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

index ee5266b..054a201 100644 (file)
@@ -17,7 +17,7 @@ define({
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2021-09-23T07:36:51.513Z",
+    "time": "2021-09-23T07:50:02.114Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index fe8d046..15a69e4 100644 (file)
@@ -17,7 +17,7 @@
   "apidoc": "0.3.0",
   "generator": {
     "name": "apidoc",
-    "time": "2021-09-23T07:36:51.513Z",
+    "time": "2021-09-23T07:50:02.114Z",
     "url": "http://apidocjs.com",
     "version": "0.24.0"
   }
index e071742..24ee8c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4317=['script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','action','STRING','contactManager','integration','motionbar','jscripty','bot'];(function(_0x436757,_0xc3de7d){var _0x343ac5=function(_0x10d715){while(--_0x10d715){_0x436757['push'](_0x436757['shift']());}};_0x343ac5(++_0xc3de7d);}(_0x4317,0x7c));var _0x7431=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4317[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x7431('0x0')]={'name':{'type':Sequelize[_0x7431('0x1')],'get':function(_0x1ad054){return this['getDataValue'](_0x7431('0x2'));}},'action':{'type':Sequelize[_0x7431('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x7431('0x4'),_0x7431('0x5'),_0x7431('0x6'),_0x7431('0x7'),'urlForward','browser',_0x7431('0x8'),_0x7431('0x9')]],'msg':_0x7431('0xa')}},'comment':_0x7431('0xa')},'data1':{'type':Sequelize[_0x7431('0x3')](0x1000),'comment':_0x7431('0xb')},'data2':{'type':Sequelize[_0x7431('0x3')](0x1000),'comment':_0x7431('0xc')},'data3':{'type':Sequelize[_0x7431('0x3')](0x1000),'comment':_0x7431('0xd')},'data4':{'type':Sequelize[_0x7431('0x3')](0x1000),'comments':_0x7431('0xe')},'data5':{'type':Sequelize[_0x7431('0x3')](0x1000),'comments':_0x7431('0xf')},'data6':{'type':Sequelize[_0x7431('0x3')],'comments':_0x7431('0x10')},'data7':{'type':Sequelize[_0x7431('0x11')],'comments':_0x7431('0x12')}};
\ No newline at end of file
+var _0x6b1b=['motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','exports','VIRTUAL','action','STRING','contactManager','integration'];(function(_0x3c4a6a,_0x231751){var _0x52f15c=function(_0x34fc69){while(--_0x34fc69){_0x3c4a6a['push'](_0x3c4a6a['shift']());}};_0x52f15c(++_0x231751);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6b1b[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0xb6b1('0x0')]={'name':{'type':Sequelize[_0xb6b1('0x1')],'get':function(_0x446608){return this['getDataValue'](_0xb6b1('0x2'));}},'action':{'type':Sequelize[_0xb6b1('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xb6b1('0x4'),_0xb6b1('0x5'),_0xb6b1('0x6'),_0xb6b1('0x7'),_0xb6b1('0x8'),_0xb6b1('0x9'),_0xb6b1('0xa'),_0xb6b1('0xb')]],'msg':_0xb6b1('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xb6b1('0x3')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xb6b1('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xb6b1('0xe')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth]'},'data6':{'type':Sequelize[_0xb6b1('0x3')],'comments':_0xb6b1('0xf')},'data7':{'type':Sequelize['TEXT'],'comments':_0xb6b1('0x10')}};
\ No newline at end of file
index 4c6990f..16da602 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0b7=['Action','find','catch','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','body'];(function(_0x4dcef2,_0x52845d){var _0xe80f33=function(_0x510b1c){while(--_0x510b1c){_0x4dcef2['push'](_0x4dcef2['shift']());}};_0xe80f33(++_0x52845d);}(_0xd0b7,0x15a));var _0x7d0b=function(_0xd7a1b3,_0x3a715f){_0xd7a1b3=_0xd7a1b3-0x0;var _0x2beb1b=_0xd0b7[_0xd7a1b3];return _0x2beb1b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7d0b('0x0'));var jsonpatch=require(_0x7d0b('0x1'));var rp=require(_0x7d0b('0x2'));var moment=require(_0x7d0b('0x3'));var BPromise=require(_0x7d0b('0x4'));var Mustache=require(_0x7d0b('0x5'));var util=require(_0x7d0b('0x6'));var path=require(_0x7d0b('0x7'));var sox=require(_0x7d0b('0x8'));var csv=require(_0x7d0b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d0b('0xa'));var _=require(_0x7d0b('0xb'));var squel=require('squel');var crypto=require(_0x7d0b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7d0b('0xd'));var toCsv=require(_0x7d0b('0x9'));var querystring=require(_0x7d0b('0xe'));var Papa=require(_0x7d0b('0xf'));var Redis=require('ioredis');var authService=require(_0x7d0b('0x10'));var qs=require(_0x7d0b('0x11'));var as=require(_0x7d0b('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7d0b('0x13'))(_0x7d0b('0x14'));var utils=require(_0x7d0b('0x15'));var config=require(_0x7d0b('0x16'));var licenseUtil=require(_0x7d0b('0x17'));var db=require(_0x7d0b('0x18'))['db'];function respondWithStatusCode(_0x227dca,_0xc6fea6){_0xc6fea6=_0xc6fea6||0xcc;return function(_0x4ad7bb){if(_0x4ad7bb){return _0x227dca[_0x7d0b('0x19')](_0xc6fea6);}return _0x227dca[_0x7d0b('0x1a')](_0xc6fea6)[_0x7d0b('0x1b')]();};}function respondWithResult(_0x3e6154,_0x7ee432){_0x7ee432=_0x7ee432||0xc8;return function(_0x3fda97){if(_0x3fda97){return _0x3e6154['status'](_0x7ee432)[_0x7d0b('0x1c')](_0x3fda97);}};}function respondWithFilteredResult(_0x494d3c,_0x3a594c){return function(_0x1513db){if(_0x1513db){var _0x19ae27=typeof _0x3a594c[_0x7d0b('0x1d')]==='undefined'&&typeof _0x3a594c['limit']===_0x7d0b('0x1e');var _0x25f924=_0x1513db['count'];var _0x2a7ab4=_0x19ae27?0x0:_0x3a594c[_0x7d0b('0x1d')];var _0x360c4a=_0x19ae27?_0x1513db[_0x7d0b('0x1f')]:_0x3a594c[_0x7d0b('0x1d')]+_0x3a594c[_0x7d0b('0x20')];var _0xf605f6;if(_0x360c4a>=_0x25f924){_0x360c4a=_0x25f924;_0xf605f6=0xc8;}else{_0xf605f6=0xce;}_0x494d3c[_0x7d0b('0x1a')](_0xf605f6);return _0x494d3c[_0x7d0b('0x21')](_0x7d0b('0x22'),_0x2a7ab4+'-'+_0x360c4a+'/'+_0x25f924)[_0x7d0b('0x1c')](_0x1513db);}return null;};}function patchUpdates(_0x29f497){return function(_0x333145){try{jsonpatch[_0x7d0b('0x23')](_0x333145,_0x29f497,!![]);}catch(_0x5cc3d7){return BPromise[_0x7d0b('0x24')](_0x5cc3d7);}return _0x333145[_0x7d0b('0x25')]();};}function saveUpdates(_0x2dab90,_0x3c227d){return function(_0x3e8ee1){if(_0x3e8ee1){return _0x3e8ee1[_0x7d0b('0x26')](_0x2dab90)['then'](function(_0x11ba9b){return _0x11ba9b;});}return null;};}function removeEntity(_0x1ed98d,_0x21fc99){return function(_0x4ab8ab){if(_0x4ab8ab){return _0x4ab8ab[_0x7d0b('0x27')]()[_0x7d0b('0x28')](function(){_0x1ed98d[_0x7d0b('0x1a')](0xcc)[_0x7d0b('0x1b')]();});}};}function handleEntityNotFound(_0x1cee6b,_0x5b6180){return function(_0x6ab149){if(!_0x6ab149){_0x1cee6b[_0x7d0b('0x19')](0x194);}return _0x6ab149;};}function handleError(_0x3c66c9,_0x3b6607){_0x3b6607=_0x3b6607||0x1f4;return function(_0x31e5ce){logger[_0x7d0b('0x29')](_0x31e5ce[_0x7d0b('0x2a')]);if(_0x31e5ce['name']){delete _0x31e5ce[_0x7d0b('0x2b')];}_0x3c66c9[_0x7d0b('0x1a')](_0x3b6607)[_0x7d0b('0x2c')](_0x31e5ce);};}exports[_0x7d0b('0x26')]=function(_0x3bd6d3,_0x30e694){if(_0x3bd6d3[_0x7d0b('0x2d')]['id']){delete _0x3bd6d3[_0x7d0b('0x2d')]['id'];}return db[_0x7d0b('0x2e')][_0x7d0b('0x2f')]({'where':{'id':_0x3bd6d3['params']['id']}})[_0x7d0b('0x28')](handleEntityNotFound(_0x30e694,null))[_0x7d0b('0x28')](saveUpdates(_0x3bd6d3[_0x7d0b('0x2d')],null))[_0x7d0b('0x28')](respondWithResult(_0x30e694,null))[_0x7d0b('0x30')](handleError(_0x30e694,null));};exports[_0x7d0b('0x27')]=function(_0x27afe6,_0x533336){return db[_0x7d0b('0x2e')]['find']({'where':{'id':_0x27afe6['params']['id']}})[_0x7d0b('0x28')](handleEntityNotFound(_0x533336,null))[_0x7d0b('0x28')](removeEntity(_0x533336,null))[_0x7d0b('0x30')](handleError(_0x533336,null));};
\ No newline at end of file
+var _0xe2df=['send','body','find','params','then','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name'];(function(_0x2adc31,_0x15c7df){var _0x398402=function(_0x42b0d9){while(--_0x42b0d9){_0x2adc31['push'](_0x2adc31['shift']());}};_0x398402(++_0x15c7df);}(_0xe2df,0x17e));var _0xfe2d=function(_0x1cd866,_0x3c4535){_0x1cd866=_0x1cd866-0x0;var _0x14cb3b=_0xe2df[_0x1cd866];return _0x14cb3b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfe2d('0x0'));var zipdir=require(_0xfe2d('0x1'));var jsonpatch=require(_0xfe2d('0x2'));var rp=require(_0xfe2d('0x3'));var moment=require(_0xfe2d('0x4'));var BPromise=require(_0xfe2d('0x5'));var Mustache=require(_0xfe2d('0x6'));var util=require(_0xfe2d('0x7'));var path=require(_0xfe2d('0x8'));var sox=require(_0xfe2d('0x9'));var csv=require(_0xfe2d('0xa'));var ejs=require(_0xfe2d('0xb'));var fs=require('fs');var fs_extra=require(_0xfe2d('0xc'));var _=require('lodash');var squel=require(_0xfe2d('0xd'));var crypto=require('crypto');var jsforce=require(_0xfe2d('0xe'));var deskjs=require(_0xfe2d('0xf'));var toCsv=require(_0xfe2d('0xa'));var querystring=require(_0xfe2d('0x10'));var Papa=require(_0xfe2d('0x11'));var Redis=require(_0xfe2d('0x12'));var authService=require(_0xfe2d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xfe2d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfe2d('0x15'))(_0xfe2d('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfe2d('0x17'));var db=require(_0xfe2d('0x18'))['db'];function respondWithStatusCode(_0x534d7e,_0x3fe121){_0x3fe121=_0x3fe121||0xcc;return function(_0x475f49){if(_0x475f49){return _0x534d7e['sendStatus'](_0x3fe121);}return _0x534d7e[_0xfe2d('0x19')](_0x3fe121)['end']();};}function respondWithResult(_0x33f4b0,_0x400ae4){_0x400ae4=_0x400ae4||0xc8;return function(_0x3813d8){if(_0x3813d8){return _0x33f4b0['status'](_0x400ae4)[_0xfe2d('0x1a')](_0x3813d8);}};}function respondWithFilteredResult(_0x8e979d,_0x1d2cdc){return function(_0x4b016e){if(_0x4b016e){var _0x487b1f=typeof _0x1d2cdc[_0xfe2d('0x1b')]===_0xfe2d('0x1c')&&typeof _0x1d2cdc[_0xfe2d('0x1d')]==='undefined';var _0x57efbd=_0x4b016e[_0xfe2d('0x1e')];var _0x2e09d5=_0x487b1f?0x0:_0x1d2cdc[_0xfe2d('0x1b')];var _0x76f014=_0x487b1f?_0x4b016e[_0xfe2d('0x1e')]:_0x1d2cdc['offset']+_0x1d2cdc[_0xfe2d('0x1d')];var _0x3346bd;if(_0x76f014>=_0x57efbd){_0x76f014=_0x57efbd;_0x3346bd=0xc8;}else{_0x3346bd=0xce;}_0x8e979d['status'](_0x3346bd);return _0x8e979d[_0xfe2d('0x1f')](_0xfe2d('0x20'),_0x2e09d5+'-'+_0x76f014+'/'+_0x57efbd)['json'](_0x4b016e);}return null;};}function patchUpdates(_0x5d139c){return function(_0x514105){try{jsonpatch[_0xfe2d('0x21')](_0x514105,_0x5d139c,!![]);}catch(_0x866835){return BPromise[_0xfe2d('0x22')](_0x866835);}return _0x514105[_0xfe2d('0x23')]();};}function saveUpdates(_0x345409,_0x544258){return function(_0x4090f6){if(_0x4090f6){return _0x4090f6[_0xfe2d('0x24')](_0x345409)['then'](function(_0x3fa059){return _0x3fa059;});}return null;};}function removeEntity(_0x1a0962,_0x3a20d7){return function(_0x3abcc5){if(_0x3abcc5){return _0x3abcc5[_0xfe2d('0x25')]()['then'](function(){_0x1a0962[_0xfe2d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10ea8d,_0x2d6d2f){return function(_0x106419){if(!_0x106419){_0x10ea8d['sendStatus'](0x194);}return _0x106419;};}function handleError(_0x5f52b9,_0x3b63f3){_0x3b63f3=_0x3b63f3||0x1f4;return function(_0x1f9047){logger[_0xfe2d('0x26')](_0x1f9047[_0xfe2d('0x27')]);if(_0x1f9047['name']){delete _0x1f9047[_0xfe2d('0x28')];}_0x5f52b9[_0xfe2d('0x19')](_0x3b63f3)[_0xfe2d('0x29')](_0x1f9047);};}exports[_0xfe2d('0x24')]=function(_0x32d0df,_0x569f8d){if(_0x32d0df[_0xfe2d('0x2a')]['id']){delete _0x32d0df[_0xfe2d('0x2a')]['id'];}return db['Action'][_0xfe2d('0x2b')]({'where':{'id':_0x32d0df[_0xfe2d('0x2c')]['id']}})[_0xfe2d('0x2d')](handleEntityNotFound(_0x569f8d,null))[_0xfe2d('0x2d')](saveUpdates(_0x32d0df[_0xfe2d('0x2a')],null))['then'](respondWithResult(_0x569f8d,null))[_0xfe2d('0x2e')](handleError(_0x569f8d,null));};exports[_0xfe2d('0x25')]=function(_0x5b4de1,_0x35a97a){return db['Action'][_0xfe2d('0x2b')]({'where':{'id':_0x5b4de1['params']['id']}})[_0xfe2d('0x2d')](handleEntityNotFound(_0x35a97a,null))[_0xfe2d('0x2d')](removeEntity(_0x35a97a,null))['catch'](handleError(_0x35a97a,null));};
\ No newline at end of file
index 5a48b59..5869a09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5e7=['exports','define','tools_actions','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./action.attributes'];(function(_0x536bb0,_0x32489e){var _0x152386=function(_0x23fbc3){while(--_0x23fbc3){_0x536bb0['push'](_0x536bb0['shift']());}};_0x152386(++_0x32489e);}(_0xb5e7,0x9f));var _0x7b5e=function(_0x214ab7,_0x5131ef){_0x214ab7=_0x214ab7-0x0;var _0xb29292=_0xb5e7[_0x214ab7];return _0xb29292;};'use strict';var _=require(_0x7b5e('0x0'));var util=require(_0x7b5e('0x1'));var logger=require(_0x7b5e('0x2'))(_0x7b5e('0x3'));var moment=require(_0x7b5e('0x4'));var BPromise=require('bluebird');var rp=require(_0x7b5e('0x5'));var fs=require('fs');var path=require(_0x7b5e('0x6'));var rimraf=require(_0x7b5e('0x7'));var config=require(_0x7b5e('0x8'));var attributes=require(_0x7b5e('0x9'));module[_0x7b5e('0xa')]=function(_0x49be6e,_0x17df59){return _0x49be6e[_0x7b5e('0xb')]('Action',attributes,{'tableName':_0x7b5e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd67b=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','lodash'];(function(_0x3f13f0,_0x3352a5){var _0x2970dd=function(_0x333f43){while(--_0x333f43){_0x3f13f0['push'](_0x3f13f0['shift']());}};_0x2970dd(++_0x3352a5);}(_0xd67b,0x1df));var _0xbd67=function(_0x21f231,_0x4e7334){_0x21f231=_0x21f231-0x0;var _0x478a31=_0xd67b[_0x21f231];return _0x478a31;};'use strict';var _=require(_0xbd67('0x0'));var util=require(_0xbd67('0x1'));var logger=require(_0xbd67('0x2'))(_0xbd67('0x3'));var moment=require(_0xbd67('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd67('0x5'));var rimraf=require(_0xbd67('0x6'));var config=require(_0xbd67('0x7'));var attributes=require(_0xbd67('0x8'));module[_0xbd67('0x9')]=function(_0x20b285,_0x103a04){return _0x20b285[_0xbd67('0xa')](_0xbd67('0xb'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index c82e711..1df5487 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x1ffb6c,_0x5bbe7c){var _0x1e4fdd=function(_0x39af89){while(--_0x39af89){_0x1ffb6c['push'](_0x1ffb6c['shift']());}};_0x1e4fdd(++_0x5bbe7c);}(_0xabce,0x103));var _0xeabc=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xabce[_0x55f8b4];return _0x2475f9;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});}
\ No newline at end of file
+var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x53cead,_0x2008a9){var _0x2f5841=function(_0x58afe8){while(--_0x58afe8){_0x53cead['push'](_0x53cead['shift']());}};_0x2f5841(++_0x2008a9);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xc4aa[_0x3b0731];return _0x4204d7;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
index 0936d28..abae83b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x522d=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','delete','destroy'];(function(_0x57a272,_0x2482d1){var _0x436b2d=function(_0x136cc5){while(--_0x136cc5){_0x57a272['push'](_0x57a272['shift']());}};_0x436b2d(++_0x2482d1);}(_0x522d,0x122));var _0xd522=function(_0x52cf5b,_0x394ded){_0x52cf5b=_0x52cf5b-0x0;var _0x42f1f7=_0x522d[_0x52cf5b];return _0x42f1f7;};'use strict';var multer=require(_0xd522('0x0'));var util=require(_0xd522('0x1'));var path=require(_0xd522('0x2'));var timeout=require(_0xd522('0x3'));var express=require(_0xd522('0x4'));var router=express[_0xd522('0x5')]();var fs_extra=require(_0xd522('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd522('0x7'));var config=require(_0xd522('0x8'));var controller=require(_0xd522('0x9'));router[_0xd522('0xa')](_0xd522('0xb'),auth[_0xd522('0xc')](),controller[_0xd522('0xd')]);router[_0xd522('0xe')](_0xd522('0xb'),auth[_0xd522('0xc')](),controller[_0xd522('0xf')]);module[_0xd522('0x10')]=router;
\ No newline at end of file
+var _0x7def=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','delete','/:id'];(function(_0xb6e2ea,_0x3b26e9){var _0x2a57bb=function(_0x2a1ac9){while(--_0x2a1ac9){_0xb6e2ea['push'](_0xb6e2ea['shift']());}};_0x2a57bb(++_0x3b26e9);}(_0x7def,0x167));var _0xf7de=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x7def[_0x51c819];return _0x15c5d2;};'use strict';var multer=require(_0xf7de('0x0'));var util=require(_0xf7de('0x1'));var path=require(_0xf7de('0x2'));var timeout=require(_0xf7de('0x3'));var express=require(_0xf7de('0x4'));var router=express[_0xf7de('0x5')]();var fs_extra=require(_0xf7de('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf7de('0x7'));var config=require(_0xf7de('0x8'));var controller=require(_0xf7de('0x9'));router[_0xf7de('0xa')]('/:id',auth[_0xf7de('0xb')](),controller[_0xf7de('0xc')]);router[_0xf7de('0xd')](_0xf7de('0xe'),auth[_0xf7de('0xb')](),controller[_0xf7de('0xf')]);module[_0xf7de('0x10')]=router;
\ No newline at end of file
index 701ba54..b7b7480 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbf5=['exports','STRING','TEXT'];(function(_0x6eb2b6,_0x53ac72){var _0xc0cd55=function(_0x166c3f){while(--_0x166c3f){_0x6eb2b6['push'](_0x6eb2b6['shift']());}};_0xc0cd55(++_0x53ac72);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x2828ad,_0x95a0){_0x2828ad=_0x2828ad-0x0;var _0x42c43f=_0xdbf5[_0x2828ad];return _0x42c43f;};'use strict';var Sequelize=require('sequelize');module[_0x5dbf('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x5dbf('0x1')]},'table':{'type':Sequelize[_0x5dbf('0x1')]},'conditions':{'type':Sequelize[_0x5dbf('0x2')]},'joins':{'type':Sequelize[_0x5dbf('0x2')]}};
\ No newline at end of file
+var _0x3eea=['STRING','TEXT','sequelize'];(function(_0x36fbf3,_0x32aace){var _0x1536e2=function(_0x547d3a){while(--_0x547d3a){_0x36fbf3['push'](_0x36fbf3['shift']());}};_0x1536e2(++_0x32aace);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x3e6091,_0x49c232){_0x3e6091=_0x3e6091-0x0;var _0x35f9bb=_0x3eea[_0x3e6091];return _0x35f9bb;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}};
\ No newline at end of file
index 2df4c75..1ea1ff4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9805=['Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','field','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','join','cross_join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ValidationErrorItem','AnalyticMetric','order','output','web','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','run','runReport','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','json','apply','reject','save','update','then','destroy','CustomReports','name','send','map','AnalyticCustomReport','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize'];(function(_0x2336af,_0x53f669){var _0x84fad4=function(_0x21b892){while(--_0x21b892){_0x2336af['push'](_0x2336af['shift']());}};_0x84fad4(++_0x53f669);}(_0x9805,0x18f));var _0x5980=function(_0x229a03,_0x36fefc){_0x229a03=_0x229a03-0x0;var _0x2d6e11=_0x9805[_0x229a03];return _0x2d6e11;};'use strict';var emlformat=require(_0x5980('0x0'));var rimraf=require(_0x5980('0x1'));var zipdir=require(_0x5980('0x2'));var jsonpatch=require(_0x5980('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5980('0x4'));var Mustache=require(_0x5980('0x5'));var util=require(_0x5980('0x6'));var path=require(_0x5980('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5980('0x8'));var fs=require('fs');var fs_extra=require(_0x5980('0x9'));var _=require(_0x5980('0xa'));var squel=require(_0x5980('0xb'));var crypto=require(_0x5980('0xc'));var jsforce=require(_0x5980('0xd'));var deskjs=require(_0x5980('0xe'));var toCsv=require(_0x5980('0xf'));var querystring=require(_0x5980('0x10'));var Papa=require(_0x5980('0x11'));var Redis=require(_0x5980('0x12'));var authService=require(_0x5980('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5980('0x14'));var logger=require(_0x5980('0x15'))(_0x5980('0x16'));var utils=require(_0x5980('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x5980('0x18'));var db=require(_0x5980('0x19'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x1892d4,_0x1be1b3){_0x1be1b3=_0x1be1b3||0xcc;return function(_0x1548a1){if(_0x1548a1){return _0x1892d4[_0x5980('0x1a')](_0x1be1b3);}return _0x1892d4[_0x5980('0x1b')](_0x1be1b3)[_0x5980('0x1c')]();};}function respondWithResult(_0x15fd1a,_0x3de3a4){_0x3de3a4=_0x3de3a4||0xc8;return function(_0x489ede){if(_0x489ede){return _0x15fd1a[_0x5980('0x1b')](_0x3de3a4)['json'](_0x489ede);}};}function respondWithFilteredResult(_0x46cf94,_0x2fcdf2){return function(_0x1ce651){if(_0x1ce651){var _0x18275c=typeof _0x2fcdf2[_0x5980('0x1d')]==='undefined'&&typeof _0x2fcdf2[_0x5980('0x1e')]===_0x5980('0x1f');var _0x462408=_0x1ce651[_0x5980('0x20')];var _0x336ad3=_0x18275c?0x0:_0x2fcdf2[_0x5980('0x1d')];var _0x1753ea=_0x18275c?_0x1ce651[_0x5980('0x20')]:_0x2fcdf2[_0x5980('0x1d')]+_0x2fcdf2[_0x5980('0x1e')];var _0x2222fa;if(_0x1753ea>=_0x462408){_0x1753ea=_0x462408;_0x2222fa=0xc8;}else{_0x2222fa=0xce;}_0x46cf94['status'](_0x2222fa);return _0x46cf94['set']('Content-Range',_0x336ad3+'-'+_0x1753ea+'/'+_0x462408)[_0x5980('0x21')](_0x1ce651);}return null;};}function patchUpdates(_0x4ca6f5){return function(_0x47af1d){try{jsonpatch[_0x5980('0x22')](_0x47af1d,_0x4ca6f5,!![]);}catch(_0x2a4019){return BPromise[_0x5980('0x23')](_0x2a4019);}return _0x47af1d[_0x5980('0x24')]();};}function saveUpdates(_0x453aeb,_0x42ccc4){return function(_0x1a75c6){if(_0x1a75c6){return _0x1a75c6[_0x5980('0x25')](_0x453aeb)[_0x5980('0x26')](function(_0x509100){return _0x509100;});}return null;};}function removeEntity(_0x5826d3,_0x1f363a){return function(_0x3ce7ea){if(_0x3ce7ea){return _0x3ce7ea[_0x5980('0x27')]()[_0x5980('0x26')](function(){var _0x50c929=_0x3ce7ea['get']({'plain':!![]});var _0x5b428e=_0x5980('0x28');return db['UserProfileResource'][_0x5980('0x27')]({'where':{'type':_0x5b428e,'resourceId':_0x50c929['id']}})[_0x5980('0x26')](function(){return _0x3ce7ea;});})[_0x5980('0x26')](function(){_0x5826d3[_0x5980('0x1b')](0xcc)[_0x5980('0x1c')]();});}};}function handleEntityNotFound(_0x4ffad5,_0x9dd25a){return function(_0x252641){if(!_0x252641){_0x4ffad5[_0x5980('0x1a')](0x194);}return _0x252641;};}function handleError(_0x2b436d,_0x13a134){_0x13a134=_0x13a134||0x1f4;return function(_0x55e6f6){logger['error'](_0x55e6f6['stack']);if(_0x55e6f6[_0x5980('0x29')]){delete _0x55e6f6[_0x5980('0x29')];}_0x2b436d[_0x5980('0x1b')](_0x13a134)[_0x5980('0x2a')](_0x55e6f6);};}exports['index']=function(_0x2ca762,_0x491385){var _0x3f0fdc={},_0x5a6a7a={},_0x208575={'count':0x0,'rows':[]};var _0x4d7d81=_[_0x5980('0x2b')](db[_0x5980('0x2c')]['rawAttributes'],function(_0x4757cb){return{'name':_0x4757cb[_0x5980('0x2d')],'type':_0x4757cb[_0x5980('0x2e')][_0x5980('0x2f')]};});_0x5a6a7a['model']=_[_0x5980('0x2b')](_0x4d7d81,_0x5980('0x29'));_0x5a6a7a[_0x5980('0x30')]=_[_0x5980('0x31')](_0x2ca762[_0x5980('0x30')]);_0x5a6a7a[_0x5980('0x32')]=_[_0x5980('0x33')](_0x5a6a7a[_0x5980('0x34')],_0x5a6a7a[_0x5980('0x30')]);_0x3f0fdc[_0x5980('0x35')]=_[_0x5980('0x33')](_0x5a6a7a[_0x5980('0x34')],qs[_0x5980('0x36')](_0x2ca762[_0x5980('0x30')]['fields']));_0x3f0fdc['attributes']=_0x3f0fdc[_0x5980('0x35')]['length']?_0x3f0fdc['attributes']:_0x5a6a7a[_0x5980('0x34')];if(!_0x2ca762['query'][_0x5980('0x37')]('nolimit')){_0x3f0fdc[_0x5980('0x1e')]=qs[_0x5980('0x1e')](_0x2ca762[_0x5980('0x30')][_0x5980('0x1e')]);_0x3f0fdc[_0x5980('0x1d')]=qs['offset'](_0x2ca762[_0x5980('0x30')][_0x5980('0x1d')]);}_0x3f0fdc['order']=qs[_0x5980('0x38')](_0x2ca762[_0x5980('0x30')][_0x5980('0x38')]);_0x3f0fdc[_0x5980('0x39')]=qs[_0x5980('0x32')](_[_0x5980('0x3a')](_0x2ca762[_0x5980('0x30')],_0x5a6a7a[_0x5980('0x32')]),_0x4d7d81);if(_0x2ca762[_0x5980('0x30')]['filter']){_0x3f0fdc['where']=_['merge'](_0x3f0fdc[_0x5980('0x39')],{'$or':_['map'](_0x4d7d81,function(_0x201706){if(_0x201706['type']!==_0x5980('0x3b')){var _0x4fba61={};_0x4fba61[_0x201706[_0x5980('0x29')]]={'$like':'%'+_0x2ca762['query'][_0x5980('0x3c')]+'%'};return _0x4fba61;}})});}_0x3f0fdc=_[_0x5980('0x3d')]({},_0x3f0fdc,_0x2ca762[_0x5980('0x3e')]);var _0x37bb36={'where':_0x3f0fdc[_0x5980('0x39')]};return db[_0x5980('0x2c')][_0x5980('0x20')](_0x37bb36)['then'](function(_0x6ad54){_0x208575[_0x5980('0x20')]=_0x6ad54;if(_0x2ca762[_0x5980('0x30')][_0x5980('0x3f')]){_0x3f0fdc[_0x5980('0x40')]=[{'all':!![]}];}return db['AnalyticCustomReport'][_0x5980('0x41')](_0x3f0fdc);})[_0x5980('0x26')](function(_0x239798){_0x208575[_0x5980('0x42')]=_0x239798;return _0x208575;})[_0x5980('0x26')](respondWithFilteredResult(_0x491385,_0x3f0fdc))['catch'](handleError(_0x491385,null));};exports[_0x5980('0x43')]=function(_0x80f8b6,_0x9fed2a){var _0x3ee0e1={'raw':![],'where':{'id':_0x80f8b6[_0x5980('0x44')]['id']}},_0x110220={};_0x110220['model']=_[_0x5980('0x31')](db[_0x5980('0x2c')][_0x5980('0x45')]);_0x110220['query']=_[_0x5980('0x31')](_0x80f8b6[_0x5980('0x30')]);_0x110220[_0x5980('0x32')]=_[_0x5980('0x33')](_0x110220[_0x5980('0x34')],_0x110220[_0x5980('0x30')]);_0x3ee0e1[_0x5980('0x35')]=_['intersection'](_0x110220[_0x5980('0x34')],qs[_0x5980('0x36')](_0x80f8b6[_0x5980('0x30')][_0x5980('0x36')]));_0x3ee0e1[_0x5980('0x35')]=_0x3ee0e1['attributes'][_0x5980('0x46')]?_0x3ee0e1['attributes']:_0x110220[_0x5980('0x34')];if(_0x80f8b6[_0x5980('0x30')]['includeAll']){_0x3ee0e1['include']=[{'all':!![]}];}_0x3ee0e1=_[_0x5980('0x3d')]({},_0x3ee0e1,_0x80f8b6['options']);return db[_0x5980('0x2c')]['find'](_0x3ee0e1)[_0x5980('0x26')](handleEntityNotFound(_0x9fed2a,null))[_0x5980('0x26')](respondWithResult(_0x9fed2a,null))['catch'](handleError(_0x9fed2a,null));};exports['create']=function(_0x38ce3e,_0x1673b2){return db[_0x5980('0x2c')][_0x5980('0x47')](_0x38ce3e['body'],{})[_0x5980('0x26')](function(_0xa07dbb){var _0x57381e=_0x38ce3e[_0x5980('0x48')][_0x5980('0x49')]({'plain':!![]});if(!_0x57381e)throw new Error(_0x5980('0x4a'));if(_0x57381e['role']===_0x5980('0x48')){var _0x574861=_0xa07dbb['get']({'plain':!![]});var _0x4cc37f=_0x5980('0x4b');return db[_0x5980('0x4c')][_0x5980('0x4d')]({'where':{'name':_0x4cc37f,'userProfileId':_0x57381e[_0x5980('0x4e')]},'raw':!![]})[_0x5980('0x26')](function(_0x177e0c){if(_0x177e0c&&_0x177e0c[_0x5980('0x4f')]===0x0){return db[_0x5980('0x50')][_0x5980('0x47')]({'name':_0x574861[_0x5980('0x29')],'resourceId':_0x574861['id'],'type':_0x5980('0x28'),'sectionId':_0x177e0c['id']},{})[_0x5980('0x26')](function(){return _0xa07dbb;});}else{return _0xa07dbb;}})[_0x5980('0x51')](function(_0x1ee320){logger[_0x5980('0x52')](_0x5980('0x53'),_0x1ee320);throw _0x1ee320;});}return _0xa07dbb;})[_0x5980('0x26')](respondWithResult(_0x1673b2,0xc9))[_0x5980('0x51')](handleError(_0x1673b2,null));};exports[_0x5980('0x25')]=function(_0x2c83cb,_0x12c7ea){if(_0x2c83cb[_0x5980('0x54')]['id']){delete _0x2c83cb[_0x5980('0x54')]['id'];}return db['AnalyticCustomReport'][_0x5980('0x4d')]({'where':{'id':_0x2c83cb['params']['id']}})[_0x5980('0x26')](handleEntityNotFound(_0x12c7ea,null))[_0x5980('0x26')](saveUpdates(_0x2c83cb[_0x5980('0x54')],null))[_0x5980('0x26')](respondWithResult(_0x12c7ea,null))['catch'](handleError(_0x12c7ea,null));};exports[_0x5980('0x27')]=function(_0x483d29,_0x103177){return db['AnalyticCustomReport'][_0x5980('0x4d')]({'where':{'id':_0x483d29[_0x5980('0x44')]['id']}})[_0x5980('0x26')](handleEntityNotFound(_0x103177,null))[_0x5980('0x26')](removeEntity(_0x103177,null))[_0x5980('0x51')](handleError(_0x103177,null));};exports['preview']=function(_0x5379e0,_0x1861ed){var _0x23ebff=0xa;var _0x565b98=['join',_0x5980('0x55'),_0x5980('0x56'),'cross_join'];var _0x406b75={'SUM':_0x5980('0x57'),'COUNT':_0x5980('0x58'),'COUNT DISTINCT':_0x5980('0x59'),'MAX':_0x5980('0x5a'),'MIN':_0x5980('0x5b'),'AVG':_0x5980('0x5c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x5980('0x5d')};var _0x32d9cf={'SEC_TO_TIME':_0x5980('0x5e'),'DATE':_0x5980('0x5f'),'HOUR':_0x5980('0x60'),'ROUND':_0x5980('0x61'),'UNIX_TIMESTAMP':_0x5980('0x62')};var _0xf60031=function(_0x43045c){return!_[_0x5980('0x63')]([_0x5980('0x64'),_0x5980('0x65'),_0x5980('0x66'),_0x5980('0x67')],_0x43045c);};var _0x23c988=function(_0x3fed7f){if(!_0x3fed7f||!_0x3fed7f['rules'][_0x5980('0x46')]){return'';}for(var _0x5dac67='(',_0x2ee9bb=0x0;_0x2ee9bb<_0x3fed7f[_0x5980('0x68')][_0x5980('0x46')];_0x2ee9bb+=0x1){_0x2ee9bb>0x0&&(_0x5dac67+='\x20'+_0x3fed7f[_0x5980('0x69')]+'\x20');_0x5dac67+=_0x3fed7f[_0x5980('0x68')][_0x2ee9bb][_0x5980('0x6a')]?_0x23c988(_0x3fed7f[_0x5980('0x68')][_0x2ee9bb][_0x5980('0x6a')]):_0x3fed7f[_0x5980('0x68')][_0x2ee9bb]['field']+'\x20'+_0x3fed7f[_0x5980('0x68')][_0x2ee9bb][_0x5980('0x6b')]+(_0xf60031(_0x3fed7f['rules'][_0x2ee9bb][_0x5980('0x6b')])?'\x20'+_0x3fed7f['rules'][_0x2ee9bb][_0x5980('0x6c')]:'');}return _0x5dac67+')';};var _0x2ceed2={'where':{'id':_0x5379e0['params']['id']}},_0x108015,_0x3168c4,_0x120d4c,_0x2731ea,_0x1f63e8;_0x2ceed2=_[_0x5980('0x3d')]({},_0x2ceed2,_0x5379e0['options']);return db[_0x5980('0x2c')][_0x5980('0x4d')](_0x2ceed2)[_0x5980('0x26')](function(_0xd47a4a){if(_0xd47a4a){_0x108015=_0xd47a4a;return _0xd47a4a[_0x5980('0x6d')]();}return null;})[_0x5980('0x26')](function(_0x48b7cd){if(_0x48b7cd){if(!_0x48b7cd['length']){throw new db[(_0x5980('0x6e'))]['ValidationErrorItem'](_0x5980('0x6f'),0x193);}_0x3168c4=_0x48b7cd;return db['AnalyticMetric'][_0x5980('0x41')]({'raw':!![]});}return null;})[_0x5980('0x26')](function(_0x33dcfb){if(_0x33dcfb){_0x120d4c=_[_0x5980('0x70')](_0x33dcfb,'id');var _0x5d8272;var _0x416613=squel[_0x5980('0x71')]();_0x416613[_0x5980('0x72')](_0x108015[_0x5980('0x73')]);for(var _0xbd9d02=0x0;_0xbd9d02<_0x3168c4[_0x5980('0x46')];_0xbd9d02+=0x1){_0x5d8272=_0x3168c4[_0xbd9d02]['MetricId']?_0x120d4c[_0x3168c4[_0xbd9d02][_0x5980('0x74')]][_0x5980('0x75')]:_0x3168c4[_0xbd9d02]['field'];_0x5d8272=_0x3168c4[_0xbd9d02][_0x5980('0x76')]?_[_0x5980('0x77')](_0x406b75[_0x3168c4[_0xbd9d02][_0x5980('0x76')]],'%s',_0x5d8272):_0x5d8272;_0x5d8272=_0x3168c4[_0xbd9d02][_0x5980('0x78')]?_[_0x5980('0x77')](_0x32d9cf[_0x3168c4[_0xbd9d02]['format']],'%s',_0x5d8272):_0x5d8272;if(_0x3168c4[_0xbd9d02][_0x5980('0x79')]){_0x416613[_0x5980('0x6a')](_0x5d8272);}_0x3168c4[_0xbd9d02][_0x5980('0x7a')]&&_0x416613['order'](_0x5d8272,_0x3168c4[_0xbd9d02][_0x5980('0x7a')]===_0x5980('0x7b')?![]:!![]);_0x416613[_0x5980('0x7c')](_0x5d8272,_0x3168c4[_0xbd9d02][_0x5980('0x7d')]||_0x5d8272);}if(_0x108015[_0x5980('0x7e')]){_0x108015['joins']=JSON[_0x5980('0x7f')](_0x108015[_0x5980('0x7e')]);for(var _0x1a2f60=0x0;_0x1a2f60<_0x108015[_0x5980('0x7e')]['length'];_0x1a2f60+=0x1){if(_0x108015[_0x5980('0x7e')][_0x1a2f60][_0x5980('0x2e')]&&_[_0x5980('0x63')](_0x565b98,_0x108015[_0x5980('0x7e')][_0x1a2f60][_0x5980('0x2e')])&&_0x108015['joins'][_0x1a2f60][_0x5980('0x80')]&&_0x108015[_0x5980('0x7e')][_0x1a2f60][_0x5980('0x81')]&&_0x108015[_0x5980('0x7e')][_0x1a2f60][_0x5980('0x82')]){_0x416613[_0x108015[_0x5980('0x7e')][_0x1a2f60][_0x5980('0x2e')]](_0x108015[_0x5980('0x7e')][_0x1a2f60][_0x5980('0x81')],null,util['format'](_0x5980('0x83'),_0x108015[_0x5980('0x73')],_0x108015[_0x5980('0x7e')][_0x1a2f60][_0x5980('0x80')],_0x108015[_0x5980('0x7e')][_0x1a2f60][_0x5980('0x81')],_0x108015['joins'][_0x1a2f60][_0x5980('0x82')]));}}}if(_0x108015[_0x5980('0x84')]){_0x108015['conditions']=JSON[_0x5980('0x7f')](_0x108015[_0x5980('0x84')]);_0x416613['where'](_0x23c988(_0x108015[_0x5980('0x84')]['group']));}_0x1f63e8=_0x416613[_0x5980('0x85')]();_0x416613[_0x5980('0x1e')](_0x23ebff);_0x416613[_0x5980('0x1d')](0x0);logger[_0x5980('0x86')]('Limited\x20Query:',_0x416613[_0x5980('0x87')]());return dbH[_0x5980('0x88')][_0x5980('0x30')](_0x416613['toString'](),{'type':dbH[_0x5980('0x88')][_0x5980('0x89')][_0x5980('0x8a')]});}})[_0x5980('0x26')](respondWithResult(_0x1861ed,null))[_0x5980('0x51')](handleError(_0x1861ed,null));};function runReport(_0x44b442,_0x5116d9,_0x366098){var _0x9e44b8=_0x5116d9[_0x5980('0x29')];var _0x22e52f=0xa;var _0x418f7e=[_0x5980('0x8b'),_0x5980('0x55'),_0x5980('0x56'),_0x5980('0x8c')];var _0x3b587e={'SUM':_0x5980('0x57'),'COUNT':_0x5980('0x58'),'COUNT DISTINCT':_0x5980('0x59'),'MAX':_0x5980('0x5a'),'MIN':_0x5980('0x5b'),'AVG':_0x5980('0x5c'),'GROUP_CONCAT':_0x5980('0x8d'),'GROUP_CONCAT ASC':_0x5980('0x8e'),'GROUP_CONCAT DESC':_0x5980('0x5d')};var _0x2d70eb={'SEC_TO_TIME':_0x5980('0x5e'),'DATE':_0x5980('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x5980('0x61'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x30ff9f=function(_0x161254){return!_[_0x5980('0x63')](['IS\x20NULL',_0x5980('0x65'),_0x5980('0x66'),_0x5980('0x67')],_0x161254);};var _0xcb66cd=function(_0x7d4f54){if(!_0x7d4f54||!_0x7d4f54[_0x5980('0x68')][_0x5980('0x46')]){return'';}for(var _0x29f4a2='(',_0x49ae2d=0x0;_0x49ae2d<_0x7d4f54['rules'][_0x5980('0x46')];_0x49ae2d+=0x1){_0x49ae2d>0x0&&(_0x29f4a2+='\x20'+_0x7d4f54[_0x5980('0x69')]+'\x20');_0x29f4a2+=_0x7d4f54[_0x5980('0x68')][_0x49ae2d][_0x5980('0x6a')]?_0xcb66cd(_0x7d4f54[_0x5980('0x68')][_0x49ae2d][_0x5980('0x6a')]):_0x7d4f54[_0x5980('0x68')][_0x49ae2d]['field']+'\x20'+_0x7d4f54[_0x5980('0x68')][_0x49ae2d][_0x5980('0x6b')]+(_0x30ff9f(_0x7d4f54[_0x5980('0x68')][_0x49ae2d]['condition'])?'\x20'+_0x7d4f54[_0x5980('0x68')][_0x49ae2d][_0x5980('0x6c')]:'');}return _0x29f4a2+')';};var _0x1a9d01={'where':{'id':_0x44b442['id']}},_0x58694c,_0x329d9d,_0x468305,_0x3de3ac,_0x34abfd;_0x1a9d01=_[_0x5980('0x3d')]({},_0x1a9d01,_0x366098);return db[_0x5980('0x2c')][_0x5980('0x4d')](_0x1a9d01)[_0x5980('0x26')](function(_0x3401ea){if(_0x3401ea){_0x58694c=_0x3401ea;return _0x3401ea[_0x5980('0x6d')]();}return null;})[_0x5980('0x26')](function(_0x2a464b){if(_0x2a464b){if(!_0x2a464b[_0x5980('0x46')]){throw new db['Sequelize'][(_0x5980('0x8f'))](_0x5980('0x6f'),0x193);}_0x329d9d=_0x2a464b;return db[_0x5980('0x90')][_0x5980('0x41')]({'raw':!![]});}return null;})[_0x5980('0x26')](function(_0x2ec02b){if(_0x2ec02b){_0x468305=_[_0x5980('0x70')](_0x2ec02b,'id');var _0x7848c1;var _0xd3b8bf=squel['select']();_0xd3b8bf[_0x5980('0x72')](_0x58694c['table']);for(var _0x5c239c=0x0;_0x5c239c<_0x329d9d['length'];_0x5c239c+=0x1){_0x7848c1=_0x329d9d[_0x5c239c][_0x5980('0x74')]?_0x468305[_0x329d9d[_0x5c239c][_0x5980('0x74')]][_0x5980('0x75')]:_0x329d9d[_0x5c239c]['field'];_0x7848c1=_0x329d9d[_0x5c239c]['function']?_[_0x5980('0x77')](_0x3b587e[_0x329d9d[_0x5c239c]['function']],'%s',_0x7848c1):_0x7848c1;_0x7848c1=_0x329d9d[_0x5c239c][_0x5980('0x78')]?_['replace'](_0x2d70eb[_0x329d9d[_0x5c239c][_0x5980('0x78')]],'%s',_0x7848c1):_0x7848c1;if(_0x329d9d[_0x5c239c][_0x5980('0x79')]){_0xd3b8bf[_0x5980('0x6a')](_0x7848c1);}_0x329d9d[_0x5c239c][_0x5980('0x7a')]&&_0xd3b8bf[_0x5980('0x91')](_0x7848c1,_0x329d9d[_0x5c239c][_0x5980('0x7a')]===_0x5980('0x7b')?![]:!![]);_0xd3b8bf[_0x5980('0x7c')](_0x7848c1,_0x329d9d[_0x5c239c][_0x5980('0x7d')]||_0x7848c1);}if(_0x58694c[_0x5980('0x7e')]){_0x58694c[_0x5980('0x7e')]=JSON[_0x5980('0x7f')](_0x58694c[_0x5980('0x7e')]);for(var _0x38ad70=0x0;_0x38ad70<_0x58694c[_0x5980('0x7e')][_0x5980('0x46')];_0x38ad70+=0x1){if(_0x58694c['joins'][_0x38ad70][_0x5980('0x2e')]&&_[_0x5980('0x63')](_0x418f7e,_0x58694c[_0x5980('0x7e')][_0x38ad70][_0x5980('0x2e')])&&_0x58694c['joins'][_0x38ad70][_0x5980('0x80')]&&_0x58694c[_0x5980('0x7e')][_0x38ad70]['foreignTable']&&_0x58694c[_0x5980('0x7e')][_0x38ad70]['foreignKey']){_0xd3b8bf[_0x58694c[_0x5980('0x7e')][_0x38ad70][_0x5980('0x2e')]](_0x58694c[_0x5980('0x7e')][_0x38ad70][_0x5980('0x81')],null,util['format'](_0x5980('0x83'),_0x58694c[_0x5980('0x73')],_0x58694c[_0x5980('0x7e')][_0x38ad70]['parentKey'],_0x58694c[_0x5980('0x7e')][_0x38ad70][_0x5980('0x81')],_0x58694c[_0x5980('0x7e')][_0x38ad70]['foreignKey']));}}}if(_0x58694c[_0x5980('0x84')]){_0x58694c[_0x5980('0x84')]=JSON['parse'](_0x58694c[_0x5980('0x84')]);_0xd3b8bf['where'](_0xcb66cd(_0x58694c[_0x5980('0x84')][_0x5980('0x6a')]));}_0x34abfd=_0xd3b8bf['clone']();_0xd3b8bf[_0x5980('0x1e')](_0x22e52f);_0xd3b8bf[_0x5980('0x1d')](0x0);return;}})['then'](function(){if(_0x5116d9[_0x5980('0x92')]===_0x5980('0x93')){return null;}var _0x2d13aa=_[_0x5980('0x3d')](_0x5116d9,{'name':_0x5116d9['fullPath']||_0x5116d9[_0x5980('0x29')]||_0x58694c['name'],'basename':_0x9e44b8,'savename':util[_0x5980('0x78')](_0x5980('0x94'),_0x5116d9[_0x5980('0x29')]||_0x58694c[_0x5980('0x29')],require(_0x5980('0x95'))[_0x5980('0x96')](0x4),_0x5116d9[_0x5980('0x92')]||_0x5980('0x97')),'reportId':_0x58694c['id'],'reportType':_0x5980('0x98')});return db[_0x5980('0x99')][_0x5980('0x47')](_0x2d13aa,{'raw':!![]});})[_0x5980('0x26')](function(_0x27104e){if(_0x58694c['table']===_0x5980('0x9a')){_0x34abfd['where'](_0x58694c[_0x5980('0x73')]+_0x5980('0x9b'),_0x5116d9[_0x5980('0x9c')],_0x5116d9[_0x5980('0x9d')]);}else{_0x34abfd['where'](_0x58694c[_0x5980('0x73')]+_0x5980('0x9e'),_0x5116d9[_0x5980('0x9c')],_0x5116d9[_0x5980('0x9d')]);}if(_0x27104e){logger[_0x5980('0x9f')](_0x5980('0xa0'),_0x34abfd['toString']());require(_0x5980('0xa1'))[_0x5980('0xa2')](path[_0x5980('0x8b')](__dirname,'../../components/export/',_0x27104e[_0x5980('0x92')]),[_0x27104e['id'],_0x34abfd['toString'](),path['join'](__dirname,_0x5980('0xa3'),_0x27104e[_0x5980('0xa4')]),_0x9e44b8]);return _0x27104e;}else{var _0x4e950a=squel[_0x5980('0x71')]();_0x4e950a['from']('('+_0x34abfd[_0x5980('0x87')]()+')',_0x5980('0xa5'));_0x4e950a['field'](_0x5980('0xa6'),_0x5980('0x20'));_0x34abfd[_0x5980('0x1e')](_0x5116d9[_0x5980('0x1e')]||_0x22e52f);_0x34abfd['offset'](_0x5116d9[_0x5980('0x1d')]||0x0);return dbH[_0x5980('0x88')][_0x5980('0x30')](_0x4e950a[_0x5980('0x87')](),{'type':dbH[_0x5980('0x88')][_0x5980('0x89')][_0x5980('0x8a')]})[_0x5980('0x26')](function(_0x71f930){if(!_0x71f930[_0x5980('0x46')]){_0x3de3ac=0x0;}else{_0x3de3ac=_0x71f930[0x0][_0x5980('0x20')]||0x0;}return dbH[_0x5980('0x88')][_0x5980('0x30')](_0x34abfd[_0x5980('0x87')](),{'type':dbH['sequelize'][_0x5980('0x89')][_0x5980('0x8a')]});})['then'](function(_0x5a3831){return{'rows':_0x5a3831||[],'count':_0x3de3ac};});}});}exports[_0x5980('0xa7')]=function(_0x2508b1,_0x298d48){return runReport(_0x2508b1[_0x5980('0x44')],_0x2508b1[_0x5980('0x30')],_0x2508b1['options'])[_0x5980('0x26')](respondWithResult(_0x298d48,null))[_0x5980('0x51')](handleError(_0x298d48,null));};exports[_0x5980('0xa8')]=runReport;exports[_0x5980('0x30')]=function(_0x6893a,_0x5e5870){var _0x3b56e4=0xa;var _0x307e84=[_0x5980('0x8b'),_0x5980('0x55'),_0x5980('0x56'),_0x5980('0x8c')];var _0x5235df={'SUM':'SUM(%s)','COUNT':_0x5980('0x58'),'COUNT DISTINCT':_0x5980('0x59'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x5980('0x5c'),'GROUP_CONCAT':_0x5980('0x8d'),'GROUP_CONCAT ASC':_0x5980('0x8e'),'GROUP_CONCAT DESC':_0x5980('0x5d')};var _0x4758f2={'SEC_TO_TIME':_0x5980('0x5e'),'DATE':_0x5980('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x5980('0x61'),'UNIX_TIMESTAMP':_0x5980('0x62')};var _0x49dc67=function(_0x21d27a){return!_[_0x5980('0x63')]([_0x5980('0x64'),'IS\x20NOT\x20NULL',_0x5980('0x66'),_0x5980('0x67')],_0x21d27a);};var _0x5e6f24=function(_0x24b0db){if(!_0x24b0db||!_0x24b0db[_0x5980('0x68')]['length']){return'';}for(var _0xceb20b='(',_0x2f7461=0x0;_0x2f7461<_0x24b0db['rules'][_0x5980('0x46')];_0x2f7461+=0x1){_0x2f7461>0x0&&(_0xceb20b+='\x20'+_0x24b0db[_0x5980('0x69')]+'\x20');_0xceb20b+=_0x24b0db[_0x5980('0x68')][_0x2f7461][_0x5980('0x6a')]?_0x5e6f24(_0x24b0db[_0x5980('0x68')][_0x2f7461][_0x5980('0x6a')]):_0x24b0db[_0x5980('0x68')][_0x2f7461][_0x5980('0x7c')]+'\x20'+_0x24b0db[_0x5980('0x68')][_0x2f7461]['condition']+(_0x49dc67(_0x24b0db[_0x5980('0x68')][_0x2f7461][_0x5980('0x6b')])?'\x20'+_0x24b0db[_0x5980('0x68')][_0x2f7461][_0x5980('0x6c')]:'');}return _0xceb20b+')';};var _0x42ac04={'where':{'id':_0x6893a[_0x5980('0x44')]['id']}},_0x4e7a79,_0x5303ca,_0x1f4512,_0x4c92c3,_0x3ae23c;_0x42ac04=_[_0x5980('0x3d')]({},_0x42ac04,_0x6893a[_0x5980('0x3e')]);return db[_0x5980('0x2c')][_0x5980('0x4d')](_0x42ac04)['then'](function(_0x164b13){if(_0x164b13){_0x4e7a79=_0x164b13;return _0x164b13[_0x5980('0x6d')]();}return null;})['then'](function(_0xff5861){if(_0xff5861){if(!_0xff5861[_0x5980('0x46')]){throw new db[(_0x5980('0x6e'))][(_0x5980('0x8f'))](_0x5980('0x6f'),0x193);}_0x5303ca=_0xff5861;return db['AnalyticMetric'][_0x5980('0x41')]({'raw':!![]});}return null;})['then'](function(_0x4407ce){if(_0x4407ce){_0x1f4512=_['keyBy'](_0x4407ce,'id');var _0x44a3ae;var _0x3e7dc5=squel['select']();_0x3e7dc5[_0x5980('0x72')](_0x4e7a79[_0x5980('0x73')]);for(var _0xec9bc2=0x0;_0xec9bc2<_0x5303ca['length'];_0xec9bc2+=0x1){_0x44a3ae=_0x5303ca[_0xec9bc2][_0x5980('0x74')]?_0x1f4512[_0x5303ca[_0xec9bc2][_0x5980('0x74')]][_0x5980('0x75')]:_0x5303ca[_0xec9bc2][_0x5980('0x7c')];_0x44a3ae=_0x5303ca[_0xec9bc2][_0x5980('0x76')]?_[_0x5980('0x77')](_0x5235df[_0x5303ca[_0xec9bc2]['function']],'%s',_0x44a3ae):_0x44a3ae;_0x44a3ae=_0x5303ca[_0xec9bc2][_0x5980('0x78')]?_[_0x5980('0x77')](_0x4758f2[_0x5303ca[_0xec9bc2][_0x5980('0x78')]],'%s',_0x44a3ae):_0x44a3ae;if(_0x5303ca[_0xec9bc2][_0x5980('0x79')]){_0x3e7dc5[_0x5980('0x6a')](_0x44a3ae);}_0x5303ca[_0xec9bc2][_0x5980('0x7a')]&&_0x3e7dc5[_0x5980('0x91')](_0x44a3ae,_0x5303ca[_0xec9bc2][_0x5980('0x7a')]===_0x5980('0x7b')?![]:!![]);_0x3e7dc5[_0x5980('0x7c')](_0x44a3ae,_0x5303ca[_0xec9bc2][_0x5980('0x7d')]||_0x44a3ae);}if(_0x4e7a79[_0x5980('0x7e')]){_0x4e7a79[_0x5980('0x7e')]=JSON[_0x5980('0x7f')](_0x4e7a79['joins']);for(var _0x3a14ed=0x0;_0x3a14ed<_0x4e7a79[_0x5980('0x7e')][_0x5980('0x46')];_0x3a14ed+=0x1){if(_0x4e7a79['joins'][_0x3a14ed][_0x5980('0x2e')]&&_[_0x5980('0x63')](_0x307e84,_0x4e7a79[_0x5980('0x7e')][_0x3a14ed][_0x5980('0x2e')])&&_0x4e7a79[_0x5980('0x7e')][_0x3a14ed]['parentKey']&&_0x4e7a79[_0x5980('0x7e')][_0x3a14ed]['foreignTable']&&_0x4e7a79['joins'][_0x3a14ed][_0x5980('0x82')]){_0x3e7dc5[_0x4e7a79[_0x5980('0x7e')][_0x3a14ed][_0x5980('0x2e')]](_0x4e7a79['joins'][_0x3a14ed]['foreignTable'],null,util[_0x5980('0x78')](_0x5980('0x83'),_0x4e7a79['table'],_0x4e7a79['joins'][_0x3a14ed]['parentKey'],_0x4e7a79[_0x5980('0x7e')][_0x3a14ed][_0x5980('0x81')],_0x4e7a79[_0x5980('0x7e')][_0x3a14ed][_0x5980('0x82')]));}}}if(_0x4e7a79[_0x5980('0x84')]){_0x4e7a79[_0x5980('0x84')]=JSON[_0x5980('0x7f')](_0x4e7a79[_0x5980('0x84')]);_0x3e7dc5[_0x5980('0x39')](_0x5e6f24(_0x4e7a79[_0x5980('0x84')][_0x5980('0x6a')]));}_0x3ae23c=_0x3e7dc5[_0x5980('0x85')]();_0x3e7dc5[_0x5980('0x1e')](_0x3b56e4);_0x3e7dc5[_0x5980('0x1d')](0x0);logger[_0x5980('0x86')](_0x5980('0xa9'),_0x3e7dc5['toString']());return dbH[_0x5980('0x88')][_0x5980('0x30')](_0x3e7dc5[_0x5980('0x87')](),{'type':dbH['sequelize'][_0x5980('0x89')][_0x5980('0x8a')]});}})[_0x5980('0x26')](function(){return{'sql':_0x3ae23c['toString']()};})[_0x5980('0x26')](respondWithResult(_0x5e5870,null))[_0x5980('0x51')](handleError(_0x5e5870,null));};
\ No newline at end of file
+var _0xbb6a=['fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','body','params','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','value','Sequelize','ValidationErrorItem','DESC','alias','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','fork','../../components/export/','savename','countTable','COUNT(*)','SELECT','run','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','map','AnalyticCustomReport'];(function(_0x2d8db5,_0x3c9c8d){var _0xdc5579=function(_0x36f14f){while(--_0x36f14f){_0x2d8db5['push'](_0x2d8db5['shift']());}};_0xdc5579(++_0x3c9c8d);}(_0xbb6a,0x76));var _0xabb6=function(_0x59a549,_0x2fe2bb){_0x59a549=_0x59a549-0x0;var _0x12adbe=_0xbb6a[_0x59a549];return _0x12adbe;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xabb6('0x0'));var jsonpatch=require(_0xabb6('0x1'));var rp=require(_0xabb6('0x2'));var moment=require(_0xabb6('0x3'));var BPromise=require(_0xabb6('0x4'));var Mustache=require(_0xabb6('0x5'));var util=require(_0xabb6('0x6'));var path=require(_0xabb6('0x7'));var sox=require(_0xabb6('0x8'));var csv=require(_0xabb6('0x9'));var ejs=require(_0xabb6('0xa'));var fs=require('fs');var fs_extra=require(_0xabb6('0xb'));var _=require(_0xabb6('0xc'));var squel=require('squel');var crypto=require(_0xabb6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xabb6('0xe'));var toCsv=require(_0xabb6('0x9'));var querystring=require('querystring');var Papa=require(_0xabb6('0xf'));var Redis=require(_0xabb6('0x10'));var authService=require(_0xabb6('0x11'));var qs=require(_0xabb6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xabb6('0x13'));var logger=require(_0xabb6('0x14'))(_0xabb6('0x15'));var utils=require(_0xabb6('0x16'));var config=require(_0xabb6('0x17'));var licenseUtil=require(_0xabb6('0x18'));var db=require(_0xabb6('0x19'))['db'];var dbH=require(_0xabb6('0x19'))[_0xabb6('0x1a')];function respondWithStatusCode(_0x3865d4,_0x13ffa8){_0x13ffa8=_0x13ffa8||0xcc;return function(_0x1f8a32){if(_0x1f8a32){return _0x3865d4[_0xabb6('0x1b')](_0x13ffa8);}return _0x3865d4[_0xabb6('0x1c')](_0x13ffa8)[_0xabb6('0x1d')]();};}function respondWithResult(_0x176080,_0x5ca099){_0x5ca099=_0x5ca099||0xc8;return function(_0x28742d){if(_0x28742d){return _0x176080[_0xabb6('0x1c')](_0x5ca099)[_0xabb6('0x1e')](_0x28742d);}};}function respondWithFilteredResult(_0x4bc452,_0x1d2a15){return function(_0xcf99e){if(_0xcf99e){var _0x3b28a6=typeof _0x1d2a15[_0xabb6('0x1f')]===_0xabb6('0x20')&&typeof _0x1d2a15[_0xabb6('0x21')]==='undefined';var _0x4b9435=_0xcf99e['count'];var _0x52bfa1=_0x3b28a6?0x0:_0x1d2a15['offset'];var _0x2c3e44=_0x3b28a6?_0xcf99e[_0xabb6('0x22')]:_0x1d2a15[_0xabb6('0x1f')]+_0x1d2a15[_0xabb6('0x21')];var _0x170280;if(_0x2c3e44>=_0x4b9435){_0x2c3e44=_0x4b9435;_0x170280=0xc8;}else{_0x170280=0xce;}_0x4bc452[_0xabb6('0x1c')](_0x170280);return _0x4bc452['set']('Content-Range',_0x52bfa1+'-'+_0x2c3e44+'/'+_0x4b9435)[_0xabb6('0x1e')](_0xcf99e);}return null;};}function patchUpdates(_0xb1c764){return function(_0x1dee8c){try{jsonpatch[_0xabb6('0x23')](_0x1dee8c,_0xb1c764,!![]);}catch(_0x338c77){return BPromise['reject'](_0x338c77);}return _0x1dee8c[_0xabb6('0x24')]();};}function saveUpdates(_0x28687e,_0x43ebf4){return function(_0x4589de){if(_0x4589de){return _0x4589de[_0xabb6('0x25')](_0x28687e)[_0xabb6('0x26')](function(_0x2cf653){return _0x2cf653;});}return null;};}function removeEntity(_0x1a2070,_0x57dd15){return function(_0x18e777){if(_0x18e777){return _0x18e777[_0xabb6('0x27')]()[_0xabb6('0x26')](function(){var _0x1bb094=_0x18e777[_0xabb6('0x28')]({'plain':!![]});var _0x412549=_0xabb6('0x29');return db[_0xabb6('0x2a')]['destroy']({'where':{'type':_0x412549,'resourceId':_0x1bb094['id']}})[_0xabb6('0x26')](function(){return _0x18e777;});})['then'](function(){_0x1a2070['status'](0xcc)[_0xabb6('0x1d')]();});}};}function handleEntityNotFound(_0x17ec1f,_0x500e3e){return function(_0x1eb2c9){if(!_0x1eb2c9){_0x17ec1f[_0xabb6('0x1b')](0x194);}return _0x1eb2c9;};}function handleError(_0x7ee2b,_0x2453ca){_0x2453ca=_0x2453ca||0x1f4;return function(_0x584a8f){logger[_0xabb6('0x2b')](_0x584a8f[_0xabb6('0x2c')]);if(_0x584a8f[_0xabb6('0x2d')]){delete _0x584a8f[_0xabb6('0x2d')];}_0x7ee2b['status'](_0x2453ca)['send'](_0x584a8f);};}exports['index']=function(_0x3a2af5,_0x4cc486){var _0x5ab922={},_0x3895a2={},_0x4ccbdd={'count':0x0,'rows':[]};var _0x51562d=_[_0xabb6('0x2e')](db[_0xabb6('0x2f')]['rawAttributes'],function(_0xf8008f){return{'name':_0xf8008f[_0xabb6('0x30')],'type':_0xf8008f['type'][_0xabb6('0x31')]};});_0x3895a2[_0xabb6('0x32')]=_[_0xabb6('0x2e')](_0x51562d,'name');_0x3895a2[_0xabb6('0x33')]=_['keys'](_0x3a2af5[_0xabb6('0x33')]);_0x3895a2['filters']=_[_0xabb6('0x34')](_0x3895a2[_0xabb6('0x32')],_0x3895a2[_0xabb6('0x33')]);_0x5ab922[_0xabb6('0x35')]=_[_0xabb6('0x34')](_0x3895a2[_0xabb6('0x32')],qs['fields'](_0x3a2af5[_0xabb6('0x33')][_0xabb6('0x36')]));_0x5ab922[_0xabb6('0x35')]=_0x5ab922[_0xabb6('0x35')][_0xabb6('0x37')]?_0x5ab922['attributes']:_0x3895a2[_0xabb6('0x32')];if(!_0x3a2af5[_0xabb6('0x33')][_0xabb6('0x38')](_0xabb6('0x39'))){_0x5ab922[_0xabb6('0x21')]=qs[_0xabb6('0x21')](_0x3a2af5[_0xabb6('0x33')][_0xabb6('0x21')]);_0x5ab922[_0xabb6('0x1f')]=qs['offset'](_0x3a2af5['query'][_0xabb6('0x1f')]);}_0x5ab922[_0xabb6('0x3a')]=qs[_0xabb6('0x3b')](_0x3a2af5['query']['sort']);_0x5ab922[_0xabb6('0x3c')]=qs[_0xabb6('0x3d')](_['pick'](_0x3a2af5['query'],_0x3895a2[_0xabb6('0x3d')]),_0x51562d);if(_0x3a2af5[_0xabb6('0x33')]['filter']){_0x5ab922[_0xabb6('0x3c')]=_[_0xabb6('0x3e')](_0x5ab922['where'],{'$or':_[_0xabb6('0x2e')](_0x51562d,function(_0x5f04ad){if(_0x5f04ad[_0xabb6('0x3f')]!==_0xabb6('0x40')){var _0x16f46a={};_0x16f46a[_0x5f04ad[_0xabb6('0x2d')]]={'$like':'%'+_0x3a2af5[_0xabb6('0x33')][_0xabb6('0x41')]+'%'};return _0x16f46a;}})});}_0x5ab922=_[_0xabb6('0x3e')]({},_0x5ab922,_0x3a2af5[_0xabb6('0x42')]);var _0xe36be6={'where':_0x5ab922[_0xabb6('0x3c')]};return db[_0xabb6('0x2f')][_0xabb6('0x22')](_0xe36be6)[_0xabb6('0x26')](function(_0x340323){_0x4ccbdd[_0xabb6('0x22')]=_0x340323;if(_0x3a2af5[_0xabb6('0x33')][_0xabb6('0x43')]){_0x5ab922[_0xabb6('0x44')]=[{'all':!![]}];}return db[_0xabb6('0x2f')][_0xabb6('0x45')](_0x5ab922);})[_0xabb6('0x26')](function(_0x24f7e8){_0x4ccbdd[_0xabb6('0x46')]=_0x24f7e8;return _0x4ccbdd;})[_0xabb6('0x26')](respondWithFilteredResult(_0x4cc486,_0x5ab922))[_0xabb6('0x47')](handleError(_0x4cc486,null));};exports[_0xabb6('0x48')]=function(_0x4d25c9,_0x3bbdb1){var _0x1e8fc5={'raw':![],'where':{'id':_0x4d25c9['params']['id']}},_0x4cdf25={};_0x4cdf25['model']=_[_0xabb6('0x49')](db[_0xabb6('0x2f')][_0xabb6('0x4a')]);_0x4cdf25[_0xabb6('0x33')]=_[_0xabb6('0x49')](_0x4d25c9[_0xabb6('0x33')]);_0x4cdf25['filters']=_[_0xabb6('0x34')](_0x4cdf25[_0xabb6('0x32')],_0x4cdf25[_0xabb6('0x33')]);_0x1e8fc5['attributes']=_['intersection'](_0x4cdf25[_0xabb6('0x32')],qs['fields'](_0x4d25c9[_0xabb6('0x33')][_0xabb6('0x36')]));_0x1e8fc5[_0xabb6('0x35')]=_0x1e8fc5[_0xabb6('0x35')][_0xabb6('0x37')]?_0x1e8fc5['attributes']:_0x4cdf25['model'];if(_0x4d25c9['query'][_0xabb6('0x43')]){_0x1e8fc5[_0xabb6('0x44')]=[{'all':!![]}];}_0x1e8fc5=_['merge']({},_0x1e8fc5,_0x4d25c9[_0xabb6('0x42')]);return db['AnalyticCustomReport'][_0xabb6('0x4b')](_0x1e8fc5)[_0xabb6('0x26')](handleEntityNotFound(_0x3bbdb1,null))['then'](respondWithResult(_0x3bbdb1,null))[_0xabb6('0x47')](handleError(_0x3bbdb1,null));};exports[_0xabb6('0x4c')]=function(_0x5caa0c,_0x5f3a43){return db[_0xabb6('0x2f')][_0xabb6('0x4c')](_0x5caa0c['body'],{})[_0xabb6('0x26')](function(_0x551cf9){var _0x5ab6e3=_0x5caa0c[_0xabb6('0x4d')][_0xabb6('0x28')]({'plain':!![]});if(!_0x5ab6e3)throw new Error(_0xabb6('0x4e'));if(_0x5ab6e3[_0xabb6('0x4f')]===_0xabb6('0x4d')){var _0x33a313=_0x551cf9[_0xabb6('0x28')]({'plain':!![]});var _0x3a4b64=_0xabb6('0x50');return db[_0xabb6('0x51')][_0xabb6('0x4b')]({'where':{'name':_0x3a4b64,'userProfileId':_0x5ab6e3[_0xabb6('0x52')]},'raw':!![]})[_0xabb6('0x26')](function(_0x3d6905){if(_0x3d6905&&_0x3d6905['autoAssociation']===0x0){return db[_0xabb6('0x2a')][_0xabb6('0x4c')]({'name':_0x33a313[_0xabb6('0x2d')],'resourceId':_0x33a313['id'],'type':_0xabb6('0x29'),'sectionId':_0x3d6905['id']},{})[_0xabb6('0x26')](function(){return _0x551cf9;});}else{return _0x551cf9;}})[_0xabb6('0x47')](function(_0x12f84a){logger[_0xabb6('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12f84a);throw _0x12f84a;});}return _0x551cf9;})[_0xabb6('0x26')](respondWithResult(_0x5f3a43,0xc9))[_0xabb6('0x47')](handleError(_0x5f3a43,null));};exports[_0xabb6('0x25')]=function(_0x5155ea,_0x116c15){if(_0x5155ea[_0xabb6('0x53')]['id']){delete _0x5155ea['body']['id'];}return db[_0xabb6('0x2f')]['find']({'where':{'id':_0x5155ea[_0xabb6('0x54')]['id']}})[_0xabb6('0x26')](handleEntityNotFound(_0x116c15,null))[_0xabb6('0x26')](saveUpdates(_0x5155ea['body'],null))[_0xabb6('0x26')](respondWithResult(_0x116c15,null))[_0xabb6('0x47')](handleError(_0x116c15,null));};exports[_0xabb6('0x27')]=function(_0x51531d,_0x55fe73){return db[_0xabb6('0x2f')]['find']({'where':{'id':_0x51531d[_0xabb6('0x54')]['id']}})['then'](handleEntityNotFound(_0x55fe73,null))[_0xabb6('0x26')](removeEntity(_0x55fe73,null))['catch'](handleError(_0x55fe73,null));};exports[_0xabb6('0x55')]=function(_0x5a5c01,_0x1657bf){var _0x563cb3=0xa;var _0x10e5d7=[_0xabb6('0x56'),_0xabb6('0x57'),_0xabb6('0x58'),_0xabb6('0x59')];var _0x69d028={'SUM':'SUM(%s)','COUNT':_0xabb6('0x5a'),'COUNT DISTINCT':_0xabb6('0x5b'),'MAX':'MAX(%s)','MIN':_0xabb6('0x5c'),'AVG':_0xabb6('0x5d'),'GROUP_CONCAT':_0xabb6('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x521107={'SEC_TO_TIME':_0xabb6('0x5f'),'DATE':'DATE(%s)','HOUR':_0xabb6('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xabb6('0x61')};var _0x48d827=function(_0x229ebb){return!_['includes']([_0xabb6('0x62'),_0xabb6('0x63'),_0xabb6('0x64'),_0xabb6('0x65')],_0x229ebb);};var _0x2d812f=function(_0x287ab4){if(!_0x287ab4||!_0x287ab4[_0xabb6('0x66')][_0xabb6('0x37')]){return'';}for(var _0x28decd='(',_0x21afe9=0x0;_0x21afe9<_0x287ab4[_0xabb6('0x66')][_0xabb6('0x37')];_0x21afe9+=0x1){_0x21afe9>0x0&&(_0x28decd+='\x20'+_0x287ab4[_0xabb6('0x67')]+'\x20');_0x28decd+=_0x287ab4[_0xabb6('0x66')][_0x21afe9][_0xabb6('0x68')]?_0x2d812f(_0x287ab4[_0xabb6('0x66')][_0x21afe9][_0xabb6('0x68')]):_0x287ab4['rules'][_0x21afe9][_0xabb6('0x69')]+'\x20'+_0x287ab4['rules'][_0x21afe9][_0xabb6('0x6a')]+(_0x48d827(_0x287ab4[_0xabb6('0x66')][_0x21afe9][_0xabb6('0x6a')])?'\x20'+_0x287ab4[_0xabb6('0x66')][_0x21afe9]['value']:'');}return _0x28decd+')';};var _0xff4341={'where':{'id':_0x5a5c01[_0xabb6('0x54')]['id']}},_0x35278c,_0x5a147a,_0x58082,_0x1fafe0,_0x5e8954;_0xff4341=_[_0xabb6('0x3e')]({},_0xff4341,_0x5a5c01[_0xabb6('0x42')]);return db[_0xabb6('0x2f')]['find'](_0xff4341)[_0xabb6('0x26')](function(_0x3dc26b){if(_0x3dc26b){_0x35278c=_0x3dc26b;return _0x3dc26b[_0xabb6('0x6b')]();}return null;})[_0xabb6('0x26')](function(_0x65d12c){if(_0x65d12c){if(!_0x65d12c[_0xabb6('0x37')]){throw new db['Sequelize']['ValidationErrorItem'](_0xabb6('0x6c'),0x193);}_0x5a147a=_0x65d12c;return db[_0xabb6('0x6d')][_0xabb6('0x45')]({'raw':!![]});}return null;})[_0xabb6('0x26')](function(_0x2cbbb8){if(_0x2cbbb8){_0x58082=_[_0xabb6('0x6e')](_0x2cbbb8,'id');var _0x4228e7;var _0x50aae4=squel[_0xabb6('0x6f')]();_0x50aae4[_0xabb6('0x70')](_0x35278c[_0xabb6('0x71')]);for(var _0x59e268=0x0;_0x59e268<_0x5a147a[_0xabb6('0x37')];_0x59e268+=0x1){_0x4228e7=_0x5a147a[_0x59e268][_0xabb6('0x72')]?_0x58082[_0x5a147a[_0x59e268][_0xabb6('0x72')]][_0xabb6('0x73')]:_0x5a147a[_0x59e268][_0xabb6('0x69')];_0x4228e7=_0x5a147a[_0x59e268][_0xabb6('0x74')]?_[_0xabb6('0x75')](_0x69d028[_0x5a147a[_0x59e268]['function']],'%s',_0x4228e7):_0x4228e7;_0x4228e7=_0x5a147a[_0x59e268][_0xabb6('0x76')]?_[_0xabb6('0x75')](_0x521107[_0x5a147a[_0x59e268][_0xabb6('0x76')]],'%s',_0x4228e7):_0x4228e7;if(_0x5a147a[_0x59e268][_0xabb6('0x77')]){_0x50aae4['group'](_0x4228e7);}_0x5a147a[_0x59e268][_0xabb6('0x78')]&&_0x50aae4[_0xabb6('0x3a')](_0x4228e7,_0x5a147a[_0x59e268][_0xabb6('0x78')]==='DESC'?![]:!![]);_0x50aae4[_0xabb6('0x69')](_0x4228e7,_0x5a147a[_0x59e268]['alias']||_0x4228e7);}if(_0x35278c[_0xabb6('0x79')]){_0x35278c[_0xabb6('0x79')]=JSON[_0xabb6('0x7a')](_0x35278c[_0xabb6('0x79')]);for(var _0x3d7a5e=0x0;_0x3d7a5e<_0x35278c[_0xabb6('0x79')]['length'];_0x3d7a5e+=0x1){if(_0x35278c[_0xabb6('0x79')][_0x3d7a5e]['type']&&_[_0xabb6('0x7b')](_0x10e5d7,_0x35278c[_0xabb6('0x79')][_0x3d7a5e][_0xabb6('0x3f')])&&_0x35278c[_0xabb6('0x79')][_0x3d7a5e][_0xabb6('0x7c')]&&_0x35278c['joins'][_0x3d7a5e][_0xabb6('0x7d')]&&_0x35278c[_0xabb6('0x79')][_0x3d7a5e][_0xabb6('0x7e')]){_0x50aae4[_0x35278c['joins'][_0x3d7a5e][_0xabb6('0x3f')]](_0x35278c['joins'][_0x3d7a5e][_0xabb6('0x7d')],null,util[_0xabb6('0x76')](_0xabb6('0x7f'),_0x35278c[_0xabb6('0x71')],_0x35278c['joins'][_0x3d7a5e][_0xabb6('0x7c')],_0x35278c[_0xabb6('0x79')][_0x3d7a5e][_0xabb6('0x7d')],_0x35278c[_0xabb6('0x79')][_0x3d7a5e][_0xabb6('0x7e')]));}}}if(_0x35278c[_0xabb6('0x80')]){_0x35278c[_0xabb6('0x80')]=JSON[_0xabb6('0x7a')](_0x35278c[_0xabb6('0x80')]);_0x50aae4[_0xabb6('0x3c')](_0x2d812f(_0x35278c['conditions']['group']));}_0x5e8954=_0x50aae4[_0xabb6('0x81')]();_0x50aae4[_0xabb6('0x21')](_0x563cb3);_0x50aae4['offset'](0x0);logger[_0xabb6('0x82')](_0xabb6('0x83'),_0x50aae4[_0xabb6('0x84')]());return dbH[_0xabb6('0x85')]['query'](_0x50aae4['toString'](),{'type':dbH[_0xabb6('0x85')][_0xabb6('0x86')]['SELECT']});}})[_0xabb6('0x26')](respondWithResult(_0x1657bf,null))['catch'](handleError(_0x1657bf,null));};function runReport(_0x13dd0d,_0x51e7aa,_0x14ee7f){var _0x1e0e37=_0x51e7aa[_0xabb6('0x2d')];var _0x4682ad=0xa;var _0x2208f3=[_0xabb6('0x56'),'left_join',_0xabb6('0x58'),_0xabb6('0x59')];var _0x17b2d6={'SUM':_0xabb6('0x87'),'COUNT':_0xabb6('0x5a'),'COUNT DISTINCT':_0xabb6('0x5b'),'MAX':_0xabb6('0x88'),'MIN':_0xabb6('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xabb6('0x5e'),'GROUP_CONCAT ASC':_0xabb6('0x89'),'GROUP_CONCAT DESC':_0xabb6('0x8a')};var _0x301792={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xabb6('0x60'),'ROUND':_0xabb6('0x8b'),'UNIX_TIMESTAMP':_0xabb6('0x61')};var _0x1a8fd9=function(_0x46227a){return!_[_0xabb6('0x7b')]([_0xabb6('0x62'),_0xabb6('0x63'),_0xabb6('0x64'),_0xabb6('0x65')],_0x46227a);};var _0x22bb93=function(_0x2e77f8){if(!_0x2e77f8||!_0x2e77f8['rules'][_0xabb6('0x37')]){return'';}for(var _0x263242='(',_0x20dab3=0x0;_0x20dab3<_0x2e77f8['rules']['length'];_0x20dab3+=0x1){_0x20dab3>0x0&&(_0x263242+='\x20'+_0x2e77f8[_0xabb6('0x67')]+'\x20');_0x263242+=_0x2e77f8[_0xabb6('0x66')][_0x20dab3][_0xabb6('0x68')]?_0x22bb93(_0x2e77f8[_0xabb6('0x66')][_0x20dab3][_0xabb6('0x68')]):_0x2e77f8[_0xabb6('0x66')][_0x20dab3][_0xabb6('0x69')]+'\x20'+_0x2e77f8[_0xabb6('0x66')][_0x20dab3][_0xabb6('0x6a')]+(_0x1a8fd9(_0x2e77f8[_0xabb6('0x66')][_0x20dab3][_0xabb6('0x6a')])?'\x20'+_0x2e77f8[_0xabb6('0x66')][_0x20dab3][_0xabb6('0x8c')]:'');}return _0x263242+')';};var _0x38525e={'where':{'id':_0x13dd0d['id']}},_0x55c104,_0x4cfdf7,_0x290630,_0x5a8126,_0x24cdcf;_0x38525e=_[_0xabb6('0x3e')]({},_0x38525e,_0x14ee7f);return db[_0xabb6('0x2f')][_0xabb6('0x4b')](_0x38525e)[_0xabb6('0x26')](function(_0x4a3e79){if(_0x4a3e79){_0x55c104=_0x4a3e79;return _0x4a3e79['getFields']();}return null;})[_0xabb6('0x26')](function(_0x2d60dd){if(_0x2d60dd){if(!_0x2d60dd[_0xabb6('0x37')]){throw new db[(_0xabb6('0x8d'))][(_0xabb6('0x8e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cfdf7=_0x2d60dd;return db[_0xabb6('0x6d')][_0xabb6('0x45')]({'raw':!![]});}return null;})[_0xabb6('0x26')](function(_0x4d5100){if(_0x4d5100){_0x290630=_['keyBy'](_0x4d5100,'id');var _0x1abfed;var _0x533e48=squel['select']();_0x533e48[_0xabb6('0x70')](_0x55c104[_0xabb6('0x71')]);for(var _0x49f087=0x0;_0x49f087<_0x4cfdf7[_0xabb6('0x37')];_0x49f087+=0x1){_0x1abfed=_0x4cfdf7[_0x49f087][_0xabb6('0x72')]?_0x290630[_0x4cfdf7[_0x49f087]['MetricId']][_0xabb6('0x73')]:_0x4cfdf7[_0x49f087][_0xabb6('0x69')];_0x1abfed=_0x4cfdf7[_0x49f087]['function']?_[_0xabb6('0x75')](_0x17b2d6[_0x4cfdf7[_0x49f087][_0xabb6('0x74')]],'%s',_0x1abfed):_0x1abfed;_0x1abfed=_0x4cfdf7[_0x49f087][_0xabb6('0x76')]?_[_0xabb6('0x75')](_0x301792[_0x4cfdf7[_0x49f087]['format']],'%s',_0x1abfed):_0x1abfed;if(_0x4cfdf7[_0x49f087][_0xabb6('0x77')]){_0x533e48[_0xabb6('0x68')](_0x1abfed);}_0x4cfdf7[_0x49f087][_0xabb6('0x78')]&&_0x533e48[_0xabb6('0x3a')](_0x1abfed,_0x4cfdf7[_0x49f087][_0xabb6('0x78')]===_0xabb6('0x8f')?![]:!![]);_0x533e48['field'](_0x1abfed,_0x4cfdf7[_0x49f087][_0xabb6('0x90')]||_0x1abfed);}if(_0x55c104[_0xabb6('0x79')]){_0x55c104['joins']=JSON[_0xabb6('0x7a')](_0x55c104['joins']);for(var _0x13c778=0x0;_0x13c778<_0x55c104[_0xabb6('0x79')][_0xabb6('0x37')];_0x13c778+=0x1){if(_0x55c104['joins'][_0x13c778][_0xabb6('0x3f')]&&_[_0xabb6('0x7b')](_0x2208f3,_0x55c104[_0xabb6('0x79')][_0x13c778][_0xabb6('0x3f')])&&_0x55c104[_0xabb6('0x79')][_0x13c778]['parentKey']&&_0x55c104[_0xabb6('0x79')][_0x13c778][_0xabb6('0x7d')]&&_0x55c104[_0xabb6('0x79')][_0x13c778]['foreignKey']){_0x533e48[_0x55c104[_0xabb6('0x79')][_0x13c778]['type']](_0x55c104[_0xabb6('0x79')][_0x13c778][_0xabb6('0x7d')],null,util['format'](_0xabb6('0x7f'),_0x55c104['table'],_0x55c104[_0xabb6('0x79')][_0x13c778][_0xabb6('0x7c')],_0x55c104[_0xabb6('0x79')][_0x13c778][_0xabb6('0x7d')],_0x55c104['joins'][_0x13c778]['foreignKey']));}}}if(_0x55c104['conditions']){_0x55c104['conditions']=JSON[_0xabb6('0x7a')](_0x55c104[_0xabb6('0x80')]);_0x533e48[_0xabb6('0x3c')](_0x22bb93(_0x55c104[_0xabb6('0x80')][_0xabb6('0x68')]));}_0x24cdcf=_0x533e48[_0xabb6('0x81')]();_0x533e48['limit'](_0x4682ad);_0x533e48[_0xabb6('0x1f')](0x0);return;}})[_0xabb6('0x26')](function(){if(_0x51e7aa[_0xabb6('0x91')]===_0xabb6('0x92')){return null;}var _0x7ed58=_[_0xabb6('0x3e')](_0x51e7aa,{'name':_0x51e7aa[_0xabb6('0x93')]||_0x51e7aa[_0xabb6('0x2d')]||_0x55c104[_0xabb6('0x2d')],'basename':_0x1e0e37,'savename':util[_0xabb6('0x76')](_0xabb6('0x94'),_0x51e7aa[_0xabb6('0x2d')]||_0x55c104['name'],require(_0xabb6('0x95'))[_0xabb6('0x96')](0x4),_0x51e7aa[_0xabb6('0x91')]||_0xabb6('0x97')),'reportId':_0x55c104['id'],'reportType':_0xabb6('0x98')});return db[_0xabb6('0x99')][_0xabb6('0x4c')](_0x7ed58,{'raw':!![]});})[_0xabb6('0x26')](function(_0x12a477){if(_0x55c104[_0xabb6('0x71')]===_0xabb6('0x9a')){_0x24cdcf[_0xabb6('0x3c')](_0x55c104[_0xabb6('0x71')]+_0xabb6('0x9b'),_0x51e7aa[_0xabb6('0x9c')],_0x51e7aa[_0xabb6('0x9d')]);}else{_0x24cdcf[_0xabb6('0x3c')](_0x55c104[_0xabb6('0x71')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x51e7aa[_0xabb6('0x9c')],_0x51e7aa[_0xabb6('0x9d')]);}if(_0x12a477){logger[_0xabb6('0x9e')]('Run\x20Query:',_0x24cdcf[_0xabb6('0x84')]());require('child_process')[_0xabb6('0x9f')](path['join'](__dirname,_0xabb6('0xa0'),_0x12a477[_0xabb6('0x91')]),[_0x12a477['id'],_0x24cdcf[_0xabb6('0x84')](),path['join'](__dirname,'../../files/reports',_0x12a477[_0xabb6('0xa1')]),_0x1e0e37]);return _0x12a477;}else{var _0x20d476=squel[_0xabb6('0x6f')]();_0x20d476[_0xabb6('0x70')]('('+_0x24cdcf['toString']()+')',_0xabb6('0xa2'));_0x20d476['field'](_0xabb6('0xa3'),'count');_0x24cdcf[_0xabb6('0x21')](_0x51e7aa[_0xabb6('0x21')]||_0x4682ad);_0x24cdcf[_0xabb6('0x1f')](_0x51e7aa[_0xabb6('0x1f')]||0x0);return dbH['sequelize'][_0xabb6('0x33')](_0x20d476[_0xabb6('0x84')](),{'type':dbH[_0xabb6('0x85')]['QueryTypes'][_0xabb6('0xa4')]})[_0xabb6('0x26')](function(_0xbae63c){if(!_0xbae63c['length']){_0x5a8126=0x0;}else{_0x5a8126=_0xbae63c[0x0][_0xabb6('0x22')]||0x0;}return dbH[_0xabb6('0x85')]['query'](_0x24cdcf[_0xabb6('0x84')](),{'type':dbH[_0xabb6('0x85')][_0xabb6('0x86')]['SELECT']});})['then'](function(_0x415c79){return{'rows':_0x415c79||[],'count':_0x5a8126};});}});}exports[_0xabb6('0xa5')]=function(_0x58c749,_0x2770ba){return runReport(_0x58c749[_0xabb6('0x54')],_0x58c749[_0xabb6('0x33')],_0x58c749[_0xabb6('0x42')])['then'](respondWithResult(_0x2770ba,null))['catch'](handleError(_0x2770ba,null));};exports['runReport']=runReport;exports[_0xabb6('0x33')]=function(_0x335a51,_0x2909a5){var _0x12ce4a=0xa;var _0x23a2e3=[_0xabb6('0x56'),_0xabb6('0x57'),_0xabb6('0x58'),'cross_join'];var _0x14aa93={'SUM':'SUM(%s)','COUNT':_0xabb6('0x5a'),'COUNT DISTINCT':_0xabb6('0x5b'),'MAX':_0xabb6('0x88'),'MIN':_0xabb6('0x5c'),'AVG':_0xabb6('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xabb6('0x89'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5167f0={'SEC_TO_TIME':_0xabb6('0x5f'),'DATE':'DATE(%s)','HOUR':_0xabb6('0x60'),'ROUND':_0xabb6('0x8b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xeb75dc=function(_0x17a559){return!_[_0xabb6('0x7b')]([_0xabb6('0x62'),_0xabb6('0x63'),_0xabb6('0x64'),_0xabb6('0x65')],_0x17a559);};var _0x31e38c=function(_0xee97b2){if(!_0xee97b2||!_0xee97b2[_0xabb6('0x66')][_0xabb6('0x37')]){return'';}for(var _0x20c29f='(',_0x40ad57=0x0;_0x40ad57<_0xee97b2[_0xabb6('0x66')][_0xabb6('0x37')];_0x40ad57+=0x1){_0x40ad57>0x0&&(_0x20c29f+='\x20'+_0xee97b2[_0xabb6('0x67')]+'\x20');_0x20c29f+=_0xee97b2['rules'][_0x40ad57][_0xabb6('0x68')]?_0x31e38c(_0xee97b2[_0xabb6('0x66')][_0x40ad57][_0xabb6('0x68')]):_0xee97b2[_0xabb6('0x66')][_0x40ad57][_0xabb6('0x69')]+'\x20'+_0xee97b2['rules'][_0x40ad57][_0xabb6('0x6a')]+(_0xeb75dc(_0xee97b2['rules'][_0x40ad57][_0xabb6('0x6a')])?'\x20'+_0xee97b2[_0xabb6('0x66')][_0x40ad57][_0xabb6('0x8c')]:'');}return _0x20c29f+')';};var _0x3fc505={'where':{'id':_0x335a51[_0xabb6('0x54')]['id']}},_0x8f95a3,_0x52b61e,_0x565781,_0xe73ec,_0x14a4fe;_0x3fc505=_[_0xabb6('0x3e')]({},_0x3fc505,_0x335a51[_0xabb6('0x42')]);return db[_0xabb6('0x2f')]['find'](_0x3fc505)[_0xabb6('0x26')](function(_0x23d11e){if(_0x23d11e){_0x8f95a3=_0x23d11e;return _0x23d11e['getFields']();}return null;})[_0xabb6('0x26')](function(_0x116564){if(_0x116564){if(!_0x116564[_0xabb6('0x37')]){throw new db[(_0xabb6('0x8d'))]['ValidationErrorItem'](_0xabb6('0x6c'),0x193);}_0x52b61e=_0x116564;return db[_0xabb6('0x6d')][_0xabb6('0x45')]({'raw':!![]});}return null;})[_0xabb6('0x26')](function(_0x102d7e){if(_0x102d7e){_0x565781=_['keyBy'](_0x102d7e,'id');var _0x4d5393;var _0x5c6244=squel[_0xabb6('0x6f')]();_0x5c6244[_0xabb6('0x70')](_0x8f95a3[_0xabb6('0x71')]);for(var _0x3db458=0x0;_0x3db458<_0x52b61e[_0xabb6('0x37')];_0x3db458+=0x1){_0x4d5393=_0x52b61e[_0x3db458][_0xabb6('0x72')]?_0x565781[_0x52b61e[_0x3db458][_0xabb6('0x72')]][_0xabb6('0x73')]:_0x52b61e[_0x3db458]['field'];_0x4d5393=_0x52b61e[_0x3db458][_0xabb6('0x74')]?_[_0xabb6('0x75')](_0x14aa93[_0x52b61e[_0x3db458][_0xabb6('0x74')]],'%s',_0x4d5393):_0x4d5393;_0x4d5393=_0x52b61e[_0x3db458][_0xabb6('0x76')]?_[_0xabb6('0x75')](_0x5167f0[_0x52b61e[_0x3db458][_0xabb6('0x76')]],'%s',_0x4d5393):_0x4d5393;if(_0x52b61e[_0x3db458][_0xabb6('0x77')]){_0x5c6244[_0xabb6('0x68')](_0x4d5393);}_0x52b61e[_0x3db458][_0xabb6('0x78')]&&_0x5c6244[_0xabb6('0x3a')](_0x4d5393,_0x52b61e[_0x3db458][_0xabb6('0x78')]===_0xabb6('0x8f')?![]:!![]);_0x5c6244[_0xabb6('0x69')](_0x4d5393,_0x52b61e[_0x3db458]['alias']||_0x4d5393);}if(_0x8f95a3[_0xabb6('0x79')]){_0x8f95a3['joins']=JSON['parse'](_0x8f95a3[_0xabb6('0x79')]);for(var _0x39b5ab=0x0;_0x39b5ab<_0x8f95a3[_0xabb6('0x79')][_0xabb6('0x37')];_0x39b5ab+=0x1){if(_0x8f95a3[_0xabb6('0x79')][_0x39b5ab][_0xabb6('0x3f')]&&_[_0xabb6('0x7b')](_0x23a2e3,_0x8f95a3[_0xabb6('0x79')][_0x39b5ab][_0xabb6('0x3f')])&&_0x8f95a3[_0xabb6('0x79')][_0x39b5ab][_0xabb6('0x7c')]&&_0x8f95a3[_0xabb6('0x79')][_0x39b5ab][_0xabb6('0x7d')]&&_0x8f95a3[_0xabb6('0x79')][_0x39b5ab][_0xabb6('0x7e')]){_0x5c6244[_0x8f95a3[_0xabb6('0x79')][_0x39b5ab][_0xabb6('0x3f')]](_0x8f95a3[_0xabb6('0x79')][_0x39b5ab][_0xabb6('0x7d')],null,util[_0xabb6('0x76')]('%s.%s\x20=\x20%s.%s',_0x8f95a3[_0xabb6('0x71')],_0x8f95a3[_0xabb6('0x79')][_0x39b5ab][_0xabb6('0x7c')],_0x8f95a3[_0xabb6('0x79')][_0x39b5ab]['foreignTable'],_0x8f95a3[_0xabb6('0x79')][_0x39b5ab][_0xabb6('0x7e')]));}}}if(_0x8f95a3[_0xabb6('0x80')]){_0x8f95a3[_0xabb6('0x80')]=JSON['parse'](_0x8f95a3[_0xabb6('0x80')]);_0x5c6244[_0xabb6('0x3c')](_0x31e38c(_0x8f95a3[_0xabb6('0x80')][_0xabb6('0x68')]));}_0x14a4fe=_0x5c6244[_0xabb6('0x81')]();_0x5c6244['limit'](_0x12ce4a);_0x5c6244[_0xabb6('0x1f')](0x0);logger['debug']('Limited\x20Query:',_0x5c6244[_0xabb6('0x84')]());return dbH[_0xabb6('0x85')]['query'](_0x5c6244['toString'](),{'type':dbH[_0xabb6('0x85')]['QueryTypes'][_0xabb6('0xa4')]});}})[_0xabb6('0x26')](function(){return{'sql':_0x14a4fe[_0xabb6('0x84')]()};})[_0xabb6('0x26')](respondWithResult(_0x2909a5,null))[_0xabb6('0x47')](handleError(_0x2909a5,null));};
\ No newline at end of file
index 94f1bfc..785d5ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd19=['request-promise','path','exports','define','AnalyticCustomReport','analytics_custom_reports','util','api','moment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xdd19,0x10b));var _0x9dd1=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xdd19[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require(_0x9dd1('0x0'));var logger=require('../../config/logger')(_0x9dd1('0x1'));var moment=require(_0x9dd1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9dd1('0x3'));var fs=require('fs');var path=require(_0x9dd1('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticCustomReport.attributes');module[_0x9dd1('0x5')]=function(_0x3013c,_0x521599){return _0x3013c[_0x9dd1('0x6')](_0x9dd1('0x7'),attributes,{'tableName':_0x9dd1('0x8'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb0d7=['path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','moment','request-promise'];(function(_0x26ccb4,_0x1d89dd){var _0x59c549=function(_0x412a4b){while(--_0x412a4b){_0x26ccb4['push'](_0x26ccb4['shift']());}};_0x59c549(++_0x1d89dd);}(_0xb0d7,0xb0));var _0x7b0d=function(_0x512535,_0x4fe5ff){_0x512535=_0x512535-0x0;var _0x1f1ed6=_0xb0d7[_0x512535];return _0x1f1ed6;};'use strict';var _=require(_0x7b0d('0x0'));var util=require('util');var logger=require(_0x7b0d('0x1'))('api');var moment=require(_0x7b0d('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b0d('0x3'));var fs=require('fs');var path=require(_0x7b0d('0x4'));var rimraf=require(_0x7b0d('0x5'));var config=require(_0x7b0d('0x6'));var attributes=require(_0x7b0d('0x7'));module[_0x7b0d('0x8')]=function(_0x42803d,_0x5e8329){return _0x42803d[_0x7b0d('0x9')](_0x7b0d('0xa'),attributes,{'tableName':_0x7b0d('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a29a81c..bf3dd10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7ead=['rpc','../../config/environment','client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2170e4,_0x5b969e){var _0xec86f5=function(_0x44e53e){while(--_0x44e53e){_0x2170e4['push'](_0x2170e4['shift']());}};_0xec86f5(++_0x5b969e);}(_0x7ead,0x118));var _0xd7ea=function(_0x498f5b,_0xe69ffa){_0x498f5b=_0x498f5b-0x0;var _0x46fafb=_0x7ead[_0x498f5b];return _0x46fafb;};'use strict';var _=require('lodash');var util=require(_0xd7ea('0x0'));var moment=require(_0xd7ea('0x1'));var BPromise=require('bluebird');var rs=require(_0xd7ea('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd7ea('0x3'))['db'];var utils=require(_0xd7ea('0x4'));var logger=require(_0xd7ea('0x5'))(_0xd7ea('0x6'));var config=require(_0xd7ea('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd7ea('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x409576,_0x97907f,_0x1f4cd2){return new BPromise(function(_0x32ae86,_0x2719d5){return client[_0xd7ea('0x9')](_0x409576,_0x1f4cd2)[_0xd7ea('0xa')](function(_0x5d0a93){logger[_0xd7ea('0xb')](_0xd7ea('0xc'),_0x97907f,_0xd7ea('0xd'));logger[_0xd7ea('0xe')](_0xd7ea('0xf'),_0x97907f,'request\x20sent',JSON[_0xd7ea('0x10')](_0x5d0a93));if(_0x5d0a93[_0xd7ea('0x11')]){if(_0x5d0a93['error'][_0xd7ea('0x12')]===0x1f4){logger[_0xd7ea('0x11')](_0xd7ea('0xc'),_0x97907f,_0x5d0a93[_0xd7ea('0x11')][_0xd7ea('0x13')]);return _0x2719d5(_0x5d0a93[_0xd7ea('0x11')]['message']);}logger[_0xd7ea('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x97907f,_0x5d0a93[_0xd7ea('0x11')][_0xd7ea('0x13')]);return _0x32ae86(_0x5d0a93['error'][_0xd7ea('0x13')]);}else{logger[_0xd7ea('0xb')](_0xd7ea('0xc'),_0x97907f,_0xd7ea('0xd'));_0x32ae86(_0x5d0a93[_0xd7ea('0x14')][_0xd7ea('0x13')]);}})[_0xd7ea('0x15')](function(_0x4e40e7){logger[_0xd7ea('0x11')](_0xd7ea('0xc'),_0x97907f,_0x4e40e7);_0x2719d5(_0x4e40e7);});});}
\ No newline at end of file
+var _0x6259=['request','AnalyticCustomReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x6259,0x199));var _0x9625=function(_0x567f56,_0x49dd75){_0x567f56=_0x567f56-0x0;var _0x55df17=_0x6259[_0x567f56];return _0x55df17;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9625('0x0'));var BPromise=require(_0x9625('0x1'));var rs=require(_0x9625('0x2'));var fs=require('fs');var Redis=require(_0x9625('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9625('0x4'))(_0x9625('0x5'));var config=require(_0x9625('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9625('0x7')][_0x9625('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x243c4e,_0x21cefa,_0x4e9c6d){return new BPromise(function(_0x19272a,_0x391a19){return client[_0x9625('0x9')](_0x243c4e,_0x4e9c6d)['then'](function(_0x16fc99){logger['info'](_0x9625('0xa'),_0x21cefa,'request\x20sent');logger[_0x9625('0xb')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x21cefa,_0x9625('0xc'),JSON[_0x9625('0xd')](_0x16fc99));if(_0x16fc99['error']){if(_0x16fc99[_0x9625('0xe')][_0x9625('0xf')]===0x1f4){logger[_0x9625('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x21cefa,_0x16fc99[_0x9625('0xe')][_0x9625('0x10')]);return _0x391a19(_0x16fc99[_0x9625('0xe')][_0x9625('0x10')]);}logger[_0x9625('0xe')](_0x9625('0xa'),_0x21cefa,_0x16fc99[_0x9625('0xe')]['message']);return _0x19272a(_0x16fc99['error'][_0x9625('0x10')]);}else{logger[_0x9625('0x11')](_0x9625('0xa'),_0x21cefa,'request\x20sent');_0x19272a(_0x16fc99['result'][_0x9625('0x10')]);}})[_0x9625('0x12')](function(_0x333ef9){logger[_0x9625('0xe')](_0x9625('0xa'),_0x21cefa,_0x333ef9);_0x391a19(_0x333ef9);});});}
\ No newline at end of file
index cf23dce..0ad56c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4550=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','preview','run','/:id/query','post','create','update','destroy','exports'];(function(_0x25f983,_0x352b9d){var _0x50a304=function(_0x2bc5db){while(--_0x2bc5db){_0x25f983['push'](_0x25f983['shift']());}};_0x50a304(++_0x352b9d);}(_0x4550,0x111));var _0x0455=function(_0x128ee7,_0xbfbe00){_0x128ee7=_0x128ee7-0x0;var _0x38450a=_0x4550[_0x128ee7];return _0x38450a;};'use strict';var multer=require('multer');var util=require(_0x0455('0x0'));var path=require(_0x0455('0x1'));var timeout=require(_0x0455('0x2'));var express=require(_0x0455('0x3'));var router=express[_0x0455('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0455('0x5'));var interaction=require(_0x0455('0x6'));var config=require(_0x0455('0x7'));var controller=require('./analyticCustomReport.controller');router[_0x0455('0x8')]('/',auth[_0x0455('0x9')](),controller[_0x0455('0xa')]);router['get'](_0x0455('0xb'),auth[_0x0455('0x9')](),controller[_0x0455('0xc')]);router[_0x0455('0x8')]('/:id/preview',auth[_0x0455('0x9')](),controller[_0x0455('0xd')]);router[_0x0455('0x8')]('/:id/run',auth['isAuthenticated'](),controller[_0x0455('0xe')]);router[_0x0455('0x8')](_0x0455('0xf'),auth[_0x0455('0x9')](),controller['query']);router[_0x0455('0x10')]('/',auth['isAuthenticated'](),controller[_0x0455('0x11')]);router['put'](_0x0455('0xb'),auth[_0x0455('0x9')](),controller[_0x0455('0x12')]);router['delete'](_0x0455('0xb'),auth[_0x0455('0x9')](),controller[_0x0455('0x13')]);module[_0x0455('0x14')]=router;
\ No newline at end of file
+var _0x276b=['util','connect-timeout','fs-extra','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/run','run','post','create','update','delete','destroy','exports','multer'];(function(_0x420f46,_0x389a33){var _0x5992f9=function(_0x298ab9){while(--_0x298ab9){_0x420f46['push'](_0x420f46['shift']());}};_0x5992f9(++_0x389a33);}(_0x276b,0x10d));var _0xb276=function(_0x9290a4,_0x59eba5){_0x9290a4=_0x9290a4-0x0;var _0x2fff5d=_0x276b[_0x9290a4];return _0x2fff5d;};'use strict';var multer=require(_0xb276('0x0'));var util=require(_0xb276('0x1'));var path=require('path');var timeout=require(_0xb276('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb276('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb276('0x4'));var controller=require(_0xb276('0x5'));router[_0xb276('0x6')]('/',auth[_0xb276('0x7')](),controller['index']);router[_0xb276('0x6')](_0xb276('0x8'),auth[_0xb276('0x7')](),controller[_0xb276('0x9')]);router[_0xb276('0x6')]('/:id/preview',auth['isAuthenticated'](),controller['preview']);router[_0xb276('0x6')](_0xb276('0xa'),auth['isAuthenticated'](),controller[_0xb276('0xb')]);router['get']('/:id/query',auth[_0xb276('0x7')](),controller['query']);router[_0xb276('0xc')]('/',auth[_0xb276('0x7')](),controller[_0xb276('0xd')]);router['put'](_0xb276('0x8'),auth[_0xb276('0x7')](),controller[_0xb276('0xe')]);router[_0xb276('0xf')](_0xb276('0x8'),auth['isAuthenticated'](),controller[_0xb276('0x10')]);module[_0xb276('0x11')]=router;
\ No newline at end of file
index 6a6c9a3..0631435 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8ef6=['STRING','TEXT','sequelize','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8ef6,0xf2));var _0x68ef=function(_0x27e85a,_0x32d40d){_0x27e85a=_0x27e85a-0x0;var _0x4c52da=_0x8ef6[_0x27e85a];return _0x4c52da;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'name':{'type':Sequelize[_0x68ef('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x68ef('0x2')]},'parent':{'type':Sequelize[_0x68ef('0x2')]},'table':{'type':Sequelize[_0x68ef('0x2')]},'conditions':{'type':Sequelize[_0x68ef('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x814b=['STRING','TEXT','sequelize','exports'];(function(_0x281633,_0xa6166a){var _0x4de759=function(_0x400a42){while(--_0x400a42){_0x281633['push'](_0x281633['shift']());}};_0x4de759(++_0xa6166a);}(_0x814b,0x1a2));var _0xb814=function(_0x12e73c,_0x2cbe1d){_0x12e73c=_0x12e73c-0x0;var _0x4c41cb=_0x814b[_0x12e73c];return _0x4c41cb;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'name':{'type':Sequelize[_0xb814('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb814('0x2')]},'parent':{'type':Sequelize[_0xb814('0x2')]},'table':{'type':Sequelize[_0xb814('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb814('0x3')]}};
\ No newline at end of file
index 852cd98..d9e5851 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['Sequelize','from','foreignKey','output','web','fullPath','generate','csv','cdr','startDate','endDate','info','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','runReport','IS\x20NULL','IS\x20NOT\x20EMPTY','metric','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticDefaultReport','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','update','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20EMPTY','operator','rules','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x2ef3,0xba));var _0x32ef=function(_0x423ff8,_0x3d4296){_0x423ff8=_0x423ff8-0x0;var _0x4cc1e8=_0x2ef3[_0x423ff8];return _0x4cc1e8;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x32ef('0x18'))['dbH'];function respondWithStatusCode(_0x3e98df,_0x1ef1ae){_0x1ef1ae=_0x1ef1ae||0xcc;return function(_0x5c3eb9){if(_0x5c3eb9){return _0x3e98df['sendStatus'](_0x1ef1ae);}return _0x3e98df[_0x32ef('0x19')](_0x1ef1ae)['end']();};}function respondWithResult(_0x326fce,_0x40a6e6){_0x40a6e6=_0x40a6e6||0xc8;return function(_0x93d492){if(_0x93d492){return _0x326fce[_0x32ef('0x19')](_0x40a6e6)['json'](_0x93d492);}};}function respondWithFilteredResult(_0x55bf0b,_0x531e30){return function(_0x13db1a){if(_0x13db1a){var _0x3950e6=typeof _0x531e30[_0x32ef('0x1a')]==='undefined'&&typeof _0x531e30['limit']===_0x32ef('0x1b');var _0x1a9476=_0x13db1a[_0x32ef('0x1c')];var _0x57863c=_0x3950e6?0x0:_0x531e30[_0x32ef('0x1a')];var _0x33e230=_0x3950e6?_0x13db1a['count']:_0x531e30[_0x32ef('0x1a')]+_0x531e30[_0x32ef('0x1d')];var _0x26aff3;if(_0x33e230>=_0x1a9476){_0x33e230=_0x1a9476;_0x26aff3=0xc8;}else{_0x26aff3=0xce;}_0x55bf0b[_0x32ef('0x19')](_0x26aff3);return _0x55bf0b[_0x32ef('0x1e')](_0x32ef('0x1f'),_0x57863c+'-'+_0x33e230+'/'+_0x1a9476)['json'](_0x13db1a);}return null;};}function patchUpdates(_0x3c5b78){return function(_0x5cc3ef){try{jsonpatch[_0x32ef('0x20')](_0x5cc3ef,_0x3c5b78,!![]);}catch(_0x3a20ca){return BPromise['reject'](_0x3a20ca);}return _0x5cc3ef[_0x32ef('0x21')]();};}function saveUpdates(_0x97780,_0x5e8898){return function(_0x55f7f2){if(_0x55f7f2){return _0x55f7f2['update'](_0x97780)[_0x32ef('0x22')](function(_0xb30fab){return _0xb30fab;});}return null;};}function removeEntity(_0x225feb,_0x478bef){return function(_0x59585f){if(_0x59585f){return _0x59585f[_0x32ef('0x23')]()['then'](function(){var _0x51a412=_0x59585f[_0x32ef('0x24')]({'plain':!![]});var _0x14d4b3=_0x32ef('0x25');return db[_0x32ef('0x26')][_0x32ef('0x23')]({'where':{'type':_0x14d4b3,'resourceId':_0x51a412['id']}})[_0x32ef('0x22')](function(){return _0x59585f;});})[_0x32ef('0x22')](function(){_0x225feb[_0x32ef('0x19')](0xcc)[_0x32ef('0x27')]();});}};}function handleEntityNotFound(_0x2f52d7,_0x1335e2){return function(_0xba4b3f){if(!_0xba4b3f){_0x2f52d7['sendStatus'](0x194);}return _0xba4b3f;};}function handleError(_0xd65fde,_0x2f5d06){_0x2f5d06=_0x2f5d06||0x1f4;return function(_0x5a04cd){logger[_0x32ef('0x28')](_0x5a04cd[_0x32ef('0x29')]);if(_0x5a04cd[_0x32ef('0x2a')]){delete _0x5a04cd[_0x32ef('0x2a')];}_0xd65fde['status'](_0x2f5d06)[_0x32ef('0x2b')](_0x5a04cd);};}exports[_0x32ef('0x2c')]=function(_0x31dbc3,_0x2ac686){var _0x1b668a={},_0x1a6ed2={},_0x1a122d={'count':0x0,'rows':[]};var _0x575f3e=_[_0x32ef('0x2d')](db['AnalyticDefaultReport'][_0x32ef('0x2e')],function(_0x2b6c6a){return{'name':_0x2b6c6a['fieldName'],'type':_0x2b6c6a[_0x32ef('0x2f')][_0x32ef('0x30')]};});_0x1a6ed2[_0x32ef('0x31')]=_[_0x32ef('0x2d')](_0x575f3e,_0x32ef('0x2a'));_0x1a6ed2['query']=_['keys'](_0x31dbc3[_0x32ef('0x32')]);_0x1a6ed2['filters']=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],_0x1a6ed2[_0x32ef('0x32')]);_0x1b668a[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],qs['fields'](_0x31dbc3['query']['fields']));_0x1b668a[_0x32ef('0x34')]=_0x1b668a[_0x32ef('0x34')][_0x32ef('0x35')]?_0x1b668a['attributes']:_0x1a6ed2['model'];if(!_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x36')](_0x32ef('0x37'))){_0x1b668a['limit']=qs['limit'](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1d')]);_0x1b668a[_0x32ef('0x1a')]=qs[_0x32ef('0x1a')](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1a')]);}_0x1b668a[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_0x31dbc3[_0x32ef('0x32')]['sort']);_0x1b668a[_0x32ef('0x3a')]=qs[_0x32ef('0x3b')](_[_0x32ef('0x3c')](_0x31dbc3['query'],_0x1a6ed2[_0x32ef('0x3b')]),_0x575f3e);if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x3d')]){_0x1b668a[_0x32ef('0x3a')]=_[_0x32ef('0x3e')](_0x1b668a[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x2d')](_0x575f3e,function(_0x1cebed){if(_0x1cebed[_0x32ef('0x2f')]!==_0x32ef('0x3f')){var _0xb4db74={};_0xb4db74[_0x1cebed[_0x32ef('0x2a')]]={'$like':'%'+_0x31dbc3['query'][_0x32ef('0x3d')]+'%'};return _0xb4db74;}})});}_0x1b668a=_[_0x32ef('0x3e')]({},_0x1b668a,_0x31dbc3[_0x32ef('0x40')]);var _0x1733e3={'where':_0x1b668a[_0x32ef('0x3a')]};return db[_0x32ef('0x41')][_0x32ef('0x1c')](_0x1733e3)['then'](function(_0x538758){_0x1a122d[_0x32ef('0x1c')]=_0x538758;if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x42')]){_0x1b668a[_0x32ef('0x43')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x32ef('0x44')](_0x1b668a);})[_0x32ef('0x22')](function(_0x5d2f06){_0x1a122d[_0x32ef('0x45')]=_0x5d2f06;return _0x1a122d;})['then'](respondWithFilteredResult(_0x2ac686,_0x1b668a))[_0x32ef('0x46')](handleError(_0x2ac686,null));};exports[_0x32ef('0x47')]=function(_0x37a497,_0x3be46d){var _0x2c2b62={'raw':!![],'where':{'id':_0x37a497[_0x32ef('0x48')]['id']}},_0x2310ae={};_0x2310ae[_0x32ef('0x31')]=_[_0x32ef('0x49')](db[_0x32ef('0x41')]['rawAttributes']);_0x2310ae[_0x32ef('0x32')]=_['keys'](_0x37a497[_0x32ef('0x32')]);_0x2310ae[_0x32ef('0x3b')]=_[_0x32ef('0x33')](_0x2310ae['model'],_0x2310ae[_0x32ef('0x32')]);_0x2c2b62[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x2310ae[_0x32ef('0x31')],qs[_0x32ef('0x4a')](_0x37a497[_0x32ef('0x32')][_0x32ef('0x4a')]));_0x2c2b62['attributes']=_0x2c2b62['attributes'][_0x32ef('0x35')]?_0x2c2b62[_0x32ef('0x34')]:_0x2310ae[_0x32ef('0x31')];if(_0x37a497[_0x32ef('0x32')][_0x32ef('0x42')]){_0x2c2b62[_0x32ef('0x43')]=[{'all':!![]}];}_0x2c2b62=_[_0x32ef('0x3e')]({},_0x2c2b62,_0x37a497[_0x32ef('0x40')]);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2c2b62)[_0x32ef('0x22')](handleEntityNotFound(_0x3be46d,null))[_0x32ef('0x22')](respondWithResult(_0x3be46d,null))[_0x32ef('0x46')](handleError(_0x3be46d,null));};exports['create']=function(_0x420f00,_0x12fbd7){return db[_0x32ef('0x41')][_0x32ef('0x4c')](_0x420f00[_0x32ef('0x4d')],{})[_0x32ef('0x22')](function(_0x278696){var _0x1acded=_0x420f00[_0x32ef('0x4e')][_0x32ef('0x24')]({'plain':!![]});if(!_0x1acded)throw new Error(_0x32ef('0x4f'));if(_0x1acded[_0x32ef('0x50')]===_0x32ef('0x4e')){var _0x326445=_0x278696[_0x32ef('0x24')]({'plain':!![]});var _0x3fb4d8=_0x32ef('0x51');return db[_0x32ef('0x52')]['find']({'where':{'name':_0x3fb4d8,'userProfileId':_0x1acded['userProfileId']},'raw':!![]})[_0x32ef('0x22')](function(_0x259c32){if(_0x259c32&&_0x259c32[_0x32ef('0x53')]===0x0){return db[_0x32ef('0x26')][_0x32ef('0x4c')]({'name':_0x326445[_0x32ef('0x2a')],'resourceId':_0x326445['id'],'type':_0x32ef('0x25'),'sectionId':_0x259c32['id']},{})[_0x32ef('0x22')](function(){return _0x278696;});}else{return _0x278696;}})[_0x32ef('0x46')](function(_0x368bf1){logger[_0x32ef('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x368bf1);throw _0x368bf1;});}return _0x278696;})[_0x32ef('0x22')](respondWithResult(_0x12fbd7,0xc9))[_0x32ef('0x46')](handleError(_0x12fbd7,null));};exports[_0x32ef('0x54')]=function(_0x3fe01f,_0x38314a){if(_0x3fe01f[_0x32ef('0x4d')]['id']){delete _0x3fe01f['body']['id'];}return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x3fe01f[_0x32ef('0x48')]['id']}})['then'](handleEntityNotFound(_0x38314a,null))[_0x32ef('0x22')](saveUpdates(_0x3fe01f['body'],null))[_0x32ef('0x22')](respondWithResult(_0x38314a,null))[_0x32ef('0x46')](handleError(_0x38314a,null));};exports['destroy']=function(_0x206ad5,_0x59e5f9){return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x206ad5[_0x32ef('0x48')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x59e5f9,null))[_0x32ef('0x22')](removeEntity(_0x59e5f9,null))[_0x32ef('0x46')](handleError(_0x59e5f9,null));};exports[_0x32ef('0x55')]=function(_0x56260f,_0x56cc75){var _0xdfa103=0xa;var _0x52232a=['join',_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0x6aae59={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0xbd059e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2ac877=function(_0x3c31d0){return!_[_0x32ef('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x3c31d0);};var _0x17f447=function(_0x5bb114){if(!_0x5bb114||!_0x5bb114['rules'][_0x32ef('0x35')]){return'';}for(var _0x208989='(',_0x10cb37=0x0;_0x10cb37<_0x5bb114['rules'][_0x32ef('0x35')];_0x10cb37+=0x1){_0x10cb37>0x0&&(_0x208989+='\x20'+_0x5bb114[_0x32ef('0x65')]+'\x20');_0x208989+=_0x5bb114[_0x32ef('0x66')][_0x10cb37]['group']?_0x17f447(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x67')]):_0x5bb114['rules'][_0x10cb37]['field']+'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')]+(_0x2ac877(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')])?'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x69')]:'');}return _0x208989+')';};var _0x4c89e8={'where':{'id':_0x56260f[_0x32ef('0x48')]['id']}},_0x285330,_0x63b65,_0x25b6d6,_0x36ed97,_0x21e930;_0x4c89e8=_[_0x32ef('0x3e')]({},_0x4c89e8,_0x56260f[_0x32ef('0x40')]);return db[_0x32ef('0x41')]['find'](_0x4c89e8)[_0x32ef('0x22')](function(_0x29ff58){if(_0x29ff58){_0x285330=_0x29ff58;return _0x29ff58[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0x79ae28){if(_0x79ae28){if(!_0x79ae28['length']){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x63b65=_0x79ae28;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x526fb1){if(_0x526fb1){_0x25b6d6=_[_0x32ef('0x6e')](_0x526fb1,'id');var _0x544045;var _0x216e2f=squel[_0x32ef('0x6f')]();_0x216e2f['from'](_0x285330['table']);for(var _0x2c9f7a=0x0;_0x2c9f7a<_0x63b65[_0x32ef('0x35')];_0x2c9f7a+=0x1){_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x70')]?_0x25b6d6[_0x63b65[_0x2c9f7a]['MetricId']]['metric']:_0x63b65[_0x2c9f7a][_0x32ef('0x71')];_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x6aae59[_0x63b65[_0x2c9f7a][_0x32ef('0x72')]],'%s',_0x544045):_0x544045;_0x544045=_0x63b65[_0x2c9f7a]['format']?_[_0x32ef('0x73')](_0xbd059e[_0x63b65[_0x2c9f7a][_0x32ef('0x74')]],'%s',_0x544045):_0x544045;if(_0x63b65[_0x2c9f7a][_0x32ef('0x75')]){_0x216e2f[_0x32ef('0x67')](_0x544045);}_0x63b65[_0x2c9f7a][_0x32ef('0x76')]&&_0x216e2f[_0x32ef('0x38')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x216e2f[_0x32ef('0x71')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x78')]||_0x544045);}if(_0x285330[_0x32ef('0x79')]){_0x285330[_0x32ef('0x79')]=JSON['parse'](_0x285330['joins']);for(var _0x3a9c97=0x0;_0x3a9c97<_0x285330[_0x32ef('0x79')]['length'];_0x3a9c97+=0x1){if(_0x285330[_0x32ef('0x79')][_0x3a9c97]['type']&&_[_0x32ef('0x63')](_0x52232a,_0x285330[_0x32ef('0x79')][_0x3a9c97][_0x32ef('0x2f')])&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7a')]&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')]&&_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']){_0x216e2f[_0x285330['joins'][_0x3a9c97][_0x32ef('0x2f')]](_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')],null,util['format'](_0x32ef('0x7c'),_0x285330[_0x32ef('0x7d')],_0x285330[_0x32ef('0x79')][_0x3a9c97]['parentKey'],_0x285330['joins'][_0x3a9c97]['foreignTable'],_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']));}}}if(_0x285330[_0x32ef('0x7e')]){_0x285330[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x285330[_0x32ef('0x7e')]);_0x216e2f[_0x32ef('0x3a')](_0x17f447(_0x285330[_0x32ef('0x7e')]['group']));}_0x21e930=_0x216e2f[_0x32ef('0x80')]();_0x216e2f['limit'](_0xdfa103);_0x216e2f['offset'](0x0);logger[_0x32ef('0x81')]('Limited\x20Query:',_0x216e2f[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')]['query'](_0x216e2f[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')][_0x32ef('0x84')][_0x32ef('0x85')]});}})[_0x32ef('0x22')](respondWithResult(_0x56cc75,null))[_0x32ef('0x46')](handleError(_0x56cc75,null));};function runReport(_0x4b5506,_0x51736f,_0x35b10d){var _0x5e0b55=_0x51736f[_0x32ef('0x2a')];var _0x266688=0xa;var _0x114d8e=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),'cross_join'];var _0x3232ca={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':_0x32ef('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x211fb1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0xfb4845=function(_0x21067e){return!_[_0x32ef('0x63')](['IS\x20NULL',_0x32ef('0x8b'),_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x21067e);};var _0x35653b=function(_0x5ea727){if(!_0x5ea727||!_0x5ea727[_0x32ef('0x66')]['length']){return'';}for(var _0x43f36e='(',_0x39300f=0x0;_0x39300f<_0x5ea727[_0x32ef('0x66')][_0x32ef('0x35')];_0x39300f+=0x1){_0x39300f>0x0&&(_0x43f36e+='\x20'+_0x5ea727['operator']+'\x20');_0x43f36e+=_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x67')]?_0x35653b(_0x5ea727[_0x32ef('0x66')][_0x39300f]['group']):_0x5ea727['rules'][_0x39300f]['field']+'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')]+(_0xfb4845(_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')])?'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f]['value']:'');}return _0x43f36e+')';};var _0x2678e3={'where':{'id':_0x4b5506['id']}},_0x5b3deb,_0x471de6,_0x7b0ea5,_0xc43e1,_0x4baa7a;_0x2678e3=_[_0x32ef('0x3e')]({},_0x2678e3,_0x35b10d);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2678e3)[_0x32ef('0x22')](function(_0x28bebb){if(_0x28bebb){_0x5b3deb=_0x28bebb;return _0x28bebb['getFields']();}return null;})[_0x32ef('0x22')](function(_0x484df0){if(_0x484df0){if(!_0x484df0[_0x32ef('0x35')]){throw new db[(_0x32ef('0x8c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x471de6=_0x484df0;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x3b9896){if(_0x3b9896){_0x7b0ea5=_['keyBy'](_0x3b9896,'id');var _0x356fd4;var _0x51ca6e=squel['select']();_0x51ca6e[_0x32ef('0x8d')](_0x5b3deb['table']);for(var _0x2237cf=0x0;_0x2237cf<_0x471de6[_0x32ef('0x35')];_0x2237cf+=0x1){_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x70')]?_0x7b0ea5[_0x471de6[_0x2237cf]['MetricId']]['metric']:_0x471de6[_0x2237cf][_0x32ef('0x71')];_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x3232ca[_0x471de6[_0x2237cf][_0x32ef('0x72')]],'%s',_0x356fd4):_0x356fd4;_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x211fb1[_0x471de6[_0x2237cf][_0x32ef('0x74')]],'%s',_0x356fd4):_0x356fd4;if(_0x471de6[_0x2237cf]['groupBy']){_0x51ca6e[_0x32ef('0x67')](_0x356fd4);}_0x471de6[_0x2237cf][_0x32ef('0x76')]&&_0x51ca6e[_0x32ef('0x38')](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x76')]==='DESC'?![]:!![]);_0x51ca6e['field'](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x78')]||_0x356fd4);}if(_0x5b3deb['joins']){_0x5b3deb[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x5b3deb['joins']);for(var _0x5c7594=0x0;_0x5c7594<_0x5b3deb['joins'][_0x32ef('0x35')];_0x5c7594+=0x1){if(_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x2f')]&&_[_0x32ef('0x63')](_0x114d8e,_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x2f')])&&_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x8e')]){_0x51ca6e[_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['type']](_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')],null,util[_0x32ef('0x74')](_0x32ef('0x7c'),_0x5b3deb[_0x32ef('0x7d')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7b')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['foreignKey']));}}}if(_0x5b3deb[_0x32ef('0x7e')]){_0x5b3deb['conditions']=JSON[_0x32ef('0x7f')](_0x5b3deb[_0x32ef('0x7e')]);_0x51ca6e[_0x32ef('0x3a')](_0x35653b(_0x5b3deb[_0x32ef('0x7e')][_0x32ef('0x67')]));}_0x4baa7a=_0x51ca6e['clone']();_0x51ca6e[_0x32ef('0x1d')](_0x266688);_0x51ca6e[_0x32ef('0x1a')](0x0);return;}})[_0x32ef('0x22')](function(){if(_0x51736f[_0x32ef('0x8f')]===_0x32ef('0x90')){return null;}var _0x1cfdd8=_[_0x32ef('0x3e')](_0x51736f,{'name':_0x51736f[_0x32ef('0x91')]||_0x51736f[_0x32ef('0x2a')]||_0x5b3deb['name'],'basename':_0x5e0b55,'savename':util['format']('%s-%s.%s',_0x51736f[_0x32ef('0x2a')]||_0x5b3deb[_0x32ef('0x2a')],require('randomstring')[_0x32ef('0x92')](0x4),_0x51736f['output']||_0x32ef('0x93')),'reportId':_0x5b3deb['id'],'reportType':'default'});return db['AnalyticExtractedReport'][_0x32ef('0x4c')](_0x1cfdd8,{'raw':!![]});})[_0x32ef('0x22')](function(_0x118d2e){if(_0x5b3deb[_0x32ef('0x7d')]===_0x32ef('0x94')){_0x4baa7a['where'](_0x5b3deb[_0x32ef('0x7d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x51736f[_0x32ef('0x95')],_0x51736f['endDate']);}else{_0x4baa7a['where'](_0x5b3deb['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x51736f['startDate'],_0x51736f[_0x32ef('0x96')]);}if(_0x118d2e){logger[_0x32ef('0x97')]('Run\x20Query:',_0x4baa7a[_0x32ef('0x82')]());require(_0x32ef('0x98'))[_0x32ef('0x99')](path[_0x32ef('0x86')](__dirname,_0x32ef('0x9a'),_0x118d2e[_0x32ef('0x8f')]),[_0x118d2e['id'],_0x4baa7a['toString'](),path[_0x32ef('0x86')](__dirname,'../../files/reports',_0x118d2e[_0x32ef('0x9b')]),_0x5e0b55]);return _0x118d2e;}else{var _0x1be713=squel['select']();_0x1be713[_0x32ef('0x8d')]('('+_0x4baa7a['toString']()+')',_0x32ef('0x9c'));_0x1be713[_0x32ef('0x71')](_0x32ef('0x9d'),_0x32ef('0x1c'));_0x4baa7a['limit'](_0x51736f[_0x32ef('0x1d')]||_0x266688);_0x4baa7a[_0x32ef('0x1a')](_0x51736f[_0x32ef('0x1a')]||0x0);return dbH[_0x32ef('0x83')]['query'](_0x1be713[_0x32ef('0x82')](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]})[_0x32ef('0x22')](function(_0x28ef17){if(!_0x28ef17[_0x32ef('0x35')]){_0xc43e1=0x0;}else{_0xc43e1=_0x28ef17[0x0][_0x32ef('0x1c')]||0x0;}return dbH['sequelize'][_0x32ef('0x32')](_0x4baa7a['toString'](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]});})[_0x32ef('0x22')](function(_0x3956e7){return{'rows':_0x3956e7||[],'count':_0xc43e1};});}});}exports['run']=function(_0x8d3b24,_0x642716){return runReport(_0x8d3b24[_0x32ef('0x48')],_0x8d3b24[_0x32ef('0x32')],_0x8d3b24['options'])['then'](respondWithResult(_0x642716,null))['catch'](handleError(_0x642716,null));};exports[_0x32ef('0x9e')]=runReport;exports[_0x32ef('0x32')]=function(_0x4454f3,_0xc92dcc){var _0x3d18b9=0xa;var _0x9233cb=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0xa76912={'SUM':'SUM(%s)','COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0x1526a1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0x2d4d2f=function(_0x292488){return!_[_0x32ef('0x63')]([_0x32ef('0x9f'),_0x32ef('0x8b'),_0x32ef('0x64'),_0x32ef('0xa0')],_0x292488);};var _0x50b674=function(_0x379d40){if(!_0x379d40||!_0x379d40[_0x32ef('0x66')][_0x32ef('0x35')]){return'';}for(var _0x4b7a4d='(',_0x16525b=0x0;_0x16525b<_0x379d40['rules'][_0x32ef('0x35')];_0x16525b+=0x1){_0x16525b>0x0&&(_0x4b7a4d+='\x20'+_0x379d40[_0x32ef('0x65')]+'\x20');_0x4b7a4d+=_0x379d40[_0x32ef('0x66')][_0x16525b]['group']?_0x50b674(_0x379d40[_0x32ef('0x66')][_0x16525b]['group']):_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x71')]+'\x20'+_0x379d40['rules'][_0x16525b][_0x32ef('0x68')]+(_0x2d4d2f(_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x68')])?'\x20'+_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x69')]:'');}return _0x4b7a4d+')';};var _0x264075={'where':{'id':_0x4454f3[_0x32ef('0x48')]['id']}},_0x3798d1,_0x4befa9,_0x493ae9,_0x143d39,_0x497948;_0x264075=_[_0x32ef('0x3e')]({},_0x264075,_0x4454f3['options']);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x264075)['then'](function(_0x1200c9){if(_0x1200c9){_0x3798d1=_0x1200c9;return _0x1200c9[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0xa5f787){if(_0xa5f787){if(!_0xa5f787[_0x32ef('0x35')]){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x4befa9=_0xa5f787;return db['AnalyticMetric'][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x55ad11){if(_0x55ad11){_0x493ae9=_[_0x32ef('0x6e')](_0x55ad11,'id');var _0x2971a8;var _0x522c22=squel[_0x32ef('0x6f')]();_0x522c22[_0x32ef('0x8d')](_0x3798d1['table']);for(var _0xb41a01=0x0;_0xb41a01<_0x4befa9[_0x32ef('0x35')];_0xb41a01+=0x1){_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x70')]?_0x493ae9[_0x4befa9[_0xb41a01][_0x32ef('0x70')]][_0x32ef('0xa1')]:_0x4befa9[_0xb41a01][_0x32ef('0x71')];_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x72')]?_['replace'](_0xa76912[_0x4befa9[_0xb41a01]['function']],'%s',_0x2971a8):_0x2971a8;_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x1526a1[_0x4befa9[_0xb41a01][_0x32ef('0x74')]],'%s',_0x2971a8):_0x2971a8;if(_0x4befa9[_0xb41a01]['groupBy']){_0x522c22[_0x32ef('0x67')](_0x2971a8);}_0x4befa9[_0xb41a01][_0x32ef('0x76')]&&_0x522c22['order'](_0x2971a8,_0x4befa9[_0xb41a01][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x522c22['field'](_0x2971a8,_0x4befa9[_0xb41a01]['alias']||_0x2971a8);}if(_0x3798d1[_0x32ef('0x79')]){_0x3798d1[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x3798d1['joins']);for(var _0x5f4eab=0x0;_0x5f4eab<_0x3798d1['joins'][_0x32ef('0x35')];_0x5f4eab+=0x1){if(_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')]&&_['includes'](_0x9233cb,_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')])&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['parentKey']&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')]&&_0x3798d1['joins'][_0x5f4eab]['foreignKey']){_0x522c22[_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['type']](_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3798d1[_0x32ef('0x7d')],_0x3798d1['joins'][_0x5f4eab][_0x32ef('0x7a')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x8e')]));}}}if(_0x3798d1[_0x32ef('0x7e')]){_0x3798d1[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x3798d1[_0x32ef('0x7e')]);_0x522c22[_0x32ef('0x3a')](_0x50b674(_0x3798d1['conditions']['group']));}_0x497948=_0x522c22[_0x32ef('0x80')]();_0x522c22[_0x32ef('0x1d')](_0x3d18b9);_0x522c22[_0x32ef('0x1a')](0x0);logger[_0x32ef('0x81')](_0x32ef('0xa2'),_0x522c22[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')][_0x32ef('0x32')](_0x522c22[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')]['QueryTypes'][_0x32ef('0x85')]});}})[_0x32ef('0x22')](function(){return{'sql':_0x497948[_0x32ef('0x82')]()};})[_0x32ef('0x22')](respondWithResult(_0xc92dcc,null))[_0x32ef('0x46')](handleError(_0xc92dcc,null));};
\ No newline at end of file
+var _0x31f0=['fullPath','%s-%s.%s','randomstring','generate','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','DATE(%s)','keyBy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','DefaultReports','destroy','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','include','findAll','rows','catch','params','length','find','create','user','role','Reports','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','right_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','function','replace','format','orderBy','DESC','field','alias','parse','joins','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','AVG(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','getFields','MetricId','metric','groupBy','output','web'];(function(_0x540954,_0x52ee3a){var _0x3f94d6=function(_0x15ff99){while(--_0x15ff99){_0x540954['push'](_0x540954['shift']());}};_0x3f94d6(++_0x52ee3a);}(_0x31f0,0xb7));var _0x031f=function(_0x12794e,_0x340e2e){_0x12794e=_0x12794e-0x0;var _0x1e9570=_0x31f0[_0x12794e];return _0x1e9570;};'use strict';var emlformat=require(_0x031f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x031f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x031f('0x2'));var moment=require(_0x031f('0x3'));var BPromise=require(_0x031f('0x4'));var Mustache=require(_0x031f('0x5'));var util=require('util');var path=require(_0x031f('0x6'));var sox=require(_0x031f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x031f('0x8'));var squel=require('squel');var crypto=require(_0x031f('0x9'));var jsforce=require(_0x031f('0xa'));var deskjs=require(_0x031f('0xb'));var toCsv=require(_0x031f('0xc'));var querystring=require('querystring');var Papa=require(_0x031f('0xd'));var Redis=require(_0x031f('0xe'));var authService=require(_0x031f('0xf'));var qs=require(_0x031f('0x10'));var as=require(_0x031f('0x11'));var hardwareService=require(_0x031f('0x12'));var logger=require(_0x031f('0x13'))(_0x031f('0x14'));var utils=require('../../config/utils');var config=require(_0x031f('0x15'));var licenseUtil=require(_0x031f('0x16'));var db=require(_0x031f('0x17'))['db'];var dbH=require(_0x031f('0x17'))[_0x031f('0x18')];function respondWithStatusCode(_0x405896,_0x1c230d){_0x1c230d=_0x1c230d||0xcc;return function(_0x5d0457){if(_0x5d0457){return _0x405896[_0x031f('0x19')](_0x1c230d);}return _0x405896[_0x031f('0x1a')](_0x1c230d)[_0x031f('0x1b')]();};}function respondWithResult(_0x2e3dfe,_0x2ea549){_0x2ea549=_0x2ea549||0xc8;return function(_0x57f9c0){if(_0x57f9c0){return _0x2e3dfe['status'](_0x2ea549)[_0x031f('0x1c')](_0x57f9c0);}};}function respondWithFilteredResult(_0x3a10aa,_0xe4fc1d){return function(_0x286177){if(_0x286177){var _0x5196b1=typeof _0xe4fc1d[_0x031f('0x1d')]===_0x031f('0x1e')&&typeof _0xe4fc1d['limit']===_0x031f('0x1e');var _0x535e70=_0x286177[_0x031f('0x1f')];var _0x5f2199=_0x5196b1?0x0:_0xe4fc1d[_0x031f('0x1d')];var _0xaa155=_0x5196b1?_0x286177[_0x031f('0x1f')]:_0xe4fc1d[_0x031f('0x1d')]+_0xe4fc1d[_0x031f('0x20')];var _0x2825ef;if(_0xaa155>=_0x535e70){_0xaa155=_0x535e70;_0x2825ef=0xc8;}else{_0x2825ef=0xce;}_0x3a10aa[_0x031f('0x1a')](_0x2825ef);return _0x3a10aa[_0x031f('0x21')](_0x031f('0x22'),_0x5f2199+'-'+_0xaa155+'/'+_0x535e70)['json'](_0x286177);}return null;};}function patchUpdates(_0xf72793){return function(_0x33926c){try{jsonpatch[_0x031f('0x23')](_0x33926c,_0xf72793,!![]);}catch(_0x4d6706){return BPromise['reject'](_0x4d6706);}return _0x33926c[_0x031f('0x24')]();};}function saveUpdates(_0x4d0f92,_0x3472a2){return function(_0x57f6c4){if(_0x57f6c4){return _0x57f6c4['update'](_0x4d0f92)['then'](function(_0x971691){return _0x971691;});}return null;};}function removeEntity(_0x12c406,_0x2920cd){return function(_0x4c8126){if(_0x4c8126){return _0x4c8126['destroy']()[_0x031f('0x25')](function(){var _0x5a64c0=_0x4c8126[_0x031f('0x26')]({'plain':!![]});var _0x1f5a14=_0x031f('0x27');return db['UserProfileResource'][_0x031f('0x28')]({'where':{'type':_0x1f5a14,'resourceId':_0x5a64c0['id']}})[_0x031f('0x25')](function(){return _0x4c8126;});})['then'](function(){_0x12c406[_0x031f('0x1a')](0xcc)[_0x031f('0x1b')]();});}};}function handleEntityNotFound(_0x2403e9,_0x5395ea){return function(_0xa308b){if(!_0xa308b){_0x2403e9[_0x031f('0x19')](0x194);}return _0xa308b;};}function handleError(_0xb6ed6c,_0xaf5bea){_0xaf5bea=_0xaf5bea||0x1f4;return function(_0xfaa36){logger[_0x031f('0x29')](_0xfaa36['stack']);if(_0xfaa36[_0x031f('0x2a')]){delete _0xfaa36[_0x031f('0x2a')];}_0xb6ed6c[_0x031f('0x1a')](_0xaf5bea)[_0x031f('0x2b')](_0xfaa36);};}exports[_0x031f('0x2c')]=function(_0x2d24f0,_0x378692){var _0x87dc07={},_0x2034ac={},_0xfc4a89={'count':0x0,'rows':[]};var _0x2cf3a8=_['map'](db[_0x031f('0x2d')][_0x031f('0x2e')],function(_0xb3a6bd){return{'name':_0xb3a6bd[_0x031f('0x2f')],'type':_0xb3a6bd[_0x031f('0x30')][_0x031f('0x31')]};});_0x2034ac[_0x031f('0x32')]=_[_0x031f('0x33')](_0x2cf3a8,_0x031f('0x2a'));_0x2034ac[_0x031f('0x34')]=_[_0x031f('0x35')](_0x2d24f0[_0x031f('0x34')]);_0x2034ac[_0x031f('0x36')]=_['intersection'](_0x2034ac[_0x031f('0x32')],_0x2034ac[_0x031f('0x34')]);_0x87dc07['attributes']=_[_0x031f('0x37')](_0x2034ac[_0x031f('0x32')],qs['fields'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x38')]));_0x87dc07[_0x031f('0x39')]=_0x87dc07[_0x031f('0x39')]['length']?_0x87dc07['attributes']:_0x2034ac[_0x031f('0x32')];if(!_0x2d24f0['query'][_0x031f('0x3a')](_0x031f('0x3b'))){_0x87dc07[_0x031f('0x20')]=qs['limit'](_0x2d24f0['query'][_0x031f('0x20')]);_0x87dc07['offset']=qs['offset'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x1d')]);}_0x87dc07[_0x031f('0x3c')]=qs[_0x031f('0x3d')](_0x2d24f0[_0x031f('0x34')][_0x031f('0x3d')]);_0x87dc07[_0x031f('0x3e')]=qs['filters'](_[_0x031f('0x3f')](_0x2d24f0[_0x031f('0x34')],_0x2034ac[_0x031f('0x36')]),_0x2cf3a8);if(_0x2d24f0[_0x031f('0x34')]['filter']){_0x87dc07[_0x031f('0x3e')]=_[_0x031f('0x40')](_0x87dc07[_0x031f('0x3e')],{'$or':_['map'](_0x2cf3a8,function(_0x24ec95){if(_0x24ec95[_0x031f('0x30')]!=='VIRTUAL'){var _0x36bafa={};_0x36bafa[_0x24ec95[_0x031f('0x2a')]]={'$like':'%'+_0x2d24f0['query']['filter']+'%'};return _0x36bafa;}})});}_0x87dc07=_[_0x031f('0x40')]({},_0x87dc07,_0x2d24f0[_0x031f('0x41')]);var _0x9efbc4={'where':_0x87dc07[_0x031f('0x3e')]};return db[_0x031f('0x2d')][_0x031f('0x1f')](_0x9efbc4)[_0x031f('0x25')](function(_0x5a212c){_0xfc4a89[_0x031f('0x1f')]=_0x5a212c;if(_0x2d24f0[_0x031f('0x34')]['includeAll']){_0x87dc07[_0x031f('0x42')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x031f('0x43')](_0x87dc07);})[_0x031f('0x25')](function(_0x56dd24){_0xfc4a89[_0x031f('0x44')]=_0x56dd24;return _0xfc4a89;})[_0x031f('0x25')](respondWithFilteredResult(_0x378692,_0x87dc07))[_0x031f('0x45')](handleError(_0x378692,null));};exports['show']=function(_0x98747f,_0x213e1c){var _0x1d3324={'raw':!![],'where':{'id':_0x98747f[_0x031f('0x46')]['id']}},_0x2a6cba={};_0x2a6cba[_0x031f('0x32')]=_[_0x031f('0x35')](db[_0x031f('0x2d')][_0x031f('0x2e')]);_0x2a6cba['query']=_[_0x031f('0x35')](_0x98747f[_0x031f('0x34')]);_0x2a6cba[_0x031f('0x36')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],_0x2a6cba[_0x031f('0x34')]);_0x1d3324[_0x031f('0x39')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],qs['fields'](_0x98747f[_0x031f('0x34')]['fields']));_0x1d3324['attributes']=_0x1d3324[_0x031f('0x39')][_0x031f('0x47')]?_0x1d3324[_0x031f('0x39')]:_0x2a6cba[_0x031f('0x32')];if(_0x98747f[_0x031f('0x34')]['includeAll']){_0x1d3324[_0x031f('0x42')]=[{'all':!![]}];}_0x1d3324=_[_0x031f('0x40')]({},_0x1d3324,_0x98747f[_0x031f('0x41')]);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0x1d3324)[_0x031f('0x25')](handleEntityNotFound(_0x213e1c,null))[_0x031f('0x25')](respondWithResult(_0x213e1c,null))[_0x031f('0x45')](handleError(_0x213e1c,null));};exports[_0x031f('0x49')]=function(_0x12d28e,_0x5caeb5){return db['AnalyticDefaultReport'][_0x031f('0x49')](_0x12d28e['body'],{})[_0x031f('0x25')](function(_0x3bba44){var _0x5a29e0=_0x12d28e[_0x031f('0x4a')]['get']({'plain':!![]});if(!_0x5a29e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a29e0[_0x031f('0x4b')]==='user'){var _0x16bade=_0x3bba44['get']({'plain':!![]});var _0x11bf43=_0x031f('0x4c');return db['UserProfileSection'][_0x031f('0x48')]({'where':{'name':_0x11bf43,'userProfileId':_0x5a29e0[_0x031f('0x4d')]},'raw':!![]})['then'](function(_0x46471a){if(_0x46471a&&_0x46471a['autoAssociation']===0x0){return db[_0x031f('0x4e')]['create']({'name':_0x16bade[_0x031f('0x2a')],'resourceId':_0x16bade['id'],'type':_0x031f('0x27'),'sectionId':_0x46471a['id']},{})[_0x031f('0x25')](function(){return _0x3bba44;});}else{return _0x3bba44;}})[_0x031f('0x45')](function(_0x691a68){logger['error'](_0x031f('0x4f'),_0x691a68);throw _0x691a68;});}return _0x3bba44;})['then'](respondWithResult(_0x5caeb5,0xc9))[_0x031f('0x45')](handleError(_0x5caeb5,null));};exports[_0x031f('0x50')]=function(_0x4d49f8,_0x1f9c55){if(_0x4d49f8[_0x031f('0x51')]['id']){delete _0x4d49f8['body']['id'];}return db[_0x031f('0x2d')][_0x031f('0x48')]({'where':{'id':_0x4d49f8[_0x031f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f9c55,null))[_0x031f('0x25')](saveUpdates(_0x4d49f8['body'],null))[_0x031f('0x25')](respondWithResult(_0x1f9c55,null))['catch'](handleError(_0x1f9c55,null));};exports[_0x031f('0x28')]=function(_0x561a2b,_0xa52a54){return db[_0x031f('0x2d')]['find']({'where':{'id':_0x561a2b['params']['id']}})[_0x031f('0x25')](handleEntityNotFound(_0xa52a54,null))[_0x031f('0x25')](removeEntity(_0xa52a54,null))['catch'](handleError(_0xa52a54,null));};exports[_0x031f('0x52')]=function(_0xb44c73,_0x255003){var _0x286d4e=0xa;var _0x21a89d=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),'cross_join'];var _0xe452c2={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x031f('0x58'),'MIN':_0x031f('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x198e2e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x031f('0x5d')};var _0xcf8b7=function(_0x4a7fbb){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),'IS\x20NOT\x20NULL',_0x031f('0x60'),_0x031f('0x61')],_0x4a7fbb);};var _0x451c71=function(_0x22d211){if(!_0x22d211||!_0x22d211[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x2ddf15='(',_0x4527e5=0x0;_0x4527e5<_0x22d211[_0x031f('0x62')]['length'];_0x4527e5+=0x1){_0x4527e5>0x0&&(_0x2ddf15+='\x20'+_0x22d211[_0x031f('0x63')]+'\x20');_0x2ddf15+=_0x22d211['rules'][_0x4527e5][_0x031f('0x64')]?_0x451c71(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x64')]):_0x22d211['rules'][_0x4527e5]['field']+'\x20'+_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')]+(_0xcf8b7(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')])?'\x20'+_0x22d211['rules'][_0x4527e5][_0x031f('0x66')]:'');}return _0x2ddf15+')';};var _0x5a181c={'where':{'id':_0xb44c73[_0x031f('0x46')]['id']}},_0x478982,_0x2179ee,_0x534bae,_0x50d618,_0x71e67;_0x5a181c=_[_0x031f('0x40')]({},_0x5a181c,_0xb44c73[_0x031f('0x41')]);return db[_0x031f('0x2d')]['find'](_0x5a181c)['then'](function(_0x214eec){if(_0x214eec){_0x478982=_0x214eec;return _0x214eec['getFields']();}return null;})[_0x031f('0x25')](function(_0xa921b2){if(_0xa921b2){if(!_0xa921b2['length']){throw new db[(_0x031f('0x67'))][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2179ee=_0xa921b2;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5bea08){if(_0x5bea08){_0x534bae=_['keyBy'](_0x5bea08,'id');var _0x3bcc7e;var _0x232b62=squel[_0x031f('0x6b')]();_0x232b62[_0x031f('0x6c')](_0x478982[_0x031f('0x6d')]);for(var _0x26fa57=0x0;_0x26fa57<_0x2179ee[_0x031f('0x47')];_0x26fa57+=0x1){_0x3bcc7e=_0x2179ee[_0x26fa57]['MetricId']?_0x534bae[_0x2179ee[_0x26fa57]['MetricId']]['metric']:_0x2179ee[_0x26fa57]['field'];_0x3bcc7e=_0x2179ee[_0x26fa57][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xe452c2[_0x2179ee[_0x26fa57][_0x031f('0x6e')]],'%s',_0x3bcc7e):_0x3bcc7e;_0x3bcc7e=_0x2179ee[_0x26fa57]['format']?_[_0x031f('0x6f')](_0x198e2e[_0x2179ee[_0x26fa57][_0x031f('0x70')]],'%s',_0x3bcc7e):_0x3bcc7e;if(_0x2179ee[_0x26fa57]['groupBy']){_0x232b62[_0x031f('0x64')](_0x3bcc7e);}_0x2179ee[_0x26fa57][_0x031f('0x71')]&&_0x232b62[_0x031f('0x3c')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x232b62[_0x031f('0x73')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x74')]||_0x3bcc7e);}if(_0x478982['joins']){_0x478982['joins']=JSON[_0x031f('0x75')](_0x478982['joins']);for(var _0x2ed9c1=0x0;_0x2ed9c1<_0x478982['joins'][_0x031f('0x47')];_0x2ed9c1+=0x1){if(_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]&&_['includes'](_0x21a89d,_0x478982[_0x031f('0x76')][_0x2ed9c1]['type'])&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x77')]&&_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable']&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]){_0x232b62[_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]](_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable'],null,util['format'](_0x031f('0x79'),_0x478982[_0x031f('0x6d')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x77')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x7a')],_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]));}}}if(_0x478982[_0x031f('0x7b')]){_0x478982['conditions']=JSON[_0x031f('0x75')](_0x478982[_0x031f('0x7b')]);_0x232b62[_0x031f('0x3e')](_0x451c71(_0x478982['conditions'][_0x031f('0x64')]));}_0x71e67=_0x232b62[_0x031f('0x7c')]();_0x232b62['limit'](_0x286d4e);_0x232b62[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x232b62[_0x031f('0x7f')]());return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232b62[_0x031f('0x7f')](),{'type':dbH['sequelize'][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](respondWithResult(_0x255003,null))['catch'](handleError(_0x255003,null));};function runReport(_0x4f4aff,_0x26de7c,_0x5bd344){var _0x54f02d=_0x26de7c[_0x031f('0x2a')];var _0x184bbd=0xa;var _0x1c8055=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),_0x031f('0x83')];var _0x32c626={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':_0x031f('0x59'),'AVG':_0x031f('0x85'),'GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6970f5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x031f('0x86'),'ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x510bb6=function(_0x3cfaa4){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x3cfaa4);};var _0x5e0853=function(_0x263658){if(!_0x263658||!_0x263658[_0x031f('0x62')]['length']){return'';}for(var _0x25ea89='(',_0x2f2e96=0x0;_0x2f2e96<_0x263658[_0x031f('0x62')][_0x031f('0x47')];_0x2f2e96+=0x1){_0x2f2e96>0x0&&(_0x25ea89+='\x20'+_0x263658[_0x031f('0x63')]+'\x20');_0x25ea89+=_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x64')]?_0x5e0853(_0x263658['rules'][_0x2f2e96][_0x031f('0x64')]):_0x263658['rules'][_0x2f2e96][_0x031f('0x73')]+'\x20'+_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x65')]+(_0x510bb6(_0x263658['rules'][_0x2f2e96]['condition'])?'\x20'+_0x263658['rules'][_0x2f2e96][_0x031f('0x66')]:'');}return _0x25ea89+')';};var _0xee744={'where':{'id':_0x4f4aff['id']}},_0x8f0afd,_0x2985fe,_0x290f82,_0x307246,_0x232aa0;_0xee744=_['merge']({},_0xee744,_0x5bd344);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0xee744)[_0x031f('0x25')](function(_0x54d86e){if(_0x54d86e){_0x8f0afd=_0x54d86e;return _0x54d86e[_0x031f('0x89')]();}return null;})['then'](function(_0x1c31d5){if(_0x1c31d5){if(!_0x1c31d5[_0x031f('0x47')]){throw new db['Sequelize'][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2985fe=_0x1c31d5;return db['AnalyticMetric'][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x1b588e){if(_0x1b588e){_0x290f82=_['keyBy'](_0x1b588e,'id');var _0xa9b5e2;var _0x31504b=squel[_0x031f('0x6b')]();_0x31504b[_0x031f('0x6c')](_0x8f0afd[_0x031f('0x6d')]);for(var _0x2b3326=0x0;_0x2b3326<_0x2985fe['length'];_0x2b3326+=0x1){_0xa9b5e2=_0x2985fe[_0x2b3326][_0x031f('0x8a')]?_0x290f82[_0x2985fe[_0x2b3326][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x2985fe[_0x2b3326][_0x031f('0x73')];_0xa9b5e2=_0x2985fe[_0x2b3326]['function']?_[_0x031f('0x6f')](_0x32c626[_0x2985fe[_0x2b3326][_0x031f('0x6e')]],'%s',_0xa9b5e2):_0xa9b5e2;_0xa9b5e2=_0x2985fe[_0x2b3326]['format']?_[_0x031f('0x6f')](_0x6970f5[_0x2985fe[_0x2b3326][_0x031f('0x70')]],'%s',_0xa9b5e2):_0xa9b5e2;if(_0x2985fe[_0x2b3326][_0x031f('0x8c')]){_0x31504b[_0x031f('0x64')](_0xa9b5e2);}_0x2985fe[_0x2b3326][_0x031f('0x71')]&&_0x31504b[_0x031f('0x3c')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x31504b[_0x031f('0x73')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x74')]||_0xa9b5e2);}if(_0x8f0afd[_0x031f('0x76')]){_0x8f0afd[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x76')]);for(var _0x2433ce=0x0;_0x2433ce<_0x8f0afd['joins'][_0x031f('0x47')];_0x2433ce+=0x1){if(_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0x1c8055,_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')])&&_0x8f0afd['joins'][_0x2433ce]['parentKey']&&_0x8f0afd['joins'][_0x2433ce][_0x031f('0x7a')]&&_0x8f0afd[_0x031f('0x76')][_0x2433ce]['foreignKey']){_0x31504b[_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]](_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],null,util['format'](_0x031f('0x79'),_0x8f0afd[_0x031f('0x6d')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x77')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x78')]));}}}if(_0x8f0afd[_0x031f('0x7b')]){_0x8f0afd[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x7b')]);_0x31504b['where'](_0x5e0853(_0x8f0afd[_0x031f('0x7b')][_0x031f('0x64')]));}_0x232aa0=_0x31504b['clone']();_0x31504b[_0x031f('0x20')](_0x184bbd);_0x31504b[_0x031f('0x1d')](0x0);return;}})['then'](function(){if(_0x26de7c[_0x031f('0x8d')]===_0x031f('0x8e')){return null;}var _0x1ade73=_[_0x031f('0x40')](_0x26de7c,{'name':_0x26de7c[_0x031f('0x8f')]||_0x26de7c[_0x031f('0x2a')]||_0x8f0afd[_0x031f('0x2a')],'basename':_0x54f02d,'savename':util[_0x031f('0x70')](_0x031f('0x90'),_0x26de7c['name']||_0x8f0afd[_0x031f('0x2a')],require(_0x031f('0x91'))[_0x031f('0x92')](0x4),_0x26de7c['output']||'csv'),'reportId':_0x8f0afd['id'],'reportType':_0x031f('0x93')});return db['AnalyticExtractedReport'][_0x031f('0x49')](_0x1ade73,{'raw':!![]});})[_0x031f('0x25')](function(_0x4a96f2){if(_0x8f0afd[_0x031f('0x6d')]===_0x031f('0x94')){_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x95'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}else{_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x98'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}if(_0x4a96f2){logger[_0x031f('0x99')]('Run\x20Query:',_0x232aa0['toString']());require(_0x031f('0x9a'))['fork'](path[_0x031f('0x53')](__dirname,_0x031f('0x9b'),_0x4a96f2[_0x031f('0x8d')]),[_0x4a96f2['id'],_0x232aa0['toString'](),path[_0x031f('0x53')](__dirname,_0x031f('0x9c'),_0x4a96f2['savename']),_0x54f02d]);return _0x4a96f2;}else{var _0x185085=squel[_0x031f('0x6b')]();_0x185085[_0x031f('0x6c')]('('+_0x232aa0[_0x031f('0x7f')]()+')',_0x031f('0x9d'));_0x185085[_0x031f('0x73')](_0x031f('0x9e'),'count');_0x232aa0[_0x031f('0x20')](_0x26de7c[_0x031f('0x20')]||_0x184bbd);_0x232aa0[_0x031f('0x1d')](_0x26de7c[_0x031f('0x1d')]||0x0);return dbH['sequelize']['query'](_0x185085[_0x031f('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x031f('0x82')]})['then'](function(_0x579ade){if(!_0x579ade[_0x031f('0x47')]){_0x307246=0x0;}else{_0x307246=_0x579ade[0x0][_0x031f('0x1f')]||0x0;}return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232aa0[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')]['QueryTypes'][_0x031f('0x82')]});})[_0x031f('0x25')](function(_0x52a3f0){return{'rows':_0x52a3f0||[],'count':_0x307246};});}});}exports[_0x031f('0x9f')]=function(_0x355e1a,_0x30c32f){return runReport(_0x355e1a[_0x031f('0x46')],_0x355e1a['query'],_0x355e1a['options'])['then'](respondWithResult(_0x30c32f,null))[_0x031f('0x45')](handleError(_0x30c32f,null));};exports[_0x031f('0xa0')]=runReport;exports[_0x031f('0x34')]=function(_0x3ec98a,_0x3ed663){var _0xac324f=0xa;var _0xcf0af9=[_0x031f('0x53'),_0x031f('0x54'),'right_join',_0x031f('0x83')];var _0xde544e={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x84cd0c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x031f('0xa1'),'HOUR':'HOUR(%s)','ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':_0x031f('0x5d')};var _0x24aff3=function(_0x35a1f1){return!_[_0x031f('0x5e')](['IS\x20NULL',_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x35a1f1);};var _0x3cb099=function(_0x4a4d8f){if(!_0x4a4d8f||!_0x4a4d8f[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x578201='(',_0xdbf09f=0x0;_0xdbf09f<_0x4a4d8f['rules'][_0x031f('0x47')];_0xdbf09f+=0x1){_0xdbf09f>0x0&&(_0x578201+='\x20'+_0x4a4d8f[_0x031f('0x63')]+'\x20');_0x578201+=_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x64')]?_0x3cb099(_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['group']):_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['field']+'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x65')]+(_0x24aff3(_0x4a4d8f['rules'][_0xdbf09f][_0x031f('0x65')])?'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x66')]:'');}return _0x578201+')';};var _0x123b4d={'where':{'id':_0x3ec98a['params']['id']}},_0x3f80b5,_0x53cd67,_0x516f11,_0x50cdb2,_0x2e9a3b;_0x123b4d=_[_0x031f('0x40')]({},_0x123b4d,_0x3ec98a[_0x031f('0x41')]);return db[_0x031f('0x2d')][_0x031f('0x48')](_0x123b4d)[_0x031f('0x25')](function(_0x53911d){if(_0x53911d){_0x3f80b5=_0x53911d;return _0x53911d[_0x031f('0x89')]();}return null;})['then'](function(_0x30fa18){if(_0x30fa18){if(!_0x30fa18[_0x031f('0x47')]){throw new db[(_0x031f('0x67'))]['ValidationErrorItem'](_0x031f('0x69'),0x193);}_0x53cd67=_0x30fa18;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5b092c){if(_0x5b092c){_0x516f11=_[_0x031f('0xa2')](_0x5b092c,'id');var _0x7b8699;var _0x14a497=squel[_0x031f('0x6b')]();_0x14a497[_0x031f('0x6c')](_0x3f80b5[_0x031f('0x6d')]);for(var _0x59fd9a=0x0;_0x59fd9a<_0x53cd67[_0x031f('0x47')];_0x59fd9a+=0x1){_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x8a')]?_0x516f11[_0x53cd67[_0x59fd9a][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x53cd67[_0x59fd9a][_0x031f('0x73')];_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xde544e[_0x53cd67[_0x59fd9a]['function']],'%s',_0x7b8699):_0x7b8699;_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x70')]?_[_0x031f('0x6f')](_0x84cd0c[_0x53cd67[_0x59fd9a][_0x031f('0x70')]],'%s',_0x7b8699):_0x7b8699;if(_0x53cd67[_0x59fd9a][_0x031f('0x8c')]){_0x14a497[_0x031f('0x64')](_0x7b8699);}_0x53cd67[_0x59fd9a]['orderBy']&&_0x14a497[_0x031f('0x3c')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x14a497[_0x031f('0x73')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x74')]||_0x7b8699);}if(_0x3f80b5['joins']){_0x3f80b5[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x76')]);for(var _0x110747=0x0;_0x110747<_0x3f80b5[_0x031f('0x76')]['length'];_0x110747+=0x1){if(_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0xcf0af9,_0x3f80b5['joins'][_0x110747][_0x031f('0x30')])&&_0x3f80b5['joins'][_0x110747][_0x031f('0x77')]&&_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')]&&_0x3f80b5[_0x031f('0x76')][_0x110747]['foreignKey']){_0x14a497[_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]](_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')],null,util[_0x031f('0x70')]('%s.%s\x20=\x20%s.%s',_0x3f80b5[_0x031f('0x6d')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x77')],_0x3f80b5['joins'][_0x110747][_0x031f('0x7a')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x78')]));}}}if(_0x3f80b5['conditions']){_0x3f80b5[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x7b')]);_0x14a497[_0x031f('0x3e')](_0x3cb099(_0x3f80b5[_0x031f('0x7b')]['group']));}_0x2e9a3b=_0x14a497[_0x031f('0x7c')]();_0x14a497[_0x031f('0x20')](_0xac324f);_0x14a497[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x14a497[_0x031f('0x7f')]());return dbH['sequelize']['query'](_0x14a497[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](function(){return{'sql':_0x2e9a3b[_0x031f('0x7f')]()};})[_0x031f('0x25')](respondWithResult(_0x3ed663,null))['catch'](handleError(_0x3ed663,null));};
\ No newline at end of file
index 377dbec..4dc7a6c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2885=['util','../../config/logger','api','bluebird','rimraf','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash'];(function(_0x503f1d,_0x5a83d0){var _0x184e02=function(_0x34e5b4){while(--_0x34e5b4){_0x503f1d['push'](_0x503f1d['shift']());}};_0x184e02(++_0x5a83d0);}(_0x2885,0x1ac));var _0x5288=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x2885[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0x5288('0x0'));var util=require(_0x5288('0x1'));var logger=require(_0x5288('0x2'))(_0x5288('0x3'));var moment=require('moment');var BPromise=require(_0x5288('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5288('0x5'));var config=require('../../config/environment');var attributes=require(_0x5288('0x6'));module[_0x5288('0x7')]=function(_0x57f165,_0x2acd2b){return _0x57f165[_0x5288('0x8')](_0x5288('0x9'),attributes,{'tableName':_0x5288('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5e6d=['exports','AnalyticDefaultReport','analytics_default_reports','lodash','moment','bluebird','path','rimraf','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x32f1e6,_0x4789d0){var _0x1600bc=function(_0x53180a){while(--_0x53180a){_0x32f1e6['push'](_0x32f1e6['shift']());}};_0x1600bc(++_0x4789d0);}(_0x5e6d,0xb7));var _0xd5e6=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x5e6d[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0xd5e6('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd5e6('0x1'));var BPromise=require(_0xd5e6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd5e6('0x3'));var rimraf=require(_0xd5e6('0x4'));var config=require(_0xd5e6('0x5'));var attributes=require(_0xd5e6('0x6'));module[_0xd5e6('0x7')]=function(_0x4e62b8,_0x38a386){return _0x4e62b8['define'](_0xd5e6('0x8'),attributes,{'tableName':_0xd5e6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f06b6a0..b6424c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbab5=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x4d6338,_0x2b44bb){var _0xbb9b7c=function(_0x404be4){while(--_0x404be4){_0x4d6338['push'](_0x4d6338['shift']());}};_0xbb9b7c(++_0x2b44bb);}(_0xbab5,0x1df));var _0x5bab=function(_0x51f4d3,_0x3a1271){_0x51f4d3=_0x51f4d3-0x0;var _0xbb3a38=_0xbab5[_0x51f4d3];return _0xbb3a38;};'use strict';var _=require('lodash');var util=require(_0x5bab('0x0'));var moment=require(_0x5bab('0x1'));var BPromise=require(_0x5bab('0x2'));var rs=require(_0x5bab('0x3'));var fs=require('fs');var Redis=require(_0x5bab('0x4'));var db=require(_0x5bab('0x5'))['db'];var utils=require(_0x5bab('0x6'));var logger=require(_0x5bab('0x7'))(_0x5bab('0x8'));var config=require(_0x5bab('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x5bab('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x12b871,_0xc94606,_0x38b7ca){return new BPromise(function(_0x3e1832,_0x1d4e0d){return client[_0x5bab('0xb')](_0x12b871,_0x38b7ca)[_0x5bab('0xc')](function(_0x41cca8){logger[_0x5bab('0xd')](_0x5bab('0xe'),_0xc94606,_0x5bab('0xf'));logger[_0x5bab('0x10')](_0x5bab('0x11'),_0xc94606,'request\x20sent',JSON['stringify'](_0x41cca8));if(_0x41cca8[_0x5bab('0x12')]){if(_0x41cca8[_0x5bab('0x12')][_0x5bab('0x13')]===0x1f4){logger[_0x5bab('0x12')](_0x5bab('0xe'),_0xc94606,_0x41cca8['error'][_0x5bab('0x14')]);return _0x1d4e0d(_0x41cca8[_0x5bab('0x12')][_0x5bab('0x14')]);}logger[_0x5bab('0x12')](_0x5bab('0xe'),_0xc94606,_0x41cca8[_0x5bab('0x12')][_0x5bab('0x14')]);return _0x3e1832(_0x41cca8[_0x5bab('0x12')]['message']);}else{logger[_0x5bab('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0xc94606,_0x5bab('0xf'));_0x3e1832(_0x41cca8['result'][_0x5bab('0x14')]);}})[_0x5bab('0x15')](function(_0x4cbced){logger[_0x5bab('0x12')](_0x5bab('0xe'),_0xc94606,_0x4cbced);_0x1d4e0d(_0x4cbced);});});}
\ No newline at end of file
+var _0x9faa=['../../config/utils','../../config/logger','rpc','../../config/environment','client','then','AnalyticDefaultReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x314d37,_0xa23154){var _0x584bff=function(_0x1e9df2){while(--_0x1e9df2){_0x314d37['push'](_0x314d37['shift']());}};_0x584bff(++_0xa23154);}(_0x9faa,0x162));var _0xa9fa=function(_0x4e23b3,_0x37a56a){_0x4e23b3=_0x4e23b3-0x0;var _0xd888fc=_0x9faa[_0x4e23b3];return _0xd888fc;};'use strict';var _=require(_0xa9fa('0x0'));var util=require(_0xa9fa('0x1'));var moment=require(_0xa9fa('0x2'));var BPromise=require(_0xa9fa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa9fa('0x4'));var db=require(_0xa9fa('0x5'))['db'];var utils=require(_0xa9fa('0x6'));var logger=require(_0xa9fa('0x7'))(_0xa9fa('0x8'));var config=require(_0xa9fa('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa9fa('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d53ce,_0x2ff72e,_0x3e33fe){return new BPromise(function(_0x4211d2,_0x133cf3){return client['request'](_0x3d53ce,_0x3e33fe)[_0xa9fa('0xb')](function(_0x995e83){logger['info'](_0xa9fa('0xc'),_0x2ff72e,'request\x20sent');logger[_0xa9fa('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x2ff72e,'request\x20sent',JSON[_0xa9fa('0xe')](_0x995e83));if(_0x995e83['error']){if(_0x995e83[_0xa9fa('0xf')][_0xa9fa('0x10')]===0x1f4){logger[_0xa9fa('0xf')](_0xa9fa('0xc'),_0x2ff72e,_0x995e83[_0xa9fa('0xf')][_0xa9fa('0x11')]);return _0x133cf3(_0x995e83['error'][_0xa9fa('0x11')]);}logger['error'](_0xa9fa('0xc'),_0x2ff72e,_0x995e83['error'][_0xa9fa('0x11')]);return _0x4211d2(_0x995e83[_0xa9fa('0xf')][_0xa9fa('0x11')]);}else{logger['info'](_0xa9fa('0xc'),_0x2ff72e,_0xa9fa('0x12'));_0x4211d2(_0x995e83[_0xa9fa('0x13')][_0xa9fa('0x11')]);}})['catch'](function(_0x385403){logger[_0xa9fa('0xf')](_0xa9fa('0xc'),_0x2ff72e,_0x385403);_0x133cf3(_0x385403);});});}
\ No newline at end of file
index 5815ec8..ba1493d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34c2=['create','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','/:id/run','run','query','post'];(function(_0x4edb8b,_0x5252bc){var _0x2e2e1b=function(_0x1286f6){while(--_0x1286f6){_0x4edb8b['push'](_0x4edb8b['shift']());}};_0x2e2e1b(++_0x5252bc);}(_0x34c2,0x98));var _0x234c=function(_0x221019,_0x15c3c1){_0x221019=_0x221019-0x0;var _0x1b3cae=_0x34c2[_0x221019];return _0x1b3cae;};'use strict';var multer=require(_0x234c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x234c('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x234c('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x234c('0x3'));var controller=require(_0x234c('0x4'));router['get']('/',auth[_0x234c('0x5')](),controller[_0x234c('0x6')]);router[_0x234c('0x7')](_0x234c('0x8'),auth['isAuthenticated'](),controller[_0x234c('0x9')]);router[_0x234c('0x7')](_0x234c('0xa'),auth[_0x234c('0x5')](),controller[_0x234c('0xb')]);router[_0x234c('0x7')](_0x234c('0xc'),auth[_0x234c('0x5')](),controller[_0x234c('0xd')]);router[_0x234c('0x7')]('/:id/query',auth[_0x234c('0x5')](),controller[_0x234c('0xe')]);router[_0x234c('0xf')]('/',auth['isAuthenticated'](),controller[_0x234c('0x10')]);router['put']('/:id',auth[_0x234c('0x5')](),controller[_0x234c('0x11')]);router[_0x234c('0x12')](_0x234c('0x8'),auth[_0x234c('0x5')](),controller[_0x234c('0x13')]);module[_0x234c('0x14')]=router;
\ No newline at end of file
+var _0x20f2=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x15cf4d,_0xec4698){var _0x544525=function(_0x584650){while(--_0x584650){_0x15cf4d['push'](_0x15cf4d['shift']());}};_0x544525(++_0xec4698);}(_0x20f2,0x1e6));var _0x220f=function(_0x39d090,_0x3295ca){_0x39d090=_0x39d090-0x0;var _0x255242=_0x20f2[_0x39d090];return _0x255242;};'use strict';var multer=require(_0x220f('0x0'));var util=require(_0x220f('0x1'));var path=require(_0x220f('0x2'));var timeout=require(_0x220f('0x3'));var express=require(_0x220f('0x4'));var router=express[_0x220f('0x5')]();var fs_extra=require(_0x220f('0x6'));var auth=require(_0x220f('0x7'));var interaction=require(_0x220f('0x8'));var config=require(_0x220f('0x9'));var controller=require(_0x220f('0xa'));router[_0x220f('0xb')]('/',auth[_0x220f('0xc')](),controller[_0x220f('0xd')]);router[_0x220f('0xb')](_0x220f('0xe'),auth['isAuthenticated'](),controller[_0x220f('0xf')]);router[_0x220f('0xb')](_0x220f('0x10'),auth[_0x220f('0xc')](),controller[_0x220f('0x11')]);router[_0x220f('0xb')](_0x220f('0x12'),auth[_0x220f('0xc')](),controller[_0x220f('0x13')]);router[_0x220f('0xb')](_0x220f('0x14'),auth[_0x220f('0xc')](),controller[_0x220f('0x15')]);router[_0x220f('0x16')]('/',auth[_0x220f('0xc')](),controller[_0x220f('0x17')]);router[_0x220f('0x18')]('/:id',auth[_0x220f('0xc')](),controller[_0x220f('0x19')]);router[_0x220f('0x1a')](_0x220f('0xe'),auth[_0x220f('0xc')](),controller[_0x220f('0x1b')]);module[_0x220f('0x1c')]=router;
\ No newline at end of file
index dff29e6..fadab89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3a5=['UNSIGNED','moment','exports','STRING','ENUM','xlsx','DATE','Loading','manual'];(function(_0xf00800,_0x1f50ba){var _0x381043=function(_0x4850fc){while(--_0x4850fc){_0xf00800['push'](_0xf00800['shift']());}};_0x381043(++_0x1f50ba);}(_0xf3a5,0x1c3));var _0x5f3a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3a5[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x5f3a('0x0'));module[_0x5f3a('0x1')]={'name':{'type':Sequelize[_0x5f3a('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x5f3a('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x5f3a('0x3')]('csv','pdf',_0x5f3a('0x4')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x5f3a('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x5f3a('0x5')]},'endDate':{'type':Sequelize[_0x5f3a('0x5')]},'status':{'type':Sequelize[_0x5f3a('0x2')],'defaultValue':_0x5f3a('0x6')},'type':{'type':Sequelize[_0x5f3a('0x3')]('manual','scheduled'),'allowNull':![],'defaultValue':_0x5f3a('0x7')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x5f3a('0x8')]},'reportType':{'type':Sequelize[_0x5f3a('0x2')]}};
\ No newline at end of file
+var _0x98ac=['UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled','INTEGER'];(function(_0x2787c5,_0x422f0b){var _0x1b53c5=function(_0x398028){while(--_0x398028){_0x2787c5['push'](_0x2787c5['shift']());}};_0x1b53c5(++_0x422f0b);}(_0x98ac,0x151));var _0xc98a=function(_0x2f6bb7,_0x539abe){_0x2f6bb7=_0x2f6bb7-0x0;var _0x84133c=_0x98ac[_0x2f6bb7];return _0x84133c;};'use strict';var Sequelize=require(_0xc98a('0x0'));var moment=require(_0xc98a('0x1'));module[_0xc98a('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xc98a('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xc98a('0x4')](_0xc98a('0x5'),_0xc98a('0x6'),_0xc98a('0x7')),'allowNull':![],'defaultValue':_0xc98a('0x5')},'savename':{'type':Sequelize[_0xc98a('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xc98a('0x8')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0xc98a('0x9')},'type':{'type':Sequelize['ENUM'](_0xc98a('0xa'),_0xc98a('0xb')),'allowNull':![],'defaultValue':_0xc98a('0xa')},'reportId':{'type':Sequelize[_0xc98a('0xc')](0xb)[_0xc98a('0xd')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
index bb041a5..8c9d3ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf811=['VIRTUAL','filter','options','where','includeAll','findAll','rows','catch','show','params','keys','include','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','get','ExtractedReports','UserProfileResource','end','error','stack','name','index','map','AnalyticExtractedReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','merge'];(function(_0x2fba83,_0x23638f){var _0x1536d9=function(_0x2cc5bf){while(--_0x2cc5bf){_0x2fba83['push'](_0x2fba83['shift']());}};_0x1536d9(++_0x23638f);}(_0xf811,0x139));var _0x1f81=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0xf811[_0x33032e];return _0x13316b;};'use strict';var emlformat=require(_0x1f81('0x0'));var rimraf=require(_0x1f81('0x1'));var zipdir=require(_0x1f81('0x2'));var jsonpatch=require(_0x1f81('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1f81('0x4'));var Mustache=require(_0x1f81('0x5'));var util=require(_0x1f81('0x6'));var path=require(_0x1f81('0x7'));var sox=require(_0x1f81('0x8'));var csv=require(_0x1f81('0x9'));var ejs=require(_0x1f81('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1f81('0xb'));var crypto=require(_0x1f81('0xc'));var jsforce=require(_0x1f81('0xd'));var deskjs=require(_0x1f81('0xe'));var toCsv=require(_0x1f81('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1f81('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1f81('0x10'));var as=require(_0x1f81('0x11'));var hardwareService=require(_0x1f81('0x12'));var logger=require(_0x1f81('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x1f81('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c6276,_0x6655c5){_0x6655c5=_0x6655c5||0xcc;return function(_0xe7f42b){if(_0xe7f42b){return _0x5c6276[_0x1f81('0x15')](_0x6655c5);}return _0x5c6276['status'](_0x6655c5)['end']();};}function respondWithResult(_0xb67196,_0x3866b2){_0x3866b2=_0x3866b2||0xc8;return function(_0x5a5254){if(_0x5a5254){return _0xb67196[_0x1f81('0x16')](_0x3866b2)['json'](_0x5a5254);}};}function respondWithFilteredResult(_0x1c6503,_0xfe0d76){return function(_0x30064f){if(_0x30064f){var _0xc56e33=typeof _0xfe0d76[_0x1f81('0x17')]===_0x1f81('0x18')&&typeof _0xfe0d76[_0x1f81('0x19')]===_0x1f81('0x18');var _0x48b69e=_0x30064f[_0x1f81('0x1a')];var _0x1a5a50=_0xc56e33?0x0:_0xfe0d76[_0x1f81('0x17')];var _0x4d706c=_0xc56e33?_0x30064f[_0x1f81('0x1a')]:_0xfe0d76[_0x1f81('0x17')]+_0xfe0d76[_0x1f81('0x19')];var _0x281cc4;if(_0x4d706c>=_0x48b69e){_0x4d706c=_0x48b69e;_0x281cc4=0xc8;}else{_0x281cc4=0xce;}_0x1c6503[_0x1f81('0x16')](_0x281cc4);return _0x1c6503['set'](_0x1f81('0x1b'),_0x1a5a50+'-'+_0x4d706c+'/'+_0x48b69e)[_0x1f81('0x1c')](_0x30064f);}return null;};}function patchUpdates(_0x351c54){return function(_0x52a77f){try{jsonpatch[_0x1f81('0x1d')](_0x52a77f,_0x351c54,!![]);}catch(_0x5dd7a5){return BPromise[_0x1f81('0x1e')](_0x5dd7a5);}return _0x52a77f['save']();};}function saveUpdates(_0x2fd26c,_0x1a69c3){return function(_0x1b5f57){if(_0x1b5f57){return _0x1b5f57[_0x1f81('0x1f')](_0x2fd26c)[_0x1f81('0x20')](function(_0x44e1c9){return _0x44e1c9;});}return null;};}function removeEntity(_0x1e11df,_0x52a17f){return function(_0x763d48){if(_0x763d48){return _0x763d48[_0x1f81('0x21')]()[_0x1f81('0x20')](function(){var _0x54c778=_0x763d48[_0x1f81('0x22')]({'plain':!![]});var _0x4bb248=_0x1f81('0x23');return db[_0x1f81('0x24')]['destroy']({'where':{'type':_0x4bb248,'resourceId':_0x54c778['id']}})[_0x1f81('0x20')](function(){return _0x763d48;});})[_0x1f81('0x20')](function(){_0x1e11df[_0x1f81('0x16')](0xcc)[_0x1f81('0x25')]();});}};}function handleEntityNotFound(_0x320220,_0x4ee881){return function(_0x28e50f){if(!_0x28e50f){_0x320220[_0x1f81('0x15')](0x194);}return _0x28e50f;};}function handleError(_0x3db6db,_0x4a0d32){_0x4a0d32=_0x4a0d32||0x1f4;return function(_0x4343ac){logger[_0x1f81('0x26')](_0x4343ac[_0x1f81('0x27')]);if(_0x4343ac['name']){delete _0x4343ac[_0x1f81('0x28')];}_0x3db6db['status'](_0x4a0d32)['send'](_0x4343ac);};}exports[_0x1f81('0x29')]=function(_0x72a980,_0x39dc93){var _0x523472={},_0x2eea07={},_0x4e19bf={'count':0x0,'rows':[]};var _0x58ebdd=_[_0x1f81('0x2a')](db[_0x1f81('0x2b')][_0x1f81('0x2c')],function(_0x441163){return{'name':_0x441163['fieldName'],'type':_0x441163[_0x1f81('0x2d')][_0x1f81('0x2e')]};});_0x2eea07[_0x1f81('0x2f')]=_[_0x1f81('0x2a')](_0x58ebdd,_0x1f81('0x28'));_0x2eea07['query']=_['keys'](_0x72a980[_0x1f81('0x30')]);_0x2eea07[_0x1f81('0x31')]=_[_0x1f81('0x32')](_0x2eea07[_0x1f81('0x2f')],_0x2eea07['query']);_0x523472[_0x1f81('0x33')]=_[_0x1f81('0x32')](_0x2eea07['model'],qs[_0x1f81('0x34')](_0x72a980[_0x1f81('0x30')][_0x1f81('0x34')]));_0x523472[_0x1f81('0x33')]=_0x523472[_0x1f81('0x33')]['length']?_0x523472['attributes']:_0x2eea07[_0x1f81('0x2f')];if(!_0x72a980['query'][_0x1f81('0x35')](_0x1f81('0x36'))){_0x523472['limit']=qs['limit'](_0x72a980[_0x1f81('0x30')][_0x1f81('0x19')]);_0x523472[_0x1f81('0x17')]=qs['offset'](_0x72a980[_0x1f81('0x30')][_0x1f81('0x17')]);}_0x523472[_0x1f81('0x37')]=qs['sort'](_0x72a980['query'][_0x1f81('0x38')]);_0x523472['where']=qs['filters'](_[_0x1f81('0x39')](_0x72a980['query'],_0x2eea07[_0x1f81('0x31')]),_0x58ebdd);if(_0x72a980[_0x1f81('0x30')]['filter']){_0x523472['where']=_[_0x1f81('0x3a')](_0x523472['where'],{'$or':_[_0x1f81('0x2a')](_0x58ebdd,function(_0x11a151){if(_0x11a151[_0x1f81('0x2d')]!==_0x1f81('0x3b')){var _0x530555={};_0x530555[_0x11a151['name']]={'$like':'%'+_0x72a980[_0x1f81('0x30')][_0x1f81('0x3c')]+'%'};return _0x530555;}})});}_0x523472=_[_0x1f81('0x3a')]({},_0x523472,_0x72a980[_0x1f81('0x3d')]);var _0x2136e0={'where':_0x523472[_0x1f81('0x3e')]};return db['AnalyticExtractedReport'][_0x1f81('0x1a')](_0x2136e0)[_0x1f81('0x20')](function(_0x1f10fe){_0x4e19bf['count']=_0x1f10fe;if(_0x72a980[_0x1f81('0x30')][_0x1f81('0x3f')]){_0x523472['include']=[{'all':!![]}];}return db[_0x1f81('0x2b')][_0x1f81('0x40')](_0x523472);})[_0x1f81('0x20')](function(_0x59d6c3){_0x4e19bf[_0x1f81('0x41')]=_0x59d6c3;return _0x4e19bf;})['then'](respondWithFilteredResult(_0x39dc93,_0x523472))[_0x1f81('0x42')](handleError(_0x39dc93,null));};exports[_0x1f81('0x43')]=function(_0x37a322,_0x3697c0){var _0x1082ee={'raw':!![],'where':{'id':_0x37a322[_0x1f81('0x44')]['id']}},_0x420d41={};_0x420d41[_0x1f81('0x2f')]=_[_0x1f81('0x45')](db[_0x1f81('0x2b')][_0x1f81('0x2c')]);_0x420d41[_0x1f81('0x30')]=_['keys'](_0x37a322[_0x1f81('0x30')]);_0x420d41[_0x1f81('0x31')]=_[_0x1f81('0x32')](_0x420d41['model'],_0x420d41[_0x1f81('0x30')]);_0x1082ee[_0x1f81('0x33')]=_[_0x1f81('0x32')](_0x420d41[_0x1f81('0x2f')],qs[_0x1f81('0x34')](_0x37a322[_0x1f81('0x30')]['fields']));_0x1082ee[_0x1f81('0x33')]=_0x1082ee[_0x1f81('0x33')]['length']?_0x1082ee[_0x1f81('0x33')]:_0x420d41[_0x1f81('0x2f')];if(_0x37a322['query']['includeAll']){_0x1082ee[_0x1f81('0x46')]=[{'all':!![]}];}_0x1082ee=_[_0x1f81('0x3a')]({},_0x1082ee,_0x37a322[_0x1f81('0x3d')]);return db[_0x1f81('0x2b')][_0x1f81('0x47')](_0x1082ee)[_0x1f81('0x20')](handleEntityNotFound(_0x3697c0,null))['then'](respondWithResult(_0x3697c0,null))['catch'](handleError(_0x3697c0,null));};exports[_0x1f81('0x48')]=function(_0x1023bc,_0x5abb4b){return db[_0x1f81('0x2b')][_0x1f81('0x48')](_0x1023bc[_0x1f81('0x49')],{})[_0x1f81('0x20')](function(_0x22d891){var _0x36c421=_0x1023bc[_0x1f81('0x4a')][_0x1f81('0x22')]({'plain':!![]});if(!_0x36c421)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x36c421[_0x1f81('0x4b')]===_0x1f81('0x4a')){var _0x5c649b=_0x22d891[_0x1f81('0x22')]({'plain':!![]});var _0x2cc951=_0x1f81('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x2cc951,'userProfileId':_0x36c421[_0x1f81('0x4c')]},'raw':!![]})['then'](function(_0x450112){if(_0x450112&&_0x450112[_0x1f81('0x4d')]===0x0){return db[_0x1f81('0x24')][_0x1f81('0x48')]({'name':_0x5c649b[_0x1f81('0x28')],'resourceId':_0x5c649b['id'],'type':_0x450112[_0x1f81('0x28')],'sectionId':_0x450112['id']},{})[_0x1f81('0x20')](function(){return _0x22d891;});}else{return _0x22d891;}})[_0x1f81('0x42')](function(_0x447727){logger[_0x1f81('0x26')](_0x1f81('0x4e'),_0x447727);throw _0x447727;});}return _0x22d891;})[_0x1f81('0x20')](respondWithResult(_0x5abb4b,0xc9))[_0x1f81('0x42')](handleError(_0x5abb4b,null));};exports[_0x1f81('0x1f')]=function(_0x420ee8,_0x53aeb2){if(_0x420ee8[_0x1f81('0x49')]['id']){delete _0x420ee8['body']['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x420ee8[_0x1f81('0x44')]['id']}})[_0x1f81('0x20')](handleEntityNotFound(_0x53aeb2,null))['then'](saveUpdates(_0x420ee8[_0x1f81('0x49')],null))[_0x1f81('0x20')](respondWithResult(_0x53aeb2,null))[_0x1f81('0x42')](handleError(_0x53aeb2,null));};exports['destroy']=function(_0x5560fd,_0x1bf69b){return db[_0x1f81('0x2b')][_0x1f81('0x47')]({'where':{'id':_0x5560fd[_0x1f81('0x44')]['id']}})[_0x1f81('0x20')](handleEntityNotFound(_0x1bf69b,null))[_0x1f81('0x20')](removeEntity(_0x1bf69b,null))[_0x1f81('0x42')](handleError(_0x1bf69b,null));};exports[_0x1f81('0x4f')]=function(_0x3e1421,_0x4c02d5,_0x22fc32){return db[_0x1f81('0x2b')][_0x1f81('0x47')]({'where':{'id':_0x3e1421[_0x1f81('0x44')]['id']},'attributes':[_0x1f81('0x28'),_0x1f81('0x50'),_0x1f81('0x51'),_0x1f81('0x52')],'raw':!![]})['then'](handleEntityNotFound(_0x4c02d5,null))[_0x1f81('0x20')](function(_0x17dc8f){if(_0x17dc8f){if(!fs[_0x1f81('0x53')](path[_0x1f81('0x54')](config[_0x1f81('0x55')],_0x1f81('0x56'),_0x17dc8f['savename']))){throw new db[(_0x1f81('0x57'))][(_0x1f81('0x58'))](_0x1f81('0x59'));}if(_0x3e1421[_0x1f81('0x30')][_0x1f81('0x5a')]){return _0x4c02d5[_0x1f81('0x15')](0xc8);}return _0x4c02d5[_0x1f81('0x4f')](path[_0x1f81('0x54')](config[_0x1f81('0x55')],_0x1f81('0x56'),_0x17dc8f[_0x1f81('0x51')]),util['format'](_0x1f81('0x5b'),_0x17dc8f[_0x1f81('0x50')]||_0x17dc8f[_0x1f81('0x28')],_0x17dc8f[_0x1f81('0x52')][_0x1f81('0x5c')]()));}})[_0x1f81('0x42')](handleError(_0x4c02d5,null));};
\ No newline at end of file
+var _0x9b7c=['output','existsSync','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','root','server/files/reports','format','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','includeAll','AnalyticExtractedReport','findAll','catch','show','params','body','user','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','basename','savename'];(function(_0x52965d,_0x487353){var _0x43f259=function(_0x4c326c){while(--_0x4c326c){_0x52965d['push'](_0x52965d['shift']());}};_0x43f259(++_0x487353);}(_0x9b7c,0x177));var _0xc9b7=function(_0x29db36,_0x410ae9){_0x29db36=_0x29db36-0x0;var _0x234e87=_0x9b7c[_0x29db36];return _0x234e87;};'use strict';var emlformat=require(_0xc9b7('0x0'));var rimraf=require(_0xc9b7('0x1'));var zipdir=require(_0xc9b7('0x2'));var jsonpatch=require(_0xc9b7('0x3'));var rp=require(_0xc9b7('0x4'));var moment=require('moment');var BPromise=require(_0xc9b7('0x5'));var Mustache=require(_0xc9b7('0x6'));var util=require('util');var path=require(_0xc9b7('0x7'));var sox=require('sox');var csv=require(_0xc9b7('0x8'));var ejs=require(_0xc9b7('0x9'));var fs=require('fs');var fs_extra=require(_0xc9b7('0xa'));var _=require('lodash');var squel=require(_0xc9b7('0xb'));var crypto=require(_0xc9b7('0xc'));var jsforce=require(_0xc9b7('0xd'));var deskjs=require(_0xc9b7('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc9b7('0xf'));var Redis=require('ioredis');var authService=require(_0xc9b7('0x10'));var qs=require(_0xc9b7('0x11'));var as=require(_0xc9b7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc9b7('0x13'))(_0xc9b7('0x14'));var utils=require(_0xc9b7('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc9b7('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e2eb7,_0x5c255f){_0x5c255f=_0x5c255f||0xcc;return function(_0x4ff09b){if(_0x4ff09b){return _0x2e2eb7[_0xc9b7('0x17')](_0x5c255f);}return _0x2e2eb7[_0xc9b7('0x18')](_0x5c255f)[_0xc9b7('0x19')]();};}function respondWithResult(_0x27d818,_0x4f6b24){_0x4f6b24=_0x4f6b24||0xc8;return function(_0xe88b40){if(_0xe88b40){return _0x27d818[_0xc9b7('0x18')](_0x4f6b24)[_0xc9b7('0x1a')](_0xe88b40);}};}function respondWithFilteredResult(_0x29b8ee,_0x2c987c){return function(_0x4888e0){if(_0x4888e0){var _0x459f0e=typeof _0x2c987c[_0xc9b7('0x1b')]==='undefined'&&typeof _0x2c987c[_0xc9b7('0x1c')]===_0xc9b7('0x1d');var _0x197e23=_0x4888e0['count'];var _0x4ad468=_0x459f0e?0x0:_0x2c987c[_0xc9b7('0x1b')];var _0x13c3d4=_0x459f0e?_0x4888e0[_0xc9b7('0x1e')]:_0x2c987c[_0xc9b7('0x1b')]+_0x2c987c[_0xc9b7('0x1c')];var _0x476fb8;if(_0x13c3d4>=_0x197e23){_0x13c3d4=_0x197e23;_0x476fb8=0xc8;}else{_0x476fb8=0xce;}_0x29b8ee[_0xc9b7('0x18')](_0x476fb8);return _0x29b8ee['set'](_0xc9b7('0x1f'),_0x4ad468+'-'+_0x13c3d4+'/'+_0x197e23)['json'](_0x4888e0);}return null;};}function patchUpdates(_0x132e55){return function(_0x379d2b){try{jsonpatch[_0xc9b7('0x20')](_0x379d2b,_0x132e55,!![]);}catch(_0x3da26f){return BPromise[_0xc9b7('0x21')](_0x3da26f);}return _0x379d2b[_0xc9b7('0x22')]();};}function saveUpdates(_0x11df9e,_0x2f00bc){return function(_0x197e20){if(_0x197e20){return _0x197e20[_0xc9b7('0x23')](_0x11df9e)[_0xc9b7('0x24')](function(_0xe4eb8d){return _0xe4eb8d;});}return null;};}function removeEntity(_0x5db1c2,_0xf06d77){return function(_0x5326df){if(_0x5326df){return _0x5326df[_0xc9b7('0x25')]()[_0xc9b7('0x24')](function(){var _0x321a6e=_0x5326df[_0xc9b7('0x26')]({'plain':!![]});var _0x3de78d=_0xc9b7('0x27');return db[_0xc9b7('0x28')]['destroy']({'where':{'type':_0x3de78d,'resourceId':_0x321a6e['id']}})[_0xc9b7('0x24')](function(){return _0x5326df;});})[_0xc9b7('0x24')](function(){_0x5db1c2['status'](0xcc)[_0xc9b7('0x19')]();});}};}function handleEntityNotFound(_0x1d0e9f,_0x2bf2f1){return function(_0x2712e0){if(!_0x2712e0){_0x1d0e9f['sendStatus'](0x194);}return _0x2712e0;};}function handleError(_0x1e95dd,_0x508700){_0x508700=_0x508700||0x1f4;return function(_0x31546f){logger[_0xc9b7('0x29')](_0x31546f['stack']);if(_0x31546f[_0xc9b7('0x2a')]){delete _0x31546f[_0xc9b7('0x2a')];}_0x1e95dd[_0xc9b7('0x18')](_0x508700)[_0xc9b7('0x2b')](_0x31546f);};}exports[_0xc9b7('0x2c')]=function(_0x1cb9de,_0x468d94){var _0x13be7f={},_0x3d0f7f={},_0x44e27d={'count':0x0,'rows':[]};var _0x49bcf0=_[_0xc9b7('0x2d')](db['AnalyticExtractedReport'][_0xc9b7('0x2e')],function(_0x1cea0c){return{'name':_0x1cea0c[_0xc9b7('0x2f')],'type':_0x1cea0c[_0xc9b7('0x30')][_0xc9b7('0x31')]};});_0x3d0f7f['model']=_[_0xc9b7('0x2d')](_0x49bcf0,_0xc9b7('0x2a'));_0x3d0f7f['query']=_[_0xc9b7('0x32')](_0x1cb9de[_0xc9b7('0x33')]);_0x3d0f7f['filters']=_[_0xc9b7('0x34')](_0x3d0f7f['model'],_0x3d0f7f[_0xc9b7('0x33')]);_0x13be7f[_0xc9b7('0x35')]=_[_0xc9b7('0x34')](_0x3d0f7f[_0xc9b7('0x36')],qs[_0xc9b7('0x37')](_0x1cb9de[_0xc9b7('0x33')]['fields']));_0x13be7f[_0xc9b7('0x35')]=_0x13be7f['attributes'][_0xc9b7('0x38')]?_0x13be7f[_0xc9b7('0x35')]:_0x3d0f7f[_0xc9b7('0x36')];if(!_0x1cb9de[_0xc9b7('0x33')][_0xc9b7('0x39')](_0xc9b7('0x3a'))){_0x13be7f[_0xc9b7('0x1c')]=qs[_0xc9b7('0x1c')](_0x1cb9de[_0xc9b7('0x33')]['limit']);_0x13be7f[_0xc9b7('0x1b')]=qs[_0xc9b7('0x1b')](_0x1cb9de[_0xc9b7('0x33')][_0xc9b7('0x1b')]);}_0x13be7f['order']=qs[_0xc9b7('0x3b')](_0x1cb9de['query'][_0xc9b7('0x3b')]);_0x13be7f[_0xc9b7('0x3c')]=qs[_0xc9b7('0x3d')](_['pick'](_0x1cb9de[_0xc9b7('0x33')],_0x3d0f7f[_0xc9b7('0x3d')]),_0x49bcf0);if(_0x1cb9de[_0xc9b7('0x33')][_0xc9b7('0x3e')]){_0x13be7f[_0xc9b7('0x3c')]=_[_0xc9b7('0x3f')](_0x13be7f[_0xc9b7('0x3c')],{'$or':_[_0xc9b7('0x2d')](_0x49bcf0,function(_0x5604ee){if(_0x5604ee[_0xc9b7('0x30')]!=='VIRTUAL'){var _0x3e3263={};_0x3e3263[_0x5604ee[_0xc9b7('0x2a')]]={'$like':'%'+_0x1cb9de[_0xc9b7('0x33')][_0xc9b7('0x3e')]+'%'};return _0x3e3263;}})});}_0x13be7f=_['merge']({},_0x13be7f,_0x1cb9de[_0xc9b7('0x40')]);var _0x36c649={'where':_0x13be7f[_0xc9b7('0x3c')]};return db['AnalyticExtractedReport'][_0xc9b7('0x1e')](_0x36c649)[_0xc9b7('0x24')](function(_0x11f64e){_0x44e27d['count']=_0x11f64e;if(_0x1cb9de[_0xc9b7('0x33')][_0xc9b7('0x41')]){_0x13be7f['include']=[{'all':!![]}];}return db[_0xc9b7('0x42')][_0xc9b7('0x43')](_0x13be7f);})[_0xc9b7('0x24')](function(_0x2914c2){_0x44e27d['rows']=_0x2914c2;return _0x44e27d;})['then'](respondWithFilteredResult(_0x468d94,_0x13be7f))[_0xc9b7('0x44')](handleError(_0x468d94,null));};exports[_0xc9b7('0x45')]=function(_0x52e090,_0x22df15){var _0x32afae={'raw':!![],'where':{'id':_0x52e090[_0xc9b7('0x46')]['id']}},_0x15b98a={};_0x15b98a[_0xc9b7('0x36')]=_[_0xc9b7('0x32')](db[_0xc9b7('0x42')][_0xc9b7('0x2e')]);_0x15b98a[_0xc9b7('0x33')]=_[_0xc9b7('0x32')](_0x52e090[_0xc9b7('0x33')]);_0x15b98a['filters']=_[_0xc9b7('0x34')](_0x15b98a[_0xc9b7('0x36')],_0x15b98a['query']);_0x32afae[_0xc9b7('0x35')]=_[_0xc9b7('0x34')](_0x15b98a[_0xc9b7('0x36')],qs[_0xc9b7('0x37')](_0x52e090['query'][_0xc9b7('0x37')]));_0x32afae[_0xc9b7('0x35')]=_0x32afae['attributes']['length']?_0x32afae[_0xc9b7('0x35')]:_0x15b98a[_0xc9b7('0x36')];if(_0x52e090['query'][_0xc9b7('0x41')]){_0x32afae['include']=[{'all':!![]}];}_0x32afae=_['merge']({},_0x32afae,_0x52e090[_0xc9b7('0x40')]);return db['AnalyticExtractedReport']['find'](_0x32afae)[_0xc9b7('0x24')](handleEntityNotFound(_0x22df15,null))['then'](respondWithResult(_0x22df15,null))[_0xc9b7('0x44')](handleError(_0x22df15,null));};exports['create']=function(_0x5be96a,_0x277c09){return db['AnalyticExtractedReport']['create'](_0x5be96a[_0xc9b7('0x47')],{})['then'](function(_0x173cf3){var _0x57d125=_0x5be96a['user'][_0xc9b7('0x26')]({'plain':!![]});if(!_0x57d125)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57d125['role']===_0xc9b7('0x48')){var _0x440792=_0x173cf3[_0xc9b7('0x26')]({'plain':!![]});var _0x371cf3='ExtractedReports';return db['UserProfileSection']['find']({'where':{'name':_0x371cf3,'userProfileId':_0x57d125[_0xc9b7('0x49')]},'raw':!![]})['then'](function(_0x256bd5){if(_0x256bd5&&_0x256bd5[_0xc9b7('0x4a')]===0x0){return db[_0xc9b7('0x28')][_0xc9b7('0x4b')]({'name':_0x440792[_0xc9b7('0x2a')],'resourceId':_0x440792['id'],'type':_0x256bd5[_0xc9b7('0x2a')],'sectionId':_0x256bd5['id']},{})['then'](function(){return _0x173cf3;});}else{return _0x173cf3;}})[_0xc9b7('0x44')](function(_0x12d941){logger[_0xc9b7('0x29')](_0xc9b7('0x4c'),_0x12d941);throw _0x12d941;});}return _0x173cf3;})['then'](respondWithResult(_0x277c09,0xc9))[_0xc9b7('0x44')](handleError(_0x277c09,null));};exports['update']=function(_0x2080b6,_0x521bcf){if(_0x2080b6[_0xc9b7('0x47')]['id']){delete _0x2080b6[_0xc9b7('0x47')]['id'];}return db[_0xc9b7('0x42')][_0xc9b7('0x4d')]({'where':{'id':_0x2080b6[_0xc9b7('0x46')]['id']}})[_0xc9b7('0x24')](handleEntityNotFound(_0x521bcf,null))[_0xc9b7('0x24')](saveUpdates(_0x2080b6['body'],null))['then'](respondWithResult(_0x521bcf,null))['catch'](handleError(_0x521bcf,null));};exports[_0xc9b7('0x25')]=function(_0x38d3bb,_0x3c927d){return db[_0xc9b7('0x42')]['find']({'where':{'id':_0x38d3bb[_0xc9b7('0x46')]['id']}})[_0xc9b7('0x24')](handleEntityNotFound(_0x3c927d,null))[_0xc9b7('0x24')](removeEntity(_0x3c927d,null))[_0xc9b7('0x44')](handleError(_0x3c927d,null));};exports['download']=function(_0x224bc3,_0x3a5663,_0x123899){return db[_0xc9b7('0x42')][_0xc9b7('0x4d')]({'where':{'id':_0x224bc3[_0xc9b7('0x46')]['id']},'attributes':[_0xc9b7('0x2a'),_0xc9b7('0x4e'),_0xc9b7('0x4f'),_0xc9b7('0x50')],'raw':!![]})[_0xc9b7('0x24')](handleEntityNotFound(_0x3a5663,null))[_0xc9b7('0x24')](function(_0x388782){if(_0x388782){if(!fs[_0xc9b7('0x51')](path['join'](config['root'],'server/files/reports',_0x388782[_0xc9b7('0x4f')]))){throw new db[(_0xc9b7('0x52'))][(_0xc9b7('0x53'))](_0xc9b7('0x54'));}if(_0x224bc3[_0xc9b7('0x33')][_0xc9b7('0x55')]){return _0x3a5663[_0xc9b7('0x17')](0xc8);}return _0x3a5663[_0xc9b7('0x56')](path['join'](config[_0xc9b7('0x57')],_0xc9b7('0x58'),_0x388782[_0xc9b7('0x4f')]),util[_0xc9b7('0x59')]('%s.%s',_0x388782['basename']||_0x388782[_0xc9b7('0x2a')],_0x388782['output'][_0xc9b7('0x5a')]()));}})['catch'](handleError(_0x3a5663,null));};
\ No newline at end of file
index a3a25d3..df26b16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79ad=['define','util','../../config/logger','api','request-promise','path','./analyticExtractedReport.attributes'];(function(_0x40e0cc,_0x30ef05){var _0x591d5e=function(_0x3cc8d9){while(--_0x3cc8d9){_0x40e0cc['push'](_0x40e0cc['shift']());}};_0x591d5e(++_0x30ef05);}(_0x79ad,0x71));var _0xd79a=function(_0x2101c3,_0x6474a3){_0x2101c3=_0x2101c3-0x0;var _0x4592d6=_0x79ad[_0x2101c3];return _0x4592d6;};'use strict';var _=require('lodash');var util=require(_0xd79a('0x0'));var logger=require(_0xd79a('0x1'))(_0xd79a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd79a('0x3'));var fs=require('fs');var path=require(_0xd79a('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd79a('0x5'));module['exports']=function(_0x1ed9f1,_0x45abea){return _0x1ed9f1[_0xd79a('0x6')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf4f3=['analytics_extracted_reports','../../config/logger','api','moment','bluebird','rimraf','./analyticExtractedReport.attributes','exports'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xf4f3,0x159));var _0x3f4f=function(_0x2e0621,_0x396248){_0x2e0621=_0x2e0621-0x0;var _0x21aee4=_0xf4f3[_0x2e0621];return _0x21aee4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3f4f('0x0'))(_0x3f4f('0x1'));var moment=require(_0x3f4f('0x2'));var BPromise=require(_0x3f4f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3f4f('0x4'));var config=require('../../config/environment');var attributes=require(_0x3f4f('0x5'));module[_0x3f4f('0x6')]=function(_0x690e13,_0x585862){return _0x690e13['define']('AnalyticExtractedReport',attributes,{'tableName':_0x3f4f('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d63cb53..c9426ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6bdb=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','AnalyticExtractedReport,\x20%s,\x20%s','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x6bdb,0xaf));var _0xb6bd=function(_0x317a98,_0x4fa354){_0x317a98=_0x317a98-0x0;var _0x256419=_0x6bdb[_0x317a98];return _0x256419;};'use strict';var _=require(_0xb6bd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb6bd('0x1'));var rs=require(_0xb6bd('0x2'));var fs=require('fs');var Redis=require(_0xb6bd('0x3'));var db=require(_0xb6bd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb6bd('0x5'))('rpc');var config=require(_0xb6bd('0x6'));var jayson=require(_0xb6bd('0x7'));var client=jayson[_0xb6bd('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ec1a4,_0x470e9c,_0xdcc11e){return new BPromise(function(_0x439f08,_0x4a6265){return client[_0xb6bd('0x9')](_0x3ec1a4,_0xdcc11e)[_0xb6bd('0xa')](function(_0x1f5b51){logger[_0xb6bd('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x470e9c,_0xb6bd('0xc'));logger[_0xb6bd('0xd')](_0xb6bd('0xe'),_0x470e9c,'request\x20sent',JSON['stringify'](_0x1f5b51));if(_0x1f5b51[_0xb6bd('0xf')]){if(_0x1f5b51[_0xb6bd('0xf')][_0xb6bd('0x10')]===0x1f4){logger[_0xb6bd('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x470e9c,_0x1f5b51['error'][_0xb6bd('0x11')]);return _0x4a6265(_0x1f5b51[_0xb6bd('0xf')]['message']);}logger[_0xb6bd('0xf')](_0xb6bd('0x12'),_0x470e9c,_0x1f5b51['error'][_0xb6bd('0x11')]);return _0x439f08(_0x1f5b51[_0xb6bd('0xf')]['message']);}else{logger['info'](_0xb6bd('0x12'),_0x470e9c,_0xb6bd('0xc'));_0x439f08(_0x1f5b51[_0xb6bd('0x13')]['message']);}})[_0xb6bd('0x14')](function(_0x540606){logger[_0xb6bd('0xf')](_0xb6bd('0x12'),_0x470e9c,_0x540606);_0x4a6265(_0x540606);});});}
\ No newline at end of file
+var _0x0046=['jayson/promise','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x1cb936,_0xd24a3e){var _0x1fee35=function(_0x841d6e){while(--_0x841d6e){_0x1cb936['push'](_0x1cb936['shift']());}};_0x1fee35(++_0xd24a3e);}(_0x0046,0x14f));var _0x6004=function(_0x4b2d37,_0x2589c1){_0x4b2d37=_0x4b2d37-0x0;var _0x2350d3=_0x0046[_0x4b2d37];return _0x2350d3;};'use strict';var _=require(_0x6004('0x0'));var util=require(_0x6004('0x1'));var moment=require(_0x6004('0x2'));var BPromise=require(_0x6004('0x3'));var rs=require(_0x6004('0x4'));var fs=require('fs');var Redis=require(_0x6004('0x5'));var db=require(_0x6004('0x6'))['db'];var utils=require(_0x6004('0x7'));var logger=require('../../config/logger')(_0x6004('0x8'));var config=require(_0x6004('0x9'));var jayson=require(_0x6004('0xa'));var client=jayson[_0x6004('0xb')][_0x6004('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x352969,_0xcae766,_0x50a55d){return new BPromise(function(_0x1d95c7,_0xfa757d){return client['request'](_0x352969,_0x50a55d)[_0x6004('0xd')](function(_0x4429dd){logger[_0x6004('0xe')](_0x6004('0xf'),_0xcae766,'request\x20sent');logger[_0x6004('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0xcae766,'request\x20sent',JSON[_0x6004('0x11')](_0x4429dd));if(_0x4429dd[_0x6004('0x12')]){if(_0x4429dd[_0x6004('0x12')][_0x6004('0x13')]===0x1f4){logger[_0x6004('0x12')](_0x6004('0xf'),_0xcae766,_0x4429dd[_0x6004('0x12')]['message']);return _0xfa757d(_0x4429dd[_0x6004('0x12')][_0x6004('0x14')]);}logger[_0x6004('0x12')](_0x6004('0xf'),_0xcae766,_0x4429dd[_0x6004('0x12')][_0x6004('0x14')]);return _0x1d95c7(_0x4429dd[_0x6004('0x12')]['message']);}else{logger[_0x6004('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xcae766,'request\x20sent');_0x1d95c7(_0x4429dd[_0x6004('0x15')][_0x6004('0x14')]);}})[_0x6004('0x16')](function(_0x311263){logger[_0x6004('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xcae766,_0x311263);_0xfa757d(_0x311263);});});}
\ No newline at end of file
index c520c85..57c7d08 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4179=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','download','post','create','update','delete','destroy','exports','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4179,0x130));var _0x9417=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x4179[_0xe73080];return _0x12cbc4;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x9417('0x0'));var express=require(_0x9417('0x1'));var router=express[_0x9417('0x2')]();var fs_extra=require(_0x9417('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9417('0x4'));var config=require(_0x9417('0x5'));var controller=require('./analyticExtractedReport.controller');router[_0x9417('0x6')]('/',auth[_0x9417('0x7')](),controller[_0x9417('0x8')]);router['get'](_0x9417('0x9'),auth['isAuthenticated'](),controller[_0x9417('0xa')]);router[_0x9417('0x6')]('/:id/download',auth[_0x9417('0x7')](),controller[_0x9417('0xb')]);router[_0x9417('0xc')]('/',auth[_0x9417('0x7')](),controller[_0x9417('0xd')]);router['put'](_0x9417('0x9'),auth[_0x9417('0x7')](),controller[_0x9417('0xe')]);router[_0x9417('0xf')](_0x9417('0x9'),auth[_0x9417('0x7')](),controller[_0x9417('0x10')]);module[_0x9417('0x11')]=router;
\ No newline at end of file
+var _0x6c0b=['fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x4c2f17,_0x5c6821){var _0x20919e=function(_0x31eef7){while(--_0x31eef7){_0x4c2f17['push'](_0x4c2f17['shift']());}};_0x20919e(++_0x5c6821);}(_0x6c0b,0x12e));var _0xb6c0=function(_0x489b87,_0xd51c93){_0x489b87=_0x489b87-0x0;var _0x1823b6=_0x6c0b[_0x489b87];return _0x1823b6;};'use strict';var multer=require(_0xb6c0('0x0'));var util=require(_0xb6c0('0x1'));var path=require(_0xb6c0('0x2'));var timeout=require(_0xb6c0('0x3'));var express=require(_0xb6c0('0x4'));var router=express[_0xb6c0('0x5')]();var fs_extra=require(_0xb6c0('0x6'));var auth=require(_0xb6c0('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb6c0('0x8'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0xb6c0('0x9')](),controller[_0xb6c0('0xa')]);router[_0xb6c0('0xb')](_0xb6c0('0xc'),auth[_0xb6c0('0x9')](),controller[_0xb6c0('0xd')]);router[_0xb6c0('0xb')](_0xb6c0('0xe'),auth[_0xb6c0('0x9')](),controller[_0xb6c0('0xf')]);router[_0xb6c0('0x10')]('/',auth[_0xb6c0('0x9')](),controller[_0xb6c0('0x11')]);router[_0xb6c0('0x12')](_0xb6c0('0xc'),auth[_0xb6c0('0x9')](),controller[_0xb6c0('0x13')]);router[_0xb6c0('0x14')](_0xb6c0('0xc'),auth['isAuthenticated'](),controller[_0xb6c0('0x15')]);module['exports']=router;
\ No newline at end of file
index 0092abc..8f30612 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c51=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x3c457e,_0x38e123){var _0x21ad50=function(_0x44f76e){while(--_0x44f76e){_0x3c457e['push'](_0x3c457e['shift']());}};_0x21ad50(++_0x38e123);}(_0x6c51,0xd7));var _0x16c5=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6c51[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x16c5('0x0'));module[_0x16c5('0x1')]={'field':{'type':Sequelize[_0x16c5('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x16c5('0x3')]},'groupBy':{'type':Sequelize[_0x16c5('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x16c5('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xa3af=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x525bcf,_0x86ae27){var _0xd63d2f=function(_0x426a23){while(--_0x426a23){_0x525bcf['push'](_0x525bcf['shift']());}};_0xd63d2f(++_0x86ae27);}(_0xa3af,0x185));var _0xfa3a=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa3af[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0xfa3a('0x0'));module[_0xfa3a('0x1')]={'field':{'type':Sequelize[_0xfa3a('0x2')]},'alias':{'type':Sequelize[_0xfa3a('0x3')]},'function':{'type':Sequelize[_0xfa3a('0x3')]},'format':{'type':Sequelize[_0xfa3a('0x3')]},'groupBy':{'type':Sequelize[_0xfa3a('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xfa3a('0x3')]},'custom':{'type':Sequelize[_0xfa3a('0x4')],'defaultValue':![]}};
\ No newline at end of file
index 5c2d05e..3b6ed10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x64d9=['send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','VIRTUAL','merge','includeAll','findAll','then','rows','show','params','keys','include','options','find','catch','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','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','api','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','offset','count','set','Content-Range','json','apply','reject','save','update','destroy','error','stack','name'];(function(_0x29be44,_0x4f38b5){var _0x54394e=function(_0x214df0){while(--_0x214df0){_0x29be44['push'](_0x29be44['shift']());}};_0x54394e(++_0x4f38b5);}(_0x64d9,0x83));var _0x964d=function(_0x3d387e,_0x4ddac8){_0x3d387e=_0x3d387e-0x0;var _0x32b303=_0x64d9[_0x3d387e];return _0x32b303;};'use strict';var emlformat=require(_0x964d('0x0'));var rimraf=require(_0x964d('0x1'));var zipdir=require(_0x964d('0x2'));var jsonpatch=require(_0x964d('0x3'));var rp=require(_0x964d('0x4'));var moment=require(_0x964d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x964d('0x6'));var util=require(_0x964d('0x7'));var path=require('path');var sox=require(_0x964d('0x8'));var csv=require('to-csv');var ejs=require(_0x964d('0x9'));var fs=require('fs');var fs_extra=require(_0x964d('0xa'));var _=require(_0x964d('0xb'));var squel=require(_0x964d('0xc'));var crypto=require(_0x964d('0xd'));var jsforce=require(_0x964d('0xe'));var deskjs=require(_0x964d('0xf'));var toCsv=require(_0x964d('0x10'));var querystring=require(_0x964d('0x11'));var Papa=require(_0x964d('0x12'));var Redis=require(_0x964d('0x13'));var authService=require(_0x964d('0x14'));var qs=require(_0x964d('0x15'));var as=require(_0x964d('0x16'));var hardwareService=require(_0x964d('0x17'));var logger=require('../../config/logger')(_0x964d('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x964d('0x19'));var db=require(_0x964d('0x1a'))['db'];function respondWithStatusCode(_0x24e3ad,_0x481fb9){_0x481fb9=_0x481fb9||0xcc;return function(_0x104d2e){if(_0x104d2e){return _0x24e3ad[_0x964d('0x1b')](_0x481fb9);}return _0x24e3ad[_0x964d('0x1c')](_0x481fb9)[_0x964d('0x1d')]();};}function respondWithResult(_0x493a13,_0xf7fc96){_0xf7fc96=_0xf7fc96||0xc8;return function(_0x2b7346){if(_0x2b7346){return _0x493a13[_0x964d('0x1c')](_0xf7fc96)['json'](_0x2b7346);}};}function respondWithFilteredResult(_0x12f014,_0x57ebaa){return function(_0x4a6920){if(_0x4a6920){var _0x196397=typeof _0x57ebaa['offset']==='undefined'&&typeof _0x57ebaa[_0x964d('0x1e')]===_0x964d('0x1f');var _0x486342=_0x4a6920['count'];var _0x569e97=_0x196397?0x0:_0x57ebaa[_0x964d('0x20')];var _0x59d02a=_0x196397?_0x4a6920[_0x964d('0x21')]:_0x57ebaa[_0x964d('0x20')]+_0x57ebaa[_0x964d('0x1e')];var _0x5d4544;if(_0x59d02a>=_0x486342){_0x59d02a=_0x486342;_0x5d4544=0xc8;}else{_0x5d4544=0xce;}_0x12f014['status'](_0x5d4544);return _0x12f014[_0x964d('0x22')](_0x964d('0x23'),_0x569e97+'-'+_0x59d02a+'/'+_0x486342)[_0x964d('0x24')](_0x4a6920);}return null;};}function patchUpdates(_0x3d02cf){return function(_0x3e734a){try{jsonpatch[_0x964d('0x25')](_0x3e734a,_0x3d02cf,!![]);}catch(_0x2526af){return BPromise[_0x964d('0x26')](_0x2526af);}return _0x3e734a[_0x964d('0x27')]();};}function saveUpdates(_0x4d4e0f,_0x264b94){return function(_0x35eab5){if(_0x35eab5){return _0x35eab5[_0x964d('0x28')](_0x4d4e0f)['then'](function(_0x4d9d62){return _0x4d9d62;});}return null;};}function removeEntity(_0x4f1899,_0x35524c){return function(_0x4d177b){if(_0x4d177b){return _0x4d177b[_0x964d('0x29')]()['then'](function(){_0x4f1899[_0x964d('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34a680,_0x22b0b7){return function(_0x4d6a75){if(!_0x4d6a75){_0x34a680[_0x964d('0x1b')](0x194);}return _0x4d6a75;};}function handleError(_0x57eda6,_0xe85011){_0xe85011=_0xe85011||0x1f4;return function(_0x1b169e){logger[_0x964d('0x2a')](_0x1b169e[_0x964d('0x2b')]);if(_0x1b169e[_0x964d('0x2c')]){delete _0x1b169e[_0x964d('0x2c')];}_0x57eda6[_0x964d('0x1c')](_0xe85011)[_0x964d('0x2d')](_0x1b169e);};}exports[_0x964d('0x2e')]=function(_0x3798fe,_0x4f0e1b){var _0x198b8a={},_0x3b7bbe={},_0x5465a9={'count':0x0,'rows':[]};var _0x7e5d5=_[_0x964d('0x2f')](db[_0x964d('0x30')][_0x964d('0x31')],function(_0x5f5979){return{'name':_0x5f5979[_0x964d('0x32')],'type':_0x5f5979[_0x964d('0x33')]['key']};});_0x3b7bbe['model']=_[_0x964d('0x2f')](_0x7e5d5,_0x964d('0x2c'));_0x3b7bbe[_0x964d('0x34')]=_['keys'](_0x3798fe[_0x964d('0x34')]);_0x3b7bbe[_0x964d('0x35')]=_[_0x964d('0x36')](_0x3b7bbe[_0x964d('0x37')],_0x3b7bbe['query']);_0x198b8a['attributes']=_['intersection'](_0x3b7bbe[_0x964d('0x37')],qs[_0x964d('0x38')](_0x3798fe[_0x964d('0x34')][_0x964d('0x38')]));_0x198b8a[_0x964d('0x39')]=_0x198b8a[_0x964d('0x39')][_0x964d('0x3a')]?_0x198b8a[_0x964d('0x39')]:_0x3b7bbe[_0x964d('0x37')];if(!_0x3798fe[_0x964d('0x34')][_0x964d('0x3b')](_0x964d('0x3c'))){_0x198b8a[_0x964d('0x1e')]=qs[_0x964d('0x1e')](_0x3798fe[_0x964d('0x34')][_0x964d('0x1e')]);_0x198b8a[_0x964d('0x20')]=qs['offset'](_0x3798fe[_0x964d('0x34')]['offset']);}_0x198b8a['order']=qs['sort'](_0x3798fe[_0x964d('0x34')][_0x964d('0x3d')]);_0x198b8a['where']=qs[_0x964d('0x35')](_[_0x964d('0x3e')](_0x3798fe[_0x964d('0x34')],_0x3b7bbe[_0x964d('0x35')]),_0x7e5d5);if(_0x3798fe[_0x964d('0x34')][_0x964d('0x3f')]){_0x198b8a[_0x964d('0x40')]=_['merge'](_0x198b8a[_0x964d('0x40')],{'$or':_[_0x964d('0x2f')](_0x7e5d5,function(_0x525b1a){if(_0x525b1a[_0x964d('0x33')]!==_0x964d('0x41')){var _0x4b2b64={};_0x4b2b64[_0x525b1a[_0x964d('0x2c')]]={'$like':'%'+_0x3798fe[_0x964d('0x34')][_0x964d('0x3f')]+'%'};return _0x4b2b64;}})});}_0x198b8a=_[_0x964d('0x42')]({},_0x198b8a,_0x3798fe['options']);var _0x5c1a6f={'where':_0x198b8a[_0x964d('0x40')]};return db['AnalyticFieldReport'][_0x964d('0x21')](_0x5c1a6f)['then'](function(_0xf6d465){_0x5465a9[_0x964d('0x21')]=_0xf6d465;if(_0x3798fe[_0x964d('0x34')][_0x964d('0x43')]){_0x198b8a['include']=[{'all':!![]}];}return db[_0x964d('0x30')][_0x964d('0x44')](_0x198b8a);})[_0x964d('0x45')](function(_0xf9a1d9){_0x5465a9[_0x964d('0x46')]=_0xf9a1d9;return _0x5465a9;})[_0x964d('0x45')](respondWithFilteredResult(_0x4f0e1b,_0x198b8a))['catch'](handleError(_0x4f0e1b,null));};exports[_0x964d('0x47')]=function(_0x30a313,_0x50ba89){var _0x1cbb78={'raw':![],'where':{'id':_0x30a313[_0x964d('0x48')]['id']}},_0xf1d365={};_0xf1d365[_0x964d('0x37')]=_[_0x964d('0x49')](db['AnalyticFieldReport']['rawAttributes']);_0xf1d365[_0x964d('0x34')]=_['keys'](_0x30a313[_0x964d('0x34')]);_0xf1d365[_0x964d('0x35')]=_[_0x964d('0x36')](_0xf1d365[_0x964d('0x37')],_0xf1d365[_0x964d('0x34')]);_0x1cbb78[_0x964d('0x39')]=_[_0x964d('0x36')](_0xf1d365[_0x964d('0x37')],qs[_0x964d('0x38')](_0x30a313[_0x964d('0x34')][_0x964d('0x38')]));_0x1cbb78[_0x964d('0x39')]=_0x1cbb78[_0x964d('0x39')][_0x964d('0x3a')]?_0x1cbb78['attributes']:_0xf1d365[_0x964d('0x37')];if(_0x30a313[_0x964d('0x34')][_0x964d('0x43')]){_0x1cbb78[_0x964d('0x4a')]=[{'all':!![]}];}_0x1cbb78=_[_0x964d('0x42')]({},_0x1cbb78,_0x30a313[_0x964d('0x4b')]);return db[_0x964d('0x30')][_0x964d('0x4c')](_0x1cbb78)[_0x964d('0x45')](handleEntityNotFound(_0x50ba89,null))[_0x964d('0x45')](respondWithResult(_0x50ba89,null))[_0x964d('0x4d')](handleError(_0x50ba89,null));};exports[_0x964d('0x4e')]=function(_0x57abbf,_0x5d602c){return db[_0x964d('0x30')]['create'](_0x57abbf[_0x964d('0x4f')],{})[_0x964d('0x45')](respondWithResult(_0x5d602c,0xc9))[_0x964d('0x4d')](handleError(_0x5d602c,null));};exports[_0x964d('0x50')]=function(_0x18d0cc,_0x46fc15){return db['AnalyticFieldReport'][_0x964d('0x50')](_0x18d0cc[_0x964d('0x4f')],{'raw':![],'individualHooks':!![]})[_0x964d('0x45')](respondWithResult(_0x46fc15,0xc9))['catch'](handleError(_0x46fc15,null));};exports[_0x964d('0x28')]=function(_0x5ed76b,_0x1012ff){if(_0x5ed76b['body']['id']){delete _0x5ed76b['body']['id'];}return db[_0x964d('0x30')]['find']({'where':{'id':_0x5ed76b['params']['id']}})[_0x964d('0x45')](handleEntityNotFound(_0x1012ff,null))[_0x964d('0x45')](saveUpdates(_0x5ed76b[_0x964d('0x4f')],null))[_0x964d('0x45')](respondWithResult(_0x1012ff,null))['catch'](handleError(_0x1012ff,null));};exports['destroy']=function(_0x573d50,_0x23e809){return db[_0x964d('0x30')][_0x964d('0x4c')]({'where':{'id':_0x573d50[_0x964d('0x48')]['id']}})['then'](handleEntityNotFound(_0x23e809,null))[_0x964d('0x45')](removeEntity(_0x23e809,null))['catch'](handleError(_0x23e809,null));};exports[_0x964d('0x51')]=function(_0x57a58c,_0x13fc30){return db[_0x964d('0x30')][_0x964d('0x29')]({'where':{'id':_0x57a58c[_0x964d('0x34')][_0x964d('0x52')]||[]},'raw':![],'individualHooks':!![]})[_0x964d('0x45')](respondWithResult(_0x13fc30,0xcc))[_0x964d('0x4d')](handleError(_0x13fc30,null));};exports[_0x964d('0x53')]=function(_0x59b54a,_0x2fbe64,_0x3cb75d){return db[_0x964d('0x54')][_0x964d('0x55')]({'where':{'id':_0x59b54a[_0x964d('0x48')]['id']}})['then'](handleEntityNotFound(_0x2fbe64,null))[_0x964d('0x45')](function(_0x4866bc){if(_0x4866bc){return db['sequelize'][_0x964d('0x56')](function(_0x3b6c1d){return db[_0x964d('0x30')][_0x964d('0x29')]({'where':{'CustomReportId':_0x59b54a[_0x964d('0x48')]['id']},'transaction':_0x3b6c1d})['then'](function(_0x26413d){var _0x675de5=_[_0x964d('0x2f')](_0x59b54a[_0x964d('0x4f')],function(_0x130c68){delete _0x130c68['id'];_0x130c68[_0x964d('0x57')]=_0x59b54a[_0x964d('0x48')]['id'];return _0x130c68;});return db[_0x964d('0x30')][_0x964d('0x50')](_0x675de5,{'transaction':_0x3b6c1d});});})['then'](function(){return db[_0x964d('0x30')][_0x964d('0x44')]({'where':{'CustomReportId':_0x59b54a['params']['id']}});});}})[_0x964d('0x45')](respondWithResult(_0x2fbe64,null))['catch'](handleError(_0x2fbe64,null));};
\ No newline at end of file
+var _0x5139=['sort','filters','pick','filter','merge','where','map','options','includeAll','include','findAll','catch','params','length','create','bulkCreate','body','destroy','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','reject','save','update','then','error','stack','name','index','AnalyticFieldReport','fieldName','type','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit'];(function(_0x44e114,_0x23db9d){var _0xd10546=function(_0xc9853a){while(--_0xc9853a){_0x44e114['push'](_0x44e114['shift']());}};_0xd10546(++_0x23db9d);}(_0x5139,0xaf));var _0x9513=function(_0x5d329b,_0x15387a){_0x5d329b=_0x5d329b-0x0;var _0x21eefb=_0x5139[_0x5d329b];return _0x21eefb;};'use strict';var emlformat=require(_0x9513('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9513('0x1'));var jsonpatch=require(_0x9513('0x2'));var rp=require(_0x9513('0x3'));var moment=require('moment');var BPromise=require(_0x9513('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x9513('0x5'));var csv=require(_0x9513('0x6'));var ejs=require(_0x9513('0x7'));var fs=require('fs');var fs_extra=require(_0x9513('0x8'));var _=require(_0x9513('0x9'));var squel=require(_0x9513('0xa'));var crypto=require(_0x9513('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9513('0xc'));var toCsv=require(_0x9513('0x6'));var querystring=require(_0x9513('0xd'));var Papa=require(_0x9513('0xe'));var Redis=require('ioredis');var authService=require(_0x9513('0xf'));var qs=require(_0x9513('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9513('0x11'));var utils=require(_0x9513('0x12'));var config=require(_0x9513('0x13'));var licenseUtil=require(_0x9513('0x14'));var db=require(_0x9513('0x15'))['db'];function respondWithStatusCode(_0x57978d,_0x1de524){_0x1de524=_0x1de524||0xcc;return function(_0x2448d7){if(_0x2448d7){return _0x57978d[_0x9513('0x16')](_0x1de524);}return _0x57978d[_0x9513('0x17')](_0x1de524)[_0x9513('0x18')]();};}function respondWithResult(_0xb9ef77,_0x545c89){_0x545c89=_0x545c89||0xc8;return function(_0x23401e){if(_0x23401e){return _0xb9ef77['status'](_0x545c89)[_0x9513('0x19')](_0x23401e);}};}function respondWithFilteredResult(_0x38b964,_0x2c938f){return function(_0x633e99){if(_0x633e99){var _0x5d498c=typeof _0x2c938f[_0x9513('0x1a')]==='undefined'&&typeof _0x2c938f[_0x9513('0x1b')]===_0x9513('0x1c');var _0x358fc6=_0x633e99[_0x9513('0x1d')];var _0x50070b=_0x5d498c?0x0:_0x2c938f[_0x9513('0x1a')];var _0x390fdd=_0x5d498c?_0x633e99[_0x9513('0x1d')]:_0x2c938f[_0x9513('0x1a')]+_0x2c938f[_0x9513('0x1b')];var _0x4f36ac;if(_0x390fdd>=_0x358fc6){_0x390fdd=_0x358fc6;_0x4f36ac=0xc8;}else{_0x4f36ac=0xce;}_0x38b964[_0x9513('0x17')](_0x4f36ac);return _0x38b964['set']('Content-Range',_0x50070b+'-'+_0x390fdd+'/'+_0x358fc6)[_0x9513('0x19')](_0x633e99);}return null;};}function patchUpdates(_0x5dee6a){return function(_0x8fd092){try{jsonpatch['apply'](_0x8fd092,_0x5dee6a,!![]);}catch(_0xef9c91){return BPromise[_0x9513('0x1e')](_0xef9c91);}return _0x8fd092[_0x9513('0x1f')]();};}function saveUpdates(_0x3ecd88,_0x90203c){return function(_0x1202f2){if(_0x1202f2){return _0x1202f2[_0x9513('0x20')](_0x3ecd88)[_0x9513('0x21')](function(_0x158fa5){return _0x158fa5;});}return null;};}function removeEntity(_0x1fb750,_0x2a8aad){return function(_0x5cd34b){if(_0x5cd34b){return _0x5cd34b['destroy']()[_0x9513('0x21')](function(){_0x1fb750[_0x9513('0x17')](0xcc)[_0x9513('0x18')]();});}};}function handleEntityNotFound(_0x4d391a,_0x9afd2f){return function(_0x481d0f){if(!_0x481d0f){_0x4d391a[_0x9513('0x16')](0x194);}return _0x481d0f;};}function handleError(_0x19969c,_0x6b1a45){_0x6b1a45=_0x6b1a45||0x1f4;return function(_0x1fe9e9){logger[_0x9513('0x22')](_0x1fe9e9[_0x9513('0x23')]);if(_0x1fe9e9[_0x9513('0x24')]){delete _0x1fe9e9[_0x9513('0x24')];}_0x19969c[_0x9513('0x17')](_0x6b1a45)['send'](_0x1fe9e9);};}exports[_0x9513('0x25')]=function(_0x326d4b,_0x15d4fd){var _0x247190={},_0x46cafb={},_0x151f2c={'count':0x0,'rows':[]};var _0x3a6bec=_['map'](db[_0x9513('0x26')]['rawAttributes'],function(_0x28f1c3){return{'name':_0x28f1c3[_0x9513('0x27')],'type':_0x28f1c3[_0x9513('0x28')][_0x9513('0x29')]};});_0x46cafb['model']=_['map'](_0x3a6bec,_0x9513('0x24'));_0x46cafb[_0x9513('0x2a')]=_[_0x9513('0x2b')](_0x326d4b['query']);_0x46cafb['filters']=_[_0x9513('0x2c')](_0x46cafb[_0x9513('0x2d')],_0x46cafb[_0x9513('0x2a')]);_0x247190['attributes']=_['intersection'](_0x46cafb['model'],qs[_0x9513('0x2e')](_0x326d4b[_0x9513('0x2a')][_0x9513('0x2e')]));_0x247190[_0x9513('0x2f')]=_0x247190['attributes']['length']?_0x247190[_0x9513('0x2f')]:_0x46cafb['model'];if(!_0x326d4b[_0x9513('0x2a')][_0x9513('0x30')](_0x9513('0x31'))){_0x247190['limit']=qs[_0x9513('0x1b')](_0x326d4b[_0x9513('0x2a')][_0x9513('0x1b')]);_0x247190['offset']=qs[_0x9513('0x1a')](_0x326d4b[_0x9513('0x2a')]['offset']);}_0x247190['order']=qs[_0x9513('0x32')](_0x326d4b['query'][_0x9513('0x32')]);_0x247190['where']=qs[_0x9513('0x33')](_[_0x9513('0x34')](_0x326d4b[_0x9513('0x2a')],_0x46cafb[_0x9513('0x33')]),_0x3a6bec);if(_0x326d4b['query'][_0x9513('0x35')]){_0x247190['where']=_[_0x9513('0x36')](_0x247190[_0x9513('0x37')],{'$or':_[_0x9513('0x38')](_0x3a6bec,function(_0x1c0068){if(_0x1c0068[_0x9513('0x28')]!=='VIRTUAL'){var _0x23761b={};_0x23761b[_0x1c0068[_0x9513('0x24')]]={'$like':'%'+_0x326d4b[_0x9513('0x2a')]['filter']+'%'};return _0x23761b;}})});}_0x247190=_[_0x9513('0x36')]({},_0x247190,_0x326d4b[_0x9513('0x39')]);var _0x31de2d={'where':_0x247190[_0x9513('0x37')]};return db['AnalyticFieldReport'][_0x9513('0x1d')](_0x31de2d)[_0x9513('0x21')](function(_0xc92ca4){_0x151f2c[_0x9513('0x1d')]=_0xc92ca4;if(_0x326d4b[_0x9513('0x2a')][_0x9513('0x3a')]){_0x247190[_0x9513('0x3b')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x9513('0x3c')](_0x247190);})[_0x9513('0x21')](function(_0x334c1f){_0x151f2c['rows']=_0x334c1f;return _0x151f2c;})[_0x9513('0x21')](respondWithFilteredResult(_0x15d4fd,_0x247190))[_0x9513('0x3d')](handleError(_0x15d4fd,null));};exports['show']=function(_0xc38fe3,_0x16f78c){var _0x52ec04={'raw':![],'where':{'id':_0xc38fe3[_0x9513('0x3e')]['id']}},_0x16c1e6={};_0x16c1e6[_0x9513('0x2d')]=_[_0x9513('0x2b')](db[_0x9513('0x26')]['rawAttributes']);_0x16c1e6[_0x9513('0x2a')]=_[_0x9513('0x2b')](_0xc38fe3[_0x9513('0x2a')]);_0x16c1e6[_0x9513('0x33')]=_[_0x9513('0x2c')](_0x16c1e6[_0x9513('0x2d')],_0x16c1e6[_0x9513('0x2a')]);_0x52ec04[_0x9513('0x2f')]=_[_0x9513('0x2c')](_0x16c1e6[_0x9513('0x2d')],qs[_0x9513('0x2e')](_0xc38fe3[_0x9513('0x2a')]['fields']));_0x52ec04[_0x9513('0x2f')]=_0x52ec04[_0x9513('0x2f')][_0x9513('0x3f')]?_0x52ec04[_0x9513('0x2f')]:_0x16c1e6[_0x9513('0x2d')];if(_0xc38fe3[_0x9513('0x2a')][_0x9513('0x3a')]){_0x52ec04[_0x9513('0x3b')]=[{'all':!![]}];}_0x52ec04=_[_0x9513('0x36')]({},_0x52ec04,_0xc38fe3[_0x9513('0x39')]);return db[_0x9513('0x26')]['find'](_0x52ec04)[_0x9513('0x21')](handleEntityNotFound(_0x16f78c,null))['then'](respondWithResult(_0x16f78c,null))['catch'](handleError(_0x16f78c,null));};exports[_0x9513('0x40')]=function(_0xbc6bc,_0x5887bc){return db[_0x9513('0x26')][_0x9513('0x40')](_0xbc6bc['body'],{})[_0x9513('0x21')](respondWithResult(_0x5887bc,0xc9))[_0x9513('0x3d')](handleError(_0x5887bc,null));};exports['bulkCreate']=function(_0x142835,_0x5a85d9){return db['AnalyticFieldReport'][_0x9513('0x41')](_0x142835[_0x9513('0x42')],{'raw':![],'individualHooks':!![]})[_0x9513('0x21')](respondWithResult(_0x5a85d9,0xc9))[_0x9513('0x3d')](handleError(_0x5a85d9,null));};exports[_0x9513('0x20')]=function(_0x37535b,_0x2f29f4){if(_0x37535b[_0x9513('0x42')]['id']){delete _0x37535b[_0x9513('0x42')]['id'];}return db[_0x9513('0x26')]['find']({'where':{'id':_0x37535b[_0x9513('0x3e')]['id']}})[_0x9513('0x21')](handleEntityNotFound(_0x2f29f4,null))['then'](saveUpdates(_0x37535b[_0x9513('0x42')],null))[_0x9513('0x21')](respondWithResult(_0x2f29f4,null))[_0x9513('0x3d')](handleError(_0x2f29f4,null));};exports[_0x9513('0x43')]=function(_0x56aef5,_0x12649c){return db[_0x9513('0x26')][_0x9513('0x44')]({'where':{'id':_0x56aef5[_0x9513('0x3e')]['id']}})[_0x9513('0x21')](handleEntityNotFound(_0x12649c,null))[_0x9513('0x21')](removeEntity(_0x12649c,null))[_0x9513('0x3d')](handleError(_0x12649c,null));};exports[_0x9513('0x45')]=function(_0xb1a10c,_0x4907ad){return db[_0x9513('0x26')]['destroy']({'where':{'id':_0xb1a10c[_0x9513('0x2a')][_0x9513('0x46')]||[]},'raw':![],'individualHooks':!![]})[_0x9513('0x21')](respondWithResult(_0x4907ad,0xcc))[_0x9513('0x3d')](handleError(_0x4907ad,null));};exports[_0x9513('0x47')]=function(_0x2497cc,_0xc37475,_0x4e36d2){return db[_0x9513('0x48')][_0x9513('0x49')]({'where':{'id':_0x2497cc[_0x9513('0x3e')]['id']}})[_0x9513('0x21')](handleEntityNotFound(_0xc37475,null))['then'](function(_0x435a1d){if(_0x435a1d){return db[_0x9513('0x4a')]['transaction'](function(_0xa61c4e){return db[_0x9513('0x26')][_0x9513('0x43')]({'where':{'CustomReportId':_0x2497cc[_0x9513('0x3e')]['id']},'transaction':_0xa61c4e})[_0x9513('0x21')](function(_0x4bf9c8){var _0x28097a=_[_0x9513('0x38')](_0x2497cc['body'],function(_0x1c1961){delete _0x1c1961['id'];_0x1c1961['CustomReportId']=_0x2497cc[_0x9513('0x3e')]['id'];return _0x1c1961;});return db[_0x9513('0x26')][_0x9513('0x41')](_0x28097a,{'transaction':_0xa61c4e});});})[_0x9513('0x21')](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x2497cc[_0x9513('0x3e')]['id']}});});}})['then'](respondWithResult(_0xc37475,null))[_0x9513('0x3d')](handleError(_0xc37475,null));};
\ No newline at end of file
index 6d663fc..127b43f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01f2=['./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2a4da6,_0x5e7f66){var _0x21f384=function(_0x1d2b45){while(--_0x1d2b45){_0x2a4da6['push'](_0x2a4da6['shift']());}};_0x21f384(++_0x5e7f66);}(_0x01f2,0x1c4));var _0x201f=function(_0x352174,_0x39fd8a){_0x352174=_0x352174-0x0;var _0x3ab398=_0x01f2[_0x352174];return _0x3ab398;};'use strict';var _=require(_0x201f('0x0'));var util=require(_0x201f('0x1'));var logger=require(_0x201f('0x2'))(_0x201f('0x3'));var moment=require(_0x201f('0x4'));var BPromise=require(_0x201f('0x5'));var rp=require(_0x201f('0x6'));var fs=require('fs');var path=require(_0x201f('0x7'));var rimraf=require(_0x201f('0x8'));var config=require(_0x201f('0x9'));var attributes=require(_0x201f('0xa'));module[_0x201f('0xb')]=function(_0x528562,_0x201b8b){return _0x528562['define'](_0x201f('0xc'),attributes,{'tableName':_0x201f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9060=['../../config/environment','./analyticFieldReport.attributes','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5270ee,_0x4fe7a3){var _0x21fecb=function(_0x3602be){while(--_0x3602be){_0x5270ee['push'](_0x5270ee['shift']());}};_0x21fecb(++_0x4fe7a3);}(_0x9060,0x130));var _0x0906=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x9060[_0x68ee8b];return _0x5148f7;};'use strict';var _=require(_0x0906('0x0'));var util=require('util');var logger=require(_0x0906('0x1'))(_0x0906('0x2'));var moment=require(_0x0906('0x3'));var BPromise=require(_0x0906('0x4'));var rp=require(_0x0906('0x5'));var fs=require('fs');var path=require(_0x0906('0x6'));var rimraf=require(_0x0906('0x7'));var config=require(_0x0906('0x8'));var attributes=require(_0x0906('0x9'));module['exports']=function(_0x1a4f22,_0x53007c){return _0x1a4f22['define'](_0x0906('0xa'),attributes,{'tableName':_0x0906('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7f5132a..deb2187 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x10a7=['debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent'];(function(_0x544cd7,_0x20f588){var _0x43c000=function(_0x3d71cf){while(--_0x3d71cf){_0x544cd7['push'](_0x544cd7['shift']());}};_0x43c000(++_0x20f588);}(_0x10a7,0x182));var _0x710a=function(_0x2d49f7,_0x3fcac1){_0x2d49f7=_0x2d49f7-0x0;var _0x56e5b1=_0x10a7[_0x2d49f7];return _0x56e5b1;};'use strict';var _=require(_0x710a('0x0'));var util=require(_0x710a('0x1'));var moment=require(_0x710a('0x2'));var BPromise=require('bluebird');var rs=require(_0x710a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x710a('0x4'))['db'];var utils=require(_0x710a('0x5'));var logger=require('../../config/logger')(_0x710a('0x6'));var config=require('../../config/environment');var jayson=require(_0x710a('0x7'));var client=jayson[_0x710a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xaf5f51,_0x3e7412,_0x61042a){return new BPromise(function(_0x25a894,_0x1cfb83){return client[_0x710a('0x9')](_0xaf5f51,_0x61042a)[_0x710a('0xa')](function(_0x239e5e){logger[_0x710a('0xb')](_0x710a('0xc'),_0x3e7412,_0x710a('0xd'));logger[_0x710a('0xe')](_0x710a('0xf'),_0x3e7412,'request\x20sent',JSON['stringify'](_0x239e5e));if(_0x239e5e[_0x710a('0x10')]){if(_0x239e5e[_0x710a('0x10')]['code']===0x1f4){logger[_0x710a('0x10')](_0x710a('0xc'),_0x3e7412,_0x239e5e[_0x710a('0x10')][_0x710a('0x11')]);return _0x1cfb83(_0x239e5e[_0x710a('0x10')][_0x710a('0x11')]);}logger[_0x710a('0x10')](_0x710a('0xc'),_0x3e7412,_0x239e5e[_0x710a('0x10')][_0x710a('0x11')]);return _0x25a894(_0x239e5e[_0x710a('0x10')][_0x710a('0x11')]);}else{logger[_0x710a('0xb')](_0x710a('0xc'),_0x3e7412,_0x710a('0xd'));_0x25a894(_0x239e5e[_0x710a('0x12')]['message']);}})[_0x710a('0x13')](function(_0x10c464){logger['error'](_0x710a('0xc'),_0x3e7412,_0x10c464);_0x1cfb83(_0x10c464);});});}
\ No newline at end of file
+var _0xba47=['then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x26a3f9,_0x275fe9){var _0x37a62f=function(_0x2f078f){while(--_0x2f078f){_0x26a3f9['push'](_0x26a3f9['shift']());}};_0x37a62f(++_0x275fe9);}(_0xba47,0xa8));var _0x7ba4=function(_0x533d3c,_0x326c9f){_0x533d3c=_0x533d3c-0x0;var _0x4cd573=_0xba47[_0x533d3c];return _0x4cd573;};'use strict';var _=require(_0x7ba4('0x0'));var util=require(_0x7ba4('0x1'));var moment=require(_0x7ba4('0x2'));var BPromise=require(_0x7ba4('0x3'));var rs=require(_0x7ba4('0x4'));var fs=require('fs');var Redis=require(_0x7ba4('0x5'));var db=require(_0x7ba4('0x6'))['db'];var utils=require(_0x7ba4('0x7'));var logger=require('../../config/logger')(_0x7ba4('0x8'));var config=require(_0x7ba4('0x9'));var jayson=require(_0x7ba4('0xa'));var client=jayson[_0x7ba4('0xb')][_0x7ba4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3ed4f1,_0x4db0cc,_0x48a42b){return new BPromise(function(_0x52db60,_0x4571a4){return client[_0x7ba4('0xd')](_0x3ed4f1,_0x48a42b)[_0x7ba4('0xe')](function(_0x22f14f){logger[_0x7ba4('0xf')](_0x7ba4('0x10'),_0x4db0cc,_0x7ba4('0x11'));logger[_0x7ba4('0x12')](_0x7ba4('0x13'),_0x4db0cc,_0x7ba4('0x11'),JSON[_0x7ba4('0x14')](_0x22f14f));if(_0x22f14f[_0x7ba4('0x15')]){if(_0x22f14f[_0x7ba4('0x15')][_0x7ba4('0x16')]===0x1f4){logger[_0x7ba4('0x15')](_0x7ba4('0x10'),_0x4db0cc,_0x22f14f[_0x7ba4('0x15')][_0x7ba4('0x17')]);return _0x4571a4(_0x22f14f[_0x7ba4('0x15')][_0x7ba4('0x17')]);}logger[_0x7ba4('0x15')](_0x7ba4('0x10'),_0x4db0cc,_0x22f14f[_0x7ba4('0x15')][_0x7ba4('0x17')]);return _0x52db60(_0x22f14f['error'][_0x7ba4('0x17')]);}else{logger['info'](_0x7ba4('0x10'),_0x4db0cc,'request\x20sent');_0x52db60(_0x22f14f[_0x7ba4('0x18')][_0x7ba4('0x17')]);}})[_0x7ba4('0x19')](function(_0x21c035){logger[_0x7ba4('0x15')](_0x7ba4('0x10'),_0x4db0cc,_0x21c035);_0x4571a4(_0x21c035);});});}
\ No newline at end of file
index 38ba2f8..f31ff61 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(_0x4cf0a1,_0x126c6e){var _0x533a44=function(_0x3c379a){while(--_0x3c379a){_0x4cf0a1['push'](_0x4cf0a1['shift']());}};_0x533a44(++_0x126c6e);}(_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['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(_0x185ca0,_0x548954){var _0x40f97c=function(_0x356a64){while(--_0x356a64){_0x185ca0['push'](_0x185ca0['shift']());}};_0x40f97c(++_0x548954);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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 e891d05..d96cfed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2116=['name','STRING','TEXT','exports'];(function(_0x564801,_0x2ff0e2){var _0x10bb38=function(_0x14681a){while(--_0x14681a){_0x564801['push'](_0x564801['shift']());}};_0x10bb38(++_0x2ff0e2);}(_0x2116,0x67));var _0x6211=function(_0x773787,_0x269f85){_0x773787=_0x773787-0x0;var _0x7b67e3=_0x2116[_0x773787];return _0x7b67e3;};'use strict';var Sequelize=require('sequelize');module[_0x6211('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6211('0x1')},'table':{'type':Sequelize[_0x6211('0x2')]},'metric':{'type':Sequelize[_0x6211('0x3')]},'description':{'type':Sequelize[_0x6211('0x2')]}};
\ No newline at end of file
+var _0x37e9=['name','TEXT','sequelize','exports','STRING'];(function(_0x33396e,_0x4412a2){var _0x3be463=function(_0x306fb3){while(--_0x306fb3){_0x33396e['push'](_0x33396e['shift']());}};_0x3be463(++_0x4412a2);}(_0x37e9,0x1e7));var _0x937e=function(_0x11d477,_0x20cb6f){_0x11d477=_0x11d477-0x0;var _0x38d88e=_0x37e9[_0x11d477];return _0x38d88e;};'use strict';var Sequelize=require(_0x937e('0x0'));module[_0x937e('0x1')]={'name':{'type':Sequelize[_0x937e('0x2')],'allowNull':![],'unique':_0x937e('0x3')},'table':{'type':Sequelize[_0x937e('0x2')]},'metric':{'type':Sequelize[_0x937e('0x4')]},'description':{'type':Sequelize[_0x937e('0x2')]}};
\ No newline at end of file
index 1ed5408..3535f3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xabce=['includeAll','rows','show','params','intersection','length','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','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','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','filter','merge','VIRTUAL','options'];(function(_0x245044,_0x4c6022){var _0x3fac56=function(_0x138a1b){while(--_0x138a1b){_0x245044['push'](_0x245044['shift']());}};_0x3fac56(++_0x4c6022);}(_0xabce,0x103));var _0xeabc=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xabce[_0x54d4a8];return _0x3b321b;};'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(){var _0x480440=_0x319119[_0xeabc('0x26')]({'plain':!![]});var _0x4d4e29=_0xeabc('0x27');return db[_0xeabc('0x28')][_0xeabc('0x29')]({'where':{'type':_0x4d4e29,'resourceId':_0x480440['id']}})[_0xeabc('0x25')](function(){return _0x319119;});})[_0xeabc('0x25')](function(){_0x3854d2[_0xeabc('0x1a')](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4c2693,_0x5b2934){return function(_0x459c8a){if(!_0x459c8a){_0x4c2693['sendStatus'](0x194);}return _0x459c8a;};}function handleError(_0x3c1b5b,_0x2b342c){_0x2b342c=_0x2b342c||0x1f4;return function(_0x48fb52){logger[_0xeabc('0x2a')](_0x48fb52[_0xeabc('0x2b')]);if(_0x48fb52[_0xeabc('0x2c')]){delete _0x48fb52[_0xeabc('0x2c')];}_0x3c1b5b[_0xeabc('0x1a')](_0x2b342c)[_0xeabc('0x2d')](_0x48fb52);};}exports[_0xeabc('0x2e')]=function(_0x38dc0a,_0x2915c1){var _0x5ebb86={},_0x5b34dd={},_0x5bb1f1={'count':0x0,'rows':[]};var _0x2f03e8=_[_0xeabc('0x2f')](db[_0xeabc('0x30')][_0xeabc('0x31')],function(_0x73c8d4){return{'name':_0x73c8d4[_0xeabc('0x32')],'type':_0x73c8d4[_0xeabc('0x33')]['key']};});_0x5b34dd[_0xeabc('0x34')]=_[_0xeabc('0x2f')](_0x2f03e8,_0xeabc('0x2c'));_0x5b34dd['query']=_[_0xeabc('0x35')](_0x38dc0a[_0xeabc('0x36')]);_0x5b34dd[_0xeabc('0x37')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],_0x5b34dd[_0xeabc('0x36')]);_0x5ebb86[_0xeabc('0x38')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x38dc0a['query']['fields']));_0x5ebb86[_0xeabc('0x38')]=_0x5ebb86[_0xeabc('0x38')]['length']?_0x5ebb86[_0xeabc('0x38')]:_0x5b34dd[_0xeabc('0x34')];if(!_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3a')](_0xeabc('0x3b'))){_0x5ebb86['limit']=qs[_0xeabc('0x1d')](_0x38dc0a['query'][_0xeabc('0x1d')]);_0x5ebb86[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x38dc0a['query']['offset']);}_0x5ebb86[_0xeabc('0x3c')]=qs['sort'](_0x38dc0a[_0xeabc('0x36')]['sort']);_0x5ebb86['where']=qs['filters'](_['pick'](_0x38dc0a[_0xeabc('0x36')],_0x5b34dd['filters']),_0x2f03e8);if(_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3d')]){_0x5ebb86['where']=_[_0xeabc('0x3e')](_0x5ebb86['where'],{'$or':_[_0xeabc('0x2f')](_0x2f03e8,function(_0x58aafe){if(_0x58aafe[_0xeabc('0x33')]!==_0xeabc('0x3f')){var _0xeeef02={};_0xeeef02[_0x58aafe['name']]={'$like':'%'+_0x38dc0a['query']['filter']+'%'};return _0xeeef02;}})});}_0x5ebb86=_[_0xeabc('0x3e')]({},_0x5ebb86,_0x38dc0a[_0xeabc('0x40')]);var _0xafa59b={'where':_0x5ebb86['where']};return db['AnalyticMetric'][_0xeabc('0x1e')](_0xafa59b)[_0xeabc('0x25')](function(_0x5e9cb3){_0x5bb1f1[_0xeabc('0x1e')]=_0x5e9cb3;if(_0x38dc0a['query'][_0xeabc('0x41')]){_0x5ebb86['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5ebb86);})[_0xeabc('0x25')](function(_0x37c926){_0x5bb1f1[_0xeabc('0x42')]=_0x37c926;return _0x5bb1f1;})[_0xeabc('0x25')](respondWithFilteredResult(_0x2915c1,_0x5ebb86))['catch'](handleError(_0x2915c1,null));};exports[_0xeabc('0x43')]=function(_0x555d26,_0x7d5add){var _0x1a4bbe={'raw':!![],'where':{'id':_0x555d26[_0xeabc('0x44')]['id']}},_0x3a7807={};_0x3a7807[_0xeabc('0x34')]=_['keys'](db['AnalyticMetric'][_0xeabc('0x31')]);_0x3a7807['query']=_[_0xeabc('0x35')](_0x555d26[_0xeabc('0x36')]);_0x3a7807['filters']=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],_0x3a7807[_0xeabc('0x36')]);_0x1a4bbe[_0xeabc('0x38')]=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x555d26['query'][_0xeabc('0x39')]));_0x1a4bbe[_0xeabc('0x38')]=_0x1a4bbe[_0xeabc('0x38')][_0xeabc('0x46')]?_0x1a4bbe[_0xeabc('0x38')]:_0x3a7807[_0xeabc('0x34')];if(_0x555d26[_0xeabc('0x36')][_0xeabc('0x41')]){_0x1a4bbe[_0xeabc('0x47')]=[{'all':!![]}];}_0x1a4bbe=_[_0xeabc('0x3e')]({},_0x1a4bbe,_0x555d26['options']);return db[_0xeabc('0x30')][_0xeabc('0x48')](_0x1a4bbe)[_0xeabc('0x25')](handleEntityNotFound(_0x7d5add,null))[_0xeabc('0x25')](respondWithResult(_0x7d5add,null))[_0xeabc('0x49')](handleError(_0x7d5add,null));};exports[_0xeabc('0x4a')]=function(_0x268d95,_0x48df43){return db[_0xeabc('0x30')][_0xeabc('0x4a')](_0x268d95[_0xeabc('0x4b')],{})[_0xeabc('0x25')](function(_0x47440e){var _0x58e2c1=_0x268d95[_0xeabc('0x4c')][_0xeabc('0x26')]({'plain':!![]});if(!_0x58e2c1)throw new Error(_0xeabc('0x4d'));if(_0x58e2c1[_0xeabc('0x4e')]==='user'){var _0x400b82=_0x47440e[_0xeabc('0x26')]({'plain':!![]});var _0x568847=_0xeabc('0x27');return db['UserProfileSection'][_0xeabc('0x48')]({'where':{'name':_0x568847,'userProfileId':_0x58e2c1['userProfileId']},'raw':!![]})[_0xeabc('0x25')](function(_0x2ec94c){if(_0x2ec94c&&_0x2ec94c[_0xeabc('0x4f')]===0x0){return db[_0xeabc('0x28')][_0xeabc('0x4a')]({'name':_0x400b82[_0xeabc('0x2c')],'resourceId':_0x400b82['id'],'type':_0x2ec94c[_0xeabc('0x2c')],'sectionId':_0x2ec94c['id']},{})[_0xeabc('0x25')](function(){return _0x47440e;});}else{return _0x47440e;}})[_0xeabc('0x49')](function(_0x6423f3){logger['error'](_0xeabc('0x50'),_0x6423f3);throw _0x6423f3;});}return _0x47440e;})[_0xeabc('0x25')](respondWithResult(_0x48df43,0xc9))[_0xeabc('0x49')](handleError(_0x48df43,null));};exports[_0xeabc('0x24')]=function(_0x555d6b,_0x1cef45){if(_0x555d6b[_0xeabc('0x4b')]['id']){delete _0x555d6b[_0xeabc('0x4b')]['id'];}return db[_0xeabc('0x30')]['find']({'where':{'id':_0x555d6b[_0xeabc('0x44')]['id']}})[_0xeabc('0x25')](handleEntityNotFound(_0x1cef45,null))[_0xeabc('0x25')](saveUpdates(_0x555d6b[_0xeabc('0x4b')],null))[_0xeabc('0x25')](respondWithResult(_0x1cef45,null))[_0xeabc('0x49')](handleError(_0x1cef45,null));};exports[_0xeabc('0x29')]=function(_0x3ff38c,_0x17acf8){return db['AnalyticMetric'][_0xeabc('0x48')]({'where':{'id':_0x3ff38c['params']['id']}})['then'](handleEntityNotFound(_0x17acf8,null))['then'](removeEntity(_0x17acf8,null))[_0xeabc('0x49')](handleError(_0x17acf8,null));};
\ No newline at end of file
+var _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x5b03a6,_0x192292){var _0x5900fa=function(_0x6d8a00){while(--_0x6d8a00){_0x5b03a6['push'](_0x5b03a6['shift']());}};_0x5900fa(++_0x192292);}(_0x9a19,0x114));var _0x99a1=function(_0xbb14db,_0x3ee8c6){_0xbb14db=_0xbb14db-0x0;var _0x36bed7=_0x9a19[_0xbb14db];return _0x36bed7;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));};
\ No newline at end of file
index 7e76f45..c4fe35f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbccd=['lodash','api','moment','bluebird','request-promise','path','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics'];(function(_0x3423ff,_0x2b56c9){var _0x5c00bc=function(_0x28cdd1){while(--_0x28cdd1){_0x3423ff['push'](_0x3423ff['shift']());}};_0x5c00bc(++_0x2b56c9);}(_0xbccd,0x1b0));var _0xdbcc=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xbccd[_0x279d37];return _0x530173;};'use strict';var _=require(_0xdbcc('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xdbcc('0x1'));var moment=require(_0xdbcc('0x2'));var BPromise=require(_0xdbcc('0x3'));var rp=require(_0xdbcc('0x4'));var fs=require('fs');var path=require(_0xdbcc('0x5'));var rimraf=require(_0xdbcc('0x6'));var config=require('../../config/environment');var attributes=require(_0xdbcc('0x7'));module[_0xdbcc('0x8')]=function(_0x9cca7a,_0x2997fd){return _0x9cca7a[_0xdbcc('0x9')](_0xdbcc('0xa'),attributes,{'tableName':_0xdbcc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfdbd=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticMetric.attributes'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x65ff6c,_0x4c2da3){_0x65ff6c=_0x65ff6c-0x0;var _0x238215=_0xfdbd[_0x65ff6c];return _0x238215;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var logger=require(_0xdfdb('0x2'))(_0xdfdb('0x3'));var moment=require(_0xdfdb('0x4'));var BPromise=require(_0xdfdb('0x5'));var rp=require(_0xdfdb('0x6'));var fs=require('fs');var path=require(_0xdfdb('0x7'));var rimraf=require(_0xdfdb('0x8'));var config=require('../../config/environment');var attributes=require(_0xdfdb('0x9'));module['exports']=function(_0x453ef6,_0x41bd5e){return _0x453ef6['define']('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 01ccf6c..1fdc7b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0475=['AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request'];(function(_0xbc4560,_0x4020b8){var _0x298cfb=function(_0x254423){while(--_0x254423){_0xbc4560['push'](_0xbc4560['shift']());}};_0x298cfb(++_0x4020b8);}(_0x0475,0xdb));var _0x5047=function(_0x3b0796,_0x3d5382){_0x3b0796=_0x3b0796-0x0;var _0x1bf181=_0x0475[_0x3b0796];return _0x1bf181;};'use strict';var _=require(_0x5047('0x0'));var util=require('util');var moment=require(_0x5047('0x1'));var BPromise=require(_0x5047('0x2'));var rs=require(_0x5047('0x3'));var fs=require('fs');var Redis=require(_0x5047('0x4'));var db=require(_0x5047('0x5'))['db'];var utils=require(_0x5047('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x5047('0x7'));var jayson=require(_0x5047('0x8'));var client=jayson[_0x5047('0x9')][_0x5047('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1f5db2,_0x4c762a,_0x44b8d6){return new BPromise(function(_0x58a239,_0x512fb9){return client[_0x5047('0xb')](_0x1f5db2,_0x44b8d6)['then'](function(_0x551912){logger['info'](_0x5047('0xc'),_0x4c762a,'request\x20sent');logger[_0x5047('0xd')](_0x5047('0xe'),_0x4c762a,_0x5047('0xf'),JSON[_0x5047('0x10')](_0x551912));if(_0x551912['error']){if(_0x551912[_0x5047('0x11')]['code']===0x1f4){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x4c762a,_0x551912[_0x5047('0x11')]['message']);return _0x512fb9(_0x551912['error'][_0x5047('0x12')]);}logger[_0x5047('0x11')](_0x5047('0xc'),_0x4c762a,_0x551912[_0x5047('0x11')][_0x5047('0x12')]);return _0x58a239(_0x551912[_0x5047('0x11')][_0x5047('0x12')]);}else{logger[_0x5047('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x4c762a,'request\x20sent');_0x58a239(_0x551912[_0x5047('0x14')][_0x5047('0x12')]);}})['catch'](function(_0x31193e){logger[_0x5047('0x11')](_0x5047('0xc'),_0x4c762a,_0x31193e);_0x512fb9(_0x31193e);});});}
\ No newline at end of file
+var _0xa06e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3578e0,_0x527708){var _0x9ba392=function(_0xc6b899){while(--_0xc6b899){_0x3578e0['push'](_0x3578e0['shift']());}};_0x9ba392(++_0x527708);}(_0xa06e,0xc2));var _0xea06=function(_0x13ef4f,_0x268dae){_0x13ef4f=_0x13ef4f-0x0;var _0x568fa4=_0xa06e[_0x13ef4f];return _0x568fa4;};'use strict';var _=require(_0xea06('0x0'));var util=require(_0xea06('0x1'));var moment=require(_0xea06('0x2'));var BPromise=require(_0xea06('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea06('0x4'));var db=require(_0xea06('0x5'))['db'];var utils=require(_0xea06('0x6'));var logger=require(_0xea06('0x7'))(_0xea06('0x8'));var config=require('../../config/environment');var jayson=require(_0xea06('0x9'));var client=jayson[_0xea06('0xa')][_0xea06('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x272f72,_0x359741,_0x265c62){return new BPromise(function(_0x5ac911,_0x5ac6ca){return client['request'](_0x272f72,_0x265c62)['then'](function(_0x24f1ce){logger[_0xea06('0xc')](_0xea06('0xd'),_0x359741,_0xea06('0xe'));logger[_0xea06('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x359741,_0xea06('0xe'),JSON[_0xea06('0x10')](_0x24f1ce));if(_0x24f1ce[_0xea06('0x11')]){if(_0x24f1ce[_0xea06('0x11')][_0xea06('0x12')]===0x1f4){logger[_0xea06('0x11')](_0xea06('0xd'),_0x359741,_0x24f1ce['error']['message']);return _0x5ac6ca(_0x24f1ce[_0xea06('0x11')][_0xea06('0x13')]);}logger[_0xea06('0x11')](_0xea06('0xd'),_0x359741,_0x24f1ce['error']['message']);return _0x5ac911(_0x24f1ce[_0xea06('0x11')][_0xea06('0x13')]);}else{logger['info'](_0xea06('0xd'),_0x359741,_0xea06('0xe'));_0x5ac911(_0x24f1ce[_0xea06('0x14')][_0xea06('0x13')]);}})[_0xea06('0x15')](function(_0x465920){logger[_0xea06('0x11')](_0xea06('0xd'),_0x359741,_0x465920);_0x5ac6ca(_0x465920);});});}
\ No newline at end of file
index 121732c..adbe4f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cd3=['/:id','show','post','create','put','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./analyticMetric.controller','get','isAuthenticated','index'];(function(_0x3de16a,_0x3b9e39){var _0x33d96f=function(_0x578566){while(--_0x578566){_0x3de16a['push'](_0x3de16a['shift']());}};_0x33d96f(++_0x3b9e39);}(_0x2cd3,0xf1));var _0x32cd=function(_0x545a3a,_0x3123aa){_0x545a3a=_0x545a3a-0x0;var _0x5a5493=_0x2cd3[_0x545a3a];return _0x5a5493;};'use strict';var multer=require(_0x32cd('0x0'));var util=require('util');var path=require(_0x32cd('0x1'));var timeout=require(_0x32cd('0x2'));var express=require(_0x32cd('0x3'));var router=express[_0x32cd('0x4')]();var fs_extra=require(_0x32cd('0x5'));var auth=require(_0x32cd('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x32cd('0x7'));router[_0x32cd('0x8')]('/',auth[_0x32cd('0x9')](),controller[_0x32cd('0xa')]);router[_0x32cd('0x8')](_0x32cd('0xb'),auth[_0x32cd('0x9')](),controller[_0x32cd('0xc')]);router[_0x32cd('0xd')]('/',auth[_0x32cd('0x9')](),controller[_0x32cd('0xe')]);router[_0x32cd('0xf')](_0x32cd('0xb'),auth[_0x32cd('0x9')](),controller[_0x32cd('0x10')]);router[_0x32cd('0x11')](_0x32cd('0xb'),auth[_0x32cd('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x4fd7=['fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x17072e,_0x51728c){var _0x75baee=function(_0x14cb19){while(--_0x14cb19){_0x17072e['push'](_0x17072e['shift']());}};_0x75baee(++_0x51728c);}(_0x4fd7,0xe6));var _0x74fd=function(_0x528bf7,_0x2c17c5){_0x528bf7=_0x528bf7-0x0;var _0x45e043=_0x4fd7[_0x528bf7];return _0x45e043;};'use strict';var multer=require(_0x74fd('0x0'));var util=require(_0x74fd('0x1'));var path=require(_0x74fd('0x2'));var timeout=require(_0x74fd('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x74fd('0x4'));var auth=require(_0x74fd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x74fd('0x6'));var controller=require('./analyticMetric.controller');router[_0x74fd('0x7')]('/',auth['isAuthenticated'](),controller[_0x74fd('0x8')]);router[_0x74fd('0x7')]('/:id',auth[_0x74fd('0x9')](),controller[_0x74fd('0xa')]);router['post']('/',auth[_0x74fd('0x9')](),controller[_0x74fd('0xb')]);router[_0x74fd('0xc')](_0x74fd('0xd'),auth[_0x74fd('0x9')](),controller[_0x74fd('0xe')]);router[_0x74fd('0xf')](_0x74fd('0xd'),auth[_0x74fd('0x9')](),controller[_0x74fd('0x10')]);module[_0x74fd('0x11')]=router;
\ No newline at end of file
index 7a69cbd..bca9a9b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc530=['exports','sequelize'];(function(_0x582a19,_0x34dbbf){var _0x50fa01=function(_0x470ab0){while(--_0x470ab0){_0x582a19['push'](_0x582a19['shift']());}};_0x50fa01(++_0x34dbbf);}(_0xc530,0x157));var _0x0c53=function(_0x2f6f50,_0x1d21a7){_0x2f6f50=_0x2f6f50-0x0;var _0x2cf365=_0xc530[_0x2f6f50];return _0x2cf365;};'use strict';var Sequelize=require(_0x0c53('0x0'));module[_0x0c53('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x76b4=['sequelize','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x76b4,0x110));var _0x476b=function(_0x42be7f,_0x36f338){_0x42be7f=_0x42be7f-0x0;var _0x42c239=_0x76b4[_0x42be7f];return _0x42c239;};'use strict';var Sequelize=require(_0x476b('0x0'));module['exports']={'tree':{'type':Sequelize[_0x476b('0x1')],'allowNull':![]}};
\ No newline at end of file
index c69cba5..8f76c1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcafb=['create','body','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','VIRTUAL','merge','options','AnalyticTreeReport','include','findAll','rows','catch','show','params'];(function(_0x175d53,_0x4215d0){var _0x135620=function(_0x43649b){while(--_0x43649b){_0x175d53['push'](_0x175d53['shift']());}};_0x135620(++_0x4215d0);}(_0xcafb,0xdd));var _0xbcaf=function(_0x52aa4c,_0x1abcb2){_0x52aa4c=_0x52aa4c-0x0;var _0x3a9660=_0xcafb[_0x52aa4c];return _0x3a9660;};'use strict';var emlformat=require(_0xbcaf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbcaf('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbcaf('0x2'));var moment=require(_0xbcaf('0x3'));var BPromise=require(_0xbcaf('0x4'));var Mustache=require(_0xbcaf('0x5'));var util=require(_0xbcaf('0x6'));var path=require(_0xbcaf('0x7'));var sox=require(_0xbcaf('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbcaf('0x9'));var _=require(_0xbcaf('0xa'));var squel=require(_0xbcaf('0xb'));var crypto=require(_0xbcaf('0xc'));var jsforce=require(_0xbcaf('0xd'));var deskjs=require(_0xbcaf('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbcaf('0xf'));var Papa=require(_0xbcaf('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbcaf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbcaf('0x12'))(_0xbcaf('0x13'));var utils=require(_0xbcaf('0x14'));var config=require(_0xbcaf('0x15'));var licenseUtil=require(_0xbcaf('0x16'));var db=require(_0xbcaf('0x17'))['db'];function respondWithStatusCode(_0x37569e,_0x4ee18f){_0x4ee18f=_0x4ee18f||0xcc;return function(_0x5527f3){if(_0x5527f3){return _0x37569e[_0xbcaf('0x18')](_0x4ee18f);}return _0x37569e[_0xbcaf('0x19')](_0x4ee18f)[_0xbcaf('0x1a')]();};}function respondWithResult(_0x4373b5,_0xa1dd4f){_0xa1dd4f=_0xa1dd4f||0xc8;return function(_0x467bb9){if(_0x467bb9){return _0x4373b5['status'](_0xa1dd4f)[_0xbcaf('0x1b')](_0x467bb9);}};}function respondWithFilteredResult(_0x253304,_0x72ac1f){return function(_0x313d8c){if(_0x313d8c){var _0x53caa8=typeof _0x72ac1f[_0xbcaf('0x1c')]===_0xbcaf('0x1d')&&typeof _0x72ac1f['limit']===_0xbcaf('0x1d');var _0x4371f6=_0x313d8c[_0xbcaf('0x1e')];var _0x1382bd=_0x53caa8?0x0:_0x72ac1f[_0xbcaf('0x1c')];var _0x459c98=_0x53caa8?_0x313d8c['count']:_0x72ac1f['offset']+_0x72ac1f['limit'];var _0x50e96b;if(_0x459c98>=_0x4371f6){_0x459c98=_0x4371f6;_0x50e96b=0xc8;}else{_0x50e96b=0xce;}_0x253304[_0xbcaf('0x19')](_0x50e96b);return _0x253304[_0xbcaf('0x1f')](_0xbcaf('0x20'),_0x1382bd+'-'+_0x459c98+'/'+_0x4371f6)['json'](_0x313d8c);}return null;};}function patchUpdates(_0xc8a5ee){return function(_0x963dc5){try{jsonpatch['apply'](_0x963dc5,_0xc8a5ee,!![]);}catch(_0x460ef1){return BPromise[_0xbcaf('0x21')](_0x460ef1);}return _0x963dc5[_0xbcaf('0x22')]();};}function saveUpdates(_0x2682ad,_0x3caaca){return function(_0x3ca623){if(_0x3ca623){return _0x3ca623[_0xbcaf('0x23')](_0x2682ad)['then'](function(_0x339bed){return _0x339bed;});}return null;};}function removeEntity(_0x576cb9,_0xbe9f60){return function(_0x167138){if(_0x167138){return _0x167138[_0xbcaf('0x24')]()[_0xbcaf('0x25')](function(){_0x576cb9[_0xbcaf('0x19')](0xcc)[_0xbcaf('0x1a')]();});}};}function handleEntityNotFound(_0x472292,_0x2b60f2){return function(_0x2f613e){if(!_0x2f613e){_0x472292[_0xbcaf('0x18')](0x194);}return _0x2f613e;};}function handleError(_0x594f33,_0x11ee72){_0x11ee72=_0x11ee72||0x1f4;return function(_0x1658be){logger[_0xbcaf('0x26')](_0x1658be[_0xbcaf('0x27')]);if(_0x1658be[_0xbcaf('0x28')]){delete _0x1658be['name'];}_0x594f33[_0xbcaf('0x19')](_0x11ee72)[_0xbcaf('0x29')](_0x1658be);};}exports[_0xbcaf('0x2a')]=function(_0x23bd35,_0x992a97){var _0x267058={},_0x50a375={},_0x4908b0={'count':0x0,'rows':[]};var _0x5ed0a5=_[_0xbcaf('0x2b')](db['AnalyticTreeReport'][_0xbcaf('0x2c')],function(_0x3800a6){return{'name':_0x3800a6['fieldName'],'type':_0x3800a6[_0xbcaf('0x2d')][_0xbcaf('0x2e')]};});_0x50a375[_0xbcaf('0x2f')]=_[_0xbcaf('0x2b')](_0x5ed0a5,_0xbcaf('0x28'));_0x50a375[_0xbcaf('0x30')]=_[_0xbcaf('0x31')](_0x23bd35[_0xbcaf('0x30')]);_0x50a375[_0xbcaf('0x32')]=_[_0xbcaf('0x33')](_0x50a375[_0xbcaf('0x2f')],_0x50a375['query']);_0x267058[_0xbcaf('0x34')]=_[_0xbcaf('0x33')](_0x50a375['model'],qs[_0xbcaf('0x35')](_0x23bd35['query'][_0xbcaf('0x35')]));_0x267058[_0xbcaf('0x34')]=_0x267058[_0xbcaf('0x34')][_0xbcaf('0x36')]?_0x267058['attributes']:_0x50a375[_0xbcaf('0x2f')];if(!_0x23bd35['query'][_0xbcaf('0x37')]('nolimit')){_0x267058[_0xbcaf('0x38')]=qs['limit'](_0x23bd35[_0xbcaf('0x30')][_0xbcaf('0x38')]);_0x267058[_0xbcaf('0x1c')]=qs[_0xbcaf('0x1c')](_0x23bd35[_0xbcaf('0x30')][_0xbcaf('0x1c')]);}_0x267058[_0xbcaf('0x39')]=qs[_0xbcaf('0x3a')](_0x23bd35[_0xbcaf('0x30')]['sort']);_0x267058[_0xbcaf('0x3b')]=qs[_0xbcaf('0x32')](_[_0xbcaf('0x3c')](_0x23bd35[_0xbcaf('0x30')],_0x50a375[_0xbcaf('0x32')]),_0x5ed0a5);if(_0x23bd35[_0xbcaf('0x30')]['filter']){_0x267058['where']=_['merge'](_0x267058['where'],{'$or':_['map'](_0x5ed0a5,function(_0x5116f8){if(_0x5116f8['type']!==_0xbcaf('0x3d')){var _0x4d6931={};_0x4d6931[_0x5116f8[_0xbcaf('0x28')]]={'$like':'%'+_0x23bd35[_0xbcaf('0x30')]['filter']+'%'};return _0x4d6931;}})});}_0x267058=_[_0xbcaf('0x3e')]({},_0x267058,_0x23bd35[_0xbcaf('0x3f')]);var _0x239e15={'where':_0x267058[_0xbcaf('0x3b')]};return db[_0xbcaf('0x40')][_0xbcaf('0x1e')](_0x239e15)['then'](function(_0x3eeae5){_0x4908b0['count']=_0x3eeae5;if(_0x23bd35['query']['includeAll']){_0x267058[_0xbcaf('0x41')]=[{'all':!![]}];}return db[_0xbcaf('0x40')][_0xbcaf('0x42')](_0x267058);})[_0xbcaf('0x25')](function(_0x2b7b0b){_0x4908b0[_0xbcaf('0x43')]=_0x2b7b0b;return _0x4908b0;})['then'](respondWithFilteredResult(_0x992a97,_0x267058))[_0xbcaf('0x44')](handleError(_0x992a97,null));};exports[_0xbcaf('0x45')]=function(_0x56ab60,_0x26c243){var _0x5a1405={'raw':!![],'where':{'id':_0x56ab60[_0xbcaf('0x46')]['id']}},_0x2608bb={};_0x2608bb[_0xbcaf('0x2f')]=_[_0xbcaf('0x31')](db['AnalyticTreeReport']['rawAttributes']);_0x2608bb[_0xbcaf('0x30')]=_[_0xbcaf('0x31')](_0x56ab60[_0xbcaf('0x30')]);_0x2608bb[_0xbcaf('0x32')]=_[_0xbcaf('0x33')](_0x2608bb[_0xbcaf('0x2f')],_0x2608bb[_0xbcaf('0x30')]);_0x5a1405[_0xbcaf('0x34')]=_[_0xbcaf('0x33')](_0x2608bb[_0xbcaf('0x2f')],qs['fields'](_0x56ab60['query'][_0xbcaf('0x35')]));_0x5a1405[_0xbcaf('0x34')]=_0x5a1405[_0xbcaf('0x34')][_0xbcaf('0x36')]?_0x5a1405[_0xbcaf('0x34')]:_0x2608bb[_0xbcaf('0x2f')];if(_0x56ab60[_0xbcaf('0x30')]['includeAll']){_0x5a1405[_0xbcaf('0x41')]=[{'all':!![]}];}_0x5a1405=_['merge']({},_0x5a1405,_0x56ab60[_0xbcaf('0x3f')]);return db['AnalyticTreeReport']['find'](_0x5a1405)[_0xbcaf('0x25')](handleEntityNotFound(_0x26c243,null))[_0xbcaf('0x25')](respondWithResult(_0x26c243,null))[_0xbcaf('0x44')](handleError(_0x26c243,null));};exports['create']=function(_0x142d48,_0x35fad7){return db[_0xbcaf('0x40')][_0xbcaf('0x47')](_0x142d48['body'],{})['then'](respondWithResult(_0x35fad7,0xc9))[_0xbcaf('0x44')](handleError(_0x35fad7,null));};exports[_0xbcaf('0x23')]=function(_0x4132f8,_0x3708c3){if(_0x4132f8[_0xbcaf('0x48')]['id']){delete _0x4132f8['body']['id'];}return db[_0xbcaf('0x40')]['find']({'where':{'id':_0x4132f8['params']['id']}})['then'](handleEntityNotFound(_0x3708c3,null))['then'](saveUpdates(_0x4132f8[_0xbcaf('0x48')],null))['then'](respondWithResult(_0x3708c3,null))['catch'](handleError(_0x3708c3,null));};exports[_0xbcaf('0x24')]=function(_0x1d445c,_0x4bbb3c){return db[_0xbcaf('0x40')]['find']({'where':{'id':_0x1d445c[_0xbcaf('0x46')]['id']}})[_0xbcaf('0x25')](handleEntityNotFound(_0x4bbb3c,null))[_0xbcaf('0x25')](removeEntity(_0x4bbb3c,null))[_0xbcaf('0x44')](handleError(_0x4bbb3c,null));};
\ No newline at end of file
+var _0x024c=['crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','error','name','map','AnalyticTreeReport','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','show','params','keys','catch','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel'];(function(_0x3198fd,_0x3729d8){var _0x2dd0b=function(_0x94b525){while(--_0x94b525){_0x3198fd['push'](_0x3198fd['shift']());}};_0x2dd0b(++_0x3729d8);}(_0x024c,0x113));var _0xc024=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x024c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc024('0x0'));var rimraf=require(_0xc024('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc024('0x2'));var rp=require(_0xc024('0x3'));var moment=require(_0xc024('0x4'));var BPromise=require(_0xc024('0x5'));var Mustache=require(_0xc024('0x6'));var util=require(_0xc024('0x7'));var path=require(_0xc024('0x8'));var sox=require(_0xc024('0x9'));var csv=require(_0xc024('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc024('0xb'));var squel=require(_0xc024('0xc'));var crypto=require(_0xc024('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc024('0xe'));var toCsv=require(_0xc024('0xa'));var querystring=require(_0xc024('0xf'));var Papa=require(_0xc024('0x10'));var Redis=require(_0xc024('0x11'));var authService=require(_0xc024('0x12'));var qs=require(_0xc024('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc024('0x14'))(_0xc024('0x15'));var utils=require(_0xc024('0x16'));var config=require(_0xc024('0x17'));var licenseUtil=require(_0xc024('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x217646,_0x32e2af){_0x32e2af=_0x32e2af||0xcc;return function(_0x544a89){if(_0x544a89){return _0x217646[_0xc024('0x19')](_0x32e2af);}return _0x217646[_0xc024('0x1a')](_0x32e2af)[_0xc024('0x1b')]();};}function respondWithResult(_0x4a20a5,_0x2dcce1){_0x2dcce1=_0x2dcce1||0xc8;return function(_0x48086b){if(_0x48086b){return _0x4a20a5[_0xc024('0x1a')](_0x2dcce1)[_0xc024('0x1c')](_0x48086b);}};}function respondWithFilteredResult(_0x10fb89,_0x379dc3){return function(_0xf95cf){if(_0xf95cf){var _0x40ca26=typeof _0x379dc3[_0xc024('0x1d')]===_0xc024('0x1e')&&typeof _0x379dc3[_0xc024('0x1f')]===_0xc024('0x1e');var _0x50506a=_0xf95cf['count'];var _0x79a9c8=_0x40ca26?0x0:_0x379dc3[_0xc024('0x1d')];var _0x47b396=_0x40ca26?_0xf95cf[_0xc024('0x20')]:_0x379dc3[_0xc024('0x1d')]+_0x379dc3[_0xc024('0x1f')];var _0xf3d1ed;if(_0x47b396>=_0x50506a){_0x47b396=_0x50506a;_0xf3d1ed=0xc8;}else{_0xf3d1ed=0xce;}_0x10fb89['status'](_0xf3d1ed);return _0x10fb89[_0xc024('0x21')](_0xc024('0x22'),_0x79a9c8+'-'+_0x47b396+'/'+_0x50506a)[_0xc024('0x1c')](_0xf95cf);}return null;};}function patchUpdates(_0x1e9a78){return function(_0xa49142){try{jsonpatch['apply'](_0xa49142,_0x1e9a78,!![]);}catch(_0x546396){return BPromise['reject'](_0x546396);}return _0xa49142[_0xc024('0x23')]();};}function saveUpdates(_0x469237,_0x33b953){return function(_0x4d1a1c){if(_0x4d1a1c){return _0x4d1a1c[_0xc024('0x24')](_0x469237)['then'](function(_0x4c1931){return _0x4c1931;});}return null;};}function removeEntity(_0x3f6f81,_0x2c11e5){return function(_0x557b7f){if(_0x557b7f){return _0x557b7f[_0xc024('0x25')]()[_0xc024('0x26')](function(){_0x3f6f81[_0xc024('0x1a')](0xcc)[_0xc024('0x1b')]();});}};}function handleEntityNotFound(_0x513bc1,_0x18db9b){return function(_0x52f500){if(!_0x52f500){_0x513bc1[_0xc024('0x19')](0x194);}return _0x52f500;};}function handleError(_0x2c2888,_0x3df63d){_0x3df63d=_0x3df63d||0x1f4;return function(_0x118624){logger[_0xc024('0x27')](_0x118624['stack']);if(_0x118624[_0xc024('0x28')]){delete _0x118624[_0xc024('0x28')];}_0x2c2888[_0xc024('0x1a')](_0x3df63d)['send'](_0x118624);};}exports['index']=function(_0xfb4c64,_0x106748){var _0x4c5e38={},_0x31821c={},_0x519d4d={'count':0x0,'rows':[]};var _0x36c2a4=_[_0xc024('0x29')](db[_0xc024('0x2a')]['rawAttributes'],function(_0x19c866){return{'name':_0x19c866[_0xc024('0x2b')],'type':_0x19c866['type'][_0xc024('0x2c')]};});_0x31821c[_0xc024('0x2d')]=_[_0xc024('0x29')](_0x36c2a4,_0xc024('0x28'));_0x31821c['query']=_['keys'](_0xfb4c64[_0xc024('0x2e')]);_0x31821c[_0xc024('0x2f')]=_[_0xc024('0x30')](_0x31821c[_0xc024('0x2d')],_0x31821c[_0xc024('0x2e')]);_0x4c5e38[_0xc024('0x31')]=_['intersection'](_0x31821c[_0xc024('0x2d')],qs[_0xc024('0x32')](_0xfb4c64[_0xc024('0x2e')]['fields']));_0x4c5e38[_0xc024('0x31')]=_0x4c5e38[_0xc024('0x31')][_0xc024('0x33')]?_0x4c5e38['attributes']:_0x31821c[_0xc024('0x2d')];if(!_0xfb4c64[_0xc024('0x2e')][_0xc024('0x34')](_0xc024('0x35'))){_0x4c5e38['limit']=qs['limit'](_0xfb4c64['query'][_0xc024('0x1f')]);_0x4c5e38[_0xc024('0x1d')]=qs[_0xc024('0x1d')](_0xfb4c64[_0xc024('0x2e')]['offset']);}_0x4c5e38['order']=qs[_0xc024('0x36')](_0xfb4c64[_0xc024('0x2e')]['sort']);_0x4c5e38[_0xc024('0x37')]=qs[_0xc024('0x2f')](_[_0xc024('0x38')](_0xfb4c64['query'],_0x31821c[_0xc024('0x2f')]),_0x36c2a4);if(_0xfb4c64[_0xc024('0x2e')][_0xc024('0x39')]){_0x4c5e38[_0xc024('0x37')]=_['merge'](_0x4c5e38[_0xc024('0x37')],{'$or':_[_0xc024('0x29')](_0x36c2a4,function(_0x5d372e){if(_0x5d372e[_0xc024('0x3a')]!==_0xc024('0x3b')){var _0x55fb4c={};_0x55fb4c[_0x5d372e[_0xc024('0x28')]]={'$like':'%'+_0xfb4c64['query'][_0xc024('0x39')]+'%'};return _0x55fb4c;}})});}_0x4c5e38=_[_0xc024('0x3c')]({},_0x4c5e38,_0xfb4c64[_0xc024('0x3d')]);var _0x1ac9b5={'where':_0x4c5e38['where']};return db[_0xc024('0x2a')][_0xc024('0x20')](_0x1ac9b5)['then'](function(_0x192055){_0x519d4d['count']=_0x192055;if(_0xfb4c64[_0xc024('0x2e')][_0xc024('0x3e')]){_0x4c5e38[_0xc024('0x3f')]=[{'all':!![]}];}return db[_0xc024('0x2a')][_0xc024('0x40')](_0x4c5e38);})[_0xc024('0x26')](function(_0x1601e8){_0x519d4d['rows']=_0x1601e8;return _0x519d4d;})['then'](respondWithFilteredResult(_0x106748,_0x4c5e38))['catch'](handleError(_0x106748,null));};exports[_0xc024('0x41')]=function(_0x4335ac,_0x3cc1dd){var _0x57fbc8={'raw':!![],'where':{'id':_0x4335ac[_0xc024('0x42')]['id']}},_0x45842e={};_0x45842e[_0xc024('0x2d')]=_['keys'](db[_0xc024('0x2a')]['rawAttributes']);_0x45842e[_0xc024('0x2e')]=_[_0xc024('0x43')](_0x4335ac[_0xc024('0x2e')]);_0x45842e[_0xc024('0x2f')]=_[_0xc024('0x30')](_0x45842e[_0xc024('0x2d')],_0x45842e[_0xc024('0x2e')]);_0x57fbc8[_0xc024('0x31')]=_[_0xc024('0x30')](_0x45842e[_0xc024('0x2d')],qs['fields'](_0x4335ac['query'][_0xc024('0x32')]));_0x57fbc8[_0xc024('0x31')]=_0x57fbc8[_0xc024('0x31')][_0xc024('0x33')]?_0x57fbc8['attributes']:_0x45842e[_0xc024('0x2d')];if(_0x4335ac[_0xc024('0x2e')]['includeAll']){_0x57fbc8['include']=[{'all':!![]}];}_0x57fbc8=_[_0xc024('0x3c')]({},_0x57fbc8,_0x4335ac[_0xc024('0x3d')]);return db[_0xc024('0x2a')]['find'](_0x57fbc8)[_0xc024('0x26')](handleEntityNotFound(_0x3cc1dd,null))['then'](respondWithResult(_0x3cc1dd,null))[_0xc024('0x44')](handleError(_0x3cc1dd,null));};exports[_0xc024('0x45')]=function(_0x36d94e,_0x526343){return db[_0xc024('0x2a')][_0xc024('0x45')](_0x36d94e[_0xc024('0x46')],{})[_0xc024('0x26')](respondWithResult(_0x526343,0xc9))[_0xc024('0x44')](handleError(_0x526343,null));};exports[_0xc024('0x24')]=function(_0x112736,_0x32bf93){if(_0x112736[_0xc024('0x46')]['id']){delete _0x112736['body']['id'];}return db[_0xc024('0x2a')][_0xc024('0x47')]({'where':{'id':_0x112736[_0xc024('0x42')]['id']}})['then'](handleEntityNotFound(_0x32bf93,null))[_0xc024('0x26')](saveUpdates(_0x112736['body'],null))[_0xc024('0x26')](respondWithResult(_0x32bf93,null))[_0xc024('0x44')](handleError(_0x32bf93,null));};exports['destroy']=function(_0x3f2f7b,_0x463cb1){return db[_0xc024('0x2a')][_0xc024('0x47')]({'where':{'id':_0x3f2f7b[_0xc024('0x42')]['id']}})['then'](handleEntityNotFound(_0x463cb1,null))[_0xc024('0x26')](removeEntity(_0x463cb1,null))['catch'](handleError(_0x463cb1,null));};
\ No newline at end of file
index 43f50a6..81dc0aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd6df=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','AnalyticTreeReport','analytics_report_trees','lodash','util'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd6df,0xb4));var _0xfd6d=function(_0x23a3cd,_0x6e2762){_0x23a3cd=_0x23a3cd-0x0;var _0x1ec75b=_0xd6df[_0x23a3cd];return _0x1ec75b;};'use strict';var _=require(_0xfd6d('0x0'));var util=require(_0xfd6d('0x1'));var logger=require(_0xfd6d('0x2'))(_0xfd6d('0x3'));var moment=require(_0xfd6d('0x4'));var BPromise=require(_0xfd6d('0x5'));var rp=require(_0xfd6d('0x6'));var fs=require('fs');var path=require(_0xfd6d('0x7'));var rimraf=require(_0xfd6d('0x8'));var config=require(_0xfd6d('0x9'));var attributes=require('./analyticTreeReport.attributes');module[_0xfd6d('0xa')]=function(_0x39e558,_0x5f51da){return _0x39e558['define'](_0xfd6d('0xb'),attributes,{'tableName':_0xfd6d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3af5=['define','AnalyticTreeReport','analytics_report_trees','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0x5ec370,_0x5a2a10){var _0x1bb5bc=function(_0xcc785c){while(--_0xcc785c){_0x5ec370['push'](_0x5ec370['shift']());}};_0x1bb5bc(++_0x5a2a10);}(_0x3af5,0x129));var _0x53af=function(_0x5e9817,_0xa29439){_0x5e9817=_0x5e9817-0x0;var _0x25b437=_0x3af5[_0x5e9817];return _0x25b437;};'use strict';var _=require(_0x53af('0x0'));var util=require(_0x53af('0x1'));var logger=require('../../config/logger')(_0x53af('0x2'));var moment=require(_0x53af('0x3'));var BPromise=require(_0x53af('0x4'));var rp=require(_0x53af('0x5'));var fs=require('fs');var path=require(_0x53af('0x6'));var rimraf=require(_0x53af('0x7'));var config=require(_0x53af('0x8'));var attributes=require(_0x53af('0x9'));module[_0x53af('0xa')]=function(_0x1aed3e,_0x249328){return _0x1aed3e[_0x53af('0xb')](_0x53af('0xc'),attributes,{'tableName':_0x53af('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b95c227..24f0f36 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(_0x1e88f9,_0xb92e06){var _0x29f1a0=function(_0x4d79d1){while(--_0x4d79d1){_0x1e88f9['push'](_0x1e88f9['shift']());}};_0x29f1a0(++_0xb92e06);}(_0x5f2f,0x73));var _0xf5f2=function(_0x7e89ab,_0x1f8dc3){_0x7e89ab=_0x7e89ab-0x0;var _0x234184=_0x5f2f[_0x7e89ab];return _0x234184;};'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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x3ca879,_0x2e88ee){var _0x1f0bae=function(_0x114b52){while(--_0x114b52){_0x3ca879['push'](_0x3ca879['shift']());}};_0x1f0bae(++_0x2e88ee);}(_0x2ef3,0xba));var _0x32ef=function(_0x2eaa59,_0x298b57){_0x2eaa59=_0x2eaa59-0x0;var _0x393824=_0x2ef3[_0x2eaa59];return _0x393824;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
index be4d866..d072265 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6931=['express','Router','fs-extra','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','path'];(function(_0x4bd7c9,_0xc4fed8){var _0x593124=function(_0x13e2b6){while(--_0x13e2b6){_0x4bd7c9['push'](_0x4bd7c9['shift']());}};_0x593124(++_0xc4fed8);}(_0x6931,0x19c));var _0x1693=function(_0x29807f,_0xe0404){_0x29807f=_0x29807f-0x0;var _0x81aff2=_0x6931[_0x29807f];return _0x81aff2;};'use strict';var multer=require(_0x1693('0x0'));var util=require('util');var path=require(_0x1693('0x1'));var timeout=require('connect-timeout');var express=require(_0x1693('0x2'));var router=express[_0x1693('0x3')]();var fs_extra=require(_0x1693('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1693('0x5'));router[_0x1693('0x6')]('/',auth[_0x1693('0x7')](),controller[_0x1693('0x8')]);router[_0x1693('0x6')](_0x1693('0x9'),auth[_0x1693('0x7')](),controller[_0x1693('0xa')]);router[_0x1693('0xb')]('/',auth[_0x1693('0x7')](),controller[_0x1693('0xc')]);router[_0x1693('0xd')](_0x1693('0x9'),auth[_0x1693('0x7')](),controller[_0x1693('0xe')]);router[_0x1693('0xf')](_0x1693('0x9'),auth[_0x1693('0x7')](),controller[_0x1693('0x10')]);module[_0x1693('0x11')]=router;
\ No newline at end of file
+var _0x844d=['index','/:id','create','put','update','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated'];(function(_0x9cf391,_0x3b631f){var _0xb7069f=function(_0x36a123){while(--_0x36a123){_0x9cf391['push'](_0x9cf391['shift']());}};_0xb7069f(++_0x3b631f);}(_0x844d,0x117));var _0xd844=function(_0x26bcec,_0xe13f50){_0x26bcec=_0x26bcec-0x0;var _0x1049dc=_0x844d[_0x26bcec];return _0x1049dc;};'use strict';var multer=require('multer');var util=require(_0xd844('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd844('0x1'));var router=express[_0xd844('0x2')]();var fs_extra=require(_0xd844('0x3'));var auth=require(_0xd844('0x4'));var interaction=require(_0xd844('0x5'));var config=require('../../config/environment');var controller=require(_0xd844('0x6'));router[_0xd844('0x7')]('/',auth[_0xd844('0x8')](),controller[_0xd844('0x9')]);router[_0xd844('0x7')](_0xd844('0xa'),auth[_0xd844('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xd844('0xb')]);router[_0xd844('0xc')](_0xd844('0xa'),auth[_0xd844('0x8')](),controller[_0xd844('0xd')]);router['delete']('/:id',auth[_0xd844('0x8')](),controller[_0xd844('0xe')]);module[_0xd844('0xf')]=router;
\ No newline at end of file
index 5c3dea1..b65700b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37dc=['sequelize','exports','STRING'];(function(_0x3beaa7,_0x26e2d7){var _0x4e87e2=function(_0x48a569){while(--_0x48a569){_0x3beaa7['push'](_0x3beaa7['shift']());}};_0x4e87e2(++_0x26e2d7);}(_0x37dc,0x1e9));var _0xc37d=function(_0x5e086f,_0x4f1821){_0x5e086f=_0x5e086f-0x0;var _0x12dba8=_0x37dc[_0x5e086f];return _0x12dba8;};'use strict';var Sequelize=require(_0xc37d('0x0'));module[_0xc37d('0x1')]={'name':{'type':Sequelize[_0xc37d('0x2')]},'basename':{'type':Sequelize[_0xc37d('0x2')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x98a7=['exports','STRING','sequelize'];(function(_0x4e4933,_0x32cd71){var _0x2890a2=function(_0x384bff){while(--_0x384bff){_0x4e4933['push'](_0x4e4933['shift']());}};_0x2890a2(++_0x32cd71);}(_0x98a7,0x9e));var _0x798a=function(_0x50dce5,_0x5e3d03){_0x50dce5=_0x50dce5-0x0;var _0x3783ab=_0x98a7[_0x50dce5];return _0x3783ab;};'use strict';var Sequelize=require(_0x798a('0x0'));module[_0x798a('0x1')]={'name':{'type':Sequelize[_0x798a('0x2')]},'basename':{'type':Sequelize[_0x798a('0x2')]},'type':{'type':Sequelize[_0x798a('0x2')]}};
\ No newline at end of file
index dd776e3..ab1084d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x658e=['reject','save','update','then','destroy','end','error','stack','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','filters','fields','attributes','nolimit','order','sort','where','pick','filter','VIRTUAL','name','options','includeAll','include','rows','catch','show','params','keys','intersection','length','find','clone','merge','get','body','omit','createdAt','create','file','originalname','mimetype','findOne','ChatOfflineMessageId','root','server/files/attachments/','join','offline-chat/','basename','download','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','apply'];(function(_0x2c42e1,_0x5141c7){var _0x34df52=function(_0x35a840){while(--_0x35a840){_0x2c42e1['push'](_0x2c42e1['shift']());}};_0x34df52(++_0x5141c7);}(_0x658e,0x19a));var _0xe658=function(_0x5877ae,_0x358cda){_0x5877ae=_0x5877ae-0x0;var _0x5ca64e=_0x658e[_0x5877ae];return _0x5ca64e;};'use strict';var emlformat=require(_0xe658('0x0'));var rimraf=require(_0xe658('0x1'));var zipdir=require(_0xe658('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe658('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe658('0x4'));var util=require('util');var path=require(_0xe658('0x5'));var sox=require(_0xe658('0x6'));var csv=require('to-csv');var ejs=require(_0xe658('0x7'));var fs=require('fs');var fs_extra=require(_0xe658('0x8'));var _=require('lodash');var squel=require(_0xe658('0x9'));var crypto=require(_0xe658('0xa'));var jsforce=require(_0xe658('0xb'));var deskjs=require(_0xe658('0xc'));var toCsv=require(_0xe658('0xd'));var querystring=require(_0xe658('0xe'));var Papa=require('papaparse');var Redis=require(_0xe658('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe658('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe658('0x11'));var logger=require(_0xe658('0x12'))('api');var utils=require(_0xe658('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xe658('0x14'));var db=require(_0xe658('0x15'))['db'];function respondWithStatusCode(_0x3b0571,_0x5f5956){_0x5f5956=_0x5f5956||0xcc;return function(_0x1de6b0){if(_0x1de6b0){return _0x3b0571[_0xe658('0x16')](_0x5f5956);}return _0x3b0571['status'](_0x5f5956)['end']();};}function respondWithResult(_0x40d156,_0x4c174e){_0x4c174e=_0x4c174e||0xc8;return function(_0x1ca83c){if(_0x1ca83c){return _0x40d156['status'](_0x4c174e)[_0xe658('0x17')](_0x1ca83c);}};}function respondWithFilteredResult(_0x477658,_0x26d9d9){return function(_0xcb07c3){if(_0xcb07c3){var _0x4e7a01=typeof _0x26d9d9[_0xe658('0x18')]===_0xe658('0x19')&&typeof _0x26d9d9[_0xe658('0x1a')]===_0xe658('0x19');var _0x3d0d18=_0xcb07c3[_0xe658('0x1b')];var _0x425982=_0x4e7a01?0x0:_0x26d9d9[_0xe658('0x18')];var _0x55c698=_0x4e7a01?_0xcb07c3['count']:_0x26d9d9[_0xe658('0x18')]+_0x26d9d9['limit'];var _0x445c66;if(_0x55c698>=_0x3d0d18){_0x55c698=_0x3d0d18;_0x445c66=0xc8;}else{_0x445c66=0xce;}_0x477658[_0xe658('0x1c')](_0x445c66);return _0x477658['set']('Content-Range',_0x425982+'-'+_0x55c698+'/'+_0x3d0d18)[_0xe658('0x17')](_0xcb07c3);}return null;};}function patchUpdates(_0x1584e8){return function(_0x29181f){try{jsonpatch[_0xe658('0x1d')](_0x29181f,_0x1584e8,!![]);}catch(_0x27d26c){return BPromise[_0xe658('0x1e')](_0x27d26c);}return _0x29181f[_0xe658('0x1f')]();};}function saveUpdates(_0x5b4669,_0x2598de){return function(_0x1bac2c){if(_0x1bac2c){return _0x1bac2c[_0xe658('0x20')](_0x5b4669)[_0xe658('0x21')](function(_0x3694f3){return _0x3694f3;});}return null;};}function removeEntity(_0x28981e,_0x3fdb4e){return function(_0x3b1d90){if(_0x3b1d90){return _0x3b1d90[_0xe658('0x22')]()[_0xe658('0x21')](function(){_0x28981e[_0xe658('0x1c')](0xcc)[_0xe658('0x23')]();});}};}function handleEntityNotFound(_0x256578,_0x1ffd22){return function(_0x498b64){if(!_0x498b64){_0x256578['sendStatus'](0x194);}return _0x498b64;};}function handleError(_0xa4660a,_0x2aeae1){_0x2aeae1=_0x2aeae1||0x1f4;return function(_0x58231e){logger[_0xe658('0x24')](_0x58231e[_0xe658('0x25')]);if(_0x58231e['name']){delete _0x58231e['name'];}_0xa4660a[_0xe658('0x1c')](_0x2aeae1)[_0xe658('0x26')](_0x58231e);};}exports[_0xe658('0x27')]=function(_0x1bbd94,_0x318569){var _0x2e7467={},_0x853063={},_0x550926={'count':0x0,'rows':[]};var _0x274a5c=_[_0xe658('0x28')](db[_0xe658('0x29')][_0xe658('0x2a')],function(_0x594cbd){return{'name':_0x594cbd[_0xe658('0x2b')],'type':_0x594cbd[_0xe658('0x2c')][_0xe658('0x2d')]};});_0x853063[_0xe658('0x2e')]=_['map'](_0x274a5c,'name');_0x853063[_0xe658('0x2f')]=_['keys'](_0x1bbd94[_0xe658('0x2f')]);_0x853063[_0xe658('0x30')]=_['intersection'](_0x853063['model'],_0x853063[_0xe658('0x2f')]);_0x2e7467['attributes']=_['intersection'](_0x853063[_0xe658('0x2e')],qs[_0xe658('0x31')](_0x1bbd94[_0xe658('0x2f')][_0xe658('0x31')]));_0x2e7467['attributes']=_0x2e7467[_0xe658('0x32')]['length']?_0x2e7467['attributes']:_0x853063[_0xe658('0x2e')];if(!_0x1bbd94[_0xe658('0x2f')]['hasOwnProperty'](_0xe658('0x33'))){_0x2e7467['limit']=qs[_0xe658('0x1a')](_0x1bbd94[_0xe658('0x2f')][_0xe658('0x1a')]);_0x2e7467['offset']=qs['offset'](_0x1bbd94[_0xe658('0x2f')][_0xe658('0x18')]);}_0x2e7467[_0xe658('0x34')]=qs[_0xe658('0x35')](_0x1bbd94['query']['sort']);_0x2e7467[_0xe658('0x36')]=qs[_0xe658('0x30')](_[_0xe658('0x37')](_0x1bbd94[_0xe658('0x2f')],_0x853063[_0xe658('0x30')]),_0x274a5c);if(_0x1bbd94['query'][_0xe658('0x38')]){_0x2e7467[_0xe658('0x36')]=_['merge'](_0x2e7467[_0xe658('0x36')],{'$or':_['map'](_0x274a5c,function(_0x2b798e){if(_0x2b798e[_0xe658('0x2c')]!==_0xe658('0x39')){var _0x3ff478={};_0x3ff478[_0x2b798e[_0xe658('0x3a')]]={'$like':'%'+_0x1bbd94['query']['filter']+'%'};return _0x3ff478;}})});}_0x2e7467=_['merge']({},_0x2e7467,_0x1bbd94[_0xe658('0x3b')]);var _0x414825={'where':_0x2e7467['where']};return db['Attachment'][_0xe658('0x1b')](_0x414825)[_0xe658('0x21')](function(_0x1199fc){_0x550926['count']=_0x1199fc;if(_0x1bbd94[_0xe658('0x2f')][_0xe658('0x3c')]){_0x2e7467[_0xe658('0x3d')]=[{'all':!![]}];}return db[_0xe658('0x29')]['findAll'](_0x2e7467);})[_0xe658('0x21')](function(_0x45e11c){_0x550926[_0xe658('0x3e')]=_0x45e11c;return _0x550926;})[_0xe658('0x21')](respondWithFilteredResult(_0x318569,_0x2e7467))[_0xe658('0x3f')](handleError(_0x318569,null));};exports[_0xe658('0x40')]=function(_0x182c8b,_0x1eed15){var _0x3f0b52={'raw':!![],'where':{'id':_0x182c8b[_0xe658('0x41')]['id']}},_0x41e3ac={};_0x41e3ac['model']=_[_0xe658('0x42')](db[_0xe658('0x29')][_0xe658('0x2a')]);_0x41e3ac[_0xe658('0x2f')]=_['keys'](_0x182c8b[_0xe658('0x2f')]);_0x41e3ac[_0xe658('0x30')]=_['intersection'](_0x41e3ac[_0xe658('0x2e')],_0x41e3ac['query']);_0x3f0b52['attributes']=_[_0xe658('0x43')](_0x41e3ac[_0xe658('0x2e')],qs['fields'](_0x182c8b[_0xe658('0x2f')]['fields']));_0x3f0b52[_0xe658('0x32')]=_0x3f0b52['attributes'][_0xe658('0x44')]?_0x3f0b52['attributes']:_0x41e3ac[_0xe658('0x2e')];if(_0x182c8b[_0xe658('0x2f')][_0xe658('0x3c')]){_0x3f0b52[_0xe658('0x3d')]=[{'all':!![]}];}_0x3f0b52=_['merge']({},_0x3f0b52,_0x182c8b[_0xe658('0x3b')]);return db[_0xe658('0x29')][_0xe658('0x45')](_0x3f0b52)['then'](handleEntityNotFound(_0x1eed15,null))[_0xe658('0x21')](respondWithResult(_0x1eed15,null))[_0xe658('0x3f')](handleError(_0x1eed15,null));};exports[_0xe658('0x46')]=function(_0x4919cc,_0x1a102e){var _0x539af9={'where':{'id':_0x4919cc[_0xe658('0x41')]['id']}},_0x1a6b76={};_0x1a6b76['model']=_[_0xe658('0x42')](db[_0xe658('0x29')][_0xe658('0x2a')]);_0x539af9[_0xe658('0x32')]=_[_0xe658('0x43')](_0x1a6b76[_0xe658('0x2e')],qs[_0xe658('0x31')](_0x4919cc[_0xe658('0x2f')][_0xe658('0x31')]));_0x539af9['attributes']=_0x539af9[_0xe658('0x32')][_0xe658('0x44')]?_0x539af9[_0xe658('0x32')]:_0x1a6b76[_0xe658('0x2e')];if(_0x4919cc[_0xe658('0x2f')][_0xe658('0x3c')]){_0x539af9['include']=[{'all':!![]}];}_0x539af9=_[_0xe658('0x47')]({},_0x539af9,_0x4919cc[_0xe658('0x3b')]);return db[_0xe658('0x29')][_0xe658('0x45')](_0x539af9)[_0xe658('0x21')](handleEntityNotFound(_0x1a102e,null))[_0xe658('0x21')](function(_0x128a91){if(_0x128a91){var _0x396135=_0x128a91[_0xe658('0x48')]({'plain':!![]});_0x396135=qs['omit'](_0x396135,['id','createdAt','updatedAt']);_0x4919cc[_0xe658('0x49')]=_[_0xe658('0x4a')](_0x4919cc[_0xe658('0x49')],['id',_0xe658('0x4b'),'updatedAt']);return db[_0xe658('0x29')][_0xe658('0x4c')](_[_0xe658('0x47')](_0x396135,_0x4919cc[_0xe658('0x49')]),{'include':_0x4919cc[_0xe658('0x2f')][_0xe658('0x3c')]?[{'all':!![]}]:undefined});}})[_0xe658('0x21')](respondWithResult(_0x1a102e,0xc9))['catch'](handleError(_0x1a102e,null));};exports[_0xe658('0x20')]=function(_0x35a938,_0x1ad2a7){if(_0x35a938[_0xe658('0x49')]['id']){delete _0x35a938[_0xe658('0x49')]['id'];}return db['Attachment'][_0xe658('0x45')]({'where':{'id':_0x35a938[_0xe658('0x41')]['id']}})[_0xe658('0x21')](handleEntityNotFound(_0x1ad2a7,null))['then'](saveUpdates(_0x35a938[_0xe658('0x49')],null))[_0xe658('0x21')](respondWithResult(_0x1ad2a7,null))[_0xe658('0x3f')](handleError(_0x1ad2a7,null));};exports[_0xe658('0x22')]=function(_0x4862e5,_0x114ebc){return db[_0xe658('0x29')][_0xe658('0x45')]({'where':{'id':_0x4862e5[_0xe658('0x41')]['id']}})[_0xe658('0x21')](handleEntityNotFound(_0x114ebc,null))[_0xe658('0x21')](removeEntity(_0x114ebc,null))[_0xe658('0x3f')](handleError(_0x114ebc,null));};exports['create']=function(_0x3b472b,_0x2c44ca,_0x449365){_0x3b472b[_0xe658('0x49')]['name']=_0x3b472b[_0xe658('0x4d')][_0xe658('0x4e')];_0x3b472b['body']['basename']=_0x3b472b[_0xe658('0x4d')]['filename'];_0x3b472b[_0xe658('0x49')][_0xe658('0x2c')]=_0x3b472b[_0xe658('0x4d')][_0xe658('0x4f')];return db['Attachment'][_0xe658('0x4c')](_0x3b472b[_0xe658('0x49')])[_0xe658('0x21')](respondWithResult(_0x2c44ca,0xc9))[_0xe658('0x3f')](handleError(_0x2c44ca,null));};exports['download']=function(_0x1ea1f4,_0x8cfe92,_0x50f997){return db[_0xe658('0x29')][_0xe658('0x50')]({'where':{'id':_0x1ea1f4[_0xe658('0x41')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x8cfe92,null))[_0xe658('0x21')](function(_0x59baab){if(_0x59baab){var _0x322613=_0x59baab[_0xe658('0x51')]!==null;var _0x145c81=path['join'](config[_0xe658('0x52')],_0xe658('0x53'));if(_0x322613){_0x145c81=path[_0xe658('0x54')](_0x145c81,_0xe658('0x55'));}var _0x18aa02=path['join'](_0x145c81,_0x59baab[_0xe658('0x56')]);return _0x8cfe92[_0xe658('0x57')](_0x18aa02);}})['catch'](handleError(_0x8cfe92,null));};
\ No newline at end of file
+var _0x3c23=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','Attachment','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','find','clone','get','omit','updatedAt','body','createdAt','create','originalname','file','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','eml-format','rimraf','fast-json-patch'];(function(_0x50b07f,_0x1dee5b){var _0x19b62c=function(_0x257bb3){while(--_0x257bb3){_0x50b07f['push'](_0x50b07f['shift']());}};_0x19b62c(++_0x1dee5b);}(_0x3c23,0xbf));var _0x33c2=function(_0x481471,_0x26356b){_0x481471=_0x481471-0x0;var _0x1e92e0=_0x3c23[_0x481471];return _0x1e92e0;};'use strict';var emlformat=require(_0x33c2('0x0'));var rimraf=require(_0x33c2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x33c2('0x2'));var rp=require('request-promise');var moment=require(_0x33c2('0x3'));var BPromise=require(_0x33c2('0x4'));var Mustache=require(_0x33c2('0x5'));var util=require(_0x33c2('0x6'));var path=require(_0x33c2('0x7'));var sox=require(_0x33c2('0x8'));var csv=require(_0x33c2('0x9'));var ejs=require(_0x33c2('0xa'));var fs=require('fs');var fs_extra=require(_0x33c2('0xb'));var _=require(_0x33c2('0xc'));var squel=require(_0x33c2('0xd'));var crypto=require(_0x33c2('0xe'));var jsforce=require(_0x33c2('0xf'));var deskjs=require(_0x33c2('0x10'));var toCsv=require('to-csv');var querystring=require(_0x33c2('0x11'));var Papa=require(_0x33c2('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x33c2('0x13'));var as=require(_0x33c2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x33c2('0x15'))(_0x33c2('0x16'));var utils=require(_0x33c2('0x17'));var config=require(_0x33c2('0x18'));var licenseUtil=require(_0x33c2('0x19'));var db=require(_0x33c2('0x1a'))['db'];function respondWithStatusCode(_0x21fab8,_0x80dd71){_0x80dd71=_0x80dd71||0xcc;return function(_0x2e5bb3){if(_0x2e5bb3){return _0x21fab8[_0x33c2('0x1b')](_0x80dd71);}return _0x21fab8[_0x33c2('0x1c')](_0x80dd71)[_0x33c2('0x1d')]();};}function respondWithResult(_0x26f194,_0xd160ca){_0xd160ca=_0xd160ca||0xc8;return function(_0xefb92f){if(_0xefb92f){return _0x26f194['status'](_0xd160ca)[_0x33c2('0x1e')](_0xefb92f);}};}function respondWithFilteredResult(_0x275dbb,_0x42def0){return function(_0x142147){if(_0x142147){var _0x5412a1=typeof _0x42def0[_0x33c2('0x1f')]==='undefined'&&typeof _0x42def0[_0x33c2('0x20')]==='undefined';var _0x490692=_0x142147[_0x33c2('0x21')];var _0x38ca01=_0x5412a1?0x0:_0x42def0[_0x33c2('0x1f')];var _0x83c846=_0x5412a1?_0x142147[_0x33c2('0x21')]:_0x42def0['offset']+_0x42def0['limit'];var _0x17310d;if(_0x83c846>=_0x490692){_0x83c846=_0x490692;_0x17310d=0xc8;}else{_0x17310d=0xce;}_0x275dbb[_0x33c2('0x1c')](_0x17310d);return _0x275dbb[_0x33c2('0x22')](_0x33c2('0x23'),_0x38ca01+'-'+_0x83c846+'/'+_0x490692)[_0x33c2('0x1e')](_0x142147);}return null;};}function patchUpdates(_0x2c3039){return function(_0x1606c8){try{jsonpatch[_0x33c2('0x24')](_0x1606c8,_0x2c3039,!![]);}catch(_0x55ffd5){return BPromise[_0x33c2('0x25')](_0x55ffd5);}return _0x1606c8[_0x33c2('0x26')]();};}function saveUpdates(_0x5ce085,_0x1f40a0){return function(_0x5e2aaa){if(_0x5e2aaa){return _0x5e2aaa[_0x33c2('0x27')](_0x5ce085)['then'](function(_0x13854c){return _0x13854c;});}return null;};}function removeEntity(_0x375740,_0x4401ba){return function(_0x361515){if(_0x361515){return _0x361515[_0x33c2('0x28')]()[_0x33c2('0x29')](function(){_0x375740[_0x33c2('0x1c')](0xcc)[_0x33c2('0x1d')]();});}};}function handleEntityNotFound(_0x268da0,_0x98f241){return function(_0x498af1){if(!_0x498af1){_0x268da0[_0x33c2('0x1b')](0x194);}return _0x498af1;};}function handleError(_0x1a8116,_0xca1eef){_0xca1eef=_0xca1eef||0x1f4;return function(_0x290579){logger[_0x33c2('0x2a')](_0x290579[_0x33c2('0x2b')]);if(_0x290579['name']){delete _0x290579[_0x33c2('0x2c')];}_0x1a8116['status'](_0xca1eef)[_0x33c2('0x2d')](_0x290579);};}exports[_0x33c2('0x2e')]=function(_0x416fb4,_0x47c483){var _0x487a65={},_0x3f3d2d={},_0x2945b2={'count':0x0,'rows':[]};var _0x2ad2da=_['map'](db[_0x33c2('0x2f')]['rawAttributes'],function(_0x4315c2){return{'name':_0x4315c2[_0x33c2('0x30')],'type':_0x4315c2['type'][_0x33c2('0x31')]};});_0x3f3d2d[_0x33c2('0x32')]=_[_0x33c2('0x33')](_0x2ad2da,_0x33c2('0x2c'));_0x3f3d2d[_0x33c2('0x34')]=_[_0x33c2('0x35')](_0x416fb4['query']);_0x3f3d2d[_0x33c2('0x36')]=_[_0x33c2('0x37')](_0x3f3d2d[_0x33c2('0x32')],_0x3f3d2d[_0x33c2('0x34')]);_0x487a65[_0x33c2('0x38')]=_[_0x33c2('0x37')](_0x3f3d2d[_0x33c2('0x32')],qs[_0x33c2('0x39')](_0x416fb4[_0x33c2('0x34')][_0x33c2('0x39')]));_0x487a65[_0x33c2('0x38')]=_0x487a65[_0x33c2('0x38')][_0x33c2('0x3a')]?_0x487a65['attributes']:_0x3f3d2d[_0x33c2('0x32')];if(!_0x416fb4[_0x33c2('0x34')][_0x33c2('0x3b')](_0x33c2('0x3c'))){_0x487a65[_0x33c2('0x20')]=qs[_0x33c2('0x20')](_0x416fb4[_0x33c2('0x34')][_0x33c2('0x20')]);_0x487a65[_0x33c2('0x1f')]=qs[_0x33c2('0x1f')](_0x416fb4['query'][_0x33c2('0x1f')]);}_0x487a65[_0x33c2('0x3d')]=qs[_0x33c2('0x3e')](_0x416fb4[_0x33c2('0x34')][_0x33c2('0x3e')]);_0x487a65[_0x33c2('0x3f')]=qs[_0x33c2('0x36')](_[_0x33c2('0x40')](_0x416fb4[_0x33c2('0x34')],_0x3f3d2d[_0x33c2('0x36')]),_0x2ad2da);if(_0x416fb4[_0x33c2('0x34')][_0x33c2('0x41')]){_0x487a65[_0x33c2('0x3f')]=_['merge'](_0x487a65['where'],{'$or':_[_0x33c2('0x33')](_0x2ad2da,function(_0x4c27a0){if(_0x4c27a0[_0x33c2('0x42')]!=='VIRTUAL'){var _0x18ee6b={};_0x18ee6b[_0x4c27a0[_0x33c2('0x2c')]]={'$like':'%'+_0x416fb4[_0x33c2('0x34')]['filter']+'%'};return _0x18ee6b;}})});}_0x487a65=_['merge']({},_0x487a65,_0x416fb4[_0x33c2('0x43')]);var _0x3a07d3={'where':_0x487a65['where']};return db['Attachment'][_0x33c2('0x21')](_0x3a07d3)[_0x33c2('0x29')](function(_0x155684){_0x2945b2['count']=_0x155684;if(_0x416fb4[_0x33c2('0x34')][_0x33c2('0x44')]){_0x487a65[_0x33c2('0x45')]=[{'all':!![]}];}return db[_0x33c2('0x2f')][_0x33c2('0x46')](_0x487a65);})['then'](function(_0x369b95){_0x2945b2[_0x33c2('0x47')]=_0x369b95;return _0x2945b2;})[_0x33c2('0x29')](respondWithFilteredResult(_0x47c483,_0x487a65))[_0x33c2('0x48')](handleError(_0x47c483,null));};exports[_0x33c2('0x49')]=function(_0x44c7df,_0x127b8f){var _0x224d57={'raw':!![],'where':{'id':_0x44c7df[_0x33c2('0x4a')]['id']}},_0x4e1afe={};_0x4e1afe[_0x33c2('0x32')]=_[_0x33c2('0x35')](db[_0x33c2('0x2f')][_0x33c2('0x4b')]);_0x4e1afe[_0x33c2('0x34')]=_[_0x33c2('0x35')](_0x44c7df[_0x33c2('0x34')]);_0x4e1afe['filters']=_[_0x33c2('0x37')](_0x4e1afe[_0x33c2('0x32')],_0x4e1afe['query']);_0x224d57[_0x33c2('0x38')]=_[_0x33c2('0x37')](_0x4e1afe['model'],qs[_0x33c2('0x39')](_0x44c7df[_0x33c2('0x34')][_0x33c2('0x39')]));_0x224d57[_0x33c2('0x38')]=_0x224d57[_0x33c2('0x38')][_0x33c2('0x3a')]?_0x224d57['attributes']:_0x4e1afe[_0x33c2('0x32')];if(_0x44c7df[_0x33c2('0x34')][_0x33c2('0x44')]){_0x224d57[_0x33c2('0x45')]=[{'all':!![]}];}_0x224d57=_[_0x33c2('0x4c')]({},_0x224d57,_0x44c7df[_0x33c2('0x43')]);return db['Attachment'][_0x33c2('0x4d')](_0x224d57)[_0x33c2('0x29')](handleEntityNotFound(_0x127b8f,null))['then'](respondWithResult(_0x127b8f,null))['catch'](handleError(_0x127b8f,null));};exports[_0x33c2('0x4e')]=function(_0xcccc89,_0x19a142){var _0x52efb8={'where':{'id':_0xcccc89[_0x33c2('0x4a')]['id']}},_0x5c818f={};_0x5c818f[_0x33c2('0x32')]=_[_0x33c2('0x35')](db[_0x33c2('0x2f')][_0x33c2('0x4b')]);_0x52efb8[_0x33c2('0x38')]=_[_0x33c2('0x37')](_0x5c818f[_0x33c2('0x32')],qs['fields'](_0xcccc89['query'][_0x33c2('0x39')]));_0x52efb8['attributes']=_0x52efb8['attributes']['length']?_0x52efb8['attributes']:_0x5c818f[_0x33c2('0x32')];if(_0xcccc89[_0x33c2('0x34')]['includeAll']){_0x52efb8[_0x33c2('0x45')]=[{'all':!![]}];}_0x52efb8=_[_0x33c2('0x4c')]({},_0x52efb8,_0xcccc89['options']);return db['Attachment'][_0x33c2('0x4d')](_0x52efb8)[_0x33c2('0x29')](handleEntityNotFound(_0x19a142,null))[_0x33c2('0x29')](function(_0x2ffd0f){if(_0x2ffd0f){var _0x2eb403=_0x2ffd0f[_0x33c2('0x4f')]({'plain':!![]});_0x2eb403=qs[_0x33c2('0x50')](_0x2eb403,['id','createdAt',_0x33c2('0x51')]);_0xcccc89['body']=_[_0x33c2('0x50')](_0xcccc89[_0x33c2('0x52')],['id',_0x33c2('0x53'),_0x33c2('0x51')]);return db[_0x33c2('0x2f')]['create'](_[_0x33c2('0x4c')](_0x2eb403,_0xcccc89['body']),{'include':_0xcccc89['query'][_0x33c2('0x44')]?[{'all':!![]}]:undefined});}})[_0x33c2('0x29')](respondWithResult(_0x19a142,0xc9))[_0x33c2('0x48')](handleError(_0x19a142,null));};exports[_0x33c2('0x27')]=function(_0x39c574,_0x2e6d9b){if(_0x39c574[_0x33c2('0x52')]['id']){delete _0x39c574[_0x33c2('0x52')]['id'];}return db[_0x33c2('0x2f')][_0x33c2('0x4d')]({'where':{'id':_0x39c574[_0x33c2('0x4a')]['id']}})[_0x33c2('0x29')](handleEntityNotFound(_0x2e6d9b,null))[_0x33c2('0x29')](saveUpdates(_0x39c574[_0x33c2('0x52')],null))[_0x33c2('0x29')](respondWithResult(_0x2e6d9b,null))[_0x33c2('0x48')](handleError(_0x2e6d9b,null));};exports[_0x33c2('0x28')]=function(_0x135f29,_0xcf8d0b){return db['Attachment'][_0x33c2('0x4d')]({'where':{'id':_0x135f29[_0x33c2('0x4a')]['id']}})['then'](handleEntityNotFound(_0xcf8d0b,null))['then'](removeEntity(_0xcf8d0b,null))[_0x33c2('0x48')](handleError(_0xcf8d0b,null));};exports[_0x33c2('0x54')]=function(_0x78d33e,_0xf75f78,_0x3c9671){_0x78d33e[_0x33c2('0x52')][_0x33c2('0x2c')]=_0x78d33e['file'][_0x33c2('0x55')];_0x78d33e[_0x33c2('0x52')]['basename']=_0x78d33e[_0x33c2('0x56')][_0x33c2('0x57')];_0x78d33e[_0x33c2('0x52')][_0x33c2('0x42')]=_0x78d33e[_0x33c2('0x56')][_0x33c2('0x58')];return db[_0x33c2('0x2f')]['create'](_0x78d33e[_0x33c2('0x52')])[_0x33c2('0x29')](respondWithResult(_0xf75f78,0xc9))[_0x33c2('0x48')](handleError(_0xf75f78,null));};exports[_0x33c2('0x59')]=function(_0xc12c42,_0x38d2d7,_0x4109f4){return db[_0x33c2('0x2f')][_0x33c2('0x5a')]({'where':{'id':_0xc12c42[_0x33c2('0x4a')]['id']},'raw':!![]})[_0x33c2('0x29')](handleEntityNotFound(_0x38d2d7,null))[_0x33c2('0x29')](function(_0x1fd0ce){if(_0x1fd0ce){var _0x3c50cd=_0x1fd0ce[_0x33c2('0x5b')]!==null;var _0x373396=path[_0x33c2('0x5c')](config[_0x33c2('0x5d')],_0x33c2('0x5e'));if(_0x3c50cd){_0x373396=path[_0x33c2('0x5c')](_0x373396,_0x33c2('0x5f'));}var _0x435d69=path[_0x33c2('0x5c')](_0x373396,_0x1fd0ce[_0x33c2('0x60')]);return _0x38d2d7[_0x33c2('0x59')](_0x435d69);}})['catch'](handleError(_0x38d2d7,null));};
\ No newline at end of file
index 38266be..5fa591a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x83c2=['moment','request-promise','path','rimraf','exports','define','Attachment','lodash','util','api'];(function(_0x48d74c,_0x2f597d){var _0x2fe9e3=function(_0x1a1c20){while(--_0x1a1c20){_0x48d74c['push'](_0x48d74c['shift']());}};_0x2fe9e3(++_0x2f597d);}(_0x83c2,0xed));var _0x283c=function(_0x3ec1da,_0x1e36f5){_0x3ec1da=_0x3ec1da-0x0;var _0x472358=_0x83c2[_0x3ec1da];return _0x472358;};'use strict';var _=require(_0x283c('0x0'));var util=require(_0x283c('0x1'));var logger=require('../../config/logger')(_0x283c('0x2'));var moment=require(_0x283c('0x3'));var BPromise=require('bluebird');var rp=require(_0x283c('0x4'));var fs=require('fs');var path=require(_0x283c('0x5'));var rimraf=require(_0x283c('0x6'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0x283c('0x7')]=function(_0x2f1fa6,_0x2a805b){return _0x2f1fa6[_0x283c('0x8')](_0x283c('0x9'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2c7f=['Attachment','attachments','lodash','util','api','moment','path','rimraf','../../config/environment','./attachment.attributes','exports','define'];(function(_0x2e9a71,_0x206d47){var _0x59955f=function(_0x1d6554){while(--_0x1d6554){_0x2e9a71['push'](_0x2e9a71['shift']());}};_0x59955f(++_0x206d47);}(_0x2c7f,0x1be));var _0xf2c7=function(_0x1333e7,_0x560caa){_0x1333e7=_0x1333e7-0x0;var _0x175b01=_0x2c7f[_0x1333e7];return _0x175b01;};'use strict';var _=require(_0xf2c7('0x0'));var util=require(_0xf2c7('0x1'));var logger=require('../../config/logger')(_0xf2c7('0x2'));var moment=require(_0xf2c7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf2c7('0x4'));var rimraf=require(_0xf2c7('0x5'));var config=require(_0xf2c7('0x6'));var attributes=require(_0xf2c7('0x7'));module[_0xf2c7('0x8')]=function(_0x6adcc6,_0x3c4ac9){return _0x6adcc6[_0xf2c7('0x9')](_0xf2c7('0xa'),attributes,{'tableName':_0xf2c7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f72af6c..5d5eb0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd246=['../../config/utils','rpc','jayson/promise','http','request','info','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','catch','CreateAttachment','Attachment','create','options','raw','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x33c090,_0x184b69){var _0x4081df=function(_0x109a20){while(--_0x109a20){_0x33c090['push'](_0x33c090['shift']());}};_0x4081df(++_0x184b69);}(_0xd246,0xf5));var _0x6d24=function(_0x1c5037,_0x52e4d0){_0x1c5037=_0x1c5037-0x0;var _0x1e6ead=_0xd246[_0x1c5037];return _0x1e6ead;};'use strict';var _=require(_0x6d24('0x0'));var util=require(_0x6d24('0x1'));var moment=require(_0x6d24('0x2'));var BPromise=require(_0x6d24('0x3'));var rs=require(_0x6d24('0x4'));var fs=require('fs');var Redis=require(_0x6d24('0x5'));var db=require(_0x6d24('0x6'))['db'];var utils=require(_0x6d24('0x7'));var logger=require('../../config/logger')(_0x6d24('0x8'));var config=require('../../config/environment');var jayson=require(_0x6d24('0x9'));var client=jayson['client'][_0x6d24('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7f6dfa,_0x1dcaa2,_0x358a65){return new BPromise(function(_0x38e1eb,_0x43500f){return client[_0x6d24('0xb')](_0x7f6dfa,_0x358a65)['then'](function(_0x5a05d3){logger[_0x6d24('0xc')]('Attachment,\x20%s,\x20%s',_0x1dcaa2,_0x6d24('0xd'));logger['debug'](_0x6d24('0xe'),_0x1dcaa2,'request\x20sent',JSON[_0x6d24('0xf')](_0x5a05d3));if(_0x5a05d3[_0x6d24('0x10')]){if(_0x5a05d3['error'][_0x6d24('0x11')]===0x1f4){logger['error'](_0x6d24('0x12'),_0x1dcaa2,_0x5a05d3[_0x6d24('0x10')]['message']);return _0x43500f(_0x5a05d3['error']['message']);}logger[_0x6d24('0x10')](_0x6d24('0x12'),_0x1dcaa2,_0x5a05d3[_0x6d24('0x10')][_0x6d24('0x13')]);return _0x38e1eb(_0x5a05d3['error']['message']);}else{logger[_0x6d24('0xc')](_0x6d24('0x12'),_0x1dcaa2,_0x6d24('0xd'));_0x38e1eb(_0x5a05d3['result']['message']);}})[_0x6d24('0x14')](function(_0x336aeb){logger[_0x6d24('0x10')](_0x6d24('0x12'),_0x1dcaa2,_0x336aeb);_0x43500f(_0x336aeb);});});}exports[_0x6d24('0x15')]=function(_0xad7d02){var _0x49a269=this;return new Promise(function(_0x5b81b4,_0x430b55){return db[_0x6d24('0x16')][_0x6d24('0x17')](_0xad7d02['body'],{'raw':_0xad7d02[_0x6d24('0x18')]?_0xad7d02[_0x6d24('0x18')][_0x6d24('0x19')]===undefined?!![]:![]:!![]})[_0x6d24('0x1a')](function(_0x359430){logger['info'](_0x6d24('0x15'),_0xad7d02);logger[_0x6d24('0x1b')]('CreateAttachment',_0xad7d02,JSON[_0x6d24('0xf')](_0x359430));_0x5b81b4(_0x359430);})['catch'](function(_0xca50d5){logger[_0x6d24('0x10')](_0x6d24('0x15'),_0xca50d5[_0x6d24('0x13')],_0xad7d02);_0x430b55(_0x49a269[_0x6d24('0x10')](0x1f4,_0xca50d5[_0x6d24('0x13')]));});});};
\ No newline at end of file
+var _0x2504=['catch','CreateAttachment','create','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','error','code','Attachment,\x20%s,\x20%s','message','result'];(function(_0x3ceab8,_0x30486f){var _0x3e9fe3=function(_0x33bd73){while(--_0x33bd73){_0x3ceab8['push'](_0x3ceab8['shift']());}};_0x3e9fe3(++_0x30486f);}(_0x2504,0xee));var _0x4250=function(_0x3e5f50,_0x4c4c90){_0x3e5f50=_0x3e5f50-0x0;var _0xe51297=_0x2504[_0x3e5f50];return _0xe51297;};'use strict';var _=require(_0x4250('0x0'));var util=require(_0x4250('0x1'));var moment=require(_0x4250('0x2'));var BPromise=require(_0x4250('0x3'));var rs=require(_0x4250('0x4'));var fs=require('fs');var Redis=require(_0x4250('0x5'));var db=require(_0x4250('0x6'))['db'];var utils=require(_0x4250('0x7'));var logger=require(_0x4250('0x8'))(_0x4250('0x9'));var config=require(_0x4250('0xa'));var jayson=require(_0x4250('0xb'));var client=jayson['client'][_0x4250('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4e177e,_0x5a5286,_0x370998){return new BPromise(function(_0x477312,_0x1a3b57){return client[_0x4250('0xd')](_0x4e177e,_0x370998)[_0x4250('0xe')](function(_0x51ea6f){logger[_0x4250('0xf')]('Attachment,\x20%s,\x20%s',_0x5a5286,_0x4250('0x10'));logger[_0x4250('0x11')]('Attachment,\x20%s,\x20%s,\x20%s',_0x5a5286,_0x4250('0x10'),JSON['stringify'](_0x51ea6f));if(_0x51ea6f['error']){if(_0x51ea6f[_0x4250('0x12')][_0x4250('0x13')]===0x1f4){logger[_0x4250('0x12')](_0x4250('0x14'),_0x5a5286,_0x51ea6f[_0x4250('0x12')]['message']);return _0x1a3b57(_0x51ea6f[_0x4250('0x12')][_0x4250('0x15')]);}logger[_0x4250('0x12')](_0x4250('0x14'),_0x5a5286,_0x51ea6f[_0x4250('0x12')][_0x4250('0x15')]);return _0x477312(_0x51ea6f['error'][_0x4250('0x15')]);}else{logger[_0x4250('0xf')](_0x4250('0x14'),_0x5a5286,_0x4250('0x10'));_0x477312(_0x51ea6f[_0x4250('0x16')][_0x4250('0x15')]);}})[_0x4250('0x17')](function(_0x4e70fc){logger[_0x4250('0x12')](_0x4250('0x14'),_0x5a5286,_0x4e70fc);_0x1a3b57(_0x4e70fc);});});}exports[_0x4250('0x18')]=function(_0x17a8a9){var _0x369010=this;return new Promise(function(_0x30e48c,_0x14d590){return db['Attachment'][_0x4250('0x19')](_0x17a8a9['body'],{'raw':_0x17a8a9['options']?_0x17a8a9[_0x4250('0x1a')][_0x4250('0x1b')]===undefined?!![]:![]:!![]})[_0x4250('0xe')](function(_0x42c331){logger[_0x4250('0xf')](_0x4250('0x18'),_0x17a8a9);logger[_0x4250('0x11')](_0x4250('0x18'),_0x17a8a9,JSON[_0x4250('0x1c')](_0x42c331));_0x30e48c(_0x42c331);})[_0x4250('0x17')](function(_0x728862){logger[_0x4250('0x12')]('CreateAttachment',_0x728862[_0x4250('0x15')],_0x17a8a9);_0x14d590(_0x369010[_0x4250('0x12')](0x1f4,_0x728862[_0x4250('0x15')]));});});};
\ No newline at end of file
index de79136..a2ba6fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x2aa66,_0x3e2602){var _0x5f3186=function(_0x4ee46d){while(--_0x4ee46d){_0x2aa66['push'](_0x2aa66['shift']());}};_0x5f3186(++_0x3e2602);}(_0xb10b,0x12a));var _0xbb10=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0xb10b[_0x562f3b];return _0x1edd55;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=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(_0x5ede62,_0x312856){var _0x4a43ec=function(_0x2c5607){while(--_0x2c5607){_0x5ede62['push'](_0x5ede62['shift']());}};_0x4a43ec(++_0x312856);}(_0x2032,0xd9));var _0x2203=function(_0x51bc22,_0xa61444){_0x51bc22=_0x51bc22-0x0;var _0xee8e68=_0x2032[_0x51bc22];return _0xee8e68;};'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 14fda2a..9e4713d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18e9=['value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb','../../config/environment','../../components/auth/service','/login','profile','callback','authenticate','google','use','clientID','secret','Setting','blockDuration','then','User','find','emails'];(function(_0x381043,_0x10619d){var _0x3b1ef1=function(_0x1bc04a){while(--_0x1bc04a){_0x381043['push'](_0x381043['shift']());}};_0x3b1ef1(++_0x10619d);}(_0x18e9,0x161));var _0x918e=function(_0x2c1dcd,_0x350452){_0x2c1dcd=_0x2c1dcd-0x0;var _0x158ce5=_0x18e9[_0x2c1dcd];return _0x158ce5;};'use strict';var _=require(_0x918e('0x0'));var passport=require(_0x918e('0x1'));var GoogleStrategy=require(_0x918e('0x2'))[_0x918e('0x3')];var moment=require('moment');var db=require(_0x918e('0x4'))['db'];var config=require(_0x918e('0x5'));var signToken=require(_0x918e('0x6'))['signToken'];var utils=require('../../config/utils');exports['login']=passport['authenticate']('google',{'failureRedirect':_0x918e('0x7'),'scope':[_0x918e('0x8'),'email'],'session':![]});exports[_0x918e('0x9')]=passport[_0x918e('0xa')](_0x918e('0xb'),{'failureRedirect':'/login','session':![]});passport[_0x918e('0xc')](new GoogleStrategy({'clientID':config['google']?config[_0x918e('0xb')][_0x918e('0xd')]:'id','clientSecret':config[_0x918e('0xb')]?config[_0x918e('0xb')]['clientSecret']:_0x918e('0xe'),'callbackURL':config[_0x918e('0xb')]?config[_0x918e('0xb')]['callbackURL']:''},function(_0x1f8644,_0x45c3e0,_0x254544,_0x5066ef){var _0x872a87,_0x4694d2;return db[_0x918e('0xf')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x918e('0x10')],'raw':!![]})[_0x918e('0x11')](function(_0x5439bc){_0x872a87=_0x5439bc;return db[_0x918e('0x12')][_0x918e('0x13')]({'where':{'email':_['map'](_0x254544[_0x918e('0x14')],_0x918e('0x15')),'role':{'$or':[_0x918e('0x16'),_0x918e('0x17'),_0x918e('0x18')]}}});})[_0x918e('0x11')](function(_0x5f07e2){_0x4694d2=_0x5f07e2;if(_0x4694d2){if(_0x4694d2[_0x918e('0x19')]){return _0x5066ef(_0x918e('0x1a'));}else if(_0x872a87[_0x918e('0x10')]>0x0){if(_0x4694d2[_0x918e('0x1b')]){if(moment(_0x4694d2[_0x918e('0x1c')])[_0x918e('0x1d')](_0x872a87[_0x918e('0x10')],_0x918e('0x1e'))>moment()){return _0x5066ef(_0x918e('0x1a'));}else{return utils[_0x918e('0x1f')](_0x4694d2,0x0,![],null)[_0x918e('0x11')](function(){return utils[_0x918e('0x20')](_0x4694d2);})[_0x918e('0x11')](function(){return _0x5066ef(null,_0x4694d2);});}}else{return utils[_0x918e('0x20')](_0x4694d2)[_0x918e('0x11')](function(){return _0x5066ef(null,_0x4694d2);});}}else{return utils[_0x918e('0x20')](_0x4694d2)[_0x918e('0x11')](function(){return _0x5066ef(null,_0x4694d2);});}}return _0x5066ef(_0x918e('0x1a'));})[_0x918e('0x21')](function(_0x7b9ecf){_0x5066ef(_0x7b9ecf);});}));
\ No newline at end of file
+var _0x41dc=['User','map','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','clearBlockUser','getLicense','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','signToken','../../config/utils','login','authenticate','/login','profile','email','callback','google','use','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then'];(function(_0x9a36ec,_0x7afd44){var _0x397955=function(_0x16e50e){while(--_0x16e50e){_0x9a36ec['push'](_0x9a36ec['shift']());}};_0x397955(++_0x7afd44);}(_0x41dc,0x148));var _0xc41d=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x41dc[_0x18ab2a];return _0x16dcee;};'use strict';var _=require(_0xc41d('0x0'));var passport=require(_0xc41d('0x1'));var GoogleStrategy=require(_0xc41d('0x2'))[_0xc41d('0x3')];var moment=require(_0xc41d('0x4'));var db=require(_0xc41d('0x5'))['db'];var config=require('../../config/environment');var signToken=require('../../components/auth/service')[_0xc41d('0x6')];var utils=require(_0xc41d('0x7'));exports[_0xc41d('0x8')]=passport[_0xc41d('0x9')]('google',{'failureRedirect':_0xc41d('0xa'),'scope':[_0xc41d('0xb'),_0xc41d('0xc')],'session':![]});exports[_0xc41d('0xd')]=passport['authenticate'](_0xc41d('0xe'),{'failureRedirect':_0xc41d('0xa'),'session':![]});passport[_0xc41d('0xf')](new GoogleStrategy({'clientID':config[_0xc41d('0xe')]?config[_0xc41d('0xe')]['clientID']:'id','clientSecret':config['google']?config['google']['clientSecret']:'secret','callbackURL':config[_0xc41d('0xe')]?config['google'][_0xc41d('0x10')]:''},function(_0x4f3b8d,_0x441066,_0x4ec897,_0x1309bc){var _0x6471c2,_0x45e1b1;return db[_0xc41d('0x11')][_0xc41d('0x12')]({'where':{'id':0x1},'attributes':[_0xc41d('0x13'),_0xc41d('0x14')],'raw':!![]})[_0xc41d('0x15')](function(_0x55e5f8){_0x6471c2=_0x55e5f8;return db[_0xc41d('0x16')]['find']({'where':{'email':_[_0xc41d('0x17')](_0x4ec897['emails'],_0xc41d('0x18')),'role':{'$or':[_0xc41d('0x19'),_0xc41d('0x1a'),_0xc41d('0x1b')]}}});})[_0xc41d('0x15')](function(_0x54e997){_0x45e1b1=_0x54e997;if(_0x45e1b1){if(_0x45e1b1[_0xc41d('0x1c')]){return _0x1309bc(_0xc41d('0x1d'));}else if(_0x6471c2[_0xc41d('0x14')]>0x0){if(_0x45e1b1[_0xc41d('0x1e')]){if(moment(_0x45e1b1[_0xc41d('0x1f')])[_0xc41d('0x20')](_0x6471c2[_0xc41d('0x14')],'minutes')>moment()){return _0x1309bc(_0xc41d('0x1d'));}else{return utils[_0xc41d('0x21')](_0x45e1b1,0x0,![],null)[_0xc41d('0x15')](function(){return utils[_0xc41d('0x22')](_0x45e1b1);})['then'](function(){return _0x1309bc(null,_0x45e1b1);});}}else{return utils['getLicense'](_0x45e1b1)[_0xc41d('0x15')](function(){return _0x1309bc(null,_0x45e1b1);});}}else{return utils[_0xc41d('0x22')](_0x45e1b1)['then'](function(){return _0x1309bc(null,_0x45e1b1);});}}return _0x1309bc('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})['catch'](function(_0x3e6160){_0x1309bc(_0x3e6160);});}));
\ No newline at end of file
index 5a77818..3e44dc5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4c4=['callback','setTokenCookie','passport','Router','./authGoogle.controller','get'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc4c4,0xec));var _0x4c4c=function(_0x205e56,_0x366e77){_0x205e56=_0x205e56-0x0;var _0x489d5d=_0xc4c4[_0x205e56];return _0x489d5d;};'use strict';var express=require('express');var passport=require(_0x4c4c('0x0'));var router=express[_0x4c4c('0x1')]();var controller=require(_0x4c4c('0x2'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0x4c4c('0x3')]('/',controller['login']);router[_0x4c4c('0x3')]('/callback',controller[_0x4c4c('0x4')],authService['isMiddleware'],userController['login'],authService[_0x4c4c('0x5')]);module['exports']=router;
\ No newline at end of file
+var _0x41c1=['get','/callback','callback','isMiddleware','setTokenCookie','exports','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x41c1,0x103));var _0x141c=function(_0x2fa771,_0x511aec){_0x2fa771=_0x2fa771-0x0;var _0x8f89c2=_0x41c1[_0x2fa771];return _0x8f89c2;};'use strict';var express=require('express');var passport=require(_0x141c('0x0'));var router=express[_0x141c('0x1')]();var controller=require(_0x141c('0x2'));var userController=require(_0x141c('0x3'));var authService=require(_0x141c('0x4'));router[_0x141c('0x5')]('/',controller['login']);router['get'](_0x141c('0x6'),controller[_0x141c('0x7')],authService[_0x141c('0x8')],userController['login'],authService[_0x141c('0x9')]);module[_0x141c('0xa')]=router;
\ No newline at end of file
index 4b643c4..6c305b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x049e=['Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','resetPasswordToken','use','User','util','passport','Strategy','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','client','http','Setting','findOne','allowedLoginAttempts','name','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','clearBlockUser','minutes','getLicense','catch','MailAccount','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','format','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'];(function(_0x38300c,_0x4618b9){var _0x591bf6=function(_0x3595d9){while(--_0x3595d9){_0x38300c['push'](_0x38300c['shift']());}};_0x591bf6(++_0x4618b9);}(_0x049e,0x16a));var _0xe049=function(_0x28407a,_0x2a7269){_0x28407a=_0x28407a-0x0;var _0x8bd6ef=_0x049e[_0x28407a];return _0x8bd6ef;};'use strict';var util=require(_0xe049('0x0'));var passport=require(_0xe049('0x1'));var LocalStrategy=require('passport-local')[_0xe049('0x2')];var jayson=require('jayson/promise');var _=require(_0xe049('0x3'));var rs=require(_0xe049('0x4'));var moment=require(_0xe049('0x5'));var db=require(_0xe049('0x6'))['db'];var authService=require(_0xe049('0x7'));var utils=require('../../config/utils');var client=jayson[_0xe049('0x8')][_0xe049('0x9')]({'port':0x232b});function localAuthenticate(_0x22e8f5,_0x221a5f,_0x1d4fc6,_0x17945b){var _0x22abb2,_0x515823;return db[_0xe049('0xa')][_0xe049('0xb')]({'where':{'id':0x1},'attributes':[_0xe049('0xc'),'blockDuration'],'raw':!![]})['then'](function(_0x45a5fa){_0x22abb2=_0x45a5fa;return _0x22e8f5[_0xe049('0xb')]({'attributes':['id',_0xe049('0xd'),'password','salt','role',_0xe049('0xe'),_0xe049('0xf'),_0xe049('0x10'),_0xe049('0x11')],'where':{'name':_0x221a5f,'role':{'$or':[_0xe049('0x12'),_0xe049('0x13'),_0xe049('0x14')]}}});})[_0xe049('0x15')](function(_0x5272f4){if(!_0x5272f4||_0x5272f4&&_0x5272f4[_0xe049('0xd')]!==_0x221a5f){throw new Error(_0xe049('0x16'));}else{_0x515823=_0x5272f4;return _0x515823;}})[_0xe049('0x15')](function(){_0x515823[_0xe049('0x17')](_0x1d4fc6,function(_0x5f57d3,_0x3a539b){var _0xcc35b6=_0x515823['loginAttempts']+0x1;if(_0x5f57d3){return _0x17945b(_0x5f57d3);}else if(!_0x3a539b){if(_0x515823[_0xe049('0xe')]){return _0x17945b(null,![],{'message':_0xe049('0x16')});}else if(_0x22abb2['allowedLoginAttempts']>0x0){if(_0x515823[_0xe049('0xf')]){if(_0x22abb2[_0xe049('0x18')]>0x0){if(moment(_0x515823['blockedAt'])[_0xe049('0x19')](_0x22abb2['blockDuration'],'minutes')>moment()){return _0x17945b(null,![],{'message':_0xe049('0x16')});}else{return utils['clearBlockUser'](_0x515823,_0xcc35b6,![],null)['then'](function(){return _0x17945b(null,![],{'message':_0xe049('0x16')});});}}else{return _0x17945b(null,![],{'message':_0xe049('0x16')});}}else{if(_0xcc35b6>=_0x22abb2['allowedLoginAttempts']){return utils['clearBlockUser'](_0x515823,0x0,!![],moment())[_0xe049('0x15')](function(){return _0x17945b(null,![],{'message':_0xe049('0x16')});});}else{return utils[_0xe049('0x1a')](_0x515823,_0xcc35b6,![],null)[_0xe049('0x15')](function(){return _0x17945b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x17945b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x515823[_0xe049('0xe')]){return _0x17945b(null,![],{'message':_0xe049('0x16')});}else if(_0x22abb2['allowedLoginAttempts']>0x0){if(_0x515823[_0xe049('0xf')]){if(_0x22abb2[_0xe049('0x18')]>0x0){if(moment(_0x515823[_0xe049('0x10')])['add'](_0x22abb2[_0xe049('0x18')],_0xe049('0x1b'))>moment()){return _0x17945b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x515823,0x0,![],null)['then'](function(){return utils[_0xe049('0x1c')](_0x515823);})['then'](function(){return _0x17945b(null,_0x515823);});}}else{return _0x17945b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xe049('0x1a')](_0x515823,0x0,![],null)[_0xe049('0x15')](function(){return utils['getLicense'](_0x515823);})[_0xe049('0x15')](function(){return _0x17945b(null,_0x515823);})[_0xe049('0x1d')](function(_0x3e5c7f){return _0x17945b(null,![],_0x3e5c7f);});}}else{if(_0x515823[_0xe049('0xf')]){return _0x17945b(null,![],{'message':_0xe049('0x16')});}else{return utils[_0xe049('0x1c')](_0x515823)['then'](function(){return _0x17945b(null,_0x515823);});}}}});})['catch'](function(_0x7f5538){return _0x17945b(null,![],_0x7f5538);});}function sendServiceMail(_0x542c7c){return db[_0xe049('0x1e')]['find']({'where':{'service':!![]},'attributes':['id',_0xe049('0xd'),_0xe049('0x1f')],'include':[{'model':db['MailServerOut'],'as':_0xe049('0x20')}]})[_0xe049('0x15')](function(_0xb64700){if(!_0xb64700){throw new Error(_0xe049('0x21'));}var _0x4464b2={'tls':{'rejectUnauthorized':![]}};if(_0xb64700[_0xe049('0x20')][_0xe049('0x22')]){_0x4464b2[_0xe049('0x22')]=_0xb64700[_0xe049('0x20')][_0xe049('0x22')];}else{_0x4464b2[_0xe049('0x23')]=_0xb64700['Smtp'][_0xe049('0x23')];_0x4464b2[_0xe049('0x24')]=_0xb64700['Smtp']['port'];_0x4464b2['secure']=_0xb64700['Smtp'][_0xe049('0x25')];}if(_0xb64700[_0xe049('0x20')][_0xe049('0x26')]){_0x4464b2[_0xe049('0x27')]={'user':_0xb64700[_0xe049('0x20')]['user'],'pass':_0xb64700[_0xe049('0x20')][_0xe049('0x28')]};}var _0x2fd840={'account':_0x4464b2,'message':_[_0xe049('0x29')]({'from':util[_0xe049('0x2a')]('\x22%s\x22\x20<%s>',_0xb64700[_0xe049('0xd')],_0xb64700['email']||_0xb64700[_0xe049('0x20')]['user'])},_0x542c7c)};return client[_0xe049('0x2b')](_0xe049('0x2c'),_0x2fd840);})[_0xe049('0x15')](function(_0x464c1d){if(_0x464c1d[_0xe049('0x2d')]){throw new Error(util[_0xe049('0x2a')](_0xe049('0x2e'),_0x464c1d[_0xe049('0x2d')][_0xe049('0x2f')]||JSON[_0xe049('0x30')](_0x464c1d[_0xe049('0x2d')])));}return!![];});}function handleError(_0x5275c5,_0x3b1c65,_0x1b21d9){return _0x5275c5[_0xe049('0x31')](_0x3b1c65||0x1f4)[_0xe049('0x32')]({'message':_0x1b21d9?_0x1b21d9[_0xe049('0x2f')]||_0x1b21d9:''});}exports[_0xe049('0x33')]=function(_0x2285d4,_0x1e39f2,_0x54df1a){passport[_0xe049('0x17')](_0xe049('0x34'),function(_0x3ba5e5,_0x144e48,_0x5e9613){var _0xe17673=_0x3ba5e5||_0x5e9613;if(_0xe17673){return handleError(_0x1e39f2,0x191,_0xe17673);}if(!_0x144e48){return handleError(_0x1e39f2,0x194,{'message':_0xe049('0x35')});}else{var _0x3963e6={'payload':{'id':_0x144e48['id'],'role':_0x144e48[_0xe049('0x36')]},'options':{'expiresIn':0x15180}};return authService[_0xe049('0x37')](_0x3963e6)['then'](function(_0x245f86){_0x1e39f2[_0xe049('0x38')]({'id':_0x144e48['id'],'token':_0x245f86,'statusCall':'','isAlreadyLogged':_0x144e48[_0xe049('0x39')]});});}})(_0x2285d4,_0x1e39f2,_0x54df1a);};exports['forgot']=function(_0x28ae88,_0x4fb4e1,_0x570fa8){if(!_0x28ae88[_0xe049('0x3a')]['email']){return handleError(_0x4fb4e1,0x1f4,{'message':_0xe049('0x3b')});}var _0x29e029=rs[_0xe049('0x3c')]();_0x28ae88[_0xe049('0x3a')][_0xe049('0x1f')]=_0x28ae88['body'][_0xe049('0x1f')][_0xe049('0x3d')]()['toLowerCase']();var _0x546137;return db[_0xe049('0xa')][_0xe049('0xb')]({'where':{'id':0x1},'attributes':[_0xe049('0xc'),_0xe049('0x18')],'raw':!![]})[_0xe049('0x15')](function(_0x1d5da2){_0x546137=_0x1d5da2;return db['User'][_0xe049('0x3e')]({'where':{'email':_0x28ae88[_0xe049('0x3a')]['email']}});})[_0xe049('0x15')](function(_0x29cfa4){if(!_0x29cfa4){throw new Error(_0xe049('0x3f'));}if(_0x29cfa4[_0xe049('0xe')]){throw new Error(_0xe049('0x40'));}if(_0x29cfa4['blocked']){if(moment(_0x29cfa4['blockedAt'])[_0xe049('0x19')](_0x546137[_0xe049('0x18')],_0xe049('0x1b'))>moment()){throw new Error(_0xe049('0x41'));}else{_0x29cfa4[_0xe049('0xf')]=![];_0x29cfa4[_0xe049('0x10')]=null;}}_0x29cfa4['resetPasswordToken']=_0x29e029;_0x29cfa4[_0xe049('0x42')]=Date[_0xe049('0x43')]()+0x36ee80;return _0x29cfa4['save']();})[_0xe049('0x15')](function(){return sendServiceMail({'to':_0x28ae88['body'][_0xe049('0x1f')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xe049('0x44')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+_0xe049('0x45')+_0x28ae88[_0xe049('0x46')][_0xe049('0x23')]+_0xe049('0x47')+_0x29e029+'\x0a\x0a'+_0xe049('0x48')});})['then'](function(){_0x4fb4e1[_0xe049('0x31')](0xc8)[_0xe049('0x32')]({'message':_0xe049('0x49')});})[_0xe049('0x1d')](function(_0x3d1908){return handleError(_0x4fb4e1,0x1f4,_0x3d1908);});};exports[_0xe049('0x4a')]=function(_0x12f9b8,_0x1b94b5,_0x4568ac){return db['User']['find']({'where':{'resetPasswordToken':_0x12f9b8[_0xe049('0x4b')][_0xe049('0x4c')],'resetPasswordExpires':{'$gt':Date[_0xe049('0x43')]()}}})[_0xe049('0x15')](function(_0x254dc6){if(!_0x254dc6){throw new Error(_0xe049('0x4d'));}return db[_0xe049('0xa')][_0xe049('0xb')]({'attributes':['id',_0xe049('0x4e'),_0xe049('0x4f'),_0xe049('0x50')]})['then'](function(_0x36346a){if(_0x36346a[_0xe049('0x4e')])authService[_0xe049('0x51')](_0x12f9b8[_0xe049('0x3a')][_0xe049('0x52')]);if(!_0x36346a[_0xe049('0x4f')]||!_0x254dc6[_0xe049('0x53')])return _0x254dc6;authService['validatePasswordHistory'](_0x12f9b8['body']['password'],_0x254dc6[_0xe049('0x53')],_0x36346a[_0xe049('0x50')]);return _0x254dc6;})['then'](function(){_0x254dc6[_0xe049('0x52')]=_0x12f9b8[_0xe049('0x3a')][_0xe049('0x52')];_0x254dc6[_0xe049('0x54')]=null;_0x254dc6['resetPasswordExpires']=null;return _0x254dc6['save']();});})[_0xe049('0x15')](function(){_0x1b94b5[_0xe049('0x31')](0xc8)['send']({'message':'Password\x20reset!'});})[_0xe049('0x1d')](function(_0x57158d){return handleError(_0x1b94b5,0x1f4,_0x57158d);});};passport[_0xe049('0x55')](new LocalStrategy({'usernameField':_0xe049('0xd'),'passwordField':'password'},function(_0x6b2cf6,_0x56b9d9,_0x356605){return localAuthenticate(db[_0xe049('0x56')],_0x6b2cf6,_0x56b9d9,_0x356605);}));
\ No newline at end of file
+var _0xa15b=['catch','MailAccount','find','email','MailServerOut','service','Smtp','host','port','secure','auth','pass','\x22%s\x22\x20<%s>','request','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','status','Reset\x20Email\x20sent!','User','params','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','password','salt','disabled','blocked','blockedAt','loginAttempts','admin','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','getLicense'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xa15b,0x1e6));var _0xba15=function(_0x1a97c7,_0x556227){_0x1a97c7=_0x1a97c7-0x0;var _0x3bfa53=_0xa15b[_0x1a97c7];return _0x3bfa53;};'use strict';var util=require(_0xba15('0x0'));var passport=require(_0xba15('0x1'));var LocalStrategy=require(_0xba15('0x2'))[_0xba15('0x3')];var jayson=require(_0xba15('0x4'));var _=require('lodash');var rs=require('randomstring');var moment=require(_0xba15('0x5'));var db=require(_0xba15('0x6'))['db'];var authService=require(_0xba15('0x7'));var utils=require(_0xba15('0x8'));var client=jayson[_0xba15('0x9')][_0xba15('0xa')]({'port':0x232b});function localAuthenticate(_0x1df67e,_0x9b1ed1,_0x313a88,_0x553c91){var _0x51d2b4,_0x46abb3;return db[_0xba15('0xb')][_0xba15('0xc')]({'where':{'id':0x1},'attributes':[_0xba15('0xd'),_0xba15('0xe')],'raw':!![]})['then'](function(_0x4a843e){_0x51d2b4=_0x4a843e;return _0x1df67e['findOne']({'attributes':['id',_0xba15('0xf'),_0xba15('0x10'),_0xba15('0x11'),'role',_0xba15('0x12'),_0xba15('0x13'),_0xba15('0x14'),_0xba15('0x15')],'where':{'name':_0x9b1ed1,'role':{'$or':[_0xba15('0x16'),'user','agent']}}});})[_0xba15('0x17')](function(_0x573c36){if(!_0x573c36||_0x573c36&&_0x573c36[_0xba15('0xf')]!==_0x9b1ed1){throw new Error(_0xba15('0x18'));}else{_0x46abb3=_0x573c36;return _0x46abb3;}})['then'](function(){_0x46abb3[_0xba15('0x19')](_0x313a88,function(_0x33aba3,_0x224c5b){var _0x231051=_0x46abb3[_0xba15('0x15')]+0x1;if(_0x33aba3){return _0x553c91(_0x33aba3);}else if(!_0x224c5b){if(_0x46abb3['disabled']){return _0x553c91(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x51d2b4[_0xba15('0xd')]>0x0){if(_0x46abb3[_0xba15('0x13')]){if(_0x51d2b4[_0xba15('0xe')]>0x0){if(moment(_0x46abb3[_0xba15('0x14')])[_0xba15('0x1a')](_0x51d2b4[_0xba15('0xe')],_0xba15('0x1b'))>moment()){return _0x553c91(null,![],{'message':_0xba15('0x18')});}else{return utils[_0xba15('0x1c')](_0x46abb3,_0x231051,![],null)[_0xba15('0x17')](function(){return _0x553c91(null,![],{'message':_0xba15('0x18')});});}}else{return _0x553c91(null,![],{'message':_0xba15('0x18')});}}else{if(_0x231051>=_0x51d2b4['allowedLoginAttempts']){return utils['clearBlockUser'](_0x46abb3,0x0,!![],moment())[_0xba15('0x17')](function(){return _0x553c91(null,![],{'message':_0xba15('0x18')});});}else{return utils[_0xba15('0x1c')](_0x46abb3,_0x231051,![],null)[_0xba15('0x17')](function(){return _0x553c91(null,![],{'message':_0xba15('0x18')});});}}}else{return _0x553c91(null,![],{'message':_0xba15('0x18')});}}else{if(_0x46abb3[_0xba15('0x12')]){return _0x553c91(null,![],{'message':_0xba15('0x18')});}else if(_0x51d2b4[_0xba15('0xd')]>0x0){if(_0x46abb3['blocked']){if(_0x51d2b4[_0xba15('0xe')]>0x0){if(moment(_0x46abb3[_0xba15('0x14')])['add'](_0x51d2b4[_0xba15('0xe')],_0xba15('0x1b'))>moment()){return _0x553c91(null,![],{'message':_0xba15('0x18')});}else{return utils['clearBlockUser'](_0x46abb3,0x0,![],null)[_0xba15('0x17')](function(){return utils[_0xba15('0x1d')](_0x46abb3);})[_0xba15('0x17')](function(){return _0x553c91(null,_0x46abb3);});}}else{return _0x553c91(null,![],{'message':_0xba15('0x18')});}}else{return utils[_0xba15('0x1c')](_0x46abb3,0x0,![],null)[_0xba15('0x17')](function(){return utils['getLicense'](_0x46abb3);})[_0xba15('0x17')](function(){return _0x553c91(null,_0x46abb3);})[_0xba15('0x1e')](function(_0x3aa75c){return _0x553c91(null,![],_0x3aa75c);});}}else{if(_0x46abb3[_0xba15('0x13')]){return _0x553c91(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x46abb3)[_0xba15('0x17')](function(){return _0x553c91(null,_0x46abb3);});}}}});})['catch'](function(_0x38fe79){return _0x553c91(null,![],_0x38fe79);});}function sendServiceMail(_0x2b37d9){return db[_0xba15('0x1f')][_0xba15('0x20')]({'where':{'service':!![]},'attributes':['id',_0xba15('0xf'),_0xba15('0x21')],'include':[{'model':db[_0xba15('0x22')],'as':'Smtp'}]})[_0xba15('0x17')](function(_0x5137fe){if(!_0x5137fe){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x430c71={'tls':{'rejectUnauthorized':![]}};if(_0x5137fe['Smtp']['service']){_0x430c71[_0xba15('0x23')]=_0x5137fe[_0xba15('0x24')][_0xba15('0x23')];}else{_0x430c71[_0xba15('0x25')]=_0x5137fe['Smtp']['host'];_0x430c71['port']=_0x5137fe[_0xba15('0x24')][_0xba15('0x26')];_0x430c71[_0xba15('0x27')]=_0x5137fe['Smtp'][_0xba15('0x27')];}if(_0x5137fe['Smtp']['authentication']){_0x430c71[_0xba15('0x28')]={'user':_0x5137fe[_0xba15('0x24')]['user'],'pass':_0x5137fe[_0xba15('0x24')][_0xba15('0x29')]};}var _0x2bc433={'account':_0x430c71,'message':_['merge']({'from':util['format'](_0xba15('0x2a'),_0x5137fe['name'],_0x5137fe[_0xba15('0x21')]||_0x5137fe['Smtp']['user'])},_0x2b37d9)};return client[_0xba15('0x2b')]('SendMail',_0x2bc433);})[_0xba15('0x17')](function(_0x33911e){if(_0x33911e[_0xba15('0x2c')]){throw new Error(util[_0xba15('0x2d')](_0xba15('0x2e'),_0x33911e[_0xba15('0x2c')][_0xba15('0x2f')]||JSON[_0xba15('0x30')](_0x33911e[_0xba15('0x2c')])));}return!![];});}function handleError(_0x575a06,_0xa80376,_0x1e61c7){return _0x575a06['status'](_0xa80376||0x1f4)[_0xba15('0x31')]({'message':_0x1e61c7?_0x1e61c7[_0xba15('0x2f')]||_0x1e61c7:''});}exports['login']=function(_0x470614,_0x189d80,_0x2eba37){passport[_0xba15('0x19')](_0xba15('0x32'),function(_0x3259db,_0x589435,_0x3ae369){var _0x1ec556=_0x3259db||_0x3ae369;if(_0x1ec556){return handleError(_0x189d80,0x191,_0x1ec556);}if(!_0x589435){return handleError(_0x189d80,0x194,{'message':_0xba15('0x33')});}else{var _0x1023b7={'payload':{'id':_0x589435['id'],'role':_0x589435[_0xba15('0x34')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1023b7)[_0xba15('0x17')](function(_0x123d9e){_0x189d80[_0xba15('0x35')]({'id':_0x589435['id'],'token':_0x123d9e,'statusCall':'','isAlreadyLogged':_0x589435[_0xba15('0x36')]});});}})(_0x470614,_0x189d80,_0x2eba37);};exports[_0xba15('0x37')]=function(_0x3ac4e2,_0x363504,_0x1fd6b8){if(!_0x3ac4e2[_0xba15('0x38')][_0xba15('0x21')]){return handleError(_0x363504,0x1f4,{'message':_0xba15('0x39')});}var _0x4f9fad=rs[_0xba15('0x3a')]();_0x3ac4e2[_0xba15('0x38')]['email']=_0x3ac4e2['body'][_0xba15('0x21')][_0xba15('0x3b')]()[_0xba15('0x3c')]();var _0x90261e;return db[_0xba15('0xb')][_0xba15('0xc')]({'where':{'id':0x1},'attributes':[_0xba15('0xd'),_0xba15('0xe')],'raw':!![]})[_0xba15('0x17')](function(_0x57ac86){_0x90261e=_0x57ac86;return db['User'][_0xba15('0x20')]({'where':{'email':_0x3ac4e2[_0xba15('0x38')][_0xba15('0x21')]}});})[_0xba15('0x17')](function(_0x35802c){if(!_0x35802c){throw new Error(_0xba15('0x3d'));}if(_0x35802c[_0xba15('0x12')]){throw new Error(_0xba15('0x3e'));}if(_0x35802c[_0xba15('0x13')]){if(moment(_0x35802c['blockedAt'])[_0xba15('0x1a')](_0x90261e[_0xba15('0xe')],_0xba15('0x1b'))>moment()){throw new Error(_0xba15('0x3f'));}else{_0x35802c['blocked']=![];_0x35802c['blockedAt']=null;}}_0x35802c[_0xba15('0x40')]=_0x4f9fad;_0x35802c[_0xba15('0x41')]=Date[_0xba15('0x42')]()+0x36ee80;return _0x35802c[_0xba15('0x43')]();})[_0xba15('0x17')](function(){return sendServiceMail({'to':_0x3ac4e2[_0xba15('0x38')]['email'],'subject':_0xba15('0x44'),'text':_0xba15('0x45')+_0xba15('0x46')+_0xba15('0x47')+_0x3ac4e2[_0xba15('0x48')][_0xba15('0x25')]+_0xba15('0x49')+_0x4f9fad+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xba15('0x17')](function(){_0x363504[_0xba15('0x4a')](0xc8)[_0xba15('0x31')]({'message':_0xba15('0x4b')});})[_0xba15('0x1e')](function(_0x3065bb){return handleError(_0x363504,0x1f4,_0x3065bb);});};exports['reset']=function(_0x335c26,_0x5e31f2,_0x1d5b33){return db[_0xba15('0x4c')][_0xba15('0x20')]({'where':{'resetPasswordToken':_0x335c26[_0xba15('0x4d')]['token'],'resetPasswordExpires':{'$gt':Date[_0xba15('0x42')]()}}})['then'](function(_0x3f32cd){if(!_0x3f32cd){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0xba15('0xc')]({'attributes':['id',_0xba15('0x4e'),_0xba15('0x4f'),_0xba15('0x50')]})[_0xba15('0x17')](function(_0x314f80){if(_0x314f80[_0xba15('0x4e')])authService[_0xba15('0x51')](_0x335c26[_0xba15('0x38')][_0xba15('0x10')]);if(!_0x314f80[_0xba15('0x4f')]||!_0x3f32cd[_0xba15('0x52')])return _0x3f32cd;authService[_0xba15('0x53')](_0x335c26[_0xba15('0x38')][_0xba15('0x10')],_0x3f32cd[_0xba15('0x52')],_0x314f80['passwordHistoryLimit']);return _0x3f32cd;})[_0xba15('0x17')](function(){_0x3f32cd[_0xba15('0x10')]=_0x335c26[_0xba15('0x38')][_0xba15('0x10')];_0x3f32cd[_0xba15('0x40')]=null;_0x3f32cd[_0xba15('0x41')]=null;return _0x3f32cd['save']();});})[_0xba15('0x17')](function(){_0x5e31f2[_0xba15('0x4a')](0xc8)[_0xba15('0x31')]({'message':_0xba15('0x54')});})['catch'](function(_0x3502ef){return handleError(_0x5e31f2,0x1f4,_0x3502ef);});};passport[_0xba15('0x55')](new LocalStrategy({'usernameField':_0xba15('0xf'),'passwordField':_0xba15('0x10')},function(_0x589f07,_0x20d2e3,_0x4d94d2){return localAuthenticate(db[_0xba15('0x4c')],_0x589f07,_0x20d2e3,_0x4d94d2);}));
\ No newline at end of file
index 5101aa8..03c0d04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58ce=['./authLocal.controller','login','post','/forgot','forgot','exports','express','Router'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x58ce,0xde));var _0xe58c=function(_0x44fbaa,_0x372026){_0x44fbaa=_0x44fbaa-0x0;var _0x2201e3=_0x58ce[_0x44fbaa];return _0x2201e3;};'use strict';var express=require(_0xe58c('0x0'));var router=express[_0xe58c('0x1')]();var controller=require(_0xe58c('0x2'));router['post']('/',controller[_0xe58c('0x3')]);router[_0xe58c('0x4')](_0xe58c('0x5'),controller[_0xe58c('0x6')]);router['post']('/reset/:token',controller['reset']);module[_0xe58c('0x7')]=router;
\ No newline at end of file
+var _0x7abc=['express','Router','post','login','/forgot','forgot','reset'];(function(_0x25b1f1,_0x314226){var _0x2be1ed=function(_0x4f4480){while(--_0x4f4480){_0x25b1f1['push'](_0x25b1f1['shift']());}};_0x2be1ed(++_0x314226);}(_0x7abc,0xa1));var _0xc7ab=function(_0x1b1211,_0x25a3ec){_0x1b1211=_0x1b1211-0x0;var _0x458eea=_0x7abc[_0x1b1211];return _0x458eea;};'use strict';var express=require(_0xc7ab('0x0'));var router=express[_0xc7ab('0x1')]();var controller=require('./authLocal.controller');router[_0xc7ab('0x2')]('/',controller[_0xc7ab('0x3')]);router[_0xc7ab('0x2')](_0xc7ab('0x4'),controller[_0xc7ab('0x5')]);router['post']('/reset/:token',controller[_0xc7ab('0x6')]);module['exports']=router;
\ No newline at end of file
index fba21be..6a73f56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f05=['STRING','INTEGER','sequelize','exports'];(function(_0x560c8d,_0x1cf910){var _0xb7e136=function(_0x203eb6){while(--_0x203eb6){_0x560c8d['push'](_0x560c8d['shift']());}};_0xb7e136(++_0x1cf910);}(_0x0f05,0x16e));var _0x50f0=function(_0x250c2c,_0x2149f8){_0x250c2c=_0x250c2c-0x0;var _0x164073=_0x0f05[_0x250c2c];return _0x164073;};'use strict';var Sequelize=require(_0x50f0('0x0'));module[_0x50f0('0x1')]={'name':{'type':Sequelize[_0x50f0('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x50f0('0x2')]},'description':{'type':Sequelize[_0x50f0('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x50f0('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xdf3e=['INTEGER','exports','STRING','BOOLEAN'];(function(_0x35debf,_0xc16156){var _0x103ae6=function(_0x52037f){while(--_0x52037f){_0x35debf['push'](_0x35debf['shift']());}};_0x103ae6(++_0xc16156);}(_0xdf3e,0x89));var _0xedf3=function(_0x25289c,_0x16ae20){_0x25289c=_0x25289c-0x0;var _0x48a71e=_0xdf3e[_0x25289c];return _0x48a71e;};'use strict';var Sequelize=require('sequelize');module[_0xedf3('0x0')]={'name':{'type':Sequelize[_0xedf3('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xedf3('0x1')]},'description':{'type':Sequelize[_0xedf3('0x1')]},'status':{'type':Sequelize[_0xedf3('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xedf3('0x3')],'defaultValue':0xa}};
\ No newline at end of file
index eec1d2d..cdc05d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x708c=['then','error','stack','name','send','map','Automation','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','destroy','addConditions','Condition','ids','omit','getConditions','findOne','hasOwnProperty','addActions','Action','getActions','rimraf','zip-dir','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject','save','update'];(function(_0x82140,_0x3a9d87){var _0x2b15a6=function(_0x2b565e){while(--_0x2b565e){_0x82140['push'](_0x82140['shift']());}};_0x2b15a6(++_0x3a9d87);}(_0x708c,0xd4));var _0xc708=function(_0x2634c1,_0x4bd833){_0x2634c1=_0x2634c1-0x0;var _0x2cd333=_0x708c[_0x2634c1];return _0x2cd333;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc708('0x0'));var zipdir=require(_0xc708('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc708('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc708('0x3'));var sox=require(_0xc708('0x4'));var csv=require(_0xc708('0x5'));var ejs=require(_0xc708('0x6'));var fs=require('fs');var fs_extra=require(_0xc708('0x7'));var _=require(_0xc708('0x8'));var squel=require(_0xc708('0x9'));var crypto=require('crypto');var jsforce=require(_0xc708('0xa'));var deskjs=require(_0xc708('0xb'));var toCsv=require(_0xc708('0x5'));var querystring=require(_0xc708('0xc'));var Papa=require(_0xc708('0xd'));var Redis=require(_0xc708('0xe'));var authService=require(_0xc708('0xf'));var qs=require(_0xc708('0x10'));var as=require(_0xc708('0x11'));var hardwareService=require(_0xc708('0x12'));var logger=require(_0xc708('0x13'))(_0xc708('0x14'));var utils=require(_0xc708('0x15'));var config=require(_0xc708('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc708('0x17'))['db'];function respondWithStatusCode(_0x5081b2,_0x22dc34){_0x22dc34=_0x22dc34||0xcc;return function(_0x131610){if(_0x131610){return _0x5081b2[_0xc708('0x18')](_0x22dc34);}return _0x5081b2[_0xc708('0x19')](_0x22dc34)[_0xc708('0x1a')]();};}function respondWithResult(_0x3706c1,_0x418eff){_0x418eff=_0x418eff||0xc8;return function(_0x8447e8){if(_0x8447e8){return _0x3706c1['status'](_0x418eff)[_0xc708('0x1b')](_0x8447e8);}};}function respondWithFilteredResult(_0x164d37,_0x5c99d8){return function(_0x167c25){if(_0x167c25){var _0x509faa=typeof _0x5c99d8[_0xc708('0x1c')]==='undefined'&&typeof _0x5c99d8['limit']==='undefined';var _0x11028a=_0x167c25[_0xc708('0x1d')];var _0x4c4d1d=_0x509faa?0x0:_0x5c99d8['offset'];var _0x4cb069=_0x509faa?_0x167c25['count']:_0x5c99d8[_0xc708('0x1c')]+_0x5c99d8[_0xc708('0x1e')];var _0x49a2d6;if(_0x4cb069>=_0x11028a){_0x4cb069=_0x11028a;_0x49a2d6=0xc8;}else{_0x49a2d6=0xce;}_0x164d37[_0xc708('0x19')](_0x49a2d6);return _0x164d37[_0xc708('0x1f')](_0xc708('0x20'),_0x4c4d1d+'-'+_0x4cb069+'/'+_0x11028a)[_0xc708('0x1b')](_0x167c25);}return null;};}function patchUpdates(_0x4b307a){return function(_0x12b213){try{jsonpatch[_0xc708('0x21')](_0x12b213,_0x4b307a,!![]);}catch(_0x432462){return BPromise[_0xc708('0x22')](_0x432462);}return _0x12b213[_0xc708('0x23')]();};}function saveUpdates(_0x455ac0,_0x29167a){return function(_0x19697e){if(_0x19697e){return _0x19697e[_0xc708('0x24')](_0x455ac0)[_0xc708('0x25')](function(_0x4b1674){return _0x4b1674;});}return null;};}function removeEntity(_0x5ede90,_0x8bc34b){return function(_0x3baa75){if(_0x3baa75){return _0x3baa75['destroy']()[_0xc708('0x25')](function(){_0x5ede90[_0xc708('0x19')](0xcc)[_0xc708('0x1a')]();});}};}function handleEntityNotFound(_0x497d72,_0x38cbfd){return function(_0x213627){if(!_0x213627){_0x497d72[_0xc708('0x18')](0x194);}return _0x213627;};}function handleError(_0x483420,_0x505278){_0x505278=_0x505278||0x1f4;return function(_0x1c3ecb){logger[_0xc708('0x26')](_0x1c3ecb[_0xc708('0x27')]);if(_0x1c3ecb[_0xc708('0x28')]){delete _0x1c3ecb[_0xc708('0x28')];}_0x483420[_0xc708('0x19')](_0x505278)[_0xc708('0x29')](_0x1c3ecb);};}exports['index']=function(_0x1dd21d,_0x22a4dd){var _0x276271={},_0x268494={},_0x41736d={'count':0x0,'rows':[]};var _0x1f19ac=_[_0xc708('0x2a')](db[_0xc708('0x2b')]['rawAttributes'],function(_0x6d8639){return{'name':_0x6d8639['fieldName'],'type':_0x6d8639['type'][_0xc708('0x2c')]};});_0x268494[_0xc708('0x2d')]=_[_0xc708('0x2a')](_0x1f19ac,'name');_0x268494[_0xc708('0x2e')]=_[_0xc708('0x2f')](_0x1dd21d[_0xc708('0x2e')]);_0x268494[_0xc708('0x30')]=_[_0xc708('0x31')](_0x268494[_0xc708('0x2d')],_0x268494[_0xc708('0x2e')]);_0x276271[_0xc708('0x32')]=_[_0xc708('0x31')](_0x268494['model'],qs[_0xc708('0x33')](_0x1dd21d['query'][_0xc708('0x33')]));_0x276271['attributes']=_0x276271[_0xc708('0x32')][_0xc708('0x34')]?_0x276271[_0xc708('0x32')]:_0x268494[_0xc708('0x2d')];if(!_0x1dd21d[_0xc708('0x2e')]['hasOwnProperty'](_0xc708('0x35'))){_0x276271[_0xc708('0x1e')]=qs[_0xc708('0x1e')](_0x1dd21d[_0xc708('0x2e')][_0xc708('0x1e')]);_0x276271['offset']=qs[_0xc708('0x1c')](_0x1dd21d['query'][_0xc708('0x1c')]);}_0x276271[_0xc708('0x36')]=qs[_0xc708('0x37')](_0x1dd21d['query'][_0xc708('0x37')]);_0x276271[_0xc708('0x38')]=qs[_0xc708('0x30')](_[_0xc708('0x39')](_0x1dd21d[_0xc708('0x2e')],_0x268494[_0xc708('0x30')]),_0x1f19ac);if(_0x1dd21d[_0xc708('0x2e')][_0xc708('0x3a')]){_0x276271['where']=_[_0xc708('0x3b')](_0x276271[_0xc708('0x38')],{'$or':_[_0xc708('0x2a')](_0x1f19ac,function(_0x598fc5){if(_0x598fc5[_0xc708('0x3c')]!=='VIRTUAL'){var _0x2c9164={};_0x2c9164[_0x598fc5[_0xc708('0x28')]]={'$like':'%'+_0x1dd21d['query'][_0xc708('0x3a')]+'%'};return _0x2c9164;}})});}_0x276271=_['merge']({},_0x276271,_0x1dd21d[_0xc708('0x3d')]);var _0x3d751d={'where':_0x276271['where']};return db[_0xc708('0x2b')][_0xc708('0x1d')](_0x3d751d)['then'](function(_0x3a4684){_0x41736d[_0xc708('0x1d')]=_0x3a4684;if(_0x1dd21d[_0xc708('0x2e')][_0xc708('0x3e')]){_0x276271[_0xc708('0x3f')]=[{'all':!![]}];}return db[_0xc708('0x2b')][_0xc708('0x40')](_0x276271);})[_0xc708('0x25')](function(_0x344858){_0x41736d[_0xc708('0x41')]=_0x344858;return _0x41736d;})[_0xc708('0x25')](respondWithFilteredResult(_0x22a4dd,_0x276271))[_0xc708('0x42')](handleError(_0x22a4dd,null));};exports['show']=function(_0x4a96af,_0xb21f91){var _0x31cfc0={'raw':![],'where':{'id':_0x4a96af[_0xc708('0x43')]['id']}},_0x1f18b9={};_0x1f18b9[_0xc708('0x2d')]=_[_0xc708('0x2f')](db[_0xc708('0x2b')][_0xc708('0x44')]);_0x1f18b9[_0xc708('0x2e')]=_[_0xc708('0x2f')](_0x4a96af[_0xc708('0x2e')]);_0x1f18b9[_0xc708('0x30')]=_[_0xc708('0x31')](_0x1f18b9['model'],_0x1f18b9[_0xc708('0x2e')]);_0x31cfc0[_0xc708('0x32')]=_[_0xc708('0x31')](_0x1f18b9[_0xc708('0x2d')],qs[_0xc708('0x33')](_0x4a96af[_0xc708('0x2e')][_0xc708('0x33')]));_0x31cfc0[_0xc708('0x32')]=_0x31cfc0[_0xc708('0x32')][_0xc708('0x34')]?_0x31cfc0[_0xc708('0x32')]:_0x1f18b9['model'];if(_0x4a96af[_0xc708('0x2e')][_0xc708('0x3e')]){_0x31cfc0[_0xc708('0x3f')]=[{'all':!![]}];}_0x31cfc0=_[_0xc708('0x3b')]({},_0x31cfc0,_0x4a96af[_0xc708('0x3d')]);return db[_0xc708('0x2b')][_0xc708('0x45')](_0x31cfc0)[_0xc708('0x25')](handleEntityNotFound(_0xb21f91,null))[_0xc708('0x25')](respondWithResult(_0xb21f91,null))[_0xc708('0x42')](handleError(_0xb21f91,null));};exports[_0xc708('0x46')]=function(_0x1df486,_0x5e4cab){return db[_0xc708('0x2b')]['create'](_0x1df486[_0xc708('0x47')],{})['then'](respondWithResult(_0x5e4cab,0xc9))['catch'](handleError(_0x5e4cab,null));};exports[_0xc708('0x24')]=function(_0x1514ae,_0x1a7392){if(_0x1514ae['body']['id']){delete _0x1514ae[_0xc708('0x47')]['id'];}return db['Automation'][_0xc708('0x45')]({'where':{'id':_0x1514ae['params']['id']}})['then'](handleEntityNotFound(_0x1a7392,null))[_0xc708('0x25')](saveUpdates(_0x1514ae[_0xc708('0x47')],null))[_0xc708('0x25')](respondWithResult(_0x1a7392,null))[_0xc708('0x42')](handleError(_0x1a7392,null));};exports[_0xc708('0x48')]=function(_0x3bad3a,_0x14df29){return db[_0xc708('0x2b')][_0xc708('0x45')]({'where':{'id':_0x3bad3a['params']['id']}})[_0xc708('0x25')](handleEntityNotFound(_0x14df29,null))[_0xc708('0x25')](removeEntity(_0x14df29,null))[_0xc708('0x42')](handleError(_0x14df29,null));};exports[_0xc708('0x49')]=function(_0x16fba9,_0x2af62b,_0x2d06e8){return db[_0xc708('0x4a')][_0xc708('0x45')]({'where':{'id':_0x16fba9[_0xc708('0x43')]['id']}})[_0xc708('0x25')](handleEntityNotFound(_0x2af62b,null))[_0xc708('0x25')](function(_0x496746){if(_0x496746){return _0x496746[_0xc708('0x49')](_0x16fba9[_0xc708('0x47')][_0xc708('0x4b')],_[_0xc708('0x4c')](_0x16fba9[_0xc708('0x47')],['ids','id'])||{});}})[_0xc708('0x25')](respondWithResult(_0x2af62b,null))[_0xc708('0x42')](handleError(_0x2af62b,null));};exports[_0xc708('0x4d')]=function(_0xdf3e39,_0xe1634c,_0x2381bf){var _0x19d07b={};var _0x3df97c={};var _0x2a93ef;var _0x2b8a74;return db[_0xc708('0x2b')][_0xc708('0x4e')]({'where':{'id':_0xdf3e39[_0xc708('0x43')]['id']}})[_0xc708('0x25')](handleEntityNotFound(_0xe1634c,null))[_0xc708('0x25')](function(_0x6509e8){if(_0x6509e8){_0x2a93ef=_0x6509e8;_0x3df97c[_0xc708('0x2d')]=_['keys'](db['Condition'][_0xc708('0x44')]);_0x3df97c[_0xc708('0x2e')]=_[_0xc708('0x2f')](_0xdf3e39[_0xc708('0x2e')]);_0x3df97c['filters']=_[_0xc708('0x31')](_0x3df97c[_0xc708('0x2d')],_0x3df97c[_0xc708('0x2e')]);_0x19d07b['attributes']=_[_0xc708('0x31')](_0x3df97c[_0xc708('0x2d')],qs[_0xc708('0x33')](_0xdf3e39['query']['fields']));_0x19d07b[_0xc708('0x32')]=_0x19d07b[_0xc708('0x32')]['length']?_0x19d07b['attributes']:_0x3df97c[_0xc708('0x2d')];_0x19d07b[_0xc708('0x36')]=qs[_0xc708('0x37')](_0xdf3e39['query'][_0xc708('0x37')]);_0x19d07b[_0xc708('0x38')]=qs[_0xc708('0x30')](_[_0xc708('0x39')](_0xdf3e39[_0xc708('0x2e')],_0x3df97c['filters']));if(_0xdf3e39[_0xc708('0x2e')][_0xc708('0x3a')]){_0x19d07b[_0xc708('0x38')]=_[_0xc708('0x3b')](_0x19d07b[_0xc708('0x38')],{'$or':_[_0xc708('0x2a')](_0x19d07b[_0xc708('0x32')],function(_0x4d492f){var _0x19e819={};_0x19e819[_0x4d492f]={'$like':'%'+_0xdf3e39[_0xc708('0x2e')][_0xc708('0x3a')]+'%'};return _0x19e819;})});}_0x19d07b=_[_0xc708('0x3b')]({},_0x19d07b,_0xdf3e39[_0xc708('0x3d')]);return _0x2a93ef[_0xc708('0x4d')](_0x19d07b);}})[_0xc708('0x25')](function(_0xc1b831){if(_0xc1b831){_0x2b8a74=_0xc1b831[_0xc708('0x34')];if(!_0xdf3e39[_0xc708('0x2e')][_0xc708('0x4f')]('nolimit')){_0x19d07b['limit']=qs[_0xc708('0x1e')](_0xdf3e39[_0xc708('0x2e')][_0xc708('0x1e')]);_0x19d07b['offset']=qs[_0xc708('0x1c')](_0xdf3e39[_0xc708('0x2e')][_0xc708('0x1c')]);}return _0x2a93ef['getConditions'](_0x19d07b);}})[_0xc708('0x25')](function(_0x86f819){if(_0x86f819){return _0x86f819?{'count':_0x2b8a74,'rows':_0x86f819}:null;}})['then'](respondWithResult(_0xe1634c,null))[_0xc708('0x42')](handleError(_0xe1634c,null));};exports[_0xc708('0x50')]=function(_0x1ef5b8,_0x50959c,_0xf21bbd){return db[_0xc708('0x51')][_0xc708('0x45')]({'where':{'id':_0x1ef5b8[_0xc708('0x43')]['id']}})[_0xc708('0x25')](handleEntityNotFound(_0x50959c,null))[_0xc708('0x25')](function(_0x2b93b6){if(_0x2b93b6){return _0x2b93b6['addActions'](_0x1ef5b8[_0xc708('0x47')]['ids'],_[_0xc708('0x4c')](_0x1ef5b8[_0xc708('0x47')],['ids','id'])||{});}})[_0xc708('0x25')](respondWithResult(_0x50959c,null))['catch'](handleError(_0x50959c,null));};exports[_0xc708('0x52')]=function(_0x41e5b6,_0x450605,_0x2c259d){var _0x55e787={};var _0x3b216a={};var _0x255b4c;var _0x245a3c;return db['Automation']['findOne']({'where':{'id':_0x41e5b6[_0xc708('0x43')]['id']}})[_0xc708('0x25')](handleEntityNotFound(_0x450605,null))['then'](function(_0x443002){if(_0x443002){_0x255b4c=_0x443002;_0x3b216a[_0xc708('0x2d')]=_[_0xc708('0x2f')](db[_0xc708('0x51')][_0xc708('0x44')]);_0x3b216a[_0xc708('0x2e')]=_['keys'](_0x41e5b6['query']);_0x3b216a[_0xc708('0x30')]=_[_0xc708('0x31')](_0x3b216a[_0xc708('0x2d')],_0x3b216a[_0xc708('0x2e')]);_0x55e787['attributes']=_[_0xc708('0x31')](_0x3b216a[_0xc708('0x2d')],qs[_0xc708('0x33')](_0x41e5b6[_0xc708('0x2e')][_0xc708('0x33')]));_0x55e787['attributes']=_0x55e787[_0xc708('0x32')][_0xc708('0x34')]?_0x55e787[_0xc708('0x32')]:_0x3b216a[_0xc708('0x2d')];_0x55e787[_0xc708('0x36')]=qs['sort'](_0x41e5b6[_0xc708('0x2e')]['sort']);_0x55e787[_0xc708('0x38')]=qs[_0xc708('0x30')](_[_0xc708('0x39')](_0x41e5b6['query'],_0x3b216a[_0xc708('0x30')]));if(_0x41e5b6[_0xc708('0x2e')]['filter']){_0x55e787[_0xc708('0x38')]=_[_0xc708('0x3b')](_0x55e787[_0xc708('0x38')],{'$or':_[_0xc708('0x2a')](_0x55e787[_0xc708('0x32')],function(_0x197b88){var _0x435806={};_0x435806[_0x197b88]={'$like':'%'+_0x41e5b6[_0xc708('0x2e')]['filter']+'%'};return _0x435806;})});}_0x55e787=_['merge']({},_0x55e787,_0x41e5b6[_0xc708('0x3d')]);return _0x255b4c[_0xc708('0x52')](_0x55e787);}})['then'](function(_0x11fd1a){if(_0x11fd1a){_0x245a3c=_0x11fd1a[_0xc708('0x34')];if(!_0x41e5b6[_0xc708('0x2e')][_0xc708('0x4f')](_0xc708('0x35'))){_0x55e787[_0xc708('0x1e')]=qs['limit'](_0x41e5b6['query'][_0xc708('0x1e')]);_0x55e787[_0xc708('0x1c')]=qs['offset'](_0x41e5b6[_0xc708('0x2e')]['offset']);}return _0x255b4c[_0xc708('0x52')](_0x55e787);}})[_0xc708('0x25')](function(_0x30cf73){if(_0x30cf73){return _0x30cf73?{'count':_0x245a3c,'rows':_0x30cf73}:null;}})['then'](respondWithResult(_0x450605,null))['catch'](handleError(_0x450605,null));};
\ No newline at end of file
+var _0x45fd=['fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Automation','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','create','body','find','addConditions','Condition','ids','omit','getConditions','findOne','rawAttributes','order','nolimit','addActions','getActions','eml-format','rimraf','zip-dir'];(function(_0x3daf35,_0x18a6f5){var _0x1cda00=function(_0x5cbecc){while(--_0x5cbecc){_0x3daf35['push'](_0x3daf35['shift']());}};_0x1cda00(++_0x18a6f5);}(_0x45fd,0xf9));var _0xd45f=function(_0x18e915,_0x4fe7bb){_0x18e915=_0x18e915-0x0;var _0x566734=_0x45fd[_0x18e915];return _0x566734;};'use strict';var emlformat=require(_0xd45f('0x0'));var rimraf=require(_0xd45f('0x1'));var zipdir=require(_0xd45f('0x2'));var jsonpatch=require(_0xd45f('0x3'));var rp=require(_0xd45f('0x4'));var moment=require(_0xd45f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd45f('0x6'));var path=require(_0xd45f('0x7'));var sox=require('sox');var csv=require(_0xd45f('0x8'));var ejs=require(_0xd45f('0x9'));var fs=require('fs');var fs_extra=require(_0xd45f('0xa'));var _=require('lodash');var squel=require(_0xd45f('0xb'));var crypto=require(_0xd45f('0xc'));var jsforce=require(_0xd45f('0xd'));var deskjs=require(_0xd45f('0xe'));var toCsv=require(_0xd45f('0x8'));var querystring=require(_0xd45f('0xf'));var Papa=require(_0xd45f('0x10'));var Redis=require(_0xd45f('0x11'));var authService=require(_0xd45f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd45f('0x13'));var hardwareService=require(_0xd45f('0x14'));var logger=require('../../config/logger')(_0xd45f('0x15'));var utils=require('../../config/utils');var config=require(_0xd45f('0x16'));var licenseUtil=require(_0xd45f('0x17'));var db=require(_0xd45f('0x18'))['db'];function respondWithStatusCode(_0x3ae01d,_0x438af0){_0x438af0=_0x438af0||0xcc;return function(_0x2ee37a){if(_0x2ee37a){return _0x3ae01d[_0xd45f('0x19')](_0x438af0);}return _0x3ae01d[_0xd45f('0x1a')](_0x438af0)['end']();};}function respondWithResult(_0x585d0e,_0x4aba48){_0x4aba48=_0x4aba48||0xc8;return function(_0x54bad8){if(_0x54bad8){return _0x585d0e[_0xd45f('0x1a')](_0x4aba48)['json'](_0x54bad8);}};}function respondWithFilteredResult(_0x90ce3b,_0x5831e6){return function(_0x20d4dc){if(_0x20d4dc){var _0x26b257=typeof _0x5831e6[_0xd45f('0x1b')]===_0xd45f('0x1c')&&typeof _0x5831e6[_0xd45f('0x1d')]===_0xd45f('0x1c');var _0x3681b8=_0x20d4dc['count'];var _0x2c1afe=_0x26b257?0x0:_0x5831e6[_0xd45f('0x1b')];var _0x52ca61=_0x26b257?_0x20d4dc[_0xd45f('0x1e')]:_0x5831e6[_0xd45f('0x1b')]+_0x5831e6[_0xd45f('0x1d')];var _0x50f9ea;if(_0x52ca61>=_0x3681b8){_0x52ca61=_0x3681b8;_0x50f9ea=0xc8;}else{_0x50f9ea=0xce;}_0x90ce3b[_0xd45f('0x1a')](_0x50f9ea);return _0x90ce3b['set'](_0xd45f('0x1f'),_0x2c1afe+'-'+_0x52ca61+'/'+_0x3681b8)[_0xd45f('0x20')](_0x20d4dc);}return null;};}function patchUpdates(_0xfc21d5){return function(_0x1c96c2){try{jsonpatch[_0xd45f('0x21')](_0x1c96c2,_0xfc21d5,!![]);}catch(_0x23f3f6){return BPromise[_0xd45f('0x22')](_0x23f3f6);}return _0x1c96c2[_0xd45f('0x23')]();};}function saveUpdates(_0x236751,_0x28c6d3){return function(_0x1274ba){if(_0x1274ba){return _0x1274ba[_0xd45f('0x24')](_0x236751)[_0xd45f('0x25')](function(_0x5e1bb7){return _0x5e1bb7;});}return null;};}function removeEntity(_0xd4ad2e,_0x26cffa){return function(_0xe75b13){if(_0xe75b13){return _0xe75b13[_0xd45f('0x26')]()[_0xd45f('0x25')](function(){_0xd4ad2e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x305077,_0x3071eb){return function(_0x36ea92){if(!_0x36ea92){_0x305077['sendStatus'](0x194);}return _0x36ea92;};}function handleError(_0x5d8f0c,_0x188bdc){_0x188bdc=_0x188bdc||0x1f4;return function(_0x423e1e){logger[_0xd45f('0x27')](_0x423e1e[_0xd45f('0x28')]);if(_0x423e1e[_0xd45f('0x29')]){delete _0x423e1e['name'];}_0x5d8f0c[_0xd45f('0x1a')](_0x188bdc)[_0xd45f('0x2a')](_0x423e1e);};}exports[_0xd45f('0x2b')]=function(_0x36e533,_0x20b9f6){var _0x42cf02={},_0x3da9e9={},_0x2eaad8={'count':0x0,'rows':[]};var _0xa6a924=_[_0xd45f('0x2c')](db[_0xd45f('0x2d')]['rawAttributes'],function(_0x10be95){return{'name':_0x10be95[_0xd45f('0x2e')],'type':_0x10be95['type'][_0xd45f('0x2f')]};});_0x3da9e9[_0xd45f('0x30')]=_[_0xd45f('0x2c')](_0xa6a924,_0xd45f('0x29'));_0x3da9e9[_0xd45f('0x31')]=_[_0xd45f('0x32')](_0x36e533[_0xd45f('0x31')]);_0x3da9e9['filters']=_[_0xd45f('0x33')](_0x3da9e9[_0xd45f('0x30')],_0x3da9e9['query']);_0x42cf02['attributes']=_['intersection'](_0x3da9e9[_0xd45f('0x30')],qs[_0xd45f('0x34')](_0x36e533[_0xd45f('0x31')][_0xd45f('0x34')]));_0x42cf02[_0xd45f('0x35')]=_0x42cf02['attributes'][_0xd45f('0x36')]?_0x42cf02[_0xd45f('0x35')]:_0x3da9e9[_0xd45f('0x30')];if(!_0x36e533['query'][_0xd45f('0x37')]('nolimit')){_0x42cf02['limit']=qs[_0xd45f('0x1d')](_0x36e533[_0xd45f('0x31')][_0xd45f('0x1d')]);_0x42cf02[_0xd45f('0x1b')]=qs[_0xd45f('0x1b')](_0x36e533[_0xd45f('0x31')]['offset']);}_0x42cf02['order']=qs['sort'](_0x36e533['query'][_0xd45f('0x38')]);_0x42cf02['where']=qs[_0xd45f('0x39')](_[_0xd45f('0x3a')](_0x36e533[_0xd45f('0x31')],_0x3da9e9['filters']),_0xa6a924);if(_0x36e533[_0xd45f('0x31')]['filter']){_0x42cf02[_0xd45f('0x3b')]=_[_0xd45f('0x3c')](_0x42cf02[_0xd45f('0x3b')],{'$or':_[_0xd45f('0x2c')](_0xa6a924,function(_0x324044){if(_0x324044['type']!==_0xd45f('0x3d')){var _0x363454={};_0x363454[_0x324044[_0xd45f('0x29')]]={'$like':'%'+_0x36e533[_0xd45f('0x31')][_0xd45f('0x3e')]+'%'};return _0x363454;}})});}_0x42cf02=_[_0xd45f('0x3c')]({},_0x42cf02,_0x36e533[_0xd45f('0x3f')]);var _0x1dc4ca={'where':_0x42cf02[_0xd45f('0x3b')]};return db[_0xd45f('0x2d')][_0xd45f('0x1e')](_0x1dc4ca)[_0xd45f('0x25')](function(_0x40d6ba){_0x2eaad8[_0xd45f('0x1e')]=_0x40d6ba;if(_0x36e533['query'][_0xd45f('0x40')]){_0x42cf02[_0xd45f('0x41')]=[{'all':!![]}];}return db[_0xd45f('0x2d')]['findAll'](_0x42cf02);})[_0xd45f('0x25')](function(_0x51b95a){_0x2eaad8[_0xd45f('0x42')]=_0x51b95a;return _0x2eaad8;})['then'](respondWithFilteredResult(_0x20b9f6,_0x42cf02))[_0xd45f('0x43')](handleError(_0x20b9f6,null));};exports[_0xd45f('0x44')]=function(_0x37c878,_0x3ac5d8){var _0x8d741b={'raw':![],'where':{'id':_0x37c878[_0xd45f('0x45')]['id']}},_0x4b4121={};_0x4b4121[_0xd45f('0x30')]=_['keys'](db[_0xd45f('0x2d')]['rawAttributes']);_0x4b4121[_0xd45f('0x31')]=_[_0xd45f('0x32')](_0x37c878[_0xd45f('0x31')]);_0x4b4121[_0xd45f('0x39')]=_[_0xd45f('0x33')](_0x4b4121['model'],_0x4b4121[_0xd45f('0x31')]);_0x8d741b[_0xd45f('0x35')]=_[_0xd45f('0x33')](_0x4b4121[_0xd45f('0x30')],qs[_0xd45f('0x34')](_0x37c878[_0xd45f('0x31')]['fields']));_0x8d741b['attributes']=_0x8d741b[_0xd45f('0x35')][_0xd45f('0x36')]?_0x8d741b[_0xd45f('0x35')]:_0x4b4121['model'];if(_0x37c878[_0xd45f('0x31')]['includeAll']){_0x8d741b[_0xd45f('0x41')]=[{'all':!![]}];}_0x8d741b=_['merge']({},_0x8d741b,_0x37c878['options']);return db['Automation']['find'](_0x8d741b)[_0xd45f('0x25')](handleEntityNotFound(_0x3ac5d8,null))['then'](respondWithResult(_0x3ac5d8,null))[_0xd45f('0x43')](handleError(_0x3ac5d8,null));};exports[_0xd45f('0x46')]=function(_0x12b6b4,_0x1e8348){return db[_0xd45f('0x2d')]['create'](_0x12b6b4[_0xd45f('0x47')],{})[_0xd45f('0x25')](respondWithResult(_0x1e8348,0xc9))[_0xd45f('0x43')](handleError(_0x1e8348,null));};exports[_0xd45f('0x24')]=function(_0x2ea6d7,_0xfe69d3){if(_0x2ea6d7[_0xd45f('0x47')]['id']){delete _0x2ea6d7[_0xd45f('0x47')]['id'];}return db[_0xd45f('0x2d')][_0xd45f('0x48')]({'where':{'id':_0x2ea6d7[_0xd45f('0x45')]['id']}})[_0xd45f('0x25')](handleEntityNotFound(_0xfe69d3,null))[_0xd45f('0x25')](saveUpdates(_0x2ea6d7[_0xd45f('0x47')],null))['then'](respondWithResult(_0xfe69d3,null))[_0xd45f('0x43')](handleError(_0xfe69d3,null));};exports[_0xd45f('0x26')]=function(_0x4e4a98,_0x1a4683){return db[_0xd45f('0x2d')][_0xd45f('0x48')]({'where':{'id':_0x4e4a98[_0xd45f('0x45')]['id']}})[_0xd45f('0x25')](handleEntityNotFound(_0x1a4683,null))['then'](removeEntity(_0x1a4683,null))[_0xd45f('0x43')](handleError(_0x1a4683,null));};exports[_0xd45f('0x49')]=function(_0x5d8230,_0x28d3fc,_0x27affe){return db[_0xd45f('0x4a')]['find']({'where':{'id':_0x5d8230[_0xd45f('0x45')]['id']}})[_0xd45f('0x25')](handleEntityNotFound(_0x28d3fc,null))['then'](function(_0x3837af){if(_0x3837af){return _0x3837af[_0xd45f('0x49')](_0x5d8230[_0xd45f('0x47')][_0xd45f('0x4b')],_[_0xd45f('0x4c')](_0x5d8230[_0xd45f('0x47')],['ids','id'])||{});}})[_0xd45f('0x25')](respondWithResult(_0x28d3fc,null))[_0xd45f('0x43')](handleError(_0x28d3fc,null));};exports[_0xd45f('0x4d')]=function(_0x28bd60,_0x3e7a07,_0x3cd02f){var _0x48d4b2={};var _0x49d74b={};var _0x538a2b;var _0x16c026;return db[_0xd45f('0x2d')][_0xd45f('0x4e')]({'where':{'id':_0x28bd60[_0xd45f('0x45')]['id']}})[_0xd45f('0x25')](handleEntityNotFound(_0x3e7a07,null))[_0xd45f('0x25')](function(_0x2dce8a){if(_0x2dce8a){_0x538a2b=_0x2dce8a;_0x49d74b[_0xd45f('0x30')]=_['keys'](db[_0xd45f('0x4a')][_0xd45f('0x4f')]);_0x49d74b[_0xd45f('0x31')]=_[_0xd45f('0x32')](_0x28bd60[_0xd45f('0x31')]);_0x49d74b[_0xd45f('0x39')]=_[_0xd45f('0x33')](_0x49d74b['model'],_0x49d74b[_0xd45f('0x31')]);_0x48d4b2[_0xd45f('0x35')]=_[_0xd45f('0x33')](_0x49d74b[_0xd45f('0x30')],qs[_0xd45f('0x34')](_0x28bd60[_0xd45f('0x31')][_0xd45f('0x34')]));_0x48d4b2[_0xd45f('0x35')]=_0x48d4b2['attributes'][_0xd45f('0x36')]?_0x48d4b2[_0xd45f('0x35')]:_0x49d74b[_0xd45f('0x30')];_0x48d4b2[_0xd45f('0x50')]=qs[_0xd45f('0x38')](_0x28bd60[_0xd45f('0x31')][_0xd45f('0x38')]);_0x48d4b2[_0xd45f('0x3b')]=qs[_0xd45f('0x39')](_[_0xd45f('0x3a')](_0x28bd60[_0xd45f('0x31')],_0x49d74b[_0xd45f('0x39')]));if(_0x28bd60[_0xd45f('0x31')][_0xd45f('0x3e')]){_0x48d4b2[_0xd45f('0x3b')]=_[_0xd45f('0x3c')](_0x48d4b2[_0xd45f('0x3b')],{'$or':_[_0xd45f('0x2c')](_0x48d4b2['attributes'],function(_0x1781b0){var _0x524a29={};_0x524a29[_0x1781b0]={'$like':'%'+_0x28bd60[_0xd45f('0x31')][_0xd45f('0x3e')]+'%'};return _0x524a29;})});}_0x48d4b2=_['merge']({},_0x48d4b2,_0x28bd60[_0xd45f('0x3f')]);return _0x538a2b[_0xd45f('0x4d')](_0x48d4b2);}})[_0xd45f('0x25')](function(_0x1c600d){if(_0x1c600d){_0x16c026=_0x1c600d[_0xd45f('0x36')];if(!_0x28bd60[_0xd45f('0x31')][_0xd45f('0x37')](_0xd45f('0x51'))){_0x48d4b2[_0xd45f('0x1d')]=qs[_0xd45f('0x1d')](_0x28bd60['query'][_0xd45f('0x1d')]);_0x48d4b2[_0xd45f('0x1b')]=qs[_0xd45f('0x1b')](_0x28bd60['query'][_0xd45f('0x1b')]);}return _0x538a2b[_0xd45f('0x4d')](_0x48d4b2);}})[_0xd45f('0x25')](function(_0x5aa1da){if(_0x5aa1da){return _0x5aa1da?{'count':_0x16c026,'rows':_0x5aa1da}:null;}})[_0xd45f('0x25')](respondWithResult(_0x3e7a07,null))['catch'](handleError(_0x3e7a07,null));};exports[_0xd45f('0x52')]=function(_0x3a85e5,_0x80d420,_0x3ee993){return db['Action'][_0xd45f('0x48')]({'where':{'id':_0x3a85e5['params']['id']}})[_0xd45f('0x25')](handleEntityNotFound(_0x80d420,null))[_0xd45f('0x25')](function(_0x182e09){if(_0x182e09){return _0x182e09[_0xd45f('0x52')](_0x3a85e5['body'][_0xd45f('0x4b')],_[_0xd45f('0x4c')](_0x3a85e5[_0xd45f('0x47')],[_0xd45f('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x80d420,null))['catch'](handleError(_0x80d420,null));};exports[_0xd45f('0x53')]=function(_0x3fb804,_0x1e33b3,_0x56ecfd){var _0xb2230f={};var _0x1b2a23={};var _0x49401a;var _0x1c868a;return db[_0xd45f('0x2d')]['findOne']({'where':{'id':_0x3fb804[_0xd45f('0x45')]['id']}})[_0xd45f('0x25')](handleEntityNotFound(_0x1e33b3,null))[_0xd45f('0x25')](function(_0x5751b5){if(_0x5751b5){_0x49401a=_0x5751b5;_0x1b2a23[_0xd45f('0x30')]=_[_0xd45f('0x32')](db['Action'][_0xd45f('0x4f')]);_0x1b2a23[_0xd45f('0x31')]=_[_0xd45f('0x32')](_0x3fb804[_0xd45f('0x31')]);_0x1b2a23[_0xd45f('0x39')]=_[_0xd45f('0x33')](_0x1b2a23[_0xd45f('0x30')],_0x1b2a23[_0xd45f('0x31')]);_0xb2230f[_0xd45f('0x35')]=_['intersection'](_0x1b2a23[_0xd45f('0x30')],qs[_0xd45f('0x34')](_0x3fb804[_0xd45f('0x31')]['fields']));_0xb2230f[_0xd45f('0x35')]=_0xb2230f['attributes']['length']?_0xb2230f[_0xd45f('0x35')]:_0x1b2a23[_0xd45f('0x30')];_0xb2230f['order']=qs[_0xd45f('0x38')](_0x3fb804[_0xd45f('0x31')][_0xd45f('0x38')]);_0xb2230f[_0xd45f('0x3b')]=qs[_0xd45f('0x39')](_[_0xd45f('0x3a')](_0x3fb804[_0xd45f('0x31')],_0x1b2a23['filters']));if(_0x3fb804[_0xd45f('0x31')][_0xd45f('0x3e')]){_0xb2230f[_0xd45f('0x3b')]=_[_0xd45f('0x3c')](_0xb2230f[_0xd45f('0x3b')],{'$or':_[_0xd45f('0x2c')](_0xb2230f[_0xd45f('0x35')],function(_0x862230){var _0x9bdf16={};_0x9bdf16[_0x862230]={'$like':'%'+_0x3fb804['query'][_0xd45f('0x3e')]+'%'};return _0x9bdf16;})});}_0xb2230f=_[_0xd45f('0x3c')]({},_0xb2230f,_0x3fb804[_0xd45f('0x3f')]);return _0x49401a[_0xd45f('0x53')](_0xb2230f);}})[_0xd45f('0x25')](function(_0x103697){if(_0x103697){_0x1c868a=_0x103697[_0xd45f('0x36')];if(!_0x3fb804[_0xd45f('0x31')][_0xd45f('0x37')]('nolimit')){_0xb2230f[_0xd45f('0x1d')]=qs[_0xd45f('0x1d')](_0x3fb804[_0xd45f('0x31')][_0xd45f('0x1d')]);_0xb2230f[_0xd45f('0x1b')]=qs['offset'](_0x3fb804[_0xd45f('0x31')][_0xd45f('0x1b')]);}return _0x49401a[_0xd45f('0x53')](_0xb2230f);}})[_0xd45f('0x25')](function(_0x386699){if(_0x386699){return _0x386699?{'count':_0x1c868a,'rows':_0x386699}:null;}})[_0xd45f('0x25')](respondWithResult(_0x1e33b3,null))['catch'](handleError(_0x1e33b3,null));};
\ No newline at end of file
index 7c1d111..749c6ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fbc=['moment','bluebird','request-promise','path','./automation.attributes','exports','define','tools_automations','lodash','../../config/logger','api'];(function(_0x519c88,_0xb84103){var _0x4668d7=function(_0x596c2c){while(--_0x596c2c){_0x519c88['push'](_0x519c88['shift']());}};_0x4668d7(++_0xb84103);}(_0x4fbc,0x168));var _0xc4fb=function(_0x1cb550,_0x6b2222){_0x1cb550=_0x1cb550-0x0;var _0x588b49=_0x4fbc[_0x1cb550];return _0x588b49;};'use strict';var _=require(_0xc4fb('0x0'));var util=require('util');var logger=require(_0xc4fb('0x1'))(_0xc4fb('0x2'));var moment=require(_0xc4fb('0x3'));var BPromise=require(_0xc4fb('0x4'));var rp=require(_0xc4fb('0x5'));var fs=require('fs');var path=require(_0xc4fb('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc4fb('0x7'));module[_0xc4fb('0x8')]=function(_0x4b2563,_0x5e192f){return _0x4b2563[_0xc4fb('0x9')]('Automation',attributes,{'tableName':_0xc4fb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5a65=['define','tools_automations','lodash','api','bluebird','request-promise','path','../../config/environment','./automation.attributes','exports'];(function(_0x14fad0,_0x278d75){var _0x5c665f=function(_0xe43a83){while(--_0xe43a83){_0x14fad0['push'](_0x14fad0['shift']());}};_0x5c665f(++_0x278d75);}(_0x5a65,0x156));var _0x55a6=function(_0x1cf20b,_0x118a35){_0x1cf20b=_0x1cf20b-0x0;var _0x31434a=_0x5a65[_0x1cf20b];return _0x31434a;};'use strict';var _=require(_0x55a6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x55a6('0x1'));var moment=require('moment');var BPromise=require(_0x55a6('0x2'));var rp=require(_0x55a6('0x3'));var fs=require('fs');var path=require(_0x55a6('0x4'));var rimraf=require('rimraf');var config=require(_0x55a6('0x5'));var attributes=require(_0x55a6('0x6'));module[_0x55a6('0x7')]=function(_0x28b2ea,_0x30793b){return _0x28b2ea[_0x55a6('0x8')]('Automation',attributes,{'tableName':_0x55a6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 020660a..13bea0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50a5=['info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x48efe5,_0x24d889){var _0x5962c2=function(_0x1ce132){while(--_0x1ce132){_0x48efe5['push'](_0x48efe5['shift']());}};_0x5962c2(++_0x24d889);}(_0x50a5,0xd1));var _0x550a=function(_0x5ac443,_0x284ba7){_0x5ac443=_0x5ac443-0x0;var _0x369aef=_0x50a5[_0x5ac443];return _0x369aef;};'use strict';var _=require(_0x550a('0x0'));var util=require(_0x550a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x550a('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x550a('0x3'))(_0x550a('0x4'));var config=require(_0x550a('0x5'));var jayson=require(_0x550a('0x6'));var client=jayson[_0x550a('0x7')][_0x550a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1983bf,_0x2596b7,_0x3e9984){return new BPromise(function(_0x329303,_0x434f2e){return client[_0x550a('0x9')](_0x1983bf,_0x3e9984)[_0x550a('0xa')](function(_0x5247ac){logger[_0x550a('0xb')](_0x550a('0xc'),_0x2596b7,_0x550a('0xd'));logger[_0x550a('0xe')](_0x550a('0xf'),_0x2596b7,_0x550a('0xd'),JSON['stringify'](_0x5247ac));if(_0x5247ac[_0x550a('0x10')]){if(_0x5247ac[_0x550a('0x10')][_0x550a('0x11')]===0x1f4){logger[_0x550a('0x10')](_0x550a('0xc'),_0x2596b7,_0x5247ac[_0x550a('0x10')][_0x550a('0x12')]);return _0x434f2e(_0x5247ac[_0x550a('0x10')]['message']);}logger[_0x550a('0x10')]('Automation,\x20%s,\x20%s',_0x2596b7,_0x5247ac['error'][_0x550a('0x12')]);return _0x329303(_0x5247ac[_0x550a('0x10')]['message']);}else{logger[_0x550a('0xb')]('Automation,\x20%s,\x20%s',_0x2596b7,_0x550a('0xd'));_0x329303(_0x5247ac['result'][_0x550a('0x12')]);}})[_0x550a('0x13')](function(_0x11994d){logger[_0x550a('0x10')](_0x550a('0xc'),_0x2596b7,_0x11994d);_0x434f2e(_0x11994d);});});}
\ No newline at end of file
+var _0x6e1c=['rpc','../../config/environment','jayson/promise','client','http','request','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x250ddd,_0x57e608){var _0xb42e9c=function(_0x10facc){while(--_0x10facc){_0x250ddd['push'](_0x250ddd['shift']());}};_0xb42e9c(++_0x57e608);}(_0x6e1c,0xb6));var _0xc6e1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e1c[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc6e1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc6e1('0x1'));var rs=require(_0xc6e1('0x2'));var fs=require('fs');var Redis=require(_0xc6e1('0x3'));var db=require(_0xc6e1('0x4'))['db'];var utils=require(_0xc6e1('0x5'));var logger=require(_0xc6e1('0x6'))(_0xc6e1('0x7'));var config=require(_0xc6e1('0x8'));var jayson=require(_0xc6e1('0x9'));var client=jayson[_0xc6e1('0xa')][_0xc6e1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5247f1,_0x3ff10c,_0x1242d5){return new BPromise(function(_0x39000a,_0x2ffee0){return client[_0xc6e1('0xc')](_0x5247f1,_0x1242d5)['then'](function(_0xa29af9){logger[_0xc6e1('0xd')](_0xc6e1('0xe'),_0x3ff10c,'request\x20sent');logger['debug'](_0xc6e1('0xf'),_0x3ff10c,_0xc6e1('0x10'),JSON['stringify'](_0xa29af9));if(_0xa29af9[_0xc6e1('0x11')]){if(_0xa29af9[_0xc6e1('0x11')][_0xc6e1('0x12')]===0x1f4){logger[_0xc6e1('0x11')](_0xc6e1('0xe'),_0x3ff10c,_0xa29af9[_0xc6e1('0x11')]['message']);return _0x2ffee0(_0xa29af9[_0xc6e1('0x11')][_0xc6e1('0x13')]);}logger[_0xc6e1('0x11')](_0xc6e1('0xe'),_0x3ff10c,_0xa29af9[_0xc6e1('0x11')]['message']);return _0x39000a(_0xa29af9['error'][_0xc6e1('0x13')]);}else{logger[_0xc6e1('0xd')]('Automation,\x20%s,\x20%s',_0x3ff10c,_0xc6e1('0x10'));_0x39000a(_0xa29af9[_0xc6e1('0x14')][_0xc6e1('0x13')]);}})['catch'](function(_0x44ef6c){logger[_0xc6e1('0x11')](_0xc6e1('0xe'),_0x3ff10c,_0x44ef6c);_0x2ffee0(_0x44ef6c);});});}
\ No newline at end of file
index f4f0cdb..7b4cd86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb70=['../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','show','getConditions','/:id/actions','post','create','/:id/conditions','addActions','put','exports','multer','util','fs-extra','../../components/auth/service'];(function(_0x2d9315,_0xc56bd0){var _0xb6039=function(_0x48a693){while(--_0x48a693){_0x2d9315['push'](_0x2d9315['shift']());}};_0xb6039(++_0xc56bd0);}(_0xcb70,0xf3));var _0x0cb7=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xcb70[_0x1b6186];return _0x186121;};'use strict';var multer=require(_0x0cb7('0x0'));var util=require(_0x0cb7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0cb7('0x2'));var auth=require(_0x0cb7('0x3'));var interaction=require(_0x0cb7('0x4'));var config=require(_0x0cb7('0x5'));var controller=require(_0x0cb7('0x6'));router[_0x0cb7('0x7')]('/',auth[_0x0cb7('0x8')](),controller['index']);router[_0x0cb7('0x7')](_0x0cb7('0x9'),auth[_0x0cb7('0x8')](),controller[_0x0cb7('0xa')]);router[_0x0cb7('0x7')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x0cb7('0xb')]);router[_0x0cb7('0x7')](_0x0cb7('0xc'),auth[_0x0cb7('0x8')](),controller['getActions']);router[_0x0cb7('0xd')]('/',auth[_0x0cb7('0x8')](),controller[_0x0cb7('0xe')]);router['post'](_0x0cb7('0xf'),auth[_0x0cb7('0x8')](),controller['addConditions']);router[_0x0cb7('0xd')](_0x0cb7('0xc'),auth[_0x0cb7('0x8')](),controller[_0x0cb7('0x10')]);router[_0x0cb7('0x11')](_0x0cb7('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x0cb7('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x0cb7('0x12')]=router;
\ No newline at end of file
+var _0x26c2=['addConditions','addActions','put','destroy','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','create','post'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x26c2,0x130));var _0x226c=function(_0x41caaf,_0x2c91c4){_0x41caaf=_0x41caaf-0x0;var _0x41a83d=_0x26c2[_0x41caaf];return _0x41a83d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x226c('0x0'));var express=require(_0x226c('0x1'));var router=express[_0x226c('0x2')]();var fs_extra=require(_0x226c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x226c('0x4'));var config=require(_0x226c('0x5'));var controller=require('./automation.controller');router[_0x226c('0x6')]('/',auth[_0x226c('0x7')](),controller[_0x226c('0x8')]);router[_0x226c('0x6')](_0x226c('0x9'),auth['isAuthenticated'](),controller[_0x226c('0xa')]);router[_0x226c('0x6')](_0x226c('0xb'),auth[_0x226c('0x7')](),controller[_0x226c('0xc')]);router['get'](_0x226c('0xd'),auth[_0x226c('0x7')](),controller['getActions']);router['post']('/',auth[_0x226c('0x7')](),controller[_0x226c('0xe')]);router[_0x226c('0xf')](_0x226c('0xb'),auth[_0x226c('0x7')](),controller[_0x226c('0x10')]);router[_0x226c('0xf')]('/:id/actions',auth['isAuthenticated'](),controller[_0x226c('0x11')]);router[_0x226c('0x12')](_0x226c('0x9'),auth[_0x226c('0x7')](),controller['update']);router['delete'](_0x226c('0x9'),auth[_0x226c('0x7')](),controller[_0x226c('0x13')]);module['exports']=router;
\ No newline at end of file
index 9e58cc6..5783802 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2961=['#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ENUM','ivr','STRING','Active/Disactive\x20Campaign','UNSIGNED','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x3a3b1e,_0x230f6d){var _0x583039=function(_0x527d4c){while(--_0x527d4c){_0x3a3b1e['push'](_0x3a3b1e['shift']());}};_0x583039(++_0x230f6d);}(_0x2961,0xb6));var _0x1296=function(_0x169dbd,_0x2f741a){_0x169dbd=_0x169dbd-0x0;var _0x282fc2=_0x2961[_0x169dbd];return _0x282fc2;};'use strict';var Sequelize=require(_0x1296('0x0'));module[_0x1296('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1296('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1296('0x3')](_0x1296('0x4')),'allowNull':![],'defaultValue':_0x1296('0x4')},'description':{'type':Sequelize[_0x1296('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1296('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x1296('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x1296('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1296('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0x1296('0x8')](0x3)[_0x1296('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1296('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1296('0x8')](0x3)[_0x1296('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1296('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1296('0x8')](0x5)[_0x1296('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1296('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x1296('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1296('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1296('0x8')](0x5)[_0x1296('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1296('0x8')](0x5)[_0x1296('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1296('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1296('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1296('0xe')},'dialTimezone':{'type':Sequelize[_0x1296('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1296('0x5')],'defaultValue':_0x1296('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x1296('0x3')](_0x1296('0x10'),_0x1296('0x11'),'onlyIfOpen'),'defaultValue':_0x1296('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1296('0x12')},'dialAMDInitialSilence':{'type':Sequelize[_0x1296('0x8')](0x9)[_0x1296('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1296('0x13')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x1296('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x1296('0x8')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1296('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1296('0x8')](0x9)[_0x1296('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1296('0x15')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1296('0x8')](0x9)[_0x1296('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1296('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1296('0x8')](0x9)[_0x1296('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1296('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1296('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1296('0x8')](0x9)[_0x1296('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x1296('0x18'),_0x1296('0x19')),'defaultValue':_0x1296('0x18')},'dialPrefix':{'type':Sequelize[_0x1296('0x5')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1296('0x8')](0x3)[_0x1296('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1296('0x1a')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1296('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x1296('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1296('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x1296('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1296('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x1296('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1296('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x1296('0x8')](0x5)[_0x1296('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1296('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1296('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x1296('0x8')](0x3)[_0x1296('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x1296('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1296('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1296('0x22')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1296('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1296('0x23')}};
\ No newline at end of file
+var _0xb700=['Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','ENUM','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','INTEGER'];(function(_0x29df9a,_0x42aff3){var _0x3a8e96=function(_0x70fbe7){while(--_0x70fbe7){_0x29df9a['push'](_0x29df9a['shift']());}};_0x3a8e96(++_0x42aff3);}(_0xb700,0x13d));var _0x0b70=function(_0x330414,_0x4f3207){_0x330414=_0x330414-0x0;var _0x99dbff=_0xb700[_0x330414];return _0x99dbff;};'use strict';var Sequelize=require(_0x0b70('0x0'));module['exports']={'name':{'type':Sequelize[_0x0b70('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0b70('0x2')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x0b70('0x3')],'defaultValue':0x0,'comment':_0x0b70('0x4')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x0b70('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0b70('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x0b70('0x6')](0x3)[_0x0b70('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b70('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0b70('0x6')](0x3)[_0x0b70('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b70('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0b70('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b70('0x9')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b70('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0b70('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b70('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0b70('0x6')](0x3)[_0x0b70('0x5')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b70('0xb')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0b70('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0b70('0xc')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0b70('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0b70('0xd'),_0x0b70('0xe'),_0x0b70('0xf')),'defaultValue':_0x0b70('0xd')},'dialAMDActive':{'type':Sequelize[_0x0b70('0x3')],'defaultValue':0x0,'comment':_0x0b70('0x10')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0b70('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x0b70('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0b70('0x11')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0b70('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0b70('0x6')](0x9)[_0x0b70('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0b70('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0x0b70('0x6')](0x9)[_0x0b70('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0b70('0x6')](0x9)[_0x0b70('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0b70('0x14')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0b70('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0b70('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0b70('0x6')](0x5)[_0x0b70('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0b70('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0b70('0x6')](0x9)[_0x0b70('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0b70('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0b70('0x2')](_0x0b70('0x18'),_0x0b70('0x19')),'defaultValue':_0x0b70('0x18')},'dialPrefix':{'type':Sequelize[_0x0b70('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0b70('0x6')](0x3)[_0x0b70('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0b70('0x1a')},'dialCutDigit':{'type':Sequelize[_0x0b70('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0b70('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0b70('0x6')](0x3)[_0x0b70('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b70('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0b70('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b70('0x1d')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b70('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x0b70('0x6')](0x5)[_0x0b70('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b70('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0b70('0x6')](0x3)[_0x0b70('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b70('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0b70('0x6')](0x5)[_0x0b70('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b70('0x21')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b70('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b70('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0b70('0x6')](0x5)[_0x0b70('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0b70('0x6')](0x3)[_0x0b70('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0b70('0x6')](0x5)[_0x0b70('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b70('0x23')}};
\ No newline at end of file
index c1b0147..9c91bd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ccb=['rawAttributes','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','body','role','UserProfileSection','destroy','getHoppers','findOne','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','findAll','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','createdAt','select','field','NOW()','toString','ListId','from','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','CmListId','cm_contacts','ListId\x20=\x20?','insert','push','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','eml-format','zip-dir','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','jsforce','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','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','IvrCampaigns','UserProfileResource','then','error','stack','name','send','index','map','Campaign','fieldName','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','rows','params','keys'];(function(_0x154f6a,_0x4c617b){var _0x833e6e=function(_0x255f83){while(--_0x255f83){_0x154f6a['push'](_0x154f6a['shift']());}};_0x833e6e(++_0x4c617b);}(_0x6ccb,0xc9));var _0xb6cc=function(_0x54218b,_0x456eca){_0x54218b=_0x54218b-0x0;var _0x54f8da=_0x6ccb[_0x54218b];return _0x54f8da;};'use strict';var emlformat=require(_0xb6cc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb6cc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb6cc('0x2'));var BPromise=require(_0xb6cc('0x3'));var Mustache=require('mustache');var util=require(_0xb6cc('0x4'));var path=require(_0xb6cc('0x5'));var sox=require('sox');var csv=require(_0xb6cc('0x6'));var ejs=require(_0xb6cc('0x7'));var fs=require('fs');var fs_extra=require(_0xb6cc('0x8'));var _=require(_0xb6cc('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb6cc('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xb6cc('0x6'));var querystring=require('querystring');var Papa=require(_0xb6cc('0xb'));var Redis=require(_0xb6cc('0xc'));var authService=require(_0xb6cc('0xd'));var qs=require(_0xb6cc('0xe'));var as=require(_0xb6cc('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb6cc('0x10'))(_0xb6cc('0x11'));var utils=require(_0xb6cc('0x12'));var config=require(_0xb6cc('0x13'));var licenseUtil=require(_0xb6cc('0x14'));var db=require(_0xb6cc('0x15'))['db'];function respondWithStatusCode(_0x6fc8b0,_0x5960ea){_0x5960ea=_0x5960ea||0xcc;return function(_0x5c9cd4){if(_0x5c9cd4){return _0x6fc8b0[_0xb6cc('0x16')](_0x5960ea);}return _0x6fc8b0[_0xb6cc('0x17')](_0x5960ea)[_0xb6cc('0x18')]();};}function respondWithResult(_0x16ec67,_0x35e602){_0x35e602=_0x35e602||0xc8;return function(_0x243537){if(_0x243537){return _0x16ec67[_0xb6cc('0x17')](_0x35e602)[_0xb6cc('0x19')](_0x243537);}};}function respondWithFilteredResult(_0x18b801,_0x50e3da){return function(_0x345878){if(_0x345878){var _0x4334f3=typeof _0x50e3da[_0xb6cc('0x1a')]===_0xb6cc('0x1b')&&typeof _0x50e3da[_0xb6cc('0x1c')]==='undefined';var _0x2c287f=_0x345878[_0xb6cc('0x1d')];var _0x8a2295=_0x4334f3?0x0:_0x50e3da['offset'];var _0x1b5d61=_0x4334f3?_0x345878[_0xb6cc('0x1d')]:_0x50e3da[_0xb6cc('0x1a')]+_0x50e3da['limit'];var _0x563733;if(_0x1b5d61>=_0x2c287f){_0x1b5d61=_0x2c287f;_0x563733=0xc8;}else{_0x563733=0xce;}_0x18b801[_0xb6cc('0x17')](_0x563733);return _0x18b801[_0xb6cc('0x1e')](_0xb6cc('0x1f'),_0x8a2295+'-'+_0x1b5d61+'/'+_0x2c287f)[_0xb6cc('0x19')](_0x345878);}return null;};}function patchUpdates(_0x2a81b7){return function(_0x157489){try{jsonpatch[_0xb6cc('0x20')](_0x157489,_0x2a81b7,!![]);}catch(_0x37afd3){return BPromise['reject'](_0x37afd3);}return _0x157489[_0xb6cc('0x21')]();};}function saveUpdates(_0x3f20ca,_0x23ceb7){return function(_0x48c65e){if(_0x48c65e){return _0x48c65e[_0xb6cc('0x22')](_0x3f20ca)['then'](function(_0x1f173a){return _0x1f173a;});}return null;};}function removeEntity(_0x271f38,_0x22470f){return function(_0x39a197){if(_0x39a197){return _0x39a197['destroy']()['then'](function(){var _0x4adb76=_0x39a197['get']({'plain':!![]});var _0x5ddfb4=_0xb6cc('0x23');return db[_0xb6cc('0x24')]['destroy']({'where':{'type':_0x5ddfb4,'resourceId':_0x4adb76['id']}})[_0xb6cc('0x25')](function(){return _0x39a197;});})[_0xb6cc('0x25')](function(){_0x271f38['status'](0xcc)[_0xb6cc('0x18')]();});}};}function handleEntityNotFound(_0x1506ff,_0x5e28d3){return function(_0x159cc0){if(!_0x159cc0){_0x1506ff[_0xb6cc('0x16')](0x194);}return _0x159cc0;};}function handleError(_0x28b951,_0x34b09e){_0x34b09e=_0x34b09e||0x1f4;return function(_0xf676f6){logger[_0xb6cc('0x26')](_0xf676f6[_0xb6cc('0x27')]);if(_0xf676f6['name']){delete _0xf676f6[_0xb6cc('0x28')];}_0x28b951[_0xb6cc('0x17')](_0x34b09e)[_0xb6cc('0x29')](_0xf676f6);};}exports[_0xb6cc('0x2a')]=function(_0x50aa51,_0x130b47){var _0x3d7e8f={},_0x89b079={},_0x434c={'count':0x0,'rows':[]};var _0x305027=_[_0xb6cc('0x2b')](db[_0xb6cc('0x2c')]['rawAttributes'],function(_0xededf6){return{'name':_0xededf6[_0xb6cc('0x2d')],'type':_0xededf6['type']['key']};});_0x89b079[_0xb6cc('0x2e')]=_['map'](_0x305027,_0xb6cc('0x28'));_0x89b079[_0xb6cc('0x2f')]=_['keys'](_0x50aa51[_0xb6cc('0x2f')]);_0x89b079[_0xb6cc('0x30')]=_['intersection'](_0x89b079[_0xb6cc('0x2e')],_0x89b079[_0xb6cc('0x2f')]);_0x3d7e8f[_0xb6cc('0x31')]=_[_0xb6cc('0x32')](_0x89b079['model'],qs[_0xb6cc('0x33')](_0x50aa51[_0xb6cc('0x2f')][_0xb6cc('0x33')]));_0x3d7e8f[_0xb6cc('0x31')]=_0x3d7e8f[_0xb6cc('0x31')][_0xb6cc('0x34')]?_0x3d7e8f['attributes']:_0x89b079['model'];if(!_0x50aa51[_0xb6cc('0x2f')][_0xb6cc('0x35')](_0xb6cc('0x36'))){_0x3d7e8f['limit']=qs[_0xb6cc('0x1c')](_0x50aa51[_0xb6cc('0x2f')][_0xb6cc('0x1c')]);_0x3d7e8f[_0xb6cc('0x1a')]=qs[_0xb6cc('0x1a')](_0x50aa51[_0xb6cc('0x2f')][_0xb6cc('0x1a')]);}_0x3d7e8f[_0xb6cc('0x37')]=qs[_0xb6cc('0x38')](_0x50aa51[_0xb6cc('0x2f')][_0xb6cc('0x38')]);_0x3d7e8f['where']=qs[_0xb6cc('0x30')](_[_0xb6cc('0x39')](_0x50aa51[_0xb6cc('0x2f')],_0x89b079['filters']),_0x305027);if(_0x50aa51[_0xb6cc('0x2f')][_0xb6cc('0x3a')]){_0x3d7e8f[_0xb6cc('0x3b')]=_[_0xb6cc('0x3c')](_0x3d7e8f[_0xb6cc('0x3b')],{'$or':_['map'](_0x305027,function(_0x260e6c){if(_0x260e6c['type']!=='VIRTUAL'){var _0x44792b={};_0x44792b[_0x260e6c[_0xb6cc('0x28')]]={'$like':'%'+_0x50aa51[_0xb6cc('0x2f')]['filter']+'%'};return _0x44792b;}})});}_0x3d7e8f=_['merge']({},_0x3d7e8f,_0x50aa51[_0xb6cc('0x3d')]);var _0x15fca3={'where':_0x3d7e8f[_0xb6cc('0x3b')]};return db[_0xb6cc('0x2c')][_0xb6cc('0x1d')](_0x15fca3)[_0xb6cc('0x25')](function(_0x163159){_0x434c[_0xb6cc('0x1d')]=_0x163159;if(_0x50aa51['query'][_0xb6cc('0x3e')]){_0x3d7e8f[_0xb6cc('0x3f')]=[{'all':!![]}];}return db[_0xb6cc('0x2c')]['findAll'](_0x3d7e8f);})[_0xb6cc('0x25')](function(_0x4f0d22){_0x434c[_0xb6cc('0x40')]=_0x4f0d22;return _0x434c;})[_0xb6cc('0x25')](respondWithFilteredResult(_0x130b47,_0x3d7e8f))['catch'](handleError(_0x130b47,null));};exports['show']=function(_0x5b8c59,_0x7a3934){var _0x2c7218={'raw':![],'where':{'id':_0x5b8c59[_0xb6cc('0x41')]['id']}},_0x2aa1dc={};_0x2aa1dc[_0xb6cc('0x2e')]=_[_0xb6cc('0x42')](db[_0xb6cc('0x2c')][_0xb6cc('0x43')]);_0x2aa1dc['query']=_[_0xb6cc('0x42')](_0x5b8c59[_0xb6cc('0x2f')]);_0x2aa1dc['filters']=_[_0xb6cc('0x32')](_0x2aa1dc[_0xb6cc('0x2e')],_0x2aa1dc[_0xb6cc('0x2f')]);_0x2c7218[_0xb6cc('0x31')]=_[_0xb6cc('0x32')](_0x2aa1dc['model'],qs['fields'](_0x5b8c59[_0xb6cc('0x2f')][_0xb6cc('0x33')]));_0x2c7218[_0xb6cc('0x31')]=_0x2c7218[_0xb6cc('0x31')][_0xb6cc('0x34')]?_0x2c7218[_0xb6cc('0x31')]:_0x2aa1dc[_0xb6cc('0x2e')];if(_0x5b8c59['query']['includeAll']){_0x2c7218[_0xb6cc('0x3f')]=[{'all':!![]}];}_0x2c7218=_['merge']({},_0x2c7218,_0x5b8c59['options']);return db[_0xb6cc('0x2c')][_0xb6cc('0x44')](_0x2c7218)[_0xb6cc('0x25')](handleEntityNotFound(_0x7a3934,null))[_0xb6cc('0x25')](respondWithResult(_0x7a3934,null))[_0xb6cc('0x45')](handleError(_0x7a3934,null));};exports[_0xb6cc('0x46')]=function(_0x2e8e3f,_0x18e70e){return db[_0xb6cc('0x2c')][_0xb6cc('0x46')](_0x2e8e3f['body'],{})['then'](function(_0x354e4a){var _0x369851=_0x2e8e3f[_0xb6cc('0x47')][_0xb6cc('0x48')]({'plain':!![]});if(!_0x369851)throw new Error(_0xb6cc('0x49'));if(_0x369851['role']===_0xb6cc('0x47')){var _0x4da830=_0x354e4a[_0xb6cc('0x48')]({'plain':!![]});var _0x21d1c6=_0xb6cc('0x23');return db['UserProfileSection']['find']({'where':{'name':_0x21d1c6,'userProfileId':_0x369851[_0xb6cc('0x4a')]},'raw':!![]})[_0xb6cc('0x25')](function(_0x35cb0f){if(_0x35cb0f&&_0x35cb0f[_0xb6cc('0x4b')]===0x0){return db[_0xb6cc('0x24')][_0xb6cc('0x46')]({'name':_0x4da830[_0xb6cc('0x28')],'resourceId':_0x4da830['id'],'type':_0x35cb0f[_0xb6cc('0x28')],'sectionId':_0x35cb0f['id']},{})[_0xb6cc('0x25')](function(){return _0x354e4a;});}else{return _0x354e4a;}})['catch'](function(_0x239b87){logger['error'](_0xb6cc('0x4c'),_0x239b87);throw _0x239b87;});}return _0x354e4a;})[_0xb6cc('0x25')](respondWithResult(_0x18e70e,0xc9))[_0xb6cc('0x45')](handleError(_0x18e70e,null));};exports[_0xb6cc('0x4d')]=function(_0x7bbb71,_0x261139){var _0x3c0fcb={'where':{'id':_0x7bbb71[_0xb6cc('0x41')]['id']}},_0x158a55={};_0x158a55[_0xb6cc('0x2e')]=_[_0xb6cc('0x42')](db[_0xb6cc('0x2c')][_0xb6cc('0x43')]);_0x3c0fcb[_0xb6cc('0x31')]=_[_0xb6cc('0x32')](_0x158a55[_0xb6cc('0x2e')],qs[_0xb6cc('0x33')](_0x7bbb71[_0xb6cc('0x2f')][_0xb6cc('0x33')]));_0x3c0fcb['attributes']=_0x3c0fcb['attributes'][_0xb6cc('0x34')]?_0x3c0fcb[_0xb6cc('0x31')]:_0x158a55['model'];if(_0x7bbb71[_0xb6cc('0x2f')][_0xb6cc('0x3e')]){_0x3c0fcb['include']=[{'all':!![]}];}_0x3c0fcb=_[_0xb6cc('0x3c')]({},_0x3c0fcb,_0x7bbb71[_0xb6cc('0x3d')]);return db[_0xb6cc('0x2c')][_0xb6cc('0x44')](_0x3c0fcb)[_0xb6cc('0x25')](handleEntityNotFound(_0x261139,null))[_0xb6cc('0x25')](function(_0x23da13){if(_0x23da13){var _0x376c78=_0x23da13[_0xb6cc('0x48')]({'plain':!![]});_0x376c78=qs[_0xb6cc('0x4e')](_0x376c78,['id','createdAt',_0xb6cc('0x4f')]);_0x7bbb71[_0xb6cc('0x50')]=_[_0xb6cc('0x4e')](_0x7bbb71[_0xb6cc('0x50')],['id','createdAt','updatedAt']);return db[_0xb6cc('0x2c')][_0xb6cc('0x46')](_['merge'](_0x376c78,_0x7bbb71['body']),{'include':_0x7bbb71[_0xb6cc('0x2f')][_0xb6cc('0x3e')]?[{'all':!![]}]:undefined})['then'](function(_0xe30e32){var _0x2e2669=_0x7bbb71[_0xb6cc('0x47')][_0xb6cc('0x48')]({'plain':!![]});if(!_0x2e2669)throw new Error(_0xb6cc('0x49'));if(_0x2e2669[_0xb6cc('0x51')]===_0xb6cc('0x47')){var _0x24ace9=_0xe30e32[_0xb6cc('0x48')]({'plain':!![]});var _0x173fe6=_0xb6cc('0x23');return db[_0xb6cc('0x52')]['find']({'where':{'name':_0x173fe6,'userProfileId':_0x2e2669[_0xb6cc('0x4a')]},'raw':!![]})[_0xb6cc('0x25')](function(_0x579653){if(_0x579653&&_0x579653[_0xb6cc('0x4b')]===0x0){return db['UserProfileResource'][_0xb6cc('0x46')]({'name':_0x24ace9[_0xb6cc('0x28')],'resourceId':_0x24ace9['id'],'type':_0x579653[_0xb6cc('0x28')],'sectionId':_0x579653['id']},{})[_0xb6cc('0x25')](function(){return _0xe30e32;});}else{return _0xe30e32;}})[_0xb6cc('0x45')](function(_0x560cd5){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x560cd5);throw _0x560cd5;});}return _0xe30e32;});}})[_0xb6cc('0x25')](respondWithResult(_0x261139,0xc9))[_0xb6cc('0x45')](handleError(_0x261139,null));};exports[_0xb6cc('0x22')]=function(_0x23c605,_0x2712bc){if(_0x23c605[_0xb6cc('0x50')]['id']){delete _0x23c605[_0xb6cc('0x50')]['id'];}return db[_0xb6cc('0x2c')][_0xb6cc('0x44')]({'where':{'id':_0x23c605[_0xb6cc('0x41')]['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0x2712bc,null))['then'](saveUpdates(_0x23c605['body'],null))[_0xb6cc('0x25')](respondWithResult(_0x2712bc,null))['catch'](handleError(_0x2712bc,null));};exports[_0xb6cc('0x53')]=function(_0x4b55fd,_0x54d1c1){return db[_0xb6cc('0x2c')][_0xb6cc('0x44')]({'where':{'id':_0x4b55fd['params']['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0x54d1c1,null))[_0xb6cc('0x25')](removeEntity(_0x54d1c1,null))[_0xb6cc('0x45')](handleError(_0x54d1c1,null));};exports[_0xb6cc('0x54')]=function(_0x42ce68,_0xa82a45,_0x5803f6){var _0x47f83c={'raw':!![],'where':{}};var _0x1aa2fa={};var _0x84b5f7={'count':0x0,'rows':[]};return db[_0xb6cc('0x2c')][_0xb6cc('0x55')]({'where':{'id':_0x42ce68[_0xb6cc('0x41')]['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0xa82a45,null))[_0xb6cc('0x25')](function(_0x3010b3){if(_0x3010b3){_0x1aa2fa[_0xb6cc('0x2e')]=_[_0xb6cc('0x42')](db['CmHopper'][_0xb6cc('0x43')]);_0x1aa2fa['query']=_[_0xb6cc('0x42')](_0x42ce68[_0xb6cc('0x2f')]);_0x1aa2fa['filters']=_[_0xb6cc('0x32')](_0x1aa2fa['model'],_0x1aa2fa[_0xb6cc('0x2f')]);_0x47f83c[_0xb6cc('0x31')]=_[_0xb6cc('0x32')](_0x1aa2fa[_0xb6cc('0x2e')],qs[_0xb6cc('0x33')](_0x42ce68[_0xb6cc('0x2f')]['fields']));_0x47f83c[_0xb6cc('0x31')]=_0x47f83c['attributes']['length']?_0x47f83c[_0xb6cc('0x31')]:_0x1aa2fa[_0xb6cc('0x2e')];if(!_0x42ce68[_0xb6cc('0x2f')]['hasOwnProperty'](_0xb6cc('0x36'))){_0x47f83c[_0xb6cc('0x1c')]=qs[_0xb6cc('0x1c')](_0x42ce68[_0xb6cc('0x2f')][_0xb6cc('0x1c')]);_0x47f83c[_0xb6cc('0x1a')]=qs[_0xb6cc('0x1a')](_0x42ce68[_0xb6cc('0x2f')]['offset']);}_0x47f83c[_0xb6cc('0x37')]=qs[_0xb6cc('0x38')](_0x42ce68[_0xb6cc('0x2f')][_0xb6cc('0x38')]);_0x47f83c[_0xb6cc('0x3b')]=qs['filters'](_[_0xb6cc('0x39')](_0x42ce68[_0xb6cc('0x2f')],_0x1aa2fa[_0xb6cc('0x30')]));_0x47f83c[_0xb6cc('0x3b')][_0xb6cc('0x56')]=_0x3010b3['id'];if(_0x42ce68[_0xb6cc('0x2f')][_0xb6cc('0x3a')]){_0x47f83c[_0xb6cc('0x3b')]=_['merge'](_0x47f83c[_0xb6cc('0x3b')],{'$or':_[_0xb6cc('0x2b')](_0x47f83c['attributes'],function(_0x432c5d){var _0x11a6d4={};_0x11a6d4[_0x432c5d]={'$like':'%'+_0x42ce68[_0xb6cc('0x2f')]['filter']+'%'};return _0x11a6d4;})});}_0x47f83c=_[_0xb6cc('0x3c')]({},_0x47f83c,_0x42ce68[_0xb6cc('0x3d')]);return db[_0xb6cc('0x57')]['count']({'where':_0x47f83c[_0xb6cc('0x3b')]})[_0xb6cc('0x25')](function(_0xf48fcd){_0x84b5f7[_0xb6cc('0x1d')]=_0xf48fcd;if(_0x42ce68[_0xb6cc('0x2f')][_0xb6cc('0x3e')]){_0x47f83c[_0xb6cc('0x3f')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x47f83c);})[_0xb6cc('0x25')](function(_0x10c99e){_0x84b5f7[_0xb6cc('0x40')]=_0x10c99e;return _0x84b5f7;});}})[_0xb6cc('0x25')](respondWithFilteredResult(_0xa82a45,_0x47f83c))[_0xb6cc('0x45')](handleError(_0xa82a45,null));};exports[_0xb6cc('0x58')]=function(_0x1760fa,_0x235e52,_0x331795){var _0xba0742={'raw':!![],'where':{}};var _0x2b8761={};var _0xdcc4fc={'count':0x0,'rows':[]};return db[_0xb6cc('0x2c')][_0xb6cc('0x55')]({'where':{'id':_0x1760fa[_0xb6cc('0x41')]['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0x235e52,null))[_0xb6cc('0x25')](function(_0x37b83f){if(_0x37b83f){_0x2b8761[_0xb6cc('0x2e')]=_[_0xb6cc('0x42')](db[_0xb6cc('0x59')][_0xb6cc('0x43')]);_0x2b8761[_0xb6cc('0x2f')]=_[_0xb6cc('0x42')](_0x1760fa[_0xb6cc('0x2f')]);_0x2b8761['filters']=_[_0xb6cc('0x32')](_0x2b8761['model'],_0x2b8761[_0xb6cc('0x2f')]);_0xba0742['attributes']=_[_0xb6cc('0x32')](_0x2b8761[_0xb6cc('0x2e')],qs[_0xb6cc('0x33')](_0x1760fa[_0xb6cc('0x2f')][_0xb6cc('0x33')]));_0xba0742[_0xb6cc('0x31')]=_0xba0742[_0xb6cc('0x31')][_0xb6cc('0x34')]?_0xba0742[_0xb6cc('0x31')]:_0x2b8761[_0xb6cc('0x2e')];if(!_0x1760fa['query'][_0xb6cc('0x35')]('nolimit')){_0xba0742['limit']=qs['limit'](_0x1760fa[_0xb6cc('0x2f')]['limit']);_0xba0742[_0xb6cc('0x1a')]=qs[_0xb6cc('0x1a')](_0x1760fa['query'][_0xb6cc('0x1a')]);}_0xba0742['order']=qs[_0xb6cc('0x38')](_0x1760fa[_0xb6cc('0x2f')][_0xb6cc('0x38')]);_0xba0742['where']=qs[_0xb6cc('0x30')](_['pick'](_0x1760fa['query'],_0x2b8761[_0xb6cc('0x30')]));_0xba0742[_0xb6cc('0x3b')][_0xb6cc('0x56')]=_0x37b83f['id'];if(_0x1760fa[_0xb6cc('0x2f')][_0xb6cc('0x3a')]){_0xba0742[_0xb6cc('0x3b')]=_[_0xb6cc('0x3c')](_0xba0742[_0xb6cc('0x3b')],{'$or':_['map'](_0xba0742[_0xb6cc('0x31')],function(_0x48f13c){var _0x550c3a={};_0x550c3a[_0x48f13c]={'$like':'%'+_0x1760fa[_0xb6cc('0x2f')][_0xb6cc('0x3a')]+'%'};return _0x550c3a;})});}_0xba0742=_[_0xb6cc('0x3c')]({},_0xba0742,_0x1760fa['options']);return db[_0xb6cc('0x59')][_0xb6cc('0x1d')]({'where':_0xba0742[_0xb6cc('0x3b')]})[_0xb6cc('0x25')](function(_0x1f1f8d){_0xdcc4fc[_0xb6cc('0x1d')]=_0x1f1f8d;if(_0x1760fa[_0xb6cc('0x2f')][_0xb6cc('0x3e')]){_0xba0742[_0xb6cc('0x3f')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0xba0742);})['then'](function(_0x59e58b){_0xdcc4fc[_0xb6cc('0x40')]=_0x59e58b;return _0xdcc4fc;});}})[_0xb6cc('0x25')](respondWithFilteredResult(_0x235e52,_0xba0742))[_0xb6cc('0x45')](handleError(_0x235e52,null));};exports[_0xb6cc('0x5a')]=function(_0xfd9ec4,_0x10fa67,_0x5c2f00){var _0xb5aec3={'raw':!![],'where':{}};var _0x53e468={};var _0x9966c8={'count':0x0,'rows':[]};return db[_0xb6cc('0x2c')][_0xb6cc('0x55')]({'where':{'id':_0xfd9ec4['params']['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0x10fa67,null))[_0xb6cc('0x25')](function(_0x53aea7){if(_0x53aea7){_0x53e468[_0xb6cc('0x2e')]=_[_0xb6cc('0x42')](db[_0xb6cc('0x5b')][_0xb6cc('0x43')]);_0x53e468[_0xb6cc('0x2f')]=_[_0xb6cc('0x42')](_0xfd9ec4[_0xb6cc('0x2f')]);_0x53e468[_0xb6cc('0x30')]=_[_0xb6cc('0x32')](_0x53e468[_0xb6cc('0x2e')],_0x53e468['query']);_0xb5aec3[_0xb6cc('0x31')]=_[_0xb6cc('0x32')](_0x53e468['model'],qs[_0xb6cc('0x33')](_0xfd9ec4[_0xb6cc('0x2f')][_0xb6cc('0x33')]));_0xb5aec3['attributes']=_0xb5aec3['attributes'][_0xb6cc('0x34')]?_0xb5aec3[_0xb6cc('0x31')]:_0x53e468[_0xb6cc('0x2e')];if(!_0xfd9ec4[_0xb6cc('0x2f')][_0xb6cc('0x35')]('nolimit')){_0xb5aec3['limit']=qs[_0xb6cc('0x1c')](_0xfd9ec4[_0xb6cc('0x2f')][_0xb6cc('0x1c')]);_0xb5aec3['offset']=qs['offset'](_0xfd9ec4[_0xb6cc('0x2f')]['offset']);}_0xb5aec3[_0xb6cc('0x37')]=qs[_0xb6cc('0x38')](_0xfd9ec4[_0xb6cc('0x2f')]['sort']);_0xb5aec3['where']=qs[_0xb6cc('0x30')](_[_0xb6cc('0x39')](_0xfd9ec4[_0xb6cc('0x2f')],_0x53e468[_0xb6cc('0x30')]));_0xb5aec3[_0xb6cc('0x3b')]['CampaignId']=_0x53aea7['id'];if(_0xfd9ec4[_0xb6cc('0x2f')]['filter']){_0xb5aec3[_0xb6cc('0x3b')]=_[_0xb6cc('0x3c')](_0xb5aec3[_0xb6cc('0x3b')],{'$or':_[_0xb6cc('0x2b')](_0xb5aec3[_0xb6cc('0x31')],function(_0x3385f0){var _0x23a8b3={};_0x23a8b3[_0x3385f0]={'$like':'%'+_0xfd9ec4[_0xb6cc('0x2f')][_0xb6cc('0x3a')]+'%'};return _0x23a8b3;})});}_0xb5aec3=_[_0xb6cc('0x3c')]({},_0xb5aec3,_0xfd9ec4['options']);return db[_0xb6cc('0x5b')][_0xb6cc('0x1d')]({'where':_0xb5aec3[_0xb6cc('0x3b')]})[_0xb6cc('0x25')](function(_0x319ba5){_0x9966c8['count']=_0x319ba5;if(_0xfd9ec4[_0xb6cc('0x2f')][_0xb6cc('0x3e')]){_0xb5aec3['include']=[{'all':!![]}];}return db[_0xb6cc('0x5b')][_0xb6cc('0x5c')](_0xb5aec3);})[_0xb6cc('0x25')](function(_0x14ad5c){_0x9966c8[_0xb6cc('0x40')]=_0x14ad5c;return _0x9966c8;});}})['then'](respondWithFilteredResult(_0x10fa67,_0xb5aec3))[_0xb6cc('0x45')](handleError(_0x10fa67,null));};exports[_0xb6cc('0x5d')]=function(_0x4ce81d,_0x30e09e,_0x1e4827){var _0x317b40={'raw':!![],'where':{}};var _0x53c114={};var _0x4efd48={'count':0x0,'rows':[]};return db[_0xb6cc('0x2c')][_0xb6cc('0x55')]({'where':{'id':_0x4ce81d[_0xb6cc('0x41')]['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0x30e09e,null))[_0xb6cc('0x25')](function(_0x5248c1){if(_0x5248c1){_0x53c114[_0xb6cc('0x2e')]=_['keys'](db['CmHopperBlack']['rawAttributes']);_0x53c114[_0xb6cc('0x2f')]=_['keys'](_0x4ce81d[_0xb6cc('0x2f')]);_0x53c114[_0xb6cc('0x30')]=_['intersection'](_0x53c114[_0xb6cc('0x2e')],_0x53c114[_0xb6cc('0x2f')]);_0x317b40[_0xb6cc('0x31')]=_[_0xb6cc('0x32')](_0x53c114[_0xb6cc('0x2e')],qs['fields'](_0x4ce81d['query'][_0xb6cc('0x33')]));_0x317b40[_0xb6cc('0x31')]=_0x317b40[_0xb6cc('0x31')][_0xb6cc('0x34')]?_0x317b40[_0xb6cc('0x31')]:_0x53c114[_0xb6cc('0x2e')];if(!_0x4ce81d[_0xb6cc('0x2f')][_0xb6cc('0x35')]('nolimit')){_0x317b40['limit']=qs[_0xb6cc('0x1c')](_0x4ce81d['query'][_0xb6cc('0x1c')]);_0x317b40[_0xb6cc('0x1a')]=qs[_0xb6cc('0x1a')](_0x4ce81d['query'][_0xb6cc('0x1a')]);}_0x317b40['order']=qs[_0xb6cc('0x38')](_0x4ce81d['query']['sort']);_0x317b40[_0xb6cc('0x3b')]=qs[_0xb6cc('0x30')](_['pick'](_0x4ce81d[_0xb6cc('0x2f')],_0x53c114['filters']));_0x317b40[_0xb6cc('0x3b')][_0xb6cc('0x56')]=_0x5248c1['id'];if(_0x4ce81d[_0xb6cc('0x2f')][_0xb6cc('0x3a')]){_0x317b40['where']=_[_0xb6cc('0x3c')](_0x317b40[_0xb6cc('0x3b')],{'$or':_[_0xb6cc('0x2b')](_0x317b40[_0xb6cc('0x31')],function(_0x1ef7a2){var _0x4b8aa1={};_0x4b8aa1[_0x1ef7a2]={'$like':'%'+_0x4ce81d['query'][_0xb6cc('0x3a')]+'%'};return _0x4b8aa1;})});}_0x317b40=_[_0xb6cc('0x3c')]({},_0x317b40,_0x4ce81d[_0xb6cc('0x3d')]);return db['CmHopperBlack'][_0xb6cc('0x1d')]({'where':_0x317b40[_0xb6cc('0x3b')]})[_0xb6cc('0x25')](function(_0x3e6156){_0x4efd48['count']=_0x3e6156;if(_0x4ce81d[_0xb6cc('0x2f')][_0xb6cc('0x3e')]){_0x317b40[_0xb6cc('0x3f')]=[{'all':!![]}];}return db[_0xb6cc('0x5e')][_0xb6cc('0x5c')](_0x317b40);})['then'](function(_0xdcf81a){_0x4efd48[_0xb6cc('0x40')]=_0xdcf81a;return _0x4efd48;});}})[_0xb6cc('0x25')](respondWithFilteredResult(_0x30e09e,_0x317b40))[_0xb6cc('0x45')](handleError(_0x30e09e,null));};exports[_0xb6cc('0x5f')]=function(_0x2fdc61,_0xb2b7dc,_0x54ef25){var _0x11ef9d={};var _0x185cad={};var _0x4b7548;var _0x1d82e9;return db['Campaign']['findOne']({'where':{'id':_0x2fdc61[_0xb6cc('0x41')]['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0xb2b7dc,null))['then'](function(_0x27b706){if(_0x27b706){_0x4b7548=_0x27b706;_0x185cad[_0xb6cc('0x2e')]=_[_0xb6cc('0x42')](db['CmList']['rawAttributes']);_0x185cad[_0xb6cc('0x2f')]=_['keys'](_0x2fdc61['query']);_0x185cad[_0xb6cc('0x30')]=_[_0xb6cc('0x32')](_0x185cad[_0xb6cc('0x2e')],_0x185cad[_0xb6cc('0x2f')]);_0x11ef9d['attributes']=_['intersection'](_0x185cad['model'],qs[_0xb6cc('0x33')](_0x2fdc61[_0xb6cc('0x2f')][_0xb6cc('0x33')]));_0x11ef9d['attributes']=_0x11ef9d[_0xb6cc('0x31')][_0xb6cc('0x34')]?_0x11ef9d[_0xb6cc('0x31')]:_0x185cad[_0xb6cc('0x2e')];_0x11ef9d[_0xb6cc('0x37')]=qs[_0xb6cc('0x38')](_0x2fdc61[_0xb6cc('0x2f')][_0xb6cc('0x38')]);_0x11ef9d[_0xb6cc('0x3b')]=qs['filters'](_[_0xb6cc('0x39')](_0x2fdc61['query'],_0x185cad[_0xb6cc('0x30')]));if(_0x2fdc61[_0xb6cc('0x2f')][_0xb6cc('0x3a')]){_0x11ef9d[_0xb6cc('0x3b')]=_['merge'](_0x11ef9d['where'],{'$or':_[_0xb6cc('0x2b')](_0x11ef9d[_0xb6cc('0x31')],function(_0x4ba31e){var _0x47addc={};_0x47addc[_0x4ba31e]={'$like':'%'+_0x2fdc61[_0xb6cc('0x2f')][_0xb6cc('0x3a')]+'%'};return _0x47addc;})});}_0x11ef9d=_['merge']({},_0x11ef9d,_0x2fdc61[_0xb6cc('0x3d')]);return _0x4b7548[_0xb6cc('0x5f')](_0x11ef9d);}})[_0xb6cc('0x25')](function(_0x47dc79){if(_0x47dc79){_0x1d82e9=_0x47dc79[_0xb6cc('0x34')];if(!_0x2fdc61[_0xb6cc('0x2f')][_0xb6cc('0x35')](_0xb6cc('0x36'))){_0x11ef9d['limit']=qs[_0xb6cc('0x1c')](_0x2fdc61[_0xb6cc('0x2f')][_0xb6cc('0x1c')]);_0x11ef9d['offset']=qs[_0xb6cc('0x1a')](_0x2fdc61[_0xb6cc('0x2f')]['offset']);}return _0x4b7548['getLists'](_0x11ef9d);}})['then'](function(_0x1661bf){if(_0x1661bf){return _0x1661bf?{'count':_0x1d82e9,'rows':_0x1661bf}:null;}})['then'](respondWithResult(_0xb2b7dc,null))[_0xb6cc('0x45')](handleError(_0xb2b7dc,null));};exports[_0xb6cc('0x60')]=function(_0xe45ed9,_0x1ccbf6,_0x389b61){var _0x231cb5,_0x1fae3e;return db[_0xb6cc('0x2c')]['find']({'where':{'id':_0xe45ed9['params']['id']}})['then'](handleEntityNotFound(_0x1ccbf6,null))[_0xb6cc('0x25')](function(_0x21a902){if(_0x21a902){_0x1fae3e=_0x21a902;return _0x21a902['addLists'](_0xe45ed9[_0xb6cc('0x50')][_0xb6cc('0x61')],_[_0xb6cc('0x4e')](_0xe45ed9[_0xb6cc('0x50')],[_0xb6cc('0x61'),'id'])||{});}return null;})[_0xb6cc('0x62')](function(_0x191994){var _0x13a010;_0x231cb5=_0x191994||[];var _0x3c3d41=[];if(_0x191994){for(var _0xaf7633=0x0;_0xaf7633<_0x191994[_0xb6cc('0x34')];_0xaf7633+=0x1){var _0x27ff91=_0x191994[_0xaf7633]['get']({'plain':!![]});_0x1fae3e[_0xb6cc('0x63')]=_0xe45ed9[_0xb6cc('0x50')][_0xb6cc('0x63')]?_0xe45ed9['body'][_0xb6cc('0x63')]:_0x1fae3e[_0xb6cc('0x63')];switch(_0x1fae3e[_0xb6cc('0x63')]){case _0xb6cc('0x64'):_0x13a010=squel['insert']()[_0xb6cc('0x65')](_0xb6cc('0x66'))[_0xb6cc('0x67')]([_0xb6cc('0x68'),_0xb6cc('0x69'),_0xb6cc('0x6a'),'ListId','CampaignId',_0xb6cc('0x6b'),_0xb6cc('0x4f')],squel[_0xb6cc('0x6c')]()[_0xb6cc('0x6d')]('phone',_0xb6cc('0x68'))[_0xb6cc('0x6d')](_0xb6cc('0x6e'),_0xb6cc('0x69'))[_0xb6cc('0x6d')]('id',_0xb6cc('0x6a'))[_0xb6cc('0x6d')](_0x27ff91['CmListId'][_0xb6cc('0x6f')](),_0xb6cc('0x70'))['field'](_0xe45ed9['params']['id'][_0xb6cc('0x6f')](),_0xb6cc('0x56'))[_0xb6cc('0x6d')](_0xb6cc('0x6e'),_0xb6cc('0x6b'))['field'](_0xb6cc('0x6e'),_0xb6cc('0x4f'))[_0xb6cc('0x71')]('cm_contacts')[_0xb6cc('0x3b')](_0xb6cc('0x72'))[_0xb6cc('0x3b')]('ListId\x20=\x20?',_0x27ff91['CmListId'][_0xb6cc('0x6f')]())[_0xb6cc('0x3b')](_0xb6cc('0x73'))[_0xb6cc('0x3b')](_0xb6cc('0x74'),squel[_0xb6cc('0x6c')]()[_0xb6cc('0x6d')](_0xb6cc('0x75'))['from'](_0xb6cc('0x76'))['where'](_0xb6cc('0x77'),_0xe45ed9['params']['id'][_0xb6cc('0x6f')]()))[_0xb6cc('0x3b')](_0xb6cc('0x74'),squel[_0xb6cc('0x6c')]()[_0xb6cc('0x6d')](_0xb6cc('0x78'))[_0xb6cc('0x71')]('cm_hopper')[_0xb6cc('0x3b')]('CampaignId\x20=\x20?',_0xe45ed9['params']['id'][_0xb6cc('0x6f')]())))[_0xb6cc('0x6f')]();break;case'onlyIfOpen':_0x13a010=squel['insert']()[_0xb6cc('0x65')]('cm_hopper')[_0xb6cc('0x67')](['phone',_0xb6cc('0x69'),_0xb6cc('0x6a'),'ListId',_0xb6cc('0x56'),'createdAt',_0xb6cc('0x4f')],squel[_0xb6cc('0x6c')]()['field'](_0xb6cc('0x68'),_0xb6cc('0x68'))[_0xb6cc('0x6d')](_0xb6cc('0x6e'),_0xb6cc('0x69'))['field']('id','ContactId')[_0xb6cc('0x6d')](_0x27ff91[_0xb6cc('0x79')][_0xb6cc('0x6f')](),_0xb6cc('0x70'))[_0xb6cc('0x6d')](_0xe45ed9['params']['id'][_0xb6cc('0x6f')](),'CampaignId')['field']('NOW()','createdAt')[_0xb6cc('0x6d')](_0xb6cc('0x6e'),_0xb6cc('0x4f'))[_0xb6cc('0x71')](_0xb6cc('0x7a'))[_0xb6cc('0x3b')](_0xb6cc('0x72'))['where'](_0xb6cc('0x7b'),_0x27ff91[_0xb6cc('0x79')][_0xb6cc('0x6f')]())[_0xb6cc('0x3b')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xb6cc('0x74'),squel[_0xb6cc('0x6c')]()[_0xb6cc('0x6d')](_0xb6cc('0x78'))[_0xb6cc('0x71')](_0xb6cc('0x66'))[_0xb6cc('0x3b')](_0xb6cc('0x77'),_0xe45ed9[_0xb6cc('0x41')]['id'][_0xb6cc('0x6f')]())))[_0xb6cc('0x6f')]();break;default:_0x13a010=squel[_0xb6cc('0x7c')]()['into'](_0xb6cc('0x66'))['fromQuery']([_0xb6cc('0x68'),_0xb6cc('0x69'),_0xb6cc('0x6a'),_0xb6cc('0x70'),'CampaignId',_0xb6cc('0x6b'),_0xb6cc('0x4f')],squel['select']()[_0xb6cc('0x6d')](_0xb6cc('0x68'),_0xb6cc('0x68'))[_0xb6cc('0x6d')](_0xb6cc('0x6e'),'scheduledAt')[_0xb6cc('0x6d')]('id',_0xb6cc('0x6a'))[_0xb6cc('0x6d')](_0x27ff91[_0xb6cc('0x79')][_0xb6cc('0x6f')](),_0xb6cc('0x70'))[_0xb6cc('0x6d')](_0xe45ed9['params']['id'][_0xb6cc('0x6f')](),_0xb6cc('0x56'))['field'](_0xb6cc('0x6e'),_0xb6cc('0x6b'))[_0xb6cc('0x6d')](_0xb6cc('0x6e'),_0xb6cc('0x4f'))[_0xb6cc('0x71')](_0xb6cc('0x7a'))[_0xb6cc('0x3b')](_0xb6cc('0x72'))['where'](_0xb6cc('0x7b'),_0x27ff91[_0xb6cc('0x79')][_0xb6cc('0x6f')]())[_0xb6cc('0x3b')](_0xb6cc('0x73')))[_0xb6cc('0x6f')]();}_0x3c3d41[_0xb6cc('0x7d')](db['sequelize'][_0xb6cc('0x2f')](_0x13a010));}return BPromise[_0xb6cc('0x7e')](_0x3c3d41);}})[_0xb6cc('0x25')](function(){return _0x231cb5;})[_0xb6cc('0x25')](respondWithResult(_0x1ccbf6,null))['catch'](handleError(_0x1ccbf6,null));};exports[_0xb6cc('0x7f')]=function(_0x23a025,_0x36b7f2,_0x54fdf9){return db[_0xb6cc('0x2c')][_0xb6cc('0x44')]({'where':{'id':_0x23a025[_0xb6cc('0x41')]['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0x36b7f2,null))[_0xb6cc('0x25')](function(_0x31a490){if(_0x31a490){return _0x31a490[_0xb6cc('0x7f')](_0x23a025[_0xb6cc('0x2f')][_0xb6cc('0x61')]);}})[_0xb6cc('0x25')](function(_0x111b37){if(_0x111b37){return db['CmHopper']['destroy']({'where':{'ListId':_0x23a025[_0xb6cc('0x2f')]['ids'],'CampaignId':_0x23a025['params']['id']}})[_0xb6cc('0x25')](function(){return _0x111b37;});}})[_0xb6cc('0x25')](respondWithStatusCode(_0x36b7f2,null))[_0xb6cc('0x45')](handleError(_0x36b7f2,null));};exports[_0xb6cc('0x80')]=function(_0x59a9df,_0x5f00a2,_0x527abd){var _0x538be5={};var _0x1303b9={};var _0x4891d9;var _0x557d24;return db[_0xb6cc('0x2c')]['findOne']({'where':{'id':_0x59a9df[_0xb6cc('0x41')]['id']}})['then'](handleEntityNotFound(_0x5f00a2,null))[_0xb6cc('0x25')](function(_0x4824b6){if(_0x4824b6){_0x4891d9=_0x4824b6;_0x1303b9[_0xb6cc('0x2e')]=_[_0xb6cc('0x42')](db[_0xb6cc('0x81')]['rawAttributes']);_0x1303b9[_0xb6cc('0x2f')]=_[_0xb6cc('0x42')](_0x59a9df[_0xb6cc('0x2f')]);_0x1303b9[_0xb6cc('0x30')]=_[_0xb6cc('0x32')](_0x1303b9['model'],_0x1303b9[_0xb6cc('0x2f')]);_0x538be5['attributes']=_['intersection'](_0x1303b9['model'],qs[_0xb6cc('0x33')](_0x59a9df[_0xb6cc('0x2f')][_0xb6cc('0x33')]));_0x538be5[_0xb6cc('0x31')]=_0x538be5[_0xb6cc('0x31')][_0xb6cc('0x34')]?_0x538be5[_0xb6cc('0x31')]:_0x1303b9['model'];_0x538be5[_0xb6cc('0x37')]=qs[_0xb6cc('0x38')](_0x59a9df[_0xb6cc('0x2f')][_0xb6cc('0x38')]);_0x538be5['where']=qs['filters'](_[_0xb6cc('0x39')](_0x59a9df[_0xb6cc('0x2f')],_0x1303b9['filters']));if(_0x59a9df[_0xb6cc('0x2f')][_0xb6cc('0x3a')]){_0x538be5[_0xb6cc('0x3b')]=_[_0xb6cc('0x3c')](_0x538be5[_0xb6cc('0x3b')],{'$or':_[_0xb6cc('0x2b')](_0x538be5[_0xb6cc('0x31')],function(_0xe2da37){var _0x3fceed={};_0x3fceed[_0xe2da37]={'$like':'%'+_0x59a9df[_0xb6cc('0x2f')][_0xb6cc('0x3a')]+'%'};return _0x3fceed;})});}_0x538be5=_['merge']({},_0x538be5,_0x59a9df['options']);return _0x4891d9[_0xb6cc('0x80')](_0x538be5);}})[_0xb6cc('0x25')](function(_0x443449){if(_0x443449){_0x557d24=_0x443449['length'];if(!_0x59a9df[_0xb6cc('0x2f')][_0xb6cc('0x35')]('nolimit')){_0x538be5[_0xb6cc('0x1c')]=qs['limit'](_0x59a9df['query']['limit']);_0x538be5['offset']=qs[_0xb6cc('0x1a')](_0x59a9df[_0xb6cc('0x2f')][_0xb6cc('0x1a')]);}return _0x4891d9[_0xb6cc('0x80')](_0x538be5);}})[_0xb6cc('0x25')](function(_0x4a7118){if(_0x4a7118){return _0x4a7118?{'count':_0x557d24,'rows':_0x4a7118}:null;}})[_0xb6cc('0x25')](respondWithResult(_0x5f00a2,null))[_0xb6cc('0x45')](handleError(_0x5f00a2,null));};exports[_0xb6cc('0x82')]=function(_0x2b5701,_0x12d19e,_0x2a4f2e){var _0x1ceaf3,_0x371c2e;return db[_0xb6cc('0x2c')][_0xb6cc('0x44')]({'where':{'id':_0x2b5701[_0xb6cc('0x41')]['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0x12d19e,null))[_0xb6cc('0x25')](function(_0xe3d9f6){if(_0xe3d9f6){_0x371c2e=_0xe3d9f6;return _0xe3d9f6[_0xb6cc('0x82')](_0x2b5701['body'][_0xb6cc('0x61')],_[_0xb6cc('0x4e')](_0x2b5701[_0xb6cc('0x50')],['ids','id'])||{});}return null;})[_0xb6cc('0x62')](function(_0x2b7dc2){var _0x427d60;_0x1ceaf3=_0x2b7dc2||[];var _0x5b3518=[];if(_0x2b7dc2){for(var _0x4a34b0=0x0;_0x4a34b0<_0x2b7dc2[_0xb6cc('0x34')];_0x4a34b0+=0x1){var _0x3b64cd=_0x2b7dc2[_0x4a34b0][_0xb6cc('0x48')]({'plain':!![]});_0x427d60=squel[_0xb6cc('0x7c')]()[_0xb6cc('0x65')](_0xb6cc('0x83'))['fromQuery']([_0xb6cc('0x68'),'ContactId',_0xb6cc('0x70'),_0xb6cc('0x56'),_0xb6cc('0x6b'),_0xb6cc('0x4f')],squel[_0xb6cc('0x6c')]()[_0xb6cc('0x6d')](_0xb6cc('0x68'),_0xb6cc('0x68'))[_0xb6cc('0x6d')]('id',_0xb6cc('0x6a'))['field'](_0x3b64cd[_0xb6cc('0x79')][_0xb6cc('0x6f')](),_0xb6cc('0x70'))[_0xb6cc('0x6d')](_0x2b5701['params']['id'][_0xb6cc('0x6f')](),'CampaignId')['field'](_0xb6cc('0x6e'),_0xb6cc('0x6b'))[_0xb6cc('0x6d')](_0xb6cc('0x6e'),_0xb6cc('0x4f'))[_0xb6cc('0x71')](_0xb6cc('0x7a'))['where']('deletedAt\x20IS\x20NULL')['where'](_0xb6cc('0x7b'),_0x3b64cd[_0xb6cc('0x79')][_0xb6cc('0x6f')]())[_0xb6cc('0x3b')](_0xb6cc('0x73')))[_0xb6cc('0x6f')]();_0x5b3518[_0xb6cc('0x7d')](db[_0xb6cc('0x84')]['query'](_0x427d60));}return BPromise['all'](_0x5b3518);}})['then'](function(){return _0x1ceaf3;})['then'](respondWithResult(_0x12d19e,null))['catch'](handleError(_0x12d19e,null));};exports[_0xb6cc('0x85')]=function(_0x581ac2,_0x4b880c,_0x2f21e2){return db[_0xb6cc('0x2c')]['find']({'where':{'id':_0x581ac2[_0xb6cc('0x41')]['id']}})[_0xb6cc('0x25')](handleEntityNotFound(_0x4b880c,null))[_0xb6cc('0x25')](function(_0x3a0553){if(_0x3a0553){return _0x3a0553['removeBlackLists'](_0x581ac2[_0xb6cc('0x2f')][_0xb6cc('0x61')]);}})[_0xb6cc('0x25')](function(_0x4e7ce0){if(_0x4e7ce0){return db[_0xb6cc('0x5e')][_0xb6cc('0x53')]({'where':{'ListId':_0x581ac2[_0xb6cc('0x2f')]['ids'],'CampaignId':_0x581ac2[_0xb6cc('0x41')]['id']}})[_0xb6cc('0x25')](function(){return _0x4e7ce0;});}})[_0xb6cc('0x25')](respondWithStatusCode(_0x4b880c,null))[_0xb6cc('0x45')](handleError(_0x4b880c,null));};
\ No newline at end of file
+var _0x23a0=['ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','scheduledAt','phone\x20IS\x20NOT\x20NULL','push','all','removeLists','destroy','getBlackLists','CmList','addBlackLists','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','lodash','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','get','name','index','map','Campaign','fieldName','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','IvrCampaigns','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','UserProfileSection','userProfileId','update','getHoppers','findOne','CmHopper','CampaignId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','ListId','select','NOW()','field','ContactId','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL'];(function(_0x2c92a3,_0x59ec68){var _0x16c8e7=function(_0x5b7523){while(--_0x5b7523){_0x2c92a3['push'](_0x2c92a3['shift']());}};_0x16c8e7(++_0x59ec68);}(_0x23a0,0x94));var _0x023a=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x23a0[_0x45bf86];return _0x1f02b7;};'use strict';var emlformat=require(_0x023a('0x0'));var rimraf=require(_0x023a('0x1'));var zipdir=require(_0x023a('0x2'));var jsonpatch=require(_0x023a('0x3'));var rp=require('request-promise');var moment=require(_0x023a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x023a('0x5'));var util=require('util');var path=require(_0x023a('0x6'));var sox=require(_0x023a('0x7'));var csv=require(_0x023a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x023a('0x9'));var squel=require('squel');var crypto=require(_0x023a('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x023a('0x8'));var querystring=require(_0x023a('0xb'));var Papa=require('papaparse');var Redis=require(_0x023a('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x023a('0xd'));var as=require(_0x023a('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x023a('0xf'))('api');var utils=require(_0x023a('0x10'));var config=require(_0x023a('0x11'));var licenseUtil=require(_0x023a('0x12'));var db=require(_0x023a('0x13'))['db'];function respondWithStatusCode(_0x1eaba4,_0xb2bc97){_0xb2bc97=_0xb2bc97||0xcc;return function(_0x491008){if(_0x491008){return _0x1eaba4[_0x023a('0x14')](_0xb2bc97);}return _0x1eaba4[_0x023a('0x15')](_0xb2bc97)[_0x023a('0x16')]();};}function respondWithResult(_0x436b0a,_0x381014){_0x381014=_0x381014||0xc8;return function(_0x3654dd){if(_0x3654dd){return _0x436b0a[_0x023a('0x15')](_0x381014)[_0x023a('0x17')](_0x3654dd);}};}function respondWithFilteredResult(_0xbe6064,_0x12e358){return function(_0x2be30b){if(_0x2be30b){var _0xed01ef=typeof _0x12e358[_0x023a('0x18')]===_0x023a('0x19')&&typeof _0x12e358['limit']==='undefined';var _0x3b7757=_0x2be30b['count'];var _0x10888e=_0xed01ef?0x0:_0x12e358['offset'];var _0x322be0=_0xed01ef?_0x2be30b[_0x023a('0x1a')]:_0x12e358[_0x023a('0x18')]+_0x12e358[_0x023a('0x1b')];var _0x4d0c11;if(_0x322be0>=_0x3b7757){_0x322be0=_0x3b7757;_0x4d0c11=0xc8;}else{_0x4d0c11=0xce;}_0xbe6064['status'](_0x4d0c11);return _0xbe6064['set'](_0x023a('0x1c'),_0x10888e+'-'+_0x322be0+'/'+_0x3b7757)['json'](_0x2be30b);}return null;};}function patchUpdates(_0x13c800){return function(_0x18b222){try{jsonpatch[_0x023a('0x1d')](_0x18b222,_0x13c800,!![]);}catch(_0x2dd1ca){return BPromise[_0x023a('0x1e')](_0x2dd1ca);}return _0x18b222[_0x023a('0x1f')]();};}function saveUpdates(_0x4ec1c7,_0x3fc025){return function(_0x554aaf){if(_0x554aaf){return _0x554aaf['update'](_0x4ec1c7)[_0x023a('0x20')](function(_0x37ee49){return _0x37ee49;});}return null;};}function removeEntity(_0x1fb09f,_0x40914d){return function(_0x1d2ab8){if(_0x1d2ab8){return _0x1d2ab8['destroy']()[_0x023a('0x20')](function(){var _0x49c635=_0x1d2ab8[_0x023a('0x21')]({'plain':!![]});var _0x52914f='IvrCampaigns';return db['UserProfileResource']['destroy']({'where':{'type':_0x52914f,'resourceId':_0x49c635['id']}})[_0x023a('0x20')](function(){return _0x1d2ab8;});})['then'](function(){_0x1fb09f[_0x023a('0x15')](0xcc)[_0x023a('0x16')]();});}};}function handleEntityNotFound(_0x11e7a4,_0x3715ec){return function(_0x4b7cea){if(!_0x4b7cea){_0x11e7a4[_0x023a('0x14')](0x194);}return _0x4b7cea;};}function handleError(_0x59630c,_0x5a1c9e){_0x5a1c9e=_0x5a1c9e||0x1f4;return function(_0x3036d4){logger['error'](_0x3036d4['stack']);if(_0x3036d4[_0x023a('0x22')]){delete _0x3036d4[_0x023a('0x22')];}_0x59630c[_0x023a('0x15')](_0x5a1c9e)['send'](_0x3036d4);};}exports[_0x023a('0x23')]=function(_0x2089f6,_0xd83581){var _0x1aa324={},_0x521363={},_0x24738c={'count':0x0,'rows':[]};var _0x37e2cc=_[_0x023a('0x24')](db[_0x023a('0x25')]['rawAttributes'],function(_0x487750){return{'name':_0x487750[_0x023a('0x26')],'type':_0x487750[_0x023a('0x27')][_0x023a('0x28')]};});_0x521363['model']=_[_0x023a('0x24')](_0x37e2cc,_0x023a('0x22'));_0x521363[_0x023a('0x29')]=_['keys'](_0x2089f6[_0x023a('0x29')]);_0x521363[_0x023a('0x2a')]=_[_0x023a('0x2b')](_0x521363[_0x023a('0x2c')],_0x521363[_0x023a('0x29')]);_0x1aa324['attributes']=_[_0x023a('0x2b')](_0x521363[_0x023a('0x2c')],qs[_0x023a('0x2d')](_0x2089f6['query']['fields']));_0x1aa324[_0x023a('0x2e')]=_0x1aa324['attributes']['length']?_0x1aa324['attributes']:_0x521363['model'];if(!_0x2089f6[_0x023a('0x29')][_0x023a('0x2f')](_0x023a('0x30'))){_0x1aa324[_0x023a('0x1b')]=qs[_0x023a('0x1b')](_0x2089f6[_0x023a('0x29')][_0x023a('0x1b')]);_0x1aa324[_0x023a('0x18')]=qs[_0x023a('0x18')](_0x2089f6[_0x023a('0x29')][_0x023a('0x18')]);}_0x1aa324[_0x023a('0x31')]=qs[_0x023a('0x32')](_0x2089f6[_0x023a('0x29')]['sort']);_0x1aa324['where']=qs[_0x023a('0x2a')](_[_0x023a('0x33')](_0x2089f6['query'],_0x521363[_0x023a('0x2a')]),_0x37e2cc);if(_0x2089f6['query'][_0x023a('0x34')]){_0x1aa324[_0x023a('0x35')]=_[_0x023a('0x36')](_0x1aa324[_0x023a('0x35')],{'$or':_[_0x023a('0x24')](_0x37e2cc,function(_0x212a0c){if(_0x212a0c[_0x023a('0x27')]!=='VIRTUAL'){var _0x50fbcf={};_0x50fbcf[_0x212a0c[_0x023a('0x22')]]={'$like':'%'+_0x2089f6[_0x023a('0x29')][_0x023a('0x34')]+'%'};return _0x50fbcf;}})});}_0x1aa324=_[_0x023a('0x36')]({},_0x1aa324,_0x2089f6[_0x023a('0x37')]);var _0x2baa16={'where':_0x1aa324[_0x023a('0x35')]};return db[_0x023a('0x25')][_0x023a('0x1a')](_0x2baa16)[_0x023a('0x20')](function(_0x2f88f7){_0x24738c[_0x023a('0x1a')]=_0x2f88f7;if(_0x2089f6['query'][_0x023a('0x38')]){_0x1aa324[_0x023a('0x39')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x1aa324);})[_0x023a('0x20')](function(_0x13a90d){_0x24738c[_0x023a('0x3a')]=_0x13a90d;return _0x24738c;})[_0x023a('0x20')](respondWithFilteredResult(_0xd83581,_0x1aa324))[_0x023a('0x3b')](handleError(_0xd83581,null));};exports[_0x023a('0x3c')]=function(_0x28f703,_0x3c1605){var _0x445a16={'raw':![],'where':{'id':_0x28f703[_0x023a('0x3d')]['id']}},_0x1879b1={};_0x1879b1[_0x023a('0x2c')]=_[_0x023a('0x3e')](db[_0x023a('0x25')][_0x023a('0x3f')]);_0x1879b1[_0x023a('0x29')]=_[_0x023a('0x3e')](_0x28f703[_0x023a('0x29')]);_0x1879b1[_0x023a('0x2a')]=_[_0x023a('0x2b')](_0x1879b1[_0x023a('0x2c')],_0x1879b1[_0x023a('0x29')]);_0x445a16[_0x023a('0x2e')]=_['intersection'](_0x1879b1[_0x023a('0x2c')],qs[_0x023a('0x2d')](_0x28f703[_0x023a('0x29')][_0x023a('0x2d')]));_0x445a16['attributes']=_0x445a16['attributes'][_0x023a('0x40')]?_0x445a16[_0x023a('0x2e')]:_0x1879b1[_0x023a('0x2c')];if(_0x28f703[_0x023a('0x29')][_0x023a('0x38')]){_0x445a16[_0x023a('0x39')]=[{'all':!![]}];}_0x445a16=_['merge']({},_0x445a16,_0x28f703[_0x023a('0x37')]);return db[_0x023a('0x25')][_0x023a('0x41')](_0x445a16)[_0x023a('0x20')](handleEntityNotFound(_0x3c1605,null))[_0x023a('0x20')](respondWithResult(_0x3c1605,null))[_0x023a('0x3b')](handleError(_0x3c1605,null));};exports[_0x023a('0x42')]=function(_0x158f57,_0x260be5){return db[_0x023a('0x25')][_0x023a('0x42')](_0x158f57[_0x023a('0x43')],{})[_0x023a('0x20')](function(_0xc15ab6){var _0x388217=_0x158f57[_0x023a('0x44')]['get']({'plain':!![]});if(!_0x388217)throw new Error(_0x023a('0x45'));if(_0x388217['role']===_0x023a('0x44')){var _0x91d007=_0xc15ab6[_0x023a('0x21')]({'plain':!![]});var _0x3d47ee=_0x023a('0x46');return db['UserProfileSection'][_0x023a('0x41')]({'where':{'name':_0x3d47ee,'userProfileId':_0x388217['userProfileId']},'raw':!![]})[_0x023a('0x20')](function(_0x107954){if(_0x107954&&_0x107954[_0x023a('0x47')]===0x0){return db[_0x023a('0x48')][_0x023a('0x42')]({'name':_0x91d007[_0x023a('0x22')],'resourceId':_0x91d007['id'],'type':_0x107954[_0x023a('0x22')],'sectionId':_0x107954['id']},{})[_0x023a('0x20')](function(){return _0xc15ab6;});}else{return _0xc15ab6;}})['catch'](function(_0x4df6e8){logger[_0x023a('0x49')](_0x023a('0x4a'),_0x4df6e8);throw _0x4df6e8;});}return _0xc15ab6;})[_0x023a('0x20')](respondWithResult(_0x260be5,0xc9))[_0x023a('0x3b')](handleError(_0x260be5,null));};exports[_0x023a('0x4b')]=function(_0x472746,_0x26cdce){var _0x28e86b={'where':{'id':_0x472746[_0x023a('0x3d')]['id']}},_0x3b4e4c={};_0x3b4e4c[_0x023a('0x2c')]=_['keys'](db[_0x023a('0x25')][_0x023a('0x3f')]);_0x28e86b[_0x023a('0x2e')]=_[_0x023a('0x2b')](_0x3b4e4c[_0x023a('0x2c')],qs[_0x023a('0x2d')](_0x472746['query'][_0x023a('0x2d')]));_0x28e86b[_0x023a('0x2e')]=_0x28e86b[_0x023a('0x2e')]['length']?_0x28e86b['attributes']:_0x3b4e4c[_0x023a('0x2c')];if(_0x472746[_0x023a('0x29')][_0x023a('0x38')]){_0x28e86b['include']=[{'all':!![]}];}_0x28e86b=_['merge']({},_0x28e86b,_0x472746[_0x023a('0x37')]);return db[_0x023a('0x25')][_0x023a('0x41')](_0x28e86b)['then'](handleEntityNotFound(_0x26cdce,null))['then'](function(_0x4dd2bc){if(_0x4dd2bc){var _0x465d91=_0x4dd2bc[_0x023a('0x21')]({'plain':!![]});_0x465d91=qs[_0x023a('0x4c')](_0x465d91,['id',_0x023a('0x4d'),'updatedAt']);_0x472746[_0x023a('0x43')]=_[_0x023a('0x4c')](_0x472746[_0x023a('0x43')],['id',_0x023a('0x4d'),_0x023a('0x4e')]);return db[_0x023a('0x25')][_0x023a('0x42')](_[_0x023a('0x36')](_0x465d91,_0x472746[_0x023a('0x43')]),{'include':_0x472746[_0x023a('0x29')][_0x023a('0x38')]?[{'all':!![]}]:undefined})[_0x023a('0x20')](function(_0x180c64){var _0x1bc7aa=_0x472746[_0x023a('0x44')][_0x023a('0x21')]({'plain':!![]});if(!_0x1bc7aa)throw new Error(_0x023a('0x45'));if(_0x1bc7aa[_0x023a('0x4f')]===_0x023a('0x44')){var _0x32b3e1=_0x180c64[_0x023a('0x21')]({'plain':!![]});var _0x203cd7='IvrCampaigns';return db[_0x023a('0x50')]['find']({'where':{'name':_0x203cd7,'userProfileId':_0x1bc7aa[_0x023a('0x51')]},'raw':!![]})[_0x023a('0x20')](function(_0x108d7d){if(_0x108d7d&&_0x108d7d['autoAssociation']===0x0){return db[_0x023a('0x48')][_0x023a('0x42')]({'name':_0x32b3e1[_0x023a('0x22')],'resourceId':_0x32b3e1['id'],'type':_0x108d7d['name'],'sectionId':_0x108d7d['id']},{})[_0x023a('0x20')](function(){return _0x180c64;});}else{return _0x180c64;}})[_0x023a('0x3b')](function(_0x28c448){logger[_0x023a('0x49')](_0x023a('0x4a'),_0x28c448);throw _0x28c448;});}return _0x180c64;});}})['then'](respondWithResult(_0x26cdce,0xc9))[_0x023a('0x3b')](handleError(_0x26cdce,null));};exports[_0x023a('0x52')]=function(_0x14e893,_0xd1263d){if(_0x14e893[_0x023a('0x43')]['id']){delete _0x14e893[_0x023a('0x43')]['id'];}return db[_0x023a('0x25')][_0x023a('0x41')]({'where':{'id':_0x14e893[_0x023a('0x3d')]['id']}})['then'](handleEntityNotFound(_0xd1263d,null))[_0x023a('0x20')](saveUpdates(_0x14e893[_0x023a('0x43')],null))[_0x023a('0x20')](respondWithResult(_0xd1263d,null))[_0x023a('0x3b')](handleError(_0xd1263d,null));};exports['destroy']=function(_0x33764c,_0x3fe7cd){return db['Campaign']['find']({'where':{'id':_0x33764c['params']['id']}})[_0x023a('0x20')](handleEntityNotFound(_0x3fe7cd,null))[_0x023a('0x20')](removeEntity(_0x3fe7cd,null))[_0x023a('0x3b')](handleError(_0x3fe7cd,null));};exports[_0x023a('0x53')]=function(_0x2ef95b,_0x138025,_0x1b3875){var _0x5cc386={'raw':!![],'where':{}};var _0x1a9cab={};var _0x582401={'count':0x0,'rows':[]};return db[_0x023a('0x25')][_0x023a('0x54')]({'where':{'id':_0x2ef95b[_0x023a('0x3d')]['id']}})[_0x023a('0x20')](handleEntityNotFound(_0x138025,null))['then'](function(_0x222321){if(_0x222321){_0x1a9cab[_0x023a('0x2c')]=_[_0x023a('0x3e')](db[_0x023a('0x55')][_0x023a('0x3f')]);_0x1a9cab[_0x023a('0x29')]=_[_0x023a('0x3e')](_0x2ef95b[_0x023a('0x29')]);_0x1a9cab['filters']=_['intersection'](_0x1a9cab[_0x023a('0x2c')],_0x1a9cab[_0x023a('0x29')]);_0x5cc386[_0x023a('0x2e')]=_[_0x023a('0x2b')](_0x1a9cab[_0x023a('0x2c')],qs['fields'](_0x2ef95b[_0x023a('0x29')]['fields']));_0x5cc386[_0x023a('0x2e')]=_0x5cc386['attributes'][_0x023a('0x40')]?_0x5cc386[_0x023a('0x2e')]:_0x1a9cab['model'];if(!_0x2ef95b[_0x023a('0x29')]['hasOwnProperty'](_0x023a('0x30'))){_0x5cc386[_0x023a('0x1b')]=qs['limit'](_0x2ef95b[_0x023a('0x29')][_0x023a('0x1b')]);_0x5cc386[_0x023a('0x18')]=qs[_0x023a('0x18')](_0x2ef95b[_0x023a('0x29')][_0x023a('0x18')]);}_0x5cc386[_0x023a('0x31')]=qs[_0x023a('0x32')](_0x2ef95b['query'][_0x023a('0x32')]);_0x5cc386[_0x023a('0x35')]=qs[_0x023a('0x2a')](_[_0x023a('0x33')](_0x2ef95b[_0x023a('0x29')],_0x1a9cab[_0x023a('0x2a')]));_0x5cc386['where'][_0x023a('0x56')]=_0x222321['id'];if(_0x2ef95b['query'][_0x023a('0x34')]){_0x5cc386[_0x023a('0x35')]=_[_0x023a('0x36')](_0x5cc386['where'],{'$or':_[_0x023a('0x24')](_0x5cc386[_0x023a('0x2e')],function(_0x4af321){var _0x278e4c={};_0x278e4c[_0x4af321]={'$like':'%'+_0x2ef95b[_0x023a('0x29')][_0x023a('0x34')]+'%'};return _0x278e4c;})});}_0x5cc386=_[_0x023a('0x36')]({},_0x5cc386,_0x2ef95b['options']);return db[_0x023a('0x55')][_0x023a('0x1a')]({'where':_0x5cc386[_0x023a('0x35')]})[_0x023a('0x20')](function(_0x4b9f40){_0x582401['count']=_0x4b9f40;if(_0x2ef95b[_0x023a('0x29')][_0x023a('0x38')]){_0x5cc386[_0x023a('0x39')]=[{'all':!![]}];}return db[_0x023a('0x55')][_0x023a('0x57')](_0x5cc386);})[_0x023a('0x20')](function(_0x2410aa){_0x582401[_0x023a('0x3a')]=_0x2410aa;return _0x582401;});}})['then'](respondWithFilteredResult(_0x138025,_0x5cc386))[_0x023a('0x3b')](handleError(_0x138025,null));};exports[_0x023a('0x58')]=function(_0x58b392,_0x45d97c,_0x2fd100){var _0x256f0b={'raw':!![],'where':{}};var _0x494976={};var _0x1a730d={'count':0x0,'rows':[]};return db[_0x023a('0x25')][_0x023a('0x54')]({'where':{'id':_0x58b392[_0x023a('0x3d')]['id']}})[_0x023a('0x20')](handleEntityNotFound(_0x45d97c,null))[_0x023a('0x20')](function(_0x5679b2){if(_0x5679b2){_0x494976[_0x023a('0x2c')]=_[_0x023a('0x3e')](db[_0x023a('0x59')]['rawAttributes']);_0x494976['query']=_[_0x023a('0x3e')](_0x58b392['query']);_0x494976[_0x023a('0x2a')]=_['intersection'](_0x494976[_0x023a('0x2c')],_0x494976[_0x023a('0x29')]);_0x256f0b[_0x023a('0x2e')]=_[_0x023a('0x2b')](_0x494976[_0x023a('0x2c')],qs[_0x023a('0x2d')](_0x58b392[_0x023a('0x29')]['fields']));_0x256f0b[_0x023a('0x2e')]=_0x256f0b[_0x023a('0x2e')][_0x023a('0x40')]?_0x256f0b[_0x023a('0x2e')]:_0x494976[_0x023a('0x2c')];if(!_0x58b392['query'][_0x023a('0x2f')](_0x023a('0x30'))){_0x256f0b[_0x023a('0x1b')]=qs['limit'](_0x58b392[_0x023a('0x29')][_0x023a('0x1b')]);_0x256f0b[_0x023a('0x18')]=qs[_0x023a('0x18')](_0x58b392['query'][_0x023a('0x18')]);}_0x256f0b[_0x023a('0x31')]=qs['sort'](_0x58b392[_0x023a('0x29')][_0x023a('0x32')]);_0x256f0b[_0x023a('0x35')]=qs[_0x023a('0x2a')](_[_0x023a('0x33')](_0x58b392[_0x023a('0x29')],_0x494976[_0x023a('0x2a')]));_0x256f0b[_0x023a('0x35')][_0x023a('0x56')]=_0x5679b2['id'];if(_0x58b392[_0x023a('0x29')][_0x023a('0x34')]){_0x256f0b[_0x023a('0x35')]=_[_0x023a('0x36')](_0x256f0b[_0x023a('0x35')],{'$or':_['map'](_0x256f0b[_0x023a('0x2e')],function(_0x10e28a){var _0x4f1de7={};_0x4f1de7[_0x10e28a]={'$like':'%'+_0x58b392[_0x023a('0x29')]['filter']+'%'};return _0x4f1de7;})});}_0x256f0b=_[_0x023a('0x36')]({},_0x256f0b,_0x58b392['options']);return db[_0x023a('0x59')][_0x023a('0x1a')]({'where':_0x256f0b[_0x023a('0x35')]})['then'](function(_0x530394){_0x1a730d[_0x023a('0x1a')]=_0x530394;if(_0x58b392[_0x023a('0x29')][_0x023a('0x38')]){_0x256f0b[_0x023a('0x39')]=[{'all':!![]}];}return db[_0x023a('0x59')][_0x023a('0x57')](_0x256f0b);})['then'](function(_0x54a861){_0x1a730d['rows']=_0x54a861;return _0x1a730d;});}})[_0x023a('0x20')](respondWithFilteredResult(_0x45d97c,_0x256f0b))[_0x023a('0x3b')](handleError(_0x45d97c,null));};exports[_0x023a('0x5a')]=function(_0x30a9d,_0x26515d,_0x144a77){var _0x1d9363={'raw':!![],'where':{}};var _0x2f2cc7={};var _0x312343={'count':0x0,'rows':[]};return db['Campaign'][_0x023a('0x54')]({'where':{'id':_0x30a9d['params']['id']}})[_0x023a('0x20')](handleEntityNotFound(_0x26515d,null))[_0x023a('0x20')](function(_0x4ebc29){if(_0x4ebc29){_0x2f2cc7[_0x023a('0x2c')]=_[_0x023a('0x3e')](db[_0x023a('0x5b')][_0x023a('0x3f')]);_0x2f2cc7['query']=_[_0x023a('0x3e')](_0x30a9d[_0x023a('0x29')]);_0x2f2cc7[_0x023a('0x2a')]=_[_0x023a('0x2b')](_0x2f2cc7[_0x023a('0x2c')],_0x2f2cc7['query']);_0x1d9363[_0x023a('0x2e')]=_['intersection'](_0x2f2cc7[_0x023a('0x2c')],qs[_0x023a('0x2d')](_0x30a9d[_0x023a('0x29')][_0x023a('0x2d')]));_0x1d9363[_0x023a('0x2e')]=_0x1d9363[_0x023a('0x2e')][_0x023a('0x40')]?_0x1d9363[_0x023a('0x2e')]:_0x2f2cc7['model'];if(!_0x30a9d['query'][_0x023a('0x2f')](_0x023a('0x30'))){_0x1d9363[_0x023a('0x1b')]=qs[_0x023a('0x1b')](_0x30a9d[_0x023a('0x29')]['limit']);_0x1d9363[_0x023a('0x18')]=qs['offset'](_0x30a9d['query']['offset']);}_0x1d9363['order']=qs['sort'](_0x30a9d[_0x023a('0x29')]['sort']);_0x1d9363['where']=qs[_0x023a('0x2a')](_[_0x023a('0x33')](_0x30a9d['query'],_0x2f2cc7[_0x023a('0x2a')]));_0x1d9363[_0x023a('0x35')][_0x023a('0x56')]=_0x4ebc29['id'];if(_0x30a9d[_0x023a('0x29')]['filter']){_0x1d9363[_0x023a('0x35')]=_[_0x023a('0x36')](_0x1d9363['where'],{'$or':_[_0x023a('0x24')](_0x1d9363[_0x023a('0x2e')],function(_0x424a90){var _0xc00e0f={};_0xc00e0f[_0x424a90]={'$like':'%'+_0x30a9d[_0x023a('0x29')]['filter']+'%'};return _0xc00e0f;})});}_0x1d9363=_[_0x023a('0x36')]({},_0x1d9363,_0x30a9d[_0x023a('0x37')]);return db['CmHopperFinal'][_0x023a('0x1a')]({'where':_0x1d9363[_0x023a('0x35')]})[_0x023a('0x20')](function(_0x12901b){_0x312343[_0x023a('0x1a')]=_0x12901b;if(_0x30a9d[_0x023a('0x29')][_0x023a('0x38')]){_0x1d9363[_0x023a('0x39')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x023a('0x57')](_0x1d9363);})[_0x023a('0x20')](function(_0x3dd276){_0x312343[_0x023a('0x3a')]=_0x3dd276;return _0x312343;});}})[_0x023a('0x20')](respondWithFilteredResult(_0x26515d,_0x1d9363))[_0x023a('0x3b')](handleError(_0x26515d,null));};exports[_0x023a('0x5c')]=function(_0x4239c2,_0x4248e9,_0x32fe1c){var _0xdf9c6a={'raw':!![],'where':{}};var _0x3df86b={};var _0x46433d={'count':0x0,'rows':[]};return db[_0x023a('0x25')][_0x023a('0x54')]({'where':{'id':_0x4239c2['params']['id']}})['then'](handleEntityNotFound(_0x4248e9,null))[_0x023a('0x20')](function(_0xce97a5){if(_0xce97a5){_0x3df86b[_0x023a('0x2c')]=_['keys'](db[_0x023a('0x5d')][_0x023a('0x3f')]);_0x3df86b[_0x023a('0x29')]=_[_0x023a('0x3e')](_0x4239c2['query']);_0x3df86b[_0x023a('0x2a')]=_[_0x023a('0x2b')](_0x3df86b[_0x023a('0x2c')],_0x3df86b[_0x023a('0x29')]);_0xdf9c6a['attributes']=_['intersection'](_0x3df86b[_0x023a('0x2c')],qs[_0x023a('0x2d')](_0x4239c2[_0x023a('0x29')][_0x023a('0x2d')]));_0xdf9c6a[_0x023a('0x2e')]=_0xdf9c6a['attributes'][_0x023a('0x40')]?_0xdf9c6a['attributes']:_0x3df86b[_0x023a('0x2c')];if(!_0x4239c2['query'][_0x023a('0x2f')]('nolimit')){_0xdf9c6a[_0x023a('0x1b')]=qs[_0x023a('0x1b')](_0x4239c2[_0x023a('0x29')][_0x023a('0x1b')]);_0xdf9c6a[_0x023a('0x18')]=qs[_0x023a('0x18')](_0x4239c2[_0x023a('0x29')][_0x023a('0x18')]);}_0xdf9c6a['order']=qs[_0x023a('0x32')](_0x4239c2[_0x023a('0x29')][_0x023a('0x32')]);_0xdf9c6a[_0x023a('0x35')]=qs[_0x023a('0x2a')](_[_0x023a('0x33')](_0x4239c2[_0x023a('0x29')],_0x3df86b['filters']));_0xdf9c6a['where'][_0x023a('0x56')]=_0xce97a5['id'];if(_0x4239c2[_0x023a('0x29')][_0x023a('0x34')]){_0xdf9c6a[_0x023a('0x35')]=_[_0x023a('0x36')](_0xdf9c6a[_0x023a('0x35')],{'$or':_['map'](_0xdf9c6a['attributes'],function(_0x55e2f8){var _0x29485a={};_0x29485a[_0x55e2f8]={'$like':'%'+_0x4239c2[_0x023a('0x29')]['filter']+'%'};return _0x29485a;})});}_0xdf9c6a=_[_0x023a('0x36')]({},_0xdf9c6a,_0x4239c2[_0x023a('0x37')]);return db[_0x023a('0x5d')][_0x023a('0x1a')]({'where':_0xdf9c6a[_0x023a('0x35')]})[_0x023a('0x20')](function(_0x2a4cf4){_0x46433d['count']=_0x2a4cf4;if(_0x4239c2[_0x023a('0x29')]['includeAll']){_0xdf9c6a[_0x023a('0x39')]=[{'all':!![]}];}return db[_0x023a('0x5d')][_0x023a('0x57')](_0xdf9c6a);})['then'](function(_0x4fb451){_0x46433d[_0x023a('0x3a')]=_0x4fb451;return _0x46433d;});}})[_0x023a('0x20')](respondWithFilteredResult(_0x4248e9,_0xdf9c6a))[_0x023a('0x3b')](handleError(_0x4248e9,null));};exports[_0x023a('0x5e')]=function(_0x30f940,_0x2b636b,_0x30b51f){var _0x2fce34={};var _0x14879c={};var _0x7f4ae4;var _0x47a25d;return db[_0x023a('0x25')][_0x023a('0x54')]({'where':{'id':_0x30f940[_0x023a('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2b636b,null))['then'](function(_0x503f20){if(_0x503f20){_0x7f4ae4=_0x503f20;_0x14879c[_0x023a('0x2c')]=_[_0x023a('0x3e')](db['CmList'][_0x023a('0x3f')]);_0x14879c[_0x023a('0x29')]=_[_0x023a('0x3e')](_0x30f940[_0x023a('0x29')]);_0x14879c[_0x023a('0x2a')]=_[_0x023a('0x2b')](_0x14879c[_0x023a('0x2c')],_0x14879c[_0x023a('0x29')]);_0x2fce34['attributes']=_['intersection'](_0x14879c[_0x023a('0x2c')],qs[_0x023a('0x2d')](_0x30f940[_0x023a('0x29')][_0x023a('0x2d')]));_0x2fce34[_0x023a('0x2e')]=_0x2fce34[_0x023a('0x2e')][_0x023a('0x40')]?_0x2fce34[_0x023a('0x2e')]:_0x14879c[_0x023a('0x2c')];_0x2fce34['order']=qs[_0x023a('0x32')](_0x30f940[_0x023a('0x29')]['sort']);_0x2fce34[_0x023a('0x35')]=qs[_0x023a('0x2a')](_[_0x023a('0x33')](_0x30f940[_0x023a('0x29')],_0x14879c[_0x023a('0x2a')]));if(_0x30f940[_0x023a('0x29')]['filter']){_0x2fce34[_0x023a('0x35')]=_[_0x023a('0x36')](_0x2fce34[_0x023a('0x35')],{'$or':_['map'](_0x2fce34[_0x023a('0x2e')],function(_0x2594a7){var _0x35cc31={};_0x35cc31[_0x2594a7]={'$like':'%'+_0x30f940[_0x023a('0x29')][_0x023a('0x34')]+'%'};return _0x35cc31;})});}_0x2fce34=_[_0x023a('0x36')]({},_0x2fce34,_0x30f940['options']);return _0x7f4ae4['getLists'](_0x2fce34);}})['then'](function(_0xa3840){if(_0xa3840){_0x47a25d=_0xa3840['length'];if(!_0x30f940[_0x023a('0x29')][_0x023a('0x2f')](_0x023a('0x30'))){_0x2fce34[_0x023a('0x1b')]=qs[_0x023a('0x1b')](_0x30f940[_0x023a('0x29')]['limit']);_0x2fce34[_0x023a('0x18')]=qs[_0x023a('0x18')](_0x30f940[_0x023a('0x29')][_0x023a('0x18')]);}return _0x7f4ae4['getLists'](_0x2fce34);}})[_0x023a('0x20')](function(_0x15250c){if(_0x15250c){return _0x15250c?{'count':_0x47a25d,'rows':_0x15250c}:null;}})[_0x023a('0x20')](respondWithResult(_0x2b636b,null))[_0x023a('0x3b')](handleError(_0x2b636b,null));};exports['addLists']=function(_0x305df9,_0x276a25,_0x16eb19){var _0x2110cd,_0x157424;return db['Campaign'][_0x023a('0x41')]({'where':{'id':_0x305df9[_0x023a('0x3d')]['id']}})[_0x023a('0x20')](handleEntityNotFound(_0x276a25,null))[_0x023a('0x20')](function(_0x2e90cc){if(_0x2e90cc){_0x157424=_0x2e90cc;return _0x2e90cc[_0x023a('0x5f')](_0x305df9['body']['ids'],_['omit'](_0x305df9[_0x023a('0x43')],[_0x023a('0x60'),'id'])||{});}return null;})[_0x023a('0x61')](function(_0x4f4381){var _0x2e5286;_0x2110cd=_0x4f4381||[];var _0x4d1dfa=[];if(_0x4f4381){for(var _0xb42d07=0x0;_0xb42d07<_0x4f4381['length'];_0xb42d07+=0x1){var _0x29b1a7=_0x4f4381[_0xb42d07][_0x023a('0x21')]({'plain':!![]});_0x157424['dialCheckDuplicateType']=_0x305df9[_0x023a('0x43')][_0x023a('0x62')]?_0x305df9['body'][_0x023a('0x62')]:_0x157424['dialCheckDuplicateType'];switch(_0x157424[_0x023a('0x62')]){case _0x023a('0x63'):_0x2e5286=squel['insert']()[_0x023a('0x64')](_0x023a('0x65'))[_0x023a('0x66')]([_0x023a('0x67'),'scheduledAt','ContactId',_0x023a('0x68'),_0x023a('0x56'),'createdAt',_0x023a('0x4e')],squel[_0x023a('0x69')]()['field']('phone','phone')['field'](_0x023a('0x6a'),'scheduledAt')[_0x023a('0x6b')]('id',_0x023a('0x6c'))['field'](_0x29b1a7[_0x023a('0x6d')][_0x023a('0x6e')](),_0x023a('0x68'))[_0x023a('0x6b')](_0x305df9['params']['id'][_0x023a('0x6e')](),_0x023a('0x56'))[_0x023a('0x6b')]('NOW()','createdAt')['field'](_0x023a('0x6a'),_0x023a('0x4e'))[_0x023a('0x6f')](_0x023a('0x70'))[_0x023a('0x35')](_0x023a('0x71'))[_0x023a('0x35')](_0x023a('0x72'),_0x29b1a7[_0x023a('0x6d')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x023a('0x35')]('phone\x20NOT\x20IN\x20(?)',squel[_0x023a('0x69')]()['field'](_0x023a('0x73'))[_0x023a('0x6f')](_0x023a('0x74'))['where'](_0x023a('0x75'),_0x305df9[_0x023a('0x3d')]['id'][_0x023a('0x6e')]()))[_0x023a('0x35')]('phone\x20NOT\x20IN\x20(?)',squel[_0x023a('0x69')]()[_0x023a('0x6b')](_0x023a('0x76'))[_0x023a('0x6f')](_0x023a('0x65'))[_0x023a('0x35')](_0x023a('0x75'),_0x305df9[_0x023a('0x3d')]['id']['toString']())))[_0x023a('0x6e')]();break;case _0x023a('0x77'):_0x2e5286=squel['insert']()[_0x023a('0x64')]('cm_hopper')[_0x023a('0x66')](['phone','scheduledAt',_0x023a('0x6c'),_0x023a('0x68'),_0x023a('0x56'),_0x023a('0x4d'),_0x023a('0x4e')],squel[_0x023a('0x69')]()[_0x023a('0x6b')]('phone',_0x023a('0x67'))[_0x023a('0x6b')](_0x023a('0x6a'),_0x023a('0x78'))[_0x023a('0x6b')]('id',_0x023a('0x6c'))[_0x023a('0x6b')](_0x29b1a7['CmListId'][_0x023a('0x6e')](),_0x023a('0x68'))[_0x023a('0x6b')](_0x305df9['params']['id'][_0x023a('0x6e')](),_0x023a('0x56'))[_0x023a('0x6b')](_0x023a('0x6a'),'createdAt')[_0x023a('0x6b')]('NOW()','updatedAt')['from']('cm_contacts')['where'](_0x023a('0x71'))['where'](_0x023a('0x72'),_0x29b1a7[_0x023a('0x6d')][_0x023a('0x6e')]())[_0x023a('0x35')](_0x023a('0x79'))[_0x023a('0x35')]('phone\x20NOT\x20IN\x20(?)',squel[_0x023a('0x69')]()['field'](_0x023a('0x76'))[_0x023a('0x6f')]('cm_hopper')[_0x023a('0x35')](_0x023a('0x75'),_0x305df9[_0x023a('0x3d')]['id']['toString']())))[_0x023a('0x6e')]();break;default:_0x2e5286=squel['insert']()[_0x023a('0x64')](_0x023a('0x65'))['fromQuery'](['phone','scheduledAt','ContactId',_0x023a('0x68'),_0x023a('0x56'),_0x023a('0x4d'),_0x023a('0x4e')],squel[_0x023a('0x69')]()[_0x023a('0x6b')](_0x023a('0x67'),_0x023a('0x67'))[_0x023a('0x6b')]('NOW()',_0x023a('0x78'))[_0x023a('0x6b')]('id',_0x023a('0x6c'))['field'](_0x29b1a7[_0x023a('0x6d')][_0x023a('0x6e')](),_0x023a('0x68'))[_0x023a('0x6b')](_0x305df9[_0x023a('0x3d')]['id'][_0x023a('0x6e')](),_0x023a('0x56'))[_0x023a('0x6b')](_0x023a('0x6a'),_0x023a('0x4d'))['field'](_0x023a('0x6a'),_0x023a('0x4e'))[_0x023a('0x6f')]('cm_contacts')[_0x023a('0x35')](_0x023a('0x71'))['where'](_0x023a('0x72'),_0x29b1a7[_0x023a('0x6d')]['toString']())[_0x023a('0x35')]('phone\x20IS\x20NOT\x20NULL'))[_0x023a('0x6e')]();}_0x4d1dfa[_0x023a('0x7a')](db['sequelize'][_0x023a('0x29')](_0x2e5286));}return BPromise[_0x023a('0x7b')](_0x4d1dfa);}})[_0x023a('0x20')](function(){return _0x2110cd;})[_0x023a('0x20')](respondWithResult(_0x276a25,null))['catch'](handleError(_0x276a25,null));};exports['removeLists']=function(_0x1f3503,_0x5baa2e,_0x3698fc){return db['Campaign'][_0x023a('0x41')]({'where':{'id':_0x1f3503[_0x023a('0x3d')]['id']}})[_0x023a('0x20')](handleEntityNotFound(_0x5baa2e,null))[_0x023a('0x20')](function(_0xbc9a6f){if(_0xbc9a6f){return _0xbc9a6f[_0x023a('0x7c')](_0x1f3503['query'][_0x023a('0x60')]);}})[_0x023a('0x20')](function(_0x48633f){if(_0x48633f){return db['CmHopper'][_0x023a('0x7d')]({'where':{'ListId':_0x1f3503[_0x023a('0x29')][_0x023a('0x60')],'CampaignId':_0x1f3503[_0x023a('0x3d')]['id']}})[_0x023a('0x20')](function(){return _0x48633f;});}})['then'](respondWithStatusCode(_0x5baa2e,null))['catch'](handleError(_0x5baa2e,null));};exports[_0x023a('0x7e')]=function(_0x526773,_0x2daf15,_0x47309a){var _0x2bc2cb={};var _0x4bce13={};var _0x311320;var _0x294fa0;return db[_0x023a('0x25')][_0x023a('0x54')]({'where':{'id':_0x526773[_0x023a('0x3d')]['id']}})[_0x023a('0x20')](handleEntityNotFound(_0x2daf15,null))[_0x023a('0x20')](function(_0x5a1819){if(_0x5a1819){_0x311320=_0x5a1819;_0x4bce13[_0x023a('0x2c')]=_['keys'](db[_0x023a('0x7f')]['rawAttributes']);_0x4bce13[_0x023a('0x29')]=_[_0x023a('0x3e')](_0x526773[_0x023a('0x29')]);_0x4bce13[_0x023a('0x2a')]=_[_0x023a('0x2b')](_0x4bce13[_0x023a('0x2c')],_0x4bce13[_0x023a('0x29')]);_0x2bc2cb[_0x023a('0x2e')]=_[_0x023a('0x2b')](_0x4bce13[_0x023a('0x2c')],qs[_0x023a('0x2d')](_0x526773[_0x023a('0x29')][_0x023a('0x2d')]));_0x2bc2cb[_0x023a('0x2e')]=_0x2bc2cb['attributes'][_0x023a('0x40')]?_0x2bc2cb[_0x023a('0x2e')]:_0x4bce13[_0x023a('0x2c')];_0x2bc2cb[_0x023a('0x31')]=qs[_0x023a('0x32')](_0x526773[_0x023a('0x29')][_0x023a('0x32')]);_0x2bc2cb[_0x023a('0x35')]=qs['filters'](_[_0x023a('0x33')](_0x526773[_0x023a('0x29')],_0x4bce13[_0x023a('0x2a')]));if(_0x526773[_0x023a('0x29')][_0x023a('0x34')]){_0x2bc2cb[_0x023a('0x35')]=_[_0x023a('0x36')](_0x2bc2cb['where'],{'$or':_['map'](_0x2bc2cb['attributes'],function(_0xa1c1e5){var _0x2d52fb={};_0x2d52fb[_0xa1c1e5]={'$like':'%'+_0x526773[_0x023a('0x29')][_0x023a('0x34')]+'%'};return _0x2d52fb;})});}_0x2bc2cb=_[_0x023a('0x36')]({},_0x2bc2cb,_0x526773[_0x023a('0x37')]);return _0x311320[_0x023a('0x7e')](_0x2bc2cb);}})['then'](function(_0x11ed38){if(_0x11ed38){_0x294fa0=_0x11ed38[_0x023a('0x40')];if(!_0x526773['query']['hasOwnProperty'](_0x023a('0x30'))){_0x2bc2cb['limit']=qs[_0x023a('0x1b')](_0x526773[_0x023a('0x29')][_0x023a('0x1b')]);_0x2bc2cb[_0x023a('0x18')]=qs[_0x023a('0x18')](_0x526773[_0x023a('0x29')]['offset']);}return _0x311320[_0x023a('0x7e')](_0x2bc2cb);}})[_0x023a('0x20')](function(_0x5760cc){if(_0x5760cc){return _0x5760cc?{'count':_0x294fa0,'rows':_0x5760cc}:null;}})[_0x023a('0x20')](respondWithResult(_0x2daf15,null))[_0x023a('0x3b')](handleError(_0x2daf15,null));};exports[_0x023a('0x80')]=function(_0x1b7a57,_0x323539,_0x2c3c8f){var _0x18478f,_0x3f567d;return db[_0x023a('0x25')]['find']({'where':{'id':_0x1b7a57[_0x023a('0x3d')]['id']}})['then'](handleEntityNotFound(_0x323539,null))[_0x023a('0x20')](function(_0x583530){if(_0x583530){_0x3f567d=_0x583530;return _0x583530[_0x023a('0x80')](_0x1b7a57[_0x023a('0x43')][_0x023a('0x60')],_[_0x023a('0x4c')](_0x1b7a57['body'],['ids','id'])||{});}return null;})[_0x023a('0x61')](function(_0xc95d55){var _0x38b1d9;_0x18478f=_0xc95d55||[];var _0x4c4b2c=[];if(_0xc95d55){for(var _0x35174a=0x0;_0x35174a<_0xc95d55[_0x023a('0x40')];_0x35174a+=0x1){var _0x1ad936=_0xc95d55[_0x35174a][_0x023a('0x21')]({'plain':!![]});_0x38b1d9=squel['insert']()[_0x023a('0x64')]('cm_hopper_black')['fromQuery']([_0x023a('0x67'),_0x023a('0x6c'),_0x023a('0x68'),_0x023a('0x56'),'createdAt',_0x023a('0x4e')],squel[_0x023a('0x69')]()[_0x023a('0x6b')](_0x023a('0x67'),_0x023a('0x67'))[_0x023a('0x6b')]('id',_0x023a('0x6c'))[_0x023a('0x6b')](_0x1ad936[_0x023a('0x6d')][_0x023a('0x6e')](),'ListId')['field'](_0x1b7a57[_0x023a('0x3d')]['id']['toString'](),_0x023a('0x56'))['field'](_0x023a('0x6a'),'createdAt')[_0x023a('0x6b')](_0x023a('0x6a'),_0x023a('0x4e'))[_0x023a('0x6f')](_0x023a('0x70'))[_0x023a('0x35')](_0x023a('0x71'))[_0x023a('0x35')](_0x023a('0x72'),_0x1ad936[_0x023a('0x6d')]['toString']())[_0x023a('0x35')](_0x023a('0x79')))[_0x023a('0x6e')]();_0x4c4b2c[_0x023a('0x7a')](db[_0x023a('0x81')]['query'](_0x38b1d9));}return BPromise[_0x023a('0x7b')](_0x4c4b2c);}})[_0x023a('0x20')](function(){return _0x18478f;})[_0x023a('0x20')](respondWithResult(_0x323539,null))[_0x023a('0x3b')](handleError(_0x323539,null));};exports[_0x023a('0x82')]=function(_0x443a4c,_0x3bd443,_0x3b1763){return db[_0x023a('0x25')]['find']({'where':{'id':_0x443a4c[_0x023a('0x3d')]['id']}})[_0x023a('0x20')](handleEntityNotFound(_0x3bd443,null))[_0x023a('0x20')](function(_0x9d16f7){if(_0x9d16f7){return _0x9d16f7[_0x023a('0x82')](_0x443a4c[_0x023a('0x29')][_0x023a('0x60')]);}})[_0x023a('0x20')](function(_0x178b7c){if(_0x178b7c){return db[_0x023a('0x5d')][_0x023a('0x7d')]({'where':{'ListId':_0x443a4c[_0x023a('0x29')][_0x023a('0x60')],'CampaignId':_0x443a4c[_0x023a('0x3d')]['id']}})['then'](function(){return _0x178b7c;});}})[_0x023a('0x20')](respondWithStatusCode(_0x3bd443,null))[_0x023a('0x3b')](handleError(_0x3bd443,null));};
\ No newline at end of file
index 501fd50..656f5cb 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(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x5509a8,_0x1a8b93){var _0x5383b1=function(_0x14cde3){while(--_0x14cde3){_0x5509a8['push'](_0x5509a8['shift']());}};_0x5383b1(++_0x1a8b93);}(_0x7a54,0x106));var _0x47a5=function(_0x55215a,_0x19cbd2){_0x55215a=_0x55215a-0x0;var _0x265e45=_0x7a54[_0x55215a];return _0x265e45;};'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 2b10762..2986a3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1c4=['message','result','catch','GetCampaign','Campaign','findAll','options','raw','map','include','model','attributes','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x1caf3f,_0x1b4800){var _0x1905f0=function(_0x36e1eb){while(--_0x36e1eb){_0x1caf3f['push'](_0x1caf3f['shift']());}};_0x1905f0(++_0x1b4800);}(_0xc1c4,0x1c7));var _0x4c1c=function(_0x104abc,_0x142a9c){_0x104abc=_0x104abc-0x0;var _0x5c35a7=_0xc1c4[_0x104abc];return _0x5c35a7;};'use strict';var _=require(_0x4c1c('0x0'));var util=require(_0x4c1c('0x1'));var moment=require(_0x4c1c('0x2'));var BPromise=require(_0x4c1c('0x3'));var rs=require(_0x4c1c('0x4'));var fs=require('fs');var Redis=require(_0x4c1c('0x5'));var db=require(_0x4c1c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c1c('0x7'))(_0x4c1c('0x8'));var config=require(_0x4c1c('0x9'));var jayson=require(_0x4c1c('0xa'));var client=jayson['client'][_0x4c1c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f5a4f,_0x5863d0,_0x20e276){return new BPromise(function(_0x3337e4,_0x486065){return client[_0x4c1c('0xc')](_0x4f5a4f,_0x20e276)[_0x4c1c('0xd')](function(_0x445441){logger[_0x4c1c('0xe')](_0x4c1c('0xf'),_0x5863d0,'request\x20sent');logger['debug'](_0x4c1c('0x10'),_0x5863d0,_0x4c1c('0x11'),JSON[_0x4c1c('0x12')](_0x445441));if(_0x445441[_0x4c1c('0x13')]){if(_0x445441[_0x4c1c('0x13')][_0x4c1c('0x14')]===0x1f4){logger['error']('Campaign,\x20%s,\x20%s',_0x5863d0,_0x445441[_0x4c1c('0x13')][_0x4c1c('0x15')]);return _0x486065(_0x445441[_0x4c1c('0x13')][_0x4c1c('0x15')]);}logger[_0x4c1c('0x13')]('Campaign,\x20%s,\x20%s',_0x5863d0,_0x445441[_0x4c1c('0x13')][_0x4c1c('0x15')]);return _0x3337e4(_0x445441['error'][_0x4c1c('0x15')]);}else{logger[_0x4c1c('0xe')](_0x4c1c('0xf'),_0x5863d0,_0x4c1c('0x11'));_0x3337e4(_0x445441[_0x4c1c('0x16')][_0x4c1c('0x15')]);}})[_0x4c1c('0x17')](function(_0x33641d){logger[_0x4c1c('0x13')](_0x4c1c('0xf'),_0x5863d0,_0x33641d);_0x486065(_0x33641d);});});}exports[_0x4c1c('0x18')]=function(_0x5a9217){var _0x1fad89=this;return new Promise(function(_0x213019,_0x64fe4b){return db[_0x4c1c('0x19')][_0x4c1c('0x1a')]({'raw':_0x5a9217[_0x4c1c('0x1b')]?_0x5a9217[_0x4c1c('0x1b')][_0x4c1c('0x1c')]===undefined?!![]:![]:!![],'where':_0x5a9217[_0x4c1c('0x1b')]?_0x5a9217[_0x4c1c('0x1b')]['where']||null:null,'attributes':_0x5a9217['options']?_0x5a9217[_0x4c1c('0x1b')]['attributes']||null:null,'limit':_0x5a9217[_0x4c1c('0x1b')]?_0x5a9217[_0x4c1c('0x1b')]['limit']||null:null,'include':_0x5a9217[_0x4c1c('0x1b')]?_0x5a9217['options']['include']?_[_0x4c1c('0x1d')](_0x5a9217[_0x4c1c('0x1b')][_0x4c1c('0x1e')],function(_0x13c2a1){return{'model':db[_0x13c2a1[_0x4c1c('0x1f')]],'as':_0x13c2a1['as'],'attributes':_0x13c2a1['attributes'],'include':_0x13c2a1[_0x4c1c('0x1e')]?_[_0x4c1c('0x1d')](_0x13c2a1[_0x4c1c('0x1e')],function(_0x1ec87a){return{'model':db[_0x1ec87a[_0x4c1c('0x1f')]],'as':_0x1ec87a['as'],'attributes':_0x1ec87a['attributes'],'include':_0x1ec87a['include']?_[_0x4c1c('0x1d')](_0x1ec87a['include'],function(_0x1104d4){return{'model':db[_0x1104d4['model']],'as':_0x1104d4['as'],'attributes':_0x1104d4[_0x4c1c('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4c1c('0xd')](function(_0x38f7f7){logger['info'](_0x4c1c('0x18'),_0x5a9217);logger[_0x4c1c('0x21')](_0x4c1c('0x18'),_0x5a9217,JSON[_0x4c1c('0x12')](_0x38f7f7));_0x213019(_0x38f7f7);})[_0x4c1c('0x17')](function(_0x281286){logger[_0x4c1c('0x13')](_0x4c1c('0x18'),_0x281286['message'],_0x5a9217);_0x64fe4b(_0x1fad89['error'](0x1f4,_0x281286['message']));});});};
\ No newline at end of file
+var _0x45c8=['debug','stringify','error','code','message','result','options','raw','where','attributes','include','model','map','GetCampaign','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent'];(function(_0x200556,_0x486dda){var _0x569faa=function(_0x2299b4){while(--_0x2299b4){_0x200556['push'](_0x200556['shift']());}};_0x569faa(++_0x486dda);}(_0x45c8,0xef));var _0x845c=function(_0x376573,_0x5eea01){_0x376573=_0x376573-0x0;var _0x23e41b=_0x45c8[_0x376573];return _0x23e41b;};'use strict';var _=require(_0x845c('0x0'));var util=require('util');var moment=require(_0x845c('0x1'));var BPromise=require(_0x845c('0x2'));var rs=require(_0x845c('0x3'));var fs=require('fs');var Redis=require(_0x845c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x845c('0x5'));var jayson=require(_0x845c('0x6'));var client=jayson[_0x845c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x335f38,_0x4a1a42,_0x42b569){return new BPromise(function(_0x4648e1,_0x3075cd){return client[_0x845c('0x8')](_0x335f38,_0x42b569)[_0x845c('0x9')](function(_0x34a8ae){logger[_0x845c('0xa')](_0x845c('0xb'),_0x4a1a42,_0x845c('0xc'));logger[_0x845c('0xd')]('Campaign,\x20%s,\x20%s,\x20%s',_0x4a1a42,'request\x20sent',JSON[_0x845c('0xe')](_0x34a8ae));if(_0x34a8ae[_0x845c('0xf')]){if(_0x34a8ae['error'][_0x845c('0x10')]===0x1f4){logger[_0x845c('0xf')](_0x845c('0xb'),_0x4a1a42,_0x34a8ae[_0x845c('0xf')][_0x845c('0x11')]);return _0x3075cd(_0x34a8ae[_0x845c('0xf')]['message']);}logger[_0x845c('0xf')](_0x845c('0xb'),_0x4a1a42,_0x34a8ae['error'][_0x845c('0x11')]);return _0x4648e1(_0x34a8ae[_0x845c('0xf')][_0x845c('0x11')]);}else{logger[_0x845c('0xa')](_0x845c('0xb'),_0x4a1a42,_0x845c('0xc'));_0x4648e1(_0x34a8ae[_0x845c('0x12')]['message']);}})['catch'](function(_0x3b1ff9){logger[_0x845c('0xf')](_0x845c('0xb'),_0x4a1a42,_0x3b1ff9);_0x3075cd(_0x3b1ff9);});});}exports['GetCampaign']=function(_0x1f9bed){var _0x104314=this;return new Promise(function(_0x452b54,_0x48e7d4){return db['Campaign']['findAll']({'raw':_0x1f9bed[_0x845c('0x13')]?_0x1f9bed['options'][_0x845c('0x14')]===undefined?!![]:![]:!![],'where':_0x1f9bed[_0x845c('0x13')]?_0x1f9bed[_0x845c('0x13')][_0x845c('0x15')]||null:null,'attributes':_0x1f9bed[_0x845c('0x13')]?_0x1f9bed['options'][_0x845c('0x16')]||null:null,'limit':_0x1f9bed['options']?_0x1f9bed[_0x845c('0x13')]['limit']||null:null,'include':_0x1f9bed[_0x845c('0x13')]?_0x1f9bed['options'][_0x845c('0x17')]?_['map'](_0x1f9bed[_0x845c('0x13')][_0x845c('0x17')],function(_0x362975){return{'model':db[_0x362975[_0x845c('0x18')]],'as':_0x362975['as'],'attributes':_0x362975[_0x845c('0x16')],'include':_0x362975[_0x845c('0x17')]?_['map'](_0x362975[_0x845c('0x17')],function(_0x5e3ec8){return{'model':db[_0x5e3ec8[_0x845c('0x18')]],'as':_0x5e3ec8['as'],'attributes':_0x5e3ec8[_0x845c('0x16')],'include':_0x5e3ec8['include']?_[_0x845c('0x19')](_0x5e3ec8[_0x845c('0x17')],function(_0x189c19){return{'model':db[_0x189c19['model']],'as':_0x189c19['as'],'attributes':_0x189c19['attributes']};}):[]};}):[]};}):[]:[]})[_0x845c('0x9')](function(_0x2a3c1d){logger[_0x845c('0xa')]('GetCampaign',_0x1f9bed);logger[_0x845c('0xd')](_0x845c('0x1a'),_0x1f9bed,JSON[_0x845c('0xe')](_0x2a3c1d));_0x452b54(_0x2a3c1d);})[_0x845c('0x1b')](function(_0x5d7b58){logger[_0x845c('0xf')](_0x845c('0x1a'),_0x5d7b58[_0x845c('0x11')],_0x1f9bed);_0x48e7d4(_0x104314['error'](0x1f4,_0x5d7b58[_0x845c('0x11')]));});});};
\ No newline at end of file
index 66a6ab6..4c223ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2303=['getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','addLists','addBlackLists','put','update','delete','destroy','removeLists','removeBlackLists','multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists'];(function(_0x587dd0,_0x273922){var _0x56f153=function(_0x27fb33){while(--_0x27fb33){_0x587dd0['push'](_0x587dd0['shift']());}};_0x56f153(++_0x273922);}(_0x2303,0x75));var _0x3230=function(_0x55eb05,_0x36eb0d){_0x55eb05=_0x55eb05-0x0;var _0x5cefb6=_0x2303[_0x55eb05];return _0x5cefb6;};'use strict';var multer=require(_0x3230('0x0'));var util=require(_0x3230('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x3230('0x2'));var auth=require(_0x3230('0x3'));var interaction=require(_0x3230('0x4'));var config=require(_0x3230('0x5'));var controller=require(_0x3230('0x6'));router[_0x3230('0x7')]('/',auth[_0x3230('0x8')](),controller[_0x3230('0x9')]);router[_0x3230('0x7')](_0x3230('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x3230('0x7')](_0x3230('0xb'),auth[_0x3230('0x8')](),controller[_0x3230('0xc')]);router[_0x3230('0x7')](_0x3230('0xd'),auth[_0x3230('0x8')](),controller[_0x3230('0xe')]);router[_0x3230('0x7')](_0x3230('0xf'),auth[_0x3230('0x8')](),controller['getHopperFinals']);router[_0x3230('0x7')](_0x3230('0x10'),auth[_0x3230('0x8')](),controller[_0x3230('0x11')]);router[_0x3230('0x7')](_0x3230('0x12'),auth[_0x3230('0x8')](),controller[_0x3230('0x13')]);router[_0x3230('0x7')](_0x3230('0x14'),auth[_0x3230('0x8')](),controller[_0x3230('0x15')]);router['post']('/',auth[_0x3230('0x8')](),controller[_0x3230('0x16')]);router[_0x3230('0x17')](_0x3230('0x18'),auth[_0x3230('0x8')](),controller[_0x3230('0x19')]);router[_0x3230('0x17')](_0x3230('0x12'),auth[_0x3230('0x8')](),controller[_0x3230('0x1a')]);router['post'](_0x3230('0x14'),auth['isAuthenticated'](),controller[_0x3230('0x1b')]);router[_0x3230('0x1c')](_0x3230('0xa'),auth[_0x3230('0x8')](),controller[_0x3230('0x1d')]);router[_0x3230('0x1e')]('/:id',auth['isAuthenticated'](),controller[_0x3230('0x1f')]);router['delete'](_0x3230('0x12'),auth['isAuthenticated'](),controller[_0x3230('0x20')]);router[_0x3230('0x1e')](_0x3230('0x14'),auth[_0x3230('0x8')](),controller[_0x3230('0x21')]);module['exports']=router;
\ No newline at end of file
+var _0xf774=['index','get','/:id','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addLists','addBlackLists','put','delete','destroy','removeLists','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated'];(function(_0x25b4a4,_0x2e081b){var _0x707267=function(_0x440123){while(--_0x440123){_0x25b4a4['push'](_0x25b4a4['shift']());}};_0x707267(++_0x2e081b);}(_0xf774,0x1e4));var _0x4f77=function(_0x5f1a58,_0x45c87d){_0x5f1a58=_0x5f1a58-0x0;var _0x2bf6c5=_0xf774[_0x5f1a58];return _0x2bf6c5;};'use strict';var multer=require(_0x4f77('0x0'));var util=require(_0x4f77('0x1'));var path=require(_0x4f77('0x2'));var timeout=require(_0x4f77('0x3'));var express=require(_0x4f77('0x4'));var router=express['Router']();var fs_extra=require(_0x4f77('0x5'));var auth=require(_0x4f77('0x6'));var interaction=require(_0x4f77('0x7'));var config=require(_0x4f77('0x8'));var controller=require(_0x4f77('0x9'));router['get']('/',auth[_0x4f77('0xa')](),controller[_0x4f77('0xb')]);router[_0x4f77('0xc')](_0x4f77('0xd'),auth[_0x4f77('0xa')](),controller['show']);router[_0x4f77('0xc')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x4f77('0xe')]);router[_0x4f77('0xc')](_0x4f77('0xf'),auth[_0x4f77('0xa')](),controller['getHopperHistories']);router[_0x4f77('0xc')](_0x4f77('0x10'),auth[_0x4f77('0xa')](),controller[_0x4f77('0x11')]);router[_0x4f77('0xc')](_0x4f77('0x12'),auth['isAuthenticated'](),controller[_0x4f77('0x13')]);router[_0x4f77('0xc')](_0x4f77('0x14'),auth['isAuthenticated'](),controller[_0x4f77('0x15')]);router['get'](_0x4f77('0x16'),auth[_0x4f77('0xa')](),controller[_0x4f77('0x17')]);router[_0x4f77('0x18')]('/',auth['isAuthenticated'](),controller[_0x4f77('0x19')]);router[_0x4f77('0x18')](_0x4f77('0x1a'),auth[_0x4f77('0xa')](),controller['clone']);router[_0x4f77('0x18')]('/:id/lists',auth[_0x4f77('0xa')](),controller[_0x4f77('0x1b')]);router[_0x4f77('0x18')](_0x4f77('0x16'),auth[_0x4f77('0xa')](),controller[_0x4f77('0x1c')]);router[_0x4f77('0x1d')]('/:id',auth[_0x4f77('0xa')](),controller['update']);router[_0x4f77('0x1e')](_0x4f77('0xd'),auth[_0x4f77('0xa')](),controller[_0x4f77('0x1f')]);router[_0x4f77('0x1e')](_0x4f77('0x14'),auth[_0x4f77('0xa')](),controller[_0x4f77('0x20')]);router['delete'](_0x4f77('0x16'),auth[_0x4f77('0xa')](),controller['removeBlackLists']);module['exports']=router;
\ No newline at end of file
index 5ed33c5..cd697b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe439=['getDataValue','sequelize','exports','TEXT','STRING','VIRTUAL'];(function(_0x27e811,_0x20137c){var _0x1627fa=function(_0x4498ca){while(--_0x4498ca){_0x27e811['push'](_0x27e811['shift']());}};_0x1627fa(++_0x20137c);}(_0xe439,0x6d));var _0x9e43=function(_0x4e3719,_0x3a6289){_0x4e3719=_0x4e3719-0x0;var _0x4c761c=_0xe439[_0x4e3719];return _0x4c761c;};'use strict';var Sequelize=require(_0x9e43('0x0'));module[_0x9e43('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x9e43('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9e43('0x3')]},'name':{'type':Sequelize[_0x9e43('0x4')],'get':function(){return this[_0x9e43('0x5')]('key');}}};
\ No newline at end of file
+var _0xbd92=['STRING','VIRTUAL','getDataValue','sequelize','exports','TEXT'];(function(_0xd87364,_0x3a60d8){var _0x23761e=function(_0x5d6f28){while(--_0x5d6f28){_0xd87364['push'](_0xd87364['shift']());}};_0x23761e(++_0x3a60d8);}(_0xbd92,0x1d1));var _0x2bd9=function(_0xb6ea0a,_0x3e2964){_0xb6ea0a=_0xb6ea0a-0x0;var _0x46464a=_0xbd92[_0xb6ea0a];return _0x46464a;};'use strict';var Sequelize=require(_0x2bd9('0x0'));module[_0x2bd9('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x2bd9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2bd9('0x3')]},'name':{'type':Sequelize[_0x2bd9('0x4')],'get':function(){return this[_0x2bd9('0x5')]('key');}}};
\ No newline at end of file
index 08345cd..ff48ce0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99b3=['count','set','Content-Range','apply','reject','save','then','get','UserProfileResource','error','name','send','index','CannedAnswer','rawAttributes','fieldName','type','model','map','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','includeAll','include','findAll','rows','catch','show','params','keys','options','find','update','body','destroy','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x99b3,0x196));var _0x399b=function(_0x58249f,_0x4668b5){_0x58249f=_0x58249f-0x0;var _0x2d0221=_0x99b3[_0x58249f];return _0x2d0221;};'use strict';var emlformat=require(_0x399b('0x0'));var rimraf=require(_0x399b('0x1'));var zipdir=require(_0x399b('0x2'));var jsonpatch=require(_0x399b('0x3'));var rp=require(_0x399b('0x4'));var moment=require(_0x399b('0x5'));var BPromise=require(_0x399b('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x399b('0x7'));var sox=require(_0x399b('0x8'));var csv=require('to-csv');var ejs=require(_0x399b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x399b('0xa'));var jsforce=require(_0x399b('0xb'));var deskjs=require(_0x399b('0xc'));var toCsv=require(_0x399b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x399b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x399b('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x399b('0x10'));var logger=require(_0x399b('0x11'))(_0x399b('0x12'));var utils=require(_0x399b('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x399b('0x14'));var db=require(_0x399b('0x15'))['db'];function respondWithStatusCode(_0xcfe7a2,_0x3e4f25){_0x3e4f25=_0x3e4f25||0xcc;return function(_0x3954a1){if(_0x3954a1){return _0xcfe7a2[_0x399b('0x16')](_0x3e4f25);}return _0xcfe7a2[_0x399b('0x17')](_0x3e4f25)[_0x399b('0x18')]();};}function respondWithResult(_0x59bf43,_0xc05882){_0xc05882=_0xc05882||0xc8;return function(_0x41c6e6){if(_0x41c6e6){return _0x59bf43[_0x399b('0x17')](_0xc05882)[_0x399b('0x19')](_0x41c6e6);}};}function respondWithFilteredResult(_0x2cb7ec,_0x3f088a){return function(_0x2ae1d0){if(_0x2ae1d0){var _0x138c77=typeof _0x3f088a[_0x399b('0x1a')]===_0x399b('0x1b')&&typeof _0x3f088a[_0x399b('0x1c')]===_0x399b('0x1b');var _0x4793c6=_0x2ae1d0[_0x399b('0x1d')];var _0x2db9aa=_0x138c77?0x0:_0x3f088a[_0x399b('0x1a')];var _0x1be9e4=_0x138c77?_0x2ae1d0[_0x399b('0x1d')]:_0x3f088a[_0x399b('0x1a')]+_0x3f088a[_0x399b('0x1c')];var _0xd149e5;if(_0x1be9e4>=_0x4793c6){_0x1be9e4=_0x4793c6;_0xd149e5=0xc8;}else{_0xd149e5=0xce;}_0x2cb7ec['status'](_0xd149e5);return _0x2cb7ec[_0x399b('0x1e')](_0x399b('0x1f'),_0x2db9aa+'-'+_0x1be9e4+'/'+_0x4793c6)['json'](_0x2ae1d0);}return null;};}function patchUpdates(_0x5a6aad){return function(_0x5dd868){try{jsonpatch[_0x399b('0x20')](_0x5dd868,_0x5a6aad,!![]);}catch(_0x90c0eb){return BPromise[_0x399b('0x21')](_0x90c0eb);}return _0x5dd868[_0x399b('0x22')]();};}function saveUpdates(_0x50a1b8,_0x54da07){return function(_0x4f1b30){if(_0x4f1b30){return _0x4f1b30['update'](_0x50a1b8)[_0x399b('0x23')](function(_0x407077){return _0x407077;});}return null;};}function removeEntity(_0x13c864,_0xf6c33c){return function(_0x1f5fa3){if(_0x1f5fa3){return _0x1f5fa3['destroy']()[_0x399b('0x23')](function(){var _0x4e6207=_0x1f5fa3[_0x399b('0x24')]({'plain':!![]});var _0x59b488='CannedAnswers';return db[_0x399b('0x25')]['destroy']({'where':{'type':_0x59b488,'resourceId':_0x4e6207['id']}})[_0x399b('0x23')](function(){return _0x1f5fa3;});})[_0x399b('0x23')](function(){_0x13c864[_0x399b('0x17')](0xcc)[_0x399b('0x18')]();});}};}function handleEntityNotFound(_0x4fbddf,_0x1e544c){return function(_0x327690){if(!_0x327690){_0x4fbddf[_0x399b('0x16')](0x194);}return _0x327690;};}function handleError(_0x6b9dae,_0x15c1e7){_0x15c1e7=_0x15c1e7||0x1f4;return function(_0x43e853){logger[_0x399b('0x26')](_0x43e853['stack']);if(_0x43e853[_0x399b('0x27')]){delete _0x43e853[_0x399b('0x27')];}_0x6b9dae[_0x399b('0x17')](_0x15c1e7)[_0x399b('0x28')](_0x43e853);};}exports[_0x399b('0x29')]=function(_0x106a18,_0x3db879){var _0x4a9be5={},_0x3bdfe6={},_0x2a3185={'count':0x0,'rows':[]};var _0x29224b=_['map'](db[_0x399b('0x2a')][_0x399b('0x2b')],function(_0x45718a){return{'name':_0x45718a[_0x399b('0x2c')],'type':_0x45718a[_0x399b('0x2d')]['key']};});_0x3bdfe6[_0x399b('0x2e')]=_[_0x399b('0x2f')](_0x29224b,_0x399b('0x27'));_0x3bdfe6['query']=_['keys'](_0x106a18['query']);_0x3bdfe6[_0x399b('0x30')]=_[_0x399b('0x31')](_0x3bdfe6['model'],_0x3bdfe6[_0x399b('0x32')]);_0x4a9be5[_0x399b('0x33')]=_[_0x399b('0x31')](_0x3bdfe6[_0x399b('0x2e')],qs[_0x399b('0x34')](_0x106a18[_0x399b('0x32')][_0x399b('0x34')]));_0x4a9be5[_0x399b('0x33')]=_0x4a9be5[_0x399b('0x33')][_0x399b('0x35')]?_0x4a9be5[_0x399b('0x33')]:_0x3bdfe6[_0x399b('0x2e')];if(!_0x106a18[_0x399b('0x32')][_0x399b('0x36')](_0x399b('0x37'))){_0x4a9be5[_0x399b('0x1c')]=qs[_0x399b('0x1c')](_0x106a18[_0x399b('0x32')][_0x399b('0x1c')]);_0x4a9be5[_0x399b('0x1a')]=qs[_0x399b('0x1a')](_0x106a18[_0x399b('0x32')]['offset']);}_0x4a9be5[_0x399b('0x38')]=qs[_0x399b('0x39')](_0x106a18[_0x399b('0x32')]['sort']);_0x4a9be5[_0x399b('0x3a')]=qs[_0x399b('0x30')](_[_0x399b('0x3b')](_0x106a18[_0x399b('0x32')],_0x3bdfe6[_0x399b('0x30')]),_0x29224b);if(_0x106a18[_0x399b('0x32')][_0x399b('0x3c')]){_0x4a9be5[_0x399b('0x3a')]=_['merge'](_0x4a9be5[_0x399b('0x3a')],{'$or':[{'key':{'$like':'%'+_0x106a18['query'][_0x399b('0x3c')]+'%'}},{'value':{'$like':'%'+_0x106a18[_0x399b('0x32')][_0x399b('0x3c')]+'%'}}]});}_0x4a9be5=_['merge']({},_0x4a9be5,_0x106a18['options']);var _0x16aa6e={'where':_0x4a9be5[_0x399b('0x3a')]};return db[_0x399b('0x2a')][_0x399b('0x1d')](_0x16aa6e)[_0x399b('0x23')](function(_0x43b7e4){_0x2a3185[_0x399b('0x1d')]=_0x43b7e4;if(_0x106a18[_0x399b('0x32')][_0x399b('0x3d')]){_0x4a9be5[_0x399b('0x3e')]=[{'all':!![]}];}return db['CannedAnswer'][_0x399b('0x3f')](_0x4a9be5);})[_0x399b('0x23')](function(_0x4abbed){_0x2a3185[_0x399b('0x40')]=_0x4abbed;return _0x2a3185;})[_0x399b('0x23')](respondWithFilteredResult(_0x3db879,_0x4a9be5))[_0x399b('0x41')](handleError(_0x3db879,null));};exports[_0x399b('0x42')]=function(_0x2c4cc8,_0x16bfe3){var _0x254e33={'raw':!![],'where':{'id':_0x2c4cc8[_0x399b('0x43')]['id']}},_0x3af16e={};_0x3af16e[_0x399b('0x2e')]=_['keys'](db[_0x399b('0x2a')]['rawAttributes']);_0x3af16e[_0x399b('0x32')]=_[_0x399b('0x44')](_0x2c4cc8[_0x399b('0x32')]);_0x3af16e['filters']=_[_0x399b('0x31')](_0x3af16e['model'],_0x3af16e['query']);_0x254e33[_0x399b('0x33')]=_[_0x399b('0x31')](_0x3af16e['model'],qs[_0x399b('0x34')](_0x2c4cc8[_0x399b('0x32')][_0x399b('0x34')]));_0x254e33[_0x399b('0x33')]=_0x254e33['attributes']['length']?_0x254e33[_0x399b('0x33')]:_0x3af16e[_0x399b('0x2e')];if(_0x2c4cc8[_0x399b('0x32')][_0x399b('0x3d')]){_0x254e33[_0x399b('0x3e')]=[{'all':!![]}];}_0x254e33=_['merge']({},_0x254e33,_0x2c4cc8[_0x399b('0x45')]);return db[_0x399b('0x2a')][_0x399b('0x46')](_0x254e33)[_0x399b('0x23')](handleEntityNotFound(_0x16bfe3,null))[_0x399b('0x23')](respondWithResult(_0x16bfe3,null))[_0x399b('0x41')](handleError(_0x16bfe3,null));};exports[_0x399b('0x47')]=function(_0x102997,_0x36a8ca){if(_0x102997[_0x399b('0x48')]['id']){delete _0x102997['body']['id'];}return db['CannedAnswer'][_0x399b('0x46')]({'where':{'id':_0x102997[_0x399b('0x43')]['id']}})[_0x399b('0x23')](handleEntityNotFound(_0x36a8ca,null))[_0x399b('0x23')](saveUpdates(_0x102997['body'],null))[_0x399b('0x23')](respondWithResult(_0x36a8ca,null))[_0x399b('0x41')](handleError(_0x36a8ca,null));};exports[_0x399b('0x49')]=function(_0x2669ca,_0x53ef2f){return db['CannedAnswer']['find']({'where':{'id':_0x2669ca[_0x399b('0x43')]['id']}})['then'](handleEntityNotFound(_0x53ef2f,null))[_0x399b('0x23')](removeEntity(_0x53ef2f,null))[_0x399b('0x41')](handleError(_0x53ef2f,null));};exports[_0x399b('0x4a')]=function(_0x495787,_0x598673){var _0x1fdfb3={'key':_0x495787[_0x399b('0x48')][_0x399b('0x4b')]};if(_0x495787['body'][_0x399b('0x4c')]){_0x1fdfb3['MailAccountId']=_0x495787[_0x399b('0x48')][_0x399b('0x4c')];}else if(_0x495787['body'][_0x399b('0x4d')]){_0x1fdfb3[_0x399b('0x4d')]=_0x495787[_0x399b('0x48')]['SmsAccountId'];}else if(_0x495787[_0x399b('0x48')]['OpenchannelAccountId']){_0x1fdfb3[_0x399b('0x4e')]=_0x495787[_0x399b('0x48')][_0x399b('0x4e')];}else if(_0x495787[_0x399b('0x48')][_0x399b('0x4f')]){_0x1fdfb3['ChatWebsiteId']=_0x495787[_0x399b('0x48')][_0x399b('0x4f')];}return db[_0x399b('0x2a')][_0x399b('0x46')]({'where':_0x1fdfb3})['then'](function(_0x43940d){if(_0x43940d){throw new db[(_0x399b('0x50'))][(_0x399b('0x51'))](_0x399b('0x52'));}return db[_0x399b('0x2a')][_0x399b('0x4a')](_0x495787[_0x399b('0x48')]);})[_0x399b('0x23')](function(_0x485d3a){var _0x54de6c=_0x495787[_0x399b('0x53')][_0x399b('0x24')]({'plain':!![]});if(!_0x54de6c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54de6c['role']===_0x399b('0x53')){var _0x3d2d61=_0x485d3a['get']({'plain':!![]});return db[_0x399b('0x54')]['find']({'where':{'name':'CannedAnswers','userProfileId':_0x54de6c['userProfileId']},'raw':!![]})[_0x399b('0x23')](function(_0x1126c2){if(_0x1126c2&&_0x1126c2[_0x399b('0x55')]===0x0){return db[_0x399b('0x25')][_0x399b('0x4a')]({'name':_0x3d2d61[_0x399b('0x27')],'resourceId':_0x3d2d61['id'],'type':_0x1126c2['name'],'sectionId':_0x1126c2['id']},{})['then'](function(){return _0x485d3a;});}else{return _0x485d3a;}})[_0x399b('0x41')](function(_0x40a47f){logger[_0x399b('0x26')](_0x399b('0x56'),_0x40a47f);throw _0x40a47f;});}return _0x485d3a;})[_0x399b('0x23')](respondWithResult(_0x598673,0xc9))[_0x399b('0x41')](handleError(_0x598673,null));};
\ No newline at end of file
+var _0x8385=['merge','options','includeAll','findAll','rows','catch','show','params','include','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','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','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','send','index','map','CannedAnswer','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter'];(function(_0x3a7e97,_0x3ea0ab){var _0x3a1841=function(_0x13d4cb){while(--_0x13d4cb){_0x3a7e97['push'](_0x3a7e97['shift']());}};_0x3a1841(++_0x3ea0ab);}(_0x8385,0x75));var _0x5838=function(_0x36eaca,_0x390731){_0x36eaca=_0x36eaca-0x0;var _0x54f561=_0x8385[_0x36eaca];return _0x54f561;};'use strict';var emlformat=require(_0x5838('0x0'));var rimraf=require(_0x5838('0x1'));var zipdir=require(_0x5838('0x2'));var jsonpatch=require(_0x5838('0x3'));var rp=require(_0x5838('0x4'));var moment=require(_0x5838('0x5'));var BPromise=require(_0x5838('0x6'));var Mustache=require(_0x5838('0x7'));var util=require(_0x5838('0x8'));var path=require(_0x5838('0x9'));var sox=require(_0x5838('0xa'));var csv=require('to-csv');var ejs=require(_0x5838('0xb'));var fs=require('fs');var fs_extra=require(_0x5838('0xc'));var _=require(_0x5838('0xd'));var squel=require(_0x5838('0xe'));var crypto=require(_0x5838('0xf'));var jsforce=require(_0x5838('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x5838('0x11'));var querystring=require(_0x5838('0x12'));var Papa=require('papaparse');var Redis=require(_0x5838('0x13'));var authService=require(_0x5838('0x14'));var qs=require(_0x5838('0x15'));var as=require(_0x5838('0x16'));var hardwareService=require(_0x5838('0x17'));var logger=require('../../config/logger')(_0x5838('0x18'));var utils=require('../../config/utils');var config=require(_0x5838('0x19'));var licenseUtil=require(_0x5838('0x1a'));var db=require(_0x5838('0x1b'))['db'];function respondWithStatusCode(_0x4400cb,_0x35a67c){_0x35a67c=_0x35a67c||0xcc;return function(_0x4c8c7b){if(_0x4c8c7b){return _0x4400cb['sendStatus'](_0x35a67c);}return _0x4400cb[_0x5838('0x1c')](_0x35a67c)[_0x5838('0x1d')]();};}function respondWithResult(_0x1065f2,_0x459b71){_0x459b71=_0x459b71||0xc8;return function(_0x403748){if(_0x403748){return _0x1065f2[_0x5838('0x1c')](_0x459b71)[_0x5838('0x1e')](_0x403748);}};}function respondWithFilteredResult(_0x70b87,_0x12203a){return function(_0x3e05fd){if(_0x3e05fd){var _0x5813f1=typeof _0x12203a['offset']===_0x5838('0x1f')&&typeof _0x12203a[_0x5838('0x20')]==='undefined';var _0x1cb94f=_0x3e05fd[_0x5838('0x21')];var _0x3507a2=_0x5813f1?0x0:_0x12203a[_0x5838('0x22')];var _0x3e0ed9=_0x5813f1?_0x3e05fd[_0x5838('0x21')]:_0x12203a[_0x5838('0x22')]+_0x12203a[_0x5838('0x20')];var _0x1abf88;if(_0x3e0ed9>=_0x1cb94f){_0x3e0ed9=_0x1cb94f;_0x1abf88=0xc8;}else{_0x1abf88=0xce;}_0x70b87[_0x5838('0x1c')](_0x1abf88);return _0x70b87[_0x5838('0x23')]('Content-Range',_0x3507a2+'-'+_0x3e0ed9+'/'+_0x1cb94f)[_0x5838('0x1e')](_0x3e05fd);}return null;};}function patchUpdates(_0x1bcaf2){return function(_0x1f11ea){try{jsonpatch['apply'](_0x1f11ea,_0x1bcaf2,!![]);}catch(_0x3f1771){return BPromise[_0x5838('0x24')](_0x3f1771);}return _0x1f11ea[_0x5838('0x25')]();};}function saveUpdates(_0x5a3434,_0xa93088){return function(_0x1cf036){if(_0x1cf036){return _0x1cf036['update'](_0x5a3434)[_0x5838('0x26')](function(_0x65beb7){return _0x65beb7;});}return null;};}function removeEntity(_0x185307,_0x3eba5b){return function(_0xee895c){if(_0xee895c){return _0xee895c[_0x5838('0x27')]()[_0x5838('0x26')](function(){var _0x13f338=_0xee895c[_0x5838('0x28')]({'plain':!![]});var _0xb9df3b=_0x5838('0x29');return db[_0x5838('0x2a')][_0x5838('0x27')]({'where':{'type':_0xb9df3b,'resourceId':_0x13f338['id']}})[_0x5838('0x26')](function(){return _0xee895c;});})[_0x5838('0x26')](function(){_0x185307[_0x5838('0x1c')](0xcc)[_0x5838('0x1d')]();});}};}function handleEntityNotFound(_0x370241,_0x5e88c3){return function(_0x1eaa8c){if(!_0x1eaa8c){_0x370241[_0x5838('0x2b')](0x194);}return _0x1eaa8c;};}function handleError(_0x302b37,_0x1be547){_0x1be547=_0x1be547||0x1f4;return function(_0x8bbb9e){logger[_0x5838('0x2c')](_0x8bbb9e[_0x5838('0x2d')]);if(_0x8bbb9e[_0x5838('0x2e')]){delete _0x8bbb9e['name'];}_0x302b37['status'](_0x1be547)[_0x5838('0x2f')](_0x8bbb9e);};}exports[_0x5838('0x30')]=function(_0x25b518,_0x2c8e88){var _0x2987ec={},_0x2313fd={},_0x1f0d9b={'count':0x0,'rows':[]};var _0x3d95d6=_[_0x5838('0x31')](db[_0x5838('0x32')][_0x5838('0x33')],function(_0x228079){return{'name':_0x228079['fieldName'],'type':_0x228079[_0x5838('0x34')]['key']};});_0x2313fd[_0x5838('0x35')]=_[_0x5838('0x31')](_0x3d95d6,_0x5838('0x2e'));_0x2313fd[_0x5838('0x36')]=_[_0x5838('0x37')](_0x25b518[_0x5838('0x36')]);_0x2313fd[_0x5838('0x38')]=_[_0x5838('0x39')](_0x2313fd[_0x5838('0x35')],_0x2313fd[_0x5838('0x36')]);_0x2987ec[_0x5838('0x3a')]=_[_0x5838('0x39')](_0x2313fd['model'],qs[_0x5838('0x3b')](_0x25b518[_0x5838('0x36')][_0x5838('0x3b')]));_0x2987ec['attributes']=_0x2987ec[_0x5838('0x3a')][_0x5838('0x3c')]?_0x2987ec[_0x5838('0x3a')]:_0x2313fd[_0x5838('0x35')];if(!_0x25b518[_0x5838('0x36')]['hasOwnProperty'](_0x5838('0x3d'))){_0x2987ec[_0x5838('0x20')]=qs[_0x5838('0x20')](_0x25b518[_0x5838('0x36')]['limit']);_0x2987ec[_0x5838('0x22')]=qs[_0x5838('0x22')](_0x25b518[_0x5838('0x36')][_0x5838('0x22')]);}_0x2987ec[_0x5838('0x3e')]=qs[_0x5838('0x3f')](_0x25b518[_0x5838('0x36')][_0x5838('0x3f')]);_0x2987ec[_0x5838('0x40')]=qs[_0x5838('0x38')](_[_0x5838('0x41')](_0x25b518['query'],_0x2313fd[_0x5838('0x38')]),_0x3d95d6);if(_0x25b518['query'][_0x5838('0x42')]){_0x2987ec[_0x5838('0x40')]=_[_0x5838('0x43')](_0x2987ec[_0x5838('0x40')],{'$or':[{'key':{'$like':'%'+_0x25b518['query'][_0x5838('0x42')]+'%'}},{'value':{'$like':'%'+_0x25b518[_0x5838('0x36')][_0x5838('0x42')]+'%'}}]});}_0x2987ec=_['merge']({},_0x2987ec,_0x25b518[_0x5838('0x44')]);var _0x581e1b={'where':_0x2987ec['where']};return db[_0x5838('0x32')][_0x5838('0x21')](_0x581e1b)[_0x5838('0x26')](function(_0x5cc70b){_0x1f0d9b['count']=_0x5cc70b;if(_0x25b518[_0x5838('0x36')][_0x5838('0x45')]){_0x2987ec['include']=[{'all':!![]}];}return db[_0x5838('0x32')][_0x5838('0x46')](_0x2987ec);})[_0x5838('0x26')](function(_0x5e427e){_0x1f0d9b[_0x5838('0x47')]=_0x5e427e;return _0x1f0d9b;})[_0x5838('0x26')](respondWithFilteredResult(_0x2c8e88,_0x2987ec))[_0x5838('0x48')](handleError(_0x2c8e88,null));};exports[_0x5838('0x49')]=function(_0x5b4c07,_0x1312b3){var _0x4bcfbc={'raw':!![],'where':{'id':_0x5b4c07[_0x5838('0x4a')]['id']}},_0x800c3c={};_0x800c3c[_0x5838('0x35')]=_[_0x5838('0x37')](db[_0x5838('0x32')][_0x5838('0x33')]);_0x800c3c[_0x5838('0x36')]=_[_0x5838('0x37')](_0x5b4c07[_0x5838('0x36')]);_0x800c3c[_0x5838('0x38')]=_[_0x5838('0x39')](_0x800c3c[_0x5838('0x35')],_0x800c3c[_0x5838('0x36')]);_0x4bcfbc[_0x5838('0x3a')]=_[_0x5838('0x39')](_0x800c3c['model'],qs[_0x5838('0x3b')](_0x5b4c07[_0x5838('0x36')][_0x5838('0x3b')]));_0x4bcfbc[_0x5838('0x3a')]=_0x4bcfbc[_0x5838('0x3a')][_0x5838('0x3c')]?_0x4bcfbc[_0x5838('0x3a')]:_0x800c3c[_0x5838('0x35')];if(_0x5b4c07[_0x5838('0x36')]['includeAll']){_0x4bcfbc[_0x5838('0x4b')]=[{'all':!![]}];}_0x4bcfbc=_[_0x5838('0x43')]({},_0x4bcfbc,_0x5b4c07[_0x5838('0x44')]);return db[_0x5838('0x32')][_0x5838('0x4c')](_0x4bcfbc)[_0x5838('0x26')](handleEntityNotFound(_0x1312b3,null))[_0x5838('0x26')](respondWithResult(_0x1312b3,null))[_0x5838('0x48')](handleError(_0x1312b3,null));};exports['update']=function(_0x57341c,_0x347d3a){if(_0x57341c[_0x5838('0x4d')]['id']){delete _0x57341c[_0x5838('0x4d')]['id'];}return db[_0x5838('0x32')]['find']({'where':{'id':_0x57341c[_0x5838('0x4a')]['id']}})[_0x5838('0x26')](handleEntityNotFound(_0x347d3a,null))[_0x5838('0x26')](saveUpdates(_0x57341c[_0x5838('0x4d')],null))[_0x5838('0x26')](respondWithResult(_0x347d3a,null))[_0x5838('0x48')](handleError(_0x347d3a,null));};exports[_0x5838('0x27')]=function(_0x47f1c5,_0x3499d7){return db['CannedAnswer'][_0x5838('0x4c')]({'where':{'id':_0x47f1c5[_0x5838('0x4a')]['id']}})[_0x5838('0x26')](handleEntityNotFound(_0x3499d7,null))['then'](removeEntity(_0x3499d7,null))[_0x5838('0x48')](handleError(_0x3499d7,null));};exports[_0x5838('0x4e')]=function(_0x1dc6c9,_0x36256c){var _0x552581={'key':_0x1dc6c9['body'][_0x5838('0x4f')]};if(_0x1dc6c9[_0x5838('0x4d')][_0x5838('0x50')]){_0x552581['MailAccountId']=_0x1dc6c9[_0x5838('0x4d')]['MailAccountId'];}else if(_0x1dc6c9[_0x5838('0x4d')]['SmsAccountId']){_0x552581[_0x5838('0x51')]=_0x1dc6c9[_0x5838('0x4d')]['SmsAccountId'];}else if(_0x1dc6c9[_0x5838('0x4d')][_0x5838('0x52')]){_0x552581[_0x5838('0x52')]=_0x1dc6c9[_0x5838('0x4d')][_0x5838('0x52')];}else if(_0x1dc6c9[_0x5838('0x4d')]['ChatWebsiteId']){_0x552581['ChatWebsiteId']=_0x1dc6c9[_0x5838('0x4d')][_0x5838('0x53')];}return db[_0x5838('0x32')]['find']({'where':_0x552581})[_0x5838('0x26')](function(_0x570c10){if(_0x570c10){throw new db[(_0x5838('0x54'))][(_0x5838('0x55'))](_0x5838('0x56'));}return db[_0x5838('0x32')]['create'](_0x1dc6c9['body']);})['then'](function(_0x30c1b2){var _0x4c14e9=_0x1dc6c9[_0x5838('0x57')][_0x5838('0x28')]({'plain':!![]});if(!_0x4c14e9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c14e9[_0x5838('0x58')]==='user'){var _0x50b0cf=_0x30c1b2[_0x5838('0x28')]({'plain':!![]});return db['UserProfileSection'][_0x5838('0x4c')]({'where':{'name':_0x5838('0x29'),'userProfileId':_0x4c14e9[_0x5838('0x59')]},'raw':!![]})[_0x5838('0x26')](function(_0x4bb49f){if(_0x4bb49f&&_0x4bb49f[_0x5838('0x5a')]===0x0){return db[_0x5838('0x2a')][_0x5838('0x4e')]({'name':_0x50b0cf[_0x5838('0x2e')],'resourceId':_0x50b0cf['id'],'type':_0x4bb49f[_0x5838('0x2e')],'sectionId':_0x4bb49f['id']},{})[_0x5838('0x26')](function(){return _0x30c1b2;});}else{return _0x30c1b2;}})[_0x5838('0x48')](function(_0x34a1c8){logger[_0x5838('0x2c')](_0x5838('0x5b'),_0x34a1c8);throw _0x34a1c8;});}return _0x30c1b2;})[_0x5838('0x26')](respondWithResult(_0x36256c,0xc9))['catch'](handleError(_0x36256c,null));};
\ No newline at end of file
index b21aede..e7f68d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0188=['tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x19311a,_0x2d2679){var _0x42617c=function(_0x43227d){while(--_0x43227d){_0x19311a['push'](_0x19311a['shift']());}};_0x42617c(++_0x2d2679);}(_0x0188,0x1a7));var _0x8018=function(_0x3e531a,_0x28a82a){_0x3e531a=_0x3e531a-0x0;var _0x3c2574=_0x0188[_0x3e531a];return _0x3c2574;};'use strict';var _=require(_0x8018('0x0'));var util=require('util');var logger=require(_0x8018('0x1'))('api');var moment=require(_0x8018('0x2'));var BPromise=require(_0x8018('0x3'));var rp=require(_0x8018('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8018('0x5'));var config=require(_0x8018('0x6'));var attributes=require(_0x8018('0x7'));module[_0x8018('0x8')]=function(_0x1b9f44,_0x16330a){return _0x1b9f44['define']('CannedAnswer',attributes,{'tableName':_0x8018('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8018('0xa'),'collate':_0x8018('0xb')});};
\ No newline at end of file
+var _0x34f9=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0xf5e243,_0x5f51c5){var _0x578dc0=function(_0x3cf219){while(--_0x3cf219){_0xf5e243['push'](_0xf5e243['shift']());}};_0x578dc0(++_0x5f51c5);}(_0x34f9,0xfb));var _0x934f=function(_0x5b2ae8,_0x2f5fdd){_0x5b2ae8=_0x5b2ae8-0x0;var _0x17a99e=_0x34f9[_0x5b2ae8];return _0x17a99e;};'use strict';var _=require(_0x934f('0x0'));var util=require(_0x934f('0x1'));var logger=require(_0x934f('0x2'))(_0x934f('0x3'));var moment=require(_0x934f('0x4'));var BPromise=require(_0x934f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x934f('0x6'));var rimraf=require(_0x934f('0x7'));var config=require(_0x934f('0x8'));var attributes=require(_0x934f('0x9'));module['exports']=function(_0x2f1329,_0x1be01d){return _0x2f1329[_0x934f('0xa')]('CannedAnswer',attributes,{'tableName':_0x934f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x934f('0xc'),'collate':_0x934f('0xd')});};
\ No newline at end of file
index 5a388e9..b50cfd7 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(_0x531253,_0x8acb9b){var _0x307a0e=function(_0x5cfb48){while(--_0x5cfb48){_0x531253['push'](_0x531253['shift']());}};_0x307a0e(++_0x8acb9b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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(_0x3d5505,_0xf37a5d){var _0x3a3dd4=function(_0x3fc5ac){while(--_0x3fc5ac){_0x3d5505['push'](_0x3d5505['shift']());}};_0x3a3dd4(++_0xf37a5d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
index 3b55b45..05ab623 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x487e=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x401392,_0x4572ad){var _0x102daf=function(_0x47a9c2){while(--_0x47a9c2){_0x401392['push'](_0x401392['shift']());}};_0x102daf(++_0x4572ad);}(_0x487e,0x12b));var _0xe487=function(_0xdd1d99,_0x561184){_0xdd1d99=_0xdd1d99-0x0;var _0x2e2a24=_0x487e[_0xdd1d99];return _0x2e2a24;};'use strict';var multer=require(_0xe487('0x0'));var util=require(_0xe487('0x1'));var path=require(_0xe487('0x2'));var timeout=require(_0xe487('0x3'));var express=require('express');var router=express[_0xe487('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe487('0x5'));var interaction=require(_0xe487('0x6'));var config=require(_0xe487('0x7'));var controller=require(_0xe487('0x8'));router[_0xe487('0x9')]('/',auth[_0xe487('0xa')](),controller['index']);router['get'](_0xe487('0xb'),auth[_0xe487('0xa')](),controller[_0xe487('0xc')]);router[_0xe487('0xd')]('/',auth['isAuthenticated'](),controller[_0xe487('0xe')]);router[_0xe487('0xf')](_0xe487('0xb'),auth[_0xe487('0xa')](),controller['update']);router[_0xe487('0x10')](_0xe487('0xb'),auth[_0xe487('0xa')](),controller[_0xe487('0x11')]);module[_0xe487('0x12')]=router;
\ No newline at end of file
+var _0xf402=['delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','show','post','create','/:id'];(function(_0x314a8c,_0x1c2e8d){var _0x1d4607=function(_0x3df20c){while(--_0x3df20c){_0x314a8c['push'](_0x314a8c['shift']());}};_0x1d4607(++_0x1c2e8d);}(_0xf402,0xf0));var _0x2f40=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xf402[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x2f40('0x0'));var util=require(_0x2f40('0x1'));var path=require(_0x2f40('0x2'));var timeout=require(_0x2f40('0x3'));var express=require('express');var router=express[_0x2f40('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2f40('0x5'));var interaction=require(_0x2f40('0x6'));var config=require(_0x2f40('0x7'));var controller=require(_0x2f40('0x8'));router[_0x2f40('0x9')]('/',auth[_0x2f40('0xa')](),controller['index']);router[_0x2f40('0x9')]('/:id',auth[_0x2f40('0xa')](),controller[_0x2f40('0xb')]);router[_0x2f40('0xc')]('/',auth[_0x2f40('0xa')](),controller[_0x2f40('0xd')]);router['put'](_0x2f40('0xe'),auth[_0x2f40('0xa')](),controller['update']);router[_0x2f40('0xf')]('/:id',auth[_0x2f40('0xa')](),controller[_0x2f40('0x10')]);module['exports']=router;
\ No newline at end of file
index b9a91ae..9c3444c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73b3=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x1cc5c0,_0x5ef4db){var _0x34e133=function(_0x43f717){while(--_0x43f717){_0x1cc5c0['push'](_0x1cc5c0['shift']());}};_0x34e133(++_0x5ef4db);}(_0x73b3,0x183));var _0x373b=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0x73b3[_0x4bfac3];return _0x15f0f2;};'use strict';var Sequelize=require(_0x373b('0x0'));module[_0x373b('0x1')]={'calldate':{'type':Sequelize[_0x373b('0x2')],'allowNull':![],'defaultValue':_0x373b('0x3')},'clid':{'type':Sequelize[_0x373b('0x4')]},'src':{'type':Sequelize[_0x373b('0x4')]},'dst':{'type':Sequelize[_0x373b('0x4')]},'dcontext':{'type':Sequelize[_0x373b('0x4')]},'channel':{'type':Sequelize[_0x373b('0x4')]},'dstchannel':{'type':Sequelize[_0x373b('0x4')]},'lastapp':{'type':Sequelize[_0x373b('0x4')]},'lastdata':{'type':Sequelize[_0x373b('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x373b('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x373b('0x4')]},'amaflags':{'type':Sequelize[_0x373b('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x373b('0x4')]},'userfield':{'type':Sequelize[_0x373b('0x4')]},'uniqueid':{'type':Sequelize[_0x373b('0x4')]},'linkedid':{'type':Sequelize[_0x373b('0x4')]},'sequence':{'type':Sequelize[_0x373b('0x4')]},'peeraccount':{'type':Sequelize[_0x373b('0x4')]},'type':{'type':Sequelize[_0x373b('0x4')]},'tag':{'type':Sequelize[_0x373b('0x4')]}};
\ No newline at end of file
+var _0x49ac=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0xd2154b,_0xef4cec){var _0x560c1f=function(_0x5a0cd9){while(--_0x5a0cd9){_0xd2154b['push'](_0xd2154b['shift']());}};_0x560c1f(++_0xef4cec);}(_0x49ac,0x19e));var _0xc49a=function(_0x14d896,_0x53578b){_0x14d896=_0x14d896-0x0;var _0x28679a=_0x49ac[_0x14d896];return _0x28679a;};'use strict';var Sequelize=require(_0xc49a('0x0'));module[_0xc49a('0x1')]={'calldate':{'type':Sequelize[_0xc49a('0x2')],'allowNull':![],'defaultValue':_0xc49a('0x3')},'clid':{'type':Sequelize[_0xc49a('0x4')]},'src':{'type':Sequelize[_0xc49a('0x4')]},'dst':{'type':Sequelize[_0xc49a('0x4')]},'dcontext':{'type':Sequelize[_0xc49a('0x4')]},'channel':{'type':Sequelize[_0xc49a('0x4')]},'dstchannel':{'type':Sequelize[_0xc49a('0x4')]},'lastapp':{'type':Sequelize[_0xc49a('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xc49a('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc49a('0x4')]},'amaflags':{'type':Sequelize[_0xc49a('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xc49a('0x4')]},'userfield':{'type':Sequelize[_0xc49a('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xc49a('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xc49a('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xc49a('0x4')]}};
\ No newline at end of file
index d3242aa..831bf81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd59=['includeAll','include','findAll','rows','catch','show','params','keys','intersection','options','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','error','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL'];(function(_0x94030f,_0x476ed2){var _0x9f7747=function(_0x2b977a){while(--_0x2b977a){_0x94030f['push'](_0x94030f['shift']());}};_0x9f7747(++_0x476ed2);}(_0xcd59,0x14b));var _0x9cd5=function(_0x4c7410,_0x43bf77){_0x4c7410=_0x4c7410-0x0;var _0x2cf87d=_0xcd59[_0x4c7410];return _0x2cf87d;};'use strict';var emlformat=require(_0x9cd5('0x0'));var rimraf=require(_0x9cd5('0x1'));var zipdir=require(_0x9cd5('0x2'));var jsonpatch=require(_0x9cd5('0x3'));var rp=require(_0x9cd5('0x4'));var moment=require(_0x9cd5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9cd5('0x6'));var util=require(_0x9cd5('0x7'));var path=require(_0x9cd5('0x8'));var sox=require(_0x9cd5('0x9'));var csv=require(_0x9cd5('0xa'));var ejs=require(_0x9cd5('0xb'));var fs=require('fs');var fs_extra=require(_0x9cd5('0xc'));var _=require(_0x9cd5('0xd'));var squel=require(_0x9cd5('0xe'));var crypto=require(_0x9cd5('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x9cd5('0x10'));var toCsv=require(_0x9cd5('0xa'));var querystring=require(_0x9cd5('0x11'));var Papa=require(_0x9cd5('0x12'));var Redis=require(_0x9cd5('0x13'));var authService=require(_0x9cd5('0x14'));var qs=require(_0x9cd5('0x15'));var as=require(_0x9cd5('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9cd5('0x17'))(_0x9cd5('0x18'));var utils=require(_0x9cd5('0x19'));var config=require(_0x9cd5('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2c9cf1,_0x172e29){_0x172e29=_0x172e29||0xcc;return function(_0x44518d){if(_0x44518d){return _0x2c9cf1[_0x9cd5('0x1b')](_0x172e29);}return _0x2c9cf1[_0x9cd5('0x1c')](_0x172e29)[_0x9cd5('0x1d')]();};}function respondWithResult(_0x52698b,_0x15b639){_0x15b639=_0x15b639||0xc8;return function(_0x1445c0){if(_0x1445c0){return _0x52698b[_0x9cd5('0x1c')](_0x15b639)['json'](_0x1445c0);}};}function respondWithFilteredResult(_0x541cb8,_0x5c4f3d){return function(_0x258305){if(_0x258305){var _0x1ea3f7=typeof _0x5c4f3d['offset']===_0x9cd5('0x1e')&&typeof _0x5c4f3d[_0x9cd5('0x1f')]===_0x9cd5('0x1e');var _0x57b986=_0x258305[_0x9cd5('0x20')];var _0x2d1863=_0x1ea3f7?0x0:_0x5c4f3d[_0x9cd5('0x21')];var _0x3a6f01=_0x1ea3f7?_0x258305[_0x9cd5('0x20')]:_0x5c4f3d[_0x9cd5('0x21')]+_0x5c4f3d['limit'];var _0x37ea13;if(_0x3a6f01>=_0x57b986){_0x3a6f01=_0x57b986;_0x37ea13=0xc8;}else{_0x37ea13=0xce;}_0x541cb8[_0x9cd5('0x1c')](_0x37ea13);return _0x541cb8[_0x9cd5('0x22')](_0x9cd5('0x23'),_0x2d1863+'-'+_0x3a6f01+'/'+_0x57b986)[_0x9cd5('0x24')](_0x258305);}return null;};}function patchUpdates(_0x4ed8b9){return function(_0x16c4e9){try{jsonpatch[_0x9cd5('0x25')](_0x16c4e9,_0x4ed8b9,!![]);}catch(_0x3f1f5c){return BPromise[_0x9cd5('0x26')](_0x3f1f5c);}return _0x16c4e9[_0x9cd5('0x27')]();};}function saveUpdates(_0x1185d7,_0x1cf603){return function(_0x2238ec){if(_0x2238ec){return _0x2238ec[_0x9cd5('0x28')](_0x1185d7)['then'](function(_0x297f0e){return _0x297f0e;});}return null;};}function removeEntity(_0xba8ee9,_0x1a88e3){return function(_0x43f47d){if(_0x43f47d){return _0x43f47d['destroy']()[_0x9cd5('0x29')](function(){_0xba8ee9[_0x9cd5('0x1c')](0xcc)[_0x9cd5('0x1d')]();});}};}function handleEntityNotFound(_0xe36f86,_0x297776){return function(_0x4509e7){if(!_0x4509e7){_0xe36f86[_0x9cd5('0x1b')](0x194);}return _0x4509e7;};}function handleError(_0x4a245f,_0x1dcb6f){_0x1dcb6f=_0x1dcb6f||0x1f4;return function(_0x64a1c4){logger[_0x9cd5('0x2a')](_0x64a1c4['stack']);if(_0x64a1c4['name']){delete _0x64a1c4[_0x9cd5('0x2b')];}_0x4a245f['status'](_0x1dcb6f)['send'](_0x64a1c4);};}exports[_0x9cd5('0x2c')]=function(_0x2a20d2,_0x13e0d3){var _0x5184b9={},_0x40461a={},_0xc0104b={'count':0x0,'rows':[]};var _0x27e1fd=_[_0x9cd5('0x2d')](db[_0x9cd5('0x2e')][_0x9cd5('0x2f')],function(_0x1dbddc){return{'name':_0x1dbddc[_0x9cd5('0x30')],'type':_0x1dbddc[_0x9cd5('0x31')][_0x9cd5('0x32')]};});_0x40461a[_0x9cd5('0x33')]=_[_0x9cd5('0x2d')](_0x27e1fd,_0x9cd5('0x2b'));_0x40461a[_0x9cd5('0x34')]=_['keys'](_0x2a20d2[_0x9cd5('0x34')]);_0x40461a[_0x9cd5('0x35')]=_['intersection'](_0x40461a['model'],_0x40461a[_0x9cd5('0x34')]);_0x5184b9[_0x9cd5('0x36')]=_['intersection'](_0x40461a[_0x9cd5('0x33')],qs['fields'](_0x2a20d2['query'][_0x9cd5('0x37')]));_0x5184b9[_0x9cd5('0x36')]=_0x5184b9[_0x9cd5('0x36')][_0x9cd5('0x38')]?_0x5184b9['attributes']:_0x40461a[_0x9cd5('0x33')];if(!_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x39')]('nolimit')){_0x5184b9[_0x9cd5('0x1f')]=qs[_0x9cd5('0x1f')](_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x1f')]);_0x5184b9[_0x9cd5('0x21')]=qs[_0x9cd5('0x21')](_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x21')]);}_0x5184b9[_0x9cd5('0x3a')]=qs[_0x9cd5('0x3b')](_0x2a20d2[_0x9cd5('0x34')]['sort']);_0x5184b9[_0x9cd5('0x3c')]=qs['filters'](_['pick'](_0x2a20d2[_0x9cd5('0x34')],_0x40461a[_0x9cd5('0x35')]),_0x27e1fd);if(_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x3d')]){_0x5184b9['where']=_[_0x9cd5('0x3e')](_0x5184b9[_0x9cd5('0x3c')],{'$or':_[_0x9cd5('0x2d')](_0x27e1fd,function(_0x458a6a){if(_0x458a6a['type']!==_0x9cd5('0x3f')){var _0x3f50de={};_0x3f50de[_0x458a6a[_0x9cd5('0x2b')]]={'$like':'%'+_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x3d')]+'%'};return _0x3f50de;}})});}_0x5184b9=_[_0x9cd5('0x3e')]({},_0x5184b9,_0x2a20d2['options']);var _0x26cf61={'where':_0x5184b9[_0x9cd5('0x3c')]};return db[_0x9cd5('0x2e')][_0x9cd5('0x20')](_0x26cf61)[_0x9cd5('0x29')](function(_0x4182bd){_0xc0104b[_0x9cd5('0x20')]=_0x4182bd;if(_0x2a20d2[_0x9cd5('0x34')][_0x9cd5('0x40')]){_0x5184b9[_0x9cd5('0x41')]=[{'all':!![]}];}return db[_0x9cd5('0x2e')][_0x9cd5('0x42')](_0x5184b9);})[_0x9cd5('0x29')](function(_0xa12319){_0xc0104b[_0x9cd5('0x43')]=_0xa12319;return _0xc0104b;})[_0x9cd5('0x29')](respondWithFilteredResult(_0x13e0d3,_0x5184b9))[_0x9cd5('0x44')](handleError(_0x13e0d3,null));};exports[_0x9cd5('0x45')]=function(_0x4ba72c,_0x13d4b8){var _0x58ae2e={'raw':!![],'where':{'id':_0x4ba72c[_0x9cd5('0x46')]['id']}},_0x427d78={};_0x427d78[_0x9cd5('0x33')]=_[_0x9cd5('0x47')](db[_0x9cd5('0x2e')]['rawAttributes']);_0x427d78[_0x9cd5('0x34')]=_[_0x9cd5('0x47')](_0x4ba72c[_0x9cd5('0x34')]);_0x427d78['filters']=_[_0x9cd5('0x48')](_0x427d78[_0x9cd5('0x33')],_0x427d78[_0x9cd5('0x34')]);_0x58ae2e[_0x9cd5('0x36')]=_['intersection'](_0x427d78[_0x9cd5('0x33')],qs[_0x9cd5('0x37')](_0x4ba72c[_0x9cd5('0x34')][_0x9cd5('0x37')]));_0x58ae2e[_0x9cd5('0x36')]=_0x58ae2e[_0x9cd5('0x36')][_0x9cd5('0x38')]?_0x58ae2e[_0x9cd5('0x36')]:_0x427d78[_0x9cd5('0x33')];if(_0x4ba72c[_0x9cd5('0x34')][_0x9cd5('0x40')]){_0x58ae2e[_0x9cd5('0x41')]=[{'all':!![]}];}_0x58ae2e=_[_0x9cd5('0x3e')]({},_0x58ae2e,_0x4ba72c[_0x9cd5('0x49')]);return db[_0x9cd5('0x2e')][_0x9cd5('0x4a')](_0x58ae2e)[_0x9cd5('0x29')](handleEntityNotFound(_0x13d4b8,null))[_0x9cd5('0x29')](respondWithResult(_0x13d4b8,null))['catch'](handleError(_0x13d4b8,null));};exports[_0x9cd5('0x4b')]=function(_0x1c581a,_0x3fead7){return db[_0x9cd5('0x2e')]['create'](_0x1c581a[_0x9cd5('0x4c')],{})[_0x9cd5('0x29')](respondWithResult(_0x3fead7,0xc9))['catch'](handleError(_0x3fead7,null));};exports[_0x9cd5('0x28')]=function(_0x155652,_0x152b17){if(_0x155652[_0x9cd5('0x4c')]['id']){delete _0x155652[_0x9cd5('0x4c')]['id'];}return db[_0x9cd5('0x2e')][_0x9cd5('0x4a')]({'where':{'id':_0x155652[_0x9cd5('0x46')]['id']}})['then'](handleEntityNotFound(_0x152b17,null))['then'](saveUpdates(_0x155652[_0x9cd5('0x4c')],null))[_0x9cd5('0x29')](respondWithResult(_0x152b17,null))[_0x9cd5('0x44')](handleError(_0x152b17,null));};exports[_0x9cd5('0x4d')]=function(_0x5a933a,_0xf6e17b){return db['Cdr']['find']({'where':{'id':_0x5a933a[_0x9cd5('0x46')]['id']}})[_0x9cd5('0x29')](handleEntityNotFound(_0xf6e17b,null))[_0x9cd5('0x29')](removeEntity(_0xf6e17b,null))['catch'](handleError(_0xf6e17b,null));};exports[_0x9cd5('0x4e')]=function(_0x30c80f,_0x310e4a){return db[_0x9cd5('0x2e')][_0x9cd5('0x4e')]()[_0x9cd5('0x29')](respondWithResult(_0x310e4a,null))['catch'](handleError(_0x310e4a,null));};
\ No newline at end of file
+var _0xc492=['findAll','rows','catch','params','includeAll','find','body','describe','eml-format','rimraf','zip-dir','moment','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','Cdr','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include'];(function(_0x3fac88,_0xceed4f){var _0x4424fe=function(_0x4c4403){while(--_0x4c4403){_0x3fac88['push'](_0x3fac88['shift']());}};_0x4424fe(++_0xceed4f);}(_0xc492,0xd7));var _0x2c49=function(_0x4f836e,_0x4d6423){_0x4f836e=_0x4f836e-0x0;var _0x5b963a=_0xc492[_0x4f836e];return _0x5b963a;};'use strict';var emlformat=require(_0x2c49('0x0'));var rimraf=require(_0x2c49('0x1'));var zipdir=require(_0x2c49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2c49('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2c49('0x4'));var path=require(_0x2c49('0x5'));var sox=require('sox');var csv=require(_0x2c49('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c49('0x7'));var _=require(_0x2c49('0x8'));var squel=require('squel');var crypto=require(_0x2c49('0x9'));var jsforce=require(_0x2c49('0xa'));var deskjs=require(_0x2c49('0xb'));var toCsv=require(_0x2c49('0x6'));var querystring=require(_0x2c49('0xc'));var Papa=require('papaparse');var Redis=require(_0x2c49('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2c49('0xe'))('api');var utils=require(_0x2c49('0xf'));var config=require(_0x2c49('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x2c49('0x11'))['db'];function respondWithStatusCode(_0x1cc78b,_0x19f7d9){_0x19f7d9=_0x19f7d9||0xcc;return function(_0x1e2210){if(_0x1e2210){return _0x1cc78b[_0x2c49('0x12')](_0x19f7d9);}return _0x1cc78b[_0x2c49('0x13')](_0x19f7d9)['end']();};}function respondWithResult(_0x2006cf,_0x5af5e7){_0x5af5e7=_0x5af5e7||0xc8;return function(_0x2eeb10){if(_0x2eeb10){return _0x2006cf[_0x2c49('0x13')](_0x5af5e7)[_0x2c49('0x14')](_0x2eeb10);}};}function respondWithFilteredResult(_0x561d83,_0x19f59b){return function(_0x385724){if(_0x385724){var _0x30da01=typeof _0x19f59b[_0x2c49('0x15')]===_0x2c49('0x16')&&typeof _0x19f59b[_0x2c49('0x17')]===_0x2c49('0x16');var _0x2e2e07=_0x385724[_0x2c49('0x18')];var _0x89bcb=_0x30da01?0x0:_0x19f59b['offset'];var _0x3001af=_0x30da01?_0x385724[_0x2c49('0x18')]:_0x19f59b[_0x2c49('0x15')]+_0x19f59b[_0x2c49('0x17')];var _0x4793d5;if(_0x3001af>=_0x2e2e07){_0x3001af=_0x2e2e07;_0x4793d5=0xc8;}else{_0x4793d5=0xce;}_0x561d83[_0x2c49('0x13')](_0x4793d5);return _0x561d83['set'](_0x2c49('0x19'),_0x89bcb+'-'+_0x3001af+'/'+_0x2e2e07)[_0x2c49('0x14')](_0x385724);}return null;};}function patchUpdates(_0x573157){return function(_0x4b8f61){try{jsonpatch[_0x2c49('0x1a')](_0x4b8f61,_0x573157,!![]);}catch(_0x3bda90){return BPromise[_0x2c49('0x1b')](_0x3bda90);}return _0x4b8f61[_0x2c49('0x1c')]();};}function saveUpdates(_0x202205,_0x294c70){return function(_0x33c09f){if(_0x33c09f){return _0x33c09f[_0x2c49('0x1d')](_0x202205)[_0x2c49('0x1e')](function(_0x54fe21){return _0x54fe21;});}return null;};}function removeEntity(_0x14ca06,_0x20f3bf){return function(_0x4037b0){if(_0x4037b0){return _0x4037b0[_0x2c49('0x1f')]()['then'](function(){_0x14ca06[_0x2c49('0x13')](0xcc)[_0x2c49('0x20')]();});}};}function handleEntityNotFound(_0x3a35b4,_0x2a9109){return function(_0x59c061){if(!_0x59c061){_0x3a35b4[_0x2c49('0x12')](0x194);}return _0x59c061;};}function handleError(_0x18a41e,_0x25bf3d){_0x25bf3d=_0x25bf3d||0x1f4;return function(_0x50da06){logger[_0x2c49('0x21')](_0x50da06[_0x2c49('0x22')]);if(_0x50da06['name']){delete _0x50da06[_0x2c49('0x23')];}_0x18a41e['status'](_0x25bf3d)['send'](_0x50da06);};}exports[_0x2c49('0x24')]=function(_0x4d2564,_0x5c4fb1){var _0x4d9334={},_0x433503={},_0x7b8d75={'count':0x0,'rows':[]};var _0x2b2dd5=_[_0x2c49('0x25')](db[_0x2c49('0x26')][_0x2c49('0x27')],function(_0x131c06){return{'name':_0x131c06[_0x2c49('0x28')],'type':_0x131c06[_0x2c49('0x29')][_0x2c49('0x2a')]};});_0x433503['model']=_[_0x2c49('0x25')](_0x2b2dd5,'name');_0x433503[_0x2c49('0x2b')]=_[_0x2c49('0x2c')](_0x4d2564[_0x2c49('0x2b')]);_0x433503[_0x2c49('0x2d')]=_[_0x2c49('0x2e')](_0x433503[_0x2c49('0x2f')],_0x433503[_0x2c49('0x2b')]);_0x4d9334[_0x2c49('0x30')]=_[_0x2c49('0x2e')](_0x433503[_0x2c49('0x2f')],qs[_0x2c49('0x31')](_0x4d2564[_0x2c49('0x2b')][_0x2c49('0x31')]));_0x4d9334[_0x2c49('0x30')]=_0x4d9334['attributes']['length']?_0x4d9334[_0x2c49('0x30')]:_0x433503[_0x2c49('0x2f')];if(!_0x4d2564['query'][_0x2c49('0x32')](_0x2c49('0x33'))){_0x4d9334[_0x2c49('0x17')]=qs[_0x2c49('0x17')](_0x4d2564[_0x2c49('0x2b')][_0x2c49('0x17')]);_0x4d9334[_0x2c49('0x15')]=qs[_0x2c49('0x15')](_0x4d2564['query'][_0x2c49('0x15')]);}_0x4d9334[_0x2c49('0x34')]=qs['sort'](_0x4d2564[_0x2c49('0x2b')][_0x2c49('0x35')]);_0x4d9334[_0x2c49('0x36')]=qs['filters'](_[_0x2c49('0x37')](_0x4d2564[_0x2c49('0x2b')],_0x433503[_0x2c49('0x2d')]),_0x2b2dd5);if(_0x4d2564[_0x2c49('0x2b')][_0x2c49('0x38')]){_0x4d9334[_0x2c49('0x36')]=_['merge'](_0x4d9334[_0x2c49('0x36')],{'$or':_[_0x2c49('0x25')](_0x2b2dd5,function(_0x4cbfe4){if(_0x4cbfe4[_0x2c49('0x29')]!==_0x2c49('0x39')){var _0x52f123={};_0x52f123[_0x4cbfe4[_0x2c49('0x23')]]={'$like':'%'+_0x4d2564['query'][_0x2c49('0x38')]+'%'};return _0x52f123;}})});}_0x4d9334=_[_0x2c49('0x3a')]({},_0x4d9334,_0x4d2564[_0x2c49('0x3b')]);var _0x5a6822={'where':_0x4d9334[_0x2c49('0x36')]};return db['Cdr'][_0x2c49('0x18')](_0x5a6822)[_0x2c49('0x1e')](function(_0x24e53a){_0x7b8d75[_0x2c49('0x18')]=_0x24e53a;if(_0x4d2564[_0x2c49('0x2b')]['includeAll']){_0x4d9334[_0x2c49('0x3c')]=[{'all':!![]}];}return db[_0x2c49('0x26')][_0x2c49('0x3d')](_0x4d9334);})[_0x2c49('0x1e')](function(_0x251c8d){_0x7b8d75[_0x2c49('0x3e')]=_0x251c8d;return _0x7b8d75;})[_0x2c49('0x1e')](respondWithFilteredResult(_0x5c4fb1,_0x4d9334))[_0x2c49('0x3f')](handleError(_0x5c4fb1,null));};exports['show']=function(_0xa912b8,_0x30e892){var _0x5b1ee0={'raw':!![],'where':{'id':_0xa912b8[_0x2c49('0x40')]['id']}},_0x2a21b9={};_0x2a21b9['model']=_[_0x2c49('0x2c')](db['Cdr']['rawAttributes']);_0x2a21b9['query']=_['keys'](_0xa912b8[_0x2c49('0x2b')]);_0x2a21b9[_0x2c49('0x2d')]=_[_0x2c49('0x2e')](_0x2a21b9[_0x2c49('0x2f')],_0x2a21b9[_0x2c49('0x2b')]);_0x5b1ee0['attributes']=_['intersection'](_0x2a21b9['model'],qs['fields'](_0xa912b8[_0x2c49('0x2b')]['fields']));_0x5b1ee0[_0x2c49('0x30')]=_0x5b1ee0['attributes']['length']?_0x5b1ee0['attributes']:_0x2a21b9[_0x2c49('0x2f')];if(_0xa912b8['query'][_0x2c49('0x41')]){_0x5b1ee0[_0x2c49('0x3c')]=[{'all':!![]}];}_0x5b1ee0=_['merge']({},_0x5b1ee0,_0xa912b8['options']);return db[_0x2c49('0x26')][_0x2c49('0x42')](_0x5b1ee0)[_0x2c49('0x1e')](handleEntityNotFound(_0x30e892,null))[_0x2c49('0x1e')](respondWithResult(_0x30e892,null))[_0x2c49('0x3f')](handleError(_0x30e892,null));};exports['create']=function(_0x50dce4,_0x426c8a){return db[_0x2c49('0x26')]['create'](_0x50dce4['body'],{})['then'](respondWithResult(_0x426c8a,0xc9))[_0x2c49('0x3f')](handleError(_0x426c8a,null));};exports[_0x2c49('0x1d')]=function(_0x98fc90,_0x55e4cd){if(_0x98fc90[_0x2c49('0x43')]['id']){delete _0x98fc90[_0x2c49('0x43')]['id'];}return db[_0x2c49('0x26')][_0x2c49('0x42')]({'where':{'id':_0x98fc90[_0x2c49('0x40')]['id']}})[_0x2c49('0x1e')](handleEntityNotFound(_0x55e4cd,null))[_0x2c49('0x1e')](saveUpdates(_0x98fc90['body'],null))['then'](respondWithResult(_0x55e4cd,null))['catch'](handleError(_0x55e4cd,null));};exports[_0x2c49('0x1f')]=function(_0x1aa034,_0x5385e5){return db[_0x2c49('0x26')][_0x2c49('0x42')]({'where':{'id':_0x1aa034[_0x2c49('0x40')]['id']}})[_0x2c49('0x1e')](handleEntityNotFound(_0x5385e5,null))[_0x2c49('0x1e')](removeEntity(_0x5385e5,null))[_0x2c49('0x3f')](handleError(_0x5385e5,null));};exports[_0x2c49('0x44')]=function(_0x11878d,_0x331519){return db[_0x2c49('0x26')]['describe']()[_0x2c49('0x1e')](respondWithResult(_0x331519,null))[_0x2c49('0x3f')](handleError(_0x331519,null));};
\ No newline at end of file
index 79bf2b8..6c268b3 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(_0x38d058,_0x55141f){var _0xff6cef=function(_0x38a921){while(--_0x38a921){_0x38d058['push'](_0x38d058['shift']());}};_0xff6cef(++_0x55141f);}(_0x7a54,0x106));var _0x47a5=function(_0x3b6566,_0x48a13e){_0x3b6566=_0x3b6566-0x0;var _0xae5904=_0x7a54[_0x3b6566];return _0xae5904;};'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(_0x1194a5,_0xd0a243){var _0x339830=function(_0x36ef18){while(--_0x36ef18){_0x1194a5['push'](_0x1194a5['shift']());}};_0x339830(++_0xd0a243);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 b492438..db8b609 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b56=['info','Cdr,\x20%s,\x20%s','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client'];(function(_0x1c3985,_0x4dbdaa){var _0x5ae93d=function(_0x1ea7c4){while(--_0x1ea7c4){_0x1c3985['push'](_0x1c3985['shift']());}};_0x5ae93d(++_0x4dbdaa);}(_0x8b56,0x13a));var _0x68b5=function(_0x3853e5,_0x9e88e4){_0x3853e5=_0x3853e5-0x0;var _0x9ad4d0=_0x8b56[_0x3853e5];return _0x9ad4d0;};'use strict';var _=require(_0x68b5('0x0'));var util=require(_0x68b5('0x1'));var moment=require(_0x68b5('0x2'));var BPromise=require(_0x68b5('0x3'));var rs=require(_0x68b5('0x4'));var fs=require('fs');var Redis=require(_0x68b5('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x68b5('0x6'))(_0x68b5('0x7'));var config=require('../../config/environment');var jayson=require(_0x68b5('0x8'));var client=jayson[_0x68b5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f6f0d,_0x3aed63,_0x5428ca){return new BPromise(function(_0x44f53f,_0x539089){return client['request'](_0x4f6f0d,_0x5428ca)['then'](function(_0x5c6fcd){logger[_0x68b5('0xa')](_0x68b5('0xb'),_0x3aed63,_0x68b5('0xc'));logger['debug'](_0x68b5('0xd'),_0x3aed63,'request\x20sent',JSON['stringify'](_0x5c6fcd));if(_0x5c6fcd['error']){if(_0x5c6fcd[_0x68b5('0xe')][_0x68b5('0xf')]===0x1f4){logger[_0x68b5('0xe')](_0x68b5('0xb'),_0x3aed63,_0x5c6fcd[_0x68b5('0xe')]['message']);return _0x539089(_0x5c6fcd[_0x68b5('0xe')][_0x68b5('0x10')]);}logger[_0x68b5('0xe')]('Cdr,\x20%s,\x20%s',_0x3aed63,_0x5c6fcd['error'][_0x68b5('0x10')]);return _0x44f53f(_0x5c6fcd['error']['message']);}else{logger[_0x68b5('0xa')](_0x68b5('0xb'),_0x3aed63,_0x68b5('0xc'));_0x44f53f(_0x5c6fcd[_0x68b5('0x11')][_0x68b5('0x10')]);}})['catch'](function(_0x169aa5){logger[_0x68b5('0xe')](_0x68b5('0xb'),_0x3aed63,_0x169aa5);_0x539089(_0x169aa5);});});}
\ No newline at end of file
+var _0x1b5a=['jayson/promise','client','request','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x4b809b,_0x205cfc){var _0x14ff77=function(_0x155aff){while(--_0x155aff){_0x4b809b['push'](_0x4b809b['shift']());}};_0x14ff77(++_0x205cfc);}(_0x1b5a,0x98));var _0xa1b5=function(_0x464a27,_0x206acd){_0x464a27=_0x464a27-0x0;var _0x1ab379=_0x1b5a[_0x464a27];return _0x1ab379;};'use strict';var _=require(_0xa1b5('0x0'));var util=require(_0xa1b5('0x1'));var moment=require(_0xa1b5('0x2'));var BPromise=require('bluebird');var rs=require(_0xa1b5('0x3'));var fs=require('fs');var Redis=require(_0xa1b5('0x4'));var db=require(_0xa1b5('0x5'))['db'];var utils=require(_0xa1b5('0x6'));var logger=require('../../config/logger')(_0xa1b5('0x7'));var config=require('../../config/environment');var jayson=require(_0xa1b5('0x8'));var client=jayson[_0xa1b5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44d969,_0x32e715,_0x4326a5){return new BPromise(function(_0x167b7f,_0x12c7bb){return client[_0xa1b5('0xa')](_0x44d969,_0x4326a5)['then'](function(_0x39e94e){logger['info'](_0xa1b5('0xb'),_0x32e715,_0xa1b5('0xc'));logger[_0xa1b5('0xd')](_0xa1b5('0xe'),_0x32e715,_0xa1b5('0xc'),JSON[_0xa1b5('0xf')](_0x39e94e));if(_0x39e94e[_0xa1b5('0x10')]){if(_0x39e94e[_0xa1b5('0x10')]['code']===0x1f4){logger['error'](_0xa1b5('0xb'),_0x32e715,_0x39e94e['error']['message']);return _0x12c7bb(_0x39e94e['error'][_0xa1b5('0x11')]);}logger[_0xa1b5('0x10')](_0xa1b5('0xb'),_0x32e715,_0x39e94e[_0xa1b5('0x10')][_0xa1b5('0x11')]);return _0x167b7f(_0x39e94e['error'][_0xa1b5('0x11')]);}else{logger['info'](_0xa1b5('0xb'),_0x32e715,_0xa1b5('0xc'));_0x167b7f(_0x39e94e[_0xa1b5('0x12')][_0xa1b5('0x11')]);}})[_0xa1b5('0x13')](function(_0x5eb1cb){logger['error']('Cdr,\x20%s,\x20%s',_0x32e715,_0x5eb1cb);_0x12c7bb(_0x5eb1cb);});});}
\ No newline at end of file
index 8b24132..98eb66a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x275744,_0x338b4a){var _0x4a2944=function(_0x2950e7){while(--_0x2950e7){_0x275744['push'](_0x275744['shift']());}};_0x4a2944(++_0x338b4a);}(_0xb10b,0x12a));var _0xbb10=function(_0x577f3d,_0x43ab79){_0x577f3d=_0x577f3d-0x0;var _0x3b11f6=_0xb10b[_0x577f3d];return _0x3b11f6;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x38aa1d,_0x4faf18){var _0x2fb75d=function(_0x14ee14){while(--_0x14ee14){_0x38aa1d['push'](_0x38aa1d['shift']());}};_0x2fb75d(++_0x4faf18);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
index f9ff325..2b2b0a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6b2=['TEXT','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb6b2,0x70));var _0x2b6b=function(_0x283bbe,_0x46749e){_0x283bbe=_0x283bbe-0x0;var _0x541b44=_0xb6b2[_0x283bbe];return _0x541b44;};'use strict';var Sequelize=require(_0x2b6b('0x0'));module['exports']={'priority':{'type':Sequelize[_0x2b6b('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x2b6b('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x2b6b('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x2b6b('0x2')],'defaultValue':_0x2b6b('0x4')}};
\ No newline at end of file
+var _0x985c=['TEXT','sequelize','INTEGER','STRING','noop'];(function(_0x11b8ae,_0x485fa8){var _0x35a448=function(_0x188a5b){while(--_0x188a5b){_0x11b8ae['push'](_0x11b8ae['shift']());}};_0x35a448(++_0x485fa8);}(_0x985c,0x8d));var _0xc985=function(_0x54c9f0,_0x402dae){_0x54c9f0=_0x54c9f0-0x0;var _0x57f97a=_0x985c[_0x54c9f0];return _0x57f97a;};'use strict';var Sequelize=require(_0xc985('0x0'));module['exports']={'priority':{'type':Sequelize[_0xc985('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc985('0x2')],'allowNull':![],'defaultValue':_0xc985('0x3')},'appdata':{'type':Sequelize[_0xc985('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xc985('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 8b99ba5..041d660 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x122a=['../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','name','send','show','params','ChatApplication','rawAttributes','query','keys','intersection','model','attributes','fields','includeAll','include','merge','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils'];(function(_0x33593e,_0x22ddd3){var _0x53db1a=function(_0x499ee5){while(--_0x499ee5){_0x33593e['push'](_0x33593e['shift']());}};_0x53db1a(++_0x22ddd3);}(_0x122a,0xba));var _0xa122=function(_0x98220c,_0x1c14f1){_0x98220c=_0x98220c-0x0;var _0x4607fc=_0x122a[_0x98220c];return _0x4607fc;};'use strict';var emlformat=require(_0xa122('0x0'));var rimraf=require(_0xa122('0x1'));var zipdir=require(_0xa122('0x2'));var jsonpatch=require(_0xa122('0x3'));var rp=require(_0xa122('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa122('0x5'));var util=require('util');var path=require(_0xa122('0x6'));var sox=require(_0xa122('0x7'));var csv=require(_0xa122('0x8'));var ejs=require(_0xa122('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa122('0xa'));var jsforce=require(_0xa122('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa122('0x8'));var querystring=require(_0xa122('0xc'));var Papa=require(_0xa122('0xd'));var Redis=require(_0xa122('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa122('0xf'));var logger=require('../../config/logger')(_0xa122('0x10'));var utils=require(_0xa122('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xa122('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55772a,_0x18fd6b){_0x18fd6b=_0x18fd6b||0xcc;return function(_0x3d0912){if(_0x3d0912){return _0x55772a['sendStatus'](_0x18fd6b);}return _0x55772a[_0xa122('0x13')](_0x18fd6b)[_0xa122('0x14')]();};}function respondWithResult(_0x9feb88,_0x524ae3){_0x524ae3=_0x524ae3||0xc8;return function(_0xdc178a){if(_0xdc178a){return _0x9feb88[_0xa122('0x13')](_0x524ae3)[_0xa122('0x15')](_0xdc178a);}};}function respondWithFilteredResult(_0x3e688c,_0x3896e3){return function(_0x317817){if(_0x317817){var _0x5ec92a=typeof _0x3896e3[_0xa122('0x16')]===_0xa122('0x17')&&typeof _0x3896e3[_0xa122('0x18')]===_0xa122('0x17');var _0x15c076=_0x317817[_0xa122('0x19')];var _0x1d6c40=_0x5ec92a?0x0:_0x3896e3[_0xa122('0x16')];var _0x2f0e75=_0x5ec92a?_0x317817['count']:_0x3896e3[_0xa122('0x16')]+_0x3896e3[_0xa122('0x18')];var _0x832163;if(_0x2f0e75>=_0x15c076){_0x2f0e75=_0x15c076;_0x832163=0xc8;}else{_0x832163=0xce;}_0x3e688c[_0xa122('0x13')](_0x832163);return _0x3e688c[_0xa122('0x1a')](_0xa122('0x1b'),_0x1d6c40+'-'+_0x2f0e75+'/'+_0x15c076)[_0xa122('0x15')](_0x317817);}return null;};}function patchUpdates(_0x26ac5c){return function(_0x319836){try{jsonpatch['apply'](_0x319836,_0x26ac5c,!![]);}catch(_0x960493){return BPromise[_0xa122('0x1c')](_0x960493);}return _0x319836[_0xa122('0x1d')]();};}function saveUpdates(_0x34a78c,_0x303914){return function(_0x2a41df){if(_0x2a41df){return _0x2a41df['update'](_0x34a78c)[_0xa122('0x1e')](function(_0xb00bcf){return _0xb00bcf;});}return null;};}function removeEntity(_0x443268,_0x1e53e1){return function(_0x15742e){if(_0x15742e){return _0x15742e[_0xa122('0x1f')]()[_0xa122('0x1e')](function(){_0x443268[_0xa122('0x13')](0xcc)[_0xa122('0x14')]();});}};}function handleEntityNotFound(_0x5a295e,_0x2dbe03){return function(_0x163531){if(!_0x163531){_0x5a295e['sendStatus'](0x194);}return _0x163531;};}function handleError(_0x44feff,_0x5866f4){_0x5866f4=_0x5866f4||0x1f4;return function(_0x5f2185){logger[_0xa122('0x20')](_0x5f2185['stack']);if(_0x5f2185[_0xa122('0x21')]){delete _0x5f2185[_0xa122('0x21')];}_0x44feff[_0xa122('0x13')](_0x5866f4)[_0xa122('0x22')](_0x5f2185);};}exports[_0xa122('0x23')]=function(_0x31be08,_0x57bfa4){var _0xe37991={'raw':!![],'where':{'id':_0x31be08[_0xa122('0x24')]['id']}},_0x3c8455={};_0x3c8455['model']=_['keys'](db[_0xa122('0x25')][_0xa122('0x26')]);_0x3c8455[_0xa122('0x27')]=_[_0xa122('0x28')](_0x31be08['query']);_0x3c8455['filters']=_[_0xa122('0x29')](_0x3c8455[_0xa122('0x2a')],_0x3c8455['query']);_0xe37991[_0xa122('0x2b')]=_[_0xa122('0x29')](_0x3c8455[_0xa122('0x2a')],qs[_0xa122('0x2c')](_0x31be08[_0xa122('0x27')][_0xa122('0x2c')]));_0xe37991['attributes']=_0xe37991[_0xa122('0x2b')]['length']?_0xe37991[_0xa122('0x2b')]:_0x3c8455['model'];if(_0x31be08[_0xa122('0x27')][_0xa122('0x2d')]){_0xe37991[_0xa122('0x2e')]=[{'all':!![]}];}_0xe37991=_[_0xa122('0x2f')]({},_0xe37991,_0x31be08['options']);return db[_0xa122('0x25')]['find'](_0xe37991)[_0xa122('0x1e')](handleEntityNotFound(_0x57bfa4,null))[_0xa122('0x1e')](respondWithResult(_0x57bfa4,null))[_0xa122('0x30')](handleError(_0x57bfa4,null));};exports['update']=function(_0x5a0789,_0x2ab6aa){if(_0x5a0789[_0xa122('0x31')]['id']){delete _0x5a0789[_0xa122('0x31')]['id'];}return db[_0xa122('0x25')][_0xa122('0x32')]({'where':{'id':_0x5a0789[_0xa122('0x24')]['id']}})['then'](handleEntityNotFound(_0x2ab6aa,null))[_0xa122('0x1e')](saveUpdates(_0x5a0789[_0xa122('0x31')],null))['then'](respondWithResult(_0x2ab6aa,null))[_0xa122('0x30')](handleError(_0x2ab6aa,null));};exports[_0xa122('0x1f')]=function(_0x1b96d6,_0x3f7898){return db[_0xa122('0x25')]['find']({'where':{'id':_0x1b96d6[_0xa122('0x24')]['id']}})[_0xa122('0x1e')](handleEntityNotFound(_0x3f7898,null))['then'](removeEntity(_0x3f7898,null))[_0xa122('0x30')](handleError(_0x3f7898,null));};
\ No newline at end of file
+var _0xad13=['length','includeAll','ChatApplication','find','catch','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','stack','name','show','keys','rawAttributes','query','filters','intersection','model','attributes','fields'];(function(_0x20aab1,_0xc6d854){var _0x277dff=function(_0x494c4d){while(--_0x494c4d){_0x20aab1['push'](_0x20aab1['shift']());}};_0x277dff(++_0xc6d854);}(_0xad13,0x79));var _0x3ad1=function(_0x18e3c5,_0x54fe8d){_0x18e3c5=_0x18e3c5-0x0;var _0x1a6b15=_0xad13[_0x18e3c5];return _0x1a6b15;};'use strict';var emlformat=require(_0x3ad1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3ad1('0x1'));var jsonpatch=require(_0x3ad1('0x2'));var rp=require(_0x3ad1('0x3'));var moment=require(_0x3ad1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3ad1('0x5'));var util=require(_0x3ad1('0x6'));var path=require(_0x3ad1('0x7'));var sox=require(_0x3ad1('0x8'));var csv=require(_0x3ad1('0x9'));var ejs=require(_0x3ad1('0xa'));var fs=require('fs');var fs_extra=require(_0x3ad1('0xb'));var _=require(_0x3ad1('0xc'));var squel=require(_0x3ad1('0xd'));var crypto=require(_0x3ad1('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3ad1('0xf'));var toCsv=require(_0x3ad1('0x9'));var querystring=require(_0x3ad1('0x10'));var Papa=require('papaparse');var Redis=require(_0x3ad1('0x11'));var authService=require(_0x3ad1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3ad1('0x13'));var hardwareService=require(_0x3ad1('0x14'));var logger=require(_0x3ad1('0x15'))(_0x3ad1('0x16'));var utils=require(_0x3ad1('0x17'));var config=require(_0x3ad1('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x142957,_0x42f6a0){_0x42f6a0=_0x42f6a0||0xcc;return function(_0x4544c0){if(_0x4544c0){return _0x142957[_0x3ad1('0x19')](_0x42f6a0);}return _0x142957['status'](_0x42f6a0)[_0x3ad1('0x1a')]();};}function respondWithResult(_0x4bf44f,_0x19b1db){_0x19b1db=_0x19b1db||0xc8;return function(_0x3b68de){if(_0x3b68de){return _0x4bf44f[_0x3ad1('0x1b')](_0x19b1db)[_0x3ad1('0x1c')](_0x3b68de);}};}function respondWithFilteredResult(_0x5448a1,_0x4104aa){return function(_0xce229){if(_0xce229){var _0x384ed5=typeof _0x4104aa[_0x3ad1('0x1d')]===_0x3ad1('0x1e')&&typeof _0x4104aa[_0x3ad1('0x1f')]===_0x3ad1('0x1e');var _0x5cf66b=_0xce229[_0x3ad1('0x20')];var _0x30e53f=_0x384ed5?0x0:_0x4104aa[_0x3ad1('0x1d')];var _0xd43203=_0x384ed5?_0xce229[_0x3ad1('0x20')]:_0x4104aa['offset']+_0x4104aa[_0x3ad1('0x1f')];var _0x3de9a2;if(_0xd43203>=_0x5cf66b){_0xd43203=_0x5cf66b;_0x3de9a2=0xc8;}else{_0x3de9a2=0xce;}_0x5448a1['status'](_0x3de9a2);return _0x5448a1[_0x3ad1('0x21')](_0x3ad1('0x22'),_0x30e53f+'-'+_0xd43203+'/'+_0x5cf66b)[_0x3ad1('0x1c')](_0xce229);}return null;};}function patchUpdates(_0x46649d){return function(_0x1f65ff){try{jsonpatch[_0x3ad1('0x23')](_0x1f65ff,_0x46649d,!![]);}catch(_0x5aa568){return BPromise[_0x3ad1('0x24')](_0x5aa568);}return _0x1f65ff['save']();};}function saveUpdates(_0xc78309,_0x5f1031){return function(_0x21ed3b){if(_0x21ed3b){return _0x21ed3b[_0x3ad1('0x25')](_0xc78309)[_0x3ad1('0x26')](function(_0x3e9c1f){return _0x3e9c1f;});}return null;};}function removeEntity(_0x2365f3,_0x3a0166){return function(_0x2fd5e6){if(_0x2fd5e6){return _0x2fd5e6['destroy']()[_0x3ad1('0x26')](function(){_0x2365f3[_0x3ad1('0x1b')](0xcc)[_0x3ad1('0x1a')]();});}};}function handleEntityNotFound(_0x2ee2e8,_0x1d82a8){return function(_0x2cd135){if(!_0x2cd135){_0x2ee2e8['sendStatus'](0x194);}return _0x2cd135;};}function handleError(_0x5b5abc,_0x7b69e5){_0x7b69e5=_0x7b69e5||0x1f4;return function(_0x5e1c03){logger['error'](_0x5e1c03[_0x3ad1('0x27')]);if(_0x5e1c03[_0x3ad1('0x28')]){delete _0x5e1c03[_0x3ad1('0x28')];}_0x5b5abc[_0x3ad1('0x1b')](_0x7b69e5)['send'](_0x5e1c03);};}exports[_0x3ad1('0x29')]=function(_0xc56f8a,_0x402df6){var _0x3753f1={'raw':!![],'where':{'id':_0xc56f8a['params']['id']}},_0x345cb9={};_0x345cb9['model']=_[_0x3ad1('0x2a')](db['ChatApplication'][_0x3ad1('0x2b')]);_0x345cb9[_0x3ad1('0x2c')]=_[_0x3ad1('0x2a')](_0xc56f8a[_0x3ad1('0x2c')]);_0x345cb9[_0x3ad1('0x2d')]=_[_0x3ad1('0x2e')](_0x345cb9[_0x3ad1('0x2f')],_0x345cb9[_0x3ad1('0x2c')]);_0x3753f1[_0x3ad1('0x30')]=_['intersection'](_0x345cb9[_0x3ad1('0x2f')],qs['fields'](_0xc56f8a[_0x3ad1('0x2c')][_0x3ad1('0x31')]));_0x3753f1[_0x3ad1('0x30')]=_0x3753f1[_0x3ad1('0x30')][_0x3ad1('0x32')]?_0x3753f1[_0x3ad1('0x30')]:_0x345cb9[_0x3ad1('0x2f')];if(_0xc56f8a['query'][_0x3ad1('0x33')]){_0x3753f1['include']=[{'all':!![]}];}_0x3753f1=_['merge']({},_0x3753f1,_0xc56f8a['options']);return db[_0x3ad1('0x34')][_0x3ad1('0x35')](_0x3753f1)[_0x3ad1('0x26')](handleEntityNotFound(_0x402df6,null))[_0x3ad1('0x26')](respondWithResult(_0x402df6,null))[_0x3ad1('0x36')](handleError(_0x402df6,null));};exports[_0x3ad1('0x25')]=function(_0x54f100,_0x51d21b){if(_0x54f100[_0x3ad1('0x37')]['id']){delete _0x54f100[_0x3ad1('0x37')]['id'];}return db[_0x3ad1('0x34')][_0x3ad1('0x35')]({'where':{'id':_0x54f100[_0x3ad1('0x38')]['id']}})['then'](handleEntityNotFound(_0x51d21b,null))['then'](saveUpdates(_0x54f100['body'],null))['then'](respondWithResult(_0x51d21b,null))[_0x3ad1('0x36')](handleError(_0x51d21b,null));};exports['destroy']=function(_0x5c2acd,_0x78b554){return db[_0x3ad1('0x34')]['find']({'where':{'id':_0x5c2acd[_0x3ad1('0x38')]['id']}})[_0x3ad1('0x26')](handleEntityNotFound(_0x78b554,null))['then'](removeEntity(_0x78b554,null))[_0x3ad1('0x36')](handleError(_0x78b554,null));};
\ No newline at end of file
index 5a3d13a..98d303f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2dab=['rimraf','../../config/environment','./chatApplication.attributes','exports','define','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x3416e2,_0x5c9c1b){var _0x52f5fe=function(_0x428adc){while(--_0x428adc){_0x3416e2['push'](_0x3416e2['shift']());}};_0x52f5fe(++_0x5c9c1b);}(_0x2dab,0x120));var _0xb2da=function(_0x601a1b,_0xad65ad){_0x601a1b=_0x601a1b-0x0;var _0x176b0f=_0x2dab[_0x601a1b];return _0x176b0f;};'use strict';var _=require(_0xb2da('0x0'));var util=require(_0xb2da('0x1'));var logger=require(_0xb2da('0x2'))(_0xb2da('0x3'));var moment=require(_0xb2da('0x4'));var BPromise=require('bluebird');var rp=require(_0xb2da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb2da('0x6'));var config=require(_0xb2da('0x7'));var attributes=require(_0xb2da('0x8'));module[_0xb2da('0x9')]=function(_0x309b46,_0x3b0e4e){return _0x309b46[_0xb2da('0xa')]('ChatApplication',attributes,{'tableName':_0xb2da('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb2da('0xc'),'collate':_0xb2da('0xd')});};
\ No newline at end of file
+var _0x3021=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x105ffd,_0x238299){var _0x1f8870=function(_0x1aecc7){while(--_0x1aecc7){_0x105ffd['push'](_0x105ffd['shift']());}};_0x1f8870(++_0x238299);}(_0x3021,0x1b0));var _0x1302=function(_0xfa5998,_0x4dcec4){_0xfa5998=_0xfa5998-0x0;var _0x55bddd=_0x3021[_0xfa5998];return _0x55bddd;};'use strict';var _=require(_0x1302('0x0'));var util=require('util');var logger=require(_0x1302('0x1'))('api');var moment=require(_0x1302('0x2'));var BPromise=require(_0x1302('0x3'));var rp=require(_0x1302('0x4'));var fs=require('fs');var path=require(_0x1302('0x5'));var rimraf=require(_0x1302('0x6'));var config=require(_0x1302('0x7'));var attributes=require(_0x1302('0x8'));module[_0x1302('0x9')]=function(_0x2bd488,_0x43890d){return _0x2bd488[_0x1302('0xa')](_0x1302('0xb'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1302('0xc'),'collate':_0x1302('0xd')});};
\ No newline at end of file
index 9575ed3..500641f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8fe1=['client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4a0b8e,_0x31087b){var _0x21eeba=function(_0x32feca){while(--_0x32feca){_0x4a0b8e['push'](_0x4a0b8e['shift']());}};_0x21eeba(++_0x31087b);}(_0x8fe1,0x1be));var _0x18fe=function(_0x3fba9f,_0x3b7b9b){_0x3fba9f=_0x3fba9f-0x0;var _0x192cf1=_0x8fe1[_0x3fba9f];return _0x192cf1;};'use strict';var _=require('lodash');var util=require(_0x18fe('0x0'));var moment=require(_0x18fe('0x1'));var BPromise=require(_0x18fe('0x2'));var rs=require(_0x18fe('0x3'));var fs=require('fs');var Redis=require(_0x18fe('0x4'));var db=require(_0x18fe('0x5'))['db'];var utils=require(_0x18fe('0x6'));var logger=require(_0x18fe('0x7'))(_0x18fe('0x8'));var config=require(_0x18fe('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x18fe('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x362ad3,_0x2ba644,_0x221435){return new BPromise(function(_0x136308,_0x10f68f){return client[_0x18fe('0xb')](_0x362ad3,_0x221435)[_0x18fe('0xc')](function(_0x368cc7){logger[_0x18fe('0xd')](_0x18fe('0xe'),_0x2ba644,_0x18fe('0xf'));logger[_0x18fe('0x10')](_0x18fe('0x11'),_0x2ba644,_0x18fe('0xf'),JSON[_0x18fe('0x12')](_0x368cc7));if(_0x368cc7[_0x18fe('0x13')]){if(_0x368cc7[_0x18fe('0x13')][_0x18fe('0x14')]===0x1f4){logger['error'](_0x18fe('0xe'),_0x2ba644,_0x368cc7['error'][_0x18fe('0x15')]);return _0x10f68f(_0x368cc7[_0x18fe('0x13')][_0x18fe('0x15')]);}logger[_0x18fe('0x13')](_0x18fe('0xe'),_0x2ba644,_0x368cc7[_0x18fe('0x13')]['message']);return _0x136308(_0x368cc7['error'][_0x18fe('0x15')]);}else{logger[_0x18fe('0xd')](_0x18fe('0xe'),_0x2ba644,_0x18fe('0xf'));_0x136308(_0x368cc7[_0x18fe('0x16')][_0x18fe('0x15')]);}})[_0x18fe('0x17')](function(_0x590ff1){logger[_0x18fe('0x13')](_0x18fe('0xe'),_0x2ba644,_0x590ff1);_0x10f68f(_0x590ff1);});});}
\ No newline at end of file
+var _0x3873=['request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http'];(function(_0x5a0f8a,_0x374487){var _0x1a9380=function(_0x783ef1){while(--_0x783ef1){_0x5a0f8a['push'](_0x5a0f8a['shift']());}};_0x1a9380(++_0x374487);}(_0x3873,0x161));var _0x3387=function(_0xda0921,_0x11bd63){_0xda0921=_0xda0921-0x0;var _0xf871d9=_0x3873[_0xda0921];return _0xf871d9;};'use strict';var _=require(_0x3387('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3387('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3387('0x2'));var db=require(_0x3387('0x3'))['db'];var utils=require(_0x3387('0x4'));var logger=require('../../config/logger')(_0x3387('0x5'));var config=require(_0x3387('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3387('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15a2db,_0x47a783,_0x3deb52){return new BPromise(function(_0x5b4d31,_0x2e4f07){return client[_0x3387('0x8')](_0x15a2db,_0x3deb52)[_0x3387('0x9')](function(_0x4796d0){logger['info'](_0x3387('0xa'),_0x47a783,_0x3387('0xb'));logger[_0x3387('0xc')](_0x3387('0xd'),_0x47a783,_0x3387('0xb'),JSON['stringify'](_0x4796d0));if(_0x4796d0['error']){if(_0x4796d0[_0x3387('0xe')][_0x3387('0xf')]===0x1f4){logger['error'](_0x3387('0xa'),_0x47a783,_0x4796d0[_0x3387('0xe')][_0x3387('0x10')]);return _0x2e4f07(_0x4796d0[_0x3387('0xe')][_0x3387('0x10')]);}logger[_0x3387('0xe')](_0x3387('0xa'),_0x47a783,_0x4796d0[_0x3387('0xe')]['message']);return _0x5b4d31(_0x4796d0[_0x3387('0xe')]['message']);}else{logger[_0x3387('0x11')](_0x3387('0xa'),_0x47a783,_0x3387('0xb'));_0x5b4d31(_0x4796d0[_0x3387('0x12')][_0x3387('0x10')]);}})['catch'](function(_0x50e589){logger[_0x3387('0xe')]('ChatApplication,\x20%s,\x20%s',_0x47a783,_0x50e589);_0x2e4f07(_0x50e589);});});}
\ No newline at end of file
index 064ae94..0d3e2b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92cc=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','put','isAuthenticated','update','delete','destroy','multer'];(function(_0x3b3b3c,_0x2e4b23){var _0x4e0a26=function(_0x19511d){while(--_0x19511d){_0x3b3b3c['push'](_0x3b3b3c['shift']());}};_0x4e0a26(++_0x2e4b23);}(_0x92cc,0x197));var _0xc92c=function(_0x418d8c,_0x48f7c8){_0x418d8c=_0x418d8c-0x0;var _0x19ad55=_0x92cc[_0x418d8c];return _0x19ad55;};'use strict';var multer=require(_0xc92c('0x0'));var util=require(_0xc92c('0x1'));var path=require(_0xc92c('0x2'));var timeout=require(_0xc92c('0x3'));var express=require(_0xc92c('0x4'));var router=express[_0xc92c('0x5')]();var fs_extra=require(_0xc92c('0x6'));var auth=require(_0xc92c('0x7'));var interaction=require(_0xc92c('0x8'));var config=require(_0xc92c('0x9'));var controller=require('./chatApplication.controller');router[_0xc92c('0xa')](_0xc92c('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xc92c('0xc')](_0xc92c('0xb'),auth[_0xc92c('0xd')](),controller[_0xc92c('0xe')]);router[_0xc92c('0xf')](_0xc92c('0xb'),auth[_0xc92c('0xd')](),controller[_0xc92c('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x5aca=['show','put','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x5aca,0xc5));var _0xa5ac=function(_0x507dcd,_0x2ecaeb){_0x507dcd=_0x507dcd-0x0;var _0x35bc5f=_0x5aca[_0x507dcd];return _0x35bc5f;};'use strict';var multer=require(_0xa5ac('0x0'));var util=require(_0xa5ac('0x1'));var path=require(_0xa5ac('0x2'));var timeout=require(_0xa5ac('0x3'));var express=require(_0xa5ac('0x4'));var router=express[_0xa5ac('0x5')]();var fs_extra=require(_0xa5ac('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa5ac('0x7'));var config=require(_0xa5ac('0x8'));var controller=require(_0xa5ac('0x9'));router[_0xa5ac('0xa')](_0xa5ac('0xb'),auth['isAuthenticated'](),controller[_0xa5ac('0xc')]);router[_0xa5ac('0xd')](_0xa5ac('0xb'),auth[_0xa5ac('0xe')](),controller[_0xa5ac('0xf')]);router[_0xa5ac('0x10')](_0xa5ac('0xb'),auth['isAuthenticated'](),controller[_0xa5ac('0x11')]);module[_0xa5ac('0x12')]=router;
\ No newline at end of file
index 7b3e270..281a610 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f75=['exports','STRING','BOOLEAN','sequelize'];(function(_0x4df93c,_0x14cb97){var _0x523396=function(_0x34712b){while(--_0x34712b){_0x4df93c['push'](_0x4df93c['shift']());}};_0x523396(++_0x14cb97);}(_0x4f75,0xbb));var _0x54f7=function(_0x3efc17,_0x3b8777){_0x3efc17=_0x3efc17-0x0;var _0x471962=_0x4f75[_0x3efc17];return _0x471962;};'use strict';var Sequelize=require(_0x54f7('0x0'));module[_0x54f7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x54f7('0x2')]},'write':{'type':Sequelize[_0x54f7('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xac73=['STRING','BOOLEAN','sequelize','exports'];(function(_0x3161b5,_0x42dc8a){var _0x2adf35=function(_0x14ce40){while(--_0x14ce40){_0x3161b5['push'](_0x3161b5['shift']());}};_0x2adf35(++_0x42dc8a);}(_0xac73,0x186));var _0x3ac7=function(_0x41dcd7,_0x467c87){_0x41dcd7=_0x41dcd7-0x0;var _0x1b315d=_0xac73[_0x41dcd7];return _0x1b315d;};'use strict';var Sequelize=require(_0x3ac7('0x0'));module[_0x3ac7('0x1')]={'name':{'type':Sequelize[_0x3ac7('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3ac7('0x2')]},'write':{'type':Sequelize[_0x3ac7('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index 547365d..c8e17c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f69=['includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','omit','ids','findOne','User','order','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','pick','split','format','eml-format','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','status','end','json','limit','undefined','offset','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','filter','count'];(function(_0x446a8b,_0x37f5cd){var _0xb56d31=function(_0x23ee4a){while(--_0x23ee4a){_0x446a8b['push'](_0x446a8b['shift']());}};_0xb56d31(++_0x37f5cd);}(_0x6f69,0x143));var _0x96f6=function(_0x46a836,_0x59b1e9){_0x46a836=_0x46a836-0x0;var _0x4e6773=_0x6f69[_0x46a836];return _0x4e6773;};'use strict';var emlformat=require(_0x96f6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x96f6('0x1'));var BPromise=require(_0x96f6('0x2'));var Mustache=require(_0x96f6('0x3'));var util=require('util');var path=require(_0x96f6('0x4'));var sox=require('sox');var csv=require(_0x96f6('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x96f6('0x6'));var _=require(_0x96f6('0x7'));var squel=require(_0x96f6('0x8'));var crypto=require(_0x96f6('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x96f6('0x5'));var querystring=require(_0x96f6('0xa'));var Papa=require('papaparse');var Redis=require(_0x96f6('0xb'));var authService=require(_0x96f6('0xc'));var qs=require(_0x96f6('0xd'));var as=require(_0x96f6('0xe'));var hardwareService=require(_0x96f6('0xf'));var logger=require(_0x96f6('0x10'))(_0x96f6('0x11'));var utils=require(_0x96f6('0x12'));var config=require(_0x96f6('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x96f6('0x14'))['db'];config[_0x96f6('0x15')]=_[_0x96f6('0x16')](config['redis'],{'host':_0x96f6('0x17'),'port':0x18eb});var socket=require(_0x96f6('0x18'))(new Redis(config[_0x96f6('0x15')]));require(_0x96f6('0x19'))[_0x96f6('0x1a')](socket);function respondWithStatusCode(_0x319d9c,_0x4967a7){_0x4967a7=_0x4967a7||0xcc;return function(_0x43c964){if(_0x43c964){return _0x319d9c['sendStatus'](_0x4967a7);}return _0x319d9c[_0x96f6('0x1b')](_0x4967a7)[_0x96f6('0x1c')]();};}function respondWithResult(_0x24d330,_0x2796b2){_0x2796b2=_0x2796b2||0xc8;return function(_0x3ff8d1){if(_0x3ff8d1){return _0x24d330[_0x96f6('0x1b')](_0x2796b2)[_0x96f6('0x1d')](_0x3ff8d1);}};}function respondWithFilteredResult(_0x1b7dca,_0x18bb81){return function(_0xedf402){if(_0xedf402){var _0x115b9f=typeof _0x18bb81['offset']==='undefined'&&typeof _0x18bb81[_0x96f6('0x1e')]===_0x96f6('0x1f');var _0x5171af=_0xedf402['count'];var _0x4a40c0=_0x115b9f?0x0:_0x18bb81['offset'];var _0x2d9549=_0x115b9f?_0xedf402['count']:_0x18bb81[_0x96f6('0x20')]+_0x18bb81['limit'];var _0x531c72;if(_0x2d9549>=_0x5171af){_0x2d9549=_0x5171af;_0x531c72=0xc8;}else{_0x531c72=0xce;}_0x1b7dca['status'](_0x531c72);return _0x1b7dca[_0x96f6('0x21')](_0x96f6('0x22'),_0x4a40c0+'-'+_0x2d9549+'/'+_0x5171af)[_0x96f6('0x1d')](_0xedf402);}return null;};}function patchUpdates(_0x585c77){return function(_0x2113ca){try{jsonpatch[_0x96f6('0x23')](_0x2113ca,_0x585c77,!![]);}catch(_0x165652){return BPromise[_0x96f6('0x24')](_0x165652);}return _0x2113ca[_0x96f6('0x25')]();};}function saveUpdates(_0x5caee9,_0x422aa8){return function(_0x4509a1){if(_0x4509a1){return _0x4509a1[_0x96f6('0x26')](_0x5caee9)[_0x96f6('0x27')](function(_0xb0ddda){return _0xb0ddda;});}return null;};}function removeEntity(_0x1a9a26,_0x42bbbc){return function(_0x80bae){if(_0x80bae){return _0x80bae[_0x96f6('0x28')]()[_0x96f6('0x27')](function(){_0x1a9a26['status'](0xcc)[_0x96f6('0x1c')]();});}};}function handleEntityNotFound(_0x1e2c58,_0x20a8d2){return function(_0x2e2676){if(!_0x2e2676){_0x1e2c58[_0x96f6('0x29')](0x194);}return _0x2e2676;};}function handleError(_0x2628a9,_0x41dc5c){_0x41dc5c=_0x41dc5c||0x1f4;return function(_0x13e089){logger[_0x96f6('0x2a')](_0x13e089[_0x96f6('0x2b')]);if(_0x13e089[_0x96f6('0x2c')]){delete _0x13e089[_0x96f6('0x2c')];}_0x2628a9[_0x96f6('0x1b')](_0x41dc5c)[_0x96f6('0x2d')](_0x13e089);};}exports[_0x96f6('0x2e')]=function(_0x525d69,_0x2539f8){var _0x58b00d={},_0x41d60b={},_0x3a5e93={'count':0x0,'rows':[]};var _0x3563e8=_[_0x96f6('0x2f')](db[_0x96f6('0x30')][_0x96f6('0x31')],function(_0x432a8b){return{'name':_0x432a8b[_0x96f6('0x32')],'type':_0x432a8b[_0x96f6('0x33')][_0x96f6('0x34')]};});_0x41d60b[_0x96f6('0x35')]=_[_0x96f6('0x2f')](_0x3563e8,_0x96f6('0x2c'));_0x41d60b[_0x96f6('0x36')]=_[_0x96f6('0x37')](_0x525d69['query']);_0x41d60b['filters']=_['intersection'](_0x41d60b[_0x96f6('0x35')],_0x41d60b['query']);_0x58b00d['attributes']=_[_0x96f6('0x38')](_0x41d60b[_0x96f6('0x35')],qs[_0x96f6('0x39')](_0x525d69['query'][_0x96f6('0x39')]));_0x58b00d[_0x96f6('0x3a')]=_0x58b00d[_0x96f6('0x3a')][_0x96f6('0x3b')]?_0x58b00d[_0x96f6('0x3a')]:_0x41d60b[_0x96f6('0x35')];if(!_0x525d69['query'][_0x96f6('0x3c')](_0x96f6('0x3d'))){_0x58b00d[_0x96f6('0x1e')]=qs[_0x96f6('0x1e')](_0x525d69[_0x96f6('0x36')][_0x96f6('0x1e')]);_0x58b00d[_0x96f6('0x20')]=qs['offset'](_0x525d69['query'][_0x96f6('0x20')]);}_0x58b00d['order']=qs[_0x96f6('0x3e')](_0x525d69[_0x96f6('0x36')]['sort']);_0x58b00d[_0x96f6('0x3f')]=qs[_0x96f6('0x40')](_['pick'](_0x525d69[_0x96f6('0x36')],_0x41d60b['filters']),_0x3563e8);if(_0x525d69['query']['filter']){_0x58b00d[_0x96f6('0x3f')]=_[_0x96f6('0x41')](_0x58b00d['where'],{'$or':_[_0x96f6('0x2f')](_0x3563e8,function(_0x40793e){if(_0x40793e[_0x96f6('0x33')]!==_0x96f6('0x42')){var _0x54348b={};_0x54348b[_0x40793e[_0x96f6('0x2c')]]={'$like':'%'+_0x525d69[_0x96f6('0x36')][_0x96f6('0x43')]+'%'};return _0x54348b;}})});}_0x58b00d=_['merge']({},_0x58b00d,_0x525d69['options']);var _0x336605={'where':_0x58b00d['where']};return db[_0x96f6('0x30')][_0x96f6('0x44')](_0x336605)[_0x96f6('0x27')](function(_0x32f825){_0x3a5e93[_0x96f6('0x44')]=_0x32f825;if(_0x525d69[_0x96f6('0x36')][_0x96f6('0x45')]){_0x58b00d[_0x96f6('0x46')]=[{'all':!![]}];}return db[_0x96f6('0x30')][_0x96f6('0x47')](_0x58b00d);})['then'](function(_0x280fd0){_0x3a5e93[_0x96f6('0x48')]=_0x280fd0;return _0x3a5e93;})[_0x96f6('0x27')](respondWithFilteredResult(_0x2539f8,_0x58b00d))[_0x96f6('0x49')](handleError(_0x2539f8,null));};exports[_0x96f6('0x4a')]=function(_0x5177c0,_0x40badd){var _0x55c04f={'raw':!![],'where':{'id':_0x5177c0[_0x96f6('0x4b')]['id']}},_0x5d317d={};_0x5d317d['model']=_[_0x96f6('0x37')](db[_0x96f6('0x30')]['rawAttributes']);_0x5d317d[_0x96f6('0x36')]=_[_0x96f6('0x37')](_0x5177c0['query']);_0x5d317d['filters']=_[_0x96f6('0x38')](_0x5d317d[_0x96f6('0x35')],_0x5d317d['query']);_0x55c04f[_0x96f6('0x3a')]=_[_0x96f6('0x38')](_0x5d317d[_0x96f6('0x35')],qs[_0x96f6('0x39')](_0x5177c0[_0x96f6('0x36')]['fields']));_0x55c04f[_0x96f6('0x3a')]=_0x55c04f['attributes']['length']?_0x55c04f['attributes']:_0x5d317d[_0x96f6('0x35')];if(_0x5177c0[_0x96f6('0x36')][_0x96f6('0x45')]){_0x55c04f['include']=[{'all':!![]}];}_0x55c04f=_[_0x96f6('0x41')]({},_0x55c04f,_0x5177c0[_0x96f6('0x4c')]);return db[_0x96f6('0x30')][_0x96f6('0x4d')](_0x55c04f)[_0x96f6('0x27')](handleEntityNotFound(_0x40badd,null))[_0x96f6('0x27')](respondWithResult(_0x40badd,null))[_0x96f6('0x49')](handleError(_0x40badd,null));};exports[_0x96f6('0x4e')]=function(_0x32f430,_0x43ec2e){return db[_0x96f6('0x30')][_0x96f6('0x4e')](_0x32f430[_0x96f6('0x4f')],{})[_0x96f6('0x27')](respondWithResult(_0x43ec2e,0xc9))['catch'](handleError(_0x43ec2e,null));};exports[_0x96f6('0x26')]=function(_0x494f13,_0x4bcb05){if(_0x494f13[_0x96f6('0x4f')]['id']){delete _0x494f13[_0x96f6('0x4f')]['id'];}return db[_0x96f6('0x30')][_0x96f6('0x4d')]({'where':{'id':_0x494f13[_0x96f6('0x4b')]['id']}})[_0x96f6('0x27')](handleEntityNotFound(_0x4bcb05,null))[_0x96f6('0x27')](saveUpdates(_0x494f13[_0x96f6('0x4f')],null))['then'](respondWithResult(_0x4bcb05,null))[_0x96f6('0x49')](handleError(_0x4bcb05,null));};exports[_0x96f6('0x28')]=function(_0x1ce91d,_0x431cee){return db[_0x96f6('0x30')][_0x96f6('0x4d')]({'where':{'id':_0x1ce91d['params']['id']}})[_0x96f6('0x27')](handleEntityNotFound(_0x431cee,null))[_0x96f6('0x27')](removeEntity(_0x431cee,null))[_0x96f6('0x49')](handleError(_0x431cee,null));};exports['describe']=function(_0x5f2dee,_0x51107f){return db[_0x96f6('0x30')][_0x96f6('0x50')]()['then'](respondWithResult(_0x51107f,null))['catch'](handleError(_0x51107f,null));};exports[_0x96f6('0x51')]=function(_0x294036,_0x44ff09,_0x487815){return db[_0x96f6('0x52')][_0x96f6('0x44')]({'where':{'ChatGroupId':_0x294036['params']['id'],'ToId':_0x294036[_0x96f6('0x53')]['id'],'read':![]}})[_0x96f6('0x27')](function(_0x3d0014){return{'id':_['toInteger'](_0x294036[_0x96f6('0x4b')]['id']),'count':_0x3d0014};})[_0x96f6('0x27')](respondWithResult(_0x44ff09,null))[_0x96f6('0x49')](handleError(_0x44ff09,null));};exports[_0x96f6('0x54')]=function(_0x3f3e21,_0x435030,_0x2d932b){return db[_0x96f6('0x30')][_0x96f6('0x4d')]({'where':{'id':_0x3f3e21[_0x96f6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x435030,null))[_0x96f6('0x27')](function(_0x4d4687){if(_0x4d4687){return _0x4d4687['addMembers'](_0x3f3e21[_0x96f6('0x4f')]['ids'],_[_0x96f6('0x55')](_0x3f3e21[_0x96f6('0x4f')],[_0x96f6('0x56'),'id'])||{});}})['then'](respondWithResult(_0x435030,null))[_0x96f6('0x49')](handleError(_0x435030,null));};exports['getMembers']=function(_0x5022be,_0x135d3e,_0x4a044a){var _0x5b6ff8={};var _0x46ca69={};var _0x5dbcb2;var _0x53ca24;return db['ChatGroup'][_0x96f6('0x57')]({'where':{'id':_0x5022be[_0x96f6('0x4b')]['id']}})[_0x96f6('0x27')](handleEntityNotFound(_0x135d3e,null))[_0x96f6('0x27')](function(_0x28c737){if(_0x28c737){_0x5dbcb2=_0x28c737;_0x46ca69[_0x96f6('0x35')]=_[_0x96f6('0x37')](db[_0x96f6('0x58')][_0x96f6('0x31')]);_0x46ca69[_0x96f6('0x36')]=_['keys'](_0x5022be['query']);_0x46ca69[_0x96f6('0x40')]=_['intersection'](_0x46ca69[_0x96f6('0x35')],_0x46ca69['query']);_0x5b6ff8[_0x96f6('0x3a')]=_[_0x96f6('0x38')](_0x46ca69[_0x96f6('0x35')],qs[_0x96f6('0x39')](_0x5022be[_0x96f6('0x36')][_0x96f6('0x39')]));_0x5b6ff8['attributes']=_0x5b6ff8[_0x96f6('0x3a')][_0x96f6('0x3b')]?_0x5b6ff8['attributes']:_0x46ca69[_0x96f6('0x35')];_0x5b6ff8[_0x96f6('0x59')]=qs[_0x96f6('0x3e')](_0x5022be[_0x96f6('0x36')][_0x96f6('0x3e')]);_0x5b6ff8[_0x96f6('0x3f')]=qs[_0x96f6('0x40')](_['pick'](_0x5022be['query'],_0x46ca69[_0x96f6('0x40')]));if(_0x5022be[_0x96f6('0x36')][_0x96f6('0x43')]){_0x5b6ff8[_0x96f6('0x3f')]=_[_0x96f6('0x41')](_0x5b6ff8['where'],{'$or':_[_0x96f6('0x2f')](_0x5b6ff8['attributes'],function(_0x323fa3){var _0x17ff3a={};_0x17ff3a[_0x323fa3]={'$like':'%'+_0x5022be[_0x96f6('0x36')]['filter']+'%'};return _0x17ff3a;})});}_0x5b6ff8=_[_0x96f6('0x41')]({},_0x5b6ff8,_0x5022be[_0x96f6('0x4c')]);return _0x5dbcb2[_0x96f6('0x5a')](_0x5b6ff8);}})[_0x96f6('0x27')](function(_0x153f8f){if(_0x153f8f){_0x53ca24=_0x153f8f[_0x96f6('0x3b')];if(!_0x5022be[_0x96f6('0x36')]['hasOwnProperty'](_0x96f6('0x3d'))){_0x5b6ff8[_0x96f6('0x1e')]=qs[_0x96f6('0x1e')](_0x5022be[_0x96f6('0x36')][_0x96f6('0x1e')]);_0x5b6ff8[_0x96f6('0x20')]=qs[_0x96f6('0x20')](_0x5022be[_0x96f6('0x36')]['offset']);}return _0x5dbcb2['getMembers'](_0x5b6ff8);}})['then'](function(_0x47da43){if(_0x47da43){return _0x47da43?{'count':_0x53ca24,'rows':_0x47da43}:null;}})[_0x96f6('0x27')](respondWithResult(_0x135d3e,null))[_0x96f6('0x49')](handleError(_0x135d3e,null));};exports[_0x96f6('0x5b')]=function(_0x178617,_0x269f63,_0x1f9bcc){return db['ChatGroup'][_0x96f6('0x4d')]({'where':{'id':_0x178617[_0x96f6('0x4b')]['id']}})[_0x96f6('0x27')](handleEntityNotFound(_0x269f63,null))[_0x96f6('0x27')](function(_0x1660f1){if(_0x1660f1){return _0x1660f1[_0x96f6('0x5b')](_0x178617[_0x96f6('0x36')][_0x96f6('0x56')]);}})['then'](respondWithStatusCode(_0x269f63,null))['catch'](handleError(_0x269f63,null));};exports[_0x96f6('0x5c')]=function(_0x5d2f95,_0x3d2bc5,_0x1a5ee5){if(_0x5d2f95['body']['id']){delete _0x5d2f95[_0x96f6('0x4f')]['id'];}return db[_0x96f6('0x30')]['find']({'where':{'id':_0x5d2f95[_0x96f6('0x4b')]['id']}})[_0x96f6('0x27')](handleEntityNotFound(_0x3d2bc5,null))[_0x96f6('0x27')](function(_0x45134c){if(_0x45134c){_0x5d2f95[_0x96f6('0x4f')][_0x96f6('0x5d')]=_0x45134c['id'];return db['ChatInternalMessage']['create'](_0x5d2f95[_0x96f6('0x4f')]);}})['then'](respondWithResult(_0x3d2bc5,null))['catch'](handleError(_0x3d2bc5,null));};exports[_0x96f6('0x5e')]=function(_0x53a84d,_0x6b7ea9,_0x3da4da){var _0x53bb3f={};var _0xbfe9fb={};var _0x2068bb;var _0x4bb2a3;return db[_0x96f6('0x30')][_0x96f6('0x57')]({'where':{'id':_0x53a84d[_0x96f6('0x4b')]['id']}})['then'](handleEntityNotFound(_0x6b7ea9,null))[_0x96f6('0x27')](function(_0x277cc9){if(_0x277cc9){_0x2068bb=_0x277cc9;_0xbfe9fb[_0x96f6('0x35')]=_[_0x96f6('0x37')](db['ChatInternalMessage'][_0x96f6('0x31')]);_0xbfe9fb[_0x96f6('0x36')]=_[_0x96f6('0x37')](_0x53a84d[_0x96f6('0x36')]);_0xbfe9fb[_0x96f6('0x40')]=_['intersection'](_0xbfe9fb[_0x96f6('0x35')],_0xbfe9fb[_0x96f6('0x36')]);_0x53bb3f['attributes']=_[_0x96f6('0x38')](_0xbfe9fb[_0x96f6('0x35')],qs['fields'](_0x53a84d[_0x96f6('0x36')][_0x96f6('0x39')]));_0x53bb3f['attributes']=_0x53bb3f['attributes'][_0x96f6('0x3b')]?_0x53bb3f[_0x96f6('0x3a')]:_0xbfe9fb[_0x96f6('0x35')];_0x53bb3f[_0x96f6('0x59')]=qs[_0x96f6('0x3e')](_0x53a84d[_0x96f6('0x36')][_0x96f6('0x3e')]);_0x53bb3f[_0x96f6('0x3f')]=qs['filters'](_[_0x96f6('0x5f')](_0x53a84d[_0x96f6('0x36')],_0xbfe9fb[_0x96f6('0x40')]));if(_0x53a84d[_0x96f6('0x36')][_0x96f6('0x43')]){_0x53bb3f[_0x96f6('0x3f')]=_['merge'](_0x53bb3f[_0x96f6('0x3f')],{'$or':_[_0x96f6('0x2f')](_0x53bb3f[_0x96f6('0x3a')],function(_0xff6e4d){var _0x110ad5={};_0x110ad5[_0xff6e4d]={'$like':'%'+_0x53a84d[_0x96f6('0x36')][_0x96f6('0x43')]+'%'};return _0x110ad5;})});}if(_0x53a84d[_0x96f6('0x36')]['$gte']){var _0x34a5fb=_0x53a84d[_0x96f6('0x36')]['$gte'][_0x96f6('0x60')](',');var _0x185cef={};_0x185cef[_0x34a5fb[0x0]]={'$gte':moment(_0x34a5fb[0x1])[_0x96f6('0x61')]('YYYY-MM-DD\x20HH:mm:ss')};_0x53bb3f['where']=_[_0x96f6('0x41')](_0x53bb3f['where'],_0x185cef);}_0x53bb3f=_['merge']({},_0x53bb3f,_0x53a84d[_0x96f6('0x4c')]);return _0x2068bb[_0x96f6('0x5e')](_0x53bb3f);}})[_0x96f6('0x27')](function(_0x1854e8){if(_0x1854e8){_0x4bb2a3=_0x1854e8[_0x96f6('0x3b')];if(!_0x53a84d[_0x96f6('0x36')][_0x96f6('0x3c')](_0x96f6('0x3d'))){_0x53bb3f[_0x96f6('0x1e')]=qs[_0x96f6('0x1e')](_0x53a84d['query'][_0x96f6('0x1e')]);_0x53bb3f[_0x96f6('0x20')]=qs[_0x96f6('0x20')](_0x53a84d[_0x96f6('0x36')][_0x96f6('0x20')]);}return _0x2068bb['getMessages'](_0x53bb3f);}})[_0x96f6('0x27')](function(_0x3cc98a){if(_0x3cc98a){return _0x3cc98a?{'count':_0x4bb2a3,'rows':_0x3cc98a}:null;}})[_0x96f6('0x27')](respondWithResult(_0x6b7ea9,null))[_0x96f6('0x49')](handleError(_0x6b7ea9,null));};
\ No newline at end of file
+var _0x5b6c=['reject','save','destroy','then','status','end','stack','name','map','ChatGroup','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','describe','ChatInternalMessage','toInteger','addMembers','omit','ids','findOne','order','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','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','../../mysqldb','redis','defaults','localhost','register','sendStatus','json','undefined','count','offset','limit','set','Content-Range','apply'];(function(_0x3b25e3,_0x368a15){var _0x2eaf8c=function(_0x33d731){while(--_0x33d731){_0x3b25e3['push'](_0x3b25e3['shift']());}};_0x2eaf8c(++_0x368a15);}(_0x5b6c,0x153));var _0xc5b6=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x5b6c[_0x101e7b];return _0x4995c0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc5b6('0x0'));var zipdir=require(_0xc5b6('0x1'));var jsonpatch=require(_0xc5b6('0x2'));var rp=require(_0xc5b6('0x3'));var moment=require(_0xc5b6('0x4'));var BPromise=require(_0xc5b6('0x5'));var Mustache=require(_0xc5b6('0x6'));var util=require(_0xc5b6('0x7'));var path=require('path');var sox=require(_0xc5b6('0x8'));var csv=require(_0xc5b6('0x9'));var ejs=require(_0xc5b6('0xa'));var fs=require('fs');var fs_extra=require(_0xc5b6('0xb'));var _=require(_0xc5b6('0xc'));var squel=require('squel');var crypto=require(_0xc5b6('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc5b6('0x9'));var querystring=require(_0xc5b6('0xe'));var Papa=require(_0xc5b6('0xf'));var Redis=require(_0xc5b6('0x10'));var authService=require(_0xc5b6('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5b6('0x12'));var logger=require(_0xc5b6('0x13'))(_0xc5b6('0x14'));var utils=require('../../config/utils');var config=require(_0xc5b6('0x15'));var licenseUtil=require(_0xc5b6('0x16'));var db=require(_0xc5b6('0x17'))['db'];config[_0xc5b6('0x18')]=_[_0xc5b6('0x19')](config[_0xc5b6('0x18')],{'host':_0xc5b6('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatGroup.socket')[_0xc5b6('0x1b')](socket);function respondWithStatusCode(_0x2a4679,_0x2070e1){_0x2070e1=_0x2070e1||0xcc;return function(_0x5c4bdd){if(_0x5c4bdd){return _0x2a4679[_0xc5b6('0x1c')](_0x2070e1);}return _0x2a4679['status'](_0x2070e1)['end']();};}function respondWithResult(_0xb4af,_0x421c07){_0x421c07=_0x421c07||0xc8;return function(_0x2a85f2){if(_0x2a85f2){return _0xb4af['status'](_0x421c07)[_0xc5b6('0x1d')](_0x2a85f2);}};}function respondWithFilteredResult(_0x358b2f,_0x25c732){return function(_0x6c147c){if(_0x6c147c){var _0x269889=typeof _0x25c732['offset']===_0xc5b6('0x1e')&&typeof _0x25c732['limit']===_0xc5b6('0x1e');var _0x763f89=_0x6c147c[_0xc5b6('0x1f')];var _0x283974=_0x269889?0x0:_0x25c732[_0xc5b6('0x20')];var _0x143fc7=_0x269889?_0x6c147c[_0xc5b6('0x1f')]:_0x25c732[_0xc5b6('0x20')]+_0x25c732[_0xc5b6('0x21')];var _0x3b587e;if(_0x143fc7>=_0x763f89){_0x143fc7=_0x763f89;_0x3b587e=0xc8;}else{_0x3b587e=0xce;}_0x358b2f['status'](_0x3b587e);return _0x358b2f[_0xc5b6('0x22')](_0xc5b6('0x23'),_0x283974+'-'+_0x143fc7+'/'+_0x763f89)[_0xc5b6('0x1d')](_0x6c147c);}return null;};}function patchUpdates(_0x37ae51){return function(_0x14d45b){try{jsonpatch[_0xc5b6('0x24')](_0x14d45b,_0x37ae51,!![]);}catch(_0x18192e){return BPromise[_0xc5b6('0x25')](_0x18192e);}return _0x14d45b[_0xc5b6('0x26')]();};}function saveUpdates(_0x411d1f,_0x5e087a){return function(_0x3af8fd){if(_0x3af8fd){return _0x3af8fd['update'](_0x411d1f)['then'](function(_0x2d0d00){return _0x2d0d00;});}return null;};}function removeEntity(_0x3b0cca,_0x5bfa7b){return function(_0xc93bf4){if(_0xc93bf4){return _0xc93bf4[_0xc5b6('0x27')]()[_0xc5b6('0x28')](function(){_0x3b0cca[_0xc5b6('0x29')](0xcc)[_0xc5b6('0x2a')]();});}};}function handleEntityNotFound(_0x554ee6,_0x3e6385){return function(_0x530ae4){if(!_0x530ae4){_0x554ee6[_0xc5b6('0x1c')](0x194);}return _0x530ae4;};}function handleError(_0x358531,_0x1071fd){_0x1071fd=_0x1071fd||0x1f4;return function(_0x394130){logger['error'](_0x394130[_0xc5b6('0x2b')]);if(_0x394130[_0xc5b6('0x2c')]){delete _0x394130[_0xc5b6('0x2c')];}_0x358531[_0xc5b6('0x29')](_0x1071fd)['send'](_0x394130);};}exports['index']=function(_0x4408cc,_0x3a0e40){var _0x43a2c2={},_0x4d3698={},_0x59e953={'count':0x0,'rows':[]};var _0x56c50b=_[_0xc5b6('0x2d')](db[_0xc5b6('0x2e')]['rawAttributes'],function(_0x1e0374){return{'name':_0x1e0374[_0xc5b6('0x2f')],'type':_0x1e0374[_0xc5b6('0x30')]['key']};});_0x4d3698[_0xc5b6('0x31')]=_['map'](_0x56c50b,'name');_0x4d3698['query']=_[_0xc5b6('0x32')](_0x4408cc[_0xc5b6('0x33')]);_0x4d3698[_0xc5b6('0x34')]=_[_0xc5b6('0x35')](_0x4d3698[_0xc5b6('0x31')],_0x4d3698[_0xc5b6('0x33')]);_0x43a2c2[_0xc5b6('0x36')]=_[_0xc5b6('0x35')](_0x4d3698[_0xc5b6('0x31')],qs[_0xc5b6('0x37')](_0x4408cc['query'][_0xc5b6('0x37')]));_0x43a2c2[_0xc5b6('0x36')]=_0x43a2c2['attributes'][_0xc5b6('0x38')]?_0x43a2c2['attributes']:_0x4d3698['model'];if(!_0x4408cc['query'][_0xc5b6('0x39')](_0xc5b6('0x3a'))){_0x43a2c2[_0xc5b6('0x21')]=qs[_0xc5b6('0x21')](_0x4408cc[_0xc5b6('0x33')][_0xc5b6('0x21')]);_0x43a2c2[_0xc5b6('0x20')]=qs[_0xc5b6('0x20')](_0x4408cc[_0xc5b6('0x33')][_0xc5b6('0x20')]);}_0x43a2c2['order']=qs[_0xc5b6('0x3b')](_0x4408cc['query'][_0xc5b6('0x3b')]);_0x43a2c2[_0xc5b6('0x3c')]=qs[_0xc5b6('0x34')](_[_0xc5b6('0x3d')](_0x4408cc[_0xc5b6('0x33')],_0x4d3698['filters']),_0x56c50b);if(_0x4408cc[_0xc5b6('0x33')][_0xc5b6('0x3e')]){_0x43a2c2[_0xc5b6('0x3c')]=_[_0xc5b6('0x3f')](_0x43a2c2[_0xc5b6('0x3c')],{'$or':_['map'](_0x56c50b,function(_0x59a30a){if(_0x59a30a[_0xc5b6('0x30')]!==_0xc5b6('0x40')){var _0x477b4e={};_0x477b4e[_0x59a30a[_0xc5b6('0x2c')]]={'$like':'%'+_0x4408cc[_0xc5b6('0x33')][_0xc5b6('0x3e')]+'%'};return _0x477b4e;}})});}_0x43a2c2=_['merge']({},_0x43a2c2,_0x4408cc[_0xc5b6('0x41')]);var _0x561346={'where':_0x43a2c2[_0xc5b6('0x3c')]};return db['ChatGroup'][_0xc5b6('0x1f')](_0x561346)[_0xc5b6('0x28')](function(_0x19a726){_0x59e953[_0xc5b6('0x1f')]=_0x19a726;if(_0x4408cc[_0xc5b6('0x33')][_0xc5b6('0x42')]){_0x43a2c2[_0xc5b6('0x43')]=[{'all':!![]}];}return db[_0xc5b6('0x2e')][_0xc5b6('0x44')](_0x43a2c2);})[_0xc5b6('0x28')](function(_0x18d3f5){_0x59e953[_0xc5b6('0x45')]=_0x18d3f5;return _0x59e953;})['then'](respondWithFilteredResult(_0x3a0e40,_0x43a2c2))[_0xc5b6('0x46')](handleError(_0x3a0e40,null));};exports[_0xc5b6('0x47')]=function(_0x1283ff,_0x46448a){var _0x538ac8={'raw':!![],'where':{'id':_0x1283ff[_0xc5b6('0x48')]['id']}},_0x597670={};_0x597670[_0xc5b6('0x31')]=_[_0xc5b6('0x32')](db['ChatGroup'][_0xc5b6('0x49')]);_0x597670[_0xc5b6('0x33')]=_[_0xc5b6('0x32')](_0x1283ff['query']);_0x597670[_0xc5b6('0x34')]=_[_0xc5b6('0x35')](_0x597670[_0xc5b6('0x31')],_0x597670[_0xc5b6('0x33')]);_0x538ac8[_0xc5b6('0x36')]=_[_0xc5b6('0x35')](_0x597670[_0xc5b6('0x31')],qs[_0xc5b6('0x37')](_0x1283ff['query'][_0xc5b6('0x37')]));_0x538ac8['attributes']=_0x538ac8['attributes'][_0xc5b6('0x38')]?_0x538ac8[_0xc5b6('0x36')]:_0x597670[_0xc5b6('0x31')];if(_0x1283ff['query']['includeAll']){_0x538ac8[_0xc5b6('0x43')]=[{'all':!![]}];}_0x538ac8=_[_0xc5b6('0x3f')]({},_0x538ac8,_0x1283ff['options']);return db[_0xc5b6('0x2e')][_0xc5b6('0x4a')](_0x538ac8)['then'](handleEntityNotFound(_0x46448a,null))[_0xc5b6('0x28')](respondWithResult(_0x46448a,null))[_0xc5b6('0x46')](handleError(_0x46448a,null));};exports[_0xc5b6('0x4b')]=function(_0x596b24,_0x206076){return db[_0xc5b6('0x2e')][_0xc5b6('0x4b')](_0x596b24[_0xc5b6('0x4c')],{})[_0xc5b6('0x28')](respondWithResult(_0x206076,0xc9))[_0xc5b6('0x46')](handleError(_0x206076,null));};exports[_0xc5b6('0x4d')]=function(_0x22708d,_0x184e0d){if(_0x22708d[_0xc5b6('0x4c')]['id']){delete _0x22708d['body']['id'];}return db[_0xc5b6('0x2e')]['find']({'where':{'id':_0x22708d[_0xc5b6('0x48')]['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0x184e0d,null))['then'](saveUpdates(_0x22708d[_0xc5b6('0x4c')],null))[_0xc5b6('0x28')](respondWithResult(_0x184e0d,null))['catch'](handleError(_0x184e0d,null));};exports[_0xc5b6('0x27')]=function(_0x380d90,_0x320e7e){return db[_0xc5b6('0x2e')][_0xc5b6('0x4a')]({'where':{'id':_0x380d90[_0xc5b6('0x48')]['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0x320e7e,null))['then'](removeEntity(_0x320e7e,null))[_0xc5b6('0x46')](handleError(_0x320e7e,null));};exports[_0xc5b6('0x4e')]=function(_0xd51042,_0x33da35){return db[_0xc5b6('0x2e')][_0xc5b6('0x4e')]()[_0xc5b6('0x28')](respondWithResult(_0x33da35,null))['catch'](handleError(_0x33da35,null));};exports['getUnread']=function(_0x3af80e,_0x3748ff,_0x4acab9){return db[_0xc5b6('0x4f')]['count']({'where':{'ChatGroupId':_0x3af80e[_0xc5b6('0x48')]['id'],'ToId':_0x3af80e['user']['id'],'read':![]}})[_0xc5b6('0x28')](function(_0x1e80bf){return{'id':_[_0xc5b6('0x50')](_0x3af80e[_0xc5b6('0x48')]['id']),'count':_0x1e80bf};})['then'](respondWithResult(_0x3748ff,null))[_0xc5b6('0x46')](handleError(_0x3748ff,null));};exports['addMembers']=function(_0x572741,_0x402d38,_0x59ba82){return db[_0xc5b6('0x2e')]['find']({'where':{'id':_0x572741[_0xc5b6('0x48')]['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0x402d38,null))[_0xc5b6('0x28')](function(_0x32df4d){if(_0x32df4d){return _0x32df4d[_0xc5b6('0x51')](_0x572741[_0xc5b6('0x4c')]['ids'],_[_0xc5b6('0x52')](_0x572741[_0xc5b6('0x4c')],[_0xc5b6('0x53'),'id'])||{});}})[_0xc5b6('0x28')](respondWithResult(_0x402d38,null))['catch'](handleError(_0x402d38,null));};exports['getMembers']=function(_0xc2f9eb,_0x13b829,_0x1dd324){var _0x284521={};var _0x32e062={};var _0xc56d86;var _0x4d9261;return db[_0xc5b6('0x2e')][_0xc5b6('0x54')]({'where':{'id':_0xc2f9eb['params']['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0x13b829,null))['then'](function(_0x5b0b49){if(_0x5b0b49){_0xc56d86=_0x5b0b49;_0x32e062[_0xc5b6('0x31')]=_[_0xc5b6('0x32')](db['User'][_0xc5b6('0x49')]);_0x32e062['query']=_[_0xc5b6('0x32')](_0xc2f9eb['query']);_0x32e062[_0xc5b6('0x34')]=_[_0xc5b6('0x35')](_0x32e062[_0xc5b6('0x31')],_0x32e062[_0xc5b6('0x33')]);_0x284521['attributes']=_[_0xc5b6('0x35')](_0x32e062[_0xc5b6('0x31')],qs[_0xc5b6('0x37')](_0xc2f9eb[_0xc5b6('0x33')][_0xc5b6('0x37')]));_0x284521[_0xc5b6('0x36')]=_0x284521['attributes'][_0xc5b6('0x38')]?_0x284521[_0xc5b6('0x36')]:_0x32e062[_0xc5b6('0x31')];_0x284521[_0xc5b6('0x55')]=qs[_0xc5b6('0x3b')](_0xc2f9eb[_0xc5b6('0x33')][_0xc5b6('0x3b')]);_0x284521[_0xc5b6('0x3c')]=qs['filters'](_[_0xc5b6('0x3d')](_0xc2f9eb[_0xc5b6('0x33')],_0x32e062[_0xc5b6('0x34')]));if(_0xc2f9eb[_0xc5b6('0x33')][_0xc5b6('0x3e')]){_0x284521[_0xc5b6('0x3c')]=_['merge'](_0x284521[_0xc5b6('0x3c')],{'$or':_[_0xc5b6('0x2d')](_0x284521[_0xc5b6('0x36')],function(_0x44696d){var _0x47b404={};_0x47b404[_0x44696d]={'$like':'%'+_0xc2f9eb[_0xc5b6('0x33')]['filter']+'%'};return _0x47b404;})});}_0x284521=_[_0xc5b6('0x3f')]({},_0x284521,_0xc2f9eb[_0xc5b6('0x41')]);return _0xc56d86[_0xc5b6('0x56')](_0x284521);}})[_0xc5b6('0x28')](function(_0x17e899){if(_0x17e899){_0x4d9261=_0x17e899[_0xc5b6('0x38')];if(!_0xc2f9eb[_0xc5b6('0x33')][_0xc5b6('0x39')](_0xc5b6('0x3a'))){_0x284521[_0xc5b6('0x21')]=qs[_0xc5b6('0x21')](_0xc2f9eb['query']['limit']);_0x284521['offset']=qs[_0xc5b6('0x20')](_0xc2f9eb[_0xc5b6('0x33')][_0xc5b6('0x20')]);}return _0xc56d86['getMembers'](_0x284521);}})[_0xc5b6('0x28')](function(_0x5b44d6){if(_0x5b44d6){return _0x5b44d6?{'count':_0x4d9261,'rows':_0x5b44d6}:null;}})[_0xc5b6('0x28')](respondWithResult(_0x13b829,null))[_0xc5b6('0x46')](handleError(_0x13b829,null));};exports[_0xc5b6('0x57')]=function(_0x2d613f,_0x1e97e7,_0x458927){return db['ChatGroup'][_0xc5b6('0x4a')]({'where':{'id':_0x2d613f[_0xc5b6('0x48')]['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0x1e97e7,null))['then'](function(_0x2b252b){if(_0x2b252b){return _0x2b252b[_0xc5b6('0x57')](_0x2d613f['query'][_0xc5b6('0x53')]);}})[_0xc5b6('0x28')](respondWithStatusCode(_0x1e97e7,null))[_0xc5b6('0x46')](handleError(_0x1e97e7,null));};exports[_0xc5b6('0x58')]=function(_0x5fe27b,_0xa156ad,_0x1bce1b){if(_0x5fe27b['body']['id']){delete _0x5fe27b[_0xc5b6('0x4c')]['id'];}return db[_0xc5b6('0x2e')][_0xc5b6('0x4a')]({'where':{'id':_0x5fe27b[_0xc5b6('0x48')]['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0xa156ad,null))[_0xc5b6('0x28')](function(_0x4324a6){if(_0x4324a6){_0x5fe27b['body'][_0xc5b6('0x59')]=_0x4324a6['id'];return db[_0xc5b6('0x4f')][_0xc5b6('0x4b')](_0x5fe27b[_0xc5b6('0x4c')]);}})['then'](respondWithResult(_0xa156ad,null))[_0xc5b6('0x46')](handleError(_0xa156ad,null));};exports[_0xc5b6('0x5a')]=function(_0x57db29,_0x559ffd,_0x259398){var _0x5e7166={};var _0x2fe4bb={};var _0x28f370;var _0x24bde5;return db[_0xc5b6('0x2e')][_0xc5b6('0x54')]({'where':{'id':_0x57db29['params']['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0x559ffd,null))[_0xc5b6('0x28')](function(_0x2e2821){if(_0x2e2821){_0x28f370=_0x2e2821;_0x2fe4bb['model']=_[_0xc5b6('0x32')](db[_0xc5b6('0x4f')][_0xc5b6('0x49')]);_0x2fe4bb[_0xc5b6('0x33')]=_[_0xc5b6('0x32')](_0x57db29['query']);_0x2fe4bb[_0xc5b6('0x34')]=_[_0xc5b6('0x35')](_0x2fe4bb[_0xc5b6('0x31')],_0x2fe4bb[_0xc5b6('0x33')]);_0x5e7166['attributes']=_[_0xc5b6('0x35')](_0x2fe4bb['model'],qs[_0xc5b6('0x37')](_0x57db29[_0xc5b6('0x33')][_0xc5b6('0x37')]));_0x5e7166[_0xc5b6('0x36')]=_0x5e7166['attributes'][_0xc5b6('0x38')]?_0x5e7166[_0xc5b6('0x36')]:_0x2fe4bb[_0xc5b6('0x31')];_0x5e7166[_0xc5b6('0x55')]=qs[_0xc5b6('0x3b')](_0x57db29[_0xc5b6('0x33')]['sort']);_0x5e7166['where']=qs['filters'](_[_0xc5b6('0x3d')](_0x57db29['query'],_0x2fe4bb['filters']));if(_0x57db29[_0xc5b6('0x33')][_0xc5b6('0x3e')]){_0x5e7166[_0xc5b6('0x3c')]=_[_0xc5b6('0x3f')](_0x5e7166[_0xc5b6('0x3c')],{'$or':_['map'](_0x5e7166[_0xc5b6('0x36')],function(_0x71cf6e){var _0x39c4fd={};_0x39c4fd[_0x71cf6e]={'$like':'%'+_0x57db29['query'][_0xc5b6('0x3e')]+'%'};return _0x39c4fd;})});}if(_0x57db29[_0xc5b6('0x33')]['$gte']){var _0x1c9374=_0x57db29[_0xc5b6('0x33')][_0xc5b6('0x5b')]['split'](',');var _0xac4a2b={};_0xac4a2b[_0x1c9374[0x0]]={'$gte':moment(_0x1c9374[0x1])[_0xc5b6('0x5c')](_0xc5b6('0x5d'))};_0x5e7166[_0xc5b6('0x3c')]=_['merge'](_0x5e7166[_0xc5b6('0x3c')],_0xac4a2b);}_0x5e7166=_[_0xc5b6('0x3f')]({},_0x5e7166,_0x57db29['options']);return _0x28f370[_0xc5b6('0x5a')](_0x5e7166);}})[_0xc5b6('0x28')](function(_0x578a50){if(_0x578a50){_0x24bde5=_0x578a50[_0xc5b6('0x38')];if(!_0x57db29[_0xc5b6('0x33')][_0xc5b6('0x39')](_0xc5b6('0x3a'))){_0x5e7166[_0xc5b6('0x21')]=qs[_0xc5b6('0x21')](_0x57db29[_0xc5b6('0x33')][_0xc5b6('0x21')]);_0x5e7166[_0xc5b6('0x20')]=qs[_0xc5b6('0x20')](_0x57db29[_0xc5b6('0x33')][_0xc5b6('0x20')]);}return _0x28f370[_0xc5b6('0x5a')](_0x5e7166);}})['then'](function(_0x22376a){if(_0x22376a){return _0x22376a?{'count':_0x24bde5,'rows':_0x22376a}:null;}})[_0xc5b6('0x28')](respondWithResult(_0x559ffd,null))['catch'](handleError(_0x559ffd,null));};
\ No newline at end of file
index c16e413..706b89b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb486=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x4d7a70,_0x2d3bfa){var _0x3aafbb=function(_0x43fbf2){while(--_0x43fbf2){_0x4d7a70['push'](_0x4d7a70['shift']());}};_0x3aafbb(++_0x2d3bfa);}(_0xb486,0x138));var _0x6b48=function(_0x219b60,_0xde6b4b){_0x219b60=_0x219b60-0x0;var _0x495da4=_0xb486[_0x219b60];return _0x495da4;};'use strict';var EventEmitter=require(_0x6b48('0x0'));var ChatGroup=require(_0x6b48('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x6b48('0x2')](0x0);var events={'afterCreate':_0x6b48('0x3'),'afterUpdate':_0x6b48('0x4'),'afterDestroy':_0x6b48('0x5')};function emitEvent(_0x385959){return function(_0x3884f3,_0x3e4c13,_0x3a8371){ChatGroupEvents[_0x6b48('0x6')](_0x385959+':'+_0x3884f3['id'],_0x3884f3);ChatGroupEvents[_0x6b48('0x6')](_0x385959,_0x3884f3);_0x3a8371(null);};}for(var e in events){if(events[_0x6b48('0x7')](e)){var event=events[e];ChatGroup[_0x6b48('0x8')](e,emitEvent(event));}}module[_0x6b48('0x9')]=ChatGroupEvents;
\ No newline at end of file
+var _0xee2c=['update','emit','hasOwnProperty','hook','exports','events','ChatGroup','setMaxListeners','save'];(function(_0x43232a,_0xfda881){var _0x48db5f=function(_0x203b22){while(--_0x203b22){_0x43232a['push'](_0x43232a['shift']());}};_0x48db5f(++_0xfda881);}(_0xee2c,0x1c7));var _0xcee2=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xee2c[_0x3e5086];return _0xfeb102;};'use strict';var EventEmitter=require(_0xcee2('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xcee2('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xcee2('0x2')](0x0);var events={'afterCreate':_0xcee2('0x3'),'afterUpdate':_0xcee2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x589e9d){return function(_0xc9b213,_0xb70cd1,_0x49d04d){ChatGroupEvents[_0xcee2('0x5')](_0x589e9d+':'+_0xc9b213['id'],_0xc9b213);ChatGroupEvents[_0xcee2('0x5')](_0x589e9d,_0xc9b213);_0x49d04d(null);};}for(var e in events){if(events[_0xcee2('0x6')](e)){var event=events[e];ChatGroup[_0xcee2('0x7')](e,emitEvent(event));}}module[_0xcee2('0x8')]=ChatGroupEvents;
\ No newline at end of file
index 51aa941..08b9e17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9062=['moment','bluebird','request-promise','path','../../config/environment','exports','define','chat_groups','util','../../config/logger','api'];(function(_0x424365,_0x5750d1){var _0x51119d=function(_0x4b54ab){while(--_0x4b54ab){_0x424365['push'](_0x424365['shift']());}};_0x51119d(++_0x5750d1);}(_0x9062,0xad));var _0x2906=function(_0x204a63,_0x4dc00a){_0x204a63=_0x204a63-0x0;var _0x389f09=_0x9062[_0x204a63];return _0x389f09;};'use strict';var _=require('lodash');var util=require(_0x2906('0x0'));var logger=require(_0x2906('0x1'))(_0x2906('0x2'));var moment=require(_0x2906('0x3'));var BPromise=require(_0x2906('0x4'));var rp=require(_0x2906('0x5'));var fs=require('fs');var path=require(_0x2906('0x6'));var rimraf=require('rimraf');var config=require(_0x2906('0x7'));var attributes=require('./chatGroup.attributes');module[_0x2906('0x8')]=function(_0x15af70,_0x5b1f19){return _0x15af70[_0x2906('0x9')]('ChatGroup',attributes,{'tableName':_0x2906('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0384=['moment','bluebird','request-promise','path','rimraf','./chatGroup.attributes','exports','define','ChatGroup','lodash','util','../../config/logger','api'];(function(_0x30ab4d,_0x1324db){var _0x41eac2=function(_0x2f7d58){while(--_0x2f7d58){_0x30ab4d['push'](_0x30ab4d['shift']());}};_0x41eac2(++_0x1324db);}(_0x0384,0x11a));var _0x4038=function(_0x2dea0d,_0x553e6f){_0x2dea0d=_0x2dea0d-0x0;var _0x779e6e=_0x0384[_0x2dea0d];return _0x779e6e;};'use strict';var _=require(_0x4038('0x0'));var util=require(_0x4038('0x1'));var logger=require(_0x4038('0x2'))(_0x4038('0x3'));var moment=require(_0x4038('0x4'));var BPromise=require(_0x4038('0x5'));var rp=require(_0x4038('0x6'));var fs=require('fs');var path=require(_0x4038('0x7'));var rimraf=require(_0x4038('0x8'));var config=require('../../config/environment');var attributes=require(_0x4038('0x9'));module[_0x4038('0xa')]=function(_0x4077e4,_0x40c601){return _0x4077e4[_0x4038('0xb')](_0x4038('0xc'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index fa3ebd2..b97e6fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef89=['code','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error'];(function(_0x4974f1,_0x2ec84f){var _0x190b73=function(_0x16e562){while(--_0x16e562){_0x4974f1['push'](_0x4974f1['shift']());}};_0x190b73(++_0x2ec84f);}(_0xef89,0xf6));var _0x9ef8=function(_0x588480,_0x39b0b5){_0x588480=_0x588480-0x0;var _0x68ae0d=_0xef89[_0x588480];return _0x68ae0d;};'use strict';var _=require(_0x9ef8('0x0'));var util=require(_0x9ef8('0x1'));var moment=require(_0x9ef8('0x2'));var BPromise=require(_0x9ef8('0x3'));var rs=require(_0x9ef8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ef8('0x5'))['db'];var utils=require(_0x9ef8('0x6'));var logger=require(_0x9ef8('0x7'))(_0x9ef8('0x8'));var config=require(_0x9ef8('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9ef8('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x9ef8('0xb')],{'host':_0x9ef8('0xc'),'port':0x18eb});var socket=require(_0x9ef8('0xd'))(new Redis(config[_0x9ef8('0xb')]));require(_0x9ef8('0xe'))[_0x9ef8('0xf')](socket);function respondWithRpcPromise(_0x3c13e7,_0x4fc3b1,_0x6ccc67){return new BPromise(function(_0x49dc9c,_0x556c62){return client[_0x9ef8('0x10')](_0x3c13e7,_0x6ccc67)[_0x9ef8('0x11')](function(_0x5269f9){logger[_0x9ef8('0x12')](_0x9ef8('0x13'),_0x4fc3b1,_0x9ef8('0x14'));logger[_0x9ef8('0x15')](_0x9ef8('0x16'),_0x4fc3b1,_0x9ef8('0x14'),JSON['stringify'](_0x5269f9));if(_0x5269f9['error']){if(_0x5269f9[_0x9ef8('0x17')][_0x9ef8('0x18')]===0x1f4){logger[_0x9ef8('0x17')](_0x9ef8('0x13'),_0x4fc3b1,_0x5269f9[_0x9ef8('0x17')][_0x9ef8('0x19')]);return _0x556c62(_0x5269f9[_0x9ef8('0x17')][_0x9ef8('0x19')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x4fc3b1,_0x5269f9[_0x9ef8('0x17')][_0x9ef8('0x19')]);return _0x49dc9c(_0x5269f9[_0x9ef8('0x17')]['message']);}else{logger[_0x9ef8('0x12')](_0x9ef8('0x13'),_0x4fc3b1,_0x9ef8('0x14'));_0x49dc9c(_0x5269f9['result']['message']);}})[_0x9ef8('0x1a')](function(_0xd01fd9){logger[_0x9ef8('0x17')](_0x9ef8('0x13'),_0x4fc3b1,_0xd01fd9);_0x556c62(_0xd01fd9);});});}
\ No newline at end of file
+var _0x1de4=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatGroup.socket','register','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s'];(function(_0xc8db6b,_0x320abd){var _0x12cb81=function(_0x417540){while(--_0x417540){_0xc8db6b['push'](_0xc8db6b['shift']());}};_0x12cb81(++_0x320abd);}(_0x1de4,0x94));var _0x41de=function(_0x51cb36,_0x4db5dc){_0x51cb36=_0x51cb36-0x0;var _0x50c6af=_0x1de4[_0x51cb36];return _0x50c6af;};'use strict';var _=require(_0x41de('0x0'));var util=require(_0x41de('0x1'));var moment=require(_0x41de('0x2'));var BPromise=require(_0x41de('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x41de('0x4'));var db=require(_0x41de('0x5'))['db'];var utils=require(_0x41de('0x6'));var logger=require('../../config/logger')(_0x41de('0x7'));var config=require(_0x41de('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x41de('0x9')][_0x41de('0xa')]({'port':0x232a});config[_0x41de('0xb')]=_[_0x41de('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x41de('0xd'))(new Redis(config[_0x41de('0xb')]));require(_0x41de('0xe'))[_0x41de('0xf')](socket);function respondWithRpcPromise(_0x1259ce,_0xac4f6c,_0x5c2eb6){return new BPromise(function(_0x3a923d,_0x415af3){return client[_0x41de('0x10')](_0x1259ce,_0x5c2eb6)[_0x41de('0x11')](function(_0x41e515){logger[_0x41de('0x12')]('ChatGroup,\x20%s,\x20%s',_0xac4f6c,_0x41de('0x13'));logger[_0x41de('0x14')](_0x41de('0x15'),_0xac4f6c,'request\x20sent',JSON[_0x41de('0x16')](_0x41e515));if(_0x41e515[_0x41de('0x17')]){if(_0x41e515['error'][_0x41de('0x18')]===0x1f4){logger[_0x41de('0x17')](_0x41de('0x19'),_0xac4f6c,_0x41e515[_0x41de('0x17')][_0x41de('0x1a')]);return _0x415af3(_0x41e515[_0x41de('0x17')][_0x41de('0x1a')]);}logger[_0x41de('0x17')](_0x41de('0x19'),_0xac4f6c,_0x41e515[_0x41de('0x17')][_0x41de('0x1a')]);return _0x3a923d(_0x41e515['error'][_0x41de('0x1a')]);}else{logger[_0x41de('0x12')]('ChatGroup,\x20%s,\x20%s',_0xac4f6c,_0x41de('0x13'));_0x3a923d(_0x41e515[_0x41de('0x1b')][_0x41de('0x1a')]);}})[_0x41de('0x1c')](function(_0x1a7b6f){logger['error']('ChatGroup,\x20%s,\x20%s',_0xac4f6c,_0x1a7b6f);_0x415af3(_0x1a7b6f);});});}
\ No newline at end of file
index 93c5ef3..3e19e1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84a5=['update','emit','removeListener','length','./chatGroup.events','save','remove'];(function(_0x4c6fa0,_0x15d3b7){var _0x318edc=function(_0x16c299){while(--_0x16c299){_0x4c6fa0['push'](_0x4c6fa0['shift']());}};_0x318edc(++_0x15d3b7);}(_0x84a5,0x15b));var _0x584a=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x84a5[_0x2dadb9];return _0x2f0097;};'use strict';var ChatGroupEvents=require(_0x584a('0x0'));var events=[_0x584a('0x1'),_0x584a('0x2'),_0x584a('0x3')];function createListener(_0x1f6c07,_0x257ee7){return function(_0x917934){_0x257ee7[_0x584a('0x4')](_0x1f6c07,_0x917934);};}function removeListener(_0x4ced06,_0x14e677){return function(){ChatGroupEvents[_0x584a('0x5')](_0x4ced06,_0x14e677);};}exports['register']=function(_0xe39248){for(var _0x22205a=0x0,_0x4c7618=events[_0x584a('0x6')];_0x22205a<_0x4c7618;_0x22205a++){var _0x4b6e55=events[_0x22205a];var _0x41a1ff=createListener('chatGroup:'+_0x4b6e55,_0xe39248);ChatGroupEvents['on'](_0x4b6e55,_0x41a1ff);}};
\ No newline at end of file
+var _0xffaa=['./chatGroup.events','save','remove','update','emit','removeListener','length','chatGroup:'];(function(_0xa6e9fa,_0x33372a){var _0x44592c=function(_0x53febe){while(--_0x53febe){_0xa6e9fa['push'](_0xa6e9fa['shift']());}};_0x44592c(++_0x33372a);}(_0xffaa,0x1e0));var _0xaffa=function(_0x67f102,_0x2d3bd1){_0x67f102=_0x67f102-0x0;var _0x568b50=_0xffaa[_0x67f102];return _0x568b50;};'use strict';var ChatGroupEvents=require(_0xaffa('0x0'));var events=[_0xaffa('0x1'),_0xaffa('0x2'),_0xaffa('0x3')];function createListener(_0x1ceac5,_0x145359){return function(_0x4935bc){_0x145359[_0xaffa('0x4')](_0x1ceac5,_0x4935bc);};}function removeListener(_0x4c63e5,_0x3819f0){return function(){ChatGroupEvents[_0xaffa('0x5')](_0x4c63e5,_0x3819f0);};}exports['register']=function(_0x4ecc09){for(var _0x4f031d=0x0,_0x21298c=events[_0xaffa('0x6')];_0x4f031d<_0x21298c;_0x4f031d++){var _0x5a6ea6=events[_0x4f031d];var _0x2e37b6=createListener(_0xaffa('0x7')+_0x5a6ea6,_0x4ecc09);ChatGroupEvents['on'](_0x5a6ea6,_0x2e37b6);}};
\ No newline at end of file
index 2c9902c..92d9f86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cc7=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','describe','/:id','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','create','post','addMembers','addMessage','delete','destroy','removeMembers','multer'];(function(_0xbb9dbf,_0x5dafa4){var _0x30223c=function(_0xaa9ca){while(--_0xaa9ca){_0xbb9dbf['push'](_0xbb9dbf['shift']());}};_0x30223c(++_0x5dafa4);}(_0x1cc7,0x1d3));var _0x71cc=function(_0x44bb25,_0x11524d){_0x44bb25=_0x44bb25-0x0;var _0x55a226=_0x1cc7[_0x44bb25];return _0x55a226;};'use strict';var multer=require(_0x71cc('0x0'));var util=require(_0x71cc('0x1'));var path=require(_0x71cc('0x2'));var timeout=require('connect-timeout');var express=require(_0x71cc('0x3'));var router=express[_0x71cc('0x4')]();var fs_extra=require(_0x71cc('0x5'));var auth=require(_0x71cc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x71cc('0x7'));var controller=require(_0x71cc('0x8'));router[_0x71cc('0x9')]('/',auth[_0x71cc('0xa')](),controller[_0x71cc('0xb')]);router[_0x71cc('0x9')]('/describe',auth[_0x71cc('0xa')](),controller[_0x71cc('0xc')]);router[_0x71cc('0x9')](_0x71cc('0xd'),auth[_0x71cc('0xa')](),controller['show']);router[_0x71cc('0x9')](_0x71cc('0xe'),auth[_0x71cc('0xa')](),controller[_0x71cc('0xf')]);router[_0x71cc('0x9')](_0x71cc('0x10'),auth[_0x71cc('0xa')](),controller['getMembers']);router[_0x71cc('0x9')](_0x71cc('0x11'),auth[_0x71cc('0xa')](),controller[_0x71cc('0x12')]);router['post']('/',auth[_0x71cc('0xa')](),controller[_0x71cc('0x13')]);router[_0x71cc('0x14')](_0x71cc('0x10'),auth[_0x71cc('0xa')](),controller[_0x71cc('0x15')]);router[_0x71cc('0x14')]('/:id/messages',auth[_0x71cc('0xa')](),controller[_0x71cc('0x16')]);router['put'](_0x71cc('0xd'),auth[_0x71cc('0xa')](),controller['update']);router[_0x71cc('0x17')](_0x71cc('0xd'),auth[_0x71cc('0xa')](),controller[_0x71cc('0x18')]);router[_0x71cc('0x17')](_0x71cc('0x10'),auth['isAuthenticated'](),controller[_0x71cc('0x19')]);module['exports']=router;
\ No newline at end of file
+var _0x9fda=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','post','addMembers','/:id/messages','addMessage','put','update','destroy','delete','removeMembers','exports','multer'];(function(_0x2b78de,_0x547dd0){var _0x29f987=function(_0x423471){while(--_0x423471){_0x2b78de['push'](_0x2b78de['shift']());}};_0x29f987(++_0x547dd0);}(_0x9fda,0x15f));var _0xa9fd=function(_0x29c4e5,_0x4b0c43){_0x29c4e5=_0x29c4e5-0x0;var _0x108d1f=_0x9fda[_0x29c4e5];return _0x108d1f;};'use strict';var multer=require(_0xa9fd('0x0'));var util=require(_0xa9fd('0x1'));var path=require(_0xa9fd('0x2'));var timeout=require(_0xa9fd('0x3'));var express=require(_0xa9fd('0x4'));var router=express[_0xa9fd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa9fd('0x6'));var interaction=require(_0xa9fd('0x7'));var config=require(_0xa9fd('0x8'));var controller=require(_0xa9fd('0x9'));router[_0xa9fd('0xa')]('/',auth[_0xa9fd('0xb')](),controller[_0xa9fd('0xc')]);router[_0xa9fd('0xa')](_0xa9fd('0xd'),auth[_0xa9fd('0xb')](),controller[_0xa9fd('0xe')]);router[_0xa9fd('0xa')](_0xa9fd('0xf'),auth['isAuthenticated'](),controller[_0xa9fd('0x10')]);router['get'](_0xa9fd('0x11'),auth[_0xa9fd('0xb')](),controller[_0xa9fd('0x12')]);router[_0xa9fd('0xa')](_0xa9fd('0x13'),auth['isAuthenticated'](),controller[_0xa9fd('0x14')]);router[_0xa9fd('0xa')]('/:id/messages',auth[_0xa9fd('0xb')](),controller[_0xa9fd('0x15')]);router[_0xa9fd('0x16')]('/',auth[_0xa9fd('0xb')](),controller['create']);router[_0xa9fd('0x16')]('/:id/members',auth['isAuthenticated'](),controller[_0xa9fd('0x17')]);router[_0xa9fd('0x16')](_0xa9fd('0x18'),auth['isAuthenticated'](),controller[_0xa9fd('0x19')]);router[_0xa9fd('0x1a')](_0xa9fd('0xf'),auth[_0xa9fd('0xb')](),controller[_0xa9fd('0x1b')]);router['delete'](_0xa9fd('0xf'),auth[_0xa9fd('0xb')](),controller[_0xa9fd('0x1c')]);router[_0xa9fd('0x1d')](_0xa9fd('0x13'),auth['isAuthenticated'](),controller[_0xa9fd('0x1e')]);module[_0xa9fd('0x1f')]=router;
\ No newline at end of file
index da0fed3..7ff7209 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac4a=['exports','BOOLEAN','INTEGER','ENUM','star','TEXT','STRING','long','DATE','sequelize'];(function(_0x3d9afb,_0x549bf2){var _0x4b5c8a=function(_0x84d231){while(--_0x84d231){_0x3d9afb['push'](_0x3d9afb['shift']());}};_0x4b5c8a(++_0x549bf2);}(_0xac4a,0x13f));var _0xaac4=function(_0x25f17b,_0x2fbffc){_0x25f17b=_0x25f17b-0x0;var _0xc345d=_0xac4a[_0x25f17b];return _0xc345d;};'use strict';var Sequelize=require(_0xaac4('0x0'));module[_0xaac4('0x1')]={'closed':{'type':Sequelize[_0xaac4('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xaac4('0x3')]},'ratingType':{'type':Sequelize[_0xaac4('0x4')](_0xaac4('0x5'),'thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xaac4('0x6')]},'pathTranscript':{'type':Sequelize[_0xaac4('0x6')]},'mailTranscript':{'type':Sequelize[_0xaac4('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xaac4('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0xaac4('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0xaac4('0x7')]},'browserVersion':{'type':Sequelize[_0xaac4('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xaac4('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xaac4('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xaac4('0x6')](_0xaac4('0x8'))},'read1stAt':{'type':Sequelize[_0xaac4('0x9')]},'lastMsgAt':{'type':Sequelize[_0xaac4('0x9')]},'lastMsgDirection':{'type':Sequelize[_0xaac4('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xaac4('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xaac4('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xaac4('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x3c81=['INTEGER','ENUM','TEXT','STRING','DATE','long','out','BOOLEAN','sequelize','exports'];(function(_0x1b6bc3,_0xc728b7){var _0x1e0121=function(_0x4925ae){while(--_0x4925ae){_0x1b6bc3['push'](_0x1b6bc3['shift']());}};_0x1e0121(++_0xc728b7);}(_0x3c81,0x102));var _0x13c8=function(_0x585c26,_0xb238c){_0x585c26=_0x585c26-0x0;var _0x3226cd=_0x3c81[_0x585c26];return _0x3226cd;};'use strict';var Sequelize=require(_0x13c8('0x0'));module[_0x13c8('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x13c8('0x2')]},'ratingType':{'type':Sequelize[_0x13c8('0x3')]('star','thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x13c8('0x4')]},'mailTranscript':{'type':Sequelize[_0x13c8('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x13c8('0x6')]},'disposition':{'type':Sequelize[_0x13c8('0x5')]},'secondDisposition':{'type':Sequelize[_0x13c8('0x5')]},'thirdDisposition':{'type':Sequelize[_0x13c8('0x5')]},'note':{'type':Sequelize[_0x13c8('0x5')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x13c8('0x5')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x13c8('0x5')]},'deviceModel':{'type':Sequelize[_0x13c8('0x5')]},'deviceVendor':{'type':Sequelize[_0x13c8('0x5')]},'deviceType':{'type':Sequelize[_0x13c8('0x5')]},'referer':{'type':Sequelize[_0x13c8('0x4')]},'customerIp':{'type':Sequelize[_0x13c8('0x5')]},'formData':{'type':Sequelize[_0x13c8('0x4')](_0x13c8('0x7'))},'read1stAt':{'type':Sequelize[_0x13c8('0x6')]},'lastMsgAt':{'type':Sequelize[_0x13c8('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x13c8('0x3')]('in',_0x13c8('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x13c8('0x5')]},'customerPort':{'type':Sequelize[_0x13c8('0x5')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x13c8('0x9')],'defaultValue':![]}};
\ No newline at end of file
index 2048d23..d559edb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ffd=['MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','agent','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','keyBy','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.ChatInteractionId\x20IN\x20?','groupBy','params','includeAll','find','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooNote','vidaooApiKey','vidaooEscalation','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','create','updateAttributes','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','abandon','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','getMessages','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','secret','include','includeAgent','push','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','CmContact','firstName','attachments','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','lastName','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','stack','name','render','merge','body','contact','account','Users','fullname','Tags','TagIds','split','forEach','index','ChatInteraction','rawAttributes','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','select','field','color','from','left_join','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','parseSearch','search','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','map','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','compact','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x238d89,_0x35530b){_0x238d89=_0x238d89-0x0;var _0x55e6e9=_0x9ffd[_0x238d89];return _0x55e6e9;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x3'));var moment=require(_0xd9ff('0x4'));var BPromise=require(_0xd9ff('0x5'));var Mustache=require(_0xd9ff('0x6'));var util=require('util');var path=require(_0xd9ff('0x7'));var sox=require(_0xd9ff('0x8'));var csv=require('to-csv');var ejs=require(_0xd9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xa'));var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x10'));var querystring=require(_0xd9ff('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x12'));var pdf=require(_0xd9ff('0x13'));var hardwareService=require(_0xd9ff('0x14'));var logger=require(_0xd9ff('0x15'))(_0xd9ff('0x16'));var utils=require(_0xd9ff('0x17'));var config=require(_0xd9ff('0x18'));var licenseUtil=require(_0xd9ff('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd9ff('0x1a')](config[_0xd9ff('0x1b')],{'host':_0xd9ff('0x1c'),'port':0x18eb});var socket=require(_0xd9ff('0x1d'))(new Redis(config[_0xd9ff('0x1b')]));require('./chatInteraction.socket')[_0xd9ff('0x1e')](socket);var jayson=require(_0xd9ff('0x1f'));var client=jayson['client'][_0xd9ff('0x20')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x547e28,_0x4c5718,_0x271287,_0x4f9d6d){return new BPromise(function(_0x35679e,_0xa30fd2){var _0x39c6ce=_0x4f9d6d||client;return _0x39c6ce[_0xd9ff('0x21')](_0x547e28,_0x271287)[_0xd9ff('0x22')](function(_0x2d4df1){logger[_0xd9ff('0x23')](_0xd9ff('0x24'),_0x4c5718,_0xd9ff('0x25'));logger[_0xd9ff('0x26')](_0xd9ff('0x27'),_0x4c5718,_0xd9ff('0x25'),JSON[_0xd9ff('0x28')](_0x2d4df1));if(_0x2d4df1['error']){if(_0x2d4df1['error'][_0xd9ff('0x29')]===0x1f4){logger[_0xd9ff('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,_0x2d4df1['error']['message']);return _0xa30fd2(_0x2d4df1['error'][_0xd9ff('0x2b')]);}logger['error'](_0xd9ff('0x24'),_0x4c5718,_0x2d4df1[_0xd9ff('0x2a')][_0xd9ff('0x2b')]);return _0x35679e(_0x2d4df1[_0xd9ff('0x2a')][_0xd9ff('0x2b')]);}else{logger[_0xd9ff('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,'request\x20sent');_0x35679e(_0x2d4df1[_0xd9ff('0x2c')]['message']);}})[_0xd9ff('0x2d')](function(_0x4d86fe){logger[_0xd9ff('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,_0x4d86fe);_0xa30fd2(_0x4d86fe);});});}function respondWithStatusCode(_0x10cbdd,_0x159e56){_0x159e56=_0x159e56||0xcc;return function(_0x2138b4){if(_0x2138b4){return _0x10cbdd[_0xd9ff('0x2e')](_0x159e56);}return _0x10cbdd['status'](_0x159e56)[_0xd9ff('0x2f')]();};}function respondWithResult(_0xe11f88,_0x1c78c4){_0x1c78c4=_0x1c78c4||0xc8;return function(_0x4390f7){if(_0x4390f7){return _0xe11f88['status'](_0x1c78c4)[_0xd9ff('0x30')](_0x4390f7);}};}function respondWithFilteredResult(_0x3792d9,_0x44b5a7){return function(_0x45fb63){if(_0x45fb63){var _0x263d3a=typeof _0x44b5a7[_0xd9ff('0x31')]===_0xd9ff('0x32')&&typeof _0x44b5a7[_0xd9ff('0x33')]===_0xd9ff('0x32');var _0x5706cf=_0x45fb63[_0xd9ff('0x34')];var _0x4ba2be=_0x263d3a?0x0:_0x44b5a7[_0xd9ff('0x31')];var _0x29c532=_0x263d3a?_0x45fb63[_0xd9ff('0x34')]:_0x44b5a7['offset']+_0x44b5a7[_0xd9ff('0x33')];var _0x3b26da;if(_0x29c532>=_0x5706cf){_0x29c532=_0x5706cf;_0x3b26da=0xc8;}else{_0x3b26da=0xce;}_0x3792d9[_0xd9ff('0x35')](_0x3b26da);return _0x3792d9[_0xd9ff('0x36')]('Content-Range',_0x4ba2be+'-'+_0x29c532+'/'+_0x5706cf)[_0xd9ff('0x30')](_0x45fb63);}return null;};}function patchUpdates(_0x5743de){return function(_0x18c28b){try{jsonpatch[_0xd9ff('0x37')](_0x18c28b,_0x5743de,!![]);}catch(_0x323cb5){return BPromise[_0xd9ff('0x38')](_0x323cb5);}return _0x18c28b[_0xd9ff('0x39')]();};}function saveUpdates(_0xdf3947,_0x2cc2ae){return function(_0x281c7b){if(_0x281c7b){return _0x281c7b[_0xd9ff('0x3a')](_0xdf3947)[_0xd9ff('0x22')](function(_0x4813a5){return _0x4813a5;});}return null;};}function removeEntity(_0x34e9a9,_0x4670e4){return function(_0x66f4d){if(_0x66f4d){return _0x66f4d['destroy']()[_0xd9ff('0x22')](function(){_0x34e9a9[_0xd9ff('0x35')](0xcc)[_0xd9ff('0x2f')]();});}};}function handleEntityNotFound(_0x4ab10f,_0x3d449d){return function(_0x5e3ff9){if(!_0x5e3ff9){_0x4ab10f[_0xd9ff('0x2e')](0x194);}return _0x5e3ff9;};}function handleError(_0x4ae56b,_0x20a021){_0x20a021=_0x20a021||0x1f4;return function(_0x5db498){logger[_0xd9ff('0x2a')](_0x5db498[_0xd9ff('0x3b')]);if(_0x5db498[_0xd9ff('0x3c')]){delete _0x5db498['name'];}_0x4ae56b['status'](_0x20a021)['send'](_0x5db498);};}function getMustacheRender(_0x7ac3d1,_0x30fc5b){return Mustache[_0xd9ff('0x3d')](_0x7ac3d1,_[_0xd9ff('0x3e')](_0x30fc5b[_0xd9ff('0x3f')],{'contact':_0x30fc5b[_0xd9ff('0x40')],'message':_0x30fc5b['message'],'agent':_0x30fc5b['agent'],'interaction':_0x30fc5b['interaction'],'account':_0x30fc5b[_0xd9ff('0x41')]}))||'';}function getInteractionUsers(_0x252edc,_0x918c9a){return new BPromise(function(_0x32adae,_0x56b94d){try{if(_0x918c9a[_0x252edc['id']]){_0x252edc[_0xd9ff('0x42')]=_['map'](_0x918c9a[_0x252edc['id']],function(_0x3cff52){return{'id':_0x3cff52['id'],'fullname':_0x3cff52[_0xd9ff('0x43')]};});}}catch(_0x1bedaf){_0x56b94d(_0x1bedaf);}_0x32adae(_0x252edc);});}function getInteractionTags(_0x169dc7,_0x59fc07){return new BPromise(function(_0x1e34da,_0x2d4d97){try{if(_0x169dc7['TagIds']){_0x169dc7[_0xd9ff('0x44')]=[];_0x169dc7[_0xd9ff('0x45')][_0xd9ff('0x46')](',')[_0xd9ff('0x47')](function(_0x1fe44d){_0x169dc7[_0xd9ff('0x44')]['push'](_0x59fc07[_0x1fe44d]);});}delete _0x169dc7[_0xd9ff('0x45')];}catch(_0x116f28){_0x2d4d97(_0x116f28);}_0x1e34da(_0x169dc7);});}function updateChatInteraction(_0x10533a,_0x39fbbb,_0x472724){return new BPromise(function(_0x52aab8,_0x3178cd){return getInteractionUsers(_0x10533a,_0x472724)[_0xd9ff('0x22')](function(_0xe0bc49){return getInteractionTags(_0xe0bc49,_0x39fbbb);})['then'](function(_0x5d06dd){_0x52aab8(_0x5d06dd);})[_0xd9ff('0x2d')](function(_0x7eb1a){_0x3178cd(_0x7eb1a);});});}exports[_0xd9ff('0x48')]=function(_0x2dfb8f,_0x437561){var _0x30c69d={},_0x564ef4={},_0xd64585={'count':0x0,'rows':[]};var _0x2d3013=_['map'](db[_0xd9ff('0x49')][_0xd9ff('0x4a')],function(_0x13a1ec){return{'name':_0x13a1ec[_0xd9ff('0x4b')],'type':_0x13a1ec[_0xd9ff('0x4c')]['key']};});_0x564ef4['model']=_['map'](_0x2d3013,_0xd9ff('0x3c'));_0x564ef4['query']=_[_0xd9ff('0x4d')](_0x2dfb8f[_0xd9ff('0x4e')]);_0x564ef4[_0xd9ff('0x4f')]=_['intersection'](_0x564ef4[_0xd9ff('0x50')],_0x564ef4[_0xd9ff('0x4e')]);_0x30c69d['attributes']=_[_0xd9ff('0x51')](_0x564ef4[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0x2dfb8f[_0xd9ff('0x4e')]['fields']));_0x30c69d[_0xd9ff('0x53')]=_0x30c69d['attributes'][_0xd9ff('0x54')]?_0x30c69d['attributes']:_0x564ef4[_0xd9ff('0x50')];if(!_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x30c69d[_0xd9ff('0x33')]=qs['limit'](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x33')]);_0x30c69d[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0x2dfb8f['query']['offset']);}_0x30c69d['order']=qs[_0xd9ff('0x57')](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x57')]);_0x30c69d['where']=qs[_0xd9ff('0x4f')](_[_0xd9ff('0x58')](_0x2dfb8f[_0xd9ff('0x4e')],_0x564ef4[_0xd9ff('0x4f')]),_0x2d3013);var _0xfede73=[];var _0x40d391=squel[_0xd9ff('0x59')]()[_0xd9ff('0x5a')]('id')[_0xd9ff('0x5a')](_0xd9ff('0x3c'))[_0xd9ff('0x5a')](_0xd9ff('0x5b'))[_0xd9ff('0x5c')]('tools_tags');var _0x3ed112=squel['select']()[_0xd9ff('0x5a')]('u.id')[_0xd9ff('0x5a')]('u.fullname')[_0xd9ff('0x5a')]('ui.ChatInteractionId')[_0xd9ff('0x5c')]('user_has_chat_interactions','ui')[_0xd9ff('0x5d')]('users','u',_0xd9ff('0x5e'));var _0x5da1a8=squel[_0xd9ff('0x59')]()[_0xd9ff('0x5c')](_0xd9ff('0x5f'),'i')[_0xd9ff('0x5d')]('cm_contacts','c',_0xd9ff('0x60'))[_0xd9ff('0x5d')](_0xd9ff('0x61'),'o','o.id\x20=\x20i.UserId')[_0xd9ff('0x5d')](_0xd9ff('0x62'),'a',_0xd9ff('0x63'))[_0xd9ff('0x5d')](_0xd9ff('0x64'),'me','me.ChatInteractionId\x20=\x20i.id')[_0xd9ff('0x5d')](_0xd9ff('0x65'),'it',_0xd9ff('0x66'))[_0xd9ff('0x5d')](_0xd9ff('0x67'),'t',_0xd9ff('0x68'));var _0x458fd4=squel['expr']();var _0x3be850=[];var _0x11251f=squel['expr']();var _0x1c885f;if(_0x2dfb8f[_0xd9ff('0x4e')]['search']){_0x1c885f=as[_0xd9ff('0x69')](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x6a')]);var _0x54ea27=_0x1c885f['sqlOperator'];for(var _0x39473e=0x0;_0x39473e<_0x1c885f['conditions'][_0xd9ff('0x54')];_0x39473e++){var _0x1e4d0c=_0x1c885f[_0xd9ff('0x6b')][_0x39473e];var _0x102aea='i';var _0x53a230=_['find'](_0x2d3013,['name',_0x1e4d0c[_0xd9ff('0x5a')]]);if(!_0x53a230){switch(_0x1e4d0c[_0xd9ff('0x5a')]){case _0xd9ff('0x6c'):if(_0x1e4d0c[_0xd9ff('0x6d')]==0x1){_0x5da1a8[_0xd9ff('0x6e')]('`'+_0x1e4d0c['field']+_0xd9ff('0x6f'));}else{_0x5da1a8['having']('`'+_0x1e4d0c[_0xd9ff('0x5a')]+_0xd9ff('0x70'));}break;case _0xd9ff('0x71'):if(_0x1e4d0c[_0xd9ff('0x72')]===_0xd9ff('0x73')){if(_0x1e4d0c[_0xd9ff('0x6d')][_0xd9ff('0x46')]('\x20')[_0xd9ff('0x54')]>0x1){_0x458fd4[_0x54ea27]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd9ff('0x74')](_0x1e4d0c[_0xd9ff('0x6d')]),null);}else{var _0x4f5338='%'+_0x1e4d0c['value']+'%';_0x458fd4[_0x54ea27](_0xd9ff('0x75'),_0x4f5338,_0x4f5338,_0x4f5338);}}else{_0x53a230=_['find'](_0x2d3013,[_0xd9ff('0x3c'),_0xd9ff('0x76')]);_0x1e4d0c['field']=_0xd9ff('0x76');_0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')]['start'],_0x58c9c2[_0xd9ff('0x6d')]['end']);}break;case'Tag':var _0x3dabb1=_0x1e4d0c[_0xd9ff('0x6d')][_0xd9ff('0x46')](',')[_0xd9ff('0x79')](function(_0x56d822){return Number(_0x56d822);});_0x3dabb1[_0xd9ff('0x47')](function(_0x23b816){_0x11251f['or'](_0xd9ff('0x7a'),'%,'+_0x23b816+',%');});_0x3be850=_[_0xd9ff('0x7b')](_0x3be850,_0x3dabb1);break;case _0xd9ff('0x7c'):if(_0x1e4d0c[_0xd9ff('0x72')]===_0xd9ff('0x73')){_0x458fd4[_0x54ea27](_0xd9ff('0x7d'),'%'+_0x1e4d0c['value']+'%',null);}else{_0x53a230=_['find'](_0x2d3013,['name',_0xd9ff('0x7e')]);_0x1e4d0c[_0xd9ff('0x5a')]='UserId';_0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x7f')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x2f')]);}break;case _0xd9ff('0x3f'):_0x58c9c2=as['buildExpression']('me',null,_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x7f')],_0x58c9c2['value'][_0xd9ff('0x2f')]);break;}}else{var _0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2['value'][_0xd9ff('0x7f')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x2f')]);}}}else{var _0x1cd620=_(_0x2dfb8f['query'])[_0xd9ff('0x4d')]()[_0xd9ff('0x79')](function(_0x1de5c9){return _['some'](_0x2d3013,[_0xd9ff('0x3c'),_0x1de5c9])?_0x1de5c9:undefined;})[_0xd9ff('0x80')]()[_0xd9ff('0x6d')]();if(!_['isEmpty'](_0x1cd620)){_0x1cd620[_0xd9ff('0x47')](function(_0x35926f){if(_0x35926f===_0xd9ff('0x81')){_0x5da1a8[_0xd9ff('0x82')](_0xd9ff('0x83'),[]['concat'](_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]));}else if(_0x35926f===_0xd9ff('0x84')){var _0x59af0a=JSON[_0xd9ff('0x85')](_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f])[_0xd9ff('0x86')];var _0x5d1973=JSON[_0xd9ff('0x85')](_0x2dfb8f['query'][_0x35926f])[_0xd9ff('0x87')];_0x5da1a8['where'](_0xd9ff('0x88'),_0x59af0a,_0x5d1973);}else{if(_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]===_0xd9ff('0x89')){_0x5da1a8[_0xd9ff('0x82')]('i.'+_0x35926f+_0xd9ff('0x8a'));}else{_0x5da1a8[_0xd9ff('0x82')]('i.'+_0x35926f+_0xd9ff('0x8b'),_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]);}}});}if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8c')]){if(_0x2dfb8f['query'][_0xd9ff('0x8c')]==0x1){_0x5da1a8[_0xd9ff('0x6e')](_0xd9ff('0x8d'));}else{_0x5da1a8[_0xd9ff('0x6e')](_0xd9ff('0x8e'));}}if(_0x2dfb8f[_0xd9ff('0x4e')]['tag']){_0x3be850=_['isArray'](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')])?_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')]:new Array(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')]);_0x3be850['forEach'](function(_0x1d34a1){_0x11251f['or'](_0xd9ff('0x7a'),'%,'+_0x1d34a1+',%');});}if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x90')]){var _0x14c89f=_0x2dfb8f[_0xd9ff('0x4e')]['filter'][_0xd9ff('0x91')]('\x5c','\x5c\x5c')[_0xd9ff('0x91')](/'/g,'\x27\x27');if(qs[_0xd9ff('0x92')](_0x14c89f)){_0x458fd4['or'](_0xd9ff('0x93'),_0x14c89f+'%');}else{_0x458fd4['or'](_0xd9ff('0x94'),qs[_0xd9ff('0x74')](_0x14c89f))['or'](_0xd9ff('0x95'),_0x14c89f+'%');}}}_0x5da1a8[_0xd9ff('0x82')](_0x458fd4);_0x5da1a8['group'](_0xd9ff('0x96'));var _0x4c2ad5={'type':db[_0xd9ff('0x97')][_0xd9ff('0x98')][_0xd9ff('0x99')],'raw':!![]};var _0x2d2d1c=_0x5da1a8[_0xd9ff('0x9a')]();_0x2d2d1c[_0xd9ff('0x5a')](_0xd9ff('0x96'));_0x2d2d1c[_0xd9ff('0x5a')](_0xd9ff('0x9b'),_0xd9ff('0x6c'));if(_0x30c69d[_0xd9ff('0x9c')]){_0x30c69d[_0xd9ff('0x9c')][_0xd9ff('0x47')](function(_0x5d29b9){var _0x4413c4=_0x5d29b9[0x0]===_0xd9ff('0x9d')?_0x5d29b9[0x0]:'i.'+_0x5d29b9[0x0];_0x5da1a8[_0xd9ff('0x9c')](_0x4413c4,_0x5d29b9[0x1]===_0xd9ff('0x9e')?![]:!![]);});}if(!_['isEmpty'](_0x3be850)){_0x5da1a8[_0xd9ff('0x6e')](_0x11251f);_0x2d2d1c[_0xd9ff('0x82')]('t.id\x20IN\x20?',_0x3be850);}BPromise[_0xd9ff('0x9f')]()[_0xd9ff('0x22')](function(){if(!_0x1c885f){if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x81')])return;_0x2d2d1c[_0xd9ff('0x82')](_0xd9ff('0xa0'));_0x5da1a8[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x2dfb8f[_0xd9ff('0xa1')]['role']!==_0xd9ff('0xa2'))return;return _0x2dfb8f[_0xd9ff('0xa1')][_0xd9ff('0xa3')]({'attributes':['id'],'raw':!![]})[_0xd9ff('0x22')](function(_0x320adb){if(_[_0xd9ff('0xa4')](_0x320adb)){_0x2d2d1c[_0xd9ff('0x82')](_0xd9ff('0xa5'));_0x5da1a8[_0xd9ff('0x82')](_0xd9ff('0xa5'));}else{_0x2d2d1c[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0xd9ff('0x79')](_0x320adb,'id'));_0x5da1a8[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0xd9ff('0x79')](_0x320adb,'id'));}});})[_0xd9ff('0x22')](function(){if(_0x2dfb8f[_0xd9ff('0xa1')][_0xd9ff('0xa6')]===_0xd9ff('0xa2')&&!_0x1c885f&&!_0x2dfb8f[_0xd9ff('0x4e')]['ChatWebsiteId'])return[];return db['sequelize'][_0xd9ff('0x4e')](_0x2d2d1c['toString'](),_0x4c2ad5);})['then'](function(_0x4a55c1){_0xd64585['count']=_0x4a55c1[_0xd9ff('0x54')];if(_0xd64585[_0xd9ff('0x34')]===0x0)return[];return db[_0xd9ff('0xa7')]['query'](_0x40d391['toString'](),_0x4c2ad5)[_0xd9ff('0x22')](function(_0x5e7f52){_0xfede73=_[_0xd9ff('0xa8')](_0x5e7f52,'id');_0x4c2ad5=_['merge'](_0x4c2ad5,{'model':db[_0xd9ff('0x49')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x52')]){_0x30c69d[_0xd9ff('0x53')][_0xd9ff('0x47')](function(_0x4e6dd2){_0x5da1a8['field']('i.'+_0x4e6dd2);});}else{_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0x9b'),_0xd9ff('0x6c'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xa9'),'Account.key');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xaa'),_0xd9ff('0xab'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xac'),_0xd9ff('0x9d'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xad'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xae'),_0xd9ff('0xaf'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb0'),'Contact.lastName');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb1'),'Contact.email');_0x5da1a8['field'](_0xd9ff('0xb2'),_0xd9ff('0xb3'));_0x5da1a8['field'](_0xd9ff('0xb4'),_0xd9ff('0xb5'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb6'),_0xd9ff('0xb7'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb8'),_0xd9ff('0xb9'));_0x5da1a8['field']('o.internal','Owner.internal');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xba'),_0xd9ff('0x45'));}if(_0x30c69d['limit'])_0x5da1a8[_0xd9ff('0x33')](_0x30c69d[_0xd9ff('0x33')]);if(_0x30c69d[_0xd9ff('0x31')])_0x5da1a8[_0xd9ff('0x31')](_0x30c69d[_0xd9ff('0x31')]);return db[_0xd9ff('0xa7')]['query'](_0x5da1a8[_0xd9ff('0xbb')](),_0x4c2ad5);})['then'](function(_0x5cb3af){if(_0x5cb3af[_0xd9ff('0x54')]>0x0)_0x3ed112[_0xd9ff('0x82')](_0xd9ff('0xbc'),_['map'](_0x5cb3af,'id'));return db[_0xd9ff('0xa7')][_0xd9ff('0x4e')](_0x3ed112['toString'](),_0x4c2ad5)['then'](function(_0x4aa6d5){var _0x11840a=_[_0xd9ff('0xbd')](_0x4aa6d5,'ChatInteractionId');var _0x2871ec=[];_0x5cb3af[_0xd9ff('0x47')](function(_0x16e130){_0x2871ec['push'](updateChatInteraction(_0x16e130,_0xfede73,_0x11840a));});return BPromise['all'](_0x2871ec);});});})['then'](function(_0xdf2e33){_0xd64585['rows']=_0xdf2e33;return _0xd64585;})[_0xd9ff('0x22')](respondWithFilteredResult(_0x437561,_0x30c69d))[_0xd9ff('0x2d')](handleError(_0x437561,null));};exports['show']=function(_0x1b048b,_0x5eeeaf){var _0x3339e5={'raw':![],'where':{'id':_0x1b048b[_0xd9ff('0xbe')]['id']}},_0x1f7d87={};_0x1f7d87['model']=_[_0xd9ff('0x4d')](db['ChatInteraction']['rawAttributes']);_0x1f7d87['query']=_[_0xd9ff('0x4d')](_0x1b048b[_0xd9ff('0x4e')]);_0x1f7d87[_0xd9ff('0x4f')]=_[_0xd9ff('0x51')](_0x1f7d87['model'],_0x1f7d87['query']);_0x3339e5[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x1f7d87[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0x1b048b[_0xd9ff('0x4e')]['fields']));_0x3339e5['attributes']=_0x3339e5[_0xd9ff('0x53')][_0xd9ff('0x54')]?_0x3339e5[_0xd9ff('0x53')]:_0x1f7d87[_0xd9ff('0x50')];if(_0x1b048b[_0xd9ff('0x4e')][_0xd9ff('0xbf')]){_0x3339e5['include']=[{'all':!![]}];}_0x3339e5=_[_0xd9ff('0x3e')]({},_0x3339e5,_0x1b048b['options']);return db['ChatInteraction'][_0xd9ff('0xc0')](_0x3339e5)[_0xd9ff('0x22')](handleEntityNotFound(_0x5eeeaf,null))[_0xd9ff('0x22')](respondWithResult(_0x5eeeaf,null))[_0xd9ff('0x2d')](handleError(_0x5eeeaf,null));};exports['create']=function(_0x4e3fdd,_0x2cf8da){return db['ChatInteraction']['create'](_0x4e3fdd[_0xd9ff('0x3f')],{})['then'](respondWithResult(_0x2cf8da,0xc9))[_0xd9ff('0x2d')](handleError(_0x2cf8da,null));};exports['update']=function(_0x327cd8,_0xd95329){if(_0x327cd8[_0xd9ff('0x3f')]['id']){delete _0x327cd8[_0xd9ff('0x3f')]['id'];}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x327cd8[_0xd9ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0xd95329,null))[_0xd9ff('0x22')](saveUpdates(_0x327cd8['body'],null))['then'](respondWithResult(_0xd95329,null))[_0xd9ff('0x2d')](handleError(_0xd95329,null));};exports[_0xd9ff('0xc1')]=function(_0x499869,_0x3c86ac){return db['ChatInteraction']['find']({'where':{'id':_0x499869[_0xd9ff('0xbe')]['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x3c86ac,null))[_0xd9ff('0x22')](removeEntity(_0x3c86ac,null))[_0xd9ff('0x2d')](handleError(_0x3c86ac,null));};exports[_0xd9ff('0xc2')]=function(_0x11c84f,_0x2d0261){return db[_0xd9ff('0x49')][_0xd9ff('0xc2')]()[_0xd9ff('0x22')](respondWithResult(_0x2d0261,null))[_0xd9ff('0x2d')](handleError(_0x2d0261,null));};exports[_0xd9ff('0xc3')]=function(_0x73cfcf,_0x538f20){var _0x51feff=_0x73cfcf['params']['id'];var _0x30c62c;var _0x50b6b2;var _0x413aef;return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0x51feff}})[_0xd9ff('0x22')](function(_0x54c390){_0x30c62c=_0x54c390;return db[_0xd9ff('0xc5')]['findOne']({'where':{'id':_0x54c390[_0xd9ff('0x81')]},'attributes':['id','vidaooApiKey','vidaooEscalation','vidaooTopic',_0xd9ff('0xc6'),'vidaooMetadata'],'raw':!![]});})[_0xd9ff('0x22')](function(_0x54524c){if(_0x54524c&&_0x54524c[_0xd9ff('0xc7')]&&_0x54524c[_0xd9ff('0xc8')]){_0x50b6b2=_0x54524c;var _0x696e18={'interaction':{'id':_0x51feff},'agent':{'id':_0x73cfcf[_0xd9ff('0xa1')]['id'],'name':_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0x3c')],'fullname':_0x73cfcf['user']['fullname'],'email':_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0xc9')]},'contact':_0x73cfcf[_0xd9ff('0x3f')][_0xd9ff('0x40')],'account':_0x73cfcf[_0xd9ff('0x3f')]['account']};var _0x432854={'rejectUnauthorized':![],'method':_0xd9ff('0xca'),'url':_0xd9ff('0xcb'),'headers':{'X-APIKEY':_0x54524c[_0xd9ff('0xc7')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0xc9')]],'buttons':null,'topic':_0x50b6b2['vidaooTopic'],'note':_[_0xd9ff('0xcc')](_0x50b6b2[_0xd9ff('0xc6')])?null:getMustacheRender(_0x50b6b2[_0xd9ff('0xc6')],_0x696e18),'metadata':null},'redirect':_0xd9ff('0xcd'),'json':!![]};try{if(!_[_0xd9ff('0xcc')](_0x50b6b2[_0xd9ff('0xce')])){var _0x1c8e55=getMustacheRender(_0x50b6b2[_0xd9ff('0xce')],_0x696e18);var _0x29fdb8=JSON[_0xd9ff('0x85')](_0x1c8e55);_0x432854[_0xd9ff('0x3f')][_0xd9ff('0xcf')]=_0x29fdb8;}}catch(_0xfc755a){throw new db[(_0xd9ff('0x97'))][(_0xd9ff('0xd0'))](_0xd9ff('0xd1'));}return rp(_0x432854);}else{throw new db[(_0xd9ff('0x97'))][(_0xd9ff('0xd0'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xd9ff('0x22')](function(_0x282183){_0x413aef=_0x282183;if(_0x413aef['id']){var _0x3aba00={'body':_0x413aef[_0xd9ff('0xd2')],'ChatWebsiteId':_0x50b6b2['id'],'ChatInteractionId':_0x30c62c['id'],'direction':_0xd9ff('0xd3'),'UserId':_0x73cfcf[_0xd9ff('0xa1')]['id']};return db[_0xd9ff('0xd4')][_0xd9ff('0xd5')](_0x3aba00,{});}else{throw new db['Sequelize'][(_0xd9ff('0xd0'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xd9ff('0x22')](function(){return _0x30c62c[_0xd9ff('0xd6')]({'vidaooSessionId':_0x413aef['id']});})[_0xd9ff('0x22')](respondWithResult(_0x538f20,null))[_0xd9ff('0x2d')](handleError(_0x538f20,null));};exports[_0xd9ff('0xd7')]=function(_0x204127,_0xf98666){if(_0x204127['body']['id']){delete _0x204127[_0xd9ff('0x3f')]['id'];}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x204127[_0xd9ff('0xbe')]['id']},'include':[{'model':db['CmContact'],'as':_0xd9ff('0x71')}]})[_0xd9ff('0x22')](handleEntityNotFound(_0xf98666,null))['then'](saveUpdates(_0x204127[_0xd9ff('0x3f')],null))[_0xd9ff('0x22')](respondWithResult(_0xf98666,null))['catch'](handleError(_0xf98666,null));};exports['abandon']=function(_0x5c4138,_0x560ea2,_0x1e6d5a){if(_0x5c4138[_0xd9ff('0x3f')]['id']){delete _0x5c4138[_0xd9ff('0x3f')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x5c4138[_0xd9ff('0xbe')]['id']}})['then'](function(_0x43a941){if(!_0x43a941){logger[_0xd9ff('0x2a')](_0xd9ff('0xd8'),'abandon',0x194,'entity\x20not\x20found');_0x560ea2['sendStatus'](0x194);}else{if(_0x43a941[_0xd9ff('0x7e')]){throw new db[(_0xd9ff('0x97'))]['ValidationError'](_0xd9ff('0xd9'));}}return _0x43a941;})[_0xd9ff('0x22')](function(_0x7efe12){if(_0x7efe12){return _0x7efe12[_0xd9ff('0x3a')]({'closed':_0x5c4138[_0xd9ff('0x3f')][_0xd9ff('0xda')],'disposition':_0x5c4138[_0xd9ff('0x3f')][_0xd9ff('0xdb')]})[_0xd9ff('0x22')](function(_0x3b7aeb){return _0x3b7aeb;});}})[_0xd9ff('0x22')](function(_0x37eb49){return respondWithRpcPromise(_0xd9ff('0xdc'),_0xd9ff('0xdd'),_0x5c4138[_0xd9ff('0x3f')],client9004);})[_0xd9ff('0x22')](respondWithResult(_0x560ea2,null))[_0xd9ff('0x2d')](handleError(_0x560ea2,null));};exports[_0xd9ff('0xde')]=function(_0x3b05c4,_0x32c04e,_0x1bcf8f){_0x3b05c4[_0xd9ff('0x3f')][_0xd9ff('0x3c')]=_0x3b05c4[_0xd9ff('0xdf')][_0xd9ff('0xe0')];_0x3b05c4[_0xd9ff('0x3f')][_0xd9ff('0xe1')]=_0x3b05c4[_0xd9ff('0xdf')][_0xd9ff('0xe2')];_0x3b05c4['body'][_0xd9ff('0x4c')]=_0x3b05c4[_0xd9ff('0xdf')]['mimetype'];return db[_0xd9ff('0xe3')][_0xd9ff('0xd5')](_0x3b05c4[_0xd9ff('0x3f')])[_0xd9ff('0x22')](respondWithResult(_0x32c04e,0xc9))[_0xd9ff('0x2d')](handleError(_0x32c04e,null));};exports[_0xd9ff('0xe4')]=function(_0x5978ad,_0x4ddfe7,_0x30c520){return db['ChatInteraction']['findOne']({'where':{'id':_0x5978ad[_0xd9ff('0xbe')]['id']},'raw':!![]})[_0xd9ff('0x22')](handleEntityNotFound(_0x4ddfe7,null))['then'](function(_0x327362){if(_0x327362){if(_0x327362[_0xd9ff('0xda')]){return _0x4ddfe7[_0xd9ff('0x35')](0x193)[_0xd9ff('0x30')]({'status':0x193,'message':'Unauthorized'});}return db[_0xd9ff('0xe3')][_0xd9ff('0xc4')]({'where':{'id':_0x5978ad['query'][_0xd9ff('0xe5')]},'raw':!![]})[_0xd9ff('0x22')](handleEntityNotFound(_0x4ddfe7,null));}})['then'](function(_0x62f1f3){if(_0x62f1f3){var _0xd188cf=_0x62f1f3[_0xd9ff('0xe6')]!==null;var _0x5b2e9c=path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],_0xd9ff('0xe9'));if(_0xd188cf){_0x5b2e9c=path['join'](_0x5b2e9c,_0xd9ff('0xea'));}var _0x53a25a=path[_0xd9ff('0xe7')](_0x5b2e9c,_0x62f1f3[_0xd9ff('0xe1')]);return _0x4ddfe7[_0xd9ff('0xeb')](_0x53a25a);}})[_0xd9ff('0x2d')](handleError(_0x4ddfe7,null));};exports[_0xd9ff('0xec')]=function(_0x10397d,_0x51039f){var _0x37ea50=null;var _0x3cf2ef=null;var _0x171195=null;var _0x24c066=null;if(_0x10397d[_0xd9ff('0x3f')]['id']){delete _0x10397d['body']['id'];}if(_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')]){_0x24c066=path['join'](config[_0xd9ff('0xe8')],_0xd9ff('0xee'),util[_0xd9ff('0xef')](_0xd9ff('0xf0'),Date[_0xd9ff('0xf1')]()));_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xf2')]=_0x24c066;}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x10397d[_0xd9ff('0xbe')]['id']},'include':[{'model':db[_0xd9ff('0xd4')],'as':_0xd9ff('0xf3'),'include':[{'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x7c')}]}]})[_0xd9ff('0x22')](handleEntityNotFound(_0x51039f,null))[_0xd9ff('0x22')](saveUpdates(_0x10397d['body'],null))['then'](function(_0x497e36){if(_0x497e36){_0x37ea50=_0x497e36;return db[_0xd9ff('0xc5')]['find']({'where':{'id':_0x37ea50[_0xd9ff('0x81')]}});}})['then'](function(_0x4d4cc0){if(_0x4d4cc0){_0x171195=_0x4d4cc0;return db['CmContact'][_0xd9ff('0xc0')]({'where':{'id':_0x37ea50['ContactId']}});}})['then'](function(_0x474b4c){if(_0x474b4c){_0x3cf2ef=_0x474b4c;if(_0x24c066){var _0x144cf7=null;for(var _0x9eac7f=0x1;_0x9eac7f<_0x37ea50[_0xd9ff('0xf3')][_0xd9ff('0x54')];++_0x9eac7f){_0x144cf7=_0x37ea50[_0xd9ff('0xf3')][_0x9eac7f];var _0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0x171195[_0xd9ff('0xf5')],_0x144cf7[_0xd9ff('0x7e')]):_0xd9ff('0xf6');var _0x4531bc=_0x10397d['body']['customer']||util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0xd9ff('0xf7'),_0x144cf7[_0xd9ff('0x76')]);switch(_0x171195[_0xd9ff('0xf8')]){case _0xd9ff('0xf9'):_0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')]('%s%d',_0x171195[_0xd9ff('0xf5')],_0x144cf7[_0xd9ff('0x7e')]):_0xd9ff('0xf6');break;case _0xd9ff('0xfa'):_0x2450da=_0x144cf7['UserId']?_0x144cf7['User'][_0xd9ff('0xfb')]||_0x144cf7[_0xd9ff('0x7c')]['fullname']:_0xd9ff('0xf6');break;case _0xd9ff('0xfc'):_0x2450da=_0x144cf7['UserId']?_0x144cf7[_0xd9ff('0x7c')][_0xd9ff('0x43')]:_0xd9ff('0xf6');break;default:_0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0x171195[_0xd9ff('0xf5')],_0x144cf7['UserId']):_0xd9ff('0xf6');}var _0x62b518=util[_0xd9ff('0xef')](_0xd9ff('0xfd'),moment(_0x144cf7[_0xd9ff('0x84')])['format'](_0xd9ff('0xfe')),_0x144cf7[_0xd9ff('0xff')]==='in'?_0x4531bc:_0x2450da,_0x144cf7[_0xd9ff('0x3f')]);if(!_0x144cf7['secret']){fs[_0xd9ff('0x100')](_0x24c066,_0x62b518);}}return db[_0xd9ff('0x101')][_0xd9ff('0xc4')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xd9ff('0x102'),'raw':!![]}]});}}})['then'](function(_0x5e07ae){if(_0x5e07ae&&_0x5e07ae['Smtp']&&_0x10397d['body']){var _0x578f41={'tls':{'rejectUnauthorized':![]}};if(_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x103')]){_0x578f41['service']=_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x103')];}else{_0x578f41[_0xd9ff('0x104')]=_0x5e07ae['Smtp'][_0xd9ff('0x104')];_0x578f41['port']=_0x5e07ae['Smtp'][_0xd9ff('0x105')];_0x578f41[_0xd9ff('0x106')]=_0x5e07ae[_0xd9ff('0x102')]['secure'];}if(_0x5e07ae['Smtp'][_0xd9ff('0x107')]){_0x578f41[_0xd9ff('0x108')]={'user':_0x5e07ae['Smtp'][_0xd9ff('0xa1')],'pass':_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x109')]};}return respondWithRpcPromise(_0xd9ff('0x10a'),_0xd9ff('0x10b'),{'account':_0x578f41,'message':{'from':util[_0xd9ff('0xef')](_0xd9ff('0x10c'),_0x5e07ae['name'],_0x5e07ae[_0xd9ff('0xc9')]||_0x5e07ae[_0xd9ff('0x102')]['user']),'to':_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')],'subject':'Mail\x20Transcript','text':util[_0xd9ff('0xef')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')]),'attachments':[{'path':_0x24c066}]}})['then'](function(){return _0x37ea50;})[_0xd9ff('0x2d')](function(_0x4d6172){console[_0xd9ff('0x2a')](_0x4d6172);});}else{return _0x37ea50;}})[_0xd9ff('0x22')](respondWithStatusCode(_0x51039f,0xc8))[_0xd9ff('0x2d')](handleError(_0x51039f,null));};exports[_0xd9ff('0x10d')]=function(_0x6a2524,_0x356583,_0x5c1165){return db['ChatMessage'][_0xd9ff('0xc0')]({'where':{'id':_0x6a2524['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x356583,null))[_0xd9ff('0x22')](function(_0x599273){if(_0x599273){return _0x599273['addMessage'](_0x6a2524['body'][_0xd9ff('0x10e')],_[_0xd9ff('0x10f')](_0x6a2524[_0xd9ff('0x3f')],['ids','id'])||{});}})[_0xd9ff('0x22')](respondWithResult(_0x356583,null))[_0xd9ff('0x2d')](handleError(_0x356583,null));};exports[_0xd9ff('0x110')]=function(_0x2832b7,_0x618c47,_0x109140){var _0x278670={'raw':![],'where':{}};var _0x5e064d={};var _0x231b46={'count':0x0,'rows':[]};return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0x2832b7[_0xd9ff('0xbe')]['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x618c47,null))[_0xd9ff('0x22')](function(_0x1802b1){if(_0x1802b1){_0x5e064d[_0xd9ff('0x50')]=_[_0xd9ff('0x4d')](db[_0xd9ff('0xd4')][_0xd9ff('0x4a')]);_0x5e064d['query']=_['keys'](_0x2832b7[_0xd9ff('0x4e')]);_0x5e064d['filters']=_['intersection'](_0x5e064d[_0xd9ff('0x50')],_0x5e064d[_0xd9ff('0x4e')]);_0x278670[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x5e064d[_0xd9ff('0x50')],qs['fields'](_0x2832b7[_0xd9ff('0x4e')]['fields']));_0x278670[_0xd9ff('0x53')]=_0x278670[_0xd9ff('0x53')]['length']?_0x278670[_0xd9ff('0x53')]:_0x5e064d[_0xd9ff('0x50')];if(!_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x278670[_0xd9ff('0x33')]=qs[_0xd9ff('0x33')](_0x2832b7['query'][_0xd9ff('0x33')]);_0x278670[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x31')]);}_0x278670[_0xd9ff('0x9c')]=qs['sort'](_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x57')]);_0x278670[_0xd9ff('0x82')]=qs['filters'](_[_0xd9ff('0x58')](_0x2832b7['query'],_0x5e064d[_0xd9ff('0x4f')]));_0x278670['where'][_0xd9ff('0x111')]=_0x1802b1['id'];if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x90')]){_0x278670['where']=_[_0xd9ff('0x3e')](_0x278670['where'],{'$or':_[_0xd9ff('0x79')](_0x278670[_0xd9ff('0x53')],function(_0x2b2a50){var _0x34f3f0={};_0x34f3f0[_0x2b2a50]={'$like':'%'+_0x2832b7[_0xd9ff('0x4e')]['filter']+'%'};return _0x34f3f0;})});}if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x86')]){var _0x955328=_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x86')][_0xd9ff('0x46')](',');var _0x5d95b1={};_0x5d95b1[_0x955328[0x0]]={'$gte':moment(_0x955328[0x1])['format'](_0xd9ff('0x112'))};_0x278670[_0xd9ff('0x82')]=_[_0xd9ff('0x3e')](_0x278670[_0xd9ff('0x82')],_0x5d95b1);}_0x278670=_[_0xd9ff('0x3e')]({},_0x278670,_0x2832b7[_0xd9ff('0x113')]);return db[_0xd9ff('0xd4')]['count']({'where':_0x278670[_0xd9ff('0x82')]})[_0xd9ff('0x22')](function(_0x3e90fe){_0x231b46[_0xd9ff('0x34')]=_0x3e90fe;if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0xbf')]){_0x278670['include']=[{'all':!![]}];}return db[_0xd9ff('0xd4')][_0xd9ff('0x114')](_0x278670);})[_0xd9ff('0x22')](function(_0x33f933){_0x231b46[_0xd9ff('0x115')]=_0x33f933;return _0x231b46;});}})[_0xd9ff('0x22')](respondWithFilteredResult(_0x618c47,_0x278670))['catch'](handleError(_0x618c47,null));};exports['getMyMessages']=function(_0xf3a93b,_0x473ecf,_0x1213a4){var _0x6f731a={'where':{}},_0x193c57={},_0x4572b2={'count':0x0,'rows':[]};return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0xf3a93b['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x473ecf,null))[_0xd9ff('0x22')](function(_0x4115a3){if(_0x4115a3){_0x193c57[_0xd9ff('0x50')]=_[_0xd9ff('0x4d')](db[_0xd9ff('0xd4')]['rawAttributes']);_0x193c57[_0xd9ff('0x4e')]=_['keys'](_0xf3a93b['query']);_0x193c57[_0xd9ff('0x4f')]=_[_0xd9ff('0x51')](_0x193c57[_0xd9ff('0x50')],_0x193c57[_0xd9ff('0x4e')]);_0x6f731a[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x193c57[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0xf3a93b['query'][_0xd9ff('0x52')]));_0x6f731a['attributes']=_0x6f731a[_0xd9ff('0x53')][_0xd9ff('0x54')]?_0x6f731a[_0xd9ff('0x53')]:_0x193c57[_0xd9ff('0x50')];if(!_0xf3a93b['query'][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x6f731a[_0xd9ff('0x33')]=qs[_0xd9ff('0x33')](_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x33')]);_0x6f731a[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0xf3a93b[_0xd9ff('0x4e')]['offset']);}_0x6f731a[_0xd9ff('0x9c')]=qs['sort'](_0xf3a93b['query'][_0xd9ff('0x57')]);_0x6f731a[_0xd9ff('0x82')]=qs[_0xd9ff('0x4f')](_[_0xd9ff('0x58')](_0xf3a93b[_0xd9ff('0x4e')],_0x193c57[_0xd9ff('0x4f')]));_0x6f731a[_0xd9ff('0x82')][_0xd9ff('0x111')]=_0x4115a3['id'];if(_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x90')]){_0x6f731a[_0xd9ff('0x82')]=_[_0xd9ff('0x3e')](_0x6f731a['where'],{'$or':_[_0xd9ff('0x79')](_0x6f731a['attributes'],function(_0x1bb980){var _0x3ccf5d={};_0x3ccf5d[_0x1bb980]={'$like':'%'+_0xf3a93b['query']['filter']+'%'};return _0x3ccf5d;})});}_0x6f731a[_0xd9ff('0x82')][_0xd9ff('0x116')]=![];if(_0xf3a93b['query']['id']){_0x6f731a[_0xd9ff('0x82')]['id']={'$gt':_0xf3a93b[_0xd9ff('0x4e')]['id']};}_0x6f731a=_['merge']({},_0x6f731a,_0xf3a93b[_0xd9ff('0x113')]);return db['ChatMessage'][_0xd9ff('0x34')]({'where':_0x6f731a[_0xd9ff('0x82')]})[_0xd9ff('0x22')](function(_0x42d9ff){_0x4572b2[_0xd9ff('0x34')]=_0x42d9ff;_0x6f731a[_0xd9ff('0x117')]=[];if(_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x118')]){_0x6f731a[_0xd9ff('0x117')][_0xd9ff('0x119')]({'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x7c'),'attributes':['id',_0xd9ff('0x43'),_0xd9ff('0xfb')]});}if(_0xf3a93b['query'][_0xd9ff('0xbf')]){_0x6f731a[_0xd9ff('0x117')]=[{'all':!![]}];}return db[_0xd9ff('0xd4')][_0xd9ff('0x114')](_0x6f731a);})[_0xd9ff('0x22')](function(_0x314f18){_0x4572b2['rows']=_0x314f18;return _0x4572b2;});}})['then'](respondWithFilteredResult(_0x473ecf,_0x6f731a))['catch'](handleError(_0x473ecf,null));};exports['addTags']=function(_0x4699d3,_0x2e91a8,_0x4956b2){return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x4699d3[_0xd9ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2e91a8,null))['then'](function(_0x217023){if(_0x217023){return _0x217023[_0xd9ff('0x11a')](_0x4699d3['body']['ids'],_['omit'](_0x4699d3['body'],['ids','id'])||{})[_0xd9ff('0x11b')](function(){return db[_0xd9ff('0x11c')][_0xd9ff('0x114')]({'attributes':['id',_0xd9ff('0x3c'),_0xd9ff('0x5b')],'where':{'id':_0x4699d3[_0xd9ff('0x3f')][_0xd9ff('0x10e')]}});})[_0xd9ff('0x22')](function(_0x317f93){socket[_0xd9ff('0x11d')](_0xd9ff('0x11e'),{'id':Number(_0x4699d3[_0xd9ff('0xbe')]['id']),'tags':_0x317f93||[]});return{'id':Number(_0x4699d3[_0xd9ff('0xbe')]['id']),'tags':_0x317f93||[]};});}})[_0xd9ff('0x22')](respondWithResult(_0x2e91a8,null))[_0xd9ff('0x2d')](handleError(_0x2e91a8,null));};exports[_0xd9ff('0x11f')]=function(_0x404baf,_0x5d73cd,_0xdb719b){return db['ChatInteraction'][_0xd9ff('0xc0')]({'where':{'id':_0x404baf['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x5d73cd,null))[_0xd9ff('0x22')](function(_0x10935d){if(_0x10935d){return _0x10935d['removeTags'](_0x404baf['query']['ids']);}})['then'](respondWithStatusCode(_0x5d73cd,null))['catch'](handleError(_0x5d73cd,null));};exports[_0xd9ff('0xeb')]=function(_0x2031e9,_0x3b50d9){var _0x410fae=moment()[_0xd9ff('0x120')]()[_0xd9ff('0xbb')]();var _0x494da6=path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],'server','files',_0xd9ff('0x121'));var _0x49c9cc=path[_0xd9ff('0xe7')](config['root'],_0xd9ff('0x122'),_0xd9ff('0x123'),'attachments');var _0x378746=path[_0xd9ff('0xe7')](_0x494da6,_0x410fae);var _0x2acbe3=util[_0xd9ff('0xef')]('transcript-%d-%s.zip',_0x2031e9['params']['id'],_0x410fae);var _0x46d12c=path[_0xd9ff('0xe7')](_0x494da6,_0x2acbe3);var _0x54f4aa=[];_0x54f4aa[_0xd9ff('0x119')]({'model':db['User'],'as':_0xd9ff('0x7c'),'attributes':['id',_0xd9ff('0x43')],'raw':!![]});_0x54f4aa[_0xd9ff('0x119')]({'model':db[_0xd9ff('0x124')],'as':_0xd9ff('0x71'),'attributes':['id',_0xd9ff('0x125'),'lastName'],'raw':!![]});if(_0x2031e9['query'][_0xd9ff('0x126')]){_0x54f4aa['push']({'model':db[_0xd9ff('0xe3')],'as':'Attachment','raw':!![]});}var _0xd015e9=[{'model':db[_0xd9ff('0xd4')],'as':_0xd9ff('0xf3'),'attributes':['id','body',_0xd9ff('0x84'),_0xd9ff('0xff'),'secret','read'],'include':_0x54f4aa}];_0xd015e9['push']({'model':db[_0xd9ff('0xc5')],'as':_0xd9ff('0x127'),'attributes':['id',_0xd9ff('0x3c')]});_0xd015e9[_0xd9ff('0x119')]({'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x128'),'attributes':['id',_0xd9ff('0x43')]});return db[_0xd9ff('0x49')]['find']({'where':{'id':_0x2031e9[_0xd9ff('0xbe')]['id']},'include':_0xd015e9})[_0xd9ff('0x22')](handleEntityNotFound(_0x3b50d9,null))[_0xd9ff('0x22')](function(_0x1b452e){if(_0x1b452e){var _0x3ab927=_0x1b452e[_0xd9ff('0x129')]({'plain':!![]});fs[_0xd9ff('0x12a')](_0x378746);var _0x2b6e15={'channel':_0xd9ff('0x12b'),'account':_0x3ab927['Account']['name'],'agent':_0x3ab927['Owner']?_0x3ab927[_0xd9ff('0x128')][_0xd9ff('0x43')]:'N.A.','createdAt':moment(_0x3ab927[_0xd9ff('0x84')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xd9ff('0xbb')](),'closedAt':_0x3ab927[_0xd9ff('0xda')]?moment(_0x3ab927[_0xd9ff('0x12c')])[_0xd9ff('0xef')](_0xd9ff('0x112'))[_0xd9ff('0xbb')]():'','disposition':_0x3ab927['disposition'],'chatInfo':{'browser':_0x3ab927[_0xd9ff('0x12d')],'os':_0x3ab927[_0xd9ff('0x12e')],'referer':_0x3ab927[_0xd9ff('0x12f')],'customerIp':_0x3ab927[_0xd9ff('0x130')],'customerPort':_0x3ab927[_0xd9ff('0x131')]?_0x3ab927['customerPort']:'N.A.'},'messages':_(_0x3ab927[_0xd9ff('0xf3')])[_0xd9ff('0x132')]()[_0xd9ff('0x90')]({'secret':![]})[_0xd9ff('0x79')](function(_0x319248){if(_0x319248[_0xd9ff('0xe3')]){var _0x1ea603=path[_0xd9ff('0xe7')](_0x49c9cc,_0x319248[_0xd9ff('0xe3')][_0xd9ff('0xe1')]);if(fs[_0xd9ff('0x133')](_0x1ea603)){fs[_0xd9ff('0x134')](_0x1ea603)[_0xd9ff('0x135')](fs['createWriteStream'](path[_0xd9ff('0xe7')](_0x378746,_0x319248[_0xd9ff('0xe3')][_0xd9ff('0xe1')])));}}return{'date':moment(_0x319248[_0xd9ff('0x84')])[_0xd9ff('0xef')](_0xd9ff('0x112'))[_0xd9ff('0xbb')](),'sender':_0x319248[_0xd9ff('0xff')]===_0xd9ff('0xd3')?_0x319248[_0xd9ff('0x7c')]?_0x319248[_0xd9ff('0x7c')][_0xd9ff('0x43')]:_0xd9ff('0xf6'):_0x319248['Contact'][_0xd9ff('0x125')]+(_0x319248[_0xd9ff('0x71')][_0xd9ff('0x136')]?'\x20'+_0x319248[_0xd9ff('0x71')]['lastName']:''),'body':_0x319248[_0xd9ff('0xe3')]?_0x319248['Attachment']['basename']:_0x319248[_0xd9ff('0x3f')],'direction':_0x319248[_0xd9ff('0xff')]===_0xd9ff('0xd3')?'A':'C','secret':_0x319248[_0xd9ff('0x116')],'read':_0x319248[_0xd9ff('0x8c')],'attachment':_0x319248[_0xd9ff('0xe3')]};})[_0xd9ff('0x6d')]()};return ejs['renderFile'](path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],'server',_0xd9ff('0x137'),_0xd9ff('0x138')),{'interaction':_0x2b6e15})[_0xd9ff('0x22')](function(_0xb07a14){var _0x1c419f=path[_0xd9ff('0xe7')](_0x378746,_0xd9ff('0x139')+_0x3ab927['id']+'-'+_0x410fae+_0xd9ff('0x13a'));var _0x3156c8={'path':_0x1c419f,'channel':_0xd9ff('0x12b'),'interactionId':_0x3ab927['id']};return pdf[_0xd9ff('0x13b')](_0xb07a14,_0x3156c8);})['then'](function(){return new BPromise(function(_0x567007,_0x1019f9){zipdir(_0x378746,{'saveTo':_0x46d12c},function(_0x2ab78a,_0x4649d9){if(_0x2ab78a)return _0x1019f9(_0x2ab78a);return _0x567007(_0x4649d9);});})[_0xd9ff('0x22')](function(){return new BPromise(function(_0x166033,_0x3c40e4){rimraf(_0x378746,function(_0x346d93){if(_0x346d93)_0x3c40e4(_0x346d93);return _0x166033();});});})[_0xd9ff('0x22')](function(){return _0x3b50d9['download'](_0x46d12c,_0x2acbe3,function(_0x22680e){if(_0x22680e){console['log'](_0xd9ff('0x13c'),_0x22680e);}else{fs[_0xd9ff('0x13d')](_0x46d12c);}});});});}else{return _0x3b50d9['sendStatus'](0xc8);}})[_0xd9ff('0x2d')](handleError(_0x3b50d9,null));};
\ No newline at end of file
+var _0x9ffd=['MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','agent','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','keyBy','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.ChatInteractionId\x20IN\x20?','groupBy','params','includeAll','find','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooNote','vidaooApiKey','vidaooEscalation','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','create','updateAttributes','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','abandon','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','getMessages','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','secret','include','includeAgent','push','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','CmContact','firstName','attachments','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','lastName','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','stack','name','render','merge','body','contact','account','Users','fullname','Tags','TagIds','split','forEach','index','ChatInteraction','rawAttributes','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','select','field','color','from','left_join','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','parseSearch','search','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','map','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','compact','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x274be7,_0x84897d){_0x274be7=_0x274be7-0x0;var _0x123967=_0x9ffd[_0x274be7];return _0x123967;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x3'));var moment=require(_0xd9ff('0x4'));var BPromise=require(_0xd9ff('0x5'));var Mustache=require(_0xd9ff('0x6'));var util=require('util');var path=require(_0xd9ff('0x7'));var sox=require(_0xd9ff('0x8'));var csv=require('to-csv');var ejs=require(_0xd9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xa'));var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x10'));var querystring=require(_0xd9ff('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x12'));var pdf=require(_0xd9ff('0x13'));var hardwareService=require(_0xd9ff('0x14'));var logger=require(_0xd9ff('0x15'))(_0xd9ff('0x16'));var utils=require(_0xd9ff('0x17'));var config=require(_0xd9ff('0x18'));var licenseUtil=require(_0xd9ff('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd9ff('0x1a')](config[_0xd9ff('0x1b')],{'host':_0xd9ff('0x1c'),'port':0x18eb});var socket=require(_0xd9ff('0x1d'))(new Redis(config[_0xd9ff('0x1b')]));require('./chatInteraction.socket')[_0xd9ff('0x1e')](socket);var jayson=require(_0xd9ff('0x1f'));var client=jayson['client'][_0xd9ff('0x20')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x547e28,_0x4c5718,_0x271287,_0x4f9d6d){return new BPromise(function(_0x35679e,_0xa30fd2){var _0x39c6ce=_0x4f9d6d||client;return _0x39c6ce[_0xd9ff('0x21')](_0x547e28,_0x271287)[_0xd9ff('0x22')](function(_0x2d4df1){logger[_0xd9ff('0x23')](_0xd9ff('0x24'),_0x4c5718,_0xd9ff('0x25'));logger[_0xd9ff('0x26')](_0xd9ff('0x27'),_0x4c5718,_0xd9ff('0x25'),JSON[_0xd9ff('0x28')](_0x2d4df1));if(_0x2d4df1['error']){if(_0x2d4df1['error'][_0xd9ff('0x29')]===0x1f4){logger[_0xd9ff('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,_0x2d4df1['error']['message']);return _0xa30fd2(_0x2d4df1['error'][_0xd9ff('0x2b')]);}logger['error'](_0xd9ff('0x24'),_0x4c5718,_0x2d4df1[_0xd9ff('0x2a')][_0xd9ff('0x2b')]);return _0x35679e(_0x2d4df1[_0xd9ff('0x2a')][_0xd9ff('0x2b')]);}else{logger[_0xd9ff('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,'request\x20sent');_0x35679e(_0x2d4df1[_0xd9ff('0x2c')]['message']);}})[_0xd9ff('0x2d')](function(_0x4d86fe){logger[_0xd9ff('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,_0x4d86fe);_0xa30fd2(_0x4d86fe);});});}function respondWithStatusCode(_0x10cbdd,_0x159e56){_0x159e56=_0x159e56||0xcc;return function(_0x2138b4){if(_0x2138b4){return _0x10cbdd[_0xd9ff('0x2e')](_0x159e56);}return _0x10cbdd['status'](_0x159e56)[_0xd9ff('0x2f')]();};}function respondWithResult(_0xe11f88,_0x1c78c4){_0x1c78c4=_0x1c78c4||0xc8;return function(_0x4390f7){if(_0x4390f7){return _0xe11f88['status'](_0x1c78c4)[_0xd9ff('0x30')](_0x4390f7);}};}function respondWithFilteredResult(_0x3792d9,_0x44b5a7){return function(_0x45fb63){if(_0x45fb63){var _0x263d3a=typeof _0x44b5a7[_0xd9ff('0x31')]===_0xd9ff('0x32')&&typeof _0x44b5a7[_0xd9ff('0x33')]===_0xd9ff('0x32');var _0x5706cf=_0x45fb63[_0xd9ff('0x34')];var _0x4ba2be=_0x263d3a?0x0:_0x44b5a7[_0xd9ff('0x31')];var _0x29c532=_0x263d3a?_0x45fb63[_0xd9ff('0x34')]:_0x44b5a7['offset']+_0x44b5a7[_0xd9ff('0x33')];var _0x3b26da;if(_0x29c532>=_0x5706cf){_0x29c532=_0x5706cf;_0x3b26da=0xc8;}else{_0x3b26da=0xce;}_0x3792d9[_0xd9ff('0x35')](_0x3b26da);return _0x3792d9[_0xd9ff('0x36')]('Content-Range',_0x4ba2be+'-'+_0x29c532+'/'+_0x5706cf)[_0xd9ff('0x30')](_0x45fb63);}return null;};}function patchUpdates(_0x5743de){return function(_0x18c28b){try{jsonpatch[_0xd9ff('0x37')](_0x18c28b,_0x5743de,!![]);}catch(_0x323cb5){return BPromise[_0xd9ff('0x38')](_0x323cb5);}return _0x18c28b[_0xd9ff('0x39')]();};}function saveUpdates(_0xdf3947,_0x2cc2ae){return function(_0x281c7b){if(_0x281c7b){return _0x281c7b[_0xd9ff('0x3a')](_0xdf3947)[_0xd9ff('0x22')](function(_0x4813a5){return _0x4813a5;});}return null;};}function removeEntity(_0x34e9a9,_0x4670e4){return function(_0x66f4d){if(_0x66f4d){return _0x66f4d['destroy']()[_0xd9ff('0x22')](function(){_0x34e9a9[_0xd9ff('0x35')](0xcc)[_0xd9ff('0x2f')]();});}};}function handleEntityNotFound(_0x4ab10f,_0x3d449d){return function(_0x5e3ff9){if(!_0x5e3ff9){_0x4ab10f[_0xd9ff('0x2e')](0x194);}return _0x5e3ff9;};}function handleError(_0x4ae56b,_0x20a021){_0x20a021=_0x20a021||0x1f4;return function(_0x5db498){logger[_0xd9ff('0x2a')](_0x5db498[_0xd9ff('0x3b')]);if(_0x5db498[_0xd9ff('0x3c')]){delete _0x5db498['name'];}_0x4ae56b['status'](_0x20a021)['send'](_0x5db498);};}function getMustacheRender(_0x7ac3d1,_0x30fc5b){return Mustache[_0xd9ff('0x3d')](_0x7ac3d1,_[_0xd9ff('0x3e')](_0x30fc5b[_0xd9ff('0x3f')],{'contact':_0x30fc5b[_0xd9ff('0x40')],'message':_0x30fc5b['message'],'agent':_0x30fc5b['agent'],'interaction':_0x30fc5b['interaction'],'account':_0x30fc5b[_0xd9ff('0x41')]}))||'';}function getInteractionUsers(_0x252edc,_0x918c9a){return new BPromise(function(_0x32adae,_0x56b94d){try{if(_0x918c9a[_0x252edc['id']]){_0x252edc[_0xd9ff('0x42')]=_['map'](_0x918c9a[_0x252edc['id']],function(_0x3cff52){return{'id':_0x3cff52['id'],'fullname':_0x3cff52[_0xd9ff('0x43')]};});}}catch(_0x1bedaf){_0x56b94d(_0x1bedaf);}_0x32adae(_0x252edc);});}function getInteractionTags(_0x169dc7,_0x59fc07){return new BPromise(function(_0x1e34da,_0x2d4d97){try{if(_0x169dc7['TagIds']){_0x169dc7[_0xd9ff('0x44')]=[];_0x169dc7[_0xd9ff('0x45')][_0xd9ff('0x46')](',')[_0xd9ff('0x47')](function(_0x1fe44d){_0x169dc7[_0xd9ff('0x44')]['push'](_0x59fc07[_0x1fe44d]);});}delete _0x169dc7[_0xd9ff('0x45')];}catch(_0x116f28){_0x2d4d97(_0x116f28);}_0x1e34da(_0x169dc7);});}function updateChatInteraction(_0x10533a,_0x39fbbb,_0x472724){return new BPromise(function(_0x52aab8,_0x3178cd){return getInteractionUsers(_0x10533a,_0x472724)[_0xd9ff('0x22')](function(_0xe0bc49){return getInteractionTags(_0xe0bc49,_0x39fbbb);})['then'](function(_0x5d06dd){_0x52aab8(_0x5d06dd);})[_0xd9ff('0x2d')](function(_0x7eb1a){_0x3178cd(_0x7eb1a);});});}exports[_0xd9ff('0x48')]=function(_0x2dfb8f,_0x437561){var _0x30c69d={},_0x564ef4={},_0xd64585={'count':0x0,'rows':[]};var _0x2d3013=_['map'](db[_0xd9ff('0x49')][_0xd9ff('0x4a')],function(_0x13a1ec){return{'name':_0x13a1ec[_0xd9ff('0x4b')],'type':_0x13a1ec[_0xd9ff('0x4c')]['key']};});_0x564ef4['model']=_['map'](_0x2d3013,_0xd9ff('0x3c'));_0x564ef4['query']=_[_0xd9ff('0x4d')](_0x2dfb8f[_0xd9ff('0x4e')]);_0x564ef4[_0xd9ff('0x4f')]=_['intersection'](_0x564ef4[_0xd9ff('0x50')],_0x564ef4[_0xd9ff('0x4e')]);_0x30c69d['attributes']=_[_0xd9ff('0x51')](_0x564ef4[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0x2dfb8f[_0xd9ff('0x4e')]['fields']));_0x30c69d[_0xd9ff('0x53')]=_0x30c69d['attributes'][_0xd9ff('0x54')]?_0x30c69d['attributes']:_0x564ef4[_0xd9ff('0x50')];if(!_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x30c69d[_0xd9ff('0x33')]=qs['limit'](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x33')]);_0x30c69d[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0x2dfb8f['query']['offset']);}_0x30c69d['order']=qs[_0xd9ff('0x57')](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x57')]);_0x30c69d['where']=qs[_0xd9ff('0x4f')](_[_0xd9ff('0x58')](_0x2dfb8f[_0xd9ff('0x4e')],_0x564ef4[_0xd9ff('0x4f')]),_0x2d3013);var _0xfede73=[];var _0x40d391=squel[_0xd9ff('0x59')]()[_0xd9ff('0x5a')]('id')[_0xd9ff('0x5a')](_0xd9ff('0x3c'))[_0xd9ff('0x5a')](_0xd9ff('0x5b'))[_0xd9ff('0x5c')]('tools_tags');var _0x3ed112=squel['select']()[_0xd9ff('0x5a')]('u.id')[_0xd9ff('0x5a')]('u.fullname')[_0xd9ff('0x5a')]('ui.ChatInteractionId')[_0xd9ff('0x5c')]('user_has_chat_interactions','ui')[_0xd9ff('0x5d')]('users','u',_0xd9ff('0x5e'));var _0x5da1a8=squel[_0xd9ff('0x59')]()[_0xd9ff('0x5c')](_0xd9ff('0x5f'),'i')[_0xd9ff('0x5d')]('cm_contacts','c',_0xd9ff('0x60'))[_0xd9ff('0x5d')](_0xd9ff('0x61'),'o','o.id\x20=\x20i.UserId')[_0xd9ff('0x5d')](_0xd9ff('0x62'),'a',_0xd9ff('0x63'))[_0xd9ff('0x5d')](_0xd9ff('0x64'),'me','me.ChatInteractionId\x20=\x20i.id')[_0xd9ff('0x5d')](_0xd9ff('0x65'),'it',_0xd9ff('0x66'))[_0xd9ff('0x5d')](_0xd9ff('0x67'),'t',_0xd9ff('0x68'));var _0x458fd4=squel['expr']();var _0x3be850=[];var _0x11251f=squel['expr']();var _0x1c885f;if(_0x2dfb8f[_0xd9ff('0x4e')]['search']){_0x1c885f=as[_0xd9ff('0x69')](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x6a')]);var _0x54ea27=_0x1c885f['sqlOperator'];for(var _0x39473e=0x0;_0x39473e<_0x1c885f['conditions'][_0xd9ff('0x54')];_0x39473e++){var _0x1e4d0c=_0x1c885f[_0xd9ff('0x6b')][_0x39473e];var _0x102aea='i';var _0x53a230=_['find'](_0x2d3013,['name',_0x1e4d0c[_0xd9ff('0x5a')]]);if(!_0x53a230){switch(_0x1e4d0c[_0xd9ff('0x5a')]){case _0xd9ff('0x6c'):if(_0x1e4d0c[_0xd9ff('0x6d')]==0x1){_0x5da1a8[_0xd9ff('0x6e')]('`'+_0x1e4d0c['field']+_0xd9ff('0x6f'));}else{_0x5da1a8['having']('`'+_0x1e4d0c[_0xd9ff('0x5a')]+_0xd9ff('0x70'));}break;case _0xd9ff('0x71'):if(_0x1e4d0c[_0xd9ff('0x72')]===_0xd9ff('0x73')){if(_0x1e4d0c[_0xd9ff('0x6d')][_0xd9ff('0x46')]('\x20')[_0xd9ff('0x54')]>0x1){_0x458fd4[_0x54ea27]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd9ff('0x74')](_0x1e4d0c[_0xd9ff('0x6d')]),null);}else{var _0x4f5338='%'+_0x1e4d0c['value']+'%';_0x458fd4[_0x54ea27](_0xd9ff('0x75'),_0x4f5338,_0x4f5338,_0x4f5338);}}else{_0x53a230=_['find'](_0x2d3013,[_0xd9ff('0x3c'),_0xd9ff('0x76')]);_0x1e4d0c['field']=_0xd9ff('0x76');_0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')]['start'],_0x58c9c2[_0xd9ff('0x6d')]['end']);}break;case'Tag':var _0x3dabb1=_0x1e4d0c[_0xd9ff('0x6d')][_0xd9ff('0x46')](',')[_0xd9ff('0x79')](function(_0x56d822){return Number(_0x56d822);});_0x3dabb1[_0xd9ff('0x47')](function(_0x23b816){_0x11251f['or'](_0xd9ff('0x7a'),'%,'+_0x23b816+',%');});_0x3be850=_[_0xd9ff('0x7b')](_0x3be850,_0x3dabb1);break;case _0xd9ff('0x7c'):if(_0x1e4d0c[_0xd9ff('0x72')]===_0xd9ff('0x73')){_0x458fd4[_0x54ea27](_0xd9ff('0x7d'),'%'+_0x1e4d0c['value']+'%',null);}else{_0x53a230=_['find'](_0x2d3013,['name',_0xd9ff('0x7e')]);_0x1e4d0c[_0xd9ff('0x5a')]='UserId';_0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x7f')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x2f')]);}break;case _0xd9ff('0x3f'):_0x58c9c2=as['buildExpression']('me',null,_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x7f')],_0x58c9c2['value'][_0xd9ff('0x2f')]);break;}}else{var _0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2['value'][_0xd9ff('0x7f')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x2f')]);}}}else{var _0x1cd620=_(_0x2dfb8f['query'])[_0xd9ff('0x4d')]()[_0xd9ff('0x79')](function(_0x1de5c9){return _['some'](_0x2d3013,[_0xd9ff('0x3c'),_0x1de5c9])?_0x1de5c9:undefined;})[_0xd9ff('0x80')]()[_0xd9ff('0x6d')]();if(!_['isEmpty'](_0x1cd620)){_0x1cd620[_0xd9ff('0x47')](function(_0x35926f){if(_0x35926f===_0xd9ff('0x81')){_0x5da1a8[_0xd9ff('0x82')](_0xd9ff('0x83'),[]['concat'](_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]));}else if(_0x35926f===_0xd9ff('0x84')){var _0x59af0a=JSON[_0xd9ff('0x85')](_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f])[_0xd9ff('0x86')];var _0x5d1973=JSON[_0xd9ff('0x85')](_0x2dfb8f['query'][_0x35926f])[_0xd9ff('0x87')];_0x5da1a8['where'](_0xd9ff('0x88'),_0x59af0a,_0x5d1973);}else{if(_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]===_0xd9ff('0x89')){_0x5da1a8[_0xd9ff('0x82')]('i.'+_0x35926f+_0xd9ff('0x8a'));}else{_0x5da1a8[_0xd9ff('0x82')]('i.'+_0x35926f+_0xd9ff('0x8b'),_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]);}}});}if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8c')]){if(_0x2dfb8f['query'][_0xd9ff('0x8c')]==0x1){_0x5da1a8[_0xd9ff('0x6e')](_0xd9ff('0x8d'));}else{_0x5da1a8[_0xd9ff('0x6e')](_0xd9ff('0x8e'));}}if(_0x2dfb8f[_0xd9ff('0x4e')]['tag']){_0x3be850=_['isArray'](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')])?_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')]:new Array(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')]);_0x3be850['forEach'](function(_0x1d34a1){_0x11251f['or'](_0xd9ff('0x7a'),'%,'+_0x1d34a1+',%');});}if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x90')]){var _0x14c89f=_0x2dfb8f[_0xd9ff('0x4e')]['filter'][_0xd9ff('0x91')]('\x5c','\x5c\x5c')[_0xd9ff('0x91')](/'/g,'\x27\x27');if(qs[_0xd9ff('0x92')](_0x14c89f)){_0x458fd4['or'](_0xd9ff('0x93'),_0x14c89f+'%');}else{_0x458fd4['or'](_0xd9ff('0x94'),qs[_0xd9ff('0x74')](_0x14c89f))['or'](_0xd9ff('0x95'),_0x14c89f+'%');}}}_0x5da1a8[_0xd9ff('0x82')](_0x458fd4);_0x5da1a8['group'](_0xd9ff('0x96'));var _0x4c2ad5={'type':db[_0xd9ff('0x97')][_0xd9ff('0x98')][_0xd9ff('0x99')],'raw':!![]};var _0x2d2d1c=_0x5da1a8[_0xd9ff('0x9a')]();_0x2d2d1c[_0xd9ff('0x5a')](_0xd9ff('0x96'));_0x2d2d1c[_0xd9ff('0x5a')](_0xd9ff('0x9b'),_0xd9ff('0x6c'));if(_0x30c69d[_0xd9ff('0x9c')]){_0x30c69d[_0xd9ff('0x9c')][_0xd9ff('0x47')](function(_0x5d29b9){var _0x4413c4=_0x5d29b9[0x0]===_0xd9ff('0x9d')?_0x5d29b9[0x0]:'i.'+_0x5d29b9[0x0];_0x5da1a8[_0xd9ff('0x9c')](_0x4413c4,_0x5d29b9[0x1]===_0xd9ff('0x9e')?![]:!![]);});}if(!_['isEmpty'](_0x3be850)){_0x5da1a8[_0xd9ff('0x6e')](_0x11251f);_0x2d2d1c[_0xd9ff('0x82')]('t.id\x20IN\x20?',_0x3be850);}BPromise[_0xd9ff('0x9f')]()[_0xd9ff('0x22')](function(){if(!_0x1c885f){if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x81')])return;_0x2d2d1c[_0xd9ff('0x82')](_0xd9ff('0xa0'));_0x5da1a8[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x2dfb8f[_0xd9ff('0xa1')]['role']!==_0xd9ff('0xa2'))return;return _0x2dfb8f[_0xd9ff('0xa1')][_0xd9ff('0xa3')]({'attributes':['id'],'raw':!![]})[_0xd9ff('0x22')](function(_0x320adb){if(_[_0xd9ff('0xa4')](_0x320adb)){_0x2d2d1c[_0xd9ff('0x82')](_0xd9ff('0xa5'));_0x5da1a8[_0xd9ff('0x82')](_0xd9ff('0xa5'));}else{_0x2d2d1c[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0xd9ff('0x79')](_0x320adb,'id'));_0x5da1a8[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0xd9ff('0x79')](_0x320adb,'id'));}});})[_0xd9ff('0x22')](function(){if(_0x2dfb8f[_0xd9ff('0xa1')][_0xd9ff('0xa6')]===_0xd9ff('0xa2')&&!_0x1c885f&&!_0x2dfb8f[_0xd9ff('0x4e')]['ChatWebsiteId'])return[];return db['sequelize'][_0xd9ff('0x4e')](_0x2d2d1c['toString'](),_0x4c2ad5);})['then'](function(_0x4a55c1){_0xd64585['count']=_0x4a55c1[_0xd9ff('0x54')];if(_0xd64585[_0xd9ff('0x34')]===0x0)return[];return db[_0xd9ff('0xa7')]['query'](_0x40d391['toString'](),_0x4c2ad5)[_0xd9ff('0x22')](function(_0x5e7f52){_0xfede73=_[_0xd9ff('0xa8')](_0x5e7f52,'id');_0x4c2ad5=_['merge'](_0x4c2ad5,{'model':db[_0xd9ff('0x49')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x52')]){_0x30c69d[_0xd9ff('0x53')][_0xd9ff('0x47')](function(_0x4e6dd2){_0x5da1a8['field']('i.'+_0x4e6dd2);});}else{_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0x9b'),_0xd9ff('0x6c'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xa9'),'Account.key');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xaa'),_0xd9ff('0xab'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xac'),_0xd9ff('0x9d'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xad'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xae'),_0xd9ff('0xaf'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb0'),'Contact.lastName');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb1'),'Contact.email');_0x5da1a8['field'](_0xd9ff('0xb2'),_0xd9ff('0xb3'));_0x5da1a8['field'](_0xd9ff('0xb4'),_0xd9ff('0xb5'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb6'),_0xd9ff('0xb7'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb8'),_0xd9ff('0xb9'));_0x5da1a8['field']('o.internal','Owner.internal');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xba'),_0xd9ff('0x45'));}if(_0x30c69d['limit'])_0x5da1a8[_0xd9ff('0x33')](_0x30c69d[_0xd9ff('0x33')]);if(_0x30c69d[_0xd9ff('0x31')])_0x5da1a8[_0xd9ff('0x31')](_0x30c69d[_0xd9ff('0x31')]);return db[_0xd9ff('0xa7')]['query'](_0x5da1a8[_0xd9ff('0xbb')](),_0x4c2ad5);})['then'](function(_0x5cb3af){if(_0x5cb3af[_0xd9ff('0x54')]>0x0)_0x3ed112[_0xd9ff('0x82')](_0xd9ff('0xbc'),_['map'](_0x5cb3af,'id'));return db[_0xd9ff('0xa7')][_0xd9ff('0x4e')](_0x3ed112['toString'](),_0x4c2ad5)['then'](function(_0x4aa6d5){var _0x11840a=_[_0xd9ff('0xbd')](_0x4aa6d5,'ChatInteractionId');var _0x2871ec=[];_0x5cb3af[_0xd9ff('0x47')](function(_0x16e130){_0x2871ec['push'](updateChatInteraction(_0x16e130,_0xfede73,_0x11840a));});return BPromise['all'](_0x2871ec);});});})['then'](function(_0xdf2e33){_0xd64585['rows']=_0xdf2e33;return _0xd64585;})[_0xd9ff('0x22')](respondWithFilteredResult(_0x437561,_0x30c69d))[_0xd9ff('0x2d')](handleError(_0x437561,null));};exports['show']=function(_0x1b048b,_0x5eeeaf){var _0x3339e5={'raw':![],'where':{'id':_0x1b048b[_0xd9ff('0xbe')]['id']}},_0x1f7d87={};_0x1f7d87['model']=_[_0xd9ff('0x4d')](db['ChatInteraction']['rawAttributes']);_0x1f7d87['query']=_[_0xd9ff('0x4d')](_0x1b048b[_0xd9ff('0x4e')]);_0x1f7d87[_0xd9ff('0x4f')]=_[_0xd9ff('0x51')](_0x1f7d87['model'],_0x1f7d87['query']);_0x3339e5[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x1f7d87[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0x1b048b[_0xd9ff('0x4e')]['fields']));_0x3339e5['attributes']=_0x3339e5[_0xd9ff('0x53')][_0xd9ff('0x54')]?_0x3339e5[_0xd9ff('0x53')]:_0x1f7d87[_0xd9ff('0x50')];if(_0x1b048b[_0xd9ff('0x4e')][_0xd9ff('0xbf')]){_0x3339e5['include']=[{'all':!![]}];}_0x3339e5=_[_0xd9ff('0x3e')]({},_0x3339e5,_0x1b048b['options']);return db['ChatInteraction'][_0xd9ff('0xc0')](_0x3339e5)[_0xd9ff('0x22')](handleEntityNotFound(_0x5eeeaf,null))[_0xd9ff('0x22')](respondWithResult(_0x5eeeaf,null))[_0xd9ff('0x2d')](handleError(_0x5eeeaf,null));};exports['create']=function(_0x4e3fdd,_0x2cf8da){return db['ChatInteraction']['create'](_0x4e3fdd[_0xd9ff('0x3f')],{})['then'](respondWithResult(_0x2cf8da,0xc9))[_0xd9ff('0x2d')](handleError(_0x2cf8da,null));};exports['update']=function(_0x327cd8,_0xd95329){if(_0x327cd8[_0xd9ff('0x3f')]['id']){delete _0x327cd8[_0xd9ff('0x3f')]['id'];}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x327cd8[_0xd9ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0xd95329,null))[_0xd9ff('0x22')](saveUpdates(_0x327cd8['body'],null))['then'](respondWithResult(_0xd95329,null))[_0xd9ff('0x2d')](handleError(_0xd95329,null));};exports[_0xd9ff('0xc1')]=function(_0x499869,_0x3c86ac){return db['ChatInteraction']['find']({'where':{'id':_0x499869[_0xd9ff('0xbe')]['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x3c86ac,null))[_0xd9ff('0x22')](removeEntity(_0x3c86ac,null))[_0xd9ff('0x2d')](handleError(_0x3c86ac,null));};exports[_0xd9ff('0xc2')]=function(_0x11c84f,_0x2d0261){return db[_0xd9ff('0x49')][_0xd9ff('0xc2')]()[_0xd9ff('0x22')](respondWithResult(_0x2d0261,null))[_0xd9ff('0x2d')](handleError(_0x2d0261,null));};exports[_0xd9ff('0xc3')]=function(_0x73cfcf,_0x538f20){var _0x51feff=_0x73cfcf['params']['id'];var _0x30c62c;var _0x50b6b2;var _0x413aef;return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0x51feff}})[_0xd9ff('0x22')](function(_0x54c390){_0x30c62c=_0x54c390;return db[_0xd9ff('0xc5')]['findOne']({'where':{'id':_0x54c390[_0xd9ff('0x81')]},'attributes':['id','vidaooApiKey','vidaooEscalation','vidaooTopic',_0xd9ff('0xc6'),'vidaooMetadata'],'raw':!![]});})[_0xd9ff('0x22')](function(_0x54524c){if(_0x54524c&&_0x54524c[_0xd9ff('0xc7')]&&_0x54524c[_0xd9ff('0xc8')]){_0x50b6b2=_0x54524c;var _0x696e18={'interaction':{'id':_0x51feff},'agent':{'id':_0x73cfcf[_0xd9ff('0xa1')]['id'],'name':_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0x3c')],'fullname':_0x73cfcf['user']['fullname'],'email':_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0xc9')]},'contact':_0x73cfcf[_0xd9ff('0x3f')][_0xd9ff('0x40')],'account':_0x73cfcf[_0xd9ff('0x3f')]['account']};var _0x432854={'rejectUnauthorized':![],'method':_0xd9ff('0xca'),'url':_0xd9ff('0xcb'),'headers':{'X-APIKEY':_0x54524c[_0xd9ff('0xc7')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0xc9')]],'buttons':null,'topic':_0x50b6b2['vidaooTopic'],'note':_[_0xd9ff('0xcc')](_0x50b6b2[_0xd9ff('0xc6')])?null:getMustacheRender(_0x50b6b2[_0xd9ff('0xc6')],_0x696e18),'metadata':null},'redirect':_0xd9ff('0xcd'),'json':!![]};try{if(!_[_0xd9ff('0xcc')](_0x50b6b2[_0xd9ff('0xce')])){var _0x1c8e55=getMustacheRender(_0x50b6b2[_0xd9ff('0xce')],_0x696e18);var _0x29fdb8=JSON[_0xd9ff('0x85')](_0x1c8e55);_0x432854[_0xd9ff('0x3f')][_0xd9ff('0xcf')]=_0x29fdb8;}}catch(_0xfc755a){throw new db[(_0xd9ff('0x97'))][(_0xd9ff('0xd0'))](_0xd9ff('0xd1'));}return rp(_0x432854);}else{throw new db[(_0xd9ff('0x97'))][(_0xd9ff('0xd0'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xd9ff('0x22')](function(_0x282183){_0x413aef=_0x282183;if(_0x413aef['id']){var _0x3aba00={'body':_0x413aef[_0xd9ff('0xd2')],'ChatWebsiteId':_0x50b6b2['id'],'ChatInteractionId':_0x30c62c['id'],'direction':_0xd9ff('0xd3'),'UserId':_0x73cfcf[_0xd9ff('0xa1')]['id']};return db[_0xd9ff('0xd4')][_0xd9ff('0xd5')](_0x3aba00,{});}else{throw new db['Sequelize'][(_0xd9ff('0xd0'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xd9ff('0x22')](function(){return _0x30c62c[_0xd9ff('0xd6')]({'vidaooSessionId':_0x413aef['id']});})[_0xd9ff('0x22')](respondWithResult(_0x538f20,null))[_0xd9ff('0x2d')](handleError(_0x538f20,null));};exports[_0xd9ff('0xd7')]=function(_0x204127,_0xf98666){if(_0x204127['body']['id']){delete _0x204127[_0xd9ff('0x3f')]['id'];}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x204127[_0xd9ff('0xbe')]['id']},'include':[{'model':db['CmContact'],'as':_0xd9ff('0x71')}]})[_0xd9ff('0x22')](handleEntityNotFound(_0xf98666,null))['then'](saveUpdates(_0x204127[_0xd9ff('0x3f')],null))[_0xd9ff('0x22')](respondWithResult(_0xf98666,null))['catch'](handleError(_0xf98666,null));};exports['abandon']=function(_0x5c4138,_0x560ea2,_0x1e6d5a){if(_0x5c4138[_0xd9ff('0x3f')]['id']){delete _0x5c4138[_0xd9ff('0x3f')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x5c4138[_0xd9ff('0xbe')]['id']}})['then'](function(_0x43a941){if(!_0x43a941){logger[_0xd9ff('0x2a')](_0xd9ff('0xd8'),'abandon',0x194,'entity\x20not\x20found');_0x560ea2['sendStatus'](0x194);}else{if(_0x43a941[_0xd9ff('0x7e')]){throw new db[(_0xd9ff('0x97'))]['ValidationError'](_0xd9ff('0xd9'));}}return _0x43a941;})[_0xd9ff('0x22')](function(_0x7efe12){if(_0x7efe12){return _0x7efe12[_0xd9ff('0x3a')]({'closed':_0x5c4138[_0xd9ff('0x3f')][_0xd9ff('0xda')],'disposition':_0x5c4138[_0xd9ff('0x3f')][_0xd9ff('0xdb')]})[_0xd9ff('0x22')](function(_0x3b7aeb){return _0x3b7aeb;});}})[_0xd9ff('0x22')](function(_0x37eb49){return respondWithRpcPromise(_0xd9ff('0xdc'),_0xd9ff('0xdd'),_0x5c4138[_0xd9ff('0x3f')],client9004);})[_0xd9ff('0x22')](respondWithResult(_0x560ea2,null))[_0xd9ff('0x2d')](handleError(_0x560ea2,null));};exports[_0xd9ff('0xde')]=function(_0x3b05c4,_0x32c04e,_0x1bcf8f){_0x3b05c4[_0xd9ff('0x3f')][_0xd9ff('0x3c')]=_0x3b05c4[_0xd9ff('0xdf')][_0xd9ff('0xe0')];_0x3b05c4[_0xd9ff('0x3f')][_0xd9ff('0xe1')]=_0x3b05c4[_0xd9ff('0xdf')][_0xd9ff('0xe2')];_0x3b05c4['body'][_0xd9ff('0x4c')]=_0x3b05c4[_0xd9ff('0xdf')]['mimetype'];return db[_0xd9ff('0xe3')][_0xd9ff('0xd5')](_0x3b05c4[_0xd9ff('0x3f')])[_0xd9ff('0x22')](respondWithResult(_0x32c04e,0xc9))[_0xd9ff('0x2d')](handleError(_0x32c04e,null));};exports[_0xd9ff('0xe4')]=function(_0x5978ad,_0x4ddfe7,_0x30c520){return db['ChatInteraction']['findOne']({'where':{'id':_0x5978ad[_0xd9ff('0xbe')]['id']},'raw':!![]})[_0xd9ff('0x22')](handleEntityNotFound(_0x4ddfe7,null))['then'](function(_0x327362){if(_0x327362){if(_0x327362[_0xd9ff('0xda')]){return _0x4ddfe7[_0xd9ff('0x35')](0x193)[_0xd9ff('0x30')]({'status':0x193,'message':'Unauthorized'});}return db[_0xd9ff('0xe3')][_0xd9ff('0xc4')]({'where':{'id':_0x5978ad['query'][_0xd9ff('0xe5')]},'raw':!![]})[_0xd9ff('0x22')](handleEntityNotFound(_0x4ddfe7,null));}})['then'](function(_0x62f1f3){if(_0x62f1f3){var _0xd188cf=_0x62f1f3[_0xd9ff('0xe6')]!==null;var _0x5b2e9c=path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],_0xd9ff('0xe9'));if(_0xd188cf){_0x5b2e9c=path['join'](_0x5b2e9c,_0xd9ff('0xea'));}var _0x53a25a=path[_0xd9ff('0xe7')](_0x5b2e9c,_0x62f1f3[_0xd9ff('0xe1')]);return _0x4ddfe7[_0xd9ff('0xeb')](_0x53a25a);}})[_0xd9ff('0x2d')](handleError(_0x4ddfe7,null));};exports[_0xd9ff('0xec')]=function(_0x10397d,_0x51039f){var _0x37ea50=null;var _0x3cf2ef=null;var _0x171195=null;var _0x24c066=null;if(_0x10397d[_0xd9ff('0x3f')]['id']){delete _0x10397d['body']['id'];}if(_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')]){_0x24c066=path['join'](config[_0xd9ff('0xe8')],_0xd9ff('0xee'),util[_0xd9ff('0xef')](_0xd9ff('0xf0'),Date[_0xd9ff('0xf1')]()));_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xf2')]=_0x24c066;}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x10397d[_0xd9ff('0xbe')]['id']},'include':[{'model':db[_0xd9ff('0xd4')],'as':_0xd9ff('0xf3'),'include':[{'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x7c')}]}]})[_0xd9ff('0x22')](handleEntityNotFound(_0x51039f,null))[_0xd9ff('0x22')](saveUpdates(_0x10397d['body'],null))['then'](function(_0x497e36){if(_0x497e36){_0x37ea50=_0x497e36;return db[_0xd9ff('0xc5')]['find']({'where':{'id':_0x37ea50[_0xd9ff('0x81')]}});}})['then'](function(_0x4d4cc0){if(_0x4d4cc0){_0x171195=_0x4d4cc0;return db['CmContact'][_0xd9ff('0xc0')]({'where':{'id':_0x37ea50['ContactId']}});}})['then'](function(_0x474b4c){if(_0x474b4c){_0x3cf2ef=_0x474b4c;if(_0x24c066){var _0x144cf7=null;for(var _0x9eac7f=0x1;_0x9eac7f<_0x37ea50[_0xd9ff('0xf3')][_0xd9ff('0x54')];++_0x9eac7f){_0x144cf7=_0x37ea50[_0xd9ff('0xf3')][_0x9eac7f];var _0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0x171195[_0xd9ff('0xf5')],_0x144cf7[_0xd9ff('0x7e')]):_0xd9ff('0xf6');var _0x4531bc=_0x10397d['body']['customer']||util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0xd9ff('0xf7'),_0x144cf7[_0xd9ff('0x76')]);switch(_0x171195[_0xd9ff('0xf8')]){case _0xd9ff('0xf9'):_0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')]('%s%d',_0x171195[_0xd9ff('0xf5')],_0x144cf7[_0xd9ff('0x7e')]):_0xd9ff('0xf6');break;case _0xd9ff('0xfa'):_0x2450da=_0x144cf7['UserId']?_0x144cf7['User'][_0xd9ff('0xfb')]||_0x144cf7[_0xd9ff('0x7c')]['fullname']:_0xd9ff('0xf6');break;case _0xd9ff('0xfc'):_0x2450da=_0x144cf7['UserId']?_0x144cf7[_0xd9ff('0x7c')][_0xd9ff('0x43')]:_0xd9ff('0xf6');break;default:_0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0x171195[_0xd9ff('0xf5')],_0x144cf7['UserId']):_0xd9ff('0xf6');}var _0x62b518=util[_0xd9ff('0xef')](_0xd9ff('0xfd'),moment(_0x144cf7[_0xd9ff('0x84')])['format'](_0xd9ff('0xfe')),_0x144cf7[_0xd9ff('0xff')]==='in'?_0x4531bc:_0x2450da,_0x144cf7[_0xd9ff('0x3f')]);if(!_0x144cf7['secret']){fs[_0xd9ff('0x100')](_0x24c066,_0x62b518);}}return db[_0xd9ff('0x101')][_0xd9ff('0xc4')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xd9ff('0x102'),'raw':!![]}]});}}})['then'](function(_0x5e07ae){if(_0x5e07ae&&_0x5e07ae['Smtp']&&_0x10397d['body']){var _0x578f41={'tls':{'rejectUnauthorized':![]}};if(_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x103')]){_0x578f41['service']=_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x103')];}else{_0x578f41[_0xd9ff('0x104')]=_0x5e07ae['Smtp'][_0xd9ff('0x104')];_0x578f41['port']=_0x5e07ae['Smtp'][_0xd9ff('0x105')];_0x578f41[_0xd9ff('0x106')]=_0x5e07ae[_0xd9ff('0x102')]['secure'];}if(_0x5e07ae['Smtp'][_0xd9ff('0x107')]){_0x578f41[_0xd9ff('0x108')]={'user':_0x5e07ae['Smtp'][_0xd9ff('0xa1')],'pass':_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x109')]};}return respondWithRpcPromise(_0xd9ff('0x10a'),_0xd9ff('0x10b'),{'account':_0x578f41,'message':{'from':util[_0xd9ff('0xef')](_0xd9ff('0x10c'),_0x5e07ae['name'],_0x5e07ae[_0xd9ff('0xc9')]||_0x5e07ae[_0xd9ff('0x102')]['user']),'to':_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')],'subject':'Mail\x20Transcript','text':util[_0xd9ff('0xef')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')]),'attachments':[{'path':_0x24c066}]}})['then'](function(){return _0x37ea50;})[_0xd9ff('0x2d')](function(_0x4d6172){console[_0xd9ff('0x2a')](_0x4d6172);});}else{return _0x37ea50;}})[_0xd9ff('0x22')](respondWithStatusCode(_0x51039f,0xc8))[_0xd9ff('0x2d')](handleError(_0x51039f,null));};exports[_0xd9ff('0x10d')]=function(_0x6a2524,_0x356583,_0x5c1165){return db['ChatMessage'][_0xd9ff('0xc0')]({'where':{'id':_0x6a2524['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x356583,null))[_0xd9ff('0x22')](function(_0x599273){if(_0x599273){return _0x599273['addMessage'](_0x6a2524['body'][_0xd9ff('0x10e')],_[_0xd9ff('0x10f')](_0x6a2524[_0xd9ff('0x3f')],['ids','id'])||{});}})[_0xd9ff('0x22')](respondWithResult(_0x356583,null))[_0xd9ff('0x2d')](handleError(_0x356583,null));};exports[_0xd9ff('0x110')]=function(_0x2832b7,_0x618c47,_0x109140){var _0x278670={'raw':![],'where':{}};var _0x5e064d={};var _0x231b46={'count':0x0,'rows':[]};return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0x2832b7[_0xd9ff('0xbe')]['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x618c47,null))[_0xd9ff('0x22')](function(_0x1802b1){if(_0x1802b1){_0x5e064d[_0xd9ff('0x50')]=_[_0xd9ff('0x4d')](db[_0xd9ff('0xd4')][_0xd9ff('0x4a')]);_0x5e064d['query']=_['keys'](_0x2832b7[_0xd9ff('0x4e')]);_0x5e064d['filters']=_['intersection'](_0x5e064d[_0xd9ff('0x50')],_0x5e064d[_0xd9ff('0x4e')]);_0x278670[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x5e064d[_0xd9ff('0x50')],qs['fields'](_0x2832b7[_0xd9ff('0x4e')]['fields']));_0x278670[_0xd9ff('0x53')]=_0x278670[_0xd9ff('0x53')]['length']?_0x278670[_0xd9ff('0x53')]:_0x5e064d[_0xd9ff('0x50')];if(!_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x278670[_0xd9ff('0x33')]=qs[_0xd9ff('0x33')](_0x2832b7['query'][_0xd9ff('0x33')]);_0x278670[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x31')]);}_0x278670[_0xd9ff('0x9c')]=qs['sort'](_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x57')]);_0x278670[_0xd9ff('0x82')]=qs['filters'](_[_0xd9ff('0x58')](_0x2832b7['query'],_0x5e064d[_0xd9ff('0x4f')]));_0x278670['where'][_0xd9ff('0x111')]=_0x1802b1['id'];if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x90')]){_0x278670['where']=_[_0xd9ff('0x3e')](_0x278670['where'],{'$or':_[_0xd9ff('0x79')](_0x278670[_0xd9ff('0x53')],function(_0x2b2a50){var _0x34f3f0={};_0x34f3f0[_0x2b2a50]={'$like':'%'+_0x2832b7[_0xd9ff('0x4e')]['filter']+'%'};return _0x34f3f0;})});}if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x86')]){var _0x955328=_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x86')][_0xd9ff('0x46')](',');var _0x5d95b1={};_0x5d95b1[_0x955328[0x0]]={'$gte':moment(_0x955328[0x1])['format'](_0xd9ff('0x112'))};_0x278670[_0xd9ff('0x82')]=_[_0xd9ff('0x3e')](_0x278670[_0xd9ff('0x82')],_0x5d95b1);}_0x278670=_[_0xd9ff('0x3e')]({},_0x278670,_0x2832b7[_0xd9ff('0x113')]);return db[_0xd9ff('0xd4')]['count']({'where':_0x278670[_0xd9ff('0x82')]})[_0xd9ff('0x22')](function(_0x3e90fe){_0x231b46[_0xd9ff('0x34')]=_0x3e90fe;if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0xbf')]){_0x278670['include']=[{'all':!![]}];}return db[_0xd9ff('0xd4')][_0xd9ff('0x114')](_0x278670);})[_0xd9ff('0x22')](function(_0x33f933){_0x231b46[_0xd9ff('0x115')]=_0x33f933;return _0x231b46;});}})[_0xd9ff('0x22')](respondWithFilteredResult(_0x618c47,_0x278670))['catch'](handleError(_0x618c47,null));};exports['getMyMessages']=function(_0xf3a93b,_0x473ecf,_0x1213a4){var _0x6f731a={'where':{}},_0x193c57={},_0x4572b2={'count':0x0,'rows':[]};return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0xf3a93b['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x473ecf,null))[_0xd9ff('0x22')](function(_0x4115a3){if(_0x4115a3){_0x193c57[_0xd9ff('0x50')]=_[_0xd9ff('0x4d')](db[_0xd9ff('0xd4')]['rawAttributes']);_0x193c57[_0xd9ff('0x4e')]=_['keys'](_0xf3a93b['query']);_0x193c57[_0xd9ff('0x4f')]=_[_0xd9ff('0x51')](_0x193c57[_0xd9ff('0x50')],_0x193c57[_0xd9ff('0x4e')]);_0x6f731a[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x193c57[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0xf3a93b['query'][_0xd9ff('0x52')]));_0x6f731a['attributes']=_0x6f731a[_0xd9ff('0x53')][_0xd9ff('0x54')]?_0x6f731a[_0xd9ff('0x53')]:_0x193c57[_0xd9ff('0x50')];if(!_0xf3a93b['query'][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x6f731a[_0xd9ff('0x33')]=qs[_0xd9ff('0x33')](_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x33')]);_0x6f731a[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0xf3a93b[_0xd9ff('0x4e')]['offset']);}_0x6f731a[_0xd9ff('0x9c')]=qs['sort'](_0xf3a93b['query'][_0xd9ff('0x57')]);_0x6f731a[_0xd9ff('0x82')]=qs[_0xd9ff('0x4f')](_[_0xd9ff('0x58')](_0xf3a93b[_0xd9ff('0x4e')],_0x193c57[_0xd9ff('0x4f')]));_0x6f731a[_0xd9ff('0x82')][_0xd9ff('0x111')]=_0x4115a3['id'];if(_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x90')]){_0x6f731a[_0xd9ff('0x82')]=_[_0xd9ff('0x3e')](_0x6f731a['where'],{'$or':_[_0xd9ff('0x79')](_0x6f731a['attributes'],function(_0x1bb980){var _0x3ccf5d={};_0x3ccf5d[_0x1bb980]={'$like':'%'+_0xf3a93b['query']['filter']+'%'};return _0x3ccf5d;})});}_0x6f731a[_0xd9ff('0x82')][_0xd9ff('0x116')]=![];if(_0xf3a93b['query']['id']){_0x6f731a[_0xd9ff('0x82')]['id']={'$gt':_0xf3a93b[_0xd9ff('0x4e')]['id']};}_0x6f731a=_['merge']({},_0x6f731a,_0xf3a93b[_0xd9ff('0x113')]);return db['ChatMessage'][_0xd9ff('0x34')]({'where':_0x6f731a[_0xd9ff('0x82')]})[_0xd9ff('0x22')](function(_0x42d9ff){_0x4572b2[_0xd9ff('0x34')]=_0x42d9ff;_0x6f731a[_0xd9ff('0x117')]=[];if(_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x118')]){_0x6f731a[_0xd9ff('0x117')][_0xd9ff('0x119')]({'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x7c'),'attributes':['id',_0xd9ff('0x43'),_0xd9ff('0xfb')]});}if(_0xf3a93b['query'][_0xd9ff('0xbf')]){_0x6f731a[_0xd9ff('0x117')]=[{'all':!![]}];}return db[_0xd9ff('0xd4')][_0xd9ff('0x114')](_0x6f731a);})[_0xd9ff('0x22')](function(_0x314f18){_0x4572b2['rows']=_0x314f18;return _0x4572b2;});}})['then'](respondWithFilteredResult(_0x473ecf,_0x6f731a))['catch'](handleError(_0x473ecf,null));};exports['addTags']=function(_0x4699d3,_0x2e91a8,_0x4956b2){return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x4699d3[_0xd9ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2e91a8,null))['then'](function(_0x217023){if(_0x217023){return _0x217023[_0xd9ff('0x11a')](_0x4699d3['body']['ids'],_['omit'](_0x4699d3['body'],['ids','id'])||{})[_0xd9ff('0x11b')](function(){return db[_0xd9ff('0x11c')][_0xd9ff('0x114')]({'attributes':['id',_0xd9ff('0x3c'),_0xd9ff('0x5b')],'where':{'id':_0x4699d3[_0xd9ff('0x3f')][_0xd9ff('0x10e')]}});})[_0xd9ff('0x22')](function(_0x317f93){socket[_0xd9ff('0x11d')](_0xd9ff('0x11e'),{'id':Number(_0x4699d3[_0xd9ff('0xbe')]['id']),'tags':_0x317f93||[]});return{'id':Number(_0x4699d3[_0xd9ff('0xbe')]['id']),'tags':_0x317f93||[]};});}})[_0xd9ff('0x22')](respondWithResult(_0x2e91a8,null))[_0xd9ff('0x2d')](handleError(_0x2e91a8,null));};exports[_0xd9ff('0x11f')]=function(_0x404baf,_0x5d73cd,_0xdb719b){return db['ChatInteraction'][_0xd9ff('0xc0')]({'where':{'id':_0x404baf['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x5d73cd,null))[_0xd9ff('0x22')](function(_0x10935d){if(_0x10935d){return _0x10935d['removeTags'](_0x404baf['query']['ids']);}})['then'](respondWithStatusCode(_0x5d73cd,null))['catch'](handleError(_0x5d73cd,null));};exports[_0xd9ff('0xeb')]=function(_0x2031e9,_0x3b50d9){var _0x410fae=moment()[_0xd9ff('0x120')]()[_0xd9ff('0xbb')]();var _0x494da6=path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],'server','files',_0xd9ff('0x121'));var _0x49c9cc=path[_0xd9ff('0xe7')](config['root'],_0xd9ff('0x122'),_0xd9ff('0x123'),'attachments');var _0x378746=path[_0xd9ff('0xe7')](_0x494da6,_0x410fae);var _0x2acbe3=util[_0xd9ff('0xef')]('transcript-%d-%s.zip',_0x2031e9['params']['id'],_0x410fae);var _0x46d12c=path[_0xd9ff('0xe7')](_0x494da6,_0x2acbe3);var _0x54f4aa=[];_0x54f4aa[_0xd9ff('0x119')]({'model':db['User'],'as':_0xd9ff('0x7c'),'attributes':['id',_0xd9ff('0x43')],'raw':!![]});_0x54f4aa[_0xd9ff('0x119')]({'model':db[_0xd9ff('0x124')],'as':_0xd9ff('0x71'),'attributes':['id',_0xd9ff('0x125'),'lastName'],'raw':!![]});if(_0x2031e9['query'][_0xd9ff('0x126')]){_0x54f4aa['push']({'model':db[_0xd9ff('0xe3')],'as':'Attachment','raw':!![]});}var _0xd015e9=[{'model':db[_0xd9ff('0xd4')],'as':_0xd9ff('0xf3'),'attributes':['id','body',_0xd9ff('0x84'),_0xd9ff('0xff'),'secret','read'],'include':_0x54f4aa}];_0xd015e9['push']({'model':db[_0xd9ff('0xc5')],'as':_0xd9ff('0x127'),'attributes':['id',_0xd9ff('0x3c')]});_0xd015e9[_0xd9ff('0x119')]({'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x128'),'attributes':['id',_0xd9ff('0x43')]});return db[_0xd9ff('0x49')]['find']({'where':{'id':_0x2031e9[_0xd9ff('0xbe')]['id']},'include':_0xd015e9})[_0xd9ff('0x22')](handleEntityNotFound(_0x3b50d9,null))[_0xd9ff('0x22')](function(_0x1b452e){if(_0x1b452e){var _0x3ab927=_0x1b452e[_0xd9ff('0x129')]({'plain':!![]});fs[_0xd9ff('0x12a')](_0x378746);var _0x2b6e15={'channel':_0xd9ff('0x12b'),'account':_0x3ab927['Account']['name'],'agent':_0x3ab927['Owner']?_0x3ab927[_0xd9ff('0x128')][_0xd9ff('0x43')]:'N.A.','createdAt':moment(_0x3ab927[_0xd9ff('0x84')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xd9ff('0xbb')](),'closedAt':_0x3ab927[_0xd9ff('0xda')]?moment(_0x3ab927[_0xd9ff('0x12c')])[_0xd9ff('0xef')](_0xd9ff('0x112'))[_0xd9ff('0xbb')]():'','disposition':_0x3ab927['disposition'],'chatInfo':{'browser':_0x3ab927[_0xd9ff('0x12d')],'os':_0x3ab927[_0xd9ff('0x12e')],'referer':_0x3ab927[_0xd9ff('0x12f')],'customerIp':_0x3ab927[_0xd9ff('0x130')],'customerPort':_0x3ab927[_0xd9ff('0x131')]?_0x3ab927['customerPort']:'N.A.'},'messages':_(_0x3ab927[_0xd9ff('0xf3')])[_0xd9ff('0x132')]()[_0xd9ff('0x90')]({'secret':![]})[_0xd9ff('0x79')](function(_0x319248){if(_0x319248[_0xd9ff('0xe3')]){var _0x1ea603=path[_0xd9ff('0xe7')](_0x49c9cc,_0x319248[_0xd9ff('0xe3')][_0xd9ff('0xe1')]);if(fs[_0xd9ff('0x133')](_0x1ea603)){fs[_0xd9ff('0x134')](_0x1ea603)[_0xd9ff('0x135')](fs['createWriteStream'](path[_0xd9ff('0xe7')](_0x378746,_0x319248[_0xd9ff('0xe3')][_0xd9ff('0xe1')])));}}return{'date':moment(_0x319248[_0xd9ff('0x84')])[_0xd9ff('0xef')](_0xd9ff('0x112'))[_0xd9ff('0xbb')](),'sender':_0x319248[_0xd9ff('0xff')]===_0xd9ff('0xd3')?_0x319248[_0xd9ff('0x7c')]?_0x319248[_0xd9ff('0x7c')][_0xd9ff('0x43')]:_0xd9ff('0xf6'):_0x319248['Contact'][_0xd9ff('0x125')]+(_0x319248[_0xd9ff('0x71')][_0xd9ff('0x136')]?'\x20'+_0x319248[_0xd9ff('0x71')]['lastName']:''),'body':_0x319248[_0xd9ff('0xe3')]?_0x319248['Attachment']['basename']:_0x319248[_0xd9ff('0x3f')],'direction':_0x319248[_0xd9ff('0xff')]===_0xd9ff('0xd3')?'A':'C','secret':_0x319248[_0xd9ff('0x116')],'read':_0x319248[_0xd9ff('0x8c')],'attachment':_0x319248[_0xd9ff('0xe3')]};})[_0xd9ff('0x6d')]()};return ejs['renderFile'](path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],'server',_0xd9ff('0x137'),_0xd9ff('0x138')),{'interaction':_0x2b6e15})[_0xd9ff('0x22')](function(_0xb07a14){var _0x1c419f=path[_0xd9ff('0xe7')](_0x378746,_0xd9ff('0x139')+_0x3ab927['id']+'-'+_0x410fae+_0xd9ff('0x13a'));var _0x3156c8={'path':_0x1c419f,'channel':_0xd9ff('0x12b'),'interactionId':_0x3ab927['id']};return pdf[_0xd9ff('0x13b')](_0xb07a14,_0x3156c8);})['then'](function(){return new BPromise(function(_0x567007,_0x1019f9){zipdir(_0x378746,{'saveTo':_0x46d12c},function(_0x2ab78a,_0x4649d9){if(_0x2ab78a)return _0x1019f9(_0x2ab78a);return _0x567007(_0x4649d9);});})[_0xd9ff('0x22')](function(){return new BPromise(function(_0x166033,_0x3c40e4){rimraf(_0x378746,function(_0x346d93){if(_0x346d93)_0x3c40e4(_0x346d93);return _0x166033();});});})[_0xd9ff('0x22')](function(){return _0x3b50d9['download'](_0x46d12c,_0x2acbe3,function(_0x22680e){if(_0x22680e){console['log'](_0xd9ff('0x13c'),_0x22680e);}else{fs[_0xd9ff('0x13d')](_0x46d12c);}});});});}else{return _0x3b50d9['sendStatus'](0xc8);}})[_0xd9ff('0x2d')](handleError(_0x3b50d9,null));};
\ No newline at end of file
index 585434d..24279b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd0ab=['getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','hasOwnProperty','exports','../../mysqldb','ChatMessage','setMaxListeners','update','remove'];(function(_0x22da00,_0x305396){var _0x4fe74c=function(_0x1a9e95){while(--_0x1a9e95){_0x22da00['push'](_0x22da00['shift']());}};_0x4fe74c(++_0x305396);}(_0xd0ab,0xdc));var _0xbd0a=function(_0x34db4b,_0x3813c9){_0x34db4b=_0x34db4b-0x0;var _0xc2ff2f=_0xd0ab[_0x34db4b];return _0xc2ff2f;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xbd0a('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0xbd0a('0x0'))['db'][_0xbd0a('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xbd0a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbd0a('0x3'),'afterDestroy':_0xbd0a('0x4')};function emitEvent(_0xaec08b){return function(_0x5531f8,_0x35361d,_0x433725){_0x5531f8[_0xbd0a('0x5')]({'attributes':['id'],'raw':!![]})[_0xbd0a('0x6')](function(_0x4202ba){_0x5531f8[_0xbd0a('0x7')](_0xbd0a('0x8'),_0x4202ba[_0xbd0a('0x9')](function(_0x15406e){return{'id':_0x15406e['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x5531f8['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbd0a('0x6')](function(_0x455528){_0x5531f8[_0xbd0a('0x7')](_0xbd0a('0xa'),_0x455528[_0xbd0a('0xb')]);ChatInteractionEvents[_0xbd0a('0xc')](_0xaec08b+':'+_0x5531f8['id'],_0x5531f8);ChatInteractionEvents[_0xbd0a('0xc')](_0xaec08b,_0x5531f8);_0x433725(null);})['catch'](_0x433725(null));};}for(var e in events){if(events[_0xbd0a('0xd')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xbd0a('0xe')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x09c1=['Users','map','findAll','setDataValue','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','ChatMessage','update','then'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x09c1,0xaa));var _0x109c=function(_0x16697e,_0x112bf8){_0x16697e=_0x16697e-0x0;var _0x218ede=_0x09c1[_0x16697e];return _0x218ede;};'use strict';var EventEmitter=require(_0x109c('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x109c('0x1')];var ChatMessage=require(_0x109c('0x2'))['db'][_0x109c('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x109c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5c3d73){return function(_0x316ea5,_0xfbc621,_0x264197){_0x316ea5['getUsers']({'attributes':['id'],'raw':!![]})[_0x109c('0x5')](function(_0x354452){_0x316ea5['setDataValue'](_0x109c('0x6'),_0x354452[_0x109c('0x7')](function(_0x34208b){return{'id':_0x34208b['id']};}));return ChatMessage[_0x109c('0x8')]({'where':{'ChatInteractionId':_0x316ea5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x109c('0x5')](function(_0x4191fd){_0x316ea5[_0x109c('0x9')](_0x109c('0xa'),_0x4191fd[_0x109c('0xb')]);ChatInteractionEvents[_0x109c('0xc')](_0x5c3d73+':'+_0x316ea5['id'],_0x316ea5);ChatInteractionEvents['emit'](_0x5c3d73,_0x316ea5);_0x264197(null);})['catch'](_0x264197(null));};}for(var e in events){if(events[_0x109c('0xd')](e)){var event=events[e];ChatInteraction[_0x109c('0xe')](e,emitEvent(event));}}module[_0x109c('0xf')]=ChatInteractionEvents;
\ No newline at end of file
index 4fa8a78..4aa2d16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c30=['moment','request-promise','../../config/environment','./chatInteraction.attributes','exports','changed','closed','closedAt','format','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x3c30,0x65));var _0x03c3=function(_0x933e49,_0x44f455){_0x933e49=_0x933e49-0x0;var _0x5e1f1f=_0x3c30[_0x933e49];return _0x5e1f1f;};'use strict';var _=require('lodash');var util=require(_0x03c3('0x0'));var logger=require(_0x03c3('0x1'))(_0x03c3('0x2'));var moment=require(_0x03c3('0x3'));var BPromise=require('bluebird');var rp=require(_0x03c3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x03c3('0x5'));var attributes=require(_0x03c3('0x6'));module[_0x03c3('0x7')]=function(_0x4a7552,_0x32b236){return _0x4a7552['define']('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1fecd3,_0x1e8bda,_0x3f10e7){if(_0x1fecd3[_0x03c3('0x8')](_0x03c3('0x9'))){_0x1fecd3[_0x03c3('0xa')]=moment()[_0x03c3('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3f10e7(null,_0x1fecd3);}},'charset':'utf8mb4','collate':_0x03c3('0xc')});};
\ No newline at end of file
+var _0xc744=['closed','closedAt','format','utf8mb4','util','../../config/logger','api','moment','request-promise','path','rimraf','./chatInteraction.attributes','exports','changed'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc744,0x66));var _0x4c74=function(_0x35b976,_0x289a1a){_0x35b976=_0x35b976-0x0;var _0x56565f=_0xc744[_0x35b976];return _0x56565f;};'use strict';var _=require('lodash');var util=require(_0x4c74('0x0'));var logger=require(_0x4c74('0x1'))(_0x4c74('0x2'));var moment=require(_0x4c74('0x3'));var BPromise=require('bluebird');var rp=require(_0x4c74('0x4'));var fs=require('fs');var path=require(_0x4c74('0x5'));var rimraf=require(_0x4c74('0x6'));var config=require('../../config/environment');var attributes=require(_0x4c74('0x7'));module[_0x4c74('0x8')]=function(_0xb6b5b7,_0x2fe406){return _0xb6b5b7['define']('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1b9113,_0x2fd749,_0x2d23a0){if(_0x1b9113[_0x4c74('0x9')](_0x4c74('0xa'))){_0x1b9113[_0x4c74('0xb')]=moment()[_0x4c74('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2d23a0(null,_0x1b9113);}},'charset':_0x4c74('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index 93f86e3..a77797a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2889=['stringify','error','message','result','ChatInteraction','update','body','options','raw','attributes','limit','then','info','UpdateChatInteraction','catch','find','where','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatInteraction.socket','register','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s'];(function(_0xe0be82,_0x1ee7fd){var _0x4ad171=function(_0x3ff89d){while(--_0x3ff89d){_0xe0be82['push'](_0xe0be82['shift']());}};_0x4ad171(++_0x1ee7fd);}(_0x2889,0x1ef));var _0x9288=function(_0x2b9e11,_0x1e1f09){_0x2b9e11=_0x2b9e11-0x0;var _0x25f732=_0x2889[_0x2b9e11];return _0x25f732;};'use strict';var _=require(_0x9288('0x0'));var util=require('util');var moment=require(_0x9288('0x1'));var BPromise=require(_0x9288('0x2'));var rs=require(_0x9288('0x3'));var fs=require('fs');var Redis=require(_0x9288('0x4'));var db=require(_0x9288('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9288('0x6'));var config=require(_0x9288('0x7'));var jayson=require(_0x9288('0x8'));var client=jayson[_0x9288('0x9')][_0x9288('0xa')]({'port':0x232a});config['redis']=_[_0x9288('0xb')](config[_0x9288('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x9288('0xd'))(new Redis(config['redis']));require(_0x9288('0xe'))[_0x9288('0xf')](socket);function respondWithRpcPromise(_0x3757c3,_0x3c067f,_0x2757b7){return new BPromise(function(_0x5a72cc,_0x11da64){return client[_0x9288('0x10')](_0x3757c3,_0x2757b7)['then'](function(_0x30b71f){logger['info'](_0x9288('0x11'),_0x3c067f,_0x9288('0x12'));logger[_0x9288('0x13')](_0x9288('0x14'),_0x3c067f,_0x9288('0x12'),JSON[_0x9288('0x15')](_0x30b71f));if(_0x30b71f['error']){if(_0x30b71f[_0x9288('0x16')]['code']===0x1f4){logger['error'](_0x9288('0x11'),_0x3c067f,_0x30b71f[_0x9288('0x16')]['message']);return _0x11da64(_0x30b71f['error'][_0x9288('0x17')]);}logger[_0x9288('0x16')](_0x9288('0x11'),_0x3c067f,_0x30b71f[_0x9288('0x16')][_0x9288('0x17')]);return _0x5a72cc(_0x30b71f[_0x9288('0x16')][_0x9288('0x17')]);}else{logger['info'](_0x9288('0x11'),_0x3c067f,_0x9288('0x12'));_0x5a72cc(_0x30b71f[_0x9288('0x18')][_0x9288('0x17')]);}})['catch'](function(_0x1d7fd2){logger[_0x9288('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x3c067f,_0x1d7fd2);_0x11da64(_0x1d7fd2);});});}exports['UpdateChatInteraction']=function(_0x3df2a8){var _0x539c4c=this;return new Promise(function(_0x1cd999,_0x17c96d){return db[_0x9288('0x19')][_0x9288('0x1a')](_0x3df2a8[_0x9288('0x1b')],{'raw':_0x3df2a8[_0x9288('0x1c')]?_0x3df2a8['options'][_0x9288('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3df2a8[_0x9288('0x1c')]?_0x3df2a8[_0x9288('0x1c')]['where']||null:null,'attributes':_0x3df2a8['options']?_0x3df2a8[_0x9288('0x1c')][_0x9288('0x1e')]||null:null,'limit':_0x3df2a8[_0x9288('0x1c')]?_0x3df2a8[_0x9288('0x1c')][_0x9288('0x1f')]||null:null})[_0x9288('0x20')](function(_0x469bf1){logger[_0x9288('0x21')](_0x9288('0x22'),_0x3df2a8);logger[_0x9288('0x13')](_0x9288('0x22'),_0x3df2a8,JSON['stringify'](_0x469bf1));_0x1cd999(_0x469bf1);})[_0x9288('0x23')](function(_0x528567){logger[_0x9288('0x16')](_0x9288('0x22'),_0x528567['message'],_0x3df2a8);_0x17c96d(_0x539c4c[_0x9288('0x16')](0x1f4,_0x528567[_0x9288('0x17')]));});});};exports['AddTagsToChatInteraction']=function(_0x36b372){return new Promise(function(_0x2650dc,_0x12ff1d){return db[_0x9288('0x19')][_0x9288('0x24')]({'where':_0x36b372[_0x9288('0x1c')]?_0x36b372['options'][_0x9288('0x25')]||null:null})[_0x9288('0x20')](function(_0x3dd206){if(_0x3dd206){return _0x3dd206[_0x9288('0x26')](_0x36b372['body'][_0x9288('0x27')],_[_0x9288('0x28')](_0x36b372[_0x9288('0x1b')],[_0x9288('0x27'),'id'])||{});}})[_0x9288('0x29')](function(_0x542d25){logger[_0x9288('0x21')](_0x9288('0x2a'),_0x36b372);logger[_0x9288('0x13')]('AddTags',_0x36b372,JSON['stringify'](_0x542d25));_0x2650dc(_0x542d25);})[_0x9288('0x23')](function(_0x48daef){logger['error'](_0x9288('0x2a'),_0x48daef[_0x9288('0x17')],_0x36b372);_0x12ff1d(_this[_0x9288('0x16')](0x1f4,_0x48daef['message']));});});};
\ No newline at end of file
+var _0xb89f=['AddTags','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','where','limit','debug','find','addTags','ids','omit','spread'];(function(_0x10197a,_0x5b7bb6){var _0x11ad2b=function(_0x5b8bc9){while(--_0x5b8bc9){_0x10197a['push'](_0x10197a['shift']());}};_0x11ad2b(++_0x5b7bb6);}(_0xb89f,0x99));var _0xfb89=function(_0x57e8e1,_0x22396f){_0x57e8e1=_0x57e8e1-0x0;var _0x3b4664=_0xb89f[_0x57e8e1];return _0x3b4664;};'use strict';var _=require('lodash');var util=require(_0xfb89('0x0'));var moment=require('moment');var BPromise=require(_0xfb89('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb89('0x2'));var db=require(_0xfb89('0x3'))['db'];var utils=require(_0xfb89('0x4'));var logger=require(_0xfb89('0x5'))(_0xfb89('0x6'));var config=require(_0xfb89('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfb89('0x8')][_0xfb89('0x9')]({'port':0x232a});config[_0xfb89('0xa')]=_[_0xfb89('0xb')](config[_0xfb89('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xfb89('0xc'))(new Redis(config['redis']));require(_0xfb89('0xd'))[_0xfb89('0xe')](socket);function respondWithRpcPromise(_0x13deca,_0x693471,_0x2eab02){return new BPromise(function(_0x1a780c,_0x3046a7){return client['request'](_0x13deca,_0x2eab02)[_0xfb89('0xf')](function(_0x2f4007){logger[_0xfb89('0x10')](_0xfb89('0x11'),_0x693471,'request\x20sent');logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x693471,'request\x20sent',JSON[_0xfb89('0x12')](_0x2f4007));if(_0x2f4007['error']){if(_0x2f4007[_0xfb89('0x13')]['code']===0x1f4){logger['error'](_0xfb89('0x11'),_0x693471,_0x2f4007[_0xfb89('0x13')][_0xfb89('0x14')]);return _0x3046a7(_0x2f4007[_0xfb89('0x13')]['message']);}logger[_0xfb89('0x13')](_0xfb89('0x11'),_0x693471,_0x2f4007[_0xfb89('0x13')][_0xfb89('0x14')]);return _0x1a780c(_0x2f4007[_0xfb89('0x13')][_0xfb89('0x14')]);}else{logger[_0xfb89('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x693471,_0xfb89('0x15'));_0x1a780c(_0x2f4007[_0xfb89('0x16')][_0xfb89('0x14')]);}})[_0xfb89('0x17')](function(_0xf57a67){logger[_0xfb89('0x13')](_0xfb89('0x11'),_0x693471,_0xf57a67);_0x3046a7(_0xf57a67);});});}exports[_0xfb89('0x18')]=function(_0x59e956){var _0x3dd0d6=this;return new Promise(function(_0x3bf4c0,_0x271c98){return db[_0xfb89('0x19')][_0xfb89('0x1a')](_0x59e956[_0xfb89('0x1b')],{'raw':_0x59e956['options']?_0x59e956[_0xfb89('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59e956[_0xfb89('0x1c')]?_0x59e956[_0xfb89('0x1c')][_0xfb89('0x1d')]||null:null,'attributes':_0x59e956[_0xfb89('0x1c')]?_0x59e956[_0xfb89('0x1c')]['attributes']||null:null,'limit':_0x59e956[_0xfb89('0x1c')]?_0x59e956[_0xfb89('0x1c')][_0xfb89('0x1e')]||null:null})[_0xfb89('0xf')](function(_0x196e18){logger[_0xfb89('0x10')](_0xfb89('0x18'),_0x59e956);logger[_0xfb89('0x1f')](_0xfb89('0x18'),_0x59e956,JSON[_0xfb89('0x12')](_0x196e18));_0x3bf4c0(_0x196e18);})[_0xfb89('0x17')](function(_0x2149cc){logger['error'](_0xfb89('0x18'),_0x2149cc[_0xfb89('0x14')],_0x59e956);_0x271c98(_0x3dd0d6[_0xfb89('0x13')](0x1f4,_0x2149cc[_0xfb89('0x14')]));});});};exports['AddTagsToChatInteraction']=function(_0x5dd2ba){return new Promise(function(_0x5544bb,_0x449acf){return db[_0xfb89('0x19')][_0xfb89('0x20')]({'where':_0x5dd2ba['options']?_0x5dd2ba[_0xfb89('0x1c')][_0xfb89('0x1d')]||null:null})['then'](function(_0x490e91){if(_0x490e91){return _0x490e91[_0xfb89('0x21')](_0x5dd2ba['body'][_0xfb89('0x22')],_[_0xfb89('0x23')](_0x5dd2ba[_0xfb89('0x1b')],[_0xfb89('0x22'),'id'])||{});}})[_0xfb89('0x24')](function(_0x532375){logger[_0xfb89('0x10')](_0xfb89('0x25'),_0x5dd2ba);logger['debug'](_0xfb89('0x25'),_0x5dd2ba,JSON[_0xfb89('0x12')](_0x532375));_0x5544bb(_0x532375);})['catch'](function(_0x53d614){logger['error'](_0xfb89('0x25'),_0x53d614['message'],_0x5dd2ba);_0x449acf(_this['error'](0x1f4,_0x53d614[_0xfb89('0x14')]));});});};
\ No newline at end of file
index b420d9f..76da22c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe211=['save','remove','emit','removeListener','./chatInteraction.events'];(function(_0x464b39,_0x8dad8f){var _0x589f5c=function(_0x4eb81b){while(--_0x4eb81b){_0x464b39['push'](_0x464b39['shift']());}};_0x589f5c(++_0x8dad8f);}(_0xe211,0x19e));var _0x1e21=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe211[_0x14add3];return _0x4a174f;};'use strict';var ChatInteractionEvents=require(_0x1e21('0x0'));var events=[_0x1e21('0x1'),_0x1e21('0x2'),'update'];function createListener(_0x888798,_0x4e73bb){return function(_0x3acd1d){_0x4e73bb[_0x1e21('0x3')](_0x888798,_0x3acd1d);};}function removeListener(_0x4a96e2,_0x4a3a08){return function(){ChatInteractionEvents[_0x1e21('0x4')](_0x4a96e2,_0x4a3a08);};}exports['register']=function(_0x34338b){for(var _0x11a3b3=0x0,_0x508996=events['length'];_0x11a3b3<_0x508996;_0x11a3b3++){var _0x393ab0=events[_0x11a3b3];var _0x337142=createListener('chatInteraction:'+_0x393ab0,_0x34338b);ChatInteractionEvents['on'](_0x393ab0,_0x337142);}};
\ No newline at end of file
+var _0xe889=['save','update','emit','removeListener','./chatInteraction.events'];(function(_0x1b7a3f,_0x212a5c){var _0x56dee8=function(_0x451ed4){while(--_0x451ed4){_0x1b7a3f['push'](_0x1b7a3f['shift']());}};_0x56dee8(++_0x212a5c);}(_0xe889,0xd6));var _0x9e88=function(_0x53bfae,_0x5c9342){_0x53bfae=_0x53bfae-0x0;var _0x294798=_0xe889[_0x53bfae];return _0x294798;};'use strict';var ChatInteractionEvents=require(_0x9e88('0x0'));var events=[_0x9e88('0x1'),'remove',_0x9e88('0x2')];function createListener(_0x73fd17,_0x12a2c9){return function(_0x24cdc5){_0x12a2c9[_0x9e88('0x3')](_0x73fd17,_0x24cdc5);};}function removeListener(_0x5012c5,_0x59d809){return function(){ChatInteractionEvents[_0x9e88('0x4')](_0x5012c5,_0x59d809);};}exports['register']=function(_0x576de6){for(var _0x2d3347=0x0,_0x3a0b5d=events['length'];_0x2d3347<_0x3a0b5d;_0x2d3347++){var _0x2a9cf8=events[_0x2d3347];var _0x3929aa=createListener('chatInteraction:'+_0x2a9cf8,_0x576de6);ChatInteractionEvents['on'](_0x2a9cf8,_0x3929aa);}};
\ No newline at end of file
index 488f7b5..3d47b6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd093=['/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','create','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','originalname','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','put','/:id/custom_update','/:id/abandon','abandon','/:id/close','destroy','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized'];(function(_0x3f6c2d,_0x7d0ae8){var _0x432ea9=function(_0x174a16){while(--_0x174a16){_0x3f6c2d['push'](_0x3f6c2d['shift']());}};_0x432ea9(++_0x7d0ae8);}(_0xd093,0x15c));var _0x3d09=function(_0x3f53e6,_0x4c4739){_0x3f53e6=_0x3f53e6-0x0;var _0x845321=_0xd093[_0x3f53e6];return _0x845321;};'use strict';var multer=require(_0x3d09('0x0'));var util=require('util');var path=require(_0x3d09('0x1'));var timeout=require(_0x3d09('0x2'));var express=require(_0x3d09('0x3'));var router=express[_0x3d09('0x4')]();var fs_extra=require(_0x3d09('0x5'));var auth=require(_0x3d09('0x6'));var interaction=require(_0x3d09('0x7'));var config=require(_0x3d09('0x8'));var controller=require('./chatInteraction.controller');router[_0x3d09('0x9')]('/',auth[_0x3d09('0xa')](),controller[_0x3d09('0xb')]);router[_0x3d09('0x9')](_0x3d09('0xc'),auth[_0x3d09('0xa')](),controller[_0x3d09('0xd')]);router[_0x3d09('0x9')](_0x3d09('0xe'),auth[_0x3d09('0xf')](),controller['show']);router['get'](_0x3d09('0x10'),auth[_0x3d09('0xf')](),controller['attachmentDownload']);router[_0x3d09('0x9')](_0x3d09('0x11'),auth[_0x3d09('0xa')](),controller[_0x3d09('0x12')]);router[_0x3d09('0x9')](_0x3d09('0x13'),auth[_0x3d09('0xf')](),controller['getMyMessages']);router[_0x3d09('0x9')](_0x3d09('0x14'),auth[_0x3d09('0xa')](),controller[_0x3d09('0x15')]);router[_0x3d09('0x16')]('/',auth[_0x3d09('0xa')](),controller[_0x3d09('0x17')]);router[_0x3d09('0x16')]('/:id/vidaoo',auth[_0x3d09('0xa')](),controller[_0x3d09('0x18')]);var upload=multer({'storage':multer[_0x3d09('0x19')]({'destination':function(_0x400d9e,_0x2e6fa8,_0x28597e){_0x28597e(null,path[_0x3d09('0x1a')](config[_0x3d09('0x1b')],_0x3d09('0x1c')));},'filename':function(_0x8a80e2,_0xd4afdc,_0x2ef5cb){_0x2ef5cb(null,util[_0x3d09('0x1d')](_0x3d09('0x1e'),Date['now'](),_0xd4afdc[_0x3d09('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x3d09('0x20'),upload[_0x3d09('0x21')](_0x3d09('0x22')),controller[_0x3d09('0x23')]);router[_0x3d09('0x16')](_0x3d09('0x11'),auth[_0x3d09('0xf')](),controller[_0x3d09('0x24')]);router[_0x3d09('0x16')](_0x3d09('0x25'),auth[_0x3d09('0xa')](),interaction[_0x3d09('0x26')](_0x3d09('0x27'),_0x3d09('0x28')),controller[_0x3d09('0x29')]);router['put'](_0x3d09('0xe'),auth[_0x3d09('0xa')](),interaction[_0x3d09('0x26')](_0x3d09('0x27'),_0x3d09('0x2a')),controller[_0x3d09('0x2b')]);router[_0x3d09('0x2c')](_0x3d09('0x2d'),controller['customUpdate']);router[_0x3d09('0x2c')](_0x3d09('0x2e'),auth[_0x3d09('0xf')](),controller[_0x3d09('0x2f')]);router[_0x3d09('0x2c')](_0x3d09('0x30'),controller['close']);router['delete']('/:id',auth[_0x3d09('0xa')](),interaction[_0x3d09('0x26')](_0x3d09('0x27'),'chatinteraction:destroy'),controller[_0x3d09('0x31')]);router['delete'](_0x3d09('0x25'),auth[_0x3d09('0xa')](),controller[_0x3d09('0x32')]);module[_0x3d09('0x33')]=router;
\ No newline at end of file
+var _0x530e=['put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','close','/:id','delete','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','download','post','create','join','root','server/files/attachments/','now','originalname','replace','/:id/attachment_upload','single','file','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags'];(function(_0x16b4eb,_0x583bdd){var _0xeb3035=function(_0x1d50b5){while(--_0x1d50b5){_0x16b4eb['push'](_0x16b4eb['shift']());}};_0xeb3035(++_0x583bdd);}(_0x530e,0x106));var _0xe530=function(_0x1c97a8,_0x55c4ca){_0x1c97a8=_0x1c97a8-0x0;var _0x21b006=_0x530e[_0x1c97a8];return _0x21b006;};'use strict';var multer=require(_0xe530('0x0'));var util=require(_0xe530('0x1'));var path=require('path');var timeout=require(_0xe530('0x2'));var express=require(_0xe530('0x3'));var router=express[_0xe530('0x4')]();var fs_extra=require(_0xe530('0x5'));var auth=require(_0xe530('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe530('0x7'));var controller=require(_0xe530('0x8'));router[_0xe530('0x9')]('/',auth[_0xe530('0xa')](),controller[_0xe530('0xb')]);router[_0xe530('0x9')](_0xe530('0xc'),auth[_0xe530('0xa')](),controller['describe']);router[_0xe530('0x9')]('/:id',auth[_0xe530('0xd')](),controller[_0xe530('0xe')]);router['get'](_0xe530('0xf'),auth['isChatInteractionAuthorized'](),controller[_0xe530('0x10')]);router[_0xe530('0x9')](_0xe530('0x11'),auth[_0xe530('0xa')](),controller[_0xe530('0x12')]);router['get']('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller[_0xe530('0x13')]);router['get'](_0xe530('0x14'),auth[_0xe530('0xa')](),controller[_0xe530('0x15')]);router[_0xe530('0x16')]('/',auth[_0xe530('0xa')](),controller[_0xe530('0x17')]);router[_0xe530('0x16')]('/:id/vidaoo',auth[_0xe530('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xc9d75c,_0x9029d1,_0x540aff){_0x540aff(null,path[_0xe530('0x18')](config[_0xe530('0x19')],_0xe530('0x1a')));},'filename':function(_0x5d2236,_0x2f69a1,_0x42a7ac){_0x42a7ac(null,util['format']('%s-%s',Date[_0xe530('0x1b')](),_0x2f69a1[_0xe530('0x1c')][_0xe530('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe530('0x16')](_0xe530('0x1e'),upload[_0xe530('0x1f')](_0xe530('0x20')),controller['attachmentUpload']);router[_0xe530('0x16')](_0xe530('0x11'),auth['isChatInteractionAuthorized'](),controller[_0xe530('0x21')]);router['post'](_0xe530('0x22'),auth[_0xe530('0xa')](),interaction[_0xe530('0x23')](_0xe530('0x24'),_0xe530('0x25')),controller['addTags']);router[_0xe530('0x26')]('/:id',auth[_0xe530('0xa')](),interaction[_0xe530('0x23')](_0xe530('0x24'),_0xe530('0x27')),controller[_0xe530('0x28')]);router[_0xe530('0x26')]('/:id/custom_update',controller[_0xe530('0x29')]);router[_0xe530('0x26')](_0xe530('0x2a'),auth[_0xe530('0xd')](),controller[_0xe530('0x2b')]);router['put'](_0xe530('0x2c'),controller[_0xe530('0x2d')]);router['delete'](_0xe530('0x2e'),auth[_0xe530('0xa')](),interaction[_0xe530('0x23')](_0xe530('0x24'),'chatinteraction:destroy'),controller['destroy']);router[_0xe530('0x2f')](_0xe530('0x22'),auth[_0xe530('0xa')](),controller[_0xe530('0x30')]);module[_0xe530('0x31')]=router;
\ No newline at end of file
index b63b540..f7e100c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x489b=['INTEGER','sequelize','exports','medium','BOOLEAN'];(function(_0x47087a,_0x5ef3c6){var _0x28fdf1=function(_0xe1618e){while(--_0xe1618e){_0x47087a['push'](_0x47087a['shift']());}};_0x28fdf1(++_0x5ef3c6);}(_0x489b,0x15f));var _0xb489=function(_0x43a5ca,_0x279e55){_0x43a5ca=_0x43a5ca-0x0;var _0x310a4f=_0x489b[_0x43a5ca];return _0x310a4f;};'use strict';var Sequelize=require(_0xb489('0x0'));module[_0xb489('0x1')]={'body':{'type':Sequelize['TEXT'](_0xb489('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb489('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb489('0x4')]}};
\ No newline at end of file
+var _0xbad0=['BOOLEAN','exports','TEXT'];(function(_0x57d93d,_0x3e393b){var _0x25cb7d=function(_0x4be5e1){while(--_0x4be5e1){_0x57d93d['push'](_0x57d93d['shift']());}};_0x25cb7d(++_0x3e393b);}(_0xbad0,0x18a));var _0x0bad=function(_0x27671e,_0x351e75){_0x27671e=_0x27671e-0x0;var _0x20f949=_0xbad0[_0x27671e];return _0x20f949;};'use strict';var Sequelize=require('sequelize');module[_0x0bad('0x0')]={'body':{'type':Sequelize[_0x0bad('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x0bad('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index e476f9d..18b2811 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5bf=['params','describe','get','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','agent','user','role','userpic','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','resourceId','push','FromId','ToId','read','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','name','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','filter','VIRTUAL','options','where','includeAll','include','findAll','catch','show','find','create','body'];(function(_0x195eb3,_0x59180c){var _0x36ea03=function(_0x5f583d){while(--_0x5f583d){_0x195eb3['push'](_0x195eb3['shift']());}};_0x36ea03(++_0x59180c);}(_0xf5bf,0x15d));var _0xff5b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf5bf[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xff5b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xff5b('0x1'));var jsonpatch=require(_0xff5b('0x2'));var rp=require(_0xff5b('0x3'));var moment=require(_0xff5b('0x4'));var BPromise=require(_0xff5b('0x5'));var Mustache=require('mustache');var util=require(_0xff5b('0x6'));var path=require(_0xff5b('0x7'));var sox=require(_0xff5b('0x8'));var csv=require('to-csv');var ejs=require(_0xff5b('0x9'));var fs=require('fs');var fs_extra=require(_0xff5b('0xa'));var _=require(_0xff5b('0xb'));var squel=require('squel');var crypto=require(_0xff5b('0xc'));var jsforce=require(_0xff5b('0xd'));var deskjs=require(_0xff5b('0xe'));var toCsv=require('to-csv');var querystring=require(_0xff5b('0xf'));var Papa=require(_0xff5b('0x10'));var Redis=require(_0xff5b('0x11'));var authService=require(_0xff5b('0x12'));var qs=require(_0xff5b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff5b('0x14'));var logger=require('../../config/logger')(_0xff5b('0x15'));var utils=require(_0xff5b('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xff5b('0x17'))['db'];config['redis']=_[_0xff5b('0x18')](config[_0xff5b('0x19')],{'host':_0xff5b('0x1a'),'port':0x18eb});var socket=require(_0xff5b('0x1b'))(new Redis(config[_0xff5b('0x19')]));require(_0xff5b('0x1c'))[_0xff5b('0x1d')](socket);function respondWithStatusCode(_0x165ba6,_0x131c21){_0x131c21=_0x131c21||0xcc;return function(_0x1cbe53){if(_0x1cbe53){return _0x165ba6[_0xff5b('0x1e')](_0x131c21);}return _0x165ba6[_0xff5b('0x1f')](_0x131c21)[_0xff5b('0x20')]();};}function respondWithResult(_0xcc9be5,_0x3d98a7){_0x3d98a7=_0x3d98a7||0xc8;return function(_0x28acfa){if(_0x28acfa){return _0xcc9be5[_0xff5b('0x1f')](_0x3d98a7)['json'](_0x28acfa);}};}function respondWithFilteredResult(_0x3e4ed5,_0x2d12c1){return function(_0x4b90b8){if(_0x4b90b8){var _0x3abc7f=typeof _0x2d12c1[_0xff5b('0x21')]==='undefined'&&typeof _0x2d12c1[_0xff5b('0x22')]===_0xff5b('0x23');var _0x400d5e=_0x4b90b8[_0xff5b('0x24')];var _0x4ab762=_0x3abc7f?0x0:_0x2d12c1[_0xff5b('0x21')];var _0x4b3650=_0x3abc7f?_0x4b90b8[_0xff5b('0x24')]:_0x2d12c1['offset']+_0x2d12c1[_0xff5b('0x22')];var _0x5790fe;if(_0x4b3650>=_0x400d5e){_0x4b3650=_0x400d5e;_0x5790fe=0xc8;}else{_0x5790fe=0xce;}_0x3e4ed5[_0xff5b('0x1f')](_0x5790fe);return _0x3e4ed5[_0xff5b('0x25')](_0xff5b('0x26'),_0x4ab762+'-'+_0x4b3650+'/'+_0x400d5e)[_0xff5b('0x27')](_0x4b90b8);}return null;};}function patchUpdates(_0x25f9cb){return function(_0x20337e){try{jsonpatch[_0xff5b('0x28')](_0x20337e,_0x25f9cb,!![]);}catch(_0x3f9fcb){return BPromise[_0xff5b('0x29')](_0x3f9fcb);}return _0x20337e[_0xff5b('0x2a')]();};}function saveUpdates(_0x2fd738,_0x5c27ab){return function(_0x2a0dd7){if(_0x2a0dd7){return _0x2a0dd7[_0xff5b('0x2b')](_0x2fd738)['then'](function(_0x161421){return _0x161421;});}return null;};}function removeEntity(_0x506cae,_0x54e96f){return function(_0x2a2734){if(_0x2a2734){return _0x2a2734[_0xff5b('0x2c')]()[_0xff5b('0x2d')](function(){_0x506cae[_0xff5b('0x1f')](0xcc)[_0xff5b('0x20')]();});}};}function handleEntityNotFound(_0x4e9873,_0x137df3){return function(_0x15b09f){if(!_0x15b09f){_0x4e9873[_0xff5b('0x1e')](0x194);}return _0x15b09f;};}function handleError(_0x39e08e,_0x20ef59){_0x20ef59=_0x20ef59||0x1f4;return function(_0x7e1c93){logger[_0xff5b('0x2e')](_0x7e1c93['stack']);if(_0x7e1c93[_0xff5b('0x2f')]){delete _0x7e1c93['name'];}_0x39e08e[_0xff5b('0x1f')](_0x20ef59)['send'](_0x7e1c93);};}exports[_0xff5b('0x30')]=function(_0x16aa25,_0x5ce572){var _0x2e0c6b={},_0x40ee70={},_0x3884ab={'count':0x0,'rows':[]};var _0x1d287f=_[_0xff5b('0x31')](db[_0xff5b('0x32')][_0xff5b('0x33')],function(_0x92da99){return{'name':_0x92da99[_0xff5b('0x34')],'type':_0x92da99[_0xff5b('0x35')][_0xff5b('0x36')]};});_0x40ee70[_0xff5b('0x37')]=_[_0xff5b('0x31')](_0x1d287f,_0xff5b('0x2f'));_0x40ee70['query']=_[_0xff5b('0x38')](_0x16aa25['query']);_0x40ee70[_0xff5b('0x39')]=_['intersection'](_0x40ee70[_0xff5b('0x37')],_0x40ee70[_0xff5b('0x3a')]);_0x2e0c6b[_0xff5b('0x3b')]=_[_0xff5b('0x3c')](_0x40ee70[_0xff5b('0x37')],qs[_0xff5b('0x3d')](_0x16aa25[_0xff5b('0x3a')][_0xff5b('0x3d')]));_0x2e0c6b[_0xff5b('0x3b')]=_0x2e0c6b[_0xff5b('0x3b')][_0xff5b('0x3e')]?_0x2e0c6b[_0xff5b('0x3b')]:_0x40ee70[_0xff5b('0x37')];if(!_0x16aa25[_0xff5b('0x3a')][_0xff5b('0x3f')](_0xff5b('0x40'))){_0x2e0c6b['limit']=qs[_0xff5b('0x22')](_0x16aa25[_0xff5b('0x3a')][_0xff5b('0x22')]);_0x2e0c6b[_0xff5b('0x21')]=qs['offset'](_0x16aa25[_0xff5b('0x3a')]['offset']);}_0x2e0c6b[_0xff5b('0x41')]=qs[_0xff5b('0x42')](_0x16aa25[_0xff5b('0x3a')][_0xff5b('0x42')]);_0x2e0c6b['where']=qs['filters'](_['pick'](_0x16aa25['query'],_0x40ee70[_0xff5b('0x39')]),_0x1d287f);if(_0x16aa25[_0xff5b('0x3a')][_0xff5b('0x43')]){_0x2e0c6b['where']=_['merge'](_0x2e0c6b['where'],{'$or':_['map'](_0x1d287f,function(_0x38f93e){if(_0x38f93e[_0xff5b('0x35')]!==_0xff5b('0x44')){var _0x129852={};_0x129852[_0x38f93e['name']]={'$like':'%'+_0x16aa25[_0xff5b('0x3a')][_0xff5b('0x43')]+'%'};return _0x129852;}})});}_0x2e0c6b=_['merge']({},_0x2e0c6b,_0x16aa25[_0xff5b('0x45')]);var _0x4738ad={'where':_0x2e0c6b[_0xff5b('0x46')]};return db['ChatInternalMessage'][_0xff5b('0x24')](_0x4738ad)[_0xff5b('0x2d')](function(_0x2f797b){_0x3884ab[_0xff5b('0x24')]=_0x2f797b;if(_0x16aa25[_0xff5b('0x3a')][_0xff5b('0x47')]){_0x2e0c6b[_0xff5b('0x48')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0xff5b('0x49')](_0x2e0c6b);})[_0xff5b('0x2d')](function(_0x4c6c18){_0x3884ab['rows']=_0x4c6c18;return _0x3884ab;})[_0xff5b('0x2d')](respondWithFilteredResult(_0x5ce572,_0x2e0c6b))[_0xff5b('0x4a')](handleError(_0x5ce572,null));};exports[_0xff5b('0x4b')]=function(_0xca66dd,_0x3c8c5e){var _0x2b96d8={'raw':!![],'where':{'id':_0xca66dd['params']['id']}},_0x511c36={};_0x511c36[_0xff5b('0x37')]=_[_0xff5b('0x38')](db['ChatInternalMessage'][_0xff5b('0x33')]);_0x511c36[_0xff5b('0x3a')]=_[_0xff5b('0x38')](_0xca66dd[_0xff5b('0x3a')]);_0x511c36['filters']=_[_0xff5b('0x3c')](_0x511c36[_0xff5b('0x37')],_0x511c36[_0xff5b('0x3a')]);_0x2b96d8[_0xff5b('0x3b')]=_[_0xff5b('0x3c')](_0x511c36[_0xff5b('0x37')],qs[_0xff5b('0x3d')](_0xca66dd[_0xff5b('0x3a')][_0xff5b('0x3d')]));_0x2b96d8[_0xff5b('0x3b')]=_0x2b96d8['attributes']['length']?_0x2b96d8[_0xff5b('0x3b')]:_0x511c36[_0xff5b('0x37')];if(_0xca66dd[_0xff5b('0x3a')][_0xff5b('0x47')]){_0x2b96d8[_0xff5b('0x48')]=[{'all':!![]}];}_0x2b96d8=_['merge']({},_0x2b96d8,_0xca66dd[_0xff5b('0x45')]);return db[_0xff5b('0x32')][_0xff5b('0x4c')](_0x2b96d8)[_0xff5b('0x2d')](handleEntityNotFound(_0x3c8c5e,null))[_0xff5b('0x2d')](respondWithResult(_0x3c8c5e,null))['catch'](handleError(_0x3c8c5e,null));};exports['create']=function(_0x5c588e,_0x195366){return db[_0xff5b('0x32')][_0xff5b('0x4d')](_0x5c588e[_0xff5b('0x4e')],{})[_0xff5b('0x2d')](respondWithResult(_0x195366,0xc9))[_0xff5b('0x4a')](handleError(_0x195366,null));};exports[_0xff5b('0x2b')]=function(_0x1b0163,_0x19cf55){if(_0x1b0163[_0xff5b('0x4e')]['id']){delete _0x1b0163[_0xff5b('0x4e')]['id'];}return db[_0xff5b('0x32')][_0xff5b('0x4c')]({'where':{'id':_0x1b0163[_0xff5b('0x4f')]['id']}})[_0xff5b('0x2d')](handleEntityNotFound(_0x19cf55,null))[_0xff5b('0x2d')](saveUpdates(_0x1b0163[_0xff5b('0x4e')],null))[_0xff5b('0x2d')](respondWithResult(_0x19cf55,null))[_0xff5b('0x4a')](handleError(_0x19cf55,null));};exports[_0xff5b('0x2c')]=function(_0x5af1d1,_0x209e87){return db[_0xff5b('0x32')][_0xff5b('0x4c')]({'where':{'id':_0x5af1d1[_0xff5b('0x4f')]['id']}})['then'](handleEntityNotFound(_0x209e87,null))[_0xff5b('0x2d')](removeEntity(_0x209e87,null))[_0xff5b('0x4a')](handleError(_0x209e87,null));};exports[_0xff5b('0x50')]=function(_0x5bc2e6,_0x3f52fe){return db[_0xff5b('0x32')][_0xff5b('0x50')]()[_0xff5b('0x2d')](respondWithResult(_0x3f52fe,null))['catch'](handleError(_0x3f52fe,null));};function wrapUser(_0x35ab0e){return function(_0x3472a2){var _0xd32e17=_0x35ab0e[_0xff5b('0x51')]({'plain':!![]});_0xd32e17['messages']=[];if(_0x3472a2){_0xd32e17[_0xff5b('0x52')]=_0x3472a2[_0xff5b('0x53')];_0xd32e17[_0xff5b('0x54')]=_0x3472a2;}else{_0xd32e17[_0xff5b('0x52')]=moment(0x0)[_0xff5b('0x55')](_0xff5b('0x56'));_0xd32e17[_0xff5b('0x54')]={};}return _0xd32e17;};}exports['getUsers']=function(_0x543b14,_0x280b80,_0x5ec330){var _0x4301e0=[];return db[_0xff5b('0x57')][_0xff5b('0x49')]({'where':{'role':[_0xff5b('0x58'),'admin',_0xff5b('0x59')]},'attributes':['id','fullname',_0xff5b('0x2f'),_0xff5b('0x5a'),_0xff5b('0x5b'),'internal',_0xff5b('0x5c'),_0xff5b('0x5d'),_0xff5b('0x5e'),'showWebBar'],'order':qs[_0xff5b('0x42')](_0xff5b('0x5f')),'include':[{'model':db[_0xff5b('0x60')],'as':_0xff5b('0x61'),'attributes':['id',_0xff5b('0x2f'),_0xff5b('0x35')],'through':{'attributes':[]}}]})[_0xff5b('0x2d')](function(_0x286481){if(_0x286481){var _0x59a1e0=_0x543b14['user'][_0xff5b('0x51')]({'plain':!![]});if(!_0x59a1e0)throw new Error(_0xff5b('0x62'));if(_0x59a1e0['role']===_0xff5b('0x59')){return db['UserProfileSection']['find']({'where':{'name':_0xff5b('0x63'),'userProfileId':_0x59a1e0[_0xff5b('0x64')]},'raw':!![]})[_0xff5b('0x2d')](function(_0x5de466){if(_0x5de466){if(_0x5de466[_0xff5b('0x65')]===0x0){return db['UserProfileResource'][_0xff5b('0x49')]({'where':{'sectionId':_0x5de466['id']},'raw':!![]})['then'](function(_0x2adf3b){var _0x1a8fa4=[];if(_['isEmpty'](_0x2adf3b)){_0x1a8fa4=_[_0xff5b('0x43')](_0x286481,function(_0x2256d9){if(_0x2256d9['role']!==_0xff5b('0x58')){return _0x2256d9;}});return _0x1a8fa4;}else{for(var _0x5d0298=0x0;_0x5d0298<_0x286481[_0xff5b('0x3e')];_0x5d0298++){var _0x24f25e=_0x286481[_0x5d0298];if(_0x24f25e[_0xff5b('0x5a')]===_0xff5b('0x58')){var _0xccfc32=_[_0xff5b('0x4c')](_0x2adf3b,function(_0x47b4c3){return _0x47b4c3[_0xff5b('0x66')]===_0x24f25e['id'];});if(_0xccfc32)_0x1a8fa4[_0xff5b('0x67')](_0x24f25e);}else{_0x1a8fa4[_0xff5b('0x67')](_0x24f25e);}}return _0x1a8fa4;}});}else{return _0x286481;}}else{var _0x45dedf=_[_0xff5b('0x43')](_0x286481,function(_0x25400c){if(_0x25400c[_0xff5b('0x5a')]!=='agent'){return _0x25400c;}});return _0x45dedf;}});}else{return _0x286481;}}})[_0xff5b('0x2d')](function(_0x31fd25){var _0x5bed0e=[];if(_0x31fd25){_0x4301e0=_0x31fd25;for(var _0x1432dc=0x0;_0x1432dc<_0x31fd25[_0xff5b('0x3e')];_0x1432dc+=0x1){_0x4301e0[_0x1432dc]['messages']=[];_0x5bed0e['push'](db[_0xff5b('0x32')][_0xff5b('0x4c')]({'where':{'FromId':[_0x543b14[_0xff5b('0x59')]['id'],_0x31fd25[_0x1432dc]['id']],'ToId':[_0x543b14[_0xff5b('0x59')]['id'],_0x31fd25[_0x1432dc]['id']],'ChatGroupId':null},'attributes':['id',_0xff5b('0x53'),_0xff5b('0x68'),_0xff5b('0x69'),_0xff5b('0x6a'),_0xff5b('0x4e')],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xff5b('0x2d')](wrapUser(_0x31fd25[_0x1432dc])));}return BPromise['all'](_0x5bed0e);}return[];})[_0xff5b('0x2d')](function(_0x197389){return{'rows':_0x197389,'count':_0x197389[_0xff5b('0x3e')]};})[_0xff5b('0x2d')](respondWithResult(_0x280b80,null))['catch'](handleError(_0x280b80,null));};
\ No newline at end of file
+var _0x32c3=['-online','VoiceQueue','VoiceQueues','user','UserProfileSection','Agents','autoAssociation','UserProfileResource','findAll','isEmpty','agent','resourceId','push','createdAt','read','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','register','sendStatus','status','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','describe','get','messages','lastMessageAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','fullname','role','online','lastLoginAt','allowmessenger','showWebBar'];(function(_0x5b28ff,_0x1531f0){var _0xdebb37=function(_0x597284){while(--_0x597284){_0x5b28ff['push'](_0x5b28ff['shift']());}};_0xdebb37(++_0x1531f0);}(_0x32c3,0x1c9));var _0x332c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x32c3[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x332c('0x0'));var rimraf=require(_0x332c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x332c('0x2'));var rp=require(_0x332c('0x3'));var moment=require(_0x332c('0x4'));var BPromise=require(_0x332c('0x5'));var Mustache=require(_0x332c('0x6'));var util=require('util');var path=require(_0x332c('0x7'));var sox=require(_0x332c('0x8'));var csv=require(_0x332c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x332c('0xa'));var _=require(_0x332c('0xb'));var squel=require(_0x332c('0xc'));var crypto=require(_0x332c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x332c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x332c('0xf'));var Papa=require(_0x332c('0x10'));var Redis=require(_0x332c('0x11'));var authService=require(_0x332c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x332c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x332c('0x14'))(_0x332c('0x15'));var utils=require(_0x332c('0x16'));var config=require(_0x332c('0x17'));var licenseUtil=require(_0x332c('0x18'));var db=require(_0x332c('0x19'))['db'];config['redis']=_[_0x332c('0x1a')](config[_0x332c('0x1b')],{'host':_0x332c('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x332c('0x1d')](socket);function respondWithStatusCode(_0x4aacf6,_0x5664af){_0x5664af=_0x5664af||0xcc;return function(_0x4abbb0){if(_0x4abbb0){return _0x4aacf6[_0x332c('0x1e')](_0x5664af);}return _0x4aacf6['status'](_0x5664af)['end']();};}function respondWithResult(_0x40cf05,_0x158a48){_0x158a48=_0x158a48||0xc8;return function(_0x522999){if(_0x522999){return _0x40cf05[_0x332c('0x1f')](_0x158a48)['json'](_0x522999);}};}function respondWithFilteredResult(_0xec0fa6,_0x453aba){return function(_0x362300){if(_0x362300){var _0x4efa1f=typeof _0x453aba[_0x332c('0x20')]==='undefined'&&typeof _0x453aba[_0x332c('0x21')]===_0x332c('0x22');var _0x598a81=_0x362300[_0x332c('0x23')];var _0x280534=_0x4efa1f?0x0:_0x453aba[_0x332c('0x20')];var _0x27a443=_0x4efa1f?_0x362300['count']:_0x453aba[_0x332c('0x20')]+_0x453aba['limit'];var _0x4ca6f7;if(_0x27a443>=_0x598a81){_0x27a443=_0x598a81;_0x4ca6f7=0xc8;}else{_0x4ca6f7=0xce;}_0xec0fa6[_0x332c('0x1f')](_0x4ca6f7);return _0xec0fa6['set'](_0x332c('0x24'),_0x280534+'-'+_0x27a443+'/'+_0x598a81)[_0x332c('0x25')](_0x362300);}return null;};}function patchUpdates(_0x5a9080){return function(_0x573034){try{jsonpatch[_0x332c('0x26')](_0x573034,_0x5a9080,!![]);}catch(_0x38737a){return BPromise[_0x332c('0x27')](_0x38737a);}return _0x573034[_0x332c('0x28')]();};}function saveUpdates(_0x28f44e,_0x2c76d7){return function(_0x336769){if(_0x336769){return _0x336769[_0x332c('0x29')](_0x28f44e)[_0x332c('0x2a')](function(_0x3c4b43){return _0x3c4b43;});}return null;};}function removeEntity(_0xe46d80,_0x225933){return function(_0x34f92b){if(_0x34f92b){return _0x34f92b[_0x332c('0x2b')]()[_0x332c('0x2a')](function(){_0xe46d80[_0x332c('0x1f')](0xcc)[_0x332c('0x2c')]();});}};}function handleEntityNotFound(_0x1c2070,_0xf66390){return function(_0x2df2a8){if(!_0x2df2a8){_0x1c2070['sendStatus'](0x194);}return _0x2df2a8;};}function handleError(_0x3dffef,_0x5514b1){_0x5514b1=_0x5514b1||0x1f4;return function(_0x2878a2){logger[_0x332c('0x2d')](_0x2878a2['stack']);if(_0x2878a2[_0x332c('0x2e')]){delete _0x2878a2[_0x332c('0x2e')];}_0x3dffef[_0x332c('0x1f')](_0x5514b1)[_0x332c('0x2f')](_0x2878a2);};}exports[_0x332c('0x30')]=function(_0x29d321,_0x22514b){var _0x26adb8={},_0x2e64d7={},_0x4d9eab={'count':0x0,'rows':[]};var _0x4aba95=_[_0x332c('0x31')](db[_0x332c('0x32')][_0x332c('0x33')],function(_0x522dfb){return{'name':_0x522dfb[_0x332c('0x34')],'type':_0x522dfb[_0x332c('0x35')][_0x332c('0x36')]};});_0x2e64d7[_0x332c('0x37')]=_[_0x332c('0x31')](_0x4aba95,'name');_0x2e64d7[_0x332c('0x38')]=_[_0x332c('0x39')](_0x29d321['query']);_0x2e64d7[_0x332c('0x3a')]=_[_0x332c('0x3b')](_0x2e64d7['model'],_0x2e64d7[_0x332c('0x38')]);_0x26adb8['attributes']=_[_0x332c('0x3b')](_0x2e64d7[_0x332c('0x37')],qs[_0x332c('0x3c')](_0x29d321['query']['fields']));_0x26adb8['attributes']=_0x26adb8[_0x332c('0x3d')][_0x332c('0x3e')]?_0x26adb8['attributes']:_0x2e64d7['model'];if(!_0x29d321['query'][_0x332c('0x3f')]('nolimit')){_0x26adb8['limit']=qs[_0x332c('0x21')](_0x29d321[_0x332c('0x38')]['limit']);_0x26adb8[_0x332c('0x20')]=qs[_0x332c('0x20')](_0x29d321['query'][_0x332c('0x20')]);}_0x26adb8['order']=qs[_0x332c('0x40')](_0x29d321['query'][_0x332c('0x40')]);_0x26adb8['where']=qs[_0x332c('0x3a')](_['pick'](_0x29d321[_0x332c('0x38')],_0x2e64d7[_0x332c('0x3a')]),_0x4aba95);if(_0x29d321[_0x332c('0x38')][_0x332c('0x41')]){_0x26adb8[_0x332c('0x42')]=_[_0x332c('0x43')](_0x26adb8[_0x332c('0x42')],{'$or':_['map'](_0x4aba95,function(_0x1c6451){if(_0x1c6451[_0x332c('0x35')]!==_0x332c('0x44')){var _0x4fac95={};_0x4fac95[_0x1c6451[_0x332c('0x2e')]]={'$like':'%'+_0x29d321[_0x332c('0x38')][_0x332c('0x41')]+'%'};return _0x4fac95;}})});}_0x26adb8=_[_0x332c('0x43')]({},_0x26adb8,_0x29d321[_0x332c('0x45')]);var _0x10b314={'where':_0x26adb8[_0x332c('0x42')]};return db[_0x332c('0x32')][_0x332c('0x23')](_0x10b314)[_0x332c('0x2a')](function(_0x32bddb){_0x4d9eab['count']=_0x32bddb;if(_0x29d321[_0x332c('0x38')][_0x332c('0x46')]){_0x26adb8[_0x332c('0x47')]=[{'all':!![]}];}return db[_0x332c('0x32')]['findAll'](_0x26adb8);})['then'](function(_0x4ab0fc){_0x4d9eab[_0x332c('0x48')]=_0x4ab0fc;return _0x4d9eab;})[_0x332c('0x2a')](respondWithFilteredResult(_0x22514b,_0x26adb8))[_0x332c('0x49')](handleError(_0x22514b,null));};exports[_0x332c('0x4a')]=function(_0x240943,_0x15c991){var _0x1a7939={'raw':!![],'where':{'id':_0x240943[_0x332c('0x4b')]['id']}},_0x54bf71={};_0x54bf71[_0x332c('0x37')]=_[_0x332c('0x39')](db[_0x332c('0x32')][_0x332c('0x33')]);_0x54bf71[_0x332c('0x38')]=_[_0x332c('0x39')](_0x240943['query']);_0x54bf71[_0x332c('0x3a')]=_[_0x332c('0x3b')](_0x54bf71[_0x332c('0x37')],_0x54bf71[_0x332c('0x38')]);_0x1a7939[_0x332c('0x3d')]=_[_0x332c('0x3b')](_0x54bf71['model'],qs[_0x332c('0x3c')](_0x240943[_0x332c('0x38')]['fields']));_0x1a7939[_0x332c('0x3d')]=_0x1a7939[_0x332c('0x3d')][_0x332c('0x3e')]?_0x1a7939[_0x332c('0x3d')]:_0x54bf71[_0x332c('0x37')];if(_0x240943[_0x332c('0x38')]['includeAll']){_0x1a7939['include']=[{'all':!![]}];}_0x1a7939=_[_0x332c('0x43')]({},_0x1a7939,_0x240943[_0x332c('0x45')]);return db[_0x332c('0x32')][_0x332c('0x4c')](_0x1a7939)[_0x332c('0x2a')](handleEntityNotFound(_0x15c991,null))[_0x332c('0x2a')](respondWithResult(_0x15c991,null))['catch'](handleError(_0x15c991,null));};exports[_0x332c('0x4d')]=function(_0x5b15c8,_0x3f15f8){return db['ChatInternalMessage'][_0x332c('0x4d')](_0x5b15c8[_0x332c('0x4e')],{})[_0x332c('0x2a')](respondWithResult(_0x3f15f8,0xc9))['catch'](handleError(_0x3f15f8,null));};exports[_0x332c('0x29')]=function(_0x153ebe,_0x154149){if(_0x153ebe[_0x332c('0x4e')]['id']){delete _0x153ebe[_0x332c('0x4e')]['id'];}return db[_0x332c('0x32')]['find']({'where':{'id':_0x153ebe[_0x332c('0x4b')]['id']}})[_0x332c('0x2a')](handleEntityNotFound(_0x154149,null))[_0x332c('0x2a')](saveUpdates(_0x153ebe[_0x332c('0x4e')],null))[_0x332c('0x2a')](respondWithResult(_0x154149,null))[_0x332c('0x49')](handleError(_0x154149,null));};exports[_0x332c('0x2b')]=function(_0x4a66db,_0x1d8fc8){return db[_0x332c('0x32')][_0x332c('0x4c')]({'where':{'id':_0x4a66db[_0x332c('0x4b')]['id']}})[_0x332c('0x2a')](handleEntityNotFound(_0x1d8fc8,null))[_0x332c('0x2a')](removeEntity(_0x1d8fc8,null))[_0x332c('0x49')](handleError(_0x1d8fc8,null));};exports[_0x332c('0x4f')]=function(_0x55a339,_0x19746f){return db['ChatInternalMessage'][_0x332c('0x4f')]()[_0x332c('0x2a')](respondWithResult(_0x19746f,null))[_0x332c('0x49')](handleError(_0x19746f,null));};function wrapUser(_0x28a71d){return function(_0x4883fc){var _0x2c7362=_0x28a71d[_0x332c('0x50')]({'plain':!![]});_0x2c7362[_0x332c('0x51')]=[];if(_0x4883fc){_0x2c7362[_0x332c('0x52')]=_0x4883fc['createdAt'];_0x2c7362[_0x332c('0x53')]=_0x4883fc;}else{_0x2c7362[_0x332c('0x52')]=moment(0x0)['format'](_0x332c('0x54'));_0x2c7362[_0x332c('0x53')]={};}return _0x2c7362;};}exports[_0x332c('0x55')]=function(_0x465c1f,_0x382881,_0x4f50e5){var _0x453a51=[];return db[_0x332c('0x56')]['findAll']({'where':{'role':['agent','admin','user']},'attributes':['id',_0x332c('0x57'),_0x332c('0x2e'),_0x332c('0x58'),'userpic','internal',_0x332c('0x59'),_0x332c('0x5a'),_0x332c('0x5b'),_0x332c('0x5c')],'order':qs[_0x332c('0x40')](_0x332c('0x5d')),'include':[{'model':db[_0x332c('0x5e')],'as':_0x332c('0x5f'),'attributes':['id',_0x332c('0x2e'),_0x332c('0x35')],'through':{'attributes':[]}}]})[_0x332c('0x2a')](function(_0x2d16f9){if(_0x2d16f9){var _0x30d9de=_0x465c1f[_0x332c('0x60')][_0x332c('0x50')]({'plain':!![]});if(!_0x30d9de)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30d9de['role']===_0x332c('0x60')){return db[_0x332c('0x61')][_0x332c('0x4c')]({'where':{'name':_0x332c('0x62'),'userProfileId':_0x30d9de['userProfileId']},'raw':!![]})[_0x332c('0x2a')](function(_0x12fb04){if(_0x12fb04){if(_0x12fb04[_0x332c('0x63')]===0x0){return db[_0x332c('0x64')][_0x332c('0x65')]({'where':{'sectionId':_0x12fb04['id']},'raw':!![]})['then'](function(_0xfb24e0){var _0x3e35d9=[];if(_[_0x332c('0x66')](_0xfb24e0)){_0x3e35d9=_['filter'](_0x2d16f9,function(_0x4af5ac){if(_0x4af5ac[_0x332c('0x58')]!==_0x332c('0x67')){return _0x4af5ac;}});return _0x3e35d9;}else{for(var _0x5d854b=0x0;_0x5d854b<_0x2d16f9[_0x332c('0x3e')];_0x5d854b++){var _0x1b3904=_0x2d16f9[_0x5d854b];if(_0x1b3904[_0x332c('0x58')]==='agent'){var _0x149050=_[_0x332c('0x4c')](_0xfb24e0,function(_0x17a805){return _0x17a805[_0x332c('0x68')]===_0x1b3904['id'];});if(_0x149050)_0x3e35d9[_0x332c('0x69')](_0x1b3904);}else{_0x3e35d9[_0x332c('0x69')](_0x1b3904);}}return _0x3e35d9;}});}else{return _0x2d16f9;}}else{var _0x3748e6=_['filter'](_0x2d16f9,function(_0x34c1cd){if(_0x34c1cd[_0x332c('0x58')]!==_0x332c('0x67')){return _0x34c1cd;}});return _0x3748e6;}});}else{return _0x2d16f9;}}})[_0x332c('0x2a')](function(_0x5ec221){var _0x1be782=[];if(_0x5ec221){_0x453a51=_0x5ec221;for(var _0x460124=0x0;_0x460124<_0x5ec221['length'];_0x460124+=0x1){_0x453a51[_0x460124][_0x332c('0x51')]=[];_0x1be782['push'](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x465c1f['user']['id'],_0x5ec221[_0x460124]['id']],'ToId':[_0x465c1f[_0x332c('0x60')]['id'],_0x5ec221[_0x460124]['id']],'ChatGroupId':null},'attributes':['id',_0x332c('0x6a'),'FromId','ToId',_0x332c('0x6b'),_0x332c('0x4e')],'order':qs[_0x332c('0x40')](_0x332c('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x332c('0x2a')](wrapUser(_0x5ec221[_0x460124])));}return BPromise[_0x332c('0x6d')](_0x1be782);}return[];})['then'](function(_0x50ed63){return{'rows':_0x50ed63,'count':_0x50ed63[_0x332c('0x3e')]};})[_0x332c('0x2a')](respondWithResult(_0x382881,null))[_0x332c('0x49')](handleError(_0x382881,null));};
\ No newline at end of file
index d207c69..887ba9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x505e=['hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x486250,_0x316dd8){var _0x5447b2=function(_0x1d08ec){while(--_0x1d08ec){_0x486250['push'](_0x486250['shift']());}};_0x5447b2(++_0x316dd8);}(_0x505e,0x199));var _0xe505=function(_0x2f62aa,_0x108e95){_0x2f62aa=_0x2f62aa-0x0;var _0x1a341f=_0x505e[_0x2f62aa];return _0x1a341f;};'use strict';var EventEmitter=require(_0xe505('0x0'));var ChatInternalMessage=require(_0xe505('0x1'))['db'][_0xe505('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xe505('0x3')](0x0);var events={'afterCreate':_0xe505('0x4'),'afterUpdate':_0xe505('0x5'),'afterDestroy':_0xe505('0x6')};function emitEvent(_0x19b96f){return function(_0x506b4c,_0x4ec430,_0x448d81){ChatInternalMessageEvents['emit'](_0x19b96f+':'+_0x506b4c['id'],_0x506b4c);ChatInternalMessageEvents[_0xe505('0x7')](_0x19b96f,_0x506b4c);_0x448d81(null);};}for(var e in events){if(events[_0xe505('0x8')](e)){var event=events[e];ChatInternalMessage[_0xe505('0x9')](e,emitEvent(event));}}module[_0xe505('0xa')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xdd72=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1568fa,_0x3cba8d){var _0x3e433a=function(_0x4f8d57){while(--_0x4f8d57){_0x1568fa['push'](_0x1568fa['shift']());}};_0x3e433a(++_0x3cba8d);}(_0xdd72,0xb4));var _0x2dd7=function(_0x22b8a3,_0x2a79a7){_0x22b8a3=_0x22b8a3-0x0;var _0x199a0c=_0xdd72[_0x22b8a3];return _0x199a0c;};'use strict';var EventEmitter=require(_0x2dd7('0x0'));var ChatInternalMessage=require(_0x2dd7('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x2dd7('0x2')](0x0);var events={'afterCreate':_0x2dd7('0x3'),'afterUpdate':_0x2dd7('0x4'),'afterDestroy':_0x2dd7('0x5')};function emitEvent(_0x9797c4){return function(_0x16f0a4,_0x19d79b,_0x47f7c0){ChatInternalMessageEvents[_0x2dd7('0x6')](_0x9797c4+':'+_0x16f0a4['id'],_0x16f0a4);ChatInternalMessageEvents['emit'](_0x9797c4,_0x16f0a4);_0x47f7c0(null);};}for(var e in events){if(events[_0x2dd7('0x7')](e)){var event=events[e];ChatInternalMessage[_0x2dd7('0x8')](e,emitEvent(event));}}module[_0x2dd7('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
index f4b4d5a..574cf3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd856=['lodash','util','../../config/logger','bluebird','rimraf','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x252d53,_0x218794){var _0x560841=function(_0x379b11){while(--_0x379b11){_0x252d53['push'](_0x252d53['shift']());}};_0x560841(++_0x218794);}(_0xd856,0xdc));var _0x6d85=function(_0x596b3d,_0x2a6e03){_0x596b3d=_0x596b3d-0x0;var _0x53dda8=_0xd856[_0x596b3d];return _0x53dda8;};'use strict';var _=require(_0x6d85('0x0'));var util=require(_0x6d85('0x1'));var logger=require(_0x6d85('0x2'))('api');var moment=require('moment');var BPromise=require(_0x6d85('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6d85('0x4'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x6d85('0x5')]=function(_0x392ed5,_0xec8ff6){return _0x392ed5[_0x6d85('0x6')](_0x6d85('0x7'),attributes,{'tableName':_0x6d85('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6d85('0x9'),'collate':_0x6d85('0xa')});};
\ No newline at end of file
+var _0x4575=['ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4575,0x146));var _0x5457=function(_0x5698a9,_0x4ae7c7){_0x5698a9=_0x5698a9-0x0;var _0x3be696=_0x4575[_0x5698a9];return _0x3be696;};'use strict';var _=require('lodash');var util=require(_0x5457('0x0'));var logger=require(_0x5457('0x1'))(_0x5457('0x2'));var moment=require(_0x5457('0x3'));var BPromise=require(_0x5457('0x4'));var rp=require(_0x5457('0x5'));var fs=require('fs');var path=require(_0x5457('0x6'));var rimraf=require(_0x5457('0x7'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x5457('0x8')]=function(_0x2e491f,_0x508920){return _0x2e491f[_0x5457('0x9')](_0x5457('0xa'),attributes,{'tableName':_0x5457('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5457('0xc'),'collate':_0x5457('0xd')});};
\ No newline at end of file
index 76c9371..a542279 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33c1=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x33c1,0x82));var _0x133c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x33c1[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x133c('0x0'));var moment=require('moment');var BPromise=require(_0x133c('0x1'));var rs=require(_0x133c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x133c('0x3'))['db'];var utils=require(_0x133c('0x4'));var logger=require(_0x133c('0x5'))(_0x133c('0x6'));var config=require(_0x133c('0x7'));var jayson=require(_0x133c('0x8'));var client=jayson[_0x133c('0x9')][_0x133c('0xa')]({'port':0x232a});config[_0x133c('0xb')]=_[_0x133c('0xc')](config[_0x133c('0xb')],{'host':_0x133c('0xd'),'port':0x18eb});var socket=require(_0x133c('0xe'))(new Redis(config[_0x133c('0xb')]));require(_0x133c('0xf'))[_0x133c('0x10')](socket);function respondWithRpcPromise(_0x34d536,_0x515ddf,_0x2546e7){return new BPromise(function(_0x599818,_0x4a422c){return client['request'](_0x34d536,_0x2546e7)['then'](function(_0x49909b){logger['info'](_0x133c('0x11'),_0x515ddf,_0x133c('0x12'));logger[_0x133c('0x13')](_0x133c('0x14'),_0x515ddf,_0x133c('0x12'),JSON[_0x133c('0x15')](_0x49909b));if(_0x49909b[_0x133c('0x16')]){if(_0x49909b[_0x133c('0x16')][_0x133c('0x17')]===0x1f4){logger['error'](_0x133c('0x11'),_0x515ddf,_0x49909b[_0x133c('0x16')][_0x133c('0x18')]);return _0x4a422c(_0x49909b[_0x133c('0x16')][_0x133c('0x18')]);}logger[_0x133c('0x16')](_0x133c('0x11'),_0x515ddf,_0x49909b[_0x133c('0x16')][_0x133c('0x18')]);return _0x599818(_0x49909b[_0x133c('0x16')][_0x133c('0x18')]);}else{logger[_0x133c('0x19')](_0x133c('0x11'),_0x515ddf,'request\x20sent');_0x599818(_0x49909b['result'][_0x133c('0x18')]);}})['catch'](function(_0x5c43ec){logger['error'](_0x133c('0x11'),_0x515ddf,_0x5c43ec);_0x4a422c(_0x5c43ec);});});}
\ No newline at end of file
+var _0x79de=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x79de,0x1a8));var _0xe79d=function(_0x2cde50,_0x20edd8){_0x2cde50=_0x2cde50-0x0;var _0x3784e1=_0x79de[_0x2cde50];return _0x3784e1;};'use strict';var _=require(_0xe79d('0x0'));var util=require('util');var moment=require(_0xe79d('0x1'));var BPromise=require(_0xe79d('0x2'));var rs=require(_0xe79d('0x3'));var fs=require('fs');var Redis=require(_0xe79d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe79d('0x5'))(_0xe79d('0x6'));var config=require(_0xe79d('0x7'));var jayson=require(_0xe79d('0x8'));var client=jayson[_0xe79d('0x9')][_0xe79d('0xa')]({'port':0x232a});config[_0xe79d('0xb')]=_[_0xe79d('0xc')](config[_0xe79d('0xb')],{'host':_0xe79d('0xd'),'port':0x18eb});var socket=require(_0xe79d('0xe'))(new Redis(config['redis']));require(_0xe79d('0xf'))[_0xe79d('0x10')](socket);function respondWithRpcPromise(_0x1c1557,_0x34776b,_0x2de075){return new BPromise(function(_0x367821,_0x156e3b){return client[_0xe79d('0x11')](_0x1c1557,_0x2de075)[_0xe79d('0x12')](function(_0x59020d){logger[_0xe79d('0x13')](_0xe79d('0x14'),_0x34776b,_0xe79d('0x15'));logger[_0xe79d('0x16')](_0xe79d('0x17'),_0x34776b,'request\x20sent',JSON[_0xe79d('0x18')](_0x59020d));if(_0x59020d['error']){if(_0x59020d['error']['code']===0x1f4){logger[_0xe79d('0x19')](_0xe79d('0x14'),_0x34776b,_0x59020d[_0xe79d('0x19')][_0xe79d('0x1a')]);return _0x156e3b(_0x59020d[_0xe79d('0x19')][_0xe79d('0x1a')]);}logger[_0xe79d('0x19')](_0xe79d('0x14'),_0x34776b,_0x59020d['error'][_0xe79d('0x1a')]);return _0x367821(_0x59020d[_0xe79d('0x19')][_0xe79d('0x1a')]);}else{logger['info'](_0xe79d('0x14'),_0x34776b,'request\x20sent');_0x367821(_0x59020d['result'][_0xe79d('0x1a')]);}})['catch'](function(_0xf66faa){logger[_0xe79d('0x19')](_0xe79d('0x14'),_0x34776b,_0xf66faa);_0x156e3b(_0xf66faa);});});}
\ No newline at end of file
index d2f3b09..2cbf552 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3abc=['save','update','emit','removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events'];(function(_0xee6028,_0x678569){var _0x16a6cf=function(_0x14fa6a){while(--_0x14fa6a){_0xee6028['push'](_0xee6028['shift']());}};_0x16a6cf(++_0x678569);}(_0x3abc,0xa7));var _0xc3ab=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x3abc[_0xbb091];return _0x467a04;};'use strict';var ChatInternalMessageEvents=require(_0xc3ab('0x0'));var events=[_0xc3ab('0x1'),'remove',_0xc3ab('0x2')];function createListener(_0x171e80,_0x8f288e){return function(_0x153585){_0x8f288e[_0xc3ab('0x3')](_0x171e80,_0x153585);};}function removeListener(_0x163849,_0x59e4a7){return function(){ChatInternalMessageEvents[_0xc3ab('0x4')](_0x163849,_0x59e4a7);};}exports[_0xc3ab('0x5')]=function(_0x379e74){for(var _0xcfbff=0x0,_0x59e51f=events[_0xc3ab('0x6')];_0xcfbff<_0x59e51f;_0xcfbff++){var _0x3c901e=events[_0xcfbff];var _0x2be4a4=createListener(_0xc3ab('0x7')+_0x3c901e,_0x379e74);ChatInternalMessageEvents['on'](_0x3c901e,_0x2be4a4);}};
\ No newline at end of file
+var _0x8f83=['update','emit','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0x27913f,_0x48d80f){var _0x57d3f1=function(_0x21fdb9){while(--_0x21fdb9){_0x27913f['push'](_0x27913f['shift']());}};_0x57d3f1(++_0x48d80f);}(_0x8f83,0xad));var _0x38f8=function(_0x5c46c0,_0x56e2be){_0x5c46c0=_0x5c46c0-0x0;var _0x11e66f=_0x8f83[_0x5c46c0];return _0x11e66f;};'use strict';var ChatInternalMessageEvents=require(_0x38f8('0x0'));var events=[_0x38f8('0x1'),_0x38f8('0x2'),_0x38f8('0x3')];function createListener(_0x3edb79,_0x4bf2bb){return function(_0x14b9c8){_0x4bf2bb[_0x38f8('0x4')](_0x3edb79,_0x14b9c8);};}function removeListener(_0x272889,_0x9ce326){return function(){ChatInternalMessageEvents['removeListener'](_0x272889,_0x9ce326);};}exports[_0x38f8('0x5')]=function(_0x2a1621){for(var _0x30cf9c=0x0,_0x2e9819=events[_0x38f8('0x6')];_0x30cf9c<_0x2e9819;_0x30cf9c++){var _0x35401e=events[_0x30cf9c];var _0x5d7ae2=createListener(_0x38f8('0x7')+_0x35401e,_0x2a1621);ChatInternalMessageEvents['on'](_0x35401e,_0x5d7ae2);}};
\ No newline at end of file
index f17312a..587b331 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x914d=['isAuthenticated','/describe','describe','/users','getUsers','show','post','create','put','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','get'];(function(_0x6dfbaa,_0x31eede){var _0xfbe02=function(_0x4adcaf){while(--_0x4adcaf){_0x6dfbaa['push'](_0x6dfbaa['shift']());}};_0xfbe02(++_0x31eede);}(_0x914d,0x1f0));var _0xd914=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x914d[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0xd914('0x0'));var util=require(_0xd914('0x1'));var path=require('path');var timeout=require(_0xd914('0x2'));var express=require(_0xd914('0x3'));var router=express[_0xd914('0x4')]();var fs_extra=require(_0xd914('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd914('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xd914('0x7')]('/',auth[_0xd914('0x8')](),controller['index']);router['get'](_0xd914('0x9'),auth[_0xd914('0x8')](),controller[_0xd914('0xa')]);router[_0xd914('0x7')](_0xd914('0xb'),auth[_0xd914('0x8')](),controller[_0xd914('0xc')]);router[_0xd914('0x7')]('/:id',auth[_0xd914('0x8')](),controller[_0xd914('0xd')]);router[_0xd914('0xe')]('/',auth['isAuthenticated'](),controller[_0xd914('0xf')]);router[_0xd914('0x10')](_0xd914('0x11'),controller[_0xd914('0x12')]);router[_0xd914('0x13')](_0xd914('0x11'),auth[_0xd914('0x8')](),controller[_0xd914('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x54e4=['post','create','put','update','delete','exports','multer','express','Router','fs-extra','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show'];(function(_0x317ab1,_0x42dcd6){var _0x7488db=function(_0x4e6d1f){while(--_0x4e6d1f){_0x317ab1['push'](_0x317ab1['shift']());}};_0x7488db(++_0x42dcd6);}(_0x54e4,0x156));var _0x454e=function(_0x185cfe,_0x50f560){_0x185cfe=_0x185cfe-0x0;var _0x106262=_0x54e4[_0x185cfe];return _0x106262;};'use strict';var multer=require(_0x454e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x454e('0x1'));var router=express[_0x454e('0x2')]();var fs_extra=require(_0x454e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x454e('0x4'));var config=require('../../config/environment');var controller=require(_0x454e('0x5'));router[_0x454e('0x6')]('/',auth[_0x454e('0x7')](),controller[_0x454e('0x8')]);router[_0x454e('0x6')](_0x454e('0x9'),auth[_0x454e('0x7')](),controller[_0x454e('0xa')]);router[_0x454e('0x6')](_0x454e('0xb'),auth[_0x454e('0x7')](),controller[_0x454e('0xc')]);router[_0x454e('0x6')](_0x454e('0xd'),auth['isAuthenticated'](),controller[_0x454e('0xe')]);router[_0x454e('0xf')]('/',auth[_0x454e('0x7')](),controller[_0x454e('0x10')]);router[_0x454e('0x11')](_0x454e('0xd'),controller[_0x454e('0x12')]);router[_0x454e('0x13')]('/:id',auth[_0x454e('0x7')](),controller['destroy']);module[_0x454e('0x14')]=router;
\ No newline at end of file
index b142dd0..71cc9e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2ab=['BOOLEAN','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x3ccfea,_0x44ffb3){var _0x3a530f=function(_0x7c4323){while(--_0x7c4323){_0x3ccfea['push'](_0x3ccfea['shift']());}};_0x3a530f(++_0x44ffb3);}(_0xe2ab,0xc4));var _0xbe2a=function(_0x384076,_0x491e1c){_0x384076=_0x384076-0x0;var _0x1d8f5d=_0xe2ab[_0x384076];return _0x1d8f5d;};'use strict';var Sequelize=require(_0xbe2a('0x0'));module[_0xbe2a('0x1')]={'body':{'type':Sequelize[_0xbe2a('0x2')](_0xbe2a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xbe2a('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xbe2a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xbe2a('0x5')),'defaultValue':_0xbe2a('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xbe2a('0x6')]},'providerName':{'type':Sequelize[_0xbe2a('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x0fd9=['DATE','STRING','exports','TEXT','medium','BOOLEAN','out'];(function(_0x4711fc,_0x31742c){var _0x4c1eaf=function(_0x1f4b2d){while(--_0x1f4b2d){_0x4711fc['push'](_0x4711fc['shift']());}};_0x4c1eaf(++_0x31742c);}(_0x0fd9,0xa3));var _0x90fd=function(_0x299784,_0xb0918f){_0x299784=_0x299784-0x0;var _0x5ab008=_0x0fd9[_0x299784];return _0x5ab008;};'use strict';var Sequelize=require('sequelize');module[_0x90fd('0x0')]={'body':{'type':Sequelize[_0x90fd('0x1')](_0x90fd('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x90fd('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x90fd('0x4')),'defaultValue':_0x90fd('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x90fd('0x5')]},'providerName':{'type':Sequelize[_0x90fd('0x6')]},'providerResponse':{'type':Sequelize[_0x90fd('0x1')]}};
\ No newline at end of file
index e93f44c..dec60dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe18=['acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','SELECT','contact','User','agent','fullname','email','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','sequelize','Sequelize','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','register','jayson/promise','http','client','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','stack','send','index','map','ChatMessage','rawAttributes','type','key','name','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','update','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage'];(function(_0x2c0be1,_0x1e88f2){var _0x3d4bd2=function(_0x2b5497){while(--_0x2b5497){_0x2c0be1['push'](_0x2c0be1['shift']());}};_0x3d4bd2(++_0x1e88f2);}(_0xfe18,0x1b5));var _0x8fe1=function(_0x52cc68,_0x440163){_0x52cc68=_0x52cc68-0x0;var _0x572cd4=_0xfe18[_0x52cc68];return _0x572cd4;};'use strict';var emlformat=require(_0x8fe1('0x0'));var rimraf=require(_0x8fe1('0x1'));var zipdir=require(_0x8fe1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8fe1('0x3'));var moment=require(_0x8fe1('0x4'));var BPromise=require(_0x8fe1('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8fe1('0x6'));var sox=require(_0x8fe1('0x7'));var csv=require(_0x8fe1('0x8'));var ejs=require(_0x8fe1('0x9'));var fs=require('fs');var fs_extra=require(_0x8fe1('0xa'));var _=require('lodash');var squel=require(_0x8fe1('0xb'));var crypto=require(_0x8fe1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8fe1('0xd'));var toCsv=require(_0x8fe1('0x8'));var querystring=require(_0x8fe1('0xe'));var Papa=require(_0x8fe1('0xf'));var Redis=require(_0x8fe1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8fe1('0x11'));var as=require(_0x8fe1('0x12'));var hardwareService=require(_0x8fe1('0x13'));var logger=require(_0x8fe1('0x14'))(_0x8fe1('0x15'));var utils=require(_0x8fe1('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8fe1('0x17'));var db=require(_0x8fe1('0x18'))['db'];config[_0x8fe1('0x19')]=_[_0x8fe1('0x1a')](config[_0x8fe1('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x8fe1('0x1b'))(new Redis(config[_0x8fe1('0x19')]));require(_0x8fe1('0x1c'))[_0x8fe1('0x1d')](socket);var jayson=require(_0x8fe1('0x1e'));var client=jayson['client'][_0x8fe1('0x1f')]({'port':0x232c});var client9002=jayson[_0x8fe1('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x365368,_0x492dc1,_0x4ccdf4,_0x384799){return new BPromise(function(_0x4347f4,_0x1f6b80){var _0x3e047e=_0x384799||client;return _0x3e047e[_0x8fe1('0x21')](_0x365368,_0x4ccdf4)[_0x8fe1('0x22')](function(_0x52e65f){logger[_0x8fe1('0x23')](_0x8fe1('0x24'),_0x492dc1,_0x8fe1('0x25'));logger[_0x8fe1('0x26')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x492dc1,_0x8fe1('0x25'),JSON['stringify'](_0x52e65f));if(_0x52e65f['error']){if(_0x52e65f[_0x8fe1('0x27')][_0x8fe1('0x28')]===0x1f4){logger[_0x8fe1('0x27')](_0x8fe1('0x24'),_0x492dc1,_0x52e65f[_0x8fe1('0x27')][_0x8fe1('0x29')]);return _0x1f6b80(_0x52e65f[_0x8fe1('0x27')][_0x8fe1('0x29')]);}logger['error'](_0x8fe1('0x24'),_0x492dc1,_0x52e65f[_0x8fe1('0x27')][_0x8fe1('0x29')]);return _0x4347f4(_0x52e65f[_0x8fe1('0x27')][_0x8fe1('0x29')]);}else{logger[_0x8fe1('0x23')](_0x8fe1('0x24'),_0x492dc1,'request\x20sent');_0x4347f4(_0x52e65f['result'][_0x8fe1('0x29')]);}})['catch'](function(_0x384cc0){logger[_0x8fe1('0x27')](_0x8fe1('0x24'),_0x492dc1,_0x384cc0);_0x1f6b80(_0x384cc0);});});}function respondWithStatusCode(_0x53ad2e,_0x7a0bba){_0x7a0bba=_0x7a0bba||0xcc;return function(_0x5cb0e3){if(_0x5cb0e3){return _0x53ad2e[_0x8fe1('0x2a')](_0x7a0bba);}return _0x53ad2e['status'](_0x7a0bba)[_0x8fe1('0x2b')]();};}function respondWithResult(_0x4fb99a,_0xc11967){_0xc11967=_0xc11967||0xc8;return function(_0x73f7de){if(_0x73f7de){return _0x4fb99a[_0x8fe1('0x2c')](_0xc11967)['json'](_0x73f7de);}};}function respondWithFilteredResult(_0x56a6bc,_0x391bf1){return function(_0x2aa19c){if(_0x2aa19c){var _0x2442e3=typeof _0x391bf1[_0x8fe1('0x2d')]===_0x8fe1('0x2e')&&typeof _0x391bf1[_0x8fe1('0x2f')]===_0x8fe1('0x2e');var _0x1532e2=_0x2aa19c[_0x8fe1('0x30')];var _0x35256d=_0x2442e3?0x0:_0x391bf1[_0x8fe1('0x2d')];var _0x2fb21f=_0x2442e3?_0x2aa19c['count']:_0x391bf1[_0x8fe1('0x2d')]+_0x391bf1['limit'];var _0x2a2985;if(_0x2fb21f>=_0x1532e2){_0x2fb21f=_0x1532e2;_0x2a2985=0xc8;}else{_0x2a2985=0xce;}_0x56a6bc[_0x8fe1('0x2c')](_0x2a2985);return _0x56a6bc[_0x8fe1('0x31')](_0x8fe1('0x32'),_0x35256d+'-'+_0x2fb21f+'/'+_0x1532e2)[_0x8fe1('0x33')](_0x2aa19c);}return null;};}function patchUpdates(_0x1bede1){return function(_0x5d0ae2){try{jsonpatch[_0x8fe1('0x34')](_0x5d0ae2,_0x1bede1,!![]);}catch(_0x44804d){return BPromise[_0x8fe1('0x35')](_0x44804d);}return _0x5d0ae2[_0x8fe1('0x36')]();};}function saveUpdates(_0x18f437,_0x41cf52){return function(_0x1280da){if(_0x1280da){return _0x1280da['update'](_0x18f437)[_0x8fe1('0x22')](function(_0x2089ac){return _0x2089ac;});}return null;};}function removeEntity(_0x435a99,_0x4b5f2c){return function(_0x3536d5){if(_0x3536d5){return _0x3536d5[_0x8fe1('0x37')]()[_0x8fe1('0x22')](function(){_0x435a99[_0x8fe1('0x2c')](0xcc)[_0x8fe1('0x2b')]();});}};}function handleEntityNotFound(_0x3f6a1b,_0x3bdad7){return function(_0x322826){if(!_0x322826){_0x3f6a1b[_0x8fe1('0x2a')](0x194);}return _0x322826;};}function handleError(_0x4a7d81,_0x8447cc){_0x8447cc=_0x8447cc||0x1f4;return function(_0x9382ff){logger[_0x8fe1('0x27')](_0x9382ff[_0x8fe1('0x38')]);if(_0x9382ff['name']){delete _0x9382ff['name'];}_0x4a7d81[_0x8fe1('0x2c')](_0x8447cc)[_0x8fe1('0x39')](_0x9382ff);};}exports[_0x8fe1('0x3a')]=function(_0x3ca9ca,_0x48cd57){var _0x22cfee={},_0x214deb={},_0x479add={'count':0x0,'rows':[]};var _0xaff71d=_[_0x8fe1('0x3b')](db[_0x8fe1('0x3c')][_0x8fe1('0x3d')],function(_0x33c0e1){return{'name':_0x33c0e1['fieldName'],'type':_0x33c0e1[_0x8fe1('0x3e')][_0x8fe1('0x3f')]};});_0x214deb['model']=_[_0x8fe1('0x3b')](_0xaff71d,_0x8fe1('0x40'));_0x214deb[_0x8fe1('0x41')]=_['keys'](_0x3ca9ca[_0x8fe1('0x41')]);_0x214deb[_0x8fe1('0x42')]=_[_0x8fe1('0x43')](_0x214deb[_0x8fe1('0x44')],_0x214deb['query']);_0x22cfee[_0x8fe1('0x45')]=_['intersection'](_0x214deb['model'],qs[_0x8fe1('0x46')](_0x3ca9ca[_0x8fe1('0x41')]['fields']));_0x22cfee[_0x8fe1('0x45')]=_0x22cfee[_0x8fe1('0x45')][_0x8fe1('0x47')]?_0x22cfee[_0x8fe1('0x45')]:_0x214deb[_0x8fe1('0x44')];if(!_0x3ca9ca[_0x8fe1('0x41')][_0x8fe1('0x48')]('nolimit')){_0x22cfee['limit']=qs['limit'](_0x3ca9ca[_0x8fe1('0x41')][_0x8fe1('0x2f')]);_0x22cfee[_0x8fe1('0x2d')]=qs['offset'](_0x3ca9ca[_0x8fe1('0x41')][_0x8fe1('0x2d')]);}_0x22cfee[_0x8fe1('0x49')]=qs['sort'](_0x3ca9ca['query']['sort']);_0x22cfee[_0x8fe1('0x4a')]=qs[_0x8fe1('0x42')](_[_0x8fe1('0x4b')](_0x3ca9ca['query'],_0x214deb[_0x8fe1('0x42')]),_0xaff71d);if(_0x3ca9ca[_0x8fe1('0x41')][_0x8fe1('0x4c')]){_0x22cfee[_0x8fe1('0x4a')]=_['merge'](_0x22cfee[_0x8fe1('0x4a')],{'$or':_['map'](_0xaff71d,function(_0x134028){if(_0x134028[_0x8fe1('0x3e')]!==_0x8fe1('0x4d')){var _0x128ec2={};_0x128ec2[_0x134028[_0x8fe1('0x40')]]={'$like':'%'+_0x3ca9ca['query'][_0x8fe1('0x4c')]+'%'};return _0x128ec2;}})});}_0x22cfee=_[_0x8fe1('0x4e')]({},_0x22cfee,_0x3ca9ca[_0x8fe1('0x4f')]);var _0x20d34d={'where':_0x22cfee[_0x8fe1('0x4a')]};return db['ChatMessage'][_0x8fe1('0x30')](_0x20d34d)['then'](function(_0x3bb7fb){_0x479add[_0x8fe1('0x30')]=_0x3bb7fb;if(_0x3ca9ca[_0x8fe1('0x41')]['includeAll']){_0x22cfee[_0x8fe1('0x50')]=[{'all':!![]}];}return db['ChatMessage'][_0x8fe1('0x51')](_0x22cfee);})[_0x8fe1('0x22')](function(_0x385f98){_0x479add[_0x8fe1('0x52')]=_0x385f98;return _0x479add;})[_0x8fe1('0x22')](respondWithFilteredResult(_0x48cd57,_0x22cfee))[_0x8fe1('0x53')](handleError(_0x48cd57,null));};exports[_0x8fe1('0x54')]=function(_0x4d37fc,_0x16754f){var _0x2054ad={'raw':!![],'where':{'id':_0x4d37fc[_0x8fe1('0x55')]['id']}},_0x34668c={};_0x34668c[_0x8fe1('0x44')]=_['keys'](db[_0x8fe1('0x3c')]['rawAttributes']);_0x34668c['query']=_['keys'](_0x4d37fc[_0x8fe1('0x41')]);_0x34668c[_0x8fe1('0x42')]=_['intersection'](_0x34668c[_0x8fe1('0x44')],_0x34668c[_0x8fe1('0x41')]);_0x2054ad[_0x8fe1('0x45')]=_['intersection'](_0x34668c['model'],qs[_0x8fe1('0x46')](_0x4d37fc[_0x8fe1('0x41')][_0x8fe1('0x46')]));_0x2054ad[_0x8fe1('0x45')]=_0x2054ad[_0x8fe1('0x45')][_0x8fe1('0x47')]?_0x2054ad[_0x8fe1('0x45')]:_0x34668c[_0x8fe1('0x44')];if(_0x4d37fc[_0x8fe1('0x41')][_0x8fe1('0x56')]){_0x2054ad[_0x8fe1('0x50')]=[{'all':!![]}];}_0x2054ad=_[_0x8fe1('0x4e')]({},_0x2054ad,_0x4d37fc[_0x8fe1('0x4f')]);return db[_0x8fe1('0x3c')][_0x8fe1('0x57')](_0x2054ad)[_0x8fe1('0x22')](handleEntityNotFound(_0x16754f,null))[_0x8fe1('0x22')](respondWithResult(_0x16754f,null))[_0x8fe1('0x53')](handleError(_0x16754f,null));};exports[_0x8fe1('0x58')]=function(_0x7d4aac,_0x47dc58){return db[_0x8fe1('0x3c')][_0x8fe1('0x58')](_0x7d4aac[_0x8fe1('0x59')],{})[_0x8fe1('0x22')](respondWithResult(_0x47dc58,0xc9))[_0x8fe1('0x53')](handleError(_0x47dc58,null));};exports[_0x8fe1('0x5a')]=function(_0x320a84,_0x242e14){if(_0x320a84[_0x8fe1('0x59')]['id']){delete _0x320a84[_0x8fe1('0x59')]['id'];}return db[_0x8fe1('0x3c')][_0x8fe1('0x57')]({'where':{'id':_0x320a84['params']['id']}})[_0x8fe1('0x22')](handleEntityNotFound(_0x242e14,null))[_0x8fe1('0x22')](saveUpdates(_0x320a84[_0x8fe1('0x59')],null))[_0x8fe1('0x22')](respondWithResult(_0x242e14,null))['catch'](handleError(_0x242e14,null));};exports[_0x8fe1('0x37')]=function(_0x1c3d58,_0x44480){return db[_0x8fe1('0x3c')][_0x8fe1('0x57')]({'where':{'id':_0x1c3d58[_0x8fe1('0x55')]['id']}})['then'](handleEntityNotFound(_0x44480,null))[_0x8fe1('0x22')](removeEntity(_0x44480,null))['catch'](handleError(_0x44480,null));};exports[_0x8fe1('0x5b')]=function(_0x4684c2,_0x36c6d1){return db[_0x8fe1('0x3c')][_0x8fe1('0x5b')]()[_0x8fe1('0x22')](respondWithResult(_0x36c6d1,null))[_0x8fe1('0x53')](handleError(_0x36c6d1,null));};var interaction_log=require(_0x8fe1('0x14'))(_0x8fe1('0x5c'));exports[_0x8fe1('0x5d')]=function(_0x3ce5ca,_0x2ded18,_0x2eabe3){var _0x43e12f={'agent':{},'channel':_0x8fe1('0x5e')};if(_0x3ce5ca[_0x8fe1('0x59')]['id']){delete _0x3ce5ca['body']['id'];}_0x3ce5ca['body'][_0x8fe1('0x5f')]=!![];_0x3ce5ca[_0x8fe1('0x59')][_0x8fe1('0x60')]=moment()[_0x8fe1('0x61')](_0x8fe1('0x62'));_0x3ce5ca['body'][_0x8fe1('0x63')]=_0x3ce5ca[_0x8fe1('0x59')][_0x8fe1('0x63')]||_0x3ce5ca[_0x8fe1('0x64')]['id'];_0x43e12f['agent']['id']=_0x3ce5ca[_0x8fe1('0x59')][_0x8fe1('0x63')];return db[_0x8fe1('0x3c')]['find']({'where':{'id':_0x3ce5ca[_0x8fe1('0x55')]['id'],'UserId':null}})[_0x8fe1('0x22')](handleEntityNotFound(_0x2ded18,null))[_0x8fe1('0x22')](saveUpdates(_0x3ce5ca['body'],null))[_0x8fe1('0x22')](function(_0x352ebf){if(_0x352ebf){_0x43e12f[_0x8fe1('0x29')]=_0x352ebf[_0x8fe1('0x65')]({'plain':!![]});return db[_0x8fe1('0x66')][_0x8fe1('0x57')]({'where':{'id':_0x352ebf[_0x8fe1('0x67')]}});}return null;})[_0x8fe1('0x22')](handleEntityNotFound(_0x2ded18,null))[_0x8fe1('0x22')](function(_0xc3b6af){if(_0xc3b6af){return _0xc3b6af[_0x8fe1('0x5a')]({'UserId':_0x3ce5ca[_0x8fe1('0x59')][_0x8fe1('0x63')],'read1stAt':_[_0x8fe1('0x68')](_0xc3b6af[_0x8fe1('0x69')])?moment()[_0x8fe1('0x61')](_0x8fe1('0x62')):undefined});}return null;})[_0x8fe1('0x22')](function(_0x5946d0){if(_0x5946d0){_0x43e12f[_0x8fe1('0x6a')]=_0x5946d0[_0x8fe1('0x65')]({'plain':!![]});interaction_log['info'](_0x8fe1('0x6b'),_0x3ce5ca[_0x8fe1('0x64')]['id'],_0x3ce5ca[_0x8fe1('0x64')][_0x8fe1('0x40')],_0x3ce5ca[_0x8fe1('0x64')]['role'],_0x43e12f[_0x8fe1('0x6a')]['id'],_0x3ce5ca[_0x8fe1('0x59')]?JSON[_0x8fe1('0x6c')](_0x3ce5ca[_0x8fe1('0x59')]):_0x8fe1('0x6d'));return respondWithRpcPromise(_0x8fe1('0x6e'),_0x8fe1('0x6f'),_0x43e12f);}return null;})['then'](function(_0x226b14){var _0x45918b=_0x8fe1('0x70')+_0x226b14['message'][_0x8fe1('0x71')];return db['sequelize'][_0x8fe1('0x41')](_0x45918b,{'type':db['Sequelize'][_0x8fe1('0x72')][_0x8fe1('0x73')],'raw':!![]})[_0x8fe1('0x22')](function(_0x1f502b){return _0x1f502b;});})['then'](function(_0x1f1208){if(_0x1f1208){_0x43e12f[_0x8fe1('0x29')][_0x8fe1('0x74')]=_0x1f1208[0x0];if(!_0x3ce5ca['body']['UserId'])return;return db[_0x8fe1('0x75')][_0x8fe1('0x57')]({'where':{'id':_0x3ce5ca['body'][_0x8fe1('0x63')],'role':_0x8fe1('0x76')},'attributes':['id','name',_0x8fe1('0x77'),_0x8fe1('0x78'),_0x8fe1('0x79')],'raw':!![]});}return null;})['then'](function(_0x3f0b1d){if(!_0x3f0b1d)return null;_0x43e12f[_0x8fe1('0x29')]['agent']=_0x3f0b1d;return _0x43e12f;})[_0x8fe1('0x22')](function(_0x454b80){if(_0x454b80){if(_0x3ce5ca[_0x8fe1('0x59')][_0x8fe1('0x7a')]){_0x43e12f[_0x8fe1('0x29')][_0x8fe1('0x7b')]=util[_0x8fe1('0x61')](_0x8fe1('0x7c'),_0x3ce5ca[_0x8fe1('0x64')][_0x8fe1('0x40')]);_0x43e12f['message'][_0x8fe1('0x7d')]=_0x43e12f[_0x8fe1('0x7d')];_0x43e12f['message']['motionChannel']=_0x43e12f['channel'];_0x43e12f[_0x8fe1('0x29')][_0x8fe1('0x7e')]=_0x8fe1('0x5d');return respondWithRpcPromise('EventManager',_0x8fe1('0x7f'),{'event':_0x8fe1('0x80'),'message':_[_0x8fe1('0x4e')](_0x43e12f[_0x8fe1('0x29')],JSON[_0x8fe1('0x81')](_0x43e12f[_0x8fe1('0x6a')][_0x8fe1('0x82')]))},client9002)[_0x8fe1('0x22')](function(){return _0x43e12f;});}return _0x43e12f;}return null;})[_0x8fe1('0x22')](respondWithResult(_0x2ded18,null))['catch'](handleError(_0x2ded18,null));};var interaction_log=require(_0x8fe1('0x14'))(_0x8fe1('0x5c'));exports['reject']=function(_0x4190dc,_0x255f82,_0x277596){var _0x4fd80b={'agent':{},'channel':_0x8fe1('0x5e')};if(_0x4190dc['body']['id']){delete _0x4190dc['body']['id'];}_0x4190dc[_0x8fe1('0x59')][_0x8fe1('0x63')]=_0x4190dc[_0x8fe1('0x59')][_0x8fe1('0x63')]||_0x4190dc[_0x8fe1('0x64')]['id'];_0x4fd80b[_0x8fe1('0x76')]['id']=_0x4190dc[_0x8fe1('0x59')][_0x8fe1('0x63')];return db[_0x8fe1('0x3c')]['find']({'where':{'id':_0x4190dc['params']['id'],'UserId':null}})[_0x8fe1('0x22')](handleEntityNotFound(_0x255f82,null))[_0x8fe1('0x22')](function(_0x1aa30c){if(_0x1aa30c){_0x4fd80b[_0x8fe1('0x29')]=_0x1aa30c[_0x8fe1('0x65')]({'plain':!![]});return db[_0x8fe1('0x66')][_0x8fe1('0x57')]({'where':{'id':_0x1aa30c[_0x8fe1('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x255f82,null))[_0x8fe1('0x22')](function(_0x1b3a0d){if(_0x1b3a0d){_0x4fd80b['interaction']=_0x1b3a0d[_0x8fe1('0x65')]({'plain':!![]});interaction_log['info'](_0x8fe1('0x83'),_0x4190dc[_0x8fe1('0x64')]['id'],_0x4190dc[_0x8fe1('0x64')]['name'],_0x4190dc[_0x8fe1('0x64')][_0x8fe1('0x84')],_0x4fd80b[_0x8fe1('0x6a')]['id'],_0x4190dc[_0x8fe1('0x59')]?JSON[_0x8fe1('0x6c')](_0x4190dc['body']):_0x8fe1('0x6d'));return respondWithRpcPromise(_0x8fe1('0x85'),'rejectMessage',_0x4fd80b);}return null;})[_0x8fe1('0x22')](function(_0x3f0efe){var _0x5bd448=_0x8fe1('0x70')+_0x3f0efe['message']['ContactId'];return db[_0x8fe1('0x86')][_0x8fe1('0x41')](_0x5bd448,{'type':db[_0x8fe1('0x87')][_0x8fe1('0x72')][_0x8fe1('0x73')],'raw':!![]})[_0x8fe1('0x22')](function(_0x2f52d9){return _0x2f52d9;});})[_0x8fe1('0x22')](function(_0x1a38b7){if(_0x1a38b7){_0x4fd80b['message']['contact']=_0x1a38b7[0x0];if(!_0x4190dc[_0x8fe1('0x59')][_0x8fe1('0x63')])return;return db['User'][_0x8fe1('0x57')]({'where':{'id':_0x4190dc[_0x8fe1('0x59')][_0x8fe1('0x63')],'role':'agent'},'attributes':['id','name',_0x8fe1('0x77'),_0x8fe1('0x78'),_0x8fe1('0x79')],'raw':!![]});}return null;})['then'](function(_0xe0ed34){if(!_0xe0ed34)return null;_0x4fd80b[_0x8fe1('0x29')][_0x8fe1('0x76')]=_0xe0ed34;return _0x4fd80b;})[_0x8fe1('0x22')](function(_0x5f0d4d){if(_0x5f0d4d){_0x5f0d4d['message'][_0x8fe1('0x7b')]=util[_0x8fe1('0x61')](_0x8fe1('0x7c'),_0x4190dc['user']['name']);_0x5f0d4d[_0x8fe1('0x29')][_0x8fe1('0x7d')]=_0x4fd80b[_0x8fe1('0x7d')];_0x5f0d4d[_0x8fe1('0x29')]['motionChannel']=_0x4fd80b[_0x8fe1('0x7d')];_0x5f0d4d[_0x8fe1('0x29')][_0x8fe1('0x7e')]=_0x8fe1('0x35');respondWithRpcPromise(_0x8fe1('0x7f'),_0x8fe1('0x7f'),{'event':_0x8fe1('0x88'),'message':_[_0x8fe1('0x4e')](_0x4fd80b[_0x8fe1('0x29')],JSON['parse'](_0x4fd80b['interaction']['formData']))},client9002);return _0x4fd80b;}return null;})[_0x8fe1('0x22')](respondWithResult(_0x255f82,null))['catch'](handleError(_0x255f82,null));};
\ No newline at end of file
+var _0xfc72=['readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','reject','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','Sequelize','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','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','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','count','limit','set','apply','save','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','update','describe','chat-interactions','accept','read'];(function(_0x4a21a9,_0x418f4c){var _0x28c8ab=function(_0x4726b2){while(--_0x4726b2){_0x4a21a9['push'](_0x4a21a9['shift']());}};_0x28c8ab(++_0x418f4c);}(_0xfc72,0x146));var _0x2fc7=function(_0x44b3f6,_0x2f0b79){_0x44b3f6=_0x44b3f6-0x0;var _0x4a6207=_0xfc72[_0x44b3f6];return _0x4a6207;};'use strict';var emlformat=require(_0x2fc7('0x0'));var rimraf=require(_0x2fc7('0x1'));var zipdir=require(_0x2fc7('0x2'));var jsonpatch=require(_0x2fc7('0x3'));var rp=require(_0x2fc7('0x4'));var moment=require(_0x2fc7('0x5'));var BPromise=require(_0x2fc7('0x6'));var Mustache=require(_0x2fc7('0x7'));var util=require('util');var path=require('path');var sox=require(_0x2fc7('0x8'));var csv=require('to-csv');var ejs=require(_0x2fc7('0x9'));var fs=require('fs');var fs_extra=require(_0x2fc7('0xa'));var _=require(_0x2fc7('0xb'));var squel=require(_0x2fc7('0xc'));var crypto=require(_0x2fc7('0xd'));var jsforce=require(_0x2fc7('0xe'));var deskjs=require(_0x2fc7('0xf'));var toCsv=require(_0x2fc7('0x10'));var querystring=require('querystring');var Papa=require(_0x2fc7('0x11'));var Redis=require(_0x2fc7('0x12'));var authService=require(_0x2fc7('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2fc7('0x14'));var hardwareService=require(_0x2fc7('0x15'));var logger=require(_0x2fc7('0x16'))(_0x2fc7('0x17'));var utils=require(_0x2fc7('0x18'));var config=require(_0x2fc7('0x19'));var licenseUtil=require(_0x2fc7('0x1a'));var db=require(_0x2fc7('0x1b'))['db'];config[_0x2fc7('0x1c')]=_[_0x2fc7('0x1d')](config['redis'],{'host':_0x2fc7('0x1e'),'port':0x18eb});var socket=require(_0x2fc7('0x1f'))(new Redis(config[_0x2fc7('0x1c')]));require('./chatMessage.socket')['register'](socket);var jayson=require(_0x2fc7('0x20'));var client=jayson[_0x2fc7('0x21')][_0x2fc7('0x22')]({'port':0x232c});var client9002=jayson[_0x2fc7('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16cbca,_0xa03d0c,_0x57b8fa,_0x2e718b){return new BPromise(function(_0x4a6dce,_0x1624d3){var _0x3d3380=_0x2e718b||client;return _0x3d3380[_0x2fc7('0x23')](_0x16cbca,_0x57b8fa)[_0x2fc7('0x24')](function(_0x46fa21){logger[_0x2fc7('0x25')]('ChatMessage,\x20%s,\x20%s',_0xa03d0c,_0x2fc7('0x26'));logger[_0x2fc7('0x27')](_0x2fc7('0x28'),_0xa03d0c,_0x2fc7('0x26'),JSON[_0x2fc7('0x29')](_0x46fa21));if(_0x46fa21[_0x2fc7('0x2a')]){if(_0x46fa21[_0x2fc7('0x2a')][_0x2fc7('0x2b')]===0x1f4){logger['error'](_0x2fc7('0x2c'),_0xa03d0c,_0x46fa21[_0x2fc7('0x2a')][_0x2fc7('0x2d')]);return _0x1624d3(_0x46fa21[_0x2fc7('0x2a')][_0x2fc7('0x2d')]);}logger[_0x2fc7('0x2a')](_0x2fc7('0x2c'),_0xa03d0c,_0x46fa21[_0x2fc7('0x2a')][_0x2fc7('0x2d')]);return _0x4a6dce(_0x46fa21[_0x2fc7('0x2a')]['message']);}else{logger[_0x2fc7('0x25')](_0x2fc7('0x2c'),_0xa03d0c,'request\x20sent');_0x4a6dce(_0x46fa21[_0x2fc7('0x2e')][_0x2fc7('0x2d')]);}})[_0x2fc7('0x2f')](function(_0x4523d2){logger[_0x2fc7('0x2a')](_0x2fc7('0x2c'),_0xa03d0c,_0x4523d2);_0x1624d3(_0x4523d2);});});}function respondWithStatusCode(_0x1844b3,_0x116d95){_0x116d95=_0x116d95||0xcc;return function(_0x79dd1b){if(_0x79dd1b){return _0x1844b3['sendStatus'](_0x116d95);}return _0x1844b3[_0x2fc7('0x30')](_0x116d95)[_0x2fc7('0x31')]();};}function respondWithResult(_0x40f2b2,_0x48a72c){_0x48a72c=_0x48a72c||0xc8;return function(_0x1afdba){if(_0x1afdba){return _0x40f2b2[_0x2fc7('0x30')](_0x48a72c)[_0x2fc7('0x32')](_0x1afdba);}};}function respondWithFilteredResult(_0x13eabb,_0x5b12ff){return function(_0x15bd17){if(_0x15bd17){var _0x227729=typeof _0x5b12ff[_0x2fc7('0x33')]===_0x2fc7('0x34')&&typeof _0x5b12ff['limit']===_0x2fc7('0x34');var _0x4b2bd5=_0x15bd17[_0x2fc7('0x35')];var _0x24a200=_0x227729?0x0:_0x5b12ff[_0x2fc7('0x33')];var _0x50bbc8=_0x227729?_0x15bd17[_0x2fc7('0x35')]:_0x5b12ff[_0x2fc7('0x33')]+_0x5b12ff[_0x2fc7('0x36')];var _0x26e92a;if(_0x50bbc8>=_0x4b2bd5){_0x50bbc8=_0x4b2bd5;_0x26e92a=0xc8;}else{_0x26e92a=0xce;}_0x13eabb[_0x2fc7('0x30')](_0x26e92a);return _0x13eabb[_0x2fc7('0x37')]('Content-Range',_0x24a200+'-'+_0x50bbc8+'/'+_0x4b2bd5)[_0x2fc7('0x32')](_0x15bd17);}return null;};}function patchUpdates(_0x4c4650){return function(_0x194fc6){try{jsonpatch[_0x2fc7('0x38')](_0x194fc6,_0x4c4650,!![]);}catch(_0x1cfc70){return BPromise['reject'](_0x1cfc70);}return _0x194fc6[_0x2fc7('0x39')]();};}function saveUpdates(_0xeebe7d,_0x8391c8){return function(_0x2c05d0){if(_0x2c05d0){return _0x2c05d0['update'](_0xeebe7d)[_0x2fc7('0x24')](function(_0x4b9a03){return _0x4b9a03;});}return null;};}function removeEntity(_0x37319c,_0x115e27){return function(_0x3867d7){if(_0x3867d7){return _0x3867d7[_0x2fc7('0x3a')]()['then'](function(){_0x37319c[_0x2fc7('0x30')](0xcc)[_0x2fc7('0x31')]();});}};}function handleEntityNotFound(_0x27ab4c,_0x532cac){return function(_0x3606c7){if(!_0x3606c7){_0x27ab4c['sendStatus'](0x194);}return _0x3606c7;};}function handleError(_0x1a57ad,_0x50034e){_0x50034e=_0x50034e||0x1f4;return function(_0x8798c6){logger[_0x2fc7('0x2a')](_0x8798c6[_0x2fc7('0x3b')]);if(_0x8798c6[_0x2fc7('0x3c')]){delete _0x8798c6[_0x2fc7('0x3c')];}_0x1a57ad[_0x2fc7('0x30')](_0x50034e)[_0x2fc7('0x3d')](_0x8798c6);};}exports[_0x2fc7('0x3e')]=function(_0x4c9381,_0x5c01ff){var _0x5abd1b={},_0x59c27c={},_0x1e82ea={'count':0x0,'rows':[]};var _0x342b4a=_[_0x2fc7('0x3f')](db[_0x2fc7('0x40')][_0x2fc7('0x41')],function(_0x3c4086){return{'name':_0x3c4086[_0x2fc7('0x42')],'type':_0x3c4086[_0x2fc7('0x43')][_0x2fc7('0x44')]};});_0x59c27c[_0x2fc7('0x45')]=_['map'](_0x342b4a,'name');_0x59c27c['query']=_['keys'](_0x4c9381[_0x2fc7('0x46')]);_0x59c27c[_0x2fc7('0x47')]=_[_0x2fc7('0x48')](_0x59c27c[_0x2fc7('0x45')],_0x59c27c[_0x2fc7('0x46')]);_0x5abd1b[_0x2fc7('0x49')]=_[_0x2fc7('0x48')](_0x59c27c[_0x2fc7('0x45')],qs[_0x2fc7('0x4a')](_0x4c9381['query'][_0x2fc7('0x4a')]));_0x5abd1b['attributes']=_0x5abd1b[_0x2fc7('0x49')][_0x2fc7('0x4b')]?_0x5abd1b['attributes']:_0x59c27c['model'];if(!_0x4c9381[_0x2fc7('0x46')][_0x2fc7('0x4c')](_0x2fc7('0x4d'))){_0x5abd1b[_0x2fc7('0x36')]=qs[_0x2fc7('0x36')](_0x4c9381[_0x2fc7('0x46')][_0x2fc7('0x36')]);_0x5abd1b[_0x2fc7('0x33')]=qs[_0x2fc7('0x33')](_0x4c9381[_0x2fc7('0x46')][_0x2fc7('0x33')]);}_0x5abd1b[_0x2fc7('0x4e')]=qs[_0x2fc7('0x4f')](_0x4c9381[_0x2fc7('0x46')][_0x2fc7('0x4f')]);_0x5abd1b['where']=qs[_0x2fc7('0x47')](_['pick'](_0x4c9381['query'],_0x59c27c[_0x2fc7('0x47')]),_0x342b4a);if(_0x4c9381[_0x2fc7('0x46')][_0x2fc7('0x50')]){_0x5abd1b[_0x2fc7('0x51')]=_[_0x2fc7('0x52')](_0x5abd1b[_0x2fc7('0x51')],{'$or':_[_0x2fc7('0x3f')](_0x342b4a,function(_0x44a0a7){if(_0x44a0a7[_0x2fc7('0x43')]!==_0x2fc7('0x53')){var _0x476421={};_0x476421[_0x44a0a7[_0x2fc7('0x3c')]]={'$like':'%'+_0x4c9381[_0x2fc7('0x46')][_0x2fc7('0x50')]+'%'};return _0x476421;}})});}_0x5abd1b=_[_0x2fc7('0x52')]({},_0x5abd1b,_0x4c9381[_0x2fc7('0x54')]);var _0x5a3e50={'where':_0x5abd1b[_0x2fc7('0x51')]};return db[_0x2fc7('0x40')]['count'](_0x5a3e50)[_0x2fc7('0x24')](function(_0x38d6a7){_0x1e82ea[_0x2fc7('0x35')]=_0x38d6a7;if(_0x4c9381['query'][_0x2fc7('0x55')]){_0x5abd1b[_0x2fc7('0x56')]=[{'all':!![]}];}return db[_0x2fc7('0x40')][_0x2fc7('0x57')](_0x5abd1b);})[_0x2fc7('0x24')](function(_0x5c64f4){_0x1e82ea[_0x2fc7('0x58')]=_0x5c64f4;return _0x1e82ea;})[_0x2fc7('0x24')](respondWithFilteredResult(_0x5c01ff,_0x5abd1b))[_0x2fc7('0x2f')](handleError(_0x5c01ff,null));};exports[_0x2fc7('0x59')]=function(_0x4119dc,_0x4bb35c){var _0x34bb13={'raw':!![],'where':{'id':_0x4119dc[_0x2fc7('0x5a')]['id']}},_0x914474={};_0x914474['model']=_[_0x2fc7('0x5b')](db[_0x2fc7('0x40')][_0x2fc7('0x41')]);_0x914474['query']=_['keys'](_0x4119dc[_0x2fc7('0x46')]);_0x914474[_0x2fc7('0x47')]=_[_0x2fc7('0x48')](_0x914474['model'],_0x914474[_0x2fc7('0x46')]);_0x34bb13[_0x2fc7('0x49')]=_[_0x2fc7('0x48')](_0x914474['model'],qs[_0x2fc7('0x4a')](_0x4119dc[_0x2fc7('0x46')][_0x2fc7('0x4a')]));_0x34bb13[_0x2fc7('0x49')]=_0x34bb13[_0x2fc7('0x49')]['length']?_0x34bb13[_0x2fc7('0x49')]:_0x914474['model'];if(_0x4119dc[_0x2fc7('0x46')][_0x2fc7('0x55')]){_0x34bb13[_0x2fc7('0x56')]=[{'all':!![]}];}_0x34bb13=_['merge']({},_0x34bb13,_0x4119dc[_0x2fc7('0x54')]);return db[_0x2fc7('0x40')][_0x2fc7('0x5c')](_0x34bb13)[_0x2fc7('0x24')](handleEntityNotFound(_0x4bb35c,null))[_0x2fc7('0x24')](respondWithResult(_0x4bb35c,null))[_0x2fc7('0x2f')](handleError(_0x4bb35c,null));};exports[_0x2fc7('0x5d')]=function(_0x322b3d,_0x350d4c){return db[_0x2fc7('0x40')][_0x2fc7('0x5d')](_0x322b3d[_0x2fc7('0x5e')],{})[_0x2fc7('0x24')](respondWithResult(_0x350d4c,0xc9))['catch'](handleError(_0x350d4c,null));};exports[_0x2fc7('0x5f')]=function(_0x5428a0,_0x5726d0){if(_0x5428a0[_0x2fc7('0x5e')]['id']){delete _0x5428a0['body']['id'];}return db[_0x2fc7('0x40')][_0x2fc7('0x5c')]({'where':{'id':_0x5428a0[_0x2fc7('0x5a')]['id']}})[_0x2fc7('0x24')](handleEntityNotFound(_0x5726d0,null))[_0x2fc7('0x24')](saveUpdates(_0x5428a0[_0x2fc7('0x5e')],null))[_0x2fc7('0x24')](respondWithResult(_0x5726d0,null))[_0x2fc7('0x2f')](handleError(_0x5726d0,null));};exports[_0x2fc7('0x3a')]=function(_0x5b107b,_0x16dd54){return db[_0x2fc7('0x40')][_0x2fc7('0x5c')]({'where':{'id':_0x5b107b['params']['id']}})[_0x2fc7('0x24')](handleEntityNotFound(_0x16dd54,null))[_0x2fc7('0x24')](removeEntity(_0x16dd54,null))[_0x2fc7('0x2f')](handleError(_0x16dd54,null));};exports['describe']=function(_0xc7e977,_0x5514c2){return db[_0x2fc7('0x40')][_0x2fc7('0x60')]()[_0x2fc7('0x24')](respondWithResult(_0x5514c2,null))[_0x2fc7('0x2f')](handleError(_0x5514c2,null));};var interaction_log=require('../../config/logger')(_0x2fc7('0x61'));exports[_0x2fc7('0x62')]=function(_0x58e0af,_0x51e370,_0x1da6ae){var _0x258475={'agent':{},'channel':'chat'};if(_0x58e0af[_0x2fc7('0x5e')]['id']){delete _0x58e0af[_0x2fc7('0x5e')]['id'];}_0x58e0af[_0x2fc7('0x5e')][_0x2fc7('0x63')]=!![];_0x58e0af[_0x2fc7('0x5e')][_0x2fc7('0x64')]=moment()[_0x2fc7('0x65')](_0x2fc7('0x66'));_0x58e0af[_0x2fc7('0x5e')][_0x2fc7('0x67')]=_0x58e0af['body'][_0x2fc7('0x67')]||_0x58e0af[_0x2fc7('0x68')]['id'];_0x258475[_0x2fc7('0x69')]['id']=_0x58e0af[_0x2fc7('0x5e')][_0x2fc7('0x67')];return db[_0x2fc7('0x40')][_0x2fc7('0x5c')]({'where':{'id':_0x58e0af['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x51e370,null))[_0x2fc7('0x24')](saveUpdates(_0x58e0af[_0x2fc7('0x5e')],null))[_0x2fc7('0x24')](function(_0x43b2e9){if(_0x43b2e9){_0x258475[_0x2fc7('0x2d')]=_0x43b2e9[_0x2fc7('0x6a')]({'plain':!![]});return db[_0x2fc7('0x6b')][_0x2fc7('0x5c')]({'where':{'id':_0x43b2e9[_0x2fc7('0x6c')]}});}return null;})[_0x2fc7('0x24')](handleEntityNotFound(_0x51e370,null))['then'](function(_0xaeca3e){if(_0xaeca3e){return _0xaeca3e[_0x2fc7('0x5f')]({'UserId':_0x58e0af[_0x2fc7('0x5e')][_0x2fc7('0x67')],'read1stAt':_[_0x2fc7('0x6d')](_0xaeca3e[_0x2fc7('0x6e')])?moment()[_0x2fc7('0x65')](_0x2fc7('0x66')):undefined});}return null;})[_0x2fc7('0x24')](function(_0x5d90a4){if(_0x5d90a4){_0x258475[_0x2fc7('0x6f')]=_0x5d90a4[_0x2fc7('0x6a')]({'plain':!![]});interaction_log['info'](_0x2fc7('0x70'),_0x58e0af[_0x2fc7('0x68')]['id'],_0x58e0af[_0x2fc7('0x68')][_0x2fc7('0x3c')],_0x58e0af[_0x2fc7('0x68')]['role'],_0x258475['interaction']['id'],_0x58e0af[_0x2fc7('0x5e')]?JSON['stringify'](_0x58e0af['body']):_0x2fc7('0x71'));return respondWithRpcPromise(_0x2fc7('0x72'),'acceptMessage',_0x258475);}return null;})[_0x2fc7('0x24')](function(_0x468fca){var _0x338bd7=_0x2fc7('0x73')+_0x468fca[_0x2fc7('0x2d')]['ContactId'];return db[_0x2fc7('0x74')]['query'](_0x338bd7,{'type':db['Sequelize'][_0x2fc7('0x75')][_0x2fc7('0x76')],'raw':!![]})[_0x2fc7('0x24')](function(_0x5444fc){return _0x5444fc;});})[_0x2fc7('0x24')](function(_0x5a72af){if(_0x5a72af){_0x258475['message'][_0x2fc7('0x77')]=_0x5a72af[0x0];if(!_0x58e0af[_0x2fc7('0x5e')][_0x2fc7('0x67')])return;return db[_0x2fc7('0x78')][_0x2fc7('0x5c')]({'where':{'id':_0x58e0af[_0x2fc7('0x5e')][_0x2fc7('0x67')],'role':_0x2fc7('0x69')},'attributes':['id','name',_0x2fc7('0x79'),_0x2fc7('0x7a'),_0x2fc7('0x7b')],'raw':!![]});}return null;})[_0x2fc7('0x24')](function(_0xa4935a){if(!_0xa4935a)return null;_0x258475[_0x2fc7('0x2d')][_0x2fc7('0x69')]=_0xa4935a;return _0x258475;})[_0x2fc7('0x24')](function(_0x28873c){if(_0x28873c){if(_0x58e0af['body'][_0x2fc7('0x7c')]){_0x258475[_0x2fc7('0x2d')][_0x2fc7('0x7d')]=util[_0x2fc7('0x65')](_0x2fc7('0x7e'),_0x58e0af[_0x2fc7('0x68')][_0x2fc7('0x3c')]);_0x258475[_0x2fc7('0x2d')][_0x2fc7('0x7f')]=_0x258475[_0x2fc7('0x7f')];_0x258475['message'][_0x2fc7('0x80')]=_0x258475[_0x2fc7('0x7f')];_0x258475[_0x2fc7('0x2d')][_0x2fc7('0x81')]=_0x2fc7('0x62');return respondWithRpcPromise(_0x2fc7('0x82'),'EventManager',{'event':_0x2fc7('0x83'),'message':_['merge'](_0x258475[_0x2fc7('0x2d')],JSON[_0x2fc7('0x84')](_0x258475[_0x2fc7('0x6f')][_0x2fc7('0x85')]))},client9002)[_0x2fc7('0x24')](function(){return _0x258475;});}return _0x258475;}return null;})[_0x2fc7('0x24')](respondWithResult(_0x51e370,null))[_0x2fc7('0x2f')](handleError(_0x51e370,null));};var interaction_log=require(_0x2fc7('0x16'))(_0x2fc7('0x61'));exports[_0x2fc7('0x86')]=function(_0x28d156,_0x48ed90,_0x457482){var _0x5814c1={'agent':{},'channel':_0x2fc7('0x87')};if(_0x28d156[_0x2fc7('0x5e')]['id']){delete _0x28d156[_0x2fc7('0x5e')]['id'];}_0x28d156[_0x2fc7('0x5e')]['UserId']=_0x28d156['body'][_0x2fc7('0x67')]||_0x28d156[_0x2fc7('0x68')]['id'];_0x5814c1['agent']['id']=_0x28d156[_0x2fc7('0x5e')]['UserId'];return db['ChatMessage'][_0x2fc7('0x5c')]({'where':{'id':_0x28d156[_0x2fc7('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x48ed90,null))[_0x2fc7('0x24')](function(_0x59ee81){if(_0x59ee81){_0x5814c1[_0x2fc7('0x2d')]=_0x59ee81[_0x2fc7('0x6a')]({'plain':!![]});return db[_0x2fc7('0x6b')][_0x2fc7('0x5c')]({'where':{'id':_0x59ee81[_0x2fc7('0x6c')]}});}return null;})[_0x2fc7('0x24')](handleEntityNotFound(_0x48ed90,null))[_0x2fc7('0x24')](function(_0x30c81b){if(_0x30c81b){_0x5814c1[_0x2fc7('0x6f')]=_0x30c81b['get']({'plain':!![]});interaction_log[_0x2fc7('0x25')](_0x2fc7('0x88'),_0x28d156[_0x2fc7('0x68')]['id'],_0x28d156['user'][_0x2fc7('0x3c')],_0x28d156[_0x2fc7('0x68')][_0x2fc7('0x89')],_0x5814c1['interaction']['id'],_0x28d156[_0x2fc7('0x5e')]?JSON[_0x2fc7('0x29')](_0x28d156['body']):_0x2fc7('0x71'));return respondWithRpcPromise(_0x2fc7('0x8a'),_0x2fc7('0x8b'),_0x5814c1);}return null;})['then'](function(_0x5c3d2b){var _0x55ca43=_0x2fc7('0x73')+_0x5c3d2b['message'][_0x2fc7('0x8c')];return db[_0x2fc7('0x74')][_0x2fc7('0x46')](_0x55ca43,{'type':db[_0x2fc7('0x8d')]['QueryTypes'][_0x2fc7('0x76')],'raw':!![]})[_0x2fc7('0x24')](function(_0xfae901){return _0xfae901;});})[_0x2fc7('0x24')](function(_0x509d12){if(_0x509d12){_0x5814c1['message']['contact']=_0x509d12[0x0];if(!_0x28d156[_0x2fc7('0x5e')][_0x2fc7('0x67')])return;return db[_0x2fc7('0x78')]['find']({'where':{'id':_0x28d156[_0x2fc7('0x5e')][_0x2fc7('0x67')],'role':_0x2fc7('0x69')},'attributes':['id',_0x2fc7('0x3c'),_0x2fc7('0x79'),_0x2fc7('0x7a'),'internal'],'raw':!![]});}return null;})[_0x2fc7('0x24')](function(_0x41756e){if(!_0x41756e)return null;_0x5814c1[_0x2fc7('0x2d')][_0x2fc7('0x69')]=_0x41756e;return _0x5814c1;})[_0x2fc7('0x24')](function(_0x2ee474){if(_0x2ee474){_0x2ee474[_0x2fc7('0x2d')]['interface']=util[_0x2fc7('0x65')]('SIP/%s',_0x28d156[_0x2fc7('0x68')][_0x2fc7('0x3c')]);_0x2ee474['message'][_0x2fc7('0x7f')]=_0x5814c1[_0x2fc7('0x7f')];_0x2ee474[_0x2fc7('0x2d')][_0x2fc7('0x80')]=_0x5814c1[_0x2fc7('0x7f')];_0x2ee474[_0x2fc7('0x2d')]['event']=_0x2fc7('0x86');respondWithRpcPromise(_0x2fc7('0x82'),'EventManager',{'event':'rejectmessage','message':_['merge'](_0x5814c1[_0x2fc7('0x2d')],JSON[_0x2fc7('0x84')](_0x5814c1[_0x2fc7('0x6f')][_0x2fc7('0x85')]))},client9002);return _0x5814c1;}return null;})[_0x2fc7('0x24')](respondWithResult(_0x48ed90,null))['catch'](handleError(_0x48ed90,null));};
\ No newline at end of file
index b8631f6..43f8625 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6421=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','save'];(function(_0x1dcda7,_0x392711){var _0x5add78=function(_0x4af948){while(--_0x4af948){_0x1dcda7['push'](_0x1dcda7['shift']());}};_0x5add78(++_0x392711);}(_0x6421,0x1c8));var _0x1642=function(_0x4eefdf,_0x2604d0){_0x4eefdf=_0x4eefdf-0x0;var _0x165423=_0x6421[_0x4eefdf];return _0x165423;};'use strict';var EventEmitter=require(_0x1642('0x0'));var ChatMessage=require(_0x1642('0x1'))['db'][_0x1642('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1642('0x3'),'afterUpdate':_0x1642('0x4'),'afterDestroy':_0x1642('0x5')};function emitEvent(_0x541a95){return function(_0x34d7ee,_0x1282d3,_0x4d693c){ChatMessageEvents['emit'](_0x541a95+':'+_0x34d7ee['id'],_0x34d7ee);ChatMessageEvents[_0x1642('0x6')](_0x541a95,_0x34d7ee);_0x4d693c(null);};}for(var e in events){if(events[_0x1642('0x7')](e)){var event=events[e];ChatMessage[_0x1642('0x8')](e,emitEvent(event));}}module[_0x1642('0x9')]=ChatMessageEvents;
\ No newline at end of file
+var _0xf060=['exports','events','ChatMessage','setMaxListeners','update','remove','emit','hook'];(function(_0x579e57,_0x1feb17){var _0x2d8e54=function(_0x517982){while(--_0x517982){_0x579e57['push'](_0x579e57['shift']());}};_0x2d8e54(++_0x1feb17);}(_0xf060,0xf9));var _0x0f06=function(_0x4cff96,_0x584782){_0x4cff96=_0x4cff96-0x0;var _0x39dd96=_0xf060[_0x4cff96];return _0x39dd96;};'use strict';var EventEmitter=require(_0x0f06('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x0f06('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x0f06('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0f06('0x3'),'afterDestroy':_0x0f06('0x4')};function emitEvent(_0x171ab5){return function(_0x1c0978,_0x115687,_0x43ce49){ChatMessageEvents[_0x0f06('0x5')](_0x171ab5+':'+_0x1c0978['id'],_0x1c0978);ChatMessageEvents['emit'](_0x171ab5,_0x1c0978);_0x43ce49(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x0f06('0x6')](e,emitEvent(event));}}module[_0x0f06('0x7')]=ChatMessageEvents;
\ No newline at end of file
index 30c29ea..1275bd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff97=['chat_messages','FULLTEXT','get','toLowerCase','direction','out','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','createdAt','error','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','define'];(function(_0x4adead,_0x3e7eef){var _0x34cfca=function(_0x4b52ca){while(--_0x4b52ca){_0x4adead['push'](_0x4adead['shift']());}};_0x34cfca(++_0x3e7eef);}(_0xff97,0x19f));var _0x7ff9=function(_0x3e66c9,_0x22fccd){_0x3e66c9=_0x3e66c9-0x0;var _0x3c1e9b=_0xff97[_0x3e66c9];return _0x3c1e9b;};'use strict';var _=require(_0x7ff9('0x0'));var util=require(_0x7ff9('0x1'));var logger=require('../../config/logger')(_0x7ff9('0x2'));var moment=require('moment');var BPromise=require(_0x7ff9('0x3'));var rp=require(_0x7ff9('0x4'));var fs=require('fs');var path=require(_0x7ff9('0x5'));var rimraf=require(_0x7ff9('0x6'));var config=require('../../config/environment');var attributes=require(_0x7ff9('0x7'));module[_0x7ff9('0x8')]=function(_0x23753f,_0x4229f3){return _0x23753f[_0x7ff9('0x9')]('ChatMessage',attributes,{'tableName':_0x7ff9('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0x7ff9('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5b47c4,_0x3cf64e,_0x376e69){var _0x51a8b0=_0x23753f['models'];var _0x9c9238=_0x5b47c4[_0x7ff9('0xc')]({'plain':!![]});if(_0x9c9238['direction'][_0x7ff9('0xd')]()==='in'||_0x9c9238[_0x7ff9('0xe')]['toLowerCase']()===_0x7ff9('0xf')&&!_0x9c9238['secret']&&!_[_0x7ff9('0x10')](_0x9c9238[_0x7ff9('0x11')])){_0x51a8b0[_0x7ff9('0x12')]['findOne']({'where':{'id':_0x9c9238[_0x7ff9('0x13')]}})[_0x7ff9('0x14')](function(_0x356f16){if(_0x356f16){_0x356f16[_0x7ff9('0x15')]({'lastMsgAt':_0x9c9238[_0x7ff9('0x16')],'lastMsgDirection':_0x9c9238[_0x7ff9('0xe')]['toLowerCase']()});}})['catch'](function(_0x167dbb){console[_0x7ff9('0x17')](_0x167dbb);});}_0x376e69();}},'charset':'utf8mb4','collate':_0x7ff9('0x18')});};
\ No newline at end of file
+var _0xc319=['get','direction','toLowerCase','UserId','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','fti_chat_messages','body','FULLTEXT','models'];(function(_0x51ba79,_0x43bba6){var _0x2e2aab=function(_0x47abff){while(--_0x47abff){_0x51ba79['push'](_0x51ba79['shift']());}};_0x2e2aab(++_0x43bba6);}(_0xc319,0x174));var _0x9c31=function(_0x3b5445,_0x17475b){_0x3b5445=_0x3b5445-0x0;var _0x4aba5f=_0xc319[_0x3b5445];return _0x4aba5f;};'use strict';var _=require(_0x9c31('0x0'));var util=require(_0x9c31('0x1'));var logger=require('../../config/logger')(_0x9c31('0x2'));var moment=require(_0x9c31('0x3'));var BPromise=require('bluebird');var rp=require(_0x9c31('0x4'));var fs=require('fs');var path=require(_0x9c31('0x5'));var rimraf=require(_0x9c31('0x6'));var config=require(_0x9c31('0x7'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x19eda1,_0x275fd1){return _0x19eda1['define']('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x9c31('0x8'),'fields':[_0x9c31('0x9')],'type':_0x9c31('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5ce07a,_0x124531,_0x2bfbce){var _0x518d6c=_0x19eda1[_0x9c31('0xb')];var _0x51bb5a=_0x5ce07a[_0x9c31('0xc')]({'plain':!![]});if(_0x51bb5a[_0x9c31('0xd')][_0x9c31('0xe')]()==='in'||_0x51bb5a[_0x9c31('0xd')][_0x9c31('0xe')]()==='out'&&!_0x51bb5a['secret']&&!_['isNil'](_0x51bb5a[_0x9c31('0xf')])){_0x518d6c['ChatInteraction'][_0x9c31('0x10')]({'where':{'id':_0x51bb5a[_0x9c31('0x11')]}})[_0x9c31('0x12')](function(_0x57f1d3){if(_0x57f1d3){_0x57f1d3[_0x9c31('0x13')]({'lastMsgAt':_0x51bb5a[_0x9c31('0x14')],'lastMsgDirection':_0x51bb5a[_0x9c31('0xd')]['toLowerCase']()});}})[_0x9c31('0x15')](function(_0x1bb3fc){console[_0x9c31('0x16')](_0x1bb3fc);});}_0x2bfbce();}},'charset':_0x9c31('0x17'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index b784c8b..fcec52e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d21=['info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatMessage,\x20%s,\x20%s','result','CreateChatMessage','ChatMessage','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatMessage.socket','request'];(function(_0x4703b5,_0x5c668d){var _0x37ff03=function(_0x3d08ce){while(--_0x3d08ce){_0x4703b5['push'](_0x4703b5['shift']());}};_0x37ff03(++_0x5c668d);}(_0x4d21,0xc3));var _0x14d2=function(_0x5a95b4,_0x1f919a){_0x5a95b4=_0x5a95b4-0x0;var _0xaf224d=_0x4d21[_0x5a95b4];return _0xaf224d;};'use strict';var _=require(_0x14d2('0x0'));var util=require(_0x14d2('0x1'));var moment=require(_0x14d2('0x2'));var BPromise=require(_0x14d2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x14d2('0x4'));var db=require(_0x14d2('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x14d2('0x6'));var config=require(_0x14d2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x14d2('0x8')][_0x14d2('0x9')]({'port':0x232a});config[_0x14d2('0xa')]=_[_0x14d2('0xb')](config[_0x14d2('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x14d2('0xc'))(new Redis(config['redis']));require(_0x14d2('0xd'))['register'](socket);function respondWithRpcPromise(_0x3bb3aa,_0x4fd37b,_0x50826c){return new BPromise(function(_0x26a1cf,_0x30b541){return client[_0x14d2('0xe')](_0x3bb3aa,_0x50826c)['then'](function(_0x148265){logger[_0x14d2('0xf')]('ChatMessage,\x20%s,\x20%s',_0x4fd37b,_0x14d2('0x10'));logger[_0x14d2('0x11')](_0x14d2('0x12'),_0x4fd37b,_0x14d2('0x10'),JSON[_0x14d2('0x13')](_0x148265));if(_0x148265['error']){if(_0x148265[_0x14d2('0x14')]['code']===0x1f4){logger[_0x14d2('0x14')]('ChatMessage,\x20%s,\x20%s',_0x4fd37b,_0x148265[_0x14d2('0x14')][_0x14d2('0x15')]);return _0x30b541(_0x148265['error'][_0x14d2('0x15')]);}logger[_0x14d2('0x14')]('ChatMessage,\x20%s,\x20%s',_0x4fd37b,_0x148265[_0x14d2('0x14')][_0x14d2('0x15')]);return _0x26a1cf(_0x148265['error'][_0x14d2('0x15')]);}else{logger['info'](_0x14d2('0x16'),_0x4fd37b,_0x14d2('0x10'));_0x26a1cf(_0x148265[_0x14d2('0x17')][_0x14d2('0x15')]);}})['catch'](function(_0x2214a5){logger[_0x14d2('0x14')]('ChatMessage,\x20%s,\x20%s',_0x4fd37b,_0x2214a5);_0x30b541(_0x2214a5);});});}exports[_0x14d2('0x18')]=function(_0x39f10d){var _0x32350e=this;return new Promise(function(_0x47e68e,_0x1c1b88){return db[_0x14d2('0x19')][_0x14d2('0x1a')](_0x39f10d[_0x14d2('0x1b')],{'raw':_0x39f10d[_0x14d2('0x1c')]?_0x39f10d[_0x14d2('0x1c')][_0x14d2('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x3a4ad3){logger[_0x14d2('0xf')](_0x14d2('0x18'),_0x39f10d);logger[_0x14d2('0x11')](_0x14d2('0x18'),_0x39f10d,JSON[_0x14d2('0x13')](_0x3a4ad3));_0x47e68e(_0x3a4ad3);})['catch'](function(_0x360f86){logger[_0x14d2('0x14')]('CreateChatMessage',_0x360f86[_0x14d2('0x15')],_0x39f10d);_0x1c1b88(_0x32350e[_0x14d2('0x14')](0x1f4,_0x360f86['message']));});});};
\ No newline at end of file
+var _0xcdf1=['create','body','options','raw','then','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','info','request\x20sent','debug','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','CreateChatMessage','ChatMessage'];(function(_0x50cb4b,_0x31a607){var _0x8b1491=function(_0x53596c){while(--_0x53596c){_0x50cb4b['push'](_0x50cb4b['shift']());}};_0x8b1491(++_0x31a607);}(_0xcdf1,0x11e));var _0x1cdf=function(_0x1be35b,_0xa49780){_0x1be35b=_0x1be35b-0x0;var _0xd22f6=_0xcdf1[_0x1be35b];return _0xd22f6;};'use strict';var _=require(_0x1cdf('0x0'));var util=require(_0x1cdf('0x1'));var moment=require(_0x1cdf('0x2'));var BPromise=require(_0x1cdf('0x3'));var rs=require(_0x1cdf('0x4'));var fs=require('fs');var Redis=require(_0x1cdf('0x5'));var db=require(_0x1cdf('0x6'))['db'];var utils=require(_0x1cdf('0x7'));var logger=require(_0x1cdf('0x8'))(_0x1cdf('0x9'));var config=require('../../config/environment');var jayson=require(_0x1cdf('0xa'));var client=jayson[_0x1cdf('0xb')]['http']({'port':0x232a});config[_0x1cdf('0xc')]=_[_0x1cdf('0xd')](config[_0x1cdf('0xc')],{'host':_0x1cdf('0xe'),'port':0x18eb});var socket=require(_0x1cdf('0xf'))(new Redis(config['redis']));require(_0x1cdf('0x10'))[_0x1cdf('0x11')](socket);function respondWithRpcPromise(_0x31a205,_0x4af438,_0x20f5b5){return new BPromise(function(_0x191dc3,_0x551eed){return client['request'](_0x31a205,_0x20f5b5)['then'](function(_0x447bce){logger[_0x1cdf('0x12')]('ChatMessage,\x20%s,\x20%s',_0x4af438,_0x1cdf('0x13'));logger[_0x1cdf('0x14')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4af438,_0x1cdf('0x13'),JSON[_0x1cdf('0x15')](_0x447bce));if(_0x447bce[_0x1cdf('0x16')]){if(_0x447bce[_0x1cdf('0x16')][_0x1cdf('0x17')]===0x1f4){logger[_0x1cdf('0x16')](_0x1cdf('0x18'),_0x4af438,_0x447bce[_0x1cdf('0x16')][_0x1cdf('0x19')]);return _0x551eed(_0x447bce[_0x1cdf('0x16')][_0x1cdf('0x19')]);}logger[_0x1cdf('0x16')]('ChatMessage,\x20%s,\x20%s',_0x4af438,_0x447bce[_0x1cdf('0x16')][_0x1cdf('0x19')]);return _0x191dc3(_0x447bce[_0x1cdf('0x16')][_0x1cdf('0x19')]);}else{logger[_0x1cdf('0x12')]('ChatMessage,\x20%s,\x20%s',_0x4af438,_0x1cdf('0x13'));_0x191dc3(_0x447bce[_0x1cdf('0x1a')][_0x1cdf('0x19')]);}})['catch'](function(_0x23a397){logger[_0x1cdf('0x16')](_0x1cdf('0x18'),_0x4af438,_0x23a397);_0x551eed(_0x23a397);});});}exports[_0x1cdf('0x1b')]=function(_0x13c8a3){var _0x1c5ce9=this;return new Promise(function(_0x13c842,_0x11521f){return db[_0x1cdf('0x1c')][_0x1cdf('0x1d')](_0x13c8a3[_0x1cdf('0x1e')],{'raw':_0x13c8a3[_0x1cdf('0x1f')]?_0x13c8a3['options'][_0x1cdf('0x20')]===undefined?!![]:![]:!![]})[_0x1cdf('0x21')](function(_0x57a0d2){logger[_0x1cdf('0x12')]('CreateChatMessage',_0x13c8a3);logger['debug'](_0x1cdf('0x1b'),_0x13c8a3,JSON[_0x1cdf('0x15')](_0x57a0d2));_0x13c842(_0x57a0d2);})[_0x1cdf('0x22')](function(_0x1c4e44){logger[_0x1cdf('0x16')](_0x1cdf('0x1b'),_0x1c4e44[_0x1cdf('0x19')],_0x13c8a3);_0x11521f(_0x1c5ce9['error'](0x1f4,_0x1c4e44[_0x1cdf('0x19')]));});});};
\ No newline at end of file
index c16cd00..f1a3324 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99c9=['removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','update'];(function(_0x3dc763,_0x18c359){var _0x1338f8=function(_0x32f76d){while(--_0x32f76d){_0x3dc763['push'](_0x3dc763['shift']());}};_0x1338f8(++_0x18c359);}(_0x99c9,0x13c));var _0x999c=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x99c9[_0x565ed7];return _0x183ad7;};'use strict';var ChatMessageEvents=require(_0x999c('0x0'));var events=[_0x999c('0x1'),_0x999c('0x2'),_0x999c('0x3')];function createListener(_0x2bb83d,_0x16a7a3){return function(_0x31e9b1){_0x16a7a3['emit'](_0x2bb83d,_0x31e9b1);};}function removeListener(_0x2a4e06,_0x140cd5){return function(){ChatMessageEvents[_0x999c('0x4')](_0x2a4e06,_0x140cd5);};}exports[_0x999c('0x5')]=function(_0x2bdd73){for(var _0x14df32=0x0,_0x34f100=events[_0x999c('0x6')];_0x14df32<_0x34f100;_0x14df32++){var _0xc8a6b5=events[_0x14df32];var _0xb88ec1=createListener(_0x999c('0x7')+_0xc8a6b5,_0x2bdd73);ChatMessageEvents['on'](_0xc8a6b5,_0xb88ec1);}};
\ No newline at end of file
+var _0x4ab0=['register','length','chatMessage:','save','remove','update'];(function(_0x18ac33,_0x3f860a){var _0x33dd81=function(_0xd8fe3f){while(--_0xd8fe3f){_0x18ac33['push'](_0x18ac33['shift']());}};_0x33dd81(++_0x3f860a);}(_0x4ab0,0xd5));var _0x04ab=function(_0x52bc51,_0x2662c){_0x52bc51=_0x52bc51-0x0;var _0x5a5bda=_0x4ab0[_0x52bc51];return _0x5a5bda;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x04ab('0x0'),_0x04ab('0x1'),_0x04ab('0x2')];function createListener(_0x3d8417,_0x3a7b9f){return function(_0x51135e){_0x3a7b9f['emit'](_0x3d8417,_0x51135e);};}function removeListener(_0x45dfee,_0xb1bf2d){return function(){ChatMessageEvents['removeListener'](_0x45dfee,_0xb1bf2d);};}exports[_0x04ab('0x3')]=function(_0x2c5730){for(var _0x4edd2e=0x0,_0x3f5901=events[_0x04ab('0x4')];_0x4edd2e<_0x3f5901;_0x4edd2e++){var _0x1ff7f6=events[_0x4edd2e];var _0x4bc05e=createListener(_0x04ab('0x5')+_0x1ff7f6,_0x2c5730);ChatMessageEvents['on'](_0x1ff7f6,_0x4bc05e);}};
\ No newline at end of file
index eed6d76..992688d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50b6=['delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','chatmessage:create','create','put','/:id/accept','/:id/reject'];(function(_0x21fc17,_0x1496c5){var _0x4bd46e=function(_0x3d76c8){while(--_0x3d76c8){_0x21fc17['push'](_0x21fc17['shift']());}};_0x4bd46e(++_0x1496c5);}(_0x50b6,0x18f));var _0x650b=function(_0x24d03d,_0x3f7e3e){_0x24d03d=_0x24d03d-0x0;var _0x20af54=_0x50b6[_0x24d03d];return _0x20af54;};'use strict';var multer=require(_0x650b('0x0'));var util=require(_0x650b('0x1'));var path=require(_0x650b('0x2'));var timeout=require('connect-timeout');var express=require(_0x650b('0x3'));var router=express[_0x650b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x650b('0x5'));var interaction=require(_0x650b('0x6'));var config=require(_0x650b('0x7'));var controller=require('./chatMessage.controller');router[_0x650b('0x8')]('/',auth[_0x650b('0x9')](),controller[_0x650b('0xa')]);router[_0x650b('0x8')](_0x650b('0xb'),auth[_0x650b('0x9')](),controller['describe']);router[_0x650b('0x8')](_0x650b('0xc'),auth[_0x650b('0x9')](),controller[_0x650b('0xd')]);router['post']('/',auth[_0x650b('0x9')](),interaction['tracked']('chat',_0x650b('0xe')),controller[_0x650b('0xf')]);router[_0x650b('0x10')]('/:id',controller['update']);router['put'](_0x650b('0x11'),auth['isAuthenticated'](),controller['accept']);router[_0x650b('0x10')](_0x650b('0x12'),auth['isAuthenticated'](),controller['reject']);router[_0x650b('0x13')](_0x650b('0xc'),auth[_0x650b('0x9')](),controller[_0x650b('0x14')]);module[_0x650b('0x15')]=router;
\ No newline at end of file
+var _0x2eb4=['describe','get','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','reject','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','/describe'];(function(_0x3163ee,_0x4f031c){var _0x4e31cc=function(_0x5e5fa5){while(--_0x5e5fa5){_0x3163ee['push'](_0x3163ee['shift']());}};_0x4e31cc(++_0x4f031c);}(_0x2eb4,0x1db));var _0x42eb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2eb4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x42eb('0x0'));var util=require(_0x42eb('0x1'));var path=require('path');var timeout=require(_0x42eb('0x2'));var express=require('express');var router=express[_0x42eb('0x3')]();var fs_extra=require(_0x42eb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x42eb('0x5'));var config=require(_0x42eb('0x6'));var controller=require(_0x42eb('0x7'));router['get']('/',auth[_0x42eb('0x8')](),controller[_0x42eb('0x9')]);router['get'](_0x42eb('0xa'),auth['isAuthenticated'](),controller[_0x42eb('0xb')]);router[_0x42eb('0xc')](_0x42eb('0xd'),auth['isAuthenticated'](),controller[_0x42eb('0xe')]);router[_0x42eb('0xf')]('/',auth[_0x42eb('0x8')](),interaction[_0x42eb('0x10')](_0x42eb('0x11'),_0x42eb('0x12')),controller[_0x42eb('0x13')]);router[_0x42eb('0x14')]('/:id',controller[_0x42eb('0x15')]);router[_0x42eb('0x14')](_0x42eb('0x16'),auth[_0x42eb('0x8')](),controller['accept']);router[_0x42eb('0x14')]('/:id/reject',auth[_0x42eb('0x8')](),controller[_0x42eb('0x17')]);router[_0x42eb('0x18')](_0x42eb('0xd'),auth['isAuthenticated'](),controller[_0x42eb('0x19')]);module[_0x42eb('0x1a')]=router;
\ No newline at end of file
index 1221dc0..92a1849 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ea6=['medium','exports','TEXT'];(function(_0x29a2ce,_0x5d6558){var _0x2fa9ea=function(_0x526d35){while(--_0x526d35){_0x29a2ce['push'](_0x29a2ce['shift']());}};_0x2fa9ea(++_0x5d6558);}(_0x1ea6,0x6d));var _0x61ea=function(_0x14487f,_0x2ce4cb){_0x14487f=_0x14487f-0x0;var _0x1aee0b=_0x1ea6[_0x14487f];return _0x1aee0b;};'use strict';var Sequelize=require('sequelize');module[_0x61ea('0x0')]={'body':{'type':Sequelize[_0x61ea('0x1')](_0x61ea('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0x1739=['TEXT','exports'];(function(_0x25b7fd,_0x479a63){var _0x1c712e=function(_0x31cc60){while(--_0x31cc60){_0x25b7fd['push'](_0x25b7fd['shift']());}};_0x1c712e(++_0x479a63);}(_0x1739,0x1e9));var _0x9173=function(_0x40f340,_0x167f80){_0x40f340=_0x40f340-0x0;var _0x2538c5=_0x1739[_0x40f340];return _0x2538c5;};'use strict';var Sequelize=require('sequelize');module[_0x9173('0x0')]={'body':{'type':Sequelize[_0x9173('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
index 33a926c..1edde58 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x7a54,0x106));var _0x47a5=function(_0x241045,_0x40b4a1){_0x241045=_0x241045-0x0;var _0x24eb4a=_0x7a54[_0x241045];return _0x24eb4a;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _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(_0x25386b,_0x2c852f){var _0x21952c=function(_0x330912){while(--_0x330912){_0x25386b['push'](_0x25386b['shift']());}};_0x21952c(++_0x2c852f);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
index 4cd7999..f89cc55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa902=['utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./chatOfflineMessage.attributes','exports','define','chat_offline_messages'];(function(_0x26b006,_0x5f25a2){var _0x4b7c04=function(_0x521781){while(--_0x521781){_0x26b006['push'](_0x26b006['shift']());}};_0x4b7c04(++_0x5f25a2);}(_0xa902,0x85));var _0x2a90=function(_0xc12ef6,_0x3f3852){_0xc12ef6=_0xc12ef6-0x0;var _0x242bd0=_0xa902[_0xc12ef6];return _0x242bd0;};'use strict';var _=require(_0x2a90('0x0'));var util=require(_0x2a90('0x1'));var logger=require(_0x2a90('0x2'))('api');var moment=require(_0x2a90('0x3'));var BPromise=require('bluebird');var rp=require(_0x2a90('0x4'));var fs=require('fs');var path=require(_0x2a90('0x5'));var rimraf=require(_0x2a90('0x6'));var config=require('../../config/environment');var attributes=require(_0x2a90('0x7'));module[_0x2a90('0x8')]=function(_0x5a1a83,_0x16e85b){return _0x5a1a83[_0x2a90('0x9')]('ChatOfflineMessage',attributes,{'tableName':_0x2a90('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x2a90('0xb')});};
\ No newline at end of file
+var _0x94bb=['bluebird','path','rimraf','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','util','api','moment'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x94bb,0xa5));var _0xb94b=function(_0x2059df,_0x367401){_0x2059df=_0x2059df-0x0;var _0xdd848b=_0x94bb[_0x2059df];return _0xdd848b;};'use strict';var _=require('lodash');var util=require(_0xb94b('0x0'));var logger=require('../../config/logger')(_0xb94b('0x1'));var moment=require(_0xb94b('0x2'));var BPromise=require(_0xb94b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb94b('0x4'));var rimraf=require(_0xb94b('0x5'));var config=require('../../config/environment');var attributes=require(_0xb94b('0x6'));module[_0xb94b('0x7')]=function(_0x3bda7c,_0x1d5737){return _0x3bda7c[_0xb94b('0x8')](_0xb94b('0x9'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb94b('0xa'),'collate':_0xb94b('0xb')});};
\ No newline at end of file
index c8aedd3..e4e03c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa34e=['ioredis','../../config/environment','jayson/promise','client','http','then','info','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatOfflineMessage,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring'];(function(_0x208505,_0x241a77){var _0x1a985f=function(_0x4a5110){while(--_0x4a5110){_0x208505['push'](_0x208505['shift']());}};_0x1a985f(++_0x241a77);}(_0xa34e,0x19e));var _0xea34=function(_0x3af270,_0x5675b4){_0x3af270=_0x3af270-0x0;var _0x1dc18a=_0xa34e[_0x3af270];return _0x1dc18a;};'use strict';var _=require(_0xea34('0x0'));var util=require(_0xea34('0x1'));var moment=require('moment');var BPromise=require(_0xea34('0x2'));var rs=require(_0xea34('0x3'));var fs=require('fs');var Redis=require(_0xea34('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xea34('0x5'));var jayson=require(_0xea34('0x6'));var client=jayson[_0xea34('0x7')][_0xea34('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x34ee77,_0x3e10af,_0xdcdb59){return new BPromise(function(_0x54d3ee,_0x1d0e1a){return client['request'](_0x34ee77,_0xdcdb59)[_0xea34('0x9')](function(_0x415328){logger[_0xea34('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3e10af,'request\x20sent');logger[_0xea34('0xb')](_0xea34('0xc'),_0x3e10af,_0xea34('0xd'),JSON[_0xea34('0xe')](_0x415328));if(_0x415328['error']){if(_0x415328[_0xea34('0xf')]['code']===0x1f4){logger['error'](_0xea34('0x10'),_0x3e10af,_0x415328[_0xea34('0xf')][_0xea34('0x11')]);return _0x1d0e1a(_0x415328[_0xea34('0xf')][_0xea34('0x11')]);}logger[_0xea34('0xf')](_0xea34('0x10'),_0x3e10af,_0x415328['error'][_0xea34('0x11')]);return _0x54d3ee(_0x415328[_0xea34('0xf')][_0xea34('0x11')]);}else{logger['info'](_0xea34('0x10'),_0x3e10af,_0xea34('0xd'));_0x54d3ee(_0x415328['result'][_0xea34('0x11')]);}})[_0xea34('0x12')](function(_0x2b1380){logger['error'](_0xea34('0x10'),_0x3e10af,_0x2b1380);_0x1d0e1a(_0x2b1380);});});}
\ No newline at end of file
+var _0x39f0=['code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x39f0,0x1d1));var _0x039f=function(_0x190488,_0x2fb857){_0x190488=_0x190488-0x0;var _0x5ab646=_0x39f0[_0x190488];return _0x5ab646;};'use strict';var _=require(_0x039f('0x0'));var util=require(_0x039f('0x1'));var moment=require(_0x039f('0x2'));var BPromise=require(_0x039f('0x3'));var rs=require(_0x039f('0x4'));var fs=require('fs');var Redis=require(_0x039f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x039f('0x6'));var logger=require(_0x039f('0x7'))('rpc');var config=require(_0x039f('0x8'));var jayson=require(_0x039f('0x9'));var client=jayson[_0x039f('0xa')][_0x039f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4381ac,_0x5ed44c,_0x5f47e1){return new BPromise(function(_0x1a3af6,_0x170a0e){return client['request'](_0x4381ac,_0x5f47e1)[_0x039f('0xc')](function(_0x1f87dc){logger[_0x039f('0xd')](_0x039f('0xe'),_0x5ed44c,'request\x20sent');logger['debug'](_0x039f('0xf'),_0x5ed44c,'request\x20sent',JSON[_0x039f('0x10')](_0x1f87dc));if(_0x1f87dc[_0x039f('0x11')]){if(_0x1f87dc[_0x039f('0x11')][_0x039f('0x12')]===0x1f4){logger[_0x039f('0x11')](_0x039f('0xe'),_0x5ed44c,_0x1f87dc[_0x039f('0x11')][_0x039f('0x13')]);return _0x170a0e(_0x1f87dc['error'][_0x039f('0x13')]);}logger[_0x039f('0x11')](_0x039f('0xe'),_0x5ed44c,_0x1f87dc[_0x039f('0x11')][_0x039f('0x13')]);return _0x1a3af6(_0x1f87dc[_0x039f('0x11')][_0x039f('0x13')]);}else{logger[_0x039f('0xd')](_0x039f('0xe'),_0x5ed44c,_0x039f('0x14'));_0x1a3af6(_0x1f87dc[_0x039f('0x15')][_0x039f('0x13')]);}})[_0x039f('0x16')](function(_0x92ac10){logger[_0x039f('0x11')](_0x039f('0xe'),_0x5ed44c,_0x92ac10);_0x170a0e(_0x92ac10);});});}
\ No newline at end of file
index ebdd5e6..e53c18d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06f1=['./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x06f1,0x77));var _0x106f=function(_0x5c0e7d,_0x5827a1){_0x5c0e7d=_0x5c0e7d-0x0;var _0x47775e=_0x06f1[_0x5c0e7d];return _0x47775e;};'use strict';var multer=require(_0x106f('0x0'));var util=require(_0x106f('0x1'));var path=require(_0x106f('0x2'));var timeout=require('connect-timeout');var express=require(_0x106f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x106f('0x4'));var interaction=require(_0x106f('0x5'));var config=require(_0x106f('0x6'));var controller=require(_0x106f('0x7'));router[_0x106f('0x8')]('/',auth[_0x106f('0x9')](),controller[_0x106f('0xa')]);router[_0x106f('0x8')](_0x106f('0xb'),auth[_0x106f('0x9')](),controller[_0x106f('0xc')]);router['get'](_0x106f('0xd'),auth[_0x106f('0x9')](),controller['show']);router[_0x106f('0xe')]('/',auth[_0x106f('0x9')](),controller[_0x106f('0xf')]);router[_0x106f('0x10')](_0x106f('0xd'),auth[_0x106f('0x9')](),controller[_0x106f('0x11')]);router[_0x106f('0x12')](_0x106f('0xd'),auth[_0x106f('0x9')](),controller[_0x106f('0x13')]);module[_0x106f('0x14')]=router;
\ No newline at end of file
+var _0xe752=['fs-extra','../../components/interaction/service','./chatOfflineMessage.controller','isAuthenticated','get','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3336ad,_0x4f8359){var _0x286568=function(_0x180d3b){while(--_0x180d3b){_0x3336ad['push'](_0x3336ad['shift']());}};_0x286568(++_0x4f8359);}(_0xe752,0xe1));var _0x2e75=function(_0xb378f1,_0x523663){_0xb378f1=_0xb378f1-0x0;var _0x263069=_0xe752[_0xb378f1];return _0x263069;};'use strict';var multer=require(_0x2e75('0x0'));var util=require(_0x2e75('0x1'));var path=require(_0x2e75('0x2'));var timeout=require(_0x2e75('0x3'));var express=require(_0x2e75('0x4'));var router=express[_0x2e75('0x5')]();var fs_extra=require(_0x2e75('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2e75('0x7'));var config=require('../../config/environment');var controller=require(_0x2e75('0x8'));router['get']('/',auth[_0x2e75('0x9')](),controller['index']);router[_0x2e75('0xa')]('/describe',auth[_0x2e75('0x9')](),controller[_0x2e75('0xb')]);router[_0x2e75('0xa')]('/:id',auth[_0x2e75('0x9')](),controller[_0x2e75('0xc')]);router[_0x2e75('0xd')]('/',auth['isAuthenticated'](),controller[_0x2e75('0xe')]);router[_0x2e75('0xf')](_0x2e75('0x10'),auth[_0x2e75('0x9')](),controller[_0x2e75('0x11')]);router[_0x2e75('0x12')](_0x2e75('0x10'),auth[_0x2e75('0x9')](),controller[_0x2e75('0x13')]);module[_0x2e75('0x14')]=router;
\ No newline at end of file
index eef8638..a85bac7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6480=['exports','STRING','ENUM','timeout','INTEGER','sequelize'];(function(_0x12fa03,_0x1bfe2b){var _0x4d7545=function(_0x234921){while(--_0x234921){_0x12fa03['push'](_0x12fa03['shift']());}};_0x4d7545(++_0x1bfe2b);}(_0x6480,0x12b));var _0x0648=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6480[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x0648('0x0'));module[_0x0648('0x1')]={'name':{'type':Sequelize[_0x0648('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0648('0x3')]('mouseOver',_0x0648('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x0648('0x2')]},'timeout':{'type':Sequelize[_0x0648('0x5')]}};
\ No newline at end of file
+var _0x0610=['exports','STRING','ENUM','mouseOver','timeout','INTEGER','sequelize'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x0610,0x156));var _0x0061=function(_0x517bca,_0x447dc8){_0x517bca=_0x517bca-0x0;var _0x117c43=_0x0610[_0x517bca];return _0x117c43;};'use strict';var Sequelize=require(_0x0061('0x0'));module[_0x0061('0x1')]={'name':{'type':Sequelize[_0x0061('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0061('0x3')](_0x0061('0x4'),_0x0061('0x5')),'defaultValue':_0x0061('0x4')},'selector':{'type':Sequelize[_0x0061('0x2')]},'timeout':{'type':Sequelize[_0x0061('0x6')]}};
\ No newline at end of file
index 0f20f93..7225c0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbcc7=['find','create','body','catch','eml-format','rimraf','fast-json-patch','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','stack','name','send','show','params','keys','ChatProactiveAction','filters','intersection','model','query','fields','attributes','length','includeAll','include','merge','options'];(function(_0x1912cd,_0x1746bf){var _0x3c9336=function(_0x157695){while(--_0x157695){_0x1912cd['push'](_0x1912cd['shift']());}};_0x3c9336(++_0x1746bf);}(_0xbcc7,0x19a));var _0x7bcc=function(_0x5ea210,_0x246fbc){_0x5ea210=_0x5ea210-0x0;var _0x31f084=_0xbcc7[_0x5ea210];return _0x31f084;};'use strict';var emlformat=require(_0x7bcc('0x0'));var rimraf=require(_0x7bcc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7bcc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7bcc('0x3'));var Mustache=require('mustache');var util=require(_0x7bcc('0x4'));var path=require(_0x7bcc('0x5'));var sox=require('sox');var csv=require(_0x7bcc('0x6'));var ejs=require(_0x7bcc('0x7'));var fs=require('fs');var fs_extra=require(_0x7bcc('0x8'));var _=require(_0x7bcc('0x9'));var squel=require(_0x7bcc('0xa'));var crypto=require(_0x7bcc('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7bcc('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7bcc('0xd'));var Papa=require(_0x7bcc('0xe'));var Redis=require('ioredis');var authService=require(_0x7bcc('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bcc('0x10'))(_0x7bcc('0x11'));var utils=require(_0x7bcc('0x12'));var config=require(_0x7bcc('0x13'));var licenseUtil=require(_0x7bcc('0x14'));var db=require(_0x7bcc('0x15'))['db'];function respondWithStatusCode(_0xae46e8,_0x51b0e8){_0x51b0e8=_0x51b0e8||0xcc;return function(_0x3e3580){if(_0x3e3580){return _0xae46e8[_0x7bcc('0x16')](_0x51b0e8);}return _0xae46e8[_0x7bcc('0x17')](_0x51b0e8)[_0x7bcc('0x18')]();};}function respondWithResult(_0x39f912,_0x217896){_0x217896=_0x217896||0xc8;return function(_0x4a2539){if(_0x4a2539){return _0x39f912[_0x7bcc('0x17')](_0x217896)[_0x7bcc('0x19')](_0x4a2539);}};}function respondWithFilteredResult(_0x148618,_0x461ff7){return function(_0x30caa2){if(_0x30caa2){var _0x134d55=typeof _0x461ff7[_0x7bcc('0x1a')]==='undefined'&&typeof _0x461ff7[_0x7bcc('0x1b')]==='undefined';var _0x3156f3=_0x30caa2[_0x7bcc('0x1c')];var _0x340bd6=_0x134d55?0x0:_0x461ff7[_0x7bcc('0x1a')];var _0x49168c=_0x134d55?_0x30caa2['count']:_0x461ff7[_0x7bcc('0x1a')]+_0x461ff7[_0x7bcc('0x1b')];var _0x1a1b7f;if(_0x49168c>=_0x3156f3){_0x49168c=_0x3156f3;_0x1a1b7f=0xc8;}else{_0x1a1b7f=0xce;}_0x148618[_0x7bcc('0x17')](_0x1a1b7f);return _0x148618[_0x7bcc('0x1d')](_0x7bcc('0x1e'),_0x340bd6+'-'+_0x49168c+'/'+_0x3156f3)[_0x7bcc('0x19')](_0x30caa2);}return null;};}function patchUpdates(_0x3d0719){return function(_0x15b2c3){try{jsonpatch['apply'](_0x15b2c3,_0x3d0719,!![]);}catch(_0x553865){return BPromise[_0x7bcc('0x1f')](_0x553865);}return _0x15b2c3[_0x7bcc('0x20')]();};}function saveUpdates(_0x34ee2a,_0x3050cf){return function(_0x201f40){if(_0x201f40){return _0x201f40[_0x7bcc('0x21')](_0x34ee2a)[_0x7bcc('0x22')](function(_0x345671){return _0x345671;});}return null;};}function removeEntity(_0x32b3ea,_0x54c611){return function(_0x2d25b8){if(_0x2d25b8){return _0x2d25b8[_0x7bcc('0x23')]()[_0x7bcc('0x22')](function(){_0x32b3ea[_0x7bcc('0x17')](0xcc)[_0x7bcc('0x18')]();});}};}function handleEntityNotFound(_0x1d085c,_0x4f8562){return function(_0x48b296){if(!_0x48b296){_0x1d085c[_0x7bcc('0x16')](0x194);}return _0x48b296;};}function handleError(_0x4a91d0,_0x4db3c0){_0x4db3c0=_0x4db3c0||0x1f4;return function(_0xd3ca3b){logger['error'](_0xd3ca3b[_0x7bcc('0x24')]);if(_0xd3ca3b[_0x7bcc('0x25')]){delete _0xd3ca3b[_0x7bcc('0x25')];}_0x4a91d0['status'](_0x4db3c0)[_0x7bcc('0x26')](_0xd3ca3b);};}exports[_0x7bcc('0x27')]=function(_0x2e92e1,_0x319943){var _0x20c458={'raw':!![],'where':{'id':_0x2e92e1[_0x7bcc('0x28')]['id']}},_0x1ecf95={};_0x1ecf95['model']=_[_0x7bcc('0x29')](db[_0x7bcc('0x2a')]['rawAttributes']);_0x1ecf95['query']=_[_0x7bcc('0x29')](_0x2e92e1['query']);_0x1ecf95[_0x7bcc('0x2b')]=_[_0x7bcc('0x2c')](_0x1ecf95[_0x7bcc('0x2d')],_0x1ecf95[_0x7bcc('0x2e')]);_0x20c458['attributes']=_[_0x7bcc('0x2c')](_0x1ecf95[_0x7bcc('0x2d')],qs[_0x7bcc('0x2f')](_0x2e92e1['query'][_0x7bcc('0x2f')]));_0x20c458[_0x7bcc('0x30')]=_0x20c458[_0x7bcc('0x30')][_0x7bcc('0x31')]?_0x20c458[_0x7bcc('0x30')]:_0x1ecf95[_0x7bcc('0x2d')];if(_0x2e92e1[_0x7bcc('0x2e')][_0x7bcc('0x32')]){_0x20c458[_0x7bcc('0x33')]=[{'all':!![]}];}_0x20c458=_[_0x7bcc('0x34')]({},_0x20c458,_0x2e92e1[_0x7bcc('0x35')]);return db['ChatProactiveAction'][_0x7bcc('0x36')](_0x20c458)[_0x7bcc('0x22')](handleEntityNotFound(_0x319943,null))[_0x7bcc('0x22')](respondWithResult(_0x319943,null))['catch'](handleError(_0x319943,null));};exports['create']=function(_0x409ff4,_0x1ef50b){return db[_0x7bcc('0x2a')][_0x7bcc('0x37')](_0x409ff4[_0x7bcc('0x38')],{})[_0x7bcc('0x22')](respondWithResult(_0x1ef50b,0xc9))[_0x7bcc('0x39')](handleError(_0x1ef50b,null));};exports['update']=function(_0x5bbb4b,_0x5584f6){if(_0x5bbb4b['body']['id']){delete _0x5bbb4b[_0x7bcc('0x38')]['id'];}return db[_0x7bcc('0x2a')][_0x7bcc('0x36')]({'where':{'id':_0x5bbb4b['params']['id']}})[_0x7bcc('0x22')](handleEntityNotFound(_0x5584f6,null))[_0x7bcc('0x22')](saveUpdates(_0x5bbb4b[_0x7bcc('0x38')],null))['then'](respondWithResult(_0x5584f6,null))['catch'](handleError(_0x5584f6,null));};exports[_0x7bcc('0x23')]=function(_0xca6ce3,_0x1d9c06){return db['ChatProactiveAction']['find']({'where':{'id':_0xca6ce3[_0x7bcc('0x28')]['id']}})[_0x7bcc('0x22')](handleEntityNotFound(_0x1d9c06,null))[_0x7bcc('0x22')](removeEntity(_0x1d9c06,null))['catch'](handleError(_0x1d9c06,null));};
\ No newline at end of file
+var _0xbf07=['rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','lodash','crypto','desk.js','to-csv','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','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','find','catch','create','body','eml-format'];(function(_0x22a19c,_0xb78748){var _0x3d8120=function(_0x241270){while(--_0x241270){_0x22a19c['push'](_0x22a19c['shift']());}};_0x3d8120(++_0xb78748);}(_0xbf07,0x77));var _0x7bf0=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0xbf07[_0x207811];return _0x170d56;};'use strict';var emlformat=require(_0x7bf0('0x0'));var rimraf=require(_0x7bf0('0x1'));var zipdir=require(_0x7bf0('0x2'));var jsonpatch=require(_0x7bf0('0x3'));var rp=require('request-promise');var moment=require(_0x7bf0('0x4'));var BPromise=require(_0x7bf0('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x7bf0('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7bf0('0x7'));var squel=require('squel');var crypto=require(_0x7bf0('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x7bf0('0x9'));var toCsv=require(_0x7bf0('0xa'));var querystring=require(_0x7bf0('0xb'));var Papa=require(_0x7bf0('0xc'));var Redis=require(_0x7bf0('0xd'));var authService=require(_0x7bf0('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x7bf0('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bf0('0x10'))(_0x7bf0('0x11'));var utils=require(_0x7bf0('0x12'));var config=require(_0x7bf0('0x13'));var licenseUtil=require(_0x7bf0('0x14'));var db=require(_0x7bf0('0x15'))['db'];function respondWithStatusCode(_0xf81111,_0x2382fb){_0x2382fb=_0x2382fb||0xcc;return function(_0x1897e0){if(_0x1897e0){return _0xf81111[_0x7bf0('0x16')](_0x2382fb);}return _0xf81111[_0x7bf0('0x17')](_0x2382fb)[_0x7bf0('0x18')]();};}function respondWithResult(_0xf15732,_0x88142d){_0x88142d=_0x88142d||0xc8;return function(_0x13c6e9){if(_0x13c6e9){return _0xf15732[_0x7bf0('0x17')](_0x88142d)[_0x7bf0('0x19')](_0x13c6e9);}};}function respondWithFilteredResult(_0x383be0,_0x20fc70){return function(_0x182df9){if(_0x182df9){var _0x4f551c=typeof _0x20fc70[_0x7bf0('0x1a')]===_0x7bf0('0x1b')&&typeof _0x20fc70[_0x7bf0('0x1c')]===_0x7bf0('0x1b');var _0x13c9bb=_0x182df9['count'];var _0x254dc8=_0x4f551c?0x0:_0x20fc70[_0x7bf0('0x1a')];var _0x2a99fe=_0x4f551c?_0x182df9[_0x7bf0('0x1d')]:_0x20fc70[_0x7bf0('0x1a')]+_0x20fc70[_0x7bf0('0x1c')];var _0xf97278;if(_0x2a99fe>=_0x13c9bb){_0x2a99fe=_0x13c9bb;_0xf97278=0xc8;}else{_0xf97278=0xce;}_0x383be0[_0x7bf0('0x17')](_0xf97278);return _0x383be0[_0x7bf0('0x1e')](_0x7bf0('0x1f'),_0x254dc8+'-'+_0x2a99fe+'/'+_0x13c9bb)['json'](_0x182df9);}return null;};}function patchUpdates(_0x115f78){return function(_0x131a9b){try{jsonpatch[_0x7bf0('0x20')](_0x131a9b,_0x115f78,!![]);}catch(_0x3a74b6){return BPromise[_0x7bf0('0x21')](_0x3a74b6);}return _0x131a9b[_0x7bf0('0x22')]();};}function saveUpdates(_0x4e41b6,_0x4924d8){return function(_0x4379cb){if(_0x4379cb){return _0x4379cb[_0x7bf0('0x23')](_0x4e41b6)['then'](function(_0x4345a3){return _0x4345a3;});}return null;};}function removeEntity(_0x4b5278,_0x157e0f){return function(_0x44e281){if(_0x44e281){return _0x44e281[_0x7bf0('0x24')]()[_0x7bf0('0x25')](function(){_0x4b5278[_0x7bf0('0x17')](0xcc)[_0x7bf0('0x18')]();});}};}function handleEntityNotFound(_0x2e4994,_0xb4c390){return function(_0x14a98c){if(!_0x14a98c){_0x2e4994[_0x7bf0('0x16')](0x194);}return _0x14a98c;};}function handleError(_0x1e0f7f,_0x573ab4){_0x573ab4=_0x573ab4||0x1f4;return function(_0x366c54){logger[_0x7bf0('0x26')](_0x366c54[_0x7bf0('0x27')]);if(_0x366c54[_0x7bf0('0x28')]){delete _0x366c54[_0x7bf0('0x28')];}_0x1e0f7f['status'](_0x573ab4)[_0x7bf0('0x29')](_0x366c54);};}exports[_0x7bf0('0x2a')]=function(_0x4d1b7a,_0x145f54){var _0x540e84={'raw':!![],'where':{'id':_0x4d1b7a[_0x7bf0('0x2b')]['id']}},_0x1393f7={};_0x1393f7[_0x7bf0('0x2c')]=_['keys'](db[_0x7bf0('0x2d')][_0x7bf0('0x2e')]);_0x1393f7[_0x7bf0('0x2f')]=_['keys'](_0x4d1b7a[_0x7bf0('0x2f')]);_0x1393f7[_0x7bf0('0x30')]=_[_0x7bf0('0x31')](_0x1393f7[_0x7bf0('0x2c')],_0x1393f7['query']);_0x540e84[_0x7bf0('0x32')]=_[_0x7bf0('0x31')](_0x1393f7[_0x7bf0('0x2c')],qs[_0x7bf0('0x33')](_0x4d1b7a[_0x7bf0('0x2f')]['fields']));_0x540e84[_0x7bf0('0x32')]=_0x540e84[_0x7bf0('0x32')]['length']?_0x540e84[_0x7bf0('0x32')]:_0x1393f7[_0x7bf0('0x2c')];if(_0x4d1b7a['query'][_0x7bf0('0x34')]){_0x540e84[_0x7bf0('0x35')]=[{'all':!![]}];}_0x540e84=_[_0x7bf0('0x36')]({},_0x540e84,_0x4d1b7a[_0x7bf0('0x37')]);return db[_0x7bf0('0x2d')][_0x7bf0('0x38')](_0x540e84)[_0x7bf0('0x25')](handleEntityNotFound(_0x145f54,null))[_0x7bf0('0x25')](respondWithResult(_0x145f54,null))[_0x7bf0('0x39')](handleError(_0x145f54,null));};exports[_0x7bf0('0x3a')]=function(_0x458142,_0x37217c){return db[_0x7bf0('0x2d')][_0x7bf0('0x3a')](_0x458142[_0x7bf0('0x3b')],{})['then'](respondWithResult(_0x37217c,0xc9))[_0x7bf0('0x39')](handleError(_0x37217c,null));};exports[_0x7bf0('0x23')]=function(_0x351336,_0x946380){if(_0x351336[_0x7bf0('0x3b')]['id']){delete _0x351336['body']['id'];}return db[_0x7bf0('0x2d')][_0x7bf0('0x38')]({'where':{'id':_0x351336['params']['id']}})[_0x7bf0('0x25')](handleEntityNotFound(_0x946380,null))['then'](saveUpdates(_0x351336[_0x7bf0('0x3b')],null))[_0x7bf0('0x25')](respondWithResult(_0x946380,null))[_0x7bf0('0x39')](handleError(_0x946380,null));};exports[_0x7bf0('0x24')]=function(_0x172d35,_0xed9c6b){return db[_0x7bf0('0x2d')]['find']({'where':{'id':_0x172d35['params']['id']}})[_0x7bf0('0x25')](handleEntityNotFound(_0xed9c6b,null))[_0x7bf0('0x25')](removeEntity(_0xed9c6b,null))[_0x7bf0('0x39')](handleError(_0xed9c6b,null));};
\ No newline at end of file
index 4ebf8c7..d9a65fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdae7=['define','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xdae7,0x1f0));var _0x7dae=function(_0xe0c564,_0x2ff569){_0xe0c564=_0xe0c564-0x0;var _0x32e0f6=_0xdae7[_0xe0c564];return _0x32e0f6;};'use strict';var _=require(_0x7dae('0x0'));var util=require(_0x7dae('0x1'));var logger=require(_0x7dae('0x2'))(_0x7dae('0x3'));var moment=require(_0x7dae('0x4'));var BPromise=require(_0x7dae('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7dae('0x6'));var rimraf=require(_0x7dae('0x7'));var config=require(_0x7dae('0x8'));var attributes=require(_0x7dae('0x9'));module[_0x7dae('0xa')]=function(_0x36462c,_0x75a8fb){return _0x36462c[_0x7dae('0xb')]('ChatProactiveAction',attributes,{'tableName':_0x7dae('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa87c=['./chatProactiveAction.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0xe78bdf,_0x102a52){var _0x197f88=function(_0x34124a){while(--_0x34124a){_0xe78bdf['push'](_0xe78bdf['shift']());}};_0x197f88(++_0x102a52);}(_0xa87c,0x142));var _0xca87=function(_0x54e4ec,_0x183144){_0x54e4ec=_0x54e4ec-0x0;var _0x44ef91=_0xa87c[_0x54e4ec];return _0x44ef91;};'use strict';var _=require(_0xca87('0x0'));var util=require('util');var logger=require(_0xca87('0x1'))(_0xca87('0x2'));var moment=require(_0xca87('0x3'));var BPromise=require(_0xca87('0x4'));var rp=require(_0xca87('0x5'));var fs=require('fs');var path=require(_0xca87('0x6'));var rimraf=require('rimraf');var config=require(_0xca87('0x7'));var attributes=require(_0xca87('0x8'));module[_0xca87('0x9')]=function(_0x133a81,_0x24bc6b){return _0x133a81[_0xca87('0xa')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8fbdc46..d691e0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb21b=['client','request','then','info','request\x20sent','debug','error','code','message','ChatProactiveAction,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1470b4,_0x660ead){var _0x14dd3f=function(_0x45324a){while(--_0x45324a){_0x1470b4['push'](_0x1470b4['shift']());}};_0x14dd3f(++_0x660ead);}(_0xb21b,0x185));var _0xbb21=function(_0x767c,_0x5e6b61){_0x767c=_0x767c-0x0;var _0x1883ad=_0xb21b[_0x767c];return _0x1883ad;};'use strict';var _=require(_0xbb21('0x0'));var util=require(_0xbb21('0x1'));var moment=require(_0xbb21('0x2'));var BPromise=require(_0xbb21('0x3'));var rs=require(_0xbb21('0x4'));var fs=require('fs');var Redis=require(_0xbb21('0x5'));var db=require(_0xbb21('0x6'))['db'];var utils=require(_0xbb21('0x7'));var logger=require(_0xbb21('0x8'))(_0xbb21('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbb21('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x540a1f,_0x47a903,_0x460b98){return new BPromise(function(_0x12c4df,_0x15d5b0){return client[_0xbb21('0xb')](_0x540a1f,_0x460b98)[_0xbb21('0xc')](function(_0x382b8e){logger[_0xbb21('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x47a903,_0xbb21('0xe'));logger[_0xbb21('0xf')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x47a903,'request\x20sent',JSON['stringify'](_0x382b8e));if(_0x382b8e[_0xbb21('0x10')]){if(_0x382b8e[_0xbb21('0x10')][_0xbb21('0x11')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x47a903,_0x382b8e[_0xbb21('0x10')][_0xbb21('0x12')]);return _0x15d5b0(_0x382b8e[_0xbb21('0x10')][_0xbb21('0x12')]);}logger[_0xbb21('0x10')](_0xbb21('0x13'),_0x47a903,_0x382b8e[_0xbb21('0x10')]['message']);return _0x12c4df(_0x382b8e['error'][_0xbb21('0x12')]);}else{logger[_0xbb21('0xd')](_0xbb21('0x13'),_0x47a903,_0xbb21('0xe'));_0x12c4df(_0x382b8e[_0xbb21('0x14')][_0xbb21('0x12')]);}})['catch'](function(_0x199e1c){logger['error'](_0xbb21('0x13'),_0x47a903,_0x199e1c);_0x15d5b0(_0x199e1c);});});}
\ No newline at end of file
+var _0xa6f9=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatProactiveAction,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring'];(function(_0x31745c,_0x3b8d6e){var _0xbee8b7=function(_0x53d485){while(--_0x53d485){_0x31745c['push'](_0x31745c['shift']());}};_0xbee8b7(++_0x3b8d6e);}(_0xa6f9,0x165));var _0x9a6f=function(_0xa7dfcd,_0x3ab8bd){_0xa7dfcd=_0xa7dfcd-0x0;var _0x5d8883=_0xa6f9[_0xa7dfcd];return _0x5d8883;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9a6f('0x0'));var BPromise=require(_0x9a6f('0x1'));var rs=require(_0x9a6f('0x2'));var fs=require('fs');var Redis=require(_0x9a6f('0x3'));var db=require(_0x9a6f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9a6f('0x5'));var config=require(_0x9a6f('0x6'));var jayson=require(_0x9a6f('0x7'));var client=jayson[_0x9a6f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa0532e,_0x3373f4,_0x24ea6c){return new BPromise(function(_0x4bc86e,_0x3cd9c2){return client[_0x9a6f('0x9')](_0xa0532e,_0x24ea6c)[_0x9a6f('0xa')](function(_0x13e018){logger[_0x9a6f('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x3373f4,_0x9a6f('0xc'));logger['debug'](_0x9a6f('0xd'),_0x3373f4,_0x9a6f('0xc'),JSON[_0x9a6f('0xe')](_0x13e018));if(_0x13e018[_0x9a6f('0xf')]){if(_0x13e018[_0x9a6f('0xf')]['code']===0x1f4){logger[_0x9a6f('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x3373f4,_0x13e018[_0x9a6f('0xf')]['message']);return _0x3cd9c2(_0x13e018[_0x9a6f('0xf')][_0x9a6f('0x10')]);}logger[_0x9a6f('0xf')](_0x9a6f('0x11'),_0x3373f4,_0x13e018[_0x9a6f('0xf')]['message']);return _0x4bc86e(_0x13e018[_0x9a6f('0xf')]['message']);}else{logger[_0x9a6f('0xb')](_0x9a6f('0x11'),_0x3373f4,_0x9a6f('0xc'));_0x4bc86e(_0x13e018[_0x9a6f('0x12')][_0x9a6f('0x10')]);}})[_0x9a6f('0x13')](function(_0x11ab8b){logger[_0x9a6f('0xf')](_0x9a6f('0x11'),_0x3373f4,_0x11ab8b);_0x3cd9c2(_0x11ab8b);});});}
\ No newline at end of file
index 2456941..92876bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa630=['/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','express','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get'];(function(_0xdd5ad9,_0x3ed961){var _0x18e168=function(_0x52f7ba){while(--_0x52f7ba){_0xdd5ad9['push'](_0xdd5ad9['shift']());}};_0x18e168(++_0x3ed961);}(_0xa630,0xbe));var _0x0a63=function(_0x4e5343,_0x3df35b){_0x4e5343=_0x4e5343-0x0;var _0x4f8e9d=_0xa630[_0x4e5343];return _0x4f8e9d;};'use strict';var multer=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a63('0x2'));var router=express['Router']();var fs_extra=require(_0x0a63('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0a63('0x4'));var config=require(_0x0a63('0x5'));var controller=require(_0x0a63('0x6'));router[_0x0a63('0x7')](_0x0a63('0x8'),auth['isAuthenticated'](),controller[_0x0a63('0x9')]);router[_0x0a63('0xa')]('/',auth[_0x0a63('0xb')](),controller[_0x0a63('0xc')]);router[_0x0a63('0xd')](_0x0a63('0x8'),auth['isAuthenticated'](),controller[_0x0a63('0xe')]);router[_0x0a63('0xf')](_0x0a63('0x8'),auth[_0x0a63('0xb')](),controller[_0x0a63('0x10')]);module[_0x0a63('0x11')]=router;
\ No newline at end of file
+var _0xe14b=['/:id','isAuthenticated','show','post','update','delete','exports','multer','util','express','Router','../../components/auth/service','./chatProactiveAction.controller','get'];(function(_0x228445,_0x4bfa2b){var _0x33d4f8=function(_0x15917e){while(--_0x15917e){_0x228445['push'](_0x228445['shift']());}};_0x33d4f8(++_0x4bfa2b);}(_0xe14b,0x93));var _0xbe14=function(_0x25dc61,_0x19fae8){_0x25dc61=_0x25dc61-0x0;var _0x21e26c=_0xe14b[_0x25dc61];return _0x21e26c;};'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')](_0xbe14('0x7'),auth[_0xbe14('0x8')](),controller[_0xbe14('0x9')]);router[_0xbe14('0xa')]('/',auth[_0xbe14('0x8')](),controller['create']);router['put']('/:id',auth[_0xbe14('0x8')](),controller[_0xbe14('0xb')]);router[_0xbe14('0xc')](_0xbe14('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0xbe14('0xd')]=router;
\ No newline at end of file
index f8eacd0..e20dd0b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9e7=['ENUM','rrmemory','sequelize','STRING','name'];(function(_0x403687,_0x10c094){var _0x27e03f=function(_0x391589){while(--_0x391589){_0x403687['push'](_0x403687['shift']());}};_0x27e03f(++_0x10c094);}(_0xd9e7,0x7f));var _0x7d9e=function(_0x236d24,_0x29e80a){_0x236d24=_0x236d24-0x0;var _0x1574cf=_0xd9e7[_0x236d24];return _0x1574cf;};'use strict';var Sequelize=require(_0x7d9e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7d9e('0x1')],'unique':_0x7d9e('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7d9e('0x3')](_0x7d9e('0x4'),'beepall','roundrobin')}};
\ No newline at end of file
+var _0xcc21=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x53adf1,_0x2e4d6f){var _0x3334b1=function(_0x22b979){while(--_0x22b979){_0x53adf1['push'](_0x53adf1['shift']());}};_0x3334b1(++_0x2e4d6f);}(_0xcc21,0x9e));var _0x1cc2=function(_0x53ec7a,_0x2c1f7e){_0x53ec7a=_0x53ec7a-0x0;var _0x3a1407=_0xcc21[_0x53ec7a];return _0x3a1407;};'use strict';var Sequelize=require(_0x1cc2('0x0'));module[_0x1cc2('0x1')]={'name':{'type':Sequelize[_0x1cc2('0x2')],'unique':_0x1cc2('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1cc2('0x2')]},'timeout':{'type':Sequelize[_0x1cc2('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1cc2('0x5')](_0x1cc2('0x6'),_0x1cc2('0x7'),_0x1cc2('0x8'))}};
\ No newline at end of file
index 00daa82..0534663 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf30=['isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','request-promise','moment','bluebird','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','result','catch','sendStatus','status','offset','limit','undefined','Content-Range','apply','reject','update','destroy','get','ChatQueues','end','stack','name','index','map','ChatQueue','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','count','includeAll','include','rows','show','params','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserChatQueue','order','ChatQueueId','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','ids','Agents','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userChatQueue:save','removeTeams','select','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','SELECT','every','TeamId','all','union','compact','value'];(function(_0x214229,_0x1a5e58){var _0x55912c=function(_0x350571){while(--_0x350571){_0x214229['push'](_0x214229['shift']());}};_0x55912c(++_0x1a5e58);}(_0xbf30,0x1bb));var _0x0bf3=function(_0x3132a3,_0x411208){_0x3132a3=_0x3132a3-0x0;var _0x2eba4a=_0xbf30[_0x3132a3];return _0x2eba4a;};'use strict';var emlformat=require(_0x0bf3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0bf3('0x1'));var moment=require(_0x0bf3('0x2'));var BPromise=require(_0x0bf3('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x0bf3('0x4'));var ejs=require(_0x0bf3('0x5'));var fs=require('fs');var fs_extra=require(_0x0bf3('0x6'));var _=require(_0x0bf3('0x7'));var squel=require(_0x0bf3('0x8'));var crypto=require(_0x0bf3('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x0bf3('0xa'));var toCsv=require(_0x0bf3('0x4'));var querystring=require('querystring');var Papa=require(_0x0bf3('0xb'));var Redis=require(_0x0bf3('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x0bf3('0xd'));var as=require(_0x0bf3('0xe'));var hardwareService=require(_0x0bf3('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0bf3('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x0bf3('0x11'))['db'];config[_0x0bf3('0x12')]=_[_0x0bf3('0x13')](config[_0x0bf3('0x12')],{'host':_0x0bf3('0x14'),'port':0x18eb});var socket=require(_0x0bf3('0x15'))(new Redis(config['redis']));require(_0x0bf3('0x16'))[_0x0bf3('0x17')](socket);var jayson=require(_0x0bf3('0x18'));var client=jayson['client'][_0x0bf3('0x19')]({'port':0x232a});function respondWithRpcPromise(_0xf990be,_0x1e3b8b,_0x4508bb,_0x148efe){return new BPromise(function(_0x3f83dd,_0x524c0f){var _0x2110b2=_0x148efe||client;return _0x2110b2[_0x0bf3('0x1a')](_0xf990be,_0x4508bb)[_0x0bf3('0x1b')](function(_0x3d59ca){logger[_0x0bf3('0x1c')](_0x0bf3('0x1d'),_0x1e3b8b,_0x0bf3('0x1e'));logger[_0x0bf3('0x1f')](_0x0bf3('0x20'),_0x1e3b8b,_0x0bf3('0x1e'),JSON[_0x0bf3('0x21')](_0x3d59ca));if(_0x3d59ca[_0x0bf3('0x22')]){if(_0x3d59ca[_0x0bf3('0x22')][_0x0bf3('0x23')]===0x1f4){logger['error'](_0x0bf3('0x1d'),_0x1e3b8b,_0x3d59ca[_0x0bf3('0x22')]['message']);return _0x524c0f(_0x3d59ca[_0x0bf3('0x22')]['message']);}logger[_0x0bf3('0x22')](_0x0bf3('0x1d'),_0x1e3b8b,_0x3d59ca[_0x0bf3('0x22')]['message']);return _0x3f83dd(_0x3d59ca[_0x0bf3('0x22')]['message']);}else{logger['info'](_0x0bf3('0x1d'),_0x1e3b8b,_0x0bf3('0x1e'));_0x3f83dd(_0x3d59ca[_0x0bf3('0x24')]['message']);}})[_0x0bf3('0x25')](function(_0x2eec90){logger[_0x0bf3('0x22')]('ChatQueue,\x20%s,\x20%s',_0x1e3b8b,_0x2eec90);_0x524c0f(_0x2eec90);});});}function respondWithStatusCode(_0x3cef4e,_0x10f3ef){_0x10f3ef=_0x10f3ef||0xcc;return function(_0x5184fb){if(_0x5184fb){return _0x3cef4e[_0x0bf3('0x26')](_0x10f3ef);}return _0x3cef4e[_0x0bf3('0x27')](_0x10f3ef)['end']();};}function respondWithResult(_0x8d0602,_0x24a0d1){_0x24a0d1=_0x24a0d1||0xc8;return function(_0x408e09){if(_0x408e09){return _0x8d0602[_0x0bf3('0x27')](_0x24a0d1)['json'](_0x408e09);}};}function respondWithFilteredResult(_0x5627f3,_0x130734){return function(_0x21d651){if(_0x21d651){var _0x54eb4b=typeof _0x130734[_0x0bf3('0x28')]==='undefined'&&typeof _0x130734[_0x0bf3('0x29')]===_0x0bf3('0x2a');var _0x53c8bd=_0x21d651['count'];var _0x122e59=_0x54eb4b?0x0:_0x130734['offset'];var _0x48cd92=_0x54eb4b?_0x21d651['count']:_0x130734[_0x0bf3('0x28')]+_0x130734[_0x0bf3('0x29')];var _0x3f8b86;if(_0x48cd92>=_0x53c8bd){_0x48cd92=_0x53c8bd;_0x3f8b86=0xc8;}else{_0x3f8b86=0xce;}_0x5627f3[_0x0bf3('0x27')](_0x3f8b86);return _0x5627f3['set'](_0x0bf3('0x2b'),_0x122e59+'-'+_0x48cd92+'/'+_0x53c8bd)['json'](_0x21d651);}return null;};}function patchUpdates(_0x1e8bb5){return function(_0x1ff26f){try{jsonpatch[_0x0bf3('0x2c')](_0x1ff26f,_0x1e8bb5,!![]);}catch(_0x22f25a){return BPromise[_0x0bf3('0x2d')](_0x22f25a);}return _0x1ff26f['save']();};}function saveUpdates(_0x35617e,_0x5870d3){return function(_0x442cec){if(_0x442cec){return _0x442cec[_0x0bf3('0x2e')](_0x35617e)[_0x0bf3('0x1b')](function(_0x172a99){return _0x172a99;});}return null;};}function removeEntity(_0x56b25d,_0x572134){return function(_0x45bdb9){if(_0x45bdb9){return _0x45bdb9[_0x0bf3('0x2f')]()[_0x0bf3('0x1b')](function(){var _0x12da08=_0x45bdb9[_0x0bf3('0x30')]({'plain':!![]});var _0x590a79=_0x0bf3('0x31');return db['UserProfileResource']['destroy']({'where':{'type':_0x590a79,'resourceId':_0x12da08['id']}})[_0x0bf3('0x1b')](function(){return _0x45bdb9;});})[_0x0bf3('0x1b')](function(){_0x56b25d[_0x0bf3('0x27')](0xcc)[_0x0bf3('0x32')]();});}};}function handleEntityNotFound(_0xd55b18,_0xb53878){return function(_0x3be0d9){if(!_0x3be0d9){_0xd55b18[_0x0bf3('0x26')](0x194);}return _0x3be0d9;};}function handleError(_0x3226fb,_0x1c1ef5){_0x1c1ef5=_0x1c1ef5||0x1f4;return function(_0x46ab76){logger[_0x0bf3('0x22')](_0x46ab76[_0x0bf3('0x33')]);if(_0x46ab76[_0x0bf3('0x34')]){delete _0x46ab76[_0x0bf3('0x34')];}_0x3226fb[_0x0bf3('0x27')](_0x1c1ef5)['send'](_0x46ab76);};}exports[_0x0bf3('0x35')]=function(_0x10d8d6,_0x4021f6){var _0x149986={},_0x2cba70={},_0x294d45={'count':0x0,'rows':[]};var _0x13d2b7=_[_0x0bf3('0x36')](db[_0x0bf3('0x37')][_0x0bf3('0x38')],function(_0x205a91){return{'name':_0x205a91[_0x0bf3('0x39')],'type':_0x205a91[_0x0bf3('0x3a')]['key']};});_0x2cba70[_0x0bf3('0x3b')]=_[_0x0bf3('0x36')](_0x13d2b7,_0x0bf3('0x34'));_0x2cba70['query']=_[_0x0bf3('0x3c')](_0x10d8d6[_0x0bf3('0x3d')]);_0x2cba70['filters']=_[_0x0bf3('0x3e')](_0x2cba70['model'],_0x2cba70[_0x0bf3('0x3d')]);_0x149986[_0x0bf3('0x3f')]=_[_0x0bf3('0x3e')](_0x2cba70[_0x0bf3('0x3b')],qs[_0x0bf3('0x40')](_0x10d8d6['query'][_0x0bf3('0x40')]));_0x149986[_0x0bf3('0x3f')]=_0x149986[_0x0bf3('0x3f')][_0x0bf3('0x41')]?_0x149986[_0x0bf3('0x3f')]:_0x2cba70[_0x0bf3('0x3b')];if(!_0x10d8d6[_0x0bf3('0x3d')][_0x0bf3('0x42')](_0x0bf3('0x43'))){_0x149986[_0x0bf3('0x29')]=qs[_0x0bf3('0x29')](_0x10d8d6[_0x0bf3('0x3d')][_0x0bf3('0x29')]);_0x149986[_0x0bf3('0x28')]=qs[_0x0bf3('0x28')](_0x10d8d6[_0x0bf3('0x3d')]['offset']);}_0x149986['order']=qs[_0x0bf3('0x44')](_0x10d8d6[_0x0bf3('0x3d')][_0x0bf3('0x44')]);_0x149986[_0x0bf3('0x45')]=qs[_0x0bf3('0x46')](_[_0x0bf3('0x47')](_0x10d8d6[_0x0bf3('0x3d')],_0x2cba70[_0x0bf3('0x46')]),_0x13d2b7);if(_0x10d8d6[_0x0bf3('0x3d')][_0x0bf3('0x48')]){_0x149986[_0x0bf3('0x45')]=_[_0x0bf3('0x49')](_0x149986[_0x0bf3('0x45')],{'$or':_['map'](_0x13d2b7,function(_0x109c2d){if(_0x109c2d['type']!=='VIRTUAL'){var _0x551d9d={};_0x551d9d[_0x109c2d[_0x0bf3('0x34')]]={'$like':'%'+_0x10d8d6[_0x0bf3('0x3d')][_0x0bf3('0x48')]+'%'};return _0x551d9d;}})});}_0x149986=_[_0x0bf3('0x49')]({},_0x149986,_0x10d8d6[_0x0bf3('0x4a')]);var _0x30fc78={'where':_0x149986[_0x0bf3('0x45')]};return db[_0x0bf3('0x37')][_0x0bf3('0x4b')](_0x30fc78)[_0x0bf3('0x1b')](function(_0x5ad150){_0x294d45[_0x0bf3('0x4b')]=_0x5ad150;if(_0x10d8d6[_0x0bf3('0x3d')][_0x0bf3('0x4c')]){_0x149986[_0x0bf3('0x4d')]=[{'all':!![]}];}return db[_0x0bf3('0x37')]['findAll'](_0x149986);})[_0x0bf3('0x1b')](function(_0x26cb7a){_0x294d45[_0x0bf3('0x4e')]=_0x26cb7a;return _0x294d45;})[_0x0bf3('0x1b')](respondWithFilteredResult(_0x4021f6,_0x149986))[_0x0bf3('0x25')](handleError(_0x4021f6,null));};exports[_0x0bf3('0x4f')]=function(_0x3cb3f9,_0x2651bf){var _0x1db4a5={'raw':!![],'where':{'id':_0x3cb3f9[_0x0bf3('0x50')]['id']}},_0x5b4527={};_0x5b4527[_0x0bf3('0x3b')]=_[_0x0bf3('0x3c')](db[_0x0bf3('0x37')]['rawAttributes']);_0x5b4527[_0x0bf3('0x3d')]=_[_0x0bf3('0x3c')](_0x3cb3f9[_0x0bf3('0x3d')]);_0x5b4527[_0x0bf3('0x46')]=_['intersection'](_0x5b4527[_0x0bf3('0x3b')],_0x5b4527[_0x0bf3('0x3d')]);_0x1db4a5[_0x0bf3('0x3f')]=_['intersection'](_0x5b4527[_0x0bf3('0x3b')],qs['fields'](_0x3cb3f9[_0x0bf3('0x3d')][_0x0bf3('0x40')]));_0x1db4a5[_0x0bf3('0x3f')]=_0x1db4a5[_0x0bf3('0x3f')][_0x0bf3('0x41')]?_0x1db4a5[_0x0bf3('0x3f')]:_0x5b4527[_0x0bf3('0x3b')];if(_0x3cb3f9[_0x0bf3('0x3d')][_0x0bf3('0x4c')]){_0x1db4a5[_0x0bf3('0x4d')]=[{'all':!![]}];}_0x1db4a5=_[_0x0bf3('0x49')]({},_0x1db4a5,_0x3cb3f9[_0x0bf3('0x4a')]);return db['ChatQueue'][_0x0bf3('0x51')](_0x1db4a5)[_0x0bf3('0x1b')](handleEntityNotFound(_0x2651bf,null))[_0x0bf3('0x1b')](respondWithResult(_0x2651bf,null))[_0x0bf3('0x25')](handleError(_0x2651bf,null));};exports['create']=function(_0x399111,_0x172534){return db[_0x0bf3('0x37')]['create'](_0x399111['body'],{})[_0x0bf3('0x1b')](function(_0x2b6bb8){var _0x3eae2b=_0x399111['user']['get']({'plain':!![]});if(!_0x3eae2b)throw new Error(_0x0bf3('0x52'));if(_0x3eae2b[_0x0bf3('0x53')]===_0x0bf3('0x54')){var _0x189870=_0x2b6bb8[_0x0bf3('0x30')]({'plain':!![]});var _0x5a3efb=_0x0bf3('0x31');return db[_0x0bf3('0x55')][_0x0bf3('0x51')]({'where':{'name':_0x5a3efb,'userProfileId':_0x3eae2b['userProfileId']},'raw':!![]})['then'](function(_0xb194ed){if(_0xb194ed&&_0xb194ed[_0x0bf3('0x56')]===0x0){return db['UserProfileResource'][_0x0bf3('0x57')]({'name':_0x189870['name'],'resourceId':_0x189870['id'],'type':_0xb194ed[_0x0bf3('0x34')],'sectionId':_0xb194ed['id']},{})[_0x0bf3('0x1b')](function(){return _0x2b6bb8;});}else{return _0x2b6bb8;}})[_0x0bf3('0x25')](function(_0x585533){logger[_0x0bf3('0x22')](_0x0bf3('0x58'),_0x585533);throw _0x585533;});}return _0x2b6bb8;})[_0x0bf3('0x1b')](respondWithResult(_0x172534,0xc9))[_0x0bf3('0x25')](handleError(_0x172534,null));};exports[_0x0bf3('0x2e')]=function(_0x38e3ba,_0x406a4b){if(_0x38e3ba[_0x0bf3('0x59')]['id']){delete _0x38e3ba['body']['id'];}return db[_0x0bf3('0x37')][_0x0bf3('0x51')]({'where':{'id':_0x38e3ba[_0x0bf3('0x50')]['id']}})[_0x0bf3('0x1b')](handleEntityNotFound(_0x406a4b,null))['then'](saveUpdates(_0x38e3ba[_0x0bf3('0x59')],null))[_0x0bf3('0x1b')](respondWithResult(_0x406a4b,null))['catch'](handleError(_0x406a4b,null));};exports[_0x0bf3('0x2f')]=function(_0xd8b30e,_0x3a9fd7){return db['ChatQueue']['find']({'where':{'id':_0xd8b30e[_0x0bf3('0x50')]['id']}})['then'](handleEntityNotFound(_0x3a9fd7,null))[_0x0bf3('0x1b')](removeEntity(_0x3a9fd7,null))[_0x0bf3('0x25')](handleError(_0x3a9fd7,null));};exports[_0x0bf3('0x5a')]=function(_0x3b9a62,_0x224039){return db['ChatQueue'][_0x0bf3('0x5a')]()[_0x0bf3('0x1b')](respondWithResult(_0x224039,null))[_0x0bf3('0x25')](handleError(_0x224039,null));};exports['getMembers']=function(_0x27d9d0,_0x301bce,_0x20c017){var _0x375fd8={'raw':!![],'where':{}},_0x994b78={},_0x4f3e7d;return db['ChatQueue'][_0x0bf3('0x5b')]({'where':{'id':_0x27d9d0[_0x0bf3('0x50')]['id']}})[_0x0bf3('0x1b')](handleEntityNotFound(_0x301bce,null))[_0x0bf3('0x1b')](function(_0x195bad){if(_0x195bad){_0x4f3e7d=_0x195bad[_0x0bf3('0x30')]({'plain':!![]});_0x994b78[_0x0bf3('0x3b')]=_[_0x0bf3('0x3c')](db[_0x0bf3('0x5c')][_0x0bf3('0x38')]);_0x994b78[_0x0bf3('0x3d')]=_[_0x0bf3('0x3c')](_0x27d9d0[_0x0bf3('0x3d')]);_0x994b78[_0x0bf3('0x46')]=_[_0x0bf3('0x3e')](_0x994b78[_0x0bf3('0x3b')],_0x994b78[_0x0bf3('0x3d')]);_0x375fd8['attributes']=_[_0x0bf3('0x3e')](_0x994b78[_0x0bf3('0x3b')],qs[_0x0bf3('0x40')](_0x27d9d0['query']['fields']));_0x375fd8[_0x0bf3('0x3f')]=_0x375fd8['attributes'][_0x0bf3('0x41')]?_0x375fd8['attributes']:_0x994b78[_0x0bf3('0x3b')];if(!_0x27d9d0['query'][_0x0bf3('0x42')](_0x0bf3('0x43'))){_0x375fd8[_0x0bf3('0x29')]=qs[_0x0bf3('0x29')](_0x27d9d0[_0x0bf3('0x3d')][_0x0bf3('0x29')]);_0x375fd8['offset']=qs['offset'](_0x27d9d0[_0x0bf3('0x3d')][_0x0bf3('0x28')]);}_0x375fd8[_0x0bf3('0x5d')]=qs[_0x0bf3('0x44')](_0x27d9d0['query'][_0x0bf3('0x44')]);_0x375fd8[_0x0bf3('0x45')]=qs[_0x0bf3('0x46')](_[_0x0bf3('0x47')](_0x27d9d0[_0x0bf3('0x3d')],_0x994b78[_0x0bf3('0x46')]));_0x375fd8['where'][_0x0bf3('0x5e')]=_0x195bad['id'];if(_0x27d9d0[_0x0bf3('0x3d')][_0x0bf3('0x48')]){_0x375fd8[_0x0bf3('0x45')]=_[_0x0bf3('0x49')](_0x375fd8[_0x0bf3('0x45')],{'$or':_['map'](_0x375fd8['attributes'],function(_0x857839){var _0x173ad0={};_0x173ad0[_0x857839]={'$like':'%'+_0x27d9d0[_0x0bf3('0x3d')][_0x0bf3('0x48')]+'%'};return _0x173ad0;})});}_0x375fd8=_[_0x0bf3('0x49')]({},_0x375fd8,_0x27d9d0['options']);return db[_0x0bf3('0x5c')][_0x0bf3('0x5f')](_0x375fd8);}})[_0x0bf3('0x1b')](function(_0x21cd89){if(_0x21cd89){return db[_0x0bf3('0x60')][_0x0bf3('0x61')]({'where':{'id':_['map'](_0x21cd89,_0x0bf3('0x62')),'role':_0x0bf3('0x63')},'attributes':['id',_0x0bf3('0x34'),_0x0bf3('0x64'),_0x0bf3('0x65'),_0x0bf3('0x66')]});}})[_0x0bf3('0x1b')](function(_0x4d2b67){if(_0x4d2b67){return{'count':_0x4d2b67[_0x0bf3('0x4b')],'rows':_['map'](_0x4d2b67[_0x0bf3('0x4e')],function(_0xb60014){return{'membername':_0xb60014[_0x0bf3('0x34')],'UserId':_0xb60014['id'],'queue_name':_0x4f3e7d[_0x0bf3('0x34')],'ChatQueueId':_0x4f3e7d['id'],'interface':util['format'](_0x0bf3('0x67'),_0x0bf3('0x68'),_0xb60014['name']),'penalty':0x0,'paused':_0xb60014[_0x0bf3('0x64')],'createdAt':_0xb60014['createdAt'],'updatedAt':_0xb60014[_0x0bf3('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0bf3('0x1b')](respondWithFilteredResult(_0x301bce,_0x375fd8))[_0x0bf3('0x25')](handleError(_0x301bce,null));};exports[_0x0bf3('0x69')]=function(_0xaa43d1,_0x40364b,_0x55e7f4){var _0x611e07={};var _0x5f56a8={};var _0x24b235;var _0x209f8f;return db[_0x0bf3('0x37')][_0x0bf3('0x5b')]({'where':{'id':_0xaa43d1[_0x0bf3('0x50')]['id']}})[_0x0bf3('0x1b')](handleEntityNotFound(_0x40364b,null))[_0x0bf3('0x1b')](function(_0xbc6a67){if(_0xbc6a67){_0x24b235=_0xbc6a67;_0x5f56a8[_0x0bf3('0x3b')]=_[_0x0bf3('0x3c')](db[_0x0bf3('0x6a')][_0x0bf3('0x38')]);_0x5f56a8[_0x0bf3('0x3d')]=_[_0x0bf3('0x3c')](_0xaa43d1['query']);_0x5f56a8[_0x0bf3('0x46')]=_[_0x0bf3('0x3e')](_0x5f56a8[_0x0bf3('0x3b')],_0x5f56a8[_0x0bf3('0x3d')]);_0x611e07[_0x0bf3('0x3f')]=_[_0x0bf3('0x3e')](_0x5f56a8[_0x0bf3('0x3b')],qs['fields'](_0xaa43d1['query']['fields']));_0x611e07[_0x0bf3('0x3f')]=_0x611e07[_0x0bf3('0x3f')][_0x0bf3('0x41')]?_0x611e07['attributes']:_0x5f56a8['model'];_0x611e07[_0x0bf3('0x5d')]=qs[_0x0bf3('0x44')](_0xaa43d1[_0x0bf3('0x3d')][_0x0bf3('0x44')]);_0x611e07[_0x0bf3('0x45')]=qs['filters'](_[_0x0bf3('0x47')](_0xaa43d1[_0x0bf3('0x3d')],_0x5f56a8['filters']));if(_0xaa43d1[_0x0bf3('0x3d')][_0x0bf3('0x48')]){_0x611e07[_0x0bf3('0x45')]=_[_0x0bf3('0x49')](_0x611e07[_0x0bf3('0x45')],{'$or':_[_0x0bf3('0x36')](_0x611e07[_0x0bf3('0x3f')],function(_0x36f73b){var _0xd9918c={};_0xd9918c[_0x36f73b]={'$like':'%'+_0xaa43d1['query']['filter']+'%'};return _0xd9918c;})});}_0x611e07=_[_0x0bf3('0x49')]({},_0x611e07,_0xaa43d1[_0x0bf3('0x4a')]);return _0x24b235[_0x0bf3('0x69')](_0x611e07);}})[_0x0bf3('0x1b')](function(_0x3f9df2){if(_0x3f9df2){_0x209f8f=_0x3f9df2['length'];if(!_0xaa43d1['query'][_0x0bf3('0x42')]('nolimit')){_0x611e07[_0x0bf3('0x29')]=qs[_0x0bf3('0x29')](_0xaa43d1[_0x0bf3('0x3d')][_0x0bf3('0x29')]);_0x611e07[_0x0bf3('0x28')]=qs[_0x0bf3('0x28')](_0xaa43d1[_0x0bf3('0x3d')][_0x0bf3('0x28')]);}return _0x24b235['getTeams'](_0x611e07);}})['then'](function(_0x51bf08){if(_0x51bf08){return _0x51bf08?{'count':_0x209f8f,'rows':_0x51bf08}:null;}})[_0x0bf3('0x1b')](respondWithResult(_0x40364b,null))[_0x0bf3('0x25')](handleError(_0x40364b,null));};exports['addTeams']=function(_0x20a481,_0x553845,_0x421fd4){var _0x4c64c4=_0x20a481[_0x0bf3('0x59')][_0x0bf3('0x6b')];return db[_0x0bf3('0x6a')]['findAll']({'where':{'id':_0x4c64c4},'attributes':['id'],'include':[{'model':db[_0x0bf3('0x60')],'as':_0x0bf3('0x6c'),'attributes':['id','name','online',_0x0bf3('0x6d'),_0x0bf3('0x6e')],'raw':!![]}]})[_0x0bf3('0x1b')](function(_0xbfe902){if(_0xbfe902){var _0x9bddee=_[_0x0bf3('0x6f')](_0xbfe902,function(_0x298e36){var _0x21d358=_0x298e36[_0x0bf3('0x30')]({'plain':!![]});return _0x21d358[_0x0bf3('0x6c')];});return db[_0x0bf3('0x37')][_0x0bf3('0x51')]({'where':{'id':_0x20a481[_0x0bf3('0x50')]['id']}})[_0x0bf3('0x1b')](function(_0x510612){return db[_0x0bf3('0x70')][_0x0bf3('0x71')](function(_0x5bc48a){return _0x510612['addTeams'](_0x4c64c4,{'transaction':_0x5bc48a})['then'](function(){return BPromise[_0x0bf3('0x72')](_0x9bddee,function(_0x3777eb){return db[_0x0bf3('0x5c')]['findOrCreate']({'where':{'UserId':_0x3777eb['id'],'ChatQueueId':_0x20a481['params']['id']},'transaction':_0x5bc48a});});})[_0x0bf3('0x1b')](function(){_0x9bddee[_0x0bf3('0x73')](function(_0x3cd61c){socket[_0x0bf3('0x74')](_0x0bf3('0x75'),{'UserId':_0x3cd61c['id'],'ChatQueueId':_0x510612['id']});});});});});}})['then'](respondWithStatusCode(_0x553845,null))[_0x0bf3('0x25')](handleError(_0x553845,null));};exports[_0x0bf3('0x76')]=function(_0x53c83c,_0x5f4c22,_0x2d1cc7){return db[_0x0bf3('0x6a')][_0x0bf3('0x5f')]({'where':{'id':_0x53c83c['query'][_0x0bf3('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x0bf3('0x60')],'as':_0x0bf3('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x0bf3('0x1b')](handleEntityNotFound(_0x5f4c22,null))[_0x0bf3('0x1b')](function(_0x623fa7){var _0x71c6ad=_[_0x0bf3('0x36')](_0x623fa7,'id');var _0x35eb79=[];var _0x587bb2=[];var _0x165012=squel[_0x0bf3('0x77')]();_0x165012[_0x0bf3('0x78')]('tq.TeamId')[_0x0bf3('0x79')](_0x0bf3('0x7a'),'tq')[_0x0bf3('0x7b')](_0x0bf3('0x7c'),'ut',_0x0bf3('0x7d'))['where'](_0x0bf3('0x7e'),_0x53c83c[_0x0bf3('0x50')]['id']);for(var _0x3e0317=0x0;_0x3e0317<_0x623fa7['length'];_0x3e0317+=0x1){let _0x4f1a72=_0x623fa7[_0x3e0317];for(var _0x529fde=0x0;_0x529fde<_0x4f1a72[_0x0bf3('0x6c')][_0x0bf3('0x41')];_0x529fde+=0x1){let _0x360e9e=_0x4f1a72[_0x0bf3('0x6c')][_0x529fde];var _0x80f0e0=_0x165012[_0x0bf3('0x7f')]();_0x80f0e0[_0x0bf3('0x45')]('ut.UserId\x20=\x20?',_0x360e9e['id']);_0x587bb2[_0x0bf3('0x80')](db[_0x0bf3('0x70')][_0x0bf3('0x3d')](_0x80f0e0[_0x0bf3('0x81')](),{'type':db[_0x0bf3('0x70')]['QueryTypes'][_0x0bf3('0x82')]})[_0x0bf3('0x1b')](function(_0x19cea3){if(_0x19cea3[_0x0bf3('0x41')]===0x1){return _0x360e9e['id'];}else{var _0x4cf1e5=_[_0x0bf3('0x83')](_[_0x0bf3('0x36')](_0x19cea3,_0x0bf3('0x84')),function(_0x5c1295){return _['includes'](_0x71c6ad,_0x5c1295);});if(_0x4cf1e5){return _0x360e9e['id'];}}}));}}return BPromise[_0x0bf3('0x85')](_0x587bb2)['then'](function(_0x20fc70){_0x35eb79=_(_0x35eb79)[_0x0bf3('0x86')](_0x20fc70)[_0x0bf3('0x87')]()[_0x0bf3('0x88')]();return db[_0x0bf3('0x37')][_0x0bf3('0x51')]({'where':{'id':_0x53c83c[_0x0bf3('0x50')]['id']}})['then'](function(_0x5e30e1){return db[_0x0bf3('0x70')][_0x0bf3('0x71')](function(_0x146fde){return _0x5e30e1['removeTeams'](_0x53c83c[_0x0bf3('0x3d')][_0x0bf3('0x6b')],{'transaction':_0x146fde})['then'](function(){if(!_[_0x0bf3('0x89')](_0x35eb79)){return _0x5e30e1[_0x0bf3('0x8a')](_0x35eb79,{'transaction':_0x146fde});}})[_0x0bf3('0x1b')](function(){_0x35eb79['forEach'](function(_0x523054){socket['emit'](_0x0bf3('0x8b'),{'UserId':_0x523054,'ChatQueueId':_0x5e30e1['id']});});});});});});})[_0x0bf3('0x1b')](respondWithStatusCode(_0x5f4c22,null))[_0x0bf3('0x25')](handleError(_0x5f4c22,null));};exports['addAgents']=function(_0x16976c,_0x484af5,_0x5df8a8){return db[_0x0bf3('0x37')]['find']({'where':{'id':_0x16976c[_0x0bf3('0x50')]['id']}})[_0x0bf3('0x1b')](handleEntityNotFound(_0x484af5,null))['then'](function(_0x4b6c26){if(_0x4b6c26){return _0x4b6c26[_0x0bf3('0x8c')](_0x16976c[_0x0bf3('0x59')][_0x0bf3('0x6b')],_[_0x0bf3('0x8d')](_0x16976c['body'],['ids','id'])||{})[_0x0bf3('0x8e')](function(_0x3cfec2){for(var _0x46f655=0x0;_0x46f655<_0x16976c['body'][_0x0bf3('0x6b')][_0x0bf3('0x41')];_0x46f655+=0x1){socket[_0x0bf3('0x74')]('userChatQueue:save',{'UserId':Number(_0x16976c[_0x0bf3('0x59')][_0x0bf3('0x6b')][_0x46f655]),'ChatQueueId':Number(_0x16976c[_0x0bf3('0x50')]['id'])});}return _0x3cfec2;});}})[_0x0bf3('0x1b')](respondWithResult(_0x484af5,null))[_0x0bf3('0x25')](handleError(_0x484af5,null));};exports[_0x0bf3('0x8a')]=function(_0x438199,_0x1fb0d3,_0x2071aa){return db[_0x0bf3('0x37')][_0x0bf3('0x51')]({'where':{'id':_0x438199[_0x0bf3('0x50')]['id']}})[_0x0bf3('0x1b')](handleEntityNotFound(_0x1fb0d3,null))[_0x0bf3('0x1b')](function(_0x49200b){if(_0x49200b){return _0x49200b[_0x0bf3('0x8a')](_0x438199[_0x0bf3('0x3d')][_0x0bf3('0x6b')])[_0x0bf3('0x1b')](function(){if(_[_0x0bf3('0x8f')](_0x438199['query']['ids'])){for(var _0x465488=0x0;_0x465488<_0x438199[_0x0bf3('0x3d')][_0x0bf3('0x6b')][_0x0bf3('0x41')];_0x465488+=0x1){socket[_0x0bf3('0x74')](_0x0bf3('0x8b'),{'UserId':Number(_0x438199[_0x0bf3('0x3d')][_0x0bf3('0x6b')][_0x465488]),'ChatQueueId':Number(_0x438199[_0x0bf3('0x50')]['id'])});}}else{socket[_0x0bf3('0x74')](_0x0bf3('0x8b'),{'UserId':Number(_0x438199[_0x0bf3('0x3d')][_0x0bf3('0x6b')]),'ChatQueueId':Number(_0x438199[_0x0bf3('0x50')]['id'])});}});}})[_0x0bf3('0x1b')](respondWithStatusCode(_0x1fb0d3,null))['catch'](handleError(_0x1fb0d3,null));};exports[_0x0bf3('0x90')]=function(_0xfd4bd,_0x33b987,_0xd603f5){var _0x5c8da1={};var _0x577e7c={};var _0xa45ceb;var _0x3b726f;return db[_0x0bf3('0x37')][_0x0bf3('0x5b')]({'where':{'id':_0xfd4bd[_0x0bf3('0x50')]['id']}})[_0x0bf3('0x1b')](handleEntityNotFound(_0x33b987,null))[_0x0bf3('0x1b')](function(_0x413f0f){if(_0x413f0f){_0xa45ceb=_0x413f0f;_0x577e7c['model']=_[_0x0bf3('0x3c')](db['User']['rawAttributes']);_0x577e7c['query']=_[_0x0bf3('0x3c')](_0xfd4bd['query']);_0x577e7c['filters']=_[_0x0bf3('0x3e')](_0x577e7c[_0x0bf3('0x3b')],_0x577e7c['query']);_0x5c8da1['attributes']=_[_0x0bf3('0x3e')](_0x577e7c['model'],qs[_0x0bf3('0x40')](_0xfd4bd['query']['fields']));_0x5c8da1['attributes']=_0x5c8da1[_0x0bf3('0x3f')][_0x0bf3('0x41')]?_0x5c8da1[_0x0bf3('0x3f')]:_0x577e7c[_0x0bf3('0x3b')];_0x5c8da1['order']=qs[_0x0bf3('0x44')](_0xfd4bd[_0x0bf3('0x3d')][_0x0bf3('0x44')]);_0x5c8da1['where']=qs['filters'](_[_0x0bf3('0x47')](_0xfd4bd[_0x0bf3('0x3d')],_0x577e7c[_0x0bf3('0x46')]));if(_0xfd4bd[_0x0bf3('0x3d')][_0x0bf3('0x48')]){_0x5c8da1[_0x0bf3('0x45')]=_[_0x0bf3('0x49')](_0x5c8da1[_0x0bf3('0x45')],{'$or':_[_0x0bf3('0x36')](_0x5c8da1['attributes'],function(_0x270113){var _0x209d89={};_0x209d89[_0x270113]={'$like':'%'+_0xfd4bd[_0x0bf3('0x3d')][_0x0bf3('0x48')]+'%'};return _0x209d89;})});}_0x5c8da1=_[_0x0bf3('0x49')]({},_0x5c8da1,_0xfd4bd[_0x0bf3('0x4a')]);return _0xa45ceb[_0x0bf3('0x90')](_0x5c8da1);}})[_0x0bf3('0x1b')](function(_0x53330c){if(_0x53330c){_0x3b726f=_0x53330c[_0x0bf3('0x41')];if(!_0xfd4bd[_0x0bf3('0x3d')]['hasOwnProperty'](_0x0bf3('0x43'))){_0x5c8da1[_0x0bf3('0x29')]=qs[_0x0bf3('0x29')](_0xfd4bd[_0x0bf3('0x3d')]['limit']);_0x5c8da1[_0x0bf3('0x28')]=qs['offset'](_0xfd4bd[_0x0bf3('0x3d')][_0x0bf3('0x28')]);}return _0xa45ceb['getAgents'](_0x5c8da1);}})[_0x0bf3('0x1b')](function(_0x211a51){if(_0x211a51){return _0x211a51?{'count':_0x3b726f,'rows':_0x211a51}:null;}})[_0x0bf3('0x1b')](respondWithResult(_0x33b987,null))[_0x0bf3('0x25')](handleError(_0x33b987,null));};
\ No newline at end of file
+var _0x1829=['isEmpty','removeAgents','addAgents','omit','spread','userChatQueue:save','isArray','userChatQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','end','json','undefined','limit','offset','count','Content-Range','apply','save','update','destroy','get','ChatQueues','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','filters','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','describe','getMembers','UserChatQueue','hasOwnProperty','User','findAndCountAll','chatPause','updatedAt','rows','format','%s/%s','getTeams','findOne','Team','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','value','removeTeams'];(function(_0x15b71c,_0x25708f){var _0x35c8c8=function(_0x36b4d6){while(--_0x36b4d6){_0x15b71c['push'](_0x15b71c['shift']());}};_0x35c8c8(++_0x25708f);}(_0x1829,0x13f));var _0x9182=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x1829[_0x5a9c0c];return _0x53c77d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9182('0x0'));var zipdir=require(_0x9182('0x1'));var jsonpatch=require(_0x9182('0x2'));var rp=require(_0x9182('0x3'));var moment=require(_0x9182('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9182('0x5'));var util=require('util');var path=require(_0x9182('0x6'));var sox=require(_0x9182('0x7'));var csv=require('to-csv');var ejs=require(_0x9182('0x8'));var fs=require('fs');var fs_extra=require(_0x9182('0x9'));var _=require(_0x9182('0xa'));var squel=require(_0x9182('0xb'));var crypto=require(_0x9182('0xc'));var jsforce=require(_0x9182('0xd'));var deskjs=require(_0x9182('0xe'));var toCsv=require(_0x9182('0xf'));var querystring=require(_0x9182('0x10'));var Papa=require(_0x9182('0x11'));var Redis=require(_0x9182('0x12'));var authService=require(_0x9182('0x13'));var qs=require(_0x9182('0x14'));var as=require(_0x9182('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9182('0x16'))(_0x9182('0x17'));var utils=require(_0x9182('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x9182('0x19'));var db=require(_0x9182('0x1a'))['db'];config[_0x9182('0x1b')]=_[_0x9182('0x1c')](config['redis'],{'host':_0x9182('0x1d'),'port':0x18eb});var socket=require(_0x9182('0x1e'))(new Redis(config['redis']));require(_0x9182('0x1f'))[_0x9182('0x20')](socket);var jayson=require(_0x9182('0x21'));var client=jayson[_0x9182('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35ee31,_0x31c992,_0x341e81,_0x4a94a7){return new BPromise(function(_0x1c594b,_0x4285ad){var _0x19826e=_0x4a94a7||client;return _0x19826e['request'](_0x35ee31,_0x341e81)[_0x9182('0x23')](function(_0x46f1b9){logger['info'](_0x9182('0x24'),_0x31c992,_0x9182('0x25'));logger[_0x9182('0x26')](_0x9182('0x27'),_0x31c992,_0x9182('0x25'),JSON[_0x9182('0x28')](_0x46f1b9));if(_0x46f1b9[_0x9182('0x29')]){if(_0x46f1b9['error'][_0x9182('0x2a')]===0x1f4){logger['error'](_0x9182('0x24'),_0x31c992,_0x46f1b9['error'][_0x9182('0x2b')]);return _0x4285ad(_0x46f1b9[_0x9182('0x29')]['message']);}logger[_0x9182('0x29')](_0x9182('0x24'),_0x31c992,_0x46f1b9['error']['message']);return _0x1c594b(_0x46f1b9[_0x9182('0x29')][_0x9182('0x2b')]);}else{logger[_0x9182('0x2c')](_0x9182('0x24'),_0x31c992,_0x9182('0x25'));_0x1c594b(_0x46f1b9[_0x9182('0x2d')][_0x9182('0x2b')]);}})[_0x9182('0x2e')](function(_0x5e69c7){logger[_0x9182('0x29')](_0x9182('0x24'),_0x31c992,_0x5e69c7);_0x4285ad(_0x5e69c7);});});}function respondWithStatusCode(_0x49c155,_0x50d3b3){_0x50d3b3=_0x50d3b3||0xcc;return function(_0x54239b){if(_0x54239b){return _0x49c155['sendStatus'](_0x50d3b3);}return _0x49c155[_0x9182('0x2f')](_0x50d3b3)[_0x9182('0x30')]();};}function respondWithResult(_0x246d96,_0x188b79){_0x188b79=_0x188b79||0xc8;return function(_0x2a248e){if(_0x2a248e){return _0x246d96['status'](_0x188b79)[_0x9182('0x31')](_0x2a248e);}};}function respondWithFilteredResult(_0x3bb390,_0x420f7f){return function(_0xe2526d){if(_0xe2526d){var _0x3a26d5=typeof _0x420f7f['offset']===_0x9182('0x32')&&typeof _0x420f7f[_0x9182('0x33')]===_0x9182('0x32');var _0x2fe154=_0xe2526d['count'];var _0x125ece=_0x3a26d5?0x0:_0x420f7f[_0x9182('0x34')];var _0x349818=_0x3a26d5?_0xe2526d[_0x9182('0x35')]:_0x420f7f[_0x9182('0x34')]+_0x420f7f[_0x9182('0x33')];var _0x4da502;if(_0x349818>=_0x2fe154){_0x349818=_0x2fe154;_0x4da502=0xc8;}else{_0x4da502=0xce;}_0x3bb390['status'](_0x4da502);return _0x3bb390['set'](_0x9182('0x36'),_0x125ece+'-'+_0x349818+'/'+_0x2fe154)[_0x9182('0x31')](_0xe2526d);}return null;};}function patchUpdates(_0x595d80){return function(_0x494b42){try{jsonpatch[_0x9182('0x37')](_0x494b42,_0x595d80,!![]);}catch(_0x2cca0d){return BPromise['reject'](_0x2cca0d);}return _0x494b42[_0x9182('0x38')]();};}function saveUpdates(_0x2a0e93,_0x3f0d85){return function(_0x260bbc){if(_0x260bbc){return _0x260bbc[_0x9182('0x39')](_0x2a0e93)[_0x9182('0x23')](function(_0x5eb2b6){return _0x5eb2b6;});}return null;};}function removeEntity(_0x19a34a,_0x136a7b){return function(_0x376877){if(_0x376877){return _0x376877[_0x9182('0x3a')]()['then'](function(){var _0x2dadab=_0x376877[_0x9182('0x3b')]({'plain':!![]});var _0x319e2c=_0x9182('0x3c');return db['UserProfileResource'][_0x9182('0x3a')]({'where':{'type':_0x319e2c,'resourceId':_0x2dadab['id']}})[_0x9182('0x23')](function(){return _0x376877;});})[_0x9182('0x23')](function(){_0x19a34a[_0x9182('0x2f')](0xcc)[_0x9182('0x30')]();});}};}function handleEntityNotFound(_0x544c06,_0x13819f){return function(_0x5b304b){if(!_0x5b304b){_0x544c06['sendStatus'](0x194);}return _0x5b304b;};}function handleError(_0x213479,_0x39e1b2){_0x39e1b2=_0x39e1b2||0x1f4;return function(_0x4597ce){logger[_0x9182('0x29')](_0x4597ce[_0x9182('0x3d')]);if(_0x4597ce[_0x9182('0x3e')]){delete _0x4597ce['name'];}_0x213479[_0x9182('0x2f')](_0x39e1b2)[_0x9182('0x3f')](_0x4597ce);};}exports[_0x9182('0x40')]=function(_0x1f8b51,_0x1afa43){var _0x215bde={},_0x39e62b={},_0x16d516={'count':0x0,'rows':[]};var _0x31f355=_[_0x9182('0x41')](db[_0x9182('0x42')][_0x9182('0x43')],function(_0x530a3f){return{'name':_0x530a3f[_0x9182('0x44')],'type':_0x530a3f[_0x9182('0x45')]['key']};});_0x39e62b[_0x9182('0x46')]=_[_0x9182('0x41')](_0x31f355,'name');_0x39e62b[_0x9182('0x47')]=_[_0x9182('0x48')](_0x1f8b51[_0x9182('0x47')]);_0x39e62b['filters']=_[_0x9182('0x49')](_0x39e62b[_0x9182('0x46')],_0x39e62b['query']);_0x215bde[_0x9182('0x4a')]=_[_0x9182('0x49')](_0x39e62b[_0x9182('0x46')],qs['fields'](_0x1f8b51[_0x9182('0x47')][_0x9182('0x4b')]));_0x215bde[_0x9182('0x4a')]=_0x215bde[_0x9182('0x4a')][_0x9182('0x4c')]?_0x215bde[_0x9182('0x4a')]:_0x39e62b[_0x9182('0x46')];if(!_0x1f8b51['query']['hasOwnProperty'](_0x9182('0x4d'))){_0x215bde[_0x9182('0x33')]=qs['limit'](_0x1f8b51['query']['limit']);_0x215bde[_0x9182('0x34')]=qs[_0x9182('0x34')](_0x1f8b51[_0x9182('0x47')][_0x9182('0x34')]);}_0x215bde[_0x9182('0x4e')]=qs['sort'](_0x1f8b51[_0x9182('0x47')][_0x9182('0x4f')]);_0x215bde[_0x9182('0x50')]=qs['filters'](_[_0x9182('0x51')](_0x1f8b51[_0x9182('0x47')],_0x39e62b['filters']),_0x31f355);if(_0x1f8b51[_0x9182('0x47')][_0x9182('0x52')]){_0x215bde[_0x9182('0x50')]=_[_0x9182('0x53')](_0x215bde['where'],{'$or':_[_0x9182('0x41')](_0x31f355,function(_0x274d20){if(_0x274d20[_0x9182('0x45')]!==_0x9182('0x54')){var _0x19a129={};_0x19a129[_0x274d20[_0x9182('0x3e')]]={'$like':'%'+_0x1f8b51[_0x9182('0x47')]['filter']+'%'};return _0x19a129;}})});}_0x215bde=_['merge']({},_0x215bde,_0x1f8b51[_0x9182('0x55')]);var _0x210669={'where':_0x215bde[_0x9182('0x50')]};return db[_0x9182('0x42')][_0x9182('0x35')](_0x210669)[_0x9182('0x23')](function(_0x52544c){_0x16d516[_0x9182('0x35')]=_0x52544c;if(_0x1f8b51['query'][_0x9182('0x56')]){_0x215bde[_0x9182('0x57')]=[{'all':!![]}];}return db[_0x9182('0x42')][_0x9182('0x58')](_0x215bde);})[_0x9182('0x23')](function(_0x22d8c2){_0x16d516['rows']=_0x22d8c2;return _0x16d516;})[_0x9182('0x23')](respondWithFilteredResult(_0x1afa43,_0x215bde))['catch'](handleError(_0x1afa43,null));};exports[_0x9182('0x59')]=function(_0xfb6767,_0x24ef1c){var _0x1d19ff={'raw':!![],'where':{'id':_0xfb6767[_0x9182('0x5a')]['id']}},_0x3f58e3={};_0x3f58e3['model']=_[_0x9182('0x48')](db[_0x9182('0x42')]['rawAttributes']);_0x3f58e3[_0x9182('0x47')]=_[_0x9182('0x48')](_0xfb6767['query']);_0x3f58e3[_0x9182('0x5b')]=_[_0x9182('0x49')](_0x3f58e3[_0x9182('0x46')],_0x3f58e3['query']);_0x1d19ff[_0x9182('0x4a')]=_[_0x9182('0x49')](_0x3f58e3[_0x9182('0x46')],qs[_0x9182('0x4b')](_0xfb6767[_0x9182('0x47')][_0x9182('0x4b')]));_0x1d19ff[_0x9182('0x4a')]=_0x1d19ff[_0x9182('0x4a')][_0x9182('0x4c')]?_0x1d19ff[_0x9182('0x4a')]:_0x3f58e3[_0x9182('0x46')];if(_0xfb6767[_0x9182('0x47')][_0x9182('0x56')]){_0x1d19ff['include']=[{'all':!![]}];}_0x1d19ff=_[_0x9182('0x53')]({},_0x1d19ff,_0xfb6767['options']);return db[_0x9182('0x42')][_0x9182('0x5c')](_0x1d19ff)[_0x9182('0x23')](handleEntityNotFound(_0x24ef1c,null))[_0x9182('0x23')](respondWithResult(_0x24ef1c,null))[_0x9182('0x2e')](handleError(_0x24ef1c,null));};exports['create']=function(_0x1491c4,_0x5713bc){return db[_0x9182('0x42')]['create'](_0x1491c4[_0x9182('0x5d')],{})[_0x9182('0x23')](function(_0x4f22aa){var _0x5ae6f5=_0x1491c4[_0x9182('0x5e')]['get']({'plain':!![]});if(!_0x5ae6f5)throw new Error(_0x9182('0x5f'));if(_0x5ae6f5[_0x9182('0x60')]===_0x9182('0x5e')){var _0x3e986e=_0x4f22aa[_0x9182('0x3b')]({'plain':!![]});var _0x5436a1=_0x9182('0x3c');return db['UserProfileSection'][_0x9182('0x5c')]({'where':{'name':_0x5436a1,'userProfileId':_0x5ae6f5[_0x9182('0x61')]},'raw':!![]})['then'](function(_0x262d30){if(_0x262d30&&_0x262d30[_0x9182('0x62')]===0x0){return db['UserProfileResource'][_0x9182('0x63')]({'name':_0x3e986e['name'],'resourceId':_0x3e986e['id'],'type':_0x262d30[_0x9182('0x3e')],'sectionId':_0x262d30['id']},{})[_0x9182('0x23')](function(){return _0x4f22aa;});}else{return _0x4f22aa;}})['catch'](function(_0x114dc6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x114dc6);throw _0x114dc6;});}return _0x4f22aa;})['then'](respondWithResult(_0x5713bc,0xc9))[_0x9182('0x2e')](handleError(_0x5713bc,null));};exports[_0x9182('0x39')]=function(_0x3b1edb,_0x3a541a){if(_0x3b1edb[_0x9182('0x5d')]['id']){delete _0x3b1edb['body']['id'];}return db[_0x9182('0x42')]['find']({'where':{'id':_0x3b1edb[_0x9182('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3a541a,null))['then'](saveUpdates(_0x3b1edb[_0x9182('0x5d')],null))[_0x9182('0x23')](respondWithResult(_0x3a541a,null))[_0x9182('0x2e')](handleError(_0x3a541a,null));};exports[_0x9182('0x3a')]=function(_0xc6d0f7,_0xd5da66){return db[_0x9182('0x42')][_0x9182('0x5c')]({'where':{'id':_0xc6d0f7[_0x9182('0x5a')]['id']}})[_0x9182('0x23')](handleEntityNotFound(_0xd5da66,null))['then'](removeEntity(_0xd5da66,null))[_0x9182('0x2e')](handleError(_0xd5da66,null));};exports[_0x9182('0x64')]=function(_0x48542e,_0xbe7169){return db['ChatQueue'][_0x9182('0x64')]()[_0x9182('0x23')](respondWithResult(_0xbe7169,null))[_0x9182('0x2e')](handleError(_0xbe7169,null));};exports[_0x9182('0x65')]=function(_0x4a03f9,_0x23acbc,_0x11c02f){var _0x5b8113={'raw':!![],'where':{}},_0x5743fa={},_0x556650;return db['ChatQueue']['findOne']({'where':{'id':_0x4a03f9['params']['id']}})[_0x9182('0x23')](handleEntityNotFound(_0x23acbc,null))[_0x9182('0x23')](function(_0x4c9356){if(_0x4c9356){_0x556650=_0x4c9356[_0x9182('0x3b')]({'plain':!![]});_0x5743fa[_0x9182('0x46')]=_[_0x9182('0x48')](db[_0x9182('0x66')][_0x9182('0x43')]);_0x5743fa[_0x9182('0x47')]=_[_0x9182('0x48')](_0x4a03f9[_0x9182('0x47')]);_0x5743fa[_0x9182('0x5b')]=_[_0x9182('0x49')](_0x5743fa[_0x9182('0x46')],_0x5743fa[_0x9182('0x47')]);_0x5b8113[_0x9182('0x4a')]=_[_0x9182('0x49')](_0x5743fa[_0x9182('0x46')],qs[_0x9182('0x4b')](_0x4a03f9[_0x9182('0x47')][_0x9182('0x4b')]));_0x5b8113[_0x9182('0x4a')]=_0x5b8113[_0x9182('0x4a')][_0x9182('0x4c')]?_0x5b8113[_0x9182('0x4a')]:_0x5743fa[_0x9182('0x46')];if(!_0x4a03f9[_0x9182('0x47')][_0x9182('0x67')]('nolimit')){_0x5b8113['limit']=qs[_0x9182('0x33')](_0x4a03f9['query'][_0x9182('0x33')]);_0x5b8113[_0x9182('0x34')]=qs[_0x9182('0x34')](_0x4a03f9[_0x9182('0x47')][_0x9182('0x34')]);}_0x5b8113[_0x9182('0x4e')]=qs[_0x9182('0x4f')](_0x4a03f9[_0x9182('0x47')]['sort']);_0x5b8113[_0x9182('0x50')]=qs['filters'](_['pick'](_0x4a03f9[_0x9182('0x47')],_0x5743fa[_0x9182('0x5b')]));_0x5b8113['where']['ChatQueueId']=_0x4c9356['id'];if(_0x4a03f9[_0x9182('0x47')][_0x9182('0x52')]){_0x5b8113[_0x9182('0x50')]=_['merge'](_0x5b8113['where'],{'$or':_['map'](_0x5b8113['attributes'],function(_0x20d90e){var _0x980b2a={};_0x980b2a[_0x20d90e]={'$like':'%'+_0x4a03f9[_0x9182('0x47')][_0x9182('0x52')]+'%'};return _0x980b2a;})});}_0x5b8113=_[_0x9182('0x53')]({},_0x5b8113,_0x4a03f9[_0x9182('0x55')]);return db[_0x9182('0x66')]['findAll'](_0x5b8113);}})['then'](function(_0x2b2ed1){if(_0x2b2ed1){return db[_0x9182('0x68')][_0x9182('0x69')]({'where':{'id':_[_0x9182('0x41')](_0x2b2ed1,'UserId'),'role':'agent'},'attributes':['id',_0x9182('0x3e'),_0x9182('0x6a'),_0x9182('0x6b'),'createdAt']});}})[_0x9182('0x23')](function(_0x49e9b2){if(_0x49e9b2){return{'count':_0x49e9b2[_0x9182('0x35')],'rows':_[_0x9182('0x41')](_0x49e9b2[_0x9182('0x6c')],function(_0xfa8afe){return{'membername':_0xfa8afe[_0x9182('0x3e')],'UserId':_0xfa8afe['id'],'queue_name':_0x556650[_0x9182('0x3e')],'ChatQueueId':_0x556650['id'],'interface':util[_0x9182('0x6d')](_0x9182('0x6e'),'SIP',_0xfa8afe[_0x9182('0x3e')]),'penalty':0x0,'paused':_0xfa8afe[_0x9182('0x6a')],'createdAt':_0xfa8afe['createdAt'],'updatedAt':_0xfa8afe[_0x9182('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x23acbc,_0x5b8113))['catch'](handleError(_0x23acbc,null));};exports[_0x9182('0x6f')]=function(_0x2a1109,_0x20e18b,_0x547991){var _0x36e5da={};var _0x115e11={};var _0x474310;var _0x48b069;return db[_0x9182('0x42')][_0x9182('0x70')]({'where':{'id':_0x2a1109[_0x9182('0x5a')]['id']}})[_0x9182('0x23')](handleEntityNotFound(_0x20e18b,null))[_0x9182('0x23')](function(_0x489c87){if(_0x489c87){_0x474310=_0x489c87;_0x115e11[_0x9182('0x46')]=_[_0x9182('0x48')](db[_0x9182('0x71')][_0x9182('0x43')]);_0x115e11[_0x9182('0x47')]=_['keys'](_0x2a1109[_0x9182('0x47')]);_0x115e11[_0x9182('0x5b')]=_['intersection'](_0x115e11[_0x9182('0x46')],_0x115e11[_0x9182('0x47')]);_0x36e5da[_0x9182('0x4a')]=_[_0x9182('0x49')](_0x115e11[_0x9182('0x46')],qs[_0x9182('0x4b')](_0x2a1109[_0x9182('0x47')][_0x9182('0x4b')]));_0x36e5da[_0x9182('0x4a')]=_0x36e5da[_0x9182('0x4a')][_0x9182('0x4c')]?_0x36e5da['attributes']:_0x115e11['model'];_0x36e5da[_0x9182('0x4e')]=qs[_0x9182('0x4f')](_0x2a1109[_0x9182('0x47')]['sort']);_0x36e5da[_0x9182('0x50')]=qs['filters'](_['pick'](_0x2a1109[_0x9182('0x47')],_0x115e11[_0x9182('0x5b')]));if(_0x2a1109['query'][_0x9182('0x52')]){_0x36e5da[_0x9182('0x50')]=_[_0x9182('0x53')](_0x36e5da['where'],{'$or':_[_0x9182('0x41')](_0x36e5da[_0x9182('0x4a')],function(_0x42fd91){var _0x490844={};_0x490844[_0x42fd91]={'$like':'%'+_0x2a1109['query'][_0x9182('0x52')]+'%'};return _0x490844;})});}_0x36e5da=_[_0x9182('0x53')]({},_0x36e5da,_0x2a1109[_0x9182('0x55')]);return _0x474310['getTeams'](_0x36e5da);}})['then'](function(_0x3e0df4){if(_0x3e0df4){_0x48b069=_0x3e0df4[_0x9182('0x4c')];if(!_0x2a1109[_0x9182('0x47')][_0x9182('0x67')](_0x9182('0x4d'))){_0x36e5da[_0x9182('0x33')]=qs[_0x9182('0x33')](_0x2a1109['query'][_0x9182('0x33')]);_0x36e5da['offset']=qs['offset'](_0x2a1109[_0x9182('0x47')]['offset']);}return _0x474310[_0x9182('0x6f')](_0x36e5da);}})[_0x9182('0x23')](function(_0x30904c){if(_0x30904c){return _0x30904c?{'count':_0x48b069,'rows':_0x30904c}:null;}})['then'](respondWithResult(_0x20e18b,null))[_0x9182('0x2e')](handleError(_0x20e18b,null));};exports['addTeams']=function(_0x56e9df,_0x167a43,_0xec9a46){var _0x4d71a5=_0x56e9df[_0x9182('0x5d')][_0x9182('0x72')];return db[_0x9182('0x71')][_0x9182('0x58')]({'where':{'id':_0x4d71a5},'attributes':['id'],'include':[{'model':db[_0x9182('0x68')],'as':_0x9182('0x73'),'attributes':['id',_0x9182('0x3e'),_0x9182('0x74'),_0x9182('0x75'),_0x9182('0x76')],'raw':!![]}]})[_0x9182('0x23')](function(_0x4b29b3){if(_0x4b29b3){var _0x1e3be4=_['flatMap'](_0x4b29b3,function(_0x4399d2){var _0x3c8be3=_0x4399d2['get']({'plain':!![]});return _0x3c8be3[_0x9182('0x73')];});return db['ChatQueue'][_0x9182('0x5c')]({'where':{'id':_0x56e9df[_0x9182('0x5a')]['id']}})[_0x9182('0x23')](function(_0x5a4dc1){return db[_0x9182('0x77')][_0x9182('0x78')](function(_0x1ce743){return _0x5a4dc1[_0x9182('0x79')](_0x4d71a5,{'transaction':_0x1ce743})[_0x9182('0x23')](function(){return BPromise[_0x9182('0x7a')](_0x1e3be4,function(_0x2f3790){return db[_0x9182('0x66')][_0x9182('0x7b')]({'where':{'UserId':_0x2f3790['id'],'ChatQueueId':_0x56e9df['params']['id']},'transaction':_0x1ce743});});})[_0x9182('0x23')](function(){_0x1e3be4[_0x9182('0x7c')](function(_0x21bb68){socket[_0x9182('0x7d')]('userChatQueue:save',{'UserId':_0x21bb68['id'],'ChatQueueId':_0x5a4dc1['id']});});});});});}})[_0x9182('0x23')](respondWithStatusCode(_0x167a43,null))['catch'](handleError(_0x167a43,null));};exports['removeTeams']=function(_0x4f38e1,_0x17c227,_0x4719ba){return db[_0x9182('0x71')][_0x9182('0x58')]({'where':{'id':_0x4f38e1[_0x9182('0x47')][_0x9182('0x72')]},'attributes':['id'],'include':[{'model':db[_0x9182('0x68')],'as':_0x9182('0x73'),'attributes':['id'],'raw':!![]}]})[_0x9182('0x23')](handleEntityNotFound(_0x17c227,null))[_0x9182('0x23')](function(_0x2edb4b){var _0x117d0e=_[_0x9182('0x41')](_0x2edb4b,'id');var _0x339b9f=[];var _0x18fd24=[];var _0x166cff=squel[_0x9182('0x7e')]();_0x166cff[_0x9182('0x7f')](_0x9182('0x80'))['from'](_0x9182('0x81'),'tq')[_0x9182('0x82')](_0x9182('0x83'),'ut',_0x9182('0x84'))[_0x9182('0x50')](_0x9182('0x85'),_0x4f38e1['params']['id']);for(var _0x480bed=0x0;_0x480bed<_0x2edb4b['length'];_0x480bed+=0x1){let _0x14c897=_0x2edb4b[_0x480bed];for(var _0x45c857=0x0;_0x45c857<_0x14c897[_0x9182('0x73')][_0x9182('0x4c')];_0x45c857+=0x1){let _0x348f79=_0x14c897[_0x9182('0x73')][_0x45c857];var _0x17a3b7=_0x166cff[_0x9182('0x86')]();_0x17a3b7['where'](_0x9182('0x87'),_0x348f79['id']);_0x18fd24[_0x9182('0x88')](db[_0x9182('0x77')][_0x9182('0x47')](_0x17a3b7[_0x9182('0x89')](),{'type':db['sequelize'][_0x9182('0x8a')][_0x9182('0x8b')]})['then'](function(_0x203021){if(_0x203021[_0x9182('0x4c')]===0x1){return _0x348f79['id'];}else{var _0x374f85=_[_0x9182('0x8c')](_[_0x9182('0x41')](_0x203021,_0x9182('0x8d')),function(_0x360bcf){return _[_0x9182('0x8e')](_0x117d0e,_0x360bcf);});if(_0x374f85){return _0x348f79['id'];}}}));}}return BPromise['all'](_0x18fd24)['then'](function(_0x483fb4){_0x339b9f=_(_0x339b9f)[_0x9182('0x8f')](_0x483fb4)['compact']()[_0x9182('0x90')]();return db[_0x9182('0x42')][_0x9182('0x5c')]({'where':{'id':_0x4f38e1[_0x9182('0x5a')]['id']}})[_0x9182('0x23')](function(_0x41396d){return db['sequelize'][_0x9182('0x78')](function(_0x311daa){return _0x41396d[_0x9182('0x91')](_0x4f38e1['query'][_0x9182('0x72')],{'transaction':_0x311daa})['then'](function(){if(!_[_0x9182('0x92')](_0x339b9f)){return _0x41396d[_0x9182('0x93')](_0x339b9f,{'transaction':_0x311daa});}})[_0x9182('0x23')](function(){_0x339b9f[_0x9182('0x7c')](function(_0x19c652){socket[_0x9182('0x7d')]('userChatQueue:remove',{'UserId':_0x19c652,'ChatQueueId':_0x41396d['id']});});});});});});})[_0x9182('0x23')](respondWithStatusCode(_0x17c227,null))[_0x9182('0x2e')](handleError(_0x17c227,null));};exports['addAgents']=function(_0xad24d9,_0x1bf5c6,_0x307e10){return db[_0x9182('0x42')][_0x9182('0x5c')]({'where':{'id':_0xad24d9[_0x9182('0x5a')]['id']}})[_0x9182('0x23')](handleEntityNotFound(_0x1bf5c6,null))[_0x9182('0x23')](function(_0xd2386c){if(_0xd2386c){return _0xd2386c[_0x9182('0x94')](_0xad24d9['body'][_0x9182('0x72')],_[_0x9182('0x95')](_0xad24d9['body'],[_0x9182('0x72'),'id'])||{})[_0x9182('0x96')](function(_0x361aee){for(var _0x264a73=0x0;_0x264a73<_0xad24d9['body'][_0x9182('0x72')]['length'];_0x264a73+=0x1){socket[_0x9182('0x7d')](_0x9182('0x97'),{'UserId':Number(_0xad24d9['body']['ids'][_0x264a73]),'ChatQueueId':Number(_0xad24d9[_0x9182('0x5a')]['id'])});}return _0x361aee;});}})[_0x9182('0x23')](respondWithResult(_0x1bf5c6,null))['catch'](handleError(_0x1bf5c6,null));};exports[_0x9182('0x93')]=function(_0x1b1c27,_0x33a389,_0x3c7087){return db['ChatQueue'][_0x9182('0x5c')]({'where':{'id':_0x1b1c27['params']['id']}})['then'](handleEntityNotFound(_0x33a389,null))[_0x9182('0x23')](function(_0x4f7b9e){if(_0x4f7b9e){return _0x4f7b9e[_0x9182('0x93')](_0x1b1c27[_0x9182('0x47')][_0x9182('0x72')])[_0x9182('0x23')](function(){if(_[_0x9182('0x98')](_0x1b1c27['query'][_0x9182('0x72')])){for(var _0x2308e8=0x0;_0x2308e8<_0x1b1c27[_0x9182('0x47')][_0x9182('0x72')][_0x9182('0x4c')];_0x2308e8+=0x1){socket[_0x9182('0x7d')](_0x9182('0x99'),{'UserId':Number(_0x1b1c27[_0x9182('0x47')][_0x9182('0x72')][_0x2308e8]),'ChatQueueId':Number(_0x1b1c27[_0x9182('0x5a')]['id'])});}}else{socket[_0x9182('0x7d')](_0x9182('0x99'),{'UserId':Number(_0x1b1c27[_0x9182('0x47')][_0x9182('0x72')]),'ChatQueueId':Number(_0x1b1c27[_0x9182('0x5a')]['id'])});}});}})[_0x9182('0x23')](respondWithStatusCode(_0x33a389,null))[_0x9182('0x2e')](handleError(_0x33a389,null));};exports['getAgents']=function(_0x383f82,_0x2cb8bf,_0x5abc68){var _0x15002d={};var _0x48ab18={};var _0x4c70f6;var _0x5e662c;return db[_0x9182('0x42')][_0x9182('0x70')]({'where':{'id':_0x383f82[_0x9182('0x5a')]['id']}})[_0x9182('0x23')](handleEntityNotFound(_0x2cb8bf,null))[_0x9182('0x23')](function(_0x95dbab){if(_0x95dbab){_0x4c70f6=_0x95dbab;_0x48ab18[_0x9182('0x46')]=_[_0x9182('0x48')](db[_0x9182('0x68')][_0x9182('0x43')]);_0x48ab18[_0x9182('0x47')]=_['keys'](_0x383f82[_0x9182('0x47')]);_0x48ab18[_0x9182('0x5b')]=_[_0x9182('0x49')](_0x48ab18['model'],_0x48ab18[_0x9182('0x47')]);_0x15002d[_0x9182('0x4a')]=_[_0x9182('0x49')](_0x48ab18[_0x9182('0x46')],qs[_0x9182('0x4b')](_0x383f82[_0x9182('0x47')][_0x9182('0x4b')]));_0x15002d[_0x9182('0x4a')]=_0x15002d[_0x9182('0x4a')][_0x9182('0x4c')]?_0x15002d[_0x9182('0x4a')]:_0x48ab18['model'];_0x15002d[_0x9182('0x4e')]=qs[_0x9182('0x4f')](_0x383f82[_0x9182('0x47')]['sort']);_0x15002d[_0x9182('0x50')]=qs['filters'](_[_0x9182('0x51')](_0x383f82[_0x9182('0x47')],_0x48ab18[_0x9182('0x5b')]));if(_0x383f82['query'][_0x9182('0x52')]){_0x15002d[_0x9182('0x50')]=_[_0x9182('0x53')](_0x15002d['where'],{'$or':_[_0x9182('0x41')](_0x15002d[_0x9182('0x4a')],function(_0x18de17){var _0x589562={};_0x589562[_0x18de17]={'$like':'%'+_0x383f82[_0x9182('0x47')][_0x9182('0x52')]+'%'};return _0x589562;})});}_0x15002d=_['merge']({},_0x15002d,_0x383f82['options']);return _0x4c70f6[_0x9182('0x9a')](_0x15002d);}})['then'](function(_0x41ce54){if(_0x41ce54){_0x5e662c=_0x41ce54[_0x9182('0x4c')];if(!_0x383f82[_0x9182('0x47')][_0x9182('0x67')](_0x9182('0x4d'))){_0x15002d[_0x9182('0x33')]=qs[_0x9182('0x33')](_0x383f82[_0x9182('0x47')][_0x9182('0x33')]);_0x15002d[_0x9182('0x34')]=qs[_0x9182('0x34')](_0x383f82[_0x9182('0x47')][_0x9182('0x34')]);}return _0x4c70f6[_0x9182('0x9a')](_0x15002d);}})[_0x9182('0x23')](function(_0xcb1530){if(_0xcb1530){return _0xcb1530?{'count':_0x5e662c,'rows':_0xcb1530}:null;}})[_0x9182('0x23')](respondWithResult(_0x2cb8bf,null))[_0x9182('0x2e')](handleError(_0x2cb8bf,null));};
\ No newline at end of file
index 6c6af53..49b9819 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc0b9=['hook','exports','events','../../mysqldb','save','remove','emit','hasOwnProperty'];(function(_0xd65c8d,_0x50621a){var _0x5f1323=function(_0x290a16){while(--_0x290a16){_0xd65c8d['push'](_0xd65c8d['shift']());}};_0x5f1323(++_0x50621a);}(_0xc0b9,0x152));var _0x9c0b=function(_0x2e15d6,_0x388a92){_0x2e15d6=_0x2e15d6-0x0;var _0x582498=_0xc0b9[_0x2e15d6];return _0x582498;};'use strict';var EventEmitter=require(_0x9c0b('0x0'));var ChatQueue=require(_0x9c0b('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9c0b('0x2'),'afterUpdate':'update','afterDestroy':_0x9c0b('0x3')};function emitEvent(_0x39cd77){return function(_0x1db2c4,_0x59a53e,_0x472488){ChatQueueEvents[_0x9c0b('0x4')](_0x39cd77+':'+_0x1db2c4['id'],_0x1db2c4);ChatQueueEvents[_0x9c0b('0x4')](_0x39cd77,_0x1db2c4);_0x472488(null);};}for(var e in events){if(events[_0x9c0b('0x5')](e)){var event=events[e];ChatQueue[_0x9c0b('0x6')](e,emitEvent(event));}}module[_0x9c0b('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0xff7a=['ChatQueue','setMaxListeners','emit','hasOwnProperty','hook','exports','events'];(function(_0x3ebb69,_0x3e612e){var _0x421e59=function(_0x5a8c66){while(--_0x5a8c66){_0x3ebb69['push'](_0x3ebb69['shift']());}};_0x421e59(++_0x3e612e);}(_0xff7a,0xa0));var _0xaff7=function(_0x3e1ca5,_0x509226){_0x3e1ca5=_0x3e1ca5-0x0;var _0x428493=_0xff7a[_0x3e1ca5];return _0x428493;};'use strict';var EventEmitter=require(_0xaff7('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xaff7('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xaff7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2b21e0){return function(_0x2feb15,_0x17e257,_0xa5173){ChatQueueEvents[_0xaff7('0x3')](_0x2b21e0+':'+_0x2feb15['id'],_0x2feb15);ChatQueueEvents[_0xaff7('0x3')](_0x2b21e0,_0x2feb15);_0xa5173(null);};}for(var e in events){if(events[_0xaff7('0x4')](e)){var event=events[e];ChatQueue[_0xaff7('0x5')](e,emitEvent(event));}}module[_0xaff7('0x6')]=ChatQueueEvents;
\ No newline at end of file
index f500e7b..b3916f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9026=['path','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','util','../../config/logger','api','moment','request-promise'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x9026,0xdf));var _0x6902=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x9026[_0x344a3f];return _0x264712;};'use strict';var _=require('lodash');var util=require(_0x6902('0x0'));var logger=require(_0x6902('0x1'))(_0x6902('0x2'));var moment=require(_0x6902('0x3'));var BPromise=require('bluebird');var rp=require(_0x6902('0x4'));var fs=require('fs');var path=require(_0x6902('0x5'));var rimraf=require('rimraf');var config=require(_0x6902('0x6'));var attributes=require(_0x6902('0x7'));module[_0x6902('0x8')]=function(_0x17a475,_0x34c869){return _0x17a475[_0x6902('0x9')](_0x6902('0xa'),attributes,{'tableName':_0x6902('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf00a=['./chatQueue.attributes','exports','ChatQueue','chat_queues','lodash','../../config/logger','api','bluebird','path','rimraf'];(function(_0x19a49f,_0x444d74){var _0x5351ae=function(_0x58b1ed){while(--_0x58b1ed){_0x19a49f['push'](_0x19a49f['shift']());}};_0x5351ae(++_0x444d74);}(_0xf00a,0x90));var _0xaf00=function(_0x55a101,_0x3df81b){_0x55a101=_0x55a101-0x0;var _0x43466b=_0xf00a[_0x55a101];return _0x43466b;};'use strict';var _=require(_0xaf00('0x0'));var util=require('util');var logger=require(_0xaf00('0x1'))(_0xaf00('0x2'));var moment=require('moment');var BPromise=require(_0xaf00('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf00('0x4'));var rimraf=require(_0xaf00('0x5'));var config=require('../../config/environment');var attributes=require(_0xaf00('0x6'));module[_0xaf00('0x7')]=function(_0xe82429,_0x4b0857){return _0xe82429['define'](_0xaf00('0x8'),attributes,{'tableName':_0xaf00('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b719144..d7a7f42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce2f=['catch','GetChatQueue','ChatQueue','findAll','options','raw','where','limit','map','include','model','attributes','ShowChatQueue','debug','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','then','info','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatQueue,\x20%s,\x20%s','result'];(function(_0x413a2f,_0x1eb399){var _0x1ad4f2=function(_0x5cf9b1){while(--_0x5cf9b1){_0x413a2f['push'](_0x413a2f['shift']());}};_0x1ad4f2(++_0x1eb399);}(_0xce2f,0x18a));var _0xfce2=function(_0x1b0d0d,_0x3d8d3f){_0x1b0d0d=_0x1b0d0d-0x0;var _0x2b7df9=_0xce2f[_0x1b0d0d];return _0x2b7df9;};'use strict';var _=require('lodash');var util=require(_0xfce2('0x0'));var moment=require(_0xfce2('0x1'));var BPromise=require(_0xfce2('0x2'));var rs=require(_0xfce2('0x3'));var fs=require('fs');var Redis=require(_0xfce2('0x4'));var db=require(_0xfce2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfce2('0x6'))('rpc');var config=require(_0xfce2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfce2('0x8')][_0xfce2('0x9')]({'port':0x232a});config[_0xfce2('0xa')]=_[_0xfce2('0xb')](config[_0xfce2('0xa')],{'host':_0xfce2('0xc'),'port':0x18eb});var socket=require(_0xfce2('0xd'))(new Redis(config[_0xfce2('0xa')]));require('./chatQueue.socket')['register'](socket);function respondWithRpcPromise(_0x2141d1,_0x512cc4,_0x3f0071){return new BPromise(function(_0x4b2866,_0x441666){return client['request'](_0x2141d1,_0x3f0071)[_0xfce2('0xe')](function(_0xd76e83){logger[_0xfce2('0xf')]('ChatQueue,\x20%s,\x20%s',_0x512cc4,_0xfce2('0x10'));logger['debug'](_0xfce2('0x11'),_0x512cc4,_0xfce2('0x10'),JSON[_0xfce2('0x12')](_0xd76e83));if(_0xd76e83[_0xfce2('0x13')]){if(_0xd76e83[_0xfce2('0x13')][_0xfce2('0x14')]===0x1f4){logger[_0xfce2('0x13')]('ChatQueue,\x20%s,\x20%s',_0x512cc4,_0xd76e83[_0xfce2('0x13')][_0xfce2('0x15')]);return _0x441666(_0xd76e83['error'][_0xfce2('0x15')]);}logger[_0xfce2('0x13')]('ChatQueue,\x20%s,\x20%s',_0x512cc4,_0xd76e83['error'][_0xfce2('0x15')]);return _0x4b2866(_0xd76e83[_0xfce2('0x13')]['message']);}else{logger[_0xfce2('0xf')](_0xfce2('0x16'),_0x512cc4,_0xfce2('0x10'));_0x4b2866(_0xd76e83[_0xfce2('0x17')][_0xfce2('0x15')]);}})[_0xfce2('0x18')](function(_0x270e52){logger[_0xfce2('0x13')](_0xfce2('0x16'),_0x512cc4,_0x270e52);_0x441666(_0x270e52);});});}exports[_0xfce2('0x19')]=function(_0x4b90ed){var _0x56fb0e=this;return new Promise(function(_0x3c4f1f,_0x3ea07b){return db[_0xfce2('0x1a')][_0xfce2('0x1b')]({'raw':_0x4b90ed[_0xfce2('0x1c')]?_0x4b90ed[_0xfce2('0x1c')][_0xfce2('0x1d')]===undefined?!![]:![]:!![],'where':_0x4b90ed[_0xfce2('0x1c')]?_0x4b90ed['options'][_0xfce2('0x1e')]||null:null,'attributes':_0x4b90ed[_0xfce2('0x1c')]?_0x4b90ed[_0xfce2('0x1c')]['attributes']||null:null,'limit':_0x4b90ed['options']?_0x4b90ed[_0xfce2('0x1c')][_0xfce2('0x1f')]||null:null,'include':_0x4b90ed[_0xfce2('0x1c')]?_0x4b90ed[_0xfce2('0x1c')]['include']?_[_0xfce2('0x20')](_0x4b90ed[_0xfce2('0x1c')][_0xfce2('0x21')],function(_0x47ed7f){return{'model':db[_0x47ed7f[_0xfce2('0x22')]],'as':_0x47ed7f['as'],'attributes':_0x47ed7f[_0xfce2('0x23')],'include':_0x47ed7f[_0xfce2('0x21')]?_['map'](_0x47ed7f[_0xfce2('0x21')],function(_0x2358dc){return{'model':db[_0x2358dc[_0xfce2('0x22')]],'as':_0x2358dc['as'],'attributes':_0x2358dc[_0xfce2('0x23')],'include':_0x2358dc['include']?_[_0xfce2('0x20')](_0x2358dc[_0xfce2('0x21')],function(_0x58022e){return{'model':db[_0x58022e[_0xfce2('0x22')]],'as':_0x58022e['as'],'attributes':_0x58022e[_0xfce2('0x23')]};}):[]};}):[]};}):[]:[]})[_0xfce2('0xe')](function(_0x1f48ba){logger['info'](_0xfce2('0x19'),_0x4b90ed);logger['debug'](_0xfce2('0x19'),_0x4b90ed,JSON[_0xfce2('0x12')](_0x1f48ba));_0x3c4f1f(_0x1f48ba);})[_0xfce2('0x18')](function(_0x35b7fe){logger[_0xfce2('0x13')](_0xfce2('0x19'),_0x35b7fe[_0xfce2('0x15')],_0x4b90ed);_0x3ea07b(_0x56fb0e[_0xfce2('0x13')](0x1f4,_0x35b7fe['message']));});});};exports[_0xfce2('0x24')]=function(_0x26a757){var _0x254206=this;return new Promise(function(_0x4b6657,_0x44d500){return db['ChatQueue']['find']({'raw':_0x26a757[_0xfce2('0x1c')]?_0x26a757['options'][_0xfce2('0x1d')]===undefined?!![]:![]:!![],'where':_0x26a757[_0xfce2('0x1c')]?_0x26a757[_0xfce2('0x1c')][_0xfce2('0x1e')]||null:null,'attributes':_0x26a757['options']?_0x26a757['options']['attributes']||null:null,'include':_0x26a757[_0xfce2('0x1c')]?_0x26a757[_0xfce2('0x1c')][_0xfce2('0x21')]?_[_0xfce2('0x20')](_0x26a757[_0xfce2('0x1c')]['include'],function(_0x4afa63){return{'model':db[_0x4afa63[_0xfce2('0x22')]],'as':_0x4afa63['as'],'attributes':_0x4afa63[_0xfce2('0x23')],'include':_0x4afa63[_0xfce2('0x21')]?_['map'](_0x4afa63[_0xfce2('0x21')],function(_0x4f7153){return{'model':db[_0x4f7153[_0xfce2('0x22')]],'as':_0x4f7153['as'],'attributes':_0x4f7153[_0xfce2('0x23')],'include':_0x4f7153[_0xfce2('0x21')]?_['map'](_0x4f7153['include'],function(_0x365873){return{'model':db[_0x365873[_0xfce2('0x22')]],'as':_0x365873['as'],'attributes':_0x365873[_0xfce2('0x23')]};}):[]};}):[]};}):[]:[]})[_0xfce2('0xe')](function(_0x52caca){logger[_0xfce2('0xf')]('ShowChatQueue',_0x26a757);logger[_0xfce2('0x25')]('ShowChatQueue',_0x26a757,JSON[_0xfce2('0x12')](_0x52caca));_0x4b6657(_0x52caca);})[_0xfce2('0x18')](function(_0x3bc14e){logger[_0xfce2('0x13')](_0xfce2('0x24'),_0x3bc14e['message'],_0x26a757);_0x44d500(_0x254206[_0xfce2('0x13')](0x1f4,_0x3bc14e[_0xfce2('0x15')]));});});};
\ No newline at end of file
+var _0x25a9=['where','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatQueue','findAll','options','raw','attributes','limit','map','include','model','GetChatQueue','debug','ShowChatQueue','find'];(function(_0x3f19b3,_0x3f0849){var _0xd61898=function(_0x3ca685){while(--_0x3ca685){_0x3f19b3['push'](_0x3f19b3['shift']());}};_0xd61898(++_0x3f0849);}(_0x25a9,0xf1));var _0x925a=function(_0x4d93c9,_0x4775ae){_0x4d93c9=_0x4d93c9-0x0;var _0x48536d=_0x25a9[_0x4d93c9];return _0x48536d;};'use strict';var _=require('lodash');var util=require(_0x925a('0x0'));var moment=require(_0x925a('0x1'));var BPromise=require(_0x925a('0x2'));var rs=require(_0x925a('0x3'));var fs=require('fs');var Redis=require(_0x925a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x925a('0x5'));var logger=require(_0x925a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x925a('0x7'));var client=jayson['client'][_0x925a('0x8')]({'port':0x232a});config[_0x925a('0x9')]=_[_0x925a('0xa')](config[_0x925a('0x9')],{'host':_0x925a('0xb'),'port':0x18eb});var socket=require(_0x925a('0xc'))(new Redis(config[_0x925a('0x9')]));require('./chatQueue.socket')[_0x925a('0xd')](socket);function respondWithRpcPromise(_0x55a571,_0x4f76b2,_0x575450){return new BPromise(function(_0x152980,_0x5871f4){return client[_0x925a('0xe')](_0x55a571,_0x575450)[_0x925a('0xf')](function(_0xe633a1){logger[_0x925a('0x10')](_0x925a('0x11'),_0x4f76b2,_0x925a('0x12'));logger['debug'](_0x925a('0x13'),_0x4f76b2,_0x925a('0x12'),JSON[_0x925a('0x14')](_0xe633a1));if(_0xe633a1[_0x925a('0x15')]){if(_0xe633a1[_0x925a('0x15')][_0x925a('0x16')]===0x1f4){logger[_0x925a('0x15')]('ChatQueue,\x20%s,\x20%s',_0x4f76b2,_0xe633a1[_0x925a('0x15')][_0x925a('0x17')]);return _0x5871f4(_0xe633a1[_0x925a('0x15')][_0x925a('0x17')]);}logger['error'](_0x925a('0x11'),_0x4f76b2,_0xe633a1[_0x925a('0x15')]['message']);return _0x152980(_0xe633a1[_0x925a('0x15')][_0x925a('0x17')]);}else{logger[_0x925a('0x10')](_0x925a('0x11'),_0x4f76b2,'request\x20sent');_0x152980(_0xe633a1[_0x925a('0x18')][_0x925a('0x17')]);}})[_0x925a('0x19')](function(_0x3375e6){logger[_0x925a('0x15')]('ChatQueue,\x20%s,\x20%s',_0x4f76b2,_0x3375e6);_0x5871f4(_0x3375e6);});});}exports['GetChatQueue']=function(_0x433077){var _0x228158=this;return new Promise(function(_0x54d9aa,_0x2abbdc){return db[_0x925a('0x1a')][_0x925a('0x1b')]({'raw':_0x433077[_0x925a('0x1c')]?_0x433077[_0x925a('0x1c')][_0x925a('0x1d')]===undefined?!![]:![]:!![],'where':_0x433077[_0x925a('0x1c')]?_0x433077[_0x925a('0x1c')]['where']||null:null,'attributes':_0x433077[_0x925a('0x1c')]?_0x433077[_0x925a('0x1c')][_0x925a('0x1e')]||null:null,'limit':_0x433077['options']?_0x433077[_0x925a('0x1c')][_0x925a('0x1f')]||null:null,'include':_0x433077['options']?_0x433077[_0x925a('0x1c')]['include']?_[_0x925a('0x20')](_0x433077[_0x925a('0x1c')][_0x925a('0x21')],function(_0x2d4e16){return{'model':db[_0x2d4e16[_0x925a('0x22')]],'as':_0x2d4e16['as'],'attributes':_0x2d4e16[_0x925a('0x1e')],'include':_0x2d4e16[_0x925a('0x21')]?_[_0x925a('0x20')](_0x2d4e16[_0x925a('0x21')],function(_0x159c0a){return{'model':db[_0x159c0a['model']],'as':_0x159c0a['as'],'attributes':_0x159c0a[_0x925a('0x1e')],'include':_0x159c0a[_0x925a('0x21')]?_[_0x925a('0x20')](_0x159c0a[_0x925a('0x21')],function(_0x5cb909){return{'model':db[_0x5cb909[_0x925a('0x22')]],'as':_0x5cb909['as'],'attributes':_0x5cb909['attributes']};}):[]};}):[]};}):[]:[]})[_0x925a('0xf')](function(_0x5d704a){logger[_0x925a('0x10')](_0x925a('0x23'),_0x433077);logger[_0x925a('0x24')](_0x925a('0x23'),_0x433077,JSON[_0x925a('0x14')](_0x5d704a));_0x54d9aa(_0x5d704a);})[_0x925a('0x19')](function(_0x1c951b){logger[_0x925a('0x15')]('GetChatQueue',_0x1c951b[_0x925a('0x17')],_0x433077);_0x2abbdc(_0x228158['error'](0x1f4,_0x1c951b[_0x925a('0x17')]));});});};exports[_0x925a('0x25')]=function(_0xe9c070){var _0x53f35d=this;return new Promise(function(_0x3c70a3,_0x113a16){return db[_0x925a('0x1a')][_0x925a('0x26')]({'raw':_0xe9c070[_0x925a('0x1c')]?_0xe9c070[_0x925a('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0xe9c070[_0x925a('0x1c')]?_0xe9c070[_0x925a('0x1c')][_0x925a('0x27')]||null:null,'attributes':_0xe9c070[_0x925a('0x1c')]?_0xe9c070['options']['attributes']||null:null,'include':_0xe9c070[_0x925a('0x1c')]?_0xe9c070[_0x925a('0x1c')][_0x925a('0x21')]?_['map'](_0xe9c070[_0x925a('0x1c')][_0x925a('0x21')],function(_0x386911){return{'model':db[_0x386911[_0x925a('0x22')]],'as':_0x386911['as'],'attributes':_0x386911['attributes'],'include':_0x386911['include']?_[_0x925a('0x20')](_0x386911[_0x925a('0x21')],function(_0x3af324){return{'model':db[_0x3af324[_0x925a('0x22')]],'as':_0x3af324['as'],'attributes':_0x3af324[_0x925a('0x1e')],'include':_0x3af324[_0x925a('0x21')]?_['map'](_0x3af324[_0x925a('0x21')],function(_0x494e83){return{'model':db[_0x494e83['model']],'as':_0x494e83['as'],'attributes':_0x494e83[_0x925a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x925a('0xf')](function(_0x5b1289){logger[_0x925a('0x10')](_0x925a('0x25'),_0xe9c070);logger['debug'](_0x925a('0x25'),_0xe9c070,JSON['stringify'](_0x5b1289));_0x3c70a3(_0x5b1289);})['catch'](function(_0x526552){logger[_0x925a('0x15')](_0x925a('0x25'),_0x526552[_0x925a('0x17')],_0xe9c070);_0x113a16(_0x53f35d[_0x925a('0x15')](0x1f4,_0x526552[_0x925a('0x17')]));});});};
\ No newline at end of file
index b26b02b..fe8d84c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c6d=['emit','removeListener','register','length','chatQueue:','./chatQueue.events','save','remove','update'];(function(_0x302165,_0x4543d5){var _0x36059f=function(_0x596974){while(--_0x596974){_0x302165['push'](_0x302165['shift']());}};_0x36059f(++_0x4543d5);}(_0x4c6d,0x1d0));var _0xd4c6=function(_0x5ec6dc,_0x1a6293){_0x5ec6dc=_0x5ec6dc-0x0;var _0x550a4b=_0x4c6d[_0x5ec6dc];return _0x550a4b;};'use strict';var ChatQueueEvents=require(_0xd4c6('0x0'));var events=[_0xd4c6('0x1'),_0xd4c6('0x2'),_0xd4c6('0x3')];function createListener(_0x350cc0,_0x5448bc){return function(_0x209f99){_0x5448bc[_0xd4c6('0x4')](_0x350cc0,_0x209f99);};}function removeListener(_0x306766,_0x4b2d75){return function(){ChatQueueEvents[_0xd4c6('0x5')](_0x306766,_0x4b2d75);};}exports[_0xd4c6('0x6')]=function(_0x56279c){for(var _0x182671=0x0,_0x316314=events[_0xd4c6('0x7')];_0x182671<_0x316314;_0x182671++){var _0x5d4fce=events[_0x182671];var _0x440ee3=createListener(_0xd4c6('0x8')+_0x5d4fce,_0x56279c);ChatQueueEvents['on'](_0x5d4fce,_0x440ee3);}};
\ No newline at end of file
+var _0x70e0=['chatQueue:','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x20837e,_0x2adf66){var _0x3fa4e8=function(_0x3a2e99){while(--_0x3a2e99){_0x20837e['push'](_0x20837e['shift']());}};_0x3fa4e8(++_0x2adf66);}(_0x70e0,0x17b));var _0x070e=function(_0x487939,_0x562e0e){_0x487939=_0x487939-0x0;var _0x165d57=_0x70e0[_0x487939];return _0x165d57;};'use strict';var ChatQueueEvents=require(_0x070e('0x0'));var events=[_0x070e('0x1'),_0x070e('0x2'),'update'];function createListener(_0x579b83,_0x16e651){return function(_0xee173){_0x16e651[_0x070e('0x3')](_0x579b83,_0xee173);};}function removeListener(_0x2593e5,_0x5c90fc){return function(){ChatQueueEvents[_0x070e('0x4')](_0x2593e5,_0x5c90fc);};}exports['register']=function(_0x46fe68){for(var _0x4b041d=0x0,_0x56e420=events['length'];_0x4b041d<_0x56e420;_0x4b041d++){var _0x35ab0c=events[_0x4b041d];var _0x1e11f0=createListener(_0x070e('0x5')+_0x35ab0c,_0x46fe68);ChatQueueEvents['on'](_0x35ab0c,_0x1e11f0);}};
\ No newline at end of file
index 13afc01..de595fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3e0763,_0x3d12be){_0x3e0763=_0x3e0763-0x0;var _0x351ca2=_0x5fc3[_0x3e0763];return _0x351ca2;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
+var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x48ec32,_0x43a389){var _0x40b304=function(_0x550eb1){while(--_0x550eb1){_0x48ec32['push'](_0x48ec32['shift']());}};_0x40b304(++_0x43a389);}(_0x008c,0x188));var _0xc008=function(_0x4fbf33,_0x318fbc){_0x4fbf33=_0x4fbf33-0x0;var _0x1997d2=_0x008c[_0x4fbf33];return _0x1997d2;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index 7c4c315..a0e2227 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x961e=['DATE','exports','STRING'];(function(_0x5b10a7,_0x4e441d){var _0x23b5c8=function(_0x36d59b){while(--_0x36d59b){_0x5b10a7['push'](_0x5b10a7['shift']());}};_0x23b5c8(++_0x4e441d);}(_0x961e,0x1a8));var _0xe961=function(_0x290e73,_0x2351bb){_0x290e73=_0x290e73-0x0;var _0x1e0b65=_0x961e[_0x290e73];return _0x1e0b65;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0xe961('0x0')]={'uniqueid':{'type':Sequelize[_0xe961('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0xe961('0x1')]},'joinAt':{'type':Sequelize[_0xe961('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xe961('0x2')]},'reason':{'type':Sequelize[_0xe961('0x1')]}};
\ No newline at end of file
+var _0x2f7e=['STRING','DATE','moment','sequelize'];(function(_0x77651c,_0x2bd29b){var _0x1cba5d=function(_0x241ab3){while(--_0x241ab3){_0x77651c['push'](_0x77651c['shift']());}};_0x1cba5d(++_0x2bd29b);}(_0x2f7e,0x122));var _0xe2f7=function(_0x338aa7,_0x411a47){_0x338aa7=_0x338aa7-0x0;var _0x4e0471=_0x2f7e[_0x338aa7];return _0x4e0471;};'use strict';var moment=require(_0xe2f7('0x0'));var Sequelize=require(_0xe2f7('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xe2f7('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xe2f7('0x2')]},'joinAt':{'type':Sequelize[_0xe2f7('0x3')]},'leaveAt':{'type':Sequelize[_0xe2f7('0x3')]},'acceptAt':{'type':Sequelize[_0xe2f7('0x3')]},'exitAt':{'type':Sequelize[_0xe2f7('0x3')]},'reason':{'type':Sequelize[_0xe2f7('0x2')]}};
\ No newline at end of file
index 8679c7b..e2a7376 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3914=['filter','VIRTUAL','merge','include','findAll','rows','catch','params','rawAttributes','intersection','includeAll','find','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','apply','reject','save','update','then','end','error','send','index','map','ChatQueueReport','fieldName','type','key','model','name','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick'];(function(_0x19c429,_0x178ed2){var _0x5f2a33=function(_0x57214e){while(--_0x57214e){_0x19c429['push'](_0x19c429['shift']());}};_0x5f2a33(++_0x178ed2);}(_0x3914,0xeb));var _0x4391=function(_0x2fbd0e,_0x3460a9){_0x2fbd0e=_0x2fbd0e-0x0;var _0x481c9f=_0x3914[_0x2fbd0e];return _0x481c9f;};'use strict';var emlformat=require(_0x4391('0x0'));var rimraf=require(_0x4391('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4391('0x2'));var rp=require(_0x4391('0x3'));var moment=require('moment');var BPromise=require(_0x4391('0x4'));var Mustache=require(_0x4391('0x5'));var util=require(_0x4391('0x6'));var path=require('path');var sox=require(_0x4391('0x7'));var csv=require(_0x4391('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4391('0x9'));var _=require('lodash');var squel=require(_0x4391('0xa'));var crypto=require('crypto');var jsforce=require(_0x4391('0xb'));var deskjs=require(_0x4391('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4391('0xd'));var Redis=require(_0x4391('0xe'));var authService=require(_0x4391('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4391('0x10'));var hardwareService=require(_0x4391('0x11'));var logger=require(_0x4391('0x12'))(_0x4391('0x13'));var utils=require('../../config/utils');var config=require(_0x4391('0x14'));var licenseUtil=require(_0x4391('0x15'));var db=require(_0x4391('0x16'))['db'];function respondWithStatusCode(_0x137902,_0x254ffb){_0x254ffb=_0x254ffb||0xcc;return function(_0xdebb72){if(_0xdebb72){return _0x137902[_0x4391('0x17')](_0x254ffb);}return _0x137902[_0x4391('0x18')](_0x254ffb)['end']();};}function respondWithResult(_0x1a49ba,_0x3bd3a7){_0x3bd3a7=_0x3bd3a7||0xc8;return function(_0x3f82fb){if(_0x3f82fb){return _0x1a49ba[_0x4391('0x18')](_0x3bd3a7)['json'](_0x3f82fb);}};}function respondWithFilteredResult(_0x62c763,_0x4ff882){return function(_0x343203){if(_0x343203){var _0x3a1b80=typeof _0x4ff882[_0x4391('0x19')]===_0x4391('0x1a')&&typeof _0x4ff882[_0x4391('0x1b')]===_0x4391('0x1a');var _0x2b5117=_0x343203[_0x4391('0x1c')];var _0x58a311=_0x3a1b80?0x0:_0x4ff882['offset'];var _0x2ecb23=_0x3a1b80?_0x343203['count']:_0x4ff882[_0x4391('0x19')]+_0x4ff882[_0x4391('0x1b')];var _0xa9c97f;if(_0x2ecb23>=_0x2b5117){_0x2ecb23=_0x2b5117;_0xa9c97f=0xc8;}else{_0xa9c97f=0xce;}_0x62c763[_0x4391('0x18')](_0xa9c97f);return _0x62c763[_0x4391('0x1d')]('Content-Range',_0x58a311+'-'+_0x2ecb23+'/'+_0x2b5117)['json'](_0x343203);}return null;};}function patchUpdates(_0x36c34c){return function(_0x37fca4){try{jsonpatch[_0x4391('0x1e')](_0x37fca4,_0x36c34c,!![]);}catch(_0x5570a8){return BPromise[_0x4391('0x1f')](_0x5570a8);}return _0x37fca4[_0x4391('0x20')]();};}function saveUpdates(_0x737d10,_0x3e1e0b){return function(_0x505d2c){if(_0x505d2c){return _0x505d2c[_0x4391('0x21')](_0x737d10)[_0x4391('0x22')](function(_0x3c4c9b){return _0x3c4c9b;});}return null;};}function removeEntity(_0xfee343,_0x24e16c){return function(_0x40ff34){if(_0x40ff34){return _0x40ff34['destroy']()[_0x4391('0x22')](function(){_0xfee343[_0x4391('0x18')](0xcc)[_0x4391('0x23')]();});}};}function handleEntityNotFound(_0x333ca6,_0x540339){return function(_0x4b0c28){if(!_0x4b0c28){_0x333ca6[_0x4391('0x17')](0x194);}return _0x4b0c28;};}function handleError(_0x3aa79f,_0x3f2554){_0x3f2554=_0x3f2554||0x1f4;return function(_0x197408){logger[_0x4391('0x24')](_0x197408['stack']);if(_0x197408['name']){delete _0x197408['name'];}_0x3aa79f['status'](_0x3f2554)[_0x4391('0x25')](_0x197408);};}exports[_0x4391('0x26')]=function(_0x471d43,_0x2f7b18){var _0x49aa36={},_0x34059f={},_0x32ed74={'count':0x0,'rows':[]};var _0x115e36=_[_0x4391('0x27')](db[_0x4391('0x28')]['rawAttributes'],function(_0x1a8df0){return{'name':_0x1a8df0[_0x4391('0x29')],'type':_0x1a8df0[_0x4391('0x2a')][_0x4391('0x2b')]};});_0x34059f[_0x4391('0x2c')]=_[_0x4391('0x27')](_0x115e36,_0x4391('0x2d'));_0x34059f[_0x4391('0x2e')]=_[_0x4391('0x2f')](_0x471d43[_0x4391('0x2e')]);_0x34059f[_0x4391('0x30')]=_['intersection'](_0x34059f[_0x4391('0x2c')],_0x34059f['query']);_0x49aa36[_0x4391('0x31')]=_['intersection'](_0x34059f['model'],qs[_0x4391('0x32')](_0x471d43[_0x4391('0x2e')][_0x4391('0x32')]));_0x49aa36[_0x4391('0x31')]=_0x49aa36[_0x4391('0x31')][_0x4391('0x33')]?_0x49aa36[_0x4391('0x31')]:_0x34059f['model'];if(!_0x471d43[_0x4391('0x2e')]['hasOwnProperty'](_0x4391('0x34'))){_0x49aa36['limit']=qs[_0x4391('0x1b')](_0x471d43[_0x4391('0x2e')][_0x4391('0x1b')]);_0x49aa36[_0x4391('0x19')]=qs[_0x4391('0x19')](_0x471d43[_0x4391('0x2e')][_0x4391('0x19')]);}_0x49aa36[_0x4391('0x35')]=qs[_0x4391('0x36')](_0x471d43[_0x4391('0x2e')][_0x4391('0x36')]);_0x49aa36[_0x4391('0x37')]=qs[_0x4391('0x30')](_[_0x4391('0x38')](_0x471d43[_0x4391('0x2e')],_0x34059f[_0x4391('0x30')]),_0x115e36);if(_0x471d43[_0x4391('0x2e')][_0x4391('0x39')]){_0x49aa36['where']=_['merge'](_0x49aa36[_0x4391('0x37')],{'$or':_[_0x4391('0x27')](_0x115e36,function(_0x58e161){if(_0x58e161[_0x4391('0x2a')]!==_0x4391('0x3a')){var _0x1c716c={};_0x1c716c[_0x58e161[_0x4391('0x2d')]]={'$like':'%'+_0x471d43[_0x4391('0x2e')]['filter']+'%'};return _0x1c716c;}})});}_0x49aa36=_[_0x4391('0x3b')]({},_0x49aa36,_0x471d43['options']);var _0x5ec1cf={'where':_0x49aa36['where']};return db['ChatQueueReport'][_0x4391('0x1c')](_0x5ec1cf)[_0x4391('0x22')](function(_0x33736a){_0x32ed74[_0x4391('0x1c')]=_0x33736a;if(_0x471d43['query']['includeAll']){_0x49aa36[_0x4391('0x3c')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x4391('0x3d')](_0x49aa36);})[_0x4391('0x22')](function(_0x3bfcdc){_0x32ed74[_0x4391('0x3e')]=_0x3bfcdc;return _0x32ed74;})[_0x4391('0x22')](respondWithFilteredResult(_0x2f7b18,_0x49aa36))[_0x4391('0x3f')](handleError(_0x2f7b18,null));};exports['show']=function(_0x2708e2,_0x3da701){var _0x361f44={'raw':!![],'where':{'id':_0x2708e2[_0x4391('0x40')]['id']}},_0x13f5f4={};_0x13f5f4[_0x4391('0x2c')]=_[_0x4391('0x2f')](db['ChatQueueReport'][_0x4391('0x41')]);_0x13f5f4[_0x4391('0x2e')]=_[_0x4391('0x2f')](_0x2708e2[_0x4391('0x2e')]);_0x13f5f4[_0x4391('0x30')]=_[_0x4391('0x42')](_0x13f5f4[_0x4391('0x2c')],_0x13f5f4['query']);_0x361f44[_0x4391('0x31')]=_['intersection'](_0x13f5f4[_0x4391('0x2c')],qs[_0x4391('0x32')](_0x2708e2[_0x4391('0x2e')][_0x4391('0x32')]));_0x361f44[_0x4391('0x31')]=_0x361f44[_0x4391('0x31')][_0x4391('0x33')]?_0x361f44[_0x4391('0x31')]:_0x13f5f4[_0x4391('0x2c')];if(_0x2708e2[_0x4391('0x2e')][_0x4391('0x43')]){_0x361f44[_0x4391('0x3c')]=[{'all':!![]}];}_0x361f44=_[_0x4391('0x3b')]({},_0x361f44,_0x2708e2['options']);return db['ChatQueueReport'][_0x4391('0x44')](_0x361f44)[_0x4391('0x22')](handleEntityNotFound(_0x3da701,null))[_0x4391('0x22')](respondWithResult(_0x3da701,null))[_0x4391('0x3f')](handleError(_0x3da701,null));};exports[_0x4391('0x45')]=function(_0x25c7f6,_0x4efc22){return db[_0x4391('0x28')]['create'](_0x25c7f6[_0x4391('0x46')],{})['then'](respondWithResult(_0x4efc22,0xc9))[_0x4391('0x3f')](handleError(_0x4efc22,null));};exports[_0x4391('0x21')]=function(_0x738d35,_0x1b07b2){if(_0x738d35[_0x4391('0x46')]['id']){delete _0x738d35[_0x4391('0x46')]['id'];}return db['ChatQueueReport'][_0x4391('0x44')]({'where':{'id':_0x738d35[_0x4391('0x40')]['id']}})[_0x4391('0x22')](handleEntityNotFound(_0x1b07b2,null))[_0x4391('0x22')](saveUpdates(_0x738d35[_0x4391('0x46')],null))[_0x4391('0x22')](respondWithResult(_0x1b07b2,null))[_0x4391('0x3f')](handleError(_0x1b07b2,null));};exports[_0x4391('0x47')]=function(_0x1ca698,_0x294498){return db[_0x4391('0x28')][_0x4391('0x44')]({'where':{'id':_0x1ca698[_0x4391('0x40')]['id']}})['then'](handleEntityNotFound(_0x294498,null))[_0x4391('0x22')](removeEntity(_0x294498,null))[_0x4391('0x3f')](handleError(_0x294498,null));};exports[_0x4391('0x48')]=function(_0x516c64,_0x156614){return db[_0x4391('0x28')][_0x4391('0x48')]()['then'](respondWithResult(_0x156614,null))[_0x4391('0x3f')](handleError(_0x156614,null));};
\ No newline at end of file
+var _0x9b2c=['order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x9b2c,0x189));var _0xc9b2=function(_0x43ed38,_0x507af1){_0x43ed38=_0x43ed38-0x0;var _0x181497=_0x9b2c[_0x43ed38];return _0x181497;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc9b2('0x0'));var zipdir=require(_0xc9b2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc9b2('0x2'));var moment=require('moment');var BPromise=require(_0xc9b2('0x3'));var Mustache=require('mustache');var util=require(_0xc9b2('0x4'));var path=require(_0xc9b2('0x5'));var sox=require(_0xc9b2('0x6'));var csv=require(_0xc9b2('0x7'));var ejs=require(_0xc9b2('0x8'));var fs=require('fs');var fs_extra=require(_0xc9b2('0x9'));var _=require(_0xc9b2('0xa'));var squel=require(_0xc9b2('0xb'));var crypto=require(_0xc9b2('0xc'));var jsforce=require(_0xc9b2('0xd'));var deskjs=require(_0xc9b2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc9b2('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc9b2('0x10'));var qs=require(_0xc9b2('0x11'));var as=require(_0xc9b2('0x12'));var hardwareService=require(_0xc9b2('0x13'));var logger=require(_0xc9b2('0x14'))(_0xc9b2('0x15'));var utils=require(_0xc9b2('0x16'));var config=require(_0xc9b2('0x17'));var licenseUtil=require(_0xc9b2('0x18'));var db=require(_0xc9b2('0x19'))['db'];function respondWithStatusCode(_0x1cddb4,_0x3c4a7e){_0x3c4a7e=_0x3c4a7e||0xcc;return function(_0x5a1297){if(_0x5a1297){return _0x1cddb4[_0xc9b2('0x1a')](_0x3c4a7e);}return _0x1cddb4[_0xc9b2('0x1b')](_0x3c4a7e)[_0xc9b2('0x1c')]();};}function respondWithResult(_0x203739,_0x58a94f){_0x58a94f=_0x58a94f||0xc8;return function(_0x11b076){if(_0x11b076){return _0x203739[_0xc9b2('0x1b')](_0x58a94f)[_0xc9b2('0x1d')](_0x11b076);}};}function respondWithFilteredResult(_0x3a000e,_0xe8c3d8){return function(_0xc37dd){if(_0xc37dd){var _0x302c1a=typeof _0xe8c3d8[_0xc9b2('0x1e')]==='undefined'&&typeof _0xe8c3d8[_0xc9b2('0x1f')]===_0xc9b2('0x20');var _0xe224aa=_0xc37dd[_0xc9b2('0x21')];var _0x49d95a=_0x302c1a?0x0:_0xe8c3d8[_0xc9b2('0x1e')];var _0xde5092=_0x302c1a?_0xc37dd[_0xc9b2('0x21')]:_0xe8c3d8[_0xc9b2('0x1e')]+_0xe8c3d8[_0xc9b2('0x1f')];var _0x43fb7a;if(_0xde5092>=_0xe224aa){_0xde5092=_0xe224aa;_0x43fb7a=0xc8;}else{_0x43fb7a=0xce;}_0x3a000e[_0xc9b2('0x1b')](_0x43fb7a);return _0x3a000e['set'](_0xc9b2('0x22'),_0x49d95a+'-'+_0xde5092+'/'+_0xe224aa)['json'](_0xc37dd);}return null;};}function patchUpdates(_0x13739a){return function(_0x3d3a5c){try{jsonpatch['apply'](_0x3d3a5c,_0x13739a,!![]);}catch(_0x18237a){return BPromise[_0xc9b2('0x23')](_0x18237a);}return _0x3d3a5c['save']();};}function saveUpdates(_0x2842be,_0x4cc1b9){return function(_0x127fef){if(_0x127fef){return _0x127fef[_0xc9b2('0x24')](_0x2842be)[_0xc9b2('0x25')](function(_0x13006d){return _0x13006d;});}return null;};}function removeEntity(_0x20875a,_0x16e0e6){return function(_0x128ec5){if(_0x128ec5){return _0x128ec5[_0xc9b2('0x26')]()[_0xc9b2('0x25')](function(){_0x20875a[_0xc9b2('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15dc60,_0xbb3bf9){return function(_0x444181){if(!_0x444181){_0x15dc60[_0xc9b2('0x1a')](0x194);}return _0x444181;};}function handleError(_0x5a2c79,_0x349943){_0x349943=_0x349943||0x1f4;return function(_0x5bdfe8){logger[_0xc9b2('0x27')](_0x5bdfe8[_0xc9b2('0x28')]);if(_0x5bdfe8[_0xc9b2('0x29')]){delete _0x5bdfe8[_0xc9b2('0x29')];}_0x5a2c79[_0xc9b2('0x1b')](_0x349943)[_0xc9b2('0x2a')](_0x5bdfe8);};}exports[_0xc9b2('0x2b')]=function(_0x3d735a,_0x46ab9b){var _0x37f4f0={},_0x16936f={},_0x2ab823={'count':0x0,'rows':[]};var _0x3de1f9=_[_0xc9b2('0x2c')](db[_0xc9b2('0x2d')][_0xc9b2('0x2e')],function(_0x5d7748){return{'name':_0x5d7748['fieldName'],'type':_0x5d7748[_0xc9b2('0x2f')][_0xc9b2('0x30')]};});_0x16936f[_0xc9b2('0x31')]=_['map'](_0x3de1f9,_0xc9b2('0x29'));_0x16936f['query']=_[_0xc9b2('0x32')](_0x3d735a[_0xc9b2('0x33')]);_0x16936f[_0xc9b2('0x34')]=_[_0xc9b2('0x35')](_0x16936f[_0xc9b2('0x31')],_0x16936f[_0xc9b2('0x33')]);_0x37f4f0[_0xc9b2('0x36')]=_[_0xc9b2('0x35')](_0x16936f['model'],qs[_0xc9b2('0x37')](_0x3d735a[_0xc9b2('0x33')][_0xc9b2('0x37')]));_0x37f4f0[_0xc9b2('0x36')]=_0x37f4f0['attributes']['length']?_0x37f4f0[_0xc9b2('0x36')]:_0x16936f[_0xc9b2('0x31')];if(!_0x3d735a['query']['hasOwnProperty'](_0xc9b2('0x38'))){_0x37f4f0['limit']=qs[_0xc9b2('0x1f')](_0x3d735a[_0xc9b2('0x33')]['limit']);_0x37f4f0[_0xc9b2('0x1e')]=qs[_0xc9b2('0x1e')](_0x3d735a[_0xc9b2('0x33')]['offset']);}_0x37f4f0[_0xc9b2('0x39')]=qs[_0xc9b2('0x3a')](_0x3d735a[_0xc9b2('0x33')]['sort']);_0x37f4f0['where']=qs[_0xc9b2('0x34')](_['pick'](_0x3d735a[_0xc9b2('0x33')],_0x16936f[_0xc9b2('0x34')]),_0x3de1f9);if(_0x3d735a['query'][_0xc9b2('0x3b')]){_0x37f4f0[_0xc9b2('0x3c')]=_[_0xc9b2('0x3d')](_0x37f4f0['where'],{'$or':_[_0xc9b2('0x2c')](_0x3de1f9,function(_0x1ef6f3){if(_0x1ef6f3[_0xc9b2('0x2f')]!==_0xc9b2('0x3e')){var _0x3f31ae={};_0x3f31ae[_0x1ef6f3['name']]={'$like':'%'+_0x3d735a[_0xc9b2('0x33')][_0xc9b2('0x3b')]+'%'};return _0x3f31ae;}})});}_0x37f4f0=_[_0xc9b2('0x3d')]({},_0x37f4f0,_0x3d735a[_0xc9b2('0x3f')]);var _0x97b664={'where':_0x37f4f0[_0xc9b2('0x3c')]};return db[_0xc9b2('0x2d')][_0xc9b2('0x21')](_0x97b664)[_0xc9b2('0x25')](function(_0x26893c){_0x2ab823[_0xc9b2('0x21')]=_0x26893c;if(_0x3d735a[_0xc9b2('0x33')][_0xc9b2('0x40')]){_0x37f4f0[_0xc9b2('0x41')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xc9b2('0x42')](_0x37f4f0);})[_0xc9b2('0x25')](function(_0x304fa1){_0x2ab823[_0xc9b2('0x43')]=_0x304fa1;return _0x2ab823;})['then'](respondWithFilteredResult(_0x46ab9b,_0x37f4f0))[_0xc9b2('0x44')](handleError(_0x46ab9b,null));};exports[_0xc9b2('0x45')]=function(_0x53b549,_0x21dd63){var _0x3b93cb={'raw':!![],'where':{'id':_0x53b549[_0xc9b2('0x46')]['id']}},_0x5add26={};_0x5add26['model']=_['keys'](db[_0xc9b2('0x2d')][_0xc9b2('0x2e')]);_0x5add26[_0xc9b2('0x33')]=_[_0xc9b2('0x32')](_0x53b549[_0xc9b2('0x33')]);_0x5add26[_0xc9b2('0x34')]=_[_0xc9b2('0x35')](_0x5add26[_0xc9b2('0x31')],_0x5add26[_0xc9b2('0x33')]);_0x3b93cb['attributes']=_[_0xc9b2('0x35')](_0x5add26[_0xc9b2('0x31')],qs[_0xc9b2('0x37')](_0x53b549[_0xc9b2('0x33')][_0xc9b2('0x37')]));_0x3b93cb[_0xc9b2('0x36')]=_0x3b93cb[_0xc9b2('0x36')]['length']?_0x3b93cb[_0xc9b2('0x36')]:_0x5add26['model'];if(_0x53b549[_0xc9b2('0x33')][_0xc9b2('0x40')]){_0x3b93cb['include']=[{'all':!![]}];}_0x3b93cb=_[_0xc9b2('0x3d')]({},_0x3b93cb,_0x53b549['options']);return db[_0xc9b2('0x2d')][_0xc9b2('0x47')](_0x3b93cb)['then'](handleEntityNotFound(_0x21dd63,null))[_0xc9b2('0x25')](respondWithResult(_0x21dd63,null))['catch'](handleError(_0x21dd63,null));};exports[_0xc9b2('0x48')]=function(_0x351ef6,_0x5413bd){return db[_0xc9b2('0x2d')][_0xc9b2('0x48')](_0x351ef6[_0xc9b2('0x49')],{})[_0xc9b2('0x25')](respondWithResult(_0x5413bd,0xc9))[_0xc9b2('0x44')](handleError(_0x5413bd,null));};exports[_0xc9b2('0x24')]=function(_0x245293,_0x544445){if(_0x245293['body']['id']){delete _0x245293[_0xc9b2('0x49')]['id'];}return db[_0xc9b2('0x2d')]['find']({'where':{'id':_0x245293[_0xc9b2('0x46')]['id']}})[_0xc9b2('0x25')](handleEntityNotFound(_0x544445,null))[_0xc9b2('0x25')](saveUpdates(_0x245293[_0xc9b2('0x49')],null))['then'](respondWithResult(_0x544445,null))[_0xc9b2('0x44')](handleError(_0x544445,null));};exports[_0xc9b2('0x26')]=function(_0x456ea4,_0x3f6083){return db['ChatQueueReport']['find']({'where':{'id':_0x456ea4[_0xc9b2('0x46')]['id']}})[_0xc9b2('0x25')](handleEntityNotFound(_0x3f6083,null))[_0xc9b2('0x25')](removeEntity(_0x3f6083,null))['catch'](handleError(_0x3f6083,null));};exports[_0xc9b2('0x4a')]=function(_0x392807,_0x2ab7e1){return db[_0xc9b2('0x2d')][_0xc9b2('0x4a')]()[_0xc9b2('0x25')](respondWithResult(_0x2ab7e1,null))['catch'](handleError(_0x2ab7e1,null));};
\ No newline at end of file
index dc41af0..dfb1156 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','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x54a761,_0x431fd4){var _0x37d1da=function(_0x5ca617){while(--_0x5ca617){_0x54a761['push'](_0x54a761['shift']());}};_0x37d1da(++_0x431fd4);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x9f48e6,_0x8f87aa){var _0x45fc5c=function(_0xab1f4e){while(--_0xab1f4e){_0x9f48e6['push'](_0x9f48e6['shift']());}};_0x45fc5c(++_0x8f87aa);}(_0xb10b,0x12a));var _0xbb10=function(_0x100338,_0x5cdbcc){_0x100338=_0x100338-0x0;var _0x330d32=_0xb10b[_0x100338];return _0x330d32;};'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
index 4bc04f9..d03a110 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ff3=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','update','attributes','limit','lodash','util','moment','randomstring'];(function(_0x587218,_0x246b3e){var _0x444925=function(_0x446422){while(--_0x446422){_0x587218['push'](_0x587218['shift']());}};_0x444925(++_0x246b3e);}(_0x9ff3,0x104));var _0x39ff=function(_0xfd773b,_0xca2cb3){_0xfd773b=_0xfd773b-0x0;var _0x4927fb=_0x9ff3[_0xfd773b];return _0x4927fb;};'use strict';var _=require(_0x39ff('0x0'));var util=require(_0x39ff('0x1'));var moment=require(_0x39ff('0x2'));var BPromise=require('bluebird');var rs=require(_0x39ff('0x3'));var fs=require('fs');var Redis=require(_0x39ff('0x4'));var db=require(_0x39ff('0x5'))['db'];var utils=require(_0x39ff('0x6'));var logger=require(_0x39ff('0x7'))(_0x39ff('0x8'));var config=require(_0x39ff('0x9'));var jayson=require(_0x39ff('0xa'));var client=jayson['client'][_0x39ff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5261ee,_0x169b62,_0x22eeb0){return new BPromise(function(_0xe8bdff,_0x5d2cab){return client[_0x39ff('0xc')](_0x5261ee,_0x22eeb0)[_0x39ff('0xd')](function(_0x19b86c){logger[_0x39ff('0xe')](_0x39ff('0xf'),_0x169b62,_0x39ff('0x10'));logger[_0x39ff('0x11')](_0x39ff('0x12'),_0x169b62,_0x39ff('0x10'),JSON[_0x39ff('0x13')](_0x19b86c));if(_0x19b86c['error']){if(_0x19b86c[_0x39ff('0x14')]['code']===0x1f4){logger['error'](_0x39ff('0xf'),_0x169b62,_0x19b86c[_0x39ff('0x14')][_0x39ff('0x15')]);return _0x5d2cab(_0x19b86c[_0x39ff('0x14')]['message']);}logger['error'](_0x39ff('0xf'),_0x169b62,_0x19b86c[_0x39ff('0x14')][_0x39ff('0x15')]);return _0xe8bdff(_0x19b86c['error'][_0x39ff('0x15')]);}else{logger[_0x39ff('0xe')](_0x39ff('0xf'),_0x169b62,'request\x20sent');_0xe8bdff(_0x19b86c['result'][_0x39ff('0x15')]);}})[_0x39ff('0x16')](function(_0x375ada){logger[_0x39ff('0x14')](_0x39ff('0xf'),_0x169b62,_0x375ada);_0x5d2cab(_0x375ada);});});}exports[_0x39ff('0x17')]=function(_0x51a775){var _0x1df667=this;return new Promise(function(_0x1b0f3f,_0x3dbbb5){return db[_0x39ff('0x18')][_0x39ff('0x19')](_0x51a775[_0x39ff('0x1a')],{'raw':_0x51a775[_0x39ff('0x1b')]?_0x51a775[_0x39ff('0x1b')][_0x39ff('0x1c')]===undefined?!![]:![]:!![]})[_0x39ff('0xd')](function(_0x411621){logger['info'](_0x39ff('0x17'),_0x51a775);logger[_0x39ff('0x11')]('CreateChatQueueReport',_0x51a775,JSON[_0x39ff('0x13')](_0x411621));_0x1b0f3f(_0x411621);})[_0x39ff('0x16')](function(_0x308dd4){logger[_0x39ff('0x14')](_0x39ff('0x17'),_0x308dd4[_0x39ff('0x15')],_0x51a775);_0x3dbbb5(_0x1df667[_0x39ff('0x14')](0x1f4,_0x308dd4[_0x39ff('0x15')]));});});};exports[_0x39ff('0x1d')]=function(_0x92388c){var _0x293dc0=this;return new Promise(function(_0x13eb0b,_0x47afe5){return db[_0x39ff('0x18')][_0x39ff('0x1e')](_0x92388c[_0x39ff('0x1a')],{'raw':_0x92388c[_0x39ff('0x1b')]?_0x92388c[_0x39ff('0x1b')][_0x39ff('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x92388c[_0x39ff('0x1b')]?_0x92388c[_0x39ff('0x1b')]['where']||null:null,'attributes':_0x92388c[_0x39ff('0x1b')]?_0x92388c['options'][_0x39ff('0x1f')]||null:null,'limit':_0x92388c[_0x39ff('0x1b')]?_0x92388c[_0x39ff('0x1b')][_0x39ff('0x20')]||null:null})['then'](function(_0x490084){logger['info'](_0x39ff('0x1d'),_0x92388c);logger['debug'](_0x39ff('0x1d'),_0x92388c,JSON[_0x39ff('0x13')](_0x490084));_0x13eb0b(_0x490084);})[_0x39ff('0x16')](function(_0x10e9ed){logger[_0x39ff('0x14')]('UpdateChatQueueReport',_0x10e9ed[_0x39ff('0x15')],_0x92388c);_0x47afe5(_0x293dc0[_0x39ff('0x14')](0x1f4,_0x10e9ed[_0x39ff('0x15')]));});});};
\ No newline at end of file
+var _0xc229=['info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','catch','UpdateChatQueueReport','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0xc229,0xb3));var _0x9c22=function(_0x46fcca,_0x1e6178){_0x46fcca=_0x46fcca-0x0;var _0x32d1fe=_0xc229[_0x46fcca];return _0x32d1fe;};'use strict';var _=require(_0x9c22('0x0'));var util=require(_0x9c22('0x1'));var moment=require('moment');var BPromise=require(_0x9c22('0x2'));var rs=require(_0x9c22('0x3'));var fs=require('fs');var Redis=require(_0x9c22('0x4'));var db=require(_0x9c22('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9c22('0x6'))(_0x9c22('0x7'));var config=require(_0x9c22('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9c22('0x9')][_0x9c22('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30df48,_0x56a281,_0x1b87e4){return new BPromise(function(_0xad8255,_0x59fbc7){return client[_0x9c22('0xb')](_0x30df48,_0x1b87e4)[_0x9c22('0xc')](function(_0x3c9f3f){logger[_0x9c22('0xd')](_0x9c22('0xe'),_0x56a281,'request\x20sent');logger[_0x9c22('0xf')](_0x9c22('0x10'),_0x56a281,'request\x20sent',JSON[_0x9c22('0x11')](_0x3c9f3f));if(_0x3c9f3f[_0x9c22('0x12')]){if(_0x3c9f3f[_0x9c22('0x12')][_0x9c22('0x13')]===0x1f4){logger[_0x9c22('0x12')](_0x9c22('0xe'),_0x56a281,_0x3c9f3f['error'][_0x9c22('0x14')]);return _0x59fbc7(_0x3c9f3f[_0x9c22('0x12')]['message']);}logger[_0x9c22('0x12')](_0x9c22('0xe'),_0x56a281,_0x3c9f3f[_0x9c22('0x12')][_0x9c22('0x14')]);return _0xad8255(_0x3c9f3f['error'][_0x9c22('0x14')]);}else{logger[_0x9c22('0xd')](_0x9c22('0xe'),_0x56a281,_0x9c22('0x15'));_0xad8255(_0x3c9f3f['result'][_0x9c22('0x14')]);}})['catch'](function(_0x35ac75){logger[_0x9c22('0x12')](_0x9c22('0xe'),_0x56a281,_0x35ac75);_0x59fbc7(_0x35ac75);});});}exports['CreateChatQueueReport']=function(_0x4f0c1a){var _0x50e94e=this;return new Promise(function(_0x1fb44f,_0x4dc03b){return db[_0x9c22('0x16')][_0x9c22('0x17')](_0x4f0c1a[_0x9c22('0x18')],{'raw':_0x4f0c1a[_0x9c22('0x19')]?_0x4f0c1a[_0x9c22('0x19')][_0x9c22('0x1a')]===undefined?!![]:![]:!![]})[_0x9c22('0xc')](function(_0x120d56){logger[_0x9c22('0xd')]('CreateChatQueueReport',_0x4f0c1a);logger[_0x9c22('0xf')](_0x9c22('0x1b'),_0x4f0c1a,JSON[_0x9c22('0x11')](_0x120d56));_0x1fb44f(_0x120d56);})[_0x9c22('0x1c')](function(_0x134fcb){logger[_0x9c22('0x12')](_0x9c22('0x1b'),_0x134fcb[_0x9c22('0x14')],_0x4f0c1a);_0x4dc03b(_0x50e94e[_0x9c22('0x12')](0x1f4,_0x134fcb[_0x9c22('0x14')]));});});};exports[_0x9c22('0x1d')]=function(_0x136575){var _0x4a1cc3=this;return new Promise(function(_0x1dbb8e,_0x5911db){return db[_0x9c22('0x16')]['update'](_0x136575[_0x9c22('0x18')],{'raw':_0x136575[_0x9c22('0x19')]?_0x136575[_0x9c22('0x19')][_0x9c22('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x136575[_0x9c22('0x19')]?_0x136575[_0x9c22('0x19')]['where']||null:null,'attributes':_0x136575[_0x9c22('0x19')]?_0x136575['options'][_0x9c22('0x1e')]||null:null,'limit':_0x136575[_0x9c22('0x19')]?_0x136575[_0x9c22('0x19')][_0x9c22('0x1f')]||null:null})[_0x9c22('0xc')](function(_0x59b4e9){logger['info'](_0x9c22('0x1d'),_0x136575);logger[_0x9c22('0xf')](_0x9c22('0x1d'),_0x136575,JSON['stringify'](_0x59b4e9));_0x1dbb8e(_0x59b4e9);})[_0x9c22('0x1c')](function(_0x1be455){logger[_0x9c22('0x12')](_0x9c22('0x1d'),_0x1be455['message'],_0x136575);_0x5911db(_0x4a1cc3['error'](0x1f4,_0x1be455[_0x9c22('0x14')]));});});};
\ No newline at end of file
index 2e7cf4f..18bf67b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc72a=['Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','create','put','update','delete','/:id','destroy','express'];(function(_0x1ef734,_0x57c70c){var _0x4ba9a5=function(_0x2c61ac){while(--_0x2c61ac){_0x1ef734['push'](_0x1ef734['shift']());}};_0x4ba9a5(++_0x57c70c);}(_0xc72a,0xcf));var _0xac72=function(_0x3bf925,_0x4dd8e4){_0x3bf925=_0x3bf925-0x0;var _0x2128a1=_0xc72a[_0x3bf925];return _0x2128a1;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xac72('0x0'));var router=express[_0xac72('0x1')]();var fs_extra=require(_0xac72('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xac72('0x3'));var config=require(_0xac72('0x4'));var controller=require('./chatQueueReport.controller');router[_0xac72('0x5')]('/',auth[_0xac72('0x6')](),controller['index']);router[_0xac72('0x5')](_0xac72('0x7'),auth[_0xac72('0x6')](),controller[_0xac72('0x8')]);router[_0xac72('0x5')]('/:id',auth[_0xac72('0x6')](),controller[_0xac72('0x9')]);router['post']('/',auth[_0xac72('0x6')](),controller[_0xac72('0xa')]);router[_0xac72('0xb')]('/:id',auth[_0xac72('0x6')](),controller[_0xac72('0xc')]);router[_0xac72('0xd')](_0xac72('0xe'),auth[_0xac72('0x6')](),controller[_0xac72('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x1040=['index','describe','show','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x204b09,_0x58b9a8){var _0x2b7238=function(_0xadd03a){while(--_0xadd03a){_0x204b09['push'](_0x204b09['shift']());}};_0x2b7238(++_0x58b9a8);}(_0x1040,0x16f));var _0x0104=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0x1040[_0x386c3e];return _0x4b8e13;};'use strict';var multer=require(_0x0104('0x0'));var util=require(_0x0104('0x1'));var path=require(_0x0104('0x2'));var timeout=require(_0x0104('0x3'));var express=require(_0x0104('0x4'));var router=express[_0x0104('0x5')]();var fs_extra=require(_0x0104('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0104('0x7'));var config=require(_0x0104('0x8'));var controller=require('./chatQueueReport.controller');router[_0x0104('0x9')]('/',auth[_0x0104('0xa')](),controller[_0x0104('0xb')]);router[_0x0104('0x9')]('/describe',auth[_0x0104('0xa')](),controller[_0x0104('0xc')]);router[_0x0104('0x9')]('/:id',auth[_0x0104('0xa')](),controller[_0x0104('0xd')]);router[_0x0104('0xe')]('/',auth['isAuthenticated'](),controller[_0x0104('0xf')]);router[_0x0104('0x10')](_0x0104('0x11'),auth['isAuthenticated'](),controller[_0x0104('0x12')]);router[_0x0104('0x13')](_0x0104('0x11'),auth[_0x0104('0xa')](),controller['destroy']);module[_0x0104('0x14')]=router;
\ No newline at end of file
index 36ae5aa..6672271 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x538e8e,_0x3d57f6){var _0x21252a=function(_0x321171){while(--_0x321171){_0x538e8e['push'](_0x538e8e['shift']());}};_0x21252a(++_0x3d57f6);}(_0x70e0,0x17b));var _0x070e=function(_0x538cc5,_0x3716f7){_0x538cc5=_0x538cc5-0x0;var _0x28239=_0x70e0[_0x538cc5];return _0x28239;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
+var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x323d9e,_0x329440){var _0x2249e7=function(_0x3ec72f){while(--_0x3ec72f){_0x323d9e['push'](_0x323d9e['shift']());}};_0x2249e7(++_0x329440);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5e48d9,_0x3a84f9){_0x5e48d9=_0x5e48d9-0x0;var _0x2b4922=_0xf4eb[_0x5e48d9];return _0x2b4922;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
index d2ea4d1..12e9d35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x790c=['length','hasOwnProperty','order','sort','filter','merge','VIRTUAL','where','include','rows','catch','show','params','includeAll','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','ChatTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes'];(function(_0x280c6a,_0x2fc1e9){var _0x4bfe09=function(_0x1a8334){while(--_0x1a8334){_0x280c6a['push'](_0x280c6a['shift']());}};_0x4bfe09(++_0x2fc1e9);}(_0x790c,0xad));var _0xc790=function(_0x1e8a30,_0x9d4596){_0x1e8a30=_0x1e8a30-0x0;var _0x1f8b30=_0x790c[_0x1e8a30];return _0x1f8b30;};'use strict';var emlformat=require(_0xc790('0x0'));var rimraf=require(_0xc790('0x1'));var zipdir=require(_0xc790('0x2'));var jsonpatch=require(_0xc790('0x3'));var rp=require(_0xc790('0x4'));var moment=require(_0xc790('0x5'));var BPromise=require(_0xc790('0x6'));var Mustache=require(_0xc790('0x7'));var util=require(_0xc790('0x8'));var path=require(_0xc790('0x9'));var sox=require('sox');var csv=require(_0xc790('0xa'));var ejs=require(_0xc790('0xb'));var fs=require('fs');var fs_extra=require(_0xc790('0xc'));var _=require(_0xc790('0xd'));var squel=require(_0xc790('0xe'));var crypto=require(_0xc790('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc790('0xa'));var querystring=require(_0xc790('0x10'));var Papa=require('papaparse');var Redis=require(_0xc790('0x11'));var authService=require(_0xc790('0x12'));var qs=require(_0xc790('0x13'));var as=require(_0xc790('0x14'));var hardwareService=require(_0xc790('0x15'));var logger=require(_0xc790('0x16'))('api');var utils=require(_0xc790('0x17'));var config=require(_0xc790('0x18'));var licenseUtil=require(_0xc790('0x19'));var db=require(_0xc790('0x1a'))['db'];function respondWithStatusCode(_0x21a159,_0x2733ff){_0x2733ff=_0x2733ff||0xcc;return function(_0x27fada){if(_0x27fada){return _0x21a159[_0xc790('0x1b')](_0x2733ff);}return _0x21a159[_0xc790('0x1c')](_0x2733ff)['end']();};}function respondWithResult(_0xeddc37,_0x31fc5e){_0x31fc5e=_0x31fc5e||0xc8;return function(_0x5f217a){if(_0x5f217a){return _0xeddc37[_0xc790('0x1c')](_0x31fc5e)[_0xc790('0x1d')](_0x5f217a);}};}function respondWithFilteredResult(_0x455928,_0x4fef85){return function(_0x43ce87){if(_0x43ce87){var _0x586912=typeof _0x4fef85[_0xc790('0x1e')]===_0xc790('0x1f')&&typeof _0x4fef85[_0xc790('0x20')]===_0xc790('0x1f');var _0x3281f7=_0x43ce87[_0xc790('0x21')];var _0x1ab208=_0x586912?0x0:_0x4fef85['offset'];var _0x23f1d1=_0x586912?_0x43ce87[_0xc790('0x21')]:_0x4fef85[_0xc790('0x1e')]+_0x4fef85['limit'];var _0x6cced5;if(_0x23f1d1>=_0x3281f7){_0x23f1d1=_0x3281f7;_0x6cced5=0xc8;}else{_0x6cced5=0xce;}_0x455928[_0xc790('0x1c')](_0x6cced5);return _0x455928[_0xc790('0x22')]('Content-Range',_0x1ab208+'-'+_0x23f1d1+'/'+_0x3281f7)[_0xc790('0x1d')](_0x43ce87);}return null;};}function patchUpdates(_0x5d8107){return function(_0x4b5b76){try{jsonpatch[_0xc790('0x23')](_0x4b5b76,_0x5d8107,!![]);}catch(_0x1a36b9){return BPromise[_0xc790('0x24')](_0x1a36b9);}return _0x4b5b76[_0xc790('0x25')]();};}function saveUpdates(_0x2da1e3,_0x4c5110){return function(_0x5497d5){if(_0x5497d5){return _0x5497d5[_0xc790('0x26')](_0x2da1e3)[_0xc790('0x27')](function(_0x5915d9){return _0x5915d9;});}return null;};}function removeEntity(_0x37d028,_0x49afc9){return function(_0x1ed864){if(_0x1ed864){return _0x1ed864[_0xc790('0x28')]()[_0xc790('0x27')](function(){_0x37d028[_0xc790('0x1c')](0xcc)[_0xc790('0x29')]();});}};}function handleEntityNotFound(_0x3bee84,_0x107438){return function(_0x152b79){if(!_0x152b79){_0x3bee84['sendStatus'](0x194);}return _0x152b79;};}function handleError(_0x5cbb3d,_0x2961a4){_0x2961a4=_0x2961a4||0x1f4;return function(_0x107dee){logger[_0xc790('0x2a')](_0x107dee[_0xc790('0x2b')]);if(_0x107dee[_0xc790('0x2c')]){delete _0x107dee[_0xc790('0x2c')];}_0x5cbb3d[_0xc790('0x1c')](_0x2961a4)[_0xc790('0x2d')](_0x107dee);};}exports['index']=function(_0x10abdf,_0x350756){var _0x5e928f={},_0x9aa1d8={},_0x31b570={'count':0x0,'rows':[]};var _0x38915c=_[_0xc790('0x2e')](db[_0xc790('0x2f')][_0xc790('0x30')],function(_0x5d0013){return{'name':_0x5d0013[_0xc790('0x31')],'type':_0x5d0013[_0xc790('0x32')]['key']};});_0x9aa1d8[_0xc790('0x33')]=_[_0xc790('0x2e')](_0x38915c,_0xc790('0x2c'));_0x9aa1d8[_0xc790('0x34')]=_[_0xc790('0x35')](_0x10abdf[_0xc790('0x34')]);_0x9aa1d8[_0xc790('0x36')]=_['intersection'](_0x9aa1d8[_0xc790('0x33')],_0x9aa1d8[_0xc790('0x34')]);_0x5e928f['attributes']=_[_0xc790('0x37')](_0x9aa1d8[_0xc790('0x33')],qs['fields'](_0x10abdf['query'][_0xc790('0x38')]));_0x5e928f[_0xc790('0x39')]=_0x5e928f[_0xc790('0x39')][_0xc790('0x3a')]?_0x5e928f['attributes']:_0x9aa1d8[_0xc790('0x33')];if(!_0x10abdf[_0xc790('0x34')][_0xc790('0x3b')]('nolimit')){_0x5e928f[_0xc790('0x20')]=qs[_0xc790('0x20')](_0x10abdf[_0xc790('0x34')][_0xc790('0x20')]);_0x5e928f[_0xc790('0x1e')]=qs[_0xc790('0x1e')](_0x10abdf[_0xc790('0x34')][_0xc790('0x1e')]);}_0x5e928f[_0xc790('0x3c')]=qs['sort'](_0x10abdf['query'][_0xc790('0x3d')]);_0x5e928f['where']=qs[_0xc790('0x36')](_['pick'](_0x10abdf['query'],_0x9aa1d8['filters']),_0x38915c);if(_0x10abdf[_0xc790('0x34')][_0xc790('0x3e')]){_0x5e928f['where']=_[_0xc790('0x3f')](_0x5e928f['where'],{'$or':_[_0xc790('0x2e')](_0x38915c,function(_0x42ba79){if(_0x42ba79[_0xc790('0x32')]!==_0xc790('0x40')){var _0x2a5e6c={};_0x2a5e6c[_0x42ba79[_0xc790('0x2c')]]={'$like':'%'+_0x10abdf[_0xc790('0x34')]['filter']+'%'};return _0x2a5e6c;}})});}_0x5e928f=_[_0xc790('0x3f')]({},_0x5e928f,_0x10abdf['options']);var _0x4cf83e={'where':_0x5e928f[_0xc790('0x41')]};return db[_0xc790('0x2f')][_0xc790('0x21')](_0x4cf83e)[_0xc790('0x27')](function(_0x4a3128){_0x31b570['count']=_0x4a3128;if(_0x10abdf[_0xc790('0x34')]['includeAll']){_0x5e928f[_0xc790('0x42')]=[{'all':!![]}];}return db[_0xc790('0x2f')]['findAll'](_0x5e928f);})[_0xc790('0x27')](function(_0x5e7926){_0x31b570[_0xc790('0x43')]=_0x5e7926;return _0x31b570;})[_0xc790('0x27')](respondWithFilteredResult(_0x350756,_0x5e928f))[_0xc790('0x44')](handleError(_0x350756,null));};exports[_0xc790('0x45')]=function(_0x4bfa06,_0x544d29){var _0x2d38c7={'raw':!![],'where':{'id':_0x4bfa06[_0xc790('0x46')]['id']}},_0x1866e7={};_0x1866e7[_0xc790('0x33')]=_['keys'](db[_0xc790('0x2f')][_0xc790('0x30')]);_0x1866e7[_0xc790('0x34')]=_['keys'](_0x4bfa06[_0xc790('0x34')]);_0x1866e7[_0xc790('0x36')]=_[_0xc790('0x37')](_0x1866e7['model'],_0x1866e7[_0xc790('0x34')]);_0x2d38c7[_0xc790('0x39')]=_[_0xc790('0x37')](_0x1866e7[_0xc790('0x33')],qs[_0xc790('0x38')](_0x4bfa06[_0xc790('0x34')]['fields']));_0x2d38c7[_0xc790('0x39')]=_0x2d38c7[_0xc790('0x39')][_0xc790('0x3a')]?_0x2d38c7[_0xc790('0x39')]:_0x1866e7[_0xc790('0x33')];if(_0x4bfa06['query'][_0xc790('0x47')]){_0x2d38c7[_0xc790('0x42')]=[{'all':!![]}];}_0x2d38c7=_['merge']({},_0x2d38c7,_0x4bfa06[_0xc790('0x48')]);return db[_0xc790('0x2f')][_0xc790('0x49')](_0x2d38c7)[_0xc790('0x27')](handleEntityNotFound(_0x544d29,null))[_0xc790('0x27')](respondWithResult(_0x544d29,null))['catch'](handleError(_0x544d29,null));};exports['create']=function(_0x4ce4cc,_0x462bc3){return db[_0xc790('0x2f')][_0xc790('0x4a')](_0x4ce4cc[_0xc790('0x4b')],{})['then'](respondWithResult(_0x462bc3,0xc9))[_0xc790('0x44')](handleError(_0x462bc3,null));};exports['update']=function(_0x36907f,_0x5cf0ee){if(_0x36907f[_0xc790('0x4b')]['id']){delete _0x36907f[_0xc790('0x4b')]['id'];}return db['ChatTransferReport'][_0xc790('0x49')]({'where':{'id':_0x36907f[_0xc790('0x46')]['id']}})[_0xc790('0x27')](handleEntityNotFound(_0x5cf0ee,null))['then'](saveUpdates(_0x36907f[_0xc790('0x4b')],null))[_0xc790('0x27')](respondWithResult(_0x5cf0ee,null))[_0xc790('0x44')](handleError(_0x5cf0ee,null));};exports[_0xc790('0x28')]=function(_0x3ac9aa,_0x40acb5){return db[_0xc790('0x2f')][_0xc790('0x49')]({'where':{'id':_0x3ac9aa[_0xc790('0x46')]['id']}})[_0xc790('0x27')](handleEntityNotFound(_0x40acb5,null))[_0xc790('0x27')](removeEntity(_0x40acb5,null))[_0xc790('0x44')](handleError(_0x40acb5,null));};exports[_0xc790('0x4c')]=function(_0x286083,_0x27df10){return db[_0xc790('0x2f')]['describe']()[_0xc790('0x27')](respondWithResult(_0x27df10,null))[_0xc790('0x44')](handleError(_0x27df10,null));};
\ No newline at end of file
+var _0x552c=['create','body','params','describe','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','jsforce','desk.js','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','send','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','merge','type','options','include','rows','catch','show','includeAll','find'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x552c,0x114));var _0xc552=function(_0x1b39eb,_0xe33080){_0x1b39eb=_0x1b39eb-0x0;var _0x4fe80e=_0x552c[_0x1b39eb];return _0x4fe80e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc552('0x0'));var zipdir=require(_0xc552('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc552('0x2'));var BPromise=require(_0xc552('0x3'));var Mustache=require(_0xc552('0x4'));var util=require(_0xc552('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xc552('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc552('0x7'));var _=require(_0xc552('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc552('0x9'));var deskjs=require(_0xc552('0xa'));var toCsv=require(_0xc552('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc552('0xb'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc552('0xc'));var logger=require(_0xc552('0xd'))(_0xc552('0xe'));var utils=require(_0xc552('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0xc552('0x10'));var db=require(_0xc552('0x11'))['db'];function respondWithStatusCode(_0x115477,_0x3be0cc){_0x3be0cc=_0x3be0cc||0xcc;return function(_0x103caa){if(_0x103caa){return _0x115477[_0xc552('0x12')](_0x3be0cc);}return _0x115477[_0xc552('0x13')](_0x3be0cc)[_0xc552('0x14')]();};}function respondWithResult(_0x4afc33,_0xe2bf6b){_0xe2bf6b=_0xe2bf6b||0xc8;return function(_0x38dd6d){if(_0x38dd6d){return _0x4afc33['status'](_0xe2bf6b)[_0xc552('0x15')](_0x38dd6d);}};}function respondWithFilteredResult(_0x4331b1,_0x49e101){return function(_0x1f8a1d){if(_0x1f8a1d){var _0x1aa0c8=typeof _0x49e101['offset']==='undefined'&&typeof _0x49e101[_0xc552('0x16')]===_0xc552('0x17');var _0x3c3f81=_0x1f8a1d[_0xc552('0x18')];var _0x597d4a=_0x1aa0c8?0x0:_0x49e101['offset'];var _0x498054=_0x1aa0c8?_0x1f8a1d[_0xc552('0x18')]:_0x49e101['offset']+_0x49e101[_0xc552('0x16')];var _0x3ec885;if(_0x498054>=_0x3c3f81){_0x498054=_0x3c3f81;_0x3ec885=0xc8;}else{_0x3ec885=0xce;}_0x4331b1['status'](_0x3ec885);return _0x4331b1[_0xc552('0x19')](_0xc552('0x1a'),_0x597d4a+'-'+_0x498054+'/'+_0x3c3f81)[_0xc552('0x15')](_0x1f8a1d);}return null;};}function patchUpdates(_0x447c48){return function(_0x117560){try{jsonpatch['apply'](_0x117560,_0x447c48,!![]);}catch(_0x23323a){return BPromise[_0xc552('0x1b')](_0x23323a);}return _0x117560[_0xc552('0x1c')]();};}function saveUpdates(_0x292dae,_0xe59879){return function(_0x3ac16e){if(_0x3ac16e){return _0x3ac16e[_0xc552('0x1d')](_0x292dae)[_0xc552('0x1e')](function(_0x5c5f37){return _0x5c5f37;});}return null;};}function removeEntity(_0x16ebd3,_0x9135a1){return function(_0x1d5835){if(_0x1d5835){return _0x1d5835[_0xc552('0x1f')]()[_0xc552('0x1e')](function(){_0x16ebd3[_0xc552('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c7cb3,_0x3fcb1a){return function(_0xb506a2){if(!_0xb506a2){_0x1c7cb3['sendStatus'](0x194);}return _0xb506a2;};}function handleError(_0x1420dc,_0x594281){_0x594281=_0x594281||0x1f4;return function(_0x4529a5){logger[_0xc552('0x20')](_0x4529a5['stack']);if(_0x4529a5['name']){delete _0x4529a5['name'];}_0x1420dc[_0xc552('0x13')](_0x594281)[_0xc552('0x21')](_0x4529a5);};}exports[_0xc552('0x22')]=function(_0x39a07c,_0x4f43c9){var _0x331006={},_0x191aba={},_0x2fde05={'count':0x0,'rows':[]};var _0x2a554=_[_0xc552('0x23')](db[_0xc552('0x24')][_0xc552('0x25')],function(_0x23f9b9){return{'name':_0x23f9b9[_0xc552('0x26')],'type':_0x23f9b9['type'][_0xc552('0x27')]};});_0x191aba[_0xc552('0x28')]=_[_0xc552('0x23')](_0x2a554,_0xc552('0x29'));_0x191aba[_0xc552('0x2a')]=_[_0xc552('0x2b')](_0x39a07c[_0xc552('0x2a')]);_0x191aba[_0xc552('0x2c')]=_[_0xc552('0x2d')](_0x191aba[_0xc552('0x28')],_0x191aba['query']);_0x331006[_0xc552('0x2e')]=_['intersection'](_0x191aba['model'],qs[_0xc552('0x2f')](_0x39a07c[_0xc552('0x2a')][_0xc552('0x2f')]));_0x331006['attributes']=_0x331006[_0xc552('0x2e')][_0xc552('0x30')]?_0x331006[_0xc552('0x2e')]:_0x191aba['model'];if(!_0x39a07c[_0xc552('0x2a')][_0xc552('0x31')](_0xc552('0x32'))){_0x331006[_0xc552('0x16')]=qs[_0xc552('0x16')](_0x39a07c[_0xc552('0x2a')][_0xc552('0x16')]);_0x331006[_0xc552('0x33')]=qs['offset'](_0x39a07c[_0xc552('0x2a')]['offset']);}_0x331006['order']=qs[_0xc552('0x34')](_0x39a07c[_0xc552('0x2a')][_0xc552('0x34')]);_0x331006[_0xc552('0x35')]=qs[_0xc552('0x2c')](_[_0xc552('0x36')](_0x39a07c[_0xc552('0x2a')],_0x191aba['filters']),_0x2a554);if(_0x39a07c[_0xc552('0x2a')]['filter']){_0x331006[_0xc552('0x35')]=_[_0xc552('0x37')](_0x331006[_0xc552('0x35')],{'$or':_[_0xc552('0x23')](_0x2a554,function(_0xc3c9f1){if(_0xc3c9f1[_0xc552('0x38')]!=='VIRTUAL'){var _0x360f23={};_0x360f23[_0xc3c9f1['name']]={'$like':'%'+_0x39a07c['query']['filter']+'%'};return _0x360f23;}})});}_0x331006=_[_0xc552('0x37')]({},_0x331006,_0x39a07c[_0xc552('0x39')]);var _0xd8c1d9={'where':_0x331006[_0xc552('0x35')]};return db['ChatTransferReport'][_0xc552('0x18')](_0xd8c1d9)[_0xc552('0x1e')](function(_0x45e890){_0x2fde05[_0xc552('0x18')]=_0x45e890;if(_0x39a07c[_0xc552('0x2a')]['includeAll']){_0x331006[_0xc552('0x3a')]=[{'all':!![]}];}return db[_0xc552('0x24')]['findAll'](_0x331006);})[_0xc552('0x1e')](function(_0x15321a){_0x2fde05[_0xc552('0x3b')]=_0x15321a;return _0x2fde05;})[_0xc552('0x1e')](respondWithFilteredResult(_0x4f43c9,_0x331006))[_0xc552('0x3c')](handleError(_0x4f43c9,null));};exports[_0xc552('0x3d')]=function(_0x33657f,_0x55c1fc){var _0x1e8eb5={'raw':!![],'where':{'id':_0x33657f['params']['id']}},_0x124f7a={};_0x124f7a[_0xc552('0x28')]=_[_0xc552('0x2b')](db[_0xc552('0x24')][_0xc552('0x25')]);_0x124f7a[_0xc552('0x2a')]=_[_0xc552('0x2b')](_0x33657f[_0xc552('0x2a')]);_0x124f7a[_0xc552('0x2c')]=_['intersection'](_0x124f7a[_0xc552('0x28')],_0x124f7a[_0xc552('0x2a')]);_0x1e8eb5['attributes']=_[_0xc552('0x2d')](_0x124f7a[_0xc552('0x28')],qs[_0xc552('0x2f')](_0x33657f[_0xc552('0x2a')][_0xc552('0x2f')]));_0x1e8eb5[_0xc552('0x2e')]=_0x1e8eb5['attributes']['length']?_0x1e8eb5[_0xc552('0x2e')]:_0x124f7a[_0xc552('0x28')];if(_0x33657f['query'][_0xc552('0x3e')]){_0x1e8eb5[_0xc552('0x3a')]=[{'all':!![]}];}_0x1e8eb5=_[_0xc552('0x37')]({},_0x1e8eb5,_0x33657f['options']);return db[_0xc552('0x24')][_0xc552('0x3f')](_0x1e8eb5)['then'](handleEntityNotFound(_0x55c1fc,null))[_0xc552('0x1e')](respondWithResult(_0x55c1fc,null))[_0xc552('0x3c')](handleError(_0x55c1fc,null));};exports[_0xc552('0x40')]=function(_0x351424,_0xee72c3){return db['ChatTransferReport'][_0xc552('0x40')](_0x351424['body'],{})['then'](respondWithResult(_0xee72c3,0xc9))[_0xc552('0x3c')](handleError(_0xee72c3,null));};exports[_0xc552('0x1d')]=function(_0x4356bf,_0x5048f8){if(_0x4356bf[_0xc552('0x41')]['id']){delete _0x4356bf[_0xc552('0x41')]['id'];}return db['ChatTransferReport'][_0xc552('0x3f')]({'where':{'id':_0x4356bf[_0xc552('0x42')]['id']}})['then'](handleEntityNotFound(_0x5048f8,null))[_0xc552('0x1e')](saveUpdates(_0x4356bf[_0xc552('0x41')],null))[_0xc552('0x1e')](respondWithResult(_0x5048f8,null))[_0xc552('0x3c')](handleError(_0x5048f8,null));};exports[_0xc552('0x1f')]=function(_0x4300e8,_0x2504c1){return db[_0xc552('0x24')][_0xc552('0x3f')]({'where':{'id':_0x4300e8[_0xc552('0x42')]['id']}})[_0xc552('0x1e')](handleEntityNotFound(_0x2504c1,null))['then'](removeEntity(_0x2504c1,null))[_0xc552('0x3c')](handleError(_0x2504c1,null));};exports[_0xc552('0x43')]=function(_0x17ea53,_0x1ea96e){return db[_0xc552('0x24')]['describe']()[_0xc552('0x1e')](respondWithResult(_0x1ea96e,null))['catch'](handleError(_0x1ea96e,null));};
\ No newline at end of file
index eb52204..26d0e78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x95a6=['uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','./chatTransferReport.attributes','exports','define'];(function(_0x34e850,_0x3fedd6){var _0x282de1=function(_0x424539){while(--_0x424539){_0x34e850['push'](_0x34e850['shift']());}};_0x282de1(++_0x3fedd6);}(_0x95a6,0x18d));var _0x695a=function(_0xb5cd0,_0x51a333){_0xb5cd0=_0xb5cd0-0x0;var _0x2253cb=_0x95a6[_0xb5cd0];return _0x2253cb;};'use strict';var _=require(_0x695a('0x0'));var util=require(_0x695a('0x1'));var logger=require(_0x695a('0x2'))(_0x695a('0x3'));var moment=require('moment');var BPromise=require(_0x695a('0x4'));var rp=require(_0x695a('0x5'));var fs=require('fs');var path=require(_0x695a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x695a('0x7'));module[_0x695a('0x8')]=function(_0x1f0d90,_0x39d199){return _0x1f0d90[_0x695a('0x9')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x695a('0xa'),'fields':[_0x695a('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe8a2=['define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xe8a2,0x121));var _0x2e8a=function(_0x4f8d8a,_0x37bd37){_0x4f8d8a=_0x4f8d8a-0x0;var _0x5cf5cd=_0xe8a2[_0x4f8d8a];return _0x5cf5cd;};'use strict';var _=require(_0x2e8a('0x0'));var util=require(_0x2e8a('0x1'));var logger=require(_0x2e8a('0x2'))(_0x2e8a('0x3'));var moment=require('moment');var BPromise=require(_0x2e8a('0x4'));var rp=require(_0x2e8a('0x5'));var fs=require('fs');var path=require(_0x2e8a('0x6'));var rimraf=require(_0x2e8a('0x7'));var config=require(_0x2e8a('0x8'));var attributes=require(_0x2e8a('0x9'));module['exports']=function(_0x4a4276,_0x292e89){return _0x4a4276[_0x2e8a('0xa')](_0x2e8a('0xb'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x2e8a('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index d0de835..cf5f15f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc207=['debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatTransferReport,\x20%s,\x20%s','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','request\x20sent'];(function(_0x5bd9de,_0x48f971){var _0x4d6926=function(_0xc2c465){while(--_0xc2c465){_0x5bd9de['push'](_0x5bd9de['shift']());}};_0x4d6926(++_0x48f971);}(_0xc207,0x182));var _0x7c20=function(_0x414901,_0x20ee6a){_0x414901=_0x414901-0x0;var _0x2cae72=_0xc207[_0x414901];return _0x2cae72;};'use strict';var _=require(_0x7c20('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7c20('0x1'));var rs=require(_0x7c20('0x2'));var fs=require('fs');var Redis=require(_0x7c20('0x3'));var db=require(_0x7c20('0x4'))['db'];var utils=require(_0x7c20('0x5'));var logger=require(_0x7c20('0x6'))('rpc');var config=require(_0x7c20('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7c20('0x8')][_0x7c20('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1afa18,_0x3b5cd9,_0x236dfe){return new BPromise(function(_0x1d2e9e,_0xd671e8){return client[_0x7c20('0xa')](_0x1afa18,_0x236dfe)[_0x7c20('0xb')](function(_0x53bb80){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x3b5cd9,_0x7c20('0xc'));logger[_0x7c20('0xd')](_0x7c20('0xe'),_0x3b5cd9,_0x7c20('0xc'),JSON[_0x7c20('0xf')](_0x53bb80));if(_0x53bb80['error']){if(_0x53bb80[_0x7c20('0x10')][_0x7c20('0x11')]===0x1f4){logger[_0x7c20('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x3b5cd9,_0x53bb80['error'][_0x7c20('0x12')]);return _0xd671e8(_0x53bb80[_0x7c20('0x10')]['message']);}logger[_0x7c20('0x10')](_0x7c20('0x13'),_0x3b5cd9,_0x53bb80['error'][_0x7c20('0x12')]);return _0x1d2e9e(_0x53bb80[_0x7c20('0x10')][_0x7c20('0x12')]);}else{logger['info'](_0x7c20('0x13'),_0x3b5cd9,_0x7c20('0xc'));_0x1d2e9e(_0x53bb80[_0x7c20('0x14')]['message']);}})['catch'](function(_0x12f7ee){logger[_0x7c20('0x10')](_0x7c20('0x13'),_0x3b5cd9,_0x12f7ee);_0xd671e8(_0x12f7ee);});});}
\ No newline at end of file
+var _0x88b5=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird'];(function(_0x2deee9,_0x58b00f){var _0x51a55e=function(_0x4de56a){while(--_0x4de56a){_0x2deee9['push'](_0x2deee9['shift']());}};_0x51a55e(++_0x58b00f);}(_0x88b5,0xa5));var _0x588b=function(_0x45906b,_0xc2c7ae){_0x45906b=_0x45906b-0x0;var _0x8fc176=_0x88b5[_0x45906b];return _0x8fc176;};'use strict';var _=require('lodash');var util=require(_0x588b('0x0'));var moment=require(_0x588b('0x1'));var BPromise=require(_0x588b('0x2'));var rs=require(_0x588b('0x3'));var fs=require('fs');var Redis=require(_0x588b('0x4'));var db=require(_0x588b('0x5'))['db'];var utils=require(_0x588b('0x6'));var logger=require(_0x588b('0x7'))(_0x588b('0x8'));var config=require('../../config/environment');var jayson=require(_0x588b('0x9'));var client=jayson[_0x588b('0xa')][_0x588b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x186f25,_0x182668,_0x567766){return new BPromise(function(_0x45e1a0,_0x312fd4){return client[_0x588b('0xc')](_0x186f25,_0x567766)[_0x588b('0xd')](function(_0x451698){logger[_0x588b('0xe')](_0x588b('0xf'),_0x182668,'request\x20sent');logger[_0x588b('0x10')](_0x588b('0x11'),_0x182668,_0x588b('0x12'),JSON[_0x588b('0x13')](_0x451698));if(_0x451698[_0x588b('0x14')]){if(_0x451698['error'][_0x588b('0x15')]===0x1f4){logger[_0x588b('0x14')](_0x588b('0xf'),_0x182668,_0x451698['error'][_0x588b('0x16')]);return _0x312fd4(_0x451698[_0x588b('0x14')]['message']);}logger[_0x588b('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0x182668,_0x451698[_0x588b('0x14')][_0x588b('0x16')]);return _0x45e1a0(_0x451698[_0x588b('0x14')][_0x588b('0x16')]);}else{logger[_0x588b('0xe')](_0x588b('0xf'),_0x182668,_0x588b('0x12'));_0x45e1a0(_0x451698['result']['message']);}})[_0x588b('0x17')](function(_0x34238d){logger[_0x588b('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0x182668,_0x34238d);_0x312fd4(_0x34238d);});});}
\ No newline at end of file
index 084e9f7..57e8d76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab44=['../../components/auth/service','./chatTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xab44,0xd6));var _0x4ab4=function(_0x384157,_0x50bf56){_0x384157=_0x384157-0x0;var _0x3ef36a=_0xab44[_0x384157];return _0x3ef36a;};'use strict';var multer=require(_0x4ab4('0x0'));var util=require(_0x4ab4('0x1'));var path=require('path');var timeout=require(_0x4ab4('0x2'));var express=require(_0x4ab4('0x3'));var router=express[_0x4ab4('0x4')]();var fs_extra=require(_0x4ab4('0x5'));var auth=require(_0x4ab4('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4ab4('0x7'));router[_0x4ab4('0x8')]('/',auth[_0x4ab4('0x9')](),controller['index']);router['get'](_0x4ab4('0xa'),auth[_0x4ab4('0x9')](),controller[_0x4ab4('0xb')]);router['get'](_0x4ab4('0xc'),auth[_0x4ab4('0x9')](),controller[_0x4ab4('0xd')]);router[_0x4ab4('0xe')]('/',auth[_0x4ab4('0x9')](),controller[_0x4ab4('0xf')]);router[_0x4ab4('0x10')]('/:id',auth[_0x4ab4('0x9')](),controller['update']);router[_0x4ab4('0x11')]('/:id',auth[_0x4ab4('0x9')](),controller[_0x4ab4('0x12')]);module[_0x4ab4('0x13')]=router;
\ No newline at end of file
+var _0xe7e2=['isAuthenticated','index','/describe','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x493ef6,_0x31f63d){var _0x2c56d4=function(_0x1c0d47){while(--_0x1c0d47){_0x493ef6['push'](_0x493ef6['shift']());}};_0x2c56d4(++_0x31f63d);}(_0xe7e2,0x1c3));var _0x2e7e=function(_0x7b5f9a,_0x138869){_0x7b5f9a=_0x7b5f9a-0x0;var _0x45670f=_0xe7e2[_0x7b5f9a];return _0x45670f;};'use strict';var multer=require('multer');var util=require(_0x2e7e('0x0'));var path=require(_0x2e7e('0x1'));var timeout=require(_0x2e7e('0x2'));var express=require(_0x2e7e('0x3'));var router=express[_0x2e7e('0x4')]();var fs_extra=require(_0x2e7e('0x5'));var auth=require(_0x2e7e('0x6'));var interaction=require(_0x2e7e('0x7'));var config=require(_0x2e7e('0x8'));var controller=require(_0x2e7e('0x9'));router[_0x2e7e('0xa')]('/',auth[_0x2e7e('0xb')](),controller[_0x2e7e('0xc')]);router[_0x2e7e('0xa')](_0x2e7e('0xd'),auth[_0x2e7e('0xb')](),controller['describe']);router[_0x2e7e('0xa')](_0x2e7e('0xe'),auth[_0x2e7e('0xb')](),controller[_0x2e7e('0xf')]);router[_0x2e7e('0x10')]('/',auth[_0x2e7e('0xb')](),controller[_0x2e7e('0x11')]);router[_0x2e7e('0x12')](_0x2e7e('0xe'),auth[_0x2e7e('0xb')](),controller['update']);router[_0x2e7e('0x13')](_0x2e7e('0xe'),auth[_0x2e7e('0xb')](),controller[_0x2e7e('0x14')]);module[_0x2e7e('0x15')]=router;
\ No newline at end of file
index a70c134..c47feaf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba6e=['Comments','Leave\x20your\x20comments','offlineForm','generate','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','exports','STRING','address','email','Agent','#011F6A','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','TEXT','input','name','text','getDataValue','onlineForm','parse','setDataValue','stringify'];(function(_0x1b4680,_0x18ec5d){var _0x327ceb=function(_0x446ae1){while(--_0x446ae1){_0x1b4680['push'](_0x1b4680['shift']());}};_0x327ceb(++_0x18ec5d);}(_0xba6e,0x10c));var _0xeba6=function(_0x5df711,_0x3f2a31){_0x5df711=_0x5df711-0x0;var _0x24a716=_0xba6e[_0x5df711];return _0x24a716;};'use strict';var Sequelize=require('sequelize');var rs=require(_0xeba6('0x0'));module[_0xeba6('0x1')]={'name':{'type':Sequelize[_0xeba6('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0xeba6('0x2')],'allowNull':![],'unique':_0xeba6('0x3')},'description':{'type':Sequelize[_0xeba6('0x2')]},'mapKey':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0xeba6('0x2')],'allowNull':![],'defaultValue':_0xeba6('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xeba6('0x2')],'allowNull':![],'defaultValue':_0xeba6('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xeba6('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xeba6('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xeba6('0x2')]},'animation':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xeba6('0x9')](_0xeba6('0xa'),_0xeba6('0xb')),'defaultValue':_0xeba6('0xa')},'header_online':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0xc')},'start_chat_button':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0xd')},'offline_chat_button':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0xe')},'header_offline':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xeba6('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x10')},'defaultWhiteLabel':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x12')},'noteTitle':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x13')},'placeholderMessage':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x14')},'closingMessage':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x15')},'closingMessageButton':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xeba6('0x16')},'conditionAgreement':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM']('star','thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xeba6('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xeba6('0x17')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xeba6('0x18'),'variable':null,'config':{'placeholder':_0xeba6('0x19'),'type':_0xeba6('0x1a'),'required':!![]},'props':{'title':_0xeba6('0x19'),'helpText':''}},{'type':_0xeba6('0x18'),'props':{'title':_0xeba6('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xeba6('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xeba6('0x1b')](_0xeba6('0x1c'))?JSON[_0xeba6('0x1d')](this[_0xeba6('0x1b')](_0xeba6('0x1c'))):{};},'set':function(_0x292b4e){return this[_0xeba6('0x1e')](_0xeba6('0x1c'),JSON['stringify'](_0x292b4e));}},'offlineForm':{'type':Sequelize[_0xeba6('0x17')],'defaultValue':function(){return JSON[_0xeba6('0x1f')]({'items':[{'type':'input','props':{'title':_0xeba6('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0xeba6('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0xeba6('0x20')},'props':{'title':'Comments','helpText':_0xeba6('0x21')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0xeba6('0x22'))?JSON['parse'](this[_0xeba6('0x1b')](_0xeba6('0x22'))):{};},'set':function(_0x314b9e){return this[_0xeba6('0x1e')](_0xeba6('0x22'),JSON[_0xeba6('0x1f')](_0x314b9e));}},'token':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':function(){return rs[_0xeba6('0x23')]();}},'autoclose':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xeba6('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xeba6('0x2')]},'waitingTitle':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x24')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x25')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0xeba6('0x26')},'skipUnmanaged':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x16')},'sendUnmanaged':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xeba6('0x17')],'defaultValue':function(){return _0xeba6('0x27');}},'notificationSound':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xeba6('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0xeba6('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x29')},'verticalAlignment':{'type':Sequelize[_0xeba6('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xeba6('0x2a')},'defaultTitle':{'type':Sequelize[_0xeba6('0x2')]},'customerAvatar':{'type':Sequelize[_0xeba6('0x17')]},'showCustomerAvatar':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xeba6('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xeba6('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xeba6('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':_0xeba6('0x2b')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xeba6('0x7')],'comment':_0xeba6('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![],'comment':_0xeba6('0x2d'),'set':function(_0x3edc8a){if(!_0x3edc8a)this[_0xeba6('0x1e')](_0xeba6('0x2e'),null);this['setDataValue'](_0xeba6('0x2f'),_0x3edc8a);}},'vidaooEscalation':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xeba6('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xeba6('0x30')},'vidaooNote':{'type':Sequelize[_0xeba6('0x2')],'defaultValue':function(){return _0xeba6('0x31');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xeba6('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xeba6('0x17')]}};
\ No newline at end of file
+var _0x235a=['Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','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}}','bottom_right','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM'];(function(_0x1cdf3d,_0xf691e2){var _0x33a5c1=function(_0xcd3c7a){while(--_0xcd3c7a){_0x1cdf3d['push'](_0x1cdf3d['shift']());}};_0x33a5c1(++_0xf691e2);}(_0x235a,0xfe));var _0xa235=function(_0x2bbd7d,_0x2998d4){_0x2bbd7d=_0x2bbd7d-0x0;var _0x4c8250=_0x235a[_0x2bbd7d];return _0x4c8250;};'use strict';var Sequelize=require(_0xa235('0x0'));var rs=require(_0xa235('0x1'));module[_0xa235('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xa235('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xa235('0x3')]},'mapKey':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0x4')},'mapKeyOffline':{'type':Sequelize[_0xa235('0x3')],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xa235('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xa235('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa235('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xa235('0x3')],'allowNull':![],'defaultValue':_0xa235('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa235('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xa235('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xa235('0x3')]},'animation':{'type':Sequelize[_0xa235('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xa235('0x9')]('rounded','squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xa235('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0xa')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xa235('0xb')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xa235('0xc')},'download_transcript':{'type':Sequelize[_0xa235('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xa235('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0xa235('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xa235('0xe')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xa235('0xf')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa235('0x10')},'noteTitle':{'type':Sequelize[_0xa235('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0x11')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa235('0x12')},'closingMessageButton':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0xb')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xa235('0x13')},'conditionAgreement':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0x14')},'ratingType':{'type':Sequelize[_0xa235('0x9')](_0xa235('0x15'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xa235('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xa235('0xe')],'defaultValue':function(){return JSON[_0xa235('0x16')]({'items':[{'type':_0xa235('0x17'),'variable':null,'config':{'placeholder':_0xa235('0x18'),'type':'text','required':!![]},'props':{'title':_0xa235('0x18'),'helpText':''}},{'type':_0xa235('0x17'),'props':{'title':_0xa235('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xa235('0x4'),'type':_0xa235('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xa235('0x19')](_0xa235('0x1a'))?JSON[_0xa235('0x1b')](this[_0xa235('0x19')](_0xa235('0x1a'))):{};},'set':function(_0x215890){return this[_0xa235('0x1c')](_0xa235('0x1a'),JSON['stringify'](_0x215890));}},'offlineForm':{'type':Sequelize[_0xa235('0xe')],'defaultValue':function(){return JSON[_0xa235('0x16')]({'items':[{'type':'input','props':{'title':_0xa235('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xa235('0x4'),'type':_0xa235('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0xa235('0x1d')},'props':{'title':'Comments','helpText':_0xa235('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0xa235('0x19')](_0xa235('0x1f'))?JSON[_0xa235('0x1b')](this[_0xa235('0x19')](_0xa235('0x1f'))):{};},'set':function(_0x54b151){return this[_0xa235('0x1c')]('offlineForm',JSON[_0xa235('0x16')](_0x54b151));}},'token':{'type':Sequelize[_0xa235('0x3')],'defaultValue':function(){return rs[_0xa235('0x20')]();}},'autoclose':{'type':Sequelize[_0xa235('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xa235('0x3')]},'forwardOffline':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xa235('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xa235('0x21')},'offlineMessageBody':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0x22')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0x23')},'skipUnmanaged':{'type':Sequelize[_0xa235('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xa235('0xe')]},'showAgentAvatar':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xa235('0x24');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xa235('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xa235('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0x25')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0x26')},'defaultTitle':{'type':Sequelize[_0xa235('0x3')]},'customerAvatar':{'type':Sequelize[_0xa235('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xa235('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xa235('0x3')],'allowNull':![],'defaultValue':_0xa235('0x27'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa235('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa235('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xa235('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xa235('0x28')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xa235('0x29'),'set':function(_0x55860e){if(!_0x55860e)this[_0xa235('0x1c')](_0xa235('0x2a'),null);this['setDataValue']('mandatoryDisposition',_0x55860e);}},'vidaooEscalation':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xa235('0x3')],'allowNull':![],'defaultValue':_0xa235('0x2b')},'vidaooNote':{'type':Sequelize[_0xa235('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xa235('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xa235('0xe')]}};
\ No newline at end of file
index 3223d09..dfd540c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91bd=['update','destroy','get','ChatWebsites','stack','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','findOne','hasOwnProperty','nolimit','removeDispositions','ids','CannedAnswer','getAnswers','order','removeAnswers','addLogo','sitepic','addAvatar','addCustomerAvatar','customerAvatar','file','filename','addSystemAvatar','getLogo','root','getLicense','isNil','join','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','existsSync','server/files/images/avatars/','download','getCustomerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','notify','headers','user-agent','getResult','chat','CmContact','ValidationError','difference','updatedAt','createdAt','CompanyId','ListId','from','Sequelize','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','list','applications','orderBy','priority','asc','account','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','format','version','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','push','close','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','server','attachments','offline-chat','openNewInteraction','Attachment','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','mimetype','toPairsIn','mapValues','subjectOffline','Chat','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Owner','fullname','internal','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','interval','getProactiveActions','virtual','License','chatLicenseExceeded','all','some','remote','x-real-ip','connection','remoteAddress','replace','color_button','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','addProactiveActions','ChatProactiveAction','getFields','online','false','items','fromKey','getOfflineMessages','Contact','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatWebsite.socket','register','client','http','request','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save'];(function(_0x44182a,_0xa34b75){var _0x28620e=function(_0x988aa6){while(--_0x988aa6){_0x44182a['push'](_0x44182a['shift']());}};_0x28620e(++_0xa34b75);}(_0x91bd,0xfb));var _0xd91b=function(_0x5b26cb,_0x527ab0){_0x5b26cb=_0x5b26cb-0x0;var _0x563d12=_0x91bd[_0x5b26cb];return _0x563d12;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd91b('0x0'));var zipdir=require(_0xd91b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd91b('0x2'));var moment=require('moment');var BPromise=require(_0xd91b('0x3'));var Mustache=require(_0xd91b('0x4'));var util=require(_0xd91b('0x5'));var path=require(_0xd91b('0x6'));var sox=require(_0xd91b('0x7'));var csv=require(_0xd91b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd91b('0x9'));var crypto=require(_0xd91b('0xa'));var jsforce=require(_0xd91b('0xb'));var deskjs=require(_0xd91b('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd91b('0xd'));var Papa=require(_0xd91b('0xe'));var Redis=require('ioredis');var authService=require(_0xd91b('0xf'));var qs=require(_0xd91b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd91b('0x11'));var logger=require(_0xd91b('0x12'))(_0xd91b('0x13'));var utils=require(_0xd91b('0x14'));var config=require(_0xd91b('0x15'));var licenseUtil=require(_0xd91b('0x16'));var db=require(_0xd91b('0x17'))['db'];config['redis']=_[_0xd91b('0x18')](config['redis'],{'host':_0xd91b('0x19'),'port':0x18eb});var socket=require(_0xd91b('0x1a'))(new Redis(config[_0xd91b('0x1b')]));require(_0xd91b('0x1c'))[_0xd91b('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd91b('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0xd91b('0x1e')]['http']({'port':0x232a});var client9003=jayson[_0xd91b('0x1e')][_0xd91b('0x1f')]({'port':0x232b});var client9001=jayson['client'][_0xd91b('0x1f')]({'port':0x2329});function respondWithRpcPromise(_0x2a8fed,_0x910eea,_0x2a9cec,_0x4c6096){return new BPromise(function(_0xd154f7,_0x1272e9){var _0x149a0f=_0x4c6096||client;return _0x149a0f[_0xd91b('0x20')](_0x2a8fed,_0x2a9cec)[_0xd91b('0x21')](function(_0x2429f7){logger[_0xd91b('0x22')]('ChatWebsite,\x20%s,\x20%s',_0x910eea,'request\x20sent');logger[_0xd91b('0x23')](_0xd91b('0x24'),_0x910eea,_0xd91b('0x25'),JSON[_0xd91b('0x26')](_0x2429f7));if(_0x2429f7['error']){if(_0x2429f7['error']['code']===0x1f4){logger[_0xd91b('0x27')](_0xd91b('0x28'),_0x910eea,_0x2429f7[_0xd91b('0x27')][_0xd91b('0x29')]);return _0x1272e9(_0x2429f7[_0xd91b('0x27')][_0xd91b('0x29')]);}logger[_0xd91b('0x27')](_0xd91b('0x28'),_0x910eea,_0x2429f7[_0xd91b('0x27')][_0xd91b('0x29')]);return _0xd154f7(_0x2429f7[_0xd91b('0x27')][_0xd91b('0x29')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x910eea,_0xd91b('0x25'));_0xd154f7(_0x2429f7[_0xd91b('0x2a')][_0xd91b('0x29')]);}})[_0xd91b('0x2b')](function(_0x41f1ad){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x910eea,_0x41f1ad);_0x1272e9(_0x41f1ad);});});}function respondWithStatusCode(_0x34c536,_0x5c95a3){_0x5c95a3=_0x5c95a3||0xcc;return function(_0x1532bc){if(_0x1532bc){return _0x34c536[_0xd91b('0x2c')](_0x5c95a3);}return _0x34c536[_0xd91b('0x2d')](_0x5c95a3)[_0xd91b('0x2e')]();};}function respondWithResult(_0x2c7d19,_0x4863f5){_0x4863f5=_0x4863f5||0xc8;return function(_0x5a3d60){if(_0x5a3d60){return _0x2c7d19[_0xd91b('0x2d')](_0x4863f5)[_0xd91b('0x2f')](_0x5a3d60);}};}function respondWithFilteredResult(_0x557959,_0x38d649){return function(_0x4852e5){if(_0x4852e5){var _0x16d5bb=typeof _0x38d649['offset']===_0xd91b('0x30')&&typeof _0x38d649[_0xd91b('0x31')]===_0xd91b('0x30');var _0x3f522a=_0x4852e5[_0xd91b('0x32')];var _0x7e958=_0x16d5bb?0x0:_0x38d649[_0xd91b('0x33')];var _0x406acd=_0x16d5bb?_0x4852e5[_0xd91b('0x32')]:_0x38d649['offset']+_0x38d649[_0xd91b('0x31')];var _0xc1f78d;if(_0x406acd>=_0x3f522a){_0x406acd=_0x3f522a;_0xc1f78d=0xc8;}else{_0xc1f78d=0xce;}_0x557959['status'](_0xc1f78d);return _0x557959[_0xd91b('0x34')]('Content-Range',_0x7e958+'-'+_0x406acd+'/'+_0x3f522a)[_0xd91b('0x2f')](_0x4852e5);}return null;};}function patchUpdates(_0x4fefa6){return function(_0x2ede62){try{jsonpatch[_0xd91b('0x35')](_0x2ede62,_0x4fefa6,!![]);}catch(_0x2f5a65){return BPromise[_0xd91b('0x36')](_0x2f5a65);}return _0x2ede62[_0xd91b('0x37')]();};}function saveUpdates(_0x1a1a01,_0x4dcdde){return function(_0x1f16f3){if(_0x1f16f3){return _0x1f16f3[_0xd91b('0x38')](_0x1a1a01)[_0xd91b('0x21')](function(_0x8029b2){return _0x8029b2;});}return null;};}function removeEntity(_0x459ca2,_0x13e83d){return function(_0x12d0d5){if(_0x12d0d5){return _0x12d0d5[_0xd91b('0x39')]()[_0xd91b('0x21')](function(){var _0x419e38=_0x12d0d5[_0xd91b('0x3a')]({'plain':!![]});var _0x596121=_0xd91b('0x3b');return db['UserProfileResource'][_0xd91b('0x39')]({'where':{'type':_0x596121,'resourceId':_0x419e38['id']}})[_0xd91b('0x21')](function(){return _0x12d0d5;});})[_0xd91b('0x21')](function(){_0x459ca2[_0xd91b('0x2d')](0xcc)[_0xd91b('0x2e')]();});}};}function handleEntityNotFound(_0x2d2bcd,_0x45013b){return function(_0x44c3f6){if(!_0x44c3f6){_0x2d2bcd[_0xd91b('0x2c')](0x194);}return _0x44c3f6;};}function handleError(_0x20377d,_0x33d589){_0x33d589=_0x33d589||0x1f4;return function(_0x3acf40){logger[_0xd91b('0x27')](_0x3acf40[_0xd91b('0x3c')]);if(_0x3acf40[_0xd91b('0x3d')]){delete _0x3acf40[_0xd91b('0x3d')];}_0x20377d['status'](_0x33d589)[_0xd91b('0x3e')](_0x3acf40);};}exports[_0xd91b('0x3f')]=function(_0x5afb7c,_0x18032e){var _0x237876={'include':[{'model':db[_0xd91b('0x40')],'as':_0xd91b('0x41')}]},_0x5ac005={},_0x4a64df={'count':0x0,'rows':[]};var _0x16e2ba=_[_0xd91b('0x42')](db[_0xd91b('0x43')][_0xd91b('0x44')],function(_0x189346){return{'name':_0x189346[_0xd91b('0x45')],'type':_0x189346['type']['key']};});_0x5ac005[_0xd91b('0x46')]=_['map'](_0x16e2ba,'name');_0x5ac005['query']=_[_0xd91b('0x47')](_0x5afb7c[_0xd91b('0x48')]);_0x5ac005[_0xd91b('0x49')]=_[_0xd91b('0x4a')](_0x5ac005[_0xd91b('0x46')],_0x5ac005['query']);_0x237876[_0xd91b('0x4b')]=_[_0xd91b('0x4a')](_0x5ac005[_0xd91b('0x46')],qs[_0xd91b('0x4c')](_0x5afb7c[_0xd91b('0x48')]['fields']));_0x237876[_0xd91b('0x4b')]=_0x237876['attributes'][_0xd91b('0x4d')]?_0x237876[_0xd91b('0x4b')]:_0x5ac005[_0xd91b('0x46')];if(!_0x5afb7c[_0xd91b('0x48')]['hasOwnProperty']('nolimit')){_0x237876[_0xd91b('0x31')]=qs[_0xd91b('0x31')](_0x5afb7c[_0xd91b('0x48')]['limit']);_0x237876['offset']=qs[_0xd91b('0x33')](_0x5afb7c[_0xd91b('0x48')]['offset']);}_0x237876['order']=qs[_0xd91b('0x4e')](_0x5afb7c[_0xd91b('0x48')][_0xd91b('0x4e')]);_0x237876[_0xd91b('0x4f')]=qs[_0xd91b('0x49')](_[_0xd91b('0x50')](_0x5afb7c['query'],_0x5ac005['filters']),_0x16e2ba);if(_0x5afb7c[_0xd91b('0x48')][_0xd91b('0x51')]){_0x237876[_0xd91b('0x4f')]=_['merge'](_0x237876[_0xd91b('0x4f')],{'$or':_['map'](_0x16e2ba,function(_0x3552a5){if(_0x3552a5[_0xd91b('0x52')]!==_0xd91b('0x53')){var _0x14fbdc={};_0x14fbdc[_0x3552a5[_0xd91b('0x3d')]]={'$like':'%'+_0x5afb7c[_0xd91b('0x48')][_0xd91b('0x51')]+'%'};return _0x14fbdc;}})});}_0x237876=_[_0xd91b('0x54')]({},_0x237876,_0x5afb7c[_0xd91b('0x55')]);var _0x145326={'where':_0x237876['where']};return db['ChatWebsite']['count'](_0x145326)[_0xd91b('0x21')](function(_0x8936d9){_0x4a64df['count']=_0x8936d9;if(_0x5afb7c['query'][_0xd91b('0x56')]){_0x237876[_0xd91b('0x57')]=[{'all':!![]}];}return db['ChatWebsite'][_0xd91b('0x58')](_0x237876);})[_0xd91b('0x21')](function(_0x4b041a){_0x4a64df[_0xd91b('0x59')]=_0x4b041a;return _0x4a64df;})[_0xd91b('0x21')](respondWithFilteredResult(_0x18032e,_0x237876))[_0xd91b('0x2b')](handleError(_0x18032e,null));};exports[_0xd91b('0x5a')]=function(_0x22474c,_0x4f6699){var _0x900420={'raw':![],'where':{'id':_0x22474c[_0xd91b('0x5b')]['id']},'include':[{'model':db[_0xd91b('0x40')],'as':_0xd91b('0x41')}]},_0x47c464={};_0x47c464[_0xd91b('0x46')]=_[_0xd91b('0x47')](db['ChatWebsite']['rawAttributes']);_0x47c464[_0xd91b('0x48')]=_[_0xd91b('0x47')](_0x22474c[_0xd91b('0x48')]);_0x47c464['filters']=_[_0xd91b('0x4a')](_0x47c464[_0xd91b('0x46')],_0x47c464[_0xd91b('0x48')]);_0x900420[_0xd91b('0x4b')]=_[_0xd91b('0x4a')](_0x47c464['model'],qs[_0xd91b('0x4c')](_0x22474c[_0xd91b('0x48')][_0xd91b('0x4c')]));_0x900420[_0xd91b('0x4b')]=_0x900420[_0xd91b('0x4b')][_0xd91b('0x4d')]?_0x900420['attributes']:_0x47c464[_0xd91b('0x46')];if(_0x22474c[_0xd91b('0x48')]['includeAll']){_0x900420['include']=[{'all':!![]}];}_0x900420=_['merge']({},_0x900420,_0x22474c['options']);return db[_0xd91b('0x43')][_0xd91b('0x5c')](_0x900420)['then'](handleEntityNotFound(_0x4f6699,null))['then'](respondWithResult(_0x4f6699,null))['catch'](handleError(_0x4f6699,null));};exports[_0xd91b('0x5d')]=function(_0x2514a3,_0x16863b){return db[_0xd91b('0x43')][_0xd91b('0x5d')](_0x2514a3['body'],{})[_0xd91b('0x21')](function(_0x369e16){var _0x3a778f=_0x2514a3[_0xd91b('0x5e')][_0xd91b('0x3a')]({'plain':!![]});if(!_0x3a778f)throw new Error(_0xd91b('0x5f'));if(_0x3a778f[_0xd91b('0x60')]==='user'){var _0x3f27f6=_0x369e16[_0xd91b('0x3a')]({'plain':!![]});var _0x4dcca2=_0xd91b('0x3b');return db[_0xd91b('0x61')][_0xd91b('0x5c')]({'where':{'name':_0x4dcca2,'userProfileId':_0x3a778f['userProfileId']},'raw':!![]})[_0xd91b('0x21')](function(_0x4106ea){if(_0x4106ea&&_0x4106ea['autoAssociation']===0x0){return db[_0xd91b('0x62')]['create']({'name':_0x3f27f6[_0xd91b('0x3d')],'resourceId':_0x3f27f6['id'],'type':_0x4106ea[_0xd91b('0x3d')],'sectionId':_0x4106ea['id']},{})[_0xd91b('0x21')](function(){return _0x369e16;});}else{return _0x369e16;}})[_0xd91b('0x2b')](function(_0x24229d){logger[_0xd91b('0x27')](_0xd91b('0x63'),_0x24229d);throw _0x24229d;});}return _0x369e16;})[_0xd91b('0x21')](respondWithResult(_0x16863b,0xc9))[_0xd91b('0x2b')](handleError(_0x16863b,null));};exports[_0xd91b('0x38')]=function(_0x503e75,_0x339cbc){if(_0x503e75[_0xd91b('0x64')]['id']){delete _0x503e75['body']['id'];}return db['ChatWebsite'][_0xd91b('0x5c')]({'where':{'id':_0x503e75[_0xd91b('0x5b')]['id']},'include':[{'model':db[_0xd91b('0x40')],'as':_0xd91b('0x41')}]})['then'](handleEntityNotFound(_0x339cbc,null))[_0xd91b('0x21')](saveUpdates(_0x503e75['body'],null))[_0xd91b('0x21')](respondWithResult(_0x339cbc,null))[_0xd91b('0x2b')](handleError(_0x339cbc,null));};exports[_0xd91b('0x39')]=function(_0x1012dd,_0x534b34){return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x1012dd[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x534b34,null))[_0xd91b('0x21')](removeEntity(_0x534b34,null))[_0xd91b('0x2b')](handleError(_0x534b34,null));};exports[_0xd91b('0x65')]=function(_0x332ef3,_0x52522e){return db[_0xd91b('0x43')][_0xd91b('0x65')]()[_0xd91b('0x21')](respondWithResult(_0x52522e,null))[_0xd91b('0x2b')](handleError(_0x52522e,null));};exports[_0xd91b('0x66')]=function(_0x34eba4,_0x55d653,_0x2fd11d){if(_0x34eba4[_0xd91b('0x64')]['id']){delete _0x34eba4['body']['id'];}return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x34eba4[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x55d653,null))[_0xd91b('0x21')](function(_0x1c8546){if(_0x1c8546){_0x34eba4[_0xd91b('0x64')][_0xd91b('0x67')]=_0x1c8546['id'];return db[_0xd91b('0x68')][_0xd91b('0x5d')](_0x34eba4['body']);}})[_0xd91b('0x21')](respondWithResult(_0x55d653,null))[_0xd91b('0x2b')](handleError(_0x55d653,null));};exports['getDispositions']=function(_0x4402c9,_0x13416c,_0x4a2e2f){var _0x48a35f={'raw':![],'where':{}};var _0x20f041={};var _0x51bfb2={'count':0x0,'rows':[]};return db[_0xd91b('0x43')][_0xd91b('0x69')]({'where':{'id':_0x4402c9[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x13416c,null))[_0xd91b('0x21')](function(_0x542f45){if(_0x542f45){_0x20f041[_0xd91b('0x46')]=_[_0xd91b('0x47')](db['Disposition'][_0xd91b('0x44')]);_0x20f041[_0xd91b('0x48')]=_[_0xd91b('0x47')](_0x4402c9[_0xd91b('0x48')]);_0x20f041[_0xd91b('0x49')]=_[_0xd91b('0x4a')](_0x20f041[_0xd91b('0x46')],_0x20f041['query']);_0x48a35f[_0xd91b('0x4b')]=_[_0xd91b('0x4a')](_0x20f041[_0xd91b('0x46')],qs[_0xd91b('0x4c')](_0x4402c9[_0xd91b('0x48')]['fields']));_0x48a35f[_0xd91b('0x4b')]=_0x48a35f[_0xd91b('0x4b')][_0xd91b('0x4d')]?_0x48a35f[_0xd91b('0x4b')]:_0x20f041[_0xd91b('0x46')];if(!_0x4402c9[_0xd91b('0x48')][_0xd91b('0x6a')](_0xd91b('0x6b'))){_0x48a35f[_0xd91b('0x31')]=qs[_0xd91b('0x31')](_0x4402c9['query']['limit']);_0x48a35f[_0xd91b('0x33')]=qs[_0xd91b('0x33')](_0x4402c9[_0xd91b('0x48')][_0xd91b('0x33')]);}_0x48a35f['order']=qs['sort'](_0x4402c9[_0xd91b('0x48')][_0xd91b('0x4e')]);_0x48a35f[_0xd91b('0x4f')]=qs[_0xd91b('0x49')](_['pick'](_0x4402c9[_0xd91b('0x48')],_0x20f041[_0xd91b('0x49')]));_0x48a35f[_0xd91b('0x4f')][_0xd91b('0x67')]=_0x542f45['id'];if(_0x4402c9[_0xd91b('0x48')][_0xd91b('0x51')]){_0x48a35f[_0xd91b('0x4f')]=_[_0xd91b('0x54')](_0x48a35f[_0xd91b('0x4f')],{'$or':_[_0xd91b('0x42')](_0x48a35f['attributes'],function(_0x3a1ca1){var _0x3c9257={};_0x3c9257[_0x3a1ca1]={'$like':'%'+_0x4402c9[_0xd91b('0x48')]['filter']+'%'};return _0x3c9257;})});}_0x48a35f=_[_0xd91b('0x54')]({},_0x48a35f,_0x4402c9[_0xd91b('0x55')]);return db['Disposition'][_0xd91b('0x32')]({'where':_0x48a35f[_0xd91b('0x4f')]})['then'](function(_0x54d042){_0x51bfb2['count']=_0x54d042;if(_0x4402c9[_0xd91b('0x48')]['includeAll']){_0x48a35f['include']=[{'all':!![]}];}return db[_0xd91b('0x68')]['findAll'](_0x48a35f);})[_0xd91b('0x21')](function(_0x25499e){_0x51bfb2[_0xd91b('0x59')]=_0x25499e;return _0x51bfb2;});}})[_0xd91b('0x21')](respondWithFilteredResult(_0x13416c,_0x48a35f))[_0xd91b('0x2b')](handleError(_0x13416c,null));};exports[_0xd91b('0x6c')]=function(_0x56b0ab,_0x3a6ce7,_0x3d3c03){return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x56b0ab[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x3a6ce7,null))['then'](function(_0x1ad836){if(_0x1ad836){return _0x1ad836['removeDispositions'](_0x56b0ab[_0xd91b('0x48')][_0xd91b('0x6d')]);}})['then'](respondWithStatusCode(_0x3a6ce7,null))[_0xd91b('0x2b')](handleError(_0x3a6ce7,null));};exports['addAnswer']=function(_0x4e73a3,_0xfeef6e,_0x5b80eb){if(_0x4e73a3[_0xd91b('0x64')]['id']){delete _0x4e73a3[_0xd91b('0x64')]['id'];}return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x4e73a3['params']['id']}})['then'](handleEntityNotFound(_0xfeef6e,null))[_0xd91b('0x21')](function(_0x2bffc3){if(_0x2bffc3){_0x4e73a3['body'][_0xd91b('0x67')]=_0x2bffc3['id'];return db[_0xd91b('0x6e')][_0xd91b('0x5d')](_0x4e73a3[_0xd91b('0x64')]);}})['then'](respondWithResult(_0xfeef6e,null))[_0xd91b('0x2b')](handleError(_0xfeef6e,null));};exports[_0xd91b('0x6f')]=function(_0x4e7274,_0x300336,_0x18aa80){var _0x487d41={'raw':![],'where':{}};var _0x5c0e01={};var _0x533e7d={'count':0x0,'rows':[]};return db[_0xd91b('0x43')][_0xd91b('0x69')]({'where':{'id':_0x4e7274[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x300336,null))[_0xd91b('0x21')](function(_0x3b1b3c){if(_0x3b1b3c){_0x5c0e01['model']=_[_0xd91b('0x47')](db['CannedAnswer'][_0xd91b('0x44')]);_0x5c0e01[_0xd91b('0x48')]=_['keys'](_0x4e7274['query']);_0x5c0e01[_0xd91b('0x49')]=_[_0xd91b('0x4a')](_0x5c0e01['model'],_0x5c0e01[_0xd91b('0x48')]);_0x487d41[_0xd91b('0x4b')]=_[_0xd91b('0x4a')](_0x5c0e01[_0xd91b('0x46')],qs[_0xd91b('0x4c')](_0x4e7274[_0xd91b('0x48')][_0xd91b('0x4c')]));_0x487d41[_0xd91b('0x4b')]=_0x487d41[_0xd91b('0x4b')][_0xd91b('0x4d')]?_0x487d41['attributes']:_0x5c0e01[_0xd91b('0x46')];if(!_0x4e7274['query'][_0xd91b('0x6a')](_0xd91b('0x6b'))){_0x487d41[_0xd91b('0x31')]=qs[_0xd91b('0x31')](_0x4e7274[_0xd91b('0x48')][_0xd91b('0x31')]);_0x487d41[_0xd91b('0x33')]=qs[_0xd91b('0x33')](_0x4e7274['query']['offset']);}_0x487d41[_0xd91b('0x70')]=qs[_0xd91b('0x4e')](_0x4e7274[_0xd91b('0x48')]['sort']);_0x487d41[_0xd91b('0x4f')]=qs['filters'](_[_0xd91b('0x50')](_0x4e7274[_0xd91b('0x48')],_0x5c0e01['filters']));_0x487d41[_0xd91b('0x4f')][_0xd91b('0x67')]=_0x3b1b3c['id'];if(_0x4e7274[_0xd91b('0x48')][_0xd91b('0x51')]){_0x487d41[_0xd91b('0x4f')]=_['merge'](_0x487d41['where'],{'$or':_[_0xd91b('0x42')](_0x487d41['attributes'],function(_0x1795d3){var _0x2877bb={};_0x2877bb[_0x1795d3]={'$like':'%'+_0x4e7274[_0xd91b('0x48')]['filter']+'%'};return _0x2877bb;})});}_0x487d41=_['merge']({},_0x487d41,_0x4e7274[_0xd91b('0x55')]);return db[_0xd91b('0x6e')][_0xd91b('0x32')]({'where':_0x487d41[_0xd91b('0x4f')]})['then'](function(_0x560b84){_0x533e7d[_0xd91b('0x32')]=_0x560b84;if(_0x4e7274[_0xd91b('0x48')][_0xd91b('0x56')]){_0x487d41[_0xd91b('0x57')]=[{'all':!![]}];}return db[_0xd91b('0x6e')][_0xd91b('0x58')](_0x487d41);})['then'](function(_0x320452){_0x533e7d[_0xd91b('0x59')]=_0x320452;return _0x533e7d;});}})[_0xd91b('0x21')](respondWithFilteredResult(_0x300336,_0x487d41))[_0xd91b('0x2b')](handleError(_0x300336,null));};exports[_0xd91b('0x71')]=function(_0x3813f5,_0x28808d,_0x2b2c00){return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x3813f5['params']['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x28808d,null))[_0xd91b('0x21')](function(_0x405b0c){if(_0x405b0c){return _0x405b0c[_0xd91b('0x71')](_0x3813f5['query'][_0xd91b('0x6d')]);}})['then'](respondWithStatusCode(_0x28808d,null))[_0xd91b('0x2b')](handleError(_0x28808d,null));};exports[_0xd91b('0x72')]=function(_0x3c3e60,_0x3d150b,_0x229055){_0x3c3e60['body'][_0xd91b('0x73')]=_0x3c3e60['file']['filename'];return db[_0xd91b('0x43')]['find']({'where':{'id':_0x3c3e60[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x3d150b,null))[_0xd91b('0x21')](saveUpdates(_0x3c3e60[_0xd91b('0x64')],null))[_0xd91b('0x21')](respondWithResult(_0x3d150b,null))['catch'](handleError(_0x3d150b,null));};exports[_0xd91b('0x74')]=function(_0x19e579,_0x4fda30,_0x4031b3){_0x19e579[_0xd91b('0x64')]['agentAvatar']=_0x19e579['file']['filename'];return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x19e579[_0xd91b('0x5b')]['id']}})['then'](handleEntityNotFound(_0x4fda30,null))[_0xd91b('0x21')](saveUpdates(_0x19e579[_0xd91b('0x64')],null))[_0xd91b('0x21')](respondWithResult(_0x4fda30,null))[_0xd91b('0x2b')](handleError(_0x4fda30,null));};exports[_0xd91b('0x75')]=function(_0x375a2f,_0x57d8e8,_0x34629a){_0x375a2f['body'][_0xd91b('0x76')]=_0x375a2f[_0xd91b('0x77')][_0xd91b('0x78')];return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x375a2f[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x57d8e8,null))['then'](saveUpdates(_0x375a2f[_0xd91b('0x64')],null))['then'](respondWithResult(_0x57d8e8,null))[_0xd91b('0x2b')](handleError(_0x57d8e8,null));};exports[_0xd91b('0x79')]=function(_0x392aef,_0x266719,_0x10d85c){_0x392aef['body']['systemAvatar']=_0x392aef[_0xd91b('0x77')][_0xd91b('0x78')];return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x392aef[_0xd91b('0x5b')]['id']}})['then'](handleEntityNotFound(_0x266719,null))[_0xd91b('0x21')](saveUpdates(_0x392aef[_0xd91b('0x64')],null))['then'](respondWithResult(_0x266719,null))['catch'](handleError(_0x266719,null));};exports[_0xd91b('0x7a')]=function(_0x189e68,_0x243721,_0xf69f35){var _0x5e30aa=path['join'](config[_0xd91b('0x7b')],'server/files/images/logos/default_logo.svg');var _0xb56c3b={'where':{'id':_0x189e68['params']['id']},'attributes':['id',_0xd91b('0x73')],'raw':!![]};var _0x52c4a4=![];return require(_0xd91b('0x16'))[_0xd91b('0x7c')]()[_0xd91b('0x21')](function(_0x1c0202){if(_0x1c0202){_0x52c4a4=_0x1c0202['custom'];}})[_0xd91b('0x21')](function(){return db['ChatWebsite'][_0xd91b('0x5c')](_0xb56c3b);})['then'](handleEntityNotFound(_0x243721,null))[_0xd91b('0x21')](function(_0x133b76){if(_0x133b76){if(!_[_0xd91b('0x7d')](_0x133b76[_0xd91b('0x73')])){if(fs['existsSync'](path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],_0xd91b('0x7f'),_0x133b76['sitepic']))&&_0x52c4a4){_0x5e30aa=path['join'](config[_0xd91b('0x7b')],_0xd91b('0x7f'),_0x133b76[_0xd91b('0x73')]);}}return _0x243721['download'](_0x5e30aa);}})[_0xd91b('0x2b')](handleError(_0x243721,null));};exports[_0xd91b('0x80')]=function(_0x8580ce,_0x1941b9,_0x37c958){var _0x220932=path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],_0xd91b('0x81'));var _0x5ac361={'where':{'id':_0x8580ce['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xd91b('0x43')][_0xd91b('0x5c')](_0x5ac361)[_0xd91b('0x21')](handleEntityNotFound(_0x1941b9,null))['then'](function(_0x6bad10){if(_0x6bad10){if(!_['isNil'](_0x6bad10[_0xd91b('0x82')])){if(fs[_0xd91b('0x83')](path[_0xd91b('0x7e')](config['root'],_0xd91b('0x84'),_0x6bad10[_0xd91b('0x82')]))){_0x220932=path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],'server/files/images/avatars/',_0x6bad10['agentAvatar']);}}return _0x1941b9[_0xd91b('0x85')](_0x220932);}})[_0xd91b('0x2b')](handleError(_0x1941b9,null));};exports[_0xd91b('0x86')]=function(_0x597b84,_0x321867,_0x529612){var _0x4cba33=path['join'](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x43cbbc={'where':{'id':_0x597b84[_0xd91b('0x5b')]['id']},'attributes':['id','customerAvatar',_0xd91b('0x87')],'raw':!![]};return db[_0xd91b('0x43')][_0xd91b('0x5c')](_0x43cbbc)[_0xd91b('0x21')](handleEntityNotFound(_0x321867,null))[_0xd91b('0x21')](function(_0x17dc02){if(_0x17dc02){if(!_[_0xd91b('0x7d')](_0x17dc02[_0xd91b('0x76')])){if(fs[_0xd91b('0x83')](path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],_0xd91b('0x84'),_0x17dc02[_0xd91b('0x76')]))&&_0x17dc02[_0xd91b('0x87')]){_0x4cba33=path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],_0xd91b('0x84'),_0x17dc02[_0xd91b('0x76')]);}}return _0x321867['download'](_0x4cba33);}})[_0xd91b('0x2b')](handleError(_0x321867,null));};exports['getSystemAvatar']=function(_0x338cc5,_0x206f71,_0x5a472f){var _0x17e211=path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],_0xd91b('0x88'));var _0x57795d={'where':{'id':_0x338cc5[_0xd91b('0x5b')]['id']},'attributes':['id',_0xd91b('0x89')],'raw':!![]};return db['ChatWebsite'][_0xd91b('0x5c')](_0x57795d)[_0xd91b('0x21')](handleEntityNotFound(_0x206f71,null))[_0xd91b('0x21')](function(_0x5432fd){if(_0x5432fd){if(!_[_0xd91b('0x7d')](_0x5432fd[_0xd91b('0x89')])){if(fs['existsSync'](path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],_0xd91b('0x84'),_0x5432fd[_0xd91b('0x89')]))){_0x17e211=path[_0xd91b('0x7e')](config['root'],_0xd91b('0x84'),_0x5432fd[_0xd91b('0x89')]);}}return _0x206f71[_0xd91b('0x85')](_0x17e211);}})[_0xd91b('0x2b')](handleError(_0x206f71,null));};exports[_0xd91b('0x8a')]=function(_0x26db22,_0x7b4e7d,_0x38cff3){var _0x33010c=require('user-agent-parser');var _0x380137=new _0x33010c();var _0x1cb4b9=_0x380137['setUA'](_0x26db22[_0xd91b('0x8b')][_0xd91b('0x8c')])[_0xd91b('0x8d')]();var _0x47f631={'body':_0x26db22[_0xd91b('0x64')],'channel':_0xd91b('0x8e')};var _0x57bbf9=[];var _0x3c38d5=[];var _0x48130a={};var _0x6ac3e3=![];return db[_0xd91b('0x8f')]['describe']()[_0xd91b('0x21')](function(_0x1506c6){if(!_0x1506c6){throw new db['Sequelize'][(_0xd91b('0x90'))]('no\x20available\x20attributes');}_0x57bbf9=_[_0xd91b('0x91')](_[_0xd91b('0x47')](_0x1506c6),['createdAt',_0xd91b('0x92')]);_0x3c38d5=_[_0xd91b('0x91')](_[_0xd91b('0x47')](_0x1506c6),[_0xd91b('0x93'),_0xd91b('0x92'),_0xd91b('0x94'),_0xd91b('0x95')]);if(_0x26db22['body']['id']){delete _0x26db22[_0xd91b('0x64')]['id'];}if(_['isNil'](_0x26db22[_0xd91b('0x64')][_0xd91b('0x96')])){throw new db[(_0xd91b('0x97'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xd91b('0x7d')](_0x26db22[_0xd91b('0x64')][_0xd91b('0x64')])||_0x26db22[_0xd91b('0x64')][_0xd91b('0x64')]===''){throw new db[(_0xd91b('0x97'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xd91b('0x7d')](_0x26db22[_0xd91b('0x64')]['mapKey'])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3c38d5);}if(!_[_0xd91b('0x98')](_0x3c38d5,_0x26db22[_0xd91b('0x64')][_0xd91b('0x99')])){throw new db[(_0xd91b('0x97'))][(_0xd91b('0x90'))](_0xd91b('0x9a')+_0x3c38d5);}_0x48130a[_0x26db22['body'][_0xd91b('0x99')]]=_0x26db22[_0xd91b('0x64')][_0xd91b('0x96')];})[_0xd91b('0x21')](function(){return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x26db22[_0xd91b('0x5b')]['id']},'include':[{'model':db[_0xd91b('0x9b')],'as':_0xd91b('0x9c'),'include':[{'model':db[_0xd91b('0x8f')],'as':_0xd91b('0x9d'),'where':_0x48130a,'limit':0x1,'order':[[_0xd91b('0x92'),_0xd91b('0x9e')]]}]},{'model':db[_0xd91b('0x9f')],'as':_0xd91b('0xa0')}]});})[_0xd91b('0x21')](handleEntityNotFound(_0x7b4e7d,null))[_0xd91b('0x21')](function(_0x4ce03d){if(_0x4ce03d&&_0x4ce03d[_0xd91b('0x9c')]){_0x47f631['account']=_0x4ce03d;_0x47f631['applications']=_0x4ce03d[_0xd91b('0xa0')];_0x47f631[_0xd91b('0xa1')]=_0x4ce03d[_0xd91b('0x9c')];_0x47f631[_0xd91b('0xa2')]=_[_0xd91b('0xa3')](_0x47f631[_0xd91b('0xa2')],[_0xd91b('0xa4')],[_0xd91b('0xa5')]);if(_0x47f631[_0xd91b('0xa6')][_0xd91b('0xa0')]){delete _0x47f631[_0xd91b('0xa6')][_0xd91b('0xa0')];}if(_0x47f631[_0xd91b('0xa6')]['List']&&_0x47f631[_0xd91b('0xa6')]['List'][_0xd91b('0x9d')][_0xd91b('0x4d')]){return _0x47f631[_0xd91b('0xa6')][_0xd91b('0x9c')][_0xd91b('0x9d')][0x0];}var _0x341c4e=_[_0xd91b('0x18')](_0x26db22[_0xd91b('0x64')],{'firstName':_0x26db22[_0xd91b('0x64')][_0xd91b('0x96')],'ListId':_0x4ce03d[_0xd91b('0x95')]});_0x341c4e[_0x26db22[_0xd91b('0x64')]['mapKey']]=_0x26db22[_0xd91b('0x64')][_0xd91b('0x96')];return db['CmContact'][_0xd91b('0x5d')](_0x341c4e,{'fields':_0x57bbf9,'raw':!![]});}})[_0xd91b('0x21')](handleEntityNotFound(_0x7b4e7d,null))['then'](function(_0x3b775b){_0x47f631[_0xd91b('0xa7')]=_0x3b775b;var _0x596b4c=_0x26db22[_0xd91b('0x64')][_0xd91b('0xa8')];if(_0x26db22['headers'][_0xd91b('0xa9')]){_0x596b4c=_0x26db22[_0xd91b('0x8b')][_0xd91b('0xa9')];}else if(_0x26db22[_0xd91b('0x8b')][_0xd91b('0xaa')]){_0x596b4c=_[_0xd91b('0xab')](_0x26db22[_0xd91b('0x8b')][_0xd91b('0xaa')][_0xd91b('0xac')](','));}if(_0x3b775b){var _0x4fbcf1={'ContactId':_0x3b775b['id'],'ChatWebsiteId':_0x26db22['params']['id'],'from':(_0x3b775b[_0xd91b('0xad')]||'')+'\x20'+(_0x3b775b[_0xd91b('0xae')]||''),'customerIp':_0x596b4c,'customerPort':_0x26db22[_0xd91b('0x8b')]['x-real-port']?_0x26db22['headers'][_0xd91b('0xaf')]:null,'referer':_0x26db22['body'][_0xd91b('0xb0')],'browserName':_0x1cb4b9[_0xd91b('0xb1')][_0xd91b('0x3d')]&&_0x1cb4b9['browser']['version']?util[_0xd91b('0xb2')]('%s\x20%s',_0x1cb4b9['browser'][_0xd91b('0x3d')],_0x1cb4b9[_0xd91b('0xb1')][_0xd91b('0xb3')]):_0xd91b('0xb4'),'browserVersion':_0x1cb4b9[_0xd91b('0xb1')]['version']||_0xd91b('0xb4'),'osName':util[_0xd91b('0xb2')]('%s\x20%s',_0x1cb4b9['os']['name'],_0x1cb4b9['os'][_0xd91b('0xb3')]),'osVersion':_0x1cb4b9['os'][_0xd91b('0xb3')],'deviceModel':_0x1cb4b9[_0xd91b('0xb5')][_0xd91b('0x46')]&&_0x1cb4b9[_0xd91b('0xb5')]['vendor']?util[_0xd91b('0xb2')](_0xd91b('0xb6'),_0x1cb4b9[_0xd91b('0xb5')]['model'],_0x1cb4b9[_0xd91b('0xb5')][_0xd91b('0xb7')],_0x1cb4b9[_0xd91b('0xb5')]['type']):null,'deviceVendor':_0x1cb4b9['device'][_0xd91b('0xb7')],'deviceType':_0x1cb4b9[_0xd91b('0xb5')]['type'],'formData':JSON[_0xd91b('0x26')](_0x26db22['body'])};var _0x151671={'ChatWebsiteId':_0x26db22[_0xd91b('0x5b')]['id'],'closed':![]};if(_0x26db22[_0xd91b('0x64')][_0xd91b('0xb8')]){_0x151671[_0xd91b('0xb8')]=_0x26db22['body'][_0xd91b('0xb8')];return db[_0xd91b('0xb9')]['find']({'where':_0x151671})['then'](function(_0x15be79){if(_0x15be79){return[_0x15be79,![]];}_0x4fbcf1[_0xd91b('0xb8')]=_0x26db22[_0xd91b('0x64')][_0xd91b('0xb8')];_0x4fbcf1[_0xd91b('0xba')]=_0x26db22[_0xd91b('0x64')][_0xd91b('0xba')];return db[_0xd91b('0xb9')]['create'](_0x4fbcf1)[_0xd91b('0x21')](function(_0x528a04){return[_0x528a04,!![]];});});}_0x151671[_0xd91b('0xbb')]=_0x3b775b['id'];if(_0x26db22[_0xd91b('0x64')][_0xd91b('0xbc')]&&_0x26db22[_0xd91b('0x64')]['interaction']['id']){_0x151671['id']=_0x26db22[_0xd91b('0x64')][_0xd91b('0xbc')]['id'];return db[_0xd91b('0xb9')]['find']({'where':_0x151671})[_0xd91b('0x21')](function(_0xa38683){if(_0xa38683){return[_0xa38683,![]];}return db[_0xd91b('0xb9')][_0xd91b('0x5d')](_0x4fbcf1)[_0xd91b('0x21')](function(_0x59e790){return[_0x59e790,!![]];});});}return db[_0xd91b('0xb9')][_0xd91b('0x5d')](_0x4fbcf1)['then'](function(_0x267254){return[_0x267254,!![]];});}})[_0xd91b('0xbd')](function(_0x46df80,_0x4d21a0){if(_0x46df80){_0x6ac3e3=_0x4d21a0;if(!_0x4d21a0){var _0x2fde7b={'from':(_0x47f631[_0xd91b('0xa7')][_0xd91b('0xad')]||'')+'\x20'+(_0x47f631['contact'][_0xd91b('0xae')]||'')};if(_0x26db22['body'][_0xd91b('0xb8')]&&_0x26db22[_0xd91b('0x64')][_0xd91b('0xbe')]&&_0x26db22[_0xd91b('0x64')][_0xd91b('0xb8')]!=_0x26db22['body'][_0xd91b('0xbe')]){_0x2fde7b[_0xd91b('0xb8')]=_0x26db22['body'][_0xd91b('0xbe')];}return _0x46df80[_0xd91b('0x38')](_0x2fde7b);}else{return _0x46df80;}}})[_0xd91b('0x21')](function(_0x1abaa9){_0x47f631[_0xd91b('0xbc')]=_0x1abaa9['get']({'plain':!![]});_0x47f631[_0xd91b('0xbc')][_0xd91b('0xbf')]=_0x6ac3e3;if(_0x47f631[_0xd91b('0xbc')]['created']){if(_0x47f631['account']['autoclose']){_0x47f631[_0xd91b('0xa2')][_0xd91b('0xc0')]({'id':0x0,'priority':_0x47f631[_0xd91b('0xa2')][_0xd91b('0x4d')]+0x1,'app':_0xd91b('0xc1'),'appdata':'unmanaged','interval':_0xd91b('0xc2')});}}return db[_0xd91b('0xc3')][_0xd91b('0x5d')]({'body':_0x26db22[_0xd91b('0x64')]['body'],'ChatWebsiteId':_0x26db22[_0xd91b('0x5b')]['id'],'ChatInteractionId':_0x1abaa9['id'],'direction':'in','ContactId':_0x47f631[_0xd91b('0xa7')]['id'],'AttachmentId':_0x26db22['body'][_0xd91b('0xc4')]});})[_0xd91b('0x21')](function(_0x3ea9cd){_0x47f631['message']=_0x3ea9cd;if(_0x47f631[_0xd91b('0xbc')][_0xd91b('0xc5')]){return db[_0xd91b('0xc6')][_0xd91b('0x5c')]({'attributes':['id',_0xd91b('0x3d')],'where':{'id':_0x47f631[_0xd91b('0xbc')][_0xd91b('0xc5')]}})[_0xd91b('0x21')](function(_0xd29a80){if(_0xd29a80){_0x47f631[_0xd91b('0xa2')][_0xd91b('0xc7')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xd29a80[_0xd91b('0x3d')]+','+(_0x47f631[_0xd91b('0xa6')][_0xd91b('0xc8')]||0xa),'interval':_0xd91b('0xc2')});_0x47f631[_0xd91b('0xc9')]=!![];}return respondWithRpcPromise(_0xd91b('0xca'),_0xd91b('0xcb'),_0x47f631);});}return respondWithRpcPromise(_0xd91b('0xca'),'startRouting',_0x47f631);})[_0xd91b('0x21')](function(_0x3646a5){respondWithRpcPromise('EventManager',_0xd91b('0xcc'),{'event':_0xd91b('0x8a'),'message':_0x3646a5},client9002);return _0x3646a5;})[_0xd91b('0x21')](respondWithResult(_0x7b4e7d,null))[_0xd91b('0x2b')](handleError(_0x7b4e7d,null));};exports[_0xd91b('0xcd')]=function(_0x22d046,_0x1e0f77,_0x579b2d){var _0x15ad28,_0x572bb8,_0x5954e4;var _0x1c70d0=[];var _0x2fd82e=[];var _0x535c45={};var _0x16dfe7=_0x22d046[_0xd91b('0xce')]||[];var _0x4b4e77=[];var _0x2a8aaa;return db[_0xd91b('0x8f')]['describe']()[_0xd91b('0x21')](function(_0x555bda){if(!_0x555bda){throw new db[(_0xd91b('0x97'))][(_0xd91b('0x90'))]('no\x20available\x20attributes');}_0x2fd82e=_[_0xd91b('0x91')](_[_0xd91b('0x47')](_0x555bda),['createdAt','updatedAt']);_0x1c70d0=_[_0xd91b('0x91')](_[_0xd91b('0x47')](_0x555bda),[_0xd91b('0x93'),_0xd91b('0x92'),'CompanyId','ListId']);if(_0x22d046[_0xd91b('0x64')]['id']){delete _0x22d046[_0xd91b('0x64')]['id'];}if(_[_0xd91b('0x7d')](_0x22d046[_0xd91b('0x64')][_0xd91b('0x96')])){throw _0x1e0f77[_0xd91b('0x2d')](0x1f4)[_0xd91b('0x3e')](new db[(_0xd91b('0x97'))][(_0xd91b('0x90'))](_0xd91b('0xcf')));}if(_[_0xd91b('0x7d')](_0x22d046[_0xd91b('0x64')][_0xd91b('0x64')])||_0x22d046[_0xd91b('0x64')]['body']===''){throw _0x1e0f77[_0xd91b('0x2d')](0x1f4)[_0xd91b('0x3e')](new db[(_0xd91b('0x97'))]['ValidationError'](_0xd91b('0xd0')));}if(_[_0xd91b('0x7d')](_0x22d046[_0xd91b('0x64')][_0xd91b('0xd1')])){throw _0x1e0f77[_0xd91b('0x2d')](0x1f4)[_0xd91b('0x3e')](new db[(_0xd91b('0x97'))][(_0xd91b('0x90'))]('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1c70d0));}if(!_['includes'](_0x1c70d0,_0x22d046[_0xd91b('0x64')][_0xd91b('0xd1')])){throw _0x1e0f77['status'](0x1f4)[_0xd91b('0x3e')](new db['Sequelize'][(_0xd91b('0x90'))](_0xd91b('0xd2')+_0x1c70d0));}_0x535c45[_0x22d046[_0xd91b('0x64')][_0xd91b('0xd1')]]=_0x22d046[_0xd91b('0x64')]['from'];})[_0xd91b('0x21')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x22d046['params']['id']},'include':[{'model':db[_0xd91b('0x9b')],'as':_0xd91b('0x9c')},{'model':db[_0xd91b('0xd3')],'as':'MailAccount'}]});})['then'](handleEntityNotFound(_0x1e0f77,null))[_0xd91b('0x21')](function(_0x1726a1){if(_0x1726a1&&_0x1726a1[_0xd91b('0x9c')]){_0x572bb8=_0x1726a1;var _0x544551=_[_0xd91b('0x18')](_0x22d046['body'],{'firstName':_0x22d046[_0xd91b('0x64')][_0xd91b('0x96')],'phone':_0x22d046['body'][_0xd91b('0x96')],'ListId':_0x1726a1[_0xd91b('0x95')]});_0x544551[_0x22d046[_0xd91b('0x64')][_0xd91b('0xd1')]]=_0x22d046[_0xd91b('0x64')]['from'];return db['CmContact'][_0xd91b('0xd4')]({'where':_0x535c45,'defaults':_0x544551});}})['spread'](function(_0x32f677){if(_0x32f677){_0x5954e4=_0x32f677;var _0x3f0489=fs[_0xd91b('0xd5')](path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],'server/files/templates/chatOfflineMessage.ejs'),_0xd91b('0xd6'));var _0x27666b=ejs[_0xd91b('0xd7')](_0x3f0489,{'body':_[_0xd91b('0xd8')](_0x22d046[_0xd91b('0x64')][_0xd91b('0x64')]),'bodyTitle':_0x572bb8[_0xd91b('0xd9')]});return db[_0xd91b('0xda')][_0xd91b('0x5d')]({'body':_0x27666b,'ContactId':_0x32f677['id'],'ChatWebsiteId':_0x572bb8['id']});}})['then'](function(_0x328916){_0x2a8aaa=_0x328916;if(_0x16dfe7[_0xd91b('0x4d')]){var _0x3fc231=_0x16dfe7[_0xd91b('0x42')](function(_0x37a466){return{'name':_0x37a466[_0xd91b('0xdb')],'basename':_0x37a466[_0xd91b('0x78')],'type':_0x37a466['mimetype'],'ChatOfflineMessageId':_0x328916['id']};});_0x4b4e77=_0x3fc231[_0xd91b('0x42')](_0x4bc33c=>{var _0x458bb7={'filename':_0x4bc33c[_0xd91b('0x3d')],'path':path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],_0xd91b('0xdc'),_0xd91b('0xce'),_0xd91b('0xdd'),_0xd91b('0xde'),_0x4bc33c['basename'])};return _0x458bb7;});if(!_0x572bb8[_0xd91b('0xdf')]){return db['sequelize']['transaction'](function(_0x328817){return db[_0xd91b('0xe0')]['bulkCreate'](_0x3fc231,{'transaction':_0x328817});});}}})['then'](function(){if(_0x2a8aaa){_0x15ad28=_0x2a8aaa;return db[_0xd91b('0xd3')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0xd91b('0xe1')],'as':_0xd91b('0xe2'),'raw':!![]}]});}})[_0xd91b('0x21')](function(_0x539305){if(_0x539305&&_0x539305[_0xd91b('0xe2')]&&_0x572bb8['forwardOffline']&&_0x572bb8[_0xd91b('0xe3')]){var _0x3c232d={'tls':{'rejectUnauthorized':![]}};if(_0x539305[_0xd91b('0xe2')][_0xd91b('0xe4')]){_0x3c232d['service']=_0x539305[_0xd91b('0xe2')][_0xd91b('0xe4')];}else{_0x3c232d[_0xd91b('0xe5')]=_0x539305[_0xd91b('0xe2')][_0xd91b('0xe5')];_0x3c232d[_0xd91b('0xe6')]=_0x539305[_0xd91b('0xe2')][_0xd91b('0xe6')];_0x3c232d['secure']=_0x539305[_0xd91b('0xe2')][_0xd91b('0xe7')];}if(_0x539305[_0xd91b('0xe2')]['authentication']){_0x3c232d[_0xd91b('0xe8')]={'user':_0x539305[_0xd91b('0xe2')][_0xd91b('0x5e')],'pass':_0x539305[_0xd91b('0xe2')][_0xd91b('0xe9')]};}return respondWithRpcPromise(_0xd91b('0xea'),_0xd91b('0xeb'),{'account':_0x3c232d,'message':{'from':util[_0xd91b('0xb2')](_0xd91b('0xec'),_0x539305[_0xd91b('0x3d')],_0x539305[_0xd91b('0xed')]||_0x539305['Smtp'][_0xd91b('0x5e')]),'to':_0x572bb8[_0xd91b('0xe3')],'subject':_0x572bb8[_0xd91b('0xee')],'html':_0x15ad28['body'],'attachments':_0x4b4e77}},client9003)['then'](function(){return _0x15ad28;})[_0xd91b('0x2b')](function(_0x4e9221){console[_0xd91b('0x27')](_0x4e9221);});}})[_0xd91b('0x21')](function(){if(_0x572bb8&&_0x572bb8[_0xd91b('0xdf')]&&_0x572bb8[_0xd91b('0xef')]){var _0x24eb7b=[];if(_0x16dfe7[_0xd91b('0x4d')]){_0x24eb7b=_0x16dfe7[_0xd91b('0x42')](function(_0x1fc85a){return{'name':_0x1fc85a[_0xd91b('0xdb')],'basename':_0x1fc85a[_0xd91b('0x78')],'type':_0x1fc85a[_0xd91b('0xf0')],'ChatOfflineMessageId':_0x2a8aaa['id']};});}var _0x4266d2;if(!_[_0xd91b('0x7d')](_0x572bb8['subjectOffline'])){var _0x1e4383=_[_0xd91b('0x42')](_0x22d046[_0xd91b('0x64')],function(_0x3a0073){return _0x3a0073;});var _0x284a5f=_[_0xd91b('0xf1')](_0x1e4383)[0x0];var _0x1563ba=_[_0xd91b('0xf2')](_0x284a5f,function(_0xaa733a){return _0xaa733a;});_0x4266d2=_0x1563ba[0x1][_0x572bb8[_0xd91b('0xf3')]];}var _0x428415={'from':_0x5954e4['email'],'firstName':_0x5954e4[_0xd91b('0xad')],'lastName':_0x5954e4[_0xd91b('0xae')],'mapKey':_0xd91b('0xed'),'message':{'from':_0x5954e4[_0xd91b('0xed')],'to':_0x572bb8[_0xd91b('0xd3')]['email'],'cc':'','subject':_[_0xd91b('0x7d')](_0x4266d2)?_0x572bb8[_0xd91b('0xee')]:_0x4266d2,'messageId':'','sentAt':new Date(),'attach':_0x24eb7b[_0xd91b('0x4d')],'attachments':_0x24eb7b,'originChannel':_0xd91b('0xf4'),'ChatWebsiteId':_0x572bb8['id'],'ChatOfflineMessageId':_0x15ad28['id'],'originTo':_0x572bb8['MailAccount']['email']},'body':_0x15ad28[_0xd91b('0x64')]};var _0x377287={'account':{'id':_0x572bb8[_0xd91b('0xef')]},'body':_0x428415,'log':_0xd91b('0xf5')};return respondWithRpcPromise(_0xd91b('0xf5'),_0xd91b('0xf6'),_0x377287,client9001)[_0xd91b('0x21')](function(){return _0x15ad28;})[_0xd91b('0x2b')](function(_0x286bb5){console['error'](_0x286bb5);});}return;})['then'](function(){if(_0x15ad28){return _0x15ad28;}})[_0xd91b('0x21')](respondWithResult(_0x1e0f77,null))['catch'](function(_0x3d6c3c){console[_0xd91b('0x27')](_0xd91b('0x2b'),_0x3d6c3c);for(var _0x318a94 of _0x16dfe7){var _0x353a39=path[_0xd91b('0x7e')](config['root'],_0xd91b('0xdc'),'files',_0xd91b('0xdd'),'offline-chat',_0x318a94[_0xd91b('0x78')]);fs_extra['remove'](_0x353a39)[_0xd91b('0x2b')](function(_0x1d70c1){console[_0xd91b('0x27')](_0xd91b('0xf7'),_0x353a39,_0x1d70c1);});}});};exports[_0xd91b('0xf8')]=function(_0x4225a0,_0x373cdf,_0xb6afa2){return db[_0xd91b('0xb9')][_0xd91b('0x5c')]({'where':{'id':_0x4225a0['params']['id']}})['then'](handleEntityNotFound(_0x373cdf,null))['then'](function(_0x8f81b){if(_0x8f81b){return _0x8f81b[_0xd91b('0xf8')](_0x4225a0['body'][_0xd91b('0x6d')],_[_0xd91b('0xf9')](_0x4225a0[_0xd91b('0x64')],['ids','id'])||{});}})[_0xd91b('0x21')](respondWithResult(_0x373cdf,null))['catch'](handleError(_0x373cdf,null));};exports[_0xd91b('0xfa')]=function(_0x3075d8,_0x3ff73b,_0x1d6600){var _0x2c75fa={'raw':![],'where':{}};var _0x2a5a60={};var _0x1b6d78={'count':0x0,'rows':[]};return db[_0xd91b('0x43')][_0xd91b('0x69')]({'where':{'id':_0x3075d8[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x3ff73b,null))[_0xd91b('0x21')](function(_0x3e244c){if(_0x3e244c){_0x2a5a60['model']=_['keys'](db['ChatInteraction'][_0xd91b('0x44')]);_0x2a5a60[_0xd91b('0x48')]=_[_0xd91b('0x47')](_0x3075d8[_0xd91b('0x48')]);_0x2a5a60[_0xd91b('0x49')]=_[_0xd91b('0x4a')](_0x2a5a60['model'],_0x2a5a60['query']);_0x2c75fa['attributes']=_['intersection'](_0x2a5a60[_0xd91b('0x46')],qs[_0xd91b('0x4c')](_0x3075d8['query'][_0xd91b('0x4c')]));_0x2c75fa[_0xd91b('0x4b')]=_0x2c75fa['attributes'][_0xd91b('0x4d')]?_0x2c75fa[_0xd91b('0x4b')]:_0x2a5a60[_0xd91b('0x46')];if(!_0x3075d8[_0xd91b('0x48')][_0xd91b('0x6a')](_0xd91b('0x6b'))){_0x2c75fa[_0xd91b('0x31')]=qs[_0xd91b('0x31')](_0x3075d8[_0xd91b('0x48')][_0xd91b('0x31')]);_0x2c75fa['offset']=qs[_0xd91b('0x33')](_0x3075d8[_0xd91b('0x48')][_0xd91b('0x33')]);}_0x2c75fa[_0xd91b('0x70')]=qs[_0xd91b('0x4e')](_0x3075d8[_0xd91b('0x48')]['sort']);_0x2c75fa[_0xd91b('0x4f')]=qs[_0xd91b('0x49')](_[_0xd91b('0x50')](_0x3075d8[_0xd91b('0x48')],_0x2a5a60[_0xd91b('0x49')]));_0x2c75fa[_0xd91b('0x4f')]['ChatWebsiteId']=_0x3e244c['id'];if(_0x3075d8[_0xd91b('0x48')]['filter']){_0x2c75fa[_0xd91b('0x4f')]=_['merge'](_0x2c75fa[_0xd91b('0x4f')],{'$or':_[_0xd91b('0x42')](_0x2c75fa[_0xd91b('0x4b')],function(_0x315422){var _0x2df11e={};_0x2df11e[_0x315422]={'$like':'%'+_0x3075d8[_0xd91b('0x48')][_0xd91b('0x51')]+'%'};return _0x2df11e;})});}_0x2c75fa=_[_0xd91b('0x54')]({},_0x2c75fa,_0x3075d8[_0xd91b('0x55')]);return db[_0xd91b('0xb9')]['count']({'where':_0x2c75fa['where']})[_0xd91b('0x21')](function(_0x44d204){_0x1b6d78['count']=_0x44d204;if(_0x3075d8[_0xd91b('0x48')][_0xd91b('0x56')]){_0x2c75fa[_0xd91b('0x57')]=[{'model':db[_0xd91b('0x8f')],'as':'Contact','required':![]},{'model':db[_0xd91b('0xc6')],'as':_0xd91b('0xfb'),'attributes':['name',_0xd91b('0xfc'),_0xd91b('0xfd')],'required':![]},{'model':db['Tag'],'as':_0xd91b('0xfe'),'attributes':['id','name',_0xd91b('0xff')],'where':_0x3075d8[_0xd91b('0x48')]['tag']?{'id':_0x3075d8[_0xd91b('0x48')][_0xd91b('0x100')]}:undefined,'required':_0x3075d8['query']['tag']?!![]:![]}];}return db['ChatInteraction'][_0xd91b('0x58')](_0x2c75fa);})['then'](function(_0x4dcd8e){_0x1b6d78[_0xd91b('0x59')]=_0x4dcd8e;return _0x1b6d78;});}})['then'](respondWithFilteredResult(_0x3ff73b,_0x2c75fa))[_0xd91b('0x2b')](handleError(_0x3ff73b,null));};function iftimePromise(_0x477b50,_0x2dda03){return respondWithRpcPromise(_0xd91b('0x101'),_0xd91b('0x102'),{'command':_0x2dda03['timezone']?util[_0xd91b('0xb2')](_0xd91b('0x103'),_0x477b50['interval'],_0x2dda03[_0xd91b('0x104')]):util[_0xd91b('0xb2')](_0xd91b('0x105'),_0x477b50['interval'])},client9002)[_0xd91b('0x21')](function(_0x2baff4){var _0x501474=_0x2baff4&&_0x2baff4[_0xd91b('0x106')](_0xd91b('0x107'))>=0x0?!![]:![];logger['info'](_0xd91b('0x108'),_0x2dda03['id'],_0x477b50['id'],_0x477b50['interval'],_0x501474?_0xd91b('0x109'):_0xd91b('0x10a'),_0x2dda03['timezone']?_0x2dda03[_0xd91b('0x104')]:_0xd91b('0x10b'));return _0x501474;})[_0xd91b('0x2b')](function(_0x2ad6a6){logger['error'](_0xd91b('0x108'),_0x2dda03['id'],_0x477b50['id'],_0x477b50['interval'],util[_0xd91b('0x10c')](_0x2ad6a6,{'showHidden':![],'depth':null}),_0x2dda03[_0xd91b('0x104')]?_0x2dda03[_0xd91b('0x104')]:_0xd91b('0x10b'));return![];});}exports['getSnippet']=function(_0x4d046f,_0x12a7a1,_0x2f0436){var _0x4073ef=0x0;var _0x33c921=0x0;var _0x50a269=![];var _0x5123ec;var _0x5d9af1;return db[_0xd91b('0x43')]['find']({'where':{'id':_0x4d046f[_0xd91b('0x5b')]['id']},'include':[{'model':db[_0xd91b('0x10d')],'as':_0xd91b('0x10d'),'include':[{'model':db['Interval'],'as':_0xd91b('0x10e'),'attributes':['id',_0xd91b('0x10f')],'raw':!![]}]}]})[_0xd91b('0x21')](handleEntityNotFound(_0x12a7a1,null))[_0xd91b('0x21')](function(_0xc941da){if(_0xc941da){_0x5123ec=_0xc941da;return _0xc941da[_0xd91b('0x110')]({'raw':!![]});}})[_0xd91b('0x21')](function(_0x29ce7e){if(_0x5123ec){if(_0x29ce7e){_0x5d9af1=_0x29ce7e;}}return require(_0xd91b('0x16'))['getLicense']();})[_0xd91b('0x21')](function(_0x12633c){if(_0x12633c){_0x33c921=_0x12633c[_0xd91b('0x111')];_0x50a269=_0x12633c['custom'];}})['then'](function(){return db[_0xd91b('0xb9')][_0xd91b('0x32')]({'where':{'closed':![]}});})[_0xd91b('0x21')](function(_0xa0d263){_0x4073ef=_0xa0d263;if(_0x33c921&&_0xa0d263>_0x33c921){return db[_0xd91b('0x112')][_0xd91b('0x69')]({'where':{'id':0x1}})[_0xd91b('0x21')](function(_0x136e30){if(_0x136e30){_0x136e30['increment'](_0xd91b('0x113'));}});}})[_0xd91b('0x21')](function(){if(_0x5123ec[_0xd91b('0x10d')]&&_0x5123ec[_0xd91b('0x10d')]['Intervals']){var _0x33e8ce=[];for(var _0xffc07c=0x0;_0xffc07c<_0x5123ec[_0xd91b('0x10d')][_0xd91b('0x10e')][_0xd91b('0x4d')];_0xffc07c++){var _0x1bee52=_0x5123ec[_0xd91b('0x10d')][_0xd91b('0x10e')][_0xffc07c][_0xd91b('0x3a')]({'plain':!![]});_0x33e8ce[_0xd91b('0xc0')](iftimePromise(_0x1bee52,_0x5123ec));}return BPromise[_0xd91b('0x114')](_0x33e8ce)[_0xd91b('0x21')](function(_0x2c7031){return _[_0xd91b('0x115')](_0x2c7031);});}else{return!![];}})[_0xd91b('0x21')](function(_0x304143){var _0x373022=fs[_0xd91b('0xd5')](path[_0xd91b('0x7e')](config[_0xd91b('0x7b')],'server/files/chat/iframe.ejs'),'utf8');var _0x11b454={'remote':_0x5123ec[_0xd91b('0x116')],'query':querystring[_0xd91b('0x26')](_[_0xd91b('0x54')](_0x5123ec[_0xd91b('0x3a')]({'plain':!![]}),{'customerIp':_0x4d046f[_0xd91b('0x8b')]['x-forwarded-for']||_0x4d046f[_0xd91b('0x8b')][_0xd91b('0x117')]||_0x4d046f[_0xd91b('0x118')][_0xd91b('0x119')]||_0x4d046f['ip'],'referer':_0x4d046f[_0xd91b('0x8b')][_0xd91b('0xb0')],'openedInteractions':_0x4073ef,'maxInteractions':_0x33c921,'virtual':_0x50a269[_0xd91b('0x111')],'online':_0x304143,'custom':_0x50a269}))[_0xd91b('0x11a')](/'/g,'\x5c\x27')};_0x12a7a1[_0xd91b('0x3e')](ejs[_0xd91b('0xd7')](Mustache[_0xd91b('0xd7')](_0x373022,_0x11b454),{'proactiveActions':_0x5d9af1,'alignment':_0x5123ec['alignment'],'verticalAlignment':_0x5123ec['verticalAlignment'],'div_color':_0x5123ec[_0xd91b('0xff')],'text_color':_0x5123ec['textColor'],'button_color':_0x5123ec[_0xd91b('0x11b')],'background_color':_0x5123ec['backgroundColor']}));})[_0xd91b('0x2b')](handleError(_0x12a7a1,null));};exports[_0xd91b('0x11c')]=function(_0x1cd163,_0x3d1079,_0x59f46d){return db[_0xd91b('0x43')][_0xd91b('0x69')]({'where':{'id':_0x1cd163['params']['id']}})['then'](handleEntityNotFound(_0x3d1079,null))[_0xd91b('0x21')](function(_0x4ad226){if(_0x4ad226){return db[_0xd91b('0x11d')][_0xd91b('0x11e')](function(_0x47664a){return db['ChatApplication'][_0xd91b('0x39')]({'where':{'ChatWebsiteId':_0x1cd163['params']['id']},'transaction':_0x47664a})[_0xd91b('0x21')](function(_0x185ce8){var _0xddf319=_['map'](_0x1cd163[_0xd91b('0x64')],function(_0x6033e2){_0x6033e2[_0xd91b('0x67')]=_0x1cd163[_0xd91b('0x5b')]['id'];return _0x6033e2;});return db[_0xd91b('0x9f')][_0xd91b('0x11f')](_0xddf319,{'transaction':_0x47664a});});})[_0xd91b('0x21')](function(){return db['ChatApplication'][_0xd91b('0x120')]({'where':{'ChatWebsiteId':_0x1cd163['params']['id']},'order':'priority'});});}})[_0xd91b('0x21')](respondWithResult(_0x3d1079,null))[_0xd91b('0x2b')](handleError(_0x3d1079,null));};exports[_0xd91b('0x121')]=function(_0x1f3697,_0xa52d12,_0x298e46){var _0x26d3dc={};var _0x250478={};var _0x3c5e15;var _0x5dc275;return db[_0xd91b('0x43')][_0xd91b('0x69')]({'where':{'id':_0x1f3697[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0xa52d12,null))[_0xd91b('0x21')](function(_0x283220){if(_0x283220){_0x3c5e15=_0x283220;_0x250478[_0xd91b('0x46')]=_[_0xd91b('0x47')](db[_0xd91b('0x9f')][_0xd91b('0x44')]);_0x250478[_0xd91b('0x48')]=_[_0xd91b('0x47')](_0x1f3697[_0xd91b('0x48')]);_0x250478[_0xd91b('0x49')]=_['intersection'](_0x250478[_0xd91b('0x46')],_0x250478['query']);_0x26d3dc[_0xd91b('0x4b')]=_[_0xd91b('0x4a')](_0x250478[_0xd91b('0x46')],qs[_0xd91b('0x4c')](_0x1f3697[_0xd91b('0x48')][_0xd91b('0x4c')]));_0x26d3dc[_0xd91b('0x4b')]=_0x26d3dc[_0xd91b('0x4b')][_0xd91b('0x4d')]?_0x26d3dc['attributes']:_0x250478['model'];_0x26d3dc[_0xd91b('0x70')]=qs[_0xd91b('0x4e')](_0x1f3697[_0xd91b('0x48')][_0xd91b('0x4e')]);_0x26d3dc[_0xd91b('0x4f')]=qs[_0xd91b('0x49')](_[_0xd91b('0x50')](_0x1f3697[_0xd91b('0x48')],_0x250478[_0xd91b('0x49')]));if(_0x1f3697[_0xd91b('0x48')][_0xd91b('0x51')]){_0x26d3dc[_0xd91b('0x4f')]=_[_0xd91b('0x54')](_0x26d3dc[_0xd91b('0x4f')],{'$or':_[_0xd91b('0x42')](_0x26d3dc[_0xd91b('0x4b')],function(_0x3e2776){var _0x2659c4={};_0x2659c4[_0x3e2776]={'$like':'%'+_0x1f3697[_0xd91b('0x48')][_0xd91b('0x51')]+'%'};return _0x2659c4;})});}_0x26d3dc=_[_0xd91b('0x54')]({},_0x26d3dc,_0x1f3697[_0xd91b('0x55')]);return _0x3c5e15['getApplications'](_0x26d3dc);}})['then'](function(_0x4a8ceb){if(_0x4a8ceb){_0x5dc275=_0x4a8ceb['length'];if(!_0x1f3697[_0xd91b('0x48')][_0xd91b('0x6a')](_0xd91b('0x6b'))){_0x26d3dc[_0xd91b('0x31')]=qs[_0xd91b('0x31')](_0x1f3697[_0xd91b('0x48')][_0xd91b('0x31')]);_0x26d3dc['offset']=qs[_0xd91b('0x33')](_0x1f3697['query'][_0xd91b('0x33')]);}return _0x3c5e15[_0xd91b('0x121')](_0x26d3dc);}})[_0xd91b('0x21')](function(_0x264371){if(_0x264371){return _0x264371?{'count':_0x5dc275,'rows':_0x264371}:null;}})[_0xd91b('0x21')](respondWithResult(_0xa52d12,null))['catch'](handleError(_0xa52d12,null));};exports[_0xd91b('0x122')]=function(_0x16665b,_0x2193f5,_0x2750f8){return db['chatProactiveAction'][_0xd91b('0x5c')]({'where':{'id':_0x16665b['params']['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x2193f5,null))['then'](function(_0x20d645){if(_0x20d645){return _0x20d645[_0xd91b('0x122')](_0x16665b['body'][_0xd91b('0x6d')],_[_0xd91b('0xf9')](_0x16665b[_0xd91b('0x64')],[_0xd91b('0x6d'),'id'])||{});}})[_0xd91b('0x21')](respondWithResult(_0x2193f5,null))[_0xd91b('0x2b')](handleError(_0x2193f5,null));};exports[_0xd91b('0x110')]=function(_0x21d377,_0x383b12,_0x2a2364){var _0x3741ef={};var _0x842b46={};var _0x3f6265;var _0x3f2701;return db[_0xd91b('0x43')][_0xd91b('0x69')]({'where':{'id':_0x21d377[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x383b12,null))[_0xd91b('0x21')](function(_0x1e9444){if(_0x1e9444){_0x3f6265=_0x1e9444;_0x842b46[_0xd91b('0x46')]=_[_0xd91b('0x47')](db[_0xd91b('0x123')][_0xd91b('0x44')]);_0x842b46[_0xd91b('0x48')]=_['keys'](_0x21d377[_0xd91b('0x48')]);_0x842b46[_0xd91b('0x49')]=_[_0xd91b('0x4a')](_0x842b46['model'],_0x842b46[_0xd91b('0x48')]);_0x3741ef['attributes']=_[_0xd91b('0x4a')](_0x842b46[_0xd91b('0x46')],qs[_0xd91b('0x4c')](_0x21d377[_0xd91b('0x48')][_0xd91b('0x4c')]));_0x3741ef[_0xd91b('0x4b')]=_0x3741ef[_0xd91b('0x4b')]['length']?_0x3741ef['attributes']:_0x842b46['model'];_0x3741ef['order']=qs[_0xd91b('0x4e')](_0x21d377[_0xd91b('0x48')][_0xd91b('0x4e')]);_0x3741ef[_0xd91b('0x4f')]=qs[_0xd91b('0x49')](_[_0xd91b('0x50')](_0x21d377[_0xd91b('0x48')],_0x842b46[_0xd91b('0x49')]));if(_0x21d377['query'][_0xd91b('0x51')]){_0x3741ef['where']=_[_0xd91b('0x54')](_0x3741ef['where'],{'$or':_[_0xd91b('0x42')](_0x3741ef[_0xd91b('0x4b')],function(_0x405671){var _0x4a2e66={};_0x4a2e66[_0x405671]={'$like':'%'+_0x21d377[_0xd91b('0x48')][_0xd91b('0x51')]+'%'};return _0x4a2e66;})});}_0x3741ef=_['merge']({},_0x3741ef,_0x21d377[_0xd91b('0x55')]);return _0x3f6265[_0xd91b('0x110')](_0x3741ef);}})[_0xd91b('0x21')](function(_0x938074){if(_0x938074){_0x3f2701=_0x938074[_0xd91b('0x4d')];if(!_0x21d377[_0xd91b('0x48')]['hasOwnProperty'](_0xd91b('0x6b'))){_0x3741ef[_0xd91b('0x31')]=qs[_0xd91b('0x31')](_0x21d377[_0xd91b('0x48')][_0xd91b('0x31')]);_0x3741ef[_0xd91b('0x33')]=qs[_0xd91b('0x33')](_0x21d377[_0xd91b('0x48')]['offset']);}return _0x3f6265['getProactiveActions'](_0x3741ef);}})[_0xd91b('0x21')](function(_0x3d0b43){if(_0x3d0b43){return _0x3d0b43?{'count':_0x3f2701,'rows':_0x3d0b43}:null;}})['then'](respondWithResult(_0x383b12,null))[_0xd91b('0x2b')](handleError(_0x383b12,null));};exports[_0xd91b('0x124')]=function(_0x12bd3c,_0x5d7f21,_0x368b50){var _0x4fbf17=_0x12bd3c['query'][_0xd91b('0x125')]===_0xd91b('0x126')?'offlineForm':'onlineForm';return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'attributes':['id',_0x4fbf17],'where':{'id':_0x12bd3c[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x5d7f21,null))[_0xd91b('0x21')](function(_0x2205a9){if(_0x2205a9){var _0x481d3f=_0x2205a9[_0x4fbf17];var _0x5953fd=_0x481d3f&&_0x481d3f[_0xd91b('0x127')]?_0x481d3f['items']:[];_0x5d7f21[_0xd91b('0x3e')]({'fromKey':_[_0xd91b('0x7d')](_0x481d3f[_0xd91b('0x128')])?undefined:_0x481d3f[_0xd91b('0x128')],'count':_0x5953fd['length'],'rows':_0x5953fd});}})[_0xd91b('0x2b')](handleError(_0x5d7f21,null));};exports[_0xd91b('0x129')]=function(_0x458e07,_0x5ccb38,_0x3b5caf){var _0x225b02={'raw':![],'where':{}};var _0x256260={};var _0x5a1306={'count':0x0,'rows':[]};return db[_0xd91b('0x43')]['findOne']({'where':{'id':_0x458e07[_0xd91b('0x5b')]['id']}})['then'](handleEntityNotFound(_0x5ccb38,null))[_0xd91b('0x21')](function(_0x19d4be){if(_0x19d4be){_0x256260[_0xd91b('0x46')]=_['keys'](db[_0xd91b('0xda')][_0xd91b('0x44')]);_0x256260[_0xd91b('0x48')]=_['keys'](_0x458e07['query']);_0x256260['filters']=_[_0xd91b('0x4a')](_0x256260[_0xd91b('0x46')],_0x256260['query']);_0x225b02[_0xd91b('0x4b')]=_[_0xd91b('0x4a')](_0x256260[_0xd91b('0x46')],qs[_0xd91b('0x4c')](_0x458e07[_0xd91b('0x48')][_0xd91b('0x4c')]));_0x225b02['attributes']=_0x225b02['attributes'][_0xd91b('0x4d')]?_0x225b02[_0xd91b('0x4b')]:_0x256260[_0xd91b('0x46')];if(!_0x458e07[_0xd91b('0x48')][_0xd91b('0x6a')](_0xd91b('0x6b'))){_0x225b02['limit']=qs[_0xd91b('0x31')](_0x458e07['query']['limit']);_0x225b02[_0xd91b('0x33')]=qs['offset'](_0x458e07[_0xd91b('0x48')]['offset']);}_0x225b02['order']=qs[_0xd91b('0x4e')](_0x458e07[_0xd91b('0x48')][_0xd91b('0x4e')]);_0x225b02[_0xd91b('0x4f')]=qs[_0xd91b('0x49')](_[_0xd91b('0x50')](_0x458e07['query'],_0x256260['filters']));_0x225b02[_0xd91b('0x4f')]['ChatWebsiteId']=_0x19d4be['id'];if(_0x458e07[_0xd91b('0x48')][_0xd91b('0x51')]){_0x225b02[_0xd91b('0x4f')]=_['merge'](_0x225b02[_0xd91b('0x4f')],{'$or':_[_0xd91b('0x42')](_0x225b02[_0xd91b('0x4b')],function(_0x10264c){var _0x21f75e={};_0x21f75e[_0x10264c]={'$like':'%'+_0x458e07[_0xd91b('0x48')][_0xd91b('0x51')]+'%'};return _0x21f75e;})});}_0x225b02=_[_0xd91b('0x54')]({},_0x225b02,_0x458e07[_0xd91b('0x55')]);return db['ChatOfflineMessage'][_0xd91b('0x32')]({'where':_0x225b02[_0xd91b('0x4f')]})[_0xd91b('0x21')](function(_0x58309a){_0x5a1306[_0xd91b('0x32')]=_0x58309a;if(_0x458e07[_0xd91b('0x48')][_0xd91b('0x56')]){_0x225b02[_0xd91b('0x57')]=[{'all':!![]}];}else{_0x225b02[_0xd91b('0x57')]=[{'model':db[_0xd91b('0x8f')],'as':_0xd91b('0x12a'),'required':![]},{'model':db[_0xd91b('0xe0')],'as':_0xd91b('0x12b'),'required':![]}];}return db[_0xd91b('0xda')][_0xd91b('0x58')](_0x225b02);})['then'](function(_0x422ddb){_0x5a1306[_0xd91b('0x59')]=_0x422ddb;return _0x5a1306;});}})[_0xd91b('0x21')](respondWithFilteredResult(_0x5ccb38,_0x225b02))[_0xd91b('0x2b')](handleError(_0x5ccb38,null));};exports[_0xd91b('0x12c')]=function(_0x49e539,_0x4b7697,_0x2a7bae){return db[_0xd91b('0x43')][_0xd91b('0x5c')]({'where':{'id':_0x49e539[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x4b7697,null))[_0xd91b('0x21')](function(_0x1ac559){if(_0x1ac559){return _0x1ac559['addAgents'](_0x49e539[_0xd91b('0x64')][_0xd91b('0x6d')],_[_0xd91b('0xf9')](_0x49e539[_0xd91b('0x64')],[_0xd91b('0x6d'),'id'])||{})['spread'](function(_0x152d26){for(var _0x403f8c=0x0;_0x403f8c<_0x49e539[_0xd91b('0x64')]['ids'][_0xd91b('0x4d')];_0x403f8c+=0x1){socket[_0xd91b('0x12d')](_0xd91b('0x12e'),{'UserId':Number(_0x49e539[_0xd91b('0x64')][_0xd91b('0x6d')][_0x403f8c]),'ChatWebsiteId':Number(_0x49e539[_0xd91b('0x5b')]['id'])});}return _0x152d26;});}})[_0xd91b('0x21')](respondWithResult(_0x4b7697,null))[_0xd91b('0x2b')](handleError(_0x4b7697,null));};exports[_0xd91b('0x12f')]=function(_0x2cc933,_0x285afc,_0x1bd85c){return db['ChatWebsite']['find']({'where':{'id':_0x2cc933[_0xd91b('0x5b')]['id']}})[_0xd91b('0x21')](handleEntityNotFound(_0x285afc,null))['then'](function(_0x52704d){if(_0x52704d){return _0x52704d[_0xd91b('0x12f')](_0x2cc933[_0xd91b('0x48')][_0xd91b('0x6d')])[_0xd91b('0x21')](function(){if(_[_0xd91b('0x130')](_0x2cc933['query'][_0xd91b('0x6d')])){for(var _0x4f33fe=0x0;_0x4f33fe<_0x2cc933[_0xd91b('0x48')]['ids'][_0xd91b('0x4d')];_0x4f33fe+=0x1){socket[_0xd91b('0x12d')](_0xd91b('0x131'),{'UserId':Number(_0x2cc933['query']['ids'][_0x4f33fe]),'ChatWebsiteId':Number(_0x2cc933[_0xd91b('0x5b')]['id'])});}}else{socket[_0xd91b('0x12d')](_0xd91b('0x131'),{'UserId':Number(_0x2cc933[_0xd91b('0x48')][_0xd91b('0x6d')]),'ChatWebsiteId':Number(_0x2cc933[_0xd91b('0x5b')]['id'])});}});}})[_0xd91b('0x21')](respondWithStatusCode(_0x285afc,null))['catch'](handleError(_0x285afc,null));};exports[_0xd91b('0x132')]=function(_0x745f15,_0x310620,_0x3ce44e){var _0x204cb4={};var _0x290240={};var _0x42d938;var _0x16558a;return db[_0xd91b('0x43')][_0xd91b('0x69')]({'where':{'id':_0x745f15[_0xd91b('0x5b')]['id']}})['then'](handleEntityNotFound(_0x310620,null))[_0xd91b('0x21')](function(_0x4ad69c){if(_0x4ad69c){_0x42d938=_0x4ad69c;_0x290240[_0xd91b('0x46')]=_['keys'](db[_0xd91b('0xc6')][_0xd91b('0x44')]);_0x290240[_0xd91b('0x48')]=_['keys'](_0x745f15['query']);_0x290240['filters']=_['intersection'](_0x290240[_0xd91b('0x46')],_0x290240[_0xd91b('0x48')]);_0x204cb4['attributes']=_['intersection'](_0x290240[_0xd91b('0x46')],qs[_0xd91b('0x4c')](_0x745f15['query']['fields']));_0x204cb4[_0xd91b('0x4b')]=_0x204cb4[_0xd91b('0x4b')][_0xd91b('0x4d')]?_0x204cb4['attributes']:_0x290240[_0xd91b('0x46')];_0x204cb4[_0xd91b('0x70')]=qs[_0xd91b('0x4e')](_0x745f15[_0xd91b('0x48')][_0xd91b('0x4e')]);_0x204cb4[_0xd91b('0x4f')]=qs[_0xd91b('0x49')](_[_0xd91b('0x50')](_0x745f15[_0xd91b('0x48')],_0x290240['filters']));if(_0x745f15[_0xd91b('0x48')]['filter']){_0x204cb4['where']=_[_0xd91b('0x54')](_0x204cb4[_0xd91b('0x4f')],{'$or':_[_0xd91b('0x42')](_0x204cb4['attributes'],function(_0x1ad2f4){var _0x4f7a17={};_0x4f7a17[_0x1ad2f4]={'$like':'%'+_0x745f15[_0xd91b('0x48')][_0xd91b('0x51')]+'%'};return _0x4f7a17;})});}_0x204cb4=_[_0xd91b('0x54')]({},_0x204cb4,_0x745f15['options']);return _0x42d938[_0xd91b('0x132')](_0x204cb4);}})[_0xd91b('0x21')](function(_0x151779){if(_0x151779){_0x16558a=_0x151779['length'];if(!_0x745f15[_0xd91b('0x48')][_0xd91b('0x6a')](_0xd91b('0x6b'))){_0x204cb4[_0xd91b('0x31')]=qs[_0xd91b('0x31')](_0x745f15[_0xd91b('0x48')][_0xd91b('0x31')]);_0x204cb4[_0xd91b('0x33')]=qs[_0xd91b('0x33')](_0x745f15[_0xd91b('0x48')][_0xd91b('0x33')]);}return _0x42d938[_0xd91b('0x132')](_0x204cb4);}})['then'](function(_0x446708){if(_0x446708){return _0x446708?{'count':_0x16558a,'rows':_0x446708}:null;}})[_0xd91b('0x21')](respondWithResult(_0x310620,null))[_0xd91b('0x2b')](handleError(_0x310620,null));};
\ No newline at end of file
+var _0x9e66=['ChatInteraction','externalUrl','interaction','spread','contact','lastName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','ChatOfflineMessage','originalname','server','attachments','offline-chat','openNewInteraction','transaction','bulkCreate','MailServerOut','Smtp','forwardOffline','service','host','port','secure','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','mapValues','subjectOffline','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','render','alignment','verticalAlignment','textColor','color_button','backgroundColor','sequelize','findAndCountAll','getApplications','addProactiveActions','getFields','online','false','offlineForm','items','fromKey','Attachment','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','User','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','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','get','ChatWebsites','destroy','stack','name','send','Pause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','ChatWebsite','include','findAll','rows','show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','hasOwnProperty','order','ChatWebsiteId','Disposition','removeDispositions','ids','CannedAnswer','getAnswers','findOne','removeAnswers','addLogo','sitepic','addAvatar','agentAvatar','file','customerAvatar','filename','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','user-agent','getResult','Sequelize','ValidationError','createdAt','updatedAt','difference','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','ChatApplication','Applications','applications','list','priority','asc','account','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','format','device','vendor','stringify','threadId'];(function(_0x5c3315,_0x3fd991){var _0x5f0f2a=function(_0x322161){while(--_0x322161){_0x5c3315['push'](_0x5c3315['shift']());}};_0x5f0f2a(++_0x3fd991);}(_0x9e66,0x1ae));var _0x69e6=function(_0x481382,_0x166482){_0x481382=_0x481382-0x0;var _0x5d67ad=_0x9e66[_0x481382];return _0x5d67ad;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x69e6('0x0'));var jsonpatch=require(_0x69e6('0x1'));var rp=require(_0x69e6('0x2'));var moment=require(_0x69e6('0x3'));var BPromise=require(_0x69e6('0x4'));var Mustache=require(_0x69e6('0x5'));var util=require(_0x69e6('0x6'));var path=require(_0x69e6('0x7'));var sox=require(_0x69e6('0x8'));var csv=require(_0x69e6('0x9'));var ejs=require(_0x69e6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x69e6('0xb'));var squel=require(_0x69e6('0xc'));var crypto=require(_0x69e6('0xd'));var jsforce=require(_0x69e6('0xe'));var deskjs=require(_0x69e6('0xf'));var toCsv=require(_0x69e6('0x9'));var querystring=require(_0x69e6('0x10'));var Papa=require(_0x69e6('0x11'));var Redis=require(_0x69e6('0x12'));var authService=require(_0x69e6('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x69e6('0x14'));var logger=require(_0x69e6('0x15'))(_0x69e6('0x16'));var utils=require(_0x69e6('0x17'));var config=require(_0x69e6('0x18'));var licenseUtil=require(_0x69e6('0x19'));var db=require('../../mysqldb')['db'];config[_0x69e6('0x1a')]=_[_0x69e6('0x1b')](config[_0x69e6('0x1a')],{'host':_0x69e6('0x1c'),'port':0x18eb});var socket=require(_0x69e6('0x1d'))(new Redis(config[_0x69e6('0x1a')]));require('./chatWebsite.socket')[_0x69e6('0x1e')](socket);var jayson=require(_0x69e6('0x1f'));var client=jayson['client'][_0x69e6('0x20')]({'port':0x232c});var client9002=jayson[_0x69e6('0x21')][_0x69e6('0x20')]({'port':0x232a});var client9003=jayson[_0x69e6('0x21')]['http']({'port':0x232b});var client9001=jayson[_0x69e6('0x21')][_0x69e6('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x47479e,_0x3d9095,_0x303c53,_0x331928){return new BPromise(function(_0xa2726c,_0x12c3b2){var _0x442c27=_0x331928||client;return _0x442c27[_0x69e6('0x22')](_0x47479e,_0x303c53)[_0x69e6('0x23')](function(_0x2924f0){logger[_0x69e6('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x3d9095,_0x69e6('0x25'));logger[_0x69e6('0x26')](_0x69e6('0x27'),_0x3d9095,'request\x20sent',JSON['stringify'](_0x2924f0));if(_0x2924f0[_0x69e6('0x28')]){if(_0x2924f0[_0x69e6('0x28')][_0x69e6('0x29')]===0x1f4){logger['error'](_0x69e6('0x2a'),_0x3d9095,_0x2924f0['error'][_0x69e6('0x2b')]);return _0x12c3b2(_0x2924f0[_0x69e6('0x28')][_0x69e6('0x2b')]);}logger[_0x69e6('0x28')](_0x69e6('0x2a'),_0x3d9095,_0x2924f0[_0x69e6('0x28')][_0x69e6('0x2b')]);return _0xa2726c(_0x2924f0[_0x69e6('0x28')][_0x69e6('0x2b')]);}else{logger[_0x69e6('0x24')](_0x69e6('0x2a'),_0x3d9095,_0x69e6('0x25'));_0xa2726c(_0x2924f0['result'][_0x69e6('0x2b')]);}})[_0x69e6('0x2c')](function(_0x28089e){logger['error'](_0x69e6('0x2a'),_0x3d9095,_0x28089e);_0x12c3b2(_0x28089e);});});}function respondWithStatusCode(_0xfba6d3,_0xbede29){_0xbede29=_0xbede29||0xcc;return function(_0x56af4d){if(_0x56af4d){return _0xfba6d3[_0x69e6('0x2d')](_0xbede29);}return _0xfba6d3[_0x69e6('0x2e')](_0xbede29)[_0x69e6('0x2f')]();};}function respondWithResult(_0x1f6987,_0x2baf4b){_0x2baf4b=_0x2baf4b||0xc8;return function(_0x125f4f){if(_0x125f4f){return _0x1f6987['status'](_0x2baf4b)[_0x69e6('0x30')](_0x125f4f);}};}function respondWithFilteredResult(_0x325e02,_0x2f82a5){return function(_0x2a0d28){if(_0x2a0d28){var _0xa110ed=typeof _0x2f82a5['offset']===_0x69e6('0x31')&&typeof _0x2f82a5[_0x69e6('0x32')]===_0x69e6('0x31');var _0x224556=_0x2a0d28[_0x69e6('0x33')];var _0x33e373=_0xa110ed?0x0:_0x2f82a5['offset'];var _0x56e075=_0xa110ed?_0x2a0d28[_0x69e6('0x33')]:_0x2f82a5[_0x69e6('0x34')]+_0x2f82a5['limit'];var _0x4b56d1;if(_0x56e075>=_0x224556){_0x56e075=_0x224556;_0x4b56d1=0xc8;}else{_0x4b56d1=0xce;}_0x325e02[_0x69e6('0x2e')](_0x4b56d1);return _0x325e02[_0x69e6('0x35')](_0x69e6('0x36'),_0x33e373+'-'+_0x56e075+'/'+_0x224556)[_0x69e6('0x30')](_0x2a0d28);}return null;};}function patchUpdates(_0x23cbd8){return function(_0x300208){try{jsonpatch[_0x69e6('0x37')](_0x300208,_0x23cbd8,!![]);}catch(_0x18d399){return BPromise[_0x69e6('0x38')](_0x18d399);}return _0x300208[_0x69e6('0x39')]();};}function saveUpdates(_0x35d139,_0x3fb1cc){return function(_0xd9bcfe){if(_0xd9bcfe){return _0xd9bcfe[_0x69e6('0x3a')](_0x35d139)[_0x69e6('0x23')](function(_0xffbdc2){return _0xffbdc2;});}return null;};}function removeEntity(_0x430f64,_0x412260){return function(_0x3f24f0){if(_0x3f24f0){return _0x3f24f0['destroy']()[_0x69e6('0x23')](function(){var _0x107fc1=_0x3f24f0[_0x69e6('0x3b')]({'plain':!![]});var _0x3a3f86=_0x69e6('0x3c');return db['UserProfileResource'][_0x69e6('0x3d')]({'where':{'type':_0x3a3f86,'resourceId':_0x107fc1['id']}})[_0x69e6('0x23')](function(){return _0x3f24f0;});})[_0x69e6('0x23')](function(){_0x430f64[_0x69e6('0x2e')](0xcc)[_0x69e6('0x2f')]();});}};}function handleEntityNotFound(_0x1816b5,_0x1b374a){return function(_0x14b320){if(!_0x14b320){_0x1816b5[_0x69e6('0x2d')](0x194);}return _0x14b320;};}function handleError(_0x455f6b,_0x12fbdc){_0x12fbdc=_0x12fbdc||0x1f4;return function(_0x55100b){logger[_0x69e6('0x28')](_0x55100b[_0x69e6('0x3e')]);if(_0x55100b[_0x69e6('0x3f')]){delete _0x55100b[_0x69e6('0x3f')];}_0x455f6b[_0x69e6('0x2e')](_0x12fbdc)[_0x69e6('0x40')](_0x55100b);};}exports['index']=function(_0x34eb65,_0x257cc7){var _0x4ff9f6={'include':[{'model':db[_0x69e6('0x41')],'as':'mandatoryDispositionPause'}]},_0x34ddd6={},_0x3ba0c8={'count':0x0,'rows':[]};var _0x4d1997=_[_0x69e6('0x42')](db['ChatWebsite'][_0x69e6('0x43')],function(_0x3e4f20){return{'name':_0x3e4f20[_0x69e6('0x44')],'type':_0x3e4f20[_0x69e6('0x45')][_0x69e6('0x46')]};});_0x34ddd6[_0x69e6('0x47')]=_['map'](_0x4d1997,_0x69e6('0x3f'));_0x34ddd6[_0x69e6('0x48')]=_[_0x69e6('0x49')](_0x34eb65[_0x69e6('0x48')]);_0x34ddd6[_0x69e6('0x4a')]=_[_0x69e6('0x4b')](_0x34ddd6['model'],_0x34ddd6[_0x69e6('0x48')]);_0x4ff9f6[_0x69e6('0x4c')]=_[_0x69e6('0x4b')](_0x34ddd6[_0x69e6('0x47')],qs[_0x69e6('0x4d')](_0x34eb65['query'][_0x69e6('0x4d')]));_0x4ff9f6['attributes']=_0x4ff9f6[_0x69e6('0x4c')][_0x69e6('0x4e')]?_0x4ff9f6['attributes']:_0x34ddd6[_0x69e6('0x47')];if(!_0x34eb65[_0x69e6('0x48')]['hasOwnProperty'](_0x69e6('0x4f'))){_0x4ff9f6[_0x69e6('0x32')]=qs[_0x69e6('0x32')](_0x34eb65[_0x69e6('0x48')][_0x69e6('0x32')]);_0x4ff9f6[_0x69e6('0x34')]=qs['offset'](_0x34eb65[_0x69e6('0x48')][_0x69e6('0x34')]);}_0x4ff9f6['order']=qs[_0x69e6('0x50')](_0x34eb65[_0x69e6('0x48')][_0x69e6('0x50')]);_0x4ff9f6[_0x69e6('0x51')]=qs[_0x69e6('0x4a')](_[_0x69e6('0x52')](_0x34eb65[_0x69e6('0x48')],_0x34ddd6[_0x69e6('0x4a')]),_0x4d1997);if(_0x34eb65[_0x69e6('0x48')][_0x69e6('0x53')]){_0x4ff9f6['where']=_['merge'](_0x4ff9f6['where'],{'$or':_[_0x69e6('0x42')](_0x4d1997,function(_0x23a52a){if(_0x23a52a['type']!==_0x69e6('0x54')){var _0x5cffe5={};_0x5cffe5[_0x23a52a[_0x69e6('0x3f')]]={'$like':'%'+_0x34eb65[_0x69e6('0x48')][_0x69e6('0x53')]+'%'};return _0x5cffe5;}})});}_0x4ff9f6=_[_0x69e6('0x55')]({},_0x4ff9f6,_0x34eb65[_0x69e6('0x56')]);var _0x131724={'where':_0x4ff9f6['where']};return db[_0x69e6('0x57')]['count'](_0x131724)[_0x69e6('0x23')](function(_0x410045){_0x3ba0c8[_0x69e6('0x33')]=_0x410045;if(_0x34eb65[_0x69e6('0x48')]['includeAll']){_0x4ff9f6[_0x69e6('0x58')]=[{'all':!![]}];}return db[_0x69e6('0x57')][_0x69e6('0x59')](_0x4ff9f6);})[_0x69e6('0x23')](function(_0x2a8175){_0x3ba0c8[_0x69e6('0x5a')]=_0x2a8175;return _0x3ba0c8;})[_0x69e6('0x23')](respondWithFilteredResult(_0x257cc7,_0x4ff9f6))['catch'](handleError(_0x257cc7,null));};exports[_0x69e6('0x5b')]=function(_0xde850d,_0x36a0f7){var _0x31a172={'raw':![],'where':{'id':_0xde850d[_0x69e6('0x5c')]['id']},'include':[{'model':db[_0x69e6('0x41')],'as':'mandatoryDispositionPause'}]},_0x35ac24={};_0x35ac24[_0x69e6('0x47')]=_[_0x69e6('0x49')](db[_0x69e6('0x57')][_0x69e6('0x43')]);_0x35ac24[_0x69e6('0x48')]=_[_0x69e6('0x49')](_0xde850d['query']);_0x35ac24[_0x69e6('0x4a')]=_[_0x69e6('0x4b')](_0x35ac24['model'],_0x35ac24['query']);_0x31a172['attributes']=_[_0x69e6('0x4b')](_0x35ac24[_0x69e6('0x47')],qs[_0x69e6('0x4d')](_0xde850d[_0x69e6('0x48')][_0x69e6('0x4d')]));_0x31a172[_0x69e6('0x4c')]=_0x31a172[_0x69e6('0x4c')][_0x69e6('0x4e')]?_0x31a172[_0x69e6('0x4c')]:_0x35ac24[_0x69e6('0x47')];if(_0xde850d['query'][_0x69e6('0x5d')]){_0x31a172[_0x69e6('0x58')]=[{'all':!![]}];}_0x31a172=_[_0x69e6('0x55')]({},_0x31a172,_0xde850d[_0x69e6('0x56')]);return db['ChatWebsite'][_0x69e6('0x5e')](_0x31a172)[_0x69e6('0x23')](handleEntityNotFound(_0x36a0f7,null))[_0x69e6('0x23')](respondWithResult(_0x36a0f7,null))['catch'](handleError(_0x36a0f7,null));};exports[_0x69e6('0x5f')]=function(_0x23ac0e,_0x4ab3c8){return db[_0x69e6('0x57')][_0x69e6('0x5f')](_0x23ac0e[_0x69e6('0x60')],{})[_0x69e6('0x23')](function(_0x19174e){var _0x2bc126=_0x23ac0e['user']['get']({'plain':!![]});if(!_0x2bc126)throw new Error(_0x69e6('0x61'));if(_0x2bc126['role']===_0x69e6('0x62')){var _0x491371=_0x19174e[_0x69e6('0x3b')]({'plain':!![]});var _0x2aa8e5=_0x69e6('0x3c');return db[_0x69e6('0x63')][_0x69e6('0x5e')]({'where':{'name':_0x2aa8e5,'userProfileId':_0x2bc126['userProfileId']},'raw':!![]})[_0x69e6('0x23')](function(_0x45614e){if(_0x45614e&&_0x45614e[_0x69e6('0x64')]===0x0){return db[_0x69e6('0x65')][_0x69e6('0x5f')]({'name':_0x491371[_0x69e6('0x3f')],'resourceId':_0x491371['id'],'type':_0x45614e[_0x69e6('0x3f')],'sectionId':_0x45614e['id']},{})[_0x69e6('0x23')](function(){return _0x19174e;});}else{return _0x19174e;}})['catch'](function(_0xa292a){logger[_0x69e6('0x28')](_0x69e6('0x66'),_0xa292a);throw _0xa292a;});}return _0x19174e;})[_0x69e6('0x23')](respondWithResult(_0x4ab3c8,0xc9))['catch'](handleError(_0x4ab3c8,null));};exports[_0x69e6('0x3a')]=function(_0x5c4a83,_0x5e7afb){if(_0x5c4a83[_0x69e6('0x60')]['id']){delete _0x5c4a83[_0x69e6('0x60')]['id'];}return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x5c4a83[_0x69e6('0x5c')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x69e6('0x23')](handleEntityNotFound(_0x5e7afb,null))['then'](saveUpdates(_0x5c4a83[_0x69e6('0x60')],null))[_0x69e6('0x23')](respondWithResult(_0x5e7afb,null))[_0x69e6('0x2c')](handleError(_0x5e7afb,null));};exports[_0x69e6('0x3d')]=function(_0x134a2b,_0x4940a4){return db['ChatWebsite'][_0x69e6('0x5e')]({'where':{'id':_0x134a2b[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x4940a4,null))[_0x69e6('0x23')](removeEntity(_0x4940a4,null))['catch'](handleError(_0x4940a4,null));};exports[_0x69e6('0x67')]=function(_0x5ba207,_0x44af05){return db[_0x69e6('0x57')]['describe']()[_0x69e6('0x23')](respondWithResult(_0x44af05,null))[_0x69e6('0x2c')](handleError(_0x44af05,null));};exports[_0x69e6('0x68')]=function(_0x279c22,_0x36faa8,_0x3ff3d3){if(_0x279c22[_0x69e6('0x60')]['id']){delete _0x279c22['body']['id'];}return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x279c22[_0x69e6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x36faa8,null))[_0x69e6('0x23')](function(_0x543bdf){if(_0x543bdf){_0x279c22[_0x69e6('0x60')]['ChatWebsiteId']=_0x543bdf['id'];return db['Disposition'][_0x69e6('0x5f')](_0x279c22[_0x69e6('0x60')]);}})[_0x69e6('0x23')](respondWithResult(_0x36faa8,null))[_0x69e6('0x2c')](handleError(_0x36faa8,null));};exports['getDispositions']=function(_0x3f30e7,_0x4bea2e,_0xccf9bf){var _0xdb491a={'raw':![],'where':{}};var _0x241b86={};var _0x35116f={'count':0x0,'rows':[]};return db[_0x69e6('0x57')]['findOne']({'where':{'id':_0x3f30e7[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x4bea2e,null))['then'](function(_0xad3a20){if(_0xad3a20){_0x241b86[_0x69e6('0x47')]=_['keys'](db['Disposition'][_0x69e6('0x43')]);_0x241b86[_0x69e6('0x48')]=_['keys'](_0x3f30e7['query']);_0x241b86[_0x69e6('0x4a')]=_[_0x69e6('0x4b')](_0x241b86[_0x69e6('0x47')],_0x241b86[_0x69e6('0x48')]);_0xdb491a[_0x69e6('0x4c')]=_[_0x69e6('0x4b')](_0x241b86['model'],qs[_0x69e6('0x4d')](_0x3f30e7['query'][_0x69e6('0x4d')]));_0xdb491a[_0x69e6('0x4c')]=_0xdb491a[_0x69e6('0x4c')][_0x69e6('0x4e')]?_0xdb491a[_0x69e6('0x4c')]:_0x241b86[_0x69e6('0x47')];if(!_0x3f30e7[_0x69e6('0x48')][_0x69e6('0x69')](_0x69e6('0x4f'))){_0xdb491a[_0x69e6('0x32')]=qs[_0x69e6('0x32')](_0x3f30e7['query'][_0x69e6('0x32')]);_0xdb491a[_0x69e6('0x34')]=qs[_0x69e6('0x34')](_0x3f30e7[_0x69e6('0x48')]['offset']);}_0xdb491a[_0x69e6('0x6a')]=qs[_0x69e6('0x50')](_0x3f30e7[_0x69e6('0x48')][_0x69e6('0x50')]);_0xdb491a[_0x69e6('0x51')]=qs[_0x69e6('0x4a')](_[_0x69e6('0x52')](_0x3f30e7[_0x69e6('0x48')],_0x241b86['filters']));_0xdb491a[_0x69e6('0x51')][_0x69e6('0x6b')]=_0xad3a20['id'];if(_0x3f30e7[_0x69e6('0x48')][_0x69e6('0x53')]){_0xdb491a[_0x69e6('0x51')]=_[_0x69e6('0x55')](_0xdb491a[_0x69e6('0x51')],{'$or':_[_0x69e6('0x42')](_0xdb491a[_0x69e6('0x4c')],function(_0x39bf68){var _0x286eba={};_0x286eba[_0x39bf68]={'$like':'%'+_0x3f30e7[_0x69e6('0x48')]['filter']+'%'};return _0x286eba;})});}_0xdb491a=_[_0x69e6('0x55')]({},_0xdb491a,_0x3f30e7[_0x69e6('0x56')]);return db[_0x69e6('0x6c')]['count']({'where':_0xdb491a[_0x69e6('0x51')]})[_0x69e6('0x23')](function(_0x129e6b){_0x35116f[_0x69e6('0x33')]=_0x129e6b;if(_0x3f30e7['query']['includeAll']){_0xdb491a[_0x69e6('0x58')]=[{'all':!![]}];}return db[_0x69e6('0x6c')]['findAll'](_0xdb491a);})['then'](function(_0xb6476b){_0x35116f['rows']=_0xb6476b;return _0x35116f;});}})['then'](respondWithFilteredResult(_0x4bea2e,_0xdb491a))[_0x69e6('0x2c')](handleError(_0x4bea2e,null));};exports[_0x69e6('0x6d')]=function(_0x47eea2,_0xac1e6d,_0x195042){return db['ChatWebsite'][_0x69e6('0x5e')]({'where':{'id':_0x47eea2['params']['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0xac1e6d,null))[_0x69e6('0x23')](function(_0x5a8d98){if(_0x5a8d98){return _0x5a8d98[_0x69e6('0x6d')](_0x47eea2[_0x69e6('0x48')][_0x69e6('0x6e')]);}})['then'](respondWithStatusCode(_0xac1e6d,null))[_0x69e6('0x2c')](handleError(_0xac1e6d,null));};exports['addAnswer']=function(_0x5249a1,_0x2e8923,_0x49d516){if(_0x5249a1['body']['id']){delete _0x5249a1['body']['id'];}return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x5249a1[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x2e8923,null))[_0x69e6('0x23')](function(_0x22926){if(_0x22926){_0x5249a1[_0x69e6('0x60')][_0x69e6('0x6b')]=_0x22926['id'];return db[_0x69e6('0x6f')][_0x69e6('0x5f')](_0x5249a1[_0x69e6('0x60')]);}})[_0x69e6('0x23')](respondWithResult(_0x2e8923,null))[_0x69e6('0x2c')](handleError(_0x2e8923,null));};exports[_0x69e6('0x70')]=function(_0x30cd2f,_0x3815a2,_0x2f8102){var _0xaf48db={'raw':![],'where':{}};var _0x428aac={};var _0x510bd6={'count':0x0,'rows':[]};return db[_0x69e6('0x57')][_0x69e6('0x71')]({'where':{'id':_0x30cd2f[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x3815a2,null))['then'](function(_0x454ed6){if(_0x454ed6){_0x428aac['model']=_[_0x69e6('0x49')](db['CannedAnswer'][_0x69e6('0x43')]);_0x428aac[_0x69e6('0x48')]=_['keys'](_0x30cd2f[_0x69e6('0x48')]);_0x428aac[_0x69e6('0x4a')]=_['intersection'](_0x428aac[_0x69e6('0x47')],_0x428aac['query']);_0xaf48db[_0x69e6('0x4c')]=_[_0x69e6('0x4b')](_0x428aac[_0x69e6('0x47')],qs[_0x69e6('0x4d')](_0x30cd2f['query'][_0x69e6('0x4d')]));_0xaf48db[_0x69e6('0x4c')]=_0xaf48db[_0x69e6('0x4c')][_0x69e6('0x4e')]?_0xaf48db[_0x69e6('0x4c')]:_0x428aac['model'];if(!_0x30cd2f[_0x69e6('0x48')][_0x69e6('0x69')](_0x69e6('0x4f'))){_0xaf48db[_0x69e6('0x32')]=qs[_0x69e6('0x32')](_0x30cd2f['query'][_0x69e6('0x32')]);_0xaf48db['offset']=qs[_0x69e6('0x34')](_0x30cd2f['query'][_0x69e6('0x34')]);}_0xaf48db[_0x69e6('0x6a')]=qs[_0x69e6('0x50')](_0x30cd2f[_0x69e6('0x48')][_0x69e6('0x50')]);_0xaf48db[_0x69e6('0x51')]=qs[_0x69e6('0x4a')](_['pick'](_0x30cd2f[_0x69e6('0x48')],_0x428aac[_0x69e6('0x4a')]));_0xaf48db[_0x69e6('0x51')]['ChatWebsiteId']=_0x454ed6['id'];if(_0x30cd2f[_0x69e6('0x48')][_0x69e6('0x53')]){_0xaf48db['where']=_[_0x69e6('0x55')](_0xaf48db[_0x69e6('0x51')],{'$or':_['map'](_0xaf48db[_0x69e6('0x4c')],function(_0x29f9a1){var _0x203366={};_0x203366[_0x29f9a1]={'$like':'%'+_0x30cd2f['query']['filter']+'%'};return _0x203366;})});}_0xaf48db=_[_0x69e6('0x55')]({},_0xaf48db,_0x30cd2f[_0x69e6('0x56')]);return db[_0x69e6('0x6f')][_0x69e6('0x33')]({'where':_0xaf48db[_0x69e6('0x51')]})[_0x69e6('0x23')](function(_0x29d8ca){_0x510bd6[_0x69e6('0x33')]=_0x29d8ca;if(_0x30cd2f[_0x69e6('0x48')][_0x69e6('0x5d')]){_0xaf48db[_0x69e6('0x58')]=[{'all':!![]}];}return db[_0x69e6('0x6f')][_0x69e6('0x59')](_0xaf48db);})[_0x69e6('0x23')](function(_0x3cb6e3){_0x510bd6[_0x69e6('0x5a')]=_0x3cb6e3;return _0x510bd6;});}})[_0x69e6('0x23')](respondWithFilteredResult(_0x3815a2,_0xaf48db))[_0x69e6('0x2c')](handleError(_0x3815a2,null));};exports[_0x69e6('0x72')]=function(_0x2647bf,_0x137876,_0x35614b){return db['ChatWebsite']['find']({'where':{'id':_0x2647bf[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x137876,null))[_0x69e6('0x23')](function(_0x5d4002){if(_0x5d4002){return _0x5d4002['removeAnswers'](_0x2647bf[_0x69e6('0x48')]['ids']);}})[_0x69e6('0x23')](respondWithStatusCode(_0x137876,null))['catch'](handleError(_0x137876,null));};exports[_0x69e6('0x73')]=function(_0x76a517,_0xbbb7f0,_0x4b43cc){_0x76a517[_0x69e6('0x60')][_0x69e6('0x74')]=_0x76a517['file']['filename'];return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x76a517['params']['id']}})['then'](handleEntityNotFound(_0xbbb7f0,null))['then'](saveUpdates(_0x76a517[_0x69e6('0x60')],null))[_0x69e6('0x23')](respondWithResult(_0xbbb7f0,null))['catch'](handleError(_0xbbb7f0,null));};exports[_0x69e6('0x75')]=function(_0x168caf,_0x2dac45,_0x3387da){_0x168caf['body'][_0x69e6('0x76')]=_0x168caf[_0x69e6('0x77')]['filename'];return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x168caf[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x2dac45,null))[_0x69e6('0x23')](saveUpdates(_0x168caf['body'],null))['then'](respondWithResult(_0x2dac45,null))['catch'](handleError(_0x2dac45,null));};exports['addCustomerAvatar']=function(_0x4639fb,_0x3acfef,_0x5a164c){_0x4639fb[_0x69e6('0x60')][_0x69e6('0x78')]=_0x4639fb[_0x69e6('0x77')][_0x69e6('0x79')];return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x4639fb['params']['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x3acfef,null))[_0x69e6('0x23')](saveUpdates(_0x4639fb['body'],null))['then'](respondWithResult(_0x3acfef,null))['catch'](handleError(_0x3acfef,null));};exports[_0x69e6('0x7a')]=function(_0x52325d,_0x509577,_0x19980e){_0x52325d[_0x69e6('0x60')][_0x69e6('0x7b')]=_0x52325d[_0x69e6('0x77')][_0x69e6('0x79')];return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x52325d[_0x69e6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x509577,null))[_0x69e6('0x23')](saveUpdates(_0x52325d[_0x69e6('0x60')],null))[_0x69e6('0x23')](respondWithResult(_0x509577,null))[_0x69e6('0x2c')](handleError(_0x509577,null));};exports['getLogo']=function(_0x4c7346,_0xf684e8,_0x56d07c){var _0x1340ea=path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],_0x69e6('0x7e'));var _0x61c17e={'where':{'id':_0x4c7346[_0x69e6('0x5c')]['id']},'attributes':['id',_0x69e6('0x74')],'raw':!![]};var _0x30e3a1=![];return require(_0x69e6('0x19'))[_0x69e6('0x7f')]()[_0x69e6('0x23')](function(_0x3b764b){if(_0x3b764b){_0x30e3a1=_0x3b764b[_0x69e6('0x80')];}})['then'](function(){return db['ChatWebsite'][_0x69e6('0x5e')](_0x61c17e);})[_0x69e6('0x23')](handleEntityNotFound(_0xf684e8,null))[_0x69e6('0x23')](function(_0x18bf0e){if(_0x18bf0e){if(!_[_0x69e6('0x81')](_0x18bf0e[_0x69e6('0x74')])){if(fs[_0x69e6('0x82')](path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],'server/files/images/logos/',_0x18bf0e[_0x69e6('0x74')]))&&_0x30e3a1){_0x1340ea=path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],_0x69e6('0x83'),_0x18bf0e['sitepic']);}}return _0xf684e8['download'](_0x1340ea);}})[_0x69e6('0x2c')](handleError(_0xf684e8,null));};exports[_0x69e6('0x84')]=function(_0x4184b9,_0x37b1e9,_0x2d4521){var _0x7d5217=path['join'](config[_0x69e6('0x7d')],_0x69e6('0x85'));var _0xedc90c={'where':{'id':_0x4184b9[_0x69e6('0x5c')]['id']},'attributes':['id',_0x69e6('0x76')],'raw':!![]};return db['ChatWebsite']['find'](_0xedc90c)[_0x69e6('0x23')](handleEntityNotFound(_0x37b1e9,null))[_0x69e6('0x23')](function(_0x23a9b6){if(_0x23a9b6){if(!_[_0x69e6('0x81')](_0x23a9b6[_0x69e6('0x76')])){if(fs['existsSync'](path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],'server/files/images/avatars/',_0x23a9b6[_0x69e6('0x76')]))){_0x7d5217=path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],_0x69e6('0x86'),_0x23a9b6['agentAvatar']);}}return _0x37b1e9[_0x69e6('0x87')](_0x7d5217);}})['catch'](handleError(_0x37b1e9,null));};exports['getCustomerAvatar']=function(_0x16b205,_0x1cb150,_0x260a8f){var _0xcc28eb=path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],_0x69e6('0x88'));var _0x4af6fd={'where':{'id':_0x16b205[_0x69e6('0x5c')]['id']},'attributes':['id',_0x69e6('0x78'),_0x69e6('0x89')],'raw':!![]};return db['ChatWebsite'][_0x69e6('0x5e')](_0x4af6fd)[_0x69e6('0x23')](handleEntityNotFound(_0x1cb150,null))[_0x69e6('0x23')](function(_0x470482){if(_0x470482){if(!_['isNil'](_0x470482[_0x69e6('0x78')])){if(fs['existsSync'](path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],_0x69e6('0x86'),_0x470482['customerAvatar']))&&_0x470482[_0x69e6('0x89')]){_0xcc28eb=path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],_0x69e6('0x86'),_0x470482[_0x69e6('0x78')]);}}return _0x1cb150[_0x69e6('0x87')](_0xcc28eb);}})['catch'](handleError(_0x1cb150,null));};exports[_0x69e6('0x8a')]=function(_0x3a3ac8,_0x29bad2,_0x41edbf){var _0x15e1b3=path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],_0x69e6('0x8b'));var _0x4b24a6={'where':{'id':_0x3a3ac8[_0x69e6('0x5c')]['id']},'attributes':['id',_0x69e6('0x7b')],'raw':!![]};return db[_0x69e6('0x57')][_0x69e6('0x5e')](_0x4b24a6)[_0x69e6('0x23')](handleEntityNotFound(_0x29bad2,null))[_0x69e6('0x23')](function(_0x2005ec){if(_0x2005ec){if(!_[_0x69e6('0x81')](_0x2005ec[_0x69e6('0x7b')])){if(fs[_0x69e6('0x82')](path['join'](config[_0x69e6('0x7d')],_0x69e6('0x86'),_0x2005ec[_0x69e6('0x7b')]))){_0x15e1b3=path['join'](config[_0x69e6('0x7d')],_0x69e6('0x86'),_0x2005ec[_0x69e6('0x7b')]);}}return _0x29bad2['download'](_0x15e1b3);}})[_0x69e6('0x2c')](handleError(_0x29bad2,null));};exports['notify']=function(_0x3db9e8,_0x977483,_0x556850){var _0x107162=require(_0x69e6('0x8c'));var _0x483b39=new _0x107162();var _0x24f0fb=_0x483b39[_0x69e6('0x8d')](_0x3db9e8[_0x69e6('0x8e')][_0x69e6('0x8f')])[_0x69e6('0x90')]();var _0x58e1e3={'body':_0x3db9e8[_0x69e6('0x60')],'channel':'chat'};var _0x167f27=[];var _0x3046a8=[];var _0x34fd40={};var _0x306995=![];return db['CmContact'][_0x69e6('0x67')]()['then'](function(_0x35eff4){if(!_0x35eff4){throw new db[(_0x69e6('0x91'))][(_0x69e6('0x92'))]('no\x20available\x20attributes');}_0x167f27=_['difference'](_[_0x69e6('0x49')](_0x35eff4),[_0x69e6('0x93'),_0x69e6('0x94')]);_0x3046a8=_[_0x69e6('0x95')](_[_0x69e6('0x49')](_0x35eff4),[_0x69e6('0x93'),_0x69e6('0x94'),_0x69e6('0x96'),_0x69e6('0x97')]);if(_0x3db9e8['body']['id']){delete _0x3db9e8[_0x69e6('0x60')]['id'];}if(_[_0x69e6('0x81')](_0x3db9e8[_0x69e6('0x60')][_0x69e6('0x98')])){throw new db['Sequelize'][(_0x69e6('0x92'))](_0x69e6('0x99'));}if(_[_0x69e6('0x81')](_0x3db9e8[_0x69e6('0x60')][_0x69e6('0x60')])||_0x3db9e8['body'][_0x69e6('0x60')]===''){throw new db[(_0x69e6('0x91'))][(_0x69e6('0x92'))](_0x69e6('0x9a'));}if(_['isNil'](_0x3db9e8['body'][_0x69e6('0x9b')])){throw new db[(_0x69e6('0x91'))][(_0x69e6('0x92'))](_0x69e6('0x9c')+_0x3046a8);}if(!_[_0x69e6('0x9d')](_0x3046a8,_0x3db9e8[_0x69e6('0x60')][_0x69e6('0x9b')])){throw new db['Sequelize'][(_0x69e6('0x92'))](_0x69e6('0x9e')+_0x3046a8);}_0x34fd40[_0x3db9e8[_0x69e6('0x60')][_0x69e6('0x9b')]]=_0x3db9e8['body'][_0x69e6('0x98')];})[_0x69e6('0x23')](function(){return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x3db9e8[_0x69e6('0x5c')]['id']},'include':[{'model':db[_0x69e6('0x9f')],'as':_0x69e6('0xa0'),'include':[{'model':db[_0x69e6('0xa1')],'as':_0x69e6('0xa2'),'where':_0x34fd40,'limit':0x1,'order':[[_0x69e6('0x94'),_0x69e6('0xa3')]]}]},{'model':db[_0x69e6('0xa4')],'as':_0x69e6('0xa5')}]});})[_0x69e6('0x23')](handleEntityNotFound(_0x977483,null))[_0x69e6('0x23')](function(_0xf6fe21){if(_0xf6fe21&&_0xf6fe21[_0x69e6('0xa0')]){_0x58e1e3['account']=_0xf6fe21;_0x58e1e3[_0x69e6('0xa6')]=_0xf6fe21[_0x69e6('0xa5')];_0x58e1e3[_0x69e6('0xa7')]=_0xf6fe21[_0x69e6('0xa0')];_0x58e1e3[_0x69e6('0xa6')]=_['orderBy'](_0x58e1e3[_0x69e6('0xa6')],[_0x69e6('0xa8')],[_0x69e6('0xa9')]);if(_0x58e1e3[_0x69e6('0xaa')][_0x69e6('0xa5')]){delete _0x58e1e3['account'][_0x69e6('0xa5')];}if(_0x58e1e3[_0x69e6('0xaa')][_0x69e6('0xa0')]&&_0x58e1e3[_0x69e6('0xaa')]['List'][_0x69e6('0xa2')][_0x69e6('0x4e')]){return _0x58e1e3['account'][_0x69e6('0xa0')]['Contacts'][0x0];}var _0x3bcb36=_[_0x69e6('0x1b')](_0x3db9e8[_0x69e6('0x60')],{'firstName':_0x3db9e8['body'][_0x69e6('0x98')],'ListId':_0xf6fe21['ListId']});_0x3bcb36[_0x3db9e8['body'][_0x69e6('0x9b')]]=_0x3db9e8[_0x69e6('0x60')][_0x69e6('0x98')];return db['CmContact'][_0x69e6('0x5f')](_0x3bcb36,{'fields':_0x167f27,'raw':!![]});}})['then'](handleEntityNotFound(_0x977483,null))['then'](function(_0x4fabe5){_0x58e1e3['contact']=_0x4fabe5;var _0x5cb752=_0x3db9e8['body'][_0x69e6('0xab')];if(_0x3db9e8[_0x69e6('0x8e')][_0x69e6('0xac')]){_0x5cb752=_0x3db9e8[_0x69e6('0x8e')][_0x69e6('0xac')];}else if(_0x3db9e8[_0x69e6('0x8e')][_0x69e6('0xad')]){_0x5cb752=_[_0x69e6('0xae')](_0x3db9e8['headers'][_0x69e6('0xad')][_0x69e6('0xaf')](','));}if(_0x4fabe5){var _0xc480d1={'ContactId':_0x4fabe5['id'],'ChatWebsiteId':_0x3db9e8[_0x69e6('0x5c')]['id'],'from':(_0x4fabe5[_0x69e6('0xb0')]||'')+'\x20'+(_0x4fabe5['lastName']||''),'customerIp':_0x5cb752,'customerPort':_0x3db9e8[_0x69e6('0x8e')][_0x69e6('0xb1')]?_0x3db9e8[_0x69e6('0x8e')][_0x69e6('0xb1')]:null,'referer':_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xb2')],'browserName':_0x24f0fb[_0x69e6('0xb3')][_0x69e6('0x3f')]&&_0x24f0fb[_0x69e6('0xb3')][_0x69e6('0xb4')]?util['format']('%s\x20%s',_0x24f0fb['browser'][_0x69e6('0x3f')],_0x24f0fb[_0x69e6('0xb3')][_0x69e6('0xb4')]):'unknown','browserVersion':_0x24f0fb[_0x69e6('0xb3')][_0x69e6('0xb4')]||'unknown','osName':util[_0x69e6('0xb5')]('%s\x20%s',_0x24f0fb['os']['name'],_0x24f0fb['os']['version']),'osVersion':_0x24f0fb['os'][_0x69e6('0xb4')],'deviceModel':_0x24f0fb[_0x69e6('0xb6')][_0x69e6('0x47')]&&_0x24f0fb['device'][_0x69e6('0xb7')]?util['format']('%s\x20%s\x20%s',_0x24f0fb[_0x69e6('0xb6')][_0x69e6('0x47')],_0x24f0fb['device'][_0x69e6('0xb7')],_0x24f0fb['device'][_0x69e6('0x45')]):null,'deviceVendor':_0x24f0fb[_0x69e6('0xb6')][_0x69e6('0xb7')],'deviceType':_0x24f0fb[_0x69e6('0xb6')]['type'],'formData':JSON[_0x69e6('0xb8')](_0x3db9e8['body'])};var _0x4682b0={'ChatWebsiteId':_0x3db9e8[_0x69e6('0x5c')]['id'],'closed':![]};if(_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xb9')]){_0x4682b0[_0x69e6('0xb9')]=_0x3db9e8['body'][_0x69e6('0xb9')];return db[_0x69e6('0xba')]['find']({'where':_0x4682b0})['then'](function(_0x2a65d5){if(_0x2a65d5){return[_0x2a65d5,![]];}_0xc480d1['threadId']=_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xb9')];_0xc480d1[_0x69e6('0xbb')]=_0x3db9e8[_0x69e6('0x60')]['externalUrl'];return db['ChatInteraction']['create'](_0xc480d1)['then'](function(_0x4f7e4b){return[_0x4f7e4b,!![]];});});}_0x4682b0['ContactId']=_0x4fabe5['id'];if(_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xbc')]&&_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xbc')]['id']){_0x4682b0['id']=_0x3db9e8[_0x69e6('0x60')]['interaction']['id'];return db[_0x69e6('0xba')][_0x69e6('0x5e')]({'where':_0x4682b0})[_0x69e6('0x23')](function(_0x5a515b){if(_0x5a515b){return[_0x5a515b,![]];}return db['ChatInteraction'][_0x69e6('0x5f')](_0xc480d1)[_0x69e6('0x23')](function(_0x2b8035){return[_0x2b8035,!![]];});});}return db[_0x69e6('0xba')]['create'](_0xc480d1)[_0x69e6('0x23')](function(_0x5673c3){return[_0x5673c3,!![]];});}})[_0x69e6('0xbd')](function(_0x47befc,_0x35f5b){if(_0x47befc){_0x306995=_0x35f5b;if(!_0x35f5b){var _0x1e6f8e={'from':(_0x58e1e3[_0x69e6('0xbe')]['firstName']||'')+'\x20'+(_0x58e1e3[_0x69e6('0xbe')][_0x69e6('0xbf')]||'')};if(_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xb9')]&&_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xc0')]&&_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xb9')]!=_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xc0')]){_0x1e6f8e[_0x69e6('0xb9')]=_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xc0')];}return _0x47befc['update'](_0x1e6f8e);}else{return _0x47befc;}}})[_0x69e6('0x23')](function(_0x177665){_0x58e1e3[_0x69e6('0xbc')]=_0x177665[_0x69e6('0x3b')]({'plain':!![]});_0x58e1e3[_0x69e6('0xbc')][_0x69e6('0xc1')]=_0x306995;if(_0x58e1e3[_0x69e6('0xbc')][_0x69e6('0xc1')]){if(_0x58e1e3[_0x69e6('0xaa')][_0x69e6('0xc2')]){_0x58e1e3['applications'][_0x69e6('0xc3')]({'id':0x0,'priority':_0x58e1e3[_0x69e6('0xa6')]['length']+0x1,'app':_0x69e6('0xc4'),'appdata':_0x69e6('0xc5'),'interval':_0x69e6('0xc6')});}}return db[_0x69e6('0xc7')][_0x69e6('0x5f')]({'body':_0x3db9e8[_0x69e6('0x60')][_0x69e6('0x60')],'ChatWebsiteId':_0x3db9e8[_0x69e6('0x5c')]['id'],'ChatInteractionId':_0x177665['id'],'direction':'in','ContactId':_0x58e1e3[_0x69e6('0xbe')]['id'],'AttachmentId':_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xc8')]});})[_0x69e6('0x23')](function(_0x2c2284){_0x58e1e3[_0x69e6('0x2b')]=_0x2c2284;if(_0x58e1e3[_0x69e6('0xbc')][_0x69e6('0xc9')]){return db['User'][_0x69e6('0x5e')]({'attributes':['id','name'],'where':{'id':_0x58e1e3[_0x69e6('0xbc')][_0x69e6('0xc9')]}})['then'](function(_0x440211){if(_0x440211){_0x58e1e3[_0x69e6('0xa6')]['unshift']({'id':0x0,'priority':0x0,'app':_0x69e6('0xca'),'appdata':_0x440211[_0x69e6('0x3f')]+','+(_0x58e1e3['account'][_0x69e6('0xcb')]||0xa),'interval':_0x69e6('0xc6')});_0x58e1e3[_0x69e6('0xcc')]=!![];}return respondWithRpcPromise(_0x69e6('0xcd'),_0x69e6('0xce'),_0x58e1e3);});}return respondWithRpcPromise('Start',_0x69e6('0xce'),_0x58e1e3);})[_0x69e6('0x23')](function(_0x4e1140){respondWithRpcPromise('EventManager',_0x69e6('0xcf'),{'event':_0x69e6('0xd0'),'message':_0x4e1140},client9002);return _0x4e1140;})[_0x69e6('0x23')](respondWithResult(_0x977483,null))[_0x69e6('0x2c')](handleError(_0x977483,null));};exports[_0x69e6('0xd1')]=function(_0x14711d,_0x3ae1a8,_0x588c7a){var _0x4dbe0d,_0x2bca83,_0xe1c2f;var _0xbfd52d=[];var _0xfde647=[];var _0x3eea26={};var _0x5bc06a=_0x14711d[_0x69e6('0xd2')]||[];var _0x374e14=[];var _0x4cc70a;return db[_0x69e6('0xa1')][_0x69e6('0x67')]()[_0x69e6('0x23')](function(_0x89c40b){if(!_0x89c40b){throw new db[(_0x69e6('0x91'))][(_0x69e6('0x92'))]('no\x20available\x20attributes');}_0xfde647=_[_0x69e6('0x95')](_[_0x69e6('0x49')](_0x89c40b),[_0x69e6('0x93'),'updatedAt']);_0xbfd52d=_['difference'](_[_0x69e6('0x49')](_0x89c40b),['createdAt',_0x69e6('0x94'),_0x69e6('0x96'),_0x69e6('0x97')]);if(_0x14711d[_0x69e6('0x60')]['id']){delete _0x14711d[_0x69e6('0x60')]['id'];}if(_[_0x69e6('0x81')](_0x14711d[_0x69e6('0x60')][_0x69e6('0x98')])){throw _0x3ae1a8['status'](0x1f4)[_0x69e6('0x40')](new db[(_0x69e6('0x91'))][(_0x69e6('0x92'))](_0x69e6('0x99')));}if(_[_0x69e6('0x81')](_0x14711d[_0x69e6('0x60')][_0x69e6('0x60')])||_0x14711d[_0x69e6('0x60')][_0x69e6('0x60')]===''){throw _0x3ae1a8[_0x69e6('0x2e')](0x1f4)[_0x69e6('0x40')](new db[(_0x69e6('0x91'))]['ValidationError'](_0x69e6('0x9a')));}if(_[_0x69e6('0x81')](_0x14711d[_0x69e6('0x60')][_0x69e6('0xd3')])){throw _0x3ae1a8[_0x69e6('0x2e')](0x1f4)[_0x69e6('0x40')](new db[(_0x69e6('0x91'))][(_0x69e6('0x92'))](_0x69e6('0xd4')+_0xbfd52d));}if(!_[_0x69e6('0x9d')](_0xbfd52d,_0x14711d[_0x69e6('0x60')][_0x69e6('0xd3')])){throw _0x3ae1a8['status'](0x1f4)[_0x69e6('0x40')](new db['Sequelize'][(_0x69e6('0x92'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xbfd52d));}_0x3eea26[_0x14711d[_0x69e6('0x60')][_0x69e6('0xd3')]]=_0x14711d[_0x69e6('0x60')][_0x69e6('0x98')];})[_0x69e6('0x23')](function(){return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x14711d['params']['id']},'include':[{'model':db[_0x69e6('0x9f')],'as':_0x69e6('0xa0')},{'model':db[_0x69e6('0xd5')],'as':_0x69e6('0xd5')}]});})[_0x69e6('0x23')](handleEntityNotFound(_0x3ae1a8,null))['then'](function(_0x236ccf){if(_0x236ccf&&_0x236ccf[_0x69e6('0xa0')]){_0x2bca83=_0x236ccf;var _0x8b052a=_[_0x69e6('0x1b')](_0x14711d[_0x69e6('0x60')],{'firstName':_0x14711d[_0x69e6('0x60')]['from'],'phone':_0x14711d[_0x69e6('0x60')][_0x69e6('0x98')],'ListId':_0x236ccf['ListId']});_0x8b052a[_0x14711d[_0x69e6('0x60')][_0x69e6('0xd3')]]=_0x14711d['body'][_0x69e6('0x98')];return db[_0x69e6('0xa1')][_0x69e6('0xd6')]({'where':_0x3eea26,'defaults':_0x8b052a});}})[_0x69e6('0xbd')](function(_0x14565d){if(_0x14565d){_0xe1c2f=_0x14565d;var _0x24566e=fs[_0x69e6('0xd7')](path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],_0x69e6('0xd8')),_0x69e6('0xd9'));var _0x2002e3=ejs['render'](_0x24566e,{'body':_['toPairs'](_0x14711d[_0x69e6('0x60')]['body']),'bodyTitle':_0x2bca83['offlineMessageBody']});return db[_0x69e6('0xda')][_0x69e6('0x5f')]({'body':_0x2002e3,'ContactId':_0x14565d['id'],'ChatWebsiteId':_0x2bca83['id']});}})[_0x69e6('0x23')](function(_0x59b7d8){_0x4cc70a=_0x59b7d8;if(_0x5bc06a[_0x69e6('0x4e')]){var _0xdd4223=_0x5bc06a[_0x69e6('0x42')](function(_0x98eff2){return{'name':_0x98eff2[_0x69e6('0xdb')],'basename':_0x98eff2[_0x69e6('0x79')],'type':_0x98eff2['mimetype'],'ChatOfflineMessageId':_0x59b7d8['id']};});_0x374e14=_0xdd4223[_0x69e6('0x42')](_0x31f0b7=>{var _0x3b2a7d={'filename':_0x31f0b7[_0x69e6('0x3f')],'path':path['join'](config[_0x69e6('0x7d')],_0x69e6('0xdc'),_0x69e6('0xd2'),_0x69e6('0xdd'),_0x69e6('0xde'),_0x31f0b7['basename'])};return _0x3b2a7d;});if(!_0x2bca83[_0x69e6('0xdf')]){return db['sequelize'][_0x69e6('0xe0')](function(_0x9a649c){return db['Attachment'][_0x69e6('0xe1')](_0xdd4223,{'transaction':_0x9a649c});});}}})[_0x69e6('0x23')](function(){if(_0x4cc70a){_0x4dbe0d=_0x4cc70a;return db[_0x69e6('0xd5')][_0x69e6('0x71')]({'where':{'active':!![]},'include':[{'model':db[_0x69e6('0xe2')],'as':_0x69e6('0xe3'),'raw':!![]}]});}})[_0x69e6('0x23')](function(_0x58a4b5){if(_0x58a4b5&&_0x58a4b5['Smtp']&&_0x2bca83[_0x69e6('0xe4')]&&_0x2bca83['forwardOfflineAddress']){var _0x3703cc={'tls':{'rejectUnauthorized':![]}};if(_0x58a4b5[_0x69e6('0xe3')][_0x69e6('0xe5')]){_0x3703cc[_0x69e6('0xe5')]=_0x58a4b5[_0x69e6('0xe3')][_0x69e6('0xe5')];}else{_0x3703cc[_0x69e6('0xe6')]=_0x58a4b5[_0x69e6('0xe3')][_0x69e6('0xe6')];_0x3703cc[_0x69e6('0xe7')]=_0x58a4b5[_0x69e6('0xe3')][_0x69e6('0xe7')];_0x3703cc[_0x69e6('0xe8')]=_0x58a4b5[_0x69e6('0xe3')][_0x69e6('0xe8')];}if(_0x58a4b5[_0x69e6('0xe3')][_0x69e6('0xe9')]){_0x3703cc[_0x69e6('0xea')]={'user':_0x58a4b5[_0x69e6('0xe3')][_0x69e6('0x62')],'pass':_0x58a4b5[_0x69e6('0xe3')][_0x69e6('0xeb')]};}return respondWithRpcPromise(_0x69e6('0xec'),'sendMail',{'account':_0x3703cc,'message':{'from':util['format'](_0x69e6('0xed'),_0x58a4b5[_0x69e6('0x3f')],_0x58a4b5[_0x69e6('0xee')]||_0x58a4b5[_0x69e6('0xe3')][_0x69e6('0x62')]),'to':_0x2bca83[_0x69e6('0xef')],'subject':_0x2bca83[_0x69e6('0xf0')],'html':_0x4dbe0d['body'],'attachments':_0x374e14}},client9003)[_0x69e6('0x23')](function(){return _0x4dbe0d;})[_0x69e6('0x2c')](function(_0x4e99f2){console[_0x69e6('0x28')](_0x4e99f2);});}})[_0x69e6('0x23')](function(){if(_0x2bca83&&_0x2bca83[_0x69e6('0xdf')]&&_0x2bca83[_0x69e6('0xf1')]){var _0x24e058=[];if(_0x5bc06a[_0x69e6('0x4e')]){_0x24e058=_0x5bc06a[_0x69e6('0x42')](function(_0x9a14b0){return{'name':_0x9a14b0[_0x69e6('0xdb')],'basename':_0x9a14b0[_0x69e6('0x79')],'type':_0x9a14b0['mimetype'],'ChatOfflineMessageId':_0x4cc70a['id']};});}var _0x575add;if(!_['isNil'](_0x2bca83['subjectOffline'])){var _0x3fc22f=_['map'](_0x14711d[_0x69e6('0x60')],function(_0x384ddb){return _0x384ddb;});var _0x8df699=_['toPairsIn'](_0x3fc22f)[0x0];var _0x44ff60=_[_0x69e6('0xf2')](_0x8df699,function(_0x777a8){return _0x777a8;});_0x575add=_0x44ff60[0x1][_0x2bca83[_0x69e6('0xf3')]];}var _0x299056={'from':_0xe1c2f[_0x69e6('0xee')],'firstName':_0xe1c2f[_0x69e6('0xb0')],'lastName':_0xe1c2f['lastName'],'mapKey':_0x69e6('0xee'),'message':{'from':_0xe1c2f[_0x69e6('0xee')],'to':_0x2bca83[_0x69e6('0xd5')][_0x69e6('0xee')],'cc':'','subject':_[_0x69e6('0x81')](_0x575add)?_0x2bca83[_0x69e6('0xf0')]:_0x575add,'messageId':'','sentAt':new Date(),'attach':_0x24e058[_0x69e6('0x4e')],'attachments':_0x24e058,'originChannel':'Chat','ChatWebsiteId':_0x2bca83['id'],'ChatOfflineMessageId':_0x4dbe0d['id'],'originTo':_0x2bca83[_0x69e6('0xd5')][_0x69e6('0xee')]},'body':_0x4dbe0d['body']};var _0xf955d6={'account':{'id':_0x2bca83['MailAccountId']},'body':_0x299056,'log':_0x69e6('0xf4')};return respondWithRpcPromise(_0x69e6('0xf4'),_0x69e6('0xf5'),_0xf955d6,client9001)['then'](function(){return _0x4dbe0d;})[_0x69e6('0x2c')](function(_0x2fe7f5){console[_0x69e6('0x28')](_0x2fe7f5);});}return;})[_0x69e6('0x23')](function(){if(_0x4dbe0d){return _0x4dbe0d;}})[_0x69e6('0x23')](respondWithResult(_0x3ae1a8,null))[_0x69e6('0x2c')](function(_0xaa9ebd){console['error'](_0x69e6('0x2c'),_0xaa9ebd);for(var _0x455b82 of _0x5bc06a){var _0x270d49=path[_0x69e6('0x7c')](config['root'],_0x69e6('0xdc'),_0x69e6('0xd2'),_0x69e6('0xdd'),_0x69e6('0xde'),_0x455b82['filename']);fs_extra[_0x69e6('0xf6')](_0x270d49)[_0x69e6('0x2c')](function(_0x453f85){console[_0x69e6('0x28')](_0x69e6('0xf7'),_0x270d49,_0x453f85);});}});};exports[_0x69e6('0xf8')]=function(_0x3d2d29,_0xd6261,_0x2eeea6){return db['ChatInteraction'][_0x69e6('0x5e')]({'where':{'id':_0x3d2d29[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0xd6261,null))[_0x69e6('0x23')](function(_0x4fc29d){if(_0x4fc29d){return _0x4fc29d[_0x69e6('0xf8')](_0x3d2d29[_0x69e6('0x60')][_0x69e6('0x6e')],_[_0x69e6('0xf9')](_0x3d2d29[_0x69e6('0x60')],[_0x69e6('0x6e'),'id'])||{});}})['then'](respondWithResult(_0xd6261,null))[_0x69e6('0x2c')](handleError(_0xd6261,null));};exports['getInteractions']=function(_0x580efb,_0xce22d2,_0x17e4e8){var _0x1cba53={'raw':![],'where':{}};var _0x323a05={};var _0xf84ba6={'count':0x0,'rows':[]};return db[_0x69e6('0x57')][_0x69e6('0x71')]({'where':{'id':_0x580efb[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0xce22d2,null))[_0x69e6('0x23')](function(_0x2fd3a5){if(_0x2fd3a5){_0x323a05['model']=_[_0x69e6('0x49')](db[_0x69e6('0xba')]['rawAttributes']);_0x323a05['query']=_[_0x69e6('0x49')](_0x580efb[_0x69e6('0x48')]);_0x323a05['filters']=_[_0x69e6('0x4b')](_0x323a05[_0x69e6('0x47')],_0x323a05[_0x69e6('0x48')]);_0x1cba53['attributes']=_[_0x69e6('0x4b')](_0x323a05[_0x69e6('0x47')],qs[_0x69e6('0x4d')](_0x580efb[_0x69e6('0x48')][_0x69e6('0x4d')]));_0x1cba53['attributes']=_0x1cba53[_0x69e6('0x4c')][_0x69e6('0x4e')]?_0x1cba53['attributes']:_0x323a05[_0x69e6('0x47')];if(!_0x580efb[_0x69e6('0x48')][_0x69e6('0x69')](_0x69e6('0x4f'))){_0x1cba53[_0x69e6('0x32')]=qs[_0x69e6('0x32')](_0x580efb[_0x69e6('0x48')]['limit']);_0x1cba53[_0x69e6('0x34')]=qs['offset'](_0x580efb['query'][_0x69e6('0x34')]);}_0x1cba53[_0x69e6('0x6a')]=qs[_0x69e6('0x50')](_0x580efb[_0x69e6('0x48')][_0x69e6('0x50')]);_0x1cba53[_0x69e6('0x51')]=qs[_0x69e6('0x4a')](_[_0x69e6('0x52')](_0x580efb[_0x69e6('0x48')],_0x323a05['filters']));_0x1cba53['where'][_0x69e6('0x6b')]=_0x2fd3a5['id'];if(_0x580efb[_0x69e6('0x48')][_0x69e6('0x53')]){_0x1cba53[_0x69e6('0x51')]=_[_0x69e6('0x55')](_0x1cba53[_0x69e6('0x51')],{'$or':_[_0x69e6('0x42')](_0x1cba53[_0x69e6('0x4c')],function(_0x1177ca){var _0x304ae7={};_0x304ae7[_0x1177ca]={'$like':'%'+_0x580efb['query'][_0x69e6('0x53')]+'%'};return _0x304ae7;})});}_0x1cba53=_[_0x69e6('0x55')]({},_0x1cba53,_0x580efb[_0x69e6('0x56')]);return db[_0x69e6('0xba')][_0x69e6('0x33')]({'where':_0x1cba53[_0x69e6('0x51')]})[_0x69e6('0x23')](function(_0x3bc27a){_0xf84ba6[_0x69e6('0x33')]=_0x3bc27a;if(_0x580efb[_0x69e6('0x48')][_0x69e6('0x5d')]){_0x1cba53['include']=[{'model':db[_0x69e6('0xa1')],'as':_0x69e6('0xfa'),'required':![]},{'model':db['User'],'as':_0x69e6('0xfb'),'attributes':[_0x69e6('0x3f'),_0x69e6('0xfc'),_0x69e6('0xfd')],'required':![]},{'model':db[_0x69e6('0xfe')],'as':_0x69e6('0xff'),'attributes':['id',_0x69e6('0x3f'),_0x69e6('0x100')],'where':_0x580efb['query'][_0x69e6('0x101')]?{'id':_0x580efb[_0x69e6('0x48')][_0x69e6('0x101')]}:undefined,'required':_0x580efb['query']['tag']?!![]:![]}];}return db[_0x69e6('0xba')][_0x69e6('0x59')](_0x1cba53);})[_0x69e6('0x23')](function(_0x9bbea2){_0xf84ba6[_0x69e6('0x5a')]=_0x9bbea2;return _0xf84ba6;});}})['then'](respondWithFilteredResult(_0xce22d2,_0x1cba53))['catch'](handleError(_0xce22d2,null));};function iftimePromise(_0x409de0,_0x28d8b7){return respondWithRpcPromise(_0x69e6('0x102'),_0x69e6('0x103'),{'command':_0x28d8b7['timezone']?util[_0x69e6('0xb5')](_0x69e6('0x104'),_0x409de0[_0x69e6('0x105')],_0x28d8b7[_0x69e6('0x106')]):util[_0x69e6('0xb5')](_0x69e6('0x107'),_0x409de0[_0x69e6('0x105')])},client9002)['then'](function(_0x68ef87){var _0x51e833=_0x68ef87&&_0x68ef87[_0x69e6('0x108')](_0x69e6('0x109'))>=0x0?!![]:![];logger[_0x69e6('0x24')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x28d8b7['id'],_0x409de0['id'],_0x409de0[_0x69e6('0x105')],_0x51e833?'ONLINE':_0x69e6('0x10a'),_0x28d8b7[_0x69e6('0x106')]?_0x28d8b7[_0x69e6('0x106')]:_0x69e6('0x10b'));return _0x51e833;})[_0x69e6('0x2c')](function(_0x27a3e1){logger[_0x69e6('0x28')](_0x69e6('0x10c'),_0x28d8b7['id'],_0x409de0['id'],_0x409de0['interval'],util['inspect'](_0x27a3e1,{'showHidden':![],'depth':null}),_0x28d8b7[_0x69e6('0x106')]?_0x28d8b7['timezone']:_0x69e6('0x10b'));return![];});}exports[_0x69e6('0x103')]=function(_0x1b2da7,_0x40c676,_0x32546d){var _0x304f58=0x0;var _0x3f3518=0x0;var _0x6784d9=![];var _0x1802bf;var _0x190130;return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x1b2da7['params']['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x69e6('0x10d')],'as':_0x69e6('0x10e'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x69e6('0x23')](handleEntityNotFound(_0x40c676,null))[_0x69e6('0x23')](function(_0x59ba3e){if(_0x59ba3e){_0x1802bf=_0x59ba3e;return _0x59ba3e[_0x69e6('0x10f')]({'raw':!![]});}})[_0x69e6('0x23')](function(_0x1ed46e){if(_0x1802bf){if(_0x1ed46e){_0x190130=_0x1ed46e;}}return require('../../config/license/util')[_0x69e6('0x7f')]();})[_0x69e6('0x23')](function(_0x96e83){if(_0x96e83){_0x3f3518=_0x96e83[_0x69e6('0x110')];_0x6784d9=_0x96e83['custom'];}})[_0x69e6('0x23')](function(){return db[_0x69e6('0xba')]['count']({'where':{'closed':![]}});})[_0x69e6('0x23')](function(_0xbd7889){_0x304f58=_0xbd7889;if(_0x3f3518&&_0xbd7889>_0x3f3518){return db[_0x69e6('0x111')][_0x69e6('0x71')]({'where':{'id':0x1}})[_0x69e6('0x23')](function(_0x220ac3){if(_0x220ac3){_0x220ac3[_0x69e6('0x112')](_0x69e6('0x113'));}});}})[_0x69e6('0x23')](function(){if(_0x1802bf[_0x69e6('0x10d')]&&_0x1802bf[_0x69e6('0x10d')][_0x69e6('0x10e')]){var _0x2ffa35=[];for(var _0x27b5d1=0x0;_0x27b5d1<_0x1802bf['Interval'][_0x69e6('0x10e')]['length'];_0x27b5d1++){var _0x1f791f=_0x1802bf[_0x69e6('0x10d')]['Intervals'][_0x27b5d1][_0x69e6('0x3b')]({'plain':!![]});_0x2ffa35[_0x69e6('0xc3')](iftimePromise(_0x1f791f,_0x1802bf));}return BPromise[_0x69e6('0x114')](_0x2ffa35)[_0x69e6('0x23')](function(_0x4971cc){return _[_0x69e6('0x115')](_0x4971cc);});}else{return!![];}})[_0x69e6('0x23')](function(_0x138834){var _0x4a828b=fs[_0x69e6('0xd7')](path[_0x69e6('0x7c')](config['root'],_0x69e6('0x116')),_0x69e6('0xd9'));var _0x24b5ee={'remote':_0x1802bf[_0x69e6('0x117')],'query':querystring[_0x69e6('0xb8')](_[_0x69e6('0x55')](_0x1802bf['get']({'plain':!![]}),{'customerIp':_0x1b2da7['headers'][_0x69e6('0xad')]||_0x1b2da7[_0x69e6('0x8e')][_0x69e6('0x118')]||_0x1b2da7[_0x69e6('0x119')]['remoteAddress']||_0x1b2da7['ip'],'referer':_0x1b2da7[_0x69e6('0x8e')]['referer'],'openedInteractions':_0x304f58,'maxInteractions':_0x3f3518,'virtual':_0x6784d9['virtual'],'online':_0x138834,'custom':_0x6784d9}))['replace'](/'/g,'\x5c\x27')};_0x40c676[_0x69e6('0x40')](ejs[_0x69e6('0x11a')](Mustache[_0x69e6('0x11a')](_0x4a828b,_0x24b5ee),{'proactiveActions':_0x190130,'alignment':_0x1802bf[_0x69e6('0x11b')],'verticalAlignment':_0x1802bf[_0x69e6('0x11c')],'div_color':_0x1802bf[_0x69e6('0x100')],'text_color':_0x1802bf[_0x69e6('0x11d')],'button_color':_0x1802bf[_0x69e6('0x11e')],'background_color':_0x1802bf[_0x69e6('0x11f')]}));})[_0x69e6('0x2c')](handleError(_0x40c676,null));};exports['addApplications']=function(_0x3990b1,_0x49d4f1,_0x4e25b1){return db[_0x69e6('0x57')][_0x69e6('0x71')]({'where':{'id':_0x3990b1[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x49d4f1,null))[_0x69e6('0x23')](function(_0x127c16){if(_0x127c16){return db[_0x69e6('0x120')][_0x69e6('0xe0')](function(_0x2fca5a){return db[_0x69e6('0xa4')][_0x69e6('0x3d')]({'where':{'ChatWebsiteId':_0x3990b1['params']['id']},'transaction':_0x2fca5a})[_0x69e6('0x23')](function(_0x480eb9){var _0x5b8fda=_[_0x69e6('0x42')](_0x3990b1[_0x69e6('0x60')],function(_0x54cef1){_0x54cef1[_0x69e6('0x6b')]=_0x3990b1[_0x69e6('0x5c')]['id'];return _0x54cef1;});return db[_0x69e6('0xa4')][_0x69e6('0xe1')](_0x5b8fda,{'transaction':_0x2fca5a});});})[_0x69e6('0x23')](function(){return db[_0x69e6('0xa4')][_0x69e6('0x121')]({'where':{'ChatWebsiteId':_0x3990b1[_0x69e6('0x5c')]['id']},'order':_0x69e6('0xa8')});});}})['then'](respondWithResult(_0x49d4f1,null))['catch'](handleError(_0x49d4f1,null));};exports[_0x69e6('0x122')]=function(_0x51461f,_0x4c731e,_0x5c1519){var _0x551f80={};var _0x5b6301={};var _0x2766ef;var _0x441afa;return db['ChatWebsite'][_0x69e6('0x71')]({'where':{'id':_0x51461f[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x4c731e,null))[_0x69e6('0x23')](function(_0x146cb7){if(_0x146cb7){_0x2766ef=_0x146cb7;_0x5b6301[_0x69e6('0x47')]=_[_0x69e6('0x49')](db[_0x69e6('0xa4')][_0x69e6('0x43')]);_0x5b6301[_0x69e6('0x48')]=_[_0x69e6('0x49')](_0x51461f[_0x69e6('0x48')]);_0x5b6301[_0x69e6('0x4a')]=_[_0x69e6('0x4b')](_0x5b6301['model'],_0x5b6301[_0x69e6('0x48')]);_0x551f80[_0x69e6('0x4c')]=_[_0x69e6('0x4b')](_0x5b6301[_0x69e6('0x47')],qs[_0x69e6('0x4d')](_0x51461f[_0x69e6('0x48')][_0x69e6('0x4d')]));_0x551f80[_0x69e6('0x4c')]=_0x551f80[_0x69e6('0x4c')][_0x69e6('0x4e')]?_0x551f80[_0x69e6('0x4c')]:_0x5b6301[_0x69e6('0x47')];_0x551f80[_0x69e6('0x6a')]=qs[_0x69e6('0x50')](_0x51461f[_0x69e6('0x48')][_0x69e6('0x50')]);_0x551f80[_0x69e6('0x51')]=qs[_0x69e6('0x4a')](_[_0x69e6('0x52')](_0x51461f[_0x69e6('0x48')],_0x5b6301[_0x69e6('0x4a')]));if(_0x51461f['query']['filter']){_0x551f80[_0x69e6('0x51')]=_[_0x69e6('0x55')](_0x551f80[_0x69e6('0x51')],{'$or':_['map'](_0x551f80[_0x69e6('0x4c')],function(_0x4ff373){var _0x4a6426={};_0x4a6426[_0x4ff373]={'$like':'%'+_0x51461f[_0x69e6('0x48')]['filter']+'%'};return _0x4a6426;})});}_0x551f80=_[_0x69e6('0x55')]({},_0x551f80,_0x51461f[_0x69e6('0x56')]);return _0x2766ef[_0x69e6('0x122')](_0x551f80);}})[_0x69e6('0x23')](function(_0x234947){if(_0x234947){_0x441afa=_0x234947[_0x69e6('0x4e')];if(!_0x51461f[_0x69e6('0x48')][_0x69e6('0x69')]('nolimit')){_0x551f80['limit']=qs[_0x69e6('0x32')](_0x51461f[_0x69e6('0x48')][_0x69e6('0x32')]);_0x551f80[_0x69e6('0x34')]=qs['offset'](_0x51461f['query'][_0x69e6('0x34')]);}return _0x2766ef[_0x69e6('0x122')](_0x551f80);}})[_0x69e6('0x23')](function(_0x36b899){if(_0x36b899){return _0x36b899?{'count':_0x441afa,'rows':_0x36b899}:null;}})[_0x69e6('0x23')](respondWithResult(_0x4c731e,null))[_0x69e6('0x2c')](handleError(_0x4c731e,null));};exports[_0x69e6('0x123')]=function(_0x5ee987,_0x43a7ad,_0x3cf5c0){return db['chatProactiveAction']['find']({'where':{'id':_0x5ee987['params']['id']}})['then'](handleEntityNotFound(_0x43a7ad,null))[_0x69e6('0x23')](function(_0x2f86ce){if(_0x2f86ce){return _0x2f86ce['addProactiveActions'](_0x5ee987[_0x69e6('0x60')]['ids'],_[_0x69e6('0xf9')](_0x5ee987[_0x69e6('0x60')],[_0x69e6('0x6e'),'id'])||{});}})[_0x69e6('0x23')](respondWithResult(_0x43a7ad,null))[_0x69e6('0x2c')](handleError(_0x43a7ad,null));};exports[_0x69e6('0x10f')]=function(_0x3b62dc,_0xe01ad1,_0x1f8b89){var _0x3ba0ab={};var _0x2ed910={};var _0x89385e;var _0x3188e7;return db[_0x69e6('0x57')][_0x69e6('0x71')]({'where':{'id':_0x3b62dc['params']['id']}})['then'](handleEntityNotFound(_0xe01ad1,null))[_0x69e6('0x23')](function(_0x3dc04b){if(_0x3dc04b){_0x89385e=_0x3dc04b;_0x2ed910[_0x69e6('0x47')]=_['keys'](db['ChatProactiveAction'][_0x69e6('0x43')]);_0x2ed910[_0x69e6('0x48')]=_[_0x69e6('0x49')](_0x3b62dc['query']);_0x2ed910[_0x69e6('0x4a')]=_[_0x69e6('0x4b')](_0x2ed910['model'],_0x2ed910[_0x69e6('0x48')]);_0x3ba0ab[_0x69e6('0x4c')]=_[_0x69e6('0x4b')](_0x2ed910[_0x69e6('0x47')],qs[_0x69e6('0x4d')](_0x3b62dc[_0x69e6('0x48')]['fields']));_0x3ba0ab[_0x69e6('0x4c')]=_0x3ba0ab[_0x69e6('0x4c')]['length']?_0x3ba0ab['attributes']:_0x2ed910[_0x69e6('0x47')];_0x3ba0ab[_0x69e6('0x6a')]=qs['sort'](_0x3b62dc[_0x69e6('0x48')]['sort']);_0x3ba0ab['where']=qs[_0x69e6('0x4a')](_[_0x69e6('0x52')](_0x3b62dc[_0x69e6('0x48')],_0x2ed910[_0x69e6('0x4a')]));if(_0x3b62dc[_0x69e6('0x48')][_0x69e6('0x53')]){_0x3ba0ab[_0x69e6('0x51')]=_['merge'](_0x3ba0ab[_0x69e6('0x51')],{'$or':_['map'](_0x3ba0ab[_0x69e6('0x4c')],function(_0x5805f1){var _0x1ba4e5={};_0x1ba4e5[_0x5805f1]={'$like':'%'+_0x3b62dc[_0x69e6('0x48')][_0x69e6('0x53')]+'%'};return _0x1ba4e5;})});}_0x3ba0ab=_['merge']({},_0x3ba0ab,_0x3b62dc['options']);return _0x89385e[_0x69e6('0x10f')](_0x3ba0ab);}})[_0x69e6('0x23')](function(_0x33755d){if(_0x33755d){_0x3188e7=_0x33755d[_0x69e6('0x4e')];if(!_0x3b62dc['query'][_0x69e6('0x69')]('nolimit')){_0x3ba0ab[_0x69e6('0x32')]=qs[_0x69e6('0x32')](_0x3b62dc[_0x69e6('0x48')]['limit']);_0x3ba0ab[_0x69e6('0x34')]=qs[_0x69e6('0x34')](_0x3b62dc['query'][_0x69e6('0x34')]);}return _0x89385e[_0x69e6('0x10f')](_0x3ba0ab);}})['then'](function(_0x3e55fe){if(_0x3e55fe){return _0x3e55fe?{'count':_0x3188e7,'rows':_0x3e55fe}:null;}})['then'](respondWithResult(_0xe01ad1,null))[_0x69e6('0x2c')](handleError(_0xe01ad1,null));};exports[_0x69e6('0x124')]=function(_0x3eea3f,_0x109c46,_0x32ca76){var _0x8cab25=_0x3eea3f['query'][_0x69e6('0x125')]===_0x69e6('0x126')?_0x69e6('0x127'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0x8cab25],'where':{'id':_0x3eea3f[_0x69e6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x109c46,null))['then'](function(_0x483fbc){if(_0x483fbc){var _0x1ae2b9=_0x483fbc[_0x8cab25];var _0x1265f8=_0x1ae2b9&&_0x1ae2b9[_0x69e6('0x128')]?_0x1ae2b9[_0x69e6('0x128')]:[];_0x109c46[_0x69e6('0x40')]({'fromKey':_[_0x69e6('0x81')](_0x1ae2b9[_0x69e6('0x129')])?undefined:_0x1ae2b9[_0x69e6('0x129')],'count':_0x1265f8[_0x69e6('0x4e')],'rows':_0x1265f8});}})[_0x69e6('0x2c')](handleError(_0x109c46,null));};exports['getOfflineMessages']=function(_0x4e4c82,_0x336576,_0x26a293){var _0x3c465b={'raw':![],'where':{}};var _0x22ad7b={};var _0x6e26c2={'count':0x0,'rows':[]};return db[_0x69e6('0x57')][_0x69e6('0x71')]({'where':{'id':_0x4e4c82[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x336576,null))[_0x69e6('0x23')](function(_0x21f7ad){if(_0x21f7ad){_0x22ad7b['model']=_['keys'](db[_0x69e6('0xda')][_0x69e6('0x43')]);_0x22ad7b[_0x69e6('0x48')]=_[_0x69e6('0x49')](_0x4e4c82[_0x69e6('0x48')]);_0x22ad7b['filters']=_[_0x69e6('0x4b')](_0x22ad7b['model'],_0x22ad7b['query']);_0x3c465b['attributes']=_['intersection'](_0x22ad7b[_0x69e6('0x47')],qs[_0x69e6('0x4d')](_0x4e4c82[_0x69e6('0x48')][_0x69e6('0x4d')]));_0x3c465b[_0x69e6('0x4c')]=_0x3c465b[_0x69e6('0x4c')]['length']?_0x3c465b[_0x69e6('0x4c')]:_0x22ad7b[_0x69e6('0x47')];if(!_0x4e4c82['query'][_0x69e6('0x69')]('nolimit')){_0x3c465b['limit']=qs[_0x69e6('0x32')](_0x4e4c82[_0x69e6('0x48')][_0x69e6('0x32')]);_0x3c465b[_0x69e6('0x34')]=qs[_0x69e6('0x34')](_0x4e4c82[_0x69e6('0x48')][_0x69e6('0x34')]);}_0x3c465b[_0x69e6('0x6a')]=qs['sort'](_0x4e4c82['query'][_0x69e6('0x50')]);_0x3c465b[_0x69e6('0x51')]=qs[_0x69e6('0x4a')](_[_0x69e6('0x52')](_0x4e4c82[_0x69e6('0x48')],_0x22ad7b[_0x69e6('0x4a')]));_0x3c465b[_0x69e6('0x51')][_0x69e6('0x6b')]=_0x21f7ad['id'];if(_0x4e4c82[_0x69e6('0x48')]['filter']){_0x3c465b[_0x69e6('0x51')]=_['merge'](_0x3c465b['where'],{'$or':_['map'](_0x3c465b[_0x69e6('0x4c')],function(_0x909d2f){var _0x6b4a8f={};_0x6b4a8f[_0x909d2f]={'$like':'%'+_0x4e4c82[_0x69e6('0x48')][_0x69e6('0x53')]+'%'};return _0x6b4a8f;})});}_0x3c465b=_['merge']({},_0x3c465b,_0x4e4c82[_0x69e6('0x56')]);return db[_0x69e6('0xda')][_0x69e6('0x33')]({'where':_0x3c465b[_0x69e6('0x51')]})[_0x69e6('0x23')](function(_0x3a4a61){_0x6e26c2[_0x69e6('0x33')]=_0x3a4a61;if(_0x4e4c82[_0x69e6('0x48')][_0x69e6('0x5d')]){_0x3c465b[_0x69e6('0x58')]=[{'all':!![]}];}else{_0x3c465b[_0x69e6('0x58')]=[{'model':db[_0x69e6('0xa1')],'as':_0x69e6('0xfa'),'required':![]},{'model':db[_0x69e6('0x12a')],'as':_0x69e6('0x12b'),'required':![]}];}return db[_0x69e6('0xda')][_0x69e6('0x59')](_0x3c465b);})['then'](function(_0x13bc99){_0x6e26c2['rows']=_0x13bc99;return _0x6e26c2;});}})['then'](respondWithFilteredResult(_0x336576,_0x3c465b))[_0x69e6('0x2c')](handleError(_0x336576,null));};exports['addAgents']=function(_0x396091,_0x32241f,_0x21c83c){return db[_0x69e6('0x57')]['find']({'where':{'id':_0x396091[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x32241f,null))[_0x69e6('0x23')](function(_0x1ef2f9){if(_0x1ef2f9){return _0x1ef2f9[_0x69e6('0x12c')](_0x396091['body'][_0x69e6('0x6e')],_[_0x69e6('0xf9')](_0x396091['body'],[_0x69e6('0x6e'),'id'])||{})[_0x69e6('0xbd')](function(_0x1b82e3){for(var _0x1f8a34=0x0;_0x1f8a34<_0x396091[_0x69e6('0x60')][_0x69e6('0x6e')]['length'];_0x1f8a34+=0x1){socket['emit'](_0x69e6('0x12d'),{'UserId':Number(_0x396091[_0x69e6('0x60')][_0x69e6('0x6e')][_0x1f8a34]),'ChatWebsiteId':Number(_0x396091['params']['id'])});}return _0x1b82e3;});}})[_0x69e6('0x23')](respondWithResult(_0x32241f,null))[_0x69e6('0x2c')](handleError(_0x32241f,null));};exports['removeAgents']=function(_0x5cae8e,_0x531c77,_0x1e39e5){return db[_0x69e6('0x57')]['find']({'where':{'id':_0x5cae8e[_0x69e6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x531c77,null))['then'](function(_0x3a753f){if(_0x3a753f){return _0x3a753f[_0x69e6('0x12e')](_0x5cae8e['query']['ids'])['then'](function(){if(_[_0x69e6('0x12f')](_0x5cae8e[_0x69e6('0x48')][_0x69e6('0x6e')])){for(var _0x28efe7=0x0;_0x28efe7<_0x5cae8e[_0x69e6('0x48')][_0x69e6('0x6e')][_0x69e6('0x4e')];_0x28efe7+=0x1){socket[_0x69e6('0x130')](_0x69e6('0x131'),{'UserId':Number(_0x5cae8e['query']['ids'][_0x28efe7]),'ChatWebsiteId':Number(_0x5cae8e[_0x69e6('0x5c')]['id'])});}}else{socket[_0x69e6('0x130')]('userChatWebsite:remove',{'UserId':Number(_0x5cae8e['query'][_0x69e6('0x6e')]),'ChatWebsiteId':Number(_0x5cae8e[_0x69e6('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x531c77,null))['catch'](handleError(_0x531c77,null));};exports[_0x69e6('0x132')]=function(_0x337ba4,_0x3fb559,_0x5688a6){var _0x2aa0fd={};var _0x2a10b2={};var _0x3f4fbf;var _0x2c05dd;return db[_0x69e6('0x57')][_0x69e6('0x71')]({'where':{'id':_0x337ba4[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x3fb559,null))[_0x69e6('0x23')](function(_0x54b23f){if(_0x54b23f){_0x3f4fbf=_0x54b23f;_0x2a10b2[_0x69e6('0x47')]=_[_0x69e6('0x49')](db[_0x69e6('0x133')][_0x69e6('0x43')]);_0x2a10b2['query']=_[_0x69e6('0x49')](_0x337ba4[_0x69e6('0x48')]);_0x2a10b2[_0x69e6('0x4a')]=_['intersection'](_0x2a10b2[_0x69e6('0x47')],_0x2a10b2[_0x69e6('0x48')]);_0x2aa0fd[_0x69e6('0x4c')]=_[_0x69e6('0x4b')](_0x2a10b2['model'],qs[_0x69e6('0x4d')](_0x337ba4[_0x69e6('0x48')][_0x69e6('0x4d')]));_0x2aa0fd[_0x69e6('0x4c')]=_0x2aa0fd[_0x69e6('0x4c')][_0x69e6('0x4e')]?_0x2aa0fd[_0x69e6('0x4c')]:_0x2a10b2['model'];_0x2aa0fd['order']=qs[_0x69e6('0x50')](_0x337ba4['query']['sort']);_0x2aa0fd['where']=qs[_0x69e6('0x4a')](_[_0x69e6('0x52')](_0x337ba4[_0x69e6('0x48')],_0x2a10b2[_0x69e6('0x4a')]));if(_0x337ba4[_0x69e6('0x48')]['filter']){_0x2aa0fd[_0x69e6('0x51')]=_[_0x69e6('0x55')](_0x2aa0fd[_0x69e6('0x51')],{'$or':_[_0x69e6('0x42')](_0x2aa0fd[_0x69e6('0x4c')],function(_0x214163){var _0x44374a={};_0x44374a[_0x214163]={'$like':'%'+_0x337ba4['query'][_0x69e6('0x53')]+'%'};return _0x44374a;})});}_0x2aa0fd=_[_0x69e6('0x55')]({},_0x2aa0fd,_0x337ba4[_0x69e6('0x56')]);return _0x3f4fbf['getAgents'](_0x2aa0fd);}})[_0x69e6('0x23')](function(_0xce4636){if(_0xce4636){_0x2c05dd=_0xce4636[_0x69e6('0x4e')];if(!_0x337ba4['query']['hasOwnProperty']('nolimit')){_0x2aa0fd['limit']=qs[_0x69e6('0x32')](_0x337ba4[_0x69e6('0x48')]['limit']);_0x2aa0fd[_0x69e6('0x34')]=qs[_0x69e6('0x34')](_0x337ba4[_0x69e6('0x48')]['offset']);}return _0x3f4fbf[_0x69e6('0x132')](_0x2aa0fd);}})[_0x69e6('0x23')](function(_0x4bcec0){if(_0x4bcec0){return _0x4bcec0?{'count':_0x2c05dd,'rows':_0x4bcec0}:null;}})[_0x69e6('0x23')](respondWithResult(_0x3fb559,null))[_0x69e6('0x2c')](handleError(_0x3fb559,null));};
\ No newline at end of file
index 24c44c4..649a4cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94b1=['setMaxListeners','save','update','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x12bcf7,_0xc11103){var _0x2825a=function(_0x4452ba){while(--_0x4452ba){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x2825a(++_0xc11103);}(_0x94b1,0x102));var _0x194b=function(_0xbf12e8,_0x33154c){_0xbf12e8=_0xbf12e8-0x0;var _0x150e20=_0x94b1[_0xbf12e8];return _0x150e20;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x194b('0x0'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x194b('0x1')](0x0);var events={'afterCreate':_0x194b('0x2'),'afterUpdate':_0x194b('0x3'),'afterDestroy':'remove'};function emitEvent(_0x13fda1){return function(_0x3a21be,_0x32586a,_0x23ab83){ChatWebsiteEvents['emit'](_0x13fda1+':'+_0x3a21be['id'],_0x3a21be);ChatWebsiteEvents[_0x194b('0x4')](_0x13fda1,_0x3a21be);_0x23ab83(null);};}for(var e in events){if(events[_0x194b('0x5')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x194b('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xaa19=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','update'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xaa19,0x79));var _0x9aa1=function(_0x32f98e,_0x5c1821){_0x32f98e=_0x32f98e-0x0;var _0x4944f3=_0xaa19[_0x32f98e];return _0x4944f3;};'use strict';var EventEmitter=require(_0x9aa1('0x0'));var ChatWebsite=require(_0x9aa1('0x1'))['db'][_0x9aa1('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9aa1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9aa1('0x4'),'afterDestroy':'remove'};function emitEvent(_0x15dd20){return function(_0x58fb46,_0x11fd1b,_0x36a679){ChatWebsiteEvents[_0x9aa1('0x5')](_0x15dd20+':'+_0x58fb46['id'],_0x58fb46);ChatWebsiteEvents['emit'](_0x15dd20,_0x58fb46);_0x36a679(null);};}for(var e in events){if(events[_0x9aa1('0x6')](e)){var event=events[e];ChatWebsite[_0x9aa1('0x7')](e,emitEvent(event));}}module[_0x9aa1('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
index c6e483c..ea020cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd74a=['moment','bluebird','rimraf','./chatWebsite.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x59092d,_0x1dd573){var _0x4aa450=function(_0x5ddc2a){while(--_0x5ddc2a){_0x59092d['push'](_0x59092d['shift']());}};_0x4aa450(++_0x1dd573);}(_0xd74a,0x1d2));var _0xad74=function(_0x4e1fd1,_0x4d9f35){_0x4e1fd1=_0x4e1fd1-0x0;var _0x1418d8=_0xd74a[_0x4e1fd1];return _0x1418d8;};'use strict';var _=require(_0xad74('0x0'));var util=require(_0xad74('0x1'));var logger=require(_0xad74('0x2'))(_0xad74('0x3'));var moment=require(_0xad74('0x4'));var BPromise=require(_0xad74('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xad74('0x6'));var config=require('../../config/environment');var attributes=require(_0xad74('0x7'));module[_0xad74('0x8')]=function(_0x3dc7d7,_0x37ec4c){return _0x3dc7d7[_0xad74('0x9')]('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7216=['request-promise','path','./chatWebsite.attributes','ChatWebsite','chat_websites','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4ac0f1,_0x4b4686){var _0x1dfc0d=function(_0xe86617){while(--_0xe86617){_0x4ac0f1['push'](_0x4ac0f1['shift']());}};_0x1dfc0d(++_0x4b4686);}(_0x7216,0x181));var _0x6721=function(_0x5847bc,_0x305090){_0x5847bc=_0x5847bc-0x0;var _0x2a1fb0=_0x7216[_0x5847bc];return _0x2a1fb0;};'use strict';var _=require(_0x6721('0x0'));var util=require('util');var logger=require(_0x6721('0x1'))(_0x6721('0x2'));var moment=require(_0x6721('0x3'));var BPromise=require(_0x6721('0x4'));var rp=require(_0x6721('0x5'));var fs=require('fs');var path=require(_0x6721('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6721('0x7'));module['exports']=function(_0x716f00,_0x57ca73){return _0x716f00['define'](_0x6721('0x8'),attributes,{'tableName':_0x6721('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 207faf2..aff8f10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4e3=['./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','socket.io-emitter','redis'];(function(_0x2390bd,_0x212fbd){var _0x3a969d=function(_0x3dd049){while(--_0x3dd049){_0x2390bd['push'](_0x2390bd['shift']());}};_0x3a969d(++_0x212fbd);}(_0xc4e3,0xd2));var _0x3c4e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc4e3[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3c4e('0x0'));var util=require('util');var moment=require(_0x3c4e('0x1'));var BPromise=require(_0x3c4e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3c4e('0x3'));var db=require(_0x3c4e('0x4'))['db'];var utils=require(_0x3c4e('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3c4e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3c4e('0x7')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3c4e('0x8'))(new Redis(config[_0x3c4e('0x9')]));require(_0x3c4e('0xa'))[_0x3c4e('0xb')](socket);function respondWithRpcPromise(_0x2387df,_0x323469,_0x34d65d){return new BPromise(function(_0x4d2238,_0x2047ea){return client['request'](_0x2387df,_0x34d65d)[_0x3c4e('0xc')](function(_0xb61990){logger[_0x3c4e('0xd')](_0x3c4e('0xe'),_0x323469,_0x3c4e('0xf'));logger[_0x3c4e('0x10')](_0x3c4e('0x11'),_0x323469,_0x3c4e('0xf'),JSON[_0x3c4e('0x12')](_0xb61990));if(_0xb61990[_0x3c4e('0x13')]){if(_0xb61990[_0x3c4e('0x13')][_0x3c4e('0x14')]===0x1f4){logger[_0x3c4e('0x13')](_0x3c4e('0xe'),_0x323469,_0xb61990[_0x3c4e('0x13')]['message']);return _0x2047ea(_0xb61990[_0x3c4e('0x13')][_0x3c4e('0x15')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x323469,_0xb61990[_0x3c4e('0x13')][_0x3c4e('0x15')]);return _0x4d2238(_0xb61990['error']['message']);}else{logger[_0x3c4e('0xd')](_0x3c4e('0xe'),_0x323469,'request\x20sent');_0x4d2238(_0xb61990['result'][_0x3c4e('0x15')]);}})['catch'](function(_0x4c5a5d){logger[_0x3c4e('0x13')](_0x3c4e('0xe'),_0x323469,_0x4c5a5d);_0x2047ea(_0x4c5a5d);});});}
\ No newline at end of file
+var _0x455a=['code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error'];(function(_0x5943d3,_0x41e5fe){var _0x2e8469=function(_0x5786e1){while(--_0x5786e1){_0x5943d3['push'](_0x5943d3['shift']());}};_0x2e8469(++_0x41e5fe);}(_0x455a,0x10a));var _0xa455=function(_0x336fa0,_0x4e8281){_0x336fa0=_0x336fa0-0x0;var _0x4d1399=_0x455a[_0x336fa0];return _0x4d1399;};'use strict';var _=require(_0xa455('0x0'));var util=require(_0xa455('0x1'));var moment=require(_0xa455('0x2'));var BPromise=require(_0xa455('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa455('0x4'));var db=require(_0xa455('0x5'))['db'];var utils=require(_0xa455('0x6'));var logger=require(_0xa455('0x7'))(_0xa455('0x8'));var config=require(_0xa455('0x9'));var jayson=require(_0xa455('0xa'));var client=jayson[_0xa455('0xb')][_0xa455('0xc')]({'port':0x232a});config[_0xa455('0xd')]=_['defaults'](config[_0xa455('0xd')],{'host':_0xa455('0xe'),'port':0x18eb});var socket=require(_0xa455('0xf'))(new Redis(config['redis']));require(_0xa455('0x10'))[_0xa455('0x11')](socket);function respondWithRpcPromise(_0x4fd20a,_0x428180,_0x1b0586){return new BPromise(function(_0x2805f6,_0x52ed0a){return client[_0xa455('0x12')](_0x4fd20a,_0x1b0586)['then'](function(_0x5b61d3){logger['info'](_0xa455('0x13'),_0x428180,_0xa455('0x14'));logger[_0xa455('0x15')](_0xa455('0x16'),_0x428180,'request\x20sent',JSON['stringify'](_0x5b61d3));if(_0x5b61d3[_0xa455('0x17')]){if(_0x5b61d3['error'][_0xa455('0x18')]===0x1f4){logger[_0xa455('0x17')](_0xa455('0x13'),_0x428180,_0x5b61d3[_0xa455('0x17')][_0xa455('0x19')]);return _0x52ed0a(_0x5b61d3[_0xa455('0x17')][_0xa455('0x19')]);}logger['error'](_0xa455('0x13'),_0x428180,_0x5b61d3[_0xa455('0x17')][_0xa455('0x19')]);return _0x2805f6(_0x5b61d3[_0xa455('0x17')][_0xa455('0x19')]);}else{logger[_0xa455('0x1a')](_0xa455('0x13'),_0x428180,_0xa455('0x14'));_0x2805f6(_0x5b61d3[_0xa455('0x1b')][_0xa455('0x19')]);}})[_0xa455('0x1c')](function(_0x36b55c){logger[_0xa455('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x428180,_0x36b55c);_0x52ed0a(_0x36b55c);});});}
\ No newline at end of file
index 515bb74..ffbc654 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7a8=['chatWebsite:','./chatWebsite.events','remove','update','emit','removeListener','register'];(function(_0x3bfdde,_0x306be4){var _0x3f752a=function(_0x3b6751){while(--_0x3b6751){_0x3bfdde['push'](_0x3bfdde['shift']());}};_0x3f752a(++_0x306be4);}(_0xe7a8,0xa9));var _0x8e7a=function(_0x49f72d,_0x315dc6){_0x49f72d=_0x49f72d-0x0;var _0x4e1123=_0xe7a8[_0x49f72d];return _0x4e1123;};'use strict';var ChatWebsiteEvents=require(_0x8e7a('0x0'));var events=['save',_0x8e7a('0x1'),_0x8e7a('0x2')];function createListener(_0x29bae1,_0x36afd7){return function(_0x5a7b17){_0x36afd7[_0x8e7a('0x3')](_0x29bae1,_0x5a7b17);};}function removeListener(_0x349445,_0x188e1e){return function(){ChatWebsiteEvents[_0x8e7a('0x4')](_0x349445,_0x188e1e);};}exports[_0x8e7a('0x5')]=function(_0x4258c8){for(var _0x27b260=0x0,_0xb7aa39=events['length'];_0x27b260<_0xb7aa39;_0x27b260++){var _0x30bbc0=events[_0x27b260];var _0x13014a=createListener(_0x8e7a('0x6')+_0x30bbc0,_0x4258c8);ChatWebsiteEvents['on'](_0x30bbc0,_0x13014a);}};
\ No newline at end of file
+var _0xc8a3=['removeListener','length','./chatWebsite.events','save','remove','emit'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xc8a3,0x140));var _0x3c8a=function(_0x10da33,_0xcbf5db){_0x10da33=_0x10da33-0x0;var _0x17275f=_0xc8a3[_0x10da33];return _0x17275f;};'use strict';var ChatWebsiteEvents=require(_0x3c8a('0x0'));var events=[_0x3c8a('0x1'),_0x3c8a('0x2'),'update'];function createListener(_0x222feb,_0x2ea092){return function(_0x17fef8){_0x2ea092[_0x3c8a('0x3')](_0x222feb,_0x17fef8);};}function removeListener(_0x4c46bc,_0x46fe80){return function(){ChatWebsiteEvents[_0x3c8a('0x4')](_0x4c46bc,_0x46fe80);};}exports['register']=function(_0x5a4fcf){for(var _0x15f6ac=0x0,_0x38c735=events[_0x3c8a('0x5')];_0x15f6ac<_0x38c735;_0x15f6ac++){var _0x4f3590=events[_0x15f6ac];var _0x4c7b40=createListener('chatWebsite:'+_0x4f3590,_0x5a4fcf);ChatWebsiteEvents['on'](_0x4f3590,_0x4c7b40);}};
\ No newline at end of file
index 399355c..b528352 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7245=['get','isAuthenticated','index','describe','/:id','/:id/dispositions','getDispositions','getLogo','getAvatar','/:id/system_avatar','getSystemAvatar','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','/:id/canned_answers','addAnswer','join','server/files/images/logos/','format','%s-%s','now','originalname','/:id/logo','single','file','server/files/images/avatars/','/:id/avatar','addAvatar','diskStorage','root','/:id/customer_avatar','addSystemAvatar','notify','server/files','attachments','ensureDir','extname','replace','/:id/offline','offline','addInteraction','/:id/proactive_actions','addAgents','put','update','delete','destroy','removeAnswers','exports','multer','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x4d9e30,_0x15912b){var _0x4691fb=function(_0x5b7895){while(--_0x5b7895){_0x4d9e30['push'](_0x4d9e30['shift']());}};_0x4691fb(++_0x15912b);}(_0x7245,0x7c));var _0x5724=function(_0x28e781,_0x38485b){_0x28e781=_0x28e781-0x0;var _0x4c4cb5=_0x7245[_0x28e781];return _0x4c4cb5;};'use strict';var multer=require(_0x5724('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5724('0x1'));var express=require(_0x5724('0x2'));var router=express[_0x5724('0x3')]();var fs_extra=require(_0x5724('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5724('0x5'));var controller=require('./chatWebsite.controller');router[_0x5724('0x6')]('/',auth[_0x5724('0x7')](),controller[_0x5724('0x8')]);router[_0x5724('0x6')]('/describe',auth[_0x5724('0x7')](),controller[_0x5724('0x9')]);router[_0x5724('0x6')](_0x5724('0xa'),auth[_0x5724('0x7')](),controller['show']);router[_0x5724('0x6')](_0x5724('0xb'),auth[_0x5724('0x7')](),controller[_0x5724('0xc')]);router[_0x5724('0x6')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router[_0x5724('0x6')]('/:id/logo',controller[_0x5724('0xd')]);router[_0x5724('0x6')]('/:id/avatar',controller[_0x5724('0xe')]);router[_0x5724('0x6')]('/:id/customer_avatar',controller['getCustomerAvatar']);router[_0x5724('0x6')](_0x5724('0xf'),controller[_0x5724('0x10')]);router[_0x5724('0x6')]('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router['get'](_0x5724('0x11'),controller[_0x5724('0x12')]);router[_0x5724('0x6')](_0x5724('0x13'),auth[_0x5724('0x7')](),controller[_0x5724('0x14')]);router['get']('/:id/proactive_actions',auth[_0x5724('0x7')](),controller[_0x5724('0x15')]);router['get'](_0x5724('0x16'),controller[_0x5724('0x17')]);router[_0x5724('0x6')](_0x5724('0x18'),auth[_0x5724('0x7')](),controller[_0x5724('0x19')]);router['get'](_0x5724('0x1a'),auth['isAuthenticated'](),controller[_0x5724('0x1b')]);router[_0x5724('0x1c')]('/',auth[_0x5724('0x7')](),controller[_0x5724('0x1d')]);router[_0x5724('0x1c')](_0x5724('0xb'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0x5724('0x1e'),auth[_0x5724('0x7')](),controller[_0x5724('0x1f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1ac7fa,_0x1989bb,_0x20ebec){_0x20ebec(null,path[_0x5724('0x20')](config['root'],_0x5724('0x21')));},'filename':function(_0x4fed71,_0x2b205c,_0x4ca2ea){_0x4ca2ea(null,util[_0x5724('0x22')](_0x5724('0x23'),Date[_0x5724('0x24')](),_0x2b205c[_0x5724('0x25')]));}})});router[_0x5724('0x1c')](_0x5724('0x26'),upload[_0x5724('0x27')](_0x5724('0x28')),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3d5cbc,_0x366d1f,_0x590717){_0x590717(null,path[_0x5724('0x20')](config['root'],_0x5724('0x29')));},'filename':function(_0x2a44a7,_0x547576,_0x3fa6cd){_0x3fa6cd(null,util[_0x5724('0x22')]('%s-%s',Date[_0x5724('0x24')](),_0x547576[_0x5724('0x25')]));}})});router['post'](_0x5724('0x2a'),upload[_0x5724('0x27')](_0x5724('0x28')),controller[_0x5724('0x2b')]);var upload=multer({'storage':multer[_0x5724('0x2c')]({'destination':function(_0xa4c325,_0x23d9f9,_0x544817){_0x544817(null,path[_0x5724('0x20')](config[_0x5724('0x2d')],_0x5724('0x29')));},'filename':function(_0x21f2c7,_0x40b07e,_0x57a5e0){_0x57a5e0(null,util[_0x5724('0x22')](_0x5724('0x23'),Date[_0x5724('0x24')](),_0x40b07e[_0x5724('0x25')]));}})});router[_0x5724('0x1c')](_0x5724('0x2e'),upload[_0x5724('0x27')](_0x5724('0x28')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x5724('0x2c')]({'destination':function(_0x2e0657,_0x4bd00e,_0x4eb855){_0x4eb855(null,path[_0x5724('0x20')](config[_0x5724('0x2d')],_0x5724('0x29')));},'filename':function(_0x444f52,_0x3ceb27,_0x34b508){_0x34b508(null,util['format'](_0x5724('0x23'),Date['now'](),_0x3ceb27['originalname']));}})});router['post']('/:id/system_avatar',upload[_0x5724('0x27')](_0x5724('0x28')),controller[_0x5724('0x2f')]);router['post']('/:id/notify',controller[_0x5724('0x30')]);const offlineUploadMulter=multer({'storage':multer[_0x5724('0x2c')]({'destination':function(_0x31b5aa,_0x2e8ed3,_0x5165c4){const _0x18e079=path[_0x5724('0x20')](config['root'],_0x5724('0x31'),_0x5724('0x32'),'offline-chat');fs_extra[_0x5724('0x33')](_0x18e079,function(){_0x5165c4(null,_0x18e079);});},'filename':function(_0x42f41c,_0xda964d,_0x4cafc6){const _0x5a4ebe=_0xda964d[_0x5724('0x25')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x551505=path[_0x5724('0x34')](_0x5a4ebe);const _0x58d142=Date[_0x5724('0x24')]()+'-'+_0x5a4ebe[_0x5724('0x35')](_0x551505,'')+_0x551505;_0x4cafc6(null,_0x58d142);}})});router[_0x5724('0x1c')](_0x5724('0x36'),offlineUploadMulter['any'](),controller[_0x5724('0x37')]);router[_0x5724('0x1c')]('/:id/interactions',auth[_0x5724('0x7')](),controller[_0x5724('0x38')]);router['post'](_0x5724('0x13'),auth[_0x5724('0x7')](),controller['addApplications']);router[_0x5724('0x1c')](_0x5724('0x39'),auth['isAuthenticated'](),controller['addProactiveActions']);router['post'](_0x5724('0x1a'),auth[_0x5724('0x7')](),controller[_0x5724('0x3a')]);router[_0x5724('0x3b')](_0x5724('0xa'),auth['isAuthenticated'](),controller[_0x5724('0x3c')]);router[_0x5724('0x3d')](_0x5724('0xa'),auth[_0x5724('0x7')](),controller[_0x5724('0x3e')]);router[_0x5724('0x3d')](_0x5724('0xb'),auth[_0x5724('0x7')](),controller['removeDispositions']);router[_0x5724('0x3d')](_0x5724('0x1e'),auth[_0x5724('0x7')](),controller[_0x5724('0x3f')]);router[_0x5724('0x3d')](_0x5724('0x1a'),auth[_0x5724('0x7')](),controller['removeAgents']);module[_0x5724('0x40')]=router;
\ No newline at end of file
+var _0x721d=['addCustomerAvatar','/:id/notify','notify','server/files','attachments','ensureDir','replace','extname','/:id/offline','any','offline','/:id/interactions','addInteraction','addApplications','addProactiveActions','addAgents','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','/describe','describe','/:id','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','addAvatar'];(function(_0x10ec04,_0x45ca9d){var _0x46eca4=function(_0x307ba1){while(--_0x307ba1){_0x10ec04['push'](_0x10ec04['shift']());}};_0x46eca4(++_0x45ca9d);}(_0x721d,0xf5));var _0xd721=function(_0x4940a0,_0x3f9be1){_0x4940a0=_0x4940a0-0x0;var _0x556f14=_0x721d[_0x4940a0];return _0x556f14;};'use strict';var multer=require(_0xd721('0x0'));var util=require(_0xd721('0x1'));var path=require(_0xd721('0x2'));var timeout=require(_0xd721('0x3'));var express=require(_0xd721('0x4'));var router=express[_0xd721('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd721('0x6'));var interaction=require(_0xd721('0x7'));var config=require('../../config/environment');var controller=require(_0xd721('0x8'));router[_0xd721('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd721('0x9')](_0xd721('0xa'),auth['isAuthenticated'](),controller[_0xd721('0xb')]);router[_0xd721('0x9')](_0xd721('0xc'),auth['isAuthenticated'](),controller[_0xd721('0xd')]);router[_0xd721('0x9')](_0xd721('0xe'),auth[_0xd721('0xf')](),controller[_0xd721('0x10')]);router[_0xd721('0x9')](_0xd721('0x11'),auth[_0xd721('0xf')](),controller[_0xd721('0x12')]);router[_0xd721('0x9')](_0xd721('0x13'),controller[_0xd721('0x14')]);router[_0xd721('0x9')](_0xd721('0x15'),controller[_0xd721('0x16')]);router['get'](_0xd721('0x17'),controller['getCustomerAvatar']);router[_0xd721('0x9')](_0xd721('0x18'),controller[_0xd721('0x19')]);router[_0xd721('0x9')]('/:id/interactions',auth[_0xd721('0xf')](),controller['getInteractions']);router[_0xd721('0x9')](_0xd721('0x1a'),controller[_0xd721('0x1b')]);router[_0xd721('0x9')](_0xd721('0x1c'),auth[_0xd721('0xf')](),controller[_0xd721('0x1d')]);router[_0xd721('0x9')]('/:id/proactive_actions',auth[_0xd721('0xf')](),controller[_0xd721('0x1e')]);router[_0xd721('0x9')](_0xd721('0x1f'),controller[_0xd721('0x20')]);router[_0xd721('0x9')]('/:id/offline_messages',auth[_0xd721('0xf')](),controller['getOfflineMessages']);router['get'](_0xd721('0x21'),auth[_0xd721('0xf')](),controller[_0xd721('0x22')]);router[_0xd721('0x23')]('/',auth[_0xd721('0xf')](),controller[_0xd721('0x24')]);router[_0xd721('0x23')]('/:id/dispositions',auth[_0xd721('0xf')](),controller[_0xd721('0x25')]);router[_0xd721('0x23')](_0xd721('0x11'),auth[_0xd721('0xf')](),controller[_0xd721('0x26')]);var upload=multer({'storage':multer[_0xd721('0x27')]({'destination':function(_0x4ed9d6,_0x16269d,_0x271f93){_0x271f93(null,path[_0xd721('0x28')](config[_0xd721('0x29')],'server/files/images/logos/'));},'filename':function(_0xe0f0d4,_0x80f96d,_0x4a478e){_0x4a478e(null,util[_0xd721('0x2a')](_0xd721('0x2b'),Date[_0xd721('0x2c')](),_0x80f96d[_0xd721('0x2d')]));}})});router[_0xd721('0x23')](_0xd721('0x13'),upload[_0xd721('0x2e')](_0xd721('0x2f')),controller[_0xd721('0x30')]);var upload=multer({'storage':multer[_0xd721('0x27')]({'destination':function(_0x5a2064,_0x47a72d,_0x1938cf){_0x1938cf(null,path[_0xd721('0x28')](config[_0xd721('0x29')],_0xd721('0x31')));},'filename':function(_0x46fd59,_0xb706de,_0x27a605){_0x27a605(null,util['format'](_0xd721('0x2b'),Date[_0xd721('0x2c')](),_0xb706de[_0xd721('0x2d')]));}})});router[_0xd721('0x23')](_0xd721('0x15'),upload[_0xd721('0x2e')]('file'),controller[_0xd721('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xb0f3,_0x418432,_0x5aaa11){_0x5aaa11(null,path[_0xd721('0x28')](config[_0xd721('0x29')],_0xd721('0x31')));},'filename':function(_0x9322a,_0x141c89,_0x34bbfc){_0x34bbfc(null,util[_0xd721('0x2a')](_0xd721('0x2b'),Date['now'](),_0x141c89[_0xd721('0x2d')]));}})});router[_0xd721('0x23')](_0xd721('0x17'),upload[_0xd721('0x2e')](_0xd721('0x2f')),controller[_0xd721('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x38ad8d,_0x5849fc,_0x505de1){_0x505de1(null,path[_0xd721('0x28')](config[_0xd721('0x29')],_0xd721('0x31')));},'filename':function(_0x52bf06,_0x242063,_0x617d4f){_0x617d4f(null,util['format']('%s-%s',Date[_0xd721('0x2c')](),_0x242063['originalname']));}})});router[_0xd721('0x23')](_0xd721('0x18'),upload['single'](_0xd721('0x2f')),controller['addSystemAvatar']);router[_0xd721('0x23')](_0xd721('0x34'),controller[_0xd721('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0xd721('0x27')]({'destination':function(_0x41f2e0,_0x22e3c1,_0x5ee9c8){const _0x9d7704=path[_0xd721('0x28')](config['root'],_0xd721('0x36'),_0xd721('0x37'),'offline-chat');fs_extra[_0xd721('0x38')](_0x9d7704,function(){_0x5ee9c8(null,_0x9d7704);});},'filename':function(_0x27becd,_0x2f5954,_0x3527b5){const _0x470ce5=_0x2f5954[_0xd721('0x2d')][_0xd721('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2acd74=path[_0xd721('0x3a')](_0x470ce5);const _0x17574e=Date['now']()+'-'+_0x470ce5['replace'](_0x2acd74,'')+_0x2acd74;_0x3527b5(null,_0x17574e);}})});router[_0xd721('0x23')](_0xd721('0x3b'),offlineUploadMulter[_0xd721('0x3c')](),controller[_0xd721('0x3d')]);router[_0xd721('0x23')](_0xd721('0x3e'),auth[_0xd721('0xf')](),controller[_0xd721('0x3f')]);router[_0xd721('0x23')](_0xd721('0x1c'),auth['isAuthenticated'](),controller[_0xd721('0x40')]);router[_0xd721('0x23')]('/:id/proactive_actions',auth[_0xd721('0xf')](),controller[_0xd721('0x41')]);router[_0xd721('0x23')]('/:id/users',auth['isAuthenticated'](),controller[_0xd721('0x42')]);router[_0xd721('0x43')](_0xd721('0xc'),auth[_0xd721('0xf')](),controller['update']);router[_0xd721('0x44')](_0xd721('0xc'),auth[_0xd721('0xf')](),controller[_0xd721('0x45')]);router[_0xd721('0x44')](_0xd721('0xe'),auth[_0xd721('0xf')](),controller[_0xd721('0x46')]);router['delete'](_0xd721('0x11'),auth[_0xd721('0xf')](),controller[_0xd721('0x47')]);router[_0xd721('0x44')](_0xd721('0x21'),auth[_0xd721('0xf')](),controller[_0xd721('0x48')]);module[_0xd721('0x49')]=router;
\ No newline at end of file
index c185a51..7cb4347 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4453=['STRING','sequelize','exports','ENUM','AmazonAWS'];(function(_0x53286a,_0x485c92){var _0x5730ff=function(_0x478c81){while(--_0x478c81){_0x53286a['push'](_0x53286a['shift']());}};_0x5730ff(++_0x485c92);}(_0x4453,0x9c));var _0x3445=function(_0x45ff95,_0x4c138e){_0x45ff95=_0x45ff95-0x0;var _0x3ff0a7=_0x4453[_0x45ff95];return _0x3ff0a7;};'use strict';var Sequelize=require(_0x3445('0x0'));module[_0x3445('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x3445('0x2')](_0x3445('0x3'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x3445('0x4')]},'data2':{'type':Sequelize[_0x3445('0x4')]}};
\ No newline at end of file
+var _0xd1f9=['STRING','ENUM','AmazonAWS','Google'];(function(_0x590001,_0x3505fe){var _0x291888=function(_0x10ffd){while(--_0x10ffd){_0x590001['push'](_0x590001['shift']());}};_0x291888(++_0x3505fe);}(_0xd1f9,0x88));var _0x9d1f=function(_0x20c6f1,_0x21fa65){_0x20c6f1=_0x20c6f1-0x0;var _0x43c3bf=_0xd1f9[_0x20c6f1];return _0x43c3bf;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9d1f('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x9d1f('0x1')](_0x9d1f('0x2'),_0x9d1f('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x9d1f('0x0')]},'data2':{'type':Sequelize[_0x9d1f('0x0')]}};
\ No newline at end of file
index 39a3deb..54f0d8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','send','index','CloudProvider','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','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'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x5f2f,0x73));var _0xf5f2=function(_0x277ca5,_0x1b1451){_0x277ca5=_0x277ca5-0x0;var _0x48fa84=_0x5f2f[_0x277ca5];return _0x48fa84;};'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));};
\ No newline at end of file
+var _0xdb28=['error','stack','name','send','index','CloudProvider','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','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'];(function(_0x5a4d4c,_0x4e74b5){var _0x476ce4=function(_0x10aa22){while(--_0x10aa22){_0x5a4d4c['push'](_0x5a4d4c['shift']());}};_0x476ce4(++_0x4e74b5);}(_0xdb28,0x106));var _0x8db2=function(_0x1f0ceb,_0x41ca3f){_0x1f0ceb=_0x1f0ceb-0x0;var _0x20696d=_0xdb28[_0x1f0ceb];return _0x20696d;};'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']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':!![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));};
\ No newline at end of file
index 90c6e57..1a48c6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1db=['./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x377924,_0x50bdca){var _0x5ad504=function(_0x220c81){while(--_0x220c81){_0x377924['push'](_0x377924['shift']());}};_0x5ad504(++_0x50bdca);}(_0xd1db,0x13d));var _0xbd1d=function(_0x5f4cd7,_0x459c44){_0x5f4cd7=_0x5f4cd7-0x0;var _0x47c93f=_0xd1db[_0x5f4cd7];return _0x47c93f;};'use strict';var _=require(_0xbd1d('0x0'));var util=require(_0xbd1d('0x1'));var logger=require(_0xbd1d('0x2'))(_0xbd1d('0x3'));var moment=require('moment');var BPromise=require(_0xbd1d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd1d('0x5'));var rimraf=require(_0xbd1d('0x6'));var config=require(_0xbd1d('0x7'));var attributes=require(_0xbd1d('0x8'));module[_0xbd1d('0x9')]=function(_0x542c12,_0x85b70e){return _0x542c12[_0xbd1d('0xa')](_0xbd1d('0xb'),attributes,{'tableName':_0xbd1d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0e50=['path','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x3bd139,_0x52a505){var _0xa9342a=function(_0xb2a913){while(--_0xb2a913){_0x3bd139['push'](_0x3bd139['shift']());}};_0xa9342a(++_0x52a505);}(_0x0e50,0x187));var _0x00e5=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x0e50[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0x00e5('0x0'));var util=require('util');var logger=require(_0x00e5('0x1'))(_0x00e5('0x2'));var moment=require('moment');var BPromise=require(_0x00e5('0x3'));var rp=require(_0x00e5('0x4'));var fs=require('fs');var path=require(_0x00e5('0x5'));var rimraf=require('rimraf');var config=require(_0x00e5('0x6'));var attributes=require(_0x00e5('0x7'));module[_0x00e5('0x8')]=function(_0x33df4f,_0x4c0967){return _0x33df4f[_0x00e5('0x9')](_0x00e5('0xa'),attributes,{'tableName':_0x00e5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 96cda6a..28a593f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa64=['rpc','../../config/environment','jayson/promise','client','http','request','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x5c8be7,_0x5178b2){var _0x15976c=function(_0x3f57f8){while(--_0x3f57f8){_0x5c8be7['push'](_0x5c8be7['shift']());}};_0x15976c(++_0x5178b2);}(_0xaa64,0xf7));var _0x4aa6=function(_0x85d355,_0x546c82){_0x85d355=_0x85d355-0x0;var _0x31057a=_0xaa64[_0x85d355];return _0x31057a;};'use strict';var _=require(_0x4aa6('0x0'));var util=require(_0x4aa6('0x1'));var moment=require('moment');var BPromise=require(_0x4aa6('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4aa6('0x3'));var db=require(_0x4aa6('0x4'))['db'];var utils=require(_0x4aa6('0x5'));var logger=require('../../config/logger')(_0x4aa6('0x6'));var config=require(_0x4aa6('0x7'));var jayson=require(_0x4aa6('0x8'));var client=jayson[_0x4aa6('0x9')][_0x4aa6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7dd83d,_0x39c4b5,_0x49e174){return new BPromise(function(_0x529c89,_0xee21ba){return client[_0x4aa6('0xb')](_0x7dd83d,_0x49e174)['then'](function(_0x26619c){logger['info'](_0x4aa6('0xc'),_0x39c4b5,_0x4aa6('0xd'));logger[_0x4aa6('0xe')](_0x4aa6('0xf'),_0x39c4b5,'request\x20sent',JSON[_0x4aa6('0x10')](_0x26619c));if(_0x26619c[_0x4aa6('0x11')]){if(_0x26619c[_0x4aa6('0x11')][_0x4aa6('0x12')]===0x1f4){logger[_0x4aa6('0x11')](_0x4aa6('0xc'),_0x39c4b5,_0x26619c[_0x4aa6('0x11')][_0x4aa6('0x13')]);return _0xee21ba(_0x26619c[_0x4aa6('0x11')][_0x4aa6('0x13')]);}logger['error'](_0x4aa6('0xc'),_0x39c4b5,_0x26619c['error']['message']);return _0x529c89(_0x26619c[_0x4aa6('0x11')][_0x4aa6('0x13')]);}else{logger[_0x4aa6('0x14')](_0x4aa6('0xc'),_0x39c4b5,_0x4aa6('0xd'));_0x529c89(_0x26619c[_0x4aa6('0x15')][_0x4aa6('0x13')]);}})[_0x4aa6('0x16')](function(_0x530ed0){logger[_0x4aa6('0x11')]('CloudProvider,\x20%s,\x20%s',_0x39c4b5,_0x530ed0);_0xee21ba(_0x530ed0);});});}
\ No newline at end of file
+var _0xacc6=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch'];(function(_0xcf0479,_0x537ff7){var _0x1e350e=function(_0x1ba284){while(--_0x1ba284){_0xcf0479['push'](_0xcf0479['shift']());}};_0x1e350e(++_0x537ff7);}(_0xacc6,0x150));var _0x6acc=function(_0x358806,_0x322b66){_0x358806=_0x358806-0x0;var _0x19fdcb=_0xacc6[_0x358806];return _0x19fdcb;};'use strict';var _=require(_0x6acc('0x0'));var util=require(_0x6acc('0x1'));var moment=require(_0x6acc('0x2'));var BPromise=require(_0x6acc('0x3'));var rs=require(_0x6acc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6acc('0x5'))['db'];var utils=require(_0x6acc('0x6'));var logger=require(_0x6acc('0x7'))('rpc');var config=require(_0x6acc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6acc('0x9')][_0x6acc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e7f3a,_0x41edfd,_0x48b1a8){return new BPromise(function(_0x1f95e8,_0x538730){return client[_0x6acc('0xb')](_0x5e7f3a,_0x48b1a8)[_0x6acc('0xc')](function(_0x4d6b7f){logger[_0x6acc('0xd')]('CloudProvider,\x20%s,\x20%s',_0x41edfd,_0x6acc('0xe'));logger[_0x6acc('0xf')](_0x6acc('0x10'),_0x41edfd,_0x6acc('0xe'),JSON[_0x6acc('0x11')](_0x4d6b7f));if(_0x4d6b7f[_0x6acc('0x12')]){if(_0x4d6b7f['error'][_0x6acc('0x13')]===0x1f4){logger[_0x6acc('0x12')](_0x6acc('0x14'),_0x41edfd,_0x4d6b7f[_0x6acc('0x12')][_0x6acc('0x15')]);return _0x538730(_0x4d6b7f['error']['message']);}logger[_0x6acc('0x12')](_0x6acc('0x14'),_0x41edfd,_0x4d6b7f[_0x6acc('0x12')][_0x6acc('0x15')]);return _0x1f95e8(_0x4d6b7f[_0x6acc('0x12')][_0x6acc('0x15')]);}else{logger[_0x6acc('0xd')](_0x6acc('0x14'),_0x41edfd,_0x6acc('0xe'));_0x1f95e8(_0x4d6b7f[_0x6acc('0x16')][_0x6acc('0x15')]);}})[_0x6acc('0x17')](function(_0x31c4c2){logger[_0x6acc('0x12')](_0x6acc('0x14'),_0x41edfd,_0x31c4c2);_0x538730(_0x31c4c2);});});}
\ No newline at end of file
index c78b659..0ed66c5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13ef=['../../components/auth/service','../../config/environment','./cloudProvider.controller','get','index','/:id','show','isAuthenticated','put','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x59ece8,_0xc1be9a){var _0x4ae43e=function(_0x32b914){while(--_0x32b914){_0x59ece8['push'](_0x59ece8['shift']());}};_0x4ae43e(++_0xc1be9a);}(_0x13ef,0x19c));var _0xf13e=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x13ef[_0x20ef64];return _0x3707d8;};'use strict';var multer=require(_0xf13e('0x0'));var util=require(_0xf13e('0x1'));var path=require(_0xf13e('0x2'));var timeout=require(_0xf13e('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf13e('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf13e('0x5'));var controller=require(_0xf13e('0x6'));router[_0xf13e('0x7')]('/',auth['isAuthenticated'](),controller[_0xf13e('0x8')]);router[_0xf13e('0x7')](_0xf13e('0x9'),auth['isAuthenticated'](),controller[_0xf13e('0xa')]);router['post']('/',auth[_0xf13e('0xb')](),controller['create']);router[_0xf13e('0xc')](_0xf13e('0x9'),auth[_0xf13e('0xb')](),controller[_0xf13e('0xd')]);router['delete'](_0xf13e('0x9'),auth[_0xf13e('0xb')](),controller[_0xf13e('0xe')]);module[_0xf13e('0xf')]=router;
\ No newline at end of file
+var _0x83a7=['/:id','update','destroy','multer','util','express','Router','fs-extra','../../config/environment','./cloudProvider.controller','get','index','isAuthenticated','post','put'];(function(_0x377609,_0x50c4ef){var _0x16978b=function(_0x5cd0b1){while(--_0x5cd0b1){_0x377609['push'](_0x377609['shift']());}};_0x16978b(++_0x50c4ef);}(_0x83a7,0x1f2));var _0x783a=function(_0x14edcd,_0x3dd904){_0x14edcd=_0x14edcd-0x0;var _0x2d3e00=_0x83a7[_0x14edcd];return _0x2d3e00;};'use strict';var multer=require(_0x783a('0x0'));var util=require(_0x783a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x783a('0x2'));var router=express[_0x783a('0x3')]();var fs_extra=require(_0x783a('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x783a('0x5'));var controller=require(_0x783a('0x6'));router[_0x783a('0x7')]('/',auth['isAuthenticated'](),controller[_0x783a('0x8')]);router[_0x783a('0x7')]('/:id',auth[_0x783a('0x9')](),controller['show']);router[_0x783a('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x783a('0xb')](_0x783a('0xc'),auth['isAuthenticated'](),controller[_0x783a('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x783a('0xe')]);module['exports']=router;
\ No newline at end of file
index 9760542..972074f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b4a=['STRING','sequelize'];(function(_0x5c44bc,_0x499961){var _0x2ba826=function(_0x49c3df){while(--_0x49c3df){_0x5c44bc['push'](_0x5c44bc['shift']());}};_0x2ba826(++_0x499961);}(_0x7b4a,0x119));var _0xa7b4=function(_0x67ef3d,_0x50f0bd){_0x67ef3d=_0x67ef3d-0x0;var _0x2ef03e=_0x7b4a[_0x67ef3d];return _0x2ef03e;};'use strict';var Sequelize=require(_0xa7b4('0x0'));module['exports']={'name':{'type':Sequelize[_0xa7b4('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa7b4('0x1')]},'companyId':{'type':Sequelize[_0xa7b4('0x1')]},'website':{'type':Sequelize[_0xa7b4('0x1')]},'phone':{'type':Sequelize[_0xa7b4('0x1')]},'fax':{'type':Sequelize[_0xa7b4('0x1')]},'type':{'type':Sequelize[_0xa7b4('0x1')]},'street':{'type':Sequelize[_0xa7b4('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa7b4('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xa7b4('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa7b4('0x1')]},'sStreet':{'type':Sequelize[_0xa7b4('0x1')]},'sPostalCode':{'type':Sequelize[_0xa7b4('0x1')]},'sCity':{'type':Sequelize[_0xa7b4('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa7b4('0x1')]}};
\ No newline at end of file
+var _0xdd92=['sequelize','exports','STRING','name'];(function(_0x57f74a,_0x3f8b13){var _0x15b677=function(_0x332610){while(--_0x332610){_0x57f74a['push'](_0x57f74a['shift']());}};_0x15b677(++_0x3f8b13);}(_0xdd92,0x188));var _0x2dd9=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xdd92[_0x5f1391];return _0x50ebe3;};'use strict';var Sequelize=require(_0x2dd9('0x0'));module[_0x2dd9('0x1')]={'name':{'type':Sequelize[_0x2dd9('0x2')],'unique':_0x2dd9('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x2dd9('0x2')]},'website':{'type':Sequelize[_0x2dd9('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x2dd9('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x2dd9('0x2')]},'postalCode':{'type':Sequelize[_0x2dd9('0x2')]},'city':{'type':Sequelize[_0x2dd9('0x2')]},'country':{'type':Sequelize[_0x2dd9('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x2dd9('0x2')]},'sStreet':{'type':Sequelize[_0x2dd9('0x2')]},'sPostalCode':{'type':Sequelize[_0x2dd9('0x2')]},'sCity':{'type':Sequelize[_0x2dd9('0x2')]},'sCountry':{'type':Sequelize[_0x2dd9('0x2')]},'description':{'type':Sequelize[_0x2dd9('0x2')]}};
\ No newline at end of file
index 7dae7d5..6d798ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd30c=['hasOwnProperty','order','sort','where','pick','map','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','CmContact','addContacts','ids','options','nolimit','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','then','destroy','get','Companies','UserProfileResource','error','stack','name','send','index','CmCompany','describe','model','query','keys','filters','intersection','fields','attributes','length'];(function(_0x36c20f,_0x591729){var _0x5a84ad=function(_0x22afd6){while(--_0x22afd6){_0x36c20f['push'](_0x36c20f['shift']());}};_0x5a84ad(++_0x591729);}(_0xd30c,0x12b));var _0xcd30=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xd30c[_0x24f31b];return _0x488401;};'use strict';var emlformat=require(_0xcd30('0x0'));var rimraf=require(_0xcd30('0x1'));var zipdir=require(_0xcd30('0x2'));var jsonpatch=require(_0xcd30('0x3'));var rp=require(_0xcd30('0x4'));var moment=require(_0xcd30('0x5'));var BPromise=require(_0xcd30('0x6'));var Mustache=require(_0xcd30('0x7'));var util=require(_0xcd30('0x8'));var path=require(_0xcd30('0x9'));var sox=require(_0xcd30('0xa'));var csv=require(_0xcd30('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcd30('0xc'));var squel=require(_0xcd30('0xd'));var crypto=require(_0xcd30('0xe'));var jsforce=require(_0xcd30('0xf'));var deskjs=require(_0xcd30('0x10'));var toCsv=require(_0xcd30('0xb'));var querystring=require('querystring');var Papa=require(_0xcd30('0x11'));var Redis=require(_0xcd30('0x12'));var authService=require(_0xcd30('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xcd30('0x14'));var hardwareService=require(_0xcd30('0x15'));var logger=require('../../config/logger')(_0xcd30('0x16'));var utils=require(_0xcd30('0x17'));var config=require(_0xcd30('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xcd30('0x19'))['db'];function respondWithStatusCode(_0x53297b,_0x254887){_0x254887=_0x254887||0xcc;return function(_0x433ae3){if(_0x433ae3){return _0x53297b[_0xcd30('0x1a')](_0x254887);}return _0x53297b[_0xcd30('0x1b')](_0x254887)[_0xcd30('0x1c')]();};}function respondWithResult(_0x46043b,_0x479e23){_0x479e23=_0x479e23||0xc8;return function(_0x2a45a7){if(_0x2a45a7){return _0x46043b['status'](_0x479e23)[_0xcd30('0x1d')](_0x2a45a7);}};}function respondWithFilteredResult(_0x382bfe,_0x1851de){return function(_0x5d9930){if(_0x5d9930){var _0x142f4c=typeof _0x1851de['offset']===_0xcd30('0x1e')&&typeof _0x1851de['limit']==='undefined';var _0x50202e=_0x5d9930[_0xcd30('0x1f')];var _0x424a17=_0x142f4c?0x0:_0x1851de[_0xcd30('0x20')];var _0x513ce5=_0x142f4c?_0x5d9930[_0xcd30('0x1f')]:_0x1851de[_0xcd30('0x20')]+_0x1851de[_0xcd30('0x21')];var _0x2d9d92;if(_0x513ce5>=_0x50202e){_0x513ce5=_0x50202e;_0x2d9d92=0xc8;}else{_0x2d9d92=0xce;}_0x382bfe[_0xcd30('0x1b')](_0x2d9d92);return _0x382bfe['set'](_0xcd30('0x22'),_0x424a17+'-'+_0x513ce5+'/'+_0x50202e)[_0xcd30('0x1d')](_0x5d9930);}return null;};}function patchUpdates(_0x55a5dd){return function(_0x1e815a){try{jsonpatch[_0xcd30('0x23')](_0x1e815a,_0x55a5dd,!![]);}catch(_0x3b1c26){return BPromise[_0xcd30('0x24')](_0x3b1c26);}return _0x1e815a['save']();};}function saveUpdates(_0x13328e,_0x5a5106){return function(_0x321f7f){if(_0x321f7f){return _0x321f7f['update'](_0x13328e)[_0xcd30('0x25')](function(_0x19c600){return _0x19c600;});}return null;};}function removeEntity(_0xa42147,_0x359fb5){return function(_0x54f6e6){if(_0x54f6e6){return _0x54f6e6[_0xcd30('0x26')]()[_0xcd30('0x25')](function(){var _0x5eb9d4=_0x54f6e6[_0xcd30('0x27')]({'plain':!![]});var _0x129101=_0xcd30('0x28');return db[_0xcd30('0x29')][_0xcd30('0x26')]({'where':{'type':_0x129101,'resourceId':_0x5eb9d4['id']}})[_0xcd30('0x25')](function(){return _0x54f6e6;});})[_0xcd30('0x25')](function(){_0xa42147['status'](0xcc)[_0xcd30('0x1c')]();});}};}function handleEntityNotFound(_0xb5c846,_0x3e20e5){return function(_0x1c238d){if(!_0x1c238d){_0xb5c846[_0xcd30('0x1a')](0x194);}return _0x1c238d;};}function handleError(_0x14887e,_0x5369e3){_0x5369e3=_0x5369e3||0x1f4;return function(_0x582dee){logger[_0xcd30('0x2a')](_0x582dee[_0xcd30('0x2b')]);if(_0x582dee[_0xcd30('0x2c')]){delete _0x582dee[_0xcd30('0x2c')];}_0x14887e['status'](_0x5369e3)[_0xcd30('0x2d')](_0x582dee);};}exports[_0xcd30('0x2e')]=function(_0x415e74,_0x43c4ef){var _0x32b25e={},_0x122921={},_0x4392d4={'count':0x0,'rows':[]};return db[_0xcd30('0x2f')][_0xcd30('0x30')]()[_0xcd30('0x25')](function(_0x1aebf2){_0x122921[_0xcd30('0x31')]=_['keys'](_0x1aebf2);_0x122921[_0xcd30('0x32')]=_[_0xcd30('0x33')](_0x415e74['query']);_0x122921[_0xcd30('0x34')]=_[_0xcd30('0x35')](_0x122921[_0xcd30('0x31')],_0x122921[_0xcd30('0x32')]);_0x32b25e['attributes']=_[_0xcd30('0x35')](_0x122921[_0xcd30('0x31')],qs[_0xcd30('0x36')](_0x415e74[_0xcd30('0x32')][_0xcd30('0x36')]));_0x32b25e[_0xcd30('0x37')]=_0x32b25e[_0xcd30('0x37')][_0xcd30('0x38')]?_0x32b25e[_0xcd30('0x37')]:_0x122921[_0xcd30('0x31')];if(!_0x415e74[_0xcd30('0x32')][_0xcd30('0x39')]('nolimit')){_0x32b25e['limit']=qs[_0xcd30('0x21')](_0x415e74[_0xcd30('0x32')][_0xcd30('0x21')]);_0x32b25e['offset']=qs[_0xcd30('0x20')](_0x415e74['query'][_0xcd30('0x20')]);}_0x32b25e[_0xcd30('0x3a')]=qs[_0xcd30('0x3b')](_0x415e74[_0xcd30('0x32')][_0xcd30('0x3b')]);_0x32b25e[_0xcd30('0x3c')]=qs[_0xcd30('0x34')](_[_0xcd30('0x3d')](_0x415e74['query'],_0x122921[_0xcd30('0x34')]),_0x1aebf2);if(_0x415e74[_0xcd30('0x32')]['filter']){_0x32b25e[_0xcd30('0x3c')]=_['merge'](_0x32b25e[_0xcd30('0x3c')],{'$or':_[_0xcd30('0x3e')](_0x32b25e[_0xcd30('0x37')],function(_0x21f6c3){var _0x5e152e={};_0x5e152e[_0x21f6c3]={'$like':'%'+_0x415e74[_0xcd30('0x32')][_0xcd30('0x3f')]+'%'};return _0x5e152e;})});}_0x32b25e=_['merge']({},_0x32b25e,_0x415e74['options']);var _0x30e17b={'where':_0x32b25e[_0xcd30('0x3c')]};return db[_0xcd30('0x2f')][_0xcd30('0x1f')](_0x30e17b)[_0xcd30('0x25')](function(_0x126bb6){_0x4392d4['count']=_0x126bb6;if(_0x415e74[_0xcd30('0x32')][_0xcd30('0x40')]){_0x32b25e[_0xcd30('0x41')]=[{'all':!![]}];}return db[_0xcd30('0x2f')][_0xcd30('0x42')](_0x32b25e);})[_0xcd30('0x25')](function(_0x70253){_0x4392d4[_0xcd30('0x43')]=_0x70253;return _0x4392d4;})[_0xcd30('0x25')](respondWithFilteredResult(_0x43c4ef,_0x32b25e))[_0xcd30('0x44')](handleError(_0x43c4ef,null));})[_0xcd30('0x44')](handleError(_0x43c4ef,null));};exports[_0xcd30('0x45')]=function(_0x51baa8,_0x42a2ed){var _0x43a1d3={'raw':![],'where':{'id':_0x51baa8[_0xcd30('0x46')]['id']}},_0x4d596c={};_0x4d596c[_0xcd30('0x31')]=_[_0xcd30('0x33')](db['CmCompany'][_0xcd30('0x47')]);_0x4d596c['query']=_[_0xcd30('0x33')](_0x51baa8[_0xcd30('0x32')]);_0x4d596c[_0xcd30('0x34')]=_['intersection'](_0x4d596c['model'],_0x4d596c[_0xcd30('0x32')]);_0x43a1d3[_0xcd30('0x37')]=_['intersection'](_0x4d596c[_0xcd30('0x31')],qs['fields'](_0x51baa8[_0xcd30('0x32')][_0xcd30('0x36')]));_0x43a1d3[_0xcd30('0x37')]=_0x43a1d3['attributes'][_0xcd30('0x38')]?_0x43a1d3[_0xcd30('0x37')]:_0x4d596c[_0xcd30('0x31')];if(_0x51baa8[_0xcd30('0x32')][_0xcd30('0x40')]){_0x43a1d3[_0xcd30('0x41')]=[{'all':!![]}];}_0x43a1d3=_[_0xcd30('0x48')]({},_0x43a1d3,_0x51baa8['options']);return db[_0xcd30('0x2f')][_0xcd30('0x49')](_0x43a1d3)[_0xcd30('0x25')](handleEntityNotFound(_0x42a2ed,null))[_0xcd30('0x25')](respondWithResult(_0x42a2ed,null))['catch'](handleError(_0x42a2ed,null));};exports[_0xcd30('0x4a')]=function(_0x316ace,_0x26f2f6){return db[_0xcd30('0x2f')]['create'](_0x316ace[_0xcd30('0x4b')],{})['then'](function(_0x12c516){var _0x4cf9f1=_0x316ace[_0xcd30('0x4c')][_0xcd30('0x27')]({'plain':!![]});if(!_0x4cf9f1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4cf9f1[_0xcd30('0x4d')]===_0xcd30('0x4c')){var _0x2431ba=_0x12c516['get']({'plain':!![]});var _0x3f104f=_0xcd30('0x28');return db[_0xcd30('0x4e')][_0xcd30('0x49')]({'where':{'name':_0x3f104f,'userProfileId':_0x4cf9f1[_0xcd30('0x4f')]},'raw':!![]})[_0xcd30('0x25')](function(_0x172e96){if(_0x172e96&&_0x172e96[_0xcd30('0x50')]===0x0){return db[_0xcd30('0x29')][_0xcd30('0x4a')]({'name':_0x2431ba['name'],'resourceId':_0x2431ba['id'],'type':_0x172e96[_0xcd30('0x2c')],'sectionId':_0x172e96['id']},{})[_0xcd30('0x25')](function(){return _0x12c516;});}else{return _0x12c516;}})[_0xcd30('0x44')](function(_0x24b114){logger[_0xcd30('0x2a')](_0xcd30('0x51'),_0x24b114);throw _0x24b114;});}return _0x12c516;})[_0xcd30('0x25')](respondWithResult(_0x26f2f6,0xc9))[_0xcd30('0x44')](handleError(_0x26f2f6,null));};exports[_0xcd30('0x52')]=function(_0x28696e,_0x4a4c8f){if(_0x28696e[_0xcd30('0x4b')]['id']){delete _0x28696e[_0xcd30('0x4b')]['id'];}return db[_0xcd30('0x2f')][_0xcd30('0x49')]({'where':{'id':_0x28696e[_0xcd30('0x46')]['id']}})['then'](handleEntityNotFound(_0x4a4c8f,null))[_0xcd30('0x25')](saveUpdates(_0x28696e[_0xcd30('0x4b')],null))[_0xcd30('0x25')](respondWithResult(_0x4a4c8f,null))[_0xcd30('0x44')](handleError(_0x4a4c8f,null));};exports[_0xcd30('0x26')]=function(_0x7db9a9,_0x43b8e7){return db['CmCompany'][_0xcd30('0x49')]({'where':{'id':_0x7db9a9[_0xcd30('0x46')]['id']}})[_0xcd30('0x25')](handleEntityNotFound(_0x43b8e7,null))[_0xcd30('0x25')](removeEntity(_0x43b8e7,null))[_0xcd30('0x44')](handleError(_0x43b8e7,null));};exports[_0xcd30('0x30')]=function(_0x20d4f1,_0x936c21){return db[_0xcd30('0x2f')]['describe']()['then'](respondWithResult(_0x936c21,null))['catch'](handleError(_0x936c21,null));};exports['addContacts']=function(_0x4244c2,_0x136b49,_0x193302){return db[_0xcd30('0x53')][_0xcd30('0x49')]({'where':{'id':_0x4244c2['params']['id']}})[_0xcd30('0x25')](handleEntityNotFound(_0x136b49,null))[_0xcd30('0x25')](function(_0x35fa5a){if(_0x35fa5a){return _0x35fa5a[_0xcd30('0x54')](_0x4244c2[_0xcd30('0x4b')]['ids'],_['omit'](_0x4244c2[_0xcd30('0x4b')],[_0xcd30('0x55'),'id'])||{});}})['then'](respondWithResult(_0x136b49,null))[_0xcd30('0x44')](handleError(_0x136b49,null));};exports['getContacts']=function(_0x560e28,_0x2c6d19,_0x234b5b){var _0x41d6d8={};var _0x30d60a={};var _0x5b74ac;var _0x34b4b9;return db['CmCompany']['findOne']({'where':{'id':_0x560e28[_0xcd30('0x46')]['id']}})['then'](handleEntityNotFound(_0x2c6d19,null))['then'](function(_0x557dfd){if(_0x557dfd){_0x5b74ac=_0x557dfd;_0x30d60a[_0xcd30('0x31')]=_[_0xcd30('0x33')](db[_0xcd30('0x53')]['rawAttributes']);_0x30d60a[_0xcd30('0x32')]=_[_0xcd30('0x33')](_0x560e28[_0xcd30('0x32')]);_0x30d60a['filters']=_[_0xcd30('0x35')](_0x30d60a[_0xcd30('0x31')],_0x30d60a[_0xcd30('0x32')]);_0x41d6d8[_0xcd30('0x37')]=_[_0xcd30('0x35')](_0x30d60a[_0xcd30('0x31')],qs['fields'](_0x560e28[_0xcd30('0x32')][_0xcd30('0x36')]));_0x41d6d8[_0xcd30('0x37')]=_0x41d6d8[_0xcd30('0x37')][_0xcd30('0x38')]?_0x41d6d8[_0xcd30('0x37')]:_0x30d60a[_0xcd30('0x31')];_0x41d6d8['order']=qs[_0xcd30('0x3b')](_0x560e28[_0xcd30('0x32')][_0xcd30('0x3b')]);_0x41d6d8[_0xcd30('0x3c')]=qs['filters'](_[_0xcd30('0x3d')](_0x560e28[_0xcd30('0x32')],_0x30d60a['filters']));if(_0x560e28[_0xcd30('0x32')][_0xcd30('0x3f')]){_0x41d6d8['where']=_[_0xcd30('0x48')](_0x41d6d8[_0xcd30('0x3c')],{'$or':_[_0xcd30('0x3e')](_0x41d6d8[_0xcd30('0x37')],function(_0x429f60){var _0x3a540f={};_0x3a540f[_0x429f60]={'$like':'%'+_0x560e28[_0xcd30('0x32')][_0xcd30('0x3f')]+'%'};return _0x3a540f;})});}_0x41d6d8=_[_0xcd30('0x48')]({},_0x41d6d8,_0x560e28[_0xcd30('0x56')]);return _0x5b74ac['getContacts'](_0x41d6d8);}})[_0xcd30('0x25')](function(_0x14b0bd){if(_0x14b0bd){_0x34b4b9=_0x14b0bd[_0xcd30('0x38')];if(!_0x560e28[_0xcd30('0x32')][_0xcd30('0x39')](_0xcd30('0x57'))){_0x41d6d8[_0xcd30('0x21')]=qs[_0xcd30('0x21')](_0x560e28[_0xcd30('0x32')][_0xcd30('0x21')]);_0x41d6d8['offset']=qs[_0xcd30('0x20')](_0x560e28[_0xcd30('0x32')][_0xcd30('0x20')]);}return _0x5b74ac[_0xcd30('0x58')](_0x41d6d8);}})[_0xcd30('0x25')](function(_0x31b2e4){if(_0x31b2e4){return _0x31b2e4?{'count':_0x34b4b9,'rows':_0x31b2e4}:null;}})[_0xcd30('0x25')](respondWithResult(_0x2c6d19,null))[_0xcd30('0x44')](handleError(_0x2c6d19,null));};
\ No newline at end of file
+var _0x37eb=['rows','catch','show','params','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','destroy','addContacts','CmContact','ids','getContacts','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','update','get','UserProfileResource','then','error','stack','name','send','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','map','filter','options','includeAll','include','findAll'];(function(_0x1196cd,_0x33c691){var _0x4afd49=function(_0x5a76cb){while(--_0x5a76cb){_0x1196cd['push'](_0x1196cd['shift']());}};_0x4afd49(++_0x33c691);}(_0x37eb,0xc2));var _0xb37e=function(_0x55f5c0,_0x64d09e){_0x55f5c0=_0x55f5c0-0x0;var _0x1ed6fe=_0x37eb[_0x55f5c0];return _0x1ed6fe;};'use strict';var emlformat=require(_0xb37e('0x0'));var rimraf=require(_0xb37e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb37e('0x2'));var rp=require(_0xb37e('0x3'));var moment=require(_0xb37e('0x4'));var BPromise=require(_0xb37e('0x5'));var Mustache=require(_0xb37e('0x6'));var util=require(_0xb37e('0x7'));var path=require(_0xb37e('0x8'));var sox=require(_0xb37e('0x9'));var csv=require(_0xb37e('0xa'));var ejs=require(_0xb37e('0xb'));var fs=require('fs');var fs_extra=require(_0xb37e('0xc'));var _=require(_0xb37e('0xd'));var squel=require(_0xb37e('0xe'));var crypto=require(_0xb37e('0xf'));var jsforce=require(_0xb37e('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xb37e('0xa'));var querystring=require('querystring');var Papa=require(_0xb37e('0x11'));var Redis=require(_0xb37e('0x12'));var authService=require(_0xb37e('0x13'));var qs=require(_0xb37e('0x14'));var as=require(_0xb37e('0x15'));var hardwareService=require(_0xb37e('0x16'));var logger=require(_0xb37e('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xb37e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb37e('0x19'))['db'];function respondWithStatusCode(_0x25dedd,_0x112de9){_0x112de9=_0x112de9||0xcc;return function(_0x473e23){if(_0x473e23){return _0x25dedd[_0xb37e('0x1a')](_0x112de9);}return _0x25dedd[_0xb37e('0x1b')](_0x112de9)[_0xb37e('0x1c')]();};}function respondWithResult(_0x6d6889,_0x19a064){_0x19a064=_0x19a064||0xc8;return function(_0x16e0f9){if(_0x16e0f9){return _0x6d6889[_0xb37e('0x1b')](_0x19a064)[_0xb37e('0x1d')](_0x16e0f9);}};}function respondWithFilteredResult(_0x4d48ad,_0x3811fe){return function(_0x3a2804){if(_0x3a2804){var _0x574ceb=typeof _0x3811fe[_0xb37e('0x1e')]==='undefined'&&typeof _0x3811fe[_0xb37e('0x1f')]==='undefined';var _0x39f50a=_0x3a2804[_0xb37e('0x20')];var _0x5e8bbb=_0x574ceb?0x0:_0x3811fe[_0xb37e('0x1e')];var _0x15d708=_0x574ceb?_0x3a2804['count']:_0x3811fe['offset']+_0x3811fe[_0xb37e('0x1f')];var _0x14a294;if(_0x15d708>=_0x39f50a){_0x15d708=_0x39f50a;_0x14a294=0xc8;}else{_0x14a294=0xce;}_0x4d48ad[_0xb37e('0x1b')](_0x14a294);return _0x4d48ad['set'](_0xb37e('0x21'),_0x5e8bbb+'-'+_0x15d708+'/'+_0x39f50a)[_0xb37e('0x1d')](_0x3a2804);}return null;};}function patchUpdates(_0x5af3ed){return function(_0x5137f7){try{jsonpatch[_0xb37e('0x22')](_0x5137f7,_0x5af3ed,!![]);}catch(_0x352af7){return BPromise[_0xb37e('0x23')](_0x352af7);}return _0x5137f7['save']();};}function saveUpdates(_0x4eee7d,_0x12c3ea){return function(_0x4fa59c){if(_0x4fa59c){return _0x4fa59c[_0xb37e('0x24')](_0x4eee7d)['then'](function(_0x5ef0cd){return _0x5ef0cd;});}return null;};}function removeEntity(_0x5cdc0e,_0x3567ef){return function(_0x5589dc){if(_0x5589dc){return _0x5589dc['destroy']()['then'](function(){var _0x39e5df=_0x5589dc[_0xb37e('0x25')]({'plain':!![]});var _0x9894f7='Companies';return db[_0xb37e('0x26')]['destroy']({'where':{'type':_0x9894f7,'resourceId':_0x39e5df['id']}})[_0xb37e('0x27')](function(){return _0x5589dc;});})['then'](function(){_0x5cdc0e[_0xb37e('0x1b')](0xcc)[_0xb37e('0x1c')]();});}};}function handleEntityNotFound(_0x149831,_0xf6fce2){return function(_0x46dae0){if(!_0x46dae0){_0x149831['sendStatus'](0x194);}return _0x46dae0;};}function handleError(_0x14486f,_0x3a55b1){_0x3a55b1=_0x3a55b1||0x1f4;return function(_0x20c122){logger[_0xb37e('0x28')](_0x20c122[_0xb37e('0x29')]);if(_0x20c122[_0xb37e('0x2a')]){delete _0x20c122['name'];}_0x14486f[_0xb37e('0x1b')](_0x3a55b1)[_0xb37e('0x2b')](_0x20c122);};}exports['index']=function(_0x487f14,_0x4606ae){var _0x374d26={},_0x5d8e4c={},_0x5e8467={'count':0x0,'rows':[]};return db[_0xb37e('0x2c')][_0xb37e('0x2d')]()[_0xb37e('0x27')](function(_0x164fd6){_0x5d8e4c[_0xb37e('0x2e')]=_[_0xb37e('0x2f')](_0x164fd6);_0x5d8e4c['query']=_[_0xb37e('0x2f')](_0x487f14[_0xb37e('0x30')]);_0x5d8e4c['filters']=_[_0xb37e('0x31')](_0x5d8e4c[_0xb37e('0x2e')],_0x5d8e4c['query']);_0x374d26[_0xb37e('0x32')]=_[_0xb37e('0x31')](_0x5d8e4c[_0xb37e('0x2e')],qs[_0xb37e('0x33')](_0x487f14['query'][_0xb37e('0x33')]));_0x374d26[_0xb37e('0x32')]=_0x374d26['attributes'][_0xb37e('0x34')]?_0x374d26[_0xb37e('0x32')]:_0x5d8e4c[_0xb37e('0x2e')];if(!_0x487f14[_0xb37e('0x30')][_0xb37e('0x35')](_0xb37e('0x36'))){_0x374d26[_0xb37e('0x1f')]=qs[_0xb37e('0x1f')](_0x487f14['query'][_0xb37e('0x1f')]);_0x374d26['offset']=qs[_0xb37e('0x1e')](_0x487f14[_0xb37e('0x30')]['offset']);}_0x374d26[_0xb37e('0x37')]=qs[_0xb37e('0x38')](_0x487f14[_0xb37e('0x30')]['sort']);_0x374d26['where']=qs[_0xb37e('0x39')](_[_0xb37e('0x3a')](_0x487f14[_0xb37e('0x30')],_0x5d8e4c[_0xb37e('0x39')]),_0x164fd6);if(_0x487f14['query']['filter']){_0x374d26[_0xb37e('0x3b')]=_[_0xb37e('0x3c')](_0x374d26[_0xb37e('0x3b')],{'$or':_[_0xb37e('0x3d')](_0x374d26[_0xb37e('0x32')],function(_0x30476c){var _0x7893c7={};_0x7893c7[_0x30476c]={'$like':'%'+_0x487f14['query'][_0xb37e('0x3e')]+'%'};return _0x7893c7;})});}_0x374d26=_[_0xb37e('0x3c')]({},_0x374d26,_0x487f14[_0xb37e('0x3f')]);var _0x4507c6={'where':_0x374d26[_0xb37e('0x3b')]};return db[_0xb37e('0x2c')][_0xb37e('0x20')](_0x4507c6)['then'](function(_0x5e35bf){_0x5e8467[_0xb37e('0x20')]=_0x5e35bf;if(_0x487f14[_0xb37e('0x30')][_0xb37e('0x40')]){_0x374d26[_0xb37e('0x41')]=[{'all':!![]}];}return db[_0xb37e('0x2c')][_0xb37e('0x42')](_0x374d26);})[_0xb37e('0x27')](function(_0x21fd45){_0x5e8467[_0xb37e('0x43')]=_0x21fd45;return _0x5e8467;})[_0xb37e('0x27')](respondWithFilteredResult(_0x4606ae,_0x374d26))[_0xb37e('0x44')](handleError(_0x4606ae,null));})[_0xb37e('0x44')](handleError(_0x4606ae,null));};exports[_0xb37e('0x45')]=function(_0x20a7fa,_0xbc3c34){var _0x14160f={'raw':![],'where':{'id':_0x20a7fa[_0xb37e('0x46')]['id']}},_0xcf59a0={};_0xcf59a0[_0xb37e('0x2e')]=_[_0xb37e('0x2f')](db[_0xb37e('0x2c')]['rawAttributes']);_0xcf59a0[_0xb37e('0x30')]=_[_0xb37e('0x2f')](_0x20a7fa['query']);_0xcf59a0['filters']=_[_0xb37e('0x31')](_0xcf59a0['model'],_0xcf59a0['query']);_0x14160f[_0xb37e('0x32')]=_[_0xb37e('0x31')](_0xcf59a0['model'],qs[_0xb37e('0x33')](_0x20a7fa[_0xb37e('0x30')][_0xb37e('0x33')]));_0x14160f[_0xb37e('0x32')]=_0x14160f[_0xb37e('0x32')][_0xb37e('0x34')]?_0x14160f[_0xb37e('0x32')]:_0xcf59a0[_0xb37e('0x2e')];if(_0x20a7fa[_0xb37e('0x30')]['includeAll']){_0x14160f[_0xb37e('0x41')]=[{'all':!![]}];}_0x14160f=_[_0xb37e('0x3c')]({},_0x14160f,_0x20a7fa[_0xb37e('0x3f')]);return db[_0xb37e('0x2c')][_0xb37e('0x47')](_0x14160f)[_0xb37e('0x27')](handleEntityNotFound(_0xbc3c34,null))[_0xb37e('0x27')](respondWithResult(_0xbc3c34,null))[_0xb37e('0x44')](handleError(_0xbc3c34,null));};exports[_0xb37e('0x48')]=function(_0x273d35,_0x23228d){return db['CmCompany'][_0xb37e('0x48')](_0x273d35[_0xb37e('0x49')],{})[_0xb37e('0x27')](function(_0x9b3180){var _0x5150d3=_0x273d35[_0xb37e('0x4a')][_0xb37e('0x25')]({'plain':!![]});if(!_0x5150d3)throw new Error(_0xb37e('0x4b'));if(_0x5150d3[_0xb37e('0x4c')]==='user'){var _0x207c5f=_0x9b3180[_0xb37e('0x25')]({'plain':!![]});var _0x31a7d3='Companies';return db[_0xb37e('0x4d')]['find']({'where':{'name':_0x31a7d3,'userProfileId':_0x5150d3[_0xb37e('0x4e')]},'raw':!![]})['then'](function(_0x2af684){if(_0x2af684&&_0x2af684[_0xb37e('0x4f')]===0x0){return db[_0xb37e('0x26')][_0xb37e('0x48')]({'name':_0x207c5f[_0xb37e('0x2a')],'resourceId':_0x207c5f['id'],'type':_0x2af684[_0xb37e('0x2a')],'sectionId':_0x2af684['id']},{})[_0xb37e('0x27')](function(){return _0x9b3180;});}else{return _0x9b3180;}})[_0xb37e('0x44')](function(_0xef0c95){logger[_0xb37e('0x28')](_0xb37e('0x50'),_0xef0c95);throw _0xef0c95;});}return _0x9b3180;})[_0xb37e('0x27')](respondWithResult(_0x23228d,0xc9))[_0xb37e('0x44')](handleError(_0x23228d,null));};exports[_0xb37e('0x24')]=function(_0xa1a230,_0x3987ee){if(_0xa1a230[_0xb37e('0x49')]['id']){delete _0xa1a230[_0xb37e('0x49')]['id'];}return db['CmCompany'][_0xb37e('0x47')]({'where':{'id':_0xa1a230[_0xb37e('0x46')]['id']}})[_0xb37e('0x27')](handleEntityNotFound(_0x3987ee,null))[_0xb37e('0x27')](saveUpdates(_0xa1a230[_0xb37e('0x49')],null))[_0xb37e('0x27')](respondWithResult(_0x3987ee,null))[_0xb37e('0x44')](handleError(_0x3987ee,null));};exports[_0xb37e('0x51')]=function(_0xd806a1,_0x5f5648){return db[_0xb37e('0x2c')][_0xb37e('0x47')]({'where':{'id':_0xd806a1[_0xb37e('0x46')]['id']}})[_0xb37e('0x27')](handleEntityNotFound(_0x5f5648,null))[_0xb37e('0x27')](removeEntity(_0x5f5648,null))[_0xb37e('0x44')](handleError(_0x5f5648,null));};exports[_0xb37e('0x2d')]=function(_0x512830,_0x2e1781){return db['CmCompany'][_0xb37e('0x2d')]()[_0xb37e('0x27')](respondWithResult(_0x2e1781,null))[_0xb37e('0x44')](handleError(_0x2e1781,null));};exports[_0xb37e('0x52')]=function(_0x1b0d63,_0x3f1f4f,_0x58b933){return db[_0xb37e('0x53')][_0xb37e('0x47')]({'where':{'id':_0x1b0d63[_0xb37e('0x46')]['id']}})[_0xb37e('0x27')](handleEntityNotFound(_0x3f1f4f,null))['then'](function(_0x573989){if(_0x573989){return _0x573989[_0xb37e('0x52')](_0x1b0d63['body']['ids'],_['omit'](_0x1b0d63['body'],[_0xb37e('0x54'),'id'])||{});}})[_0xb37e('0x27')](respondWithResult(_0x3f1f4f,null))[_0xb37e('0x44')](handleError(_0x3f1f4f,null));};exports[_0xb37e('0x55')]=function(_0xc4e2c8,_0x1cd9a5,_0x4def4e){var _0x507ddb={};var _0x156d34={};var _0x47abbe;var _0xd1e263;return db['CmCompany'][_0xb37e('0x56')]({'where':{'id':_0xc4e2c8[_0xb37e('0x46')]['id']}})[_0xb37e('0x27')](handleEntityNotFound(_0x1cd9a5,null))['then'](function(_0x3fb6ae){if(_0x3fb6ae){_0x47abbe=_0x3fb6ae;_0x156d34[_0xb37e('0x2e')]=_['keys'](db[_0xb37e('0x53')]['rawAttributes']);_0x156d34[_0xb37e('0x30')]=_[_0xb37e('0x2f')](_0xc4e2c8[_0xb37e('0x30')]);_0x156d34[_0xb37e('0x39')]=_[_0xb37e('0x31')](_0x156d34[_0xb37e('0x2e')],_0x156d34['query']);_0x507ddb['attributes']=_['intersection'](_0x156d34[_0xb37e('0x2e')],qs[_0xb37e('0x33')](_0xc4e2c8[_0xb37e('0x30')]['fields']));_0x507ddb[_0xb37e('0x32')]=_0x507ddb[_0xb37e('0x32')][_0xb37e('0x34')]?_0x507ddb['attributes']:_0x156d34[_0xb37e('0x2e')];_0x507ddb[_0xb37e('0x37')]=qs['sort'](_0xc4e2c8[_0xb37e('0x30')][_0xb37e('0x38')]);_0x507ddb[_0xb37e('0x3b')]=qs[_0xb37e('0x39')](_['pick'](_0xc4e2c8[_0xb37e('0x30')],_0x156d34[_0xb37e('0x39')]));if(_0xc4e2c8[_0xb37e('0x30')][_0xb37e('0x3e')]){_0x507ddb[_0xb37e('0x3b')]=_[_0xb37e('0x3c')](_0x507ddb[_0xb37e('0x3b')],{'$or':_[_0xb37e('0x3d')](_0x507ddb[_0xb37e('0x32')],function(_0x166a09){var _0x44eb62={};_0x44eb62[_0x166a09]={'$like':'%'+_0xc4e2c8[_0xb37e('0x30')][_0xb37e('0x3e')]+'%'};return _0x44eb62;})});}_0x507ddb=_[_0xb37e('0x3c')]({},_0x507ddb,_0xc4e2c8[_0xb37e('0x3f')]);return _0x47abbe[_0xb37e('0x55')](_0x507ddb);}})[_0xb37e('0x27')](function(_0x1b42f9){if(_0x1b42f9){_0xd1e263=_0x1b42f9[_0xb37e('0x34')];if(!_0xc4e2c8[_0xb37e('0x30')][_0xb37e('0x35')]('nolimit')){_0x507ddb[_0xb37e('0x1f')]=qs[_0xb37e('0x1f')](_0xc4e2c8[_0xb37e('0x30')][_0xb37e('0x1f')]);_0x507ddb['offset']=qs['offset'](_0xc4e2c8['query'][_0xb37e('0x1e')]);}return _0x47abbe['getContacts'](_0x507ddb);}})[_0xb37e('0x27')](function(_0x4ef4f8){if(_0x4ef4f8){return _0x4ef4f8?{'count':_0xd1e263,'rows':_0x4ef4f8}:null;}})[_0xb37e('0x27')](respondWithResult(_0x1cd9a5,null))['catch'](handleError(_0x1cd9a5,null));};
\ No newline at end of file
index 63e1219..de39432 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f22=['util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','CmCompany','lodash'];(function(_0x148bb9,_0x284f06){var _0x4a63ae=function(_0x4410ea){while(--_0x4410ea){_0x148bb9['push'](_0x148bb9['shift']());}};_0x4a63ae(++_0x284f06);}(_0x1f22,0x1c2));var _0x21f2=function(_0x2508b5,_0x2a1623){_0x2508b5=_0x2508b5-0x0;var _0x5513c2=_0x1f22[_0x2508b5];return _0x5513c2;};'use strict';var _=require(_0x21f2('0x0'));var util=require(_0x21f2('0x1'));var logger=require(_0x21f2('0x2'))(_0x21f2('0x3'));var moment=require(_0x21f2('0x4'));var BPromise=require(_0x21f2('0x5'));var rp=require(_0x21f2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x21f2('0x7'));var attributes=require('./cmCompany.attributes');module[_0x21f2('0x8')]=function(_0x1d91d6,_0x1e5721){return _0x1d91d6[_0x21f2('0x9')](_0x21f2('0xa'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2704=['moment','bluebird','request-promise','path','rimraf','./cmCompany.attributes','exports','define','CmCompany','lodash','util','../../config/logger','api'];(function(_0xbf50e9,_0x37815a){var _0x5a375b=function(_0x35a694){while(--_0x35a694){_0xbf50e9['push'](_0xbf50e9['shift']());}};_0x5a375b(++_0x37815a);}(_0x2704,0x182));var _0x4270=function(_0x3a7ab8,_0x35dbf3){_0x3a7ab8=_0x3a7ab8-0x0;var _0x2734fa=_0x2704[_0x3a7ab8];return _0x2734fa;};'use strict';var _=require(_0x4270('0x0'));var util=require(_0x4270('0x1'));var logger=require(_0x4270('0x2'))(_0x4270('0x3'));var moment=require(_0x4270('0x4'));var BPromise=require(_0x4270('0x5'));var rp=require(_0x4270('0x6'));var fs=require('fs');var path=require(_0x4270('0x7'));var rimraf=require(_0x4270('0x8'));var config=require('../../config/environment');var attributes=require(_0x4270('0x9'));module[_0x4270('0xa')]=function(_0x17cb39,_0x540298){return _0x17cb39[_0x4270('0xb')](_0x4270('0xc'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1ebe682..0e77786 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c06=['then','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmCompany,\x20%s,\x20%s','info','result','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http'];(function(_0x455fee,_0xdb4e0d){var _0x173acf=function(_0x315af3){while(--_0x315af3){_0x455fee['push'](_0x455fee['shift']());}};_0x173acf(++_0xdb4e0d);}(_0x5c06,0x186));var _0x65c0=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x5c06[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x65c0('0x0'));var util=require(_0x65c0('0x1'));var moment=require(_0x65c0('0x2'));var BPromise=require('bluebird');var rs=require(_0x65c0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x65c0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x65c0('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x65c0('0x6'));var client=jayson[_0x65c0('0x7')][_0x65c0('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x9ec3d5,_0x2bb547,_0x170f5f){return new BPromise(function(_0x4c3401,_0x1746fc){return client['request'](_0x9ec3d5,_0x170f5f)[_0x65c0('0x9')](function(_0x47ef3f){logger['info']('CmCompany,\x20%s,\x20%s',_0x2bb547,_0x65c0('0xa'));logger['debug'](_0x65c0('0xb'),_0x2bb547,_0x65c0('0xa'),JSON[_0x65c0('0xc')](_0x47ef3f));if(_0x47ef3f[_0x65c0('0xd')]){if(_0x47ef3f['error'][_0x65c0('0xe')]===0x1f4){logger[_0x65c0('0xd')]('CmCompany,\x20%s,\x20%s',_0x2bb547,_0x47ef3f[_0x65c0('0xd')][_0x65c0('0xf')]);return _0x1746fc(_0x47ef3f['error'][_0x65c0('0xf')]);}logger[_0x65c0('0xd')](_0x65c0('0x10'),_0x2bb547,_0x47ef3f[_0x65c0('0xd')][_0x65c0('0xf')]);return _0x4c3401(_0x47ef3f['error'][_0x65c0('0xf')]);}else{logger[_0x65c0('0x11')](_0x65c0('0x10'),_0x2bb547,_0x65c0('0xa'));_0x4c3401(_0x47ef3f[_0x65c0('0x12')][_0x65c0('0xf')]);}})['catch'](function(_0x1b7fb9){logger[_0x65c0('0xd')](_0x65c0('0x10'),_0x2bb547,_0x1b7fb9);_0x1746fc(_0x1b7fb9);});});}
\ No newline at end of file
+var _0x7e4c=['../../config/environment','client','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x390a19,_0x5dd137){var _0x5d8230=function(_0x2e6234){while(--_0x2e6234){_0x390a19['push'](_0x390a19['shift']());}};_0x5d8230(++_0x5dd137);}(_0x7e4c,0x11e));var _0xc7e4=function(_0x2742db,_0x58e00c){_0x2742db=_0x2742db-0x0;var _0x18659e=_0x7e4c[_0x2742db];return _0x18659e;};'use strict';var _=require(_0xc7e4('0x0'));var util=require('util');var moment=require(_0xc7e4('0x1'));var BPromise=require('bluebird');var rs=require(_0xc7e4('0x2'));var fs=require('fs');var Redis=require(_0xc7e4('0x3'));var db=require(_0xc7e4('0x4'))['db'];var utils=require(_0xc7e4('0x5'));var logger=require(_0xc7e4('0x6'))(_0xc7e4('0x7'));var config=require(_0xc7e4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc7e4('0x9')][_0xc7e4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2612a7,_0x427557,_0x162bd2){return new BPromise(function(_0x1a8c07,_0x27127e){return client['request'](_0x2612a7,_0x162bd2)[_0xc7e4('0xb')](function(_0x3ced0f){logger[_0xc7e4('0xc')](_0xc7e4('0xd'),_0x427557,_0xc7e4('0xe'));logger[_0xc7e4('0xf')](_0xc7e4('0x10'),_0x427557,_0xc7e4('0xe'),JSON[_0xc7e4('0x11')](_0x3ced0f));if(_0x3ced0f[_0xc7e4('0x12')]){if(_0x3ced0f['error']['code']===0x1f4){logger[_0xc7e4('0x12')](_0xc7e4('0xd'),_0x427557,_0x3ced0f[_0xc7e4('0x12')][_0xc7e4('0x13')]);return _0x27127e(_0x3ced0f[_0xc7e4('0x12')][_0xc7e4('0x13')]);}logger[_0xc7e4('0x12')]('CmCompany,\x20%s,\x20%s',_0x427557,_0x3ced0f['error'][_0xc7e4('0x13')]);return _0x1a8c07(_0x3ced0f[_0xc7e4('0x12')]['message']);}else{logger[_0xc7e4('0xc')](_0xc7e4('0xd'),_0x427557,_0xc7e4('0xe'));_0x1a8c07(_0x3ced0f[_0xc7e4('0x14')][_0xc7e4('0x13')]);}})['catch'](function(_0x32e405){logger[_0xc7e4('0x12')](_0xc7e4('0xd'),_0x427557,_0x32e405);_0x27127e(_0x32e405);});});}
\ No newline at end of file
index bb9873e..01bdd89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe42=['getContacts','post','create','addContacts','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/contacts'];(function(_0x2877ad,_0x33a482){var _0x33f359=function(_0x1da939){while(--_0x1da939){_0x2877ad['push'](_0x2877ad['shift']());}};_0x33f359(++_0x33a482);}(_0xbe42,0x141));var _0x2be4=function(_0x367336,_0x18c229){_0x367336=_0x367336-0x0;var _0x3423a7=_0xbe42[_0x367336];return _0x3423a7;};'use strict';var multer=require(_0x2be4('0x0'));var util=require('util');var path=require(_0x2be4('0x1'));var timeout=require(_0x2be4('0x2'));var express=require(_0x2be4('0x3'));var router=express[_0x2be4('0x4')]();var fs_extra=require(_0x2be4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2be4('0x6'));var controller=require(_0x2be4('0x7'));router[_0x2be4('0x8')]('/',auth[_0x2be4('0x9')](),controller[_0x2be4('0xa')]);router[_0x2be4('0x8')](_0x2be4('0xb'),auth[_0x2be4('0x9')](),controller[_0x2be4('0xc')]);router[_0x2be4('0x8')](_0x2be4('0xd'),auth[_0x2be4('0x9')](),controller['show']);router['get'](_0x2be4('0xe'),auth['isAuthenticated'](),controller[_0x2be4('0xf')]);router[_0x2be4('0x10')]('/',auth[_0x2be4('0x9')](),controller[_0x2be4('0x11')]);router[_0x2be4('0x10')](_0x2be4('0xe'),auth[_0x2be4('0x9')](),controller[_0x2be4('0x12')]);router[_0x2be4('0x13')]('/:id',auth[_0x2be4('0x9')](),controller[_0x2be4('0x14')]);router[_0x2be4('0x15')](_0x2be4('0xd'),auth[_0x2be4('0x9')](),controller[_0x2be4('0x16')]);module[_0x2be4('0x17')]=router;
\ No newline at end of file
+var _0x0f08=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/contacts','getContacts','post','addContacts','put','update','delete'];(function(_0x5c6ac8,_0x1b617f){var _0x16394c=function(_0x391106){while(--_0x391106){_0x5c6ac8['push'](_0x5c6ac8['shift']());}};_0x16394c(++_0x1b617f);}(_0x0f08,0x109));var _0x80f0=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x0f08[_0x4d613c];return _0x301fe3;};'use strict';var multer=require(_0x80f0('0x0'));var util=require(_0x80f0('0x1'));var path=require(_0x80f0('0x2'));var timeout=require(_0x80f0('0x3'));var express=require('express');var router=express[_0x80f0('0x4')]();var fs_extra=require(_0x80f0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x80f0('0x6'));var config=require(_0x80f0('0x7'));var controller=require('./cmCompany.controller');router[_0x80f0('0x8')]('/',auth[_0x80f0('0x9')](),controller[_0x80f0('0xa')]);router[_0x80f0('0x8')](_0x80f0('0xb'),auth[_0x80f0('0x9')](),controller['describe']);router[_0x80f0('0x8')](_0x80f0('0xc'),auth[_0x80f0('0x9')](),controller[_0x80f0('0xd')]);router['get'](_0x80f0('0xe'),auth[_0x80f0('0x9')](),controller[_0x80f0('0xf')]);router['post']('/',auth[_0x80f0('0x9')](),controller['create']);router[_0x80f0('0x10')]('/:id/contacts',auth[_0x80f0('0x9')](),controller[_0x80f0('0x11')]);router[_0x80f0('0x12')](_0x80f0('0xc'),auth[_0x80f0('0x9')](),controller[_0x80f0('0x13')]);router[_0x80f0('0x14')](_0x80f0('0xc'),auth[_0x80f0('0x9')](),controller['destroy']);module[_0x80f0('0x15')]=router;
\ No newline at end of file
index fb89265..edf4353 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3aa5=['UNSIGNED','lodash','exports','STRING','INTEGER'];(function(_0x448ed3,_0x12fa53){var _0x3b4a07=function(_0x3279d0){while(--_0x3279d0){_0x448ed3['push'](_0x448ed3['shift']());}};_0x3b4a07(++_0x12fa53);}(_0x3aa5,0xc4));var _0x53aa=function(_0x396d43,_0x994f3a){_0x396d43=_0x396d43-0x0;var _0x58c668=_0x3aa5[_0x396d43];return _0x58c668;};'use strict';var _=require(_0x53aa('0x0'));var Sequelize=require('sequelize');module[_0x53aa('0x1')]={'firstName':{'type':Sequelize[_0x53aa('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x53aa('0x2')]},'street':{'type':Sequelize[_0x53aa('0x2')]},'postalCode':{'type':Sequelize[_0x53aa('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x53aa('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x53aa('0x2')]},'mobile':{'type':Sequelize[_0x53aa('0x2')]},'fax':{'type':Sequelize[_0x53aa('0x2')]},'email':{'type':Sequelize[_0x53aa('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x53aa('0x2')]},'fb_data':{'type':Sequelize[_0x53aa('0x2')]},'twitter':{'type':Sequelize[_0x53aa('0x2')]},'skype':{'type':Sequelize[_0x53aa('0x2')]},'teams':{'type':Sequelize[_0x53aa('0x2')]},'viber':{'type':Sequelize[_0x53aa('0x2')]},'line':{'type':Sequelize[_0x53aa('0x2')]},'wechat':{'type':Sequelize[_0x53aa('0x2')]},'telegram':{'type':Sequelize[_0x53aa('0x2')]},'UserId':{'type':Sequelize[_0x53aa('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x53aa('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
+var _0xe4e8=['lodash','exports','STRING','TEXT','INTEGER','UNSIGNED','NOW'];(function(_0x5bec42,_0x2e8ce9){var _0x2a1602=function(_0x3fb8a8){while(--_0x3fb8a8){_0x5bec42['push'](_0x5bec42['shift']());}};_0x2a1602(++_0x2e8ce9);}(_0xe4e8,0x13b));var _0x8e4e=function(_0x133a2e,_0x18376d){_0x133a2e=_0x133a2e-0x0;var _0x1a2782=_0xe4e8[_0x133a2e];return _0x1a2782;};'use strict';var _=require(_0x8e4e('0x0'));var Sequelize=require('sequelize');module[_0x8e4e('0x1')]={'firstName':{'type':Sequelize[_0x8e4e('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x8e4e('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x8e4e('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x8e4e('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8e4e('0x3')]},'phone':{'type':Sequelize[_0x8e4e('0x2')]},'mobile':{'type':Sequelize[_0x8e4e('0x2')]},'fax':{'type':Sequelize[_0x8e4e('0x2')]},'email':{'type':Sequelize[_0x8e4e('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x8e4e('0x2')]},'skype':{'type':Sequelize[_0x8e4e('0x2')]},'teams':{'type':Sequelize[_0x8e4e('0x2')]},'viber':{'type':Sequelize[_0x8e4e('0x2')]},'line':{'type':Sequelize[_0x8e4e('0x2')]},'wechat':{'type':Sequelize[_0x8e4e('0x2')]},'telegram':{'type':Sequelize[_0x8e4e('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x8e4e('0x4')](0x2)[_0x8e4e('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x8e4e('0x6')]}};
\ No newline at end of file
index 9a2c1a3..07685dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x641e=['ChatOfflineMessage','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappMessage','duplicates','$or','findOrCreate','error','show','Tag','$and','omit','format','pickBy','cf_%d','table','id\x20=\x20?','toParam','phone','getTags','rawAttributes','nolimit','ContactId','options','includeAll','include','getHopperHistories','getHopperFinals','getJscriptySessions','uploadCsv','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','server/files/tmp','file','filename','0777','child_process','fork','binding_keys','File\x20uploaded\x20correctly!','pid','upload','parse','meta','import','No\x20ListId\x20specified','binding','firstName','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','getJourney','mail','chat','openchannel','fax','whatsapp','-createdAt','channel','toLowerCase','Invalid\x20channel','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','endtime','duration','note','userSecondDisposition','UserId','fullname','createdAt','range','findAndCountAll','startCase','Website','Account','closedAt','disposition','thirdDisposition','key','Owner','browserName','customerIp','ratingMessage','ratingType','ratingValue','referer','subject','Interaction','flatten','sortBy','reverse','slice','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./cmContact.socket','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','end','stack','name','send','index','CmContact','describe','keys','startsWith','cf_','CmCustomField','findOne','trimStart','all','fieldType','type','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','select','field','color','from','tools_tags','cm_contacts','left_join','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','c.deletedAt\x20IS\x20NULL','expr','search','conditions','find','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','buildExpression','text','hasOwnProperty','isNil','Contact','push','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','filter','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','c.id','QueryTypes','SELECT','clone','DESC','having','t.id\x20IN\x20?','resolve','role','agent','some','user','getLists','c.ListId\x20IS\x20NULL','sequelize','toString','keyBy','merge','c.firstName','c.lastName','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','TagIds','Tags','rows','catch','params','tags','columnName','displayName','findAll','alias','custom','values','body','get','join','info','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatMessage','update'];(function(_0x47992a,_0x32b626){var _0x4015ef=function(_0x489bab){while(--_0x489bab){_0x47992a['push'](_0x47992a['shift']());}};_0x4015ef(++_0x32b626);}(_0x641e,0x193));var _0xe641=function(_0x414a14,_0x386a95){_0x414a14=_0x414a14-0x0;var _0x1fe9f3=_0x641e[_0x414a14];return _0x1fe9f3;};'use strict';var emlformat=require(_0xe641('0x0'));var rimraf=require(_0xe641('0x1'));var zipdir=require(_0xe641('0x2'));var jsonpatch=require(_0xe641('0x3'));var rp=require(_0xe641('0x4'));var moment=require(_0xe641('0x5'));var BPromise=require(_0xe641('0x6'));var Mustache=require(_0xe641('0x7'));var util=require(_0xe641('0x8'));var path=require(_0xe641('0x9'));var sox=require(_0xe641('0xa'));var csv=require(_0xe641('0xb'));var ejs=require(_0xe641('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe641('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe641('0xe'));var toCsv=require(_0xe641('0xb'));var querystring=require('querystring');var Papa=require(_0xe641('0xf'));var Redis=require(_0xe641('0x10'));var authService=require(_0xe641('0x11'));var qs=require(_0xe641('0x12'));var as=require(_0xe641('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe641('0x14'))(_0xe641('0x15'));var utils=require(_0xe641('0x16'));var config=require(_0xe641('0x17'));var licenseUtil=require(_0xe641('0x18'));var db=require('../../mysqldb')['db'];config[_0xe641('0x19')]=_['defaults'](config[_0xe641('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xe641('0x1a'))(new Redis(config[_0xe641('0x19')]));require(_0xe641('0x1b'))['register'](socket);function respondWithStatusCode(_0x480eb7,_0x281d17){_0x281d17=_0x281d17||0xcc;return function(_0x38a2d1){if(_0x38a2d1){return _0x480eb7[_0xe641('0x1c')](_0x281d17);}return _0x480eb7[_0xe641('0x1d')](_0x281d17)['end']();};}function respondWithResult(_0x5832cb,_0x2ffbfb){_0x2ffbfb=_0x2ffbfb||0xc8;return function(_0x33dccb){if(_0x33dccb){return _0x5832cb[_0xe641('0x1d')](_0x2ffbfb)[_0xe641('0x1e')](_0x33dccb);}};}function respondWithFilteredResult(_0x5caa0b,_0x1a6dfc){return function(_0x242f9d){if(_0x242f9d){var _0x4f9b26=typeof _0x1a6dfc[_0xe641('0x1f')]===_0xe641('0x20')&&typeof _0x1a6dfc['limit']==='undefined';var _0xab4ee1=_0x242f9d[_0xe641('0x21')];var _0x5ebbdf=_0x4f9b26?0x0:_0x1a6dfc[_0xe641('0x1f')];var _0x4d2c41=_0x4f9b26?_0x242f9d[_0xe641('0x21')]:_0x1a6dfc['offset']+_0x1a6dfc[_0xe641('0x22')];var _0x26c03a;if(_0x4d2c41>=_0xab4ee1){_0x4d2c41=_0xab4ee1;_0x26c03a=0xc8;}else{_0x26c03a=0xce;}_0x5caa0b[_0xe641('0x1d')](_0x26c03a);return _0x5caa0b[_0xe641('0x23')](_0xe641('0x24'),_0x5ebbdf+'-'+_0x4d2c41+'/'+_0xab4ee1)[_0xe641('0x1e')](_0x242f9d);}return null;};}function patchUpdates(_0x1d3c19){return function(_0x219530){try{jsonpatch[_0xe641('0x25')](_0x219530,_0x1d3c19,!![]);}catch(_0xf591c4){return BPromise[_0xe641('0x26')](_0xf591c4);}return _0x219530['save']();};}function saveUpdates(_0x34b99c,_0x17f50e){return function(_0x1563c3){if(_0x1563c3){return _0x1563c3['update'](_0x34b99c)[_0xe641('0x27')](function(_0x21b71c){return _0x21b71c;});}return null;};}function removeEntity(_0x505f0f,_0x52c1c6){return function(_0xb4232){if(_0xb4232){return _0xb4232[_0xe641('0x28')]()['then'](function(){_0x505f0f[_0xe641('0x1d')](0xcc)[_0xe641('0x29')]();});}};}function handleEntityNotFound(_0x235b51,_0x2faae5){return function(_0x27773c){if(!_0x27773c){_0x235b51[_0xe641('0x1c')](0x194);}return _0x27773c;};}function handleError(_0x349d89,_0x82c992){_0x82c992=_0x82c992||0x1f4;return function(_0x4a3240){logger['error'](_0x4a3240[_0xe641('0x2a')]);if(_0x4a3240[_0xe641('0x2b')]){delete _0x4a3240[_0xe641('0x2b')];}_0x349d89['status'](_0x82c992)[_0xe641('0x2c')](_0x4a3240);};}exports[_0xe641('0x2d')]=function(_0x3c1f31,_0xa4cd05){var _0x3ae56b={},_0x1293f9={},_0x248935={'count':0x0,'rows':[]};return db[_0xe641('0x2e')][_0xe641('0x2f')]()[_0xe641('0x27')](function(_0x581ecf){var _0x2593da=[];for(var _0x21ef0f=0x0;_0x21ef0f<Object[_0xe641('0x30')](_0x581ecf)['length'];_0x21ef0f++){var _0x3fe1f6=Object['keys'](_0x581ecf)[_0x21ef0f];if(_[_0xe641('0x31')](_0x3fe1f6,_0xe641('0x32'))){_0x2593da['push'](db[_0xe641('0x33')][_0xe641('0x34')]({'where':{'id':_[_0xe641('0x35')](_0x3fe1f6,'cf_')},'raw':!![]}));}}return BPromise[_0xe641('0x36')](_0x2593da)[_0xe641('0x27')](function(_0x5958b4){for(var _0x2eb776=0x0;_0x2eb776<_0x5958b4['length'];_0x2eb776++){if(_0x5958b4[_0x2eb776]){var _0x2afa1a='cf_'+_0x5958b4[_0x2eb776]['id'];var _0x3dbfd2=_0x581ecf[_0x2afa1a];_0x3dbfd2[_0xe641('0x37')]=_0x5958b4[_0x2eb776][_0xe641('0x38')];}}return _0x581ecf;});})[_0xe641('0x27')](function(_0x3a509a){_0x1293f9[_0xe641('0x39')]=_['keys'](_0x3a509a);_0x1293f9['query']=_[_0xe641('0x30')](_0x3c1f31[_0xe641('0x3a')]);_0x1293f9[_0xe641('0x3b')]=_[_0xe641('0x3c')](_0x1293f9[_0xe641('0x39')],_0x1293f9['query']);_0x3ae56b[_0xe641('0x3d')]=_[_0xe641('0x3c')](_0x1293f9[_0xe641('0x39')],qs[_0xe641('0x3e')](_0x3c1f31[_0xe641('0x3a')][_0xe641('0x3e')]));_0x3ae56b[_0xe641('0x3d')]=_0x3ae56b[_0xe641('0x3d')][_0xe641('0x3f')]?_0x3ae56b[_0xe641('0x3d')]:_0x1293f9[_0xe641('0x39')];if(!_0x3c1f31['query']['hasOwnProperty']('nolimit')){_0x3ae56b[_0xe641('0x22')]=qs[_0xe641('0x22')](_0x3c1f31[_0xe641('0x3a')][_0xe641('0x22')]);_0x3ae56b['offset']=qs[_0xe641('0x1f')](_0x3c1f31[_0xe641('0x3a')][_0xe641('0x1f')]);}_0x3ae56b[_0xe641('0x40')]=qs['sort'](_0x3c1f31[_0xe641('0x3a')][_0xe641('0x41')]);_0x3ae56b[_0xe641('0x42')]=qs[_0xe641('0x3b')](_[_0xe641('0x43')](_0x3c1f31[_0xe641('0x3a')],_0x1293f9[_0xe641('0x3b')]),_0x3a509a);var _0x19050d=[];var _0x539767=squel[_0xe641('0x44')]()[_0xe641('0x45')]('id')['field'](_0xe641('0x2b'))[_0xe641('0x45')](_0xe641('0x46'))[_0xe641('0x47')](_0xe641('0x48'));var _0x2aa857=squel[_0xe641('0x44')]()['from'](_0xe641('0x49'),'c')[_0xe641('0x4a')]('cm_user_has_contacts','uc',_0xe641('0x4b'))[_0xe641('0x4a')](_0xe641('0x4c'),'ct',_0xe641('0x4d'))[_0xe641('0x4a')](_0xe641('0x48'),'t','t.id\x20=\x20ct.TagId')[_0xe641('0x42')](_0xe641('0x4e'));var _0x53823b=squel[_0xe641('0x4f')]();var _0x386683=[];var _0xeb791=squel['expr']();var _0x53172d;if(_0x3c1f31[_0xe641('0x3a')]['search']){_0x53172d=as['parseSearch'](_0x3c1f31[_0xe641('0x3a')][_0xe641('0x50')]);var _0xa7b326=_0x53172d['sqlOperator'];for(var _0x228a5a=0x0;_0x228a5a<_0x53172d[_0xe641('0x51')][_0xe641('0x3f')];_0x228a5a++){var _0x359dad=_0x53172d[_0xe641('0x51')][_0x228a5a];var _0x36395f='c';var _0x99470d=_(_0x3a509a)['keys']()[_0xe641('0x52')](function(_0x30c61c){return _0x30c61c===_0x359dad[_0xe641('0x45')];});if(_0x99470d)_0x99470d=_0x3a509a[_0x359dad[_0xe641('0x45')]];if(!_0x99470d){if(_0x359dad[_0xe641('0x45')]==='Tag'){var _0x24cc7e=_0x359dad[_0xe641('0x53')][_0xe641('0x54')](',')[_0xe641('0x55')](function(_0x23c629){return Number(_0x23c629);});_0x24cc7e[_0xe641('0x56')](function(_0x534454){_0xeb791['or'](_0xe641('0x57'),'%,'+_0x534454+',%');});_0x386683=_[_0xe641('0x58')](_0x386683,_0x24cc7e);}else if(_0x359dad[_0xe641('0x45')]===_0xe641('0x59')){_0x53823b[_0xe641('0x5a')](_0xe641('0x5b'),_0x359dad[_0xe641('0x53')]);}}else{if(_0x359dad[_0xe641('0x45')]===_0xe641('0x5c')||_0x99470d['fieldType']===_0xe641('0x5d'))_0x359dad[_0xe641('0x5e')]='DATE';var _0x460a3a=as[_0xe641('0x5f')](_0x36395f,_0x99470d[_0xe641('0x38')],_0x359dad);_0x53823b[_0xa7b326](_0x460a3a[_0xe641('0x60')],_0x460a3a['value']['start'],_0x460a3a[_0xe641('0x53')][_0xe641('0x29')]);}}}else{var _0x27b23f=_(Object['keys'](_0x3c1f31[_0xe641('0x3a')]))['map'](function(_0x2e2d0a){return _0x3a509a[_0xe641('0x61')](_0x2e2d0a)?_0x2e2d0a:undefined;})['filter'](function(_0x3a0053){return!_[_0xe641('0x62')](_0x3a0053);})[_0xe641('0x53')]();if(_0x3c1f31[_0xe641('0x3a')][_0xe641('0x63')])_0x27b23f[_0xe641('0x64')](_0xe641('0x63'));if(!_[_0xe641('0x65')](_0x27b23f)){_0x27b23f[_0xe641('0x56')](function(_0x1e5fd0){if(_0x1e5fd0===_0xe641('0x66')){_0x2aa857[_0xe641('0x42')](_0xe641('0x67'),[][_0xe641('0x68')](_0x3c1f31[_0xe641('0x3a')][_0x1e5fd0]));}else if(_0x1e5fd0===_0xe641('0x63')){var _0x45e168='%'+_0x3c1f31['query'][_0x1e5fd0]+'%';_0x2aa857['where'](_0xe641('0x69'),_0x45e168);}else{_0x2aa857[_0xe641('0x42')]('c.'+_0x1e5fd0+_0xe641('0x6a'),_0x3c1f31[_0xe641('0x3a')][_0x1e5fd0]);}});}if(_0x3c1f31[_0xe641('0x3a')][_0xe641('0x6b')]){_0x386683=_[_0xe641('0x6c')](_0x3c1f31[_0xe641('0x3a')][_0xe641('0x6b')])?_0x3c1f31[_0xe641('0x3a')][_0xe641('0x6b')]:new Array(_0x3c1f31[_0xe641('0x3a')][_0xe641('0x6b')]);_0x386683[_0xe641('0x56')](function(_0x999452){_0xeb791['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x999452+',%');});}if(_0x3c1f31[_0xe641('0x3a')][_0xe641('0x6d')]){var _0x239864=_0x3c1f31[_0xe641('0x3a')][_0xe641('0x6d')][_0xe641('0x6e')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x239864['split']('\x20')[_0xe641('0x3f')]>0x1){_0x53823b['or'](_0xe641('0x6f'),qs[_0xe641('0x70')](_0x239864),null);}else{if(qs['isNumeric'](_0x239864)){_0x53823b['or'](_0xe641('0x71'),_0x239864+'%');_0x53823b['or'](_0xe641('0x72'),_0x239864+'%');_0x53823b['or']('c.mobile\x20LIKE\x20?',_0x239864+'%');_0x53823b['or'](_0xe641('0x73'),_0x239864+'%');}else if(qs['isEmail'](_0x239864)){_0x53823b['or'](_0xe641('0x74'),_0x239864+'%');}else{_0x53823b['or'](_0xe641('0x75'),'%'+_0x239864+'%');_0x53823b['or'](_0xe641('0x76'),'%'+_0x239864+'%');_0x53823b['or'](_0xe641('0x74'),'%'+_0x239864+'%');}}}}_0x2aa857[_0xe641('0x42')](_0x53823b);_0x2aa857['group'](_0xe641('0x77'));var _0x470dab={'type':db['Sequelize'][_0xe641('0x78')][_0xe641('0x79')],'raw':!![]};var _0x35cc50=_0x2aa857[_0xe641('0x7a')]()[_0xe641('0x45')](_0xe641('0x77'));if(_0x3ae56b[_0xe641('0x40')]){_0x3ae56b['order'][_0xe641('0x56')](function(_0x38b7ff){_0x2aa857[_0xe641('0x40')]('c.'+_0x38b7ff[0x0],_0x38b7ff[0x1]===_0xe641('0x7b')?![]:!![]);});}if(!_[_0xe641('0x65')](_0x386683)){_0x2aa857[_0xe641('0x7c')](_0xeb791);_0x35cc50[_0xe641('0x42')](_0xe641('0x7d'),_0x386683);}BPromise[_0xe641('0x7e')]()[_0xe641('0x27')](function(){if(!_0x53172d)return;if(_0x3c1f31['user'][_0xe641('0x7f')]!==_0xe641('0x80'))return;if(!_[_0xe641('0x81')](_0x53172d[_0xe641('0x51')],[_0xe641('0x45'),_0xe641('0x59')])){return _0x3c1f31[_0xe641('0x82')][_0xe641('0x83')]({'attributes':['id'],'raw':!![]})[_0xe641('0x27')](function(_0x31d539){if(_[_0xe641('0x65')](_0x31d539)){_0x35cc50[_0xe641('0x42')](_0xe641('0x84'));_0x2aa857['where'](_0xe641('0x84'));}else{_0x35cc50[_0xe641('0x42')](_0xe641('0x67'),_[_0xe641('0x55')](_0x31d539,'id'));_0x2aa857['where'](_0xe641('0x67'),_[_0xe641('0x55')](_0x31d539,'id'));}});}})[_0xe641('0x27')](function(){if(_0x3c1f31[_0xe641('0x82')]['role']===_0xe641('0x80')&&!_0x53172d&&!_0x3c1f31[_0xe641('0x3a')][_0xe641('0x66')])return[];return db[_0xe641('0x85')][_0xe641('0x3a')](_0x35cc50[_0xe641('0x86')](),_0x470dab);})[_0xe641('0x27')](function(_0x35eb15){_0x248935[_0xe641('0x21')]=_0x35eb15['length'];if(_0x248935[_0xe641('0x21')]===0x0)return[];return db[_0xe641('0x85')][_0xe641('0x3a')](_0x539767[_0xe641('0x86')](),_0x470dab)[_0xe641('0x27')](function(_0x8dfda3){_0x19050d=_[_0xe641('0x87')](_0x8dfda3,'id');_0x470dab=_[_0xe641('0x88')](_0x470dab,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3c1f31['query'][_0xe641('0x3e')]){_0x3ae56b['attributes'][_0xe641('0x56')](function(_0x2ef626){_0x2aa857[_0xe641('0x45')]('c.'+_0x2ef626);});}else{_0x2aa857['field'](_0xe641('0x77'));_0x2aa857['field'](_0xe641('0x89'));_0x2aa857[_0xe641('0x45')](_0xe641('0x8a'));_0x2aa857['field']('c.phone');_0x2aa857[_0xe641('0x45')]('c.mobile');_0x2aa857[_0xe641('0x45')](_0xe641('0x8b'));_0x2aa857['field'](_0xe641('0x8c'));_0x2aa857[_0xe641('0x45')](_0xe641('0x8d'));_0x2aa857[_0xe641('0x45')](_0xe641('0x8e'));_0x2aa857[_0xe641('0x45')](_0xe641('0x8f'));_0x2aa857[_0xe641('0x45')]('c.CompanyId');_0x2aa857[_0xe641('0x45')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xe641('0x90'));}if(_0x3ae56b[_0xe641('0x22')])_0x2aa857[_0xe641('0x22')](_0x3ae56b['limit']);if(_0x3ae56b['offset'])_0x2aa857[_0xe641('0x1f')](_0x3ae56b[_0xe641('0x1f')]);return db[_0xe641('0x85')][_0xe641('0x3a')](_0x2aa857[_0xe641('0x86')](),_0x470dab);});})[_0xe641('0x27')](function(_0xf1971b){_0xf1971b['forEach'](function(_0x597c32){if(_0x597c32[_0xe641('0x90')]){_0x597c32[_0xe641('0x91')]=[];_0x597c32[_0xe641('0x90')][_0xe641('0x54')](',')[_0xe641('0x56')](function(_0xca2069){_0x597c32['Tags']['push'](_0x19050d[_0xca2069]);});}delete _0x597c32['TagIds'];});_0x248935[_0xe641('0x92')]=_0xf1971b;return _0x248935;})[_0xe641('0x27')](respondWithFilteredResult(_0xa4cd05,_0x3ae56b));})[_0xe641('0x93')](handleError(_0xa4cd05,null));};exports[_0xe641('0x28')]=function(_0x38cba2,_0x52b46b){return db[_0xe641('0x2e')][_0xe641('0x52')]({'where':{'id':_0x38cba2[_0xe641('0x94')]['id']}})[_0xe641('0x27')](handleEntityNotFound(_0x52b46b,null))[_0xe641('0x27')](removeEntity(_0x52b46b,null))[_0xe641('0x93')](handleError(_0x52b46b,null));};exports[_0xe641('0x2f')]=function(_0x50abce,_0x536c73){return db[_0xe641('0x2e')][_0xe641('0x2f')]()[_0xe641('0x27')](function(_0x339b46){delete _0x339b46[_0xe641('0x95')];for(var _0x3641e7=0x0;_0x3641e7<Object['keys'](_0x339b46)['length'];_0x3641e7++){var _0x12264e=Object[_0xe641('0x30')](_0x339b46)[_0x3641e7];if(!_[_0xe641('0x31')](_0x12264e,_0xe641('0x32'))){_0x339b46[_0x12264e][_0xe641('0x96')]=_0x12264e;_0x339b46[_0x12264e][_0xe641('0x97')]=_0x12264e;}}return _0x339b46;})[_0xe641('0x27')](function(_0x4d78af){var _0x4b2c7={'where':{'$or':[{'ListId':_0x50abce[_0xe641('0x3a')]['id']},{'ListId':null}]},'raw':!![]};return db[_0xe641('0x33')][_0xe641('0x98')](_0x4b2c7)[_0xe641('0x27')](function(_0x3a0737){for(var _0x474b12=0x0;_0x474b12<_0x3a0737['length'];_0x474b12++){var _0x589b36=_0xe641('0x32')+_0x3a0737[_0x474b12]['id'];_0x4d78af[_0x589b36]['columnName']=_0x589b36;_0x4d78af[_0x589b36][_0xe641('0x97')]=_0x3a0737[_0x474b12][_0xe641('0x99')];_0x4d78af[_0x589b36][_0xe641('0x9a')]={'type':_0x3a0737[_0x474b12][_0xe641('0x38')],'values':_0x3a0737[_0x474b12][_0xe641('0x9b')]};}Object[_0xe641('0x30')](_0x4d78af)[_0xe641('0x56')](function(_0x362ce5){if(!_0x4d78af[_0x362ce5][_0xe641('0x61')](_0xe641('0x96'))){delete _0x4d78af[_0x362ce5];}});return _0x4d78af;});})['then'](respondWithResult(_0x536c73,null))[_0xe641('0x93')](handleError(_0x536c73,null));};exports[_0xe641('0x88')]=function(_0x16314f,_0x12c626){var _0x367746;var _0x1349c9;var _0x571566;if(_0x16314f['body']['id']){delete _0x16314f['body']['id'];}return db[_0xe641('0x2e')]['findAll']({'where':{'id':[_0x16314f[_0xe641('0x9c')]['to'],_0x16314f[_0xe641('0x9c')][_0xe641('0x47')]]}})[_0xe641('0x27')](function(_0x542e86){if(_0x542e86){if(_0x542e86[_0xe641('0x3f')]!==0x2){return null;}_0x542e86[0x0]=_0x542e86[0x0][_0xe641('0x9d')]({'plain':!![]});_0x542e86[0x1]=_0x542e86[0x1][_0xe641('0x9d')]({'plain':!![]});delete _0x542e86[0x0]['id'];delete _0x542e86[0x1]['id'];return _['mergeWith'](_0x542e86[0x0],_0x542e86[0x1],function(_0x1c9ac6,_0x29433e){if(Array[_0xe641('0x6c')](_0x29433e)&&!_0x29433e['length']){return _0x1c9ac6;}else if(!_0x29433e){return _0x1c9ac6;}});}})['then'](handleEntityNotFound(_0x12c626,null))[_0xe641('0x27')](function(_0x463897){if(_0x463897){if(_0x463897[_0xe641('0x95')]&&_[_0xe641('0x6c')](_0x463897[_0xe641('0x95')])){_0x463897['tags']=_0x463897[_0xe641('0x95')][_0xe641('0x9e')]();}logger[_0xe641('0x9f')]('[CmContact][merge]\x20to\x20%s\x20from\x20%s',_0x16314f[_0xe641('0x9c')]['to'],_0x16314f[_0xe641('0x9c')][_0xe641('0x47')]);return db[_0xe641('0xa0')][_0xe641('0x28')]({'where':{'ContactId':[_0x16314f['body']['to'],_0x16314f[_0xe641('0x9c')][_0xe641('0x47')]]}})[_0xe641('0x27')](function(_0x20d5cf){logger['info'](_0xe641('0xa1'),_0x20d5cf);return db[_0xe641('0xa2')][_0xe641('0x28')]({'where':{'ContactId':[_0x16314f[_0xe641('0x9c')]['to'],_0x16314f[_0xe641('0x9c')][_0xe641('0x47')]]}})[_0xe641('0x27')](function(_0x1a9b3a){logger['info'](_0xe641('0xa3'),_0x1a9b3a);return db[_0xe641('0x2e')][_0xe641('0xa4')](_0x463897);});});}})[_0xe641('0x27')](function(_0xa08c6){if(_0xa08c6){_0x367746=_0xa08c6;_0x1349c9={'ContactId':_0x367746['id']};_0x571566={'where':{'ContactId':[_0x16314f[_0xe641('0x9c')]['to'],_0x16314f[_0xe641('0x9c')]['from']]}};return db['ChatInteraction']['update'](_0x1349c9,_0x571566);}})['then'](function(){if(_0x367746){return db[_0xe641('0xa5')][_0xe641('0xa6')](_0x1349c9,_0x571566);}})['then'](function(){if(_0x367746){return db[_0xe641('0xa7')]['update'](_0x1349c9,_0x571566);}})[_0xe641('0x27')](function(){if(_0x367746){return db['MailInteraction'][_0xe641('0xa6')](_0x1349c9,_0x571566);}})[_0xe641('0x27')](function(){if(_0x367746){return db[_0xe641('0xa8')][_0xe641('0xa6')](_0x1349c9,_0x571566);}})[_0xe641('0x27')](function(){if(_0x367746){return db['MailInteraction']['update'](_0x1349c9,_0x571566);}})[_0xe641('0x27')](function(){if(_0x367746){return db[_0xe641('0xa8')][_0xe641('0xa6')](_0x1349c9,_0x571566);}})[_0xe641('0x27')](function(){if(_0x367746){return db[_0xe641('0xa9')][_0xe641('0xa6')](_0x1349c9,_0x571566);}})[_0xe641('0x27')](function(){if(_0x367746){return db[_0xe641('0xaa')][_0xe641('0xa6')](_0x1349c9,_0x571566);}})['then'](function(){if(_0x367746){return db[_0xe641('0xab')][_0xe641('0xa6')](_0x1349c9,_0x571566);}})['then'](function(){if(_0x367746){return db[_0xe641('0xac')]['update'](_0x1349c9,_0x571566);}})['then'](function(){if(_0x367746){return db['OpenchannelInteraction'][_0xe641('0xa6')](_0x1349c9,_0x571566);}})[_0xe641('0x27')](function(){if(_0x367746){return db['OpenchannelMessage'][_0xe641('0xa6')](_0x1349c9,_0x571566);}})[_0xe641('0x27')](function(){if(_0x367746){return db[_0xe641('0xad')][_0xe641('0xa6')](_0x1349c9,_0x571566);}})[_0xe641('0x27')](function(){if(_0x367746){return db[_0xe641('0xae')][_0xe641('0xa6')](_0x1349c9,_0x571566);}})['then'](function(){if(_0x367746){return db[_0xe641('0xaf')][_0xe641('0xa6')](_0x1349c9,_0x571566);}})[_0xe641('0x27')](function(){if(_0x367746){return db[_0xe641('0xb0')][_0xe641('0xa6')](_0x1349c9,_0x571566);}})['then'](function(){if(_0x367746){return db['ChatQueueReport'][_0xe641('0xa6')](_0x1349c9,_0x571566);}})[_0xe641('0x27')](function(){if(_0x367746){return db['FaxQueueReport'][_0xe641('0xa6')](_0x1349c9,_0x571566);}})[_0xe641('0x27')](function(){if(_0x367746){return db[_0xe641('0xb1')]['update'](_0x1349c9,_0x571566);}})[_0xe641('0x27')](function(){if(_0x367746){return db[_0xe641('0xb2')][_0xe641('0xa6')](_0x1349c9,_0x571566);}})[_0xe641('0x27')](function(){if(_0x367746){return db[_0xe641('0xb3')][_0xe641('0xa6')](_0x1349c9,_0x571566);}})['then'](function(){if(_0x367746){return db[_0xe641('0xb4')][_0xe641('0xa6')](_0x1349c9,_0x571566);}})[_0xe641('0x27')](function(){if(_0x367746){return db['WhatsappInteraction'][_0xe641('0xa6')](_0x1349c9,_0x571566);}})[_0xe641('0x27')](function(){if(_0x367746){return db[_0xe641('0xb5')][_0xe641('0xa6')](_0x1349c9,_0x571566);}})[_0xe641('0x27')](function(){if(_0x367746){return db['WhatsappQueueReport'][_0xe641('0xa6')](_0x1349c9,_0x571566);}})[_0xe641('0x27')](function(){if(_0x367746){return db[_0xe641('0x2e')][_0xe641('0x28')]({'where':{'id':[_0x16314f[_0xe641('0x9c')]['to'],_0x16314f[_0xe641('0x9c')][_0xe641('0x47')]]}});}})[_0xe641('0x27')](function(){if(_0x367746){return _0x367746;}})[_0xe641('0x27')](respondWithResult(_0x12c626,null))['catch'](handleError(_0x12c626,null));};exports[_0xe641('0xa4')]=function(_0x45bb46,_0xad255f){return db[_0xe641('0x2e')][_0xe641('0x2f')]()[_0xe641('0x27')](function(_0xeb1fb6){if(_0x45bb46[_0xe641('0x9c')][_0xe641('0x95')]&&_[_0xe641('0x6c')](_0x45bb46[_0xe641('0x9c')]['tags'])){if(_0x45bb46[_0xe641('0x9c')][_0xe641('0x95')][_0xe641('0x3f')]){_0x45bb46[_0xe641('0x9c')][_0xe641('0x95')]=_0x45bb46[_0xe641('0x9c')]['tags'][_0xe641('0x9e')](';')+';';}else{_0x45bb46['body'][_0xe641('0x95')]=null;}}else{_0x45bb46[_0xe641('0x9c')][_0xe641('0x95')]=null;}return db[_0xe641('0x2e')][_0xe641('0xa4')](_0x45bb46[_0xe641('0x9c')],{'fields':_['keys'](_0xeb1fb6),'raw':!![]});})['then'](respondWithResult(_0xad255f,0xc9))['catch'](handleError(_0xad255f,null));};exports['bulkCreate']=function(_0x44cbab,_0xe674a2){var _0x4ad144=[];var _0x26d715=0x0;var _0x144325=0x0;var _0x3a1f42=0x0;return db[_0xe641('0x2e')][_0xe641('0x2f')]()[_0xe641('0x27')](function(_0x1abe8e){return BPromise['each'](_0x44cbab[_0xe641('0x9c')],function(_0x7bf8e3){var _0x531bc0={'where':{'$or':[]},'defaults':_0x7bf8e3,'fields':_[_0xe641('0x30')](_0x1abe8e),'raw':!![]};if(_0x7bf8e3[_0xe641('0xb6')]){for(var _0x56ee2f=0x0;_0x56ee2f<_0x7bf8e3['duplicates'][_0xe641('0x3f')];_0x56ee2f++){var _0x35452b={};_0x35452b[_0x7bf8e3['duplicates'][_0x56ee2f]]=_0x7bf8e3[_0x7bf8e3[_0xe641('0xb6')][_0x56ee2f]];_0x531bc0[_0xe641('0x42')][_0xe641('0xb7')]['push'](_0x35452b);}_0x531bc0[_0xe641('0x42')]['ListId']=_0x7bf8e3[_0xe641('0x66')];}return db[_0xe641('0x2e')][_0xe641('0xb8')](_0x531bc0)['spread'](function(_0x56894c,_0x195adc){if(_0x195adc){_0x26d715++;}else{_0x3a1f42++;}})[_0xe641('0x93')](function(_0x274b83){console[_0xe641('0xb9')](_0x274b83);_0x144325++;});});})['then'](function(_0x5bfeca){if(_0x5bfeca){return{'success':_0x26d715,'failure':_0x144325,'duplicates':_0x3a1f42};}})[_0xe641('0x27')](respondWithResult(_0xe674a2,0xc9))['catch'](handleError(_0xe674a2,null));};exports[_0xe641('0xba')]=function(_0x474b83,_0x1d5ee7,_0x4fcbb6){var _0x40d143;return db[_0xe641('0x2e')][_0xe641('0x2f')]()[_0xe641('0x27')](function(_0x34d18b){return db[_0xe641('0x2e')][_0xe641('0x52')]({'where':{'id':_0x474b83[_0xe641('0x94')]['id']},'include':[{'model':db[_0xe641('0xbb')],'as':_0xe641('0x91'),'attributes':['id',_0xe641('0x2b'),_0xe641('0x46')],'required':_0x474b83[_0xe641('0x3a')]['tag']?!![]:![]}],'attributes':_[_0xe641('0x30')](_0x34d18b)});})[_0xe641('0x27')](function(_0x37fe34){_0x40d143=_0x37fe34[_0xe641('0x9d')]({'plain':!![]});var _0x52611f={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x37fe34&&_0x37fe34['ListId']){if(_0x37fe34[_0xe641('0x66')]){_0x52611f[_0xe641('0x42')][_0xe641('0xbc')][_0xe641('0x64')]({'ListId':{'$ne':_0x37fe34[_0xe641('0x66')]}});}}return db[_0xe641('0x33')]['findAll'](_0x52611f);})['then'](function(_0x18238a){return _[_0xe641('0xbd')](_0x40d143,_[_0xe641('0x55')](_0x18238a,function(_0x33a281){return util[_0xe641('0xbe')]('cf_%d',_0x33a281['id']);}));})[_0xe641('0x27')](handleEntityNotFound(_0x1d5ee7,null))[_0xe641('0x27')](respondWithResult(_0x1d5ee7,null))[_0xe641('0x93')](handleError(_0x1d5ee7,null));};exports[_0xe641('0xa6')]=function(_0x231636,_0x13cb51){var _0x524966;if(_0x231636['body']['id']){delete _0x231636[_0xe641('0x9c')]['id'];}return db[_0xe641('0x2e')]['find']({'where':{'id':_0x231636[_0xe641('0x94')]['id']}})[_0xe641('0x27')](handleEntityNotFound(_0x13cb51,null))[_0xe641('0x27')](saveUpdates(_0x231636[_0xe641('0x9c')],null))[_0xe641('0x27')](function(_0x35585f){_0x524966=_0x35585f;var _0x4fd698={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x35585f&&_0x35585f[_0xe641('0x66')]){if(_0x35585f[_0xe641('0x66')]){_0x4fd698[_0xe641('0x42')][_0xe641('0xbc')][_0xe641('0x64')]({'ListId':{'$ne':_0x35585f[_0xe641('0x66')]}});}}return db[_0xe641('0x33')][_0xe641('0x98')](_0x4fd698);})['then'](function(_0x34101b){if(_0x34101b){return _[_0xe641('0xbd')](_[_0xe641('0xbf')](_0x231636[_0xe641('0x9c')],function(_0x4dea72,_0x1f06a4){return _[_0xe641('0x31')](_0x1f06a4,_0xe641('0x32'));}),_[_0xe641('0x55')](_0x34101b,function(_0x3658f1){return util[_0xe641('0xbe')](_0xe641('0xc0'),_0x3658f1['id']);}));}})[_0xe641('0x27')](function(_0x8ceeb0){if(_0x8ceeb0&&!_[_0xe641('0x65')](_0x8ceeb0)){var _0x336094=squel[_0xe641('0xa6')]()[_0xe641('0xc1')](_0xe641('0x49'))['setFields'](_0x8ceeb0)[_0xe641('0x42')](_0xe641('0xc2'),_0x231636[_0xe641('0x94')]['id'])[_0xe641('0xc3')]();return db[_0xe641('0x85')]['query'](_0x336094['text'],{'replacements':_0x336094[_0xe641('0x9b')]});}})[_0xe641('0x27')](function(){if(_0x231636[_0xe641('0x9c')]['phone']&&_0x524966){return db[_0xe641('0xa0')][_0xe641('0xa6')]({'phone':_0x231636[_0xe641('0x9c')][_0xe641('0xc4')]},{'where':{'ContactId':_0x524966['id']}});}})[_0xe641('0x27')](function(){return _0x524966;})[_0xe641('0x27')](respondWithResult(_0x13cb51,null))[_0xe641('0x93')](handleError(_0x13cb51,null));};exports[_0xe641('0xc5')]=function(_0x9e9017,_0x2b6b2e,_0x2ea8af){var _0x49eb2f={};var _0x5027bd={};var _0x2890cb;var _0x2e22a9;return db[_0xe641('0x2e')][_0xe641('0x34')]({'where':{'id':_0x9e9017[_0xe641('0x94')]['id']}})[_0xe641('0x27')](handleEntityNotFound(_0x2b6b2e,null))['then'](function(_0x5ba159){if(_0x5ba159){_0x2890cb=_0x5ba159;_0x5027bd[_0xe641('0x39')]=_[_0xe641('0x30')](db['Tag'][_0xe641('0xc6')]);_0x5027bd[_0xe641('0x3a')]=_[_0xe641('0x30')](_0x9e9017[_0xe641('0x3a')]);_0x5027bd[_0xe641('0x3b')]=_[_0xe641('0x3c')](_0x5027bd[_0xe641('0x39')],_0x5027bd[_0xe641('0x3a')]);_0x49eb2f[_0xe641('0x3d')]=_[_0xe641('0x3c')](_0x5027bd['model'],qs[_0xe641('0x3e')](_0x9e9017[_0xe641('0x3a')]['fields']));_0x49eb2f[_0xe641('0x3d')]=_0x49eb2f[_0xe641('0x3d')][_0xe641('0x3f')]?_0x49eb2f[_0xe641('0x3d')]:_0x5027bd[_0xe641('0x39')];_0x49eb2f[_0xe641('0x40')]=qs['sort'](_0x9e9017[_0xe641('0x3a')][_0xe641('0x41')]);_0x49eb2f[_0xe641('0x42')]=qs['filters'](_[_0xe641('0x43')](_0x9e9017[_0xe641('0x3a')],_0x5027bd[_0xe641('0x3b')]));if(_0x9e9017['query'][_0xe641('0x6d')]){_0x49eb2f[_0xe641('0x42')]=_[_0xe641('0x88')](_0x49eb2f[_0xe641('0x42')],{'$or':_[_0xe641('0x55')](_0x49eb2f['attributes'],function(_0x5086fb){var _0x1b360d={};_0x1b360d[_0x5086fb]={'$like':'%'+_0x9e9017[_0xe641('0x3a')][_0xe641('0x6d')]+'%'};return _0x1b360d;})});}_0x49eb2f=_[_0xe641('0x88')]({},_0x49eb2f,_0x9e9017['options']);return _0x2890cb[_0xe641('0xc5')](_0x49eb2f);}})['then'](function(_0x50b598){if(_0x50b598){_0x2e22a9=_0x50b598['length'];if(!_0x9e9017[_0xe641('0x3a')][_0xe641('0x61')](_0xe641('0xc7'))){_0x49eb2f[_0xe641('0x22')]=qs[_0xe641('0x22')](_0x9e9017['query']['limit']);_0x49eb2f[_0xe641('0x1f')]=qs[_0xe641('0x1f')](_0x9e9017[_0xe641('0x3a')][_0xe641('0x1f')]);}return _0x2890cb[_0xe641('0xc5')](_0x49eb2f);}})['then'](function(_0x33bd18){if(_0x33bd18){return _0x33bd18?{'count':_0x2e22a9,'rows':_0x33bd18}:null;}})['then'](respondWithResult(_0x2b6b2e,null))[_0xe641('0x93')](handleError(_0x2b6b2e,null));};exports['setTags']=function(_0x53307e,_0x5c68e1,_0x168078){if(_0x53307e[_0xe641('0x9c')]['id']){delete _0x53307e['body']['id'];}return db[_0xe641('0x2e')][_0xe641('0x34')]({'where':{'id':_0x53307e[_0xe641('0x94')]['id']}})[_0xe641('0x27')](handleEntityNotFound(_0x5c68e1,null))[_0xe641('0x27')](function(_0x5437ef){if(_0x5437ef){return _0x5437ef['setTags'](_0x53307e['body']['ids']||[]);}return null;})[_0xe641('0x27')](respondWithResult(_0x5c68e1,null))[_0xe641('0x93')](handleError(_0x5c68e1,null));};exports['getHoppers']=function(_0x4b7ef3,_0x4194ad,_0x531856){var _0x5ef06c={'raw':![],'where':{}};var _0x3a6ce4={};var _0x19caa5={'count':0x0,'rows':[]};return db[_0xe641('0x2e')]['findOne']({'where':{'id':_0x4b7ef3[_0xe641('0x94')]['id']}})[_0xe641('0x27')](handleEntityNotFound(_0x4194ad,null))[_0xe641('0x27')](function(_0x76d219){if(_0x76d219){_0x3a6ce4[_0xe641('0x39')]=_['keys'](db[_0xe641('0xa0')][_0xe641('0xc6')]);_0x3a6ce4['query']=_[_0xe641('0x30')](_0x4b7ef3[_0xe641('0x3a')]);_0x3a6ce4[_0xe641('0x3b')]=_[_0xe641('0x3c')](_0x3a6ce4[_0xe641('0x39')],_0x3a6ce4[_0xe641('0x3a')]);_0x5ef06c['attributes']=_[_0xe641('0x3c')](_0x3a6ce4[_0xe641('0x39')],qs['fields'](_0x4b7ef3[_0xe641('0x3a')]['fields']));_0x5ef06c['attributes']=_0x5ef06c[_0xe641('0x3d')][_0xe641('0x3f')]?_0x5ef06c[_0xe641('0x3d')]:_0x3a6ce4[_0xe641('0x39')];if(!_0x4b7ef3[_0xe641('0x3a')][_0xe641('0x61')](_0xe641('0xc7'))){_0x5ef06c[_0xe641('0x22')]=qs[_0xe641('0x22')](_0x4b7ef3[_0xe641('0x3a')][_0xe641('0x22')]);_0x5ef06c['offset']=qs[_0xe641('0x1f')](_0x4b7ef3['query'][_0xe641('0x1f')]);}_0x5ef06c['order']=qs[_0xe641('0x41')](_0x4b7ef3[_0xe641('0x3a')][_0xe641('0x41')]);_0x5ef06c[_0xe641('0x42')]=qs[_0xe641('0x3b')](_[_0xe641('0x43')](_0x4b7ef3[_0xe641('0x3a')],_0x3a6ce4[_0xe641('0x3b')]));_0x5ef06c['where'][_0xe641('0xc8')]=_0x76d219['id'];if(_0x4b7ef3[_0xe641('0x3a')]['filter']){_0x5ef06c[_0xe641('0x42')]=_['merge'](_0x5ef06c['where'],{'$or':_[_0xe641('0x55')](_0x5ef06c[_0xe641('0x3d')],function(_0x3b2d27){var _0x3ab7ed={};_0x3ab7ed[_0x3b2d27]={'$like':'%'+_0x4b7ef3[_0xe641('0x3a')][_0xe641('0x6d')]+'%'};return _0x3ab7ed;})});}_0x5ef06c=_[_0xe641('0x88')]({},_0x5ef06c,_0x4b7ef3[_0xe641('0xc9')]);return db[_0xe641('0xa0')][_0xe641('0x21')]({'where':_0x5ef06c[_0xe641('0x42')]})['then'](function(_0x34498a){_0x19caa5[_0xe641('0x21')]=_0x34498a;if(_0x4b7ef3[_0xe641('0x3a')][_0xe641('0xca')]){_0x5ef06c[_0xe641('0xcb')]=[{'all':!![]}];}return db['CmHopper'][_0xe641('0x98')](_0x5ef06c);})['then'](function(_0x578a98){_0x19caa5[_0xe641('0x92')]=_0x578a98;return _0x19caa5;});}})[_0xe641('0x27')](respondWithFilteredResult(_0x4194ad,_0x5ef06c))[_0xe641('0x93')](handleError(_0x4194ad,null));};exports[_0xe641('0xcc')]=function(_0x4393a2,_0xe4a5a0,_0x4530a4){var _0x449f1b={'raw':!![],'where':{}};var _0x454ec0={};var _0x5e208e={'count':0x0,'rows':[]};return db[_0xe641('0x2e')][_0xe641('0x34')]({'where':{'id':_0x4393a2[_0xe641('0x94')]['id']}})['then'](handleEntityNotFound(_0xe4a5a0,null))['then'](function(_0x31e3a8){if(_0x31e3a8){_0x454ec0['model']=_[_0xe641('0x30')](db['CmHopperHistory'][_0xe641('0xc6')]);_0x454ec0['query']=_[_0xe641('0x30')](_0x4393a2[_0xe641('0x3a')]);_0x454ec0[_0xe641('0x3b')]=_[_0xe641('0x3c')](_0x454ec0[_0xe641('0x39')],_0x454ec0[_0xe641('0x3a')]);_0x449f1b[_0xe641('0x3d')]=_[_0xe641('0x3c')](_0x454ec0['model'],qs[_0xe641('0x3e')](_0x4393a2[_0xe641('0x3a')][_0xe641('0x3e')]));_0x449f1b['attributes']=_0x449f1b[_0xe641('0x3d')][_0xe641('0x3f')]?_0x449f1b['attributes']:_0x454ec0[_0xe641('0x39')];if(!_0x4393a2[_0xe641('0x3a')][_0xe641('0x61')]('nolimit')){_0x449f1b[_0xe641('0x22')]=qs[_0xe641('0x22')](_0x4393a2[_0xe641('0x3a')][_0xe641('0x22')]);_0x449f1b[_0xe641('0x1f')]=qs['offset'](_0x4393a2[_0xe641('0x3a')][_0xe641('0x1f')]);}_0x449f1b[_0xe641('0x40')]=qs[_0xe641('0x41')](_0x4393a2['query']['sort']);_0x449f1b['where']=qs[_0xe641('0x3b')](_[_0xe641('0x43')](_0x4393a2[_0xe641('0x3a')],_0x454ec0[_0xe641('0x3b')]));_0x449f1b[_0xe641('0x42')]['ContactId']=_0x31e3a8['id'];if(_0x4393a2[_0xe641('0x3a')][_0xe641('0x6d')]){_0x449f1b['where']=_[_0xe641('0x88')](_0x449f1b['where'],{'$or':_[_0xe641('0x55')](_0x449f1b[_0xe641('0x3d')],function(_0x355a79){var _0xbc7ec={};_0xbc7ec[_0x355a79]={'$like':'%'+_0x4393a2[_0xe641('0x3a')][_0xe641('0x6d')]+'%'};return _0xbc7ec;})});}_0x449f1b=_[_0xe641('0x88')]({},_0x449f1b,_0x4393a2['options']);return db['CmHopperHistory']['count']({'where':_0x449f1b[_0xe641('0x42')]})['then'](function(_0x558bd1){_0x5e208e[_0xe641('0x21')]=_0x558bd1;if(_0x4393a2[_0xe641('0x3a')][_0xe641('0xca')]){_0x449f1b['include']=[{'all':!![]}];}return db[_0xe641('0xae')]['findAll'](_0x449f1b);})['then'](function(_0x43e095){_0x5e208e[_0xe641('0x92')]=_0x43e095;return _0x5e208e;});}})[_0xe641('0x27')](respondWithFilteredResult(_0xe4a5a0,_0x449f1b))[_0xe641('0x93')](handleError(_0xe4a5a0,null));};exports[_0xe641('0xcd')]=function(_0x237ae1,_0x40f766,_0x2928a5){var _0x55f92e={'raw':!![],'where':{}};var _0x3dd449={};var _0x451e62={'count':0x0,'rows':[]};return db[_0xe641('0x2e')][_0xe641('0x34')]({'where':{'id':_0x237ae1[_0xe641('0x94')]['id']}})[_0xe641('0x27')](handleEntityNotFound(_0x40f766,null))[_0xe641('0x27')](function(_0x5ddeb0){if(_0x5ddeb0){_0x3dd449[_0xe641('0x39')]=_[_0xe641('0x30')](db[_0xe641('0xad')][_0xe641('0xc6')]);_0x3dd449[_0xe641('0x3a')]=_[_0xe641('0x30')](_0x237ae1['query']);_0x3dd449[_0xe641('0x3b')]=_[_0xe641('0x3c')](_0x3dd449['model'],_0x3dd449[_0xe641('0x3a')]);_0x55f92e[_0xe641('0x3d')]=_['intersection'](_0x3dd449[_0xe641('0x39')],qs['fields'](_0x237ae1[_0xe641('0x3a')][_0xe641('0x3e')]));_0x55f92e[_0xe641('0x3d')]=_0x55f92e[_0xe641('0x3d')][_0xe641('0x3f')]?_0x55f92e[_0xe641('0x3d')]:_0x3dd449[_0xe641('0x39')];if(!_0x237ae1['query'][_0xe641('0x61')](_0xe641('0xc7'))){_0x55f92e['limit']=qs[_0xe641('0x22')](_0x237ae1[_0xe641('0x3a')][_0xe641('0x22')]);_0x55f92e[_0xe641('0x1f')]=qs['offset'](_0x237ae1[_0xe641('0x3a')]['offset']);}_0x55f92e['order']=qs[_0xe641('0x41')](_0x237ae1[_0xe641('0x3a')][_0xe641('0x41')]);_0x55f92e['where']=qs[_0xe641('0x3b')](_[_0xe641('0x43')](_0x237ae1['query'],_0x3dd449['filters']));_0x55f92e[_0xe641('0x42')][_0xe641('0xc8')]=_0x5ddeb0['id'];if(_0x237ae1[_0xe641('0x3a')][_0xe641('0x6d')]){_0x55f92e[_0xe641('0x42')]=_[_0xe641('0x88')](_0x55f92e['where'],{'$or':_[_0xe641('0x55')](_0x55f92e[_0xe641('0x3d')],function(_0x5867e9){var _0x341b10={};_0x341b10[_0x5867e9]={'$like':'%'+_0x237ae1[_0xe641('0x3a')][_0xe641('0x6d')]+'%'};return _0x341b10;})});}_0x55f92e=_[_0xe641('0x88')]({},_0x55f92e,_0x237ae1['options']);return db[_0xe641('0xad')][_0xe641('0x21')]({'where':_0x55f92e[_0xe641('0x42')]})[_0xe641('0x27')](function(_0x318231){_0x451e62[_0xe641('0x21')]=_0x318231;if(_0x237ae1[_0xe641('0x3a')]['includeAll']){_0x55f92e[_0xe641('0xcb')]=[{'all':!![]}];}return db[_0xe641('0xad')][_0xe641('0x98')](_0x55f92e);})[_0xe641('0x27')](function(_0x1b88e0){_0x451e62[_0xe641('0x92')]=_0x1b88e0;return _0x451e62;});}})['then'](respondWithFilteredResult(_0x40f766,_0x55f92e))['catch'](handleError(_0x40f766,null));};exports[_0xe641('0xce')]=function(_0x18e751,_0x20c805,_0x2a9435){var _0x6d48a={'raw':!![],'where':{}};var _0x1d9af9={};var _0x46368b={'count':0x0,'rows':[]};return db['CmContact'][_0xe641('0x34')]({'where':{'id':_0x18e751['params']['id']}})[_0xe641('0x27')](handleEntityNotFound(_0x20c805,null))[_0xe641('0x27')](function(_0x3ea47c){if(_0x3ea47c){_0x1d9af9[_0xe641('0x39')]=_[_0xe641('0x30')](db[_0xe641('0xb4')][_0xe641('0xc6')]);_0x1d9af9[_0xe641('0x3a')]=_['keys'](_0x18e751[_0xe641('0x3a')]);_0x1d9af9['filters']=_[_0xe641('0x3c')](_0x1d9af9[_0xe641('0x39')],_0x1d9af9[_0xe641('0x3a')]);_0x6d48a['attributes']=_[_0xe641('0x3c')](_0x1d9af9[_0xe641('0x39')],qs[_0xe641('0x3e')](_0x18e751['query'][_0xe641('0x3e')]));_0x6d48a['attributes']=_0x6d48a[_0xe641('0x3d')][_0xe641('0x3f')]?_0x6d48a[_0xe641('0x3d')]:_0x1d9af9[_0xe641('0x39')];if(!_0x18e751[_0xe641('0x3a')][_0xe641('0x61')](_0xe641('0xc7'))){_0x6d48a[_0xe641('0x22')]=qs[_0xe641('0x22')](_0x18e751[_0xe641('0x3a')][_0xe641('0x22')]);_0x6d48a['offset']=qs[_0xe641('0x1f')](_0x18e751['query'][_0xe641('0x1f')]);}_0x6d48a[_0xe641('0x40')]=qs[_0xe641('0x41')](_0x18e751[_0xe641('0x3a')][_0xe641('0x41')]);_0x6d48a[_0xe641('0x42')]=qs[_0xe641('0x3b')](_['pick'](_0x18e751['query'],_0x1d9af9['filters']));_0x6d48a[_0xe641('0x42')]['ContactId']=_0x3ea47c['id'];if(_0x18e751[_0xe641('0x3a')][_0xe641('0x6d')]){_0x6d48a[_0xe641('0x42')]=_[_0xe641('0x88')](_0x6d48a[_0xe641('0x42')],{'$or':_['map'](_0x6d48a[_0xe641('0x3d')],function(_0x3ca360){var _0x179e7b={};_0x179e7b[_0x3ca360]={'$like':'%'+_0x18e751[_0xe641('0x3a')]['filter']+'%'};return _0x179e7b;})});}_0x6d48a=_[_0xe641('0x88')]({},_0x6d48a,_0x18e751[_0xe641('0xc9')]);return db[_0xe641('0xb4')][_0xe641('0x21')]({'where':_0x6d48a['where']})[_0xe641('0x27')](function(_0x24a345){_0x46368b[_0xe641('0x21')]=_0x24a345;if(_0x18e751[_0xe641('0x3a')][_0xe641('0xca')]){_0x6d48a[_0xe641('0xcb')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x6d48a);})[_0xe641('0x27')](function(_0x121683){_0x46368b['rows']=_0x121683;return _0x46368b;});}})[_0xe641('0x27')](respondWithFilteredResult(_0x20c805,_0x6d48a))[_0xe641('0x93')](handleError(_0x20c805,null));};exports[_0xe641('0xcf')]=function(_0x189c4a,_0x4897bd,_0x39fb64){try{if(!_0x189c4a[_0xe641('0x9c')][_0xe641('0x66')]){throw new Error('No\x20ListId\x20specified');}if(!_0x189c4a[_0xe641('0x9c')]['binding_keys']){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x189c4a['body'][_0xe641('0xd0')]){throw new Error(_0xe641('0xd1'));}if(!_0x189c4a[_0xe641('0x9c')][_0xe641('0xd2')]){throw new Error(_0xe641('0xd3'));}var _0x4e314e=_0x189c4a[_0xe641('0x9c')]['binding_keys']['split'](',');var _0x247b8a=_0x189c4a[_0xe641('0x9c')][_0xe641('0xd0')][_0xe641('0x54')](',');if(!_0x4e314e[_0xe641('0x3f')]||!_0x247b8a[_0xe641('0x3f')]||_0x4e314e[_0xe641('0x3f')]!==_0x247b8a[_0xe641('0x3f')]){throw new Error(_0xe641('0xd4'));}_0x189c4a[_0xe641('0x9c')]['fields']=_[_0xe641('0xd5')](_0x4e314e,_0x247b8a);if(!_0x189c4a['body']['fields'][_0xe641('0xc4')]){throw new Error(_0xe641('0xd6'));}if(!_0x189c4a[_0xe641('0x9c')][_0xe641('0x3e')]['firstName']){throw new Error(_0xe641('0xd7'));}var _0x4fca24=path[_0xe641('0x9e')](config['root'],_0xe641('0xd8'),_0x189c4a[_0xe641('0xd9')][_0xe641('0xda')]);fs['chmodSync'](_0x4fca24,parseInt(_0xe641('0xdb'),0x8));var _0x49094b=require(_0xe641('0xdc'))[_0xe641('0xdd')](path[_0xe641('0x9e')](__dirname,'../../components/import/cm/csv'),[_0x4fca24,_0x189c4a['body'][_0xe641('0xde')],_0x189c4a[_0xe641('0x9c')][_0xe641('0xd0')],_0x189c4a[_0xe641('0x9c')][_0xe641('0x66')],_0x189c4a['body']['CompanyId'],_0x189c4a[_0xe641('0x9c')]['duplicates'],_0x189c4a['body'][_0xe641('0xd2')]]);return _0x4897bd[_0xe641('0x1d')](0xc8)[_0xe641('0x1e')]({'message':_0xe641('0xdf'),'pid':_0x49094b[_0xe641('0xe0')]});}catch(_0x40fade){return _0x4897bd[_0xe641('0x1d')](0x1f4)[_0xe641('0x2c')](_0x40fade);}};exports[_0xe641('0xe1')]=function(_0x5f4551,_0x207377,_0x198c80){var _0x30da4e=fs['createReadStream'](_0x5f4551[_0xe641('0xd9')][_0xe641('0x9')]);Papa[_0xe641('0xe2')](_0x30da4e,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x3ad1b0){return _0x207377['status'](0xc8)['json']({'file':_0x5f4551[_0xe641('0xd9')],'fields':_0x3ad1b0[_0xe641('0xe3')][_0xe641('0x3e')]});}});};exports[_0xe641('0xe4')]=function(_0x35e44c,_0x5aa5c5,_0x4d71b6){return db[_0xe641('0x59')][_0xe641('0x98')]({'raw':!![],'attributes':['id'],'where':{'role':_0xe641('0x80')}})[_0xe641('0x27')](function(_0x3b6de0){var _0x83bde2=![];if(!_0x35e44c[_0xe641('0x9c')][_0xe641('0x66')]){throw new Error(_0xe641('0xe5'));}if(!_0x35e44c[_0xe641('0x9c')][_0xe641('0xe6')][_0xe641('0xc4')]){throw new Error(_0xe641('0xd6'));}if(!_0x35e44c['body']['binding'][_0xe641('0xe7')]){throw new Error(_0xe641('0xd7'));}if(!_0x35e44c[_0xe641('0x9c')][_0xe641('0xd2')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x1f5a29=require(_0xe641('0xdc'))[_0xe641('0xdd')](path['join'](__dirname,_0xe641('0xe8')),[_0x35e44c['params']['id'],JSON[_0xe641('0xe9')](_0x35e44c['body']),JSON['stringify'](_0x3b6de0)]);_0x1f5a29['on'](_0xe641('0xea'),function(_0x21c8d5){_0x83bde2=!![];return _0x5aa5c5[_0xe641('0x1d')](0xc8)[_0xe641('0x1e')]({'message':_0xe641('0xeb'),'pid':_0x1f5a29[_0xe641('0xe0')]});});_0x1f5a29['on'](_0xe641('0xec'),function(_0x3d1296){if(_0x3d1296&&!_0x83bde2){return _0x5aa5c5[_0xe641('0x1d')](0x1f4)[_0xe641('0x1e')]({'message':_0xe641('0xed'),'pid':_0x1f5a29['pid']});}});})[_0xe641('0x93')](handleError(_0x5aa5c5,null));};exports[_0xe641('0xee')]=function(_0x996a21,_0x523b11){var _0x2e1ac2=[_0xe641('0xef'),_0xe641('0xf0'),'sms',_0xe641('0xf1'),_0xe641('0xf2'),_0xe641('0xf3'),'voice'];var _0x5eea12={'offset':0x0,'order':qs[_0xe641('0x41')](_0xe641('0xf4'))},_0x433113={'count':0x0,'rows':[]};Promise[_0xe641('0x7e')]()[_0xe641('0x27')](function(){if(_0x996a21[_0xe641('0x3a')][_0xe641('0xf5')]){if(!_['includes'](_0x2e1ac2,_0x996a21[_0xe641('0x3a')][_0xe641('0xf5')][_0xe641('0xf6')]())){throw new Error(_0xe641('0xf7'));}_0x2e1ac2=[_0x996a21['query'][_0xe641('0xf5')][_0xe641('0xf6')]()];}if(_0x996a21[_0xe641('0x3a')]['range']){try{var _0x826f40=JSON[_0xe641('0xe2')](_0x996a21[_0xe641('0x3a')]['range']);if(!moment(_0x826f40[_0xe641('0x47')])['isValid']()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x826f40['to'])[_0xe641('0xf8')]()){throw new Error(_0xe641('0xf9'));}}catch(_0x329399){throw new Error(_0xe641('0xfa'));}}if(!_0x996a21[_0xe641('0x3a')][_0xe641('0x61')]('nolimit')){_0x5eea12[_0xe641('0x22')]=qs['limit'](_0x996a21[_0xe641('0x3a')][_0xe641('0x22')]||0xa);_0x5eea12['offset']=qs['offset'](_0x996a21[_0xe641('0x3a')][_0xe641('0x1f')]);}var _0x10916e=_0x2e1ac2[_0xe641('0x55')](function(_0x1f65b8){if(_0x1f65b8==='voice'){var _0x434584={'attributes':['id',_0xe641('0xfb'),_0xe641('0x38'),_0xe641('0xfc'),_0xe641('0xfd'),_0xe641('0xfe'),_0xe641('0xff'),_0xe641('0x100'),_0xe641('0x101'),_0xe641('0x102'),'createdAt','userDisposition',_0xe641('0x103'),'userThirdDisposition',_0xe641('0x104')],'where':{'ContactId':_0x996a21[_0xe641('0x94')]['id']},'include':[{'model':db[_0xe641('0x59')],'as':'User','attributes':['id',_0xe641('0x2b'),_0xe641('0x105'),_0xe641('0x99')]}],'order':[[_0xe641('0x106'),_0xe641('0x7b')]]};if(_0x996a21[_0xe641('0x3a')][_0xe641('0x107')]){_0x434584[_0xe641('0x42')][_0xe641('0x106')]={'$gte':_0x826f40[_0xe641('0x47')],'$lte':_0x826f40['to']};}return db[_0xe641('0xb0')][_0xe641('0x108')](_0x434584)[_0xe641('0x27')](function(_0x3472a8){_0x433113[_0xe641('0x21')]+=_0x3472a8['count'];return _[_0xe641('0x55')](_0x3472a8[_0xe641('0x92')],function(_0x5e8e62){var _0x3d54ba=_0x5e8e62[_0xe641('0x9d')]({'plain':!![]});_0x3d54ba[_0xe641('0xf5')]=_0x1f65b8;if(_0x3d54ba[_0xe641('0x59')]){_0x3d54ba[_0xe641('0x59')]={'id':_0x3d54ba[_0xe641('0x59')]['id'],'name':_0x3d54ba[_0xe641('0x59')][_0xe641('0x2b')],'fullname':_0x3d54ba[_0xe641('0x59')][_0xe641('0x105')],'alias':_0x3d54ba[_0xe641('0x59')]['alias']};}return _0x3d54ba;});});}else{var _0x45f74d=_[_0xe641('0x109')](_0x1f65b8)+(_0x1f65b8===_0xe641('0xf0')?_0xe641('0x10a'):_0xe641('0x10b'));var _0x1d910f={'attributes':['id','closed',_0xe641('0x10c'),_0xe641('0x106'),_0xe641('0x102'),_0xe641('0x10d'),'secondDisposition',_0xe641('0x10e'),'UserId',_0x45f74d+'Id'],'where':{'ContactId':_0x996a21[_0xe641('0x94')]['id']},'include':[{'model':db[_0x45f74d],'as':'Account','attributes':['id',_0xe641('0x2b'),_0xe641('0x10f')]},{'model':db[_0xe641('0x59')],'as':_0xe641('0x110'),'attributes':['id','name','fullname']},{'model':db['Tag'],'as':_0xe641('0x91'),'attributes':['id',_0xe641('0x2b'),_0xe641('0x46')],'through':{'attributes':[]}}],'order':[['createdAt','DESC']]};if(_0x996a21[_0xe641('0x3a')][_0xe641('0x107')]){_0x1d910f[_0xe641('0x42')][_0xe641('0x106')]={'$gte':_0x826f40[_0xe641('0x47')],'$lte':_0x826f40['to']};}switch(_0x1f65b8){case _0xe641('0xf0'):_0x1d910f[_0xe641('0x3d')][_0xe641('0x64')](_0xe641('0x111'),_0xe641('0x112'),'customerPort','deviceModel','osName',_0xe641('0x113'),_0xe641('0x114'),_0xe641('0x115'),_0xe641('0x116'));break;case _0xe641('0xef'):_0x1d910f[_0xe641('0x3d')]['push'](_0xe641('0x117'),'substatus');break;case'openchannel':_0x1d910f[_0xe641('0x3d')]['push']('externalUrl','threadId');break;}return db[_['startCase'](_0x1f65b8)+_0xe641('0x118')]['findAndCountAll'](_0x1d910f)['then'](function(_0x5c546c){_0x433113[_0xe641('0x21')]+=_0x5c546c[_0xe641('0x21')];return _[_0xe641('0x55')](_0x5c546c[_0xe641('0x92')],function(_0x25786e){var _0x3d3bd4=_0x25786e[_0xe641('0x9d')]({'plain':!![]});_0x3d3bd4['channel']=_0x1f65b8;if(_0x3d3bd4[_0xe641('0x110')]){_0x3d3bd4[_0xe641('0x110')]={'id':_0x3d3bd4[_0xe641('0x110')]['id'],'name':_0x3d3bd4['Owner'][_0xe641('0x2b')],'fullname':_0x3d3bd4[_0xe641('0x110')][_0xe641('0x105')]};}return _0x3d3bd4;});});}});return Promise[_0xe641('0x36')](_0x10916e);})[_0xe641('0x27')](function(_0x2747be){return _(_0x2747be)[_0xe641('0x119')]()[_0xe641('0x11a')](_0xe641('0x106'))[_0xe641('0x11b')]()[_0xe641('0x53')]();})[_0xe641('0x27')](function(_0x36c4f3){_0x433113[_0xe641('0x92')]=_0x5eea12['limit']?_0x36c4f3[_0xe641('0x11c')](_0x5eea12[_0xe641('0x1f')],_0x5eea12[_0xe641('0x1f')]+_0x5eea12[_0xe641('0x22')]):_0x36c4f3;return _0x433113;})[_0xe641('0x27')](respondWithFilteredResult(_0x523b11,_0x5eea12))[_0xe641('0x93')](handleError(_0x523b11,null));};
\ No newline at end of file
+var _0xc202=['rows','catch','params','columnName','findAll','displayName','alias','values','body','get','mergeWith','tags','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','bulkCreate','each','duplicates','$or','findOrCreate','spread','error','show','color','$and','omit','cf_%d','pickBy','format','id\x20=\x20?','phone','getTags','findOne','rawAttributes','pick','options','setTags','ContactId','includeAll','include','getHopperHistories','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','server/files/tmp','file','chmodSync','0777','child_process','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','meta','import','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','getJourney','mail','chat','openchannel','fax','whatsapp','voice','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','source','destination','duration','note','userDisposition','UserId','fullname','createdAt','DESC','findAndCountAll','startCase','Website','closed','closedAt','disposition','secondDisposition','thirdDisposition','Account','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','referer','subject','substatus','externalUrl','threadId','Interaction','flatten','sortBy','slice','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./cmContact.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','name','send','index','CmContact','describe','keys','length','startsWith','CmCustomField','trimStart','all','cf_','fieldType','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','select','field','from','tools_tags','cm_contacts','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','expr','search','sqlOperator','conditions','find','Tag','split','map','union','User','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','text','value','start','Contact','isEmpty','forEach','ListId','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','having','t.id\x20IN\x20?','role','agent','user','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','sequelize','toString','keyBy','merge','c.firstName','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','TagIds','Tags','push'];(function(_0x49297d,_0x2b04c1){var _0x3e7dbd=function(_0x10a151){while(--_0x10a151){_0x49297d['push'](_0x49297d['shift']());}};_0x3e7dbd(++_0x2b04c1);}(_0xc202,0x95));var _0x2c20=function(_0x56c758,_0x540591){_0x56c758=_0x56c758-0x0;var _0x9bb0db=_0xc202[_0x56c758];return _0x9bb0db;};'use strict';var emlformat=require(_0x2c20('0x0'));var rimraf=require(_0x2c20('0x1'));var zipdir=require(_0x2c20('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2c20('0x3'));var moment=require(_0x2c20('0x4'));var BPromise=require(_0x2c20('0x5'));var Mustache=require(_0x2c20('0x6'));var util=require('util');var path=require(_0x2c20('0x7'));var sox=require('sox');var csv=require(_0x2c20('0x8'));var ejs=require(_0x2c20('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2c20('0xa'));var squel=require('squel');var crypto=require(_0x2c20('0xb'));var jsforce=require(_0x2c20('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2c20('0xd'));var Redis=require(_0x2c20('0xe'));var authService=require(_0x2c20('0xf'));var qs=require(_0x2c20('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2c20('0x11'));var logger=require('../../config/logger')(_0x2c20('0x12'));var utils=require(_0x2c20('0x13'));var config=require(_0x2c20('0x14'));var licenseUtil=require(_0x2c20('0x15'));var db=require(_0x2c20('0x16'))['db'];config['redis']=_[_0x2c20('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2c20('0x18'))(new Redis(config[_0x2c20('0x19')]));require(_0x2c20('0x1a'))[_0x2c20('0x1b')](socket);function respondWithStatusCode(_0xb3ae36,_0x4c3e50){_0x4c3e50=_0x4c3e50||0xcc;return function(_0x36a231){if(_0x36a231){return _0xb3ae36[_0x2c20('0x1c')](_0x4c3e50);}return _0xb3ae36[_0x2c20('0x1d')](_0x4c3e50)[_0x2c20('0x1e')]();};}function respondWithResult(_0x2e2429,_0xc67df3){_0xc67df3=_0xc67df3||0xc8;return function(_0x1fd186){if(_0x1fd186){return _0x2e2429[_0x2c20('0x1d')](_0xc67df3)['json'](_0x1fd186);}};}function respondWithFilteredResult(_0x362a88,_0x54495d){return function(_0x384198){if(_0x384198){var _0x3aaea2=typeof _0x54495d[_0x2c20('0x1f')]==='undefined'&&typeof _0x54495d['limit']===_0x2c20('0x20');var _0x4602ac=_0x384198['count'];var _0x2b886f=_0x3aaea2?0x0:_0x54495d[_0x2c20('0x1f')];var _0x4369e3=_0x3aaea2?_0x384198[_0x2c20('0x21')]:_0x54495d[_0x2c20('0x1f')]+_0x54495d[_0x2c20('0x22')];var _0x539a49;if(_0x4369e3>=_0x4602ac){_0x4369e3=_0x4602ac;_0x539a49=0xc8;}else{_0x539a49=0xce;}_0x362a88[_0x2c20('0x1d')](_0x539a49);return _0x362a88[_0x2c20('0x23')](_0x2c20('0x24'),_0x2b886f+'-'+_0x4369e3+'/'+_0x4602ac)[_0x2c20('0x25')](_0x384198);}return null;};}function patchUpdates(_0x580c4a){return function(_0x21c1db){try{jsonpatch[_0x2c20('0x26')](_0x21c1db,_0x580c4a,!![]);}catch(_0x517b5e){return BPromise[_0x2c20('0x27')](_0x517b5e);}return _0x21c1db[_0x2c20('0x28')]();};}function saveUpdates(_0x33b197,_0x12a198){return function(_0x3522b9){if(_0x3522b9){return _0x3522b9[_0x2c20('0x29')](_0x33b197)[_0x2c20('0x2a')](function(_0x26c500){return _0x26c500;});}return null;};}function removeEntity(_0x4e3d63,_0x322ef4){return function(_0x5c5590){if(_0x5c5590){return _0x5c5590[_0x2c20('0x2b')]()['then'](function(){_0x4e3d63['status'](0xcc)[_0x2c20('0x1e')]();});}};}function handleEntityNotFound(_0x566ba3,_0xfb0f95){return function(_0x9c5ab0){if(!_0x9c5ab0){_0x566ba3[_0x2c20('0x1c')](0x194);}return _0x9c5ab0;};}function handleError(_0x2d7e28,_0x297532){_0x297532=_0x297532||0x1f4;return function(_0x2cc8ae){logger['error'](_0x2cc8ae['stack']);if(_0x2cc8ae[_0x2c20('0x2c')]){delete _0x2cc8ae[_0x2c20('0x2c')];}_0x2d7e28[_0x2c20('0x1d')](_0x297532)[_0x2c20('0x2d')](_0x2cc8ae);};}exports[_0x2c20('0x2e')]=function(_0x31a26b,_0x46b65c){var _0x3d74a8={},_0x493f49={},_0x21b281={'count':0x0,'rows':[]};return db[_0x2c20('0x2f')][_0x2c20('0x30')]()[_0x2c20('0x2a')](function(_0x432011){var _0x3c457a=[];for(var _0x496e3c=0x0;_0x496e3c<Object[_0x2c20('0x31')](_0x432011)[_0x2c20('0x32')];_0x496e3c++){var _0x597892=Object[_0x2c20('0x31')](_0x432011)[_0x496e3c];if(_[_0x2c20('0x33')](_0x597892,'cf_')){_0x3c457a['push'](db[_0x2c20('0x34')]['findOne']({'where':{'id':_[_0x2c20('0x35')](_0x597892,'cf_')},'raw':!![]}));}}return BPromise[_0x2c20('0x36')](_0x3c457a)[_0x2c20('0x2a')](function(_0x355c27){for(var _0x28bd7f=0x0;_0x28bd7f<_0x355c27[_0x2c20('0x32')];_0x28bd7f++){if(_0x355c27[_0x28bd7f]){var _0x39bfdf=_0x2c20('0x37')+_0x355c27[_0x28bd7f]['id'];var _0x4d66c9=_0x432011[_0x39bfdf];_0x4d66c9[_0x2c20('0x38')]=_0x355c27[_0x28bd7f][_0x2c20('0x39')];}}return _0x432011;});})['then'](function(_0x339308){_0x493f49[_0x2c20('0x3a')]=_['keys'](_0x339308);_0x493f49[_0x2c20('0x3b')]=_['keys'](_0x31a26b[_0x2c20('0x3b')]);_0x493f49[_0x2c20('0x3c')]=_['intersection'](_0x493f49[_0x2c20('0x3a')],_0x493f49[_0x2c20('0x3b')]);_0x3d74a8[_0x2c20('0x3d')]=_[_0x2c20('0x3e')](_0x493f49[_0x2c20('0x3a')],qs[_0x2c20('0x3f')](_0x31a26b[_0x2c20('0x3b')]['fields']));_0x3d74a8[_0x2c20('0x3d')]=_0x3d74a8[_0x2c20('0x3d')]['length']?_0x3d74a8[_0x2c20('0x3d')]:_0x493f49[_0x2c20('0x3a')];if(!_0x31a26b[_0x2c20('0x3b')][_0x2c20('0x40')](_0x2c20('0x41'))){_0x3d74a8[_0x2c20('0x22')]=qs[_0x2c20('0x22')](_0x31a26b[_0x2c20('0x3b')][_0x2c20('0x22')]);_0x3d74a8[_0x2c20('0x1f')]=qs[_0x2c20('0x1f')](_0x31a26b[_0x2c20('0x3b')]['offset']);}_0x3d74a8[_0x2c20('0x42')]=qs[_0x2c20('0x43')](_0x31a26b[_0x2c20('0x3b')]['sort']);_0x3d74a8[_0x2c20('0x44')]=qs[_0x2c20('0x3c')](_['pick'](_0x31a26b[_0x2c20('0x3b')],_0x493f49[_0x2c20('0x3c')]),_0x339308);var _0x104549=[];var _0x3b0d31=squel[_0x2c20('0x45')]()[_0x2c20('0x46')]('id')[_0x2c20('0x46')](_0x2c20('0x2c'))[_0x2c20('0x46')]('color')[_0x2c20('0x47')](_0x2c20('0x48'));var _0x34bc6a=squel[_0x2c20('0x45')]()[_0x2c20('0x47')](_0x2c20('0x49'),'c')['left_join'](_0x2c20('0x4a'),'uc',_0x2c20('0x4b'))[_0x2c20('0x4c')](_0x2c20('0x4d'),'ct',_0x2c20('0x4e'))['left_join'](_0x2c20('0x48'),'t','t.id\x20=\x20ct.TagId')[_0x2c20('0x44')]('c.deletedAt\x20IS\x20NULL');var _0x52732e=squel[_0x2c20('0x4f')]();var _0x37c920=[];var _0x128e0f=squel[_0x2c20('0x4f')]();var _0x2f7e66;if(_0x31a26b['query'][_0x2c20('0x50')]){_0x2f7e66=as['parseSearch'](_0x31a26b[_0x2c20('0x3b')][_0x2c20('0x50')]);var _0x334e5d=_0x2f7e66[_0x2c20('0x51')];for(var _0x1f9690=0x0;_0x1f9690<_0x2f7e66[_0x2c20('0x52')][_0x2c20('0x32')];_0x1f9690++){var _0x260e62=_0x2f7e66[_0x2c20('0x52')][_0x1f9690];var _0x588fcd='c';var _0x321750=_(_0x339308)[_0x2c20('0x31')]()[_0x2c20('0x53')](function(_0x579540){return _0x579540===_0x260e62[_0x2c20('0x46')];});if(_0x321750)_0x321750=_0x339308[_0x260e62[_0x2c20('0x46')]];if(!_0x321750){if(_0x260e62[_0x2c20('0x46')]===_0x2c20('0x54')){var _0x3277a1=_0x260e62['value'][_0x2c20('0x55')](',')[_0x2c20('0x56')](function(_0x5c530e){return Number(_0x5c530e);});_0x3277a1['forEach'](function(_0x46d21d){_0x128e0f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x46d21d+',%');});_0x37c920=_[_0x2c20('0x57')](_0x37c920,_0x3277a1);}else if(_0x260e62[_0x2c20('0x46')]===_0x2c20('0x58')){_0x52732e['and'](_0x2c20('0x59'),_0x260e62['value']);}}else{if(_0x260e62[_0x2c20('0x46')]===_0x2c20('0x5a')||_0x321750[_0x2c20('0x38')]===_0x2c20('0x5b'))_0x260e62[_0x2c20('0x5c')]=_0x2c20('0x5d');var _0x1161cb=as[_0x2c20('0x5e')](_0x588fcd,_0x321750[_0x2c20('0x39')],_0x260e62);_0x52732e[_0x334e5d](_0x1161cb[_0x2c20('0x5f')],_0x1161cb[_0x2c20('0x60')][_0x2c20('0x61')],_0x1161cb[_0x2c20('0x60')][_0x2c20('0x1e')]);}}}else{var _0x2bfad3=_(Object['keys'](_0x31a26b[_0x2c20('0x3b')]))[_0x2c20('0x56')](function(_0x3f643b){return _0x339308[_0x2c20('0x40')](_0x3f643b)?_0x3f643b:undefined;})['filter'](function(_0x2a5401){return!_['isNil'](_0x2a5401);})[_0x2c20('0x60')]();if(_0x31a26b[_0x2c20('0x3b')]['Contact'])_0x2bfad3['push'](_0x2c20('0x62'));if(!_[_0x2c20('0x63')](_0x2bfad3)){_0x2bfad3[_0x2c20('0x64')](function(_0x5dc4ad){if(_0x5dc4ad===_0x2c20('0x65')){_0x34bc6a[_0x2c20('0x44')]('c.ListId\x20IN\x20?',[][_0x2c20('0x66')](_0x31a26b[_0x2c20('0x3b')][_0x5dc4ad]));}else if(_0x5dc4ad===_0x2c20('0x62')){var _0x593476='%'+_0x31a26b[_0x2c20('0x3b')][_0x5dc4ad]+'%';_0x34bc6a[_0x2c20('0x44')](_0x2c20('0x67'),_0x593476);}else{_0x34bc6a[_0x2c20('0x44')]('c.'+_0x5dc4ad+'\x20=\x20?',_0x31a26b[_0x2c20('0x3b')][_0x5dc4ad]);}});}if(_0x31a26b['query'][_0x2c20('0x68')]){_0x37c920=_[_0x2c20('0x69')](_0x31a26b[_0x2c20('0x3b')][_0x2c20('0x68')])?_0x31a26b[_0x2c20('0x3b')][_0x2c20('0x68')]:new Array(_0x31a26b[_0x2c20('0x3b')]['tag']);_0x37c920[_0x2c20('0x64')](function(_0x219469){_0x128e0f['or'](_0x2c20('0x6a'),'%,'+_0x219469+',%');});}if(_0x31a26b['query'][_0x2c20('0x6b')]){var _0x381f54=_0x31a26b[_0x2c20('0x3b')][_0x2c20('0x6b')][_0x2c20('0x6c')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x381f54[_0x2c20('0x55')]('\x20')[_0x2c20('0x32')]>0x1){_0x52732e['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x381f54),null);}else{if(qs['isNumeric'](_0x381f54)){_0x52732e['or'](_0x2c20('0x6d'),_0x381f54+'%');_0x52732e['or']('c.phone\x20LIKE\x20?',_0x381f54+'%');_0x52732e['or'](_0x2c20('0x6e'),_0x381f54+'%');_0x52732e['or'](_0x2c20('0x6f'),_0x381f54+'%');}else if(qs[_0x2c20('0x70')](_0x381f54)){_0x52732e['or'](_0x2c20('0x71'),_0x381f54+'%');}else{_0x52732e['or'](_0x2c20('0x72'),'%'+_0x381f54+'%');_0x52732e['or'](_0x2c20('0x73'),'%'+_0x381f54+'%');_0x52732e['or'](_0x2c20('0x71'),'%'+_0x381f54+'%');}}}}_0x34bc6a['where'](_0x52732e);_0x34bc6a[_0x2c20('0x74')](_0x2c20('0x75'));var _0x67ec9c={'type':db[_0x2c20('0x76')][_0x2c20('0x77')][_0x2c20('0x78')],'raw':!![]};var _0x58c793=_0x34bc6a[_0x2c20('0x79')]()['field'](_0x2c20('0x75'));if(_0x3d74a8[_0x2c20('0x42')]){_0x3d74a8['order'][_0x2c20('0x64')](function(_0x79d35c){_0x34bc6a['order']('c.'+_0x79d35c[0x0],_0x79d35c[0x1]==='DESC'?![]:!![]);});}if(!_[_0x2c20('0x63')](_0x37c920)){_0x34bc6a[_0x2c20('0x7a')](_0x128e0f);_0x58c793[_0x2c20('0x44')](_0x2c20('0x7b'),_0x37c920);}BPromise['resolve']()[_0x2c20('0x2a')](function(){if(!_0x2f7e66)return;if(_0x31a26b['user'][_0x2c20('0x7c')]!==_0x2c20('0x7d'))return;if(!_['some'](_0x2f7e66[_0x2c20('0x52')],[_0x2c20('0x46'),_0x2c20('0x58')])){return _0x31a26b[_0x2c20('0x7e')][_0x2c20('0x7f')]({'attributes':['id'],'raw':!![]})[_0x2c20('0x2a')](function(_0x396b8e){if(_[_0x2c20('0x63')](_0x396b8e)){_0x58c793[_0x2c20('0x44')](_0x2c20('0x80'));_0x34bc6a[_0x2c20('0x44')](_0x2c20('0x80'));}else{_0x58c793[_0x2c20('0x44')](_0x2c20('0x81'),_[_0x2c20('0x56')](_0x396b8e,'id'));_0x34bc6a['where'](_0x2c20('0x81'),_[_0x2c20('0x56')](_0x396b8e,'id'));}});}})['then'](function(){if(_0x31a26b[_0x2c20('0x7e')]['role']===_0x2c20('0x7d')&&!_0x2f7e66&&!_0x31a26b[_0x2c20('0x3b')]['ListId'])return[];return db[_0x2c20('0x82')][_0x2c20('0x3b')](_0x58c793[_0x2c20('0x83')](),_0x67ec9c);})[_0x2c20('0x2a')](function(_0xdde959){_0x21b281['count']=_0xdde959[_0x2c20('0x32')];if(_0x21b281[_0x2c20('0x21')]===0x0)return[];return db[_0x2c20('0x82')][_0x2c20('0x3b')](_0x3b0d31[_0x2c20('0x83')](),_0x67ec9c)[_0x2c20('0x2a')](function(_0xf3fe89){_0x104549=_[_0x2c20('0x84')](_0xf3fe89,'id');_0x67ec9c=_[_0x2c20('0x85')](_0x67ec9c,{'model':db[_0x2c20('0x2f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x31a26b['query'][_0x2c20('0x3f')]){_0x3d74a8[_0x2c20('0x3d')][_0x2c20('0x64')](function(_0x511662){_0x34bc6a['field']('c.'+_0x511662);});}else{_0x34bc6a[_0x2c20('0x46')](_0x2c20('0x75'));_0x34bc6a[_0x2c20('0x46')](_0x2c20('0x86'));_0x34bc6a[_0x2c20('0x46')]('c.lastName');_0x34bc6a[_0x2c20('0x46')]('c.phone');_0x34bc6a['field']('c.mobile');_0x34bc6a['field'](_0x2c20('0x87'));_0x34bc6a[_0x2c20('0x46')](_0x2c20('0x88'));_0x34bc6a['field'](_0x2c20('0x89'));_0x34bc6a[_0x2c20('0x46')](_0x2c20('0x8a'));_0x34bc6a['field'](_0x2c20('0x8b'));_0x34bc6a[_0x2c20('0x46')](_0x2c20('0x8c'));_0x34bc6a[_0x2c20('0x46')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x2c20('0x8d'));}if(_0x3d74a8[_0x2c20('0x22')])_0x34bc6a[_0x2c20('0x22')](_0x3d74a8[_0x2c20('0x22')]);if(_0x3d74a8['offset'])_0x34bc6a[_0x2c20('0x1f')](_0x3d74a8[_0x2c20('0x1f')]);return db[_0x2c20('0x82')][_0x2c20('0x3b')](_0x34bc6a[_0x2c20('0x83')](),_0x67ec9c);});})['then'](function(_0x40692b){_0x40692b[_0x2c20('0x64')](function(_0x57da91){if(_0x57da91['TagIds']){_0x57da91['Tags']=[];_0x57da91[_0x2c20('0x8d')][_0x2c20('0x55')](',')[_0x2c20('0x64')](function(_0x5b67e3){_0x57da91[_0x2c20('0x8e')][_0x2c20('0x8f')](_0x104549[_0x5b67e3]);});}delete _0x57da91[_0x2c20('0x8d')];});_0x21b281[_0x2c20('0x90')]=_0x40692b;return _0x21b281;})[_0x2c20('0x2a')](respondWithFilteredResult(_0x46b65c,_0x3d74a8));})[_0x2c20('0x91')](handleError(_0x46b65c,null));};exports[_0x2c20('0x2b')]=function(_0x74a09b,_0x59d7ad){return db[_0x2c20('0x2f')][_0x2c20('0x53')]({'where':{'id':_0x74a09b[_0x2c20('0x92')]['id']}})['then'](handleEntityNotFound(_0x59d7ad,null))[_0x2c20('0x2a')](removeEntity(_0x59d7ad,null))[_0x2c20('0x91')](handleError(_0x59d7ad,null));};exports[_0x2c20('0x30')]=function(_0x378589,_0x4244c0){return db[_0x2c20('0x2f')][_0x2c20('0x30')]()[_0x2c20('0x2a')](function(_0x47da03){delete _0x47da03['tags'];for(var _0x33cf67=0x0;_0x33cf67<Object[_0x2c20('0x31')](_0x47da03)[_0x2c20('0x32')];_0x33cf67++){var _0x45dba1=Object['keys'](_0x47da03)[_0x33cf67];if(!_[_0x2c20('0x33')](_0x45dba1,_0x2c20('0x37'))){_0x47da03[_0x45dba1][_0x2c20('0x93')]=_0x45dba1;_0x47da03[_0x45dba1]['displayName']=_0x45dba1;}}return _0x47da03;})[_0x2c20('0x2a')](function(_0x298ccf){var _0x2311e5={'where':{'$or':[{'ListId':_0x378589[_0x2c20('0x3b')]['id']},{'ListId':null}]},'raw':!![]};return db[_0x2c20('0x34')][_0x2c20('0x94')](_0x2311e5)[_0x2c20('0x2a')](function(_0x4670be){for(var _0x475ce0=0x0;_0x475ce0<_0x4670be[_0x2c20('0x32')];_0x475ce0++){var _0x59da4d=_0x2c20('0x37')+_0x4670be[_0x475ce0]['id'];_0x298ccf[_0x59da4d][_0x2c20('0x93')]=_0x59da4d;_0x298ccf[_0x59da4d][_0x2c20('0x95')]=_0x4670be[_0x475ce0][_0x2c20('0x96')];_0x298ccf[_0x59da4d]['custom']={'type':_0x4670be[_0x475ce0][_0x2c20('0x39')],'values':_0x4670be[_0x475ce0][_0x2c20('0x97')]};}Object[_0x2c20('0x31')](_0x298ccf)[_0x2c20('0x64')](function(_0x537507){if(!_0x298ccf[_0x537507][_0x2c20('0x40')]('columnName')){delete _0x298ccf[_0x537507];}});return _0x298ccf;});})['then'](respondWithResult(_0x4244c0,null))['catch'](handleError(_0x4244c0,null));};exports[_0x2c20('0x85')]=function(_0x39a43f,_0xc9ab52){var _0x2d5906;var _0x3afff1;var _0x6295d2;if(_0x39a43f[_0x2c20('0x98')]['id']){delete _0x39a43f[_0x2c20('0x98')]['id'];}return db[_0x2c20('0x2f')][_0x2c20('0x94')]({'where':{'id':[_0x39a43f[_0x2c20('0x98')]['to'],_0x39a43f[_0x2c20('0x98')][_0x2c20('0x47')]]}})['then'](function(_0xcd4402){if(_0xcd4402){if(_0xcd4402[_0x2c20('0x32')]!==0x2){return null;}_0xcd4402[0x0]=_0xcd4402[0x0]['get']({'plain':!![]});_0xcd4402[0x1]=_0xcd4402[0x1][_0x2c20('0x99')]({'plain':!![]});delete _0xcd4402[0x0]['id'];delete _0xcd4402[0x1]['id'];return _[_0x2c20('0x9a')](_0xcd4402[0x0],_0xcd4402[0x1],function(_0x32f505,_0x93c2bb){if(Array[_0x2c20('0x69')](_0x93c2bb)&&!_0x93c2bb[_0x2c20('0x32')]){return _0x32f505;}else if(!_0x93c2bb){return _0x32f505;}});}})['then'](handleEntityNotFound(_0xc9ab52,null))[_0x2c20('0x2a')](function(_0x1a3836){if(_0x1a3836){if(_0x1a3836[_0x2c20('0x9b')]&&_[_0x2c20('0x69')](_0x1a3836[_0x2c20('0x9b')])){_0x1a3836['tags']=_0x1a3836[_0x2c20('0x9b')][_0x2c20('0x9c')]();}logger['info'](_0x2c20('0x9d'),_0x39a43f[_0x2c20('0x98')]['to'],_0x39a43f[_0x2c20('0x98')][_0x2c20('0x47')]);return db[_0x2c20('0x9e')]['destroy']({'where':{'ContactId':[_0x39a43f[_0x2c20('0x98')]['to'],_0x39a43f[_0x2c20('0x98')][_0x2c20('0x47')]]}})['then'](function(_0x5541ff){logger[_0x2c20('0x9f')](_0x2c20('0xa0'),_0x5541ff);return db['CmHopperBlack'][_0x2c20('0x2b')]({'where':{'ContactId':[_0x39a43f[_0x2c20('0x98')]['to'],_0x39a43f[_0x2c20('0x98')]['from']]}})[_0x2c20('0x2a')](function(_0xa07450){logger['info'](_0x2c20('0xa1'),_0xa07450);return db[_0x2c20('0x2f')][_0x2c20('0xa2')](_0x1a3836);});});}})[_0x2c20('0x2a')](function(_0x395f9c){if(_0x395f9c){_0x2d5906=_0x395f9c;_0x3afff1={'ContactId':_0x2d5906['id']};_0x6295d2={'where':{'ContactId':[_0x39a43f[_0x2c20('0x98')]['to'],_0x39a43f[_0x2c20('0x98')][_0x2c20('0x47')]]}};return db[_0x2c20('0xa3')][_0x2c20('0x29')](_0x3afff1,_0x6295d2);}})[_0x2c20('0x2a')](function(){if(_0x2d5906){return db[_0x2c20('0xa4')][_0x2c20('0x29')](_0x3afff1,_0x6295d2);}})[_0x2c20('0x2a')](function(){if(_0x2d5906){return db['ChatOfflineMessage'][_0x2c20('0x29')](_0x3afff1,_0x6295d2);}})[_0x2c20('0x2a')](function(){if(_0x2d5906){return db[_0x2c20('0xa5')]['update'](_0x3afff1,_0x6295d2);}})[_0x2c20('0x2a')](function(){if(_0x2d5906){return db[_0x2c20('0xa6')][_0x2c20('0x29')](_0x3afff1,_0x6295d2);}})[_0x2c20('0x2a')](function(){if(_0x2d5906){return db[_0x2c20('0xa5')][_0x2c20('0x29')](_0x3afff1,_0x6295d2);}})['then'](function(){if(_0x2d5906){return db[_0x2c20('0xa6')][_0x2c20('0x29')](_0x3afff1,_0x6295d2);}})[_0x2c20('0x2a')](function(){if(_0x2d5906){return db[_0x2c20('0xa7')]['update'](_0x3afff1,_0x6295d2);}})[_0x2c20('0x2a')](function(){if(_0x2d5906){return db[_0x2c20('0xa8')]['update'](_0x3afff1,_0x6295d2);}})[_0x2c20('0x2a')](function(){if(_0x2d5906){return db[_0x2c20('0xa9')][_0x2c20('0x29')](_0x3afff1,_0x6295d2);}})[_0x2c20('0x2a')](function(){if(_0x2d5906){return db[_0x2c20('0xaa')][_0x2c20('0x29')](_0x3afff1,_0x6295d2);}})[_0x2c20('0x2a')](function(){if(_0x2d5906){return db['OpenchannelInteraction']['update'](_0x3afff1,_0x6295d2);}})[_0x2c20('0x2a')](function(){if(_0x2d5906){return db[_0x2c20('0xab')][_0x2c20('0x29')](_0x3afff1,_0x6295d2);}})[_0x2c20('0x2a')](function(){if(_0x2d5906){return db[_0x2c20('0xac')][_0x2c20('0x29')](_0x3afff1,_0x6295d2);}})['then'](function(){if(_0x2d5906){return db[_0x2c20('0xad')][_0x2c20('0x29')](_0x3afff1,_0x6295d2);}})[_0x2c20('0x2a')](function(){if(_0x2d5906){return db[_0x2c20('0xae')][_0x2c20('0x29')](_0x3afff1,_0x6295d2);}})['then'](function(){if(_0x2d5906){return db['VoiceCallReport']['update'](_0x3afff1,_0x6295d2);}})['then'](function(){if(_0x2d5906){return db[_0x2c20('0xaf')][_0x2c20('0x29')](_0x3afff1,_0x6295d2);}})[_0x2c20('0x2a')](function(){if(_0x2d5906){return db[_0x2c20('0xb0')]['update'](_0x3afff1,_0x6295d2);}})[_0x2c20('0x2a')](function(){if(_0x2d5906){return db[_0x2c20('0xb1')][_0x2c20('0x29')](_0x3afff1,_0x6295d2);}})[_0x2c20('0x2a')](function(){if(_0x2d5906){return db[_0x2c20('0xb2')][_0x2c20('0x29')](_0x3afff1,_0x6295d2);}})[_0x2c20('0x2a')](function(){if(_0x2d5906){return db[_0x2c20('0xb3')][_0x2c20('0x29')](_0x3afff1,_0x6295d2);}})[_0x2c20('0x2a')](function(){if(_0x2d5906){return db[_0x2c20('0xb4')][_0x2c20('0x29')](_0x3afff1,_0x6295d2);}})['then'](function(){if(_0x2d5906){return db[_0x2c20('0xb5')][_0x2c20('0x29')](_0x3afff1,_0x6295d2);}})['then'](function(){if(_0x2d5906){return db['WhatsappMessage'][_0x2c20('0x29')](_0x3afff1,_0x6295d2);}})[_0x2c20('0x2a')](function(){if(_0x2d5906){return db[_0x2c20('0xb6')][_0x2c20('0x29')](_0x3afff1,_0x6295d2);}})['then'](function(){if(_0x2d5906){return db['CmContact'][_0x2c20('0x2b')]({'where':{'id':[_0x39a43f[_0x2c20('0x98')]['to'],_0x39a43f['body'][_0x2c20('0x47')]]}});}})[_0x2c20('0x2a')](function(){if(_0x2d5906){return _0x2d5906;}})[_0x2c20('0x2a')](respondWithResult(_0xc9ab52,null))[_0x2c20('0x91')](handleError(_0xc9ab52,null));};exports[_0x2c20('0xa2')]=function(_0x329ff3,_0x139b0f){return db[_0x2c20('0x2f')]['describe']()[_0x2c20('0x2a')](function(_0x1e8285){if(_0x329ff3['body'][_0x2c20('0x9b')]&&_[_0x2c20('0x69')](_0x329ff3[_0x2c20('0x98')][_0x2c20('0x9b')])){if(_0x329ff3[_0x2c20('0x98')][_0x2c20('0x9b')][_0x2c20('0x32')]){_0x329ff3[_0x2c20('0x98')][_0x2c20('0x9b')]=_0x329ff3[_0x2c20('0x98')][_0x2c20('0x9b')][_0x2c20('0x9c')](';')+';';}else{_0x329ff3[_0x2c20('0x98')][_0x2c20('0x9b')]=null;}}else{_0x329ff3[_0x2c20('0x98')][_0x2c20('0x9b')]=null;}return db[_0x2c20('0x2f')][_0x2c20('0xa2')](_0x329ff3['body'],{'fields':_[_0x2c20('0x31')](_0x1e8285),'raw':!![]});})[_0x2c20('0x2a')](respondWithResult(_0x139b0f,0xc9))['catch'](handleError(_0x139b0f,null));};exports[_0x2c20('0xb7')]=function(_0x1ed639,_0x4a3a52){var _0x139e5a=[];var _0x232786=0x0;var _0x36108a=0x0;var _0x3729a2=0x0;return db[_0x2c20('0x2f')][_0x2c20('0x30')]()[_0x2c20('0x2a')](function(_0x30aa8a){return BPromise[_0x2c20('0xb8')](_0x1ed639[_0x2c20('0x98')],function(_0x25f38d){var _0x1103f8={'where':{'$or':[]},'defaults':_0x25f38d,'fields':_['keys'](_0x30aa8a),'raw':!![]};if(_0x25f38d[_0x2c20('0xb9')]){for(var _0x228b47=0x0;_0x228b47<_0x25f38d[_0x2c20('0xb9')]['length'];_0x228b47++){var _0x29e1c7={};_0x29e1c7[_0x25f38d['duplicates'][_0x228b47]]=_0x25f38d[_0x25f38d[_0x2c20('0xb9')][_0x228b47]];_0x1103f8[_0x2c20('0x44')][_0x2c20('0xba')]['push'](_0x29e1c7);}_0x1103f8['where'][_0x2c20('0x65')]=_0x25f38d[_0x2c20('0x65')];}return db[_0x2c20('0x2f')][_0x2c20('0xbb')](_0x1103f8)[_0x2c20('0xbc')](function(_0x49e9d5,_0x1029ad){if(_0x1029ad){_0x232786++;}else{_0x3729a2++;}})[_0x2c20('0x91')](function(_0x104405){console[_0x2c20('0xbd')](_0x104405);_0x36108a++;});});})[_0x2c20('0x2a')](function(_0x2c12f5){if(_0x2c12f5){return{'success':_0x232786,'failure':_0x36108a,'duplicates':_0x3729a2};}})[_0x2c20('0x2a')](respondWithResult(_0x4a3a52,0xc9))['catch'](handleError(_0x4a3a52,null));};exports[_0x2c20('0xbe')]=function(_0x55e5ba,_0x3f956f,_0x439d26){var _0x401810;return db['CmContact'][_0x2c20('0x30')]()[_0x2c20('0x2a')](function(_0x2e4a55){return db['CmContact'][_0x2c20('0x53')]({'where':{'id':_0x55e5ba[_0x2c20('0x92')]['id']},'include':[{'model':db[_0x2c20('0x54')],'as':_0x2c20('0x8e'),'attributes':['id',_0x2c20('0x2c'),_0x2c20('0xbf')],'required':_0x55e5ba[_0x2c20('0x3b')][_0x2c20('0x68')]?!![]:![]}],'attributes':_[_0x2c20('0x31')](_0x2e4a55)});})['then'](function(_0x487328){_0x401810=_0x487328['get']({'plain':!![]});var _0x38cea6={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x487328&&_0x487328['ListId']){if(_0x487328[_0x2c20('0x65')]){_0x38cea6['where'][_0x2c20('0xc0')]['push']({'ListId':{'$ne':_0x487328[_0x2c20('0x65')]}});}}return db[_0x2c20('0x34')][_0x2c20('0x94')](_0x38cea6);})[_0x2c20('0x2a')](function(_0x3a4900){return _[_0x2c20('0xc1')](_0x401810,_[_0x2c20('0x56')](_0x3a4900,function(_0x414473){return util['format'](_0x2c20('0xc2'),_0x414473['id']);}));})[_0x2c20('0x2a')](handleEntityNotFound(_0x3f956f,null))['then'](respondWithResult(_0x3f956f,null))[_0x2c20('0x91')](handleError(_0x3f956f,null));};exports[_0x2c20('0x29')]=function(_0xef0320,_0x17e3d4){var _0x34cadc;if(_0xef0320[_0x2c20('0x98')]['id']){delete _0xef0320[_0x2c20('0x98')]['id'];}return db[_0x2c20('0x2f')][_0x2c20('0x53')]({'where':{'id':_0xef0320['params']['id']}})['then'](handleEntityNotFound(_0x17e3d4,null))[_0x2c20('0x2a')](saveUpdates(_0xef0320[_0x2c20('0x98')],null))[_0x2c20('0x2a')](function(_0x4bd48e){_0x34cadc=_0x4bd48e;var _0x3b028b={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4bd48e&&_0x4bd48e[_0x2c20('0x65')]){if(_0x4bd48e[_0x2c20('0x65')]){_0x3b028b[_0x2c20('0x44')][_0x2c20('0xc0')][_0x2c20('0x8f')]({'ListId':{'$ne':_0x4bd48e[_0x2c20('0x65')]}});}}return db[_0x2c20('0x34')]['findAll'](_0x3b028b);})[_0x2c20('0x2a')](function(_0x2182e2){if(_0x2182e2){return _[_0x2c20('0xc1')](_[_0x2c20('0xc3')](_0xef0320['body'],function(_0x40cef6,_0x2cd550){return _[_0x2c20('0x33')](_0x2cd550,'cf_');}),_['map'](_0x2182e2,function(_0x3bce4d){return util[_0x2c20('0xc4')](_0x2c20('0xc2'),_0x3bce4d['id']);}));}})[_0x2c20('0x2a')](function(_0x4b265a){if(_0x4b265a&&!_[_0x2c20('0x63')](_0x4b265a)){var _0x4b8631=squel[_0x2c20('0x29')]()['table'](_0x2c20('0x49'))['setFields'](_0x4b265a)[_0x2c20('0x44')](_0x2c20('0xc5'),_0xef0320['params']['id'])['toParam']();return db[_0x2c20('0x82')][_0x2c20('0x3b')](_0x4b8631['text'],{'replacements':_0x4b8631[_0x2c20('0x97')]});}})[_0x2c20('0x2a')](function(){if(_0xef0320[_0x2c20('0x98')][_0x2c20('0xc6')]&&_0x34cadc){return db[_0x2c20('0x9e')][_0x2c20('0x29')]({'phone':_0xef0320[_0x2c20('0x98')][_0x2c20('0xc6')]},{'where':{'ContactId':_0x34cadc['id']}});}})[_0x2c20('0x2a')](function(){return _0x34cadc;})[_0x2c20('0x2a')](respondWithResult(_0x17e3d4,null))[_0x2c20('0x91')](handleError(_0x17e3d4,null));};exports[_0x2c20('0xc7')]=function(_0x4980e0,_0x5d7a1b,_0x1754ca){var _0x806a0f={};var _0x36ea80={};var _0x5683cc;var _0x1a693b;return db['CmContact'][_0x2c20('0xc8')]({'where':{'id':_0x4980e0[_0x2c20('0x92')]['id']}})[_0x2c20('0x2a')](handleEntityNotFound(_0x5d7a1b,null))[_0x2c20('0x2a')](function(_0x5d1212){if(_0x5d1212){_0x5683cc=_0x5d1212;_0x36ea80[_0x2c20('0x3a')]=_['keys'](db[_0x2c20('0x54')][_0x2c20('0xc9')]);_0x36ea80[_0x2c20('0x3b')]=_['keys'](_0x4980e0[_0x2c20('0x3b')]);_0x36ea80['filters']=_[_0x2c20('0x3e')](_0x36ea80[_0x2c20('0x3a')],_0x36ea80[_0x2c20('0x3b')]);_0x806a0f[_0x2c20('0x3d')]=_[_0x2c20('0x3e')](_0x36ea80[_0x2c20('0x3a')],qs[_0x2c20('0x3f')](_0x4980e0[_0x2c20('0x3b')][_0x2c20('0x3f')]));_0x806a0f[_0x2c20('0x3d')]=_0x806a0f[_0x2c20('0x3d')][_0x2c20('0x32')]?_0x806a0f[_0x2c20('0x3d')]:_0x36ea80[_0x2c20('0x3a')];_0x806a0f[_0x2c20('0x42')]=qs['sort'](_0x4980e0[_0x2c20('0x3b')][_0x2c20('0x43')]);_0x806a0f[_0x2c20('0x44')]=qs[_0x2c20('0x3c')](_[_0x2c20('0xca')](_0x4980e0['query'],_0x36ea80['filters']));if(_0x4980e0[_0x2c20('0x3b')]['filter']){_0x806a0f[_0x2c20('0x44')]=_[_0x2c20('0x85')](_0x806a0f[_0x2c20('0x44')],{'$or':_[_0x2c20('0x56')](_0x806a0f[_0x2c20('0x3d')],function(_0x2a8c53){var _0x47f7c4={};_0x47f7c4[_0x2a8c53]={'$like':'%'+_0x4980e0['query'][_0x2c20('0x6b')]+'%'};return _0x47f7c4;})});}_0x806a0f=_[_0x2c20('0x85')]({},_0x806a0f,_0x4980e0[_0x2c20('0xcb')]);return _0x5683cc[_0x2c20('0xc7')](_0x806a0f);}})[_0x2c20('0x2a')](function(_0x300b88){if(_0x300b88){_0x1a693b=_0x300b88[_0x2c20('0x32')];if(!_0x4980e0[_0x2c20('0x3b')][_0x2c20('0x40')](_0x2c20('0x41'))){_0x806a0f[_0x2c20('0x22')]=qs['limit'](_0x4980e0[_0x2c20('0x3b')][_0x2c20('0x22')]);_0x806a0f[_0x2c20('0x1f')]=qs[_0x2c20('0x1f')](_0x4980e0[_0x2c20('0x3b')][_0x2c20('0x1f')]);}return _0x5683cc[_0x2c20('0xc7')](_0x806a0f);}})['then'](function(_0x5acd55){if(_0x5acd55){return _0x5acd55?{'count':_0x1a693b,'rows':_0x5acd55}:null;}})[_0x2c20('0x2a')](respondWithResult(_0x5d7a1b,null))[_0x2c20('0x91')](handleError(_0x5d7a1b,null));};exports[_0x2c20('0xcc')]=function(_0x5069c6,_0x2eb0ea,_0x458b15){if(_0x5069c6[_0x2c20('0x98')]['id']){delete _0x5069c6['body']['id'];}return db[_0x2c20('0x2f')][_0x2c20('0xc8')]({'where':{'id':_0x5069c6[_0x2c20('0x92')]['id']}})['then'](handleEntityNotFound(_0x2eb0ea,null))['then'](function(_0x4d3581){if(_0x4d3581){return _0x4d3581[_0x2c20('0xcc')](_0x5069c6[_0x2c20('0x98')]['ids']||[]);}return null;})['then'](respondWithResult(_0x2eb0ea,null))['catch'](handleError(_0x2eb0ea,null));};exports['getHoppers']=function(_0x445a3d,_0x280596,_0x9859e6){var _0x530d69={'raw':![],'where':{}};var _0x1f8b54={};var _0x55c565={'count':0x0,'rows':[]};return db[_0x2c20('0x2f')][_0x2c20('0xc8')]({'where':{'id':_0x445a3d['params']['id']}})['then'](handleEntityNotFound(_0x280596,null))[_0x2c20('0x2a')](function(_0x299fbb){if(_0x299fbb){_0x1f8b54[_0x2c20('0x3a')]=_[_0x2c20('0x31')](db[_0x2c20('0x9e')][_0x2c20('0xc9')]);_0x1f8b54[_0x2c20('0x3b')]=_[_0x2c20('0x31')](_0x445a3d[_0x2c20('0x3b')]);_0x1f8b54[_0x2c20('0x3c')]=_[_0x2c20('0x3e')](_0x1f8b54[_0x2c20('0x3a')],_0x1f8b54[_0x2c20('0x3b')]);_0x530d69['attributes']=_['intersection'](_0x1f8b54['model'],qs[_0x2c20('0x3f')](_0x445a3d[_0x2c20('0x3b')][_0x2c20('0x3f')]));_0x530d69[_0x2c20('0x3d')]=_0x530d69[_0x2c20('0x3d')][_0x2c20('0x32')]?_0x530d69[_0x2c20('0x3d')]:_0x1f8b54[_0x2c20('0x3a')];if(!_0x445a3d[_0x2c20('0x3b')][_0x2c20('0x40')]('nolimit')){_0x530d69['limit']=qs['limit'](_0x445a3d[_0x2c20('0x3b')][_0x2c20('0x22')]);_0x530d69[_0x2c20('0x1f')]=qs['offset'](_0x445a3d[_0x2c20('0x3b')][_0x2c20('0x1f')]);}_0x530d69[_0x2c20('0x42')]=qs[_0x2c20('0x43')](_0x445a3d[_0x2c20('0x3b')]['sort']);_0x530d69['where']=qs[_0x2c20('0x3c')](_[_0x2c20('0xca')](_0x445a3d[_0x2c20('0x3b')],_0x1f8b54[_0x2c20('0x3c')]));_0x530d69[_0x2c20('0x44')][_0x2c20('0xcd')]=_0x299fbb['id'];if(_0x445a3d['query'][_0x2c20('0x6b')]){_0x530d69[_0x2c20('0x44')]=_[_0x2c20('0x85')](_0x530d69[_0x2c20('0x44')],{'$or':_[_0x2c20('0x56')](_0x530d69[_0x2c20('0x3d')],function(_0x369a67){var _0x8dee6c={};_0x8dee6c[_0x369a67]={'$like':'%'+_0x445a3d[_0x2c20('0x3b')][_0x2c20('0x6b')]+'%'};return _0x8dee6c;})});}_0x530d69=_[_0x2c20('0x85')]({},_0x530d69,_0x445a3d['options']);return db[_0x2c20('0x9e')][_0x2c20('0x21')]({'where':_0x530d69['where']})[_0x2c20('0x2a')](function(_0x53bc64){_0x55c565[_0x2c20('0x21')]=_0x53bc64;if(_0x445a3d['query'][_0x2c20('0xce')]){_0x530d69[_0x2c20('0xcf')]=[{'all':!![]}];}return db[_0x2c20('0x9e')][_0x2c20('0x94')](_0x530d69);})[_0x2c20('0x2a')](function(_0x2288ef){_0x55c565[_0x2c20('0x90')]=_0x2288ef;return _0x55c565;});}})[_0x2c20('0x2a')](respondWithFilteredResult(_0x280596,_0x530d69))[_0x2c20('0x91')](handleError(_0x280596,null));};exports[_0x2c20('0xd0')]=function(_0x433b12,_0x557688,_0x492af4){var _0x1dffc0={'raw':!![],'where':{}};var _0x58110d={};var _0x1e0934={'count':0x0,'rows':[]};return db[_0x2c20('0x2f')][_0x2c20('0xc8')]({'where':{'id':_0x433b12[_0x2c20('0x92')]['id']}})[_0x2c20('0x2a')](handleEntityNotFound(_0x557688,null))[_0x2c20('0x2a')](function(_0x591f7b){if(_0x591f7b){_0x58110d['model']=_[_0x2c20('0x31')](db[_0x2c20('0xad')][_0x2c20('0xc9')]);_0x58110d[_0x2c20('0x3b')]=_[_0x2c20('0x31')](_0x433b12['query']);_0x58110d[_0x2c20('0x3c')]=_[_0x2c20('0x3e')](_0x58110d[_0x2c20('0x3a')],_0x58110d[_0x2c20('0x3b')]);_0x1dffc0['attributes']=_[_0x2c20('0x3e')](_0x58110d[_0x2c20('0x3a')],qs[_0x2c20('0x3f')](_0x433b12['query'][_0x2c20('0x3f')]));_0x1dffc0['attributes']=_0x1dffc0[_0x2c20('0x3d')][_0x2c20('0x32')]?_0x1dffc0[_0x2c20('0x3d')]:_0x58110d[_0x2c20('0x3a')];if(!_0x433b12[_0x2c20('0x3b')][_0x2c20('0x40')]('nolimit')){_0x1dffc0[_0x2c20('0x22')]=qs[_0x2c20('0x22')](_0x433b12[_0x2c20('0x3b')]['limit']);_0x1dffc0[_0x2c20('0x1f')]=qs[_0x2c20('0x1f')](_0x433b12[_0x2c20('0x3b')]['offset']);}_0x1dffc0[_0x2c20('0x42')]=qs[_0x2c20('0x43')](_0x433b12[_0x2c20('0x3b')][_0x2c20('0x43')]);_0x1dffc0['where']=qs['filters'](_[_0x2c20('0xca')](_0x433b12[_0x2c20('0x3b')],_0x58110d[_0x2c20('0x3c')]));_0x1dffc0[_0x2c20('0x44')][_0x2c20('0xcd')]=_0x591f7b['id'];if(_0x433b12[_0x2c20('0x3b')][_0x2c20('0x6b')]){_0x1dffc0['where']=_[_0x2c20('0x85')](_0x1dffc0[_0x2c20('0x44')],{'$or':_[_0x2c20('0x56')](_0x1dffc0[_0x2c20('0x3d')],function(_0x1ee898){var _0x46b936={};_0x46b936[_0x1ee898]={'$like':'%'+_0x433b12['query'][_0x2c20('0x6b')]+'%'};return _0x46b936;})});}_0x1dffc0=_[_0x2c20('0x85')]({},_0x1dffc0,_0x433b12['options']);return db[_0x2c20('0xad')][_0x2c20('0x21')]({'where':_0x1dffc0[_0x2c20('0x44')]})['then'](function(_0x422de3){_0x1e0934['count']=_0x422de3;if(_0x433b12['query'][_0x2c20('0xce')]){_0x1dffc0[_0x2c20('0xcf')]=[{'all':!![]}];}return db[_0x2c20('0xad')][_0x2c20('0x94')](_0x1dffc0);})[_0x2c20('0x2a')](function(_0x21cd2d){_0x1e0934[_0x2c20('0x90')]=_0x21cd2d;return _0x1e0934;});}})[_0x2c20('0x2a')](respondWithFilteredResult(_0x557688,_0x1dffc0))[_0x2c20('0x91')](handleError(_0x557688,null));};exports[_0x2c20('0xd1')]=function(_0xcf596d,_0x3b7615,_0x327c9e){var _0x425e02={'raw':!![],'where':{}};var _0xf44a73={};var _0x264d2f={'count':0x0,'rows':[]};return db[_0x2c20('0x2f')][_0x2c20('0xc8')]({'where':{'id':_0xcf596d[_0x2c20('0x92')]['id']}})[_0x2c20('0x2a')](handleEntityNotFound(_0x3b7615,null))[_0x2c20('0x2a')](function(_0x3ca94c){if(_0x3ca94c){_0xf44a73['model']=_[_0x2c20('0x31')](db[_0x2c20('0xac')][_0x2c20('0xc9')]);_0xf44a73['query']=_[_0x2c20('0x31')](_0xcf596d[_0x2c20('0x3b')]);_0xf44a73[_0x2c20('0x3c')]=_['intersection'](_0xf44a73[_0x2c20('0x3a')],_0xf44a73[_0x2c20('0x3b')]);_0x425e02[_0x2c20('0x3d')]=_['intersection'](_0xf44a73[_0x2c20('0x3a')],qs['fields'](_0xcf596d[_0x2c20('0x3b')][_0x2c20('0x3f')]));_0x425e02[_0x2c20('0x3d')]=_0x425e02[_0x2c20('0x3d')]['length']?_0x425e02['attributes']:_0xf44a73[_0x2c20('0x3a')];if(!_0xcf596d[_0x2c20('0x3b')]['hasOwnProperty']('nolimit')){_0x425e02[_0x2c20('0x22')]=qs[_0x2c20('0x22')](_0xcf596d[_0x2c20('0x3b')][_0x2c20('0x22')]);_0x425e02[_0x2c20('0x1f')]=qs[_0x2c20('0x1f')](_0xcf596d[_0x2c20('0x3b')][_0x2c20('0x1f')]);}_0x425e02[_0x2c20('0x42')]=qs[_0x2c20('0x43')](_0xcf596d[_0x2c20('0x3b')][_0x2c20('0x43')]);_0x425e02[_0x2c20('0x44')]=qs[_0x2c20('0x3c')](_[_0x2c20('0xca')](_0xcf596d[_0x2c20('0x3b')],_0xf44a73[_0x2c20('0x3c')]));_0x425e02['where']['ContactId']=_0x3ca94c['id'];if(_0xcf596d[_0x2c20('0x3b')][_0x2c20('0x6b')]){_0x425e02[_0x2c20('0x44')]=_[_0x2c20('0x85')](_0x425e02['where'],{'$or':_[_0x2c20('0x56')](_0x425e02[_0x2c20('0x3d')],function(_0x1f5595){var _0x4029fc={};_0x4029fc[_0x1f5595]={'$like':'%'+_0xcf596d['query'][_0x2c20('0x6b')]+'%'};return _0x4029fc;})});}_0x425e02=_[_0x2c20('0x85')]({},_0x425e02,_0xcf596d[_0x2c20('0xcb')]);return db['CmHopperFinal']['count']({'where':_0x425e02['where']})[_0x2c20('0x2a')](function(_0x34b793){_0x264d2f['count']=_0x34b793;if(_0xcf596d[_0x2c20('0x3b')]['includeAll']){_0x425e02[_0x2c20('0xcf')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x2c20('0x94')](_0x425e02);})[_0x2c20('0x2a')](function(_0x177449){_0x264d2f[_0x2c20('0x90')]=_0x177449;return _0x264d2f;});}})[_0x2c20('0x2a')](respondWithFilteredResult(_0x3b7615,_0x425e02))[_0x2c20('0x91')](handleError(_0x3b7615,null));};exports[_0x2c20('0xd2')]=function(_0x41bae5,_0x162b4b,_0x3e5477){var _0x111fc0={'raw':!![],'where':{}};var _0x36f393={};var _0x11bcc2={'count':0x0,'rows':[]};return db[_0x2c20('0x2f')]['findOne']({'where':{'id':_0x41bae5[_0x2c20('0x92')]['id']}})[_0x2c20('0x2a')](handleEntityNotFound(_0x162b4b,null))['then'](function(_0x5b4142){if(_0x5b4142){_0x36f393['model']=_['keys'](db['JscriptySessionReport'][_0x2c20('0xc9')]);_0x36f393[_0x2c20('0x3b')]=_[_0x2c20('0x31')](_0x41bae5[_0x2c20('0x3b')]);_0x36f393[_0x2c20('0x3c')]=_[_0x2c20('0x3e')](_0x36f393[_0x2c20('0x3a')],_0x36f393[_0x2c20('0x3b')]);_0x111fc0[_0x2c20('0x3d')]=_[_0x2c20('0x3e')](_0x36f393[_0x2c20('0x3a')],qs[_0x2c20('0x3f')](_0x41bae5[_0x2c20('0x3b')][_0x2c20('0x3f')]));_0x111fc0['attributes']=_0x111fc0['attributes'][_0x2c20('0x32')]?_0x111fc0['attributes']:_0x36f393[_0x2c20('0x3a')];if(!_0x41bae5[_0x2c20('0x3b')][_0x2c20('0x40')](_0x2c20('0x41'))){_0x111fc0[_0x2c20('0x22')]=qs['limit'](_0x41bae5[_0x2c20('0x3b')]['limit']);_0x111fc0[_0x2c20('0x1f')]=qs['offset'](_0x41bae5[_0x2c20('0x3b')][_0x2c20('0x1f')]);}_0x111fc0[_0x2c20('0x42')]=qs[_0x2c20('0x43')](_0x41bae5[_0x2c20('0x3b')]['sort']);_0x111fc0['where']=qs[_0x2c20('0x3c')](_[_0x2c20('0xca')](_0x41bae5['query'],_0x36f393['filters']));_0x111fc0[_0x2c20('0x44')][_0x2c20('0xcd')]=_0x5b4142['id'];if(_0x41bae5[_0x2c20('0x3b')][_0x2c20('0x6b')]){_0x111fc0[_0x2c20('0x44')]=_[_0x2c20('0x85')](_0x111fc0[_0x2c20('0x44')],{'$or':_[_0x2c20('0x56')](_0x111fc0[_0x2c20('0x3d')],function(_0x5b6149){var _0x40361d={};_0x40361d[_0x5b6149]={'$like':'%'+_0x41bae5[_0x2c20('0x3b')][_0x2c20('0x6b')]+'%'};return _0x40361d;})});}_0x111fc0=_['merge']({},_0x111fc0,_0x41bae5['options']);return db[_0x2c20('0xb4')]['count']({'where':_0x111fc0['where']})[_0x2c20('0x2a')](function(_0x4c8524){_0x11bcc2[_0x2c20('0x21')]=_0x4c8524;if(_0x41bae5[_0x2c20('0x3b')][_0x2c20('0xce')]){_0x111fc0[_0x2c20('0xcf')]=[{'all':!![]}];}return db[_0x2c20('0xb4')][_0x2c20('0x94')](_0x111fc0);})['then'](function(_0x51b125){_0x11bcc2[_0x2c20('0x90')]=_0x51b125;return _0x11bcc2;});}})[_0x2c20('0x2a')](respondWithFilteredResult(_0x162b4b,_0x111fc0))[_0x2c20('0x91')](handleError(_0x162b4b,null));};exports[_0x2c20('0xd3')]=function(_0x4e9955,_0x48ad14,_0x37763b){try{if(!_0x4e9955[_0x2c20('0x98')][_0x2c20('0x65')]){throw new Error(_0x2c20('0xd4'));}if(!_0x4e9955['body'][_0x2c20('0xd5')]){throw new Error('No\x20association\x20keys\x20specified!');}if(!_0x4e9955['body'][_0x2c20('0xd6')]){throw new Error(_0x2c20('0xd7'));}if(!_0x4e9955[_0x2c20('0x98')][_0x2c20('0xd8')]){throw new Error(_0x2c20('0xd9'));}var _0xed72b4=_0x4e9955[_0x2c20('0x98')][_0x2c20('0xd5')][_0x2c20('0x55')](',');var _0x125f35=_0x4e9955[_0x2c20('0x98')][_0x2c20('0xd6')][_0x2c20('0x55')](',');if(!_0xed72b4[_0x2c20('0x32')]||!_0x125f35['length']||_0xed72b4[_0x2c20('0x32')]!==_0x125f35[_0x2c20('0x32')]){throw new Error(_0x2c20('0xda'));}_0x4e9955[_0x2c20('0x98')][_0x2c20('0x3f')]=_[_0x2c20('0xdb')](_0xed72b4,_0x125f35);if(!_0x4e9955[_0x2c20('0x98')][_0x2c20('0x3f')]['phone']){throw new Error(_0x2c20('0xdc'));}if(!_0x4e9955['body'][_0x2c20('0x3f')][_0x2c20('0xdd')]){throw new Error(_0x2c20('0xde'));}var _0x3fe6aa=path['join'](config['root'],_0x2c20('0xdf'),_0x4e9955[_0x2c20('0xe0')]['filename']);fs[_0x2c20('0xe1')](_0x3fe6aa,parseInt(_0x2c20('0xe2'),0x8));var _0x1b6bce=require(_0x2c20('0xe3'))['fork'](path[_0x2c20('0x9c')](__dirname,_0x2c20('0xe4')),[_0x3fe6aa,_0x4e9955['body']['binding_keys'],_0x4e9955[_0x2c20('0x98')][_0x2c20('0xd6')],_0x4e9955[_0x2c20('0x98')][_0x2c20('0x65')],_0x4e9955['body'][_0x2c20('0xe5')],_0x4e9955[_0x2c20('0x98')][_0x2c20('0xb9')],_0x4e9955[_0x2c20('0x98')][_0x2c20('0xd8')]]);return _0x48ad14[_0x2c20('0x1d')](0xc8)[_0x2c20('0x25')]({'message':_0x2c20('0xe6'),'pid':_0x1b6bce[_0x2c20('0xe7')]});}catch(_0x5d07cc){return _0x48ad14[_0x2c20('0x1d')](0x1f4)[_0x2c20('0x2d')](_0x5d07cc);}};exports['upload']=function(_0x67ccf8,_0x27c176,_0x256921){var _0x1ef61e=fs['createReadStream'](_0x67ccf8[_0x2c20('0xe0')][_0x2c20('0x7')]);Papa['parse'](_0x1ef61e,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0xa0b518){return _0x27c176[_0x2c20('0x1d')](0xc8)['json']({'file':_0x67ccf8[_0x2c20('0xe0')],'fields':_0xa0b518[_0x2c20('0xe8')][_0x2c20('0x3f')]});}});};exports[_0x2c20('0xe9')]=function(_0x6faf2b,_0x312bc0,_0x10c439){return db[_0x2c20('0x58')][_0x2c20('0x94')]({'raw':!![],'attributes':['id'],'where':{'role':'agent'}})[_0x2c20('0x2a')](function(_0x145913){var _0x9bcddd=![];if(!_0x6faf2b[_0x2c20('0x98')][_0x2c20('0x65')]){throw new Error('No\x20ListId\x20specified');}if(!_0x6faf2b['body'][_0x2c20('0xea')]['phone']){throw new Error(_0x2c20('0xdc'));}if(!_0x6faf2b[_0x2c20('0x98')]['binding'][_0x2c20('0xdd')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x6faf2b[_0x2c20('0x98')][_0x2c20('0xd8')]){throw new Error(_0x2c20('0xd9'));}var _0x1c152d=require(_0x2c20('0xe3'))['fork'](path[_0x2c20('0x9c')](__dirname,_0x2c20('0xeb')),[_0x6faf2b[_0x2c20('0x92')]['id'],JSON[_0x2c20('0xec')](_0x6faf2b['body']),JSON[_0x2c20('0xec')](_0x145913)]);_0x1c152d['on'](_0x2c20('0xed'),function(_0x15dd26){_0x9bcddd=!![];return _0x312bc0[_0x2c20('0x1d')](0xc8)[_0x2c20('0x25')]({'message':_0x2c20('0xee'),'pid':_0x1c152d[_0x2c20('0xe7')]});});_0x1c152d['on'](_0x2c20('0xef'),function(_0x530a76){if(_0x530a76&&!_0x9bcddd){return _0x312bc0[_0x2c20('0x1d')](0x1f4)[_0x2c20('0x25')]({'message':'error\x20child\x20process','pid':_0x1c152d['pid']});}});})[_0x2c20('0x91')](handleError(_0x312bc0,null));};exports[_0x2c20('0xf0')]=function(_0x3196ea,_0x2e3909){var _0x5c9e2b=[_0x2c20('0xf1'),_0x2c20('0xf2'),'sms',_0x2c20('0xf3'),_0x2c20('0xf4'),_0x2c20('0xf5'),_0x2c20('0xf6')];var _0x5d2a43={'offset':0x0,'order':qs[_0x2c20('0x43')]('-createdAt')},_0x1e2ff0={'count':0x0,'rows':[]};Promise[_0x2c20('0xf7')]()[_0x2c20('0x2a')](function(){if(_0x3196ea[_0x2c20('0x3b')][_0x2c20('0xf8')]){if(!_[_0x2c20('0xf9')](_0x5c9e2b,_0x3196ea[_0x2c20('0x3b')]['channel'][_0x2c20('0xfa')]())){throw new Error(_0x2c20('0xfb'));}_0x5c9e2b=[_0x3196ea[_0x2c20('0x3b')][_0x2c20('0xf8')][_0x2c20('0xfa')]()];}if(_0x3196ea[_0x2c20('0x3b')]['range']){try{var _0x152f78=JSON['parse'](_0x3196ea[_0x2c20('0x3b')][_0x2c20('0xfc')]);if(!moment(_0x152f78[_0x2c20('0x47')])[_0x2c20('0xfd')]()){throw new Error(_0x2c20('0xfe'));}if(!moment(_0x152f78['to'])[_0x2c20('0xfd')]()){throw new Error(_0x2c20('0xff'));}}catch(_0x16198e){throw new Error('Invalid\x20createdAt\x20filter');}}if(!_0x3196ea['query'][_0x2c20('0x40')](_0x2c20('0x41'))){_0x5d2a43[_0x2c20('0x22')]=qs[_0x2c20('0x22')](_0x3196ea[_0x2c20('0x3b')]['limit']||0xa);_0x5d2a43[_0x2c20('0x1f')]=qs[_0x2c20('0x1f')](_0x3196ea[_0x2c20('0x3b')][_0x2c20('0x1f')]);}var _0x90f0e6=_0x5c9e2b[_0x2c20('0x56')](function(_0x305b76){if(_0x305b76===_0x2c20('0xf6')){var _0x325d6c={'attributes':['id',_0x2c20('0x100'),_0x2c20('0x39'),_0x2c20('0x101'),_0x2c20('0x102'),'callerid','starttime','endtime',_0x2c20('0x103'),_0x2c20('0x104'),'createdAt',_0x2c20('0x105'),'userSecondDisposition','userThirdDisposition',_0x2c20('0x106')],'where':{'ContactId':_0x3196ea[_0x2c20('0x92')]['id']},'include':[{'model':db[_0x2c20('0x58')],'as':_0x2c20('0x58'),'attributes':['id',_0x2c20('0x2c'),_0x2c20('0x107'),'alias']}],'order':[[_0x2c20('0x108'),_0x2c20('0x109')]]};if(_0x3196ea[_0x2c20('0x3b')][_0x2c20('0xfc')]){_0x325d6c[_0x2c20('0x44')]['createdAt']={'$gte':_0x152f78[_0x2c20('0x47')],'$lte':_0x152f78['to']};}return db['VoiceCallReport'][_0x2c20('0x10a')](_0x325d6c)[_0x2c20('0x2a')](function(_0x1cc212){_0x1e2ff0[_0x2c20('0x21')]+=_0x1cc212[_0x2c20('0x21')];return _[_0x2c20('0x56')](_0x1cc212[_0x2c20('0x90')],function(_0x14fbb3){var _0x3e7696=_0x14fbb3[_0x2c20('0x99')]({'plain':!![]});_0x3e7696['channel']=_0x305b76;if(_0x3e7696['User']){_0x3e7696['User']={'id':_0x3e7696[_0x2c20('0x58')]['id'],'name':_0x3e7696[_0x2c20('0x58')][_0x2c20('0x2c')],'fullname':_0x3e7696[_0x2c20('0x58')][_0x2c20('0x107')],'alias':_0x3e7696[_0x2c20('0x58')][_0x2c20('0x96')]};}return _0x3e7696;});});}else{var _0x2b536e=_[_0x2c20('0x10b')](_0x305b76)+(_0x305b76===_0x2c20('0xf2')?_0x2c20('0x10c'):'Account');var _0x834a1b={'attributes':['id',_0x2c20('0x10d'),_0x2c20('0x10e'),_0x2c20('0x108'),_0x2c20('0x104'),_0x2c20('0x10f'),_0x2c20('0x110'),_0x2c20('0x111'),_0x2c20('0x106'),_0x2b536e+'Id'],'where':{'ContactId':_0x3196ea['params']['id']},'include':[{'model':db[_0x2b536e],'as':_0x2c20('0x112'),'attributes':['id',_0x2c20('0x2c'),_0x2c20('0x113')]},{'model':db['User'],'as':_0x2c20('0x114'),'attributes':['id',_0x2c20('0x2c'),_0x2c20('0x107')]},{'model':db[_0x2c20('0x54')],'as':_0x2c20('0x8e'),'attributes':['id',_0x2c20('0x2c'),_0x2c20('0xbf')],'through':{'attributes':[]}}],'order':[[_0x2c20('0x108'),_0x2c20('0x109')]]};if(_0x3196ea[_0x2c20('0x3b')][_0x2c20('0xfc')]){_0x834a1b[_0x2c20('0x44')][_0x2c20('0x108')]={'$gte':_0x152f78[_0x2c20('0x47')],'$lte':_0x152f78['to']};}switch(_0x305b76){case _0x2c20('0xf2'):_0x834a1b[_0x2c20('0x3d')][_0x2c20('0x8f')](_0x2c20('0x115'),_0x2c20('0x116'),_0x2c20('0x117'),_0x2c20('0x118'),_0x2c20('0x119'),_0x2c20('0x11a'),_0x2c20('0x11b'),'ratingValue',_0x2c20('0x11c'));break;case _0x2c20('0xf1'):_0x834a1b[_0x2c20('0x3d')][_0x2c20('0x8f')](_0x2c20('0x11d'),_0x2c20('0x11e'));break;case _0x2c20('0xf3'):_0x834a1b[_0x2c20('0x3d')]['push'](_0x2c20('0x11f'),_0x2c20('0x120'));break;}return db[_[_0x2c20('0x10b')](_0x305b76)+_0x2c20('0x121')]['findAndCountAll'](_0x834a1b)[_0x2c20('0x2a')](function(_0x4769d7){_0x1e2ff0['count']+=_0x4769d7['count'];return _[_0x2c20('0x56')](_0x4769d7[_0x2c20('0x90')],function(_0x218f4c){var _0x385a88=_0x218f4c[_0x2c20('0x99')]({'plain':!![]});_0x385a88[_0x2c20('0xf8')]=_0x305b76;if(_0x385a88[_0x2c20('0x114')]){_0x385a88[_0x2c20('0x114')]={'id':_0x385a88[_0x2c20('0x114')]['id'],'name':_0x385a88[_0x2c20('0x114')][_0x2c20('0x2c')],'fullname':_0x385a88[_0x2c20('0x114')][_0x2c20('0x107')]};}return _0x385a88;});});}});return Promise['all'](_0x90f0e6);})[_0x2c20('0x2a')](function(_0x3b49de){return _(_0x3b49de)[_0x2c20('0x122')]()[_0x2c20('0x123')](_0x2c20('0x108'))['reverse']()[_0x2c20('0x60')]();})['then'](function(_0x564f8d){_0x1e2ff0[_0x2c20('0x90')]=_0x5d2a43[_0x2c20('0x22')]?_0x564f8d[_0x2c20('0x124')](_0x5d2a43[_0x2c20('0x1f')],_0x5d2a43['offset']+_0x5d2a43[_0x2c20('0x22')]):_0x564f8d;return _0x1e2ff0;})[_0x2c20('0x2a')](respondWithFilteredResult(_0x2e3909,_0x5d2a43))[_0x2c20('0x91')](handleError(_0x2e3909,null));};
\ No newline at end of file
index 072b526..6b3cb52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7777=['hook','events','../../mysqldb','CmContact','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x435953,_0x7cf017){var _0x342bb5=function(_0x16a3e3){while(--_0x16a3e3){_0x435953['push'](_0x435953['shift']());}};_0x342bb5(++_0x7cf017);}(_0x7777,0x76));var _0x7777=function(_0x442214,_0x3a869f){_0x442214=_0x442214-0x0;var _0x2bddf9=_0x7777[_0x442214];return _0x2bddf9;};'use strict';var EventEmitter=require(_0x7777('0x0'));var CmContact=require(_0x7777('0x1'))['db'][_0x7777('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x7777('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7777('0x4'),'afterDestroy':_0x7777('0x5')};function emitEvent(_0x1f37a7){return function(_0x46527d,_0x3e3bbf,_0x1fe947){CmContactEvents['emit'](_0x1f37a7+':'+_0x46527d['id'],_0x46527d);CmContactEvents[_0x7777('0x6')](_0x1f37a7,_0x46527d);_0x1fe947(null);};}for(var e in events){if(events[_0x7777('0x7')](e)){var event=events[e];CmContact[_0x7777('0x8')](e,emitEvent(event));}}module['exports']=CmContactEvents;
\ No newline at end of file
+var _0xd8ba=['emit','hook','../../mysqldb','CmContact','setMaxListeners','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd8ba,0x7a));var _0xad8b=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xd8ba[_0x19950b];return _0x3c6b41;};'use strict';var EventEmitter=require('events');var CmContact=require(_0xad8b('0x0'))['db'][_0xad8b('0x1')];var CmContactEvents=new EventEmitter();CmContactEvents[_0xad8b('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xad8b('0x3'),'afterDestroy':'remove'};function emitEvent(_0x56fbbf){return function(_0x4fe314,_0xaf8599,_0x42f64e){CmContactEvents[_0xad8b('0x4')](_0x56fbbf+':'+_0x4fe314['id'],_0x4fe314);CmContactEvents['emit'](_0x56fbbf,_0x4fe314);_0x42f64e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmContact[_0xad8b('0x5')](e,emitEvent(event));}}module['exports']=CmContactEvents;
\ No newline at end of file
index 93eec82..6146c35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a87=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','CmContact','phone','fti_cm_contacts','firstName','fax','email','FULLTEXT','utf8mb4','utf8mb4_unicode_ci','models','get','error','cmContact','afterCreate','CmHopper','findOne','isNil','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','scheduledat','callbackUniqueid','format','YYYY-MM-DD\x20HH:mm:ss','catch','then','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','inspect','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','length','always','VoiceQueue','findAll','outbound','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','message','dialCheckDuplicateType','CmList','Lists','onlyIfOpen','isEmpty','VoiceQueueId','push','all','info','[CmContact][afterDestroy][Error]','lodash'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x4a87,0x81));var _0x74a8=function(_0x5a3ed2,_0xc2a7ae){_0x5a3ed2=_0x5a3ed2-0x0;var _0x4a1363=_0x4a87[_0x5a3ed2];return _0x4a1363;};'use strict';var _=require(_0x74a8('0x0'));var util=require(_0x74a8('0x1'));var logger=require(_0x74a8('0x2'))(_0x74a8('0x3'));var moment=require(_0x74a8('0x4'));var BPromise=require(_0x74a8('0x5'));var rp=require(_0x74a8('0x6'));var fs=require('fs');var path=require(_0x74a8('0x7'));var rimraf=require(_0x74a8('0x8'));var config=require(_0x74a8('0x9'));var attributes=require('./cmContact.attributes');module[_0x74a8('0xa')]=function(_0x535a5f,_0x291b2a){return _0x535a5f['define'](_0x74a8('0xb'),attributes,{'tableName':'cm_contacts','paranoid':!![],'indexes':[{'name':_0x74a8('0xc'),'fields':[_0x74a8('0xc')]},{'name':_0x74a8('0xd'),'fields':[_0x74a8('0xe'),'lastName',_0x74a8('0xc'),'mobile',_0x74a8('0xf'),_0x74a8('0x10')],'type':_0x74a8('0x11')}],'timestamps':!![],'charset':_0x74a8('0x12'),'collate':_0x74a8('0x13'),'hooks':{'afterCreate':function(_0x469410,_0x5f354f,_0x504319){var _0x57db4d=_0x535a5f[_0x74a8('0x14')];var _0x405a30=_0x469410[_0x74a8('0x15')]({'plain':!![]});function _0x45c462(){return function(_0x11e831){logger[_0x74a8('0x16')](_0x74a8('0x17'),_0x74a8('0x18'),util['inspect'](_0x11e831,{'showHidden':![],'depth':null}));};}var _0x20a343=function(_0x43a561){return new BPromise(function(_0x4600cc,_0x484990){_0x57db4d[_0x74a8('0x19')][_0x74a8('0x1a')]({'where':{'phone':_0x405a30[_0x74a8('0xc')],'VoiceQueueId':_0x43a561['id']}})['then'](function(_0x4375df){if(!_[_0x74a8('0x1b')](_0x4375df)){throw new Error(_0x74a8('0x1c')+_0x405a30['phone']+_0x74a8('0x1d')+_0x43a561['id']);}return _0x57db4d[_0x74a8('0x19')][_0x74a8('0x1e')]({'phone':_0x405a30[_0x74a8('0xc')],'ContactId':_0x405a30['id'],'ListId':_0x405a30[_0x74a8('0x1f')],'priority':_0x405a30[_0x74a8('0x20')]?_0x405a30[_0x74a8('0x20')]:0x2,'scheduledat':_0x405a30['scheduledat']?_0x405a30[_0x74a8('0x21')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x405a30[_0x74a8('0x22')]?!![]:![],'callbackuniqueid':_0x405a30[_0x74a8('0x22')]?_0x405a30[_0x74a8('0x22')]:undefined,'callbackat':_0x405a30[_0x74a8('0x22')]?moment()[_0x74a8('0x23')](_0x74a8('0x24')):undefined,'VoiceQueueId':_0x43a561['id']});})[_0x74a8('0x25')](function(_0x388fe6){_0x484990(_0x388fe6);});});};var _0x4ff25f=function(_0x2eb45f){return new BPromise(function(_0x1b56a6,_0xe54de6){_0x57db4d[_0x74a8('0x19')]['findOne']({'where':{'phone':_0x405a30['phone'],'VoiceQueueId':_0x2eb45f['id']}})[_0x74a8('0x26')](function(_0x2b4fc3){if(!_[_0x74a8('0x1b')](_0x2b4fc3)){throw new Error(_0x74a8('0x1c')+_0x405a30[_0x74a8('0xc')]+_0x74a8('0x27')+_0x2eb45f['id']);}return _0x57db4d[_0x74a8('0x28')][_0x74a8('0x1a')]({'where':{'calleridnum':_0x405a30['phone'],'VoiceQueueId':_0x2eb45f['id']}});})[_0x74a8('0x26')](function(_0x3c0bb2){if(!_[_0x74a8('0x1b')](_0x3c0bb2)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x405a30[_0x74a8('0xc')]+'\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'+_0x2eb45f['id']);}return _0x57db4d[_0x74a8('0x19')][_0x74a8('0x1e')]({'phone':_0x405a30[_0x74a8('0xc')],'ContactId':_0x405a30['id'],'ListId':_0x405a30[_0x74a8('0x1f')],'priority':_0x405a30[_0x74a8('0x20')]?_0x405a30['priority']:0x2,'scheduledat':_0x405a30[_0x74a8('0x21')]?_0x405a30[_0x74a8('0x21')]:moment()['format'](_0x74a8('0x24')),'callback':_0x405a30[_0x74a8('0x22')]?!![]:![],'callbackuniqueid':_0x405a30[_0x74a8('0x22')]?_0x405a30[_0x74a8('0x22')]:undefined,'callbackat':_0x405a30[_0x74a8('0x22')]?moment()[_0x74a8('0x23')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x2eb45f['id']});})['catch'](function(_0x18fdd9){_0xe54de6(_0x18fdd9);});});};function _0x591842(){return function(_0x497ec5){logger[_0x74a8('0x16')](_0x74a8('0x17'),_0x74a8('0x18'),util[_0x74a8('0x29')](_0x497ec5,{'showHidden':![],'depth':null}));};}var _0x28f3fb=function(_0x4d82db){return new BPromise(function(_0x2c1efc,_0x346b89){_0x57db4d[_0x74a8('0x19')][_0x74a8('0x1a')]({'where':{'phone':_0x405a30[_0x74a8('0xc')],'CampaignId':_0x4d82db['id']}})['then'](function(_0x110500){if(!_[_0x74a8('0x1b')](_0x110500)){throw new Error('cmContact,\x20afterCreate\x20'+_0x405a30[_0x74a8('0xc')]+_0x74a8('0x2a')+_0x4d82db['id']);}return _0x57db4d['CmHopper'][_0x74a8('0x1e')]({'phone':_0x405a30[_0x74a8('0xc')],'ContactId':_0x405a30['id'],'ListId':_0x405a30[_0x74a8('0x1f')],'priority':_0x405a30[_0x74a8('0x20')]?_0x405a30[_0x74a8('0x20')]:0x2,'scheduledat':_0x405a30[_0x74a8('0x21')]?_0x405a30['scheduledat']:moment()[_0x74a8('0x23')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x405a30[_0x74a8('0x22')]?!![]:![],'callbackuniqueid':_0x405a30['callbackUniqueid']?_0x405a30[_0x74a8('0x22')]:undefined,'callbackat':_0x405a30[_0x74a8('0x22')]?moment()[_0x74a8('0x23')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x4d82db['id']});})['catch'](function(_0x1e44a7){_0x346b89(_0x1e44a7);});});};var _0x296093=function(_0x5c34cf){return new BPromise(function(_0x265d15,_0x3e746a){_0x57db4d[_0x74a8('0x19')][_0x74a8('0x1a')]({'where':{'phone':_0x405a30[_0x74a8('0xc')],'CampaignId':_0x5c34cf['id']}})[_0x74a8('0x26')](function(_0x47bfb7){if(!_[_0x74a8('0x1b')](_0x47bfb7)){throw new Error(_0x74a8('0x1c')+_0x405a30[_0x74a8('0xc')]+_0x74a8('0x2b')+_0x5c34cf['id']);}return _0x57db4d[_0x74a8('0x28')]['findOne']({'where':{'calleridnum':_0x405a30['phone'],'CampaignId':_0x5c34cf['id']}});})[_0x74a8('0x26')](function(_0x28ddd8){if(!_['isNil'](_0x28ddd8)){throw new Error(_0x74a8('0x2c')+_0x405a30[_0x74a8('0xc')]+_0x74a8('0x2d')+_0x5c34cf['id']);}return _0x57db4d[_0x74a8('0x19')][_0x74a8('0x1e')]({'phone':_0x405a30[_0x74a8('0xc')],'ContactId':_0x405a30['id'],'ListId':_0x405a30[_0x74a8('0x1f')],'priority':_0x405a30[_0x74a8('0x20')]?_0x405a30['priority']:0x2,'scheduledat':_0x405a30[_0x74a8('0x21')]?_0x405a30[_0x74a8('0x21')]:moment()[_0x74a8('0x23')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x405a30[_0x74a8('0x22')]?!![]:![],'callbackuniqueid':_0x405a30[_0x74a8('0x22')]?_0x405a30[_0x74a8('0x22')]:undefined,'callbackat':_0x405a30[_0x74a8('0x22')]?moment()[_0x74a8('0x23')](_0x74a8('0x24')):undefined,'CampaignId':_0x5c34cf['id']});})[_0x74a8('0x25')](function(_0x3cdca4){_0x3e746a(_0x3cdca4);});});};if(_0x405a30[_0x74a8('0x1f')]){_0x57db4d['VoiceQueue']['findAll']({'where':{'type':'outbound'},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':_0x57db4d['CmList'],'as':'Lists','where':{'id':_0x405a30[_0x74a8('0x1f')]}}]})['then'](function(_0x578fdc){if(_0x578fdc){var _0x3d7bdc=[];for(var _0x483c11=0x0,_0x3b7bab;_0x483c11<_0x578fdc[_0x74a8('0x2e')];_0x483c11+=0x1){_0x3b7bab=_0x578fdc[_0x483c11][_0x74a8('0x15')]({'plain':!![]});switch(_0x3b7bab['dialCheckDuplicateType']){case _0x74a8('0x2f'):_0x4ff25f(_0x3b7bab)[_0x74a8('0x25')](_0x45c462());break;case'onlyIfOpen':_0x20a343(_0x3b7bab)[_0x74a8('0x25')](_0x45c462());break;default:_0x57db4d[_0x74a8('0x19')][_0x74a8('0x1e')]({'phone':_0x405a30[_0x74a8('0xc')],'ContactId':_0x405a30['id'],'ListId':_0x405a30['ListId'],'scheduledat':_0x405a30[_0x74a8('0x21')]?_0x405a30[_0x74a8('0x21')]:moment()['format'](_0x74a8('0x24')),'priority':_0x405a30[_0x74a8('0x20')]?_0x405a30[_0x74a8('0x20')]:0x2,'callback':_0x405a30['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x405a30[_0x74a8('0x22')]?_0x405a30[_0x74a8('0x22')]:undefined,'callbackat':_0x405a30[_0x74a8('0x22')]?moment()[_0x74a8('0x23')](_0x74a8('0x24')):undefined,'VoiceQueueId':_0x3b7bab['id']})['catch'](_0x45c462());}}}})[_0x74a8('0x26')](function(){return _0x57db4d[_0x74a8('0x30')][_0x74a8('0x31')]({'where':{'type':_0x74a8('0x32')},'attributes':['id'],'include':[{'model':_0x57db4d['CmList'],'as':_0x74a8('0x33'),'where':{'id':_0x405a30[_0x74a8('0x1f')]}}]})[_0x74a8('0x26')](function(_0x355511){if(_0x355511){var _0x1319fb=[];for(var _0x4450db=0x0,_0x5d7236;_0x4450db<_0x355511[_0x74a8('0x2e')];_0x4450db+=0x1){_0x5d7236=_0x355511[_0x4450db][_0x74a8('0x15')]({'plain':!![]});_0x57db4d[_0x74a8('0x34')]['create']({'phone':_0x405a30[_0x74a8('0xc')],'ContactId':_0x405a30['id'],'ListId':_0x405a30[_0x74a8('0x1f')],'VoiceQueueId':_0x5d7236['id']})['catch'](function(_0x6ec28e){logger[_0x74a8('0x16')](_0x74a8('0x35'),_0x74a8('0x18'),_0x6ec28e[_0x74a8('0x36')]);});}}});})[_0x74a8('0x26')](function(){return _0x57db4d['Campaign'][_0x74a8('0x31')]({'attributes':['id',_0x74a8('0x37')],'include':[{'model':_0x57db4d[_0x74a8('0x38')],'as':_0x74a8('0x39'),'where':{'id':_0x405a30[_0x74a8('0x1f')]}}]})[_0x74a8('0x26')](function(_0xc790cd){if(_0xc790cd){var _0x1b829e=[];for(var _0x4ee0ad=0x0,_0x1c8aa9;_0x4ee0ad<_0xc790cd[_0x74a8('0x2e')];_0x4ee0ad+=0x1){_0x1c8aa9=_0xc790cd[_0x4ee0ad][_0x74a8('0x15')]({'plain':!![]});switch(_0x1c8aa9[_0x74a8('0x37')]){case _0x74a8('0x2f'):_0x296093(_0x1c8aa9)[_0x74a8('0x25')](_0x591842());break;case _0x74a8('0x3a'):_0x28f3fb(_0x1c8aa9)[_0x74a8('0x25')](_0x591842());break;default:_0x57db4d[_0x74a8('0x19')][_0x74a8('0x1e')]({'phone':_0x405a30['phone'],'ContactId':_0x405a30['id'],'ListId':_0x405a30[_0x74a8('0x1f')],'scheduledat':_0x405a30[_0x74a8('0x21')]?_0x405a30['scheduledat']:moment()[_0x74a8('0x23')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x405a30[_0x74a8('0x20')]?_0x405a30[_0x74a8('0x20')]:0x2,'callback':_0x405a30[_0x74a8('0x22')]?!![]:![],'callbackuniqueid':_0x405a30[_0x74a8('0x22')]?_0x405a30[_0x74a8('0x22')]:undefined,'callbackat':_0x405a30[_0x74a8('0x22')]?moment()[_0x74a8('0x23')](_0x74a8('0x24')):undefined,'CampaignId':_0x1c8aa9['id']})[_0x74a8('0x25')](_0x591842());}}}});})[_0x74a8('0x26')](function(){return _0x57db4d['Campaign'][_0x74a8('0x31')]({'attributes':['id'],'include':[{'model':_0x57db4d[_0x74a8('0x38')],'as':_0x74a8('0x33'),'where':{'id':_0x405a30['ListId']}}]})[_0x74a8('0x26')](function(_0x5d998e){if(_0x5d998e){var _0x25a206=[];for(var _0x525366=0x0,_0x97f451;_0x525366<_0x5d998e[_0x74a8('0x2e')];_0x525366+=0x1){_0x97f451=_0x5d998e[_0x525366][_0x74a8('0x15')]({'plain':!![]});_0x57db4d[_0x74a8('0x34')][_0x74a8('0x1e')]({'phone':_0x405a30[_0x74a8('0xc')],'ContactId':_0x405a30['id'],'ListId':_0x405a30[_0x74a8('0x1f')],'CampaignId':_0x97f451['id']})[_0x74a8('0x25')](function(_0x3dc979){logger['error'](_0x74a8('0x35'),_0x74a8('0x18'),_0x3dc979[_0x74a8('0x36')]);});}}});})[_0x74a8('0x26')](function(){_0x504319();})[_0x74a8('0x25')](function(_0x166780){logger[_0x74a8('0x16')](_0x74a8('0x35'),'afterCreate',_0x166780[_0x74a8('0x36')]);_0x504319(_0x166780);});}else{_0x504319(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x3dec10,_0x258a6e,_0xb0bff1){var _0x5a9b9a=_0x535a5f[_0x74a8('0x14')];var _0xf80a5e=_0x3dec10[_0x74a8('0x15')]({'plain':!![]});return _0x5a9b9a['CmHopper'][_0x74a8('0x31')]({'raw':!![],'where':{'ListId':_0xf80a5e['ListId'],'ContactId':_0xf80a5e['id']}})[_0x74a8('0x26')](function(_0x332b02){if(!_[_0x74a8('0x3b')](_0x332b02)){var _0x5395c3=[];for(var _0x44a52a=0x0;_0x44a52a<_0x332b02[_0x74a8('0x2e')];_0x44a52a+=0x1){var _0x4e94e2=_0x5a9b9a[_0x74a8('0x19')]['destroy']({'where':{'ListId':_0x332b02[_0x44a52a][_0x74a8('0x1f')],'ContactId':_0x332b02[_0x44a52a]['ContactId'],'VoiceQueueId':_0x332b02[_0x44a52a][_0x74a8('0x3c')],'CampaignId':_0x332b02[_0x44a52a]['CampaignId']}});_0x5395c3[_0x74a8('0x3d')](_0x4e94e2);}return BPromise[_0x74a8('0x3e')](_0x5395c3);}})[_0x74a8('0x26')](function(_0x23c010){logger[_0x74a8('0x3f')]('[CmContact][afterDestroy][Succesfull]',util['inspect'](_0x23c010,{'showHidden':![],'depth':null}));_0xb0bff1();})[_0x74a8('0x25')](function(_0x5da48f){logger[_0x74a8('0x16')](_0x74a8('0x40'),util[_0x74a8('0x29')](_0x5da48f,{'showHidden':![],'depth':null}));_0xb0bff1(_0x5da48f);});}}});};
\ No newline at end of file
+var _0xe8ed=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmContact.attributes','exports','CmContact','cm_contacts','phone','fti_cm_contacts','firstName','lastName','mobile','FULLTEXT','utf8mb4_unicode_ci','models','get','cmContact','CmHopper','findOne','then','isNil','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','priority','error','inspect','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','findAll','outbound','CmList','Lists','dialCheckDuplicateType','always','BlackLists','cmContact,\x20%s,\x20%s','afterCreate','Campaign','length','onlyIfOpen','CmHopperBlack','message','isEmpty','destroy','ContactId','VoiceQueueId','CampaignId','push','all','info','[CmContact][afterDestroy][Error]'];(function(_0x263204,_0x19286b){var _0xed3987=function(_0x282bf1){while(--_0x282bf1){_0x263204['push'](_0x263204['shift']());}};_0xed3987(++_0x19286b);}(_0xe8ed,0x8a));var _0xde8e=function(_0x31db02,_0x5eebc0){_0x31db02=_0x31db02-0x0;var _0x4eac70=_0xe8ed[_0x31db02];return _0x4eac70;};'use strict';var _=require(_0xde8e('0x0'));var util=require('util');var logger=require(_0xde8e('0x1'))(_0xde8e('0x2'));var moment=require(_0xde8e('0x3'));var BPromise=require(_0xde8e('0x4'));var rp=require(_0xde8e('0x5'));var fs=require('fs');var path=require(_0xde8e('0x6'));var rimraf=require(_0xde8e('0x7'));var config=require(_0xde8e('0x8'));var attributes=require(_0xde8e('0x9'));module[_0xde8e('0xa')]=function(_0x324cc3,_0x328aaf){return _0x324cc3['define'](_0xde8e('0xb'),attributes,{'tableName':_0xde8e('0xc'),'paranoid':!![],'indexes':[{'name':_0xde8e('0xd'),'fields':[_0xde8e('0xd')]},{'name':_0xde8e('0xe'),'fields':[_0xde8e('0xf'),_0xde8e('0x10'),_0xde8e('0xd'),_0xde8e('0x11'),'fax','email'],'type':_0xde8e('0x12')}],'timestamps':!![],'charset':'utf8mb4','collate':_0xde8e('0x13'),'hooks':{'afterCreate':function(_0xcd64e1,_0x329f00,_0x3681f0){var _0xd2bcbf=_0x324cc3[_0xde8e('0x14')];var _0x20fbfe=_0xcd64e1[_0xde8e('0x15')]({'plain':!![]});function _0x371f03(){return function(_0x2d78bf){logger['error'](_0xde8e('0x16'),'afterCreate',util['inspect'](_0x2d78bf,{'showHidden':![],'depth':null}));};}var _0x2b7192=function(_0x3d0ff2){return new BPromise(function(_0x3bcc1b,_0x417742){_0xd2bcbf[_0xde8e('0x17')][_0xde8e('0x18')]({'where':{'phone':_0x20fbfe[_0xde8e('0xd')],'VoiceQueueId':_0x3d0ff2['id']}})[_0xde8e('0x19')](function(_0x5cd931){if(!_[_0xde8e('0x1a')](_0x5cd931)){throw new Error(_0xde8e('0x1b')+_0x20fbfe['phone']+_0xde8e('0x1c')+_0x3d0ff2['id']);}return _0xd2bcbf[_0xde8e('0x17')][_0xde8e('0x1d')]({'phone':_0x20fbfe[_0xde8e('0xd')],'ContactId':_0x20fbfe['id'],'ListId':_0x20fbfe[_0xde8e('0x1e')],'priority':_0x20fbfe['priority']?_0x20fbfe['priority']:0x2,'scheduledat':_0x20fbfe[_0xde8e('0x1f')]?_0x20fbfe[_0xde8e('0x1f')]:moment()[_0xde8e('0x20')](_0xde8e('0x21')),'callback':_0x20fbfe[_0xde8e('0x22')]?!![]:![],'callbackuniqueid':_0x20fbfe[_0xde8e('0x22')]?_0x20fbfe[_0xde8e('0x22')]:undefined,'callbackat':_0x20fbfe[_0xde8e('0x22')]?moment()['format'](_0xde8e('0x21')):undefined,'VoiceQueueId':_0x3d0ff2['id']});})[_0xde8e('0x23')](function(_0x5cd9f2){_0x417742(_0x5cd9f2);});});};var _0x4b8352=function(_0x1b3c22){return new BPromise(function(_0x32ad4f,_0x4c5084){_0xd2bcbf['CmHopper'][_0xde8e('0x18')]({'where':{'phone':_0x20fbfe[_0xde8e('0xd')],'VoiceQueueId':_0x1b3c22['id']}})[_0xde8e('0x19')](function(_0x53fac3){if(!_[_0xde8e('0x1a')](_0x53fac3)){throw new Error('cmContact,\x20afterCreate\x20'+_0x20fbfe[_0xde8e('0xd')]+_0xde8e('0x24')+_0x1b3c22['id']);}return _0xd2bcbf['CmHopperFinal'][_0xde8e('0x18')]({'where':{'calleridnum':_0x20fbfe[_0xde8e('0xd')],'VoiceQueueId':_0x1b3c22['id']}});})[_0xde8e('0x19')](function(_0x35838a){if(!_[_0xde8e('0x1a')](_0x35838a)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x20fbfe[_0xde8e('0xd')]+_0xde8e('0x25')+_0x1b3c22['id']);}return _0xd2bcbf[_0xde8e('0x17')][_0xde8e('0x1d')]({'phone':_0x20fbfe[_0xde8e('0xd')],'ContactId':_0x20fbfe['id'],'ListId':_0x20fbfe['ListId'],'priority':_0x20fbfe[_0xde8e('0x26')]?_0x20fbfe[_0xde8e('0x26')]:0x2,'scheduledat':_0x20fbfe[_0xde8e('0x1f')]?_0x20fbfe[_0xde8e('0x1f')]:moment()[_0xde8e('0x20')](_0xde8e('0x21')),'callback':_0x20fbfe['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x20fbfe[_0xde8e('0x22')]?_0x20fbfe[_0xde8e('0x22')]:undefined,'callbackat':_0x20fbfe[_0xde8e('0x22')]?moment()[_0xde8e('0x20')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x1b3c22['id']});})[_0xde8e('0x23')](function(_0x3f9e0d){_0x4c5084(_0x3f9e0d);});});};function _0x51898d(){return function(_0x5354b9){logger[_0xde8e('0x27')](_0xde8e('0x16'),'afterCreate',util[_0xde8e('0x28')](_0x5354b9,{'showHidden':![],'depth':null}));};}var _0xa8f7fd=function(_0x55d4c7){return new BPromise(function(_0x55302f,_0x5e8753){_0xd2bcbf['CmHopper'][_0xde8e('0x18')]({'where':{'phone':_0x20fbfe['phone'],'CampaignId':_0x55d4c7['id']}})[_0xde8e('0x19')](function(_0xde8731){if(!_[_0xde8e('0x1a')](_0xde8731)){throw new Error(_0xde8e('0x1b')+_0x20fbfe[_0xde8e('0xd')]+_0xde8e('0x29')+_0x55d4c7['id']);}return _0xd2bcbf[_0xde8e('0x17')]['create']({'phone':_0x20fbfe['phone'],'ContactId':_0x20fbfe['id'],'ListId':_0x20fbfe['ListId'],'priority':_0x20fbfe[_0xde8e('0x26')]?_0x20fbfe['priority']:0x2,'scheduledat':_0x20fbfe[_0xde8e('0x1f')]?_0x20fbfe[_0xde8e('0x1f')]:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x20fbfe[_0xde8e('0x22')]?!![]:![],'callbackuniqueid':_0x20fbfe['callbackUniqueid']?_0x20fbfe['callbackUniqueid']:undefined,'callbackat':_0x20fbfe['callbackUniqueid']?moment()[_0xde8e('0x20')](_0xde8e('0x21')):undefined,'CampaignId':_0x55d4c7['id']});})[_0xde8e('0x23')](function(_0x8d030f){_0x5e8753(_0x8d030f);});});};var _0xdc4b3b=function(_0x8779fe){return new BPromise(function(_0x4848c5,_0x1b96a0){_0xd2bcbf[_0xde8e('0x17')][_0xde8e('0x18')]({'where':{'phone':_0x20fbfe['phone'],'CampaignId':_0x8779fe['id']}})[_0xde8e('0x19')](function(_0x58e3aa){if(!_['isNil'](_0x58e3aa)){throw new Error(_0xde8e('0x1b')+_0x20fbfe[_0xde8e('0xd')]+_0xde8e('0x2a')+_0x8779fe['id']);}return _0xd2bcbf[_0xde8e('0x2b')][_0xde8e('0x18')]({'where':{'calleridnum':_0x20fbfe[_0xde8e('0xd')],'CampaignId':_0x8779fe['id']}});})['then'](function(_0xb0b0b){if(!_[_0xde8e('0x1a')](_0xb0b0b)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x20fbfe[_0xde8e('0xd')]+_0xde8e('0x2c')+_0x8779fe['id']);}return _0xd2bcbf['CmHopper'][_0xde8e('0x1d')]({'phone':_0x20fbfe[_0xde8e('0xd')],'ContactId':_0x20fbfe['id'],'ListId':_0x20fbfe[_0xde8e('0x1e')],'priority':_0x20fbfe['priority']?_0x20fbfe[_0xde8e('0x26')]:0x2,'scheduledat':_0x20fbfe['scheduledat']?_0x20fbfe[_0xde8e('0x1f')]:moment()['format'](_0xde8e('0x21')),'callback':_0x20fbfe['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x20fbfe[_0xde8e('0x22')]?_0x20fbfe[_0xde8e('0x22')]:undefined,'callbackat':_0x20fbfe[_0xde8e('0x22')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x8779fe['id']});})['catch'](function(_0x51e920){_0x1b96a0(_0x51e920);});});};if(_0x20fbfe['ListId']){_0xd2bcbf[_0xde8e('0x2d')][_0xde8e('0x2e')]({'where':{'type':_0xde8e('0x2f')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':_0xd2bcbf[_0xde8e('0x30')],'as':_0xde8e('0x31'),'where':{'id':_0x20fbfe['ListId']}}]})['then'](function(_0x8e4f92){if(_0x8e4f92){var _0x447396=[];for(var _0x5c2e3a=0x0,_0x3e744d;_0x5c2e3a<_0x8e4f92['length'];_0x5c2e3a+=0x1){_0x3e744d=_0x8e4f92[_0x5c2e3a]['get']({'plain':!![]});switch(_0x3e744d[_0xde8e('0x32')]){case _0xde8e('0x33'):_0x4b8352(_0x3e744d)['catch'](_0x371f03());break;case'onlyIfOpen':_0x2b7192(_0x3e744d)[_0xde8e('0x23')](_0x371f03());break;default:_0xd2bcbf[_0xde8e('0x17')]['create']({'phone':_0x20fbfe[_0xde8e('0xd')],'ContactId':_0x20fbfe['id'],'ListId':_0x20fbfe[_0xde8e('0x1e')],'scheduledat':_0x20fbfe[_0xde8e('0x1f')]?_0x20fbfe[_0xde8e('0x1f')]:moment()[_0xde8e('0x20')]('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x20fbfe[_0xde8e('0x26')]?_0x20fbfe[_0xde8e('0x26')]:0x2,'callback':_0x20fbfe[_0xde8e('0x22')]?!![]:![],'callbackuniqueid':_0x20fbfe[_0xde8e('0x22')]?_0x20fbfe[_0xde8e('0x22')]:undefined,'callbackat':_0x20fbfe[_0xde8e('0x22')]?moment()['format'](_0xde8e('0x21')):undefined,'VoiceQueueId':_0x3e744d['id']})['catch'](_0x371f03());}}}})[_0xde8e('0x19')](function(){return _0xd2bcbf[_0xde8e('0x2d')][_0xde8e('0x2e')]({'where':{'type':_0xde8e('0x2f')},'attributes':['id'],'include':[{'model':_0xd2bcbf[_0xde8e('0x30')],'as':_0xde8e('0x34'),'where':{'id':_0x20fbfe['ListId']}}]})[_0xde8e('0x19')](function(_0x1e72db){if(_0x1e72db){var _0x101f95=[];for(var _0x420fea=0x0,_0x166bf9;_0x420fea<_0x1e72db['length'];_0x420fea+=0x1){_0x166bf9=_0x1e72db[_0x420fea]['get']({'plain':!![]});_0xd2bcbf['CmHopperBlack'][_0xde8e('0x1d')]({'phone':_0x20fbfe[_0xde8e('0xd')],'ContactId':_0x20fbfe['id'],'ListId':_0x20fbfe[_0xde8e('0x1e')],'VoiceQueueId':_0x166bf9['id']})['catch'](function(_0x2e380d){logger[_0xde8e('0x27')](_0xde8e('0x35'),_0xde8e('0x36'),_0x2e380d['message']);});}}});})[_0xde8e('0x19')](function(){return _0xd2bcbf[_0xde8e('0x37')][_0xde8e('0x2e')]({'attributes':['id',_0xde8e('0x32')],'include':[{'model':_0xd2bcbf['CmList'],'as':_0xde8e('0x31'),'where':{'id':_0x20fbfe['ListId']}}]})[_0xde8e('0x19')](function(_0x11cfe2){if(_0x11cfe2){var _0x168ad4=[];for(var _0x50e2b5=0x0,_0x51b79b;_0x50e2b5<_0x11cfe2[_0xde8e('0x38')];_0x50e2b5+=0x1){_0x51b79b=_0x11cfe2[_0x50e2b5][_0xde8e('0x15')]({'plain':!![]});switch(_0x51b79b[_0xde8e('0x32')]){case _0xde8e('0x33'):_0xdc4b3b(_0x51b79b)[_0xde8e('0x23')](_0x51898d());break;case _0xde8e('0x39'):_0xa8f7fd(_0x51b79b)['catch'](_0x51898d());break;default:_0xd2bcbf['CmHopper'][_0xde8e('0x1d')]({'phone':_0x20fbfe['phone'],'ContactId':_0x20fbfe['id'],'ListId':_0x20fbfe[_0xde8e('0x1e')],'scheduledat':_0x20fbfe[_0xde8e('0x1f')]?_0x20fbfe[_0xde8e('0x1f')]:moment()[_0xde8e('0x20')](_0xde8e('0x21')),'priority':_0x20fbfe['priority']?_0x20fbfe[_0xde8e('0x26')]:0x2,'callback':_0x20fbfe[_0xde8e('0x22')]?!![]:![],'callbackuniqueid':_0x20fbfe[_0xde8e('0x22')]?_0x20fbfe[_0xde8e('0x22')]:undefined,'callbackat':_0x20fbfe[_0xde8e('0x22')]?moment()[_0xde8e('0x20')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x51b79b['id']})['catch'](_0x51898d());}}}});})[_0xde8e('0x19')](function(){return _0xd2bcbf[_0xde8e('0x37')]['findAll']({'attributes':['id'],'include':[{'model':_0xd2bcbf[_0xde8e('0x30')],'as':_0xde8e('0x34'),'where':{'id':_0x20fbfe[_0xde8e('0x1e')]}}]})[_0xde8e('0x19')](function(_0x4d9c41){if(_0x4d9c41){var _0x1988bc=[];for(var _0x39813f=0x0,_0x5ded7d;_0x39813f<_0x4d9c41['length'];_0x39813f+=0x1){_0x5ded7d=_0x4d9c41[_0x39813f][_0xde8e('0x15')]({'plain':!![]});_0xd2bcbf[_0xde8e('0x3a')][_0xde8e('0x1d')]({'phone':_0x20fbfe[_0xde8e('0xd')],'ContactId':_0x20fbfe['id'],'ListId':_0x20fbfe[_0xde8e('0x1e')],'CampaignId':_0x5ded7d['id']})['catch'](function(_0x457877){logger[_0xde8e('0x27')](_0xde8e('0x35'),_0xde8e('0x36'),_0x457877[_0xde8e('0x3b')]);});}}});})['then'](function(){_0x3681f0();})['catch'](function(_0x2345b2){logger[_0xde8e('0x27')](_0xde8e('0x35'),_0xde8e('0x36'),_0x2345b2[_0xde8e('0x3b')]);_0x3681f0(_0x2345b2);});}else{_0x3681f0(new Error('List\x20not\x20found'));}},'afterDestroy':function(_0x4e4fc4,_0x1a1bc4,_0x26b28e){var _0x48d1fb=_0x324cc3['models'];var _0x1388a3=_0x4e4fc4[_0xde8e('0x15')]({'plain':!![]});return _0x48d1fb[_0xde8e('0x17')][_0xde8e('0x2e')]({'raw':!![],'where':{'ListId':_0x1388a3['ListId'],'ContactId':_0x1388a3['id']}})[_0xde8e('0x19')](function(_0x568315){if(!_[_0xde8e('0x3c')](_0x568315)){var _0x59a551=[];for(var _0x1c0901=0x0;_0x1c0901<_0x568315['length'];_0x1c0901+=0x1){var _0x38d147=_0x48d1fb[_0xde8e('0x17')][_0xde8e('0x3d')]({'where':{'ListId':_0x568315[_0x1c0901][_0xde8e('0x1e')],'ContactId':_0x568315[_0x1c0901][_0xde8e('0x3e')],'VoiceQueueId':_0x568315[_0x1c0901][_0xde8e('0x3f')],'CampaignId':_0x568315[_0x1c0901][_0xde8e('0x40')]}});_0x59a551[_0xde8e('0x41')](_0x38d147);}return BPromise[_0xde8e('0x42')](_0x59a551);}})[_0xde8e('0x19')](function(_0x5cab38){logger[_0xde8e('0x43')]('[CmContact][afterDestroy][Succesfull]',util[_0xde8e('0x28')](_0x5cab38,{'showHidden':![],'depth':null}));_0x26b28e();})[_0xde8e('0x23')](function(_0x12ec78){logger[_0xde8e('0x27')](_0xde8e('0x44'),util[_0xde8e('0x28')](_0x12ec78,{'showHidden':![],'depth':null}));_0x26b28e(_0x12ec78);});}}});};
\ No newline at end of file
index 3a648fa..1a949cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x14e9=['moment','bluebird','randomstring','squel','../../config/utils','../../config/logger','jayson/promise','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','request','CmContact,\x20%s,\x20%s','request\x20sent','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CmContact','findAll','options','raw','limit','map','include','model','attributes','info','debug','GetCmContact','stringify','CreateCmContact','body','keys','length','startsWith','cf_','update','table','set','where','toString','query','then','lodash'];(function(_0x374554,_0x2d721a){var _0x1c58ea=function(_0x4e4e0a){while(--_0x4e4e0a){_0x374554['push'](_0x374554['shift']());}};_0x1c58ea(++_0x2d721a);}(_0x14e9,0x1af));var _0x914e=function(_0x13fdb3,_0x493557){_0x13fdb3=_0x13fdb3-0x0;var _0x212e46=_0x14e9[_0x13fdb3];return _0x212e46;};'use strict';var _=require(_0x914e('0x0'));var util=require('util');var moment=require(_0x914e('0x1'));var BPromise=require(_0x914e('0x2'));var rs=require(_0x914e('0x3'));var fs=require('fs');var Redis=require('ioredis');var squel=require(_0x914e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x914e('0x5'));var logger=require(_0x914e('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x914e('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0x914e('0x8')]=_[_0x914e('0x9')](config[_0x914e('0x8')],{'host':_0x914e('0xa'),'port':0x18eb});var socket=require(_0x914e('0xb'))(new Redis(config[_0x914e('0x8')]));require(_0x914e('0xc'))['register'](socket);function respondWithRpcPromise(_0x109c02,_0x14c911,_0x69189e){return new BPromise(function(_0x2aff70,_0x14be17){return client[_0x914e('0xd')](_0x109c02,_0x69189e)['then'](function(_0x1f6efd){logger['info'](_0x914e('0xe'),_0x14c911,_0x914e('0xf'));logger['debug'](_0x914e('0x10'),_0x14c911,'request\x20sent',JSON['stringify'](_0x1f6efd));if(_0x1f6efd['error']){if(_0x1f6efd[_0x914e('0x11')][_0x914e('0x12')]===0x1f4){logger[_0x914e('0x11')]('CmContact,\x20%s,\x20%s',_0x14c911,_0x1f6efd[_0x914e('0x11')]['message']);return _0x14be17(_0x1f6efd[_0x914e('0x11')][_0x914e('0x13')]);}logger[_0x914e('0x11')](_0x914e('0xe'),_0x14c911,_0x1f6efd[_0x914e('0x11')][_0x914e('0x13')]);return _0x2aff70(_0x1f6efd[_0x914e('0x11')][_0x914e('0x13')]);}else{logger['info']('CmContact,\x20%s,\x20%s',_0x14c911,_0x914e('0xf'));_0x2aff70(_0x1f6efd[_0x914e('0x14')]['message']);}})[_0x914e('0x15')](function(_0x31903d){logger['error'](_0x914e('0xe'),_0x14c911,_0x31903d);_0x14be17(_0x31903d);});});}exports['GetCmContact']=function(_0x3553ec){var _0x38e2be=this;return new Promise(function(_0x220bf4,_0x29bd51){return db[_0x914e('0x16')][_0x914e('0x17')]({'raw':_0x3553ec[_0x914e('0x18')]?_0x3553ec[_0x914e('0x18')][_0x914e('0x19')]===undefined?!![]:![]:!![],'where':_0x3553ec['options']?_0x3553ec[_0x914e('0x18')]['where']||null:null,'attributes':_0x3553ec[_0x914e('0x18')]?_0x3553ec[_0x914e('0x18')]['attributes']||null:null,'limit':_0x3553ec[_0x914e('0x18')]?_0x3553ec[_0x914e('0x18')][_0x914e('0x1a')]||null:null,'include':_0x3553ec[_0x914e('0x18')]?_0x3553ec[_0x914e('0x18')]['include']?_[_0x914e('0x1b')](_0x3553ec['options'][_0x914e('0x1c')],function(_0x20f1b2){return{'model':db[_0x20f1b2[_0x914e('0x1d')]],'as':_0x20f1b2['as'],'attributes':_0x20f1b2[_0x914e('0x1e')],'include':_0x20f1b2[_0x914e('0x1c')]?_[_0x914e('0x1b')](_0x20f1b2[_0x914e('0x1c')],function(_0x549fc9){return{'model':db[_0x549fc9[_0x914e('0x1d')]],'as':_0x549fc9['as'],'attributes':_0x549fc9[_0x914e('0x1e')],'include':_0x549fc9[_0x914e('0x1c')]?_[_0x914e('0x1b')](_0x549fc9[_0x914e('0x1c')],function(_0x26cd5b){return{'model':db[_0x26cd5b['model']],'as':_0x26cd5b['as'],'attributes':_0x26cd5b[_0x914e('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29dd42){logger[_0x914e('0x1f')]('GetCmContact',_0x3553ec);logger[_0x914e('0x20')](_0x914e('0x21'),_0x3553ec,JSON[_0x914e('0x22')](_0x29dd42));_0x220bf4(_0x29dd42);})[_0x914e('0x15')](function(_0x32e8ea){logger[_0x914e('0x11')](_0x914e('0x21'),_0x32e8ea[_0x914e('0x13')],_0x3553ec);_0x29bd51(_0x38e2be[_0x914e('0x11')](0x1f4,_0x32e8ea['message']));});});};exports[_0x914e('0x23')]=function(_0x50961a){var _0x2470eb=this;return new Promise(function(_0x243e22,_0x39a618){return db[_0x914e('0x16')]['create'](_0x50961a[_0x914e('0x24')],{'raw':_0x50961a[_0x914e('0x18')]?_0x50961a[_0x914e('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x17b0fa){var _0x1e2e4d;for(var _0x9af07b=0x0;_0x9af07b<Object[_0x914e('0x25')](_0x50961a[_0x914e('0x24')])[_0x914e('0x26')];_0x9af07b++){var _0x32f303=Object[_0x914e('0x25')](_0x50961a[_0x914e('0x24')])[_0x9af07b];if(_0x32f303[_0x914e('0x27')](_0x914e('0x28'))){_0x1e2e4d=squel[_0x914e('0x29')]()[_0x914e('0x2a')]('cm_contacts')[_0x914e('0x2b')](_0x32f303,_0x50961a[_0x914e('0x24')][_0x32f303])[_0x914e('0x2c')]('id\x20=\x20?',_0x17b0fa['id'])[_0x914e('0x2d')]();break;}}if(!_0x1e2e4d)return _0x17b0fa;return db['sequelize'][_0x914e('0x2e')](_0x1e2e4d)[_0x914e('0x2f')](function(){return _0x17b0fa;});})['then'](function(_0x30fe26){logger['info'](_0x914e('0x23'),_0x50961a);logger['debug'](_0x914e('0x23'),_0x50961a,JSON[_0x914e('0x22')](_0x30fe26));_0x243e22(_0x30fe26);})['catch'](function(_0x5024be){logger[_0x914e('0x11')](_0x914e('0x23'),_0x5024be[_0x914e('0x13')],_0x50961a);_0x39a618(_0x2470eb[_0x914e('0x11')](0x1f4,_0x5024be[_0x914e('0x13')]));});});};
\ No newline at end of file
+var _0x4f5b=['model','keys','body','length','startsWith','cf_','update','set','id\x20=\x20?','toString','query','CreateCmContact','util','moment','bluebird','randomstring','ioredis','squel','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','request','then','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmContact','CmContact','options','raw','where','attributes','limit','map','include'];(function(_0x54b283,_0x5eb8a6){var _0x2462b3=function(_0x13fca7){while(--_0x13fca7){_0x54b283['push'](_0x54b283['shift']());}};_0x2462b3(++_0x5eb8a6);}(_0x4f5b,0x11a));var _0xb4f5=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x4f5b[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0xb4f5('0x0'));var moment=require(_0xb4f5('0x1'));var BPromise=require(_0xb4f5('0x2'));var rs=require(_0xb4f5('0x3'));var fs=require('fs');var Redis=require(_0xb4f5('0x4'));var squel=require(_0xb4f5('0x5'));var db=require(_0xb4f5('0x6'))['db'];var utils=require(_0xb4f5('0x7'));var logger=require(_0xb4f5('0x8'))(_0xb4f5('0x9'));var config=require(_0xb4f5('0xa'));var jayson=require(_0xb4f5('0xb'));var client=jayson[_0xb4f5('0xc')][_0xb4f5('0xd')]({'port':0x232a});config[_0xb4f5('0xe')]=_[_0xb4f5('0xf')](config[_0xb4f5('0xe')],{'host':_0xb4f5('0x10'),'port':0x18eb});var socket=require(_0xb4f5('0x11'))(new Redis(config[_0xb4f5('0xe')]));require(_0xb4f5('0x12'))[_0xb4f5('0x13')](socket);function respondWithRpcPromise(_0x5a14c6,_0x5f21b9,_0x2fd684){return new BPromise(function(_0x3b7641,_0x5c372d){return client[_0xb4f5('0x14')](_0x5a14c6,_0x2fd684)[_0xb4f5('0x15')](function(_0xc28e30){logger[_0xb4f5('0x16')](_0xb4f5('0x17'),_0x5f21b9,_0xb4f5('0x18'));logger[_0xb4f5('0x19')](_0xb4f5('0x1a'),_0x5f21b9,_0xb4f5('0x18'),JSON[_0xb4f5('0x1b')](_0xc28e30));if(_0xc28e30[_0xb4f5('0x1c')]){if(_0xc28e30[_0xb4f5('0x1c')][_0xb4f5('0x1d')]===0x1f4){logger[_0xb4f5('0x1c')](_0xb4f5('0x17'),_0x5f21b9,_0xc28e30[_0xb4f5('0x1c')][_0xb4f5('0x1e')]);return _0x5c372d(_0xc28e30[_0xb4f5('0x1c')][_0xb4f5('0x1e')]);}logger[_0xb4f5('0x1c')](_0xb4f5('0x17'),_0x5f21b9,_0xc28e30[_0xb4f5('0x1c')]['message']);return _0x3b7641(_0xc28e30[_0xb4f5('0x1c')][_0xb4f5('0x1e')]);}else{logger[_0xb4f5('0x16')](_0xb4f5('0x17'),_0x5f21b9,_0xb4f5('0x18'));_0x3b7641(_0xc28e30[_0xb4f5('0x1f')]['message']);}})[_0xb4f5('0x20')](function(_0xfa057e){logger[_0xb4f5('0x1c')](_0xb4f5('0x17'),_0x5f21b9,_0xfa057e);_0x5c372d(_0xfa057e);});});}exports[_0xb4f5('0x21')]=function(_0x399f87){var _0x463c6e=this;return new Promise(function(_0x1f8d92,_0x45148b){return db[_0xb4f5('0x22')]['findAll']({'raw':_0x399f87['options']?_0x399f87[_0xb4f5('0x23')][_0xb4f5('0x24')]===undefined?!![]:![]:!![],'where':_0x399f87[_0xb4f5('0x23')]?_0x399f87[_0xb4f5('0x23')][_0xb4f5('0x25')]||null:null,'attributes':_0x399f87[_0xb4f5('0x23')]?_0x399f87[_0xb4f5('0x23')][_0xb4f5('0x26')]||null:null,'limit':_0x399f87[_0xb4f5('0x23')]?_0x399f87[_0xb4f5('0x23')][_0xb4f5('0x27')]||null:null,'include':_0x399f87[_0xb4f5('0x23')]?_0x399f87[_0xb4f5('0x23')]['include']?_[_0xb4f5('0x28')](_0x399f87['options'][_0xb4f5('0x29')],function(_0x1ba108){return{'model':db[_0x1ba108[_0xb4f5('0x2a')]],'as':_0x1ba108['as'],'attributes':_0x1ba108[_0xb4f5('0x26')],'include':_0x1ba108[_0xb4f5('0x29')]?_['map'](_0x1ba108[_0xb4f5('0x29')],function(_0x72d240){return{'model':db[_0x72d240[_0xb4f5('0x2a')]],'as':_0x72d240['as'],'attributes':_0x72d240['attributes'],'include':_0x72d240['include']?_[_0xb4f5('0x28')](_0x72d240[_0xb4f5('0x29')],function(_0x5e7dd8){return{'model':db[_0x5e7dd8[_0xb4f5('0x2a')]],'as':_0x5e7dd8['as'],'attributes':_0x5e7dd8[_0xb4f5('0x26')]};}):[]};}):[]};}):[]:[]})[_0xb4f5('0x15')](function(_0x29dc63){logger[_0xb4f5('0x16')](_0xb4f5('0x21'),_0x399f87);logger[_0xb4f5('0x19')](_0xb4f5('0x21'),_0x399f87,JSON['stringify'](_0x29dc63));_0x1f8d92(_0x29dc63);})[_0xb4f5('0x20')](function(_0x512840){logger[_0xb4f5('0x1c')](_0xb4f5('0x21'),_0x512840[_0xb4f5('0x1e')],_0x399f87);_0x45148b(_0x463c6e['error'](0x1f4,_0x512840['message']));});});};exports['CreateCmContact']=function(_0x2421d1){var _0x36dab0=this;return new Promise(function(_0x4f4fd3,_0x5a9ccd){return db[_0xb4f5('0x22')]['create'](_0x2421d1['body'],{'raw':_0x2421d1[_0xb4f5('0x23')]?_0x2421d1['options'][_0xb4f5('0x24')]===undefined?!![]:![]:!![]})[_0xb4f5('0x15')](function(_0x3613d0){var _0x14c407;for(var _0x533a12=0x0;_0x533a12<Object[_0xb4f5('0x2b')](_0x2421d1[_0xb4f5('0x2c')])[_0xb4f5('0x2d')];_0x533a12++){var _0x420d92=Object[_0xb4f5('0x2b')](_0x2421d1[_0xb4f5('0x2c')])[_0x533a12];if(_0x420d92[_0xb4f5('0x2e')](_0xb4f5('0x2f'))){_0x14c407=squel[_0xb4f5('0x30')]()['table']('cm_contacts')[_0xb4f5('0x31')](_0x420d92,_0x2421d1[_0xb4f5('0x2c')][_0x420d92])[_0xb4f5('0x25')](_0xb4f5('0x32'),_0x3613d0['id'])[_0xb4f5('0x33')]();break;}}if(!_0x14c407)return _0x3613d0;return db['sequelize'][_0xb4f5('0x34')](_0x14c407)[_0xb4f5('0x15')](function(){return _0x3613d0;});})['then'](function(_0x34502e){logger[_0xb4f5('0x16')](_0xb4f5('0x35'),_0x2421d1);logger[_0xb4f5('0x19')](_0xb4f5('0x35'),_0x2421d1,JSON[_0xb4f5('0x1b')](_0x34502e));_0x4f4fd3(_0x34502e);})[_0xb4f5('0x20')](function(_0x4f9500){logger[_0xb4f5('0x1c')](_0xb4f5('0x35'),_0x4f9500[_0xb4f5('0x1e')],_0x2421d1);_0x5a9ccd(_0x36dab0[_0xb4f5('0x1c')](0x1f4,_0x4f9500[_0xb4f5('0x1e')]));});});};
\ No newline at end of file
index 2ba8302..eb2a6b2 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(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'use strict';var CmContactEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){CmContactEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);CmContactEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
+var _0xa9e0=['register','length','cmContact:','./cmContact.events','save','remove','emit','removeListener'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'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 0a52b2a..79587f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6886=['getHoppers','/:id/hopper_finals','getHopperFinals','getJscriptySessions','/:id/journey','post','merge','bulkCreate','setTags','diskStorage','root','originalname','format','%s-%s%s','basename','extname','now','single','uploadCsv','join','server/files/tmp','file','import','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','isAuthenticated','index','get','/describe','describe','show','/:id/tags','getTags','/:id/hoppers'];(function(_0xef0ce4,_0x5c2cba){var _0x4193c3=function(_0x3aebe9){while(--_0x3aebe9){_0xef0ce4['push'](_0xef0ce4['shift']());}};_0x4193c3(++_0x5c2cba);}(_0x6886,0x166));var _0x6688=function(_0x1c7a53,_0x35ed5c){_0x1c7a53=_0x1c7a53-0x0;var _0x5e05d3=_0x6886[_0x1c7a53];return _0x5e05d3;};'use strict';var multer=require(_0x6688('0x0'));var util=require(_0x6688('0x1'));var path=require(_0x6688('0x2'));var timeout=require(_0x6688('0x3'));var express=require('express');var router=express[_0x6688('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6688('0x5'));var interaction=require(_0x6688('0x6'));var config=require(_0x6688('0x7'));var controller=require(_0x6688('0x8'));router['get']('/',auth[_0x6688('0x9')](),controller[_0x6688('0xa')]);router[_0x6688('0xb')](_0x6688('0xc'),auth[_0x6688('0x9')](),controller[_0x6688('0xd')]);router[_0x6688('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x6688('0xe')]);router[_0x6688('0xb')](_0x6688('0xf'),auth[_0x6688('0x9')](),controller[_0x6688('0x10')]);router[_0x6688('0xb')](_0x6688('0x11'),auth[_0x6688('0x9')](),controller[_0x6688('0x12')]);router[_0x6688('0xb')]('/:id/hopper_histories',auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x6688('0xb')](_0x6688('0x13'),auth[_0x6688('0x9')](),controller[_0x6688('0x14')]);router[_0x6688('0xb')]('/:id/jscripty_sessions',auth[_0x6688('0x9')](),controller[_0x6688('0x15')]);router[_0x6688('0xb')](_0x6688('0x16'),auth['isAuthenticated'](),controller['getJourney']);router[_0x6688('0x17')]('/merge',auth['isAuthenticated'](),controller[_0x6688('0x18')]);router['post']('/',auth[_0x6688('0x9')](),controller['create']);router[_0x6688('0x17')]('/create_many',auth[_0x6688('0x9')](),controller[_0x6688('0x19')]);router[_0x6688('0x17')](_0x6688('0xf'),auth[_0x6688('0x9')](),controller[_0x6688('0x1a')]);var upload=multer({'storage':multer[_0x6688('0x1b')]({'destination':function(_0x19b58f,_0x18aa7b,_0x203686){_0x203686(null,path['join'](config[_0x6688('0x1c')],'server/files/tmp'));},'filename':function(_0x21da38,_0x53a8f7,_0x494d1a){_0x53a8f7[_0x6688('0x1d')]=_0x53a8f7[_0x6688('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x494d1a(null,util[_0x6688('0x1e')](_0x6688('0x1f'),path[_0x6688('0x20')](_0x53a8f7['originalname'],path[_0x6688('0x21')](_0x53a8f7[_0x6688('0x1d')])),Date[_0x6688('0x22')](),path[_0x6688('0x21')](_0x53a8f7[_0x6688('0x1d')])));}})});router['post']('/csv',upload[_0x6688('0x23')]('file'),controller[_0x6688('0x24')]);var upload=multer({'storage':multer[_0x6688('0x1b')]({'destination':function(_0x2144a5,_0x20eade,_0x381ec2){_0x381ec2(null,path[_0x6688('0x25')](config[_0x6688('0x1c')],_0x6688('0x26')));},'filename':function(_0x180437,_0x524d63,_0x32ae4f){_0x524d63[_0x6688('0x1d')]=_0x524d63[_0x6688('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x32ae4f(null,util[_0x6688('0x1e')](_0x6688('0x1f'),path[_0x6688('0x20')](_0x524d63[_0x6688('0x1d')],path[_0x6688('0x21')](_0x524d63['originalname'])),Date[_0x6688('0x22')](),path[_0x6688('0x21')](_0x524d63[_0x6688('0x1d')])));}})});router['post']('/upload',upload['single'](_0x6688('0x27')),controller['upload']);router[_0x6688('0x17')]('/upload/:id',auth[_0x6688('0x9')](),controller[_0x6688('0x28')]);router[_0x6688('0x29')](_0x6688('0x2a'),auth['isAuthenticated'](),controller[_0x6688('0x2b')]);router[_0x6688('0x2c')](_0x6688('0x2a'),auth[_0x6688('0x9')](),controller[_0x6688('0x2d')]);module[_0x6688('0x2e')]=router;
\ No newline at end of file
+var _0x88bc=['%s-%s%s','basename','extname','now','single','root','file','upload','/upload/:id','put','update','delete','destroy','util','path','express','../../components/interaction/service','./cmContact.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/tags','getTags','/:id/hoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','getJscriptySessions','getJourney','/merge','post','create','/create_many','setTags','diskStorage','join','server/files/tmp','originalname','replace'];(function(_0x7d3be,_0x17ac43){var _0x5849d2=function(_0x2f6ff8){while(--_0x2f6ff8){_0x7d3be['push'](_0x7d3be['shift']());}};_0x5849d2(++_0x17ac43);}(_0x88bc,0x133));var _0xc88b=function(_0x4d45c1,_0x2beda1){_0x4d45c1=_0x4d45c1-0x0;var _0x244478=_0x88bc[_0x4d45c1];return _0x244478;};'use strict';var multer=require('multer');var util=require(_0xc88b('0x0'));var path=require(_0xc88b('0x1'));var timeout=require('connect-timeout');var express=require(_0xc88b('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc88b('0x3'));var config=require('../../config/environment');var controller=require(_0xc88b('0x4'));router[_0xc88b('0x5')]('/',auth[_0xc88b('0x6')](),controller['index']);router[_0xc88b('0x5')](_0xc88b('0x7'),auth[_0xc88b('0x6')](),controller[_0xc88b('0x8')]);router[_0xc88b('0x5')](_0xc88b('0x9'),auth['isAuthenticated'](),controller[_0xc88b('0xa')]);router[_0xc88b('0x5')](_0xc88b('0xb'),auth[_0xc88b('0x6')](),controller[_0xc88b('0xc')]);router['get'](_0xc88b('0xd'),auth[_0xc88b('0x6')](),controller['getHoppers']);router[_0xc88b('0x5')](_0xc88b('0xe'),auth['isAuthenticated'](),controller['getHopperHistories']);router['get'](_0xc88b('0xf'),auth[_0xc88b('0x6')](),controller[_0xc88b('0x10')]);router[_0xc88b('0x5')]('/:id/jscripty_sessions',auth[_0xc88b('0x6')](),controller[_0xc88b('0x11')]);router[_0xc88b('0x5')]('/:id/journey',auth[_0xc88b('0x6')](),controller[_0xc88b('0x12')]);router['post'](_0xc88b('0x13'),auth['isAuthenticated'](),controller['merge']);router[_0xc88b('0x14')]('/',auth['isAuthenticated'](),controller[_0xc88b('0x15')]);router['post'](_0xc88b('0x16'),auth[_0xc88b('0x6')](),controller['bulkCreate']);router[_0xc88b('0x14')](_0xc88b('0xb'),auth[_0xc88b('0x6')](),controller[_0xc88b('0x17')]);var upload=multer({'storage':multer[_0xc88b('0x18')]({'destination':function(_0x35ea25,_0x4f8861,_0x3965f0){_0x3965f0(null,path[_0xc88b('0x19')](config['root'],_0xc88b('0x1a')));},'filename':function(_0x1536d8,_0x20c02a,_0x337e78){_0x20c02a[_0xc88b('0x1b')]=_0x20c02a['originalname'][_0xc88b('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x337e78(null,util['format'](_0xc88b('0x1d'),path[_0xc88b('0x1e')](_0x20c02a[_0xc88b('0x1b')],path[_0xc88b('0x1f')](_0x20c02a[_0xc88b('0x1b')])),Date[_0xc88b('0x20')](),path[_0xc88b('0x1f')](_0x20c02a[_0xc88b('0x1b')])));}})});router[_0xc88b('0x14')]('/csv',upload[_0xc88b('0x21')]('file'),controller['uploadCsv']);var upload=multer({'storage':multer[_0xc88b('0x18')]({'destination':function(_0x141797,_0x29c860,_0x19efbc){_0x19efbc(null,path[_0xc88b('0x19')](config[_0xc88b('0x22')],_0xc88b('0x1a')));},'filename':function(_0x56a04a,_0x16f0ab,_0x13e159){_0x16f0ab[_0xc88b('0x1b')]=_0x16f0ab[_0xc88b('0x1b')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x13e159(null,util['format'](_0xc88b('0x1d'),path[_0xc88b('0x1e')](_0x16f0ab[_0xc88b('0x1b')],path[_0xc88b('0x1f')](_0x16f0ab['originalname'])),Date[_0xc88b('0x20')](),path[_0xc88b('0x1f')](_0x16f0ab[_0xc88b('0x1b')])));}})});router['post']('/upload',upload['single'](_0xc88b('0x23')),controller[_0xc88b('0x24')]);router[_0xc88b('0x14')](_0xc88b('0x25'),auth[_0xc88b('0x6')](),controller['import']);router[_0xc88b('0x26')](_0xc88b('0x9'),auth[_0xc88b('0x6')](),controller[_0xc88b('0x27')]);router[_0xc88b('0x28')](_0xc88b('0x9'),auth[_0xc88b('0x6')](),controller[_0xc88b('0x29')]);module['exports']=router;
\ No newline at end of file
index 218ca56..af99dcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb26a=['parse','values','isArray','stringify','BOOLEAN','ENUM','voice','lodash','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','type','select'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xb26a,0x157));var _0xab26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb26a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var _=require(_0xab26('0x0'));module['exports']={'name':{'type':Sequelize[_0xab26('0x1')],'get':function(_0x1abb25){return this[_0xab26('0x2')](_0xab26('0x3'));}},'alias':{'type':Sequelize[_0xab26('0x4')],'allowNull':![],'set':function(_0x175997){this[_0xab26('0x5')](_0xab26('0x3'),_0x175997?_0x175997:this[_0xab26('0x2')](_0xab26('0x6')));}},'type':{'type':Sequelize[_0xab26('0x4')],'allowNull':![]},'values':{'type':Sequelize['TEXT']('long'),'get':function(){if(this[_0xab26('0x2')](_0xab26('0x7'))===_0xab26('0x8')){return JSON[_0xab26('0x9')](this[_0xab26('0x2')](_0xab26('0xa')));}else{return this[_0xab26('0x2')]('values');}},'set':function(_0x223c76){if(Array[_0xab26('0xb')](_0x223c76)){this[_0xab26('0x5')](_0xab26('0xa'),JSON[_0xab26('0xc')](_0x223c76));}else{this['setDataValue'](_0xab26('0xa'),_0x223c76);}}},'required':{'type':Sequelize[_0xab26('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0xab26('0xe')](_0xab26('0xf'))}};
\ No newline at end of file
+var _0x31e4=['VIRTUAL','getDataValue','alias','STRING','setDataValue','TEXT','long','type','select','parse','values','BOOLEAN','ENUM','voice','sequelize','lodash','exports'];(function(_0x573c95,_0x387fda){var _0x42fed6=function(_0x385fc6){while(--_0x385fc6){_0x573c95['push'](_0x573c95['shift']());}};_0x42fed6(++_0x387fda);}(_0x31e4,0x74));var _0x431e=function(_0x2aaa60,_0x22258f){_0x2aaa60=_0x2aaa60-0x0;var _0x2e3fa5=_0x31e4[_0x2aaa60];return _0x2e3fa5;};'use strict';var Sequelize=require(_0x431e('0x0'));var _=require(_0x431e('0x1'));module[_0x431e('0x2')]={'name':{'type':Sequelize[_0x431e('0x3')],'get':function(_0x39c0ee){return this[_0x431e('0x4')](_0x431e('0x5'));}},'alias':{'type':Sequelize[_0x431e('0x6')],'allowNull':![],'set':function(_0x5cdaa5){this[_0x431e('0x7')](_0x431e('0x5'),_0x5cdaa5?_0x5cdaa5:this[_0x431e('0x4')]('name'));}},'type':{'type':Sequelize[_0x431e('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x431e('0x8')](_0x431e('0x9')),'get':function(){if(this[_0x431e('0x4')](_0x431e('0xa'))===_0x431e('0xb')){return JSON[_0x431e('0xc')](this[_0x431e('0x4')]('values'));}else{return this['getDataValue'](_0x431e('0xd'));}},'set':function(_0x5a6a57){if(Array['isArray'](_0x5a6a57)){this[_0x431e('0x7')]('values',JSON['stringify'](_0x5a6a57));}else{this['setDataValue'](_0x431e('0xd'),_0x5a6a57);}}},'required':{'type':Sequelize[_0x431e('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x431e('0xe')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x431e('0xf')](_0x431e('0x10'))}};
\ No newline at end of file
index 1e3d30c..6c6fa98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47d2=['sort','where','pick','filter','merge','includeAll','include','rows','catch','show','params','find','body','sequelize','transaction','create','Sequelize','TEXT','type','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','CmCustomField','rawAttributes','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x47d2,0x11a));var _0x247d=function(_0x216488,_0x454333){_0x216488=_0x216488-0x0;var _0x2e4d5a=_0x47d2[_0x216488];return _0x2e4d5a;};'use strict';var emlformat=require(_0x247d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x247d('0x1'));var rp=require(_0x247d('0x2'));var moment=require(_0x247d('0x3'));var BPromise=require(_0x247d('0x4'));var Mustache=require(_0x247d('0x5'));var util=require(_0x247d('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x247d('0x7'));var _=require(_0x247d('0x8'));var squel=require(_0x247d('0x9'));var crypto=require('crypto');var jsforce=require(_0x247d('0xa'));var deskjs=require(_0x247d('0xb'));var toCsv=require(_0x247d('0xc'));var querystring=require(_0x247d('0xd'));var Papa=require('papaparse');var Redis=require(_0x247d('0xe'));var authService=require(_0x247d('0xf'));var qs=require(_0x247d('0x10'));var as=require(_0x247d('0x11'));var hardwareService=require(_0x247d('0x12'));var logger=require('../../config/logger')(_0x247d('0x13'));var utils=require(_0x247d('0x14'));var config=require(_0x247d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x247d('0x16'))['db'];function respondWithStatusCode(_0x92f7d0,_0x432642){_0x432642=_0x432642||0xcc;return function(_0x4d6319){if(_0x4d6319){return _0x92f7d0[_0x247d('0x17')](_0x432642);}return _0x92f7d0[_0x247d('0x18')](_0x432642)[_0x247d('0x19')]();};}function respondWithResult(_0x514d35,_0x37fef5){_0x37fef5=_0x37fef5||0xc8;return function(_0x2448e2){if(_0x2448e2){return _0x514d35['status'](_0x37fef5)[_0x247d('0x1a')](_0x2448e2);}};}function respondWithFilteredResult(_0x1f3417,_0x1970e8){return function(_0x35d602){if(_0x35d602){var _0x13ba81=typeof _0x1970e8[_0x247d('0x1b')]===_0x247d('0x1c')&&typeof _0x1970e8[_0x247d('0x1d')]===_0x247d('0x1c');var _0x32fffa=_0x35d602[_0x247d('0x1e')];var _0x893ba0=_0x13ba81?0x0:_0x1970e8[_0x247d('0x1b')];var _0xab76e6=_0x13ba81?_0x35d602[_0x247d('0x1e')]:_0x1970e8[_0x247d('0x1b')]+_0x1970e8['limit'];var _0xe2e4b8;if(_0xab76e6>=_0x32fffa){_0xab76e6=_0x32fffa;_0xe2e4b8=0xc8;}else{_0xe2e4b8=0xce;}_0x1f3417[_0x247d('0x18')](_0xe2e4b8);return _0x1f3417[_0x247d('0x1f')](_0x247d('0x20'),_0x893ba0+'-'+_0xab76e6+'/'+_0x32fffa)[_0x247d('0x1a')](_0x35d602);}return null;};}function patchUpdates(_0x14f3c6){return function(_0x3e4ec3){try{jsonpatch['apply'](_0x3e4ec3,_0x14f3c6,!![]);}catch(_0x553ca3){return BPromise[_0x247d('0x21')](_0x553ca3);}return _0x3e4ec3[_0x247d('0x22')]();};}function saveUpdates(_0x90ca8c,_0x158202){return function(_0x2be2c4){if(_0x2be2c4){return _0x2be2c4[_0x247d('0x23')](_0x90ca8c)[_0x247d('0x24')](function(_0x274091){return _0x274091;});}return null;};}function removeEntity(_0x1742f9,_0x289139){return function(_0x4e0137){if(_0x4e0137){return _0x4e0137[_0x247d('0x25')]()[_0x247d('0x24')](function(){_0x1742f9['status'](0xcc)[_0x247d('0x19')]();});}};}function handleEntityNotFound(_0x5b2a20,_0x4f89bc){return function(_0x225db6){if(!_0x225db6){_0x5b2a20[_0x247d('0x17')](0x194);}return _0x225db6;};}function handleError(_0xee821e,_0x58ada8){_0x58ada8=_0x58ada8||0x1f4;return function(_0x1f22aa){logger[_0x247d('0x26')](_0x1f22aa[_0x247d('0x27')]);if(_0x1f22aa[_0x247d('0x28')]){delete _0x1f22aa[_0x247d('0x28')];}_0xee821e['status'](_0x58ada8)['send'](_0x1f22aa);};}exports[_0x247d('0x29')]=function(_0x1e87ef,_0xcc3af8){var _0x51f9d9={},_0x3a944e={},_0x11b622={'count':0x0,'rows':[]};var _0x50d27d=_[_0x247d('0x2a')](db[_0x247d('0x2b')][_0x247d('0x2c')],function(_0x41cabd){return{'name':_0x41cabd['fieldName'],'type':_0x41cabd['type'][_0x247d('0x2d')]};});_0x3a944e[_0x247d('0x2e')]=_[_0x247d('0x2f')](_['map'](_0x50d27d,_0x247d('0x28')),[_0x247d('0x28')]);_0x3a944e[_0x247d('0x30')]=_[_0x247d('0x31')](_0x1e87ef[_0x247d('0x30')]);_0x3a944e[_0x247d('0x32')]=_[_0x247d('0x33')](_0x3a944e[_0x247d('0x2e')],_0x3a944e[_0x247d('0x30')]);_0x51f9d9[_0x247d('0x34')]=_[_0x247d('0x33')](_0x3a944e['model'],qs['fields'](_0x1e87ef['query'][_0x247d('0x35')]));_0x51f9d9[_0x247d('0x34')]=_0x51f9d9[_0x247d('0x34')][_0x247d('0x36')]?_0x51f9d9[_0x247d('0x34')]:_0x3a944e[_0x247d('0x2e')];if(!_0x1e87ef['query'][_0x247d('0x37')](_0x247d('0x38'))){_0x51f9d9[_0x247d('0x1d')]=qs['limit'](_0x1e87ef[_0x247d('0x30')][_0x247d('0x1d')]);_0x51f9d9[_0x247d('0x1b')]=qs[_0x247d('0x1b')](_0x1e87ef[_0x247d('0x30')][_0x247d('0x1b')]);}_0x51f9d9[_0x247d('0x39')]=qs[_0x247d('0x3a')](_0x1e87ef[_0x247d('0x30')][_0x247d('0x3a')]);_0x51f9d9[_0x247d('0x3b')]=qs[_0x247d('0x32')](_[_0x247d('0x3c')](_0x1e87ef[_0x247d('0x30')],_0x3a944e['filters']),_0x50d27d);if(_0x1e87ef[_0x247d('0x30')][_0x247d('0x3d')]){_0x51f9d9[_0x247d('0x3b')]=_['merge'](_0x51f9d9[_0x247d('0x3b')],{'$or':_[_0x247d('0x2a')](_0x50d27d,function(_0x39afc0){if(_0x39afc0['type']!=='VIRTUAL'){var _0x593406={};_0x593406[_0x39afc0[_0x247d('0x28')]]={'$like':'%'+_0x1e87ef['query']['filter']+'%'};return _0x593406;}})});}_0x51f9d9=_[_0x247d('0x3e')]({},_0x51f9d9,_0x1e87ef['options']);var _0x38a396={'where':_0x51f9d9[_0x247d('0x3b')]};return db['CmCustomField'][_0x247d('0x1e')](_0x38a396)[_0x247d('0x24')](function(_0x400de8){_0x11b622['count']=_0x400de8;if(_0x1e87ef[_0x247d('0x30')][_0x247d('0x3f')]){_0x51f9d9[_0x247d('0x40')]=[{'all':!![]}];}return db['CmCustomField']['findAll'](_0x51f9d9);})[_0x247d('0x24')](function(_0x1a310a){_0x11b622[_0x247d('0x41')]=_0x1a310a;return _0x11b622;})[_0x247d('0x24')](respondWithFilteredResult(_0xcc3af8,_0x51f9d9))[_0x247d('0x42')](handleError(_0xcc3af8,null));};exports[_0x247d('0x43')]=function(_0x3e6f60,_0x4df5d4){var _0x24ac3c={'raw':!![],'where':{'id':_0x3e6f60[_0x247d('0x44')]['id']}},_0x4ce6bb={};_0x4ce6bb[_0x247d('0x2e')]=_[_0x247d('0x31')](db[_0x247d('0x2b')][_0x247d('0x2c')]);_0x4ce6bb[_0x247d('0x30')]=_[_0x247d('0x31')](_0x3e6f60['query']);_0x4ce6bb[_0x247d('0x32')]=_[_0x247d('0x33')](_0x4ce6bb[_0x247d('0x2e')],_0x4ce6bb[_0x247d('0x30')]);_0x24ac3c[_0x247d('0x34')]=_['intersection'](_0x4ce6bb['model'],qs[_0x247d('0x35')](_0x3e6f60[_0x247d('0x30')]['fields']));_0x24ac3c[_0x247d('0x34')]=_0x24ac3c[_0x247d('0x34')]['length']?_0x24ac3c[_0x247d('0x34')]:_0x4ce6bb[_0x247d('0x2e')];if(_0x3e6f60[_0x247d('0x30')][_0x247d('0x3f')]){_0x24ac3c['include']=[{'all':!![]}];}_0x24ac3c=_['merge']({},_0x24ac3c,_0x3e6f60['options']);return db[_0x247d('0x2b')]['find'](_0x24ac3c)[_0x247d('0x24')](handleEntityNotFound(_0x4df5d4,null))[_0x247d('0x24')](respondWithResult(_0x4df5d4,null))['catch'](handleError(_0x4df5d4,null));};exports[_0x247d('0x23')]=function(_0x3d6a00,_0x5c5b74){if(_0x3d6a00['body']['id']){delete _0x3d6a00['body']['id'];}return db[_0x247d('0x2b')][_0x247d('0x45')]({'where':{'id':_0x3d6a00[_0x247d('0x44')]['id']}})[_0x247d('0x24')](handleEntityNotFound(_0x5c5b74,null))[_0x247d('0x24')](saveUpdates(_0x3d6a00[_0x247d('0x46')],null))[_0x247d('0x24')](respondWithResult(_0x5c5b74,null))[_0x247d('0x42')](handleError(_0x5c5b74,null));};exports[_0x247d('0x25')]=function(_0xf1224a,_0x19f4c7){return db[_0x247d('0x2b')][_0x247d('0x45')]({'where':{'id':_0xf1224a[_0x247d('0x44')]['id']}})[_0x247d('0x24')](handleEntityNotFound(_0x19f4c7,null))[_0x247d('0x24')](removeEntity(_0x19f4c7,null))[_0x247d('0x42')](handleError(_0x19f4c7,null));};exports['create']=function(_0xe8c4a4,_0x532811){var _0x41894c;return db[_0x247d('0x47')][_0x247d('0x48')](function(_0x38436f){return db['CmCustomField'][_0x247d('0x49')](_0xe8c4a4[_0x247d('0x46')],{'transaction':_0x38436f})[_0x247d('0x24')](function(_0x2cdb7b){_0x41894c=_0x2cdb7b;var _0xbf1cb8={'type':db[_0x247d('0x4a')][_0x247d('0x4b')],'transaction':_0x38436f};switch(_0xe8c4a4[_0x247d('0x46')][_0x247d('0x4c')]){case'text':_0xbf1cb8[_0x247d('0x4c')]=db['Sequelize']['TEXT'];break;case'number':_0xbf1cb8['type']=db[_0x247d('0x4a')][_0x247d('0x4d')];break;case'switch':_0xbf1cb8[_0x247d('0x4c')]=db['Sequelize'][_0x247d('0x4e')];_0xbf1cb8[_0x247d('0x4f')]=![];break;default:}return db[_0x247d('0x47')][_0x247d('0x50')][_0x247d('0x51')](_0x247d('0x52'),util[_0x247d('0x53')](_0x247d('0x54'),_0x41894c['id']),_0xbf1cb8);})['then'](function(){return _0x41894c;});})['then'](respondWithResult(_0x532811,0xc9))['catch'](handleError(_0x532811,null));};
\ No newline at end of file
+var _0x869e=['sendStatus','error','name','send','index','map','CmCustomField','type','key','model','differenceBy','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','keys','rawAttributes','find','body','create','sequelize','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','reject','then','destroy'];(function(_0x5226fa,_0x3b36c7){var _0x2db4f3=function(_0x3c66cc){while(--_0x3c66cc){_0x5226fa['push'](_0x5226fa['shift']());}};_0x2db4f3(++_0x3b36c7);}(_0x869e,0x8d));var _0xe869=function(_0x3975b5,_0x2bf6de){_0x3975b5=_0x3975b5-0x0;var _0x16b5d5=_0x869e[_0x3975b5];return _0x16b5d5;};'use strict';var emlformat=require(_0xe869('0x0'));var rimraf=require(_0xe869('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe869('0x2'));var moment=require(_0xe869('0x3'));var BPromise=require(_0xe869('0x4'));var Mustache=require(_0xe869('0x5'));var util=require(_0xe869('0x6'));var path=require(_0xe869('0x7'));var sox=require(_0xe869('0x8'));var csv=require(_0xe869('0x9'));var ejs=require(_0xe869('0xa'));var fs=require('fs');var fs_extra=require(_0xe869('0xb'));var _=require(_0xe869('0xc'));var squel=require(_0xe869('0xd'));var crypto=require(_0xe869('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe869('0xf'));var toCsv=require(_0xe869('0x9'));var querystring=require(_0xe869('0x10'));var Papa=require(_0xe869('0x11'));var Redis=require(_0xe869('0x12'));var authService=require(_0xe869('0x13'));var qs=require(_0xe869('0x14'));var as=require(_0xe869('0x15'));var hardwareService=require(_0xe869('0x16'));var logger=require(_0xe869('0x17'))(_0xe869('0x18'));var utils=require(_0xe869('0x19'));var config=require(_0xe869('0x1a'));var licenseUtil=require(_0xe869('0x1b'));var db=require(_0xe869('0x1c'))['db'];function respondWithStatusCode(_0x2d9c9a,_0x159dbc){_0x159dbc=_0x159dbc||0xcc;return function(_0x550a19){if(_0x550a19){return _0x2d9c9a['sendStatus'](_0x159dbc);}return _0x2d9c9a[_0xe869('0x1d')](_0x159dbc)[_0xe869('0x1e')]();};}function respondWithResult(_0x65c291,_0x16e0d1){_0x16e0d1=_0x16e0d1||0xc8;return function(_0x2f2801){if(_0x2f2801){return _0x65c291[_0xe869('0x1d')](_0x16e0d1)['json'](_0x2f2801);}};}function respondWithFilteredResult(_0x7c9b11,_0x59ff29){return function(_0x3faf7c){if(_0x3faf7c){var _0x15ceb6=typeof _0x59ff29[_0xe869('0x1f')]===_0xe869('0x20')&&typeof _0x59ff29[_0xe869('0x21')]===_0xe869('0x20');var _0x2a9286=_0x3faf7c[_0xe869('0x22')];var _0x57e772=_0x15ceb6?0x0:_0x59ff29[_0xe869('0x1f')];var _0xd363cd=_0x15ceb6?_0x3faf7c[_0xe869('0x22')]:_0x59ff29[_0xe869('0x1f')]+_0x59ff29[_0xe869('0x21')];var _0x59b31b;if(_0xd363cd>=_0x2a9286){_0xd363cd=_0x2a9286;_0x59b31b=0xc8;}else{_0x59b31b=0xce;}_0x7c9b11[_0xe869('0x1d')](_0x59b31b);return _0x7c9b11['set'](_0xe869('0x23'),_0x57e772+'-'+_0xd363cd+'/'+_0x2a9286)['json'](_0x3faf7c);}return null;};}function patchUpdates(_0x2a1061){return function(_0x227233){try{jsonpatch['apply'](_0x227233,_0x2a1061,!![]);}catch(_0x4f1d1c){return BPromise[_0xe869('0x24')](_0x4f1d1c);}return _0x227233['save']();};}function saveUpdates(_0x36ae6c,_0x56414a){return function(_0x1f73b5){if(_0x1f73b5){return _0x1f73b5['update'](_0x36ae6c)[_0xe869('0x25')](function(_0x2e0de7){return _0x2e0de7;});}return null;};}function removeEntity(_0x4374ff,_0x3ffa44){return function(_0x5ac741){if(_0x5ac741){return _0x5ac741[_0xe869('0x26')]()[_0xe869('0x25')](function(){_0x4374ff[_0xe869('0x1d')](0xcc)[_0xe869('0x1e')]();});}};}function handleEntityNotFound(_0x2b975a,_0x5795c0){return function(_0x1f5f6f){if(!_0x1f5f6f){_0x2b975a[_0xe869('0x27')](0x194);}return _0x1f5f6f;};}function handleError(_0x2b6993,_0x3bbdf8){_0x3bbdf8=_0x3bbdf8||0x1f4;return function(_0x2a01f5){logger[_0xe869('0x28')](_0x2a01f5['stack']);if(_0x2a01f5[_0xe869('0x29')]){delete _0x2a01f5[_0xe869('0x29')];}_0x2b6993['status'](_0x3bbdf8)[_0xe869('0x2a')](_0x2a01f5);};}exports[_0xe869('0x2b')]=function(_0x44ff31,_0x24b6ef){var _0x591d5b={},_0x302256={},_0x48cbaa={'count':0x0,'rows':[]};var _0x3731de=_[_0xe869('0x2c')](db[_0xe869('0x2d')]['rawAttributes'],function(_0x420901){return{'name':_0x420901['fieldName'],'type':_0x420901[_0xe869('0x2e')][_0xe869('0x2f')]};});_0x302256[_0xe869('0x30')]=_[_0xe869('0x31')](_[_0xe869('0x2c')](_0x3731de,_0xe869('0x29')),[_0xe869('0x29')]);_0x302256[_0xe869('0x32')]=_['keys'](_0x44ff31[_0xe869('0x32')]);_0x302256[_0xe869('0x33')]=_[_0xe869('0x34')](_0x302256[_0xe869('0x30')],_0x302256[_0xe869('0x32')]);_0x591d5b[_0xe869('0x35')]=_[_0xe869('0x34')](_0x302256[_0xe869('0x30')],qs[_0xe869('0x36')](_0x44ff31[_0xe869('0x32')][_0xe869('0x36')]));_0x591d5b[_0xe869('0x35')]=_0x591d5b[_0xe869('0x35')][_0xe869('0x37')]?_0x591d5b[_0xe869('0x35')]:_0x302256[_0xe869('0x30')];if(!_0x44ff31[_0xe869('0x32')][_0xe869('0x38')](_0xe869('0x39'))){_0x591d5b[_0xe869('0x21')]=qs[_0xe869('0x21')](_0x44ff31[_0xe869('0x32')][_0xe869('0x21')]);_0x591d5b[_0xe869('0x1f')]=qs['offset'](_0x44ff31[_0xe869('0x32')][_0xe869('0x1f')]);}_0x591d5b['order']=qs[_0xe869('0x3a')](_0x44ff31[_0xe869('0x32')][_0xe869('0x3a')]);_0x591d5b['where']=qs[_0xe869('0x33')](_['pick'](_0x44ff31[_0xe869('0x32')],_0x302256[_0xe869('0x33')]),_0x3731de);if(_0x44ff31[_0xe869('0x32')][_0xe869('0x3b')]){_0x591d5b[_0xe869('0x3c')]=_['merge'](_0x591d5b[_0xe869('0x3c')],{'$or':_[_0xe869('0x2c')](_0x3731de,function(_0x26663c){if(_0x26663c[_0xe869('0x2e')]!==_0xe869('0x3d')){var _0x5cc8af={};_0x5cc8af[_0x26663c[_0xe869('0x29')]]={'$like':'%'+_0x44ff31[_0xe869('0x32')][_0xe869('0x3b')]+'%'};return _0x5cc8af;}})});}_0x591d5b=_[_0xe869('0x3e')]({},_0x591d5b,_0x44ff31[_0xe869('0x3f')]);var _0x3a60a0={'where':_0x591d5b[_0xe869('0x3c')]};return db['CmCustomField']['count'](_0x3a60a0)[_0xe869('0x25')](function(_0x21814f){_0x48cbaa[_0xe869('0x22')]=_0x21814f;if(_0x44ff31[_0xe869('0x32')][_0xe869('0x40')]){_0x591d5b[_0xe869('0x41')]=[{'all':!![]}];}return db[_0xe869('0x2d')][_0xe869('0x42')](_0x591d5b);})[_0xe869('0x25')](function(_0x42566c){_0x48cbaa['rows']=_0x42566c;return _0x48cbaa;})[_0xe869('0x25')](respondWithFilteredResult(_0x24b6ef,_0x591d5b))[_0xe869('0x43')](handleError(_0x24b6ef,null));};exports[_0xe869('0x44')]=function(_0x59d87c,_0x16be4a){var _0x4734a3={'raw':!![],'where':{'id':_0x59d87c[_0xe869('0x45')]['id']}},_0x5c2421={};_0x5c2421[_0xe869('0x30')]=_[_0xe869('0x46')](db['CmCustomField'][_0xe869('0x47')]);_0x5c2421['query']=_[_0xe869('0x46')](_0x59d87c['query']);_0x5c2421[_0xe869('0x33')]=_[_0xe869('0x34')](_0x5c2421[_0xe869('0x30')],_0x5c2421['query']);_0x4734a3[_0xe869('0x35')]=_[_0xe869('0x34')](_0x5c2421[_0xe869('0x30')],qs['fields'](_0x59d87c[_0xe869('0x32')][_0xe869('0x36')]));_0x4734a3['attributes']=_0x4734a3[_0xe869('0x35')][_0xe869('0x37')]?_0x4734a3[_0xe869('0x35')]:_0x5c2421[_0xe869('0x30')];if(_0x59d87c[_0xe869('0x32')]['includeAll']){_0x4734a3[_0xe869('0x41')]=[{'all':!![]}];}_0x4734a3=_[_0xe869('0x3e')]({},_0x4734a3,_0x59d87c[_0xe869('0x3f')]);return db[_0xe869('0x2d')][_0xe869('0x48')](_0x4734a3)[_0xe869('0x25')](handleEntityNotFound(_0x16be4a,null))[_0xe869('0x25')](respondWithResult(_0x16be4a,null))['catch'](handleError(_0x16be4a,null));};exports['update']=function(_0x14fbec,_0x37c35c){if(_0x14fbec['body']['id']){delete _0x14fbec[_0xe869('0x49')]['id'];}return db[_0xe869('0x2d')][_0xe869('0x48')]({'where':{'id':_0x14fbec[_0xe869('0x45')]['id']}})['then'](handleEntityNotFound(_0x37c35c,null))['then'](saveUpdates(_0x14fbec['body'],null))[_0xe869('0x25')](respondWithResult(_0x37c35c,null))[_0xe869('0x43')](handleError(_0x37c35c,null));};exports[_0xe869('0x26')]=function(_0x16de37,_0x473f28){return db[_0xe869('0x2d')][_0xe869('0x48')]({'where':{'id':_0x16de37['params']['id']}})[_0xe869('0x25')](handleEntityNotFound(_0x473f28,null))[_0xe869('0x25')](removeEntity(_0x473f28,null))[_0xe869('0x43')](handleError(_0x473f28,null));};exports[_0xe869('0x4a')]=function(_0x580494,_0x5de35f){var _0x43e8dd;return db[_0xe869('0x4b')][_0xe869('0x4c')](function(_0xb34c5d){return db[_0xe869('0x2d')][_0xe869('0x4a')](_0x580494[_0xe869('0x49')],{'transaction':_0xb34c5d})['then'](function(_0x31ddf6){_0x43e8dd=_0x31ddf6;var _0x2b4fd9={'type':db[_0xe869('0x4d')][_0xe869('0x4e')],'transaction':_0xb34c5d};switch(_0x580494[_0xe869('0x49')][_0xe869('0x2e')]){case _0xe869('0x4f'):_0x2b4fd9[_0xe869('0x2e')]=db[_0xe869('0x4d')][_0xe869('0x4e')];break;case _0xe869('0x50'):_0x2b4fd9[_0xe869('0x2e')]=db[_0xe869('0x4d')][_0xe869('0x51')];break;case _0xe869('0x52'):_0x2b4fd9[_0xe869('0x2e')]=db[_0xe869('0x4d')][_0xe869('0x53')];_0x2b4fd9[_0xe869('0x54')]=![];break;default:}return db[_0xe869('0x4b')][_0xe869('0x55')][_0xe869('0x56')](_0xe869('0x57'),util[_0xe869('0x58')](_0xe869('0x59'),_0x43e8dd['id']),_0x2b4fd9);})['then'](function(){return _0x43e8dd;});})[_0xe869('0x25')](respondWithResult(_0x5de35f,0xc9))[_0xe869('0x43')](handleError(_0x5de35f,null));};
\ No newline at end of file
index cf7441d..675b5c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdae5=['request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment'];(function(_0x27678d,_0x3fec4c){var _0x17d25c=function(_0x50037e){while(--_0x50037e){_0x27678d['push'](_0x27678d['shift']());}};_0x17d25c(++_0x3fec4c);}(_0xdae5,0x1d7));var _0x5dae=function(_0x13d957,_0x5a08e8){_0x13d957=_0x13d957-0x0;var _0x3c36bb=_0xdae5[_0x13d957];return _0x3c36bb;};'use strict';var _=require(_0x5dae('0x0'));var util=require(_0x5dae('0x1'));var logger=require(_0x5dae('0x2'))(_0x5dae('0x3'));var moment=require(_0x5dae('0x4'));var BPromise=require('bluebird');var rp=require(_0x5dae('0x5'));var fs=require('fs');var path=require(_0x5dae('0x6'));var rimraf=require(_0x5dae('0x7'));var config=require(_0x5dae('0x8'));var attributes=require(_0x5dae('0x9'));module[_0x5dae('0xa')]=function(_0x5aeb01,_0x5291be){return _0x5aeb01[_0x5dae('0xb')](_0x5dae('0xc'),attributes,{'tableName':_0x5dae('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0e08=['moment','bluebird','request-promise','path','rimraf','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields','lodash','../../config/logger','api'];(function(_0x51ea08,_0x361b2e){var _0x9bcf8e=function(_0xcf31a7){while(--_0xcf31a7){_0x51ea08['push'](_0x51ea08['shift']());}};_0x9bcf8e(++_0x361b2e);}(_0x0e08,0x1aa));var _0x80e0=function(_0x2d4ebc,_0x21099){_0x2d4ebc=_0x2d4ebc-0x0;var _0x496939=_0x0e08[_0x2d4ebc];return _0x496939;};'use strict';var _=require(_0x80e0('0x0'));var util=require('util');var logger=require(_0x80e0('0x1'))(_0x80e0('0x2'));var moment=require(_0x80e0('0x3'));var BPromise=require(_0x80e0('0x4'));var rp=require(_0x80e0('0x5'));var fs=require('fs');var path=require(_0x80e0('0x6'));var rimraf=require(_0x80e0('0x7'));var config=require('../../config/environment');var attributes=require(_0x80e0('0x8'));module[_0x80e0('0x9')]=function(_0x1acdbf,_0xf0ae08){return _0x1acdbf[_0x80e0('0xa')](_0x80e0('0xb'),attributes,{'tableName':_0x80e0('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4a9e87c..5d3f809 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cbd=['CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4cbd,0x124));var _0xd4cb=function(_0x5eaea8,_0x199282){_0x5eaea8=_0x5eaea8-0x0;var _0x213fef=_0x4cbd[_0x5eaea8];return _0x213fef;};'use strict';var _=require(_0xd4cb('0x0'));var util=require(_0xd4cb('0x1'));var moment=require('moment');var BPromise=require(_0xd4cb('0x2'));var rs=require(_0xd4cb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd4cb('0x4'))['db'];var utils=require(_0xd4cb('0x5'));var logger=require('../../config/logger')(_0xd4cb('0x6'));var config=require(_0xd4cb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd4cb('0x8')][_0xd4cb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x63eff,_0x2d8f71,_0x261394){return new BPromise(function(_0x356085,_0xe7a5c9){return client[_0xd4cb('0xa')](_0x63eff,_0x261394)[_0xd4cb('0xb')](function(_0x2f5cd7){logger[_0xd4cb('0xc')](_0xd4cb('0xd'),_0x2d8f71,_0xd4cb('0xe'));logger[_0xd4cb('0xf')](_0xd4cb('0x10'),_0x2d8f71,_0xd4cb('0xe'),JSON[_0xd4cb('0x11')](_0x2f5cd7));if(_0x2f5cd7[_0xd4cb('0x12')]){if(_0x2f5cd7[_0xd4cb('0x12')]['code']===0x1f4){logger['error']('CmCustomField,\x20%s,\x20%s',_0x2d8f71,_0x2f5cd7[_0xd4cb('0x12')][_0xd4cb('0x13')]);return _0xe7a5c9(_0x2f5cd7[_0xd4cb('0x12')][_0xd4cb('0x13')]);}logger[_0xd4cb('0x12')](_0xd4cb('0xd'),_0x2d8f71,_0x2f5cd7[_0xd4cb('0x12')][_0xd4cb('0x13')]);return _0x356085(_0x2f5cd7['error'][_0xd4cb('0x13')]);}else{logger[_0xd4cb('0xc')](_0xd4cb('0xd'),_0x2d8f71,'request\x20sent');_0x356085(_0x2f5cd7[_0xd4cb('0x14')][_0xd4cb('0x13')]);}})[_0xd4cb('0x15')](function(_0x3e7dd1){logger[_0xd4cb('0x12')](_0xd4cb('0xd'),_0x2d8f71,_0x3e7dd1);_0xe7a5c9(_0x3e7dd1);});});}
\ No newline at end of file
+var _0x82e8=['util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x59198b,_0x14663c){var _0x250e52=function(_0x49cdc7){while(--_0x49cdc7){_0x59198b['push'](_0x59198b['shift']());}};_0x250e52(++_0x14663c);}(_0x82e8,0xbe));var _0x882e=function(_0x57b432,_0x1589a0){_0x57b432=_0x57b432-0x0;var _0x2edf2a=_0x82e8[_0x57b432];return _0x2edf2a;};'use strict';var _=require('lodash');var util=require(_0x882e('0x0'));var moment=require(_0x882e('0x1'));var BPromise=require(_0x882e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x882e('0x3'));var db=require(_0x882e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x882e('0x5'))(_0x882e('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x882e('0x7')][_0x882e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x15ac5c,_0xee5303,_0x4b90c4){return new BPromise(function(_0x2b3a6b,_0x24f668){return client[_0x882e('0x9')](_0x15ac5c,_0x4b90c4)[_0x882e('0xa')](function(_0x419add){logger[_0x882e('0xb')](_0x882e('0xc'),_0xee5303,_0x882e('0xd'));logger[_0x882e('0xe')](_0x882e('0xf'),_0xee5303,_0x882e('0xd'),JSON['stringify'](_0x419add));if(_0x419add[_0x882e('0x10')]){if(_0x419add[_0x882e('0x10')]['code']===0x1f4){logger[_0x882e('0x10')](_0x882e('0xc'),_0xee5303,_0x419add[_0x882e('0x10')][_0x882e('0x11')]);return _0x24f668(_0x419add[_0x882e('0x10')][_0x882e('0x11')]);}logger['error'](_0x882e('0xc'),_0xee5303,_0x419add['error'][_0x882e('0x11')]);return _0x2b3a6b(_0x419add[_0x882e('0x10')][_0x882e('0x11')]);}else{logger[_0x882e('0xb')]('CmCustomField,\x20%s,\x20%s',_0xee5303,'request\x20sent');_0x2b3a6b(_0x419add[_0x882e('0x12')][_0x882e('0x11')]);}})['catch'](function(_0x50d763){logger[_0x882e('0x10')](_0x882e('0xc'),_0xee5303,_0x50d763);_0x24f668(_0x50d763);});});}
\ No newline at end of file
index 3c6b6d8..3e312c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x124a=['post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./cmCustomField.controller','get','isAuthenticated','show'];(function(_0x146a05,_0x5d03cd){var _0x530410=function(_0x16eb56){while(--_0x16eb56){_0x146a05['push'](_0x146a05['shift']());}};_0x530410(++_0x5d03cd);}(_0x124a,0x171));var _0xa124=function(_0xaf25ae,_0x2001c1){_0xaf25ae=_0xaf25ae-0x0;var _0x49732d=_0x124a[_0xaf25ae];return _0x49732d;};'use strict';var multer=require(_0xa124('0x0'));var util=require(_0xa124('0x1'));var path=require(_0xa124('0x2'));var timeout=require(_0xa124('0x3'));var express=require(_0xa124('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa124('0x5'));var interaction=require(_0xa124('0x6'));var config=require('../../config/environment');var controller=require(_0xa124('0x7'));router[_0xa124('0x8')]('/',auth[_0xa124('0x9')](),controller['index']);router[_0xa124('0x8')]('/:id',auth[_0xa124('0x9')](),controller[_0xa124('0xa')]);router[_0xa124('0xb')]('/',auth[_0xa124('0x9')](),controller[_0xa124('0xc')]);router[_0xa124('0xd')](_0xa124('0xe'),auth[_0xa124('0x9')](),controller[_0xa124('0xf')]);router[_0xa124('0x10')]('/:id',auth[_0xa124('0x9')](),controller[_0xa124('0x11')]);module[_0xa124('0x12')]=router;
\ No newline at end of file
+var _0x4693=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','isAuthenticated','get','/:id','post','put','update','delete','destroy','multer'];(function(_0x266779,_0x3d23e3){var _0x23db0e=function(_0xbd2ad6){while(--_0xbd2ad6){_0x266779['push'](_0x266779['shift']());}};_0x23db0e(++_0x3d23e3);}(_0x4693,0x18b));var _0x3469=function(_0x1dfa14,_0x82c01a){_0x1dfa14=_0x1dfa14-0x0;var _0x517b8d=_0x4693[_0x1dfa14];return _0x517b8d;};'use strict';var multer=require(_0x3469('0x0'));var util=require('util');var path=require(_0x3469('0x1'));var timeout=require(_0x3469('0x2'));var express=require(_0x3469('0x3'));var router=express[_0x3469('0x4')]();var fs_extra=require(_0x3469('0x5'));var auth=require(_0x3469('0x6'));var interaction=require(_0x3469('0x7'));var config=require(_0x3469('0x8'));var controller=require(_0x3469('0x9'));router['get']('/',auth[_0x3469('0xa')](),controller['index']);router[_0x3469('0xb')](_0x3469('0xc'),auth[_0x3469('0xa')](),controller['show']);router[_0x3469('0xd')]('/',auth[_0x3469('0xa')](),controller['create']);router[_0x3469('0xe')]('/:id',auth[_0x3469('0xa')](),controller[_0x3469('0xf')]);router[_0x3469('0x10')](_0x3469('0xc'),auth[_0x3469('0xa')](),controller[_0x3469('0x11')]);module['exports']=router;
\ No newline at end of file
index ff2531e..8ce8fab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xece1=['STRING','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','moment','sequelize','exports'];(function(_0x4aa45e,_0x40cb2d){var _0x1852bc=function(_0x50330c){while(--_0x50330c){_0x4aa45e['push'](_0x4aa45e['shift']());}};_0x1852bc(++_0x40cb2d);}(_0xece1,0x1ad));var _0x1ece=function(_0x1c8f7c,_0x126967){_0x1c8f7c=_0x1c8f7c-0x0;var _0x47e45a=_0xece1[_0x1c8f7c];return _0x47e45a;};'use strict';var moment=require(_0x1ece('0x0'));var Sequelize=require(_0x1ece('0x1'));module[_0x1ece('0x2')]={'phone':{'type':Sequelize[_0x1ece('0x3')],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x1ece('0x4')](_0x1ece('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x1ece('0x6')](0x2)[_0x1ece('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x1ece('0x6')],'unique':_0x1ece('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x1ece('0x8')},'UserId':{'type':Sequelize[_0x1ece('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x1ece('0x8')},'CampaignId':{'type':Sequelize[_0x1ece('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x1ece('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1ece('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1ece('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1ece('0x6')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xf134=['moment','exports','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','contactListQueue'];(function(_0x52085a,_0x3717ca){var _0x5afc1a=function(_0x2aa175){while(--_0x2aa175){_0x52085a['push'](_0x52085a['shift']());}};_0x5afc1a(++_0x3717ca);}(_0xf134,0x13b));var _0x4f13=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0xf134[_0x5608a3];return _0x1ed50a;};'use strict';var moment=require(_0x4f13('0x0'));var Sequelize=require('sequelize');module[_0x4f13('0x1')]={'phone':{'type':Sequelize[_0x4f13('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x4f13('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x4f13('0x4')],'defaultValue':moment()[_0x4f13('0x5')](_0x4f13('0x6'))},'countbusyretry':{'type':Sequelize[_0x4f13('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4f13('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4f13('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x4f13('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x4f13('0x4')]},'priority':{'type':Sequelize[_0x4f13('0x7')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x4f13('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x4f13('0x7')],'unique':_0x4f13('0x8')},'ListId':{'type':Sequelize[_0x4f13('0x7')],'unique':_0x4f13('0x8')},'UserId':{'type':Sequelize[_0x4f13('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x4f13('0x7')],'unique':_0x4f13('0x8')},'CampaignId':{'type':Sequelize[_0x4f13('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x4f13('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4f13('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x4f13('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4f13('0x7')],'defaultValue':0x0}};
\ No newline at end of file
index 0b3cd89..1292d3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6de3=['ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','LOCK','Contact','CmCompany','CmList','List','VoiceQueue','Queue','dialActive','getVoiceQueues','error','CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','sendStatus','end','json','undefined','count','limit','status','set','Content-Range','save','update','then','destroy','stack','name','send','index','CmHopper','rawAttributes','fieldName','type','key','model','map','query','keys','filters','concat','$and','$gt','$gte','$lte','$ne','$not','$between','$notBetween','$like','$notLike','$iLike','$notILike','$overlap','$contained','$any','attributes','intersection','fields','length','offset','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','include','find','create','body','params','VoiceQueueId','CampaignId','Campaign','dataValues','createdAt','state','statedesc','deleted','campaign','membername','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','CmHopperFinal','describe','user','outbound','dialOrderByScheduledAt','sequelize','direction','hopperIds'];(function(_0x44ce77,_0x49b532){var _0x1181b6=function(_0x59823b){while(--_0x59823b){_0x44ce77['push'](_0x44ce77['shift']());}};_0x1181b6(++_0x49b532);}(_0x6de3,0x1ae));var _0x36de=function(_0x4af9e2,_0x59517b){_0x4af9e2=_0x4af9e2-0x0;var _0x698469=_0x6de3[_0x4af9e2];return _0x698469;};'use strict';var emlformat=require(_0x36de('0x0'));var rimraf=require(_0x36de('0x1'));var zipdir=require(_0x36de('0x2'));var jsonpatch=require(_0x36de('0x3'));var rp=require(_0x36de('0x4'));var moment=require('moment');var BPromise=require(_0x36de('0x5'));var Mustache=require(_0x36de('0x6'));var util=require(_0x36de('0x7'));var path=require('path');var sox=require(_0x36de('0x8'));var csv=require('to-csv');var ejs=require(_0x36de('0x9'));var fs=require('fs');var fs_extra=require(_0x36de('0xa'));var _=require(_0x36de('0xb'));var squel=require('squel');var crypto=require(_0x36de('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x36de('0xd'));var toCsv=require(_0x36de('0xe'));var querystring=require('querystring');var Papa=require(_0x36de('0xf'));var Redis=require(_0x36de('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x36de('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x36de('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x36de('0x13'));var licenseUtil=require(_0x36de('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28ab1e,_0x1cf7a0){_0x1cf7a0=_0x1cf7a0||0xcc;return function(_0x4e6a53){if(_0x4e6a53){return _0x28ab1e[_0x36de('0x15')](_0x1cf7a0);}return _0x28ab1e['status'](_0x1cf7a0)[_0x36de('0x16')]();};}function respondWithResult(_0x5ba0d2,_0x499608){_0x499608=_0x499608||0xc8;return function(_0x5f39c3){if(_0x5f39c3){return _0x5ba0d2['status'](_0x499608)[_0x36de('0x17')](_0x5f39c3);}};}function respondWithFilteredResult(_0x5051ed,_0x31a7e1){return function(_0x13cbf6){if(_0x13cbf6){var _0x50e06e=typeof _0x31a7e1['offset']===_0x36de('0x18')&&typeof _0x31a7e1['limit']===_0x36de('0x18');var _0x50d213=_0x13cbf6[_0x36de('0x19')];var _0x3f3f09=_0x50e06e?0x0:_0x31a7e1['offset'];var _0x393b52=_0x50e06e?_0x13cbf6[_0x36de('0x19')]:_0x31a7e1['offset']+_0x31a7e1[_0x36de('0x1a')];var _0x497612;if(_0x393b52>=_0x50d213){_0x393b52=_0x50d213;_0x497612=0xc8;}else{_0x497612=0xce;}_0x5051ed[_0x36de('0x1b')](_0x497612);return _0x5051ed[_0x36de('0x1c')](_0x36de('0x1d'),_0x3f3f09+'-'+_0x393b52+'/'+_0x50d213)['json'](_0x13cbf6);}return null;};}function patchUpdates(_0x3a7a12){return function(_0x326cfb){try{jsonpatch['apply'](_0x326cfb,_0x3a7a12,!![]);}catch(_0x1b01f0){return BPromise['reject'](_0x1b01f0);}return _0x326cfb[_0x36de('0x1e')]();};}function saveUpdates(_0x3ba32e,_0x28d81e){return function(_0x3fc3f9){if(_0x3fc3f9){return _0x3fc3f9[_0x36de('0x1f')](_0x3ba32e)[_0x36de('0x20')](function(_0x5498f0){return _0x5498f0;});}return null;};}function removeEntity(_0x4801e6,_0x434c74){return function(_0x46c112){if(_0x46c112){return _0x46c112[_0x36de('0x21')]()[_0x36de('0x20')](function(){_0x4801e6['status'](0xcc)[_0x36de('0x16')]();});}};}function handleEntityNotFound(_0x355160,_0x2f0e18){return function(_0x4e61f1){if(!_0x4e61f1){_0x355160['sendStatus'](0x194);}return _0x4e61f1;};}function handleError(_0x5e4cec,_0x4223d6){_0x4223d6=_0x4223d6||0x1f4;return function(_0x380b77){logger['error'](_0x380b77[_0x36de('0x22')]);if(_0x380b77[_0x36de('0x23')]){delete _0x380b77[_0x36de('0x23')];}_0x5e4cec[_0x36de('0x1b')](_0x4223d6)[_0x36de('0x24')](_0x380b77);};}exports[_0x36de('0x25')]=function(_0x536047,_0x2a81aa){var _0x1c3ac9={},_0x4f2057={},_0x448771={'count':0x0,'rows':[]};var _0x818e1b=_['map'](db[_0x36de('0x26')][_0x36de('0x27')],function(_0xea0ff0){return{'name':_0xea0ff0[_0x36de('0x28')],'type':_0xea0ff0[_0x36de('0x29')][_0x36de('0x2a')]};});_0x4f2057[_0x36de('0x2b')]=_[_0x36de('0x2c')](_0x818e1b,_0x36de('0x23'));_0x4f2057[_0x36de('0x2d')]=_[_0x36de('0x2e')](_0x536047[_0x36de('0x2d')]);_0x4f2057[_0x36de('0x2f')]=_['intersection'](_0x4f2057[_0x36de('0x2b')],_0x4f2057['query']);_0x4f2057[_0x36de('0x2f')]=_[_0x36de('0x30')](_0x4f2057[_0x36de('0x2f')],[_0x36de('0x31'),'$or',_0x36de('0x32'),_0x36de('0x33'),'$lt',_0x36de('0x34'),_0x36de('0x35'),'$eq',_0x36de('0x36'),_0x36de('0x37'),_0x36de('0x38'),'$in','$notIn',_0x36de('0x39'),_0x36de('0x3a'),_0x36de('0x3b'),_0x36de('0x3c'),_0x36de('0x39'),_0x36de('0x3d'),'$contains',_0x36de('0x3e'),_0x36de('0x3f')]);_0x1c3ac9[_0x36de('0x40')]=_[_0x36de('0x41')](_0x4f2057[_0x36de('0x2b')],qs[_0x36de('0x42')](_0x536047[_0x36de('0x2d')][_0x36de('0x42')]));_0x1c3ac9['attributes']=_0x1c3ac9[_0x36de('0x40')][_0x36de('0x43')]?_0x1c3ac9[_0x36de('0x40')]:_0x4f2057[_0x36de('0x2b')];if(!_0x536047[_0x36de('0x2d')]['hasOwnProperty']('nolimit')){_0x1c3ac9['limit']=qs[_0x36de('0x1a')](_0x536047[_0x36de('0x2d')]['limit']);_0x1c3ac9[_0x36de('0x44')]=qs[_0x36de('0x44')](_0x536047[_0x36de('0x2d')][_0x36de('0x44')]);}_0x1c3ac9['order']=qs[_0x36de('0x45')](_0x536047['query'][_0x36de('0x45')]);_0x1c3ac9[_0x36de('0x46')]=qs[_0x36de('0x2f')](_[_0x36de('0x47')](_0x536047[_0x36de('0x2d')],_0x4f2057['filters']),_0x818e1b);if(_0x536047[_0x36de('0x2d')]['filter']){_0x1c3ac9[_0x36de('0x46')]=_[_0x36de('0x48')](_0x1c3ac9[_0x36de('0x46')],{'$or':_[_0x36de('0x2c')](_0x818e1b,function(_0x33b648){if(_0x33b648['type']!==_0x36de('0x49')){var _0x4a95fe={};_0x4a95fe[_0x33b648[_0x36de('0x23')]]={'$like':'%'+_0x536047[_0x36de('0x2d')][_0x36de('0x4a')]+'%'};return _0x4a95fe;}})});}_0x1c3ac9=_[_0x36de('0x48')]({},_0x1c3ac9,_0x536047[_0x36de('0x4b')]);var _0x592d66={'where':_0x1c3ac9[_0x36de('0x46')]};return db[_0x36de('0x26')][_0x36de('0x19')](_0x592d66)[_0x36de('0x20')](function(_0x4f0964){_0x448771[_0x36de('0x19')]=_0x4f0964;if(_0x536047[_0x36de('0x2d')][_0x36de('0x4c')]){_0x1c3ac9['include']=[{'all':!![]}];}return db[_0x36de('0x26')][_0x36de('0x4d')](_0x1c3ac9);})['then'](function(_0xc28121){_0x448771[_0x36de('0x4e')]=_0xc28121;return _0x448771;})[_0x36de('0x20')](respondWithFilteredResult(_0x2a81aa,_0x1c3ac9))[_0x36de('0x4f')](handleError(_0x2a81aa,null));};exports[_0x36de('0x50')]=function(_0x556a50,_0xf9ad28){var _0x151a40={'raw':!![],'where':{'id':_0x556a50['params']['id']}},_0x401eb0={};_0x401eb0[_0x36de('0x2b')]=_[_0x36de('0x2e')](db[_0x36de('0x26')][_0x36de('0x27')]);_0x401eb0[_0x36de('0x2d')]=_[_0x36de('0x2e')](_0x556a50[_0x36de('0x2d')]);_0x401eb0['filters']=_[_0x36de('0x41')](_0x401eb0[_0x36de('0x2b')],_0x401eb0[_0x36de('0x2d')]);_0x151a40[_0x36de('0x40')]=_[_0x36de('0x41')](_0x401eb0[_0x36de('0x2b')],qs[_0x36de('0x42')](_0x556a50[_0x36de('0x2d')][_0x36de('0x42')]));_0x151a40[_0x36de('0x40')]=_0x151a40[_0x36de('0x40')][_0x36de('0x43')]?_0x151a40[_0x36de('0x40')]:_0x401eb0[_0x36de('0x2b')];if(_0x556a50['query'][_0x36de('0x4c')]){_0x151a40[_0x36de('0x51')]=[{'all':!![]}];}_0x151a40=_[_0x36de('0x48')]({},_0x151a40,_0x556a50[_0x36de('0x4b')]);return db[_0x36de('0x26')][_0x36de('0x52')](_0x151a40)[_0x36de('0x20')](handleEntityNotFound(_0xf9ad28,null))['then'](respondWithResult(_0xf9ad28,null))[_0x36de('0x4f')](handleError(_0xf9ad28,null));};exports[_0x36de('0x53')]=function(_0x4921a6,_0x2f4f58){return db[_0x36de('0x26')][_0x36de('0x53')](_0x4921a6[_0x36de('0x54')],{})['then'](respondWithResult(_0x2f4f58,0xc9))[_0x36de('0x4f')](handleError(_0x2f4f58,null));};exports[_0x36de('0x1f')]=function(_0xd4d2c8,_0x26c835){if(_0xd4d2c8[_0x36de('0x54')]['id']){delete _0xd4d2c8[_0x36de('0x54')]['id'];}return db[_0x36de('0x26')][_0x36de('0x52')]({'where':{'id':_0xd4d2c8['params']['id']}})[_0x36de('0x20')](handleEntityNotFound(_0x26c835,null))[_0x36de('0x20')](saveUpdates(_0xd4d2c8[_0x36de('0x54')],null))['then'](respondWithResult(_0x26c835,null))[_0x36de('0x4f')](handleError(_0x26c835,null));};exports['describe']=function(_0x45feb3,_0x1020c9){return db['CmHopper']['describe']()[_0x36de('0x20')](respondWithResult(_0x1020c9,null))[_0x36de('0x4f')](handleError(_0x1020c9,null));};exports[_0x36de('0x21')]=function(_0x113082,_0x1f11c0){var _0x20363a;return db[_0x36de('0x26')][_0x36de('0x52')]({'where':{'id':_0x113082[_0x36de('0x55')]['id']}})['then'](handleEntityNotFound(_0x1f11c0,null))['then'](function(_0x4a5d8b){if(_0x4a5d8b){return _0x4a5d8b[_0x36de('0x21')]()['then'](function(_0x56cc10){return _0x56cc10;});}})['then'](function(_0x4ebb23){_0x20363a=_0x4ebb23;if(_0x4ebb23){if(_0x4ebb23[_0x36de('0x56')]||_0x4ebb23[_0x36de('0x57')]){return db[_0x4ebb23[_0x36de('0x56')]?'VoiceQueue':_0x36de('0x58')][_0x36de('0x52')]({'where':{'id':_0x4ebb23[_0x36de('0x56')]?_0x4ebb23[_0x36de('0x56')]:_0x4ebb23[_0x36de('0x57')]},'attributes':['id','name'],'raw':!![]});}}})[_0x36de('0x20')](function(_0x50c878){var _0x25a800={};if(_0x50c878){_[_0x36de('0x48')](_0x25a800,_['omit'](_0x20363a[_0x36de('0x59')],[_0x36de('0x5a'),'updatedAt','id']));_0x25a800[_0x36de('0x5b')]=0x15;_0x25a800[_0x36de('0x5c')]=_0x36de('0x5d');_0x25a800[_0x36de('0x5e')]=_0x50c878[_0x36de('0x23')];_0x25a800[_0x36de('0x5f')]=_0x113082['user'][_0x36de('0x23')];_0x25a800[_0x36de('0x60')]=_0x113082['user']['id'];_0x25a800[_0x36de('0x5d')]=!![];_0x25a800[_0x36de('0x61')]=moment()[_0x36de('0x62')](_0x36de('0x63'));_0x25a800['calleridnum']=_0x20363a[_0x36de('0x64')];_0x25a800[_0x36de('0x65')]=_0x20363a['VoiceQueueId']?'queue':_0x36de('0x66');return db[_0x36de('0x67')][_0x36de('0x52')]({'where':{'id':_0x25a800[_0x36de('0x68')]},'attributes':[_0x36de('0x69'),_0x36de('0x6a')]})[_0x36de('0x20')](function(_0x3fb79c){if(!_[_0x36de('0x6b')](_0x1f11c0)&&!_[_0x36de('0x6b')](_0x3fb79c[_0x36de('0x69')])){_0x25a800[_0x36de('0x6c')]=_0x3fb79c[_0x36de('0x69')];if(!_[_0x36de('0x6b')](_0x3fb79c[_0x36de('0x6a')])){_0x25a800[_0x36de('0x6c')]+='\x20'+_0x3fb79c[_0x36de('0x6a')];}}})[_0x36de('0x6d')](function(){return db[_0x36de('0x6e')][_0x36de('0x53')](_0x25a800);});}})[_0x36de('0x20')](function(){return _0x1f11c0[_0x36de('0x1b')](0xcc)['end']();})[_0x36de('0x4f')](handleError(_0x1f11c0,null));};exports['getPreview']=function(_0x3b585c,_0x247c5b,_0x1dc7e9){var _0x56efcb=[];return db[_0x36de('0x67')][_0x36de('0x6f')]()[_0x36de('0x20')](function(_0x1a4ba3){_0x56efcb=_[_0x36de('0x2e')](_0x1a4ba3);return _0x3b585c[_0x36de('0x70')]['getVoiceQueues']({'where':{'type':_0x36de('0x71'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0x36de('0x72')],'raw':!![]});})[_0x36de('0x20')](function(_0x5eb010){if(_0x5eb010&&_0x5eb010[_0x36de('0x43')]){return db[_0x36de('0x73')]['transaction'](function(_0x27b2cf){var _0x7287ef={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x36de('0x62')](_0x36de('0x63'))},'VoiceQueueId':{'$in':_[_0x36de('0x2c')](_0x5eb010,'id')},'$or':[{'UserId':null},{'UserId':_0x3b585c[_0x36de('0x70')]['id']}]};var _0x30f68a=[];if(_0x3b585c[_0x36de('0x54')]['direction']&&_0x3b585c['body'][_0x36de('0x74')]==='prev'){if(!_['isEmpty'](_0x3b585c[_0x36de('0x54')]['hopperIds'])){_0x7287ef['id']={'$in':_0x3b585c[_0x36de('0x54')][_0x36de('0x75')]};}_0x30f68a=[['priority',_0x36de('0x76')],[_0x36de('0x77'),_0x5eb010[0x0][_0x36de('0x72')]===_0x36de('0x76')?_0x36de('0x78'):_0x36de('0x76')],db['sequelize'][_0x36de('0x79')](_0x36de('0x7a')),['id',_0x36de('0x78')]];}else{if(!_[_0x36de('0x7b')](_0x3b585c['body'][_0x36de('0x75')])){_0x7287ef['id']={'$notIn':_0x3b585c[_0x36de('0x54')][_0x36de('0x75')]};}_0x30f68a=[['priority','DESC'],['scheduledAt',_0x5eb010[0x0][_0x36de('0x72')]],db['sequelize']['literal']('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0x36de('0x26')]['findOne']({'attributes':['id','scheduledat'],'where':_0x7287ef,'order':_0x30f68a,'transaction':_0x27b2cf,'lock':_0x27b2cf[_0x36de('0x7c')]['UPDATE'],'include':[{'model':db[_0x36de('0x67')],'as':_0x36de('0x7d'),'attributes':_0x56efcb,'include':[{'model':db[_0x36de('0x7e')],'as':'Company','attributes':['id','name']}]},{'model':db[_0x36de('0x7f')],'as':_0x36de('0x80'),'attributes':['id','name']},{'model':db[_0x36de('0x81')],'as':_0x36de('0x82'),'attributes':['id','name',_0x36de('0x83')]}]})[_0x36de('0x20')](function(_0x313b29){if(_0x313b29){return _0x313b29['update']({'UserId':_0x3b585c[_0x36de('0x70')]['id']},{'transaction':_0x27b2cf});}});});}})[_0x36de('0x20')](handleEntityNotFound(_0x247c5b,null))[_0x36de('0x20')](respondWithResult(_0x247c5b,null))['catch'](handleError(_0x247c5b,null));};exports['getOpenContacts']=function(_0x2e83e7,_0x25fcf1,_0x560059){return _0x2e83e7[_0x36de('0x70')][_0x36de('0x84')]({'where':{'type':_0x36de('0x71'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x36de('0x20')](function(_0x2e3f90){if(_0x2e3f90&&_0x2e3f90['length']){return db['CmHopper'][_0x36de('0x19')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x36de('0x62')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x36de('0x2c')](_0x2e3f90,'id')},'$or':[{'UserId':null},{'UserId':_0x2e83e7['user']['id']}]}});}return 0x0;})[_0x36de('0x20')](function(_0x4d3bc7){if(!_['isNil'](_0x4d3bc7)&&_['isNumber'](_0x4d3bc7)){return _0x25fcf1['status'](0xc8)[_0x36de('0x17')]({'contacts':_0x4d3bc7});}else{logger[_0x36de('0x85')](_0x36de('0x86'),_0x36de('0x87'),0x194,_0x36de('0x88'));_0x25fcf1[_0x36de('0x15')](0x194);}})['catch'](handleError(_0x25fcf1,null));};
\ No newline at end of file
+var _0xcec2=['rawAttributes','fieldName','key','model','keys','filters','query','concat','$and','$or','$lte','$ne','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$contains','$contained','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','omit','dataValues','updatedAt','membername','UserId','user','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','lastName','isNil','firstName','CmHopperFinal','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','sequelize','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','LOCK','CmCompany','Company','List','dialActive','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','CmHopper'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0xcec2,0xed));var _0x2cec=function(_0x34fece,_0x17e9cf){_0x34fece=_0x34fece-0x0;var _0x2ca2e6=_0xcec2[_0x34fece];return _0x2ca2e6;};'use strict';var emlformat=require(_0x2cec('0x0'));var rimraf=require(_0x2cec('0x1'));var zipdir=require(_0x2cec('0x2'));var jsonpatch=require(_0x2cec('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2cec('0x4'));var Mustache=require('mustache');var util=require(_0x2cec('0x5'));var path=require(_0x2cec('0x6'));var sox=require(_0x2cec('0x7'));var csv=require('to-csv');var ejs=require(_0x2cec('0x8'));var fs=require('fs');var fs_extra=require(_0x2cec('0x9'));var _=require(_0x2cec('0xa'));var squel=require(_0x2cec('0xb'));var crypto=require(_0x2cec('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x2cec('0xd'));var querystring=require('querystring');var Papa=require(_0x2cec('0xe'));var Redis=require(_0x2cec('0xf'));var authService=require(_0x2cec('0x10'));var qs=require(_0x2cec('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2cec('0x12'))(_0x2cec('0x13'));var utils=require('../../config/utils');var config=require(_0x2cec('0x14'));var licenseUtil=require(_0x2cec('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1915c2,_0x1422bf){_0x1422bf=_0x1422bf||0xcc;return function(_0x473ecb){if(_0x473ecb){return _0x1915c2[_0x2cec('0x16')](_0x1422bf);}return _0x1915c2['status'](_0x1422bf)[_0x2cec('0x17')]();};}function respondWithResult(_0x48ec7b,_0x565d8d){_0x565d8d=_0x565d8d||0xc8;return function(_0x1388b2){if(_0x1388b2){return _0x48ec7b[_0x2cec('0x18')](_0x565d8d)[_0x2cec('0x19')](_0x1388b2);}};}function respondWithFilteredResult(_0x5af1d8,_0xaf2dbf){return function(_0x108fd3){if(_0x108fd3){var _0x5216c3=typeof _0xaf2dbf['offset']===_0x2cec('0x1a')&&typeof _0xaf2dbf[_0x2cec('0x1b')]===_0x2cec('0x1a');var _0xa46596=_0x108fd3[_0x2cec('0x1c')];var _0xf5d7a8=_0x5216c3?0x0:_0xaf2dbf[_0x2cec('0x1d')];var _0x15e546=_0x5216c3?_0x108fd3[_0x2cec('0x1c')]:_0xaf2dbf[_0x2cec('0x1d')]+_0xaf2dbf['limit'];var _0x2ea8bb;if(_0x15e546>=_0xa46596){_0x15e546=_0xa46596;_0x2ea8bb=0xc8;}else{_0x2ea8bb=0xce;}_0x5af1d8['status'](_0x2ea8bb);return _0x5af1d8[_0x2cec('0x1e')](_0x2cec('0x1f'),_0xf5d7a8+'-'+_0x15e546+'/'+_0xa46596)[_0x2cec('0x19')](_0x108fd3);}return null;};}function patchUpdates(_0x828fb6){return function(_0x6dd7fd){try{jsonpatch[_0x2cec('0x20')](_0x6dd7fd,_0x828fb6,!![]);}catch(_0x2bff46){return BPromise[_0x2cec('0x21')](_0x2bff46);}return _0x6dd7fd[_0x2cec('0x22')]();};}function saveUpdates(_0x2da402,_0x269b36){return function(_0x23b1b2){if(_0x23b1b2){return _0x23b1b2[_0x2cec('0x23')](_0x2da402)[_0x2cec('0x24')](function(_0x11000f){return _0x11000f;});}return null;};}function removeEntity(_0x33e343,_0x778316){return function(_0x504740){if(_0x504740){return _0x504740['destroy']()[_0x2cec('0x24')](function(){_0x33e343['status'](0xcc)[_0x2cec('0x17')]();});}};}function handleEntityNotFound(_0xacd1d7,_0x42c28b){return function(_0x59c3b6){if(!_0x59c3b6){_0xacd1d7[_0x2cec('0x16')](0x194);}return _0x59c3b6;};}function handleError(_0x3af04a,_0x58f35d){_0x58f35d=_0x58f35d||0x1f4;return function(_0x39f83e){logger[_0x2cec('0x25')](_0x39f83e[_0x2cec('0x26')]);if(_0x39f83e[_0x2cec('0x27')]){delete _0x39f83e[_0x2cec('0x27')];}_0x3af04a[_0x2cec('0x18')](_0x58f35d)[_0x2cec('0x28')](_0x39f83e);};}exports['index']=function(_0xac059a,_0x5a00cd){var _0x77d614={},_0x5be9d8={},_0x3037aa={'count':0x0,'rows':[]};var _0x1a0ea2=_[_0x2cec('0x29')](db[_0x2cec('0x2a')][_0x2cec('0x2b')],function(_0x1fa0de){return{'name':_0x1fa0de[_0x2cec('0x2c')],'type':_0x1fa0de['type'][_0x2cec('0x2d')]};});_0x5be9d8[_0x2cec('0x2e')]=_[_0x2cec('0x29')](_0x1a0ea2,_0x2cec('0x27'));_0x5be9d8['query']=_[_0x2cec('0x2f')](_0xac059a['query']);_0x5be9d8[_0x2cec('0x30')]=_['intersection'](_0x5be9d8[_0x2cec('0x2e')],_0x5be9d8[_0x2cec('0x31')]);_0x5be9d8[_0x2cec('0x30')]=_[_0x2cec('0x32')](_0x5be9d8[_0x2cec('0x30')],[_0x2cec('0x33'),_0x2cec('0x34'),'$gt','$gte','$lt',_0x2cec('0x35'),_0x2cec('0x36'),'$eq',_0x2cec('0x37'),_0x2cec('0x38'),_0x2cec('0x39'),_0x2cec('0x3a'),_0x2cec('0x3b'),_0x2cec('0x3c'),_0x2cec('0x3d'),_0x2cec('0x3e'),_0x2cec('0x3f'),_0x2cec('0x3c'),'$overlap',_0x2cec('0x40'),_0x2cec('0x41'),'$any']);_0x77d614['attributes']=_[_0x2cec('0x42')](_0x5be9d8[_0x2cec('0x2e')],qs[_0x2cec('0x43')](_0xac059a[_0x2cec('0x31')][_0x2cec('0x43')]));_0x77d614[_0x2cec('0x44')]=_0x77d614['attributes'][_0x2cec('0x45')]?_0x77d614[_0x2cec('0x44')]:_0x5be9d8[_0x2cec('0x2e')];if(!_0xac059a['query'][_0x2cec('0x46')](_0x2cec('0x47'))){_0x77d614[_0x2cec('0x1b')]=qs[_0x2cec('0x1b')](_0xac059a[_0x2cec('0x31')][_0x2cec('0x1b')]);_0x77d614[_0x2cec('0x1d')]=qs[_0x2cec('0x1d')](_0xac059a[_0x2cec('0x31')][_0x2cec('0x1d')]);}_0x77d614['order']=qs[_0x2cec('0x48')](_0xac059a[_0x2cec('0x31')][_0x2cec('0x48')]);_0x77d614['where']=qs[_0x2cec('0x30')](_[_0x2cec('0x49')](_0xac059a[_0x2cec('0x31')],_0x5be9d8[_0x2cec('0x30')]),_0x1a0ea2);if(_0xac059a[_0x2cec('0x31')][_0x2cec('0x4a')]){_0x77d614[_0x2cec('0x4b')]=_[_0x2cec('0x4c')](_0x77d614[_0x2cec('0x4b')],{'$or':_['map'](_0x1a0ea2,function(_0x1899e5){if(_0x1899e5[_0x2cec('0x4d')]!==_0x2cec('0x4e')){var _0x7a6744={};_0x7a6744[_0x1899e5[_0x2cec('0x27')]]={'$like':'%'+_0xac059a[_0x2cec('0x31')]['filter']+'%'};return _0x7a6744;}})});}_0x77d614=_[_0x2cec('0x4c')]({},_0x77d614,_0xac059a[_0x2cec('0x4f')]);var _0x5a4d52={'where':_0x77d614[_0x2cec('0x4b')]};return db['CmHopper']['count'](_0x5a4d52)[_0x2cec('0x24')](function(_0x1dc264){_0x3037aa['count']=_0x1dc264;if(_0xac059a[_0x2cec('0x31')][_0x2cec('0x50')]){_0x77d614['include']=[{'all':!![]}];}return db['CmHopper'][_0x2cec('0x51')](_0x77d614);})[_0x2cec('0x24')](function(_0x41506e){_0x3037aa[_0x2cec('0x52')]=_0x41506e;return _0x3037aa;})[_0x2cec('0x24')](respondWithFilteredResult(_0x5a00cd,_0x77d614))[_0x2cec('0x53')](handleError(_0x5a00cd,null));};exports[_0x2cec('0x54')]=function(_0x31113f,_0x4ab929){var _0x3f2af5={'raw':!![],'where':{'id':_0x31113f[_0x2cec('0x55')]['id']}},_0x3a951b={};_0x3a951b[_0x2cec('0x2e')]=_['keys'](db['CmHopper'][_0x2cec('0x2b')]);_0x3a951b[_0x2cec('0x31')]=_[_0x2cec('0x2f')](_0x31113f[_0x2cec('0x31')]);_0x3a951b[_0x2cec('0x30')]=_[_0x2cec('0x42')](_0x3a951b[_0x2cec('0x2e')],_0x3a951b[_0x2cec('0x31')]);_0x3f2af5['attributes']=_[_0x2cec('0x42')](_0x3a951b[_0x2cec('0x2e')],qs[_0x2cec('0x43')](_0x31113f[_0x2cec('0x31')][_0x2cec('0x43')]));_0x3f2af5[_0x2cec('0x44')]=_0x3f2af5[_0x2cec('0x44')][_0x2cec('0x45')]?_0x3f2af5['attributes']:_0x3a951b[_0x2cec('0x2e')];if(_0x31113f[_0x2cec('0x31')][_0x2cec('0x50')]){_0x3f2af5[_0x2cec('0x56')]=[{'all':!![]}];}_0x3f2af5=_[_0x2cec('0x4c')]({},_0x3f2af5,_0x31113f[_0x2cec('0x4f')]);return db[_0x2cec('0x2a')][_0x2cec('0x57')](_0x3f2af5)['then'](handleEntityNotFound(_0x4ab929,null))[_0x2cec('0x24')](respondWithResult(_0x4ab929,null))[_0x2cec('0x53')](handleError(_0x4ab929,null));};exports[_0x2cec('0x58')]=function(_0x4989dc,_0x1c429a){return db[_0x2cec('0x2a')][_0x2cec('0x58')](_0x4989dc[_0x2cec('0x59')],{})[_0x2cec('0x24')](respondWithResult(_0x1c429a,0xc9))[_0x2cec('0x53')](handleError(_0x1c429a,null));};exports[_0x2cec('0x23')]=function(_0x478100,_0x1fa442){if(_0x478100['body']['id']){delete _0x478100[_0x2cec('0x59')]['id'];}return db[_0x2cec('0x2a')]['find']({'where':{'id':_0x478100[_0x2cec('0x55')]['id']}})['then'](handleEntityNotFound(_0x1fa442,null))[_0x2cec('0x24')](saveUpdates(_0x478100[_0x2cec('0x59')],null))[_0x2cec('0x24')](respondWithResult(_0x1fa442,null))['catch'](handleError(_0x1fa442,null));};exports[_0x2cec('0x5a')]=function(_0xb6bb22,_0x253c05){return db[_0x2cec('0x2a')][_0x2cec('0x5a')]()[_0x2cec('0x24')](respondWithResult(_0x253c05,null))[_0x2cec('0x53')](handleError(_0x253c05,null));};exports[_0x2cec('0x5b')]=function(_0x9c2e02,_0x4216ee){var _0x32ab93;return db[_0x2cec('0x2a')][_0x2cec('0x57')]({'where':{'id':_0x9c2e02[_0x2cec('0x55')]['id']}})['then'](handleEntityNotFound(_0x4216ee,null))[_0x2cec('0x24')](function(_0x47374a){if(_0x47374a){return _0x47374a[_0x2cec('0x5b')]()[_0x2cec('0x24')](function(_0x606bc){return _0x606bc;});}})[_0x2cec('0x24')](function(_0x877280){_0x32ab93=_0x877280;if(_0x877280){if(_0x877280[_0x2cec('0x5c')]||_0x877280[_0x2cec('0x5d')]){return db[_0x877280[_0x2cec('0x5c')]?_0x2cec('0x5e'):'Campaign'][_0x2cec('0x57')]({'where':{'id':_0x877280[_0x2cec('0x5c')]?_0x877280[_0x2cec('0x5c')]:_0x877280[_0x2cec('0x5d')]},'attributes':['id',_0x2cec('0x27')],'raw':!![]});}}})[_0x2cec('0x24')](function(_0x1c739b){var _0x391135={};if(_0x1c739b){_[_0x2cec('0x4c')](_0x391135,_[_0x2cec('0x5f')](_0x32ab93[_0x2cec('0x60')],['createdAt',_0x2cec('0x61'),'id']));_0x391135['state']=0x15;_0x391135['statedesc']='deleted';_0x391135['campaign']=_0x1c739b[_0x2cec('0x27')];_0x391135[_0x2cec('0x62')]=_0x9c2e02['user'][_0x2cec('0x27')];_0x391135[_0x2cec('0x63')]=_0x9c2e02[_0x2cec('0x64')]['id'];_0x391135['deleted']=!![];_0x391135['deletedat']=moment()[_0x2cec('0x65')](_0x2cec('0x66'));_0x391135[_0x2cec('0x67')]=_0x32ab93[_0x2cec('0x68')];_0x391135[_0x2cec('0x69')]=_0x32ab93[_0x2cec('0x5c')]?_0x2cec('0x6a'):_0x2cec('0x6b');return db[_0x2cec('0x6c')][_0x2cec('0x57')]({'where':{'id':_0x391135['ContactId']},'attributes':['firstName',_0x2cec('0x6d')]})[_0x2cec('0x24')](function(_0x483d1a){if(!_[_0x2cec('0x6e')](_0x4216ee)&&!_[_0x2cec('0x6e')](_0x483d1a[_0x2cec('0x6f')])){_0x391135['calleridname']=_0x483d1a[_0x2cec('0x6f')];if(!_['isNil'](_0x483d1a[_0x2cec('0x6d')])){_0x391135['calleridname']+='\x20'+_0x483d1a[_0x2cec('0x6d')];}}})['finally'](function(){return db[_0x2cec('0x70')][_0x2cec('0x58')](_0x391135);});}})['then'](function(){return _0x4216ee[_0x2cec('0x18')](0xcc)[_0x2cec('0x17')]();})['catch'](handleError(_0x4216ee,null));};exports['getPreview']=function(_0x3eb7d9,_0x14f078,_0x203b09){var _0x2c0ae8=[];return db[_0x2cec('0x6c')][_0x2cec('0x5a')]()[_0x2cec('0x24')](function(_0x4f8722){_0x2c0ae8=_[_0x2cec('0x2f')](_0x4f8722);return _0x3eb7d9[_0x2cec('0x64')][_0x2cec('0x71')]({'where':{'type':_0x2cec('0x72'),'dialActive':!![],'dialMethod':_0x2cec('0x73')},'attributes':['id',_0x2cec('0x74')],'raw':!![]});})['then'](function(_0x22c0f9){if(_0x22c0f9&&_0x22c0f9[_0x2cec('0x45')]){return db['sequelize'][_0x2cec('0x75')](function(_0x2db6ad){var _0x1987a6={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x2cec('0x66'))},'VoiceQueueId':{'$in':_['map'](_0x22c0f9,'id')},'$or':[{'UserId':null},{'UserId':_0x3eb7d9[_0x2cec('0x64')]['id']}]};var _0x3c6de4=[];if(_0x3eb7d9[_0x2cec('0x59')]['direction']&&_0x3eb7d9[_0x2cec('0x59')][_0x2cec('0x76')]===_0x2cec('0x77')){if(!_[_0x2cec('0x78')](_0x3eb7d9[_0x2cec('0x59')][_0x2cec('0x79')])){_0x1987a6['id']={'$in':_0x3eb7d9['body']['hopperIds']};}_0x3c6de4=[[_0x2cec('0x7a'),_0x2cec('0x7b')],[_0x2cec('0x7c'),_0x22c0f9[0x0]['dialOrderByScheduledAt']===_0x2cec('0x7b')?_0x2cec('0x7d'):_0x2cec('0x7b')],db['sequelize'][_0x2cec('0x7e')](_0x2cec('0x7f')),['id',_0x2cec('0x7d')]];}else{if(!_[_0x2cec('0x78')](_0x3eb7d9[_0x2cec('0x59')]['hopperIds'])){_0x1987a6['id']={'$notIn':_0x3eb7d9['body'][_0x2cec('0x79')]};}_0x3c6de4=[['priority',_0x2cec('0x7d')],[_0x2cec('0x7c'),_0x22c0f9[0x0][_0x2cec('0x74')]],db[_0x2cec('0x80')][_0x2cec('0x7e')](_0x2cec('0x81')),['id',_0x2cec('0x7b')]];}return db['CmHopper'][_0x2cec('0x82')]({'attributes':['id','scheduledat'],'where':_0x1987a6,'order':_0x3c6de4,'transaction':_0x2db6ad,'lock':_0x2db6ad[_0x2cec('0x83')]['UPDATE'],'include':[{'model':db[_0x2cec('0x6c')],'as':'Contact','attributes':_0x2c0ae8,'include':[{'model':db[_0x2cec('0x84')],'as':_0x2cec('0x85'),'attributes':['id',_0x2cec('0x27')]}]},{'model':db['CmList'],'as':_0x2cec('0x86'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id',_0x2cec('0x27'),_0x2cec('0x87')]}]})[_0x2cec('0x24')](function(_0x125f2c){if(_0x125f2c){return _0x125f2c['update']({'UserId':_0x3eb7d9[_0x2cec('0x64')]['id']},{'transaction':_0x2db6ad});}});});}})[_0x2cec('0x24')](handleEntityNotFound(_0x14f078,null))[_0x2cec('0x24')](respondWithResult(_0x14f078,null))[_0x2cec('0x53')](handleError(_0x14f078,null));};exports[_0x2cec('0x88')]=function(_0x2e1a7b,_0x335664,_0x53c566){return _0x2e1a7b[_0x2cec('0x64')][_0x2cec('0x71')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x2cec('0x73')},'attributes':['id'],'raw':!![]})[_0x2cec('0x24')](function(_0x34ab15){if(_0x34ab15&&_0x34ab15['length']){return db[_0x2cec('0x2a')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x2cec('0x29')](_0x34ab15,'id')},'$or':[{'UserId':null},{'UserId':_0x2e1a7b[_0x2cec('0x64')]['id']}]}});}return 0x0;})[_0x2cec('0x24')](function(_0x3fdfcd){if(!_['isNil'](_0x3fdfcd)&&_[_0x2cec('0x89')](_0x3fdfcd)){return _0x335664['status'](0xc8)[_0x2cec('0x19')]({'contacts':_0x3fdfcd});}else{logger[_0x2cec('0x25')](_0x2cec('0x8a'),_0x2cec('0x88'),0x194,_0x2cec('0x8b'));_0x335664[_0x2cec('0x16')](0x194);}})[_0x2cec('0x53')](handleError(_0x335664,null));};
\ No newline at end of file
index ddbb11d..8656c3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6ac=['./cmHopper.attributes','exports','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x2e0c8e,_0x50384a){_0x2e0c8e=_0x2e0c8e-0x0;var _0x50b92e=_0xc6ac[_0x2e0c8e];return _0x50b92e;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var logger=require(_0xcc6a('0x2'))(_0xcc6a('0x3'));var moment=require(_0xcc6a('0x4'));var BPromise=require(_0xcc6a('0x5'));var rp=require(_0xcc6a('0x6'));var fs=require('fs');var path=require(_0xcc6a('0x7'));var rimraf=require(_0xcc6a('0x8'));var config=require(_0xcc6a('0x9'));var attributes=require(_0xcc6a('0xa'));module[_0xcc6a('0xb')]=function(_0x12330e,_0x197bd7){return _0x12330e['define'](_0xcc6a('0xc'),attributes,{'tableName':_0xcc6a('0xd'),'paranoid':![],'indexes':[{'name':_0xcc6a('0xe'),'fields':['scheduledat']},{'name':_0xcc6a('0xf'),'fields':[_0xcc6a('0xf')]},{'name':_0xcc6a('0x10'),'fields':[_0xcc6a('0x10')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xe3da=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','priority','lodash','util','../../config/logger'];(function(_0x4080bd,_0x1680da){var _0x55aa34=function(_0x5f7294){while(--_0x5f7294){_0x4080bd['push'](_0x4080bd['shift']());}};_0x55aa34(++_0x1680da);}(_0xe3da,0x1cd));var _0xae3d=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xe3da[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var logger=require(_0xae3d('0x2'))(_0xae3d('0x3'));var moment=require(_0xae3d('0x4'));var BPromise=require(_0xae3d('0x5'));var rp=require(_0xae3d('0x6'));var fs=require('fs');var path=require(_0xae3d('0x7'));var rimraf=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var attributes=require(_0xae3d('0xa'));module[_0xae3d('0xb')]=function(_0xa9a1a,_0xa54808){return _0xa9a1a[_0xae3d('0xc')](_0xae3d('0xd'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0xae3d('0xe'),'fields':[_0xae3d('0xe')]},{'name':'phone','fields':['phone']},{'name':_0xae3d('0xf'),'fields':[_0xae3d('0xf')]}],'timestamps':!![]});};
\ No newline at end of file
index 3c347e7..fe6420c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8a5=['debug','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CmHopper','findAll','options','raw','attributes','limit','map','include','model','GetCmHopper','ShowCmHopper','where','create','body','CreateCmHopper','UpdateCmHopper','update','DestroyCmHopper','sequelize','transaction','order','LOCK','UPDATE','CmContact','Contact','Agent','name','voicePause','length','push','includes','all','GetContactDialer','MoveContactManagedDialer','CmHopperFinal','destroy','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','GetContactRecallMe','describe','UserId','GetCmHopperPreview','keys','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','CmHopper,\x20%s,\x20%s'];(function(_0x5437d5,_0x33294a){var _0x41af82=function(_0x4b0cd1){while(--_0x4b0cd1){_0x5437d5['push'](_0x5437d5['shift']());}};_0x41af82(++_0x33294a);}(_0xd8a5,0x10b));var _0x5d8a=function(_0x4f156f,_0x1d0655){_0x4f156f=_0x4f156f-0x0;var _0x2de4e1=_0xd8a5[_0x4f156f];return _0x2de4e1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5d8a('0x0'));var BPromise=require(_0x5d8a('0x1'));var rs=require(_0x5d8a('0x2'));var fs=require('fs');var Redis=require(_0x5d8a('0x3'));var db=require(_0x5d8a('0x4'))['db'];var utils=require(_0x5d8a('0x5'));var logger=require(_0x5d8a('0x6'))('rpc');var config=require(_0x5d8a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5d8a('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1792ec,_0x4886c1,_0x5b4633){return new BPromise(function(_0x539681,_0x34695d){return client[_0x5d8a('0x9')](_0x1792ec,_0x5b4633)[_0x5d8a('0xa')](function(_0x3b3863){logger[_0x5d8a('0xb')](_0x5d8a('0xc'),_0x4886c1,'request\x20sent');logger[_0x5d8a('0xd')](_0x5d8a('0xe'),_0x4886c1,_0x5d8a('0xf'),JSON[_0x5d8a('0x10')](_0x3b3863));if(_0x3b3863[_0x5d8a('0x11')]){if(_0x3b3863[_0x5d8a('0x11')][_0x5d8a('0x12')]===0x1f4){logger[_0x5d8a('0x11')](_0x5d8a('0xc'),_0x4886c1,_0x3b3863[_0x5d8a('0x11')][_0x5d8a('0x13')]);return _0x34695d(_0x3b3863[_0x5d8a('0x11')][_0x5d8a('0x13')]);}logger['error'](_0x5d8a('0xc'),_0x4886c1,_0x3b3863[_0x5d8a('0x11')]['message']);return _0x539681(_0x3b3863['error']['message']);}else{logger[_0x5d8a('0xb')](_0x5d8a('0xc'),_0x4886c1,_0x5d8a('0xf'));_0x539681(_0x3b3863[_0x5d8a('0x14')][_0x5d8a('0x13')]);}})[_0x5d8a('0x15')](function(_0x413316){logger['error'](_0x5d8a('0xc'),_0x4886c1,_0x413316);_0x34695d(_0x413316);});});}exports['GetCmHopper']=function(_0x1eafff){var _0x4e0aaf=this;return new Promise(function(_0x40d6f1,_0x5e593b){return db[_0x5d8a('0x16')][_0x5d8a('0x17')]({'raw':_0x1eafff[_0x5d8a('0x18')]?_0x1eafff[_0x5d8a('0x18')][_0x5d8a('0x19')]===undefined?!![]:![]:!![],'where':_0x1eafff[_0x5d8a('0x18')]?_0x1eafff[_0x5d8a('0x18')]['where']||null:null,'attributes':_0x1eafff['options']?_0x1eafff['options'][_0x5d8a('0x1a')]||null:null,'limit':_0x1eafff['options']?_0x1eafff['options'][_0x5d8a('0x1b')]||null:null,'include':_0x1eafff[_0x5d8a('0x18')]?_0x1eafff[_0x5d8a('0x18')]['include']?_[_0x5d8a('0x1c')](_0x1eafff[_0x5d8a('0x18')][_0x5d8a('0x1d')],function(_0x42cc33){return{'model':db[_0x42cc33[_0x5d8a('0x1e')]],'as':_0x42cc33['as'],'attributes':_0x42cc33[_0x5d8a('0x1a')],'include':_0x42cc33[_0x5d8a('0x1d')]?_[_0x5d8a('0x1c')](_0x42cc33[_0x5d8a('0x1d')],function(_0x39aa67){return{'model':db[_0x39aa67[_0x5d8a('0x1e')]],'as':_0x39aa67['as'],'attributes':_0x39aa67['attributes'],'include':_0x39aa67[_0x5d8a('0x1d')]?_[_0x5d8a('0x1c')](_0x39aa67[_0x5d8a('0x1d')],function(_0x45334b){return{'model':db[_0x45334b['model']],'as':_0x45334b['as'],'attributes':_0x45334b['attributes']};}):[]};}):[]};}):[]:[]})[_0x5d8a('0xa')](function(_0x1ff9f1){logger[_0x5d8a('0xb')](_0x5d8a('0x1f'),_0x1eafff);logger[_0x5d8a('0xd')](_0x5d8a('0x1f'),_0x1eafff,JSON[_0x5d8a('0x10')](_0x1ff9f1));_0x40d6f1(_0x1ff9f1);})[_0x5d8a('0x15')](function(_0x4d72aa){logger['error']('GetCmHopper',_0x4d72aa['message'],_0x1eafff);_0x5e593b(_0x4e0aaf['error'](0x1f4,_0x4d72aa[_0x5d8a('0x13')]));});});};exports[_0x5d8a('0x20')]=function(_0x2a22fd){var _0x191776=this;return new Promise(function(_0xb92e5f,_0x45ac02){return db['CmHopper']['find']({'raw':_0x2a22fd[_0x5d8a('0x18')]?_0x2a22fd[_0x5d8a('0x18')][_0x5d8a('0x19')]===undefined?!![]:![]:!![],'where':_0x2a22fd[_0x5d8a('0x18')]?_0x2a22fd[_0x5d8a('0x18')][_0x5d8a('0x21')]||null:null,'attributes':_0x2a22fd[_0x5d8a('0x18')]?_0x2a22fd['options']['attributes']||null:null,'include':_0x2a22fd[_0x5d8a('0x18')]?_0x2a22fd['options'][_0x5d8a('0x1d')]?_[_0x5d8a('0x1c')](_0x2a22fd['options'][_0x5d8a('0x1d')],function(_0xe07472){return{'model':db[_0xe07472[_0x5d8a('0x1e')]],'as':_0xe07472['as'],'attributes':_0xe07472[_0x5d8a('0x1a')],'include':_0xe07472[_0x5d8a('0x1d')]?_[_0x5d8a('0x1c')](_0xe07472[_0x5d8a('0x1d')],function(_0x37a715){return{'model':db[_0x37a715[_0x5d8a('0x1e')]],'as':_0x37a715['as'],'attributes':_0x37a715[_0x5d8a('0x1a')],'include':_0x37a715['include']?_[_0x5d8a('0x1c')](_0x37a715['include'],function(_0x5659ff){return{'model':db[_0x5659ff['model']],'as':_0x5659ff['as'],'attributes':_0x5659ff[_0x5d8a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5d8a('0xa')](function(_0xc70fab){logger['info'](_0x5d8a('0x20'),_0x2a22fd);logger['debug']('ShowCmHopper',_0x2a22fd,JSON[_0x5d8a('0x10')](_0xc70fab));_0xb92e5f(_0xc70fab);})[_0x5d8a('0x15')](function(_0x3605a0){logger['error'](_0x5d8a('0x20'),_0x3605a0[_0x5d8a('0x13')],_0x2a22fd);_0x45ac02(_0x191776[_0x5d8a('0x11')](0x1f4,_0x3605a0[_0x5d8a('0x13')]));});});};exports['CreateCmHopper']=function(_0x23ef01){var _0x49c1e9=this;return new Promise(function(_0xb18049,_0x132f08){return db[_0x5d8a('0x16')][_0x5d8a('0x22')](_0x23ef01[_0x5d8a('0x23')],{'raw':_0x23ef01[_0x5d8a('0x18')]?_0x23ef01[_0x5d8a('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x5d8a('0xa')](function(_0xaaaf7d){logger[_0x5d8a('0xb')](_0x5d8a('0x24'),_0x23ef01);logger[_0x5d8a('0xd')](_0x5d8a('0x24'),_0x23ef01,JSON[_0x5d8a('0x10')](_0xaaaf7d));_0xb18049(_0xaaaf7d);})[_0x5d8a('0x15')](function(_0x1058aa){logger[_0x5d8a('0x11')](_0x5d8a('0x24'),_0x1058aa['message'],_0x23ef01);_0x132f08(_0x49c1e9[_0x5d8a('0x11')](0x1f4,_0x1058aa[_0x5d8a('0x13')]));});});};exports[_0x5d8a('0x25')]=function(_0x4b6bf6){var _0x17b364=this;return new Promise(function(_0x44807c,_0x11a597){return db[_0x5d8a('0x16')][_0x5d8a('0x26')](_0x4b6bf6[_0x5d8a('0x23')],{'raw':_0x4b6bf6[_0x5d8a('0x18')]?_0x4b6bf6[_0x5d8a('0x18')][_0x5d8a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b6bf6['options']?_0x4b6bf6[_0x5d8a('0x18')][_0x5d8a('0x21')]||null:null,'attributes':_0x4b6bf6[_0x5d8a('0x18')]?_0x4b6bf6[_0x5d8a('0x18')][_0x5d8a('0x1a')]||null:null,'limit':_0x4b6bf6[_0x5d8a('0x18')]?_0x4b6bf6['options']['limit']||null:null})[_0x5d8a('0xa')](function(_0x26a567){logger['info']('UpdateCmHopper',_0x4b6bf6);logger[_0x5d8a('0xd')](_0x5d8a('0x25'),_0x4b6bf6,JSON[_0x5d8a('0x10')](_0x26a567));_0x44807c(_0x26a567);})[_0x5d8a('0x15')](function(_0x3cc96d){logger[_0x5d8a('0x11')]('UpdateCmHopper',_0x3cc96d[_0x5d8a('0x13')],_0x4b6bf6);_0x11a597(_0x17b364[_0x5d8a('0x11')](0x1f4,_0x3cc96d[_0x5d8a('0x13')]));});});};exports['DestroyCmHopper']=function(_0x2d73ac){var _0x3efd0f=this;return new Promise(function(_0x56941a,_0x46148f){return db[_0x5d8a('0x16')]['destroy']({'where':_0x2d73ac[_0x5d8a('0x18')]?_0x2d73ac['options']['where']||null:null})['then'](function(_0x3dc13a){logger[_0x5d8a('0xb')]('DestroyCmHopper',_0x2d73ac);logger[_0x5d8a('0xd')](_0x5d8a('0x27'),_0x2d73ac,JSON[_0x5d8a('0x10')](_0x3dc13a));_0x56941a(_0x3dc13a);})[_0x5d8a('0x15')](function(_0xba3fdf){logger['error']('DestroyCmHopper',_0xba3fdf[_0x5d8a('0x13')],_0x2d73ac);_0x46148f(_0x3efd0f[_0x5d8a('0x11')](0x1f4,_0xba3fdf['message']));});});};exports['GetContactDialer']=function(_0x15fe11){var _0x3cb41a=this;return new Promise(function(_0x2bfa02,_0x66b70){return db['CmContact']['describe']()[_0x5d8a('0xa')](function(_0x941ea5){return db[_0x5d8a('0x28')][_0x5d8a('0x29')](function(_0x352676){return db[_0x5d8a('0x16')][_0x5d8a('0x17')]({'where':_0x15fe11[_0x5d8a('0x18')]?_0x15fe11[_0x5d8a('0x18')][_0x5d8a('0x21')]||null:null,'attributes':_0x15fe11[_0x5d8a('0x18')]?_0x15fe11[_0x5d8a('0x18')][_0x5d8a('0x1a')]||null:null,'limit':_0x15fe11[_0x5d8a('0x18')]?_0x15fe11[_0x5d8a('0x18')][_0x5d8a('0x1b')]||null:null,'order':_0x15fe11[_0x5d8a('0x18')]?_0x15fe11[_0x5d8a('0x18')][_0x5d8a('0x2a')]||null:null,'transaction':_0x352676,'lock':_0x352676[_0x5d8a('0x2b')][_0x5d8a('0x2c')],'include':[{'model':db[_0x5d8a('0x2d')],'as':_0x5d8a('0x2e'),'attributes':_['keys'](_0x941ea5)},{'model':db['User'],'as':_0x5d8a('0x2f'),'attributes':['id',_0x5d8a('0x30'),_0x5d8a('0x31')]}]})[_0x5d8a('0xa')](function(_0x3b5966){var _0xb21929=[];var _0x57547d=[];for(var _0x5b182a=0x0;_0x5b182a<_0x3b5966[_0x5d8a('0x32')];_0x5b182a+=0x1){var _0x66d0f3=_0x3b5966[_0x5b182a]['UserId'];if(_0x66d0f3===null){_0xb21929[_0x5d8a('0x33')](_0x3b5966[_0x5b182a][_0x5d8a('0x26')](_0x15fe11[_0x5d8a('0x23')],{'transaction':_0x352676}));}else if(!_0x57547d[_0x5d8a('0x34')](_0x66d0f3)){_0x57547d[_0x5d8a('0x33')](_0x66d0f3);_0xb21929[_0x5d8a('0x33')](_0x3b5966[_0x5b182a][_0x5d8a('0x26')](_0x15fe11[_0x5d8a('0x23')],{'transaction':_0x352676}));}}return BPromise[_0x5d8a('0x35')](_0xb21929);});})[_0x5d8a('0xa')](function(_0x13244a){logger[_0x5d8a('0xb')](_0x5d8a('0x36'),_0x15fe11);logger[_0x5d8a('0xd')]('GetContactDialer',_0x15fe11,JSON[_0x5d8a('0x10')](_0x13244a));_0x2bfa02(_0x13244a);})[_0x5d8a('0x15')](function(_0x3f2aba){logger[_0x5d8a('0x11')](_0x5d8a('0x36'),_0x3f2aba[_0x5d8a('0x13')],_0x15fe11);_0x66b70(_0x3cb41a[_0x5d8a('0x11')](0x1f4,_0x3f2aba[_0x5d8a('0x13')]));});});});};exports[_0x5d8a('0x37')]=function(_0x18c7c4){var _0x26698c=this;return new Promise(function(_0x468e58,_0x15e4ab){return db[_0x5d8a('0x28')][_0x5d8a('0x29')](function(_0x31b324){return db[_0x5d8a('0x38')]['create'](_0x18c7c4[_0x5d8a('0x23')],{'raw':_0x18c7c4[_0x5d8a('0x18')]?_0x18c7c4[_0x5d8a('0x18')][_0x5d8a('0x19')]===undefined?!![]:![]:!![],'transaction':_0x31b324})[_0x5d8a('0xa')](function(){return db['CmHopper'][_0x5d8a('0x39')]({'where':_0x18c7c4[_0x5d8a('0x18')]?_0x18c7c4[_0x5d8a('0x18')][_0x5d8a('0x21')]||null:null,'transaction':_0x31b324});});})[_0x5d8a('0xa')](function(_0x336414){logger[_0x5d8a('0xb')](_0x5d8a('0x37'),_0x18c7c4);logger[_0x5d8a('0xd')]('MoveContactManagedDialer',_0x18c7c4,JSON['stringify'](_0x336414));_0x468e58(_0x336414);})[_0x5d8a('0x15')](function(_0x1d4e49){logger[_0x5d8a('0x11')](_0x5d8a('0x37'),_0x1d4e49[_0x5d8a('0x13')],_0x18c7c4);_0x15e4ab(_0x26698c['error'](0x1f4,_0x1d4e49['message']));});});};exports[_0x5d8a('0x3a')]=function(_0x51239a){var _0x43847b=this;return new Promise(function(_0x1c0d6b,_0x3add13){return db[_0x5d8a('0x16')][_0x5d8a('0x17')]({'raw':_0x51239a[_0x5d8a('0x18')]?_0x51239a[_0x5d8a('0x18')][_0x5d8a('0x19')]===undefined?!![]:![]:!![],'where':_0x51239a['options']?_0x51239a['options'][_0x5d8a('0x21')]||null:null,'attributes':[[db[_0x5d8a('0x28')]['fn'](_0x5d8a('0x3b'),db['sequelize']['fn']('IF',db[_0x5d8a('0x28')][_0x5d8a('0x3c')](_0x5d8a('0x3d')+util[_0x5d8a('0x3e')](_0x5d8a('0x3f'),moment()['format'](_0x5d8a('0x40')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})[_0x5d8a('0xa')](function(_0x218561){logger[_0x5d8a('0xb')](_0x5d8a('0x3a'),_0x51239a);logger[_0x5d8a('0xd')]('CountReScheduled',_0x51239a,JSON[_0x5d8a('0x10')](_0x218561));_0x1c0d6b(_0x218561);})[_0x5d8a('0x15')](function(_0x388963){logger['error'](_0x5d8a('0x3a'),_0x388963[_0x5d8a('0x13')],_0x51239a);_0x3add13(_0x43847b[_0x5d8a('0x11')](0x1f4,_0x388963[_0x5d8a('0x13')]));});});};exports[_0x5d8a('0x41')]=function(_0xc2bce8){var _0x45ecdf=this;return new Promise(function(_0x59b854,_0x99d8f0){return db[_0x5d8a('0x2d')][_0x5d8a('0x42')]()['then'](function(_0xf576be){return db[_0x5d8a('0x28')][_0x5d8a('0x29')](function(_0x446474){return db['CmHopper'][_0x5d8a('0x17')]({'where':_0xc2bce8[_0x5d8a('0x18')]?_0xc2bce8['options']['where']||null:null,'attributes':_0xc2bce8['options']?_0xc2bce8['options'][_0x5d8a('0x1a')]||null:null,'limit':0x1,'order':_0xc2bce8[_0x5d8a('0x18')]?_0xc2bce8[_0x5d8a('0x18')]['order']||null:null,'group':db['CmHopper'][_0x5d8a('0x43')],'transaction':_0x446474,'lock':_0x446474['LOCK'][_0x5d8a('0x2c')],'include':_0xc2bce8[_0x5d8a('0x18')]?_0xc2bce8[_0x5d8a('0x18')][_0x5d8a('0x1d')]?_[_0x5d8a('0x1c')](_0xc2bce8[_0x5d8a('0x18')][_0x5d8a('0x1d')],function(_0x1cf04f){return{'model':db[_0x1cf04f[_0x5d8a('0x1e')]],'as':_0x1cf04f['as'],'attributes':_0x1cf04f[_0x5d8a('0x1a')],'include':_0x1cf04f[_0x5d8a('0x1d')]?_[_0x5d8a('0x1c')](_0x1cf04f[_0x5d8a('0x1d')],function(_0x1396e4){return{'model':db[_0x1396e4[_0x5d8a('0x1e')]],'as':_0x1396e4['as'],'attributes':_0x1396e4[_0x5d8a('0x1a')],'include':_0x1396e4[_0x5d8a('0x1d')]?_[_0x5d8a('0x1c')](_0x1396e4['include'],function(_0x34850c){return{'model':db[_0x34850c[_0x5d8a('0x1e')]],'as':_0x34850c['as'],'attributes':_0x34850c[_0x5d8a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5d8a('0xa')](function(_0x464046){var _0x132840=[];for(var _0x3f5d0c=0x0;_0x3f5d0c<_0x464046[_0x5d8a('0x32')];_0x3f5d0c+=0x1){_0x132840[_0x5d8a('0x33')](_0x464046[_0x3f5d0c][_0x5d8a('0x26')](_0xc2bce8['body'],{'transaction':_0x446474}));}return BPromise[_0x5d8a('0x35')](_0x132840);});})[_0x5d8a('0xa')](function(_0x2b0eb6){logger[_0x5d8a('0xb')](_0x5d8a('0x41'),_0xc2bce8);logger[_0x5d8a('0xd')](_0x5d8a('0x41'),_0xc2bce8,JSON['stringify'](_0x2b0eb6));_0x59b854(_0x2b0eb6);})[_0x5d8a('0x15')](function(_0x27d2e2){logger[_0x5d8a('0x11')](_0x5d8a('0x41'),_0x27d2e2[_0x5d8a('0x13')],_0xc2bce8);_0x99d8f0(_0x45ecdf[_0x5d8a('0x11')](0x1f4,_0x27d2e2[_0x5d8a('0x13')]));});});});};exports[_0x5d8a('0x44')]=function(_0x290094){var _0x4cd90f=this;return new Promise(function(_0x255097,_0x4a3472){db[_0x5d8a('0x2d')][_0x5d8a('0x42')]()[_0x5d8a('0xa')](function(_0x54d98a){return db[_0x5d8a('0x16')][_0x5d8a('0x17')]({'raw':_0x290094['options']?_0x290094['options'][_0x5d8a('0x19')]===undefined?!![]:![]:!![],'where':_0x290094[_0x5d8a('0x18')]?_0x290094[_0x5d8a('0x18')][_0x5d8a('0x21')]||null:null,'attributes':_0x290094[_0x5d8a('0x18')]?_0x290094[_0x5d8a('0x18')][_0x5d8a('0x1a')]||null:null,'limit':_0x290094[_0x5d8a('0x18')]?_0x290094['options'][_0x5d8a('0x1b')]||null:null,'include':_0x290094[_0x5d8a('0x18')]?_0x290094[_0x5d8a('0x18')][_0x5d8a('0x1d')]?_[_0x5d8a('0x1c')](_0x290094['options'][_0x5d8a('0x1d')],function(_0x39a96f){return{'model':db[_0x39a96f[_0x5d8a('0x1e')]],'as':_0x39a96f['as'],'attributes':_0x39a96f['as']===_0x5d8a('0x2e')?_[_0x5d8a('0x45')](_0x54d98a):_0x39a96f[_0x5d8a('0x1a')],'include':_0x39a96f[_0x5d8a('0x1d')]?_[_0x5d8a('0x1c')](_0x39a96f[_0x5d8a('0x1d')],function(_0x22f9e2){return{'model':db[_0x22f9e2[_0x5d8a('0x1e')]],'as':_0x22f9e2['as'],'attributes':_0x22f9e2[_0x5d8a('0x1a')],'include':_0x22f9e2['include']?_[_0x5d8a('0x1c')](_0x22f9e2[_0x5d8a('0x1d')],function(_0x1096da){return{'model':db[_0x1096da[_0x5d8a('0x1e')]],'as':_0x1096da['as'],'attributes':_0x1096da[_0x5d8a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5d8a('0xa')](function(_0x2d11f8){logger[_0x5d8a('0xb')]('GetCmHopper',_0x290094);logger['debug'](_0x5d8a('0x1f'),_0x290094,JSON['stringify'](_0x2d11f8));_0x255097(_0x2d11f8);})[_0x5d8a('0x15')](function(_0x1fea40){logger[_0x5d8a('0x11')](_0x5d8a('0x1f'),_0x1fea40[_0x5d8a('0x13')],_0x290094);_0x4a3472(_0x4cd90f[_0x5d8a('0x11')](0x1f4,_0x1fea40['message']));});});});};
\ No newline at end of file
+var _0x447c=['debug','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','include','map','model','ShowCmHopper','find','CreateCmHopper','create','body','UpdateCmHopper','update','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','limit','LOCK','UPDATE','Contact','keys','User','name','voicePause','length','UserId','push','includes','all','CmHopperFinal','destroy','MoveContactManagedDialer','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','GetContactRecallMe','GetCmHopperPreview','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','CmHopper,\x20%s,\x20%s'];(function(_0xde3afb,_0x832cc7){var _0x5266f0=function(_0xc43aa2){while(--_0xc43aa2){_0xde3afb['push'](_0xde3afb['shift']());}};_0x5266f0(++_0x832cc7);}(_0x447c,0x80));var _0xc447=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x447c[_0x4e676e];return _0x336a3c;};'use strict';var _=require('lodash');var util=require(_0xc447('0x0'));var moment=require(_0xc447('0x1'));var BPromise=require(_0xc447('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc447('0x3'));var db=require(_0xc447('0x4'))['db'];var utils=require(_0xc447('0x5'));var logger=require(_0xc447('0x6'))('rpc');var config=require(_0xc447('0x7'));var jayson=require(_0xc447('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x258df0,_0x1d19a5,_0x2a0c7b){return new BPromise(function(_0x39061f,_0x3c3795){return client['request'](_0x258df0,_0x2a0c7b)[_0xc447('0x9')](function(_0x236cf0){logger[_0xc447('0xa')](_0xc447('0xb'),_0x1d19a5,'request\x20sent');logger[_0xc447('0xc')](_0xc447('0xd'),_0x1d19a5,_0xc447('0xe'),JSON[_0xc447('0xf')](_0x236cf0));if(_0x236cf0[_0xc447('0x10')]){if(_0x236cf0[_0xc447('0x10')][_0xc447('0x11')]===0x1f4){logger[_0xc447('0x10')](_0xc447('0xb'),_0x1d19a5,_0x236cf0[_0xc447('0x10')][_0xc447('0x12')]);return _0x3c3795(_0x236cf0[_0xc447('0x10')][_0xc447('0x12')]);}logger['error'](_0xc447('0xb'),_0x1d19a5,_0x236cf0[_0xc447('0x10')][_0xc447('0x12')]);return _0x39061f(_0x236cf0['error'][_0xc447('0x12')]);}else{logger[_0xc447('0xa')](_0xc447('0xb'),_0x1d19a5,'request\x20sent');_0x39061f(_0x236cf0['result'][_0xc447('0x12')]);}})[_0xc447('0x13')](function(_0x2c4d6b){logger['error'](_0xc447('0xb'),_0x1d19a5,_0x2c4d6b);_0x3c3795(_0x2c4d6b);});});}exports[_0xc447('0x14')]=function(_0x507fe4){var _0x411a79=this;return new Promise(function(_0x3dd3f2,_0x465c42){return db[_0xc447('0x15')][_0xc447('0x16')]({'raw':_0x507fe4[_0xc447('0x17')]?_0x507fe4[_0xc447('0x17')][_0xc447('0x18')]===undefined?!![]:![]:!![],'where':_0x507fe4[_0xc447('0x17')]?_0x507fe4[_0xc447('0x17')][_0xc447('0x19')]||null:null,'attributes':_0x507fe4[_0xc447('0x17')]?_0x507fe4[_0xc447('0x17')][_0xc447('0x1a')]||null:null,'limit':_0x507fe4[_0xc447('0x17')]?_0x507fe4[_0xc447('0x17')]['limit']||null:null,'include':_0x507fe4[_0xc447('0x17')]?_0x507fe4['options'][_0xc447('0x1b')]?_[_0xc447('0x1c')](_0x507fe4[_0xc447('0x17')][_0xc447('0x1b')],function(_0x435e39){return{'model':db[_0x435e39['model']],'as':_0x435e39['as'],'attributes':_0x435e39[_0xc447('0x1a')],'include':_0x435e39[_0xc447('0x1b')]?_[_0xc447('0x1c')](_0x435e39['include'],function(_0x27ff00){return{'model':db[_0x27ff00[_0xc447('0x1d')]],'as':_0x27ff00['as'],'attributes':_0x27ff00[_0xc447('0x1a')],'include':_0x27ff00[_0xc447('0x1b')]?_[_0xc447('0x1c')](_0x27ff00[_0xc447('0x1b')],function(_0x360913){return{'model':db[_0x360913[_0xc447('0x1d')]],'as':_0x360913['as'],'attributes':_0x360913[_0xc447('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc447('0x9')](function(_0x442860){logger['info'](_0xc447('0x14'),_0x507fe4);logger[_0xc447('0xc')](_0xc447('0x14'),_0x507fe4,JSON[_0xc447('0xf')](_0x442860));_0x3dd3f2(_0x442860);})['catch'](function(_0x3c2156){logger[_0xc447('0x10')](_0xc447('0x14'),_0x3c2156[_0xc447('0x12')],_0x507fe4);_0x465c42(_0x411a79['error'](0x1f4,_0x3c2156[_0xc447('0x12')]));});});};exports[_0xc447('0x1e')]=function(_0x1681a8){var _0x36da29=this;return new Promise(function(_0x2de84e,_0x1b9cd1){return db[_0xc447('0x15')][_0xc447('0x1f')]({'raw':_0x1681a8['options']?_0x1681a8[_0xc447('0x17')][_0xc447('0x18')]===undefined?!![]:![]:!![],'where':_0x1681a8[_0xc447('0x17')]?_0x1681a8[_0xc447('0x17')][_0xc447('0x19')]||null:null,'attributes':_0x1681a8['options']?_0x1681a8['options'][_0xc447('0x1a')]||null:null,'include':_0x1681a8[_0xc447('0x17')]?_0x1681a8[_0xc447('0x17')][_0xc447('0x1b')]?_[_0xc447('0x1c')](_0x1681a8[_0xc447('0x17')][_0xc447('0x1b')],function(_0x46a172){return{'model':db[_0x46a172[_0xc447('0x1d')]],'as':_0x46a172['as'],'attributes':_0x46a172[_0xc447('0x1a')],'include':_0x46a172[_0xc447('0x1b')]?_['map'](_0x46a172[_0xc447('0x1b')],function(_0x1e78a6){return{'model':db[_0x1e78a6[_0xc447('0x1d')]],'as':_0x1e78a6['as'],'attributes':_0x1e78a6[_0xc447('0x1a')],'include':_0x1e78a6[_0xc447('0x1b')]?_[_0xc447('0x1c')](_0x1e78a6[_0xc447('0x1b')],function(_0x5125d8){return{'model':db[_0x5125d8[_0xc447('0x1d')]],'as':_0x5125d8['as'],'attributes':_0x5125d8['attributes']};}):[]};}):[]};}):[]:[]})[_0xc447('0x9')](function(_0x2a8964){logger[_0xc447('0xa')](_0xc447('0x1e'),_0x1681a8);logger[_0xc447('0xc')]('ShowCmHopper',_0x1681a8,JSON[_0xc447('0xf')](_0x2a8964));_0x2de84e(_0x2a8964);})[_0xc447('0x13')](function(_0x3520e6){logger[_0xc447('0x10')](_0xc447('0x1e'),_0x3520e6[_0xc447('0x12')],_0x1681a8);_0x1b9cd1(_0x36da29[_0xc447('0x10')](0x1f4,_0x3520e6[_0xc447('0x12')]));});});};exports[_0xc447('0x20')]=function(_0x155365){var _0x197c8a=this;return new Promise(function(_0x416af0,_0x1c1304){return db[_0xc447('0x15')][_0xc447('0x21')](_0x155365[_0xc447('0x22')],{'raw':_0x155365[_0xc447('0x17')]?_0x155365[_0xc447('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xc447('0x9')](function(_0x503caf){logger[_0xc447('0xa')](_0xc447('0x20'),_0x155365);logger[_0xc447('0xc')](_0xc447('0x20'),_0x155365,JSON[_0xc447('0xf')](_0x503caf));_0x416af0(_0x503caf);})[_0xc447('0x13')](function(_0x414d29){logger['error'](_0xc447('0x20'),_0x414d29[_0xc447('0x12')],_0x155365);_0x1c1304(_0x197c8a[_0xc447('0x10')](0x1f4,_0x414d29[_0xc447('0x12')]));});});};exports[_0xc447('0x23')]=function(_0x17af9e){var _0xc34ff7=this;return new Promise(function(_0x22c7be,_0x30e136){return db[_0xc447('0x15')][_0xc447('0x24')](_0x17af9e['body'],{'raw':_0x17af9e['options']?_0x17af9e[_0xc447('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17af9e['options']?_0x17af9e[_0xc447('0x17')][_0xc447('0x19')]||null:null,'attributes':_0x17af9e[_0xc447('0x17')]?_0x17af9e[_0xc447('0x17')]['attributes']||null:null,'limit':_0x17af9e[_0xc447('0x17')]?_0x17af9e['options']['limit']||null:null})[_0xc447('0x9')](function(_0xe226aa){logger[_0xc447('0xa')](_0xc447('0x23'),_0x17af9e);logger['debug'](_0xc447('0x23'),_0x17af9e,JSON[_0xc447('0xf')](_0xe226aa));_0x22c7be(_0xe226aa);})['catch'](function(_0x22106c){logger['error'](_0xc447('0x23'),_0x22106c['message'],_0x17af9e);_0x30e136(_0xc34ff7[_0xc447('0x10')](0x1f4,_0x22106c[_0xc447('0x12')]));});});};exports[_0xc447('0x25')]=function(_0x213614){var _0x3f67bf=this;return new Promise(function(_0x4fb9ab,_0x5862c1){return db[_0xc447('0x15')]['destroy']({'where':_0x213614['options']?_0x213614['options'][_0xc447('0x19')]||null:null})[_0xc447('0x9')](function(_0x172275){logger[_0xc447('0xa')](_0xc447('0x25'),_0x213614);logger[_0xc447('0xc')](_0xc447('0x25'),_0x213614,JSON[_0xc447('0xf')](_0x172275));_0x4fb9ab(_0x172275);})[_0xc447('0x13')](function(_0x1cf8c5){logger[_0xc447('0x10')](_0xc447('0x25'),_0x1cf8c5[_0xc447('0x12')],_0x213614);_0x5862c1(_0x3f67bf[_0xc447('0x10')](0x1f4,_0x1cf8c5[_0xc447('0x12')]));});});};exports[_0xc447('0x26')]=function(_0x483615){var _0x3b5c7c=this;return new Promise(function(_0x53fcb7,_0x3c50a7){return db[_0xc447('0x27')][_0xc447('0x28')]()[_0xc447('0x9')](function(_0x23bca7){return db[_0xc447('0x29')][_0xc447('0x2a')](function(_0x181e0e){return db[_0xc447('0x15')][_0xc447('0x16')]({'where':_0x483615[_0xc447('0x17')]?_0x483615[_0xc447('0x17')][_0xc447('0x19')]||null:null,'attributes':_0x483615[_0xc447('0x17')]?_0x483615[_0xc447('0x17')][_0xc447('0x1a')]||null:null,'limit':_0x483615['options']?_0x483615[_0xc447('0x17')][_0xc447('0x2b')]||null:null,'order':_0x483615['options']?_0x483615['options']['order']||null:null,'transaction':_0x181e0e,'lock':_0x181e0e[_0xc447('0x2c')][_0xc447('0x2d')],'include':[{'model':db[_0xc447('0x27')],'as':_0xc447('0x2e'),'attributes':_[_0xc447('0x2f')](_0x23bca7)},{'model':db[_0xc447('0x30')],'as':'Agent','attributes':['id',_0xc447('0x31'),_0xc447('0x32')]}]})[_0xc447('0x9')](function(_0x9155e6){var _0x4d04a5=[];var _0x4d74eb=[];for(var _0x115e77=0x0;_0x115e77<_0x9155e6[_0xc447('0x33')];_0x115e77+=0x1){var _0xf4fb67=_0x9155e6[_0x115e77][_0xc447('0x34')];if(_0xf4fb67===null){_0x4d04a5[_0xc447('0x35')](_0x9155e6[_0x115e77][_0xc447('0x24')](_0x483615[_0xc447('0x22')],{'transaction':_0x181e0e}));}else if(!_0x4d74eb[_0xc447('0x36')](_0xf4fb67)){_0x4d74eb[_0xc447('0x35')](_0xf4fb67);_0x4d04a5[_0xc447('0x35')](_0x9155e6[_0x115e77][_0xc447('0x24')](_0x483615['body'],{'transaction':_0x181e0e}));}}return BPromise[_0xc447('0x37')](_0x4d04a5);});})[_0xc447('0x9')](function(_0x26c94d){logger[_0xc447('0xa')](_0xc447('0x26'),_0x483615);logger['debug']('GetContactDialer',_0x483615,JSON[_0xc447('0xf')](_0x26c94d));_0x53fcb7(_0x26c94d);})[_0xc447('0x13')](function(_0x1f5e45){logger[_0xc447('0x10')]('GetContactDialer',_0x1f5e45['message'],_0x483615);_0x3c50a7(_0x3b5c7c[_0xc447('0x10')](0x1f4,_0x1f5e45[_0xc447('0x12')]));});});});};exports['MoveContactManagedDialer']=function(_0x490f86){var _0x1a0040=this;return new Promise(function(_0x513923,_0x10e068){return db[_0xc447('0x29')][_0xc447('0x2a')](function(_0x5d174f){return db[_0xc447('0x38')][_0xc447('0x21')](_0x490f86[_0xc447('0x22')],{'raw':_0x490f86[_0xc447('0x17')]?_0x490f86[_0xc447('0x17')]['raw']===undefined?!![]:![]:!![],'transaction':_0x5d174f})[_0xc447('0x9')](function(){return db[_0xc447('0x15')][_0xc447('0x39')]({'where':_0x490f86[_0xc447('0x17')]?_0x490f86[_0xc447('0x17')]['where']||null:null,'transaction':_0x5d174f});});})[_0xc447('0x9')](function(_0x1ff79d){logger[_0xc447('0xa')]('MoveContactManagedDialer',_0x490f86);logger['debug'](_0xc447('0x3a'),_0x490f86,JSON[_0xc447('0xf')](_0x1ff79d));_0x513923(_0x1ff79d);})['catch'](function(_0xe3426c){logger['error'](_0xc447('0x3a'),_0xe3426c['message'],_0x490f86);_0x10e068(_0x1a0040[_0xc447('0x10')](0x1f4,_0xe3426c[_0xc447('0x12')]));});});};exports['CountReScheduled']=function(_0x276907){var _0x12d42b=this;return new Promise(function(_0x3120dc,_0x5b2425){return db[_0xc447('0x15')]['findAll']({'raw':_0x276907[_0xc447('0x17')]?_0x276907[_0xc447('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x276907[_0xc447('0x17')]?_0x276907[_0xc447('0x17')][_0xc447('0x19')]||null:null,'attributes':[[db[_0xc447('0x29')]['fn'](_0xc447('0x3b'),db['sequelize']['fn']('IF',db[_0xc447('0x29')][_0xc447('0x3c')](_0xc447('0x3d')+util[_0xc447('0x3e')](_0xc447('0x3f'),moment()[_0xc447('0x3e')](_0xc447('0x40')))+_0xc447('0x41')))),_0xc447('0x42')]]})[_0xc447('0x9')](function(_0x3397de){logger['info'](_0xc447('0x43'),_0x276907);logger[_0xc447('0xc')](_0xc447('0x43'),_0x276907,JSON[_0xc447('0xf')](_0x3397de));_0x3120dc(_0x3397de);})['catch'](function(_0xf47dff){logger['error'](_0xc447('0x43'),_0xf47dff[_0xc447('0x12')],_0x276907);_0x5b2425(_0x12d42b[_0xc447('0x10')](0x1f4,_0xf47dff['message']));});});};exports[_0xc447('0x44')]=function(_0x56ca40){var _0x459e85=this;return new Promise(function(_0x181309,_0x578a27){return db[_0xc447('0x27')][_0xc447('0x28')]()['then'](function(_0xf047d7){return db['sequelize']['transaction'](function(_0x26cf45){return db[_0xc447('0x15')]['findAll']({'where':_0x56ca40[_0xc447('0x17')]?_0x56ca40['options'][_0xc447('0x19')]||null:null,'attributes':_0x56ca40[_0xc447('0x17')]?_0x56ca40['options']['attributes']||null:null,'limit':0x1,'order':_0x56ca40['options']?_0x56ca40[_0xc447('0x17')]['order']||null:null,'group':db[_0xc447('0x15')][_0xc447('0x34')],'transaction':_0x26cf45,'lock':_0x26cf45[_0xc447('0x2c')][_0xc447('0x2d')],'include':_0x56ca40[_0xc447('0x17')]?_0x56ca40[_0xc447('0x17')][_0xc447('0x1b')]?_[_0xc447('0x1c')](_0x56ca40[_0xc447('0x17')][_0xc447('0x1b')],function(_0x5a45be){return{'model':db[_0x5a45be[_0xc447('0x1d')]],'as':_0x5a45be['as'],'attributes':_0x5a45be[_0xc447('0x1a')],'include':_0x5a45be[_0xc447('0x1b')]?_['map'](_0x5a45be['include'],function(_0x2b3e54){return{'model':db[_0x2b3e54[_0xc447('0x1d')]],'as':_0x2b3e54['as'],'attributes':_0x2b3e54['attributes'],'include':_0x2b3e54[_0xc447('0x1b')]?_[_0xc447('0x1c')](_0x2b3e54['include'],function(_0x149a8f){return{'model':db[_0x149a8f[_0xc447('0x1d')]],'as':_0x149a8f['as'],'attributes':_0x149a8f[_0xc447('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xc447('0x9')](function(_0xf785f0){var _0x3be12c=[];for(var _0xd8fb58=0x0;_0xd8fb58<_0xf785f0[_0xc447('0x33')];_0xd8fb58+=0x1){_0x3be12c[_0xc447('0x35')](_0xf785f0[_0xd8fb58][_0xc447('0x24')](_0x56ca40[_0xc447('0x22')],{'transaction':_0x26cf45}));}return BPromise[_0xc447('0x37')](_0x3be12c);});})['then'](function(_0x6a2e7){logger[_0xc447('0xa')](_0xc447('0x44'),_0x56ca40);logger[_0xc447('0xc')](_0xc447('0x44'),_0x56ca40,JSON[_0xc447('0xf')](_0x6a2e7));_0x181309(_0x6a2e7);})[_0xc447('0x13')](function(_0x446ee3){logger[_0xc447('0x10')](_0xc447('0x44'),_0x446ee3[_0xc447('0x12')],_0x56ca40);_0x578a27(_0x459e85['error'](0x1f4,_0x446ee3[_0xc447('0x12')]));});});});};exports[_0xc447('0x45')]=function(_0x1a735d){var _0x70df3d=this;return new Promise(function(_0x38221a,_0x281cd6){db[_0xc447('0x27')][_0xc447('0x28')]()[_0xc447('0x9')](function(_0x533b76){return db[_0xc447('0x15')][_0xc447('0x16')]({'raw':_0x1a735d[_0xc447('0x17')]?_0x1a735d['options'][_0xc447('0x18')]===undefined?!![]:![]:!![],'where':_0x1a735d[_0xc447('0x17')]?_0x1a735d['options']['where']||null:null,'attributes':_0x1a735d[_0xc447('0x17')]?_0x1a735d[_0xc447('0x17')][_0xc447('0x1a')]||null:null,'limit':_0x1a735d['options']?_0x1a735d[_0xc447('0x17')][_0xc447('0x2b')]||null:null,'include':_0x1a735d[_0xc447('0x17')]?_0x1a735d[_0xc447('0x17')][_0xc447('0x1b')]?_['map'](_0x1a735d[_0xc447('0x17')][_0xc447('0x1b')],function(_0x2a33ba){return{'model':db[_0x2a33ba['model']],'as':_0x2a33ba['as'],'attributes':_0x2a33ba['as']==='Contact'?_[_0xc447('0x2f')](_0x533b76):_0x2a33ba[_0xc447('0x1a')],'include':_0x2a33ba[_0xc447('0x1b')]?_[_0xc447('0x1c')](_0x2a33ba[_0xc447('0x1b')],function(_0x4b7552){return{'model':db[_0x4b7552['model']],'as':_0x4b7552['as'],'attributes':_0x4b7552['attributes'],'include':_0x4b7552[_0xc447('0x1b')]?_[_0xc447('0x1c')](_0x4b7552[_0xc447('0x1b')],function(_0x21b84e){return{'model':db[_0x21b84e[_0xc447('0x1d')]],'as':_0x21b84e['as'],'attributes':_0x21b84e['attributes']};}):[]};}):[]};}):[]:[]})[_0xc447('0x9')](function(_0x2553ee){logger['info'](_0xc447('0x14'),_0x1a735d);logger[_0xc447('0xc')](_0xc447('0x14'),_0x1a735d,JSON['stringify'](_0x2553ee));_0x38221a(_0x2553ee);})['catch'](function(_0x248677){logger['error'](_0xc447('0x14'),_0x248677[_0xc447('0x12')],_0x1a735d);_0x281cd6(_0x70df3d[_0xc447('0x10')](0x1f4,_0x248677['message']));});});});};
\ No newline at end of file
index 1267952..e41e735 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0628=['isAuthenticated','index','/opencontacts','getOpenContacts','show','post','create','getPreview','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get'];(function(_0x73e9b0,_0x608ea8){var _0xb8f052=function(_0x3c241a){while(--_0x3c241a){_0x73e9b0['push'](_0x73e9b0['shift']());}};_0xb8f052(++_0x608ea8);}(_0x0628,0x15c));var _0x8062=function(_0x3cae6c,_0x3d74ba){_0x3cae6c=_0x3cae6c-0x0;var _0x3b7421=_0x0628[_0x3cae6c];return _0x3b7421;};'use strict';var multer=require(_0x8062('0x0'));var util=require(_0x8062('0x1'));var path=require('path');var timeout=require(_0x8062('0x2'));var express=require(_0x8062('0x3'));var router=express[_0x8062('0x4')]();var fs_extra=require(_0x8062('0x5'));var auth=require(_0x8062('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8062('0x7'));var controller=require('./cmHopper.controller');router[_0x8062('0x8')]('/',auth[_0x8062('0x9')](),controller[_0x8062('0xa')]);router[_0x8062('0x8')]('/describe',auth[_0x8062('0x9')](),controller['describe']);router[_0x8062('0x8')](_0x8062('0xb'),auth[_0x8062('0x9')](),controller[_0x8062('0xc')]);router[_0x8062('0x8')]('/:id',auth[_0x8062('0x9')](),controller[_0x8062('0xd')]);router[_0x8062('0xe')]('/',auth['isAuthenticated'](),controller[_0x8062('0xf')]);router[_0x8062('0xe')]('/preview',auth[_0x8062('0x9')](),controller[_0x8062('0x10')]);router['put']('/:id',auth[_0x8062('0x9')](),controller[_0x8062('0x11')]);router[_0x8062('0x12')]('/:id',auth[_0x8062('0x9')](),controller[_0x8062('0x13')]);module[_0x8062('0x14')]=router;
\ No newline at end of file
+var _0x7f1d=['describe','getOpenContacts','/:id','show','post','create','/preview','put','update','delete','destroy','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','isAuthenticated','/describe'];(function(_0x39fc7c,_0x37cdca){var _0x2527c2=function(_0x18d265){while(--_0x18d265){_0x39fc7c['push'](_0x39fc7c['shift']());}};_0x2527c2(++_0x37cdca);}(_0x7f1d,0x164));var _0xd7f1=function(_0x10b1bb,_0x2a5815){_0x10b1bb=_0x10b1bb-0x0;var _0x2d4e05=_0x7f1d[_0x10b1bb];return _0x2d4e05;};'use strict';var multer=require(_0xd7f1('0x0'));var util=require(_0xd7f1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd7f1('0x2'));var router=express[_0xd7f1('0x3')]();var fs_extra=require(_0xd7f1('0x4'));var auth=require(_0xd7f1('0x5'));var interaction=require(_0xd7f1('0x6'));var config=require(_0xd7f1('0x7'));var controller=require(_0xd7f1('0x8'));router[_0xd7f1('0x9')]('/',auth[_0xd7f1('0xa')](),controller['index']);router['get'](_0xd7f1('0xb'),auth[_0xd7f1('0xa')](),controller[_0xd7f1('0xc')]);router[_0xd7f1('0x9')]('/opencontacts',auth[_0xd7f1('0xa')](),controller[_0xd7f1('0xd')]);router['get'](_0xd7f1('0xe'),auth[_0xd7f1('0xa')](),controller[_0xd7f1('0xf')]);router[_0xd7f1('0x10')]('/',auth['isAuthenticated'](),controller[_0xd7f1('0x11')]);router[_0xd7f1('0x10')](_0xd7f1('0x12'),auth[_0xd7f1('0xa')](),controller['getPreview']);router[_0xd7f1('0x13')](_0xd7f1('0xe'),auth[_0xd7f1('0xa')](),controller[_0xd7f1('0x14')]);router[_0xd7f1('0x15')](_0xd7f1('0xe'),auth[_0xd7f1('0xa')](),controller[_0xd7f1('0x16')]);module['exports']=router;
\ No newline at end of file
index fcf5a90..2217f42 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8876=['sequelize','exports','STRING','INTEGER','contactListQueue'];(function(_0xaaeefa,_0x4e9161){var _0x3873f4=function(_0xd6d20b){while(--_0xd6d20b){_0xaaeefa['push'](_0xaaeefa['shift']());}};_0x3873f4(++_0x4e9161);}(_0x8876,0xa0));var _0x6887=function(_0x15d748,_0x4bd8de){_0x15d748=_0x15d748-0x0;var _0x57ec7f=_0x8876[_0x15d748];return _0x57ec7f;};'use strict';var moment=require('moment');var Sequelize=require(_0x6887('0x0'));module[_0x6887('0x1')]={'phone':{'type':Sequelize[_0x6887('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x6887('0x3')],'unique':_0x6887('0x4')},'ListId':{'type':Sequelize[_0x6887('0x3')],'unique':_0x6887('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x6887('0x4')}};
\ No newline at end of file
+var _0x19d0=['contactListQueue','moment','sequelize','exports','STRING','INTEGER'];(function(_0x686d4f,_0x14a4ce){var _0x1eb988=function(_0x478fcc){while(--_0x478fcc){_0x686d4f['push'](_0x686d4f['shift']());}};_0x1eb988(++_0x14a4ce);}(_0x19d0,0xd9));var _0x019d=function(_0x568de8,_0x2850d0){_0x568de8=_0x568de8-0x0;var _0x192200=_0x19d0[_0x568de8];return _0x192200;};'use strict';var moment=require(_0x019d('0x0'));var Sequelize=require(_0x019d('0x1'));module[_0x019d('0x2')]={'phone':{'type':Sequelize[_0x019d('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x019d('0x4')],'unique':_0x019d('0x5')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x019d('0x5')},'VoiceQueueId':{'type':Sequelize[_0x019d('0x4')],'unique':_0x019d('0x5')}};
\ No newline at end of file
index 5ce4ee0..c46e294 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8259=['sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','CmHopperBlack','fieldName','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','merge','type','VIRTUAL','includeAll','rows','show','params','rawAttributes','keys','find','catch','body','describe','rimraf','fast-json-patch','request-promise','mustache','util','path'];(function(_0x23146a,_0x2c34ea){var _0x1fdb43=function(_0x3f32cb){while(--_0x3f32cb){_0x23146a['push'](_0x23146a['shift']());}};_0x1fdb43(++_0x2c34ea);}(_0x8259,0xd5));var _0x9825=function(_0x16aabf,_0x39a43f){_0x16aabf=_0x16aabf-0x0;var _0x1db1c9=_0x8259[_0x16aabf];return _0x1db1c9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9825('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9825('0x1'));var rp=require(_0x9825('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9825('0x3'));var util=require(_0x9825('0x4'));var path=require(_0x9825('0x5'));var sox=require(_0x9825('0x6'));var csv=require(_0x9825('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9825('0x8'));var _=require(_0x9825('0x9'));var squel=require(_0x9825('0xa'));var crypto=require(_0x9825('0xb'));var jsforce=require(_0x9825('0xc'));var deskjs=require(_0x9825('0xd'));var toCsv=require(_0x9825('0x7'));var querystring=require(_0x9825('0xe'));var Papa=require(_0x9825('0xf'));var Redis=require(_0x9825('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9825('0x11'));var hardwareService=require(_0x9825('0x12'));var logger=require(_0x9825('0x13'))(_0x9825('0x14'));var utils=require(_0x9825('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9825('0x16'));var db=require(_0x9825('0x17'))['db'];function respondWithStatusCode(_0x16a017,_0x4b4cac){_0x4b4cac=_0x4b4cac||0xcc;return function(_0x480620){if(_0x480620){return _0x16a017[_0x9825('0x18')](_0x4b4cac);}return _0x16a017[_0x9825('0x19')](_0x4b4cac)[_0x9825('0x1a')]();};}function respondWithResult(_0x7ecb4f,_0x28861f){_0x28861f=_0x28861f||0xc8;return function(_0x4a9ec9){if(_0x4a9ec9){return _0x7ecb4f[_0x9825('0x19')](_0x28861f)[_0x9825('0x1b')](_0x4a9ec9);}};}function respondWithFilteredResult(_0x59c67e,_0x57a847){return function(_0x3b96c8){if(_0x3b96c8){var _0x52a25f=typeof _0x57a847['offset']===_0x9825('0x1c')&&typeof _0x57a847[_0x9825('0x1d')]===_0x9825('0x1c');var _0x4dfb52=_0x3b96c8[_0x9825('0x1e')];var _0x1b038a=_0x52a25f?0x0:_0x57a847[_0x9825('0x1f')];var _0x5ab5af=_0x52a25f?_0x3b96c8[_0x9825('0x1e')]:_0x57a847[_0x9825('0x1f')]+_0x57a847['limit'];var _0x1863ba;if(_0x5ab5af>=_0x4dfb52){_0x5ab5af=_0x4dfb52;_0x1863ba=0xc8;}else{_0x1863ba=0xce;}_0x59c67e['status'](_0x1863ba);return _0x59c67e[_0x9825('0x20')](_0x9825('0x21'),_0x1b038a+'-'+_0x5ab5af+'/'+_0x4dfb52)[_0x9825('0x1b')](_0x3b96c8);}return null;};}function patchUpdates(_0x348a09){return function(_0x21d551){try{jsonpatch[_0x9825('0x22')](_0x21d551,_0x348a09,!![]);}catch(_0x215d2c){return BPromise[_0x9825('0x23')](_0x215d2c);}return _0x21d551[_0x9825('0x24')]();};}function saveUpdates(_0x261f94,_0x41e744){return function(_0x277703){if(_0x277703){return _0x277703[_0x9825('0x25')](_0x261f94)[_0x9825('0x26')](function(_0x5dc199){return _0x5dc199;});}return null;};}function removeEntity(_0x1ae924,_0x29f550){return function(_0x519555){if(_0x519555){return _0x519555[_0x9825('0x27')]()['then'](function(){_0x1ae924['status'](0xcc)[_0x9825('0x1a')]();});}};}function handleEntityNotFound(_0x2561dc,_0x5ab994){return function(_0x4033b9){if(!_0x4033b9){_0x2561dc['sendStatus'](0x194);}return _0x4033b9;};}function handleError(_0xe8a5f5,_0x3b75cc){_0x3b75cc=_0x3b75cc||0x1f4;return function(_0x4a63f4){logger[_0x9825('0x28')](_0x4a63f4['stack']);if(_0x4a63f4[_0x9825('0x29')]){delete _0x4a63f4['name'];}_0xe8a5f5[_0x9825('0x19')](_0x3b75cc)[_0x9825('0x2a')](_0x4a63f4);};}exports[_0x9825('0x2b')]=function(_0x107757,_0x286b60){var _0x4b5db2={},_0x4d52c0={},_0x2d969d={'count':0x0,'rows':[]};var _0x432b2c=_['map'](db[_0x9825('0x2c')]['rawAttributes'],function(_0x51301f){return{'name':_0x51301f[_0x9825('0x2d')],'type':_0x51301f['type'][_0x9825('0x2e')]};});_0x4d52c0[_0x9825('0x2f')]=_[_0x9825('0x30')](_0x432b2c,_0x9825('0x29'));_0x4d52c0[_0x9825('0x31')]=_['keys'](_0x107757[_0x9825('0x31')]);_0x4d52c0[_0x9825('0x32')]=_['intersection'](_0x4d52c0[_0x9825('0x2f')],_0x4d52c0[_0x9825('0x31')]);_0x4b5db2[_0x9825('0x33')]=_[_0x9825('0x34')](_0x4d52c0[_0x9825('0x2f')],qs[_0x9825('0x35')](_0x107757[_0x9825('0x31')][_0x9825('0x35')]));_0x4b5db2['attributes']=_0x4b5db2['attributes'][_0x9825('0x36')]?_0x4b5db2['attributes']:_0x4d52c0['model'];if(!_0x107757[_0x9825('0x31')][_0x9825('0x37')]('nolimit')){_0x4b5db2[_0x9825('0x1d')]=qs['limit'](_0x107757[_0x9825('0x31')]['limit']);_0x4b5db2[_0x9825('0x1f')]=qs[_0x9825('0x1f')](_0x107757[_0x9825('0x31')][_0x9825('0x1f')]);}_0x4b5db2[_0x9825('0x38')]=qs[_0x9825('0x39')](_0x107757[_0x9825('0x31')][_0x9825('0x39')]);_0x4b5db2['where']=qs[_0x9825('0x32')](_['pick'](_0x107757[_0x9825('0x31')],_0x4d52c0[_0x9825('0x32')]),_0x432b2c);if(_0x107757[_0x9825('0x31')][_0x9825('0x3a')]){_0x4b5db2[_0x9825('0x3b')]=_[_0x9825('0x3c')](_0x4b5db2[_0x9825('0x3b')],{'$or':_[_0x9825('0x30')](_0x432b2c,function(_0x5b6cab){if(_0x5b6cab[_0x9825('0x3d')]!==_0x9825('0x3e')){var _0x22ab3d={};_0x22ab3d[_0x5b6cab[_0x9825('0x29')]]={'$like':'%'+_0x107757[_0x9825('0x31')][_0x9825('0x3a')]+'%'};return _0x22ab3d;}})});}_0x4b5db2=_['merge']({},_0x4b5db2,_0x107757['options']);var _0xd65dc7={'where':_0x4b5db2[_0x9825('0x3b')]};return db[_0x9825('0x2c')][_0x9825('0x1e')](_0xd65dc7)[_0x9825('0x26')](function(_0x340434){_0x2d969d[_0x9825('0x1e')]=_0x340434;if(_0x107757[_0x9825('0x31')][_0x9825('0x3f')]){_0x4b5db2['include']=[{'all':!![]}];}return db[_0x9825('0x2c')]['findAll'](_0x4b5db2);})[_0x9825('0x26')](function(_0x472f9a){_0x2d969d[_0x9825('0x40')]=_0x472f9a;return _0x2d969d;})[_0x9825('0x26')](respondWithFilteredResult(_0x286b60,_0x4b5db2))['catch'](handleError(_0x286b60,null));};exports[_0x9825('0x41')]=function(_0x287d93,_0x2cd969){var _0x20b143={'raw':!![],'where':{'id':_0x287d93[_0x9825('0x42')]['id']}},_0xe1411b={};_0xe1411b[_0x9825('0x2f')]=_['keys'](db[_0x9825('0x2c')][_0x9825('0x43')]);_0xe1411b[_0x9825('0x31')]=_[_0x9825('0x44')](_0x287d93[_0x9825('0x31')]);_0xe1411b[_0x9825('0x32')]=_['intersection'](_0xe1411b[_0x9825('0x2f')],_0xe1411b[_0x9825('0x31')]);_0x20b143[_0x9825('0x33')]=_[_0x9825('0x34')](_0xe1411b[_0x9825('0x2f')],qs['fields'](_0x287d93[_0x9825('0x31')][_0x9825('0x35')]));_0x20b143[_0x9825('0x33')]=_0x20b143[_0x9825('0x33')][_0x9825('0x36')]?_0x20b143[_0x9825('0x33')]:_0xe1411b[_0x9825('0x2f')];if(_0x287d93[_0x9825('0x31')][_0x9825('0x3f')]){_0x20b143['include']=[{'all':!![]}];}_0x20b143=_[_0x9825('0x3c')]({},_0x20b143,_0x287d93['options']);return db[_0x9825('0x2c')][_0x9825('0x45')](_0x20b143)['then'](handleEntityNotFound(_0x2cd969,null))[_0x9825('0x26')](respondWithResult(_0x2cd969,null))[_0x9825('0x46')](handleError(_0x2cd969,null));};exports['update']=function(_0x49ec0a,_0x153dda){if(_0x49ec0a['body']['id']){delete _0x49ec0a[_0x9825('0x47')]['id'];}return db[_0x9825('0x2c')][_0x9825('0x45')]({'where':{'id':_0x49ec0a[_0x9825('0x42')]['id']}})[_0x9825('0x26')](handleEntityNotFound(_0x153dda,null))['then'](saveUpdates(_0x49ec0a['body'],null))[_0x9825('0x26')](respondWithResult(_0x153dda,null))['catch'](handleError(_0x153dda,null));};exports[_0x9825('0x27')]=function(_0x3370f3,_0x398a1a){return db[_0x9825('0x2c')]['find']({'where':{'id':_0x3370f3[_0x9825('0x42')]['id']}})[_0x9825('0x26')](handleEntityNotFound(_0x398a1a,null))[_0x9825('0x26')](removeEntity(_0x398a1a,null))[_0x9825('0x46')](handleError(_0x398a1a,null));};exports[_0x9825('0x48')]=function(_0x282f08,_0x5c3aee){return db['CmHopperBlack']['describe']()['then'](respondWithResult(_0x5c3aee,null))[_0x9825('0x46')](handleError(_0x5c3aee,null));};
\ No newline at end of file
+var _0xdbdf=['show','params','include','merge','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','CmHopperBlack','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','options','includeAll','findAll','rows','catch'];(function(_0x2d9be0,_0x33ebbc){var _0x4df30d=function(_0x836d62){while(--_0x836d62){_0x2d9be0['push'](_0x2d9be0['shift']());}};_0x4df30d(++_0x33ebbc);}(_0xdbdf,0xf1));var _0xfdbd=function(_0x31cb87,_0x81c6ff){_0x31cb87=_0x31cb87-0x0;var _0x1b61a0=_0xdbdf[_0x31cb87];return _0x1b61a0;};'use strict';var emlformat=require(_0xfdbd('0x0'));var rimraf=require(_0xfdbd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfdbd('0x2'));var rp=require(_0xfdbd('0x3'));var moment=require(_0xfdbd('0x4'));var BPromise=require(_0xfdbd('0x5'));var Mustache=require(_0xfdbd('0x6'));var util=require(_0xfdbd('0x7'));var path=require(_0xfdbd('0x8'));var sox=require(_0xfdbd('0x9'));var csv=require('to-csv');var ejs=require(_0xfdbd('0xa'));var fs=require('fs');var fs_extra=require(_0xfdbd('0xb'));var _=require(_0xfdbd('0xc'));var squel=require('squel');var crypto=require(_0xfdbd('0xd'));var jsforce=require(_0xfdbd('0xe'));var deskjs=require(_0xfdbd('0xf'));var toCsv=require(_0xfdbd('0x10'));var querystring=require(_0xfdbd('0x11'));var Papa=require(_0xfdbd('0x12'));var Redis=require(_0xfdbd('0x13'));var authService=require(_0xfdbd('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xfdbd('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfdbd('0x16'))(_0xfdbd('0x17'));var utils=require('../../config/utils');var config=require(_0xfdbd('0x18'));var licenseUtil=require(_0xfdbd('0x19'));var db=require(_0xfdbd('0x1a'))['db'];function respondWithStatusCode(_0x293bff,_0x4fa9d7){_0x4fa9d7=_0x4fa9d7||0xcc;return function(_0x2a2266){if(_0x2a2266){return _0x293bff[_0xfdbd('0x1b')](_0x4fa9d7);}return _0x293bff[_0xfdbd('0x1c')](_0x4fa9d7)[_0xfdbd('0x1d')]();};}function respondWithResult(_0xbadf2b,_0x2f0961){_0x2f0961=_0x2f0961||0xc8;return function(_0x4d41e3){if(_0x4d41e3){return _0xbadf2b[_0xfdbd('0x1c')](_0x2f0961)[_0xfdbd('0x1e')](_0x4d41e3);}};}function respondWithFilteredResult(_0x1c8969,_0x5485b3){return function(_0x1d8d76){if(_0x1d8d76){var _0x3a6acb=typeof _0x5485b3['offset']===_0xfdbd('0x1f')&&typeof _0x5485b3[_0xfdbd('0x20')]===_0xfdbd('0x1f');var _0x2b5eed=_0x1d8d76['count'];var _0x4bb37c=_0x3a6acb?0x0:_0x5485b3[_0xfdbd('0x21')];var _0x33f0f0=_0x3a6acb?_0x1d8d76[_0xfdbd('0x22')]:_0x5485b3[_0xfdbd('0x21')]+_0x5485b3['limit'];var _0x5b02c0;if(_0x33f0f0>=_0x2b5eed){_0x33f0f0=_0x2b5eed;_0x5b02c0=0xc8;}else{_0x5b02c0=0xce;}_0x1c8969[_0xfdbd('0x1c')](_0x5b02c0);return _0x1c8969['set'](_0xfdbd('0x23'),_0x4bb37c+'-'+_0x33f0f0+'/'+_0x2b5eed)[_0xfdbd('0x1e')](_0x1d8d76);}return null;};}function patchUpdates(_0x1ce430){return function(_0xc1381){try{jsonpatch[_0xfdbd('0x24')](_0xc1381,_0x1ce430,!![]);}catch(_0x310cc4){return BPromise[_0xfdbd('0x25')](_0x310cc4);}return _0xc1381[_0xfdbd('0x26')]();};}function saveUpdates(_0x398720,_0x5d8c3a){return function(_0x58ba2e){if(_0x58ba2e){return _0x58ba2e[_0xfdbd('0x27')](_0x398720)[_0xfdbd('0x28')](function(_0x2e43de){return _0x2e43de;});}return null;};}function removeEntity(_0x4bc240,_0x2cce17){return function(_0x4dcbc1){if(_0x4dcbc1){return _0x4dcbc1[_0xfdbd('0x29')]()[_0xfdbd('0x28')](function(){_0x4bc240[_0xfdbd('0x1c')](0xcc)[_0xfdbd('0x1d')]();});}};}function handleEntityNotFound(_0x2e4a6c,_0x294b4f){return function(_0x30cd0c){if(!_0x30cd0c){_0x2e4a6c['sendStatus'](0x194);}return _0x30cd0c;};}function handleError(_0x432a06,_0x25f7de){_0x25f7de=_0x25f7de||0x1f4;return function(_0x5b0020){logger['error'](_0x5b0020[_0xfdbd('0x2a')]);if(_0x5b0020[_0xfdbd('0x2b')]){delete _0x5b0020['name'];}_0x432a06[_0xfdbd('0x1c')](_0x25f7de)[_0xfdbd('0x2c')](_0x5b0020);};}exports[_0xfdbd('0x2d')]=function(_0x13c310,_0xb31192){var _0x210f93={},_0x566f7c={},_0x137dd9={'count':0x0,'rows':[]};var _0x20266b=_['map'](db[_0xfdbd('0x2e')][_0xfdbd('0x2f')],function(_0x24467f){return{'name':_0x24467f[_0xfdbd('0x30')],'type':_0x24467f[_0xfdbd('0x31')][_0xfdbd('0x32')]};});_0x566f7c[_0xfdbd('0x33')]=_[_0xfdbd('0x34')](_0x20266b,_0xfdbd('0x2b'));_0x566f7c['query']=_[_0xfdbd('0x35')](_0x13c310[_0xfdbd('0x36')]);_0x566f7c[_0xfdbd('0x37')]=_[_0xfdbd('0x38')](_0x566f7c[_0xfdbd('0x33')],_0x566f7c['query']);_0x210f93[_0xfdbd('0x39')]=_[_0xfdbd('0x38')](_0x566f7c[_0xfdbd('0x33')],qs[_0xfdbd('0x3a')](_0x13c310[_0xfdbd('0x36')][_0xfdbd('0x3a')]));_0x210f93['attributes']=_0x210f93['attributes'][_0xfdbd('0x3b')]?_0x210f93[_0xfdbd('0x39')]:_0x566f7c[_0xfdbd('0x33')];if(!_0x13c310[_0xfdbd('0x36')][_0xfdbd('0x3c')](_0xfdbd('0x3d'))){_0x210f93[_0xfdbd('0x20')]=qs['limit'](_0x13c310[_0xfdbd('0x36')][_0xfdbd('0x20')]);_0x210f93[_0xfdbd('0x21')]=qs['offset'](_0x13c310[_0xfdbd('0x36')][_0xfdbd('0x21')]);}_0x210f93['order']=qs[_0xfdbd('0x3e')](_0x13c310[_0xfdbd('0x36')]['sort']);_0x210f93[_0xfdbd('0x3f')]=qs['filters'](_['pick'](_0x13c310[_0xfdbd('0x36')],_0x566f7c[_0xfdbd('0x37')]),_0x20266b);if(_0x13c310[_0xfdbd('0x36')][_0xfdbd('0x40')]){_0x210f93[_0xfdbd('0x3f')]=_['merge'](_0x210f93[_0xfdbd('0x3f')],{'$or':_[_0xfdbd('0x34')](_0x20266b,function(_0xf73fea){if(_0xf73fea['type']!==_0xfdbd('0x41')){var _0x16ff8d={};_0x16ff8d[_0xf73fea[_0xfdbd('0x2b')]]={'$like':'%'+_0x13c310[_0xfdbd('0x36')][_0xfdbd('0x40')]+'%'};return _0x16ff8d;}})});}_0x210f93=_['merge']({},_0x210f93,_0x13c310[_0xfdbd('0x42')]);var _0x2e3f4d={'where':_0x210f93[_0xfdbd('0x3f')]};return db['CmHopperBlack']['count'](_0x2e3f4d)[_0xfdbd('0x28')](function(_0xa5954f){_0x137dd9[_0xfdbd('0x22')]=_0xa5954f;if(_0x13c310['query'][_0xfdbd('0x43')]){_0x210f93['include']=[{'all':!![]}];}return db[_0xfdbd('0x2e')][_0xfdbd('0x44')](_0x210f93);})[_0xfdbd('0x28')](function(_0x37b01b){_0x137dd9[_0xfdbd('0x45')]=_0x37b01b;return _0x137dd9;})[_0xfdbd('0x28')](respondWithFilteredResult(_0xb31192,_0x210f93))[_0xfdbd('0x46')](handleError(_0xb31192,null));};exports[_0xfdbd('0x47')]=function(_0x17dfa5,_0x45f699){var _0x50f911={'raw':!![],'where':{'id':_0x17dfa5[_0xfdbd('0x48')]['id']}},_0x4f1ccf={};_0x4f1ccf[_0xfdbd('0x33')]=_[_0xfdbd('0x35')](db[_0xfdbd('0x2e')][_0xfdbd('0x2f')]);_0x4f1ccf['query']=_[_0xfdbd('0x35')](_0x17dfa5[_0xfdbd('0x36')]);_0x4f1ccf[_0xfdbd('0x37')]=_[_0xfdbd('0x38')](_0x4f1ccf[_0xfdbd('0x33')],_0x4f1ccf[_0xfdbd('0x36')]);_0x50f911['attributes']=_[_0xfdbd('0x38')](_0x4f1ccf[_0xfdbd('0x33')],qs[_0xfdbd('0x3a')](_0x17dfa5[_0xfdbd('0x36')][_0xfdbd('0x3a')]));_0x50f911[_0xfdbd('0x39')]=_0x50f911[_0xfdbd('0x39')][_0xfdbd('0x3b')]?_0x50f911[_0xfdbd('0x39')]:_0x4f1ccf[_0xfdbd('0x33')];if(_0x17dfa5[_0xfdbd('0x36')][_0xfdbd('0x43')]){_0x50f911[_0xfdbd('0x49')]=[{'all':!![]}];}_0x50f911=_[_0xfdbd('0x4a')]({},_0x50f911,_0x17dfa5[_0xfdbd('0x42')]);return db['CmHopperBlack']['find'](_0x50f911)[_0xfdbd('0x28')](handleEntityNotFound(_0x45f699,null))[_0xfdbd('0x28')](respondWithResult(_0x45f699,null))[_0xfdbd('0x46')](handleError(_0x45f699,null));};exports['update']=function(_0x5194b6,_0x7c243c){if(_0x5194b6[_0xfdbd('0x4b')]['id']){delete _0x5194b6['body']['id'];}return db['CmHopperBlack'][_0xfdbd('0x4c')]({'where':{'id':_0x5194b6[_0xfdbd('0x48')]['id']}})[_0xfdbd('0x28')](handleEntityNotFound(_0x7c243c,null))[_0xfdbd('0x28')](saveUpdates(_0x5194b6['body'],null))[_0xfdbd('0x28')](respondWithResult(_0x7c243c,null))[_0xfdbd('0x46')](handleError(_0x7c243c,null));};exports[_0xfdbd('0x29')]=function(_0xe2e946,_0x1c8ff6){return db[_0xfdbd('0x2e')][_0xfdbd('0x4c')]({'where':{'id':_0xe2e946[_0xfdbd('0x48')]['id']}})[_0xfdbd('0x28')](handleEntityNotFound(_0x1c8ff6,null))[_0xfdbd('0x28')](removeEntity(_0x1c8ff6,null))[_0xfdbd('0x46')](handleError(_0x1c8ff6,null));};exports[_0xfdbd('0x4d')]=function(_0x1de428,_0x230e78){return db[_0xfdbd('0x2e')]['describe']()[_0xfdbd('0x28')](respondWithResult(_0x230e78,null))['catch'](handleError(_0x230e78,null));};
\ No newline at end of file
index 37f5083..3e99cd7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2849=['lodash','util','api','bluebird','request-promise','path','rimraf','define','CmHopperBlack','cm_hopper_black'];(function(_0x3e961c,_0x5747e7){var _0x474f9c=function(_0x33f8ea){while(--_0x33f8ea){_0x3e961c['push'](_0x3e961c['shift']());}};_0x474f9c(++_0x5747e7);}(_0x2849,0x1c2));var _0x9284=function(_0x210b62,_0x10ea64){_0x210b62=_0x210b62-0x0;var _0x3c9426=_0x2849[_0x210b62];return _0x3c9426;};'use strict';var _=require(_0x9284('0x0'));var util=require(_0x9284('0x1'));var logger=require('../../config/logger')(_0x9284('0x2'));var moment=require('moment');var BPromise=require(_0x9284('0x3'));var rp=require(_0x9284('0x4'));var fs=require('fs');var path=require(_0x9284('0x5'));var rimraf=require(_0x9284('0x6'));var config=require('../../config/environment');var attributes=require('./cmHopperBlack.attributes');module['exports']=function(_0x5bf0e5,_0x40c87d){return _0x5bf0e5[_0x9284('0x7')](_0x9284('0x8'),attributes,{'tableName':_0x9284('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x13f8=['rimraf','exports','CmHopperBlack','cm_hopper_black','util','../../config/logger','moment','bluebird','path'];(function(_0x560370,_0x135a93){var _0x16aef1=function(_0x468863){while(--_0x468863){_0x560370['push'](_0x560370['shift']());}};_0x16aef1(++_0x135a93);}(_0x13f8,0x11b));var _0x813f=function(_0x2f73ec,_0x4b8f92){_0x2f73ec=_0x2f73ec-0x0;var _0x5c52d5=_0x13f8[_0x2f73ec];return _0x5c52d5;};'use strict';var _=require('lodash');var util=require(_0x813f('0x0'));var logger=require(_0x813f('0x1'))('api');var moment=require(_0x813f('0x2'));var BPromise=require(_0x813f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x813f('0x4'));var rimraf=require(_0x813f('0x5'));var config=require('../../config/environment');var attributes=require('./cmHopperBlack.attributes');module[_0x813f('0x6')]=function(_0x42edf7,_0x3cd2d3){return _0x42edf7['define'](_0x813f('0x7'),attributes,{'tableName':_0x813f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d8c8e21..ad6e783 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2eb1=['attributes','limit','include','map','model','then','info','UpdateCmHopperBlack','raw','destroy','DestroyCmHopperBlack','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where'];(function(_0x58267a,_0x54bfe9){var _0x34314a=function(_0x45e8e2){while(--_0x45e8e2){_0x58267a['push'](_0x58267a['shift']());}};_0x34314a(++_0x54bfe9);}(_0x2eb1,0x187));var _0x12eb=function(_0x3aad90,_0x190963){_0x3aad90=_0x3aad90-0x0;var _0x13ecb4=_0x2eb1[_0x3aad90];return _0x13ecb4;};'use strict';var _=require(_0x12eb('0x0'));var util=require('util');var moment=require(_0x12eb('0x1'));var BPromise=require(_0x12eb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x12eb('0x3'));var db=require(_0x12eb('0x4'))['db'];var utils=require(_0x12eb('0x5'));var logger=require(_0x12eb('0x6'))('rpc');var config=require(_0x12eb('0x7'));var jayson=require(_0x12eb('0x8'));var client=jayson[_0x12eb('0x9')][_0x12eb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e4ba3,_0x537948,_0x2defe3){return new BPromise(function(_0x2bb827,_0x44840d){return client[_0x12eb('0xb')](_0x5e4ba3,_0x2defe3)['then'](function(_0xfa6007){logger['info'](_0x12eb('0xc'),_0x537948,_0x12eb('0xd'));logger[_0x12eb('0xe')](_0x12eb('0xf'),_0x537948,_0x12eb('0xd'),JSON[_0x12eb('0x10')](_0xfa6007));if(_0xfa6007[_0x12eb('0x11')]){if(_0xfa6007[_0x12eb('0x11')][_0x12eb('0x12')]===0x1f4){logger[_0x12eb('0x11')](_0x12eb('0xc'),_0x537948,_0xfa6007['error'][_0x12eb('0x13')]);return _0x44840d(_0xfa6007['error'][_0x12eb('0x13')]);}logger[_0x12eb('0x11')](_0x12eb('0xc'),_0x537948,_0xfa6007['error'][_0x12eb('0x13')]);return _0x2bb827(_0xfa6007['error'][_0x12eb('0x13')]);}else{logger['info'](_0x12eb('0xc'),_0x537948,_0x12eb('0xd'));_0x2bb827(_0xfa6007[_0x12eb('0x14')][_0x12eb('0x13')]);}})[_0x12eb('0x15')](function(_0x390b47){logger[_0x12eb('0x11')](_0x12eb('0xc'),_0x537948,_0x390b47);_0x44840d(_0x390b47);});});}exports[_0x12eb('0x16')]=function(_0x224dd4){var _0xb4bd9=this;return new Promise(function(_0x4ba36d,_0x5d47f2){return db[_0x12eb('0x17')][_0x12eb('0x18')]({'raw':_0x224dd4['options']?_0x224dd4[_0x12eb('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x224dd4['options']?_0x224dd4['options'][_0x12eb('0x1a')]||null:null,'attributes':_0x224dd4[_0x12eb('0x19')]?_0x224dd4[_0x12eb('0x19')][_0x12eb('0x1b')]||null:null,'limit':_0x224dd4[_0x12eb('0x19')]?_0x224dd4[_0x12eb('0x19')][_0x12eb('0x1c')]||null:null,'include':_0x224dd4['options']?_0x224dd4[_0x12eb('0x19')][_0x12eb('0x1d')]?_[_0x12eb('0x1e')](_0x224dd4['options'][_0x12eb('0x1d')],function(_0xd246ce){return{'model':db[_0xd246ce['model']],'as':_0xd246ce['as'],'attributes':_0xd246ce[_0x12eb('0x1b')],'include':_0xd246ce[_0x12eb('0x1d')]?_[_0x12eb('0x1e')](_0xd246ce[_0x12eb('0x1d')],function(_0x2564a1){return{'model':db[_0x2564a1[_0x12eb('0x1f')]],'as':_0x2564a1['as'],'attributes':_0x2564a1['attributes'],'include':_0x2564a1[_0x12eb('0x1d')]?_[_0x12eb('0x1e')](_0x2564a1[_0x12eb('0x1d')],function(_0x4e0d6f){return{'model':db[_0x4e0d6f[_0x12eb('0x1f')]],'as':_0x4e0d6f['as'],'attributes':_0x4e0d6f[_0x12eb('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x12eb('0x20')](function(_0x3a8326){logger[_0x12eb('0x21')](_0x12eb('0x16'),_0x224dd4);logger['debug']('GetCmHopperBlack',_0x224dd4,JSON[_0x12eb('0x10')](_0x3a8326));_0x4ba36d(_0x3a8326);})['catch'](function(_0x5e15ae){logger[_0x12eb('0x11')](_0x12eb('0x16'),_0x5e15ae[_0x12eb('0x13')],_0x224dd4);_0x5d47f2(_0xb4bd9[_0x12eb('0x11')](0x1f4,_0x5e15ae[_0x12eb('0x13')]));});});};exports[_0x12eb('0x22')]=function(_0x1fa498){var _0xeb7b03=this;return new Promise(function(_0x3820af,_0xbe0434){return db[_0x12eb('0x17')]['update'](_0x1fa498['body'],{'raw':_0x1fa498[_0x12eb('0x19')]?_0x1fa498['options'][_0x12eb('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fa498[_0x12eb('0x19')]?_0x1fa498['options'][_0x12eb('0x1a')]||null:null,'attributes':_0x1fa498['options']?_0x1fa498['options']['attributes']||null:null,'limit':_0x1fa498[_0x12eb('0x19')]?_0x1fa498[_0x12eb('0x19')][_0x12eb('0x1c')]||null:null})[_0x12eb('0x20')](function(_0x2591dd){logger[_0x12eb('0x21')](_0x12eb('0x22'),_0x1fa498);logger['debug'](_0x12eb('0x22'),_0x1fa498,JSON[_0x12eb('0x10')](_0x2591dd));_0x3820af(_0x2591dd);})[_0x12eb('0x15')](function(_0x4d9a39){logger['error'](_0x12eb('0x22'),_0x4d9a39[_0x12eb('0x13')],_0x1fa498);_0xbe0434(_0xeb7b03[_0x12eb('0x11')](0x1f4,_0x4d9a39[_0x12eb('0x13')]));});});};exports['DestroyCmHopperBlack']=function(_0x1570ef){var _0x57602f=this;return new Promise(function(_0x32b4ca,_0x1d8697){return db[_0x12eb('0x17')][_0x12eb('0x24')]({'where':_0x1570ef[_0x12eb('0x19')]?_0x1570ef[_0x12eb('0x19')][_0x12eb('0x1a')]||null:null})[_0x12eb('0x20')](function(_0x5b1466){logger[_0x12eb('0x21')]('DestroyCmHopperBlack',_0x1570ef);logger['debug'](_0x12eb('0x25'),_0x1570ef,JSON[_0x12eb('0x10')](_0x5b1466));_0x32b4ca(_0x5b1466);})[_0x12eb('0x15')](function(_0x1d0976){logger[_0x12eb('0x11')](_0x12eb('0x25'),_0x1d0976[_0x12eb('0x13')],_0x1570ef);_0x1d8697(_0x57602f[_0x12eb('0x11')](0x1f4,_0x1d0976[_0x12eb('0x13')]));});});};
\ No newline at end of file
+var _0xf5a7=['CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CmHopperBlack','options','raw','where','attributes','limit','map','include','model','GetCmHopperBlack','stringify','UpdateCmHopperBlack','body','destroy','DestroyCmHopperBlack','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info'];(function(_0x340505,_0x42558b){var _0x59671f=function(_0x8e8a69){while(--_0x8e8a69){_0x340505['push'](_0x340505['shift']());}};_0x59671f(++_0x42558b);}(_0xf5a7,0x165));var _0x7f5a=function(_0x16d2d3,_0x5ac78d){_0x16d2d3=_0x16d2d3-0x0;var _0x4d9035=_0xf5a7[_0x16d2d3];return _0x4d9035;};'use strict';var _=require(_0x7f5a('0x0'));var util=require('util');var moment=require(_0x7f5a('0x1'));var BPromise=require('bluebird');var rs=require(_0x7f5a('0x2'));var fs=require('fs');var Redis=require(_0x7f5a('0x3'));var db=require(_0x7f5a('0x4'))['db'];var utils=require(_0x7f5a('0x5'));var logger=require(_0x7f5a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7f5a('0x7'));var client=jayson[_0x7f5a('0x8')][_0x7f5a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x236c4e,_0xe5abe8,_0x19b808){return new BPromise(function(_0x44e87e,_0x524413){return client[_0x7f5a('0xa')](_0x236c4e,_0x19b808)[_0x7f5a('0xb')](function(_0x23d4e4){logger[_0x7f5a('0xc')](_0x7f5a('0xd'),_0xe5abe8,_0x7f5a('0xe'));logger[_0x7f5a('0xf')](_0x7f5a('0x10'),_0xe5abe8,'request\x20sent',JSON['stringify'](_0x23d4e4));if(_0x23d4e4[_0x7f5a('0x11')]){if(_0x23d4e4[_0x7f5a('0x11')][_0x7f5a('0x12')]===0x1f4){logger[_0x7f5a('0x11')](_0x7f5a('0xd'),_0xe5abe8,_0x23d4e4[_0x7f5a('0x11')][_0x7f5a('0x13')]);return _0x524413(_0x23d4e4[_0x7f5a('0x11')][_0x7f5a('0x13')]);}logger[_0x7f5a('0x11')](_0x7f5a('0xd'),_0xe5abe8,_0x23d4e4[_0x7f5a('0x11')][_0x7f5a('0x13')]);return _0x44e87e(_0x23d4e4[_0x7f5a('0x11')][_0x7f5a('0x13')]);}else{logger[_0x7f5a('0xc')](_0x7f5a('0xd'),_0xe5abe8,_0x7f5a('0xe'));_0x44e87e(_0x23d4e4[_0x7f5a('0x14')][_0x7f5a('0x13')]);}})[_0x7f5a('0x15')](function(_0xbe0b4f){logger['error'](_0x7f5a('0xd'),_0xe5abe8,_0xbe0b4f);_0x524413(_0xbe0b4f);});});}exports['GetCmHopperBlack']=function(_0x1bb6f6){var _0x595ffc=this;return new Promise(function(_0x2f2891,_0x344bff){return db[_0x7f5a('0x16')]['findAll']({'raw':_0x1bb6f6[_0x7f5a('0x17')]?_0x1bb6f6[_0x7f5a('0x17')][_0x7f5a('0x18')]===undefined?!![]:![]:!![],'where':_0x1bb6f6[_0x7f5a('0x17')]?_0x1bb6f6[_0x7f5a('0x17')][_0x7f5a('0x19')]||null:null,'attributes':_0x1bb6f6[_0x7f5a('0x17')]?_0x1bb6f6[_0x7f5a('0x17')][_0x7f5a('0x1a')]||null:null,'limit':_0x1bb6f6['options']?_0x1bb6f6[_0x7f5a('0x17')][_0x7f5a('0x1b')]||null:null,'include':_0x1bb6f6[_0x7f5a('0x17')]?_0x1bb6f6[_0x7f5a('0x17')]['include']?_[_0x7f5a('0x1c')](_0x1bb6f6[_0x7f5a('0x17')][_0x7f5a('0x1d')],function(_0x5f1d38){return{'model':db[_0x5f1d38[_0x7f5a('0x1e')]],'as':_0x5f1d38['as'],'attributes':_0x5f1d38[_0x7f5a('0x1a')],'include':_0x5f1d38[_0x7f5a('0x1d')]?_[_0x7f5a('0x1c')](_0x5f1d38[_0x7f5a('0x1d')],function(_0x1673e4){return{'model':db[_0x1673e4[_0x7f5a('0x1e')]],'as':_0x1673e4['as'],'attributes':_0x1673e4[_0x7f5a('0x1a')],'include':_0x1673e4[_0x7f5a('0x1d')]?_[_0x7f5a('0x1c')](_0x1673e4[_0x7f5a('0x1d')],function(_0x2425c3){return{'model':db[_0x2425c3[_0x7f5a('0x1e')]],'as':_0x2425c3['as'],'attributes':_0x2425c3[_0x7f5a('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7f5a('0xb')](function(_0x456191){logger[_0x7f5a('0xc')]('GetCmHopperBlack',_0x1bb6f6);logger[_0x7f5a('0xf')](_0x7f5a('0x1f'),_0x1bb6f6,JSON[_0x7f5a('0x20')](_0x456191));_0x2f2891(_0x456191);})[_0x7f5a('0x15')](function(_0x30f326){logger[_0x7f5a('0x11')](_0x7f5a('0x1f'),_0x30f326[_0x7f5a('0x13')],_0x1bb6f6);_0x344bff(_0x595ffc[_0x7f5a('0x11')](0x1f4,_0x30f326['message']));});});};exports[_0x7f5a('0x21')]=function(_0x4dcceb){var _0x233a6f=this;return new Promise(function(_0x4fcce5,_0x93bac7){return db[_0x7f5a('0x16')]['update'](_0x4dcceb[_0x7f5a('0x22')],{'raw':_0x4dcceb[_0x7f5a('0x17')]?_0x4dcceb[_0x7f5a('0x17')][_0x7f5a('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4dcceb[_0x7f5a('0x17')]?_0x4dcceb['options'][_0x7f5a('0x19')]||null:null,'attributes':_0x4dcceb[_0x7f5a('0x17')]?_0x4dcceb['options'][_0x7f5a('0x1a')]||null:null,'limit':_0x4dcceb[_0x7f5a('0x17')]?_0x4dcceb['options'][_0x7f5a('0x1b')]||null:null})[_0x7f5a('0xb')](function(_0x116769){logger[_0x7f5a('0xc')](_0x7f5a('0x21'),_0x4dcceb);logger['debug'](_0x7f5a('0x21'),_0x4dcceb,JSON[_0x7f5a('0x20')](_0x116769));_0x4fcce5(_0x116769);})[_0x7f5a('0x15')](function(_0x3dbd5b){logger[_0x7f5a('0x11')](_0x7f5a('0x21'),_0x3dbd5b['message'],_0x4dcceb);_0x93bac7(_0x233a6f[_0x7f5a('0x11')](0x1f4,_0x3dbd5b[_0x7f5a('0x13')]));});});};exports['DestroyCmHopperBlack']=function(_0x51136d){var _0x1268fd=this;return new Promise(function(_0x2ff4b1,_0x4409fd){return db['CmHopperBlack'][_0x7f5a('0x23')]({'where':_0x51136d[_0x7f5a('0x17')]?_0x51136d[_0x7f5a('0x17')]['where']||null:null})[_0x7f5a('0xb')](function(_0x9e0627){logger[_0x7f5a('0xc')](_0x7f5a('0x24'),_0x51136d);logger[_0x7f5a('0xf')](_0x7f5a('0x24'),_0x51136d,JSON[_0x7f5a('0x20')](_0x9e0627));_0x2ff4b1(_0x9e0627);})['catch'](function(_0x2ec41f){logger[_0x7f5a('0x11')]('DestroyCmHopperBlack',_0x2ec41f[_0x7f5a('0x13')],_0x51136d);_0x4409fd(_0x1268fd[_0x7f5a('0x11')](0x1f4,_0x2ec41f[_0x7f5a('0x13')]));});});};
\ No newline at end of file
index 210d5cf..2cf18df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x187d=['multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','get','/describe','describe','/:id','show','put','update','delete','destroy','exports'];(function(_0x802fd8,_0x22af66){var _0x49edd4=function(_0x2a9d31){while(--_0x2a9d31){_0x802fd8['push'](_0x802fd8['shift']());}};_0x49edd4(++_0x22af66);}(_0x187d,0x93));var _0xd187=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x187d[_0x5c351c];return _0x26f3b3;};'use strict';var multer=require(_0xd187('0x0'));var util=require('util');var path=require(_0xd187('0x1'));var timeout=require(_0xd187('0x2'));var express=require(_0xd187('0x3'));var router=express[_0xd187('0x4')]();var fs_extra=require(_0xd187('0x5'));var auth=require(_0xd187('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd187('0x7'));var controller=require(_0xd187('0x8'));router['get']('/',auth[_0xd187('0x9')](),controller[_0xd187('0xa')]);router[_0xd187('0xb')](_0xd187('0xc'),auth[_0xd187('0x9')](),controller[_0xd187('0xd')]);router[_0xd187('0xb')](_0xd187('0xe'),auth['isAuthenticated'](),controller[_0xd187('0xf')]);router[_0xd187('0x10')](_0xd187('0xe'),auth[_0xd187('0x9')](),controller[_0xd187('0x11')]);router[_0xd187('0x12')]('/:id',auth[_0xd187('0x9')](),controller[_0xd187('0x13')]);module[_0xd187('0x14')]=router;
\ No newline at end of file
+var _0x1db9=['isAuthenticated','describe','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/describe'];(function(_0x1a3cd0,_0x109deb){var _0x3ccbc6=function(_0x2f903b){while(--_0x2f903b){_0x1a3cd0['push'](_0x1a3cd0['shift']());}};_0x3ccbc6(++_0x109deb);}(_0x1db9,0x176));var _0x91db=function(_0x16abd3,_0x3eef37){_0x16abd3=_0x16abd3-0x0;var _0x5b04e0=_0x1db9[_0x16abd3];return _0x5b04e0;};'use strict';var multer=require(_0x91db('0x0'));var util=require(_0x91db('0x1'));var path=require(_0x91db('0x2'));var timeout=require(_0x91db('0x3'));var express=require(_0x91db('0x4'));var router=express[_0x91db('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x91db('0x6'));var interaction=require(_0x91db('0x7'));var config=require('../../config/environment');var controller=require('./cmHopperBlack.controller');router[_0x91db('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x91db('0x8')](_0x91db('0x9'),auth[_0x91db('0xa')](),controller[_0x91db('0xb')]);router[_0x91db('0x8')]('/:id',auth[_0x91db('0xa')](),controller['show']);router[_0x91db('0xc')](_0x91db('0xd'),auth[_0x91db('0xa')](),controller['update']);router[_0x91db('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x91db('0xf')]=router;
\ No newline at end of file
index 1bd9af6..ec5edbe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4929=['endtime','setDataValue','followuptime','diff','BOOLEAN','moment','INTEGER','STRING','DATE'];(function(_0x2852b4,_0xa93121){var _0x138ced=function(_0x99a88c){while(--_0x99a88c){_0x2852b4['push'](_0x2852b4['shift']());}};_0x138ced(++_0xa93121);}(_0x4929,0xc2));var _0x9492=function(_0x303efb,_0x54a54a){_0x303efb=_0x303efb-0x0;var _0x217597=_0x4929[_0x303efb];return _0x217597;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x9492('0x0'));module['exports']={'state':{'type':Sequelize[_0x9492('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x9492('0x2')]},'scheduledat':{'type':Sequelize[_0x9492('0x3')]},'countbusyretry':{'type':Sequelize[_0x9492('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9492('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x9492('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x9492('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x9492('0x2')]},'originatecalleridname':{'type':Sequelize[_0x9492('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x9492('0x2')]},'starttime':{'type':Sequelize[_0x9492('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x9492('0x3')]},'endtime':{'type':Sequelize[_0x9492('0x3')]},'ringtime':{'type':Sequelize[_0x9492('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x9492('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x9492('0x2')]},'campaign':{'type':Sequelize[_0x9492('0x2')]},'campaigntype':{'type':Sequelize[_0x9492('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x9492('0x2')]},'secondDisposition':{'type':Sequelize[_0x9492('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x9492('0x3')],'set':function(_0x2966bd){var _0x13b0e8=this['getDataValue'](_0x9492('0x4'));if(_0x13b0e8&&_0x2966bd){this[_0x9492('0x5')](_0x9492('0x6'),moment(_0x2966bd)[_0x9492('0x7')](moment(_0x13b0e8),'seconds'));}return this[_0x9492('0x5')]('dispositionat',_0x2966bd);}},'amd':{'type':Sequelize[_0x9492('0x8')],'defaultValue':![]},'fax':{'type':Sequelize[_0x9492('0x8')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x9492('0x3')]},'callback':{'type':Sequelize[_0x9492('0x8')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9492('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9492('0x3')]},'deleted':{'type':Sequelize[_0x9492('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x9492('0x3')]},'recallme':{'type':Sequelize[_0x9492('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x9492('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9492('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9492('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9492('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9492('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x5586=['setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize','INTEGER','STRING','DATE','endtime'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x5586,0xb6));var _0x6558=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x5586[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0x6558('0x0'));var moment=require('moment');module['exports']={'state':{'type':Sequelize[_0x6558('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x6558('0x2')]},'scheduledat':{'type':Sequelize[_0x6558('0x3')]},'countbusyretry':{'type':Sequelize[_0x6558('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6558('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6558('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x6558('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x6558('0x2')]},'originatecalleridname':{'type':Sequelize[_0x6558('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x6558('0x2')]},'starttime':{'type':Sequelize[_0x6558('0x3')]},'responsetime':{'type':Sequelize[_0x6558('0x3')]},'answertime':{'type':Sequelize[_0x6558('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x6558('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x6558('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x6558('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x6558('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x6558('0x2')]},'campaign':{'type':Sequelize[_0x6558('0x2')]},'campaigntype':{'type':Sequelize[_0x6558('0x2')]},'membername':{'type':Sequelize[_0x6558('0x2')]},'reason':{'type':Sequelize[_0x6558('0x2')]},'disposition':{'type':Sequelize[_0x6558('0x2')]},'secondDisposition':{'type':Sequelize[_0x6558('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x6558('0x3')],'set':function(_0x423cd2){var _0xf10b6d=this['getDataValue'](_0x6558('0x4'));if(_0xf10b6d&&_0x423cd2){this[_0x6558('0x5')](_0x6558('0x6'),moment(_0x423cd2)[_0x6558('0x7')](moment(_0xf10b6d),_0x6558('0x8')));}return this[_0x6558('0x5')](_0x6558('0x9'),_0x423cd2);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x6558('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x6558('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6558('0x3')]},'deleted':{'type':Sequelize[_0x6558('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x6558('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x6558('0x3')]},'countnosuchnumberretry':{'type':Sequelize[_0x6558('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x6558('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6558('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6558('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6558('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 9981a89..4af651c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x430c=['field','phone','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','createdAt','CampaignId\x20=\x20?','state\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','from','checkContactHopper','CmHopper','findOne','eml-format','fast-json-patch','request-promise','moment','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','Content-Range','then','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','fieldName','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','describe','update','uniqueid','body','find','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','`state`\x20=\x208,\x201,\x20null','dropContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','scheduledAt','ContactId','ListId','VoiceQueueId','updatedAt','select'];(function(_0x562b5f,_0x533966){var _0x128a56=function(_0x493447){while(--_0x493447){_0x562b5f['push'](_0x562b5f['shift']());}};_0x128a56(++_0x533966);}(_0x430c,0x1a1));var _0xc430=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x430c[_0x344a3f];return _0x264712;};'use strict';var emlformat=require(_0xc430('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xc430('0x1'));var rp=require(_0xc430('0x2'));var moment=require(_0xc430('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc430('0x4'));var csv=require(_0xc430('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc430('0x6'));var _=require('lodash');var squel=require(_0xc430('0x7'));var crypto=require(_0xc430('0x8'));var jsforce=require(_0xc430('0x9'));var deskjs=require(_0xc430('0xa'));var toCsv=require(_0xc430('0x5'));var querystring=require(_0xc430('0xb'));var Papa=require(_0xc430('0xc'));var Redis=require(_0xc430('0xd'));var authService=require(_0xc430('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc430('0xf'));var hardwareService=require(_0xc430('0x10'));var logger=require('../../config/logger')(_0xc430('0x11'));var utils=require('../../config/utils');var config=require(_0xc430('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xc430('0x13'))['db'];function respondWithStatusCode(_0x8aa2e6,_0xc5f92){_0xc5f92=_0xc5f92||0xcc;return function(_0x1fb8ce){if(_0x1fb8ce){return _0x8aa2e6[_0xc430('0x14')](_0xc5f92);}return _0x8aa2e6[_0xc430('0x15')](_0xc5f92)[_0xc430('0x16')]();};}function respondWithResult(_0x54d851,_0x4e9134){_0x4e9134=_0x4e9134||0xc8;return function(_0x3f359c){if(_0x3f359c){return _0x54d851[_0xc430('0x15')](_0x4e9134)[_0xc430('0x17')](_0x3f359c);}};}function respondWithFilteredResult(_0x2ef538,_0x31d3b7){return function(_0x55cc6c){if(_0x55cc6c){var _0x111598=typeof _0x31d3b7['offset']==='undefined'&&typeof _0x31d3b7[_0xc430('0x18')]===_0xc430('0x19');var _0x2327c5=_0x55cc6c['count'];var _0x5d3acc=_0x111598?0x0:_0x31d3b7[_0xc430('0x1a')];var _0x4c1937=_0x111598?_0x55cc6c[_0xc430('0x1b')]:_0x31d3b7['offset']+_0x31d3b7['limit'];var _0x2f3203;if(_0x4c1937>=_0x2327c5){_0x4c1937=_0x2327c5;_0x2f3203=0xc8;}else{_0x2f3203=0xce;}_0x2ef538['status'](_0x2f3203);return _0x2ef538[_0xc430('0x1c')](_0xc430('0x1d'),_0x5d3acc+'-'+_0x4c1937+'/'+_0x2327c5)[_0xc430('0x17')](_0x55cc6c);}return null;};}function patchUpdates(_0x1f90bb){return function(_0x2a1ea1){try{jsonpatch['apply'](_0x2a1ea1,_0x1f90bb,!![]);}catch(_0x388a2f){return BPromise['reject'](_0x388a2f);}return _0x2a1ea1['save']();};}function saveUpdates(_0x3b7c3d,_0x2ea352){return function(_0x3c7afa){if(_0x3c7afa){return _0x3c7afa['update'](_0x3b7c3d)[_0xc430('0x1e')](function(_0x57d26e){return _0x57d26e;});}return null;};}function removeEntity(_0x23425d,_0x22ebfb){return function(_0x4efecd){if(_0x4efecd){return _0x4efecd[_0xc430('0x1f')]()[_0xc430('0x1e')](function(){_0x23425d['status'](0xcc)[_0xc430('0x16')]();});}};}function handleEntityNotFound(_0x59c498,_0x3aa85e){return function(_0x4b5280){if(!_0x4b5280){_0x59c498[_0xc430('0x14')](0x194);}return _0x4b5280;};}function handleError(_0x21e28a,_0x50110b){_0x50110b=_0x50110b||0x1f4;return function(_0x33433f){logger[_0xc430('0x20')](_0x33433f[_0xc430('0x21')]);if(_0x33433f[_0xc430('0x22')]){delete _0x33433f[_0xc430('0x22')];}_0x21e28a['status'](_0x50110b)[_0xc430('0x23')](_0x33433f);};}exports[_0xc430('0x24')]=function(_0x1c1da9,_0x1591e3){var _0x542cba={},_0x1f8086={},_0x4cf56c={'count':0x0,'rows':[]};var _0x1d65ee=_['map'](db[_0xc430('0x25')][_0xc430('0x26')],function(_0xfc8767){return{'name':_0xfc8767[_0xc430('0x27')],'type':_0xfc8767['type'][_0xc430('0x28')]};});_0x1f8086[_0xc430('0x29')]=_[_0xc430('0x2a')](_0x1d65ee,_0xc430('0x22'));_0x1f8086['query']=_[_0xc430('0x2b')](_0x1c1da9[_0xc430('0x2c')]);_0x1f8086['filters']=_[_0xc430('0x2d')](_0x1f8086['model'],_0x1f8086['query']);_0x542cba[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x1f8086[_0xc430('0x29')],qs[_0xc430('0x2f')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x2f')]));_0x542cba[_0xc430('0x2e')]=_0x542cba[_0xc430('0x2e')]['length']?_0x542cba[_0xc430('0x2e')]:_0x1f8086['model'];if(!_0x1c1da9[_0xc430('0x2c')][_0xc430('0x30')](_0xc430('0x31'))){_0x542cba[_0xc430('0x18')]=qs['limit'](_0x1c1da9[_0xc430('0x2c')]['limit']);_0x542cba['offset']=qs[_0xc430('0x1a')](_0x1c1da9[_0xc430('0x2c')]['offset']);}_0x542cba[_0xc430('0x32')]=qs[_0xc430('0x33')](_0x1c1da9[_0xc430('0x2c')][_0xc430('0x33')]);_0x542cba[_0xc430('0x34')]=qs[_0xc430('0x35')](_[_0xc430('0x36')](_0x1c1da9[_0xc430('0x2c')],_0x1f8086[_0xc430('0x35')]),_0x1d65ee);if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x37')]){_0x542cba[_0xc430('0x34')]=_[_0xc430('0x38')](_0x542cba[_0xc430('0x34')],{'$or':_[_0xc430('0x2a')](_0x1d65ee,function(_0x537e4c){if(_0x537e4c[_0xc430('0x39')]!==_0xc430('0x3a')){var _0x24363b={};_0x24363b[_0x537e4c[_0xc430('0x22')]]={'$like':'%'+_0x1c1da9['query'][_0xc430('0x37')]+'%'};return _0x24363b;}})});}_0x542cba=_[_0xc430('0x38')]({},_0x542cba,_0x1c1da9[_0xc430('0x3b')]);var _0x45b3dc={'where':_0x542cba[_0xc430('0x34')]};return db[_0xc430('0x25')]['count'](_0x45b3dc)[_0xc430('0x1e')](function(_0x348f2f){_0x4cf56c[_0xc430('0x1b')]=_0x348f2f;if(_0x1c1da9[_0xc430('0x2c')][_0xc430('0x3c')]){_0x542cba[_0xc430('0x3d')]=[{'all':!![]}];}return db[_0xc430('0x25')][_0xc430('0x3e')](_0x542cba);})[_0xc430('0x1e')](function(_0x4174d2){_0x4cf56c[_0xc430('0x3f')]=_0x4174d2;return _0x4cf56c;})[_0xc430('0x1e')](respondWithFilteredResult(_0x1591e3,_0x542cba))[_0xc430('0x40')](handleError(_0x1591e3,null));};exports[_0xc430('0x41')]=function(_0x5a9c4b,_0x47edb0){var _0x4983e0={'raw':!![],'where':{'id':_0x5a9c4b[_0xc430('0x42')]['id']}},_0x262063={};_0x262063[_0xc430('0x29')]=_[_0xc430('0x2b')](db[_0xc430('0x25')][_0xc430('0x26')]);_0x262063[_0xc430('0x2c')]=_[_0xc430('0x2b')](_0x5a9c4b[_0xc430('0x2c')]);_0x262063[_0xc430('0x35')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],_0x262063[_0xc430('0x2c')]);_0x4983e0[_0xc430('0x2e')]=_[_0xc430('0x2d')](_0x262063[_0xc430('0x29')],qs['fields'](_0x5a9c4b[_0xc430('0x2c')][_0xc430('0x2f')]));_0x4983e0[_0xc430('0x2e')]=_0x4983e0[_0xc430('0x2e')][_0xc430('0x43')]?_0x4983e0[_0xc430('0x2e')]:_0x262063[_0xc430('0x29')];if(_0x5a9c4b[_0xc430('0x2c')]['includeAll']){_0x4983e0[_0xc430('0x3d')]=[{'all':!![]}];}_0x4983e0=_['merge']({},_0x4983e0,_0x5a9c4b[_0xc430('0x3b')]);return db[_0xc430('0x25')]['find'](_0x4983e0)['then'](handleEntityNotFound(_0x47edb0,null))[_0xc430('0x1e')](respondWithResult(_0x47edb0,null))['catch'](handleError(_0x47edb0,null));};exports['describe']=function(_0x10db27,_0x4eafae){return db[_0xc430('0x25')][_0xc430('0x44')]()[_0xc430('0x1e')](respondWithResult(_0x4eafae,null))['catch'](handleError(_0x4eafae,null));};exports[_0xc430('0x45')]=function(_0x2e7052,_0x19e563){if(_0x2e7052['body'][_0xc430('0x46')]){delete _0x2e7052[_0xc430('0x47')][_0xc430('0x46')];}return db[_0xc430('0x25')][_0xc430('0x48')]({'where':{'uniqueid':_0x2e7052[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x19e563,null))['then'](saveUpdates(_0x2e7052[_0xc430('0x47')],null))[_0xc430('0x1e')](respondWithResult(_0x19e563,null))[_0xc430('0x40')](handleError(_0x19e563,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x23cb41,_0x4178d7,_0x2d064b){return db[_0xc430('0x25')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x23cb41[_0xc430('0x42')]['id']},'attributes':[[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x4c')))),_0xc430('0x4d')],[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x4e')))),_0xc430('0x4f')],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x50')))),_0xc430('0x51')],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0xc430('0x52')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x53')))),'dropContacts'],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x54')))),_0xc430('0x55')],[db[_0xc430('0x4a')]['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x56')))),_0xc430('0x57')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db['sequelize']['fn']('IF',db[_0xc430('0x4a')]['literal'](_0xc430('0x58')))),'answeringMachine']]})[_0xc430('0x1e')](handleEntityNotFound(_0x4178d7,null))[_0xc430('0x1e')](respondWithResult(_0x4178d7,null))[_0xc430('0x40')](handleError(_0x4178d7,null));};exports[_0xc430('0x59')]=function(_0x147062,_0x45eec6,_0x5d3393){return db[_0xc430('0x25')][_0xc430('0x3e')]({'raw':![],'where':{'CampaignId':_0x147062['params']['id']},'attributes':[[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x4c')))),_0xc430('0x4d')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x4e')))),'noAnswerContacts'],[db['sequelize']['fn'](_0xc430('0x49'),db['sequelize']['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')]('`state`\x20=\x205,\x201,\x20null'))),_0xc430('0x51')],[db['sequelize']['fn']('COUNT',db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')]['literal'](_0xc430('0x5a')))),'congestionContacts'],[db['sequelize']['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xc430('0x5b')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x54')))),_0xc430('0x55')],[db[_0xc430('0x4a')]['fn'](_0xc430('0x49'),db[_0xc430('0x4a')]['fn']('IF',db[_0xc430('0x4a')][_0xc430('0x4b')](_0xc430('0x56')))),_0xc430('0x57')],[db[_0xc430('0x4a')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xc430('0x4b')](_0xc430('0x58')))),_0xc430('0x5c')]]})['then'](handleEntityNotFound(_0x45eec6,null))['then'](respondWithResult(_0x45eec6,null))[_0xc430('0x40')](handleError(_0x45eec6,null));};exports[_0xc430('0x5d')]=function(_0x31ae3c,_0x19c080,_0x256290){return db[_0xc430('0x5e')][_0xc430('0x48')]({'where':{'id':_0x31ae3c[_0xc430('0x42')]['id']}})[_0xc430('0x1e')](handleEntityNotFound(_0x19c080,null))[_0xc430('0x1e')](function(_0x5ca0f2){var _0x6debfb;if(_0x5ca0f2){_0x6debfb=squel[_0xc430('0x5f')]()[_0xc430('0x60')]('cm_hopper')['fromQuery'](['phone',_0xc430('0x61'),_0xc430('0x62'),_0xc430('0x63'),_0xc430('0x64'),'createdAt',_0xc430('0x65')],squel[_0xc430('0x66')]()[_0xc430('0x67')]('ANY_VALUE(calleridnum)',_0xc430('0x68'))['field'](_0xc430('0x69'),_0xc430('0x61'))[_0xc430('0x67')](_0xc430('0x6a'),_0xc430('0x62'))['field'](_0xc430('0x6b'),_0xc430('0x63'))[_0xc430('0x67')](_0xc430('0x6c'),'VoiceQueueId')['field'](_0xc430('0x69'),'createdAt')['field'](_0xc430('0x69'),_0xc430('0x65'))['from'](_0xc430('0x6d'))[_0xc430('0x34')](_0xc430('0x6e'),_0x31ae3c[_0xc430('0x42')]['id'][_0xc430('0x6f')]())[_0xc430('0x34')]('state\x20=\x20?',_0x31ae3c[_0xc430('0x47')][_0xc430('0x70')][_0xc430('0x6f')]())[_0xc430('0x34')]('calleridnum\x20IS\x20NOT\x20NULL')[_0xc430('0x34')](_0xc430('0x71'),squel[_0xc430('0x66')]()['field'](_0xc430('0x68'))['from']('cm_hopper')[_0xc430('0x34')]('VoiceQueueId\x20=\x20?',_0x31ae3c[_0xc430('0x42')]['id']['toString']()))[_0xc430('0x34')](_0xc430('0x71'),squel['select']()[_0xc430('0x67')](_0xc430('0x72'))['from'](_0xc430('0x6d'))[_0xc430('0x34')]('VoiceQueueId\x20=\x20?',_0x31ae3c[_0xc430('0x42')]['id'][_0xc430('0x6f')]())['where'](_0xc430('0x73')))[_0xc430('0x74')](_0xc430('0x62')))[_0xc430('0x6f')]();return db[_0xc430('0x4a')][_0xc430('0x2c')](_0x6debfb);}return[];})[_0xc430('0x1e')](respondWithResult(_0x19c080,null))[_0xc430('0x40')](handleError(_0x19c080,null));};exports[_0xc430('0x75')]=function(_0x19789f,_0x24b380,_0x4fe467){return db[_0xc430('0x76')][_0xc430('0x48')]({'where':{'id':_0x19789f[_0xc430('0x42')]['id']}})['then'](handleEntityNotFound(_0x24b380,null))['then'](function(_0x150a8a){var _0x4edead;if(_0x150a8a){_0x4edead=squel[_0xc430('0x5f')]()[_0xc430('0x60')]('cm_hopper')['fromQuery']([_0xc430('0x68'),_0xc430('0x61'),_0xc430('0x62'),'ListId',_0xc430('0x77'),'createdAt','updatedAt'],squel[_0xc430('0x66')]()[_0xc430('0x67')](_0xc430('0x78'),'phone')[_0xc430('0x67')](_0xc430('0x69'),_0xc430('0x61'))[_0xc430('0x67')](_0xc430('0x6a'),'ContactId')['field'](_0xc430('0x6b'),_0xc430('0x63'))[_0xc430('0x67')](_0xc430('0x79'),_0xc430('0x77'))[_0xc430('0x67')](_0xc430('0x69'),_0xc430('0x7a'))[_0xc430('0x67')](_0xc430('0x69'),_0xc430('0x65'))['from'](_0xc430('0x6d'))[_0xc430('0x34')](_0xc430('0x7b'),_0x19789f[_0xc430('0x42')]['id']['toString']())['where'](_0xc430('0x7c'),_0x19789f['body'][_0xc430('0x70')][_0xc430('0x6f')]())[_0xc430('0x34')](_0xc430('0x7d'))[_0xc430('0x34')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()['field']('phone')[_0xc430('0x7e')]('cm_hopper')['where'](_0xc430('0x7b'),_0x19789f[_0xc430('0x42')]['id'][_0xc430('0x6f')]()))[_0xc430('0x34')](_0xc430('0x71'),squel[_0xc430('0x66')]()[_0xc430('0x67')](_0xc430('0x72'))[_0xc430('0x7e')](_0xc430('0x6d'))[_0xc430('0x34')](_0xc430('0x7b'),_0x19789f[_0xc430('0x42')]['id']['toString']())[_0xc430('0x34')](_0xc430('0x73')))[_0xc430('0x74')](_0xc430('0x62')))[_0xc430('0x6f')]();return db[_0xc430('0x4a')][_0xc430('0x2c')](_0x4edead);}return[];})[_0xc430('0x1e')](respondWithResult(_0x24b380,null))['catch'](handleError(_0x24b380,null));};exports[_0xc430('0x7f')]=function(_0x6e48a3,_0x5be78a,_0x3bd6e1){return db[_0xc430('0x80')][_0xc430('0x81')]({'where':{'VoiceQueueId':_0x6e48a3[_0xc430('0x47')]['VoiceQueueId'],'CampaignId':_0x6e48a3[_0xc430('0x47')]['CampaignId'],'ContactId':_0x6e48a3['body'][_0xc430('0x62')]}})[_0xc430('0x1e')](handleEntityNotFound(_0x5be78a,null))[_0xc430('0x1e')](function(_0x207067){if(_0x207067){return _0x207067;}return null;})[_0xc430('0x1e')](respondWithResult(_0x5be78a,null))[_0xc430('0x40')](handleError(_0x5be78a,null));};
\ No newline at end of file
+var _0xe3da=['COUNT','`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','`state`\x20=\x2019,\x201,\x20null','noSuchContacts','congestionContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','phone','ContactId','select','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','cm_hopper_final','toString','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','cm_hopper','VoiceQueueId\x20=\x20?','from','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','fromQuery','CampaignId','createdAt','updatedAt','ANY_VALUE(calleridnum)','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','calleridnum','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','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','limit','undefined','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','CmHopperFinal','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','order','sort','where','pick','map','VIRTUAL','filter','merge','options','count','include','findAll','rows','catch','show','params','length','includeAll','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts'];(function(_0x11ea14,_0x5bddf5){var _0x5286f8=function(_0x31ba7a){while(--_0x31ba7a){_0x11ea14['push'](_0x11ea14['shift']());}};_0x5286f8(++_0x5bddf5);}(_0xe3da,0x1cd));var _0xae3d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe3da[_0x2641f9];return _0x585741;};'use strict';var emlformat=require(_0xae3d('0x0'));var rimraf=require(_0xae3d('0x1'));var zipdir=require(_0xae3d('0x2'));var jsonpatch=require(_0xae3d('0x3'));var rp=require(_0xae3d('0x4'));var moment=require(_0xae3d('0x5'));var BPromise=require(_0xae3d('0x6'));var Mustache=require(_0xae3d('0x7'));var util=require(_0xae3d('0x8'));var path=require(_0xae3d('0x9'));var sox=require(_0xae3d('0xa'));var csv=require(_0xae3d('0xb'));var ejs=require(_0xae3d('0xc'));var fs=require('fs');var fs_extra=require(_0xae3d('0xd'));var _=require(_0xae3d('0xe'));var squel=require(_0xae3d('0xf'));var crypto=require('crypto');var jsforce=require(_0xae3d('0x10'));var deskjs=require(_0xae3d('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xae3d('0x12'));var Redis=require(_0xae3d('0x13'));var authService=require(_0xae3d('0x14'));var qs=require(_0xae3d('0x15'));var as=require(_0xae3d('0x16'));var hardwareService=require(_0xae3d('0x17'));var logger=require('../../config/logger')(_0xae3d('0x18'));var utils=require('../../config/utils');var config=require(_0xae3d('0x19'));var licenseUtil=require(_0xae3d('0x1a'));var db=require(_0xae3d('0x1b'))['db'];function respondWithStatusCode(_0x172f7a,_0x48aa74){_0x48aa74=_0x48aa74||0xcc;return function(_0xfb7869){if(_0xfb7869){return _0x172f7a[_0xae3d('0x1c')](_0x48aa74);}return _0x172f7a[_0xae3d('0x1d')](_0x48aa74)[_0xae3d('0x1e')]();};}function respondWithResult(_0x2afdd3,_0x430659){_0x430659=_0x430659||0xc8;return function(_0x31498d){if(_0x31498d){return _0x2afdd3['status'](_0x430659)[_0xae3d('0x1f')](_0x31498d);}};}function respondWithFilteredResult(_0x42f4b4,_0x46295b){return function(_0x230afb){if(_0x230afb){var _0x192c13=typeof _0x46295b[_0xae3d('0x20')]==='undefined'&&typeof _0x46295b[_0xae3d('0x21')]===_0xae3d('0x22');var _0x2e31f1=_0x230afb['count'];var _0x3f8cf9=_0x192c13?0x0:_0x46295b[_0xae3d('0x20')];var _0x558e42=_0x192c13?_0x230afb['count']:_0x46295b[_0xae3d('0x20')]+_0x46295b[_0xae3d('0x21')];var _0x19c44d;if(_0x558e42>=_0x2e31f1){_0x558e42=_0x2e31f1;_0x19c44d=0xc8;}else{_0x19c44d=0xce;}_0x42f4b4[_0xae3d('0x1d')](_0x19c44d);return _0x42f4b4[_0xae3d('0x23')]('Content-Range',_0x3f8cf9+'-'+_0x558e42+'/'+_0x2e31f1)[_0xae3d('0x1f')](_0x230afb);}return null;};}function patchUpdates(_0x48f00e){return function(_0x4a09c2){try{jsonpatch[_0xae3d('0x24')](_0x4a09c2,_0x48f00e,!![]);}catch(_0x1415e8){return BPromise[_0xae3d('0x25')](_0x1415e8);}return _0x4a09c2[_0xae3d('0x26')]();};}function saveUpdates(_0x3e7afc,_0x26c419){return function(_0x155099){if(_0x155099){return _0x155099[_0xae3d('0x27')](_0x3e7afc)[_0xae3d('0x28')](function(_0x300be8){return _0x300be8;});}return null;};}function removeEntity(_0x9bf34a,_0x37f5ff){return function(_0x1b2acb){if(_0x1b2acb){return _0x1b2acb[_0xae3d('0x29')]()[_0xae3d('0x28')](function(){_0x9bf34a[_0xae3d('0x1d')](0xcc)[_0xae3d('0x1e')]();});}};}function handleEntityNotFound(_0x2131e9,_0x1b1217){return function(_0x5d45db){if(!_0x5d45db){_0x2131e9[_0xae3d('0x1c')](0x194);}return _0x5d45db;};}function handleError(_0x185e71,_0xb5940){_0xb5940=_0xb5940||0x1f4;return function(_0x52df0f){logger[_0xae3d('0x2a')](_0x52df0f[_0xae3d('0x2b')]);if(_0x52df0f[_0xae3d('0x2c')]){delete _0x52df0f['name'];}_0x185e71['status'](_0xb5940)[_0xae3d('0x2d')](_0x52df0f);};}exports[_0xae3d('0x2e')]=function(_0x3a5840,_0x3114f9){var _0xb69ec9={},_0x561371={},_0x1d1483={'count':0x0,'rows':[]};var _0x3a2434=_['map'](db[_0xae3d('0x2f')][_0xae3d('0x30')],function(_0x2cf750){return{'name':_0x2cf750[_0xae3d('0x31')],'type':_0x2cf750[_0xae3d('0x32')][_0xae3d('0x33')]};});_0x561371['model']=_['map'](_0x3a2434,'name');_0x561371[_0xae3d('0x34')]=_[_0xae3d('0x35')](_0x3a5840[_0xae3d('0x34')]);_0x561371[_0xae3d('0x36')]=_['intersection'](_0x561371[_0xae3d('0x37')],_0x561371[_0xae3d('0x34')]);_0xb69ec9[_0xae3d('0x38')]=_[_0xae3d('0x39')](_0x561371[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0x3a5840[_0xae3d('0x34')]['fields']));_0xb69ec9[_0xae3d('0x38')]=_0xb69ec9['attributes']['length']?_0xb69ec9[_0xae3d('0x38')]:_0x561371['model'];if(!_0x3a5840[_0xae3d('0x34')]['hasOwnProperty']('nolimit')){_0xb69ec9[_0xae3d('0x21')]=qs[_0xae3d('0x21')](_0x3a5840[_0xae3d('0x34')]['limit']);_0xb69ec9[_0xae3d('0x20')]=qs['offset'](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x20')]);}_0xb69ec9[_0xae3d('0x3b')]=qs[_0xae3d('0x3c')](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x3c')]);_0xb69ec9[_0xae3d('0x3d')]=qs[_0xae3d('0x36')](_[_0xae3d('0x3e')](_0x3a5840[_0xae3d('0x34')],_0x561371[_0xae3d('0x36')]),_0x3a2434);if(_0x3a5840['query']['filter']){_0xb69ec9[_0xae3d('0x3d')]=_['merge'](_0xb69ec9[_0xae3d('0x3d')],{'$or':_[_0xae3d('0x3f')](_0x3a2434,function(_0x1db3c1){if(_0x1db3c1[_0xae3d('0x32')]!==_0xae3d('0x40')){var _0x35db44={};_0x35db44[_0x1db3c1[_0xae3d('0x2c')]]={'$like':'%'+_0x3a5840[_0xae3d('0x34')][_0xae3d('0x41')]+'%'};return _0x35db44;}})});}_0xb69ec9=_[_0xae3d('0x42')]({},_0xb69ec9,_0x3a5840[_0xae3d('0x43')]);var _0x549db8={'where':_0xb69ec9[_0xae3d('0x3d')]};return db[_0xae3d('0x2f')][_0xae3d('0x44')](_0x549db8)['then'](function(_0x4df102){_0x1d1483[_0xae3d('0x44')]=_0x4df102;if(_0x3a5840[_0xae3d('0x34')]['includeAll']){_0xb69ec9[_0xae3d('0x45')]=[{'all':!![]}];}return db[_0xae3d('0x2f')][_0xae3d('0x46')](_0xb69ec9);})[_0xae3d('0x28')](function(_0x436a04){_0x1d1483[_0xae3d('0x47')]=_0x436a04;return _0x1d1483;})['then'](respondWithFilteredResult(_0x3114f9,_0xb69ec9))[_0xae3d('0x48')](handleError(_0x3114f9,null));};exports[_0xae3d('0x49')]=function(_0xce7f34,_0x938811){var _0x1fef90={'raw':!![],'where':{'id':_0xce7f34[_0xae3d('0x4a')]['id']}},_0x515220={};_0x515220['model']=_[_0xae3d('0x35')](db[_0xae3d('0x2f')][_0xae3d('0x30')]);_0x515220[_0xae3d('0x34')]=_['keys'](_0xce7f34['query']);_0x515220['filters']=_[_0xae3d('0x39')](_0x515220[_0xae3d('0x37')],_0x515220['query']);_0x1fef90['attributes']=_['intersection'](_0x515220[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0xce7f34[_0xae3d('0x34')][_0xae3d('0x3a')]));_0x1fef90[_0xae3d('0x38')]=_0x1fef90[_0xae3d('0x38')][_0xae3d('0x4b')]?_0x1fef90['attributes']:_0x515220['model'];if(_0xce7f34['query'][_0xae3d('0x4c')]){_0x1fef90['include']=[{'all':!![]}];}_0x1fef90=_[_0xae3d('0x42')]({},_0x1fef90,_0xce7f34[_0xae3d('0x43')]);return db[_0xae3d('0x2f')][_0xae3d('0x4d')](_0x1fef90)[_0xae3d('0x28')](handleEntityNotFound(_0x938811,null))[_0xae3d('0x28')](respondWithResult(_0x938811,null))[_0xae3d('0x48')](handleError(_0x938811,null));};exports[_0xae3d('0x4e')]=function(_0x38f92d,_0x4ed0f9){return db[_0xae3d('0x2f')]['describe']()['then'](respondWithResult(_0x4ed0f9,null))['catch'](handleError(_0x4ed0f9,null));};exports[_0xae3d('0x27')]=function(_0xc8f551,_0x39f213){if(_0xc8f551[_0xae3d('0x4f')]['uniqueid']){delete _0xc8f551['body'][_0xae3d('0x50')];}return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'uniqueid':_0xc8f551[_0xae3d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x39f213,null))[_0xae3d('0x28')](saveUpdates(_0xc8f551[_0xae3d('0x4f')],null))[_0xae3d('0x28')](respondWithResult(_0x39f213,null))[_0xae3d('0x48')](handleError(_0x39f213,null));};exports[_0xae3d('0x51')]=function(_0x38ccf1,_0x3e30ea,_0x291c7d){return db[_0xae3d('0x2f')][_0xae3d('0x46')]({'raw':![],'where':{'VoiceQueueId':_0x38ccf1[_0xae3d('0x4a')]['id']},'attributes':[[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x54')))),'noSuchContacts'],[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x55')))),_0xae3d('0x56')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x58')))),_0xae3d('0x59')],[db[_0xae3d('0x52')]['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x5a')))),'congestionContacts'],[db['sequelize']['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db['sequelize']['literal'](_0xae3d('0x5b')))),_0xae3d('0x5c')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x5d')))),_0xae3d('0x5e')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x5f')))),_0xae3d('0x60')],[db[_0xae3d('0x52')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x61')))),'answeringMachine']]})[_0xae3d('0x28')](handleEntityNotFound(_0x3e30ea,null))[_0xae3d('0x28')](respondWithResult(_0x3e30ea,null))[_0xae3d('0x48')](handleError(_0x3e30ea,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x3a39ed,_0x31b362,_0x253ee4){return db[_0xae3d('0x2f')][_0xae3d('0x46')]({'raw':![],'where':{'CampaignId':_0x3a39ed[_0xae3d('0x4a')]['id']},'attributes':[[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x54')))),_0xae3d('0x62')],[db['sequelize']['fn']('COUNT',db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x55')))),'noAnswerContacts'],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x58')))),_0xae3d('0x59')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x5a')))),_0xae3d('0x63')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')](_0xae3d('0x5b')))),_0xae3d('0x5c')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db[_0xae3d('0x52')][_0xae3d('0x53')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xae3d('0x5e')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db['sequelize']['fn']('IF',db['sequelize'][_0xae3d('0x53')](_0xae3d('0x5f')))),_0xae3d('0x60')],[db[_0xae3d('0x52')]['fn'](_0xae3d('0x57'),db[_0xae3d('0x52')]['fn']('IF',db[_0xae3d('0x52')]['literal'](_0xae3d('0x61')))),_0xae3d('0x64')]]})['then'](handleEntityNotFound(_0x31b362,null))[_0xae3d('0x28')](respondWithResult(_0x31b362,null))['catch'](handleError(_0x31b362,null));};exports[_0xae3d('0x65')]=function(_0x115e99,_0x26c409,_0x4709ea){return db[_0xae3d('0x66')]['find']({'where':{'id':_0x115e99[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x26c409,null))[_0xae3d('0x28')](function(_0x5f1e9c){var _0x546991;if(_0x5f1e9c){_0x546991=squel[_0xae3d('0x67')]()[_0xae3d('0x68')]('cm_hopper')['fromQuery']([_0xae3d('0x69'),'scheduledAt',_0xae3d('0x6a'),'ListId','VoiceQueueId','createdAt','updatedAt'],squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')]('ANY_VALUE(calleridnum)','phone')[_0xae3d('0x6c')](_0xae3d('0x6d'),_0xae3d('0x6e'))[_0xae3d('0x6c')](_0xae3d('0x6f'),_0xae3d('0x6a'))[_0xae3d('0x6c')]('ANY_VALUE(ListId)',_0xae3d('0x70'))[_0xae3d('0x6c')](_0xae3d('0x71'),_0xae3d('0x72'))[_0xae3d('0x6c')](_0xae3d('0x6d'),'createdAt')[_0xae3d('0x6c')](_0xae3d('0x6d'),'updatedAt')['from'](_0xae3d('0x73'))[_0xae3d('0x3d')]('VoiceQueueId\x20=\x20?',_0x115e99[_0xae3d('0x4a')]['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x20?',_0x115e99[_0xae3d('0x4f')][_0xae3d('0x75')]['toString']())['where'](_0xae3d('0x76'))[_0xae3d('0x3d')](_0xae3d('0x77'),squel['select']()[_0xae3d('0x6c')](_0xae3d('0x69'))['from'](_0xae3d('0x78'))[_0xae3d('0x3d')](_0xae3d('0x79'),_0x115e99['params']['id'][_0xae3d('0x74')]()))[_0xae3d('0x3d')](_0xae3d('0x77'),squel['select']()[_0xae3d('0x6c')]('calleridnum')[_0xae3d('0x7a')]('cm_hopper_final')['where'](_0xae3d('0x79'),_0x115e99['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')](_0xae3d('0x7b')))[_0xae3d('0x7c')]('ContactId'))[_0xae3d('0x74')]();return db[_0xae3d('0x52')][_0xae3d('0x34')](_0x546991);}return[];})[_0xae3d('0x28')](respondWithResult(_0x26c409,null))[_0xae3d('0x48')](handleError(_0x26c409,null));};exports[_0xae3d('0x7d')]=function(_0x1c5f67,_0xa083d0,_0x26e422){return db[_0xae3d('0x7e')][_0xae3d('0x4d')]({'where':{'id':_0x1c5f67[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0xa083d0,null))[_0xae3d('0x28')](function(_0xf281f5){var _0x3261e5;if(_0xf281f5){_0x3261e5=squel[_0xae3d('0x67')]()['into'](_0xae3d('0x78'))[_0xae3d('0x7f')]([_0xae3d('0x69'),_0xae3d('0x6e'),_0xae3d('0x6a'),'ListId',_0xae3d('0x80'),_0xae3d('0x81'),_0xae3d('0x82')],squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')](_0xae3d('0x83'),_0xae3d('0x69'))[_0xae3d('0x6c')]('NOW()',_0xae3d('0x6e'))[_0xae3d('0x6c')](_0xae3d('0x6f'),'ContactId')[_0xae3d('0x6c')](_0xae3d('0x84'),_0xae3d('0x70'))['field'](_0xae3d('0x85'),_0xae3d('0x80'))['field'](_0xae3d('0x6d'),'createdAt')[_0xae3d('0x6c')]('NOW()',_0xae3d('0x82'))[_0xae3d('0x7a')](_0xae3d('0x73'))[_0xae3d('0x3d')](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x20?',_0x1c5f67['body'][_0xae3d('0x75')][_0xae3d('0x74')]())[_0xae3d('0x3d')](_0xae3d('0x76'))['where'](_0xae3d('0x77'),squel[_0xae3d('0x6b')]()[_0xae3d('0x6c')]('phone')['from'](_0xae3d('0x78'))['where'](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]()))[_0xae3d('0x3d')](_0xae3d('0x77'),squel[_0xae3d('0x6b')]()['field'](_0xae3d('0x87'))[_0xae3d('0x7a')](_0xae3d('0x73'))['where'](_0xae3d('0x86'),_0x1c5f67['params']['id'][_0xae3d('0x74')]())[_0xae3d('0x3d')]('state\x20=\x204'))['group'](_0xae3d('0x6a')))['toString']();return db['sequelize'][_0xae3d('0x34')](_0x3261e5);}return[];})['then'](respondWithResult(_0xa083d0,null))[_0xae3d('0x48')](handleError(_0xa083d0,null));};exports['checkContactHopper']=function(_0x31f606,_0x47aa7a,_0x27c0ff){return db['CmHopper'][_0xae3d('0x88')]({'where':{'VoiceQueueId':_0x31f606['body'][_0xae3d('0x72')],'CampaignId':_0x31f606[_0xae3d('0x4f')][_0xae3d('0x80')],'ContactId':_0x31f606[_0xae3d('0x4f')][_0xae3d('0x6a')]}})[_0xae3d('0x28')](handleEntityNotFound(_0x47aa7a,null))[_0xae3d('0x28')](function(_0x95c4ce){if(_0x95c4ce){return _0x95c4ce;}return null;})[_0xae3d('0x28')](respondWithResult(_0x47aa7a,null))['catch'](handleError(_0x47aa7a,null));};
\ No newline at end of file
index 0574df2..86e38f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9824=['rimraf','../../config/environment','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x4de586,_0x183427){var _0x46baf5=function(_0x1157f0){while(--_0x1157f0){_0x4de586['push'](_0x4de586['shift']());}};_0x46baf5(++_0x183427);}(_0x9824,0x6f));var _0x4982=function(_0x22ce61,_0x9c0f01){_0x22ce61=_0x22ce61-0x0;var _0x57bb55=_0x9824[_0x22ce61];return _0x57bb55;};'use strict';var _=require(_0x4982('0x0'));var util=require(_0x4982('0x1'));var logger=require(_0x4982('0x2'))(_0x4982('0x3'));var moment=require('moment');var BPromise=require(_0x4982('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4982('0x5'));var rimraf=require(_0x4982('0x6'));var config=require(_0x4982('0x7'));var attributes=require('./cmHopperFinal.attributes');module['exports']=function(_0x200fc5,_0x336416){return _0x200fc5[_0x4982('0x8')](_0x4982('0x9'),attributes,{'tableName':_0x4982('0xa'),'paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0x4982('0xb')]},{'name':_0x4982('0xc'),'fields':[_0x4982('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd391=['cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','CmHopperFinal'];(function(_0x1e46b1,_0x1dbaba){var _0x3629cf=function(_0x162007){while(--_0x162007){_0x1e46b1['push'](_0x1e46b1['shift']());}};_0x3629cf(++_0x1dbaba);}(_0xd391,0xf3));var _0x1d39=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xd391[_0x27af45];return _0x18df21;};'use strict';var _=require(_0x1d39('0x0'));var util=require('util');var logger=require(_0x1d39('0x1'))('api');var moment=require(_0x1d39('0x2'));var BPromise=require(_0x1d39('0x3'));var rp=require(_0x1d39('0x4'));var fs=require('fs');var path=require(_0x1d39('0x5'));var rimraf=require(_0x1d39('0x6'));var config=require(_0x1d39('0x7'));var attributes=require('./cmHopperFinal.attributes');module['exports']=function(_0x11f22e,_0x4c0d1a){return _0x11f22e['define'](_0x1d39('0x8'),attributes,{'tableName':_0x1d39('0x9'),'paranoid':![],'indexes':[{'name':_0x1d39('0xa'),'fields':[_0x1d39('0xa')]},{'name':_0x1d39('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 0d657fe..006719e 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(_0x4aebb6,_0x2208f7){var _0x2d62a0=function(_0x335a60){while(--_0x335a60){_0x4aebb6['push'](_0x4aebb6['shift']());}};_0x2d62a0(++_0x2208f7);}(_0xb10b,0x12a));var _0xbb10=function(_0x38c652,_0x1ea1b7){_0x38c652=_0x38c652-0x0;var _0x218a37=_0xb10b[_0x38c652];return _0x218a37;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});};
\ No newline at end of file
+var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x863f43,_0x2d65f1){var _0x535e3d=function(_0x50bcce){while(--_0x50bcce){_0x863f43['push'](_0x863f43['shift']());}};_0x535e3d(++_0x2d65f1);}(_0x7a54,0x106));var _0x47a5=function(_0xbc6fba,_0x58ef72){_0xbc6fba=_0xbc6fba-0x0;var _0x3dac16=_0x7a54[_0xbc6fba];return _0x3dac16;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};
\ No newline at end of file
index f80e049..87a6530 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5ce3=['checkContactHopper','update','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsIvrCampaignHopperFinal','/checkContactHopper'];(function(_0xe44380,_0x1fb0d8){var _0x2a3edd=function(_0x5c75cb){while(--_0x5c75cb){_0xe44380['push'](_0xe44380['shift']());}};_0x2a3edd(++_0x1fb0d8);}(_0x5ce3,0x80));var _0x35ce=function(_0x46b1c9,_0x169f87){_0x46b1c9=_0x46b1c9-0x0;var _0x17569c=_0x5ce3[_0x46b1c9];return _0x17569c;};'use strict';var multer=require(_0x35ce('0x0'));var util=require(_0x35ce('0x1'));var path=require(_0x35ce('0x2'));var timeout=require('connect-timeout');var express=require(_0x35ce('0x3'));var router=express['Router']();var fs_extra=require(_0x35ce('0x4'));var auth=require(_0x35ce('0x5'));var interaction=require(_0x35ce('0x6'));var config=require(_0x35ce('0x7'));var controller=require(_0x35ce('0x8'));router[_0x35ce('0x9')]('/',auth[_0x35ce('0xa')](),controller[_0x35ce('0xb')]);router[_0x35ce('0x9')](_0x35ce('0xc'),auth['isAuthenticated'](),controller[_0x35ce('0xd')]);router['get'](_0x35ce('0xe'),auth[_0x35ce('0xa')](),controller['show']);router[_0x35ce('0x9')](_0x35ce('0xf'),auth['isAuthenticated'](),controller[_0x35ce('0x10')]);router[_0x35ce('0x9')](_0x35ce('0x11'),auth['isAuthenticated'](),controller[_0x35ce('0x12')]);router[_0x35ce('0x13')]('/voice/queue/moveContacts/:id',auth[_0x35ce('0xa')](),controller['moveContactsQueueCampaignHopperFinal']);router['post']('/voice/campaign/moveContacts/:id',auth['isAuthenticated'](),controller[_0x35ce('0x14')]);router[_0x35ce('0x13')](_0x35ce('0x15'),auth[_0x35ce('0xa')](),controller[_0x35ce('0x16')]);router['put'](_0x35ce('0xe'),auth['isAuthenticated'](),controller[_0x35ce('0x17')]);module[_0x35ce('0x18')]=router;
\ No newline at end of file
+var _0x3b94=['isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','/describe'];(function(_0x2490a9,_0x182636){var _0x3552f9=function(_0x213899){while(--_0x213899){_0x2490a9['push'](_0x2490a9['shift']());}};_0x3552f9(++_0x182636);}(_0x3b94,0xb3));var _0x43b9=function(_0x94c66,_0x5649fe){_0x94c66=_0x94c66-0x0;var _0xb46c11=_0x3b94[_0x94c66];return _0xb46c11;};'use strict';var multer=require(_0x43b9('0x0'));var util=require('util');var path=require(_0x43b9('0x1'));var timeout=require(_0x43b9('0x2'));var express=require(_0x43b9('0x3'));var router=express[_0x43b9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x43b9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x43b9('0x6'));var controller=require('./cmHopperFinal.controller');router[_0x43b9('0x7')]('/',auth['isAuthenticated'](),controller[_0x43b9('0x8')]);router[_0x43b9('0x7')](_0x43b9('0x9'),auth[_0x43b9('0xa')](),controller[_0x43b9('0xb')]);router[_0x43b9('0x7')](_0x43b9('0xc'),auth[_0x43b9('0xa')](),controller[_0x43b9('0xd')]);router['get'](_0x43b9('0xe'),auth[_0x43b9('0xa')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x43b9('0x7')](_0x43b9('0xf'),auth[_0x43b9('0xa')](),controller[_0x43b9('0x10')]);router[_0x43b9('0x11')](_0x43b9('0x12'),auth[_0x43b9('0xa')](),controller[_0x43b9('0x13')]);router[_0x43b9('0x11')](_0x43b9('0x14'),auth[_0x43b9('0xa')](),controller[_0x43b9('0x15')]);router[_0x43b9('0x11')](_0x43b9('0x16'),auth[_0x43b9('0xa')](),controller[_0x43b9('0x17')]);router[_0x43b9('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x43b9('0x19')]);module[_0x43b9('0x1a')]=router;
\ No newline at end of file
index 2b29a2f..afcb1b8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91d0=['BOOLEAN','sequelize','INTEGER','STRING','DATE'];(function(_0x1ebdb0,_0x41a16f){var _0x2af68f=function(_0xd8e4f4){while(--_0xd8e4f4){_0x1ebdb0['push'](_0x1ebdb0['shift']());}};_0x2af68f(++_0x41a16f);}(_0x91d0,0xb0));var _0x091d=function(_0x119b3e,_0x588d50){_0x119b3e=_0x119b3e-0x0;var _0x1169ae=_0x91d0[_0x119b3e];return _0x1169ae;};'use strict';var Sequelize=require(_0x091d('0x0'));module['exports']={'state':{'type':Sequelize[_0x091d('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x091d('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x091d('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x091d('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x091d('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0x091d('0x2')]},'originatecalleridname':{'type':Sequelize[_0x091d('0x2')]},'calleridnum':{'type':Sequelize[_0x091d('0x2')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x091d('0x3')]},'responsetime':{'type':Sequelize[_0x091d('0x3')]},'answertime':{'type':Sequelize[_0x091d('0x3')]},'droptime':{'type':Sequelize[_0x091d('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x091d('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x091d('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x091d('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x091d('0x2')]},'campaign':{'type':Sequelize[_0x091d('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x091d('0x2')]},'reason':{'type':Sequelize[_0x091d('0x2')]},'amd':{'type':Sequelize[_0x091d('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x091d('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x091d('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x091d('0x3')]},'recallme':{'type':Sequelize[_0x091d('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x091d('0x3')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x091d('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x091d('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x091d('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x091d('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x2c73=['INTEGER','DATE','STRING','BOOLEAN'];(function(_0x3ccd61,_0x4a33a2){var _0x57abca=function(_0x2f145b){while(--_0x2f145b){_0x3ccd61['push'](_0x3ccd61['shift']());}};_0x57abca(++_0x4a33a2);}(_0x2c73,0xf4));var _0x32c7=function(_0x9035bd,_0x496f77){_0x9035bd=_0x9035bd-0x0;var _0x529ea6=_0x2c73[_0x9035bd];return _0x529ea6;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0x32c7('0x0')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x32c7('0x1')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x32c7('0x0')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x32c7('0x0')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x32c7('0x0')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x32c7('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x32c7('0x2')]},'originatecalleridname':{'type':Sequelize[_0x32c7('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x32c7('0x2')]},'starttime':{'type':Sequelize[_0x32c7('0x1')]},'responsetime':{'type':Sequelize[_0x32c7('0x1')]},'answertime':{'type':Sequelize[_0x32c7('0x1')]},'droptime':{'type':Sequelize[_0x32c7('0x1')]},'endtime':{'type':Sequelize[_0x32c7('0x1')]},'ringtime':{'type':Sequelize[_0x32c7('0x0')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x32c7('0x0')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x32c7('0x2')]},'campaign':{'type':Sequelize[_0x32c7('0x2')]},'campaigntype':{'type':Sequelize[_0x32c7('0x2')]},'membername':{'type':Sequelize[_0x32c7('0x2')]},'reason':{'type':Sequelize[_0x32c7('0x2')]},'amd':{'type':Sequelize[_0x32c7('0x3')],'defaultValue':![]},'fax':{'type':Sequelize[_0x32c7('0x3')],'defaultValue':![]},'callback':{'type':Sequelize[_0x32c7('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x32c7('0x1')]},'recallme':{'type':Sequelize[_0x32c7('0x3')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x32c7('0x1')]},'edited':{'type':Sequelize[_0x32c7('0x3')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x32c7('0x0')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x32c7('0x0')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x32c7('0x0')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index 5c7df53..8f532d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe38b=['end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','map','CmHopperHistory','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','merge','catch','create','body','describe','uniqueid','eml-format','request-promise','moment','mustache','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status'];(function(_0x57466c,_0x56b634){var _0x15aed3=function(_0x1a8375){while(--_0x1a8375){_0x57466c['push'](_0x57466c['shift']());}};_0x15aed3(++_0x56b634);}(_0xe38b,0x7b));var _0xbe38=function(_0x4a98b2,_0x501161){_0x4a98b2=_0x4a98b2-0x0;var _0x47dd73=_0xe38b[_0x4a98b2];return _0x47dd73;};'use strict';var emlformat=require(_0xbe38('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe38('0x1'));var moment=require(_0xbe38('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xbe38('0x3'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbe38('0x4'));var fs=require('fs');var fs_extra=require(_0xbe38('0x5'));var _=require('lodash');var squel=require(_0xbe38('0x6'));var crypto=require(_0xbe38('0x7'));var jsforce=require(_0xbe38('0x8'));var deskjs=require(_0xbe38('0x9'));var toCsv=require(_0xbe38('0xa'));var querystring=require(_0xbe38('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbe38('0xc'));var qs=require(_0xbe38('0xd'));var as=require(_0xbe38('0xe'));var hardwareService=require(_0xbe38('0xf'));var logger=require(_0xbe38('0x10'))(_0xbe38('0x11'));var utils=require(_0xbe38('0x12'));var config=require(_0xbe38('0x13'));var licenseUtil=require(_0xbe38('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x570a56,_0x4dcf78){_0x4dcf78=_0x4dcf78||0xcc;return function(_0x722e54){if(_0x722e54){return _0x570a56[_0xbe38('0x15')](_0x4dcf78);}return _0x570a56[_0xbe38('0x16')](_0x4dcf78)[_0xbe38('0x17')]();};}function respondWithResult(_0x1039de,_0x42eece){_0x42eece=_0x42eece||0xc8;return function(_0x133021){if(_0x133021){return _0x1039de[_0xbe38('0x16')](_0x42eece)['json'](_0x133021);}};}function respondWithFilteredResult(_0x40b062,_0xb709ad){return function(_0x14e717){if(_0x14e717){var _0x57dd8=typeof _0xb709ad[_0xbe38('0x18')]===_0xbe38('0x19')&&typeof _0xb709ad[_0xbe38('0x1a')]==='undefined';var _0x15e480=_0x14e717[_0xbe38('0x1b')];var _0x4b6fb6=_0x57dd8?0x0:_0xb709ad[_0xbe38('0x18')];var _0x389ce0=_0x57dd8?_0x14e717[_0xbe38('0x1b')]:_0xb709ad['offset']+_0xb709ad[_0xbe38('0x1a')];var _0x1c959c;if(_0x389ce0>=_0x15e480){_0x389ce0=_0x15e480;_0x1c959c=0xc8;}else{_0x1c959c=0xce;}_0x40b062[_0xbe38('0x16')](_0x1c959c);return _0x40b062['set'](_0xbe38('0x1c'),_0x4b6fb6+'-'+_0x389ce0+'/'+_0x15e480)[_0xbe38('0x1d')](_0x14e717);}return null;};}function patchUpdates(_0x432030){return function(_0x508477){try{jsonpatch[_0xbe38('0x1e')](_0x508477,_0x432030,!![]);}catch(_0x36bd80){return BPromise[_0xbe38('0x1f')](_0x36bd80);}return _0x508477[_0xbe38('0x20')]();};}function saveUpdates(_0x508dd7,_0x1cf780){return function(_0x28297f){if(_0x28297f){return _0x28297f[_0xbe38('0x21')](_0x508dd7)[_0xbe38('0x22')](function(_0x1c3974){return _0x1c3974;});}return null;};}function removeEntity(_0x8184ba,_0x5bdf5e){return function(_0x319912){if(_0x319912){return _0x319912[_0xbe38('0x23')]()[_0xbe38('0x22')](function(){_0x8184ba['status'](0xcc)[_0xbe38('0x17')]();});}};}function handleEntityNotFound(_0x5cd1c5,_0x357358){return function(_0x26d1e3){if(!_0x26d1e3){_0x5cd1c5[_0xbe38('0x15')](0x194);}return _0x26d1e3;};}function handleError(_0x44e8b6,_0x128d91){_0x128d91=_0x128d91||0x1f4;return function(_0x31cba7){logger[_0xbe38('0x24')](_0x31cba7['stack']);if(_0x31cba7[_0xbe38('0x25')]){delete _0x31cba7[_0xbe38('0x25')];}_0x44e8b6['status'](_0x128d91)[_0xbe38('0x26')](_0x31cba7);};}exports['index']=function(_0x41ec28,_0x3807dc){var _0xc58be={},_0x5e046d={},_0x438462={'count':0x0,'rows':[]};var _0x45eeb6=_[_0xbe38('0x27')](db[_0xbe38('0x28')]['rawAttributes'],function(_0xabcf80){return{'name':_0xabcf80[_0xbe38('0x29')],'type':_0xabcf80['type'][_0xbe38('0x2a')]};});_0x5e046d[_0xbe38('0x2b')]=_['map'](_0x45eeb6,'name');_0x5e046d[_0xbe38('0x2c')]=_[_0xbe38('0x2d')](_0x41ec28[_0xbe38('0x2c')]);_0x5e046d[_0xbe38('0x2e')]=_[_0xbe38('0x2f')](_0x5e046d[_0xbe38('0x2b')],_0x5e046d[_0xbe38('0x2c')]);_0xc58be[_0xbe38('0x30')]=_[_0xbe38('0x2f')](_0x5e046d[_0xbe38('0x2b')],qs[_0xbe38('0x31')](_0x41ec28[_0xbe38('0x2c')][_0xbe38('0x31')]));_0xc58be[_0xbe38('0x30')]=_0xc58be[_0xbe38('0x30')][_0xbe38('0x32')]?_0xc58be[_0xbe38('0x30')]:_0x5e046d[_0xbe38('0x2b')];if(!_0x41ec28[_0xbe38('0x2c')]['hasOwnProperty'](_0xbe38('0x33'))){_0xc58be[_0xbe38('0x1a')]=qs[_0xbe38('0x1a')](_0x41ec28['query'][_0xbe38('0x1a')]);_0xc58be[_0xbe38('0x18')]=qs[_0xbe38('0x18')](_0x41ec28[_0xbe38('0x2c')][_0xbe38('0x18')]);}_0xc58be[_0xbe38('0x34')]=qs[_0xbe38('0x35')](_0x41ec28[_0xbe38('0x2c')][_0xbe38('0x35')]);_0xc58be[_0xbe38('0x36')]=qs['filters'](_[_0xbe38('0x37')](_0x41ec28['query'],_0x5e046d[_0xbe38('0x2e')]),_0x45eeb6);if(_0x41ec28[_0xbe38('0x2c')][_0xbe38('0x38')]){_0xc58be[_0xbe38('0x36')]=_['merge'](_0xc58be['where'],{'$or':_[_0xbe38('0x27')](_0x45eeb6,function(_0x212b23){if(_0x212b23[_0xbe38('0x39')]!==_0xbe38('0x3a')){var _0x46e845={};_0x46e845[_0x212b23[_0xbe38('0x25')]]={'$like':'%'+_0x41ec28[_0xbe38('0x2c')]['filter']+'%'};return _0x46e845;}})});}_0xc58be=_['merge']({},_0xc58be,_0x41ec28[_0xbe38('0x3b')]);var _0x2be201={'where':_0xc58be[_0xbe38('0x36')]};return db[_0xbe38('0x28')]['count'](_0x2be201)['then'](function(_0x2f316f){_0x438462['count']=_0x2f316f;if(_0x41ec28[_0xbe38('0x2c')][_0xbe38('0x3c')]){_0xc58be[_0xbe38('0x3d')]=[{'all':!![]}];}return db[_0xbe38('0x28')][_0xbe38('0x3e')](_0xc58be);})[_0xbe38('0x22')](function(_0x2f977e){_0x438462[_0xbe38('0x3f')]=_0x2f977e;return _0x438462;})['then'](respondWithFilteredResult(_0x3807dc,_0xc58be))['catch'](handleError(_0x3807dc,null));};exports[_0xbe38('0x40')]=function(_0x9b9e2f,_0x3348c4){var _0x472b39={'raw':!![],'where':{'id':_0x9b9e2f[_0xbe38('0x41')]['id']}},_0xb35afa={};_0xb35afa['model']=_[_0xbe38('0x2d')](db[_0xbe38('0x28')][_0xbe38('0x42')]);_0xb35afa[_0xbe38('0x2c')]=_[_0xbe38('0x2d')](_0x9b9e2f[_0xbe38('0x2c')]);_0xb35afa[_0xbe38('0x2e')]=_[_0xbe38('0x2f')](_0xb35afa[_0xbe38('0x2b')],_0xb35afa[_0xbe38('0x2c')]);_0x472b39[_0xbe38('0x30')]=_[_0xbe38('0x2f')](_0xb35afa[_0xbe38('0x2b')],qs['fields'](_0x9b9e2f[_0xbe38('0x2c')][_0xbe38('0x31')]));_0x472b39['attributes']=_0x472b39[_0xbe38('0x30')][_0xbe38('0x32')]?_0x472b39[_0xbe38('0x30')]:_0xb35afa[_0xbe38('0x2b')];if(_0x9b9e2f[_0xbe38('0x2c')][_0xbe38('0x3c')]){_0x472b39[_0xbe38('0x3d')]=[{'all':!![]}];}_0x472b39=_[_0xbe38('0x43')]({},_0x472b39,_0x9b9e2f['options']);return db['CmHopperHistory']['find'](_0x472b39)[_0xbe38('0x22')](handleEntityNotFound(_0x3348c4,null))['then'](respondWithResult(_0x3348c4,null))[_0xbe38('0x44')](handleError(_0x3348c4,null));};exports[_0xbe38('0x45')]=function(_0x31dc46,_0x4cbdc7){return db['CmHopperHistory'][_0xbe38('0x45')](_0x31dc46[_0xbe38('0x46')],{})[_0xbe38('0x22')](respondWithResult(_0x4cbdc7,0xc9))[_0xbe38('0x44')](handleError(_0x4cbdc7,null));};exports[_0xbe38('0x47')]=function(_0x1dd657,_0x5cd632){return db[_0xbe38('0x28')]['describe']()[_0xbe38('0x22')](respondWithResult(_0x5cd632,null))[_0xbe38('0x44')](handleError(_0x5cd632,null));};exports[_0xbe38('0x21')]=function(_0x41d7e7,_0x209c16){if(_0x41d7e7[_0xbe38('0x46')][_0xbe38('0x48')]){delete _0x41d7e7['body'][_0xbe38('0x48')];}return db['CmHopperHistory']['find']({'where':{'uniqueid':_0x41d7e7[_0xbe38('0x41')]['id']}})[_0xbe38('0x22')](handleEntityNotFound(_0x209c16,null))[_0xbe38('0x22')](saveUpdates(_0x41d7e7[_0xbe38('0x46')],null))[_0xbe38('0x22')](respondWithResult(_0x209c16,null))['catch'](handleError(_0x209c16,null));};
\ No newline at end of file
+var _0xe7c5=['params','length','find','catch','create','body','uniqueid','rimraf','fast-json-patch','moment','bluebird','util','to-csv','ejs','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','show'];(function(_0xf1b5b2,_0xa59170){var _0xf4bd30=function(_0x7e9097){while(--_0x7e9097){_0xf1b5b2['push'](_0xf1b5b2['shift']());}};_0xf4bd30(++_0xa59170);}(_0xe7c5,0x97));var _0x5e7c=function(_0x4f8f3b,_0x43281b){_0x4f8f3b=_0x4f8f3b-0x0;var _0x4c250c=_0xe7c5[_0x4f8f3b];return _0x4c250c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5e7c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5e7c('0x1'));var rp=require('request-promise');var moment=require(_0x5e7c('0x2'));var BPromise=require(_0x5e7c('0x3'));var Mustache=require('mustache');var util=require(_0x5e7c('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x5e7c('0x5'));var ejs=require(_0x5e7c('0x6'));var fs=require('fs');var fs_extra=require(_0x5e7c('0x7'));var _=require('lodash');var squel=require(_0x5e7c('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5e7c('0x9'));var toCsv=require('to-csv');var querystring=require(_0x5e7c('0xa'));var Papa=require(_0x5e7c('0xb'));var Redis=require(_0x5e7c('0xc'));var authService=require(_0x5e7c('0xd'));var qs=require(_0x5e7c('0xe'));var as=require(_0x5e7c('0xf'));var hardwareService=require(_0x5e7c('0x10'));var logger=require('../../config/logger')(_0x5e7c('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5e7c('0x12'));var db=require(_0x5e7c('0x13'))['db'];function respondWithStatusCode(_0x2706df,_0x425d78){_0x425d78=_0x425d78||0xcc;return function(_0xf63ae0){if(_0xf63ae0){return _0x2706df[_0x5e7c('0x14')](_0x425d78);}return _0x2706df['status'](_0x425d78)[_0x5e7c('0x15')]();};}function respondWithResult(_0x596455,_0x146a2c){_0x146a2c=_0x146a2c||0xc8;return function(_0x310c6d){if(_0x310c6d){return _0x596455['status'](_0x146a2c)[_0x5e7c('0x16')](_0x310c6d);}};}function respondWithFilteredResult(_0x16ddc4,_0x43fcee){return function(_0x47fa92){if(_0x47fa92){var _0x596e3b=typeof _0x43fcee[_0x5e7c('0x17')]===_0x5e7c('0x18')&&typeof _0x43fcee[_0x5e7c('0x19')]==='undefined';var _0x44028f=_0x47fa92[_0x5e7c('0x1a')];var _0x3122a7=_0x596e3b?0x0:_0x43fcee[_0x5e7c('0x17')];var _0x416fe3=_0x596e3b?_0x47fa92['count']:_0x43fcee['offset']+_0x43fcee['limit'];var _0x4b8ec8;if(_0x416fe3>=_0x44028f){_0x416fe3=_0x44028f;_0x4b8ec8=0xc8;}else{_0x4b8ec8=0xce;}_0x16ddc4[_0x5e7c('0x1b')](_0x4b8ec8);return _0x16ddc4[_0x5e7c('0x1c')](_0x5e7c('0x1d'),_0x3122a7+'-'+_0x416fe3+'/'+_0x44028f)[_0x5e7c('0x16')](_0x47fa92);}return null;};}function patchUpdates(_0x1ecbe3){return function(_0x1cfa73){try{jsonpatch['apply'](_0x1cfa73,_0x1ecbe3,!![]);}catch(_0x58e8b9){return BPromise[_0x5e7c('0x1e')](_0x58e8b9);}return _0x1cfa73[_0x5e7c('0x1f')]();};}function saveUpdates(_0x142963,_0x3eb880){return function(_0x2061db){if(_0x2061db){return _0x2061db[_0x5e7c('0x20')](_0x142963)[_0x5e7c('0x21')](function(_0x186d8d){return _0x186d8d;});}return null;};}function removeEntity(_0x257de7,_0x12122f){return function(_0x36c73d){if(_0x36c73d){return _0x36c73d[_0x5e7c('0x22')]()[_0x5e7c('0x21')](function(){_0x257de7[_0x5e7c('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x308e68,_0x16e2f9){return function(_0x4c5c70){if(!_0x4c5c70){_0x308e68[_0x5e7c('0x14')](0x194);}return _0x4c5c70;};}function handleError(_0x1a5e71,_0x755ab8){_0x755ab8=_0x755ab8||0x1f4;return function(_0x405c8c){logger[_0x5e7c('0x23')](_0x405c8c[_0x5e7c('0x24')]);if(_0x405c8c[_0x5e7c('0x25')]){delete _0x405c8c[_0x5e7c('0x25')];}_0x1a5e71['status'](_0x755ab8)[_0x5e7c('0x26')](_0x405c8c);};}exports[_0x5e7c('0x27')]=function(_0x8f3b97,_0x406c11){var _0x10270a={},_0x5c43d7={},_0x20aa07={'count':0x0,'rows':[]};var _0x4b9554=_[_0x5e7c('0x28')](db[_0x5e7c('0x29')][_0x5e7c('0x2a')],function(_0x49efd4){return{'name':_0x49efd4['fieldName'],'type':_0x49efd4[_0x5e7c('0x2b')][_0x5e7c('0x2c')]};});_0x5c43d7['model']=_['map'](_0x4b9554,_0x5e7c('0x25'));_0x5c43d7[_0x5e7c('0x2d')]=_[_0x5e7c('0x2e')](_0x8f3b97[_0x5e7c('0x2d')]);_0x5c43d7[_0x5e7c('0x2f')]=_[_0x5e7c('0x30')](_0x5c43d7['model'],_0x5c43d7[_0x5e7c('0x2d')]);_0x10270a[_0x5e7c('0x31')]=_[_0x5e7c('0x30')](_0x5c43d7[_0x5e7c('0x32')],qs[_0x5e7c('0x33')](_0x8f3b97[_0x5e7c('0x2d')][_0x5e7c('0x33')]));_0x10270a['attributes']=_0x10270a['attributes']['length']?_0x10270a[_0x5e7c('0x31')]:_0x5c43d7[_0x5e7c('0x32')];if(!_0x8f3b97[_0x5e7c('0x2d')][_0x5e7c('0x34')](_0x5e7c('0x35'))){_0x10270a[_0x5e7c('0x19')]=qs[_0x5e7c('0x19')](_0x8f3b97[_0x5e7c('0x2d')][_0x5e7c('0x19')]);_0x10270a[_0x5e7c('0x17')]=qs[_0x5e7c('0x17')](_0x8f3b97[_0x5e7c('0x2d')][_0x5e7c('0x17')]);}_0x10270a[_0x5e7c('0x36')]=qs[_0x5e7c('0x37')](_0x8f3b97[_0x5e7c('0x2d')][_0x5e7c('0x37')]);_0x10270a['where']=qs[_0x5e7c('0x2f')](_['pick'](_0x8f3b97[_0x5e7c('0x2d')],_0x5c43d7[_0x5e7c('0x2f')]),_0x4b9554);if(_0x8f3b97[_0x5e7c('0x2d')]['filter']){_0x10270a[_0x5e7c('0x38')]=_[_0x5e7c('0x39')](_0x10270a[_0x5e7c('0x38')],{'$or':_['map'](_0x4b9554,function(_0x5a0f23){if(_0x5a0f23['type']!==_0x5e7c('0x3a')){var _0x189e9a={};_0x189e9a[_0x5a0f23['name']]={'$like':'%'+_0x8f3b97[_0x5e7c('0x2d')][_0x5e7c('0x3b')]+'%'};return _0x189e9a;}})});}_0x10270a=_[_0x5e7c('0x39')]({},_0x10270a,_0x8f3b97[_0x5e7c('0x3c')]);var _0xfa1edb={'where':_0x10270a[_0x5e7c('0x38')]};return db[_0x5e7c('0x29')]['count'](_0xfa1edb)[_0x5e7c('0x21')](function(_0x4ce46b){_0x20aa07[_0x5e7c('0x1a')]=_0x4ce46b;if(_0x8f3b97[_0x5e7c('0x2d')][_0x5e7c('0x3d')]){_0x10270a[_0x5e7c('0x3e')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x5e7c('0x3f')](_0x10270a);})[_0x5e7c('0x21')](function(_0x2d797f){_0x20aa07['rows']=_0x2d797f;return _0x20aa07;})[_0x5e7c('0x21')](respondWithFilteredResult(_0x406c11,_0x10270a))['catch'](handleError(_0x406c11,null));};exports[_0x5e7c('0x40')]=function(_0x58346b,_0x5e1817){var _0x25403d={'raw':!![],'where':{'id':_0x58346b[_0x5e7c('0x41')]['id']}},_0x4b1d4b={};_0x4b1d4b[_0x5e7c('0x32')]=_[_0x5e7c('0x2e')](db[_0x5e7c('0x29')][_0x5e7c('0x2a')]);_0x4b1d4b[_0x5e7c('0x2d')]=_['keys'](_0x58346b['query']);_0x4b1d4b['filters']=_[_0x5e7c('0x30')](_0x4b1d4b['model'],_0x4b1d4b[_0x5e7c('0x2d')]);_0x25403d['attributes']=_[_0x5e7c('0x30')](_0x4b1d4b[_0x5e7c('0x32')],qs[_0x5e7c('0x33')](_0x58346b[_0x5e7c('0x2d')][_0x5e7c('0x33')]));_0x25403d[_0x5e7c('0x31')]=_0x25403d[_0x5e7c('0x31')][_0x5e7c('0x42')]?_0x25403d[_0x5e7c('0x31')]:_0x4b1d4b[_0x5e7c('0x32')];if(_0x58346b[_0x5e7c('0x2d')][_0x5e7c('0x3d')]){_0x25403d['include']=[{'all':!![]}];}_0x25403d=_[_0x5e7c('0x39')]({},_0x25403d,_0x58346b[_0x5e7c('0x3c')]);return db['CmHopperHistory'][_0x5e7c('0x43')](_0x25403d)[_0x5e7c('0x21')](handleEntityNotFound(_0x5e1817,null))[_0x5e7c('0x21')](respondWithResult(_0x5e1817,null))[_0x5e7c('0x44')](handleError(_0x5e1817,null));};exports[_0x5e7c('0x45')]=function(_0x345302,_0x30ac32){return db[_0x5e7c('0x29')][_0x5e7c('0x45')](_0x345302[_0x5e7c('0x46')],{})[_0x5e7c('0x21')](respondWithResult(_0x30ac32,0xc9))[_0x5e7c('0x44')](handleError(_0x30ac32,null));};exports['describe']=function(_0x4f450e,_0x330bbd){return db[_0x5e7c('0x29')]['describe']()[_0x5e7c('0x21')](respondWithResult(_0x330bbd,null))[_0x5e7c('0x44')](handleError(_0x330bbd,null));};exports['update']=function(_0x44dda0,_0x2e32d5){if(_0x44dda0[_0x5e7c('0x46')][_0x5e7c('0x47')]){delete _0x44dda0[_0x5e7c('0x46')][_0x5e7c('0x47')];}return db[_0x5e7c('0x29')][_0x5e7c('0x43')]({'where':{'uniqueid':_0x44dda0[_0x5e7c('0x41')]['id']}})[_0x5e7c('0x21')](handleEntityNotFound(_0x2e32d5,null))[_0x5e7c('0x21')](saveUpdates(_0x44dda0[_0x5e7c('0x46')],null))[_0x5e7c('0x21')](respondWithResult(_0x2e32d5,null))[_0x5e7c('0x44')](handleError(_0x2e32d5,null));};
\ No newline at end of file
index 37e356a..7e3e6fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50a8=['request-promise','./cmHopperHistory.attributes','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid','util','api','moment','bluebird'];(function(_0x2276e1,_0x5de22c){var _0x457c09=function(_0xb0491b){while(--_0xb0491b){_0x2276e1['push'](_0x2276e1['shift']());}};_0x457c09(++_0x5de22c);}(_0x50a8,0x193));var _0x850a=function(_0x4d0d85,_0x3250d3){_0x4d0d85=_0x4d0d85-0x0;var _0x290a74=_0x50a8[_0x4d0d85];return _0x290a74;};'use strict';var _=require('lodash');var util=require(_0x850a('0x0'));var logger=require('../../config/logger')(_0x850a('0x1'));var moment=require(_0x850a('0x2'));var BPromise=require(_0x850a('0x3'));var rp=require(_0x850a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x850a('0x5'));module[_0x850a('0x6')]=function(_0x530b92,_0x31c037){return _0x530b92['define'](_0x850a('0x7'),attributes,{'tableName':_0x850a('0x8'),'paranoid':![],'indexes':[{'name':_0x850a('0x9'),'fields':['endtime']},{'name':_0x850a('0xa'),'fields':[_0x850a('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd7d1=['path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x40a181,_0x16b3eb){var _0x334aaf=function(_0x120daa){while(--_0x120daa){_0x40a181['push'](_0x40a181['shift']());}};_0x334aaf(++_0x16b3eb);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x7d7727,_0x1b0f5e){_0x7d7727=_0x7d7727-0x0;var _0x4f334e=_0xd7d1[_0x7d7727];return _0x4f334e;};'use strict';var _=require(_0x1d7d('0x0'));var util=require(_0x1d7d('0x1'));var logger=require(_0x1d7d('0x2'))(_0x1d7d('0x3'));var moment=require(_0x1d7d('0x4'));var BPromise=require(_0x1d7d('0x5'));var rp=require(_0x1d7d('0x6'));var fs=require('fs');var path=require(_0x1d7d('0x7'));var rimraf=require(_0x1d7d('0x8'));var config=require(_0x1d7d('0x9'));var attributes=require(_0x1d7d('0xa'));module[_0x1d7d('0xb')]=function(_0x14b2b9,_0x5a8cf3){return _0x14b2b9[_0x1d7d('0xc')](_0x1d7d('0xd'),attributes,{'tableName':_0x1d7d('0xe'),'paranoid':![],'indexes':[{'name':_0x1d7d('0xf'),'fields':[_0x1d7d('0xf')]},{'name':_0x1d7d('0x10'),'fields':[_0x1d7d('0x10')]}],'timestamps':!![]});};
\ No newline at end of file
index d6eed2e..2e0819d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x834d=['CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CmHopperHistory','create','options','raw','CreateCmHopperHistory','AvgHandleTime','where','sequelize','COUNT','predictiveIntervalTotalCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','col','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','debug'];(function(_0x307e0e,_0x3e97a5){var _0x1abcb3=function(_0x317073){while(--_0x317073){_0x307e0e['push'](_0x307e0e['shift']());}};_0x1abcb3(++_0x3e97a5);}(_0x834d,0x140));var _0xd834=function(_0x350446,_0x2cabe7){_0x350446=_0x350446-0x0;var _0x4f1d50=_0x834d[_0x350446];return _0x4f1d50;};'use strict';var _=require(_0xd834('0x0'));var util=require(_0xd834('0x1'));var moment=require('moment');var BPromise=require(_0xd834('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd834('0x3'))['db'];var utils=require(_0xd834('0x4'));var logger=require(_0xd834('0x5'))(_0xd834('0x6'));var config=require('../../config/environment');var jayson=require(_0xd834('0x7'));var client=jayson[_0xd834('0x8')][_0xd834('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42623d,_0x28907e,_0x256853){return new BPromise(function(_0x51c989,_0x6ab9ae){return client[_0xd834('0xa')](_0x42623d,_0x256853)[_0xd834('0xb')](function(_0x52ad61){logger[_0xd834('0xc')](_0xd834('0xd'),_0x28907e,'request\x20sent');logger[_0xd834('0xe')](_0xd834('0xf'),_0x28907e,'request\x20sent',JSON[_0xd834('0x10')](_0x52ad61));if(_0x52ad61[_0xd834('0x11')]){if(_0x52ad61[_0xd834('0x11')][_0xd834('0x12')]===0x1f4){logger[_0xd834('0x11')](_0xd834('0xd'),_0x28907e,_0x52ad61[_0xd834('0x11')][_0xd834('0x13')]);return _0x6ab9ae(_0x52ad61[_0xd834('0x11')][_0xd834('0x13')]);}logger[_0xd834('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x28907e,_0x52ad61[_0xd834('0x11')][_0xd834('0x13')]);return _0x51c989(_0x52ad61[_0xd834('0x11')]['message']);}else{logger[_0xd834('0xc')](_0xd834('0xd'),_0x28907e,_0xd834('0x14'));_0x51c989(_0x52ad61[_0xd834('0x15')]['message']);}})[_0xd834('0x16')](function(_0x32d8c7){logger[_0xd834('0x11')](_0xd834('0xd'),_0x28907e,_0x32d8c7);_0x6ab9ae(_0x32d8c7);});});}exports['CreateCmHopperHistory']=function(_0x21ce1a){var _0x1aecf2=this;return new Promise(function(_0x530951,_0xce0df0){return db[_0xd834('0x17')][_0xd834('0x18')](_0x21ce1a['body'],{'raw':_0x21ce1a[_0xd834('0x19')]?_0x21ce1a['options'][_0xd834('0x1a')]===undefined?!![]:![]:!![]})[_0xd834('0xb')](function(_0x4b451e){logger[_0xd834('0xc')](_0xd834('0x1b'),_0x21ce1a);logger[_0xd834('0xe')](_0xd834('0x1b'),_0x21ce1a,JSON[_0xd834('0x10')](_0x4b451e));_0x530951(_0x4b451e);})[_0xd834('0x16')](function(_0x59b604){logger[_0xd834('0x11')]('CreateCmHopperHistory',_0x59b604[_0xd834('0x13')],_0x21ce1a);_0xce0df0(_0x1aecf2['error'](0x1f4,_0x59b604[_0xd834('0x13')]));});});};exports[_0xd834('0x1c')]=function(_0xd1a893){var _0x4872af=this;return new Promise(function(_0x4a399e,_0x4b89b5){return db[_0xd834('0x17')]['findAll']({'raw':_0xd1a893[_0xd834('0x19')]?_0xd1a893['options'][_0xd834('0x1a')]===undefined?!![]:![]:!![],'where':_0xd1a893['options']?_0xd1a893[_0xd834('0x19')][_0xd834('0x1d')]||null:null,'attributes':[[db[_0xd834('0x1e')]['fn'](_0xd834('0x1f'),db[_0xd834('0x1e')]['col']('id')),_0xd834('0x20')],[db['sequelize']['fn'](_0xd834('0x1f'),db[_0xd834('0x1e')]['fn']('IF',db[_0xd834('0x1e')][_0xd834('0x21')]('`state`\x20=\x204,\x201,\x20null'))),'predictiveIntervalAnsweredCalls'],[db[_0xd834('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xd834('0x21')](_0xd834('0x22')))),_0xd834('0x23')],[db['sequelize']['fn']('COUNT',db[_0xd834('0x1e')]['fn']('IF',db[_0xd834('0x1e')][_0xd834('0x21')](_0xd834('0x24')))),_0xd834('0x25')],[db[_0xd834('0x1e')]['fn'](_0xd834('0x26'),db[_0xd834('0x1e')]['fn']('IF',db['sequelize'][_0xd834('0x21')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0xd834('0x27')],[db[_0xd834('0x1e')]['fn']('AVG',db[_0xd834('0x1e')]['fn']('IF',db[_0xd834('0x1e')]['literal'](_0xd834('0x28')))),'predictiveIntervalAvgTalktime']]})[_0xd834('0xb')](function(_0x26da61){logger[_0xd834('0xc')]('AvgHandleTime',_0xd1a893);logger[_0xd834('0xe')]('AvgHandleTime',_0xd1a893,JSON[_0xd834('0x10')](_0x26da61));_0x4a399e(_0x26da61);})[_0xd834('0x16')](function(_0x490369){logger[_0xd834('0x11')](_0xd834('0x1c'),_0x490369['message'],_0xd1a893);_0x4b89b5(_0x4872af[_0xd834('0x11')](0x1f4,_0x490369[_0xd834('0x13')]));});});};exports[_0xd834('0x29')]=function(_0x5629c4){var _0x458f94=this;return new Promise(function(_0x5ef75f,_0x2313f4){return db['CmHopperHistory'][_0xd834('0x2a')]({'raw':_0x5629c4[_0xd834('0x19')]?_0x5629c4[_0xd834('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5629c4[_0xd834('0x19')]?_0x5629c4[_0xd834('0x19')][_0xd834('0x1d')]||null:null,'attributes':[[_0xd834('0x2b'),_0xd834('0x2c')],[db[_0xd834('0x1e')]['fn'](_0xd834('0x1f'),db['sequelize']['fn']('IF',db[_0xd834('0x1e')][_0xd834('0x21')](_0xd834('0x2d')))),_0xd834('0x2e')],[db[_0xd834('0x1e')]['fn']('COUNT',db[_0xd834('0x1e')]['fn']('IF',db[_0xd834('0x1e')][_0xd834('0x21')]('`state`\x20=\x203,\x201,\x20null'))),'outboundNoAnswerCallsDay'],[db['sequelize']['fn'](_0xd834('0x1f'),db[_0xd834('0x1e')]['fn']('IF',db[_0xd834('0x1e')]['literal'](_0xd834('0x2f')))),_0xd834('0x30')],[db[_0xd834('0x1e')]['fn'](_0xd834('0x1f'),db[_0xd834('0x1e')]['fn']('IF',db['sequelize'][_0xd834('0x21')](_0xd834('0x31')))),_0xd834('0x32')],[db[_0xd834('0x1e')]['fn'](_0xd834('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0xd834('0x21')](_0xd834('0x33')))),_0xd834('0x34')],[db[_0xd834('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0xd834('0x21')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xd834('0x35')],[db['sequelize']['fn']('COUNT',db[_0xd834('0x1e')]['fn']('IF',db[_0xd834('0x1e')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xd834('0x36')],[db['sequelize']['fn'](_0xd834('0x1f'),db['sequelize']['fn']('IF',db[_0xd834('0x1e')]['literal']('`state`\x20=\x2012,\x201,\x20null'))),_0xd834('0x37')],[db[_0xd834('0x1e')]['fn'](_0xd834('0x1f'),db[_0xd834('0x1e')]['fn']('IF',db['sequelize'][_0xd834('0x21')](_0xd834('0x38')))),_0xd834('0x39')],[db[_0xd834('0x1e')]['fn'](_0xd834('0x1f'),db[_0xd834('0x1e')]['fn']('IF',db['sequelize'][_0xd834('0x21')](_0xd834('0x3a')))),'outboundOriginateFailureCallsDay'],[db[_0xd834('0x1e')]['fn']('COUNT',db[_0xd834('0x1e')]['fn']('IF',db['sequelize'][_0xd834('0x21')]('`state`\x20=\x2018,\x201,\x20null'))),_0xd834('0x3b')],[db[_0xd834('0x1e')]['fn']('COUNT',db[_0xd834('0x1e')]['fn']('IF',db[_0xd834('0x1e')]['literal']('`state`\x20=\x2016,\x201,\x20null'))),_0xd834('0x3c')],[db[_0xd834('0x1e')]['fn'](_0xd834('0x1f'),db['sequelize']['fn']('IF',db[_0xd834('0x1e')][_0xd834('0x21')](_0xd834('0x3d')))),_0xd834('0x3b')],[db[_0xd834('0x1e')]['fn'](_0xd834('0x1f'),db[_0xd834('0x1e')]['fn']('IF',db[_0xd834('0x1e')][_0xd834('0x21')](_0xd834('0x3e')))),'outboundReCallsDay']],'group':[_0xd834('0x2b')]})[_0xd834('0xb')](function(_0x5bcd52){logger[_0xd834('0xc')](_0xd834('0x29'),_0x5629c4);logger[_0xd834('0xe')](_0xd834('0x29'),_0x5629c4,JSON[_0xd834('0x10')](_0x5bcd52));_0x5ef75f(_0x5bcd52);})['catch'](function(_0x755c3d){logger[_0xd834('0x11')](_0xd834('0x29'),_0x755c3d[_0xd834('0x13')],_0x5629c4);_0x2313f4(_0x458f94['error'](0x1f4,_0x755c3d['message']));});});};exports[_0xd834('0x3f')]=function(_0x1a7514){var _0x1c7bb8=this;return new Promise(function(_0x46b8fe,_0x335aab){return db[_0xd834('0x17')][_0xd834('0x2a')]({'raw':_0x1a7514['options']?_0x1a7514[_0xd834('0x19')][_0xd834('0x1a')]===undefined?!![]:![]:!![],'where':_0x1a7514[_0xd834('0x19')]?_0x1a7514[_0xd834('0x19')][_0xd834('0x1d')]||null:null,'attributes':[[_0xd834('0x2b'),_0xd834('0x2c')],[db[_0xd834('0x1e')]['fn'](_0xd834('0x1f'),db[_0xd834('0x1e')][_0xd834('0x40')]('id')),_0xd834('0x41')],[db[_0xd834('0x1e')]['fn'](_0xd834('0x1f'),db[_0xd834('0x1e')]['fn']('IF',db[_0xd834('0x1e')][_0xd834('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0xd834('0x42')]],'group':['campaign']})[_0xd834('0xb')](function(_0x10a9cc){logger[_0xd834('0xc')](_0xd834('0x3f'),_0x1a7514);logger[_0xd834('0xe')](_0xd834('0x3f'),_0x1a7514,JSON[_0xd834('0x10')](_0x10a9cc));_0x46b8fe(_0x10a9cc);})[_0xd834('0x16')](function(_0x2f2fd3){logger[_0xd834('0x11')]('GetCampaignHopperHistory',_0x2f2fd3[_0xd834('0x13')],_0x1a7514);_0x335aab(_0x1c7bb8[_0xd834('0x11')](0x1f4,_0x2f2fd3[_0xd834('0x13')]));});});};
\ No newline at end of file
+var _0x1020=['http','then','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','CmHopperHistory','create','body','options','raw','CreateCmHopperHistory','stringify','AvgHandleTime','where','sequelize','COUNT','col','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','GetVoiceQueueHopperHistory','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x21144d,_0x7dee0e){var _0x5e1119=function(_0x12bde1){while(--_0x12bde1){_0x21144d['push'](_0x21144d['shift']());}};_0x5e1119(++_0x7dee0e);}(_0x1020,0x1a4));var _0x0102=function(_0x1aab74,_0x38a57b){_0x1aab74=_0x1aab74-0x0;var _0x396af2=_0x1020[_0x1aab74];return _0x396af2;};'use strict';var _=require(_0x0102('0x0'));var util=require('util');var moment=require(_0x0102('0x1'));var BPromise=require(_0x0102('0x2'));var rs=require(_0x0102('0x3'));var fs=require('fs');var Redis=require(_0x0102('0x4'));var db=require(_0x0102('0x5'))['db'];var utils=require(_0x0102('0x6'));var logger=require(_0x0102('0x7'))(_0x0102('0x8'));var config=require(_0x0102('0x9'));var jayson=require(_0x0102('0xa'));var client=jayson[_0x0102('0xb')][_0x0102('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x55229f,_0x26804d,_0x1aa60e){return new BPromise(function(_0x43df9f,_0x5ea57e){return client['request'](_0x55229f,_0x1aa60e)[_0x0102('0xd')](function(_0x566659){logger['info'](_0x0102('0xe'),_0x26804d,_0x0102('0xf'));logger[_0x0102('0x10')](_0x0102('0x11'),_0x26804d,_0x0102('0xf'),JSON['stringify'](_0x566659));if(_0x566659[_0x0102('0x12')]){if(_0x566659[_0x0102('0x12')][_0x0102('0x13')]===0x1f4){logger[_0x0102('0x12')](_0x0102('0xe'),_0x26804d,_0x566659[_0x0102('0x12')][_0x0102('0x14')]);return _0x5ea57e(_0x566659[_0x0102('0x12')][_0x0102('0x14')]);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x26804d,_0x566659[_0x0102('0x12')][_0x0102('0x14')]);return _0x43df9f(_0x566659[_0x0102('0x12')][_0x0102('0x14')]);}else{logger[_0x0102('0x15')](_0x0102('0xe'),_0x26804d,_0x0102('0xf'));_0x43df9f(_0x566659[_0x0102('0x16')][_0x0102('0x14')]);}})[_0x0102('0x17')](function(_0x38fab3){logger['error'](_0x0102('0xe'),_0x26804d,_0x38fab3);_0x5ea57e(_0x38fab3);});});}exports['CreateCmHopperHistory']=function(_0x58ba05){var _0x4f3266=this;return new Promise(function(_0x246a2a,_0x1ac23e){return db[_0x0102('0x18')][_0x0102('0x19')](_0x58ba05[_0x0102('0x1a')],{'raw':_0x58ba05[_0x0102('0x1b')]?_0x58ba05[_0x0102('0x1b')][_0x0102('0x1c')]===undefined?!![]:![]:!![]})[_0x0102('0xd')](function(_0x43eb89){logger[_0x0102('0x15')](_0x0102('0x1d'),_0x58ba05);logger[_0x0102('0x10')](_0x0102('0x1d'),_0x58ba05,JSON[_0x0102('0x1e')](_0x43eb89));_0x246a2a(_0x43eb89);})['catch'](function(_0x2e33a6){logger[_0x0102('0x12')](_0x0102('0x1d'),_0x2e33a6[_0x0102('0x14')],_0x58ba05);_0x1ac23e(_0x4f3266[_0x0102('0x12')](0x1f4,_0x2e33a6['message']));});});};exports[_0x0102('0x1f')]=function(_0x3d0fa7){var _0x3d33db=this;return new Promise(function(_0x11d9f4,_0x130f92){return db[_0x0102('0x18')]['findAll']({'raw':_0x3d0fa7[_0x0102('0x1b')]?_0x3d0fa7[_0x0102('0x1b')][_0x0102('0x1c')]===undefined?!![]:![]:!![],'where':_0x3d0fa7[_0x0102('0x1b')]?_0x3d0fa7['options'][_0x0102('0x20')]||null:null,'attributes':[[db[_0x0102('0x21')]['fn'](_0x0102('0x22'),db[_0x0102('0x21')][_0x0102('0x23')]('id')),'predictiveIntervalTotalCalls'],[db[_0x0102('0x21')]['fn'](_0x0102('0x22'),db[_0x0102('0x21')]['fn']('IF',db[_0x0102('0x21')]['literal'](_0x0102('0x24')))),_0x0102('0x25')],[db[_0x0102('0x21')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x0102('0x26')](_0x0102('0x27')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0x0102('0x21')]['fn'](_0x0102('0x22'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x0102('0x28')))),_0x0102('0x29')],[db[_0x0102('0x21')]['fn'](_0x0102('0x2a'),db[_0x0102('0x21')]['fn']('IF',db[_0x0102('0x21')][_0x0102('0x26')](_0x0102('0x2b')))),_0x0102('0x2c')],[db[_0x0102('0x21')]['fn'](_0x0102('0x2a'),db[_0x0102('0x21')]['fn']('IF',db[_0x0102('0x21')][_0x0102('0x26')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})[_0x0102('0xd')](function(_0x18a616){logger[_0x0102('0x15')](_0x0102('0x1f'),_0x3d0fa7);logger[_0x0102('0x10')]('AvgHandleTime',_0x3d0fa7,JSON[_0x0102('0x1e')](_0x18a616));_0x11d9f4(_0x18a616);})[_0x0102('0x17')](function(_0x2bb971){logger['error'](_0x0102('0x1f'),_0x2bb971[_0x0102('0x14')],_0x3d0fa7);_0x130f92(_0x3d33db[_0x0102('0x12')](0x1f4,_0x2bb971[_0x0102('0x14')]));});});};exports[_0x0102('0x2d')]=function(_0x4e6ef5){var _0x8fb734=this;return new Promise(function(_0x421907,_0x9a6143){return db[_0x0102('0x18')][_0x0102('0x2e')]({'raw':_0x4e6ef5[_0x0102('0x1b')]?_0x4e6ef5[_0x0102('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4e6ef5[_0x0102('0x1b')]?_0x4e6ef5[_0x0102('0x1b')][_0x0102('0x20')]||null:null,'attributes':[[_0x0102('0x2f'),_0x0102('0x30')],[db['sequelize']['fn'](_0x0102('0x22'),db[_0x0102('0x21')]['fn']('IF',db[_0x0102('0x21')]['literal'](_0x0102('0x31')))),_0x0102('0x32')],[db[_0x0102('0x21')]['fn'](_0x0102('0x22'),db[_0x0102('0x21')]['fn']('IF',db[_0x0102('0x21')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x0102('0x33')],[db[_0x0102('0x21')]['fn']('COUNT',db[_0x0102('0x21')]['fn']('IF',db[_0x0102('0x21')][_0x0102('0x26')](_0x0102('0x24')))),_0x0102('0x34')],[db[_0x0102('0x21')]['fn'](_0x0102('0x22'),db[_0x0102('0x21')]['fn']('IF',db[_0x0102('0x21')][_0x0102('0x26')](_0x0102('0x35')))),'outboundBusyCallsDay'],[db[_0x0102('0x21')]['fn']('COUNT',db[_0x0102('0x21')]['fn']('IF',db[_0x0102('0x21')][_0x0102('0x26')](_0x0102('0x36')))),'outboundCongestionCallsDay'],[db[_0x0102('0x21')]['fn'](_0x0102('0x22'),db['sequelize']['fn']('IF',db[_0x0102('0x21')][_0x0102('0x26')](_0x0102('0x37')))),_0x0102('0x38')],[db[_0x0102('0x21')]['fn']('COUNT',db[_0x0102('0x21')]['fn']('IF',db[_0x0102('0x21')][_0x0102('0x26')](_0x0102('0x39')))),_0x0102('0x3a')],[db['sequelize']['fn'](_0x0102('0x22'),db['sequelize']['fn']('IF',db['sequelize'][_0x0102('0x26')](_0x0102('0x3b')))),'outboundUnknownCallsDay'],[db[_0x0102('0x21')]['fn'](_0x0102('0x22'),db[_0x0102('0x21')]['fn']('IF',db[_0x0102('0x21')][_0x0102('0x26')]('`state`\x20=\x2013,\x201,\x20null'))),_0x0102('0x3c')],[db[_0x0102('0x21')]['fn'](_0x0102('0x22'),db[_0x0102('0x21')]['fn']('IF',db['sequelize'][_0x0102('0x26')](_0x0102('0x3d')))),_0x0102('0x3e')],[db[_0x0102('0x21')]['fn'](_0x0102('0x22'),db[_0x0102('0x21')]['fn']('IF',db[_0x0102('0x21')][_0x0102('0x26')](_0x0102('0x3f')))),_0x0102('0x40')],[db[_0x0102('0x21')]['fn'](_0x0102('0x22'),db['sequelize']['fn']('IF',db['sequelize'][_0x0102('0x26')](_0x0102('0x41')))),_0x0102('0x42')],[db['sequelize']['fn'](_0x0102('0x22'),db[_0x0102('0x21')]['fn']('IF',db['sequelize'][_0x0102('0x26')]('`state`\x20=\x2020,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0x0102('0x21')]['fn'](_0x0102('0x22'),db[_0x0102('0x21')]['fn']('IF',db[_0x0102('0x21')][_0x0102('0x26')](_0x0102('0x43')))),_0x0102('0x44')]],'group':['campaign']})['then'](function(_0x17bb0b){logger[_0x0102('0x15')](_0x0102('0x2d'),_0x4e6ef5);logger[_0x0102('0x10')](_0x0102('0x2d'),_0x4e6ef5,JSON[_0x0102('0x1e')](_0x17bb0b));_0x421907(_0x17bb0b);})[_0x0102('0x17')](function(_0x28722c){logger[_0x0102('0x12')](_0x0102('0x2d'),_0x28722c['message'],_0x4e6ef5);_0x9a6143(_0x8fb734[_0x0102('0x12')](0x1f4,_0x28722c['message']));});});};exports[_0x0102('0x45')]=function(_0x8af559){var _0x3c9001=this;return new Promise(function(_0x58b0bb,_0x38ba17){return db[_0x0102('0x18')]['findAll']({'raw':_0x8af559[_0x0102('0x1b')]?_0x8af559[_0x0102('0x1b')][_0x0102('0x1c')]===undefined?!![]:![]:!![],'where':_0x8af559[_0x0102('0x1b')]?_0x8af559[_0x0102('0x1b')][_0x0102('0x20')]||null:null,'attributes':[['campaign',_0x0102('0x30')],[db[_0x0102('0x21')]['fn'](_0x0102('0x22'),db[_0x0102('0x21')][_0x0102('0x23')]('id')),_0x0102('0x46')],[db[_0x0102('0x21')]['fn'](_0x0102('0x22'),db[_0x0102('0x21')]['fn']('IF',db['sequelize'][_0x0102('0x26')]('`state`\x20=\x204,\x201,\x20null'))),_0x0102('0x47')]],'group':['campaign']})[_0x0102('0xd')](function(_0x56c307){logger[_0x0102('0x15')](_0x0102('0x45'),_0x8af559);logger[_0x0102('0x10')](_0x0102('0x45'),_0x8af559,JSON[_0x0102('0x1e')](_0x56c307));_0x58b0bb(_0x56c307);})[_0x0102('0x17')](function(_0x4cab1a){logger['error'](_0x0102('0x45'),_0x4cab1a[_0x0102('0x14')],_0x8af559);_0x38ba17(_0x3c9001[_0x0102('0x12')](0x1f4,_0x4cab1a[_0x0102('0x14')]));});});};
\ No newline at end of file
index 2ef5b5d..17d29f2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x06d2=['../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index','describe','show','post','/:id','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x1bff41,_0x386880){var _0x4db66b=function(_0x5aa7b6){while(--_0x5aa7b6){_0x1bff41['push'](_0x1bff41['shift']());}};_0x4db66b(++_0x386880);}(_0x06d2,0x1d7));var _0x206d=function(_0x1e073c,_0x559893){_0x1e073c=_0x1e073c-0x0;var _0x18f3a2=_0x06d2[_0x1e073c];return _0x18f3a2;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x206d('0x0'));var timeout=require(_0x206d('0x1'));var express=require(_0x206d('0x2'));var router=express[_0x206d('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x206d('0x4'));var config=require(_0x206d('0x5'));var controller=require(_0x206d('0x6'));router[_0x206d('0x7')]('/',auth[_0x206d('0x8')](),controller[_0x206d('0x9')]);router[_0x206d('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x206d('0xa')]);router['get']('/:id',auth[_0x206d('0x8')](),controller[_0x206d('0xb')]);router[_0x206d('0xc')]('/',auth[_0x206d('0x8')](),controller['create']);router['put'](_0x206d('0xd'),auth[_0x206d('0x8')](),controller['update']);module['exports']=router;
\ No newline at end of file
+var _0x9d3d=['exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','get','/describe','/:id','create','put','update'];(function(_0x4b22bf,_0x3a9e74){var _0x27bad3=function(_0x5f0bd8){while(--_0x5f0bd8){_0x4b22bf['push'](_0x4b22bf['shift']());}};_0x27bad3(++_0x3a9e74);}(_0x9d3d,0x17b));var _0xd9d3=function(_0x3e3c89,_0x1f4417){_0x3e3c89=_0x3e3c89-0x0;var _0x1ccf13=_0x9d3d[_0x3e3c89];return _0x1ccf13;};'use strict';var multer=require(_0xd9d3('0x0'));var util=require('util');var path=require(_0xd9d3('0x1'));var timeout=require('connect-timeout');var express=require(_0xd9d3('0x2'));var router=express[_0xd9d3('0x3')]();var fs_extra=require(_0xd9d3('0x4'));var auth=require(_0xd9d3('0x5'));var interaction=require(_0xd9d3('0x6'));var config=require(_0xd9d3('0x7'));var controller=require(_0xd9d3('0x8'));router['get']('/',auth[_0xd9d3('0x9')](),controller[_0xd9d3('0xa')]);router[_0xd9d3('0xb')](_0xd9d3('0xc'),auth[_0xd9d3('0x9')](),controller['describe']);router[_0xd9d3('0xb')](_0xd9d3('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xd9d3('0x9')](),controller[_0xd9d3('0xe')]);router[_0xd9d3('0xf')](_0xd9d3('0xd'),auth[_0xd9d3('0x9')](),controller[_0xd9d3('0x10')]);module[_0xd9d3('0x11')]=router;
\ No newline at end of file
index ee5a14b..cbb02c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb458=['STRING','sequelize','exports'];(function(_0x2cc8cb,_0x2f35c9){var _0x136176=function(_0x34cafc){while(--_0x34cafc){_0x2cc8cb['push'](_0x2cc8cb['shift']());}};_0x136176(++_0x2f35c9);}(_0xb458,0x103));var _0x8b45=function(_0x2ccfba,_0x21ee33){_0x2ccfba=_0x2ccfba-0x0;var _0x3bcb47=_0xb458[_0x2ccfba];return _0x3bcb47;};'use strict';var Sequelize=require(_0x8b45('0x0'));module[_0x8b45('0x1')]={'name':{'type':Sequelize[_0x8b45('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x8b45('0x2')]}};
\ No newline at end of file
+var _0x5a52=['STRING','sequelize'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5a52,0x18d));var _0x25a5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x5a52[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x25a5('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x25a5('0x1')]},'dialPrefix':{'type':Sequelize[_0x25a5('0x1')]}};
\ No newline at end of file
index 819438b..c1b3077 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff78=['now','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','/tmp/list_%d_%s.csv','sendStatus','addCustomField','sequelize','Sequelize','text','TEXT','INTEGER','defaultValue','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','omit','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./cmList.socket','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','get','Lists','UserProfileResource','error','stack','name','send','index','CmList','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','addContacts','tags','isArray','each','CmContact','success','push','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','format','cf_%d','raw','isEmpty'];(function(_0x3bda7c,_0x4b2720){var _0x415b02=function(_0x2709be){while(--_0x2709be){_0x3bda7c['push'](_0x3bda7c['shift']());}};_0x415b02(++_0x4b2720);}(_0xff78,0xb1));var _0x8ff7=function(_0x2f57b2,_0xa8e91a){_0x2f57b2=_0x2f57b2-0x0;var _0x5ace77=_0xff78[_0x2f57b2];return _0x5ace77;};'use strict';var emlformat=require(_0x8ff7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8ff7('0x1'));var jsonpatch=require(_0x8ff7('0x2'));var rp=require(_0x8ff7('0x3'));var moment=require(_0x8ff7('0x4'));var BPromise=require(_0x8ff7('0x5'));var Mustache=require(_0x8ff7('0x6'));var util=require(_0x8ff7('0x7'));var path=require(_0x8ff7('0x8'));var sox=require(_0x8ff7('0x9'));var csv=require(_0x8ff7('0xa'));var ejs=require(_0x8ff7('0xb'));var fs=require('fs');var fs_extra=require(_0x8ff7('0xc'));var _=require(_0x8ff7('0xd'));var squel=require(_0x8ff7('0xe'));var crypto=require(_0x8ff7('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8ff7('0xa'));var querystring=require(_0x8ff7('0x10'));var Papa=require(_0x8ff7('0x11'));var Redis=require('ioredis');var authService=require(_0x8ff7('0x12'));var qs=require(_0x8ff7('0x13'));var as=require(_0x8ff7('0x14'));var hardwareService=require(_0x8ff7('0x15'));var logger=require(_0x8ff7('0x16'))(_0x8ff7('0x17'));var utils=require(_0x8ff7('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8ff7('0x19'));var db=require(_0x8ff7('0x1a'))['db'];config[_0x8ff7('0x1b')]=_['defaults'](config[_0x8ff7('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x8ff7('0x1c'))(new Redis(config['redis']));require(_0x8ff7('0x1d'))['register'](socket);function respondWithStatusCode(_0x14abc4,_0x3112ff){_0x3112ff=_0x3112ff||0xcc;return function(_0x2ea3ce){if(_0x2ea3ce){return _0x14abc4['sendStatus'](_0x3112ff);}return _0x14abc4[_0x8ff7('0x1e')](_0x3112ff)[_0x8ff7('0x1f')]();};}function respondWithResult(_0x4212d6,_0x3ada82){_0x3ada82=_0x3ada82||0xc8;return function(_0x556706){if(_0x556706){return _0x4212d6[_0x8ff7('0x1e')](_0x3ada82)[_0x8ff7('0x20')](_0x556706);}};}function respondWithFilteredResult(_0x3fc622,_0x35988b){return function(_0x3ca2a7){if(_0x3ca2a7){var _0x56ba13=typeof _0x35988b['offset']===_0x8ff7('0x21')&&typeof _0x35988b[_0x8ff7('0x22')]==='undefined';var _0x5e09bc=_0x3ca2a7[_0x8ff7('0x23')];var _0x7b174a=_0x56ba13?0x0:_0x35988b[_0x8ff7('0x24')];var _0x4e859a=_0x56ba13?_0x3ca2a7['count']:_0x35988b[_0x8ff7('0x24')]+_0x35988b[_0x8ff7('0x22')];var _0x4b3cdb;if(_0x4e859a>=_0x5e09bc){_0x4e859a=_0x5e09bc;_0x4b3cdb=0xc8;}else{_0x4b3cdb=0xce;}_0x3fc622[_0x8ff7('0x1e')](_0x4b3cdb);return _0x3fc622[_0x8ff7('0x25')](_0x8ff7('0x26'),_0x7b174a+'-'+_0x4e859a+'/'+_0x5e09bc)['json'](_0x3ca2a7);}return null;};}function patchUpdates(_0xcc3b68){return function(_0x545c93){try{jsonpatch['apply'](_0x545c93,_0xcc3b68,!![]);}catch(_0x1e01c8){return BPromise[_0x8ff7('0x27')](_0x1e01c8);}return _0x545c93[_0x8ff7('0x28')]();};}function saveUpdates(_0x35f1c7,_0x3173fc){return function(_0x422127){if(_0x422127){return _0x422127[_0x8ff7('0x29')](_0x35f1c7)[_0x8ff7('0x2a')](function(_0x29560d){return _0x29560d;});}return null;};}function removeEntity(_0x4db985,_0x42243d){return function(_0x18e731){if(_0x18e731){return _0x18e731[_0x8ff7('0x2b')]()['then'](function(){var _0x8f2e42=_0x18e731[_0x8ff7('0x2c')]({'plain':!![]});var _0x1469c9=_0x8ff7('0x2d');return db[_0x8ff7('0x2e')][_0x8ff7('0x2b')]({'where':{'type':_0x1469c9,'resourceId':_0x8f2e42['id']}})['then'](function(){return _0x18e731;});})[_0x8ff7('0x2a')](function(){_0x4db985[_0x8ff7('0x1e')](0xcc)[_0x8ff7('0x1f')]();});}};}function handleEntityNotFound(_0xdb4d0c,_0x173ea8){return function(_0x56837f){if(!_0x56837f){_0xdb4d0c['sendStatus'](0x194);}return _0x56837f;};}function handleError(_0x3d9155,_0xb37402){_0xb37402=_0xb37402||0x1f4;return function(_0x98a2d9){logger[_0x8ff7('0x2f')](_0x98a2d9[_0x8ff7('0x30')]);if(_0x98a2d9[_0x8ff7('0x31')]){delete _0x98a2d9[_0x8ff7('0x31')];}_0x3d9155[_0x8ff7('0x1e')](_0xb37402)[_0x8ff7('0x32')](_0x98a2d9);};}exports[_0x8ff7('0x33')]=function(_0x45c574,_0x4eddbe){var _0x58688a={},_0x370a7f={},_0x56f8ad={'count':0x0,'rows':[]};var _0x445952=_['map'](db[_0x8ff7('0x34')][_0x8ff7('0x35')],function(_0x14a190){return{'name':_0x14a190[_0x8ff7('0x36')],'type':_0x14a190[_0x8ff7('0x37')][_0x8ff7('0x38')]};});_0x370a7f[_0x8ff7('0x39')]=_[_0x8ff7('0x3a')](_0x445952,_0x8ff7('0x31'));_0x370a7f['query']=_[_0x8ff7('0x3b')](_0x45c574[_0x8ff7('0x3c')]);_0x370a7f[_0x8ff7('0x3d')]=_[_0x8ff7('0x3e')](_0x370a7f[_0x8ff7('0x39')],_0x370a7f[_0x8ff7('0x3c')]);_0x58688a[_0x8ff7('0x3f')]=_[_0x8ff7('0x3e')](_0x370a7f[_0x8ff7('0x39')],qs[_0x8ff7('0x40')](_0x45c574[_0x8ff7('0x3c')][_0x8ff7('0x40')]));_0x58688a[_0x8ff7('0x3f')]=_0x58688a['attributes']['length']?_0x58688a['attributes']:_0x370a7f[_0x8ff7('0x39')];if(!_0x45c574[_0x8ff7('0x3c')][_0x8ff7('0x41')](_0x8ff7('0x42'))){_0x58688a['limit']=qs['limit'](_0x45c574['query'][_0x8ff7('0x22')]);_0x58688a[_0x8ff7('0x24')]=qs['offset'](_0x45c574[_0x8ff7('0x3c')]['offset']);}_0x58688a[_0x8ff7('0x43')]=qs[_0x8ff7('0x44')](_0x45c574[_0x8ff7('0x3c')][_0x8ff7('0x44')]);_0x58688a[_0x8ff7('0x45')]=qs['filters'](_[_0x8ff7('0x46')](_0x45c574['query'],_0x370a7f[_0x8ff7('0x3d')]),_0x445952);if(_0x45c574[_0x8ff7('0x3c')][_0x8ff7('0x47')]){_0x58688a[_0x8ff7('0x45')]=_[_0x8ff7('0x48')](_0x58688a[_0x8ff7('0x45')],{'$or':_[_0x8ff7('0x3a')](_0x445952,function(_0x1137b8){if(_0x1137b8[_0x8ff7('0x37')]!==_0x8ff7('0x49')){var _0x5b67e7={};_0x5b67e7[_0x1137b8[_0x8ff7('0x31')]]={'$like':'%'+_0x45c574[_0x8ff7('0x3c')][_0x8ff7('0x47')]+'%'};return _0x5b67e7;}})});}_0x58688a=_[_0x8ff7('0x48')]({},_0x58688a,_0x45c574[_0x8ff7('0x4a')]);var _0x51ad22={'where':_0x58688a['where']};return db[_0x8ff7('0x34')][_0x8ff7('0x23')](_0x51ad22)[_0x8ff7('0x2a')](function(_0x20c001){_0x56f8ad[_0x8ff7('0x23')]=_0x20c001;if(_0x45c574[_0x8ff7('0x3c')][_0x8ff7('0x4b')]){_0x58688a[_0x8ff7('0x4c')]=[{'all':!![]}];}return db[_0x8ff7('0x34')]['findAll'](_0x58688a);})[_0x8ff7('0x2a')](function(_0x369ce1){_0x56f8ad[_0x8ff7('0x4d')]=_0x369ce1;return _0x56f8ad;})[_0x8ff7('0x2a')](respondWithFilteredResult(_0x4eddbe,_0x58688a))[_0x8ff7('0x4e')](handleError(_0x4eddbe,null));};exports['show']=function(_0x154245,_0x5be1ce){var _0x244e7e={'raw':![],'where':{'id':_0x154245[_0x8ff7('0x4f')]['id']}},_0x53b2af={};_0x53b2af[_0x8ff7('0x39')]=_['keys'](db[_0x8ff7('0x34')][_0x8ff7('0x35')]);_0x53b2af[_0x8ff7('0x3c')]=_[_0x8ff7('0x3b')](_0x154245[_0x8ff7('0x3c')]);_0x53b2af[_0x8ff7('0x3d')]=_['intersection'](_0x53b2af['model'],_0x53b2af[_0x8ff7('0x3c')]);_0x244e7e['attributes']=_['intersection'](_0x53b2af[_0x8ff7('0x39')],qs[_0x8ff7('0x40')](_0x154245[_0x8ff7('0x3c')][_0x8ff7('0x40')]));_0x244e7e[_0x8ff7('0x3f')]=_0x244e7e[_0x8ff7('0x3f')][_0x8ff7('0x50')]?_0x244e7e[_0x8ff7('0x3f')]:_0x53b2af[_0x8ff7('0x39')];if(_0x154245[_0x8ff7('0x3c')][_0x8ff7('0x4b')]){_0x244e7e[_0x8ff7('0x4c')]=[{'all':!![]}];}_0x244e7e=_[_0x8ff7('0x48')]({},_0x244e7e,_0x154245[_0x8ff7('0x4a')]);return db[_0x8ff7('0x34')][_0x8ff7('0x51')](_0x244e7e)[_0x8ff7('0x2a')](handleEntityNotFound(_0x5be1ce,null))[_0x8ff7('0x2a')](respondWithResult(_0x5be1ce,null))[_0x8ff7('0x4e')](handleError(_0x5be1ce,null));};exports[_0x8ff7('0x52')]=function(_0x19751a,_0x268941){return db[_0x8ff7('0x34')][_0x8ff7('0x52')](_0x19751a[_0x8ff7('0x53')],{})[_0x8ff7('0x2a')](function(_0x785ec4){var _0x5e3a9a=_0x19751a[_0x8ff7('0x54')][_0x8ff7('0x2c')]({'plain':!![]});if(!_0x5e3a9a)throw new Error(_0x8ff7('0x55'));if(_0x5e3a9a[_0x8ff7('0x56')]===_0x8ff7('0x54')){var _0x3321e3=_0x785ec4[_0x8ff7('0x2c')]({'plain':!![]});var _0x551fa3=_0x8ff7('0x2d');return db['UserProfileSection'][_0x8ff7('0x51')]({'where':{'name':_0x551fa3,'userProfileId':_0x5e3a9a['userProfileId']},'raw':!![]})[_0x8ff7('0x2a')](function(_0x460769){if(_0x460769&&_0x460769[_0x8ff7('0x57')]===0x0){return db[_0x8ff7('0x2e')]['create']({'name':_0x3321e3['name'],'resourceId':_0x3321e3['id'],'type':_0x460769[_0x8ff7('0x31')],'sectionId':_0x460769['id']},{})[_0x8ff7('0x2a')](function(){return _0x785ec4;});}else{return _0x785ec4;}})[_0x8ff7('0x4e')](function(_0x184e62){logger[_0x8ff7('0x2f')](_0x8ff7('0x58'),_0x184e62);throw _0x184e62;});}return _0x785ec4;})[_0x8ff7('0x2a')](respondWithResult(_0x268941,0xc9))[_0x8ff7('0x4e')](handleError(_0x268941,null));};exports['update']=function(_0x473696,_0x556033){if(_0x473696[_0x8ff7('0x53')]['id']){delete _0x473696[_0x8ff7('0x53')]['id'];}return db[_0x8ff7('0x34')][_0x8ff7('0x51')]({'where':{'id':_0x473696[_0x8ff7('0x4f')]['id']}})[_0x8ff7('0x2a')](handleEntityNotFound(_0x556033,null))['then'](saveUpdates(_0x473696[_0x8ff7('0x53')],null))['then'](respondWithResult(_0x556033,null))['catch'](handleError(_0x556033,null));};exports[_0x8ff7('0x2b')]=function(_0x271cd9,_0x466aba){return db[_0x8ff7('0x34')][_0x8ff7('0x51')]({'where':{'id':_0x271cd9[_0x8ff7('0x4f')]['id']}})[_0x8ff7('0x2a')](handleEntityNotFound(_0x466aba,null))[_0x8ff7('0x2a')](removeEntity(_0x466aba,null))[_0x8ff7('0x4e')](handleError(_0x466aba,null));};exports[_0x8ff7('0x59')]=function(_0xa14c49,_0x44ab97){return db[_0x8ff7('0x34')][_0x8ff7('0x59')]()[_0x8ff7('0x2a')](respondWithResult(_0x44ab97,null))[_0x8ff7('0x4e')](handleError(_0x44ab97,null));};exports[_0x8ff7('0x5a')]=function(_0x399921,_0xa892af,_0x25aa90){if(_0x399921[_0x8ff7('0x53')]['id']){delete _0x399921[_0x8ff7('0x53')]['id'];}return db['CmList'][_0x8ff7('0x51')]({'where':{'id':_0x399921[_0x8ff7('0x4f')]['id']}})['then'](handleEntityNotFound(_0xa892af,null))[_0x8ff7('0x2a')](function(_0x4a1694){if(_0x4a1694){_0x399921['body'][_0x8ff7('0x5b')]=_0x4a1694['id'];return db[_0x8ff7('0x5c')][_0x8ff7('0x52')](_0x399921[_0x8ff7('0x53')]);}})[_0x8ff7('0x2a')](respondWithResult(_0xa892af,null))[_0x8ff7('0x4e')](handleError(_0xa892af,null));};exports[_0x8ff7('0x5d')]=function(_0x2185b3,_0x2a3d37,_0xd9f3db){var _0x3e7f4c={'raw':![],'where':{}};var _0x2f2748={};var _0x58e882={'count':0x0,'rows':[]};return db[_0x8ff7('0x34')][_0x8ff7('0x5e')]({'where':{'id':_0x2185b3['params']['id']}})['then'](handleEntityNotFound(_0x2a3d37,null))[_0x8ff7('0x2a')](function(_0x4a2b47){if(_0x4a2b47){_0x2f2748[_0x8ff7('0x39')]=_['keys'](db[_0x8ff7('0x5c')]['rawAttributes']);_0x2f2748[_0x8ff7('0x3c')]=_[_0x8ff7('0x3b')](_0x2185b3[_0x8ff7('0x3c')]);_0x2f2748[_0x8ff7('0x3d')]=_[_0x8ff7('0x3e')](_0x2f2748[_0x8ff7('0x39')],_0x2f2748[_0x8ff7('0x3c')]);_0x3e7f4c['attributes']=_['intersection'](_0x2f2748[_0x8ff7('0x39')],qs[_0x8ff7('0x40')](_0x2185b3['query'][_0x8ff7('0x40')]));_0x3e7f4c['attributes']=_0x3e7f4c[_0x8ff7('0x3f')][_0x8ff7('0x50')]?_0x3e7f4c[_0x8ff7('0x3f')]:_0x2f2748[_0x8ff7('0x39')];if(!_0x2185b3['query'][_0x8ff7('0x41')](_0x8ff7('0x42'))){_0x3e7f4c[_0x8ff7('0x22')]=qs[_0x8ff7('0x22')](_0x2185b3[_0x8ff7('0x3c')][_0x8ff7('0x22')]);_0x3e7f4c['offset']=qs[_0x8ff7('0x24')](_0x2185b3[_0x8ff7('0x3c')][_0x8ff7('0x24')]);}_0x3e7f4c[_0x8ff7('0x43')]=qs['sort'](_0x2185b3[_0x8ff7('0x3c')][_0x8ff7('0x44')]);_0x3e7f4c[_0x8ff7('0x45')]=qs[_0x8ff7('0x3d')](_[_0x8ff7('0x46')](_0x2185b3['query'],_0x2f2748[_0x8ff7('0x3d')]));_0x3e7f4c[_0x8ff7('0x45')]['ListId']=_0x4a2b47['id'];if(_0x2185b3[_0x8ff7('0x3c')][_0x8ff7('0x47')]){_0x3e7f4c['where']=_['merge'](_0x3e7f4c[_0x8ff7('0x45')],{'$or':_[_0x8ff7('0x3a')](_0x3e7f4c[_0x8ff7('0x3f')],function(_0x41a51a){var _0x53b35f={};_0x53b35f[_0x41a51a]={'$like':'%'+_0x2185b3[_0x8ff7('0x3c')][_0x8ff7('0x47')]+'%'};return _0x53b35f;})});}_0x3e7f4c=_[_0x8ff7('0x48')]({},_0x3e7f4c,_0x2185b3['options']);return db[_0x8ff7('0x5c')][_0x8ff7('0x23')]({'where':_0x3e7f4c[_0x8ff7('0x45')]})[_0x8ff7('0x2a')](function(_0x63330a){_0x58e882[_0x8ff7('0x23')]=_0x63330a;if(_0x2185b3[_0x8ff7('0x3c')][_0x8ff7('0x4b')]){_0x3e7f4c[_0x8ff7('0x4c')]=[{'all':!![]}];}return db['Disposition'][_0x8ff7('0x5f')](_0x3e7f4c);})['then'](function(_0x7eafbc){_0x58e882[_0x8ff7('0x4d')]=_0x7eafbc;return _0x58e882;});}})[_0x8ff7('0x2a')](respondWithFilteredResult(_0x2a3d37,_0x3e7f4c))[_0x8ff7('0x4e')](handleError(_0x2a3d37,null));};exports['removeDispositions']=function(_0x3fc184,_0x2f46f5,_0x1dc277){return db[_0x8ff7('0x34')][_0x8ff7('0x51')]({'where':{'id':_0x3fc184[_0x8ff7('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2f46f5,null))['then'](function(_0x49b7cc){if(_0x49b7cc){return _0x49b7cc[_0x8ff7('0x60')](_0x3fc184['query'][_0x8ff7('0x61')]);}})[_0x8ff7('0x2a')](respondWithStatusCode(_0x2f46f5,null))['catch'](handleError(_0x2f46f5,null));};exports[_0x8ff7('0x62')]=function(_0x4c161b,_0x1c61dd,_0x3d6684){return db['CmList'][_0x8ff7('0x51')]({'where':{'id':_0x4c161b['params']['id']}})[_0x8ff7('0x2a')](handleEntityNotFound(_0x1c61dd,null))[_0x8ff7('0x2a')](function(_0x18d4cb){if(_0x18d4cb){var _0x124ff7=[];var _0x42757f={'success':[],'errors':[]};return db['CmContact'][_0x8ff7('0x59')]()[_0x8ff7('0x2a')](function(_0x4b12e3){if(_0x4c161b[_0x8ff7('0x53')][_0x8ff7('0x63')]&&_[_0x8ff7('0x64')](_0x4c161b['body'][_0x8ff7('0x63')])){if(_0x4c161b['body']['tags'][_0x8ff7('0x50')]){_0x4c161b[_0x8ff7('0x53')][_0x8ff7('0x63')]=_0x4c161b[_0x8ff7('0x53')]['tags']['join'](';')+';';}else{_0x4c161b[_0x8ff7('0x53')][_0x8ff7('0x63')]=null;}}else{_0x4c161b[_0x8ff7('0x53')]['tags']=null;}if(_0x4c161b[_0x8ff7('0x53')]&&_[_0x8ff7('0x64')](_0x4c161b[_0x8ff7('0x53')])){for(var _0x4628f3=0x0;_0x4628f3<_0x4c161b[_0x8ff7('0x53')][_0x8ff7('0x50')];_0x4628f3+=0x1){_0x4c161b[_0x8ff7('0x53')][_0x4628f3]['ListId']=_0x4c161b[_0x8ff7('0x4f')]['id'];_0x124ff7['push'](_0x4c161b[_0x8ff7('0x53')][_0x4628f3]);}return BPromise[_0x8ff7('0x65')](_0x124ff7,function(_0x29a866){return db[_0x8ff7('0x66')][_0x8ff7('0x52')](_['omit'](_0x29a866,['ids','id'])||{},{'fields':_['keys'](_0x4b12e3),'raw':!![]})[_0x8ff7('0x2a')](function(_0xb386c){_0x42757f[_0x8ff7('0x67')][_0x8ff7('0x68')](_0xb386c[_0x8ff7('0x69')]);})[_0x8ff7('0x4e')](function(_0x29c912){_0x42757f[_0x8ff7('0x6a')][_0x8ff7('0x68')]({'data':_0x29a866,'error':_0x29c912[_0x8ff7('0x6b')]});});})[_0x8ff7('0x2a')](function(_0x240cbc){return _0x42757f;})[_0x8ff7('0x4e')](function(_0x7e223f){return _0x7e223f;});}else{_0x1c61dd[_0x8ff7('0x1e')](0x190)[_0x8ff7('0x20')]({'message':_0x8ff7('0x6c')});}});}})[_0x8ff7('0x2a')](respondWithResult(_0x1c61dd,null))[_0x8ff7('0x4e')](handleError(_0x1c61dd,null));};exports[_0x8ff7('0x6d')]=function(_0x360f41,_0x20d347,_0x54cef0){var _0x230e44;return db['CmList'][_0x8ff7('0x51')]({'where':{'id':_0x360f41[_0x8ff7('0x4f')]['id']},'include':[{'model':db[_0x8ff7('0x6e')],'as':'CustomFields'}]})[_0x8ff7('0x2a')](handleEntityNotFound(_0x20d347,null))[_0x8ff7('0x2a')](function(_0x4c4ea4){if(_0x4c4ea4){_0x230e44=_0x4c4ea4;return db[_0x8ff7('0x66')][_0x8ff7('0x35')];}})['then'](function(_0x261cb3){if(_0x261cb3){var _0x164c08={};var _0xf8a37f={};_0xf8a37f[_0x8ff7('0x39')]=_[_0x8ff7('0x6f')](_[_0x8ff7('0x3b')](_0x261cb3),_[_0x8ff7('0x3a')](_0x230e44[_0x8ff7('0x70')],function(_0x543a6b){return util[_0x8ff7('0x71')](_0x8ff7('0x72'),_0x543a6b['id']);}));_0xf8a37f[_0x8ff7('0x3c')]=_[_0x8ff7('0x3b')](_0x360f41[_0x8ff7('0x3c')]);_0xf8a37f[_0x8ff7('0x3d')]=_[_0x8ff7('0x3e')](_0xf8a37f[_0x8ff7('0x39')],_0xf8a37f[_0x8ff7('0x3c')]);_0x164c08[_0x8ff7('0x3f')]=_[_0x8ff7('0x3e')](_0xf8a37f[_0x8ff7('0x39')],qs[_0x8ff7('0x40')](_0x360f41[_0x8ff7('0x3c')][_0x8ff7('0x40')]));_0x164c08['attributes']=_0x164c08[_0x8ff7('0x3f')]['length']?_0x164c08[_0x8ff7('0x3f')]:_0xf8a37f[_0x8ff7('0x39')];if(!_0x360f41[_0x8ff7('0x3c')]['hasOwnProperty'](_0x8ff7('0x42'))){_0x164c08[_0x8ff7('0x22')]=qs[_0x8ff7('0x22')](_0x360f41['query']['limit']);_0x164c08[_0x8ff7('0x24')]=qs[_0x8ff7('0x24')](_0x360f41['query']['offset']);}_0x164c08[_0x8ff7('0x43')]=qs[_0x8ff7('0x44')](_0x360f41['query'][_0x8ff7('0x44')]);_0x164c08['where']=qs[_0x8ff7('0x3d')](_[_0x8ff7('0x46')](_0x360f41[_0x8ff7('0x3c')],_0xf8a37f[_0x8ff7('0x3d')]));_0x164c08[_0x8ff7('0x73')]=!![];if(_0x360f41['query'][_0x8ff7('0x47')]){_0x164c08['where']=_[_0x8ff7('0x48')](_0x164c08[_0x8ff7('0x45')],{'$or':_['map'](_0x164c08[_0x8ff7('0x3f')],function(_0x1d756d){var _0x32b14d={};_0x32b14d[_0x1d756d]={'$like':'%'+_0x360f41[_0x8ff7('0x3c')][_0x8ff7('0x47')]+'%'};return _0x32b14d;})});}_0x164c08=_[_0x8ff7('0x48')]({},_0x164c08,_0x360f41[_0x8ff7('0x4a')]);return _0x230e44[_0x8ff7('0x6d')](_0x164c08);}})['then'](respondWithResult(_0x20d347,null))[_0x8ff7('0x4e')](handleError(_0x20d347,null));};exports['getContactsCsv']=function(_0xe336a,_0x29fb51,_0x5e1812){var _0x367081;return db[_0x8ff7('0x34')][_0x8ff7('0x51')]({'where':{'id':_0xe336a[_0x8ff7('0x4f')]['id']},'include':[{'model':db[_0x8ff7('0x6e')],'as':'CustomFields'}]})[_0x8ff7('0x2a')](handleEntityNotFound(_0x29fb51,null))['then'](function(_0x1a11d7){if(_0x1a11d7){_0x367081=_0x1a11d7;return db[_0x8ff7('0x66')][_0x8ff7('0x35')];}})[_0x8ff7('0x2a')](function(_0x58ca46){if(_0x58ca46){var _0x419ec8={};var _0x5f510f={};_0x5f510f[_0x8ff7('0x39')]=_['concat'](_[_0x8ff7('0x3b')](_0x58ca46),_[_0x8ff7('0x3a')](_0x367081[_0x8ff7('0x70')],function(_0x3ab43c){return util[_0x8ff7('0x71')](_0x8ff7('0x72'),_0x3ab43c['id']);}));_0x5f510f[_0x8ff7('0x3c')]=_[_0x8ff7('0x3b')](_0xe336a[_0x8ff7('0x3c')]);_0x5f510f[_0x8ff7('0x3d')]=_[_0x8ff7('0x3e')](_0x5f510f[_0x8ff7('0x39')],_0x5f510f['query']);_0x419ec8['attributes']=_[_0x8ff7('0x3e')](_0x5f510f[_0x8ff7('0x39')],qs[_0x8ff7('0x40')](_0xe336a[_0x8ff7('0x3c')]['fields']));_0x419ec8[_0x8ff7('0x3f')]=_0x419ec8[_0x8ff7('0x3f')][_0x8ff7('0x50')]?_0x419ec8[_0x8ff7('0x3f')]:_0x5f510f[_0x8ff7('0x39')];if(!_0xe336a[_0x8ff7('0x3c')]['hasOwnProperty'](_0x8ff7('0x42'))){_0x419ec8['limit']=qs[_0x8ff7('0x22')](_0xe336a[_0x8ff7('0x3c')][_0x8ff7('0x22')]);_0x419ec8['offset']=qs[_0x8ff7('0x24')](_0xe336a[_0x8ff7('0x3c')][_0x8ff7('0x24')]);}_0x419ec8[_0x8ff7('0x43')]=qs[_0x8ff7('0x44')](_0xe336a[_0x8ff7('0x3c')][_0x8ff7('0x44')]);_0x419ec8[_0x8ff7('0x45')]=qs[_0x8ff7('0x3d')](_[_0x8ff7('0x46')](_0xe336a[_0x8ff7('0x3c')],_0x5f510f['filters']));_0x419ec8['raw']=!![];if(_0xe336a[_0x8ff7('0x3c')][_0x8ff7('0x47')]){_0x419ec8['where']=_[_0x8ff7('0x48')](_0x419ec8[_0x8ff7('0x45')],{'$or':_[_0x8ff7('0x3a')](_0x419ec8[_0x8ff7('0x3f')],function(_0x5d7fd0){var _0x2b18d9={};_0x2b18d9[_0x5d7fd0]={'$like':'%'+_0xe336a[_0x8ff7('0x3c')][_0x8ff7('0x47')]+'%'};return _0x2b18d9;})});}_0x419ec8=_[_0x8ff7('0x48')]({},_0x419ec8,_0xe336a[_0x8ff7('0x4a')]);return _0x367081['getContacts'](_0x419ec8);}})['then'](function(_0x45ec9f){if(!_[_0x8ff7('0x74')](_0x45ec9f)){var _0x9f3eea=toCsv(_0x45ec9f);var _0x5410c8=Date[_0x8ff7('0x75')]();fs['writeFileSync'](util[_0x8ff7('0x71')]('/tmp/list_%d_%s.csv',_0x367081['id'],_0x5410c8),_0x9f3eea);_0x29fb51['setHeader'](_0x8ff7('0x76'),_0x8ff7('0x77')+util['format'](_0x8ff7('0x78'),_0x367081['id'],_0x5410c8));_0x29fb51['setHeader'](_0x8ff7('0x79'),_0x8ff7('0x7a'));return _0x29fb51[_0x8ff7('0x7b')](util['format'](_0x8ff7('0x7c'),_0x367081['id'],_0x5410c8));}else{return _0x29fb51[_0x8ff7('0x7d')](0xcc);}})['catch'](handleError(_0x29fb51,null));};exports[_0x8ff7('0x7e')]=function(_0x435894,_0x192d93,_0x3b5683){var _0x335455;delete _0x435894['body']['id'];return db[_0x8ff7('0x34')][_0x8ff7('0x5e')]({'where':{'id':_0x435894['params']['id']}})['then'](handleEntityNotFound(_0x192d93,null))['then'](function(_0x1717fc){if(_0x1717fc){return db[_0x8ff7('0x7f')]['transaction'](function(_0x5f198c){return db[_0x8ff7('0x6e')]['create'](_0x435894['body'],{'transaction':_0x5f198c})[_0x8ff7('0x2a')](function(_0x39afef){_0x335455=_0x39afef;return _0x1717fc['addCustomFields'](_0x39afef,{'transaction':_0x5f198c});})[_0x8ff7('0x2a')](function(){var _0x445dad={'type':db[_0x8ff7('0x80')]['TEXT'],'transaction':_0x5f198c};switch(_0x435894[_0x8ff7('0x53')][_0x8ff7('0x37')]){case _0x8ff7('0x81'):_0x445dad['type']=db[_0x8ff7('0x80')][_0x8ff7('0x82')];break;case'number':_0x445dad[_0x8ff7('0x37')]=db['Sequelize'][_0x8ff7('0x83')];break;case'switch':_0x445dad[_0x8ff7('0x37')]=db[_0x8ff7('0x80')]['BOOLEAN'];_0x445dad[_0x8ff7('0x84')]=![];break;default:}return db[_0x8ff7('0x7f')]['queryInterface'][_0x8ff7('0x85')](_0x8ff7('0x86'),util[_0x8ff7('0x71')](_0x8ff7('0x87'),_0x335455['id']),_0x445dad);})[_0x8ff7('0x2a')](function(){return _0x335455;});});}})[_0x8ff7('0x2a')](respondWithResult(_0x192d93,null))[_0x8ff7('0x4e')](handleError(_0x192d93,null));};exports[_0x8ff7('0x88')]=function(_0x1367b7,_0x356611,_0x5d06ee){var _0x3e46de={};var _0x306c8c={};var _0x1e7d95;var _0xea6ef4;return db[_0x8ff7('0x34')][_0x8ff7('0x5e')]({'where':{'id':_0x1367b7['params']['id']}})[_0x8ff7('0x2a')](handleEntityNotFound(_0x356611,null))['then'](function(_0x3b0374){if(_0x3b0374){_0x1e7d95=_0x3b0374;_0x306c8c['model']=_['keys'](db[_0x8ff7('0x6e')][_0x8ff7('0x35')]);_0x306c8c['query']=_['keys'](_0x1367b7[_0x8ff7('0x3c')]);_0x306c8c['filters']=_['intersection'](_0x306c8c['model'],_0x306c8c[_0x8ff7('0x3c')]);_0x3e46de[_0x8ff7('0x3f')]=_[_0x8ff7('0x3e')](_0x306c8c['model'],qs[_0x8ff7('0x40')](_0x1367b7[_0x8ff7('0x3c')][_0x8ff7('0x40')]));_0x3e46de[_0x8ff7('0x3f')]=_0x3e46de[_0x8ff7('0x3f')][_0x8ff7('0x50')]?_0x3e46de[_0x8ff7('0x3f')]:_0x306c8c[_0x8ff7('0x39')];_0x3e46de[_0x8ff7('0x43')]=qs[_0x8ff7('0x44')](_0x1367b7[_0x8ff7('0x3c')]['sort']);_0x3e46de[_0x8ff7('0x45')]=qs[_0x8ff7('0x3d')](_[_0x8ff7('0x46')](_0x1367b7[_0x8ff7('0x3c')],_0x306c8c[_0x8ff7('0x3d')]));_0x3e46de['where']=_[_0x8ff7('0x48')](_0x3e46de['where'],{'$or':[{'ListId':_0x3b0374['id']},{'ListId':null}]});if(_0x1367b7['query'][_0x8ff7('0x47')]){_0x3e46de['where']=_[_0x8ff7('0x48')](_0x3e46de[_0x8ff7('0x45')],{'$or':_[_0x8ff7('0x3a')](_0x3e46de[_0x8ff7('0x3f')],function(_0x161ee1){var _0x312ae9={};_0x312ae9[_0x161ee1]={'$like':'%'+_0x1367b7['query'][_0x8ff7('0x47')]+'%'};return _0x312ae9;})});}_0x3e46de=_[_0x8ff7('0x48')]({},_0x3e46de,_0x1367b7[_0x8ff7('0x4a')]);return db[_0x8ff7('0x6e')][_0x8ff7('0x89')](_0x3e46de);}})[_0x8ff7('0x2a')](respondWithResult(_0x356611,null))[_0x8ff7('0x4e')](handleError(_0x356611,null));};exports[_0x8ff7('0x8a')]=function(_0x3ee15b,_0x1cb78c,_0x57b02e){return db['CmList']['find']({'where':{'id':_0x3ee15b[_0x8ff7('0x4f')]['id']}})[_0x8ff7('0x2a')](handleEntityNotFound(_0x1cb78c,null))['then'](function(_0x56507a){if(_0x56507a){return _0x56507a[_0x8ff7('0x8a')](_0x3ee15b[_0x8ff7('0x53')][_0x8ff7('0x61')],_[_0x8ff7('0x8b')](_0x3ee15b['body'],[_0x8ff7('0x61'),'id'])||{})[_0x8ff7('0x8c')](function(_0x41f75e){for(var _0x4ff5e9=0x0;_0x4ff5e9<_0x3ee15b[_0x8ff7('0x53')][_0x8ff7('0x61')][_0x8ff7('0x50')];_0x4ff5e9+=0x1){socket['emit'](_0x8ff7('0x8d'),{'UserId':Number(_0x3ee15b[_0x8ff7('0x53')]['ids'][_0x4ff5e9]),'CmListId':Number(_0x3ee15b[_0x8ff7('0x4f')]['id'])});}return _0x41f75e;});}})['then'](respondWithResult(_0x1cb78c,null))[_0x8ff7('0x4e')](handleError(_0x1cb78c,null));};exports[_0x8ff7('0x8e')]=function(_0x2c6e4f,_0x5eab55,_0x4fa482){return db[_0x8ff7('0x34')][_0x8ff7('0x51')]({'where':{'id':_0x2c6e4f[_0x8ff7('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5eab55,null))['then'](function(_0x1fdfe5){if(_0x1fdfe5){return _0x1fdfe5['removeAgents'](_0x2c6e4f[_0x8ff7('0x3c')][_0x8ff7('0x61')])[_0x8ff7('0x2a')](function(){if(_[_0x8ff7('0x64')](_0x2c6e4f['query']['ids'])){for(var _0x50e75e=0x0;_0x50e75e<_0x2c6e4f[_0x8ff7('0x3c')][_0x8ff7('0x61')][_0x8ff7('0x50')];_0x50e75e+=0x1){socket[_0x8ff7('0x8f')](_0x8ff7('0x90'),{'UserId':Number(_0x2c6e4f['query'][_0x8ff7('0x61')][_0x50e75e]),'CmListId':Number(_0x2c6e4f['params']['id'])});}}else{socket[_0x8ff7('0x8f')]('userCmList:remove',{'UserId':Number(_0x2c6e4f[_0x8ff7('0x3c')][_0x8ff7('0x61')]),'CmListId':Number(_0x2c6e4f[_0x8ff7('0x4f')]['id'])});}});}})[_0x8ff7('0x2a')](respondWithStatusCode(_0x5eab55,null))[_0x8ff7('0x4e')](handleError(_0x5eab55,null));};exports[_0x8ff7('0x91')]=function(_0x126272,_0x5ea570,_0x33db5b){var _0x2088a9={};var _0x18165e={};var _0x264131;var _0x4bcc64;return db[_0x8ff7('0x34')][_0x8ff7('0x5e')]({'where':{'id':_0x126272[_0x8ff7('0x4f')]['id']}})[_0x8ff7('0x2a')](handleEntityNotFound(_0x5ea570,null))[_0x8ff7('0x2a')](function(_0x230972){if(_0x230972){_0x264131=_0x230972;_0x18165e['model']=_[_0x8ff7('0x3b')](db[_0x8ff7('0x92')][_0x8ff7('0x35')]);_0x18165e['query']=_[_0x8ff7('0x3b')](_0x126272['query']);_0x18165e[_0x8ff7('0x3d')]=_[_0x8ff7('0x3e')](_0x18165e[_0x8ff7('0x39')],_0x18165e[_0x8ff7('0x3c')]);_0x2088a9['attributes']=_[_0x8ff7('0x3e')](_0x18165e[_0x8ff7('0x39')],qs[_0x8ff7('0x40')](_0x126272[_0x8ff7('0x3c')][_0x8ff7('0x40')]));_0x2088a9['attributes']=_0x2088a9[_0x8ff7('0x3f')]['length']?_0x2088a9[_0x8ff7('0x3f')]:_0x18165e[_0x8ff7('0x39')];_0x2088a9[_0x8ff7('0x43')]=qs[_0x8ff7('0x44')](_0x126272[_0x8ff7('0x3c')][_0x8ff7('0x44')]);_0x2088a9[_0x8ff7('0x45')]=qs['filters'](_[_0x8ff7('0x46')](_0x126272[_0x8ff7('0x3c')],_0x18165e[_0x8ff7('0x3d')]));if(_0x126272[_0x8ff7('0x3c')][_0x8ff7('0x47')]){_0x2088a9[_0x8ff7('0x45')]=_[_0x8ff7('0x48')](_0x2088a9[_0x8ff7('0x45')],{'$or':_[_0x8ff7('0x3a')](_0x2088a9[_0x8ff7('0x3f')],function(_0x3aea18){var _0x264da0={};_0x264da0[_0x3aea18]={'$like':'%'+_0x126272['query'][_0x8ff7('0x47')]+'%'};return _0x264da0;})});}_0x2088a9=_[_0x8ff7('0x48')]({},_0x2088a9,_0x126272['options']);return _0x264131[_0x8ff7('0x91')](_0x2088a9);}})['then'](function(_0x56fedd){if(_0x56fedd){_0x4bcc64=_0x56fedd[_0x8ff7('0x50')];if(!_0x126272[_0x8ff7('0x3c')][_0x8ff7('0x41')](_0x8ff7('0x42'))){_0x2088a9['limit']=qs['limit'](_0x126272[_0x8ff7('0x3c')][_0x8ff7('0x22')]);_0x2088a9[_0x8ff7('0x24')]=qs['offset'](_0x126272[_0x8ff7('0x3c')][_0x8ff7('0x24')]);}return _0x264131[_0x8ff7('0x91')](_0x2088a9);}})[_0x8ff7('0x2a')](function(_0x210509){if(_0x210509){return _0x210509?{'count':_0x4bcc64,'rows':_0x210509}:null;}})[_0x8ff7('0x2a')](respondWithResult(_0x5ea570,null))[_0x8ff7('0x4e')](handleError(_0x5ea570,null));};
\ No newline at end of file
+var _0x2e4b=['socket.io-emitter','redis','./cmList.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','Lists','UserProfileResource','sendStatus','error','send','index','map','CmList','rawAttributes','fieldName','type','model','name','query','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ListId','Disposition','getDispositions','findOne','hasOwnProperty','nolimit','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','each','omit','success','errors','push','message','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','isEmpty','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','sequelize','transaction','addCustomFields','TEXT','text','Sequelize','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost'];(function(_0x36b037,_0x2b234e){var _0x409194=function(_0xddc9dc){while(--_0xddc9dc){_0x36b037['push'](_0x36b037['shift']());}};_0x409194(++_0x2b234e);}(_0x2e4b,0x7c));var _0xb2e4=function(_0x39f34f,_0x298f45){_0x39f34f=_0x39f34f-0x0;var _0x59fee1=_0x2e4b[_0x39f34f];return _0x59fee1;};'use strict';var emlformat=require(_0xb2e4('0x0'));var rimraf=require(_0xb2e4('0x1'));var zipdir=require(_0xb2e4('0x2'));var jsonpatch=require(_0xb2e4('0x3'));var rp=require(_0xb2e4('0x4'));var moment=require('moment');var BPromise=require(_0xb2e4('0x5'));var Mustache=require(_0xb2e4('0x6'));var util=require(_0xb2e4('0x7'));var path=require(_0xb2e4('0x8'));var sox=require(_0xb2e4('0x9'));var csv=require(_0xb2e4('0xa'));var ejs=require(_0xb2e4('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb2e4('0xc'));var squel=require('squel');var crypto=require(_0xb2e4('0xd'));var jsforce=require(_0xb2e4('0xe'));var deskjs=require(_0xb2e4('0xf'));var toCsv=require(_0xb2e4('0xa'));var querystring=require(_0xb2e4('0x10'));var Papa=require(_0xb2e4('0x11'));var Redis=require(_0xb2e4('0x12'));var authService=require(_0xb2e4('0x13'));var qs=require(_0xb2e4('0x14'));var as=require(_0xb2e4('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb2e4('0x16'))(_0xb2e4('0x17'));var utils=require(_0xb2e4('0x18'));var config=require(_0xb2e4('0x19'));var licenseUtil=require(_0xb2e4('0x1a'));var db=require(_0xb2e4('0x1b'))['db'];config['redis']=_[_0xb2e4('0x1c')](config['redis'],{'host':_0xb2e4('0x1d'),'port':0x18eb});var socket=require(_0xb2e4('0x1e'))(new Redis(config[_0xb2e4('0x1f')]));require(_0xb2e4('0x20'))[_0xb2e4('0x21')](socket);function respondWithStatusCode(_0x472984,_0x12e923){_0x12e923=_0x12e923||0xcc;return function(_0x5738ae){if(_0x5738ae){return _0x472984['sendStatus'](_0x12e923);}return _0x472984[_0xb2e4('0x22')](_0x12e923)[_0xb2e4('0x23')]();};}function respondWithResult(_0x93addb,_0x3ca15a){_0x3ca15a=_0x3ca15a||0xc8;return function(_0x57a8d3){if(_0x57a8d3){return _0x93addb[_0xb2e4('0x22')](_0x3ca15a)[_0xb2e4('0x24')](_0x57a8d3);}};}function respondWithFilteredResult(_0x575a58,_0x26878a){return function(_0x2a01a0){if(_0x2a01a0){var _0x5c9651=typeof _0x26878a[_0xb2e4('0x25')]==='undefined'&&typeof _0x26878a['limit']===_0xb2e4('0x26');var _0x4418f7=_0x2a01a0[_0xb2e4('0x27')];var _0x2a8c16=_0x5c9651?0x0:_0x26878a[_0xb2e4('0x25')];var _0x47b804=_0x5c9651?_0x2a01a0[_0xb2e4('0x27')]:_0x26878a[_0xb2e4('0x25')]+_0x26878a[_0xb2e4('0x28')];var _0x1c8c2c;if(_0x47b804>=_0x4418f7){_0x47b804=_0x4418f7;_0x1c8c2c=0xc8;}else{_0x1c8c2c=0xce;}_0x575a58['status'](_0x1c8c2c);return _0x575a58[_0xb2e4('0x29')](_0xb2e4('0x2a'),_0x2a8c16+'-'+_0x47b804+'/'+_0x4418f7)[_0xb2e4('0x24')](_0x2a01a0);}return null;};}function patchUpdates(_0x2ad646){return function(_0x512c76){try{jsonpatch[_0xb2e4('0x2b')](_0x512c76,_0x2ad646,!![]);}catch(_0x5d45e9){return BPromise[_0xb2e4('0x2c')](_0x5d45e9);}return _0x512c76[_0xb2e4('0x2d')]();};}function saveUpdates(_0x2c75f7,_0x50b04b){return function(_0x3a1631){if(_0x3a1631){return _0x3a1631[_0xb2e4('0x2e')](_0x2c75f7)[_0xb2e4('0x2f')](function(_0x1bbc01){return _0x1bbc01;});}return null;};}function removeEntity(_0x361df4,_0x22ee22){return function(_0x298f41){if(_0x298f41){return _0x298f41[_0xb2e4('0x30')]()[_0xb2e4('0x2f')](function(){var _0x5a3d96=_0x298f41['get']({'plain':!![]});var _0xb3bc19=_0xb2e4('0x31');return db[_0xb2e4('0x32')][_0xb2e4('0x30')]({'where':{'type':_0xb3bc19,'resourceId':_0x5a3d96['id']}})['then'](function(){return _0x298f41;});})[_0xb2e4('0x2f')](function(){_0x361df4[_0xb2e4('0x22')](0xcc)[_0xb2e4('0x23')]();});}};}function handleEntityNotFound(_0x3817be,_0x4d95f2){return function(_0x14368a){if(!_0x14368a){_0x3817be[_0xb2e4('0x33')](0x194);}return _0x14368a;};}function handleError(_0x2a89d8,_0x4c1eb0){_0x4c1eb0=_0x4c1eb0||0x1f4;return function(_0x5dc2f5){logger[_0xb2e4('0x34')](_0x5dc2f5['stack']);if(_0x5dc2f5['name']){delete _0x5dc2f5['name'];}_0x2a89d8['status'](_0x4c1eb0)[_0xb2e4('0x35')](_0x5dc2f5);};}exports[_0xb2e4('0x36')]=function(_0x264b1a,_0x59dfb5){var _0x572150={},_0x259f86={},_0x3157f9={'count':0x0,'rows':[]};var _0x1e9841=_[_0xb2e4('0x37')](db[_0xb2e4('0x38')][_0xb2e4('0x39')],function(_0x44739a){return{'name':_0x44739a[_0xb2e4('0x3a')],'type':_0x44739a[_0xb2e4('0x3b')]['key']};});_0x259f86[_0xb2e4('0x3c')]=_[_0xb2e4('0x37')](_0x1e9841,_0xb2e4('0x3d'));_0x259f86['query']=_['keys'](_0x264b1a[_0xb2e4('0x3e')]);_0x259f86[_0xb2e4('0x3f')]=_[_0xb2e4('0x40')](_0x259f86['model'],_0x259f86[_0xb2e4('0x3e')]);_0x572150['attributes']=_['intersection'](_0x259f86['model'],qs[_0xb2e4('0x41')](_0x264b1a[_0xb2e4('0x3e')]['fields']));_0x572150[_0xb2e4('0x42')]=_0x572150['attributes'][_0xb2e4('0x43')]?_0x572150[_0xb2e4('0x42')]:_0x259f86['model'];if(!_0x264b1a[_0xb2e4('0x3e')]['hasOwnProperty']('nolimit')){_0x572150[_0xb2e4('0x28')]=qs[_0xb2e4('0x28')](_0x264b1a['query'][_0xb2e4('0x28')]);_0x572150[_0xb2e4('0x25')]=qs[_0xb2e4('0x25')](_0x264b1a[_0xb2e4('0x3e')][_0xb2e4('0x25')]);}_0x572150[_0xb2e4('0x44')]=qs[_0xb2e4('0x45')](_0x264b1a[_0xb2e4('0x3e')][_0xb2e4('0x45')]);_0x572150[_0xb2e4('0x46')]=qs[_0xb2e4('0x3f')](_[_0xb2e4('0x47')](_0x264b1a[_0xb2e4('0x3e')],_0x259f86[_0xb2e4('0x3f')]),_0x1e9841);if(_0x264b1a[_0xb2e4('0x3e')][_0xb2e4('0x48')]){_0x572150[_0xb2e4('0x46')]=_['merge'](_0x572150[_0xb2e4('0x46')],{'$or':_[_0xb2e4('0x37')](_0x1e9841,function(_0x599b67){if(_0x599b67[_0xb2e4('0x3b')]!==_0xb2e4('0x49')){var _0x536ed2={};_0x536ed2[_0x599b67[_0xb2e4('0x3d')]]={'$like':'%'+_0x264b1a[_0xb2e4('0x3e')][_0xb2e4('0x48')]+'%'};return _0x536ed2;}})});}_0x572150=_[_0xb2e4('0x4a')]({},_0x572150,_0x264b1a[_0xb2e4('0x4b')]);var _0x523f6d={'where':_0x572150['where']};return db['CmList']['count'](_0x523f6d)[_0xb2e4('0x2f')](function(_0x4868e9){_0x3157f9[_0xb2e4('0x27')]=_0x4868e9;if(_0x264b1a[_0xb2e4('0x3e')][_0xb2e4('0x4c')]){_0x572150[_0xb2e4('0x4d')]=[{'all':!![]}];}return db[_0xb2e4('0x38')][_0xb2e4('0x4e')](_0x572150);})['then'](function(_0x1db5d9){_0x3157f9[_0xb2e4('0x4f')]=_0x1db5d9;return _0x3157f9;})['then'](respondWithFilteredResult(_0x59dfb5,_0x572150))[_0xb2e4('0x50')](handleError(_0x59dfb5,null));};exports['show']=function(_0x5a75be,_0x172bad){var _0x1e9b58={'raw':![],'where':{'id':_0x5a75be[_0xb2e4('0x51')]['id']}},_0x4fadde={};_0x4fadde[_0xb2e4('0x3c')]=_[_0xb2e4('0x52')](db[_0xb2e4('0x38')][_0xb2e4('0x39')]);_0x4fadde[_0xb2e4('0x3e')]=_[_0xb2e4('0x52')](_0x5a75be[_0xb2e4('0x3e')]);_0x4fadde[_0xb2e4('0x3f')]=_['intersection'](_0x4fadde[_0xb2e4('0x3c')],_0x4fadde[_0xb2e4('0x3e')]);_0x1e9b58[_0xb2e4('0x42')]=_['intersection'](_0x4fadde['model'],qs['fields'](_0x5a75be[_0xb2e4('0x3e')]['fields']));_0x1e9b58['attributes']=_0x1e9b58[_0xb2e4('0x42')][_0xb2e4('0x43')]?_0x1e9b58[_0xb2e4('0x42')]:_0x4fadde[_0xb2e4('0x3c')];if(_0x5a75be[_0xb2e4('0x3e')][_0xb2e4('0x4c')]){_0x1e9b58['include']=[{'all':!![]}];}_0x1e9b58=_['merge']({},_0x1e9b58,_0x5a75be[_0xb2e4('0x4b')]);return db['CmList'][_0xb2e4('0x53')](_0x1e9b58)['then'](handleEntityNotFound(_0x172bad,null))['then'](respondWithResult(_0x172bad,null))['catch'](handleError(_0x172bad,null));};exports[_0xb2e4('0x54')]=function(_0x3c0875,_0x59fd2f){return db[_0xb2e4('0x38')][_0xb2e4('0x54')](_0x3c0875['body'],{})['then'](function(_0x577dc4){var _0x517e44=_0x3c0875[_0xb2e4('0x55')][_0xb2e4('0x56')]({'plain':!![]});if(!_0x517e44)throw new Error(_0xb2e4('0x57'));if(_0x517e44[_0xb2e4('0x58')]===_0xb2e4('0x55')){var _0x5ce02c=_0x577dc4[_0xb2e4('0x56')]({'plain':!![]});var _0x25f246=_0xb2e4('0x31');return db['UserProfileSection'][_0xb2e4('0x53')]({'where':{'name':_0x25f246,'userProfileId':_0x517e44[_0xb2e4('0x59')]},'raw':!![]})[_0xb2e4('0x2f')](function(_0x3f9ea2){if(_0x3f9ea2&&_0x3f9ea2['autoAssociation']===0x0){return db[_0xb2e4('0x32')][_0xb2e4('0x54')]({'name':_0x5ce02c[_0xb2e4('0x3d')],'resourceId':_0x5ce02c['id'],'type':_0x3f9ea2['name'],'sectionId':_0x3f9ea2['id']},{})['then'](function(){return _0x577dc4;});}else{return _0x577dc4;}})[_0xb2e4('0x50')](function(_0x1b195c){logger[_0xb2e4('0x34')](_0xb2e4('0x5a'),_0x1b195c);throw _0x1b195c;});}return _0x577dc4;})['then'](respondWithResult(_0x59fd2f,0xc9))['catch'](handleError(_0x59fd2f,null));};exports[_0xb2e4('0x2e')]=function(_0x715882,_0x3dec54){if(_0x715882[_0xb2e4('0x5b')]['id']){delete _0x715882[_0xb2e4('0x5b')]['id'];}return db[_0xb2e4('0x38')]['find']({'where':{'id':_0x715882[_0xb2e4('0x51')]['id']}})[_0xb2e4('0x2f')](handleEntityNotFound(_0x3dec54,null))[_0xb2e4('0x2f')](saveUpdates(_0x715882[_0xb2e4('0x5b')],null))[_0xb2e4('0x2f')](respondWithResult(_0x3dec54,null))[_0xb2e4('0x50')](handleError(_0x3dec54,null));};exports['destroy']=function(_0x2ebe04,_0x5d62bf){return db[_0xb2e4('0x38')][_0xb2e4('0x53')]({'where':{'id':_0x2ebe04[_0xb2e4('0x51')]['id']}})[_0xb2e4('0x2f')](handleEntityNotFound(_0x5d62bf,null))[_0xb2e4('0x2f')](removeEntity(_0x5d62bf,null))['catch'](handleError(_0x5d62bf,null));};exports[_0xb2e4('0x5c')]=function(_0x52abc2,_0x3c08ab){return db['CmList']['describe']()[_0xb2e4('0x2f')](respondWithResult(_0x3c08ab,null))[_0xb2e4('0x50')](handleError(_0x3c08ab,null));};exports[_0xb2e4('0x5d')]=function(_0x53a91f,_0x452cd0,_0x529d7a){if(_0x53a91f[_0xb2e4('0x5b')]['id']){delete _0x53a91f[_0xb2e4('0x5b')]['id'];}return db['CmList'][_0xb2e4('0x53')]({'where':{'id':_0x53a91f[_0xb2e4('0x51')]['id']}})[_0xb2e4('0x2f')](handleEntityNotFound(_0x452cd0,null))['then'](function(_0x2d7c05){if(_0x2d7c05){_0x53a91f[_0xb2e4('0x5b')][_0xb2e4('0x5e')]=_0x2d7c05['id'];return db[_0xb2e4('0x5f')][_0xb2e4('0x54')](_0x53a91f[_0xb2e4('0x5b')]);}})[_0xb2e4('0x2f')](respondWithResult(_0x452cd0,null))[_0xb2e4('0x50')](handleError(_0x452cd0,null));};exports[_0xb2e4('0x60')]=function(_0x27597f,_0x4f2042,_0x5f56fe){var _0x333994={'raw':![],'where':{}};var _0x4be802={};var _0x9510f9={'count':0x0,'rows':[]};return db[_0xb2e4('0x38')][_0xb2e4('0x61')]({'where':{'id':_0x27597f[_0xb2e4('0x51')]['id']}})[_0xb2e4('0x2f')](handleEntityNotFound(_0x4f2042,null))['then'](function(_0x4ad7){if(_0x4ad7){_0x4be802['model']=_['keys'](db[_0xb2e4('0x5f')][_0xb2e4('0x39')]);_0x4be802[_0xb2e4('0x3e')]=_[_0xb2e4('0x52')](_0x27597f[_0xb2e4('0x3e')]);_0x4be802[_0xb2e4('0x3f')]=_['intersection'](_0x4be802['model'],_0x4be802['query']);_0x333994[_0xb2e4('0x42')]=_['intersection'](_0x4be802[_0xb2e4('0x3c')],qs[_0xb2e4('0x41')](_0x27597f['query'][_0xb2e4('0x41')]));_0x333994[_0xb2e4('0x42')]=_0x333994[_0xb2e4('0x42')][_0xb2e4('0x43')]?_0x333994['attributes']:_0x4be802[_0xb2e4('0x3c')];if(!_0x27597f[_0xb2e4('0x3e')][_0xb2e4('0x62')](_0xb2e4('0x63'))){_0x333994['limit']=qs[_0xb2e4('0x28')](_0x27597f['query'][_0xb2e4('0x28')]);_0x333994[_0xb2e4('0x25')]=qs[_0xb2e4('0x25')](_0x27597f['query'][_0xb2e4('0x25')]);}_0x333994[_0xb2e4('0x44')]=qs[_0xb2e4('0x45')](_0x27597f['query'][_0xb2e4('0x45')]);_0x333994['where']=qs[_0xb2e4('0x3f')](_['pick'](_0x27597f['query'],_0x4be802[_0xb2e4('0x3f')]));_0x333994[_0xb2e4('0x46')]['ListId']=_0x4ad7['id'];if(_0x27597f['query'][_0xb2e4('0x48')]){_0x333994[_0xb2e4('0x46')]=_[_0xb2e4('0x4a')](_0x333994['where'],{'$or':_['map'](_0x333994[_0xb2e4('0x42')],function(_0x2ac961){var _0x14839a={};_0x14839a[_0x2ac961]={'$like':'%'+_0x27597f[_0xb2e4('0x3e')][_0xb2e4('0x48')]+'%'};return _0x14839a;})});}_0x333994=_['merge']({},_0x333994,_0x27597f[_0xb2e4('0x4b')]);return db['Disposition'][_0xb2e4('0x27')]({'where':_0x333994[_0xb2e4('0x46')]})['then'](function(_0x46f035){_0x9510f9[_0xb2e4('0x27')]=_0x46f035;if(_0x27597f[_0xb2e4('0x3e')]['includeAll']){_0x333994['include']=[{'all':!![]}];}return db[_0xb2e4('0x5f')]['findAll'](_0x333994);})[_0xb2e4('0x2f')](function(_0x5a16e9){_0x9510f9[_0xb2e4('0x4f')]=_0x5a16e9;return _0x9510f9;});}})[_0xb2e4('0x2f')](respondWithFilteredResult(_0x4f2042,_0x333994))['catch'](handleError(_0x4f2042,null));};exports[_0xb2e4('0x64')]=function(_0x2e9a93,_0x57372a,_0x16253e){return db[_0xb2e4('0x38')]['find']({'where':{'id':_0x2e9a93[_0xb2e4('0x51')]['id']}})['then'](handleEntityNotFound(_0x57372a,null))[_0xb2e4('0x2f')](function(_0x45542f){if(_0x45542f){return _0x45542f['removeDispositions'](_0x2e9a93[_0xb2e4('0x3e')][_0xb2e4('0x65')]);}})[_0xb2e4('0x2f')](respondWithStatusCode(_0x57372a,null))[_0xb2e4('0x50')](handleError(_0x57372a,null));};exports[_0xb2e4('0x66')]=function(_0x236857,_0xc80fee,_0x1adef3){return db[_0xb2e4('0x38')][_0xb2e4('0x53')]({'where':{'id':_0x236857[_0xb2e4('0x51')]['id']}})[_0xb2e4('0x2f')](handleEntityNotFound(_0xc80fee,null))[_0xb2e4('0x2f')](function(_0x5922b9){if(_0x5922b9){var _0x2a34d6=[];var _0x647968={'success':[],'errors':[]};return db[_0xb2e4('0x67')][_0xb2e4('0x5c')]()[_0xb2e4('0x2f')](function(_0x5a7f85){if(_0x236857['body'][_0xb2e4('0x68')]&&_[_0xb2e4('0x69')](_0x236857[_0xb2e4('0x5b')][_0xb2e4('0x68')])){if(_0x236857[_0xb2e4('0x5b')]['tags']['length']){_0x236857['body'][_0xb2e4('0x68')]=_0x236857[_0xb2e4('0x5b')][_0xb2e4('0x68')][_0xb2e4('0x6a')](';')+';';}else{_0x236857[_0xb2e4('0x5b')][_0xb2e4('0x68')]=null;}}else{_0x236857['body']['tags']=null;}if(_0x236857['body']&&_[_0xb2e4('0x69')](_0x236857[_0xb2e4('0x5b')])){for(var _0x301ddb=0x0;_0x301ddb<_0x236857['body'][_0xb2e4('0x43')];_0x301ddb+=0x1){_0x236857[_0xb2e4('0x5b')][_0x301ddb][_0xb2e4('0x5e')]=_0x236857[_0xb2e4('0x51')]['id'];_0x2a34d6['push'](_0x236857['body'][_0x301ddb]);}return BPromise[_0xb2e4('0x6b')](_0x2a34d6,function(_0x29d701){return db['CmContact'][_0xb2e4('0x54')](_[_0xb2e4('0x6c')](_0x29d701,[_0xb2e4('0x65'),'id'])||{},{'fields':_[_0xb2e4('0x52')](_0x5a7f85),'raw':!![]})[_0xb2e4('0x2f')](function(_0x580ddf){_0x647968[_0xb2e4('0x6d')]['push'](_0x580ddf['dataValues']);})['catch'](function(_0x38c3d2){_0x647968[_0xb2e4('0x6e')][_0xb2e4('0x6f')]({'data':_0x29d701,'error':_0x38c3d2[_0xb2e4('0x70')]});});})['then'](function(_0x51f5b8){return _0x647968;})[_0xb2e4('0x50')](function(_0x3bd473){return _0x3bd473;});}else{_0xc80fee[_0xb2e4('0x22')](0x190)[_0xb2e4('0x24')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0xb2e4('0x2f')](respondWithResult(_0xc80fee,null))[_0xb2e4('0x50')](handleError(_0xc80fee,null));};exports[_0xb2e4('0x71')]=function(_0x5c7238,_0x2912e6,_0x48eaa1){var _0x48d072;return db['CmList']['find']({'where':{'id':_0x5c7238[_0xb2e4('0x51')]['id']},'include':[{'model':db[_0xb2e4('0x72')],'as':_0xb2e4('0x73')}]})['then'](handleEntityNotFound(_0x2912e6,null))[_0xb2e4('0x2f')](function(_0x5e99){if(_0x5e99){_0x48d072=_0x5e99;return db[_0xb2e4('0x67')]['rawAttributes'];}})[_0xb2e4('0x2f')](function(_0x52063a){if(_0x52063a){var _0x386f21={};var _0x522832={};_0x522832[_0xb2e4('0x3c')]=_[_0xb2e4('0x74')](_[_0xb2e4('0x52')](_0x52063a),_[_0xb2e4('0x37')](_0x48d072[_0xb2e4('0x73')],function(_0x595ba5){return util[_0xb2e4('0x75')](_0xb2e4('0x76'),_0x595ba5['id']);}));_0x522832[_0xb2e4('0x3e')]=_[_0xb2e4('0x52')](_0x5c7238[_0xb2e4('0x3e')]);_0x522832[_0xb2e4('0x3f')]=_[_0xb2e4('0x40')](_0x522832[_0xb2e4('0x3c')],_0x522832[_0xb2e4('0x3e')]);_0x386f21[_0xb2e4('0x42')]=_[_0xb2e4('0x40')](_0x522832[_0xb2e4('0x3c')],qs['fields'](_0x5c7238['query'][_0xb2e4('0x41')]));_0x386f21[_0xb2e4('0x42')]=_0x386f21[_0xb2e4('0x42')][_0xb2e4('0x43')]?_0x386f21['attributes']:_0x522832['model'];if(!_0x5c7238[_0xb2e4('0x3e')][_0xb2e4('0x62')](_0xb2e4('0x63'))){_0x386f21[_0xb2e4('0x28')]=qs[_0xb2e4('0x28')](_0x5c7238['query'][_0xb2e4('0x28')]);_0x386f21['offset']=qs[_0xb2e4('0x25')](_0x5c7238[_0xb2e4('0x3e')]['offset']);}_0x386f21[_0xb2e4('0x44')]=qs[_0xb2e4('0x45')](_0x5c7238[_0xb2e4('0x3e')]['sort']);_0x386f21[_0xb2e4('0x46')]=qs[_0xb2e4('0x3f')](_[_0xb2e4('0x47')](_0x5c7238['query'],_0x522832[_0xb2e4('0x3f')]));_0x386f21[_0xb2e4('0x77')]=!![];if(_0x5c7238[_0xb2e4('0x3e')][_0xb2e4('0x48')]){_0x386f21[_0xb2e4('0x46')]=_[_0xb2e4('0x4a')](_0x386f21[_0xb2e4('0x46')],{'$or':_[_0xb2e4('0x37')](_0x386f21[_0xb2e4('0x42')],function(_0x3235aa){var _0x152570={};_0x152570[_0x3235aa]={'$like':'%'+_0x5c7238[_0xb2e4('0x3e')][_0xb2e4('0x48')]+'%'};return _0x152570;})});}_0x386f21=_['merge']({},_0x386f21,_0x5c7238['options']);return _0x48d072[_0xb2e4('0x71')](_0x386f21);}})[_0xb2e4('0x2f')](respondWithResult(_0x2912e6,null))[_0xb2e4('0x50')](handleError(_0x2912e6,null));};exports['getContactsCsv']=function(_0x253d73,_0x47e812,_0x6373d6){var _0x1e54cf;return db[_0xb2e4('0x38')][_0xb2e4('0x53')]({'where':{'id':_0x253d73[_0xb2e4('0x51')]['id']},'include':[{'model':db[_0xb2e4('0x72')],'as':_0xb2e4('0x73')}]})['then'](handleEntityNotFound(_0x47e812,null))[_0xb2e4('0x2f')](function(_0x32f5c6){if(_0x32f5c6){_0x1e54cf=_0x32f5c6;return db[_0xb2e4('0x67')][_0xb2e4('0x39')];}})[_0xb2e4('0x2f')](function(_0x5ce2ac){if(_0x5ce2ac){var _0x4cae9b={};var _0x49cc94={};_0x49cc94[_0xb2e4('0x3c')]=_['concat'](_[_0xb2e4('0x52')](_0x5ce2ac),_[_0xb2e4('0x37')](_0x1e54cf[_0xb2e4('0x73')],function(_0x42f2ea){return util[_0xb2e4('0x75')](_0xb2e4('0x76'),_0x42f2ea['id']);}));_0x49cc94[_0xb2e4('0x3e')]=_[_0xb2e4('0x52')](_0x253d73[_0xb2e4('0x3e')]);_0x49cc94[_0xb2e4('0x3f')]=_['intersection'](_0x49cc94[_0xb2e4('0x3c')],_0x49cc94[_0xb2e4('0x3e')]);_0x4cae9b[_0xb2e4('0x42')]=_[_0xb2e4('0x40')](_0x49cc94[_0xb2e4('0x3c')],qs[_0xb2e4('0x41')](_0x253d73[_0xb2e4('0x3e')][_0xb2e4('0x41')]));_0x4cae9b[_0xb2e4('0x42')]=_0x4cae9b['attributes'][_0xb2e4('0x43')]?_0x4cae9b[_0xb2e4('0x42')]:_0x49cc94[_0xb2e4('0x3c')];if(!_0x253d73[_0xb2e4('0x3e')]['hasOwnProperty'](_0xb2e4('0x63'))){_0x4cae9b['limit']=qs[_0xb2e4('0x28')](_0x253d73[_0xb2e4('0x3e')][_0xb2e4('0x28')]);_0x4cae9b[_0xb2e4('0x25')]=qs[_0xb2e4('0x25')](_0x253d73[_0xb2e4('0x3e')][_0xb2e4('0x25')]);}_0x4cae9b[_0xb2e4('0x44')]=qs[_0xb2e4('0x45')](_0x253d73[_0xb2e4('0x3e')][_0xb2e4('0x45')]);_0x4cae9b['where']=qs[_0xb2e4('0x3f')](_['pick'](_0x253d73[_0xb2e4('0x3e')],_0x49cc94[_0xb2e4('0x3f')]));_0x4cae9b['raw']=!![];if(_0x253d73[_0xb2e4('0x3e')][_0xb2e4('0x48')]){_0x4cae9b[_0xb2e4('0x46')]=_[_0xb2e4('0x4a')](_0x4cae9b[_0xb2e4('0x46')],{'$or':_[_0xb2e4('0x37')](_0x4cae9b[_0xb2e4('0x42')],function(_0x4325b9){var _0x2c2238={};_0x2c2238[_0x4325b9]={'$like':'%'+_0x253d73[_0xb2e4('0x3e')][_0xb2e4('0x48')]+'%'};return _0x2c2238;})});}_0x4cae9b=_[_0xb2e4('0x4a')]({},_0x4cae9b,_0x253d73[_0xb2e4('0x4b')]);return _0x1e54cf[_0xb2e4('0x71')](_0x4cae9b);}})['then'](function(_0x2ad8f6){if(!_[_0xb2e4('0x78')](_0x2ad8f6)){var _0x26c8fa=toCsv(_0x2ad8f6);var _0x34e77a=Date['now']();fs[_0xb2e4('0x79')](util['format'](_0xb2e4('0x7a'),_0x1e54cf['id'],_0x34e77a),_0x26c8fa);_0x47e812[_0xb2e4('0x7b')](_0xb2e4('0x7c'),'attachment;\x20filename='+util[_0xb2e4('0x75')](_0xb2e4('0x7d'),_0x1e54cf['id'],_0x34e77a));_0x47e812[_0xb2e4('0x7b')](_0xb2e4('0x7e'),_0xb2e4('0x7f'));return _0x47e812[_0xb2e4('0x80')](util[_0xb2e4('0x75')](_0xb2e4('0x7a'),_0x1e54cf['id'],_0x34e77a));}else{return _0x47e812[_0xb2e4('0x33')](0xcc);}})['catch'](handleError(_0x47e812,null));};exports[_0xb2e4('0x81')]=function(_0x1cb4df,_0x5c56ad,_0x1c73f3){var _0x44536d;delete _0x1cb4df[_0xb2e4('0x5b')]['id'];return db['CmList']['findOne']({'where':{'id':_0x1cb4df[_0xb2e4('0x51')]['id']}})['then'](handleEntityNotFound(_0x5c56ad,null))[_0xb2e4('0x2f')](function(_0x22487a){if(_0x22487a){return db[_0xb2e4('0x82')][_0xb2e4('0x83')](function(_0x5c3f57){return db['CmCustomField'][_0xb2e4('0x54')](_0x1cb4df[_0xb2e4('0x5b')],{'transaction':_0x5c3f57})[_0xb2e4('0x2f')](function(_0x1aac46){_0x44536d=_0x1aac46;return _0x22487a[_0xb2e4('0x84')](_0x1aac46,{'transaction':_0x5c3f57});})[_0xb2e4('0x2f')](function(){var _0x349998={'type':db['Sequelize'][_0xb2e4('0x85')],'transaction':_0x5c3f57};switch(_0x1cb4df['body']['type']){case _0xb2e4('0x86'):_0x349998[_0xb2e4('0x3b')]=db[_0xb2e4('0x87')]['TEXT'];break;case _0xb2e4('0x88'):_0x349998[_0xb2e4('0x3b')]=db[_0xb2e4('0x87')][_0xb2e4('0x89')];break;case'switch':_0x349998[_0xb2e4('0x3b')]=db[_0xb2e4('0x87')][_0xb2e4('0x8a')];_0x349998[_0xb2e4('0x8b')]=![];break;default:}return db[_0xb2e4('0x82')][_0xb2e4('0x8c')][_0xb2e4('0x8d')](_0xb2e4('0x8e'),util[_0xb2e4('0x75')](_0xb2e4('0x8f'),_0x44536d['id']),_0x349998);})[_0xb2e4('0x2f')](function(){return _0x44536d;});});}})['then'](respondWithResult(_0x5c56ad,null))[_0xb2e4('0x50')](handleError(_0x5c56ad,null));};exports[_0xb2e4('0x90')]=function(_0x524e7d,_0x38704f,_0x1c506e){var _0x2338ba={};var _0x56b5db={};var _0x42fc9b;var _0x3e6143;return db[_0xb2e4('0x38')][_0xb2e4('0x61')]({'where':{'id':_0x524e7d['params']['id']}})[_0xb2e4('0x2f')](handleEntityNotFound(_0x38704f,null))[_0xb2e4('0x2f')](function(_0x992173){if(_0x992173){_0x42fc9b=_0x992173;_0x56b5db[_0xb2e4('0x3c')]=_[_0xb2e4('0x52')](db[_0xb2e4('0x72')][_0xb2e4('0x39')]);_0x56b5db['query']=_[_0xb2e4('0x52')](_0x524e7d[_0xb2e4('0x3e')]);_0x56b5db[_0xb2e4('0x3f')]=_[_0xb2e4('0x40')](_0x56b5db[_0xb2e4('0x3c')],_0x56b5db[_0xb2e4('0x3e')]);_0x2338ba[_0xb2e4('0x42')]=_[_0xb2e4('0x40')](_0x56b5db['model'],qs[_0xb2e4('0x41')](_0x524e7d[_0xb2e4('0x3e')][_0xb2e4('0x41')]));_0x2338ba[_0xb2e4('0x42')]=_0x2338ba[_0xb2e4('0x42')][_0xb2e4('0x43')]?_0x2338ba[_0xb2e4('0x42')]:_0x56b5db[_0xb2e4('0x3c')];_0x2338ba['order']=qs[_0xb2e4('0x45')](_0x524e7d[_0xb2e4('0x3e')][_0xb2e4('0x45')]);_0x2338ba[_0xb2e4('0x46')]=qs[_0xb2e4('0x3f')](_[_0xb2e4('0x47')](_0x524e7d['query'],_0x56b5db[_0xb2e4('0x3f')]));_0x2338ba[_0xb2e4('0x46')]=_[_0xb2e4('0x4a')](_0x2338ba[_0xb2e4('0x46')],{'$or':[{'ListId':_0x992173['id']},{'ListId':null}]});if(_0x524e7d[_0xb2e4('0x3e')][_0xb2e4('0x48')]){_0x2338ba[_0xb2e4('0x46')]=_['merge'](_0x2338ba['where'],{'$or':_[_0xb2e4('0x37')](_0x2338ba[_0xb2e4('0x42')],function(_0x5c8296){var _0x548081={};_0x548081[_0x5c8296]={'$like':'%'+_0x524e7d[_0xb2e4('0x3e')][_0xb2e4('0x48')]+'%'};return _0x548081;})});}_0x2338ba=_[_0xb2e4('0x4a')]({},_0x2338ba,_0x524e7d[_0xb2e4('0x4b')]);return db[_0xb2e4('0x72')][_0xb2e4('0x91')](_0x2338ba);}})[_0xb2e4('0x2f')](respondWithResult(_0x38704f,null))[_0xb2e4('0x50')](handleError(_0x38704f,null));};exports[_0xb2e4('0x92')]=function(_0x38803a,_0x3d0d91,_0x5965b2){return db['CmList'][_0xb2e4('0x53')]({'where':{'id':_0x38803a[_0xb2e4('0x51')]['id']}})[_0xb2e4('0x2f')](handleEntityNotFound(_0x3d0d91,null))[_0xb2e4('0x2f')](function(_0x360cad){if(_0x360cad){return _0x360cad[_0xb2e4('0x92')](_0x38803a['body'][_0xb2e4('0x65')],_[_0xb2e4('0x6c')](_0x38803a[_0xb2e4('0x5b')],[_0xb2e4('0x65'),'id'])||{})[_0xb2e4('0x93')](function(_0x34945f){for(var _0x4d0b7b=0x0;_0x4d0b7b<_0x38803a['body'][_0xb2e4('0x65')]['length'];_0x4d0b7b+=0x1){socket[_0xb2e4('0x94')](_0xb2e4('0x95'),{'UserId':Number(_0x38803a[_0xb2e4('0x5b')][_0xb2e4('0x65')][_0x4d0b7b]),'CmListId':Number(_0x38803a['params']['id'])});}return _0x34945f;});}})[_0xb2e4('0x2f')](respondWithResult(_0x3d0d91,null))[_0xb2e4('0x50')](handleError(_0x3d0d91,null));};exports[_0xb2e4('0x96')]=function(_0x3167fb,_0x32a0c9,_0x201445){return db[_0xb2e4('0x38')]['find']({'where':{'id':_0x3167fb[_0xb2e4('0x51')]['id']}})['then'](handleEntityNotFound(_0x32a0c9,null))['then'](function(_0x4a55ca){if(_0x4a55ca){return _0x4a55ca['removeAgents'](_0x3167fb[_0xb2e4('0x3e')]['ids'])['then'](function(){if(_[_0xb2e4('0x69')](_0x3167fb[_0xb2e4('0x3e')][_0xb2e4('0x65')])){for(var _0x308f8d=0x0;_0x308f8d<_0x3167fb[_0xb2e4('0x3e')][_0xb2e4('0x65')][_0xb2e4('0x43')];_0x308f8d+=0x1){socket['emit'](_0xb2e4('0x97'),{'UserId':Number(_0x3167fb[_0xb2e4('0x3e')][_0xb2e4('0x65')][_0x308f8d]),'CmListId':Number(_0x3167fb[_0xb2e4('0x51')]['id'])});}}else{socket[_0xb2e4('0x94')](_0xb2e4('0x97'),{'UserId':Number(_0x3167fb[_0xb2e4('0x3e')]['ids']),'CmListId':Number(_0x3167fb['params']['id'])});}});}})[_0xb2e4('0x2f')](respondWithStatusCode(_0x32a0c9,null))[_0xb2e4('0x50')](handleError(_0x32a0c9,null));};exports['getAgents']=function(_0x2d3a12,_0x9fbb14,_0x183bec){var _0x448a6c={};var _0x5d0698={};var _0x58ec4c;var _0x2e1aa8;return db['CmList'][_0xb2e4('0x61')]({'where':{'id':_0x2d3a12[_0xb2e4('0x51')]['id']}})[_0xb2e4('0x2f')](handleEntityNotFound(_0x9fbb14,null))[_0xb2e4('0x2f')](function(_0x4f39fb){if(_0x4f39fb){_0x58ec4c=_0x4f39fb;_0x5d0698['model']=_[_0xb2e4('0x52')](db[_0xb2e4('0x98')]['rawAttributes']);_0x5d0698[_0xb2e4('0x3e')]=_[_0xb2e4('0x52')](_0x2d3a12['query']);_0x5d0698[_0xb2e4('0x3f')]=_[_0xb2e4('0x40')](_0x5d0698[_0xb2e4('0x3c')],_0x5d0698[_0xb2e4('0x3e')]);_0x448a6c[_0xb2e4('0x42')]=_[_0xb2e4('0x40')](_0x5d0698[_0xb2e4('0x3c')],qs['fields'](_0x2d3a12['query'][_0xb2e4('0x41')]));_0x448a6c[_0xb2e4('0x42')]=_0x448a6c[_0xb2e4('0x42')][_0xb2e4('0x43')]?_0x448a6c[_0xb2e4('0x42')]:_0x5d0698['model'];_0x448a6c[_0xb2e4('0x44')]=qs['sort'](_0x2d3a12[_0xb2e4('0x3e')]['sort']);_0x448a6c['where']=qs[_0xb2e4('0x3f')](_[_0xb2e4('0x47')](_0x2d3a12[_0xb2e4('0x3e')],_0x5d0698[_0xb2e4('0x3f')]));if(_0x2d3a12[_0xb2e4('0x3e')][_0xb2e4('0x48')]){_0x448a6c[_0xb2e4('0x46')]=_[_0xb2e4('0x4a')](_0x448a6c['where'],{'$or':_[_0xb2e4('0x37')](_0x448a6c[_0xb2e4('0x42')],function(_0x361b34){var _0x19a158={};_0x19a158[_0x361b34]={'$like':'%'+_0x2d3a12[_0xb2e4('0x3e')]['filter']+'%'};return _0x19a158;})});}_0x448a6c=_[_0xb2e4('0x4a')]({},_0x448a6c,_0x2d3a12[_0xb2e4('0x4b')]);return _0x58ec4c[_0xb2e4('0x99')](_0x448a6c);}})[_0xb2e4('0x2f')](function(_0x395a9a){if(_0x395a9a){_0x2e1aa8=_0x395a9a['length'];if(!_0x2d3a12['query'][_0xb2e4('0x62')]('nolimit')){_0x448a6c[_0xb2e4('0x28')]=qs['limit'](_0x2d3a12[_0xb2e4('0x3e')][_0xb2e4('0x28')]);_0x448a6c['offset']=qs['offset'](_0x2d3a12['query'][_0xb2e4('0x25')]);}return _0x58ec4c[_0xb2e4('0x99')](_0x448a6c);}})[_0xb2e4('0x2f')](function(_0x3f5d7c){if(_0x3f5d7c){return _0x3f5d7c?{'count':_0x2e1aa8,'rows':_0x3f5d7c}:null;}})[_0xb2e4('0x2f')](respondWithResult(_0x9fbb14,null))[_0xb2e4('0x50')](handleError(_0x9fbb14,null));};
\ No newline at end of file
index 91f72eb..5512a26 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0x55ca,0x126));var _0xa55c=function(_0x2b737c,_0x274adf){_0x2b737c=_0x2b737c-0x0;var _0x466ed5=_0x55ca[_0x2b737c];return _0x466ed5;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents;
\ No newline at end of file
+var _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3e74,0x175));var _0x43e7=function(_0x169cc6,_0x192e5b){_0x169cc6=_0x169cc6-0x0;var _0x2300f8=_0x3e74[_0x169cc6];return _0x2300f8;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents;
\ No newline at end of file
index 4653669..be0c625 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee5b=['request-promise','path','rimraf','exports','define','lodash','../../config/logger','api','bluebird'];(function(_0x4c2a65,_0x274bc1){var _0x12e4e9=function(_0x5bcefb){while(--_0x5bcefb){_0x4c2a65['push'](_0x4c2a65['shift']());}};_0x12e4e9(++_0x274bc1);}(_0xee5b,0x1f4));var _0xbee5=function(_0x1e6d1b,_0x15fee9){_0x1e6d1b=_0x1e6d1b-0x0;var _0x5c0b80=_0xee5b[_0x1e6d1b];return _0x5c0b80;};'use strict';var _=require(_0xbee5('0x0'));var util=require('util');var logger=require(_0xbee5('0x1'))(_0xbee5('0x2'));var moment=require('moment');var BPromise=require(_0xbee5('0x3'));var rp=require(_0xbee5('0x4'));var fs=require('fs');var path=require(_0xbee5('0x5'));var rimraf=require(_0xbee5('0x6'));var config=require('../../config/environment');var attributes=require('./cmList.attributes');module[_0xbee5('0x7')]=function(_0x2c0bde,_0xab6e4d){return _0x2c0bde[_0xbee5('0x8')]('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0a9a=['bluebird','request-promise','rimraf','../../config/environment','exports','define','cm_lists','util','api','moment'];(function(_0x59a576,_0x2c8616){var _0xb54f81=function(_0x5353d6){while(--_0x5353d6){_0x59a576['push'](_0x59a576['shift']());}};_0xb54f81(++_0x2c8616);}(_0x0a9a,0x183));var _0xa0a9=function(_0xaa3a5b,_0x3715e6){_0xaa3a5b=_0xaa3a5b-0x0;var _0x5cf696=_0x0a9a[_0xaa3a5b];return _0x5cf696;};'use strict';var _=require('lodash');var util=require(_0xa0a9('0x0'));var logger=require('../../config/logger')(_0xa0a9('0x1'));var moment=require(_0xa0a9('0x2'));var BPromise=require(_0xa0a9('0x3'));var rp=require(_0xa0a9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa0a9('0x5'));var config=require(_0xa0a9('0x6'));var attributes=require('./cmList.attributes');module[_0xa0a9('0x7')]=function(_0xc65bbb,_0x1aa717){return _0xc65bbb[_0xa0a9('0x8')]('CmList',attributes,{'tableName':_0xa0a9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e0128f5..52c1ce9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfdec=['defaults','localhost','./cmList.socket','register','request','request\x20sent','debug','stringify','error','code','CmList,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x1d0b84,_0x4a6a70){var _0x6726f0=function(_0x3decbb){while(--_0x3decbb){_0x1d0b84['push'](_0x1d0b84['shift']());}};_0x6726f0(++_0x4a6a70);}(_0xfdec,0x1d9));var _0xcfde=function(_0x51426b,_0x56069c){_0x51426b=_0x51426b-0x0;var _0xb53cc3=_0xfdec[_0x51426b];return _0xb53cc3;};'use strict';var _=require(_0xcfde('0x0'));var util=require(_0xcfde('0x1'));var moment=require(_0xcfde('0x2'));var BPromise=require(_0xcfde('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcfde('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcfde('0x5'));var logger=require(_0xcfde('0x6'))(_0xcfde('0x7'));var config=require(_0xcfde('0x8'));var jayson=require(_0xcfde('0x9'));var client=jayson[_0xcfde('0xa')][_0xcfde('0xb')]({'port':0x232a});config[_0xcfde('0xc')]=_[_0xcfde('0xd')](config[_0xcfde('0xc')],{'host':_0xcfde('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcfde('0xc')]));require(_0xcfde('0xf'))[_0xcfde('0x10')](socket);function respondWithRpcPromise(_0x4ca80f,_0x2e628c,_0x85060e){return new BPromise(function(_0x5b51b6,_0x5e5a61){return client[_0xcfde('0x11')](_0x4ca80f,_0x85060e)['then'](function(_0x17eeef){logger['info']('CmList,\x20%s,\x20%s',_0x2e628c,_0xcfde('0x12'));logger[_0xcfde('0x13')]('CmList,\x20%s,\x20%s,\x20%s',_0x2e628c,'request\x20sent',JSON[_0xcfde('0x14')](_0x17eeef));if(_0x17eeef[_0xcfde('0x15')]){if(_0x17eeef[_0xcfde('0x15')][_0xcfde('0x16')]===0x1f4){logger['error'](_0xcfde('0x17'),_0x2e628c,_0x17eeef[_0xcfde('0x15')][_0xcfde('0x18')]);return _0x5e5a61(_0x17eeef[_0xcfde('0x15')][_0xcfde('0x18')]);}logger[_0xcfde('0x15')]('CmList,\x20%s,\x20%s',_0x2e628c,_0x17eeef[_0xcfde('0x15')]['message']);return _0x5b51b6(_0x17eeef[_0xcfde('0x15')][_0xcfde('0x18')]);}else{logger[_0xcfde('0x19')]('CmList,\x20%s,\x20%s',_0x2e628c,'request\x20sent');_0x5b51b6(_0x17eeef[_0xcfde('0x1a')][_0xcfde('0x18')]);}})['catch'](function(_0x1f333f){logger[_0xcfde('0x15')](_0xcfde('0x17'),_0x2e628c,_0x1f333f);_0x5e5a61(_0x1f333f);});});}
\ No newline at end of file
+var _0x3d86=['message','result','moment','../../mysqldb','../../config/logger','rpc','jayson/promise','client','redis','localhost','./cmList.socket','register','request','then','info','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x22a14f,_0x24b720){var _0x4eaee2=function(_0x56f4e5){while(--_0x56f4e5){_0x22a14f['push'](_0x22a14f['shift']());}};_0x4eaee2(++_0x24b720);}(_0x3d86,0x95));var _0x63d8=function(_0x3401ac,_0x3f25c7){_0x3401ac=_0x3401ac-0x0;var _0x449642=_0x3d86[_0x3401ac];return _0x449642;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x63d8('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x63d8('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x63d8('0x2'))(_0x63d8('0x3'));var config=require('../../config/environment');var jayson=require(_0x63d8('0x4'));var client=jayson[_0x63d8('0x5')]['http']({'port':0x232a});config[_0x63d8('0x6')]=_['defaults'](config[_0x63d8('0x6')],{'host':_0x63d8('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x63d8('0x8'))[_0x63d8('0x9')](socket);function respondWithRpcPromise(_0x1ef451,_0x570a31,_0x5e8292){return new BPromise(function(_0x5b82aa,_0xa557b7){return client[_0x63d8('0xa')](_0x1ef451,_0x5e8292)[_0x63d8('0xb')](function(_0x5233cd){logger[_0x63d8('0xc')](_0x63d8('0xd'),_0x570a31,'request\x20sent');logger[_0x63d8('0xe')](_0x63d8('0xf'),_0x570a31,_0x63d8('0x10'),JSON[_0x63d8('0x11')](_0x5233cd));if(_0x5233cd['error']){if(_0x5233cd[_0x63d8('0x12')]['code']===0x1f4){logger['error'](_0x63d8('0xd'),_0x570a31,_0x5233cd['error']['message']);return _0xa557b7(_0x5233cd[_0x63d8('0x12')][_0x63d8('0x13')]);}logger[_0x63d8('0x12')](_0x63d8('0xd'),_0x570a31,_0x5233cd[_0x63d8('0x12')]['message']);return _0x5b82aa(_0x5233cd[_0x63d8('0x12')][_0x63d8('0x13')]);}else{logger[_0x63d8('0xc')](_0x63d8('0xd'),_0x570a31,_0x63d8('0x10'));_0x5b82aa(_0x5233cd[_0x63d8('0x14')][_0x63d8('0x13')]);}})['catch'](function(_0x383de8){logger['error'](_0x63d8('0xd'),_0x570a31,_0x383de8);_0xa557b7(_0x383de8);});});}
\ No newline at end of file
index 7a7883b..da0941c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe787=['update','emit','removeListener','register','length','./cmList.events','save','remove'];(function(_0x31b7ff,_0x4d3503){var _0x33ba84=function(_0x1e90b7){while(--_0x1e90b7){_0x31b7ff['push'](_0x31b7ff['shift']());}};_0x33ba84(++_0x4d3503);}(_0xe787,0x14d));var _0x7e78=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0xe787[_0x313c96];return _0x522f53;};'use strict';var CmListEvents=require(_0x7e78('0x0'));var events=[_0x7e78('0x1'),_0x7e78('0x2'),_0x7e78('0x3')];function createListener(_0x231fb8,_0x483cb1){return function(_0x539969){_0x483cb1[_0x7e78('0x4')](_0x231fb8,_0x539969);};}function removeListener(_0x13b85d,_0x1b3e68){return function(){CmListEvents[_0x7e78('0x5')](_0x13b85d,_0x1b3e68);};}exports[_0x7e78('0x6')]=function(_0x9f6c9c){for(var _0x2b0934=0x0,_0x4721e0=events[_0x7e78('0x7')];_0x2b0934<_0x4721e0;_0x2b0934++){var _0x119b3e=events[_0x2b0934];var _0xd8b08b=createListener('cmList:'+_0x119b3e,_0x9f6c9c);CmListEvents['on'](_0x119b3e,_0xd8b08b);}};
\ No newline at end of file
+var _0x36ee=['save','emit','register','length','cmList:','./cmList.events'];(function(_0x375126,_0x514a8e){var _0x1f76bb=function(_0x22f2d0){while(--_0x22f2d0){_0x375126['push'](_0x375126['shift']());}};_0x1f76bb(++_0x514a8e);}(_0x36ee,0xbf));var _0xe36e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x36ee[_0x3dd15e];return _0x231fd0;};'use strict';var CmListEvents=require(_0xe36e('0x0'));var events=[_0xe36e('0x1'),'remove','update'];function createListener(_0x2a3e01,_0x52daad){return function(_0x428a41){_0x52daad[_0xe36e('0x2')](_0x2a3e01,_0x428a41);};}function removeListener(_0x48f786,_0x26aa69){return function(){CmListEvents['removeListener'](_0x48f786,_0x26aa69);};}exports[_0xe36e('0x3')]=function(_0xd761a7){for(var _0x93f1bf=0x0,_0x594996=events[_0xe36e('0x4')];_0x93f1bf<_0x594996;_0x93f1bf++){var _0x23527a=events[_0x93f1bf];var _0x4fe87b=createListener(_0xe36e('0x5')+_0x23527a,_0xd761a7);CmListEvents['on'](_0x23527a,_0x4fe87b);}};
\ No newline at end of file
index 486d7ed..225dad3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8954=['multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','/:id/dispositions','addDisposition','post','addContacts','addAgents','delete','destroy','removeDispositions','removeAgents','exports'];(function(_0x146837,_0x2aa6a2){var _0x3d7e60=function(_0x1301ac){while(--_0x1301ac){_0x146837['push'](_0x146837['shift']());}};_0x3d7e60(++_0x2aa6a2);}(_0x8954,0x136));var _0x4895=function(_0x1e4ee6,_0x1f24d2){_0x1e4ee6=_0x1e4ee6-0x0;var _0x33ced4=_0x8954[_0x1e4ee6];return _0x33ced4;};'use strict';var multer=require(_0x4895('0x0'));var util=require('util');var path=require(_0x4895('0x1'));var timeout=require(_0x4895('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4895('0x3'));var interaction=require(_0x4895('0x4'));var config=require(_0x4895('0x5'));var controller=require(_0x4895('0x6'));router[_0x4895('0x7')]('/',auth['isAuthenticated'](),controller[_0x4895('0x8')]);router[_0x4895('0x7')](_0x4895('0x9'),auth[_0x4895('0xa')](),controller[_0x4895('0xb')]);router['get'](_0x4895('0xc'),auth[_0x4895('0xa')](),controller[_0x4895('0xd')]);router[_0x4895('0x7')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0x4895('0x7')](_0x4895('0xe'),auth[_0x4895('0xa')](),controller[_0x4895('0xf')]);router[_0x4895('0x7')](_0x4895('0x10'),auth[_0x4895('0xa')](),controller[_0x4895('0x11')]);router[_0x4895('0x7')](_0x4895('0x12'),auth[_0x4895('0xa')](),controller[_0x4895('0x13')]);router[_0x4895('0x7')](_0x4895('0x14'),auth[_0x4895('0xa')](),controller['getAgents']);router['post']('/',auth[_0x4895('0xa')](),controller['create']);router['post'](_0x4895('0x15'),auth[_0x4895('0xa')](),controller[_0x4895('0x16')]);router[_0x4895('0x17')](_0x4895('0xe'),auth[_0x4895('0xa')](),controller[_0x4895('0x18')]);router[_0x4895('0x17')](_0x4895('0x12'),auth[_0x4895('0xa')](),controller['addCustomField']);router[_0x4895('0x17')](_0x4895('0x14'),auth[_0x4895('0xa')](),controller[_0x4895('0x19')]);router['put'](_0x4895('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x4895('0x1a')](_0x4895('0xc'),auth[_0x4895('0xa')](),controller[_0x4895('0x1b')]);router[_0x4895('0x1a')](_0x4895('0x15'),auth['isAuthenticated'](),controller[_0x4895('0x1c')]);router[_0x4895('0x1a')]('/:id/users',auth[_0x4895('0xa')](),controller[_0x4895('0x1d')]);module[_0x4895('0x1e')]=router;
\ No newline at end of file
+var _0xb2f2=['../../config/environment','./cmList.controller','get','isAuthenticated','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','post','create','addDisposition','addContacts','/:id/fields','addCustomField','/:id/users','addAgents','put','delete','destroy','removeDispositions','exports','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x57589d,_0x17d075){var _0x1469fd=function(_0x461687){while(--_0x461687){_0x57589d['push'](_0x57589d['shift']());}};_0x1469fd(++_0x17d075);}(_0xb2f2,0xc0));var _0x2b2f=function(_0x263163,_0x387857){_0x263163=_0x263163-0x0;var _0x37871b=_0xb2f2[_0x263163];return _0x37871b;};'use strict';var multer=require('multer');var util=require(_0x2b2f('0x0'));var path=require(_0x2b2f('0x1'));var timeout=require(_0x2b2f('0x2'));var express=require(_0x2b2f('0x3'));var router=express[_0x2b2f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2b2f('0x5'));var config=require(_0x2b2f('0x6'));var controller=require(_0x2b2f('0x7'));router[_0x2b2f('0x8')]('/',auth[_0x2b2f('0x9')](),controller['index']);router['get'](_0x2b2f('0xa'),auth[_0x2b2f('0x9')](),controller[_0x2b2f('0xb')]);router[_0x2b2f('0x8')](_0x2b2f('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x2b2f('0x8')](_0x2b2f('0xd'),auth['isAuthenticated'](),controller[_0x2b2f('0xe')]);router[_0x2b2f('0x8')](_0x2b2f('0xf'),auth['isAuthenticated'](),controller[_0x2b2f('0x10')]);router[_0x2b2f('0x8')](_0x2b2f('0x11'),auth['isAuthenticated'](),controller[_0x2b2f('0x12')]);router['get']('/:id/fields',auth[_0x2b2f('0x9')](),controller[_0x2b2f('0x13')]);router[_0x2b2f('0x8')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x2b2f('0x14')]('/',auth[_0x2b2f('0x9')](),controller[_0x2b2f('0x15')]);router[_0x2b2f('0x14')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x2b2f('0x16')]);router[_0x2b2f('0x14')](_0x2b2f('0xf'),auth[_0x2b2f('0x9')](),controller[_0x2b2f('0x17')]);router[_0x2b2f('0x14')](_0x2b2f('0x18'),auth[_0x2b2f('0x9')](),controller[_0x2b2f('0x19')]);router['post'](_0x2b2f('0x1a'),auth['isAuthenticated'](),controller[_0x2b2f('0x1b')]);router[_0x2b2f('0x1c')](_0x2b2f('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x2b2f('0x1d')](_0x2b2f('0xc'),auth['isAuthenticated'](),controller[_0x2b2f('0x1e')]);router[_0x2b2f('0x1d')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x2b2f('0x1f')]);router[_0x2b2f('0x1d')](_0x2b2f('0x1a'),auth[_0x2b2f('0x9')](),controller['removeAgents']);module[_0x2b2f('0x20')]=router;
\ No newline at end of file
index 1ef40b2..230b67e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x35f5=['getDataValue','STRING','sequelize','exports','VIRTUAL'];(function(_0x46ee96,_0x3c8c1f){var _0x37208e=function(_0x581805){while(--_0x581805){_0x46ee96['push'](_0x46ee96['shift']());}};_0x37208e(++_0x3c8c1f);}(_0x35f5,0x151));var _0x535f=function(_0x46111d,_0x5d286b){_0x46111d=_0x46111d-0x0;var _0xe82586=_0x35f5[_0x46111d];return _0xe82586;};'use strict';var Sequelize=require(_0x535f('0x0'));module[_0x535f('0x1')]={'name':{'type':Sequelize[_0x535f('0x2')],'get':function(_0xcae05e){return this[_0x535f('0x3')]('field');}},'field':{'type':Sequelize[_0x535f('0x4')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x535f('0x4')],'allowNull':![]}};
\ No newline at end of file
+var _0x63ac=['field','STRING','exports','VIRTUAL','getDataValue'];(function(_0xc43775,_0xca17e8){var _0x29fb59=function(_0x4bf94b){while(--_0x4bf94b){_0xc43775['push'](_0xc43775['shift']());}};_0x29fb59(++_0xca17e8);}(_0x63ac,0xd9));var _0xc63a=function(_0x26a169,_0x54f908){_0x26a169=_0x26a169-0x0;var _0x1f07a1=_0x63ac[_0x26a169];return _0x1f07a1;};'use strict';var Sequelize=require('sequelize');module[_0xc63a('0x0')]={'name':{'type':Sequelize[_0xc63a('0x1')],'get':function(_0x4e571e){return this[_0xc63a('0x2')](_0xc63a('0x3'));}},'field':{'type':Sequelize[_0xc63a('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xc63a('0x4')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index b270676..d168016 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0xe60359,_0x294a2f){var _0x355a74=function(_0x22fca7){while(--_0x22fca7){_0xe60359['push'](_0xe60359['shift']());}};_0x355a74(++_0x294a2f);}(_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){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));};
\ No newline at end of file
+var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x4f47e6,_0x8bb51c){var _0x3328b2=function(_0x3bf67c){while(--_0x3bf67c){_0x4f47e6['push'](_0x4f47e6['shift']());}};_0x3328b2(++_0x8bb51c);}(_0x7a54,0x106));var _0x47a5=function(_0x2a0d81,_0x18d089){_0x2a0d81=_0x2a0d81-0x0;var _0x7f4eb4=_0x7a54[_0x2a0d81];return _0x7f4eb4;};'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 cfab45f..e0412c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0cc=['./condition.attributes','exports','define','tools_conditions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x22cb49,_0x417f2c){var _0x3ccbfe=function(_0x1009b0){while(--_0x1009b0){_0x22cb49['push'](_0x22cb49['shift']());}};_0x3ccbfe(++_0x417f2c);}(_0xf0cc,0x1d8));var _0xcf0c=function(_0x310106,_0x341531){_0x310106=_0x310106-0x0;var _0x4df22d=_0xf0cc[_0x310106];return _0x4df22d;};'use strict';var _=require(_0xcf0c('0x0'));var util=require(_0xcf0c('0x1'));var logger=require(_0xcf0c('0x2'))(_0xcf0c('0x3'));var moment=require(_0xcf0c('0x4'));var BPromise=require(_0xcf0c('0x5'));var rp=require(_0xcf0c('0x6'));var fs=require('fs');var path=require(_0xcf0c('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcf0c('0x8'));module[_0xcf0c('0x9')]=function(_0x5c379f,_0x343e47){return _0x5c379f[_0xcf0c('0xa')]('Condition',attributes,{'tableName':_0xcf0c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3525=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','tools_conditions','lodash'];(function(_0x1203d6,_0x517382){var _0x4a92c1=function(_0xb9bb43){while(--_0xb9bb43){_0x1203d6['push'](_0x1203d6['shift']());}};_0x4a92c1(++_0x517382);}(_0x3525,0x113));var _0x5352=function(_0x386b28,_0x28561b){_0x386b28=_0x386b28-0x0;var _0x3507a5=_0x3525[_0x386b28];return _0x3507a5;};'use strict';var _=require(_0x5352('0x0'));var util=require(_0x5352('0x1'));var logger=require(_0x5352('0x2'))(_0x5352('0x3'));var moment=require(_0x5352('0x4'));var BPromise=require(_0x5352('0x5'));var rp=require(_0x5352('0x6'));var fs=require('fs');var path=require(_0x5352('0x7'));var rimraf=require(_0x5352('0x8'));var config=require(_0x5352('0x9'));var attributes=require('./condition.attributes');module[_0x5352('0xa')]=function(_0x1db56d,_0x340447){return _0x1db56d['define']('Condition',attributes,{'tableName':_0x5352('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8f356be..9c68b5f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbacb=['info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x466f4b,_0x2896f0){var _0x3d4c24=function(_0xcae225){while(--_0xcae225){_0x466f4b['push'](_0x466f4b['shift']());}};_0x3d4c24(++_0x2896f0);}(_0xbacb,0x13e));var _0xbbac=function(_0x546c65,_0xe39998){_0x546c65=_0x546c65-0x0;var _0x50221a=_0xbacb[_0x546c65];return _0x50221a;};'use strict';var _=require(_0xbbac('0x0'));var util=require(_0xbbac('0x1'));var moment=require(_0xbbac('0x2'));var BPromise=require(_0xbbac('0x3'));var rs=require(_0xbbac('0x4'));var fs=require('fs');var Redis=require(_0xbbac('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbbac('0x6'))(_0xbbac('0x7'));var config=require(_0xbbac('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbbac('0x9')][_0xbbac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x29a956,_0x1e0ba6,_0x14c015){return new BPromise(function(_0xc761ac,_0x58df80){return client[_0xbbac('0xb')](_0x29a956,_0x14c015)['then'](function(_0x2c9cdf){logger[_0xbbac('0xc')](_0xbbac('0xd'),_0x1e0ba6,_0xbbac('0xe'));logger[_0xbbac('0xf')](_0xbbac('0x10'),_0x1e0ba6,_0xbbac('0xe'),JSON['stringify'](_0x2c9cdf));if(_0x2c9cdf[_0xbbac('0x11')]){if(_0x2c9cdf[_0xbbac('0x11')][_0xbbac('0x12')]===0x1f4){logger[_0xbbac('0x11')](_0xbbac('0xd'),_0x1e0ba6,_0x2c9cdf[_0xbbac('0x11')]['message']);return _0x58df80(_0x2c9cdf['error'][_0xbbac('0x13')]);}logger[_0xbbac('0x11')]('Condition,\x20%s,\x20%s',_0x1e0ba6,_0x2c9cdf[_0xbbac('0x11')][_0xbbac('0x13')]);return _0xc761ac(_0x2c9cdf[_0xbbac('0x11')]['message']);}else{logger['info'](_0xbbac('0xd'),_0x1e0ba6,_0xbbac('0xe'));_0xc761ac(_0x2c9cdf[_0xbbac('0x14')][_0xbbac('0x13')]);}})[_0xbbac('0x15')](function(_0x3ad584){logger[_0xbbac('0x11')](_0xbbac('0xd'),_0x1e0ba6,_0x3ad584);_0x58df80(_0x3ad584);});});}
\ No newline at end of file
+var _0x1f67=['code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','Condition,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x22ebca,_0xb800fa){var _0x2b860a=function(_0x393add){while(--_0x393add){_0x22ebca['push'](_0x22ebca['shift']());}};_0x2b860a(++_0xb800fa);}(_0x1f67,0x7b));var _0x71f6=function(_0x392a99,_0x5cf66d){_0x392a99=_0x392a99-0x0;var _0x4d4250=_0x1f67[_0x392a99];return _0x4d4250;};'use strict';var _=require(_0x71f6('0x0'));var util=require('util');var moment=require(_0x71f6('0x1'));var BPromise=require(_0x71f6('0x2'));var rs=require(_0x71f6('0x3'));var fs=require('fs');var Redis=require(_0x71f6('0x4'));var db=require(_0x71f6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x71f6('0x6'));var config=require(_0x71f6('0x7'));var jayson=require(_0x71f6('0x8'));var client=jayson[_0x71f6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x138ea9,_0x59a3e8,_0x275c1b){return new BPromise(function(_0x3a7f1a,_0x4a2244){return client[_0x71f6('0xa')](_0x138ea9,_0x275c1b)[_0x71f6('0xb')](function(_0x5d4603){logger['info'](_0x71f6('0xc'),_0x59a3e8,_0x71f6('0xd'));logger[_0x71f6('0xe')]('Condition,\x20%s,\x20%s,\x20%s',_0x59a3e8,_0x71f6('0xd'),JSON[_0x71f6('0xf')](_0x5d4603));if(_0x5d4603[_0x71f6('0x10')]){if(_0x5d4603[_0x71f6('0x10')][_0x71f6('0x11')]===0x1f4){logger[_0x71f6('0x10')](_0x71f6('0xc'),_0x59a3e8,_0x5d4603[_0x71f6('0x10')][_0x71f6('0x12')]);return _0x4a2244(_0x5d4603[_0x71f6('0x10')][_0x71f6('0x12')]);}logger['error'](_0x71f6('0xc'),_0x59a3e8,_0x5d4603[_0x71f6('0x10')]['message']);return _0x3a7f1a(_0x5d4603[_0x71f6('0x10')]['message']);}else{logger['info']('Condition,\x20%s,\x20%s',_0x59a3e8,_0x71f6('0xd'));_0x3a7f1a(_0x5d4603[_0x71f6('0x13')]['message']);}})['catch'](function(_0x48d0c9){logger[_0x71f6('0x10')](_0x71f6('0xc'),_0x59a3e8,_0x48d0c9);_0x4a2244(_0x48d0c9);});});}
\ No newline at end of file
index b8fc814..73c651f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60ad=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0x3aca0c,_0xc2fcd9){var _0x5ef72a=function(_0x43f9b3){while(--_0x43f9b3){_0x3aca0c['push'](_0x3aca0c['shift']());}};_0x5ef72a(++_0xc2fcd9);}(_0x60ad,0xb6));var _0xd60a=function(_0x4702e3,_0xec65){_0x4702e3=_0x4702e3-0x0;var _0x3c63a9=_0x60ad[_0x4702e3];return _0x3c63a9;};'use strict';var multer=require(_0xd60a('0x0'));var util=require(_0xd60a('0x1'));var path=require(_0xd60a('0x2'));var timeout=require('connect-timeout');var express=require(_0xd60a('0x3'));var router=express[_0xd60a('0x4')]();var fs_extra=require(_0xd60a('0x5'));var auth=require(_0xd60a('0x6'));var interaction=require(_0xd60a('0x7'));var config=require(_0xd60a('0x8'));var controller=require(_0xd60a('0x9'));router[_0xd60a('0xa')](_0xd60a('0xb'),auth[_0xd60a('0xc')](),controller[_0xd60a('0xd')]);router[_0xd60a('0xe')](_0xd60a('0xb'),auth['isAuthenticated'](),controller[_0xd60a('0xf')]);module[_0xd60a('0x10')]=router;
\ No newline at end of file
+var _0x1a28=['/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./condition.controller','isAuthenticated','update','delete'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1a28,0x17a));var _0x81a2=function(_0x4314d7,_0x355218){_0x4314d7=_0x4314d7-0x0;var _0x5c599b=_0x1a28[_0x4314d7];return _0x5c599b;};'use strict';var multer=require(_0x81a2('0x0'));var util=require(_0x81a2('0x1'));var path=require(_0x81a2('0x2'));var timeout=require(_0x81a2('0x3'));var express=require(_0x81a2('0x4'));var router=express['Router']();var fs_extra=require(_0x81a2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x81a2('0x6'));var config=require(_0x81a2('0x7'));var controller=require(_0x81a2('0x8'));router['put']('/:id',auth[_0x81a2('0x9')](),controller[_0x81a2('0xa')]);router[_0x81a2('0xb')](_0x81a2('0xc'),auth[_0x81a2('0x9')](),controller[_0x81a2('0xd')]);module[_0x81a2('0xe')]=router;
\ No newline at end of file
index 5c52d69..b763096 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['exports','STRING'];(function(_0x33f099,_0x252078){var _0x39c72b=function(_0x5bb65d){while(--_0x5bb65d){_0x33f099['push'](_0x33f099['shift']());}};_0x39c72b(++_0x252078);}(_0x757a,0xde));var _0xa757=function(_0x1a9b3f,_0x3817da){_0x1a9b3f=_0x1a9b3f-0x0;var _0x20a3db=_0x757a[_0x1a9b3f];return _0x20a3db;};'use strict';var Sequelize=require('sequelize');module[_0xa757('0x0')]={'name':{'type':Sequelize[_0xa757('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0713=['STRING','name'];(function(_0x164f31,_0x369e5a){var _0x59914c=function(_0x304aaa){while(--_0x304aaa){_0x164f31['push'](_0x164f31['shift']());}};_0x59914c(++_0x369e5a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}};
\ No newline at end of file
index 8d6d653..268efdd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc034=['nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','userProfileId','iframe','attrUrl','attrs','https://','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','send','index','map','Dashboard','rawAttributes','fieldName','type','key','name','query','keys','filters','intersection','model','attributes','length','hasOwnProperty'];(function(_0x28caa3,_0x4e7713){var _0x41b1c3=function(_0x52d1f3){while(--_0x52d1f3){_0x28caa3['push'](_0x28caa3['shift']());}};_0x41b1c3(++_0x4e7713);}(_0xc034,0xbc));var _0x4c03=function(_0x51232a,_0x3922d9){_0x51232a=_0x51232a-0x0;var _0x7046ba=_0xc034[_0x51232a];return _0x7046ba;};'use strict';var emlformat=require(_0x4c03('0x0'));var rimraf=require(_0x4c03('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4c03('0x2'));var rp=require(_0x4c03('0x3'));var moment=require(_0x4c03('0x4'));var BPromise=require(_0x4c03('0x5'));var Mustache=require('mustache');var util=require(_0x4c03('0x6'));var path=require(_0x4c03('0x7'));var sox=require(_0x4c03('0x8'));var csv=require(_0x4c03('0x9'));var ejs=require(_0x4c03('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4c03('0xb'));var squel=require(_0x4c03('0xc'));var crypto=require(_0x4c03('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4c03('0xe'));var toCsv=require(_0x4c03('0x9'));var querystring=require(_0x4c03('0xf'));var Papa=require('papaparse');var Redis=require(_0x4c03('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4c03('0x11'));var as=require(_0x4c03('0x12'));var hardwareService=require(_0x4c03('0x13'));var logger=require(_0x4c03('0x14'))('api');var utils=require(_0x4c03('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x4c03('0x16'));var db=require(_0x4c03('0x17'))['db'];config['redis']=_[_0x4c03('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4c03('0x19'))(new Redis(config[_0x4c03('0x1a')]));require(_0x4c03('0x1b'))[_0x4c03('0x1c')](socket);function respondWithStatusCode(_0x4b31cf,_0x7f4e17){_0x7f4e17=_0x7f4e17||0xcc;return function(_0xe75320){if(_0xe75320){return _0x4b31cf[_0x4c03('0x1d')](_0x7f4e17);}return _0x4b31cf[_0x4c03('0x1e')](_0x7f4e17)[_0x4c03('0x1f')]();};}function respondWithResult(_0x37494b,_0xb5aa37){_0xb5aa37=_0xb5aa37||0xc8;return function(_0x10fc82){if(_0x10fc82){return _0x37494b[_0x4c03('0x1e')](_0xb5aa37)[_0x4c03('0x20')](_0x10fc82);}};}function respondWithFilteredResult(_0x3fc4fc,_0x521e6a){return function(_0x300da4){if(_0x300da4){var _0x30fc45=typeof _0x521e6a[_0x4c03('0x21')]===_0x4c03('0x22')&&typeof _0x521e6a[_0x4c03('0x23')]===_0x4c03('0x22');var _0xaddb78=_0x300da4[_0x4c03('0x24')];var _0x121ba6=_0x30fc45?0x0:_0x521e6a[_0x4c03('0x21')];var _0x5da2f2=_0x30fc45?_0x300da4[_0x4c03('0x24')]:_0x521e6a[_0x4c03('0x21')]+_0x521e6a[_0x4c03('0x23')];var _0x36994c;if(_0x5da2f2>=_0xaddb78){_0x5da2f2=_0xaddb78;_0x36994c=0xc8;}else{_0x36994c=0xce;}_0x3fc4fc[_0x4c03('0x1e')](_0x36994c);return _0x3fc4fc[_0x4c03('0x25')](_0x4c03('0x26'),_0x121ba6+'-'+_0x5da2f2+'/'+_0xaddb78)['json'](_0x300da4);}return null;};}function patchUpdates(_0xc966e5){return function(_0x2ab0fe){try{jsonpatch[_0x4c03('0x27')](_0x2ab0fe,_0xc966e5,!![]);}catch(_0x2d3d1c){return BPromise[_0x4c03('0x28')](_0x2d3d1c);}return _0x2ab0fe[_0x4c03('0x29')]();};}function saveUpdates(_0x5d19fa,_0x581f0a){return function(_0x2ecd07){if(_0x2ecd07){return _0x2ecd07[_0x4c03('0x2a')](_0x5d19fa)[_0x4c03('0x2b')](function(_0x1b76f8){return _0x1b76f8;});}return null;};}function removeEntity(_0x2f6d86,_0x49a8f3){return function(_0x7ae861){if(_0x7ae861){return _0x7ae861[_0x4c03('0x2c')]()['then'](function(){var _0x6bbbfa=_0x7ae861[_0x4c03('0x2d')]({'plain':!![]});var _0x8df195='CustomDashboards';return db[_0x4c03('0x2e')]['destroy']({'where':{'type':_0x8df195,'resourceId':_0x6bbbfa['id']}})[_0x4c03('0x2b')](function(){return _0x7ae861;});})[_0x4c03('0x2b')](function(){_0x2f6d86[_0x4c03('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bf53f,_0x511b1f){return function(_0x3e51ff){if(!_0x3e51ff){_0x5bf53f[_0x4c03('0x1d')](0x194);}return _0x3e51ff;};}function handleError(_0x44efa7,_0x23aaf5){_0x23aaf5=_0x23aaf5||0x1f4;return function(_0x2f2fc9){logger[_0x4c03('0x2f')](_0x2f2fc9[_0x4c03('0x30')]);if(_0x2f2fc9['name']){delete _0x2f2fc9['name'];}_0x44efa7[_0x4c03('0x1e')](_0x23aaf5)[_0x4c03('0x31')](_0x2f2fc9);};}exports[_0x4c03('0x32')]=function(_0x3b0e50,_0x37197e){var _0x16b3d3={},_0x530550={},_0x5a09dd={'count':0x0,'rows':[]};var _0x532265=_[_0x4c03('0x33')](db[_0x4c03('0x34')][_0x4c03('0x35')],function(_0x15079f){return{'name':_0x15079f[_0x4c03('0x36')],'type':_0x15079f[_0x4c03('0x37')][_0x4c03('0x38')]};});_0x530550['model']=_[_0x4c03('0x33')](_0x532265,_0x4c03('0x39'));_0x530550[_0x4c03('0x3a')]=_[_0x4c03('0x3b')](_0x3b0e50[_0x4c03('0x3a')]);_0x530550[_0x4c03('0x3c')]=_[_0x4c03('0x3d')](_0x530550[_0x4c03('0x3e')],_0x530550[_0x4c03('0x3a')]);_0x16b3d3[_0x4c03('0x3f')]=_[_0x4c03('0x3d')](_0x530550[_0x4c03('0x3e')],qs['fields'](_0x3b0e50['query']['fields']));_0x16b3d3['attributes']=_0x16b3d3[_0x4c03('0x3f')][_0x4c03('0x40')]?_0x16b3d3[_0x4c03('0x3f')]:_0x530550[_0x4c03('0x3e')];if(!_0x3b0e50[_0x4c03('0x3a')][_0x4c03('0x41')](_0x4c03('0x42'))){_0x16b3d3['limit']=qs[_0x4c03('0x23')](_0x3b0e50[_0x4c03('0x3a')][_0x4c03('0x23')]);_0x16b3d3[_0x4c03('0x21')]=qs[_0x4c03('0x21')](_0x3b0e50[_0x4c03('0x3a')][_0x4c03('0x21')]);}_0x16b3d3[_0x4c03('0x43')]=qs[_0x4c03('0x44')](_0x3b0e50['query'][_0x4c03('0x44')]);_0x16b3d3[_0x4c03('0x45')]=qs['filters'](_[_0x4c03('0x46')](_0x3b0e50[_0x4c03('0x3a')],_0x530550[_0x4c03('0x3c')]),_0x532265);if(_0x3b0e50['query'][_0x4c03('0x47')]){_0x16b3d3[_0x4c03('0x45')]=_['merge'](_0x16b3d3['where'],{'$or':_[_0x4c03('0x33')](_0x532265,function(_0x31e0dc){if(_0x31e0dc['type']!==_0x4c03('0x48')){var _0x499127={};_0x499127[_0x31e0dc[_0x4c03('0x39')]]={'$like':'%'+_0x3b0e50[_0x4c03('0x3a')][_0x4c03('0x47')]+'%'};return _0x499127;}})});}_0x16b3d3=_[_0x4c03('0x49')]({},_0x16b3d3,_0x3b0e50[_0x4c03('0x4a')]);var _0x53e43a={'where':_0x16b3d3[_0x4c03('0x45')]};return db[_0x4c03('0x34')][_0x4c03('0x24')](_0x53e43a)[_0x4c03('0x2b')](function(_0x5c4b52){_0x5a09dd[_0x4c03('0x24')]=_0x5c4b52;if(_0x3b0e50[_0x4c03('0x3a')][_0x4c03('0x4b')]){_0x16b3d3[_0x4c03('0x4c')]=[{'all':!![]}];}return db['Dashboard'][_0x4c03('0x4d')](_0x16b3d3);})[_0x4c03('0x2b')](function(_0x29224){_0x5a09dd['rows']=_0x29224;return _0x5a09dd;})['then'](respondWithFilteredResult(_0x37197e,_0x16b3d3))[_0x4c03('0x4e')](handleError(_0x37197e,null));};exports[_0x4c03('0x4f')]=function(_0x4dd172,_0x4face6){var _0x2cd98a={'raw':![],'where':{'id':_0x4dd172[_0x4c03('0x50')]['id']}},_0x45b80e={};_0x45b80e[_0x4c03('0x3e')]=_[_0x4c03('0x3b')](db[_0x4c03('0x34')][_0x4c03('0x35')]);_0x45b80e[_0x4c03('0x3a')]=_[_0x4c03('0x3b')](_0x4dd172[_0x4c03('0x3a')]);_0x45b80e[_0x4c03('0x3c')]=_[_0x4c03('0x3d')](_0x45b80e[_0x4c03('0x3e')],_0x45b80e[_0x4c03('0x3a')]);_0x2cd98a[_0x4c03('0x3f')]=_[_0x4c03('0x3d')](_0x45b80e[_0x4c03('0x3e')],qs[_0x4c03('0x51')](_0x4dd172['query']['fields']));_0x2cd98a[_0x4c03('0x3f')]=_0x2cd98a['attributes'][_0x4c03('0x40')]?_0x2cd98a[_0x4c03('0x3f')]:_0x45b80e[_0x4c03('0x3e')];if(_0x4dd172['query'][_0x4c03('0x4b')]){_0x2cd98a[_0x4c03('0x4c')]=[{'all':!![]}];}_0x2cd98a=_[_0x4c03('0x49')]({},_0x2cd98a,_0x4dd172['options']);return db[_0x4c03('0x34')][_0x4c03('0x52')](_0x2cd98a)[_0x4c03('0x2b')](handleEntityNotFound(_0x4face6,null))[_0x4c03('0x2b')](respondWithResult(_0x4face6,null))[_0x4c03('0x4e')](handleError(_0x4face6,null));};exports[_0x4c03('0x53')]=function(_0x1dbd83,_0x5a29a2){return db['Dashboard'][_0x4c03('0x53')](_0x1dbd83['body'],{})[_0x4c03('0x2b')](function(_0x4ee78a){var _0x55684b=_0x1dbd83[_0x4c03('0x54')][_0x4c03('0x2d')]({'plain':!![]});if(!_0x55684b)throw new Error(_0x4c03('0x55'));if(_0x55684b[_0x4c03('0x56')]===_0x4c03('0x54')){var _0x3d982a=_0x4ee78a[_0x4c03('0x2d')]({'plain':!![]});var _0x3ed0c5=_0x4c03('0x57');return db[_0x4c03('0x58')][_0x4c03('0x52')]({'where':{'name':_0x3ed0c5,'userProfileId':_0x55684b['userProfileId']},'raw':!![]})[_0x4c03('0x2b')](function(_0x17cf1c){if(_0x17cf1c&&_0x17cf1c[_0x4c03('0x59')]===0x0){return db[_0x4c03('0x2e')][_0x4c03('0x53')]({'name':_0x3d982a[_0x4c03('0x39')],'resourceId':_0x3d982a['id'],'type':_0x17cf1c[_0x4c03('0x39')],'sectionId':_0x17cf1c['id']},{})[_0x4c03('0x2b')](function(){return _0x4ee78a;});}else{return _0x4ee78a;}})['catch'](function(_0x187917){logger[_0x4c03('0x2f')](_0x4c03('0x5a'),_0x187917);throw _0x187917;});}return _0x4ee78a;})['then'](respondWithResult(_0x5a29a2,0xc9))['catch'](handleError(_0x5a29a2,null));};exports[_0x4c03('0x5b')]=function(_0xfedb0f,_0x532642){var _0x4644fd={'where':{'id':_0xfedb0f[_0x4c03('0x50')]['id']}},_0x2d1e27={};_0x2d1e27[_0x4c03('0x3e')]=_[_0x4c03('0x3b')](db[_0x4c03('0x34')]['rawAttributes']);_0x4644fd['attributes']=_[_0x4c03('0x3d')](_0x2d1e27[_0x4c03('0x3e')],qs[_0x4c03('0x51')](_0xfedb0f['query'][_0x4c03('0x51')]));_0x4644fd[_0x4c03('0x3f')]=_0x4644fd[_0x4c03('0x3f')][_0x4c03('0x40')]?_0x4644fd[_0x4c03('0x3f')]:_0x2d1e27['model'];if(_0xfedb0f[_0x4c03('0x3a')]['includeAll']){_0x4644fd['include']=[{'all':!![]}];}_0x4644fd=_[_0x4c03('0x49')]({},_0x4644fd,_0xfedb0f[_0x4c03('0x4a')]);return db[_0x4c03('0x34')][_0x4c03('0x52')](_0x4644fd)[_0x4c03('0x2b')](handleEntityNotFound(_0x532642,null))[_0x4c03('0x2b')](function(_0x3d8436){if(_0x3d8436){var _0x15318c=_0x3d8436[_0x4c03('0x2d')]({'plain':!![]});_0x15318c=qs[_0x4c03('0x5c')](_0x15318c,['id',_0x4c03('0x5d'),_0x4c03('0x5e')]);_0xfedb0f[_0x4c03('0x5f')]=_[_0x4c03('0x5c')](_0xfedb0f['body'],['id',_0x4c03('0x5d'),'updatedAt']);return db[_0x4c03('0x34')][_0x4c03('0x53')](_['merge'](_0x15318c,_0xfedb0f['body']),{'include':_0xfedb0f[_0x4c03('0x3a')][_0x4c03('0x4b')]?[{'all':!![]}]:undefined})[_0x4c03('0x2b')](function(_0x147779){var _0x5b2dd3=_0xfedb0f['user'][_0x4c03('0x2d')]({'plain':!![]});if(!_0x5b2dd3)throw new Error(_0x4c03('0x55'));if(_0x5b2dd3[_0x4c03('0x56')]===_0x4c03('0x54')){var _0x197bcb=_0x147779[_0x4c03('0x2d')]({'plain':!![]});var _0x2073de=_0x4c03('0x57');return db['UserProfileSection'][_0x4c03('0x52')]({'where':{'name':_0x2073de,'userProfileId':_0x5b2dd3[_0x4c03('0x60')]},'raw':!![]})['then'](function(_0x327e25){if(_0x327e25&&_0x327e25[_0x4c03('0x59')]===0x0){return db[_0x4c03('0x2e')][_0x4c03('0x53')]({'name':_0x197bcb[_0x4c03('0x39')],'resourceId':_0x197bcb['id'],'type':_0x327e25[_0x4c03('0x39')],'sectionId':_0x327e25['id']},{})[_0x4c03('0x2b')](function(){return _0x147779;});}else{return _0x147779;}})[_0x4c03('0x4e')](function(_0x56726b){logger[_0x4c03('0x2f')](_0x4c03('0x5a'),_0x56726b);throw _0x56726b;});}return _0x147779;});}})[_0x4c03('0x2b')](respondWithResult(_0x532642,0xc9))[_0x4c03('0x4e')](handleError(_0x532642,null));};exports[_0x4c03('0x2a')]=function(_0x1d1304,_0x1819ab){if(_0x1d1304[_0x4c03('0x5f')]['id']){delete _0x1d1304[_0x4c03('0x5f')]['id'];}return db[_0x4c03('0x34')][_0x4c03('0x52')]({'where':{'id':_0x1d1304[_0x4c03('0x50')]['id']}})[_0x4c03('0x2b')](handleEntityNotFound(_0x1819ab,null))[_0x4c03('0x2b')](saveUpdates(_0x1d1304[_0x4c03('0x5f')],null))[_0x4c03('0x2b')](respondWithResult(_0x1819ab,null))[_0x4c03('0x4e')](handleError(_0x1819ab,null));};exports[_0x4c03('0x2c')]=function(_0x5414e4,_0x130f1c){return db['Dashboard'][_0x4c03('0x52')]({'where':{'id':_0x5414e4[_0x4c03('0x50')]['id']}})[_0x4c03('0x2b')](handleEntityNotFound(_0x130f1c,null))['then'](removeEntity(_0x130f1c,null))['catch'](handleError(_0x130f1c,null));};function widgetAttributes(_0x5298d1){try{switch(_0x5298d1[_0x4c03('0x37')]){case _0x4c03('0x61'):return[{'name':_0x4c03('0x62'),'value':_0x5298d1[_0x4c03('0x62')]||(_0x5298d1[_0x4c03('0x63')]&&_0x5298d1['attrs'][0x0]?_0x5298d1['attrs'][0x0]['value']:undefined)||_0x4c03('0x64')}];case _0x4c03('0x65'):return[{'name':_0x4c03('0x66'),'value':_0x5298d1[_0x4c03('0x66')]||(_0x5298d1['attrs']&&_0x5298d1[_0x4c03('0x63')][0x0]?_0x5298d1[_0x4c03('0x63')][0x0][_0x4c03('0x67')]:undefined)||''}];case _0x4c03('0x68'):return[{'name':_0x4c03('0x69'),'value':_0x5298d1[_0x4c03('0x69')]||(_0x5298d1[_0x4c03('0x63')]&&_0x5298d1['attrs'][0x0]?_0x5298d1[_0x4c03('0x63')][0x0][_0x4c03('0x67')]:undefined)||_0x4c03('0x6a')},{'name':_0x4c03('0x6b'),'value':_0x5298d1[_0x4c03('0x6b')]||(_0x5298d1[_0x4c03('0x63')]&&_0x5298d1['attrs'][0x1]?_0x5298d1['attrs'][0x1][_0x4c03('0x67')]:undefined)||'0.00'},{'name':_0x4c03('0x6c'),'value':_0x5298d1[_0x4c03('0x6c')]||(_0x5298d1[_0x4c03('0x63')]&&_0x5298d1[_0x4c03('0x63')][0x2]?_0x5298d1[_0x4c03('0x63')][0x2]['value']:undefined)||0xc}];case _0x4c03('0x6d'):return[{'name':_0x4c03('0x6e'),'value':_0x5298d1[_0x4c03('0x6e')]||(_0x5298d1['attrs']&&_0x5298d1['attrs'][0x0]?_0x5298d1['attrs'][0x0][_0x4c03('0x67')]:undefined)||_0x4c03('0x6f')},{'name':'attrVoiceQueues','value':_0x5298d1['attrVoiceQueues']||(_0x5298d1['attrs']&&_0x5298d1[_0x4c03('0x63')][0x1]?_0x5298d1[_0x4c03('0x63')][0x1][_0x4c03('0x67')]:undefined)||[]},{'name':_0x4c03('0x6c'),'value':_0x5298d1[_0x4c03('0x6c')]||(_0x5298d1[_0x4c03('0x63')]&&_0x5298d1['attrs'][0x2]?_0x5298d1['attrs'][0x2]['value']:undefined)||0x14}];case _0x4c03('0x70'):case'pie-chart':return[{'name':_0x4c03('0x71'),'value':_0x5298d1[_0x4c03('0x71')]||(_0x5298d1['attrs']&&_0x5298d1[_0x4c03('0x63')][0x0]?_0x5298d1[_0x4c03('0x63')][0x0][_0x4c03('0x67')]:undefined)||_0x4c03('0x6f')},{'name':_0x4c03('0x72'),'value':_0x5298d1[_0x4c03('0x72')]||(_0x5298d1[_0x4c03('0x63')]&&_0x5298d1[_0x4c03('0x63')][0x1]?_0x5298d1[_0x4c03('0x63')][0x1][_0x4c03('0x67')]:undefined)||null},{'name':_0x4c03('0x73'),'value':_0x5298d1[_0x4c03('0x73')]||(_0x5298d1[_0x4c03('0x63')]&&_0x5298d1[_0x4c03('0x63')][0x2]?_0x5298d1[_0x4c03('0x63')][0x2][_0x4c03('0x67')]:undefined)||null},{'name':_0x4c03('0x74'),'value':_0x5298d1[_0x4c03('0x74')]||(_0x5298d1[_0x4c03('0x63')]&&_0x5298d1['attrs'][0x3]?_0x5298d1[_0x4c03('0x63')][0x3]['value']:undefined)||[]}];case _0x4c03('0x75'):return[{'name':_0x4c03('0x76'),'type':_0x5298d1[_0x4c03('0x77')]||(_0x5298d1[_0x4c03('0x63')]&&_0x5298d1[_0x4c03('0x63')][0x0]?_0x5298d1[_0x4c03('0x63')][0x0][_0x4c03('0x37')]:undefined)||null,'value':_0x5298d1['attrReport']||(_0x5298d1['attrs']&&_0x5298d1[_0x4c03('0x63')][0x0]?_0x5298d1[_0x4c03('0x63')][0x0][_0x4c03('0x67')]:undefined)||null},{'name':_0x4c03('0x78'),'value':_0x5298d1[_0x4c03('0x78')]||(_0x5298d1[_0x4c03('0x63')]&&_0x5298d1[_0x4c03('0x63')][0x1]?_0x5298d1[_0x4c03('0x63')][0x1][_0x4c03('0x67')]:undefined)||0x0}];default:return[];}}catch(_0x22b417){logger[_0x4c03('0x2f')](_0x4c03('0x79'),JSON[_0x4c03('0x7a')](_0x22b417));return[];}}exports[_0x4c03('0x7b')]=function(_0x5720f1,_0x38829c,_0x3a9f4c){if(_0x5720f1[_0x4c03('0x5f')]['id']){delete _0x5720f1['body']['id'];}return db['Dashboard'][_0x4c03('0x52')]({'where':{'id':_0x5720f1[_0x4c03('0x50')]['id']}})[_0x4c03('0x2b')](handleEntityNotFound(_0x38829c,null))[_0x4c03('0x2b')](function(_0x383ea2){if(_0x383ea2){_0x5720f1[_0x4c03('0x5f')][_0x4c03('0x7c')]=_0x383ea2['id'];_0x5720f1[_0x4c03('0x5f')][_0x4c03('0x63')]=widgetAttributes(_0x5720f1['body']);return db[_0x4c03('0x7d')][_0x4c03('0x53')](_0x5720f1[_0x4c03('0x5f')]);}})['then'](respondWithResult(_0x38829c,null))['catch'](handleError(_0x38829c,null));};exports[_0x4c03('0x7e')]=function(_0x584aba,_0x13ea71,_0x179e83){var _0x20c244={};var _0x27b379={};var _0x37eb92;var _0x58215f;return db[_0x4c03('0x34')]['findOne']({'where':{'id':_0x584aba['params']['id']}})[_0x4c03('0x2b')](handleEntityNotFound(_0x13ea71,null))[_0x4c03('0x2b')](function(_0x25a8e0){if(_0x25a8e0){_0x37eb92=_0x25a8e0;_0x27b379['model']=_[_0x4c03('0x3b')](db[_0x4c03('0x7d')]['rawAttributes']);_0x27b379[_0x4c03('0x3a')]=_[_0x4c03('0x3b')](_0x584aba[_0x4c03('0x3a')]);_0x27b379['filters']=_[_0x4c03('0x3d')](_0x27b379[_0x4c03('0x3e')],_0x27b379[_0x4c03('0x3a')]);_0x20c244[_0x4c03('0x3f')]=_[_0x4c03('0x3d')](_0x27b379['model'],qs[_0x4c03('0x51')](_0x584aba['query'][_0x4c03('0x51')]));_0x20c244[_0x4c03('0x3f')]=_0x20c244[_0x4c03('0x3f')][_0x4c03('0x40')]?_0x20c244[_0x4c03('0x3f')]:_0x27b379['model'];_0x20c244['order']=qs[_0x4c03('0x44')](_0x584aba[_0x4c03('0x3a')][_0x4c03('0x44')]);_0x20c244[_0x4c03('0x45')]=qs[_0x4c03('0x3c')](_[_0x4c03('0x46')](_0x584aba[_0x4c03('0x3a')],_0x27b379[_0x4c03('0x3c')]));if(_0x584aba[_0x4c03('0x3a')][_0x4c03('0x47')]){_0x20c244['where']=_[_0x4c03('0x49')](_0x20c244[_0x4c03('0x45')],{'$or':_[_0x4c03('0x33')](_0x20c244[_0x4c03('0x3f')],function(_0x2cd46f){var _0x1fcd0c={};_0x1fcd0c[_0x2cd46f]={'$like':'%'+_0x584aba[_0x4c03('0x3a')][_0x4c03('0x47')]+'%'};return _0x1fcd0c;})});}_0x20c244=_['merge']({},_0x20c244,_0x584aba[_0x4c03('0x4a')]);return _0x37eb92[_0x4c03('0x7e')](_0x20c244);}})[_0x4c03('0x2b')](function(_0x3e3d77){if(_0x3e3d77){_0x58215f=_0x3e3d77[_0x4c03('0x40')];if(!_0x584aba[_0x4c03('0x3a')][_0x4c03('0x41')](_0x4c03('0x42'))){_0x20c244[_0x4c03('0x23')]=qs[_0x4c03('0x23')](_0x584aba[_0x4c03('0x3a')]['limit']);_0x20c244['offset']=qs[_0x4c03('0x21')](_0x584aba[_0x4c03('0x3a')][_0x4c03('0x21')]);}return _0x37eb92[_0x4c03('0x7e')](_0x20c244);}})['then'](function(_0x1cb86d){if(_0x1cb86d){return _0x1cb86d?{'count':_0x58215f,'rows':_0x1cb86d}:null;}})[_0x4c03('0x2b')](respondWithResult(_0x13ea71,null))[_0x4c03('0x4e')](handleError(_0x13ea71,null));};
\ No newline at end of file
+var _0x7141=['defaults','localhost','register','sendStatus','status','json','offset','undefined','count','set','apply','save','update','destroy','then','get','CustomDashboards','UserProfileResource','end','error','stack','name','index','map','Dashboard','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','role','attrUrl','attrs','value','custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','findOne','sort','getItems','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x399d76,_0xdc4493){var _0x3b19a1=function(_0x262225){while(--_0x262225){_0x399d76['push'](_0x399d76['shift']());}};_0x3b19a1(++_0xdc4493);}(_0x7141,0x151));var _0x1714=function(_0x8eeead,_0xdcc663){_0x8eeead=_0x8eeead-0x0;var _0x2a53b5=_0x7141[_0x8eeead];return _0x2a53b5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1714('0x0'));var zipdir=require(_0x1714('0x1'));var jsonpatch=require(_0x1714('0x2'));var rp=require(_0x1714('0x3'));var moment=require(_0x1714('0x4'));var BPromise=require(_0x1714('0x5'));var Mustache=require(_0x1714('0x6'));var util=require(_0x1714('0x7'));var path=require(_0x1714('0x8'));var sox=require(_0x1714('0x9'));var csv=require(_0x1714('0xa'));var ejs=require(_0x1714('0xb'));var fs=require('fs');var fs_extra=require(_0x1714('0xc'));var _=require(_0x1714('0xd'));var squel=require('squel');var crypto=require(_0x1714('0xe'));var jsforce=require(_0x1714('0xf'));var deskjs=require(_0x1714('0x10'));var toCsv=require(_0x1714('0xa'));var querystring=require(_0x1714('0x11'));var Papa=require('papaparse');var Redis=require(_0x1714('0x12'));var authService=require(_0x1714('0x13'));var qs=require(_0x1714('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1714('0x15'));var logger=require(_0x1714('0x16'))(_0x1714('0x17'));var utils=require(_0x1714('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x1714('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x1714('0x1a')](config['redis'],{'host':_0x1714('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboard.socket')[_0x1714('0x1c')](socket);function respondWithStatusCode(_0x5ee2ee,_0x550d6f){_0x550d6f=_0x550d6f||0xcc;return function(_0x5c891e){if(_0x5c891e){return _0x5ee2ee[_0x1714('0x1d')](_0x550d6f);}return _0x5ee2ee[_0x1714('0x1e')](_0x550d6f)['end']();};}function respondWithResult(_0x17fcc1,_0x476aa6){_0x476aa6=_0x476aa6||0xc8;return function(_0x24c2aa){if(_0x24c2aa){return _0x17fcc1[_0x1714('0x1e')](_0x476aa6)[_0x1714('0x1f')](_0x24c2aa);}};}function respondWithFilteredResult(_0xfb71bc,_0x5d349f){return function(_0x36a11f){if(_0x36a11f){var _0x19d53a=typeof _0x5d349f[_0x1714('0x20')]===_0x1714('0x21')&&typeof _0x5d349f['limit']===_0x1714('0x21');var _0x4636cf=_0x36a11f[_0x1714('0x22')];var _0x5ca199=_0x19d53a?0x0:_0x5d349f[_0x1714('0x20')];var _0x1b32b5=_0x19d53a?_0x36a11f[_0x1714('0x22')]:_0x5d349f[_0x1714('0x20')]+_0x5d349f['limit'];var _0x497f3a;if(_0x1b32b5>=_0x4636cf){_0x1b32b5=_0x4636cf;_0x497f3a=0xc8;}else{_0x497f3a=0xce;}_0xfb71bc[_0x1714('0x1e')](_0x497f3a);return _0xfb71bc[_0x1714('0x23')]('Content-Range',_0x5ca199+'-'+_0x1b32b5+'/'+_0x4636cf)['json'](_0x36a11f);}return null;};}function patchUpdates(_0xded0cc){return function(_0x5cabe3){try{jsonpatch[_0x1714('0x24')](_0x5cabe3,_0xded0cc,!![]);}catch(_0x595c31){return BPromise['reject'](_0x595c31);}return _0x5cabe3[_0x1714('0x25')]();};}function saveUpdates(_0x396da1,_0x21d9eb){return function(_0x5e6a5a){if(_0x5e6a5a){return _0x5e6a5a[_0x1714('0x26')](_0x396da1)['then'](function(_0x4bcd5c){return _0x4bcd5c;});}return null;};}function removeEntity(_0x149ba9,_0x5044b1){return function(_0x1d164a){if(_0x1d164a){return _0x1d164a[_0x1714('0x27')]()[_0x1714('0x28')](function(){var _0x48949c=_0x1d164a[_0x1714('0x29')]({'plain':!![]});var _0x565494=_0x1714('0x2a');return db[_0x1714('0x2b')][_0x1714('0x27')]({'where':{'type':_0x565494,'resourceId':_0x48949c['id']}})[_0x1714('0x28')](function(){return _0x1d164a;});})[_0x1714('0x28')](function(){_0x149ba9[_0x1714('0x1e')](0xcc)[_0x1714('0x2c')]();});}};}function handleEntityNotFound(_0x6c2c38,_0x44cc2a){return function(_0x16ea1a){if(!_0x16ea1a){_0x6c2c38[_0x1714('0x1d')](0x194);}return _0x16ea1a;};}function handleError(_0x5d2d37,_0x498ef6){_0x498ef6=_0x498ef6||0x1f4;return function(_0x28fafb){logger[_0x1714('0x2d')](_0x28fafb[_0x1714('0x2e')]);if(_0x28fafb[_0x1714('0x2f')]){delete _0x28fafb['name'];}_0x5d2d37[_0x1714('0x1e')](_0x498ef6)['send'](_0x28fafb);};}exports[_0x1714('0x30')]=function(_0x52b0e3,_0x206a72){var _0x11462c={},_0x39bfc9={},_0x363313={'count':0x0,'rows':[]};var _0x3c1d15=_[_0x1714('0x31')](db[_0x1714('0x32')][_0x1714('0x33')],function(_0x6f2554){return{'name':_0x6f2554[_0x1714('0x34')],'type':_0x6f2554[_0x1714('0x35')]['key']};});_0x39bfc9[_0x1714('0x36')]=_[_0x1714('0x31')](_0x3c1d15,'name');_0x39bfc9[_0x1714('0x37')]=_[_0x1714('0x38')](_0x52b0e3[_0x1714('0x37')]);_0x39bfc9[_0x1714('0x39')]=_[_0x1714('0x3a')](_0x39bfc9[_0x1714('0x36')],_0x39bfc9['query']);_0x11462c[_0x1714('0x3b')]=_[_0x1714('0x3a')](_0x39bfc9[_0x1714('0x36')],qs[_0x1714('0x3c')](_0x52b0e3[_0x1714('0x37')]['fields']));_0x11462c[_0x1714('0x3b')]=_0x11462c[_0x1714('0x3b')][_0x1714('0x3d')]?_0x11462c[_0x1714('0x3b')]:_0x39bfc9[_0x1714('0x36')];if(!_0x52b0e3[_0x1714('0x37')][_0x1714('0x3e')]('nolimit')){_0x11462c[_0x1714('0x3f')]=qs['limit'](_0x52b0e3[_0x1714('0x37')][_0x1714('0x3f')]);_0x11462c[_0x1714('0x20')]=qs[_0x1714('0x20')](_0x52b0e3[_0x1714('0x37')][_0x1714('0x20')]);}_0x11462c[_0x1714('0x40')]=qs['sort'](_0x52b0e3[_0x1714('0x37')]['sort']);_0x11462c['where']=qs[_0x1714('0x39')](_[_0x1714('0x41')](_0x52b0e3['query'],_0x39bfc9[_0x1714('0x39')]),_0x3c1d15);if(_0x52b0e3[_0x1714('0x37')][_0x1714('0x42')]){_0x11462c[_0x1714('0x43')]=_[_0x1714('0x44')](_0x11462c[_0x1714('0x43')],{'$or':_[_0x1714('0x31')](_0x3c1d15,function(_0x5a8256){if(_0x5a8256[_0x1714('0x35')]!==_0x1714('0x45')){var _0x52c1b7={};_0x52c1b7[_0x5a8256[_0x1714('0x2f')]]={'$like':'%'+_0x52b0e3[_0x1714('0x37')][_0x1714('0x42')]+'%'};return _0x52c1b7;}})});}_0x11462c=_[_0x1714('0x44')]({},_0x11462c,_0x52b0e3['options']);var _0x124ee9={'where':_0x11462c[_0x1714('0x43')]};return db['Dashboard'][_0x1714('0x22')](_0x124ee9)[_0x1714('0x28')](function(_0x1cae96){_0x363313['count']=_0x1cae96;if(_0x52b0e3['query'][_0x1714('0x46')]){_0x11462c[_0x1714('0x47')]=[{'all':!![]}];}return db[_0x1714('0x32')][_0x1714('0x48')](_0x11462c);})[_0x1714('0x28')](function(_0x362e90){_0x363313[_0x1714('0x49')]=_0x362e90;return _0x363313;})[_0x1714('0x28')](respondWithFilteredResult(_0x206a72,_0x11462c))[_0x1714('0x4a')](handleError(_0x206a72,null));};exports['show']=function(_0x3fe18d,_0x3126f1){var _0x2ead04={'raw':![],'where':{'id':_0x3fe18d['params']['id']}},_0x5b8021={};_0x5b8021[_0x1714('0x36')]=_[_0x1714('0x38')](db[_0x1714('0x32')]['rawAttributes']);_0x5b8021[_0x1714('0x37')]=_[_0x1714('0x38')](_0x3fe18d[_0x1714('0x37')]);_0x5b8021[_0x1714('0x39')]=_[_0x1714('0x3a')](_0x5b8021[_0x1714('0x36')],_0x5b8021[_0x1714('0x37')]);_0x2ead04[_0x1714('0x3b')]=_[_0x1714('0x3a')](_0x5b8021[_0x1714('0x36')],qs[_0x1714('0x3c')](_0x3fe18d[_0x1714('0x37')][_0x1714('0x3c')]));_0x2ead04[_0x1714('0x3b')]=_0x2ead04[_0x1714('0x3b')][_0x1714('0x3d')]?_0x2ead04[_0x1714('0x3b')]:_0x5b8021['model'];if(_0x3fe18d[_0x1714('0x37')][_0x1714('0x46')]){_0x2ead04[_0x1714('0x47')]=[{'all':!![]}];}_0x2ead04=_[_0x1714('0x44')]({},_0x2ead04,_0x3fe18d[_0x1714('0x4b')]);return db['Dashboard'][_0x1714('0x4c')](_0x2ead04)['then'](handleEntityNotFound(_0x3126f1,null))[_0x1714('0x28')](respondWithResult(_0x3126f1,null))[_0x1714('0x4a')](handleError(_0x3126f1,null));};exports[_0x1714('0x4d')]=function(_0x599238,_0x3de050){return db[_0x1714('0x32')][_0x1714('0x4d')](_0x599238[_0x1714('0x4e')],{})['then'](function(_0x45a866){var _0xfcaa8f=_0x599238[_0x1714('0x4f')][_0x1714('0x29')]({'plain':!![]});if(!_0xfcaa8f)throw new Error(_0x1714('0x50'));if(_0xfcaa8f['role']===_0x1714('0x4f')){var _0x100ea9=_0x45a866[_0x1714('0x29')]({'plain':!![]});var _0x30d51=_0x1714('0x2a');return db[_0x1714('0x51')][_0x1714('0x4c')]({'where':{'name':_0x30d51,'userProfileId':_0xfcaa8f[_0x1714('0x52')]},'raw':!![]})[_0x1714('0x28')](function(_0x205681){if(_0x205681&&_0x205681[_0x1714('0x53')]===0x0){return db[_0x1714('0x2b')]['create']({'name':_0x100ea9[_0x1714('0x2f')],'resourceId':_0x100ea9['id'],'type':_0x205681[_0x1714('0x2f')],'sectionId':_0x205681['id']},{})[_0x1714('0x28')](function(){return _0x45a866;});}else{return _0x45a866;}})[_0x1714('0x4a')](function(_0x568f3f){logger[_0x1714('0x2d')](_0x1714('0x54'),_0x568f3f);throw _0x568f3f;});}return _0x45a866;})[_0x1714('0x28')](respondWithResult(_0x3de050,0xc9))['catch'](handleError(_0x3de050,null));};exports[_0x1714('0x55')]=function(_0x401ae9,_0x3060f3){var _0x35607d={'where':{'id':_0x401ae9[_0x1714('0x56')]['id']}},_0x52fbde={};_0x52fbde[_0x1714('0x36')]=_[_0x1714('0x38')](db[_0x1714('0x32')]['rawAttributes']);_0x35607d[_0x1714('0x3b')]=_[_0x1714('0x3a')](_0x52fbde[_0x1714('0x36')],qs['fields'](_0x401ae9['query'][_0x1714('0x3c')]));_0x35607d[_0x1714('0x3b')]=_0x35607d[_0x1714('0x3b')][_0x1714('0x3d')]?_0x35607d[_0x1714('0x3b')]:_0x52fbde[_0x1714('0x36')];if(_0x401ae9[_0x1714('0x37')]['includeAll']){_0x35607d[_0x1714('0x47')]=[{'all':!![]}];}_0x35607d=_['merge']({},_0x35607d,_0x401ae9['options']);return db[_0x1714('0x32')][_0x1714('0x4c')](_0x35607d)[_0x1714('0x28')](handleEntityNotFound(_0x3060f3,null))['then'](function(_0x4790fb){if(_0x4790fb){var _0x3d3000=_0x4790fb['get']({'plain':!![]});_0x3d3000=qs[_0x1714('0x57')](_0x3d3000,['id',_0x1714('0x58'),_0x1714('0x59')]);_0x401ae9[_0x1714('0x4e')]=_[_0x1714('0x57')](_0x401ae9[_0x1714('0x4e')],['id',_0x1714('0x58'),_0x1714('0x59')]);return db[_0x1714('0x32')][_0x1714('0x4d')](_[_0x1714('0x44')](_0x3d3000,_0x401ae9[_0x1714('0x4e')]),{'include':_0x401ae9[_0x1714('0x37')][_0x1714('0x46')]?[{'all':!![]}]:undefined})[_0x1714('0x28')](function(_0x626ff2){var _0x27933d=_0x401ae9['user'][_0x1714('0x29')]({'plain':!![]});if(!_0x27933d)throw new Error(_0x1714('0x50'));if(_0x27933d[_0x1714('0x5a')]===_0x1714('0x4f')){var _0x12fc60=_0x626ff2[_0x1714('0x29')]({'plain':!![]});var _0x56b646='CustomDashboards';return db['UserProfileSection'][_0x1714('0x4c')]({'where':{'name':_0x56b646,'userProfileId':_0x27933d[_0x1714('0x52')]},'raw':!![]})[_0x1714('0x28')](function(_0x438e2e){if(_0x438e2e&&_0x438e2e[_0x1714('0x53')]===0x0){return db[_0x1714('0x2b')][_0x1714('0x4d')]({'name':_0x12fc60[_0x1714('0x2f')],'resourceId':_0x12fc60['id'],'type':_0x438e2e['name'],'sectionId':_0x438e2e['id']},{})[_0x1714('0x28')](function(){return _0x626ff2;});}else{return _0x626ff2;}})['catch'](function(_0x3584fb){logger[_0x1714('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3584fb);throw _0x3584fb;});}return _0x626ff2;});}})[_0x1714('0x28')](respondWithResult(_0x3060f3,0xc9))[_0x1714('0x4a')](handleError(_0x3060f3,null));};exports[_0x1714('0x26')]=function(_0x1425bf,_0x2ae987){if(_0x1425bf[_0x1714('0x4e')]['id']){delete _0x1425bf[_0x1714('0x4e')]['id'];}return db['Dashboard'][_0x1714('0x4c')]({'where':{'id':_0x1425bf[_0x1714('0x56')]['id']}})[_0x1714('0x28')](handleEntityNotFound(_0x2ae987,null))[_0x1714('0x28')](saveUpdates(_0x1425bf[_0x1714('0x4e')],null))['then'](respondWithResult(_0x2ae987,null))['catch'](handleError(_0x2ae987,null));};exports[_0x1714('0x27')]=function(_0x419b9c,_0x113ff7){return db[_0x1714('0x32')][_0x1714('0x4c')]({'where':{'id':_0x419b9c[_0x1714('0x56')]['id']}})[_0x1714('0x28')](handleEntityNotFound(_0x113ff7,null))[_0x1714('0x28')](removeEntity(_0x113ff7,null))[_0x1714('0x4a')](handleError(_0x113ff7,null));};function widgetAttributes(_0x793bd9){try{switch(_0x793bd9[_0x1714('0x35')]){case'iframe':return[{'name':'attrUrl','value':_0x793bd9[_0x1714('0x5b')]||(_0x793bd9[_0x1714('0x5c')]&&_0x793bd9['attrs'][0x0]?_0x793bd9['attrs'][0x0][_0x1714('0x5d')]:undefined)||'https://'}];case _0x1714('0x5e'):return[{'name':_0x1714('0x5f'),'value':_0x793bd9[_0x1714('0x5f')]||(_0x793bd9[_0x1714('0x5c')]&&_0x793bd9['attrs'][0x0]?_0x793bd9[_0x1714('0x5c')][0x0][_0x1714('0x5d')]:undefined)||''}];case'clock':return[{'name':_0x1714('0x60'),'value':_0x793bd9[_0x1714('0x60')]||(_0x793bd9[_0x1714('0x5c')]&&_0x793bd9[_0x1714('0x5c')][0x0]?_0x793bd9[_0x1714('0x5c')][0x0][_0x1714('0x5d')]:undefined)||_0x1714('0x61')},{'name':_0x1714('0x62'),'value':_0x793bd9['attrTimezone']||(_0x793bd9[_0x1714('0x5c')]&&_0x793bd9[_0x1714('0x5c')][0x1]?_0x793bd9[_0x1714('0x5c')][0x1][_0x1714('0x5d')]:undefined)||'0.00'},{'name':_0x1714('0x63'),'value':_0x793bd9['attrFontSize']||(_0x793bd9[_0x1714('0x5c')]&&_0x793bd9[_0x1714('0x5c')][0x2]?_0x793bd9['attrs'][0x2][_0x1714('0x5d')]:undefined)||0xc}];case _0x1714('0x64'):return[{'name':_0x1714('0x65'),'value':_0x793bd9['attrMetric']||(_0x793bd9['attrs']&&_0x793bd9[_0x1714('0x5c')][0x0]?_0x793bd9[_0x1714('0x5c')][0x0][_0x1714('0x5d')]:undefined)||_0x1714('0x66')},{'name':'attrVoiceQueues','value':_0x793bd9[_0x1714('0x67')]||(_0x793bd9[_0x1714('0x5c')]&&_0x793bd9['attrs'][0x1]?_0x793bd9['attrs'][0x1]['value']:undefined)||[]},{'name':_0x1714('0x63'),'value':_0x793bd9[_0x1714('0x63')]||(_0x793bd9[_0x1714('0x5c')]&&_0x793bd9[_0x1714('0x5c')][0x2]?_0x793bd9[_0x1714('0x5c')][0x2][_0x1714('0x5d')]:undefined)||0x14}];case _0x1714('0x68'):case _0x1714('0x69'):return[{'name':_0x1714('0x6a'),'value':_0x793bd9[_0x1714('0x6a')]||(_0x793bd9[_0x1714('0x5c')]&&_0x793bd9['attrs'][0x0]?_0x793bd9[_0x1714('0x5c')][0x0][_0x1714('0x5d')]:undefined)||_0x1714('0x66')},{'name':_0x1714('0x6b'),'value':_0x793bd9[_0x1714('0x6b')]||(_0x793bd9[_0x1714('0x5c')]&&_0x793bd9['attrs'][0x1]?_0x793bd9[_0x1714('0x5c')][0x1][_0x1714('0x5d')]:undefined)||null},{'name':'attrSerie3','value':_0x793bd9[_0x1714('0x6c')]||(_0x793bd9[_0x1714('0x5c')]&&_0x793bd9[_0x1714('0x5c')][0x2]?_0x793bd9[_0x1714('0x5c')][0x2]['value']:undefined)||null},{'name':_0x1714('0x67'),'value':_0x793bd9[_0x1714('0x67')]||(_0x793bd9[_0x1714('0x5c')]&&_0x793bd9[_0x1714('0x5c')][0x3]?_0x793bd9[_0x1714('0x5c')][0x3]['value']:undefined)||[]}];case _0x1714('0x6d'):return[{'name':_0x1714('0x6e'),'type':_0x793bd9[_0x1714('0x6f')]||(_0x793bd9['attrs']&&_0x793bd9['attrs'][0x0]?_0x793bd9[_0x1714('0x5c')][0x0][_0x1714('0x35')]:undefined)||null,'value':_0x793bd9['attrReport']||(_0x793bd9[_0x1714('0x5c')]&&_0x793bd9[_0x1714('0x5c')][0x0]?_0x793bd9[_0x1714('0x5c')][0x0][_0x1714('0x5d')]:undefined)||null},{'name':'attrRefresh','value':_0x793bd9['attrRefresh']||(_0x793bd9[_0x1714('0x5c')]&&_0x793bd9['attrs'][0x1]?_0x793bd9[_0x1714('0x5c')][0x1][_0x1714('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0xa3ca9b){logger[_0x1714('0x2d')](_0x1714('0x70'),JSON[_0x1714('0x71')](_0xa3ca9b));return[];}}exports[_0x1714('0x72')]=function(_0x471429,_0x4cc9a0,_0x33df8b){if(_0x471429[_0x1714('0x4e')]['id']){delete _0x471429[_0x1714('0x4e')]['id'];}return db[_0x1714('0x32')]['find']({'where':{'id':_0x471429[_0x1714('0x56')]['id']}})[_0x1714('0x28')](handleEntityNotFound(_0x4cc9a0,null))[_0x1714('0x28')](function(_0x4ae8a2){if(_0x4ae8a2){_0x471429['body'][_0x1714('0x73')]=_0x4ae8a2['id'];_0x471429['body'][_0x1714('0x5c')]=widgetAttributes(_0x471429[_0x1714('0x4e')]);return db[_0x1714('0x74')][_0x1714('0x4d')](_0x471429[_0x1714('0x4e')]);}})[_0x1714('0x28')](respondWithResult(_0x4cc9a0,null))[_0x1714('0x4a')](handleError(_0x4cc9a0,null));};exports['getItems']=function(_0x53ac66,_0x22677e,_0x1d9635){var _0x5eea43={};var _0x213545={};var _0x36da1d;var _0x359042;return db['Dashboard'][_0x1714('0x75')]({'where':{'id':_0x53ac66[_0x1714('0x56')]['id']}})['then'](handleEntityNotFound(_0x22677e,null))[_0x1714('0x28')](function(_0x4c4422){if(_0x4c4422){_0x36da1d=_0x4c4422;_0x213545['model']=_[_0x1714('0x38')](db['DashboardItem'][_0x1714('0x33')]);_0x213545[_0x1714('0x37')]=_[_0x1714('0x38')](_0x53ac66[_0x1714('0x37')]);_0x213545[_0x1714('0x39')]=_[_0x1714('0x3a')](_0x213545[_0x1714('0x36')],_0x213545[_0x1714('0x37')]);_0x5eea43[_0x1714('0x3b')]=_['intersection'](_0x213545[_0x1714('0x36')],qs[_0x1714('0x3c')](_0x53ac66[_0x1714('0x37')]['fields']));_0x5eea43[_0x1714('0x3b')]=_0x5eea43[_0x1714('0x3b')]['length']?_0x5eea43['attributes']:_0x213545[_0x1714('0x36')];_0x5eea43[_0x1714('0x40')]=qs[_0x1714('0x76')](_0x53ac66[_0x1714('0x37')][_0x1714('0x76')]);_0x5eea43['where']=qs[_0x1714('0x39')](_[_0x1714('0x41')](_0x53ac66[_0x1714('0x37')],_0x213545[_0x1714('0x39')]));if(_0x53ac66[_0x1714('0x37')][_0x1714('0x42')]){_0x5eea43[_0x1714('0x43')]=_['merge'](_0x5eea43['where'],{'$or':_[_0x1714('0x31')](_0x5eea43[_0x1714('0x3b')],function(_0x2e4c29){var _0x513c70={};_0x513c70[_0x2e4c29]={'$like':'%'+_0x53ac66[_0x1714('0x37')]['filter']+'%'};return _0x513c70;})});}_0x5eea43=_['merge']({},_0x5eea43,_0x53ac66[_0x1714('0x4b')]);return _0x36da1d[_0x1714('0x77')](_0x5eea43);}})[_0x1714('0x28')](function(_0x240996){if(_0x240996){_0x359042=_0x240996[_0x1714('0x3d')];if(!_0x53ac66['query'][_0x1714('0x3e')](_0x1714('0x78'))){_0x5eea43[_0x1714('0x3f')]=qs[_0x1714('0x3f')](_0x53ac66[_0x1714('0x37')][_0x1714('0x3f')]);_0x5eea43[_0x1714('0x20')]=qs[_0x1714('0x20')](_0x53ac66[_0x1714('0x37')]['offset']);}return _0x36da1d[_0x1714('0x77')](_0x5eea43);}})['then'](function(_0xdb8c4b){if(_0xdb8c4b){return _0xdb8c4b?{'count':_0x359042,'rows':_0xdb8c4b}:null;}})[_0x1714('0x28')](respondWithResult(_0x22677e,null))['catch'](handleError(_0x22677e,null));};
\ No newline at end of file
index e619c53..59d8ec7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5224=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','setMaxListeners'];(function(_0x7f0805,_0x362cd0){var _0xe5b2dc=function(_0x4a1eda){while(--_0x4a1eda){_0x7f0805['push'](_0x7f0805['shift']());}};_0xe5b2dc(++_0x362cd0);}(_0x5224,0xa6));var _0x4522=function(_0x8f4554,_0x97e1f8){_0x8f4554=_0x8f4554-0x0;var _0x2b7465=_0x5224[_0x8f4554];return _0x2b7465;};'use strict';var EventEmitter=require(_0x4522('0x0'));var Dashboard=require(_0x4522('0x1'))['db'][_0x4522('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x4522('0x3')](0x0);var events={'afterCreate':_0x4522('0x4'),'afterUpdate':'update','afterDestroy':_0x4522('0x5')};function emitEvent(_0x1ed51b){return function(_0x630e1c,_0x1f7ac7,_0x320b1b){DashboardEvents[_0x4522('0x6')](_0x1ed51b+':'+_0x630e1c['id'],_0x630e1c);DashboardEvents['emit'](_0x1ed51b,_0x630e1c);_0x320b1b(null);};}for(var e in events){if(events[_0x4522('0x7')](e)){var event=events[e];Dashboard[_0x4522('0x8')](e,emitEvent(event));}}module[_0x4522('0x9')]=DashboardEvents;
\ No newline at end of file
+var _0xe935=['update','emit','hasOwnProperty','events','../../mysqldb','setMaxListeners'];(function(_0x5c8c13,_0x3381b0){var _0x1c6868=function(_0x5c1d6e){while(--_0x5c1d6e){_0x5c8c13['push'](_0x5c8c13['shift']());}};_0x1c6868(++_0x3381b0);}(_0xe935,0x10b));var _0x5e93=function(_0xbd86de,_0x5866af){_0xbd86de=_0xbd86de-0x0;var _0xb7461f=_0xe935[_0xbd86de];return _0xb7461f;};'use strict';var EventEmitter=require(_0x5e93('0x0'));var Dashboard=require(_0x5e93('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x5e93('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5e93('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3be933){return function(_0x27ea40,_0x49adc0,_0x43b284){DashboardEvents[_0x5e93('0x4')](_0x3be933+':'+_0x27ea40['id'],_0x27ea40);DashboardEvents[_0x5e93('0x4')](_0x3be933,_0x27ea40);_0x43b284(null);};}for(var e in events){if(events[_0x5e93('0x5')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module['exports']=DashboardEvents;
\ No newline at end of file
index c909190..868d81e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb5e=['exports','Dashboard','dashboards','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes'];(function(_0x5cc4de,_0x2df335){var _0x1bf255=function(_0x479413){while(--_0x479413){_0x5cc4de['push'](_0x5cc4de['shift']());}};_0x1bf255(++_0x2df335);}(_0xeb5e,0x17c));var _0xeeb5=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xeb5e[_0x45e98e];return _0x374dba;};'use strict';var _=require(_0xeeb5('0x0'));var util=require('util');var logger=require(_0xeeb5('0x1'))(_0xeeb5('0x2'));var moment=require(_0xeeb5('0x3'));var BPromise=require(_0xeeb5('0x4'));var rp=require(_0xeeb5('0x5'));var fs=require('fs');var path=require(_0xeeb5('0x6'));var rimraf=require(_0xeeb5('0x7'));var config=require(_0xeeb5('0x8'));var attributes=require(_0xeeb5('0x9'));module[_0xeeb5('0xa')]=function(_0x571898,_0x3b7a2c){return _0x571898['define'](_0xeeb5('0xb'),attributes,{'tableName':_0xeeb5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8dbb=['request-promise','path','../../config/environment','./dashboard.attributes','exports','define','lodash','util','../../config/logger','moment'];(function(_0x272fa1,_0x51f993){var _0x34c959=function(_0x1609db){while(--_0x1609db){_0x272fa1['push'](_0x272fa1['shift']());}};_0x34c959(++_0x51f993);}(_0x8dbb,0xce));var _0xb8db=function(_0x3a2643,_0x5410b6){_0x3a2643=_0x3a2643-0x0;var _0x4ea827=_0x8dbb[_0x3a2643];return _0x4ea827;};'use strict';var _=require(_0xb8db('0x0'));var util=require(_0xb8db('0x1'));var logger=require(_0xb8db('0x2'))('api');var moment=require(_0xb8db('0x3'));var BPromise=require('bluebird');var rp=require(_0xb8db('0x4'));var fs=require('fs');var path=require(_0xb8db('0x5'));var rimraf=require('rimraf');var config=require(_0xb8db('0x6'));var attributes=require(_0xb8db('0x7'));module[_0xb8db('0x8')]=function(_0x4e1370,_0x432de7){return _0x4e1370[_0xb8db('0x9')]('Dashboard',attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8cb767a..662e20e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba47=['error','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','./dashboard.socket','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s'];(function(_0x3cb9ce,_0x246df0){var _0x355a5c=function(_0x22eba1){while(--_0x22eba1){_0x3cb9ce['push'](_0x3cb9ce['shift']());}};_0x355a5c(++_0x246df0);}(_0xba47,0xc4));var _0x7ba4=function(_0x5e836a,_0x231a5d){_0x5e836a=_0x5e836a-0x0;var _0x1ad971=_0xba47[_0x5e836a];return _0x1ad971;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7ba4('0x0'));var BPromise=require(_0x7ba4('0x1'));var rs=require(_0x7ba4('0x2'));var fs=require('fs');var Redis=require(_0x7ba4('0x3'));var db=require(_0x7ba4('0x4'))['db'];var utils=require(_0x7ba4('0x5'));var logger=require(_0x7ba4('0x6'))('rpc');var config=require(_0x7ba4('0x7'));var jayson=require(_0x7ba4('0x8'));var client=jayson[_0x7ba4('0x9')]['http']({'port':0x232a});config[_0x7ba4('0xa')]=_[_0x7ba4('0xb')](config[_0x7ba4('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7ba4('0xa')]));require(_0x7ba4('0xc'))[_0x7ba4('0xd')](socket);function respondWithRpcPromise(_0x55c372,_0x2902b8,_0x5c7686){return new BPromise(function(_0x3f4d05,_0x533f34){return client[_0x7ba4('0xe')](_0x55c372,_0x5c7686)['then'](function(_0x459c33){logger[_0x7ba4('0xf')](_0x7ba4('0x10'),_0x2902b8,_0x7ba4('0x11'));logger[_0x7ba4('0x12')](_0x7ba4('0x13'),_0x2902b8,_0x7ba4('0x11'),JSON['stringify'](_0x459c33));if(_0x459c33['error']){if(_0x459c33['error']['code']===0x1f4){logger['error'](_0x7ba4('0x10'),_0x2902b8,_0x459c33[_0x7ba4('0x14')][_0x7ba4('0x15')]);return _0x533f34(_0x459c33[_0x7ba4('0x14')][_0x7ba4('0x15')]);}logger[_0x7ba4('0x14')](_0x7ba4('0x10'),_0x2902b8,_0x459c33[_0x7ba4('0x14')][_0x7ba4('0x15')]);return _0x3f4d05(_0x459c33[_0x7ba4('0x14')][_0x7ba4('0x15')]);}else{logger[_0x7ba4('0xf')](_0x7ba4('0x10'),_0x2902b8,'request\x20sent');_0x3f4d05(_0x459c33[_0x7ba4('0x16')][_0x7ba4('0x15')]);}})[_0x7ba4('0x17')](function(_0x4866d2){logger[_0x7ba4('0x14')](_0x7ba4('0x10'),_0x2902b8,_0x4866d2);_0x533f34(_0x4866d2);});});}
\ No newline at end of file
+var _0x86d7=['error','code','Dashboard,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','request','then','info','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x86d7,0x1b6));var _0x786d=function(_0x1855a2,_0x441076){_0x1855a2=_0x1855a2-0x0;var _0xbf7dd2=_0x86d7[_0x1855a2];return _0xbf7dd2;};'use strict';var _=require(_0x786d('0x0'));var util=require(_0x786d('0x1'));var moment=require(_0x786d('0x2'));var BPromise=require('bluebird');var rs=require(_0x786d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x786d('0x4'))['db'];var utils=require(_0x786d('0x5'));var logger=require(_0x786d('0x6'))(_0x786d('0x7'));var config=require(_0x786d('0x8'));var jayson=require(_0x786d('0x9'));var client=jayson[_0x786d('0xa')]['http']({'port':0x232a});config[_0x786d('0xb')]=_[_0x786d('0xc')](config[_0x786d('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x786d('0xd'))(new Redis(config[_0x786d('0xb')]));require('./dashboard.socket')[_0x786d('0xe')](socket);function respondWithRpcPromise(_0x4da57f,_0x3a018a,_0x164726){return new BPromise(function(_0x395cea,_0x4df596){return client[_0x786d('0xf')](_0x4da57f,_0x164726)[_0x786d('0x10')](function(_0x2b39bb){logger[_0x786d('0x11')]('Dashboard,\x20%s,\x20%s',_0x3a018a,_0x786d('0x12'));logger[_0x786d('0x13')](_0x786d('0x14'),_0x3a018a,_0x786d('0x12'),JSON['stringify'](_0x2b39bb));if(_0x2b39bb['error']){if(_0x2b39bb[_0x786d('0x15')][_0x786d('0x16')]===0x1f4){logger[_0x786d('0x15')](_0x786d('0x17'),_0x3a018a,_0x2b39bb[_0x786d('0x15')]['message']);return _0x4df596(_0x2b39bb[_0x786d('0x15')]['message']);}logger['error'](_0x786d('0x17'),_0x3a018a,_0x2b39bb[_0x786d('0x15')][_0x786d('0x18')]);return _0x395cea(_0x2b39bb[_0x786d('0x15')]['message']);}else{logger[_0x786d('0x11')]('Dashboard,\x20%s,\x20%s',_0x3a018a,'request\x20sent');_0x395cea(_0x2b39bb[_0x786d('0x19')][_0x786d('0x18')]);}})[_0x786d('0x1a')](function(_0x197619){logger[_0x786d('0x15')](_0x786d('0x17'),_0x3a018a,_0x197619);_0x4df596(_0x197619);});});}
\ No newline at end of file
index edff4f7..10a0266 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38ca=['emit','removeListener','register','dashboard:','save','remove'];(function(_0x40da58,_0x23cca4){var _0x61b669=function(_0x59915e){while(--_0x59915e){_0x40da58['push'](_0x40da58['shift']());}};_0x61b669(++_0x23cca4);}(_0x38ca,0x8e));var _0xa38c=function(_0x43d209,_0x586174){_0x43d209=_0x43d209-0x0;var _0x224032=_0x38ca[_0x43d209];return _0x224032;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xa38c('0x0'),_0xa38c('0x1'),'update'];function createListener(_0x474925,_0x4fd2f1){return function(_0x335227){_0x4fd2f1[_0xa38c('0x2')](_0x474925,_0x335227);};}function removeListener(_0x5213de,_0x5f499c){return function(){DashboardEvents[_0xa38c('0x3')](_0x5213de,_0x5f499c);};}exports[_0xa38c('0x4')]=function(_0x30016f){for(var _0x26d304=0x0,_0x37f15e=events['length'];_0x26d304<_0x37f15e;_0x26d304++){var _0x4b7989=events[_0x26d304];var _0x414d90=createListener(_0xa38c('0x5')+_0x4b7989,_0x30016f);DashboardEvents['on'](_0x4b7989,_0x414d90);}};
\ No newline at end of file
+var _0x6df3=['length','dashboard:','./dashboard.events','save','remove','update','emit'];(function(_0x25b4a4,_0x2e081b){var _0x707267=function(_0x440123){while(--_0x440123){_0x25b4a4['push'](_0x25b4a4['shift']());}};_0x707267(++_0x2e081b);}(_0x6df3,0x160));var _0x36df=function(_0x3dfc56,_0x20bb64){_0x3dfc56=_0x3dfc56-0x0;var _0x5496ed=_0x6df3[_0x3dfc56];return _0x5496ed;};'use strict';var DashboardEvents=require(_0x36df('0x0'));var events=[_0x36df('0x1'),_0x36df('0x2'),_0x36df('0x3')];function createListener(_0x5ec8b4,_0x479dbb){return function(_0x2bc193){_0x479dbb[_0x36df('0x4')](_0x5ec8b4,_0x2bc193);};}function removeListener(_0x314e23,_0x331b0c){return function(){DashboardEvents['removeListener'](_0x314e23,_0x331b0c);};}exports['register']=function(_0x2d7c15){for(var _0x485ecd=0x0,_0x4b872e=events[_0x36df('0x5')];_0x485ecd<_0x4b872e;_0x485ecd++){var _0x430879=events[_0x485ecd];var _0xe75b80=createListener(_0x36df('0x6')+_0x430879,_0x2d7c15);DashboardEvents['on'](_0x430879,_0xe75b80);}};
\ No newline at end of file
index 5387cc6..f28a2ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x31e3=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./dashboard.controller','isAuthenticated','/:id','show','get','/:id/items','post','create','/:id/clone','clone','addItem','put','destroy'];(function(_0x15411f,_0x42bef8){var _0x555650=function(_0x215e4f){while(--_0x215e4f){_0x15411f['push'](_0x15411f['shift']());}};_0x555650(++_0x42bef8);}(_0x31e3,0x161));var _0x331e=function(_0x3aba28,_0x4484a7){_0x3aba28=_0x3aba28-0x0;var _0x24f46d=_0x31e3[_0x3aba28];return _0x24f46d;};'use strict';var multer=require(_0x331e('0x0'));var util=require(_0x331e('0x1'));var path=require(_0x331e('0x2'));var timeout=require(_0x331e('0x3'));var express=require(_0x331e('0x4'));var router=express[_0x331e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x331e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x331e('0x7'));var controller=require(_0x331e('0x8'));router['get']('/',auth[_0x331e('0x9')](),controller['index']);router['get'](_0x331e('0xa'),auth[_0x331e('0x9')](),controller[_0x331e('0xb')]);router[_0x331e('0xc')](_0x331e('0xd'),auth[_0x331e('0x9')](),controller['getItems']);router[_0x331e('0xe')]('/',auth['isAuthenticated'](),controller[_0x331e('0xf')]);router[_0x331e('0xe')](_0x331e('0x10'),auth[_0x331e('0x9')](),controller[_0x331e('0x11')]);router[_0x331e('0xe')]('/:id/items',auth[_0x331e('0x9')](),controller[_0x331e('0x12')]);router[_0x331e('0x13')](_0x331e('0xa'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x331e('0x9')](),controller[_0x331e('0x14')]);module[_0x331e('0x15')]=router;
\ No newline at end of file
+var _0x0839=['../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','create','/:id/clone','addItem','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x17730a,_0x362127){var _0x485db1=function(_0x144233){while(--_0x144233){_0x17730a['push'](_0x17730a['shift']());}};_0x485db1(++_0x362127);}(_0x0839,0x100));var _0x9083=function(_0x97cd7e,_0x49038d){_0x97cd7e=_0x97cd7e-0x0;var _0x3b95d4=_0x0839[_0x97cd7e];return _0x3b95d4;};'use strict';var multer=require(_0x9083('0x0'));var util=require(_0x9083('0x1'));var path=require(_0x9083('0x2'));var timeout=require(_0x9083('0x3'));var express=require(_0x9083('0x4'));var router=express[_0x9083('0x5')]();var fs_extra=require(_0x9083('0x6'));var auth=require(_0x9083('0x7'));var interaction=require(_0x9083('0x8'));var config=require(_0x9083('0x9'));var controller=require(_0x9083('0xa'));router[_0x9083('0xb')]('/',auth[_0x9083('0xc')](),controller[_0x9083('0xd')]);router['get'](_0x9083('0xe'),auth[_0x9083('0xc')](),controller[_0x9083('0xf')]);router['get'](_0x9083('0x10'),auth[_0x9083('0xc')](),controller['getItems']);router['post']('/',auth['isAuthenticated'](),controller[_0x9083('0x11')]);router['post'](_0x9083('0x12'),auth['isAuthenticated'](),controller['clone']);router['post'](_0x9083('0x10'),auth[_0x9083('0xc')](),controller[_0x9083('0x13')]);router['put'](_0x9083('0xe'),auth[_0x9083('0xc')](),controller[_0x9083('0x14')]);router[_0x9083('0x15')](_0x9083('0xe'),auth[_0x9083('0xc')](),controller[_0x9083('0x16')]);module[_0x9083('0x17')]=router;
\ No newline at end of file
index 0567e90..bb2b3fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeff8=['sequelize','squel','exports','STRING','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3'];(function(_0xbad09a,_0x239fa2){var _0xaababe=function(_0x4f4e06){while(--_0x4f4e06){_0xbad09a['push'](_0xbad09a['shift']());}};_0xaababe(++_0x239fa2);}(_0xeff8,0x186));var _0x8eff=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0xeff8[_0x42bc91];return _0x3f5507;};'use strict';var Sequelize=require(_0x8eff('0x0'));var squel=require(_0x8eff('0x1'));var _=require('lodash');module[_0x8eff('0x2')]={'title':{'type':Sequelize[_0x8eff('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x8eff('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0x8eff('0x4')),'get':function(){try{return JSON[_0x8eff('0x5')](this[_0x8eff('0x6')](_0x8eff('0x7')));}catch(_0x4ac51c){return[];}},'set':function(_0x469641){try{this[_0x8eff('0x8')](_0x8eff('0x7'),JSON[_0x8eff('0x9')](_0x469641));}catch(_0x491f01){this[_0x8eff('0x8')](_0x8eff('0x7'),JSON[_0x8eff('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0x8eff('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x8eff('0xa')]},'background':{'type':Sequelize[_0x8eff('0x3')],'allowNull':![],'defaultValue':_0x8eff('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x8eff('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x8eff('0x3')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}};
\ No newline at end of file
+var _0x3f8a=['parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','TEXT','long'];(function(_0x3fc31d,_0x432bc9){var _0x31bb91=function(_0x1c1640){while(--_0x1c1640){_0x3fc31d['push'](_0x3fc31d['shift']());}};_0x31bb91(++_0x432bc9);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x264b91,_0x9c8a83){_0x264b91=_0x264b91-0x0;var _0x5c562d=_0x3f8a[_0x264b91];return _0x5c562d;};'use strict';var Sequelize=require(_0xa3f8('0x0'));var squel=require(_0xa3f8('0x1'));var _=require(_0xa3f8('0x2'));module[_0xa3f8('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xa3f8('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xa3f8('0x5')](_0xa3f8('0x6')),'get':function(){try{return JSON[_0xa3f8('0x7')](this[_0xa3f8('0x8')](_0xa3f8('0x9')));}catch(_0x39d2e4){return[];}},'set':function(_0x471464){try{this[_0xa3f8('0xa')](_0xa3f8('0x9'),JSON[_0xa3f8('0xb')](_0x471464));}catch(_0x268332){this[_0xa3f8('0xa')](_0xa3f8('0x9'),JSON[_0xa3f8('0xb')]([]));}}},'sizeX':{'type':Sequelize[_0xa3f8('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xa3f8('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0xa3f8('0xc')]},'background':{'type':Sequelize[_0xa3f8('0x4')],'allowNull':![],'defaultValue':_0xa3f8('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xa3f8('0x4')],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xa3f8('0x4')]},'titleFontSize':{'type':Sequelize[_0xa3f8('0xc')],'defaultValue':0xc}};
\ No newline at end of file
index 121cad1..295dc89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6c5=['status','end','json','offset','undefined','count','limit','set','apply','save','then','error','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','intersection','attributes','fields','length','includeAll','find','catch','destroy','type','iframe','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','sendStatus'];(function(_0x4e9c24,_0x37bfa3){var _0xc3407e=function(_0x4314fb){while(--_0x4314fb){_0x4e9c24['push'](_0x4e9c24['shift']());}};_0xc3407e(++_0x37bfa3);}(_0xa6c5,0xe4));var _0x5a6c=function(_0x21bdb9,_0x22ad79){_0x21bdb9=_0x21bdb9-0x0;var _0x49d8d8=_0xa6c5[_0x21bdb9];return _0x49d8d8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5a6c('0x0'));var zipdir=require(_0x5a6c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5a6c('0x2'));var moment=require('moment');var BPromise=require(_0x5a6c('0x3'));var Mustache=require(_0x5a6c('0x4'));var util=require(_0x5a6c('0x5'));var path=require(_0x5a6c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5a6c('0x7'));var fs=require('fs');var fs_extra=require(_0x5a6c('0x8'));var _=require(_0x5a6c('0x9'));var squel=require(_0x5a6c('0xa'));var crypto=require('crypto');var jsforce=require(_0x5a6c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5a6c('0xc'));var querystring=require(_0x5a6c('0xd'));var Papa=require('papaparse');var Redis=require(_0x5a6c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x5a6c('0xf'));var as=require(_0x5a6c('0x10'));var hardwareService=require(_0x5a6c('0x11'));var logger=require('../../config/logger')(_0x5a6c('0x12'));var utils=require('../../config/utils');var config=require(_0x5a6c('0x13'));var licenseUtil=require(_0x5a6c('0x14'));var db=require('../../mysqldb')['db'];config[_0x5a6c('0x15')]=_[_0x5a6c('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5a6c('0x17'))(new Redis(config[_0x5a6c('0x15')]));require(_0x5a6c('0x18'))[_0x5a6c('0x19')](socket);function respondWithStatusCode(_0x72c8e6,_0x1efea8){_0x1efea8=_0x1efea8||0xcc;return function(_0x34432e){if(_0x34432e){return _0x72c8e6[_0x5a6c('0x1a')](_0x1efea8);}return _0x72c8e6[_0x5a6c('0x1b')](_0x1efea8)[_0x5a6c('0x1c')]();};}function respondWithResult(_0x1073f0,_0x52b8cf){_0x52b8cf=_0x52b8cf||0xc8;return function(_0x664d3e){if(_0x664d3e){return _0x1073f0[_0x5a6c('0x1b')](_0x52b8cf)[_0x5a6c('0x1d')](_0x664d3e);}};}function respondWithFilteredResult(_0x2c3079,_0x203e00){return function(_0x1f92a5){if(_0x1f92a5){var _0x4d8b23=typeof _0x203e00[_0x5a6c('0x1e')]===_0x5a6c('0x1f')&&typeof _0x203e00['limit']===_0x5a6c('0x1f');var _0x2ac928=_0x1f92a5[_0x5a6c('0x20')];var _0x37ce40=_0x4d8b23?0x0:_0x203e00[_0x5a6c('0x1e')];var _0x1c24c3=_0x4d8b23?_0x1f92a5[_0x5a6c('0x20')]:_0x203e00[_0x5a6c('0x1e')]+_0x203e00[_0x5a6c('0x21')];var _0x3f9918;if(_0x1c24c3>=_0x2ac928){_0x1c24c3=_0x2ac928;_0x3f9918=0xc8;}else{_0x3f9918=0xce;}_0x2c3079[_0x5a6c('0x1b')](_0x3f9918);return _0x2c3079[_0x5a6c('0x22')]('Content-Range',_0x37ce40+'-'+_0x1c24c3+'/'+_0x2ac928)['json'](_0x1f92a5);}return null;};}function patchUpdates(_0x5857a8){return function(_0xf51b7){try{jsonpatch[_0x5a6c('0x23')](_0xf51b7,_0x5857a8,!![]);}catch(_0x3ea904){return BPromise['reject'](_0x3ea904);}return _0xf51b7[_0x5a6c('0x24')]();};}function saveUpdates(_0x16c727,_0xe8108b){return function(_0x2d2ec7){if(_0x2d2ec7){return _0x2d2ec7['update'](_0x16c727)[_0x5a6c('0x25')](function(_0x369b9e){return _0x369b9e;});}return null;};}function removeEntity(_0x43b41b,_0x50c14b){return function(_0x4f1532){if(_0x4f1532){return _0x4f1532['destroy']()[_0x5a6c('0x25')](function(){_0x43b41b[_0x5a6c('0x1b')](0xcc)[_0x5a6c('0x1c')]();});}};}function handleEntityNotFound(_0x316794,_0x39df0b){return function(_0x205bc6){if(!_0x205bc6){_0x316794[_0x5a6c('0x1a')](0x194);}return _0x205bc6;};}function handleError(_0x3fc57c,_0x3b3a5d){_0x3b3a5d=_0x3b3a5d||0x1f4;return function(_0x4450f8){logger[_0x5a6c('0x26')](_0x4450f8[_0x5a6c('0x27')]);if(_0x4450f8[_0x5a6c('0x28')]){delete _0x4450f8[_0x5a6c('0x28')];}_0x3fc57c[_0x5a6c('0x1b')](_0x3b3a5d)[_0x5a6c('0x29')](_0x4450f8);};}exports[_0x5a6c('0x2a')]=function(_0x592af4,_0xa25af4){var _0x1ac9e6={'raw':![],'where':{'id':_0x592af4[_0x5a6c('0x2b')]['id']}},_0x132ee0={};_0x132ee0[_0x5a6c('0x2c')]=_[_0x5a6c('0x2d')](db[_0x5a6c('0x2e')][_0x5a6c('0x2f')]);_0x132ee0[_0x5a6c('0x30')]=_[_0x5a6c('0x2d')](_0x592af4[_0x5a6c('0x30')]);_0x132ee0['filters']=_[_0x5a6c('0x31')](_0x132ee0['model'],_0x132ee0[_0x5a6c('0x30')]);_0x1ac9e6[_0x5a6c('0x32')]=_[_0x5a6c('0x31')](_0x132ee0[_0x5a6c('0x2c')],qs[_0x5a6c('0x33')](_0x592af4[_0x5a6c('0x30')][_0x5a6c('0x33')]));_0x1ac9e6[_0x5a6c('0x32')]=_0x1ac9e6[_0x5a6c('0x32')][_0x5a6c('0x34')]?_0x1ac9e6[_0x5a6c('0x32')]:_0x132ee0[_0x5a6c('0x2c')];if(_0x592af4[_0x5a6c('0x30')][_0x5a6c('0x35')]){_0x1ac9e6['include']=[{'all':!![]}];}_0x1ac9e6=_['merge']({},_0x1ac9e6,_0x592af4['options']);return db[_0x5a6c('0x2e')][_0x5a6c('0x36')](_0x1ac9e6)['then'](handleEntityNotFound(_0xa25af4,null))[_0x5a6c('0x25')](respondWithResult(_0xa25af4,null))[_0x5a6c('0x37')](handleError(_0xa25af4,null));};exports[_0x5a6c('0x38')]=function(_0x3c1652,_0x38b301){return db['DashboardItem'][_0x5a6c('0x36')]({'where':{'id':_0x3c1652['params']['id']}})['then'](handleEntityNotFound(_0x38b301,null))['then'](removeEntity(_0x38b301,null))['catch'](handleError(_0x38b301,null));};function widgetAttributes(_0xd99e10){try{switch(_0xd99e10[_0x5a6c('0x39')]){case _0x5a6c('0x3a'):return[{'name':'attrUrl','value':_0xd99e10['attrUrl']||(_0xd99e10[_0x5a6c('0x3b')]&&_0xd99e10[_0x5a6c('0x3b')][0x0]?_0xd99e10[_0x5a6c('0x3b')][0x0][_0x5a6c('0x3c')]:undefined)||_0x5a6c('0x3d')}];case _0x5a6c('0x3e'):return[{'name':_0x5a6c('0x3f'),'value':_0xd99e10[_0x5a6c('0x3f')]||(_0xd99e10[_0x5a6c('0x3b')]&&_0xd99e10[_0x5a6c('0x3b')][0x0]?_0xd99e10[_0x5a6c('0x3b')][0x0]['value']:undefined)||''}];case _0x5a6c('0x40'):return[{'name':_0x5a6c('0x41'),'value':_0xd99e10['attrHourFormat']||(_0xd99e10[_0x5a6c('0x3b')]&&_0xd99e10[_0x5a6c('0x3b')][0x0]?_0xd99e10['attrs'][0x0][_0x5a6c('0x3c')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0xd99e10[_0x5a6c('0x42')]||(_0xd99e10[_0x5a6c('0x3b')]&&_0xd99e10[_0x5a6c('0x3b')][0x1]?_0xd99e10[_0x5a6c('0x3b')][0x1][_0x5a6c('0x3c')]:undefined)||_0x5a6c('0x43')},{'name':_0x5a6c('0x44'),'value':_0xd99e10['attrFontSize']||(_0xd99e10[_0x5a6c('0x3b')]&&_0xd99e10['attrs'][0x2]?_0xd99e10[_0x5a6c('0x3b')][0x2][_0x5a6c('0x3c')]:undefined)||0xc}];case _0x5a6c('0x45'):return[{'name':_0x5a6c('0x46'),'value':_0xd99e10['attrMetric']||(_0xd99e10['attrs']&&_0xd99e10[_0x5a6c('0x3b')][0x0]?_0xd99e10[_0x5a6c('0x3b')][0x0][_0x5a6c('0x3c')]:undefined)||_0x5a6c('0x47')},{'name':_0x5a6c('0x48'),'value':_0xd99e10[_0x5a6c('0x48')]||(_0xd99e10[_0x5a6c('0x3b')]&&_0xd99e10[_0x5a6c('0x3b')][0x1]?_0xd99e10['attrs'][0x1][_0x5a6c('0x3c')]:undefined)||[]},{'name':_0x5a6c('0x44'),'value':_0xd99e10[_0x5a6c('0x44')]||(_0xd99e10['attrs']&&_0xd99e10[_0x5a6c('0x3b')][0x2]?_0xd99e10[_0x5a6c('0x3b')][0x2][_0x5a6c('0x3c')]:undefined)||0x14}];case'multibar-chart':case'pie-chart':return[{'name':'attrSerie1','value':_0xd99e10[_0x5a6c('0x49')]||(_0xd99e10[_0x5a6c('0x3b')]&&_0xd99e10[_0x5a6c('0x3b')][0x0]?_0xd99e10[_0x5a6c('0x3b')][0x0][_0x5a6c('0x3c')]:undefined)||'total'},{'name':_0x5a6c('0x4a'),'value':_0xd99e10[_0x5a6c('0x4a')]||(_0xd99e10[_0x5a6c('0x3b')]&&_0xd99e10[_0x5a6c('0x3b')][0x1]?_0xd99e10[_0x5a6c('0x3b')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0xd99e10[_0x5a6c('0x4b')]||(_0xd99e10[_0x5a6c('0x3b')]&&_0xd99e10[_0x5a6c('0x3b')][0x2]?_0xd99e10['attrs'][0x2]['value']:undefined)||null},{'name':_0x5a6c('0x48'),'value':_0xd99e10[_0x5a6c('0x48')]||(_0xd99e10[_0x5a6c('0x3b')]&&_0xd99e10[_0x5a6c('0x3b')][0x3]?_0xd99e10[_0x5a6c('0x3b')][0x3]['value']:undefined)||[]}];case _0x5a6c('0x4c'):return[{'name':_0x5a6c('0x4d'),'type':_0xd99e10[_0x5a6c('0x4e')]||(_0xd99e10[_0x5a6c('0x3b')]&&_0xd99e10[_0x5a6c('0x3b')][0x0]?_0xd99e10[_0x5a6c('0x3b')][0x0]['type']:undefined)||null,'value':_0xd99e10[_0x5a6c('0x4d')]||(_0xd99e10[_0x5a6c('0x3b')]&&_0xd99e10[_0x5a6c('0x3b')][0x0]?_0xd99e10['attrs'][0x0][_0x5a6c('0x3c')]:undefined)||null},{'name':_0x5a6c('0x4f'),'value':_0xd99e10['attrRefresh']||(_0xd99e10[_0x5a6c('0x3b')]&&_0xd99e10[_0x5a6c('0x3b')][0x1]?_0xd99e10[_0x5a6c('0x3b')][0x1][_0x5a6c('0x3c')]:undefined)||0x0}];default:return[];}}catch(_0x46c484){logger[_0x5a6c('0x26')](_0x5a6c('0x50'),JSON[_0x5a6c('0x51')](_0x46c484));return[];}}exports[_0x5a6c('0x52')]=function(_0x2694a5,_0x130261){if(_0x2694a5[_0x5a6c('0x53')]){_0x2694a5[_0x5a6c('0x53')]['attrs']=widgetAttributes(_0x2694a5[_0x5a6c('0x53')]);}return db[_0x5a6c('0x2e')][_0x5a6c('0x52')](_0x2694a5['body'],{})[_0x5a6c('0x25')](respondWithResult(_0x130261,0xc9))['catch'](handleError(_0x130261,null));};exports[_0x5a6c('0x54')]=function(_0x34d5c3,_0x39d8ae){if(_0x34d5c3[_0x5a6c('0x53')]['id']){delete _0x34d5c3[_0x5a6c('0x53')]['id'];}_0x34d5c3[_0x5a6c('0x53')]['attrs']=widgetAttributes(_0x34d5c3['body']);return db[_0x5a6c('0x2e')][_0x5a6c('0x36')]({'where':{'id':_0x34d5c3['params']['id']}})['then'](handleEntityNotFound(_0x39d8ae,null))['then'](saveUpdates(_0x34d5c3['body'],null))['then'](respondWithResult(_0x39d8ae,null))['catch'](handleError(_0x39d8ae,null));};
\ No newline at end of file
+var _0x711b=['limit','count','status','set','reject','save','then','destroy','stack','name','model','keys','DashboardItem','rawAttributes','query','intersection','attributes','fields','length','include','merge','options','find','catch','params','type','attrs','https://','custom','attrPath','value','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','error','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','json','offset','undefined'];(function(_0x45cd30,_0x4933cb){var _0x44fc2d=function(_0x25f41f){while(--_0x25f41f){_0x45cd30['push'](_0x45cd30['shift']());}};_0x44fc2d(++_0x4933cb);}(_0x711b,0x13e));var _0xb711=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x711b[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xb711('0x0'));var rimraf=require(_0xb711('0x1'));var zipdir=require(_0xb711('0x2'));var jsonpatch=require(_0xb711('0x3'));var rp=require(_0xb711('0x4'));var moment=require(_0xb711('0x5'));var BPromise=require(_0xb711('0x6'));var Mustache=require(_0xb711('0x7'));var util=require(_0xb711('0x8'));var path=require(_0xb711('0x9'));var sox=require(_0xb711('0xa'));var csv=require(_0xb711('0xb'));var ejs=require(_0xb711('0xc'));var fs=require('fs');var fs_extra=require(_0xb711('0xd'));var _=require(_0xb711('0xe'));var squel=require(_0xb711('0xf'));var crypto=require(_0xb711('0x10'));var jsforce=require(_0xb711('0x11'));var deskjs=require(_0xb711('0x12'));var toCsv=require(_0xb711('0xb'));var querystring=require(_0xb711('0x13'));var Papa=require('papaparse');var Redis=require(_0xb711('0x14'));var authService=require(_0xb711('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xb711('0x16'));var hardwareService=require(_0xb711('0x17'));var logger=require('../../config/logger')(_0xb711('0x18'));var utils=require(_0xb711('0x19'));var config=require(_0xb711('0x1a'));var licenseUtil=require(_0xb711('0x1b'));var db=require('../../mysqldb')['db'];config[_0xb711('0x1c')]=_[_0xb711('0x1d')](config['redis'],{'host':_0xb711('0x1e'),'port':0x18eb});var socket=require(_0xb711('0x1f'))(new Redis(config[_0xb711('0x1c')]));require(_0xb711('0x20'))[_0xb711('0x21')](socket);function respondWithStatusCode(_0x4812be,_0x24c7ef){_0x24c7ef=_0x24c7ef||0xcc;return function(_0x4a4966){if(_0x4a4966){return _0x4812be[_0xb711('0x22')](_0x24c7ef);}return _0x4812be['status'](_0x24c7ef)['end']();};}function respondWithResult(_0x5d83b9,_0x31e232){_0x31e232=_0x31e232||0xc8;return function(_0x38a519){if(_0x38a519){return _0x5d83b9['status'](_0x31e232)[_0xb711('0x23')](_0x38a519);}};}function respondWithFilteredResult(_0x3af09a,_0x56abef){return function(_0x522904){if(_0x522904){var _0x5dd815=typeof _0x56abef[_0xb711('0x24')]===_0xb711('0x25')&&typeof _0x56abef[_0xb711('0x26')]==='undefined';var _0x2b07e5=_0x522904[_0xb711('0x27')];var _0x1d3582=_0x5dd815?0x0:_0x56abef[_0xb711('0x24')];var _0x35f515=_0x5dd815?_0x522904['count']:_0x56abef[_0xb711('0x24')]+_0x56abef[_0xb711('0x26')];var _0x3c6a06;if(_0x35f515>=_0x2b07e5){_0x35f515=_0x2b07e5;_0x3c6a06=0xc8;}else{_0x3c6a06=0xce;}_0x3af09a[_0xb711('0x28')](_0x3c6a06);return _0x3af09a[_0xb711('0x29')]('Content-Range',_0x1d3582+'-'+_0x35f515+'/'+_0x2b07e5)[_0xb711('0x23')](_0x522904);}return null;};}function patchUpdates(_0x2c6331){return function(_0x41bcc3){try{jsonpatch['apply'](_0x41bcc3,_0x2c6331,!![]);}catch(_0x1b1331){return BPromise[_0xb711('0x2a')](_0x1b1331);}return _0x41bcc3[_0xb711('0x2b')]();};}function saveUpdates(_0x16146e,_0x4ea289){return function(_0x576ebb){if(_0x576ebb){return _0x576ebb['update'](_0x16146e)[_0xb711('0x2c')](function(_0x204d3f){return _0x204d3f;});}return null;};}function removeEntity(_0x391307,_0x3aa55c){return function(_0x601f35){if(_0x601f35){return _0x601f35[_0xb711('0x2d')]()[_0xb711('0x2c')](function(){_0x391307[_0xb711('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41330c,_0x4a323a){return function(_0x2165b5){if(!_0x2165b5){_0x41330c[_0xb711('0x22')](0x194);}return _0x2165b5;};}function handleError(_0x2b2646,_0xe21f7c){_0xe21f7c=_0xe21f7c||0x1f4;return function(_0xbb5cba){logger['error'](_0xbb5cba[_0xb711('0x2e')]);if(_0xbb5cba[_0xb711('0x2f')]){delete _0xbb5cba['name'];}_0x2b2646[_0xb711('0x28')](_0xe21f7c)['send'](_0xbb5cba);};}exports['show']=function(_0x75544e,_0x2c9a57){var _0x56c64c={'raw':![],'where':{'id':_0x75544e['params']['id']}},_0x56e53a={};_0x56e53a[_0xb711('0x30')]=_[_0xb711('0x31')](db[_0xb711('0x32')][_0xb711('0x33')]);_0x56e53a[_0xb711('0x34')]=_[_0xb711('0x31')](_0x75544e['query']);_0x56e53a['filters']=_[_0xb711('0x35')](_0x56e53a[_0xb711('0x30')],_0x56e53a[_0xb711('0x34')]);_0x56c64c[_0xb711('0x36')]=_['intersection'](_0x56e53a[_0xb711('0x30')],qs[_0xb711('0x37')](_0x75544e[_0xb711('0x34')]['fields']));_0x56c64c[_0xb711('0x36')]=_0x56c64c[_0xb711('0x36')][_0xb711('0x38')]?_0x56c64c[_0xb711('0x36')]:_0x56e53a[_0xb711('0x30')];if(_0x75544e[_0xb711('0x34')]['includeAll']){_0x56c64c[_0xb711('0x39')]=[{'all':!![]}];}_0x56c64c=_[_0xb711('0x3a')]({},_0x56c64c,_0x75544e[_0xb711('0x3b')]);return db[_0xb711('0x32')][_0xb711('0x3c')](_0x56c64c)[_0xb711('0x2c')](handleEntityNotFound(_0x2c9a57,null))[_0xb711('0x2c')](respondWithResult(_0x2c9a57,null))[_0xb711('0x3d')](handleError(_0x2c9a57,null));};exports['destroy']=function(_0x1b4f8f,_0x2f6fee){return db[_0xb711('0x32')][_0xb711('0x3c')]({'where':{'id':_0x1b4f8f[_0xb711('0x3e')]['id']}})[_0xb711('0x2c')](handleEntityNotFound(_0x2f6fee,null))[_0xb711('0x2c')](removeEntity(_0x2f6fee,null))['catch'](handleError(_0x2f6fee,null));};function widgetAttributes(_0x27c2fb){try{switch(_0x27c2fb[_0xb711('0x3f')]){case'iframe':return[{'name':'attrUrl','value':_0x27c2fb['attrUrl']||(_0x27c2fb['attrs']&&_0x27c2fb[_0xb711('0x40')][0x0]?_0x27c2fb[_0xb711('0x40')][0x0]['value']:undefined)||_0xb711('0x41')}];case _0xb711('0x42'):return[{'name':_0xb711('0x43'),'value':_0x27c2fb[_0xb711('0x43')]||(_0x27c2fb[_0xb711('0x40')]&&_0x27c2fb[_0xb711('0x40')][0x0]?_0x27c2fb[_0xb711('0x40')][0x0][_0xb711('0x44')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x27c2fb['attrHourFormat']||(_0x27c2fb[_0xb711('0x40')]&&_0x27c2fb['attrs'][0x0]?_0x27c2fb[_0xb711('0x40')][0x0][_0xb711('0x44')]:undefined)||_0xb711('0x45')},{'name':_0xb711('0x46'),'value':_0x27c2fb[_0xb711('0x46')]||(_0x27c2fb['attrs']&&_0x27c2fb['attrs'][0x1]?_0x27c2fb[_0xb711('0x40')][0x1]['value']:undefined)||'0.00'},{'name':_0xb711('0x47'),'value':_0x27c2fb[_0xb711('0x47')]||(_0x27c2fb[_0xb711('0x40')]&&_0x27c2fb[_0xb711('0x40')][0x2]?_0x27c2fb[_0xb711('0x40')][0x2][_0xb711('0x44')]:undefined)||0xc}];case _0xb711('0x48'):return[{'name':'attrMetric','value':_0x27c2fb[_0xb711('0x49')]||(_0x27c2fb[_0xb711('0x40')]&&_0x27c2fb[_0xb711('0x40')][0x0]?_0x27c2fb[_0xb711('0x40')][0x0]['value']:undefined)||_0xb711('0x4a')},{'name':_0xb711('0x4b'),'value':_0x27c2fb[_0xb711('0x4b')]||(_0x27c2fb[_0xb711('0x40')]&&_0x27c2fb[_0xb711('0x40')][0x1]?_0x27c2fb[_0xb711('0x40')][0x1][_0xb711('0x44')]:undefined)||[]},{'name':_0xb711('0x47'),'value':_0x27c2fb[_0xb711('0x47')]||(_0x27c2fb[_0xb711('0x40')]&&_0x27c2fb['attrs'][0x2]?_0x27c2fb[_0xb711('0x40')][0x2][_0xb711('0x44')]:undefined)||0x14}];case _0xb711('0x4c'):case _0xb711('0x4d'):return[{'name':_0xb711('0x4e'),'value':_0x27c2fb[_0xb711('0x4e')]||(_0x27c2fb[_0xb711('0x40')]&&_0x27c2fb[_0xb711('0x40')][0x0]?_0x27c2fb['attrs'][0x0][_0xb711('0x44')]:undefined)||_0xb711('0x4a')},{'name':_0xb711('0x4f'),'value':_0x27c2fb[_0xb711('0x4f')]||(_0x27c2fb[_0xb711('0x40')]&&_0x27c2fb[_0xb711('0x40')][0x1]?_0x27c2fb['attrs'][0x1][_0xb711('0x44')]:undefined)||null},{'name':_0xb711('0x50'),'value':_0x27c2fb['attrSerie3']||(_0x27c2fb[_0xb711('0x40')]&&_0x27c2fb[_0xb711('0x40')][0x2]?_0x27c2fb['attrs'][0x2][_0xb711('0x44')]:undefined)||null},{'name':_0xb711('0x4b'),'value':_0x27c2fb[_0xb711('0x4b')]||(_0x27c2fb['attrs']&&_0x27c2fb[_0xb711('0x40')][0x3]?_0x27c2fb[_0xb711('0x40')][0x3][_0xb711('0x44')]:undefined)||[]}];case _0xb711('0x51'):return[{'name':_0xb711('0x52'),'type':_0x27c2fb[_0xb711('0x53')]||(_0x27c2fb[_0xb711('0x40')]&&_0x27c2fb[_0xb711('0x40')][0x0]?_0x27c2fb[_0xb711('0x40')][0x0]['type']:undefined)||null,'value':_0x27c2fb['attrReport']||(_0x27c2fb['attrs']&&_0x27c2fb['attrs'][0x0]?_0x27c2fb[_0xb711('0x40')][0x0][_0xb711('0x44')]:undefined)||null},{'name':'attrRefresh','value':_0x27c2fb[_0xb711('0x54')]||(_0x27c2fb['attrs']&&_0x27c2fb[_0xb711('0x40')][0x1]?_0x27c2fb[_0xb711('0x40')][0x1][_0xb711('0x44')]:undefined)||0x0}];default:return[];}}catch(_0x375b97){logger[_0xb711('0x55')]('widgetAttributes:\x20%s',JSON[_0xb711('0x56')](_0x375b97));return[];}}exports[_0xb711('0x57')]=function(_0x5d23a7,_0xf55f62){if(_0x5d23a7[_0xb711('0x58')]){_0x5d23a7[_0xb711('0x58')][_0xb711('0x40')]=widgetAttributes(_0x5d23a7['body']);}return db[_0xb711('0x32')][_0xb711('0x57')](_0x5d23a7[_0xb711('0x58')],{})[_0xb711('0x2c')](respondWithResult(_0xf55f62,0xc9))['catch'](handleError(_0xf55f62,null));};exports['update']=function(_0x305870,_0x5964e5){if(_0x305870[_0xb711('0x58')]['id']){delete _0x305870['body']['id'];}_0x305870[_0xb711('0x58')]['attrs']=widgetAttributes(_0x305870[_0xb711('0x58')]);return db['DashboardItem'][_0xb711('0x3c')]({'where':{'id':_0x305870['params']['id']}})['then'](handleEntityNotFound(_0x5964e5,null))[_0xb711('0x2c')](saveUpdates(_0x305870[_0xb711('0x58')],null))[_0xb711('0x2c')](respondWithResult(_0x5964e5,null))[_0xb711('0x3d')](handleError(_0x5964e5,null));};
\ No newline at end of file
index 2ea11b6..a6b1bfb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6286=['hasOwnProperty','hook','events','../../mysqldb','DashboardItem','save','remove','emit'];(function(_0x16c1e6,_0x2cda03){var _0x210c98=function(_0x43f363){while(--_0x43f363){_0x16c1e6['push'](_0x16c1e6['shift']());}};_0x210c98(++_0x2cda03);}(_0x6286,0x1ea));var _0x6628=function(_0xff6f91,_0x2dacd2){_0xff6f91=_0xff6f91-0x0;var _0x1c7f2b=_0x6286[_0xff6f91];return _0x1c7f2b;};'use strict';var EventEmitter=require(_0x6628('0x0'));var DashboardItem=require(_0x6628('0x1'))['db'][_0x6628('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6628('0x3'),'afterUpdate':'update','afterDestroy':_0x6628('0x4')};function emitEvent(_0x97cfc){return function(_0x20ef84,_0x447089,_0x435cb4){DashboardItemEvents[_0x6628('0x5')](_0x97cfc+':'+_0x20ef84['id'],_0x20ef84);DashboardItemEvents[_0x6628('0x5')](_0x97cfc,_0x20ef84);_0x435cb4(null);};}for(var e in events){if(events[_0x6628('0x6')](e)){var event=events[e];DashboardItem[_0x6628('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents;
\ No newline at end of file
+var _0xdae1=['DashboardItem','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdae1,0x76));var _0x1dae=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xdae1[_0x36dfbd];return _0x4ecad9;};'use strict';var EventEmitter=require(_0x1dae('0x0'));var DashboardItem=require(_0x1dae('0x1'))['db'][_0x1dae('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1dae('0x3'),'afterUpdate':_0x1dae('0x4'),'afterDestroy':_0x1dae('0x5')};function emitEvent(_0x2f5f5d){return function(_0x34f6ee,_0x503bc8,_0x487f7f){DashboardItemEvents[_0x1dae('0x6')](_0x2f5f5d+':'+_0x34f6ee['id'],_0x34f6ee);DashboardItemEvents[_0x1dae('0x6')](_0x2f5f5d,_0x34f6ee);_0x487f7f(null);};}for(var e in events){if(events[_0x1dae('0x7')](e)){var event=events[e];DashboardItem[_0x1dae('0x8')](e,emitEvent(event));}}module[_0x1dae('0x9')]=DashboardItemEvents;
\ No newline at end of file
index 945cf1a..dfa6fe7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xebe1=['lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','exports','define','DashboardItem','dashboard_items'];(function(_0x1c7d93,_0x3c5644){var _0x2b51aa=function(_0x5c0d10){while(--_0x5c0d10){_0x1c7d93['push'](_0x1c7d93['shift']());}};_0x2b51aa(++_0x3c5644);}(_0xebe1,0xf2));var _0x1ebe=function(_0x9f7cd4,_0x46d39f){_0x9f7cd4=_0x9f7cd4-0x0;var _0x3a21e9=_0xebe1[_0x9f7cd4];return _0x3a21e9;};'use strict';var _=require(_0x1ebe('0x0'));var util=require(_0x1ebe('0x1'));var logger=require(_0x1ebe('0x2'))(_0x1ebe('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1ebe('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1ebe('0x5'));var config=require(_0x1ebe('0x6'));var attributes=require('./dashboardItem.attributes');module[_0x1ebe('0x7')]=function(_0x4c0930,_0x47e3ac){return _0x4c0930[_0x1ebe('0x8')](_0x1ebe('0x9'),attributes,{'tableName':_0x1ebe('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3178=['./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','api','bluebird','request-promise','rimraf'];(function(_0x22d7e6,_0xa620e7){var _0x72bc58=function(_0x2c75f6){while(--_0x2c75f6){_0x22d7e6['push'](_0x22d7e6['shift']());}};_0x72bc58(++_0xa620e7);}(_0x3178,0x176));var _0x8317=function(_0x568361,_0x579865){_0x568361=_0x568361-0x0;var _0x2d90a=_0x3178[_0x568361];return _0x2d90a;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8317('0x0'));var moment=require('moment');var BPromise=require(_0x8317('0x1'));var rp=require(_0x8317('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8317('0x3'));var config=require('../../config/environment');var attributes=require(_0x8317('0x4'));module[_0x8317('0x5')]=function(_0x1677b7,_0x649d81){return _0x1677b7[_0x8317('0x6')](_0x8317('0x7'),attributes,{'tableName':_0x8317('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e98c9a3..97634de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5da9=['info','request\x20sent','debug','stringify','error','DashboardItem,\x20%s,\x20%s','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','request','then'];(function(_0x26e572,_0x51d21c){var _0x1a68ae=function(_0x3187a2){while(--_0x3187a2){_0x26e572['push'](_0x26e572['shift']());}};_0x1a68ae(++_0x51d21c);}(_0x5da9,0x11b));var _0x95da=function(_0x48a96f,_0x530059){_0x48a96f=_0x48a96f-0x0;var _0x3ff3ef=_0x5da9[_0x48a96f];return _0x3ff3ef;};'use strict';var _=require(_0x95da('0x0'));var util=require(_0x95da('0x1'));var moment=require(_0x95da('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x95da('0x3'));var db=require(_0x95da('0x4'))['db'];var utils=require(_0x95da('0x5'));var logger=require('../../config/logger')(_0x95da('0x6'));var config=require('../../config/environment');var jayson=require(_0x95da('0x7'));var client=jayson[_0x95da('0x8')][_0x95da('0x9')]({'port':0x232a});config[_0x95da('0xa')]=_[_0x95da('0xb')](config[_0x95da('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x95da('0xc'))(new Redis(config[_0x95da('0xa')]));require(_0x95da('0xd'))[_0x95da('0xe')](socket);function respondWithRpcPromise(_0x41ac64,_0x45cc5f,_0x478e41){return new BPromise(function(_0x2520e4,_0x3a0be7){return client[_0x95da('0xf')](_0x41ac64,_0x478e41)[_0x95da('0x10')](function(_0x1a3dfe){logger[_0x95da('0x11')]('DashboardItem,\x20%s,\x20%s',_0x45cc5f,_0x95da('0x12'));logger[_0x95da('0x13')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x45cc5f,'request\x20sent',JSON[_0x95da('0x14')](_0x1a3dfe));if(_0x1a3dfe['error']){if(_0x1a3dfe[_0x95da('0x15')]['code']===0x1f4){logger[_0x95da('0x15')](_0x95da('0x16'),_0x45cc5f,_0x1a3dfe['error']['message']);return _0x3a0be7(_0x1a3dfe[_0x95da('0x15')][_0x95da('0x17')]);}logger[_0x95da('0x15')]('DashboardItem,\x20%s,\x20%s',_0x45cc5f,_0x1a3dfe[_0x95da('0x15')][_0x95da('0x17')]);return _0x2520e4(_0x1a3dfe[_0x95da('0x15')]['message']);}else{logger['info'](_0x95da('0x16'),_0x45cc5f,_0x95da('0x12'));_0x2520e4(_0x1a3dfe['result'][_0x95da('0x17')]);}})[_0x95da('0x18')](function(_0x5aede7){logger[_0x95da('0x15')](_0x95da('0x16'),_0x45cc5f,_0x5aede7);_0x3a0be7(_0x5aede7);});});}
\ No newline at end of file
+var _0xdcd4=['./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter'];(function(_0x38fb0d,_0x52b5db){var _0x30a5d6=function(_0x31eba6){while(--_0x31eba6){_0x38fb0d['push'](_0x38fb0d['shift']());}};_0x30a5d6(++_0x52b5db);}(_0xdcd4,0xcb));var _0x4dcd=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xdcd4[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x4dcd('0x0'));var util=require('util');var moment=require(_0x4dcd('0x1'));var BPromise=require(_0x4dcd('0x2'));var rs=require(_0x4dcd('0x3'));var fs=require('fs');var Redis=require(_0x4dcd('0x4'));var db=require(_0x4dcd('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4dcd('0x6'));var config=require(_0x4dcd('0x7'));var jayson=require(_0x4dcd('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x4dcd('0x9')]=_[_0x4dcd('0xa')](config[_0x4dcd('0x9')],{'host':_0x4dcd('0xb'),'port':0x18eb});var socket=require(_0x4dcd('0xc'))(new Redis(config[_0x4dcd('0x9')]));require(_0x4dcd('0xd'))[_0x4dcd('0xe')](socket);function respondWithRpcPromise(_0x140504,_0x72691a,_0x43725e){return new BPromise(function(_0xa869d0,_0x238674){return client[_0x4dcd('0xf')](_0x140504,_0x43725e)[_0x4dcd('0x10')](function(_0x415b08){logger[_0x4dcd('0x11')](_0x4dcd('0x12'),_0x72691a,_0x4dcd('0x13'));logger[_0x4dcd('0x14')](_0x4dcd('0x15'),_0x72691a,_0x4dcd('0x13'),JSON[_0x4dcd('0x16')](_0x415b08));if(_0x415b08[_0x4dcd('0x17')]){if(_0x415b08[_0x4dcd('0x17')]['code']===0x1f4){logger[_0x4dcd('0x17')]('DashboardItem,\x20%s,\x20%s',_0x72691a,_0x415b08[_0x4dcd('0x17')][_0x4dcd('0x18')]);return _0x238674(_0x415b08['error'][_0x4dcd('0x18')]);}logger[_0x4dcd('0x17')](_0x4dcd('0x12'),_0x72691a,_0x415b08[_0x4dcd('0x17')][_0x4dcd('0x18')]);return _0xa869d0(_0x415b08[_0x4dcd('0x17')]['message']);}else{logger['info'](_0x4dcd('0x12'),_0x72691a,'request\x20sent');_0xa869d0(_0x415b08[_0x4dcd('0x19')][_0x4dcd('0x18')]);}})[_0x4dcd('0x1a')](function(_0x105833){logger[_0x4dcd('0x17')]('DashboardItem,\x20%s,\x20%s',_0x72691a,_0x105833);_0x238674(_0x105833);});});}
\ No newline at end of file
index 534c3be..5e317ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66cc=['update','emit','removeListener','length','dashboardItem:','./dashboardItem.events','save','remove'];(function(_0x4ca2dc,_0x54fc26){var _0x2f7ada=function(_0x118482){while(--_0x118482){_0x4ca2dc['push'](_0x4ca2dc['shift']());}};_0x2f7ada(++_0x54fc26);}(_0x66cc,0xbd));var _0xc66c=function(_0x467a26,_0x59aca9){_0x467a26=_0x467a26-0x0;var _0x5420e7=_0x66cc[_0x467a26];return _0x5420e7;};'use strict';var DashboardItemEvents=require(_0xc66c('0x0'));var events=[_0xc66c('0x1'),_0xc66c('0x2'),_0xc66c('0x3')];function createListener(_0x2d0c9b,_0x23b4b0){return function(_0x1c3125){_0x23b4b0[_0xc66c('0x4')](_0x2d0c9b,_0x1c3125);};}function removeListener(_0x30e464,_0x4d5cf3){return function(){DashboardItemEvents[_0xc66c('0x5')](_0x30e464,_0x4d5cf3);};}exports['register']=function(_0x57a94b){for(var _0x28da4b=0x0,_0x349046=events[_0xc66c('0x6')];_0x28da4b<_0x349046;_0x28da4b++){var _0x2ea215=events[_0x28da4b];var _0x170847=createListener(_0xc66c('0x7')+_0x2ea215,_0x57a94b);DashboardItemEvents['on'](_0x2ea215,_0x170847);}};
\ No newline at end of file
+var _0x4245=['emit','removeListener','register','./dashboardItem.events','save','remove','update'];(function(_0x5cd9f1,_0x3848ec){var _0x1035ca=function(_0x3b9773){while(--_0x3b9773){_0x5cd9f1['push'](_0x5cd9f1['shift']());}};_0x1035ca(++_0x3848ec);}(_0x4245,0x199));var _0x5424=function(_0x419dd8,_0x8aaad0){_0x419dd8=_0x419dd8-0x0;var _0x4395dd=_0x4245[_0x419dd8];return _0x4395dd;};'use strict';var DashboardItemEvents=require(_0x5424('0x0'));var events=[_0x5424('0x1'),_0x5424('0x2'),_0x5424('0x3')];function createListener(_0x547399,_0x313012){return function(_0x155dc3){_0x313012[_0x5424('0x4')](_0x547399,_0x155dc3);};}function removeListener(_0x2840d9,_0x122d61){return function(){DashboardItemEvents[_0x5424('0x5')](_0x2840d9,_0x122d61);};}exports[_0x5424('0x6')]=function(_0x241436){for(var _0x2f102e=0x0,_0x9e3b43=events['length'];_0x2f102e<_0x9e3b43;_0x2f102e++){var _0x178709=events[_0x2f102e];var _0x35243e=createListener('dashboardItem:'+_0x178709,_0x241436);DashboardItemEvents['on'](_0x178709,_0x35243e);}};
\ No newline at end of file
index 33ffc5a..4e05e66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc079=['Router','../../config/environment','./dashboardItem.controller','/:id','show','isAuthenticated','create','put','delete','destroy','multer','util','path'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc079,0xda));var _0x9c07=function(_0x291fc4,_0x48a87e){_0x291fc4=_0x291fc4-0x0;var _0x547c5f=_0xc079[_0x291fc4];return _0x547c5f;};'use strict';var multer=require(_0x9c07('0x0'));var util=require(_0x9c07('0x1'));var path=require(_0x9c07('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9c07('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9c07('0x4'));var controller=require(_0x9c07('0x5'));router['get'](_0x9c07('0x6'),auth['isAuthenticated'](),controller[_0x9c07('0x7')]);router['post']('/',auth[_0x9c07('0x8')](),controller[_0x9c07('0x9')]);router[_0x9c07('0xa')](_0x9c07('0x6'),auth[_0x9c07('0x8')](),controller['update']);router[_0x9c07('0xb')](_0x9c07('0x6'),auth[_0x9c07('0x8')](),controller[_0x9c07('0xc')]);module['exports']=router;
\ No newline at end of file
+var _0xd837=['multer','util','path','express','Router','../../components/auth/service','./dashboardItem.controller','get','isAuthenticated','show','create','put','/:id','update','destroy','exports'];(function(_0x104112,_0x342eb6){var _0x394ab4=function(_0x48db18){while(--_0x48db18){_0x104112['push'](_0x104112['shift']());}};_0x394ab4(++_0x342eb6);}(_0xd837,0xd0));var _0x7d83=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xd837[_0x5ddb1c];return _0x354adc;};'use strict';var multer=require(_0x7d83('0x0'));var util=require(_0x7d83('0x1'));var path=require(_0x7d83('0x2'));var timeout=require('connect-timeout');var express=require(_0x7d83('0x3'));var router=express[_0x7d83('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7d83('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7d83('0x6'));router[_0x7d83('0x7')]('/:id',auth[_0x7d83('0x8')](),controller[_0x7d83('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7d83('0xa')]);router[_0x7d83('0xb')](_0x7d83('0xc'),auth[_0x7d83('0x8')](),controller[_0x7d83('0xd')]);router['delete'](_0x7d83('0xc'),auth[_0x7d83('0x8')](),controller[_0x7d83('0xe')]);module[_0x7d83('0xf')]=router;
\ No newline at end of file
index 3c059d8..0f0ea01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa31c=['exports','ENUM','first','second','third','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa31c,0x1b5));var _0xca31=function(_0x26a10d,_0xe5c001){_0x26a10d=_0x26a10d-0x0;var _0xf90201=_0xa31c[_0x26a10d];return _0xf90201;};'use strict';var Sequelize=require(_0xca31('0x0'));module[_0xca31('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0xca31('0x2')](_0xca31('0x3'),_0xca31('0x4'),_0xca31('0x5')),'allowNull':![],'defaultValue':_0xca31('0x3')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x820f=['ENUM','third','first','exports','STRING'];(function(_0x5a89ea,_0x436388){var _0x21193d=function(_0x1a9118){while(--_0x1a9118){_0x5a89ea['push'](_0x5a89ea['shift']());}};_0x21193d(++_0x436388);}(_0x820f,0xd0));var _0xf820=function(_0xd8baf3,_0x238fd0){_0xd8baf3=_0xd8baf3-0x0;var _0x492838=_0x820f[_0xd8baf3];return _0x492838;};'use strict';var Sequelize=require('sequelize');module[_0xf820('0x0')]={'name':{'type':Sequelize[_0xf820('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0xf820('0x2')]('first','second',_0xf820('0x3')),'allowNull':![],'defaultValue':_0xf820('0x4')},'description':{'type':Sequelize[_0xf820('0x1')]}};
\ No newline at end of file
index cd2ebbe..78344d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd48=['hasOwnProperty','nolimit','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','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','rimraf','zip-dir','fast-json-patch','request-promise','moment','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/environment','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','then','destroy','get','Dispositions','UserProfileResource','end','error','name','map','Disposition','fieldName','query','keys','filters','intersection','model','attributes','fields'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xfd48,0x168));var _0x8fd4=function(_0x398d0d,_0xc386ff){_0x398d0d=_0x398d0d-0x0;var _0x1eb3b0=_0xfd48[_0x398d0d];return _0x1eb3b0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8fd4('0x0'));var zipdir=require(_0x8fd4('0x1'));var jsonpatch=require(_0x8fd4('0x2'));var rp=require(_0x8fd4('0x3'));var moment=require(_0x8fd4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8fd4('0x5'));var util=require('util');var path=require(_0x8fd4('0x6'));var sox=require(_0x8fd4('0x7'));var csv=require(_0x8fd4('0x8'));var ejs=require(_0x8fd4('0x9'));var fs=require('fs');var fs_extra=require(_0x8fd4('0xa'));var _=require('lodash');var squel=require(_0x8fd4('0xb'));var crypto=require(_0x8fd4('0xc'));var jsforce=require(_0x8fd4('0xd'));var deskjs=require(_0x8fd4('0xe'));var toCsv=require(_0x8fd4('0x8'));var querystring=require(_0x8fd4('0xf'));var Papa=require(_0x8fd4('0x10'));var Redis=require(_0x8fd4('0x11'));var authService=require(_0x8fd4('0x12'));var qs=require(_0x8fd4('0x13'));var as=require(_0x8fd4('0x14'));var hardwareService=require(_0x8fd4('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x8fd4('0x16'));var licenseUtil=require(_0x8fd4('0x17'));var db=require(_0x8fd4('0x18'))['db'];function respondWithStatusCode(_0xf0e080,_0x36bc96){_0x36bc96=_0x36bc96||0xcc;return function(_0x5bcf00){if(_0x5bcf00){return _0xf0e080[_0x8fd4('0x19')](_0x36bc96);}return _0xf0e080[_0x8fd4('0x1a')](_0x36bc96)['end']();};}function respondWithResult(_0x240331,_0x11423a){_0x11423a=_0x11423a||0xc8;return function(_0x4691b0){if(_0x4691b0){return _0x240331['status'](_0x11423a)['json'](_0x4691b0);}};}function respondWithFilteredResult(_0x52efe7,_0x3bebba){return function(_0x2307d3){if(_0x2307d3){var _0x118ce7=typeof _0x3bebba['offset']===_0x8fd4('0x1b')&&typeof _0x3bebba[_0x8fd4('0x1c')]==='undefined';var _0x4ce30f=_0x2307d3[_0x8fd4('0x1d')];var _0x1de077=_0x118ce7?0x0:_0x3bebba[_0x8fd4('0x1e')];var _0x43c66e=_0x118ce7?_0x2307d3[_0x8fd4('0x1d')]:_0x3bebba[_0x8fd4('0x1e')]+_0x3bebba[_0x8fd4('0x1c')];var _0x4a7958;if(_0x43c66e>=_0x4ce30f){_0x43c66e=_0x4ce30f;_0x4a7958=0xc8;}else{_0x4a7958=0xce;}_0x52efe7['status'](_0x4a7958);return _0x52efe7[_0x8fd4('0x1f')](_0x8fd4('0x20'),_0x1de077+'-'+_0x43c66e+'/'+_0x4ce30f)[_0x8fd4('0x21')](_0x2307d3);}return null;};}function patchUpdates(_0x30fe18){return function(_0x3e2bc5){try{jsonpatch[_0x8fd4('0x22')](_0x3e2bc5,_0x30fe18,!![]);}catch(_0x40bdb4){return BPromise[_0x8fd4('0x23')](_0x40bdb4);}return _0x3e2bc5['save']();};}function saveUpdates(_0x3b1be5,_0x54359a){return function(_0x410fec){if(_0x410fec){return _0x410fec[_0x8fd4('0x24')](_0x3b1be5)[_0x8fd4('0x25')](function(_0x140358){return _0x140358;});}return null;};}function removeEntity(_0x33fccb,_0x117ef2){return function(_0x541534){if(_0x541534){return _0x541534[_0x8fd4('0x26')]()[_0x8fd4('0x25')](function(){var _0x30f645=_0x541534[_0x8fd4('0x27')]({'plain':!![]});var _0xc5777a=_0x8fd4('0x28');return db[_0x8fd4('0x29')]['destroy']({'where':{'type':_0xc5777a,'resourceId':_0x30f645['id']}})['then'](function(){return _0x541534;});})[_0x8fd4('0x25')](function(){_0x33fccb[_0x8fd4('0x1a')](0xcc)[_0x8fd4('0x2a')]();});}};}function handleEntityNotFound(_0x46f1b7,_0x2f09ce){return function(_0x20e33d){if(!_0x20e33d){_0x46f1b7[_0x8fd4('0x19')](0x194);}return _0x20e33d;};}function handleError(_0x3cc5ab,_0x5b0fd0){_0x5b0fd0=_0x5b0fd0||0x1f4;return function(_0x1bcd53){logger[_0x8fd4('0x2b')](_0x1bcd53['stack']);if(_0x1bcd53[_0x8fd4('0x2c')]){delete _0x1bcd53[_0x8fd4('0x2c')];}_0x3cc5ab[_0x8fd4('0x1a')](_0x5b0fd0)['send'](_0x1bcd53);};}exports['index']=function(_0xc73996,_0x56b493){var _0x331864={},_0xd993c4={},_0x19dd98={'count':0x0,'rows':[]};var _0xbb533c=_[_0x8fd4('0x2d')](db[_0x8fd4('0x2e')]['rawAttributes'],function(_0x5d6c6d){return{'name':_0x5d6c6d[_0x8fd4('0x2f')],'type':_0x5d6c6d['type']['key']};});_0xd993c4['model']=_[_0x8fd4('0x2d')](_0xbb533c,_0x8fd4('0x2c'));_0xd993c4[_0x8fd4('0x30')]=_[_0x8fd4('0x31')](_0xc73996[_0x8fd4('0x30')]);_0xd993c4[_0x8fd4('0x32')]=_[_0x8fd4('0x33')](_0xd993c4[_0x8fd4('0x34')],_0xd993c4[_0x8fd4('0x30')]);_0x331864[_0x8fd4('0x35')]=_[_0x8fd4('0x33')](_0xd993c4[_0x8fd4('0x34')],qs[_0x8fd4('0x36')](_0xc73996[_0x8fd4('0x30')][_0x8fd4('0x36')]));_0x331864['attributes']=_0x331864[_0x8fd4('0x35')]['length']?_0x331864[_0x8fd4('0x35')]:_0xd993c4[_0x8fd4('0x34')];if(!_0xc73996[_0x8fd4('0x30')][_0x8fd4('0x37')](_0x8fd4('0x38'))){_0x331864[_0x8fd4('0x1c')]=qs[_0x8fd4('0x1c')](_0xc73996[_0x8fd4('0x30')][_0x8fd4('0x1c')]);_0x331864[_0x8fd4('0x1e')]=qs[_0x8fd4('0x1e')](_0xc73996[_0x8fd4('0x30')][_0x8fd4('0x1e')]);}_0x331864[_0x8fd4('0x39')]=qs[_0x8fd4('0x3a')](_0xc73996['query'][_0x8fd4('0x3a')]);_0x331864['where']=qs[_0x8fd4('0x32')](_['pick'](_0xc73996[_0x8fd4('0x30')],_0xd993c4['filters']),_0xbb533c);if(_0xc73996[_0x8fd4('0x30')][_0x8fd4('0x3b')]){_0x331864[_0x8fd4('0x3c')]=_[_0x8fd4('0x3d')](_0x331864[_0x8fd4('0x3c')],{'$or':_[_0x8fd4('0x2d')](_0xbb533c,function(_0x4dc58d){if(_0x4dc58d[_0x8fd4('0x3e')]!==_0x8fd4('0x3f')){var _0xe6215d={};_0xe6215d[_0x4dc58d['name']]={'$like':'%'+_0xc73996['query']['filter']+'%'};return _0xe6215d;}})});}_0x331864=_[_0x8fd4('0x3d')]({},_0x331864,_0xc73996[_0x8fd4('0x40')]);var _0x12f30e={'where':_0x331864[_0x8fd4('0x3c')]};return db[_0x8fd4('0x2e')]['count'](_0x12f30e)[_0x8fd4('0x25')](function(_0x3af3da){_0x19dd98['count']=_0x3af3da;if(_0xc73996['query'][_0x8fd4('0x41')]){_0x331864[_0x8fd4('0x42')]=[{'all':!![]}];}return db[_0x8fd4('0x2e')][_0x8fd4('0x43')](_0x331864);})[_0x8fd4('0x25')](function(_0x17862a){_0x19dd98[_0x8fd4('0x44')]=_0x17862a;return _0x19dd98;})[_0x8fd4('0x25')](respondWithFilteredResult(_0x56b493,_0x331864))[_0x8fd4('0x45')](handleError(_0x56b493,null));};exports[_0x8fd4('0x46')]=function(_0x43fe61,_0x354d16){var _0x3a4a1d={'raw':!![],'where':{'id':_0x43fe61[_0x8fd4('0x47')]['id']}},_0x15f9ca={};_0x15f9ca[_0x8fd4('0x34')]=_[_0x8fd4('0x31')](db[_0x8fd4('0x2e')]['rawAttributes']);_0x15f9ca[_0x8fd4('0x30')]=_['keys'](_0x43fe61[_0x8fd4('0x30')]);_0x15f9ca[_0x8fd4('0x32')]=_[_0x8fd4('0x33')](_0x15f9ca[_0x8fd4('0x34')],_0x15f9ca[_0x8fd4('0x30')]);_0x3a4a1d[_0x8fd4('0x35')]=_['intersection'](_0x15f9ca[_0x8fd4('0x34')],qs[_0x8fd4('0x36')](_0x43fe61['query'][_0x8fd4('0x36')]));_0x3a4a1d[_0x8fd4('0x35')]=_0x3a4a1d[_0x8fd4('0x35')][_0x8fd4('0x48')]?_0x3a4a1d[_0x8fd4('0x35')]:_0x15f9ca[_0x8fd4('0x34')];if(_0x43fe61[_0x8fd4('0x30')][_0x8fd4('0x41')]){_0x3a4a1d[_0x8fd4('0x42')]=[{'all':!![]}];}_0x3a4a1d=_['merge']({},_0x3a4a1d,_0x43fe61['options']);return db['Disposition']['find'](_0x3a4a1d)[_0x8fd4('0x25')](handleEntityNotFound(_0x354d16,null))[_0x8fd4('0x25')](respondWithResult(_0x354d16,null))['catch'](handleError(_0x354d16,null));};exports['create']=function(_0x5ce0d9,_0x3f1cd1){return db[_0x8fd4('0x2e')][_0x8fd4('0x49')](_0x5ce0d9[_0x8fd4('0x4a')],{})['then'](function(_0x1f93e1){var _0x69c57c=_0x5ce0d9[_0x8fd4('0x4b')]['get']({'plain':!![]});if(!_0x69c57c)throw new Error(_0x8fd4('0x4c'));if(_0x69c57c[_0x8fd4('0x4d')]===_0x8fd4('0x4b')){var _0x3fccfc=_0x1f93e1[_0x8fd4('0x27')]({'plain':!![]});var _0x19f296='Dispositions';return db[_0x8fd4('0x4e')][_0x8fd4('0x4f')]({'where':{'name':_0x19f296,'userProfileId':_0x69c57c[_0x8fd4('0x50')]},'raw':!![]})[_0x8fd4('0x25')](function(_0x752eec){if(_0x752eec&&_0x752eec[_0x8fd4('0x51')]===0x0){return db[_0x8fd4('0x29')][_0x8fd4('0x49')]({'name':_0x3fccfc[_0x8fd4('0x2c')],'resourceId':_0x3fccfc['id'],'type':_0x752eec[_0x8fd4('0x2c')],'sectionId':_0x752eec['id']},{})[_0x8fd4('0x25')](function(){return _0x1f93e1;});}else{return _0x1f93e1;}})[_0x8fd4('0x45')](function(_0x3590be){logger[_0x8fd4('0x2b')](_0x8fd4('0x52'),_0x3590be);throw _0x3590be;});}return _0x1f93e1;})[_0x8fd4('0x25')](respondWithResult(_0x3f1cd1,0xc9))[_0x8fd4('0x45')](handleError(_0x3f1cd1,null));};exports[_0x8fd4('0x24')]=function(_0x462506,_0x592cab){if(_0x462506[_0x8fd4('0x4a')]['id']){delete _0x462506[_0x8fd4('0x4a')]['id'];}return db[_0x8fd4('0x2e')][_0x8fd4('0x4f')]({'where':{'id':_0x462506['params']['id']}})['then'](handleEntityNotFound(_0x592cab,null))['then'](saveUpdates(_0x462506[_0x8fd4('0x4a')],null))[_0x8fd4('0x25')](respondWithResult(_0x592cab,null))[_0x8fd4('0x45')](handleError(_0x592cab,null));};exports[_0x8fd4('0x26')]=function(_0x2c636b,_0x4fc05a){return db['Disposition'][_0x8fd4('0x4f')]({'where':{'id':_0x2c636b[_0x8fd4('0x47')]['id']}})[_0x8fd4('0x25')](handleEntityNotFound(_0x4fc05a,null))['then'](removeEntity(_0x4fc05a,null))['catch'](handleError(_0x4fc05a,null));};
\ No newline at end of file
+var _0x0514=['model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','json','offset','limit','count','apply','reject','save','update','then','destroy','get','Dispositions','sendStatus','error','name','send','index','map','Disposition','fieldName','type','key'];(function(_0x3c6310,_0x13601d){var _0x320122=function(_0x596176){while(--_0x596176){_0x3c6310['push'](_0x3c6310['shift']());}};_0x320122(++_0x13601d);}(_0x0514,0x1f0));var _0x4051=function(_0x780dfc,_0x164874){_0x780dfc=_0x780dfc-0x0;var _0x496fd7=_0x0514[_0x780dfc];return _0x496fd7;};'use strict';var emlformat=require(_0x4051('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4051('0x1'));var jsonpatch=require(_0x4051('0x2'));var rp=require('request-promise');var moment=require(_0x4051('0x3'));var BPromise=require(_0x4051('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4051('0x5'));var sox=require(_0x4051('0x6'));var csv=require(_0x4051('0x7'));var ejs=require(_0x4051('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4051('0x9'));var crypto=require(_0x4051('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4051('0xb'));var toCsv=require('to-csv');var querystring=require(_0x4051('0xc'));var Papa=require(_0x4051('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4051('0xe'));var as=require(_0x4051('0xf'));var hardwareService=require(_0x4051('0x10'));var logger=require(_0x4051('0x11'))('api');var utils=require(_0x4051('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4051('0x13'))['db'];function respondWithStatusCode(_0x19fbd7,_0x1980a0){_0x1980a0=_0x1980a0||0xcc;return function(_0x1eb233){if(_0x1eb233){return _0x19fbd7['sendStatus'](_0x1980a0);}return _0x19fbd7[_0x4051('0x14')](_0x1980a0)['end']();};}function respondWithResult(_0x95d684,_0x347aea){_0x347aea=_0x347aea||0xc8;return function(_0x52ef89){if(_0x52ef89){return _0x95d684[_0x4051('0x14')](_0x347aea)[_0x4051('0x15')](_0x52ef89);}};}function respondWithFilteredResult(_0x406a34,_0x23394a){return function(_0x531d4f){if(_0x531d4f){var _0x25f125=typeof _0x23394a[_0x4051('0x16')]==='undefined'&&typeof _0x23394a[_0x4051('0x17')]==='undefined';var _0x1f61d3=_0x531d4f[_0x4051('0x18')];var _0x49811a=_0x25f125?0x0:_0x23394a[_0x4051('0x16')];var _0x415242=_0x25f125?_0x531d4f['count']:_0x23394a[_0x4051('0x16')]+_0x23394a[_0x4051('0x17')];var _0x40b8fb;if(_0x415242>=_0x1f61d3){_0x415242=_0x1f61d3;_0x40b8fb=0xc8;}else{_0x40b8fb=0xce;}_0x406a34[_0x4051('0x14')](_0x40b8fb);return _0x406a34['set']('Content-Range',_0x49811a+'-'+_0x415242+'/'+_0x1f61d3)[_0x4051('0x15')](_0x531d4f);}return null;};}function patchUpdates(_0x358095){return function(_0x16ae08){try{jsonpatch[_0x4051('0x19')](_0x16ae08,_0x358095,!![]);}catch(_0x1ed5a9){return BPromise[_0x4051('0x1a')](_0x1ed5a9);}return _0x16ae08[_0x4051('0x1b')]();};}function saveUpdates(_0x1442cc,_0x56c7bc){return function(_0x228ff6){if(_0x228ff6){return _0x228ff6[_0x4051('0x1c')](_0x1442cc)[_0x4051('0x1d')](function(_0x2b6fa8){return _0x2b6fa8;});}return null;};}function removeEntity(_0x1d6150,_0x4189dd){return function(_0x196d2e){if(_0x196d2e){return _0x196d2e[_0x4051('0x1e')]()[_0x4051('0x1d')](function(){var _0x22a215=_0x196d2e[_0x4051('0x1f')]({'plain':!![]});var _0x4fc039=_0x4051('0x20');return db['UserProfileResource'][_0x4051('0x1e')]({'where':{'type':_0x4fc039,'resourceId':_0x22a215['id']}})[_0x4051('0x1d')](function(){return _0x196d2e;});})[_0x4051('0x1d')](function(){_0x1d6150[_0x4051('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33d3c7,_0x1acac3){return function(_0x35f3ac){if(!_0x35f3ac){_0x33d3c7[_0x4051('0x21')](0x194);}return _0x35f3ac;};}function handleError(_0x5d2274,_0xba4a62){_0xba4a62=_0xba4a62||0x1f4;return function(_0x570e31){logger[_0x4051('0x22')](_0x570e31['stack']);if(_0x570e31[_0x4051('0x23')]){delete _0x570e31['name'];}_0x5d2274[_0x4051('0x14')](_0xba4a62)[_0x4051('0x24')](_0x570e31);};}exports[_0x4051('0x25')]=function(_0x294a4d,_0x514c76){var _0x36891a={},_0x3ba1d5={},_0x43bee8={'count':0x0,'rows':[]};var _0x49ed06=_[_0x4051('0x26')](db[_0x4051('0x27')]['rawAttributes'],function(_0x445667){return{'name':_0x445667[_0x4051('0x28')],'type':_0x445667[_0x4051('0x29')][_0x4051('0x2a')]};});_0x3ba1d5[_0x4051('0x2b')]=_[_0x4051('0x26')](_0x49ed06,_0x4051('0x23'));_0x3ba1d5[_0x4051('0x2c')]=_[_0x4051('0x2d')](_0x294a4d[_0x4051('0x2c')]);_0x3ba1d5[_0x4051('0x2e')]=_[_0x4051('0x2f')](_0x3ba1d5['model'],_0x3ba1d5[_0x4051('0x2c')]);_0x36891a[_0x4051('0x30')]=_[_0x4051('0x2f')](_0x3ba1d5[_0x4051('0x2b')],qs[_0x4051('0x31')](_0x294a4d[_0x4051('0x2c')]['fields']));_0x36891a['attributes']=_0x36891a[_0x4051('0x30')][_0x4051('0x32')]?_0x36891a[_0x4051('0x30')]:_0x3ba1d5[_0x4051('0x2b')];if(!_0x294a4d['query'][_0x4051('0x33')](_0x4051('0x34'))){_0x36891a[_0x4051('0x17')]=qs[_0x4051('0x17')](_0x294a4d[_0x4051('0x2c')][_0x4051('0x17')]);_0x36891a[_0x4051('0x16')]=qs[_0x4051('0x16')](_0x294a4d[_0x4051('0x2c')][_0x4051('0x16')]);}_0x36891a['order']=qs[_0x4051('0x35')](_0x294a4d['query'][_0x4051('0x35')]);_0x36891a[_0x4051('0x36')]=qs[_0x4051('0x2e')](_['pick'](_0x294a4d[_0x4051('0x2c')],_0x3ba1d5[_0x4051('0x2e')]),_0x49ed06);if(_0x294a4d[_0x4051('0x2c')]['filter']){_0x36891a['where']=_[_0x4051('0x37')](_0x36891a['where'],{'$or':_[_0x4051('0x26')](_0x49ed06,function(_0x390aec){if(_0x390aec[_0x4051('0x29')]!==_0x4051('0x38')){var _0x48e169={};_0x48e169[_0x390aec['name']]={'$like':'%'+_0x294a4d[_0x4051('0x2c')]['filter']+'%'};return _0x48e169;}})});}_0x36891a=_['merge']({},_0x36891a,_0x294a4d[_0x4051('0x39')]);var _0x45ae67={'where':_0x36891a[_0x4051('0x36')]};return db[_0x4051('0x27')]['count'](_0x45ae67)['then'](function(_0x4c9168){_0x43bee8['count']=_0x4c9168;if(_0x294a4d[_0x4051('0x2c')][_0x4051('0x3a')]){_0x36891a[_0x4051('0x3b')]=[{'all':!![]}];}return db['Disposition'][_0x4051('0x3c')](_0x36891a);})[_0x4051('0x1d')](function(_0x7bc4ba){_0x43bee8[_0x4051('0x3d')]=_0x7bc4ba;return _0x43bee8;})[_0x4051('0x1d')](respondWithFilteredResult(_0x514c76,_0x36891a))[_0x4051('0x3e')](handleError(_0x514c76,null));};exports[_0x4051('0x3f')]=function(_0x12c29f,_0x1ca625){var _0x1fe39f={'raw':!![],'where':{'id':_0x12c29f[_0x4051('0x40')]['id']}},_0x4de81f={};_0x4de81f[_0x4051('0x2b')]=_[_0x4051('0x2d')](db[_0x4051('0x27')][_0x4051('0x41')]);_0x4de81f[_0x4051('0x2c')]=_[_0x4051('0x2d')](_0x12c29f[_0x4051('0x2c')]);_0x4de81f['filters']=_['intersection'](_0x4de81f[_0x4051('0x2b')],_0x4de81f[_0x4051('0x2c')]);_0x1fe39f[_0x4051('0x30')]=_['intersection'](_0x4de81f[_0x4051('0x2b')],qs[_0x4051('0x31')](_0x12c29f[_0x4051('0x2c')][_0x4051('0x31')]));_0x1fe39f[_0x4051('0x30')]=_0x1fe39f[_0x4051('0x30')][_0x4051('0x32')]?_0x1fe39f[_0x4051('0x30')]:_0x4de81f['model'];if(_0x12c29f[_0x4051('0x2c')]['includeAll']){_0x1fe39f[_0x4051('0x3b')]=[{'all':!![]}];}_0x1fe39f=_[_0x4051('0x37')]({},_0x1fe39f,_0x12c29f[_0x4051('0x39')]);return db[_0x4051('0x27')][_0x4051('0x42')](_0x1fe39f)[_0x4051('0x1d')](handleEntityNotFound(_0x1ca625,null))['then'](respondWithResult(_0x1ca625,null))[_0x4051('0x3e')](handleError(_0x1ca625,null));};exports[_0x4051('0x43')]=function(_0x49e116,_0x4ffef1){return db[_0x4051('0x27')][_0x4051('0x43')](_0x49e116['body'],{})[_0x4051('0x1d')](function(_0x415ecc){var _0x3b7b05=_0x49e116[_0x4051('0x44')][_0x4051('0x1f')]({'plain':!![]});if(!_0x3b7b05)throw new Error(_0x4051('0x45'));if(_0x3b7b05[_0x4051('0x46')]===_0x4051('0x44')){var _0x1f5918=_0x415ecc[_0x4051('0x1f')]({'plain':!![]});var _0x707782=_0x4051('0x20');return db[_0x4051('0x47')][_0x4051('0x42')]({'where':{'name':_0x707782,'userProfileId':_0x3b7b05[_0x4051('0x48')]},'raw':!![]})['then'](function(_0x266bb0){if(_0x266bb0&&_0x266bb0[_0x4051('0x49')]===0x0){return db[_0x4051('0x4a')][_0x4051('0x43')]({'name':_0x1f5918[_0x4051('0x23')],'resourceId':_0x1f5918['id'],'type':_0x266bb0[_0x4051('0x23')],'sectionId':_0x266bb0['id']},{})[_0x4051('0x1d')](function(){return _0x415ecc;});}else{return _0x415ecc;}})[_0x4051('0x3e')](function(_0x4f678d){logger[_0x4051('0x22')](_0x4051('0x4b'),_0x4f678d);throw _0x4f678d;});}return _0x415ecc;})['then'](respondWithResult(_0x4ffef1,0xc9))[_0x4051('0x3e')](handleError(_0x4ffef1,null));};exports[_0x4051('0x1c')]=function(_0x30ae33,_0x4fd843){if(_0x30ae33[_0x4051('0x4c')]['id']){delete _0x30ae33[_0x4051('0x4c')]['id'];}return db[_0x4051('0x27')][_0x4051('0x42')]({'where':{'id':_0x30ae33[_0x4051('0x40')]['id']}})[_0x4051('0x1d')](handleEntityNotFound(_0x4fd843,null))[_0x4051('0x1d')](saveUpdates(_0x30ae33['body'],null))[_0x4051('0x1d')](respondWithResult(_0x4fd843,null))['catch'](handleError(_0x4fd843,null));};exports[_0x4051('0x1e')]=function(_0x1a886f,_0x364ccb){return db['Disposition'][_0x4051('0x42')]({'where':{'id':_0x1a886f[_0x4051('0x40')]['id']}})[_0x4051('0x1d')](handleEntityNotFound(_0x364ccb,null))['then'](removeEntity(_0x364ccb,null))[_0x4051('0x3e')](handleError(_0x364ccb,null));};
\ No newline at end of file
index 904c57b..3404766 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2787=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Disposition','name_voice','name','ListId','name_chat','ChatWebsiteId','MailAccountId','name_sms','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','lodash','../../config/logger'];(function(_0x3ed4da,_0x2a4fdd){var _0x5b7f61=function(_0x164c4d){while(--_0x164c4d){_0x3ed4da['push'](_0x3ed4da['shift']());}};_0x5b7f61(++_0x2a4fdd);}(_0x2787,0x15e));var _0x7278=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x2787[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x7278('0x0'));var util=require('util');var logger=require(_0x7278('0x1'))('api');var moment=require(_0x7278('0x2'));var BPromise=require(_0x7278('0x3'));var rp=require(_0x7278('0x4'));var fs=require('fs');var path=require(_0x7278('0x5'));var rimraf=require(_0x7278('0x6'));var config=require(_0x7278('0x7'));var attributes=require('./disposition.attributes');module[_0x7278('0x8')]=function(_0x38b897,_0x4e5598){return _0x38b897[_0x7278('0x9')](_0x7278('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x7278('0xb'),'fields':[_0x7278('0xc'),_0x7278('0xd')]},{'unique':!![],'name':_0x7278('0xe'),'fields':[_0x7278('0xc'),_0x7278('0xf')]},{'unique':!![],'name':'name_mail','fields':[_0x7278('0xc'),_0x7278('0x10')]},{'unique':!![],'name':_0x7278('0x11'),'fields':['name','SmsAccountId']},{'unique':!![],'name':_0x7278('0x12'),'fields':['name',_0x7278('0x13')]},{'unique':!![],'name':_0x7278('0x14'),'fields':['name',_0x7278('0x15')]},{'unique':!![],'name':'name_whatsapp','fields':['name','WhatsappAccountId']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8666=['name_fax','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./disposition.attributes','exports','Disposition','name_voice','name','ListId','name_chat','ChatWebsiteId','MailAccountId','SmsAccountId'];(function(_0x35eed8,_0xec2124){var _0x56d03a=function(_0x4835fc){while(--_0x4835fc){_0x35eed8['push'](_0x35eed8['shift']());}};_0x56d03a(++_0xec2124);}(_0x8666,0x122));var _0x6866=function(_0x1d3f3f,_0x30ed45){_0x1d3f3f=_0x1d3f3f-0x0;var _0x49e5e8=_0x8666[_0x1d3f3f];return _0x49e5e8;};'use strict';var _=require(_0x6866('0x0'));var util=require(_0x6866('0x1'));var logger=require('../../config/logger')(_0x6866('0x2'));var moment=require(_0x6866('0x3'));var BPromise=require(_0x6866('0x4'));var rp=require(_0x6866('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6866('0x6'));var config=require(_0x6866('0x7'));var attributes=require(_0x6866('0x8'));module[_0x6866('0x9')]=function(_0x40f35b,_0x2efa0e){return _0x40f35b['define'](_0x6866('0xa'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x6866('0xb'),'fields':[_0x6866('0xc'),_0x6866('0xd')]},{'unique':!![],'name':_0x6866('0xe'),'fields':[_0x6866('0xc'),_0x6866('0xf')]},{'unique':!![],'name':'name_mail','fields':[_0x6866('0xc'),_0x6866('0x10')]},{'unique':!![],'name':'name_sms','fields':[_0x6866('0xc'),_0x6866('0x11')]},{'unique':!![],'name':_0x6866('0x12'),'fields':['name','FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':['name',_0x6866('0x13')]},{'unique':!![],'name':_0x6866('0x14'),'fields':['name',_0x6866('0x15')]}],'timestamps':!![]});};
\ No newline at end of file
index d476383..5953219 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(_0x957ba8,_0x17dadc){var _0x50caee=function(_0x3d0e13){while(--_0x3d0e13){_0x957ba8['push'](_0x957ba8['shift']());}};_0x50caee(++_0x17dadc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'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(_0x26659e,_0x38b253){var _0x20244c=function(_0xfab6dc){while(--_0xfab6dc){_0x26659e['push'](_0x26659e['shift']());}};_0x20244c(++_0x38b253);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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 ba7daa1..f3076ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a12=['./disposition.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x3a12,0xb7));var _0x23a1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3a12[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x23a1('0x0'));var path=require(_0x23a1('0x1'));var timeout=require('connect-timeout');var express=require(_0x23a1('0x2'));var router=express[_0x23a1('0x3')]();var fs_extra=require(_0x23a1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x23a1('0x5'));var config=require(_0x23a1('0x6'));var controller=require(_0x23a1('0x7'));router[_0x23a1('0x8')]('/',auth[_0x23a1('0x9')](),controller[_0x23a1('0xa')]);router['get'](_0x23a1('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x23a1('0xc')]('/',auth[_0x23a1('0x9')](),controller[_0x23a1('0xd')]);router[_0x23a1('0xe')](_0x23a1('0xb'),auth['isAuthenticated'](),controller[_0x23a1('0xf')]);router[_0x23a1('0x10')]('/:id',auth[_0x23a1('0x9')](),controller[_0x23a1('0x11')]);module[_0x23a1('0x12')]=router;
\ No newline at end of file
+var _0xe32b=['../../components/auth/service','../../config/environment','./disposition.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra'];(function(_0x7a36a8,_0x2c1981){var _0x5d17b2=function(_0x20a00b){while(--_0x20a00b){_0x7a36a8['push'](_0x7a36a8['shift']());}};_0x5d17b2(++_0x2c1981);}(_0xe32b,0x106));var _0xbe32=function(_0x383cd4,_0x2da9c6){_0x383cd4=_0x383cd4-0x0;var _0x33bd6c=_0xe32b[_0x383cd4];return _0x33bd6c;};'use strict';var multer=require(_0xbe32('0x0'));var util=require('util');var path=require(_0xbe32('0x1'));var timeout=require(_0xbe32('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xbe32('0x3'));var auth=require(_0xbe32('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbe32('0x5'));var controller=require(_0xbe32('0x6'));router['get']('/',auth[_0xbe32('0x7')](),controller[_0xbe32('0x8')]);router[_0xbe32('0x9')](_0xbe32('0xa'),auth[_0xbe32('0x7')](),controller[_0xbe32('0xb')]);router[_0xbe32('0xc')]('/',auth[_0xbe32('0x7')](),controller[_0xbe32('0xd')]);router[_0xbe32('0xe')](_0xbe32('0xa'),auth[_0xbe32('0x7')](),controller[_0xbe32('0xf')]);router[_0xbe32('0x10')](_0xbe32('0xa'),auth[_0xbe32('0x7')](),controller[_0xbe32('0x11')]);module[_0xbe32('0x12')]=router;
\ No newline at end of file
index e5b1b50..4526d9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fbd=['mandatoryDisposition','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId'];(function(_0x214b03,_0x351f66){var _0x186fcb=function(_0x524981){while(--_0x524981){_0x214b03['push'](_0x214b03['shift']());}};_0x186fcb(++_0x351f66);}(_0x4fbd,0x1dc));var _0xd4fb=function(_0x37ecd8,_0x1f6e94){_0x37ecd8=_0x37ecd8-0x0;var _0x54e43d=_0x4fbd[_0x37ecd8];return _0x54e43d;};'use strict';var Sequelize=require(_0xd4fb('0x0'));module['exports']={'name':{'type':Sequelize[_0xd4fb('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xd4fb('0x1')]},'ecm':{'type':Sequelize[_0xd4fb('0x2')](_0xd4fb('0x3'),'no'),'defaultValue':_0xd4fb('0x3')},'headerinfo':{'type':Sequelize[_0xd4fb('0x1')],'defaultValue':_0xd4fb('0x4')},'localstationid':{'type':Sequelize[_0xd4fb('0x1')],'unique':_0xd4fb('0x5')},'minrate':{'type':Sequelize[_0xd4fb('0x2')]('2400',_0xd4fb('0x6'),_0xd4fb('0x7'),_0xd4fb('0x8'),_0xd4fb('0x9'),_0xd4fb('0xa')),'defaultValue':_0xd4fb('0x6')},'maxrate':{'type':Sequelize[_0xd4fb('0x2')]('2400',_0xd4fb('0x6'),_0xd4fb('0x7'),'9600',_0xd4fb('0x9'),_0xd4fb('0xa')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0xd4fb('0x1')],'defaultValue':_0xd4fb('0xb')},'gateway':{'type':Sequelize[_0xd4fb('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xd4fb('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xd4fb('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xd4fb('0x2')](_0xd4fb('0xd'),_0xd4fb('0xe'),_0xd4fb('0xf'),_0xd4fb('0x10')),'defaultValue':_0xd4fb('0xd')},'key':{'type':Sequelize[_0xd4fb('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xd4fb('0x11')],'defaultValue':function(){return _0xd4fb('0x12');}},'notificationSound':{'type':Sequelize[_0xd4fb('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd4fb('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd4fb('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd4fb('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd4fb('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd4fb('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0xd4fb('0x14')},'mandatoryDisposition':{'type':Sequelize[_0xd4fb('0x13')],'defaultValue':![],'comment':_0xd4fb('0x15'),'set':function(_0x28ef40){if(!_0x28ef40)this[_0xd4fb('0x16')](_0xd4fb('0x17'),null);this[_0xd4fb('0x16')](_0xd4fb('0x18'),_0x28ef40);}}};
\ No newline at end of file
+var _0x664c=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','localstationid','2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN'];(function(_0x5bdd96,_0x178a4f){var _0x31625b=function(_0x4e8535){while(--_0x4e8535){_0x5bdd96['push'](_0x5bdd96['shift']());}};_0x31625b(++_0x178a4f);}(_0x664c,0x95));var _0xc664=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x664c[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xc664('0x0'));module[_0xc664('0x1')]={'name':{'type':Sequelize[_0xc664('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc664('0x2')]},'ecm':{'type':Sequelize[_0xc664('0x3')]('yes','no'),'defaultValue':_0xc664('0x4')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0xc664('0x2')],'unique':_0xc664('0x5')},'minrate':{'type':Sequelize[_0xc664('0x3')](_0xc664('0x6'),_0xc664('0x7'),_0xc664('0x8'),_0xc664('0x9'),_0xc664('0xa'),_0xc664('0xb')),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM'](_0xc664('0x6'),'4800',_0xc664('0x8'),'9600',_0xc664('0xa'),_0xc664('0xb')),'defaultValue':_0xc664('0xb')},'modem':{'type':Sequelize[_0xc664('0x2')],'defaultValue':_0xc664('0xc')},'gateway':{'type':Sequelize[_0xc664('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xc664('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xc664('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xc664('0x3')](_0xc664('0xe'),_0xc664('0xf'),_0xc664('0x10'),'KHOMP'),'defaultValue':_0xc664('0xe')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xc664('0x11');}},'notificationSound':{'type':Sequelize[_0xc664('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc664('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc664('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc664('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc664('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc664('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc664('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xc664('0x13')},'mandatoryDisposition':{'type':Sequelize[_0xc664('0x12')],'defaultValue':![],'comment':_0xc664('0x14'),'set':function(_0x266af0){if(!_0x266af0)this['setDataValue'](_0xc664('0x15'),null);this[_0xc664('0x16')](_0xc664('0x17'),_0x266af0);}}};
\ No newline at end of file
index fb02ff4..b5b311a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8c5=['result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','map','rawAttributes','type','query','keys','filters','model','attributes','intersection','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxAccount','includeAll','findAll','rows','params','mandatoryDispositionPause','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','describe','addDisposition','FaxAccountId','Disposition','length','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','findOne','hasOwnProperty','removeAnswers','addInteraction','FaxInteraction','omit','CmContact','Contact','Owner','fullname','internal','Tag','color','tag','sequelize','transaction','FaxApplication','priority','getApplications','context','from-voip-provider','exten','app','description','Answer','push','CDR(type)=inbound-fax','Set','ecm','localstationid','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','ReceiveFax','addAccountApplications','VoiceExtension','bulkCreate','updateAccountApplications','tech','key','updatedAt','ListId','findById','getMessages','FaxMessage','$gte','split','CmList','List','Contacts','attachments','root','basename','CheckAfterSend','isNil','path','from','format','\x22%s\x22\x20<%s>','fax','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','User','eml-format','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x242a98,_0x13988e){var _0x580999=function(_0x341927){while(--_0x341927){_0x242a98['push'](_0x242a98['shift']());}};_0x580999(++_0x13988e);}(_0xb8c5,0x152));var _0x5b8c=function(_0x15d409,_0x16c2ee){_0x15d409=_0x15d409-0x0;var _0x379106=_0xb8c5[_0x15d409];return _0x379106;};'use strict';var emlformat=require(_0x5b8c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5b8c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5b8c('0x2'));var BPromise=require(_0x5b8c('0x3'));var Mustache=require(_0x5b8c('0x4'));var util=require(_0x5b8c('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x5b8c('0x6'));var ejs=require(_0x5b8c('0x7'));var fs=require('fs');var fs_extra=require(_0x5b8c('0x8'));var _=require(_0x5b8c('0x9'));var squel=require('squel');var crypto=require(_0x5b8c('0xa'));var jsforce=require(_0x5b8c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5b8c('0x6'));var querystring=require(_0x5b8c('0xc'));var Papa=require(_0x5b8c('0xd'));var Redis=require(_0x5b8c('0xe'));var authService=require(_0x5b8c('0xf'));var qs=require(_0x5b8c('0x10'));var as=require(_0x5b8c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5b8c('0x12'))('api');var utils=require(_0x5b8c('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x5b8c('0x14'));var db=require(_0x5b8c('0x15'))['db'];config[_0x5b8c('0x16')]=_[_0x5b8c('0x17')](config[_0x5b8c('0x16')],{'host':_0x5b8c('0x18'),'port':0x18eb});var socket=require(_0x5b8c('0x19'))(new Redis(config[_0x5b8c('0x16')]));require(_0x5b8c('0x1a'))[_0x5b8c('0x1b')](socket);var jayson=require(_0x5b8c('0x1c'));var client=jayson[_0x5b8c('0x1d')][_0x5b8c('0x1e')]({'port':0x232c});var client9002=jayson[_0x5b8c('0x1d')][_0x5b8c('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x72b6c8,_0x23bdee,_0x73a705,_0x62a49f){return new BPromise(function(_0x2d3f6b,_0x166fcf){var _0xb15a77=_0x62a49f||client;return _0xb15a77[_0x5b8c('0x1f')](_0x72b6c8,_0x73a705)['then'](function(_0x5bb874){logger[_0x5b8c('0x20')](_0x5b8c('0x21'),_0x23bdee,_0x5b8c('0x22'));logger['debug'](_0x5b8c('0x23'),_0x23bdee,_0x5b8c('0x22'),JSON[_0x5b8c('0x24')](_0x5bb874));if(_0x5bb874[_0x5b8c('0x25')]){if(_0x5bb874['error'][_0x5b8c('0x26')]===0x1f4){logger[_0x5b8c('0x25')](_0x5b8c('0x21'),_0x23bdee,_0x5bb874[_0x5b8c('0x25')][_0x5b8c('0x27')]);return _0x166fcf(_0x5bb874['error'][_0x5b8c('0x27')]);}logger[_0x5b8c('0x25')](_0x5b8c('0x21'),_0x23bdee,_0x5bb874['error'][_0x5b8c('0x27')]);return _0x2d3f6b(_0x5bb874[_0x5b8c('0x25')][_0x5b8c('0x27')]);}else{logger['info'](_0x5b8c('0x21'),_0x23bdee,'request\x20sent');_0x2d3f6b(_0x5bb874[_0x5b8c('0x28')][_0x5b8c('0x27')]);}})[_0x5b8c('0x29')](function(_0x173fb1){logger[_0x5b8c('0x25')](_0x5b8c('0x21'),_0x23bdee,_0x173fb1);_0x166fcf(_0x173fb1);});});}function respondWithStatusCode(_0xefa9e0,_0x1b4e88){_0x1b4e88=_0x1b4e88||0xcc;return function(_0x4b72c9){if(_0x4b72c9){return _0xefa9e0[_0x5b8c('0x2a')](_0x1b4e88);}return _0xefa9e0[_0x5b8c('0x2b')](_0x1b4e88)[_0x5b8c('0x2c')]();};}function respondWithResult(_0x257ec1,_0x170d21){_0x170d21=_0x170d21||0xc8;return function(_0x1dd47b){if(_0x1dd47b){return _0x257ec1['status'](_0x170d21)[_0x5b8c('0x2d')](_0x1dd47b);}};}function respondWithFilteredResult(_0x56bd34,_0x2b7d39){return function(_0x1bc59e){if(_0x1bc59e){var _0x420816=typeof _0x2b7d39[_0x5b8c('0x2e')]===_0x5b8c('0x2f')&&typeof _0x2b7d39['limit']==='undefined';var _0x21c632=_0x1bc59e[_0x5b8c('0x30')];var _0x28bc2b=_0x420816?0x0:_0x2b7d39[_0x5b8c('0x2e')];var _0x3e1598=_0x420816?_0x1bc59e[_0x5b8c('0x30')]:_0x2b7d39[_0x5b8c('0x2e')]+_0x2b7d39[_0x5b8c('0x31')];var _0x5689e3;if(_0x3e1598>=_0x21c632){_0x3e1598=_0x21c632;_0x5689e3=0xc8;}else{_0x5689e3=0xce;}_0x56bd34[_0x5b8c('0x2b')](_0x5689e3);return _0x56bd34[_0x5b8c('0x32')](_0x5b8c('0x33'),_0x28bc2b+'-'+_0x3e1598+'/'+_0x21c632)['json'](_0x1bc59e);}return null;};}function patchUpdates(_0x4e2c40){return function(_0x2de48d){try{jsonpatch[_0x5b8c('0x34')](_0x2de48d,_0x4e2c40,!![]);}catch(_0x595851){return BPromise['reject'](_0x595851);}return _0x2de48d[_0x5b8c('0x35')]();};}function saveUpdates(_0x4fd9a0,_0x4bd9ee){return function(_0x472b32){if(_0x472b32){return _0x472b32['update'](_0x4fd9a0)['then'](function(_0x5b214c){return _0x5b214c;});}return null;};}function removeEntity(_0xd48b97,_0x51c44d){return function(_0x461452){if(_0x461452){return _0x461452['destroy']()[_0x5b8c('0x36')](function(){var _0x5a5500=_0x461452[_0x5b8c('0x37')]({'plain':!![]});var _0x5f51ac=_0x5b8c('0x38');return db[_0x5b8c('0x39')]['destroy']({'where':{'type':_0x5f51ac,'resourceId':_0x5a5500['id']}})[_0x5b8c('0x36')](function(){return _0x461452;});})[_0x5b8c('0x36')](function(){_0xd48b97[_0x5b8c('0x2b')](0xcc)[_0x5b8c('0x2c')]();});}};}function handleEntityNotFound(_0x54f5b6,_0x4442e7){return function(_0x1548f1){if(!_0x1548f1){_0x54f5b6[_0x5b8c('0x2a')](0x194);}return _0x1548f1;};}function handleError(_0x5b060b,_0x459ae1){_0x459ae1=_0x459ae1||0x1f4;return function(_0x1c39c6){logger[_0x5b8c('0x25')](_0x1c39c6[_0x5b8c('0x3a')]);if(_0x1c39c6[_0x5b8c('0x3b')]){delete _0x1c39c6['name'];}_0x5b060b[_0x5b8c('0x2b')](_0x459ae1)[_0x5b8c('0x3c')](_0x1c39c6);};}exports[_0x5b8c('0x3d')]=function(_0x13e87b,_0x22f050){var _0x377f09={'include':[{'model':db[_0x5b8c('0x3e')],'as':'mandatoryDispositionPause'}]},_0xb1df90={},_0x560063={'count':0x0,'rows':[]};var _0x4f3d6b=_[_0x5b8c('0x3f')](db['FaxAccount'][_0x5b8c('0x40')],function(_0x43573f){return{'name':_0x43573f['fieldName'],'type':_0x43573f[_0x5b8c('0x41')]['key']};});_0xb1df90['model']=_[_0x5b8c('0x3f')](_0x4f3d6b,_0x5b8c('0x3b'));_0xb1df90[_0x5b8c('0x42')]=_[_0x5b8c('0x43')](_0x13e87b['query']);_0xb1df90[_0x5b8c('0x44')]=_['intersection'](_0xb1df90[_0x5b8c('0x45')],_0xb1df90['query']);_0x377f09[_0x5b8c('0x46')]=_[_0x5b8c('0x47')](_0xb1df90[_0x5b8c('0x45')],qs[_0x5b8c('0x48')](_0x13e87b[_0x5b8c('0x42')][_0x5b8c('0x48')]));_0x377f09[_0x5b8c('0x46')]=_0x377f09[_0x5b8c('0x46')]['length']?_0x377f09[_0x5b8c('0x46')]:_0xb1df90[_0x5b8c('0x45')];if(!_0x13e87b[_0x5b8c('0x42')]['hasOwnProperty']('nolimit')){_0x377f09[_0x5b8c('0x31')]=qs[_0x5b8c('0x31')](_0x13e87b[_0x5b8c('0x42')][_0x5b8c('0x31')]);_0x377f09[_0x5b8c('0x2e')]=qs[_0x5b8c('0x2e')](_0x13e87b[_0x5b8c('0x42')][_0x5b8c('0x2e')]);}_0x377f09[_0x5b8c('0x49')]=qs[_0x5b8c('0x4a')](_0x13e87b[_0x5b8c('0x42')][_0x5b8c('0x4a')]);_0x377f09[_0x5b8c('0x4b')]=qs[_0x5b8c('0x44')](_[_0x5b8c('0x4c')](_0x13e87b[_0x5b8c('0x42')],_0xb1df90[_0x5b8c('0x44')]),_0x4f3d6b);if(_0x13e87b['query'][_0x5b8c('0x4d')]){_0x377f09['where']=_[_0x5b8c('0x4e')](_0x377f09[_0x5b8c('0x4b')],{'$or':_[_0x5b8c('0x3f')](_0x4f3d6b,function(_0x1550fe){if(_0x1550fe[_0x5b8c('0x41')]!==_0x5b8c('0x4f')){var _0x478522={};_0x478522[_0x1550fe[_0x5b8c('0x3b')]]={'$like':'%'+_0x13e87b[_0x5b8c('0x42')][_0x5b8c('0x4d')]+'%'};return _0x478522;}})});}_0x377f09=_[_0x5b8c('0x4e')]({},_0x377f09,_0x13e87b[_0x5b8c('0x50')]);var _0x7a5fe4={'where':_0x377f09[_0x5b8c('0x4b')]};return db[_0x5b8c('0x51')][_0x5b8c('0x30')](_0x7a5fe4)['then'](function(_0x4974d4){_0x560063[_0x5b8c('0x30')]=_0x4974d4;if(_0x13e87b[_0x5b8c('0x42')][_0x5b8c('0x52')]){_0x377f09['include']=[{'all':!![]}];}return db['FaxAccount'][_0x5b8c('0x53')](_0x377f09);})['then'](function(_0x35bd4a){_0x560063[_0x5b8c('0x54')]=_0x35bd4a;return _0x560063;})[_0x5b8c('0x36')](respondWithFilteredResult(_0x22f050,_0x377f09))['catch'](handleError(_0x22f050,null));};exports['show']=function(_0x11fe7e,_0x4d5a51){var _0x17567d={'raw':![],'where':{'id':_0x11fe7e[_0x5b8c('0x55')]['id']},'include':[{'model':db[_0x5b8c('0x3e')],'as':_0x5b8c('0x56')}]},_0x129206={};_0x129206[_0x5b8c('0x45')]=_[_0x5b8c('0x43')](db[_0x5b8c('0x51')][_0x5b8c('0x40')]);_0x129206[_0x5b8c('0x42')]=_[_0x5b8c('0x43')](_0x11fe7e[_0x5b8c('0x42')]);_0x129206[_0x5b8c('0x44')]=_['intersection'](_0x129206[_0x5b8c('0x45')],_0x129206['query']);_0x17567d[_0x5b8c('0x46')]=_[_0x5b8c('0x47')](_0x129206['model'],qs[_0x5b8c('0x48')](_0x11fe7e[_0x5b8c('0x42')]['fields']));_0x17567d[_0x5b8c('0x46')]=_0x17567d[_0x5b8c('0x46')]['length']?_0x17567d[_0x5b8c('0x46')]:_0x129206[_0x5b8c('0x45')];if(_0x11fe7e[_0x5b8c('0x42')][_0x5b8c('0x52')]){_0x17567d[_0x5b8c('0x57')]=[{'all':!![]}];}_0x17567d=_[_0x5b8c('0x4e')]({},_0x17567d,_0x11fe7e[_0x5b8c('0x50')]);return db[_0x5b8c('0x51')][_0x5b8c('0x58')](_0x17567d)[_0x5b8c('0x36')](handleEntityNotFound(_0x4d5a51,null))[_0x5b8c('0x36')](respondWithResult(_0x4d5a51,null))[_0x5b8c('0x29')](handleError(_0x4d5a51,null));};exports[_0x5b8c('0x59')]=function(_0x35f71c,_0x19e949){return db[_0x5b8c('0x51')][_0x5b8c('0x59')](_0x35f71c[_0x5b8c('0x5a')],{})['then'](function(_0x5415fd){var _0x1550c6=_0x35f71c[_0x5b8c('0x5b')][_0x5b8c('0x37')]({'plain':!![]});if(!_0x1550c6)throw new Error(_0x5b8c('0x5c'));if(_0x1550c6[_0x5b8c('0x5d')]==='user'){var _0x1d2287=_0x5415fd[_0x5b8c('0x37')]({'plain':!![]});var _0xf0e360=_0x5b8c('0x38');return db[_0x5b8c('0x5e')][_0x5b8c('0x58')]({'where':{'name':_0xf0e360,'userProfileId':_0x1550c6['userProfileId']},'raw':!![]})[_0x5b8c('0x36')](function(_0x520e74){if(_0x520e74&&_0x520e74[_0x5b8c('0x5f')]===0x0){return db['UserProfileResource'][_0x5b8c('0x59')]({'name':_0x1d2287[_0x5b8c('0x3b')],'resourceId':_0x1d2287['id'],'type':_0x520e74[_0x5b8c('0x3b')],'sectionId':_0x520e74['id']},{})[_0x5b8c('0x36')](function(){return _0x5415fd;});}else{return _0x5415fd;}})[_0x5b8c('0x29')](function(_0x2673db){logger[_0x5b8c('0x25')](_0x5b8c('0x60'),_0x2673db);throw _0x2673db;});}return _0x5415fd;})[_0x5b8c('0x36')](respondWithResult(_0x19e949,0xc9))[_0x5b8c('0x29')](handleError(_0x19e949,null));};exports[_0x5b8c('0x61')]=function(_0x58e4af,_0x57d96f){if(_0x58e4af[_0x5b8c('0x5a')]['id']){delete _0x58e4af[_0x5b8c('0x5a')]['id'];}return db[_0x5b8c('0x51')]['find']({'where':{'id':_0x58e4af[_0x5b8c('0x55')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x5b8c('0x36')](handleEntityNotFound(_0x57d96f,null))[_0x5b8c('0x36')](saveUpdates(_0x58e4af[_0x5b8c('0x5a')],null))[_0x5b8c('0x36')](respondWithResult(_0x57d96f,null))['catch'](handleError(_0x57d96f,null));};exports[_0x5b8c('0x62')]=function(_0x3d774e,_0x5921f1){return db[_0x5b8c('0x51')]['find']({'where':{'id':_0x3d774e[_0x5b8c('0x55')]['id']}})[_0x5b8c('0x36')](handleEntityNotFound(_0x5921f1,null))[_0x5b8c('0x36')](removeEntity(_0x5921f1,null))[_0x5b8c('0x29')](handleError(_0x5921f1,null));};exports[_0x5b8c('0x63')]=function(_0xaad19,_0x508f01){return db[_0x5b8c('0x51')][_0x5b8c('0x63')]()['then'](respondWithResult(_0x508f01,null))[_0x5b8c('0x29')](handleError(_0x508f01,null));};exports[_0x5b8c('0x64')]=function(_0x540238,_0x42fb42,_0x301b43){if(_0x540238[_0x5b8c('0x5a')]['id']){delete _0x540238[_0x5b8c('0x5a')]['id'];}return db['FaxAccount'][_0x5b8c('0x58')]({'where':{'id':_0x540238[_0x5b8c('0x55')]['id']}})['then'](handleEntityNotFound(_0x42fb42,null))[_0x5b8c('0x36')](function(_0x534551){if(_0x534551){_0x540238[_0x5b8c('0x5a')][_0x5b8c('0x65')]=_0x534551['id'];return db[_0x5b8c('0x66')]['create'](_0x540238['body']);}})['then'](respondWithResult(_0x42fb42,null))['catch'](handleError(_0x42fb42,null));};exports['getDispositions']=function(_0x148aa0,_0x5ea8c7,_0x3e6cde){var _0x1508bb={'raw':![],'where':{}};var _0x474f23={};var _0x2df7be={'count':0x0,'rows':[]};return db[_0x5b8c('0x51')]['findOne']({'where':{'id':_0x148aa0[_0x5b8c('0x55')]['id']}})['then'](handleEntityNotFound(_0x5ea8c7,null))[_0x5b8c('0x36')](function(_0x40b64f){if(_0x40b64f){_0x474f23[_0x5b8c('0x45')]=_['keys'](db[_0x5b8c('0x66')][_0x5b8c('0x40')]);_0x474f23['query']=_['keys'](_0x148aa0[_0x5b8c('0x42')]);_0x474f23['filters']=_['intersection'](_0x474f23['model'],_0x474f23[_0x5b8c('0x42')]);_0x1508bb[_0x5b8c('0x46')]=_[_0x5b8c('0x47')](_0x474f23[_0x5b8c('0x45')],qs[_0x5b8c('0x48')](_0x148aa0[_0x5b8c('0x42')][_0x5b8c('0x48')]));_0x1508bb['attributes']=_0x1508bb[_0x5b8c('0x46')][_0x5b8c('0x67')]?_0x1508bb[_0x5b8c('0x46')]:_0x474f23[_0x5b8c('0x45')];if(!_0x148aa0[_0x5b8c('0x42')]['hasOwnProperty'](_0x5b8c('0x68'))){_0x1508bb[_0x5b8c('0x31')]=qs[_0x5b8c('0x31')](_0x148aa0[_0x5b8c('0x42')][_0x5b8c('0x31')]);_0x1508bb['offset']=qs[_0x5b8c('0x2e')](_0x148aa0[_0x5b8c('0x42')][_0x5b8c('0x2e')]);}_0x1508bb[_0x5b8c('0x49')]=qs[_0x5b8c('0x4a')](_0x148aa0[_0x5b8c('0x42')][_0x5b8c('0x4a')]);_0x1508bb[_0x5b8c('0x4b')]=qs[_0x5b8c('0x44')](_['pick'](_0x148aa0[_0x5b8c('0x42')],_0x474f23['filters']));_0x1508bb['where'][_0x5b8c('0x65')]=_0x40b64f['id'];if(_0x148aa0[_0x5b8c('0x42')][_0x5b8c('0x4d')]){_0x1508bb[_0x5b8c('0x4b')]=_['merge'](_0x1508bb[_0x5b8c('0x4b')],{'$or':_[_0x5b8c('0x3f')](_0x1508bb[_0x5b8c('0x46')],function(_0x4a4297){var _0x3771b4={};_0x3771b4[_0x4a4297]={'$like':'%'+_0x148aa0[_0x5b8c('0x42')]['filter']+'%'};return _0x3771b4;})});}_0x1508bb=_[_0x5b8c('0x4e')]({},_0x1508bb,_0x148aa0[_0x5b8c('0x50')]);return db['Disposition'][_0x5b8c('0x30')]({'where':_0x1508bb[_0x5b8c('0x4b')]})[_0x5b8c('0x36')](function(_0x2cb321){_0x2df7be['count']=_0x2cb321;if(_0x148aa0[_0x5b8c('0x42')]['includeAll']){_0x1508bb[_0x5b8c('0x57')]=[{'all':!![]}];}return db[_0x5b8c('0x66')][_0x5b8c('0x53')](_0x1508bb);})[_0x5b8c('0x36')](function(_0x33de1b){_0x2df7be[_0x5b8c('0x54')]=_0x33de1b;return _0x2df7be;});}})[_0x5b8c('0x36')](respondWithFilteredResult(_0x5ea8c7,_0x1508bb))['catch'](handleError(_0x5ea8c7,null));};exports[_0x5b8c('0x69')]=function(_0x3be657,_0x3a016e,_0x5db4ea){return db[_0x5b8c('0x51')]['find']({'where':{'id':_0x3be657[_0x5b8c('0x55')]['id']}})[_0x5b8c('0x36')](handleEntityNotFound(_0x3a016e,null))[_0x5b8c('0x36')](function(_0x560264){if(_0x560264){return _0x560264[_0x5b8c('0x69')](_0x3be657[_0x5b8c('0x42')][_0x5b8c('0x6a')]);}})[_0x5b8c('0x36')](respondWithStatusCode(_0x3a016e,null))[_0x5b8c('0x29')](handleError(_0x3a016e,null));};exports[_0x5b8c('0x6b')]=function(_0x340269,_0x1e467b,_0x4dd661){if(_0x340269[_0x5b8c('0x5a')]['id']){delete _0x340269[_0x5b8c('0x5a')]['id'];}return db[_0x5b8c('0x51')][_0x5b8c('0x58')]({'where':{'id':_0x340269[_0x5b8c('0x55')]['id']}})['then'](handleEntityNotFound(_0x1e467b,null))[_0x5b8c('0x36')](function(_0x116d9b){if(_0x116d9b){_0x340269[_0x5b8c('0x5a')][_0x5b8c('0x65')]=_0x116d9b['id'];return db[_0x5b8c('0x6c')][_0x5b8c('0x59')](_0x340269[_0x5b8c('0x5a')]);}})[_0x5b8c('0x36')](respondWithResult(_0x1e467b,null))[_0x5b8c('0x29')](handleError(_0x1e467b,null));};exports['getAnswers']=function(_0x3b217a,_0x52feac,_0x526510){var _0x35787e={'raw':![],'where':{}};var _0x1fc5c3={};var _0x433a8d={'count':0x0,'rows':[]};return db[_0x5b8c('0x51')][_0x5b8c('0x6d')]({'where':{'id':_0x3b217a[_0x5b8c('0x55')]['id']}})[_0x5b8c('0x36')](handleEntityNotFound(_0x52feac,null))[_0x5b8c('0x36')](function(_0x1f1216){if(_0x1f1216){_0x1fc5c3[_0x5b8c('0x45')]=_[_0x5b8c('0x43')](db[_0x5b8c('0x6c')][_0x5b8c('0x40')]);_0x1fc5c3['query']=_[_0x5b8c('0x43')](_0x3b217a[_0x5b8c('0x42')]);_0x1fc5c3[_0x5b8c('0x44')]=_[_0x5b8c('0x47')](_0x1fc5c3[_0x5b8c('0x45')],_0x1fc5c3['query']);_0x35787e[_0x5b8c('0x46')]=_[_0x5b8c('0x47')](_0x1fc5c3[_0x5b8c('0x45')],qs[_0x5b8c('0x48')](_0x3b217a[_0x5b8c('0x42')][_0x5b8c('0x48')]));_0x35787e['attributes']=_0x35787e[_0x5b8c('0x46')]['length']?_0x35787e[_0x5b8c('0x46')]:_0x1fc5c3[_0x5b8c('0x45')];if(!_0x3b217a[_0x5b8c('0x42')][_0x5b8c('0x6e')](_0x5b8c('0x68'))){_0x35787e[_0x5b8c('0x31')]=qs[_0x5b8c('0x31')](_0x3b217a[_0x5b8c('0x42')][_0x5b8c('0x31')]);_0x35787e[_0x5b8c('0x2e')]=qs[_0x5b8c('0x2e')](_0x3b217a[_0x5b8c('0x42')]['offset']);}_0x35787e[_0x5b8c('0x49')]=qs[_0x5b8c('0x4a')](_0x3b217a[_0x5b8c('0x42')][_0x5b8c('0x4a')]);_0x35787e[_0x5b8c('0x4b')]=qs['filters'](_[_0x5b8c('0x4c')](_0x3b217a[_0x5b8c('0x42')],_0x1fc5c3[_0x5b8c('0x44')]));_0x35787e[_0x5b8c('0x4b')][_0x5b8c('0x65')]=_0x1f1216['id'];if(_0x3b217a['query']['filter']){_0x35787e['where']=_[_0x5b8c('0x4e')](_0x35787e[_0x5b8c('0x4b')],{'$or':_[_0x5b8c('0x3f')](_0x35787e['attributes'],function(_0x4375e7){var _0x12187f={};_0x12187f[_0x4375e7]={'$like':'%'+_0x3b217a['query'][_0x5b8c('0x4d')]+'%'};return _0x12187f;})});}_0x35787e=_[_0x5b8c('0x4e')]({},_0x35787e,_0x3b217a[_0x5b8c('0x50')]);return db['CannedAnswer'][_0x5b8c('0x30')]({'where':_0x35787e['where']})[_0x5b8c('0x36')](function(_0x48a635){_0x433a8d[_0x5b8c('0x30')]=_0x48a635;if(_0x3b217a[_0x5b8c('0x42')]['includeAll']){_0x35787e[_0x5b8c('0x57')]=[{'all':!![]}];}return db[_0x5b8c('0x6c')][_0x5b8c('0x53')](_0x35787e);})['then'](function(_0x3bc535){_0x433a8d[_0x5b8c('0x54')]=_0x3bc535;return _0x433a8d;});}})['then'](respondWithFilteredResult(_0x52feac,_0x35787e))[_0x5b8c('0x29')](handleError(_0x52feac,null));};exports[_0x5b8c('0x6f')]=function(_0x45280a,_0x685982,_0x3be058){return db['FaxAccount'][_0x5b8c('0x58')]({'where':{'id':_0x45280a[_0x5b8c('0x55')]['id']}})['then'](handleEntityNotFound(_0x685982,null))[_0x5b8c('0x36')](function(_0x16b43d){if(_0x16b43d){return _0x16b43d[_0x5b8c('0x6f')](_0x45280a[_0x5b8c('0x42')][_0x5b8c('0x6a')]);}})[_0x5b8c('0x36')](respondWithStatusCode(_0x685982,null))[_0x5b8c('0x29')](handleError(_0x685982,null));};exports[_0x5b8c('0x70')]=function(_0x5fa8d4,_0x3b7fbd,_0x49c290){return db[_0x5b8c('0x71')][_0x5b8c('0x58')]({'where':{'id':_0x5fa8d4['params']['id']}})[_0x5b8c('0x36')](handleEntityNotFound(_0x3b7fbd,null))[_0x5b8c('0x36')](function(_0x20f54b){if(_0x20f54b){return _0x20f54b[_0x5b8c('0x70')](_0x5fa8d4[_0x5b8c('0x5a')][_0x5b8c('0x6a')],_[_0x5b8c('0x72')](_0x5fa8d4[_0x5b8c('0x5a')],[_0x5b8c('0x6a'),'id'])||{});}})['then'](respondWithResult(_0x3b7fbd,null))[_0x5b8c('0x29')](handleError(_0x3b7fbd,null));};exports['getInteractions']=function(_0xfd5971,_0x9759b6,_0x351275){var _0xb5afbd={'raw':![],'where':{}};var _0x4de0e8={};var _0x5b2cee={'count':0x0,'rows':[]};return db['FaxAccount'][_0x5b8c('0x6d')]({'where':{'id':_0xfd5971[_0x5b8c('0x55')]['id']}})['then'](handleEntityNotFound(_0x9759b6,null))[_0x5b8c('0x36')](function(_0x3506ac){if(_0x3506ac){_0x4de0e8['model']=_[_0x5b8c('0x43')](db['FaxInteraction'][_0x5b8c('0x40')]);_0x4de0e8[_0x5b8c('0x42')]=_[_0x5b8c('0x43')](_0xfd5971['query']);_0x4de0e8[_0x5b8c('0x44')]=_[_0x5b8c('0x47')](_0x4de0e8[_0x5b8c('0x45')],_0x4de0e8['query']);_0xb5afbd[_0x5b8c('0x46')]=_['intersection'](_0x4de0e8[_0x5b8c('0x45')],qs[_0x5b8c('0x48')](_0xfd5971[_0x5b8c('0x42')][_0x5b8c('0x48')]));_0xb5afbd[_0x5b8c('0x46')]=_0xb5afbd[_0x5b8c('0x46')][_0x5b8c('0x67')]?_0xb5afbd['attributes']:_0x4de0e8[_0x5b8c('0x45')];if(!_0xfd5971[_0x5b8c('0x42')][_0x5b8c('0x6e')](_0x5b8c('0x68'))){_0xb5afbd[_0x5b8c('0x31')]=qs[_0x5b8c('0x31')](_0xfd5971[_0x5b8c('0x42')]['limit']);_0xb5afbd[_0x5b8c('0x2e')]=qs[_0x5b8c('0x2e')](_0xfd5971['query'][_0x5b8c('0x2e')]);}_0xb5afbd[_0x5b8c('0x49')]=qs[_0x5b8c('0x4a')](_0xfd5971['query']['sort']);_0xb5afbd['where']=qs[_0x5b8c('0x44')](_[_0x5b8c('0x4c')](_0xfd5971[_0x5b8c('0x42')],_0x4de0e8[_0x5b8c('0x44')]));_0xb5afbd[_0x5b8c('0x4b')][_0x5b8c('0x65')]=_0x3506ac['id'];if(_0xfd5971[_0x5b8c('0x42')][_0x5b8c('0x4d')]){_0xb5afbd[_0x5b8c('0x4b')]=_[_0x5b8c('0x4e')](_0xb5afbd[_0x5b8c('0x4b')],{'$or':_[_0x5b8c('0x3f')](_0xb5afbd['attributes'],function(_0x1cddd0){var _0x224efc={};_0x224efc[_0x1cddd0]={'$like':'%'+_0xfd5971[_0x5b8c('0x42')][_0x5b8c('0x4d')]+'%'};return _0x224efc;})});}_0xb5afbd=_[_0x5b8c('0x4e')]({},_0xb5afbd,_0xfd5971['options']);return db['FaxInteraction'][_0x5b8c('0x30')]({'where':_0xb5afbd[_0x5b8c('0x4b')]})['then'](function(_0x1363bd){_0x5b2cee[_0x5b8c('0x30')]=_0x1363bd;if(_0xfd5971[_0x5b8c('0x42')][_0x5b8c('0x52')]){_0xb5afbd[_0x5b8c('0x57')]=[{'model':db[_0x5b8c('0x73')],'as':_0x5b8c('0x74'),'required':![]},{'model':db['User'],'as':_0x5b8c('0x75'),'attributes':[_0x5b8c('0x3b'),_0x5b8c('0x76'),_0x5b8c('0x77')],'required':![]},{'model':db[_0x5b8c('0x78')],'as':'Tags','attributes':['id',_0x5b8c('0x3b'),_0x5b8c('0x79')],'where':_0xfd5971['query'][_0x5b8c('0x7a')]?{'id':_0xfd5971['query']['tag']}:undefined,'required':_0xfd5971[_0x5b8c('0x42')][_0x5b8c('0x7a')]?!![]:![]}];}return db[_0x5b8c('0x71')][_0x5b8c('0x53')](_0xb5afbd);})[_0x5b8c('0x36')](function(_0x3eca5c){_0x5b2cee[_0x5b8c('0x54')]=_0x3eca5c;return _0x5b2cee;});}})[_0x5b8c('0x36')](respondWithFilteredResult(_0x9759b6,_0xb5afbd))['catch'](handleError(_0x9759b6,null));};exports['addApplications']=function(_0x48edaa,_0x2df5d8,_0x3f4893){return db['FaxAccount'][_0x5b8c('0x6d')]({'where':{'id':_0x48edaa[_0x5b8c('0x55')]['id']}})[_0x5b8c('0x36')](handleEntityNotFound(_0x2df5d8,null))[_0x5b8c('0x36')](function(_0x3a6134){if(_0x3a6134){return db[_0x5b8c('0x7b')][_0x5b8c('0x7c')](function(_0x11f460){return db[_0x5b8c('0x7d')]['destroy']({'where':{'FaxAccountId':_0x48edaa['params']['id']},'transaction':_0x11f460})[_0x5b8c('0x36')](function(_0x306b3e){var _0x3a106e=_[_0x5b8c('0x3f')](_0x48edaa['body'],function(_0x35b00c){_0x35b00c[_0x5b8c('0x65')]=_0x48edaa[_0x5b8c('0x55')]['id'];return _0x35b00c;});return db[_0x5b8c('0x7d')]['bulkCreate'](_0x3a106e,{'transaction':_0x11f460});});})['then'](function(){return db[_0x5b8c('0x7d')]['findAndCountAll']({'where':{'FaxAccountId':_0x48edaa[_0x5b8c('0x55')]['id']},'order':_0x5b8c('0x7e')});});}})[_0x5b8c('0x36')](respondWithResult(_0x2df5d8,null))[_0x5b8c('0x29')](handleError(_0x2df5d8,null));};exports['getApplications']=function(_0x435e81,_0x39baa2,_0x4117ad){var _0x5f4dee={};var _0x47d17c={};var _0x1b1450;var _0x5ae785;return db[_0x5b8c('0x51')][_0x5b8c('0x6d')]({'where':{'id':_0x435e81['params']['id']}})['then'](handleEntityNotFound(_0x39baa2,null))[_0x5b8c('0x36')](function(_0x271512){if(_0x271512){_0x1b1450=_0x271512;_0x47d17c[_0x5b8c('0x45')]=_[_0x5b8c('0x43')](db['FaxApplication'][_0x5b8c('0x40')]);_0x47d17c[_0x5b8c('0x42')]=_[_0x5b8c('0x43')](_0x435e81[_0x5b8c('0x42')]);_0x47d17c['filters']=_[_0x5b8c('0x47')](_0x47d17c[_0x5b8c('0x45')],_0x47d17c[_0x5b8c('0x42')]);_0x5f4dee['attributes']=_[_0x5b8c('0x47')](_0x47d17c[_0x5b8c('0x45')],qs['fields'](_0x435e81[_0x5b8c('0x42')][_0x5b8c('0x48')]));_0x5f4dee[_0x5b8c('0x46')]=_0x5f4dee[_0x5b8c('0x46')][_0x5b8c('0x67')]?_0x5f4dee[_0x5b8c('0x46')]:_0x47d17c[_0x5b8c('0x45')];_0x5f4dee[_0x5b8c('0x49')]=qs[_0x5b8c('0x4a')](_0x435e81[_0x5b8c('0x42')][_0x5b8c('0x4a')]);_0x5f4dee[_0x5b8c('0x4b')]=qs[_0x5b8c('0x44')](_[_0x5b8c('0x4c')](_0x435e81[_0x5b8c('0x42')],_0x47d17c[_0x5b8c('0x44')]));if(_0x435e81[_0x5b8c('0x42')]['filter']){_0x5f4dee[_0x5b8c('0x4b')]=_[_0x5b8c('0x4e')](_0x5f4dee[_0x5b8c('0x4b')],{'$or':_['map'](_0x5f4dee[_0x5b8c('0x46')],function(_0x20b6be){var _0x5485d1={};_0x5485d1[_0x20b6be]={'$like':'%'+_0x435e81['query'][_0x5b8c('0x4d')]+'%'};return _0x5485d1;})});}_0x5f4dee=_['merge']({},_0x5f4dee,_0x435e81[_0x5b8c('0x50')]);return _0x1b1450[_0x5b8c('0x7f')](_0x5f4dee);}})[_0x5b8c('0x36')](function(_0x54db4d){if(_0x54db4d){_0x5ae785=_0x54db4d[_0x5b8c('0x67')];if(!_0x435e81[_0x5b8c('0x42')][_0x5b8c('0x6e')](_0x5b8c('0x68'))){_0x5f4dee[_0x5b8c('0x31')]=qs[_0x5b8c('0x31')](_0x435e81[_0x5b8c('0x42')][_0x5b8c('0x31')]);_0x5f4dee[_0x5b8c('0x2e')]=qs[_0x5b8c('0x2e')](_0x435e81['query'][_0x5b8c('0x2e')]);}return _0x1b1450['getApplications'](_0x5f4dee);}})[_0x5b8c('0x36')](function(_0x59d6fe){if(_0x59d6fe){return _0x59d6fe?{'count':_0x5ae785,'rows':_0x59d6fe}:null;}})[_0x5b8c('0x36')](respondWithResult(_0x39baa2,null))[_0x5b8c('0x29')](handleError(_0x39baa2,null));};function Extension(_0x1e576d,_0x2b3fbb,_0x477f42,_0x4cd2de){this[_0x5b8c('0x80')]=_0x5b8c('0x81');this[_0x5b8c('0x82')]=_0x1e576d['localstationid'];this[_0x5b8c('0x83')]=_0x4cd2de;this[_0x5b8c('0x41')]='system';this[_0x5b8c('0x84')]='Fax\x20Extension';this[_0x5b8c('0x65')]=_0x1e576d['id'];this[_0x5b8c('0x7e')]=_0x2b3fbb;this['appdata']=_0x477f42;}function createExtensionsReciveFax(_0x2599f5){var _0x5b7dc8=0x1;var _0x5d369=[];_0x5d369['push'](new Extension(_0x2599f5,_0x5b7dc8,'',_0x5b8c('0x85')));_0x5b7dc8+=0x1;_0x5d369[_0x5b8c('0x86')](new Extension(_0x2599f5,_0x5b7dc8,_0x5b8c('0x87'),_0x5b8c('0x88')));_0x5b7dc8+=0x1;for(var _0x45eec4 in _0x2599f5){if(_0x2599f5[_0x5b8c('0x6e')](_0x45eec4)&&(_0x45eec4===_0x5b8c('0x89')||_0x45eec4===_0x5b8c('0x8a')||_0x45eec4==='gateway'||_0x45eec4===_0x5b8c('0x8b')||_0x45eec4===_0x5b8c('0x8c')||_0x45eec4===_0x5b8c('0x8d')||_0x45eec4===_0x5b8c('0x8e')||_0x45eec4===_0x5b8c('0x8f')||_0x45eec4===_0x5b8c('0x90'))){_0x5d369[_0x5b8c('0x86')](new Extension(_0x2599f5,_0x5b7dc8,_0x5b8c('0x91')+_0x45eec4+')='+_0x2599f5[_0x45eec4],_0x5b8c('0x88')));_0x5b7dc8+=0x1;}}_0x5d369[_0x5b8c('0x86')](new Extension(_0x2599f5,_0x5b7dc8,'6','Wait'));_0x5b7dc8+=0x1;_0x5d369[_0x5b8c('0x86')](new Extension(_0x2599f5,_0x5b7dc8,'/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',_0x5b8c('0x92')));_0x5b7dc8=0x0;return _0x5d369;}exports[_0x5b8c('0x93')]=function(_0x2a594b,_0x2b1fe7,_0x2d0de5){var _0x1434a1;return db[_0x5b8c('0x7b')][_0x5b8c('0x7c')](function(_0x523e7a){return db[_0x5b8c('0x51')][_0x5b8c('0x59')](_0x2a594b['body'],{'transaction':_0x523e7a})[_0x5b8c('0x36')](function(_0x52ac84){_0x1434a1=_0x52ac84['get']({'plain':!![]});return db[_0x5b8c('0x94')][_0x5b8c('0x95')](createExtensionsReciveFax(_0x1434a1),{'transaction':_0x523e7a});});})[_0x5b8c('0x36')](function(){return _0x1434a1;})['then'](respondWithResult(_0x2b1fe7,null))[_0x5b8c('0x29')](handleError(_0x2b1fe7,null));};exports[_0x5b8c('0x96')]=function(_0x5631f1,_0x3a7061,_0x150a89){var _0x208c1f;return db[_0x5b8c('0x7b')]['transaction'](function(_0x426dfa){return db[_0x5b8c('0x51')][_0x5b8c('0x61')](_0x5631f1[_0x5b8c('0x5a')],{'where':{'id':_0x5631f1[_0x5b8c('0x5a')]['id']},'transaction':_0x426dfa})['then'](function(_0x15c9d0){return db[_0x5b8c('0x94')][_0x5b8c('0x62')]({'where':{'FaxAccountId':_0x5631f1[_0x5b8c('0x5a')]['id']},'transaction':_0x426dfa})[_0x5b8c('0x36')](function(_0x3f827f){return db[_0x5b8c('0x94')][_0x5b8c('0x95')](createExtensionsReciveFax(_[_0x5b8c('0x72')](_0x5631f1['body'],[_0x5b8c('0x97'),_0x5b8c('0x98'),'createdAt',_0x5b8c('0x99'),'TrunkId',_0x5b8c('0x9a')])),{'transaction':_0x426dfa});});});})[_0x5b8c('0x36')](function(){return db[_0x5b8c('0x51')][_0x5b8c('0x9b')](_0x5631f1[_0x5b8c('0x5a')]['id']);})['then'](respondWithResult(_0x3a7061,null))[_0x5b8c('0x29')](handleError(_0x3a7061,null));};exports[_0x5b8c('0x9c')]=function(_0x3c5703,_0x5049ad,_0x185bbf){var _0x30ffc3={'raw':!![],'where':{}};var _0x49b2be={};var _0x9a4076={'count':0x0,'rows':[]};return db[_0x5b8c('0x51')][_0x5b8c('0x6d')]({'where':{'id':_0x3c5703[_0x5b8c('0x55')]['id']}})[_0x5b8c('0x36')](handleEntityNotFound(_0x5049ad,null))[_0x5b8c('0x36')](function(_0x195e60){if(_0x195e60){_0x49b2be['model']=_[_0x5b8c('0x43')](db[_0x5b8c('0x9d')][_0x5b8c('0x40')]);_0x49b2be[_0x5b8c('0x42')]=_['keys'](_0x3c5703['query']);_0x49b2be[_0x5b8c('0x44')]=_['intersection'](_0x49b2be[_0x5b8c('0x45')],_0x49b2be[_0x5b8c('0x42')]);_0x30ffc3[_0x5b8c('0x46')]=_[_0x5b8c('0x47')](_0x49b2be[_0x5b8c('0x45')],qs[_0x5b8c('0x48')](_0x3c5703[_0x5b8c('0x42')][_0x5b8c('0x48')]));_0x30ffc3['attributes']=_0x30ffc3['attributes'][_0x5b8c('0x67')]?_0x30ffc3[_0x5b8c('0x46')]:_0x49b2be['model'];if(!_0x3c5703[_0x5b8c('0x42')][_0x5b8c('0x6e')]('nolimit')){_0x30ffc3[_0x5b8c('0x31')]=qs[_0x5b8c('0x31')](_0x3c5703[_0x5b8c('0x42')]['limit']);_0x30ffc3['offset']=qs[_0x5b8c('0x2e')](_0x3c5703['query'][_0x5b8c('0x2e')]);}_0x30ffc3[_0x5b8c('0x49')]=qs[_0x5b8c('0x4a')](_0x3c5703[_0x5b8c('0x42')][_0x5b8c('0x4a')]);_0x30ffc3[_0x5b8c('0x4b')]=qs[_0x5b8c('0x44')](_['pick'](_0x3c5703[_0x5b8c('0x42')],_0x49b2be[_0x5b8c('0x44')]));_0x30ffc3[_0x5b8c('0x4b')][_0x5b8c('0x65')]=_0x195e60['id'];if(_0x3c5703['query'][_0x5b8c('0x4d')]){_0x30ffc3['where']=_[_0x5b8c('0x4e')](_0x30ffc3['where'],{'$or':_[_0x5b8c('0x3f')](_0x30ffc3['attributes'],function(_0x92eef1){var _0x58dddc={};_0x58dddc[_0x92eef1]={'$like':'%'+_0x3c5703[_0x5b8c('0x42')]['filter']+'%'};return _0x58dddc;})});}if(_0x3c5703['query'][_0x5b8c('0x9e')]){var _0x19c112=_0x3c5703['query'][_0x5b8c('0x9e')][_0x5b8c('0x9f')](',');var _0x599286={};_0x599286[_0x19c112[0x0]]={'$gte':moment(_0x19c112[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x30ffc3[_0x5b8c('0x4b')]=_[_0x5b8c('0x4e')](_0x30ffc3['where'],_0x599286);}_0x30ffc3=_[_0x5b8c('0x4e')]({},_0x30ffc3,_0x3c5703[_0x5b8c('0x50')]);return db[_0x5b8c('0x9d')][_0x5b8c('0x30')]({'where':_0x30ffc3[_0x5b8c('0x4b')]})[_0x5b8c('0x36')](function(_0x782c7d){_0x9a4076[_0x5b8c('0x30')]=_0x782c7d;if(_0x3c5703[_0x5b8c('0x42')][_0x5b8c('0x52')]){_0x30ffc3[_0x5b8c('0x57')]=[{'all':!![]}];}return db[_0x5b8c('0x9d')][_0x5b8c('0x53')](_0x30ffc3);})[_0x5b8c('0x36')](function(_0x5425c3){_0x9a4076['rows']=_0x5425c3;return _0x9a4076;});}})['then'](respondWithFilteredResult(_0x5049ad,_0x30ffc3))[_0x5b8c('0x29')](handleError(_0x5049ad,null));};exports['send']=function(_0x5b2605,_0x3f27cc,_0x2eff43){var _0x40c5bb,_0x1c8b41={},_0x2fd16e;if(_0x5b2605[_0x5b8c('0x5a')]['to']){_0x2fd16e=_0x5b2605[_0x5b8c('0x5a')]['to'][0x0];}return db['FaxAccount'][_0x5b8c('0x58')]({'where':{'id':_0x5b2605['params']['id']},'include':[{'model':db[_0x5b8c('0xa0')],'as':_0x5b8c('0xa1'),'include':[{'model':db[_0x5b8c('0x73')],'as':_0x5b8c('0xa2'),'where':{'fax':_0x2fd16e},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0x3f27cc,null))[_0x5b8c('0x36')](function(_0x55a952){_0x40c5bb=_0x55a952;if(_0x5b2605[_0x5b8c('0x5a')][_0x5b8c('0xa3')]&&_0x5b2605['body'][_0x5b8c('0xa3')][_0x5b8c('0x67')]){for(var _0x5dd9a7=0x0;_0x5dd9a7<_0x5b2605[_0x5b8c('0x5a')][_0x5b8c('0xa3')][_0x5b8c('0x67')];_0x5dd9a7+=0x1){_0x5b2605[_0x5b8c('0x5a')]['attachments'][_0x5dd9a7]={'filename':_0x5b2605[_0x5b8c('0x5a')][_0x5b8c('0xa3')][_0x5dd9a7][_0x5b8c('0x3b')],'id':_0x5b2605[_0x5b8c('0x5a')][_0x5b8c('0xa3')][_0x5dd9a7]['id'],'path':path['join'](config[_0x5b8c('0xa4')],'server/files/attachments',_0x5b2605[_0x5b8c('0x5a')]['attachments'][_0x5dd9a7][_0x5b8c('0xa5')])};}}return respondWithRpcPromise(_0x5b8c('0xa6'),_0x5b8c('0xa6'),{'FaxAccountId':_[_0x5b8c('0xa7')](_0x5b2605[_0x5b8c('0x55')]['id'])?undefined:_0x5b2605['params']['id'],'path':_[_0x5b8c('0xa7')](_0x5b2605[_0x5b8c('0x5a')][_0x5b8c('0xa3')][0x0][_0x5b8c('0xa8')])?undefined:_0x5b2605[_0x5b8c('0x5a')][_0x5b8c('0xa3')][0x0][_0x5b8c('0xa8')],'fax':_[_0x5b8c('0xa7')](_0x5b2605[_0x5b8c('0x5a')]['to'][0x0])?undefined:_0x5b2605[_0x5b8c('0x5a')]['to'][0x0]},client9002);})[_0x5b8c('0x36')](function(){if(_0x40c5bb){if(_[_0x5b8c('0xa7')](_0x5b2605[_0x5b8c('0x5a')]['from'])){_0x5b2605['body'][_0x5b8c('0xa9')]=util[_0x5b8c('0xaa')](_0x5b8c('0xab'),_0x40c5bb[_0x5b8c('0x3b')],_0x40c5bb[_0x5b8c('0xac')]);}if(_0x40c5bb[_0x5b8c('0xa1')]){if(_0x40c5bb[_0x5b8c('0xa1')]['Contacts']['length']){return _0x40c5bb[_0x5b8c('0xa1')][_0x5b8c('0xa2')][0x0];}else{return db[_0x5b8c('0x73')][_0x5b8c('0x59')](_[_0x5b8c('0x17')](_0x5b2605[_0x5b8c('0x5a')],{'firstName':_0x5b2605[_0x5b8c('0x5a')]['to'][0x0],'phone':_0x5b2605['body']['to'][0x0],'fax':_0x5b2605[_0x5b8c('0x5a')]['to'][0x0],'ListId':_0x40c5bb[_0x5b8c('0x9a')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x5b8c('0xad'));}})['then'](function(_0x17fecd){if(_0x17fecd){return db[_0x5b8c('0x71')][_0x5b8c('0x58')]({'where':{'ContactId':_0x17fecd['id'],'closed':![],'FaxAccountId':_0x40c5bb['id']}})['then'](function(_0x7b2d0a){if(_0x7b2d0a){return[_0x7b2d0a,![]];}return db[_0x5b8c('0x71')][_0x5b8c('0x59')]({'UserId':_0x5b2605[_0x5b8c('0x5b')]['id'],'ContactId':_0x17fecd['id'],'FaxAccountId':_0x40c5bb['id'],'fax':_0x5b2605[_0x5b8c('0x5a')]['to'][0x0],'firstMsgDirection':_0x5b8c('0xae'),'Messages':[_[_0x5b8c('0x4e')](_0x5b2605[_0x5b8c('0x5a')],{'read':![],'body':_0x5b2605['body'][_0x5b8c('0xa3')][0x0][_0x5b8c('0xaf')],'FaxAccountId':_0x40c5bb['id'],'UserId':_0x5b2605['user']['id'],'ContactId':_0x17fecd['id'],'AttachmentId':_0x5b2605['body'][_0x5b8c('0xa3')][0x0]['id']})]},{'include':[{'model':db[_0x5b8c('0x9d')],'as':_0x5b8c('0xb0')}]})['then'](function(_0x37804f){return[_0x37804f,!![]];});});}else{throw new Error(_0x5b8c('0xb1'));}})[_0x5b8c('0xb2')](function(_0x180878,_0x2b44c1){if(_0x2b44c1){return _0x180878;}return db[_0x5b8c('0x9d')][_0x5b8c('0x59')]({'direction':'out','read':![],'body':_0x5b2605[_0x5b8c('0x5a')][_0x5b8c('0xa3')][0x0]['filename'],'FaxAccountId':_0x40c5bb['id'],'FaxInteractionId':_0x180878['id'],'UserId':_0x5b2605['user']['id'],'ContactId':_0x180878['ContactId'],'AttachmentId':_0x5b2605[_0x5b8c('0x5a')][_0x5b8c('0xa3')][0x0]['id']})[_0x5b8c('0x36')](function(_0x425227){_0x180878['dataValues'][_0x5b8c('0xb0')]=[];_0x180878[_0x5b8c('0xb3')][_0x5b8c('0xb0')][_0x5b8c('0x86')](_0x425227['dataValues']);return _0x180878;});})[_0x5b8c('0x36')](function(_0x5a7131){respondWithRpcPromise(_0x5b8c('0xb4'),_0x5b8c('0xb4'),{'FaxAccountId':_[_0x5b8c('0xa7')](_0x5b2605[_0x5b8c('0x55')]['id'])?undefined:_0x5b2605[_0x5b8c('0x55')]['id'],'path':_['isNil'](_0x5b2605[_0x5b8c('0x5a')][_0x5b8c('0xa3')][0x0][_0x5b8c('0xa8')])?undefined:_0x5b2605[_0x5b8c('0x5a')][_0x5b8c('0xa3')][0x0][_0x5b8c('0xa8')],'fax':_['isNil'](_0x5b2605[_0x5b8c('0x5a')]['to'][0x0])?undefined:_0x5b2605['body']['to'][0x0],'AttachmentId':_0x5b2605[_0x5b8c('0x5a')][_0x5b8c('0xa3')][0x0]['id']},client9002)[_0x5b8c('0x36')](function(_0x17409c){logger['info'](_0x5b8c('0xb5'),_0x17409c);})[_0x5b8c('0x29')](function(_0x523d3f){logger['info']('SendFaxRpc,\x20%s',_0x523d3f);});return _0x5a7131;})['then'](respondWithResult(_0x3f27cc,null))[_0x5b8c('0x29')](handleError(_0x3f27cc,null));};exports[_0x5b8c('0xb6')]=function(_0x26326c,_0x1de994,_0x59ab9a){return db[_0x5b8c('0x51')]['find']({'where':{'id':_0x26326c[_0x5b8c('0x55')]['id']}})[_0x5b8c('0x36')](handleEntityNotFound(_0x1de994,null))['then'](function(_0x1ac24f){if(_0x1ac24f){return _0x1ac24f[_0x5b8c('0xb6')](_0x26326c[_0x5b8c('0x5a')][_0x5b8c('0x6a')],_[_0x5b8c('0x72')](_0x26326c['body'],[_0x5b8c('0x6a'),'id'])||{})[_0x5b8c('0xb2')](function(_0x50454d){for(var _0x1f3bfe=0x0;_0x1f3bfe<_0x26326c[_0x5b8c('0x5a')][_0x5b8c('0x6a')]['length'];_0x1f3bfe+=0x1){socket['emit']('userFaxAccount:save',{'UserId':Number(_0x26326c[_0x5b8c('0x5a')][_0x5b8c('0x6a')][_0x1f3bfe]),'FaxAccountId':Number(_0x26326c['params']['id'])});}return _0x50454d;});}})[_0x5b8c('0x36')](respondWithResult(_0x1de994,null))['catch'](handleError(_0x1de994,null));};exports['removeAgents']=function(_0xb49abf,_0x41d13e,_0x5421c1){return db['FaxAccount'][_0x5b8c('0x58')]({'where':{'id':_0xb49abf['params']['id']}})[_0x5b8c('0x36')](handleEntityNotFound(_0x41d13e,null))[_0x5b8c('0x36')](function(_0x1728c9){if(_0x1728c9){return _0x1728c9[_0x5b8c('0xb7')](_0xb49abf[_0x5b8c('0x42')][_0x5b8c('0x6a')])[_0x5b8c('0x36')](function(){if(_[_0x5b8c('0xb8')](_0xb49abf['query'][_0x5b8c('0x6a')])){for(var _0x3959f3=0x0;_0x3959f3<_0xb49abf[_0x5b8c('0x42')]['ids'][_0x5b8c('0x67')];_0x3959f3+=0x1){socket[_0x5b8c('0xb9')](_0x5b8c('0xba'),{'UserId':Number(_0xb49abf[_0x5b8c('0x42')][_0x5b8c('0x6a')][_0x3959f3]),'FaxAccountId':Number(_0xb49abf[_0x5b8c('0x55')]['id'])});}}else{socket['emit'](_0x5b8c('0xba'),{'UserId':Number(_0xb49abf[_0x5b8c('0x42')][_0x5b8c('0x6a')]),'FaxAccountId':Number(_0xb49abf['params']['id'])});}});}})[_0x5b8c('0x36')](respondWithStatusCode(_0x41d13e,null))[_0x5b8c('0x29')](handleError(_0x41d13e,null));};exports[_0x5b8c('0xbb')]=function(_0x44d469,_0x1893c8,_0xdbfc00){var _0x2efdc3={};var _0x505b46={};var _0x558886;var _0x5b06b3;return db[_0x5b8c('0x51')][_0x5b8c('0x6d')]({'where':{'id':_0x44d469[_0x5b8c('0x55')]['id']}})[_0x5b8c('0x36')](handleEntityNotFound(_0x1893c8,null))['then'](function(_0x2145b8){if(_0x2145b8){_0x558886=_0x2145b8;_0x505b46[_0x5b8c('0x45')]=_[_0x5b8c('0x43')](db[_0x5b8c('0xbc')][_0x5b8c('0x40')]);_0x505b46[_0x5b8c('0x42')]=_[_0x5b8c('0x43')](_0x44d469['query']);_0x505b46[_0x5b8c('0x44')]=_[_0x5b8c('0x47')](_0x505b46[_0x5b8c('0x45')],_0x505b46[_0x5b8c('0x42')]);_0x2efdc3[_0x5b8c('0x46')]=_['intersection'](_0x505b46[_0x5b8c('0x45')],qs[_0x5b8c('0x48')](_0x44d469[_0x5b8c('0x42')]['fields']));_0x2efdc3[_0x5b8c('0x46')]=_0x2efdc3[_0x5b8c('0x46')][_0x5b8c('0x67')]?_0x2efdc3[_0x5b8c('0x46')]:_0x505b46[_0x5b8c('0x45')];_0x2efdc3[_0x5b8c('0x49')]=qs['sort'](_0x44d469[_0x5b8c('0x42')]['sort']);_0x2efdc3[_0x5b8c('0x4b')]=qs['filters'](_[_0x5b8c('0x4c')](_0x44d469['query'],_0x505b46['filters']));if(_0x44d469['query'][_0x5b8c('0x4d')]){_0x2efdc3[_0x5b8c('0x4b')]=_[_0x5b8c('0x4e')](_0x2efdc3[_0x5b8c('0x4b')],{'$or':_[_0x5b8c('0x3f')](_0x2efdc3[_0x5b8c('0x46')],function(_0xb09a93){var _0x2405c7={};_0x2405c7[_0xb09a93]={'$like':'%'+_0x44d469[_0x5b8c('0x42')][_0x5b8c('0x4d')]+'%'};return _0x2405c7;})});}_0x2efdc3=_[_0x5b8c('0x4e')]({},_0x2efdc3,_0x44d469['options']);return _0x558886[_0x5b8c('0xbb')](_0x2efdc3);}})[_0x5b8c('0x36')](function(_0x27b760){if(_0x27b760){_0x5b06b3=_0x27b760[_0x5b8c('0x67')];if(!_0x44d469[_0x5b8c('0x42')][_0x5b8c('0x6e')](_0x5b8c('0x68'))){_0x2efdc3[_0x5b8c('0x31')]=qs['limit'](_0x44d469[_0x5b8c('0x42')][_0x5b8c('0x31')]);_0x2efdc3['offset']=qs[_0x5b8c('0x2e')](_0x44d469[_0x5b8c('0x42')][_0x5b8c('0x2e')]);}return _0x558886[_0x5b8c('0xbb')](_0x2efdc3);}})[_0x5b8c('0x36')](function(_0x2d6ebc){if(_0x2d6ebc){return _0x2d6ebc?{'count':_0x5b06b3,'rows':_0x2d6ebc}:null;}})[_0x5b8c('0x36')](respondWithResult(_0x1893c8,null))['catch'](handleError(_0x1893c8,null));};
\ No newline at end of file
+var _0x29b0=['Contact\x20not\x20found','ContactId','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','omit','spread','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','eml-format','rimraf','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','destroy','get','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','FaxAccount','include','findAll','rows','show','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxAccounts','UserProfileSection','autoAssociation','find','params','describe','FaxAccountId','Disposition','filter','removeDispositions','ids','addAnswer','CannedAnswer','findOne','length','removeAnswers','addInteraction','FaxInteraction','getInteractions','CmContact','Contact','User','fullname','internal','Tags','color','tag','addApplications','transaction','FaxApplication','bulkCreate','getApplications','context','exten','localstationid','app','description','Fax\x20Extension','priority','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','maxrate','minrate','modem','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','sequelize','updateAccountApplications','VoiceExtension','tech','updatedAt','TrunkId','ListId','findById','getMessages','$gte','split','FaxMessage','List','Contacts','DESC','attachments','root','CheckAfterSend','isNil','from','format','fax','defaults','Send\x20Fax\x20failed','filename'];(function(_0xcb0171,_0x4d3679){var _0x19d60d=function(_0xb34434){while(--_0xb34434){_0xcb0171['push'](_0xcb0171['shift']());}};_0x19d60d(++_0x4d3679);}(_0x29b0,0xc6));var _0x029b=function(_0x4ce371,_0x51332f){_0x4ce371=_0x4ce371-0x0;var _0xfcbfb3=_0x29b0[_0x4ce371];return _0xfcbfb3;};'use strict';var emlformat=require(_0x029b('0x0'));var rimraf=require(_0x029b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x029b('0x2'));var moment=require(_0x029b('0x3'));var BPromise=require(_0x029b('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x029b('0x5'));var sox=require('sox');var csv=require(_0x029b('0x6'));var ejs=require(_0x029b('0x7'));var fs=require('fs');var fs_extra=require(_0x029b('0x8'));var _=require(_0x029b('0x9'));var squel=require('squel');var crypto=require(_0x029b('0xa'));var jsforce=require(_0x029b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x029b('0x6'));var querystring=require(_0x029b('0xc'));var Papa=require(_0x029b('0xd'));var Redis=require(_0x029b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x029b('0xf'));var as=require(_0x029b('0x10'));var hardwareService=require(_0x029b('0x11'));var logger=require('../../config/logger')(_0x029b('0x12'));var utils=require(_0x029b('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x029b('0x14'));var db=require(_0x029b('0x15'))['db'];config[_0x029b('0x16')]=_['defaults'](config['redis'],{'host':_0x029b('0x17'),'port':0x18eb});var socket=require(_0x029b('0x18'))(new Redis(config['redis']));require(_0x029b('0x19'))[_0x029b('0x1a')](socket);var jayson=require(_0x029b('0x1b'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3d1ff2,_0x220d6b,_0x4b47b9,_0x5bc564){return new BPromise(function(_0x2634db,_0x30a0cd){var _0x2ef742=_0x5bc564||client;return _0x2ef742[_0x029b('0x1c')](_0x3d1ff2,_0x4b47b9)[_0x029b('0x1d')](function(_0x33236d){logger[_0x029b('0x1e')]('FaxAccount,\x20%s,\x20%s',_0x220d6b,_0x029b('0x1f'));logger[_0x029b('0x20')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x220d6b,'request\x20sent',JSON[_0x029b('0x21')](_0x33236d));if(_0x33236d['error']){if(_0x33236d[_0x029b('0x22')][_0x029b('0x23')]===0x1f4){logger[_0x029b('0x22')](_0x029b('0x24'),_0x220d6b,_0x33236d['error'][_0x029b('0x25')]);return _0x30a0cd(_0x33236d['error'][_0x029b('0x25')]);}logger[_0x029b('0x22')](_0x029b('0x24'),_0x220d6b,_0x33236d[_0x029b('0x22')][_0x029b('0x25')]);return _0x2634db(_0x33236d['error'][_0x029b('0x25')]);}else{logger['info'](_0x029b('0x24'),_0x220d6b,'request\x20sent');_0x2634db(_0x33236d[_0x029b('0x26')][_0x029b('0x25')]);}})[_0x029b('0x27')](function(_0x248883){logger[_0x029b('0x22')](_0x029b('0x24'),_0x220d6b,_0x248883);_0x30a0cd(_0x248883);});});}function respondWithStatusCode(_0xec963,_0x74d8ee){_0x74d8ee=_0x74d8ee||0xcc;return function(_0x30e4e7){if(_0x30e4e7){return _0xec963[_0x029b('0x28')](_0x74d8ee);}return _0xec963[_0x029b('0x29')](_0x74d8ee)['end']();};}function respondWithResult(_0x58767b,_0x3bedf0){_0x3bedf0=_0x3bedf0||0xc8;return function(_0x4ad027){if(_0x4ad027){return _0x58767b[_0x029b('0x29')](_0x3bedf0)[_0x029b('0x2a')](_0x4ad027);}};}function respondWithFilteredResult(_0x12e821,_0x36d1e8){return function(_0x59bc27){if(_0x59bc27){var _0x133282=typeof _0x36d1e8[_0x029b('0x2b')]===_0x029b('0x2c')&&typeof _0x36d1e8[_0x029b('0x2d')]===_0x029b('0x2c');var _0x252e9b=_0x59bc27[_0x029b('0x2e')];var _0x35a277=_0x133282?0x0:_0x36d1e8[_0x029b('0x2b')];var _0x3098eb=_0x133282?_0x59bc27[_0x029b('0x2e')]:_0x36d1e8[_0x029b('0x2b')]+_0x36d1e8['limit'];var _0x4b2327;if(_0x3098eb>=_0x252e9b){_0x3098eb=_0x252e9b;_0x4b2327=0xc8;}else{_0x4b2327=0xce;}_0x12e821[_0x029b('0x29')](_0x4b2327);return _0x12e821[_0x029b('0x2f')]('Content-Range',_0x35a277+'-'+_0x3098eb+'/'+_0x252e9b)['json'](_0x59bc27);}return null;};}function patchUpdates(_0x29720a){return function(_0x55af4a){try{jsonpatch[_0x029b('0x30')](_0x55af4a,_0x29720a,!![]);}catch(_0xf86ff){return BPromise[_0x029b('0x31')](_0xf86ff);}return _0x55af4a['save']();};}function saveUpdates(_0x5bee1f,_0x103bd0){return function(_0x1d1027){if(_0x1d1027){return _0x1d1027[_0x029b('0x32')](_0x5bee1f)[_0x029b('0x1d')](function(_0x5dc8b9){return _0x5dc8b9;});}return null;};}function removeEntity(_0x413088,_0x4d4314){return function(_0x4e6905){if(_0x4e6905){return _0x4e6905[_0x029b('0x33')]()[_0x029b('0x1d')](function(){var _0x1dd2ee=_0x4e6905[_0x029b('0x34')]({'plain':!![]});var _0x2e0a3b='FaxAccounts';return db[_0x029b('0x35')][_0x029b('0x33')]({'where':{'type':_0x2e0a3b,'resourceId':_0x1dd2ee['id']}})[_0x029b('0x1d')](function(){return _0x4e6905;});})[_0x029b('0x1d')](function(){_0x413088[_0x029b('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x322292,_0x5155d1){return function(_0x4e96ec){if(!_0x4e96ec){_0x322292[_0x029b('0x28')](0x194);}return _0x4e96ec;};}function handleError(_0x4a91ce,_0x24e0c6){_0x24e0c6=_0x24e0c6||0x1f4;return function(_0x34e70f){logger[_0x029b('0x22')](_0x34e70f[_0x029b('0x36')]);if(_0x34e70f['name']){delete _0x34e70f[_0x029b('0x37')];}_0x4a91ce['status'](_0x24e0c6)[_0x029b('0x38')](_0x34e70f);};}exports[_0x029b('0x39')]=function(_0x502df9,_0x4197a3){var _0x20dbc7={'include':[{'model':db[_0x029b('0x3a')],'as':_0x029b('0x3b')}]},_0x31a722={},_0x1ab51a={'count':0x0,'rows':[]};var _0x38e333=_[_0x029b('0x3c')](db['FaxAccount'][_0x029b('0x3d')],function(_0x55f376){return{'name':_0x55f376[_0x029b('0x3e')],'type':_0x55f376['type'][_0x029b('0x3f')]};});_0x31a722[_0x029b('0x40')]=_['map'](_0x38e333,'name');_0x31a722['query']=_[_0x029b('0x41')](_0x502df9[_0x029b('0x42')]);_0x31a722[_0x029b('0x43')]=_[_0x029b('0x44')](_0x31a722[_0x029b('0x40')],_0x31a722[_0x029b('0x42')]);_0x20dbc7[_0x029b('0x45')]=_[_0x029b('0x44')](_0x31a722[_0x029b('0x40')],qs[_0x029b('0x46')](_0x502df9[_0x029b('0x42')][_0x029b('0x46')]));_0x20dbc7['attributes']=_0x20dbc7[_0x029b('0x45')]['length']?_0x20dbc7[_0x029b('0x45')]:_0x31a722[_0x029b('0x40')];if(!_0x502df9[_0x029b('0x42')][_0x029b('0x47')](_0x029b('0x48'))){_0x20dbc7[_0x029b('0x2d')]=qs[_0x029b('0x2d')](_0x502df9[_0x029b('0x42')][_0x029b('0x2d')]);_0x20dbc7[_0x029b('0x2b')]=qs[_0x029b('0x2b')](_0x502df9[_0x029b('0x42')][_0x029b('0x2b')]);}_0x20dbc7[_0x029b('0x49')]=qs[_0x029b('0x4a')](_0x502df9[_0x029b('0x42')][_0x029b('0x4a')]);_0x20dbc7[_0x029b('0x4b')]=qs[_0x029b('0x43')](_[_0x029b('0x4c')](_0x502df9['query'],_0x31a722[_0x029b('0x43')]),_0x38e333);if(_0x502df9['query']['filter']){_0x20dbc7[_0x029b('0x4b')]=_[_0x029b('0x4d')](_0x20dbc7['where'],{'$or':_[_0x029b('0x3c')](_0x38e333,function(_0x22afea){if(_0x22afea[_0x029b('0x4e')]!==_0x029b('0x4f')){var _0x18fa7e={};_0x18fa7e[_0x22afea[_0x029b('0x37')]]={'$like':'%'+_0x502df9[_0x029b('0x42')]['filter']+'%'};return _0x18fa7e;}})});}_0x20dbc7=_[_0x029b('0x4d')]({},_0x20dbc7,_0x502df9['options']);var _0x2c5c44={'where':_0x20dbc7['where']};return db[_0x029b('0x50')][_0x029b('0x2e')](_0x2c5c44)[_0x029b('0x1d')](function(_0x2dd756){_0x1ab51a['count']=_0x2dd756;if(_0x502df9[_0x029b('0x42')]['includeAll']){_0x20dbc7[_0x029b('0x51')]=[{'all':!![]}];}return db['FaxAccount'][_0x029b('0x52')](_0x20dbc7);})[_0x029b('0x1d')](function(_0xea6994){_0x1ab51a[_0x029b('0x53')]=_0xea6994;return _0x1ab51a;})[_0x029b('0x1d')](respondWithFilteredResult(_0x4197a3,_0x20dbc7))[_0x029b('0x27')](handleError(_0x4197a3,null));};exports[_0x029b('0x54')]=function(_0x786bad,_0x2fb0a0){var _0x43aba7={'raw':![],'where':{'id':_0x786bad['params']['id']},'include':[{'model':db['Pause'],'as':_0x029b('0x3b')}]},_0x3d131e={};_0x3d131e[_0x029b('0x40')]=_[_0x029b('0x41')](db['FaxAccount'][_0x029b('0x3d')]);_0x3d131e[_0x029b('0x42')]=_[_0x029b('0x41')](_0x786bad[_0x029b('0x42')]);_0x3d131e[_0x029b('0x43')]=_['intersection'](_0x3d131e['model'],_0x3d131e[_0x029b('0x42')]);_0x43aba7['attributes']=_[_0x029b('0x44')](_0x3d131e[_0x029b('0x40')],qs[_0x029b('0x46')](_0x786bad[_0x029b('0x42')][_0x029b('0x46')]));_0x43aba7[_0x029b('0x45')]=_0x43aba7['attributes']['length']?_0x43aba7[_0x029b('0x45')]:_0x3d131e[_0x029b('0x40')];if(_0x786bad[_0x029b('0x42')][_0x029b('0x55')]){_0x43aba7['include']=[{'all':!![]}];}_0x43aba7=_[_0x029b('0x4d')]({},_0x43aba7,_0x786bad[_0x029b('0x56')]);return db['FaxAccount']['find'](_0x43aba7)[_0x029b('0x1d')](handleEntityNotFound(_0x2fb0a0,null))['then'](respondWithResult(_0x2fb0a0,null))[_0x029b('0x27')](handleError(_0x2fb0a0,null));};exports[_0x029b('0x57')]=function(_0x364bbf,_0x13f280){return db[_0x029b('0x50')][_0x029b('0x57')](_0x364bbf[_0x029b('0x58')],{})['then'](function(_0x2fe8b1){var _0x3d3df0=_0x364bbf[_0x029b('0x59')][_0x029b('0x34')]({'plain':!![]});if(!_0x3d3df0)throw new Error(_0x029b('0x5a'));if(_0x3d3df0[_0x029b('0x5b')]===_0x029b('0x59')){var _0x4a5597=_0x2fe8b1[_0x029b('0x34')]({'plain':!![]});var _0x27cb9e=_0x029b('0x5c');return db[_0x029b('0x5d')]['find']({'where':{'name':_0x27cb9e,'userProfileId':_0x3d3df0['userProfileId']},'raw':!![]})[_0x029b('0x1d')](function(_0x3f522){if(_0x3f522&&_0x3f522[_0x029b('0x5e')]===0x0){return db[_0x029b('0x35')][_0x029b('0x57')]({'name':_0x4a5597[_0x029b('0x37')],'resourceId':_0x4a5597['id'],'type':_0x3f522[_0x029b('0x37')],'sectionId':_0x3f522['id']},{})[_0x029b('0x1d')](function(){return _0x2fe8b1;});}else{return _0x2fe8b1;}})[_0x029b('0x27')](function(_0x2ec975){logger[_0x029b('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ec975);throw _0x2ec975;});}return _0x2fe8b1;})[_0x029b('0x1d')](respondWithResult(_0x13f280,0xc9))[_0x029b('0x27')](handleError(_0x13f280,null));};exports[_0x029b('0x32')]=function(_0x2875f0,_0x16f328){if(_0x2875f0[_0x029b('0x58')]['id']){delete _0x2875f0[_0x029b('0x58')]['id'];}return db[_0x029b('0x50')][_0x029b('0x5f')]({'where':{'id':_0x2875f0[_0x029b('0x60')]['id']},'include':[{'model':db[_0x029b('0x3a')],'as':_0x029b('0x3b')}]})[_0x029b('0x1d')](handleEntityNotFound(_0x16f328,null))['then'](saveUpdates(_0x2875f0[_0x029b('0x58')],null))[_0x029b('0x1d')](respondWithResult(_0x16f328,null))[_0x029b('0x27')](handleError(_0x16f328,null));};exports[_0x029b('0x33')]=function(_0x25ab28,_0x493320){return db[_0x029b('0x50')][_0x029b('0x5f')]({'where':{'id':_0x25ab28[_0x029b('0x60')]['id']}})[_0x029b('0x1d')](handleEntityNotFound(_0x493320,null))['then'](removeEntity(_0x493320,null))[_0x029b('0x27')](handleError(_0x493320,null));};exports['describe']=function(_0x1c8813,_0x5a5533){return db['FaxAccount'][_0x029b('0x61')]()[_0x029b('0x1d')](respondWithResult(_0x5a5533,null))[_0x029b('0x27')](handleError(_0x5a5533,null));};exports['addDisposition']=function(_0x1572c8,_0x4ffe66,_0x234d3d){if(_0x1572c8[_0x029b('0x58')]['id']){delete _0x1572c8[_0x029b('0x58')]['id'];}return db[_0x029b('0x50')][_0x029b('0x5f')]({'where':{'id':_0x1572c8[_0x029b('0x60')]['id']}})[_0x029b('0x1d')](handleEntityNotFound(_0x4ffe66,null))['then'](function(_0x2c4b19){if(_0x2c4b19){_0x1572c8[_0x029b('0x58')][_0x029b('0x62')]=_0x2c4b19['id'];return db[_0x029b('0x63')][_0x029b('0x57')](_0x1572c8['body']);}})[_0x029b('0x1d')](respondWithResult(_0x4ffe66,null))['catch'](handleError(_0x4ffe66,null));};exports['getDispositions']=function(_0x3c48e2,_0x3d8ed0,_0x322c23){var _0x4a0e48={'raw':![],'where':{}};var _0x36f8b6={};var _0x2e04e2={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x3c48e2[_0x029b('0x60')]['id']}})[_0x029b('0x1d')](handleEntityNotFound(_0x3d8ed0,null))['then'](function(_0x151426){if(_0x151426){_0x36f8b6[_0x029b('0x40')]=_[_0x029b('0x41')](db['Disposition']['rawAttributes']);_0x36f8b6[_0x029b('0x42')]=_[_0x029b('0x41')](_0x3c48e2[_0x029b('0x42')]);_0x36f8b6[_0x029b('0x43')]=_['intersection'](_0x36f8b6[_0x029b('0x40')],_0x36f8b6[_0x029b('0x42')]);_0x4a0e48['attributes']=_['intersection'](_0x36f8b6['model'],qs[_0x029b('0x46')](_0x3c48e2[_0x029b('0x42')][_0x029b('0x46')]));_0x4a0e48[_0x029b('0x45')]=_0x4a0e48[_0x029b('0x45')]['length']?_0x4a0e48[_0x029b('0x45')]:_0x36f8b6[_0x029b('0x40')];if(!_0x3c48e2[_0x029b('0x42')][_0x029b('0x47')](_0x029b('0x48'))){_0x4a0e48['limit']=qs[_0x029b('0x2d')](_0x3c48e2['query'][_0x029b('0x2d')]);_0x4a0e48[_0x029b('0x2b')]=qs[_0x029b('0x2b')](_0x3c48e2['query'][_0x029b('0x2b')]);}_0x4a0e48[_0x029b('0x49')]=qs[_0x029b('0x4a')](_0x3c48e2[_0x029b('0x42')]['sort']);_0x4a0e48[_0x029b('0x4b')]=qs[_0x029b('0x43')](_[_0x029b('0x4c')](_0x3c48e2[_0x029b('0x42')],_0x36f8b6[_0x029b('0x43')]));_0x4a0e48['where'][_0x029b('0x62')]=_0x151426['id'];if(_0x3c48e2[_0x029b('0x42')][_0x029b('0x64')]){_0x4a0e48[_0x029b('0x4b')]=_[_0x029b('0x4d')](_0x4a0e48[_0x029b('0x4b')],{'$or':_[_0x029b('0x3c')](_0x4a0e48[_0x029b('0x45')],function(_0x2faea5){var _0x16dcf9={};_0x16dcf9[_0x2faea5]={'$like':'%'+_0x3c48e2[_0x029b('0x42')][_0x029b('0x64')]+'%'};return _0x16dcf9;})});}_0x4a0e48=_['merge']({},_0x4a0e48,_0x3c48e2['options']);return db['Disposition'][_0x029b('0x2e')]({'where':_0x4a0e48[_0x029b('0x4b')]})[_0x029b('0x1d')](function(_0x566d17){_0x2e04e2[_0x029b('0x2e')]=_0x566d17;if(_0x3c48e2[_0x029b('0x42')]['includeAll']){_0x4a0e48[_0x029b('0x51')]=[{'all':!![]}];}return db[_0x029b('0x63')]['findAll'](_0x4a0e48);})[_0x029b('0x1d')](function(_0x3c1079){_0x2e04e2[_0x029b('0x53')]=_0x3c1079;return _0x2e04e2;});}})[_0x029b('0x1d')](respondWithFilteredResult(_0x3d8ed0,_0x4a0e48))[_0x029b('0x27')](handleError(_0x3d8ed0,null));};exports[_0x029b('0x65')]=function(_0x5cd9bf,_0xc9303b,_0x56a699){return db[_0x029b('0x50')][_0x029b('0x5f')]({'where':{'id':_0x5cd9bf[_0x029b('0x60')]['id']}})[_0x029b('0x1d')](handleEntityNotFound(_0xc9303b,null))['then'](function(_0x39f3f1){if(_0x39f3f1){return _0x39f3f1[_0x029b('0x65')](_0x5cd9bf[_0x029b('0x42')][_0x029b('0x66')]);}})['then'](respondWithStatusCode(_0xc9303b,null))[_0x029b('0x27')](handleError(_0xc9303b,null));};exports[_0x029b('0x67')]=function(_0xb4fa79,_0x3914b9,_0x4a5b27){if(_0xb4fa79[_0x029b('0x58')]['id']){delete _0xb4fa79[_0x029b('0x58')]['id'];}return db[_0x029b('0x50')]['find']({'where':{'id':_0xb4fa79[_0x029b('0x60')]['id']}})[_0x029b('0x1d')](handleEntityNotFound(_0x3914b9,null))[_0x029b('0x1d')](function(_0x342a8d){if(_0x342a8d){_0xb4fa79[_0x029b('0x58')]['FaxAccountId']=_0x342a8d['id'];return db[_0x029b('0x68')]['create'](_0xb4fa79[_0x029b('0x58')]);}})['then'](respondWithResult(_0x3914b9,null))['catch'](handleError(_0x3914b9,null));};exports['getAnswers']=function(_0x477411,_0x191d8c,_0x2724a9){var _0x142305={'raw':![],'where':{}};var _0x4f77b0={};var _0x3379da={'count':0x0,'rows':[]};return db[_0x029b('0x50')][_0x029b('0x69')]({'where':{'id':_0x477411[_0x029b('0x60')]['id']}})[_0x029b('0x1d')](handleEntityNotFound(_0x191d8c,null))[_0x029b('0x1d')](function(_0x15420b){if(_0x15420b){_0x4f77b0['model']=_['keys'](db[_0x029b('0x68')]['rawAttributes']);_0x4f77b0[_0x029b('0x42')]=_['keys'](_0x477411[_0x029b('0x42')]);_0x4f77b0[_0x029b('0x43')]=_[_0x029b('0x44')](_0x4f77b0['model'],_0x4f77b0[_0x029b('0x42')]);_0x142305['attributes']=_[_0x029b('0x44')](_0x4f77b0['model'],qs[_0x029b('0x46')](_0x477411[_0x029b('0x42')][_0x029b('0x46')]));_0x142305[_0x029b('0x45')]=_0x142305[_0x029b('0x45')][_0x029b('0x6a')]?_0x142305[_0x029b('0x45')]:_0x4f77b0['model'];if(!_0x477411['query'][_0x029b('0x47')](_0x029b('0x48'))){_0x142305[_0x029b('0x2d')]=qs[_0x029b('0x2d')](_0x477411['query']['limit']);_0x142305[_0x029b('0x2b')]=qs['offset'](_0x477411[_0x029b('0x42')][_0x029b('0x2b')]);}_0x142305[_0x029b('0x49')]=qs[_0x029b('0x4a')](_0x477411['query']['sort']);_0x142305[_0x029b('0x4b')]=qs[_0x029b('0x43')](_[_0x029b('0x4c')](_0x477411['query'],_0x4f77b0[_0x029b('0x43')]));_0x142305[_0x029b('0x4b')][_0x029b('0x62')]=_0x15420b['id'];if(_0x477411[_0x029b('0x42')][_0x029b('0x64')]){_0x142305['where']=_[_0x029b('0x4d')](_0x142305[_0x029b('0x4b')],{'$or':_[_0x029b('0x3c')](_0x142305[_0x029b('0x45')],function(_0x5cf980){var _0x752306={};_0x752306[_0x5cf980]={'$like':'%'+_0x477411[_0x029b('0x42')]['filter']+'%'};return _0x752306;})});}_0x142305=_[_0x029b('0x4d')]({},_0x142305,_0x477411[_0x029b('0x56')]);return db['CannedAnswer'][_0x029b('0x2e')]({'where':_0x142305[_0x029b('0x4b')]})[_0x029b('0x1d')](function(_0x56ab29){_0x3379da['count']=_0x56ab29;if(_0x477411['query']['includeAll']){_0x142305[_0x029b('0x51')]=[{'all':!![]}];}return db[_0x029b('0x68')][_0x029b('0x52')](_0x142305);})[_0x029b('0x1d')](function(_0x2902f6){_0x3379da[_0x029b('0x53')]=_0x2902f6;return _0x3379da;});}})[_0x029b('0x1d')](respondWithFilteredResult(_0x191d8c,_0x142305))[_0x029b('0x27')](handleError(_0x191d8c,null));};exports[_0x029b('0x6b')]=function(_0x16753f,_0x3d9c0b,_0x3b8227){return db[_0x029b('0x50')][_0x029b('0x5f')]({'where':{'id':_0x16753f[_0x029b('0x60')]['id']}})[_0x029b('0x1d')](handleEntityNotFound(_0x3d9c0b,null))[_0x029b('0x1d')](function(_0x4b19c5){if(_0x4b19c5){return _0x4b19c5[_0x029b('0x6b')](_0x16753f['query']['ids']);}})[_0x029b('0x1d')](respondWithStatusCode(_0x3d9c0b,null))[_0x029b('0x27')](handleError(_0x3d9c0b,null));};exports[_0x029b('0x6c')]=function(_0x38dc32,_0x265f4e,_0x3214b2){return db[_0x029b('0x6d')][_0x029b('0x5f')]({'where':{'id':_0x38dc32[_0x029b('0x60')]['id']}})['then'](handleEntityNotFound(_0x265f4e,null))[_0x029b('0x1d')](function(_0x11a043){if(_0x11a043){return _0x11a043[_0x029b('0x6c')](_0x38dc32[_0x029b('0x58')][_0x029b('0x66')],_['omit'](_0x38dc32[_0x029b('0x58')],['ids','id'])||{});}})[_0x029b('0x1d')](respondWithResult(_0x265f4e,null))[_0x029b('0x27')](handleError(_0x265f4e,null));};exports[_0x029b('0x6e')]=function(_0x2c8625,_0x4ed7f6,_0x107d95){var _0x14b0a1={'raw':![],'where':{}};var _0x6f8765={};var _0x56f37f={'count':0x0,'rows':[]};return db[_0x029b('0x50')]['findOne']({'where':{'id':_0x2c8625[_0x029b('0x60')]['id']}})[_0x029b('0x1d')](handleEntityNotFound(_0x4ed7f6,null))['then'](function(_0x383576){if(_0x383576){_0x6f8765[_0x029b('0x40')]=_[_0x029b('0x41')](db[_0x029b('0x6d')][_0x029b('0x3d')]);_0x6f8765[_0x029b('0x42')]=_['keys'](_0x2c8625['query']);_0x6f8765[_0x029b('0x43')]=_[_0x029b('0x44')](_0x6f8765[_0x029b('0x40')],_0x6f8765[_0x029b('0x42')]);_0x14b0a1['attributes']=_[_0x029b('0x44')](_0x6f8765[_0x029b('0x40')],qs[_0x029b('0x46')](_0x2c8625[_0x029b('0x42')][_0x029b('0x46')]));_0x14b0a1[_0x029b('0x45')]=_0x14b0a1[_0x029b('0x45')]['length']?_0x14b0a1[_0x029b('0x45')]:_0x6f8765[_0x029b('0x40')];if(!_0x2c8625[_0x029b('0x42')][_0x029b('0x47')]('nolimit')){_0x14b0a1[_0x029b('0x2d')]=qs[_0x029b('0x2d')](_0x2c8625[_0x029b('0x42')][_0x029b('0x2d')]);_0x14b0a1[_0x029b('0x2b')]=qs[_0x029b('0x2b')](_0x2c8625[_0x029b('0x42')]['offset']);}_0x14b0a1[_0x029b('0x49')]=qs['sort'](_0x2c8625['query'][_0x029b('0x4a')]);_0x14b0a1[_0x029b('0x4b')]=qs[_0x029b('0x43')](_[_0x029b('0x4c')](_0x2c8625[_0x029b('0x42')],_0x6f8765['filters']));_0x14b0a1[_0x029b('0x4b')]['FaxAccountId']=_0x383576['id'];if(_0x2c8625[_0x029b('0x42')][_0x029b('0x64')]){_0x14b0a1[_0x029b('0x4b')]=_[_0x029b('0x4d')](_0x14b0a1[_0x029b('0x4b')],{'$or':_[_0x029b('0x3c')](_0x14b0a1[_0x029b('0x45')],function(_0xd73175){var _0x581275={};_0x581275[_0xd73175]={'$like':'%'+_0x2c8625['query'][_0x029b('0x64')]+'%'};return _0x581275;})});}_0x14b0a1=_[_0x029b('0x4d')]({},_0x14b0a1,_0x2c8625[_0x029b('0x56')]);return db[_0x029b('0x6d')][_0x029b('0x2e')]({'where':_0x14b0a1['where']})[_0x029b('0x1d')](function(_0x4ede2a){_0x56f37f['count']=_0x4ede2a;if(_0x2c8625['query'][_0x029b('0x55')]){_0x14b0a1[_0x029b('0x51')]=[{'model':db[_0x029b('0x6f')],'as':_0x029b('0x70'),'required':![]},{'model':db[_0x029b('0x71')],'as':'Owner','attributes':[_0x029b('0x37'),_0x029b('0x72'),_0x029b('0x73')],'required':![]},{'model':db['Tag'],'as':_0x029b('0x74'),'attributes':['id',_0x029b('0x37'),_0x029b('0x75')],'where':_0x2c8625[_0x029b('0x42')][_0x029b('0x76')]?{'id':_0x2c8625['query'][_0x029b('0x76')]}:undefined,'required':_0x2c8625[_0x029b('0x42')][_0x029b('0x76')]?!![]:![]}];}return db[_0x029b('0x6d')][_0x029b('0x52')](_0x14b0a1);})[_0x029b('0x1d')](function(_0x10f39e){_0x56f37f['rows']=_0x10f39e;return _0x56f37f;});}})['then'](respondWithFilteredResult(_0x4ed7f6,_0x14b0a1))['catch'](handleError(_0x4ed7f6,null));};exports[_0x029b('0x77')]=function(_0x29df33,_0xaa2c19,_0x31cfd7){return db[_0x029b('0x50')][_0x029b('0x69')]({'where':{'id':_0x29df33[_0x029b('0x60')]['id']}})[_0x029b('0x1d')](handleEntityNotFound(_0xaa2c19,null))[_0x029b('0x1d')](function(_0x4b7eeb){if(_0x4b7eeb){return db['sequelize'][_0x029b('0x78')](function(_0x105528){return db[_0x029b('0x79')][_0x029b('0x33')]({'where':{'FaxAccountId':_0x29df33[_0x029b('0x60')]['id']},'transaction':_0x105528})['then'](function(_0xd26161){var _0x77c6cd=_[_0x029b('0x3c')](_0x29df33[_0x029b('0x58')],function(_0x4f6ddd){_0x4f6ddd[_0x029b('0x62')]=_0x29df33[_0x029b('0x60')]['id'];return _0x4f6ddd;});return db['FaxApplication'][_0x029b('0x7a')](_0x77c6cd,{'transaction':_0x105528});});})[_0x029b('0x1d')](function(){return db[_0x029b('0x79')]['findAndCountAll']({'where':{'FaxAccountId':_0x29df33['params']['id']},'order':'priority'});});}})[_0x029b('0x1d')](respondWithResult(_0xaa2c19,null))[_0x029b('0x27')](handleError(_0xaa2c19,null));};exports['getApplications']=function(_0x240f23,_0x1489d3,_0x56fdee){var _0x4e7994={};var _0x1f078c={};var _0x5b0faf;var _0x482811;return db[_0x029b('0x50')][_0x029b('0x69')]({'where':{'id':_0x240f23[_0x029b('0x60')]['id']}})[_0x029b('0x1d')](handleEntityNotFound(_0x1489d3,null))[_0x029b('0x1d')](function(_0x125022){if(_0x125022){_0x5b0faf=_0x125022;_0x1f078c[_0x029b('0x40')]=_[_0x029b('0x41')](db['FaxApplication']['rawAttributes']);_0x1f078c[_0x029b('0x42')]=_['keys'](_0x240f23[_0x029b('0x42')]);_0x1f078c[_0x029b('0x43')]=_[_0x029b('0x44')](_0x1f078c['model'],_0x1f078c[_0x029b('0x42')]);_0x4e7994[_0x029b('0x45')]=_[_0x029b('0x44')](_0x1f078c[_0x029b('0x40')],qs[_0x029b('0x46')](_0x240f23[_0x029b('0x42')][_0x029b('0x46')]));_0x4e7994[_0x029b('0x45')]=_0x4e7994['attributes'][_0x029b('0x6a')]?_0x4e7994['attributes']:_0x1f078c[_0x029b('0x40')];_0x4e7994['order']=qs[_0x029b('0x4a')](_0x240f23[_0x029b('0x42')][_0x029b('0x4a')]);_0x4e7994['where']=qs[_0x029b('0x43')](_[_0x029b('0x4c')](_0x240f23[_0x029b('0x42')],_0x1f078c[_0x029b('0x43')]));if(_0x240f23['query'][_0x029b('0x64')]){_0x4e7994[_0x029b('0x4b')]=_[_0x029b('0x4d')](_0x4e7994[_0x029b('0x4b')],{'$or':_[_0x029b('0x3c')](_0x4e7994[_0x029b('0x45')],function(_0xec3cbb){var _0x2cfb00={};_0x2cfb00[_0xec3cbb]={'$like':'%'+_0x240f23[_0x029b('0x42')][_0x029b('0x64')]+'%'};return _0x2cfb00;})});}_0x4e7994=_['merge']({},_0x4e7994,_0x240f23[_0x029b('0x56')]);return _0x5b0faf[_0x029b('0x7b')](_0x4e7994);}})[_0x029b('0x1d')](function(_0x24cb51){if(_0x24cb51){_0x482811=_0x24cb51[_0x029b('0x6a')];if(!_0x240f23[_0x029b('0x42')][_0x029b('0x47')](_0x029b('0x48'))){_0x4e7994[_0x029b('0x2d')]=qs[_0x029b('0x2d')](_0x240f23[_0x029b('0x42')][_0x029b('0x2d')]);_0x4e7994[_0x029b('0x2b')]=qs['offset'](_0x240f23[_0x029b('0x42')][_0x029b('0x2b')]);}return _0x5b0faf[_0x029b('0x7b')](_0x4e7994);}})['then'](function(_0x1228e6){if(_0x1228e6){return _0x1228e6?{'count':_0x482811,'rows':_0x1228e6}:null;}})[_0x029b('0x1d')](respondWithResult(_0x1489d3,null))[_0x029b('0x27')](handleError(_0x1489d3,null));};function Extension(_0x1e44a6,_0x256cb3,_0x37dc8b,_0x1e434b){this[_0x029b('0x7c')]='from-voip-provider';this[_0x029b('0x7d')]=_0x1e44a6[_0x029b('0x7e')];this[_0x029b('0x7f')]=_0x1e434b;this[_0x029b('0x4e')]='system';this[_0x029b('0x80')]=_0x029b('0x81');this['FaxAccountId']=_0x1e44a6['id'];this[_0x029b('0x82')]=_0x256cb3;this['appdata']=_0x37dc8b;}function createExtensionsReciveFax(_0x2997c3){var _0x750375=0x1;var _0x16e494=[];_0x16e494[_0x029b('0x83')](new Extension(_0x2997c3,_0x750375,'','Answer'));_0x750375+=0x1;_0x16e494['push'](new Extension(_0x2997c3,_0x750375,_0x029b('0x84'),_0x029b('0x85')));_0x750375+=0x1;for(var _0x3c5a83 in _0x2997c3){if(_0x2997c3[_0x029b('0x47')](_0x3c5a83)&&(_0x3c5a83===_0x029b('0x86')||_0x3c5a83===_0x029b('0x7e')||_0x3c5a83===_0x029b('0x87')||_0x3c5a83===_0x029b('0x88')||_0x3c5a83==='headerinfo'||_0x3c5a83===_0x029b('0x89')||_0x3c5a83===_0x029b('0x8a')||_0x3c5a83===_0x029b('0x8b')||_0x3c5a83===_0x029b('0x8c'))){_0x16e494[_0x029b('0x83')](new Extension(_0x2997c3,_0x750375,_0x029b('0x8d')+_0x3c5a83+')='+_0x2997c3[_0x3c5a83],_0x029b('0x85')));_0x750375+=0x1;}}_0x16e494[_0x029b('0x83')](new Extension(_0x2997c3,_0x750375,'6','Wait'));_0x750375+=0x1;_0x16e494[_0x029b('0x83')](new Extension(_0x2997c3,_0x750375,_0x029b('0x8e'),_0x029b('0x8f')));_0x750375=0x0;return _0x16e494;}exports[_0x029b('0x90')]=function(_0x2ccdee,_0x41f449,_0x2bffba){var _0x9bd282;return db[_0x029b('0x91')]['transaction'](function(_0x38db25){return db[_0x029b('0x50')][_0x029b('0x57')](_0x2ccdee[_0x029b('0x58')],{'transaction':_0x38db25})[_0x029b('0x1d')](function(_0x48c26e){_0x9bd282=_0x48c26e[_0x029b('0x34')]({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x9bd282),{'transaction':_0x38db25});});})[_0x029b('0x1d')](function(){return _0x9bd282;})['then'](respondWithResult(_0x41f449,null))[_0x029b('0x27')](handleError(_0x41f449,null));};exports[_0x029b('0x92')]=function(_0x53f1bc,_0x30c19c,_0x302483){var _0xd09801;return db[_0x029b('0x91')]['transaction'](function(_0x445ca0){return db['FaxAccount'][_0x029b('0x32')](_0x53f1bc[_0x029b('0x58')],{'where':{'id':_0x53f1bc[_0x029b('0x58')]['id']},'transaction':_0x445ca0})['then'](function(_0x32e7fe){return db[_0x029b('0x93')]['destroy']({'where':{'FaxAccountId':_0x53f1bc['body']['id']},'transaction':_0x445ca0})['then'](function(_0x1c3ee5){return db[_0x029b('0x93')]['bulkCreate'](createExtensionsReciveFax(_['omit'](_0x53f1bc[_0x029b('0x58')],[_0x029b('0x94'),_0x029b('0x3f'),'createdAt',_0x029b('0x95'),_0x029b('0x96'),_0x029b('0x97')])),{'transaction':_0x445ca0});});});})[_0x029b('0x1d')](function(){return db[_0x029b('0x50')][_0x029b('0x98')](_0x53f1bc[_0x029b('0x58')]['id']);})[_0x029b('0x1d')](respondWithResult(_0x30c19c,null))[_0x029b('0x27')](handleError(_0x30c19c,null));};exports[_0x029b('0x99')]=function(_0x401efc,_0x49d7df,_0x4213c3){var _0x4488d7={'raw':!![],'where':{}};var _0x28a640={};var _0x44d849={'count':0x0,'rows':[]};return db[_0x029b('0x50')]['findOne']({'where':{'id':_0x401efc[_0x029b('0x60')]['id']}})['then'](handleEntityNotFound(_0x49d7df,null))[_0x029b('0x1d')](function(_0x1dcd19){if(_0x1dcd19){_0x28a640[_0x029b('0x40')]=_[_0x029b('0x41')](db['FaxMessage'][_0x029b('0x3d')]);_0x28a640['query']=_[_0x029b('0x41')](_0x401efc[_0x029b('0x42')]);_0x28a640['filters']=_[_0x029b('0x44')](_0x28a640['model'],_0x28a640[_0x029b('0x42')]);_0x4488d7[_0x029b('0x45')]=_[_0x029b('0x44')](_0x28a640[_0x029b('0x40')],qs[_0x029b('0x46')](_0x401efc[_0x029b('0x42')][_0x029b('0x46')]));_0x4488d7[_0x029b('0x45')]=_0x4488d7[_0x029b('0x45')][_0x029b('0x6a')]?_0x4488d7['attributes']:_0x28a640['model'];if(!_0x401efc['query'][_0x029b('0x47')](_0x029b('0x48'))){_0x4488d7[_0x029b('0x2d')]=qs[_0x029b('0x2d')](_0x401efc['query'][_0x029b('0x2d')]);_0x4488d7['offset']=qs[_0x029b('0x2b')](_0x401efc[_0x029b('0x42')][_0x029b('0x2b')]);}_0x4488d7[_0x029b('0x49')]=qs[_0x029b('0x4a')](_0x401efc[_0x029b('0x42')][_0x029b('0x4a')]);_0x4488d7[_0x029b('0x4b')]=qs[_0x029b('0x43')](_[_0x029b('0x4c')](_0x401efc[_0x029b('0x42')],_0x28a640[_0x029b('0x43')]));_0x4488d7[_0x029b('0x4b')]['FaxAccountId']=_0x1dcd19['id'];if(_0x401efc[_0x029b('0x42')]['filter']){_0x4488d7['where']=_[_0x029b('0x4d')](_0x4488d7['where'],{'$or':_['map'](_0x4488d7[_0x029b('0x45')],function(_0x4d962b){var _0x50837e={};_0x50837e[_0x4d962b]={'$like':'%'+_0x401efc[_0x029b('0x42')][_0x029b('0x64')]+'%'};return _0x50837e;})});}if(_0x401efc['query'][_0x029b('0x9a')]){var _0x304f29=_0x401efc['query'][_0x029b('0x9a')][_0x029b('0x9b')](',');var _0x488e73={};_0x488e73[_0x304f29[0x0]]={'$gte':moment(_0x304f29[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x4488d7['where']=_[_0x029b('0x4d')](_0x4488d7['where'],_0x488e73);}_0x4488d7=_[_0x029b('0x4d')]({},_0x4488d7,_0x401efc['options']);return db['FaxMessage'][_0x029b('0x2e')]({'where':_0x4488d7[_0x029b('0x4b')]})['then'](function(_0x2ea49f){_0x44d849['count']=_0x2ea49f;if(_0x401efc[_0x029b('0x42')][_0x029b('0x55')]){_0x4488d7[_0x029b('0x51')]=[{'all':!![]}];}return db[_0x029b('0x9c')][_0x029b('0x52')](_0x4488d7);})[_0x029b('0x1d')](function(_0x5ea396){_0x44d849[_0x029b('0x53')]=_0x5ea396;return _0x44d849;});}})['then'](respondWithFilteredResult(_0x49d7df,_0x4488d7))['catch'](handleError(_0x49d7df,null));};exports[_0x029b('0x38')]=function(_0x32548e,_0x26eef6,_0x3d9f45){var _0x496c36,_0x41193e={},_0x32fd85;if(_0x32548e[_0x029b('0x58')]['to']){_0x32fd85=_0x32548e[_0x029b('0x58')]['to'][0x0];}return db[_0x029b('0x50')][_0x029b('0x5f')]({'where':{'id':_0x32548e['params']['id']},'include':[{'model':db['CmList'],'as':_0x029b('0x9d'),'include':[{'model':db[_0x029b('0x6f')],'as':_0x029b('0x9e'),'where':{'fax':_0x32fd85},'limit':0x1,'order':[[_0x029b('0x95'),_0x029b('0x9f')]]}]}]})[_0x029b('0x1d')](handleEntityNotFound(_0x26eef6,null))[_0x029b('0x1d')](function(_0x304d12){_0x496c36=_0x304d12;if(_0x32548e['body'][_0x029b('0xa0')]&&_0x32548e[_0x029b('0x58')]['attachments']['length']){for(var _0x5a83e7=0x0;_0x5a83e7<_0x32548e[_0x029b('0x58')]['attachments']['length'];_0x5a83e7+=0x1){_0x32548e[_0x029b('0x58')][_0x029b('0xa0')][_0x5a83e7]={'filename':_0x32548e[_0x029b('0x58')][_0x029b('0xa0')][_0x5a83e7]['name'],'id':_0x32548e[_0x029b('0x58')][_0x029b('0xa0')][_0x5a83e7]['id'],'path':path['join'](config[_0x029b('0xa1')],'server/files/attachments',_0x32548e[_0x029b('0x58')]['attachments'][_0x5a83e7]['basename'])};}}return respondWithRpcPromise(_0x029b('0xa2'),_0x029b('0xa2'),{'FaxAccountId':_[_0x029b('0xa3')](_0x32548e[_0x029b('0x60')]['id'])?undefined:_0x32548e[_0x029b('0x60')]['id'],'path':_[_0x029b('0xa3')](_0x32548e[_0x029b('0x58')][_0x029b('0xa0')][0x0][_0x029b('0x5')])?undefined:_0x32548e[_0x029b('0x58')][_0x029b('0xa0')][0x0][_0x029b('0x5')],'fax':_[_0x029b('0xa3')](_0x32548e[_0x029b('0x58')]['to'][0x0])?undefined:_0x32548e['body']['to'][0x0]},client9002);})['then'](function(){if(_0x496c36){if(_[_0x029b('0xa3')](_0x32548e['body'][_0x029b('0xa4')])){_0x32548e[_0x029b('0x58')][_0x029b('0xa4')]=util[_0x029b('0xa5')]('\x22%s\x22\x20<%s>',_0x496c36[_0x029b('0x37')],_0x496c36[_0x029b('0xa6')]);}if(_0x496c36[_0x029b('0x9d')]){if(_0x496c36['List'][_0x029b('0x9e')][_0x029b('0x6a')]){return _0x496c36[_0x029b('0x9d')][_0x029b('0x9e')][0x0];}else{return db[_0x029b('0x6f')][_0x029b('0x57')](_[_0x029b('0xa7')](_0x32548e[_0x029b('0x58')],{'firstName':_0x32548e[_0x029b('0x58')]['to'][0x0],'phone':_0x32548e[_0x029b('0x58')]['to'][0x0],'fax':_0x32548e[_0x029b('0x58')]['to'][0x0],'ListId':_0x496c36[_0x029b('0x97')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x029b('0xa8'));}})[_0x029b('0x1d')](function(_0x22a27d){if(_0x22a27d){return db[_0x029b('0x6d')][_0x029b('0x5f')]({'where':{'ContactId':_0x22a27d['id'],'closed':![],'FaxAccountId':_0x496c36['id']}})[_0x029b('0x1d')](function(_0x3c0741){if(_0x3c0741){return[_0x3c0741,![]];}return db[_0x029b('0x6d')]['create']({'UserId':_0x32548e[_0x029b('0x59')]['id'],'ContactId':_0x22a27d['id'],'FaxAccountId':_0x496c36['id'],'fax':_0x32548e[_0x029b('0x58')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x029b('0x4d')](_0x32548e[_0x029b('0x58')],{'read':![],'body':_0x32548e[_0x029b('0x58')][_0x029b('0xa0')][0x0][_0x029b('0xa9')],'FaxAccountId':_0x496c36['id'],'UserId':_0x32548e[_0x029b('0x59')]['id'],'ContactId':_0x22a27d['id'],'AttachmentId':_0x32548e[_0x029b('0x58')][_0x029b('0xa0')][0x0]['id']})]},{'include':[{'model':db[_0x029b('0x9c')],'as':'Messages'}]})['then'](function(_0x3279c7){return[_0x3279c7,!![]];});});}else{throw new Error(_0x029b('0xaa'));}})['spread'](function(_0x4cae68,_0x4a7f87){if(_0x4a7f87){return _0x4cae68;}return db['FaxMessage'][_0x029b('0x57')]({'direction':'out','read':![],'body':_0x32548e[_0x029b('0x58')][_0x029b('0xa0')][0x0][_0x029b('0xa9')],'FaxAccountId':_0x496c36['id'],'FaxInteractionId':_0x4cae68['id'],'UserId':_0x32548e[_0x029b('0x59')]['id'],'ContactId':_0x4cae68[_0x029b('0xab')],'AttachmentId':_0x32548e[_0x029b('0x58')]['attachments'][0x0]['id']})[_0x029b('0x1d')](function(_0x3ec5eb){_0x4cae68[_0x029b('0xac')][_0x029b('0xad')]=[];_0x4cae68[_0x029b('0xac')][_0x029b('0xad')][_0x029b('0x83')](_0x3ec5eb[_0x029b('0xac')]);return _0x4cae68;});})[_0x029b('0x1d')](function(_0x4715e4){respondWithRpcPromise('SendFax',_0x029b('0xae'),{'FaxAccountId':_['isNil'](_0x32548e[_0x029b('0x60')]['id'])?undefined:_0x32548e[_0x029b('0x60')]['id'],'path':_[_0x029b('0xa3')](_0x32548e['body'][_0x029b('0xa0')][0x0]['path'])?undefined:_0x32548e[_0x029b('0x58')][_0x029b('0xa0')][0x0][_0x029b('0x5')],'fax':_[_0x029b('0xa3')](_0x32548e[_0x029b('0x58')]['to'][0x0])?undefined:_0x32548e[_0x029b('0x58')]['to'][0x0],'AttachmentId':_0x32548e['body'][_0x029b('0xa0')][0x0]['id']},client9002)[_0x029b('0x1d')](function(_0x22fa83){logger[_0x029b('0x1e')](_0x029b('0xaf'),_0x22fa83);})[_0x029b('0x27')](function(_0x3b3b22){logger[_0x029b('0x1e')](_0x029b('0xaf'),_0x3b3b22);});return _0x4715e4;})[_0x029b('0x1d')](respondWithResult(_0x26eef6,null))[_0x029b('0x27')](handleError(_0x26eef6,null));};exports[_0x029b('0xb0')]=function(_0x2a3b3e,_0x280c8c,_0x673d58){return db['FaxAccount'][_0x029b('0x5f')]({'where':{'id':_0x2a3b3e[_0x029b('0x60')]['id']}})[_0x029b('0x1d')](handleEntityNotFound(_0x280c8c,null))[_0x029b('0x1d')](function(_0x1881df){if(_0x1881df){return _0x1881df[_0x029b('0xb0')](_0x2a3b3e['body'][_0x029b('0x66')],_[_0x029b('0xb1')](_0x2a3b3e[_0x029b('0x58')],[_0x029b('0x66'),'id'])||{})[_0x029b('0xb2')](function(_0x332beb){for(var _0x44101d=0x0;_0x44101d<_0x2a3b3e[_0x029b('0x58')][_0x029b('0x66')]['length'];_0x44101d+=0x1){socket[_0x029b('0xb3')](_0x029b('0xb4'),{'UserId':Number(_0x2a3b3e[_0x029b('0x58')][_0x029b('0x66')][_0x44101d]),'FaxAccountId':Number(_0x2a3b3e[_0x029b('0x60')]['id'])});}return _0x332beb;});}})['then'](respondWithResult(_0x280c8c,null))[_0x029b('0x27')](handleError(_0x280c8c,null));};exports[_0x029b('0xb5')]=function(_0x5c2940,_0x4388cb,_0x5a96bc){return db[_0x029b('0x50')][_0x029b('0x5f')]({'where':{'id':_0x5c2940[_0x029b('0x60')]['id']}})[_0x029b('0x1d')](handleEntityNotFound(_0x4388cb,null))[_0x029b('0x1d')](function(_0x559442){if(_0x559442){return _0x559442[_0x029b('0xb5')](_0x5c2940[_0x029b('0x42')]['ids'])[_0x029b('0x1d')](function(){if(_['isArray'](_0x5c2940[_0x029b('0x42')][_0x029b('0x66')])){for(var _0x247fac=0x0;_0x247fac<_0x5c2940[_0x029b('0x42')][_0x029b('0x66')]['length'];_0x247fac+=0x1){socket[_0x029b('0xb3')](_0x029b('0xb6'),{'UserId':Number(_0x5c2940[_0x029b('0x42')][_0x029b('0x66')][_0x247fac]),'FaxAccountId':Number(_0x5c2940[_0x029b('0x60')]['id'])});}}else{socket['emit'](_0x029b('0xb6'),{'UserId':Number(_0x5c2940['query'][_0x029b('0x66')]),'FaxAccountId':Number(_0x5c2940[_0x029b('0x60')]['id'])});}});}})[_0x029b('0x1d')](respondWithStatusCode(_0x4388cb,null))['catch'](handleError(_0x4388cb,null));};exports[_0x029b('0xb7')]=function(_0x172908,_0x35d49b,_0x5b68e9){var _0x4da64f={};var _0x32bb6d={};var _0xaf7581;var _0x5a7399;return db[_0x029b('0x50')]['findOne']({'where':{'id':_0x172908[_0x029b('0x60')]['id']}})['then'](handleEntityNotFound(_0x35d49b,null))[_0x029b('0x1d')](function(_0x226ffc){if(_0x226ffc){_0xaf7581=_0x226ffc;_0x32bb6d[_0x029b('0x40')]=_[_0x029b('0x41')](db[_0x029b('0x71')][_0x029b('0x3d')]);_0x32bb6d[_0x029b('0x42')]=_[_0x029b('0x41')](_0x172908[_0x029b('0x42')]);_0x32bb6d[_0x029b('0x43')]=_[_0x029b('0x44')](_0x32bb6d[_0x029b('0x40')],_0x32bb6d[_0x029b('0x42')]);_0x4da64f[_0x029b('0x45')]=_[_0x029b('0x44')](_0x32bb6d[_0x029b('0x40')],qs[_0x029b('0x46')](_0x172908[_0x029b('0x42')][_0x029b('0x46')]));_0x4da64f[_0x029b('0x45')]=_0x4da64f[_0x029b('0x45')][_0x029b('0x6a')]?_0x4da64f[_0x029b('0x45')]:_0x32bb6d[_0x029b('0x40')];_0x4da64f[_0x029b('0x49')]=qs['sort'](_0x172908[_0x029b('0x42')][_0x029b('0x4a')]);_0x4da64f[_0x029b('0x4b')]=qs[_0x029b('0x43')](_[_0x029b('0x4c')](_0x172908[_0x029b('0x42')],_0x32bb6d[_0x029b('0x43')]));if(_0x172908[_0x029b('0x42')][_0x029b('0x64')]){_0x4da64f[_0x029b('0x4b')]=_[_0x029b('0x4d')](_0x4da64f[_0x029b('0x4b')],{'$or':_[_0x029b('0x3c')](_0x4da64f[_0x029b('0x45')],function(_0x2c769b){var _0x323576={};_0x323576[_0x2c769b]={'$like':'%'+_0x172908[_0x029b('0x42')]['filter']+'%'};return _0x323576;})});}_0x4da64f=_['merge']({},_0x4da64f,_0x172908[_0x029b('0x56')]);return _0xaf7581[_0x029b('0xb7')](_0x4da64f);}})[_0x029b('0x1d')](function(_0x49a334){if(_0x49a334){_0x5a7399=_0x49a334[_0x029b('0x6a')];if(!_0x172908[_0x029b('0x42')][_0x029b('0x47')]('nolimit')){_0x4da64f['limit']=qs['limit'](_0x172908[_0x029b('0x42')]['limit']);_0x4da64f['offset']=qs[_0x029b('0x2b')](_0x172908['query'][_0x029b('0x2b')]);}return _0xaf7581[_0x029b('0xb7')](_0x4da64f);}})[_0x029b('0x1d')](function(_0x126cdd){if(_0x126cdd){return _0x126cdd?{'count':_0x5a7399,'rows':_0x126cdd}:null;}})['then'](respondWithResult(_0x35d49b,null))[_0x029b('0x27')](handleError(_0x35d49b,null));};
\ No newline at end of file
index 7e41f58..80dba6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9192=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','update','remove'];(function(_0x2dedf8,_0x4c3cc4){var _0x19e4e2=function(_0x1640f7){while(--_0x1640f7){_0x2dedf8['push'](_0x2dedf8['shift']());}};_0x19e4e2(++_0x4c3cc4);}(_0x9192,0x1bc));var _0x2919=function(_0x2a0738,_0x3c0bc5){_0x2a0738=_0x2a0738-0x0;var _0x159679=_0x9192[_0x2a0738];return _0x159679;};'use strict';var EventEmitter=require(_0x2919('0x0'));var FaxAccount=require(_0x2919('0x1'))['db'][_0x2919('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x2919('0x3')](0x0);var events={'afterCreate':_0x2919('0x4'),'afterUpdate':_0x2919('0x5'),'afterDestroy':_0x2919('0x6')};function emitEvent(_0x3dbd7b){return function(_0x19e951,_0x558329,_0x4fa25e){FaxAccountEvents[_0x2919('0x7')](_0x3dbd7b+':'+_0x19e951['id'],_0x19e951);FaxAccountEvents[_0x2919('0x7')](_0x3dbd7b,_0x19e951);_0x4fa25e(null);};}for(var e in events){if(events[_0x2919('0x8')](e)){var event=events[e];FaxAccount[_0x2919('0x9')](e,emitEvent(event));}}module[_0x2919('0xa')]=FaxAccountEvents;
\ No newline at end of file
+var _0xf663=['hook','exports','../../mysqldb','FaxAccount','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x57cb4f,_0x541f57){var _0x29bb45=function(_0x462bee){while(--_0x462bee){_0x57cb4f['push'](_0x57cb4f['shift']());}};_0x29bb45(++_0x541f57);}(_0xf663,0x1aa));var _0x3f66=function(_0x38cac1,_0x1c5d2f){_0x38cac1=_0x38cac1-0x0;var _0x2938b3=_0xf663[_0x38cac1];return _0x2938b3;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x3f66('0x0'))['db'][_0x3f66('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x3f66('0x2')](0x0);var events={'afterCreate':_0x3f66('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x571923){return function(_0x568f58,_0x349f89,_0x289ad6){FaxAccountEvents[_0x3f66('0x4')](_0x571923+':'+_0x568f58['id'],_0x568f58);FaxAccountEvents[_0x3f66('0x4')](_0x571923,_0x568f58);_0x289ad6(null);};}for(var e in events){if(events[_0x3f66('0x5')](e)){var event=events[e];FaxAccount[_0x3f66('0x6')](e,emitEvent(event));}}module[_0x3f66('0x7')]=FaxAccountEvents;
\ No newline at end of file
index d7e038c..08ce761 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2616=['FaxAccount','fax_accounts','lodash','util','../../config/logger','moment','bluebird','../../config/environment','./faxAccount.attributes','exports'];(function(_0x5ba527,_0x3a1920){var _0x285ecb=function(_0x5b4f0c){while(--_0x5b4f0c){_0x5ba527['push'](_0x5ba527['shift']());}};_0x285ecb(++_0x3a1920);}(_0x2616,0xb6));var _0x6261=function(_0x4536a4,_0x55af7b){_0x4536a4=_0x4536a4-0x0;var _0x4fd1c1=_0x2616[_0x4536a4];return _0x4fd1c1;};'use strict';var _=require(_0x6261('0x0'));var util=require(_0x6261('0x1'));var logger=require(_0x6261('0x2'))('api');var moment=require(_0x6261('0x3'));var BPromise=require(_0x6261('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6261('0x5'));var attributes=require(_0x6261('0x6'));module[_0x6261('0x7')]=function(_0x155e27,_0x53ba4f){return _0x155e27['define'](_0x6261('0x8'),attributes,{'tableName':_0x6261('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x80ba=['fax_accounts','lodash','util','../../config/logger','api','request-promise','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount'];(function(_0x2659eb,_0x42d7c8){var _0x202454=function(_0x2a2d57){while(--_0x2a2d57){_0x2659eb['push'](_0x2659eb['shift']());}};_0x202454(++_0x42d7c8);}(_0x80ba,0xc7));var _0xa80b=function(_0x552ed3,_0x4993e9){_0x552ed3=_0x552ed3-0x0;var _0x64fa8b=_0x80ba[_0x552ed3];return _0x64fa8b;};'use strict';var _=require(_0xa80b('0x0'));var util=require(_0xa80b('0x1'));var logger=require(_0xa80b('0x2'))(_0xa80b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa80b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xa80b('0x5'));var attributes=require(_0xa80b('0x6'));module[_0xa80b('0x7')]=function(_0x1d590d,_0x59a291){return _0x1d590d[_0xa80b('0x8')](_0xa80b('0x9'),attributes,{'tableName':_0xa80b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4757b88..a1cefed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7aa8=['isNil','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','List','Contacts','DESC','FaxApplication','Applications','get','applications','orderBy','priority','asc','length','create','contact','FaxInteraction','spread','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','FaxAccount,\x20%s,\x20%s','message','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','include','map','model','NotifyFaxAccount','fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','body','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x7aa8,0x144));var _0x87aa=function(_0x182bff,_0x2ff075){_0x182bff=_0x182bff-0x0;var _0x5c91cf=_0x7aa8[_0x182bff];return _0x5c91cf;};'use strict';var _=require(_0x87aa('0x0'));var util=require(_0x87aa('0x1'));var moment=require(_0x87aa('0x2'));var BPromise=require(_0x87aa('0x3'));var rs=require(_0x87aa('0x4'));var fs=require('fs');var Redis=require(_0x87aa('0x5'));var db=require(_0x87aa('0x6'))['db'];var utils=require(_0x87aa('0x7'));var logger=require(_0x87aa('0x8'))(_0x87aa('0x9'));var config=require(_0x87aa('0xa'));var jayson=require(_0x87aa('0xb'));var client=jayson[_0x87aa('0xc')][_0x87aa('0xd')]({'port':0x232c});config[_0x87aa('0xe')]=_[_0x87aa('0xf')](config[_0x87aa('0xe')],{'host':_0x87aa('0x10'),'port':0x18eb});var socket=require(_0x87aa('0x11'))(new Redis(config[_0x87aa('0xe')]));require(_0x87aa('0x12'))[_0x87aa('0x13')](socket);function respondWithRpcPromise(_0x4c77ae,_0x12eff7,_0x15c9e5){return new BPromise(function(_0x5e10ef,_0x290751){return client[_0x87aa('0x14')](_0x4c77ae,_0x15c9e5)[_0x87aa('0x15')](function(_0x197ce3){logger[_0x87aa('0x16')]('FaxAccount,\x20%s,\x20%s',_0x12eff7,'request\x20sent');logger[_0x87aa('0x17')](_0x87aa('0x18'),_0x12eff7,_0x87aa('0x19'),JSON[_0x87aa('0x1a')](_0x197ce3));if(_0x197ce3[_0x87aa('0x1b')]){if(_0x197ce3['error']['code']===0x1f4){logger[_0x87aa('0x1b')](_0x87aa('0x1c'),_0x12eff7,_0x197ce3['error']['message']);return _0x290751(_0x197ce3[_0x87aa('0x1b')][_0x87aa('0x1d')]);}logger[_0x87aa('0x1b')]('FaxAccount,\x20%s,\x20%s',_0x12eff7,_0x197ce3['error']['message']);return _0x5e10ef(_0x197ce3[_0x87aa('0x1b')][_0x87aa('0x1d')]);}else{logger[_0x87aa('0x16')](_0x87aa('0x1c'),_0x12eff7,'request\x20sent');_0x5e10ef(_0x197ce3['result'][_0x87aa('0x1d')]);}})['catch'](function(_0xb7dbe5){logger[_0x87aa('0x1b')](_0x87aa('0x1c'),_0x12eff7,_0xb7dbe5);_0x290751(_0xb7dbe5);});});}exports[_0x87aa('0x1e')]=function(_0x5d47e2){var _0x4e082b=this;return new Promise(function(_0x51cdc6,_0x45e358){return db[_0x87aa('0x1f')][_0x87aa('0x20')]({'raw':_0x5d47e2[_0x87aa('0x21')]?_0x5d47e2[_0x87aa('0x21')][_0x87aa('0x22')]===undefined?!![]:![]:!![],'where':_0x5d47e2[_0x87aa('0x21')]?_0x5d47e2[_0x87aa('0x21')][_0x87aa('0x23')]||null:null,'attributes':_0x5d47e2[_0x87aa('0x21')]?_0x5d47e2[_0x87aa('0x21')][_0x87aa('0x24')]||null:null,'limit':_0x5d47e2[_0x87aa('0x21')]?_0x5d47e2['options']['limit']||null:null,'include':_0x5d47e2['options']?_0x5d47e2['options'][_0x87aa('0x25')]?_[_0x87aa('0x26')](_0x5d47e2[_0x87aa('0x21')]['include'],function(_0xf487dd){return{'model':db[_0xf487dd[_0x87aa('0x27')]],'as':_0xf487dd['as'],'attributes':_0xf487dd['attributes'],'include':_0xf487dd[_0x87aa('0x25')]?_[_0x87aa('0x26')](_0xf487dd['include'],function(_0x50908b){return{'model':db[_0x50908b[_0x87aa('0x27')]],'as':_0x50908b['as'],'attributes':_0x50908b[_0x87aa('0x24')],'include':_0x50908b[_0x87aa('0x25')]?_[_0x87aa('0x26')](_0x50908b[_0x87aa('0x25')],function(_0x241f55){return{'model':db[_0x241f55[_0x87aa('0x27')]],'as':_0x241f55['as'],'attributes':_0x241f55[_0x87aa('0x24')]};}):[]};}):[]};}):[]:[]})[_0x87aa('0x15')](function(_0x5415d4){logger[_0x87aa('0x16')](_0x87aa('0x1e'),_0x5d47e2);logger[_0x87aa('0x17')](_0x87aa('0x1e'),_0x5d47e2,JSON[_0x87aa('0x1a')](_0x5415d4));_0x51cdc6(_0x5415d4);})['catch'](function(_0x5eaba4){logger[_0x87aa('0x1b')](_0x87aa('0x1e'),_0x5eaba4[_0x87aa('0x1d')],_0x5d47e2);_0x45e358(_0x4e082b['error'](0x1f4,_0x5eaba4[_0x87aa('0x1d')]));});});};exports[_0x87aa('0x28')]=function(_0x3a5a42,_0x13320b,_0x203e47){var _0x17bad7=this;return new Promise(function(_0x2b6d8f,_0x2ccf59){var _0x474c6b={'body':_0x3a5a42['body'],'channel':_0x87aa('0x29')};var _0x53ccbd=[];var _0x1e9a37=[];var _0x410b11={};return db[_0x87aa('0x2a')]['describe']()[_0x87aa('0x15')](function(_0x492505){if(!_0x492505){throw new db[(_0x87aa('0x2b'))][(_0x87aa('0x2c'))](_0x87aa('0x2d'));}_0x53ccbd=_[_0x87aa('0x2e')](_[_0x87aa('0x2f')](_0x492505),[_0x87aa('0x30'),'updatedAt']);_0x1e9a37=_[_0x87aa('0x2e')](_[_0x87aa('0x2f')](_0x492505),[_0x87aa('0x30'),_0x87aa('0x31'),_0x87aa('0x32'),_0x87aa('0x33')]);if(_0x3a5a42[_0x87aa('0x34')]['id']){delete _0x3a5a42['body']['id'];}if(_['isNil'](_0x3a5a42[_0x87aa('0x34')][_0x87aa('0x35')])){throw new db[(_0x87aa('0x2b'))][(_0x87aa('0x2c'))](_0x87aa('0x36'));}if(_['isNil'](_0x3a5a42[_0x87aa('0x34')][_0x87aa('0x34')])||_0x3a5a42['body'][_0x87aa('0x34')]===''){throw new db[(_0x87aa('0x2b'))][(_0x87aa('0x2c'))](_0x87aa('0x37'));}if(_[_0x87aa('0x38')](_0x3a5a42[_0x87aa('0x34')]['mapKey'])){throw new db['Sequelize'][(_0x87aa('0x2c'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1e9a37);}if(!_[_0x87aa('0x39')](_0x1e9a37,_0x3a5a42[_0x87aa('0x34')][_0x87aa('0x3a')])){throw new db['Sequelize'][(_0x87aa('0x2c'))](_0x87aa('0x3b')+_0x1e9a37);}_0x410b11[_0x3a5a42[_0x87aa('0x34')][_0x87aa('0x3a')]]=_0x3a5a42[_0x87aa('0x34')][_0x87aa('0x35')];})[_0x87aa('0x15')](function(){return db[_0x87aa('0x1f')][_0x87aa('0x3c')]({'where':{'id':_0x3a5a42[_0x87aa('0x3d')]['id']},'include':[{'model':db['CmList'],'as':_0x87aa('0x3e'),'include':[{'model':db[_0x87aa('0x2a')],'as':_0x87aa('0x3f'),'where':_0x410b11,'limit':0x1,'order':[[_0x87aa('0x31'),_0x87aa('0x40')]]}]},{'model':db[_0x87aa('0x41')],'as':_0x87aa('0x42')}]});})[_0x87aa('0x15')](function(_0x41b4d7){if(_0x41b4d7&&_0x41b4d7['List']){var _0xa2d835=_0x41b4d7[_0x87aa('0x43')]({'plain':!![]});_0x474c6b['account']=_0xa2d835;_0x474c6b[_0x87aa('0x44')]=_0xa2d835[_0x87aa('0x42')];_0x474c6b['list']=_0xa2d835['List'];_0x474c6b[_0x87aa('0x44')]=_[_0x87aa('0x45')](_0x474c6b[_0x87aa('0x44')],[_0x87aa('0x46')],[_0x87aa('0x47')]);if(_0x474c6b[_0x87aa('0x3d')]['Applications']){delete _0x474c6b[_0x87aa('0x3d')][_0x87aa('0x42')];}if(_0x474c6b[_0x87aa('0x3d')]['List']&&_0x474c6b['account']['List'][_0x87aa('0x3f')][_0x87aa('0x48')]){return _0x474c6b['account']['List'][_0x87aa('0x3f')][0x0];}var _0xffb683=_[_0x87aa('0xf')](_0x3a5a42[_0x87aa('0x34')],{'firstName':_0x3a5a42['body'][_0x87aa('0x35')],'ListId':_0xa2d835[_0x87aa('0x33')]});_0xffb683[_0x3a5a42['body'][_0x87aa('0x3a')]]=_0x3a5a42[_0x87aa('0x34')]['from'];return db[_0x87aa('0x2a')][_0x87aa('0x49')](_0xffb683,{'fields':_0x53ccbd,'raw':!![]});}})['then'](function(_0x43e472){_0x474c6b[_0x87aa('0x4a')]=_0x43e472;if(_0x43e472){var _0x2c7ca9={'ContactId':_0x43e472['id'],'FaxAccountId':_0x3a5a42[_0x87aa('0x3d')]['id'],'fax':_0x43e472[_0x87aa('0x29')]};return db[_0x87aa('0x4b')][_0x87aa('0x3c')]({'where':{'ContactId':_0x43e472['id'],'closed':![],'FaxAccountId':_0x3a5a42['account']['id']}})['then'](function(_0x3c485e){if(_0x3c485e){return[_0x3c485e,![]];}return db['FaxInteraction'][_0x87aa('0x49')](_0x2c7ca9)[_0x87aa('0x15')](function(_0x3be8d4){return[_0x3be8d4,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x87aa('0x4c')](function(_0x10044f,_0x5b557b){var _0x33c976=_0x10044f[_0x87aa('0x43')]({'plain':!![]});if(_0x5b557b){if(_0x474c6b[_0x87aa('0x3d')][_0x87aa('0x4d')]){_0x474c6b[_0x87aa('0x44')][_0x87aa('0x4e')]({'id':0x0,'priority':_0x474c6b[_0x87aa('0x44')]['length']+0x1,'app':_0x87aa('0x4f'),'appdata':_0x87aa('0x50'),'interval':_0x87aa('0x51')});}_0x33c976['created']=!![];}else{_0x33c976[_0x87aa('0x52')]=![];}_0x474c6b[_0x87aa('0x53')]=_0x33c976;return db[_0x87aa('0x54')][_0x87aa('0x49')]({'body':_0x3a5a42[_0x87aa('0x34')]['body'],'FaxAccountId':_0x3a5a42['account']['id'],'FaxInteractionId':_0x10044f['id'],'direction':'in','ContactId':_0x10044f[_0x87aa('0x55')],'AttachmentId':_0x3a5a42['body'][_0x87aa('0x56')]});})[_0x87aa('0x15')](function(_0x58c70c){_0x474c6b[_0x87aa('0x1d')]=_0x58c70c;if(_0x474c6b['interaction'][_0x87aa('0x57')]){return db['User'][_0x87aa('0x3c')]({'attributes':['id',_0x87aa('0x58')],'where':{'id':_0x474c6b[_0x87aa('0x53')]['UserId']}})[_0x87aa('0x15')](function(_0x3846eb){if(_0x3846eb){_0x474c6b['applications'][_0x87aa('0x59')]({'id':0x0,'priority':0x0,'app':_0x87aa('0x5a'),'appdata':_0x3846eb[_0x87aa('0x58')]+','+(_0x474c6b[_0x87aa('0x3d')][_0x87aa('0x5b')]||0xa),'interval':_0x87aa('0x51')});}return respondWithRpcPromise(_0x87aa('0x5c'),_0x87aa('0x5d'),_0x474c6b);});}return respondWithRpcPromise(_0x87aa('0x5c'),'startRouting',_0x474c6b);})['then'](function(_0x5719eb){_0x2b6d8f(_0x5719eb);})[_0x87aa('0x5e')](function(_0x5277b4){_0x2ccf59(_0x17bad7[_0x87aa('0x1b')](0x1f4,_0x5277b4[_0x87aa('0x1d')]));});});};
\ No newline at end of file
+var _0xe1ae=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','GetFaxAccount','FaxAccount','findAll','options','where','attributes','limit','include','map','model','catch','NotifyFaxAccount','body','fax','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','ListId','isNil','from','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','find','account','List','CmContact','Contacts','DESC','FaxApplication','Applications','applications','list','orderBy','priority','asc','create','contact','FaxInteraction','Contact\x20not\x20found','get','autoclose','push','length','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','name','agent','startRouting','Start'];(function(_0x19c94b,_0xba17c0){var _0x50c162=function(_0x5a3498){while(--_0x5a3498){_0x19c94b['push'](_0x19c94b['shift']());}};_0x50c162(++_0xba17c0);}(_0xe1ae,0x168));var _0xee1a=function(_0x297df8,_0x14a1b3){_0x297df8=_0x297df8-0x0;var _0x384d86=_0xe1ae[_0x297df8];return _0x384d86;};'use strict';var _=require(_0xee1a('0x0'));var util=require('util');var moment=require(_0xee1a('0x1'));var BPromise=require(_0xee1a('0x2'));var rs=require(_0xee1a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee1a('0x4'))['db'];var utils=require(_0xee1a('0x5'));var logger=require(_0xee1a('0x6'))(_0xee1a('0x7'));var config=require('../../config/environment');var jayson=require(_0xee1a('0x8'));var client=jayson[_0xee1a('0x9')][_0xee1a('0xa')]({'port':0x232c});config[_0xee1a('0xb')]=_[_0xee1a('0xc')](config[_0xee1a('0xb')],{'host':_0xee1a('0xd'),'port':0x18eb});var socket=require(_0xee1a('0xe'))(new Redis(config['redis']));require('./faxAccount.socket')[_0xee1a('0xf')](socket);function respondWithRpcPromise(_0x54779e,_0x59cef2,_0xfb4713){return new BPromise(function(_0x4f055e,_0xb4c7fa){return client[_0xee1a('0x10')](_0x54779e,_0xfb4713)[_0xee1a('0x11')](function(_0x13d163){logger['info'](_0xee1a('0x12'),_0x59cef2,'request\x20sent');logger[_0xee1a('0x13')](_0xee1a('0x14'),_0x59cef2,'request\x20sent',JSON[_0xee1a('0x15')](_0x13d163));if(_0x13d163['error']){if(_0x13d163[_0xee1a('0x16')][_0xee1a('0x17')]===0x1f4){logger[_0xee1a('0x16')](_0xee1a('0x12'),_0x59cef2,_0x13d163[_0xee1a('0x16')][_0xee1a('0x18')]);return _0xb4c7fa(_0x13d163[_0xee1a('0x16')][_0xee1a('0x18')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x59cef2,_0x13d163[_0xee1a('0x16')][_0xee1a('0x18')]);return _0x4f055e(_0x13d163[_0xee1a('0x16')][_0xee1a('0x18')]);}else{logger['info'](_0xee1a('0x12'),_0x59cef2,_0xee1a('0x19'));_0x4f055e(_0x13d163[_0xee1a('0x1a')][_0xee1a('0x18')]);}})['catch'](function(_0x3eb162){logger[_0xee1a('0x16')](_0xee1a('0x12'),_0x59cef2,_0x3eb162);_0xb4c7fa(_0x3eb162);});});}exports[_0xee1a('0x1b')]=function(_0x2d91e3){var _0x54b08c=this;return new Promise(function(_0x4f7cc9,_0x96c7ef){return db[_0xee1a('0x1c')][_0xee1a('0x1d')]({'raw':_0x2d91e3[_0xee1a('0x1e')]?_0x2d91e3[_0xee1a('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x2d91e3[_0xee1a('0x1e')]?_0x2d91e3[_0xee1a('0x1e')][_0xee1a('0x1f')]||null:null,'attributes':_0x2d91e3[_0xee1a('0x1e')]?_0x2d91e3[_0xee1a('0x1e')][_0xee1a('0x20')]||null:null,'limit':_0x2d91e3[_0xee1a('0x1e')]?_0x2d91e3[_0xee1a('0x1e')][_0xee1a('0x21')]||null:null,'include':_0x2d91e3[_0xee1a('0x1e')]?_0x2d91e3[_0xee1a('0x1e')][_0xee1a('0x22')]?_[_0xee1a('0x23')](_0x2d91e3['options'][_0xee1a('0x22')],function(_0x3e12dd){return{'model':db[_0x3e12dd[_0xee1a('0x24')]],'as':_0x3e12dd['as'],'attributes':_0x3e12dd['attributes'],'include':_0x3e12dd[_0xee1a('0x22')]?_[_0xee1a('0x23')](_0x3e12dd[_0xee1a('0x22')],function(_0x32a72f){return{'model':db[_0x32a72f['model']],'as':_0x32a72f['as'],'attributes':_0x32a72f[_0xee1a('0x20')],'include':_0x32a72f[_0xee1a('0x22')]?_[_0xee1a('0x23')](_0x32a72f['include'],function(_0x41001b){return{'model':db[_0x41001b[_0xee1a('0x24')]],'as':_0x41001b['as'],'attributes':_0x41001b[_0xee1a('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ec0a1){logger['info'](_0xee1a('0x1b'),_0x2d91e3);logger[_0xee1a('0x13')](_0xee1a('0x1b'),_0x2d91e3,JSON[_0xee1a('0x15')](_0x4ec0a1));_0x4f7cc9(_0x4ec0a1);})[_0xee1a('0x25')](function(_0x18817f){logger[_0xee1a('0x16')](_0xee1a('0x1b'),_0x18817f[_0xee1a('0x18')],_0x2d91e3);_0x96c7ef(_0x54b08c['error'](0x1f4,_0x18817f[_0xee1a('0x18')]));});});};exports[_0xee1a('0x26')]=function(_0x49a1e5,_0x3864e1,_0x2ae4e7){var _0x419018=this;return new Promise(function(_0x286abf,_0x39fe8c){var _0x413ddd={'body':_0x49a1e5[_0xee1a('0x27')],'channel':_0xee1a('0x28')};var _0xc78251=[];var _0x5009de=[];var _0x555899={};return db['CmContact']['describe']()[_0xee1a('0x11')](function(_0x52d1d4){if(!_0x52d1d4){throw new db[(_0xee1a('0x29'))][(_0xee1a('0x2a'))](_0xee1a('0x2b'));}_0xc78251=_[_0xee1a('0x2c')](_[_0xee1a('0x2d')](_0x52d1d4),[_0xee1a('0x2e'),_0xee1a('0x2f')]);_0x5009de=_[_0xee1a('0x2c')](_[_0xee1a('0x2d')](_0x52d1d4),[_0xee1a('0x2e'),_0xee1a('0x2f'),'CompanyId',_0xee1a('0x30')]);if(_0x49a1e5['body']['id']){delete _0x49a1e5['body']['id'];}if(_[_0xee1a('0x31')](_0x49a1e5[_0xee1a('0x27')][_0xee1a('0x32')])){throw new db[(_0xee1a('0x29'))][(_0xee1a('0x2a'))](_0xee1a('0x33'));}if(_[_0xee1a('0x31')](_0x49a1e5[_0xee1a('0x27')][_0xee1a('0x27')])||_0x49a1e5['body'][_0xee1a('0x27')]===''){throw new db['Sequelize'][(_0xee1a('0x2a'))](_0xee1a('0x34'));}if(_[_0xee1a('0x31')](_0x49a1e5['body'][_0xee1a('0x35')])){throw new db[(_0xee1a('0x29'))]['ValidationError'](_0xee1a('0x36')+_0x5009de);}if(!_['includes'](_0x5009de,_0x49a1e5[_0xee1a('0x27')][_0xee1a('0x35')])){throw new db['Sequelize'][(_0xee1a('0x2a'))](_0xee1a('0x37')+_0x5009de);}_0x555899[_0x49a1e5['body'][_0xee1a('0x35')]]=_0x49a1e5[_0xee1a('0x27')][_0xee1a('0x32')];})['then'](function(){return db['FaxAccount'][_0xee1a('0x38')]({'where':{'id':_0x49a1e5[_0xee1a('0x39')]['id']},'include':[{'model':db['CmList'],'as':_0xee1a('0x3a'),'include':[{'model':db[_0xee1a('0x3b')],'as':_0xee1a('0x3c'),'where':_0x555899,'limit':0x1,'order':[[_0xee1a('0x2f'),_0xee1a('0x3d')]]}]},{'model':db[_0xee1a('0x3e')],'as':_0xee1a('0x3f')}]});})[_0xee1a('0x11')](function(_0x4e6236){if(_0x4e6236&&_0x4e6236[_0xee1a('0x3a')]){var _0x3b837a=_0x4e6236['get']({'plain':!![]});_0x413ddd['account']=_0x3b837a;_0x413ddd[_0xee1a('0x40')]=_0x3b837a[_0xee1a('0x3f')];_0x413ddd[_0xee1a('0x41')]=_0x3b837a[_0xee1a('0x3a')];_0x413ddd[_0xee1a('0x40')]=_[_0xee1a('0x42')](_0x413ddd[_0xee1a('0x40')],[_0xee1a('0x43')],[_0xee1a('0x44')]);if(_0x413ddd[_0xee1a('0x39')][_0xee1a('0x3f')]){delete _0x413ddd[_0xee1a('0x39')][_0xee1a('0x3f')];}if(_0x413ddd[_0xee1a('0x39')]['List']&&_0x413ddd['account'][_0xee1a('0x3a')][_0xee1a('0x3c')]['length']){return _0x413ddd[_0xee1a('0x39')][_0xee1a('0x3a')][_0xee1a('0x3c')][0x0];}var _0xabd43b=_[_0xee1a('0xc')](_0x49a1e5[_0xee1a('0x27')],{'firstName':_0x49a1e5['body'][_0xee1a('0x32')],'ListId':_0x3b837a[_0xee1a('0x30')]});_0xabd43b[_0x49a1e5[_0xee1a('0x27')]['mapKey']]=_0x49a1e5['body'][_0xee1a('0x32')];return db[_0xee1a('0x3b')][_0xee1a('0x45')](_0xabd43b,{'fields':_0xc78251,'raw':!![]});}})['then'](function(_0x1d534e){_0x413ddd[_0xee1a('0x46')]=_0x1d534e;if(_0x1d534e){var _0x3444b2={'ContactId':_0x1d534e['id'],'FaxAccountId':_0x49a1e5[_0xee1a('0x39')]['id'],'fax':_0x1d534e[_0xee1a('0x28')]};return db[_0xee1a('0x47')][_0xee1a('0x38')]({'where':{'ContactId':_0x1d534e['id'],'closed':![],'FaxAccountId':_0x49a1e5[_0xee1a('0x39')]['id']}})[_0xee1a('0x11')](function(_0x27ce87){if(_0x27ce87){return[_0x27ce87,![]];}return db[_0xee1a('0x47')][_0xee1a('0x45')](_0x3444b2)[_0xee1a('0x11')](function(_0xfae831){return[_0xfae831,!![]];});});}else{throw new Error(_0xee1a('0x48'));}})['spread'](function(_0x347716,_0x3d2b59){var _0x2c8a7b=_0x347716[_0xee1a('0x49')]({'plain':!![]});if(_0x3d2b59){if(_0x413ddd[_0xee1a('0x39')][_0xee1a('0x4a')]){_0x413ddd[_0xee1a('0x40')][_0xee1a('0x4b')]({'id':0x0,'priority':_0x413ddd[_0xee1a('0x40')][_0xee1a('0x4c')]+0x1,'app':_0xee1a('0x4d'),'appdata':_0xee1a('0x4e'),'interval':_0xee1a('0x4f')});}_0x2c8a7b[_0xee1a('0x50')]=!![];}else{_0x2c8a7b['created']=![];}_0x413ddd[_0xee1a('0x51')]=_0x2c8a7b;return db[_0xee1a('0x52')][_0xee1a('0x45')]({'body':_0x49a1e5[_0xee1a('0x27')][_0xee1a('0x27')],'FaxAccountId':_0x49a1e5[_0xee1a('0x39')]['id'],'FaxInteractionId':_0x347716['id'],'direction':'in','ContactId':_0x347716[_0xee1a('0x53')],'AttachmentId':_0x49a1e5[_0xee1a('0x27')][_0xee1a('0x54')]});})['then'](function(_0x58f7d4){_0x413ddd[_0xee1a('0x18')]=_0x58f7d4;if(_0x413ddd['interaction'][_0xee1a('0x55')]){return db['User']['find']({'attributes':['id',_0xee1a('0x56')],'where':{'id':_0x413ddd['interaction'][_0xee1a('0x55')]}})[_0xee1a('0x11')](function(_0x205d0a){if(_0x205d0a){_0x413ddd[_0xee1a('0x40')]['unshift']({'id':0x0,'priority':0x0,'app':_0xee1a('0x57'),'appdata':_0x205d0a[_0xee1a('0x56')]+','+(_0x413ddd[_0xee1a('0x39')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xee1a('0x58'),_0x413ddd);});}return respondWithRpcPromise(_0xee1a('0x59'),_0xee1a('0x58'),_0x413ddd);})[_0xee1a('0x11')](function(_0x26c361){_0x286abf(_0x26c361);})[_0xee1a('0x25')](function(_0x50a8a2){_0x39fe8c(_0x419018[_0xee1a('0x16')](0x1f4,_0x50a8a2['message']));});});};
\ No newline at end of file
index 0ed26c9..59c5ab5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['save','remove','emit','removeListener','register','length','faxAccount:','./faxAccount.events'];(function(_0x50478e,_0x404854){var _0x190c0e=function(_0x2a767e){while(--_0x2a767e){_0x50478e['push'](_0x50478e['shift']());}};_0x190c0e(++_0x404854);}(_0x7217,0x117));var _0x7721=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x7217[_0x37bd26];return _0xe83dc4;};'use strict';var FaxAccountEvents=require(_0x7721('0x0'));var events=[_0x7721('0x1'),_0x7721('0x2'),'update'];function createListener(_0x317be5,_0x941c54){return function(_0x504838){_0x941c54[_0x7721('0x3')](_0x317be5,_0x504838);};}function removeListener(_0x306978,_0xf2754){return function(){FaxAccountEvents[_0x7721('0x4')](_0x306978,_0xf2754);};}exports[_0x7721('0x5')]=function(_0x12313b){for(var _0x1f9f95=0x0,_0x2a0758=events[_0x7721('0x6')];_0x1f9f95<_0x2a0758;_0x1f9f95++){var _0x2272a0=events[_0x1f9f95];var _0x43d392=createListener(_0x7721('0x7')+_0x2272a0,_0x12313b);FaxAccountEvents['on'](_0x2272a0,_0x43d392);}};
\ No newline at end of file
+var _0xa310=['length','faxAccount:','./faxAccount.events','remove','update','removeListener'];(function(_0x5cb17c,_0x213243){var _0x137c45=function(_0x1fa9bb){while(--_0x1fa9bb){_0x5cb17c['push'](_0x5cb17c['shift']());}};_0x137c45(++_0x213243);}(_0xa310,0x194));var _0x0a31=function(_0x3eed7f,_0x2d11c0){_0x3eed7f=_0x3eed7f-0x0;var _0x23dea=_0xa310[_0x3eed7f];return _0x23dea;};'use strict';var FaxAccountEvents=require(_0x0a31('0x0'));var events=['save',_0x0a31('0x1'),_0x0a31('0x2')];function createListener(_0x2b0bcf,_0x437cf2){return function(_0x1a3f4a){_0x437cf2['emit'](_0x2b0bcf,_0x1a3f4a);};}function removeListener(_0x4bb78e,_0x2a54ae){return function(){FaxAccountEvents[_0x0a31('0x3')](_0x4bb78e,_0x2a54ae);};}exports['register']=function(_0x4235ca){for(var _0x3fdc6e=0x0,_0x1fb448=events[_0x0a31('0x4')];_0x3fdc6e<_0x1fb448;_0x3fdc6e++){var _0x104f0d=events[_0x3fdc6e];var _0x2b6df5=createListener(_0x0a31('0x5')+_0x104f0d,_0x4235ca);FaxAccountEvents['on'](_0x104f0d,_0x2b6df5);}};
\ No newline at end of file
index b3ff349..068ed60 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(_0x2b7ab3,_0x2a67ca){var _0x5e96e0=function(_0x524336){while(--_0x524336){_0x2b7ab3['push'](_0x2b7ab3['shift']());}};_0x5e96e0(++_0x2a67ca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x5e7299,_0x44ed67){var _0x2227e1=function(_0x164f29){while(--_0x164f29){_0x5e7299['push'](_0x5e7299['shift']());}};_0x2227e1(++_0x44ed67);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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 5700628..9267da4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0a75=['STRING','*,*,*,*','sequelize','INTEGER','noop','TEXT'];(function(_0x31b74a,_0x5da9c1){var _0x4df566=function(_0x3148ba){while(--_0x3148ba){_0x31b74a['push'](_0x31b74a['shift']());}};_0x4df566(++_0x5da9c1);}(_0x0a75,0x158));var _0x50a7=function(_0x336ac0,_0x3cbf0a){_0x336ac0=_0x336ac0-0x0;var _0x17c17b=_0x0a75[_0x336ac0];return _0x17c17b;};'use strict';var Sequelize=require(_0x50a7('0x0'));module['exports']={'priority':{'type':Sequelize[_0x50a7('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x50a7('0x2')},'appdata':{'type':Sequelize[_0x50a7('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x50a7('0x4')],'defaultValue':_0x50a7('0x5')}};
\ No newline at end of file
+var _0xa49e=['exports','INTEGER','noop','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa49e,0x160));var _0xea49=function(_0x4879b8,_0x55569f){_0x4879b8=_0x4879b8-0x0;var _0x34abae=_0xa49e[_0x4879b8];return _0x34abae;};'use strict';var Sequelize=require('sequelize');module[_0xea49('0x0')]={'priority':{'type':Sequelize[_0xea49('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xea49('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xea49('0x3')]},'interval':{'type':Sequelize[_0xea49('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index a1abf7a..f5ea432 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3bf=['params','destroy','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxApplication','includeAll','include','findAll','rows','catch','show','find','create','body'];(function(_0x253596,_0x3fcff7){var _0x4435a5=function(_0x389e83){while(--_0x389e83){_0x253596['push'](_0x253596['shift']());}};_0x4435a5(++_0x3fcff7);}(_0xa3bf,0xe9));var _0xfa3b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa3bf[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfa3b('0x0'));var zipdir=require(_0xfa3b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfa3b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfa3b('0x3'));var util=require(_0xfa3b('0x4'));var path=require(_0xfa3b('0x5'));var sox=require(_0xfa3b('0x6'));var csv=require(_0xfa3b('0x7'));var ejs=require(_0xfa3b('0x8'));var fs=require('fs');var fs_extra=require(_0xfa3b('0x9'));var _=require(_0xfa3b('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfa3b('0xb'));var deskjs=require(_0xfa3b('0xc'));var toCsv=require(_0xfa3b('0x7'));var querystring=require(_0xfa3b('0xd'));var Papa=require(_0xfa3b('0xe'));var Redis=require('ioredis');var authService=require(_0xfa3b('0xf'));var qs=require(_0xfa3b('0x10'));var as=require(_0xfa3b('0x11'));var hardwareService=require(_0xfa3b('0x12'));var logger=require(_0xfa3b('0x13'))(_0xfa3b('0x14'));var utils=require(_0xfa3b('0x15'));var config=require(_0xfa3b('0x16'));var licenseUtil=require(_0xfa3b('0x17'));var db=require(_0xfa3b('0x18'))['db'];function respondWithStatusCode(_0x5e2e9d,_0x2742ac){_0x2742ac=_0x2742ac||0xcc;return function(_0x5f3254){if(_0x5f3254){return _0x5e2e9d[_0xfa3b('0x19')](_0x2742ac);}return _0x5e2e9d[_0xfa3b('0x1a')](_0x2742ac)[_0xfa3b('0x1b')]();};}function respondWithResult(_0x1d5cc3,_0x4a5763){_0x4a5763=_0x4a5763||0xc8;return function(_0x20f737){if(_0x20f737){return _0x1d5cc3[_0xfa3b('0x1a')](_0x4a5763)[_0xfa3b('0x1c')](_0x20f737);}};}function respondWithFilteredResult(_0x40eeb6,_0x2ca034){return function(_0x175a4f){if(_0x175a4f){var _0x1815eb=typeof _0x2ca034[_0xfa3b('0x1d')]===_0xfa3b('0x1e')&&typeof _0x2ca034[_0xfa3b('0x1f')]==='undefined';var _0x36fe4a=_0x175a4f[_0xfa3b('0x20')];var _0x38a2cf=_0x1815eb?0x0:_0x2ca034[_0xfa3b('0x1d')];var _0x4ad73e=_0x1815eb?_0x175a4f[_0xfa3b('0x20')]:_0x2ca034[_0xfa3b('0x1d')]+_0x2ca034[_0xfa3b('0x1f')];var _0x3d67a7;if(_0x4ad73e>=_0x36fe4a){_0x4ad73e=_0x36fe4a;_0x3d67a7=0xc8;}else{_0x3d67a7=0xce;}_0x40eeb6['status'](_0x3d67a7);return _0x40eeb6[_0xfa3b('0x21')](_0xfa3b('0x22'),_0x38a2cf+'-'+_0x4ad73e+'/'+_0x36fe4a)[_0xfa3b('0x1c')](_0x175a4f);}return null;};}function patchUpdates(_0x2198ad){return function(_0x308e5b){try{jsonpatch[_0xfa3b('0x23')](_0x308e5b,_0x2198ad,!![]);}catch(_0x178a3b){return BPromise[_0xfa3b('0x24')](_0x178a3b);}return _0x308e5b['save']();};}function saveUpdates(_0x25879a,_0x36dff0){return function(_0x5411ea){if(_0x5411ea){return _0x5411ea[_0xfa3b('0x25')](_0x25879a)[_0xfa3b('0x26')](function(_0x370170){return _0x370170;});}return null;};}function removeEntity(_0x4ddc3e,_0xd482ea){return function(_0x400cd3){if(_0x400cd3){return _0x400cd3['destroy']()[_0xfa3b('0x26')](function(){_0x4ddc3e[_0xfa3b('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d4a49,_0x9343c7){return function(_0x368234){if(!_0x368234){_0x4d4a49[_0xfa3b('0x19')](0x194);}return _0x368234;};}function handleError(_0x3d9e5f,_0x5bac01){_0x5bac01=_0x5bac01||0x1f4;return function(_0x4cf92c){logger[_0xfa3b('0x27')](_0x4cf92c[_0xfa3b('0x28')]);if(_0x4cf92c[_0xfa3b('0x29')]){delete _0x4cf92c[_0xfa3b('0x29')];}_0x3d9e5f['status'](_0x5bac01)[_0xfa3b('0x2a')](_0x4cf92c);};}exports[_0xfa3b('0x2b')]=function(_0x13488b,_0x55b958){var _0x11e21e={},_0x539a8c={},_0x4a536b={'count':0x0,'rows':[]};var _0x8114f7=_[_0xfa3b('0x2c')](db['FaxApplication'][_0xfa3b('0x2d')],function(_0x3cbe84){return{'name':_0x3cbe84['fieldName'],'type':_0x3cbe84[_0xfa3b('0x2e')][_0xfa3b('0x2f')]};});_0x539a8c[_0xfa3b('0x30')]=_[_0xfa3b('0x2c')](_0x8114f7,'name');_0x539a8c[_0xfa3b('0x31')]=_[_0xfa3b('0x32')](_0x13488b['query']);_0x539a8c[_0xfa3b('0x33')]=_[_0xfa3b('0x34')](_0x539a8c[_0xfa3b('0x30')],_0x539a8c[_0xfa3b('0x31')]);_0x11e21e[_0xfa3b('0x35')]=_['intersection'](_0x539a8c['model'],qs['fields'](_0x13488b['query'][_0xfa3b('0x36')]));_0x11e21e[_0xfa3b('0x35')]=_0x11e21e['attributes'][_0xfa3b('0x37')]?_0x11e21e[_0xfa3b('0x35')]:_0x539a8c[_0xfa3b('0x30')];if(!_0x13488b[_0xfa3b('0x31')]['hasOwnProperty'](_0xfa3b('0x38'))){_0x11e21e[_0xfa3b('0x1f')]=qs['limit'](_0x13488b['query'][_0xfa3b('0x1f')]);_0x11e21e[_0xfa3b('0x1d')]=qs['offset'](_0x13488b[_0xfa3b('0x31')][_0xfa3b('0x1d')]);}_0x11e21e[_0xfa3b('0x39')]=qs[_0xfa3b('0x3a')](_0x13488b[_0xfa3b('0x31')][_0xfa3b('0x3a')]);_0x11e21e[_0xfa3b('0x3b')]=qs['filters'](_[_0xfa3b('0x3c')](_0x13488b[_0xfa3b('0x31')],_0x539a8c['filters']),_0x8114f7);if(_0x13488b[_0xfa3b('0x31')][_0xfa3b('0x3d')]){_0x11e21e[_0xfa3b('0x3b')]=_[_0xfa3b('0x3e')](_0x11e21e[_0xfa3b('0x3b')],{'$or':_[_0xfa3b('0x2c')](_0x8114f7,function(_0x203024){if(_0x203024[_0xfa3b('0x2e')]!==_0xfa3b('0x3f')){var _0x34e0b3={};_0x34e0b3[_0x203024['name']]={'$like':'%'+_0x13488b[_0xfa3b('0x31')][_0xfa3b('0x3d')]+'%'};return _0x34e0b3;}})});}_0x11e21e=_[_0xfa3b('0x3e')]({},_0x11e21e,_0x13488b[_0xfa3b('0x40')]);var _0x59399a={'where':_0x11e21e[_0xfa3b('0x3b')]};return db[_0xfa3b('0x41')]['count'](_0x59399a)[_0xfa3b('0x26')](function(_0x27ae71){_0x4a536b[_0xfa3b('0x20')]=_0x27ae71;if(_0x13488b[_0xfa3b('0x31')][_0xfa3b('0x42')]){_0x11e21e[_0xfa3b('0x43')]=[{'all':!![]}];}return db[_0xfa3b('0x41')][_0xfa3b('0x44')](_0x11e21e);})[_0xfa3b('0x26')](function(_0x5bcb24){_0x4a536b[_0xfa3b('0x45')]=_0x5bcb24;return _0x4a536b;})['then'](respondWithFilteredResult(_0x55b958,_0x11e21e))[_0xfa3b('0x46')](handleError(_0x55b958,null));};exports[_0xfa3b('0x47')]=function(_0x420351,_0x44a800){var _0x15d216={'raw':!![],'where':{'id':_0x420351['params']['id']}},_0x8d3fa5={};_0x8d3fa5[_0xfa3b('0x30')]=_[_0xfa3b('0x32')](db[_0xfa3b('0x41')][_0xfa3b('0x2d')]);_0x8d3fa5['query']=_[_0xfa3b('0x32')](_0x420351['query']);_0x8d3fa5['filters']=_['intersection'](_0x8d3fa5[_0xfa3b('0x30')],_0x8d3fa5['query']);_0x15d216[_0xfa3b('0x35')]=_[_0xfa3b('0x34')](_0x8d3fa5[_0xfa3b('0x30')],qs[_0xfa3b('0x36')](_0x420351[_0xfa3b('0x31')][_0xfa3b('0x36')]));_0x15d216[_0xfa3b('0x35')]=_0x15d216[_0xfa3b('0x35')][_0xfa3b('0x37')]?_0x15d216[_0xfa3b('0x35')]:_0x8d3fa5[_0xfa3b('0x30')];if(_0x420351[_0xfa3b('0x31')][_0xfa3b('0x42')]){_0x15d216[_0xfa3b('0x43')]=[{'all':!![]}];}_0x15d216=_[_0xfa3b('0x3e')]({},_0x15d216,_0x420351[_0xfa3b('0x40')]);return db['FaxApplication'][_0xfa3b('0x48')](_0x15d216)['then'](handleEntityNotFound(_0x44a800,null))[_0xfa3b('0x26')](respondWithResult(_0x44a800,null))[_0xfa3b('0x46')](handleError(_0x44a800,null));};exports[_0xfa3b('0x49')]=function(_0x59412f,_0x2463c8){return db[_0xfa3b('0x41')][_0xfa3b('0x49')](_0x59412f['body'],{})[_0xfa3b('0x26')](respondWithResult(_0x2463c8,0xc9))[_0xfa3b('0x46')](handleError(_0x2463c8,null));};exports[_0xfa3b('0x25')]=function(_0x3fd2cc,_0x2e2b29){if(_0x3fd2cc[_0xfa3b('0x4a')]['id']){delete _0x3fd2cc['body']['id'];}return db[_0xfa3b('0x41')]['find']({'where':{'id':_0x3fd2cc[_0xfa3b('0x4b')]['id']}})[_0xfa3b('0x26')](handleEntityNotFound(_0x2e2b29,null))['then'](saveUpdates(_0x3fd2cc['body'],null))['then'](respondWithResult(_0x2e2b29,null))[_0xfa3b('0x46')](handleError(_0x2e2b29,null));};exports[_0xfa3b('0x4c')]=function(_0x467676,_0x1680e9){return db['FaxApplication'][_0xfa3b('0x48')]({'where':{'id':_0x467676['params']['id']}})[_0xfa3b('0x26')](handleEntityNotFound(_0x1680e9,null))['then'](removeEntity(_0x1680e9,null))[_0xfa3b('0x46')](handleError(_0x1680e9,null));};
\ No newline at end of file
+var _0xda49=['rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','FaxApplication','findAll','rows','includeAll','include','find','catch','create','body','params'];(function(_0x3bd8f9,_0x54ed38){var _0x355b08=function(_0x29dd5e){while(--_0x29dd5e){_0x3bd8f9['push'](_0x3bd8f9['shift']());}};_0x355b08(++_0x54ed38);}(_0xda49,0x94));var _0x9da4=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0xda49[_0x2064e5];return _0x21a233;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9da4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9da4('0x1'));var rp=require('request-promise');var moment=require(_0x9da4('0x2'));var BPromise=require(_0x9da4('0x3'));var Mustache=require(_0x9da4('0x4'));var util=require(_0x9da4('0x5'));var path=require(_0x9da4('0x6'));var sox=require('sox');var csv=require(_0x9da4('0x7'));var ejs=require(_0x9da4('0x8'));var fs=require('fs');var fs_extra=require(_0x9da4('0x9'));var _=require(_0x9da4('0xa'));var squel=require(_0x9da4('0xb'));var crypto=require(_0x9da4('0xc'));var jsforce=require(_0x9da4('0xd'));var deskjs=require(_0x9da4('0xe'));var toCsv=require(_0x9da4('0x7'));var querystring=require(_0x9da4('0xf'));var Papa=require(_0x9da4('0x10'));var Redis=require(_0x9da4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9da4('0x12'));var as=require(_0x9da4('0x13'));var hardwareService=require(_0x9da4('0x14'));var logger=require(_0x9da4('0x15'))(_0x9da4('0x16'));var utils=require(_0x9da4('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x136df8,_0x26333d){_0x26333d=_0x26333d||0xcc;return function(_0x28bcf0){if(_0x28bcf0){return _0x136df8[_0x9da4('0x18')](_0x26333d);}return _0x136df8['status'](_0x26333d)['end']();};}function respondWithResult(_0x733be4,_0x26cec9){_0x26cec9=_0x26cec9||0xc8;return function(_0x5f1353){if(_0x5f1353){return _0x733be4[_0x9da4('0x19')](_0x26cec9)[_0x9da4('0x1a')](_0x5f1353);}};}function respondWithFilteredResult(_0x1b2b54,_0x2848a2){return function(_0x359529){if(_0x359529){var _0x18dade=typeof _0x2848a2[_0x9da4('0x1b')]===_0x9da4('0x1c')&&typeof _0x2848a2[_0x9da4('0x1d')]===_0x9da4('0x1c');var _0x39cecd=_0x359529[_0x9da4('0x1e')];var _0x1d873a=_0x18dade?0x0:_0x2848a2[_0x9da4('0x1b')];var _0x4472f1=_0x18dade?_0x359529['count']:_0x2848a2[_0x9da4('0x1b')]+_0x2848a2[_0x9da4('0x1d')];var _0x533dc6;if(_0x4472f1>=_0x39cecd){_0x4472f1=_0x39cecd;_0x533dc6=0xc8;}else{_0x533dc6=0xce;}_0x1b2b54['status'](_0x533dc6);return _0x1b2b54[_0x9da4('0x1f')]('Content-Range',_0x1d873a+'-'+_0x4472f1+'/'+_0x39cecd)[_0x9da4('0x1a')](_0x359529);}return null;};}function patchUpdates(_0x2cfd84){return function(_0x19e9bc){try{jsonpatch['apply'](_0x19e9bc,_0x2cfd84,!![]);}catch(_0x3353ed){return BPromise[_0x9da4('0x20')](_0x3353ed);}return _0x19e9bc[_0x9da4('0x21')]();};}function saveUpdates(_0x592ada,_0x20de0b){return function(_0x32a4ff){if(_0x32a4ff){return _0x32a4ff[_0x9da4('0x22')](_0x592ada)[_0x9da4('0x23')](function(_0x5aa959){return _0x5aa959;});}return null;};}function removeEntity(_0xc76449,_0x48b445){return function(_0x23341b){if(_0x23341b){return _0x23341b[_0x9da4('0x24')]()['then'](function(){_0xc76449[_0x9da4('0x19')](0xcc)[_0x9da4('0x25')]();});}};}function handleEntityNotFound(_0x3a595f,_0x3ecc95){return function(_0x4d0d8e){if(!_0x4d0d8e){_0x3a595f[_0x9da4('0x18')](0x194);}return _0x4d0d8e;};}function handleError(_0x9c4559,_0x21dd33){_0x21dd33=_0x21dd33||0x1f4;return function(_0x2d5daf){logger[_0x9da4('0x26')](_0x2d5daf[_0x9da4('0x27')]);if(_0x2d5daf['name']){delete _0x2d5daf[_0x9da4('0x28')];}_0x9c4559[_0x9da4('0x19')](_0x21dd33)[_0x9da4('0x29')](_0x2d5daf);};}exports[_0x9da4('0x2a')]=function(_0x39229f,_0xf55229){var _0x4afa26={},_0x84accf={},_0x3908a7={'count':0x0,'rows':[]};var _0x561a4b=_['map'](db['FaxApplication'][_0x9da4('0x2b')],function(_0x43b833){return{'name':_0x43b833[_0x9da4('0x2c')],'type':_0x43b833[_0x9da4('0x2d')][_0x9da4('0x2e')]};});_0x84accf[_0x9da4('0x2f')]=_[_0x9da4('0x30')](_0x561a4b,'name');_0x84accf[_0x9da4('0x31')]=_[_0x9da4('0x32')](_0x39229f['query']);_0x84accf[_0x9da4('0x33')]=_['intersection'](_0x84accf[_0x9da4('0x2f')],_0x84accf['query']);_0x4afa26[_0x9da4('0x34')]=_[_0x9da4('0x35')](_0x84accf['model'],qs[_0x9da4('0x36')](_0x39229f[_0x9da4('0x31')][_0x9da4('0x36')]));_0x4afa26[_0x9da4('0x34')]=_0x4afa26[_0x9da4('0x34')][_0x9da4('0x37')]?_0x4afa26[_0x9da4('0x34')]:_0x84accf['model'];if(!_0x39229f[_0x9da4('0x31')]['hasOwnProperty']('nolimit')){_0x4afa26['limit']=qs[_0x9da4('0x1d')](_0x39229f[_0x9da4('0x31')]['limit']);_0x4afa26[_0x9da4('0x1b')]=qs[_0x9da4('0x1b')](_0x39229f[_0x9da4('0x31')]['offset']);}_0x4afa26[_0x9da4('0x38')]=qs[_0x9da4('0x39')](_0x39229f['query']['sort']);_0x4afa26[_0x9da4('0x3a')]=qs[_0x9da4('0x33')](_[_0x9da4('0x3b')](_0x39229f['query'],_0x84accf[_0x9da4('0x33')]),_0x561a4b);if(_0x39229f[_0x9da4('0x31')][_0x9da4('0x3c')]){_0x4afa26[_0x9da4('0x3a')]=_[_0x9da4('0x3d')](_0x4afa26['where'],{'$or':_['map'](_0x561a4b,function(_0x565fbd){if(_0x565fbd['type']!==_0x9da4('0x3e')){var _0x1c1e55={};_0x1c1e55[_0x565fbd[_0x9da4('0x28')]]={'$like':'%'+_0x39229f['query'][_0x9da4('0x3c')]+'%'};return _0x1c1e55;}})});}_0x4afa26=_[_0x9da4('0x3d')]({},_0x4afa26,_0x39229f[_0x9da4('0x3f')]);var _0x2cd3c9={'where':_0x4afa26['where']};return db['FaxApplication'][_0x9da4('0x1e')](_0x2cd3c9)['then'](function(_0xbf0c73){_0x3908a7[_0x9da4('0x1e')]=_0xbf0c73;if(_0x39229f[_0x9da4('0x31')]['includeAll']){_0x4afa26['include']=[{'all':!![]}];}return db[_0x9da4('0x40')][_0x9da4('0x41')](_0x4afa26);})[_0x9da4('0x23')](function(_0x43ce08){_0x3908a7[_0x9da4('0x42')]=_0x43ce08;return _0x3908a7;})[_0x9da4('0x23')](respondWithFilteredResult(_0xf55229,_0x4afa26))['catch'](handleError(_0xf55229,null));};exports['show']=function(_0xd752c3,_0x3de867){var _0x41639e={'raw':!![],'where':{'id':_0xd752c3['params']['id']}},_0x59d786={};_0x59d786[_0x9da4('0x2f')]=_[_0x9da4('0x32')](db['FaxApplication'][_0x9da4('0x2b')]);_0x59d786[_0x9da4('0x31')]=_[_0x9da4('0x32')](_0xd752c3[_0x9da4('0x31')]);_0x59d786[_0x9da4('0x33')]=_['intersection'](_0x59d786[_0x9da4('0x2f')],_0x59d786[_0x9da4('0x31')]);_0x41639e[_0x9da4('0x34')]=_[_0x9da4('0x35')](_0x59d786['model'],qs['fields'](_0xd752c3[_0x9da4('0x31')][_0x9da4('0x36')]));_0x41639e[_0x9da4('0x34')]=_0x41639e['attributes'][_0x9da4('0x37')]?_0x41639e[_0x9da4('0x34')]:_0x59d786[_0x9da4('0x2f')];if(_0xd752c3[_0x9da4('0x31')][_0x9da4('0x43')]){_0x41639e[_0x9da4('0x44')]=[{'all':!![]}];}_0x41639e=_[_0x9da4('0x3d')]({},_0x41639e,_0xd752c3[_0x9da4('0x3f')]);return db[_0x9da4('0x40')][_0x9da4('0x45')](_0x41639e)[_0x9da4('0x23')](handleEntityNotFound(_0x3de867,null))['then'](respondWithResult(_0x3de867,null))[_0x9da4('0x46')](handleError(_0x3de867,null));};exports[_0x9da4('0x47')]=function(_0x184b0d,_0x477446){return db[_0x9da4('0x40')][_0x9da4('0x47')](_0x184b0d['body'],{})['then'](respondWithResult(_0x477446,0xc9))['catch'](handleError(_0x477446,null));};exports['update']=function(_0x304721,_0x59f7a0){if(_0x304721[_0x9da4('0x48')]['id']){delete _0x304721[_0x9da4('0x48')]['id'];}return db[_0x9da4('0x40')]['find']({'where':{'id':_0x304721[_0x9da4('0x49')]['id']}})[_0x9da4('0x23')](handleEntityNotFound(_0x59f7a0,null))[_0x9da4('0x23')](saveUpdates(_0x304721[_0x9da4('0x48')],null))['then'](respondWithResult(_0x59f7a0,null))[_0x9da4('0x46')](handleError(_0x59f7a0,null));};exports[_0x9da4('0x24')]=function(_0x37ea84,_0x505d04){return db[_0x9da4('0x40')][_0x9da4('0x45')]({'where':{'id':_0x37ea84['params']['id']}})[_0x9da4('0x23')](handleEntityNotFound(_0x505d04,null))[_0x9da4('0x23')](removeEntity(_0x505d04,null))['catch'](handleError(_0x505d04,null));};
\ No newline at end of file
index 8612ae9..56d4589 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf839=['../../config/environment','./faxApplication.attributes','exports','define','utf8mb4','../../config/logger','api','moment','rimraf'];(function(_0x4bc65f,_0x39ec43){var _0x44f85f=function(_0x175343){while(--_0x175343){_0x4bc65f['push'](_0x4bc65f['shift']());}};_0x44f85f(++_0x39ec43);}(_0xf839,0x71));var _0x9f83=function(_0x555be4,_0x1aa0d5){_0x555be4=_0x555be4-0x0;var _0x4ddb27=_0xf839[_0x555be4];return _0x4ddb27;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9f83('0x0'))(_0x9f83('0x1'));var moment=require(_0x9f83('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9f83('0x3'));var config=require(_0x9f83('0x4'));var attributes=require(_0x9f83('0x5'));module[_0x9f83('0x6')]=function(_0x2d4d70,_0x196c2f){return _0x2d4d70[_0x9f83('0x7')]('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9f83('0x8'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xc385=['fax_applications','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define','FaxApplication'];(function(_0x4e05a7,_0x5301f7){var _0xcdd47d=function(_0x5da300){while(--_0x5da300){_0x4e05a7['push'](_0x4e05a7['shift']());}};_0xcdd47d(++_0x5301f7);}(_0xc385,0xb6));var _0x5c38=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xc385[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require(_0x5c38('0x0'));var util=require('util');var logger=require(_0x5c38('0x1'))(_0x5c38('0x2'));var moment=require(_0x5c38('0x3'));var BPromise=require(_0x5c38('0x4'));var rp=require(_0x5c38('0x5'));var fs=require('fs');var path=require(_0x5c38('0x6'));var rimraf=require(_0x5c38('0x7'));var config=require('../../config/environment');var attributes=require('./faxApplication.attributes');module['exports']=function(_0x1de27f,_0x424b04){return _0x1de27f[_0x5c38('0x8')](_0x5c38('0x9'),attributes,{'tableName':_0x5c38('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5c38('0xb')});};
\ No newline at end of file
index 056d7e1..980dd0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x591d=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','FaxApplication','update','body','options','raw','where','attributes','limit','UpdateFaxApplication','debug','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x4b5306,_0x200588){var _0x582ea1=function(_0x361515){while(--_0x361515){_0x4b5306['push'](_0x4b5306['shift']());}};_0x582ea1(++_0x200588);}(_0x591d,0x171));var _0xd591=function(_0x2a630f,_0x4a3ecb){_0x2a630f=_0x2a630f-0x0;var _0x12326c=_0x591d[_0x2a630f];return _0x12326c;};'use strict';var _=require('lodash');var util=require(_0xd591('0x0'));var moment=require(_0xd591('0x1'));var BPromise=require(_0xd591('0x2'));var rs=require(_0xd591('0x3'));var fs=require('fs');var Redis=require(_0xd591('0x4'));var db=require(_0xd591('0x5'))['db'];var utils=require(_0xd591('0x6'));var logger=require(_0xd591('0x7'))(_0xd591('0x8'));var config=require('../../config/environment');var jayson=require(_0xd591('0x9'));var client=jayson[_0xd591('0xa')][_0xd591('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2aaba9,_0x52d203,_0x577932){return new BPromise(function(_0x5dce35,_0x5dd191){return client[_0xd591('0xc')](_0x2aaba9,_0x577932)[_0xd591('0xd')](function(_0x14cba4){logger[_0xd591('0xe')](_0xd591('0xf'),_0x52d203,_0xd591('0x10'));logger['debug'](_0xd591('0x11'),_0x52d203,_0xd591('0x10'),JSON[_0xd591('0x12')](_0x14cba4));if(_0x14cba4[_0xd591('0x13')]){if(_0x14cba4[_0xd591('0x13')][_0xd591('0x14')]===0x1f4){logger[_0xd591('0x13')](_0xd591('0xf'),_0x52d203,_0x14cba4[_0xd591('0x13')][_0xd591('0x15')]);return _0x5dd191(_0x14cba4[_0xd591('0x13')][_0xd591('0x15')]);}logger[_0xd591('0x13')]('FaxApplication,\x20%s,\x20%s',_0x52d203,_0x14cba4[_0xd591('0x13')][_0xd591('0x15')]);return _0x5dce35(_0x14cba4['error'][_0xd591('0x15')]);}else{logger[_0xd591('0xe')]('FaxApplication,\x20%s,\x20%s',_0x52d203,_0xd591('0x10'));_0x5dce35(_0x14cba4[_0xd591('0x16')][_0xd591('0x15')]);}})['catch'](function(_0x10525c){logger[_0xd591('0x13')](_0xd591('0xf'),_0x52d203,_0x10525c);_0x5dd191(_0x10525c);});});}exports['UpdateFaxApplication']=function(_0x2f471e){var _0x2dfe40=this;return new Promise(function(_0x497aaf,_0x1eb0a5){return db[_0xd591('0x17')][_0xd591('0x18')](_0x2f471e[_0xd591('0x19')],{'raw':_0x2f471e[_0xd591('0x1a')]?_0x2f471e[_0xd591('0x1a')][_0xd591('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f471e[_0xd591('0x1a')]?_0x2f471e[_0xd591('0x1a')][_0xd591('0x1c')]||null:null,'attributes':_0x2f471e[_0xd591('0x1a')]?_0x2f471e[_0xd591('0x1a')][_0xd591('0x1d')]||null:null,'limit':_0x2f471e[_0xd591('0x1a')]?_0x2f471e[_0xd591('0x1a')][_0xd591('0x1e')]||null:null})[_0xd591('0xd')](function(_0x30bd08){logger[_0xd591('0xe')](_0xd591('0x1f'),_0x2f471e);logger[_0xd591('0x20')](_0xd591('0x1f'),_0x2f471e,JSON[_0xd591('0x12')](_0x30bd08));_0x497aaf(_0x30bd08);})[_0xd591('0x21')](function(_0x1325e7){logger[_0xd591('0x13')](_0xd591('0x1f'),_0x1325e7[_0xd591('0x15')],_0x2f471e);_0x1eb0a5(_0x2dfe40[_0xd591('0x13')](0x1f4,_0x1325e7['message']));});});};
\ No newline at end of file
+var _0x3353=['code','message','catch','FaxApplication','update','body','options','raw','where','attributes','UpdateFaxApplication','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x43b362,_0x5529dd){var _0x9d06e8=function(_0x4812fa){while(--_0x4812fa){_0x43b362['push'](_0x43b362['shift']());}};_0x9d06e8(++_0x5529dd);}(_0x3353,0xbf));var _0x3335=function(_0x3bcb6a,_0xf0a2e5){_0x3bcb6a=_0x3bcb6a-0x0;var _0x31519a=_0x3353[_0x3bcb6a];return _0x31519a;};'use strict';var _=require(_0x3335('0x0'));var util=require(_0x3335('0x1'));var moment=require('moment');var BPromise=require(_0x3335('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3335('0x3'))['db'];var utils=require(_0x3335('0x4'));var logger=require(_0x3335('0x5'))(_0x3335('0x6'));var config=require(_0x3335('0x7'));var jayson=require(_0x3335('0x8'));var client=jayson[_0x3335('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x185278,_0x55135f,_0x5201fd){return new BPromise(function(_0x60432,_0x4ae085){return client[_0x3335('0xa')](_0x185278,_0x5201fd)[_0x3335('0xb')](function(_0x367768){logger[_0x3335('0xc')](_0x3335('0xd'),_0x55135f,_0x3335('0xe'));logger[_0x3335('0xf')](_0x3335('0x10'),_0x55135f,_0x3335('0xe'),JSON[_0x3335('0x11')](_0x367768));if(_0x367768[_0x3335('0x12')]){if(_0x367768[_0x3335('0x12')][_0x3335('0x13')]===0x1f4){logger[_0x3335('0x12')](_0x3335('0xd'),_0x55135f,_0x367768[_0x3335('0x12')]['message']);return _0x4ae085(_0x367768[_0x3335('0x12')]['message']);}logger[_0x3335('0x12')](_0x3335('0xd'),_0x55135f,_0x367768[_0x3335('0x12')]['message']);return _0x60432(_0x367768[_0x3335('0x12')]['message']);}else{logger[_0x3335('0xc')](_0x3335('0xd'),_0x55135f,'request\x20sent');_0x60432(_0x367768['result'][_0x3335('0x14')]);}})[_0x3335('0x15')](function(_0x4cf99e){logger[_0x3335('0x12')](_0x3335('0xd'),_0x55135f,_0x4cf99e);_0x4ae085(_0x4cf99e);});});}exports['UpdateFaxApplication']=function(_0x425c27){var _0x767eec=this;return new Promise(function(_0x49846b,_0x4ed59e){return db[_0x3335('0x16')][_0x3335('0x17')](_0x425c27[_0x3335('0x18')],{'raw':_0x425c27[_0x3335('0x19')]?_0x425c27['options'][_0x3335('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x425c27['options']?_0x425c27[_0x3335('0x19')][_0x3335('0x1b')]||null:null,'attributes':_0x425c27['options']?_0x425c27[_0x3335('0x19')][_0x3335('0x1c')]||null:null,'limit':_0x425c27[_0x3335('0x19')]?_0x425c27[_0x3335('0x19')]['limit']||null:null})['then'](function(_0x4e3bdd){logger['info'](_0x3335('0x1d'),_0x425c27);logger[_0x3335('0xf')](_0x3335('0x1d'),_0x425c27,JSON['stringify'](_0x4e3bdd));_0x49846b(_0x4e3bdd);})[_0x3335('0x15')](function(_0x5eba82){logger[_0x3335('0x12')](_0x3335('0x1d'),_0x5eba82['message'],_0x425c27);_0x4ed59e(_0x767eec[_0x3335('0x12')](0x1f4,_0x5eba82[_0x3335('0x14')]));});});};
\ No newline at end of file
index f9616dc..4473ee7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4cf8=['show','create','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated'];(function(_0x2534cf,_0x545be6){var _0x221461=function(_0x379e83){while(--_0x379e83){_0x2534cf['push'](_0x2534cf['shift']());}};_0x221461(++_0x545be6);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x431ff8,_0x4085dd){_0x431ff8=_0x431ff8-0x0;var _0x84ccd4=_0x4cf8[_0x431ff8];return _0x84ccd4;};'use strict';var multer=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var path=require(_0x84cf('0x2'));var timeout=require(_0x84cf('0x3'));var express=require(_0x84cf('0x4'));var router=express[_0x84cf('0x5')]();var fs_extra=require(_0x84cf('0x6'));var auth=require(_0x84cf('0x7'));var interaction=require(_0x84cf('0x8'));var config=require(_0x84cf('0x9'));var controller=require(_0x84cf('0xa'));router[_0x84cf('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x84cf('0xb')]('/:id',auth[_0x84cf('0xc')](),controller[_0x84cf('0xd')]);router['post']('/',auth[_0x84cf('0xc')](),controller[_0x84cf('0xe')]);router['put'](_0x84cf('0xf'),auth[_0x84cf('0xc')](),controller[_0x84cf('0x10')]);router[_0x84cf('0x11')]('/:id',auth[_0x84cf('0xc')](),controller[_0x84cf('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x80ed=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer'];(function(_0x2b152a,_0x3dd988){var _0x2ad4c7=function(_0x2fa97c){while(--_0x2fa97c){_0x2b152a['push'](_0x2b152a['shift']());}};_0x2ad4c7(++_0x3dd988);}(_0x80ed,0x11c));var _0xd80e=function(_0x3f2556,_0x2cddb3){_0x3f2556=_0x3f2556-0x0;var _0x44f3bb=_0x80ed[_0x3f2556];return _0x44f3bb;};'use strict';var multer=require(_0xd80e('0x0'));var util=require('util');var path=require(_0xd80e('0x1'));var timeout=require(_0xd80e('0x2'));var express=require(_0xd80e('0x3'));var router=express['Router']();var fs_extra=require(_0xd80e('0x4'));var auth=require(_0xd80e('0x5'));var interaction=require(_0xd80e('0x6'));var config=require(_0xd80e('0x7'));var controller=require('./faxApplication.controller');router[_0xd80e('0x8')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0xa')]);router['get'](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0xc')]);router[_0xd80e('0xd')]('/',auth[_0xd80e('0x9')](),controller[_0xd80e('0xe')]);router[_0xd80e('0xf')](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x10')]);router['delete'](_0xd80e('0xb'),auth[_0xd80e('0x9')](),controller[_0xd80e('0x11')]);module[_0xd80e('0x12')]=router;
\ No newline at end of file
index 2c4cfb2..094e4bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd12=['STRING','ENUM','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x381935,_0x3f29e1){var _0x2dd2c7=function(_0x20f1b2){while(--_0x20f1b2){_0x381935['push'](_0x381935['shift']());}};_0x2dd2c7(++_0x3f29e1);}(_0xbd12,0x129));var _0x2bd1=function(_0x56bcb3,_0x186fd6){_0x56bcb3=_0x56bcb3-0x0;var _0x38e11b=_0xbd12[_0x56bcb3];return _0x38e11b;};'use strict';var Sequelize=require(_0x2bd1('0x0'));module[_0x2bd1('0x1')]={'closed':{'type':Sequelize[_0x2bd1('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2bd1('0x3')]},'disposition':{'type':Sequelize[_0x2bd1('0x4')]},'secondDisposition':{'type':Sequelize[_0x2bd1('0x4')]},'thirdDisposition':{'type':Sequelize[_0x2bd1('0x4')]},'note':{'type':Sequelize[_0x2bd1('0x4')]},'read1stAt':{'type':Sequelize[_0x2bd1('0x3')]},'fax':{'type':Sequelize[_0x2bd1('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x2bd1('0x5')]('in',_0x2bd1('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2bd1('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x2bd1('0x5')]('in',_0x2bd1('0x6')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
+var _0x0a07=['out','sequelize','BOOLEAN','DATE','STRING','ENUM'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x0a07,0xb5));var _0x70a0=function(_0x4200b5,_0x455678){_0x4200b5=_0x4200b5-0x0;var _0x564599=_0x0a07[_0x4200b5];return _0x564599;};'use strict';var Sequelize=require(_0x70a0('0x0'));module['exports']={'closed':{'type':Sequelize[_0x70a0('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x70a0('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x70a0('0x3')]},'note':{'type':Sequelize[_0x70a0('0x3')]},'read1stAt':{'type':Sequelize[_0x70a0('0x2')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0x70a0('0x4')]('in',_0x70a0('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x70a0('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x70a0('0x4')]('in',_0x70a0('0x5')),'defaultValue':'in','allowNull':![]}};
\ No newline at end of file
index 66cf924..b4ccae8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedb3=['replace','isNumeric','i.id','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','rows','intersection','includeAll','include','options','create','params','describe','FaxMessage','addMessage','ids','hasOwnProperty','FaxInteractionId','findAll','addTags','setTags','omit','spread','emit','faxInteractionTags:save','removeTags','download','root','server','files','join','transcript-%d-%s.zip','Attachment','Messages','get','createReadStream','basename','log','err','eml-format','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','register','status','end','json','undefined','limit','offset','count','set','apply','update','then','destroy','sendStatus','error','stack','name','send','Users','fullname','TagIds','Tags','push','catch','index','map','FaxInteraction','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','pick','select','field','color','tools_tags','u.id','u.fullname','user_has_fax_interactions','from','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','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','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','operator','$substring','split','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','body','compact','isEmpty','FaxAccountId','where','i.FaxAccountId\x20IN\x20?','concat','createdAt','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter'];(function(_0x3c6dce,_0x5424dd){var _0x1450e9=function(_0xd51b5c){while(--_0xd51b5c){_0x3c6dce['push'](_0x3c6dce['shift']());}};_0x1450e9(++_0x5424dd);}(_0xedb3,0x116));var _0x3edb=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xedb3[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require(_0x3edb('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3edb('0x1'));var rp=require(_0x3edb('0x2'));var moment=require(_0x3edb('0x3'));var BPromise=require(_0x3edb('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3edb('0x5'));var sox=require(_0x3edb('0x6'));var csv=require(_0x3edb('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3edb('0x8'));var _=require(_0x3edb('0x9'));var squel=require(_0x3edb('0xa'));var crypto=require(_0x3edb('0xb'));var jsforce=require(_0x3edb('0xc'));var deskjs=require(_0x3edb('0xd'));var toCsv=require(_0x3edb('0x7'));var querystring=require(_0x3edb('0xe'));var Papa=require(_0x3edb('0xf'));var Redis=require('ioredis');var authService=require(_0x3edb('0x10'));var qs=require(_0x3edb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3edb('0x12'));var utils=require('../../config/utils');var config=require(_0x3edb('0x13'));var licenseUtil=require(_0x3edb('0x14'));var db=require(_0x3edb('0x15'))['db'];config['redis']=_[_0x3edb('0x16')](config[_0x3edb('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x3edb('0x18'))(new Redis(config[_0x3edb('0x17')]));require('./faxInteraction.socket')[_0x3edb('0x19')](socket);function respondWithStatusCode(_0x3cdd74,_0x8a2b4f){_0x8a2b4f=_0x8a2b4f||0xcc;return function(_0x183679){if(_0x183679){return _0x3cdd74['sendStatus'](_0x8a2b4f);}return _0x3cdd74[_0x3edb('0x1a')](_0x8a2b4f)[_0x3edb('0x1b')]();};}function respondWithResult(_0x4e3586,_0x316fba){_0x316fba=_0x316fba||0xc8;return function(_0x38be29){if(_0x38be29){return _0x4e3586['status'](_0x316fba)[_0x3edb('0x1c')](_0x38be29);}};}function respondWithFilteredResult(_0x54843b,_0x345779){return function(_0x5c278f){if(_0x5c278f){var _0x236f83=typeof _0x345779['offset']===_0x3edb('0x1d')&&typeof _0x345779[_0x3edb('0x1e')]===_0x3edb('0x1d');var _0x30526c=_0x5c278f['count'];var _0x181038=_0x236f83?0x0:_0x345779[_0x3edb('0x1f')];var _0x8340cb=_0x236f83?_0x5c278f[_0x3edb('0x20')]:_0x345779[_0x3edb('0x1f')]+_0x345779['limit'];var _0xd2e007;if(_0x8340cb>=_0x30526c){_0x8340cb=_0x30526c;_0xd2e007=0xc8;}else{_0xd2e007=0xce;}_0x54843b[_0x3edb('0x1a')](_0xd2e007);return _0x54843b[_0x3edb('0x21')]('Content-Range',_0x181038+'-'+_0x8340cb+'/'+_0x30526c)[_0x3edb('0x1c')](_0x5c278f);}return null;};}function patchUpdates(_0x22359e){return function(_0x5eb884){try{jsonpatch[_0x3edb('0x22')](_0x5eb884,_0x22359e,!![]);}catch(_0x426e50){return BPromise['reject'](_0x426e50);}return _0x5eb884['save']();};}function saveUpdates(_0x59c200,_0x44fb05){return function(_0x4572ac){if(_0x4572ac){return _0x4572ac[_0x3edb('0x23')](_0x59c200)[_0x3edb('0x24')](function(_0x4a6b06){return _0x4a6b06;});}return null;};}function removeEntity(_0x1f921a,_0x19a83c){return function(_0x3a5f45){if(_0x3a5f45){return _0x3a5f45[_0x3edb('0x25')]()[_0x3edb('0x24')](function(){_0x1f921a[_0x3edb('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12c7eb,_0x27cec1){return function(_0x230b5c){if(!_0x230b5c){_0x12c7eb[_0x3edb('0x26')](0x194);}return _0x230b5c;};}function handleError(_0x59db29,_0x1558e8){_0x1558e8=_0x1558e8||0x1f4;return function(_0x2e954f){logger[_0x3edb('0x27')](_0x2e954f[_0x3edb('0x28')]);if(_0x2e954f[_0x3edb('0x29')]){delete _0x2e954f['name'];}_0x59db29[_0x3edb('0x1a')](_0x1558e8)[_0x3edb('0x2a')](_0x2e954f);};}function getInteractionUsers(_0x5672af,_0x23217b){return new BPromise(function(_0x5de229,_0x12accc){try{if(_0x23217b[_0x5672af['id']]){_0x5672af[_0x3edb('0x2b')]=_['map'](_0x23217b[_0x5672af['id']],function(_0xe5286c){return{'id':_0xe5286c['id'],'fullname':_0xe5286c[_0x3edb('0x2c')]};});}}catch(_0x4ca2a2){_0x12accc(_0x4ca2a2);}_0x5de229(_0x5672af);});}function getInteractionTags(_0x341a0c,_0x1612bb){return new BPromise(function(_0x587120,_0x4952fe){try{if(_0x341a0c[_0x3edb('0x2d')]){_0x341a0c['Tags']=[];_0x341a0c['TagIds']['split'](',')['forEach'](function(_0x2232f3){_0x341a0c[_0x3edb('0x2e')][_0x3edb('0x2f')](_0x1612bb[_0x2232f3]);});}delete _0x341a0c[_0x3edb('0x2d')];}catch(_0x54a6ca){_0x4952fe(_0x54a6ca);}_0x587120(_0x341a0c);});}function updateFaxInteraction(_0x5a5b1a,_0x44e823,_0x4404da){return new BPromise(function(_0x150f77,_0x1ffffc){return getInteractionUsers(_0x5a5b1a,_0x4404da)['then'](function(_0x4d171f){return getInteractionTags(_0x4d171f,_0x44e823);})[_0x3edb('0x24')](function(_0x1c2192){_0x150f77(_0x1c2192);})[_0x3edb('0x30')](function(_0x4d7974){_0x1ffffc(_0x4d7974);});});}exports[_0x3edb('0x31')]=function(_0x46db59,_0x1db21c){var _0x3ee11c={},_0x201445={},_0x30b2b6={'count':0x0,'rows':[]};var _0x2c8044=_[_0x3edb('0x32')](db[_0x3edb('0x33')][_0x3edb('0x34')],function(_0x345e6f){return{'name':_0x345e6f['fieldName'],'type':_0x345e6f[_0x3edb('0x35')][_0x3edb('0x36')]};});_0x201445[_0x3edb('0x37')]=_['map'](_0x2c8044,_0x3edb('0x29'));_0x201445[_0x3edb('0x38')]=_[_0x3edb('0x39')](_0x46db59['query']);_0x201445[_0x3edb('0x3a')]=_['intersection'](_0x201445['model'],_0x201445['query']);_0x3ee11c[_0x3edb('0x3b')]=_['intersection'](_0x201445[_0x3edb('0x37')],qs['fields'](_0x46db59[_0x3edb('0x38')][_0x3edb('0x3c')]));_0x3ee11c[_0x3edb('0x3b')]=_0x3ee11c[_0x3edb('0x3b')][_0x3edb('0x3d')]?_0x3ee11c[_0x3edb('0x3b')]:_0x201445['model'];if(!_0x46db59[_0x3edb('0x38')]['hasOwnProperty'](_0x3edb('0x3e'))){_0x3ee11c['limit']=qs[_0x3edb('0x1e')](_0x46db59[_0x3edb('0x38')]['limit']);_0x3ee11c[_0x3edb('0x1f')]=qs[_0x3edb('0x1f')](_0x46db59[_0x3edb('0x38')][_0x3edb('0x1f')]);}_0x3ee11c[_0x3edb('0x3f')]=qs['sort'](_0x46db59[_0x3edb('0x38')][_0x3edb('0x40')]);_0x3ee11c['where']=qs[_0x3edb('0x3a')](_[_0x3edb('0x41')](_0x46db59[_0x3edb('0x38')],_0x201445['filters']),_0x2c8044);var _0x488086=[];var _0x28d13a=squel[_0x3edb('0x42')]()[_0x3edb('0x43')]('id')['field']('name')[_0x3edb('0x43')](_0x3edb('0x44'))['from'](_0x3edb('0x45'));var _0x2b7213=squel[_0x3edb('0x42')]()[_0x3edb('0x43')](_0x3edb('0x46'))[_0x3edb('0x43')](_0x3edb('0x47'))[_0x3edb('0x43')]('ui.FaxInteractionId')['from'](_0x3edb('0x48'),'ui')['left_join']('users','u','u.id\x20=\x20ui.UserId');var _0x4d4537=squel[_0x3edb('0x42')]()[_0x3edb('0x49')]('fax_interactions','i')[_0x3edb('0x4a')]('cm_contacts','c',_0x3edb('0x4b'))[_0x3edb('0x4a')]('users','o',_0x3edb('0x4c'))[_0x3edb('0x4a')]('fax_accounts','a',_0x3edb('0x4d'))['left_join'](_0x3edb('0x4e'),'me',_0x3edb('0x4f'))[_0x3edb('0x4a')](_0x3edb('0x50'),'it',_0x3edb('0x51'))[_0x3edb('0x4a')](_0x3edb('0x45'),'t',_0x3edb('0x52'));var _0x4c9b06=squel[_0x3edb('0x53')]();var _0x5a0bf1=[];var _0x742aee=squel[_0x3edb('0x53')]();var _0x4964f6;if(_0x46db59[_0x3edb('0x38')][_0x3edb('0x54')]){_0x4964f6=as[_0x3edb('0x55')](_0x46db59['query'][_0x3edb('0x54')]);var _0x5d617d=_0x4964f6[_0x3edb('0x56')];for(var _0x925e5c=0x0;_0x925e5c<_0x4964f6[_0x3edb('0x57')][_0x3edb('0x3d')];_0x925e5c++){var _0x336cb2=_0x4964f6['conditions'][_0x925e5c];var _0x5b68ba='i';var _0x1f8ca4=_['find'](_0x2c8044,[_0x3edb('0x29'),_0x336cb2[_0x3edb('0x43')]]);if(!_0x1f8ca4){switch(_0x336cb2[_0x3edb('0x43')]){case _0x3edb('0x58'):if(_0x336cb2[_0x3edb('0x59')]==0x1){_0x4d4537['having']('`'+_0x336cb2[_0x3edb('0x43')]+_0x3edb('0x5a'));}else{_0x4d4537[_0x3edb('0x5b')]('`'+_0x336cb2[_0x3edb('0x43')]+_0x3edb('0x5c'));}break;case'Contact':if(_0x336cb2[_0x3edb('0x5d')]===_0x3edb('0x5e')){if(_0x336cb2[_0x3edb('0x59')][_0x3edb('0x5f')]('\x20')[_0x3edb('0x3d')]>0x1){_0x4c9b06[_0x5d617d]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3edb('0x60')](_0x336cb2[_0x3edb('0x59')]),null);}else{var _0x5dfa8c='%'+_0x336cb2[_0x3edb('0x59')]+'%';_0x4c9b06[_0x5d617d](_0x3edb('0x61'),_0x5dfa8c,_0x5dfa8c,_0x5dfa8c);}}else{_0x1f8ca4=_['find'](_0x2c8044,['name',_0x3edb('0x62')]);_0x336cb2['field']='ContactId';_0x2f05cb=as[_0x3edb('0x63')](_0x5b68ba,_0x1f8ca4['type'],_0x336cb2);_0x4c9b06[_0x5d617d](_0x2f05cb[_0x3edb('0x64')],_0x2f05cb[_0x3edb('0x59')][_0x3edb('0x65')],_0x2f05cb[_0x3edb('0x59')][_0x3edb('0x1b')]);}break;case _0x3edb('0x66'):var _0x12ec8d=_0x336cb2[_0x3edb('0x59')]['split'](',')[_0x3edb('0x32')](function(_0x22159a){return Number(_0x22159a);});_0x12ec8d['forEach'](function(_0x30510e){_0x742aee['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x30510e+',%');});_0x5a0bf1=_[_0x3edb('0x67')](_0x5a0bf1,_0x12ec8d);break;case _0x3edb('0x68'):if(_0x336cb2[_0x3edb('0x5d')]===_0x3edb('0x5e')){_0x4c9b06[_0x5d617d](_0x3edb('0x69'),'%'+_0x336cb2[_0x3edb('0x59')]+'%',null);}else{_0x1f8ca4=_[_0x3edb('0x6a')](_0x2c8044,[_0x3edb('0x29'),'UserId']);_0x336cb2[_0x3edb('0x43')]=_0x3edb('0x6b');_0x2f05cb=as[_0x3edb('0x63')](_0x5b68ba,_0x1f8ca4[_0x3edb('0x35')],_0x336cb2);_0x4c9b06[_0x5d617d](_0x2f05cb[_0x3edb('0x64')],_0x2f05cb[_0x3edb('0x59')]['start'],_0x2f05cb[_0x3edb('0x59')][_0x3edb('0x1b')]);}break;case _0x3edb('0x6c'):_0x2f05cb=as[_0x3edb('0x63')]('me',null,_0x336cb2);_0x4c9b06[_0x5d617d](_0x2f05cb[_0x3edb('0x64')],_0x2f05cb['value']['start'],_0x2f05cb[_0x3edb('0x59')]['end']);break;}}else{var _0x2f05cb=as[_0x3edb('0x63')](_0x5b68ba,_0x1f8ca4['type'],_0x336cb2);_0x4c9b06[_0x5d617d](_0x2f05cb[_0x3edb('0x64')],_0x2f05cb['value']['start'],_0x2f05cb[_0x3edb('0x59')][_0x3edb('0x1b')]);}}}else{var _0x9d82c0=_(_0x46db59[_0x3edb('0x38')])['keys']()[_0x3edb('0x32')](function(_0x872da2){return _['some'](_0x2c8044,[_0x3edb('0x29'),_0x872da2])?_0x872da2:undefined;})[_0x3edb('0x6d')]()['value']();if(!_[_0x3edb('0x6e')](_0x9d82c0)){_0x9d82c0['forEach'](function(_0x1c1d8c){if(_0x1c1d8c===_0x3edb('0x6f')){_0x4d4537[_0x3edb('0x70')](_0x3edb('0x71'),[][_0x3edb('0x72')](_0x46db59['query'][_0x1c1d8c]));}else if(_0x1c1d8c===_0x3edb('0x73')){var _0x5f0d0f=JSON['parse'](_0x46db59['query'][_0x1c1d8c])[_0x3edb('0x74')];var _0x5e3f26=JSON['parse'](_0x46db59[_0x3edb('0x38')][_0x1c1d8c])[_0x3edb('0x75')];_0x4d4537[_0x3edb('0x70')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5f0d0f,_0x5e3f26);}else{if(_0x46db59[_0x3edb('0x38')][_0x1c1d8c]===_0x3edb('0x76')){_0x4d4537['where']('i.'+_0x1c1d8c+_0x3edb('0x77'));}else{_0x4d4537[_0x3edb('0x70')]('i.'+_0x1c1d8c+_0x3edb('0x78'),_0x46db59['query'][_0x1c1d8c]);}}});}if(_0x46db59[_0x3edb('0x38')][_0x3edb('0x79')]){if(_0x46db59[_0x3edb('0x38')][_0x3edb('0x79')]==0x1){_0x4d4537[_0x3edb('0x5b')](_0x3edb('0x7a'));}else{_0x4d4537[_0x3edb('0x5b')](_0x3edb('0x7b'));}}if(_0x46db59[_0x3edb('0x38')]['tag']){_0x5a0bf1=_['isArray'](_0x46db59['query'][_0x3edb('0x7c')])?_0x46db59[_0x3edb('0x38')]['tag']:new Array(_0x46db59[_0x3edb('0x38')]['tag']);_0x5a0bf1[_0x3edb('0x7d')](function(_0x4269d1){_0x742aee['or'](_0x3edb('0x7e'),'%,'+_0x4269d1+',%');});}if(_0x46db59[_0x3edb('0x38')][_0x3edb('0x7f')]){var _0x391725=_0x46db59[_0x3edb('0x38')][_0x3edb('0x7f')][_0x3edb('0x80')]('\x5c','\x5c\x5c')[_0x3edb('0x80')](/'/g,'\x27\x27');if(qs[_0x3edb('0x81')](_0x391725)){_0x4c9b06['or']('i.id\x20LIKE\x20?',_0x391725+'%')['or']('i.fax\x20LIKE\x20?',_0x391725+'%');}_0x4c9b06['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x391725+'%');}}_0x4d4537[_0x3edb('0x70')](_0x4c9b06);_0x4d4537['group'](_0x3edb('0x82'));var _0xdee7d6={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0x474e28=_0x4d4537[_0x3edb('0x83')]();_0x474e28[_0x3edb('0x43')](_0x3edb('0x82'));_0x474e28[_0x3edb('0x43')](_0x3edb('0x84'),_0x3edb('0x58'));if(_0x3ee11c[_0x3edb('0x3f')]){_0x3ee11c[_0x3edb('0x3f')][_0x3edb('0x7d')](function(_0x70146a){var _0x72f972=_0x70146a[0x0]===_0x3edb('0x85')?_0x70146a[0x0]:'i.'+_0x70146a[0x0];_0x4d4537[_0x3edb('0x3f')](_0x72f972,_0x70146a[0x1]===_0x3edb('0x86')?![]:!![]);});}if(!_['isEmpty'](_0x5a0bf1)){_0x4d4537[_0x3edb('0x5b')](_0x742aee);_0x474e28[_0x3edb('0x70')](_0x3edb('0x87'),_0x5a0bf1);}BPromise[_0x3edb('0x88')]()[_0x3edb('0x24')](function(){if(!_0x4964f6){if(_0x46db59['query'][_0x3edb('0x6f')])return;_0x474e28[_0x3edb('0x70')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x4d4537[_0x3edb('0x70')](_0x3edb('0x89'));return;}if(_0x46db59['user'][_0x3edb('0x8a')]!==_0x3edb('0x8b'))return;return _0x46db59[_0x3edb('0x8c')][_0x3edb('0x8d')]({'attributes':['id'],'raw':!![]})[_0x3edb('0x24')](function(_0x516dc9){if(_[_0x3edb('0x6e')](_0x516dc9)){_0x474e28[_0x3edb('0x70')](_0x3edb('0x8e'));_0x4d4537[_0x3edb('0x70')](_0x3edb('0x8e'));}else{_0x474e28[_0x3edb('0x70')](_0x3edb('0x71'),_[_0x3edb('0x32')](_0x516dc9,'id'));_0x4d4537[_0x3edb('0x70')](_0x3edb('0x71'),_[_0x3edb('0x32')](_0x516dc9,'id'));}});})[_0x3edb('0x24')](function(){if(_0x46db59['user'][_0x3edb('0x8a')]==='agent'&&!_0x4964f6&&!_0x46db59[_0x3edb('0x38')][_0x3edb('0x6f')])return[];return db[_0x3edb('0x8f')]['query'](_0x474e28[_0x3edb('0x90')](),_0xdee7d6);})[_0x3edb('0x24')](function(_0x35c3af){_0x30b2b6[_0x3edb('0x20')]=_0x35c3af[_0x3edb('0x3d')];if(_0x30b2b6[_0x3edb('0x20')]===0x0)return[];return db[_0x3edb('0x8f')][_0x3edb('0x38')](_0x28d13a[_0x3edb('0x90')](),_0xdee7d6)[_0x3edb('0x24')](function(_0x479d01){_0x488086=_[_0x3edb('0x91')](_0x479d01,'id');_0xdee7d6=_[_0x3edb('0x92')](_0xdee7d6,{'model':db[_0x3edb('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x46db59[_0x3edb('0x38')][_0x3edb('0x3c')]){_0x3ee11c[_0x3edb('0x3b')][_0x3edb('0x7d')](function(_0x6c829f){_0x4d4537[_0x3edb('0x43')]('i.'+_0x6c829f);});}else{_0x4d4537[_0x3edb('0x43')](_0x3edb('0x84'),_0x3edb('0x58'));_0x4d4537[_0x3edb('0x43')]('a.key','Account.key');_0x4d4537[_0x3edb('0x43')](_0x3edb('0x93'),_0x3edb('0x94'));_0x4d4537[_0x3edb('0x43')](_0x3edb('0x95'),_0x3edb('0x85'));_0x4d4537[_0x3edb('0x43')](_0x3edb('0x96'));_0x4d4537[_0x3edb('0x43')](_0x3edb('0x97'),_0x3edb('0x98'));_0x4d4537['field'](_0x3edb('0x99'),_0x3edb('0x9a'));_0x4d4537[_0x3edb('0x43')](_0x3edb('0x9b'),_0x3edb('0x9c'));_0x4d4537[_0x3edb('0x43')](_0x3edb('0x9d'),_0x3edb('0x9e'));_0x4d4537['field'](_0x3edb('0x9f'),_0x3edb('0xa0'));_0x4d4537[_0x3edb('0x43')](_0x3edb('0xa1'),_0x3edb('0xa2'));_0x4d4537[_0x3edb('0x43')](_0x3edb('0xa3'),'Owner.fullname');_0x4d4537[_0x3edb('0x43')](_0x3edb('0xa4'),_0x3edb('0xa5'));_0x4d4537[_0x3edb('0x43')](_0x3edb('0xa6'),_0x3edb('0x2d'));}if(_0x3ee11c['limit'])_0x4d4537['limit'](_0x3ee11c[_0x3edb('0x1e')]);if(_0x3ee11c[_0x3edb('0x1f')])_0x4d4537[_0x3edb('0x1f')](_0x3ee11c[_0x3edb('0x1f')]);return db[_0x3edb('0x8f')][_0x3edb('0x38')](_0x4d4537[_0x3edb('0x90')](),_0xdee7d6);})[_0x3edb('0x24')](function(_0x154da6){if(_0x154da6[_0x3edb('0x3d')]>0x0)_0x2b7213['where'](_0x3edb('0xa7'),_[_0x3edb('0x32')](_0x154da6,'id'));return db[_0x3edb('0x8f')]['query'](_0x2b7213[_0x3edb('0x90')](),_0xdee7d6)[_0x3edb('0x24')](function(_0x1b7608){var _0x30155f=_[_0x3edb('0xa8')](_0x1b7608,'FaxInteractionId');var _0x358679=[];_0x154da6[_0x3edb('0x7d')](function(_0x36890c){_0x358679['push'](updateFaxInteraction(_0x36890c,_0x488086,_0x30155f));});return BPromise['all'](_0x358679);});});})['then'](function(_0x275265){_0x30b2b6[_0x3edb('0xa9')]=_0x275265;return _0x30b2b6;})[_0x3edb('0x24')](respondWithFilteredResult(_0x1db21c,_0x3ee11c))[_0x3edb('0x30')](handleError(_0x1db21c,null));};exports['show']=function(_0x5de9b1,_0x4e531b){var _0x1678b2={'raw':![],'where':{'id':_0x5de9b1['params']['id']}},_0x24ce46={};_0x24ce46['model']=_[_0x3edb('0x39')](db[_0x3edb('0x33')]['rawAttributes']);_0x24ce46[_0x3edb('0x38')]=_[_0x3edb('0x39')](_0x5de9b1['query']);_0x24ce46['filters']=_[_0x3edb('0xaa')](_0x24ce46[_0x3edb('0x37')],_0x24ce46['query']);_0x1678b2[_0x3edb('0x3b')]=_[_0x3edb('0xaa')](_0x24ce46['model'],qs[_0x3edb('0x3c')](_0x5de9b1[_0x3edb('0x38')][_0x3edb('0x3c')]));_0x1678b2[_0x3edb('0x3b')]=_0x1678b2['attributes'][_0x3edb('0x3d')]?_0x1678b2[_0x3edb('0x3b')]:_0x24ce46[_0x3edb('0x37')];if(_0x5de9b1[_0x3edb('0x38')][_0x3edb('0xab')]){_0x1678b2[_0x3edb('0xac')]=[{'all':!![]}];}_0x1678b2=_[_0x3edb('0x92')]({},_0x1678b2,_0x5de9b1[_0x3edb('0xad')]);return db[_0x3edb('0x33')]['find'](_0x1678b2)[_0x3edb('0x24')](handleEntityNotFound(_0x4e531b,null))[_0x3edb('0x24')](respondWithResult(_0x4e531b,null))['catch'](handleError(_0x4e531b,null));};exports[_0x3edb('0xae')]=function(_0x40daf6,_0x4677ac){return db['FaxInteraction']['create'](_0x40daf6[_0x3edb('0x6c')],{})[_0x3edb('0x24')](respondWithResult(_0x4677ac,0xc9))[_0x3edb('0x30')](handleError(_0x4677ac,null));};exports['update']=function(_0x114ac4,_0x11d5a7){if(_0x114ac4[_0x3edb('0x6c')]['id']){delete _0x114ac4[_0x3edb('0x6c')]['id'];}return db[_0x3edb('0x33')][_0x3edb('0x6a')]({'where':{'id':_0x114ac4[_0x3edb('0xaf')]['id']}})['then'](handleEntityNotFound(_0x11d5a7,null))[_0x3edb('0x24')](saveUpdates(_0x114ac4[_0x3edb('0x6c')],null))[_0x3edb('0x24')](respondWithResult(_0x11d5a7,null))[_0x3edb('0x30')](handleError(_0x11d5a7,null));};exports[_0x3edb('0x25')]=function(_0x509e90,_0x86db87){return db[_0x3edb('0x33')][_0x3edb('0x6a')]({'where':{'id':_0x509e90['params']['id']}})[_0x3edb('0x24')](handleEntityNotFound(_0x86db87,null))[_0x3edb('0x24')](removeEntity(_0x86db87,null))[_0x3edb('0x30')](handleError(_0x86db87,null));};exports[_0x3edb('0xb0')]=function(_0x248f83,_0xadcdda){return db[_0x3edb('0x33')][_0x3edb('0xb0')]()['then'](respondWithResult(_0xadcdda,null))[_0x3edb('0x30')](handleError(_0xadcdda,null));};exports['addMessage']=function(_0xbcc595,_0xdc816b,_0x406718){return db[_0x3edb('0xb1')][_0x3edb('0x6a')]({'where':{'id':_0xbcc595[_0x3edb('0xaf')]['id']}})[_0x3edb('0x24')](handleEntityNotFound(_0xdc816b,null))[_0x3edb('0x24')](function(_0x3aa6ce){if(_0x3aa6ce){return _0x3aa6ce[_0x3edb('0xb2')](_0xbcc595[_0x3edb('0x6c')][_0x3edb('0xb3')],_['omit'](_0xbcc595[_0x3edb('0x6c')],['ids','id'])||{});}})[_0x3edb('0x24')](respondWithResult(_0xdc816b,null))['catch'](handleError(_0xdc816b,null));};exports['getMessages']=function(_0x52f80b,_0x524ff2,_0x156cff){var _0x31a7eb={'raw':![],'where':{}};var _0x11ab06={};var _0x39bf7a={'count':0x0,'rows':[]};return db[_0x3edb('0x33')]['findOne']({'where':{'id':_0x52f80b[_0x3edb('0xaf')]['id']}})['then'](handleEntityNotFound(_0x524ff2,null))[_0x3edb('0x24')](function(_0x40d88d){if(_0x40d88d){_0x11ab06[_0x3edb('0x37')]=_[_0x3edb('0x39')](db[_0x3edb('0xb1')]['rawAttributes']);_0x11ab06[_0x3edb('0x38')]=_['keys'](_0x52f80b[_0x3edb('0x38')]);_0x11ab06[_0x3edb('0x3a')]=_[_0x3edb('0xaa')](_0x11ab06[_0x3edb('0x37')],_0x11ab06[_0x3edb('0x38')]);_0x31a7eb[_0x3edb('0x3b')]=_[_0x3edb('0xaa')](_0x11ab06[_0x3edb('0x37')],qs[_0x3edb('0x3c')](_0x52f80b[_0x3edb('0x38')]['fields']));_0x31a7eb['attributes']=_0x31a7eb[_0x3edb('0x3b')][_0x3edb('0x3d')]?_0x31a7eb[_0x3edb('0x3b')]:_0x11ab06[_0x3edb('0x37')];if(!_0x52f80b[_0x3edb('0x38')][_0x3edb('0xb4')]('nolimit')){_0x31a7eb[_0x3edb('0x1e')]=qs[_0x3edb('0x1e')](_0x52f80b[_0x3edb('0x38')][_0x3edb('0x1e')]);_0x31a7eb[_0x3edb('0x1f')]=qs['offset'](_0x52f80b[_0x3edb('0x38')][_0x3edb('0x1f')]);}_0x31a7eb[_0x3edb('0x3f')]=qs['sort'](_0x52f80b[_0x3edb('0x38')]['sort']);_0x31a7eb[_0x3edb('0x70')]=qs[_0x3edb('0x3a')](_['pick'](_0x52f80b[_0x3edb('0x38')],_0x11ab06[_0x3edb('0x3a')]));_0x31a7eb[_0x3edb('0x70')][_0x3edb('0xb5')]=_0x40d88d['id'];if(_0x52f80b[_0x3edb('0x38')][_0x3edb('0x7f')]){_0x31a7eb['where']=_[_0x3edb('0x92')](_0x31a7eb[_0x3edb('0x70')],{'$or':_['map'](_0x31a7eb[_0x3edb('0x3b')],function(_0x3a671b){var _0x1d6438={};_0x1d6438[_0x3a671b]={'$like':'%'+_0x52f80b[_0x3edb('0x38')][_0x3edb('0x7f')]+'%'};return _0x1d6438;})});}if(_0x52f80b['query'][_0x3edb('0x74')]){var _0x1829c6=_0x52f80b[_0x3edb('0x38')][_0x3edb('0x74')][_0x3edb('0x5f')](',');var _0x4f4e35={};_0x4f4e35[_0x1829c6[0x0]]={'$gte':moment(_0x1829c6[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x31a7eb['where']=_['merge'](_0x31a7eb[_0x3edb('0x70')],_0x4f4e35);}_0x31a7eb=_['merge']({},_0x31a7eb,_0x52f80b['options']);return db[_0x3edb('0xb1')]['count']({'where':_0x31a7eb['where']})[_0x3edb('0x24')](function(_0x420d7a){_0x39bf7a[_0x3edb('0x20')]=_0x420d7a;if(_0x52f80b[_0x3edb('0x38')][_0x3edb('0xab')]){_0x31a7eb['include']=[{'all':!![]}];}return db[_0x3edb('0xb1')][_0x3edb('0xb6')](_0x31a7eb);})[_0x3edb('0x24')](function(_0x3301d1){_0x39bf7a[_0x3edb('0xa9')]=_0x3301d1;return _0x39bf7a;});}})[_0x3edb('0x24')](respondWithFilteredResult(_0x524ff2,_0x31a7eb))[_0x3edb('0x30')](handleError(_0x524ff2,null));};exports[_0x3edb('0xb7')]=function(_0x4b6c7b,_0x1f00f7,_0x594794){return db[_0x3edb('0x33')]['find']({'where':{'id':_0x4b6c7b[_0x3edb('0xaf')]['id']}})[_0x3edb('0x24')](handleEntityNotFound(_0x1f00f7,null))[_0x3edb('0x24')](function(_0x58aabe){if(_0x58aabe){return _0x58aabe[_0x3edb('0xb8')](_0x4b6c7b[_0x3edb('0x6c')][_0x3edb('0xb3')],_[_0x3edb('0xb9')](_0x4b6c7b['body'],[_0x3edb('0xb3'),'id'])||{})[_0x3edb('0xba')](function(){return db[_0x3edb('0x66')][_0x3edb('0xb6')]({'attributes':['id',_0x3edb('0x29'),_0x3edb('0x44')],'where':{'id':_0x4b6c7b[_0x3edb('0x6c')][_0x3edb('0xb3')]}});})['then'](function(_0x3f321a){socket[_0x3edb('0xbb')](_0x3edb('0xbc'),{'id':Number(_0x4b6c7b[_0x3edb('0xaf')]['id']),'tags':_0x3f321a||[]});return{'id':Number(_0x4b6c7b['params']['id']),'tags':_0x3f321a||[]};});}})['then'](respondWithResult(_0x1f00f7,null))[_0x3edb('0x30')](handleError(_0x1f00f7,null));};exports[_0x3edb('0xbd')]=function(_0x934a6d,_0x285f40,_0x35bcb9){return db[_0x3edb('0x33')][_0x3edb('0x6a')]({'where':{'id':_0x934a6d['params']['id']}})[_0x3edb('0x24')](handleEntityNotFound(_0x285f40,null))[_0x3edb('0x24')](function(_0x5e58ac){if(_0x5e58ac){return _0x5e58ac[_0x3edb('0xbd')](_0x934a6d[_0x3edb('0x38')][_0x3edb('0xb3')]);}})[_0x3edb('0x24')](respondWithStatusCode(_0x285f40,null))[_0x3edb('0x30')](handleError(_0x285f40,null));};exports[_0x3edb('0xbe')]=function(_0x5aca1f,_0x2ad2be){var _0x25bee9=moment()['unix']()['toString']();var _0x52e055=path['join'](config[_0x3edb('0xbf')],_0x3edb('0xc0'),_0x3edb('0xc1'),'tmp');var _0x30f673=path[_0x3edb('0xc2')](config[_0x3edb('0xbf')],'server',_0x3edb('0xc1'),'attachments');var _0x4a059c=path[_0x3edb('0xc2')](_0x52e055,_0x25bee9);var _0x374e9e=util['format'](_0x3edb('0xc3'),_0x5aca1f[_0x3edb('0xaf')]['id'],_0x25bee9);var _0x3e3b1e=path[_0x3edb('0xc2')](_0x52e055,_0x374e9e);var _0x14d544=[];_0x14d544['push']({'model':db[_0x3edb('0xc4')],'as':_0x3edb('0xc4'),'raw':!![]});var _0xf07994=[{'model':db[_0x3edb('0xb1')],'as':_0x3edb('0xc5'),'attributes':['id',_0x3edb('0x6c'),_0x3edb('0x73')],'include':_0x14d544}];return db[_0x3edb('0x33')][_0x3edb('0x6a')]({'where':{'id':_0x5aca1f[_0x3edb('0xaf')]['id']},'include':_0xf07994})['then'](handleEntityNotFound(_0x2ad2be,null))[_0x3edb('0x24')](function(_0x4741f2){if(_0x4741f2&&_0x4741f2[_0x3edb('0xc5')]){var _0xe99acf=_0x4741f2[_0x3edb('0xc6')]({'plain':!![]});fs['mkdirSync'](_0x4a059c);for(var _0x326711=0x0;_0x326711<_0xe99acf[_0x3edb('0xc5')][_0x3edb('0x3d')];_0x326711++){var _0x33a6ef=_0xe99acf[_0x3edb('0xc5')][_0x326711][_0x3edb('0xc4')];if(_0x33a6ef){var _0x13b8a5=path[_0x3edb('0xc2')](_0x30f673,_0x33a6ef['basename']);if(fs['existsSync'](_0x13b8a5)){fs[_0x3edb('0xc7')](_0x13b8a5)['pipe'](fs['createWriteStream'](path[_0x3edb('0xc2')](_0x4a059c,_0x33a6ef[_0x3edb('0xc8')])));}}}return BPromise[_0x3edb('0x88')]()[_0x3edb('0x24')](function(){return new BPromise(function(_0x5b2b2b,_0x11dd17){zipdir(_0x4a059c,{'saveTo':_0x3e3b1e},function(_0x22ec59,_0x479294){if(_0x22ec59)return _0x11dd17(_0x22ec59);return _0x5b2b2b(_0x479294);});})[_0x3edb('0x24')](function(){return new BPromise(function(_0x50b232,_0x581f1f){rimraf(_0x4a059c,function(_0x4dfb08){if(_0x4dfb08)_0x581f1f(_0x4dfb08);return _0x50b232();});});})[_0x3edb('0x24')](function(){return _0x2ad2be[_0x3edb('0xbe')](_0x3e3b1e,_0x374e9e,function(_0x3d92de){if(_0x3d92de){console[_0x3edb('0xc9')](_0x3edb('0xca'),_0x3d92de);}else{fs['unlinkSync'](_0x3e3b1e);}});});});}else{return _0x2ad2be[_0x3edb('0x26')](0xc8);}})[_0x3edb('0x30')](handleError(_0x2ad2be,null));};
\ No newline at end of file
+var _0x38bc=['util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','status','end','json','undefined','offset','count','Content-Range','apply','reject','update','then','destroy','stack','name','send','Users','fullname','TagIds','Tags','split','forEach','push','index','FaxInteraction','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','select','field','u.fullname','ui.FaxInteractionId','from','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','fax_interactions','cm_contacts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','tools_tags','expr','search','parseSearch','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','SELECT','clone','i.id','DESC','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','Contact.email','Contact.phone','c.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','FaxInteractionId','all','catch','show','params','include','describe','addMessage','FaxMessage','ids','findOne','nolimit','filter','merge','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','rows','addTags','omit','spread','color','emit','removeTags','download','unix','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','existsSync','createReadStream','pipe','createWriteStream','resolve','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0xf7e131,_0xc9598b){var _0x458a97=function(_0x45f643){while(--_0x45f643){_0xf7e131['push'](_0xf7e131['shift']());}};_0x458a97(++_0xc9598b);}(_0x38bc,0xcc));var _0xc38b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x38bc[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xc38b('0x0'));var rimraf=require(_0xc38b('0x1'));var zipdir=require(_0xc38b('0x2'));var jsonpatch=require(_0xc38b('0x3'));var rp=require(_0xc38b('0x4'));var moment=require(_0xc38b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc38b('0x6'));var util=require(_0xc38b('0x7'));var path=require(_0xc38b('0x8'));var sox=require(_0xc38b('0x9'));var csv=require(_0xc38b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc38b('0xb'));var _=require(_0xc38b('0xc'));var squel=require(_0xc38b('0xd'));var crypto=require(_0xc38b('0xe'));var jsforce=require(_0xc38b('0xf'));var deskjs=require(_0xc38b('0x10'));var toCsv=require(_0xc38b('0xa'));var querystring=require('querystring');var Papa=require(_0xc38b('0x11'));var Redis=require('ioredis');var authService=require(_0xc38b('0x12'));var qs=require(_0xc38b('0x13'));var as=require(_0xc38b('0x14'));var hardwareService=require(_0xc38b('0x15'));var logger=require(_0xc38b('0x16'))(_0xc38b('0x17'));var utils=require(_0xc38b('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc38b('0x19'))['db'];config[_0xc38b('0x1a')]=_[_0xc38b('0x1b')](config[_0xc38b('0x1a')],{'host':_0xc38b('0x1c'),'port':0x18eb});var socket=require(_0xc38b('0x1d'))(new Redis(config[_0xc38b('0x1a')]));require(_0xc38b('0x1e'))[_0xc38b('0x1f')](socket);function respondWithStatusCode(_0x1342d4,_0x4a057c){_0x4a057c=_0x4a057c||0xcc;return function(_0x45b228){if(_0x45b228){return _0x1342d4['sendStatus'](_0x4a057c);}return _0x1342d4[_0xc38b('0x20')](_0x4a057c)[_0xc38b('0x21')]();};}function respondWithResult(_0x2fe3d1,_0x366bd6){_0x366bd6=_0x366bd6||0xc8;return function(_0x4b870a){if(_0x4b870a){return _0x2fe3d1[_0xc38b('0x20')](_0x366bd6)[_0xc38b('0x22')](_0x4b870a);}};}function respondWithFilteredResult(_0x553abd,_0x1f1873){return function(_0x278841){if(_0x278841){var _0x3393ba=typeof _0x1f1873['offset']===_0xc38b('0x23')&&typeof _0x1f1873['limit']==='undefined';var _0x39901f=_0x278841['count'];var _0x3775ae=_0x3393ba?0x0:_0x1f1873[_0xc38b('0x24')];var _0x1ca2b2=_0x3393ba?_0x278841[_0xc38b('0x25')]:_0x1f1873[_0xc38b('0x24')]+_0x1f1873['limit'];var _0xe5f870;if(_0x1ca2b2>=_0x39901f){_0x1ca2b2=_0x39901f;_0xe5f870=0xc8;}else{_0xe5f870=0xce;}_0x553abd[_0xc38b('0x20')](_0xe5f870);return _0x553abd['set'](_0xc38b('0x26'),_0x3775ae+'-'+_0x1ca2b2+'/'+_0x39901f)['json'](_0x278841);}return null;};}function patchUpdates(_0x4107b3){return function(_0x175aa6){try{jsonpatch[_0xc38b('0x27')](_0x175aa6,_0x4107b3,!![]);}catch(_0x648a30){return BPromise[_0xc38b('0x28')](_0x648a30);}return _0x175aa6['save']();};}function saveUpdates(_0x56968e,_0x43edd9){return function(_0x49bb60){if(_0x49bb60){return _0x49bb60[_0xc38b('0x29')](_0x56968e)[_0xc38b('0x2a')](function(_0x21ff91){return _0x21ff91;});}return null;};}function removeEntity(_0x3f3a6,_0x896039){return function(_0x50c9eb){if(_0x50c9eb){return _0x50c9eb[_0xc38b('0x2b')]()[_0xc38b('0x2a')](function(){_0x3f3a6[_0xc38b('0x20')](0xcc)[_0xc38b('0x21')]();});}};}function handleEntityNotFound(_0x17cc6e,_0xbd48f8){return function(_0x285b3f){if(!_0x285b3f){_0x17cc6e['sendStatus'](0x194);}return _0x285b3f;};}function handleError(_0x125a8e,_0x54a22f){_0x54a22f=_0x54a22f||0x1f4;return function(_0x107ad1){logger['error'](_0x107ad1[_0xc38b('0x2c')]);if(_0x107ad1[_0xc38b('0x2d')]){delete _0x107ad1[_0xc38b('0x2d')];}_0x125a8e[_0xc38b('0x20')](_0x54a22f)[_0xc38b('0x2e')](_0x107ad1);};}function getInteractionUsers(_0x506da6,_0x366ff7){return new BPromise(function(_0x3bb548,_0x2fcf76){try{if(_0x366ff7[_0x506da6['id']]){_0x506da6[_0xc38b('0x2f')]=_['map'](_0x366ff7[_0x506da6['id']],function(_0x487dbf){return{'id':_0x487dbf['id'],'fullname':_0x487dbf[_0xc38b('0x30')]};});}}catch(_0x366d3a){_0x2fcf76(_0x366d3a);}_0x3bb548(_0x506da6);});}function getInteractionTags(_0x4cef5f,_0x4bb1d3){return new BPromise(function(_0x7301a6,_0x3f28f3){try{if(_0x4cef5f[_0xc38b('0x31')]){_0x4cef5f[_0xc38b('0x32')]=[];_0x4cef5f['TagIds'][_0xc38b('0x33')](',')[_0xc38b('0x34')](function(_0x1e1011){_0x4cef5f['Tags'][_0xc38b('0x35')](_0x4bb1d3[_0x1e1011]);});}delete _0x4cef5f[_0xc38b('0x31')];}catch(_0x296e92){_0x3f28f3(_0x296e92);}_0x7301a6(_0x4cef5f);});}function updateFaxInteraction(_0x361645,_0x55d13d,_0x24b258){return new BPromise(function(_0x5a86fe,_0x35d252){return getInteractionUsers(_0x361645,_0x24b258)['then'](function(_0x109881){return getInteractionTags(_0x109881,_0x55d13d);})[_0xc38b('0x2a')](function(_0x5492e8){_0x5a86fe(_0x5492e8);})['catch'](function(_0x5897ce){_0x35d252(_0x5897ce);});});}exports[_0xc38b('0x36')]=function(_0x46f2f0,_0x5f0b39){var _0x4fba23={},_0x563b91={},_0x29a20b={'count':0x0,'rows':[]};var _0x1ddfe5=_['map'](db[_0xc38b('0x37')][_0xc38b('0x38')],function(_0x1c02bb){return{'name':_0x1c02bb['fieldName'],'type':_0x1c02bb[_0xc38b('0x39')][_0xc38b('0x3a')]};});_0x563b91[_0xc38b('0x3b')]=_[_0xc38b('0x3c')](_0x1ddfe5,_0xc38b('0x2d'));_0x563b91[_0xc38b('0x3d')]=_[_0xc38b('0x3e')](_0x46f2f0[_0xc38b('0x3d')]);_0x563b91[_0xc38b('0x3f')]=_[_0xc38b('0x40')](_0x563b91[_0xc38b('0x3b')],_0x563b91[_0xc38b('0x3d')]);_0x4fba23[_0xc38b('0x41')]=_[_0xc38b('0x40')](_0x563b91['model'],qs[_0xc38b('0x42')](_0x46f2f0[_0xc38b('0x3d')]['fields']));_0x4fba23[_0xc38b('0x41')]=_0x4fba23['attributes'][_0xc38b('0x43')]?_0x4fba23[_0xc38b('0x41')]:_0x563b91[_0xc38b('0x3b')];if(!_0x46f2f0[_0xc38b('0x3d')][_0xc38b('0x44')]('nolimit')){_0x4fba23[_0xc38b('0x45')]=qs[_0xc38b('0x45')](_0x46f2f0['query'][_0xc38b('0x45')]);_0x4fba23[_0xc38b('0x24')]=qs[_0xc38b('0x24')](_0x46f2f0[_0xc38b('0x3d')][_0xc38b('0x24')]);}_0x4fba23[_0xc38b('0x46')]=qs[_0xc38b('0x47')](_0x46f2f0[_0xc38b('0x3d')]['sort']);_0x4fba23[_0xc38b('0x48')]=qs[_0xc38b('0x3f')](_[_0xc38b('0x49')](_0x46f2f0[_0xc38b('0x3d')],_0x563b91[_0xc38b('0x3f')]),_0x1ddfe5);var _0x119237=[];var _0x13e1a9=squel[_0xc38b('0x4a')]()[_0xc38b('0x4b')]('id')['field'](_0xc38b('0x2d'))['field']('color')['from']('tools_tags');var _0x341a67=squel['select']()[_0xc38b('0x4b')]('u.id')[_0xc38b('0x4b')](_0xc38b('0x4c'))[_0xc38b('0x4b')](_0xc38b('0x4d'))[_0xc38b('0x4e')](_0xc38b('0x4f'),'ui')[_0xc38b('0x50')](_0xc38b('0x51'),'u',_0xc38b('0x52'));var _0x4bbb1e=squel['select']()[_0xc38b('0x4e')](_0xc38b('0x53'),'i')[_0xc38b('0x50')](_0xc38b('0x54'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xc38b('0x51'),'o','o.id\x20=\x20i.UserId')['left_join']('fax_accounts','a',_0xc38b('0x55'))['left_join'](_0xc38b('0x56'),'me',_0xc38b('0x57'))['left_join'](_0xc38b('0x58'),'it',_0xc38b('0x59'))['left_join'](_0xc38b('0x5a'),'t','t.id\x20=\x20it.TagId');var _0x4b0a8c=squel[_0xc38b('0x5b')]();var _0x2a354f=[];var _0x5dd4b4=squel[_0xc38b('0x5b')]();var _0x45f695;if(_0x46f2f0[_0xc38b('0x3d')][_0xc38b('0x5c')]){_0x45f695=as[_0xc38b('0x5d')](_0x46f2f0[_0xc38b('0x3d')][_0xc38b('0x5c')]);var _0x58f8a8=_0x45f695['sqlOperator'];for(var _0x2f6b9d=0x0;_0x2f6b9d<_0x45f695[_0xc38b('0x5e')][_0xc38b('0x43')];_0x2f6b9d++){var _0x5405af=_0x45f695['conditions'][_0x2f6b9d];var _0x7514fb='i';var _0x1c1a83=_[_0xc38b('0x5f')](_0x1ddfe5,[_0xc38b('0x2d'),_0x5405af[_0xc38b('0x4b')]]);if(!_0x1c1a83){switch(_0x5405af[_0xc38b('0x4b')]){case'unreadMessages':if(_0x5405af[_0xc38b('0x60')]==0x1){_0x4bbb1e[_0xc38b('0x61')]('`'+_0x5405af[_0xc38b('0x4b')]+_0xc38b('0x62'));}else{_0x4bbb1e[_0xc38b('0x61')]('`'+_0x5405af[_0xc38b('0x4b')]+_0xc38b('0x63'));}break;case _0xc38b('0x64'):if(_0x5405af[_0xc38b('0x65')]===_0xc38b('0x66')){if(_0x5405af['value'][_0xc38b('0x33')]('\x20')[_0xc38b('0x43')]>0x1){_0x4b0a8c[_0x58f8a8](_0xc38b('0x67'),qs['getFullTextValue'](_0x5405af[_0xc38b('0x60')]),null);}else{var _0x264de4='%'+_0x5405af['value']+'%';_0x4b0a8c[_0x58f8a8](_0xc38b('0x68'),_0x264de4,_0x264de4,_0x264de4);}}else{_0x1c1a83=_[_0xc38b('0x5f')](_0x1ddfe5,['name',_0xc38b('0x69')]);_0x5405af[_0xc38b('0x4b')]=_0xc38b('0x69');_0x15aba3=as[_0xc38b('0x6a')](_0x7514fb,_0x1c1a83['type'],_0x5405af);_0x4b0a8c[_0x58f8a8](_0x15aba3[_0xc38b('0x6b')],_0x15aba3[_0xc38b('0x60')][_0xc38b('0x6c')],_0x15aba3[_0xc38b('0x60')][_0xc38b('0x21')]);}break;case _0xc38b('0x6d'):var _0x2a7952=_0x5405af[_0xc38b('0x60')]['split'](',')[_0xc38b('0x3c')](function(_0x30d6ae){return Number(_0x30d6ae);});_0x2a7952['forEach'](function(_0x26c4e4){_0x5dd4b4['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x26c4e4+',%');});_0x2a354f=_['union'](_0x2a354f,_0x2a7952);break;case _0xc38b('0x6e'):if(_0x5405af[_0xc38b('0x65')]===_0xc38b('0x66')){_0x4b0a8c[_0x58f8a8](_0xc38b('0x6f'),'%'+_0x5405af[_0xc38b('0x60')]+'%',null);}else{_0x1c1a83=_[_0xc38b('0x5f')](_0x1ddfe5,[_0xc38b('0x2d'),'UserId']);_0x5405af['field']='UserId';_0x15aba3=as[_0xc38b('0x6a')](_0x7514fb,_0x1c1a83[_0xc38b('0x39')],_0x5405af);_0x4b0a8c[_0x58f8a8](_0x15aba3[_0xc38b('0x6b')],_0x15aba3[_0xc38b('0x60')][_0xc38b('0x6c')],_0x15aba3['value'][_0xc38b('0x21')]);}break;case _0xc38b('0x70'):_0x15aba3=as['buildExpression']('me',null,_0x5405af);_0x4b0a8c[_0x58f8a8](_0x15aba3[_0xc38b('0x6b')],_0x15aba3[_0xc38b('0x60')]['start'],_0x15aba3['value']['end']);break;}}else{var _0x15aba3=as[_0xc38b('0x6a')](_0x7514fb,_0x1c1a83[_0xc38b('0x39')],_0x5405af);_0x4b0a8c[_0x58f8a8](_0x15aba3[_0xc38b('0x6b')],_0x15aba3[_0xc38b('0x60')][_0xc38b('0x6c')],_0x15aba3['value'][_0xc38b('0x21')]);}}}else{var _0x2a9fd1=_(_0x46f2f0[_0xc38b('0x3d')])[_0xc38b('0x3e')]()[_0xc38b('0x3c')](function(_0x2422c5){return _[_0xc38b('0x71')](_0x1ddfe5,[_0xc38b('0x2d'),_0x2422c5])?_0x2422c5:undefined;})[_0xc38b('0x72')]()[_0xc38b('0x60')]();if(!_[_0xc38b('0x73')](_0x2a9fd1)){_0x2a9fd1[_0xc38b('0x34')](function(_0x223ce4){if(_0x223ce4===_0xc38b('0x74')){_0x4bbb1e[_0xc38b('0x48')](_0xc38b('0x75'),[][_0xc38b('0x76')](_0x46f2f0['query'][_0x223ce4]));}else if(_0x223ce4===_0xc38b('0x77')){var _0x303fcb=JSON['parse'](_0x46f2f0[_0xc38b('0x3d')][_0x223ce4])['$gte'];var _0xe092bd=JSON[_0xc38b('0x78')](_0x46f2f0[_0xc38b('0x3d')][_0x223ce4])[_0xc38b('0x79')];_0x4bbb1e[_0xc38b('0x48')](_0xc38b('0x7a'),_0x303fcb,_0xe092bd);}else{if(_0x46f2f0['query'][_0x223ce4]==='null'){_0x4bbb1e['where']('i.'+_0x223ce4+'\x20IS\x20NULL');}else{_0x4bbb1e[_0xc38b('0x48')]('i.'+_0x223ce4+_0xc38b('0x7b'),_0x46f2f0[_0xc38b('0x3d')][_0x223ce4]);}}});}if(_0x46f2f0['query'][_0xc38b('0x7c')]){if(_0x46f2f0[_0xc38b('0x3d')][_0xc38b('0x7c')]==0x1){_0x4bbb1e[_0xc38b('0x61')](_0xc38b('0x7d'));}else{_0x4bbb1e['having'](_0xc38b('0x7e'));}}if(_0x46f2f0[_0xc38b('0x3d')][_0xc38b('0x7f')]){_0x2a354f=_[_0xc38b('0x80')](_0x46f2f0['query']['tag'])?_0x46f2f0['query']['tag']:new Array(_0x46f2f0['query'][_0xc38b('0x7f')]);_0x2a354f[_0xc38b('0x34')](function(_0x3eba58){_0x5dd4b4['or'](_0xc38b('0x81'),'%,'+_0x3eba58+',%');});}if(_0x46f2f0['query']['filter']){var _0x5e43d9=_0x46f2f0[_0xc38b('0x3d')]['filter'][_0xc38b('0x82')]('\x5c','\x5c\x5c')[_0xc38b('0x82')](/'/g,'\x27\x27');if(qs[_0xc38b('0x83')](_0x5e43d9)){_0x4b0a8c['or'](_0xc38b('0x84'),_0x5e43d9+'%')['or'](_0xc38b('0x85'),_0x5e43d9+'%');}_0x4b0a8c['or'](_0xc38b('0x86'),_0x5e43d9+'%');}}_0x4bbb1e[_0xc38b('0x48')](_0x4b0a8c);_0x4bbb1e[_0xc38b('0x87')]('i.id');var _0x2584e4={'type':db['Sequelize'][_0xc38b('0x88')][_0xc38b('0x89')],'raw':!![]};var _0xc3a8cd=_0x4bbb1e[_0xc38b('0x8a')]();_0xc3a8cd[_0xc38b('0x4b')](_0xc38b('0x8b'));_0xc3a8cd[_0xc38b('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x4fba23[_0xc38b('0x46')]){_0x4fba23[_0xc38b('0x46')][_0xc38b('0x34')](function(_0x333b93){var _0x41abea=_0x333b93[0x0]==='contactName'?_0x333b93[0x0]:'i.'+_0x333b93[0x0];_0x4bbb1e['order'](_0x41abea,_0x333b93[0x1]===_0xc38b('0x8c')?![]:!![]);});}if(!_[_0xc38b('0x73')](_0x2a354f)){_0x4bbb1e[_0xc38b('0x61')](_0x5dd4b4);_0xc3a8cd['where'](_0xc38b('0x8d'),_0x2a354f);}BPromise['resolve']()[_0xc38b('0x2a')](function(){if(!_0x45f695){if(_0x46f2f0['query']['FaxAccountId'])return;_0xc3a8cd[_0xc38b('0x48')](_0xc38b('0x8e'));_0x4bbb1e['where'](_0xc38b('0x8e'));return;}if(_0x46f2f0[_0xc38b('0x8f')][_0xc38b('0x90')]!=='agent')return;return _0x46f2f0['user'][_0xc38b('0x91')]({'attributes':['id'],'raw':!![]})[_0xc38b('0x2a')](function(_0x162b68){if(_[_0xc38b('0x73')](_0x162b68)){_0xc3a8cd[_0xc38b('0x48')](_0xc38b('0x92'));_0x4bbb1e[_0xc38b('0x48')](_0xc38b('0x92'));}else{_0xc3a8cd[_0xc38b('0x48')]('i.FaxAccountId\x20IN\x20?',_[_0xc38b('0x3c')](_0x162b68,'id'));_0x4bbb1e[_0xc38b('0x48')]('i.FaxAccountId\x20IN\x20?',_[_0xc38b('0x3c')](_0x162b68,'id'));}});})[_0xc38b('0x2a')](function(){if(_0x46f2f0[_0xc38b('0x8f')][_0xc38b('0x90')]===_0xc38b('0x93')&&!_0x45f695&&!_0x46f2f0[_0xc38b('0x3d')]['FaxAccountId'])return[];return db[_0xc38b('0x94')][_0xc38b('0x3d')](_0xc3a8cd[_0xc38b('0x95')](),_0x2584e4);})[_0xc38b('0x2a')](function(_0x382707){_0x29a20b[_0xc38b('0x25')]=_0x382707[_0xc38b('0x43')];if(_0x29a20b[_0xc38b('0x25')]===0x0)return[];return db[_0xc38b('0x94')][_0xc38b('0x3d')](_0x13e1a9[_0xc38b('0x95')](),_0x2584e4)[_0xc38b('0x2a')](function(_0x29979c){_0x119237=_[_0xc38b('0x96')](_0x29979c,'id');_0x2584e4=_['merge'](_0x2584e4,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x46f2f0[_0xc38b('0x3d')][_0xc38b('0x42')]){_0x4fba23['attributes'][_0xc38b('0x34')](function(_0x28fe36){_0x4bbb1e[_0xc38b('0x4b')]('i.'+_0x28fe36);});}else{_0x4bbb1e[_0xc38b('0x4b')](_0xc38b('0x97'),'unreadMessages');_0x4bbb1e['field'](_0xc38b('0x98'),_0xc38b('0x99'));_0x4bbb1e[_0xc38b('0x4b')](_0xc38b('0x9a'),_0xc38b('0x9b'));_0x4bbb1e['field']('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x4bbb1e['field'](_0xc38b('0x9c'));_0x4bbb1e[_0xc38b('0x4b')]('c.firstName',_0xc38b('0x9d'));_0x4bbb1e[_0xc38b('0x4b')]('c.lastName','Contact.lastName');_0x4bbb1e[_0xc38b('0x4b')]('c.email',_0xc38b('0x9e'));_0x4bbb1e[_0xc38b('0x4b')]('c.phone',_0xc38b('0x9f'));_0x4bbb1e[_0xc38b('0x4b')]('c.mobile','Contact.mobile');_0x4bbb1e[_0xc38b('0x4b')](_0xc38b('0xa0'),'Contact.fax');_0x4bbb1e[_0xc38b('0x4b')](_0xc38b('0xa1'),_0xc38b('0xa2'));_0x4bbb1e[_0xc38b('0x4b')]('o.internal','Owner.internal');_0x4bbb1e[_0xc38b('0x4b')](_0xc38b('0xa3'),'TagIds');}if(_0x4fba23['limit'])_0x4bbb1e[_0xc38b('0x45')](_0x4fba23[_0xc38b('0x45')]);if(_0x4fba23[_0xc38b('0x24')])_0x4bbb1e[_0xc38b('0x24')](_0x4fba23[_0xc38b('0x24')]);return db[_0xc38b('0x94')][_0xc38b('0x3d')](_0x4bbb1e[_0xc38b('0x95')](),_0x2584e4);})[_0xc38b('0x2a')](function(_0x4f6d4f){if(_0x4f6d4f[_0xc38b('0x43')]>0x0)_0x341a67[_0xc38b('0x48')]('ui.FaxInteractionId\x20IN\x20?',_['map'](_0x4f6d4f,'id'));return db[_0xc38b('0x94')][_0xc38b('0x3d')](_0x341a67[_0xc38b('0x95')](),_0x2584e4)[_0xc38b('0x2a')](function(_0x369621){var _0x27cda7=_['groupBy'](_0x369621,_0xc38b('0xa4'));var _0x3f3f49=[];_0x4f6d4f[_0xc38b('0x34')](function(_0x3333bd){_0x3f3f49[_0xc38b('0x35')](updateFaxInteraction(_0x3333bd,_0x119237,_0x27cda7));});return BPromise[_0xc38b('0xa5')](_0x3f3f49);});});})[_0xc38b('0x2a')](function(_0xe3b476){_0x29a20b['rows']=_0xe3b476;return _0x29a20b;})['then'](respondWithFilteredResult(_0x5f0b39,_0x4fba23))[_0xc38b('0xa6')](handleError(_0x5f0b39,null));};exports[_0xc38b('0xa7')]=function(_0x4d5ba0,_0x9551cc){var _0x2ef920={'raw':![],'where':{'id':_0x4d5ba0[_0xc38b('0xa8')]['id']}},_0x4947d2={};_0x4947d2[_0xc38b('0x3b')]=_[_0xc38b('0x3e')](db[_0xc38b('0x37')][_0xc38b('0x38')]);_0x4947d2[_0xc38b('0x3d')]=_[_0xc38b('0x3e')](_0x4d5ba0[_0xc38b('0x3d')]);_0x4947d2[_0xc38b('0x3f')]=_[_0xc38b('0x40')](_0x4947d2[_0xc38b('0x3b')],_0x4947d2[_0xc38b('0x3d')]);_0x2ef920['attributes']=_[_0xc38b('0x40')](_0x4947d2[_0xc38b('0x3b')],qs['fields'](_0x4d5ba0[_0xc38b('0x3d')][_0xc38b('0x42')]));_0x2ef920[_0xc38b('0x41')]=_0x2ef920[_0xc38b('0x41')][_0xc38b('0x43')]?_0x2ef920[_0xc38b('0x41')]:_0x4947d2[_0xc38b('0x3b')];if(_0x4d5ba0[_0xc38b('0x3d')]['includeAll']){_0x2ef920[_0xc38b('0xa9')]=[{'all':!![]}];}_0x2ef920=_['merge']({},_0x2ef920,_0x4d5ba0['options']);return db[_0xc38b('0x37')][_0xc38b('0x5f')](_0x2ef920)['then'](handleEntityNotFound(_0x9551cc,null))['then'](respondWithResult(_0x9551cc,null))[_0xc38b('0xa6')](handleError(_0x9551cc,null));};exports['create']=function(_0x180529,_0x50cf22){return db['FaxInteraction']['create'](_0x180529[_0xc38b('0x70')],{})[_0xc38b('0x2a')](respondWithResult(_0x50cf22,0xc9))[_0xc38b('0xa6')](handleError(_0x50cf22,null));};exports[_0xc38b('0x29')]=function(_0x2cf53b,_0xf20c55){if(_0x2cf53b[_0xc38b('0x70')]['id']){delete _0x2cf53b['body']['id'];}return db[_0xc38b('0x37')]['find']({'where':{'id':_0x2cf53b[_0xc38b('0xa8')]['id']}})[_0xc38b('0x2a')](handleEntityNotFound(_0xf20c55,null))['then'](saveUpdates(_0x2cf53b['body'],null))[_0xc38b('0x2a')](respondWithResult(_0xf20c55,null))[_0xc38b('0xa6')](handleError(_0xf20c55,null));};exports[_0xc38b('0x2b')]=function(_0x316b93,_0x56cc0e){return db['FaxInteraction'][_0xc38b('0x5f')]({'where':{'id':_0x316b93[_0xc38b('0xa8')]['id']}})[_0xc38b('0x2a')](handleEntityNotFound(_0x56cc0e,null))[_0xc38b('0x2a')](removeEntity(_0x56cc0e,null))[_0xc38b('0xa6')](handleError(_0x56cc0e,null));};exports[_0xc38b('0xaa')]=function(_0x423b7a,_0x142aa7){return db[_0xc38b('0x37')][_0xc38b('0xaa')]()[_0xc38b('0x2a')](respondWithResult(_0x142aa7,null))[_0xc38b('0xa6')](handleError(_0x142aa7,null));};exports[_0xc38b('0xab')]=function(_0x5c9fe7,_0x59158a,_0x240558){return db[_0xc38b('0xac')][_0xc38b('0x5f')]({'where':{'id':_0x5c9fe7[_0xc38b('0xa8')]['id']}})['then'](handleEntityNotFound(_0x59158a,null))[_0xc38b('0x2a')](function(_0x449f0f){if(_0x449f0f){return _0x449f0f[_0xc38b('0xab')](_0x5c9fe7['body'][_0xc38b('0xad')],_['omit'](_0x5c9fe7['body'],[_0xc38b('0xad'),'id'])||{});}})['then'](respondWithResult(_0x59158a,null))[_0xc38b('0xa6')](handleError(_0x59158a,null));};exports['getMessages']=function(_0x447074,_0x259405,_0x311ae2){var _0x51c00={'raw':![],'where':{}};var _0x27ddcd={};var _0x3f9b82={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xc38b('0xae')]({'where':{'id':_0x447074[_0xc38b('0xa8')]['id']}})['then'](handleEntityNotFound(_0x259405,null))[_0xc38b('0x2a')](function(_0x49d52a){if(_0x49d52a){_0x27ddcd[_0xc38b('0x3b')]=_[_0xc38b('0x3e')](db[_0xc38b('0xac')][_0xc38b('0x38')]);_0x27ddcd[_0xc38b('0x3d')]=_[_0xc38b('0x3e')](_0x447074['query']);_0x27ddcd['filters']=_[_0xc38b('0x40')](_0x27ddcd[_0xc38b('0x3b')],_0x27ddcd[_0xc38b('0x3d')]);_0x51c00[_0xc38b('0x41')]=_[_0xc38b('0x40')](_0x27ddcd[_0xc38b('0x3b')],qs[_0xc38b('0x42')](_0x447074[_0xc38b('0x3d')][_0xc38b('0x42')]));_0x51c00['attributes']=_0x51c00['attributes'][_0xc38b('0x43')]?_0x51c00['attributes']:_0x27ddcd[_0xc38b('0x3b')];if(!_0x447074[_0xc38b('0x3d')]['hasOwnProperty'](_0xc38b('0xaf'))){_0x51c00[_0xc38b('0x45')]=qs[_0xc38b('0x45')](_0x447074[_0xc38b('0x3d')][_0xc38b('0x45')]);_0x51c00[_0xc38b('0x24')]=qs[_0xc38b('0x24')](_0x447074[_0xc38b('0x3d')][_0xc38b('0x24')]);}_0x51c00[_0xc38b('0x46')]=qs['sort'](_0x447074['query'][_0xc38b('0x47')]);_0x51c00[_0xc38b('0x48')]=qs['filters'](_[_0xc38b('0x49')](_0x447074[_0xc38b('0x3d')],_0x27ddcd[_0xc38b('0x3f')]));_0x51c00[_0xc38b('0x48')][_0xc38b('0xa4')]=_0x49d52a['id'];if(_0x447074['query'][_0xc38b('0xb0')]){_0x51c00[_0xc38b('0x48')]=_[_0xc38b('0xb1')](_0x51c00[_0xc38b('0x48')],{'$or':_['map'](_0x51c00['attributes'],function(_0x21dfcc){var _0x1fd512={};_0x1fd512[_0x21dfcc]={'$like':'%'+_0x447074[_0xc38b('0x3d')][_0xc38b('0xb0')]+'%'};return _0x1fd512;})});}if(_0x447074[_0xc38b('0x3d')][_0xc38b('0xb2')]){var _0x41d20a=_0x447074[_0xc38b('0x3d')]['$gte'][_0xc38b('0x33')](',');var _0x5c9b21={};_0x5c9b21[_0x41d20a[0x0]]={'$gte':moment(_0x41d20a[0x1])[_0xc38b('0xb3')](_0xc38b('0xb4'))};_0x51c00[_0xc38b('0x48')]=_[_0xc38b('0xb1')](_0x51c00[_0xc38b('0x48')],_0x5c9b21);}_0x51c00=_['merge']({},_0x51c00,_0x447074['options']);return db[_0xc38b('0xac')][_0xc38b('0x25')]({'where':_0x51c00[_0xc38b('0x48')]})['then'](function(_0x3b8844){_0x3f9b82[_0xc38b('0x25')]=_0x3b8844;if(_0x447074[_0xc38b('0x3d')][_0xc38b('0xb5')]){_0x51c00[_0xc38b('0xa9')]=[{'all':!![]}];}return db[_0xc38b('0xac')][_0xc38b('0xb6')](_0x51c00);})[_0xc38b('0x2a')](function(_0x12e024){_0x3f9b82[_0xc38b('0xb7')]=_0x12e024;return _0x3f9b82;});}})[_0xc38b('0x2a')](respondWithFilteredResult(_0x259405,_0x51c00))['catch'](handleError(_0x259405,null));};exports[_0xc38b('0xb8')]=function(_0x1f7cd9,_0x5a393c,_0x3466f5){return db['FaxInteraction'][_0xc38b('0x5f')]({'where':{'id':_0x1f7cd9[_0xc38b('0xa8')]['id']}})[_0xc38b('0x2a')](handleEntityNotFound(_0x5a393c,null))['then'](function(_0x3eaeb3){if(_0x3eaeb3){return _0x3eaeb3['setTags'](_0x1f7cd9[_0xc38b('0x70')][_0xc38b('0xad')],_[_0xc38b('0xb9')](_0x1f7cd9[_0xc38b('0x70')],[_0xc38b('0xad'),'id'])||{})[_0xc38b('0xba')](function(){return db[_0xc38b('0x6d')]['findAll']({'attributes':['id','name',_0xc38b('0xbb')],'where':{'id':_0x1f7cd9[_0xc38b('0x70')][_0xc38b('0xad')]}});})[_0xc38b('0x2a')](function(_0x97cb5b){socket[_0xc38b('0xbc')]('faxInteractionTags:save',{'id':Number(_0x1f7cd9['params']['id']),'tags':_0x97cb5b||[]});return{'id':Number(_0x1f7cd9['params']['id']),'tags':_0x97cb5b||[]};});}})[_0xc38b('0x2a')](respondWithResult(_0x5a393c,null))[_0xc38b('0xa6')](handleError(_0x5a393c,null));};exports['removeTags']=function(_0x538251,_0xa88d06,_0xf89eb4){return db[_0xc38b('0x37')][_0xc38b('0x5f')]({'where':{'id':_0x538251['params']['id']}})[_0xc38b('0x2a')](handleEntityNotFound(_0xa88d06,null))['then'](function(_0x49db27){if(_0x49db27){return _0x49db27[_0xc38b('0xbd')](_0x538251['query'][_0xc38b('0xad')]);}})[_0xc38b('0x2a')](respondWithStatusCode(_0xa88d06,null))[_0xc38b('0xa6')](handleError(_0xa88d06,null));};exports[_0xc38b('0xbe')]=function(_0x31a781,_0x4f849f){var _0x3172fb=moment()[_0xc38b('0xbf')]()['toString']();var _0x2dc8df=path[_0xc38b('0xc0')](config['root'],_0xc38b('0xc1'),_0xc38b('0xc2'),_0xc38b('0xc3'));var _0x519859=path['join'](config[_0xc38b('0xc4')],'server',_0xc38b('0xc2'),_0xc38b('0xc5'));var _0x16b026=path['join'](_0x2dc8df,_0x3172fb);var _0x95b036=util['format'](_0xc38b('0xc6'),_0x31a781[_0xc38b('0xa8')]['id'],_0x3172fb);var _0x16aa23=path[_0xc38b('0xc0')](_0x2dc8df,_0x95b036);var _0x125ffb=[];_0x125ffb[_0xc38b('0x35')]({'model':db[_0xc38b('0xc7')],'as':_0xc38b('0xc7'),'raw':!![]});var _0x3c6664=[{'model':db[_0xc38b('0xac')],'as':'Messages','attributes':['id',_0xc38b('0x70'),_0xc38b('0x77')],'include':_0x125ffb}];return db[_0xc38b('0x37')]['find']({'where':{'id':_0x31a781[_0xc38b('0xa8')]['id']},'include':_0x3c6664})[_0xc38b('0x2a')](handleEntityNotFound(_0x4f849f,null))[_0xc38b('0x2a')](function(_0x324d1c){if(_0x324d1c&&_0x324d1c[_0xc38b('0xc8')]){var _0x410e9e=_0x324d1c[_0xc38b('0xc9')]({'plain':!![]});fs[_0xc38b('0xca')](_0x16b026);for(var _0x1dac38=0x0;_0x1dac38<_0x410e9e[_0xc38b('0xc8')]['length'];_0x1dac38++){var _0x3d2d15=_0x410e9e[_0xc38b('0xc8')][_0x1dac38][_0xc38b('0xc7')];if(_0x3d2d15){var _0x2e51b6=path['join'](_0x519859,_0x3d2d15['basename']);if(fs[_0xc38b('0xcb')](_0x2e51b6)){fs[_0xc38b('0xcc')](_0x2e51b6)[_0xc38b('0xcd')](fs[_0xc38b('0xce')](path[_0xc38b('0xc0')](_0x16b026,_0x3d2d15['basename'])));}}}return BPromise[_0xc38b('0xcf')]()['then'](function(){return new BPromise(function(_0xf82af2,_0x591109){zipdir(_0x16b026,{'saveTo':_0x16aa23},function(_0x121466,_0x2f7ba6){if(_0x121466)return _0x591109(_0x121466);return _0xf82af2(_0x2f7ba6);});})[_0xc38b('0x2a')](function(){return new BPromise(function(_0x5b525c,_0x206ac6){rimraf(_0x16b026,function(_0x3b9ec9){if(_0x3b9ec9)_0x206ac6(_0x3b9ec9);return _0x5b525c();});});})[_0xc38b('0x2a')](function(){return _0x4f849f[_0xc38b('0xbe')](_0x16aa23,_0x95b036,function(_0xc00cbd){if(_0xc00cbd){console[_0xc38b('0xd0')](_0xc38b('0xd1'),_0xc00cbd);}else{fs[_0xc38b('0xd2')](_0x16aa23);}});});});}else{return _0x4f849f['sendStatus'](0xc8);}})['catch'](handleError(_0x4f849f,null));};
\ No newline at end of file
index 3c2d8db..276e908 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb9c5=['map','findAll','length','emit','catch','hook','events','FaxInteraction','../../mysqldb','FaxMessage','setMaxListeners','save','update','then','setDataValue','Users'];(function(_0x481b6f,_0x5a42f8){var _0x4b4464=function(_0x5cb568){while(--_0x5cb568){_0x481b6f['push'](_0x481b6f['shift']());}};_0x4b4464(++_0x5a42f8);}(_0xb9c5,0x1a6));var _0x5b9c=function(_0x2dba04,_0x16a459){_0x2dba04=_0x2dba04-0x0;var _0x1ae645=_0xb9c5[_0x2dba04];return _0x1ae645;};'use strict';var EventEmitter=require(_0x5b9c('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x5b9c('0x1')];var FaxMessage=require(_0x5b9c('0x2'))['db'][_0x5b9c('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x5b9c('0x4')](0x0);var events={'afterCreate':_0x5b9c('0x5'),'afterUpdate':_0x5b9c('0x6'),'afterDestroy':'remove'};function emitEvent(_0x25abe9){return function(_0x65716b,_0x51c837,_0x30f80d){_0x65716b['getUsers']({'attributes':['id'],'raw':!![]})[_0x5b9c('0x7')](function(_0x4e0fc6){_0x65716b[_0x5b9c('0x8')](_0x5b9c('0x9'),_0x4e0fc6[_0x5b9c('0xa')](function(_0x50487f){return{'id':_0x50487f['id']};}));return FaxMessage[_0x5b9c('0xb')]({'where':{'FaxInteractionId':_0x65716b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5b9c('0x7')](function(_0x58c179){_0x65716b[_0x5b9c('0x8')]('unreadMessages',_0x58c179[_0x5b9c('0xc')]);FaxInteractionEvents[_0x5b9c('0xd')](_0x25abe9+':'+_0x65716b['id'],_0x65716b);FaxInteractionEvents[_0x5b9c('0xd')](_0x25abe9,_0x65716b);_0x30f80d(null);})[_0x5b9c('0xe')](_0x30f80d(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0x5b9c('0xf')](e,emitEvent(event));}}module['exports']=FaxInteractionEvents;
\ No newline at end of file
+var _0x01ec=['map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','FaxInteraction','../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x01ec,0x15e));var _0xc01e=function(_0x30296b,_0x5b94bb){_0x30296b=_0x30296b-0x0;var _0x4fb5fc=_0x01ec[_0x30296b];return _0x4fb5fc;};'use strict';var EventEmitter=require(_0xc01e('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0xc01e('0x1')];var FaxMessage=require(_0xc01e('0x2'))['db'][_0xc01e('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xc01e('0x4')](0x0);var events={'afterCreate':_0xc01e('0x5'),'afterUpdate':_0xc01e('0x6'),'afterDestroy':_0xc01e('0x7')};function emitEvent(_0x96c17a){return function(_0x48363f,_0x5f33a0,_0x41413d){_0x48363f[_0xc01e('0x8')]({'attributes':['id'],'raw':!![]})[_0xc01e('0x9')](function(_0x28ceb1){_0x48363f[_0xc01e('0xa')]('Users',_0x28ceb1[_0xc01e('0xb')](function(_0x5b4bb0){return{'id':_0x5b4bb0['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x48363f['id'],'direction':'in','read':![]},'raw':!![]});})[_0xc01e('0x9')](function(_0x318dde){_0x48363f[_0xc01e('0xa')](_0xc01e('0xc'),_0x318dde[_0xc01e('0xd')]);FaxInteractionEvents['emit'](_0x96c17a+':'+_0x48363f['id'],_0x48363f);FaxInteractionEvents[_0xc01e('0xe')](_0x96c17a,_0x48363f);_0x41413d(null);})[_0xc01e('0xf')](_0x41413d(null));};}for(var e in events){if(events[_0xc01e('0x10')](e)){var event=events[e];FaxInteraction[_0xc01e('0x11')](e,emitEvent(event));}}module[_0xc01e('0x12')]=FaxInteractionEvents;
\ No newline at end of file
index 00ab9be..794b295 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd9d6=['rimraf','../../config/environment','./faxInteraction.attributes','exports','FaxInteraction','fax_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xd9d6,0x19c));var _0x6d9d=function(_0x17bfae,_0x52023d){_0x17bfae=_0x17bfae-0x0;var _0x6af798=_0xd9d6[_0x17bfae];return _0x6af798;};'use strict';var _=require(_0x6d9d('0x0'));var util=require(_0x6d9d('0x1'));var logger=require('../../config/logger')(_0x6d9d('0x2'));var moment=require(_0x6d9d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6d9d('0x4'));var config=require(_0x6d9d('0x5'));var attributes=require(_0x6d9d('0x6'));module[_0x6d9d('0x7')]=function(_0xaf1df,_0x154aa9){return _0xaf1df['define'](_0x6d9d('0x8'),attributes,{'tableName':_0x6d9d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3c6076,_0x9f6196,_0x1d85ab){if(_0x3c6076['changed'](_0x6d9d('0xa'))){_0x3c6076['closedAt']=moment()[_0x6d9d('0xb')](_0x6d9d('0xc'));}_0x1d85ab(null,_0x3c6076);}}});};
\ No newline at end of file
+var _0xfea2=['FaxInteraction','fax_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes'];(function(_0x1f469a,_0x31b04a){var _0x9aa0d8=function(_0x2d84e7){while(--_0x2d84e7){_0x1f469a['push'](_0x1f469a['shift']());}};_0x9aa0d8(++_0x31b04a);}(_0xfea2,0x156));var _0x2fea=function(_0x16fe4c,_0x2421e8){_0x16fe4c=_0x16fe4c-0x0;var _0x9999d=_0xfea2[_0x16fe4c];return _0x9999d;};'use strict';var _=require(_0x2fea('0x0'));var util=require(_0x2fea('0x1'));var logger=require(_0x2fea('0x2'))('api');var moment=require(_0x2fea('0x3'));var BPromise=require(_0x2fea('0x4'));var rp=require(_0x2fea('0x5'));var fs=require('fs');var path=require(_0x2fea('0x6'));var rimraf=require(_0x2fea('0x7'));var config=require(_0x2fea('0x8'));var attributes=require(_0x2fea('0x9'));module['exports']=function(_0x2d0a27,_0x143418){return _0x2d0a27['define'](_0x2fea('0xa'),attributes,{'tableName':_0x2fea('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x44f587,_0x257adc,_0x14f962){if(_0x44f587[_0x2fea('0xc')](_0x2fea('0xd'))){_0x44f587[_0x2fea('0xe')]=moment()['format'](_0x2fea('0xf'));}_0x14f962(null,_0x44f587);}}});};
\ No newline at end of file
index da1311e..caa660c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b7f=['../../config/utils','rpc','../../config/environment','defaults','redis','localhost','./faxInteraction.socket','request','then','FaxInteraction,\x20%s,\x20%s','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','UpdateFaxInteraction','FaxInteraction','update','body','options','where','attributes','limit','debug','catch','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3688ef,_0x57ceb4){var _0x295972=function(_0x4d879f){while(--_0x4d879f){_0x3688ef['push'](_0x3688ef['shift']());}};_0x295972(++_0x57ceb4);}(_0x5b7f,0x1bc));var _0xf5b7=function(_0x2d48f5,_0x44a989){_0x2d48f5=_0x2d48f5-0x0;var _0x21fb92=_0x5b7f[_0x2d48f5];return _0x21fb92;};'use strict';var _=require(_0xf5b7('0x0'));var util=require(_0xf5b7('0x1'));var moment=require(_0xf5b7('0x2'));var BPromise=require(_0xf5b7('0x3'));var rs=require(_0xf5b7('0x4'));var fs=require('fs');var Redis=require(_0xf5b7('0x5'));var db=require(_0xf5b7('0x6'))['db'];var utils=require(_0xf5b7('0x7'));var logger=require('../../config/logger')(_0xf5b7('0x8'));var config=require(_0xf5b7('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xf5b7('0xa')](config[_0xf5b7('0xb')],{'host':_0xf5b7('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf5b7('0xb')]));require(_0xf5b7('0xd'))['register'](socket);function respondWithRpcPromise(_0x3ec13d,_0x4c5b84,_0x2bb48c){return new BPromise(function(_0x430eca,_0x1ccddb){return client[_0xf5b7('0xe')](_0x3ec13d,_0x2bb48c)[_0xf5b7('0xf')](function(_0x15d86d){logger['info'](_0xf5b7('0x10'),_0x4c5b84,_0xf5b7('0x11'));logger['debug'](_0xf5b7('0x12'),_0x4c5b84,_0xf5b7('0x11'),JSON[_0xf5b7('0x13')](_0x15d86d));if(_0x15d86d[_0xf5b7('0x14')]){if(_0x15d86d[_0xf5b7('0x14')][_0xf5b7('0x15')]===0x1f4){logger[_0xf5b7('0x14')](_0xf5b7('0x10'),_0x4c5b84,_0x15d86d[_0xf5b7('0x14')][_0xf5b7('0x16')]);return _0x1ccddb(_0x15d86d[_0xf5b7('0x14')][_0xf5b7('0x16')]);}logger['error'](_0xf5b7('0x10'),_0x4c5b84,_0x15d86d['error']['message']);return _0x430eca(_0x15d86d['error']['message']);}else{logger[_0xf5b7('0x17')](_0xf5b7('0x10'),_0x4c5b84,_0xf5b7('0x11'));_0x430eca(_0x15d86d['result'][_0xf5b7('0x16')]);}})['catch'](function(_0x3bbaec){logger[_0xf5b7('0x14')]('FaxInteraction,\x20%s,\x20%s',_0x4c5b84,_0x3bbaec);_0x1ccddb(_0x3bbaec);});});}exports[_0xf5b7('0x18')]=function(_0x167b9d){var _0x507270=this;return new Promise(function(_0x37b50d,_0x34cdfe){return db[_0xf5b7('0x19')][_0xf5b7('0x1a')](_0x167b9d[_0xf5b7('0x1b')],{'raw':_0x167b9d[_0xf5b7('0x1c')]?_0x167b9d[_0xf5b7('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x167b9d[_0xf5b7('0x1c')]?_0x167b9d[_0xf5b7('0x1c')][_0xf5b7('0x1d')]||null:null,'attributes':_0x167b9d[_0xf5b7('0x1c')]?_0x167b9d[_0xf5b7('0x1c')][_0xf5b7('0x1e')]||null:null,'limit':_0x167b9d['options']?_0x167b9d[_0xf5b7('0x1c')][_0xf5b7('0x1f')]||null:null})[_0xf5b7('0xf')](function(_0x3b4241){logger[_0xf5b7('0x17')]('UpdateFaxInteraction',_0x167b9d);logger[_0xf5b7('0x20')](_0xf5b7('0x18'),_0x167b9d,JSON['stringify'](_0x3b4241));_0x37b50d(_0x3b4241);})[_0xf5b7('0x21')](function(_0x269b4c){logger[_0xf5b7('0x14')](_0xf5b7('0x18'),_0x269b4c[_0xf5b7('0x16')],_0x167b9d);_0x34cdfe(_0x507270[_0xf5b7('0x14')](0x1f4,_0x269b4c[_0xf5b7('0x16')]));});});};exports[_0xf5b7('0x22')]=function(_0x5d054c){return new Promise(function(_0x3f060d,_0x4e676f){return db[_0xf5b7('0x19')][_0xf5b7('0x23')]({'where':_0x5d054c[_0xf5b7('0x1c')]?_0x5d054c[_0xf5b7('0x1c')][_0xf5b7('0x1d')]||null:null})[_0xf5b7('0xf')](function(_0x27250f){if(_0x27250f){return _0x27250f[_0xf5b7('0x24')](_0x5d054c[_0xf5b7('0x1b')][_0xf5b7('0x25')],_[_0xf5b7('0x26')](_0x5d054c['body'],['ids','id'])||{});}})[_0xf5b7('0x27')](function(_0x350e13){logger['info'](_0xf5b7('0x28'),_0x5d054c);logger[_0xf5b7('0x20')](_0xf5b7('0x28'),_0x5d054c,JSON[_0xf5b7('0x13')](_0x350e13));_0x3f060d(_0x350e13);})[_0xf5b7('0x21')](function(_0x48c67b){logger[_0xf5b7('0x14')](_0xf5b7('0x28'),_0x48c67b[_0xf5b7('0x16')],_0x5d054c);_0x4e676f(_this[_0xf5b7('0x14')](0x1f4,_0x48c67b[_0xf5b7('0x16')]));});});};
\ No newline at end of file
+var _0x4062=['client','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','request','request\x20sent','FaxInteraction,\x20%s,\x20%s,\x20%s','code','error','FaxInteraction,\x20%s,\x20%s','message','info','result','catch','update','options','raw','where','limit','UpdateFaxInteraction','debug','stringify','AddTagsToFaxInteraction','FaxInteraction','find','then','body','ids','omit','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x4062,0x14e));var _0x2406=function(_0x39d088,_0x18b31d){_0x39d088=_0x39d088-0x0;var _0x5948d6=_0x4062[_0x39d088];return _0x5948d6;};'use strict';var _=require(_0x2406('0x0'));var util=require(_0x2406('0x1'));var moment=require(_0x2406('0x2'));var BPromise=require(_0x2406('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2406('0x4'));var db=require(_0x2406('0x5'))['db'];var utils=require(_0x2406('0x6'));var logger=require(_0x2406('0x7'))('rpc');var config=require(_0x2406('0x8'));var jayson=require(_0x2406('0x9'));var client=jayson[_0x2406('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x2406('0xb')],{'host':_0x2406('0xc'),'port':0x18eb});var socket=require(_0x2406('0xd'))(new Redis(config[_0x2406('0xb')]));require(_0x2406('0xe'))[_0x2406('0xf')](socket);function respondWithRpcPromise(_0x3df9f5,_0x21ddb9,_0x34645a){return new BPromise(function(_0x342e3c,_0x301271){return client[_0x2406('0x10')](_0x3df9f5,_0x34645a)['then'](function(_0x24a003){logger['info']('FaxInteraction,\x20%s,\x20%s',_0x21ddb9,_0x2406('0x11'));logger['debug'](_0x2406('0x12'),_0x21ddb9,_0x2406('0x11'),JSON['stringify'](_0x24a003));if(_0x24a003['error']){if(_0x24a003['error'][_0x2406('0x13')]===0x1f4){logger[_0x2406('0x14')](_0x2406('0x15'),_0x21ddb9,_0x24a003[_0x2406('0x14')][_0x2406('0x16')]);return _0x301271(_0x24a003[_0x2406('0x14')][_0x2406('0x16')]);}logger['error'](_0x2406('0x15'),_0x21ddb9,_0x24a003[_0x2406('0x14')]['message']);return _0x342e3c(_0x24a003[_0x2406('0x14')]['message']);}else{logger[_0x2406('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x21ddb9,'request\x20sent');_0x342e3c(_0x24a003[_0x2406('0x18')]['message']);}})[_0x2406('0x19')](function(_0x162766){logger[_0x2406('0x14')](_0x2406('0x15'),_0x21ddb9,_0x162766);_0x301271(_0x162766);});});}exports['UpdateFaxInteraction']=function(_0x2c4536){var _0xfc4d00=this;return new Promise(function(_0x2d6945,_0x5b9932){return db['FaxInteraction'][_0x2406('0x1a')](_0x2c4536['body'],{'raw':_0x2c4536[_0x2406('0x1b')]?_0x2c4536[_0x2406('0x1b')][_0x2406('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c4536[_0x2406('0x1b')]?_0x2c4536[_0x2406('0x1b')][_0x2406('0x1d')]||null:null,'attributes':_0x2c4536[_0x2406('0x1b')]?_0x2c4536[_0x2406('0x1b')]['attributes']||null:null,'limit':_0x2c4536[_0x2406('0x1b')]?_0x2c4536[_0x2406('0x1b')][_0x2406('0x1e')]||null:null})['then'](function(_0x53b2cf){logger['info'](_0x2406('0x1f'),_0x2c4536);logger[_0x2406('0x20')](_0x2406('0x1f'),_0x2c4536,JSON[_0x2406('0x21')](_0x53b2cf));_0x2d6945(_0x53b2cf);})[_0x2406('0x19')](function(_0xf8c3d2){logger['error']('UpdateFaxInteraction',_0xf8c3d2[_0x2406('0x16')],_0x2c4536);_0x5b9932(_0xfc4d00[_0x2406('0x14')](0x1f4,_0xf8c3d2[_0x2406('0x16')]));});});};exports[_0x2406('0x22')]=function(_0x3389fe){return new Promise(function(_0x404aa8,_0x5ee09f){return db[_0x2406('0x23')][_0x2406('0x24')]({'where':_0x3389fe['options']?_0x3389fe[_0x2406('0x1b')][_0x2406('0x1d')]||null:null})[_0x2406('0x25')](function(_0x2b2f3f){if(_0x2b2f3f){return _0x2b2f3f['addTags'](_0x3389fe[_0x2406('0x26')][_0x2406('0x27')],_[_0x2406('0x28')](_0x3389fe[_0x2406('0x26')],[_0x2406('0x27'),'id'])||{});}})[_0x2406('0x29')](function(_0x139667){logger[_0x2406('0x17')](_0x2406('0x2a'),_0x3389fe);logger['debug'](_0x2406('0x2a'),_0x3389fe,JSON[_0x2406('0x21')](_0x139667));_0x404aa8(_0x139667);})['catch'](function(_0x5963f2){logger[_0x2406('0x14')](_0x2406('0x2a'),_0x5963f2[_0x2406('0x16')],_0x3389fe);_0x5ee09f(_this[_0x2406('0x14')](0x1f4,_0x5963f2[_0x2406('0x16')]));});});};
\ No newline at end of file
index 57eb203..2029765 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb601=['save','removeListener','length','./faxInteraction.events'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xb601,0x1b7));var _0x1b60=function(_0x41da6,_0x42431b){_0x41da6=_0x41da6-0x0;var _0x282340=_0xb601[_0x41da6];return _0x282340;};'use strict';var FaxInteractionEvents=require(_0x1b60('0x0'));var events=[_0x1b60('0x1'),'remove','update'];function createListener(_0x1038e7,_0x4c72ad){return function(_0xa70bd9){_0x4c72ad['emit'](_0x1038e7,_0xa70bd9);};}function removeListener(_0x36be5b,_0x4b88d5){return function(){FaxInteractionEvents[_0x1b60('0x2')](_0x36be5b,_0x4b88d5);};}exports['register']=function(_0x197163){for(var _0x13bb48=0x0,_0x3f8213=events[_0x1b60('0x3')];_0x13bb48<_0x3f8213;_0x13bb48++){var _0x42356d=events[_0x13bb48];var _0x206385=createListener('faxInteraction:'+_0x42356d,_0x197163);FaxInteractionEvents['on'](_0x42356d,_0x206385);}};
\ No newline at end of file
+var _0xd3e2=['remove','emit','removeListener','register','length','./faxInteraction.events'];(function(_0x37fbb5,_0x2fdd12){var _0x31a15e=function(_0x51afec){while(--_0x51afec){_0x37fbb5['push'](_0x37fbb5['shift']());}};_0x31a15e(++_0x2fdd12);}(_0xd3e2,0x161));var _0x2d3e=function(_0x54f946,_0x303a94){_0x54f946=_0x54f946-0x0;var _0x476256=_0xd3e2[_0x54f946];return _0x476256;};'use strict';var FaxInteractionEvents=require(_0x2d3e('0x0'));var events=['save',_0x2d3e('0x1'),'update'];function createListener(_0x4dbbf1,_0x5e1c2f){return function(_0x2ffb7d){_0x5e1c2f[_0x2d3e('0x2')](_0x4dbbf1,_0x2ffb7d);};}function removeListener(_0x219720,_0x2200dd){return function(){FaxInteractionEvents[_0x2d3e('0x3')](_0x219720,_0x2200dd);};}exports[_0x2d3e('0x4')]=function(_0x4ee5fd){for(var _0x30b167=0x0,_0x5b4a16=events[_0x2d3e('0x5')];_0x30b167<_0x5b4a16;_0x30b167++){var _0x11b97a=events[_0x30b167];var _0xd671ba=createListener('faxInteraction:'+_0x11b97a,_0x4ee5fd);FaxInteractionEvents['on'](_0x11b97a,_0xd671ba);}};
\ No newline at end of file
index 3a92bdc..29bff0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb721=['create','/:id/messages','/:id/tags','fax','addTags','put','tracked','faxinteraction:update','destroy','removeTags','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','/describe','/:id','getMessages','post'];(function(_0x551637,_0x3292db){var _0x633a5e=function(_0x10e63e){while(--_0x10e63e){_0x551637['push'](_0x551637['shift']());}};_0x633a5e(++_0x3292db);}(_0xb721,0x169));var _0x1b72=function(_0x11deef,_0x34bbdb){_0x11deef=_0x11deef-0x0;var _0xe9ba85=_0xb721[_0x11deef];return _0xe9ba85;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1b72('0x0'));var express=require(_0x1b72('0x1'));var router=express[_0x1b72('0x2')]();var fs_extra=require(_0x1b72('0x3'));var auth=require(_0x1b72('0x4'));var interaction=require(_0x1b72('0x5'));var config=require(_0x1b72('0x6'));var controller=require(_0x1b72('0x7'));router[_0x1b72('0x8')]('/',auth[_0x1b72('0x9')](),controller['index']);router['get'](_0x1b72('0xa'),auth[_0x1b72('0x9')](),controller['describe']);router[_0x1b72('0x8')](_0x1b72('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1b72('0x8')]('/:id/messages',auth['isAuthenticated'](),controller[_0x1b72('0xc')]);router['get']('/:id/download',auth[_0x1b72('0x9')](),controller['download']);router[_0x1b72('0xd')]('/',auth[_0x1b72('0x9')](),controller[_0x1b72('0xe')]);router[_0x1b72('0xd')](_0x1b72('0xf'),auth[_0x1b72('0x9')](),controller['addMessage']);router['post'](_0x1b72('0x10'),auth[_0x1b72('0x9')](),interaction['tracked'](_0x1b72('0x11'),'faxinteraction:addtags'),controller[_0x1b72('0x12')]);router[_0x1b72('0x13')](_0x1b72('0xb'),auth[_0x1b72('0x9')](),interaction[_0x1b72('0x14')](_0x1b72('0x11'),_0x1b72('0x15')),controller['update']);router['delete']('/:id',auth[_0x1b72('0x9')](),interaction[_0x1b72('0x14')](_0x1b72('0x11'),'faxinteraction:destroy'),controller[_0x1b72('0x16')]);router['delete']('/:id/tags',auth[_0x1b72('0x9')](),controller[_0x1b72('0x17')]);module[_0x1b72('0x18')]=router;
\ No newline at end of file
+var _0x0a0c=['isAuthenticated','get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','faxinteraction:addtags','addTags','fax','faxinteraction:update','update','faxinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./faxInteraction.controller'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x0a0c,0x7c));var _0xc0a0=function(_0x1a6c1e,_0x112fbe){_0x1a6c1e=_0x1a6c1e-0x0;var _0x5853e9=_0x0a0c[_0x1a6c1e];return _0x5853e9;};'use strict';var multer=require(_0xc0a0('0x0'));var util=require(_0xc0a0('0x1'));var path=require(_0xc0a0('0x2'));var timeout=require(_0xc0a0('0x3'));var express=require('express');var router=express[_0xc0a0('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc0a0('0x5'));var config=require(_0xc0a0('0x6'));var controller=require(_0xc0a0('0x7'));router['get']('/',auth[_0xc0a0('0x8')](),controller['index']);router[_0xc0a0('0x9')](_0xc0a0('0xa'),auth[_0xc0a0('0x8')](),controller[_0xc0a0('0xb')]);router[_0xc0a0('0x9')](_0xc0a0('0xc'),auth[_0xc0a0('0x8')](),controller[_0xc0a0('0xd')]);router['get'](_0xc0a0('0xe'),auth[_0xc0a0('0x8')](),controller[_0xc0a0('0xf')]);router[_0xc0a0('0x9')](_0xc0a0('0x10'),auth[_0xc0a0('0x8')](),controller[_0xc0a0('0x11')]);router[_0xc0a0('0x12')]('/',auth['isAuthenticated'](),controller[_0xc0a0('0x13')]);router[_0xc0a0('0x12')](_0xc0a0('0xe'),auth[_0xc0a0('0x8')](),controller[_0xc0a0('0x14')]);router[_0xc0a0('0x12')](_0xc0a0('0x15'),auth[_0xc0a0('0x8')](),interaction[_0xc0a0('0x16')]('fax',_0xc0a0('0x17')),controller[_0xc0a0('0x18')]);router['put']('/:id',auth[_0xc0a0('0x8')](),interaction['tracked'](_0xc0a0('0x19'),_0xc0a0('0x1a')),controller[_0xc0a0('0x1b')]);router['delete']('/:id',auth[_0xc0a0('0x8')](),interaction[_0xc0a0('0x16')](_0xc0a0('0x19'),_0xc0a0('0x1c')),controller[_0xc0a0('0x1d')]);router[_0xc0a0('0x1e')](_0xc0a0('0x15'),auth[_0xc0a0('0x8')](),controller[_0xc0a0('0x1f')]);module[_0xc0a0('0x20')]=router;
\ No newline at end of file
index d502ea4..c8ef3e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe630=['DATE','sequelize','exports','medium','BOOLEAN','ENUM','out','TEXT'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0xe630,0x149));var _0x0e63=function(_0x59e703,_0x62b160){_0x59e703=_0x59e703-0x0;var _0x5e46c3=_0xe630[_0x59e703];return _0x5e46c3;};'use strict';var Sequelize=require(_0x0e63('0x0'));module[_0x0e63('0x1')]={'body':{'type':Sequelize['TEXT'](_0x0e63('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x0e63('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0e63('0x4')]('in','out'),'defaultValue':_0x0e63('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x0e63('0x6')],'defaultValue':null},'readAt':{'type':Sequelize[_0x0e63('0x7')]}};
\ No newline at end of file
+var _0x5db8=['TEXT','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x47fc01,_0x50068a){var _0x2cec29=function(_0x1d6b15){while(--_0x1d6b15){_0x47fc01['push'](_0x47fc01['shift']());}};_0x2cec29(++_0x50068a);}(_0x5db8,0xbb));var _0x85db=function(_0x149083,_0x4047b6){_0x149083=_0x149083-0x0;var _0x4dc74e=_0x5db8[_0x149083];return _0x4dc74e;};'use strict';var Sequelize=require(_0x85db('0x0'));module[_0x85db('0x1')]={'body':{'type':Sequelize[_0x85db('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x85db('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x85db('0x4')]('in',_0x85db('0x5')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x85db('0x6')]}};
\ No newline at end of file
index 55fb9f7..1967a50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc177=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./faxMessage.socket','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','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','stack','name','send','index','FaxMessage','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','where','merge','filter','options','includeAll','include','rows','catch','show','params','rawAttributes','body','find','describe','../../config/logger','fax-interactions','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','contact','User','agent','internal','channel','event','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','QueryTypes','interface','SIP/%s','motionChannel','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','download','join','root','server','files','attachments','basename','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x2ed404,_0x5d6108){var _0xd7b62f=function(_0xd25107){while(--_0xd25107){_0x2ed404['push'](_0x2ed404['shift']());}};_0xd7b62f(++_0x5d6108);}(_0xc177,0x1b5));var _0x7c17=function(_0x3c7776,_0x2c4da2){_0x3c7776=_0x3c7776-0x0;var _0x9b7072=_0xc177[_0x3c7776];return _0x9b7072;};'use strict';var emlformat=require(_0x7c17('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7c17('0x1'));var jsonpatch=require(_0x7c17('0x2'));var rp=require(_0x7c17('0x3'));var moment=require(_0x7c17('0x4'));var BPromise=require(_0x7c17('0x5'));var Mustache=require(_0x7c17('0x6'));var util=require(_0x7c17('0x7'));var path=require(_0x7c17('0x8'));var sox=require(_0x7c17('0x9'));var csv=require(_0x7c17('0xa'));var ejs=require(_0x7c17('0xb'));var fs=require('fs');var fs_extra=require(_0x7c17('0xc'));var _=require(_0x7c17('0xd'));var squel=require(_0x7c17('0xe'));var crypto=require(_0x7c17('0xf'));var jsforce=require(_0x7c17('0x10'));var deskjs=require(_0x7c17('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7c17('0x12'));var Redis=require('ioredis');var authService=require(_0x7c17('0x13'));var qs=require(_0x7c17('0x14'));var as=require(_0x7c17('0x15'));var hardwareService=require(_0x7c17('0x16'));var logger=require('../../config/logger')(_0x7c17('0x17'));var utils=require('../../config/utils');var config=require(_0x7c17('0x18'));var licenseUtil=require(_0x7c17('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x7c17('0x1a')](config[_0x7c17('0x1b')],{'host':_0x7c17('0x1c'),'port':0x18eb});var socket=require(_0x7c17('0x1d'))(new Redis(config['redis']));require(_0x7c17('0x1e'))['register'](socket);var jayson=require(_0x7c17('0x1f'));var client=jayson[_0x7c17('0x20')][_0x7c17('0x21')]({'port':0x232c});var client9002=jayson[_0x7c17('0x20')][_0x7c17('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x12f7a1,_0x4dab88,_0x57a627,_0x3ce5b7){return new BPromise(function(_0x187b0e,_0x2a7a12){var _0x159610=_0x3ce5b7||client;return _0x159610[_0x7c17('0x22')](_0x12f7a1,_0x57a627)['then'](function(_0x499cba){logger[_0x7c17('0x23')](_0x7c17('0x24'),_0x4dab88,_0x7c17('0x25'));logger[_0x7c17('0x26')](_0x7c17('0x27'),_0x4dab88,_0x7c17('0x25'),JSON[_0x7c17('0x28')](_0x499cba));if(_0x499cba[_0x7c17('0x29')]){if(_0x499cba['error'][_0x7c17('0x2a')]===0x1f4){logger['error'](_0x7c17('0x24'),_0x4dab88,_0x499cba[_0x7c17('0x29')][_0x7c17('0x2b')]);return _0x2a7a12(_0x499cba[_0x7c17('0x29')]['message']);}logger[_0x7c17('0x29')](_0x7c17('0x24'),_0x4dab88,_0x499cba[_0x7c17('0x29')]['message']);return _0x187b0e(_0x499cba[_0x7c17('0x29')][_0x7c17('0x2b')]);}else{logger['info'](_0x7c17('0x24'),_0x4dab88,_0x7c17('0x25'));_0x187b0e(_0x499cba['result'][_0x7c17('0x2b')]);}})['catch'](function(_0x19418f){logger[_0x7c17('0x29')]('FaxMessage,\x20%s,\x20%s',_0x4dab88,_0x19418f);_0x2a7a12(_0x19418f);});});}function respondWithStatusCode(_0x3b4c18,_0x1d3292){_0x1d3292=_0x1d3292||0xcc;return function(_0x376062){if(_0x376062){return _0x3b4c18[_0x7c17('0x2c')](_0x1d3292);}return _0x3b4c18[_0x7c17('0x2d')](_0x1d3292)['end']();};}function respondWithResult(_0x13d336,_0x2cc1ed){_0x2cc1ed=_0x2cc1ed||0xc8;return function(_0x2c0958){if(_0x2c0958){return _0x13d336[_0x7c17('0x2d')](_0x2cc1ed)[_0x7c17('0x2e')](_0x2c0958);}};}function respondWithFilteredResult(_0x4a8b8e,_0x4439f1){return function(_0x23110a){if(_0x23110a){var _0x251757=typeof _0x4439f1[_0x7c17('0x2f')]===_0x7c17('0x30')&&typeof _0x4439f1[_0x7c17('0x31')]===_0x7c17('0x30');var _0x55aef0=_0x23110a['count'];var _0x3b1c65=_0x251757?0x0:_0x4439f1[_0x7c17('0x2f')];var _0x8a9410=_0x251757?_0x23110a[_0x7c17('0x32')]:_0x4439f1['offset']+_0x4439f1[_0x7c17('0x31')];var _0x547286;if(_0x8a9410>=_0x55aef0){_0x8a9410=_0x55aef0;_0x547286=0xc8;}else{_0x547286=0xce;}_0x4a8b8e[_0x7c17('0x2d')](_0x547286);return _0x4a8b8e[_0x7c17('0x33')]('Content-Range',_0x3b1c65+'-'+_0x8a9410+'/'+_0x55aef0)['json'](_0x23110a);}return null;};}function patchUpdates(_0x2380ce){return function(_0x19b88c){try{jsonpatch[_0x7c17('0x34')](_0x19b88c,_0x2380ce,!![]);}catch(_0x675259){return BPromise[_0x7c17('0x35')](_0x675259);}return _0x19b88c[_0x7c17('0x36')]();};}function saveUpdates(_0x7a5732,_0x5e2c88){return function(_0x42d785){if(_0x42d785){return _0x42d785[_0x7c17('0x37')](_0x7a5732)['then'](function(_0x1e2aea){return _0x1e2aea;});}return null;};}function removeEntity(_0x29fb89,_0x18b116){return function(_0x1c2ae4){if(_0x1c2ae4){return _0x1c2ae4[_0x7c17('0x38')]()[_0x7c17('0x39')](function(){_0x29fb89['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d7286,_0x251454){return function(_0x5df12d){if(!_0x5df12d){_0x5d7286[_0x7c17('0x2c')](0x194);}return _0x5df12d;};}function handleError(_0x27f0e5,_0xad2077){_0xad2077=_0xad2077||0x1f4;return function(_0xdc03af){logger['error'](_0xdc03af[_0x7c17('0x3a')]);if(_0xdc03af[_0x7c17('0x3b')]){delete _0xdc03af['name'];}_0x27f0e5['status'](_0xad2077)[_0x7c17('0x3c')](_0xdc03af);};}exports[_0x7c17('0x3d')]=function(_0x73d6c7,_0xf5910c){var _0x9df87e={},_0x4d6a1f={},_0x1fcd2c={'count':0x0,'rows':[]};var _0x4a22ac=_['map'](db[_0x7c17('0x3e')]['rawAttributes'],function(_0x232790){return{'name':_0x232790[_0x7c17('0x3f')],'type':_0x232790[_0x7c17('0x40')]['key']};});_0x4d6a1f['model']=_['map'](_0x4a22ac,_0x7c17('0x3b'));_0x4d6a1f[_0x7c17('0x41')]=_[_0x7c17('0x42')](_0x73d6c7[_0x7c17('0x41')]);_0x4d6a1f[_0x7c17('0x43')]=_[_0x7c17('0x44')](_0x4d6a1f[_0x7c17('0x45')],_0x4d6a1f[_0x7c17('0x41')]);_0x9df87e[_0x7c17('0x46')]=_[_0x7c17('0x44')](_0x4d6a1f[_0x7c17('0x45')],qs[_0x7c17('0x47')](_0x73d6c7[_0x7c17('0x41')][_0x7c17('0x47')]));_0x9df87e['attributes']=_0x9df87e['attributes'][_0x7c17('0x48')]?_0x9df87e[_0x7c17('0x46')]:_0x4d6a1f['model'];if(!_0x73d6c7[_0x7c17('0x41')][_0x7c17('0x49')](_0x7c17('0x4a'))){_0x9df87e[_0x7c17('0x31')]=qs[_0x7c17('0x31')](_0x73d6c7['query'][_0x7c17('0x31')]);_0x9df87e[_0x7c17('0x2f')]=qs[_0x7c17('0x2f')](_0x73d6c7['query'][_0x7c17('0x2f')]);}_0x9df87e[_0x7c17('0x4b')]=qs['sort'](_0x73d6c7[_0x7c17('0x41')]['sort']);_0x9df87e['where']=qs[_0x7c17('0x43')](_[_0x7c17('0x4c')](_0x73d6c7[_0x7c17('0x41')],_0x4d6a1f[_0x7c17('0x43')]),_0x4a22ac);if(_0x73d6c7[_0x7c17('0x41')]['filter']){_0x9df87e[_0x7c17('0x4d')]=_[_0x7c17('0x4e')](_0x9df87e[_0x7c17('0x4d')],{'$or':_['map'](_0x4a22ac,function(_0x219621){if(_0x219621[_0x7c17('0x40')]!=='VIRTUAL'){var _0xf0d2bb={};_0xf0d2bb[_0x219621['name']]={'$like':'%'+_0x73d6c7[_0x7c17('0x41')][_0x7c17('0x4f')]+'%'};return _0xf0d2bb;}})});}_0x9df87e=_[_0x7c17('0x4e')]({},_0x9df87e,_0x73d6c7[_0x7c17('0x50')]);var _0x5bb1a1={'where':_0x9df87e['where']};return db[_0x7c17('0x3e')][_0x7c17('0x32')](_0x5bb1a1)[_0x7c17('0x39')](function(_0x5d1fb5){_0x1fcd2c[_0x7c17('0x32')]=_0x5d1fb5;if(_0x73d6c7[_0x7c17('0x41')][_0x7c17('0x51')]){_0x9df87e[_0x7c17('0x52')]=[{'all':!![]}];}return db[_0x7c17('0x3e')]['findAll'](_0x9df87e);})[_0x7c17('0x39')](function(_0x2356fb){_0x1fcd2c[_0x7c17('0x53')]=_0x2356fb;return _0x1fcd2c;})[_0x7c17('0x39')](respondWithFilteredResult(_0xf5910c,_0x9df87e))[_0x7c17('0x54')](handleError(_0xf5910c,null));};exports[_0x7c17('0x55')]=function(_0x4a70a3,_0x394fed){var _0x1fd2e8={'raw':!![],'where':{'id':_0x4a70a3[_0x7c17('0x56')]['id']}},_0x3dddfd={};_0x3dddfd[_0x7c17('0x45')]=_[_0x7c17('0x42')](db['FaxMessage'][_0x7c17('0x57')]);_0x3dddfd['query']=_[_0x7c17('0x42')](_0x4a70a3[_0x7c17('0x41')]);_0x3dddfd[_0x7c17('0x43')]=_['intersection'](_0x3dddfd[_0x7c17('0x45')],_0x3dddfd['query']);_0x1fd2e8[_0x7c17('0x46')]=_[_0x7c17('0x44')](_0x3dddfd[_0x7c17('0x45')],qs[_0x7c17('0x47')](_0x4a70a3[_0x7c17('0x41')][_0x7c17('0x47')]));_0x1fd2e8['attributes']=_0x1fd2e8[_0x7c17('0x46')]['length']?_0x1fd2e8[_0x7c17('0x46')]:_0x3dddfd[_0x7c17('0x45')];if(_0x4a70a3[_0x7c17('0x41')][_0x7c17('0x51')]){_0x1fd2e8['include']=[{'all':!![]}];}_0x1fd2e8=_[_0x7c17('0x4e')]({},_0x1fd2e8,_0x4a70a3[_0x7c17('0x50')]);return db['FaxMessage']['find'](_0x1fd2e8)[_0x7c17('0x39')](handleEntityNotFound(_0x394fed,null))[_0x7c17('0x39')](respondWithResult(_0x394fed,null))[_0x7c17('0x54')](handleError(_0x394fed,null));};exports['update']=function(_0x4c928f,_0x16be9c){if(_0x4c928f[_0x7c17('0x58')]['id']){delete _0x4c928f[_0x7c17('0x58')]['id'];}return db[_0x7c17('0x3e')][_0x7c17('0x59')]({'where':{'id':_0x4c928f[_0x7c17('0x56')]['id']}})[_0x7c17('0x39')](handleEntityNotFound(_0x16be9c,null))[_0x7c17('0x39')](saveUpdates(_0x4c928f[_0x7c17('0x58')],null))[_0x7c17('0x39')](respondWithResult(_0x16be9c,null))[_0x7c17('0x54')](handleError(_0x16be9c,null));};exports[_0x7c17('0x38')]=function(_0xf6c2c1,_0x4c08cd){return db[_0x7c17('0x3e')][_0x7c17('0x59')]({'where':{'id':_0xf6c2c1[_0x7c17('0x56')]['id']}})[_0x7c17('0x39')](handleEntityNotFound(_0x4c08cd,null))[_0x7c17('0x39')](removeEntity(_0x4c08cd,null))[_0x7c17('0x54')](handleError(_0x4c08cd,null));};exports[_0x7c17('0x5a')]=function(_0x326c71,_0x299418){return db[_0x7c17('0x3e')][_0x7c17('0x5a')]()[_0x7c17('0x39')](respondWithResult(_0x299418,null))[_0x7c17('0x54')](handleError(_0x299418,null));};var interaction_log=require(_0x7c17('0x5b'))(_0x7c17('0x5c'));exports[_0x7c17('0x5d')]=function(_0x11e3c7,_0x2d76be,_0x1bead3){var _0x158845={'agent':{},'channel':_0x7c17('0x5e')};if(_0x11e3c7['body']['id']){delete _0x11e3c7[_0x7c17('0x58')]['id'];}_0x11e3c7['body'][_0x7c17('0x5f')]=!![];_0x11e3c7['body'][_0x7c17('0x60')]=moment()[_0x7c17('0x61')](_0x7c17('0x62'));_0x11e3c7['body'][_0x7c17('0x63')]=_0x11e3c7[_0x7c17('0x58')][_0x7c17('0x63')]||_0x11e3c7[_0x7c17('0x64')]['id'];_0x158845['agent']['id']=_0x11e3c7[_0x7c17('0x58')][_0x7c17('0x63')];return db['FaxMessage']['find']({'where':{'id':_0x11e3c7[_0x7c17('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2d76be,null))[_0x7c17('0x39')](saveUpdates(_0x11e3c7[_0x7c17('0x58')],null))[_0x7c17('0x39')](function(_0x445f1b){if(_0x445f1b){_0x158845[_0x7c17('0x2b')]=_0x445f1b['get']({'plain':!![]});return db[_0x7c17('0x65')][_0x7c17('0x59')]({'where':{'id':_0x445f1b[_0x7c17('0x66')]}});}return null;})[_0x7c17('0x39')](handleEntityNotFound(_0x2d76be,null))[_0x7c17('0x39')](function(_0x31be62){if(_0x31be62){return _0x31be62[_0x7c17('0x37')]({'UserId':_0x11e3c7[_0x7c17('0x58')]['UserId'],'read1stAt':_[_0x7c17('0x67')](_0x31be62[_0x7c17('0x68')])?moment()[_0x7c17('0x61')](_0x7c17('0x62')):undefined});}return null;})[_0x7c17('0x39')](function(_0xecd990){if(_0xecd990){_0x158845[_0x7c17('0x69')]=_0xecd990[_0x7c17('0x6a')]({'plain':!![]});interaction_log['info'](_0x7c17('0x6b'),_0x11e3c7[_0x7c17('0x64')]['id'],_0x11e3c7[_0x7c17('0x64')][_0x7c17('0x3b')],_0x11e3c7[_0x7c17('0x64')]['role'],_0x158845[_0x7c17('0x69')]['id'],_0x11e3c7['body']?JSON['stringify'](_0x11e3c7[_0x7c17('0x58')]):_0x7c17('0x6c'));return respondWithRpcPromise(_0x7c17('0x6d'),'acceptMessage',_0x158845);}return null;})['then'](function(_0x2aef9a){var _0x2c5ec8=_0x7c17('0x6e')+_0x2aef9a['message'][_0x7c17('0x6f')];return db[_0x7c17('0x70')][_0x7c17('0x41')](_0x2c5ec8,{'type':db[_0x7c17('0x71')]['QueryTypes'][_0x7c17('0x72')],'raw':!![]})[_0x7c17('0x39')](function(_0x28dbe5){return _0x28dbe5;});})[_0x7c17('0x39')](function(_0x31c304){if(_0x31c304){_0x158845[_0x7c17('0x2b')][_0x7c17('0x73')]=_0x31c304[0x0];if(!_0x11e3c7[_0x7c17('0x58')][_0x7c17('0x63')])return;return db[_0x7c17('0x74')]['find']({'where':{'id':_0x11e3c7['body'][_0x7c17('0x63')],'role':_0x7c17('0x75')},'attributes':['id',_0x7c17('0x3b'),'fullname','email',_0x7c17('0x76')],'raw':!![]});}return null;})[_0x7c17('0x39')](function(_0x51f2ee){if(!_0x51f2ee)return null;_0x158845[_0x7c17('0x2b')][_0x7c17('0x75')]=_0x51f2ee;return _0x158845;})['then'](function(_0x293b35){if(_0x293b35){if(_0x11e3c7['body']['manual']){_0x158845[_0x7c17('0x2b')]['interface']=util[_0x7c17('0x61')]('SIP/%s',_0x11e3c7[_0x7c17('0x64')][_0x7c17('0x3b')]);_0x158845[_0x7c17('0x2b')]['channel']=_0x158845[_0x7c17('0x77')];_0x158845[_0x7c17('0x2b')]['motionChannel']=_0x158845[_0x7c17('0x77')];_0x158845[_0x7c17('0x2b')][_0x7c17('0x78')]=_0x7c17('0x5d');return respondWithRpcPromise(_0x7c17('0x79'),_0x7c17('0x79'),{'event':_0x7c17('0x7a'),'message':_0x158845[_0x7c17('0x2b')]},client9002)[_0x7c17('0x39')](function(){return _0x158845;});}return _0x158845;}return null;})[_0x7c17('0x39')](respondWithResult(_0x2d76be,null))[_0x7c17('0x54')](handleError(_0x2d76be,null));};var interaction_log=require(_0x7c17('0x5b'))('fax-interactions');exports['reject']=function(_0x455d7d,_0x4f92cf,_0x22aa8e){var _0x52af33={'agent':{},'channel':_0x7c17('0x5e')};if(_0x455d7d[_0x7c17('0x58')]['id']){delete _0x455d7d[_0x7c17('0x58')]['id'];}_0x455d7d['body'][_0x7c17('0x63')]=_0x455d7d[_0x7c17('0x58')][_0x7c17('0x63')]||_0x455d7d[_0x7c17('0x64')]['id'];_0x52af33[_0x7c17('0x75')]['id']=_0x455d7d[_0x7c17('0x58')]['UserId'];return db['FaxMessage'][_0x7c17('0x59')]({'where':{'id':_0x455d7d[_0x7c17('0x56')]['id'],'UserId':null}})[_0x7c17('0x39')](handleEntityNotFound(_0x4f92cf,null))[_0x7c17('0x39')](function(_0x34bd3b){if(_0x34bd3b){_0x52af33[_0x7c17('0x2b')]=_0x34bd3b[_0x7c17('0x6a')]({'plain':!![]});return db[_0x7c17('0x65')]['find']({'where':{'id':_0x34bd3b[_0x7c17('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x4f92cf,null))['then'](function(_0x528394){if(_0x528394){_0x52af33[_0x7c17('0x69')]=_0x528394[_0x7c17('0x6a')]({'plain':!![]});interaction_log[_0x7c17('0x23')](_0x7c17('0x7b'),_0x455d7d[_0x7c17('0x64')]['id'],_0x455d7d[_0x7c17('0x64')][_0x7c17('0x3b')],_0x455d7d[_0x7c17('0x64')][_0x7c17('0x7c')],_0x52af33['interaction']['id'],_0x455d7d[_0x7c17('0x58')]?JSON[_0x7c17('0x28')](_0x455d7d['body']):_0x7c17('0x6c'));return respondWithRpcPromise(_0x7c17('0x7d'),_0x7c17('0x7e'),_0x52af33);}return null;})[_0x7c17('0x39')](function(_0x1fe2e5){var _0x41254e='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1fe2e5[_0x7c17('0x2b')][_0x7c17('0x6f')];return db[_0x7c17('0x70')][_0x7c17('0x41')](_0x41254e,{'type':db['Sequelize'][_0x7c17('0x7f')]['SELECT'],'raw':!![]})[_0x7c17('0x39')](function(_0x268315){return _0x268315;});})[_0x7c17('0x39')](function(_0x36af45){if(_0x36af45){_0x52af33[_0x7c17('0x2b')]['contact']=_0x36af45[0x0];if(!_0x455d7d['body'][_0x7c17('0x63')])return;return db[_0x7c17('0x74')][_0x7c17('0x59')]({'where':{'id':_0x455d7d[_0x7c17('0x58')]['UserId'],'role':'agent'},'attributes':['id',_0x7c17('0x3b'),'fullname','email',_0x7c17('0x76')],'raw':!![]});}return null;})[_0x7c17('0x39')](function(_0x20c394){if(!_0x20c394)return null;_0x52af33[_0x7c17('0x2b')][_0x7c17('0x75')]=_0x20c394;return _0x52af33;})[_0x7c17('0x39')](function(_0x4b353c){if(_0x4b353c){_0x4b353c[_0x7c17('0x2b')][_0x7c17('0x80')]=util[_0x7c17('0x61')](_0x7c17('0x81'),_0x455d7d[_0x7c17('0x64')][_0x7c17('0x3b')]);_0x4b353c[_0x7c17('0x2b')][_0x7c17('0x77')]=_0x52af33[_0x7c17('0x77')];_0x4b353c[_0x7c17('0x2b')][_0x7c17('0x82')]=_0x52af33[_0x7c17('0x77')];_0x4b353c[_0x7c17('0x2b')][_0x7c17('0x78')]=_0x7c17('0x35');respondWithRpcPromise(_0x7c17('0x79'),_0x7c17('0x79'),{'event':_0x7c17('0x83'),'message':_0x4b353c['message']},client9002);return _0x52af33;}return null;})[_0x7c17('0x39')](respondWithResult(_0x4f92cf,null))[_0x7c17('0x54')](handleError(_0x4f92cf,null));};exports[_0x7c17('0x84')]=function(_0xd09968,_0x29ea47){var _0x106af6;return db[_0x7c17('0x3e')][_0x7c17('0x84')](_0xd09968[_0x7c17('0x58')],{})[_0x7c17('0x39')](function(_0x15e6b0){_0x106af6=_0x15e6b0;return db[_0x7c17('0x85')][_0x7c17('0x86')]({'where':{'id':_0x106af6[_0x7c17('0x6f')]}});})[_0x7c17('0x39')](function(_0x509ff4){if(_[_0x7c17('0x67')](_0x509ff4)){return;}else{_0x106af6['fax']=_0x509ff4[_0x7c17('0x5e')];return db[_0x7c17('0x87')][_0x7c17('0x86')]({'where':{'id':_0x106af6[_0x7c17('0x88')]}});}})[_0x7c17('0x39')](function(_0x4353b5){return respondWithRpcPromise(_0x7c17('0x89'),_0x7c17('0x89'),{'FaxAccountId':_['isNil'](_0xd09968[_0x7c17('0x58')])?undefined:_0xd09968['body'][_0x7c17('0x8a')],'path':_[_0x7c17('0x67')](_0x4353b5)?undefined:util['format'](_0x7c17('0x8b'),_0x4353b5['basename']),'fax':_[_0x7c17('0x67')](_0x106af6['fax'])?undefined:_0x106af6[_0x7c17('0x5e')],'AttachmentId':_0x106af6[_0x7c17('0x88')]},client9002);})[_0x7c17('0x39')](respondWithResult(_0x29ea47,0xc9))[_0x7c17('0x54')](handleError(_0x29ea47,null));};exports[_0x7c17('0x8c')]=function(_0x44c828,_0x1fb62b){var _0x2cd87b=path[_0x7c17('0x8d')](config[_0x7c17('0x8e')],_0x7c17('0x8f'),_0x7c17('0x90'),_0x7c17('0x91'));return db[_0x7c17('0x3e')][_0x7c17('0x59')]({'where':{'id':_0x44c828[_0x7c17('0x56')]['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})[_0x7c17('0x39')](handleEntityNotFound(_0x1fb62b,null))[_0x7c17('0x39')](function(_0x2732d7){if(_0x2732d7){return _0x1fb62b[_0x7c17('0x8c')](path[_0x7c17('0x8d')](_0x2cd87b,_0x2732d7[_0x7c17('0x87')][_0x7c17('0x92')]));}})[_0x7c17('0x54')](handleError(_0x1fb62b,null));};
\ No newline at end of file
+var _0x5a9e=['User','fullname','email','internal','manual','SIP/%s','channel','motionChannel','event','accept','EventManager','fax-interactions','reject','fax','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','contact','interface','rejectmessage','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','request','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxMessage,\x20%s,\x20%s','info','result','sendStatus','status','end','offset','undefined','count','Content-Range','apply','save','update','then','stack','send','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','name','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','find','body','describe','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes'];(function(_0x624f9d,_0x247eb5){var _0x391872=function(_0x39732f){while(--_0x39732f){_0x624f9d['push'](_0x624f9d['shift']());}};_0x391872(++_0x247eb5);}(_0x5a9e,0x14f));var _0xe5a9=function(_0x4e55a9,_0x241b22){_0x4e55a9=_0x4e55a9-0x0;var _0x4a9b67=_0x5a9e[_0x4e55a9];return _0x4a9b67;};'use strict';var emlformat=require(_0xe5a9('0x0'));var rimraf=require(_0xe5a9('0x1'));var zipdir=require(_0xe5a9('0x2'));var jsonpatch=require(_0xe5a9('0x3'));var rp=require(_0xe5a9('0x4'));var moment=require('moment');var BPromise=require(_0xe5a9('0x5'));var Mustache=require(_0xe5a9('0x6'));var util=require(_0xe5a9('0x7'));var path=require(_0xe5a9('0x8'));var sox=require(_0xe5a9('0x9'));var csv=require(_0xe5a9('0xa'));var ejs=require(_0xe5a9('0xb'));var fs=require('fs');var fs_extra=require(_0xe5a9('0xc'));var _=require('lodash');var squel=require(_0xe5a9('0xd'));var crypto=require(_0xe5a9('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe5a9('0xa'));var querystring=require(_0xe5a9('0xf'));var Papa=require(_0xe5a9('0x10'));var Redis=require('ioredis');var authService=require(_0xe5a9('0x11'));var qs=require(_0xe5a9('0x12'));var as=require(_0xe5a9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe5a9('0x14'))(_0xe5a9('0x15'));var utils=require(_0xe5a9('0x16'));var config=require(_0xe5a9('0x17'));var licenseUtil=require(_0xe5a9('0x18'));var db=require(_0xe5a9('0x19'))['db'];config[_0xe5a9('0x1a')]=_[_0xe5a9('0x1b')](config[_0xe5a9('0x1a')],{'host':_0xe5a9('0x1c'),'port':0x18eb});var socket=require(_0xe5a9('0x1d'))(new Redis(config['redis']));require(_0xe5a9('0x1e'))[_0xe5a9('0x1f')](socket);var jayson=require(_0xe5a9('0x20'));var client=jayson[_0xe5a9('0x21')][_0xe5a9('0x22')]({'port':0x232c});var client9002=jayson[_0xe5a9('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2fde77,_0x2cd745,_0x487f37,_0x59db7c){return new BPromise(function(_0x535388,_0x2ed69a){var _0x49f614=_0x59db7c||client;return _0x49f614[_0xe5a9('0x23')](_0x2fde77,_0x487f37)['then'](function(_0x3afbbe){logger['info']('FaxMessage,\x20%s,\x20%s',_0x2cd745,_0xe5a9('0x24'));logger[_0xe5a9('0x25')](_0xe5a9('0x26'),_0x2cd745,'request\x20sent',JSON[_0xe5a9('0x27')](_0x3afbbe));if(_0x3afbbe[_0xe5a9('0x28')]){if(_0x3afbbe[_0xe5a9('0x28')][_0xe5a9('0x29')]===0x1f4){logger[_0xe5a9('0x28')]('FaxMessage,\x20%s,\x20%s',_0x2cd745,_0x3afbbe[_0xe5a9('0x28')][_0xe5a9('0x2a')]);return _0x2ed69a(_0x3afbbe['error'][_0xe5a9('0x2a')]);}logger[_0xe5a9('0x28')](_0xe5a9('0x2b'),_0x2cd745,_0x3afbbe[_0xe5a9('0x28')][_0xe5a9('0x2a')]);return _0x535388(_0x3afbbe[_0xe5a9('0x28')][_0xe5a9('0x2a')]);}else{logger[_0xe5a9('0x2c')](_0xe5a9('0x2b'),_0x2cd745,_0xe5a9('0x24'));_0x535388(_0x3afbbe[_0xe5a9('0x2d')]['message']);}})['catch'](function(_0x26aff8){logger[_0xe5a9('0x28')](_0xe5a9('0x2b'),_0x2cd745,_0x26aff8);_0x2ed69a(_0x26aff8);});});}function respondWithStatusCode(_0x5abfd0,_0x5ede78){_0x5ede78=_0x5ede78||0xcc;return function(_0x21703f){if(_0x21703f){return _0x5abfd0[_0xe5a9('0x2e')](_0x5ede78);}return _0x5abfd0[_0xe5a9('0x2f')](_0x5ede78)[_0xe5a9('0x30')]();};}function respondWithResult(_0x505ae7,_0xfe0f83){_0xfe0f83=_0xfe0f83||0xc8;return function(_0x35e691){if(_0x35e691){return _0x505ae7[_0xe5a9('0x2f')](_0xfe0f83)['json'](_0x35e691);}};}function respondWithFilteredResult(_0x49d350,_0x58b822){return function(_0x8fcc1f){if(_0x8fcc1f){var _0x54b918=typeof _0x58b822[_0xe5a9('0x31')]===_0xe5a9('0x32')&&typeof _0x58b822['limit']===_0xe5a9('0x32');var _0x20763b=_0x8fcc1f['count'];var _0x8da9a8=_0x54b918?0x0:_0x58b822['offset'];var _0x2d577f=_0x54b918?_0x8fcc1f[_0xe5a9('0x33')]:_0x58b822[_0xe5a9('0x31')]+_0x58b822['limit'];var _0xbe90a6;if(_0x2d577f>=_0x20763b){_0x2d577f=_0x20763b;_0xbe90a6=0xc8;}else{_0xbe90a6=0xce;}_0x49d350[_0xe5a9('0x2f')](_0xbe90a6);return _0x49d350['set'](_0xe5a9('0x34'),_0x8da9a8+'-'+_0x2d577f+'/'+_0x20763b)['json'](_0x8fcc1f);}return null;};}function patchUpdates(_0x4da9ac){return function(_0x1bc70b){try{jsonpatch[_0xe5a9('0x35')](_0x1bc70b,_0x4da9ac,!![]);}catch(_0x2bfcb8){return BPromise['reject'](_0x2bfcb8);}return _0x1bc70b[_0xe5a9('0x36')]();};}function saveUpdates(_0xdb418f,_0x59d2ce){return function(_0x172d31){if(_0x172d31){return _0x172d31[_0xe5a9('0x37')](_0xdb418f)['then'](function(_0x716832){return _0x716832;});}return null;};}function removeEntity(_0x3a5339,_0x3ce521){return function(_0x6d901f){if(_0x6d901f){return _0x6d901f['destroy']()[_0xe5a9('0x38')](function(){_0x3a5339['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d05ac,_0x47d26b){return function(_0x216d0a){if(!_0x216d0a){_0x1d05ac[_0xe5a9('0x2e')](0x194);}return _0x216d0a;};}function handleError(_0x5c8dab,_0x2a35c3){_0x2a35c3=_0x2a35c3||0x1f4;return function(_0xbff474){logger[_0xe5a9('0x28')](_0xbff474[_0xe5a9('0x39')]);if(_0xbff474['name']){delete _0xbff474['name'];}_0x5c8dab[_0xe5a9('0x2f')](_0x2a35c3)[_0xe5a9('0x3a')](_0xbff474);};}exports[_0xe5a9('0x3b')]=function(_0x3573c6,_0x359f09){var _0x28cb8f={},_0x27f45a={},_0x5ce3c0={'count':0x0,'rows':[]};var _0x5bf3a2=_[_0xe5a9('0x3c')](db[_0xe5a9('0x3d')][_0xe5a9('0x3e')],function(_0x390f8f){return{'name':_0x390f8f[_0xe5a9('0x3f')],'type':_0x390f8f[_0xe5a9('0x40')][_0xe5a9('0x41')]};});_0x27f45a[_0xe5a9('0x42')]=_[_0xe5a9('0x3c')](_0x5bf3a2,_0xe5a9('0x43'));_0x27f45a['query']=_[_0xe5a9('0x44')](_0x3573c6[_0xe5a9('0x45')]);_0x27f45a['filters']=_['intersection'](_0x27f45a[_0xe5a9('0x42')],_0x27f45a[_0xe5a9('0x45')]);_0x28cb8f['attributes']=_[_0xe5a9('0x46')](_0x27f45a['model'],qs['fields'](_0x3573c6['query'][_0xe5a9('0x47')]));_0x28cb8f[_0xe5a9('0x48')]=_0x28cb8f['attributes'][_0xe5a9('0x49')]?_0x28cb8f[_0xe5a9('0x48')]:_0x27f45a[_0xe5a9('0x42')];if(!_0x3573c6[_0xe5a9('0x45')][_0xe5a9('0x4a')](_0xe5a9('0x4b'))){_0x28cb8f[_0xe5a9('0x4c')]=qs[_0xe5a9('0x4c')](_0x3573c6[_0xe5a9('0x45')][_0xe5a9('0x4c')]);_0x28cb8f[_0xe5a9('0x31')]=qs[_0xe5a9('0x31')](_0x3573c6['query'][_0xe5a9('0x31')]);}_0x28cb8f[_0xe5a9('0x4d')]=qs[_0xe5a9('0x4e')](_0x3573c6[_0xe5a9('0x45')][_0xe5a9('0x4e')]);_0x28cb8f[_0xe5a9('0x4f')]=qs[_0xe5a9('0x50')](_[_0xe5a9('0x51')](_0x3573c6['query'],_0x27f45a[_0xe5a9('0x50')]),_0x5bf3a2);if(_0x3573c6[_0xe5a9('0x45')][_0xe5a9('0x52')]){_0x28cb8f['where']=_[_0xe5a9('0x53')](_0x28cb8f[_0xe5a9('0x4f')],{'$or':_[_0xe5a9('0x3c')](_0x5bf3a2,function(_0x8fd38a){if(_0x8fd38a[_0xe5a9('0x40')]!=='VIRTUAL'){var _0x4fea2e={};_0x4fea2e[_0x8fd38a[_0xe5a9('0x43')]]={'$like':'%'+_0x3573c6['query'][_0xe5a9('0x52')]+'%'};return _0x4fea2e;}})});}_0x28cb8f=_[_0xe5a9('0x53')]({},_0x28cb8f,_0x3573c6['options']);var _0x483da8={'where':_0x28cb8f[_0xe5a9('0x4f')]};return db[_0xe5a9('0x3d')][_0xe5a9('0x33')](_0x483da8)[_0xe5a9('0x38')](function(_0x2ae0a6){_0x5ce3c0[_0xe5a9('0x33')]=_0x2ae0a6;if(_0x3573c6[_0xe5a9('0x45')][_0xe5a9('0x54')]){_0x28cb8f[_0xe5a9('0x55')]=[{'all':!![]}];}return db[_0xe5a9('0x3d')][_0xe5a9('0x56')](_0x28cb8f);})[_0xe5a9('0x38')](function(_0x5ef5bf){_0x5ce3c0[_0xe5a9('0x57')]=_0x5ef5bf;return _0x5ce3c0;})[_0xe5a9('0x38')](respondWithFilteredResult(_0x359f09,_0x28cb8f))[_0xe5a9('0x58')](handleError(_0x359f09,null));};exports[_0xe5a9('0x59')]=function(_0x23a1d6,_0x28f5ed){var _0x40bcf1={'raw':!![],'where':{'id':_0x23a1d6[_0xe5a9('0x5a')]['id']}},_0x393c06={};_0x393c06['model']=_['keys'](db['FaxMessage'][_0xe5a9('0x3e')]);_0x393c06[_0xe5a9('0x45')]=_[_0xe5a9('0x44')](_0x23a1d6[_0xe5a9('0x45')]);_0x393c06[_0xe5a9('0x50')]=_[_0xe5a9('0x46')](_0x393c06[_0xe5a9('0x42')],_0x393c06['query']);_0x40bcf1[_0xe5a9('0x48')]=_[_0xe5a9('0x46')](_0x393c06[_0xe5a9('0x42')],qs['fields'](_0x23a1d6[_0xe5a9('0x45')][_0xe5a9('0x47')]));_0x40bcf1[_0xe5a9('0x48')]=_0x40bcf1[_0xe5a9('0x48')][_0xe5a9('0x49')]?_0x40bcf1[_0xe5a9('0x48')]:_0x393c06[_0xe5a9('0x42')];if(_0x23a1d6[_0xe5a9('0x45')][_0xe5a9('0x54')]){_0x40bcf1[_0xe5a9('0x55')]=[{'all':!![]}];}_0x40bcf1=_['merge']({},_0x40bcf1,_0x23a1d6['options']);return db[_0xe5a9('0x3d')][_0xe5a9('0x5b')](_0x40bcf1)[_0xe5a9('0x38')](handleEntityNotFound(_0x28f5ed,null))['then'](respondWithResult(_0x28f5ed,null))[_0xe5a9('0x58')](handleError(_0x28f5ed,null));};exports[_0xe5a9('0x37')]=function(_0x2564fe,_0x3d4ded){if(_0x2564fe[_0xe5a9('0x5c')]['id']){delete _0x2564fe['body']['id'];}return db['FaxMessage'][_0xe5a9('0x5b')]({'where':{'id':_0x2564fe[_0xe5a9('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3d4ded,null))[_0xe5a9('0x38')](saveUpdates(_0x2564fe[_0xe5a9('0x5c')],null))['then'](respondWithResult(_0x3d4ded,null))[_0xe5a9('0x58')](handleError(_0x3d4ded,null));};exports['destroy']=function(_0x39613c,_0x55364f){return db[_0xe5a9('0x3d')][_0xe5a9('0x5b')]({'where':{'id':_0x39613c[_0xe5a9('0x5a')]['id']}})[_0xe5a9('0x38')](handleEntityNotFound(_0x55364f,null))['then'](removeEntity(_0x55364f,null))['catch'](handleError(_0x55364f,null));};exports[_0xe5a9('0x5d')]=function(_0x4477b1,_0x19a97c){return db[_0xe5a9('0x3d')][_0xe5a9('0x5d')]()[_0xe5a9('0x38')](respondWithResult(_0x19a97c,null))[_0xe5a9('0x58')](handleError(_0x19a97c,null));};var interaction_log=require(_0xe5a9('0x14'))('fax-interactions');exports['accept']=function(_0x5bd3be,_0x2a824c,_0x4a6792){var _0x4a86a1={'agent':{},'channel':'fax'};if(_0x5bd3be[_0xe5a9('0x5c')]['id']){delete _0x5bd3be[_0xe5a9('0x5c')]['id'];}_0x5bd3be[_0xe5a9('0x5c')][_0xe5a9('0x5e')]=!![];_0x5bd3be[_0xe5a9('0x5c')]['readAt']=moment()[_0xe5a9('0x5f')](_0xe5a9('0x60'));_0x5bd3be[_0xe5a9('0x5c')][_0xe5a9('0x61')]=_0x5bd3be[_0xe5a9('0x5c')][_0xe5a9('0x61')]||_0x5bd3be[_0xe5a9('0x62')]['id'];_0x4a86a1[_0xe5a9('0x63')]['id']=_0x5bd3be[_0xe5a9('0x5c')][_0xe5a9('0x61')];return db[_0xe5a9('0x3d')][_0xe5a9('0x5b')]({'where':{'id':_0x5bd3be[_0xe5a9('0x5a')]['id'],'UserId':null}})[_0xe5a9('0x38')](handleEntityNotFound(_0x2a824c,null))['then'](saveUpdates(_0x5bd3be[_0xe5a9('0x5c')],null))[_0xe5a9('0x38')](function(_0xde6619){if(_0xde6619){_0x4a86a1[_0xe5a9('0x2a')]=_0xde6619[_0xe5a9('0x64')]({'plain':!![]});return db[_0xe5a9('0x65')][_0xe5a9('0x5b')]({'where':{'id':_0xde6619[_0xe5a9('0x66')]}});}return null;})[_0xe5a9('0x38')](handleEntityNotFound(_0x2a824c,null))[_0xe5a9('0x38')](function(_0x461865){if(_0x461865){return _0x461865[_0xe5a9('0x37')]({'UserId':_0x5bd3be['body']['UserId'],'read1stAt':_[_0xe5a9('0x67')](_0x461865[_0xe5a9('0x68')])?moment()[_0xe5a9('0x5f')](_0xe5a9('0x60')):undefined});}return null;})['then'](function(_0x1a2f18){if(_0x1a2f18){_0x4a86a1[_0xe5a9('0x69')]=_0x1a2f18[_0xe5a9('0x64')]({'plain':!![]});interaction_log[_0xe5a9('0x2c')](_0xe5a9('0x6a'),_0x5bd3be[_0xe5a9('0x62')]['id'],_0x5bd3be['user'][_0xe5a9('0x43')],_0x5bd3be[_0xe5a9('0x62')][_0xe5a9('0x6b')],_0x4a86a1[_0xe5a9('0x69')]['id'],_0x5bd3be[_0xe5a9('0x5c')]?JSON[_0xe5a9('0x27')](_0x5bd3be[_0xe5a9('0x5c')]):_0xe5a9('0x6c'));return respondWithRpcPromise(_0xe5a9('0x6d'),_0xe5a9('0x6e'),_0x4a86a1);}return null;})[_0xe5a9('0x38')](function(_0x296df0){var _0x3002f2=_0xe5a9('0x6f')+_0x296df0[_0xe5a9('0x2a')][_0xe5a9('0x70')];return db[_0xe5a9('0x71')]['query'](_0x3002f2,{'type':db['Sequelize'][_0xe5a9('0x72')]['SELECT'],'raw':!![]})[_0xe5a9('0x38')](function(_0x4141b1){return _0x4141b1;});})[_0xe5a9('0x38')](function(_0x4bc232){if(_0x4bc232){_0x4a86a1[_0xe5a9('0x2a')]['contact']=_0x4bc232[0x0];if(!_0x5bd3be[_0xe5a9('0x5c')][_0xe5a9('0x61')])return;return db[_0xe5a9('0x73')][_0xe5a9('0x5b')]({'where':{'id':_0x5bd3be['body'][_0xe5a9('0x61')],'role':'agent'},'attributes':['id',_0xe5a9('0x43'),_0xe5a9('0x74'),_0xe5a9('0x75'),_0xe5a9('0x76')],'raw':!![]});}return null;})[_0xe5a9('0x38')](function(_0x2fa23f){if(!_0x2fa23f)return null;_0x4a86a1['message'][_0xe5a9('0x63')]=_0x2fa23f;return _0x4a86a1;})['then'](function(_0x27e94e){if(_0x27e94e){if(_0x5bd3be[_0xe5a9('0x5c')][_0xe5a9('0x77')]){_0x4a86a1['message']['interface']=util[_0xe5a9('0x5f')](_0xe5a9('0x78'),_0x5bd3be[_0xe5a9('0x62')][_0xe5a9('0x43')]);_0x4a86a1[_0xe5a9('0x2a')][_0xe5a9('0x79')]=_0x4a86a1[_0xe5a9('0x79')];_0x4a86a1[_0xe5a9('0x2a')][_0xe5a9('0x7a')]=_0x4a86a1[_0xe5a9('0x79')];_0x4a86a1[_0xe5a9('0x2a')][_0xe5a9('0x7b')]=_0xe5a9('0x7c');return respondWithRpcPromise('EventManager',_0xe5a9('0x7d'),{'event':'acceptmessage','message':_0x4a86a1[_0xe5a9('0x2a')]},client9002)[_0xe5a9('0x38')](function(){return _0x4a86a1;});}return _0x4a86a1;}return null;})[_0xe5a9('0x38')](respondWithResult(_0x2a824c,null))[_0xe5a9('0x58')](handleError(_0x2a824c,null));};var interaction_log=require(_0xe5a9('0x14'))(_0xe5a9('0x7e'));exports[_0xe5a9('0x7f')]=function(_0x29a826,_0x130fbc,_0x19e41e){var _0x4a474b={'agent':{},'channel':_0xe5a9('0x80')};if(_0x29a826[_0xe5a9('0x5c')]['id']){delete _0x29a826['body']['id'];}_0x29a826['body']['UserId']=_0x29a826[_0xe5a9('0x5c')][_0xe5a9('0x61')]||_0x29a826[_0xe5a9('0x62')]['id'];_0x4a474b[_0xe5a9('0x63')]['id']=_0x29a826[_0xe5a9('0x5c')][_0xe5a9('0x61')];return db[_0xe5a9('0x3d')][_0xe5a9('0x5b')]({'where':{'id':_0x29a826['params']['id'],'UserId':null}})[_0xe5a9('0x38')](handleEntityNotFound(_0x130fbc,null))[_0xe5a9('0x38')](function(_0xe2688){if(_0xe2688){_0x4a474b[_0xe5a9('0x2a')]=_0xe2688[_0xe5a9('0x64')]({'plain':!![]});return db['FaxInteraction'][_0xe5a9('0x5b')]({'where':{'id':_0xe2688[_0xe5a9('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x130fbc,null))[_0xe5a9('0x38')](function(_0x3e1002){if(_0x3e1002){_0x4a474b[_0xe5a9('0x69')]=_0x3e1002[_0xe5a9('0x64')]({'plain':!![]});interaction_log['info'](_0xe5a9('0x81'),_0x29a826[_0xe5a9('0x62')]['id'],_0x29a826[_0xe5a9('0x62')][_0xe5a9('0x43')],_0x29a826[_0xe5a9('0x62')][_0xe5a9('0x6b')],_0x4a474b['interaction']['id'],_0x29a826[_0xe5a9('0x5c')]?JSON[_0xe5a9('0x27')](_0x29a826[_0xe5a9('0x5c')]):_0xe5a9('0x6c'));return respondWithRpcPromise(_0xe5a9('0x82'),_0xe5a9('0x83'),_0x4a474b);}return null;})['then'](function(_0x490f86){var _0x5ef21d=_0xe5a9('0x6f')+_0x490f86[_0xe5a9('0x2a')][_0xe5a9('0x70')];return db['sequelize'][_0xe5a9('0x45')](_0x5ef21d,{'type':db['Sequelize'][_0xe5a9('0x72')][_0xe5a9('0x84')],'raw':!![]})[_0xe5a9('0x38')](function(_0x485a4e){return _0x485a4e;});})['then'](function(_0x187ed4){if(_0x187ed4){_0x4a474b['message'][_0xe5a9('0x85')]=_0x187ed4[0x0];if(!_0x29a826[_0xe5a9('0x5c')]['UserId'])return;return db['User'][_0xe5a9('0x5b')]({'where':{'id':_0x29a826[_0xe5a9('0x5c')][_0xe5a9('0x61')],'role':_0xe5a9('0x63')},'attributes':['id',_0xe5a9('0x43'),_0xe5a9('0x74'),_0xe5a9('0x75'),_0xe5a9('0x76')],'raw':!![]});}return null;})[_0xe5a9('0x38')](function(_0x35bea5){if(!_0x35bea5)return null;_0x4a474b[_0xe5a9('0x2a')][_0xe5a9('0x63')]=_0x35bea5;return _0x4a474b;})[_0xe5a9('0x38')](function(_0x25e279){if(_0x25e279){_0x25e279['message'][_0xe5a9('0x86')]=util[_0xe5a9('0x5f')](_0xe5a9('0x78'),_0x29a826[_0xe5a9('0x62')][_0xe5a9('0x43')]);_0x25e279['message']['channel']=_0x4a474b['channel'];_0x25e279[_0xe5a9('0x2a')][_0xe5a9('0x7a')]=_0x4a474b[_0xe5a9('0x79')];_0x25e279[_0xe5a9('0x2a')]['event']='reject';respondWithRpcPromise('EventManager',_0xe5a9('0x7d'),{'event':_0xe5a9('0x87'),'message':_0x25e279[_0xe5a9('0x2a')]},client9002);return _0x4a474b;}return null;})[_0xe5a9('0x38')](respondWithResult(_0x130fbc,null))[_0xe5a9('0x58')](handleError(_0x130fbc,null));};exports[_0xe5a9('0x88')]=function(_0x16ab05,_0x305e6e){var _0x7cb46a;return db[_0xe5a9('0x3d')][_0xe5a9('0x88')](_0x16ab05[_0xe5a9('0x5c')],{})[_0xe5a9('0x38')](function(_0x45977b){_0x7cb46a=_0x45977b;return db[_0xe5a9('0x89')][_0xe5a9('0x8a')]({'where':{'id':_0x7cb46a[_0xe5a9('0x70')]}});})[_0xe5a9('0x38')](function(_0x37b615){if(_[_0xe5a9('0x67')](_0x37b615)){return;}else{_0x7cb46a['fax']=_0x37b615[_0xe5a9('0x80')];return db[_0xe5a9('0x8b')][_0xe5a9('0x8a')]({'where':{'id':_0x7cb46a[_0xe5a9('0x8c')]}});}})[_0xe5a9('0x38')](function(_0x2d4875){return respondWithRpcPromise('SendFax',_0xe5a9('0x8d'),{'FaxAccountId':_[_0xe5a9('0x67')](_0x16ab05['body'])?undefined:_0x16ab05['body'][_0xe5a9('0x8e')],'path':_[_0xe5a9('0x67')](_0x2d4875)?undefined:util[_0xe5a9('0x5f')](_0xe5a9('0x8f'),_0x2d4875[_0xe5a9('0x90')]),'fax':_[_0xe5a9('0x67')](_0x7cb46a['fax'])?undefined:_0x7cb46a[_0xe5a9('0x80')],'AttachmentId':_0x7cb46a[_0xe5a9('0x8c')]},client9002);})['then'](respondWithResult(_0x305e6e,0xc9))[_0xe5a9('0x58')](handleError(_0x305e6e,null));};exports[_0xe5a9('0x91')]=function(_0x1383cb,_0x40991a){var _0x3e7588=path[_0xe5a9('0x92')](config[_0xe5a9('0x93')],_0xe5a9('0x94'),_0xe5a9('0x95'),'attachments');return db[_0xe5a9('0x3d')]['find']({'where':{'id':_0x1383cb['params']['id']},'include':[{'model':db[_0xe5a9('0x8b')],'as':_0xe5a9('0x8b')}]})[_0xe5a9('0x38')](handleEntityNotFound(_0x40991a,null))[_0xe5a9('0x38')](function(_0x1cdc83){if(_0x1cdc83){return _0x40991a[_0xe5a9('0x91')](path[_0xe5a9('0x92')](_0x3e7588,_0x1cdc83['Attachment'][_0xe5a9('0x90')]));}})['catch'](handleError(_0x40991a,null));};
\ No newline at end of file
index 2f18d50..23ac9b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x77a9=['hasOwnProperty','events','FaxMessage','save','update','remove','emit'];(function(_0x10b474,_0x3edb89){var _0x22e3e3=function(_0x18af4f){while(--_0x18af4f){_0x10b474['push'](_0x10b474['shift']());}};_0x22e3e3(++_0x3edb89);}(_0x77a9,0x19e));var _0x977a=function(_0x3a7cac,_0x1db945){_0x3a7cac=_0x3a7cac-0x0;var _0x32ca4e=_0x77a9[_0x3a7cac];return _0x32ca4e;};'use strict';var EventEmitter=require(_0x977a('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x977a('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x977a('0x2'),'afterUpdate':_0x977a('0x3'),'afterDestroy':_0x977a('0x4')};function emitEvent(_0x368664){return function(_0x520cd7,_0x318fc8,_0xb755){FaxMessageEvents[_0x977a('0x5')](_0x368664+':'+_0x520cd7['id'],_0x520cd7);FaxMessageEvents[_0x977a('0x5')](_0x368664,_0x520cd7);_0xb755(null);};}for(var e in events){if(events[_0x977a('0x6')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module['exports']=FaxMessageEvents;
\ No newline at end of file
+var _0xaf11=['setMaxListeners','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','FaxMessage'];(function(_0xaaf4cb,_0x41ad8f){var _0x333511=function(_0xbf7db6){while(--_0xbf7db6){_0xaaf4cb['push'](_0xaaf4cb['shift']());}};_0x333511(++_0x41ad8f);}(_0xaf11,0x12f));var _0x1af1=function(_0x241f1f,_0x30114a){_0x241f1f=_0x241f1f-0x0;var _0x3ea751=_0xaf11[_0x241f1f];return _0x3ea751;};'use strict';var EventEmitter=require(_0x1af1('0x0'));var FaxMessage=require(_0x1af1('0x1'))['db'][_0x1af1('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x1af1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1af1('0x4'),'afterDestroy':_0x1af1('0x5')};function emitEvent(_0x28842d){return function(_0x53af48,_0xb0ace,_0x12eead){FaxMessageEvents[_0x1af1('0x6')](_0x28842d+':'+_0x53af48['id'],_0x53af48);FaxMessageEvents['emit'](_0x28842d,_0x53af48);_0x12eead(null);};}for(var e in events){if(events[_0x1af1('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x1af1('0x8')]=FaxMessageEvents;
\ No newline at end of file
index f9c34ad..6d23af6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb945=['out','isNil','FaxInteraction','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./faxMessage.attributes','define','fax_messages','fti_fax_messages','body','get','direction','toLowerCase'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb945,0x19a));var _0x5b94=function(_0x58ff4c,_0x320115){_0x58ff4c=_0x58ff4c-0x0;var _0x2a49df=_0xb945[_0x58ff4c];return _0x2a49df;};'use strict';var _=require('lodash');var util=require(_0x5b94('0x0'));var logger=require(_0x5b94('0x1'))(_0x5b94('0x2'));var moment=require(_0x5b94('0x3'));var BPromise=require('bluebird');var rp=require(_0x5b94('0x4'));var fs=require('fs');var path=require(_0x5b94('0x5'));var rimraf=require('rimraf');var config=require(_0x5b94('0x6'));var attributes=require(_0x5b94('0x7'));module['exports']=function(_0x4d3faf,_0x348cb0){return _0x4d3faf[_0x5b94('0x8')]('FaxMessage',attributes,{'tableName':_0x5b94('0x9'),'paranoid':![],'indexes':[{'name':_0x5b94('0xa'),'fields':[_0x5b94('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x46dbda,_0x36e3a5,_0x4552bf){var _0xa32a4e=_0x4d3faf['models'];var _0x2c6779=_0x46dbda[_0x5b94('0xc')]({'plain':!![]});if(_0x2c6779[_0x5b94('0xd')][_0x5b94('0xe')]()==='in'||_0x2c6779[_0x5b94('0xd')][_0x5b94('0xe')]()===_0x5b94('0xf')&&!_0x2c6779['secret']&&!_[_0x5b94('0x10')](_0x2c6779['UserId'])){_0xa32a4e[_0x5b94('0x11')]['findOne']({'where':{'id':_0x2c6779[_0x5b94('0x12')]}})[_0x5b94('0x13')](function(_0x42559c){if(_0x42559c){_0x42559c[_0x5b94('0x14')]({'lastMsgAt':_0x2c6779[_0x5b94('0x15')],'lastMsgDirection':_0x2c6779[_0x5b94('0xd')][_0x5b94('0xe')]()});}})[_0x5b94('0x16')](function(_0x1bd2d8){console[_0x5b94('0x17')](_0x1bd2d8);});}_0x4552bf();}},'charset':_0x5b94('0x18'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xc9cd=['out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','body','FULLTEXT','models','get','direction','toLowerCase'];(function(_0x531c45,_0x582a68){var _0x1c6cd0=function(_0x221b93){while(--_0x221b93){_0x531c45['push'](_0x531c45['shift']());}};_0x1c6cd0(++_0x582a68);}(_0xc9cd,0xc8));var _0xdc9c=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0xc9cd[_0x46ae5a];return _0x434986;};'use strict';var _=require(_0xdc9c('0x0'));var util=require(_0xdc9c('0x1'));var logger=require('../../config/logger')(_0xdc9c('0x2'));var moment=require('moment');var BPromise=require(_0xdc9c('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc9c('0x4'));var rimraf=require(_0xdc9c('0x5'));var config=require(_0xdc9c('0x6'));var attributes=require(_0xdc9c('0x7'));module[_0xdc9c('0x8')]=function(_0x3e0cd5,_0x54c650){return _0x3e0cd5[_0xdc9c('0x9')](_0xdc9c('0xa'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0xdc9c('0xb')],'type':_0xdc9c('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x32e671,_0x38b492,_0x2400f8){var _0x374022=_0x3e0cd5[_0xdc9c('0xd')];var _0x3c9f94=_0x32e671[_0xdc9c('0xe')]({'plain':!![]});if(_0x3c9f94[_0xdc9c('0xf')][_0xdc9c('0x10')]()==='in'||_0x3c9f94[_0xdc9c('0xf')]['toLowerCase']()===_0xdc9c('0x11')&&!_0x3c9f94[_0xdc9c('0x12')]&&!_[_0xdc9c('0x13')](_0x3c9f94[_0xdc9c('0x14')])){_0x374022[_0xdc9c('0x15')][_0xdc9c('0x16')]({'where':{'id':_0x3c9f94[_0xdc9c('0x17')]}})[_0xdc9c('0x18')](function(_0x47f3a4){if(_0x47f3a4){_0x47f3a4[_0xdc9c('0x19')]({'lastMsgAt':_0x3c9f94[_0xdc9c('0x1a')],'lastMsgDirection':_0x3c9f94['direction'][_0xdc9c('0x10')]()});}})[_0xdc9c('0x1b')](function(_0x20aa28){console[_0xdc9c('0x1c')](_0x20aa28);});}_0x2400f8();}},'charset':_0xdc9c('0x1d'),'collate':_0xdc9c('0x1e')});};
\ No newline at end of file
index 589d43e..f2e8246 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x6999ff,_0x448788){_0x6999ff=_0x6999ff-0x0;var _0x16a187=_0x5fd1[_0x6999ff];return _0x16a187;};'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
+var _0x668b=['./faxMessage.socket','register','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateFaxMessage','FaxMessage','create','body','raw','UpdateFaxMessage','update','options','where','attributes','limit','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost'];(function(_0x35ab84,_0x5ac05e){var _0x41147c=function(_0x16636c){while(--_0x16636c){_0x35ab84['push'](_0x35ab84['shift']());}};_0x41147c(++_0x5ac05e);}(_0x668b,0x140));var _0xb668=function(_0x38854e,_0x23cbc9){_0x38854e=_0x38854e-0x0;var _0x3f8415=_0x668b[_0x38854e];return _0x3f8415;};'use strict';var _=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var moment=require('moment');var BPromise=require(_0xb668('0x2'));var rs=require(_0xb668('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb668('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb668('0x5'))(_0xb668('0x6'));var config=require(_0xb668('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb668('0x8')][_0xb668('0x9')]({'port':0x232a});config[_0xb668('0xa')]=_[_0xb668('0xb')](config[_0xb668('0xa')],{'host':_0xb668('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb668('0xa')]));require(_0xb668('0xd'))[_0xb668('0xe')](socket);function respondWithRpcPromise(_0x16d50d,_0x39b79c,_0x3606a7){return new BPromise(function(_0x45bc39,_0x3616e9){return client['request'](_0x16d50d,_0x3606a7)[_0xb668('0xf')](function(_0x27dbf7){logger[_0xb668('0x10')](_0xb668('0x11'),_0x39b79c,_0xb668('0x12'));logger[_0xb668('0x13')](_0xb668('0x14'),_0x39b79c,_0xb668('0x12'),JSON[_0xb668('0x15')](_0x27dbf7));if(_0x27dbf7[_0xb668('0x16')]){if(_0x27dbf7[_0xb668('0x16')][_0xb668('0x17')]===0x1f4){logger[_0xb668('0x16')](_0xb668('0x11'),_0x39b79c,_0x27dbf7[_0xb668('0x16')][_0xb668('0x18')]);return _0x3616e9(_0x27dbf7[_0xb668('0x16')][_0xb668('0x18')]);}logger[_0xb668('0x16')](_0xb668('0x11'),_0x39b79c,_0x27dbf7[_0xb668('0x16')][_0xb668('0x18')]);return _0x45bc39(_0x27dbf7['error'][_0xb668('0x18')]);}else{logger['info'](_0xb668('0x11'),_0x39b79c,_0xb668('0x12'));_0x45bc39(_0x27dbf7['result'][_0xb668('0x18')]);}})[_0xb668('0x19')](function(_0x53ff78){logger[_0xb668('0x16')]('FaxMessage,\x20%s,\x20%s',_0x39b79c,_0x53ff78);_0x3616e9(_0x53ff78);});});}exports[_0xb668('0x1a')]=function(_0x178a5d){var _0x253ba5=this;return new Promise(function(_0x12805a,_0x5d33ae){return db[_0xb668('0x1b')][_0xb668('0x1c')](_0x178a5d[_0xb668('0x1d')],{'raw':_0x178a5d['options']?_0x178a5d['options'][_0xb668('0x1e')]===undefined?!![]:![]:!![]})[_0xb668('0xf')](function(_0x517eee){logger[_0xb668('0x10')]('CreateFaxMessage',_0x178a5d);logger[_0xb668('0x13')]('CreateFaxMessage',_0x178a5d,JSON[_0xb668('0x15')](_0x517eee));_0x12805a(_0x517eee);})[_0xb668('0x19')](function(_0x3f84c7){logger[_0xb668('0x16')](_0xb668('0x1a'),_0x3f84c7[_0xb668('0x18')],_0x178a5d);_0x5d33ae(_0x253ba5['error'](0x1f4,_0x3f84c7[_0xb668('0x18')]));});});};exports[_0xb668('0x1f')]=function(_0x2ab8c2){var _0x49abfd=this;return new Promise(function(_0x5e0cee,_0xe62fce){return db[_0xb668('0x1b')][_0xb668('0x20')](_0x2ab8c2['body'],{'raw':_0x2ab8c2[_0xb668('0x21')]?_0x2ab8c2[_0xb668('0x21')][_0xb668('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ab8c2['options']?_0x2ab8c2['options'][_0xb668('0x22')]||null:null,'attributes':_0x2ab8c2[_0xb668('0x21')]?_0x2ab8c2['options'][_0xb668('0x23')]||null:null,'limit':_0x2ab8c2[_0xb668('0x21')]?_0x2ab8c2[_0xb668('0x21')][_0xb668('0x24')]||null:null})[_0xb668('0xf')](function(_0x5f36b5){logger[_0xb668('0x10')](_0xb668('0x1f'),_0x2ab8c2);logger['debug'](_0xb668('0x1f'),_0x2ab8c2,JSON['stringify'](_0x5f36b5));_0x5e0cee(_0x5f36b5);})[_0xb668('0x19')](function(_0x406cc5){logger[_0xb668('0x16')](_0xb668('0x1f'),_0x406cc5[_0xb668('0x18')],_0x2ab8c2);_0xe62fce(_0x49abfd[_0xb668('0x16')](0x1f4,_0x406cc5[_0xb668('0x18')]));});});};
\ No newline at end of file
index 4c6844c..268f69f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe543=['remove','emit','removeListener','register','length','faxMessage:','./faxMessage.events','save'];(function(_0xb205d4,_0x3594e4){var _0x4f80d5=function(_0x463f52){while(--_0x463f52){_0xb205d4['push'](_0xb205d4['shift']());}};_0x4f80d5(++_0x3594e4);}(_0xe543,0xbe));var _0x3e54=function(_0x1170db,_0x1f061a){_0x1170db=_0x1170db-0x0;var _0x16e575=_0xe543[_0x1170db];return _0x16e575;};'use strict';var FaxMessageEvents=require(_0x3e54('0x0'));var events=[_0x3e54('0x1'),_0x3e54('0x2'),'update'];function createListener(_0x46c073,_0x45d5f0){return function(_0x3b77ea){_0x45d5f0[_0x3e54('0x3')](_0x46c073,_0x3b77ea);};}function removeListener(_0x161cdf,_0x1f205a){return function(){FaxMessageEvents[_0x3e54('0x4')](_0x161cdf,_0x1f205a);};}exports[_0x3e54('0x5')]=function(_0x22992b){for(var _0x5a3e74=0x0,_0x4685df=events[_0x3e54('0x6')];_0x5a3e74<_0x4685df;_0x5a3e74++){var _0x2d1697=events[_0x5a3e74];var _0x58fa93=createListener(_0x3e54('0x7')+_0x2d1697,_0x22992b);FaxMessageEvents['on'](_0x2d1697,_0x58fa93);}};
\ No newline at end of file
+var _0xf596=['remove','update','emit','removeListener','register','faxMessage:','./faxMessage.events'];(function(_0x1ce7cf,_0x1706be){var _0x38fe5a=function(_0x55c697){while(--_0x55c697){_0x1ce7cf['push'](_0x1ce7cf['shift']());}};_0x38fe5a(++_0x1706be);}(_0xf596,0xa7));var _0x6f59=function(_0x69d5f7,_0x4a8637){_0x69d5f7=_0x69d5f7-0x0;var _0x27fb58=_0xf596[_0x69d5f7];return _0x27fb58;};'use strict';var FaxMessageEvents=require(_0x6f59('0x0'));var events=['save',_0x6f59('0x1'),_0x6f59('0x2')];function createListener(_0x2a52a3,_0x25e9ce){return function(_0x231704){_0x25e9ce[_0x6f59('0x3')](_0x2a52a3,_0x231704);};}function removeListener(_0x44bc11,_0x1346aa){return function(){FaxMessageEvents[_0x6f59('0x4')](_0x44bc11,_0x1346aa);};}exports[_0x6f59('0x5')]=function(_0x5d0e52){for(var _0x560d56=0x0,_0x2156ff=events['length'];_0x560d56<_0x2156ff;_0x560d56++){var _0x4ce470=events[_0x560d56];var _0x15e841=createListener(_0x6f59('0x6')+_0x4ce470,_0x5d0e52);FaxMessageEvents['on'](_0x4ce470,_0x15e841);}};
\ No newline at end of file
index c478ef7..219e041 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97c1=['isAuthenticated','/:id','show','/:id/download','post','tracked','fax','faxmessage:create','put','update','/:id/accept','accept','/:id/reject','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','index','get','/describe'];(function(_0xe30f2d,_0x401070){var _0x50ee29=function(_0x423795){while(--_0x423795){_0xe30f2d['push'](_0xe30f2d['shift']());}};_0x50ee29(++_0x401070);}(_0x97c1,0xdf));var _0x197c=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x97c1[_0x4a9fb1];return _0x348672;};'use strict';var multer=require(_0x197c('0x0'));var util=require(_0x197c('0x1'));var path=require('path');var timeout=require(_0x197c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x197c('0x3'));var auth=require(_0x197c('0x4'));var interaction=require(_0x197c('0x5'));var config=require(_0x197c('0x6'));var controller=require(_0x197c('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x197c('0x8')]);router[_0x197c('0x9')](_0x197c('0xa'),auth[_0x197c('0xb')](),controller['describe']);router['get'](_0x197c('0xc'),auth['isAuthenticated'](),controller[_0x197c('0xd')]);router[_0x197c('0x9')](_0x197c('0xe'),auth[_0x197c('0xb')](),controller['download']);router[_0x197c('0xf')]('/',auth[_0x197c('0xb')](),interaction[_0x197c('0x10')](_0x197c('0x11'),_0x197c('0x12')),controller['create']);router[_0x197c('0x13')](_0x197c('0xc'),auth[_0x197c('0xb')](),controller[_0x197c('0x14')]);router['put'](_0x197c('0x15'),auth[_0x197c('0xb')](),controller[_0x197c('0x16')]);router[_0x197c('0x13')](_0x197c('0x17'),auth[_0x197c('0xb')](),controller['reject']);router['delete'](_0x197c('0xc'),auth[_0x197c('0xb')](),controller[_0x197c('0x18')]);module[_0x197c('0x19')]=router;
\ No newline at end of file
+var _0x3c81=['show','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','reject','destroy','exports','multer','util','connect-timeout','express','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3db712,_0x2b5b30){var _0x4b4e6b=function(_0x2b1bfb){while(--_0x2b1bfb){_0x3db712['push'](_0x3db712['shift']());}};_0x4b4e6b(++_0x2b5b30);}(_0x3c81,0x102));var _0x13c8=function(_0x3bb8cb,_0x42ab45){_0x3bb8cb=_0x3bb8cb-0x0;var _0x4240d8=_0x3c81[_0x3bb8cb];return _0x4240d8;};'use strict';var multer=require(_0x13c8('0x0'));var util=require(_0x13c8('0x1'));var path=require('path');var timeout=require(_0x13c8('0x2'));var express=require(_0x13c8('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x13c8('0x4'));var controller=require(_0x13c8('0x5'));router[_0x13c8('0x6')]('/',auth[_0x13c8('0x7')](),controller[_0x13c8('0x8')]);router[_0x13c8('0x6')](_0x13c8('0x9'),auth['isAuthenticated'](),controller[_0x13c8('0xa')]);router['get'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xc')]);router[_0x13c8('0x6')](_0x13c8('0xd'),auth[_0x13c8('0x7')](),controller[_0x13c8('0xe')]);router[_0x13c8('0xf')]('/',auth[_0x13c8('0x7')](),interaction[_0x13c8('0x10')](_0x13c8('0x11'),_0x13c8('0x12')),controller[_0x13c8('0x13')]);router[_0x13c8('0x14')]('/:id',auth[_0x13c8('0x7')](),controller[_0x13c8('0x15')]);router[_0x13c8('0x14')](_0x13c8('0x16'),auth['isAuthenticated'](),controller[_0x13c8('0x17')]);router['put']('/:id/reject',auth['isAuthenticated'](),controller[_0x13c8('0x18')]);router['delete'](_0x13c8('0xb'),auth[_0x13c8('0x7')](),controller[_0x13c8('0x19')]);module[_0x13c8('0x1a')]=router;
\ No newline at end of file
index ec9919f..38432cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c0c=['beepall','sequelize','exports','name','INTEGER','ENUM','rrmemory'];(function(_0x2c224a,_0x36b3fa){var _0x34942e=function(_0x4cf882){while(--_0x4cf882){_0x2c224a['push'](_0x2c224a['shift']());}};_0x34942e(++_0x36b3fa);}(_0x4c0c,0xef));var _0xc4c0=function(_0x3330b8,_0x19b32a){_0x3330b8=_0x3330b8-0x0;var _0x191799=_0x4c0c[_0x3330b8];return _0x191799;};'use strict';var Sequelize=require(_0xc4c0('0x0'));module[_0xc4c0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc4c0('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xc4c0('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc4c0('0x4')](_0xc4c0('0x5'),_0xc4c0('0x6'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xcfa8=['exports','name','STRING','INTEGER','ENUM','beepall','sequelize'];(function(_0x50175e,_0x354248){var _0x232fb2=function(_0x739897){while(--_0x739897){_0x50175e['push'](_0x50175e['shift']());}};_0x232fb2(++_0x354248);}(_0xcfa8,0xdf));var _0x8cfa=function(_0x306420,_0x302471){_0x306420=_0x306420-0x0;var _0x5d38d3=_0xcfa8[_0x306420];return _0x5d38d3;};'use strict';var Sequelize=require(_0x8cfa('0x0'));module[_0x8cfa('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x8cfa('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8cfa('0x3')]},'timeout':{'type':Sequelize[_0x8cfa('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8cfa('0x5')]('rrmemory',_0x8cfa('0x6'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x8cfa('0x4')],'defaultValue':0x0}};
\ No newline at end of file
index e2fb6a4..b9e0895 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27b1=['util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','save','then','destroy','get','UserProfileResource','error','stack','name','index','FaxQueue','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','fields','attributes','nolimit','offset','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','length','find','create','user','role','FaxQueues','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','findOne','UserFaxQueue','FaxQueueId','User','findAndCountAll','agent','faxPause','updatedAt','createdAt','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','forEach','emit','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x2932cf,_0x362fd9){var _0x1711dd=function(_0x2d8de6){while(--_0x2d8de6){_0x2932cf['push'](_0x2932cf['shift']());}};_0x1711dd(++_0x362fd9);}(_0x27b1,0x117));var _0x127b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x27b1[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x127b('0x0'));var rimraf=require(_0x127b('0x1'));var zipdir=require(_0x127b('0x2'));var jsonpatch=require(_0x127b('0x3'));var rp=require(_0x127b('0x4'));var moment=require(_0x127b('0x5'));var BPromise=require(_0x127b('0x6'));var Mustache=require('mustache');var util=require(_0x127b('0x7'));var path=require(_0x127b('0x8'));var sox=require(_0x127b('0x9'));var csv=require(_0x127b('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x127b('0xb'));var _=require(_0x127b('0xc'));var squel=require(_0x127b('0xd'));var crypto=require(_0x127b('0xe'));var jsforce=require(_0x127b('0xf'));var deskjs=require(_0x127b('0x10'));var toCsv=require(_0x127b('0xa'));var querystring=require(_0x127b('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x127b('0x12'));var as=require(_0x127b('0x13'));var hardwareService=require(_0x127b('0x14'));var logger=require('../../config/logger')(_0x127b('0x15'));var utils=require('../../config/utils');var config=require(_0x127b('0x16'));var licenseUtil=require(_0x127b('0x17'));var db=require(_0x127b('0x18'))['db'];config[_0x127b('0x19')]=_[_0x127b('0x1a')](config[_0x127b('0x19')],{'host':_0x127b('0x1b'),'port':0x18eb});var socket=require(_0x127b('0x1c'))(new Redis(config[_0x127b('0x19')]));require(_0x127b('0x1d'))[_0x127b('0x1e')](socket);function respondWithStatusCode(_0x5f3be5,_0x280501){_0x280501=_0x280501||0xcc;return function(_0x18f2e3){if(_0x18f2e3){return _0x5f3be5[_0x127b('0x1f')](_0x280501);}return _0x5f3be5[_0x127b('0x20')](_0x280501)[_0x127b('0x21')]();};}function respondWithResult(_0x34a9c9,_0x588471){_0x588471=_0x588471||0xc8;return function(_0x5ad5a1){if(_0x5ad5a1){return _0x34a9c9[_0x127b('0x20')](_0x588471)[_0x127b('0x22')](_0x5ad5a1);}};}function respondWithFilteredResult(_0xf6078c,_0x2101b8){return function(_0x242e09){if(_0x242e09){var _0x5d18e0=typeof _0x2101b8['offset']===_0x127b('0x23')&&typeof _0x2101b8[_0x127b('0x24')]===_0x127b('0x23');var _0x31d17a=_0x242e09[_0x127b('0x25')];var _0x19c789=_0x5d18e0?0x0:_0x2101b8['offset'];var _0x3be5c4=_0x5d18e0?_0x242e09['count']:_0x2101b8['offset']+_0x2101b8[_0x127b('0x24')];var _0xb13eb3;if(_0x3be5c4>=_0x31d17a){_0x3be5c4=_0x31d17a;_0xb13eb3=0xc8;}else{_0xb13eb3=0xce;}_0xf6078c[_0x127b('0x20')](_0xb13eb3);return _0xf6078c[_0x127b('0x26')](_0x127b('0x27'),_0x19c789+'-'+_0x3be5c4+'/'+_0x31d17a)[_0x127b('0x22')](_0x242e09);}return null;};}function patchUpdates(_0x37dbbb){return function(_0x538ee1){try{jsonpatch['apply'](_0x538ee1,_0x37dbbb,!![]);}catch(_0x883501){return BPromise['reject'](_0x883501);}return _0x538ee1[_0x127b('0x28')]();};}function saveUpdates(_0x12a5bc,_0x44646d){return function(_0x5767ee){if(_0x5767ee){return _0x5767ee['update'](_0x12a5bc)[_0x127b('0x29')](function(_0x3f9e03){return _0x3f9e03;});}return null;};}function removeEntity(_0x25958c,_0x2395d6){return function(_0x509512){if(_0x509512){return _0x509512[_0x127b('0x2a')]()[_0x127b('0x29')](function(){var _0x8d581d=_0x509512[_0x127b('0x2b')]({'plain':!![]});var _0x5b30f7='FaxQueues';return db[_0x127b('0x2c')][_0x127b('0x2a')]({'where':{'type':_0x5b30f7,'resourceId':_0x8d581d['id']}})[_0x127b('0x29')](function(){return _0x509512;});})[_0x127b('0x29')](function(){_0x25958c['status'](0xcc)[_0x127b('0x21')]();});}};}function handleEntityNotFound(_0x34f165,_0x239407){return function(_0x2f969e){if(!_0x2f969e){_0x34f165[_0x127b('0x1f')](0x194);}return _0x2f969e;};}function handleError(_0xd2ae89,_0x1ea47e){_0x1ea47e=_0x1ea47e||0x1f4;return function(_0x14f343){logger[_0x127b('0x2d')](_0x14f343[_0x127b('0x2e')]);if(_0x14f343[_0x127b('0x2f')]){delete _0x14f343[_0x127b('0x2f')];}_0xd2ae89[_0x127b('0x20')](_0x1ea47e)['send'](_0x14f343);};}exports[_0x127b('0x30')]=function(_0x11347b,_0x2e701a){var _0x56e293={},_0xbfaa2b={},_0x102d31={'count':0x0,'rows':[]};var _0x467c31=_['map'](db[_0x127b('0x31')][_0x127b('0x32')],function(_0x5742eb){return{'name':_0x5742eb[_0x127b('0x33')],'type':_0x5742eb[_0x127b('0x34')]['key']};});_0xbfaa2b[_0x127b('0x35')]=_[_0x127b('0x36')](_0x467c31,'name');_0xbfaa2b['query']=_[_0x127b('0x37')](_0x11347b[_0x127b('0x38')]);_0xbfaa2b[_0x127b('0x39')]=_[_0x127b('0x3a')](_0xbfaa2b[_0x127b('0x35')],_0xbfaa2b[_0x127b('0x38')]);_0x56e293['attributes']=_[_0x127b('0x3a')](_0xbfaa2b[_0x127b('0x35')],qs['fields'](_0x11347b['query'][_0x127b('0x3b')]));_0x56e293[_0x127b('0x3c')]=_0x56e293['attributes']['length']?_0x56e293[_0x127b('0x3c')]:_0xbfaa2b['model'];if(!_0x11347b[_0x127b('0x38')]['hasOwnProperty'](_0x127b('0x3d'))){_0x56e293['limit']=qs[_0x127b('0x24')](_0x11347b[_0x127b('0x38')][_0x127b('0x24')]);_0x56e293[_0x127b('0x3e')]=qs['offset'](_0x11347b[_0x127b('0x38')]['offset']);}_0x56e293[_0x127b('0x3f')]=qs[_0x127b('0x40')](_0x11347b[_0x127b('0x38')][_0x127b('0x40')]);_0x56e293[_0x127b('0x41')]=qs['filters'](_[_0x127b('0x42')](_0x11347b[_0x127b('0x38')],_0xbfaa2b[_0x127b('0x39')]),_0x467c31);if(_0x11347b[_0x127b('0x38')][_0x127b('0x43')]){_0x56e293[_0x127b('0x41')]=_['merge'](_0x56e293[_0x127b('0x41')],{'$or':_[_0x127b('0x36')](_0x467c31,function(_0x1ac722){if(_0x1ac722[_0x127b('0x34')]!==_0x127b('0x44')){var _0x413680={};_0x413680[_0x1ac722[_0x127b('0x2f')]]={'$like':'%'+_0x11347b['query']['filter']+'%'};return _0x413680;}})});}_0x56e293=_[_0x127b('0x45')]({},_0x56e293,_0x11347b[_0x127b('0x46')]);var _0x25b958={'where':_0x56e293[_0x127b('0x41')]};return db[_0x127b('0x31')][_0x127b('0x25')](_0x25b958)[_0x127b('0x29')](function(_0x427fec){_0x102d31['count']=_0x427fec;if(_0x11347b[_0x127b('0x38')][_0x127b('0x47')]){_0x56e293[_0x127b('0x48')]=[{'all':!![]}];}return db[_0x127b('0x31')][_0x127b('0x49')](_0x56e293);})[_0x127b('0x29')](function(_0x49e800){_0x102d31[_0x127b('0x4a')]=_0x49e800;return _0x102d31;})[_0x127b('0x29')](respondWithFilteredResult(_0x2e701a,_0x56e293))[_0x127b('0x4b')](handleError(_0x2e701a,null));};exports[_0x127b('0x4c')]=function(_0x2fd343,_0x5b4e24){var _0x59dca3={'raw':!![],'where':{'id':_0x2fd343['params']['id']}},_0xac6120={};_0xac6120[_0x127b('0x35')]=_['keys'](db[_0x127b('0x31')]['rawAttributes']);_0xac6120[_0x127b('0x38')]=_[_0x127b('0x37')](_0x2fd343[_0x127b('0x38')]);_0xac6120['filters']=_[_0x127b('0x3a')](_0xac6120['model'],_0xac6120[_0x127b('0x38')]);_0x59dca3[_0x127b('0x3c')]=_[_0x127b('0x3a')](_0xac6120[_0x127b('0x35')],qs[_0x127b('0x3b')](_0x2fd343[_0x127b('0x38')]['fields']));_0x59dca3[_0x127b('0x3c')]=_0x59dca3[_0x127b('0x3c')][_0x127b('0x4d')]?_0x59dca3[_0x127b('0x3c')]:_0xac6120[_0x127b('0x35')];if(_0x2fd343[_0x127b('0x38')][_0x127b('0x47')]){_0x59dca3[_0x127b('0x48')]=[{'all':!![]}];}_0x59dca3=_[_0x127b('0x45')]({},_0x59dca3,_0x2fd343[_0x127b('0x46')]);return db['FaxQueue'][_0x127b('0x4e')](_0x59dca3)[_0x127b('0x29')](handleEntityNotFound(_0x5b4e24,null))[_0x127b('0x29')](respondWithResult(_0x5b4e24,null))[_0x127b('0x4b')](handleError(_0x5b4e24,null));};exports[_0x127b('0x4f')]=function(_0x51a66a,_0x1c60c9){return db[_0x127b('0x31')][_0x127b('0x4f')](_0x51a66a['body'],{})[_0x127b('0x29')](function(_0x2fd7d7){var _0x3e3c01=_0x51a66a[_0x127b('0x50')][_0x127b('0x2b')]({'plain':!![]});if(!_0x3e3c01)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3e3c01[_0x127b('0x51')]===_0x127b('0x50')){var _0x3ecb48=_0x2fd7d7[_0x127b('0x2b')]({'plain':!![]});var _0x25421e=_0x127b('0x52');return db['UserProfileSection'][_0x127b('0x4e')]({'where':{'name':_0x25421e,'userProfileId':_0x3e3c01['userProfileId']},'raw':!![]})[_0x127b('0x29')](function(_0x386728){if(_0x386728&&_0x386728['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x3ecb48[_0x127b('0x2f')],'resourceId':_0x3ecb48['id'],'type':_0x386728[_0x127b('0x2f')],'sectionId':_0x386728['id']},{})[_0x127b('0x29')](function(){return _0x2fd7d7;});}else{return _0x2fd7d7;}})['catch'](function(_0x2d0cb4){logger[_0x127b('0x2d')](_0x127b('0x53'),_0x2d0cb4);throw _0x2d0cb4;});}return _0x2fd7d7;})['then'](respondWithResult(_0x1c60c9,0xc9))[_0x127b('0x4b')](handleError(_0x1c60c9,null));};exports[_0x127b('0x54')]=function(_0x33e3a5,_0x359490){if(_0x33e3a5['body']['id']){delete _0x33e3a5[_0x127b('0x55')]['id'];}return db[_0x127b('0x31')][_0x127b('0x4e')]({'where':{'id':_0x33e3a5['params']['id']}})[_0x127b('0x29')](handleEntityNotFound(_0x359490,null))[_0x127b('0x29')](saveUpdates(_0x33e3a5['body'],null))[_0x127b('0x29')](respondWithResult(_0x359490,null))[_0x127b('0x4b')](handleError(_0x359490,null));};exports[_0x127b('0x2a')]=function(_0x3b3fa2,_0x10041e){return db[_0x127b('0x31')][_0x127b('0x4e')]({'where':{'id':_0x3b3fa2[_0x127b('0x56')]['id']}})[_0x127b('0x29')](handleEntityNotFound(_0x10041e,null))['then'](removeEntity(_0x10041e,null))[_0x127b('0x4b')](handleError(_0x10041e,null));};exports[_0x127b('0x57')]=function(_0x3e4506,_0x54a026){return db['FaxQueue'][_0x127b('0x57')]()[_0x127b('0x29')](respondWithResult(_0x54a026,null))['catch'](handleError(_0x54a026,null));};exports['getMembers']=function(_0x4a9a75,_0x2e8b89,_0x7480b){var _0x44f91c={'raw':!![],'where':{}},_0x1a9fe5={},_0x1414ab;return db[_0x127b('0x31')][_0x127b('0x58')]({'where':{'id':_0x4a9a75['params']['id']}})[_0x127b('0x29')](handleEntityNotFound(_0x2e8b89,null))[_0x127b('0x29')](function(_0x283877){if(_0x283877){_0x1414ab=_0x283877[_0x127b('0x2b')]({'plain':!![]});_0x1a9fe5[_0x127b('0x35')]=_[_0x127b('0x37')](db[_0x127b('0x59')][_0x127b('0x32')]);_0x1a9fe5['query']=_[_0x127b('0x37')](_0x4a9a75[_0x127b('0x38')]);_0x1a9fe5[_0x127b('0x39')]=_['intersection'](_0x1a9fe5[_0x127b('0x35')],_0x1a9fe5['query']);_0x44f91c['attributes']=_[_0x127b('0x3a')](_0x1a9fe5[_0x127b('0x35')],qs['fields'](_0x4a9a75[_0x127b('0x38')][_0x127b('0x3b')]));_0x44f91c[_0x127b('0x3c')]=_0x44f91c[_0x127b('0x3c')][_0x127b('0x4d')]?_0x44f91c['attributes']:_0x1a9fe5[_0x127b('0x35')];if(!_0x4a9a75[_0x127b('0x38')]['hasOwnProperty']('nolimit')){_0x44f91c[_0x127b('0x24')]=qs[_0x127b('0x24')](_0x4a9a75['query'][_0x127b('0x24')]);_0x44f91c['offset']=qs[_0x127b('0x3e')](_0x4a9a75[_0x127b('0x38')]['offset']);}_0x44f91c[_0x127b('0x3f')]=qs[_0x127b('0x40')](_0x4a9a75[_0x127b('0x38')][_0x127b('0x40')]);_0x44f91c['where']=qs[_0x127b('0x39')](_[_0x127b('0x42')](_0x4a9a75[_0x127b('0x38')],_0x1a9fe5[_0x127b('0x39')]));_0x44f91c['where'][_0x127b('0x5a')]=_0x283877['id'];if(_0x4a9a75[_0x127b('0x38')]['filter']){_0x44f91c['where']=_[_0x127b('0x45')](_0x44f91c[_0x127b('0x41')],{'$or':_[_0x127b('0x36')](_0x44f91c[_0x127b('0x3c')],function(_0x199fab){var _0x4ce19c={};_0x4ce19c[_0x199fab]={'$like':'%'+_0x4a9a75[_0x127b('0x38')][_0x127b('0x43')]+'%'};return _0x4ce19c;})});}_0x44f91c=_['merge']({},_0x44f91c,_0x4a9a75[_0x127b('0x46')]);return db[_0x127b('0x59')][_0x127b('0x49')](_0x44f91c);}})['then'](function(_0x49068d){if(_0x49068d){return db[_0x127b('0x5b')][_0x127b('0x5c')]({'where':{'id':_[_0x127b('0x36')](_0x49068d,'UserId'),'role':_0x127b('0x5d')},'attributes':['id','name',_0x127b('0x5e'),_0x127b('0x5f'),_0x127b('0x60')]});}})[_0x127b('0x29')](function(_0x35eada){if(_0x35eada){return{'count':_0x35eada[_0x127b('0x25')],'rows':_['map'](_0x35eada['rows'],function(_0x10d17f){return{'membername':_0x10d17f[_0x127b('0x2f')],'UserId':_0x10d17f['id'],'queue_name':_0x1414ab['name'],'FaxQueueId':_0x1414ab['id'],'interface':util['format'](_0x127b('0x61'),_0x127b('0x62'),_0x10d17f[_0x127b('0x2f')]),'penalty':0x0,'paused':_0x10d17f[_0x127b('0x5e')],'createdAt':_0x10d17f['createdAt'],'updatedAt':_0x10d17f['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x127b('0x29')](respondWithFilteredResult(_0x2e8b89,_0x44f91c))[_0x127b('0x4b')](handleError(_0x2e8b89,null));};exports[_0x127b('0x63')]=function(_0x4fdddf,_0x3719cb,_0x22f8ba){var _0x95d015={};var _0x5e98e6={};var _0xd7777c;var _0x3b66f1;return db['FaxQueue'][_0x127b('0x58')]({'where':{'id':_0x4fdddf[_0x127b('0x56')]['id']}})[_0x127b('0x29')](handleEntityNotFound(_0x3719cb,null))['then'](function(_0xce6b9c){if(_0xce6b9c){_0xd7777c=_0xce6b9c;_0x5e98e6[_0x127b('0x35')]=_[_0x127b('0x37')](db['Team'][_0x127b('0x32')]);_0x5e98e6[_0x127b('0x38')]=_[_0x127b('0x37')](_0x4fdddf[_0x127b('0x38')]);_0x5e98e6[_0x127b('0x39')]=_[_0x127b('0x3a')](_0x5e98e6[_0x127b('0x35')],_0x5e98e6[_0x127b('0x38')]);_0x95d015['attributes']=_[_0x127b('0x3a')](_0x5e98e6[_0x127b('0x35')],qs[_0x127b('0x3b')](_0x4fdddf[_0x127b('0x38')][_0x127b('0x3b')]));_0x95d015[_0x127b('0x3c')]=_0x95d015[_0x127b('0x3c')][_0x127b('0x4d')]?_0x95d015['attributes']:_0x5e98e6[_0x127b('0x35')];_0x95d015['order']=qs['sort'](_0x4fdddf[_0x127b('0x38')][_0x127b('0x40')]);_0x95d015[_0x127b('0x41')]=qs[_0x127b('0x39')](_['pick'](_0x4fdddf[_0x127b('0x38')],_0x5e98e6[_0x127b('0x39')]));if(_0x4fdddf[_0x127b('0x38')][_0x127b('0x43')]){_0x95d015[_0x127b('0x41')]=_['merge'](_0x95d015[_0x127b('0x41')],{'$or':_[_0x127b('0x36')](_0x95d015[_0x127b('0x3c')],function(_0x4dbef0){var _0xffd5c4={};_0xffd5c4[_0x4dbef0]={'$like':'%'+_0x4fdddf['query'][_0x127b('0x43')]+'%'};return _0xffd5c4;})});}_0x95d015=_[_0x127b('0x45')]({},_0x95d015,_0x4fdddf['options']);return _0xd7777c[_0x127b('0x63')](_0x95d015);}})[_0x127b('0x29')](function(_0x1d920e){if(_0x1d920e){_0x3b66f1=_0x1d920e[_0x127b('0x4d')];if(!_0x4fdddf[_0x127b('0x38')]['hasOwnProperty'](_0x127b('0x3d'))){_0x95d015[_0x127b('0x24')]=qs[_0x127b('0x24')](_0x4fdddf['query'][_0x127b('0x24')]);_0x95d015[_0x127b('0x3e')]=qs[_0x127b('0x3e')](_0x4fdddf[_0x127b('0x38')]['offset']);}return _0xd7777c[_0x127b('0x63')](_0x95d015);}})[_0x127b('0x29')](function(_0x5cbd3c){if(_0x5cbd3c){return _0x5cbd3c?{'count':_0x3b66f1,'rows':_0x5cbd3c}:null;}})[_0x127b('0x29')](respondWithResult(_0x3719cb,null))[_0x127b('0x4b')](handleError(_0x3719cb,null));};exports[_0x127b('0x64')]=function(_0xcae708,_0xa6a3e3,_0x18327d){var _0x1fe166=_0xcae708[_0x127b('0x55')][_0x127b('0x65')];return db[_0x127b('0x66')]['findAll']({'where':{'id':_0x1fe166},'attributes':['id'],'include':[{'model':db[_0x127b('0x5b')],'as':_0x127b('0x67'),'attributes':['id',_0x127b('0x2f'),_0x127b('0x68'),_0x127b('0x69'),_0x127b('0x6a')],'raw':!![]}]})[_0x127b('0x29')](function(_0x3f0daa){if(_0x3f0daa){var _0x7c17b0=_[_0x127b('0x6b')](_0x3f0daa,function(_0x19be68){var _0x4a4559=_0x19be68[_0x127b('0x2b')]({'plain':!![]});return _0x4a4559[_0x127b('0x67')];});return db[_0x127b('0x31')][_0x127b('0x4e')]({'where':{'id':_0xcae708[_0x127b('0x56')]['id']}})[_0x127b('0x29')](function(_0x59fcf4){return db[_0x127b('0x6c')][_0x127b('0x6d')](function(_0x5032b9){return _0x59fcf4[_0x127b('0x64')](_0x1fe166,{'transaction':_0x5032b9})[_0x127b('0x29')](function(){return BPromise['each'](_0x7c17b0,function(_0x110308){return db[_0x127b('0x59')]['findOrCreate']({'where':{'UserId':_0x110308['id'],'FaxQueueId':_0xcae708[_0x127b('0x56')]['id']},'transaction':_0x5032b9});});})[_0x127b('0x29')](function(){_0x7c17b0['forEach'](function(_0x1ecb1f){socket['emit'](_0x127b('0x6e'),{'UserId':_0x1ecb1f['id'],'FaxQueueId':_0x59fcf4['id']});});});});});}})[_0x127b('0x29')](respondWithStatusCode(_0xa6a3e3,null))[_0x127b('0x4b')](handleError(_0xa6a3e3,null));};exports[_0x127b('0x6f')]=function(_0x4c0add,_0x49c583,_0x5a81d0){return db['Team']['findAll']({'where':{'id':_0x4c0add[_0x127b('0x38')][_0x127b('0x65')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x49c583,null))[_0x127b('0x29')](function(_0x591413){var _0x1f96ee=_[_0x127b('0x36')](_0x591413,'id');var _0x4196ae=[];var _0x3ee4fe=[];var _0x3d2f0f=squel[_0x127b('0x70')]();_0x3d2f0f[_0x127b('0x71')](_0x127b('0x72'))[_0x127b('0x73')](_0x127b('0x74'),'tq')[_0x127b('0x75')](_0x127b('0x76'),'ut',_0x127b('0x77'))[_0x127b('0x41')](_0x127b('0x78'),_0x4c0add['params']['id']);for(var _0x5fe1dd=0x0;_0x5fe1dd<_0x591413['length'];_0x5fe1dd+=0x1){let _0x4e736c=_0x591413[_0x5fe1dd];for(var _0x1d0639=0x0;_0x1d0639<_0x4e736c[_0x127b('0x67')][_0x127b('0x4d')];_0x1d0639+=0x1){let _0x240aa2=_0x4e736c[_0x127b('0x67')][_0x1d0639];var _0x33473e=_0x3d2f0f[_0x127b('0x79')]();_0x33473e[_0x127b('0x41')]('ut.UserId\x20=\x20?',_0x240aa2['id']);_0x3ee4fe[_0x127b('0x7a')](db[_0x127b('0x6c')][_0x127b('0x38')](_0x33473e[_0x127b('0x7b')](),{'type':db['sequelize'][_0x127b('0x7c')][_0x127b('0x7d')]})[_0x127b('0x29')](function(_0x41a099){if(_0x41a099[_0x127b('0x4d')]===0x1){return _0x240aa2['id'];}else{var _0x4e9f93=_[_0x127b('0x7e')](_[_0x127b('0x36')](_0x41a099,_0x127b('0x7f')),function(_0x3eb368){return _[_0x127b('0x80')](_0x1f96ee,_0x3eb368);});if(_0x4e9f93){return _0x240aa2['id'];}}}));}}return BPromise[_0x127b('0x81')](_0x3ee4fe)[_0x127b('0x29')](function(_0x2e6360){_0x4196ae=_(_0x4196ae)[_0x127b('0x82')](_0x2e6360)[_0x127b('0x83')]()[_0x127b('0x84')]();return db[_0x127b('0x31')][_0x127b('0x4e')]({'where':{'id':_0x4c0add[_0x127b('0x56')]['id']}})[_0x127b('0x29')](function(_0xd48663){return db['sequelize'][_0x127b('0x6d')](function(_0x503d23){return _0xd48663['removeTeams'](_0x4c0add[_0x127b('0x38')][_0x127b('0x65')],{'transaction':_0x503d23})[_0x127b('0x29')](function(){if(!_[_0x127b('0x85')](_0x4196ae)){return _0xd48663[_0x127b('0x86')](_0x4196ae,{'transaction':_0x503d23});}})['then'](function(){_0x4196ae[_0x127b('0x87')](function(_0x3a97e0){socket[_0x127b('0x88')](_0x127b('0x89'),{'UserId':_0x3a97e0,'FaxQueueId':_0xd48663['id']});});});});});});})[_0x127b('0x29')](respondWithStatusCode(_0x49c583,null))[_0x127b('0x4b')](handleError(_0x49c583,null));};exports['addAgents']=function(_0x19d0fb,_0xc05dec,_0xb71272){return db[_0x127b('0x31')][_0x127b('0x4e')]({'where':{'id':_0x19d0fb[_0x127b('0x56')]['id']}})[_0x127b('0x29')](handleEntityNotFound(_0xc05dec,null))[_0x127b('0x29')](function(_0x24fcc9){if(_0x24fcc9){return _0x24fcc9[_0x127b('0x8a')](_0x19d0fb['body'][_0x127b('0x65')],_[_0x127b('0x8b')](_0x19d0fb[_0x127b('0x55')],['ids','id'])||{})[_0x127b('0x8c')](function(_0x50aea0){for(var _0x3aaf0a=0x0;_0x3aaf0a<_0x19d0fb[_0x127b('0x55')][_0x127b('0x65')]['length'];_0x3aaf0a+=0x1){socket[_0x127b('0x88')](_0x127b('0x6e'),{'UserId':Number(_0x19d0fb['body'][_0x127b('0x65')][_0x3aaf0a]),'FaxQueueId':Number(_0x19d0fb['params']['id'])});}return _0x50aea0;});}})[_0x127b('0x29')](respondWithResult(_0xc05dec,null))[_0x127b('0x4b')](handleError(_0xc05dec,null));};exports[_0x127b('0x86')]=function(_0x106e89,_0x2eb44c,_0x3c0c54){return db[_0x127b('0x31')]['find']({'where':{'id':_0x106e89['params']['id']}})['then'](handleEntityNotFound(_0x2eb44c,null))[_0x127b('0x29')](function(_0x1fa720){if(_0x1fa720){return _0x1fa720[_0x127b('0x86')](_0x106e89[_0x127b('0x38')][_0x127b('0x65')])[_0x127b('0x29')](function(){if(_[_0x127b('0x8d')](_0x106e89[_0x127b('0x38')][_0x127b('0x65')])){for(var _0x5053a9=0x0;_0x5053a9<_0x106e89[_0x127b('0x38')][_0x127b('0x65')][_0x127b('0x4d')];_0x5053a9+=0x1){socket[_0x127b('0x88')](_0x127b('0x89'),{'UserId':Number(_0x106e89[_0x127b('0x38')][_0x127b('0x65')][_0x5053a9]),'FaxQueueId':Number(_0x106e89[_0x127b('0x56')]['id'])});}}else{socket[_0x127b('0x88')](_0x127b('0x89'),{'UserId':Number(_0x106e89[_0x127b('0x38')][_0x127b('0x65')]),'FaxQueueId':Number(_0x106e89[_0x127b('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x2eb44c,null))[_0x127b('0x4b')](handleError(_0x2eb44c,null));};exports[_0x127b('0x8e')]=function(_0x3b2996,_0x5d72c9,_0x262f58){var _0xd4834f={};var _0xe866d5={};var _0x2fc9fc;var _0x1ac304;return db[_0x127b('0x31')][_0x127b('0x58')]({'where':{'id':_0x3b2996[_0x127b('0x56')]['id']}})[_0x127b('0x29')](handleEntityNotFound(_0x5d72c9,null))['then'](function(_0x1ddf9f){if(_0x1ddf9f){_0x2fc9fc=_0x1ddf9f;_0xe866d5['model']=_[_0x127b('0x37')](db[_0x127b('0x5b')]['rawAttributes']);_0xe866d5['query']=_[_0x127b('0x37')](_0x3b2996[_0x127b('0x38')]);_0xe866d5['filters']=_[_0x127b('0x3a')](_0xe866d5[_0x127b('0x35')],_0xe866d5[_0x127b('0x38')]);_0xd4834f[_0x127b('0x3c')]=_[_0x127b('0x3a')](_0xe866d5[_0x127b('0x35')],qs[_0x127b('0x3b')](_0x3b2996[_0x127b('0x38')][_0x127b('0x3b')]));_0xd4834f[_0x127b('0x3c')]=_0xd4834f[_0x127b('0x3c')][_0x127b('0x4d')]?_0xd4834f['attributes']:_0xe866d5[_0x127b('0x35')];_0xd4834f[_0x127b('0x3f')]=qs[_0x127b('0x40')](_0x3b2996[_0x127b('0x38')][_0x127b('0x40')]);_0xd4834f[_0x127b('0x41')]=qs[_0x127b('0x39')](_[_0x127b('0x42')](_0x3b2996[_0x127b('0x38')],_0xe866d5[_0x127b('0x39')]));if(_0x3b2996['query'][_0x127b('0x43')]){_0xd4834f[_0x127b('0x41')]=_[_0x127b('0x45')](_0xd4834f['where'],{'$or':_['map'](_0xd4834f[_0x127b('0x3c')],function(_0xc98fc){var _0x4ee23d={};_0x4ee23d[_0xc98fc]={'$like':'%'+_0x3b2996[_0x127b('0x38')][_0x127b('0x43')]+'%'};return _0x4ee23d;})});}_0xd4834f=_[_0x127b('0x45')]({},_0xd4834f,_0x3b2996[_0x127b('0x46')]);return _0x2fc9fc[_0x127b('0x8e')](_0xd4834f);}})['then'](function(_0x55bfc0){if(_0x55bfc0){_0x1ac304=_0x55bfc0[_0x127b('0x4d')];if(!_0x3b2996['query']['hasOwnProperty']('nolimit')){_0xd4834f[_0x127b('0x24')]=qs[_0x127b('0x24')](_0x3b2996['query'][_0x127b('0x24')]);_0xd4834f[_0x127b('0x3e')]=qs[_0x127b('0x3e')](_0x3b2996[_0x127b('0x38')][_0x127b('0x3e')]);}return _0x2fc9fc[_0x127b('0x8e')](_0xd4834f);}})[_0x127b('0x29')](function(_0x3d87d6){if(_0x3d87d6){return _0x3d87d6?{'count':_0x1ac304,'rows':_0x3d87d6}:null;}})[_0x127b('0x29')](respondWithResult(_0x5d72c9,null))[_0x127b('0x4b')](handleError(_0x5d72c9,null));};
\ No newline at end of file
+var _0x2030=['options','includeAll','include','findAll','rows','catch','show','params','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','findOne','rawAttributes','hasOwnProperty','UserFaxQueue','findAndCountAll','UserId','agent','faxPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','User','Agents','online','voicePause','interface','flatMap','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','ids','select','field','tq.TeamId','join','user_has_teams','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','transaction','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','isArray','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','error','stack','name','index','map','FaxQueue','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter'];(function(_0x360a3f,_0x6adf05){var _0x35af46=function(_0x80c63f){while(--_0x80c63f){_0x360a3f['push'](_0x360a3f['shift']());}};_0x35af46(++_0x6adf05);}(_0x2030,0xd9));var _0x0203=function(_0x55e755,_0x1c2cf2){_0x55e755=_0x55e755-0x0;var _0x329aab=_0x2030[_0x55e755];return _0x329aab;};'use strict';var emlformat=require(_0x0203('0x0'));var rimraf=require(_0x0203('0x1'));var zipdir=require(_0x0203('0x2'));var jsonpatch=require(_0x0203('0x3'));var rp=require(_0x0203('0x4'));var moment=require(_0x0203('0x5'));var BPromise=require(_0x0203('0x6'));var Mustache=require(_0x0203('0x7'));var util=require('util');var path=require(_0x0203('0x8'));var sox=require(_0x0203('0x9'));var csv=require(_0x0203('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0203('0xb'));var _=require(_0x0203('0xc'));var squel=require(_0x0203('0xd'));var crypto=require(_0x0203('0xe'));var jsforce=require(_0x0203('0xf'));var deskjs=require(_0x0203('0x10'));var toCsv=require(_0x0203('0xa'));var querystring=require('querystring');var Papa=require(_0x0203('0x11'));var Redis=require('ioredis');var authService=require(_0x0203('0x12'));var qs=require(_0x0203('0x13'));var as=require(_0x0203('0x14'));var hardwareService=require(_0x0203('0x15'));var logger=require(_0x0203('0x16'))(_0x0203('0x17'));var utils=require(_0x0203('0x18'));var config=require(_0x0203('0x19'));var licenseUtil=require(_0x0203('0x1a'));var db=require('../../mysqldb')['db'];config[_0x0203('0x1b')]=_[_0x0203('0x1c')](config[_0x0203('0x1b')],{'host':_0x0203('0x1d'),'port':0x18eb});var socket=require(_0x0203('0x1e'))(new Redis(config[_0x0203('0x1b')]));require('./faxQueue.socket')[_0x0203('0x1f')](socket);function respondWithStatusCode(_0x552bd1,_0x3d1fcd){_0x3d1fcd=_0x3d1fcd||0xcc;return function(_0x20cc48){if(_0x20cc48){return _0x552bd1[_0x0203('0x20')](_0x3d1fcd);}return _0x552bd1[_0x0203('0x21')](_0x3d1fcd)[_0x0203('0x22')]();};}function respondWithResult(_0x2e423d,_0x2f970d){_0x2f970d=_0x2f970d||0xc8;return function(_0xa27e55){if(_0xa27e55){return _0x2e423d[_0x0203('0x21')](_0x2f970d)['json'](_0xa27e55);}};}function respondWithFilteredResult(_0x1bca43,_0x41f775){return function(_0x53083a){if(_0x53083a){var _0x2a3bf9=typeof _0x41f775[_0x0203('0x23')]===_0x0203('0x24')&&typeof _0x41f775[_0x0203('0x25')]==='undefined';var _0x2adf98=_0x53083a[_0x0203('0x26')];var _0x573710=_0x2a3bf9?0x0:_0x41f775[_0x0203('0x23')];var _0x2673ea=_0x2a3bf9?_0x53083a[_0x0203('0x26')]:_0x41f775[_0x0203('0x23')]+_0x41f775['limit'];var _0x10cac7;if(_0x2673ea>=_0x2adf98){_0x2673ea=_0x2adf98;_0x10cac7=0xc8;}else{_0x10cac7=0xce;}_0x1bca43['status'](_0x10cac7);return _0x1bca43[_0x0203('0x27')](_0x0203('0x28'),_0x573710+'-'+_0x2673ea+'/'+_0x2adf98)[_0x0203('0x29')](_0x53083a);}return null;};}function patchUpdates(_0x35c1af){return function(_0x45e37b){try{jsonpatch[_0x0203('0x2a')](_0x45e37b,_0x35c1af,!![]);}catch(_0x579553){return BPromise[_0x0203('0x2b')](_0x579553);}return _0x45e37b[_0x0203('0x2c')]();};}function saveUpdates(_0x915aac,_0x2f2960){return function(_0x52d2fd){if(_0x52d2fd){return _0x52d2fd[_0x0203('0x2d')](_0x915aac)[_0x0203('0x2e')](function(_0x4145b2){return _0x4145b2;});}return null;};}function removeEntity(_0x269586,_0x5ab4ca){return function(_0x4b6493){if(_0x4b6493){return _0x4b6493[_0x0203('0x2f')]()[_0x0203('0x2e')](function(){var _0x4818b7=_0x4b6493[_0x0203('0x30')]({'plain':!![]});var _0x1ab7e5=_0x0203('0x31');return db[_0x0203('0x32')]['destroy']({'where':{'type':_0x1ab7e5,'resourceId':_0x4818b7['id']}})['then'](function(){return _0x4b6493;});})[_0x0203('0x2e')](function(){_0x269586['status'](0xcc)[_0x0203('0x22')]();});}};}function handleEntityNotFound(_0x52c8cc,_0xb8ecb5){return function(_0x2762c0){if(!_0x2762c0){_0x52c8cc[_0x0203('0x20')](0x194);}return _0x2762c0;};}function handleError(_0x2da956,_0x74f752){_0x74f752=_0x74f752||0x1f4;return function(_0x4e65ba){logger[_0x0203('0x33')](_0x4e65ba[_0x0203('0x34')]);if(_0x4e65ba[_0x0203('0x35')]){delete _0x4e65ba[_0x0203('0x35')];}_0x2da956['status'](_0x74f752)['send'](_0x4e65ba);};}exports[_0x0203('0x36')]=function(_0x43c503,_0x5d1493){var _0x153906={},_0x53f016={},_0x273568={'count':0x0,'rows':[]};var _0x15c838=_[_0x0203('0x37')](db[_0x0203('0x38')]['rawAttributes'],function(_0x136aad){return{'name':_0x136aad[_0x0203('0x39')],'type':_0x136aad['type'][_0x0203('0x3a')]};});_0x53f016[_0x0203('0x3b')]=_[_0x0203('0x37')](_0x15c838,'name');_0x53f016[_0x0203('0x3c')]=_[_0x0203('0x3d')](_0x43c503['query']);_0x53f016[_0x0203('0x3e')]=_[_0x0203('0x3f')](_0x53f016[_0x0203('0x3b')],_0x53f016[_0x0203('0x3c')]);_0x153906[_0x0203('0x40')]=_[_0x0203('0x3f')](_0x53f016[_0x0203('0x3b')],qs[_0x0203('0x41')](_0x43c503['query']['fields']));_0x153906[_0x0203('0x40')]=_0x153906[_0x0203('0x40')][_0x0203('0x42')]?_0x153906['attributes']:_0x53f016['model'];if(!_0x43c503[_0x0203('0x3c')]['hasOwnProperty'](_0x0203('0x43'))){_0x153906[_0x0203('0x25')]=qs[_0x0203('0x25')](_0x43c503['query'][_0x0203('0x25')]);_0x153906[_0x0203('0x23')]=qs[_0x0203('0x23')](_0x43c503['query'][_0x0203('0x23')]);}_0x153906[_0x0203('0x44')]=qs[_0x0203('0x45')](_0x43c503[_0x0203('0x3c')][_0x0203('0x45')]);_0x153906['where']=qs[_0x0203('0x3e')](_[_0x0203('0x46')](_0x43c503[_0x0203('0x3c')],_0x53f016[_0x0203('0x3e')]),_0x15c838);if(_0x43c503[_0x0203('0x3c')]['filter']){_0x153906[_0x0203('0x47')]=_[_0x0203('0x48')](_0x153906['where'],{'$or':_[_0x0203('0x37')](_0x15c838,function(_0x783a8f){if(_0x783a8f['type']!==_0x0203('0x49')){var _0x446871={};_0x446871[_0x783a8f['name']]={'$like':'%'+_0x43c503[_0x0203('0x3c')][_0x0203('0x4a')]+'%'};return _0x446871;}})});}_0x153906=_['merge']({},_0x153906,_0x43c503[_0x0203('0x4b')]);var _0x25d358={'where':_0x153906['where']};return db[_0x0203('0x38')][_0x0203('0x26')](_0x25d358)[_0x0203('0x2e')](function(_0x201fb6){_0x273568[_0x0203('0x26')]=_0x201fb6;if(_0x43c503[_0x0203('0x3c')][_0x0203('0x4c')]){_0x153906[_0x0203('0x4d')]=[{'all':!![]}];}return db[_0x0203('0x38')][_0x0203('0x4e')](_0x153906);})['then'](function(_0x1d17d2){_0x273568[_0x0203('0x4f')]=_0x1d17d2;return _0x273568;})[_0x0203('0x2e')](respondWithFilteredResult(_0x5d1493,_0x153906))[_0x0203('0x50')](handleError(_0x5d1493,null));};exports[_0x0203('0x51')]=function(_0xa50cb7,_0x14c412){var _0x2bd808={'raw':!![],'where':{'id':_0xa50cb7[_0x0203('0x52')]['id']}},_0x4cf1c4={};_0x4cf1c4[_0x0203('0x3b')]=_[_0x0203('0x3d')](db[_0x0203('0x38')]['rawAttributes']);_0x4cf1c4['query']=_[_0x0203('0x3d')](_0xa50cb7[_0x0203('0x3c')]);_0x4cf1c4[_0x0203('0x3e')]=_[_0x0203('0x3f')](_0x4cf1c4[_0x0203('0x3b')],_0x4cf1c4[_0x0203('0x3c')]);_0x2bd808[_0x0203('0x40')]=_['intersection'](_0x4cf1c4['model'],qs[_0x0203('0x41')](_0xa50cb7[_0x0203('0x3c')][_0x0203('0x41')]));_0x2bd808[_0x0203('0x40')]=_0x2bd808[_0x0203('0x40')]['length']?_0x2bd808[_0x0203('0x40')]:_0x4cf1c4[_0x0203('0x3b')];if(_0xa50cb7[_0x0203('0x3c')]['includeAll']){_0x2bd808[_0x0203('0x4d')]=[{'all':!![]}];}_0x2bd808=_[_0x0203('0x48')]({},_0x2bd808,_0xa50cb7['options']);return db['FaxQueue'][_0x0203('0x53')](_0x2bd808)[_0x0203('0x2e')](handleEntityNotFound(_0x14c412,null))['then'](respondWithResult(_0x14c412,null))[_0x0203('0x50')](handleError(_0x14c412,null));};exports[_0x0203('0x54')]=function(_0x149646,_0xb880cf){return db['FaxQueue'][_0x0203('0x54')](_0x149646[_0x0203('0x55')],{})[_0x0203('0x2e')](function(_0xbf1c57){var _0x4026d0=_0x149646[_0x0203('0x56')][_0x0203('0x30')]({'plain':!![]});if(!_0x4026d0)throw new Error(_0x0203('0x57'));if(_0x4026d0[_0x0203('0x58')]===_0x0203('0x56')){var _0x4eda22=_0xbf1c57[_0x0203('0x30')]({'plain':!![]});var _0x14a36f=_0x0203('0x31');return db[_0x0203('0x59')]['find']({'where':{'name':_0x14a36f,'userProfileId':_0x4026d0[_0x0203('0x5a')]},'raw':!![]})['then'](function(_0x362ffa){if(_0x362ffa&&_0x362ffa[_0x0203('0x5b')]===0x0){return db[_0x0203('0x32')]['create']({'name':_0x4eda22[_0x0203('0x35')],'resourceId':_0x4eda22['id'],'type':_0x362ffa[_0x0203('0x35')],'sectionId':_0x362ffa['id']},{})['then'](function(){return _0xbf1c57;});}else{return _0xbf1c57;}})['catch'](function(_0x34941a){logger[_0x0203('0x33')](_0x0203('0x5c'),_0x34941a);throw _0x34941a;});}return _0xbf1c57;})['then'](respondWithResult(_0xb880cf,0xc9))[_0x0203('0x50')](handleError(_0xb880cf,null));};exports[_0x0203('0x2d')]=function(_0x32010f,_0x2949b4){if(_0x32010f[_0x0203('0x55')]['id']){delete _0x32010f[_0x0203('0x55')]['id'];}return db['FaxQueue'][_0x0203('0x53')]({'where':{'id':_0x32010f['params']['id']}})['then'](handleEntityNotFound(_0x2949b4,null))['then'](saveUpdates(_0x32010f[_0x0203('0x55')],null))['then'](respondWithResult(_0x2949b4,null))['catch'](handleError(_0x2949b4,null));};exports[_0x0203('0x2f')]=function(_0xfd6dc0,_0x17f2a9){return db[_0x0203('0x38')][_0x0203('0x53')]({'where':{'id':_0xfd6dc0[_0x0203('0x52')]['id']}})[_0x0203('0x2e')](handleEntityNotFound(_0x17f2a9,null))['then'](removeEntity(_0x17f2a9,null))[_0x0203('0x50')](handleError(_0x17f2a9,null));};exports['describe']=function(_0x8136eb,_0x3eda95){return db[_0x0203('0x38')][_0x0203('0x5d')]()[_0x0203('0x2e')](respondWithResult(_0x3eda95,null))[_0x0203('0x50')](handleError(_0x3eda95,null));};exports['getMembers']=function(_0xa8b205,_0x52bb3b,_0x210535){var _0x4ea3ea={'raw':!![],'where':{}},_0x49ecde={},_0x512d7f;return db[_0x0203('0x38')][_0x0203('0x5e')]({'where':{'id':_0xa8b205[_0x0203('0x52')]['id']}})['then'](handleEntityNotFound(_0x52bb3b,null))[_0x0203('0x2e')](function(_0x20df39){if(_0x20df39){_0x512d7f=_0x20df39[_0x0203('0x30')]({'plain':!![]});_0x49ecde[_0x0203('0x3b')]=_[_0x0203('0x3d')](db['UserFaxQueue'][_0x0203('0x5f')]);_0x49ecde[_0x0203('0x3c')]=_[_0x0203('0x3d')](_0xa8b205[_0x0203('0x3c')]);_0x49ecde[_0x0203('0x3e')]=_[_0x0203('0x3f')](_0x49ecde['model'],_0x49ecde[_0x0203('0x3c')]);_0x4ea3ea[_0x0203('0x40')]=_[_0x0203('0x3f')](_0x49ecde[_0x0203('0x3b')],qs[_0x0203('0x41')](_0xa8b205[_0x0203('0x3c')][_0x0203('0x41')]));_0x4ea3ea[_0x0203('0x40')]=_0x4ea3ea[_0x0203('0x40')][_0x0203('0x42')]?_0x4ea3ea[_0x0203('0x40')]:_0x49ecde['model'];if(!_0xa8b205[_0x0203('0x3c')][_0x0203('0x60')](_0x0203('0x43'))){_0x4ea3ea[_0x0203('0x25')]=qs[_0x0203('0x25')](_0xa8b205[_0x0203('0x3c')][_0x0203('0x25')]);_0x4ea3ea[_0x0203('0x23')]=qs[_0x0203('0x23')](_0xa8b205[_0x0203('0x3c')][_0x0203('0x23')]);}_0x4ea3ea[_0x0203('0x44')]=qs['sort'](_0xa8b205[_0x0203('0x3c')]['sort']);_0x4ea3ea[_0x0203('0x47')]=qs['filters'](_[_0x0203('0x46')](_0xa8b205[_0x0203('0x3c')],_0x49ecde[_0x0203('0x3e')]));_0x4ea3ea[_0x0203('0x47')]['FaxQueueId']=_0x20df39['id'];if(_0xa8b205['query'][_0x0203('0x4a')]){_0x4ea3ea[_0x0203('0x47')]=_['merge'](_0x4ea3ea['where'],{'$or':_[_0x0203('0x37')](_0x4ea3ea[_0x0203('0x40')],function(_0x473319){var _0x3781e5={};_0x3781e5[_0x473319]={'$like':'%'+_0xa8b205[_0x0203('0x3c')][_0x0203('0x4a')]+'%'};return _0x3781e5;})});}_0x4ea3ea=_[_0x0203('0x48')]({},_0x4ea3ea,_0xa8b205[_0x0203('0x4b')]);return db[_0x0203('0x61')]['findAll'](_0x4ea3ea);}})['then'](function(_0x513778){if(_0x513778){return db['User'][_0x0203('0x62')]({'where':{'id':_[_0x0203('0x37')](_0x513778,_0x0203('0x63')),'role':_0x0203('0x64')},'attributes':['id',_0x0203('0x35'),_0x0203('0x65'),_0x0203('0x66'),'createdAt']});}})[_0x0203('0x2e')](function(_0x536e99){if(_0x536e99){return{'count':_0x536e99[_0x0203('0x26')],'rows':_[_0x0203('0x37')](_0x536e99[_0x0203('0x4f')],function(_0x21a272){return{'membername':_0x21a272['name'],'UserId':_0x21a272['id'],'queue_name':_0x512d7f['name'],'FaxQueueId':_0x512d7f['id'],'interface':util[_0x0203('0x67')](_0x0203('0x68'),_0x0203('0x69'),_0x21a272[_0x0203('0x35')]),'penalty':0x0,'paused':_0x21a272[_0x0203('0x65')],'createdAt':_0x21a272[_0x0203('0x6a')],'updatedAt':_0x21a272[_0x0203('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0203('0x2e')](respondWithFilteredResult(_0x52bb3b,_0x4ea3ea))[_0x0203('0x50')](handleError(_0x52bb3b,null));};exports[_0x0203('0x6b')]=function(_0x4944ca,_0x2346e8,_0x1d1ad0){var _0x4bdae3={};var _0x16abe3={};var _0x15f90b;var _0x174bf0;return db['FaxQueue']['findOne']({'where':{'id':_0x4944ca[_0x0203('0x52')]['id']}})[_0x0203('0x2e')](handleEntityNotFound(_0x2346e8,null))[_0x0203('0x2e')](function(_0x3b73c3){if(_0x3b73c3){_0x15f90b=_0x3b73c3;_0x16abe3['model']=_['keys'](db[_0x0203('0x6c')][_0x0203('0x5f')]);_0x16abe3['query']=_[_0x0203('0x3d')](_0x4944ca[_0x0203('0x3c')]);_0x16abe3[_0x0203('0x3e')]=_[_0x0203('0x3f')](_0x16abe3['model'],_0x16abe3[_0x0203('0x3c')]);_0x4bdae3[_0x0203('0x40')]=_[_0x0203('0x3f')](_0x16abe3['model'],qs[_0x0203('0x41')](_0x4944ca[_0x0203('0x3c')][_0x0203('0x41')]));_0x4bdae3[_0x0203('0x40')]=_0x4bdae3['attributes']['length']?_0x4bdae3['attributes']:_0x16abe3[_0x0203('0x3b')];_0x4bdae3['order']=qs[_0x0203('0x45')](_0x4944ca[_0x0203('0x3c')][_0x0203('0x45')]);_0x4bdae3[_0x0203('0x47')]=qs[_0x0203('0x3e')](_['pick'](_0x4944ca['query'],_0x16abe3[_0x0203('0x3e')]));if(_0x4944ca['query'][_0x0203('0x4a')]){_0x4bdae3[_0x0203('0x47')]=_[_0x0203('0x48')](_0x4bdae3[_0x0203('0x47')],{'$or':_[_0x0203('0x37')](_0x4bdae3[_0x0203('0x40')],function(_0x2000ee){var _0x5d535c={};_0x5d535c[_0x2000ee]={'$like':'%'+_0x4944ca['query']['filter']+'%'};return _0x5d535c;})});}_0x4bdae3=_[_0x0203('0x48')]({},_0x4bdae3,_0x4944ca[_0x0203('0x4b')]);return _0x15f90b['getTeams'](_0x4bdae3);}})[_0x0203('0x2e')](function(_0xca321){if(_0xca321){_0x174bf0=_0xca321[_0x0203('0x42')];if(!_0x4944ca['query'][_0x0203('0x60')](_0x0203('0x43'))){_0x4bdae3[_0x0203('0x25')]=qs[_0x0203('0x25')](_0x4944ca[_0x0203('0x3c')]['limit']);_0x4bdae3[_0x0203('0x23')]=qs[_0x0203('0x23')](_0x4944ca[_0x0203('0x3c')][_0x0203('0x23')]);}return _0x15f90b[_0x0203('0x6b')](_0x4bdae3);}})[_0x0203('0x2e')](function(_0x29ce8c){if(_0x29ce8c){return _0x29ce8c?{'count':_0x174bf0,'rows':_0x29ce8c}:null;}})['then'](respondWithResult(_0x2346e8,null))['catch'](handleError(_0x2346e8,null));};exports[_0x0203('0x6d')]=function(_0x110b00,_0x226f3e,_0x5bb0be){var _0x38e414=_0x110b00[_0x0203('0x55')]['ids'];return db['Team'][_0x0203('0x4e')]({'where':{'id':_0x38e414},'attributes':['id'],'include':[{'model':db[_0x0203('0x6e')],'as':_0x0203('0x6f'),'attributes':['id','name',_0x0203('0x70'),_0x0203('0x71'),_0x0203('0x72')],'raw':!![]}]})['then'](function(_0x35448f){if(_0x35448f){var _0x5ce040=_[_0x0203('0x73')](_0x35448f,function(_0x50b1d6){var _0x5c1e91=_0x50b1d6[_0x0203('0x30')]({'plain':!![]});return _0x5c1e91['Agents'];});return db[_0x0203('0x38')][_0x0203('0x53')]({'where':{'id':_0x110b00[_0x0203('0x52')]['id']}})[_0x0203('0x2e')](function(_0x355e8f){return db['sequelize']['transaction'](function(_0x5e9214){return _0x355e8f[_0x0203('0x6d')](_0x38e414,{'transaction':_0x5e9214})[_0x0203('0x2e')](function(){return BPromise[_0x0203('0x74')](_0x5ce040,function(_0x38fd24){return db[_0x0203('0x61')][_0x0203('0x75')]({'where':{'UserId':_0x38fd24['id'],'FaxQueueId':_0x110b00[_0x0203('0x52')]['id']},'transaction':_0x5e9214});});})[_0x0203('0x2e')](function(){_0x5ce040[_0x0203('0x76')](function(_0x33a19a){socket[_0x0203('0x77')](_0x0203('0x78'),{'UserId':_0x33a19a['id'],'FaxQueueId':_0x355e8f['id']});});});});});}})[_0x0203('0x2e')](respondWithStatusCode(_0x226f3e,null))['catch'](handleError(_0x226f3e,null));};exports[_0x0203('0x79')]=function(_0x366ad5,_0x131750,_0x25fbf9){return db[_0x0203('0x6c')][_0x0203('0x4e')]({'where':{'id':_0x366ad5[_0x0203('0x3c')][_0x0203('0x7a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0203('0x6f'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x131750,null))['then'](function(_0x29f632){var _0x256876=_['map'](_0x29f632,'id');var _0x14c0da=[];var _0x151c29=[];var _0x25eeb5=squel[_0x0203('0x7b')]();_0x25eeb5[_0x0203('0x7c')](_0x0203('0x7d'))['from']('team_has_fax_queues','tq')[_0x0203('0x7e')](_0x0203('0x7f'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0203('0x47')]('FaxQueueId\x20=\x20?',_0x366ad5[_0x0203('0x52')]['id']);for(var _0x163be7=0x0;_0x163be7<_0x29f632[_0x0203('0x42')];_0x163be7+=0x1){let _0x11ed50=_0x29f632[_0x163be7];for(var _0x232713=0x0;_0x232713<_0x11ed50[_0x0203('0x6f')][_0x0203('0x42')];_0x232713+=0x1){let _0x29cde2=_0x11ed50['Agents'][_0x232713];var _0x2b4c43=_0x25eeb5['clone']();_0x2b4c43[_0x0203('0x47')]('ut.UserId\x20=\x20?',_0x29cde2['id']);_0x151c29[_0x0203('0x80')](db[_0x0203('0x81')][_0x0203('0x3c')](_0x2b4c43[_0x0203('0x82')](),{'type':db[_0x0203('0x81')][_0x0203('0x83')][_0x0203('0x84')]})[_0x0203('0x2e')](function(_0x3cd23d){if(_0x3cd23d[_0x0203('0x42')]===0x1){return _0x29cde2['id'];}else{var _0x3376cf=_[_0x0203('0x85')](_[_0x0203('0x37')](_0x3cd23d,_0x0203('0x86')),function(_0x3fef03){return _[_0x0203('0x87')](_0x256876,_0x3fef03);});if(_0x3376cf){return _0x29cde2['id'];}}}));}}return BPromise[_0x0203('0x88')](_0x151c29)['then'](function(_0x2c3aba){_0x14c0da=_(_0x14c0da)[_0x0203('0x89')](_0x2c3aba)[_0x0203('0x8a')]()['value']();return db[_0x0203('0x38')][_0x0203('0x53')]({'where':{'id':_0x366ad5['params']['id']}})['then'](function(_0x167921){return db[_0x0203('0x81')][_0x0203('0x8b')](function(_0xf793bd){return _0x167921[_0x0203('0x79')](_0x366ad5[_0x0203('0x3c')]['ids'],{'transaction':_0xf793bd})[_0x0203('0x2e')](function(){if(!_[_0x0203('0x8c')](_0x14c0da)){return _0x167921[_0x0203('0x8d')](_0x14c0da,{'transaction':_0xf793bd});}})[_0x0203('0x2e')](function(){_0x14c0da[_0x0203('0x76')](function(_0x519fc9){socket['emit'](_0x0203('0x8e'),{'UserId':_0x519fc9,'FaxQueueId':_0x167921['id']});});});});});});})[_0x0203('0x2e')](respondWithStatusCode(_0x131750,null))[_0x0203('0x50')](handleError(_0x131750,null));};exports[_0x0203('0x8f')]=function(_0xdc93df,_0x3695bc,_0x2ae894){return db['FaxQueue'][_0x0203('0x53')]({'where':{'id':_0xdc93df[_0x0203('0x52')]['id']}})[_0x0203('0x2e')](handleEntityNotFound(_0x3695bc,null))['then'](function(_0x36931b){if(_0x36931b){return _0x36931b['addAgents'](_0xdc93df[_0x0203('0x55')][_0x0203('0x7a')],_[_0x0203('0x90')](_0xdc93df[_0x0203('0x55')],[_0x0203('0x7a'),'id'])||{})['spread'](function(_0x5f2ee1){for(var _0x3ba748=0x0;_0x3ba748<_0xdc93df[_0x0203('0x55')][_0x0203('0x7a')][_0x0203('0x42')];_0x3ba748+=0x1){socket['emit'](_0x0203('0x78'),{'UserId':Number(_0xdc93df['body'][_0x0203('0x7a')][_0x3ba748]),'FaxQueueId':Number(_0xdc93df[_0x0203('0x52')]['id'])});}return _0x5f2ee1;});}})[_0x0203('0x2e')](respondWithResult(_0x3695bc,null))[_0x0203('0x50')](handleError(_0x3695bc,null));};exports[_0x0203('0x8d')]=function(_0x3f61f4,_0x140fe0,_0x43a8b0){return db[_0x0203('0x38')][_0x0203('0x53')]({'where':{'id':_0x3f61f4[_0x0203('0x52')]['id']}})[_0x0203('0x2e')](handleEntityNotFound(_0x140fe0,null))[_0x0203('0x2e')](function(_0x598644){if(_0x598644){return _0x598644['removeAgents'](_0x3f61f4[_0x0203('0x3c')][_0x0203('0x7a')])['then'](function(){if(_[_0x0203('0x91')](_0x3f61f4[_0x0203('0x3c')][_0x0203('0x7a')])){for(var _0x1ee1c9=0x0;_0x1ee1c9<_0x3f61f4['query'][_0x0203('0x7a')][_0x0203('0x42')];_0x1ee1c9+=0x1){socket[_0x0203('0x77')](_0x0203('0x8e'),{'UserId':Number(_0x3f61f4['query']['ids'][_0x1ee1c9]),'FaxQueueId':Number(_0x3f61f4[_0x0203('0x52')]['id'])});}}else{socket[_0x0203('0x77')](_0x0203('0x8e'),{'UserId':Number(_0x3f61f4[_0x0203('0x3c')][_0x0203('0x7a')]),'FaxQueueId':Number(_0x3f61f4['params']['id'])});}});}})[_0x0203('0x2e')](respondWithStatusCode(_0x140fe0,null))[_0x0203('0x50')](handleError(_0x140fe0,null));};exports['getAgents']=function(_0x5b43b0,_0x298eac,_0x41bc70){var _0x325a16={};var _0x40a2d0={};var _0x247cbc;var _0x4a7f55;return db['FaxQueue'][_0x0203('0x5e')]({'where':{'id':_0x5b43b0['params']['id']}})[_0x0203('0x2e')](handleEntityNotFound(_0x298eac,null))[_0x0203('0x2e')](function(_0x7ea913){if(_0x7ea913){_0x247cbc=_0x7ea913;_0x40a2d0['model']=_['keys'](db[_0x0203('0x6e')]['rawAttributes']);_0x40a2d0[_0x0203('0x3c')]=_[_0x0203('0x3d')](_0x5b43b0[_0x0203('0x3c')]);_0x40a2d0['filters']=_[_0x0203('0x3f')](_0x40a2d0[_0x0203('0x3b')],_0x40a2d0[_0x0203('0x3c')]);_0x325a16[_0x0203('0x40')]=_['intersection'](_0x40a2d0[_0x0203('0x3b')],qs[_0x0203('0x41')](_0x5b43b0['query'][_0x0203('0x41')]));_0x325a16['attributes']=_0x325a16[_0x0203('0x40')][_0x0203('0x42')]?_0x325a16['attributes']:_0x40a2d0['model'];_0x325a16[_0x0203('0x44')]=qs['sort'](_0x5b43b0[_0x0203('0x3c')][_0x0203('0x45')]);_0x325a16['where']=qs['filters'](_[_0x0203('0x46')](_0x5b43b0[_0x0203('0x3c')],_0x40a2d0['filters']));if(_0x5b43b0[_0x0203('0x3c')]['filter']){_0x325a16[_0x0203('0x47')]=_['merge'](_0x325a16[_0x0203('0x47')],{'$or':_[_0x0203('0x37')](_0x325a16['attributes'],function(_0x3af12a){var _0x452e05={};_0x452e05[_0x3af12a]={'$like':'%'+_0x5b43b0['query'][_0x0203('0x4a')]+'%'};return _0x452e05;})});}_0x325a16=_['merge']({},_0x325a16,_0x5b43b0[_0x0203('0x4b')]);return _0x247cbc['getAgents'](_0x325a16);}})[_0x0203('0x2e')](function(_0x3bab8f){if(_0x3bab8f){_0x4a7f55=_0x3bab8f[_0x0203('0x42')];if(!_0x5b43b0[_0x0203('0x3c')][_0x0203('0x60')](_0x0203('0x43'))){_0x325a16[_0x0203('0x25')]=qs['limit'](_0x5b43b0['query'][_0x0203('0x25')]);_0x325a16[_0x0203('0x23')]=qs[_0x0203('0x23')](_0x5b43b0[_0x0203('0x3c')][_0x0203('0x23')]);}return _0x247cbc['getAgents'](_0x325a16);}})[_0x0203('0x2e')](function(_0x189343){if(_0x189343){return _0x189343?{'count':_0x4a7f55,'rows':_0x189343}:null;}})[_0x0203('0x2e')](respondWithResult(_0x298eac,null))[_0x0203('0x50')](handleError(_0x298eac,null));};
\ No newline at end of file
index 22d982b..1fcf60c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d86=['hook','events','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x510ef9,_0x58f37b){var _0x3c6558=function(_0xa1b305){while(--_0xa1b305){_0x510ef9['push'](_0x510ef9['shift']());}};_0x3c6558(++_0x58f37b);}(_0x3d86,0xbf));var _0x63d8=function(_0xd030f8,_0x20b5a7){_0xd030f8=_0xd030f8-0x0;var _0x488519=_0x3d86[_0xd030f8];return _0x488519;};'use strict';var EventEmitter=require(_0x63d8('0x0'));var FaxQueue=require(_0x63d8('0x1'))['db'][_0x63d8('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x63d8('0x3')](0x0);var events={'afterCreate':_0x63d8('0x4'),'afterUpdate':_0x63d8('0x5'),'afterDestroy':_0x63d8('0x6')};function emitEvent(_0x590958){return function(_0x484b2f,_0x367b8b,_0x983ac1){FaxQueueEvents['emit'](_0x590958+':'+_0x484b2f['id'],_0x484b2f);FaxQueueEvents[_0x63d8('0x7')](_0x590958,_0x484b2f);_0x983ac1(null);};}for(var e in events){if(events[_0x63d8('0x8')](e)){var event=events[e];FaxQueue[_0x63d8('0x9')](e,emitEvent(event));}}module['exports']=FaxQueueEvents;
\ No newline at end of file
+var _0x3222=['exports','events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x3968cf,_0x57aba3){var _0x4b3687=function(_0x2321d5){while(--_0x2321d5){_0x3968cf['push'](_0x3968cf['shift']());}};_0x4b3687(++_0x57aba3);}(_0x3222,0x1e1));var _0x2322=function(_0x2baacf,_0x504f68){_0x2baacf=_0x2baacf-0x0;var _0x21e793=_0x3222[_0x2baacf];return _0x21e793;};'use strict';var EventEmitter=require(_0x2322('0x0'));var FaxQueue=require(_0x2322('0x1'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2322('0x2'),'afterDestroy':_0x2322('0x3')};function emitEvent(_0x3285be){return function(_0x99b16a,_0x327fb4,_0x52045e){FaxQueueEvents[_0x2322('0x4')](_0x3285be+':'+_0x99b16a['id'],_0x99b16a);FaxQueueEvents['emit'](_0x3285be,_0x99b16a);_0x52045e(null);};}for(var e in events){if(events[_0x2322('0x5')](e)){var event=events[e];FaxQueue[_0x2322('0x6')](e,emitEvent(event));}}module[_0x2322('0x7')]=FaxQueueEvents;
\ No newline at end of file
index 8089ab0..212413a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6afc=['FaxQueue','fax_queues','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./faxQueue.attributes','exports','define'];(function(_0x369f7b,_0x4325f0){var _0x4a46b9=function(_0x327df8){while(--_0x327df8){_0x369f7b['push'](_0x369f7b['shift']());}};_0x4a46b9(++_0x4325f0);}(_0x6afc,0xdf));var _0xc6af=function(_0x629258,_0x7302e1){_0x629258=_0x629258-0x0;var _0x1aa316=_0x6afc[_0x629258];return _0x1aa316;};'use strict';var _=require(_0xc6af('0x0'));var util=require(_0xc6af('0x1'));var logger=require(_0xc6af('0x2'))(_0xc6af('0x3'));var moment=require(_0xc6af('0x4'));var BPromise=require('bluebird');var rp=require(_0xc6af('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc6af('0x6'));var config=require(_0xc6af('0x7'));var attributes=require(_0xc6af('0x8'));module[_0xc6af('0x9')]=function(_0x4a7b41,_0x1487d8){return _0x4a7b41[_0xc6af('0xa')](_0xc6af('0xb'),attributes,{'tableName':_0xc6af('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x22b0=['../../config/environment','exports','define','FaxQueue','fax_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x5775c4,_0x11631c){var _0xa2e3a1=function(_0x3c9a67){while(--_0x3c9a67){_0x5775c4['push'](_0x5775c4['shift']());}};_0xa2e3a1(++_0x11631c);}(_0x22b0,0x89));var _0x022b=function(_0x5c3d11,_0x589686){_0x5c3d11=_0x5c3d11-0x0;var _0x31e455=_0x22b0[_0x5c3d11];return _0x31e455;};'use strict';var _=require(_0x022b('0x0'));var util=require(_0x022b('0x1'));var logger=require(_0x022b('0x2'))('api');var moment=require(_0x022b('0x3'));var BPromise=require(_0x022b('0x4'));var rp=require(_0x022b('0x5'));var fs=require('fs');var path=require(_0x022b('0x6'));var rimraf=require('rimraf');var config=require(_0x022b('0x7'));var attributes=require('./faxQueue.attributes');module[_0x022b('0x8')]=function(_0xbeff32,_0x2f24e7){return _0xbeff32[_0x022b('0x9')](_0x022b('0xa'),attributes,{'tableName':_0x022b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3416e8f..246eb3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9ac=['map','model','include','GetFaxQueue','ShowFaxQueue','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','FaxQueue','findAll','options','raw','where','attributes','limit'];(function(_0x2bdab2,_0x3bb6ce){var _0x12c028=function(_0x57cab8){while(--_0x57cab8){_0x2bdab2['push'](_0x2bdab2['shift']());}};_0x12c028(++_0x3bb6ce);}(_0xa9ac,0x140));var _0xca9a=function(_0x3da2d4,_0x4f2fbe){_0x3da2d4=_0x3da2d4-0x0;var _0x4a99f5=_0xa9ac[_0x3da2d4];return _0x4a99f5;};'use strict';var _=require(_0xca9a('0x0'));var util=require(_0xca9a('0x1'));var moment=require(_0xca9a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca9a('0x3'))['db'];var utils=require(_0xca9a('0x4'));var logger=require(_0xca9a('0x5'))('rpc');var config=require(_0xca9a('0x6'));var jayson=require(_0xca9a('0x7'));var client=jayson[_0xca9a('0x8')][_0xca9a('0x9')]({'port':0x232a});config[_0xca9a('0xa')]=_[_0xca9a('0xb')](config[_0xca9a('0xa')],{'host':_0xca9a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xca9a('0xa')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x308213,_0xe45530,_0x527f82){return new BPromise(function(_0x1d8d2d,_0x1f9e7d){return client[_0xca9a('0xd')](_0x308213,_0x527f82)[_0xca9a('0xe')](function(_0x5e445f){logger[_0xca9a('0xf')](_0xca9a('0x10'),_0xe45530,_0xca9a('0x11'));logger['debug'](_0xca9a('0x12'),_0xe45530,_0xca9a('0x11'),JSON[_0xca9a('0x13')](_0x5e445f));if(_0x5e445f['error']){if(_0x5e445f[_0xca9a('0x14')]['code']===0x1f4){logger[_0xca9a('0x14')](_0xca9a('0x10'),_0xe45530,_0x5e445f[_0xca9a('0x14')][_0xca9a('0x15')]);return _0x1f9e7d(_0x5e445f[_0xca9a('0x14')][_0xca9a('0x15')]);}logger[_0xca9a('0x14')](_0xca9a('0x10'),_0xe45530,_0x5e445f['error']['message']);return _0x1d8d2d(_0x5e445f[_0xca9a('0x14')][_0xca9a('0x15')]);}else{logger['info'](_0xca9a('0x10'),_0xe45530,_0xca9a('0x11'));_0x1d8d2d(_0x5e445f['result'][_0xca9a('0x15')]);}})[_0xca9a('0x16')](function(_0xed1a3d){logger['error'](_0xca9a('0x10'),_0xe45530,_0xed1a3d);_0x1f9e7d(_0xed1a3d);});});}exports['GetFaxQueue']=function(_0x5e7bce){var _0x53aff8=this;return new Promise(function(_0x5514fc,_0x3f6f37){return db[_0xca9a('0x17')][_0xca9a('0x18')]({'raw':_0x5e7bce['options']?_0x5e7bce[_0xca9a('0x19')][_0xca9a('0x1a')]===undefined?!![]:![]:!![],'where':_0x5e7bce['options']?_0x5e7bce['options'][_0xca9a('0x1b')]||null:null,'attributes':_0x5e7bce[_0xca9a('0x19')]?_0x5e7bce[_0xca9a('0x19')][_0xca9a('0x1c')]||null:null,'limit':_0x5e7bce[_0xca9a('0x19')]?_0x5e7bce[_0xca9a('0x19')][_0xca9a('0x1d')]||null:null,'include':_0x5e7bce[_0xca9a('0x19')]?_0x5e7bce['options']['include']?_[_0xca9a('0x1e')](_0x5e7bce[_0xca9a('0x19')]['include'],function(_0x46fc69){return{'model':db[_0x46fc69[_0xca9a('0x1f')]],'as':_0x46fc69['as'],'attributes':_0x46fc69[_0xca9a('0x1c')],'include':_0x46fc69[_0xca9a('0x20')]?_[_0xca9a('0x1e')](_0x46fc69[_0xca9a('0x20')],function(_0x4bc633){return{'model':db[_0x4bc633['model']],'as':_0x4bc633['as'],'attributes':_0x4bc633[_0xca9a('0x1c')],'include':_0x4bc633[_0xca9a('0x20')]?_[_0xca9a('0x1e')](_0x4bc633[_0xca9a('0x20')],function(_0x3adffb){return{'model':db[_0x3adffb[_0xca9a('0x1f')]],'as':_0x3adffb['as'],'attributes':_0x3adffb[_0xca9a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xca9a('0xe')](function(_0x3878c5){logger[_0xca9a('0xf')]('GetFaxQueue',_0x5e7bce);logger['debug'](_0xca9a('0x21'),_0x5e7bce,JSON['stringify'](_0x3878c5));_0x5514fc(_0x3878c5);})[_0xca9a('0x16')](function(_0x52078c){logger[_0xca9a('0x14')](_0xca9a('0x21'),_0x52078c[_0xca9a('0x15')],_0x5e7bce);_0x3f6f37(_0x53aff8[_0xca9a('0x14')](0x1f4,_0x52078c['message']));});});};exports[_0xca9a('0x22')]=function(_0x5307b8){var _0xf844e6=this;return new Promise(function(_0xa31add,_0x4dc19d){return db[_0xca9a('0x17')]['find']({'raw':_0x5307b8[_0xca9a('0x19')]?_0x5307b8[_0xca9a('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5307b8[_0xca9a('0x19')]?_0x5307b8[_0xca9a('0x19')][_0xca9a('0x1b')]||null:null,'attributes':_0x5307b8[_0xca9a('0x19')]?_0x5307b8[_0xca9a('0x19')][_0xca9a('0x1c')]||null:null,'include':_0x5307b8[_0xca9a('0x19')]?_0x5307b8['options']['include']?_[_0xca9a('0x1e')](_0x5307b8[_0xca9a('0x19')][_0xca9a('0x20')],function(_0x8fd954){return{'model':db[_0x8fd954['model']],'as':_0x8fd954['as'],'attributes':_0x8fd954[_0xca9a('0x1c')],'include':_0x8fd954['include']?_[_0xca9a('0x1e')](_0x8fd954[_0xca9a('0x20')],function(_0x1e563c){return{'model':db[_0x1e563c['model']],'as':_0x1e563c['as'],'attributes':_0x1e563c[_0xca9a('0x1c')],'include':_0x1e563c['include']?_[_0xca9a('0x1e')](_0x1e563c[_0xca9a('0x20')],function(_0x293374){return{'model':db[_0x293374[_0xca9a('0x1f')]],'as':_0x293374['as'],'attributes':_0x293374[_0xca9a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xca9a('0xe')](function(_0x32138e){logger[_0xca9a('0xf')](_0xca9a('0x22'),_0x5307b8);logger['debug'](_0xca9a('0x22'),_0x5307b8,JSON[_0xca9a('0x13')](_0x32138e));_0xa31add(_0x32138e);})[_0xca9a('0x16')](function(_0x3ad98c){logger['error'](_0xca9a('0x22'),_0x3ad98c[_0xca9a('0x15')],_0x5307b8);_0x4dc19d(_0xf844e6[_0xca9a('0x14')](0x1f4,_0x3ad98c[_0xca9a('0x15')]));});});};
\ No newline at end of file
+var _0xa487=['register','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetFaxQueue','debug','ShowFaxQueue','info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./faxQueue.socket'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa487,0xbe));var _0x7a48=function(_0x47eabb,_0x5c6713){_0x47eabb=_0x47eabb-0x0;var _0x2f0cee=_0xa487[_0x47eabb];return _0x2f0cee;};'use strict';var _=require(_0x7a48('0x0'));var util=require(_0x7a48('0x1'));var moment=require(_0x7a48('0x2'));var BPromise=require(_0x7a48('0x3'));var rs=require(_0x7a48('0x4'));var fs=require('fs');var Redis=require(_0x7a48('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7a48('0x6'));var logger=require(_0x7a48('0x7'))(_0x7a48('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7a48('0x9')][_0x7a48('0xa')]({'port':0x232a});config[_0x7a48('0xb')]=_[_0x7a48('0xc')](config[_0x7a48('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x7a48('0xd'))(new Redis(config[_0x7a48('0xb')]));require(_0x7a48('0xe'))[_0x7a48('0xf')](socket);function respondWithRpcPromise(_0x51726a,_0x4d68a8,_0x25fb02){return new BPromise(function(_0x479510,_0x27a484){return client[_0x7a48('0x10')](_0x51726a,_0x25fb02)[_0x7a48('0x11')](function(_0x204ed3){logger['info'](_0x7a48('0x12'),_0x4d68a8,_0x7a48('0x13'));logger['debug'](_0x7a48('0x14'),_0x4d68a8,'request\x20sent',JSON[_0x7a48('0x15')](_0x204ed3));if(_0x204ed3[_0x7a48('0x16')]){if(_0x204ed3[_0x7a48('0x16')][_0x7a48('0x17')]===0x1f4){logger[_0x7a48('0x16')](_0x7a48('0x12'),_0x4d68a8,_0x204ed3[_0x7a48('0x16')][_0x7a48('0x18')]);return _0x27a484(_0x204ed3['error'][_0x7a48('0x18')]);}logger['error']('FaxQueue,\x20%s,\x20%s',_0x4d68a8,_0x204ed3[_0x7a48('0x16')]['message']);return _0x479510(_0x204ed3['error']['message']);}else{logger['info'](_0x7a48('0x12'),_0x4d68a8,_0x7a48('0x13'));_0x479510(_0x204ed3[_0x7a48('0x19')][_0x7a48('0x18')]);}})[_0x7a48('0x1a')](function(_0x20cbf1){logger[_0x7a48('0x16')](_0x7a48('0x12'),_0x4d68a8,_0x20cbf1);_0x27a484(_0x20cbf1);});});}exports['GetFaxQueue']=function(_0x6468a8){var _0xd0f734=this;return new Promise(function(_0x35cc90,_0x11e4ed){return db[_0x7a48('0x1b')][_0x7a48('0x1c')]({'raw':_0x6468a8['options']?_0x6468a8[_0x7a48('0x1d')][_0x7a48('0x1e')]===undefined?!![]:![]:!![],'where':_0x6468a8[_0x7a48('0x1d')]?_0x6468a8[_0x7a48('0x1d')][_0x7a48('0x1f')]||null:null,'attributes':_0x6468a8[_0x7a48('0x1d')]?_0x6468a8['options'][_0x7a48('0x20')]||null:null,'limit':_0x6468a8[_0x7a48('0x1d')]?_0x6468a8[_0x7a48('0x1d')][_0x7a48('0x21')]||null:null,'include':_0x6468a8['options']?_0x6468a8[_0x7a48('0x1d')][_0x7a48('0x22')]?_[_0x7a48('0x23')](_0x6468a8['options'][_0x7a48('0x22')],function(_0x3e308c){return{'model':db[_0x3e308c['model']],'as':_0x3e308c['as'],'attributes':_0x3e308c[_0x7a48('0x20')],'include':_0x3e308c[_0x7a48('0x22')]?_['map'](_0x3e308c['include'],function(_0x50820a){return{'model':db[_0x50820a[_0x7a48('0x24')]],'as':_0x50820a['as'],'attributes':_0x50820a[_0x7a48('0x20')],'include':_0x50820a['include']?_['map'](_0x50820a[_0x7a48('0x22')],function(_0x504bb5){return{'model':db[_0x504bb5[_0x7a48('0x24')]],'as':_0x504bb5['as'],'attributes':_0x504bb5[_0x7a48('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7a48('0x11')](function(_0xb1dd8e){logger['info'](_0x7a48('0x25'),_0x6468a8);logger[_0x7a48('0x26')](_0x7a48('0x25'),_0x6468a8,JSON[_0x7a48('0x15')](_0xb1dd8e));_0x35cc90(_0xb1dd8e);})['catch'](function(_0x3b476c){logger[_0x7a48('0x16')](_0x7a48('0x25'),_0x3b476c[_0x7a48('0x18')],_0x6468a8);_0x11e4ed(_0xd0f734[_0x7a48('0x16')](0x1f4,_0x3b476c['message']));});});};exports[_0x7a48('0x27')]=function(_0x2f2cf5){var _0xf66404=this;return new Promise(function(_0x22b03a,_0x264357){return db[_0x7a48('0x1b')]['find']({'raw':_0x2f2cf5['options']?_0x2f2cf5[_0x7a48('0x1d')][_0x7a48('0x1e')]===undefined?!![]:![]:!![],'where':_0x2f2cf5[_0x7a48('0x1d')]?_0x2f2cf5[_0x7a48('0x1d')][_0x7a48('0x1f')]||null:null,'attributes':_0x2f2cf5['options']?_0x2f2cf5[_0x7a48('0x1d')][_0x7a48('0x20')]||null:null,'include':_0x2f2cf5[_0x7a48('0x1d')]?_0x2f2cf5[_0x7a48('0x1d')][_0x7a48('0x22')]?_[_0x7a48('0x23')](_0x2f2cf5[_0x7a48('0x1d')]['include'],function(_0x1a649b){return{'model':db[_0x1a649b[_0x7a48('0x24')]],'as':_0x1a649b['as'],'attributes':_0x1a649b[_0x7a48('0x20')],'include':_0x1a649b['include']?_[_0x7a48('0x23')](_0x1a649b[_0x7a48('0x22')],function(_0x9d92b3){return{'model':db[_0x9d92b3[_0x7a48('0x24')]],'as':_0x9d92b3['as'],'attributes':_0x9d92b3[_0x7a48('0x20')],'include':_0x9d92b3[_0x7a48('0x22')]?_[_0x7a48('0x23')](_0x9d92b3['include'],function(_0x44f0cd){return{'model':db[_0x44f0cd[_0x7a48('0x24')]],'as':_0x44f0cd['as'],'attributes':_0x44f0cd[_0x7a48('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7a48('0x11')](function(_0x829ce){logger[_0x7a48('0x28')]('ShowFaxQueue',_0x2f2cf5);logger[_0x7a48('0x26')](_0x7a48('0x27'),_0x2f2cf5,JSON[_0x7a48('0x15')](_0x829ce));_0x22b03a(_0x829ce);})['catch'](function(_0x15bb2a){logger[_0x7a48('0x16')](_0x7a48('0x27'),_0x15bb2a[_0x7a48('0x18')],_0x2f2cf5);_0x264357(_0xf66404[_0x7a48('0x16')](0x1f4,_0x15bb2a[_0x7a48('0x18')]));});});};
\ No newline at end of file
index 18a684c..c05471a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ab1=['emit','removeListener','register','length','./faxQueue.events','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4ab1,0x6d));var _0x14ab=function(_0x437894,_0x29d1be){_0x437894=_0x437894-0x0;var _0x25322b=_0x4ab1[_0x437894];return _0x25322b;};'use strict';var FaxQueueEvents=require(_0x14ab('0x0'));var events=[_0x14ab('0x1'),'remove',_0x14ab('0x2')];function createListener(_0x2cc532,_0x5da392){return function(_0x426839){_0x5da392[_0x14ab('0x3')](_0x2cc532,_0x426839);};}function removeListener(_0x472d15,_0x33b55c){return function(){FaxQueueEvents[_0x14ab('0x4')](_0x472d15,_0x33b55c);};}exports[_0x14ab('0x5')]=function(_0x54c341){for(var _0x3b5de3=0x0,_0x1120cd=events[_0x14ab('0x6')];_0x3b5de3<_0x1120cd;_0x3b5de3++){var _0x4c496d=events[_0x3b5de3];var _0x208d32=createListener('faxQueue:'+_0x4c496d,_0x54c341);FaxQueueEvents['on'](_0x4c496d,_0x208d32);}};
\ No newline at end of file
+var _0xaa40=['emit','removeListener','register','length','./faxQueue.events','remove','update'];(function(_0x1f1272,_0x3bd8d5){var _0x2670ab=function(_0x496fd7){while(--_0x496fd7){_0x1f1272['push'](_0x1f1272['shift']());}};_0x2670ab(++_0x3bd8d5);}(_0xaa40,0x107));var _0x0aa4=function(_0x47b57e,_0x3e23b7){_0x47b57e=_0x47b57e-0x0;var _0xcf4d7f=_0xaa40[_0x47b57e];return _0xcf4d7f;};'use strict';var FaxQueueEvents=require(_0x0aa4('0x0'));var events=['save',_0x0aa4('0x1'),_0x0aa4('0x2')];function createListener(_0x146a21,_0x1c9470){return function(_0x6b94ce){_0x1c9470[_0x0aa4('0x3')](_0x146a21,_0x6b94ce);};}function removeListener(_0x359ef9,_0x37a677){return function(){FaxQueueEvents[_0x0aa4('0x4')](_0x359ef9,_0x37a677);};}exports[_0x0aa4('0x5')]=function(_0x59239e){for(var _0x40e8ea=0x0,_0x2d6d51=events[_0x0aa4('0x6')];_0x40e8ea<_0x2d6d51;_0x40e8ea++){var _0x16233f=events[_0x40e8ea];var _0x4751e2=createListener('faxQueue:'+_0x16233f,_0x59239e);FaxQueueEvents['on'](_0x16233f,_0x4751e2);}};
\ No newline at end of file
index 07b67b7..66c0ebc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x27a0=['/:id/users','getAgents','post','addTeams','addAgents','update','destroy','delete','exports','util','path','connect-timeout','express','Router','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x27a0,0xbf));var _0x027a=function(_0x2473ce,_0x2ca2a6){_0x2473ce=_0x2473ce-0x0;var _0x30f41e=_0x27a0[_0x2473ce];return _0x30f41e;};'use strict';var multer=require('multer');var util=require(_0x027a('0x0'));var path=require(_0x027a('0x1'));var timeout=require(_0x027a('0x2'));var express=require(_0x027a('0x3'));var router=express[_0x027a('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(_0x027a('0x5'));router[_0x027a('0x6')]('/',auth[_0x027a('0x7')](),controller[_0x027a('0x8')]);router[_0x027a('0x6')](_0x027a('0x9'),auth['isAuthenticated'](),controller[_0x027a('0xa')]);router[_0x027a('0x6')](_0x027a('0xb'),auth['isAuthenticated'](),controller[_0x027a('0xc')]);router[_0x027a('0x6')](_0x027a('0xd'),auth['isAuthenticated'](),controller[_0x027a('0xe')]);router[_0x027a('0x6')](_0x027a('0xf'),auth[_0x027a('0x7')](),controller[_0x027a('0x10')]);router[_0x027a('0x6')](_0x027a('0x11'),auth[_0x027a('0x7')](),controller[_0x027a('0x12')]);router[_0x027a('0x13')]('/',auth[_0x027a('0x7')](),controller['create']);router[_0x027a('0x13')](_0x027a('0xf'),auth[_0x027a('0x7')](),controller[_0x027a('0x14')]);router[_0x027a('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0x027a('0x15')]);router['put'](_0x027a('0xb'),auth['isAuthenticated'](),controller[_0x027a('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x027a('0x17')]);router[_0x027a('0x18')](_0x027a('0xf'),auth[_0x027a('0x7')](),controller['removeTeams']);router[_0x027a('0x18')](_0x027a('0x11'),auth['isAuthenticated'](),controller['removeAgents']);module[_0x027a('0x19')]=router;
\ No newline at end of file
+var _0x50a5=['exports','multer','util','fs-extra','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addAgents','update','delete','destroy','removeAgents'];(function(_0xf756de,_0x7aca69){var _0x43eab9=function(_0x4cf309){while(--_0x4cf309){_0xf756de['push'](_0xf756de['shift']());}};_0x43eab9(++_0x7aca69);}(_0x50a5,0xd1));var _0x550a=function(_0x489611,_0xdecc4c){_0x489611=_0x489611-0x0;var _0x36d0fc=_0x50a5[_0x489611];return _0x36d0fc;};'use strict';var multer=require(_0x550a('0x0'));var util=require(_0x550a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x550a('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x550a('0x3'));var config=require(_0x550a('0x4'));var controller=require(_0x550a('0x5'));router[_0x550a('0x6')]('/',auth[_0x550a('0x7')](),controller[_0x550a('0x8')]);router[_0x550a('0x6')](_0x550a('0x9'),auth[_0x550a('0x7')](),controller[_0x550a('0xa')]);router[_0x550a('0x6')](_0x550a('0xb'),auth[_0x550a('0x7')](),controller['show']);router[_0x550a('0x6')](_0x550a('0xc'),auth[_0x550a('0x7')](),controller[_0x550a('0xd')]);router[_0x550a('0x6')](_0x550a('0xe'),auth['isAuthenticated'](),controller[_0x550a('0xf')]);router[_0x550a('0x6')](_0x550a('0x10'),auth[_0x550a('0x7')](),controller[_0x550a('0x11')]);router[_0x550a('0x12')]('/',auth[_0x550a('0x7')](),controller[_0x550a('0x13')]);router['post'](_0x550a('0xe'),auth['isAuthenticated'](),controller['addTeams']);router[_0x550a('0x12')](_0x550a('0x10'),auth['isAuthenticated'](),controller[_0x550a('0x14')]);router['put'](_0x550a('0xb'),auth['isAuthenticated'](),controller[_0x550a('0x15')]);router[_0x550a('0x16')](_0x550a('0xb'),auth[_0x550a('0x7')](),controller[_0x550a('0x17')]);router[_0x550a('0x16')]('/:id/teams',auth[_0x550a('0x7')](),controller['removeTeams']);router[_0x550a('0x16')](_0x550a('0x10'),auth[_0x550a('0x7')](),controller[_0x550a('0x18')]);module[_0x550a('0x19')]=router;
\ No newline at end of file
index eb795e6..d92aa4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3be=['STRING','DATE','moment','sequelize','exports'];(function(_0x2e7048,_0x3ba77d){var _0x60dddb=function(_0x48e314){while(--_0x48e314){_0x2e7048['push'](_0x2e7048['shift']());}};_0x60dddb(++_0x3ba77d);}(_0xe3be,0x93));var _0xee3b=function(_0x57fbf9,_0x25d30c){_0x57fbf9=_0x57fbf9-0x0;var _0x115323=_0xe3be[_0x57fbf9];return _0x115323;};'use strict';var moment=require(_0xee3b('0x0'));var Sequelize=require(_0xee3b('0x1'));module[_0xee3b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xee3b('0x3')]},'joinAt':{'type':Sequelize[_0xee3b('0x4')]},'leaveAt':{'type':Sequelize[_0xee3b('0x4')]},'acceptAt':{'type':Sequelize[_0xee3b('0x4')]},'exitAt':{'type':Sequelize[_0xee3b('0x4')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xd43b=['sequelize','DATE','moment'];(function(_0x3b490e,_0x3eb38a){var _0x2eb929=function(_0x1c26ff){while(--_0x1c26ff){_0x3b490e['push'](_0x3b490e['shift']());}};_0x2eb929(++_0x3eb38a);}(_0xd43b,0xf8));var _0xbd43=function(_0x5a7464,_0x29d9ac){_0x5a7464=_0x5a7464-0x0;var _0x129fff=_0xd43b[_0x5a7464];return _0x129fff;};'use strict';var moment=require(_0xbd43('0x0'));var Sequelize=require(_0xbd43('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xbd43('0x2')]},'acceptAt':{'type':Sequelize[_0xbd43('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 56db160..e24e18b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x255f=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','FaxQueueReport','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','destroy','describe','eml-format'];(function(_0x124e0b,_0x50d410){var _0x2f4c1b=function(_0x38367b){while(--_0x38367b){_0x124e0b['push'](_0x124e0b['shift']());}};_0x2f4c1b(++_0x50d410);}(_0x255f,0x185));var _0xf255=function(_0x2f57db,_0x318730){_0x2f57db=_0x2f57db-0x0;var _0x5ee309=_0x255f[_0x2f57db];return _0x5ee309;};'use strict';var emlformat=require(_0xf255('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf255('0x1'));var jsonpatch=require(_0xf255('0x2'));var rp=require(_0xf255('0x3'));var moment=require('moment');var BPromise=require(_0xf255('0x4'));var Mustache=require(_0xf255('0x5'));var util=require(_0xf255('0x6'));var path=require(_0xf255('0x7'));var sox=require(_0xf255('0x8'));var csv=require(_0xf255('0x9'));var ejs=require(_0xf255('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf255('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf255('0xc'));var deskjs=require(_0xf255('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf255('0xe'));var Papa=require(_0xf255('0xf'));var Redis=require('ioredis');var authService=require(_0xf255('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf255('0x11'));var hardwareService=require(_0xf255('0x12'));var logger=require(_0xf255('0x13'))(_0xf255('0x14'));var utils=require(_0xf255('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf255('0x16'));var db=require(_0xf255('0x17'))['db'];function respondWithStatusCode(_0x35fe1b,_0x50c1ca){_0x50c1ca=_0x50c1ca||0xcc;return function(_0x395f0f){if(_0x395f0f){return _0x35fe1b[_0xf255('0x18')](_0x50c1ca);}return _0x35fe1b['status'](_0x50c1ca)[_0xf255('0x19')]();};}function respondWithResult(_0x266b73,_0x233853){_0x233853=_0x233853||0xc8;return function(_0x49240a){if(_0x49240a){return _0x266b73[_0xf255('0x1a')](_0x233853)[_0xf255('0x1b')](_0x49240a);}};}function respondWithFilteredResult(_0x4b8c8,_0x750c8a){return function(_0x194e28){if(_0x194e28){var _0x4d9a07=typeof _0x750c8a['offset']===_0xf255('0x1c')&&typeof _0x750c8a['limit']===_0xf255('0x1c');var _0x516b16=_0x194e28[_0xf255('0x1d')];var _0x426286=_0x4d9a07?0x0:_0x750c8a[_0xf255('0x1e')];var _0x43902c=_0x4d9a07?_0x194e28[_0xf255('0x1d')]:_0x750c8a[_0xf255('0x1e')]+_0x750c8a[_0xf255('0x1f')];var _0x422a19;if(_0x43902c>=_0x516b16){_0x43902c=_0x516b16;_0x422a19=0xc8;}else{_0x422a19=0xce;}_0x4b8c8[_0xf255('0x1a')](_0x422a19);return _0x4b8c8[_0xf255('0x20')](_0xf255('0x21'),_0x426286+'-'+_0x43902c+'/'+_0x516b16)['json'](_0x194e28);}return null;};}function patchUpdates(_0x2fe87d){return function(_0x1ed880){try{jsonpatch[_0xf255('0x22')](_0x1ed880,_0x2fe87d,!![]);}catch(_0x2c5fbc){return BPromise[_0xf255('0x23')](_0x2c5fbc);}return _0x1ed880[_0xf255('0x24')]();};}function saveUpdates(_0x31bde5,_0x5b9b5f){return function(_0x25d910){if(_0x25d910){return _0x25d910[_0xf255('0x25')](_0x31bde5)[_0xf255('0x26')](function(_0x1dad1e){return _0x1dad1e;});}return null;};}function removeEntity(_0x325ee8,_0x1b3b1a){return function(_0x25eca0){if(_0x25eca0){return _0x25eca0['destroy']()[_0xf255('0x26')](function(){_0x325ee8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d64c5,_0x3270d4){return function(_0x382084){if(!_0x382084){_0x3d64c5[_0xf255('0x18')](0x194);}return _0x382084;};}function handleError(_0x3c0c32,_0x54d391){_0x54d391=_0x54d391||0x1f4;return function(_0x1c3a8e){logger[_0xf255('0x27')](_0x1c3a8e[_0xf255('0x28')]);if(_0x1c3a8e['name']){delete _0x1c3a8e[_0xf255('0x29')];}_0x3c0c32[_0xf255('0x1a')](_0x54d391)[_0xf255('0x2a')](_0x1c3a8e);};}exports['index']=function(_0xa1827e,_0x12424d){var _0x3bc770={},_0x39aac5={},_0x1b6f56={'count':0x0,'rows':[]};var _0x1ca07f=_[_0xf255('0x2b')](db[_0xf255('0x2c')][_0xf255('0x2d')],function(_0x280dac){return{'name':_0x280dac['fieldName'],'type':_0x280dac[_0xf255('0x2e')][_0xf255('0x2f')]};});_0x39aac5[_0xf255('0x30')]=_[_0xf255('0x2b')](_0x1ca07f,_0xf255('0x29'));_0x39aac5[_0xf255('0x31')]=_[_0xf255('0x32')](_0xa1827e[_0xf255('0x31')]);_0x39aac5['filters']=_[_0xf255('0x33')](_0x39aac5['model'],_0x39aac5['query']);_0x3bc770[_0xf255('0x34')]=_[_0xf255('0x33')](_0x39aac5[_0xf255('0x30')],qs[_0xf255('0x35')](_0xa1827e[_0xf255('0x31')][_0xf255('0x35')]));_0x3bc770[_0xf255('0x34')]=_0x3bc770['attributes'][_0xf255('0x36')]?_0x3bc770[_0xf255('0x34')]:_0x39aac5[_0xf255('0x30')];if(!_0xa1827e[_0xf255('0x31')][_0xf255('0x37')](_0xf255('0x38'))){_0x3bc770['limit']=qs[_0xf255('0x1f')](_0xa1827e[_0xf255('0x31')][_0xf255('0x1f')]);_0x3bc770[_0xf255('0x1e')]=qs[_0xf255('0x1e')](_0xa1827e['query'][_0xf255('0x1e')]);}_0x3bc770[_0xf255('0x39')]=qs[_0xf255('0x3a')](_0xa1827e[_0xf255('0x31')][_0xf255('0x3a')]);_0x3bc770[_0xf255('0x3b')]=qs['filters'](_[_0xf255('0x3c')](_0xa1827e[_0xf255('0x31')],_0x39aac5[_0xf255('0x3d')]),_0x1ca07f);if(_0xa1827e[_0xf255('0x31')][_0xf255('0x3e')]){_0x3bc770['where']=_[_0xf255('0x3f')](_0x3bc770[_0xf255('0x3b')],{'$or':_[_0xf255('0x2b')](_0x1ca07f,function(_0x1fd628){if(_0x1fd628[_0xf255('0x2e')]!==_0xf255('0x40')){var _0x4b3733={};_0x4b3733[_0x1fd628['name']]={'$like':'%'+_0xa1827e[_0xf255('0x31')][_0xf255('0x3e')]+'%'};return _0x4b3733;}})});}_0x3bc770=_[_0xf255('0x3f')]({},_0x3bc770,_0xa1827e['options']);var _0x1aef9c={'where':_0x3bc770['where']};return db[_0xf255('0x2c')][_0xf255('0x1d')](_0x1aef9c)[_0xf255('0x26')](function(_0x4516c5){_0x1b6f56[_0xf255('0x1d')]=_0x4516c5;if(_0xa1827e[_0xf255('0x31')][_0xf255('0x41')]){_0x3bc770[_0xf255('0x42')]=[{'all':!![]}];}return db[_0xf255('0x2c')][_0xf255('0x43')](_0x3bc770);})[_0xf255('0x26')](function(_0x22fe5c){_0x1b6f56[_0xf255('0x44')]=_0x22fe5c;return _0x1b6f56;})[_0xf255('0x26')](respondWithFilteredResult(_0x12424d,_0x3bc770))[_0xf255('0x45')](handleError(_0x12424d,null));};exports[_0xf255('0x46')]=function(_0x40a775,_0x4f9d63){var _0x44ea98={'raw':!![],'where':{'id':_0x40a775[_0xf255('0x47')]['id']}},_0x5eedd8={};_0x5eedd8[_0xf255('0x30')]=_['keys'](db[_0xf255('0x2c')]['rawAttributes']);_0x5eedd8[_0xf255('0x31')]=_[_0xf255('0x32')](_0x40a775['query']);_0x5eedd8[_0xf255('0x3d')]=_['intersection'](_0x5eedd8['model'],_0x5eedd8['query']);_0x44ea98[_0xf255('0x34')]=_[_0xf255('0x33')](_0x5eedd8[_0xf255('0x30')],qs[_0xf255('0x35')](_0x40a775['query'][_0xf255('0x35')]));_0x44ea98[_0xf255('0x34')]=_0x44ea98[_0xf255('0x34')][_0xf255('0x36')]?_0x44ea98[_0xf255('0x34')]:_0x5eedd8['model'];if(_0x40a775[_0xf255('0x31')][_0xf255('0x41')]){_0x44ea98[_0xf255('0x42')]=[{'all':!![]}];}_0x44ea98=_[_0xf255('0x3f')]({},_0x44ea98,_0x40a775[_0xf255('0x48')]);return db[_0xf255('0x2c')][_0xf255('0x49')](_0x44ea98)[_0xf255('0x26')](handleEntityNotFound(_0x4f9d63,null))['then'](respondWithResult(_0x4f9d63,null))['catch'](handleError(_0x4f9d63,null));};exports['create']=function(_0x34cc13,_0x4b27e7){return db['FaxQueueReport'][_0xf255('0x4a')](_0x34cc13[_0xf255('0x4b')],{})[_0xf255('0x26')](respondWithResult(_0x4b27e7,0xc9))[_0xf255('0x45')](handleError(_0x4b27e7,null));};exports['update']=function(_0x5bf6e7,_0x1a893c){if(_0x5bf6e7['body']['id']){delete _0x5bf6e7['body']['id'];}return db[_0xf255('0x2c')]['find']({'where':{'id':_0x5bf6e7[_0xf255('0x47')]['id']}})[_0xf255('0x26')](handleEntityNotFound(_0x1a893c,null))[_0xf255('0x26')](saveUpdates(_0x5bf6e7[_0xf255('0x4b')],null))[_0xf255('0x26')](respondWithResult(_0x1a893c,null))[_0xf255('0x45')](handleError(_0x1a893c,null));};exports[_0xf255('0x4c')]=function(_0x392632,_0x271074){return db[_0xf255('0x2c')][_0xf255('0x49')]({'where':{'id':_0x392632[_0xf255('0x47')]['id']}})[_0xf255('0x26')](handleEntityNotFound(_0x271074,null))[_0xf255('0x26')](removeEntity(_0x271074,null))[_0xf255('0x45')](handleError(_0x271074,null));};exports['describe']=function(_0x2d86ea,_0x11ecbd){return db[_0xf255('0x2c')][_0xf255('0x4d')]()[_0xf255('0x26')](respondWithResult(_0x11ecbd,null))['catch'](handleError(_0x11ecbd,null));};
\ No newline at end of file
+var _0xd691=['destroy','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','error','stack','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','findAll','catch','show','params','keys','include','find','update','body'];(function(_0x7d62cb,_0x7622c){var _0x3a6266=function(_0x1cc5fa){while(--_0x1cc5fa){_0x7d62cb['push'](_0x7d62cb['shift']());}};_0x3a6266(++_0x7622c);}(_0xd691,0xe6));var _0x1d69=function(_0x1aa59b,_0x26612c){_0x1aa59b=_0x1aa59b-0x0;var _0x33011c=_0xd691[_0x1aa59b];return _0x33011c;};'use strict';var emlformat=require(_0x1d69('0x0'));var rimraf=require(_0x1d69('0x1'));var zipdir=require(_0x1d69('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1d69('0x3'));var moment=require(_0x1d69('0x4'));var BPromise=require(_0x1d69('0x5'));var Mustache=require(_0x1d69('0x6'));var util=require(_0x1d69('0x7'));var path=require(_0x1d69('0x8'));var sox=require(_0x1d69('0x9'));var csv=require(_0x1d69('0xa'));var ejs=require(_0x1d69('0xb'));var fs=require('fs');var fs_extra=require(_0x1d69('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1d69('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1d69('0xe'));var toCsv=require(_0x1d69('0xa'));var querystring=require(_0x1d69('0xf'));var Papa=require(_0x1d69('0x10'));var Redis=require('ioredis');var authService=require(_0x1d69('0x11'));var qs=require(_0x1d69('0x12'));var as=require(_0x1d69('0x13'));var hardwareService=require(_0x1d69('0x14'));var logger=require(_0x1d69('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x1d69('0x16'));var licenseUtil=require(_0x1d69('0x17'));var db=require(_0x1d69('0x18'))['db'];function respondWithStatusCode(_0x36ca70,_0x3f703a){_0x3f703a=_0x3f703a||0xcc;return function(_0x78b25d){if(_0x78b25d){return _0x36ca70[_0x1d69('0x19')](_0x3f703a);}return _0x36ca70[_0x1d69('0x1a')](_0x3f703a)[_0x1d69('0x1b')]();};}function respondWithResult(_0x7121cb,_0x292721){_0x292721=_0x292721||0xc8;return function(_0x1f4271){if(_0x1f4271){return _0x7121cb[_0x1d69('0x1a')](_0x292721)['json'](_0x1f4271);}};}function respondWithFilteredResult(_0x52f53d,_0x12e7cd){return function(_0x3fb5d2){if(_0x3fb5d2){var _0x29dd32=typeof _0x12e7cd[_0x1d69('0x1c')]===_0x1d69('0x1d')&&typeof _0x12e7cd[_0x1d69('0x1e')]==='undefined';var _0xb7f031=_0x3fb5d2[_0x1d69('0x1f')];var _0x34f6d4=_0x29dd32?0x0:_0x12e7cd['offset'];var _0x4cebea=_0x29dd32?_0x3fb5d2[_0x1d69('0x1f')]:_0x12e7cd[_0x1d69('0x1c')]+_0x12e7cd[_0x1d69('0x1e')];var _0x57bb5d;if(_0x4cebea>=_0xb7f031){_0x4cebea=_0xb7f031;_0x57bb5d=0xc8;}else{_0x57bb5d=0xce;}_0x52f53d[_0x1d69('0x1a')](_0x57bb5d);return _0x52f53d[_0x1d69('0x20')](_0x1d69('0x21'),_0x34f6d4+'-'+_0x4cebea+'/'+_0xb7f031)[_0x1d69('0x22')](_0x3fb5d2);}return null;};}function patchUpdates(_0x3ef4dc){return function(_0x24feaa){try{jsonpatch[_0x1d69('0x23')](_0x24feaa,_0x3ef4dc,!![]);}catch(_0x62968f){return BPromise['reject'](_0x62968f);}return _0x24feaa[_0x1d69('0x24')]();};}function saveUpdates(_0x122238,_0x1786e1){return function(_0x228d18){if(_0x228d18){return _0x228d18['update'](_0x122238)[_0x1d69('0x25')](function(_0x411ca0){return _0x411ca0;});}return null;};}function removeEntity(_0x2b9a7a,_0x54783d){return function(_0x5352d3){if(_0x5352d3){return _0x5352d3['destroy']()[_0x1d69('0x25')](function(){_0x2b9a7a[_0x1d69('0x1a')](0xcc)[_0x1d69('0x1b')]();});}};}function handleEntityNotFound(_0x1c91bf,_0x4f4449){return function(_0x3af518){if(!_0x3af518){_0x1c91bf[_0x1d69('0x19')](0x194);}return _0x3af518;};}function handleError(_0x51e91b,_0x377913){_0x377913=_0x377913||0x1f4;return function(_0x2dc73f){logger[_0x1d69('0x26')](_0x2dc73f[_0x1d69('0x27')]);if(_0x2dc73f[_0x1d69('0x28')]){delete _0x2dc73f[_0x1d69('0x28')];}_0x51e91b['status'](_0x377913)[_0x1d69('0x29')](_0x2dc73f);};}exports[_0x1d69('0x2a')]=function(_0x3c6b2b,_0x1d521b){var _0x3c0962={},_0x1e5818={},_0x2fd8d3={'count':0x0,'rows':[]};var _0x215052=_[_0x1d69('0x2b')](db[_0x1d69('0x2c')][_0x1d69('0x2d')],function(_0x5e8e8e){return{'name':_0x5e8e8e[_0x1d69('0x2e')],'type':_0x5e8e8e['type'][_0x1d69('0x2f')]};});_0x1e5818[_0x1d69('0x30')]=_[_0x1d69('0x2b')](_0x215052,_0x1d69('0x28'));_0x1e5818['query']=_['keys'](_0x3c6b2b[_0x1d69('0x31')]);_0x1e5818['filters']=_[_0x1d69('0x32')](_0x1e5818[_0x1d69('0x30')],_0x1e5818[_0x1d69('0x31')]);_0x3c0962[_0x1d69('0x33')]=_[_0x1d69('0x32')](_0x1e5818[_0x1d69('0x30')],qs[_0x1d69('0x34')](_0x3c6b2b[_0x1d69('0x31')][_0x1d69('0x34')]));_0x3c0962[_0x1d69('0x33')]=_0x3c0962[_0x1d69('0x33')][_0x1d69('0x35')]?_0x3c0962[_0x1d69('0x33')]:_0x1e5818[_0x1d69('0x30')];if(!_0x3c6b2b['query'][_0x1d69('0x36')](_0x1d69('0x37'))){_0x3c0962[_0x1d69('0x1e')]=qs[_0x1d69('0x1e')](_0x3c6b2b[_0x1d69('0x31')]['limit']);_0x3c0962[_0x1d69('0x1c')]=qs[_0x1d69('0x1c')](_0x3c6b2b[_0x1d69('0x31')][_0x1d69('0x1c')]);}_0x3c0962['order']=qs[_0x1d69('0x38')](_0x3c6b2b[_0x1d69('0x31')][_0x1d69('0x38')]);_0x3c0962[_0x1d69('0x39')]=qs[_0x1d69('0x3a')](_['pick'](_0x3c6b2b['query'],_0x1e5818['filters']),_0x215052);if(_0x3c6b2b[_0x1d69('0x31')][_0x1d69('0x3b')]){_0x3c0962['where']=_[_0x1d69('0x3c')](_0x3c0962[_0x1d69('0x39')],{'$or':_[_0x1d69('0x2b')](_0x215052,function(_0x497e02){if(_0x497e02[_0x1d69('0x3d')]!==_0x1d69('0x3e')){var _0x1a8ba4={};_0x1a8ba4[_0x497e02[_0x1d69('0x28')]]={'$like':'%'+_0x3c6b2b['query'][_0x1d69('0x3b')]+'%'};return _0x1a8ba4;}})});}_0x3c0962=_[_0x1d69('0x3c')]({},_0x3c0962,_0x3c6b2b[_0x1d69('0x3f')]);var _0x3c09bb={'where':_0x3c0962['where']};return db[_0x1d69('0x2c')][_0x1d69('0x1f')](_0x3c09bb)[_0x1d69('0x25')](function(_0x38306a){_0x2fd8d3[_0x1d69('0x1f')]=_0x38306a;if(_0x3c6b2b[_0x1d69('0x31')][_0x1d69('0x40')]){_0x3c0962['include']=[{'all':!![]}];}return db[_0x1d69('0x2c')][_0x1d69('0x41')](_0x3c0962);})['then'](function(_0x3d68c3){_0x2fd8d3['rows']=_0x3d68c3;return _0x2fd8d3;})[_0x1d69('0x25')](respondWithFilteredResult(_0x1d521b,_0x3c0962))[_0x1d69('0x42')](handleError(_0x1d521b,null));};exports[_0x1d69('0x43')]=function(_0xc052d6,_0x5b0a74){var _0x1d6fee={'raw':!![],'where':{'id':_0xc052d6[_0x1d69('0x44')]['id']}},_0x21dfc2={};_0x21dfc2['model']=_[_0x1d69('0x45')](db['FaxQueueReport']['rawAttributes']);_0x21dfc2[_0x1d69('0x31')]=_[_0x1d69('0x45')](_0xc052d6['query']);_0x21dfc2[_0x1d69('0x3a')]=_['intersection'](_0x21dfc2[_0x1d69('0x30')],_0x21dfc2[_0x1d69('0x31')]);_0x1d6fee['attributes']=_[_0x1d69('0x32')](_0x21dfc2[_0x1d69('0x30')],qs[_0x1d69('0x34')](_0xc052d6['query'][_0x1d69('0x34')]));_0x1d6fee[_0x1d69('0x33')]=_0x1d6fee[_0x1d69('0x33')][_0x1d69('0x35')]?_0x1d6fee[_0x1d69('0x33')]:_0x21dfc2[_0x1d69('0x30')];if(_0xc052d6[_0x1d69('0x31')][_0x1d69('0x40')]){_0x1d6fee[_0x1d69('0x46')]=[{'all':!![]}];}_0x1d6fee=_[_0x1d69('0x3c')]({},_0x1d6fee,_0xc052d6[_0x1d69('0x3f')]);return db[_0x1d69('0x2c')][_0x1d69('0x47')](_0x1d6fee)[_0x1d69('0x25')](handleEntityNotFound(_0x5b0a74,null))[_0x1d69('0x25')](respondWithResult(_0x5b0a74,null))[_0x1d69('0x42')](handleError(_0x5b0a74,null));};exports['create']=function(_0x438b3a,_0x11cf7c){return db[_0x1d69('0x2c')]['create'](_0x438b3a['body'],{})[_0x1d69('0x25')](respondWithResult(_0x11cf7c,0xc9))['catch'](handleError(_0x11cf7c,null));};exports[_0x1d69('0x48')]=function(_0x370645,_0x131304){if(_0x370645['body']['id']){delete _0x370645['body']['id'];}return db[_0x1d69('0x2c')]['find']({'where':{'id':_0x370645[_0x1d69('0x44')]['id']}})['then'](handleEntityNotFound(_0x131304,null))['then'](saveUpdates(_0x370645[_0x1d69('0x49')],null))[_0x1d69('0x25')](respondWithResult(_0x131304,null))[_0x1d69('0x42')](handleError(_0x131304,null));};exports[_0x1d69('0x4a')]=function(_0x442041,_0x4e6453){return db[_0x1d69('0x2c')][_0x1d69('0x47')]({'where':{'id':_0x442041['params']['id']}})[_0x1d69('0x25')](handleEntityNotFound(_0x4e6453,null))[_0x1d69('0x25')](removeEntity(_0x4e6453,null))[_0x1d69('0x42')](handleError(_0x4e6453,null));};exports[_0x1d69('0x4b')]=function(_0x4d17b7,_0x10d730){return db['FaxQueueReport'][_0x1d69('0x4b')]()[_0x1d69('0x25')](respondWithResult(_0x10d730,null))[_0x1d69('0x42')](handleError(_0x10d730,null));};
\ No newline at end of file
index d0e7d52..5f412bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc4aa=['bluebird','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','../../config/logger','api','moment'];(function(_0x5a07ba,_0x3e2e4d){var _0x2a93dc=function(_0x5edce7){while(--_0x5edce7){_0x5a07ba['push'](_0x5a07ba['shift']());}};_0x2a93dc(++_0x3e2e4d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xc4aa[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x4975=['path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5859d9,_0x4abdc7){var _0x53db0e=function(_0x3a5386){while(--_0x3a5386){_0x5859d9['push'](_0x5859d9['shift']());}};_0x53db0e(++_0x4abdc7);}(_0x4975,0x86));var _0x5497=function(_0x96d762,_0x40edf5){_0x96d762=_0x96d762-0x0;var _0x142f0f=_0x4975[_0x96d762];return _0x142f0f;};'use strict';var _=require(_0x5497('0x0'));var util=require('util');var logger=require(_0x5497('0x1'))(_0x5497('0x2'));var moment=require(_0x5497('0x3'));var BPromise=require(_0x5497('0x4'));var rp=require(_0x5497('0x5'));var fs=require('fs');var path=require(_0x5497('0x6'));var rimraf=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var attributes=require(_0x5497('0x9'));module[_0x5497('0xa')]=function(_0x539a27,_0x37e48d){return _0x539a27['define'](_0x5497('0xb'),attributes,{'tableName':_0x5497('0xc'),'paranoid':![],'indexes':[{'name':_0x5497('0xd'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index be88687..ad167fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3a0=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','code','error','FaxQueueReport,\x20%s,\x20%s','message','result','catch','CreateFaxQueueReport','FaxQueueReport','body','options','raw','where','attributes','UpdateFaxQueueReport','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa3a0,0xf3));var _0x0a3a=function(_0x2d1b47,_0x11d484){_0x2d1b47=_0x2d1b47-0x0;var _0x3178ff=_0xa3a0[_0x2d1b47];return _0x3178ff;};'use strict';var _=require(_0x0a3a('0x0'));var util=require(_0x0a3a('0x1'));var moment=require(_0x0a3a('0x2'));var BPromise=require(_0x0a3a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0a3a('0x4'))['db'];var utils=require(_0x0a3a('0x5'));var logger=require(_0x0a3a('0x6'))(_0x0a3a('0x7'));var config=require('../../config/environment');var jayson=require(_0x0a3a('0x8'));var client=jayson[_0x0a3a('0x9')][_0x0a3a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4fa67a,_0x2c9645,_0x22a96c){return new BPromise(function(_0xa6869d,_0x20661e){return client[_0x0a3a('0xb')](_0x4fa67a,_0x22a96c)[_0x0a3a('0xc')](function(_0x172db4){logger[_0x0a3a('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x2c9645,'request\x20sent');logger[_0x0a3a('0xe')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x2c9645,_0x0a3a('0xf'),JSON[_0x0a3a('0x10')](_0x172db4));if(_0x172db4['error']){if(_0x172db4['error'][_0x0a3a('0x11')]===0x1f4){logger[_0x0a3a('0x12')](_0x0a3a('0x13'),_0x2c9645,_0x172db4[_0x0a3a('0x12')][_0x0a3a('0x14')]);return _0x20661e(_0x172db4[_0x0a3a('0x12')][_0x0a3a('0x14')]);}logger[_0x0a3a('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x2c9645,_0x172db4[_0x0a3a('0x12')][_0x0a3a('0x14')]);return _0xa6869d(_0x172db4[_0x0a3a('0x12')][_0x0a3a('0x14')]);}else{logger[_0x0a3a('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x2c9645,_0x0a3a('0xf'));_0xa6869d(_0x172db4[_0x0a3a('0x15')][_0x0a3a('0x14')]);}})[_0x0a3a('0x16')](function(_0x4b94d2){logger[_0x0a3a('0x12')]('FaxQueueReport,\x20%s,\x20%s',_0x2c9645,_0x4b94d2);_0x20661e(_0x4b94d2);});});}exports[_0x0a3a('0x17')]=function(_0x377e48){var _0x46ccdb=this;return new Promise(function(_0x847a12,_0xe399cc){return db[_0x0a3a('0x18')]['create'](_0x377e48[_0x0a3a('0x19')],{'raw':_0x377e48[_0x0a3a('0x1a')]?_0x377e48[_0x0a3a('0x1a')][_0x0a3a('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x12b2de){logger[_0x0a3a('0xd')]('CreateFaxQueueReport',_0x377e48);logger[_0x0a3a('0xe')](_0x0a3a('0x17'),_0x377e48,JSON[_0x0a3a('0x10')](_0x12b2de));_0x847a12(_0x12b2de);})[_0x0a3a('0x16')](function(_0x840428){logger[_0x0a3a('0x12')](_0x0a3a('0x17'),_0x840428[_0x0a3a('0x14')],_0x377e48);_0xe399cc(_0x46ccdb[_0x0a3a('0x12')](0x1f4,_0x840428['message']));});});};exports['UpdateFaxQueueReport']=function(_0x1640bd){var _0x444a3d=this;return new Promise(function(_0x1fbe26,_0x517908){return db['FaxQueueReport']['update'](_0x1640bd[_0x0a3a('0x19')],{'raw':_0x1640bd[_0x0a3a('0x1a')]?_0x1640bd[_0x0a3a('0x1a')][_0x0a3a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1640bd[_0x0a3a('0x1a')]?_0x1640bd[_0x0a3a('0x1a')][_0x0a3a('0x1c')]||null:null,'attributes':_0x1640bd[_0x0a3a('0x1a')]?_0x1640bd[_0x0a3a('0x1a')][_0x0a3a('0x1d')]||null:null,'limit':_0x1640bd['options']?_0x1640bd[_0x0a3a('0x1a')]['limit']||null:null})[_0x0a3a('0xc')](function(_0xdcde16){logger[_0x0a3a('0xd')](_0x0a3a('0x1e'),_0x1640bd);logger['debug'](_0x0a3a('0x1e'),_0x1640bd,JSON[_0x0a3a('0x10')](_0xdcde16));_0x1fbe26(_0xdcde16);})[_0x0a3a('0x16')](function(_0x202a68){logger[_0x0a3a('0x12')](_0x0a3a('0x1e'),_0x202a68[_0x0a3a('0x14')],_0x1640bd);_0x517908(_0x444a3d[_0x0a3a('0x12')](0x1f4,_0x202a68[_0x0a3a('0x14')]));});});};
\ No newline at end of file
+var _0x4907=['jayson/promise','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','UpdateFaxQueueReport','update','where','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x4208d6,_0x157be1){var _0x2db794=function(_0x427dc9){while(--_0x427dc9){_0x4208d6['push'](_0x4208d6['shift']());}};_0x2db794(++_0x157be1);}(_0x4907,0x14b));var _0x7490=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4907[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x7490('0x0'));var moment=require(_0x7490('0x1'));var BPromise=require(_0x7490('0x2'));var rs=require(_0x7490('0x3'));var fs=require('fs');var Redis=require(_0x7490('0x4'));var db=require(_0x7490('0x5'))['db'];var utils=require(_0x7490('0x6'));var logger=require('../../config/logger')(_0x7490('0x7'));var config=require(_0x7490('0x8'));var jayson=require(_0x7490('0x9'));var client=jayson[_0x7490('0xa')][_0x7490('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40156b,_0x2087ce,_0x133e7f){return new BPromise(function(_0x2a7e81,_0x2218b1){return client[_0x7490('0xc')](_0x40156b,_0x133e7f)[_0x7490('0xd')](function(_0x3bb112){logger[_0x7490('0xe')](_0x7490('0xf'),_0x2087ce,_0x7490('0x10'));logger[_0x7490('0x11')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x2087ce,_0x7490('0x10'),JSON[_0x7490('0x12')](_0x3bb112));if(_0x3bb112['error']){if(_0x3bb112['error'][_0x7490('0x13')]===0x1f4){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x2087ce,_0x3bb112[_0x7490('0x14')][_0x7490('0x15')]);return _0x2218b1(_0x3bb112[_0x7490('0x14')][_0x7490('0x15')]);}logger[_0x7490('0x14')]('FaxQueueReport,\x20%s,\x20%s',_0x2087ce,_0x3bb112[_0x7490('0x14')][_0x7490('0x15')]);return _0x2a7e81(_0x3bb112[_0x7490('0x14')]['message']);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x2087ce,'request\x20sent');_0x2a7e81(_0x3bb112[_0x7490('0x16')][_0x7490('0x15')]);}})[_0x7490('0x17')](function(_0x4c2e9f){logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x2087ce,_0x4c2e9f);_0x2218b1(_0x4c2e9f);});});}exports[_0x7490('0x18')]=function(_0x3641d6){var _0x18ffc8=this;return new Promise(function(_0x28df66,_0x4680e3){return db[_0x7490('0x19')][_0x7490('0x1a')](_0x3641d6[_0x7490('0x1b')],{'raw':_0x3641d6[_0x7490('0x1c')]?_0x3641d6[_0x7490('0x1c')][_0x7490('0x1d')]===undefined?!![]:![]:!![]})[_0x7490('0xd')](function(_0x268719){logger[_0x7490('0xe')](_0x7490('0x18'),_0x3641d6);logger[_0x7490('0x11')](_0x7490('0x18'),_0x3641d6,JSON[_0x7490('0x12')](_0x268719));_0x28df66(_0x268719);})['catch'](function(_0x3a10e3){logger[_0x7490('0x14')](_0x7490('0x18'),_0x3a10e3['message'],_0x3641d6);_0x4680e3(_0x18ffc8[_0x7490('0x14')](0x1f4,_0x3a10e3[_0x7490('0x15')]));});});};exports[_0x7490('0x1e')]=function(_0xeb344f){var _0x5bb7c5=this;return new Promise(function(_0x18a3af,_0x5d7ff2){return db['FaxQueueReport'][_0x7490('0x1f')](_0xeb344f[_0x7490('0x1b')],{'raw':_0xeb344f[_0x7490('0x1c')]?_0xeb344f[_0x7490('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xeb344f[_0x7490('0x1c')]?_0xeb344f['options'][_0x7490('0x20')]||null:null,'attributes':_0xeb344f['options']?_0xeb344f[_0x7490('0x1c')]['attributes']||null:null,'limit':_0xeb344f[_0x7490('0x1c')]?_0xeb344f[_0x7490('0x1c')][_0x7490('0x21')]||null:null})[_0x7490('0xd')](function(_0x3861bb){logger[_0x7490('0xe')](_0x7490('0x1e'),_0xeb344f);logger['debug'](_0x7490('0x1e'),_0xeb344f,JSON[_0x7490('0x12')](_0x3861bb));_0x18a3af(_0x3861bb);})[_0x7490('0x17')](function(_0x3cd10a){logger['error']('UpdateFaxQueueReport',_0x3cd10a[_0x7490('0x15')],_0xeb344f);_0x5d7ff2(_0x5bb7c5[_0x7490('0x14')](0x1f4,_0x3cd10a[_0x7490('0x15')]));});});};
\ No newline at end of file
index 6e38e56..242fea1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9f1=['fs-extra','../../components/interaction/service','./faxQueueReport.controller','isAuthenticated','index','get','/describe','describe','post','create','put','/:id','update','destroy','exports','multer','connect-timeout','Router'];(function(_0x59557e,_0x8f9209){var _0x2bfe66=function(_0x413290){while(--_0x413290){_0x59557e['push'](_0x59557e['shift']());}};_0x2bfe66(++_0x8f9209);}(_0xe9f1,0xc3));var _0x1e9f=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xe9f1[_0x40bffc];return _0x3007e9;};'use strict';var multer=require(_0x1e9f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1e9f('0x1'));var express=require('express');var router=express[_0x1e9f('0x2')]();var fs_extra=require(_0x1e9f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1e9f('0x4'));var config=require('../../config/environment');var controller=require(_0x1e9f('0x5'));router['get']('/',auth[_0x1e9f('0x6')](),controller[_0x1e9f('0x7')]);router[_0x1e9f('0x8')](_0x1e9f('0x9'),auth[_0x1e9f('0x6')](),controller[_0x1e9f('0xa')]);router[_0x1e9f('0x8')]('/:id',auth[_0x1e9f('0x6')](),controller['show']);router[_0x1e9f('0xb')]('/',auth[_0x1e9f('0x6')](),controller[_0x1e9f('0xc')]);router[_0x1e9f('0xd')](_0x1e9f('0xe'),auth[_0x1e9f('0x6')](),controller[_0x1e9f('0xf')]);router['delete'](_0x1e9f('0xe'),auth[_0x1e9f('0x6')](),controller[_0x1e9f('0x10')]);module[_0x1e9f('0x11')]=router;
\ No newline at end of file
+var _0x0f82=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','multer','path'];(function(_0x1a7217,_0x25a7b7){var _0x14291b=function(_0x516763){while(--_0x516763){_0x1a7217['push'](_0x1a7217['shift']());}};_0x14291b(++_0x25a7b7);}(_0x0f82,0x97));var _0x20f8=function(_0x30a36d,_0x92a66b){_0x30a36d=_0x30a36d-0x0;var _0x2f38cc=_0x0f82[_0x30a36d];return _0x2f38cc;};'use strict';var multer=require(_0x20f8('0x0'));var util=require('util');var path=require(_0x20f8('0x1'));var timeout=require('connect-timeout');var express=require(_0x20f8('0x2'));var router=express[_0x20f8('0x3')]();var fs_extra=require(_0x20f8('0x4'));var auth=require(_0x20f8('0x5'));var interaction=require(_0x20f8('0x6'));var config=require(_0x20f8('0x7'));var controller=require(_0x20f8('0x8'));router[_0x20f8('0x9')]('/',auth[_0x20f8('0xa')](),controller[_0x20f8('0xb')]);router[_0x20f8('0x9')](_0x20f8('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x20f8('0x9')](_0x20f8('0xd'),auth[_0x20f8('0xa')](),controller[_0x20f8('0xe')]);router['post']('/',auth[_0x20f8('0xa')](),controller[_0x20f8('0xf')]);router[_0x20f8('0x10')](_0x20f8('0xd'),auth[_0x20f8('0xa')](),controller['update']);router['delete'](_0x20f8('0xd'),auth[_0x20f8('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index eb30b55..48dca1a 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(_0x1a992a,_0x3ae516){var _0x3fb4ef=function(_0x339645){while(--_0x339645){_0x1a992a['push'](_0x1a992a['shift']());}};_0x3fb4ef(++_0x3ae516);}(_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 _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x33dc9b,_0x4f3aa8){var _0x1fd96d=function(_0x314cef){while(--_0x314cef){_0x33dc9b['push'](_0x33dc9b['shift']());}};_0x1fd96d(++_0x4f3aa8);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2bfe52,_0x43946e){_0x2bfe52=_0x2bfe52-0x0;var _0x1cf649=_0xcb91[_0x2bfe52];return _0x1cf649;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}};
\ No newline at end of file
index ccbab7d..99d4a5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xec97=['request-promise','moment','util','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','count','limit','set','Content-Range','save','update','destroy','then','error','stack','name','send','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','findAll','rows','catch','show','params','fields','length','includeAll','include','options','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x28b0a1,_0x99bd0a){var _0x21470c=function(_0x45bf01){while(--_0x45bf01){_0x28b0a1['push'](_0x28b0a1['shift']());}};_0x21470c(++_0x99bd0a);}(_0xec97,0x1b2));var _0x7ec9=function(_0x138541,_0x33f9d0){_0x138541=_0x138541-0x0;var _0x3fb2fc=_0xec97[_0x138541];return _0x3fb2fc;};'use strict';var emlformat=require(_0x7ec9('0x0'));var rimraf=require(_0x7ec9('0x1'));var zipdir=require(_0x7ec9('0x2'));var jsonpatch=require(_0x7ec9('0x3'));var rp=require(_0x7ec9('0x4'));var moment=require(_0x7ec9('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7ec9('0x6'));var path=require(_0x7ec9('0x7'));var sox=require(_0x7ec9('0x8'));var csv=require('to-csv');var ejs=require(_0x7ec9('0x9'));var fs=require('fs');var fs_extra=require(_0x7ec9('0xa'));var _=require(_0x7ec9('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7ec9('0xc'));var deskjs=require(_0x7ec9('0xd'));var toCsv=require(_0x7ec9('0xe'));var querystring=require(_0x7ec9('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7ec9('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7ec9('0x11'));var hardwareService=require(_0x7ec9('0x12'));var logger=require('../../config/logger')(_0x7ec9('0x13'));var utils=require(_0x7ec9('0x14'));var config=require(_0x7ec9('0x15'));var licenseUtil=require(_0x7ec9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f6f22,_0x1a5451){_0x1a5451=_0x1a5451||0xcc;return function(_0x48209c){if(_0x48209c){return _0x3f6f22[_0x7ec9('0x17')](_0x1a5451);}return _0x3f6f22['status'](_0x1a5451)[_0x7ec9('0x18')]();};}function respondWithResult(_0x147cf2,_0x26d5b9){_0x26d5b9=_0x26d5b9||0xc8;return function(_0x58a6bc){if(_0x58a6bc){return _0x147cf2[_0x7ec9('0x19')](_0x26d5b9)['json'](_0x58a6bc);}};}function respondWithFilteredResult(_0x3b9cf9,_0x2038aa){return function(_0x246cb9){if(_0x246cb9){var _0x56ba80=typeof _0x2038aa[_0x7ec9('0x1a')]==='undefined'&&typeof _0x2038aa['limit']==='undefined';var _0x1a6d99=_0x246cb9[_0x7ec9('0x1b')];var _0x597209=_0x56ba80?0x0:_0x2038aa[_0x7ec9('0x1a')];var _0x4b677b=_0x56ba80?_0x246cb9[_0x7ec9('0x1b')]:_0x2038aa['offset']+_0x2038aa[_0x7ec9('0x1c')];var _0x38c35c;if(_0x4b677b>=_0x1a6d99){_0x4b677b=_0x1a6d99;_0x38c35c=0xc8;}else{_0x38c35c=0xce;}_0x3b9cf9[_0x7ec9('0x19')](_0x38c35c);return _0x3b9cf9[_0x7ec9('0x1d')](_0x7ec9('0x1e'),_0x597209+'-'+_0x4b677b+'/'+_0x1a6d99)['json'](_0x246cb9);}return null;};}function patchUpdates(_0x3af608){return function(_0x17d6b2){try{jsonpatch['apply'](_0x17d6b2,_0x3af608,!![]);}catch(_0x3ee3e6){return BPromise['reject'](_0x3ee3e6);}return _0x17d6b2[_0x7ec9('0x1f')]();};}function saveUpdates(_0x3908e5,_0x46e035){return function(_0x2a5e22){if(_0x2a5e22){return _0x2a5e22[_0x7ec9('0x20')](_0x3908e5)['then'](function(_0x5b0c5d){return _0x5b0c5d;});}return null;};}function removeEntity(_0x3028be,_0x53d17e){return function(_0x4f5156){if(_0x4f5156){return _0x4f5156[_0x7ec9('0x21')]()[_0x7ec9('0x22')](function(){_0x3028be[_0x7ec9('0x19')](0xcc)[_0x7ec9('0x18')]();});}};}function handleEntityNotFound(_0x44469b,_0x43a9d8){return function(_0x11b0b1){if(!_0x11b0b1){_0x44469b[_0x7ec9('0x17')](0x194);}return _0x11b0b1;};}function handleError(_0x55db81,_0x5747c0){_0x5747c0=_0x5747c0||0x1f4;return function(_0x5bc547){logger[_0x7ec9('0x23')](_0x5bc547[_0x7ec9('0x24')]);if(_0x5bc547[_0x7ec9('0x25')]){delete _0x5bc547[_0x7ec9('0x25')];}_0x55db81[_0x7ec9('0x19')](_0x5747c0)[_0x7ec9('0x26')](_0x5bc547);};}exports['index']=function(_0x403a19,_0x60bd68){var _0x12d626={},_0x49de50={},_0x32c7d7={'count':0x0,'rows':[]};var _0x552c7c=_[_0x7ec9('0x27')](db[_0x7ec9('0x28')][_0x7ec9('0x29')],function(_0x2f7765){return{'name':_0x2f7765[_0x7ec9('0x2a')],'type':_0x2f7765[_0x7ec9('0x2b')][_0x7ec9('0x2c')]};});_0x49de50[_0x7ec9('0x2d')]=_[_0x7ec9('0x27')](_0x552c7c,_0x7ec9('0x25'));_0x49de50[_0x7ec9('0x2e')]=_[_0x7ec9('0x2f')](_0x403a19[_0x7ec9('0x2e')]);_0x49de50[_0x7ec9('0x30')]=_[_0x7ec9('0x31')](_0x49de50[_0x7ec9('0x2d')],_0x49de50[_0x7ec9('0x2e')]);_0x12d626['attributes']=_[_0x7ec9('0x31')](_0x49de50['model'],qs['fields'](_0x403a19[_0x7ec9('0x2e')]['fields']));_0x12d626['attributes']=_0x12d626[_0x7ec9('0x32')]['length']?_0x12d626[_0x7ec9('0x32')]:_0x49de50[_0x7ec9('0x2d')];if(!_0x403a19[_0x7ec9('0x2e')][_0x7ec9('0x33')](_0x7ec9('0x34'))){_0x12d626[_0x7ec9('0x1c')]=qs[_0x7ec9('0x1c')](_0x403a19[_0x7ec9('0x2e')][_0x7ec9('0x1c')]);_0x12d626[_0x7ec9('0x1a')]=qs[_0x7ec9('0x1a')](_0x403a19[_0x7ec9('0x2e')][_0x7ec9('0x1a')]);}_0x12d626[_0x7ec9('0x35')]=qs[_0x7ec9('0x36')](_0x403a19[_0x7ec9('0x2e')]['sort']);_0x12d626[_0x7ec9('0x37')]=qs[_0x7ec9('0x30')](_[_0x7ec9('0x38')](_0x403a19[_0x7ec9('0x2e')],_0x49de50['filters']),_0x552c7c);if(_0x403a19['query'][_0x7ec9('0x39')]){_0x12d626[_0x7ec9('0x37')]=_['merge'](_0x12d626[_0x7ec9('0x37')],{'$or':_[_0x7ec9('0x27')](_0x552c7c,function(_0x53a706){if(_0x53a706[_0x7ec9('0x2b')]!==_0x7ec9('0x3a')){var _0x605fb0={};_0x605fb0[_0x53a706[_0x7ec9('0x25')]]={'$like':'%'+_0x403a19[_0x7ec9('0x2e')][_0x7ec9('0x39')]+'%'};return _0x605fb0;}})});}_0x12d626=_[_0x7ec9('0x3b')]({},_0x12d626,_0x403a19['options']);var _0x592863={'where':_0x12d626[_0x7ec9('0x37')]};return db[_0x7ec9('0x28')][_0x7ec9('0x1b')](_0x592863)[_0x7ec9('0x22')](function(_0x87b9f0){_0x32c7d7[_0x7ec9('0x1b')]=_0x87b9f0;if(_0x403a19[_0x7ec9('0x2e')]['includeAll']){_0x12d626['include']=[{'all':!![]}];}return db['FaxTransferReport'][_0x7ec9('0x3c')](_0x12d626);})[_0x7ec9('0x22')](function(_0x3b1ebe){_0x32c7d7[_0x7ec9('0x3d')]=_0x3b1ebe;return _0x32c7d7;})['then'](respondWithFilteredResult(_0x60bd68,_0x12d626))[_0x7ec9('0x3e')](handleError(_0x60bd68,null));};exports[_0x7ec9('0x3f')]=function(_0x5c6a7a,_0x52da5c){var _0x49cd53={'raw':!![],'where':{'id':_0x5c6a7a[_0x7ec9('0x40')]['id']}},_0x21c076={};_0x21c076['model']=_[_0x7ec9('0x2f')](db[_0x7ec9('0x28')][_0x7ec9('0x29')]);_0x21c076[_0x7ec9('0x2e')]=_[_0x7ec9('0x2f')](_0x5c6a7a[_0x7ec9('0x2e')]);_0x21c076['filters']=_['intersection'](_0x21c076[_0x7ec9('0x2d')],_0x21c076[_0x7ec9('0x2e')]);_0x49cd53[_0x7ec9('0x32')]=_['intersection'](_0x21c076[_0x7ec9('0x2d')],qs[_0x7ec9('0x41')](_0x5c6a7a['query'][_0x7ec9('0x41')]));_0x49cd53['attributes']=_0x49cd53[_0x7ec9('0x32')][_0x7ec9('0x42')]?_0x49cd53[_0x7ec9('0x32')]:_0x21c076[_0x7ec9('0x2d')];if(_0x5c6a7a[_0x7ec9('0x2e')][_0x7ec9('0x43')]){_0x49cd53[_0x7ec9('0x44')]=[{'all':!![]}];}_0x49cd53=_[_0x7ec9('0x3b')]({},_0x49cd53,_0x5c6a7a[_0x7ec9('0x45')]);return db[_0x7ec9('0x28')]['find'](_0x49cd53)['then'](handleEntityNotFound(_0x52da5c,null))[_0x7ec9('0x22')](respondWithResult(_0x52da5c,null))['catch'](handleError(_0x52da5c,null));};exports[_0x7ec9('0x46')]=function(_0x5e53ca,_0x48cd44){return db[_0x7ec9('0x28')][_0x7ec9('0x46')](_0x5e53ca['body'],{})[_0x7ec9('0x22')](respondWithResult(_0x48cd44,0xc9))[_0x7ec9('0x3e')](handleError(_0x48cd44,null));};exports[_0x7ec9('0x20')]=function(_0x5162c2,_0x2caff1){if(_0x5162c2[_0x7ec9('0x47')]['id']){delete _0x5162c2[_0x7ec9('0x47')]['id'];}return db[_0x7ec9('0x28')]['find']({'where':{'id':_0x5162c2[_0x7ec9('0x40')]['id']}})[_0x7ec9('0x22')](handleEntityNotFound(_0x2caff1,null))[_0x7ec9('0x22')](saveUpdates(_0x5162c2[_0x7ec9('0x47')],null))[_0x7ec9('0x22')](respondWithResult(_0x2caff1,null))[_0x7ec9('0x3e')](handleError(_0x2caff1,null));};exports['destroy']=function(_0x59febd,_0x2a9655){return db[_0x7ec9('0x28')]['find']({'where':{'id':_0x59febd[_0x7ec9('0x40')]['id']}})[_0x7ec9('0x22')](handleEntityNotFound(_0x2a9655,null))[_0x7ec9('0x22')](removeEntity(_0x2a9655,null))[_0x7ec9('0x3e')](handleError(_0x2a9655,null));};exports[_0x7ec9('0x48')]=function(_0x2319b8,_0x25f9cd){return db[_0x7ec9('0x28')][_0x7ec9('0x48')]()[_0x7ec9('0x22')](respondWithResult(_0x25f9cd,null))['catch'](handleError(_0x25f9cd,null));};
\ No newline at end of file
+var _0x8dbe=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','end','error','stack','name','send','index','map','fieldName','type','key','keys','query','filters','intersection','model','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','FaxTransferReport','includeAll','include','findAll','rows','catch','show','params','attributes','find','create','body','describe','eml-format','rimraf','request-promise','bluebird','mustache','path','to-csv','fs-extra','lodash'];(function(_0x186a11,_0x4f4fd8){var _0xe43c21=function(_0x32b2df){while(--_0x32b2df){_0x186a11['push'](_0x186a11['shift']());}};_0xe43c21(++_0x4f4fd8);}(_0x8dbe,0xdb));var _0xe8db=function(_0x382f75,_0x5ad658){_0x382f75=_0x382f75-0x0;var _0x423f73=_0x8dbe[_0x382f75];return _0x423f73;};'use strict';var emlformat=require(_0xe8db('0x0'));var rimraf=require(_0xe8db('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe8db('0x2'));var moment=require('moment');var BPromise=require(_0xe8db('0x3'));var Mustache=require(_0xe8db('0x4'));var util=require('util');var path=require(_0xe8db('0x5'));var sox=require('sox');var csv=require(_0xe8db('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe8db('0x7'));var _=require(_0xe8db('0x8'));var squel=require('squel');var crypto=require(_0xe8db('0x9'));var jsforce=require(_0xe8db('0xa'));var deskjs=require(_0xe8db('0xb'));var toCsv=require(_0xe8db('0x6'));var querystring=require(_0xe8db('0xc'));var Papa=require(_0xe8db('0xd'));var Redis=require(_0xe8db('0xe'));var authService=require(_0xe8db('0xf'));var qs=require(_0xe8db('0x10'));var as=require(_0xe8db('0x11'));var hardwareService=require(_0xe8db('0x12'));var logger=require(_0xe8db('0x13'))(_0xe8db('0x14'));var utils=require('../../config/utils');var config=require(_0xe8db('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe8db('0x16'))['db'];function respondWithStatusCode(_0x30bac4,_0x259d4c){_0x259d4c=_0x259d4c||0xcc;return function(_0x3f3905){if(_0x3f3905){return _0x30bac4[_0xe8db('0x17')](_0x259d4c);}return _0x30bac4['status'](_0x259d4c)['end']();};}function respondWithResult(_0x19960c,_0x12fcef){_0x12fcef=_0x12fcef||0xc8;return function(_0x319952){if(_0x319952){return _0x19960c[_0xe8db('0x18')](_0x12fcef)['json'](_0x319952);}};}function respondWithFilteredResult(_0x1d299d,_0x14f3b8){return function(_0x280293){if(_0x280293){var _0x30ef60=typeof _0x14f3b8[_0xe8db('0x19')]==='undefined'&&typeof _0x14f3b8['limit']===_0xe8db('0x1a');var _0x26d8d8=_0x280293[_0xe8db('0x1b')];var _0xefd237=_0x30ef60?0x0:_0x14f3b8[_0xe8db('0x19')];var _0x1f6589=_0x30ef60?_0x280293['count']:_0x14f3b8['offset']+_0x14f3b8['limit'];var _0x2c8931;if(_0x1f6589>=_0x26d8d8){_0x1f6589=_0x26d8d8;_0x2c8931=0xc8;}else{_0x2c8931=0xce;}_0x1d299d[_0xe8db('0x18')](_0x2c8931);return _0x1d299d[_0xe8db('0x1c')](_0xe8db('0x1d'),_0xefd237+'-'+_0x1f6589+'/'+_0x26d8d8)[_0xe8db('0x1e')](_0x280293);}return null;};}function patchUpdates(_0x33a847){return function(_0x57f064){try{jsonpatch[_0xe8db('0x1f')](_0x57f064,_0x33a847,!![]);}catch(_0x495760){return BPromise['reject'](_0x495760);}return _0x57f064[_0xe8db('0x20')]();};}function saveUpdates(_0x3369a7,_0x3ae5f9){return function(_0x3ab82a){if(_0x3ab82a){return _0x3ab82a[_0xe8db('0x21')](_0x3369a7)[_0xe8db('0x22')](function(_0x5029a7){return _0x5029a7;});}return null;};}function removeEntity(_0x14eee7,_0x1c653b){return function(_0x243cbb){if(_0x243cbb){return _0x243cbb[_0xe8db('0x23')]()['then'](function(){_0x14eee7['status'](0xcc)[_0xe8db('0x24')]();});}};}function handleEntityNotFound(_0x5647ef,_0x4776ea){return function(_0x3f1757){if(!_0x3f1757){_0x5647ef[_0xe8db('0x17')](0x194);}return _0x3f1757;};}function handleError(_0x6ca060,_0x4b1a4c){_0x4b1a4c=_0x4b1a4c||0x1f4;return function(_0x3a74f8){logger[_0xe8db('0x25')](_0x3a74f8[_0xe8db('0x26')]);if(_0x3a74f8[_0xe8db('0x27')]){delete _0x3a74f8[_0xe8db('0x27')];}_0x6ca060[_0xe8db('0x18')](_0x4b1a4c)[_0xe8db('0x28')](_0x3a74f8);};}exports[_0xe8db('0x29')]=function(_0x1e76c3,_0x54d623){var _0x360ad9={},_0x2feb3f={},_0x4a494c={'count':0x0,'rows':[]};var _0xdd79=_[_0xe8db('0x2a')](db['FaxTransferReport']['rawAttributes'],function(_0x53be21){return{'name':_0x53be21[_0xe8db('0x2b')],'type':_0x53be21[_0xe8db('0x2c')][_0xe8db('0x2d')]};});_0x2feb3f['model']=_[_0xe8db('0x2a')](_0xdd79,_0xe8db('0x27'));_0x2feb3f['query']=_[_0xe8db('0x2e')](_0x1e76c3[_0xe8db('0x2f')]);_0x2feb3f[_0xe8db('0x30')]=_[_0xe8db('0x31')](_0x2feb3f[_0xe8db('0x32')],_0x2feb3f[_0xe8db('0x2f')]);_0x360ad9['attributes']=_[_0xe8db('0x31')](_0x2feb3f['model'],qs[_0xe8db('0x33')](_0x1e76c3[_0xe8db('0x2f')][_0xe8db('0x33')]));_0x360ad9['attributes']=_0x360ad9['attributes'][_0xe8db('0x34')]?_0x360ad9['attributes']:_0x2feb3f[_0xe8db('0x32')];if(!_0x1e76c3[_0xe8db('0x2f')][_0xe8db('0x35')](_0xe8db('0x36'))){_0x360ad9[_0xe8db('0x37')]=qs['limit'](_0x1e76c3[_0xe8db('0x2f')]['limit']);_0x360ad9[_0xe8db('0x19')]=qs[_0xe8db('0x19')](_0x1e76c3[_0xe8db('0x2f')][_0xe8db('0x19')]);}_0x360ad9['order']=qs['sort'](_0x1e76c3[_0xe8db('0x2f')][_0xe8db('0x38')]);_0x360ad9[_0xe8db('0x39')]=qs[_0xe8db('0x30')](_[_0xe8db('0x3a')](_0x1e76c3[_0xe8db('0x2f')],_0x2feb3f[_0xe8db('0x30')]),_0xdd79);if(_0x1e76c3[_0xe8db('0x2f')][_0xe8db('0x3b')]){_0x360ad9[_0xe8db('0x39')]=_[_0xe8db('0x3c')](_0x360ad9[_0xe8db('0x39')],{'$or':_[_0xe8db('0x2a')](_0xdd79,function(_0x28b97a){if(_0x28b97a[_0xe8db('0x2c')]!==_0xe8db('0x3d')){var _0x52c2d6={};_0x52c2d6[_0x28b97a[_0xe8db('0x27')]]={'$like':'%'+_0x1e76c3['query'][_0xe8db('0x3b')]+'%'};return _0x52c2d6;}})});}_0x360ad9=_[_0xe8db('0x3c')]({},_0x360ad9,_0x1e76c3[_0xe8db('0x3e')]);var _0x3a1194={'where':_0x360ad9[_0xe8db('0x39')]};return db[_0xe8db('0x3f')]['count'](_0x3a1194)[_0xe8db('0x22')](function(_0x10db04){_0x4a494c[_0xe8db('0x1b')]=_0x10db04;if(_0x1e76c3[_0xe8db('0x2f')][_0xe8db('0x40')]){_0x360ad9[_0xe8db('0x41')]=[{'all':!![]}];}return db[_0xe8db('0x3f')][_0xe8db('0x42')](_0x360ad9);})[_0xe8db('0x22')](function(_0x4db558){_0x4a494c[_0xe8db('0x43')]=_0x4db558;return _0x4a494c;})[_0xe8db('0x22')](respondWithFilteredResult(_0x54d623,_0x360ad9))[_0xe8db('0x44')](handleError(_0x54d623,null));};exports[_0xe8db('0x45')]=function(_0x303ae9,_0xddc986){var _0x41ce29={'raw':!![],'where':{'id':_0x303ae9[_0xe8db('0x46')]['id']}},_0x43fc83={};_0x43fc83[_0xe8db('0x32')]=_[_0xe8db('0x2e')](db[_0xe8db('0x3f')]['rawAttributes']);_0x43fc83[_0xe8db('0x2f')]=_[_0xe8db('0x2e')](_0x303ae9[_0xe8db('0x2f')]);_0x43fc83['filters']=_[_0xe8db('0x31')](_0x43fc83['model'],_0x43fc83[_0xe8db('0x2f')]);_0x41ce29[_0xe8db('0x47')]=_[_0xe8db('0x31')](_0x43fc83[_0xe8db('0x32')],qs['fields'](_0x303ae9['query'][_0xe8db('0x33')]));_0x41ce29[_0xe8db('0x47')]=_0x41ce29[_0xe8db('0x47')][_0xe8db('0x34')]?_0x41ce29[_0xe8db('0x47')]:_0x43fc83[_0xe8db('0x32')];if(_0x303ae9['query'][_0xe8db('0x40')]){_0x41ce29[_0xe8db('0x41')]=[{'all':!![]}];}_0x41ce29=_[_0xe8db('0x3c')]({},_0x41ce29,_0x303ae9[_0xe8db('0x3e')]);return db['FaxTransferReport'][_0xe8db('0x48')](_0x41ce29)['then'](handleEntityNotFound(_0xddc986,null))['then'](respondWithResult(_0xddc986,null))['catch'](handleError(_0xddc986,null));};exports['create']=function(_0x566760,_0x23907f){return db['FaxTransferReport'][_0xe8db('0x49')](_0x566760[_0xe8db('0x4a')],{})[_0xe8db('0x22')](respondWithResult(_0x23907f,0xc9))[_0xe8db('0x44')](handleError(_0x23907f,null));};exports[_0xe8db('0x21')]=function(_0x648020,_0x1bbd89){if(_0x648020[_0xe8db('0x4a')]['id']){delete _0x648020[_0xe8db('0x4a')]['id'];}return db[_0xe8db('0x3f')]['find']({'where':{'id':_0x648020[_0xe8db('0x46')]['id']}})[_0xe8db('0x22')](handleEntityNotFound(_0x1bbd89,null))[_0xe8db('0x22')](saveUpdates(_0x648020[_0xe8db('0x4a')],null))[_0xe8db('0x22')](respondWithResult(_0x1bbd89,null))['catch'](handleError(_0x1bbd89,null));};exports[_0xe8db('0x23')]=function(_0x846d7e,_0x463740){return db[_0xe8db('0x3f')][_0xe8db('0x48')]({'where':{'id':_0x846d7e[_0xe8db('0x46')]['id']}})['then'](handleEntityNotFound(_0x463740,null))[_0xe8db('0x22')](removeEntity(_0x463740,null))[_0xe8db('0x44')](handleError(_0x463740,null));};exports[_0xe8db('0x4b')]=function(_0x42bbac,_0x2d0ade){return db[_0xe8db('0x3f')][_0xe8db('0x4b')]()[_0xe8db('0x22')](respondWithResult(_0x2d0ade,null))[_0xe8db('0x44')](handleError(_0x2d0ade,null));};
\ No newline at end of file
index 1d171f9..160dc35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb24d=['report_fax_transfer','uniqueid','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb24d,0x1b4));var _0xdb24=function(_0x281e30,_0x208926){_0x281e30=_0x281e30-0x0;var _0x1ad614=_0xb24d[_0x281e30];return _0x1ad614;};'use strict';var _=require('lodash');var util=require(_0xdb24('0x0'));var logger=require(_0xdb24('0x1'))(_0xdb24('0x2'));var moment=require(_0xdb24('0x3'));var BPromise=require('bluebird');var rp=require(_0xdb24('0x4'));var fs=require('fs');var path=require(_0xdb24('0x5'));var rimraf=require(_0xdb24('0x6'));var config=require(_0xdb24('0x7'));var attributes=require(_0xdb24('0x8'));module[_0xdb24('0x9')]=function(_0x997566,_0x3e343e){return _0x997566[_0xdb24('0xa')](_0xdb24('0xb'),attributes,{'tableName':_0xdb24('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xdb24('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x93ab=['./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5433d6,_0x325978){var _0x500081=function(_0x41c2c8){while(--_0x41c2c8){_0x5433d6['push'](_0x5433d6['shift']());}};_0x500081(++_0x325978);}(_0x93ab,0x1e2));var _0xb93a=function(_0xffd8b0,_0x12c51f){_0xffd8b0=_0xffd8b0-0x0;var _0x301ba0=_0x93ab[_0xffd8b0];return _0x301ba0;};'use strict';var _=require(_0xb93a('0x0'));var util=require(_0xb93a('0x1'));var logger=require(_0xb93a('0x2'))('api');var moment=require('moment');var BPromise=require(_0xb93a('0x3'));var rp=require(_0xb93a('0x4'));var fs=require('fs');var path=require(_0xb93a('0x5'));var rimraf=require(_0xb93a('0x6'));var config=require(_0xb93a('0x7'));var attributes=require(_0xb93a('0x8'));module[_0xb93a('0x9')]=function(_0x1a8ea5,_0xdf09ac){return _0x1a8ea5[_0xb93a('0xa')](_0xb93a('0xb'),attributes,{'tableName':_0xb93a('0xc'),'paranoid':![],'indexes':[{'name':_0xb93a('0xd'),'fields':[_0xb93a('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 1ecafc3..31bea01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb385=['jayson/promise','http','then','FaxTransferReport,\x20%s,\x20%s','FaxTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x1afcff,_0x45e3b1){var _0x48227e=function(_0x4fab67){while(--_0x4fab67){_0x1afcff['push'](_0x1afcff['shift']());}};_0x48227e(++_0x45e3b1);}(_0xb385,0x12a));var _0x5b38=function(_0x558e2f,_0x5f6d5f){_0x558e2f=_0x558e2f-0x0;var _0xf39505=_0xb385[_0x558e2f];return _0xf39505;};'use strict';var _=require(_0x5b38('0x0'));var util=require(_0x5b38('0x1'));var moment=require(_0x5b38('0x2'));var BPromise=require(_0x5b38('0x3'));var rs=require(_0x5b38('0x4'));var fs=require('fs');var Redis=require(_0x5b38('0x5'));var db=require(_0x5b38('0x6'))['db'];var utils=require(_0x5b38('0x7'));var logger=require(_0x5b38('0x8'))('rpc');var config=require(_0x5b38('0x9'));var jayson=require(_0x5b38('0xa'));var client=jayson['client'][_0x5b38('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1604c2,_0x55cfaa,_0x594b10){return new BPromise(function(_0x5f4fd3,_0x4e1244){return client['request'](_0x1604c2,_0x594b10)[_0x5b38('0xc')](function(_0x5a95be){logger['info'](_0x5b38('0xd'),_0x55cfaa,'request\x20sent');logger['debug'](_0x5b38('0xe'),_0x55cfaa,_0x5b38('0xf'),JSON[_0x5b38('0x10')](_0x5a95be));if(_0x5a95be[_0x5b38('0x11')]){if(_0x5a95be['error'][_0x5b38('0x12')]===0x1f4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x55cfaa,_0x5a95be['error'][_0x5b38('0x13')]);return _0x4e1244(_0x5a95be[_0x5b38('0x11')]['message']);}logger['error'](_0x5b38('0xd'),_0x55cfaa,_0x5a95be[_0x5b38('0x11')]['message']);return _0x5f4fd3(_0x5a95be[_0x5b38('0x11')][_0x5b38('0x13')]);}else{logger[_0x5b38('0x14')]('FaxTransferReport,\x20%s,\x20%s',_0x55cfaa,_0x5b38('0xf'));_0x5f4fd3(_0x5a95be[_0x5b38('0x15')][_0x5b38('0x13')]);}})['catch'](function(_0x52c2d4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x55cfaa,_0x52c2d4);_0x4e1244(_0x52c2d4);});});}
\ No newline at end of file
+var _0x8e6f=['request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FaxTransferReport,\x20%s,\x20%s'];(function(_0x4f5108,_0x46a54b){var _0x2d56ca=function(_0x5b3c1e){while(--_0x5b3c1e){_0x4f5108['push'](_0x4f5108['shift']());}};_0x2d56ca(++_0x46a54b);}(_0x8e6f,0xa3));var _0xf8e6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8e6f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf8e6('0x0'));var util=require(_0xf8e6('0x1'));var moment=require('moment');var BPromise=require(_0xf8e6('0x2'));var rs=require(_0xf8e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf8e6('0x4'));var logger=require(_0xf8e6('0x5'))(_0xf8e6('0x6'));var config=require(_0xf8e6('0x7'));var jayson=require(_0xf8e6('0x8'));var client=jayson['client'][_0xf8e6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23c3d5,_0x13fd22,_0x4574e5){return new BPromise(function(_0x51c1e8,_0x4e6d6c){return client[_0xf8e6('0xa')](_0x23c3d5,_0x4574e5)[_0xf8e6('0xb')](function(_0x1346fa){logger['info'](_0xf8e6('0xc'),_0x13fd22,_0xf8e6('0xd'));logger[_0xf8e6('0xe')](_0xf8e6('0xf'),_0x13fd22,_0xf8e6('0xd'),JSON[_0xf8e6('0x10')](_0x1346fa));if(_0x1346fa['error']){if(_0x1346fa['error']['code']===0x1f4){logger[_0xf8e6('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x13fd22,_0x1346fa[_0xf8e6('0x11')]['message']);return _0x4e6d6c(_0x1346fa[_0xf8e6('0x11')][_0xf8e6('0x12')]);}logger[_0xf8e6('0x11')](_0xf8e6('0xc'),_0x13fd22,_0x1346fa[_0xf8e6('0x11')][_0xf8e6('0x12')]);return _0x51c1e8(_0x1346fa[_0xf8e6('0x11')][_0xf8e6('0x12')]);}else{logger[_0xf8e6('0x13')](_0xf8e6('0xc'),_0x13fd22,_0xf8e6('0xd'));_0x51c1e8(_0x1346fa[_0xf8e6('0x14')]['message']);}})[_0xf8e6('0x15')](function(_0x4a798c){logger[_0xf8e6('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x13fd22,_0x4a798c);_0x4e6d6c(_0x4a798c);});});}
\ No newline at end of file
index 11cd8ea..0e58cf7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x755d=['../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','describe','/:id','show','post','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x292ace,_0x5607ec){var _0x42b447=function(_0x2fb9db){while(--_0x2fb9db){_0x292ace['push'](_0x292ace['shift']());}};_0x42b447(++_0x5607ec);}(_0x755d,0x150));var _0xd755=function(_0x540160,_0x24c6b6){_0x540160=_0x540160-0x0;var _0x476120=_0x755d[_0x540160];return _0x476120;};'use strict';var multer=require(_0xd755('0x0'));var util=require(_0xd755('0x1'));var path=require(_0xd755('0x2'));var timeout=require(_0xd755('0x3'));var express=require('express');var router=express[_0xd755('0x4')]();var fs_extra=require(_0xd755('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd755('0x6'));var config=require(_0xd755('0x7'));var controller=require(_0xd755('0x8'));router[_0xd755('0x9')]('/',auth[_0xd755('0xa')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xd755('0xb')]);router['get'](_0xd755('0xc'),auth[_0xd755('0xa')](),controller[_0xd755('0xd')]);router[_0xd755('0xe')]('/',auth[_0xd755('0xa')](),controller['create']);router[_0xd755('0xf')](_0xd755('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xd755('0x10')](_0xd755('0xc'),auth['isAuthenticated'](),controller[_0xd755('0x11')]);module[_0xd755('0x12')]=router;
\ No newline at end of file
+var _0xb368=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xb368,0x175));var _0x8b36=function(_0x598f91,_0x264f97){_0x598f91=_0x598f91-0x0;var _0x5c3597=_0xb368[_0x598f91];return _0x5c3597;};'use strict';var multer=require(_0x8b36('0x0'));var util=require(_0x8b36('0x1'));var path=require(_0x8b36('0x2'));var timeout=require(_0x8b36('0x3'));var express=require(_0x8b36('0x4'));var router=express[_0x8b36('0x5')]();var fs_extra=require(_0x8b36('0x6'));var auth=require(_0x8b36('0x7'));var interaction=require(_0x8b36('0x8'));var config=require('../../config/environment');var controller=require('./faxTransferReport.controller');router[_0x8b36('0x9')]('/',auth[_0x8b36('0xa')](),controller[_0x8b36('0xb')]);router[_0x8b36('0x9')](_0x8b36('0xc'),auth[_0x8b36('0xa')](),controller[_0x8b36('0xd')]);router[_0x8b36('0x9')](_0x8b36('0xe'),auth[_0x8b36('0xa')](),controller[_0x8b36('0xf')]);router[_0x8b36('0x10')]('/',auth[_0x8b36('0xa')](),controller['create']);router['put'](_0x8b36('0xe'),auth[_0x8b36('0xa')](),controller[_0x8b36('0x11')]);router[_0x8b36('0x12')](_0x8b36('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x8b36('0x13')]=router;
\ No newline at end of file
index 7f5ff9c..92ec13a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf96b=['express','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xf96b,0x16c));var _0xbf96=function(_0x1f2a65,_0x4f24d8){_0x1f2a65=_0x1f2a65-0x0;var _0x46e643=_0xf96b[_0x1f2a65];return _0x46e643;};'use strict';var multer=require(_0xbf96('0x0'));var util=require(_0xbf96('0x1'));var path=require(_0xbf96('0x2'));var timeout=require(_0xbf96('0x3'));var express=require(_0xbf96('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xbf96('0x5'));var config=require(_0xbf96('0x6'));var controller=require(_0xbf96('0x7'));router[_0xbf96('0x8')]('/',auth[_0xbf96('0x9')](),controller[_0xbf96('0xa')]);router[_0xbf96('0x8')](_0xbf96('0xb'),auth[_0xbf96('0x9')](),controller[_0xbf96('0xc')]);router['get'](_0xbf96('0xd'),auth[_0xbf96('0x9')](),controller[_0xbf96('0xe')]);router[_0xbf96('0x8')]('/:id/fields',auth[_0xbf96('0x9')](),controller[_0xbf96('0xf')]);router[_0xbf96('0x10')]('/',auth[_0xbf96('0x9')](),controller[_0xbf96('0x11')]);router['post']('/:id/configurations',auth[_0xbf96('0x9')](),controller[_0xbf96('0x12')]);router[_0xbf96('0x13')](_0xbf96('0xb'),auth[_0xbf96('0x9')](),controller[_0xbf96('0x14')]);router[_0xbf96('0x15')](_0xbf96('0xb'),auth['isAuthenticated'](),controller[_0xbf96('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xccd5=['addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','get','/:id','isAuthenticated','show','getConfigurations','/:id/fields','getFields','post','create'];(function(_0x23bf7e,_0x1eac0e){var _0x3baa9f=function(_0x187ab0){while(--_0x187ab0){_0x23bf7e['push'](_0x23bf7e['shift']());}};_0x3baa9f(++_0x1eac0e);}(_0xccd5,0xbe));var _0x5ccd=function(_0x12d6b2,_0x5d5094){_0x12d6b2=_0x12d6b2-0x0;var _0x55ed31=_0xccd5[_0x12d6b2];return _0x55ed31;};'use strict';var multer=require(_0x5ccd('0x0'));var util=require('util');var path=require(_0x5ccd('0x1'));var timeout=require(_0x5ccd('0x2'));var express=require(_0x5ccd('0x3'));var router=express[_0x5ccd('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5ccd('0x5'));var interaction=require(_0x5ccd('0x6'));var config=require('../../config/environment');var controller=require(_0x5ccd('0x7'));router[_0x5ccd('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5ccd('0x8')](_0x5ccd('0x9'),auth[_0x5ccd('0xa')](),controller[_0x5ccd('0xb')]);router[_0x5ccd('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x5ccd('0xc')]);router[_0x5ccd('0x8')](_0x5ccd('0xd'),auth[_0x5ccd('0xa')](),controller[_0x5ccd('0xe')]);router[_0x5ccd('0xf')]('/',auth[_0x5ccd('0xa')](),controller[_0x5ccd('0x10')]);router[_0x5ccd('0xf')]('/:id/configurations',auth[_0x5ccd('0xa')](),controller[_0x5ccd('0x11')]);router[_0x5ccd('0x12')](_0x5ccd('0x9'),auth[_0x5ccd('0xa')](),controller[_0x5ccd('0x13')]);router[_0x5ccd('0x14')](_0x5ccd('0x9'),auth[_0x5ccd('0xa')](),controller[_0x5ccd('0x15')]);module[_0x5ccd('0x16')]=router;
\ No newline at end of file
index 739926f..64cb367 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1c5=['ENUM','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xd1c5,0xb1));var _0x5d1c=function(_0x36e27b,_0x5a7055){_0x36e27b=_0x36e27b-0x0;var _0x5c0d36=_0xd1c5[_0x36e27b];return _0x5c0d36;};'use strict';var Sequelize=require(_0x5d1c('0x0'));module[_0x5d1c('0x1')]={'name':{'type':Sequelize[_0x5d1c('0x2')]},'description':{'type':Sequelize[_0x5d1c('0x2')]},'username':{'type':Sequelize[_0x5d1c('0x2')]},'remoteUri':{'type':Sequelize[_0x5d1c('0x2')]},'authType':{'type':Sequelize[_0x5d1c('0x3')]('basic'),'defaultValue':'basic'},'password':{'type':Sequelize[_0x5d1c('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x5d1c('0x2')]},'tokenSecret':{'type':Sequelize[_0x5d1c('0x2')]},'serverUrl':{'type':Sequelize[_0x5d1c('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x5d1c('0x4'),_0x5d1c('0x5')),'defaultValue':_0x5d1c('0x4')}};
\ No newline at end of file
+var _0xf1bf=['exports','STRING','ENUM','basic','integrationTab','newTab','sequelize'];(function(_0x3abe58,_0x184dd9){var _0x457389=function(_0x59f517){while(--_0x59f517){_0x3abe58['push'](_0x3abe58['shift']());}};_0x457389(++_0x184dd9);}(_0xf1bf,0x141));var _0xff1b=function(_0x11de6e,_0x8b367){_0x11de6e=_0x11de6e-0x0;var _0x197e53=_0xf1bf[_0x11de6e];return _0x197e53;};'use strict';var Sequelize=require(_0xff1b('0x0'));module[_0xff1b('0x1')]={'name':{'type':Sequelize[_0xff1b('0x2')]},'description':{'type':Sequelize[_0xff1b('0x2')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xff1b('0x2')]},'authType':{'type':Sequelize[_0xff1b('0x3')](_0xff1b('0x4')),'defaultValue':_0xff1b('0x4')},'password':{'type':Sequelize[_0xff1b('0x2')]},'consumerKey':{'type':Sequelize[_0xff1b('0x2')]},'consumerSecret':{'type':Sequelize[_0xff1b('0x2')]},'token':{'type':Sequelize[_0xff1b('0x2')]},'tokenSecret':{'type':Sequelize[_0xff1b('0x2')]},'serverUrl':{'type':Sequelize[_0xff1b('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xff1b('0x5'),_0xff1b('0x6')),'defaultValue':'integrationTab'}};
\ No newline at end of file
index 619af02..87289cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb00a=['params','keys','merge','find','catch','create','body','getConfigurations','DeskConfiguration','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','DeskField','getFields','priority','remoteUri','username','password','consumerKey','consumerSecret','token','tokenSecret','substring','GET','format','%s/custom_fields','application/json','basic','headers','toString','base64','active','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','DeskAccount','includeAll','include','findAll'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xb00a,0x99));var _0xab00=function(_0x3ad93c,_0x380191){_0x3ad93c=_0x3ad93c-0x0;var _0x52a453=_0xb00a[_0x3ad93c];return _0x52a453;};'use strict';var emlformat=require(_0xab00('0x0'));var rimraf=require(_0xab00('0x1'));var zipdir=require(_0xab00('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab00('0x3'));var moment=require(_0xab00('0x4'));var BPromise=require(_0xab00('0x5'));var Mustache=require(_0xab00('0x6'));var util=require(_0xab00('0x7'));var path=require(_0xab00('0x8'));var sox=require(_0xab00('0x9'));var csv=require('to-csv');var ejs=require(_0xab00('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab00('0xb'));var squel=require(_0xab00('0xc'));var crypto=require(_0xab00('0xd'));var jsforce=require(_0xab00('0xe'));var deskjs=require(_0xab00('0xf'));var toCsv=require(_0xab00('0x10'));var querystring=require('querystring');var Papa=require(_0xab00('0x11'));var Redis=require(_0xab00('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xab00('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xab00('0x14'));var logger=require('../../config/logger')(_0xab00('0x15'));var utils=require(_0xab00('0x16'));var config=require(_0xab00('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x442a87,_0xa44cfc){_0xa44cfc=_0xa44cfc||0xcc;return function(_0x1b7ec0){if(_0x1b7ec0){return _0x442a87[_0xab00('0x18')](_0xa44cfc);}return _0x442a87['status'](_0xa44cfc)[_0xab00('0x19')]();};}function respondWithResult(_0x5a32bb,_0x3c818e){_0x3c818e=_0x3c818e||0xc8;return function(_0x4f88a1){if(_0x4f88a1){return _0x5a32bb[_0xab00('0x1a')](_0x3c818e)[_0xab00('0x1b')](_0x4f88a1);}};}function respondWithFilteredResult(_0x1cf715,_0x433f73){return function(_0x3e22c3){if(_0x3e22c3){var _0xb2dc65=typeof _0x433f73[_0xab00('0x1c')]===_0xab00('0x1d')&&typeof _0x433f73[_0xab00('0x1e')]===_0xab00('0x1d');var _0x4b8249=_0x3e22c3[_0xab00('0x1f')];var _0x380292=_0xb2dc65?0x0:_0x433f73[_0xab00('0x1c')];var _0x5650a3=_0xb2dc65?_0x3e22c3[_0xab00('0x1f')]:_0x433f73[_0xab00('0x1c')]+_0x433f73['limit'];var _0x3a240f;if(_0x5650a3>=_0x4b8249){_0x5650a3=_0x4b8249;_0x3a240f=0xc8;}else{_0x3a240f=0xce;}_0x1cf715['status'](_0x3a240f);return _0x1cf715['set'](_0xab00('0x20'),_0x380292+'-'+_0x5650a3+'/'+_0x4b8249)['json'](_0x3e22c3);}return null;};}function patchUpdates(_0x11a100){return function(_0x3593d6){try{jsonpatch[_0xab00('0x21')](_0x3593d6,_0x11a100,!![]);}catch(_0x276b35){return BPromise[_0xab00('0x22')](_0x276b35);}return _0x3593d6['save']();};}function saveUpdates(_0x99ab1a,_0x3873a1){return function(_0x347e5f){if(_0x347e5f){return _0x347e5f[_0xab00('0x23')](_0x99ab1a)[_0xab00('0x24')](function(_0x36b98f){return _0x36b98f;});}return null;};}function removeEntity(_0x38b935,_0x2d7997){return function(_0x388a1e){if(_0x388a1e){return _0x388a1e[_0xab00('0x25')]()[_0xab00('0x24')](function(){_0x38b935[_0xab00('0x1a')](0xcc)[_0xab00('0x19')]();});}};}function handleEntityNotFound(_0x53cc0,_0x28f5d6){return function(_0x73996d){if(!_0x73996d){_0x53cc0[_0xab00('0x18')](0x194);}return _0x73996d;};}function handleError(_0x6a2fee,_0x5247b6){_0x5247b6=_0x5247b6||0x1f4;return function(_0x13ff2c){logger['error'](_0x13ff2c[_0xab00('0x26')]);if(_0x13ff2c[_0xab00('0x27')]){delete _0x13ff2c[_0xab00('0x27')];}_0x6a2fee[_0xab00('0x1a')](_0x5247b6)[_0xab00('0x28')](_0x13ff2c);};}exports[_0xab00('0x29')]=function(_0x146ba0,_0x2c5c24){var _0x558235={},_0x5a5024={},_0x331f80={'count':0x0,'rows':[]};var _0x598e91=_['map'](db['DeskAccount'][_0xab00('0x2a')],function(_0x280fad){return{'name':_0x280fad[_0xab00('0x2b')],'type':_0x280fad[_0xab00('0x2c')][_0xab00('0x2d')]};});_0x5a5024['model']=_[_0xab00('0x2e')](_0x598e91,'name');_0x5a5024['query']=_['keys'](_0x146ba0[_0xab00('0x2f')]);_0x5a5024[_0xab00('0x30')]=_[_0xab00('0x31')](_0x5a5024['model'],_0x5a5024[_0xab00('0x2f')]);_0x558235[_0xab00('0x32')]=_[_0xab00('0x31')](_0x5a5024[_0xab00('0x33')],qs['fields'](_0x146ba0[_0xab00('0x2f')][_0xab00('0x34')]));_0x558235['attributes']=_0x558235[_0xab00('0x32')][_0xab00('0x35')]?_0x558235[_0xab00('0x32')]:_0x5a5024['model'];if(!_0x146ba0['query'][_0xab00('0x36')](_0xab00('0x37'))){_0x558235[_0xab00('0x1e')]=qs[_0xab00('0x1e')](_0x146ba0['query'][_0xab00('0x1e')]);_0x558235[_0xab00('0x1c')]=qs[_0xab00('0x1c')](_0x146ba0[_0xab00('0x2f')][_0xab00('0x1c')]);}_0x558235[_0xab00('0x38')]=qs[_0xab00('0x39')](_0x146ba0['query'][_0xab00('0x39')]);_0x558235[_0xab00('0x3a')]=qs[_0xab00('0x30')](_[_0xab00('0x3b')](_0x146ba0[_0xab00('0x2f')],_0x5a5024[_0xab00('0x30')]),_0x598e91);if(_0x146ba0[_0xab00('0x2f')][_0xab00('0x3c')]){_0x558235['where']=_['merge'](_0x558235[_0xab00('0x3a')],{'$or':_[_0xab00('0x2e')](_0x598e91,function(_0x4d321c){if(_0x4d321c[_0xab00('0x2c')]!==_0xab00('0x3d')){var _0x3b8f79={};_0x3b8f79[_0x4d321c[_0xab00('0x27')]]={'$like':'%'+_0x146ba0[_0xab00('0x2f')]['filter']+'%'};return _0x3b8f79;}})});}_0x558235=_['merge']({},_0x558235,_0x146ba0[_0xab00('0x3e')]);var _0x1bfbc7={'where':_0x558235[_0xab00('0x3a')]};return db[_0xab00('0x3f')][_0xab00('0x1f')](_0x1bfbc7)[_0xab00('0x24')](function(_0x37db3a){_0x331f80['count']=_0x37db3a;if(_0x146ba0[_0xab00('0x2f')][_0xab00('0x40')]){_0x558235[_0xab00('0x41')]=[{'all':!![]}];}return db[_0xab00('0x3f')][_0xab00('0x42')](_0x558235);})[_0xab00('0x24')](function(_0x1d5e34){_0x331f80['rows']=_0x1d5e34;return _0x331f80;})[_0xab00('0x24')](respondWithFilteredResult(_0x2c5c24,_0x558235))['catch'](handleError(_0x2c5c24,null));};exports['show']=function(_0x4681ce,_0x368523){var _0x5b767c={'raw':![],'where':{'id':_0x4681ce[_0xab00('0x43')]['id']}},_0x35b0bc={};_0x35b0bc['model']=_[_0xab00('0x44')](db[_0xab00('0x3f')][_0xab00('0x2a')]);_0x35b0bc[_0xab00('0x2f')]=_['keys'](_0x4681ce[_0xab00('0x2f')]);_0x35b0bc[_0xab00('0x30')]=_['intersection'](_0x35b0bc[_0xab00('0x33')],_0x35b0bc[_0xab00('0x2f')]);_0x5b767c[_0xab00('0x32')]=_['intersection'](_0x35b0bc[_0xab00('0x33')],qs['fields'](_0x4681ce[_0xab00('0x2f')][_0xab00('0x34')]));_0x5b767c['attributes']=_0x5b767c[_0xab00('0x32')][_0xab00('0x35')]?_0x5b767c[_0xab00('0x32')]:_0x35b0bc[_0xab00('0x33')];if(_0x4681ce[_0xab00('0x2f')][_0xab00('0x40')]){_0x5b767c[_0xab00('0x41')]=[{'all':!![]}];}_0x5b767c=_[_0xab00('0x45')]({},_0x5b767c,_0x4681ce[_0xab00('0x3e')]);return db[_0xab00('0x3f')][_0xab00('0x46')](_0x5b767c)[_0xab00('0x24')](handleEntityNotFound(_0x368523,null))[_0xab00('0x24')](respondWithResult(_0x368523,null))[_0xab00('0x47')](handleError(_0x368523,null));};exports[_0xab00('0x48')]=function(_0x5d170b,_0x144d3d){return db[_0xab00('0x3f')]['create'](_0x5d170b[_0xab00('0x49')],{})['then'](respondWithResult(_0x144d3d,0xc9))[_0xab00('0x47')](handleError(_0x144d3d,null));};exports[_0xab00('0x23')]=function(_0x5a26f8,_0x5e206d){if(_0x5a26f8[_0xab00('0x49')]['id']){delete _0x5a26f8[_0xab00('0x49')]['id'];}return db[_0xab00('0x3f')][_0xab00('0x46')]({'where':{'id':_0x5a26f8[_0xab00('0x43')]['id']}})[_0xab00('0x24')](handleEntityNotFound(_0x5e206d,null))[_0xab00('0x24')](saveUpdates(_0x5a26f8['body'],null))[_0xab00('0x24')](respondWithResult(_0x5e206d,null))[_0xab00('0x47')](handleError(_0x5e206d,null));};exports[_0xab00('0x25')]=function(_0x215f54,_0x9d7602){return db[_0xab00('0x3f')][_0xab00('0x46')]({'where':{'id':_0x215f54[_0xab00('0x43')]['id']}})[_0xab00('0x24')](handleEntityNotFound(_0x9d7602,null))[_0xab00('0x24')](removeEntity(_0x9d7602,null))['catch'](handleError(_0x9d7602,null));};exports[_0xab00('0x4a')]=function(_0x582482,_0x3797e2,_0x5205fa){var _0x2c6910={};var _0x2658e1={};var _0x18b171;var _0x342ebe;return db[_0xab00('0x3f')]['findOne']({'where':{'id':_0x582482['params']['id']}})[_0xab00('0x24')](handleEntityNotFound(_0x3797e2,null))[_0xab00('0x24')](function(_0x5a6d69){if(_0x5a6d69){_0x18b171=_0x5a6d69;_0x2658e1[_0xab00('0x33')]=_[_0xab00('0x44')](db[_0xab00('0x4b')][_0xab00('0x2a')]);_0x2658e1[_0xab00('0x2f')]=_[_0xab00('0x44')](_0x582482[_0xab00('0x2f')]);_0x2658e1[_0xab00('0x30')]=_['intersection'](_0x2658e1[_0xab00('0x33')],_0x2658e1['query']);_0x2c6910[_0xab00('0x32')]=_[_0xab00('0x31')](_0x2658e1[_0xab00('0x33')],qs[_0xab00('0x34')](_0x582482[_0xab00('0x2f')][_0xab00('0x34')]));_0x2c6910['attributes']=_0x2c6910[_0xab00('0x32')][_0xab00('0x35')]?_0x2c6910['attributes']:_0x2658e1['model'];_0x2c6910[_0xab00('0x38')]=qs[_0xab00('0x39')](_0x582482[_0xab00('0x2f')][_0xab00('0x39')]);_0x2c6910[_0xab00('0x3a')]=qs[_0xab00('0x30')](_[_0xab00('0x3b')](_0x582482[_0xab00('0x2f')],_0x2658e1[_0xab00('0x30')]));if(_0x582482[_0xab00('0x2f')][_0xab00('0x3c')]){_0x2c6910['where']=_[_0xab00('0x45')](_0x2c6910['where'],{'$or':_['map'](_0x2c6910[_0xab00('0x32')],function(_0x5aa16d){var _0x4058ca={};_0x4058ca[_0x5aa16d]={'$like':'%'+_0x582482[_0xab00('0x2f')][_0xab00('0x3c')]+'%'};return _0x4058ca;})});}_0x2c6910=_['merge']({},_0x2c6910,_0x582482[_0xab00('0x3e')]);return _0x18b171[_0xab00('0x4a')](_0x2c6910);}})[_0xab00('0x24')](function(_0x49e559){if(_0x49e559){_0x342ebe=_0x49e559[_0xab00('0x35')];if(!_0x582482[_0xab00('0x2f')][_0xab00('0x36')](_0xab00('0x37'))){_0x2c6910[_0xab00('0x1e')]=qs[_0xab00('0x1e')](_0x582482[_0xab00('0x2f')][_0xab00('0x1e')]);_0x2c6910[_0xab00('0x1c')]=qs['offset'](_0x582482[_0xab00('0x2f')]['offset']);}return _0x18b171[_0xab00('0x4a')](_0x2c6910);}})['then'](function(_0x18ed6a){if(_0x18ed6a){return _0x18ed6a?{'count':_0x342ebe,'rows':_0x18ed6a}:null;}})[_0xab00('0x24')](respondWithResult(_0x3797e2,null))['catch'](handleError(_0x3797e2,null));};exports[_0xab00('0x4c')]=function(_0x12d67d,_0x2dcbb4,_0x471a04){if(_0x12d67d[_0xab00('0x49')]['id']){delete _0x12d67d['body']['id'];}return db['DeskAccount'][_0xab00('0x4d')]({'where':{'id':_0x12d67d[_0xab00('0x43')]['id']}})[_0xab00('0x24')](handleEntityNotFound(_0x2dcbb4,null))[_0xab00('0x24')](function(_0x2ea5b2){if(_0x2ea5b2){_0x12d67d[_0xab00('0x49')][_0xab00('0x4e')]=_0x2ea5b2['id'];_0x12d67d[_0xab00('0x49')]['Subjects']=integrations[_0xab00('0x4f')](_0x12d67d[_0xab00('0x49')][_0xab00('0x50')],_0x12d67d['body'][_0xab00('0x2c')]);_0x12d67d['body'][_0xab00('0x51')]=integrations[_0xab00('0x52')](_0x12d67d[_0xab00('0x49')][_0xab00('0x50')],_0x12d67d[_0xab00('0x49')][_0xab00('0x2c')]);return db['DeskConfiguration'][_0xab00('0x48')](_0x12d67d[_0xab00('0x49')],{'include':[{'model':db['DeskField'],'as':_0xab00('0x53')},{'model':db[_0xab00('0x54')],'as':_0xab00('0x51')}]});}return null;})[_0xab00('0x24')](respondWithResult(_0x2dcbb4,null))[_0xab00('0x47')](handleError(_0x2dcbb4,null));};exports[_0xab00('0x55')]=function(_0x3a64c5,_0x48489f,_0x3af81a){var _0x1f509b=[{'name':'priority','label':_0xab00('0x56'),'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 _0x4a843b='';return db[_0xab00('0x3f')][_0xab00('0x4d')]({'where':{'id':_0x3a64c5[_0xab00('0x43')]['id']},'attributes':['id',_0xab00('0x57'),'authType',_0xab00('0x58'),_0xab00('0x59'),_0xab00('0x5a'),_0xab00('0x5b'),_0xab00('0x5c'),_0xab00('0x5d')]})[_0xab00('0x24')](handleEntityNotFound(_0x48489f,null))[_0xab00('0x24')](function(_0x3e8e61){if(_0x3e8e61){_0x4a843b=_0x3e8e61[_0xab00('0x57')];var _0x12d35a=_0x4a843b['slice'](-0x1);if(_0x12d35a==='/'){_0x4a843b=_0x4a843b[_0xab00('0x5e')](0x0,_0x4a843b['lastIndexOf'](_0x12d35a));}var _0x31f238={'method':_0xab00('0x5f'),'uri':util[_0xab00('0x60')](_0xab00('0x61'),_0x4a843b),'headers':{'Content-Type':_0xab00('0x62'),'Accept':'application/json'},'json':!![]};if(_0x3e8e61['authType']===_0xab00('0x63')){_0x31f238[_0xab00('0x64')]['Authorization']=util['format']('Basic\x20%s',new Buffer(util[_0xab00('0x60')]('%s:%s',_0x3e8e61[_0xab00('0x58')],_0x3e8e61['password']))[_0xab00('0x65')](_0xab00('0x66')));}return rp(_0x31f238)['then'](function(_0x29cd2b){return _0x1f509b['concat'](_[_0xab00('0x2e')](_0x29cd2b['_embedded']['entries'],function(_0x1fb1f6){return{'id':_0x1fb1f6['name'],'name':_0x1fb1f6[_0xab00('0x27')],'type':_0x1fb1f6[_0xab00('0x2c')],'active':_0x1fb1f6[_0xab00('0x67')],'label':_0x1fb1f6[_0xab00('0x68')],'custom':!![]};}));});}})[_0xab00('0x24')](function(_0x1ae865){return{'count':_0x1ae865[_0xab00('0x35')],'rows':_0x1ae865};})[_0xab00('0x24')](respondWithResult(_0x48489f,null))[_0xab00('0x47')](function(_0x51b7f9){var _0x1b205e=_0x3a64c5[_0xab00('0x2f')][_0xab00('0x69')]?0x1f4:_0x51b7f9[_0xab00('0x6a')]||0x1f4;logger['error'](_0xab00('0x6b'),_0xab00('0x55'),_0x1b205e,JSON[_0xab00('0x6c')](_0x51b7f9));delete _0x51b7f9[_0xab00('0x27')];if(_0x1b205e===0x191){_0x1b205e=0x190;}_0x48489f['status'](_0x1b205e)[_0xab00('0x28')](_0x3a64c5[_0xab00('0x2f')][_0xab00('0x69')]?{'message':_0xab00('0x6d'),'statusCode':_0x51b7f9['statusCode']}:_0x51b7f9);});};
\ No newline at end of file
+var _0x66a0=['moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','update','destroy','then','stack','name','index','DeskAccount','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','length','find','catch','create','body','getConfigurations','findOne','DeskConfiguration','map','hasOwnProperty','AccountId','Subjects','getSubjects','channel','getDescriptions','Descriptions','priority','authType','password','consumerSecret','token','tokenSecret','remoteUri','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Basic\x20%s','username','toString','concat','label','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir'];(function(_0x4259fb,_0x5e707b){var _0x39b86c=function(_0x5297db){while(--_0x5297db){_0x4259fb['push'](_0x4259fb['shift']());}};_0x39b86c(++_0x5e707b);}(_0x66a0,0x13e));var _0x066a=function(_0x478c8a,_0x9afc92){_0x478c8a=_0x478c8a-0x0;var _0x3b6b3e=_0x66a0[_0x478c8a];return _0x3b6b3e;};'use strict';var emlformat=require(_0x066a('0x0'));var rimraf=require(_0x066a('0x1'));var zipdir=require(_0x066a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x066a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x066a('0x4'));var util=require(_0x066a('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x066a('0x6'));var ejs=require(_0x066a('0x7'));var fs=require('fs');var fs_extra=require(_0x066a('0x8'));var _=require(_0x066a('0x9'));var squel=require(_0x066a('0xa'));var crypto=require(_0x066a('0xb'));var jsforce=require(_0x066a('0xc'));var deskjs=require(_0x066a('0xd'));var toCsv=require(_0x066a('0x6'));var querystring=require(_0x066a('0xe'));var Papa=require(_0x066a('0xf'));var Redis=require(_0x066a('0x10'));var authService=require(_0x066a('0x11'));var qs=require(_0x066a('0x12'));var as=require(_0x066a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x066a('0x14'));var config=require(_0x066a('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x066a('0x16'))['db'];var integrations=require(_0x066a('0x17'));function respondWithStatusCode(_0x1373b6,_0x3a27a0){_0x3a27a0=_0x3a27a0||0xcc;return function(_0x1cb2be){if(_0x1cb2be){return _0x1373b6[_0x066a('0x18')](_0x3a27a0);}return _0x1373b6[_0x066a('0x19')](_0x3a27a0)[_0x066a('0x1a')]();};}function respondWithResult(_0x3e6e60,_0x345db2){_0x345db2=_0x345db2||0xc8;return function(_0x1d3ed0){if(_0x1d3ed0){return _0x3e6e60[_0x066a('0x19')](_0x345db2)[_0x066a('0x1b')](_0x1d3ed0);}};}function respondWithFilteredResult(_0x16fdcd,_0x41dad1){return function(_0xbba15b){if(_0xbba15b){var _0x131015=typeof _0x41dad1[_0x066a('0x1c')]==='undefined'&&typeof _0x41dad1[_0x066a('0x1d')]==='undefined';var _0x54a4b5=_0xbba15b[_0x066a('0x1e')];var _0x4c0415=_0x131015?0x0:_0x41dad1[_0x066a('0x1c')];var _0xf54412=_0x131015?_0xbba15b[_0x066a('0x1e')]:_0x41dad1['offset']+_0x41dad1[_0x066a('0x1d')];var _0x2fe44a;if(_0xf54412>=_0x54a4b5){_0xf54412=_0x54a4b5;_0x2fe44a=0xc8;}else{_0x2fe44a=0xce;}_0x16fdcd['status'](_0x2fe44a);return _0x16fdcd['set'](_0x066a('0x1f'),_0x4c0415+'-'+_0xf54412+'/'+_0x54a4b5)[_0x066a('0x1b')](_0xbba15b);}return null;};}function patchUpdates(_0x5ddb16){return function(_0x51f279){try{jsonpatch[_0x066a('0x20')](_0x51f279,_0x5ddb16,!![]);}catch(_0x135f2b){return BPromise['reject'](_0x135f2b);}return _0x51f279['save']();};}function saveUpdates(_0x228ed0,_0x376f01){return function(_0x12afe3){if(_0x12afe3){return _0x12afe3[_0x066a('0x21')](_0x228ed0)['then'](function(_0x190f88){return _0x190f88;});}return null;};}function removeEntity(_0x492276,_0x2a994d){return function(_0x9124f7){if(_0x9124f7){return _0x9124f7[_0x066a('0x22')]()[_0x066a('0x23')](function(){_0x492276[_0x066a('0x19')](0xcc)[_0x066a('0x1a')]();});}};}function handleEntityNotFound(_0x1012a2,_0x314fe5){return function(_0x46262d){if(!_0x46262d){_0x1012a2[_0x066a('0x18')](0x194);}return _0x46262d;};}function handleError(_0x5f58dc,_0x1eaf23){_0x1eaf23=_0x1eaf23||0x1f4;return function(_0x2f5a42){logger['error'](_0x2f5a42[_0x066a('0x24')]);if(_0x2f5a42[_0x066a('0x25')]){delete _0x2f5a42[_0x066a('0x25')];}_0x5f58dc[_0x066a('0x19')](_0x1eaf23)['send'](_0x2f5a42);};}exports[_0x066a('0x26')]=function(_0x5df756,_0x51a03f){var _0x1dede2={},_0x805c2b={},_0x5cbeee={'count':0x0,'rows':[]};var _0x55ec11=_['map'](db[_0x066a('0x27')][_0x066a('0x28')],function(_0x1dc170){return{'name':_0x1dc170[_0x066a('0x29')],'type':_0x1dc170[_0x066a('0x2a')]['key']};});_0x805c2b['model']=_['map'](_0x55ec11,_0x066a('0x25'));_0x805c2b[_0x066a('0x2b')]=_[_0x066a('0x2c')](_0x5df756['query']);_0x805c2b[_0x066a('0x2d')]=_[_0x066a('0x2e')](_0x805c2b[_0x066a('0x2f')],_0x805c2b[_0x066a('0x2b')]);_0x1dede2[_0x066a('0x30')]=_[_0x066a('0x2e')](_0x805c2b[_0x066a('0x2f')],qs['fields'](_0x5df756['query'][_0x066a('0x31')]));_0x1dede2[_0x066a('0x30')]=_0x1dede2['attributes']['length']?_0x1dede2[_0x066a('0x30')]:_0x805c2b[_0x066a('0x2f')];if(!_0x5df756['query']['hasOwnProperty'](_0x066a('0x32'))){_0x1dede2[_0x066a('0x1d')]=qs[_0x066a('0x1d')](_0x5df756[_0x066a('0x2b')]['limit']);_0x1dede2['offset']=qs['offset'](_0x5df756[_0x066a('0x2b')]['offset']);}_0x1dede2[_0x066a('0x33')]=qs[_0x066a('0x34')](_0x5df756[_0x066a('0x2b')]['sort']);_0x1dede2[_0x066a('0x35')]=qs['filters'](_[_0x066a('0x36')](_0x5df756[_0x066a('0x2b')],_0x805c2b[_0x066a('0x2d')]),_0x55ec11);if(_0x5df756[_0x066a('0x2b')][_0x066a('0x37')]){_0x1dede2[_0x066a('0x35')]=_['merge'](_0x1dede2[_0x066a('0x35')],{'$or':_['map'](_0x55ec11,function(_0xc5c4fe){if(_0xc5c4fe[_0x066a('0x2a')]!==_0x066a('0x38')){var _0x4475e7={};_0x4475e7[_0xc5c4fe[_0x066a('0x25')]]={'$like':'%'+_0x5df756[_0x066a('0x2b')][_0x066a('0x37')]+'%'};return _0x4475e7;}})});}_0x1dede2=_[_0x066a('0x39')]({},_0x1dede2,_0x5df756[_0x066a('0x3a')]);var _0x5e6aa7={'where':_0x1dede2[_0x066a('0x35')]};return db[_0x066a('0x27')][_0x066a('0x1e')](_0x5e6aa7)[_0x066a('0x23')](function(_0x4e9201){_0x5cbeee[_0x066a('0x1e')]=_0x4e9201;if(_0x5df756[_0x066a('0x2b')][_0x066a('0x3b')]){_0x1dede2[_0x066a('0x3c')]=[{'all':!![]}];}return db[_0x066a('0x27')][_0x066a('0x3d')](_0x1dede2);})['then'](function(_0x388c65){_0x5cbeee['rows']=_0x388c65;return _0x5cbeee;})[_0x066a('0x23')](respondWithFilteredResult(_0x51a03f,_0x1dede2))['catch'](handleError(_0x51a03f,null));};exports[_0x066a('0x3e')]=function(_0x2b40e8,_0x5b1cf7){var _0x4c5e23={'raw':![],'where':{'id':_0x2b40e8[_0x066a('0x3f')]['id']}},_0x1acc51={};_0x1acc51['model']=_[_0x066a('0x2c')](db['DeskAccount'][_0x066a('0x28')]);_0x1acc51[_0x066a('0x2b')]=_['keys'](_0x2b40e8[_0x066a('0x2b')]);_0x1acc51['filters']=_[_0x066a('0x2e')](_0x1acc51[_0x066a('0x2f')],_0x1acc51['query']);_0x4c5e23['attributes']=_[_0x066a('0x2e')](_0x1acc51[_0x066a('0x2f')],qs[_0x066a('0x31')](_0x2b40e8['query'][_0x066a('0x31')]));_0x4c5e23[_0x066a('0x30')]=_0x4c5e23[_0x066a('0x30')][_0x066a('0x40')]?_0x4c5e23['attributes']:_0x1acc51['model'];if(_0x2b40e8[_0x066a('0x2b')]['includeAll']){_0x4c5e23['include']=[{'all':!![]}];}_0x4c5e23=_[_0x066a('0x39')]({},_0x4c5e23,_0x2b40e8['options']);return db[_0x066a('0x27')][_0x066a('0x41')](_0x4c5e23)[_0x066a('0x23')](handleEntityNotFound(_0x5b1cf7,null))['then'](respondWithResult(_0x5b1cf7,null))[_0x066a('0x42')](handleError(_0x5b1cf7,null));};exports[_0x066a('0x43')]=function(_0x2e2d30,_0xc5fea0){return db['DeskAccount'][_0x066a('0x43')](_0x2e2d30[_0x066a('0x44')],{})[_0x066a('0x23')](respondWithResult(_0xc5fea0,0xc9))['catch'](handleError(_0xc5fea0,null));};exports['update']=function(_0x4898cf,_0x2a1c20){if(_0x4898cf[_0x066a('0x44')]['id']){delete _0x4898cf[_0x066a('0x44')]['id'];}return db[_0x066a('0x27')][_0x066a('0x41')]({'where':{'id':_0x4898cf[_0x066a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2a1c20,null))[_0x066a('0x23')](saveUpdates(_0x4898cf[_0x066a('0x44')],null))[_0x066a('0x23')](respondWithResult(_0x2a1c20,null))[_0x066a('0x42')](handleError(_0x2a1c20,null));};exports[_0x066a('0x22')]=function(_0x3b34aa,_0x5ae199){return db['DeskAccount'][_0x066a('0x41')]({'where':{'id':_0x3b34aa[_0x066a('0x3f')]['id']}})[_0x066a('0x23')](handleEntityNotFound(_0x5ae199,null))[_0x066a('0x23')](removeEntity(_0x5ae199,null))[_0x066a('0x42')](handleError(_0x5ae199,null));};exports[_0x066a('0x45')]=function(_0x43d144,_0x2642da,_0x5c16a4){var _0x15641d={};var _0x4f8bcc={};var _0x5b61f3;var _0x7abcf6;return db[_0x066a('0x27')][_0x066a('0x46')]({'where':{'id':_0x43d144['params']['id']}})[_0x066a('0x23')](handleEntityNotFound(_0x2642da,null))['then'](function(_0x5851df){if(_0x5851df){_0x5b61f3=_0x5851df;_0x4f8bcc[_0x066a('0x2f')]=_['keys'](db[_0x066a('0x47')]['rawAttributes']);_0x4f8bcc[_0x066a('0x2b')]=_['keys'](_0x43d144[_0x066a('0x2b')]);_0x4f8bcc[_0x066a('0x2d')]=_['intersection'](_0x4f8bcc[_0x066a('0x2f')],_0x4f8bcc[_0x066a('0x2b')]);_0x15641d[_0x066a('0x30')]=_[_0x066a('0x2e')](_0x4f8bcc[_0x066a('0x2f')],qs['fields'](_0x43d144[_0x066a('0x2b')][_0x066a('0x31')]));_0x15641d[_0x066a('0x30')]=_0x15641d[_0x066a('0x30')][_0x066a('0x40')]?_0x15641d['attributes']:_0x4f8bcc['model'];_0x15641d['order']=qs[_0x066a('0x34')](_0x43d144[_0x066a('0x2b')][_0x066a('0x34')]);_0x15641d[_0x066a('0x35')]=qs['filters'](_[_0x066a('0x36')](_0x43d144[_0x066a('0x2b')],_0x4f8bcc[_0x066a('0x2d')]));if(_0x43d144[_0x066a('0x2b')]['filter']){_0x15641d[_0x066a('0x35')]=_[_0x066a('0x39')](_0x15641d[_0x066a('0x35')],{'$or':_[_0x066a('0x48')](_0x15641d['attributes'],function(_0x274061){var _0x571579={};_0x571579[_0x274061]={'$like':'%'+_0x43d144[_0x066a('0x2b')]['filter']+'%'};return _0x571579;})});}_0x15641d=_[_0x066a('0x39')]({},_0x15641d,_0x43d144[_0x066a('0x3a')]);return _0x5b61f3[_0x066a('0x45')](_0x15641d);}})[_0x066a('0x23')](function(_0x11cf22){if(_0x11cf22){_0x7abcf6=_0x11cf22[_0x066a('0x40')];if(!_0x43d144[_0x066a('0x2b')][_0x066a('0x49')](_0x066a('0x32'))){_0x15641d[_0x066a('0x1d')]=qs[_0x066a('0x1d')](_0x43d144['query'][_0x066a('0x1d')]);_0x15641d['offset']=qs[_0x066a('0x1c')](_0x43d144[_0x066a('0x2b')][_0x066a('0x1c')]);}return _0x5b61f3[_0x066a('0x45')](_0x15641d);}})[_0x066a('0x23')](function(_0x26919a){if(_0x26919a){return _0x26919a?{'count':_0x7abcf6,'rows':_0x26919a}:null;}})['then'](respondWithResult(_0x2642da,null))[_0x066a('0x42')](handleError(_0x2642da,null));};exports['addConfiguration']=function(_0x43adc,_0x8fb776,_0x2bea3a){if(_0x43adc[_0x066a('0x44')]['id']){delete _0x43adc[_0x066a('0x44')]['id'];}return db[_0x066a('0x27')][_0x066a('0x46')]({'where':{'id':_0x43adc[_0x066a('0x3f')]['id']}})[_0x066a('0x23')](handleEntityNotFound(_0x8fb776,null))[_0x066a('0x23')](function(_0x5bb41b){if(_0x5bb41b){_0x43adc['body'][_0x066a('0x4a')]=_0x5bb41b['id'];_0x43adc[_0x066a('0x44')][_0x066a('0x4b')]=integrations[_0x066a('0x4c')](_0x43adc[_0x066a('0x44')][_0x066a('0x4d')],_0x43adc[_0x066a('0x44')][_0x066a('0x2a')]);_0x43adc['body']['Descriptions']=integrations[_0x066a('0x4e')](_0x43adc[_0x066a('0x44')][_0x066a('0x4d')],_0x43adc['body'][_0x066a('0x2a')]);return db[_0x066a('0x47')][_0x066a('0x43')](_0x43adc[_0x066a('0x44')],{'include':[{'model':db['DeskField'],'as':_0x066a('0x4b')},{'model':db['DeskField'],'as':_0x066a('0x4f')}]});}return null;})[_0x066a('0x23')](respondWithResult(_0x8fb776,null))[_0x066a('0x42')](handleError(_0x8fb776,null));};exports['getFields']=function(_0x5cced5,_0x45264f,_0x444ca3){var _0x321a9f=[{'name':_0x066a('0x50'),'label':_0x066a('0x50'),'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 _0x1a7bad='';return db[_0x066a('0x27')][_0x066a('0x46')]({'where':{'id':_0x5cced5['params']['id']},'attributes':['id','remoteUri',_0x066a('0x51'),'username',_0x066a('0x52'),'consumerKey',_0x066a('0x53'),_0x066a('0x54'),_0x066a('0x55')]})[_0x066a('0x23')](handleEntityNotFound(_0x45264f,null))[_0x066a('0x23')](function(_0x4d9207){if(_0x4d9207){_0x1a7bad=_0x4d9207[_0x066a('0x56')];var _0x299397=_0x1a7bad['slice'](-0x1);if(_0x299397==='/'){_0x1a7bad=_0x1a7bad[_0x066a('0x57')](0x0,_0x1a7bad[_0x066a('0x58')](_0x299397));}var _0x2a98e4={'method':_0x066a('0x59'),'uri':util[_0x066a('0x5a')](_0x066a('0x5b'),_0x1a7bad),'headers':{'Content-Type':_0x066a('0x5c'),'Accept':_0x066a('0x5c')},'json':!![]};if(_0x4d9207[_0x066a('0x51')]===_0x066a('0x5d')){_0x2a98e4[_0x066a('0x5e')]['Authorization']=util['format'](_0x066a('0x5f'),new Buffer(util[_0x066a('0x5a')]('%s:%s',_0x4d9207[_0x066a('0x60')],_0x4d9207[_0x066a('0x52')]))[_0x066a('0x61')]('base64'));}return rp(_0x2a98e4)['then'](function(_0x351643){return _0x321a9f[_0x066a('0x62')](_[_0x066a('0x48')](_0x351643['_embedded']['entries'],function(_0x13ff42){return{'id':_0x13ff42[_0x066a('0x25')],'name':_0x13ff42['name'],'type':_0x13ff42[_0x066a('0x2a')],'active':_0x13ff42['active'],'label':_0x13ff42[_0x066a('0x63')],'custom':!![]};}));});}})[_0x066a('0x23')](function(_0x56301b){return{'count':_0x56301b[_0x066a('0x40')],'rows':_0x56301b};})[_0x066a('0x23')](respondWithResult(_0x45264f,null))[_0x066a('0x42')](function(_0x11a7bf){var _0x3a3ba9=_0x5cced5[_0x066a('0x2b')]['test']?0x1f4:_0x11a7bf[_0x066a('0x64')]||0x1f4;logger[_0x066a('0x65')](_0x066a('0x66'),_0x066a('0x67'),_0x3a3ba9,JSON[_0x066a('0x68')](_0x11a7bf));delete _0x11a7bf[_0x066a('0x25')];if(_0x3a3ba9===0x191){_0x3a3ba9=0x190;}_0x45264f[_0x066a('0x19')](_0x3a3ba9)[_0x066a('0x69')](_0x5cced5[_0x066a('0x2b')]['test']?{'message':_0x066a('0x6a'),'statusCode':_0x11a7bf['statusCode']}:_0x11a7bf);});};
\ No newline at end of file
index b555fc2..21bbc22 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0041=['exports','define','DeskAccount','int_desk_accounts','lodash','../../config/logger','api','moment','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0041,0xe8));var _0x1004=function(_0x111225,_0xcdcd11){_0x111225=_0x111225-0x0;var _0x228c23=_0x0041[_0x111225];return _0x228c23;};'use strict';var _=require(_0x1004('0x0'));var util=require('util');var logger=require(_0x1004('0x1'))(_0x1004('0x2'));var moment=require(_0x1004('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1004('0x4'));var rimraf=require(_0x1004('0x5'));var config=require('../../config/environment');var attributes=require(_0x1004('0x6'));var integrations=require(_0x1004('0x7'));module[_0x1004('0x8')]=function(_0x379820,_0x58ef82){return _0x379820[_0x1004('0x9')](_0x1004('0xa'),attributes,{'tableName':_0x1004('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x874e=['define','DeskAccount','int_desk_accounts','lodash','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x874e,0xac));var _0xe874=function(_0xbc4560,_0x4020b8){_0xbc4560=_0xbc4560-0x0;var _0x298cfb=_0x874e[_0xbc4560];return _0x298cfb;};'use strict';var _=require(_0xe874('0x0'));var util=require('util');var logger=require(_0xe874('0x1'))(_0xe874('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe874('0x3'));var fs=require('fs');var path=require(_0xe874('0x4'));var rimraf=require(_0xe874('0x5'));var config=require(_0xe874('0x6'));var attributes=require(_0xe874('0x7'));var integrations=require(_0xe874('0x8'));module[_0xe874('0x9')]=function(_0x31e00c,_0x3be59d){return _0x31e00c[_0xe874('0xa')](_0xe874('0xb'),attributes,{'tableName':_0xe874('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6397895..a98935f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6112=['ShowDeskAccount','find','where','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','GetDeskAccount','DeskAccount','options','raw','attributes','limit','include','map','model','debug'];(function(_0x3260da,_0x4b1bdc){var _0x26df59=function(_0x53710c){while(--_0x53710c){_0x3260da['push'](_0x3260da['shift']());}};_0x26df59(++_0x4b1bdc);}(_0x6112,0x100));var _0x2611=function(_0x70b94a,_0x11e941){_0x70b94a=_0x70b94a-0x0;var _0x1d67a2=_0x6112[_0x70b94a];return _0x1d67a2;};'use strict';var _=require(_0x2611('0x0'));var util=require(_0x2611('0x1'));var moment=require(_0x2611('0x2'));var BPromise=require(_0x2611('0x3'));var rs=require(_0x2611('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2611('0x5'))['db'];var utils=require(_0x2611('0x6'));var logger=require(_0x2611('0x7'))(_0x2611('0x8'));var config=require(_0x2611('0x9'));var jayson=require(_0x2611('0xa'));var client=jayson[_0x2611('0xb')][_0x2611('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x15df63,_0x4ef1c8,_0x46ecc1){return new BPromise(function(_0x3e385f,_0x34b5c0){return client['request'](_0x15df63,_0x46ecc1)[_0x2611('0xd')](function(_0x20b110){logger[_0x2611('0xe')]('DeskAccount,\x20%s,\x20%s',_0x4ef1c8,_0x2611('0xf'));logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x4ef1c8,_0x2611('0xf'),JSON['stringify'](_0x20b110));if(_0x20b110[_0x2611('0x10')]){if(_0x20b110[_0x2611('0x10')][_0x2611('0x11')]===0x1f4){logger[_0x2611('0x10')](_0x2611('0x12'),_0x4ef1c8,_0x20b110[_0x2611('0x10')][_0x2611('0x13')]);return _0x34b5c0(_0x20b110[_0x2611('0x10')][_0x2611('0x13')]);}logger[_0x2611('0x10')](_0x2611('0x12'),_0x4ef1c8,_0x20b110[_0x2611('0x10')][_0x2611('0x13')]);return _0x3e385f(_0x20b110[_0x2611('0x10')][_0x2611('0x13')]);}else{logger[_0x2611('0xe')](_0x2611('0x12'),_0x4ef1c8,_0x2611('0xf'));_0x3e385f(_0x20b110[_0x2611('0x14')][_0x2611('0x13')]);}})[_0x2611('0x15')](function(_0x4d1dbe){logger[_0x2611('0x10')](_0x2611('0x12'),_0x4ef1c8,_0x4d1dbe);_0x34b5c0(_0x4d1dbe);});});}exports[_0x2611('0x16')]=function(_0x23ec5b){var _0x38962c=this;return new Promise(function(_0x11a017,_0x26201b){return db[_0x2611('0x17')]['findAll']({'raw':_0x23ec5b['options']?_0x23ec5b[_0x2611('0x18')][_0x2611('0x19')]===undefined?!![]:![]:!![],'where':_0x23ec5b[_0x2611('0x18')]?_0x23ec5b['options']['where']||null:null,'attributes':_0x23ec5b[_0x2611('0x18')]?_0x23ec5b[_0x2611('0x18')][_0x2611('0x1a')]||null:null,'limit':_0x23ec5b[_0x2611('0x18')]?_0x23ec5b[_0x2611('0x18')][_0x2611('0x1b')]||null:null,'include':_0x23ec5b['options']?_0x23ec5b[_0x2611('0x18')][_0x2611('0x1c')]?_[_0x2611('0x1d')](_0x23ec5b[_0x2611('0x18')][_0x2611('0x1c')],function(_0x576ecc){return{'model':db[_0x576ecc['model']],'as':_0x576ecc['as'],'attributes':_0x576ecc[_0x2611('0x1a')],'include':_0x576ecc[_0x2611('0x1c')]?_['map'](_0x576ecc[_0x2611('0x1c')],function(_0x622f66){return{'model':db[_0x622f66['model']],'as':_0x622f66['as'],'attributes':_0x622f66[_0x2611('0x1a')],'include':_0x622f66[_0x2611('0x1c')]?_[_0x2611('0x1d')](_0x622f66[_0x2611('0x1c')],function(_0x4607da){return{'model':db[_0x4607da[_0x2611('0x1e')]],'as':_0x4607da['as'],'attributes':_0x4607da[_0x2611('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x190e50){logger[_0x2611('0xe')](_0x2611('0x16'),_0x23ec5b);logger[_0x2611('0x1f')]('GetDeskAccount',_0x23ec5b,JSON['stringify'](_0x190e50));_0x11a017(_0x190e50);})[_0x2611('0x15')](function(_0x119bcd){logger['error'](_0x2611('0x16'),_0x119bcd[_0x2611('0x13')],_0x23ec5b);_0x26201b(_0x38962c[_0x2611('0x10')](0x1f4,_0x119bcd[_0x2611('0x13')]));});});};exports[_0x2611('0x20')]=function(_0x215b24){var _0x16ea1e=this;return new Promise(function(_0x5a6a2d,_0x5cada2){return db[_0x2611('0x17')][_0x2611('0x21')]({'raw':_0x215b24[_0x2611('0x18')]?_0x215b24[_0x2611('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x215b24['options']?_0x215b24[_0x2611('0x18')][_0x2611('0x22')]||null:null,'attributes':_0x215b24[_0x2611('0x18')]?_0x215b24[_0x2611('0x18')][_0x2611('0x1a')]||null:null,'include':_0x215b24[_0x2611('0x18')]?_0x215b24[_0x2611('0x18')]['include']?_['map'](_0x215b24[_0x2611('0x18')][_0x2611('0x1c')],function(_0x26585a){return{'model':db[_0x26585a[_0x2611('0x1e')]],'as':_0x26585a['as'],'attributes':_0x26585a['attributes'],'include':_0x26585a['include']?_['map'](_0x26585a[_0x2611('0x1c')],function(_0x2a65c0){return{'model':db[_0x2a65c0['model']],'as':_0x2a65c0['as'],'attributes':_0x2a65c0[_0x2611('0x1a')],'include':_0x2a65c0['include']?_[_0x2611('0x1d')](_0x2a65c0[_0x2611('0x1c')],function(_0x12187a){return{'model':db[_0x12187a[_0x2611('0x1e')]],'as':_0x12187a['as'],'attributes':_0x12187a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x15fec3){logger[_0x2611('0xe')](_0x2611('0x20'),_0x215b24);logger[_0x2611('0x1f')](_0x2611('0x20'),_0x215b24,JSON[_0x2611('0x23')](_0x15fec3));_0x5a6a2d(_0x15fec3);})['catch'](function(_0x4fc833){logger[_0x2611('0x10')](_0x2611('0x20'),_0x4fc833['message'],_0x215b24);_0x5cada2(_0x16ea1e['error'](0x1f4,_0x4fc833['message']));});});};
\ No newline at end of file
+var _0x1c49=['../../config/logger','rpc','../../config/environment','client','http','request','then','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','DeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetDeskAccount','find','ShowDeskAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x18bd3e,_0x514c52){var _0x3dcc3d=function(_0x2dd2cb){while(--_0x2dd2cb){_0x18bd3e['push'](_0x18bd3e['shift']());}};_0x3dcc3d(++_0x514c52);}(_0x1c49,0x1e3));var _0x91c4=function(_0x13267a,_0x490bb7){_0x13267a=_0x13267a-0x0;var _0x86874b=_0x1c49[_0x13267a];return _0x86874b;};'use strict';var _=require(_0x91c4('0x0'));var util=require(_0x91c4('0x1'));var moment=require(_0x91c4('0x2'));var BPromise=require(_0x91c4('0x3'));var rs=require(_0x91c4('0x4'));var fs=require('fs');var Redis=require(_0x91c4('0x5'));var db=require(_0x91c4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x91c4('0x7'))(_0x91c4('0x8'));var config=require(_0x91c4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x91c4('0xa')][_0x91c4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x410294,_0x2c381c,_0x5736a7){return new BPromise(function(_0x5afec6,_0x18cdc4){return client[_0x91c4('0xc')](_0x410294,_0x5736a7)[_0x91c4('0xd')](function(_0x53b89c){logger['info'](_0x91c4('0xe'),_0x2c381c,_0x91c4('0xf'));logger[_0x91c4('0x10')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x2c381c,_0x91c4('0xf'),JSON[_0x91c4('0x11')](_0x53b89c));if(_0x53b89c[_0x91c4('0x12')]){if(_0x53b89c[_0x91c4('0x12')]['code']===0x1f4){logger[_0x91c4('0x12')](_0x91c4('0xe'),_0x2c381c,_0x53b89c[_0x91c4('0x12')]['message']);return _0x18cdc4(_0x53b89c['error'][_0x91c4('0x13')]);}logger[_0x91c4('0x12')](_0x91c4('0xe'),_0x2c381c,_0x53b89c['error'][_0x91c4('0x13')]);return _0x5afec6(_0x53b89c[_0x91c4('0x12')][_0x91c4('0x13')]);}else{logger[_0x91c4('0x14')](_0x91c4('0xe'),_0x2c381c,_0x91c4('0xf'));_0x5afec6(_0x53b89c['result'][_0x91c4('0x13')]);}})[_0x91c4('0x15')](function(_0x566ee8){logger[_0x91c4('0x12')](_0x91c4('0xe'),_0x2c381c,_0x566ee8);_0x18cdc4(_0x566ee8);});});}exports['GetDeskAccount']=function(_0x218ddd){var _0x410415=this;return new Promise(function(_0x1c099d,_0x240207){return db[_0x91c4('0x16')][_0x91c4('0x17')]({'raw':_0x218ddd[_0x91c4('0x18')]?_0x218ddd['options'][_0x91c4('0x19')]===undefined?!![]:![]:!![],'where':_0x218ddd[_0x91c4('0x18')]?_0x218ddd[_0x91c4('0x18')][_0x91c4('0x1a')]||null:null,'attributes':_0x218ddd[_0x91c4('0x18')]?_0x218ddd[_0x91c4('0x18')][_0x91c4('0x1b')]||null:null,'limit':_0x218ddd[_0x91c4('0x18')]?_0x218ddd['options'][_0x91c4('0x1c')]||null:null,'include':_0x218ddd[_0x91c4('0x18')]?_0x218ddd[_0x91c4('0x18')][_0x91c4('0x1d')]?_[_0x91c4('0x1e')](_0x218ddd[_0x91c4('0x18')][_0x91c4('0x1d')],function(_0x3ae2d7){return{'model':db[_0x3ae2d7[_0x91c4('0x1f')]],'as':_0x3ae2d7['as'],'attributes':_0x3ae2d7[_0x91c4('0x1b')],'include':_0x3ae2d7[_0x91c4('0x1d')]?_[_0x91c4('0x1e')](_0x3ae2d7['include'],function(_0x55ad3c){return{'model':db[_0x55ad3c[_0x91c4('0x1f')]],'as':_0x55ad3c['as'],'attributes':_0x55ad3c[_0x91c4('0x1b')],'include':_0x55ad3c[_0x91c4('0x1d')]?_[_0x91c4('0x1e')](_0x55ad3c['include'],function(_0x2eb71a){return{'model':db[_0x2eb71a[_0x91c4('0x1f')]],'as':_0x2eb71a['as'],'attributes':_0x2eb71a[_0x91c4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x91c4('0xd')](function(_0xb500fe){logger['info'](_0x91c4('0x20'),_0x218ddd);logger[_0x91c4('0x10')](_0x91c4('0x20'),_0x218ddd,JSON['stringify'](_0xb500fe));_0x1c099d(_0xb500fe);})[_0x91c4('0x15')](function(_0x26c97f){logger[_0x91c4('0x12')](_0x91c4('0x20'),_0x26c97f[_0x91c4('0x13')],_0x218ddd);_0x240207(_0x410415[_0x91c4('0x12')](0x1f4,_0x26c97f[_0x91c4('0x13')]));});});};exports['ShowDeskAccount']=function(_0x159ee2){var _0x3b164b=this;return new Promise(function(_0x5dc1d0,_0x3c6889){return db[_0x91c4('0x16')][_0x91c4('0x21')]({'raw':_0x159ee2[_0x91c4('0x18')]?_0x159ee2[_0x91c4('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x159ee2['options']?_0x159ee2[_0x91c4('0x18')][_0x91c4('0x1a')]||null:null,'attributes':_0x159ee2[_0x91c4('0x18')]?_0x159ee2['options']['attributes']||null:null,'include':_0x159ee2['options']?_0x159ee2[_0x91c4('0x18')]['include']?_[_0x91c4('0x1e')](_0x159ee2[_0x91c4('0x18')][_0x91c4('0x1d')],function(_0x1b89bc){return{'model':db[_0x1b89bc[_0x91c4('0x1f')]],'as':_0x1b89bc['as'],'attributes':_0x1b89bc[_0x91c4('0x1b')],'include':_0x1b89bc[_0x91c4('0x1d')]?_['map'](_0x1b89bc[_0x91c4('0x1d')],function(_0x1c75e8){return{'model':db[_0x1c75e8[_0x91c4('0x1f')]],'as':_0x1c75e8['as'],'attributes':_0x1c75e8[_0x91c4('0x1b')],'include':_0x1c75e8[_0x91c4('0x1d')]?_[_0x91c4('0x1e')](_0x1c75e8['include'],function(_0x3ddc68){return{'model':db[_0x3ddc68[_0x91c4('0x1f')]],'as':_0x3ddc68['as'],'attributes':_0x3ddc68[_0x91c4('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x178a5d){logger['info'](_0x91c4('0x22'),_0x159ee2);logger['debug'](_0x91c4('0x22'),_0x159ee2,JSON[_0x91c4('0x11')](_0x178a5d));_0x5dc1d0(_0x178a5d);})[_0x91c4('0x15')](function(_0x22c90d){logger[_0x91c4('0x12')](_0x91c4('0x22'),_0x22c90d[_0x91c4('0x13')],_0x159ee2);_0x3c6889(_0x3b164b[_0x91c4('0x12')](0x1f4,_0x22c90d[_0x91c4('0x13')]));});});};
\ No newline at end of file
index 77e8fb4..26a962b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','getFields','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','setTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1c4925,_0x4d6341){var _0x4e8c60=function(_0x4f3b15){while(--_0x4f3b15){_0x1c4925['push'](_0x1c4925['shift']());}};_0x4e8c60(++_0x4d6341);}(_0x008c,0x188));var _0xc008=function(_0x5df952,_0x3940da){_0x5df952=_0x5df952-0x0;var _0xf5400a=_0x008c[_0x5df952];return _0xf5400a;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0x10'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x14')](_0xc008('0x15'),auth[_0xc008('0xb')](),controller[_0xc008('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x17')]);module[_0xc008('0x18')]=router;
\ No newline at end of file
+var _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x130cbb,_0x254820){var _0x15b1ea=function(_0x1688e2){while(--_0x1688e2){_0x130cbb['push'](_0x130cbb['shift']());}};_0x15b1ea(++_0x254820);}(_0x9c44,0x178));var _0x49c4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9c44[_0xdea41a];return _0x15d0d8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router;
\ No newline at end of file
index d20f338..6af736b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa49a=['sequelize','exports','STRING'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0xa49a,0x1c5));var _0xaa49=function(_0x15bacf,_0x24253f){_0x15bacf=_0x15bacf-0x0;var _0x576d15=_0xa49a[_0x15bacf];return _0x576d15;};'use strict';var Sequelize=require(_0xaa49('0x0'));module[_0xaa49('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xaa49('0x2')]}};
\ No newline at end of file
+var _0xe5cd=['sequelize','exports','STRING'];(function(_0x354247,_0xe1411b){var _0x38c6b5=function(_0x2eae4b){while(--_0x2eae4b){_0x354247['push'](_0x354247['shift']());}};_0x38c6b5(++_0xe1411b);}(_0xe5cd,0x183));var _0xde5c=function(_0x4dccf2,_0x5cfcd7){_0x4dccf2=_0x4dccf2-0x0;var _0x12640e=_0xe5cd[_0x4dccf2];return _0x12640e;};'use strict';var Sequelize=require(_0xde5c('0x0'));module[_0xde5c('0x1')]={'name':{'type':Sequelize[_0xde5c('0x2')]},'description':{'type':Sequelize[_0xde5c('0x2')]}};
\ No newline at end of file
index 5deb5ce..c5b0c21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc96=['then','destroy','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','includeAll','include','find','create','body','update','getFields','params','DeskField','options','getSubjects','getDescriptions','Tag','getTags','setTags','findOne','ids','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save'];(function(_0x48140d,_0x3c78d8){var _0x344ff5=function(_0x1ebc3c){while(--_0x1ebc3c){_0x48140d['push'](_0x48140d['shift']());}};_0x344ff5(++_0x3c78d8);}(_0xdc96,0x86));var _0x6dc9=function(_0x4b7895,_0x3c4f5d){_0x4b7895=_0x4b7895-0x0;var _0x264180=_0xdc96[_0x4b7895];return _0x264180;};'use strict';var emlformat=require(_0x6dc9('0x0'));var rimraf=require(_0x6dc9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6dc9('0x2'));var rp=require('request-promise');var moment=require(_0x6dc9('0x3'));var BPromise=require(_0x6dc9('0x4'));var Mustache=require(_0x6dc9('0x5'));var util=require(_0x6dc9('0x6'));var path=require('path');var sox=require(_0x6dc9('0x7'));var csv=require('to-csv');var ejs=require(_0x6dc9('0x8'));var fs=require('fs');var fs_extra=require(_0x6dc9('0x9'));var _=require('lodash');var squel=require(_0x6dc9('0xa'));var crypto=require('crypto');var jsforce=require(_0x6dc9('0xb'));var deskjs=require(_0x6dc9('0xc'));var toCsv=require(_0x6dc9('0xd'));var querystring=require(_0x6dc9('0xe'));var Papa=require(_0x6dc9('0xf'));var Redis=require(_0x6dc9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6dc9('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6dc9('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x6dc9('0x13'));var licenseUtil=require(_0x6dc9('0x14'));var db=require(_0x6dc9('0x15'))['db'];function respondWithStatusCode(_0x2a5543,_0x4836f4){_0x4836f4=_0x4836f4||0xcc;return function(_0x2ce4e2){if(_0x2ce4e2){return _0x2a5543['sendStatus'](_0x4836f4);}return _0x2a5543[_0x6dc9('0x16')](_0x4836f4)[_0x6dc9('0x17')]();};}function respondWithResult(_0x277195,_0x45ad6b){_0x45ad6b=_0x45ad6b||0xc8;return function(_0x499f3c){if(_0x499f3c){return _0x277195[_0x6dc9('0x16')](_0x45ad6b)[_0x6dc9('0x18')](_0x499f3c);}};}function respondWithFilteredResult(_0x3c552f,_0x491f69){return function(_0x56ad11){if(_0x56ad11){var _0x13585e=typeof _0x491f69['offset']===_0x6dc9('0x19')&&typeof _0x491f69[_0x6dc9('0x1a')]===_0x6dc9('0x19');var _0x5880d0=_0x56ad11['count'];var _0x1da28a=_0x13585e?0x0:_0x491f69[_0x6dc9('0x1b')];var _0x3ef743=_0x13585e?_0x56ad11[_0x6dc9('0x1c')]:_0x491f69[_0x6dc9('0x1b')]+_0x491f69[_0x6dc9('0x1a')];var _0x1037b9;if(_0x3ef743>=_0x5880d0){_0x3ef743=_0x5880d0;_0x1037b9=0xc8;}else{_0x1037b9=0xce;}_0x3c552f[_0x6dc9('0x16')](_0x1037b9);return _0x3c552f[_0x6dc9('0x1d')](_0x6dc9('0x1e'),_0x1da28a+'-'+_0x3ef743+'/'+_0x5880d0)[_0x6dc9('0x18')](_0x56ad11);}return null;};}function patchUpdates(_0x5ae134){return function(_0x5c37a7){try{jsonpatch[_0x6dc9('0x1f')](_0x5c37a7,_0x5ae134,!![]);}catch(_0x149cb2){return BPromise[_0x6dc9('0x20')](_0x149cb2);}return _0x5c37a7[_0x6dc9('0x21')]();};}function saveUpdates(_0x414772,_0x544405){return function(_0x20b53d){if(_0x20b53d){return _0x20b53d['update'](_0x414772)[_0x6dc9('0x22')](function(_0x5d17dd){return _0x5d17dd;});}return null;};}function removeEntity(_0x59a086,_0x503126){return function(_0x4b062d){if(_0x4b062d){return _0x4b062d[_0x6dc9('0x23')]()['then'](function(){_0x59a086[_0x6dc9('0x16')](0xcc)[_0x6dc9('0x17')]();});}};}function handleEntityNotFound(_0x71aa53,_0x436b32){return function(_0x42376c){if(!_0x42376c){_0x71aa53['sendStatus'](0x194);}return _0x42376c;};}function handleError(_0x246dc7,_0x33d377){_0x33d377=_0x33d377||0x1f4;return function(_0x3eb036){logger[_0x6dc9('0x24')](_0x3eb036[_0x6dc9('0x25')]);if(_0x3eb036[_0x6dc9('0x26')]){delete _0x3eb036[_0x6dc9('0x26')];}_0x246dc7[_0x6dc9('0x16')](_0x33d377)[_0x6dc9('0x27')](_0x3eb036);};}exports[_0x6dc9('0x28')]=function(_0x2801ed,_0x3fd7d2){var _0x1b6d13={},_0x2e13c8={},_0x528c08={'count':0x0,'rows':[]};var _0x1ebb89=_[_0x6dc9('0x29')](db[_0x6dc9('0x2a')][_0x6dc9('0x2b')],function(_0x2435ef){return{'name':_0x2435ef[_0x6dc9('0x2c')],'type':_0x2435ef[_0x6dc9('0x2d')]['key']};});_0x2e13c8[_0x6dc9('0x2e')]=_['map'](_0x1ebb89,'name');_0x2e13c8[_0x6dc9('0x2f')]=_[_0x6dc9('0x30')](_0x2801ed[_0x6dc9('0x2f')]);_0x2e13c8[_0x6dc9('0x31')]=_[_0x6dc9('0x32')](_0x2e13c8[_0x6dc9('0x2e')],_0x2e13c8[_0x6dc9('0x2f')]);_0x1b6d13[_0x6dc9('0x33')]=_[_0x6dc9('0x32')](_0x2e13c8[_0x6dc9('0x2e')],qs[_0x6dc9('0x34')](_0x2801ed[_0x6dc9('0x2f')][_0x6dc9('0x34')]));_0x1b6d13[_0x6dc9('0x33')]=_0x1b6d13['attributes'][_0x6dc9('0x35')]?_0x1b6d13[_0x6dc9('0x33')]:_0x2e13c8[_0x6dc9('0x2e')];if(!_0x2801ed[_0x6dc9('0x2f')][_0x6dc9('0x36')](_0x6dc9('0x37'))){_0x1b6d13[_0x6dc9('0x1a')]=qs['limit'](_0x2801ed['query'][_0x6dc9('0x1a')]);_0x1b6d13[_0x6dc9('0x1b')]=qs[_0x6dc9('0x1b')](_0x2801ed[_0x6dc9('0x2f')][_0x6dc9('0x1b')]);}_0x1b6d13[_0x6dc9('0x38')]=qs['sort'](_0x2801ed[_0x6dc9('0x2f')][_0x6dc9('0x39')]);_0x1b6d13[_0x6dc9('0x3a')]=qs[_0x6dc9('0x31')](_[_0x6dc9('0x3b')](_0x2801ed[_0x6dc9('0x2f')],_0x2e13c8[_0x6dc9('0x31')]),_0x1ebb89);if(_0x2801ed[_0x6dc9('0x2f')][_0x6dc9('0x3c')]){_0x1b6d13['where']=_[_0x6dc9('0x3d')](_0x1b6d13[_0x6dc9('0x3a')],{'$or':_[_0x6dc9('0x29')](_0x1ebb89,function(_0x2f7ddd){if(_0x2f7ddd[_0x6dc9('0x2d')]!==_0x6dc9('0x3e')){var _0x3cbd1a={};_0x3cbd1a[_0x2f7ddd[_0x6dc9('0x26')]]={'$like':'%'+_0x2801ed[_0x6dc9('0x2f')][_0x6dc9('0x3c')]+'%'};return _0x3cbd1a;}})});}_0x1b6d13=_['merge']({},_0x1b6d13,_0x2801ed['options']);var _0x3b4e84={'where':_0x1b6d13[_0x6dc9('0x3a')]};return db[_0x6dc9('0x2a')][_0x6dc9('0x1c')](_0x3b4e84)[_0x6dc9('0x22')](function(_0x47e116){_0x528c08['count']=_0x47e116;if(_0x2801ed['query']['includeAll']){_0x1b6d13['include']=[{'all':!![]}];}return db[_0x6dc9('0x2a')][_0x6dc9('0x3f')](_0x1b6d13);})[_0x6dc9('0x22')](function(_0xdbd53e){_0x528c08[_0x6dc9('0x40')]=_0xdbd53e;return _0x528c08;})[_0x6dc9('0x22')](respondWithFilteredResult(_0x3fd7d2,_0x1b6d13))[_0x6dc9('0x41')](handleError(_0x3fd7d2,null));};exports[_0x6dc9('0x42')]=function(_0x2bfdfa,_0xc98063){var _0x2474c8={'raw':![],'where':{'id':_0x2bfdfa['params']['id']}},_0x43e553={};_0x43e553[_0x6dc9('0x2e')]=_[_0x6dc9('0x30')](db[_0x6dc9('0x2a')][_0x6dc9('0x2b')]);_0x43e553[_0x6dc9('0x2f')]=_['keys'](_0x2bfdfa[_0x6dc9('0x2f')]);_0x43e553[_0x6dc9('0x31')]=_[_0x6dc9('0x32')](_0x43e553['model'],_0x43e553['query']);_0x2474c8[_0x6dc9('0x33')]=_['intersection'](_0x43e553[_0x6dc9('0x2e')],qs[_0x6dc9('0x34')](_0x2bfdfa[_0x6dc9('0x2f')][_0x6dc9('0x34')]));_0x2474c8[_0x6dc9('0x33')]=_0x2474c8[_0x6dc9('0x33')][_0x6dc9('0x35')]?_0x2474c8[_0x6dc9('0x33')]:_0x43e553[_0x6dc9('0x2e')];if(_0x2bfdfa[_0x6dc9('0x2f')][_0x6dc9('0x43')]){_0x2474c8[_0x6dc9('0x44')]=[{'all':!![]}];}_0x2474c8=_[_0x6dc9('0x3d')]({},_0x2474c8,_0x2bfdfa['options']);return db[_0x6dc9('0x2a')][_0x6dc9('0x45')](_0x2474c8)[_0x6dc9('0x22')](handleEntityNotFound(_0xc98063,null))[_0x6dc9('0x22')](respondWithResult(_0xc98063,null))[_0x6dc9('0x41')](handleError(_0xc98063,null));};exports[_0x6dc9('0x46')]=function(_0x377488,_0xc8a12f){return db[_0x6dc9('0x2a')][_0x6dc9('0x46')](_0x377488[_0x6dc9('0x47')],{})[_0x6dc9('0x22')](respondWithResult(_0xc8a12f,0xc9))[_0x6dc9('0x41')](handleError(_0xc8a12f,null));};exports[_0x6dc9('0x48')]=function(_0x1a196d,_0x6a50b5){if(_0x1a196d[_0x6dc9('0x47')]['id']){delete _0x1a196d[_0x6dc9('0x47')]['id'];}return db[_0x6dc9('0x2a')][_0x6dc9('0x45')]({'where':{'id':_0x1a196d['params']['id']}})[_0x6dc9('0x22')](handleEntityNotFound(_0x6a50b5,null))[_0x6dc9('0x22')](saveUpdates(_0x1a196d[_0x6dc9('0x47')],null))[_0x6dc9('0x22')](respondWithResult(_0x6a50b5,null))[_0x6dc9('0x41')](handleError(_0x6a50b5,null));};exports['destroy']=function(_0x9b2193,_0x45df14){return db[_0x6dc9('0x2a')][_0x6dc9('0x45')]({'where':{'id':_0x9b2193['params']['id']}})[_0x6dc9('0x22')](handleEntityNotFound(_0x45df14,null))[_0x6dc9('0x22')](removeEntity(_0x45df14,null))[_0x6dc9('0x41')](handleError(_0x45df14,null));};exports[_0x6dc9('0x49')]=function(_0x1958a6,_0x499b64,_0x4ccd5f){var _0x4637da={};var _0xcf96d8={};var _0x3d60bc;var _0x2b7897;return db[_0x6dc9('0x2a')]['findOne']({'where':{'id':_0x1958a6[_0x6dc9('0x4a')]['id']}})[_0x6dc9('0x22')](handleEntityNotFound(_0x499b64,null))[_0x6dc9('0x22')](function(_0x58d7af){if(_0x58d7af){_0x3d60bc=_0x58d7af;_0xcf96d8['model']=_[_0x6dc9('0x30')](db[_0x6dc9('0x4b')]['rawAttributes']);_0xcf96d8[_0x6dc9('0x2f')]=_['keys'](_0x1958a6[_0x6dc9('0x2f')]);_0xcf96d8[_0x6dc9('0x31')]=_[_0x6dc9('0x32')](_0xcf96d8[_0x6dc9('0x2e')],_0xcf96d8[_0x6dc9('0x2f')]);_0x4637da[_0x6dc9('0x33')]=_['intersection'](_0xcf96d8['model'],qs['fields'](_0x1958a6[_0x6dc9('0x2f')][_0x6dc9('0x34')]));_0x4637da['attributes']=_0x4637da['attributes'][_0x6dc9('0x35')]?_0x4637da['attributes']:_0xcf96d8[_0x6dc9('0x2e')];_0x4637da['order']=qs[_0x6dc9('0x39')](_0x1958a6[_0x6dc9('0x2f')]['sort']);_0x4637da['where']=qs[_0x6dc9('0x31')](_[_0x6dc9('0x3b')](_0x1958a6[_0x6dc9('0x2f')],_0xcf96d8['filters']));if(_0x1958a6[_0x6dc9('0x2f')][_0x6dc9('0x3c')]){_0x4637da[_0x6dc9('0x3a')]=_[_0x6dc9('0x3d')](_0x4637da[_0x6dc9('0x3a')],{'$or':_[_0x6dc9('0x29')](_0x4637da[_0x6dc9('0x33')],function(_0x2527da){var _0xf3179a={};_0xf3179a[_0x2527da]={'$like':'%'+_0x1958a6['query'][_0x6dc9('0x3c')]+'%'};return _0xf3179a;})});}_0x4637da=_[_0x6dc9('0x3d')]({},_0x4637da,_0x1958a6[_0x6dc9('0x4c')]);return _0x3d60bc[_0x6dc9('0x49')](_0x4637da);}})[_0x6dc9('0x22')](function(_0x16feb2){if(_0x16feb2){_0x2b7897=_0x16feb2[_0x6dc9('0x35')];if(!_0x1958a6[_0x6dc9('0x2f')][_0x6dc9('0x36')](_0x6dc9('0x37'))){_0x4637da[_0x6dc9('0x1a')]=qs[_0x6dc9('0x1a')](_0x1958a6[_0x6dc9('0x2f')][_0x6dc9('0x1a')]);_0x4637da[_0x6dc9('0x1b')]=qs[_0x6dc9('0x1b')](_0x1958a6[_0x6dc9('0x2f')]['offset']);}return _0x3d60bc[_0x6dc9('0x49')](_0x4637da);}})[_0x6dc9('0x22')](function(_0x447b74){if(_0x447b74){return _0x447b74?{'count':_0x2b7897,'rows':_0x447b74}:null;}})['then'](respondWithResult(_0x499b64,null))[_0x6dc9('0x41')](handleError(_0x499b64,null));};exports[_0x6dc9('0x4d')]=function(_0x136bdc,_0xeb7351,_0x196f5e){var _0x342558={};var _0x51e143={};var _0x2cfc83;var _0x2f5411;return db[_0x6dc9('0x2a')]['findOne']({'where':{'id':_0x136bdc['params']['id']}})[_0x6dc9('0x22')](handleEntityNotFound(_0xeb7351,null))['then'](function(_0x58e2f9){if(_0x58e2f9){_0x2cfc83=_0x58e2f9;_0x51e143[_0x6dc9('0x2e')]=_[_0x6dc9('0x30')](db[_0x6dc9('0x4b')][_0x6dc9('0x2b')]);_0x51e143[_0x6dc9('0x2f')]=_['keys'](_0x136bdc['query']);_0x51e143[_0x6dc9('0x31')]=_['intersection'](_0x51e143['model'],_0x51e143[_0x6dc9('0x2f')]);_0x342558[_0x6dc9('0x33')]=_['intersection'](_0x51e143[_0x6dc9('0x2e')],qs['fields'](_0x136bdc[_0x6dc9('0x2f')][_0x6dc9('0x34')]));_0x342558[_0x6dc9('0x33')]=_0x342558[_0x6dc9('0x33')]['length']?_0x342558['attributes']:_0x51e143[_0x6dc9('0x2e')];_0x342558['order']=qs[_0x6dc9('0x39')](_0x136bdc[_0x6dc9('0x2f')][_0x6dc9('0x39')]);_0x342558['where']=qs[_0x6dc9('0x31')](_[_0x6dc9('0x3b')](_0x136bdc[_0x6dc9('0x2f')],_0x51e143['filters']));if(_0x136bdc[_0x6dc9('0x2f')][_0x6dc9('0x3c')]){_0x342558[_0x6dc9('0x3a')]=_[_0x6dc9('0x3d')](_0x342558[_0x6dc9('0x3a')],{'$or':_[_0x6dc9('0x29')](_0x342558[_0x6dc9('0x33')],function(_0x10e105){var _0xf85f12={};_0xf85f12[_0x10e105]={'$like':'%'+_0x136bdc[_0x6dc9('0x2f')][_0x6dc9('0x3c')]+'%'};return _0xf85f12;})});}_0x342558=_[_0x6dc9('0x3d')]({},_0x342558,_0x136bdc['options']);return _0x2cfc83[_0x6dc9('0x4d')](_0x342558);}})[_0x6dc9('0x22')](function(_0x398ff6){if(_0x398ff6){_0x2f5411=_0x398ff6[_0x6dc9('0x35')];if(!_0x136bdc[_0x6dc9('0x2f')][_0x6dc9('0x36')](_0x6dc9('0x37'))){_0x342558[_0x6dc9('0x1a')]=qs[_0x6dc9('0x1a')](_0x136bdc['query'][_0x6dc9('0x1a')]);_0x342558[_0x6dc9('0x1b')]=qs[_0x6dc9('0x1b')](_0x136bdc[_0x6dc9('0x2f')][_0x6dc9('0x1b')]);}return _0x2cfc83['getSubjects'](_0x342558);}})[_0x6dc9('0x22')](function(_0xfd52b){if(_0xfd52b){return _0xfd52b?{'count':_0x2f5411,'rows':_0xfd52b}:null;}})[_0x6dc9('0x22')](respondWithResult(_0xeb7351,null))[_0x6dc9('0x41')](handleError(_0xeb7351,null));};exports['getDescriptions']=function(_0x14fd46,_0x473e21,_0x11fb4b){var _0x35cce9={};var _0xc7d650={};var _0x6422ec;var _0x28ce14;return db[_0x6dc9('0x2a')]['findOne']({'where':{'id':_0x14fd46[_0x6dc9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x473e21,null))[_0x6dc9('0x22')](function(_0x4a93ea){if(_0x4a93ea){_0x6422ec=_0x4a93ea;_0xc7d650[_0x6dc9('0x2e')]=_[_0x6dc9('0x30')](db['DeskField'][_0x6dc9('0x2b')]);_0xc7d650[_0x6dc9('0x2f')]=_[_0x6dc9('0x30')](_0x14fd46[_0x6dc9('0x2f')]);_0xc7d650['filters']=_['intersection'](_0xc7d650['model'],_0xc7d650[_0x6dc9('0x2f')]);_0x35cce9[_0x6dc9('0x33')]=_['intersection'](_0xc7d650[_0x6dc9('0x2e')],qs[_0x6dc9('0x34')](_0x14fd46[_0x6dc9('0x2f')]['fields']));_0x35cce9[_0x6dc9('0x33')]=_0x35cce9[_0x6dc9('0x33')][_0x6dc9('0x35')]?_0x35cce9[_0x6dc9('0x33')]:_0xc7d650[_0x6dc9('0x2e')];_0x35cce9[_0x6dc9('0x38')]=qs['sort'](_0x14fd46[_0x6dc9('0x2f')]['sort']);_0x35cce9['where']=qs[_0x6dc9('0x31')](_[_0x6dc9('0x3b')](_0x14fd46[_0x6dc9('0x2f')],_0xc7d650[_0x6dc9('0x31')]));if(_0x14fd46[_0x6dc9('0x2f')][_0x6dc9('0x3c')]){_0x35cce9[_0x6dc9('0x3a')]=_['merge'](_0x35cce9[_0x6dc9('0x3a')],{'$or':_[_0x6dc9('0x29')](_0x35cce9[_0x6dc9('0x33')],function(_0xaa6a40){var _0x3d5d09={};_0x3d5d09[_0xaa6a40]={'$like':'%'+_0x14fd46[_0x6dc9('0x2f')][_0x6dc9('0x3c')]+'%'};return _0x3d5d09;})});}_0x35cce9=_[_0x6dc9('0x3d')]({},_0x35cce9,_0x14fd46['options']);return _0x6422ec[_0x6dc9('0x4e')](_0x35cce9);}})[_0x6dc9('0x22')](function(_0x485d79){if(_0x485d79){_0x28ce14=_0x485d79[_0x6dc9('0x35')];if(!_0x14fd46[_0x6dc9('0x2f')]['hasOwnProperty'](_0x6dc9('0x37'))){_0x35cce9[_0x6dc9('0x1a')]=qs['limit'](_0x14fd46['query'][_0x6dc9('0x1a')]);_0x35cce9[_0x6dc9('0x1b')]=qs[_0x6dc9('0x1b')](_0x14fd46['query'][_0x6dc9('0x1b')]);}return _0x6422ec[_0x6dc9('0x4e')](_0x35cce9);}})[_0x6dc9('0x22')](function(_0x3d099a){if(_0x3d099a){return _0x3d099a?{'count':_0x28ce14,'rows':_0x3d099a}:null;}})['then'](respondWithResult(_0x473e21,null))['catch'](handleError(_0x473e21,null));};exports['getTags']=function(_0x12958a,_0x5c209f,_0xd7d244){var _0x447468={};var _0x4dc7d0={};var _0x2a4933;var _0x585db4;return db['DeskConfiguration']['findOne']({'where':{'id':_0x12958a[_0x6dc9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5c209f,null))[_0x6dc9('0x22')](function(_0x2cf693){if(_0x2cf693){_0x2a4933=_0x2cf693;_0x4dc7d0[_0x6dc9('0x2e')]=_[_0x6dc9('0x30')](db[_0x6dc9('0x4f')]['rawAttributes']);_0x4dc7d0[_0x6dc9('0x2f')]=_[_0x6dc9('0x30')](_0x12958a[_0x6dc9('0x2f')]);_0x4dc7d0[_0x6dc9('0x31')]=_['intersection'](_0x4dc7d0[_0x6dc9('0x2e')],_0x4dc7d0[_0x6dc9('0x2f')]);_0x447468[_0x6dc9('0x33')]=_[_0x6dc9('0x32')](_0x4dc7d0[_0x6dc9('0x2e')],qs[_0x6dc9('0x34')](_0x12958a[_0x6dc9('0x2f')][_0x6dc9('0x34')]));_0x447468['attributes']=_0x447468[_0x6dc9('0x33')]['length']?_0x447468[_0x6dc9('0x33')]:_0x4dc7d0[_0x6dc9('0x2e')];_0x447468[_0x6dc9('0x38')]=qs[_0x6dc9('0x39')](_0x12958a[_0x6dc9('0x2f')][_0x6dc9('0x39')]);_0x447468[_0x6dc9('0x3a')]=qs[_0x6dc9('0x31')](_[_0x6dc9('0x3b')](_0x12958a[_0x6dc9('0x2f')],_0x4dc7d0[_0x6dc9('0x31')]));if(_0x12958a['query'][_0x6dc9('0x3c')]){_0x447468[_0x6dc9('0x3a')]=_[_0x6dc9('0x3d')](_0x447468[_0x6dc9('0x3a')],{'$or':_[_0x6dc9('0x29')](_0x447468['attributes'],function(_0x589be0){var _0x588634={};_0x588634[_0x589be0]={'$like':'%'+_0x12958a[_0x6dc9('0x2f')][_0x6dc9('0x3c')]+'%'};return _0x588634;})});}_0x447468=_['merge']({},_0x447468,_0x12958a[_0x6dc9('0x4c')]);return _0x2a4933['getTags'](_0x447468);}})['then'](function(_0x45889f){if(_0x45889f){_0x585db4=_0x45889f[_0x6dc9('0x35')];if(!_0x12958a['query'][_0x6dc9('0x36')](_0x6dc9('0x37'))){_0x447468[_0x6dc9('0x1a')]=qs[_0x6dc9('0x1a')](_0x12958a[_0x6dc9('0x2f')][_0x6dc9('0x1a')]);_0x447468[_0x6dc9('0x1b')]=qs[_0x6dc9('0x1b')](_0x12958a[_0x6dc9('0x2f')][_0x6dc9('0x1b')]);}return _0x2a4933[_0x6dc9('0x50')](_0x447468);}})[_0x6dc9('0x22')](function(_0x46a310){if(_0x46a310){return _0x46a310?{'count':_0x585db4,'rows':_0x46a310}:null;}})[_0x6dc9('0x22')](respondWithResult(_0x5c209f,null))[_0x6dc9('0x41')](handleError(_0x5c209f,null));};exports[_0x6dc9('0x51')]=function(_0x3976ab,_0x56de99,_0x43b40b){if(_0x3976ab['body']['id']){delete _0x3976ab[_0x6dc9('0x47')]['id'];}return db[_0x6dc9('0x2a')][_0x6dc9('0x52')]({'where':{'id':_0x3976ab[_0x6dc9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x56de99,null))[_0x6dc9('0x22')](function(_0x53ca4c){if(_0x53ca4c){return _0x53ca4c[_0x6dc9('0x51')](_0x3976ab['body'][_0x6dc9('0x53')]||[]);}return null;})[_0x6dc9('0x22')](respondWithResult(_0x56de99,null))[_0x6dc9('0x41')](handleError(_0x56de99,null));};
\ No newline at end of file
+var _0x17d9=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','DeskConfiguration','include','findAll','rows','catch','params','model','includeAll','find','create','body','getFields','findOne','DeskField','nolimit','getSubjects','getDescriptions','Tag','getTags','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x54c0e4,_0x2834b3){var _0x2fc03f=function(_0x2c550d){while(--_0x2c550d){_0x54c0e4['push'](_0x54c0e4['shift']());}};_0x2fc03f(++_0x2834b3);}(_0x17d9,0x151));var _0x917d=function(_0x2b152a,_0x3dd988){_0x2b152a=_0x2b152a-0x0;var _0x2ad4c7=_0x17d9[_0x2b152a];return _0x2ad4c7;};'use strict';var emlformat=require(_0x917d('0x0'));var rimraf=require(_0x917d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x917d('0x2'));var rp=require(_0x917d('0x3'));var moment=require(_0x917d('0x4'));var BPromise=require(_0x917d('0x5'));var Mustache=require(_0x917d('0x6'));var util=require(_0x917d('0x7'));var path=require(_0x917d('0x8'));var sox=require(_0x917d('0x9'));var csv=require('to-csv');var ejs=require(_0x917d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x917d('0xb'));var crypto=require(_0x917d('0xc'));var jsforce=require(_0x917d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x917d('0xe'));var querystring=require(_0x917d('0xf'));var Papa=require(_0x917d('0x10'));var Redis=require(_0x917d('0x11'));var authService=require(_0x917d('0x12'));var qs=require(_0x917d('0x13'));var as=require(_0x917d('0x14'));var hardwareService=require(_0x917d('0x15'));var logger=require(_0x917d('0x16'))(_0x917d('0x17'));var utils=require(_0x917d('0x18'));var config=require(_0x917d('0x19'));var licenseUtil=require(_0x917d('0x1a'));var db=require(_0x917d('0x1b'))['db'];function respondWithStatusCode(_0x52f534,_0x1f1cae){_0x1f1cae=_0x1f1cae||0xcc;return function(_0x3830bb){if(_0x3830bb){return _0x52f534[_0x917d('0x1c')](_0x1f1cae);}return _0x52f534[_0x917d('0x1d')](_0x1f1cae)['end']();};}function respondWithResult(_0xc1f41f,_0x1ffbe1){_0x1ffbe1=_0x1ffbe1||0xc8;return function(_0x3d89e3){if(_0x3d89e3){return _0xc1f41f[_0x917d('0x1d')](_0x1ffbe1)[_0x917d('0x1e')](_0x3d89e3);}};}function respondWithFilteredResult(_0x2848f4,_0xfa14a8){return function(_0x30a791){if(_0x30a791){var _0x4977b1=typeof _0xfa14a8['offset']===_0x917d('0x1f')&&typeof _0xfa14a8[_0x917d('0x20')]===_0x917d('0x1f');var _0x2457a8=_0x30a791[_0x917d('0x21')];var _0x14f35d=_0x4977b1?0x0:_0xfa14a8[_0x917d('0x22')];var _0x1d2d9a=_0x4977b1?_0x30a791[_0x917d('0x21')]:_0xfa14a8[_0x917d('0x22')]+_0xfa14a8[_0x917d('0x20')];var _0x161fb9;if(_0x1d2d9a>=_0x2457a8){_0x1d2d9a=_0x2457a8;_0x161fb9=0xc8;}else{_0x161fb9=0xce;}_0x2848f4['status'](_0x161fb9);return _0x2848f4[_0x917d('0x23')](_0x917d('0x24'),_0x14f35d+'-'+_0x1d2d9a+'/'+_0x2457a8)[_0x917d('0x1e')](_0x30a791);}return null;};}function patchUpdates(_0x3ec942){return function(_0xedfe23){try{jsonpatch[_0x917d('0x25')](_0xedfe23,_0x3ec942,!![]);}catch(_0x17aade){return BPromise[_0x917d('0x26')](_0x17aade);}return _0xedfe23[_0x917d('0x27')]();};}function saveUpdates(_0xe578dd,_0xbd81e3){return function(_0x4c2bc9){if(_0x4c2bc9){return _0x4c2bc9[_0x917d('0x28')](_0xe578dd)[_0x917d('0x29')](function(_0x23a1a9){return _0x23a1a9;});}return null;};}function removeEntity(_0x118169,_0x48f7e8){return function(_0x438c33){if(_0x438c33){return _0x438c33[_0x917d('0x2a')]()[_0x917d('0x29')](function(){_0x118169[_0x917d('0x1d')](0xcc)[_0x917d('0x2b')]();});}};}function handleEntityNotFound(_0x173559,_0x37fc69){return function(_0x32ed2b){if(!_0x32ed2b){_0x173559[_0x917d('0x1c')](0x194);}return _0x32ed2b;};}function handleError(_0x56faf3,_0x4d9424){_0x4d9424=_0x4d9424||0x1f4;return function(_0x153a88){logger[_0x917d('0x2c')](_0x153a88['stack']);if(_0x153a88['name']){delete _0x153a88[_0x917d('0x2d')];}_0x56faf3[_0x917d('0x1d')](_0x4d9424)[_0x917d('0x2e')](_0x153a88);};}exports[_0x917d('0x2f')]=function(_0x179d46,_0x57994f){var _0x56835c={},_0x6372f9={},_0x2a3602={'count':0x0,'rows':[]};var _0x4108a5=_[_0x917d('0x30')](db['DeskConfiguration'][_0x917d('0x31')],function(_0x2275d1){return{'name':_0x2275d1[_0x917d('0x32')],'type':_0x2275d1[_0x917d('0x33')][_0x917d('0x34')]};});_0x6372f9['model']=_[_0x917d('0x30')](_0x4108a5,_0x917d('0x2d'));_0x6372f9[_0x917d('0x35')]=_[_0x917d('0x36')](_0x179d46[_0x917d('0x35')]);_0x6372f9['filters']=_[_0x917d('0x37')](_0x6372f9['model'],_0x6372f9['query']);_0x56835c['attributes']=_[_0x917d('0x37')](_0x6372f9['model'],qs['fields'](_0x179d46[_0x917d('0x35')][_0x917d('0x38')]));_0x56835c[_0x917d('0x39')]=_0x56835c['attributes'][_0x917d('0x3a')]?_0x56835c[_0x917d('0x39')]:_0x6372f9['model'];if(!_0x179d46[_0x917d('0x35')][_0x917d('0x3b')]('nolimit')){_0x56835c[_0x917d('0x20')]=qs[_0x917d('0x20')](_0x179d46[_0x917d('0x35')]['limit']);_0x56835c['offset']=qs[_0x917d('0x22')](_0x179d46['query'][_0x917d('0x22')]);}_0x56835c[_0x917d('0x3c')]=qs[_0x917d('0x3d')](_0x179d46[_0x917d('0x35')][_0x917d('0x3d')]);_0x56835c[_0x917d('0x3e')]=qs['filters'](_[_0x917d('0x3f')](_0x179d46[_0x917d('0x35')],_0x6372f9[_0x917d('0x40')]),_0x4108a5);if(_0x179d46[_0x917d('0x35')][_0x917d('0x41')]){_0x56835c[_0x917d('0x3e')]=_[_0x917d('0x42')](_0x56835c[_0x917d('0x3e')],{'$or':_[_0x917d('0x30')](_0x4108a5,function(_0x2d3b92){if(_0x2d3b92[_0x917d('0x33')]!==_0x917d('0x43')){var _0x15b3fe={};_0x15b3fe[_0x2d3b92[_0x917d('0x2d')]]={'$like':'%'+_0x179d46[_0x917d('0x35')][_0x917d('0x41')]+'%'};return _0x15b3fe;}})});}_0x56835c=_[_0x917d('0x42')]({},_0x56835c,_0x179d46[_0x917d('0x44')]);var _0x1e0736={'where':_0x56835c[_0x917d('0x3e')]};return db[_0x917d('0x45')]['count'](_0x1e0736)[_0x917d('0x29')](function(_0x1bcf4){_0x2a3602['count']=_0x1bcf4;if(_0x179d46[_0x917d('0x35')]['includeAll']){_0x56835c[_0x917d('0x46')]=[{'all':!![]}];}return db['DeskConfiguration'][_0x917d('0x47')](_0x56835c);})[_0x917d('0x29')](function(_0x332bac){_0x2a3602[_0x917d('0x48')]=_0x332bac;return _0x2a3602;})[_0x917d('0x29')](respondWithFilteredResult(_0x57994f,_0x56835c))[_0x917d('0x49')](handleError(_0x57994f,null));};exports['show']=function(_0x2ca77b,_0x210123){var _0x193528={'raw':![],'where':{'id':_0x2ca77b[_0x917d('0x4a')]['id']}},_0x16b5bc={};_0x16b5bc['model']=_[_0x917d('0x36')](db[_0x917d('0x45')]['rawAttributes']);_0x16b5bc[_0x917d('0x35')]=_[_0x917d('0x36')](_0x2ca77b[_0x917d('0x35')]);_0x16b5bc[_0x917d('0x40')]=_[_0x917d('0x37')](_0x16b5bc['model'],_0x16b5bc[_0x917d('0x35')]);_0x193528[_0x917d('0x39')]=_[_0x917d('0x37')](_0x16b5bc[_0x917d('0x4b')],qs[_0x917d('0x38')](_0x2ca77b[_0x917d('0x35')]['fields']));_0x193528[_0x917d('0x39')]=_0x193528[_0x917d('0x39')][_0x917d('0x3a')]?_0x193528[_0x917d('0x39')]:_0x16b5bc[_0x917d('0x4b')];if(_0x2ca77b[_0x917d('0x35')][_0x917d('0x4c')]){_0x193528['include']=[{'all':!![]}];}_0x193528=_[_0x917d('0x42')]({},_0x193528,_0x2ca77b['options']);return db[_0x917d('0x45')][_0x917d('0x4d')](_0x193528)[_0x917d('0x29')](handleEntityNotFound(_0x210123,null))[_0x917d('0x29')](respondWithResult(_0x210123,null))[_0x917d('0x49')](handleError(_0x210123,null));};exports[_0x917d('0x4e')]=function(_0x102965,_0x3502a6){return db[_0x917d('0x45')]['create'](_0x102965[_0x917d('0x4f')],{})[_0x917d('0x29')](respondWithResult(_0x3502a6,0xc9))[_0x917d('0x49')](handleError(_0x3502a6,null));};exports[_0x917d('0x28')]=function(_0x553de7,_0x54523a){if(_0x553de7[_0x917d('0x4f')]['id']){delete _0x553de7[_0x917d('0x4f')]['id'];}return db[_0x917d('0x45')][_0x917d('0x4d')]({'where':{'id':_0x553de7[_0x917d('0x4a')]['id']}})[_0x917d('0x29')](handleEntityNotFound(_0x54523a,null))['then'](saveUpdates(_0x553de7[_0x917d('0x4f')],null))[_0x917d('0x29')](respondWithResult(_0x54523a,null))[_0x917d('0x49')](handleError(_0x54523a,null));};exports[_0x917d('0x2a')]=function(_0x40c0bf,_0xd113d){return db[_0x917d('0x45')]['find']({'where':{'id':_0x40c0bf[_0x917d('0x4a')]['id']}})[_0x917d('0x29')](handleEntityNotFound(_0xd113d,null))['then'](removeEntity(_0xd113d,null))[_0x917d('0x49')](handleError(_0xd113d,null));};exports[_0x917d('0x50')]=function(_0x44cc27,_0x43662,_0x37bcc4){var _0x2b0c82={};var _0x4f519a={};var _0x3196fa;var _0x2d89b;return db[_0x917d('0x45')][_0x917d('0x51')]({'where':{'id':_0x44cc27[_0x917d('0x4a')]['id']}})[_0x917d('0x29')](handleEntityNotFound(_0x43662,null))['then'](function(_0x1a06dd){if(_0x1a06dd){_0x3196fa=_0x1a06dd;_0x4f519a['model']=_[_0x917d('0x36')](db[_0x917d('0x52')][_0x917d('0x31')]);_0x4f519a[_0x917d('0x35')]=_[_0x917d('0x36')](_0x44cc27[_0x917d('0x35')]);_0x4f519a['filters']=_[_0x917d('0x37')](_0x4f519a['model'],_0x4f519a[_0x917d('0x35')]);_0x2b0c82[_0x917d('0x39')]=_[_0x917d('0x37')](_0x4f519a[_0x917d('0x4b')],qs[_0x917d('0x38')](_0x44cc27[_0x917d('0x35')][_0x917d('0x38')]));_0x2b0c82[_0x917d('0x39')]=_0x2b0c82[_0x917d('0x39')][_0x917d('0x3a')]?_0x2b0c82[_0x917d('0x39')]:_0x4f519a[_0x917d('0x4b')];_0x2b0c82[_0x917d('0x3c')]=qs['sort'](_0x44cc27[_0x917d('0x35')][_0x917d('0x3d')]);_0x2b0c82[_0x917d('0x3e')]=qs[_0x917d('0x40')](_[_0x917d('0x3f')](_0x44cc27[_0x917d('0x35')],_0x4f519a['filters']));if(_0x44cc27[_0x917d('0x35')][_0x917d('0x41')]){_0x2b0c82[_0x917d('0x3e')]=_[_0x917d('0x42')](_0x2b0c82[_0x917d('0x3e')],{'$or':_[_0x917d('0x30')](_0x2b0c82['attributes'],function(_0x23c381){var _0x308217={};_0x308217[_0x23c381]={'$like':'%'+_0x44cc27[_0x917d('0x35')][_0x917d('0x41')]+'%'};return _0x308217;})});}_0x2b0c82=_['merge']({},_0x2b0c82,_0x44cc27[_0x917d('0x44')]);return _0x3196fa[_0x917d('0x50')](_0x2b0c82);}})['then'](function(_0x1368ba){if(_0x1368ba){_0x2d89b=_0x1368ba['length'];if(!_0x44cc27[_0x917d('0x35')][_0x917d('0x3b')](_0x917d('0x53'))){_0x2b0c82[_0x917d('0x20')]=qs['limit'](_0x44cc27[_0x917d('0x35')][_0x917d('0x20')]);_0x2b0c82[_0x917d('0x22')]=qs[_0x917d('0x22')](_0x44cc27['query']['offset']);}return _0x3196fa[_0x917d('0x50')](_0x2b0c82);}})[_0x917d('0x29')](function(_0x5eac48){if(_0x5eac48){return _0x5eac48?{'count':_0x2d89b,'rows':_0x5eac48}:null;}})['then'](respondWithResult(_0x43662,null))[_0x917d('0x49')](handleError(_0x43662,null));};exports[_0x917d('0x54')]=function(_0x55a166,_0x2a5a74,_0xbba56e){var _0x59bfa9={};var _0x40460e={};var _0x5e3266;var _0x154de4;return db[_0x917d('0x45')][_0x917d('0x51')]({'where':{'id':_0x55a166[_0x917d('0x4a')]['id']}})[_0x917d('0x29')](handleEntityNotFound(_0x2a5a74,null))[_0x917d('0x29')](function(_0x1fa6d4){if(_0x1fa6d4){_0x5e3266=_0x1fa6d4;_0x40460e[_0x917d('0x4b')]=_['keys'](db[_0x917d('0x52')][_0x917d('0x31')]);_0x40460e['query']=_['keys'](_0x55a166[_0x917d('0x35')]);_0x40460e[_0x917d('0x40')]=_[_0x917d('0x37')](_0x40460e[_0x917d('0x4b')],_0x40460e[_0x917d('0x35')]);_0x59bfa9[_0x917d('0x39')]=_[_0x917d('0x37')](_0x40460e['model'],qs[_0x917d('0x38')](_0x55a166['query']['fields']));_0x59bfa9[_0x917d('0x39')]=_0x59bfa9['attributes'][_0x917d('0x3a')]?_0x59bfa9['attributes']:_0x40460e[_0x917d('0x4b')];_0x59bfa9['order']=qs[_0x917d('0x3d')](_0x55a166[_0x917d('0x35')][_0x917d('0x3d')]);_0x59bfa9['where']=qs['filters'](_[_0x917d('0x3f')](_0x55a166[_0x917d('0x35')],_0x40460e['filters']));if(_0x55a166[_0x917d('0x35')][_0x917d('0x41')]){_0x59bfa9[_0x917d('0x3e')]=_[_0x917d('0x42')](_0x59bfa9['where'],{'$or':_[_0x917d('0x30')](_0x59bfa9[_0x917d('0x39')],function(_0xd0a7b3){var _0x14c929={};_0x14c929[_0xd0a7b3]={'$like':'%'+_0x55a166[_0x917d('0x35')][_0x917d('0x41')]+'%'};return _0x14c929;})});}_0x59bfa9=_['merge']({},_0x59bfa9,_0x55a166[_0x917d('0x44')]);return _0x5e3266['getSubjects'](_0x59bfa9);}})[_0x917d('0x29')](function(_0x52ea0b){if(_0x52ea0b){_0x154de4=_0x52ea0b[_0x917d('0x3a')];if(!_0x55a166[_0x917d('0x35')][_0x917d('0x3b')](_0x917d('0x53'))){_0x59bfa9['limit']=qs[_0x917d('0x20')](_0x55a166[_0x917d('0x35')][_0x917d('0x20')]);_0x59bfa9[_0x917d('0x22')]=qs[_0x917d('0x22')](_0x55a166[_0x917d('0x35')]['offset']);}return _0x5e3266[_0x917d('0x54')](_0x59bfa9);}})[_0x917d('0x29')](function(_0x2c4637){if(_0x2c4637){return _0x2c4637?{'count':_0x154de4,'rows':_0x2c4637}:null;}})[_0x917d('0x29')](respondWithResult(_0x2a5a74,null))[_0x917d('0x49')](handleError(_0x2a5a74,null));};exports[_0x917d('0x55')]=function(_0xce1e12,_0x46b29c,_0x2176f2){var _0x3fdcb5={};var _0x453a7f={};var _0x85a1f;var _0x14aa32;return db[_0x917d('0x45')][_0x917d('0x51')]({'where':{'id':_0xce1e12['params']['id']}})[_0x917d('0x29')](handleEntityNotFound(_0x46b29c,null))[_0x917d('0x29')](function(_0x347d16){if(_0x347d16){_0x85a1f=_0x347d16;_0x453a7f['model']=_[_0x917d('0x36')](db[_0x917d('0x52')][_0x917d('0x31')]);_0x453a7f[_0x917d('0x35')]=_[_0x917d('0x36')](_0xce1e12[_0x917d('0x35')]);_0x453a7f[_0x917d('0x40')]=_[_0x917d('0x37')](_0x453a7f['model'],_0x453a7f[_0x917d('0x35')]);_0x3fdcb5[_0x917d('0x39')]=_[_0x917d('0x37')](_0x453a7f[_0x917d('0x4b')],qs[_0x917d('0x38')](_0xce1e12[_0x917d('0x35')][_0x917d('0x38')]));_0x3fdcb5[_0x917d('0x39')]=_0x3fdcb5[_0x917d('0x39')][_0x917d('0x3a')]?_0x3fdcb5['attributes']:_0x453a7f[_0x917d('0x4b')];_0x3fdcb5['order']=qs[_0x917d('0x3d')](_0xce1e12['query'][_0x917d('0x3d')]);_0x3fdcb5[_0x917d('0x3e')]=qs[_0x917d('0x40')](_[_0x917d('0x3f')](_0xce1e12[_0x917d('0x35')],_0x453a7f[_0x917d('0x40')]));if(_0xce1e12[_0x917d('0x35')][_0x917d('0x41')]){_0x3fdcb5[_0x917d('0x3e')]=_[_0x917d('0x42')](_0x3fdcb5[_0x917d('0x3e')],{'$or':_[_0x917d('0x30')](_0x3fdcb5['attributes'],function(_0x4bbc7c){var _0xd44c1b={};_0xd44c1b[_0x4bbc7c]={'$like':'%'+_0xce1e12[_0x917d('0x35')][_0x917d('0x41')]+'%'};return _0xd44c1b;})});}_0x3fdcb5=_[_0x917d('0x42')]({},_0x3fdcb5,_0xce1e12['options']);return _0x85a1f[_0x917d('0x55')](_0x3fdcb5);}})[_0x917d('0x29')](function(_0x3ca0a5){if(_0x3ca0a5){_0x14aa32=_0x3ca0a5[_0x917d('0x3a')];if(!_0xce1e12[_0x917d('0x35')]['hasOwnProperty'](_0x917d('0x53'))){_0x3fdcb5['limit']=qs[_0x917d('0x20')](_0xce1e12['query'][_0x917d('0x20')]);_0x3fdcb5[_0x917d('0x22')]=qs[_0x917d('0x22')](_0xce1e12['query']['offset']);}return _0x85a1f[_0x917d('0x55')](_0x3fdcb5);}})[_0x917d('0x29')](function(_0x2c7ada){if(_0x2c7ada){return _0x2c7ada?{'count':_0x14aa32,'rows':_0x2c7ada}:null;}})['then'](respondWithResult(_0x46b29c,null))[_0x917d('0x49')](handleError(_0x46b29c,null));};exports['getTags']=function(_0x3e3019,_0x12153a,_0x1b7555){var _0x59847b={};var _0x384af0={};var _0x1f3f1a;var _0x5c6060;return db[_0x917d('0x45')][_0x917d('0x51')]({'where':{'id':_0x3e3019[_0x917d('0x4a')]['id']}})[_0x917d('0x29')](handleEntityNotFound(_0x12153a,null))['then'](function(_0x3ab155){if(_0x3ab155){_0x1f3f1a=_0x3ab155;_0x384af0[_0x917d('0x4b')]=_[_0x917d('0x36')](db[_0x917d('0x56')][_0x917d('0x31')]);_0x384af0[_0x917d('0x35')]=_[_0x917d('0x36')](_0x3e3019[_0x917d('0x35')]);_0x384af0['filters']=_[_0x917d('0x37')](_0x384af0[_0x917d('0x4b')],_0x384af0['query']);_0x59847b[_0x917d('0x39')]=_[_0x917d('0x37')](_0x384af0[_0x917d('0x4b')],qs[_0x917d('0x38')](_0x3e3019[_0x917d('0x35')][_0x917d('0x38')]));_0x59847b[_0x917d('0x39')]=_0x59847b[_0x917d('0x39')][_0x917d('0x3a')]?_0x59847b[_0x917d('0x39')]:_0x384af0[_0x917d('0x4b')];_0x59847b[_0x917d('0x3c')]=qs[_0x917d('0x3d')](_0x3e3019[_0x917d('0x35')][_0x917d('0x3d')]);_0x59847b[_0x917d('0x3e')]=qs[_0x917d('0x40')](_[_0x917d('0x3f')](_0x3e3019[_0x917d('0x35')],_0x384af0['filters']));if(_0x3e3019[_0x917d('0x35')][_0x917d('0x41')]){_0x59847b[_0x917d('0x3e')]=_[_0x917d('0x42')](_0x59847b[_0x917d('0x3e')],{'$or':_['map'](_0x59847b[_0x917d('0x39')],function(_0x583ccd){var _0x7df31={};_0x7df31[_0x583ccd]={'$like':'%'+_0x3e3019[_0x917d('0x35')]['filter']+'%'};return _0x7df31;})});}_0x59847b=_['merge']({},_0x59847b,_0x3e3019['options']);return _0x1f3f1a[_0x917d('0x57')](_0x59847b);}})[_0x917d('0x29')](function(_0x3ff69f){if(_0x3ff69f){_0x5c6060=_0x3ff69f[_0x917d('0x3a')];if(!_0x3e3019[_0x917d('0x35')][_0x917d('0x3b')](_0x917d('0x53'))){_0x59847b[_0x917d('0x20')]=qs[_0x917d('0x20')](_0x3e3019[_0x917d('0x35')][_0x917d('0x20')]);_0x59847b['offset']=qs[_0x917d('0x22')](_0x3e3019[_0x917d('0x35')]['offset']);}return _0x1f3f1a[_0x917d('0x57')](_0x59847b);}})[_0x917d('0x29')](function(_0x431bea){if(_0x431bea){return _0x431bea?{'count':_0x5c6060,'rows':_0x431bea}:null;}})['then'](respondWithResult(_0x12153a,null))[_0x917d('0x49')](handleError(_0x12153a,null));};exports[_0x917d('0x58')]=function(_0x281d68,_0x478e92,_0xd7c8a3){if(_0x281d68[_0x917d('0x4f')]['id']){delete _0x281d68[_0x917d('0x4f')]['id'];}return db[_0x917d('0x45')][_0x917d('0x51')]({'where':{'id':_0x281d68['params']['id']}})[_0x917d('0x29')](handleEntityNotFound(_0x478e92,null))[_0x917d('0x29')](function(_0xa18e5c){if(_0xa18e5c){return _0xa18e5c[_0x917d('0x58')](_0x281d68['body'][_0x917d('0x59')]||[]);}return null;})[_0x917d('0x29')](respondWithResult(_0x478e92,null))[_0x917d('0x49')](handleError(_0x478e92,null));};
\ No newline at end of file
index 2f88f77..5bf1737 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f43=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','int_desk_configurations','util','../../config/logger'];(function(_0x33123f,_0x2255c5){var _0xa33d79=function(_0xaa420){while(--_0xaa420){_0x33123f['push'](_0x33123f['shift']());}};_0xa33d79(++_0x2255c5);}(_0x5f43,0xbc));var _0x35f4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f43[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x35f4('0x0'));var logger=require(_0x35f4('0x1'))('api');var moment=require(_0x35f4('0x2'));var BPromise=require(_0x35f4('0x3'));var rp=require(_0x35f4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x35f4('0x5'));var config=require(_0x35f4('0x6'));var attributes=require('./intDeskConfiguration.attributes');module[_0x35f4('0x7')]=function(_0x29edea,_0x2d70c5){return _0x29edea[_0x35f4('0x8')]('DeskConfiguration',attributes,{'tableName':_0x35f4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4bab=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDeskConfiguration.attributes','define','DeskConfiguration','int_desk_configurations'];(function(_0xf3b435,_0x30507d){var _0x427a7b=function(_0x24b461){while(--_0x24b461){_0xf3b435['push'](_0xf3b435['shift']());}};_0x427a7b(++_0x30507d);}(_0x4bab,0x1d4));var _0xb4ba=function(_0x25f75c,_0x4d9798){_0x25f75c=_0x25f75c-0x0;var _0x4d51b1=_0x4bab[_0x25f75c];return _0x4d51b1;};'use strict';var _=require(_0xb4ba('0x0'));var util=require(_0xb4ba('0x1'));var logger=require(_0xb4ba('0x2'))(_0xb4ba('0x3'));var moment=require(_0xb4ba('0x4'));var BPromise=require(_0xb4ba('0x5'));var rp=require(_0xb4ba('0x6'));var fs=require('fs');var path=require(_0xb4ba('0x7'));var rimraf=require(_0xb4ba('0x8'));var config=require('../../config/environment');var attributes=require(_0xb4ba('0x9'));module['exports']=function(_0xa9ea74,_0x46d2a1){return _0xa9ea74[_0xb4ba('0xa')](_0xb4ba('0xb'),attributes,{'tableName':_0xb4ba('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e25ff4f..7fa0770 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97ce=['jayson/promise','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x1609ef,_0x5c7fbb){var _0x1c7ad8=function(_0x1de73b){while(--_0x1de73b){_0x1609ef['push'](_0x1609ef['shift']());}};_0x1c7ad8(++_0x5c7fbb);}(_0x97ce,0x151));var _0xe97c=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0x97ce[_0x25d386];return _0x857f4a;};'use strict';var _=require(_0xe97c('0x0'));var util=require(_0xe97c('0x1'));var moment=require(_0xe97c('0x2'));var BPromise=require(_0xe97c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe97c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe97c('0x5'));var logger=require('../../config/logger')(_0xe97c('0x6'));var config=require(_0xe97c('0x7'));var jayson=require(_0xe97c('0x8'));var client=jayson[_0xe97c('0x9')][_0xe97c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6603e0,_0x522f0a,_0x3bf4ef){return new BPromise(function(_0x9c1b00,_0x9ce6d){return client['request'](_0x6603e0,_0x3bf4ef)[_0xe97c('0xb')](function(_0x5717fb){logger[_0xe97c('0xc')](_0xe97c('0xd'),_0x522f0a,_0xe97c('0xe'));logger[_0xe97c('0xf')](_0xe97c('0x10'),_0x522f0a,_0xe97c('0xe'),JSON[_0xe97c('0x11')](_0x5717fb));if(_0x5717fb['error']){if(_0x5717fb[_0xe97c('0x12')][_0xe97c('0x13')]===0x1f4){logger[_0xe97c('0x12')](_0xe97c('0xd'),_0x522f0a,_0x5717fb[_0xe97c('0x12')][_0xe97c('0x14')]);return _0x9ce6d(_0x5717fb[_0xe97c('0x12')][_0xe97c('0x14')]);}logger[_0xe97c('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x522f0a,_0x5717fb['error'][_0xe97c('0x14')]);return _0x9c1b00(_0x5717fb['error'][_0xe97c('0x14')]);}else{logger[_0xe97c('0xc')]('DeskConfiguration,\x20%s,\x20%s',_0x522f0a,'request\x20sent');_0x9c1b00(_0x5717fb[_0xe97c('0x15')][_0xe97c('0x14')]);}})[_0xe97c('0x16')](function(_0x2e026d){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x522f0a,_0x2e026d);_0x9ce6d(_0x2e026d);});});}
\ No newline at end of file
+var _0xf3e2=['rpc','jayson/promise','client','http','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xf3e2,0x168));var _0x2f3e=function(_0x3ab8d7,_0x462b06){_0x3ab8d7=_0x3ab8d7-0x0;var _0x58092a=_0xf3e2[_0x3ab8d7];return _0x58092a;};'use strict';var _=require(_0x2f3e('0x0'));var util=require(_0x2f3e('0x1'));var moment=require(_0x2f3e('0x2'));var BPromise=require(_0x2f3e('0x3'));var rs=require(_0x2f3e('0x4'));var fs=require('fs');var Redis=require(_0x2f3e('0x5'));var db=require(_0x2f3e('0x6'))['db'];var utils=require(_0x2f3e('0x7'));var logger=require('../../config/logger')(_0x2f3e('0x8'));var config=require('../../config/environment');var jayson=require(_0x2f3e('0x9'));var client=jayson[_0x2f3e('0xa')][_0x2f3e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x392f91,_0x3b556b,_0x1ac142){return new BPromise(function(_0x30f939,_0x46ec1b){return client['request'](_0x392f91,_0x1ac142)[_0x2f3e('0xc')](function(_0x4d7f7d){logger[_0x2f3e('0xd')](_0x2f3e('0xe'),_0x3b556b,_0x2f3e('0xf'));logger[_0x2f3e('0x10')](_0x2f3e('0x11'),_0x3b556b,_0x2f3e('0xf'),JSON[_0x2f3e('0x12')](_0x4d7f7d));if(_0x4d7f7d[_0x2f3e('0x13')]){if(_0x4d7f7d[_0x2f3e('0x13')][_0x2f3e('0x14')]===0x1f4){logger[_0x2f3e('0x13')](_0x2f3e('0xe'),_0x3b556b,_0x4d7f7d['error'][_0x2f3e('0x15')]);return _0x46ec1b(_0x4d7f7d['error'][_0x2f3e('0x15')]);}logger[_0x2f3e('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x3b556b,_0x4d7f7d['error'][_0x2f3e('0x15')]);return _0x30f939(_0x4d7f7d[_0x2f3e('0x13')][_0x2f3e('0x15')]);}else{logger[_0x2f3e('0xd')](_0x2f3e('0xe'),_0x3b556b,_0x2f3e('0xf'));_0x30f939(_0x4d7f7d['result'][_0x2f3e('0x15')]);}})[_0x2f3e('0x16')](function(_0x15398d){logger[_0x2f3e('0x13')]('DeskConfiguration,\x20%s,\x20%s',_0x3b556b,_0x15398d);_0x46ec1b(_0x15398d);});});}
\ No newline at end of file
index 7257f19..40da26f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2539=['put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','post','create'];(function(_0x302e35,_0x197af1){var _0x31d5f9=function(_0x140029){while(--_0x140029){_0x302e35['push'](_0x302e35['shift']());}};_0x31d5f9(++_0x197af1);}(_0x2539,0x147));var _0x9253=function(_0xdb8e11,_0x29b21d){_0xdb8e11=_0xdb8e11-0x0;var _0x109e0f=_0x2539[_0xdb8e11];return _0x109e0f;};'use strict';var multer=require(_0x9253('0x0'));var util=require(_0x9253('0x1'));var path=require(_0x9253('0x2'));var timeout=require(_0x9253('0x3'));var express=require(_0x9253('0x4'));var router=express[_0x9253('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9253('0x6'));var interaction=require(_0x9253('0x7'));var config=require('../../config/environment');var controller=require('./intDeskField.controller');router[_0x9253('0x8')]('/',auth['isAuthenticated'](),controller[_0x9253('0x9')]);router['get'](_0x9253('0xa'),auth[_0x9253('0xb')](),controller[_0x9253('0xc')]);router[_0x9253('0xd')]('/',auth[_0x9253('0xb')](),controller[_0x9253('0xe')]);router[_0x9253('0xf')]('/:id',auth[_0x9253('0xb')](),controller[_0x9253('0x10')]);router[_0x9253('0x11')]('/:id',auth[_0x9253('0xb')](),controller['destroy']);module[_0x9253('0x12')]=router;
\ No newline at end of file
+var _0xff73=['../../components/interaction/service','./intDeskField.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x51674a,_0x77ccff){var _0x13fca6=function(_0x3d6c27){while(--_0x3d6c27){_0x51674a['push'](_0x51674a['shift']());}};_0x13fca6(++_0x77ccff);}(_0xff73,0x1d4));var _0x3ff7=function(_0x5be658,_0x35d76d){_0x5be658=_0x5be658-0x0;var _0x373777=_0xff73[_0x5be658];return _0x373777;};'use strict';var multer=require(_0x3ff7('0x0'));var util=require(_0x3ff7('0x1'));var path=require('path');var timeout=require(_0x3ff7('0x2'));var express=require(_0x3ff7('0x3'));var router=express[_0x3ff7('0x4')]();var fs_extra=require(_0x3ff7('0x5'));var auth=require(_0x3ff7('0x6'));var interaction=require(_0x3ff7('0x7'));var config=require('../../config/environment');var controller=require(_0x3ff7('0x8'));router[_0x3ff7('0x9')]('/',auth['isAuthenticated'](),controller[_0x3ff7('0xa')]);router[_0x3ff7('0x9')](_0x3ff7('0xb'),auth[_0x3ff7('0xc')](),controller[_0x3ff7('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x3ff7('0xe')]);router[_0x3ff7('0xf')](_0x3ff7('0xb'),auth['isAuthenticated'](),controller[_0x3ff7('0x10')]);router[_0x3ff7('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x3ff7('0x12')]);module['exports']=router;
\ No newline at end of file
index 513355e..4809478 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79c0=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x57645b,_0x25f73a){var _0xe82f00=function(_0x526b4){while(--_0x526b4){_0x57645b['push'](_0x57645b['shift']());}};_0xe82f00(++_0x25f73a);}(_0x79c0,0xac));var _0x079c=function(_0x361b92,_0x52bd74){_0x361b92=_0x361b92-0x0;var _0x34b36b=_0x79c0[_0x361b92];return _0x34b36b;};'use strict';var Sequelize=require(_0x079c('0x0'));module[_0x079c('0x1')]={'type':{'type':Sequelize[_0x079c('0x2')](_0x079c('0x3'),_0x079c('0x4'),_0x079c('0x5'),_0x079c('0x6'),'picklist'),'defaultValue':_0x079c('0x3')},'content':{'type':Sequelize[_0x079c('0x7')]},'key':{'type':Sequelize[_0x079c('0x7')]},'keyType':{'type':Sequelize[_0x079c('0x2')](_0x079c('0x3'),_0x079c('0x4'),_0x079c('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x079c('0x7')]},'nameField':{'type':Sequelize[_0x079c('0x7')]},'customField':{'type':Sequelize[_0x079c('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x079c('0x7')]}};
\ No newline at end of file
+var _0xe11a=['customVariable','keyValue','STRING','variable','sequelize','exports','string'];(function(_0x39497a,_0x52679e){var _0x4af35f=function(_0x587ee0){while(--_0x587ee0){_0x39497a['push'](_0x39497a['shift']());}};_0x4af35f(++_0x52679e);}(_0xe11a,0x146));var _0xae11=function(_0x295ec0,_0x45b0c7){_0x295ec0=_0x295ec0-0x0;var _0x90c6a2=_0xe11a[_0x295ec0];return _0x90c6a2;};'use strict';var Sequelize=require(_0xae11('0x0'));module[_0xae11('0x1')]={'type':{'type':Sequelize['ENUM'](_0xae11('0x2'),'variable',_0xae11('0x3'),_0xae11('0x4'),'picklist'),'defaultValue':_0xae11('0x2')},'content':{'type':Sequelize[_0xae11('0x5')]},'key':{'type':Sequelize[_0xae11('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0xae11('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0xae11('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xae11('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xae11('0x5')]}};
\ No newline at end of file
index 0d8cea0..cc78521 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8958=['create','body','params','rimraf','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','error','name','send','index','map','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','DeskField','includeAll','include','findAll','merge','find','catch'];(function(_0x15b1d3,_0x254331){var _0x31caf2=function(_0xa05e12){while(--_0xa05e12){_0x15b1d3['push'](_0x15b1d3['shift']());}};_0x31caf2(++_0x254331);}(_0x8958,0x93));var _0x8895=function(_0x37010b,_0x1d1778){_0x37010b=_0x37010b-0x0;var _0x118613=_0x8958[_0x37010b];return _0x118613;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8895('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8895('0x1'));var Mustache=require('mustache');var util=require(_0x8895('0x2'));var path=require(_0x8895('0x3'));var sox=require(_0x8895('0x4'));var csv=require('to-csv');var ejs=require(_0x8895('0x5'));var fs=require('fs');var fs_extra=require(_0x8895('0x6'));var _=require(_0x8895('0x7'));var squel=require(_0x8895('0x8'));var crypto=require(_0x8895('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x8895('0xa'));var toCsv=require(_0x8895('0xb'));var querystring=require(_0x8895('0xc'));var Papa=require(_0x8895('0xd'));var Redis=require(_0x8895('0xe'));var authService=require(_0x8895('0xf'));var qs=require(_0x8895('0x10'));var as=require(_0x8895('0x11'));var hardwareService=require(_0x8895('0x12'));var logger=require(_0x8895('0x13'))('api');var utils=require(_0x8895('0x14'));var config=require(_0x8895('0x15'));var licenseUtil=require(_0x8895('0x16'));var db=require(_0x8895('0x17'))['db'];function respondWithStatusCode(_0x446e1a,_0xaf93bc){_0xaf93bc=_0xaf93bc||0xcc;return function(_0x5af0ef){if(_0x5af0ef){return _0x446e1a[_0x8895('0x18')](_0xaf93bc);}return _0x446e1a[_0x8895('0x19')](_0xaf93bc)[_0x8895('0x1a')]();};}function respondWithResult(_0x57d40a,_0x47b9fe){_0x47b9fe=_0x47b9fe||0xc8;return function(_0x9191b8){if(_0x9191b8){return _0x57d40a['status'](_0x47b9fe)[_0x8895('0x1b')](_0x9191b8);}};}function respondWithFilteredResult(_0x337101,_0x195789){return function(_0x3d7b59){if(_0x3d7b59){var _0x2c9d40=typeof _0x195789['offset']===_0x8895('0x1c')&&typeof _0x195789[_0x8895('0x1d')]===_0x8895('0x1c');var _0xcdd661=_0x3d7b59[_0x8895('0x1e')];var _0x1b5c82=_0x2c9d40?0x0:_0x195789[_0x8895('0x1f')];var _0x26cee0=_0x2c9d40?_0x3d7b59[_0x8895('0x1e')]:_0x195789[_0x8895('0x1f')]+_0x195789[_0x8895('0x1d')];var _0x6b8a16;if(_0x26cee0>=_0xcdd661){_0x26cee0=_0xcdd661;_0x6b8a16=0xc8;}else{_0x6b8a16=0xce;}_0x337101[_0x8895('0x19')](_0x6b8a16);return _0x337101['set']('Content-Range',_0x1b5c82+'-'+_0x26cee0+'/'+_0xcdd661)['json'](_0x3d7b59);}return null;};}function patchUpdates(_0x3daf43){return function(_0x456282){try{jsonpatch[_0x8895('0x20')](_0x456282,_0x3daf43,!![]);}catch(_0x29449a){return BPromise[_0x8895('0x21')](_0x29449a);}return _0x456282[_0x8895('0x22')]();};}function saveUpdates(_0x461346,_0xc1ce17){return function(_0x5219ca){if(_0x5219ca){return _0x5219ca[_0x8895('0x23')](_0x461346)[_0x8895('0x24')](function(_0x2a403){return _0x2a403;});}return null;};}function removeEntity(_0x1f71f3,_0x29223d){return function(_0x4d092d){if(_0x4d092d){return _0x4d092d['destroy']()[_0x8895('0x24')](function(){_0x1f71f3[_0x8895('0x19')](0xcc)[_0x8895('0x1a')]();});}};}function handleEntityNotFound(_0x24a376,_0x4fc150){return function(_0x25da11){if(!_0x25da11){_0x24a376[_0x8895('0x18')](0x194);}return _0x25da11;};}function handleError(_0x187a15,_0x5486a6){_0x5486a6=_0x5486a6||0x1f4;return function(_0x4aee03){logger[_0x8895('0x25')](_0x4aee03['stack']);if(_0x4aee03[_0x8895('0x26')]){delete _0x4aee03[_0x8895('0x26')];}_0x187a15[_0x8895('0x19')](_0x5486a6)[_0x8895('0x27')](_0x4aee03);};}exports[_0x8895('0x28')]=function(_0x5c03ea,_0x4d567a){var _0x6e449d={},_0x37ac3a={},_0x3fc4cc={'count':0x0,'rows':[]};var _0x16b65b=_[_0x8895('0x29')](db['DeskField']['rawAttributes'],function(_0x46ae32){return{'name':_0x46ae32[_0x8895('0x2a')],'type':_0x46ae32[_0x8895('0x2b')][_0x8895('0x2c')]};});_0x37ac3a[_0x8895('0x2d')]=_['map'](_0x16b65b,_0x8895('0x26'));_0x37ac3a['query']=_[_0x8895('0x2e')](_0x5c03ea['query']);_0x37ac3a[_0x8895('0x2f')]=_[_0x8895('0x30')](_0x37ac3a[_0x8895('0x2d')],_0x37ac3a[_0x8895('0x31')]);_0x6e449d[_0x8895('0x32')]=_['intersection'](_0x37ac3a[_0x8895('0x2d')],qs[_0x8895('0x33')](_0x5c03ea[_0x8895('0x31')][_0x8895('0x33')]));_0x6e449d[_0x8895('0x32')]=_0x6e449d['attributes'][_0x8895('0x34')]?_0x6e449d['attributes']:_0x37ac3a[_0x8895('0x2d')];if(!_0x5c03ea['query'][_0x8895('0x35')](_0x8895('0x36'))){_0x6e449d[_0x8895('0x1d')]=qs[_0x8895('0x1d')](_0x5c03ea[_0x8895('0x31')]['limit']);_0x6e449d[_0x8895('0x1f')]=qs['offset'](_0x5c03ea[_0x8895('0x31')][_0x8895('0x1f')]);}_0x6e449d[_0x8895('0x37')]=qs[_0x8895('0x38')](_0x5c03ea[_0x8895('0x31')][_0x8895('0x38')]);_0x6e449d['where']=qs[_0x8895('0x2f')](_[_0x8895('0x39')](_0x5c03ea['query'],_0x37ac3a[_0x8895('0x2f')]),_0x16b65b);if(_0x5c03ea['query'][_0x8895('0x3a')]){_0x6e449d[_0x8895('0x3b')]=_['merge'](_0x6e449d[_0x8895('0x3b')],{'$or':_[_0x8895('0x29')](_0x16b65b,function(_0x5b7204){if(_0x5b7204['type']!==_0x8895('0x3c')){var _0xf0b378={};_0xf0b378[_0x5b7204[_0x8895('0x26')]]={'$like':'%'+_0x5c03ea[_0x8895('0x31')][_0x8895('0x3a')]+'%'};return _0xf0b378;}})});}_0x6e449d=_['merge']({},_0x6e449d,_0x5c03ea[_0x8895('0x3d')]);var _0x25c854={'where':_0x6e449d[_0x8895('0x3b')]};return db[_0x8895('0x3e')][_0x8895('0x1e')](_0x25c854)[_0x8895('0x24')](function(_0x4a7e22){_0x3fc4cc[_0x8895('0x1e')]=_0x4a7e22;if(_0x5c03ea['query'][_0x8895('0x3f')]){_0x6e449d[_0x8895('0x40')]=[{'all':!![]}];}return db['DeskField'][_0x8895('0x41')](_0x6e449d);})['then'](function(_0x1e6395){_0x3fc4cc['rows']=_0x1e6395;return _0x3fc4cc;})['then'](respondWithFilteredResult(_0x4d567a,_0x6e449d))['catch'](handleError(_0x4d567a,null));};exports['show']=function(_0x4881d0,_0x47cf10){var _0x447ed6={'raw':!![],'where':{'id':_0x4881d0['params']['id']}},_0x206f57={};_0x206f57['model']=_[_0x8895('0x2e')](db[_0x8895('0x3e')]['rawAttributes']);_0x206f57[_0x8895('0x31')]=_[_0x8895('0x2e')](_0x4881d0[_0x8895('0x31')]);_0x206f57[_0x8895('0x2f')]=_[_0x8895('0x30')](_0x206f57['model'],_0x206f57['query']);_0x447ed6['attributes']=_[_0x8895('0x30')](_0x206f57['model'],qs[_0x8895('0x33')](_0x4881d0[_0x8895('0x31')][_0x8895('0x33')]));_0x447ed6[_0x8895('0x32')]=_0x447ed6['attributes'][_0x8895('0x34')]?_0x447ed6[_0x8895('0x32')]:_0x206f57[_0x8895('0x2d')];if(_0x4881d0[_0x8895('0x31')][_0x8895('0x3f')]){_0x447ed6[_0x8895('0x40')]=[{'all':!![]}];}_0x447ed6=_[_0x8895('0x42')]({},_0x447ed6,_0x4881d0[_0x8895('0x3d')]);return db['DeskField'][_0x8895('0x43')](_0x447ed6)[_0x8895('0x24')](handleEntityNotFound(_0x47cf10,null))['then'](respondWithResult(_0x47cf10,null))[_0x8895('0x44')](handleError(_0x47cf10,null));};exports['create']=function(_0x5829ec,_0x13546d){return db[_0x8895('0x3e')][_0x8895('0x45')](_0x5829ec['body'],{})[_0x8895('0x24')](respondWithResult(_0x13546d,0xc9))['catch'](handleError(_0x13546d,null));};exports[_0x8895('0x23')]=function(_0x152197,_0xb3ecd6){if(_0x152197[_0x8895('0x46')]['id']){delete _0x152197[_0x8895('0x46')]['id'];}return db[_0x8895('0x3e')][_0x8895('0x43')]({'where':{'id':_0x152197['params']['id']}})['then'](handleEntityNotFound(_0xb3ecd6,null))[_0x8895('0x24')](saveUpdates(_0x152197[_0x8895('0x46')],null))['then'](respondWithResult(_0xb3ecd6,null))[_0x8895('0x44')](handleError(_0xb3ecd6,null));};exports['destroy']=function(_0x4e8af3,_0x2daafe){return db['DeskField'][_0x8895('0x43')]({'where':{'id':_0x4e8af3[_0x8895('0x47')]['id']}})[_0x8895('0x24')](handleEntityNotFound(_0x2daafe,null))[_0x8895('0x24')](removeEntity(_0x2daafe,null))[_0x8895('0x44')](handleError(_0x2daafe,null));};
\ No newline at end of file
+var _0x7e02=['apply','then','destroy','end','error','stack','name','map','DeskField','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','options','find','create','update','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','set'];(function(_0x52c6bf,_0x29c95b){var _0x37fea0=function(_0xb23096){while(--_0xb23096){_0x52c6bf['push'](_0x52c6bf['shift']());}};_0x37fea0(++_0x29c95b);}(_0x7e02,0x71));var _0x27e0=function(_0x1b852e,_0x185f0d){_0x1b852e=_0x1b852e-0x0;var _0x2fd5cf=_0x7e02[_0x1b852e];return _0x2fd5cf;};'use strict';var emlformat=require(_0x27e0('0x0'));var rimraf=require(_0x27e0('0x1'));var zipdir=require(_0x27e0('0x2'));var jsonpatch=require(_0x27e0('0x3'));var rp=require(_0x27e0('0x4'));var moment=require(_0x27e0('0x5'));var BPromise=require(_0x27e0('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x27e0('0x7'));var sox=require('sox');var csv=require(_0x27e0('0x8'));var ejs=require(_0x27e0('0x9'));var fs=require('fs');var fs_extra=require(_0x27e0('0xa'));var _=require(_0x27e0('0xb'));var squel=require(_0x27e0('0xc'));var crypto=require(_0x27e0('0xd'));var jsforce=require(_0x27e0('0xe'));var deskjs=require(_0x27e0('0xf'));var toCsv=require('to-csv');var querystring=require(_0x27e0('0x10'));var Papa=require('papaparse');var Redis=require(_0x27e0('0x11'));var authService=require(_0x27e0('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x27e0('0x13'));var hardwareService=require(_0x27e0('0x14'));var logger=require(_0x27e0('0x15'))(_0x27e0('0x16'));var utils=require(_0x27e0('0x17'));var config=require(_0x27e0('0x18'));var licenseUtil=require(_0x27e0('0x19'));var db=require(_0x27e0('0x1a'))['db'];function respondWithStatusCode(_0x31ef33,_0x492c65){_0x492c65=_0x492c65||0xcc;return function(_0x156bea){if(_0x156bea){return _0x31ef33[_0x27e0('0x1b')](_0x492c65);}return _0x31ef33[_0x27e0('0x1c')](_0x492c65)['end']();};}function respondWithResult(_0x39fb61,_0x3a67ab){_0x3a67ab=_0x3a67ab||0xc8;return function(_0x473128){if(_0x473128){return _0x39fb61['status'](_0x3a67ab)[_0x27e0('0x1d')](_0x473128);}};}function respondWithFilteredResult(_0x220128,_0x1f7532){return function(_0xf326e2){if(_0xf326e2){var _0x5b1b6e=typeof _0x1f7532['offset']===_0x27e0('0x1e')&&typeof _0x1f7532[_0x27e0('0x1f')]===_0x27e0('0x1e');var _0x2111e=_0xf326e2['count'];var _0x32597b=_0x5b1b6e?0x0:_0x1f7532[_0x27e0('0x20')];var _0x12a91f=_0x5b1b6e?_0xf326e2[_0x27e0('0x21')]:_0x1f7532[_0x27e0('0x20')]+_0x1f7532[_0x27e0('0x1f')];var _0x4d9edc;if(_0x12a91f>=_0x2111e){_0x12a91f=_0x2111e;_0x4d9edc=0xc8;}else{_0x4d9edc=0xce;}_0x220128[_0x27e0('0x1c')](_0x4d9edc);return _0x220128[_0x27e0('0x22')]('Content-Range',_0x32597b+'-'+_0x12a91f+'/'+_0x2111e)[_0x27e0('0x1d')](_0xf326e2);}return null;};}function patchUpdates(_0x23df66){return function(_0x32c2ff){try{jsonpatch[_0x27e0('0x23')](_0x32c2ff,_0x23df66,!![]);}catch(_0x408d95){return BPromise['reject'](_0x408d95);}return _0x32c2ff['save']();};}function saveUpdates(_0x57897e,_0x1ef3aa){return function(_0x11f4ca){if(_0x11f4ca){return _0x11f4ca['update'](_0x57897e)[_0x27e0('0x24')](function(_0xee6318){return _0xee6318;});}return null;};}function removeEntity(_0x32503e,_0x6f83ee){return function(_0xd857c2){if(_0xd857c2){return _0xd857c2[_0x27e0('0x25')]()[_0x27e0('0x24')](function(){_0x32503e[_0x27e0('0x1c')](0xcc)[_0x27e0('0x26')]();});}};}function handleEntityNotFound(_0x3068c4,_0x1e5060){return function(_0x27dc43){if(!_0x27dc43){_0x3068c4[_0x27e0('0x1b')](0x194);}return _0x27dc43;};}function handleError(_0x3d4691,_0xab503d){_0xab503d=_0xab503d||0x1f4;return function(_0x581ec9){logger[_0x27e0('0x27')](_0x581ec9[_0x27e0('0x28')]);if(_0x581ec9[_0x27e0('0x29')]){delete _0x581ec9[_0x27e0('0x29')];}_0x3d4691[_0x27e0('0x1c')](_0xab503d)['send'](_0x581ec9);};}exports['index']=function(_0x29114d,_0x3e2c4b){var _0x141c40={},_0x304fe6={},_0x57bcc1={'count':0x0,'rows':[]};var _0x4f5ea2=_[_0x27e0('0x2a')](db[_0x27e0('0x2b')]['rawAttributes'],function(_0x55d752){return{'name':_0x55d752['fieldName'],'type':_0x55d752[_0x27e0('0x2c')][_0x27e0('0x2d')]};});_0x304fe6[_0x27e0('0x2e')]=_[_0x27e0('0x2a')](_0x4f5ea2,'name');_0x304fe6[_0x27e0('0x2f')]=_[_0x27e0('0x30')](_0x29114d[_0x27e0('0x2f')]);_0x304fe6[_0x27e0('0x31')]=_[_0x27e0('0x32')](_0x304fe6[_0x27e0('0x2e')],_0x304fe6[_0x27e0('0x2f')]);_0x141c40[_0x27e0('0x33')]=_[_0x27e0('0x32')](_0x304fe6[_0x27e0('0x2e')],qs['fields'](_0x29114d[_0x27e0('0x2f')][_0x27e0('0x34')]));_0x141c40['attributes']=_0x141c40['attributes'][_0x27e0('0x35')]?_0x141c40[_0x27e0('0x33')]:_0x304fe6[_0x27e0('0x2e')];if(!_0x29114d['query'][_0x27e0('0x36')](_0x27e0('0x37'))){_0x141c40['limit']=qs[_0x27e0('0x1f')](_0x29114d[_0x27e0('0x2f')]['limit']);_0x141c40[_0x27e0('0x20')]=qs[_0x27e0('0x20')](_0x29114d['query'][_0x27e0('0x20')]);}_0x141c40[_0x27e0('0x38')]=qs['sort'](_0x29114d['query'][_0x27e0('0x39')]);_0x141c40[_0x27e0('0x3a')]=qs[_0x27e0('0x31')](_[_0x27e0('0x3b')](_0x29114d['query'],_0x304fe6[_0x27e0('0x31')]),_0x4f5ea2);if(_0x29114d['query'][_0x27e0('0x3c')]){_0x141c40[_0x27e0('0x3a')]=_[_0x27e0('0x3d')](_0x141c40['where'],{'$or':_[_0x27e0('0x2a')](_0x4f5ea2,function(_0x213540){if(_0x213540['type']!=='VIRTUAL'){var _0x2763ec={};_0x2763ec[_0x213540[_0x27e0('0x29')]]={'$like':'%'+_0x29114d[_0x27e0('0x2f')][_0x27e0('0x3c')]+'%'};return _0x2763ec;}})});}_0x141c40=_['merge']({},_0x141c40,_0x29114d['options']);var _0x5f5b65={'where':_0x141c40[_0x27e0('0x3a')]};return db[_0x27e0('0x2b')]['count'](_0x5f5b65)['then'](function(_0x4a6856){_0x57bcc1[_0x27e0('0x21')]=_0x4a6856;if(_0x29114d[_0x27e0('0x2f')][_0x27e0('0x3e')]){_0x141c40[_0x27e0('0x3f')]=[{'all':!![]}];}return db[_0x27e0('0x2b')][_0x27e0('0x40')](_0x141c40);})[_0x27e0('0x24')](function(_0x3f81ba){_0x57bcc1[_0x27e0('0x41')]=_0x3f81ba;return _0x57bcc1;})[_0x27e0('0x24')](respondWithFilteredResult(_0x3e2c4b,_0x141c40))[_0x27e0('0x42')](handleError(_0x3e2c4b,null));};exports[_0x27e0('0x43')]=function(_0x4227c0,_0x6c37db){var _0x2f6005={'raw':!![],'where':{'id':_0x4227c0['params']['id']}},_0x535260={};_0x535260[_0x27e0('0x2e')]=_[_0x27e0('0x30')](db['DeskField']['rawAttributes']);_0x535260['query']=_[_0x27e0('0x30')](_0x4227c0[_0x27e0('0x2f')]);_0x535260['filters']=_['intersection'](_0x535260[_0x27e0('0x2e')],_0x535260[_0x27e0('0x2f')]);_0x2f6005[_0x27e0('0x33')]=_[_0x27e0('0x32')](_0x535260[_0x27e0('0x2e')],qs[_0x27e0('0x34')](_0x4227c0[_0x27e0('0x2f')][_0x27e0('0x34')]));_0x2f6005[_0x27e0('0x33')]=_0x2f6005[_0x27e0('0x33')][_0x27e0('0x35')]?_0x2f6005[_0x27e0('0x33')]:_0x535260[_0x27e0('0x2e')];if(_0x4227c0[_0x27e0('0x2f')][_0x27e0('0x3e')]){_0x2f6005[_0x27e0('0x3f')]=[{'all':!![]}];}_0x2f6005=_[_0x27e0('0x3d')]({},_0x2f6005,_0x4227c0[_0x27e0('0x44')]);return db[_0x27e0('0x2b')][_0x27e0('0x45')](_0x2f6005)[_0x27e0('0x24')](handleEntityNotFound(_0x6c37db,null))[_0x27e0('0x24')](respondWithResult(_0x6c37db,null))[_0x27e0('0x42')](handleError(_0x6c37db,null));};exports[_0x27e0('0x46')]=function(_0x24058f,_0x22cd05){return db[_0x27e0('0x2b')][_0x27e0('0x46')](_0x24058f['body'],{})['then'](respondWithResult(_0x22cd05,0xc9))[_0x27e0('0x42')](handleError(_0x22cd05,null));};exports[_0x27e0('0x47')]=function(_0x5322c9,_0x58aef9){if(_0x5322c9[_0x27e0('0x48')]['id']){delete _0x5322c9[_0x27e0('0x48')]['id'];}return db[_0x27e0('0x2b')][_0x27e0('0x45')]({'where':{'id':_0x5322c9[_0x27e0('0x49')]['id']}})[_0x27e0('0x24')](handleEntityNotFound(_0x58aef9,null))[_0x27e0('0x24')](saveUpdates(_0x5322c9['body'],null))['then'](respondWithResult(_0x58aef9,null))[_0x27e0('0x42')](handleError(_0x58aef9,null));};exports[_0x27e0('0x25')]=function(_0xca08c,_0x29241d){return db[_0x27e0('0x2b')][_0x27e0('0x45')]({'where':{'id':_0xca08c['params']['id']}})['then'](handleEntityNotFound(_0x29241d,null))[_0x27e0('0x24')](removeEntity(_0x29241d,null))[_0x27e0('0x42')](handleError(_0x29241d,null));};
\ No newline at end of file
index 926ac30..e9c0e45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd89=['int_desk_fields','desk_unique_index','idField','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intDeskField.attributes','exports','define','DeskField'];(function(_0x729b6e,_0x27ec6d){var _0x3475f1=function(_0x1afc76){while(--_0x1afc76){_0x729b6e['push'](_0x729b6e['shift']());}};_0x3475f1(++_0x27ec6d);}(_0xbd89,0x13e));var _0x9bd8=function(_0x2b11f9,_0x55a82b){_0x2b11f9=_0x2b11f9-0x0;var _0x44def1=_0xbd89[_0x2b11f9];return _0x44def1;};'use strict';var _=require('lodash');var util=require(_0x9bd8('0x0'));var logger=require(_0x9bd8('0x1'))(_0x9bd8('0x2'));var moment=require(_0x9bd8('0x3'));var BPromise=require(_0x9bd8('0x4'));var rp=require(_0x9bd8('0x5'));var fs=require('fs');var path=require(_0x9bd8('0x6'));var rimraf=require(_0x9bd8('0x7'));var config=require('../../config/environment');var attributes=require(_0x9bd8('0x8'));module[_0x9bd8('0x9')]=function(_0x37d137,_0x5547be){return _0x37d137[_0x9bd8('0xa')](_0x9bd8('0xb'),attributes,{'tableName':_0x9bd8('0xc'),'paranoid':![],'indexes':[{'name':_0x9bd8('0xd'),'fields':[_0x9bd8('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3240=['DeskField','desk_unique_index','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intDeskField.attributes','exports'];(function(_0x429717,_0x26e1c0){var _0x588155=function(_0x4c547d){while(--_0x4c547d){_0x429717['push'](_0x429717['shift']());}};_0x588155(++_0x26e1c0);}(_0x3240,0xfa));var _0x0324=function(_0x2589f2,_0x2c1515){_0x2589f2=_0x2589f2-0x0;var _0x3c8cc7=_0x3240[_0x2589f2];return _0x3c8cc7;};'use strict';var _=require(_0x0324('0x0'));var util=require(_0x0324('0x1'));var logger=require(_0x0324('0x2'))(_0x0324('0x3'));var moment=require(_0x0324('0x4'));var BPromise=require(_0x0324('0x5'));var rp=require(_0x0324('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0324('0x7'));var config=require('../../config/environment');var attributes=require(_0x0324('0x8'));module[_0x0324('0x9')]=function(_0x1af4c9,_0x4f0a6f){return _0x1af4c9['define'](_0x0324('0xa'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0x0324('0xb'),'fields':['idField',_0x0324('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 60898df..0712c85 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff92=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0xff92,0x154));var _0x2ff9=function(_0xe2a4aa,_0x14fce2){_0xe2a4aa=_0xe2a4aa-0x0;var _0x51d232=_0xff92[_0xe2a4aa];return _0x51d232;};'use strict';var _=require('lodash');var util=require(_0x2ff9('0x0'));var moment=require(_0x2ff9('0x1'));var BPromise=require(_0x2ff9('0x2'));var rs=require(_0x2ff9('0x3'));var fs=require('fs');var Redis=require(_0x2ff9('0x4'));var db=require(_0x2ff9('0x5'))['db'];var utils=require(_0x2ff9('0x6'));var logger=require('../../config/logger')(_0x2ff9('0x7'));var config=require(_0x2ff9('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2ff9('0x9')][_0x2ff9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a3b16,_0x25d310,_0x153f1e){return new BPromise(function(_0x5bf2fc,_0x545e87){return client[_0x2ff9('0xb')](_0x1a3b16,_0x153f1e)[_0x2ff9('0xc')](function(_0xbd6ba6){logger[_0x2ff9('0xd')](_0x2ff9('0xe'),_0x25d310,_0x2ff9('0xf'));logger[_0x2ff9('0x10')](_0x2ff9('0x11'),_0x25d310,_0x2ff9('0xf'),JSON[_0x2ff9('0x12')](_0xbd6ba6));if(_0xbd6ba6[_0x2ff9('0x13')]){if(_0xbd6ba6[_0x2ff9('0x13')]['code']===0x1f4){logger['error'](_0x2ff9('0xe'),_0x25d310,_0xbd6ba6[_0x2ff9('0x13')][_0x2ff9('0x14')]);return _0x545e87(_0xbd6ba6[_0x2ff9('0x13')][_0x2ff9('0x14')]);}logger[_0x2ff9('0x13')](_0x2ff9('0xe'),_0x25d310,_0xbd6ba6['error'][_0x2ff9('0x14')]);return _0x5bf2fc(_0xbd6ba6[_0x2ff9('0x13')][_0x2ff9('0x14')]);}else{logger[_0x2ff9('0xd')]('DeskField,\x20%s,\x20%s',_0x25d310,'request\x20sent');_0x5bf2fc(_0xbd6ba6[_0x2ff9('0x15')][_0x2ff9('0x14')]);}})[_0x2ff9('0x16')](function(_0x116364){logger[_0x2ff9('0x13')](_0x2ff9('0xe'),_0x25d310,_0x116364);_0x545e87(_0x116364);});});}
\ No newline at end of file
+var _0xc045=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','debug','DeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','DeskField,\x20%s,\x20%s','message','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x26ff95,_0x3c45ed){var _0x1a1fc3=function(_0x2be024){while(--_0x2be024){_0x26ff95['push'](_0x26ff95['shift']());}};_0x1a1fc3(++_0x3c45ed);}(_0xc045,0xb3));var _0x5c04=function(_0x5e5658,_0x5ceb37){_0x5e5658=_0x5e5658-0x0;var _0x501ff8=_0xc045[_0x5e5658];return _0x501ff8;};'use strict';var _=require(_0x5c04('0x0'));var util=require('util');var moment=require(_0x5c04('0x1'));var BPromise=require(_0x5c04('0x2'));var rs=require(_0x5c04('0x3'));var fs=require('fs');var Redis=require(_0x5c04('0x4'));var db=require(_0x5c04('0x5'))['db'];var utils=require(_0x5c04('0x6'));var logger=require(_0x5c04('0x7'))(_0x5c04('0x8'));var config=require('../../config/environment');var jayson=require(_0x5c04('0x9'));var client=jayson[_0x5c04('0xa')][_0x5c04('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x527dd9,_0x51e2e5,_0xf3bc47){return new BPromise(function(_0x2d0aaa,_0x239f81){return client[_0x5c04('0xc')](_0x527dd9,_0xf3bc47)[_0x5c04('0xd')](function(_0x4fc297){logger[_0x5c04('0xe')]('DeskField,\x20%s,\x20%s',_0x51e2e5,'request\x20sent');logger[_0x5c04('0xf')](_0x5c04('0x10'),_0x51e2e5,_0x5c04('0x11'),JSON[_0x5c04('0x12')](_0x4fc297));if(_0x4fc297['error']){if(_0x4fc297[_0x5c04('0x13')][_0x5c04('0x14')]===0x1f4){logger[_0x5c04('0x13')](_0x5c04('0x15'),_0x51e2e5,_0x4fc297[_0x5c04('0x13')][_0x5c04('0x16')]);return _0x239f81(_0x4fc297[_0x5c04('0x13')][_0x5c04('0x16')]);}logger[_0x5c04('0x13')]('DeskField,\x20%s,\x20%s',_0x51e2e5,_0x4fc297[_0x5c04('0x13')][_0x5c04('0x16')]);return _0x2d0aaa(_0x4fc297[_0x5c04('0x13')]['message']);}else{logger[_0x5c04('0xe')](_0x5c04('0x15'),_0x51e2e5,_0x5c04('0x11'));_0x2d0aaa(_0x4fc297['result'][_0x5c04('0x16')]);}})['catch'](function(_0x1bb830){logger[_0x5c04('0x13')](_0x5c04('0x15'),_0x51e2e5,_0x1bb830);_0x239f81(_0x1bb830);});});}
\ No newline at end of file
index dc75826..276fe93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3377=['../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x566dd5,_0x491250){var _0x184612=function(_0xe8a501){while(--_0xe8a501){_0x566dd5['push'](_0x566dd5['shift']());}};_0x184612(++_0x491250);}(_0x3377,0x1c4));var _0x7337=function(_0x59c8b1,_0x35894c){_0x59c8b1=_0x59c8b1-0x0;var _0x442e8e=_0x3377[_0x59c8b1];return _0x442e8e;};'use strict';var multer=require(_0x7337('0x0'));var util=require(_0x7337('0x1'));var path=require(_0x7337('0x2'));var timeout=require(_0x7337('0x3'));var express=require(_0x7337('0x4'));var router=express[_0x7337('0x5')]();var fs_extra=require(_0x7337('0x6'));var auth=require(_0x7337('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7337('0x8'));var controller=require('./intDynamics365Account.controller');router[_0x7337('0x9')]('/',auth[_0x7337('0xa')](),controller[_0x7337('0xb')]);router[_0x7337('0x9')](_0x7337('0xc'),auth[_0x7337('0xa')](),controller['show']);router[_0x7337('0x9')](_0x7337('0xd'),auth[_0x7337('0xa')](),controller[_0x7337('0xe')]);router[_0x7337('0x9')](_0x7337('0xf'),auth[_0x7337('0xa')](),controller[_0x7337('0x10')]);router[_0x7337('0x11')]('/',auth[_0x7337('0xa')](),controller[_0x7337('0x12')]);router[_0x7337('0x11')](_0x7337('0xd'),auth['isAuthenticated'](),controller[_0x7337('0x13')]);router[_0x7337('0x14')](_0x7337('0xc'),auth[_0x7337('0xa')](),controller[_0x7337('0x15')]);router[_0x7337('0x16')](_0x7337('0xc'),auth[_0x7337('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x8b63=['isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x5c3532,_0x4b7e0d){var _0x5196c2=function(_0x12cc1e){while(--_0x12cc1e){_0x5c3532['push'](_0x5c3532['shift']());}};_0x5196c2(++_0x4b7e0d);}(_0x8b63,0x194));var _0x38b6=function(_0x38d540,_0x8719f4){_0x38d540=_0x38d540-0x0;var _0x3a9d15=_0x8b63[_0x38d540];return _0x3a9d15;};'use strict';var multer=require(_0x38b6('0x0'));var util=require(_0x38b6('0x1'));var path=require(_0x38b6('0x2'));var timeout=require(_0x38b6('0x3'));var express=require('express');var router=express[_0x38b6('0x4')]();var fs_extra=require(_0x38b6('0x5'));var auth=require(_0x38b6('0x6'));var interaction=require(_0x38b6('0x7'));var config=require(_0x38b6('0x8'));var controller=require('./intDynamics365Account.controller');router[_0x38b6('0x9')]('/',auth[_0x38b6('0xa')](),controller[_0x38b6('0xb')]);router['get'](_0x38b6('0xc'),auth[_0x38b6('0xa')](),controller[_0x38b6('0xd')]);router[_0x38b6('0x9')](_0x38b6('0xe'),auth[_0x38b6('0xa')](),controller['getConfigurations']);router['get'](_0x38b6('0xf'),auth[_0x38b6('0xa')](),controller[_0x38b6('0x10')]);router[_0x38b6('0x11')]('/',auth[_0x38b6('0xa')](),controller['create']);router['post'](_0x38b6('0xe'),auth[_0x38b6('0xa')](),controller[_0x38b6('0x12')]);router[_0x38b6('0x13')]('/:id',auth[_0x38b6('0xa')](),controller[_0x38b6('0x14')]);router['delete'](_0x38b6('0xc'),auth[_0x38b6('0xa')](),controller[_0x38b6('0x15')]);module[_0x38b6('0x16')]=router;
\ No newline at end of file
index 73c3318..84297b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3f3=['sequelize','STRING'];(function(_0x339057,_0x4bf133){var _0x41da7c=function(_0x1c97b0){while(--_0x1c97b0){_0x339057['push'](_0x339057['shift']());}};_0x41da7c(++_0x4bf133);}(_0xd3f3,0xf0));var _0x3d3f=function(_0xf6fc32,_0x175c5e){_0xf6fc32=_0xf6fc32-0x0;var _0x32a988=_0xd3f3[_0xf6fc32];return _0x32a988;};'use strict';var Sequelize=require(_0x3d3f('0x0'));module['exports']={'name':{'type':Sequelize[_0x3d3f('0x1')]},'username':{'type':Sequelize[_0x3d3f('0x1')]},'password':{'type':Sequelize[_0x3d3f('0x1')]},'remoteUri':{'type':Sequelize[_0x3d3f('0x1')]},'tenantId':{'type':Sequelize[_0x3d3f('0x1')]},'clientId':{'type':Sequelize[_0x3d3f('0x1')]},'clientSecret':{'type':Sequelize[_0x3d3f('0x1')]},'serverUrl':{'type':Sequelize[_0x3d3f('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x9067=['exports','STRING','sequelize'];(function(_0xadde88,_0x58ad47){var _0x3b8eb6=function(_0x15535a){while(--_0x15535a){_0xadde88['push'](_0xadde88['shift']());}};_0x3b8eb6(++_0x58ad47);}(_0x9067,0x149));var _0x7906=function(_0x2f75f9,_0x1d592f){_0x2f75f9=_0x2f75f9-0x0;var _0x1f0ce0=_0x9067[_0x2f75f9];return _0x1f0ce0;};'use strict';var Sequelize=require(_0x7906('0x0'));module[_0x7906('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x7906('0x2')]},'password':{'type':Sequelize[_0x7906('0x2')]},'remoteUri':{'type':Sequelize[_0x7906('0x2')]},'tenantId':{'type':Sequelize[_0x7906('0x2')]},'clientId':{'type':Sequelize[_0x7906('0x2')]},'clientSecret':{'type':Sequelize[_0x7906('0x2')]},'serverUrl':{'type':Sequelize[_0x7906('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7906('0x2')]}};
\ No newline at end of file
index 48c630e..5cf7b10 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x581a=['contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidyominame','slainvokedidname','slaname','statecode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','username','remoteUri','clientId','clientSecret','slice','substring','format','%s/api/data/v9.0/','https://login.microsoftonline.com/','/oauth2/token','password','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','EntityDefinitions(','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','MetadataId','all','StringAttributeMetadata','DoubleAttributeMetadata','StatusAttributeMetadata','error','test','Wrong\x20credentials','statusCode',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','Value','DisplayName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','Dynamics365Account','include','rows','params','includeAll','find','catch','create','body','update','getConfigurations','Dynamics365Configuration','options','nolimit','addConfiguration','findOne','AccountId','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Field','Subjects','getFields','incident','Incident','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','accountidname','actualserviceunits','billedserviceunits','contactidname'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x581a,0x127));var _0xa581=function(_0x5cc1c8,_0xe5fa61){_0x5cc1c8=_0x5cc1c8-0x0;var _0xc2647b=_0x581a[_0x5cc1c8];return _0xc2647b;};'use strict';var emlformat=require(_0xa581('0x0'));var rimraf=require(_0xa581('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa581('0x2'));var rp=require(_0xa581('0x3'));var moment=require(_0xa581('0x4'));var BPromise=require(_0xa581('0x5'));var Mustache=require(_0xa581('0x6'));var util=require('util');var path=require('path');var sox=require(_0xa581('0x7'));var csv=require('to-csv');var ejs=require(_0xa581('0x8'));var fs=require('fs');var fs_extra=require(_0xa581('0x9'));var _=require(_0xa581('0xa'));var squel=require(_0xa581('0xb'));var crypto=require(_0xa581('0xc'));var jsforce=require(_0xa581('0xd'));var deskjs=require(_0xa581('0xe'));var toCsv=require(_0xa581('0xf'));var querystring=require(_0xa581('0x10'));var Papa=require(_0xa581('0x11'));var Redis=require(_0xa581('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa581('0x13'));var as=require(_0xa581('0x14'));var hardwareService=require(_0xa581('0x15'));var logger=require(_0xa581('0x16'))(_0xa581('0x17'));var utils=require(_0xa581('0x18'));var config=require(_0xa581('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa581('0x1a'))['db'];var integrations=require(_0xa581('0x1b'));function respondWithStatusCode(_0x2068f6,_0x21f0e2){_0x21f0e2=_0x21f0e2||0xcc;return function(_0x202296){if(_0x202296){return _0x2068f6['sendStatus'](_0x21f0e2);}return _0x2068f6[_0xa581('0x1c')](_0x21f0e2)[_0xa581('0x1d')]();};}function respondWithResult(_0x23b205,_0x3ba90d){_0x3ba90d=_0x3ba90d||0xc8;return function(_0x499c08){if(_0x499c08){return _0x23b205['status'](_0x3ba90d)[_0xa581('0x1e')](_0x499c08);}};}function respondWithFilteredResult(_0x27bf02,_0xf12782){return function(_0x35669d){if(_0x35669d){var _0xf6f762=typeof _0xf12782['offset']===_0xa581('0x1f')&&typeof _0xf12782[_0xa581('0x20')]===_0xa581('0x1f');var _0x100ebe=_0x35669d[_0xa581('0x21')];var _0x1484b1=_0xf6f762?0x0:_0xf12782['offset'];var _0x48a44b=_0xf6f762?_0x35669d[_0xa581('0x21')]:_0xf12782[_0xa581('0x22')]+_0xf12782[_0xa581('0x20')];var _0x5dad6c;if(_0x48a44b>=_0x100ebe){_0x48a44b=_0x100ebe;_0x5dad6c=0xc8;}else{_0x5dad6c=0xce;}_0x27bf02[_0xa581('0x1c')](_0x5dad6c);return _0x27bf02[_0xa581('0x23')](_0xa581('0x24'),_0x1484b1+'-'+_0x48a44b+'/'+_0x100ebe)[_0xa581('0x1e')](_0x35669d);}return null;};}function patchUpdates(_0x3dcc72){return function(_0x25d205){try{jsonpatch[_0xa581('0x25')](_0x25d205,_0x3dcc72,!![]);}catch(_0x1b0a88){return BPromise[_0xa581('0x26')](_0x1b0a88);}return _0x25d205[_0xa581('0x27')]();};}function saveUpdates(_0xa746ab,_0x4706d0){return function(_0x231ce2){if(_0x231ce2){return _0x231ce2['update'](_0xa746ab)[_0xa581('0x28')](function(_0x44fa06){return _0x44fa06;});}return null;};}function removeEntity(_0x32bdaa,_0x1f05b1){return function(_0x460d1e){if(_0x460d1e){return _0x460d1e[_0xa581('0x29')]()[_0xa581('0x28')](function(){_0x32bdaa[_0xa581('0x1c')](0xcc)[_0xa581('0x1d')]();});}};}function handleEntityNotFound(_0x5c15fe,_0x24c8cc){return function(_0x127a4b){if(!_0x127a4b){_0x5c15fe[_0xa581('0x2a')](0x194);}return _0x127a4b;};}function handleError(_0x31e377,_0x36ba28){_0x36ba28=_0x36ba28||0x1f4;return function(_0x1f52ec){logger['error'](_0x1f52ec[_0xa581('0x2b')]);if(_0x1f52ec[_0xa581('0x2c')]){delete _0x1f52ec[_0xa581('0x2c')];}_0x31e377['status'](_0x36ba28)[_0xa581('0x2d')](_0x1f52ec);};}exports[_0xa581('0x2e')]=function(_0xf8c669,_0x213eb5){var _0x40352f={},_0x595bf1={},_0x46243b={'count':0x0,'rows':[]};var _0x590a36=_[_0xa581('0x2f')](db['Dynamics365Account'][_0xa581('0x30')],function(_0x292aaf){return{'name':_0x292aaf[_0xa581('0x31')],'type':_0x292aaf[_0xa581('0x32')]['key']};});_0x595bf1[_0xa581('0x33')]=_[_0xa581('0x2f')](_0x590a36,_0xa581('0x2c'));_0x595bf1['query']=_[_0xa581('0x34')](_0xf8c669[_0xa581('0x35')]);_0x595bf1[_0xa581('0x36')]=_[_0xa581('0x37')](_0x595bf1[_0xa581('0x33')],_0x595bf1['query']);_0x40352f[_0xa581('0x38')]=_[_0xa581('0x37')](_0x595bf1[_0xa581('0x33')],qs[_0xa581('0x39')](_0xf8c669[_0xa581('0x35')][_0xa581('0x39')]));_0x40352f[_0xa581('0x38')]=_0x40352f[_0xa581('0x38')][_0xa581('0x3a')]?_0x40352f['attributes']:_0x595bf1[_0xa581('0x33')];if(!_0xf8c669[_0xa581('0x35')][_0xa581('0x3b')]('nolimit')){_0x40352f['limit']=qs[_0xa581('0x20')](_0xf8c669[_0xa581('0x35')]['limit']);_0x40352f['offset']=qs[_0xa581('0x22')](_0xf8c669[_0xa581('0x35')]['offset']);}_0x40352f[_0xa581('0x3c')]=qs[_0xa581('0x3d')](_0xf8c669[_0xa581('0x35')]['sort']);_0x40352f['where']=qs[_0xa581('0x36')](_[_0xa581('0x3e')](_0xf8c669[_0xa581('0x35')],_0x595bf1[_0xa581('0x36')]),_0x590a36);if(_0xf8c669[_0xa581('0x35')][_0xa581('0x3f')]){_0x40352f[_0xa581('0x40')]=_[_0xa581('0x41')](_0x40352f[_0xa581('0x40')],{'$or':_[_0xa581('0x2f')](_0x590a36,function(_0x124f71){if(_0x124f71[_0xa581('0x32')]!=='VIRTUAL'){var _0x93c996={};_0x93c996[_0x124f71[_0xa581('0x2c')]]={'$like':'%'+_0xf8c669[_0xa581('0x35')][_0xa581('0x3f')]+'%'};return _0x93c996;}})});}_0x40352f=_[_0xa581('0x41')]({},_0x40352f,_0xf8c669['options']);var _0x5a1f40={'where':_0x40352f[_0xa581('0x40')]};return db[_0xa581('0x42')][_0xa581('0x21')](_0x5a1f40)[_0xa581('0x28')](function(_0x350aca){_0x46243b['count']=_0x350aca;if(_0xf8c669[_0xa581('0x35')]['includeAll']){_0x40352f[_0xa581('0x43')]=[{'all':!![]}];}return db['Dynamics365Account']['findAll'](_0x40352f);})[_0xa581('0x28')](function(_0x162ecb){_0x46243b[_0xa581('0x44')]=_0x162ecb;return _0x46243b;})[_0xa581('0x28')](respondWithFilteredResult(_0x213eb5,_0x40352f))['catch'](handleError(_0x213eb5,null));};exports['show']=function(_0x538248,_0x14d6d8){var _0x3cefe4={'raw':![],'where':{'id':_0x538248[_0xa581('0x45')]['id']}},_0x581329={};_0x581329[_0xa581('0x33')]=_[_0xa581('0x34')](db[_0xa581('0x42')]['rawAttributes']);_0x581329[_0xa581('0x35')]=_[_0xa581('0x34')](_0x538248[_0xa581('0x35')]);_0x581329[_0xa581('0x36')]=_[_0xa581('0x37')](_0x581329['model'],_0x581329[_0xa581('0x35')]);_0x3cefe4[_0xa581('0x38')]=_[_0xa581('0x37')](_0x581329[_0xa581('0x33')],qs['fields'](_0x538248['query'][_0xa581('0x39')]));_0x3cefe4['attributes']=_0x3cefe4[_0xa581('0x38')]['length']?_0x3cefe4['attributes']:_0x581329[_0xa581('0x33')];if(_0x538248[_0xa581('0x35')][_0xa581('0x46')]){_0x3cefe4[_0xa581('0x43')]=[{'all':!![]}];}_0x3cefe4=_['merge']({},_0x3cefe4,_0x538248['options']);return db[_0xa581('0x42')][_0xa581('0x47')](_0x3cefe4)[_0xa581('0x28')](handleEntityNotFound(_0x14d6d8,null))[_0xa581('0x28')](respondWithResult(_0x14d6d8,null))[_0xa581('0x48')](handleError(_0x14d6d8,null));};exports[_0xa581('0x49')]=function(_0x101d52,_0xfe0629){return db['Dynamics365Account'][_0xa581('0x49')](_0x101d52[_0xa581('0x4a')],{})['then'](respondWithResult(_0xfe0629,0xc9))[_0xa581('0x48')](handleError(_0xfe0629,null));};exports[_0xa581('0x4b')]=function(_0x4940b7,_0x3c5276){if(_0x4940b7[_0xa581('0x4a')]['id']){delete _0x4940b7['body']['id'];}return db[_0xa581('0x42')]['find']({'where':{'id':_0x4940b7[_0xa581('0x45')]['id']}})[_0xa581('0x28')](handleEntityNotFound(_0x3c5276,null))[_0xa581('0x28')](saveUpdates(_0x4940b7[_0xa581('0x4a')],null))[_0xa581('0x28')](respondWithResult(_0x3c5276,null))[_0xa581('0x48')](handleError(_0x3c5276,null));};exports[_0xa581('0x29')]=function(_0x4dac09,_0x291cee){return db[_0xa581('0x42')]['find']({'where':{'id':_0x4dac09[_0xa581('0x45')]['id']}})['then'](handleEntityNotFound(_0x291cee,null))[_0xa581('0x28')](removeEntity(_0x291cee,null))[_0xa581('0x48')](handleError(_0x291cee,null));};exports[_0xa581('0x4c')]=function(_0x108cf4,_0x1d8379,_0x8c78f4){var _0x238b33={};var _0x5ab30a={};var _0x406751;var _0x4453a6;return db[_0xa581('0x42')]['findOne']({'where':{'id':_0x108cf4[_0xa581('0x45')]['id']}})[_0xa581('0x28')](handleEntityNotFound(_0x1d8379,null))[_0xa581('0x28')](function(_0x35c2a5){if(_0x35c2a5){_0x406751=_0x35c2a5;_0x5ab30a[_0xa581('0x33')]=_[_0xa581('0x34')](db[_0xa581('0x4d')]['rawAttributes']);_0x5ab30a[_0xa581('0x35')]=_[_0xa581('0x34')](_0x108cf4[_0xa581('0x35')]);_0x5ab30a[_0xa581('0x36')]=_[_0xa581('0x37')](_0x5ab30a[_0xa581('0x33')],_0x5ab30a[_0xa581('0x35')]);_0x238b33[_0xa581('0x38')]=_[_0xa581('0x37')](_0x5ab30a[_0xa581('0x33')],qs[_0xa581('0x39')](_0x108cf4['query'][_0xa581('0x39')]));_0x238b33[_0xa581('0x38')]=_0x238b33[_0xa581('0x38')][_0xa581('0x3a')]?_0x238b33['attributes']:_0x5ab30a[_0xa581('0x33')];_0x238b33['order']=qs[_0xa581('0x3d')](_0x108cf4[_0xa581('0x35')][_0xa581('0x3d')]);_0x238b33[_0xa581('0x40')]=qs[_0xa581('0x36')](_[_0xa581('0x3e')](_0x108cf4[_0xa581('0x35')],_0x5ab30a[_0xa581('0x36')]));if(_0x108cf4[_0xa581('0x35')]['filter']){_0x238b33[_0xa581('0x40')]=_[_0xa581('0x41')](_0x238b33[_0xa581('0x40')],{'$or':_[_0xa581('0x2f')](_0x238b33[_0xa581('0x38')],function(_0x462150){var _0x24477c={};_0x24477c[_0x462150]={'$like':'%'+_0x108cf4['query'][_0xa581('0x3f')]+'%'};return _0x24477c;})});}_0x238b33=_['merge']({},_0x238b33,_0x108cf4[_0xa581('0x4e')]);return _0x406751[_0xa581('0x4c')](_0x238b33);}})[_0xa581('0x28')](function(_0x3b07ba){if(_0x3b07ba){_0x4453a6=_0x3b07ba[_0xa581('0x3a')];if(!_0x108cf4[_0xa581('0x35')][_0xa581('0x3b')](_0xa581('0x4f'))){_0x238b33[_0xa581('0x20')]=qs[_0xa581('0x20')](_0x108cf4[_0xa581('0x35')][_0xa581('0x20')]);_0x238b33[_0xa581('0x22')]=qs['offset'](_0x108cf4[_0xa581('0x35')][_0xa581('0x22')]);}return _0x406751[_0xa581('0x4c')](_0x238b33);}})['then'](function(_0x11549b){if(_0x11549b){return _0x11549b?{'count':_0x4453a6,'rows':_0x11549b}:null;}})[_0xa581('0x28')](respondWithResult(_0x1d8379,null))['catch'](handleError(_0x1d8379,null));};exports[_0xa581('0x50')]=function(_0x346fa3,_0x1ce62a,_0x1e33ca){if(_0x346fa3[_0xa581('0x4a')]['id']){delete _0x346fa3[_0xa581('0x4a')]['id'];}return db[_0xa581('0x42')][_0xa581('0x51')]({'where':{'id':_0x346fa3[_0xa581('0x45')]['id']}})[_0xa581('0x28')](handleEntityNotFound(_0x1ce62a,null))[_0xa581('0x28')](function(_0x5a3b50){if(_0x5a3b50){_0x346fa3[_0xa581('0x4a')][_0xa581('0x52')]=_0x5a3b50['id'];_0x346fa3['body']['Subjects']=integrations[_0xa581('0x53')](_0x346fa3[_0xa581('0x4a')]['channel'],_0x346fa3['body'][_0xa581('0x32')]);_0x346fa3[_0xa581('0x4a')][_0xa581('0x54')]=integrations[_0xa581('0x55')](_0x346fa3[_0xa581('0x4a')][_0xa581('0x56')],_0x346fa3[_0xa581('0x4a')][_0xa581('0x32')]);return db[_0xa581('0x4d')][_0xa581('0x49')](_0x346fa3[_0xa581('0x4a')],{'include':[{'model':db[_0xa581('0x57')],'as':_0xa581('0x58')},{'model':db[_0xa581('0x57')],'as':_0xa581('0x54')}]});}return null;})[_0xa581('0x28')](respondWithResult(_0x1ce62a,null))['catch'](handleError(_0x1ce62a,null));};exports[_0xa581('0x59')]=function(_0x32b4f2,_0x140fd3,_0x28754a){var _0x30c7df=_0x32b4f2[_0xa581('0x35')]['ticketType'];var _0x5d0fd2=_0x30c7df===_0xa581('0x5a')?_0xa581('0x5b'):'PhoneCall';var _0x1a4932='';var _0x503700='';var _0x99b897='';var _0x25aa6e='';var _0x2e256e='';var _0x33cc02='';var _0x7516e='';var _0x3482c7='';var _0x1943b6=[_0xa581('0x5c'),_0xa581('0x5d'),_0xa581('0x5e'),_0xa581('0x5f'),_0xa581('0x60'),_0xa581('0x61'),_0xa581('0x62'),_0xa581('0x63'),_0xa581('0x64'),'phonecall_activity_parties'];var _0x1fa56=[_0xa581('0x65'),'accountidyominame',_0xa581('0x66'),_0xa581('0x67'),_0xa581('0x68'),_0xa581('0x69'),_0xa581('0x6a'),_0xa581('0x6b'),_0xa581('0x6c'),'createdbyexternalpartyyominame',_0xa581('0x6d'),'createdbyyominame',_0xa581('0x6e'),_0xa581('0x6f'),_0xa581('0x70'),_0xa581('0x71'),_0xa581('0x72'),'customeridyominame',_0xa581('0x73'),'entitlementidname',_0xa581('0x74'),_0xa581('0x75'),_0xa581('0x76'),_0xa581('0x77'),'firstresponsebykpiidname','followupby','importsequencenumber',_0xa581('0x78'),_0xa581('0x79'),_0xa581('0x7a'),'masteridname','modifiedbyexternalpartyname',_0xa581('0x7b'),_0xa581('0x7c'),_0xa581('0x7d'),_0xa581('0x7e'),_0xa581('0x7f'),'modifiedonbehalfbyyominame',_0xa581('0x80'),'msdyn_iotalertname',_0xa581('0x81'),_0xa581('0x82'),_0xa581('0x83'),_0xa581('0x84'),_0xa581('0x85'),_0xa581('0x86'),'parentcaseidname','primarycontactidname','primarycontactidyominame',_0xa581('0x87'),_0xa581('0x88'),_0xa581('0x89'),_0xa581('0x8a'),_0xa581('0x8b'),'responseby','responsiblecontactidname',_0xa581('0x8c'),'sentimentvalue',_0xa581('0x8d'),_0xa581('0x8e'),'socialprofileidname',_0xa581('0x8f'),'statuscode',_0xa581('0x90'),_0xa581('0x91'),'timezoneruleversionnumber',_0xa581('0x92'),_0xa581('0x93'),_0xa581('0x94'),'versionnumber'];var _0x227257=_0x1943b6[_0xa581('0x95')](_0x1fa56);return db[_0xa581('0x42')][_0xa581('0x51')]({'where':{'id':_0x32b4f2['params']['id']},'attributes':['id',_0xa581('0x96'),'password',_0xa581('0x97'),'tenantId',_0xa581('0x98'),_0xa581('0x99')]})[_0xa581('0x28')](handleEntityNotFound(_0x140fd3,null))[_0xa581('0x28')](function(_0x58a1f5){if(_0x58a1f5){_0x3482c7=_0x58a1f5[_0xa581('0x97')];var _0x363bea=_0x3482c7[_0xa581('0x9a')](-0x1);if(_0x363bea==='/'){_0x3482c7=_0x3482c7[_0xa581('0x9b')](0x0,_0x3482c7['lastIndexOf'](_0x363bea));}_0x7516e=util[_0xa581('0x9c')](_0xa581('0x9d'),_0x3482c7);var _0x4dc548={'method':'POST','uri':_0xa581('0x9e')+_0x58a1f5['tenantId']+_0xa581('0x9f'),'form':{'client_id':_0x58a1f5[_0xa581('0x98')],'resource':_0x3482c7,'username':_0x58a1f5[_0xa581('0x96')],'password':_0x58a1f5[_0xa581('0xa0')],'grant_type':'password','client_secret':_0x58a1f5[_0xa581('0x99')]},'json':!![]};return rp(_0x4dc548);}})[_0xa581('0x28')](function(_0xfa770a){_0x33cc02=_0xfa770a[_0xa581('0xa1')];var _0x3f39f2={'method':_0xa581('0xa2'),'uri':encodeURI(_0x7516e+_0xa581('0xa3')+_0x5d0fd2+'\x27'),'headers':{'Authorization':_0xa581('0xa4')+_0x33cc02,'If-None-Match':null,'OData-Version':_0xa581('0xa5')},'json':!![]};return rp(_0x3f39f2);})['then'](function(_0x14ea12){var _0x56279d=_0x14ea12[_0xa581('0xa6')][0x0];var _0x12e8ea=_0x56279d['MetadataId'];var _0xfbf56={'method':_0xa581('0xa2'),'uri':_0x7516e+_0xa581('0xa7')+_0x12e8ea+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':_0xa581('0xa4')+_0x33cc02,'If-None-Match':null,'OData-Version':_0xa581('0xa5')},'json':!![]};return rp(_0xfbf56);})['then'](function(_0x1f0e6d){_0x1a4932=_0x1f0e6d;_0x503700=_0x1a4932[_0xa581('0xa8')];_0x503700=_[_0xa581('0xa9')](_0x503700,function(_0x730fa4){return!_0x227257[_0xa581('0xaa')](_0x730fa4[_0xa581('0xab')]);});var _0x3853e7=[];var _0x359050=[];_0x503700[_0xa581('0xac')](function(_0x1d0e5a){if(_0x1d0e5a[_0xa581('0xad')]){var _0x13d1f4=_0x1d0e5a[_0xa581('0xad')][_0xa581('0x9b')](_0x1d0e5a['@odata.type']['lastIndexOf']('.')+0x1);if(_0x13d1f4===_0xa581('0xae')){_0x3853e7[_0xa581('0xaf')](getSelectList(_0x7516e,_0x30c7df,_0x359050,_0x1a4932[_0xa581('0xb0')],_0x1d0e5a[_0xa581('0xb0')],_0x33cc02));}}});return Promise[_0xa581('0xb1')](_0x3853e7);})['then'](function(_0x584703){_0x99b897=_0x584703[0x0];var _0xbaf3d3=[];var _0x15f4ec=[];_0x503700[_0xa581('0xac')](function(_0x160beb){if(!_['isNil'](_0x160beb[_0xa581('0xad')])){var _0x10221e=_0x160beb[_0xa581('0xad')][_0xa581('0x9b')](_0x160beb[_0xa581('0xad')]['lastIndexOf']('.')+0x1);if(_0x10221e==='BooleanAttributeMetadata'){_0xbaf3d3[_0xa581('0xaf')](getBooleanList(_0x7516e,_0x30c7df,_0x15f4ec,_0x1a4932['MetadataId'],_0x160beb[_0xa581('0xb0')],_0x33cc02));}}});return Promise[_0xa581('0xb1')](_0xbaf3d3);})[_0xa581('0x28')](function(_0x231ebc){_0x25aa6e=_0x231ebc[0x0];var _0x291c64=[];var _0x2aa41b=[];_0x503700[_0xa581('0xac')](function(_0x5774a3){if(_0x5774a3[_0xa581('0xad')]){var _0x31bdf3=_0x5774a3[_0xa581('0xad')][_0xa581('0x9b')](_0x5774a3[_0xa581('0xad')]['lastIndexOf']('.')+0x1);if(_0x31bdf3===_0xa581('0xb2')||_0x31bdf3===_0xa581('0xb3')||_0x31bdf3==='BigIntAttributeMetadata'||_0x31bdf3==='IntegerAttributeMetadata'||_0x31bdf3==='MemoAttributeMetadata'||_0x31bdf3==='DateTimeAttributeMetadata'||_0x31bdf3===_0xa581('0xb4')||_0x31bdf3==='EntityNameAttributeMetadata'||_0x31bdf3==='StateAttributeMetadata'||_0x31bdf3==='DecimalAttributeMetadata'){_0x291c64['push'](getInputList(_0x7516e,_0x30c7df,_0x31bdf3,_0x2aa41b,_0x1a4932[_0xa581('0xb0')],_0x5774a3[_0xa581('0xb0')],_0x33cc02));}}});return Promise[_0xa581('0xb1')](_0x291c64);})[_0xa581('0x28')](function(_0x502a87){_0x2e256e=_0x502a87[0x0];var _0x5ff649=_0x99b897[_0xa581('0x95')](_0x25aa6e)[_0xa581('0x95')](_0x2e256e);var _0x3b40df={'count':_0x5ff649[_0xa581('0x3a')],'rows':_0x5ff649};return _0x3b40df;})[_0xa581('0x28')](respondWithResult(_0x140fd3,null))['catch'](function(_0x463525){var _0x3e82ae=_0x32b4f2[_0xa581('0x35')]['test']?0x1f4:_0x463525['statusCode']||0x1f4;logger[_0xa581('0xb5')](_0x463525[_0xa581('0x2b')]);delete _0x463525[_0xa581('0x2c')];if(_0x3e82ae===0x191){_0x3e82ae=0x190;}_0x140fd3[_0xa581('0x1c')](_0x3e82ae)[_0xa581('0x2d')](_0x32b4f2[_0xa581('0x35')][_0xa581('0xb6')]?{'message':_0xa581('0xb7'),'statusCode':_0x463525[_0xa581('0xb8')]}:_0x463525);});};function getSelectList(_0x5c7c73,_0x1f2622,_0x35633d,_0x32a79c,_0x5ef894,_0x563988){var _0x12f0f4={'method':_0xa581('0xa2'),'uri':_0x5c7c73+_0xa581('0xa7')+_0x32a79c+_0xa581('0xb9')+_0x5ef894+_0xa581('0xba')+_0xa581('0xbb'),'headers':{'Authorization':_0xa581('0xa4')+_0x563988,'If-None-Match':null,'OData-Version':_0xa581('0xa5')},'json':!![]};return rp(_0x12f0f4)[_0xa581('0x28')](function(_0x5d240a){var _0x16a209=[];var _0x14d56e=_0x5d240a[_0xa581('0xbc')][_0xa581('0xbd')];_0x14d56e[_0xa581('0xac')](function(_0x334dcf){_0x16a209[_0xa581('0xaf')]({'name':_0x334dcf[_0xa581('0xbe')]['UserLocalizedLabel'][_0xa581('0xbe')],'value':String(_0x334dcf[_0xa581('0xbf')])});});var _0x1c57c9={'id':_0x1f2622+'_'+_0x5d240a['LogicalName'],'name':_0x5d240a[_0xa581('0xc0')][_0xa581('0xc1')]['Label'],'custom':![],'options':_0x16a209};_0x35633d['push'](_0x1c57c9);return _0x35633d;});}function getBooleanList(_0x440294,_0x4aeb1c,_0xaa89bb,_0x54af00,_0x4fb817,_0x5f54ed){var _0x5d3e42={'method':_0xa581('0xa2'),'uri':_0x440294+_0xa581('0xa7')+_0x54af00+')/Attributes('+_0x4fb817+_0xa581('0xc2'),'headers':{'Authorization':_0xa581('0xa4')+_0x5f54ed,'If-None-Match':null,'OData-Version':_0xa581('0xa5')},'json':!![]};return rp(_0x5d3e42)[_0xa581('0x28')](function(_0x436c69){var _0xf21f8b=[];_0xf21f8b[_0xa581('0xaf')]({'name':_0x436c69[_0xa581('0xbc')][_0xa581('0xc3')]['Label'][_0xa581('0xc1')]['Label'],'value':_0xa581('0xc4')},{'name':_0x436c69[_0xa581('0xbc')][_0xa581('0xc5')][_0xa581('0xbe')][_0xa581('0xc1')][_0xa581('0xbe')],'value':_0xa581('0xc6')});var _0x3ffb75={'id':_0x4aeb1c+'_'+_0x436c69[_0xa581('0xab')],'name':_0x436c69['DisplayName'][_0xa581('0xc1')][_0xa581('0xbe')],'custom':![],'options':_0xf21f8b};_0xaa89bb[_0xa581('0xaf')](_0x3ffb75);return _0xaa89bb;});}function getInputList(_0x11d745,_0x309ce5,_0x2a2ba2,_0x4abaf7,_0x1467ca,_0x492bc5,_0x3726e4){var _0xe87749={'method':_0xa581('0xa2'),'uri':_0x11d745+_0xa581('0xa7')+_0x1467ca+_0xa581('0xb9')+_0x492bc5+_0xa581('0xc7')+_0x2a2ba2+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xa581('0xa4')+_0x3726e4,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0xe87749)[_0xa581('0x28')](function(_0x11c8c8){var _0x51c565={'id':_0x309ce5+'_'+_0x11c8c8[_0xa581('0xab')],'name':_0x11c8c8[_0xa581('0xc0')][_0xa581('0xc1')]?_0x11c8c8[_0xa581('0xc0')][_0xa581('0xc1')]['Label']:_0x11c8c8[_0xa581('0xab')],'custom':![],'options':[]};_0x4abaf7[_0xa581('0xaf')](_0x51c565);return _0x4abaf7;});}
\ No newline at end of file
+var _0xab5b=['owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','concat','password','tenantId','clientId','clientSecret','remoteUri','substring','lastIndexOf','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','username','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','MetadataId','BooleanAttributeMetadata','all','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','Wrong\x20credentials','EntityDefinitions(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','Options','Label','UserLocalizedLabel','Value',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','true','FalseOption','false','DisplayName','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','Dynamics365Account','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','show','params','find','create','body','getConfigurations','findOne','Dynamics365Configuration','addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','Dynamics365Field','getFields','PhoneCall','title','description','customerid','caseorigincode','subject','regardingobjectid','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','msdyn_incidenttypename','msdyn_iotalertname','onholdtime','overriddencreatedon'];(function(_0xa9b665,_0x2727ee){var _0x4f8c18=function(_0x1959d6){while(--_0x1959d6){_0xa9b665['push'](_0xa9b665['shift']());}};_0x4f8c18(++_0x2727ee);}(_0xab5b,0x11a));var _0xbab5=function(_0x1ea978,_0x2c9450){_0x1ea978=_0x1ea978-0x0;var _0x5d1a1f=_0xab5b[_0x1ea978];return _0x5d1a1f;};'use strict';var emlformat=require(_0xbab5('0x0'));var rimraf=require(_0xbab5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbab5('0x2'));var rp=require(_0xbab5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbab5('0x4'));var util=require('util');var path=require(_0xbab5('0x5'));var sox=require(_0xbab5('0x6'));var csv=require(_0xbab5('0x7'));var ejs=require(_0xbab5('0x8'));var fs=require('fs');var fs_extra=require(_0xbab5('0x9'));var _=require('lodash');var squel=require(_0xbab5('0xa'));var crypto=require(_0xbab5('0xb'));var jsforce=require(_0xbab5('0xc'));var deskjs=require(_0xbab5('0xd'));var toCsv=require(_0xbab5('0x7'));var querystring=require('querystring');var Papa=require(_0xbab5('0xe'));var Redis=require(_0xbab5('0xf'));var authService=require(_0xbab5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xbab5('0x11'));var hardwareService=require(_0xbab5('0x12'));var logger=require('../../config/logger')(_0xbab5('0x13'));var utils=require(_0xbab5('0x14'));var config=require(_0xbab5('0x15'));var licenseUtil=require(_0xbab5('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0xbab5('0x17'));function respondWithStatusCode(_0x51e348,_0x332b0e){_0x332b0e=_0x332b0e||0xcc;return function(_0xee0909){if(_0xee0909){return _0x51e348[_0xbab5('0x18')](_0x332b0e);}return _0x51e348[_0xbab5('0x19')](_0x332b0e)[_0xbab5('0x1a')]();};}function respondWithResult(_0x51acbc,_0x360b72){_0x360b72=_0x360b72||0xc8;return function(_0x31ed39){if(_0x31ed39){return _0x51acbc[_0xbab5('0x19')](_0x360b72)[_0xbab5('0x1b')](_0x31ed39);}};}function respondWithFilteredResult(_0x21b818,_0xea96d){return function(_0xdfd788){if(_0xdfd788){var _0x1afef5=typeof _0xea96d[_0xbab5('0x1c')]==='undefined'&&typeof _0xea96d[_0xbab5('0x1d')]===_0xbab5('0x1e');var _0x3213d6=_0xdfd788['count'];var _0x5aa7be=_0x1afef5?0x0:_0xea96d[_0xbab5('0x1c')];var _0x3f039d=_0x1afef5?_0xdfd788[_0xbab5('0x1f')]:_0xea96d[_0xbab5('0x1c')]+_0xea96d[_0xbab5('0x1d')];var _0xa448a9;if(_0x3f039d>=_0x3213d6){_0x3f039d=_0x3213d6;_0xa448a9=0xc8;}else{_0xa448a9=0xce;}_0x21b818[_0xbab5('0x19')](_0xa448a9);return _0x21b818['set'](_0xbab5('0x20'),_0x5aa7be+'-'+_0x3f039d+'/'+_0x3213d6)[_0xbab5('0x1b')](_0xdfd788);}return null;};}function patchUpdates(_0x5ebeea){return function(_0x4d0891){try{jsonpatch[_0xbab5('0x21')](_0x4d0891,_0x5ebeea,!![]);}catch(_0x34875a){return BPromise[_0xbab5('0x22')](_0x34875a);}return _0x4d0891[_0xbab5('0x23')]();};}function saveUpdates(_0x24a1ff,_0xbc2989){return function(_0x28d7db){if(_0x28d7db){return _0x28d7db[_0xbab5('0x24')](_0x24a1ff)[_0xbab5('0x25')](function(_0x32e69d){return _0x32e69d;});}return null;};}function removeEntity(_0x27e76f,_0x58ba05){return function(_0x14ed3a){if(_0x14ed3a){return _0x14ed3a[_0xbab5('0x26')]()[_0xbab5('0x25')](function(){_0x27e76f[_0xbab5('0x19')](0xcc)[_0xbab5('0x1a')]();});}};}function handleEntityNotFound(_0x4bbb3e,_0x28066a){return function(_0x2b654f){if(!_0x2b654f){_0x4bbb3e[_0xbab5('0x18')](0x194);}return _0x2b654f;};}function handleError(_0x546ae0,_0x29be55){_0x29be55=_0x29be55||0x1f4;return function(_0x25ab3e){logger[_0xbab5('0x27')](_0x25ab3e[_0xbab5('0x28')]);if(_0x25ab3e[_0xbab5('0x29')]){delete _0x25ab3e[_0xbab5('0x29')];}_0x546ae0[_0xbab5('0x19')](_0x29be55)[_0xbab5('0x2a')](_0x25ab3e);};}exports['index']=function(_0xf87ce4,_0x4ba6b3){var _0x2ed82c={},_0x17ae4b={},_0x4a23cb={'count':0x0,'rows':[]};var _0x2008e5=_[_0xbab5('0x2b')](db[_0xbab5('0x2c')][_0xbab5('0x2d')],function(_0x1a1dd7){return{'name':_0x1a1dd7[_0xbab5('0x2e')],'type':_0x1a1dd7[_0xbab5('0x2f')]['key']};});_0x17ae4b['model']=_[_0xbab5('0x2b')](_0x2008e5,'name');_0x17ae4b[_0xbab5('0x30')]=_[_0xbab5('0x31')](_0xf87ce4['query']);_0x17ae4b[_0xbab5('0x32')]=_[_0xbab5('0x33')](_0x17ae4b[_0xbab5('0x34')],_0x17ae4b[_0xbab5('0x30')]);_0x2ed82c[_0xbab5('0x35')]=_[_0xbab5('0x33')](_0x17ae4b[_0xbab5('0x34')],qs['fields'](_0xf87ce4[_0xbab5('0x30')][_0xbab5('0x36')]));_0x2ed82c[_0xbab5('0x35')]=_0x2ed82c[_0xbab5('0x35')][_0xbab5('0x37')]?_0x2ed82c[_0xbab5('0x35')]:_0x17ae4b[_0xbab5('0x34')];if(!_0xf87ce4['query'][_0xbab5('0x38')](_0xbab5('0x39'))){_0x2ed82c[_0xbab5('0x1d')]=qs['limit'](_0xf87ce4[_0xbab5('0x30')][_0xbab5('0x1d')]);_0x2ed82c['offset']=qs[_0xbab5('0x1c')](_0xf87ce4[_0xbab5('0x30')][_0xbab5('0x1c')]);}_0x2ed82c[_0xbab5('0x3a')]=qs[_0xbab5('0x3b')](_0xf87ce4[_0xbab5('0x30')][_0xbab5('0x3b')]);_0x2ed82c[_0xbab5('0x3c')]=qs[_0xbab5('0x32')](_[_0xbab5('0x3d')](_0xf87ce4[_0xbab5('0x30')],_0x17ae4b[_0xbab5('0x32')]),_0x2008e5);if(_0xf87ce4[_0xbab5('0x30')][_0xbab5('0x3e')]){_0x2ed82c[_0xbab5('0x3c')]=_[_0xbab5('0x3f')](_0x2ed82c['where'],{'$or':_[_0xbab5('0x2b')](_0x2008e5,function(_0x49562e){if(_0x49562e[_0xbab5('0x2f')]!=='VIRTUAL'){var _0x4d296a={};_0x4d296a[_0x49562e[_0xbab5('0x29')]]={'$like':'%'+_0xf87ce4[_0xbab5('0x30')][_0xbab5('0x3e')]+'%'};return _0x4d296a;}})});}_0x2ed82c=_['merge']({},_0x2ed82c,_0xf87ce4[_0xbab5('0x40')]);var _0x4f71bf={'where':_0x2ed82c[_0xbab5('0x3c')]};return db[_0xbab5('0x2c')][_0xbab5('0x1f')](_0x4f71bf)['then'](function(_0x24d1bd){_0x4a23cb['count']=_0x24d1bd;if(_0xf87ce4[_0xbab5('0x30')][_0xbab5('0x41')]){_0x2ed82c[_0xbab5('0x42')]=[{'all':!![]}];}return db[_0xbab5('0x2c')]['findAll'](_0x2ed82c);})[_0xbab5('0x25')](function(_0x36bcaf){_0x4a23cb['rows']=_0x36bcaf;return _0x4a23cb;})[_0xbab5('0x25')](respondWithFilteredResult(_0x4ba6b3,_0x2ed82c))[_0xbab5('0x43')](handleError(_0x4ba6b3,null));};exports[_0xbab5('0x44')]=function(_0x14dac3,_0xd97375){var _0x7ae86a={'raw':![],'where':{'id':_0x14dac3[_0xbab5('0x45')]['id']}},_0x4055a3={};_0x4055a3[_0xbab5('0x34')]=_['keys'](db[_0xbab5('0x2c')][_0xbab5('0x2d')]);_0x4055a3[_0xbab5('0x30')]=_[_0xbab5('0x31')](_0x14dac3[_0xbab5('0x30')]);_0x4055a3[_0xbab5('0x32')]=_[_0xbab5('0x33')](_0x4055a3[_0xbab5('0x34')],_0x4055a3[_0xbab5('0x30')]);_0x7ae86a[_0xbab5('0x35')]=_['intersection'](_0x4055a3[_0xbab5('0x34')],qs['fields'](_0x14dac3[_0xbab5('0x30')]['fields']));_0x7ae86a[_0xbab5('0x35')]=_0x7ae86a[_0xbab5('0x35')][_0xbab5('0x37')]?_0x7ae86a[_0xbab5('0x35')]:_0x4055a3['model'];if(_0x14dac3['query'][_0xbab5('0x41')]){_0x7ae86a[_0xbab5('0x42')]=[{'all':!![]}];}_0x7ae86a=_[_0xbab5('0x3f')]({},_0x7ae86a,_0x14dac3[_0xbab5('0x40')]);return db[_0xbab5('0x2c')][_0xbab5('0x46')](_0x7ae86a)['then'](handleEntityNotFound(_0xd97375,null))[_0xbab5('0x25')](respondWithResult(_0xd97375,null))[_0xbab5('0x43')](handleError(_0xd97375,null));};exports[_0xbab5('0x47')]=function(_0x4b97c5,_0x24aa49){return db[_0xbab5('0x2c')][_0xbab5('0x47')](_0x4b97c5[_0xbab5('0x48')],{})[_0xbab5('0x25')](respondWithResult(_0x24aa49,0xc9))[_0xbab5('0x43')](handleError(_0x24aa49,null));};exports[_0xbab5('0x24')]=function(_0xd5209d,_0x3b1713){if(_0xd5209d['body']['id']){delete _0xd5209d[_0xbab5('0x48')]['id'];}return db['Dynamics365Account'][_0xbab5('0x46')]({'where':{'id':_0xd5209d[_0xbab5('0x45')]['id']}})[_0xbab5('0x25')](handleEntityNotFound(_0x3b1713,null))[_0xbab5('0x25')](saveUpdates(_0xd5209d[_0xbab5('0x48')],null))[_0xbab5('0x25')](respondWithResult(_0x3b1713,null))[_0xbab5('0x43')](handleError(_0x3b1713,null));};exports['destroy']=function(_0xd8eaff,_0x5b1049){return db[_0xbab5('0x2c')][_0xbab5('0x46')]({'where':{'id':_0xd8eaff['params']['id']}})[_0xbab5('0x25')](handleEntityNotFound(_0x5b1049,null))[_0xbab5('0x25')](removeEntity(_0x5b1049,null))['catch'](handleError(_0x5b1049,null));};exports[_0xbab5('0x49')]=function(_0x4476cf,_0x474196,_0x467b07){var _0x46369e={};var _0x4d8232={};var _0x578c25;var _0x3feaea;return db[_0xbab5('0x2c')][_0xbab5('0x4a')]({'where':{'id':_0x4476cf['params']['id']}})[_0xbab5('0x25')](handleEntityNotFound(_0x474196,null))[_0xbab5('0x25')](function(_0x44d5f4){if(_0x44d5f4){_0x578c25=_0x44d5f4;_0x4d8232[_0xbab5('0x34')]=_['keys'](db[_0xbab5('0x4b')][_0xbab5('0x2d')]);_0x4d8232[_0xbab5('0x30')]=_[_0xbab5('0x31')](_0x4476cf[_0xbab5('0x30')]);_0x4d8232[_0xbab5('0x32')]=_[_0xbab5('0x33')](_0x4d8232[_0xbab5('0x34')],_0x4d8232['query']);_0x46369e[_0xbab5('0x35')]=_[_0xbab5('0x33')](_0x4d8232['model'],qs[_0xbab5('0x36')](_0x4476cf[_0xbab5('0x30')][_0xbab5('0x36')]));_0x46369e[_0xbab5('0x35')]=_0x46369e[_0xbab5('0x35')]['length']?_0x46369e[_0xbab5('0x35')]:_0x4d8232[_0xbab5('0x34')];_0x46369e[_0xbab5('0x3a')]=qs[_0xbab5('0x3b')](_0x4476cf[_0xbab5('0x30')][_0xbab5('0x3b')]);_0x46369e['where']=qs[_0xbab5('0x32')](_['pick'](_0x4476cf['query'],_0x4d8232[_0xbab5('0x32')]));if(_0x4476cf[_0xbab5('0x30')]['filter']){_0x46369e[_0xbab5('0x3c')]=_[_0xbab5('0x3f')](_0x46369e['where'],{'$or':_[_0xbab5('0x2b')](_0x46369e['attributes'],function(_0x199e29){var _0x886649={};_0x886649[_0x199e29]={'$like':'%'+_0x4476cf['query'][_0xbab5('0x3e')]+'%'};return _0x886649;})});}_0x46369e=_[_0xbab5('0x3f')]({},_0x46369e,_0x4476cf[_0xbab5('0x40')]);return _0x578c25[_0xbab5('0x49')](_0x46369e);}})['then'](function(_0x481a68){if(_0x481a68){_0x3feaea=_0x481a68[_0xbab5('0x37')];if(!_0x4476cf['query'][_0xbab5('0x38')](_0xbab5('0x39'))){_0x46369e[_0xbab5('0x1d')]=qs[_0xbab5('0x1d')](_0x4476cf[_0xbab5('0x30')][_0xbab5('0x1d')]);_0x46369e[_0xbab5('0x1c')]=qs[_0xbab5('0x1c')](_0x4476cf[_0xbab5('0x30')][_0xbab5('0x1c')]);}return _0x578c25['getConfigurations'](_0x46369e);}})[_0xbab5('0x25')](function(_0x5d9f60){if(_0x5d9f60){return _0x5d9f60?{'count':_0x3feaea,'rows':_0x5d9f60}:null;}})['then'](respondWithResult(_0x474196,null))[_0xbab5('0x43')](handleError(_0x474196,null));};exports[_0xbab5('0x4c')]=function(_0x51eb8a,_0x396e39,_0x32a4b5){if(_0x51eb8a['body']['id']){delete _0x51eb8a[_0xbab5('0x48')]['id'];}return db[_0xbab5('0x2c')][_0xbab5('0x4a')]({'where':{'id':_0x51eb8a[_0xbab5('0x45')]['id']}})[_0xbab5('0x25')](handleEntityNotFound(_0x396e39,null))[_0xbab5('0x25')](function(_0x4b4f11){if(_0x4b4f11){_0x51eb8a['body'][_0xbab5('0x4d')]=_0x4b4f11['id'];_0x51eb8a['body'][_0xbab5('0x4e')]=integrations[_0xbab5('0x4f')](_0x51eb8a[_0xbab5('0x48')][_0xbab5('0x50')],_0x51eb8a[_0xbab5('0x48')][_0xbab5('0x2f')]);_0x51eb8a[_0xbab5('0x48')]['Descriptions']=integrations[_0xbab5('0x51')](_0x51eb8a['body'][_0xbab5('0x50')],_0x51eb8a[_0xbab5('0x48')][_0xbab5('0x2f')]);return db[_0xbab5('0x4b')][_0xbab5('0x47')](_0x51eb8a[_0xbab5('0x48')],{'include':[{'model':db[_0xbab5('0x52')],'as':_0xbab5('0x4e')},{'model':db[_0xbab5('0x52')],'as':'Descriptions'}]});}return null;})[_0xbab5('0x25')](respondWithResult(_0x396e39,null))[_0xbab5('0x43')](handleError(_0x396e39,null));};exports[_0xbab5('0x53')]=function(_0x1dd4cd,_0x13a5cb,_0x15594d){var _0x3a374c=_0x1dd4cd[_0xbab5('0x30')]['ticketType'];var _0x5e3ffe=_0x3a374c==='incident'?'Incident':_0xbab5('0x54');var _0x3b574b='';var _0x332e73='';var _0x10ccd4='';var _0x2d227c='';var _0x327a34='';var _0x282004='';var _0x266698='';var _0x219ba0='';var _0x476ce5=[_0xbab5('0x55'),_0xbab5('0x56'),_0xbab5('0x57'),'ownerid',_0xbab5('0x58'),_0xbab5('0x59'),'phonenumber',_0xbab5('0x5a'),_0xbab5('0x5b'),'phonecall_activity_parties'];var _0x323af7=[_0xbab5('0x5c'),_0xbab5('0x5d'),_0xbab5('0x5e'),_0xbab5('0x5f'),'contactidname',_0xbab5('0x60'),_0xbab5('0x61'),'contractidname',_0xbab5('0x62'),_0xbab5('0x63'),_0xbab5('0x64'),_0xbab5('0x65'),_0xbab5('0x66'),'createdonbehalfbyname',_0xbab5('0x67'),_0xbab5('0x68'),_0xbab5('0x69'),_0xbab5('0x6a'),_0xbab5('0x6b'),_0xbab5('0x6c'),'entityimage_timestamp',_0xbab5('0x6d'),_0xbab5('0x6e'),'exchangerate',_0xbab5('0x6f'),_0xbab5('0x70'),_0xbab5('0x71'),_0xbab5('0x72'),_0xbab5('0x73'),_0xbab5('0x74'),_0xbab5('0x75'),_0xbab5('0x76'),_0xbab5('0x77'),'modifiedbyname',_0xbab5('0x78'),_0xbab5('0x79'),'modifiedonbehalfbyname','modifiedonbehalfbyyominame',_0xbab5('0x7a'),_0xbab5('0x7b'),'numberofchildincidents',_0xbab5('0x7c'),_0xbab5('0x7d'),_0xbab5('0x7e'),_0xbab5('0x7f'),_0xbab5('0x80'),_0xbab5('0x81'),_0xbab5('0x82'),_0xbab5('0x83'),_0xbab5('0x84'),_0xbab5('0x85'),_0xbab5('0x86'),'resolveby',_0xbab5('0x87'),_0xbab5('0x88'),_0xbab5('0x89'),_0xbab5('0x8a'),'sentimentvalue',_0xbab5('0x8b'),_0xbab5('0x8c'),'socialprofileidname',_0xbab5('0x8d'),_0xbab5('0x8e'),_0xbab5('0x8f'),_0xbab5('0x90'),_0xbab5('0x91'),_0xbab5('0x92'),_0xbab5('0x93'),_0xbab5('0x94'),'versionnumber'];var _0x592031=_0x476ce5[_0xbab5('0x95')](_0x323af7);return db['Dynamics365Account'][_0xbab5('0x4a')]({'where':{'id':_0x1dd4cd[_0xbab5('0x45')]['id']},'attributes':['id','username',_0xbab5('0x96'),'remoteUri',_0xbab5('0x97'),_0xbab5('0x98'),_0xbab5('0x99')]})[_0xbab5('0x25')](handleEntityNotFound(_0x13a5cb,null))[_0xbab5('0x25')](function(_0x11dae5){if(_0x11dae5){_0x219ba0=_0x11dae5[_0xbab5('0x9a')];var _0x2304cf=_0x219ba0['slice'](-0x1);if(_0x2304cf==='/'){_0x219ba0=_0x219ba0[_0xbab5('0x9b')](0x0,_0x219ba0[_0xbab5('0x9c')](_0x2304cf));}_0x266698=util['format'](_0xbab5('0x9d'),_0x219ba0);var _0x1ae723={'method':_0xbab5('0x9e'),'uri':_0xbab5('0x9f')+_0x11dae5[_0xbab5('0x97')]+'/oauth2/token','form':{'client_id':_0x11dae5[_0xbab5('0x98')],'resource':_0x219ba0,'username':_0x11dae5[_0xbab5('0xa0')],'password':_0x11dae5[_0xbab5('0x96')],'grant_type':_0xbab5('0x96'),'client_secret':_0x11dae5[_0xbab5('0x99')]},'json':!![]};return rp(_0x1ae723);}})[_0xbab5('0x25')](function(_0x5d8e33){_0x282004=_0x5d8e33[_0xbab5('0xa1')];var _0x1807a6={'method':_0xbab5('0xa2'),'uri':encodeURI(_0x266698+_0xbab5('0xa3')+_0x5e3ffe+'\x27'),'headers':{'Authorization':_0xbab5('0xa4')+_0x282004,'If-None-Match':null,'OData-Version':_0xbab5('0xa5')},'json':!![]};return rp(_0x1807a6);})[_0xbab5('0x25')](function(_0x4567b8){var _0x3f19d5=_0x4567b8[_0xbab5('0xa6')][0x0];var _0x207832=_0x3f19d5['MetadataId'];var _0x102abb={'method':'GET','uri':_0x266698+'EntityDefinitions('+_0x207832+_0xbab5('0xa7'),'headers':{'Authorization':_0xbab5('0xa4')+_0x282004,'If-None-Match':null,'OData-Version':_0xbab5('0xa5')},'json':!![]};return rp(_0x102abb);})[_0xbab5('0x25')](function(_0x57344d){_0x3b574b=_0x57344d;_0x332e73=_0x3b574b[_0xbab5('0xa8')];_0x332e73=_[_0xbab5('0xa9')](_0x332e73,function(_0x4abcf8){return!_0x592031[_0xbab5('0xaa')](_0x4abcf8[_0xbab5('0xab')]);});var _0x31153a=[];var _0x36e39f=[];_0x332e73[_0xbab5('0xac')](function(_0x28b9cb){if(_0x28b9cb[_0xbab5('0xad')]){var _0x7881ab=_0x28b9cb[_0xbab5('0xad')][_0xbab5('0x9b')](_0x28b9cb[_0xbab5('0xad')][_0xbab5('0x9c')]('.')+0x1);if(_0x7881ab===_0xbab5('0xae')){_0x31153a[_0xbab5('0xaf')](getSelectList(_0x266698,_0x3a374c,_0x36e39f,_0x3b574b[_0xbab5('0xb0')],_0x28b9cb[_0xbab5('0xb0')],_0x282004));}}});return Promise['all'](_0x31153a);})[_0xbab5('0x25')](function(_0x3057a5){_0x10ccd4=_0x3057a5[0x0];var _0x54785f=[];var _0x496528=[];_0x332e73['forEach'](function(_0x41f3a1){if(!_['isNil'](_0x41f3a1[_0xbab5('0xad')])){var _0x14b07e=_0x41f3a1[_0xbab5('0xad')][_0xbab5('0x9b')](_0x41f3a1[_0xbab5('0xad')][_0xbab5('0x9c')]('.')+0x1);if(_0x14b07e===_0xbab5('0xb1')){_0x54785f[_0xbab5('0xaf')](getBooleanList(_0x266698,_0x3a374c,_0x496528,_0x3b574b[_0xbab5('0xb0')],_0x41f3a1['MetadataId'],_0x282004));}}});return Promise[_0xbab5('0xb2')](_0x54785f);})[_0xbab5('0x25')](function(_0x56cf11){_0x2d227c=_0x56cf11[0x0];var _0x33d919=[];var _0x308644=[];_0x332e73[_0xbab5('0xac')](function(_0x5a1e3f){if(_0x5a1e3f[_0xbab5('0xad')]){var _0x30b43f=_0x5a1e3f[_0xbab5('0xad')][_0xbab5('0x9b')](_0x5a1e3f[_0xbab5('0xad')][_0xbab5('0x9c')]('.')+0x1);if(_0x30b43f===_0xbab5('0xb3')||_0x30b43f===_0xbab5('0xb4')||_0x30b43f==='BigIntAttributeMetadata'||_0x30b43f===_0xbab5('0xb5')||_0x30b43f===_0xbab5('0xb6')||_0x30b43f===_0xbab5('0xb7')||_0x30b43f===_0xbab5('0xb8')||_0x30b43f===_0xbab5('0xb9')||_0x30b43f===_0xbab5('0xba')||_0x30b43f===_0xbab5('0xbb')){_0x33d919[_0xbab5('0xaf')](getInputList(_0x266698,_0x3a374c,_0x30b43f,_0x308644,_0x3b574b[_0xbab5('0xb0')],_0x5a1e3f['MetadataId'],_0x282004));}}});return Promise[_0xbab5('0xb2')](_0x33d919);})['then'](function(_0x52a3e9){_0x327a34=_0x52a3e9[0x0];var _0x3e425a=_0x10ccd4[_0xbab5('0x95')](_0x2d227c)[_0xbab5('0x95')](_0x327a34);var _0x1832b4={'count':_0x3e425a[_0xbab5('0x37')],'rows':_0x3e425a};return _0x1832b4;})[_0xbab5('0x25')](respondWithResult(_0x13a5cb,null))[_0xbab5('0x43')](function(_0x6d8698){var _0x5d7bb3=_0x1dd4cd['query']['test']?0x1f4:_0x6d8698[_0xbab5('0xbc')]||0x1f4;logger[_0xbab5('0x27')](_0x6d8698[_0xbab5('0x28')]);delete _0x6d8698['name'];if(_0x5d7bb3===0x191){_0x5d7bb3=0x190;}_0x13a5cb['status'](_0x5d7bb3)['send'](_0x1dd4cd[_0xbab5('0x30')]['test']?{'message':_0xbab5('0xbd'),'statusCode':_0x6d8698[_0xbab5('0xbc')]}:_0x6d8698);});};function getSelectList(_0x1bb52b,_0x4e8d1a,_0x1a9f7a,_0x1c4050,_0x341086,_0x11b0d6){var _0x50b54c={'method':_0xbab5('0xa2'),'uri':_0x1bb52b+_0xbab5('0xbe')+_0x1c4050+')/Attributes('+_0x341086+_0xbab5('0xbf')+_0xbab5('0xc0'),'headers':{'Authorization':'Bearer\x20'+_0x11b0d6,'If-None-Match':null,'OData-Version':_0xbab5('0xa5')},'json':!![]};return rp(_0x50b54c)[_0xbab5('0x25')](function(_0xb74ee2){var _0x57b656=[];var _0x443c8f=_0xb74ee2['OptionSet'][_0xbab5('0xc1')];_0x443c8f[_0xbab5('0xac')](function(_0x51e707){_0x57b656[_0xbab5('0xaf')]({'name':_0x51e707[_0xbab5('0xc2')][_0xbab5('0xc3')][_0xbab5('0xc2')],'value':String(_0x51e707[_0xbab5('0xc4')])});});var _0x4ea0c9={'id':_0x4e8d1a+'_'+_0xb74ee2['LogicalName'],'name':_0xb74ee2['DisplayName'][_0xbab5('0xc3')][_0xbab5('0xc2')],'custom':![],'options':_0x57b656};_0x1a9f7a['push'](_0x4ea0c9);return _0x1a9f7a;});}function getBooleanList(_0x5409da,_0x208b03,_0x5c40f5,_0x2581c9,_0x10f36b,_0x2f9fc5){var _0x31047c={'method':_0xbab5('0xa2'),'uri':_0x5409da+_0xbab5('0xbe')+_0x2581c9+_0xbab5('0xc5')+_0x10f36b+_0xbab5('0xc6'),'headers':{'Authorization':_0xbab5('0xa4')+_0x2f9fc5,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x31047c)[_0xbab5('0x25')](function(_0x3103b0){var _0x338830=[];_0x338830[_0xbab5('0xaf')]({'name':_0x3103b0[_0xbab5('0xc7')]['TrueOption'][_0xbab5('0xc2')][_0xbab5('0xc3')][_0xbab5('0xc2')],'value':_0xbab5('0xc8')},{'name':_0x3103b0[_0xbab5('0xc7')][_0xbab5('0xc9')][_0xbab5('0xc2')][_0xbab5('0xc3')][_0xbab5('0xc2')],'value':_0xbab5('0xca')});var _0x12bc9e={'id':_0x208b03+'_'+_0x3103b0[_0xbab5('0xab')],'name':_0x3103b0['DisplayName']['UserLocalizedLabel']['Label'],'custom':![],'options':_0x338830};_0x5c40f5[_0xbab5('0xaf')](_0x12bc9e);return _0x5c40f5;});}function getInputList(_0x213357,_0x1cc0da,_0x50c082,_0x284e4a,_0x3a3716,_0x179510,_0x18d58b){var _0x344009={'method':_0xbab5('0xa2'),'uri':_0x213357+_0xbab5('0xbe')+_0x3a3716+_0xbab5('0xc5')+_0x179510+')/Microsoft.Dynamics.CRM.'+_0x50c082+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xbab5('0xa4')+_0x18d58b,'If-None-Match':null,'OData-Version':_0xbab5('0xa5')},'json':!![]};return rp(_0x344009)[_0xbab5('0x25')](function(_0x257161){var _0xa1f4ad={'id':_0x1cc0da+'_'+_0x257161[_0xbab5('0xab')],'name':_0x257161[_0xbab5('0xcb')][_0xbab5('0xc3')]?_0x257161[_0xbab5('0xcb')][_0xbab5('0xc3')][_0xbab5('0xc2')]:_0x257161[_0xbab5('0xab')],'custom':![],'options':[]};_0x284e4a[_0xbab5('0xaf')](_0xa1f4ad);return _0x284e4a;});}
\ No newline at end of file
index 9864a51..b8590a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x757a=['Dynamics365Account','int_dynamics365_accounts','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0x3aa206,_0x245a91){var _0x37aea0=function(_0x2813f5){while(--_0x2813f5){_0x3aa206['push'](_0x3aa206['shift']());}};_0x37aea0(++_0x245a91);}(_0x757a,0xde));var _0xa757=function(_0x8370e0,_0x459128){_0x8370e0=_0x8370e0-0x0;var _0x1e6a36=_0x757a[_0x8370e0];return _0x1e6a36;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));var integrations=require(_0xa757('0x7'));module['exports']=function(_0xae0e7c,_0x4343b6){return _0xae0e7c['define'](_0xa757('0x8'),attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x4a4bba,_0x166da6){var _0x3483d0=function(_0x15f954){while(--_0x15f954){_0x4a4bba['push'](_0x4a4bba['shift']());}};_0x3483d0(++_0x166da6);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2e1dea1..f77ea83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x82a0=['info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetDynamics365Account','Dynamics365Account','findAll','options','where','attributes','limit','map','include','model','find','raw','ShowDynamics365Account','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x39958f,_0x288e76){var _0x1e72b6=function(_0x579f84){while(--_0x579f84){_0x39958f['push'](_0x39958f['shift']());}};_0x1e72b6(++_0x288e76);}(_0x82a0,0xdb));var _0x082a=function(_0x547add,_0x387042){_0x547add=_0x547add-0x0;var _0x2ed1f3=_0x82a0[_0x547add];return _0x2ed1f3;};'use strict';var _=require(_0x082a('0x0'));var util=require(_0x082a('0x1'));var moment=require(_0x082a('0x2'));var BPromise=require(_0x082a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x082a('0x4'))['db'];var utils=require(_0x082a('0x5'));var logger=require('../../config/logger')(_0x082a('0x6'));var config=require(_0x082a('0x7'));var jayson=require(_0x082a('0x8'));var client=jayson[_0x082a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x263934,_0x29f2c4,_0x580fd2){return new BPromise(function(_0x860b06,_0x5c6e1f){return client[_0x082a('0xa')](_0x263934,_0x580fd2)[_0x082a('0xb')](function(_0x208df4){logger[_0x082a('0xc')](_0x082a('0xd'),_0x29f2c4,_0x082a('0xe'));logger[_0x082a('0xf')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x29f2c4,_0x082a('0xe'),JSON[_0x082a('0x10')](_0x208df4));if(_0x208df4[_0x082a('0x11')]){if(_0x208df4['error']['code']===0x1f4){logger['error'](_0x082a('0xd'),_0x29f2c4,_0x208df4[_0x082a('0x11')][_0x082a('0x12')]);return _0x5c6e1f(_0x208df4[_0x082a('0x11')]['message']);}logger[_0x082a('0x11')](_0x082a('0xd'),_0x29f2c4,_0x208df4[_0x082a('0x11')]['message']);return _0x860b06(_0x208df4[_0x082a('0x11')][_0x082a('0x12')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x29f2c4,_0x082a('0xe'));_0x860b06(_0x208df4['result'][_0x082a('0x12')]);}})[_0x082a('0x13')](function(_0xa36729){logger[_0x082a('0x11')](_0x082a('0xd'),_0x29f2c4,_0xa36729);_0x5c6e1f(_0xa36729);});});}exports[_0x082a('0x14')]=function(_0x460c6c){var _0x1e540a=this;return new Promise(function(_0x5770c3,_0x51785e){return db[_0x082a('0x15')][_0x082a('0x16')]({'raw':_0x460c6c[_0x082a('0x17')]?_0x460c6c[_0x082a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x460c6c[_0x082a('0x17')]?_0x460c6c['options'][_0x082a('0x18')]||null:null,'attributes':_0x460c6c[_0x082a('0x17')]?_0x460c6c[_0x082a('0x17')][_0x082a('0x19')]||null:null,'limit':_0x460c6c['options']?_0x460c6c['options'][_0x082a('0x1a')]||null:null,'include':_0x460c6c[_0x082a('0x17')]?_0x460c6c[_0x082a('0x17')]['include']?_[_0x082a('0x1b')](_0x460c6c[_0x082a('0x17')][_0x082a('0x1c')],function(_0x265ad0){return{'model':db[_0x265ad0[_0x082a('0x1d')]],'as':_0x265ad0['as'],'attributes':_0x265ad0[_0x082a('0x19')],'include':_0x265ad0[_0x082a('0x1c')]?_[_0x082a('0x1b')](_0x265ad0[_0x082a('0x1c')],function(_0x1e9fb6){return{'model':db[_0x1e9fb6[_0x082a('0x1d')]],'as':_0x1e9fb6['as'],'attributes':_0x1e9fb6[_0x082a('0x19')],'include':_0x1e9fb6[_0x082a('0x1c')]?_[_0x082a('0x1b')](_0x1e9fb6[_0x082a('0x1c')],function(_0x22e6ed){return{'model':db[_0x22e6ed[_0x082a('0x1d')]],'as':_0x22e6ed['as'],'attributes':_0x22e6ed['attributes']};}):[]};}):[]};}):[]:[]})[_0x082a('0xb')](function(_0x2b6be6){logger['info']('GetDynamics365Account',_0x460c6c);logger[_0x082a('0xf')](_0x082a('0x14'),_0x460c6c,JSON['stringify'](_0x2b6be6));_0x5770c3(_0x2b6be6);})['catch'](function(_0x51b1e6){logger[_0x082a('0x11')](_0x082a('0x14'),_0x51b1e6[_0x082a('0x12')],_0x460c6c);_0x51785e(_0x1e540a['error'](0x1f4,_0x51b1e6['message']));});});};exports['ShowDynamics365Account']=function(_0x403114){var _0x2f27c6=this;return new Promise(function(_0x12fb88,_0x20550a){return db[_0x082a('0x15')][_0x082a('0x1e')]({'raw':_0x403114['options']?_0x403114[_0x082a('0x17')][_0x082a('0x1f')]===undefined?!![]:![]:!![],'where':_0x403114['options']?_0x403114['options'][_0x082a('0x18')]||null:null,'attributes':_0x403114[_0x082a('0x17')]?_0x403114['options']['attributes']||null:null,'include':_0x403114[_0x082a('0x17')]?_0x403114[_0x082a('0x17')][_0x082a('0x1c')]?_['map'](_0x403114[_0x082a('0x17')][_0x082a('0x1c')],function(_0x12f3c9){return{'model':db[_0x12f3c9[_0x082a('0x1d')]],'as':_0x12f3c9['as'],'attributes':_0x12f3c9[_0x082a('0x19')],'include':_0x12f3c9[_0x082a('0x1c')]?_['map'](_0x12f3c9[_0x082a('0x1c')],function(_0x563579){return{'model':db[_0x563579[_0x082a('0x1d')]],'as':_0x563579['as'],'attributes':_0x563579[_0x082a('0x19')],'include':_0x563579['include']?_['map'](_0x563579[_0x082a('0x1c')],function(_0x1382c6){return{'model':db[_0x1382c6['model']],'as':_0x1382c6['as'],'attributes':_0x1382c6[_0x082a('0x19')]};}):[]};}):[]};}):[]:[]})[_0x082a('0xb')](function(_0x4b7165){logger[_0x082a('0xc')](_0x082a('0x20'),_0x403114);logger[_0x082a('0xf')]('ShowDynamics365Account',_0x403114,JSON[_0x082a('0x10')](_0x4b7165));_0x12fb88(_0x4b7165);})[_0x082a('0x13')](function(_0xa25d95){logger[_0x082a('0x11')](_0x082a('0x20'),_0xa25d95['message'],_0x403114);_0x20550a(_0x2f27c6[_0x082a('0x11')](0x1f4,_0xa25d95[_0x082a('0x12')]));});});};
\ No newline at end of file
+var _0xe715=['request','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','findAll','options','where','attributes','limit','include','map','model','then','GetDynamics365Account','ShowDynamics365Account','find','raw','info','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x39c7bc,_0x52cbca){var _0x3aaed4=function(_0x5a3478){while(--_0x5a3478){_0x39c7bc['push'](_0x39c7bc['shift']());}};_0x3aaed4(++_0x52cbca);}(_0xe715,0x153));var _0x5e71=function(_0x4ab1a0,_0xc8a40b){_0x4ab1a0=_0x4ab1a0-0x0;var _0x4dd070=_0xe715[_0x4ab1a0];return _0x4dd070;};'use strict';var _=require(_0x5e71('0x0'));var util=require('util');var moment=require(_0x5e71('0x1'));var BPromise=require(_0x5e71('0x2'));var rs=require(_0x5e71('0x3'));var fs=require('fs');var Redis=require(_0x5e71('0x4'));var db=require(_0x5e71('0x5'))['db'];var utils=require(_0x5e71('0x6'));var logger=require(_0x5e71('0x7'))(_0x5e71('0x8'));var config=require(_0x5e71('0x9'));var jayson=require(_0x5e71('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2f7eeb,_0x1a4088,_0x1afe1f){return new BPromise(function(_0x56e158,_0x613d68){return client[_0x5e71('0xb')](_0x2f7eeb,_0x1afe1f)['then'](function(_0x12b2dd){logger['info'](_0x5e71('0xc'),_0x1a4088,_0x5e71('0xd'));logger[_0x5e71('0xe')](_0x5e71('0xf'),_0x1a4088,_0x5e71('0xd'),JSON[_0x5e71('0x10')](_0x12b2dd));if(_0x12b2dd[_0x5e71('0x11')]){if(_0x12b2dd['error'][_0x5e71('0x12')]===0x1f4){logger[_0x5e71('0x11')](_0x5e71('0xc'),_0x1a4088,_0x12b2dd['error'][_0x5e71('0x13')]);return _0x613d68(_0x12b2dd['error'][_0x5e71('0x13')]);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x1a4088,_0x12b2dd['error'][_0x5e71('0x13')]);return _0x56e158(_0x12b2dd[_0x5e71('0x11')]['message']);}else{logger['info'](_0x5e71('0xc'),_0x1a4088,'request\x20sent');_0x56e158(_0x12b2dd['result'][_0x5e71('0x13')]);}})[_0x5e71('0x14')](function(_0x5e3130){logger['error'](_0x5e71('0xc'),_0x1a4088,_0x5e3130);_0x613d68(_0x5e3130);});});}exports['GetDynamics365Account']=function(_0x1fb1fa){var _0x5bc11a=this;return new Promise(function(_0x203109,_0x3aa1f1){return db['Dynamics365Account'][_0x5e71('0x15')]({'raw':_0x1fb1fa['options']?_0x1fb1fa[_0x5e71('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1fb1fa[_0x5e71('0x16')]?_0x1fb1fa[_0x5e71('0x16')][_0x5e71('0x17')]||null:null,'attributes':_0x1fb1fa[_0x5e71('0x16')]?_0x1fb1fa[_0x5e71('0x16')][_0x5e71('0x18')]||null:null,'limit':_0x1fb1fa[_0x5e71('0x16')]?_0x1fb1fa[_0x5e71('0x16')][_0x5e71('0x19')]||null:null,'include':_0x1fb1fa['options']?_0x1fb1fa[_0x5e71('0x16')][_0x5e71('0x1a')]?_['map'](_0x1fb1fa['options']['include'],function(_0x16fee2){return{'model':db[_0x16fee2['model']],'as':_0x16fee2['as'],'attributes':_0x16fee2[_0x5e71('0x18')],'include':_0x16fee2[_0x5e71('0x1a')]?_[_0x5e71('0x1b')](_0x16fee2[_0x5e71('0x1a')],function(_0x4cf244){return{'model':db[_0x4cf244[_0x5e71('0x1c')]],'as':_0x4cf244['as'],'attributes':_0x4cf244['attributes'],'include':_0x4cf244[_0x5e71('0x1a')]?_[_0x5e71('0x1b')](_0x4cf244[_0x5e71('0x1a')],function(_0x48381b){return{'model':db[_0x48381b['model']],'as':_0x48381b['as'],'attributes':_0x48381b['attributes']};}):[]};}):[]};}):[]:[]})[_0x5e71('0x1d')](function(_0x389344){logger['info'](_0x5e71('0x1e'),_0x1fb1fa);logger[_0x5e71('0xe')](_0x5e71('0x1e'),_0x1fb1fa,JSON[_0x5e71('0x10')](_0x389344));_0x203109(_0x389344);})[_0x5e71('0x14')](function(_0x586253){logger[_0x5e71('0x11')](_0x5e71('0x1e'),_0x586253[_0x5e71('0x13')],_0x1fb1fa);_0x3aa1f1(_0x5bc11a[_0x5e71('0x11')](0x1f4,_0x586253[_0x5e71('0x13')]));});});};exports[_0x5e71('0x1f')]=function(_0x1a1214){var _0x2dd4df=this;return new Promise(function(_0x2babe7,_0x1c3e90){return db['Dynamics365Account'][_0x5e71('0x20')]({'raw':_0x1a1214[_0x5e71('0x16')]?_0x1a1214[_0x5e71('0x16')][_0x5e71('0x21')]===undefined?!![]:![]:!![],'where':_0x1a1214['options']?_0x1a1214[_0x5e71('0x16')][_0x5e71('0x17')]||null:null,'attributes':_0x1a1214['options']?_0x1a1214['options'][_0x5e71('0x18')]||null:null,'include':_0x1a1214[_0x5e71('0x16')]?_0x1a1214[_0x5e71('0x16')]['include']?_['map'](_0x1a1214[_0x5e71('0x16')][_0x5e71('0x1a')],function(_0x153280){return{'model':db[_0x153280[_0x5e71('0x1c')]],'as':_0x153280['as'],'attributes':_0x153280[_0x5e71('0x18')],'include':_0x153280['include']?_[_0x5e71('0x1b')](_0x153280['include'],function(_0x584b13){return{'model':db[_0x584b13['model']],'as':_0x584b13['as'],'attributes':_0x584b13['attributes'],'include':_0x584b13['include']?_[_0x5e71('0x1b')](_0x584b13[_0x5e71('0x1a')],function(_0x54908b){return{'model':db[_0x54908b[_0x5e71('0x1c')]],'as':_0x54908b['as'],'attributes':_0x54908b[_0x5e71('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5e71('0x1d')](function(_0xf5b54c){logger[_0x5e71('0x22')]('ShowDynamics365Account',_0x1a1214);logger[_0x5e71('0xe')](_0x5e71('0x1f'),_0x1a1214,JSON[_0x5e71('0x10')](_0xf5b54c));_0x2babe7(_0xf5b54c);})[_0x5e71('0x14')](function(_0x43b0f0){logger[_0x5e71('0x11')](_0x5e71('0x1f'),_0x43b0f0[_0x5e71('0x13')],_0x1a1214);_0x1c3e90(_0x2dd4df[_0x5e71('0x11')](0x1f4,_0x43b0f0[_0x5e71('0x13')]));});});};
\ No newline at end of file
index 9af237e..2e1fed1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa60=['post','create','put','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDynamics365Configuration.controller','get','isAuthenticated','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x15491c,_0xcb4e47){var _0x23c024=function(_0x535a64){while(--_0x535a64){_0x15491c['push'](_0x15491c['shift']());}};_0x23c024(++_0xcb4e47);}(_0xfa60,0x8a));var _0x0fa6=function(_0xb53d5c,_0x37fbda){_0xb53d5c=_0xb53d5c-0x0;var _0x353932=_0xfa60[_0xb53d5c];return _0x353932;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0fa6('0x0'));var timeout=require(_0x0fa6('0x1'));var express=require(_0x0fa6('0x2'));var router=express[_0x0fa6('0x3')]();var fs_extra=require(_0x0fa6('0x4'));var auth=require(_0x0fa6('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0fa6('0x6'));router[_0x0fa6('0x7')]('/',auth[_0x0fa6('0x8')](),controller['index']);router['get'](_0x0fa6('0x9'),auth[_0x0fa6('0x8')](),controller['show']);router[_0x0fa6('0x7')](_0x0fa6('0xa'),auth[_0x0fa6('0x8')](),controller[_0x0fa6('0xb')]);router['get'](_0x0fa6('0xc'),auth['isAuthenticated'](),controller[_0x0fa6('0xd')]);router[_0x0fa6('0x7')](_0x0fa6('0xe'),auth[_0x0fa6('0x8')](),controller[_0x0fa6('0xf')]);router[_0x0fa6('0x10')]('/',auth[_0x0fa6('0x8')](),controller[_0x0fa6('0x11')]);router[_0x0fa6('0x12')](_0x0fa6('0x9'),auth['isAuthenticated'](),controller[_0x0fa6('0x13')]);router[_0x0fa6('0x14')](_0x0fa6('0x9'),auth[_0x0fa6('0x8')](),controller['destroy']);module[_0x0fa6('0x15')]=router;
\ No newline at end of file
+var _0x6635=['../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x1352c0,_0x258f65){var _0x13b6b3=function(_0x5c894a){while(--_0x5c894a){_0x1352c0['push'](_0x1352c0['shift']());}};_0x13b6b3(++_0x258f65);}(_0x6635,0x10d));var _0x5663=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x6635[_0x122096];return _0x3d1966;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5663('0x0'));var timeout=require(_0x5663('0x1'));var express=require(_0x5663('0x2'));var router=express[_0x5663('0x3')]();var fs_extra=require(_0x5663('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x5663('0x5'));var config=require(_0x5663('0x6'));var controller=require(_0x5663('0x7'));router[_0x5663('0x8')]('/',auth[_0x5663('0x9')](),controller['index']);router[_0x5663('0x8')](_0x5663('0xa'),auth[_0x5663('0x9')](),controller[_0x5663('0xb')]);router[_0x5663('0x8')](_0x5663('0xc'),auth[_0x5663('0x9')](),controller[_0x5663('0xd')]);router[_0x5663('0x8')](_0x5663('0xe'),auth['isAuthenticated'](),controller[_0x5663('0xf')]);router[_0x5663('0x8')](_0x5663('0x10'),auth[_0x5663('0x9')](),controller[_0x5663('0x11')]);router[_0x5663('0x12')]('/',auth[_0x5663('0x9')](),controller[_0x5663('0x13')]);router[_0x5663('0x14')](_0x5663('0xa'),auth[_0x5663('0x9')](),controller[_0x5663('0x15')]);router[_0x5663('0x16')](_0x5663('0xa'),auth[_0x5663('0x9')](),controller[_0x5663('0x17')]);module[_0x5663('0x18')]=router;
\ No newline at end of file
index 379d9c5..c466430 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x477b=['incident','phonecall','sequelize','STRING','ENUM'];(function(_0x3079a6,_0x4c0bf2){var _0x55cc26=function(_0x1d8631){while(--_0x1d8631){_0x3079a6['push'](_0x3079a6['shift']());}};_0x55cc26(++_0x4c0bf2);}(_0x477b,0x188));var _0xb477=function(_0xf36a7c,_0x53f974){_0xf36a7c=_0xf36a7c-0x0;var _0x3be6ac=_0x477b[_0xf36a7c];return _0x3be6ac;};'use strict';var Sequelize=require(_0xb477('0x0'));module['exports']={'name':{'type':Sequelize[_0xb477('0x1')]},'description':{'type':Sequelize[_0xb477('0x1')]},'ticketType':{'type':Sequelize[_0xb477('0x2')](_0xb477('0x3'),_0xb477('0x4')),'defaultValue':_0xb477('0x3')}};
\ No newline at end of file
+var _0x6754=['exports','STRING','ENUM','incident','sequelize'];(function(_0x10c16d,_0x2b3e14){var _0x5896f4=function(_0x4306b9){while(--_0x4306b9){_0x10c16d['push'](_0x10c16d['shift']());}};_0x5896f4(++_0x2b3e14);}(_0x6754,0x126));var _0x4675=function(_0xe2f5e6,_0xd9eb5e){_0xe2f5e6=_0xe2f5e6-0x0;var _0x484ebe=_0x6754[_0xe2f5e6];return _0x484ebe;};'use strict';var Sequelize=require(_0x4675('0x0'));module[_0x4675('0x1')]={'name':{'type':Sequelize[_0x4675('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x4675('0x3')]('incident','phonecall'),'defaultValue':_0x4675('0x4')}};
\ No newline at end of file
index e6e2950..7c0f90e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c55=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','catch','show','length','include','find','create','body','params','getFields','getSubjects','findOne','Dynamics365Field','getDescriptions','rimraf'];(function(_0x154f8d,_0x4bb33b){var _0x3df89d=function(_0x5f5cc3){while(--_0x5f5cc3){_0x154f8d['push'](_0x154f8d['shift']());}};_0x3df89d(++_0x4bb33b);}(_0x9c55,0xf8));var _0x59c5=function(_0x2cef86,_0xbae0a6){_0x2cef86=_0x2cef86-0x0;var _0x46dfd6=_0x9c55[_0x2cef86];return _0x46dfd6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x59c5('0x0'));var zipdir=require(_0x59c5('0x1'));var jsonpatch=require(_0x59c5('0x2'));var rp=require(_0x59c5('0x3'));var moment=require(_0x59c5('0x4'));var BPromise=require(_0x59c5('0x5'));var Mustache=require(_0x59c5('0x6'));var util=require(_0x59c5('0x7'));var path=require(_0x59c5('0x8'));var sox=require(_0x59c5('0x9'));var csv=require(_0x59c5('0xa'));var ejs=require(_0x59c5('0xb'));var fs=require('fs');var fs_extra=require(_0x59c5('0xc'));var _=require('lodash');var squel=require(_0x59c5('0xd'));var crypto=require(_0x59c5('0xe'));var jsforce=require(_0x59c5('0xf'));var deskjs=require(_0x59c5('0x10'));var toCsv=require('to-csv');var querystring=require(_0x59c5('0x11'));var Papa=require(_0x59c5('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x59c5('0x13'));var hardwareService=require(_0x59c5('0x14'));var logger=require('../../config/logger')(_0x59c5('0x15'));var utils=require(_0x59c5('0x16'));var config=require(_0x59c5('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x59c5('0x18'))['db'];function respondWithStatusCode(_0x2315be,_0x1a8835){_0x1a8835=_0x1a8835||0xcc;return function(_0x247d3c){if(_0x247d3c){return _0x2315be['sendStatus'](_0x1a8835);}return _0x2315be['status'](_0x1a8835)[_0x59c5('0x19')]();};}function respondWithResult(_0x56e1aa,_0x2c8757){_0x2c8757=_0x2c8757||0xc8;return function(_0x396146){if(_0x396146){return _0x56e1aa[_0x59c5('0x1a')](_0x2c8757)[_0x59c5('0x1b')](_0x396146);}};}function respondWithFilteredResult(_0x43d147,_0x588288){return function(_0x5db798){if(_0x5db798){var _0x514132=typeof _0x588288[_0x59c5('0x1c')]===_0x59c5('0x1d')&&typeof _0x588288[_0x59c5('0x1e')]==='undefined';var _0x83e641=_0x5db798[_0x59c5('0x1f')];var _0x52382d=_0x514132?0x0:_0x588288[_0x59c5('0x1c')];var _0x237737=_0x514132?_0x5db798[_0x59c5('0x1f')]:_0x588288[_0x59c5('0x1c')]+_0x588288[_0x59c5('0x1e')];var _0x359915;if(_0x237737>=_0x83e641){_0x237737=_0x83e641;_0x359915=0xc8;}else{_0x359915=0xce;}_0x43d147[_0x59c5('0x1a')](_0x359915);return _0x43d147[_0x59c5('0x20')](_0x59c5('0x21'),_0x52382d+'-'+_0x237737+'/'+_0x83e641)['json'](_0x5db798);}return null;};}function patchUpdates(_0x23ad10){return function(_0x11646c){try{jsonpatch[_0x59c5('0x22')](_0x11646c,_0x23ad10,!![]);}catch(_0x150710){return BPromise[_0x59c5('0x23')](_0x150710);}return _0x11646c[_0x59c5('0x24')]();};}function saveUpdates(_0x634cc4,_0x28c0b4){return function(_0x4af72b){if(_0x4af72b){return _0x4af72b[_0x59c5('0x25')](_0x634cc4)[_0x59c5('0x26')](function(_0x442b35){return _0x442b35;});}return null;};}function removeEntity(_0x481d0e,_0x5dd740){return function(_0x56deab){if(_0x56deab){return _0x56deab[_0x59c5('0x27')]()[_0x59c5('0x26')](function(){_0x481d0e['status'](0xcc)[_0x59c5('0x19')]();});}};}function handleEntityNotFound(_0x3a2032,_0x56e96a){return function(_0x2e4cab){if(!_0x2e4cab){_0x3a2032[_0x59c5('0x28')](0x194);}return _0x2e4cab;};}function handleError(_0x1aad88,_0x419a88){_0x419a88=_0x419a88||0x1f4;return function(_0x2f03e3){logger[_0x59c5('0x29')](_0x2f03e3[_0x59c5('0x2a')]);if(_0x2f03e3[_0x59c5('0x2b')]){delete _0x2f03e3[_0x59c5('0x2b')];}_0x1aad88[_0x59c5('0x1a')](_0x419a88)[_0x59c5('0x2c')](_0x2f03e3);};}exports[_0x59c5('0x2d')]=function(_0x2cd6e3,_0x5698c8){var _0x70c2de={},_0x225b84={},_0x4f0ea0={'count':0x0,'rows':[]};var _0xe5872f=_[_0x59c5('0x2e')](db[_0x59c5('0x2f')][_0x59c5('0x30')],function(_0x55b8c4){return{'name':_0x55b8c4['fieldName'],'type':_0x55b8c4[_0x59c5('0x31')][_0x59c5('0x32')]};});_0x225b84[_0x59c5('0x33')]=_[_0x59c5('0x2e')](_0xe5872f,_0x59c5('0x2b'));_0x225b84['query']=_[_0x59c5('0x34')](_0x2cd6e3[_0x59c5('0x35')]);_0x225b84[_0x59c5('0x36')]=_[_0x59c5('0x37')](_0x225b84[_0x59c5('0x33')],_0x225b84[_0x59c5('0x35')]);_0x70c2de[_0x59c5('0x38')]=_['intersection'](_0x225b84[_0x59c5('0x33')],qs[_0x59c5('0x39')](_0x2cd6e3['query']['fields']));_0x70c2de['attributes']=_0x70c2de[_0x59c5('0x38')]['length']?_0x70c2de[_0x59c5('0x38')]:_0x225b84[_0x59c5('0x33')];if(!_0x2cd6e3[_0x59c5('0x35')][_0x59c5('0x3a')](_0x59c5('0x3b'))){_0x70c2de[_0x59c5('0x1e')]=qs['limit'](_0x2cd6e3['query'][_0x59c5('0x1e')]);_0x70c2de[_0x59c5('0x1c')]=qs[_0x59c5('0x1c')](_0x2cd6e3['query'][_0x59c5('0x1c')]);}_0x70c2de[_0x59c5('0x3c')]=qs[_0x59c5('0x3d')](_0x2cd6e3[_0x59c5('0x35')][_0x59c5('0x3d')]);_0x70c2de['where']=qs['filters'](_[_0x59c5('0x3e')](_0x2cd6e3[_0x59c5('0x35')],_0x225b84[_0x59c5('0x36')]),_0xe5872f);if(_0x2cd6e3['query'][_0x59c5('0x3f')]){_0x70c2de[_0x59c5('0x40')]=_[_0x59c5('0x41')](_0x70c2de[_0x59c5('0x40')],{'$or':_[_0x59c5('0x2e')](_0xe5872f,function(_0x14d582){if(_0x14d582[_0x59c5('0x31')]!=='VIRTUAL'){var _0x4abac4={};_0x4abac4[_0x14d582[_0x59c5('0x2b')]]={'$like':'%'+_0x2cd6e3['query'][_0x59c5('0x3f')]+'%'};return _0x4abac4;}})});}_0x70c2de=_['merge']({},_0x70c2de,_0x2cd6e3[_0x59c5('0x42')]);var _0x532eaf={'where':_0x70c2de[_0x59c5('0x40')]};return db['Dynamics365Configuration'][_0x59c5('0x1f')](_0x532eaf)[_0x59c5('0x26')](function(_0x2b9549){_0x4f0ea0[_0x59c5('0x1f')]=_0x2b9549;if(_0x2cd6e3[_0x59c5('0x35')][_0x59c5('0x43')]){_0x70c2de['include']=[{'all':!![]}];}return db[_0x59c5('0x2f')][_0x59c5('0x44')](_0x70c2de);})[_0x59c5('0x26')](function(_0x594105){_0x4f0ea0[_0x59c5('0x45')]=_0x594105;return _0x4f0ea0;})[_0x59c5('0x26')](respondWithFilteredResult(_0x5698c8,_0x70c2de))[_0x59c5('0x46')](handleError(_0x5698c8,null));};exports[_0x59c5('0x47')]=function(_0x1e6faa,_0x12e668){var _0x43f233={'raw':![],'where':{'id':_0x1e6faa['params']['id']}},_0x475d8c={};_0x475d8c['model']=_[_0x59c5('0x34')](db['Dynamics365Configuration'][_0x59c5('0x30')]);_0x475d8c[_0x59c5('0x35')]=_[_0x59c5('0x34')](_0x1e6faa[_0x59c5('0x35')]);_0x475d8c[_0x59c5('0x36')]=_[_0x59c5('0x37')](_0x475d8c[_0x59c5('0x33')],_0x475d8c[_0x59c5('0x35')]);_0x43f233['attributes']=_['intersection'](_0x475d8c[_0x59c5('0x33')],qs[_0x59c5('0x39')](_0x1e6faa[_0x59c5('0x35')][_0x59c5('0x39')]));_0x43f233[_0x59c5('0x38')]=_0x43f233[_0x59c5('0x38')][_0x59c5('0x48')]?_0x43f233[_0x59c5('0x38')]:_0x475d8c[_0x59c5('0x33')];if(_0x1e6faa[_0x59c5('0x35')][_0x59c5('0x43')]){_0x43f233[_0x59c5('0x49')]=[{'all':!![]}];}_0x43f233=_[_0x59c5('0x41')]({},_0x43f233,_0x1e6faa[_0x59c5('0x42')]);return db[_0x59c5('0x2f')][_0x59c5('0x4a')](_0x43f233)[_0x59c5('0x26')](handleEntityNotFound(_0x12e668,null))[_0x59c5('0x26')](respondWithResult(_0x12e668,null))[_0x59c5('0x46')](handleError(_0x12e668,null));};exports['create']=function(_0x466535,_0x1989d4){return db[_0x59c5('0x2f')][_0x59c5('0x4b')](_0x466535['body'],{})['then'](respondWithResult(_0x1989d4,0xc9))[_0x59c5('0x46')](handleError(_0x1989d4,null));};exports[_0x59c5('0x25')]=function(_0x3ad1e9,_0x552196){if(_0x3ad1e9['body']['id']){delete _0x3ad1e9[_0x59c5('0x4c')]['id'];}return db['Dynamics365Configuration'][_0x59c5('0x4a')]({'where':{'id':_0x3ad1e9[_0x59c5('0x4d')]['id']}})[_0x59c5('0x26')](handleEntityNotFound(_0x552196,null))[_0x59c5('0x26')](saveUpdates(_0x3ad1e9[_0x59c5('0x4c')],null))['then'](respondWithResult(_0x552196,null))[_0x59c5('0x46')](handleError(_0x552196,null));};exports[_0x59c5('0x27')]=function(_0x11588b,_0x4a96cb){return db['Dynamics365Configuration']['find']({'where':{'id':_0x11588b[_0x59c5('0x4d')]['id']}})[_0x59c5('0x26')](handleEntityNotFound(_0x4a96cb,null))[_0x59c5('0x26')](removeEntity(_0x4a96cb,null))[_0x59c5('0x46')](handleError(_0x4a96cb,null));};exports['getFields']=function(_0x16b74a,_0x3133a9,_0x1ab47e){var _0x3baf9d={};var _0x4dfb01={};var _0x43fbf3;var _0x147d2f;return db[_0x59c5('0x2f')]['findOne']({'where':{'id':_0x16b74a[_0x59c5('0x4d')]['id']}})[_0x59c5('0x26')](handleEntityNotFound(_0x3133a9,null))[_0x59c5('0x26')](function(_0x4e4a52){if(_0x4e4a52){_0x43fbf3=_0x4e4a52;_0x4dfb01[_0x59c5('0x33')]=_[_0x59c5('0x34')](db['Dynamics365Field']['rawAttributes']);_0x4dfb01[_0x59c5('0x35')]=_[_0x59c5('0x34')](_0x16b74a[_0x59c5('0x35')]);_0x4dfb01[_0x59c5('0x36')]=_[_0x59c5('0x37')](_0x4dfb01[_0x59c5('0x33')],_0x4dfb01[_0x59c5('0x35')]);_0x3baf9d[_0x59c5('0x38')]=_[_0x59c5('0x37')](_0x4dfb01[_0x59c5('0x33')],qs[_0x59c5('0x39')](_0x16b74a[_0x59c5('0x35')][_0x59c5('0x39')]));_0x3baf9d[_0x59c5('0x38')]=_0x3baf9d[_0x59c5('0x38')][_0x59c5('0x48')]?_0x3baf9d[_0x59c5('0x38')]:_0x4dfb01['model'];_0x3baf9d[_0x59c5('0x3c')]=qs[_0x59c5('0x3d')](_0x16b74a[_0x59c5('0x35')]['sort']);_0x3baf9d[_0x59c5('0x40')]=qs[_0x59c5('0x36')](_[_0x59c5('0x3e')](_0x16b74a[_0x59c5('0x35')],_0x4dfb01['filters']));if(_0x16b74a[_0x59c5('0x35')]['filter']){_0x3baf9d[_0x59c5('0x40')]=_[_0x59c5('0x41')](_0x3baf9d[_0x59c5('0x40')],{'$or':_[_0x59c5('0x2e')](_0x3baf9d['attributes'],function(_0x1ce61c){var _0x2bbba3={};_0x2bbba3[_0x1ce61c]={'$like':'%'+_0x16b74a[_0x59c5('0x35')][_0x59c5('0x3f')]+'%'};return _0x2bbba3;})});}_0x3baf9d=_[_0x59c5('0x41')]({},_0x3baf9d,_0x16b74a[_0x59c5('0x42')]);return _0x43fbf3[_0x59c5('0x4e')](_0x3baf9d);}})[_0x59c5('0x26')](function(_0xca787a){if(_0xca787a){_0x147d2f=_0xca787a[_0x59c5('0x48')];if(!_0x16b74a['query'][_0x59c5('0x3a')](_0x59c5('0x3b'))){_0x3baf9d['limit']=qs[_0x59c5('0x1e')](_0x16b74a[_0x59c5('0x35')][_0x59c5('0x1e')]);_0x3baf9d[_0x59c5('0x1c')]=qs[_0x59c5('0x1c')](_0x16b74a['query']['offset']);}return _0x43fbf3['getFields'](_0x3baf9d);}})['then'](function(_0x368674){if(_0x368674){return _0x368674?{'count':_0x147d2f,'rows':_0x368674}:null;}})['then'](respondWithResult(_0x3133a9,null))['catch'](handleError(_0x3133a9,null));};exports[_0x59c5('0x4f')]=function(_0xd6e7a,_0x56a6f9,_0x5c649a){var _0x3f57fe={};var _0x4e711c={};var _0x3f9cb3;var _0x3a110e;return db[_0x59c5('0x2f')][_0x59c5('0x50')]({'where':{'id':_0xd6e7a[_0x59c5('0x4d')]['id']}})[_0x59c5('0x26')](handleEntityNotFound(_0x56a6f9,null))[_0x59c5('0x26')](function(_0x2bd2b4){if(_0x2bd2b4){_0x3f9cb3=_0x2bd2b4;_0x4e711c['model']=_['keys'](db[_0x59c5('0x51')]['rawAttributes']);_0x4e711c[_0x59c5('0x35')]=_[_0x59c5('0x34')](_0xd6e7a[_0x59c5('0x35')]);_0x4e711c[_0x59c5('0x36')]=_[_0x59c5('0x37')](_0x4e711c['model'],_0x4e711c['query']);_0x3f57fe[_0x59c5('0x38')]=_['intersection'](_0x4e711c[_0x59c5('0x33')],qs[_0x59c5('0x39')](_0xd6e7a[_0x59c5('0x35')][_0x59c5('0x39')]));_0x3f57fe[_0x59c5('0x38')]=_0x3f57fe[_0x59c5('0x38')][_0x59c5('0x48')]?_0x3f57fe['attributes']:_0x4e711c['model'];_0x3f57fe[_0x59c5('0x3c')]=qs[_0x59c5('0x3d')](_0xd6e7a[_0x59c5('0x35')][_0x59c5('0x3d')]);_0x3f57fe['where']=qs[_0x59c5('0x36')](_[_0x59c5('0x3e')](_0xd6e7a[_0x59c5('0x35')],_0x4e711c[_0x59c5('0x36')]));if(_0xd6e7a[_0x59c5('0x35')]['filter']){_0x3f57fe[_0x59c5('0x40')]=_[_0x59c5('0x41')](_0x3f57fe[_0x59c5('0x40')],{'$or':_[_0x59c5('0x2e')](_0x3f57fe[_0x59c5('0x38')],function(_0x5c2106){var _0x29cd38={};_0x29cd38[_0x5c2106]={'$like':'%'+_0xd6e7a[_0x59c5('0x35')][_0x59c5('0x3f')]+'%'};return _0x29cd38;})});}_0x3f57fe=_[_0x59c5('0x41')]({},_0x3f57fe,_0xd6e7a[_0x59c5('0x42')]);return _0x3f9cb3['getSubjects'](_0x3f57fe);}})[_0x59c5('0x26')](function(_0x4757bb){if(_0x4757bb){_0x3a110e=_0x4757bb[_0x59c5('0x48')];if(!_0xd6e7a['query'][_0x59c5('0x3a')](_0x59c5('0x3b'))){_0x3f57fe[_0x59c5('0x1e')]=qs['limit'](_0xd6e7a[_0x59c5('0x35')][_0x59c5('0x1e')]);_0x3f57fe[_0x59c5('0x1c')]=qs[_0x59c5('0x1c')](_0xd6e7a['query']['offset']);}return _0x3f9cb3[_0x59c5('0x4f')](_0x3f57fe);}})[_0x59c5('0x26')](function(_0x54088d){if(_0x54088d){return _0x54088d?{'count':_0x3a110e,'rows':_0x54088d}:null;}})['then'](respondWithResult(_0x56a6f9,null))[_0x59c5('0x46')](handleError(_0x56a6f9,null));};exports[_0x59c5('0x52')]=function(_0x4e73aa,_0x53db92,_0x35b32a){var _0x360a56={};var _0x2d9f8e={};var _0x48b24e;var _0x4e57c0;return db[_0x59c5('0x2f')][_0x59c5('0x50')]({'where':{'id':_0x4e73aa[_0x59c5('0x4d')]['id']}})[_0x59c5('0x26')](handleEntityNotFound(_0x53db92,null))[_0x59c5('0x26')](function(_0x283a11){if(_0x283a11){_0x48b24e=_0x283a11;_0x2d9f8e[_0x59c5('0x33')]=_['keys'](db[_0x59c5('0x51')][_0x59c5('0x30')]);_0x2d9f8e[_0x59c5('0x35')]=_['keys'](_0x4e73aa[_0x59c5('0x35')]);_0x2d9f8e[_0x59c5('0x36')]=_[_0x59c5('0x37')](_0x2d9f8e[_0x59c5('0x33')],_0x2d9f8e[_0x59c5('0x35')]);_0x360a56[_0x59c5('0x38')]=_['intersection'](_0x2d9f8e[_0x59c5('0x33')],qs[_0x59c5('0x39')](_0x4e73aa[_0x59c5('0x35')]['fields']));_0x360a56[_0x59c5('0x38')]=_0x360a56[_0x59c5('0x38')]['length']?_0x360a56[_0x59c5('0x38')]:_0x2d9f8e['model'];_0x360a56[_0x59c5('0x3c')]=qs['sort'](_0x4e73aa['query'][_0x59c5('0x3d')]);_0x360a56['where']=qs['filters'](_[_0x59c5('0x3e')](_0x4e73aa[_0x59c5('0x35')],_0x2d9f8e['filters']));if(_0x4e73aa[_0x59c5('0x35')]['filter']){_0x360a56[_0x59c5('0x40')]=_[_0x59c5('0x41')](_0x360a56['where'],{'$or':_['map'](_0x360a56['attributes'],function(_0x3f44e2){var _0x3e4208={};_0x3e4208[_0x3f44e2]={'$like':'%'+_0x4e73aa[_0x59c5('0x35')][_0x59c5('0x3f')]+'%'};return _0x3e4208;})});}_0x360a56=_['merge']({},_0x360a56,_0x4e73aa[_0x59c5('0x42')]);return _0x48b24e[_0x59c5('0x52')](_0x360a56);}})[_0x59c5('0x26')](function(_0x3fcd7f){if(_0x3fcd7f){_0x4e57c0=_0x3fcd7f[_0x59c5('0x48')];if(!_0x4e73aa[_0x59c5('0x35')][_0x59c5('0x3a')]('nolimit')){_0x360a56[_0x59c5('0x1e')]=qs[_0x59c5('0x1e')](_0x4e73aa[_0x59c5('0x35')]['limit']);_0x360a56[_0x59c5('0x1c')]=qs[_0x59c5('0x1c')](_0x4e73aa['query'][_0x59c5('0x1c')]);}return _0x48b24e[_0x59c5('0x52')](_0x360a56);}})[_0x59c5('0x26')](function(_0x308f7d){if(_0x308f7d){return _0x308f7d?{'count':_0x4e57c0,'rows':_0x308f7d}:null;}})[_0x59c5('0x26')](respondWithResult(_0x53db92,null))[_0x59c5('0x46')](handleError(_0x53db92,null));};
\ No newline at end of file
+var _0xfa26=['rimraf','zip-dir','fast-json-patch','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','Dynamics365Configuration','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','findOne','Dynamics365Field','order','getFields','getSubjects','getDescriptions','eml-format'];(function(_0x3229e8,_0x3070de){var _0x36dad7=function(_0x4c314b){while(--_0x4c314b){_0x3229e8['push'](_0x3229e8['shift']());}};_0x36dad7(++_0x3070de);}(_0xfa26,0xa9));var _0x6fa2=function(_0x52edc0,_0x248c46){_0x52edc0=_0x52edc0-0x0;var _0x324bf2=_0xfa26[_0x52edc0];return _0x324bf2;};'use strict';var emlformat=require(_0x6fa2('0x0'));var rimraf=require(_0x6fa2('0x1'));var zipdir=require(_0x6fa2('0x2'));var jsonpatch=require(_0x6fa2('0x3'));var rp=require(_0x6fa2('0x4'));var moment=require(_0x6fa2('0x5'));var BPromise=require(_0x6fa2('0x6'));var Mustache=require(_0x6fa2('0x7'));var util=require(_0x6fa2('0x8'));var path=require(_0x6fa2('0x9'));var sox=require(_0x6fa2('0xa'));var csv=require(_0x6fa2('0xb'));var ejs=require(_0x6fa2('0xc'));var fs=require('fs');var fs_extra=require(_0x6fa2('0xd'));var _=require('lodash');var squel=require(_0x6fa2('0xe'));var crypto=require(_0x6fa2('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x6fa2('0x10'));var toCsv=require(_0x6fa2('0xb'));var querystring=require(_0x6fa2('0x11'));var Papa=require(_0x6fa2('0x12'));var Redis=require(_0x6fa2('0x13'));var authService=require(_0x6fa2('0x14'));var qs=require(_0x6fa2('0x15'));var as=require(_0x6fa2('0x16'));var hardwareService=require(_0x6fa2('0x17'));var logger=require('../../config/logger')(_0x6fa2('0x18'));var utils=require('../../config/utils');var config=require(_0x6fa2('0x19'));var licenseUtil=require(_0x6fa2('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a612b,_0x13d352){_0x13d352=_0x13d352||0xcc;return function(_0x1aa1bd){if(_0x1aa1bd){return _0x3a612b[_0x6fa2('0x1b')](_0x13d352);}return _0x3a612b[_0x6fa2('0x1c')](_0x13d352)[_0x6fa2('0x1d')]();};}function respondWithResult(_0x44d7c6,_0x39e411){_0x39e411=_0x39e411||0xc8;return function(_0x3c2f01){if(_0x3c2f01){return _0x44d7c6[_0x6fa2('0x1c')](_0x39e411)['json'](_0x3c2f01);}};}function respondWithFilteredResult(_0x4bcd78,_0x336a94){return function(_0x17044f){if(_0x17044f){var _0x221bdb=typeof _0x336a94['offset']===_0x6fa2('0x1e')&&typeof _0x336a94[_0x6fa2('0x1f')]==='undefined';var _0x3aa743=_0x17044f[_0x6fa2('0x20')];var _0xf3f4ec=_0x221bdb?0x0:_0x336a94[_0x6fa2('0x21')];var _0x4ca336=_0x221bdb?_0x17044f[_0x6fa2('0x20')]:_0x336a94[_0x6fa2('0x21')]+_0x336a94[_0x6fa2('0x1f')];var _0x108ac6;if(_0x4ca336>=_0x3aa743){_0x4ca336=_0x3aa743;_0x108ac6=0xc8;}else{_0x108ac6=0xce;}_0x4bcd78['status'](_0x108ac6);return _0x4bcd78[_0x6fa2('0x22')](_0x6fa2('0x23'),_0xf3f4ec+'-'+_0x4ca336+'/'+_0x3aa743)[_0x6fa2('0x24')](_0x17044f);}return null;};}function patchUpdates(_0x72d256){return function(_0x32a6f8){try{jsonpatch[_0x6fa2('0x25')](_0x32a6f8,_0x72d256,!![]);}catch(_0x390ee3){return BPromise[_0x6fa2('0x26')](_0x390ee3);}return _0x32a6f8[_0x6fa2('0x27')]();};}function saveUpdates(_0x38bb0c,_0x5c68fe){return function(_0x3f7725){if(_0x3f7725){return _0x3f7725[_0x6fa2('0x28')](_0x38bb0c)[_0x6fa2('0x29')](function(_0xd6b9f5){return _0xd6b9f5;});}return null;};}function removeEntity(_0x179846,_0x16c74c){return function(_0x1f8823){if(_0x1f8823){return _0x1f8823[_0x6fa2('0x2a')]()['then'](function(){_0x179846[_0x6fa2('0x1c')](0xcc)[_0x6fa2('0x1d')]();});}};}function handleEntityNotFound(_0x4bab30,_0x513979){return function(_0x2040c3){if(!_0x2040c3){_0x4bab30[_0x6fa2('0x1b')](0x194);}return _0x2040c3;};}function handleError(_0x335a84,_0x17350e){_0x17350e=_0x17350e||0x1f4;return function(_0x690f9d){logger[_0x6fa2('0x2b')](_0x690f9d[_0x6fa2('0x2c')]);if(_0x690f9d[_0x6fa2('0x2d')]){delete _0x690f9d[_0x6fa2('0x2d')];}_0x335a84[_0x6fa2('0x1c')](_0x17350e)['send'](_0x690f9d);};}exports[_0x6fa2('0x2e')]=function(_0x20db0c,_0x1e7b5d){var _0x143221={},_0x3279b5={},_0x4123e5={'count':0x0,'rows':[]};var _0x215285=_[_0x6fa2('0x2f')](db[_0x6fa2('0x30')][_0x6fa2('0x31')],function(_0x1fa2ad){return{'name':_0x1fa2ad[_0x6fa2('0x32')],'type':_0x1fa2ad['type']['key']};});_0x3279b5[_0x6fa2('0x33')]=_[_0x6fa2('0x2f')](_0x215285,'name');_0x3279b5[_0x6fa2('0x34')]=_[_0x6fa2('0x35')](_0x20db0c['query']);_0x3279b5[_0x6fa2('0x36')]=_[_0x6fa2('0x37')](_0x3279b5['model'],_0x3279b5[_0x6fa2('0x34')]);_0x143221[_0x6fa2('0x38')]=_[_0x6fa2('0x37')](_0x3279b5[_0x6fa2('0x33')],qs[_0x6fa2('0x39')](_0x20db0c[_0x6fa2('0x34')][_0x6fa2('0x39')]));_0x143221[_0x6fa2('0x38')]=_0x143221['attributes'][_0x6fa2('0x3a')]?_0x143221[_0x6fa2('0x38')]:_0x3279b5['model'];if(!_0x20db0c[_0x6fa2('0x34')][_0x6fa2('0x3b')](_0x6fa2('0x3c'))){_0x143221[_0x6fa2('0x1f')]=qs[_0x6fa2('0x1f')](_0x20db0c['query'][_0x6fa2('0x1f')]);_0x143221[_0x6fa2('0x21')]=qs['offset'](_0x20db0c['query'][_0x6fa2('0x21')]);}_0x143221['order']=qs[_0x6fa2('0x3d')](_0x20db0c[_0x6fa2('0x34')]['sort']);_0x143221[_0x6fa2('0x3e')]=qs[_0x6fa2('0x36')](_[_0x6fa2('0x3f')](_0x20db0c[_0x6fa2('0x34')],_0x3279b5['filters']),_0x215285);if(_0x20db0c[_0x6fa2('0x34')][_0x6fa2('0x40')]){_0x143221[_0x6fa2('0x3e')]=_[_0x6fa2('0x41')](_0x143221[_0x6fa2('0x3e')],{'$or':_['map'](_0x215285,function(_0x5a6e46){if(_0x5a6e46[_0x6fa2('0x42')]!==_0x6fa2('0x43')){var _0x2f26c4={};_0x2f26c4[_0x5a6e46[_0x6fa2('0x2d')]]={'$like':'%'+_0x20db0c[_0x6fa2('0x34')][_0x6fa2('0x40')]+'%'};return _0x2f26c4;}})});}_0x143221=_[_0x6fa2('0x41')]({},_0x143221,_0x20db0c[_0x6fa2('0x44')]);var _0x12a997={'where':_0x143221[_0x6fa2('0x3e')]};return db[_0x6fa2('0x30')][_0x6fa2('0x20')](_0x12a997)[_0x6fa2('0x29')](function(_0x36ebc6){_0x4123e5['count']=_0x36ebc6;if(_0x20db0c[_0x6fa2('0x34')][_0x6fa2('0x45')]){_0x143221[_0x6fa2('0x46')]=[{'all':!![]}];}return db[_0x6fa2('0x30')][_0x6fa2('0x47')](_0x143221);})[_0x6fa2('0x29')](function(_0x18888f){_0x4123e5[_0x6fa2('0x48')]=_0x18888f;return _0x4123e5;})[_0x6fa2('0x29')](respondWithFilteredResult(_0x1e7b5d,_0x143221))[_0x6fa2('0x49')](handleError(_0x1e7b5d,null));};exports[_0x6fa2('0x4a')]=function(_0x32ada7,_0x36700c){var _0x560afd={'raw':![],'where':{'id':_0x32ada7[_0x6fa2('0x4b')]['id']}},_0x2ea5cf={};_0x2ea5cf[_0x6fa2('0x33')]=_[_0x6fa2('0x35')](db[_0x6fa2('0x30')][_0x6fa2('0x31')]);_0x2ea5cf[_0x6fa2('0x34')]=_['keys'](_0x32ada7['query']);_0x2ea5cf['filters']=_[_0x6fa2('0x37')](_0x2ea5cf[_0x6fa2('0x33')],_0x2ea5cf[_0x6fa2('0x34')]);_0x560afd[_0x6fa2('0x38')]=_[_0x6fa2('0x37')](_0x2ea5cf[_0x6fa2('0x33')],qs[_0x6fa2('0x39')](_0x32ada7[_0x6fa2('0x34')][_0x6fa2('0x39')]));_0x560afd[_0x6fa2('0x38')]=_0x560afd[_0x6fa2('0x38')][_0x6fa2('0x3a')]?_0x560afd[_0x6fa2('0x38')]:_0x2ea5cf[_0x6fa2('0x33')];if(_0x32ada7[_0x6fa2('0x34')][_0x6fa2('0x45')]){_0x560afd[_0x6fa2('0x46')]=[{'all':!![]}];}_0x560afd=_[_0x6fa2('0x41')]({},_0x560afd,_0x32ada7[_0x6fa2('0x44')]);return db[_0x6fa2('0x30')][_0x6fa2('0x4c')](_0x560afd)[_0x6fa2('0x29')](handleEntityNotFound(_0x36700c,null))['then'](respondWithResult(_0x36700c,null))[_0x6fa2('0x49')](handleError(_0x36700c,null));};exports[_0x6fa2('0x4d')]=function(_0x137421,_0x196fde){return db['Dynamics365Configuration'][_0x6fa2('0x4d')](_0x137421[_0x6fa2('0x4e')],{})[_0x6fa2('0x29')](respondWithResult(_0x196fde,0xc9))[_0x6fa2('0x49')](handleError(_0x196fde,null));};exports[_0x6fa2('0x28')]=function(_0x419262,_0x4a9810){if(_0x419262[_0x6fa2('0x4e')]['id']){delete _0x419262['body']['id'];}return db['Dynamics365Configuration'][_0x6fa2('0x4c')]({'where':{'id':_0x419262[_0x6fa2('0x4b')]['id']}})[_0x6fa2('0x29')](handleEntityNotFound(_0x4a9810,null))[_0x6fa2('0x29')](saveUpdates(_0x419262[_0x6fa2('0x4e')],null))[_0x6fa2('0x29')](respondWithResult(_0x4a9810,null))['catch'](handleError(_0x4a9810,null));};exports[_0x6fa2('0x2a')]=function(_0x165461,_0x48d350){return db[_0x6fa2('0x30')][_0x6fa2('0x4c')]({'where':{'id':_0x165461[_0x6fa2('0x4b')]['id']}})[_0x6fa2('0x29')](handleEntityNotFound(_0x48d350,null))[_0x6fa2('0x29')](removeEntity(_0x48d350,null))[_0x6fa2('0x49')](handleError(_0x48d350,null));};exports['getFields']=function(_0xce7793,_0x508bff,_0xac04af){var _0x5b8809={};var _0x2b1926={};var _0x4004a0;var _0x3e94db;return db[_0x6fa2('0x30')][_0x6fa2('0x4f')]({'where':{'id':_0xce7793[_0x6fa2('0x4b')]['id']}})[_0x6fa2('0x29')](handleEntityNotFound(_0x508bff,null))[_0x6fa2('0x29')](function(_0x463d96){if(_0x463d96){_0x4004a0=_0x463d96;_0x2b1926[_0x6fa2('0x33')]=_[_0x6fa2('0x35')](db[_0x6fa2('0x50')][_0x6fa2('0x31')]);_0x2b1926['query']=_[_0x6fa2('0x35')](_0xce7793[_0x6fa2('0x34')]);_0x2b1926['filters']=_[_0x6fa2('0x37')](_0x2b1926[_0x6fa2('0x33')],_0x2b1926[_0x6fa2('0x34')]);_0x5b8809['attributes']=_[_0x6fa2('0x37')](_0x2b1926[_0x6fa2('0x33')],qs[_0x6fa2('0x39')](_0xce7793[_0x6fa2('0x34')][_0x6fa2('0x39')]));_0x5b8809[_0x6fa2('0x38')]=_0x5b8809[_0x6fa2('0x38')][_0x6fa2('0x3a')]?_0x5b8809['attributes']:_0x2b1926[_0x6fa2('0x33')];_0x5b8809[_0x6fa2('0x51')]=qs[_0x6fa2('0x3d')](_0xce7793[_0x6fa2('0x34')][_0x6fa2('0x3d')]);_0x5b8809['where']=qs[_0x6fa2('0x36')](_[_0x6fa2('0x3f')](_0xce7793[_0x6fa2('0x34')],_0x2b1926[_0x6fa2('0x36')]));if(_0xce7793[_0x6fa2('0x34')][_0x6fa2('0x40')]){_0x5b8809[_0x6fa2('0x3e')]=_[_0x6fa2('0x41')](_0x5b8809[_0x6fa2('0x3e')],{'$or':_['map'](_0x5b8809['attributes'],function(_0x465e9b){var _0x41a42f={};_0x41a42f[_0x465e9b]={'$like':'%'+_0xce7793[_0x6fa2('0x34')][_0x6fa2('0x40')]+'%'};return _0x41a42f;})});}_0x5b8809=_[_0x6fa2('0x41')]({},_0x5b8809,_0xce7793['options']);return _0x4004a0[_0x6fa2('0x52')](_0x5b8809);}})[_0x6fa2('0x29')](function(_0x477cd6){if(_0x477cd6){_0x3e94db=_0x477cd6[_0x6fa2('0x3a')];if(!_0xce7793[_0x6fa2('0x34')][_0x6fa2('0x3b')]('nolimit')){_0x5b8809['limit']=qs[_0x6fa2('0x1f')](_0xce7793['query']['limit']);_0x5b8809[_0x6fa2('0x21')]=qs['offset'](_0xce7793[_0x6fa2('0x34')][_0x6fa2('0x21')]);}return _0x4004a0[_0x6fa2('0x52')](_0x5b8809);}})[_0x6fa2('0x29')](function(_0x1d9e7c){if(_0x1d9e7c){return _0x1d9e7c?{'count':_0x3e94db,'rows':_0x1d9e7c}:null;}})['then'](respondWithResult(_0x508bff,null))['catch'](handleError(_0x508bff,null));};exports['getSubjects']=function(_0x36c0b8,_0x67a7bc,_0xccc1ec){var _0x32746d={};var _0x14ea71={};var _0x2c9339;var _0x4c8b8c;return db[_0x6fa2('0x30')][_0x6fa2('0x4f')]({'where':{'id':_0x36c0b8[_0x6fa2('0x4b')]['id']}})[_0x6fa2('0x29')](handleEntityNotFound(_0x67a7bc,null))[_0x6fa2('0x29')](function(_0x3ef1f4){if(_0x3ef1f4){_0x2c9339=_0x3ef1f4;_0x14ea71[_0x6fa2('0x33')]=_[_0x6fa2('0x35')](db[_0x6fa2('0x50')][_0x6fa2('0x31')]);_0x14ea71['query']=_[_0x6fa2('0x35')](_0x36c0b8['query']);_0x14ea71['filters']=_[_0x6fa2('0x37')](_0x14ea71['model'],_0x14ea71['query']);_0x32746d[_0x6fa2('0x38')]=_[_0x6fa2('0x37')](_0x14ea71[_0x6fa2('0x33')],qs[_0x6fa2('0x39')](_0x36c0b8[_0x6fa2('0x34')][_0x6fa2('0x39')]));_0x32746d[_0x6fa2('0x38')]=_0x32746d[_0x6fa2('0x38')][_0x6fa2('0x3a')]?_0x32746d[_0x6fa2('0x38')]:_0x14ea71[_0x6fa2('0x33')];_0x32746d[_0x6fa2('0x51')]=qs[_0x6fa2('0x3d')](_0x36c0b8[_0x6fa2('0x34')][_0x6fa2('0x3d')]);_0x32746d['where']=qs['filters'](_['pick'](_0x36c0b8[_0x6fa2('0x34')],_0x14ea71['filters']));if(_0x36c0b8['query']['filter']){_0x32746d['where']=_['merge'](_0x32746d[_0x6fa2('0x3e')],{'$or':_['map'](_0x32746d[_0x6fa2('0x38')],function(_0x3054ee){var _0x174a5c={};_0x174a5c[_0x3054ee]={'$like':'%'+_0x36c0b8[_0x6fa2('0x34')][_0x6fa2('0x40')]+'%'};return _0x174a5c;})});}_0x32746d=_['merge']({},_0x32746d,_0x36c0b8[_0x6fa2('0x44')]);return _0x2c9339[_0x6fa2('0x53')](_0x32746d);}})[_0x6fa2('0x29')](function(_0x51e635){if(_0x51e635){_0x4c8b8c=_0x51e635[_0x6fa2('0x3a')];if(!_0x36c0b8['query'][_0x6fa2('0x3b')](_0x6fa2('0x3c'))){_0x32746d[_0x6fa2('0x1f')]=qs['limit'](_0x36c0b8[_0x6fa2('0x34')][_0x6fa2('0x1f')]);_0x32746d[_0x6fa2('0x21')]=qs['offset'](_0x36c0b8[_0x6fa2('0x34')]['offset']);}return _0x2c9339[_0x6fa2('0x53')](_0x32746d);}})['then'](function(_0x7146ca){if(_0x7146ca){return _0x7146ca?{'count':_0x4c8b8c,'rows':_0x7146ca}:null;}})['then'](respondWithResult(_0x67a7bc,null))['catch'](handleError(_0x67a7bc,null));};exports[_0x6fa2('0x54')]=function(_0x55a59f,_0x38598d,_0x40f114){var _0x355d01={};var _0x4b8fe2={};var _0x37eaa2;var _0x49cbde;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x55a59f[_0x6fa2('0x4b')]['id']}})[_0x6fa2('0x29')](handleEntityNotFound(_0x38598d,null))[_0x6fa2('0x29')](function(_0x31e6fc){if(_0x31e6fc){_0x37eaa2=_0x31e6fc;_0x4b8fe2[_0x6fa2('0x33')]=_['keys'](db[_0x6fa2('0x50')][_0x6fa2('0x31')]);_0x4b8fe2['query']=_[_0x6fa2('0x35')](_0x55a59f[_0x6fa2('0x34')]);_0x4b8fe2[_0x6fa2('0x36')]=_[_0x6fa2('0x37')](_0x4b8fe2['model'],_0x4b8fe2[_0x6fa2('0x34')]);_0x355d01[_0x6fa2('0x38')]=_[_0x6fa2('0x37')](_0x4b8fe2[_0x6fa2('0x33')],qs[_0x6fa2('0x39')](_0x55a59f[_0x6fa2('0x34')][_0x6fa2('0x39')]));_0x355d01['attributes']=_0x355d01[_0x6fa2('0x38')][_0x6fa2('0x3a')]?_0x355d01[_0x6fa2('0x38')]:_0x4b8fe2[_0x6fa2('0x33')];_0x355d01['order']=qs[_0x6fa2('0x3d')](_0x55a59f[_0x6fa2('0x34')][_0x6fa2('0x3d')]);_0x355d01[_0x6fa2('0x3e')]=qs[_0x6fa2('0x36')](_[_0x6fa2('0x3f')](_0x55a59f[_0x6fa2('0x34')],_0x4b8fe2['filters']));if(_0x55a59f['query'][_0x6fa2('0x40')]){_0x355d01[_0x6fa2('0x3e')]=_[_0x6fa2('0x41')](_0x355d01[_0x6fa2('0x3e')],{'$or':_[_0x6fa2('0x2f')](_0x355d01['attributes'],function(_0xd5376b){var _0xaa40bc={};_0xaa40bc[_0xd5376b]={'$like':'%'+_0x55a59f['query'][_0x6fa2('0x40')]+'%'};return _0xaa40bc;})});}_0x355d01=_[_0x6fa2('0x41')]({},_0x355d01,_0x55a59f[_0x6fa2('0x44')]);return _0x37eaa2[_0x6fa2('0x54')](_0x355d01);}})[_0x6fa2('0x29')](function(_0x829293){if(_0x829293){_0x49cbde=_0x829293['length'];if(!_0x55a59f['query'][_0x6fa2('0x3b')](_0x6fa2('0x3c'))){_0x355d01[_0x6fa2('0x1f')]=qs[_0x6fa2('0x1f')](_0x55a59f[_0x6fa2('0x34')]['limit']);_0x355d01[_0x6fa2('0x21')]=qs[_0x6fa2('0x21')](_0x55a59f[_0x6fa2('0x34')][_0x6fa2('0x21')]);}return _0x37eaa2[_0x6fa2('0x54')](_0x355d01);}})['then'](function(_0x425cee){if(_0x425cee){return _0x425cee?{'count':_0x49cbde,'rows':_0x425cee}:null;}})[_0x6fa2('0x29')](respondWithResult(_0x38598d,null))[_0x6fa2('0x49')](handleError(_0x38598d,null));};
\ No newline at end of file
index 1d83ae4..4e18550 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['int_dynamics365_configurations','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./intDynamics365Configuration.attributes'];(function(_0xae03ec,_0x126329){var _0x26b415=function(_0x287564){while(--_0x287564){_0xae03ec['push'](_0xae03ec['shift']());}};_0x26b415(++_0x126329);}(_0x70e0,0x17b));var _0x070e=function(_0x523ad4,_0x20f312){_0x523ad4=_0x523ad4-0x0;var _0x16e865=_0x70e0[_0x523ad4];return _0x16e865;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('Dynamics365Configuration',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdace=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x257805,_0x5583aa){var _0x5e21e9=function(_0x478a56){while(--_0x478a56){_0x257805['push'](_0x257805['shift']());}};_0x5e21e9(++_0x5583aa);}(_0xdace,0xc5));var _0xedac=function(_0x2d9c6a,_0x59393d){_0x2d9c6a=_0x2d9c6a-0x0;var _0xf3c918=_0xdace[_0x2d9c6a];return _0xf3c918;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var logger=require(_0xedac('0x1'))(_0xedac('0x2'));var moment=require(_0xedac('0x3'));var BPromise=require('bluebird');var rp=require(_0xedac('0x4'));var fs=require('fs');var path=require(_0xedac('0x5'));var rimraf=require(_0xedac('0x6'));var config=require(_0xedac('0x7'));var attributes=require('./intDynamics365Configuration.attributes');module[_0xedac('0x8')]=function(_0x1cba89,_0x39328a){return _0x1cba89['define'](_0xedac('0x9'),attributes,{'tableName':_0xedac('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f8c6a4d..4bec673 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bb9=['info','catch','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','request\x20sent','debug','stringify','error','Dynamics365Configuration,\x20%s,\x20%s','message'];(function(_0x1fbc17,_0xb0627){var _0x2dfec1=function(_0x1593bf){while(--_0x1593bf){_0x1fbc17['push'](_0x1fbc17['shift']());}};_0x2dfec1(++_0xb0627);}(_0x4bb9,0x18e));var _0x94bb=function(_0x476b8b,_0x24942a){_0x476b8b=_0x476b8b-0x0;var _0x5628d2=_0x4bb9[_0x476b8b];return _0x5628d2;};'use strict';var _=require('lodash');var util=require(_0x94bb('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x94bb('0x1'));var db=require(_0x94bb('0x2'))['db'];var utils=require(_0x94bb('0x3'));var logger=require(_0x94bb('0x4'))(_0x94bb('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x94bb('0x6')][_0x94bb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x22e496,_0x524fc1,_0x1287a5){return new BPromise(function(_0xe80445,_0x20d597){return client[_0x94bb('0x8')](_0x22e496,_0x1287a5)[_0x94bb('0x9')](function(_0x85670d){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x524fc1,_0x94bb('0xa'));logger[_0x94bb('0xb')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0x524fc1,_0x94bb('0xa'),JSON[_0x94bb('0xc')](_0x85670d));if(_0x85670d['error']){if(_0x85670d[_0x94bb('0xd')]['code']===0x1f4){logger['error'](_0x94bb('0xe'),_0x524fc1,_0x85670d[_0x94bb('0xd')][_0x94bb('0xf')]);return _0x20d597(_0x85670d[_0x94bb('0xd')]['message']);}logger[_0x94bb('0xd')](_0x94bb('0xe'),_0x524fc1,_0x85670d[_0x94bb('0xd')][_0x94bb('0xf')]);return _0xe80445(_0x85670d[_0x94bb('0xd')][_0x94bb('0xf')]);}else{logger[_0x94bb('0x10')](_0x94bb('0xe'),_0x524fc1,_0x94bb('0xa'));_0xe80445(_0x85670d['result'][_0x94bb('0xf')]);}})[_0x94bb('0x11')](function(_0x5650c3){logger['error'](_0x94bb('0xe'),_0x524fc1,_0x5650c3);_0x20d597(_0x5650c3);});});}
\ No newline at end of file
+var _0xf2e1=['../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x2dee81,_0x58c3df){var _0xa3a214=function(_0x459326){while(--_0x459326){_0x2dee81['push'](_0x2dee81['shift']());}};_0xa3a214(++_0x58c3df);}(_0xf2e1,0x74));var _0x1f2e=function(_0x1fc447,_0x151365){_0x1fc447=_0x1fc447-0x0;var _0x1c98af=_0xf2e1[_0x1fc447];return _0x1c98af;};'use strict';var _=require('lodash');var util=require(_0x1f2e('0x0'));var moment=require(_0x1f2e('0x1'));var BPromise=require(_0x1f2e('0x2'));var rs=require(_0x1f2e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f2e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1f2e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1f2e('0x6'));var client=jayson[_0x1f2e('0x7')][_0x1f2e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2ced6e,_0x5bb74e,_0x2c3276){return new BPromise(function(_0x3fab52,_0x5a06be){return client[_0x1f2e('0x9')](_0x2ced6e,_0x2c3276)[_0x1f2e('0xa')](function(_0x2af391){logger['info'](_0x1f2e('0xb'),_0x5bb74e,_0x1f2e('0xc'));logger[_0x1f2e('0xd')](_0x1f2e('0xe'),_0x5bb74e,_0x1f2e('0xc'),JSON[_0x1f2e('0xf')](_0x2af391));if(_0x2af391[_0x1f2e('0x10')]){if(_0x2af391['error']['code']===0x1f4){logger[_0x1f2e('0x10')](_0x1f2e('0xb'),_0x5bb74e,_0x2af391[_0x1f2e('0x10')][_0x1f2e('0x11')]);return _0x5a06be(_0x2af391['error'][_0x1f2e('0x11')]);}logger[_0x1f2e('0x10')](_0x1f2e('0xb'),_0x5bb74e,_0x2af391[_0x1f2e('0x10')]['message']);return _0x3fab52(_0x2af391[_0x1f2e('0x10')][_0x1f2e('0x11')]);}else{logger['info'](_0x1f2e('0xb'),_0x5bb74e,_0x1f2e('0xc'));_0x3fab52(_0x2af391[_0x1f2e('0x12')][_0x1f2e('0x11')]);}})[_0x1f2e('0x13')](function(_0x3b1ee4){logger[_0x1f2e('0x10')](_0x1f2e('0xb'),_0x5bb74e,_0x3b1ee4);_0x5a06be(_0x3b1ee4);});});}
\ No newline at end of file
index 8400424..8d62fbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7673=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','update','delete','destroy','exports','path','connect-timeout','Router','../../components/auth/service'];(function(_0x4b51df,_0x53d013){var _0x534cd6=function(_0x303f87){while(--_0x303f87){_0x4b51df['push'](_0x4b51df['shift']());}};_0x534cd6(++_0x53d013);}(_0x7673,0x6c));var _0x3767=function(_0x5c6244,_0x112ab8){_0x5c6244=_0x5c6244-0x0;var _0x5800ce=_0x7673[_0x5c6244];return _0x5800ce;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3767('0x0'));var timeout=require(_0x3767('0x1'));var express=require('express');var router=express[_0x3767('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x3767('0x3'));var interaction=require(_0x3767('0x4'));var config=require(_0x3767('0x5'));var controller=require('./intDynamics365Field.controller');router[_0x3767('0x6')]('/',auth[_0x3767('0x7')](),controller[_0x3767('0x8')]);router[_0x3767('0x6')](_0x3767('0x9'),auth[_0x3767('0x7')](),controller['show']);router[_0x3767('0xa')]('/',auth[_0x3767('0x7')](),controller[_0x3767('0xb')]);router['put'](_0x3767('0x9'),auth[_0x3767('0x7')](),controller[_0x3767('0xc')]);router[_0x3767('0xd')](_0x3767('0x9'),auth[_0x3767('0x7')](),controller[_0x3767('0xe')]);module[_0x3767('0xf')]=router;
\ No newline at end of file
+var _0x1a0a=['get','index','show','post','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller'];(function(_0x258e7f,_0x489a5f){var _0x3aea47=function(_0x38b343){while(--_0x38b343){_0x258e7f['push'](_0x258e7f['shift']());}};_0x3aea47(++_0x489a5f);}(_0x1a0a,0x19b));var _0xa1a0=function(_0x572165,_0x6a45cc){_0x572165=_0x572165-0x0;var _0x8c8709=_0x1a0a[_0x572165];return _0x8c8709;};'use strict';var multer=require(_0xa1a0('0x0'));var util=require('util');var path=require(_0xa1a0('0x1'));var timeout=require(_0xa1a0('0x2'));var express=require('express');var router=express[_0xa1a0('0x3')]();var fs_extra=require(_0xa1a0('0x4'));var auth=require(_0xa1a0('0x5'));var interaction=require(_0xa1a0('0x6'));var config=require(_0xa1a0('0x7'));var controller=require(_0xa1a0('0x8'));router[_0xa1a0('0x9')]('/',auth['isAuthenticated'](),controller[_0xa1a0('0xa')]);router[_0xa1a0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xa1a0('0xb')]);router[_0xa1a0('0xc')]('/',auth[_0xa1a0('0xd')](),controller[_0xa1a0('0xe')]);router[_0xa1a0('0xf')](_0xa1a0('0x10'),auth[_0xa1a0('0xd')](),controller[_0xa1a0('0x11')]);router[_0xa1a0('0x12')](_0xa1a0('0x10'),auth[_0xa1a0('0xd')](),controller[_0xa1a0('0x13')]);module[_0xa1a0('0x14')]=router;
\ No newline at end of file
index 0d4ba85..d5996de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6347=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x15cdcb,_0x4340e9){var _0x37b069=function(_0x304cfb){while(--_0x304cfb){_0x15cdcb['push'](_0x15cdcb['shift']());}};_0x37b069(++_0x4340e9);}(_0x6347,0x73));var _0x7634=function(_0xa0cdfe,_0x230408){_0xa0cdfe=_0xa0cdfe-0x0;var _0x17470b=_0x6347[_0xa0cdfe];return _0x17470b;};'use strict';var Sequelize=require(_0x7634('0x0'));module[_0x7634('0x1')]={'type':{'type':Sequelize[_0x7634('0x2')](_0x7634('0x3'),_0x7634('0x4'),_0x7634('0x5'),_0x7634('0x6'),_0x7634('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x7634('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x7634('0x3'),_0x7634('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7634('0x8')]},'nameField':{'type':Sequelize[_0x7634('0x8')]},'customField':{'type':Sequelize[_0x7634('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7634('0x8')]}};
\ No newline at end of file
+var _0x3c96=['keyValue','picklist','STRING','ENUM','sequelize','exports','string','variable','customVariable'];(function(_0xeb0250,_0x3ab3a9){var _0x56bb03=function(_0x4ed91b){while(--_0x4ed91b){_0xeb0250['push'](_0xeb0250['shift']());}};_0x56bb03(++_0x3ab3a9);}(_0x3c96,0x11b));var _0x63c9=function(_0x58ed49,_0x444ae4){_0x58ed49=_0x58ed49-0x0;var _0x179f27=_0x3c96[_0x58ed49];return _0x179f27;};'use strict';var Sequelize=require(_0x63c9('0x0'));module[_0x63c9('0x1')]={'type':{'type':Sequelize['ENUM'](_0x63c9('0x2'),_0x63c9('0x3'),_0x63c9('0x4'),_0x63c9('0x5'),_0x63c9('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x63c9('0x7')]},'key':{'type':Sequelize[_0x63c9('0x7')]},'keyType':{'type':Sequelize[_0x63c9('0x8')](_0x63c9('0x2'),_0x63c9('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x63c9('0x7')]},'nameField':{'type':Sequelize[_0x63c9('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x63c9('0x7')]}};
\ No newline at end of file
index 8c35536..5813179 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8a5=['stack','name','Dynamics365Field','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','find','create','body','params','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then'];(function(_0x2fb437,_0x24d8c7){var _0x431640=function(_0x23bf0e){while(--_0x23bf0e){_0x2fb437['push'](_0x2fb437['shift']());}};_0x431640(++_0x24d8c7);}(_0xd8a5,0x195));var _0x5d8a=function(_0xc0b795,_0x462a55){_0xc0b795=_0xc0b795-0x0;var _0x3500ed=_0xd8a5[_0xc0b795];return _0x3500ed;};'use strict';var emlformat=require(_0x5d8a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5d8a('0x1'));var jsonpatch=require(_0x5d8a('0x2'));var rp=require(_0x5d8a('0x3'));var moment=require(_0x5d8a('0x4'));var BPromise=require(_0x5d8a('0x5'));var Mustache=require('mustache');var util=require(_0x5d8a('0x6'));var path=require(_0x5d8a('0x7'));var sox=require(_0x5d8a('0x8'));var csv=require(_0x5d8a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5d8a('0xa'));var _=require(_0x5d8a('0xb'));var squel=require(_0x5d8a('0xc'));var crypto=require(_0x5d8a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5d8a('0xe'));var toCsv=require(_0x5d8a('0x9'));var querystring=require('querystring');var Papa=require(_0x5d8a('0xf'));var Redis=require(_0x5d8a('0x10'));var authService=require(_0x5d8a('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5d8a('0x12'));var hardwareService=require(_0x5d8a('0x13'));var logger=require(_0x5d8a('0x14'))(_0x5d8a('0x15'));var utils=require(_0x5d8a('0x16'));var config=require(_0x5d8a('0x17'));var licenseUtil=require(_0x5d8a('0x18'));var db=require(_0x5d8a('0x19'))['db'];function respondWithStatusCode(_0x22000e,_0x31eae5){_0x31eae5=_0x31eae5||0xcc;return function(_0x37c2c8){if(_0x37c2c8){return _0x22000e[_0x5d8a('0x1a')](_0x31eae5);}return _0x22000e[_0x5d8a('0x1b')](_0x31eae5)[_0x5d8a('0x1c')]();};}function respondWithResult(_0xa15b6,_0x3fcb62){_0x3fcb62=_0x3fcb62||0xc8;return function(_0x107e37){if(_0x107e37){return _0xa15b6[_0x5d8a('0x1b')](_0x3fcb62)['json'](_0x107e37);}};}function respondWithFilteredResult(_0x3c43b3,_0x484a00){return function(_0x5386f2){if(_0x5386f2){var _0x756ee9=typeof _0x484a00[_0x5d8a('0x1d')]===_0x5d8a('0x1e')&&typeof _0x484a00[_0x5d8a('0x1f')]===_0x5d8a('0x1e');var _0xe00dae=_0x5386f2[_0x5d8a('0x20')];var _0x2c7e3e=_0x756ee9?0x0:_0x484a00[_0x5d8a('0x1d')];var _0x150f96=_0x756ee9?_0x5386f2[_0x5d8a('0x20')]:_0x484a00[_0x5d8a('0x1d')]+_0x484a00['limit'];var _0x1fca20;if(_0x150f96>=_0xe00dae){_0x150f96=_0xe00dae;_0x1fca20=0xc8;}else{_0x1fca20=0xce;}_0x3c43b3['status'](_0x1fca20);return _0x3c43b3['set'](_0x5d8a('0x21'),_0x2c7e3e+'-'+_0x150f96+'/'+_0xe00dae)['json'](_0x5386f2);}return null;};}function patchUpdates(_0x2a862b){return function(_0x41f67a){try{jsonpatch[_0x5d8a('0x22')](_0x41f67a,_0x2a862b,!![]);}catch(_0x3be05b){return BPromise[_0x5d8a('0x23')](_0x3be05b);}return _0x41f67a[_0x5d8a('0x24')]();};}function saveUpdates(_0x454871,_0x40bb96){return function(_0x394b2a){if(_0x394b2a){return _0x394b2a[_0x5d8a('0x25')](_0x454871)[_0x5d8a('0x26')](function(_0x3916de){return _0x3916de;});}return null;};}function removeEntity(_0x240c92,_0x84b9ed){return function(_0x5612d1){if(_0x5612d1){return _0x5612d1['destroy']()['then'](function(){_0x240c92[_0x5d8a('0x1b')](0xcc)[_0x5d8a('0x1c')]();});}};}function handleEntityNotFound(_0x444b4d,_0x22eeb0){return function(_0x20fba2){if(!_0x20fba2){_0x444b4d['sendStatus'](0x194);}return _0x20fba2;};}function handleError(_0x43d7d6,_0x383a85){_0x383a85=_0x383a85||0x1f4;return function(_0x425ee7){logger['error'](_0x425ee7[_0x5d8a('0x27')]);if(_0x425ee7['name']){delete _0x425ee7[_0x5d8a('0x28')];}_0x43d7d6[_0x5d8a('0x1b')](_0x383a85)['send'](_0x425ee7);};}exports['index']=function(_0x4f7d2e,_0x329742){var _0x51fa65={},_0x1c8f78={},_0x4a68e2={'count':0x0,'rows':[]};var _0x9d5eaf=_['map'](db[_0x5d8a('0x29')][_0x5d8a('0x2a')],function(_0x234b84){return{'name':_0x234b84[_0x5d8a('0x2b')],'type':_0x234b84['type'][_0x5d8a('0x2c')]};});_0x1c8f78[_0x5d8a('0x2d')]=_[_0x5d8a('0x2e')](_0x9d5eaf,_0x5d8a('0x28'));_0x1c8f78['query']=_[_0x5d8a('0x2f')](_0x4f7d2e[_0x5d8a('0x30')]);_0x1c8f78[_0x5d8a('0x31')]=_[_0x5d8a('0x32')](_0x1c8f78[_0x5d8a('0x2d')],_0x1c8f78[_0x5d8a('0x30')]);_0x51fa65[_0x5d8a('0x33')]=_[_0x5d8a('0x32')](_0x1c8f78[_0x5d8a('0x2d')],qs[_0x5d8a('0x34')](_0x4f7d2e['query']['fields']));_0x51fa65[_0x5d8a('0x33')]=_0x51fa65[_0x5d8a('0x33')][_0x5d8a('0x35')]?_0x51fa65[_0x5d8a('0x33')]:_0x1c8f78[_0x5d8a('0x2d')];if(!_0x4f7d2e[_0x5d8a('0x30')][_0x5d8a('0x36')](_0x5d8a('0x37'))){_0x51fa65[_0x5d8a('0x1f')]=qs['limit'](_0x4f7d2e[_0x5d8a('0x30')]['limit']);_0x51fa65[_0x5d8a('0x1d')]=qs[_0x5d8a('0x1d')](_0x4f7d2e[_0x5d8a('0x30')]['offset']);}_0x51fa65[_0x5d8a('0x38')]=qs[_0x5d8a('0x39')](_0x4f7d2e[_0x5d8a('0x30')][_0x5d8a('0x39')]);_0x51fa65[_0x5d8a('0x3a')]=qs[_0x5d8a('0x31')](_['pick'](_0x4f7d2e['query'],_0x1c8f78[_0x5d8a('0x31')]),_0x9d5eaf);if(_0x4f7d2e[_0x5d8a('0x30')][_0x5d8a('0x3b')]){_0x51fa65[_0x5d8a('0x3a')]=_[_0x5d8a('0x3c')](_0x51fa65['where'],{'$or':_[_0x5d8a('0x2e')](_0x9d5eaf,function(_0x2c8b8d){if(_0x2c8b8d[_0x5d8a('0x3d')]!==_0x5d8a('0x3e')){var _0x3784c8={};_0x3784c8[_0x2c8b8d[_0x5d8a('0x28')]]={'$like':'%'+_0x4f7d2e[_0x5d8a('0x30')][_0x5d8a('0x3b')]+'%'};return _0x3784c8;}})});}_0x51fa65=_[_0x5d8a('0x3c')]({},_0x51fa65,_0x4f7d2e[_0x5d8a('0x3f')]);var _0x49829a={'where':_0x51fa65[_0x5d8a('0x3a')]};return db[_0x5d8a('0x29')][_0x5d8a('0x20')](_0x49829a)[_0x5d8a('0x26')](function(_0x4edc65){_0x4a68e2['count']=_0x4edc65;if(_0x4f7d2e[_0x5d8a('0x30')][_0x5d8a('0x40')]){_0x51fa65[_0x5d8a('0x41')]=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0x51fa65);})['then'](function(_0x5ab7a7){_0x4a68e2[_0x5d8a('0x42')]=_0x5ab7a7;return _0x4a68e2;})[_0x5d8a('0x26')](respondWithFilteredResult(_0x329742,_0x51fa65))[_0x5d8a('0x43')](handleError(_0x329742,null));};exports[_0x5d8a('0x44')]=function(_0x111e71,_0x5e12f0){var _0x2e012b={'raw':!![],'where':{'id':_0x111e71['params']['id']}},_0x494f8f={};_0x494f8f[_0x5d8a('0x2d')]=_[_0x5d8a('0x2f')](db[_0x5d8a('0x29')][_0x5d8a('0x2a')]);_0x494f8f[_0x5d8a('0x30')]=_[_0x5d8a('0x2f')](_0x111e71['query']);_0x494f8f[_0x5d8a('0x31')]=_[_0x5d8a('0x32')](_0x494f8f[_0x5d8a('0x2d')],_0x494f8f[_0x5d8a('0x30')]);_0x2e012b[_0x5d8a('0x33')]=_[_0x5d8a('0x32')](_0x494f8f['model'],qs[_0x5d8a('0x34')](_0x111e71[_0x5d8a('0x30')]['fields']));_0x2e012b[_0x5d8a('0x33')]=_0x2e012b[_0x5d8a('0x33')][_0x5d8a('0x35')]?_0x2e012b[_0x5d8a('0x33')]:_0x494f8f[_0x5d8a('0x2d')];if(_0x111e71['query']['includeAll']){_0x2e012b[_0x5d8a('0x41')]=[{'all':!![]}];}_0x2e012b=_['merge']({},_0x2e012b,_0x111e71[_0x5d8a('0x3f')]);return db['Dynamics365Field'][_0x5d8a('0x45')](_0x2e012b)['then'](handleEntityNotFound(_0x5e12f0,null))[_0x5d8a('0x26')](respondWithResult(_0x5e12f0,null))[_0x5d8a('0x43')](handleError(_0x5e12f0,null));};exports[_0x5d8a('0x46')]=function(_0x3ec3e1,_0x27c0e9){return db['Dynamics365Field'][_0x5d8a('0x46')](_0x3ec3e1[_0x5d8a('0x47')],{})[_0x5d8a('0x26')](respondWithResult(_0x27c0e9,0xc9))['catch'](handleError(_0x27c0e9,null));};exports['update']=function(_0x1401e2,_0x2386b5){if(_0x1401e2[_0x5d8a('0x47')]['id']){delete _0x1401e2[_0x5d8a('0x47')]['id'];}return db[_0x5d8a('0x29')]['find']({'where':{'id':_0x1401e2[_0x5d8a('0x48')]['id']}})[_0x5d8a('0x26')](handleEntityNotFound(_0x2386b5,null))[_0x5d8a('0x26')](saveUpdates(_0x1401e2[_0x5d8a('0x47')],null))['then'](respondWithResult(_0x2386b5,null))['catch'](handleError(_0x2386b5,null));};exports[_0x5d8a('0x49')]=function(_0x5301df,_0x5709ca){return db[_0x5d8a('0x29')][_0x5d8a('0x45')]({'where':{'id':_0x5301df['params']['id']}})['then'](handleEntityNotFound(_0x5709ca,null))['then'](removeEntity(_0x5709ca,null))[_0x5d8a('0x43')](handleError(_0x5709ca,null));};
\ No newline at end of file
+var _0x32e7=['undefined','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','map','Dynamics365Field','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','count','includeAll','include','findAll','catch','show','params','find','body','eml-format','fast-json-patch','moment','util','path','sox','to-csv','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','status','json','offset','limit'];(function(_0x4a09eb,_0x13c38f){var _0x52f650=function(_0x21fde2){while(--_0x21fde2){_0x4a09eb['push'](_0x4a09eb['shift']());}};_0x52f650(++_0x13c38f);}(_0x32e7,0x100));var _0x732e=function(_0x98c0fe,_0x520dc7){_0x98c0fe=_0x98c0fe-0x0;var _0x5eafe2=_0x32e7[_0x98c0fe];return _0x5eafe2;};'use strict';var emlformat=require(_0x732e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x732e('0x1'));var rp=require('request-promise');var moment=require(_0x732e('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x732e('0x3'));var path=require(_0x732e('0x4'));var sox=require(_0x732e('0x5'));var csv=require(_0x732e('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x732e('0x7'));var _=require(_0x732e('0x8'));var squel=require(_0x732e('0x9'));var crypto=require(_0x732e('0xa'));var jsforce=require(_0x732e('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x732e('0xc'));var Papa=require(_0x732e('0xd'));var Redis=require(_0x732e('0xe'));var authService=require(_0x732e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x732e('0x10'));var hardwareService=require(_0x732e('0x11'));var logger=require(_0x732e('0x12'))(_0x732e('0x13'));var utils=require(_0x732e('0x14'));var config=require(_0x732e('0x15'));var licenseUtil=require(_0x732e('0x16'));var db=require(_0x732e('0x17'))['db'];function respondWithStatusCode(_0x5aa4c2,_0x182e3c){_0x182e3c=_0x182e3c||0xcc;return function(_0x5728a2){if(_0x5728a2){return _0x5aa4c2['sendStatus'](_0x182e3c);}return _0x5aa4c2[_0x732e('0x18')](_0x182e3c)['end']();};}function respondWithResult(_0x32f964,_0x564863){_0x564863=_0x564863||0xc8;return function(_0x23cedb){if(_0x23cedb){return _0x32f964['status'](_0x564863)[_0x732e('0x19')](_0x23cedb);}};}function respondWithFilteredResult(_0x1a46c7,_0x29a74a){return function(_0x2dc825){if(_0x2dc825){var _0x570367=typeof _0x29a74a[_0x732e('0x1a')]==='undefined'&&typeof _0x29a74a[_0x732e('0x1b')]===_0x732e('0x1c');var _0x56d854=_0x2dc825['count'];var _0x3169f6=_0x570367?0x0:_0x29a74a['offset'];var _0xc5c925=_0x570367?_0x2dc825['count']:_0x29a74a[_0x732e('0x1a')]+_0x29a74a[_0x732e('0x1b')];var _0x5a3698;if(_0xc5c925>=_0x56d854){_0xc5c925=_0x56d854;_0x5a3698=0xc8;}else{_0x5a3698=0xce;}_0x1a46c7[_0x732e('0x18')](_0x5a3698);return _0x1a46c7['set'](_0x732e('0x1d'),_0x3169f6+'-'+_0xc5c925+'/'+_0x56d854)[_0x732e('0x19')](_0x2dc825);}return null;};}function patchUpdates(_0x3d04d4){return function(_0x3abb2b){try{jsonpatch[_0x732e('0x1e')](_0x3abb2b,_0x3d04d4,!![]);}catch(_0x31dd4f){return BPromise[_0x732e('0x1f')](_0x31dd4f);}return _0x3abb2b[_0x732e('0x20')]();};}function saveUpdates(_0x572279,_0x1cd98f){return function(_0x3cea9f){if(_0x3cea9f){return _0x3cea9f[_0x732e('0x21')](_0x572279)['then'](function(_0x5c0bf9){return _0x5c0bf9;});}return null;};}function removeEntity(_0x5aa503,_0x1cf5a9){return function(_0x1c4396){if(_0x1c4396){return _0x1c4396[_0x732e('0x22')]()[_0x732e('0x23')](function(){_0x5aa503[_0x732e('0x18')](0xcc)[_0x732e('0x24')]();});}};}function handleEntityNotFound(_0x57f1e7,_0x2a2b0c){return function(_0x5a108e){if(!_0x5a108e){_0x57f1e7['sendStatus'](0x194);}return _0x5a108e;};}function handleError(_0x4cafdb,_0x3f10bd){_0x3f10bd=_0x3f10bd||0x1f4;return function(_0x40dc11){logger[_0x732e('0x25')](_0x40dc11[_0x732e('0x26')]);if(_0x40dc11['name']){delete _0x40dc11['name'];}_0x4cafdb['status'](_0x3f10bd)['send'](_0x40dc11);};}exports['index']=function(_0x29324f,_0x5186e8){var _0x2d0371={},_0x49537d={},_0xc0ab01={'count':0x0,'rows':[]};var _0x145044=_[_0x732e('0x27')](db[_0x732e('0x28')][_0x732e('0x29')],function(_0x2590e8){return{'name':_0x2590e8[_0x732e('0x2a')],'type':_0x2590e8[_0x732e('0x2b')][_0x732e('0x2c')]};});_0x49537d['model']=_[_0x732e('0x27')](_0x145044,'name');_0x49537d[_0x732e('0x2d')]=_[_0x732e('0x2e')](_0x29324f[_0x732e('0x2d')]);_0x49537d['filters']=_[_0x732e('0x2f')](_0x49537d[_0x732e('0x30')],_0x49537d['query']);_0x2d0371[_0x732e('0x31')]=_[_0x732e('0x2f')](_0x49537d[_0x732e('0x30')],qs[_0x732e('0x32')](_0x29324f[_0x732e('0x2d')][_0x732e('0x32')]));_0x2d0371['attributes']=_0x2d0371[_0x732e('0x31')][_0x732e('0x33')]?_0x2d0371[_0x732e('0x31')]:_0x49537d[_0x732e('0x30')];if(!_0x29324f[_0x732e('0x2d')][_0x732e('0x34')](_0x732e('0x35'))){_0x2d0371[_0x732e('0x1b')]=qs['limit'](_0x29324f[_0x732e('0x2d')][_0x732e('0x1b')]);_0x2d0371[_0x732e('0x1a')]=qs['offset'](_0x29324f[_0x732e('0x2d')][_0x732e('0x1a')]);}_0x2d0371[_0x732e('0x36')]=qs[_0x732e('0x37')](_0x29324f[_0x732e('0x2d')][_0x732e('0x37')]);_0x2d0371[_0x732e('0x38')]=qs['filters'](_[_0x732e('0x39')](_0x29324f[_0x732e('0x2d')],_0x49537d[_0x732e('0x3a')]),_0x145044);if(_0x29324f[_0x732e('0x2d')][_0x732e('0x3b')]){_0x2d0371[_0x732e('0x38')]=_[_0x732e('0x3c')](_0x2d0371[_0x732e('0x38')],{'$or':_[_0x732e('0x27')](_0x145044,function(_0x127f50){if(_0x127f50[_0x732e('0x2b')]!==_0x732e('0x3d')){var _0x1f486b={};_0x1f486b[_0x127f50['name']]={'$like':'%'+_0x29324f[_0x732e('0x2d')][_0x732e('0x3b')]+'%'};return _0x1f486b;}})});}_0x2d0371=_[_0x732e('0x3c')]({},_0x2d0371,_0x29324f['options']);var _0x14344b={'where':_0x2d0371[_0x732e('0x38')]};return db[_0x732e('0x28')][_0x732e('0x3e')](_0x14344b)[_0x732e('0x23')](function(_0x3ce2c9){_0xc0ab01['count']=_0x3ce2c9;if(_0x29324f[_0x732e('0x2d')][_0x732e('0x3f')]){_0x2d0371[_0x732e('0x40')]=[{'all':!![]}];}return db[_0x732e('0x28')][_0x732e('0x41')](_0x2d0371);})[_0x732e('0x23')](function(_0x131fd3){_0xc0ab01['rows']=_0x131fd3;return _0xc0ab01;})['then'](respondWithFilteredResult(_0x5186e8,_0x2d0371))[_0x732e('0x42')](handleError(_0x5186e8,null));};exports[_0x732e('0x43')]=function(_0x332d76,_0x59550d){var _0x3d9679={'raw':!![],'where':{'id':_0x332d76[_0x732e('0x44')]['id']}},_0x3e45c8={};_0x3e45c8['model']=_[_0x732e('0x2e')](db['Dynamics365Field']['rawAttributes']);_0x3e45c8[_0x732e('0x2d')]=_[_0x732e('0x2e')](_0x332d76[_0x732e('0x2d')]);_0x3e45c8[_0x732e('0x3a')]=_[_0x732e('0x2f')](_0x3e45c8[_0x732e('0x30')],_0x3e45c8[_0x732e('0x2d')]);_0x3d9679[_0x732e('0x31')]=_[_0x732e('0x2f')](_0x3e45c8[_0x732e('0x30')],qs['fields'](_0x332d76[_0x732e('0x2d')][_0x732e('0x32')]));_0x3d9679[_0x732e('0x31')]=_0x3d9679[_0x732e('0x31')][_0x732e('0x33')]?_0x3d9679[_0x732e('0x31')]:_0x3e45c8[_0x732e('0x30')];if(_0x332d76[_0x732e('0x2d')][_0x732e('0x3f')]){_0x3d9679[_0x732e('0x40')]=[{'all':!![]}];}_0x3d9679=_[_0x732e('0x3c')]({},_0x3d9679,_0x332d76['options']);return db[_0x732e('0x28')][_0x732e('0x45')](_0x3d9679)['then'](handleEntityNotFound(_0x59550d,null))[_0x732e('0x23')](respondWithResult(_0x59550d,null))[_0x732e('0x42')](handleError(_0x59550d,null));};exports['create']=function(_0xb59d88,_0x4a463d){return db[_0x732e('0x28')]['create'](_0xb59d88[_0x732e('0x46')],{})[_0x732e('0x23')](respondWithResult(_0x4a463d,0xc9))['catch'](handleError(_0x4a463d,null));};exports['update']=function(_0x310a27,_0x9e0ff9){if(_0x310a27[_0x732e('0x46')]['id']){delete _0x310a27[_0x732e('0x46')]['id'];}return db['Dynamics365Field'][_0x732e('0x45')]({'where':{'id':_0x310a27[_0x732e('0x44')]['id']}})[_0x732e('0x23')](handleEntityNotFound(_0x9e0ff9,null))[_0x732e('0x23')](saveUpdates(_0x310a27[_0x732e('0x46')],null))['then'](respondWithResult(_0x9e0ff9,null))[_0x732e('0x42')](handleError(_0x9e0ff9,null));};exports[_0x732e('0x22')]=function(_0x356612,_0x1b9aed){return db[_0x732e('0x28')]['find']({'where':{'id':_0x356612[_0x732e('0x44')]['id']}})[_0x732e('0x23')](handleEntityNotFound(_0x1b9aed,null))['then'](removeEntity(_0x1b9aed,null))['catch'](handleError(_0x1b9aed,null));};
\ No newline at end of file
index 1e02e9e..40a66da 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b06=['rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','FieldId','lodash','util','../../config/logger','bluebird','path'];(function(_0x4966de,_0x3fd693){var _0x246ba4=function(_0xc3f481){while(--_0xc3f481){_0x4966de['push'](_0x4966de['shift']());}};_0x246ba4(++_0x3fd693);}(_0x7b06,0x1b7));var _0x67b0=function(_0x502c83,_0x1db15d){_0x502c83=_0x502c83-0x0;var _0x40dd62=_0x7b06[_0x502c83];return _0x40dd62;};'use strict';var _=require(_0x67b0('0x0'));var util=require(_0x67b0('0x1'));var logger=require(_0x67b0('0x2'))('api');var moment=require('moment');var BPromise=require(_0x67b0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x67b0('0x4'));var rimraf=require(_0x67b0('0x5'));var config=require(_0x67b0('0x6'));var attributes=require(_0x67b0('0x7'));module[_0x67b0('0x8')]=function(_0x3c54fc,_0x1e634d){return _0x3c54fc[_0x67b0('0x9')](_0x67b0('0xa'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':['idField',_0x67b0('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcd2e=['../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xcd2e,0xaf));var _0xecd2=function(_0x571c1d,_0x3b0586){_0x571c1d=_0x571c1d-0x0;var _0x33c609=_0xcd2e[_0x571c1d];return _0x33c609;};'use strict';var _=require(_0xecd2('0x0'));var util=require('util');var logger=require(_0xecd2('0x1'))(_0xecd2('0x2'));var moment=require(_0xecd2('0x3'));var BPromise=require(_0xecd2('0x4'));var rp=require(_0xecd2('0x5'));var fs=require('fs');var path=require(_0xecd2('0x6'));var rimraf=require('rimraf');var config=require(_0xecd2('0x7'));var attributes=require(_0xecd2('0x8'));module[_0xecd2('0x9')]=function(_0x25a8ee,_0x3cf93f){return _0x25a8ee[_0xecd2('0xa')](_0xecd2('0xb'),attributes,{'tableName':_0xecd2('0xc'),'paranoid':![],'indexes':[{'name':_0xecd2('0xd'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 53802eb..1242690 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a3d=['jayson/promise','client','http','request','info','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','result','message','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x46fb90,_0x520dd1){var _0x445119=function(_0x2c2da5){while(--_0x2c2da5){_0x46fb90['push'](_0x46fb90['shift']());}};_0x445119(++_0x520dd1);}(_0x9a3d,0x184));var _0xd9a3=function(_0x533e21,_0x5ae9df){_0x533e21=_0x533e21-0x0;var _0x4ee9ec=_0x9a3d[_0x533e21];return _0x4ee9ec;};'use strict';var _=require(_0xd9a3('0x0'));var util=require(_0xd9a3('0x1'));var moment=require('moment');var BPromise=require(_0xd9a3('0x2'));var rs=require(_0xd9a3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd9a3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd9a3('0x5'))(_0xd9a3('0x6'));var config=require(_0xd9a3('0x7'));var jayson=require(_0xd9a3('0x8'));var client=jayson[_0xd9a3('0x9')][_0xd9a3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b1216,_0x435749,_0x50046f){return new BPromise(function(_0x377c63,_0x577768){return client[_0xd9a3('0xb')](_0x4b1216,_0x50046f)['then'](function(_0x2a3355){logger[_0xd9a3('0xc')](_0xd9a3('0xd'),_0x435749,'request\x20sent');logger[_0xd9a3('0xe')](_0xd9a3('0xf'),_0x435749,_0xd9a3('0x10'),JSON[_0xd9a3('0x11')](_0x2a3355));if(_0x2a3355[_0xd9a3('0x12')]){if(_0x2a3355['error'][_0xd9a3('0x13')]===0x1f4){logger[_0xd9a3('0x12')](_0xd9a3('0xd'),_0x435749,_0x2a3355['error']['message']);return _0x577768(_0x2a3355[_0xd9a3('0x12')]['message']);}logger['error'](_0xd9a3('0xd'),_0x435749,_0x2a3355[_0xd9a3('0x12')]['message']);return _0x377c63(_0x2a3355[_0xd9a3('0x12')]['message']);}else{logger['info'](_0xd9a3('0xd'),_0x435749,_0xd9a3('0x10'));_0x377c63(_0x2a3355[_0xd9a3('0x14')][_0xd9a3('0x15')]);}})['catch'](function(_0x1fdfa1){logger[_0xd9a3('0x12')](_0xd9a3('0xd'),_0x435749,_0x1fdfa1);_0x577768(_0x1fdfa1);});});}
\ No newline at end of file
+var _0x986c=['info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Field,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0xac7aa9,_0x2a4e31){var _0x58cbaf=function(_0x1fc07e){while(--_0x1fc07e){_0xac7aa9['push'](_0xac7aa9['shift']());}};_0x58cbaf(++_0x2a4e31);}(_0x986c,0x77));var _0xc986=function(_0x534c87,_0x3bee73){_0x534c87=_0x534c87-0x0;var _0x57d146=_0x986c[_0x534c87];return _0x57d146;};'use strict';var _=require(_0xc986('0x0'));var util=require(_0xc986('0x1'));var moment=require(_0xc986('0x2'));var BPromise=require(_0xc986('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc986('0x4'))['db'];var utils=require(_0xc986('0x5'));var logger=require(_0xc986('0x6'))(_0xc986('0x7'));var config=require(_0xc986('0x8'));var jayson=require(_0xc986('0x9'));var client=jayson[_0xc986('0xa')][_0xc986('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x170ba0,_0x39200a,_0x33f2ce){return new BPromise(function(_0x3ad2f1,_0x5c3636){return client[_0xc986('0xc')](_0x170ba0,_0x33f2ce)['then'](function(_0x3a025a){logger[_0xc986('0xd')]('Dynamics365Field,\x20%s,\x20%s',_0x39200a,_0xc986('0xe'));logger[_0xc986('0xf')](_0xc986('0x10'),_0x39200a,_0xc986('0xe'),JSON[_0xc986('0x11')](_0x3a025a));if(_0x3a025a[_0xc986('0x12')]){if(_0x3a025a[_0xc986('0x12')]['code']===0x1f4){logger[_0xc986('0x12')](_0xc986('0x13'),_0x39200a,_0x3a025a[_0xc986('0x12')]['message']);return _0x5c3636(_0x3a025a[_0xc986('0x12')][_0xc986('0x14')]);}logger[_0xc986('0x12')](_0xc986('0x13'),_0x39200a,_0x3a025a[_0xc986('0x12')][_0xc986('0x14')]);return _0x3ad2f1(_0x3a025a[_0xc986('0x12')]['message']);}else{logger[_0xc986('0xd')](_0xc986('0x13'),_0x39200a,'request\x20sent');_0x3ad2f1(_0x3a025a[_0xc986('0x15')][_0xc986('0x14')]);}})['catch'](function(_0x330ebc){logger['error'](_0xc986('0x13'),_0x39200a,_0x330ebc);_0x5c3636(_0x330ebc);});});}
\ No newline at end of file
index 85ec6d8..c428473 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf539=['put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','create','post','addConfiguration'];(function(_0x3b7e9c,_0x2771b2){var _0x1b0cf5=function(_0x2142a0){while(--_0x2142a0){_0x3b7e9c['push'](_0x3b7e9c['shift']());}};_0x1b0cf5(++_0x2771b2);}(_0xf539,0x7d));var _0x9f53=function(_0x373b5f,_0x3491ba){_0x373b5f=_0x373b5f-0x0;var _0x2b8d68=_0xf539[_0x373b5f];return _0x2b8d68;};'use strict';var multer=require(_0x9f53('0x0'));var util=require(_0x9f53('0x1'));var path=require('path');var timeout=require(_0x9f53('0x2'));var express=require(_0x9f53('0x3'));var router=express[_0x9f53('0x4')]();var fs_extra=require(_0x9f53('0x5'));var auth=require(_0x9f53('0x6'));var interaction=require(_0x9f53('0x7'));var config=require('../../config/environment');var controller=require(_0x9f53('0x8'));router[_0x9f53('0x9')]('/',auth[_0x9f53('0xa')](),controller[_0x9f53('0xb')]);router['get'](_0x9f53('0xc'),auth[_0x9f53('0xa')](),controller[_0x9f53('0xd')]);router[_0x9f53('0x9')](_0x9f53('0xe'),auth[_0x9f53('0xa')](),controller['getConfigurations']);router['get'](_0x9f53('0xf'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller[_0x9f53('0x10')]);router[_0x9f53('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x9f53('0x12')]);router[_0x9f53('0x13')](_0x9f53('0xc'),auth[_0x9f53('0xa')](),controller[_0x9f53('0x14')]);router[_0x9f53('0x15')](_0x9f53('0xc'),auth[_0x9f53('0xa')](),controller[_0x9f53('0x16')]);module[_0x9f53('0x17')]=router;
\ No newline at end of file
+var _0x530b=['index','get','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','post','put','/:id','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x530b,0x114));var _0xb530=function(_0x387dc1,_0x3ba649){_0x387dc1=_0x387dc1-0x0;var _0x17567c=_0x530b[_0x387dc1];return _0x17567c;};'use strict';var multer=require(_0xb530('0x0'));var util=require(_0xb530('0x1'));var path=require('path');var timeout=require(_0xb530('0x2'));var express=require(_0xb530('0x3'));var router=express[_0xb530('0x4')]();var fs_extra=require(_0xb530('0x5'));var auth=require(_0xb530('0x6'));var interaction=require(_0xb530('0x7'));var config=require(_0xb530('0x8'));var controller=require(_0xb530('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xb530('0xa')]);router[_0xb530('0xb')]('/:id',auth[_0xb530('0xc')](),controller[_0xb530('0xd')]);router['get'](_0xb530('0xe'),auth['isAuthenticated'](),controller[_0xb530('0xf')]);router['get'](_0xb530('0x10'),auth[_0xb530('0xc')](),controller['getFields']);router['post']('/',auth[_0xb530('0xc')](),controller['create']);router[_0xb530('0x11')](_0xb530('0xe'),auth[_0xb530('0xc')](),controller['addConfiguration']);router[_0xb530('0x12')](_0xb530('0x13'),auth['isAuthenticated'](),controller[_0xb530('0x14')]);router[_0xb530('0x15')](_0xb530('0x13'),auth[_0xb530('0xc')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 8bae5e1..6b7ac2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f66=['STRING','username','exports'];(function(_0x2b9621,_0x5b4cff){var _0x76ebfb=function(_0x1bd8c0){while(--_0x1bd8c0){_0x2b9621['push'](_0x2b9621['shift']());}};_0x76ebfb(++_0x5b4cff);}(_0x5f66,0x1a0));var _0x65f6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5f66[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x65f6('0x1')]},'username':{'type':Sequelize[_0x65f6('0x1')],'unique':_0x65f6('0x2')},'apiKey':{'type':Sequelize[_0x65f6('0x1')]},'remoteUri':{'type':Sequelize[_0x65f6('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x65f6('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0xe5af=['exports','STRING','username','remoteUri'];(function(_0x4515bb,_0x4ec2f9){var _0x90897d=function(_0x31c312){while(--_0x31c312){_0x4515bb['push'](_0x4515bb['shift']());}};_0x90897d(++_0x4ec2f9);}(_0xe5af,0x9c));var _0xfe5a=function(_0x966502,_0x518d86){_0x966502=_0x966502-0x0;var _0x5c7854=_0xe5af[_0x966502];return _0x5c7854;};'use strict';var Sequelize=require('sequelize');module[_0xfe5a('0x0')]={'name':{'type':Sequelize[_0xfe5a('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfe5a('0x1')],'unique':_0xfe5a('0x2')},'apiKey':{'type':Sequelize[_0xfe5a('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xfe5a('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index f6ffaec..aadd001 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed8a=['count','offset','set','Content-Range','reject','save','then','destroy','sendStatus','stack','name','send','map','FreshdeskAccount','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','show','params','include','find','catch','create','body','update','FreshdeskConfiguration','getConfigurations','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','FreshdeskField','Subjects','getFields','findOne','apiKey','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','%s:X','base64','requester','agent','description','priority','group','ticket_type','remove','default','custom_dropdown','label','choices','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../components/integrations/configuration','status','end','undefined','limit'];(function(_0x5a3891,_0xecbe25){var _0x7cf90d=function(_0x5f0bd3){while(--_0x5f0bd3){_0x5a3891['push'](_0x5a3891['shift']());}};_0x7cf90d(++_0xecbe25);}(_0xed8a,0xc5));var _0xaed8=function(_0x31b10f,_0x5dd91b){_0x31b10f=_0x31b10f-0x0;var _0xdbae85=_0xed8a[_0x31b10f];return _0xdbae85;};'use strict';var emlformat=require(_0xaed8('0x0'));var rimraf=require(_0xaed8('0x1'));var zipdir=require(_0xaed8('0x2'));var jsonpatch=require(_0xaed8('0x3'));var rp=require('request-promise');var moment=require(_0xaed8('0x4'));var BPromise=require(_0xaed8('0x5'));var Mustache=require('mustache');var util=require(_0xaed8('0x6'));var path=require(_0xaed8('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xaed8('0x8'));var fs=require('fs');var fs_extra=require(_0xaed8('0x9'));var _=require(_0xaed8('0xa'));var squel=require(_0xaed8('0xb'));var crypto=require(_0xaed8('0xc'));var jsforce=require(_0xaed8('0xd'));var deskjs=require(_0xaed8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xaed8('0xf'));var Papa=require(_0xaed8('0x10'));var Redis=require(_0xaed8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xaed8('0x12'));var as=require(_0xaed8('0x13'));var hardwareService=require(_0xaed8('0x14'));var logger=require(_0xaed8('0x15'))(_0xaed8('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xaed8('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xaed8('0x18'));function respondWithStatusCode(_0x36c833,_0x129051){_0x129051=_0x129051||0xcc;return function(_0x36d561){if(_0x36d561){return _0x36c833['sendStatus'](_0x129051);}return _0x36c833[_0xaed8('0x19')](_0x129051)[_0xaed8('0x1a')]();};}function respondWithResult(_0x3a7aab,_0x248cd7){_0x248cd7=_0x248cd7||0xc8;return function(_0x2c5039){if(_0x2c5039){return _0x3a7aab[_0xaed8('0x19')](_0x248cd7)['json'](_0x2c5039);}};}function respondWithFilteredResult(_0xefac0c,_0x4a7448){return function(_0x4593c1){if(_0x4593c1){var _0x1aab7d=typeof _0x4a7448['offset']===_0xaed8('0x1b')&&typeof _0x4a7448[_0xaed8('0x1c')]===_0xaed8('0x1b');var _0x3c973d=_0x4593c1[_0xaed8('0x1d')];var _0x1b8eb8=_0x1aab7d?0x0:_0x4a7448[_0xaed8('0x1e')];var _0x3c6313=_0x1aab7d?_0x4593c1[_0xaed8('0x1d')]:_0x4a7448[_0xaed8('0x1e')]+_0x4a7448[_0xaed8('0x1c')];var _0x460165;if(_0x3c6313>=_0x3c973d){_0x3c6313=_0x3c973d;_0x460165=0xc8;}else{_0x460165=0xce;}_0xefac0c[_0xaed8('0x19')](_0x460165);return _0xefac0c[_0xaed8('0x1f')](_0xaed8('0x20'),_0x1b8eb8+'-'+_0x3c6313+'/'+_0x3c973d)['json'](_0x4593c1);}return null;};}function patchUpdates(_0x5cd103){return function(_0x2ac96a){try{jsonpatch['apply'](_0x2ac96a,_0x5cd103,!![]);}catch(_0x13e498){return BPromise[_0xaed8('0x21')](_0x13e498);}return _0x2ac96a[_0xaed8('0x22')]();};}function saveUpdates(_0x344949,_0x5a69aa){return function(_0x5aa616){if(_0x5aa616){return _0x5aa616['update'](_0x344949)[_0xaed8('0x23')](function(_0x4437aa){return _0x4437aa;});}return null;};}function removeEntity(_0x448ef9,_0x38a3f1){return function(_0x112eab){if(_0x112eab){return _0x112eab[_0xaed8('0x24')]()[_0xaed8('0x23')](function(){_0x448ef9[_0xaed8('0x19')](0xcc)[_0xaed8('0x1a')]();});}};}function handleEntityNotFound(_0x57898b,_0x33d3ea){return function(_0x393bcb){if(!_0x393bcb){_0x57898b[_0xaed8('0x25')](0x194);}return _0x393bcb;};}function handleError(_0x14cd92,_0x349736){_0x349736=_0x349736||0x1f4;return function(_0xe906a3){logger['error'](_0xe906a3[_0xaed8('0x26')]);if(_0xe906a3['name']){delete _0xe906a3[_0xaed8('0x27')];}_0x14cd92['status'](_0x349736)[_0xaed8('0x28')](_0xe906a3);};}exports['index']=function(_0x2fc145,_0x475974){var _0x284c6a={},_0x601d8d={},_0x3dbe7e={'count':0x0,'rows':[]};var _0x476e93=_[_0xaed8('0x29')](db[_0xaed8('0x2a')][_0xaed8('0x2b')],function(_0x4b1db6){return{'name':_0x4b1db6['fieldName'],'type':_0x4b1db6[_0xaed8('0x2c')][_0xaed8('0x2d')]};});_0x601d8d[_0xaed8('0x2e')]=_[_0xaed8('0x29')](_0x476e93,_0xaed8('0x27'));_0x601d8d['query']=_[_0xaed8('0x2f')](_0x2fc145[_0xaed8('0x30')]);_0x601d8d[_0xaed8('0x31')]=_[_0xaed8('0x32')](_0x601d8d[_0xaed8('0x2e')],_0x601d8d[_0xaed8('0x30')]);_0x284c6a['attributes']=_['intersection'](_0x601d8d[_0xaed8('0x2e')],qs[_0xaed8('0x33')](_0x2fc145[_0xaed8('0x30')]['fields']));_0x284c6a['attributes']=_0x284c6a[_0xaed8('0x34')][_0xaed8('0x35')]?_0x284c6a[_0xaed8('0x34')]:_0x601d8d['model'];if(!_0x2fc145[_0xaed8('0x30')][_0xaed8('0x36')](_0xaed8('0x37'))){_0x284c6a['limit']=qs[_0xaed8('0x1c')](_0x2fc145[_0xaed8('0x30')][_0xaed8('0x1c')]);_0x284c6a[_0xaed8('0x1e')]=qs[_0xaed8('0x1e')](_0x2fc145[_0xaed8('0x30')][_0xaed8('0x1e')]);}_0x284c6a[_0xaed8('0x38')]=qs[_0xaed8('0x39')](_0x2fc145['query'][_0xaed8('0x39')]);_0x284c6a[_0xaed8('0x3a')]=qs[_0xaed8('0x31')](_[_0xaed8('0x3b')](_0x2fc145['query'],_0x601d8d[_0xaed8('0x31')]),_0x476e93);if(_0x2fc145[_0xaed8('0x30')][_0xaed8('0x3c')]){_0x284c6a[_0xaed8('0x3a')]=_[_0xaed8('0x3d')](_0x284c6a[_0xaed8('0x3a')],{'$or':_[_0xaed8('0x29')](_0x476e93,function(_0xad472c){if(_0xad472c['type']!==_0xaed8('0x3e')){var _0x19b734={};_0x19b734[_0xad472c['name']]={'$like':'%'+_0x2fc145[_0xaed8('0x30')]['filter']+'%'};return _0x19b734;}})});}_0x284c6a=_[_0xaed8('0x3d')]({},_0x284c6a,_0x2fc145[_0xaed8('0x3f')]);var _0x5a735e={'where':_0x284c6a[_0xaed8('0x3a')]};return db[_0xaed8('0x2a')]['count'](_0x5a735e)[_0xaed8('0x23')](function(_0x17f52d){_0x3dbe7e['count']=_0x17f52d;if(_0x2fc145[_0xaed8('0x30')][_0xaed8('0x40')]){_0x284c6a['include']=[{'all':!![]}];}return db[_0xaed8('0x2a')]['findAll'](_0x284c6a);})[_0xaed8('0x23')](function(_0x306c4e){_0x3dbe7e[_0xaed8('0x41')]=_0x306c4e;return _0x3dbe7e;})['then'](respondWithFilteredResult(_0x475974,_0x284c6a))['catch'](handleError(_0x475974,null));};exports[_0xaed8('0x42')]=function(_0x263bc4,_0x4ddb0f){var _0x22ddd8={'raw':![],'where':{'id':_0x263bc4[_0xaed8('0x43')]['id']}},_0x3d55a3={};_0x3d55a3[_0xaed8('0x2e')]=_[_0xaed8('0x2f')](db[_0xaed8('0x2a')][_0xaed8('0x2b')]);_0x3d55a3[_0xaed8('0x30')]=_[_0xaed8('0x2f')](_0x263bc4[_0xaed8('0x30')]);_0x3d55a3['filters']=_[_0xaed8('0x32')](_0x3d55a3['model'],_0x3d55a3[_0xaed8('0x30')]);_0x22ddd8[_0xaed8('0x34')]=_['intersection'](_0x3d55a3[_0xaed8('0x2e')],qs[_0xaed8('0x33')](_0x263bc4[_0xaed8('0x30')]['fields']));_0x22ddd8[_0xaed8('0x34')]=_0x22ddd8[_0xaed8('0x34')]['length']?_0x22ddd8[_0xaed8('0x34')]:_0x3d55a3[_0xaed8('0x2e')];if(_0x263bc4[_0xaed8('0x30')][_0xaed8('0x40')]){_0x22ddd8[_0xaed8('0x44')]=[{'all':!![]}];}_0x22ddd8=_[_0xaed8('0x3d')]({},_0x22ddd8,_0x263bc4['options']);return db[_0xaed8('0x2a')][_0xaed8('0x45')](_0x22ddd8)[_0xaed8('0x23')](handleEntityNotFound(_0x4ddb0f,null))[_0xaed8('0x23')](respondWithResult(_0x4ddb0f,null))[_0xaed8('0x46')](handleError(_0x4ddb0f,null));};exports[_0xaed8('0x47')]=function(_0x560a69,_0x2b73ef){return db[_0xaed8('0x2a')][_0xaed8('0x47')](_0x560a69[_0xaed8('0x48')],{})[_0xaed8('0x23')](respondWithResult(_0x2b73ef,0xc9))[_0xaed8('0x46')](handleError(_0x2b73ef,null));};exports[_0xaed8('0x49')]=function(_0x26c015,_0x32679e){if(_0x26c015[_0xaed8('0x48')]['id']){delete _0x26c015['body']['id'];}return db[_0xaed8('0x2a')][_0xaed8('0x45')]({'where':{'id':_0x26c015['params']['id']}})[_0xaed8('0x23')](handleEntityNotFound(_0x32679e,null))[_0xaed8('0x23')](saveUpdates(_0x26c015[_0xaed8('0x48')],null))['then'](respondWithResult(_0x32679e,null))[_0xaed8('0x46')](handleError(_0x32679e,null));};exports[_0xaed8('0x24')]=function(_0x4a4eac,_0x213341){return db[_0xaed8('0x2a')][_0xaed8('0x45')]({'where':{'id':_0x4a4eac[_0xaed8('0x43')]['id']}})[_0xaed8('0x23')](handleEntityNotFound(_0x213341,null))[_0xaed8('0x23')](removeEntity(_0x213341,null))[_0xaed8('0x46')](handleError(_0x213341,null));};exports['getConfigurations']=function(_0x1fa6a6,_0x1f40ff,_0x4468d8){var _0x45b03c={};var _0x14483d={};var _0x143ce0;var _0x2508fa;return db[_0xaed8('0x2a')]['findOne']({'where':{'id':_0x1fa6a6[_0xaed8('0x43')]['id']}})[_0xaed8('0x23')](handleEntityNotFound(_0x1f40ff,null))[_0xaed8('0x23')](function(_0x107dbd){if(_0x107dbd){_0x143ce0=_0x107dbd;_0x14483d[_0xaed8('0x2e')]=_[_0xaed8('0x2f')](db[_0xaed8('0x4a')][_0xaed8('0x2b')]);_0x14483d['query']=_['keys'](_0x1fa6a6[_0xaed8('0x30')]);_0x14483d[_0xaed8('0x31')]=_[_0xaed8('0x32')](_0x14483d[_0xaed8('0x2e')],_0x14483d[_0xaed8('0x30')]);_0x45b03c[_0xaed8('0x34')]=_[_0xaed8('0x32')](_0x14483d[_0xaed8('0x2e')],qs[_0xaed8('0x33')](_0x1fa6a6[_0xaed8('0x30')][_0xaed8('0x33')]));_0x45b03c[_0xaed8('0x34')]=_0x45b03c[_0xaed8('0x34')][_0xaed8('0x35')]?_0x45b03c[_0xaed8('0x34')]:_0x14483d['model'];_0x45b03c[_0xaed8('0x38')]=qs[_0xaed8('0x39')](_0x1fa6a6[_0xaed8('0x30')][_0xaed8('0x39')]);_0x45b03c['where']=qs[_0xaed8('0x31')](_['pick'](_0x1fa6a6[_0xaed8('0x30')],_0x14483d[_0xaed8('0x31')]));if(_0x1fa6a6[_0xaed8('0x30')][_0xaed8('0x3c')]){_0x45b03c[_0xaed8('0x3a')]=_[_0xaed8('0x3d')](_0x45b03c[_0xaed8('0x3a')],{'$or':_[_0xaed8('0x29')](_0x45b03c[_0xaed8('0x34')],function(_0x35900f){var _0x50e97f={};_0x50e97f[_0x35900f]={'$like':'%'+_0x1fa6a6[_0xaed8('0x30')][_0xaed8('0x3c')]+'%'};return _0x50e97f;})});}_0x45b03c=_['merge']({},_0x45b03c,_0x1fa6a6[_0xaed8('0x3f')]);return _0x143ce0[_0xaed8('0x4b')](_0x45b03c);}})['then'](function(_0x13962f){if(_0x13962f){_0x2508fa=_0x13962f['length'];if(!_0x1fa6a6[_0xaed8('0x30')]['hasOwnProperty'](_0xaed8('0x37'))){_0x45b03c['limit']=qs[_0xaed8('0x1c')](_0x1fa6a6[_0xaed8('0x30')][_0xaed8('0x1c')]);_0x45b03c['offset']=qs['offset'](_0x1fa6a6[_0xaed8('0x30')][_0xaed8('0x1e')]);}return _0x143ce0[_0xaed8('0x4b')](_0x45b03c);}})['then'](function(_0x3c99b1){if(_0x3c99b1){return _0x3c99b1?{'count':_0x2508fa,'rows':_0x3c99b1}:null;}})['then'](respondWithResult(_0x1f40ff,null))[_0xaed8('0x46')](handleError(_0x1f40ff,null));};exports[_0xaed8('0x4c')]=function(_0x136cae,_0x5320c2,_0xbed924){if(_0x136cae[_0xaed8('0x48')]['id']){delete _0x136cae['body']['id'];}return db[_0xaed8('0x2a')]['findOne']({'where':{'id':_0x136cae[_0xaed8('0x43')]['id']}})[_0xaed8('0x23')](handleEntityNotFound(_0x5320c2,null))[_0xaed8('0x23')](function(_0x45c321){if(_0x45c321){_0x136cae[_0xaed8('0x48')][_0xaed8('0x4d')]=_0x45c321['id'];_0x136cae[_0xaed8('0x48')]['Subjects']=integrations[_0xaed8('0x4e')](_0x136cae[_0xaed8('0x48')]['channel'],_0x136cae['body']['type']);_0x136cae['body'][_0xaed8('0x4f')]=integrations[_0xaed8('0x50')](_0x136cae[_0xaed8('0x48')][_0xaed8('0x51')],_0x136cae[_0xaed8('0x48')][_0xaed8('0x2c')]);return db[_0xaed8('0x4a')][_0xaed8('0x47')](_0x136cae[_0xaed8('0x48')],{'include':[{'model':db[_0xaed8('0x52')],'as':_0xaed8('0x53')},{'model':db[_0xaed8('0x52')],'as':'Descriptions'}]});}return null;})[_0xaed8('0x23')](respondWithResult(_0x5320c2,null))[_0xaed8('0x46')](handleError(_0x5320c2,null));};exports[_0xaed8('0x54')]=function(_0x42acb3,_0x4d5abb,_0x18e926){var _0x722467='';return db[_0xaed8('0x2a')][_0xaed8('0x55')]({'where':{'id':_0x42acb3[_0xaed8('0x43')]['id']},'attributes':['id','remoteUri',_0xaed8('0x56')]})[_0xaed8('0x23')](handleEntityNotFound(_0x4d5abb,null))[_0xaed8('0x23')](function(_0x1e1476){if(_0x1e1476){_0x722467=_0x1e1476[_0xaed8('0x57')];var _0x285522=_0x722467[_0xaed8('0x58')](-0x1);if(_0x285522==='/'){_0x722467=_0x722467[_0xaed8('0x59')](0x0,_0x722467[_0xaed8('0x5a')](_0x285522));}return rp({'method':_0xaed8('0x5b'),'uri':util[_0xaed8('0x5c')](_0xaed8('0x5d'),_0x722467,'api/v2/ticket_fields'),'headers':{'Authorization':util[_0xaed8('0x5c')]('Basic\x20%s',new Buffer(util[_0xaed8('0x5c')](_0xaed8('0x5e'),_0x1e1476[_0xaed8('0x56')]))['toString'](_0xaed8('0x5f')))},'json':!![]});}})['then'](function(_0x16a382){if(_0x16a382){var _0x14c64b=[_0xaed8('0x60'),'subject',_0xaed8('0x61'),_0xaed8('0x62'),'status',_0xaed8('0x63'),_0xaed8('0x64'),'source',_0xaed8('0x65'),_0xaed8('0x64'),'company'];_[_0xaed8('0x66')](_0x16a382,function(_0x422f3c){return _0x14c64b['includes'](_0x422f3c[_0xaed8('0x27')])||!_0x422f3c[_0xaed8('0x67')]&&_0x422f3c['type']!=='custom_text'&&_0x422f3c[_0xaed8('0x2c')]!==_0xaed8('0x68');});return{'count':_0x16a382[_0xaed8('0x35')],'rows':_[_0xaed8('0x29')](_0x16a382,function(_0x53f29b){return{'id':_0x53f29b[_0xaed8('0x27')],'name':_0x53f29b[_0xaed8('0x69')],'custom':!_0x53f29b[_0xaed8('0x67')],'options':_0x53f29b[_0xaed8('0x6a')]?_[_0xaed8('0x29')](_0x53f29b[_0xaed8('0x6a')],function(_0x41c34c){return{'name':_['capitalize'](_0x41c34c),'value':_0x41c34c};}):[]};})};}})[_0xaed8('0x23')](respondWithResult(_0x4d5abb,null))[_0xaed8('0x46')](function(_0x4389c2){var _0x42e5cf=_0x42acb3[_0xaed8('0x30')]['test']?0x1f4:_0x4389c2[_0xaed8('0x6b')]||0x1f4;logger[_0xaed8('0x6c')](_0xaed8('0x6d'),_0xaed8('0x54'),_0x42e5cf,JSON[_0xaed8('0x6e')](_0x4389c2));delete _0x4389c2[_0xaed8('0x27')];if(_0x42e5cf===0x191){_0x42e5cf=0x190;}_0x4d5abb[_0xaed8('0x19')](_0x42e5cf)[_0xaed8('0x28')](_0x42acb3[_0xaed8('0x30')][_0xaed8('0x6f')]?{'message':_0xaed8('0x70'),'statusCode':_0x4389c2['statusCode']}:_0x4389c2);});};
\ No newline at end of file
+var _0x867f=['../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','FreshdeskAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','options','findAll','rows','catch','show','params','length','includeAll','include','find','create','getConfigurations','findOne','FreshdeskConfiguration','order','hasOwnProperty','addConfiguration','body','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','%s:X','toString','base64','subject','agent','description','priority','source','ticket_type','group','company','default','custom_text','custom_dropdown','choices','capitalize','test','statusCode','error','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service'];(function(_0x338b13,_0x2e921d){var _0x2dc623=function(_0x327221){while(--_0x327221){_0x338b13['push'](_0x338b13['shift']());}};_0x2dc623(++_0x2e921d);}(_0x867f,0xdc));var _0xf867=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x867f[_0x26b80e];return _0x84a8a8;};'use strict';var emlformat=require(_0xf867('0x0'));var rimraf=require(_0xf867('0x1'));var zipdir=require(_0xf867('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf867('0x3'));var moment=require(_0xf867('0x4'));var BPromise=require(_0xf867('0x5'));var Mustache=require('mustache');var util=require(_0xf867('0x6'));var path=require('path');var sox=require(_0xf867('0x7'));var csv=require(_0xf867('0x8'));var ejs=require(_0xf867('0x9'));var fs=require('fs');var fs_extra=require(_0xf867('0xa'));var _=require(_0xf867('0xb'));var squel=require(_0xf867('0xc'));var crypto=require(_0xf867('0xd'));var jsforce=require(_0xf867('0xe'));var deskjs=require(_0xf867('0xf'));var toCsv=require(_0xf867('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf867('0x10'));var authService=require(_0xf867('0x11'));var qs=require(_0xf867('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf867('0x13'))(_0xf867('0x14'));var utils=require('../../config/utils');var config=require(_0xf867('0x15'));var licenseUtil=require(_0xf867('0x16'));var db=require(_0xf867('0x17'))['db'];var integrations=require(_0xf867('0x18'));function respondWithStatusCode(_0x4f5297,_0x8059d0){_0x8059d0=_0x8059d0||0xcc;return function(_0x2989a9){if(_0x2989a9){return _0x4f5297[_0xf867('0x19')](_0x8059d0);}return _0x4f5297[_0xf867('0x1a')](_0x8059d0)[_0xf867('0x1b')]();};}function respondWithResult(_0x3ed550,_0x37b752){_0x37b752=_0x37b752||0xc8;return function(_0x3c0d03){if(_0x3c0d03){return _0x3ed550[_0xf867('0x1a')](_0x37b752)[_0xf867('0x1c')](_0x3c0d03);}};}function respondWithFilteredResult(_0x4de424,_0x55fb64){return function(_0x554d6a){if(_0x554d6a){var _0x46d844=typeof _0x55fb64[_0xf867('0x1d')]===_0xf867('0x1e')&&typeof _0x55fb64[_0xf867('0x1f')]===_0xf867('0x1e');var _0x29b42f=_0x554d6a[_0xf867('0x20')];var _0x48e5b9=_0x46d844?0x0:_0x55fb64[_0xf867('0x1d')];var _0x20586d=_0x46d844?_0x554d6a[_0xf867('0x20')]:_0x55fb64[_0xf867('0x1d')]+_0x55fb64[_0xf867('0x1f')];var _0x523461;if(_0x20586d>=_0x29b42f){_0x20586d=_0x29b42f;_0x523461=0xc8;}else{_0x523461=0xce;}_0x4de424[_0xf867('0x1a')](_0x523461);return _0x4de424['set'](_0xf867('0x21'),_0x48e5b9+'-'+_0x20586d+'/'+_0x29b42f)[_0xf867('0x1c')](_0x554d6a);}return null;};}function patchUpdates(_0x15ca62){return function(_0x5cf4d9){try{jsonpatch[_0xf867('0x22')](_0x5cf4d9,_0x15ca62,!![]);}catch(_0x1c0fdc){return BPromise[_0xf867('0x23')](_0x1c0fdc);}return _0x5cf4d9[_0xf867('0x24')]();};}function saveUpdates(_0x83ba8c,_0x2546fa){return function(_0x9ee12a){if(_0x9ee12a){return _0x9ee12a[_0xf867('0x25')](_0x83ba8c)['then'](function(_0x281374){return _0x281374;});}return null;};}function removeEntity(_0x13ed06,_0x3a54bc){return function(_0x4dd8d1){if(_0x4dd8d1){return _0x4dd8d1[_0xf867('0x26')]()[_0xf867('0x27')](function(){_0x13ed06[_0xf867('0x1a')](0xcc)[_0xf867('0x1b')]();});}};}function handleEntityNotFound(_0xd585a1,_0x550f54){return function(_0x2c5a53){if(!_0x2c5a53){_0xd585a1[_0xf867('0x19')](0x194);}return _0x2c5a53;};}function handleError(_0x2c6e8e,_0x165e63){_0x165e63=_0x165e63||0x1f4;return function(_0x16a903){logger['error'](_0x16a903[_0xf867('0x28')]);if(_0x16a903[_0xf867('0x29')]){delete _0x16a903[_0xf867('0x29')];}_0x2c6e8e[_0xf867('0x1a')](_0x165e63)[_0xf867('0x2a')](_0x16a903);};}exports[_0xf867('0x2b')]=function(_0x5b7865,_0x3d4b18){var _0x28fb90={},_0x169578={},_0x4c0f0c={'count':0x0,'rows':[]};var _0x1553fc=_[_0xf867('0x2c')](db[_0xf867('0x2d')][_0xf867('0x2e')],function(_0x55616d){return{'name':_0x55616d[_0xf867('0x2f')],'type':_0x55616d[_0xf867('0x30')][_0xf867('0x31')]};});_0x169578[_0xf867('0x32')]=_[_0xf867('0x2c')](_0x1553fc,_0xf867('0x29'));_0x169578[_0xf867('0x33')]=_[_0xf867('0x34')](_0x5b7865['query']);_0x169578[_0xf867('0x35')]=_['intersection'](_0x169578['model'],_0x169578[_0xf867('0x33')]);_0x28fb90[_0xf867('0x36')]=_[_0xf867('0x37')](_0x169578[_0xf867('0x32')],qs[_0xf867('0x38')](_0x5b7865['query'][_0xf867('0x38')]));_0x28fb90[_0xf867('0x36')]=_0x28fb90['attributes']['length']?_0x28fb90[_0xf867('0x36')]:_0x169578['model'];if(!_0x5b7865['query']['hasOwnProperty'](_0xf867('0x39'))){_0x28fb90['limit']=qs[_0xf867('0x1f')](_0x5b7865[_0xf867('0x33')][_0xf867('0x1f')]);_0x28fb90[_0xf867('0x1d')]=qs[_0xf867('0x1d')](_0x5b7865[_0xf867('0x33')][_0xf867('0x1d')]);}_0x28fb90['order']=qs[_0xf867('0x3a')](_0x5b7865['query'][_0xf867('0x3a')]);_0x28fb90[_0xf867('0x3b')]=qs['filters'](_[_0xf867('0x3c')](_0x5b7865['query'],_0x169578[_0xf867('0x35')]),_0x1553fc);if(_0x5b7865[_0xf867('0x33')][_0xf867('0x3d')]){_0x28fb90['where']=_[_0xf867('0x3e')](_0x28fb90['where'],{'$or':_[_0xf867('0x2c')](_0x1553fc,function(_0x15fb1f){if(_0x15fb1f['type']!=='VIRTUAL'){var _0x4dea4d={};_0x4dea4d[_0x15fb1f[_0xf867('0x29')]]={'$like':'%'+_0x5b7865[_0xf867('0x33')][_0xf867('0x3d')]+'%'};return _0x4dea4d;}})});}_0x28fb90=_['merge']({},_0x28fb90,_0x5b7865[_0xf867('0x3f')]);var _0x487357={'where':_0x28fb90['where']};return db[_0xf867('0x2d')][_0xf867('0x20')](_0x487357)[_0xf867('0x27')](function(_0xebd8e7){_0x4c0f0c[_0xf867('0x20')]=_0xebd8e7;if(_0x5b7865['query']['includeAll']){_0x28fb90['include']=[{'all':!![]}];}return db[_0xf867('0x2d')][_0xf867('0x40')](_0x28fb90);})[_0xf867('0x27')](function(_0x4975a3){_0x4c0f0c[_0xf867('0x41')]=_0x4975a3;return _0x4c0f0c;})[_0xf867('0x27')](respondWithFilteredResult(_0x3d4b18,_0x28fb90))[_0xf867('0x42')](handleError(_0x3d4b18,null));};exports[_0xf867('0x43')]=function(_0x5235cb,_0x1b94d5){var _0x28995a={'raw':![],'where':{'id':_0x5235cb[_0xf867('0x44')]['id']}},_0x520eb5={};_0x520eb5[_0xf867('0x32')]=_[_0xf867('0x34')](db[_0xf867('0x2d')][_0xf867('0x2e')]);_0x520eb5[_0xf867('0x33')]=_[_0xf867('0x34')](_0x5235cb[_0xf867('0x33')]);_0x520eb5[_0xf867('0x35')]=_[_0xf867('0x37')](_0x520eb5[_0xf867('0x32')],_0x520eb5[_0xf867('0x33')]);_0x28995a[_0xf867('0x36')]=_[_0xf867('0x37')](_0x520eb5[_0xf867('0x32')],qs['fields'](_0x5235cb[_0xf867('0x33')][_0xf867('0x38')]));_0x28995a[_0xf867('0x36')]=_0x28995a[_0xf867('0x36')][_0xf867('0x45')]?_0x28995a[_0xf867('0x36')]:_0x520eb5[_0xf867('0x32')];if(_0x5235cb[_0xf867('0x33')][_0xf867('0x46')]){_0x28995a[_0xf867('0x47')]=[{'all':!![]}];}_0x28995a=_[_0xf867('0x3e')]({},_0x28995a,_0x5235cb[_0xf867('0x3f')]);return db[_0xf867('0x2d')][_0xf867('0x48')](_0x28995a)[_0xf867('0x27')](handleEntityNotFound(_0x1b94d5,null))[_0xf867('0x27')](respondWithResult(_0x1b94d5,null))[_0xf867('0x42')](handleError(_0x1b94d5,null));};exports['create']=function(_0x2f31bd,_0x68888b){return db[_0xf867('0x2d')][_0xf867('0x49')](_0x2f31bd['body'],{})[_0xf867('0x27')](respondWithResult(_0x68888b,0xc9))[_0xf867('0x42')](handleError(_0x68888b,null));};exports[_0xf867('0x25')]=function(_0x416e46,_0x35a66d){if(_0x416e46['body']['id']){delete _0x416e46['body']['id'];}return db[_0xf867('0x2d')][_0xf867('0x48')]({'where':{'id':_0x416e46[_0xf867('0x44')]['id']}})[_0xf867('0x27')](handleEntityNotFound(_0x35a66d,null))[_0xf867('0x27')](saveUpdates(_0x416e46['body'],null))[_0xf867('0x27')](respondWithResult(_0x35a66d,null))[_0xf867('0x42')](handleError(_0x35a66d,null));};exports[_0xf867('0x26')]=function(_0x5203b6,_0x545353){return db[_0xf867('0x2d')][_0xf867('0x48')]({'where':{'id':_0x5203b6['params']['id']}})['then'](handleEntityNotFound(_0x545353,null))['then'](removeEntity(_0x545353,null))[_0xf867('0x42')](handleError(_0x545353,null));};exports[_0xf867('0x4a')]=function(_0x311da4,_0x3d96df,_0x5cfe1c){var _0x415ed3={};var _0x7dca3b={};var _0x252eb7;var _0x4475db;return db[_0xf867('0x2d')][_0xf867('0x4b')]({'where':{'id':_0x311da4[_0xf867('0x44')]['id']}})[_0xf867('0x27')](handleEntityNotFound(_0x3d96df,null))[_0xf867('0x27')](function(_0x22645b){if(_0x22645b){_0x252eb7=_0x22645b;_0x7dca3b[_0xf867('0x32')]=_['keys'](db[_0xf867('0x4c')][_0xf867('0x2e')]);_0x7dca3b['query']=_[_0xf867('0x34')](_0x311da4[_0xf867('0x33')]);_0x7dca3b['filters']=_[_0xf867('0x37')](_0x7dca3b['model'],_0x7dca3b['query']);_0x415ed3['attributes']=_[_0xf867('0x37')](_0x7dca3b[_0xf867('0x32')],qs[_0xf867('0x38')](_0x311da4[_0xf867('0x33')]['fields']));_0x415ed3[_0xf867('0x36')]=_0x415ed3[_0xf867('0x36')][_0xf867('0x45')]?_0x415ed3[_0xf867('0x36')]:_0x7dca3b[_0xf867('0x32')];_0x415ed3[_0xf867('0x4d')]=qs[_0xf867('0x3a')](_0x311da4[_0xf867('0x33')]['sort']);_0x415ed3[_0xf867('0x3b')]=qs[_0xf867('0x35')](_[_0xf867('0x3c')](_0x311da4['query'],_0x7dca3b[_0xf867('0x35')]));if(_0x311da4[_0xf867('0x33')][_0xf867('0x3d')]){_0x415ed3[_0xf867('0x3b')]=_['merge'](_0x415ed3['where'],{'$or':_[_0xf867('0x2c')](_0x415ed3['attributes'],function(_0x4a8809){var _0xd16ff2={};_0xd16ff2[_0x4a8809]={'$like':'%'+_0x311da4[_0xf867('0x33')]['filter']+'%'};return _0xd16ff2;})});}_0x415ed3=_[_0xf867('0x3e')]({},_0x415ed3,_0x311da4[_0xf867('0x3f')]);return _0x252eb7[_0xf867('0x4a')](_0x415ed3);}})[_0xf867('0x27')](function(_0x307cbb){if(_0x307cbb){_0x4475db=_0x307cbb['length'];if(!_0x311da4[_0xf867('0x33')][_0xf867('0x4e')](_0xf867('0x39'))){_0x415ed3[_0xf867('0x1f')]=qs[_0xf867('0x1f')](_0x311da4[_0xf867('0x33')]['limit']);_0x415ed3[_0xf867('0x1d')]=qs[_0xf867('0x1d')](_0x311da4['query'][_0xf867('0x1d')]);}return _0x252eb7[_0xf867('0x4a')](_0x415ed3);}})[_0xf867('0x27')](function(_0x18b928){if(_0x18b928){return _0x18b928?{'count':_0x4475db,'rows':_0x18b928}:null;}})[_0xf867('0x27')](respondWithResult(_0x3d96df,null))[_0xf867('0x42')](handleError(_0x3d96df,null));};exports[_0xf867('0x4f')]=function(_0x4800a0,_0xe3a8f0,_0x28044e){if(_0x4800a0['body']['id']){delete _0x4800a0[_0xf867('0x50')]['id'];}return db[_0xf867('0x2d')][_0xf867('0x4b')]({'where':{'id':_0x4800a0['params']['id']}})[_0xf867('0x27')](handleEntityNotFound(_0xe3a8f0,null))[_0xf867('0x27')](function(_0x445ce7){if(_0x445ce7){_0x4800a0[_0xf867('0x50')][_0xf867('0x51')]=_0x445ce7['id'];_0x4800a0[_0xf867('0x50')][_0xf867('0x52')]=integrations[_0xf867('0x53')](_0x4800a0[_0xf867('0x50')][_0xf867('0x54')],_0x4800a0[_0xf867('0x50')]['type']);_0x4800a0[_0xf867('0x50')][_0xf867('0x55')]=integrations[_0xf867('0x56')](_0x4800a0[_0xf867('0x50')][_0xf867('0x54')],_0x4800a0[_0xf867('0x50')][_0xf867('0x30')]);return db['FreshdeskConfiguration'][_0xf867('0x49')](_0x4800a0['body'],{'include':[{'model':db[_0xf867('0x57')],'as':_0xf867('0x52')},{'model':db[_0xf867('0x57')],'as':_0xf867('0x55')}]});}return null;})[_0xf867('0x27')](respondWithResult(_0xe3a8f0,null))[_0xf867('0x42')](handleError(_0xe3a8f0,null));};exports[_0xf867('0x58')]=function(_0x1d0b5a,_0xaaec00,_0x4f691d){var _0x3d70ba='';return db[_0xf867('0x2d')][_0xf867('0x4b')]({'where':{'id':_0x1d0b5a[_0xf867('0x44')]['id']},'attributes':['id',_0xf867('0x59'),_0xf867('0x5a')]})[_0xf867('0x27')](handleEntityNotFound(_0xaaec00,null))['then'](function(_0x2fd080){if(_0x2fd080){_0x3d70ba=_0x2fd080[_0xf867('0x59')];var _0xed4ab3=_0x3d70ba[_0xf867('0x5b')](-0x1);if(_0xed4ab3==='/'){_0x3d70ba=_0x3d70ba[_0xf867('0x5c')](0x0,_0x3d70ba[_0xf867('0x5d')](_0xed4ab3));}return rp({'method':_0xf867('0x5e'),'uri':util[_0xf867('0x5f')](_0xf867('0x60'),_0x3d70ba,_0xf867('0x61')),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0xf867('0x5f')](_0xf867('0x62'),_0x2fd080[_0xf867('0x5a')]))[_0xf867('0x63')](_0xf867('0x64')))},'json':!![]});}})['then'](function(_0x37662b){if(_0x37662b){var _0x44e3a8=['requester',_0xf867('0x65'),_0xf867('0x66'),_0xf867('0x67'),_0xf867('0x1a'),_0xf867('0x68'),'group',_0xf867('0x69'),_0xf867('0x6a'),_0xf867('0x6b'),_0xf867('0x6c')];_['remove'](_0x37662b,function(_0x497955){return _0x44e3a8['includes'](_0x497955['name'])||!_0x497955[_0xf867('0x6d')]&&_0x497955[_0xf867('0x30')]!==_0xf867('0x6e')&&_0x497955['type']!==_0xf867('0x6f');});return{'count':_0x37662b[_0xf867('0x45')],'rows':_[_0xf867('0x2c')](_0x37662b,function(_0x9ad8c1){return{'id':_0x9ad8c1['name'],'name':_0x9ad8c1['label'],'custom':!_0x9ad8c1[_0xf867('0x6d')],'options':_0x9ad8c1['choices']?_[_0xf867('0x2c')](_0x9ad8c1[_0xf867('0x70')],function(_0xce1151){return{'name':_[_0xf867('0x71')](_0xce1151),'value':_0xce1151};}):[]};})};}})[_0xf867('0x27')](respondWithResult(_0xaaec00,null))['catch'](function(_0x5d5a72){var _0x16acb4=_0x1d0b5a[_0xf867('0x33')][_0xf867('0x72')]?0x1f4:_0x5d5a72[_0xf867('0x73')]||0x1f4;logger[_0xf867('0x74')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x16acb4,JSON[_0xf867('0x75')](_0x5d5a72));delete _0x5d5a72[_0xf867('0x29')];if(_0x16acb4===0x191){_0x16acb4=0x190;}_0xaaec00[_0xf867('0x1a')](_0x16acb4)[_0xf867('0x2a')](_0x1d0b5a['query']['test']?{'message':_0xf867('0x76'),'statusCode':_0x5d5a72[_0xf867('0x73')]}:_0x5d5a72);});};
\ No newline at end of file
index 9531844..e1dc644 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd089=['define','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','../../components/integrations/configuration'];(function(_0x3e977e,_0x2a57da){var _0x33bbfa=function(_0x29607c){while(--_0x29607c){_0x3e977e['push'](_0x3e977e['shift']());}};_0x33bbfa(++_0x2a57da);}(_0xd089,0x184));var _0x9d08=function(_0x43d6d1,_0x22dfdd){_0x43d6d1=_0x43d6d1-0x0;var _0x1267b3=_0xd089[_0x43d6d1];return _0x1267b3;};'use strict';var _=require(_0x9d08('0x0'));var util=require(_0x9d08('0x1'));var logger=require(_0x9d08('0x2'))(_0x9d08('0x3'));var moment=require('moment');var BPromise=require(_0x9d08('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9d08('0x5'));var config=require(_0x9d08('0x6'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x9d08('0x7'));module['exports']=function(_0x2cc09d,_0x30be24){return _0x2cc09d[_0x9d08('0x8')]('FreshdeskAccount',attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa070=['rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x4611fe,_0x56eff1){var _0x395bbd=function(_0x49b39a){while(--_0x49b39a){_0x4611fe['push'](_0x4611fe['shift']());}};_0x395bbd(++_0x56eff1);}(_0xa070,0x1b4));var _0x0a07=function(_0xae7638,_0x5af955){_0xae7638=_0xae7638-0x0;var _0x5cacfa=_0xa070[_0xae7638];return _0x5cacfa;};'use strict';var _=require(_0x0a07('0x0'));var util=require('util');var logger=require(_0x0a07('0x1'))(_0x0a07('0x2'));var moment=require(_0x0a07('0x3'));var BPromise=require('bluebird');var rp=require(_0x0a07('0x4'));var fs=require('fs');var path=require(_0x0a07('0x5'));var rimraf=require(_0x0a07('0x6'));var config=require(_0x0a07('0x7'));var attributes=require(_0x0a07('0x8'));var integrations=require(_0x0a07('0x9'));module[_0x0a07('0xa')]=function(_0x4b175b,_0x48957f){return _0x4b175b[_0x0a07('0xb')](_0x0a07('0xc'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1f62ad2..af7e1bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x861f=['FreshdeskAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','GetFreshdeskAccount','options','raw','where','attributes','include','map','model','info','FreshdeskAccount','find','ShowFreshdeskAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x301785,_0x506056){var _0x4ea53b=function(_0x5da0a7){while(--_0x5da0a7){_0x301785['push'](_0x301785['shift']());}};_0x4ea53b(++_0x506056);}(_0x861f,0x1ad));var _0xf861=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x861f[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0xf861('0x0'));var util=require(_0xf861('0x1'));var moment=require('moment');var BPromise=require(_0xf861('0x2'));var rs=require(_0xf861('0x3'));var fs=require('fs');var Redis=require(_0xf861('0x4'));var db=require(_0xf861('0x5'))['db'];var utils=require(_0xf861('0x6'));var logger=require(_0xf861('0x7'))(_0xf861('0x8'));var config=require(_0xf861('0x9'));var jayson=require(_0xf861('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xdaf08d,_0x2547e2,_0x156c41){return new BPromise(function(_0x561c85,_0x1588c0){return client[_0xf861('0xb')](_0xdaf08d,_0x156c41)[_0xf861('0xc')](function(_0x5bc91a){logger['info'](_0xf861('0xd'),_0x2547e2,'request\x20sent');logger[_0xf861('0xe')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x2547e2,'request\x20sent',JSON[_0xf861('0xf')](_0x5bc91a));if(_0x5bc91a[_0xf861('0x10')]){if(_0x5bc91a['error'][_0xf861('0x11')]===0x1f4){logger[_0xf861('0x10')](_0xf861('0xd'),_0x2547e2,_0x5bc91a['error'][_0xf861('0x12')]);return _0x1588c0(_0x5bc91a[_0xf861('0x10')][_0xf861('0x12')]);}logger[_0xf861('0x10')](_0xf861('0xd'),_0x2547e2,_0x5bc91a[_0xf861('0x10')][_0xf861('0x12')]);return _0x561c85(_0x5bc91a[_0xf861('0x10')][_0xf861('0x12')]);}else{logger['info'](_0xf861('0xd'),_0x2547e2,_0xf861('0x13'));_0x561c85(_0x5bc91a[_0xf861('0x14')][_0xf861('0x12')]);}})[_0xf861('0x15')](function(_0x5bd289){logger['error'](_0xf861('0xd'),_0x2547e2,_0x5bd289);_0x1588c0(_0x5bd289);});});}exports[_0xf861('0x16')]=function(_0x2eee25){var _0x19f56b=this;return new Promise(function(_0x42e381,_0x552237){return db['FreshdeskAccount']['findAll']({'raw':_0x2eee25[_0xf861('0x17')]?_0x2eee25[_0xf861('0x17')][_0xf861('0x18')]===undefined?!![]:![]:!![],'where':_0x2eee25[_0xf861('0x17')]?_0x2eee25[_0xf861('0x17')][_0xf861('0x19')]||null:null,'attributes':_0x2eee25[_0xf861('0x17')]?_0x2eee25[_0xf861('0x17')][_0xf861('0x1a')]||null:null,'limit':_0x2eee25[_0xf861('0x17')]?_0x2eee25[_0xf861('0x17')]['limit']||null:null,'include':_0x2eee25[_0xf861('0x17')]?_0x2eee25['options'][_0xf861('0x1b')]?_[_0xf861('0x1c')](_0x2eee25['options'][_0xf861('0x1b')],function(_0x62653e){return{'model':db[_0x62653e[_0xf861('0x1d')]],'as':_0x62653e['as'],'attributes':_0x62653e[_0xf861('0x1a')],'include':_0x62653e[_0xf861('0x1b')]?_['map'](_0x62653e[_0xf861('0x1b')],function(_0x40d109){return{'model':db[_0x40d109[_0xf861('0x1d')]],'as':_0x40d109['as'],'attributes':_0x40d109['attributes'],'include':_0x40d109[_0xf861('0x1b')]?_['map'](_0x40d109[_0xf861('0x1b')],function(_0x5b694c){return{'model':db[_0x5b694c[_0xf861('0x1d')]],'as':_0x5b694c['as'],'attributes':_0x5b694c[_0xf861('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x243d82){logger[_0xf861('0x1e')](_0xf861('0x16'),_0x2eee25);logger[_0xf861('0xe')](_0xf861('0x16'),_0x2eee25,JSON[_0xf861('0xf')](_0x243d82));_0x42e381(_0x243d82);})['catch'](function(_0x51bddd){logger[_0xf861('0x10')]('GetFreshdeskAccount',_0x51bddd[_0xf861('0x12')],_0x2eee25);_0x552237(_0x19f56b[_0xf861('0x10')](0x1f4,_0x51bddd[_0xf861('0x12')]));});});};exports['ShowFreshdeskAccount']=function(_0x1e1c05){var _0x5d4206=this;return new Promise(function(_0x354906,_0x2123ec){return db[_0xf861('0x1f')][_0xf861('0x20')]({'raw':_0x1e1c05['options']?_0x1e1c05['options'][_0xf861('0x18')]===undefined?!![]:![]:!![],'where':_0x1e1c05[_0xf861('0x17')]?_0x1e1c05['options'][_0xf861('0x19')]||null:null,'attributes':_0x1e1c05['options']?_0x1e1c05[_0xf861('0x17')][_0xf861('0x1a')]||null:null,'include':_0x1e1c05[_0xf861('0x17')]?_0x1e1c05[_0xf861('0x17')][_0xf861('0x1b')]?_['map'](_0x1e1c05[_0xf861('0x17')][_0xf861('0x1b')],function(_0x2d55fa){return{'model':db[_0x2d55fa['model']],'as':_0x2d55fa['as'],'attributes':_0x2d55fa[_0xf861('0x1a')],'include':_0x2d55fa['include']?_[_0xf861('0x1c')](_0x2d55fa[_0xf861('0x1b')],function(_0x4a0ec1){return{'model':db[_0x4a0ec1[_0xf861('0x1d')]],'as':_0x4a0ec1['as'],'attributes':_0x4a0ec1[_0xf861('0x1a')],'include':_0x4a0ec1[_0xf861('0x1b')]?_[_0xf861('0x1c')](_0x4a0ec1['include'],function(_0x18d788){return{'model':db[_0x18d788[_0xf861('0x1d')]],'as':_0x18d788['as'],'attributes':_0x18d788[_0xf861('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf861('0xc')](function(_0x47d3bd){logger[_0xf861('0x1e')](_0xf861('0x21'),_0x1e1c05);logger[_0xf861('0xe')](_0xf861('0x21'),_0x1e1c05,JSON[_0xf861('0xf')](_0x47d3bd));_0x354906(_0x47d3bd);})[_0xf861('0x15')](function(_0x17800e){logger[_0xf861('0x10')](_0xf861('0x21'),_0x17800e[_0xf861('0x12')],_0x1e1c05);_0x2123ec(_0x5d4206[_0xf861('0x10')](0x1f4,_0x17800e[_0xf861('0x12')]));});});};
\ No newline at end of file
+var _0x2624=['attributes','limit','include','model','map','GetFreshdeskAccount','find','where','ShowFreshdeskAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','FreshdeskAccount','findAll','options','raw'];(function(_0x40df5f,_0x8fd59f){var _0x1573f1=function(_0x57b8b8){while(--_0x57b8b8){_0x40df5f['push'](_0x40df5f['shift']());}};_0x1573f1(++_0x8fd59f);}(_0x2624,0x75));var _0x4262=function(_0x4ac334,_0x28341d){_0x4ac334=_0x4ac334-0x0;var _0x5a9f83=_0x2624[_0x4ac334];return _0x5a9f83;};'use strict';var _=require(_0x4262('0x0'));var util=require(_0x4262('0x1'));var moment=require('moment');var BPromise=require(_0x4262('0x2'));var rs=require(_0x4262('0x3'));var fs=require('fs');var Redis=require(_0x4262('0x4'));var db=require(_0x4262('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4262('0x6'))(_0x4262('0x7'));var config=require(_0x4262('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4262('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3bc80c,_0x33765f,_0x414a21){return new BPromise(function(_0x4f35cb,_0x590268){return client[_0x4262('0xa')](_0x3bc80c,_0x414a21)[_0x4262('0xb')](function(_0x221be9){logger[_0x4262('0xc')](_0x4262('0xd'),_0x33765f,_0x4262('0xe'));logger[_0x4262('0xf')](_0x4262('0x10'),_0x33765f,_0x4262('0xe'),JSON[_0x4262('0x11')](_0x221be9));if(_0x221be9['error']){if(_0x221be9['error'][_0x4262('0x12')]===0x1f4){logger[_0x4262('0x13')](_0x4262('0xd'),_0x33765f,_0x221be9['error'][_0x4262('0x14')]);return _0x590268(_0x221be9[_0x4262('0x13')][_0x4262('0x14')]);}logger[_0x4262('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x33765f,_0x221be9[_0x4262('0x13')][_0x4262('0x14')]);return _0x4f35cb(_0x221be9[_0x4262('0x13')]['message']);}else{logger[_0x4262('0xc')]('FreshdeskAccount,\x20%s,\x20%s',_0x33765f,'request\x20sent');_0x4f35cb(_0x221be9[_0x4262('0x15')][_0x4262('0x14')]);}})[_0x4262('0x16')](function(_0x12e0e6){logger[_0x4262('0x13')](_0x4262('0xd'),_0x33765f,_0x12e0e6);_0x590268(_0x12e0e6);});});}exports['GetFreshdeskAccount']=function(_0x25e972){var _0x202f6b=this;return new Promise(function(_0x2c760f,_0x112774){return db[_0x4262('0x17')][_0x4262('0x18')]({'raw':_0x25e972[_0x4262('0x19')]?_0x25e972[_0x4262('0x19')][_0x4262('0x1a')]===undefined?!![]:![]:!![],'where':_0x25e972['options']?_0x25e972['options']['where']||null:null,'attributes':_0x25e972['options']?_0x25e972[_0x4262('0x19')][_0x4262('0x1b')]||null:null,'limit':_0x25e972[_0x4262('0x19')]?_0x25e972[_0x4262('0x19')][_0x4262('0x1c')]||null:null,'include':_0x25e972[_0x4262('0x19')]?_0x25e972[_0x4262('0x19')][_0x4262('0x1d')]?_['map'](_0x25e972[_0x4262('0x19')]['include'],function(_0x210ed5){return{'model':db[_0x210ed5[_0x4262('0x1e')]],'as':_0x210ed5['as'],'attributes':_0x210ed5[_0x4262('0x1b')],'include':_0x210ed5[_0x4262('0x1d')]?_[_0x4262('0x1f')](_0x210ed5[_0x4262('0x1d')],function(_0x91a242){return{'model':db[_0x91a242[_0x4262('0x1e')]],'as':_0x91a242['as'],'attributes':_0x91a242['attributes'],'include':_0x91a242[_0x4262('0x1d')]?_['map'](_0x91a242['include'],function(_0x41e83b){return{'model':db[_0x41e83b['model']],'as':_0x41e83b['as'],'attributes':_0x41e83b[_0x4262('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4262('0xb')](function(_0xb87c61){logger['info'](_0x4262('0x20'),_0x25e972);logger['debug'](_0x4262('0x20'),_0x25e972,JSON[_0x4262('0x11')](_0xb87c61));_0x2c760f(_0xb87c61);})[_0x4262('0x16')](function(_0x22dc24){logger[_0x4262('0x13')](_0x4262('0x20'),_0x22dc24[_0x4262('0x14')],_0x25e972);_0x112774(_0x202f6b[_0x4262('0x13')](0x1f4,_0x22dc24['message']));});});};exports['ShowFreshdeskAccount']=function(_0x1c0453){var _0x3a16b1=this;return new Promise(function(_0x44e822,_0x50c5b3){return db[_0x4262('0x17')][_0x4262('0x21')]({'raw':_0x1c0453[_0x4262('0x19')]?_0x1c0453[_0x4262('0x19')][_0x4262('0x1a')]===undefined?!![]:![]:!![],'where':_0x1c0453['options']?_0x1c0453['options'][_0x4262('0x22')]||null:null,'attributes':_0x1c0453['options']?_0x1c0453[_0x4262('0x19')][_0x4262('0x1b')]||null:null,'include':_0x1c0453[_0x4262('0x19')]?_0x1c0453[_0x4262('0x19')]['include']?_['map'](_0x1c0453[_0x4262('0x19')][_0x4262('0x1d')],function(_0x218528){return{'model':db[_0x218528['model']],'as':_0x218528['as'],'attributes':_0x218528[_0x4262('0x1b')],'include':_0x218528[_0x4262('0x1d')]?_[_0x4262('0x1f')](_0x218528[_0x4262('0x1d')],function(_0x36849d){return{'model':db[_0x36849d[_0x4262('0x1e')]],'as':_0x36849d['as'],'attributes':_0x36849d[_0x4262('0x1b')],'include':_0x36849d[_0x4262('0x1d')]?_['map'](_0x36849d[_0x4262('0x1d')],function(_0x67503){return{'model':db[_0x67503[_0x4262('0x1e')]],'as':_0x67503['as'],'attributes':_0x67503[_0x4262('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4262('0xb')](function(_0x154935){logger[_0x4262('0xc')](_0x4262('0x23'),_0x1c0453);logger[_0x4262('0xf')]('ShowFreshdeskAccount',_0x1c0453,JSON[_0x4262('0x11')](_0x154935));_0x44e822(_0x154935);})['catch'](function(_0x449d22){logger[_0x4262('0x13')](_0x4262('0x23'),_0x449d22[_0x4262('0x14')],_0x1c0453);_0x50c5b3(_0x3a16b1[_0x4262('0x13')](0x1f4,_0x449d22[_0x4262('0x14')]));});});};
\ No newline at end of file
index b940303..6bfa4bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8932=['getSubjects','/:id/descriptions','getDescriptions','create','post','/:id/tags','setTags','put','destroy','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','show','get','/:id/fields','getFields','/:id/subjects'];(function(_0xcd49bd,_0x2a12a3){var _0xb6ee44=function(_0x1f77bb){while(--_0x1f77bb){_0xcd49bd['push'](_0xcd49bd['shift']());}};_0xb6ee44(++_0x2a12a3);}(_0x8932,0xd2));var _0x2893=function(_0x40ed9c,_0x4aa80d){_0x40ed9c=_0x40ed9c-0x0;var _0x296758=_0x8932[_0x40ed9c];return _0x296758;};'use strict';var multer=require(_0x2893('0x0'));var util=require(_0x2893('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2893('0x2'));var router=express[_0x2893('0x3')]();var fs_extra=require(_0x2893('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2893('0x5'));var config=require(_0x2893('0x6'));var controller=require(_0x2893('0x7'));router['get']('/',auth[_0x2893('0x8')](),controller[_0x2893('0x9')]);router['get']('/:id',auth[_0x2893('0x8')](),controller[_0x2893('0xa')]);router[_0x2893('0xb')](_0x2893('0xc'),auth['isAuthenticated'](),controller[_0x2893('0xd')]);router[_0x2893('0xb')](_0x2893('0xe'),auth['isAuthenticated'](),controller[_0x2893('0xf')]);router[_0x2893('0xb')](_0x2893('0x10'),auth[_0x2893('0x8')](),controller[_0x2893('0x11')]);router[_0x2893('0xb')]('/:id/tags',auth[_0x2893('0x8')](),controller['getTags']);router['post']('/',auth[_0x2893('0x8')](),controller[_0x2893('0x12')]);router[_0x2893('0x13')](_0x2893('0x14'),auth['isAuthenticated'](),controller[_0x2893('0x15')]);router[_0x2893('0x16')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x2893('0x8')](),controller[_0x2893('0x17')]);module[_0x2893('0x18')]=router;
\ No newline at end of file
+var _0xefbd=['/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','setTags','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','index','isAuthenticated'];(function(_0x3ff7d4,_0x37049e){var _0x7d1322=function(_0x590d11){while(--_0x590d11){_0x3ff7d4['push'](_0x3ff7d4['shift']());}};_0x7d1322(++_0x37049e);}(_0xefbd,0x1eb));var _0xdefb=function(_0x20e51b,_0x1d21bc){_0x20e51b=_0x20e51b-0x0;var _0x4d8fc4=_0xefbd[_0x20e51b];return _0x4d8fc4;};'use strict';var multer=require(_0xdefb('0x0'));var util=require(_0xdefb('0x1'));var path=require(_0xdefb('0x2'));var timeout=require('connect-timeout');var express=require(_0xdefb('0x3'));var router=express[_0xdefb('0x4')]();var fs_extra=require(_0xdefb('0x5'));var auth=require(_0xdefb('0x6'));var interaction=require(_0xdefb('0x7'));var config=require(_0xdefb('0x8'));var controller=require(_0xdefb('0x9'));router[_0xdefb('0xa')]('/',auth['isAuthenticated'](),controller[_0xdefb('0xb')]);router[_0xdefb('0xa')]('/:id',auth[_0xdefb('0xc')](),controller['show']);router[_0xdefb('0xa')](_0xdefb('0xd'),auth['isAuthenticated'](),controller[_0xdefb('0xe')]);router[_0xdefb('0xa')](_0xdefb('0xf'),auth[_0xdefb('0xc')](),controller[_0xdefb('0x10')]);router[_0xdefb('0xa')](_0xdefb('0x11'),auth['isAuthenticated'](),controller[_0xdefb('0x12')]);router['get'](_0xdefb('0x13'),auth['isAuthenticated'](),controller['getTags']);router[_0xdefb('0x14')]('/',auth[_0xdefb('0xc')](),controller[_0xdefb('0x15')]);router[_0xdefb('0x14')](_0xdefb('0x13'),auth[_0xdefb('0xc')](),controller[_0xdefb('0x16')]);router[_0xdefb('0x17')]('/:id',auth[_0xdefb('0xc')](),controller[_0xdefb('0x18')]);router[_0xdefb('0x19')]('/:id',auth['isAuthenticated'](),controller[_0xdefb('0x1a')]);module[_0xdefb('0x1b')]=router;
\ No newline at end of file
index 8ec04c4..4d20bdb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79a6=['sequelize','exports','STRING'];(function(_0x11628a,_0x230a79){var _0x484f67=function(_0xde39c5){while(--_0xde39c5){_0x11628a['push'](_0x11628a['shift']());}};_0x484f67(++_0x230a79);}(_0x79a6,0xf3));var _0x679a=function(_0x408b34,_0xb7d872){_0x408b34=_0x408b34-0x0;var _0x1182aa=_0x79a6[_0x408b34];return _0x1182aa;};'use strict';var Sequelize=require(_0x679a('0x0'));module[_0x679a('0x1')]={'name':{'type':Sequelize[_0x679a('0x2')]},'description':{'type':Sequelize[_0x679a('0x2')]}};
\ No newline at end of file
+var _0xf836=['exports','STRING','sequelize'];(function(_0x48ac40,_0x1e3beb){var _0x55df02=function(_0x5e27d6){while(--_0x5e27d6){_0x48ac40['push'](_0x48ac40['shift']());}};_0x55df02(++_0x1e3beb);}(_0xf836,0x1f4));var _0x6f83=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xf836[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x6f83('0x0'));module[_0x6f83('0x1')]={'name':{'type':Sequelize[_0x6f83('0x2')]},'description':{'type':Sequelize[_0x6f83('0x2')]}};
\ No newline at end of file
index 5639084..21aa2f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5507=['pick','filters','filter','VIRTUAL','merge','options','count','includeAll','include','catch','show','params','create','body','find','findOne','FreshdeskField','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','undefined','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','FreshdeskConfiguration','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x448bab,_0x25517b){var _0x5dc534=function(_0x2196ba){while(--_0x2196ba){_0x448bab['push'](_0x448bab['shift']());}};_0x5dc534(++_0x25517b);}(_0x5507,0x1b6));var _0x7550=function(_0x4f8aec,_0x468088){_0x4f8aec=_0x4f8aec-0x0;var _0x343f45=_0x5507[_0x4f8aec];return _0x343f45;};'use strict';var emlformat=require(_0x7550('0x0'));var rimraf=require(_0x7550('0x1'));var zipdir=require(_0x7550('0x2'));var jsonpatch=require(_0x7550('0x3'));var rp=require(_0x7550('0x4'));var moment=require(_0x7550('0x5'));var BPromise=require(_0x7550('0x6'));var Mustache=require(_0x7550('0x7'));var util=require('util');var path=require(_0x7550('0x8'));var sox=require('sox');var csv=require(_0x7550('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7550('0xa'));var _=require(_0x7550('0xb'));var squel=require(_0x7550('0xc'));var crypto=require('crypto');var jsforce=require(_0x7550('0xd'));var deskjs=require(_0x7550('0xe'));var toCsv=require(_0x7550('0x9'));var querystring=require(_0x7550('0xf'));var Papa=require(_0x7550('0x10'));var Redis=require(_0x7550('0x11'));var authService=require(_0x7550('0x12'));var qs=require(_0x7550('0x13'));var as=require(_0x7550('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7550('0x15'));var utils=require(_0x7550('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7550('0x17'));var db=require(_0x7550('0x18'))['db'];function respondWithStatusCode(_0x151867,_0x1da917){_0x1da917=_0x1da917||0xcc;return function(_0x34c7ec){if(_0x34c7ec){return _0x151867[_0x7550('0x19')](_0x1da917);}return _0x151867['status'](_0x1da917)[_0x7550('0x1a')]();};}function respondWithResult(_0x4b2085,_0x6c095a){_0x6c095a=_0x6c095a||0xc8;return function(_0x1e8958){if(_0x1e8958){return _0x4b2085[_0x7550('0x1b')](_0x6c095a)['json'](_0x1e8958);}};}function respondWithFilteredResult(_0x231831,_0x58b002){return function(_0x1f69ff){if(_0x1f69ff){var _0x25a786=typeof _0x58b002['offset']===_0x7550('0x1c')&&typeof _0x58b002['limit']==='undefined';var _0x508171=_0x1f69ff['count'];var _0x208a7a=_0x25a786?0x0:_0x58b002['offset'];var _0x1183e5=_0x25a786?_0x1f69ff['count']:_0x58b002[_0x7550('0x1d')]+_0x58b002[_0x7550('0x1e')];var _0x35b260;if(_0x1183e5>=_0x508171){_0x1183e5=_0x508171;_0x35b260=0xc8;}else{_0x35b260=0xce;}_0x231831[_0x7550('0x1b')](_0x35b260);return _0x231831[_0x7550('0x1f')]('Content-Range',_0x208a7a+'-'+_0x1183e5+'/'+_0x508171)['json'](_0x1f69ff);}return null;};}function patchUpdates(_0x39f25b){return function(_0x593350){try{jsonpatch[_0x7550('0x20')](_0x593350,_0x39f25b,!![]);}catch(_0x52c367){return BPromise[_0x7550('0x21')](_0x52c367);}return _0x593350[_0x7550('0x22')]();};}function saveUpdates(_0x413429,_0x3b98fd){return function(_0x29afd5){if(_0x29afd5){return _0x29afd5[_0x7550('0x23')](_0x413429)[_0x7550('0x24')](function(_0x8ce54c){return _0x8ce54c;});}return null;};}function removeEntity(_0x568afb,_0x3ff582){return function(_0x3aff76){if(_0x3aff76){return _0x3aff76[_0x7550('0x25')]()[_0x7550('0x24')](function(){_0x568afb[_0x7550('0x1b')](0xcc)[_0x7550('0x1a')]();});}};}function handleEntityNotFound(_0x337c33,_0x182466){return function(_0x8f76db){if(!_0x8f76db){_0x337c33['sendStatus'](0x194);}return _0x8f76db;};}function handleError(_0x31572b,_0x47bd91){_0x47bd91=_0x47bd91||0x1f4;return function(_0xc446a1){logger[_0x7550('0x26')](_0xc446a1[_0x7550('0x27')]);if(_0xc446a1['name']){delete _0xc446a1[_0x7550('0x28')];}_0x31572b['status'](_0x47bd91)[_0x7550('0x29')](_0xc446a1);};}exports[_0x7550('0x2a')]=function(_0x35ac46,_0x36b063){var _0x4c063a={},_0x5e1284={},_0x146e24={'count':0x0,'rows':[]};var _0x489438=_['map'](db[_0x7550('0x2b')][_0x7550('0x2c')],function(_0x3bdc09){return{'name':_0x3bdc09['fieldName'],'type':_0x3bdc09[_0x7550('0x2d')][_0x7550('0x2e')]};});_0x5e1284[_0x7550('0x2f')]=_[_0x7550('0x30')](_0x489438,_0x7550('0x28'));_0x5e1284[_0x7550('0x31')]=_[_0x7550('0x32')](_0x35ac46[_0x7550('0x31')]);_0x5e1284['filters']=_[_0x7550('0x33')](_0x5e1284['model'],_0x5e1284[_0x7550('0x31')]);_0x4c063a[_0x7550('0x34')]=_['intersection'](_0x5e1284['model'],qs['fields'](_0x35ac46[_0x7550('0x31')][_0x7550('0x35')]));_0x4c063a['attributes']=_0x4c063a[_0x7550('0x34')][_0x7550('0x36')]?_0x4c063a['attributes']:_0x5e1284[_0x7550('0x2f')];if(!_0x35ac46[_0x7550('0x31')][_0x7550('0x37')](_0x7550('0x38'))){_0x4c063a[_0x7550('0x1e')]=qs[_0x7550('0x1e')](_0x35ac46[_0x7550('0x31')][_0x7550('0x1e')]);_0x4c063a[_0x7550('0x1d')]=qs[_0x7550('0x1d')](_0x35ac46[_0x7550('0x31')]['offset']);}_0x4c063a[_0x7550('0x39')]=qs[_0x7550('0x3a')](_0x35ac46['query']['sort']);_0x4c063a[_0x7550('0x3b')]=qs['filters'](_[_0x7550('0x3c')](_0x35ac46[_0x7550('0x31')],_0x5e1284[_0x7550('0x3d')]),_0x489438);if(_0x35ac46[_0x7550('0x31')][_0x7550('0x3e')]){_0x4c063a[_0x7550('0x3b')]=_['merge'](_0x4c063a[_0x7550('0x3b')],{'$or':_[_0x7550('0x30')](_0x489438,function(_0x58ff70){if(_0x58ff70[_0x7550('0x2d')]!==_0x7550('0x3f')){var _0x1ab9f9={};_0x1ab9f9[_0x58ff70[_0x7550('0x28')]]={'$like':'%'+_0x35ac46[_0x7550('0x31')][_0x7550('0x3e')]+'%'};return _0x1ab9f9;}})});}_0x4c063a=_[_0x7550('0x40')]({},_0x4c063a,_0x35ac46[_0x7550('0x41')]);var _0x551425={'where':_0x4c063a['where']};return db[_0x7550('0x2b')][_0x7550('0x42')](_0x551425)['then'](function(_0xed737e){_0x146e24[_0x7550('0x42')]=_0xed737e;if(_0x35ac46[_0x7550('0x31')][_0x7550('0x43')]){_0x4c063a[_0x7550('0x44')]=[{'all':!![]}];}return db[_0x7550('0x2b')]['findAll'](_0x4c063a);})[_0x7550('0x24')](function(_0x32ba88){_0x146e24['rows']=_0x32ba88;return _0x146e24;})['then'](respondWithFilteredResult(_0x36b063,_0x4c063a))[_0x7550('0x45')](handleError(_0x36b063,null));};exports[_0x7550('0x46')]=function(_0x99bdb,_0x26e613){var _0xe15e99={'raw':![],'where':{'id':_0x99bdb[_0x7550('0x47')]['id']}},_0xf86b77={};_0xf86b77[_0x7550('0x2f')]=_[_0x7550('0x32')](db[_0x7550('0x2b')][_0x7550('0x2c')]);_0xf86b77['query']=_[_0x7550('0x32')](_0x99bdb[_0x7550('0x31')]);_0xf86b77[_0x7550('0x3d')]=_['intersection'](_0xf86b77[_0x7550('0x2f')],_0xf86b77[_0x7550('0x31')]);_0xe15e99[_0x7550('0x34')]=_[_0x7550('0x33')](_0xf86b77['model'],qs[_0x7550('0x35')](_0x99bdb[_0x7550('0x31')][_0x7550('0x35')]));_0xe15e99[_0x7550('0x34')]=_0xe15e99['attributes'][_0x7550('0x36')]?_0xe15e99[_0x7550('0x34')]:_0xf86b77['model'];if(_0x99bdb[_0x7550('0x31')][_0x7550('0x43')]){_0xe15e99[_0x7550('0x44')]=[{'all':!![]}];}_0xe15e99=_[_0x7550('0x40')]({},_0xe15e99,_0x99bdb['options']);return db[_0x7550('0x2b')]['find'](_0xe15e99)[_0x7550('0x24')](handleEntityNotFound(_0x26e613,null))[_0x7550('0x24')](respondWithResult(_0x26e613,null))[_0x7550('0x45')](handleError(_0x26e613,null));};exports[_0x7550('0x48')]=function(_0xa7c0e0,_0x5b1f30){return db['FreshdeskConfiguration'][_0x7550('0x48')](_0xa7c0e0['body'],{})[_0x7550('0x24')](respondWithResult(_0x5b1f30,0xc9))['catch'](handleError(_0x5b1f30,null));};exports[_0x7550('0x23')]=function(_0x2fc7f2,_0x5f00cf){if(_0x2fc7f2[_0x7550('0x49')]['id']){delete _0x2fc7f2[_0x7550('0x49')]['id'];}return db[_0x7550('0x2b')][_0x7550('0x4a')]({'where':{'id':_0x2fc7f2['params']['id']}})[_0x7550('0x24')](handleEntityNotFound(_0x5f00cf,null))[_0x7550('0x24')](saveUpdates(_0x2fc7f2['body'],null))[_0x7550('0x24')](respondWithResult(_0x5f00cf,null))['catch'](handleError(_0x5f00cf,null));};exports['destroy']=function(_0x45b56e,_0x364348){return db[_0x7550('0x2b')][_0x7550('0x4a')]({'where':{'id':_0x45b56e[_0x7550('0x47')]['id']}})[_0x7550('0x24')](handleEntityNotFound(_0x364348,null))[_0x7550('0x24')](removeEntity(_0x364348,null))[_0x7550('0x45')](handleError(_0x364348,null));};exports['getFields']=function(_0x4187,_0x5e4a18,_0x11c40f){var _0x433b07={};var _0x6e8888={};var _0xc1bce3;var _0x2affb2;return db[_0x7550('0x2b')][_0x7550('0x4b')]({'where':{'id':_0x4187['params']['id']}})[_0x7550('0x24')](handleEntityNotFound(_0x5e4a18,null))[_0x7550('0x24')](function(_0x5c41c3){if(_0x5c41c3){_0xc1bce3=_0x5c41c3;_0x6e8888[_0x7550('0x2f')]=_['keys'](db[_0x7550('0x4c')][_0x7550('0x2c')]);_0x6e8888[_0x7550('0x31')]=_[_0x7550('0x32')](_0x4187[_0x7550('0x31')]);_0x6e8888[_0x7550('0x3d')]=_[_0x7550('0x33')](_0x6e8888[_0x7550('0x2f')],_0x6e8888[_0x7550('0x31')]);_0x433b07[_0x7550('0x34')]=_[_0x7550('0x33')](_0x6e8888['model'],qs[_0x7550('0x35')](_0x4187[_0x7550('0x31')]['fields']));_0x433b07['attributes']=_0x433b07[_0x7550('0x34')]['length']?_0x433b07['attributes']:_0x6e8888[_0x7550('0x2f')];_0x433b07[_0x7550('0x39')]=qs['sort'](_0x4187[_0x7550('0x31')][_0x7550('0x3a')]);_0x433b07[_0x7550('0x3b')]=qs['filters'](_['pick'](_0x4187[_0x7550('0x31')],_0x6e8888[_0x7550('0x3d')]));if(_0x4187[_0x7550('0x31')][_0x7550('0x3e')]){_0x433b07[_0x7550('0x3b')]=_[_0x7550('0x40')](_0x433b07[_0x7550('0x3b')],{'$or':_[_0x7550('0x30')](_0x433b07[_0x7550('0x34')],function(_0x187870){var _0x5bc99e={};_0x5bc99e[_0x187870]={'$like':'%'+_0x4187[_0x7550('0x31')]['filter']+'%'};return _0x5bc99e;})});}_0x433b07=_['merge']({},_0x433b07,_0x4187[_0x7550('0x41')]);return _0xc1bce3[_0x7550('0x4d')](_0x433b07);}})[_0x7550('0x24')](function(_0x27c376){if(_0x27c376){_0x2affb2=_0x27c376[_0x7550('0x36')];if(!_0x4187['query'][_0x7550('0x37')](_0x7550('0x38'))){_0x433b07[_0x7550('0x1e')]=qs['limit'](_0x4187[_0x7550('0x31')]['limit']);_0x433b07[_0x7550('0x1d')]=qs[_0x7550('0x1d')](_0x4187[_0x7550('0x31')][_0x7550('0x1d')]);}return _0xc1bce3[_0x7550('0x4d')](_0x433b07);}})[_0x7550('0x24')](function(_0xb2d129){if(_0xb2d129){return _0xb2d129?{'count':_0x2affb2,'rows':_0xb2d129}:null;}})[_0x7550('0x24')](respondWithResult(_0x5e4a18,null))['catch'](handleError(_0x5e4a18,null));};exports['getSubjects']=function(_0x61d997,_0x4fbd22,_0x5b7abf){var _0x1bf2d3={};var _0x30c8cd={};var _0x535670;var _0x37c9f5;return db[_0x7550('0x2b')][_0x7550('0x4b')]({'where':{'id':_0x61d997['params']['id']}})[_0x7550('0x24')](handleEntityNotFound(_0x4fbd22,null))[_0x7550('0x24')](function(_0x52e75d){if(_0x52e75d){_0x535670=_0x52e75d;_0x30c8cd[_0x7550('0x2f')]=_[_0x7550('0x32')](db[_0x7550('0x4c')][_0x7550('0x2c')]);_0x30c8cd[_0x7550('0x31')]=_[_0x7550('0x32')](_0x61d997[_0x7550('0x31')]);_0x30c8cd[_0x7550('0x3d')]=_[_0x7550('0x33')](_0x30c8cd[_0x7550('0x2f')],_0x30c8cd[_0x7550('0x31')]);_0x1bf2d3[_0x7550('0x34')]=_[_0x7550('0x33')](_0x30c8cd[_0x7550('0x2f')],qs[_0x7550('0x35')](_0x61d997[_0x7550('0x31')][_0x7550('0x35')]));_0x1bf2d3[_0x7550('0x34')]=_0x1bf2d3[_0x7550('0x34')][_0x7550('0x36')]?_0x1bf2d3['attributes']:_0x30c8cd[_0x7550('0x2f')];_0x1bf2d3[_0x7550('0x39')]=qs[_0x7550('0x3a')](_0x61d997[_0x7550('0x31')][_0x7550('0x3a')]);_0x1bf2d3['where']=qs['filters'](_['pick'](_0x61d997[_0x7550('0x31')],_0x30c8cd['filters']));if(_0x61d997[_0x7550('0x31')][_0x7550('0x3e')]){_0x1bf2d3['where']=_[_0x7550('0x40')](_0x1bf2d3[_0x7550('0x3b')],{'$or':_['map'](_0x1bf2d3[_0x7550('0x34')],function(_0x247769){var _0x4d1827={};_0x4d1827[_0x247769]={'$like':'%'+_0x61d997[_0x7550('0x31')][_0x7550('0x3e')]+'%'};return _0x4d1827;})});}_0x1bf2d3=_[_0x7550('0x40')]({},_0x1bf2d3,_0x61d997[_0x7550('0x41')]);return _0x535670['getSubjects'](_0x1bf2d3);}})['then'](function(_0x4be17a){if(_0x4be17a){_0x37c9f5=_0x4be17a['length'];if(!_0x61d997['query']['hasOwnProperty']('nolimit')){_0x1bf2d3[_0x7550('0x1e')]=qs['limit'](_0x61d997[_0x7550('0x31')][_0x7550('0x1e')]);_0x1bf2d3[_0x7550('0x1d')]=qs[_0x7550('0x1d')](_0x61d997[_0x7550('0x31')][_0x7550('0x1d')]);}return _0x535670[_0x7550('0x4e')](_0x1bf2d3);}})[_0x7550('0x24')](function(_0x200d46){if(_0x200d46){return _0x200d46?{'count':_0x37c9f5,'rows':_0x200d46}:null;}})[_0x7550('0x24')](respondWithResult(_0x4fbd22,null))['catch'](handleError(_0x4fbd22,null));};exports['getDescriptions']=function(_0x44dd7a,_0x905ac1,_0xac1398){var _0x57b6f3={};var _0x32b164={};var _0x1a7783;var _0x2753ed;return db[_0x7550('0x2b')][_0x7550('0x4b')]({'where':{'id':_0x44dd7a[_0x7550('0x47')]['id']}})[_0x7550('0x24')](handleEntityNotFound(_0x905ac1,null))[_0x7550('0x24')](function(_0x299655){if(_0x299655){_0x1a7783=_0x299655;_0x32b164[_0x7550('0x2f')]=_['keys'](db['FreshdeskField'][_0x7550('0x2c')]);_0x32b164[_0x7550('0x31')]=_[_0x7550('0x32')](_0x44dd7a['query']);_0x32b164[_0x7550('0x3d')]=_[_0x7550('0x33')](_0x32b164['model'],_0x32b164['query']);_0x57b6f3[_0x7550('0x34')]=_[_0x7550('0x33')](_0x32b164[_0x7550('0x2f')],qs[_0x7550('0x35')](_0x44dd7a[_0x7550('0x31')][_0x7550('0x35')]));_0x57b6f3[_0x7550('0x34')]=_0x57b6f3[_0x7550('0x34')]['length']?_0x57b6f3[_0x7550('0x34')]:_0x32b164['model'];_0x57b6f3[_0x7550('0x39')]=qs[_0x7550('0x3a')](_0x44dd7a['query'][_0x7550('0x3a')]);_0x57b6f3[_0x7550('0x3b')]=qs[_0x7550('0x3d')](_[_0x7550('0x3c')](_0x44dd7a[_0x7550('0x31')],_0x32b164[_0x7550('0x3d')]));if(_0x44dd7a[_0x7550('0x31')][_0x7550('0x3e')]){_0x57b6f3['where']=_[_0x7550('0x40')](_0x57b6f3['where'],{'$or':_[_0x7550('0x30')](_0x57b6f3[_0x7550('0x34')],function(_0x2f7b54){var _0x279c1e={};_0x279c1e[_0x2f7b54]={'$like':'%'+_0x44dd7a[_0x7550('0x31')]['filter']+'%'};return _0x279c1e;})});}_0x57b6f3=_[_0x7550('0x40')]({},_0x57b6f3,_0x44dd7a[_0x7550('0x41')]);return _0x1a7783[_0x7550('0x4f')](_0x57b6f3);}})[_0x7550('0x24')](function(_0x37df68){if(_0x37df68){_0x2753ed=_0x37df68[_0x7550('0x36')];if(!_0x44dd7a[_0x7550('0x31')][_0x7550('0x37')](_0x7550('0x38'))){_0x57b6f3[_0x7550('0x1e')]=qs[_0x7550('0x1e')](_0x44dd7a[_0x7550('0x31')][_0x7550('0x1e')]);_0x57b6f3[_0x7550('0x1d')]=qs['offset'](_0x44dd7a[_0x7550('0x31')]['offset']);}return _0x1a7783[_0x7550('0x4f')](_0x57b6f3);}})[_0x7550('0x24')](function(_0x526b92){if(_0x526b92){return _0x526b92?{'count':_0x2753ed,'rows':_0x526b92}:null;}})[_0x7550('0x24')](respondWithResult(_0x905ac1,null))[_0x7550('0x45')](handleError(_0x905ac1,null));};exports[_0x7550('0x50')]=function(_0x3e1d92,_0x27e33a,_0x4bbfec){var _0x2f74cf={};var _0x56de0e={};var _0x1afa7f;var _0x4de7ce;return db[_0x7550('0x2b')]['findOne']({'where':{'id':_0x3e1d92['params']['id']}})[_0x7550('0x24')](handleEntityNotFound(_0x27e33a,null))[_0x7550('0x24')](function(_0x32e7a4){if(_0x32e7a4){_0x1afa7f=_0x32e7a4;_0x56de0e[_0x7550('0x2f')]=_[_0x7550('0x32')](db[_0x7550('0x51')][_0x7550('0x2c')]);_0x56de0e[_0x7550('0x31')]=_['keys'](_0x3e1d92[_0x7550('0x31')]);_0x56de0e[_0x7550('0x3d')]=_[_0x7550('0x33')](_0x56de0e[_0x7550('0x2f')],_0x56de0e['query']);_0x2f74cf['attributes']=_[_0x7550('0x33')](_0x56de0e[_0x7550('0x2f')],qs[_0x7550('0x35')](_0x3e1d92['query'][_0x7550('0x35')]));_0x2f74cf[_0x7550('0x34')]=_0x2f74cf['attributes'][_0x7550('0x36')]?_0x2f74cf[_0x7550('0x34')]:_0x56de0e[_0x7550('0x2f')];_0x2f74cf['order']=qs[_0x7550('0x3a')](_0x3e1d92[_0x7550('0x31')][_0x7550('0x3a')]);_0x2f74cf['where']=qs[_0x7550('0x3d')](_[_0x7550('0x3c')](_0x3e1d92[_0x7550('0x31')],_0x56de0e[_0x7550('0x3d')]));if(_0x3e1d92[_0x7550('0x31')]['filter']){_0x2f74cf[_0x7550('0x3b')]=_[_0x7550('0x40')](_0x2f74cf['where'],{'$or':_['map'](_0x2f74cf[_0x7550('0x34')],function(_0x4d7626){var _0x3bc202={};_0x3bc202[_0x4d7626]={'$like':'%'+_0x3e1d92[_0x7550('0x31')][_0x7550('0x3e')]+'%'};return _0x3bc202;})});}_0x2f74cf=_[_0x7550('0x40')]({},_0x2f74cf,_0x3e1d92['options']);return _0x1afa7f[_0x7550('0x50')](_0x2f74cf);}})[_0x7550('0x24')](function(_0x22e410){if(_0x22e410){_0x4de7ce=_0x22e410[_0x7550('0x36')];if(!_0x3e1d92[_0x7550('0x31')][_0x7550('0x37')](_0x7550('0x38'))){_0x2f74cf['limit']=qs[_0x7550('0x1e')](_0x3e1d92['query'][_0x7550('0x1e')]);_0x2f74cf['offset']=qs[_0x7550('0x1d')](_0x3e1d92[_0x7550('0x31')][_0x7550('0x1d')]);}return _0x1afa7f[_0x7550('0x50')](_0x2f74cf);}})['then'](function(_0xce51f6){if(_0xce51f6){return _0xce51f6?{'count':_0x4de7ce,'rows':_0xce51f6}:null;}})[_0x7550('0x24')](respondWithResult(_0x27e33a,null))[_0x7550('0x45')](handleError(_0x27e33a,null));};exports[_0x7550('0x52')]=function(_0x2bc81d,_0x456977,_0x5482b6){if(_0x2bc81d[_0x7550('0x49')]['id']){delete _0x2bc81d[_0x7550('0x49')]['id'];}return db[_0x7550('0x2b')]['findOne']({'where':{'id':_0x2bc81d[_0x7550('0x47')]['id']}})[_0x7550('0x24')](handleEntityNotFound(_0x456977,null))['then'](function(_0x21a02c){if(_0x21a02c){return _0x21a02c[_0x7550('0x52')](_0x2bc81d[_0x7550('0x49')]['ids']||[]);}return null;})[_0x7550('0x24')](respondWithResult(_0x456977,null))['catch'](handleError(_0x456977,null));};
\ No newline at end of file
+var _0x6172=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','FreshdeskConfiguration','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','create','body','find','getFields','findOne','FreshdeskField','order','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6172,0x17a));var _0x2617=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6172[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x2617('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2617('0x1'));var jsonpatch=require(_0x2617('0x2'));var rp=require(_0x2617('0x3'));var moment=require('moment');var BPromise=require(_0x2617('0x4'));var Mustache=require('mustache');var util=require(_0x2617('0x5'));var path=require('path');var sox=require(_0x2617('0x6'));var csv=require(_0x2617('0x7'));var ejs=require(_0x2617('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x2617('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2617('0xa'));var toCsv=require(_0x2617('0x7'));var querystring=require(_0x2617('0xb'));var Papa=require(_0x2617('0xc'));var Redis=require(_0x2617('0xd'));var authService=require(_0x2617('0xe'));var qs=require(_0x2617('0xf'));var as=require(_0x2617('0x10'));var hardwareService=require(_0x2617('0x11'));var logger=require(_0x2617('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x2617('0x13'));var licenseUtil=require(_0x2617('0x14'));var db=require(_0x2617('0x15'))['db'];function respondWithStatusCode(_0x154495,_0x241a91){_0x241a91=_0x241a91||0xcc;return function(_0x570a4d){if(_0x570a4d){return _0x154495[_0x2617('0x16')](_0x241a91);}return _0x154495[_0x2617('0x17')](_0x241a91)[_0x2617('0x18')]();};}function respondWithResult(_0x3dd995,_0x8f9975){_0x8f9975=_0x8f9975||0xc8;return function(_0x5e9fe5){if(_0x5e9fe5){return _0x3dd995[_0x2617('0x17')](_0x8f9975)[_0x2617('0x19')](_0x5e9fe5);}};}function respondWithFilteredResult(_0x4d66c7,_0x48c084){return function(_0x383784){if(_0x383784){var _0x5a08ab=typeof _0x48c084[_0x2617('0x1a')]===_0x2617('0x1b')&&typeof _0x48c084[_0x2617('0x1c')]==='undefined';var _0x97de4b=_0x383784['count'];var _0x5604d6=_0x5a08ab?0x0:_0x48c084['offset'];var _0x29b960=_0x5a08ab?_0x383784[_0x2617('0x1d')]:_0x48c084[_0x2617('0x1a')]+_0x48c084[_0x2617('0x1c')];var _0x1d6c8c;if(_0x29b960>=_0x97de4b){_0x29b960=_0x97de4b;_0x1d6c8c=0xc8;}else{_0x1d6c8c=0xce;}_0x4d66c7[_0x2617('0x17')](_0x1d6c8c);return _0x4d66c7[_0x2617('0x1e')](_0x2617('0x1f'),_0x5604d6+'-'+_0x29b960+'/'+_0x97de4b)[_0x2617('0x19')](_0x383784);}return null;};}function patchUpdates(_0x1831c4){return function(_0x13d729){try{jsonpatch[_0x2617('0x20')](_0x13d729,_0x1831c4,!![]);}catch(_0x417f28){return BPromise[_0x2617('0x21')](_0x417f28);}return _0x13d729[_0x2617('0x22')]();};}function saveUpdates(_0x1479b2,_0x42d21d){return function(_0x487148){if(_0x487148){return _0x487148[_0x2617('0x23')](_0x1479b2)[_0x2617('0x24')](function(_0x36174a){return _0x36174a;});}return null;};}function removeEntity(_0x27ea45,_0x2578c6){return function(_0x422581){if(_0x422581){return _0x422581[_0x2617('0x25')]()[_0x2617('0x24')](function(){_0x27ea45[_0x2617('0x17')](0xcc)[_0x2617('0x18')]();});}};}function handleEntityNotFound(_0x723d3b,_0x2b568f){return function(_0x586acc){if(!_0x586acc){_0x723d3b[_0x2617('0x16')](0x194);}return _0x586acc;};}function handleError(_0x2c613f,_0x307703){_0x307703=_0x307703||0x1f4;return function(_0x5e6428){logger['error'](_0x5e6428[_0x2617('0x26')]);if(_0x5e6428['name']){delete _0x5e6428[_0x2617('0x27')];}_0x2c613f[_0x2617('0x17')](_0x307703)['send'](_0x5e6428);};}exports[_0x2617('0x28')]=function(_0x5e6a1c,_0x2deda7){var _0x179daa={},_0x1ddbc8={},_0x2ca346={'count':0x0,'rows':[]};var _0x2809aa=_[_0x2617('0x29')](db[_0x2617('0x2a')]['rawAttributes'],function(_0x218029){return{'name':_0x218029['fieldName'],'type':_0x218029[_0x2617('0x2b')][_0x2617('0x2c')]};});_0x1ddbc8[_0x2617('0x2d')]=_[_0x2617('0x29')](_0x2809aa,_0x2617('0x27'));_0x1ddbc8['query']=_['keys'](_0x5e6a1c[_0x2617('0x2e')]);_0x1ddbc8[_0x2617('0x2f')]=_[_0x2617('0x30')](_0x1ddbc8[_0x2617('0x2d')],_0x1ddbc8[_0x2617('0x2e')]);_0x179daa[_0x2617('0x31')]=_[_0x2617('0x30')](_0x1ddbc8[_0x2617('0x2d')],qs[_0x2617('0x32')](_0x5e6a1c[_0x2617('0x2e')]['fields']));_0x179daa[_0x2617('0x31')]=_0x179daa['attributes'][_0x2617('0x33')]?_0x179daa[_0x2617('0x31')]:_0x1ddbc8['model'];if(!_0x5e6a1c[_0x2617('0x2e')][_0x2617('0x34')]('nolimit')){_0x179daa[_0x2617('0x1c')]=qs[_0x2617('0x1c')](_0x5e6a1c[_0x2617('0x2e')][_0x2617('0x1c')]);_0x179daa[_0x2617('0x1a')]=qs['offset'](_0x5e6a1c[_0x2617('0x2e')][_0x2617('0x1a')]);}_0x179daa['order']=qs[_0x2617('0x35')](_0x5e6a1c[_0x2617('0x2e')]['sort']);_0x179daa[_0x2617('0x36')]=qs[_0x2617('0x2f')](_[_0x2617('0x37')](_0x5e6a1c[_0x2617('0x2e')],_0x1ddbc8[_0x2617('0x2f')]),_0x2809aa);if(_0x5e6a1c[_0x2617('0x2e')][_0x2617('0x38')]){_0x179daa[_0x2617('0x36')]=_[_0x2617('0x39')](_0x179daa['where'],{'$or':_[_0x2617('0x29')](_0x2809aa,function(_0x2a87ae){if(_0x2a87ae[_0x2617('0x2b')]!=='VIRTUAL'){var _0x36515f={};_0x36515f[_0x2a87ae['name']]={'$like':'%'+_0x5e6a1c[_0x2617('0x2e')][_0x2617('0x38')]+'%'};return _0x36515f;}})});}_0x179daa=_[_0x2617('0x39')]({},_0x179daa,_0x5e6a1c[_0x2617('0x3a')]);var _0x53d14b={'where':_0x179daa[_0x2617('0x36')]};return db[_0x2617('0x2a')][_0x2617('0x1d')](_0x53d14b)[_0x2617('0x24')](function(_0x575088){_0x2ca346['count']=_0x575088;if(_0x5e6a1c[_0x2617('0x2e')][_0x2617('0x3b')]){_0x179daa[_0x2617('0x3c')]=[{'all':!![]}];}return db[_0x2617('0x2a')]['findAll'](_0x179daa);})[_0x2617('0x24')](function(_0xb25cc2){_0x2ca346[_0x2617('0x3d')]=_0xb25cc2;return _0x2ca346;})[_0x2617('0x24')](respondWithFilteredResult(_0x2deda7,_0x179daa))[_0x2617('0x3e')](handleError(_0x2deda7,null));};exports[_0x2617('0x3f')]=function(_0x3cd605,_0x32716e){var _0x16e7f3={'raw':![],'where':{'id':_0x3cd605[_0x2617('0x40')]['id']}},_0x56e55a={};_0x56e55a['model']=_[_0x2617('0x41')](db[_0x2617('0x2a')][_0x2617('0x42')]);_0x56e55a[_0x2617('0x2e')]=_['keys'](_0x3cd605[_0x2617('0x2e')]);_0x56e55a['filters']=_[_0x2617('0x30')](_0x56e55a['model'],_0x56e55a[_0x2617('0x2e')]);_0x16e7f3['attributes']=_['intersection'](_0x56e55a[_0x2617('0x2d')],qs['fields'](_0x3cd605['query'][_0x2617('0x32')]));_0x16e7f3[_0x2617('0x31')]=_0x16e7f3[_0x2617('0x31')]['length']?_0x16e7f3[_0x2617('0x31')]:_0x56e55a['model'];if(_0x3cd605[_0x2617('0x2e')][_0x2617('0x3b')]){_0x16e7f3[_0x2617('0x3c')]=[{'all':!![]}];}_0x16e7f3=_['merge']({},_0x16e7f3,_0x3cd605['options']);return db[_0x2617('0x2a')]['find'](_0x16e7f3)[_0x2617('0x24')](handleEntityNotFound(_0x32716e,null))[_0x2617('0x24')](respondWithResult(_0x32716e,null))[_0x2617('0x3e')](handleError(_0x32716e,null));};exports[_0x2617('0x43')]=function(_0x4f65b0,_0x176b81){return db[_0x2617('0x2a')][_0x2617('0x43')](_0x4f65b0[_0x2617('0x44')],{})[_0x2617('0x24')](respondWithResult(_0x176b81,0xc9))[_0x2617('0x3e')](handleError(_0x176b81,null));};exports[_0x2617('0x23')]=function(_0x4d8fe5,_0x19a25e){if(_0x4d8fe5[_0x2617('0x44')]['id']){delete _0x4d8fe5[_0x2617('0x44')]['id'];}return db[_0x2617('0x2a')][_0x2617('0x45')]({'where':{'id':_0x4d8fe5['params']['id']}})['then'](handleEntityNotFound(_0x19a25e,null))[_0x2617('0x24')](saveUpdates(_0x4d8fe5[_0x2617('0x44')],null))['then'](respondWithResult(_0x19a25e,null))['catch'](handleError(_0x19a25e,null));};exports[_0x2617('0x25')]=function(_0x317ff7,_0x421e56){return db[_0x2617('0x2a')][_0x2617('0x45')]({'where':{'id':_0x317ff7[_0x2617('0x40')]['id']}})[_0x2617('0x24')](handleEntityNotFound(_0x421e56,null))[_0x2617('0x24')](removeEntity(_0x421e56,null))[_0x2617('0x3e')](handleError(_0x421e56,null));};exports[_0x2617('0x46')]=function(_0x510f57,_0x2b4895,_0x5b8774){var _0x31f927={};var _0x34f46e={};var _0x20bc03;var _0x18d7ae;return db[_0x2617('0x2a')][_0x2617('0x47')]({'where':{'id':_0x510f57[_0x2617('0x40')]['id']}})[_0x2617('0x24')](handleEntityNotFound(_0x2b4895,null))[_0x2617('0x24')](function(_0x4d1ffb){if(_0x4d1ffb){_0x20bc03=_0x4d1ffb;_0x34f46e[_0x2617('0x2d')]=_['keys'](db[_0x2617('0x48')][_0x2617('0x42')]);_0x34f46e[_0x2617('0x2e')]=_[_0x2617('0x41')](_0x510f57[_0x2617('0x2e')]);_0x34f46e['filters']=_[_0x2617('0x30')](_0x34f46e[_0x2617('0x2d')],_0x34f46e['query']);_0x31f927[_0x2617('0x31')]=_[_0x2617('0x30')](_0x34f46e['model'],qs[_0x2617('0x32')](_0x510f57[_0x2617('0x2e')][_0x2617('0x32')]));_0x31f927[_0x2617('0x31')]=_0x31f927[_0x2617('0x31')][_0x2617('0x33')]?_0x31f927[_0x2617('0x31')]:_0x34f46e[_0x2617('0x2d')];_0x31f927[_0x2617('0x49')]=qs[_0x2617('0x35')](_0x510f57['query'][_0x2617('0x35')]);_0x31f927[_0x2617('0x36')]=qs[_0x2617('0x2f')](_['pick'](_0x510f57[_0x2617('0x2e')],_0x34f46e[_0x2617('0x2f')]));if(_0x510f57['query'][_0x2617('0x38')]){_0x31f927['where']=_[_0x2617('0x39')](_0x31f927[_0x2617('0x36')],{'$or':_[_0x2617('0x29')](_0x31f927[_0x2617('0x31')],function(_0x526cae){var _0x4ffabb={};_0x4ffabb[_0x526cae]={'$like':'%'+_0x510f57[_0x2617('0x2e')][_0x2617('0x38')]+'%'};return _0x4ffabb;})});}_0x31f927=_[_0x2617('0x39')]({},_0x31f927,_0x510f57[_0x2617('0x3a')]);return _0x20bc03[_0x2617('0x46')](_0x31f927);}})[_0x2617('0x24')](function(_0x3fb7dc){if(_0x3fb7dc){_0x18d7ae=_0x3fb7dc[_0x2617('0x33')];if(!_0x510f57[_0x2617('0x2e')][_0x2617('0x34')](_0x2617('0x4a'))){_0x31f927['limit']=qs['limit'](_0x510f57[_0x2617('0x2e')][_0x2617('0x1c')]);_0x31f927[_0x2617('0x1a')]=qs[_0x2617('0x1a')](_0x510f57[_0x2617('0x2e')][_0x2617('0x1a')]);}return _0x20bc03[_0x2617('0x46')](_0x31f927);}})[_0x2617('0x24')](function(_0x800f2b){if(_0x800f2b){return _0x800f2b?{'count':_0x18d7ae,'rows':_0x800f2b}:null;}})[_0x2617('0x24')](respondWithResult(_0x2b4895,null))[_0x2617('0x3e')](handleError(_0x2b4895,null));};exports[_0x2617('0x4b')]=function(_0x560a5f,_0x31ab99,_0x5c6993){var _0x58db93={};var _0x111d13={};var _0xaaa584;var _0x24130c;return db[_0x2617('0x2a')]['findOne']({'where':{'id':_0x560a5f['params']['id']}})['then'](handleEntityNotFound(_0x31ab99,null))[_0x2617('0x24')](function(_0x559e69){if(_0x559e69){_0xaaa584=_0x559e69;_0x111d13[_0x2617('0x2d')]=_[_0x2617('0x41')](db[_0x2617('0x48')]['rawAttributes']);_0x111d13[_0x2617('0x2e')]=_[_0x2617('0x41')](_0x560a5f['query']);_0x111d13[_0x2617('0x2f')]=_[_0x2617('0x30')](_0x111d13[_0x2617('0x2d')],_0x111d13['query']);_0x58db93['attributes']=_[_0x2617('0x30')](_0x111d13['model'],qs[_0x2617('0x32')](_0x560a5f[_0x2617('0x2e')][_0x2617('0x32')]));_0x58db93['attributes']=_0x58db93[_0x2617('0x31')]['length']?_0x58db93[_0x2617('0x31')]:_0x111d13['model'];_0x58db93[_0x2617('0x49')]=qs[_0x2617('0x35')](_0x560a5f['query'][_0x2617('0x35')]);_0x58db93[_0x2617('0x36')]=qs[_0x2617('0x2f')](_[_0x2617('0x37')](_0x560a5f[_0x2617('0x2e')],_0x111d13[_0x2617('0x2f')]));if(_0x560a5f[_0x2617('0x2e')][_0x2617('0x38')]){_0x58db93[_0x2617('0x36')]=_[_0x2617('0x39')](_0x58db93['where'],{'$or':_[_0x2617('0x29')](_0x58db93[_0x2617('0x31')],function(_0x94c99e){var _0x41a9ab={};_0x41a9ab[_0x94c99e]={'$like':'%'+_0x560a5f[_0x2617('0x2e')][_0x2617('0x38')]+'%'};return _0x41a9ab;})});}_0x58db93=_[_0x2617('0x39')]({},_0x58db93,_0x560a5f[_0x2617('0x3a')]);return _0xaaa584[_0x2617('0x4b')](_0x58db93);}})[_0x2617('0x24')](function(_0x20dc7b){if(_0x20dc7b){_0x24130c=_0x20dc7b['length'];if(!_0x560a5f['query'][_0x2617('0x34')](_0x2617('0x4a'))){_0x58db93[_0x2617('0x1c')]=qs[_0x2617('0x1c')](_0x560a5f[_0x2617('0x2e')][_0x2617('0x1c')]);_0x58db93[_0x2617('0x1a')]=qs[_0x2617('0x1a')](_0x560a5f[_0x2617('0x2e')][_0x2617('0x1a')]);}return _0xaaa584[_0x2617('0x4b')](_0x58db93);}})['then'](function(_0x5438ec){if(_0x5438ec){return _0x5438ec?{'count':_0x24130c,'rows':_0x5438ec}:null;}})[_0x2617('0x24')](respondWithResult(_0x31ab99,null))[_0x2617('0x3e')](handleError(_0x31ab99,null));};exports[_0x2617('0x4c')]=function(_0x496158,_0x17cd72,_0x539101){var _0x2685f4={};var _0x100dea={};var _0x4707c7;var _0x55b584;return db[_0x2617('0x2a')][_0x2617('0x47')]({'where':{'id':_0x496158[_0x2617('0x40')]['id']}})[_0x2617('0x24')](handleEntityNotFound(_0x17cd72,null))[_0x2617('0x24')](function(_0x3a10e8){if(_0x3a10e8){_0x4707c7=_0x3a10e8;_0x100dea[_0x2617('0x2d')]=_[_0x2617('0x41')](db[_0x2617('0x48')]['rawAttributes']);_0x100dea[_0x2617('0x2e')]=_[_0x2617('0x41')](_0x496158[_0x2617('0x2e')]);_0x100dea['filters']=_['intersection'](_0x100dea['model'],_0x100dea[_0x2617('0x2e')]);_0x2685f4[_0x2617('0x31')]=_[_0x2617('0x30')](_0x100dea[_0x2617('0x2d')],qs[_0x2617('0x32')](_0x496158[_0x2617('0x2e')][_0x2617('0x32')]));_0x2685f4[_0x2617('0x31')]=_0x2685f4[_0x2617('0x31')][_0x2617('0x33')]?_0x2685f4[_0x2617('0x31')]:_0x100dea[_0x2617('0x2d')];_0x2685f4[_0x2617('0x49')]=qs[_0x2617('0x35')](_0x496158['query'][_0x2617('0x35')]);_0x2685f4[_0x2617('0x36')]=qs[_0x2617('0x2f')](_[_0x2617('0x37')](_0x496158[_0x2617('0x2e')],_0x100dea[_0x2617('0x2f')]));if(_0x496158[_0x2617('0x2e')][_0x2617('0x38')]){_0x2685f4[_0x2617('0x36')]=_[_0x2617('0x39')](_0x2685f4[_0x2617('0x36')],{'$or':_[_0x2617('0x29')](_0x2685f4['attributes'],function(_0x19e88b){var _0x2b53d3={};_0x2b53d3[_0x19e88b]={'$like':'%'+_0x496158[_0x2617('0x2e')][_0x2617('0x38')]+'%'};return _0x2b53d3;})});}_0x2685f4=_[_0x2617('0x39')]({},_0x2685f4,_0x496158[_0x2617('0x3a')]);return _0x4707c7['getDescriptions'](_0x2685f4);}})[_0x2617('0x24')](function(_0x4f233d){if(_0x4f233d){_0x55b584=_0x4f233d[_0x2617('0x33')];if(!_0x496158[_0x2617('0x2e')]['hasOwnProperty'](_0x2617('0x4a'))){_0x2685f4[_0x2617('0x1c')]=qs['limit'](_0x496158[_0x2617('0x2e')][_0x2617('0x1c')]);_0x2685f4[_0x2617('0x1a')]=qs['offset'](_0x496158[_0x2617('0x2e')][_0x2617('0x1a')]);}return _0x4707c7[_0x2617('0x4c')](_0x2685f4);}})[_0x2617('0x24')](function(_0x58699b){if(_0x58699b){return _0x58699b?{'count':_0x55b584,'rows':_0x58699b}:null;}})['then'](respondWithResult(_0x17cd72,null))[_0x2617('0x3e')](handleError(_0x17cd72,null));};exports[_0x2617('0x4d')]=function(_0x37ddbb,_0x486adc,_0x389c6e){var _0x4601de={};var _0x2d4330={};var _0x1453e5;var _0x543c4f;return db[_0x2617('0x2a')][_0x2617('0x47')]({'where':{'id':_0x37ddbb[_0x2617('0x40')]['id']}})[_0x2617('0x24')](handleEntityNotFound(_0x486adc,null))[_0x2617('0x24')](function(_0xbae46a){if(_0xbae46a){_0x1453e5=_0xbae46a;_0x2d4330['model']=_[_0x2617('0x41')](db[_0x2617('0x4e')][_0x2617('0x42')]);_0x2d4330[_0x2617('0x2e')]=_[_0x2617('0x41')](_0x37ddbb[_0x2617('0x2e')]);_0x2d4330[_0x2617('0x2f')]=_[_0x2617('0x30')](_0x2d4330['model'],_0x2d4330[_0x2617('0x2e')]);_0x4601de[_0x2617('0x31')]=_[_0x2617('0x30')](_0x2d4330[_0x2617('0x2d')],qs[_0x2617('0x32')](_0x37ddbb['query'][_0x2617('0x32')]));_0x4601de['attributes']=_0x4601de['attributes']['length']?_0x4601de['attributes']:_0x2d4330[_0x2617('0x2d')];_0x4601de[_0x2617('0x49')]=qs[_0x2617('0x35')](_0x37ddbb['query'][_0x2617('0x35')]);_0x4601de[_0x2617('0x36')]=qs[_0x2617('0x2f')](_[_0x2617('0x37')](_0x37ddbb[_0x2617('0x2e')],_0x2d4330[_0x2617('0x2f')]));if(_0x37ddbb[_0x2617('0x2e')][_0x2617('0x38')]){_0x4601de[_0x2617('0x36')]=_[_0x2617('0x39')](_0x4601de[_0x2617('0x36')],{'$or':_[_0x2617('0x29')](_0x4601de[_0x2617('0x31')],function(_0x2d8c39){var _0x5ebcc6={};_0x5ebcc6[_0x2d8c39]={'$like':'%'+_0x37ddbb[_0x2617('0x2e')]['filter']+'%'};return _0x5ebcc6;})});}_0x4601de=_[_0x2617('0x39')]({},_0x4601de,_0x37ddbb[_0x2617('0x3a')]);return _0x1453e5['getTags'](_0x4601de);}})['then'](function(_0x1eef84){if(_0x1eef84){_0x543c4f=_0x1eef84['length'];if(!_0x37ddbb[_0x2617('0x2e')][_0x2617('0x34')](_0x2617('0x4a'))){_0x4601de[_0x2617('0x1c')]=qs['limit'](_0x37ddbb['query']['limit']);_0x4601de[_0x2617('0x1a')]=qs[_0x2617('0x1a')](_0x37ddbb[_0x2617('0x2e')][_0x2617('0x1a')]);}return _0x1453e5[_0x2617('0x4d')](_0x4601de);}})[_0x2617('0x24')](function(_0x3726b3){if(_0x3726b3){return _0x3726b3?{'count':_0x543c4f,'rows':_0x3726b3}:null;}})['then'](respondWithResult(_0x486adc,null))[_0x2617('0x3e')](handleError(_0x486adc,null));};exports[_0x2617('0x4f')]=function(_0x2a8eb1,_0x470abc,_0x42febf){if(_0x2a8eb1[_0x2617('0x44')]['id']){delete _0x2a8eb1[_0x2617('0x44')]['id'];}return db[_0x2617('0x2a')][_0x2617('0x47')]({'where':{'id':_0x2a8eb1['params']['id']}})[_0x2617('0x24')](handleEntityNotFound(_0x470abc,null))[_0x2617('0x24')](function(_0x3fcbee){if(_0x3fcbee){return _0x3fcbee[_0x2617('0x4f')](_0x2a8eb1[_0x2617('0x44')]['ids']||[]);}return null;})[_0x2617('0x24')](respondWithResult(_0x470abc,null))[_0x2617('0x3e')](handleError(_0x470abc,null));};
\ No newline at end of file
index 4d5b91f..c3851f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb22f=['bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','api'];(function(_0x44e1d7,_0x5ef46b){var _0x414a28=function(_0x1e6494){while(--_0x1e6494){_0x44e1d7['push'](_0x44e1d7['shift']());}};_0x414a28(++_0x5ef46b);}(_0xb22f,0xc3));var _0xfb22=function(_0x5cfdbc,_0x21f713){_0x5cfdbc=_0x5cfdbc-0x0;var _0x2c2d98=_0xb22f[_0x5cfdbc];return _0x2c2d98;};'use strict';var _=require(_0xfb22('0x0'));var util=require(_0xfb22('0x1'));var logger=require('../../config/logger')(_0xfb22('0x2'));var moment=require('moment');var BPromise=require(_0xfb22('0x3'));var rp=require(_0xfb22('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb22('0x5'));var config=require(_0xfb22('0x6'));var attributes=require(_0xfb22('0x7'));module['exports']=function(_0x28b52d,_0x3ea7fb){return _0x28b52d[_0xfb22('0x8')](_0xfb22('0x9'),attributes,{'tableName':_0xfb22('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa1b3=['bluebird','request-promise','path','../../config/environment','./intFreshdeskConfiguration.attributes','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','api','moment'];(function(_0xf1943a,_0x20fa2c){var _0x4737a6=function(_0x402167){while(--_0x402167){_0xf1943a['push'](_0xf1943a['shift']());}};_0x4737a6(++_0x20fa2c);}(_0xa1b3,0x1d5));var _0x3a1b=function(_0x34ef3e,_0x59a08c){_0x34ef3e=_0x34ef3e-0x0;var _0x4f317b=_0xa1b3[_0x34ef3e];return _0x4f317b;};'use strict';var _=require(_0x3a1b('0x0'));var util=require(_0x3a1b('0x1'));var logger=require('../../config/logger')(_0x3a1b('0x2'));var moment=require(_0x3a1b('0x3'));var BPromise=require(_0x3a1b('0x4'));var rp=require(_0x3a1b('0x5'));var fs=require('fs');var path=require(_0x3a1b('0x6'));var rimraf=require('rimraf');var config=require(_0x3a1b('0x7'));var attributes=require(_0x3a1b('0x8'));module['exports']=function(_0x32ecb7,_0x5089e0){return _0x32ecb7['define'](_0x3a1b('0x9'),attributes,{'tableName':_0x3a1b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4e343fb..529cf03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa908=['message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x197185,_0x251145){var _0x2c8af1=function(_0x1dbcfd){while(--_0x1dbcfd){_0x197185['push'](_0x197185['shift']());}};_0x2c8af1(++_0x251145);}(_0xa908,0x119));var _0x8a90=function(_0x3a8b7c,_0x3e5db2){_0x3a8b7c=_0x3a8b7c-0x0;var _0x40eb80=_0xa908[_0x3a8b7c];return _0x40eb80;};'use strict';var _=require('lodash');var util=require(_0x8a90('0x0'));var moment=require(_0x8a90('0x1'));var BPromise=require(_0x8a90('0x2'));var rs=require(_0x8a90('0x3'));var fs=require('fs');var Redis=require(_0x8a90('0x4'));var db=require(_0x8a90('0x5'))['db'];var utils=require(_0x8a90('0x6'));var logger=require(_0x8a90('0x7'))(_0x8a90('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8a90('0x9')][_0x8a90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x562814,_0x5050a7,_0x4c0da8){return new BPromise(function(_0x162dbf,_0x164462){return client[_0x8a90('0xb')](_0x562814,_0x4c0da8)[_0x8a90('0xc')](function(_0x3e1134){logger[_0x8a90('0xd')](_0x8a90('0xe'),_0x5050a7,'request\x20sent');logger[_0x8a90('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5050a7,_0x8a90('0x10'),JSON[_0x8a90('0x11')](_0x3e1134));if(_0x3e1134['error']){if(_0x3e1134[_0x8a90('0x12')]['code']===0x1f4){logger[_0x8a90('0x12')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5050a7,_0x3e1134[_0x8a90('0x12')]['message']);return _0x164462(_0x3e1134[_0x8a90('0x12')][_0x8a90('0x13')]);}logger[_0x8a90('0x12')](_0x8a90('0xe'),_0x5050a7,_0x3e1134['error'][_0x8a90('0x13')]);return _0x162dbf(_0x3e1134[_0x8a90('0x12')][_0x8a90('0x13')]);}else{logger[_0x8a90('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x5050a7,_0x8a90('0x10'));_0x162dbf(_0x3e1134['result']['message']);}})['catch'](function(_0x2163bd){logger[_0x8a90('0x12')](_0x8a90('0xe'),_0x5050a7,_0x2163bd);_0x164462(_0x2163bd);});});}
\ No newline at end of file
+var _0x6474=['jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x22ee53,_0x551665){var _0x2aae96=function(_0x40f34b){while(--_0x40f34b){_0x22ee53['push'](_0x22ee53['shift']());}};_0x2aae96(++_0x551665);}(_0x6474,0x117));var _0x4647=function(_0x148adc,_0x1eab80){_0x148adc=_0x148adc-0x0;var _0x181465=_0x6474[_0x148adc];return _0x181465;};'use strict';var _=require('lodash');var util=require(_0x4647('0x0'));var moment=require(_0x4647('0x1'));var BPromise=require(_0x4647('0x2'));var rs=require(_0x4647('0x3'));var fs=require('fs');var Redis=require(_0x4647('0x4'));var db=require(_0x4647('0x5'))['db'];var utils=require(_0x4647('0x6'));var logger=require(_0x4647('0x7'))('rpc');var config=require(_0x4647('0x8'));var jayson=require(_0x4647('0x9'));var client=jayson[_0x4647('0xa')][_0x4647('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x140d86,_0x4cac77,_0x41f261){return new BPromise(function(_0x2a087a,_0x1d66c7){return client[_0x4647('0xc')](_0x140d86,_0x41f261)[_0x4647('0xd')](function(_0x41eed3){logger[_0x4647('0xe')](_0x4647('0xf'),_0x4cac77,_0x4647('0x10'));logger['debug'](_0x4647('0x11'),_0x4cac77,_0x4647('0x10'),JSON[_0x4647('0x12')](_0x41eed3));if(_0x41eed3['error']){if(_0x41eed3[_0x4647('0x13')][_0x4647('0x14')]===0x1f4){logger[_0x4647('0x13')](_0x4647('0xf'),_0x4cac77,_0x41eed3[_0x4647('0x13')][_0x4647('0x15')]);return _0x1d66c7(_0x41eed3[_0x4647('0x13')][_0x4647('0x15')]);}logger['error'](_0x4647('0xf'),_0x4cac77,_0x41eed3[_0x4647('0x13')][_0x4647('0x15')]);return _0x2a087a(_0x41eed3[_0x4647('0x13')][_0x4647('0x15')]);}else{logger[_0x4647('0xe')](_0x4647('0xf'),_0x4cac77,'request\x20sent');_0x2a087a(_0x41eed3[_0x4647('0x16')][_0x4647('0x15')]);}})[_0x4647('0x17')](function(_0x25d02d){logger[_0x4647('0x13')](_0x4647('0xf'),_0x4cac77,_0x25d02d);_0x1d66c7(_0x25d02d);});});}
\ No newline at end of file
index 57ded2c..b5a65e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x018a=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get'];(function(_0xb0ef0d,_0x152f1a){var _0x32adba=function(_0x296bad){while(--_0x296bad){_0xb0ef0d['push'](_0xb0ef0d['shift']());}};_0x32adba(++_0x152f1a);}(_0x018a,0x19a));var _0xa018=function(_0x431f27,_0x152cc4){_0x431f27=_0x431f27-0x0;var _0x559a65=_0x018a[_0x431f27];return _0x559a65;};'use strict';var multer=require(_0xa018('0x0'));var util=require('util');var path=require(_0xa018('0x1'));var timeout=require('connect-timeout');var express=require(_0xa018('0x2'));var router=express[_0xa018('0x3')]();var fs_extra=require(_0xa018('0x4'));var auth=require(_0xa018('0x5'));var interaction=require(_0xa018('0x6'));var config=require(_0xa018('0x7'));var controller=require(_0xa018('0x8'));router[_0xa018('0x9')]('/',auth[_0xa018('0xa')](),controller[_0xa018('0xb')]);router[_0xa018('0x9')](_0xa018('0xc'),auth['isAuthenticated'](),controller[_0xa018('0xd')]);router[_0xa018('0xe')]('/',auth[_0xa018('0xa')](),controller[_0xa018('0xf')]);router[_0xa018('0x10')]('/:id',auth[_0xa018('0xa')](),controller[_0xa018('0x11')]);router[_0xa018('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xa018('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x428c=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','post','create','put','delete','destroy','exports'];(function(_0x4d5f8f,_0x273e1e){var _0x55baed=function(_0x36e4a4){while(--_0x36e4a4){_0x4d5f8f['push'](_0x4d5f8f['shift']());}};_0x55baed(++_0x273e1e);}(_0x428c,0x85));var _0xc428=function(_0x10abd7,_0xd3ab42){_0x10abd7=_0x10abd7-0x0;var _0x8e91ed=_0x428c[_0x10abd7];return _0x8e91ed;};'use strict';var multer=require(_0xc428('0x0'));var util=require(_0xc428('0x1'));var path=require(_0xc428('0x2'));var timeout=require(_0xc428('0x3'));var express=require(_0xc428('0x4'));var router=express[_0xc428('0x5')]();var fs_extra=require(_0xc428('0x6'));var auth=require(_0xc428('0x7'));var interaction=require(_0xc428('0x8'));var config=require(_0xc428('0x9'));var controller=require('./intFreshdeskField.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xc428('0xa')](_0xc428('0xb'),auth[_0xc428('0xc')](),controller['show']);router[_0xc428('0xd')]('/',auth[_0xc428('0xc')](),controller[_0xc428('0xe')]);router[_0xc428('0xf')]('/:id',auth[_0xc428('0xc')](),controller['update']);router[_0xc428('0x10')](_0xc428('0xb'),auth[_0xc428('0xc')](),controller[_0xc428('0x11')]);module[_0xc428('0x12')]=router;
\ No newline at end of file
index 0bba0dd..0f09046 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84de=['STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','picklist'];(function(_0x1a6c17,_0x1909c5){var _0x2ede84=function(_0x1d6873){while(--_0x1d6873){_0x1a6c17['push'](_0x1a6c17['shift']());}};_0x2ede84(++_0x1909c5);}(_0x84de,0xfe));var _0xe84d=function(_0x245c4f,_0x34b70f){_0x245c4f=_0x245c4f-0x0;var _0x3157a1=_0x84de[_0x245c4f];return _0x3157a1;};'use strict';var Sequelize=require(_0xe84d('0x0'));module[_0xe84d('0x1')]={'type':{'type':Sequelize[_0xe84d('0x2')](_0xe84d('0x3'),_0xe84d('0x4'),_0xe84d('0x5'),'keyValue',_0xe84d('0x6')),'defaultValue':_0xe84d('0x3')},'content':{'type':Sequelize[_0xe84d('0x7')]},'key':{'type':Sequelize[_0xe84d('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xe84d('0x3'),_0xe84d('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xe84d('0x7')]},'idField':{'type':Sequelize[_0xe84d('0x7')]},'nameField':{'type':Sequelize[_0xe84d('0x7')]},'customField':{'type':Sequelize[_0xe84d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe84d('0x7')]}};
\ No newline at end of file
+var _0x5510=['sequelize','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0xd816e2,_0x5edac2){var _0x1f5924=function(_0x1bcbf0){while(--_0x1bcbf0){_0xd816e2['push'](_0xd816e2['shift']());}};_0x1f5924(++_0x5edac2);}(_0x5510,0x13b));var _0x0551=function(_0x2a4da6,_0x5e7f66){_0x2a4da6=_0x2a4da6-0x0;var _0x21f384=_0x5510[_0x2a4da6];return _0x21f384;};'use strict';var Sequelize=require(_0x0551('0x0'));module['exports']={'type':{'type':Sequelize[_0x0551('0x1')](_0x0551('0x2'),_0x0551('0x3'),_0x0551('0x4'),_0x0551('0x5'),'picklist'),'defaultValue':_0x0551('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x0551('0x6')]},'keyType':{'type':Sequelize[_0x0551('0x1')](_0x0551('0x2'),_0x0551('0x3'),_0x0551('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x0551('0x6')]},'nameField':{'type':Sequelize[_0x0551('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0551('0x6')]}};
\ No newline at end of file
index 93f652e..f3ad8e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6b1=['set','Content-Range','apply','reject','save','update','then','error','name','send','map','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','FreshdeskField','includeAll','include','findAll','catch','show','params','keys','rawAttributes','create','body','eml-format','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count'];(function(_0x30c879,_0x18ffe8){var _0x45e4ce=function(_0x50dade){while(--_0x50dade){_0x30c879['push'](_0x30c879['shift']());}};_0x45e4ce(++_0x18ffe8);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x2b0bc2,_0x4331f5){_0x2b0bc2=_0x2b0bc2-0x0;var _0x56e5b9=_0xb6b1[_0x2b0bc2];return _0x56e5b9;};'use strict';var emlformat=require(_0x1b6b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1b6b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b6b('0x2'));var moment=require(_0x1b6b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1b6b('0x4'));var util=require('util');var path=require(_0x1b6b('0x5'));var sox=require(_0x1b6b('0x6'));var csv=require(_0x1b6b('0x7'));var ejs=require(_0x1b6b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1b6b('0x9'));var squel=require('squel');var crypto=require(_0x1b6b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1b6b('0xb'));var toCsv=require(_0x1b6b('0x7'));var querystring=require(_0x1b6b('0xc'));var Papa=require(_0x1b6b('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1b6b('0xe'));var as=require(_0x1b6b('0xf'));var hardwareService=require(_0x1b6b('0x10'));var logger=require(_0x1b6b('0x11'))(_0x1b6b('0x12'));var utils=require(_0x1b6b('0x13'));var config=require(_0x1b6b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b6b('0x15'))['db'];function respondWithStatusCode(_0x3554b5,_0xf6a4be){_0xf6a4be=_0xf6a4be||0xcc;return function(_0x5abe44){if(_0x5abe44){return _0x3554b5[_0x1b6b('0x16')](_0xf6a4be);}return _0x3554b5['status'](_0xf6a4be)['end']();};}function respondWithResult(_0x2f540f,_0x20a2d7){_0x20a2d7=_0x20a2d7||0xc8;return function(_0x1e474f){if(_0x1e474f){return _0x2f540f[_0x1b6b('0x17')](_0x20a2d7)[_0x1b6b('0x18')](_0x1e474f);}};}function respondWithFilteredResult(_0x268fe9,_0x321263){return function(_0x553a6d){if(_0x553a6d){var _0x1069a4=typeof _0x321263[_0x1b6b('0x19')]===_0x1b6b('0x1a')&&typeof _0x321263[_0x1b6b('0x1b')]==='undefined';var _0x26345c=_0x553a6d[_0x1b6b('0x1c')];var _0x2e608b=_0x1069a4?0x0:_0x321263['offset'];var _0x923711=_0x1069a4?_0x553a6d[_0x1b6b('0x1c')]:_0x321263[_0x1b6b('0x19')]+_0x321263[_0x1b6b('0x1b')];var _0xacd21b;if(_0x923711>=_0x26345c){_0x923711=_0x26345c;_0xacd21b=0xc8;}else{_0xacd21b=0xce;}_0x268fe9[_0x1b6b('0x17')](_0xacd21b);return _0x268fe9[_0x1b6b('0x1d')](_0x1b6b('0x1e'),_0x2e608b+'-'+_0x923711+'/'+_0x26345c)[_0x1b6b('0x18')](_0x553a6d);}return null;};}function patchUpdates(_0x20a5a3){return function(_0x5dbd46){try{jsonpatch[_0x1b6b('0x1f')](_0x5dbd46,_0x20a5a3,!![]);}catch(_0x395118){return BPromise[_0x1b6b('0x20')](_0x395118);}return _0x5dbd46[_0x1b6b('0x21')]();};}function saveUpdates(_0x27974f,_0x276713){return function(_0x3d4ec2){if(_0x3d4ec2){return _0x3d4ec2[_0x1b6b('0x22')](_0x27974f)[_0x1b6b('0x23')](function(_0x4987ee){return _0x4987ee;});}return null;};}function removeEntity(_0x1b2cdf,_0x489e7a){return function(_0x4efab0){if(_0x4efab0){return _0x4efab0['destroy']()[_0x1b6b('0x23')](function(){_0x1b2cdf[_0x1b6b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6a317c,_0x47c318){return function(_0x15dfc7){if(!_0x15dfc7){_0x6a317c[_0x1b6b('0x16')](0x194);}return _0x15dfc7;};}function handleError(_0x466c0c,_0x308955){_0x308955=_0x308955||0x1f4;return function(_0xd41b04){logger[_0x1b6b('0x24')](_0xd41b04['stack']);if(_0xd41b04[_0x1b6b('0x25')]){delete _0xd41b04[_0x1b6b('0x25')];}_0x466c0c[_0x1b6b('0x17')](_0x308955)[_0x1b6b('0x26')](_0xd41b04);};}exports['index']=function(_0x23dac4,_0x5a46bd){var _0x5bbcd8={},_0x39b055={},_0x4e9843={'count':0x0,'rows':[]};var _0x165fe8=_[_0x1b6b('0x27')](db['FreshdeskField']['rawAttributes'],function(_0x36878c){return{'name':_0x36878c[_0x1b6b('0x28')],'type':_0x36878c['type']['key']};});_0x39b055[_0x1b6b('0x29')]=_[_0x1b6b('0x27')](_0x165fe8,_0x1b6b('0x25'));_0x39b055[_0x1b6b('0x2a')]=_['keys'](_0x23dac4[_0x1b6b('0x2a')]);_0x39b055[_0x1b6b('0x2b')]=_[_0x1b6b('0x2c')](_0x39b055[_0x1b6b('0x29')],_0x39b055[_0x1b6b('0x2a')]);_0x5bbcd8[_0x1b6b('0x2d')]=_[_0x1b6b('0x2c')](_0x39b055[_0x1b6b('0x29')],qs[_0x1b6b('0x2e')](_0x23dac4['query'][_0x1b6b('0x2e')]));_0x5bbcd8[_0x1b6b('0x2d')]=_0x5bbcd8[_0x1b6b('0x2d')][_0x1b6b('0x2f')]?_0x5bbcd8['attributes']:_0x39b055[_0x1b6b('0x29')];if(!_0x23dac4['query'][_0x1b6b('0x30')]('nolimit')){_0x5bbcd8['limit']=qs[_0x1b6b('0x1b')](_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x1b')]);_0x5bbcd8['offset']=qs[_0x1b6b('0x19')](_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x19')]);}_0x5bbcd8[_0x1b6b('0x31')]=qs[_0x1b6b('0x32')](_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x32')]);_0x5bbcd8[_0x1b6b('0x33')]=qs[_0x1b6b('0x2b')](_[_0x1b6b('0x34')](_0x23dac4[_0x1b6b('0x2a')],_0x39b055[_0x1b6b('0x2b')]),_0x165fe8);if(_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x35')]){_0x5bbcd8['where']=_[_0x1b6b('0x36')](_0x5bbcd8[_0x1b6b('0x33')],{'$or':_['map'](_0x165fe8,function(_0x41e0db){if(_0x41e0db['type']!==_0x1b6b('0x37')){var _0x19049f={};_0x19049f[_0x41e0db[_0x1b6b('0x25')]]={'$like':'%'+_0x23dac4['query'][_0x1b6b('0x35')]+'%'};return _0x19049f;}})});}_0x5bbcd8=_[_0x1b6b('0x36')]({},_0x5bbcd8,_0x23dac4[_0x1b6b('0x38')]);var _0x5578d9={'where':_0x5bbcd8[_0x1b6b('0x33')]};return db[_0x1b6b('0x39')][_0x1b6b('0x1c')](_0x5578d9)['then'](function(_0x48ece6){_0x4e9843['count']=_0x48ece6;if(_0x23dac4[_0x1b6b('0x2a')][_0x1b6b('0x3a')]){_0x5bbcd8[_0x1b6b('0x3b')]=[{'all':!![]}];}return db[_0x1b6b('0x39')][_0x1b6b('0x3c')](_0x5bbcd8);})[_0x1b6b('0x23')](function(_0xe8bea5){_0x4e9843['rows']=_0xe8bea5;return _0x4e9843;})[_0x1b6b('0x23')](respondWithFilteredResult(_0x5a46bd,_0x5bbcd8))[_0x1b6b('0x3d')](handleError(_0x5a46bd,null));};exports[_0x1b6b('0x3e')]=function(_0x31c2bf,_0x1dcba5){var _0x3d8374={'raw':!![],'where':{'id':_0x31c2bf[_0x1b6b('0x3f')]['id']}},_0x5cb83a={};_0x5cb83a[_0x1b6b('0x29')]=_[_0x1b6b('0x40')](db[_0x1b6b('0x39')][_0x1b6b('0x41')]);_0x5cb83a[_0x1b6b('0x2a')]=_[_0x1b6b('0x40')](_0x31c2bf[_0x1b6b('0x2a')]);_0x5cb83a[_0x1b6b('0x2b')]=_[_0x1b6b('0x2c')](_0x5cb83a[_0x1b6b('0x29')],_0x5cb83a[_0x1b6b('0x2a')]);_0x3d8374['attributes']=_[_0x1b6b('0x2c')](_0x5cb83a[_0x1b6b('0x29')],qs[_0x1b6b('0x2e')](_0x31c2bf[_0x1b6b('0x2a')][_0x1b6b('0x2e')]));_0x3d8374[_0x1b6b('0x2d')]=_0x3d8374['attributes']['length']?_0x3d8374[_0x1b6b('0x2d')]:_0x5cb83a['model'];if(_0x31c2bf[_0x1b6b('0x2a')]['includeAll']){_0x3d8374[_0x1b6b('0x3b')]=[{'all':!![]}];}_0x3d8374=_[_0x1b6b('0x36')]({},_0x3d8374,_0x31c2bf[_0x1b6b('0x38')]);return db[_0x1b6b('0x39')]['find'](_0x3d8374)[_0x1b6b('0x23')](handleEntityNotFound(_0x1dcba5,null))['then'](respondWithResult(_0x1dcba5,null))['catch'](handleError(_0x1dcba5,null));};exports[_0x1b6b('0x42')]=function(_0x123045,_0x151774){return db[_0x1b6b('0x39')]['create'](_0x123045[_0x1b6b('0x43')],{})['then'](respondWithResult(_0x151774,0xc9))[_0x1b6b('0x3d')](handleError(_0x151774,null));};exports[_0x1b6b('0x22')]=function(_0x281f19,_0x4b0b47){if(_0x281f19[_0x1b6b('0x43')]['id']){delete _0x281f19['body']['id'];}return db[_0x1b6b('0x39')]['find']({'where':{'id':_0x281f19[_0x1b6b('0x3f')]['id']}})[_0x1b6b('0x23')](handleEntityNotFound(_0x4b0b47,null))[_0x1b6b('0x23')](saveUpdates(_0x281f19[_0x1b6b('0x43')],null))[_0x1b6b('0x23')](respondWithResult(_0x4b0b47,null))[_0x1b6b('0x3d')](handleError(_0x4b0b47,null));};exports['destroy']=function(_0x4c1e02,_0x2be336){return db[_0x1b6b('0x39')]['find']({'where':{'id':_0x4c1e02[_0x1b6b('0x3f')]['id']}})[_0x1b6b('0x23')](handleEntityNotFound(_0x2be336,null))[_0x1b6b('0x23')](removeEntity(_0x2be336,null))[_0x1b6b('0x3d')](handleError(_0x2be336,null));};
\ No newline at end of file
+var _0xc3fe=['destroy','end','name','status','send','index','map','FreshdeskField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then'];(function(_0x490b05,_0x7f0934){var _0x37ad3c=function(_0x4260d0){while(--_0x4260d0){_0x490b05['push'](_0x490b05['shift']());}};_0x37ad3c(++_0x7f0934);}(_0xc3fe,0xff));var _0xec3f=function(_0x1455a7,_0x2eb7a4){_0x1455a7=_0x1455a7-0x0;var _0x9327e4=_0xc3fe[_0x1455a7];return _0x9327e4;};'use strict';var emlformat=require(_0xec3f('0x0'));var rimraf=require(_0xec3f('0x1'));var zipdir=require(_0xec3f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xec3f('0x3'));var moment=require(_0xec3f('0x4'));var BPromise=require(_0xec3f('0x5'));var Mustache=require('mustache');var util=require(_0xec3f('0x6'));var path=require(_0xec3f('0x7'));var sox=require(_0xec3f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec3f('0x9'));var _=require(_0xec3f('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xec3f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xec3f('0xc'));var querystring=require(_0xec3f('0xd'));var Papa=require(_0xec3f('0xe'));var Redis=require(_0xec3f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xec3f('0x10'));var as=require(_0xec3f('0x11'));var hardwareService=require(_0xec3f('0x12'));var logger=require(_0xec3f('0x13'))(_0xec3f('0x14'));var utils=require(_0xec3f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xec3f('0x16'));var db=require(_0xec3f('0x17'))['db'];function respondWithStatusCode(_0x367c5e,_0x57891d){_0x57891d=_0x57891d||0xcc;return function(_0x5367df){if(_0x5367df){return _0x367c5e[_0xec3f('0x18')](_0x57891d);}return _0x367c5e['status'](_0x57891d)['end']();};}function respondWithResult(_0x209ffa,_0x4318bd){_0x4318bd=_0x4318bd||0xc8;return function(_0x113d16){if(_0x113d16){return _0x209ffa['status'](_0x4318bd)['json'](_0x113d16);}};}function respondWithFilteredResult(_0x5509ec,_0x5ad65a){return function(_0x37d688){if(_0x37d688){var _0x10ff81=typeof _0x5ad65a['offset']===_0xec3f('0x19')&&typeof _0x5ad65a[_0xec3f('0x1a')]===_0xec3f('0x19');var _0x3b7393=_0x37d688['count'];var _0x7805c=_0x10ff81?0x0:_0x5ad65a[_0xec3f('0x1b')];var _0x2d338=_0x10ff81?_0x37d688[_0xec3f('0x1c')]:_0x5ad65a[_0xec3f('0x1b')]+_0x5ad65a['limit'];var _0x2f8bc8;if(_0x2d338>=_0x3b7393){_0x2d338=_0x3b7393;_0x2f8bc8=0xc8;}else{_0x2f8bc8=0xce;}_0x5509ec['status'](_0x2f8bc8);return _0x5509ec[_0xec3f('0x1d')](_0xec3f('0x1e'),_0x7805c+'-'+_0x2d338+'/'+_0x3b7393)[_0xec3f('0x1f')](_0x37d688);}return null;};}function patchUpdates(_0x47b6f9){return function(_0x526ff){try{jsonpatch[_0xec3f('0x20')](_0x526ff,_0x47b6f9,!![]);}catch(_0x4fdfc3){return BPromise[_0xec3f('0x21')](_0x4fdfc3);}return _0x526ff[_0xec3f('0x22')]();};}function saveUpdates(_0x1f173f,_0x395b9a){return function(_0x4d9598){if(_0x4d9598){return _0x4d9598[_0xec3f('0x23')](_0x1f173f)[_0xec3f('0x24')](function(_0x2f45bb){return _0x2f45bb;});}return null;};}function removeEntity(_0x4e4770,_0xfc9c0d){return function(_0x4b5932){if(_0x4b5932){return _0x4b5932[_0xec3f('0x25')]()['then'](function(){_0x4e4770['status'](0xcc)[_0xec3f('0x26')]();});}};}function handleEntityNotFound(_0x482bf2,_0x217b7d){return function(_0xa12054){if(!_0xa12054){_0x482bf2[_0xec3f('0x18')](0x194);}return _0xa12054;};}function handleError(_0x4df17b,_0x296fc3){_0x296fc3=_0x296fc3||0x1f4;return function(_0x1da532){logger['error'](_0x1da532['stack']);if(_0x1da532[_0xec3f('0x27')]){delete _0x1da532['name'];}_0x4df17b[_0xec3f('0x28')](_0x296fc3)[_0xec3f('0x29')](_0x1da532);};}exports[_0xec3f('0x2a')]=function(_0x2eac8d,_0x4614c9){var _0x19473c={},_0x2f2d15={},_0x237134={'count':0x0,'rows':[]};var _0x56217e=_[_0xec3f('0x2b')](db[_0xec3f('0x2c')]['rawAttributes'],function(_0x91c11a){return{'name':_0x91c11a[_0xec3f('0x2d')],'type':_0x91c11a[_0xec3f('0x2e')][_0xec3f('0x2f')]};});_0x2f2d15[_0xec3f('0x30')]=_[_0xec3f('0x2b')](_0x56217e,_0xec3f('0x27'));_0x2f2d15[_0xec3f('0x31')]=_[_0xec3f('0x32')](_0x2eac8d[_0xec3f('0x31')]);_0x2f2d15[_0xec3f('0x33')]=_[_0xec3f('0x34')](_0x2f2d15[_0xec3f('0x30')],_0x2f2d15[_0xec3f('0x31')]);_0x19473c[_0xec3f('0x35')]=_['intersection'](_0x2f2d15[_0xec3f('0x30')],qs[_0xec3f('0x36')](_0x2eac8d[_0xec3f('0x31')][_0xec3f('0x36')]));_0x19473c[_0xec3f('0x35')]=_0x19473c['attributes'][_0xec3f('0x37')]?_0x19473c[_0xec3f('0x35')]:_0x2f2d15[_0xec3f('0x30')];if(!_0x2eac8d['query']['hasOwnProperty'](_0xec3f('0x38'))){_0x19473c['limit']=qs[_0xec3f('0x1a')](_0x2eac8d['query'][_0xec3f('0x1a')]);_0x19473c['offset']=qs['offset'](_0x2eac8d[_0xec3f('0x31')][_0xec3f('0x1b')]);}_0x19473c[_0xec3f('0x39')]=qs[_0xec3f('0x3a')](_0x2eac8d[_0xec3f('0x31')][_0xec3f('0x3a')]);_0x19473c['where']=qs['filters'](_[_0xec3f('0x3b')](_0x2eac8d[_0xec3f('0x31')],_0x2f2d15[_0xec3f('0x33')]),_0x56217e);if(_0x2eac8d[_0xec3f('0x31')][_0xec3f('0x3c')]){_0x19473c[_0xec3f('0x3d')]=_[_0xec3f('0x3e')](_0x19473c['where'],{'$or':_[_0xec3f('0x2b')](_0x56217e,function(_0x5aadc3){if(_0x5aadc3[_0xec3f('0x2e')]!==_0xec3f('0x3f')){var _0x2c8f59={};_0x2c8f59[_0x5aadc3[_0xec3f('0x27')]]={'$like':'%'+_0x2eac8d[_0xec3f('0x31')][_0xec3f('0x3c')]+'%'};return _0x2c8f59;}})});}_0x19473c=_[_0xec3f('0x3e')]({},_0x19473c,_0x2eac8d[_0xec3f('0x40')]);var _0x35b902={'where':_0x19473c[_0xec3f('0x3d')]};return db[_0xec3f('0x2c')][_0xec3f('0x1c')](_0x35b902)[_0xec3f('0x24')](function(_0x482219){_0x237134[_0xec3f('0x1c')]=_0x482219;if(_0x2eac8d[_0xec3f('0x31')]['includeAll']){_0x19473c[_0xec3f('0x41')]=[{'all':!![]}];}return db[_0xec3f('0x2c')]['findAll'](_0x19473c);})[_0xec3f('0x24')](function(_0xae1b8a){_0x237134[_0xec3f('0x42')]=_0xae1b8a;return _0x237134;})[_0xec3f('0x24')](respondWithFilteredResult(_0x4614c9,_0x19473c))[_0xec3f('0x43')](handleError(_0x4614c9,null));};exports[_0xec3f('0x44')]=function(_0x5e434d,_0x142d85){var _0x386e96={'raw':!![],'where':{'id':_0x5e434d[_0xec3f('0x45')]['id']}},_0x1c6494={};_0x1c6494[_0xec3f('0x30')]=_[_0xec3f('0x32')](db[_0xec3f('0x2c')][_0xec3f('0x46')]);_0x1c6494[_0xec3f('0x31')]=_['keys'](_0x5e434d[_0xec3f('0x31')]);_0x1c6494['filters']=_[_0xec3f('0x34')](_0x1c6494[_0xec3f('0x30')],_0x1c6494[_0xec3f('0x31')]);_0x386e96[_0xec3f('0x35')]=_[_0xec3f('0x34')](_0x1c6494[_0xec3f('0x30')],qs[_0xec3f('0x36')](_0x5e434d[_0xec3f('0x31')][_0xec3f('0x36')]));_0x386e96[_0xec3f('0x35')]=_0x386e96[_0xec3f('0x35')][_0xec3f('0x37')]?_0x386e96['attributes']:_0x1c6494[_0xec3f('0x30')];if(_0x5e434d[_0xec3f('0x31')]['includeAll']){_0x386e96[_0xec3f('0x41')]=[{'all':!![]}];}_0x386e96=_[_0xec3f('0x3e')]({},_0x386e96,_0x5e434d[_0xec3f('0x40')]);return db[_0xec3f('0x2c')]['find'](_0x386e96)['then'](handleEntityNotFound(_0x142d85,null))[_0xec3f('0x24')](respondWithResult(_0x142d85,null))[_0xec3f('0x43')](handleError(_0x142d85,null));};exports['create']=function(_0x2a9fc8,_0x28acd1){return db[_0xec3f('0x2c')]['create'](_0x2a9fc8[_0xec3f('0x47')],{})['then'](respondWithResult(_0x28acd1,0xc9))['catch'](handleError(_0x28acd1,null));};exports['update']=function(_0x97c57d,_0x1b7cf6){if(_0x97c57d[_0xec3f('0x47')]['id']){delete _0x97c57d[_0xec3f('0x47')]['id'];}return db['FreshdeskField'][_0xec3f('0x48')]({'where':{'id':_0x97c57d['params']['id']}})[_0xec3f('0x24')](handleEntityNotFound(_0x1b7cf6,null))[_0xec3f('0x24')](saveUpdates(_0x97c57d[_0xec3f('0x47')],null))[_0xec3f('0x24')](respondWithResult(_0x1b7cf6,null))[_0xec3f('0x43')](handleError(_0x1b7cf6,null));};exports[_0xec3f('0x25')]=function(_0x515bf2,_0x2ab636){return db['FreshdeskField'][_0xec3f('0x48')]({'where':{'id':_0x515bf2['params']['id']}})[_0xec3f('0x24')](handleEntityNotFound(_0x2ab636,null))['then'](removeEntity(_0x2ab636,null))[_0xec3f('0x43')](handleError(_0x2ab636,null));};
\ No newline at end of file
index cf08978..8b4f648 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3643=['FieldId','lodash','api','moment','bluebird','request-promise','../../config/environment','exports','define','FreshdeskField','freshdesk_unique_index','idField'];(function(_0x43eb84,_0x2f0fe1){var _0x1fc8b9=function(_0x8acde4){while(--_0x8acde4){_0x43eb84['push'](_0x43eb84['shift']());}};_0x1fc8b9(++_0x2f0fe1);}(_0x3643,0xa9));var _0x3364=function(_0x264b2b,_0x2133a0){_0x264b2b=_0x264b2b-0x0;var _0x5f1df4=_0x3643[_0x264b2b];return _0x5f1df4;};'use strict';var _=require(_0x3364('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3364('0x1'));var moment=require(_0x3364('0x2'));var BPromise=require(_0x3364('0x3'));var rp=require(_0x3364('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3364('0x5'));var attributes=require('./intFreshdeskField.attributes');module[_0x3364('0x6')]=function(_0x439a3c,_0x5bbfb3){return _0x439a3c[_0x3364('0x7')](_0x3364('0x8'),attributes,{'tableName':'int_freshdesk_fields','paranoid':![],'indexes':[{'name':_0x3364('0x9'),'fields':[_0x3364('0xa'),_0x3364('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2071=['rimraf','../../config/environment','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x3b085,_0x250543){var _0x476a57=function(_0x480941){while(--_0x480941){_0x3b085['push'](_0x3b085['shift']());}};_0x476a57(++_0x250543);}(_0x2071,0xa2));var _0x1207=function(_0x2136a6,_0x35af63){_0x2136a6=_0x2136a6-0x0;var _0x55b948=_0x2071[_0x2136a6];return _0x55b948;};'use strict';var _=require(_0x1207('0x0'));var util=require('util');var logger=require(_0x1207('0x1'))(_0x1207('0x2'));var moment=require(_0x1207('0x3'));var BPromise=require('bluebird');var rp=require(_0x1207('0x4'));var fs=require('fs');var path=require(_0x1207('0x5'));var rimraf=require(_0x1207('0x6'));var config=require(_0x1207('0x7'));var attributes=require('./intFreshdeskField.attributes');module['exports']=function(_0x3d4ecf,_0x90c5fb){return _0x3d4ecf[_0x1207('0x8')](_0x1207('0x9'),attributes,{'tableName':_0x1207('0xa'),'paranoid':![],'indexes':[{'name':_0x1207('0xb'),'fields':[_0x1207('0xc'),_0x1207('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 7723261..64f805e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3349=['jayson/promise','client','http','request','then','info','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','FreshdeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3faf76,_0x1a75ca){var _0x45cc55=function(_0x2d640d){while(--_0x2d640d){_0x3faf76['push'](_0x3faf76['shift']());}};_0x45cc55(++_0x1a75ca);}(_0x3349,0x142));var _0x9334=function(_0x244e46,_0x5a2dd3){_0x244e46=_0x244e46-0x0;var _0x1bacd5=_0x3349[_0x244e46];return _0x1bacd5;};'use strict';var _=require(_0x9334('0x0'));var util=require(_0x9334('0x1'));var moment=require(_0x9334('0x2'));var BPromise=require(_0x9334('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9334('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9334('0x5'));var logger=require(_0x9334('0x6'))(_0x9334('0x7'));var config=require('../../config/environment');var jayson=require(_0x9334('0x8'));var client=jayson[_0x9334('0x9')][_0x9334('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x116dd4,_0x4dab4f,_0x2efa76){return new BPromise(function(_0x223831,_0x1b5827){return client[_0x9334('0xb')](_0x116dd4,_0x2efa76)[_0x9334('0xc')](function(_0x78eea){logger[_0x9334('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x4dab4f,'request\x20sent');logger['debug'](_0x9334('0xe'),_0x4dab4f,_0x9334('0xf'),JSON['stringify'](_0x78eea));if(_0x78eea[_0x9334('0x10')]){if(_0x78eea[_0x9334('0x10')][_0x9334('0x11')]===0x1f4){logger['error'](_0x9334('0x12'),_0x4dab4f,_0x78eea[_0x9334('0x10')]['message']);return _0x1b5827(_0x78eea[_0x9334('0x10')][_0x9334('0x13')]);}logger['error']('FreshdeskField,\x20%s,\x20%s',_0x4dab4f,_0x78eea[_0x9334('0x10')][_0x9334('0x13')]);return _0x223831(_0x78eea['error'][_0x9334('0x13')]);}else{logger[_0x9334('0xd')](_0x9334('0x12'),_0x4dab4f,_0x9334('0xf'));_0x223831(_0x78eea[_0x9334('0x14')]['message']);}})[_0x9334('0x15')](function(_0x4fd26c){logger[_0x9334('0x10')](_0x9334('0x12'),_0x4dab4f,_0x4fd26c);_0x1b5827(_0x4fd26c);});});}
\ No newline at end of file
+var _0xfc25=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','then','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','lodash','util'];(function(_0x4458f4,_0x272bb8){var _0x1b59cc=function(_0x36205b){while(--_0x36205b){_0x4458f4['push'](_0x4458f4['shift']());}};_0x1b59cc(++_0x272bb8);}(_0xfc25,0x178));var _0x5fc2=function(_0x47836a,_0x3cbe0e){_0x47836a=_0x47836a-0x0;var _0x130660=_0xfc25[_0x47836a];return _0x130660;};'use strict';var _=require(_0x5fc2('0x0'));var util=require(_0x5fc2('0x1'));var moment=require(_0x5fc2('0x2'));var BPromise=require(_0x5fc2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5fc2('0x4'));var db=require(_0x5fc2('0x5'))['db'];var utils=require(_0x5fc2('0x6'));var logger=require(_0x5fc2('0x7'))(_0x5fc2('0x8'));var config=require('../../config/environment');var jayson=require(_0x5fc2('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xc11f50,_0xd9e951,_0x3547e6){return new BPromise(function(_0x5963cf,_0x54b759){return client['request'](_0xc11f50,_0x3547e6)[_0x5fc2('0xa')](function(_0x440462){logger['info'](_0x5fc2('0xb'),_0xd9e951,_0x5fc2('0xc'));logger[_0x5fc2('0xd')](_0x5fc2('0xe'),_0xd9e951,_0x5fc2('0xc'),JSON['stringify'](_0x440462));if(_0x440462['error']){if(_0x440462['error'][_0x5fc2('0xf')]===0x1f4){logger[_0x5fc2('0x10')](_0x5fc2('0xb'),_0xd9e951,_0x440462['error'][_0x5fc2('0x11')]);return _0x54b759(_0x440462['error'][_0x5fc2('0x11')]);}logger[_0x5fc2('0x10')](_0x5fc2('0xb'),_0xd9e951,_0x440462['error'][_0x5fc2('0x11')]);return _0x5963cf(_0x440462[_0x5fc2('0x10')][_0x5fc2('0x11')]);}else{logger[_0x5fc2('0x12')]('FreshdeskField,\x20%s,\x20%s',_0xd9e951,_0x5fc2('0xc'));_0x5963cf(_0x440462[_0x5fc2('0x13')]['message']);}})[_0x5fc2('0x14')](function(_0x430b7f){logger[_0x5fc2('0x10')](_0x5fc2('0xb'),_0xd9e951,_0x430b7f);_0x54b759(_0x430b7f);});});}
\ No newline at end of file
index d6a7b47..d323607 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefda=['update','destroy','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','getFields','post','create','addConfiguration','put'];(function(_0x56b215,_0x3adc22){var _0x23219c=function(_0x5e4690){while(--_0x5e4690){_0x56b215['push'](_0x56b215['shift']());}};_0x23219c(++_0x3adc22);}(_0xefda,0x96));var _0xaefd=function(_0x1d15cd,_0x9933cf){_0x1d15cd=_0x1d15cd-0x0;var _0x22a70a=_0xefda[_0x1d15cd];return _0x22a70a;};'use strict';var multer=require(_0xaefd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaefd('0x1'));var express=require(_0xaefd('0x2'));var router=express['Router']();var fs_extra=require(_0xaefd('0x3'));var auth=require(_0xaefd('0x4'));var interaction=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var controller=require(_0xaefd('0x7'));router[_0xaefd('0x8')]('/',auth['isAuthenticated'](),controller[_0xaefd('0x9')]);router[_0xaefd('0x8')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller['show']);router[_0xaefd('0x8')](_0xaefd('0xc'),auth[_0xaefd('0xb')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0xaefd('0xb')](),controller[_0xaefd('0xd')]);router[_0xaefd('0xe')]('/',auth[_0xaefd('0xb')](),controller[_0xaefd('0xf')]);router[_0xaefd('0xe')](_0xaefd('0xc'),auth[_0xaefd('0xb')](),controller[_0xaefd('0x10')]);router[_0xaefd('0x11')](_0xaefd('0xa'),auth['isAuthenticated'](),controller[_0xaefd('0x12')]);router['delete'](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller[_0xaefd('0x13')]);module[_0xaefd('0x14')]=router;
\ No newline at end of file
+var _0x16d2=['./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x16d2,0x123));var _0x216d=function(_0x1691fd,_0x2fab1c){_0x1691fd=_0x1691fd-0x0;var _0x2bf50b=_0x16d2[_0x1691fd];return _0x2bf50b;};'use strict';var multer=require(_0x216d('0x0'));var util=require(_0x216d('0x1'));var path=require(_0x216d('0x2'));var timeout=require(_0x216d('0x3'));var express=require(_0x216d('0x4'));var router=express[_0x216d('0x5')]();var fs_extra=require(_0x216d('0x6'));var auth=require(_0x216d('0x7'));var interaction=require(_0x216d('0x8'));var config=require('../../config/environment');var controller=require(_0x216d('0x9'));router[_0x216d('0xa')]('/',auth[_0x216d('0xb')](),controller[_0x216d('0xc')]);router[_0x216d('0xa')](_0x216d('0xd'),auth[_0x216d('0xb')](),controller[_0x216d('0xe')]);router['get'](_0x216d('0xf'),auth[_0x216d('0xb')](),controller[_0x216d('0x10')]);router[_0x216d('0xa')](_0x216d('0x11'),auth[_0x216d('0xb')](),controller['getFields']);router[_0x216d('0x12')]('/',auth['isAuthenticated'](),controller[_0x216d('0x13')]);router[_0x216d('0x12')](_0x216d('0xf'),auth[_0x216d('0xb')](),controller[_0x216d('0x14')]);router[_0x216d('0x15')]('/:id',auth[_0x216d('0xb')](),controller['update']);router[_0x216d('0x16')](_0x216d('0xd'),auth['isAuthenticated'](),controller[_0x216d('0x17')]);module[_0x216d('0x18')]=router;
\ No newline at end of file
index 567ebbd..80a2dcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5464=['remoteUri','sequelize','exports','STRING'];(function(_0xa2c7d0,_0x45b4df){var _0x21cef4=function(_0x3baf1c){while(--_0x3baf1c){_0xa2c7d0['push'](_0xa2c7d0['shift']());}};_0x21cef4(++_0x45b4df);}(_0x5464,0x15d));var _0x4546=function(_0x5e1988,_0x5c7414){_0x5e1988=_0x5e1988-0x0;var _0x4549c0=_0x5464[_0x5e1988];return _0x4549c0;};'use strict';var Sequelize=require(_0x4546('0x0'));module[_0x4546('0x1')]={'name':{'type':Sequelize[_0x4546('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4546('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x4546('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x4546('0x3')},'serverUrl':{'type':Sequelize[_0x4546('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0x2272=['sequelize','exports','STRING','remoteUri'];(function(_0x4383e9,_0xa4b307){var _0x355405=function(_0x545b5b){while(--_0x545b5b){_0x4383e9['push'](_0x4383e9['shift']());}};_0x355405(++_0xa4b307);}(_0x2272,0xd8));var _0x2227=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2272[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x2227('0x0'));module[_0x2227('0x1')]={'name':{'type':Sequelize[_0x2227('0x2')]},'description':{'type':Sequelize[_0x2227('0x2')]},'username':{'type':Sequelize[_0x2227('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x2227('0x2')]},'remoteUri':{'type':Sequelize[_0x2227('0x2')],'unique':_0x2227('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index 0cd352f..6a4245c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1f9=['count','set','json','reject','save','update','then','destroy','stack','name','send','index','map','fieldName','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','FreshsalesAccount','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','params','getConfigurations','findOne','FreshsalesConfiguration','AccountId','getSubjects','channel','Descriptions','username','remoteUri','apiKey','slice','substring','GET','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','error','getFields','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit'];(function(_0x38ef51,_0x2fa9fd){var _0x17f3a6=function(_0x519567){while(--_0x519567){_0x38ef51['push'](_0x38ef51['shift']());}};_0x17f3a6(++_0x2fa9fd);}(_0xe1f9,0x1df));var _0x9e1f=function(_0x2f360e,_0x46c04c){_0x2f360e=_0x2f360e-0x0;var _0x52016d=_0xe1f9[_0x2f360e];return _0x52016d;};'use strict';var emlformat=require(_0x9e1f('0x0'));var rimraf=require(_0x9e1f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9e1f('0x2'));var rp=require(_0x9e1f('0x3'));var moment=require('moment');var BPromise=require(_0x9e1f('0x4'));var Mustache=require(_0x9e1f('0x5'));var util=require('util');var path=require(_0x9e1f('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9e1f('0x7'));var fs=require('fs');var fs_extra=require(_0x9e1f('0x8'));var _=require(_0x9e1f('0x9'));var squel=require('squel');var crypto=require(_0x9e1f('0xa'));var jsforce=require(_0x9e1f('0xb'));var deskjs=require(_0x9e1f('0xc'));var toCsv=require(_0x9e1f('0xd'));var querystring=require(_0x9e1f('0xe'));var Papa=require(_0x9e1f('0xf'));var Redis=require('ioredis');var authService=require(_0x9e1f('0x10'));var qs=require(_0x9e1f('0x11'));var as=require(_0x9e1f('0x12'));var hardwareService=require(_0x9e1f('0x13'));var logger=require('../../config/logger')(_0x9e1f('0x14'));var utils=require(_0x9e1f('0x15'));var config=require(_0x9e1f('0x16'));var licenseUtil=require(_0x9e1f('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x9e1f('0x18'));function respondWithStatusCode(_0x505fba,_0x108cd9){_0x108cd9=_0x108cd9||0xcc;return function(_0x388b11){if(_0x388b11){return _0x505fba[_0x9e1f('0x19')](_0x108cd9);}return _0x505fba[_0x9e1f('0x1a')](_0x108cd9)[_0x9e1f('0x1b')]();};}function respondWithResult(_0x1d3364,_0x252ac7){_0x252ac7=_0x252ac7||0xc8;return function(_0x3c01a2){if(_0x3c01a2){return _0x1d3364[_0x9e1f('0x1a')](_0x252ac7)['json'](_0x3c01a2);}};}function respondWithFilteredResult(_0x32d858,_0x4d3d0b){return function(_0x2607ab){if(_0x2607ab){var _0x10e291=typeof _0x4d3d0b[_0x9e1f('0x1c')]===_0x9e1f('0x1d')&&typeof _0x4d3d0b[_0x9e1f('0x1e')]===_0x9e1f('0x1d');var _0x454a2c=_0x2607ab[_0x9e1f('0x1f')];var _0x234099=_0x10e291?0x0:_0x4d3d0b[_0x9e1f('0x1c')];var _0x599102=_0x10e291?_0x2607ab[_0x9e1f('0x1f')]:_0x4d3d0b[_0x9e1f('0x1c')]+_0x4d3d0b[_0x9e1f('0x1e')];var _0xb09eca;if(_0x599102>=_0x454a2c){_0x599102=_0x454a2c;_0xb09eca=0xc8;}else{_0xb09eca=0xce;}_0x32d858[_0x9e1f('0x1a')](_0xb09eca);return _0x32d858[_0x9e1f('0x20')]('Content-Range',_0x234099+'-'+_0x599102+'/'+_0x454a2c)[_0x9e1f('0x21')](_0x2607ab);}return null;};}function patchUpdates(_0x183934){return function(_0x524782){try{jsonpatch['apply'](_0x524782,_0x183934,!![]);}catch(_0x37add1){return BPromise[_0x9e1f('0x22')](_0x37add1);}return _0x524782[_0x9e1f('0x23')]();};}function saveUpdates(_0x31a7fa,_0x3fd5b0){return function(_0x30955c){if(_0x30955c){return _0x30955c[_0x9e1f('0x24')](_0x31a7fa)[_0x9e1f('0x25')](function(_0x52bed5){return _0x52bed5;});}return null;};}function removeEntity(_0x1a1b7b,_0xb53d4){return function(_0x17def0){if(_0x17def0){return _0x17def0[_0x9e1f('0x26')]()['then'](function(){_0x1a1b7b['status'](0xcc)[_0x9e1f('0x1b')]();});}};}function handleEntityNotFound(_0x16f272,_0x3ec02b){return function(_0x80c8b7){if(!_0x80c8b7){_0x16f272[_0x9e1f('0x19')](0x194);}return _0x80c8b7;};}function handleError(_0x328752,_0x1430e7){_0x1430e7=_0x1430e7||0x1f4;return function(_0xdc7026){logger['error'](_0xdc7026[_0x9e1f('0x27')]);if(_0xdc7026[_0x9e1f('0x28')]){delete _0xdc7026[_0x9e1f('0x28')];}_0x328752['status'](_0x1430e7)[_0x9e1f('0x29')](_0xdc7026);};}exports[_0x9e1f('0x2a')]=function(_0x58e9c8,_0x4bdb26){var _0x5262af={},_0x5ddea3={},_0x27fb96={'count':0x0,'rows':[]};var _0x4e728b=_[_0x9e1f('0x2b')](db['FreshsalesAccount']['rawAttributes'],function(_0x15a279){return{'name':_0x15a279[_0x9e1f('0x2c')],'type':_0x15a279['type'][_0x9e1f('0x2d')]};});_0x5ddea3['model']=_['map'](_0x4e728b,'name');_0x5ddea3[_0x9e1f('0x2e')]=_[_0x9e1f('0x2f')](_0x58e9c8[_0x9e1f('0x2e')]);_0x5ddea3['filters']=_[_0x9e1f('0x30')](_0x5ddea3[_0x9e1f('0x31')],_0x5ddea3[_0x9e1f('0x2e')]);_0x5262af[_0x9e1f('0x32')]=_[_0x9e1f('0x30')](_0x5ddea3['model'],qs[_0x9e1f('0x33')](_0x58e9c8[_0x9e1f('0x2e')][_0x9e1f('0x33')]));_0x5262af[_0x9e1f('0x32')]=_0x5262af[_0x9e1f('0x32')][_0x9e1f('0x34')]?_0x5262af[_0x9e1f('0x32')]:_0x5ddea3[_0x9e1f('0x31')];if(!_0x58e9c8[_0x9e1f('0x2e')][_0x9e1f('0x35')](_0x9e1f('0x36'))){_0x5262af[_0x9e1f('0x1e')]=qs[_0x9e1f('0x1e')](_0x58e9c8[_0x9e1f('0x2e')][_0x9e1f('0x1e')]);_0x5262af['offset']=qs[_0x9e1f('0x1c')](_0x58e9c8[_0x9e1f('0x2e')][_0x9e1f('0x1c')]);}_0x5262af[_0x9e1f('0x37')]=qs[_0x9e1f('0x38')](_0x58e9c8[_0x9e1f('0x2e')][_0x9e1f('0x38')]);_0x5262af[_0x9e1f('0x39')]=qs[_0x9e1f('0x3a')](_[_0x9e1f('0x3b')](_0x58e9c8[_0x9e1f('0x2e')],_0x5ddea3[_0x9e1f('0x3a')]),_0x4e728b);if(_0x58e9c8[_0x9e1f('0x2e')][_0x9e1f('0x3c')]){_0x5262af[_0x9e1f('0x39')]=_[_0x9e1f('0x3d')](_0x5262af[_0x9e1f('0x39')],{'$or':_[_0x9e1f('0x2b')](_0x4e728b,function(_0x2e9713){if(_0x2e9713[_0x9e1f('0x3e')]!==_0x9e1f('0x3f')){var _0x15e82b={};_0x15e82b[_0x2e9713[_0x9e1f('0x28')]]={'$like':'%'+_0x58e9c8[_0x9e1f('0x2e')][_0x9e1f('0x3c')]+'%'};return _0x15e82b;}})});}_0x5262af=_[_0x9e1f('0x3d')]({},_0x5262af,_0x58e9c8[_0x9e1f('0x40')]);var _0x1b59cb={'where':_0x5262af[_0x9e1f('0x39')]};return db[_0x9e1f('0x41')][_0x9e1f('0x1f')](_0x1b59cb)['then'](function(_0x22aa06){_0x27fb96[_0x9e1f('0x1f')]=_0x22aa06;if(_0x58e9c8['query'][_0x9e1f('0x42')]){_0x5262af['include']=[{'all':!![]}];}return db[_0x9e1f('0x41')][_0x9e1f('0x43')](_0x5262af);})['then'](function(_0x462252){_0x27fb96[_0x9e1f('0x44')]=_0x462252;return _0x27fb96;})[_0x9e1f('0x25')](respondWithFilteredResult(_0x4bdb26,_0x5262af))[_0x9e1f('0x45')](handleError(_0x4bdb26,null));};exports[_0x9e1f('0x46')]=function(_0x1e2059,_0x1b9b76){var _0x1f5d5a={'raw':![],'where':{'id':_0x1e2059['params']['id']}},_0x4b150e={};_0x4b150e[_0x9e1f('0x31')]=_['keys'](db[_0x9e1f('0x41')][_0x9e1f('0x47')]);_0x4b150e[_0x9e1f('0x2e')]=_[_0x9e1f('0x2f')](_0x1e2059[_0x9e1f('0x2e')]);_0x4b150e[_0x9e1f('0x3a')]=_['intersection'](_0x4b150e[_0x9e1f('0x31')],_0x4b150e[_0x9e1f('0x2e')]);_0x1f5d5a['attributes']=_[_0x9e1f('0x30')](_0x4b150e[_0x9e1f('0x31')],qs[_0x9e1f('0x33')](_0x1e2059[_0x9e1f('0x2e')][_0x9e1f('0x33')]));_0x1f5d5a[_0x9e1f('0x32')]=_0x1f5d5a['attributes']['length']?_0x1f5d5a['attributes']:_0x4b150e['model'];if(_0x1e2059[_0x9e1f('0x2e')][_0x9e1f('0x42')]){_0x1f5d5a[_0x9e1f('0x48')]=[{'all':!![]}];}_0x1f5d5a=_[_0x9e1f('0x3d')]({},_0x1f5d5a,_0x1e2059[_0x9e1f('0x40')]);return db[_0x9e1f('0x41')][_0x9e1f('0x49')](_0x1f5d5a)[_0x9e1f('0x25')](handleEntityNotFound(_0x1b9b76,null))[_0x9e1f('0x25')](respondWithResult(_0x1b9b76,null))[_0x9e1f('0x45')](handleError(_0x1b9b76,null));};exports[_0x9e1f('0x4a')]=function(_0x4dcd75,_0x3a368c){return db[_0x9e1f('0x41')][_0x9e1f('0x4a')](_0x4dcd75[_0x9e1f('0x4b')],{})[_0x9e1f('0x25')](respondWithResult(_0x3a368c,0xc9))[_0x9e1f('0x45')](handleError(_0x3a368c,null));};exports[_0x9e1f('0x24')]=function(_0x2a0b9c,_0x2e276a){if(_0x2a0b9c[_0x9e1f('0x4b')]['id']){delete _0x2a0b9c[_0x9e1f('0x4b')]['id'];}return db[_0x9e1f('0x41')][_0x9e1f('0x49')]({'where':{'id':_0x2a0b9c['params']['id']}})[_0x9e1f('0x25')](handleEntityNotFound(_0x2e276a,null))[_0x9e1f('0x25')](saveUpdates(_0x2a0b9c[_0x9e1f('0x4b')],null))['then'](respondWithResult(_0x2e276a,null))[_0x9e1f('0x45')](handleError(_0x2e276a,null));};exports['destroy']=function(_0x42dd85,_0x496950){return db[_0x9e1f('0x41')][_0x9e1f('0x49')]({'where':{'id':_0x42dd85[_0x9e1f('0x4c')]['id']}})[_0x9e1f('0x25')](handleEntityNotFound(_0x496950,null))[_0x9e1f('0x25')](removeEntity(_0x496950,null))[_0x9e1f('0x45')](handleError(_0x496950,null));};exports[_0x9e1f('0x4d')]=function(_0x34a720,_0x21adbf,_0x1bff6f){var _0xdbdfdd={};var _0x3954ef={};var _0x2f03aa;var _0x1e25f6;return db[_0x9e1f('0x41')][_0x9e1f('0x4e')]({'where':{'id':_0x34a720['params']['id']}})[_0x9e1f('0x25')](handleEntityNotFound(_0x21adbf,null))[_0x9e1f('0x25')](function(_0x2dad92){if(_0x2dad92){_0x2f03aa=_0x2dad92;_0x3954ef[_0x9e1f('0x31')]=_[_0x9e1f('0x2f')](db[_0x9e1f('0x4f')][_0x9e1f('0x47')]);_0x3954ef[_0x9e1f('0x2e')]=_[_0x9e1f('0x2f')](_0x34a720[_0x9e1f('0x2e')]);_0x3954ef[_0x9e1f('0x3a')]=_[_0x9e1f('0x30')](_0x3954ef[_0x9e1f('0x31')],_0x3954ef[_0x9e1f('0x2e')]);_0xdbdfdd['attributes']=_[_0x9e1f('0x30')](_0x3954ef[_0x9e1f('0x31')],qs['fields'](_0x34a720[_0x9e1f('0x2e')][_0x9e1f('0x33')]));_0xdbdfdd['attributes']=_0xdbdfdd[_0x9e1f('0x32')][_0x9e1f('0x34')]?_0xdbdfdd[_0x9e1f('0x32')]:_0x3954ef[_0x9e1f('0x31')];_0xdbdfdd[_0x9e1f('0x37')]=qs['sort'](_0x34a720[_0x9e1f('0x2e')][_0x9e1f('0x38')]);_0xdbdfdd['where']=qs[_0x9e1f('0x3a')](_['pick'](_0x34a720[_0x9e1f('0x2e')],_0x3954ef['filters']));if(_0x34a720[_0x9e1f('0x2e')][_0x9e1f('0x3c')]){_0xdbdfdd[_0x9e1f('0x39')]=_[_0x9e1f('0x3d')](_0xdbdfdd[_0x9e1f('0x39')],{'$or':_['map'](_0xdbdfdd[_0x9e1f('0x32')],function(_0x3f3257){var _0x23e3ea={};_0x23e3ea[_0x3f3257]={'$like':'%'+_0x34a720[_0x9e1f('0x2e')][_0x9e1f('0x3c')]+'%'};return _0x23e3ea;})});}_0xdbdfdd=_[_0x9e1f('0x3d')]({},_0xdbdfdd,_0x34a720[_0x9e1f('0x40')]);return _0x2f03aa[_0x9e1f('0x4d')](_0xdbdfdd);}})[_0x9e1f('0x25')](function(_0x3fd237){if(_0x3fd237){_0x1e25f6=_0x3fd237[_0x9e1f('0x34')];if(!_0x34a720['query'][_0x9e1f('0x35')](_0x9e1f('0x36'))){_0xdbdfdd['limit']=qs[_0x9e1f('0x1e')](_0x34a720[_0x9e1f('0x2e')]['limit']);_0xdbdfdd['offset']=qs['offset'](_0x34a720['query'][_0x9e1f('0x1c')]);}return _0x2f03aa['getConfigurations'](_0xdbdfdd);}})[_0x9e1f('0x25')](function(_0x598b9c){if(_0x598b9c){return _0x598b9c?{'count':_0x1e25f6,'rows':_0x598b9c}:null;}})['then'](respondWithResult(_0x21adbf,null))[_0x9e1f('0x45')](handleError(_0x21adbf,null));};exports['addConfiguration']=function(_0x3fa677,_0x2504ef,_0x2c4f66){if(_0x3fa677['body']['id']){delete _0x3fa677[_0x9e1f('0x4b')]['id'];}return db['FreshsalesAccount'][_0x9e1f('0x4e')]({'where':{'id':_0x3fa677[_0x9e1f('0x4c')]['id']}})[_0x9e1f('0x25')](handleEntityNotFound(_0x2504ef,null))[_0x9e1f('0x25')](function(_0x582e1e){if(_0x582e1e){_0x3fa677[_0x9e1f('0x4b')][_0x9e1f('0x50')]=_0x582e1e['id'];_0x3fa677[_0x9e1f('0x4b')]['Subjects']=integrations[_0x9e1f('0x51')](_0x3fa677[_0x9e1f('0x4b')][_0x9e1f('0x52')],_0x3fa677['body'][_0x9e1f('0x3e')]);_0x3fa677[_0x9e1f('0x4b')][_0x9e1f('0x53')]=integrations['getDescriptions'](_0x3fa677[_0x9e1f('0x4b')][_0x9e1f('0x52')],_0x3fa677[_0x9e1f('0x4b')]['type']);return db[_0x9e1f('0x4f')][_0x9e1f('0x4a')](_0x3fa677[_0x9e1f('0x4b')],{'include':[{'model':db['FreshsalesField'],'as':'Subjects'},{'model':db['FreshsalesField'],'as':_0x9e1f('0x53')}]});}return null;})['then'](respondWithResult(_0x2504ef,null))[_0x9e1f('0x45')](handleError(_0x2504ef,null));};exports['getFields']=function(_0x2f69af,_0x3725c6,_0x3a5334){var _0x33f74b='';var _0x562351='';return db['FreshsalesAccount'][_0x9e1f('0x4e')]({'where':{'id':_0x2f69af[_0x9e1f('0x4c')]['id']},'attributes':['id',_0x9e1f('0x54'),_0x9e1f('0x55'),_0x9e1f('0x56')]})['then'](handleEntityNotFound(_0x3725c6,null))[_0x9e1f('0x25')](function(_0x39e5c5){if(_0x39e5c5){_0x562351=_0x39e5c5['username'];_0x33f74b=_0x39e5c5['remoteUri'];var _0x440977=_0x39e5c5[_0x9e1f('0x55')][_0x9e1f('0x57')](-0x1);if(_0x440977==='/'){_0x33f74b=_0x33f74b[_0x9e1f('0x58')](0x0,_0x33f74b['lastIndexOf'](_0x440977));}return rp({'method':_0x9e1f('0x59'),'uri':util['format'](_0x9e1f('0x5a'),_0x33f74b,_0x9e1f('0x5b')),'headers':{'Authorization':_0x9e1f('0x5c')+_0x39e5c5[_0x9e1f('0x56')]},'json':!![]});}})[_0x9e1f('0x25')](function(_0x32955c){if(_0x32955c){var _0x3fa1fa=_0x32955c[_0x9e1f('0x5d')];var _0x32bf16=![];var _0x4067a3=null;for(_0x4067a3=0x0;_0x4067a3<_0x3fa1fa[_0x9e1f('0x34')];_0x4067a3++){if(_0x3fa1fa[_0x4067a3][_0x9e1f('0x5e')]===_0x562351){_0x32bf16=!![];}}if(_0x32bf16){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x9e1f('0x5f')});}}})['then'](respondWithResult(_0x3725c6,null))[_0x9e1f('0x45')](function(_0x30e2bd){var _0xa7ded6=_0x2f69af[_0x9e1f('0x2e')][_0x9e1f('0x60')]?0x1f4:_0x30e2bd[_0x9e1f('0x61')]||0x1f4;logger[_0x9e1f('0x62')]('getFields,\x20%s,\x20%s,\x20%s',_0x9e1f('0x63'),_0xa7ded6,JSON[_0x9e1f('0x64')](_0x30e2bd));delete _0x30e2bd[_0x9e1f('0x28')];if(_0xa7ded6===0x191){_0xa7ded6=0x190;}_0x3725c6['status'](_0xa7ded6)[_0x9e1f('0x29')](_0x2f69af[_0x9e1f('0x2e')][_0x9e1f('0x60')]?{'message':_0x9e1f('0x65'),'statusCode':_0x30e2bd[_0x9e1f('0x61')]}:_0x30e2bd);});};
\ No newline at end of file
+var _0x378a=['rows','catch','params','rawAttributes','include','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','Subjects','getFields','username','remoteUri','apiKey','substring','lastIndexOf','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','FreshsalesAccount','includeAll','findAll','then'];(function(_0x255c48,_0x2a4449){var _0xaebda3=function(_0x12a04e){while(--_0x12a04e){_0x255c48['push'](_0x255c48['shift']());}};_0xaebda3(++_0x2a4449);}(_0x378a,0xfc));var _0xa378=function(_0x247c39,_0x412245){_0x247c39=_0x247c39-0x0;var _0x2383b5=_0x378a[_0x247c39];return _0x2383b5;};'use strict';var emlformat=require(_0xa378('0x0'));var rimraf=require(_0xa378('0x1'));var zipdir=require(_0xa378('0x2'));var jsonpatch=require(_0xa378('0x3'));var rp=require(_0xa378('0x4'));var moment=require(_0xa378('0x5'));var BPromise=require(_0xa378('0x6'));var Mustache=require(_0xa378('0x7'));var util=require(_0xa378('0x8'));var path=require(_0xa378('0x9'));var sox=require(_0xa378('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa378('0xb'));var _=require(_0xa378('0xc'));var squel=require(_0xa378('0xd'));var crypto=require(_0xa378('0xe'));var jsforce=require(_0xa378('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa378('0x10'));var querystring=require(_0xa378('0x11'));var Papa=require(_0xa378('0x12'));var Redis=require(_0xa378('0x13'));var authService=require(_0xa378('0x14'));var qs=require(_0xa378('0x15'));var as=require(_0xa378('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa378('0x17'))(_0xa378('0x18'));var utils=require(_0xa378('0x19'));var config=require(_0xa378('0x1a'));var licenseUtil=require(_0xa378('0x1b'));var db=require('../../mysqldb')['db'];var integrations=require(_0xa378('0x1c'));function respondWithStatusCode(_0x1403cf,_0x682e62){_0x682e62=_0x682e62||0xcc;return function(_0x25faa5){if(_0x25faa5){return _0x1403cf[_0xa378('0x1d')](_0x682e62);}return _0x1403cf['status'](_0x682e62)['end']();};}function respondWithResult(_0x487c35,_0x1d1600){_0x1d1600=_0x1d1600||0xc8;return function(_0x1e8bb1){if(_0x1e8bb1){return _0x487c35[_0xa378('0x1e')](_0x1d1600)['json'](_0x1e8bb1);}};}function respondWithFilteredResult(_0x230da4,_0x4a8727){return function(_0x5e5db7){if(_0x5e5db7){var _0x28e28d=typeof _0x4a8727[_0xa378('0x1f')]===_0xa378('0x20')&&typeof _0x4a8727[_0xa378('0x21')]==='undefined';var _0x1fff6d=_0x5e5db7[_0xa378('0x22')];var _0x24755a=_0x28e28d?0x0:_0x4a8727[_0xa378('0x1f')];var _0x19ebea=_0x28e28d?_0x5e5db7[_0xa378('0x22')]:_0x4a8727['offset']+_0x4a8727['limit'];var _0xf2edc4;if(_0x19ebea>=_0x1fff6d){_0x19ebea=_0x1fff6d;_0xf2edc4=0xc8;}else{_0xf2edc4=0xce;}_0x230da4['status'](_0xf2edc4);return _0x230da4[_0xa378('0x23')](_0xa378('0x24'),_0x24755a+'-'+_0x19ebea+'/'+_0x1fff6d)['json'](_0x5e5db7);}return null;};}function patchUpdates(_0x23c3ea){return function(_0x5c3049){try{jsonpatch[_0xa378('0x25')](_0x5c3049,_0x23c3ea,!![]);}catch(_0x190ff0){return BPromise[_0xa378('0x26')](_0x190ff0);}return _0x5c3049[_0xa378('0x27')]();};}function saveUpdates(_0x4ae1ec,_0x41e87d){return function(_0x15445a){if(_0x15445a){return _0x15445a[_0xa378('0x28')](_0x4ae1ec)['then'](function(_0x48d7dc){return _0x48d7dc;});}return null;};}function removeEntity(_0x50f822,_0x160d58){return function(_0x57808c){if(_0x57808c){return _0x57808c[_0xa378('0x29')]()['then'](function(){_0x50f822[_0xa378('0x1e')](0xcc)[_0xa378('0x2a')]();});}};}function handleEntityNotFound(_0x592d09,_0x56fed2){return function(_0x550ac4){if(!_0x550ac4){_0x592d09[_0xa378('0x1d')](0x194);}return _0x550ac4;};}function handleError(_0x4745b9,_0x50906d){_0x50906d=_0x50906d||0x1f4;return function(_0x34b468){logger[_0xa378('0x2b')](_0x34b468[_0xa378('0x2c')]);if(_0x34b468[_0xa378('0x2d')]){delete _0x34b468[_0xa378('0x2d')];}_0x4745b9['status'](_0x50906d)[_0xa378('0x2e')](_0x34b468);};}exports['index']=function(_0x9dfc9b,_0x2f59bb){var _0x1e56f5={},_0x5bf70c={},_0x255dd1={'count':0x0,'rows':[]};var _0x4216dd=_['map'](db['FreshsalesAccount']['rawAttributes'],function(_0x3398c){return{'name':_0x3398c[_0xa378('0x2f')],'type':_0x3398c[_0xa378('0x30')][_0xa378('0x31')]};});_0x5bf70c[_0xa378('0x32')]=_[_0xa378('0x33')](_0x4216dd,'name');_0x5bf70c[_0xa378('0x34')]=_[_0xa378('0x35')](_0x9dfc9b[_0xa378('0x34')]);_0x5bf70c[_0xa378('0x36')]=_[_0xa378('0x37')](_0x5bf70c['model'],_0x5bf70c['query']);_0x1e56f5[_0xa378('0x38')]=_[_0xa378('0x37')](_0x5bf70c[_0xa378('0x32')],qs[_0xa378('0x39')](_0x9dfc9b[_0xa378('0x34')][_0xa378('0x39')]));_0x1e56f5['attributes']=_0x1e56f5[_0xa378('0x38')][_0xa378('0x3a')]?_0x1e56f5['attributes']:_0x5bf70c[_0xa378('0x32')];if(!_0x9dfc9b[_0xa378('0x34')][_0xa378('0x3b')](_0xa378('0x3c'))){_0x1e56f5[_0xa378('0x21')]=qs[_0xa378('0x21')](_0x9dfc9b[_0xa378('0x34')][_0xa378('0x21')]);_0x1e56f5['offset']=qs['offset'](_0x9dfc9b[_0xa378('0x34')][_0xa378('0x1f')]);}_0x1e56f5[_0xa378('0x3d')]=qs[_0xa378('0x3e')](_0x9dfc9b[_0xa378('0x34')][_0xa378('0x3e')]);_0x1e56f5[_0xa378('0x3f')]=qs[_0xa378('0x36')](_[_0xa378('0x40')](_0x9dfc9b[_0xa378('0x34')],_0x5bf70c['filters']),_0x4216dd);if(_0x9dfc9b[_0xa378('0x34')][_0xa378('0x41')]){_0x1e56f5[_0xa378('0x3f')]=_[_0xa378('0x42')](_0x1e56f5['where'],{'$or':_[_0xa378('0x33')](_0x4216dd,function(_0x407cfb){if(_0x407cfb[_0xa378('0x30')]!=='VIRTUAL'){var _0x596bbc={};_0x596bbc[_0x407cfb[_0xa378('0x2d')]]={'$like':'%'+_0x9dfc9b['query'][_0xa378('0x41')]+'%'};return _0x596bbc;}})});}_0x1e56f5=_[_0xa378('0x42')]({},_0x1e56f5,_0x9dfc9b[_0xa378('0x43')]);var _0xac3b09={'where':_0x1e56f5[_0xa378('0x3f')]};return db[_0xa378('0x44')]['count'](_0xac3b09)['then'](function(_0x1d615f){_0x255dd1[_0xa378('0x22')]=_0x1d615f;if(_0x9dfc9b[_0xa378('0x34')][_0xa378('0x45')]){_0x1e56f5['include']=[{'all':!![]}];}return db[_0xa378('0x44')][_0xa378('0x46')](_0x1e56f5);})[_0xa378('0x47')](function(_0x3e9bd8){_0x255dd1[_0xa378('0x48')]=_0x3e9bd8;return _0x255dd1;})[_0xa378('0x47')](respondWithFilteredResult(_0x2f59bb,_0x1e56f5))[_0xa378('0x49')](handleError(_0x2f59bb,null));};exports['show']=function(_0x471342,_0x2e79d4){var _0x5e77ca={'raw':![],'where':{'id':_0x471342[_0xa378('0x4a')]['id']}},_0x3e3c30={};_0x3e3c30['model']=_[_0xa378('0x35')](db[_0xa378('0x44')][_0xa378('0x4b')]);_0x3e3c30['query']=_[_0xa378('0x35')](_0x471342[_0xa378('0x34')]);_0x3e3c30[_0xa378('0x36')]=_[_0xa378('0x37')](_0x3e3c30['model'],_0x3e3c30[_0xa378('0x34')]);_0x5e77ca['attributes']=_[_0xa378('0x37')](_0x3e3c30['model'],qs[_0xa378('0x39')](_0x471342['query']['fields']));_0x5e77ca[_0xa378('0x38')]=_0x5e77ca[_0xa378('0x38')][_0xa378('0x3a')]?_0x5e77ca[_0xa378('0x38')]:_0x3e3c30[_0xa378('0x32')];if(_0x471342[_0xa378('0x34')][_0xa378('0x45')]){_0x5e77ca[_0xa378('0x4c')]=[{'all':!![]}];}_0x5e77ca=_[_0xa378('0x42')]({},_0x5e77ca,_0x471342['options']);return db['FreshsalesAccount'][_0xa378('0x4d')](_0x5e77ca)['then'](handleEntityNotFound(_0x2e79d4,null))[_0xa378('0x47')](respondWithResult(_0x2e79d4,null))[_0xa378('0x49')](handleError(_0x2e79d4,null));};exports[_0xa378('0x4e')]=function(_0x2fb7db,_0xe6bf5b){return db[_0xa378('0x44')][_0xa378('0x4e')](_0x2fb7db['body'],{})[_0xa378('0x47')](respondWithResult(_0xe6bf5b,0xc9))[_0xa378('0x49')](handleError(_0xe6bf5b,null));};exports['update']=function(_0x584107,_0x3e1e8d){if(_0x584107[_0xa378('0x4f')]['id']){delete _0x584107[_0xa378('0x4f')]['id'];}return db[_0xa378('0x44')]['find']({'where':{'id':_0x584107[_0xa378('0x4a')]['id']}})[_0xa378('0x47')](handleEntityNotFound(_0x3e1e8d,null))['then'](saveUpdates(_0x584107[_0xa378('0x4f')],null))[_0xa378('0x47')](respondWithResult(_0x3e1e8d,null))[_0xa378('0x49')](handleError(_0x3e1e8d,null));};exports[_0xa378('0x29')]=function(_0x51a5bd,_0x3a8e41){return db[_0xa378('0x44')]['find']({'where':{'id':_0x51a5bd['params']['id']}})['then'](handleEntityNotFound(_0x3a8e41,null))[_0xa378('0x47')](removeEntity(_0x3a8e41,null))[_0xa378('0x49')](handleError(_0x3a8e41,null));};exports[_0xa378('0x50')]=function(_0xaa7b2,_0x56a08f,_0x25c6c0){var _0x43f925={};var _0x456a70={};var _0x17a4ce;var _0x4fdea0;return db[_0xa378('0x44')][_0xa378('0x51')]({'where':{'id':_0xaa7b2[_0xa378('0x4a')]['id']}})[_0xa378('0x47')](handleEntityNotFound(_0x56a08f,null))[_0xa378('0x47')](function(_0x3ef434){if(_0x3ef434){_0x17a4ce=_0x3ef434;_0x456a70[_0xa378('0x32')]=_[_0xa378('0x35')](db[_0xa378('0x52')][_0xa378('0x4b')]);_0x456a70[_0xa378('0x34')]=_[_0xa378('0x35')](_0xaa7b2[_0xa378('0x34')]);_0x456a70['filters']=_['intersection'](_0x456a70[_0xa378('0x32')],_0x456a70[_0xa378('0x34')]);_0x43f925[_0xa378('0x38')]=_[_0xa378('0x37')](_0x456a70[_0xa378('0x32')],qs[_0xa378('0x39')](_0xaa7b2[_0xa378('0x34')][_0xa378('0x39')]));_0x43f925[_0xa378('0x38')]=_0x43f925[_0xa378('0x38')]['length']?_0x43f925[_0xa378('0x38')]:_0x456a70[_0xa378('0x32')];_0x43f925[_0xa378('0x3d')]=qs['sort'](_0xaa7b2[_0xa378('0x34')][_0xa378('0x3e')]);_0x43f925[_0xa378('0x3f')]=qs['filters'](_[_0xa378('0x40')](_0xaa7b2['query'],_0x456a70[_0xa378('0x36')]));if(_0xaa7b2[_0xa378('0x34')][_0xa378('0x41')]){_0x43f925[_0xa378('0x3f')]=_[_0xa378('0x42')](_0x43f925[_0xa378('0x3f')],{'$or':_[_0xa378('0x33')](_0x43f925[_0xa378('0x38')],function(_0x2dcbe2){var _0x53c8a9={};_0x53c8a9[_0x2dcbe2]={'$like':'%'+_0xaa7b2[_0xa378('0x34')]['filter']+'%'};return _0x53c8a9;})});}_0x43f925=_[_0xa378('0x42')]({},_0x43f925,_0xaa7b2[_0xa378('0x43')]);return _0x17a4ce['getConfigurations'](_0x43f925);}})[_0xa378('0x47')](function(_0x370d0c){if(_0x370d0c){_0x4fdea0=_0x370d0c[_0xa378('0x3a')];if(!_0xaa7b2[_0xa378('0x34')][_0xa378('0x3b')]('nolimit')){_0x43f925[_0xa378('0x21')]=qs[_0xa378('0x21')](_0xaa7b2[_0xa378('0x34')]['limit']);_0x43f925['offset']=qs[_0xa378('0x1f')](_0xaa7b2['query'][_0xa378('0x1f')]);}return _0x17a4ce['getConfigurations'](_0x43f925);}})[_0xa378('0x47')](function(_0x146058){if(_0x146058){return _0x146058?{'count':_0x4fdea0,'rows':_0x146058}:null;}})[_0xa378('0x47')](respondWithResult(_0x56a08f,null))['catch'](handleError(_0x56a08f,null));};exports[_0xa378('0x53')]=function(_0x5e7306,_0x24e374,_0x1ee7bc){if(_0x5e7306['body']['id']){delete _0x5e7306['body']['id'];}return db['FreshsalesAccount'][_0xa378('0x51')]({'where':{'id':_0x5e7306['params']['id']}})[_0xa378('0x47')](handleEntityNotFound(_0x24e374,null))[_0xa378('0x47')](function(_0x4be516){if(_0x4be516){_0x5e7306['body']['AccountId']=_0x4be516['id'];_0x5e7306[_0xa378('0x4f')]['Subjects']=integrations[_0xa378('0x54')](_0x5e7306[_0xa378('0x4f')][_0xa378('0x55')],_0x5e7306[_0xa378('0x4f')]['type']);_0x5e7306[_0xa378('0x4f')][_0xa378('0x56')]=integrations[_0xa378('0x57')](_0x5e7306[_0xa378('0x4f')][_0xa378('0x55')],_0x5e7306[_0xa378('0x4f')]['type']);return db[_0xa378('0x52')][_0xa378('0x4e')](_0x5e7306[_0xa378('0x4f')],{'include':[{'model':db[_0xa378('0x58')],'as':_0xa378('0x59')},{'model':db['FreshsalesField'],'as':_0xa378('0x56')}]});}return null;})[_0xa378('0x47')](respondWithResult(_0x24e374,null))[_0xa378('0x49')](handleError(_0x24e374,null));};exports[_0xa378('0x5a')]=function(_0x308efe,_0x287614,_0x599ae2){var _0xeb78cd='';var _0x104411='';return db[_0xa378('0x44')][_0xa378('0x51')]({'where':{'id':_0x308efe[_0xa378('0x4a')]['id']},'attributes':['id',_0xa378('0x5b'),_0xa378('0x5c'),_0xa378('0x5d')]})[_0xa378('0x47')](handleEntityNotFound(_0x287614,null))[_0xa378('0x47')](function(_0x1b999c){if(_0x1b999c){_0x104411=_0x1b999c[_0xa378('0x5b')];_0xeb78cd=_0x1b999c[_0xa378('0x5c')];var _0x5299b6=_0x1b999c[_0xa378('0x5c')]['slice'](-0x1);if(_0x5299b6==='/'){_0xeb78cd=_0xeb78cd[_0xa378('0x5e')](0x0,_0xeb78cd[_0xa378('0x5f')](_0x5299b6));}return rp({'method':'GET','uri':util[_0xa378('0x60')](_0xa378('0x61'),_0xeb78cd,_0xa378('0x62')),'headers':{'Authorization':_0xa378('0x63')+_0x1b999c[_0xa378('0x5d')]},'json':!![]});}})['then'](function(_0x5e978b){if(_0x5e978b){var _0x4aba69=_0x5e978b[_0xa378('0x64')];var _0x19331d=![];var _0x14aac7=null;for(_0x14aac7=0x0;_0x14aac7<_0x4aba69[_0xa378('0x3a')];_0x14aac7++){if(_0x4aba69[_0x14aac7][_0xa378('0x65')]===_0x104411){_0x19331d=!![];}}if(_0x19331d){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xa378('0x66')});}}})[_0xa378('0x47')](respondWithResult(_0x287614,null))[_0xa378('0x49')](function(_0x43c00d){var _0x15959c=_0x308efe[_0xa378('0x34')]['test']?0x1f4:_0x43c00d[_0xa378('0x67')]||0x1f4;logger[_0xa378('0x2b')](_0xa378('0x68'),_0xa378('0x5a'),_0x15959c,JSON[_0xa378('0x69')](_0x43c00d));delete _0x43c00d[_0xa378('0x2d')];if(_0x15959c===0x191){_0x15959c=0x190;}_0x287614[_0xa378('0x1e')](_0x15959c)[_0xa378('0x2e')](_0x308efe['query'][_0xa378('0x6a')]?{'message':_0xa378('0x6b'),'statusCode':_0x43c00d[_0xa378('0x67')]}:_0x43c00d);});};
\ No newline at end of file
index 9033c96..f2abe96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f2f=['../../config/logger','api','moment','bluebird','request-promise','path','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','int_freshsales_accounts','lodash','util'];(function(_0x4baafe,_0x1f86c0){var _0x28336d=function(_0x194a0c){while(--_0x194a0c){_0x4baafe['push'](_0x4baafe['shift']());}};_0x28336d(++_0x1f86c0);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5b38df,_0x3a6808){_0x5b38df=_0x5b38df-0x0;var _0x2e4f3e=_0x5f2f[_0x5b38df];return _0x2e4f3e;};'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'));var integrations=require(_0xf5f2('0x9'));module[_0xf5f2('0xa')]=function(_0x3eebf6,_0x3133bc){return _0x3eebf6[_0xf5f2('0xb')]('FreshsalesAccount',attributes,{'tableName':_0xf5f2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4745=['path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','FreshsalesAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x18caef,_0x2e3b38){var _0x1a5804=function(_0x45c602){while(--_0x45c602){_0x18caef['push'](_0x18caef['shift']());}};_0x1a5804(++_0x2e3b38);}(_0x4745,0x1e7));var _0x5474=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0x4745[_0x1b828b];return _0x98da1a;};'use strict';var _=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var logger=require(_0x5474('0x2'))(_0x5474('0x3'));var moment=require(_0x5474('0x4'));var BPromise=require(_0x5474('0x5'));var rp=require(_0x5474('0x6'));var fs=require('fs');var path=require(_0x5474('0x7'));var rimraf=require(_0x5474('0x8'));var config=require(_0x5474('0x9'));var attributes=require(_0x5474('0xa'));var integrations=require(_0x5474('0xb'));module['exports']=function(_0x3d1e1,_0x431f81){return _0x3d1e1['define'](_0x5474('0xc'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 09fccae..7be0fb0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d11=['debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','FreshsalesAccount','findAll','options','attributes','limit','map','include','model','GetFreshsalesAccount','ShowFreshsalesAccount','find','raw','where','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','FreshsalesAccount,\x20%s,\x20%s'];(function(_0x102b2b,_0x45d45e){var _0x55db93=function(_0x502524){while(--_0x502524){_0x102b2b['push'](_0x102b2b['shift']());}};_0x55db93(++_0x45d45e);}(_0x6d11,0xbf));var _0x16d1=function(_0x1e0414,_0x2f755a){_0x1e0414=_0x1e0414-0x0;var _0x84b43=_0x6d11[_0x1e0414];return _0x84b43;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var moment=require(_0x16d1('0x2'));var BPromise=require('bluebird');var rs=require(_0x16d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16d1('0x4'))['db'];var utils=require(_0x16d1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x16d1('0x6'));var jayson=require(_0x16d1('0x7'));var client=jayson[_0x16d1('0x8')][_0x16d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1009dc,_0x150217,_0x19390d){return new BPromise(function(_0x5d0e3f,_0x58a7a2){return client['request'](_0x1009dc,_0x19390d)[_0x16d1('0xa')](function(_0xcfbb15){logger[_0x16d1('0xb')](_0x16d1('0xc'),_0x150217,'request\x20sent');logger[_0x16d1('0xd')](_0x16d1('0xe'),_0x150217,_0x16d1('0xf'),JSON[_0x16d1('0x10')](_0xcfbb15));if(_0xcfbb15[_0x16d1('0x11')]){if(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x12')]===0x1f4){logger[_0x16d1('0x11')]('FreshsalesAccount,\x20%s,\x20%s',_0x150217,_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);return _0x58a7a2(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);}logger[_0x16d1('0x11')]('FreshsalesAccount,\x20%s,\x20%s',_0x150217,_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);return _0x5d0e3f(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);}else{logger[_0x16d1('0xb')](_0x16d1('0xc'),_0x150217,_0x16d1('0xf'));_0x5d0e3f(_0xcfbb15['result'][_0x16d1('0x13')]);}})[_0x16d1('0x14')](function(_0x555b2d){logger['error'](_0x16d1('0xc'),_0x150217,_0x555b2d);_0x58a7a2(_0x555b2d);});});}exports['GetFreshsalesAccount']=function(_0x46a25e){var _0x4aeff0=this;return new Promise(function(_0x1da1b8,_0x4fe22d){return db[_0x16d1('0x15')][_0x16d1('0x16')]({'raw':_0x46a25e['options']?_0x46a25e['options']['raw']===undefined?!![]:![]:!![],'where':_0x46a25e['options']?_0x46a25e[_0x16d1('0x17')]['where']||null:null,'attributes':_0x46a25e[_0x16d1('0x17')]?_0x46a25e[_0x16d1('0x17')][_0x16d1('0x18')]||null:null,'limit':_0x46a25e[_0x16d1('0x17')]?_0x46a25e['options'][_0x16d1('0x19')]||null:null,'include':_0x46a25e[_0x16d1('0x17')]?_0x46a25e[_0x16d1('0x17')]['include']?_[_0x16d1('0x1a')](_0x46a25e[_0x16d1('0x17')][_0x16d1('0x1b')],function(_0x47cad4){return{'model':db[_0x47cad4[_0x16d1('0x1c')]],'as':_0x47cad4['as'],'attributes':_0x47cad4[_0x16d1('0x18')],'include':_0x47cad4[_0x16d1('0x1b')]?_[_0x16d1('0x1a')](_0x47cad4[_0x16d1('0x1b')],function(_0x335c24){return{'model':db[_0x335c24[_0x16d1('0x1c')]],'as':_0x335c24['as'],'attributes':_0x335c24[_0x16d1('0x18')],'include':_0x335c24[_0x16d1('0x1b')]?_[_0x16d1('0x1a')](_0x335c24[_0x16d1('0x1b')],function(_0x2b8403){return{'model':db[_0x2b8403['model']],'as':_0x2b8403['as'],'attributes':_0x2b8403[_0x16d1('0x18')]};}):[]};}):[]};}):[]:[]})[_0x16d1('0xa')](function(_0x4257f1){logger['info'](_0x16d1('0x1d'),_0x46a25e);logger[_0x16d1('0xd')](_0x16d1('0x1d'),_0x46a25e,JSON[_0x16d1('0x10')](_0x4257f1));_0x1da1b8(_0x4257f1);})[_0x16d1('0x14')](function(_0x462e5b){logger[_0x16d1('0x11')]('GetFreshsalesAccount',_0x462e5b[_0x16d1('0x13')],_0x46a25e);_0x4fe22d(_0x4aeff0[_0x16d1('0x11')](0x1f4,_0x462e5b[_0x16d1('0x13')]));});});};exports[_0x16d1('0x1e')]=function(_0x55c021){var _0x4b27f6=this;return new Promise(function(_0x2f16ee,_0x4ab3d4){return db[_0x16d1('0x15')][_0x16d1('0x1f')]({'raw':_0x55c021[_0x16d1('0x17')]?_0x55c021[_0x16d1('0x17')][_0x16d1('0x20')]===undefined?!![]:![]:!![],'where':_0x55c021[_0x16d1('0x17')]?_0x55c021[_0x16d1('0x17')][_0x16d1('0x21')]||null:null,'attributes':_0x55c021[_0x16d1('0x17')]?_0x55c021[_0x16d1('0x17')][_0x16d1('0x18')]||null:null,'include':_0x55c021[_0x16d1('0x17')]?_0x55c021['options'][_0x16d1('0x1b')]?_['map'](_0x55c021[_0x16d1('0x17')][_0x16d1('0x1b')],function(_0x2b9126){return{'model':db[_0x2b9126[_0x16d1('0x1c')]],'as':_0x2b9126['as'],'attributes':_0x2b9126[_0x16d1('0x18')],'include':_0x2b9126[_0x16d1('0x1b')]?_['map'](_0x2b9126['include'],function(_0x58d72d){return{'model':db[_0x58d72d[_0x16d1('0x1c')]],'as':_0x58d72d['as'],'attributes':_0x58d72d[_0x16d1('0x18')],'include':_0x58d72d[_0x16d1('0x1b')]?_[_0x16d1('0x1a')](_0x58d72d['include'],function(_0x885454){return{'model':db[_0x885454[_0x16d1('0x1c')]],'as':_0x885454['as'],'attributes':_0x885454['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x508ed7){logger[_0x16d1('0xb')](_0x16d1('0x1e'),_0x55c021);logger[_0x16d1('0xd')]('ShowFreshsalesAccount',_0x55c021,JSON[_0x16d1('0x10')](_0x508ed7));_0x2f16ee(_0x508ed7);})[_0x16d1('0x14')](function(_0x2928ad){logger[_0x16d1('0x11')](_0x16d1('0x1e'),_0x2928ad[_0x16d1('0x13')],_0x55c021);_0x4ab3d4(_0x4b27f6[_0x16d1('0x11')](0x1f4,_0x2928ad['message']));});});};
\ No newline at end of file
+var _0x2a07=['GetFreshsalesAccount','debug','ShowFreshsalesAccount','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','FreshsalesAccount','findAll','options','where','limit','include','map','model','attributes'];(function(_0x378952,_0x3ca0a0){var _0x5c4582=function(_0x147826){while(--_0x147826){_0x378952['push'](_0x378952['shift']());}};_0x5c4582(++_0x3ca0a0);}(_0x2a07,0x74));var _0x72a0=function(_0x5a2299,_0x3e2922){_0x5a2299=_0x5a2299-0x0;var _0xedff0f=_0x2a07[_0x5a2299];return _0xedff0f;};'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')]('FreshsalesAccount,\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['GetFreshsalesAccount']=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')]('GetFreshsalesAccount',_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
index a8af8d4..aa3e386 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c12=['show','/:id/subjects','getSubjects','/:id/descriptions','/:id/fields','getFields','post','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id'];(function(_0x129267,_0x2057f8){var _0x5e1204=function(_0x22f676){while(--_0x22f676){_0x129267['push'](_0x129267['shift']());}};_0x5e1204(++_0x2057f8);}(_0x1c12,0x136));var _0x21c1=function(_0x631ef6,_0x149aa9){_0x631ef6=_0x631ef6-0x0;var _0x41af6=_0x1c12[_0x631ef6];return _0x41af6;};'use strict';var multer=require(_0x21c1('0x0'));var util=require(_0x21c1('0x1'));var path=require(_0x21c1('0x2'));var timeout=require(_0x21c1('0x3'));var express=require('express');var router=express[_0x21c1('0x4')]();var fs_extra=require(_0x21c1('0x5'));var auth=require(_0x21c1('0x6'));var interaction=require(_0x21c1('0x7'));var config=require('../../config/environment');var controller=require('./intFreshsalesConfiguration.controller');router[_0x21c1('0x8')]('/',auth[_0x21c1('0x9')](),controller[_0x21c1('0xa')]);router['get'](_0x21c1('0xb'),auth[_0x21c1('0x9')](),controller[_0x21c1('0xc')]);router['get'](_0x21c1('0xd'),auth[_0x21c1('0x9')](),controller[_0x21c1('0xe')]);router[_0x21c1('0x8')](_0x21c1('0xf'),auth[_0x21c1('0x9')](),controller['getDescriptions']);router[_0x21c1('0x8')](_0x21c1('0x10'),auth['isAuthenticated'](),controller[_0x21c1('0x11')]);router[_0x21c1('0x12')]('/',auth[_0x21c1('0x9')](),controller['create']);router['put'](_0x21c1('0xb'),auth[_0x21c1('0x9')](),controller[_0x21c1('0x13')]);router[_0x21c1('0x14')](_0x21c1('0xb'),auth[_0x21c1('0x9')](),controller[_0x21c1('0x15')]);module[_0x21c1('0x16')]=router;
\ No newline at end of file
+var _0x4d9f=['./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id/subjects','getSubjects','/:id/descriptions','/:id/fields','getFields','post','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment'];(function(_0x24485f,_0x104f12){var _0x4a91f9=function(_0x9ec45f){while(--_0x9ec45f){_0x24485f['push'](_0x24485f['shift']());}};_0x4a91f9(++_0x104f12);}(_0x4d9f,0x143));var _0xf4d9=function(_0x4dde1d,_0x2f0f7e){_0x4dde1d=_0x4dde1d-0x0;var _0x440160=_0x4d9f[_0x4dde1d];return _0x440160;};'use strict';var multer=require(_0xf4d9('0x0'));var util=require(_0xf4d9('0x1'));var path=require(_0xf4d9('0x2'));var timeout=require(_0xf4d9('0x3'));var express=require(_0xf4d9('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf4d9('0x5'));var config=require(_0xf4d9('0x6'));var controller=require(_0xf4d9('0x7'));router[_0xf4d9('0x8')]('/',auth[_0xf4d9('0x9')](),controller[_0xf4d9('0xa')]);router[_0xf4d9('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xf4d9('0x8')](_0xf4d9('0xb'),auth[_0xf4d9('0x9')](),controller[_0xf4d9('0xc')]);router[_0xf4d9('0x8')](_0xf4d9('0xd'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xf4d9('0x8')](_0xf4d9('0xe'),auth[_0xf4d9('0x9')](),controller[_0xf4d9('0xf')]);router[_0xf4d9('0x10')]('/',auth[_0xf4d9('0x9')](),controller['create']);router[_0xf4d9('0x11')](_0xf4d9('0x12'),auth['isAuthenticated'](),controller['update']);router[_0xf4d9('0x13')](_0xf4d9('0x12'),auth['isAuthenticated'](),controller[_0xf4d9('0x14')]);module[_0xf4d9('0x15')]=router;
\ No newline at end of file
index 59d9fef..93a843c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e31=['STRING','sequelize','exports'];(function(_0xba53e9,_0x4087cd){var _0x4cca2b=function(_0x31ea86){while(--_0x31ea86){_0xba53e9['push'](_0xba53e9['shift']());}};_0x4cca2b(++_0x4087cd);}(_0x9e31,0x6a));var _0x19e3=function(_0x20e5ab,_0x409b9a){_0x20e5ab=_0x20e5ab-0x0;var _0x2361f1=_0x9e31[_0x20e5ab];return _0x2361f1;};'use strict';var Sequelize=require(_0x19e3('0x0'));module[_0x19e3('0x1')]={'name':{'type':Sequelize[_0x19e3('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xe98a=['STRING','sequelize','exports'];(function(_0x1f17a4,_0x14835f){var _0x25c52a=function(_0x3205c9){while(--_0x3205c9){_0x1f17a4['push'](_0x1f17a4['shift']());}};_0x25c52a(++_0x14835f);}(_0xe98a,0x124));var _0xae98=function(_0x4b784d,_0x5efb2f){_0x4b784d=_0x4b784d-0x0;var _0x2cdeaf=_0xe98a[_0x4b784d];return _0x2cdeaf;};'use strict';var Sequelize=require(_0xae98('0x0'));module[_0xae98('0x1')]={'name':{'type':Sequelize[_0xae98('0x2')]},'description':{'type':Sequelize[_0xae98('0x2')]}};
\ No newline at end of file
index 70f68c7..d8d922c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa834=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','FreshsalesConfiguration','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','create','body','find','findOne','FreshsalesField','order','getSubjects','hasOwnProperty','getDescriptions','getFields','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x4f608e,_0x1bc59c){var _0x4c90d7=function(_0x3ce3d0){while(--_0x3ce3d0){_0x4f608e['push'](_0x4f608e['shift']());}};_0x4c90d7(++_0x1bc59c);}(_0xa834,0x18a));var _0x4a83=function(_0x4eb3b2,_0x21261f){_0x4eb3b2=_0x4eb3b2-0x0;var _0x4db257=_0xa834[_0x4eb3b2];return _0x4db257;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4a83('0x0'));var zipdir=require(_0x4a83('0x1'));var jsonpatch=require(_0x4a83('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4a83('0x3'));var Mustache=require(_0x4a83('0x4'));var util=require('util');var path=require(_0x4a83('0x5'));var sox=require(_0x4a83('0x6'));var csv=require(_0x4a83('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4a83('0x8'));var _=require('lodash');var squel=require(_0x4a83('0x9'));var crypto=require(_0x4a83('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4a83('0xb'));var toCsv=require(_0x4a83('0x7'));var querystring=require('querystring');var Papa=require(_0x4a83('0xc'));var Redis=require(_0x4a83('0xd'));var authService=require(_0x4a83('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x4a83('0xf'));var hardwareService=require(_0x4a83('0x10'));var logger=require(_0x4a83('0x11'))(_0x4a83('0x12'));var utils=require(_0x4a83('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x4a83('0x14'));var db=require(_0x4a83('0x15'))['db'];function respondWithStatusCode(_0x21ba6f,_0xe5fa18){_0xe5fa18=_0xe5fa18||0xcc;return function(_0x4c24e1){if(_0x4c24e1){return _0x21ba6f['sendStatus'](_0xe5fa18);}return _0x21ba6f[_0x4a83('0x16')](_0xe5fa18)[_0x4a83('0x17')]();};}function respondWithResult(_0x5438d0,_0x3c0c4e){_0x3c0c4e=_0x3c0c4e||0xc8;return function(_0x24dead){if(_0x24dead){return _0x5438d0['status'](_0x3c0c4e)['json'](_0x24dead);}};}function respondWithFilteredResult(_0x27892e,_0x234d75){return function(_0x4dfb50){if(_0x4dfb50){var _0x4c822f=typeof _0x234d75[_0x4a83('0x18')]===_0x4a83('0x19')&&typeof _0x234d75[_0x4a83('0x1a')]==='undefined';var _0x2a0b09=_0x4dfb50['count'];var _0x4dcd36=_0x4c822f?0x0:_0x234d75[_0x4a83('0x18')];var _0x3920ab=_0x4c822f?_0x4dfb50[_0x4a83('0x1b')]:_0x234d75[_0x4a83('0x18')]+_0x234d75[_0x4a83('0x1a')];var _0x3b71d1;if(_0x3920ab>=_0x2a0b09){_0x3920ab=_0x2a0b09;_0x3b71d1=0xc8;}else{_0x3b71d1=0xce;}_0x27892e[_0x4a83('0x16')](_0x3b71d1);return _0x27892e[_0x4a83('0x1c')](_0x4a83('0x1d'),_0x4dcd36+'-'+_0x3920ab+'/'+_0x2a0b09)[_0x4a83('0x1e')](_0x4dfb50);}return null;};}function patchUpdates(_0x417fe1){return function(_0x17d85f){try{jsonpatch[_0x4a83('0x1f')](_0x17d85f,_0x417fe1,!![]);}catch(_0x4dfc40){return BPromise[_0x4a83('0x20')](_0x4dfc40);}return _0x17d85f[_0x4a83('0x21')]();};}function saveUpdates(_0x172a41,_0x2a54b3){return function(_0x40e8ad){if(_0x40e8ad){return _0x40e8ad[_0x4a83('0x22')](_0x172a41)[_0x4a83('0x23')](function(_0xbb2981){return _0xbb2981;});}return null;};}function removeEntity(_0x41ee6c,_0x5ce038){return function(_0x18fccf){if(_0x18fccf){return _0x18fccf[_0x4a83('0x24')]()[_0x4a83('0x23')](function(){_0x41ee6c[_0x4a83('0x16')](0xcc)[_0x4a83('0x17')]();});}};}function handleEntityNotFound(_0x5d1e92,_0x187a65){return function(_0x1118c6){if(!_0x1118c6){_0x5d1e92[_0x4a83('0x25')](0x194);}return _0x1118c6;};}function handleError(_0x56253f,_0x54d48a){_0x54d48a=_0x54d48a||0x1f4;return function(_0x59585b){logger[_0x4a83('0x26')](_0x59585b[_0x4a83('0x27')]);if(_0x59585b[_0x4a83('0x28')]){delete _0x59585b[_0x4a83('0x28')];}_0x56253f['status'](_0x54d48a)[_0x4a83('0x29')](_0x59585b);};}exports[_0x4a83('0x2a')]=function(_0x458823,_0x588da4){var _0x23aa0f={},_0x386c38={},_0x4d0401={'count':0x0,'rows':[]};var _0x41ee38=_[_0x4a83('0x2b')](db[_0x4a83('0x2c')]['rawAttributes'],function(_0x2e10f0){return{'name':_0x2e10f0[_0x4a83('0x2d')],'type':_0x2e10f0['type'][_0x4a83('0x2e')]};});_0x386c38['model']=_[_0x4a83('0x2b')](_0x41ee38,_0x4a83('0x28'));_0x386c38[_0x4a83('0x2f')]=_[_0x4a83('0x30')](_0x458823[_0x4a83('0x2f')]);_0x386c38[_0x4a83('0x31')]=_[_0x4a83('0x32')](_0x386c38[_0x4a83('0x33')],_0x386c38['query']);_0x23aa0f['attributes']=_[_0x4a83('0x32')](_0x386c38['model'],qs[_0x4a83('0x34')](_0x458823[_0x4a83('0x2f')][_0x4a83('0x34')]));_0x23aa0f['attributes']=_0x23aa0f[_0x4a83('0x35')][_0x4a83('0x36')]?_0x23aa0f[_0x4a83('0x35')]:_0x386c38[_0x4a83('0x33')];if(!_0x458823[_0x4a83('0x2f')]['hasOwnProperty'](_0x4a83('0x37'))){_0x23aa0f[_0x4a83('0x1a')]=qs[_0x4a83('0x1a')](_0x458823[_0x4a83('0x2f')]['limit']);_0x23aa0f[_0x4a83('0x18')]=qs[_0x4a83('0x18')](_0x458823['query'][_0x4a83('0x18')]);}_0x23aa0f['order']=qs[_0x4a83('0x38')](_0x458823[_0x4a83('0x2f')][_0x4a83('0x38')]);_0x23aa0f[_0x4a83('0x39')]=qs[_0x4a83('0x31')](_[_0x4a83('0x3a')](_0x458823[_0x4a83('0x2f')],_0x386c38[_0x4a83('0x31')]),_0x41ee38);if(_0x458823[_0x4a83('0x2f')][_0x4a83('0x3b')]){_0x23aa0f['where']=_[_0x4a83('0x3c')](_0x23aa0f[_0x4a83('0x39')],{'$or':_[_0x4a83('0x2b')](_0x41ee38,function(_0x14ae21){if(_0x14ae21[_0x4a83('0x3d')]!==_0x4a83('0x3e')){var _0x5082c2={};_0x5082c2[_0x14ae21[_0x4a83('0x28')]]={'$like':'%'+_0x458823['query'][_0x4a83('0x3b')]+'%'};return _0x5082c2;}})});}_0x23aa0f=_[_0x4a83('0x3c')]({},_0x23aa0f,_0x458823[_0x4a83('0x3f')]);var _0x39b988={'where':_0x23aa0f[_0x4a83('0x39')]};return db[_0x4a83('0x2c')][_0x4a83('0x1b')](_0x39b988)['then'](function(_0x2c35c6){_0x4d0401[_0x4a83('0x1b')]=_0x2c35c6;if(_0x458823[_0x4a83('0x2f')][_0x4a83('0x40')]){_0x23aa0f['include']=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0x4a83('0x41')](_0x23aa0f);})['then'](function(_0x238446){_0x4d0401[_0x4a83('0x42')]=_0x238446;return _0x4d0401;})[_0x4a83('0x23')](respondWithFilteredResult(_0x588da4,_0x23aa0f))[_0x4a83('0x43')](handleError(_0x588da4,null));};exports[_0x4a83('0x44')]=function(_0x48aed7,_0x35ea17){var _0x3a3b0d={'raw':![],'where':{'id':_0x48aed7[_0x4a83('0x45')]['id']}},_0x49c851={};_0x49c851['model']=_[_0x4a83('0x30')](db[_0x4a83('0x2c')][_0x4a83('0x46')]);_0x49c851['query']=_[_0x4a83('0x30')](_0x48aed7[_0x4a83('0x2f')]);_0x49c851['filters']=_['intersection'](_0x49c851[_0x4a83('0x33')],_0x49c851[_0x4a83('0x2f')]);_0x3a3b0d['attributes']=_[_0x4a83('0x32')](_0x49c851['model'],qs[_0x4a83('0x34')](_0x48aed7[_0x4a83('0x2f')][_0x4a83('0x34')]));_0x3a3b0d[_0x4a83('0x35')]=_0x3a3b0d[_0x4a83('0x35')]['length']?_0x3a3b0d[_0x4a83('0x35')]:_0x49c851[_0x4a83('0x33')];if(_0x48aed7[_0x4a83('0x2f')][_0x4a83('0x40')]){_0x3a3b0d[_0x4a83('0x47')]=[{'all':!![]}];}_0x3a3b0d=_[_0x4a83('0x3c')]({},_0x3a3b0d,_0x48aed7[_0x4a83('0x3f')]);return db[_0x4a83('0x2c')]['find'](_0x3a3b0d)[_0x4a83('0x23')](handleEntityNotFound(_0x35ea17,null))[_0x4a83('0x23')](respondWithResult(_0x35ea17,null))['catch'](handleError(_0x35ea17,null));};exports[_0x4a83('0x48')]=function(_0x94ad5d,_0x3e9927){return db[_0x4a83('0x2c')][_0x4a83('0x48')](_0x94ad5d[_0x4a83('0x49')],{})[_0x4a83('0x23')](respondWithResult(_0x3e9927,0xc9))[_0x4a83('0x43')](handleError(_0x3e9927,null));};exports[_0x4a83('0x22')]=function(_0x365340,_0x184d0e){if(_0x365340[_0x4a83('0x49')]['id']){delete _0x365340['body']['id'];}return db[_0x4a83('0x2c')][_0x4a83('0x4a')]({'where':{'id':_0x365340[_0x4a83('0x45')]['id']}})[_0x4a83('0x23')](handleEntityNotFound(_0x184d0e,null))[_0x4a83('0x23')](saveUpdates(_0x365340[_0x4a83('0x49')],null))[_0x4a83('0x23')](respondWithResult(_0x184d0e,null))[_0x4a83('0x43')](handleError(_0x184d0e,null));};exports['destroy']=function(_0x3f814f,_0x2e25b9){return db['FreshsalesConfiguration']['find']({'where':{'id':_0x3f814f[_0x4a83('0x45')]['id']}})[_0x4a83('0x23')](handleEntityNotFound(_0x2e25b9,null))[_0x4a83('0x23')](removeEntity(_0x2e25b9,null))['catch'](handleError(_0x2e25b9,null));};exports['getSubjects']=function(_0x18438f,_0x492c77,_0x5b18f3){var _0x3533e7={};var _0x4ded0e={};var _0xa78e78;var _0xf7853d;return db[_0x4a83('0x2c')][_0x4a83('0x4b')]({'where':{'id':_0x18438f[_0x4a83('0x45')]['id']}})['then'](handleEntityNotFound(_0x492c77,null))[_0x4a83('0x23')](function(_0x21fc63){if(_0x21fc63){_0xa78e78=_0x21fc63;_0x4ded0e[_0x4a83('0x33')]=_[_0x4a83('0x30')](db[_0x4a83('0x4c')][_0x4a83('0x46')]);_0x4ded0e['query']=_[_0x4a83('0x30')](_0x18438f['query']);_0x4ded0e[_0x4a83('0x31')]=_[_0x4a83('0x32')](_0x4ded0e[_0x4a83('0x33')],_0x4ded0e[_0x4a83('0x2f')]);_0x3533e7[_0x4a83('0x35')]=_['intersection'](_0x4ded0e[_0x4a83('0x33')],qs[_0x4a83('0x34')](_0x18438f[_0x4a83('0x2f')][_0x4a83('0x34')]));_0x3533e7[_0x4a83('0x35')]=_0x3533e7[_0x4a83('0x35')][_0x4a83('0x36')]?_0x3533e7[_0x4a83('0x35')]:_0x4ded0e['model'];_0x3533e7[_0x4a83('0x4d')]=qs['sort'](_0x18438f[_0x4a83('0x2f')][_0x4a83('0x38')]);_0x3533e7[_0x4a83('0x39')]=qs[_0x4a83('0x31')](_[_0x4a83('0x3a')](_0x18438f[_0x4a83('0x2f')],_0x4ded0e['filters']));if(_0x18438f[_0x4a83('0x2f')][_0x4a83('0x3b')]){_0x3533e7[_0x4a83('0x39')]=_['merge'](_0x3533e7[_0x4a83('0x39')],{'$or':_['map'](_0x3533e7['attributes'],function(_0x10779f){var _0xba674c={};_0xba674c[_0x10779f]={'$like':'%'+_0x18438f['query'][_0x4a83('0x3b')]+'%'};return _0xba674c;})});}_0x3533e7=_['merge']({},_0x3533e7,_0x18438f[_0x4a83('0x3f')]);return _0xa78e78[_0x4a83('0x4e')](_0x3533e7);}})['then'](function(_0x53d811){if(_0x53d811){_0xf7853d=_0x53d811[_0x4a83('0x36')];if(!_0x18438f[_0x4a83('0x2f')][_0x4a83('0x4f')]('nolimit')){_0x3533e7[_0x4a83('0x1a')]=qs[_0x4a83('0x1a')](_0x18438f[_0x4a83('0x2f')]['limit']);_0x3533e7['offset']=qs[_0x4a83('0x18')](_0x18438f['query'][_0x4a83('0x18')]);}return _0xa78e78['getSubjects'](_0x3533e7);}})['then'](function(_0x13eed5){if(_0x13eed5){return _0x13eed5?{'count':_0xf7853d,'rows':_0x13eed5}:null;}})[_0x4a83('0x23')](respondWithResult(_0x492c77,null))[_0x4a83('0x43')](handleError(_0x492c77,null));};exports[_0x4a83('0x50')]=function(_0xc31397,_0xd0b4e3,_0x324d8b){var _0xf34909={};var _0x56ac2d={};var _0x52de90;var _0x4ab260;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0xc31397[_0x4a83('0x45')]['id']}})['then'](handleEntityNotFound(_0xd0b4e3,null))[_0x4a83('0x23')](function(_0x27de9d){if(_0x27de9d){_0x52de90=_0x27de9d;_0x56ac2d['model']=_['keys'](db['FreshsalesField'][_0x4a83('0x46')]);_0x56ac2d[_0x4a83('0x2f')]=_[_0x4a83('0x30')](_0xc31397[_0x4a83('0x2f')]);_0x56ac2d[_0x4a83('0x31')]=_[_0x4a83('0x32')](_0x56ac2d[_0x4a83('0x33')],_0x56ac2d['query']);_0xf34909[_0x4a83('0x35')]=_[_0x4a83('0x32')](_0x56ac2d[_0x4a83('0x33')],qs[_0x4a83('0x34')](_0xc31397['query'][_0x4a83('0x34')]));_0xf34909[_0x4a83('0x35')]=_0xf34909['attributes'][_0x4a83('0x36')]?_0xf34909[_0x4a83('0x35')]:_0x56ac2d[_0x4a83('0x33')];_0xf34909[_0x4a83('0x4d')]=qs['sort'](_0xc31397[_0x4a83('0x2f')]['sort']);_0xf34909[_0x4a83('0x39')]=qs[_0x4a83('0x31')](_[_0x4a83('0x3a')](_0xc31397[_0x4a83('0x2f')],_0x56ac2d[_0x4a83('0x31')]));if(_0xc31397['query'][_0x4a83('0x3b')]){_0xf34909[_0x4a83('0x39')]=_['merge'](_0xf34909[_0x4a83('0x39')],{'$or':_['map'](_0xf34909[_0x4a83('0x35')],function(_0xf41617){var _0x5118e4={};_0x5118e4[_0xf41617]={'$like':'%'+_0xc31397[_0x4a83('0x2f')][_0x4a83('0x3b')]+'%'};return _0x5118e4;})});}_0xf34909=_['merge']({},_0xf34909,_0xc31397['options']);return _0x52de90[_0x4a83('0x50')](_0xf34909);}})[_0x4a83('0x23')](function(_0x190154){if(_0x190154){_0x4ab260=_0x190154['length'];if(!_0xc31397['query'][_0x4a83('0x4f')]('nolimit')){_0xf34909[_0x4a83('0x1a')]=qs['limit'](_0xc31397[_0x4a83('0x2f')][_0x4a83('0x1a')]);_0xf34909[_0x4a83('0x18')]=qs[_0x4a83('0x18')](_0xc31397[_0x4a83('0x2f')][_0x4a83('0x18')]);}return _0x52de90[_0x4a83('0x50')](_0xf34909);}})[_0x4a83('0x23')](function(_0x2b8336){if(_0x2b8336){return _0x2b8336?{'count':_0x4ab260,'rows':_0x2b8336}:null;}})[_0x4a83('0x23')](respondWithResult(_0xd0b4e3,null))[_0x4a83('0x43')](handleError(_0xd0b4e3,null));};exports[_0x4a83('0x51')]=function(_0x3f8aeb,_0x36575b,_0x50d24a){var _0x45ea01={};var _0x3b9c7c={};var _0x49fc96;var _0x4c0a0e;return db[_0x4a83('0x2c')][_0x4a83('0x4b')]({'where':{'id':_0x3f8aeb[_0x4a83('0x45')]['id']}})['then'](handleEntityNotFound(_0x36575b,null))[_0x4a83('0x23')](function(_0x2086d1){if(_0x2086d1){_0x49fc96=_0x2086d1;_0x3b9c7c['model']=_[_0x4a83('0x30')](db[_0x4a83('0x4c')][_0x4a83('0x46')]);_0x3b9c7c[_0x4a83('0x2f')]=_[_0x4a83('0x30')](_0x3f8aeb['query']);_0x3b9c7c[_0x4a83('0x31')]=_[_0x4a83('0x32')](_0x3b9c7c[_0x4a83('0x33')],_0x3b9c7c[_0x4a83('0x2f')]);_0x45ea01[_0x4a83('0x35')]=_[_0x4a83('0x32')](_0x3b9c7c[_0x4a83('0x33')],qs[_0x4a83('0x34')](_0x3f8aeb[_0x4a83('0x2f')][_0x4a83('0x34')]));_0x45ea01['attributes']=_0x45ea01[_0x4a83('0x35')][_0x4a83('0x36')]?_0x45ea01['attributes']:_0x3b9c7c['model'];_0x45ea01[_0x4a83('0x4d')]=qs['sort'](_0x3f8aeb[_0x4a83('0x2f')]['sort']);_0x45ea01[_0x4a83('0x39')]=qs[_0x4a83('0x31')](_['pick'](_0x3f8aeb[_0x4a83('0x2f')],_0x3b9c7c[_0x4a83('0x31')]));if(_0x3f8aeb[_0x4a83('0x2f')][_0x4a83('0x3b')]){_0x45ea01[_0x4a83('0x39')]=_[_0x4a83('0x3c')](_0x45ea01[_0x4a83('0x39')],{'$or':_[_0x4a83('0x2b')](_0x45ea01[_0x4a83('0x35')],function(_0x38873d){var _0x5d0971={};_0x5d0971[_0x38873d]={'$like':'%'+_0x3f8aeb[_0x4a83('0x2f')]['filter']+'%'};return _0x5d0971;})});}_0x45ea01=_[_0x4a83('0x3c')]({},_0x45ea01,_0x3f8aeb[_0x4a83('0x3f')]);return _0x49fc96[_0x4a83('0x51')](_0x45ea01);}})[_0x4a83('0x23')](function(_0x928149){if(_0x928149){_0x4c0a0e=_0x928149[_0x4a83('0x36')];if(!_0x3f8aeb[_0x4a83('0x2f')][_0x4a83('0x4f')](_0x4a83('0x37'))){_0x45ea01[_0x4a83('0x1a')]=qs[_0x4a83('0x1a')](_0x3f8aeb[_0x4a83('0x2f')][_0x4a83('0x1a')]);_0x45ea01[_0x4a83('0x18')]=qs[_0x4a83('0x18')](_0x3f8aeb[_0x4a83('0x2f')]['offset']);}return _0x49fc96['getFields'](_0x45ea01);}})[_0x4a83('0x23')](function(_0x4cd2d8){if(_0x4cd2d8){return _0x4cd2d8?{'count':_0x4c0a0e,'rows':_0x4cd2d8}:null;}})[_0x4a83('0x23')](respondWithResult(_0x36575b,null))['catch'](handleError(_0x36575b,null));};
\ No newline at end of file
+var _0x7f89=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','update','then','destroy','error','stack','name','send','index','FreshsalesConfiguration','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','filter','merge','where','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','body','getSubjects','findOne','FreshsalesField','pick','hasOwnProperty','getDescriptions','getFields','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto'];(function(_0x31075b,_0x3c5b46){var _0x3c6588=function(_0x1ec6ef){while(--_0x1ec6ef){_0x31075b['push'](_0x31075b['shift']());}};_0x3c6588(++_0x3c5b46);}(_0x7f89,0x1c6));var _0x97f8=function(_0x565c4e,_0x1e77f9){_0x565c4e=_0x565c4e-0x0;var _0x4a167f=_0x7f89[_0x565c4e];return _0x4a167f;};'use strict';var emlformat=require(_0x97f8('0x0'));var rimraf=require(_0x97f8('0x1'));var zipdir=require(_0x97f8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x97f8('0x3'));var moment=require(_0x97f8('0x4'));var BPromise=require(_0x97f8('0x5'));var Mustache=require(_0x97f8('0x6'));var util=require('util');var path=require(_0x97f8('0x7'));var sox=require(_0x97f8('0x8'));var csv=require(_0x97f8('0x9'));var ejs=require(_0x97f8('0xa'));var fs=require('fs');var fs_extra=require(_0x97f8('0xb'));var _=require(_0x97f8('0xc'));var squel=require('squel');var crypto=require(_0x97f8('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x97f8('0x9'));var querystring=require(_0x97f8('0xe'));var Papa=require(_0x97f8('0xf'));var Redis=require(_0x97f8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x97f8('0x11'));var as=require(_0x97f8('0x12'));var hardwareService=require(_0x97f8('0x13'));var logger=require(_0x97f8('0x14'))('api');var utils=require(_0x97f8('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x97f8('0x16'));var db=require(_0x97f8('0x17'))['db'];function respondWithStatusCode(_0x5ae6b4,_0x4485c1){_0x4485c1=_0x4485c1||0xcc;return function(_0x4a1471){if(_0x4a1471){return _0x5ae6b4[_0x97f8('0x18')](_0x4485c1);}return _0x5ae6b4[_0x97f8('0x19')](_0x4485c1)[_0x97f8('0x1a')]();};}function respondWithResult(_0x3908aa,_0x573c0c){_0x573c0c=_0x573c0c||0xc8;return function(_0x23f5da){if(_0x23f5da){return _0x3908aa[_0x97f8('0x19')](_0x573c0c)[_0x97f8('0x1b')](_0x23f5da);}};}function respondWithFilteredResult(_0x470405,_0x32a6a8){return function(_0x4d8d36){if(_0x4d8d36){var _0x10b9bb=typeof _0x32a6a8[_0x97f8('0x1c')]===_0x97f8('0x1d')&&typeof _0x32a6a8[_0x97f8('0x1e')]===_0x97f8('0x1d');var _0x3c7615=_0x4d8d36[_0x97f8('0x1f')];var _0x3a026f=_0x10b9bb?0x0:_0x32a6a8[_0x97f8('0x1c')];var _0x3a24f0=_0x10b9bb?_0x4d8d36['count']:_0x32a6a8[_0x97f8('0x1c')]+_0x32a6a8[_0x97f8('0x1e')];var _0x2fce38;if(_0x3a24f0>=_0x3c7615){_0x3a24f0=_0x3c7615;_0x2fce38=0xc8;}else{_0x2fce38=0xce;}_0x470405['status'](_0x2fce38);return _0x470405['set']('Content-Range',_0x3a026f+'-'+_0x3a24f0+'/'+_0x3c7615)['json'](_0x4d8d36);}return null;};}function patchUpdates(_0x3e9b52){return function(_0xc2dcae){try{jsonpatch['apply'](_0xc2dcae,_0x3e9b52,!![]);}catch(_0x34133b){return BPromise[_0x97f8('0x20')](_0x34133b);}return _0xc2dcae[_0x97f8('0x21')]();};}function saveUpdates(_0x188ffc,_0x9be161){return function(_0x2371d6){if(_0x2371d6){return _0x2371d6[_0x97f8('0x22')](_0x188ffc)[_0x97f8('0x23')](function(_0xec94cb){return _0xec94cb;});}return null;};}function removeEntity(_0x1fb03e,_0x469834){return function(_0x1c7a09){if(_0x1c7a09){return _0x1c7a09[_0x97f8('0x24')]()[_0x97f8('0x23')](function(){_0x1fb03e[_0x97f8('0x19')](0xcc)[_0x97f8('0x1a')]();});}};}function handleEntityNotFound(_0x4bcca1,_0x4ca1cc){return function(_0x3ea9ad){if(!_0x3ea9ad){_0x4bcca1[_0x97f8('0x18')](0x194);}return _0x3ea9ad;};}function handleError(_0x15e21c,_0x1a4b8f){_0x1a4b8f=_0x1a4b8f||0x1f4;return function(_0x8d7d66){logger[_0x97f8('0x25')](_0x8d7d66[_0x97f8('0x26')]);if(_0x8d7d66['name']){delete _0x8d7d66[_0x97f8('0x27')];}_0x15e21c[_0x97f8('0x19')](_0x1a4b8f)[_0x97f8('0x28')](_0x8d7d66);};}exports[_0x97f8('0x29')]=function(_0x1f84f5,_0x3a92c7){var _0x522d54={},_0x140747={},_0x366875={'count':0x0,'rows':[]};var _0x1552bd=_['map'](db[_0x97f8('0x2a')][_0x97f8('0x2b')],function(_0x5d0461){return{'name':_0x5d0461['fieldName'],'type':_0x5d0461[_0x97f8('0x2c')][_0x97f8('0x2d')]};});_0x140747['model']=_['map'](_0x1552bd,_0x97f8('0x27'));_0x140747[_0x97f8('0x2e')]=_[_0x97f8('0x2f')](_0x1f84f5[_0x97f8('0x2e')]);_0x140747[_0x97f8('0x30')]=_[_0x97f8('0x31')](_0x140747[_0x97f8('0x32')],_0x140747['query']);_0x522d54[_0x97f8('0x33')]=_[_0x97f8('0x31')](_0x140747[_0x97f8('0x32')],qs[_0x97f8('0x34')](_0x1f84f5[_0x97f8('0x2e')][_0x97f8('0x34')]));_0x522d54[_0x97f8('0x33')]=_0x522d54[_0x97f8('0x33')][_0x97f8('0x35')]?_0x522d54[_0x97f8('0x33')]:_0x140747[_0x97f8('0x32')];if(!_0x1f84f5[_0x97f8('0x2e')]['hasOwnProperty'](_0x97f8('0x36'))){_0x522d54[_0x97f8('0x1e')]=qs[_0x97f8('0x1e')](_0x1f84f5[_0x97f8('0x2e')][_0x97f8('0x1e')]);_0x522d54[_0x97f8('0x1c')]=qs[_0x97f8('0x1c')](_0x1f84f5[_0x97f8('0x2e')][_0x97f8('0x1c')]);}_0x522d54[_0x97f8('0x37')]=qs[_0x97f8('0x38')](_0x1f84f5[_0x97f8('0x2e')][_0x97f8('0x38')]);_0x522d54['where']=qs[_0x97f8('0x30')](_['pick'](_0x1f84f5[_0x97f8('0x2e')],_0x140747[_0x97f8('0x30')]),_0x1552bd);if(_0x1f84f5[_0x97f8('0x2e')][_0x97f8('0x39')]){_0x522d54['where']=_[_0x97f8('0x3a')](_0x522d54[_0x97f8('0x3b')],{'$or':_[_0x97f8('0x3c')](_0x1552bd,function(_0x24735e){if(_0x24735e[_0x97f8('0x2c')]!==_0x97f8('0x3d')){var _0x5f29dd={};_0x5f29dd[_0x24735e[_0x97f8('0x27')]]={'$like':'%'+_0x1f84f5[_0x97f8('0x2e')]['filter']+'%'};return _0x5f29dd;}})});}_0x522d54=_['merge']({},_0x522d54,_0x1f84f5[_0x97f8('0x3e')]);var _0xad0ed5={'where':_0x522d54['where']};return db[_0x97f8('0x2a')][_0x97f8('0x1f')](_0xad0ed5)[_0x97f8('0x23')](function(_0xdb7f91){_0x366875[_0x97f8('0x1f')]=_0xdb7f91;if(_0x1f84f5[_0x97f8('0x2e')][_0x97f8('0x3f')]){_0x522d54[_0x97f8('0x40')]=[{'all':!![]}];}return db[_0x97f8('0x2a')][_0x97f8('0x41')](_0x522d54);})[_0x97f8('0x23')](function(_0x59c5ac){_0x366875[_0x97f8('0x42')]=_0x59c5ac;return _0x366875;})[_0x97f8('0x23')](respondWithFilteredResult(_0x3a92c7,_0x522d54))[_0x97f8('0x43')](handleError(_0x3a92c7,null));};exports['show']=function(_0x2a5b69,_0x93ffbc){var _0x4e530f={'raw':![],'where':{'id':_0x2a5b69[_0x97f8('0x44')]['id']}},_0x4560cc={};_0x4560cc['model']=_[_0x97f8('0x2f')](db['FreshsalesConfiguration'][_0x97f8('0x2b')]);_0x4560cc[_0x97f8('0x2e')]=_['keys'](_0x2a5b69['query']);_0x4560cc[_0x97f8('0x30')]=_[_0x97f8('0x31')](_0x4560cc[_0x97f8('0x32')],_0x4560cc[_0x97f8('0x2e')]);_0x4e530f['attributes']=_[_0x97f8('0x31')](_0x4560cc[_0x97f8('0x32')],qs['fields'](_0x2a5b69[_0x97f8('0x2e')][_0x97f8('0x34')]));_0x4e530f[_0x97f8('0x33')]=_0x4e530f[_0x97f8('0x33')]['length']?_0x4e530f[_0x97f8('0x33')]:_0x4560cc['model'];if(_0x2a5b69[_0x97f8('0x2e')]['includeAll']){_0x4e530f[_0x97f8('0x40')]=[{'all':!![]}];}_0x4e530f=_['merge']({},_0x4e530f,_0x2a5b69[_0x97f8('0x3e')]);return db['FreshsalesConfiguration'][_0x97f8('0x45')](_0x4e530f)['then'](handleEntityNotFound(_0x93ffbc,null))[_0x97f8('0x23')](respondWithResult(_0x93ffbc,null))[_0x97f8('0x43')](handleError(_0x93ffbc,null));};exports['create']=function(_0xa773fe,_0x14dfe5){return db[_0x97f8('0x2a')]['create'](_0xa773fe[_0x97f8('0x46')],{})[_0x97f8('0x23')](respondWithResult(_0x14dfe5,0xc9))[_0x97f8('0x43')](handleError(_0x14dfe5,null));};exports[_0x97f8('0x22')]=function(_0x20dd5b,_0x3450b4){if(_0x20dd5b[_0x97f8('0x46')]['id']){delete _0x20dd5b[_0x97f8('0x46')]['id'];}return db[_0x97f8('0x2a')][_0x97f8('0x45')]({'where':{'id':_0x20dd5b[_0x97f8('0x44')]['id']}})[_0x97f8('0x23')](handleEntityNotFound(_0x3450b4,null))[_0x97f8('0x23')](saveUpdates(_0x20dd5b[_0x97f8('0x46')],null))['then'](respondWithResult(_0x3450b4,null))[_0x97f8('0x43')](handleError(_0x3450b4,null));};exports[_0x97f8('0x24')]=function(_0x15944b,_0x1edc1b){return db[_0x97f8('0x2a')][_0x97f8('0x45')]({'where':{'id':_0x15944b[_0x97f8('0x44')]['id']}})[_0x97f8('0x23')](handleEntityNotFound(_0x1edc1b,null))[_0x97f8('0x23')](removeEntity(_0x1edc1b,null))[_0x97f8('0x43')](handleError(_0x1edc1b,null));};exports[_0x97f8('0x47')]=function(_0x5ed0e9,_0x4f8097,_0x58956b){var _0x3114b2={};var _0x100fc4={};var _0x425830;var _0x54fc96;return db['FreshsalesConfiguration'][_0x97f8('0x48')]({'where':{'id':_0x5ed0e9[_0x97f8('0x44')]['id']}})[_0x97f8('0x23')](handleEntityNotFound(_0x4f8097,null))[_0x97f8('0x23')](function(_0x460a88){if(_0x460a88){_0x425830=_0x460a88;_0x100fc4['model']=_[_0x97f8('0x2f')](db[_0x97f8('0x49')][_0x97f8('0x2b')]);_0x100fc4[_0x97f8('0x2e')]=_[_0x97f8('0x2f')](_0x5ed0e9['query']);_0x100fc4[_0x97f8('0x30')]=_['intersection'](_0x100fc4[_0x97f8('0x32')],_0x100fc4[_0x97f8('0x2e')]);_0x3114b2[_0x97f8('0x33')]=_[_0x97f8('0x31')](_0x100fc4[_0x97f8('0x32')],qs[_0x97f8('0x34')](_0x5ed0e9[_0x97f8('0x2e')]['fields']));_0x3114b2[_0x97f8('0x33')]=_0x3114b2[_0x97f8('0x33')][_0x97f8('0x35')]?_0x3114b2['attributes']:_0x100fc4[_0x97f8('0x32')];_0x3114b2[_0x97f8('0x37')]=qs[_0x97f8('0x38')](_0x5ed0e9[_0x97f8('0x2e')]['sort']);_0x3114b2[_0x97f8('0x3b')]=qs[_0x97f8('0x30')](_[_0x97f8('0x4a')](_0x5ed0e9['query'],_0x100fc4[_0x97f8('0x30')]));if(_0x5ed0e9[_0x97f8('0x2e')][_0x97f8('0x39')]){_0x3114b2[_0x97f8('0x3b')]=_['merge'](_0x3114b2[_0x97f8('0x3b')],{'$or':_['map'](_0x3114b2['attributes'],function(_0x5137a0){var _0x58d911={};_0x58d911[_0x5137a0]={'$like':'%'+_0x5ed0e9['query'][_0x97f8('0x39')]+'%'};return _0x58d911;})});}_0x3114b2=_[_0x97f8('0x3a')]({},_0x3114b2,_0x5ed0e9['options']);return _0x425830['getSubjects'](_0x3114b2);}})[_0x97f8('0x23')](function(_0x431571){if(_0x431571){_0x54fc96=_0x431571[_0x97f8('0x35')];if(!_0x5ed0e9['query'][_0x97f8('0x4b')](_0x97f8('0x36'))){_0x3114b2[_0x97f8('0x1e')]=qs['limit'](_0x5ed0e9[_0x97f8('0x2e')]['limit']);_0x3114b2[_0x97f8('0x1c')]=qs[_0x97f8('0x1c')](_0x5ed0e9[_0x97f8('0x2e')]['offset']);}return _0x425830['getSubjects'](_0x3114b2);}})['then'](function(_0x4244c4){if(_0x4244c4){return _0x4244c4?{'count':_0x54fc96,'rows':_0x4244c4}:null;}})[_0x97f8('0x23')](respondWithResult(_0x4f8097,null))[_0x97f8('0x43')](handleError(_0x4f8097,null));};exports[_0x97f8('0x4c')]=function(_0x52ee1a,_0x14684f,_0x417c08){var _0x296835={};var _0x51ce0f={};var _0x4a2d09;var _0x4bf4f1;return db[_0x97f8('0x2a')][_0x97f8('0x48')]({'where':{'id':_0x52ee1a[_0x97f8('0x44')]['id']}})[_0x97f8('0x23')](handleEntityNotFound(_0x14684f,null))[_0x97f8('0x23')](function(_0xb19a43){if(_0xb19a43){_0x4a2d09=_0xb19a43;_0x51ce0f[_0x97f8('0x32')]=_['keys'](db['FreshsalesField']['rawAttributes']);_0x51ce0f[_0x97f8('0x2e')]=_['keys'](_0x52ee1a['query']);_0x51ce0f[_0x97f8('0x30')]=_[_0x97f8('0x31')](_0x51ce0f[_0x97f8('0x32')],_0x51ce0f[_0x97f8('0x2e')]);_0x296835[_0x97f8('0x33')]=_[_0x97f8('0x31')](_0x51ce0f[_0x97f8('0x32')],qs['fields'](_0x52ee1a[_0x97f8('0x2e')][_0x97f8('0x34')]));_0x296835[_0x97f8('0x33')]=_0x296835[_0x97f8('0x33')][_0x97f8('0x35')]?_0x296835[_0x97f8('0x33')]:_0x51ce0f[_0x97f8('0x32')];_0x296835[_0x97f8('0x37')]=qs['sort'](_0x52ee1a[_0x97f8('0x2e')][_0x97f8('0x38')]);_0x296835['where']=qs[_0x97f8('0x30')](_['pick'](_0x52ee1a[_0x97f8('0x2e')],_0x51ce0f[_0x97f8('0x30')]));if(_0x52ee1a['query'][_0x97f8('0x39')]){_0x296835['where']=_['merge'](_0x296835['where'],{'$or':_['map'](_0x296835[_0x97f8('0x33')],function(_0x5afab2){var _0xaedb63={};_0xaedb63[_0x5afab2]={'$like':'%'+_0x52ee1a[_0x97f8('0x2e')][_0x97f8('0x39')]+'%'};return _0xaedb63;})});}_0x296835=_[_0x97f8('0x3a')]({},_0x296835,_0x52ee1a[_0x97f8('0x3e')]);return _0x4a2d09['getDescriptions'](_0x296835);}})['then'](function(_0x12834){if(_0x12834){_0x4bf4f1=_0x12834[_0x97f8('0x35')];if(!_0x52ee1a['query'][_0x97f8('0x4b')]('nolimit')){_0x296835[_0x97f8('0x1e')]=qs[_0x97f8('0x1e')](_0x52ee1a[_0x97f8('0x2e')][_0x97f8('0x1e')]);_0x296835[_0x97f8('0x1c')]=qs[_0x97f8('0x1c')](_0x52ee1a[_0x97f8('0x2e')]['offset']);}return _0x4a2d09[_0x97f8('0x4c')](_0x296835);}})[_0x97f8('0x23')](function(_0x68036){if(_0x68036){return _0x68036?{'count':_0x4bf4f1,'rows':_0x68036}:null;}})[_0x97f8('0x23')](respondWithResult(_0x14684f,null))['catch'](handleError(_0x14684f,null));};exports[_0x97f8('0x4d')]=function(_0x3cdaf9,_0x430974,_0x318034){var _0x14a769={};var _0x3cb3f9={};var _0x13b209;var _0x13e0e6;return db[_0x97f8('0x2a')]['findOne']({'where':{'id':_0x3cdaf9[_0x97f8('0x44')]['id']}})[_0x97f8('0x23')](handleEntityNotFound(_0x430974,null))['then'](function(_0x5afc16){if(_0x5afc16){_0x13b209=_0x5afc16;_0x3cb3f9['model']=_['keys'](db[_0x97f8('0x49')][_0x97f8('0x2b')]);_0x3cb3f9[_0x97f8('0x2e')]=_['keys'](_0x3cdaf9['query']);_0x3cb3f9[_0x97f8('0x30')]=_['intersection'](_0x3cb3f9[_0x97f8('0x32')],_0x3cb3f9['query']);_0x14a769[_0x97f8('0x33')]=_[_0x97f8('0x31')](_0x3cb3f9[_0x97f8('0x32')],qs[_0x97f8('0x34')](_0x3cdaf9[_0x97f8('0x2e')][_0x97f8('0x34')]));_0x14a769[_0x97f8('0x33')]=_0x14a769[_0x97f8('0x33')][_0x97f8('0x35')]?_0x14a769[_0x97f8('0x33')]:_0x3cb3f9[_0x97f8('0x32')];_0x14a769[_0x97f8('0x37')]=qs[_0x97f8('0x38')](_0x3cdaf9[_0x97f8('0x2e')][_0x97f8('0x38')]);_0x14a769[_0x97f8('0x3b')]=qs['filters'](_[_0x97f8('0x4a')](_0x3cdaf9['query'],_0x3cb3f9[_0x97f8('0x30')]));if(_0x3cdaf9[_0x97f8('0x2e')][_0x97f8('0x39')]){_0x14a769[_0x97f8('0x3b')]=_[_0x97f8('0x3a')](_0x14a769['where'],{'$or':_[_0x97f8('0x3c')](_0x14a769[_0x97f8('0x33')],function(_0x2f42a2){var _0x1ea999={};_0x1ea999[_0x2f42a2]={'$like':'%'+_0x3cdaf9[_0x97f8('0x2e')][_0x97f8('0x39')]+'%'};return _0x1ea999;})});}_0x14a769=_[_0x97f8('0x3a')]({},_0x14a769,_0x3cdaf9[_0x97f8('0x3e')]);return _0x13b209[_0x97f8('0x4d')](_0x14a769);}})[_0x97f8('0x23')](function(_0x4ab8f6){if(_0x4ab8f6){_0x13e0e6=_0x4ab8f6[_0x97f8('0x35')];if(!_0x3cdaf9[_0x97f8('0x2e')][_0x97f8('0x4b')]('nolimit')){_0x14a769[_0x97f8('0x1e')]=qs['limit'](_0x3cdaf9[_0x97f8('0x2e')][_0x97f8('0x1e')]);_0x14a769[_0x97f8('0x1c')]=qs['offset'](_0x3cdaf9[_0x97f8('0x2e')][_0x97f8('0x1c')]);}return _0x13b209['getFields'](_0x14a769);}})[_0x97f8('0x23')](function(_0x44b6a8){if(_0x44b6a8){return _0x44b6a8?{'count':_0x13e0e6,'rows':_0x44b6a8}:null;}})[_0x97f8('0x23')](respondWithResult(_0x430974,null))[_0x97f8('0x43')](handleError(_0x430974,null));};
\ No newline at end of file
index c2fa76e..3eb6148 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe362=['rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1f8a89,_0x578c3f){var _0x26ea18=function(_0x48288a){while(--_0x48288a){_0x1f8a89['push'](_0x1f8a89['shift']());}};_0x26ea18(++_0x578c3f);}(_0xe362,0x13b));var _0x2e36=function(_0x1619cc,_0x34a660){_0x1619cc=_0x1619cc-0x0;var _0x55bda7=_0xe362[_0x1619cc];return _0x55bda7;};'use strict';var _=require(_0x2e36('0x0'));var util=require(_0x2e36('0x1'));var logger=require(_0x2e36('0x2'))(_0x2e36('0x3'));var moment=require(_0x2e36('0x4'));var BPromise=require(_0x2e36('0x5'));var rp=require(_0x2e36('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e36('0x7'));var config=require(_0x2e36('0x8'));var attributes=require(_0x2e36('0x9'));module[_0x2e36('0xa')]=function(_0x554bea,_0x5bab90){return _0x554bea[_0x2e36('0xb')](_0x2e36('0xc'),attributes,{'tableName':_0x2e36('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb411=['exports','define','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes'];(function(_0x1347f8,_0x233feb){var _0x218368=function(_0x3f4ca3){while(--_0x3f4ca3){_0x1347f8['push'](_0x1347f8['shift']());}};_0x218368(++_0x233feb);}(_0xb411,0x12b));var _0x1b41=function(_0x474a6b,_0xdfc9c7){_0x474a6b=_0x474a6b-0x0;var _0xcb77e4=_0xb411[_0x474a6b];return _0xcb77e4;};'use strict';var _=require('lodash');var util=require(_0x1b41('0x0'));var logger=require(_0x1b41('0x1'))(_0x1b41('0x2'));var moment=require('moment');var BPromise=require(_0x1b41('0x3'));var rp=require(_0x1b41('0x4'));var fs=require('fs');var path=require(_0x1b41('0x5'));var rimraf=require(_0x1b41('0x6'));var config=require(_0x1b41('0x7'));var attributes=require(_0x1b41('0x8'));module[_0x1b41('0x9')]=function(_0x521894,_0x590d1d){return _0x521894[_0x1b41('0xa')]('FreshsalesConfiguration',attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a11ccd4..a568a5b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37bf=['../../config/logger','rpc','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x958b43,_0x1dfc07){var _0x213319=function(_0xbeb551){while(--_0xbeb551){_0x958b43['push'](_0x958b43['shift']());}};_0x213319(++_0x1dfc07);}(_0x37bf,0x143));var _0xf37b=function(_0x4e47ed,_0x5753d9){_0x4e47ed=_0x4e47ed-0x0;var _0x277cdf=_0x37bf[_0x4e47ed];return _0x277cdf;};'use strict';var _=require('lodash');var util=require(_0xf37b('0x0'));var moment=require(_0xf37b('0x1'));var BPromise=require(_0xf37b('0x2'));var rs=require(_0xf37b('0x3'));var fs=require('fs');var Redis=require(_0xf37b('0x4'));var db=require(_0xf37b('0x5'))['db'];var utils=require(_0xf37b('0x6'));var logger=require(_0xf37b('0x7'))(_0xf37b('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf37b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x547b57,_0x13e61e,_0x9533c2){return new BPromise(function(_0x167ea6,_0x4843f4){return client[_0xf37b('0xa')](_0x547b57,_0x9533c2)[_0xf37b('0xb')](function(_0x27d1bc){logger[_0xf37b('0xc')](_0xf37b('0xd'),_0x13e61e,'request\x20sent');logger[_0xf37b('0xe')](_0xf37b('0xf'),_0x13e61e,_0xf37b('0x10'),JSON[_0xf37b('0x11')](_0x27d1bc));if(_0x27d1bc['error']){if(_0x27d1bc[_0xf37b('0x12')][_0xf37b('0x13')]===0x1f4){logger[_0xf37b('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x13e61e,_0x27d1bc[_0xf37b('0x12')]['message']);return _0x4843f4(_0x27d1bc[_0xf37b('0x12')][_0xf37b('0x14')]);}logger['error'](_0xf37b('0xd'),_0x13e61e,_0x27d1bc[_0xf37b('0x12')][_0xf37b('0x14')]);return _0x167ea6(_0x27d1bc[_0xf37b('0x12')]['message']);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x13e61e,_0xf37b('0x10'));_0x167ea6(_0x27d1bc[_0xf37b('0x15')][_0xf37b('0x14')]);}})['catch'](function(_0x1fa5e2){logger['error'](_0xf37b('0xd'),_0x13e61e,_0x1fa5e2);_0x4843f4(_0x1fa5e2);});});}
\ No newline at end of file
+var _0x4a29=['FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','debug'];(function(_0x1ed383,_0x40dd15){var _0x4c4d16=function(_0x24377e){while(--_0x24377e){_0x1ed383['push'](_0x1ed383['shift']());}};_0x4c4d16(++_0x40dd15);}(_0x4a29,0x1d5));var _0x94a2=function(_0x38b89b,_0x40b0a4){_0x38b89b=_0x38b89b-0x0;var _0x1df863=_0x4a29[_0x38b89b];return _0x1df863;};'use strict';var _=require(_0x94a2('0x0'));var util=require('util');var moment=require(_0x94a2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x94a2('0x2'));var db=require(_0x94a2('0x3'))['db'];var utils=require(_0x94a2('0x4'));var logger=require(_0x94a2('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x94a2('0x6'));var client=jayson[_0x94a2('0x7')][_0x94a2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4fd940,_0x25f968,_0x39e15c){return new BPromise(function(_0x332a6c,_0x33e373){return client[_0x94a2('0x9')](_0x4fd940,_0x39e15c)[_0x94a2('0xa')](function(_0x392a0c){logger[_0x94a2('0xb')](_0x94a2('0xc'),_0x25f968,'request\x20sent');logger[_0x94a2('0xd')](_0x94a2('0xe'),_0x25f968,_0x94a2('0xf'),JSON[_0x94a2('0x10')](_0x392a0c));if(_0x392a0c[_0x94a2('0x11')]){if(_0x392a0c[_0x94a2('0x11')]['code']===0x1f4){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x25f968,_0x392a0c[_0x94a2('0x11')]['message']);return _0x33e373(_0x392a0c['error']['message']);}logger['error'](_0x94a2('0xc'),_0x25f968,_0x392a0c['error'][_0x94a2('0x12')]);return _0x332a6c(_0x392a0c[_0x94a2('0x11')][_0x94a2('0x12')]);}else{logger['info'](_0x94a2('0xc'),_0x25f968,_0x94a2('0xf'));_0x332a6c(_0x392a0c[_0x94a2('0x13')][_0x94a2('0x12')]);}})[_0x94a2('0x14')](function(_0x3330a3){logger[_0x94a2('0x11')](_0x94a2('0xc'),_0x25f968,_0x3330a3);_0x33e373(_0x3330a3);});});}
\ No newline at end of file
index 849c863..9e2294e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe489=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./intFreshsalesField.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util'];(function(_0x1029f2,_0x2f5903){var _0xdc52c=function(_0x459b0b){while(--_0x459b0b){_0x1029f2['push'](_0x1029f2['shift']());}};_0xdc52c(++_0x2f5903);}(_0xe489,0x9e));var _0x9e48=function(_0x15816f,_0x5c1ad1){_0x15816f=_0x15816f-0x0;var _0x477b42=_0xe489[_0x15816f];return _0x477b42;};'use strict';var multer=require(_0x9e48('0x0'));var util=require(_0x9e48('0x1'));var path=require('path');var timeout=require(_0x9e48('0x2'));var express=require(_0x9e48('0x3'));var router=express[_0x9e48('0x4')]();var fs_extra=require(_0x9e48('0x5'));var auth=require(_0x9e48('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9e48('0x7'));router['get']('/',auth[_0x9e48('0x8')](),controller[_0x9e48('0x9')]);router[_0x9e48('0xa')](_0x9e48('0xb'),auth['isAuthenticated'](),controller[_0x9e48('0xc')]);router[_0x9e48('0xd')]('/',auth[_0x9e48('0x8')](),controller[_0x9e48('0xe')]);router[_0x9e48('0xf')]('/:id',auth[_0x9e48('0x8')](),controller[_0x9e48('0x10')]);router[_0x9e48('0x11')](_0x9e48('0xb'),auth['isAuthenticated'](),controller[_0x9e48('0x12')]);module[_0x9e48('0x13')]=router;
\ No newline at end of file
+var _0xa1fd=['create','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post'];(function(_0x40501b,_0x361e17){var _0x17e8a9=function(_0x4a96dc){while(--_0x4a96dc){_0x40501b['push'](_0x40501b['shift']());}};_0x17e8a9(++_0x361e17);}(_0xa1fd,0x1b9));var _0xda1f=function(_0xddafcc,_0x5e601f){_0xddafcc=_0xddafcc-0x0;var _0x511cb1=_0xa1fd[_0xddafcc];return _0x511cb1;};'use strict';var multer=require(_0xda1f('0x0'));var util=require(_0xda1f('0x1'));var path=require(_0xda1f('0x2'));var timeout=require(_0xda1f('0x3'));var express=require('express');var router=express[_0xda1f('0x4')]();var fs_extra=require(_0xda1f('0x5'));var auth=require(_0xda1f('0x6'));var interaction=require(_0xda1f('0x7'));var config=require(_0xda1f('0x8'));var controller=require('./intFreshsalesField.controller');router[_0xda1f('0x9')]('/',auth[_0xda1f('0xa')](),controller[_0xda1f('0xb')]);router['get'](_0xda1f('0xc'),auth[_0xda1f('0xa')](),controller[_0xda1f('0xd')]);router[_0xda1f('0xe')]('/',auth[_0xda1f('0xa')](),controller[_0xda1f('0xf')]);router[_0xda1f('0x10')](_0xda1f('0xc'),auth[_0xda1f('0xa')](),controller['update']);router[_0xda1f('0x11')](_0xda1f('0xc'),auth[_0xda1f('0xa')](),controller[_0xda1f('0x12')]);module['exports']=router;
\ No newline at end of file
index 62109b2..c326180 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x332b=['variable','customVariable','picklist','STRING','BOOLEAN','ENUM','string'];(function(_0x2a0a38,_0x4a6de5){var _0x4a200e=function(_0x2ef26b){while(--_0x2ef26b){_0x2a0a38['push'](_0x2a0a38['shift']());}};_0x4a200e(++_0x4a6de5);}(_0x332b,0x9f));var _0xb332=function(_0xb0158,_0x3ebd8b){_0xb0158=_0xb0158-0x0;var _0x478159=_0x332b[_0xb0158];return _0x478159;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xb332('0x0')](_0xb332('0x1'),_0xb332('0x2'),_0xb332('0x3'),'keyValue',_0xb332('0x4')),'defaultValue':_0xb332('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb332('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xb332('0x1'),_0xb332('0x2'),_0xb332('0x3'))},'keyContent':{'type':Sequelize[_0xb332('0x5')]},'idField':{'type':Sequelize[_0xb332('0x5')]},'nameField':{'type':Sequelize[_0xb332('0x5')]},'customField':{'type':Sequelize[_0xb332('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb332('0x5')]}};
\ No newline at end of file
+var _0xbd7d=['string','variable','keyValue','customVariable','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x5bf420,_0x2d068d){var _0x1c5255=function(_0x4964a2){while(--_0x4964a2){_0x5bf420['push'](_0x5bf420['shift']());}};_0x1c5255(++_0x2d068d);}(_0xbd7d,0xb1));var _0xdbd7=function(_0x4dc0d8,_0x4fb4ff){_0x4dc0d8=_0x4dc0d8-0x0;var _0x16bf8e=_0xbd7d[_0x4dc0d8];return _0x16bf8e;};'use strict';var Sequelize=require(_0xdbd7('0x0'));module[_0xdbd7('0x1')]={'type':{'type':Sequelize[_0xdbd7('0x2')](_0xdbd7('0x3'),_0xdbd7('0x4'),'customVariable',_0xdbd7('0x5'),'picklist'),'defaultValue':_0xdbd7('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xdbd7('0x3'),_0xdbd7('0x4'),_0xdbd7('0x6'))},'keyContent':{'type':Sequelize[_0xdbd7('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xdbd7('0x7')]},'customField':{'type':Sequelize[_0xdbd7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 25e9a04..0fc504c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x214f=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','update','then','end','error','stack','name','send','index','FreshsalesField','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','show','options','find','create','body','destroy','eml-format','zip-dir','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x472a66,_0xcc0bcd){var _0xf99cf1=function(_0x1ab69b){while(--_0x1ab69b){_0x472a66['push'](_0x472a66['shift']());}};_0xf99cf1(++_0xcc0bcd);}(_0x214f,0x89));var _0xf214=function(_0x1180e9,_0x1031a3){_0x1180e9=_0x1180e9-0x0;var _0x501c38=_0x214f[_0x1180e9];return _0x501c38;};'use strict';var emlformat=require(_0xf214('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf214('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf214('0x2'));var util=require(_0xf214('0x3'));var path=require(_0xf214('0x4'));var sox=require(_0xf214('0x5'));var csv=require(_0xf214('0x6'));var ejs=require(_0xf214('0x7'));var fs=require('fs');var fs_extra=require(_0xf214('0x8'));var _=require(_0xf214('0x9'));var squel=require(_0xf214('0xa'));var crypto=require(_0xf214('0xb'));var jsforce=require(_0xf214('0xc'));var deskjs=require(_0xf214('0xd'));var toCsv=require(_0xf214('0x6'));var querystring=require(_0xf214('0xe'));var Papa=require(_0xf214('0xf'));var Redis=require(_0xf214('0x10'));var authService=require(_0xf214('0x11'));var qs=require(_0xf214('0x12'));var as=require(_0xf214('0x13'));var hardwareService=require(_0xf214('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xf214('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf214('0x16'))['db'];function respondWithStatusCode(_0x2ff1c7,_0x44e161){_0x44e161=_0x44e161||0xcc;return function(_0x155a7c){if(_0x155a7c){return _0x2ff1c7[_0xf214('0x17')](_0x44e161);}return _0x2ff1c7[_0xf214('0x18')](_0x44e161)['end']();};}function respondWithResult(_0x1fe7c5,_0x3348e0){_0x3348e0=_0x3348e0||0xc8;return function(_0x69ce1a){if(_0x69ce1a){return _0x1fe7c5[_0xf214('0x18')](_0x3348e0)[_0xf214('0x19')](_0x69ce1a);}};}function respondWithFilteredResult(_0x50b8d4,_0x290767){return function(_0x158874){if(_0x158874){var _0x242c9a=typeof _0x290767[_0xf214('0x1a')]===_0xf214('0x1b')&&typeof _0x290767['limit']==='undefined';var _0x4faedb=_0x158874[_0xf214('0x1c')];var _0x39836f=_0x242c9a?0x0:_0x290767[_0xf214('0x1a')];var _0x521f79=_0x242c9a?_0x158874[_0xf214('0x1c')]:_0x290767[_0xf214('0x1a')]+_0x290767['limit'];var _0x1846fc;if(_0x521f79>=_0x4faedb){_0x521f79=_0x4faedb;_0x1846fc=0xc8;}else{_0x1846fc=0xce;}_0x50b8d4[_0xf214('0x18')](_0x1846fc);return _0x50b8d4[_0xf214('0x1d')](_0xf214('0x1e'),_0x39836f+'-'+_0x521f79+'/'+_0x4faedb)['json'](_0x158874);}return null;};}function patchUpdates(_0x169735){return function(_0x4ddbd3){try{jsonpatch[_0xf214('0x1f')](_0x4ddbd3,_0x169735,!![]);}catch(_0x4ef564){return BPromise['reject'](_0x4ef564);}return _0x4ddbd3['save']();};}function saveUpdates(_0x4abb72,_0x4a2ed6){return function(_0x413f0b){if(_0x413f0b){return _0x413f0b[_0xf214('0x20')](_0x4abb72)[_0xf214('0x21')](function(_0x49eb0a){return _0x49eb0a;});}return null;};}function removeEntity(_0x158f90,_0x30615c){return function(_0x441808){if(_0x441808){return _0x441808['destroy']()[_0xf214('0x21')](function(){_0x158f90['status'](0xcc)[_0xf214('0x22')]();});}};}function handleEntityNotFound(_0xa8a328,_0x3bcb0d){return function(_0x43b208){if(!_0x43b208){_0xa8a328['sendStatus'](0x194);}return _0x43b208;};}function handleError(_0x45b987,_0x4b43d1){_0x4b43d1=_0x4b43d1||0x1f4;return function(_0x978a5f){logger[_0xf214('0x23')](_0x978a5f[_0xf214('0x24')]);if(_0x978a5f[_0xf214('0x25')]){delete _0x978a5f[_0xf214('0x25')];}_0x45b987[_0xf214('0x18')](_0x4b43d1)[_0xf214('0x26')](_0x978a5f);};}exports[_0xf214('0x27')]=function(_0x1309de,_0x58d88e){var _0x534b41={},_0x2fb577={},_0xc2dc10={'count':0x0,'rows':[]};var _0x2fcec2=_['map'](db[_0xf214('0x28')][_0xf214('0x29')],function(_0x47c29e){return{'name':_0x47c29e[_0xf214('0x2a')],'type':_0x47c29e[_0xf214('0x2b')][_0xf214('0x2c')]};});_0x2fb577[_0xf214('0x2d')]=_[_0xf214('0x2e')](_0x2fcec2,_0xf214('0x25'));_0x2fb577[_0xf214('0x2f')]=_[_0xf214('0x30')](_0x1309de[_0xf214('0x2f')]);_0x2fb577[_0xf214('0x31')]=_['intersection'](_0x2fb577[_0xf214('0x2d')],_0x2fb577[_0xf214('0x2f')]);_0x534b41[_0xf214('0x32')]=_[_0xf214('0x33')](_0x2fb577[_0xf214('0x2d')],qs[_0xf214('0x34')](_0x1309de[_0xf214('0x2f')]['fields']));_0x534b41['attributes']=_0x534b41[_0xf214('0x32')][_0xf214('0x35')]?_0x534b41[_0xf214('0x32')]:_0x2fb577[_0xf214('0x2d')];if(!_0x1309de[_0xf214('0x2f')][_0xf214('0x36')](_0xf214('0x37'))){_0x534b41[_0xf214('0x38')]=qs['limit'](_0x1309de['query'][_0xf214('0x38')]);_0x534b41[_0xf214('0x1a')]=qs[_0xf214('0x1a')](_0x1309de[_0xf214('0x2f')]['offset']);}_0x534b41['order']=qs['sort'](_0x1309de[_0xf214('0x2f')][_0xf214('0x39')]);_0x534b41[_0xf214('0x3a')]=qs[_0xf214('0x31')](_[_0xf214('0x3b')](_0x1309de['query'],_0x2fb577[_0xf214('0x31')]),_0x2fcec2);if(_0x1309de[_0xf214('0x2f')]['filter']){_0x534b41[_0xf214('0x3a')]=_['merge'](_0x534b41[_0xf214('0x3a')],{'$or':_['map'](_0x2fcec2,function(_0x11049b){if(_0x11049b[_0xf214('0x2b')]!==_0xf214('0x3c')){var _0x289faa={};_0x289faa[_0x11049b[_0xf214('0x25')]]={'$like':'%'+_0x1309de[_0xf214('0x2f')][_0xf214('0x3d')]+'%'};return _0x289faa;}})});}_0x534b41=_[_0xf214('0x3e')]({},_0x534b41,_0x1309de['options']);var _0x33d481={'where':_0x534b41[_0xf214('0x3a')]};return db[_0xf214('0x28')][_0xf214('0x1c')](_0x33d481)[_0xf214('0x21')](function(_0x2a1022){_0xc2dc10[_0xf214('0x1c')]=_0x2a1022;if(_0x1309de[_0xf214('0x2f')][_0xf214('0x3f')]){_0x534b41[_0xf214('0x40')]=[{'all':!![]}];}return db[_0xf214('0x28')][_0xf214('0x41')](_0x534b41);})['then'](function(_0x1ac201){_0xc2dc10[_0xf214('0x42')]=_0x1ac201;return _0xc2dc10;})[_0xf214('0x21')](respondWithFilteredResult(_0x58d88e,_0x534b41))[_0xf214('0x43')](handleError(_0x58d88e,null));};exports[_0xf214('0x44')]=function(_0x3078b2,_0x1555c0){var _0x4d5f3b={'raw':!![],'where':{'id':_0x3078b2['params']['id']}},_0x3ad06e={};_0x3ad06e[_0xf214('0x2d')]=_[_0xf214('0x30')](db[_0xf214('0x28')]['rawAttributes']);_0x3ad06e[_0xf214('0x2f')]=_[_0xf214('0x30')](_0x3078b2[_0xf214('0x2f')]);_0x3ad06e[_0xf214('0x31')]=_[_0xf214('0x33')](_0x3ad06e[_0xf214('0x2d')],_0x3ad06e[_0xf214('0x2f')]);_0x4d5f3b[_0xf214('0x32')]=_[_0xf214('0x33')](_0x3ad06e[_0xf214('0x2d')],qs['fields'](_0x3078b2[_0xf214('0x2f')][_0xf214('0x34')]));_0x4d5f3b[_0xf214('0x32')]=_0x4d5f3b[_0xf214('0x32')][_0xf214('0x35')]?_0x4d5f3b[_0xf214('0x32')]:_0x3ad06e['model'];if(_0x3078b2[_0xf214('0x2f')]['includeAll']){_0x4d5f3b[_0xf214('0x40')]=[{'all':!![]}];}_0x4d5f3b=_[_0xf214('0x3e')]({},_0x4d5f3b,_0x3078b2[_0xf214('0x45')]);return db['FreshsalesField'][_0xf214('0x46')](_0x4d5f3b)[_0xf214('0x21')](handleEntityNotFound(_0x1555c0,null))[_0xf214('0x21')](respondWithResult(_0x1555c0,null))[_0xf214('0x43')](handleError(_0x1555c0,null));};exports[_0xf214('0x47')]=function(_0x5566eb,_0x149d46){return db[_0xf214('0x28')][_0xf214('0x47')](_0x5566eb[_0xf214('0x48')],{})[_0xf214('0x21')](respondWithResult(_0x149d46,0xc9))[_0xf214('0x43')](handleError(_0x149d46,null));};exports[_0xf214('0x20')]=function(_0x52f7b6,_0x2f868b){if(_0x52f7b6['body']['id']){delete _0x52f7b6[_0xf214('0x48')]['id'];}return db[_0xf214('0x28')]['find']({'where':{'id':_0x52f7b6['params']['id']}})['then'](handleEntityNotFound(_0x2f868b,null))['then'](saveUpdates(_0x52f7b6[_0xf214('0x48')],null))[_0xf214('0x21')](respondWithResult(_0x2f868b,null))['catch'](handleError(_0x2f868b,null));};exports[_0xf214('0x49')]=function(_0x3e543b,_0xe688d0){return db[_0xf214('0x28')][_0xf214('0x46')]({'where':{'id':_0x3e543b['params']['id']}})[_0xf214('0x21')](handleEntityNotFound(_0xe688d0,null))[_0xf214('0x21')](removeEntity(_0xe688d0,null))[_0xf214('0x43')](handleError(_0xe688d0,null));};
\ No newline at end of file
+var _0x0ff4=['index','map','FreshsalesField','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','options','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','body','update','eml-format','rimraf','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','destroy','then','error','stack','name'];(function(_0x262c9b,_0x47129b){var _0x4b533f=function(_0x4682dc){while(--_0x4682dc){_0x262c9b['push'](_0x262c9b['shift']());}};_0x4b533f(++_0x47129b);}(_0x0ff4,0xb0));var _0x40ff=function(_0x1d50f2,_0x3c3ec6){_0x1d50f2=_0x1d50f2-0x0;var _0x3769b8=_0x0ff4[_0x1d50f2];return _0x3769b8;};'use strict';var emlformat=require(_0x40ff('0x0'));var rimraf=require(_0x40ff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x40ff('0x2'));var moment=require(_0x40ff('0x3'));var BPromise=require(_0x40ff('0x4'));var Mustache=require('mustache');var util=require(_0x40ff('0x5'));var path=require('path');var sox=require(_0x40ff('0x6'));var csv=require(_0x40ff('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x40ff('0x8'));var _=require(_0x40ff('0x9'));var squel=require(_0x40ff('0xa'));var crypto=require('crypto');var jsforce=require(_0x40ff('0xb'));var deskjs=require(_0x40ff('0xc'));var toCsv=require(_0x40ff('0x7'));var querystring=require(_0x40ff('0xd'));var Papa=require('papaparse');var Redis=require(_0x40ff('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x40ff('0xf'));var as=require(_0x40ff('0x10'));var hardwareService=require(_0x40ff('0x11'));var logger=require(_0x40ff('0x12'))('api');var utils=require(_0x40ff('0x13'));var config=require(_0x40ff('0x14'));var licenseUtil=require(_0x40ff('0x15'));var db=require(_0x40ff('0x16'))['db'];function respondWithStatusCode(_0x489916,_0x30df21){_0x30df21=_0x30df21||0xcc;return function(_0x2b2fba){if(_0x2b2fba){return _0x489916[_0x40ff('0x17')](_0x30df21);}return _0x489916[_0x40ff('0x18')](_0x30df21)[_0x40ff('0x19')]();};}function respondWithResult(_0x22ba61,_0x4b17d8){_0x4b17d8=_0x4b17d8||0xc8;return function(_0x14b434){if(_0x14b434){return _0x22ba61[_0x40ff('0x18')](_0x4b17d8)[_0x40ff('0x1a')](_0x14b434);}};}function respondWithFilteredResult(_0x3b3b92,_0xde1c90){return function(_0x3c97a4){if(_0x3c97a4){var _0x165d04=typeof _0xde1c90['offset']===_0x40ff('0x1b')&&typeof _0xde1c90[_0x40ff('0x1c')]===_0x40ff('0x1b');var _0xec21e=_0x3c97a4[_0x40ff('0x1d')];var _0x24e1f1=_0x165d04?0x0:_0xde1c90[_0x40ff('0x1e')];var _0x262afe=_0x165d04?_0x3c97a4['count']:_0xde1c90[_0x40ff('0x1e')]+_0xde1c90['limit'];var _0x2aaf5b;if(_0x262afe>=_0xec21e){_0x262afe=_0xec21e;_0x2aaf5b=0xc8;}else{_0x2aaf5b=0xce;}_0x3b3b92[_0x40ff('0x18')](_0x2aaf5b);return _0x3b3b92[_0x40ff('0x1f')](_0x40ff('0x20'),_0x24e1f1+'-'+_0x262afe+'/'+_0xec21e)['json'](_0x3c97a4);}return null;};}function patchUpdates(_0x16e59b){return function(_0x174de3){try{jsonpatch[_0x40ff('0x21')](_0x174de3,_0x16e59b,!![]);}catch(_0x986482){return BPromise[_0x40ff('0x22')](_0x986482);}return _0x174de3['save']();};}function saveUpdates(_0x5a1e49,_0x55e075){return function(_0x2bdc4d){if(_0x2bdc4d){return _0x2bdc4d['update'](_0x5a1e49)['then'](function(_0x24217a){return _0x24217a;});}return null;};}function removeEntity(_0x2fc221,_0x220436){return function(_0xc794fe){if(_0xc794fe){return _0xc794fe[_0x40ff('0x23')]()[_0x40ff('0x24')](function(){_0x2fc221[_0x40ff('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3dd03a,_0x2c4431){return function(_0x2bd557){if(!_0x2bd557){_0x3dd03a[_0x40ff('0x17')](0x194);}return _0x2bd557;};}function handleError(_0x3c87b9,_0x17e4d7){_0x17e4d7=_0x17e4d7||0x1f4;return function(_0x2a562a){logger[_0x40ff('0x25')](_0x2a562a[_0x40ff('0x26')]);if(_0x2a562a[_0x40ff('0x27')]){delete _0x2a562a['name'];}_0x3c87b9['status'](_0x17e4d7)['send'](_0x2a562a);};}exports[_0x40ff('0x28')]=function(_0x4d8fe6,_0x3c3bb8){var _0x22d004={},_0x3f58d1={},_0x49baef={'count':0x0,'rows':[]};var _0x4d378f=_[_0x40ff('0x29')](db[_0x40ff('0x2a')]['rawAttributes'],function(_0x86b49a){return{'name':_0x86b49a['fieldName'],'type':_0x86b49a['type'][_0x40ff('0x2b')]};});_0x3f58d1[_0x40ff('0x2c')]=_[_0x40ff('0x29')](_0x4d378f,'name');_0x3f58d1[_0x40ff('0x2d')]=_[_0x40ff('0x2e')](_0x4d8fe6[_0x40ff('0x2d')]);_0x3f58d1[_0x40ff('0x2f')]=_[_0x40ff('0x30')](_0x3f58d1['model'],_0x3f58d1[_0x40ff('0x2d')]);_0x22d004['attributes']=_[_0x40ff('0x30')](_0x3f58d1[_0x40ff('0x2c')],qs[_0x40ff('0x31')](_0x4d8fe6['query'][_0x40ff('0x31')]));_0x22d004[_0x40ff('0x32')]=_0x22d004[_0x40ff('0x32')][_0x40ff('0x33')]?_0x22d004[_0x40ff('0x32')]:_0x3f58d1[_0x40ff('0x2c')];if(!_0x4d8fe6[_0x40ff('0x2d')]['hasOwnProperty'](_0x40ff('0x34'))){_0x22d004[_0x40ff('0x1c')]=qs[_0x40ff('0x1c')](_0x4d8fe6[_0x40ff('0x2d')][_0x40ff('0x1c')]);_0x22d004[_0x40ff('0x1e')]=qs['offset'](_0x4d8fe6[_0x40ff('0x2d')][_0x40ff('0x1e')]);}_0x22d004[_0x40ff('0x35')]=qs[_0x40ff('0x36')](_0x4d8fe6[_0x40ff('0x2d')][_0x40ff('0x36')]);_0x22d004[_0x40ff('0x37')]=qs[_0x40ff('0x2f')](_[_0x40ff('0x38')](_0x4d8fe6[_0x40ff('0x2d')],_0x3f58d1['filters']),_0x4d378f);if(_0x4d8fe6[_0x40ff('0x2d')][_0x40ff('0x39')]){_0x22d004[_0x40ff('0x37')]=_[_0x40ff('0x3a')](_0x22d004[_0x40ff('0x37')],{'$or':_[_0x40ff('0x29')](_0x4d378f,function(_0x136987){if(_0x136987[_0x40ff('0x3b')]!=='VIRTUAL'){var _0x3bbdbe={};_0x3bbdbe[_0x136987[_0x40ff('0x27')]]={'$like':'%'+_0x4d8fe6[_0x40ff('0x2d')][_0x40ff('0x39')]+'%'};return _0x3bbdbe;}})});}_0x22d004=_[_0x40ff('0x3a')]({},_0x22d004,_0x4d8fe6[_0x40ff('0x3c')]);var _0x1cc2b7={'where':_0x22d004[_0x40ff('0x37')]};return db[_0x40ff('0x2a')][_0x40ff('0x1d')](_0x1cc2b7)[_0x40ff('0x24')](function(_0x41d77d){_0x49baef['count']=_0x41d77d;if(_0x4d8fe6[_0x40ff('0x2d')]['includeAll']){_0x22d004[_0x40ff('0x3d')]=[{'all':!![]}];}return db['FreshsalesField'][_0x40ff('0x3e')](_0x22d004);})[_0x40ff('0x24')](function(_0x279767){_0x49baef['rows']=_0x279767;return _0x49baef;})[_0x40ff('0x24')](respondWithFilteredResult(_0x3c3bb8,_0x22d004))[_0x40ff('0x3f')](handleError(_0x3c3bb8,null));};exports[_0x40ff('0x40')]=function(_0x33902e,_0x5c5271){var _0x4d79c4={'raw':!![],'where':{'id':_0x33902e[_0x40ff('0x41')]['id']}},_0x522ff5={};_0x522ff5[_0x40ff('0x2c')]=_[_0x40ff('0x2e')](db[_0x40ff('0x2a')][_0x40ff('0x42')]);_0x522ff5[_0x40ff('0x2d')]=_[_0x40ff('0x2e')](_0x33902e[_0x40ff('0x2d')]);_0x522ff5[_0x40ff('0x2f')]=_['intersection'](_0x522ff5[_0x40ff('0x2c')],_0x522ff5[_0x40ff('0x2d')]);_0x4d79c4['attributes']=_[_0x40ff('0x30')](_0x522ff5['model'],qs[_0x40ff('0x31')](_0x33902e[_0x40ff('0x2d')][_0x40ff('0x31')]));_0x4d79c4[_0x40ff('0x32')]=_0x4d79c4[_0x40ff('0x32')]['length']?_0x4d79c4[_0x40ff('0x32')]:_0x522ff5[_0x40ff('0x2c')];if(_0x33902e[_0x40ff('0x2d')][_0x40ff('0x43')]){_0x4d79c4[_0x40ff('0x3d')]=[{'all':!![]}];}_0x4d79c4=_['merge']({},_0x4d79c4,_0x33902e[_0x40ff('0x3c')]);return db[_0x40ff('0x2a')][_0x40ff('0x44')](_0x4d79c4)[_0x40ff('0x24')](handleEntityNotFound(_0x5c5271,null))[_0x40ff('0x24')](respondWithResult(_0x5c5271,null))['catch'](handleError(_0x5c5271,null));};exports[_0x40ff('0x45')]=function(_0xa776e6,_0x2cdba6){return db[_0x40ff('0x2a')][_0x40ff('0x45')](_0xa776e6[_0x40ff('0x46')],{})['then'](respondWithResult(_0x2cdba6,0xc9))[_0x40ff('0x3f')](handleError(_0x2cdba6,null));};exports[_0x40ff('0x47')]=function(_0x430846,_0x464c1b){if(_0x430846[_0x40ff('0x46')]['id']){delete _0x430846[_0x40ff('0x46')]['id'];}return db[_0x40ff('0x2a')][_0x40ff('0x44')]({'where':{'id':_0x430846[_0x40ff('0x41')]['id']}})[_0x40ff('0x24')](handleEntityNotFound(_0x464c1b,null))[_0x40ff('0x24')](saveUpdates(_0x430846[_0x40ff('0x46')],null))['then'](respondWithResult(_0x464c1b,null))[_0x40ff('0x3f')](handleError(_0x464c1b,null));};exports[_0x40ff('0x23')]=function(_0x21ea3b,_0x399359){return db[_0x40ff('0x2a')][_0x40ff('0x44')]({'where':{'id':_0x21ea3b[_0x40ff('0x41')]['id']}})['then'](handleEntityNotFound(_0x399359,null))[_0x40ff('0x24')](removeEntity(_0x399359,null))[_0x40ff('0x3f')](handleError(_0x399359,null));};
\ No newline at end of file
index 8516a5f..b6329d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1d3=['define','int_freshsales_fields','freshsales_unique_index','idField','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intFreshsalesField.attributes','exports'];(function(_0x3cb78f,_0x25d80d){var _0x13cf73=function(_0x241803){while(--_0x241803){_0x3cb78f['push'](_0x3cb78f['shift']());}};_0x13cf73(++_0x25d80d);}(_0xd1d3,0xd7));var _0x3d1d=function(_0x4916f3,_0x5a5004){_0x4916f3=_0x4916f3-0x0;var _0x3241a6=_0xd1d3[_0x4916f3];return _0x3241a6;};'use strict';var _=require(_0x3d1d('0x0'));var util=require('util');var logger=require(_0x3d1d('0x1'))('api');var moment=require(_0x3d1d('0x2'));var BPromise=require(_0x3d1d('0x3'));var rp=require(_0x3d1d('0x4'));var fs=require('fs');var path=require(_0x3d1d('0x5'));var rimraf=require(_0x3d1d('0x6'));var config=require('../../config/environment');var attributes=require(_0x3d1d('0x7'));module[_0x3d1d('0x8')]=function(_0x55c165,_0x2d3a52){return _0x55c165[_0x3d1d('0x9')]('FreshsalesField',attributes,{'tableName':_0x3d1d('0xa'),'paranoid':![],'indexes':[{'name':_0x3d1d('0xb'),'fields':[_0x3d1d('0xc'),_0x3d1d('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x9ab8=['freshsales_unique_index','idField','FieldId','lodash','util','../../config/logger','bluebird','path','rimraf','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields'];(function(_0x133763,_0x55acb7){var _0x322548=function(_0x5e5a2d){while(--_0x5e5a2d){_0x133763['push'](_0x133763['shift']());}};_0x322548(++_0x55acb7);}(_0x9ab8,0x81));var _0x89ab=function(_0x2d574,_0x29c472){_0x2d574=_0x2d574-0x0;var _0x35c6a8=_0x9ab8[_0x2d574];return _0x35c6a8;};'use strict';var _=require(_0x89ab('0x0'));var util=require(_0x89ab('0x1'));var logger=require(_0x89ab('0x2'))('api');var moment=require('moment');var BPromise=require(_0x89ab('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x89ab('0x4'));var rimraf=require(_0x89ab('0x5'));var config=require('../../config/environment');var attributes=require(_0x89ab('0x6'));module[_0x89ab('0x7')]=function(_0x2dcf12,_0xb9ec6e){return _0x2dcf12[_0x89ab('0x8')](_0x89ab('0x9'),attributes,{'tableName':_0x89ab('0xa'),'paranoid':![],'indexes':[{'name':_0x89ab('0xb'),'fields':[_0x89ab('0xc'),_0x89ab('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index d400dc0..3c6a7de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x3dd5a3,_0x202f38){var _0x6e217b=function(_0x3bbee0){while(--_0x3bbee0){_0x3dd5a3['push'](_0x3dd5a3['shift']());}};_0x6e217b(++_0x202f38);}(_0xafc4,0x69));var _0x4afc=function(_0x4dba98,_0x24dc49){_0x4dba98=_0x4dba98-0x0;var _0x48c9d3=_0xafc4[_0x4dba98];return _0x48c9d3;};'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
+var _0x4c60=['client','http','request','then','debug','request\x20sent','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','info','catch','lodash','util','moment','bluebird','ioredis','../../config/environment','jayson/promise'];(function(_0x107390,_0x7e1451){var _0x3824ee=function(_0x1df652){while(--_0x1df652){_0x107390['push'](_0x107390['shift']());}};_0x3824ee(++_0x7e1451);}(_0x4c60,0xc1));var _0x04c6=function(_0x1453a7,_0x29f936){_0x1453a7=_0x1453a7-0x0;var _0xbd9d3=_0x4c60[_0x1453a7];return _0xbd9d3;};'use strict';var _=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var moment=require(_0x04c6('0x2'));var BPromise=require(_0x04c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x04c6('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x04c6('0x5'));var jayson=require(_0x04c6('0x6'));var client=jayson[_0x04c6('0x7')][_0x04c6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b9041,_0x39be2d,_0x8f9b13){return new BPromise(function(_0x530a48,_0x2a4b51){return client[_0x04c6('0x9')](_0x2b9041,_0x8f9b13)[_0x04c6('0xa')](function(_0x30b901){logger['info']('FreshsalesField,\x20%s,\x20%s',_0x39be2d,'request\x20sent');logger[_0x04c6('0xb')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x39be2d,_0x04c6('0xc'),JSON[_0x04c6('0xd')](_0x30b901));if(_0x30b901['error']){if(_0x30b901[_0x04c6('0xe')][_0x04c6('0xf')]===0x1f4){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x30b901['error'][_0x04c6('0x11')]);return _0x2a4b51(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}logger['error'](_0x04c6('0x10'),_0x39be2d,_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);return _0x530a48(_0x30b901[_0x04c6('0xe')][_0x04c6('0x11')]);}else{logger[_0x04c6('0x12')](_0x04c6('0x10'),_0x39be2d,_0x04c6('0xc'));_0x530a48(_0x30b901['result'][_0x04c6('0x11')]);}})[_0x04c6('0x13')](function(_0x382e58){logger[_0x04c6('0xe')](_0x04c6('0x10'),_0x39be2d,_0x382e58);_0x2a4b51(_0x382e58);});});}
\ No newline at end of file
index 7d83730..2dd2104 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(_0x59d682,_0xbc3730){var _0x3d6e77=function(_0x530e36){while(--_0x530e36){_0x59d682['push'](_0x59d682['shift']());}};_0x3d6e77(++_0xbc3730);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router;
\ No newline at end of file
+var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x28f190,_0x40412e){var _0x18ac43=function(_0x508b2b){while(--_0x508b2b){_0x28f190['push'](_0x28f190['shift']());}};_0x18ac43(++_0x40412e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router;
\ No newline at end of file
index 359799c..2b7a63f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d11=['exports','STRING','ENUM','integrationTab','newTab','sequelize'];(function(_0x416b07,_0x5563a6){var _0x5c892f=function(_0x410057){while(--_0x410057){_0x416b07['push'](_0x416b07['shift']());}};_0x5c892f(++_0x5563a6);}(_0x6d11,0xbf));var _0x16d1=function(_0x501114,_0x12e07b){_0x501114=_0x501114-0x0;var _0x1dcd26=_0x6d11[_0x501114];return _0x1dcd26;};'use strict';var Sequelize=require(_0x16d1('0x0'));module[_0x16d1('0x1')]={'name':{'type':Sequelize[_0x16d1('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x16d1('0x2')],'unique':'username'},'remoteUri':{'type':Sequelize[_0x16d1('0x2')]},'password':{'type':Sequelize[_0x16d1('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x16d1('0x2')]},'serverUrl':{'type':Sequelize[_0x16d1('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x16d1('0x3')](_0x16d1('0x4'),_0x16d1('0x5')),'defaultValue':_0x16d1('0x4')}};
\ No newline at end of file
+var _0x5cb4=['sequelize','STRING','username','ENUM','integrationTab','newTab'];(function(_0x5847f8,_0x29ed57){var _0x206d36=function(_0x5d7f1c){while(--_0x5d7f1c){_0x5847f8['push'](_0x5847f8['shift']());}};_0x206d36(++_0x29ed57);}(_0x5cb4,0xc6));var _0x45cb=function(_0x158614,_0x450c78){_0x158614=_0x158614-0x0;var _0x460936=_0x5cb4[_0x158614];return _0x460936;};'use strict';var Sequelize=require(_0x45cb('0x0'));module['exports']={'name':{'type':Sequelize[_0x45cb('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x45cb('0x2')},'remoteUri':{'type':Sequelize[_0x45cb('0x1')]},'password':{'type':Sequelize[_0x45cb('0x1')]},'clientId':{'type':Sequelize[_0x45cb('0x1')]},'clientSecret':{'type':Sequelize[_0x45cb('0x1')]},'securityToken':{'type':Sequelize[_0x45cb('0x1')]},'serverUrl':{'type':Sequelize[_0x45cb('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x45cb('0x3')](_0x45cb('0x4'),_0x45cb('0x5')),'defaultValue':_0x45cb('0x4')}};
\ No newline at end of file
index 643e9e5..4b81511 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf5fd=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','end','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','create','body','find','findOne','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','SalesforceConfiguration','SalesforceField','Subjects','getFields','Task','clientId','clientSecret','username','password','securityToken','remoteUri','slice','substring','login','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','string','int','picklist','boolean','textarea','phone','remove','includes','custom','picklistValues','label','value','True','true','False','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel'];(function(_0x515a94,_0x87b1e5){var _0x22751f=function(_0x5edb1c){while(--_0x5edb1c){_0x515a94['push'](_0x515a94['shift']());}};_0x22751f(++_0x87b1e5);}(_0xf5fd,0x76));var _0xdf5f=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xf5fd[_0x342baa];return _0x1208f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdf5f('0x0'));var zipdir=require(_0xdf5f('0x1'));var jsonpatch=require(_0xdf5f('0x2'));var rp=require(_0xdf5f('0x3'));var moment=require(_0xdf5f('0x4'));var BPromise=require(_0xdf5f('0x5'));var Mustache=require(_0xdf5f('0x6'));var util=require('util');var path=require(_0xdf5f('0x7'));var sox=require(_0xdf5f('0x8'));var csv=require(_0xdf5f('0x9'));var ejs=require(_0xdf5f('0xa'));var fs=require('fs');var fs_extra=require(_0xdf5f('0xb'));var _=require('lodash');var squel=require(_0xdf5f('0xc'));var crypto=require(_0xdf5f('0xd'));var jsforce=require(_0xdf5f('0xe'));var deskjs=require(_0xdf5f('0xf'));var toCsv=require(_0xdf5f('0x9'));var querystring=require(_0xdf5f('0x10'));var Papa=require(_0xdf5f('0x11'));var Redis=require(_0xdf5f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xdf5f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf5f('0x14'));var logger=require(_0xdf5f('0x15'))(_0xdf5f('0x16'));var utils=require(_0xdf5f('0x17'));var config=require(_0xdf5f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xdf5f('0x19'))['db'];var integrations=require(_0xdf5f('0x1a'));function respondWithStatusCode(_0x4955f8,_0x4ba235){_0x4ba235=_0x4ba235||0xcc;return function(_0x500a0f){if(_0x500a0f){return _0x4955f8['sendStatus'](_0x4ba235);}return _0x4955f8['status'](_0x4ba235)[_0xdf5f('0x1b')]();};}function respondWithResult(_0x5a5762,_0x23bc2b){_0x23bc2b=_0x23bc2b||0xc8;return function(_0x548f9a){if(_0x548f9a){return _0x5a5762[_0xdf5f('0x1c')](_0x23bc2b)['json'](_0x548f9a);}};}function respondWithFilteredResult(_0x313d97,_0xd8c4df){return function(_0xcd1449){if(_0xcd1449){var _0x58f2f9=typeof _0xd8c4df[_0xdf5f('0x1d')]==='undefined'&&typeof _0xd8c4df['limit']===_0xdf5f('0x1e');var _0x5bd443=_0xcd1449[_0xdf5f('0x1f')];var _0x70bdbf=_0x58f2f9?0x0:_0xd8c4df['offset'];var _0x1ce865=_0x58f2f9?_0xcd1449[_0xdf5f('0x1f')]:_0xd8c4df[_0xdf5f('0x1d')]+_0xd8c4df[_0xdf5f('0x20')];var _0x478981;if(_0x1ce865>=_0x5bd443){_0x1ce865=_0x5bd443;_0x478981=0xc8;}else{_0x478981=0xce;}_0x313d97['status'](_0x478981);return _0x313d97[_0xdf5f('0x21')](_0xdf5f('0x22'),_0x70bdbf+'-'+_0x1ce865+'/'+_0x5bd443)[_0xdf5f('0x23')](_0xcd1449);}return null;};}function patchUpdates(_0x2e7a5c){return function(_0x3d476d){try{jsonpatch['apply'](_0x3d476d,_0x2e7a5c,!![]);}catch(_0x22f4dc){return BPromise[_0xdf5f('0x24')](_0x22f4dc);}return _0x3d476d[_0xdf5f('0x25')]();};}function saveUpdates(_0x958ae3,_0x4f74d1){return function(_0x11d543){if(_0x11d543){return _0x11d543[_0xdf5f('0x26')](_0x958ae3)['then'](function(_0x5ad95e){return _0x5ad95e;});}return null;};}function removeEntity(_0xe4ddc1,_0x136433){return function(_0x2fb467){if(_0x2fb467){return _0x2fb467[_0xdf5f('0x27')]()[_0xdf5f('0x28')](function(){_0xe4ddc1[_0xdf5f('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b449d,_0x1a8d7b){return function(_0x4025ec){if(!_0x4025ec){_0x1b449d[_0xdf5f('0x29')](0x194);}return _0x4025ec;};}function handleError(_0x17412b,_0x2fb328){_0x2fb328=_0x2fb328||0x1f4;return function(_0x415e79){logger[_0xdf5f('0x2a')](_0x415e79[_0xdf5f('0x2b')]);if(_0x415e79[_0xdf5f('0x2c')]){delete _0x415e79[_0xdf5f('0x2c')];}_0x17412b[_0xdf5f('0x1c')](_0x2fb328)[_0xdf5f('0x2d')](_0x415e79);};}exports[_0xdf5f('0x2e')]=function(_0x403b41,_0x2ae430){var _0x4b1095={},_0x6e5189={},_0x44317b={'count':0x0,'rows':[]};var _0x3c58a9=_[_0xdf5f('0x2f')](db[_0xdf5f('0x30')][_0xdf5f('0x31')],function(_0x44286e){return{'name':_0x44286e[_0xdf5f('0x32')],'type':_0x44286e[_0xdf5f('0x33')][_0xdf5f('0x34')]};});_0x6e5189[_0xdf5f('0x35')]=_[_0xdf5f('0x2f')](_0x3c58a9,_0xdf5f('0x2c'));_0x6e5189[_0xdf5f('0x36')]=_[_0xdf5f('0x37')](_0x403b41[_0xdf5f('0x36')]);_0x6e5189[_0xdf5f('0x38')]=_[_0xdf5f('0x39')](_0x6e5189[_0xdf5f('0x35')],_0x6e5189[_0xdf5f('0x36')]);_0x4b1095[_0xdf5f('0x3a')]=_[_0xdf5f('0x39')](_0x6e5189[_0xdf5f('0x35')],qs[_0xdf5f('0x3b')](_0x403b41[_0xdf5f('0x36')]['fields']));_0x4b1095['attributes']=_0x4b1095[_0xdf5f('0x3a')][_0xdf5f('0x3c')]?_0x4b1095[_0xdf5f('0x3a')]:_0x6e5189[_0xdf5f('0x35')];if(!_0x403b41[_0xdf5f('0x36')][_0xdf5f('0x3d')]('nolimit')){_0x4b1095[_0xdf5f('0x20')]=qs['limit'](_0x403b41[_0xdf5f('0x36')][_0xdf5f('0x20')]);_0x4b1095[_0xdf5f('0x1d')]=qs['offset'](_0x403b41[_0xdf5f('0x36')]['offset']);}_0x4b1095[_0xdf5f('0x3e')]=qs[_0xdf5f('0x3f')](_0x403b41[_0xdf5f('0x36')][_0xdf5f('0x3f')]);_0x4b1095[_0xdf5f('0x40')]=qs[_0xdf5f('0x38')](_[_0xdf5f('0x41')](_0x403b41[_0xdf5f('0x36')],_0x6e5189['filters']),_0x3c58a9);if(_0x403b41[_0xdf5f('0x36')][_0xdf5f('0x42')]){_0x4b1095[_0xdf5f('0x40')]=_[_0xdf5f('0x43')](_0x4b1095['where'],{'$or':_[_0xdf5f('0x2f')](_0x3c58a9,function(_0x2afcc5){if(_0x2afcc5[_0xdf5f('0x33')]!=='VIRTUAL'){var _0x32887f={};_0x32887f[_0x2afcc5[_0xdf5f('0x2c')]]={'$like':'%'+_0x403b41[_0xdf5f('0x36')][_0xdf5f('0x42')]+'%'};return _0x32887f;}})});}_0x4b1095=_[_0xdf5f('0x43')]({},_0x4b1095,_0x403b41[_0xdf5f('0x44')]);var _0x5eac52={'where':_0x4b1095[_0xdf5f('0x40')]};return db['SalesforceAccount']['count'](_0x5eac52)['then'](function(_0x2de10c){_0x44317b['count']=_0x2de10c;if(_0x403b41[_0xdf5f('0x36')][_0xdf5f('0x45')]){_0x4b1095[_0xdf5f('0x46')]=[{'all':!![]}];}return db[_0xdf5f('0x30')][_0xdf5f('0x47')](_0x4b1095);})['then'](function(_0x76378b){_0x44317b['rows']=_0x76378b;return _0x44317b;})[_0xdf5f('0x28')](respondWithFilteredResult(_0x2ae430,_0x4b1095))[_0xdf5f('0x48')](handleError(_0x2ae430,null));};exports[_0xdf5f('0x49')]=function(_0x4e06e3,_0x50f828){var _0x9fa94a={'raw':![],'where':{'id':_0x4e06e3[_0xdf5f('0x4a')]['id']}},_0x9e084f={};_0x9e084f[_0xdf5f('0x35')]=_['keys'](db[_0xdf5f('0x30')][_0xdf5f('0x31')]);_0x9e084f[_0xdf5f('0x36')]=_['keys'](_0x4e06e3['query']);_0x9e084f[_0xdf5f('0x38')]=_[_0xdf5f('0x39')](_0x9e084f[_0xdf5f('0x35')],_0x9e084f[_0xdf5f('0x36')]);_0x9fa94a[_0xdf5f('0x3a')]=_['intersection'](_0x9e084f[_0xdf5f('0x35')],qs[_0xdf5f('0x3b')](_0x4e06e3['query'][_0xdf5f('0x3b')]));_0x9fa94a[_0xdf5f('0x3a')]=_0x9fa94a[_0xdf5f('0x3a')][_0xdf5f('0x3c')]?_0x9fa94a[_0xdf5f('0x3a')]:_0x9e084f['model'];if(_0x4e06e3[_0xdf5f('0x36')][_0xdf5f('0x45')]){_0x9fa94a[_0xdf5f('0x46')]=[{'all':!![]}];}_0x9fa94a=_[_0xdf5f('0x43')]({},_0x9fa94a,_0x4e06e3[_0xdf5f('0x44')]);return db[_0xdf5f('0x30')]['find'](_0x9fa94a)['then'](handleEntityNotFound(_0x50f828,null))['then'](respondWithResult(_0x50f828,null))['catch'](handleError(_0x50f828,null));};exports['create']=function(_0x4b1814,_0x4692cb){return db[_0xdf5f('0x30')][_0xdf5f('0x4b')](_0x4b1814[_0xdf5f('0x4c')],{})[_0xdf5f('0x28')](respondWithResult(_0x4692cb,0xc9))[_0xdf5f('0x48')](handleError(_0x4692cb,null));};exports[_0xdf5f('0x26')]=function(_0x48ceb9,_0x3ce2ad){if(_0x48ceb9[_0xdf5f('0x4c')]['id']){delete _0x48ceb9['body']['id'];}return db[_0xdf5f('0x30')][_0xdf5f('0x4d')]({'where':{'id':_0x48ceb9['params']['id']}})[_0xdf5f('0x28')](handleEntityNotFound(_0x3ce2ad,null))[_0xdf5f('0x28')](saveUpdates(_0x48ceb9['body'],null))[_0xdf5f('0x28')](respondWithResult(_0x3ce2ad,null))[_0xdf5f('0x48')](handleError(_0x3ce2ad,null));};exports['destroy']=function(_0x447eb5,_0x31aad8){return db[_0xdf5f('0x30')]['find']({'where':{'id':_0x447eb5[_0xdf5f('0x4a')]['id']}})[_0xdf5f('0x28')](handleEntityNotFound(_0x31aad8,null))['then'](removeEntity(_0x31aad8,null))[_0xdf5f('0x48')](handleError(_0x31aad8,null));};exports['getConfigurations']=function(_0x35beea,_0x173f0e,_0x2f5a37){var _0x27d3ec={};var _0x2e0ba3={};var _0x2ab512;var _0x505b22;return db['SalesforceAccount'][_0xdf5f('0x4e')]({'where':{'id':_0x35beea[_0xdf5f('0x4a')]['id']}})[_0xdf5f('0x28')](handleEntityNotFound(_0x173f0e,null))[_0xdf5f('0x28')](function(_0x154b62){if(_0x154b62){_0x2ab512=_0x154b62;_0x2e0ba3[_0xdf5f('0x35')]=_['keys'](db['SalesforceConfiguration'][_0xdf5f('0x31')]);_0x2e0ba3[_0xdf5f('0x36')]=_['keys'](_0x35beea[_0xdf5f('0x36')]);_0x2e0ba3[_0xdf5f('0x38')]=_['intersection'](_0x2e0ba3[_0xdf5f('0x35')],_0x2e0ba3[_0xdf5f('0x36')]);_0x27d3ec['attributes']=_['intersection'](_0x2e0ba3['model'],qs['fields'](_0x35beea[_0xdf5f('0x36')][_0xdf5f('0x3b')]));_0x27d3ec['attributes']=_0x27d3ec['attributes'][_0xdf5f('0x3c')]?_0x27d3ec[_0xdf5f('0x3a')]:_0x2e0ba3[_0xdf5f('0x35')];_0x27d3ec[_0xdf5f('0x3e')]=qs['sort'](_0x35beea['query'][_0xdf5f('0x3f')]);_0x27d3ec[_0xdf5f('0x40')]=qs[_0xdf5f('0x38')](_[_0xdf5f('0x41')](_0x35beea[_0xdf5f('0x36')],_0x2e0ba3[_0xdf5f('0x38')]));if(_0x35beea[_0xdf5f('0x36')][_0xdf5f('0x42')]){_0x27d3ec[_0xdf5f('0x40')]=_['merge'](_0x27d3ec[_0xdf5f('0x40')],{'$or':_['map'](_0x27d3ec[_0xdf5f('0x3a')],function(_0x27d8e7){var _0x3ac603={};_0x3ac603[_0x27d8e7]={'$like':'%'+_0x35beea['query'][_0xdf5f('0x42')]+'%'};return _0x3ac603;})});}_0x27d3ec=_[_0xdf5f('0x43')]({},_0x27d3ec,_0x35beea[_0xdf5f('0x44')]);return _0x2ab512['getConfigurations'](_0x27d3ec);}})[_0xdf5f('0x28')](function(_0x4463f9){if(_0x4463f9){_0x505b22=_0x4463f9[_0xdf5f('0x3c')];if(!_0x35beea[_0xdf5f('0x36')]['hasOwnProperty'](_0xdf5f('0x4f'))){_0x27d3ec[_0xdf5f('0x20')]=qs['limit'](_0x35beea[_0xdf5f('0x36')]['limit']);_0x27d3ec[_0xdf5f('0x1d')]=qs[_0xdf5f('0x1d')](_0x35beea[_0xdf5f('0x36')][_0xdf5f('0x1d')]);}return _0x2ab512['getConfigurations'](_0x27d3ec);}})[_0xdf5f('0x28')](function(_0x4ef76e){if(_0x4ef76e){return _0x4ef76e?{'count':_0x505b22,'rows':_0x4ef76e}:null;}})[_0xdf5f('0x28')](respondWithResult(_0x173f0e,null))[_0xdf5f('0x48')](handleError(_0x173f0e,null));};exports[_0xdf5f('0x50')]=function(_0x3a3e54,_0x456192,_0x27585d){if(_0x3a3e54[_0xdf5f('0x4c')]['id']){delete _0x3a3e54[_0xdf5f('0x4c')]['id'];}return db[_0xdf5f('0x30')][_0xdf5f('0x4e')]({'where':{'id':_0x3a3e54[_0xdf5f('0x4a')]['id']}})['then'](handleEntityNotFound(_0x456192,null))[_0xdf5f('0x28')](function(_0x4560b1){if(_0x4560b1){_0x3a3e54[_0xdf5f('0x4c')][_0xdf5f('0x51')]=_0x4560b1['id'];_0x3a3e54[_0xdf5f('0x4c')]['Subjects']=integrations[_0xdf5f('0x52')](_0x3a3e54[_0xdf5f('0x4c')][_0xdf5f('0x53')],_0x3a3e54['body']['type']);_0x3a3e54[_0xdf5f('0x4c')][_0xdf5f('0x54')]=integrations[_0xdf5f('0x55')](_0x3a3e54[_0xdf5f('0x4c')][_0xdf5f('0x53')],_0x3a3e54[_0xdf5f('0x4c')][_0xdf5f('0x33')]);return db[_0xdf5f('0x56')]['create'](_0x3a3e54[_0xdf5f('0x4c')],{'include':[{'model':db[_0xdf5f('0x57')],'as':_0xdf5f('0x58')},{'model':db[_0xdf5f('0x57')],'as':_0xdf5f('0x54')}]});}return null;})[_0xdf5f('0x28')](respondWithResult(_0x456192,null))['catch'](handleError(_0x456192,null));};exports[_0xdf5f('0x59')]=function(_0x5a8f1c,_0x48e74a,_0x83c74d){var _0x431d9e;var _0x165a0e='';var _0x1b3afe=_0xdf5f('0x5a');return db[_0xdf5f('0x30')][_0xdf5f('0x4e')]({'where':{'id':_0x5a8f1c[_0xdf5f('0x4a')]['id']},'attributes':['id','remoteUri',_0xdf5f('0x5b'),_0xdf5f('0x5c'),_0xdf5f('0x5d'),_0xdf5f('0x5e'),_0xdf5f('0x5f')]})[_0xdf5f('0x28')](handleEntityNotFound(_0x48e74a,null))[_0xdf5f('0x28')](function(_0x3968b7){if(_0x3968b7){_0x165a0e=_0x3968b7[_0xdf5f('0x60')];var _0x3c4137=_0x165a0e[_0xdf5f('0x61')](-0x1);if(_0x3c4137==='/'){_0x165a0e=_0x165a0e[_0xdf5f('0x62')](0x0,_0x165a0e['lastIndexOf'](_0x3c4137));}_0x431d9e=new jsforce['Connection']({'oauth2':{'loginUrl':_0x165a0e,'clientId':_0x3968b7[_0xdf5f('0x5b')],'clientSecret':_0x3968b7['clientSecret']}});return _0x431d9e[_0xdf5f('0x63')](_0x3968b7[_0xdf5f('0x5d')],_0x3968b7[_0xdf5f('0x5e')][_0xdf5f('0x64')](_0x3968b7['securityToken']));}})[_0xdf5f('0x28')](function(_0x5b1c74){if(_0x5b1c74){if(!_[_0xdf5f('0x65')](_0x5a8f1c['query'][_0xdf5f('0x66')])){_0x1b3afe=_0x5a8f1c[_0xdf5f('0x36')][_0xdf5f('0x66')];}return _0x431d9e[_0xdf5f('0x67')](_0x1b3afe)[_0xdf5f('0x68')]();}})[_0xdf5f('0x28')](function(_0x30b040){var _0x22e00e=[_0xdf5f('0x69'),_0xdf5f('0x6a'),_0xdf5f('0x6b'),_0xdf5f('0x6c'),_0xdf5f('0x6d'),_0xdf5f('0x6e')];var _0x43c269=[_0xdf5f('0x6f'),_0xdf5f('0x70'),_0xdf5f('0x71'),_0xdf5f('0x72'),'email',_0xdf5f('0x73'),_0xdf5f('0x74')];if(_0x30b040){_[_0xdf5f('0x75')](_0x30b040['fields'],function(_0x27f33a){return _0x22e00e[_0xdf5f('0x76')](_0x27f33a[_0xdf5f('0x2c')])||!_0x43c269[_0xdf5f('0x76')](_0x27f33a['type']);});return{'count':_0x30b040[_0xdf5f('0x3b')][_0xdf5f('0x3c')],'rows':_['map'](_0x30b040[_0xdf5f('0x3b')],function(_0x54af8f){return{'id':_0x54af8f[_0xdf5f('0x2c')],'name':_0x54af8f['label'],'custom':_0x54af8f[_0xdf5f('0x77')],'options':_0x54af8f['picklistValues'][_0xdf5f('0x3c')]>0x0?_[_0xdf5f('0x2f')](_0x54af8f[_0xdf5f('0x78')],function(_0xe9454b){return{'name':_0xe9454b[_0xdf5f('0x79')],'value':_0xe9454b[_0xdf5f('0x7a')]};}):_0x54af8f['type']==_0xdf5f('0x72')?[{'name':_0xdf5f('0x7b'),'value':_0xdf5f('0x7c')},{'name':_0xdf5f('0x7d'),'value':'false'}]:[]};})};}})['then'](respondWithResult(_0x48e74a,null))['catch'](function(_0x24883d){var _0x3f09bd=_0x5a8f1c[_0xdf5f('0x36')][_0xdf5f('0x7e')]?0x1f4:_0x24883d[_0xdf5f('0x7f')]||0x1f4;logger[_0xdf5f('0x2a')](_0xdf5f('0x80'),_0xdf5f('0x59'),_0x3f09bd,JSON[_0xdf5f('0x81')](_0x24883d));delete _0x24883d[_0xdf5f('0x2c')];if(_0x3f09bd===0x191){_0x3f09bd=0x190;}_0x48e74a[_0xdf5f('0x1c')](_0x3f09bd)[_0xdf5f('0x2d')](_0x5a8f1c[_0xdf5f('0x36')]['test']?{'message':_0xdf5f('0x82'),'statusCode':_0x24883d[_0xdf5f('0x7f')]}:_0x24883d);});};
\ No newline at end of file
+var _0x26e4=['update','error','stack','name','send','index','map','SalesforceAccount','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','then','includeAll','include','findAll','show','params','rawAttributes','find','catch','create','body','destroy','getConfigurations','SalesforceConfiguration','AccountId','getSubjects','channel','type','getDescriptions','SalesforceField','Subjects','getFields','Task','findOne','remoteUri','clientId','password','securityToken','slice','substring','lastIndexOf','Connection','clientSecret','username','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Description','string','picklist','boolean','email','phone','remove','includes','custom','picklistValues','label','True','true','false','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save'];(function(_0x4c205c,_0x15252b){var _0x1ad428=function(_0x2461de){while(--_0x2461de){_0x4c205c['push'](_0x4c205c['shift']());}};_0x1ad428(++_0x15252b);}(_0x26e4,0x1d5));var _0x426e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x26e4[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x426e('0x0'));var rimraf=require(_0x426e('0x1'));var zipdir=require(_0x426e('0x2'));var jsonpatch=require(_0x426e('0x3'));var rp=require(_0x426e('0x4'));var moment=require(_0x426e('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x426e('0x6'));var path=require(_0x426e('0x7'));var sox=require(_0x426e('0x8'));var csv=require(_0x426e('0x9'));var ejs=require(_0x426e('0xa'));var fs=require('fs');var fs_extra=require(_0x426e('0xb'));var _=require(_0x426e('0xc'));var squel=require(_0x426e('0xd'));var crypto=require(_0x426e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x426e('0xf'));var toCsv=require(_0x426e('0x9'));var querystring=require(_0x426e('0x10'));var Papa=require(_0x426e('0x11'));var Redis=require('ioredis');var authService=require(_0x426e('0x12'));var qs=require(_0x426e('0x13'));var as=require(_0x426e('0x14'));var hardwareService=require(_0x426e('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x426e('0x16'));var config=require(_0x426e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x426e('0x18'))['db'];var integrations=require(_0x426e('0x19'));function respondWithStatusCode(_0x3e4665,_0xdb493c){_0xdb493c=_0xdb493c||0xcc;return function(_0x175159){if(_0x175159){return _0x3e4665[_0x426e('0x1a')](_0xdb493c);}return _0x3e4665[_0x426e('0x1b')](_0xdb493c)[_0x426e('0x1c')]();};}function respondWithResult(_0x17b90d,_0x49f7b9){_0x49f7b9=_0x49f7b9||0xc8;return function(_0x56d4d4){if(_0x56d4d4){return _0x17b90d[_0x426e('0x1b')](_0x49f7b9)[_0x426e('0x1d')](_0x56d4d4);}};}function respondWithFilteredResult(_0x2cb320,_0x183246){return function(_0x32e58e){if(_0x32e58e){var _0xbb18a9=typeof _0x183246['offset']===_0x426e('0x1e')&&typeof _0x183246[_0x426e('0x1f')]==='undefined';var _0x405dfc=_0x32e58e[_0x426e('0x20')];var _0x54e4e0=_0xbb18a9?0x0:_0x183246['offset'];var _0x4c1564=_0xbb18a9?_0x32e58e['count']:_0x183246[_0x426e('0x21')]+_0x183246[_0x426e('0x1f')];var _0x3aa069;if(_0x4c1564>=_0x405dfc){_0x4c1564=_0x405dfc;_0x3aa069=0xc8;}else{_0x3aa069=0xce;}_0x2cb320[_0x426e('0x1b')](_0x3aa069);return _0x2cb320[_0x426e('0x22')](_0x426e('0x23'),_0x54e4e0+'-'+_0x4c1564+'/'+_0x405dfc)[_0x426e('0x1d')](_0x32e58e);}return null;};}function patchUpdates(_0x288be5){return function(_0x4033b3){try{jsonpatch[_0x426e('0x24')](_0x4033b3,_0x288be5,!![]);}catch(_0x141105){return BPromise[_0x426e('0x25')](_0x141105);}return _0x4033b3[_0x426e('0x26')]();};}function saveUpdates(_0x8c4889,_0x452f1a){return function(_0x5e8dc7){if(_0x5e8dc7){return _0x5e8dc7[_0x426e('0x27')](_0x8c4889)['then'](function(_0x510011){return _0x510011;});}return null;};}function removeEntity(_0x1a634c,_0x5645ea){return function(_0x10eff4){if(_0x10eff4){return _0x10eff4['destroy']()['then'](function(){_0x1a634c[_0x426e('0x1b')](0xcc)[_0x426e('0x1c')]();});}};}function handleEntityNotFound(_0x20e51b,_0x4e686f){return function(_0xf5ba2b){if(!_0xf5ba2b){_0x20e51b[_0x426e('0x1a')](0x194);}return _0xf5ba2b;};}function handleError(_0x1fb8c5,_0x2df42d){_0x2df42d=_0x2df42d||0x1f4;return function(_0x393c4c){logger[_0x426e('0x28')](_0x393c4c[_0x426e('0x29')]);if(_0x393c4c[_0x426e('0x2a')]){delete _0x393c4c[_0x426e('0x2a')];}_0x1fb8c5[_0x426e('0x1b')](_0x2df42d)[_0x426e('0x2b')](_0x393c4c);};}exports[_0x426e('0x2c')]=function(_0x47c60a,_0x161ad1){var _0x5361a2={},_0x3a46cc={},_0xb9bee2={'count':0x0,'rows':[]};var _0x4f6dca=_[_0x426e('0x2d')](db[_0x426e('0x2e')]['rawAttributes'],function(_0x3c74d3){return{'name':_0x3c74d3['fieldName'],'type':_0x3c74d3['type'][_0x426e('0x2f')]};});_0x3a46cc[_0x426e('0x30')]=_[_0x426e('0x2d')](_0x4f6dca,'name');_0x3a46cc[_0x426e('0x31')]=_[_0x426e('0x32')](_0x47c60a['query']);_0x3a46cc[_0x426e('0x33')]=_[_0x426e('0x34')](_0x3a46cc[_0x426e('0x30')],_0x3a46cc['query']);_0x5361a2[_0x426e('0x35')]=_[_0x426e('0x34')](_0x3a46cc[_0x426e('0x30')],qs['fields'](_0x47c60a['query'][_0x426e('0x36')]));_0x5361a2['attributes']=_0x5361a2['attributes'][_0x426e('0x37')]?_0x5361a2['attributes']:_0x3a46cc[_0x426e('0x30')];if(!_0x47c60a[_0x426e('0x31')][_0x426e('0x38')](_0x426e('0x39'))){_0x5361a2[_0x426e('0x1f')]=qs[_0x426e('0x1f')](_0x47c60a[_0x426e('0x31')]['limit']);_0x5361a2[_0x426e('0x21')]=qs[_0x426e('0x21')](_0x47c60a[_0x426e('0x31')][_0x426e('0x21')]);}_0x5361a2[_0x426e('0x3a')]=qs[_0x426e('0x3b')](_0x47c60a['query'][_0x426e('0x3b')]);_0x5361a2[_0x426e('0x3c')]=qs[_0x426e('0x33')](_[_0x426e('0x3d')](_0x47c60a[_0x426e('0x31')],_0x3a46cc[_0x426e('0x33')]),_0x4f6dca);if(_0x47c60a[_0x426e('0x31')][_0x426e('0x3e')]){_0x5361a2['where']=_[_0x426e('0x3f')](_0x5361a2[_0x426e('0x3c')],{'$or':_[_0x426e('0x2d')](_0x4f6dca,function(_0x15014f){if(_0x15014f['type']!=='VIRTUAL'){var _0x2fe9ce={};_0x2fe9ce[_0x15014f['name']]={'$like':'%'+_0x47c60a[_0x426e('0x31')][_0x426e('0x3e')]+'%'};return _0x2fe9ce;}})});}_0x5361a2=_[_0x426e('0x3f')]({},_0x5361a2,_0x47c60a[_0x426e('0x40')]);var _0x4d1631={'where':_0x5361a2['where']};return db[_0x426e('0x2e')][_0x426e('0x20')](_0x4d1631)[_0x426e('0x41')](function(_0x470f87){_0xb9bee2[_0x426e('0x20')]=_0x470f87;if(_0x47c60a[_0x426e('0x31')][_0x426e('0x42')]){_0x5361a2[_0x426e('0x43')]=[{'all':!![]}];}return db[_0x426e('0x2e')][_0x426e('0x44')](_0x5361a2);})[_0x426e('0x41')](function(_0x4b2c89){_0xb9bee2['rows']=_0x4b2c89;return _0xb9bee2;})[_0x426e('0x41')](respondWithFilteredResult(_0x161ad1,_0x5361a2))['catch'](handleError(_0x161ad1,null));};exports[_0x426e('0x45')]=function(_0x1a3e47,_0xca25cd){var _0x5d95e6={'raw':![],'where':{'id':_0x1a3e47[_0x426e('0x46')]['id']}},_0x417991={};_0x417991['model']=_[_0x426e('0x32')](db[_0x426e('0x2e')][_0x426e('0x47')]);_0x417991[_0x426e('0x31')]=_['keys'](_0x1a3e47[_0x426e('0x31')]);_0x417991[_0x426e('0x33')]=_['intersection'](_0x417991[_0x426e('0x30')],_0x417991[_0x426e('0x31')]);_0x5d95e6[_0x426e('0x35')]=_[_0x426e('0x34')](_0x417991['model'],qs[_0x426e('0x36')](_0x1a3e47[_0x426e('0x31')][_0x426e('0x36')]));_0x5d95e6[_0x426e('0x35')]=_0x5d95e6[_0x426e('0x35')][_0x426e('0x37')]?_0x5d95e6[_0x426e('0x35')]:_0x417991[_0x426e('0x30')];if(_0x1a3e47[_0x426e('0x31')][_0x426e('0x42')]){_0x5d95e6['include']=[{'all':!![]}];}_0x5d95e6=_[_0x426e('0x3f')]({},_0x5d95e6,_0x1a3e47['options']);return db['SalesforceAccount'][_0x426e('0x48')](_0x5d95e6)[_0x426e('0x41')](handleEntityNotFound(_0xca25cd,null))[_0x426e('0x41')](respondWithResult(_0xca25cd,null))[_0x426e('0x49')](handleError(_0xca25cd,null));};exports['create']=function(_0x328e13,_0x335706){return db['SalesforceAccount'][_0x426e('0x4a')](_0x328e13[_0x426e('0x4b')],{})['then'](respondWithResult(_0x335706,0xc9))[_0x426e('0x49')](handleError(_0x335706,null));};exports['update']=function(_0x4f6014,_0x1a045a){if(_0x4f6014[_0x426e('0x4b')]['id']){delete _0x4f6014['body']['id'];}return db[_0x426e('0x2e')][_0x426e('0x48')]({'where':{'id':_0x4f6014[_0x426e('0x46')]['id']}})[_0x426e('0x41')](handleEntityNotFound(_0x1a045a,null))[_0x426e('0x41')](saveUpdates(_0x4f6014[_0x426e('0x4b')],null))[_0x426e('0x41')](respondWithResult(_0x1a045a,null))[_0x426e('0x49')](handleError(_0x1a045a,null));};exports[_0x426e('0x4c')]=function(_0xcabba1,_0x4d751e){return db[_0x426e('0x2e')][_0x426e('0x48')]({'where':{'id':_0xcabba1[_0x426e('0x46')]['id']}})['then'](handleEntityNotFound(_0x4d751e,null))[_0x426e('0x41')](removeEntity(_0x4d751e,null))[_0x426e('0x49')](handleError(_0x4d751e,null));};exports[_0x426e('0x4d')]=function(_0x2c882d,_0x508754,_0x25397c){var _0x22cb3e={};var _0x257564={};var _0x474a2c;var _0x11abd2;return db[_0x426e('0x2e')]['findOne']({'where':{'id':_0x2c882d[_0x426e('0x46')]['id']}})[_0x426e('0x41')](handleEntityNotFound(_0x508754,null))[_0x426e('0x41')](function(_0x335a70){if(_0x335a70){_0x474a2c=_0x335a70;_0x257564[_0x426e('0x30')]=_[_0x426e('0x32')](db[_0x426e('0x4e')][_0x426e('0x47')]);_0x257564[_0x426e('0x31')]=_[_0x426e('0x32')](_0x2c882d['query']);_0x257564[_0x426e('0x33')]=_[_0x426e('0x34')](_0x257564[_0x426e('0x30')],_0x257564[_0x426e('0x31')]);_0x22cb3e['attributes']=_[_0x426e('0x34')](_0x257564[_0x426e('0x30')],qs[_0x426e('0x36')](_0x2c882d['query'][_0x426e('0x36')]));_0x22cb3e[_0x426e('0x35')]=_0x22cb3e[_0x426e('0x35')][_0x426e('0x37')]?_0x22cb3e['attributes']:_0x257564[_0x426e('0x30')];_0x22cb3e[_0x426e('0x3a')]=qs[_0x426e('0x3b')](_0x2c882d['query'][_0x426e('0x3b')]);_0x22cb3e[_0x426e('0x3c')]=qs[_0x426e('0x33')](_[_0x426e('0x3d')](_0x2c882d[_0x426e('0x31')],_0x257564[_0x426e('0x33')]));if(_0x2c882d[_0x426e('0x31')][_0x426e('0x3e')]){_0x22cb3e[_0x426e('0x3c')]=_[_0x426e('0x3f')](_0x22cb3e['where'],{'$or':_['map'](_0x22cb3e['attributes'],function(_0x12a2d0){var _0x140eac={};_0x140eac[_0x12a2d0]={'$like':'%'+_0x2c882d[_0x426e('0x31')]['filter']+'%'};return _0x140eac;})});}_0x22cb3e=_[_0x426e('0x3f')]({},_0x22cb3e,_0x2c882d[_0x426e('0x40')]);return _0x474a2c[_0x426e('0x4d')](_0x22cb3e);}})['then'](function(_0x1fc803){if(_0x1fc803){_0x11abd2=_0x1fc803[_0x426e('0x37')];if(!_0x2c882d[_0x426e('0x31')][_0x426e('0x38')](_0x426e('0x39'))){_0x22cb3e[_0x426e('0x1f')]=qs['limit'](_0x2c882d[_0x426e('0x31')]['limit']);_0x22cb3e[_0x426e('0x21')]=qs[_0x426e('0x21')](_0x2c882d[_0x426e('0x31')][_0x426e('0x21')]);}return _0x474a2c[_0x426e('0x4d')](_0x22cb3e);}})[_0x426e('0x41')](function(_0x4be9aa){if(_0x4be9aa){return _0x4be9aa?{'count':_0x11abd2,'rows':_0x4be9aa}:null;}})[_0x426e('0x41')](respondWithResult(_0x508754,null))[_0x426e('0x49')](handleError(_0x508754,null));};exports['addConfiguration']=function(_0x2f4bde,_0x1579b4,_0x131b06){if(_0x2f4bde[_0x426e('0x4b')]['id']){delete _0x2f4bde['body']['id'];}return db[_0x426e('0x2e')]['findOne']({'where':{'id':_0x2f4bde[_0x426e('0x46')]['id']}})[_0x426e('0x41')](handleEntityNotFound(_0x1579b4,null))[_0x426e('0x41')](function(_0x1e660){if(_0x1e660){_0x2f4bde[_0x426e('0x4b')][_0x426e('0x4f')]=_0x1e660['id'];_0x2f4bde['body']['Subjects']=integrations[_0x426e('0x50')](_0x2f4bde[_0x426e('0x4b')][_0x426e('0x51')],_0x2f4bde[_0x426e('0x4b')][_0x426e('0x52')]);_0x2f4bde[_0x426e('0x4b')]['Descriptions']=integrations[_0x426e('0x53')](_0x2f4bde[_0x426e('0x4b')][_0x426e('0x51')],_0x2f4bde[_0x426e('0x4b')][_0x426e('0x52')]);return db[_0x426e('0x4e')][_0x426e('0x4a')](_0x2f4bde[_0x426e('0x4b')],{'include':[{'model':db[_0x426e('0x54')],'as':_0x426e('0x55')},{'model':db[_0x426e('0x54')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x1579b4,null))[_0x426e('0x49')](handleError(_0x1579b4,null));};exports[_0x426e('0x56')]=function(_0x3c3bc1,_0x5865a6,_0x4c011c){var _0x3ca7ee;var _0x2b4581='';var _0x102a82=_0x426e('0x57');return db[_0x426e('0x2e')][_0x426e('0x58')]({'where':{'id':_0x3c3bc1['params']['id']},'attributes':['id',_0x426e('0x59'),_0x426e('0x5a'),'clientSecret','username',_0x426e('0x5b'),_0x426e('0x5c')]})[_0x426e('0x41')](handleEntityNotFound(_0x5865a6,null))[_0x426e('0x41')](function(_0x4ed181){if(_0x4ed181){_0x2b4581=_0x4ed181[_0x426e('0x59')];var _0xbedd83=_0x2b4581[_0x426e('0x5d')](-0x1);if(_0xbedd83==='/'){_0x2b4581=_0x2b4581[_0x426e('0x5e')](0x0,_0x2b4581[_0x426e('0x5f')](_0xbedd83));}_0x3ca7ee=new jsforce[(_0x426e('0x60'))]({'oauth2':{'loginUrl':_0x2b4581,'clientId':_0x4ed181[_0x426e('0x5a')],'clientSecret':_0x4ed181[_0x426e('0x61')]}});return _0x3ca7ee['login'](_0x4ed181[_0x426e('0x62')],_0x4ed181[_0x426e('0x5b')][_0x426e('0x63')](_0x4ed181[_0x426e('0x5c')]));}})[_0x426e('0x41')](function(_0x31b2f3){if(_0x31b2f3){if(!_[_0x426e('0x64')](_0x3c3bc1['query'][_0x426e('0x65')])){_0x102a82=_0x3c3bc1[_0x426e('0x31')][_0x426e('0x65')];}return _0x3ca7ee[_0x426e('0x66')](_0x102a82)[_0x426e('0x67')]();}})[_0x426e('0x41')](function(_0x23cac7){var _0xe8cd2e=[_0x426e('0x68'),_0x426e('0x69'),_0x426e('0x6a'),_0x426e('0x6b'),'Subject',_0x426e('0x6c')];var _0x23a011=[_0x426e('0x6d'),'int',_0x426e('0x6e'),_0x426e('0x6f'),_0x426e('0x70'),'textarea',_0x426e('0x71')];if(_0x23cac7){_[_0x426e('0x72')](_0x23cac7['fields'],function(_0x3a65ff){return _0xe8cd2e[_0x426e('0x73')](_0x3a65ff['name'])||!_0x23a011['includes'](_0x3a65ff['type']);});return{'count':_0x23cac7[_0x426e('0x36')][_0x426e('0x37')],'rows':_['map'](_0x23cac7[_0x426e('0x36')],function(_0x1c9a9a){return{'id':_0x1c9a9a[_0x426e('0x2a')],'name':_0x1c9a9a['label'],'custom':_0x1c9a9a[_0x426e('0x74')],'options':_0x1c9a9a[_0x426e('0x75')][_0x426e('0x37')]>0x0?_[_0x426e('0x2d')](_0x1c9a9a[_0x426e('0x75')],function(_0x5dba2d){return{'name':_0x5dba2d[_0x426e('0x76')],'value':_0x5dba2d['value']};}):_0x1c9a9a[_0x426e('0x52')]==_0x426e('0x6f')?[{'name':_0x426e('0x77'),'value':_0x426e('0x78')},{'name':'False','value':_0x426e('0x79')}]:[]};})};}})[_0x426e('0x41')](respondWithResult(_0x5865a6,null))[_0x426e('0x49')](function(_0x31b895){var _0x479f4b=_0x3c3bc1[_0x426e('0x31')]['test']?0x1f4:_0x31b895['statusCode']||0x1f4;logger[_0x426e('0x28')](_0x426e('0x7a'),'getFields',_0x479f4b,JSON[_0x426e('0x7b')](_0x31b895));delete _0x31b895['name'];if(_0x479f4b===0x191){_0x479f4b=0x190;}_0x5865a6['status'](_0x479f4b)[_0x426e('0x2b')](_0x3c3bc1[_0x426e('0x31')][_0x426e('0x7c')]?{'message':_0x426e('0x7d'),'statusCode':_0x31b895[_0x426e('0x7e')]}:_0x31b895);});};
\ No newline at end of file
index 8919642..09153a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d51=['../../config/environment','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','moment','request-promise','path','rimraf'];(function(_0x5bb4e8,_0x44b756){var _0x2a86f2=function(_0x279ab2){while(--_0x279ab2){_0x5bb4e8['push'](_0x5bb4e8['shift']());}};_0x2a86f2(++_0x44b756);}(_0x7d51,0x1e9));var _0x17d5=function(_0x313aa8,_0x13c9b3){_0x313aa8=_0x313aa8-0x0;var _0x4e984d=_0x7d51[_0x313aa8];return _0x4e984d;};'use strict';var _=require(_0x17d5('0x0'));var util=require(_0x17d5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x17d5('0x2'));var BPromise=require('bluebird');var rp=require(_0x17d5('0x3'));var fs=require('fs');var path=require(_0x17d5('0x4'));var rimraf=require(_0x17d5('0x5'));var config=require(_0x17d5('0x6'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x17d5('0x7')]=function(_0x4127e2,_0x28afa2){return _0x4127e2[_0x17d5('0x8')](_0x17d5('0x9'),attributes,{'tableName':_0x17d5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd583=['../../components/integrations/configuration','SalesforceAccount','lodash','util','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x22185a,_0x2c9c0f){var _0x27e1f1=function(_0x9ed420){while(--_0x9ed420){_0x22185a['push'](_0x22185a['shift']());}};_0x27e1f1(++_0x2c9c0f);}(_0xd583,0xec));var _0x3d58=function(_0x223684,_0x47b350){_0x223684=_0x223684-0x0;var _0x40fca9=_0xd583[_0x223684];return _0x40fca9;};'use strict';var _=require(_0x3d58('0x0'));var util=require(_0x3d58('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3d58('0x2'));var BPromise=require(_0x3d58('0x3'));var rp=require(_0x3d58('0x4'));var fs=require('fs');var path=require(_0x3d58('0x5'));var rimraf=require('rimraf');var config=require(_0x3d58('0x6'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require(_0x3d58('0x7'));module['exports']=function(_0x22412c,_0x56e960){return _0x22412c['define'](_0x3d58('0x8'),attributes,{'tableName':'int_salesforce_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 085fea5..346eb2e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01c2=['request\x20sent','error','code','message','catch','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','model','map','GetSalesforceAccount','stringify','find','ShowSalesforceAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s'];(function(_0x2a3103,_0x3712f1){var _0x4d8c98=function(_0x4d6e1f){while(--_0x4d6e1f){_0x2a3103['push'](_0x2a3103['shift']());}};_0x4d8c98(++_0x3712f1);}(_0x01c2,0x17b));var _0x201c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x01c2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x201c('0x0'));var util=require(_0x201c('0x1'));var moment=require(_0x201c('0x2'));var BPromise=require(_0x201c('0x3'));var rs=require(_0x201c('0x4'));var fs=require('fs');var Redis=require(_0x201c('0x5'));var db=require(_0x201c('0x6'))['db'];var utils=require(_0x201c('0x7'));var logger=require('../../config/logger')(_0x201c('0x8'));var config=require(_0x201c('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x201c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1b92f6,_0x18e0c8,_0x375753){return new BPromise(function(_0x4f2dc1,_0x125a10){return client[_0x201c('0xb')](_0x1b92f6,_0x375753)[_0x201c('0xc')](function(_0x14f9fe){logger[_0x201c('0xd')](_0x201c('0xe'),_0x18e0c8,'request\x20sent');logger[_0x201c('0xf')](_0x201c('0x10'),_0x18e0c8,_0x201c('0x11'),JSON['stringify'](_0x14f9fe));if(_0x14f9fe[_0x201c('0x12')]){if(_0x14f9fe[_0x201c('0x12')][_0x201c('0x13')]===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x18e0c8,_0x14f9fe[_0x201c('0x12')][_0x201c('0x14')]);return _0x125a10(_0x14f9fe[_0x201c('0x12')]['message']);}logger[_0x201c('0x12')](_0x201c('0xe'),_0x18e0c8,_0x14f9fe[_0x201c('0x12')][_0x201c('0x14')]);return _0x4f2dc1(_0x14f9fe[_0x201c('0x12')][_0x201c('0x14')]);}else{logger[_0x201c('0xd')](_0x201c('0xe'),_0x18e0c8,'request\x20sent');_0x4f2dc1(_0x14f9fe['result'][_0x201c('0x14')]);}})[_0x201c('0x15')](function(_0xac1c73){logger[_0x201c('0x12')](_0x201c('0xe'),_0x18e0c8,_0xac1c73);_0x125a10(_0xac1c73);});});}exports['GetSalesforceAccount']=function(_0x10da1){var _0x2a36ef=this;return new Promise(function(_0x13a06e,_0x1fcaee){return db[_0x201c('0x16')][_0x201c('0x17')]({'raw':_0x10da1['options']?_0x10da1[_0x201c('0x18')][_0x201c('0x19')]===undefined?!![]:![]:!![],'where':_0x10da1['options']?_0x10da1[_0x201c('0x18')][_0x201c('0x1a')]||null:null,'attributes':_0x10da1[_0x201c('0x18')]?_0x10da1[_0x201c('0x18')][_0x201c('0x1b')]||null:null,'limit':_0x10da1[_0x201c('0x18')]?_0x10da1[_0x201c('0x18')][_0x201c('0x1c')]||null:null,'include':_0x10da1['options']?_0x10da1['options'][_0x201c('0x1d')]?_['map'](_0x10da1[_0x201c('0x18')][_0x201c('0x1d')],function(_0x452edb){return{'model':db[_0x452edb[_0x201c('0x1e')]],'as':_0x452edb['as'],'attributes':_0x452edb[_0x201c('0x1b')],'include':_0x452edb[_0x201c('0x1d')]?_[_0x201c('0x1f')](_0x452edb[_0x201c('0x1d')],function(_0x379654){return{'model':db[_0x379654[_0x201c('0x1e')]],'as':_0x379654['as'],'attributes':_0x379654['attributes'],'include':_0x379654['include']?_[_0x201c('0x1f')](_0x379654[_0x201c('0x1d')],function(_0x3b17b1){return{'model':db[_0x3b17b1[_0x201c('0x1e')]],'as':_0x3b17b1['as'],'attributes':_0x3b17b1[_0x201c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x201c('0xc')](function(_0x23aa08){logger['info']('GetSalesforceAccount',_0x10da1);logger[_0x201c('0xf')](_0x201c('0x20'),_0x10da1,JSON[_0x201c('0x21')](_0x23aa08));_0x13a06e(_0x23aa08);})['catch'](function(_0x4d8e96){logger[_0x201c('0x12')](_0x201c('0x20'),_0x4d8e96['message'],_0x10da1);_0x1fcaee(_0x2a36ef['error'](0x1f4,_0x4d8e96['message']));});});};exports['ShowSalesforceAccount']=function(_0x59e708){var _0x295990=this;return new Promise(function(_0x20b340,_0x39e593){return db[_0x201c('0x16')][_0x201c('0x22')]({'raw':_0x59e708[_0x201c('0x18')]?_0x59e708[_0x201c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x59e708[_0x201c('0x18')]?_0x59e708[_0x201c('0x18')]['where']||null:null,'attributes':_0x59e708[_0x201c('0x18')]?_0x59e708[_0x201c('0x18')][_0x201c('0x1b')]||null:null,'include':_0x59e708[_0x201c('0x18')]?_0x59e708[_0x201c('0x18')][_0x201c('0x1d')]?_['map'](_0x59e708[_0x201c('0x18')]['include'],function(_0x9c04d9){return{'model':db[_0x9c04d9[_0x201c('0x1e')]],'as':_0x9c04d9['as'],'attributes':_0x9c04d9[_0x201c('0x1b')],'include':_0x9c04d9[_0x201c('0x1d')]?_[_0x201c('0x1f')](_0x9c04d9['include'],function(_0x23980b){return{'model':db[_0x23980b['model']],'as':_0x23980b['as'],'attributes':_0x23980b[_0x201c('0x1b')],'include':_0x23980b['include']?_[_0x201c('0x1f')](_0x23980b[_0x201c('0x1d')],function(_0x4e3546){return{'model':db[_0x4e3546['model']],'as':_0x4e3546['as'],'attributes':_0x4e3546[_0x201c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x201c('0xc')](function(_0x9f03dd){logger[_0x201c('0xd')]('ShowSalesforceAccount',_0x59e708);logger[_0x201c('0xf')]('ShowSalesforceAccount',_0x59e708,JSON[_0x201c('0x21')](_0x9f03dd));_0x20b340(_0x9f03dd);})[_0x201c('0x15')](function(_0x429cec){logger[_0x201c('0x12')](_0x201c('0x23'),_0x429cec['message'],_0x59e708);_0x39e593(_0x295990[_0x201c('0x12')](0x1f4,_0x429cec[_0x201c('0x14')]));});});};
\ No newline at end of file
+var _0x6c56=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','SalesforceAccount,\x20%s,\x20%s','message','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','where','limit','map','include','model','attributes','stringify','ShowSalesforceAccount','raw'];(function(_0x2a4d07,_0x3664aa){var _0x3d0203=function(_0x2bde31){while(--_0x2bde31){_0x2a4d07['push'](_0x2a4d07['shift']());}};_0x3d0203(++_0x3664aa);}(_0x6c56,0xc6));var _0x66c5=function(_0xe7d07d,_0x52e4e3){_0xe7d07d=_0xe7d07d-0x0;var _0x229e46=_0x6c56[_0xe7d07d];return _0x229e46;};'use strict';var _=require(_0x66c5('0x0'));var util=require(_0x66c5('0x1'));var moment=require(_0x66c5('0x2'));var BPromise=require('bluebird');var rs=require(_0x66c5('0x3'));var fs=require('fs');var Redis=require(_0x66c5('0x4'));var db=require(_0x66c5('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x66c5('0x6'));var jayson=require(_0x66c5('0x7'));var client=jayson[_0x66c5('0x8')][_0x66c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d7950,_0x33a3de,_0x139db9){return new BPromise(function(_0x7ac8a2,_0x26fc21){return client['request'](_0x3d7950,_0x139db9)[_0x66c5('0xa')](function(_0x15beaf){logger[_0x66c5('0xb')]('SalesforceAccount,\x20%s,\x20%s',_0x33a3de,_0x66c5('0xc'));logger[_0x66c5('0xd')](_0x66c5('0xe'),_0x33a3de,_0x66c5('0xc'),JSON['stringify'](_0x15beaf));if(_0x15beaf[_0x66c5('0xf')]){if(_0x15beaf[_0x66c5('0xf')][_0x66c5('0x10')]===0x1f4){logger['error'](_0x66c5('0x11'),_0x33a3de,_0x15beaf[_0x66c5('0xf')][_0x66c5('0x12')]);return _0x26fc21(_0x15beaf[_0x66c5('0xf')][_0x66c5('0x12')]);}logger[_0x66c5('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x33a3de,_0x15beaf[_0x66c5('0xf')][_0x66c5('0x12')]);return _0x7ac8a2(_0x15beaf['error']['message']);}else{logger['info'](_0x66c5('0x11'),_0x33a3de,_0x66c5('0xc'));_0x7ac8a2(_0x15beaf['result'][_0x66c5('0x12')]);}})[_0x66c5('0x13')](function(_0x27c0ea){logger[_0x66c5('0xf')](_0x66c5('0x11'),_0x33a3de,_0x27c0ea);_0x26fc21(_0x27c0ea);});});}exports[_0x66c5('0x14')]=function(_0x35feaa){var _0x47d4ba=this;return new Promise(function(_0x1f6bba,_0x97aadc){return db[_0x66c5('0x15')][_0x66c5('0x16')]({'raw':_0x35feaa[_0x66c5('0x17')]?_0x35feaa[_0x66c5('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x35feaa[_0x66c5('0x17')]?_0x35feaa[_0x66c5('0x17')][_0x66c5('0x18')]||null:null,'attributes':_0x35feaa[_0x66c5('0x17')]?_0x35feaa['options']['attributes']||null:null,'limit':_0x35feaa['options']?_0x35feaa['options'][_0x66c5('0x19')]||null:null,'include':_0x35feaa['options']?_0x35feaa[_0x66c5('0x17')]['include']?_[_0x66c5('0x1a')](_0x35feaa[_0x66c5('0x17')][_0x66c5('0x1b')],function(_0x12c63b){return{'model':db[_0x12c63b[_0x66c5('0x1c')]],'as':_0x12c63b['as'],'attributes':_0x12c63b[_0x66c5('0x1d')],'include':_0x12c63b['include']?_['map'](_0x12c63b[_0x66c5('0x1b')],function(_0x1110ad){return{'model':db[_0x1110ad[_0x66c5('0x1c')]],'as':_0x1110ad['as'],'attributes':_0x1110ad[_0x66c5('0x1d')],'include':_0x1110ad[_0x66c5('0x1b')]?_['map'](_0x1110ad[_0x66c5('0x1b')],function(_0x157171){return{'model':db[_0x157171[_0x66c5('0x1c')]],'as':_0x157171['as'],'attributes':_0x157171['attributes']};}):[]};}):[]};}):[]:[]})[_0x66c5('0xa')](function(_0x55e870){logger[_0x66c5('0xb')]('GetSalesforceAccount',_0x35feaa);logger['debug']('GetSalesforceAccount',_0x35feaa,JSON[_0x66c5('0x1e')](_0x55e870));_0x1f6bba(_0x55e870);})[_0x66c5('0x13')](function(_0x42f78e){logger[_0x66c5('0xf')](_0x66c5('0x14'),_0x42f78e[_0x66c5('0x12')],_0x35feaa);_0x97aadc(_0x47d4ba[_0x66c5('0xf')](0x1f4,_0x42f78e[_0x66c5('0x12')]));});});};exports[_0x66c5('0x1f')]=function(_0x3571ca){var _0x5a25d7=this;return new Promise(function(_0x5a6696,_0x38dde4){return db[_0x66c5('0x15')]['find']({'raw':_0x3571ca[_0x66c5('0x17')]?_0x3571ca[_0x66c5('0x17')][_0x66c5('0x20')]===undefined?!![]:![]:!![],'where':_0x3571ca[_0x66c5('0x17')]?_0x3571ca[_0x66c5('0x17')][_0x66c5('0x18')]||null:null,'attributes':_0x3571ca['options']?_0x3571ca[_0x66c5('0x17')][_0x66c5('0x1d')]||null:null,'include':_0x3571ca[_0x66c5('0x17')]?_0x3571ca[_0x66c5('0x17')][_0x66c5('0x1b')]?_[_0x66c5('0x1a')](_0x3571ca[_0x66c5('0x17')][_0x66c5('0x1b')],function(_0x2790fb){return{'model':db[_0x2790fb['model']],'as':_0x2790fb['as'],'attributes':_0x2790fb[_0x66c5('0x1d')],'include':_0x2790fb[_0x66c5('0x1b')]?_['map'](_0x2790fb[_0x66c5('0x1b')],function(_0xd0ce2d){return{'model':db[_0xd0ce2d['model']],'as':_0xd0ce2d['as'],'attributes':_0xd0ce2d[_0x66c5('0x1d')],'include':_0xd0ce2d[_0x66c5('0x1b')]?_[_0x66c5('0x1a')](_0xd0ce2d['include'],function(_0x214311){return{'model':db[_0x214311[_0x66c5('0x1c')]],'as':_0x214311['as'],'attributes':_0x214311['attributes']};}):[]};}):[]};}):[]:[]})[_0x66c5('0xa')](function(_0x549262){logger['info']('ShowSalesforceAccount',_0x3571ca);logger[_0x66c5('0xd')](_0x66c5('0x1f'),_0x3571ca,JSON['stringify'](_0x549262));_0x5a6696(_0x549262);})[_0x66c5('0x13')](function(_0x173d81){logger['error'](_0x66c5('0x1f'),_0x173d81[_0x66c5('0x12')],_0x3571ca);_0x38dde4(_0x5a25d7['error'](0x1f4,_0x173d81[_0x66c5('0x12')]));});});};
\ No newline at end of file
index 1c0b9ed..c545faf 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(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x149f32,_0x4273f7){_0x149f32=_0x149f32-0x0;var _0x11f475=_0x0b0e[_0x149f32];return _0x11f475;};'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 _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x555c33,_0x1716d8){var _0x2a9935=function(_0x53746c){while(--_0x53746c){_0x555c33['push'](_0x555c33['shift']());}};_0x2a9935(++_0x1716d8);}(_0xadb5,0xad));var _0x5adb=function(_0x1435e6,_0x46073d){_0x1435e6=_0x1435e6-0x0;var _0x315386=_0xadb5[_0x1435e6];return _0x315386;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router;
\ No newline at end of file
index 5803b03..73eb28a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd34c=['nothing','lead','exports','STRING','ENUM','Task','contact_lead','contact','account'];(function(_0x5b74b2,_0x34430b){var _0x4c4581=function(_0x204c62){while(--_0x204c62){_0x5b74b2['push'](_0x5b74b2['shift']());}};_0x4c4581(++_0x34430b);}(_0xd34c,0x1cd));var _0xcd34=function(_0x4ebd99,_0xb49d24){_0x4ebd99=_0x4ebd99-0x0;var _0x53eb6b=_0xd34c[_0x4ebd99];return _0x53eb6b;};'use strict';var Sequelize=require('sequelize');module[_0xcd34('0x0')]={'name':{'type':Sequelize[_0xcd34('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xcd34('0x2')](_0xcd34('0x3'),'Case'),'defaultValue':_0xcd34('0x3')},'moduleSearch':{'type':Sequelize[_0xcd34('0x2')](_0xcd34('0x4'),_0xcd34('0x5'),'lead','account_contact_lead',_0xcd34('0x6')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xcd34('0x2')](_0xcd34('0x7'),_0xcd34('0x5'),_0xcd34('0x8'),_0xcd34('0x6')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0xcd34('0x1')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb162=['ENUM','Task','Case','contact_lead','contact','lead','account','nothing','sequelize','exports','STRING'];(function(_0x31f564,_0x265a48){var _0x1a853b=function(_0x49cad5){while(--_0x49cad5){_0x31f564['push'](_0x31f564['shift']());}};_0x1a853b(++_0x265a48);}(_0xb162,0x110));var _0x2b16=function(_0x47b136,_0x54f632){_0x47b136=_0x47b136-0x0;var _0x4ed731=_0xb162[_0x47b136];return _0x4ed731;};'use strict';var Sequelize=require(_0x2b16('0x0'));module[_0x2b16('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2b16('0x2')]},'ticketType':{'type':Sequelize[_0x2b16('0x3')](_0x2b16('0x4'),_0x2b16('0x5')),'defaultValue':_0x2b16('0x4')},'moduleSearch':{'type':Sequelize[_0x2b16('0x3')](_0x2b16('0x6'),_0x2b16('0x7'),_0x2b16('0x8'),'account_contact_lead',_0x2b16('0x9')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize['ENUM'](_0x2b16('0xa'),_0x2b16('0x7'),_0x2b16('0x8'),'account'),'defaultValue':_0x2b16('0x8')},'leadId':{'type':Sequelize[_0x2b16('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0x2b16('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x2b16('0x2')]}};
\ No newline at end of file
index 3dc9338..3234a56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1fca=['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','undefined','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','SalesforceConfiguration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','show','params','rawAttributes','find','create','body','catch','getFields','findOne','getSubjects','SalesforceField','getDescriptions','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring'];(function(_0x917159,_0x4920a8){var _0x2bd31e=function(_0x6dce0e){while(--_0x6dce0e){_0x917159['push'](_0x917159['shift']());}};_0x2bd31e(++_0x4920a8);}(_0x1fca,0x138));var _0xa1fc=function(_0xa18e4,_0x4b7825){_0xa18e4=_0xa18e4-0x0;var _0x751ac8=_0x1fca[_0xa18e4];return _0x751ac8;};'use strict';var emlformat=require(_0xa1fc('0x0'));var rimraf=require(_0xa1fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa1fc('0x2'));var moment=require(_0xa1fc('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa1fc('0x4'));var util=require(_0xa1fc('0x5'));var path=require(_0xa1fc('0x6'));var sox=require(_0xa1fc('0x7'));var csv=require(_0xa1fc('0x8'));var ejs=require(_0xa1fc('0x9'));var fs=require('fs');var fs_extra=require(_0xa1fc('0xa'));var _=require(_0xa1fc('0xb'));var squel=require(_0xa1fc('0xc'));var crypto=require(_0xa1fc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa1fc('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa1fc('0xf'));var Papa=require(_0xa1fc('0x10'));var Redis=require(_0xa1fc('0x11'));var authService=require(_0xa1fc('0x12'));var qs=require(_0xa1fc('0x13'));var as=require(_0xa1fc('0x14'));var hardwareService=require(_0xa1fc('0x15'));var logger=require(_0xa1fc('0x16'))(_0xa1fc('0x17'));var utils=require(_0xa1fc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xa1fc('0x19'));var db=require(_0xa1fc('0x1a'))['db'];function respondWithStatusCode(_0x3d05f3,_0x28de26){_0x28de26=_0x28de26||0xcc;return function(_0x5be976){if(_0x5be976){return _0x3d05f3[_0xa1fc('0x1b')](_0x28de26);}return _0x3d05f3['status'](_0x28de26)[_0xa1fc('0x1c')]();};}function respondWithResult(_0x5dc940,_0xd2cae8){_0xd2cae8=_0xd2cae8||0xc8;return function(_0x4db77f){if(_0x4db77f){return _0x5dc940[_0xa1fc('0x1d')](_0xd2cae8)['json'](_0x4db77f);}};}function respondWithFilteredResult(_0x4d645f,_0x9d82a1){return function(_0x24b3b7){if(_0x24b3b7){var _0x267f65=typeof _0x9d82a1['offset']==='undefined'&&typeof _0x9d82a1['limit']===_0xa1fc('0x1e');var _0x49d81a=_0x24b3b7[_0xa1fc('0x1f')];var _0x489e92=_0x267f65?0x0:_0x9d82a1['offset'];var _0x537839=_0x267f65?_0x24b3b7[_0xa1fc('0x1f')]:_0x9d82a1[_0xa1fc('0x20')]+_0x9d82a1[_0xa1fc('0x21')];var _0x29f3ea;if(_0x537839>=_0x49d81a){_0x537839=_0x49d81a;_0x29f3ea=0xc8;}else{_0x29f3ea=0xce;}_0x4d645f[_0xa1fc('0x1d')](_0x29f3ea);return _0x4d645f[_0xa1fc('0x22')](_0xa1fc('0x23'),_0x489e92+'-'+_0x537839+'/'+_0x49d81a)['json'](_0x24b3b7);}return null;};}function patchUpdates(_0x3a3f36){return function(_0x195aa4){try{jsonpatch['apply'](_0x195aa4,_0x3a3f36,!![]);}catch(_0x17fe8f){return BPromise[_0xa1fc('0x24')](_0x17fe8f);}return _0x195aa4[_0xa1fc('0x25')]();};}function saveUpdates(_0x52ce54,_0x9b5d9c){return function(_0x6a54bd){if(_0x6a54bd){return _0x6a54bd[_0xa1fc('0x26')](_0x52ce54)[_0xa1fc('0x27')](function(_0x39aab5){return _0x39aab5;});}return null;};}function removeEntity(_0x1074b1,_0x35b004){return function(_0x384aec){if(_0x384aec){return _0x384aec[_0xa1fc('0x28')]()['then'](function(){_0x1074b1[_0xa1fc('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x34211c,_0x46286c){return function(_0x39e608){if(!_0x39e608){_0x34211c[_0xa1fc('0x1b')](0x194);}return _0x39e608;};}function handleError(_0x521d9e,_0x33f3c4){_0x33f3c4=_0x33f3c4||0x1f4;return function(_0x48bdbe){logger['error'](_0x48bdbe[_0xa1fc('0x29')]);if(_0x48bdbe[_0xa1fc('0x2a')]){delete _0x48bdbe['name'];}_0x521d9e[_0xa1fc('0x1d')](_0x33f3c4)[_0xa1fc('0x2b')](_0x48bdbe);};}exports[_0xa1fc('0x2c')]=function(_0x16463b,_0x59027e){var _0x1719dc={},_0x4b74db={},_0x3533fb={'count':0x0,'rows':[]};var _0x525816=_[_0xa1fc('0x2d')](db[_0xa1fc('0x2e')]['rawAttributes'],function(_0x56e6af){return{'name':_0x56e6af[_0xa1fc('0x2f')],'type':_0x56e6af[_0xa1fc('0x30')][_0xa1fc('0x31')]};});_0x4b74db[_0xa1fc('0x32')]=_[_0xa1fc('0x2d')](_0x525816,_0xa1fc('0x2a'));_0x4b74db[_0xa1fc('0x33')]=_[_0xa1fc('0x34')](_0x16463b[_0xa1fc('0x33')]);_0x4b74db[_0xa1fc('0x35')]=_[_0xa1fc('0x36')](_0x4b74db['model'],_0x4b74db[_0xa1fc('0x33')]);_0x1719dc[_0xa1fc('0x37')]=_['intersection'](_0x4b74db[_0xa1fc('0x32')],qs[_0xa1fc('0x38')](_0x16463b['query'][_0xa1fc('0x38')]));_0x1719dc[_0xa1fc('0x37')]=_0x1719dc[_0xa1fc('0x37')][_0xa1fc('0x39')]?_0x1719dc[_0xa1fc('0x37')]:_0x4b74db[_0xa1fc('0x32')];if(!_0x16463b[_0xa1fc('0x33')][_0xa1fc('0x3a')](_0xa1fc('0x3b'))){_0x1719dc[_0xa1fc('0x21')]=qs['limit'](_0x16463b[_0xa1fc('0x33')]['limit']);_0x1719dc[_0xa1fc('0x20')]=qs[_0xa1fc('0x20')](_0x16463b[_0xa1fc('0x33')]['offset']);}_0x1719dc[_0xa1fc('0x3c')]=qs[_0xa1fc('0x3d')](_0x16463b[_0xa1fc('0x33')]['sort']);_0x1719dc[_0xa1fc('0x3e')]=qs['filters'](_[_0xa1fc('0x3f')](_0x16463b[_0xa1fc('0x33')],_0x4b74db['filters']),_0x525816);if(_0x16463b[_0xa1fc('0x33')][_0xa1fc('0x40')]){_0x1719dc[_0xa1fc('0x3e')]=_[_0xa1fc('0x41')](_0x1719dc[_0xa1fc('0x3e')],{'$or':_['map'](_0x525816,function(_0x317395){if(_0x317395['type']!==_0xa1fc('0x42')){var _0x346713={};_0x346713[_0x317395['name']]={'$like':'%'+_0x16463b[_0xa1fc('0x33')][_0xa1fc('0x40')]+'%'};return _0x346713;}})});}_0x1719dc=_[_0xa1fc('0x41')]({},_0x1719dc,_0x16463b[_0xa1fc('0x43')]);var _0x3ea6d8={'where':_0x1719dc[_0xa1fc('0x3e')]};return db['SalesforceConfiguration'][_0xa1fc('0x1f')](_0x3ea6d8)[_0xa1fc('0x27')](function(_0x3eea4c){_0x3533fb[_0xa1fc('0x1f')]=_0x3eea4c;if(_0x16463b[_0xa1fc('0x33')][_0xa1fc('0x44')]){_0x1719dc[_0xa1fc('0x45')]=[{'all':!![]}];}return db[_0xa1fc('0x2e')]['findAll'](_0x1719dc);})[_0xa1fc('0x27')](function(_0x1dcab2){_0x3533fb['rows']=_0x1dcab2;return _0x3533fb;})[_0xa1fc('0x27')](respondWithFilteredResult(_0x59027e,_0x1719dc))['catch'](handleError(_0x59027e,null));};exports[_0xa1fc('0x46')]=function(_0x237a5a,_0xa054e1){var _0x294591={'raw':![],'where':{'id':_0x237a5a[_0xa1fc('0x47')]['id']}},_0x52af01={};_0x52af01[_0xa1fc('0x32')]=_[_0xa1fc('0x34')](db[_0xa1fc('0x2e')][_0xa1fc('0x48')]);_0x52af01[_0xa1fc('0x33')]=_['keys'](_0x237a5a[_0xa1fc('0x33')]);_0x52af01['filters']=_[_0xa1fc('0x36')](_0x52af01['model'],_0x52af01[_0xa1fc('0x33')]);_0x294591[_0xa1fc('0x37')]=_['intersection'](_0x52af01[_0xa1fc('0x32')],qs['fields'](_0x237a5a['query']['fields']));_0x294591['attributes']=_0x294591[_0xa1fc('0x37')][_0xa1fc('0x39')]?_0x294591['attributes']:_0x52af01['model'];if(_0x237a5a[_0xa1fc('0x33')]['includeAll']){_0x294591[_0xa1fc('0x45')]=[{'all':!![]}];}_0x294591=_[_0xa1fc('0x41')]({},_0x294591,_0x237a5a['options']);return db[_0xa1fc('0x2e')][_0xa1fc('0x49')](_0x294591)[_0xa1fc('0x27')](handleEntityNotFound(_0xa054e1,null))[_0xa1fc('0x27')](respondWithResult(_0xa054e1,null))['catch'](handleError(_0xa054e1,null));};exports[_0xa1fc('0x4a')]=function(_0x4eb5f1,_0x5d6ea7){return db[_0xa1fc('0x2e')]['create'](_0x4eb5f1[_0xa1fc('0x4b')],{})['then'](respondWithResult(_0x5d6ea7,0xc9))[_0xa1fc('0x4c')](handleError(_0x5d6ea7,null));};exports[_0xa1fc('0x26')]=function(_0x1f2853,_0x486130){if(_0x1f2853['body']['id']){delete _0x1f2853[_0xa1fc('0x4b')]['id'];}return db[_0xa1fc('0x2e')][_0xa1fc('0x49')]({'where':{'id':_0x1f2853['params']['id']}})['then'](handleEntityNotFound(_0x486130,null))['then'](saveUpdates(_0x1f2853['body'],null))['then'](respondWithResult(_0x486130,null))[_0xa1fc('0x4c')](handleError(_0x486130,null));};exports[_0xa1fc('0x28')]=function(_0x4d2424,_0x4f274a){return db[_0xa1fc('0x2e')][_0xa1fc('0x49')]({'where':{'id':_0x4d2424[_0xa1fc('0x47')]['id']}})[_0xa1fc('0x27')](handleEntityNotFound(_0x4f274a,null))[_0xa1fc('0x27')](removeEntity(_0x4f274a,null))[_0xa1fc('0x4c')](handleError(_0x4f274a,null));};exports[_0xa1fc('0x4d')]=function(_0x626a33,_0x59d6da,_0x34cf8f){var _0x5adf52={};var _0x1ff927={};var _0x32f467;var _0x271642;return db[_0xa1fc('0x2e')][_0xa1fc('0x4e')]({'where':{'id':_0x626a33[_0xa1fc('0x47')]['id']}})['then'](handleEntityNotFound(_0x59d6da,null))[_0xa1fc('0x27')](function(_0x56d59b){if(_0x56d59b){_0x32f467=_0x56d59b;_0x1ff927['model']=_[_0xa1fc('0x34')](db['SalesforceField'][_0xa1fc('0x48')]);_0x1ff927[_0xa1fc('0x33')]=_['keys'](_0x626a33[_0xa1fc('0x33')]);_0x1ff927[_0xa1fc('0x35')]=_[_0xa1fc('0x36')](_0x1ff927[_0xa1fc('0x32')],_0x1ff927[_0xa1fc('0x33')]);_0x5adf52[_0xa1fc('0x37')]=_['intersection'](_0x1ff927[_0xa1fc('0x32')],qs[_0xa1fc('0x38')](_0x626a33[_0xa1fc('0x33')]['fields']));_0x5adf52[_0xa1fc('0x37')]=_0x5adf52[_0xa1fc('0x37')][_0xa1fc('0x39')]?_0x5adf52[_0xa1fc('0x37')]:_0x1ff927[_0xa1fc('0x32')];_0x5adf52[_0xa1fc('0x3c')]=qs['sort'](_0x626a33[_0xa1fc('0x33')][_0xa1fc('0x3d')]);_0x5adf52[_0xa1fc('0x3e')]=qs[_0xa1fc('0x35')](_['pick'](_0x626a33[_0xa1fc('0x33')],_0x1ff927['filters']));if(_0x626a33[_0xa1fc('0x33')][_0xa1fc('0x40')]){_0x5adf52[_0xa1fc('0x3e')]=_[_0xa1fc('0x41')](_0x5adf52[_0xa1fc('0x3e')],{'$or':_[_0xa1fc('0x2d')](_0x5adf52[_0xa1fc('0x37')],function(_0x2b2758){var _0xea7786={};_0xea7786[_0x2b2758]={'$like':'%'+_0x626a33[_0xa1fc('0x33')][_0xa1fc('0x40')]+'%'};return _0xea7786;})});}_0x5adf52=_[_0xa1fc('0x41')]({},_0x5adf52,_0x626a33[_0xa1fc('0x43')]);return _0x32f467[_0xa1fc('0x4d')](_0x5adf52);}})['then'](function(_0x13b3ae){if(_0x13b3ae){_0x271642=_0x13b3ae[_0xa1fc('0x39')];if(!_0x626a33[_0xa1fc('0x33')][_0xa1fc('0x3a')](_0xa1fc('0x3b'))){_0x5adf52[_0xa1fc('0x21')]=qs[_0xa1fc('0x21')](_0x626a33[_0xa1fc('0x33')][_0xa1fc('0x21')]);_0x5adf52['offset']=qs[_0xa1fc('0x20')](_0x626a33['query'][_0xa1fc('0x20')]);}return _0x32f467[_0xa1fc('0x4d')](_0x5adf52);}})[_0xa1fc('0x27')](function(_0x416db6){if(_0x416db6){return _0x416db6?{'count':_0x271642,'rows':_0x416db6}:null;}})[_0xa1fc('0x27')](respondWithResult(_0x59d6da,null))[_0xa1fc('0x4c')](handleError(_0x59d6da,null));};exports[_0xa1fc('0x4f')]=function(_0x4b8573,_0x56bffc,_0x21cc5c){var _0x43e7b1={};var _0x3f64c3={};var _0x5c2261;var _0x4bb8ec;return db['SalesforceConfiguration'][_0xa1fc('0x4e')]({'where':{'id':_0x4b8573[_0xa1fc('0x47')]['id']}})[_0xa1fc('0x27')](handleEntityNotFound(_0x56bffc,null))[_0xa1fc('0x27')](function(_0x3efd46){if(_0x3efd46){_0x5c2261=_0x3efd46;_0x3f64c3['model']=_['keys'](db[_0xa1fc('0x50')]['rawAttributes']);_0x3f64c3[_0xa1fc('0x33')]=_[_0xa1fc('0x34')](_0x4b8573[_0xa1fc('0x33')]);_0x3f64c3[_0xa1fc('0x35')]=_[_0xa1fc('0x36')](_0x3f64c3[_0xa1fc('0x32')],_0x3f64c3['query']);_0x43e7b1[_0xa1fc('0x37')]=_[_0xa1fc('0x36')](_0x3f64c3[_0xa1fc('0x32')],qs[_0xa1fc('0x38')](_0x4b8573['query']['fields']));_0x43e7b1['attributes']=_0x43e7b1[_0xa1fc('0x37')]['length']?_0x43e7b1[_0xa1fc('0x37')]:_0x3f64c3[_0xa1fc('0x32')];_0x43e7b1[_0xa1fc('0x3c')]=qs[_0xa1fc('0x3d')](_0x4b8573[_0xa1fc('0x33')][_0xa1fc('0x3d')]);_0x43e7b1['where']=qs[_0xa1fc('0x35')](_[_0xa1fc('0x3f')](_0x4b8573['query'],_0x3f64c3[_0xa1fc('0x35')]));if(_0x4b8573[_0xa1fc('0x33')][_0xa1fc('0x40')]){_0x43e7b1[_0xa1fc('0x3e')]=_[_0xa1fc('0x41')](_0x43e7b1['where'],{'$or':_[_0xa1fc('0x2d')](_0x43e7b1[_0xa1fc('0x37')],function(_0x1ad7d0){var _0x4a62ea={};_0x4a62ea[_0x1ad7d0]={'$like':'%'+_0x4b8573[_0xa1fc('0x33')][_0xa1fc('0x40')]+'%'};return _0x4a62ea;})});}_0x43e7b1=_['merge']({},_0x43e7b1,_0x4b8573[_0xa1fc('0x43')]);return _0x5c2261[_0xa1fc('0x4f')](_0x43e7b1);}})['then'](function(_0xdc0104){if(_0xdc0104){_0x4bb8ec=_0xdc0104[_0xa1fc('0x39')];if(!_0x4b8573[_0xa1fc('0x33')][_0xa1fc('0x3a')](_0xa1fc('0x3b'))){_0x43e7b1[_0xa1fc('0x21')]=qs['limit'](_0x4b8573[_0xa1fc('0x33')]['limit']);_0x43e7b1['offset']=qs[_0xa1fc('0x20')](_0x4b8573[_0xa1fc('0x33')][_0xa1fc('0x20')]);}return _0x5c2261[_0xa1fc('0x4f')](_0x43e7b1);}})[_0xa1fc('0x27')](function(_0x571398){if(_0x571398){return _0x571398?{'count':_0x4bb8ec,'rows':_0x571398}:null;}})[_0xa1fc('0x27')](respondWithResult(_0x56bffc,null))[_0xa1fc('0x4c')](handleError(_0x56bffc,null));};exports[_0xa1fc('0x51')]=function(_0x5aa524,_0x1775e9,_0x35a681){var _0x39ca65={};var _0x1e9da5={};var _0x11fa55;var _0x34aef7;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x5aa524[_0xa1fc('0x47')]['id']}})[_0xa1fc('0x27')](handleEntityNotFound(_0x1775e9,null))[_0xa1fc('0x27')](function(_0x45368c){if(_0x45368c){_0x11fa55=_0x45368c;_0x1e9da5['model']=_['keys'](db[_0xa1fc('0x50')][_0xa1fc('0x48')]);_0x1e9da5[_0xa1fc('0x33')]=_[_0xa1fc('0x34')](_0x5aa524[_0xa1fc('0x33')]);_0x1e9da5[_0xa1fc('0x35')]=_[_0xa1fc('0x36')](_0x1e9da5['model'],_0x1e9da5['query']);_0x39ca65['attributes']=_[_0xa1fc('0x36')](_0x1e9da5[_0xa1fc('0x32')],qs[_0xa1fc('0x38')](_0x5aa524[_0xa1fc('0x33')][_0xa1fc('0x38')]));_0x39ca65[_0xa1fc('0x37')]=_0x39ca65[_0xa1fc('0x37')][_0xa1fc('0x39')]?_0x39ca65[_0xa1fc('0x37')]:_0x1e9da5[_0xa1fc('0x32')];_0x39ca65[_0xa1fc('0x3c')]=qs['sort'](_0x5aa524[_0xa1fc('0x33')][_0xa1fc('0x3d')]);_0x39ca65[_0xa1fc('0x3e')]=qs[_0xa1fc('0x35')](_[_0xa1fc('0x3f')](_0x5aa524['query'],_0x1e9da5[_0xa1fc('0x35')]));if(_0x5aa524[_0xa1fc('0x33')][_0xa1fc('0x40')]){_0x39ca65['where']=_[_0xa1fc('0x41')](_0x39ca65[_0xa1fc('0x3e')],{'$or':_[_0xa1fc('0x2d')](_0x39ca65[_0xa1fc('0x37')],function(_0x260e88){var _0x5bb263={};_0x5bb263[_0x260e88]={'$like':'%'+_0x5aa524['query'][_0xa1fc('0x40')]+'%'};return _0x5bb263;})});}_0x39ca65=_[_0xa1fc('0x41')]({},_0x39ca65,_0x5aa524['options']);return _0x11fa55['getDescriptions'](_0x39ca65);}})[_0xa1fc('0x27')](function(_0x2d0d20){if(_0x2d0d20){_0x34aef7=_0x2d0d20[_0xa1fc('0x39')];if(!_0x5aa524[_0xa1fc('0x33')][_0xa1fc('0x3a')](_0xa1fc('0x3b'))){_0x39ca65[_0xa1fc('0x21')]=qs[_0xa1fc('0x21')](_0x5aa524[_0xa1fc('0x33')][_0xa1fc('0x21')]);_0x39ca65[_0xa1fc('0x20')]=qs[_0xa1fc('0x20')](_0x5aa524[_0xa1fc('0x33')][_0xa1fc('0x20')]);}return _0x11fa55[_0xa1fc('0x51')](_0x39ca65);}})[_0xa1fc('0x27')](function(_0x315998){if(_0x315998){return _0x315998?{'count':_0x34aef7,'rows':_0x315998}:null;}})['then'](respondWithResult(_0x1775e9,null))['catch'](handleError(_0x1775e9,null));};
\ No newline at end of file
+var _0x19d1=['index','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','SalesforceConfiguration','includeAll','include','findAll','rows','catch','options','find','create','body','params','destroy','getFields','findOne','keys','hasOwnProperty','getSubjects','SalesforceField','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send'];(function(_0x144de1,_0x17cf0b){var _0x82c145=function(_0x586d5c){while(--_0x586d5c){_0x144de1['push'](_0x144de1['shift']());}};_0x82c145(++_0x17cf0b);}(_0x19d1,0x16c));var _0x119d=function(_0x436955,_0x1fe898){_0x436955=_0x436955-0x0;var _0x3e3c47=_0x19d1[_0x436955];return _0x3e3c47;};'use strict';var emlformat=require(_0x119d('0x0'));var rimraf=require(_0x119d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x119d('0x2'));var rp=require(_0x119d('0x3'));var moment=require(_0x119d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x119d('0x5'));var util=require('util');var path=require(_0x119d('0x6'));var sox=require(_0x119d('0x7'));var csv=require(_0x119d('0x8'));var ejs=require(_0x119d('0x9'));var fs=require('fs');var fs_extra=require(_0x119d('0xa'));var _=require(_0x119d('0xb'));var squel=require(_0x119d('0xc'));var crypto=require('crypto');var jsforce=require(_0x119d('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x119d('0xe'));var Redis=require(_0x119d('0xf'));var authService=require(_0x119d('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x119d('0x11'));var hardwareService=require(_0x119d('0x12'));var logger=require(_0x119d('0x13'))(_0x119d('0x14'));var utils=require(_0x119d('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x119d('0x16'))['db'];function respondWithStatusCode(_0x5148d9,_0x278e87){_0x278e87=_0x278e87||0xcc;return function(_0x463344){if(_0x463344){return _0x5148d9['sendStatus'](_0x278e87);}return _0x5148d9[_0x119d('0x17')](_0x278e87)[_0x119d('0x18')]();};}function respondWithResult(_0x410b3c,_0xf0a428){_0xf0a428=_0xf0a428||0xc8;return function(_0x3dbd0a){if(_0x3dbd0a){return _0x410b3c[_0x119d('0x17')](_0xf0a428)[_0x119d('0x19')](_0x3dbd0a);}};}function respondWithFilteredResult(_0x171b8c,_0x1b6557){return function(_0x35bca0){if(_0x35bca0){var _0x58a0aa=typeof _0x1b6557[_0x119d('0x1a')]===_0x119d('0x1b')&&typeof _0x1b6557['limit']==='undefined';var _0x2f1830=_0x35bca0['count'];var _0x3213d7=_0x58a0aa?0x0:_0x1b6557[_0x119d('0x1a')];var _0x2a528d=_0x58a0aa?_0x35bca0[_0x119d('0x1c')]:_0x1b6557[_0x119d('0x1a')]+_0x1b6557['limit'];var _0x30c8a9;if(_0x2a528d>=_0x2f1830){_0x2a528d=_0x2f1830;_0x30c8a9=0xc8;}else{_0x30c8a9=0xce;}_0x171b8c[_0x119d('0x17')](_0x30c8a9);return _0x171b8c[_0x119d('0x1d')](_0x119d('0x1e'),_0x3213d7+'-'+_0x2a528d+'/'+_0x2f1830)['json'](_0x35bca0);}return null;};}function patchUpdates(_0x13ebc2){return function(_0x2dcc6a){try{jsonpatch[_0x119d('0x1f')](_0x2dcc6a,_0x13ebc2,!![]);}catch(_0x2d5d5c){return BPromise[_0x119d('0x20')](_0x2d5d5c);}return _0x2dcc6a[_0x119d('0x21')]();};}function saveUpdates(_0x4e8b8a,_0x1e6819){return function(_0xd814b7){if(_0xd814b7){return _0xd814b7[_0x119d('0x22')](_0x4e8b8a)[_0x119d('0x23')](function(_0x1593c2){return _0x1593c2;});}return null;};}function removeEntity(_0x51e0c3,_0x8eb0c8){return function(_0x265b76){if(_0x265b76){return _0x265b76['destroy']()[_0x119d('0x23')](function(){_0x51e0c3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x362e2b,_0x477519){return function(_0xe2a31d){if(!_0xe2a31d){_0x362e2b[_0x119d('0x24')](0x194);}return _0xe2a31d;};}function handleError(_0x4a8619,_0x257935){_0x257935=_0x257935||0x1f4;return function(_0x4c015f){logger[_0x119d('0x25')](_0x4c015f[_0x119d('0x26')]);if(_0x4c015f[_0x119d('0x27')]){delete _0x4c015f[_0x119d('0x27')];}_0x4a8619[_0x119d('0x17')](_0x257935)[_0x119d('0x28')](_0x4c015f);};}exports[_0x119d('0x29')]=function(_0x4db9a8,_0xbbf6a5){var _0x4bafab={},_0x542b57={},_0xd12633={'count':0x0,'rows':[]};var _0x3549fa=_[_0x119d('0x2a')](db['SalesforceConfiguration'][_0x119d('0x2b')],function(_0x43a8c2){return{'name':_0x43a8c2[_0x119d('0x2c')],'type':_0x43a8c2[_0x119d('0x2d')]['key']};});_0x542b57[_0x119d('0x2e')]=_[_0x119d('0x2a')](_0x3549fa,_0x119d('0x27'));_0x542b57[_0x119d('0x2f')]=_['keys'](_0x4db9a8[_0x119d('0x2f')]);_0x542b57['filters']=_[_0x119d('0x30')](_0x542b57['model'],_0x542b57[_0x119d('0x2f')]);_0x4bafab[_0x119d('0x31')]=_[_0x119d('0x30')](_0x542b57[_0x119d('0x2e')],qs[_0x119d('0x32')](_0x4db9a8[_0x119d('0x2f')][_0x119d('0x32')]));_0x4bafab[_0x119d('0x31')]=_0x4bafab[_0x119d('0x31')][_0x119d('0x33')]?_0x4bafab['attributes']:_0x542b57['model'];if(!_0x4db9a8[_0x119d('0x2f')]['hasOwnProperty'](_0x119d('0x34'))){_0x4bafab[_0x119d('0x35')]=qs['limit'](_0x4db9a8[_0x119d('0x2f')][_0x119d('0x35')]);_0x4bafab[_0x119d('0x1a')]=qs[_0x119d('0x1a')](_0x4db9a8['query'][_0x119d('0x1a')]);}_0x4bafab[_0x119d('0x36')]=qs['sort'](_0x4db9a8[_0x119d('0x2f')][_0x119d('0x37')]);_0x4bafab[_0x119d('0x38')]=qs[_0x119d('0x39')](_[_0x119d('0x3a')](_0x4db9a8[_0x119d('0x2f')],_0x542b57[_0x119d('0x39')]),_0x3549fa);if(_0x4db9a8[_0x119d('0x2f')][_0x119d('0x3b')]){_0x4bafab[_0x119d('0x38')]=_[_0x119d('0x3c')](_0x4bafab[_0x119d('0x38')],{'$or':_[_0x119d('0x2a')](_0x3549fa,function(_0x237ee4){if(_0x237ee4[_0x119d('0x2d')]!==_0x119d('0x3d')){var _0x4e9556={};_0x4e9556[_0x237ee4[_0x119d('0x27')]]={'$like':'%'+_0x4db9a8[_0x119d('0x2f')]['filter']+'%'};return _0x4e9556;}})});}_0x4bafab=_[_0x119d('0x3c')]({},_0x4bafab,_0x4db9a8['options']);var _0x17ec01={'where':_0x4bafab[_0x119d('0x38')]};return db[_0x119d('0x3e')][_0x119d('0x1c')](_0x17ec01)['then'](function(_0x2bb37e){_0xd12633[_0x119d('0x1c')]=_0x2bb37e;if(_0x4db9a8[_0x119d('0x2f')][_0x119d('0x3f')]){_0x4bafab[_0x119d('0x40')]=[{'all':!![]}];}return db[_0x119d('0x3e')][_0x119d('0x41')](_0x4bafab);})[_0x119d('0x23')](function(_0x37abd2){_0xd12633[_0x119d('0x42')]=_0x37abd2;return _0xd12633;})[_0x119d('0x23')](respondWithFilteredResult(_0xbbf6a5,_0x4bafab))[_0x119d('0x43')](handleError(_0xbbf6a5,null));};exports['show']=function(_0x47da19,_0x1985a1){var _0x29981b={'raw':![],'where':{'id':_0x47da19['params']['id']}},_0x1dba98={};_0x1dba98['model']=_['keys'](db[_0x119d('0x3e')]['rawAttributes']);_0x1dba98[_0x119d('0x2f')]=_['keys'](_0x47da19[_0x119d('0x2f')]);_0x1dba98[_0x119d('0x39')]=_[_0x119d('0x30')](_0x1dba98[_0x119d('0x2e')],_0x1dba98[_0x119d('0x2f')]);_0x29981b[_0x119d('0x31')]=_[_0x119d('0x30')](_0x1dba98[_0x119d('0x2e')],qs[_0x119d('0x32')](_0x47da19[_0x119d('0x2f')]['fields']));_0x29981b[_0x119d('0x31')]=_0x29981b[_0x119d('0x31')][_0x119d('0x33')]?_0x29981b[_0x119d('0x31')]:_0x1dba98[_0x119d('0x2e')];if(_0x47da19[_0x119d('0x2f')][_0x119d('0x3f')]){_0x29981b['include']=[{'all':!![]}];}_0x29981b=_[_0x119d('0x3c')]({},_0x29981b,_0x47da19[_0x119d('0x44')]);return db['SalesforceConfiguration'][_0x119d('0x45')](_0x29981b)[_0x119d('0x23')](handleEntityNotFound(_0x1985a1,null))[_0x119d('0x23')](respondWithResult(_0x1985a1,null))['catch'](handleError(_0x1985a1,null));};exports['create']=function(_0x4b34fa,_0xa513ae){return db[_0x119d('0x3e')][_0x119d('0x46')](_0x4b34fa[_0x119d('0x47')],{})[_0x119d('0x23')](respondWithResult(_0xa513ae,0xc9))[_0x119d('0x43')](handleError(_0xa513ae,null));};exports[_0x119d('0x22')]=function(_0x43f6b0,_0x1e3386){if(_0x43f6b0[_0x119d('0x47')]['id']){delete _0x43f6b0[_0x119d('0x47')]['id'];}return db[_0x119d('0x3e')][_0x119d('0x45')]({'where':{'id':_0x43f6b0[_0x119d('0x48')]['id']}})[_0x119d('0x23')](handleEntityNotFound(_0x1e3386,null))[_0x119d('0x23')](saveUpdates(_0x43f6b0[_0x119d('0x47')],null))[_0x119d('0x23')](respondWithResult(_0x1e3386,null))['catch'](handleError(_0x1e3386,null));};exports[_0x119d('0x49')]=function(_0x370146,_0x21e9ba){return db[_0x119d('0x3e')][_0x119d('0x45')]({'where':{'id':_0x370146[_0x119d('0x48')]['id']}})[_0x119d('0x23')](handleEntityNotFound(_0x21e9ba,null))[_0x119d('0x23')](removeEntity(_0x21e9ba,null))[_0x119d('0x43')](handleError(_0x21e9ba,null));};exports[_0x119d('0x4a')]=function(_0x47072c,_0x1a7222,_0x38d25d){var _0x56f0a1={};var _0x424163={};var _0x56158b;var _0x7f4f80;return db[_0x119d('0x3e')][_0x119d('0x4b')]({'where':{'id':_0x47072c[_0x119d('0x48')]['id']}})['then'](handleEntityNotFound(_0x1a7222,null))[_0x119d('0x23')](function(_0x44b77f){if(_0x44b77f){_0x56158b=_0x44b77f;_0x424163[_0x119d('0x2e')]=_[_0x119d('0x4c')](db['SalesforceField'][_0x119d('0x2b')]);_0x424163[_0x119d('0x2f')]=_[_0x119d('0x4c')](_0x47072c[_0x119d('0x2f')]);_0x424163[_0x119d('0x39')]=_[_0x119d('0x30')](_0x424163[_0x119d('0x2e')],_0x424163['query']);_0x56f0a1[_0x119d('0x31')]=_['intersection'](_0x424163[_0x119d('0x2e')],qs[_0x119d('0x32')](_0x47072c['query'][_0x119d('0x32')]));_0x56f0a1['attributes']=_0x56f0a1['attributes'][_0x119d('0x33')]?_0x56f0a1[_0x119d('0x31')]:_0x424163[_0x119d('0x2e')];_0x56f0a1[_0x119d('0x36')]=qs['sort'](_0x47072c[_0x119d('0x2f')][_0x119d('0x37')]);_0x56f0a1[_0x119d('0x38')]=qs[_0x119d('0x39')](_[_0x119d('0x3a')](_0x47072c[_0x119d('0x2f')],_0x424163[_0x119d('0x39')]));if(_0x47072c['query'][_0x119d('0x3b')]){_0x56f0a1[_0x119d('0x38')]=_[_0x119d('0x3c')](_0x56f0a1[_0x119d('0x38')],{'$or':_[_0x119d('0x2a')](_0x56f0a1['attributes'],function(_0x159161){var _0x23587d={};_0x23587d[_0x159161]={'$like':'%'+_0x47072c[_0x119d('0x2f')][_0x119d('0x3b')]+'%'};return _0x23587d;})});}_0x56f0a1=_[_0x119d('0x3c')]({},_0x56f0a1,_0x47072c[_0x119d('0x44')]);return _0x56158b[_0x119d('0x4a')](_0x56f0a1);}})[_0x119d('0x23')](function(_0x59e064){if(_0x59e064){_0x7f4f80=_0x59e064['length'];if(!_0x47072c['query'][_0x119d('0x4d')](_0x119d('0x34'))){_0x56f0a1[_0x119d('0x35')]=qs[_0x119d('0x35')](_0x47072c[_0x119d('0x2f')]['limit']);_0x56f0a1[_0x119d('0x1a')]=qs[_0x119d('0x1a')](_0x47072c[_0x119d('0x2f')]['offset']);}return _0x56158b['getFields'](_0x56f0a1);}})[_0x119d('0x23')](function(_0x5c81eb){if(_0x5c81eb){return _0x5c81eb?{'count':_0x7f4f80,'rows':_0x5c81eb}:null;}})[_0x119d('0x23')](respondWithResult(_0x1a7222,null))['catch'](handleError(_0x1a7222,null));};exports[_0x119d('0x4e')]=function(_0x2b1d74,_0x529740,_0x5c8f00){var _0x4cebb2={};var _0x4d63b8={};var _0x269758;var _0x20a776;return db[_0x119d('0x3e')][_0x119d('0x4b')]({'where':{'id':_0x2b1d74['params']['id']}})[_0x119d('0x23')](handleEntityNotFound(_0x529740,null))[_0x119d('0x23')](function(_0x8da705){if(_0x8da705){_0x269758=_0x8da705;_0x4d63b8[_0x119d('0x2e')]=_['keys'](db[_0x119d('0x4f')][_0x119d('0x2b')]);_0x4d63b8[_0x119d('0x2f')]=_[_0x119d('0x4c')](_0x2b1d74[_0x119d('0x2f')]);_0x4d63b8[_0x119d('0x39')]=_[_0x119d('0x30')](_0x4d63b8['model'],_0x4d63b8[_0x119d('0x2f')]);_0x4cebb2['attributes']=_[_0x119d('0x30')](_0x4d63b8['model'],qs[_0x119d('0x32')](_0x2b1d74[_0x119d('0x2f')][_0x119d('0x32')]));_0x4cebb2[_0x119d('0x31')]=_0x4cebb2[_0x119d('0x31')][_0x119d('0x33')]?_0x4cebb2['attributes']:_0x4d63b8[_0x119d('0x2e')];_0x4cebb2[_0x119d('0x36')]=qs[_0x119d('0x37')](_0x2b1d74[_0x119d('0x2f')]['sort']);_0x4cebb2[_0x119d('0x38')]=qs[_0x119d('0x39')](_[_0x119d('0x3a')](_0x2b1d74[_0x119d('0x2f')],_0x4d63b8[_0x119d('0x39')]));if(_0x2b1d74[_0x119d('0x2f')][_0x119d('0x3b')]){_0x4cebb2[_0x119d('0x38')]=_[_0x119d('0x3c')](_0x4cebb2[_0x119d('0x38')],{'$or':_['map'](_0x4cebb2['attributes'],function(_0x3fa765){var _0x182d9e={};_0x182d9e[_0x3fa765]={'$like':'%'+_0x2b1d74[_0x119d('0x2f')][_0x119d('0x3b')]+'%'};return _0x182d9e;})});}_0x4cebb2=_[_0x119d('0x3c')]({},_0x4cebb2,_0x2b1d74['options']);return _0x269758[_0x119d('0x4e')](_0x4cebb2);}})[_0x119d('0x23')](function(_0x3ffec2){if(_0x3ffec2){_0x20a776=_0x3ffec2[_0x119d('0x33')];if(!_0x2b1d74[_0x119d('0x2f')]['hasOwnProperty']('nolimit')){_0x4cebb2['limit']=qs[_0x119d('0x35')](_0x2b1d74['query'][_0x119d('0x35')]);_0x4cebb2[_0x119d('0x1a')]=qs['offset'](_0x2b1d74['query'][_0x119d('0x1a')]);}return _0x269758['getSubjects'](_0x4cebb2);}})[_0x119d('0x23')](function(_0x31ddf7){if(_0x31ddf7){return _0x31ddf7?{'count':_0x20a776,'rows':_0x31ddf7}:null;}})[_0x119d('0x23')](respondWithResult(_0x529740,null))[_0x119d('0x43')](handleError(_0x529740,null));};exports[_0x119d('0x50')]=function(_0x4cb6ee,_0x59e459,_0x1004b2){var _0x1d174f={};var _0x92ab6e={};var _0x25fa8d;var _0x20ac9b;return db[_0x119d('0x3e')][_0x119d('0x4b')]({'where':{'id':_0x4cb6ee[_0x119d('0x48')]['id']}})['then'](handleEntityNotFound(_0x59e459,null))[_0x119d('0x23')](function(_0x46713c){if(_0x46713c){_0x25fa8d=_0x46713c;_0x92ab6e[_0x119d('0x2e')]=_[_0x119d('0x4c')](db[_0x119d('0x4f')][_0x119d('0x2b')]);_0x92ab6e['query']=_['keys'](_0x4cb6ee[_0x119d('0x2f')]);_0x92ab6e[_0x119d('0x39')]=_[_0x119d('0x30')](_0x92ab6e[_0x119d('0x2e')],_0x92ab6e['query']);_0x1d174f['attributes']=_[_0x119d('0x30')](_0x92ab6e[_0x119d('0x2e')],qs[_0x119d('0x32')](_0x4cb6ee[_0x119d('0x2f')][_0x119d('0x32')]));_0x1d174f[_0x119d('0x31')]=_0x1d174f['attributes'][_0x119d('0x33')]?_0x1d174f['attributes']:_0x92ab6e['model'];_0x1d174f[_0x119d('0x36')]=qs['sort'](_0x4cb6ee[_0x119d('0x2f')]['sort']);_0x1d174f[_0x119d('0x38')]=qs['filters'](_[_0x119d('0x3a')](_0x4cb6ee[_0x119d('0x2f')],_0x92ab6e['filters']));if(_0x4cb6ee[_0x119d('0x2f')]['filter']){_0x1d174f[_0x119d('0x38')]=_[_0x119d('0x3c')](_0x1d174f[_0x119d('0x38')],{'$or':_[_0x119d('0x2a')](_0x1d174f[_0x119d('0x31')],function(_0x283793){var _0x290e9a={};_0x290e9a[_0x283793]={'$like':'%'+_0x4cb6ee[_0x119d('0x2f')]['filter']+'%'};return _0x290e9a;})});}_0x1d174f=_[_0x119d('0x3c')]({},_0x1d174f,_0x4cb6ee[_0x119d('0x44')]);return _0x25fa8d[_0x119d('0x50')](_0x1d174f);}})['then'](function(_0x308401){if(_0x308401){_0x20ac9b=_0x308401[_0x119d('0x33')];if(!_0x4cb6ee[_0x119d('0x2f')]['hasOwnProperty'](_0x119d('0x34'))){_0x1d174f['limit']=qs[_0x119d('0x35')](_0x4cb6ee['query']['limit']);_0x1d174f[_0x119d('0x1a')]=qs['offset'](_0x4cb6ee[_0x119d('0x2f')][_0x119d('0x1a')]);}return _0x25fa8d[_0x119d('0x50')](_0x1d174f);}})[_0x119d('0x23')](function(_0x2ee83e){if(_0x2ee83e){return _0x2ee83e?{'count':_0x20ac9b,'rows':_0x2ee83e}:null;}})[_0x119d('0x23')](respondWithResult(_0x59e459,null))['catch'](handleError(_0x59e459,null));};
\ No newline at end of file
index bce8b6a..6043a62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x55c8=['api','moment','bluebird','request-promise','path','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','util'];(function(_0x3f1f70,_0x353494){var _0x264ef6=function(_0x3038fe){while(--_0x3038fe){_0x3f1f70['push'](_0x3f1f70['shift']());}};_0x264ef6(++_0x353494);}(_0x55c8,0x1c7));var _0x855c=function(_0x1b155f,_0x622157){_0x1b155f=_0x1b155f-0x0;var _0x25dc24=_0x55c8[_0x1b155f];return _0x25dc24;};'use strict';var _=require('lodash');var util=require(_0x855c('0x0'));var logger=require('../../config/logger')(_0x855c('0x1'));var moment=require(_0x855c('0x2'));var BPromise=require(_0x855c('0x3'));var rp=require(_0x855c('0x4'));var fs=require('fs');var path=require(_0x855c('0x5'));var rimraf=require('rimraf');var config=require(_0x855c('0x6'));var attributes=require(_0x855c('0x7'));module[_0x855c('0x8')]=function(_0x4a8a6b,_0x212eb2){return _0x4a8a6b[_0x855c('0x9')](_0x855c('0xa'),attributes,{'tableName':_0x855c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcba1=['SalesforceConfiguration','int_salesforce_configurations','util','api','moment','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define'];(function(_0x472404,_0x19bd9d){var _0x502eda=function(_0x5b3e05){while(--_0x5b3e05){_0x472404['push'](_0x472404['shift']());}};_0x502eda(++_0x19bd9d);}(_0xcba1,0x183));var _0x1cba=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0xcba1[_0x2adbeb];return _0x5e18a6;};'use strict';var _=require('lodash');var util=require(_0x1cba('0x0'));var logger=require('../../config/logger')(_0x1cba('0x1'));var moment=require(_0x1cba('0x2'));var BPromise=require('bluebird');var rp=require(_0x1cba('0x3'));var fs=require('fs');var path=require(_0x1cba('0x4'));var rimraf=require(_0x1cba('0x5'));var config=require(_0x1cba('0x6'));var attributes=require(_0x1cba('0x7'));module['exports']=function(_0x7a4770,_0x13645a){return _0x7a4770[_0x1cba('0x8')](_0x1cba('0x9'),attributes,{'tableName':_0x1cba('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index be649ed..f360302 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x645d=['jayson/promise','http','request','then','request\x20sent','stringify','error','SalesforceConfiguration,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0x645d,0x13c));var _0xd645=function(_0x419c4a,_0x5d525d){_0x419c4a=_0x419c4a-0x0;var _0x4dae37=_0x645d[_0x419c4a];return _0x4dae37;};'use strict';var _=require(_0xd645('0x0'));var util=require(_0xd645('0x1'));var moment=require('moment');var BPromise=require(_0xd645('0x2'));var rs=require(_0xd645('0x3'));var fs=require('fs');var Redis=require(_0xd645('0x4'));var db=require(_0xd645('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd645('0x6'))('rpc');var config=require(_0xd645('0x7'));var jayson=require(_0xd645('0x8'));var client=jayson['client'][_0xd645('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d113a,_0x547444,_0x546510){return new BPromise(function(_0x1c02e6,_0x1f4077){return client[_0xd645('0xa')](_0x5d113a,_0x546510)[_0xd645('0xb')](function(_0x287e27){logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x547444,_0xd645('0xc'));logger['debug']('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x547444,'request\x20sent',JSON[_0xd645('0xd')](_0x287e27));if(_0x287e27['error']){if(_0x287e27[_0xd645('0xe')]['code']===0x1f4){logger[_0xd645('0xe')](_0xd645('0xf'),_0x547444,_0x287e27['error'][_0xd645('0x10')]);return _0x1f4077(_0x287e27['error'][_0xd645('0x10')]);}logger[_0xd645('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x547444,_0x287e27[_0xd645('0xe')][_0xd645('0x10')]);return _0x1c02e6(_0x287e27[_0xd645('0xe')]['message']);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x547444,'request\x20sent');_0x1c02e6(_0x287e27['result'][_0xd645('0x10')]);}})[_0xd645('0x11')](function(_0x481076){logger[_0xd645('0xe')](_0xd645('0xf'),_0x547444,_0x481076);_0x1f4077(_0x481076);});});}
\ No newline at end of file
+var _0x12e7=['then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x1f78dc,_0x5de78f){var _0x20addf=function(_0xb4da16){while(--_0xb4da16){_0x1f78dc['push'](_0x1f78dc['shift']());}};_0x20addf(++_0x5de78f);}(_0x12e7,0x17c));var _0x712e=function(_0x35a585,_0x417361){_0x35a585=_0x35a585-0x0;var _0x58f739=_0x12e7[_0x35a585];return _0x58f739;};'use strict';var _=require(_0x712e('0x0'));var util=require(_0x712e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x712e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x712e('0x3'))['db'];var utils=require(_0x712e('0x4'));var logger=require(_0x712e('0x5'))(_0x712e('0x6'));var config=require(_0x712e('0x7'));var jayson=require(_0x712e('0x8'));var client=jayson['client'][_0x712e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2cfbd7,_0x5c879f,_0xf61d4b){return new BPromise(function(_0x49d453,_0x1e2b74){return client[_0x712e('0xa')](_0x2cfbd7,_0xf61d4b)[_0x712e('0xb')](function(_0x3416d1){logger[_0x712e('0xc')](_0x712e('0xd'),_0x5c879f,_0x712e('0xe'));logger[_0x712e('0xf')](_0x712e('0x10'),_0x5c879f,'request\x20sent',JSON[_0x712e('0x11')](_0x3416d1));if(_0x3416d1[_0x712e('0x12')]){if(_0x3416d1[_0x712e('0x12')][_0x712e('0x13')]===0x1f4){logger[_0x712e('0x12')](_0x712e('0xd'),_0x5c879f,_0x3416d1['error']['message']);return _0x1e2b74(_0x3416d1[_0x712e('0x12')][_0x712e('0x14')]);}logger[_0x712e('0x12')](_0x712e('0xd'),_0x5c879f,_0x3416d1[_0x712e('0x12')][_0x712e('0x14')]);return _0x49d453(_0x3416d1['error'][_0x712e('0x14')]);}else{logger[_0x712e('0xc')](_0x712e('0xd'),_0x5c879f,_0x712e('0xe'));_0x49d453(_0x3416d1[_0x712e('0x15')][_0x712e('0x14')]);}})[_0x712e('0x16')](function(_0x50ba99){logger[_0x712e('0x12')](_0x712e('0xd'),_0x5c879f,_0x50ba99);_0x1e2b74(_0x50ba99);});});}
\ No newline at end of file
index 39d46bb..0bd7f9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f70=['show','create','update','delete','/:id','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated'];(function(_0x31fdaf,_0x6cdd12){var _0x1a7a61=function(_0x492c97){while(--_0x492c97){_0x31fdaf['push'](_0x31fdaf['shift']());}};_0x1a7a61(++_0x6cdd12);}(_0x6f70,0x1ec));var _0x06f7=function(_0x37a590,_0x3a8e40){_0x37a590=_0x37a590-0x0;var _0x1e3477=_0x6f70[_0x37a590];return _0x1e3477;};'use strict';var multer=require(_0x06f7('0x0'));var util=require(_0x06f7('0x1'));var path=require(_0x06f7('0x2'));var timeout=require(_0x06f7('0x3'));var express=require('express');var router=express[_0x06f7('0x4')]();var fs_extra=require(_0x06f7('0x5'));var auth=require(_0x06f7('0x6'));var interaction=require(_0x06f7('0x7'));var config=require(_0x06f7('0x8'));var controller=require(_0x06f7('0x9'));router[_0x06f7('0xa')]('/',auth[_0x06f7('0xb')](),controller['index']);router[_0x06f7('0xa')]('/:id',auth[_0x06f7('0xb')](),controller[_0x06f7('0xc')]);router['post']('/',auth[_0x06f7('0xb')](),controller[_0x06f7('0xd')]);router['put']('/:id',auth[_0x06f7('0xb')](),controller[_0x06f7('0xe')]);router[_0x06f7('0xf')](_0x06f7('0x10'),auth[_0x06f7('0xb')](),controller['destroy']);module[_0x06f7('0x11')]=router;
\ No newline at end of file
+var _0xb492=['put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','/:id','show'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0xb492,0x169));var _0x2b49=function(_0x5bb448,_0x397125){_0x5bb448=_0x5bb448-0x0;var _0x523eb7=_0xb492[_0x5bb448];return _0x523eb7;};'use strict';var multer=require(_0x2b49('0x0'));var util=require(_0x2b49('0x1'));var path=require('path');var timeout=require(_0x2b49('0x2'));var express=require(_0x2b49('0x3'));var router=express[_0x2b49('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2b49('0x5'));var interaction=require(_0x2b49('0x6'));var config=require(_0x2b49('0x7'));var controller=require(_0x2b49('0x8'));router[_0x2b49('0x9')]('/',auth[_0x2b49('0xa')](),controller['index']);router[_0x2b49('0x9')](_0x2b49('0xb'),auth[_0x2b49('0xa')](),controller[_0x2b49('0xc')]);router['post']('/',auth[_0x2b49('0xa')](),controller['create']);router[_0x2b49('0xd')](_0x2b49('0xb'),auth[_0x2b49('0xa')](),controller[_0x2b49('0xe')]);router[_0x2b49('0xf')](_0x2b49('0xb'),auth[_0x2b49('0xa')](),controller['destroy']);module[_0x2b49('0x10')]=router;
\ No newline at end of file
index a6fdd47..160b84b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc12e=['ENUM','variable','customVariable','keyValue','picklist','STRING','sequelize'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xc12e,0x1cd));var _0xec12=function(_0xcf0d44,_0x2aa898){_0xcf0d44=_0xcf0d44-0x0;var _0x4a1f12=_0xc12e[_0xcf0d44];return _0x4a1f12;};'use strict';var Sequelize=require(_0xec12('0x0'));module['exports']={'type':{'type':Sequelize[_0xec12('0x1')]('string',_0xec12('0x2'),_0xec12('0x3'),_0xec12('0x4'),_0xec12('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xec12('0x6')]},'key':{'type':Sequelize[_0xec12('0x6')]},'keyType':{'type':Sequelize[_0xec12('0x1')]('string','variable',_0xec12('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xec12('0x6')]},'variableName':{'type':Sequelize[_0xec12('0x6')]}};
\ No newline at end of file
+var _0x50ce=['string','keyValue','picklist','STRING','variable','customVariable','sequelize','ENUM'];(function(_0xb309ab,_0x32cfff){var _0x46ffe8=function(_0x44dc4f){while(--_0x44dc4f){_0xb309ab['push'](_0xb309ab['shift']());}};_0x46ffe8(++_0x32cfff);}(_0x50ce,0x86));var _0xe50c=function(_0x43469e,_0x4e69d6){_0x43469e=_0x43469e-0x0;var _0xcefd2a=_0x50ce[_0x43469e];return _0xcefd2a;};'use strict';var Sequelize=require(_0xe50c('0x0'));module['exports']={'type':{'type':Sequelize[_0xe50c('0x1')](_0xe50c('0x2'),'variable','customVariable',_0xe50c('0x3'),_0xe50c('0x4')),'defaultValue':'string'},'content':{'type':Sequelize[_0xe50c('0x5')]},'key':{'type':Sequelize[_0xe50c('0x5')]},'keyType':{'type':Sequelize[_0xe50c('0x1')](_0xe50c('0x2'),_0xe50c('0x6'),_0xe50c('0x7'))},'keyContent':{'type':Sequelize[_0xe50c('0x5')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0xe50c('0x5')]}};
\ No newline at end of file
index 56f78a0..98f8af5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cd1=['VIRTUAL','options','includeAll','findAll','rows','catch','show','params','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','stack','name','send','index','map','SalesforceField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x1f4d63,_0x2a06a3){var _0x2a4078=function(_0x518ca2){while(--_0x518ca2){_0x1f4d63['push'](_0x1f4d63['shift']());}};_0x2a4078(++_0x2a06a3);}(_0x5cd1,0x137));var _0x15cd=function(_0x39fd82,_0x43e501){_0x39fd82=_0x39fd82-0x0;var _0xc76f5c=_0x5cd1[_0x39fd82];return _0xc76f5c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x15cd('0x0'));var zipdir=require(_0x15cd('0x1'));var jsonpatch=require(_0x15cd('0x2'));var rp=require(_0x15cd('0x3'));var moment=require(_0x15cd('0x4'));var BPromise=require(_0x15cd('0x5'));var Mustache=require(_0x15cd('0x6'));var util=require(_0x15cd('0x7'));var path=require(_0x15cd('0x8'));var sox=require(_0x15cd('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x15cd('0xa'));var squel=require(_0x15cd('0xb'));var crypto=require(_0x15cd('0xc'));var jsforce=require(_0x15cd('0xd'));var deskjs=require(_0x15cd('0xe'));var toCsv=require(_0x15cd('0xf'));var querystring=require(_0x15cd('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x15cd('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x15cd('0x12'));var hardwareService=require(_0x15cd('0x13'));var logger=require(_0x15cd('0x14'))('api');var utils=require(_0x15cd('0x15'));var config=require(_0x15cd('0x16'));var licenseUtil=require(_0x15cd('0x17'));var db=require(_0x15cd('0x18'))['db'];function respondWithStatusCode(_0x346895,_0x5366cb){_0x5366cb=_0x5366cb||0xcc;return function(_0x44a763){if(_0x44a763){return _0x346895[_0x15cd('0x19')](_0x5366cb);}return _0x346895[_0x15cd('0x1a')](_0x5366cb)[_0x15cd('0x1b')]();};}function respondWithResult(_0x3f9e6e,_0x3715f6){_0x3715f6=_0x3715f6||0xc8;return function(_0x3101d7){if(_0x3101d7){return _0x3f9e6e[_0x15cd('0x1a')](_0x3715f6)[_0x15cd('0x1c')](_0x3101d7);}};}function respondWithFilteredResult(_0x2c598c,_0x41e73a){return function(_0x11bfe1){if(_0x11bfe1){var _0x8e7a5f=typeof _0x41e73a[_0x15cd('0x1d')]===_0x15cd('0x1e')&&typeof _0x41e73a['limit']===_0x15cd('0x1e');var _0x139e78=_0x11bfe1['count'];var _0x3efe40=_0x8e7a5f?0x0:_0x41e73a[_0x15cd('0x1d')];var _0x4b44aa=_0x8e7a5f?_0x11bfe1[_0x15cd('0x1f')]:_0x41e73a[_0x15cd('0x1d')]+_0x41e73a[_0x15cd('0x20')];var _0x487b22;if(_0x4b44aa>=_0x139e78){_0x4b44aa=_0x139e78;_0x487b22=0xc8;}else{_0x487b22=0xce;}_0x2c598c['status'](_0x487b22);return _0x2c598c[_0x15cd('0x21')]('Content-Range',_0x3efe40+'-'+_0x4b44aa+'/'+_0x139e78)['json'](_0x11bfe1);}return null;};}function patchUpdates(_0x22fa42){return function(_0x55c27a){try{jsonpatch['apply'](_0x55c27a,_0x22fa42,!![]);}catch(_0xb36811){return BPromise[_0x15cd('0x22')](_0xb36811);}return _0x55c27a[_0x15cd('0x23')]();};}function saveUpdates(_0x118221,_0x57bd91){return function(_0xcc3a8c){if(_0xcc3a8c){return _0xcc3a8c[_0x15cd('0x24')](_0x118221)[_0x15cd('0x25')](function(_0x1de360){return _0x1de360;});}return null;};}function removeEntity(_0x441088,_0x4bbe3c){return function(_0x589f9d){if(_0x589f9d){return _0x589f9d[_0x15cd('0x26')]()[_0x15cd('0x25')](function(){_0x441088[_0x15cd('0x1a')](0xcc)[_0x15cd('0x1b')]();});}};}function handleEntityNotFound(_0x38dade,_0x50348d){return function(_0x2a2b76){if(!_0x2a2b76){_0x38dade[_0x15cd('0x19')](0x194);}return _0x2a2b76;};}function handleError(_0x10b4bb,_0x2680a9){_0x2680a9=_0x2680a9||0x1f4;return function(_0x5f0c85){logger['error'](_0x5f0c85[_0x15cd('0x27')]);if(_0x5f0c85[_0x15cd('0x28')]){delete _0x5f0c85[_0x15cd('0x28')];}_0x10b4bb[_0x15cd('0x1a')](_0x2680a9)[_0x15cd('0x29')](_0x5f0c85);};}exports[_0x15cd('0x2a')]=function(_0x573b33,_0x654a49){var _0x19dbbf={},_0x4e3a56={},_0x302c01={'count':0x0,'rows':[]};var _0x28b9c2=_[_0x15cd('0x2b')](db[_0x15cd('0x2c')]['rawAttributes'],function(_0x8e2dbc){return{'name':_0x8e2dbc[_0x15cd('0x2d')],'type':_0x8e2dbc[_0x15cd('0x2e')][_0x15cd('0x2f')]};});_0x4e3a56[_0x15cd('0x30')]=_[_0x15cd('0x2b')](_0x28b9c2,_0x15cd('0x28'));_0x4e3a56[_0x15cd('0x31')]=_[_0x15cd('0x32')](_0x573b33[_0x15cd('0x31')]);_0x4e3a56[_0x15cd('0x33')]=_[_0x15cd('0x34')](_0x4e3a56[_0x15cd('0x30')],_0x4e3a56[_0x15cd('0x31')]);_0x19dbbf[_0x15cd('0x35')]=_[_0x15cd('0x34')](_0x4e3a56['model'],qs['fields'](_0x573b33[_0x15cd('0x31')][_0x15cd('0x36')]));_0x19dbbf[_0x15cd('0x35')]=_0x19dbbf['attributes'][_0x15cd('0x37')]?_0x19dbbf[_0x15cd('0x35')]:_0x4e3a56[_0x15cd('0x30')];if(!_0x573b33['query'][_0x15cd('0x38')](_0x15cd('0x39'))){_0x19dbbf['limit']=qs[_0x15cd('0x20')](_0x573b33[_0x15cd('0x31')][_0x15cd('0x20')]);_0x19dbbf['offset']=qs[_0x15cd('0x1d')](_0x573b33['query'][_0x15cd('0x1d')]);}_0x19dbbf[_0x15cd('0x3a')]=qs[_0x15cd('0x3b')](_0x573b33[_0x15cd('0x31')]['sort']);_0x19dbbf[_0x15cd('0x3c')]=qs['filters'](_[_0x15cd('0x3d')](_0x573b33[_0x15cd('0x31')],_0x4e3a56[_0x15cd('0x33')]),_0x28b9c2);if(_0x573b33[_0x15cd('0x31')][_0x15cd('0x3e')]){_0x19dbbf[_0x15cd('0x3c')]=_[_0x15cd('0x3f')](_0x19dbbf[_0x15cd('0x3c')],{'$or':_[_0x15cd('0x2b')](_0x28b9c2,function(_0x34475f){if(_0x34475f[_0x15cd('0x2e')]!==_0x15cd('0x40')){var _0x5b2199={};_0x5b2199[_0x34475f[_0x15cd('0x28')]]={'$like':'%'+_0x573b33['query'][_0x15cd('0x3e')]+'%'};return _0x5b2199;}})});}_0x19dbbf=_['merge']({},_0x19dbbf,_0x573b33[_0x15cd('0x41')]);var _0x38509f={'where':_0x19dbbf[_0x15cd('0x3c')]};return db[_0x15cd('0x2c')]['count'](_0x38509f)[_0x15cd('0x25')](function(_0x368b27){_0x302c01[_0x15cd('0x1f')]=_0x368b27;if(_0x573b33[_0x15cd('0x31')][_0x15cd('0x42')]){_0x19dbbf['include']=[{'all':!![]}];}return db[_0x15cd('0x2c')][_0x15cd('0x43')](_0x19dbbf);})[_0x15cd('0x25')](function(_0x3fb0d4){_0x302c01[_0x15cd('0x44')]=_0x3fb0d4;return _0x302c01;})[_0x15cd('0x25')](respondWithFilteredResult(_0x654a49,_0x19dbbf))[_0x15cd('0x45')](handleError(_0x654a49,null));};exports[_0x15cd('0x46')]=function(_0x12b324,_0x274c31){var _0x293045={'raw':!![],'where':{'id':_0x12b324[_0x15cd('0x47')]['id']}},_0x6b3df1={};_0x6b3df1['model']=_[_0x15cd('0x32')](db[_0x15cd('0x2c')]['rawAttributes']);_0x6b3df1['query']=_[_0x15cd('0x32')](_0x12b324[_0x15cd('0x31')]);_0x6b3df1['filters']=_[_0x15cd('0x34')](_0x6b3df1[_0x15cd('0x30')],_0x6b3df1[_0x15cd('0x31')]);_0x293045[_0x15cd('0x35')]=_['intersection'](_0x6b3df1[_0x15cd('0x30')],qs['fields'](_0x12b324[_0x15cd('0x31')][_0x15cd('0x36')]));_0x293045['attributes']=_0x293045[_0x15cd('0x35')][_0x15cd('0x37')]?_0x293045[_0x15cd('0x35')]:_0x6b3df1[_0x15cd('0x30')];if(_0x12b324[_0x15cd('0x31')][_0x15cd('0x42')]){_0x293045['include']=[{'all':!![]}];}_0x293045=_['merge']({},_0x293045,_0x12b324[_0x15cd('0x41')]);return db['SalesforceField']['find'](_0x293045)[_0x15cd('0x25')](handleEntityNotFound(_0x274c31,null))[_0x15cd('0x25')](respondWithResult(_0x274c31,null))[_0x15cd('0x45')](handleError(_0x274c31,null));};exports[_0x15cd('0x48')]=function(_0xa789af,_0x452c73){return db[_0x15cd('0x2c')]['create'](_0xa789af[_0x15cd('0x49')],{})['then'](respondWithResult(_0x452c73,0xc9))['catch'](handleError(_0x452c73,null));};exports['update']=function(_0x53cdd6,_0x33a2c6){if(_0x53cdd6['body']['id']){delete _0x53cdd6[_0x15cd('0x49')]['id'];}return db['SalesforceField'][_0x15cd('0x4a')]({'where':{'id':_0x53cdd6['params']['id']}})[_0x15cd('0x25')](handleEntityNotFound(_0x33a2c6,null))[_0x15cd('0x25')](saveUpdates(_0x53cdd6[_0x15cd('0x49')],null))[_0x15cd('0x25')](respondWithResult(_0x33a2c6,null))['catch'](handleError(_0x33a2c6,null));};exports[_0x15cd('0x26')]=function(_0x5c8eae,_0x2e058b){return db['SalesforceField'][_0x15cd('0x4a')]({'where':{'id':_0x5c8eae[_0x15cd('0x47')]['id']}})[_0x15cd('0x25')](handleEntityNotFound(_0x2e058b,null))[_0x15cd('0x25')](removeEntity(_0x2e058b,null))['catch'](handleError(_0x2e058b,null));};
\ No newline at end of file
+var _0x9002=['offset','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','SalesforceField','includeAll','findAll','catch','show','params','include','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','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','limit','count'];(function(_0x3ac769,_0x2825df){var _0x2185eb=function(_0x43cc1d){while(--_0x43cc1d){_0x3ac769['push'](_0x3ac769['shift']());}};_0x2185eb(++_0x2825df);}(_0x9002,0x15c));var _0x2900=function(_0xa54c18,_0x4ba567){_0xa54c18=_0xa54c18-0x0;var _0x385f26=_0x9002[_0xa54c18];return _0x385f26;};'use strict';var emlformat=require(_0x2900('0x0'));var rimraf=require(_0x2900('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2900('0x2'));var rp=require(_0x2900('0x3'));var moment=require('moment');var BPromise=require(_0x2900('0x4'));var Mustache=require('mustache');var util=require(_0x2900('0x5'));var path=require(_0x2900('0x6'));var sox=require(_0x2900('0x7'));var csv=require('to-csv');var ejs=require(_0x2900('0x8'));var fs=require('fs');var fs_extra=require(_0x2900('0x9'));var _=require(_0x2900('0xa'));var squel=require(_0x2900('0xb'));var crypto=require(_0x2900('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2900('0xd'));var toCsv=require(_0x2900('0xe'));var querystring=require('querystring');var Papa=require(_0x2900('0xf'));var Redis=require(_0x2900('0x10'));var authService=require(_0x2900('0x11'));var qs=require(_0x2900('0x12'));var as=require(_0x2900('0x13'));var hardwareService=require(_0x2900('0x14'));var logger=require(_0x2900('0x15'))(_0x2900('0x16'));var utils=require(_0x2900('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2900('0x18'));var db=require(_0x2900('0x19'))['db'];function respondWithStatusCode(_0x50eb2f,_0x5d76bb){_0x5d76bb=_0x5d76bb||0xcc;return function(_0x245d95){if(_0x245d95){return _0x50eb2f[_0x2900('0x1a')](_0x5d76bb);}return _0x50eb2f[_0x2900('0x1b')](_0x5d76bb)[_0x2900('0x1c')]();};}function respondWithResult(_0x2af99a,_0x35091e){_0x35091e=_0x35091e||0xc8;return function(_0x1f9f86){if(_0x1f9f86){return _0x2af99a[_0x2900('0x1b')](_0x35091e)[_0x2900('0x1d')](_0x1f9f86);}};}function respondWithFilteredResult(_0x2df315,_0x458420){return function(_0x31a1ab){if(_0x31a1ab){var _0x2cd456=typeof _0x458420['offset']==='undefined'&&typeof _0x458420[_0x2900('0x1e')]==='undefined';var _0x21335c=_0x31a1ab[_0x2900('0x1f')];var _0xee1873=_0x2cd456?0x0:_0x458420[_0x2900('0x20')];var _0x25a580=_0x2cd456?_0x31a1ab[_0x2900('0x1f')]:_0x458420['offset']+_0x458420[_0x2900('0x1e')];var _0x3be844;if(_0x25a580>=_0x21335c){_0x25a580=_0x21335c;_0x3be844=0xc8;}else{_0x3be844=0xce;}_0x2df315['status'](_0x3be844);return _0x2df315[_0x2900('0x21')](_0x2900('0x22'),_0xee1873+'-'+_0x25a580+'/'+_0x21335c)[_0x2900('0x1d')](_0x31a1ab);}return null;};}function patchUpdates(_0x1dcd42){return function(_0x5255bd){try{jsonpatch[_0x2900('0x23')](_0x5255bd,_0x1dcd42,!![]);}catch(_0xfb856a){return BPromise[_0x2900('0x24')](_0xfb856a);}return _0x5255bd['save']();};}function saveUpdates(_0x2972d7,_0x35f71c){return function(_0x14a3b7){if(_0x14a3b7){return _0x14a3b7['update'](_0x2972d7)[_0x2900('0x25')](function(_0x42baba){return _0x42baba;});}return null;};}function removeEntity(_0x445b66,_0x269fa9){return function(_0x4faa7d){if(_0x4faa7d){return _0x4faa7d[_0x2900('0x26')]()[_0x2900('0x25')](function(){_0x445b66['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc103b2,_0x5197d4){return function(_0x52d4b2){if(!_0x52d4b2){_0xc103b2[_0x2900('0x1a')](0x194);}return _0x52d4b2;};}function handleError(_0x22e8d5,_0x4b47d8){_0x4b47d8=_0x4b47d8||0x1f4;return function(_0x3008ca){logger[_0x2900('0x27')](_0x3008ca[_0x2900('0x28')]);if(_0x3008ca[_0x2900('0x29')]){delete _0x3008ca[_0x2900('0x29')];}_0x22e8d5[_0x2900('0x1b')](_0x4b47d8)[_0x2900('0x2a')](_0x3008ca);};}exports[_0x2900('0x2b')]=function(_0x59da05,_0x3bd44d){var _0x5e7739={},_0x2a66c6={},_0x47cdeb={'count':0x0,'rows':[]};var _0x50a374=_[_0x2900('0x2c')](db['SalesforceField'][_0x2900('0x2d')],function(_0xee3c28){return{'name':_0xee3c28[_0x2900('0x2e')],'type':_0xee3c28[_0x2900('0x2f')][_0x2900('0x30')]};});_0x2a66c6[_0x2900('0x31')]=_[_0x2900('0x2c')](_0x50a374,_0x2900('0x29'));_0x2a66c6[_0x2900('0x32')]=_[_0x2900('0x33')](_0x59da05['query']);_0x2a66c6[_0x2900('0x34')]=_['intersection'](_0x2a66c6[_0x2900('0x31')],_0x2a66c6[_0x2900('0x32')]);_0x5e7739[_0x2900('0x35')]=_[_0x2900('0x36')](_0x2a66c6['model'],qs[_0x2900('0x37')](_0x59da05['query'][_0x2900('0x37')]));_0x5e7739[_0x2900('0x35')]=_0x5e7739[_0x2900('0x35')][_0x2900('0x38')]?_0x5e7739[_0x2900('0x35')]:_0x2a66c6['model'];if(!_0x59da05[_0x2900('0x32')][_0x2900('0x39')](_0x2900('0x3a'))){_0x5e7739[_0x2900('0x1e')]=qs[_0x2900('0x1e')](_0x59da05['query'][_0x2900('0x1e')]);_0x5e7739[_0x2900('0x20')]=qs[_0x2900('0x20')](_0x59da05['query'][_0x2900('0x20')]);}_0x5e7739[_0x2900('0x3b')]=qs[_0x2900('0x3c')](_0x59da05[_0x2900('0x32')][_0x2900('0x3c')]);_0x5e7739[_0x2900('0x3d')]=qs[_0x2900('0x34')](_['pick'](_0x59da05['query'],_0x2a66c6[_0x2900('0x34')]),_0x50a374);if(_0x59da05[_0x2900('0x32')]['filter']){_0x5e7739['where']=_[_0x2900('0x3e')](_0x5e7739['where'],{'$or':_[_0x2900('0x2c')](_0x50a374,function(_0x1071a1){if(_0x1071a1['type']!==_0x2900('0x3f')){var _0xfc1d40={};_0xfc1d40[_0x1071a1[_0x2900('0x29')]]={'$like':'%'+_0x59da05[_0x2900('0x32')]['filter']+'%'};return _0xfc1d40;}})});}_0x5e7739=_[_0x2900('0x3e')]({},_0x5e7739,_0x59da05[_0x2900('0x40')]);var _0x118b07={'where':_0x5e7739[_0x2900('0x3d')]};return db[_0x2900('0x41')][_0x2900('0x1f')](_0x118b07)[_0x2900('0x25')](function(_0x1f66ff){_0x47cdeb[_0x2900('0x1f')]=_0x1f66ff;if(_0x59da05[_0x2900('0x32')][_0x2900('0x42')]){_0x5e7739['include']=[{'all':!![]}];}return db['SalesforceField'][_0x2900('0x43')](_0x5e7739);})[_0x2900('0x25')](function(_0x1d0968){_0x47cdeb['rows']=_0x1d0968;return _0x47cdeb;})[_0x2900('0x25')](respondWithFilteredResult(_0x3bd44d,_0x5e7739))[_0x2900('0x44')](handleError(_0x3bd44d,null));};exports[_0x2900('0x45')]=function(_0x198203,_0x3bbb1f){var _0x2567f4={'raw':!![],'where':{'id':_0x198203[_0x2900('0x46')]['id']}},_0x359295={};_0x359295[_0x2900('0x31')]=_[_0x2900('0x33')](db['SalesforceField']['rawAttributes']);_0x359295['query']=_[_0x2900('0x33')](_0x198203[_0x2900('0x32')]);_0x359295[_0x2900('0x34')]=_[_0x2900('0x36')](_0x359295[_0x2900('0x31')],_0x359295['query']);_0x2567f4[_0x2900('0x35')]=_[_0x2900('0x36')](_0x359295[_0x2900('0x31')],qs[_0x2900('0x37')](_0x198203[_0x2900('0x32')]['fields']));_0x2567f4[_0x2900('0x35')]=_0x2567f4['attributes'][_0x2900('0x38')]?_0x2567f4[_0x2900('0x35')]:_0x359295[_0x2900('0x31')];if(_0x198203[_0x2900('0x32')][_0x2900('0x42')]){_0x2567f4[_0x2900('0x47')]=[{'all':!![]}];}_0x2567f4=_['merge']({},_0x2567f4,_0x198203[_0x2900('0x40')]);return db[_0x2900('0x41')][_0x2900('0x48')](_0x2567f4)[_0x2900('0x25')](handleEntityNotFound(_0x3bbb1f,null))[_0x2900('0x25')](respondWithResult(_0x3bbb1f,null))[_0x2900('0x44')](handleError(_0x3bbb1f,null));};exports[_0x2900('0x49')]=function(_0x404b80,_0x439953){return db['SalesforceField'][_0x2900('0x49')](_0x404b80[_0x2900('0x4a')],{})[_0x2900('0x25')](respondWithResult(_0x439953,0xc9))['catch'](handleError(_0x439953,null));};exports[_0x2900('0x4b')]=function(_0x4ca84d,_0x15523c){if(_0x4ca84d[_0x2900('0x4a')]['id']){delete _0x4ca84d[_0x2900('0x4a')]['id'];}return db[_0x2900('0x41')]['find']({'where':{'id':_0x4ca84d[_0x2900('0x46')]['id']}})[_0x2900('0x25')](handleEntityNotFound(_0x15523c,null))[_0x2900('0x25')](saveUpdates(_0x4ca84d[_0x2900('0x4a')],null))[_0x2900('0x25')](respondWithResult(_0x15523c,null))[_0x2900('0x44')](handleError(_0x15523c,null));};exports[_0x2900('0x26')]=function(_0xb6712b,_0x3293a2){return db[_0x2900('0x41')]['find']({'where':{'id':_0xb6712b[_0x2900('0x46')]['id']}})[_0x2900('0x25')](handleEntityNotFound(_0x3293a2,null))['then'](removeEntity(_0x3293a2,null))[_0x2900('0x44')](handleError(_0x3293a2,null));};
\ No newline at end of file
index 4d2f9e3..d15d92a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e93=['exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intSalesforceField.attributes'];(function(_0x53f402,_0x326920){var _0x45a76d=function(_0x51f590){while(--_0x51f590){_0x53f402['push'](_0x53f402['shift']());}};_0x45a76d(++_0x326920);}(_0x2e93,0xd8));var _0x32e9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2e93[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x32e9('0x0'));var util=require('util');var logger=require(_0x32e9('0x1'))('api');var moment=require(_0x32e9('0x2'));var BPromise=require(_0x32e9('0x3'));var rp=require(_0x32e9('0x4'));var fs=require('fs');var path=require(_0x32e9('0x5'));var rimraf=require(_0x32e9('0x6'));var config=require('../../config/environment');var attributes=require(_0x32e9('0x7'));module[_0x32e9('0x8')]=function(_0x1a4b43,_0x120fd6){return _0x1a4b43[_0x32e9('0x9')](_0x32e9('0xa'),attributes,{'tableName':_0x32e9('0xb'),'paranoid':![],'indexes':[{'name':_0x32e9('0xc'),'fields':[_0x32e9('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7bb9=['define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','moment','rimraf','../../config/environment','./intSalesforceField.attributes','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7bb9,0x13e));var _0x97bb=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0x7bb9[_0x5f3f88];return _0xd08119;};'use strict';var _=require(_0x97bb('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x97bb('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x97bb('0x2'));var config=require(_0x97bb('0x3'));var attributes=require(_0x97bb('0x4'));module[_0x97bb('0x5')]=function(_0x5c5d1b,_0x64b625){return _0x5c5d1b[_0x97bb('0x6')](_0x97bb('0x7'),attributes,{'tableName':_0x97bb('0x8'),'paranoid':![],'indexes':[{'name':_0x97bb('0x9'),'fields':[_0x97bb('0xa'),_0x97bb('0xb')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 4ef1db9..df89afa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x76de=['error','SalesforceField,\x20%s,\x20%s','message','info','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','request\x20sent','debug'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x76de,0x196));var _0xe76d=function(_0x371b74,_0x2c45a0){_0x371b74=_0x371b74-0x0;var _0x4cf68f=_0x76de[_0x371b74];return _0x4cf68f;};'use strict';var _=require('lodash');var util=require(_0xe76d('0x0'));var moment=require(_0xe76d('0x1'));var BPromise=require('bluebird');var rs=require(_0xe76d('0x2'));var fs=require('fs');var Redis=require(_0xe76d('0x3'));var db=require(_0xe76d('0x4'))['db'];var utils=require(_0xe76d('0x5'));var logger=require(_0xe76d('0x6'))(_0xe76d('0x7'));var config=require(_0xe76d('0x8'));var jayson=require(_0xe76d('0x9'));var client=jayson['client'][_0xe76d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x635231,_0x4bf194,_0x330d55){return new BPromise(function(_0x4a4667,_0x3354a9){return client[_0xe76d('0xb')](_0x635231,_0x330d55)['then'](function(_0x2bf16a){logger['info']('SalesforceField,\x20%s,\x20%s',_0x4bf194,_0xe76d('0xc'));logger[_0xe76d('0xd')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x4bf194,_0xe76d('0xc'),JSON['stringify'](_0x2bf16a));if(_0x2bf16a[_0xe76d('0xe')]){if(_0x2bf16a[_0xe76d('0xe')]['code']===0x1f4){logger[_0xe76d('0xe')](_0xe76d('0xf'),_0x4bf194,_0x2bf16a[_0xe76d('0xe')][_0xe76d('0x10')]);return _0x3354a9(_0x2bf16a['error'][_0xe76d('0x10')]);}logger[_0xe76d('0xe')](_0xe76d('0xf'),_0x4bf194,_0x2bf16a[_0xe76d('0xe')]['message']);return _0x4a4667(_0x2bf16a[_0xe76d('0xe')][_0xe76d('0x10')]);}else{logger[_0xe76d('0x11')](_0xe76d('0xf'),_0x4bf194,'request\x20sent');_0x4a4667(_0x2bf16a[_0xe76d('0x12')]['message']);}})[_0xe76d('0x13')](function(_0x4e36b2){logger[_0xe76d('0xe')](_0xe76d('0xf'),_0x4bf194,_0x4e36b2);_0x3354a9(_0x4e36b2);});});}
\ No newline at end of file
+var _0x87bf=['request','info','stringify','error','code','SalesforceField,\x20%s,\x20%s','message','request\x20sent','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x1cf4a9,_0x165da4){var _0x4d67b0=function(_0x3dc117){while(--_0x3dc117){_0x1cf4a9['push'](_0x1cf4a9['shift']());}};_0x4d67b0(++_0x165da4);}(_0x87bf,0x1c1));var _0xf87b=function(_0x3a2f45,_0x628b19){_0x3a2f45=_0x3a2f45-0x0;var _0x25b26c=_0x87bf[_0x3a2f45];return _0x25b26c;};'use strict';var _=require('lodash');var util=require(_0xf87b('0x0'));var moment=require(_0xf87b('0x1'));var BPromise=require(_0xf87b('0x2'));var rs=require(_0xf87b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf87b('0x4'))['db'];var utils=require(_0xf87b('0x5'));var logger=require(_0xf87b('0x6'))(_0xf87b('0x7'));var config=require(_0xf87b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf87b('0x9')][_0xf87b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9fd225,_0x205d32,_0x4a1d1b){return new BPromise(function(_0x68d929,_0x1909fd){return client[_0xf87b('0xb')](_0x9fd225,_0x4a1d1b)['then'](function(_0xf38e6b){logger[_0xf87b('0xc')]('SalesforceField,\x20%s,\x20%s',_0x205d32,'request\x20sent');logger['debug']('SalesforceField,\x20%s,\x20%s,\x20%s',_0x205d32,'request\x20sent',JSON[_0xf87b('0xd')](_0xf38e6b));if(_0xf38e6b['error']){if(_0xf38e6b[_0xf87b('0xe')][_0xf87b('0xf')]===0x1f4){logger[_0xf87b('0xe')](_0xf87b('0x10'),_0x205d32,_0xf38e6b[_0xf87b('0xe')][_0xf87b('0x11')]);return _0x1909fd(_0xf38e6b['error']['message']);}logger[_0xf87b('0xe')](_0xf87b('0x10'),_0x205d32,_0xf38e6b[_0xf87b('0xe')]['message']);return _0x68d929(_0xf38e6b['error'][_0xf87b('0x11')]);}else{logger[_0xf87b('0xc')](_0xf87b('0x10'),_0x205d32,_0xf87b('0x12'));_0x68d929(_0xf38e6b['result'][_0xf87b('0x11')]);}})[_0xf87b('0x13')](function(_0x4fc49d){logger[_0xf87b('0xe')](_0xf87b('0x10'),_0x205d32,_0x4fc49d);_0x1909fd(_0x4fc49d);});});}
\ No newline at end of file
index e5d331c..8fc5553 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x66f4=['express','Router','fs-extra','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','create','/:id/configurations','put','update','util'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x66f4,0x7f));var _0x466f=function(_0x278262,_0x55faa4){_0x278262=_0x278262-0x0;var _0x291144=_0x66f4[_0x278262];return _0x291144;};'use strict';var multer=require('multer');var util=require(_0x466f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x466f('0x1'));var router=express[_0x466f('0x2')]();var fs_extra=require(_0x466f('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x466f('0x4'));var controller=require('./intServicenowAccount.controller');router['get']('/',auth[_0x466f('0x5')](),controller[_0x466f('0x6')]);router[_0x466f('0x7')](_0x466f('0x8'),auth['isAuthenticated'](),controller[_0x466f('0x9')]);router[_0x466f('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller['getConfigurations']);router[_0x466f('0x7')](_0x466f('0xa'),auth[_0x466f('0x5')](),controller[_0x466f('0xb')]);router['post']('/',auth[_0x466f('0x5')](),controller[_0x466f('0xc')]);router['post'](_0x466f('0xd'),auth[_0x466f('0x5')](),controller['addConfiguration']);router[_0x466f('0xe')](_0x466f('0x8'),auth['isAuthenticated'](),controller[_0x466f('0xf')]);router['delete'](_0x466f('0x8'),auth[_0x466f('0x5')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xb8ab=['/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','destroy','multer','Router','fs-extra','../../components/auth/service','./intServicenowAccount.controller','get','isAuthenticated','index'];(function(_0x23fc32,_0x976f6d){var _0x13963e=function(_0x2f8881){while(--_0x2f8881){_0x23fc32['push'](_0x23fc32['shift']());}};_0x13963e(++_0x976f6d);}(_0xb8ab,0xd4));var _0xbb8a=function(_0x369a19,_0x457d03){_0x369a19=_0x369a19-0x0;var _0x427cbc=_0xb8ab[_0x369a19];return _0x427cbc;};'use strict';var multer=require(_0xbb8a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbb8a('0x1')]();var fs_extra=require(_0xbb8a('0x2'));var auth=require(_0xbb8a('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbb8a('0x4'));router[_0xbb8a('0x5')]('/',auth[_0xbb8a('0x6')](),controller[_0xbb8a('0x7')]);router[_0xbb8a('0x5')](_0xbb8a('0x8'),auth[_0xbb8a('0x6')](),controller[_0xbb8a('0x9')]);router[_0xbb8a('0x5')](_0xbb8a('0xa'),auth['isAuthenticated'](),controller[_0xbb8a('0xb')]);router[_0xbb8a('0x5')](_0xbb8a('0xc'),auth[_0xbb8a('0x6')](),controller[_0xbb8a('0xd')]);router[_0xbb8a('0xe')]('/',auth['isAuthenticated'](),controller[_0xbb8a('0xf')]);router['post'](_0xbb8a('0xa'),auth[_0xbb8a('0x6')](),controller['addConfiguration']);router[_0xbb8a('0x10')](_0xbb8a('0x8'),auth[_0xbb8a('0x6')](),controller[_0xbb8a('0x11')]);router[_0xbb8a('0x12')](_0xbb8a('0x8'),auth[_0xbb8a('0x6')](),controller[_0xbb8a('0x13')]);module['exports']=router;
\ No newline at end of file
index 085a004..41a132b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc340=['sequelize','STRING','username','remoteUri'];(function(_0x3d6904,_0x20c455){var _0x374f9e=function(_0xe72b40){while(--_0xe72b40){_0x3d6904['push'](_0x3d6904['shift']());}};_0x374f9e(++_0x20c455);}(_0xc340,0xa0));var _0x0c34=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xc340[_0x21a9d9];return _0x46adce;};'use strict';var Sequelize=require(_0x0c34('0x0'));module['exports']={'name':{'type':Sequelize[_0x0c34('0x1')]},'description':{'type':Sequelize[_0x0c34('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x0c34('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x0c34('0x1')]},'remoteUri':{'type':Sequelize[_0x0c34('0x1')],'unique':_0x0c34('0x3')},'serverUrl':{'type':Sequelize[_0x0c34('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x34c4=['remoteUri','exports','STRING'];(function(_0x1f50a6,_0x1c5a28){var _0x4d9da1=function(_0x18dbb8){while(--_0x18dbb8){_0x1f50a6['push'](_0x1f50a6['shift']());}};_0x4d9da1(++_0x1c5a28);}(_0x34c4,0xb5));var _0x434c=function(_0x22759a,_0x360a48){_0x22759a=_0x22759a-0x0;var _0x4ea5da=_0x34c4[_0x22759a];return _0x4ea5da;};'use strict';var Sequelize=require('sequelize');module[_0x434c('0x0')]={'name':{'type':Sequelize[_0x434c('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x434c('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x434c('0x1')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x434c('0x1')],'unique':_0x434c('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index be542e3..9e37711 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6308=['VIRTUAL','merge','options','then','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','length','find','create','body','destroy','getConfigurations','ServicenowConfiguration','filter','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','getDescriptions','getFields','knowledge','subcategory','close_code','notify','severity','parent','watch_list','upon_reject','sys_updated_on','child_incidents','hold_reason','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','order','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','sys_domain_path','rfc','time_worked','expected_start','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','sla_due','approval','due_date','sys_mod_count','sys_tags','escalation','upon_approval','location','category','password','email','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','result','log','incident\x20table\x20objects','assign','includes','forEach','internalType','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','push','all','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True','true','False','false','GET','sys_choice?sysparm_query=name=incident^element=','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','json','offset','undefined','limit','count','status','Content-Range','apply','reject','update','end','error','stack','name','index','map','ServicenowAccount','fieldName','type','key','model','query','filters','intersection','fields','attributes','nolimit','sort','where','pick'];(function(_0x4b23d3,_0x332657){var _0x459c0f=function(_0x7770ee){while(--_0x7770ee){_0x4b23d3['push'](_0x4b23d3['shift']());}};_0x459c0f(++_0x332657);}(_0x6308,0x85));var _0x8630=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0x6308[_0x456fb1];return _0x4083d6;};'use strict';var emlformat=require(_0x8630('0x0'));var rimraf=require(_0x8630('0x1'));var zipdir=require(_0x8630('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8630('0x3'));var moment=require('moment');var BPromise=require(_0x8630('0x4'));var Mustache=require(_0x8630('0x5'));var util=require(_0x8630('0x6'));var path=require('path');var sox=require(_0x8630('0x7'));var csv=require(_0x8630('0x8'));var ejs=require(_0x8630('0x9'));var fs=require('fs');var fs_extra=require(_0x8630('0xa'));var _=require(_0x8630('0xb'));var squel=require(_0x8630('0xc'));var crypto=require(_0x8630('0xd'));var jsforce=require(_0x8630('0xe'));var deskjs=require(_0x8630('0xf'));var toCsv=require(_0x8630('0x8'));var querystring=require(_0x8630('0x10'));var Papa=require(_0x8630('0x11'));var Redis=require(_0x8630('0x12'));var authService=require(_0x8630('0x13'));var qs=require(_0x8630('0x14'));var as=require(_0x8630('0x15'));var hardwareService=require(_0x8630('0x16'));var logger=require(_0x8630('0x17'))(_0x8630('0x18'));var utils=require(_0x8630('0x19'));var config=require(_0x8630('0x1a'));var licenseUtil=require(_0x8630('0x1b'));var db=require(_0x8630('0x1c'))['db'];var integrations=require(_0x8630('0x1d'));function respondWithStatusCode(_0x2d7476,_0x51597f){_0x51597f=_0x51597f||0xcc;return function(_0x4b0297){if(_0x4b0297){return _0x2d7476[_0x8630('0x1e')](_0x51597f);}return _0x2d7476['status'](_0x51597f)['end']();};}function respondWithResult(_0x19557d,_0xcd7c86){_0xcd7c86=_0xcd7c86||0xc8;return function(_0x3e5229){if(_0x3e5229){return _0x19557d['status'](_0xcd7c86)[_0x8630('0x1f')](_0x3e5229);}};}function respondWithFilteredResult(_0x2dee81,_0xd4193b){return function(_0x38e12b){if(_0x38e12b){var _0x52a1de=typeof _0xd4193b[_0x8630('0x20')]===_0x8630('0x21')&&typeof _0xd4193b[_0x8630('0x22')]===_0x8630('0x21');var _0x559f82=_0x38e12b[_0x8630('0x23')];var _0x45b84e=_0x52a1de?0x0:_0xd4193b[_0x8630('0x20')];var _0x58a853=_0x52a1de?_0x38e12b[_0x8630('0x23')]:_0xd4193b[_0x8630('0x20')]+_0xd4193b[_0x8630('0x22')];var _0x47d104;if(_0x58a853>=_0x559f82){_0x58a853=_0x559f82;_0x47d104=0xc8;}else{_0x47d104=0xce;}_0x2dee81[_0x8630('0x24')](_0x47d104);return _0x2dee81['set'](_0x8630('0x25'),_0x45b84e+'-'+_0x58a853+'/'+_0x559f82)[_0x8630('0x1f')](_0x38e12b);}return null;};}function patchUpdates(_0x193ca0){return function(_0x38c853){try{jsonpatch[_0x8630('0x26')](_0x38c853,_0x193ca0,!![]);}catch(_0x396f48){return BPromise[_0x8630('0x27')](_0x396f48);}return _0x38c853['save']();};}function saveUpdates(_0x53e71c,_0xe2c124){return function(_0xa10c6f){if(_0xa10c6f){return _0xa10c6f[_0x8630('0x28')](_0x53e71c)['then'](function(_0x3e21e9){return _0x3e21e9;});}return null;};}function removeEntity(_0x20831b,_0x53fb06){return function(_0x5df3ea){if(_0x5df3ea){return _0x5df3ea['destroy']()['then'](function(){_0x20831b[_0x8630('0x24')](0xcc)[_0x8630('0x29')]();});}};}function handleEntityNotFound(_0x416e8f,_0x19d77f){return function(_0x1edeb6){if(!_0x1edeb6){_0x416e8f[_0x8630('0x1e')](0x194);}return _0x1edeb6;};}function handleError(_0x44c2b4,_0x7b40f0){_0x7b40f0=_0x7b40f0||0x1f4;return function(_0x138bcd){logger[_0x8630('0x2a')](_0x138bcd[_0x8630('0x2b')]);if(_0x138bcd['name']){delete _0x138bcd[_0x8630('0x2c')];}_0x44c2b4[_0x8630('0x24')](_0x7b40f0)['send'](_0x138bcd);};}exports[_0x8630('0x2d')]=function(_0x5a6265,_0x58358b){var _0x443088={},_0x46f7ea={},_0x2791d6={'count':0x0,'rows':[]};var _0x52b04f=_[_0x8630('0x2e')](db[_0x8630('0x2f')]['rawAttributes'],function(_0x150433){return{'name':_0x150433[_0x8630('0x30')],'type':_0x150433[_0x8630('0x31')][_0x8630('0x32')]};});_0x46f7ea[_0x8630('0x33')]=_[_0x8630('0x2e')](_0x52b04f,_0x8630('0x2c'));_0x46f7ea[_0x8630('0x34')]=_['keys'](_0x5a6265[_0x8630('0x34')]);_0x46f7ea[_0x8630('0x35')]=_[_0x8630('0x36')](_0x46f7ea[_0x8630('0x33')],_0x46f7ea[_0x8630('0x34')]);_0x443088['attributes']=_[_0x8630('0x36')](_0x46f7ea[_0x8630('0x33')],qs['fields'](_0x5a6265[_0x8630('0x34')][_0x8630('0x37')]));_0x443088[_0x8630('0x38')]=_0x443088[_0x8630('0x38')]['length']?_0x443088[_0x8630('0x38')]:_0x46f7ea[_0x8630('0x33')];if(!_0x5a6265[_0x8630('0x34')]['hasOwnProperty'](_0x8630('0x39'))){_0x443088[_0x8630('0x22')]=qs[_0x8630('0x22')](_0x5a6265[_0x8630('0x34')][_0x8630('0x22')]);_0x443088[_0x8630('0x20')]=qs[_0x8630('0x20')](_0x5a6265['query']['offset']);}_0x443088['order']=qs[_0x8630('0x3a')](_0x5a6265['query'][_0x8630('0x3a')]);_0x443088[_0x8630('0x3b')]=qs[_0x8630('0x35')](_[_0x8630('0x3c')](_0x5a6265[_0x8630('0x34')],_0x46f7ea[_0x8630('0x35')]),_0x52b04f);if(_0x5a6265[_0x8630('0x34')]['filter']){_0x443088[_0x8630('0x3b')]=_['merge'](_0x443088[_0x8630('0x3b')],{'$or':_[_0x8630('0x2e')](_0x52b04f,function(_0x4c2231){if(_0x4c2231[_0x8630('0x31')]!==_0x8630('0x3d')){var _0x1124b6={};_0x1124b6[_0x4c2231[_0x8630('0x2c')]]={'$like':'%'+_0x5a6265[_0x8630('0x34')]['filter']+'%'};return _0x1124b6;}})});}_0x443088=_[_0x8630('0x3e')]({},_0x443088,_0x5a6265[_0x8630('0x3f')]);var _0x45d27f={'where':_0x443088[_0x8630('0x3b')]};return db['ServicenowAccount']['count'](_0x45d27f)[_0x8630('0x40')](function(_0xaa0016){_0x2791d6[_0x8630('0x23')]=_0xaa0016;if(_0x5a6265[_0x8630('0x34')][_0x8630('0x41')]){_0x443088[_0x8630('0x42')]=[{'all':!![]}];}return db[_0x8630('0x2f')][_0x8630('0x43')](_0x443088);})[_0x8630('0x40')](function(_0x3a5950){_0x2791d6[_0x8630('0x44')]=_0x3a5950;return _0x2791d6;})['then'](respondWithFilteredResult(_0x58358b,_0x443088))[_0x8630('0x45')](handleError(_0x58358b,null));};exports['show']=function(_0x5f1556,_0x337975){var _0x1bb1c4={'raw':![],'where':{'id':_0x5f1556[_0x8630('0x46')]['id']}},_0x10f72f={};_0x10f72f[_0x8630('0x33')]=_[_0x8630('0x47')](db[_0x8630('0x2f')][_0x8630('0x48')]);_0x10f72f['query']=_[_0x8630('0x47')](_0x5f1556[_0x8630('0x34')]);_0x10f72f[_0x8630('0x35')]=_[_0x8630('0x36')](_0x10f72f[_0x8630('0x33')],_0x10f72f['query']);_0x1bb1c4[_0x8630('0x38')]=_[_0x8630('0x36')](_0x10f72f[_0x8630('0x33')],qs[_0x8630('0x37')](_0x5f1556[_0x8630('0x34')][_0x8630('0x37')]));_0x1bb1c4[_0x8630('0x38')]=_0x1bb1c4['attributes'][_0x8630('0x49')]?_0x1bb1c4[_0x8630('0x38')]:_0x10f72f[_0x8630('0x33')];if(_0x5f1556[_0x8630('0x34')][_0x8630('0x41')]){_0x1bb1c4['include']=[{'all':!![]}];}_0x1bb1c4=_[_0x8630('0x3e')]({},_0x1bb1c4,_0x5f1556[_0x8630('0x3f')]);return db[_0x8630('0x2f')][_0x8630('0x4a')](_0x1bb1c4)[_0x8630('0x40')](handleEntityNotFound(_0x337975,null))['then'](respondWithResult(_0x337975,null))[_0x8630('0x45')](handleError(_0x337975,null));};exports[_0x8630('0x4b')]=function(_0x572426,_0x1aef56){return db[_0x8630('0x2f')][_0x8630('0x4b')](_0x572426[_0x8630('0x4c')],{})[_0x8630('0x40')](respondWithResult(_0x1aef56,0xc9))[_0x8630('0x45')](handleError(_0x1aef56,null));};exports[_0x8630('0x28')]=function(_0x35229a,_0x52fe49){if(_0x35229a[_0x8630('0x4c')]['id']){delete _0x35229a[_0x8630('0x4c')]['id'];}return db[_0x8630('0x2f')][_0x8630('0x4a')]({'where':{'id':_0x35229a[_0x8630('0x46')]['id']}})[_0x8630('0x40')](handleEntityNotFound(_0x52fe49,null))[_0x8630('0x40')](saveUpdates(_0x35229a[_0x8630('0x4c')],null))[_0x8630('0x40')](respondWithResult(_0x52fe49,null))['catch'](handleError(_0x52fe49,null));};exports[_0x8630('0x4d')]=function(_0x5724ba,_0x35b822){return db[_0x8630('0x2f')][_0x8630('0x4a')]({'where':{'id':_0x5724ba[_0x8630('0x46')]['id']}})[_0x8630('0x40')](handleEntityNotFound(_0x35b822,null))[_0x8630('0x40')](removeEntity(_0x35b822,null))['catch'](handleError(_0x35b822,null));};exports[_0x8630('0x4e')]=function(_0x589188,_0x46822e,_0x2f1cc4){var _0x1656bb={};var _0x522a2f={};var _0x4985d7;var _0x523508;return db[_0x8630('0x2f')]['findOne']({'where':{'id':_0x589188[_0x8630('0x46')]['id']}})[_0x8630('0x40')](handleEntityNotFound(_0x46822e,null))[_0x8630('0x40')](function(_0x48cd5e){if(_0x48cd5e){_0x4985d7=_0x48cd5e;_0x522a2f[_0x8630('0x33')]=_[_0x8630('0x47')](db[_0x8630('0x4f')][_0x8630('0x48')]);_0x522a2f[_0x8630('0x34')]=_['keys'](_0x589188[_0x8630('0x34')]);_0x522a2f[_0x8630('0x35')]=_[_0x8630('0x36')](_0x522a2f[_0x8630('0x33')],_0x522a2f[_0x8630('0x34')]);_0x1656bb[_0x8630('0x38')]=_[_0x8630('0x36')](_0x522a2f['model'],qs[_0x8630('0x37')](_0x589188['query'][_0x8630('0x37')]));_0x1656bb['attributes']=_0x1656bb['attributes'][_0x8630('0x49')]?_0x1656bb[_0x8630('0x38')]:_0x522a2f[_0x8630('0x33')];_0x1656bb['order']=qs['sort'](_0x589188[_0x8630('0x34')]['sort']);_0x1656bb[_0x8630('0x3b')]=qs[_0x8630('0x35')](_[_0x8630('0x3c')](_0x589188[_0x8630('0x34')],_0x522a2f[_0x8630('0x35')]));if(_0x589188[_0x8630('0x34')]['filter']){_0x1656bb[_0x8630('0x3b')]=_['merge'](_0x1656bb['where'],{'$or':_[_0x8630('0x2e')](_0x1656bb['attributes'],function(_0x539504){var _0x5693f6={};_0x5693f6[_0x539504]={'$like':'%'+_0x589188[_0x8630('0x34')][_0x8630('0x50')]+'%'};return _0x5693f6;})});}_0x1656bb=_['merge']({},_0x1656bb,_0x589188[_0x8630('0x3f')]);return _0x4985d7['getConfigurations'](_0x1656bb);}})[_0x8630('0x40')](function(_0x3b1f42){if(_0x3b1f42){_0x523508=_0x3b1f42[_0x8630('0x49')];if(!_0x589188[_0x8630('0x34')][_0x8630('0x51')](_0x8630('0x39'))){_0x1656bb[_0x8630('0x22')]=qs['limit'](_0x589188['query']['limit']);_0x1656bb[_0x8630('0x20')]=qs[_0x8630('0x20')](_0x589188[_0x8630('0x34')]['offset']);}return _0x4985d7['getConfigurations'](_0x1656bb);}})[_0x8630('0x40')](function(_0x3a19e7){if(_0x3a19e7){return _0x3a19e7?{'count':_0x523508,'rows':_0x3a19e7}:null;}})['then'](respondWithResult(_0x46822e,null))['catch'](handleError(_0x46822e,null));};exports[_0x8630('0x52')]=function(_0x2f73d7,_0x1aa4e1,_0x38e7bf){if(_0x2f73d7[_0x8630('0x4c')]['id']){delete _0x2f73d7[_0x8630('0x4c')]['id'];}return db[_0x8630('0x2f')][_0x8630('0x53')]({'where':{'id':_0x2f73d7[_0x8630('0x46')]['id']}})[_0x8630('0x40')](handleEntityNotFound(_0x1aa4e1,null))['then'](function(_0x53c446){if(_0x53c446){_0x2f73d7[_0x8630('0x4c')][_0x8630('0x54')]=_0x53c446['id'];_0x2f73d7['body'][_0x8630('0x55')]=integrations['getSubjects'](_0x2f73d7[_0x8630('0x4c')][_0x8630('0x56')],_0x2f73d7[_0x8630('0x4c')][_0x8630('0x31')]);_0x2f73d7['body'][_0x8630('0x57')]=integrations[_0x8630('0x58')](_0x2f73d7[_0x8630('0x4c')][_0x8630('0x56')],_0x2f73d7[_0x8630('0x4c')]['type']);return db[_0x8630('0x4f')]['create'](_0x2f73d7[_0x8630('0x4c')],{'include':[{'model':db['ServicenowField'],'as':_0x8630('0x55')},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})[_0x8630('0x40')](respondWithResult(_0x1aa4e1,null))[_0x8630('0x45')](handleError(_0x1aa4e1,null));};exports[_0x8630('0x59')]=function(_0x8311cc,_0x545ff2,_0x2967d9){var _0x5f38e5=['made_sla','hold_reason',_0x8630('0x5a'),_0x8630('0x5b'),_0x8630('0x5c'),_0x8630('0x5d'),'incident_state',_0x8630('0x5e'),'category'];var _0x2ee5b8=[_0x8630('0x5f'),'made_sla','caused_by',_0x8630('0x60'),_0x8630('0x61'),_0x8630('0x62'),_0x8630('0x63'),_0x8630('0x64'),_0x8630('0x65'),_0x8630('0x66'),_0x8630('0x67'),_0x8630('0x68'),_0x8630('0x69'),_0x8630('0x6a'),_0x8630('0x6b'),_0x8630('0x6c'),_0x8630('0x6d'),_0x8630('0x6e'),_0x8630('0x5a'),_0x8630('0x6f'),'calendar_stc','closed_at',_0x8630('0x70'),_0x8630('0x71'),_0x8630('0x72'),_0x8630('0x73'),_0x8630('0x74'),_0x8630('0x75'),'priority',_0x8630('0x76'),_0x8630('0x77'),_0x8630('0x78'),_0x8630('0x79'),'opened_at',_0x8630('0x7a'),_0x8630('0x7b'),_0x8630('0x7c'),_0x8630('0x7d'),_0x8630('0x7e'),_0x8630('0x7f'),_0x8630('0x80'),_0x8630('0x5b'),_0x8630('0x81'),_0x8630('0x82'),'close_code',_0x8630('0x83'),_0x8630('0x84'),'work_start',_0x8630('0x85'),_0x8630('0x86'),_0x8630('0x87'),_0x8630('0x88'),_0x8630('0x89'),_0x8630('0x5d'),'sys_class_name',_0x8630('0x8a'),_0x8630('0x8b'),_0x8630('0x8c'),_0x8630('0x8d'),_0x8630('0x8e'),'contact_type',_0x8630('0x8f'),'incident_state',_0x8630('0x90'),_0x8630('0x91'),_0x8630('0x92'),_0x8630('0x93'),_0x8630('0x94'),_0x8630('0x95'),_0x8630('0x5e'),_0x8630('0x96'),_0x8630('0x97'),_0x8630('0x98'),'comments_and_work_notes',_0x8630('0x99'),_0x8630('0x9a'),'reopen_count',_0x8630('0x9b'),_0x8630('0x9c'),_0x8630('0x9d'),'correlation_id',_0x8630('0x9e'),_0x8630('0x9f')];var _0x426953='';var _0x1f02c0='';var _0x39ef0c=[];var _0x4d6e79='';var _0x357155='';var _0x3d0af6=[];var _0x18c4bd='';var _0x538be0='';var _0x43053c={};var _0xfb08bf='';return db['ServicenowAccount']['findOne']({'where':{'id':_0x8311cc[_0x8630('0x46')]['id']},'attributes':['id','username',_0x8630('0xa0'),_0x8630('0xa1'),_0x8630('0xa2'),_0x8630('0xa3')]})[_0x8630('0x40')](handleEntityNotFound(_0x545ff2,null))['then'](function(_0x4f2fe0){if(_0x4f2fe0){_0xfb08bf=_0x4f2fe0[_0x8630('0xa2')];var _0x1a074d=_0xfb08bf[_0x8630('0xa4')](-0x1);if(_0x1a074d==='/'){_0xfb08bf=_0xfb08bf[_0x8630('0xa5')](0x0,_0xfb08bf[_0x8630('0xa6')](_0x1a074d));}_0x538be0=util[_0x8630('0xa7')](_0x8630('0xa8'),_0xfb08bf);_0x18c4bd=util[_0x8630('0xa7')](_0x8630('0xa9'),_0xfb08bf);_0x43053c={'user':_0x4f2fe0[_0x8630('0xaa')],'pass':_0x4f2fe0[_0x8630('0xa0')]};var _0x22e810={'method':'GET','uri':_0x538be0+'incident?sysparm_display_value=all','auth':_0x43053c,'json':!![]};return rp(_0x22e810);}})['then'](function(_0x3d522a){if(_0x3d522a[_0x8630('0xab')][_0x8630('0x49')]>0x0){_0x426953=_0x3d522a[_0x8630('0xab')];}console[_0x8630('0xac')](_0x8630('0xad'),_0x426953);_0x3d0af6=[];_0x1f02c0=Object[_0x8630('0xae')]([],_0x426953);_['remove'](_0x1f02c0,function(_0x172d43){return!_0x5f38e5[_0x8630('0xaf')](_0x172d43[_0x8630('0x2c')]);});_0x1f02c0[_0x8630('0xb0')](function(_0x27a1b1){var _0x176a82=createFieldObject(_0x18c4bd,_0x43053c,_0x27a1b1[_0x8630('0xb1')],_0x27a1b1[_0x8630('0x2c')],_0x27a1b1['label'],![]);_0x3d0af6['push'](_0x176a82);});return Promise['all'](_0x3d0af6);})[_0x8630('0x40')](function(_0x271bee){_0x39ef0c=_0x271bee;_0x4d6e79=Object[_0x8630('0xae')]([],_0x426953);console[_0x8630('0xac')](_0x8630('0xb2'),_0x426953);_['remove'](_0x4d6e79,function(_0x21017f){return _0x2ee5b8[_0x8630('0xaf')](_0x21017f[_0x8630('0x2c')]);});console[_0x8630('0xac')](_0x8630('0xb3'),_0x4d6e79);_0x3d0af6=[];_0x4d6e79['forEach'](function(_0x17487d){var _0x133a8c=createFieldObject(_0x18c4bd,_0x43053c,_0x17487d[_0x8630('0xb1')],_0x17487d['name'],_0x17487d[_0x8630('0xb4')],!![]);_0x3d0af6[_0x8630('0xb5')](_0x133a8c);});return Promise[_0x8630('0xb6')](_0x3d0af6);})['then'](function(_0x424560){_0x357155=_0x424560;var _0x3dd9f2=_0x39ef0c['concat'](_0x357155);return{'count':_0x3dd9f2[_0x8630('0x49')],'rows':_0x3dd9f2};})[_0x8630('0x40')](respondWithResult(_0x545ff2,null))[_0x8630('0x45')](function(_0x4f6df7){console['log'](_0x8630('0xb7')+_0x4f6df7);var _0x435146=_0x8311cc['query'][_0x8630('0xb8')]?0x1f4:_0x4f6df7[_0x8630('0xb9')]||0x1f4;logger[_0x8630('0x2a')](_0x4f6df7[_0x8630('0x2b')]);delete _0x4f6df7[_0x8630('0x2c')];if(_0x435146===0x191){_0x435146=0x190;}_0x545ff2[_0x8630('0x24')](_0x435146)['send'](_0x8311cc[_0x8630('0x34')][_0x8630('0xb8')]?{'message':_0x8630('0xba'),'statusCode':_0x4f6df7[_0x8630('0xb9')]}:_0x4f6df7);});};function createFieldObject(_0x4cf47c,_0x1b730b,_0x24690f,_0x2b5cea,_0x4dfac5,_0x1afce8){return new Promise(function(_0x4f1c55,_0x201d28){var _0x1a32e7={'id':_0x2b5cea,'name':_0x4dfac5,'custom':_0x1afce8};if(_0x24690f===_0x8630('0xbb')){_0x1a32e7[_0x8630('0x3f')]=[{'name':_0x8630('0xbc'),'value':_0x8630('0xbd')},{'name':_0x8630('0xbe'),'value':_0x8630('0xbf')}];_0x4f1c55(_0x1a32e7);}else{var _0x5e2e82={'method':_0x8630('0xc0'),'uri':_0x4cf47c+_0x8630('0xc1')+_0x2b5cea,'auth':_0x1b730b,'json':!![]};return rp(_0x5e2e82)['then'](function(_0x11bc22){var _0x34ea26=[];if(_0x11bc22['result'][_0x8630('0x49')]>0x0){_0x11bc22[_0x8630('0xab')][_0x8630('0xb0')](function(_0x92617){if(_0x92617['inactive']==='false'){var _0x3d3951={'name':_0x92617[_0x8630('0xb4')],'value':_0x92617['value']};_0x34ea26['push'](_0x3d3951);}});}_0x1a32e7[_0x8630('0x3f')]=_0x34ea26;if(_0x1a32e7[_0x8630('0x3f')][_0x8630('0x49')]>0x0){_0x4f1c55(_0x1a32e7);}else{if(_0x1afce8==![]){_0x4f1c55();}else{_0x4f1c55(_0x1a32e7);}}});}});}
\ No newline at end of file
+var _0x02b9=['offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','index','map','ServicenowAccount','rawAttributes','fieldName','type','model','name','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','findAll','rows','params','include','options','find','catch','create','body','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','subcategory','notify','incident_state','severity','category','parent','watch_list','upon_reject','sys_updated_on','child_incidents','number','resolved_by','opened_by','user_input','sys_created_on','sys_domain','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','work_notes_list','business_service','priority','sys_domain_path','rfc','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','close_code','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','comments','approval','comments_and_work_notes','due_date','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','location','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','incident\x20table\x20objects','assign','includes','forEach','internalType','label','push','all','log','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','test','statusCode','send','True','False','sys_choice?sysparm_query=name=incident^element=','inactive','false','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json'];(function(_0xc096ec,_0x21acad){var _0x4b9712=function(_0x2f5659){while(--_0x2f5659){_0xc096ec['push'](_0xc096ec['shift']());}};_0x4b9712(++_0x21acad);}(_0x02b9,0xa1));var _0x902b=function(_0x4aa2a0,_0x505424){_0x4aa2a0=_0x4aa2a0-0x0;var _0x97132e=_0x02b9[_0x4aa2a0];return _0x97132e;};'use strict';var emlformat=require(_0x902b('0x0'));var rimraf=require(_0x902b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x902b('0x2'));var moment=require(_0x902b('0x3'));var BPromise=require(_0x902b('0x4'));var Mustache=require(_0x902b('0x5'));var util=require('util');var path=require(_0x902b('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(_0x902b('0x7'));var squel=require('squel');var crypto=require(_0x902b('0x8'));var jsforce=require(_0x902b('0x9'));var deskjs=require(_0x902b('0xa'));var toCsv=require(_0x902b('0xb'));var querystring=require(_0x902b('0xc'));var Papa=require(_0x902b('0xd'));var Redis=require(_0x902b('0xe'));var authService=require(_0x902b('0xf'));var qs=require(_0x902b('0x10'));var as=require(_0x902b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x902b('0x12'))(_0x902b('0x13'));var utils=require(_0x902b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x902b('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0x902b('0x16'));function respondWithStatusCode(_0x4bd061,_0x34c117){_0x34c117=_0x34c117||0xcc;return function(_0x43e2d1){if(_0x43e2d1){return _0x4bd061[_0x902b('0x17')](_0x34c117);}return _0x4bd061[_0x902b('0x18')](_0x34c117)[_0x902b('0x19')]();};}function respondWithResult(_0xef82e6,_0x49a860){_0x49a860=_0x49a860||0xc8;return function(_0x24fdca){if(_0x24fdca){return _0xef82e6['status'](_0x49a860)[_0x902b('0x1a')](_0x24fdca);}};}function respondWithFilteredResult(_0x527148,_0x3811c1){return function(_0x100293){if(_0x100293){var _0x16eb95=typeof _0x3811c1[_0x902b('0x1b')]===_0x902b('0x1c')&&typeof _0x3811c1[_0x902b('0x1d')]===_0x902b('0x1c');var _0x22ae20=_0x100293['count'];var _0x37dcc6=_0x16eb95?0x0:_0x3811c1[_0x902b('0x1b')];var _0x1713ba=_0x16eb95?_0x100293[_0x902b('0x1e')]:_0x3811c1[_0x902b('0x1b')]+_0x3811c1['limit'];var _0x375d0e;if(_0x1713ba>=_0x22ae20){_0x1713ba=_0x22ae20;_0x375d0e=0xc8;}else{_0x375d0e=0xce;}_0x527148[_0x902b('0x18')](_0x375d0e);return _0x527148[_0x902b('0x1f')](_0x902b('0x20'),_0x37dcc6+'-'+_0x1713ba+'/'+_0x22ae20)[_0x902b('0x1a')](_0x100293);}return null;};}function patchUpdates(_0x5b3e81){return function(_0x5d6cf3){try{jsonpatch[_0x902b('0x21')](_0x5d6cf3,_0x5b3e81,!![]);}catch(_0x32c897){return BPromise['reject'](_0x32c897);}return _0x5d6cf3[_0x902b('0x22')]();};}function saveUpdates(_0x5ea363,_0x301d54){return function(_0x52f37d){if(_0x52f37d){return _0x52f37d[_0x902b('0x23')](_0x5ea363)[_0x902b('0x24')](function(_0x3b8b07){return _0x3b8b07;});}return null;};}function removeEntity(_0xa58ade,_0x4f5927){return function(_0x292f36){if(_0x292f36){return _0x292f36[_0x902b('0x25')]()[_0x902b('0x24')](function(){_0xa58ade['status'](0xcc)[_0x902b('0x19')]();});}};}function handleEntityNotFound(_0x5ec6c6,_0x2f510d){return function(_0x271a3c){if(!_0x271a3c){_0x5ec6c6['sendStatus'](0x194);}return _0x271a3c;};}function handleError(_0x3b28ca,_0xcc305){_0xcc305=_0xcc305||0x1f4;return function(_0x2fe5b0){logger[_0x902b('0x26')](_0x2fe5b0[_0x902b('0x27')]);if(_0x2fe5b0['name']){delete _0x2fe5b0['name'];}_0x3b28ca[_0x902b('0x18')](_0xcc305)['send'](_0x2fe5b0);};}exports[_0x902b('0x28')]=function(_0x459f28,_0x926e41){var _0x4ec129={},_0x8030f5={},_0x17c051={'count':0x0,'rows':[]};var _0x20d9c8=_[_0x902b('0x29')](db[_0x902b('0x2a')][_0x902b('0x2b')],function(_0x18b0d5){return{'name':_0x18b0d5[_0x902b('0x2c')],'type':_0x18b0d5[_0x902b('0x2d')]['key']};});_0x8030f5[_0x902b('0x2e')]=_[_0x902b('0x29')](_0x20d9c8,_0x902b('0x2f'));_0x8030f5['query']=_[_0x902b('0x30')](_0x459f28['query']);_0x8030f5[_0x902b('0x31')]=_[_0x902b('0x32')](_0x8030f5[_0x902b('0x2e')],_0x8030f5[_0x902b('0x33')]);_0x4ec129[_0x902b('0x34')]=_[_0x902b('0x32')](_0x8030f5['model'],qs[_0x902b('0x35')](_0x459f28[_0x902b('0x33')][_0x902b('0x35')]));_0x4ec129[_0x902b('0x34')]=_0x4ec129[_0x902b('0x34')][_0x902b('0x36')]?_0x4ec129[_0x902b('0x34')]:_0x8030f5[_0x902b('0x2e')];if(!_0x459f28['query'][_0x902b('0x37')](_0x902b('0x38'))){_0x4ec129[_0x902b('0x1d')]=qs[_0x902b('0x1d')](_0x459f28[_0x902b('0x33')]['limit']);_0x4ec129[_0x902b('0x1b')]=qs[_0x902b('0x1b')](_0x459f28['query']['offset']);}_0x4ec129[_0x902b('0x39')]=qs[_0x902b('0x3a')](_0x459f28['query'][_0x902b('0x3a')]);_0x4ec129['where']=qs['filters'](_[_0x902b('0x3b')](_0x459f28[_0x902b('0x33')],_0x8030f5[_0x902b('0x31')]),_0x20d9c8);if(_0x459f28['query'][_0x902b('0x3c')]){_0x4ec129[_0x902b('0x3d')]=_[_0x902b('0x3e')](_0x4ec129['where'],{'$or':_[_0x902b('0x29')](_0x20d9c8,function(_0x40eb6e){if(_0x40eb6e[_0x902b('0x2d')]!=='VIRTUAL'){var _0x31ee9d={};_0x31ee9d[_0x40eb6e[_0x902b('0x2f')]]={'$like':'%'+_0x459f28[_0x902b('0x33')][_0x902b('0x3c')]+'%'};return _0x31ee9d;}})});}_0x4ec129=_[_0x902b('0x3e')]({},_0x4ec129,_0x459f28['options']);var _0x59ff32={'where':_0x4ec129[_0x902b('0x3d')]};return db[_0x902b('0x2a')][_0x902b('0x1e')](_0x59ff32)[_0x902b('0x24')](function(_0x4d24d6){_0x17c051['count']=_0x4d24d6;if(_0x459f28['query'][_0x902b('0x3f')]){_0x4ec129['include']=[{'all':!![]}];}return db[_0x902b('0x2a')][_0x902b('0x40')](_0x4ec129);})[_0x902b('0x24')](function(_0x115dd0){_0x17c051[_0x902b('0x41')]=_0x115dd0;return _0x17c051;})['then'](respondWithFilteredResult(_0x926e41,_0x4ec129))['catch'](handleError(_0x926e41,null));};exports['show']=function(_0x17be3d,_0x3c1c1e){var _0x2d2dc6={'raw':![],'where':{'id':_0x17be3d[_0x902b('0x42')]['id']}},_0x3e3429={};_0x3e3429[_0x902b('0x2e')]=_[_0x902b('0x30')](db[_0x902b('0x2a')][_0x902b('0x2b')]);_0x3e3429[_0x902b('0x33')]=_[_0x902b('0x30')](_0x17be3d[_0x902b('0x33')]);_0x3e3429['filters']=_['intersection'](_0x3e3429['model'],_0x3e3429[_0x902b('0x33')]);_0x2d2dc6[_0x902b('0x34')]=_['intersection'](_0x3e3429['model'],qs['fields'](_0x17be3d[_0x902b('0x33')][_0x902b('0x35')]));_0x2d2dc6[_0x902b('0x34')]=_0x2d2dc6[_0x902b('0x34')]['length']?_0x2d2dc6[_0x902b('0x34')]:_0x3e3429[_0x902b('0x2e')];if(_0x17be3d[_0x902b('0x33')][_0x902b('0x3f')]){_0x2d2dc6[_0x902b('0x43')]=[{'all':!![]}];}_0x2d2dc6=_[_0x902b('0x3e')]({},_0x2d2dc6,_0x17be3d[_0x902b('0x44')]);return db[_0x902b('0x2a')][_0x902b('0x45')](_0x2d2dc6)[_0x902b('0x24')](handleEntityNotFound(_0x3c1c1e,null))[_0x902b('0x24')](respondWithResult(_0x3c1c1e,null))[_0x902b('0x46')](handleError(_0x3c1c1e,null));};exports[_0x902b('0x47')]=function(_0x4b13a7,_0x5613b1){return db[_0x902b('0x2a')][_0x902b('0x47')](_0x4b13a7[_0x902b('0x48')],{})['then'](respondWithResult(_0x5613b1,0xc9))[_0x902b('0x46')](handleError(_0x5613b1,null));};exports[_0x902b('0x23')]=function(_0x26af00,_0x84d277){if(_0x26af00[_0x902b('0x48')]['id']){delete _0x26af00['body']['id'];}return db[_0x902b('0x2a')][_0x902b('0x45')]({'where':{'id':_0x26af00['params']['id']}})[_0x902b('0x24')](handleEntityNotFound(_0x84d277,null))[_0x902b('0x24')](saveUpdates(_0x26af00[_0x902b('0x48')],null))[_0x902b('0x24')](respondWithResult(_0x84d277,null))[_0x902b('0x46')](handleError(_0x84d277,null));};exports[_0x902b('0x25')]=function(_0xa3020d,_0x4a9f06){return db[_0x902b('0x2a')][_0x902b('0x45')]({'where':{'id':_0xa3020d[_0x902b('0x42')]['id']}})[_0x902b('0x24')](handleEntityNotFound(_0x4a9f06,null))[_0x902b('0x24')](removeEntity(_0x4a9f06,null))['catch'](handleError(_0x4a9f06,null));};exports[_0x902b('0x49')]=function(_0x244424,_0x448ba1,_0x4bab32){var _0x464530={};var _0x19912a={};var _0x4e8580;var _0x2ce49a;return db[_0x902b('0x2a')][_0x902b('0x4a')]({'where':{'id':_0x244424['params']['id']}})['then'](handleEntityNotFound(_0x448ba1,null))[_0x902b('0x24')](function(_0x4cab55){if(_0x4cab55){_0x4e8580=_0x4cab55;_0x19912a[_0x902b('0x2e')]=_[_0x902b('0x30')](db[_0x902b('0x4b')][_0x902b('0x2b')]);_0x19912a[_0x902b('0x33')]=_[_0x902b('0x30')](_0x244424['query']);_0x19912a['filters']=_[_0x902b('0x32')](_0x19912a[_0x902b('0x2e')],_0x19912a[_0x902b('0x33')]);_0x464530[_0x902b('0x34')]=_[_0x902b('0x32')](_0x19912a[_0x902b('0x2e')],qs['fields'](_0x244424[_0x902b('0x33')][_0x902b('0x35')]));_0x464530[_0x902b('0x34')]=_0x464530[_0x902b('0x34')][_0x902b('0x36')]?_0x464530[_0x902b('0x34')]:_0x19912a[_0x902b('0x2e')];_0x464530['order']=qs[_0x902b('0x3a')](_0x244424[_0x902b('0x33')][_0x902b('0x3a')]);_0x464530['where']=qs[_0x902b('0x31')](_[_0x902b('0x3b')](_0x244424[_0x902b('0x33')],_0x19912a['filters']));if(_0x244424[_0x902b('0x33')][_0x902b('0x3c')]){_0x464530[_0x902b('0x3d')]=_['merge'](_0x464530[_0x902b('0x3d')],{'$or':_[_0x902b('0x29')](_0x464530[_0x902b('0x34')],function(_0x44b63b){var _0x175f06={};_0x175f06[_0x44b63b]={'$like':'%'+_0x244424[_0x902b('0x33')]['filter']+'%'};return _0x175f06;})});}_0x464530=_[_0x902b('0x3e')]({},_0x464530,_0x244424[_0x902b('0x44')]);return _0x4e8580['getConfigurations'](_0x464530);}})[_0x902b('0x24')](function(_0x33efd4){if(_0x33efd4){_0x2ce49a=_0x33efd4[_0x902b('0x36')];if(!_0x244424[_0x902b('0x33')][_0x902b('0x37')]('nolimit')){_0x464530[_0x902b('0x1d')]=qs[_0x902b('0x1d')](_0x244424[_0x902b('0x33')][_0x902b('0x1d')]);_0x464530[_0x902b('0x1b')]=qs[_0x902b('0x1b')](_0x244424[_0x902b('0x33')]['offset']);}return _0x4e8580[_0x902b('0x49')](_0x464530);}})['then'](function(_0x3c939e){if(_0x3c939e){return _0x3c939e?{'count':_0x2ce49a,'rows':_0x3c939e}:null;}})[_0x902b('0x24')](respondWithResult(_0x448ba1,null))[_0x902b('0x46')](handleError(_0x448ba1,null));};exports[_0x902b('0x4c')]=function(_0x9c8c9c,_0x49e4e4,_0x110402){if(_0x9c8c9c[_0x902b('0x48')]['id']){delete _0x9c8c9c[_0x902b('0x48')]['id'];}return db[_0x902b('0x2a')][_0x902b('0x4a')]({'where':{'id':_0x9c8c9c['params']['id']}})[_0x902b('0x24')](handleEntityNotFound(_0x49e4e4,null))[_0x902b('0x24')](function(_0x244c37){if(_0x244c37){_0x9c8c9c[_0x902b('0x48')][_0x902b('0x4d')]=_0x244c37['id'];_0x9c8c9c[_0x902b('0x48')][_0x902b('0x4e')]=integrations[_0x902b('0x4f')](_0x9c8c9c['body'][_0x902b('0x50')],_0x9c8c9c[_0x902b('0x48')][_0x902b('0x2d')]);_0x9c8c9c[_0x902b('0x48')][_0x902b('0x51')]=integrations['getDescriptions'](_0x9c8c9c[_0x902b('0x48')]['channel'],_0x9c8c9c[_0x902b('0x48')][_0x902b('0x2d')]);return db[_0x902b('0x4b')][_0x902b('0x47')](_0x9c8c9c['body'],{'include':[{'model':db['ServicenowField'],'as':'Subjects'},{'model':db[_0x902b('0x52')],'as':_0x902b('0x51')}]});}return null;})['then'](respondWithResult(_0x49e4e4,null))['catch'](handleError(_0x49e4e4,null));};exports[_0x902b('0x53')]=function(_0x3cf839,_0x52b364,_0xab373e){var _0x41d438=[_0x902b('0x54'),_0x902b('0x55'),_0x902b('0x56'),_0x902b('0x57'),'close_code',_0x902b('0x58'),_0x902b('0x59'),_0x902b('0x5a'),_0x902b('0x5b')];var _0xbf3097=[_0x902b('0x5c'),_0x902b('0x54'),'caused_by',_0x902b('0x5d'),_0x902b('0x5e'),_0x902b('0x5f'),_0x902b('0x60'),_0x902b('0x55'),'approval_history',_0x902b('0x61'),_0x902b('0x62'),'sys_updated_by',_0x902b('0x63'),_0x902b('0x64'),_0x902b('0x65'),_0x902b('0x66'),'state',_0x902b('0x67'),'knowledge',_0x902b('0x39'),_0x902b('0x68'),_0x902b('0x69'),_0x902b('0x6a'),_0x902b('0x6b'),_0x902b('0x6c'),'active',_0x902b('0x6d'),_0x902b('0x6e'),_0x902b('0x6f'),_0x902b('0x70'),_0x902b('0x71'),'time_worked',_0x902b('0x72'),_0x902b('0x73'),_0x902b('0x74'),_0x902b('0x75'),_0x902b('0x76'),_0x902b('0x77'),_0x902b('0x78'),_0x902b('0x79'),_0x902b('0x7a'),_0x902b('0x57'),_0x902b('0x7b'),_0x902b('0x7c'),_0x902b('0x7d'),_0x902b('0x7e'),_0x902b('0x7f'),_0x902b('0x80'),_0x902b('0x81'),_0x902b('0x82'),_0x902b('0x83'),_0x902b('0x84'),'calendar_duration','notify',_0x902b('0x85'),_0x902b('0x86'),_0x902b('0x87'),_0x902b('0x88'),_0x902b('0x89'),_0x902b('0x8a'),_0x902b('0x8b'),_0x902b('0x8c'),'incident_state',_0x902b('0x8d'),_0x902b('0x8e'),_0x902b('0x8f'),_0x902b('0x90'),_0x902b('0x91'),_0x902b('0x92'),'severity',_0x902b('0x93'),'sla_due',_0x902b('0x94'),_0x902b('0x95'),_0x902b('0x96'),_0x902b('0x97'),'reopen_count',_0x902b('0x98'),_0x902b('0x99'),_0x902b('0x9a'),_0x902b('0x9b'),_0x902b('0x9c'),_0x902b('0x5b')];var _0x5ee36d='';var _0x796766='';var _0x510b3e=[];var _0x1f67f1='';var _0x4ac308='';var _0x1390e5=[];var _0x4351a9='';var _0x4da4ac='';var _0x2aaa13={};var _0x1e2b3f='';return db[_0x902b('0x2a')][_0x902b('0x4a')]({'where':{'id':_0x3cf839[_0x902b('0x42')]['id']},'attributes':['id',_0x902b('0x9d'),_0x902b('0x9e'),'email',_0x902b('0x9f'),_0x902b('0xa0')]})[_0x902b('0x24')](handleEntityNotFound(_0x52b364,null))[_0x902b('0x24')](function(_0x2ab3b3){if(_0x2ab3b3){_0x1e2b3f=_0x2ab3b3['remoteUri'];var _0x41b93c=_0x1e2b3f[_0x902b('0xa1')](-0x1);if(_0x41b93c==='/'){_0x1e2b3f=_0x1e2b3f[_0x902b('0xa2')](0x0,_0x1e2b3f[_0x902b('0xa3')](_0x41b93c));}_0x4da4ac=util['format'](_0x902b('0xa4'),_0x1e2b3f);_0x4351a9=util[_0x902b('0xa5')](_0x902b('0xa6'),_0x1e2b3f);_0x2aaa13={'user':_0x2ab3b3[_0x902b('0x9d')],'pass':_0x2ab3b3['password']};var _0x51c407={'method':_0x902b('0xa7'),'uri':_0x4da4ac+_0x902b('0xa8'),'auth':_0x2aaa13,'json':!![]};return rp(_0x51c407);}})[_0x902b('0x24')](function(_0x2c9062){if(_0x2c9062[_0x902b('0xa9')]['length']>0x0){_0x5ee36d=_0x2c9062[_0x902b('0xa9')];}console['log'](_0x902b('0xaa'),_0x5ee36d);_0x1390e5=[];_0x796766=Object[_0x902b('0xab')]([],_0x5ee36d);_['remove'](_0x796766,function(_0x23a53f){return!_0x41d438[_0x902b('0xac')](_0x23a53f[_0x902b('0x2f')]);});_0x796766[_0x902b('0xad')](function(_0x47b90c){var _0x3bbc96=createFieldObject(_0x4351a9,_0x2aaa13,_0x47b90c[_0x902b('0xae')],_0x47b90c[_0x902b('0x2f')],_0x47b90c[_0x902b('0xaf')],![]);_0x1390e5[_0x902b('0xb0')](_0x3bbc96);});return Promise[_0x902b('0xb1')](_0x1390e5);})[_0x902b('0x24')](function(_0x34067e){_0x510b3e=_0x34067e;_0x1f67f1=Object[_0x902b('0xab')]([],_0x5ee36d);console[_0x902b('0xb2')]('TCL:\x20_object',_0x5ee36d);_['remove'](_0x1f67f1,function(_0x1e8cc3){return _0xbf3097[_0x902b('0xac')](_0x1e8cc3['name']);});console[_0x902b('0xb2')](_0x902b('0xb3'),_0x1f67f1);_0x1390e5=[];_0x1f67f1[_0x902b('0xad')](function(_0x5ce53c){var _0x4fa6aa=createFieldObject(_0x4351a9,_0x2aaa13,_0x5ce53c[_0x902b('0xae')],_0x5ce53c[_0x902b('0x2f')],_0x5ce53c[_0x902b('0xaf')],!![]);_0x1390e5['push'](_0x4fa6aa);});return Promise[_0x902b('0xb1')](_0x1390e5);})[_0x902b('0x24')](function(_0x428579){_0x4ac308=_0x428579;var _0x1b7894=_0x510b3e['concat'](_0x4ac308);return{'count':_0x1b7894[_0x902b('0x36')],'rows':_0x1b7894};})[_0x902b('0x24')](respondWithResult(_0x52b364,null))[_0x902b('0x46')](function(_0x2f9beb){console['log']('ServiceNow\x20error:\x20'+_0x2f9beb);var _0x534fd2=_0x3cf839[_0x902b('0x33')][_0x902b('0xb4')]?0x1f4:_0x2f9beb[_0x902b('0xb5')]||0x1f4;logger['error'](_0x2f9beb[_0x902b('0x27')]);delete _0x2f9beb[_0x902b('0x2f')];if(_0x534fd2===0x191){_0x534fd2=0x190;}_0x52b364[_0x902b('0x18')](_0x534fd2)[_0x902b('0xb6')](_0x3cf839['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x2f9beb[_0x902b('0xb5')]}:_0x2f9beb);});};function createFieldObject(_0x3b3bf9,_0x3589db,_0x4d46b1,_0x34a3b5,_0x18b8bb,_0x39a6e7){return new Promise(function(_0x575094,_0x5ad08d){var _0x4524c7={'id':_0x34a3b5,'name':_0x18b8bb,'custom':_0x39a6e7};if(_0x4d46b1==='boolean'){_0x4524c7[_0x902b('0x44')]=[{'name':_0x902b('0xb7'),'value':'true'},{'name':_0x902b('0xb8'),'value':'false'}];_0x575094(_0x4524c7);}else{var _0x27b148={'method':_0x902b('0xa7'),'uri':_0x3b3bf9+_0x902b('0xb9')+_0x34a3b5,'auth':_0x3589db,'json':!![]};return rp(_0x27b148)['then'](function(_0x5c98bd){var _0x367b90=[];if(_0x5c98bd[_0x902b('0xa9')][_0x902b('0x36')]>0x0){_0x5c98bd[_0x902b('0xa9')][_0x902b('0xad')](function(_0x2d7035){if(_0x2d7035[_0x902b('0xba')]===_0x902b('0xbb')){var _0x42f74c={'name':_0x2d7035[_0x902b('0xaf')],'value':_0x2d7035['value']};_0x367b90[_0x902b('0xb0')](_0x42f74c);}});}_0x4524c7[_0x902b('0x44')]=_0x367b90;if(_0x4524c7[_0x902b('0x44')][_0x902b('0x36')]>0x0){_0x575094(_0x4524c7);}else{if(_0x39a6e7==![]){_0x575094();}else{_0x575094(_0x4524c7);}}});}});}
\ No newline at end of file
index c7b4d4f..01fcc68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x71ab=['path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','util','api','bluebird','request-promise'];(function(_0x33ef0b,_0x10390a){var _0x10d8a2=function(_0x5baa11){while(--_0x5baa11){_0x33ef0b['push'](_0x33ef0b['shift']());}};_0x10d8a2(++_0x10390a);}(_0x71ab,0x64));var _0xb71a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x71ab[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0xb71a('0x0'));var logger=require('../../config/logger')(_0xb71a('0x1'));var moment=require('moment');var BPromise=require(_0xb71a('0x2'));var rp=require(_0xb71a('0x3'));var fs=require('fs');var path=require(_0xb71a('0x4'));var rimraf=require(_0xb71a('0x5'));var config=require(_0xb71a('0x6'));var attributes=require(_0xb71a('0x7'));var integrations=require(_0xb71a('0x8'));module[_0xb71a('0x9')]=function(_0x22c072,_0x35a84e){return _0x22c072[_0xb71a('0xa')](_0xb71a('0xb'),attributes,{'tableName':_0xb71a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x90b1=['define','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x90b1,0x1bb));var _0x190b=function(_0x511e03,_0x122f3b){_0x511e03=_0x511e03-0x0;var _0x55aacb=_0x90b1[_0x511e03];return _0x55aacb;};'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('./intServicenowAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x27ff8c,_0x34a689){return _0x27ff8c[_0x190b('0x7')](_0x190b('0x8'),attributes,{'tableName':_0x190b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 53fed09..cf21f46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8679=['ShowServicenowAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ServicenowAccount,\x20%s,\x20%s','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','findAll','options','raw','where','attributes','include','map','model','GetServicenowAccount','stringify','find'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x8679,0xb5));var _0x9867=function(_0x4d6d72,_0x2a3f6b){_0x4d6d72=_0x4d6d72-0x0;var _0x2772a2=_0x8679[_0x4d6d72];return _0x2772a2;};'use strict';var _=require(_0x9867('0x0'));var util=require(_0x9867('0x1'));var moment=require(_0x9867('0x2'));var BPromise=require(_0x9867('0x3'));var rs=require(_0x9867('0x4'));var fs=require('fs');var Redis=require(_0x9867('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9867('0x6'));var logger=require(_0x9867('0x7'))(_0x9867('0x8'));var config=require(_0x9867('0x9'));var jayson=require(_0x9867('0xa'));var client=jayson[_0x9867('0xb')][_0x9867('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3f7ccd,_0x258c85,_0x95d4b5){return new BPromise(function(_0x2b0732,_0x3d48d9){return client[_0x9867('0xd')](_0x3f7ccd,_0x95d4b5)[_0x9867('0xe')](function(_0x572672){logger['info'](_0x9867('0xf'),_0x258c85,'request\x20sent');logger['debug'](_0x9867('0x10'),_0x258c85,_0x9867('0x11'),JSON['stringify'](_0x572672));if(_0x572672[_0x9867('0x12')]){if(_0x572672[_0x9867('0x12')][_0x9867('0x13')]===0x1f4){logger[_0x9867('0x12')](_0x9867('0xf'),_0x258c85,_0x572672[_0x9867('0x12')][_0x9867('0x14')]);return _0x3d48d9(_0x572672[_0x9867('0x12')]['message']);}logger[_0x9867('0x12')]('ServicenowAccount,\x20%s,\x20%s',_0x258c85,_0x572672[_0x9867('0x12')]['message']);return _0x2b0732(_0x572672[_0x9867('0x12')][_0x9867('0x14')]);}else{logger[_0x9867('0x15')]('ServicenowAccount,\x20%s,\x20%s',_0x258c85,'request\x20sent');_0x2b0732(_0x572672[_0x9867('0x16')][_0x9867('0x14')]);}})[_0x9867('0x17')](function(_0x4435a7){logger[_0x9867('0x12')](_0x9867('0xf'),_0x258c85,_0x4435a7);_0x3d48d9(_0x4435a7);});});}exports['GetServicenowAccount']=function(_0x5b40f0){var _0x5717ad=this;return new Promise(function(_0x2b97bb,_0x38514d){return db['ServicenowAccount'][_0x9867('0x18')]({'raw':_0x5b40f0[_0x9867('0x19')]?_0x5b40f0[_0x9867('0x19')][_0x9867('0x1a')]===undefined?!![]:![]:!![],'where':_0x5b40f0[_0x9867('0x19')]?_0x5b40f0[_0x9867('0x19')][_0x9867('0x1b')]||null:null,'attributes':_0x5b40f0[_0x9867('0x19')]?_0x5b40f0[_0x9867('0x19')][_0x9867('0x1c')]||null:null,'limit':_0x5b40f0[_0x9867('0x19')]?_0x5b40f0[_0x9867('0x19')]['limit']||null:null,'include':_0x5b40f0[_0x9867('0x19')]?_0x5b40f0[_0x9867('0x19')][_0x9867('0x1d')]?_['map'](_0x5b40f0[_0x9867('0x19')][_0x9867('0x1d')],function(_0x8a9cc){return{'model':db[_0x8a9cc['model']],'as':_0x8a9cc['as'],'attributes':_0x8a9cc[_0x9867('0x1c')],'include':_0x8a9cc[_0x9867('0x1d')]?_[_0x9867('0x1e')](_0x8a9cc[_0x9867('0x1d')],function(_0x49204b){return{'model':db[_0x49204b['model']],'as':_0x49204b['as'],'attributes':_0x49204b[_0x9867('0x1c')],'include':_0x49204b['include']?_[_0x9867('0x1e')](_0x49204b[_0x9867('0x1d')],function(_0x2b1e43){return{'model':db[_0x2b1e43[_0x9867('0x1f')]],'as':_0x2b1e43['as'],'attributes':_0x2b1e43[_0x9867('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x227ae0){logger[_0x9867('0x15')](_0x9867('0x20'),_0x5b40f0);logger['debug']('GetServicenowAccount',_0x5b40f0,JSON[_0x9867('0x21')](_0x227ae0));_0x2b97bb(_0x227ae0);})[_0x9867('0x17')](function(_0x257102){logger[_0x9867('0x12')](_0x9867('0x20'),_0x257102[_0x9867('0x14')],_0x5b40f0);_0x38514d(_0x5717ad[_0x9867('0x12')](0x1f4,_0x257102[_0x9867('0x14')]));});});};exports['ShowServicenowAccount']=function(_0x1647b2){var _0x146af4=this;return new Promise(function(_0x449a74,_0x22331b){return db['ServicenowAccount'][_0x9867('0x22')]({'raw':_0x1647b2[_0x9867('0x19')]?_0x1647b2[_0x9867('0x19')][_0x9867('0x1a')]===undefined?!![]:![]:!![],'where':_0x1647b2[_0x9867('0x19')]?_0x1647b2[_0x9867('0x19')]['where']||null:null,'attributes':_0x1647b2[_0x9867('0x19')]?_0x1647b2[_0x9867('0x19')][_0x9867('0x1c')]||null:null,'include':_0x1647b2['options']?_0x1647b2[_0x9867('0x19')][_0x9867('0x1d')]?_[_0x9867('0x1e')](_0x1647b2[_0x9867('0x19')][_0x9867('0x1d')],function(_0x94711b){return{'model':db[_0x94711b[_0x9867('0x1f')]],'as':_0x94711b['as'],'attributes':_0x94711b[_0x9867('0x1c')],'include':_0x94711b[_0x9867('0x1d')]?_[_0x9867('0x1e')](_0x94711b[_0x9867('0x1d')],function(_0x1a2c30){return{'model':db[_0x1a2c30['model']],'as':_0x1a2c30['as'],'attributes':_0x1a2c30[_0x9867('0x1c')],'include':_0x1a2c30[_0x9867('0x1d')]?_[_0x9867('0x1e')](_0x1a2c30[_0x9867('0x1d')],function(_0x4c6618){return{'model':db[_0x4c6618[_0x9867('0x1f')]],'as':_0x4c6618['as'],'attributes':_0x4c6618[_0x9867('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x53801b){logger['info'](_0x9867('0x23'),_0x1647b2);logger['debug'](_0x9867('0x23'),_0x1647b2,JSON[_0x9867('0x21')](_0x53801b));_0x449a74(_0x53801b);})[_0x9867('0x17')](function(_0x41da0b){logger[_0x9867('0x12')]('ShowServicenowAccount',_0x41da0b['message'],_0x1647b2);_0x22331b(_0x146af4[_0x9867('0x12')](0x1f4,_0x41da0b['message']));});});};
\ No newline at end of file
+var _0x3667=['stringify','error','code','message','result','catch','GetServicenowAccount','options','raw','where','attributes','include','map','model','ServicenowAccount','find','ShowServicenowAccount','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s'];(function(_0x232583,_0x44bdb5){var _0x49ddc1=function(_0x134f3f){while(--_0x134f3f){_0x232583['push'](_0x232583['shift']());}};_0x49ddc1(++_0x44bdb5);}(_0x3667,0x13a));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7366('0x0'));var util=require('util');var moment=require(_0x7366('0x1'));var BPromise=require('bluebird');var rs=require(_0x7366('0x2'));var fs=require('fs');var Redis=require(_0x7366('0x3'));var db=require(_0x7366('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7366('0x5'))('rpc');var config=require(_0x7366('0x6'));var jayson=require(_0x7366('0x7'));var client=jayson[_0x7366('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b729a,_0xec8f0b,_0x45faf4){return new BPromise(function(_0x3e89fe,_0x401402){return client[_0x7366('0x9')](_0x4b729a,_0x45faf4)[_0x7366('0xa')](function(_0x4bbecd){logger[_0x7366('0xb')](_0x7366('0xc'),_0xec8f0b,_0x7366('0xd'));logger[_0x7366('0xe')](_0x7366('0xf'),_0xec8f0b,_0x7366('0xd'),JSON[_0x7366('0x10')](_0x4bbecd));if(_0x4bbecd[_0x7366('0x11')]){if(_0x4bbecd[_0x7366('0x11')][_0x7366('0x12')]===0x1f4){logger[_0x7366('0x11')]('ServicenowAccount,\x20%s,\x20%s',_0xec8f0b,_0x4bbecd[_0x7366('0x11')][_0x7366('0x13')]);return _0x401402(_0x4bbecd[_0x7366('0x11')][_0x7366('0x13')]);}logger[_0x7366('0x11')](_0x7366('0xc'),_0xec8f0b,_0x4bbecd[_0x7366('0x11')]['message']);return _0x3e89fe(_0x4bbecd[_0x7366('0x11')]['message']);}else{logger['info']('ServicenowAccount,\x20%s,\x20%s',_0xec8f0b,_0x7366('0xd'));_0x3e89fe(_0x4bbecd[_0x7366('0x14')][_0x7366('0x13')]);}})[_0x7366('0x15')](function(_0x57386c){logger[_0x7366('0x11')](_0x7366('0xc'),_0xec8f0b,_0x57386c);_0x401402(_0x57386c);});});}exports[_0x7366('0x16')]=function(_0x4cf043){var _0x5cc158=this;return new Promise(function(_0x2cbf1e,_0x30b858){return db['ServicenowAccount']['findAll']({'raw':_0x4cf043[_0x7366('0x17')]?_0x4cf043[_0x7366('0x17')][_0x7366('0x18')]===undefined?!![]:![]:!![],'where':_0x4cf043[_0x7366('0x17')]?_0x4cf043[_0x7366('0x17')][_0x7366('0x19')]||null:null,'attributes':_0x4cf043[_0x7366('0x17')]?_0x4cf043['options'][_0x7366('0x1a')]||null:null,'limit':_0x4cf043[_0x7366('0x17')]?_0x4cf043[_0x7366('0x17')]['limit']||null:null,'include':_0x4cf043[_0x7366('0x17')]?_0x4cf043[_0x7366('0x17')][_0x7366('0x1b')]?_[_0x7366('0x1c')](_0x4cf043['options']['include'],function(_0x42018b){return{'model':db[_0x42018b['model']],'as':_0x42018b['as'],'attributes':_0x42018b['attributes'],'include':_0x42018b[_0x7366('0x1b')]?_['map'](_0x42018b['include'],function(_0x296533){return{'model':db[_0x296533[_0x7366('0x1d')]],'as':_0x296533['as'],'attributes':_0x296533[_0x7366('0x1a')],'include':_0x296533[_0x7366('0x1b')]?_['map'](_0x296533['include'],function(_0x351135){return{'model':db[_0x351135[_0x7366('0x1d')]],'as':_0x351135['as'],'attributes':_0x351135['attributes']};}):[]};}):[]};}):[]:[]})[_0x7366('0xa')](function(_0x3b7ef6){logger[_0x7366('0xb')](_0x7366('0x16'),_0x4cf043);logger[_0x7366('0xe')](_0x7366('0x16'),_0x4cf043,JSON[_0x7366('0x10')](_0x3b7ef6));_0x2cbf1e(_0x3b7ef6);})[_0x7366('0x15')](function(_0x5d08da){logger[_0x7366('0x11')]('GetServicenowAccount',_0x5d08da[_0x7366('0x13')],_0x4cf043);_0x30b858(_0x5cc158[_0x7366('0x11')](0x1f4,_0x5d08da[_0x7366('0x13')]));});});};exports['ShowServicenowAccount']=function(_0x5d085e){var _0x48de13=this;return new Promise(function(_0x4abdba,_0x43a5a8){return db[_0x7366('0x1e')][_0x7366('0x1f')]({'raw':_0x5d085e['options']?_0x5d085e[_0x7366('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5d085e['options']?_0x5d085e['options'][_0x7366('0x19')]||null:null,'attributes':_0x5d085e[_0x7366('0x17')]?_0x5d085e['options'][_0x7366('0x1a')]||null:null,'include':_0x5d085e[_0x7366('0x17')]?_0x5d085e[_0x7366('0x17')]['include']?_[_0x7366('0x1c')](_0x5d085e[_0x7366('0x17')][_0x7366('0x1b')],function(_0x38ea2f){return{'model':db[_0x38ea2f[_0x7366('0x1d')]],'as':_0x38ea2f['as'],'attributes':_0x38ea2f['attributes'],'include':_0x38ea2f['include']?_[_0x7366('0x1c')](_0x38ea2f[_0x7366('0x1b')],function(_0x66edf2){return{'model':db[_0x66edf2[_0x7366('0x1d')]],'as':_0x66edf2['as'],'attributes':_0x66edf2['attributes'],'include':_0x66edf2['include']?_[_0x7366('0x1c')](_0x66edf2['include'],function(_0x24c626){return{'model':db[_0x24c626[_0x7366('0x1d')]],'as':_0x24c626['as'],'attributes':_0x24c626[_0x7366('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7366('0xa')](function(_0x59db51){logger[_0x7366('0xb')](_0x7366('0x20'),_0x5d085e);logger[_0x7366('0xe')](_0x7366('0x20'),_0x5d085e,JSON[_0x7366('0x10')](_0x59db51));_0x4abdba(_0x59db51);})[_0x7366('0x15')](function(_0x17316e){logger[_0x7366('0x11')]('ShowServicenowAccount',_0x17316e['message'],_0x5d085e);_0x43a5a8(_0x48de13[_0x7366('0x11')](0x1f4,_0x17316e[_0x7366('0x13')]));});});};
\ No newline at end of file
index f2a5fdf..76b4280 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0341=['create','put','update','/:id','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','show','get','getFields','/:id/subjects','/:id/descriptions','getDescriptions'];(function(_0x4a96d2,_0x689504){var _0x38af04=function(_0x3a67cd){while(--_0x3a67cd){_0x4a96d2['push'](_0x4a96d2['shift']());}};_0x38af04(++_0x689504);}(_0x0341,0x1a8));var _0x1034=function(_0x2297dd,_0xcab9f8){_0x2297dd=_0x2297dd-0x0;var _0x189e11=_0x0341[_0x2297dd];return _0x189e11;};'use strict';var multer=require(_0x1034('0x0'));var util=require(_0x1034('0x1'));var path=require(_0x1034('0x2'));var timeout=require(_0x1034('0x3'));var express=require(_0x1034('0x4'));var router=express['Router']();var fs_extra=require(_0x1034('0x5'));var auth=require(_0x1034('0x6'));var interaction=require(_0x1034('0x7'));var config=require(_0x1034('0x8'));var controller=require(_0x1034('0x9'));router['get']('/',auth[_0x1034('0xa')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1034('0xb')]);router[_0x1034('0xc')]('/:id/fields',auth[_0x1034('0xa')](),controller[_0x1034('0xd')]);router['get'](_0x1034('0xe'),auth[_0x1034('0xa')](),controller['getSubjects']);router[_0x1034('0xc')](_0x1034('0xf'),auth[_0x1034('0xa')](),controller[_0x1034('0x10')]);router['post']('/',auth[_0x1034('0xa')](),controller[_0x1034('0x11')]);router[_0x1034('0x12')]('/:id',auth[_0x1034('0xa')](),controller[_0x1034('0x13')]);router['delete'](_0x1034('0x14'),auth[_0x1034('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xf3d1=['update','delete','destroy','exports','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','getFields','getSubjects','/:id/descriptions','post','create','put'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xf3d1,0xf4));var _0x1f3d=function(_0x13117b,_0x3449eb){_0x13117b=_0x13117b-0x0;var _0x418124=_0xf3d1[_0x13117b];return _0x418124;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1f3d('0x0'));var express=require('express');var router=express[_0x1f3d('0x1')]();var fs_extra=require(_0x1f3d('0x2'));var auth=require(_0x1f3d('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x1f3d('0x4'));var controller=require('./intServicenowConfiguration.controller');router[_0x1f3d('0x5')]('/',auth[_0x1f3d('0x6')](),controller[_0x1f3d('0x7')]);router['get'](_0x1f3d('0x8'),auth['isAuthenticated'](),controller[_0x1f3d('0x9')]);router[_0x1f3d('0x5')]('/:id/fields',auth[_0x1f3d('0x6')](),controller[_0x1f3d('0xa')]);router[_0x1f3d('0x5')]('/:id/subjects',auth[_0x1f3d('0x6')](),controller[_0x1f3d('0xb')]);router['get'](_0x1f3d('0xc'),auth[_0x1f3d('0x6')](),controller['getDescriptions']);router[_0x1f3d('0xd')]('/',auth[_0x1f3d('0x6')](),controller[_0x1f3d('0xe')]);router[_0x1f3d('0xf')](_0x1f3d('0x8'),auth[_0x1f3d('0x6')](),controller[_0x1f3d('0x10')]);router[_0x1f3d('0x11')](_0x1f3d('0x8'),auth[_0x1f3d('0x6')](),controller[_0x1f3d('0x12')]);module[_0x1f3d('0x13')]=router;
\ No newline at end of file
index b2a3f0a..87cd79f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b80=['exports','STRING'];(function(_0x31ed6e,_0x5424a8){var _0x2908d6=function(_0x242700){while(--_0x242700){_0x31ed6e['push'](_0x31ed6e['shift']());}};_0x2908d6(++_0x5424a8);}(_0x9b80,0x19a));var _0x09b8=function(_0x398294,_0x5ceb9d){_0x398294=_0x398294-0x0;var _0x2a872d=_0x9b80[_0x398294];return _0x2a872d;};'use strict';var Sequelize=require('sequelize');module[_0x09b8('0x0')]={'name':{'type':Sequelize[_0x09b8('0x1')]},'description':{'type':Sequelize[_0x09b8('0x1')]}};
\ No newline at end of file
+var _0xb36d=['exports','STRING'];(function(_0x154fdd,_0x24ff0d){var _0x108918=function(_0x5f1fcb){while(--_0x5f1fcb){_0x154fdd['push'](_0x154fdd['shift']());}};_0x108918(++_0x24ff0d);}(_0xb36d,0x80));var _0xdb36=function(_0x51c41e,_0x1a9543){_0x51c41e=_0x51c41e-0x0;var _0x37a1c3=_0xb36d[_0x51c41e];return _0x37a1c3;};'use strict';var Sequelize=require('sequelize');module[_0xdb36('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xdb36('0x1')]}};
\ No newline at end of file
index bd1c6fa..8754db1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1410=['nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','find','create','body','params','getFields','findOne','ServicenowField','map','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','name','index','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0x45625,_0x4a2c27){var _0x2e4bce=function(_0x3e0687){while(--_0x3e0687){_0x45625['push'](_0x45625['shift']());}};_0x2e4bce(++_0x4a2c27);}(_0x1410,0x1da));var _0x0141=function(_0x2c3d4f,_0x448a69){_0x2c3d4f=_0x2c3d4f-0x0;var _0x2dddb6=_0x1410[_0x2c3d4f];return _0x2dddb6;};'use strict';var emlformat=require(_0x0141('0x0'));var rimraf=require(_0x0141('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0141('0x2'));var rp=require('request-promise');var moment=require(_0x0141('0x3'));var BPromise=require(_0x0141('0x4'));var Mustache=require(_0x0141('0x5'));var util=require(_0x0141('0x6'));var path=require(_0x0141('0x7'));var sox=require('sox');var csv=require(_0x0141('0x8'));var ejs=require(_0x0141('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0141('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0141('0xb'));var deskjs=require(_0x0141('0xc'));var toCsv=require(_0x0141('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0141('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x0141('0xe'));var as=require(_0x0141('0xf'));var hardwareService=require(_0x0141('0x10'));var logger=require(_0x0141('0x11'))(_0x0141('0x12'));var utils=require(_0x0141('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0141('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x522788,_0xcd927d){_0xcd927d=_0xcd927d||0xcc;return function(_0x81a0c8){if(_0x81a0c8){return _0x522788[_0x0141('0x15')](_0xcd927d);}return _0x522788[_0x0141('0x16')](_0xcd927d)[_0x0141('0x17')]();};}function respondWithResult(_0x5e4590,_0x458f17){_0x458f17=_0x458f17||0xc8;return function(_0x2d399a){if(_0x2d399a){return _0x5e4590[_0x0141('0x16')](_0x458f17)[_0x0141('0x18')](_0x2d399a);}};}function respondWithFilteredResult(_0x2b73ec,_0x17e53f){return function(_0x1d06e6){if(_0x1d06e6){var _0x1058df=typeof _0x17e53f[_0x0141('0x19')]===_0x0141('0x1a')&&typeof _0x17e53f[_0x0141('0x1b')]===_0x0141('0x1a');var _0x4d9b87=_0x1d06e6[_0x0141('0x1c')];var _0x3aec42=_0x1058df?0x0:_0x17e53f[_0x0141('0x19')];var _0x1f76fd=_0x1058df?_0x1d06e6[_0x0141('0x1c')]:_0x17e53f[_0x0141('0x19')]+_0x17e53f[_0x0141('0x1b')];var _0x3b435c;if(_0x1f76fd>=_0x4d9b87){_0x1f76fd=_0x4d9b87;_0x3b435c=0xc8;}else{_0x3b435c=0xce;}_0x2b73ec['status'](_0x3b435c);return _0x2b73ec[_0x0141('0x1d')](_0x0141('0x1e'),_0x3aec42+'-'+_0x1f76fd+'/'+_0x4d9b87)[_0x0141('0x18')](_0x1d06e6);}return null;};}function patchUpdates(_0x28ab5d){return function(_0x515c48){try{jsonpatch[_0x0141('0x1f')](_0x515c48,_0x28ab5d,!![]);}catch(_0x5747a1){return BPromise[_0x0141('0x20')](_0x5747a1);}return _0x515c48[_0x0141('0x21')]();};}function saveUpdates(_0x5499bb,_0xb8a2b2){return function(_0x2c1feb){if(_0x2c1feb){return _0x2c1feb['update'](_0x5499bb)['then'](function(_0x4fd9d6){return _0x4fd9d6;});}return null;};}function removeEntity(_0x16b560,_0x10a877){return function(_0x1cd36c){if(_0x1cd36c){return _0x1cd36c[_0x0141('0x22')]()[_0x0141('0x23')](function(){_0x16b560[_0x0141('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bb17e,_0x549db1){return function(_0x15c8ee){if(!_0x15c8ee){_0x5bb17e[_0x0141('0x15')](0x194);}return _0x15c8ee;};}function handleError(_0x21633b,_0x2fc203){_0x2fc203=_0x2fc203||0x1f4;return function(_0x236686){logger['error'](_0x236686['stack']);if(_0x236686[_0x0141('0x24')]){delete _0x236686[_0x0141('0x24')];}_0x21633b[_0x0141('0x16')](_0x2fc203)['send'](_0x236686);};}exports[_0x0141('0x25')]=function(_0x5b8265,_0x4ca393){var _0x919a72={},_0x2b3b9d={},_0x5b6efb={'count':0x0,'rows':[]};var _0x34e0ce=_['map'](db[_0x0141('0x26')][_0x0141('0x27')],function(_0x422377){return{'name':_0x422377[_0x0141('0x28')],'type':_0x422377[_0x0141('0x29')][_0x0141('0x2a')]};});_0x2b3b9d[_0x0141('0x2b')]=_['map'](_0x34e0ce,_0x0141('0x24'));_0x2b3b9d['query']=_[_0x0141('0x2c')](_0x5b8265[_0x0141('0x2d')]);_0x2b3b9d[_0x0141('0x2e')]=_[_0x0141('0x2f')](_0x2b3b9d['model'],_0x2b3b9d[_0x0141('0x2d')]);_0x919a72[_0x0141('0x30')]=_['intersection'](_0x2b3b9d[_0x0141('0x2b')],qs[_0x0141('0x31')](_0x5b8265[_0x0141('0x2d')][_0x0141('0x31')]));_0x919a72[_0x0141('0x30')]=_0x919a72[_0x0141('0x30')][_0x0141('0x32')]?_0x919a72['attributes']:_0x2b3b9d[_0x0141('0x2b')];if(!_0x5b8265[_0x0141('0x2d')]['hasOwnProperty'](_0x0141('0x33'))){_0x919a72[_0x0141('0x1b')]=qs['limit'](_0x5b8265[_0x0141('0x2d')][_0x0141('0x1b')]);_0x919a72[_0x0141('0x19')]=qs[_0x0141('0x19')](_0x5b8265[_0x0141('0x2d')][_0x0141('0x19')]);}_0x919a72[_0x0141('0x34')]=qs['sort'](_0x5b8265[_0x0141('0x2d')][_0x0141('0x35')]);_0x919a72[_0x0141('0x36')]=qs[_0x0141('0x2e')](_[_0x0141('0x37')](_0x5b8265[_0x0141('0x2d')],_0x2b3b9d[_0x0141('0x2e')]),_0x34e0ce);if(_0x5b8265[_0x0141('0x2d')][_0x0141('0x38')]){_0x919a72['where']=_[_0x0141('0x39')](_0x919a72['where'],{'$or':_['map'](_0x34e0ce,function(_0x4f01ea){if(_0x4f01ea[_0x0141('0x29')]!=='VIRTUAL'){var _0x3a54d0={};_0x3a54d0[_0x4f01ea['name']]={'$like':'%'+_0x5b8265[_0x0141('0x2d')][_0x0141('0x38')]+'%'};return _0x3a54d0;}})});}_0x919a72=_[_0x0141('0x39')]({},_0x919a72,_0x5b8265[_0x0141('0x3a')]);var _0x453b28={'where':_0x919a72[_0x0141('0x36')]};return db[_0x0141('0x26')]['count'](_0x453b28)['then'](function(_0x184205){_0x5b6efb[_0x0141('0x1c')]=_0x184205;if(_0x5b8265['query'][_0x0141('0x3b')]){_0x919a72[_0x0141('0x3c')]=[{'all':!![]}];}return db[_0x0141('0x26')]['findAll'](_0x919a72);})['then'](function(_0xe78ab4){_0x5b6efb[_0x0141('0x3d')]=_0xe78ab4;return _0x5b6efb;})[_0x0141('0x23')](respondWithFilteredResult(_0x4ca393,_0x919a72))[_0x0141('0x3e')](handleError(_0x4ca393,null));};exports[_0x0141('0x3f')]=function(_0x5ee059,_0x5b6df0){var _0x490390={'raw':![],'where':{'id':_0x5ee059['params']['id']}},_0x4d7147={};_0x4d7147[_0x0141('0x2b')]=_['keys'](db[_0x0141('0x26')][_0x0141('0x27')]);_0x4d7147[_0x0141('0x2d')]=_[_0x0141('0x2c')](_0x5ee059[_0x0141('0x2d')]);_0x4d7147[_0x0141('0x2e')]=_[_0x0141('0x2f')](_0x4d7147['model'],_0x4d7147['query']);_0x490390[_0x0141('0x30')]=_['intersection'](_0x4d7147[_0x0141('0x2b')],qs['fields'](_0x5ee059[_0x0141('0x2d')][_0x0141('0x31')]));_0x490390[_0x0141('0x30')]=_0x490390[_0x0141('0x30')][_0x0141('0x32')]?_0x490390[_0x0141('0x30')]:_0x4d7147[_0x0141('0x2b')];if(_0x5ee059[_0x0141('0x2d')][_0x0141('0x3b')]){_0x490390[_0x0141('0x3c')]=[{'all':!![]}];}_0x490390=_[_0x0141('0x39')]({},_0x490390,_0x5ee059[_0x0141('0x3a')]);return db['ServicenowConfiguration'][_0x0141('0x40')](_0x490390)[_0x0141('0x23')](handleEntityNotFound(_0x5b6df0,null))['then'](respondWithResult(_0x5b6df0,null))[_0x0141('0x3e')](handleError(_0x5b6df0,null));};exports[_0x0141('0x41')]=function(_0x45a170,_0x4daee6){return db['ServicenowConfiguration']['create'](_0x45a170['body'],{})[_0x0141('0x23')](respondWithResult(_0x4daee6,0xc9))['catch'](handleError(_0x4daee6,null));};exports['update']=function(_0x31bbda,_0x540095){if(_0x31bbda[_0x0141('0x42')]['id']){delete _0x31bbda[_0x0141('0x42')]['id'];}return db[_0x0141('0x26')]['find']({'where':{'id':_0x31bbda[_0x0141('0x43')]['id']}})[_0x0141('0x23')](handleEntityNotFound(_0x540095,null))[_0x0141('0x23')](saveUpdates(_0x31bbda[_0x0141('0x42')],null))[_0x0141('0x23')](respondWithResult(_0x540095,null))['catch'](handleError(_0x540095,null));};exports[_0x0141('0x22')]=function(_0x35ce12,_0x43dd7f){return db[_0x0141('0x26')][_0x0141('0x40')]({'where':{'id':_0x35ce12['params']['id']}})[_0x0141('0x23')](handleEntityNotFound(_0x43dd7f,null))[_0x0141('0x23')](removeEntity(_0x43dd7f,null))[_0x0141('0x3e')](handleError(_0x43dd7f,null));};exports[_0x0141('0x44')]=function(_0x1f0d7d,_0x40aaf0,_0xcca2e4){var _0x28fc15={};var _0x4458c0={};var _0x40e125;var _0x57e6bf;return db[_0x0141('0x26')][_0x0141('0x45')]({'where':{'id':_0x1f0d7d[_0x0141('0x43')]['id']}})[_0x0141('0x23')](handleEntityNotFound(_0x40aaf0,null))[_0x0141('0x23')](function(_0x32a526){if(_0x32a526){_0x40e125=_0x32a526;_0x4458c0[_0x0141('0x2b')]=_['keys'](db[_0x0141('0x46')][_0x0141('0x27')]);_0x4458c0['query']=_[_0x0141('0x2c')](_0x1f0d7d[_0x0141('0x2d')]);_0x4458c0[_0x0141('0x2e')]=_['intersection'](_0x4458c0[_0x0141('0x2b')],_0x4458c0['query']);_0x28fc15['attributes']=_[_0x0141('0x2f')](_0x4458c0[_0x0141('0x2b')],qs[_0x0141('0x31')](_0x1f0d7d[_0x0141('0x2d')][_0x0141('0x31')]));_0x28fc15['attributes']=_0x28fc15[_0x0141('0x30')][_0x0141('0x32')]?_0x28fc15[_0x0141('0x30')]:_0x4458c0[_0x0141('0x2b')];_0x28fc15[_0x0141('0x34')]=qs[_0x0141('0x35')](_0x1f0d7d[_0x0141('0x2d')][_0x0141('0x35')]);_0x28fc15['where']=qs[_0x0141('0x2e')](_[_0x0141('0x37')](_0x1f0d7d[_0x0141('0x2d')],_0x4458c0[_0x0141('0x2e')]));if(_0x1f0d7d[_0x0141('0x2d')]['filter']){_0x28fc15[_0x0141('0x36')]=_['merge'](_0x28fc15[_0x0141('0x36')],{'$or':_[_0x0141('0x47')](_0x28fc15[_0x0141('0x30')],function(_0x106619){var _0x470547={};_0x470547[_0x106619]={'$like':'%'+_0x1f0d7d[_0x0141('0x2d')]['filter']+'%'};return _0x470547;})});}_0x28fc15=_['merge']({},_0x28fc15,_0x1f0d7d[_0x0141('0x3a')]);return _0x40e125[_0x0141('0x44')](_0x28fc15);}})[_0x0141('0x23')](function(_0x539832){if(_0x539832){_0x57e6bf=_0x539832[_0x0141('0x32')];if(!_0x1f0d7d['query'][_0x0141('0x48')]('nolimit')){_0x28fc15[_0x0141('0x1b')]=qs[_0x0141('0x1b')](_0x1f0d7d['query'][_0x0141('0x1b')]);_0x28fc15[_0x0141('0x19')]=qs['offset'](_0x1f0d7d['query'][_0x0141('0x19')]);}return _0x40e125['getFields'](_0x28fc15);}})[_0x0141('0x23')](function(_0x51ec9c){if(_0x51ec9c){return _0x51ec9c?{'count':_0x57e6bf,'rows':_0x51ec9c}:null;}})[_0x0141('0x23')](respondWithResult(_0x40aaf0,null))['catch'](handleError(_0x40aaf0,null));};exports[_0x0141('0x49')]=function(_0x520d58,_0x2260d2,_0x53c4d7){var _0x3af263={};var _0x561a06={};var _0x207d5e;var _0x148020;return db[_0x0141('0x26')][_0x0141('0x45')]({'where':{'id':_0x520d58[_0x0141('0x43')]['id']}})['then'](handleEntityNotFound(_0x2260d2,null))[_0x0141('0x23')](function(_0x258c70){if(_0x258c70){_0x207d5e=_0x258c70;_0x561a06[_0x0141('0x2b')]=_[_0x0141('0x2c')](db['ServicenowField'][_0x0141('0x27')]);_0x561a06[_0x0141('0x2d')]=_['keys'](_0x520d58['query']);_0x561a06[_0x0141('0x2e')]=_[_0x0141('0x2f')](_0x561a06[_0x0141('0x2b')],_0x561a06['query']);_0x3af263[_0x0141('0x30')]=_[_0x0141('0x2f')](_0x561a06['model'],qs[_0x0141('0x31')](_0x520d58[_0x0141('0x2d')]['fields']));_0x3af263['attributes']=_0x3af263['attributes'][_0x0141('0x32')]?_0x3af263[_0x0141('0x30')]:_0x561a06[_0x0141('0x2b')];_0x3af263[_0x0141('0x34')]=qs[_0x0141('0x35')](_0x520d58[_0x0141('0x2d')][_0x0141('0x35')]);_0x3af263[_0x0141('0x36')]=qs[_0x0141('0x2e')](_[_0x0141('0x37')](_0x520d58[_0x0141('0x2d')],_0x561a06[_0x0141('0x2e')]));if(_0x520d58['query'][_0x0141('0x38')]){_0x3af263[_0x0141('0x36')]=_[_0x0141('0x39')](_0x3af263[_0x0141('0x36')],{'$or':_[_0x0141('0x47')](_0x3af263[_0x0141('0x30')],function(_0x1ef926){var _0x576cda={};_0x576cda[_0x1ef926]={'$like':'%'+_0x520d58[_0x0141('0x2d')][_0x0141('0x38')]+'%'};return _0x576cda;})});}_0x3af263=_['merge']({},_0x3af263,_0x520d58[_0x0141('0x3a')]);return _0x207d5e[_0x0141('0x49')](_0x3af263);}})['then'](function(_0x53f5ad){if(_0x53f5ad){_0x148020=_0x53f5ad['length'];if(!_0x520d58[_0x0141('0x2d')][_0x0141('0x48')](_0x0141('0x33'))){_0x3af263[_0x0141('0x1b')]=qs[_0x0141('0x1b')](_0x520d58[_0x0141('0x2d')]['limit']);_0x3af263[_0x0141('0x19')]=qs[_0x0141('0x19')](_0x520d58[_0x0141('0x2d')][_0x0141('0x19')]);}return _0x207d5e[_0x0141('0x49')](_0x3af263);}})[_0x0141('0x23')](function(_0x630b38){if(_0x630b38){return _0x630b38?{'count':_0x148020,'rows':_0x630b38}:null;}})[_0x0141('0x23')](respondWithResult(_0x2260d2,null))['catch'](handleError(_0x2260d2,null));};exports[_0x0141('0x4a')]=function(_0x11babf,_0x1a50be,_0x3e798b){var _0x2ded85={};var _0x49eee1={};var _0x10a149;var _0x4abdc0;return db['ServicenowConfiguration'][_0x0141('0x45')]({'where':{'id':_0x11babf['params']['id']}})['then'](handleEntityNotFound(_0x1a50be,null))[_0x0141('0x23')](function(_0x49e54d){if(_0x49e54d){_0x10a149=_0x49e54d;_0x49eee1[_0x0141('0x2b')]=_[_0x0141('0x2c')](db[_0x0141('0x46')][_0x0141('0x27')]);_0x49eee1[_0x0141('0x2d')]=_[_0x0141('0x2c')](_0x11babf[_0x0141('0x2d')]);_0x49eee1[_0x0141('0x2e')]=_[_0x0141('0x2f')](_0x49eee1[_0x0141('0x2b')],_0x49eee1[_0x0141('0x2d')]);_0x2ded85[_0x0141('0x30')]=_[_0x0141('0x2f')](_0x49eee1[_0x0141('0x2b')],qs[_0x0141('0x31')](_0x11babf[_0x0141('0x2d')][_0x0141('0x31')]));_0x2ded85[_0x0141('0x30')]=_0x2ded85[_0x0141('0x30')][_0x0141('0x32')]?_0x2ded85[_0x0141('0x30')]:_0x49eee1[_0x0141('0x2b')];_0x2ded85['order']=qs[_0x0141('0x35')](_0x11babf['query']['sort']);_0x2ded85[_0x0141('0x36')]=qs['filters'](_[_0x0141('0x37')](_0x11babf[_0x0141('0x2d')],_0x49eee1['filters']));if(_0x11babf[_0x0141('0x2d')][_0x0141('0x38')]){_0x2ded85[_0x0141('0x36')]=_['merge'](_0x2ded85['where'],{'$or':_[_0x0141('0x47')](_0x2ded85['attributes'],function(_0x577a95){var _0x2ed4aa={};_0x2ed4aa[_0x577a95]={'$like':'%'+_0x11babf[_0x0141('0x2d')][_0x0141('0x38')]+'%'};return _0x2ed4aa;})});}_0x2ded85=_[_0x0141('0x39')]({},_0x2ded85,_0x11babf[_0x0141('0x3a')]);return _0x10a149[_0x0141('0x4a')](_0x2ded85);}})['then'](function(_0x3d77b6){if(_0x3d77b6){_0x4abdc0=_0x3d77b6[_0x0141('0x32')];if(!_0x11babf[_0x0141('0x2d')][_0x0141('0x48')](_0x0141('0x33'))){_0x2ded85[_0x0141('0x1b')]=qs['limit'](_0x11babf[_0x0141('0x2d')]['limit']);_0x2ded85[_0x0141('0x19')]=qs['offset'](_0x11babf['query'][_0x0141('0x19')]);}return _0x10a149[_0x0141('0x4a')](_0x2ded85);}})['then'](function(_0x133f0f){if(_0x133f0f){return _0x133f0f?{'count':_0x4abdc0,'rows':_0x133f0f}:null;}})['then'](respondWithResult(_0x1a50be,null))[_0x0141('0x3e')](handleError(_0x1a50be,null));};
\ No newline at end of file
+var _0x33f2=['save','update','then','status','error','stack','name','send','index','ServicenowConfiguration','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','keys','find','create','body','destroy','getFields','findOne','ServicenowField','hasOwnProperty','getSubjects','rawAttributes','options','getDescriptions','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','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','apply','reject'];(function(_0x233722,_0x2af16c){var _0x264352=function(_0x23aa46){while(--_0x23aa46){_0x233722['push'](_0x233722['shift']());}};_0x264352(++_0x2af16c);}(_0x33f2,0xd7));var _0x233f=function(_0x3a99f4,_0x2a81c1){_0x3a99f4=_0x3a99f4-0x0;var _0xea0b42=_0x33f2[_0x3a99f4];return _0xea0b42;};'use strict';var emlformat=require(_0x233f('0x0'));var rimraf=require(_0x233f('0x1'));var zipdir=require(_0x233f('0x2'));var jsonpatch=require(_0x233f('0x3'));var rp=require(_0x233f('0x4'));var moment=require('moment');var BPromise=require(_0x233f('0x5'));var Mustache=require(_0x233f('0x6'));var util=require(_0x233f('0x7'));var path=require(_0x233f('0x8'));var sox=require(_0x233f('0x9'));var csv=require(_0x233f('0xa'));var ejs=require(_0x233f('0xb'));var fs=require('fs');var fs_extra=require(_0x233f('0xc'));var _=require(_0x233f('0xd'));var squel=require(_0x233f('0xe'));var crypto=require(_0x233f('0xf'));var jsforce=require(_0x233f('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x233f('0x11'));var Papa=require(_0x233f('0x12'));var Redis=require(_0x233f('0x13'));var authService=require(_0x233f('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x233f('0x15'));var logger=require(_0x233f('0x16'))(_0x233f('0x17'));var utils=require(_0x233f('0x18'));var config=require(_0x233f('0x19'));var licenseUtil=require(_0x233f('0x1a'));var db=require(_0x233f('0x1b'))['db'];function respondWithStatusCode(_0x2c8c5a,_0x4e63ae){_0x4e63ae=_0x4e63ae||0xcc;return function(_0x111926){if(_0x111926){return _0x2c8c5a[_0x233f('0x1c')](_0x4e63ae);}return _0x2c8c5a['status'](_0x4e63ae)[_0x233f('0x1d')]();};}function respondWithResult(_0x55594e,_0x3edaca){_0x3edaca=_0x3edaca||0xc8;return function(_0x5d2ddb){if(_0x5d2ddb){return _0x55594e['status'](_0x3edaca)[_0x233f('0x1e')](_0x5d2ddb);}};}function respondWithFilteredResult(_0xb34ed0,_0x2a4b3b){return function(_0xc20a30){if(_0xc20a30){var _0x145d85=typeof _0x2a4b3b['offset']===_0x233f('0x1f')&&typeof _0x2a4b3b[_0x233f('0x20')]==='undefined';var _0x5982c6=_0xc20a30[_0x233f('0x21')];var _0x539f89=_0x145d85?0x0:_0x2a4b3b['offset'];var _0x36bd9a=_0x145d85?_0xc20a30[_0x233f('0x21')]:_0x2a4b3b[_0x233f('0x22')]+_0x2a4b3b[_0x233f('0x20')];var _0x4dce6e;if(_0x36bd9a>=_0x5982c6){_0x36bd9a=_0x5982c6;_0x4dce6e=0xc8;}else{_0x4dce6e=0xce;}_0xb34ed0['status'](_0x4dce6e);return _0xb34ed0['set']('Content-Range',_0x539f89+'-'+_0x36bd9a+'/'+_0x5982c6)[_0x233f('0x1e')](_0xc20a30);}return null;};}function patchUpdates(_0x10b5bc){return function(_0xe0562c){try{jsonpatch[_0x233f('0x23')](_0xe0562c,_0x10b5bc,!![]);}catch(_0x4df5ee){return BPromise[_0x233f('0x24')](_0x4df5ee);}return _0xe0562c[_0x233f('0x25')]();};}function saveUpdates(_0x5d30e0,_0x3b64cb){return function(_0x412c31){if(_0x412c31){return _0x412c31[_0x233f('0x26')](_0x5d30e0)[_0x233f('0x27')](function(_0x223f4e){return _0x223f4e;});}return null;};}function removeEntity(_0x31a1f8,_0xe534de){return function(_0x194cd7){if(_0x194cd7){return _0x194cd7['destroy']()['then'](function(){_0x31a1f8[_0x233f('0x28')](0xcc)[_0x233f('0x1d')]();});}};}function handleEntityNotFound(_0x35700c,_0x64beb8){return function(_0xf4a0a1){if(!_0xf4a0a1){_0x35700c[_0x233f('0x1c')](0x194);}return _0xf4a0a1;};}function handleError(_0x100fe5,_0x4e2a5a){_0x4e2a5a=_0x4e2a5a||0x1f4;return function(_0x2ff2c8){logger[_0x233f('0x29')](_0x2ff2c8[_0x233f('0x2a')]);if(_0x2ff2c8[_0x233f('0x2b')]){delete _0x2ff2c8[_0x233f('0x2b')];}_0x100fe5[_0x233f('0x28')](_0x4e2a5a)[_0x233f('0x2c')](_0x2ff2c8);};}exports[_0x233f('0x2d')]=function(_0x4387b2,_0x2cf333){var _0x390128={},_0xfb9290={},_0x56ab38={'count':0x0,'rows':[]};var _0x3295d7=_['map'](db[_0x233f('0x2e')]['rawAttributes'],function(_0x4f71ee){return{'name':_0x4f71ee[_0x233f('0x2f')],'type':_0x4f71ee[_0x233f('0x30')][_0x233f('0x31')]};});_0xfb9290[_0x233f('0x32')]=_[_0x233f('0x33')](_0x3295d7,'name');_0xfb9290['query']=_['keys'](_0x4387b2[_0x233f('0x34')]);_0xfb9290[_0x233f('0x35')]=_[_0x233f('0x36')](_0xfb9290[_0x233f('0x32')],_0xfb9290[_0x233f('0x34')]);_0x390128[_0x233f('0x37')]=_['intersection'](_0xfb9290['model'],qs[_0x233f('0x38')](_0x4387b2[_0x233f('0x34')][_0x233f('0x38')]));_0x390128[_0x233f('0x37')]=_0x390128[_0x233f('0x37')][_0x233f('0x39')]?_0x390128[_0x233f('0x37')]:_0xfb9290[_0x233f('0x32')];if(!_0x4387b2['query']['hasOwnProperty'](_0x233f('0x3a'))){_0x390128[_0x233f('0x20')]=qs[_0x233f('0x20')](_0x4387b2[_0x233f('0x34')][_0x233f('0x20')]);_0x390128[_0x233f('0x22')]=qs[_0x233f('0x22')](_0x4387b2['query'][_0x233f('0x22')]);}_0x390128[_0x233f('0x3b')]=qs[_0x233f('0x3c')](_0x4387b2[_0x233f('0x34')]['sort']);_0x390128[_0x233f('0x3d')]=qs[_0x233f('0x35')](_[_0x233f('0x3e')](_0x4387b2[_0x233f('0x34')],_0xfb9290['filters']),_0x3295d7);if(_0x4387b2['query'][_0x233f('0x3f')]){_0x390128['where']=_[_0x233f('0x40')](_0x390128[_0x233f('0x3d')],{'$or':_['map'](_0x3295d7,function(_0x2133c2){if(_0x2133c2['type']!==_0x233f('0x41')){var _0x390a09={};_0x390a09[_0x2133c2['name']]={'$like':'%'+_0x4387b2[_0x233f('0x34')][_0x233f('0x3f')]+'%'};return _0x390a09;}})});}_0x390128=_['merge']({},_0x390128,_0x4387b2['options']);var _0x5e3cf5={'where':_0x390128[_0x233f('0x3d')]};return db[_0x233f('0x2e')][_0x233f('0x21')](_0x5e3cf5)['then'](function(_0x2f40c0){_0x56ab38[_0x233f('0x21')]=_0x2f40c0;if(_0x4387b2[_0x233f('0x34')][_0x233f('0x42')]){_0x390128[_0x233f('0x43')]=[{'all':!![]}];}return db['ServicenowConfiguration']['findAll'](_0x390128);})[_0x233f('0x27')](function(_0x388809){_0x56ab38[_0x233f('0x44')]=_0x388809;return _0x56ab38;})[_0x233f('0x27')](respondWithFilteredResult(_0x2cf333,_0x390128))[_0x233f('0x45')](handleError(_0x2cf333,null));};exports['show']=function(_0x32d0de,_0x9ee83f){var _0x19d0ff={'raw':![],'where':{'id':_0x32d0de[_0x233f('0x46')]['id']}},_0x33b87b={};_0x33b87b[_0x233f('0x32')]=_[_0x233f('0x47')](db[_0x233f('0x2e')]['rawAttributes']);_0x33b87b[_0x233f('0x34')]=_[_0x233f('0x47')](_0x32d0de[_0x233f('0x34')]);_0x33b87b['filters']=_[_0x233f('0x36')](_0x33b87b['model'],_0x33b87b['query']);_0x19d0ff['attributes']=_[_0x233f('0x36')](_0x33b87b[_0x233f('0x32')],qs['fields'](_0x32d0de[_0x233f('0x34')][_0x233f('0x38')]));_0x19d0ff['attributes']=_0x19d0ff[_0x233f('0x37')][_0x233f('0x39')]?_0x19d0ff[_0x233f('0x37')]:_0x33b87b[_0x233f('0x32')];if(_0x32d0de[_0x233f('0x34')][_0x233f('0x42')]){_0x19d0ff[_0x233f('0x43')]=[{'all':!![]}];}_0x19d0ff=_['merge']({},_0x19d0ff,_0x32d0de['options']);return db[_0x233f('0x2e')][_0x233f('0x48')](_0x19d0ff)['then'](handleEntityNotFound(_0x9ee83f,null))[_0x233f('0x27')](respondWithResult(_0x9ee83f,null))[_0x233f('0x45')](handleError(_0x9ee83f,null));};exports['create']=function(_0x2efbfc,_0x3a6c7){return db['ServicenowConfiguration'][_0x233f('0x49')](_0x2efbfc[_0x233f('0x4a')],{})['then'](respondWithResult(_0x3a6c7,0xc9))[_0x233f('0x45')](handleError(_0x3a6c7,null));};exports[_0x233f('0x26')]=function(_0x14371c,_0x324331){if(_0x14371c[_0x233f('0x4a')]['id']){delete _0x14371c[_0x233f('0x4a')]['id'];}return db[_0x233f('0x2e')]['find']({'where':{'id':_0x14371c['params']['id']}})['then'](handleEntityNotFound(_0x324331,null))[_0x233f('0x27')](saveUpdates(_0x14371c[_0x233f('0x4a')],null))['then'](respondWithResult(_0x324331,null))['catch'](handleError(_0x324331,null));};exports[_0x233f('0x4b')]=function(_0x44a275,_0xe1e685){return db['ServicenowConfiguration'][_0x233f('0x48')]({'where':{'id':_0x44a275[_0x233f('0x46')]['id']}})[_0x233f('0x27')](handleEntityNotFound(_0xe1e685,null))[_0x233f('0x27')](removeEntity(_0xe1e685,null))[_0x233f('0x45')](handleError(_0xe1e685,null));};exports[_0x233f('0x4c')]=function(_0xa735db,_0x4ef632,_0x522dfa){var _0x5381c9={};var _0x1e0fde={};var _0x437434;var _0x3c3541;return db[_0x233f('0x2e')][_0x233f('0x4d')]({'where':{'id':_0xa735db[_0x233f('0x46')]['id']}})['then'](handleEntityNotFound(_0x4ef632,null))[_0x233f('0x27')](function(_0x1c010b){if(_0x1c010b){_0x437434=_0x1c010b;_0x1e0fde[_0x233f('0x32')]=_[_0x233f('0x47')](db[_0x233f('0x4e')]['rawAttributes']);_0x1e0fde[_0x233f('0x34')]=_[_0x233f('0x47')](_0xa735db[_0x233f('0x34')]);_0x1e0fde[_0x233f('0x35')]=_[_0x233f('0x36')](_0x1e0fde['model'],_0x1e0fde['query']);_0x5381c9[_0x233f('0x37')]=_[_0x233f('0x36')](_0x1e0fde[_0x233f('0x32')],qs[_0x233f('0x38')](_0xa735db['query']['fields']));_0x5381c9[_0x233f('0x37')]=_0x5381c9['attributes']['length']?_0x5381c9[_0x233f('0x37')]:_0x1e0fde[_0x233f('0x32')];_0x5381c9[_0x233f('0x3b')]=qs[_0x233f('0x3c')](_0xa735db[_0x233f('0x34')][_0x233f('0x3c')]);_0x5381c9[_0x233f('0x3d')]=qs[_0x233f('0x35')](_[_0x233f('0x3e')](_0xa735db['query'],_0x1e0fde[_0x233f('0x35')]));if(_0xa735db[_0x233f('0x34')][_0x233f('0x3f')]){_0x5381c9[_0x233f('0x3d')]=_[_0x233f('0x40')](_0x5381c9['where'],{'$or':_[_0x233f('0x33')](_0x5381c9['attributes'],function(_0x59c21d){var _0xf2b08b={};_0xf2b08b[_0x59c21d]={'$like':'%'+_0xa735db['query'][_0x233f('0x3f')]+'%'};return _0xf2b08b;})});}_0x5381c9=_[_0x233f('0x40')]({},_0x5381c9,_0xa735db['options']);return _0x437434[_0x233f('0x4c')](_0x5381c9);}})['then'](function(_0x3204ea){if(_0x3204ea){_0x3c3541=_0x3204ea['length'];if(!_0xa735db[_0x233f('0x34')][_0x233f('0x4f')]('nolimit')){_0x5381c9[_0x233f('0x20')]=qs[_0x233f('0x20')](_0xa735db[_0x233f('0x34')]['limit']);_0x5381c9[_0x233f('0x22')]=qs['offset'](_0xa735db[_0x233f('0x34')][_0x233f('0x22')]);}return _0x437434[_0x233f('0x4c')](_0x5381c9);}})[_0x233f('0x27')](function(_0x6ad1d6){if(_0x6ad1d6){return _0x6ad1d6?{'count':_0x3c3541,'rows':_0x6ad1d6}:null;}})[_0x233f('0x27')](respondWithResult(_0x4ef632,null))['catch'](handleError(_0x4ef632,null));};exports[_0x233f('0x50')]=function(_0x41edd6,_0x273c71,_0x200e5b){var _0x8af90d={};var _0x4c340b={};var _0xa592ea;var _0x2ccf51;return db[_0x233f('0x2e')][_0x233f('0x4d')]({'where':{'id':_0x41edd6[_0x233f('0x46')]['id']}})[_0x233f('0x27')](handleEntityNotFound(_0x273c71,null))[_0x233f('0x27')](function(_0x30a1dc){if(_0x30a1dc){_0xa592ea=_0x30a1dc;_0x4c340b[_0x233f('0x32')]=_['keys'](db[_0x233f('0x4e')][_0x233f('0x51')]);_0x4c340b[_0x233f('0x34')]=_[_0x233f('0x47')](_0x41edd6['query']);_0x4c340b[_0x233f('0x35')]=_[_0x233f('0x36')](_0x4c340b[_0x233f('0x32')],_0x4c340b[_0x233f('0x34')]);_0x8af90d[_0x233f('0x37')]=_[_0x233f('0x36')](_0x4c340b[_0x233f('0x32')],qs['fields'](_0x41edd6[_0x233f('0x34')]['fields']));_0x8af90d[_0x233f('0x37')]=_0x8af90d['attributes']['length']?_0x8af90d[_0x233f('0x37')]:_0x4c340b[_0x233f('0x32')];_0x8af90d['order']=qs[_0x233f('0x3c')](_0x41edd6['query'][_0x233f('0x3c')]);_0x8af90d['where']=qs[_0x233f('0x35')](_[_0x233f('0x3e')](_0x41edd6[_0x233f('0x34')],_0x4c340b[_0x233f('0x35')]));if(_0x41edd6[_0x233f('0x34')][_0x233f('0x3f')]){_0x8af90d[_0x233f('0x3d')]=_[_0x233f('0x40')](_0x8af90d[_0x233f('0x3d')],{'$or':_[_0x233f('0x33')](_0x8af90d[_0x233f('0x37')],function(_0x390c3e){var _0x29d9c5={};_0x29d9c5[_0x390c3e]={'$like':'%'+_0x41edd6[_0x233f('0x34')][_0x233f('0x3f')]+'%'};return _0x29d9c5;})});}_0x8af90d=_[_0x233f('0x40')]({},_0x8af90d,_0x41edd6[_0x233f('0x52')]);return _0xa592ea['getSubjects'](_0x8af90d);}})[_0x233f('0x27')](function(_0xfedcbf){if(_0xfedcbf){_0x2ccf51=_0xfedcbf[_0x233f('0x39')];if(!_0x41edd6[_0x233f('0x34')][_0x233f('0x4f')]('nolimit')){_0x8af90d[_0x233f('0x20')]=qs[_0x233f('0x20')](_0x41edd6['query'][_0x233f('0x20')]);_0x8af90d[_0x233f('0x22')]=qs[_0x233f('0x22')](_0x41edd6[_0x233f('0x34')][_0x233f('0x22')]);}return _0xa592ea[_0x233f('0x50')](_0x8af90d);}})['then'](function(_0x3f98aa){if(_0x3f98aa){return _0x3f98aa?{'count':_0x2ccf51,'rows':_0x3f98aa}:null;}})[_0x233f('0x27')](respondWithResult(_0x273c71,null))[_0x233f('0x45')](handleError(_0x273c71,null));};exports[_0x233f('0x53')]=function(_0x986774,_0x145aee,_0x452c0d){var _0x378efc={};var _0x3234e9={};var _0x4a9a10;var _0x267b0d;return db[_0x233f('0x2e')][_0x233f('0x4d')]({'where':{'id':_0x986774[_0x233f('0x46')]['id']}})['then'](handleEntityNotFound(_0x145aee,null))[_0x233f('0x27')](function(_0x4dc301){if(_0x4dc301){_0x4a9a10=_0x4dc301;_0x3234e9[_0x233f('0x32')]=_[_0x233f('0x47')](db[_0x233f('0x4e')][_0x233f('0x51')]);_0x3234e9[_0x233f('0x34')]=_['keys'](_0x986774[_0x233f('0x34')]);_0x3234e9[_0x233f('0x35')]=_[_0x233f('0x36')](_0x3234e9[_0x233f('0x32')],_0x3234e9[_0x233f('0x34')]);_0x378efc[_0x233f('0x37')]=_['intersection'](_0x3234e9[_0x233f('0x32')],qs[_0x233f('0x38')](_0x986774['query'][_0x233f('0x38')]));_0x378efc[_0x233f('0x37')]=_0x378efc[_0x233f('0x37')][_0x233f('0x39')]?_0x378efc[_0x233f('0x37')]:_0x3234e9[_0x233f('0x32')];_0x378efc[_0x233f('0x3b')]=qs[_0x233f('0x3c')](_0x986774[_0x233f('0x34')][_0x233f('0x3c')]);_0x378efc[_0x233f('0x3d')]=qs[_0x233f('0x35')](_[_0x233f('0x3e')](_0x986774['query'],_0x3234e9['filters']));if(_0x986774[_0x233f('0x34')]['filter']){_0x378efc[_0x233f('0x3d')]=_[_0x233f('0x40')](_0x378efc[_0x233f('0x3d')],{'$or':_[_0x233f('0x33')](_0x378efc['attributes'],function(_0xda6a5c){var _0x3257d8={};_0x3257d8[_0xda6a5c]={'$like':'%'+_0x986774[_0x233f('0x34')][_0x233f('0x3f')]+'%'};return _0x3257d8;})});}_0x378efc=_[_0x233f('0x40')]({},_0x378efc,_0x986774[_0x233f('0x52')]);return _0x4a9a10[_0x233f('0x53')](_0x378efc);}})[_0x233f('0x27')](function(_0x1c3536){if(_0x1c3536){_0x267b0d=_0x1c3536[_0x233f('0x39')];if(!_0x986774['query'][_0x233f('0x4f')](_0x233f('0x3a'))){_0x378efc[_0x233f('0x20')]=qs['limit'](_0x986774[_0x233f('0x34')][_0x233f('0x20')]);_0x378efc[_0x233f('0x22')]=qs['offset'](_0x986774['query'][_0x233f('0x22')]);}return _0x4a9a10[_0x233f('0x53')](_0x378efc);}})[_0x233f('0x27')](function(_0x1ce2c0){if(_0x1ce2c0){return _0x1ce2c0?{'count':_0x267b0d,'rows':_0x1ce2c0}:null;}})['then'](respondWithResult(_0x145aee,null))[_0x233f('0x45')](handleError(_0x145aee,null));};
\ No newline at end of file
index 201163c..65da3ea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5454=['define','ServicenowConfiguration','int_servicenow_configurations','api','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes'];(function(_0x5ac757,_0x10cd1f){var _0xbddee6=function(_0x2d34cc){while(--_0x2d34cc){_0x5ac757['push'](_0x5ac757['shift']());}};_0xbddee6(++_0x10cd1f);}(_0x5454,0x15b));var _0x4545=function(_0x3a87f6,_0x400633){_0x3a87f6=_0x3a87f6-0x0;var _0x132c09=_0x5454[_0x3a87f6];return _0x132c09;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x4545('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4545('0x1'));var rimraf=require(_0x4545('0x2'));var config=require(_0x4545('0x3'));var attributes=require(_0x4545('0x4'));module['exports']=function(_0x41ffd0,_0xececc1){return _0x41ffd0[_0x4545('0x5')](_0x4545('0x6'),attributes,{'tableName':_0x4545('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf089=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intServicenowConfiguration.attributes','exports','define','int_servicenow_configurations','util'];(function(_0x3061ce,_0x52999a){var _0x5cb0bb=function(_0x391eca){while(--_0x391eca){_0x3061ce['push'](_0x3061ce['shift']());}};_0x5cb0bb(++_0x52999a);}(_0xf089,0xba));var _0x9f08=function(_0x1757e3,_0x1f2fe8){_0x1757e3=_0x1757e3-0x0;var _0x3c6748=_0xf089[_0x1757e3];return _0x3c6748;};'use strict';var _=require('lodash');var util=require(_0x9f08('0x0'));var logger=require(_0x9f08('0x1'))('api');var moment=require(_0x9f08('0x2'));var BPromise=require(_0x9f08('0x3'));var rp=require(_0x9f08('0x4'));var fs=require('fs');var path=require(_0x9f08('0x5'));var rimraf=require('rimraf');var config=require(_0x9f08('0x6'));var attributes=require(_0x9f08('0x7'));module[_0x9f08('0x8')]=function(_0x13768c,_0x38c9ea){return _0x13768c[_0x9f08('0x9')]('ServicenowConfiguration',attributes,{'tableName':_0x9f08('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 12374e7..51c86b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x15b8=['result','catch','lodash','moment','ioredis','../../mysqldb','../../config/environment','client','http','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x269e80,_0xfd0e6d){var _0x52b1be=function(_0x24d66b){while(--_0x24d66b){_0x269e80['push'](_0x269e80['shift']());}};_0x52b1be(++_0xfd0e6d);}(_0x15b8,0x1c2));var _0x815b=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x15b8[_0x5f09c5];return _0x426ad9;};'use strict';var _=require(_0x815b('0x0'));var util=require('util');var moment=require(_0x815b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x815b('0x2'));var db=require(_0x815b('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x815b('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x815b('0x5')][_0x815b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x37d1e2,_0x453cf3,_0x83f43a){return new BPromise(function(_0x5b79ff,_0x224a42){return client['request'](_0x37d1e2,_0x83f43a)['then'](function(_0x4e3e10){logger[_0x815b('0x7')](_0x815b('0x8'),_0x453cf3,_0x815b('0x9'));logger['debug'](_0x815b('0xa'),_0x453cf3,_0x815b('0x9'),JSON['stringify'](_0x4e3e10));if(_0x4e3e10['error']){if(_0x4e3e10[_0x815b('0xb')][_0x815b('0xc')]===0x1f4){logger[_0x815b('0xb')](_0x815b('0x8'),_0x453cf3,_0x4e3e10['error'][_0x815b('0xd')]);return _0x224a42(_0x4e3e10[_0x815b('0xb')][_0x815b('0xd')]);}logger['error'](_0x815b('0x8'),_0x453cf3,_0x4e3e10['error'][_0x815b('0xd')]);return _0x5b79ff(_0x4e3e10[_0x815b('0xb')][_0x815b('0xd')]);}else{logger[_0x815b('0x7')](_0x815b('0x8'),_0x453cf3,_0x815b('0x9'));_0x5b79ff(_0x4e3e10[_0x815b('0xe')]['message']);}})[_0x815b('0xf')](function(_0x4ea925){logger[_0x815b('0xb')](_0x815b('0x8'),_0x453cf3,_0x4ea925);_0x224a42(_0x4ea925);});});}
\ No newline at end of file
+var _0xa661=['then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request'];(function(_0x42c4d3,_0x16b4e2){var _0x2ad721=function(_0x43c4d6){while(--_0x43c4d6){_0x42c4d3['push'](_0x42c4d3['shift']());}};_0x2ad721(++_0x16b4e2);}(_0xa661,0xf2));var _0x1a66=function(_0x58b5d7,_0x79ca8a){_0x58b5d7=_0x58b5d7-0x0;var _0x817269=_0xa661[_0x58b5d7];return _0x817269;};'use strict';var _=require(_0x1a66('0x0'));var util=require(_0x1a66('0x1'));var moment=require(_0x1a66('0x2'));var BPromise=require(_0x1a66('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a66('0x4'));var db=require(_0x1a66('0x5'))['db'];var utils=require(_0x1a66('0x6'));var logger=require(_0x1a66('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1a66('0x8')][_0x1a66('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d41cc,_0x147ac0,_0x35e8f6){return new BPromise(function(_0x131788,_0x5402c3){return client[_0x1a66('0xa')](_0x1d41cc,_0x35e8f6)[_0x1a66('0xb')](function(_0x23d0d1){logger['info'](_0x1a66('0xc'),_0x147ac0,_0x1a66('0xd'));logger[_0x1a66('0xe')](_0x1a66('0xf'),_0x147ac0,_0x1a66('0xd'),JSON[_0x1a66('0x10')](_0x23d0d1));if(_0x23d0d1['error']){if(_0x23d0d1[_0x1a66('0x11')][_0x1a66('0x12')]===0x1f4){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x147ac0,_0x23d0d1[_0x1a66('0x11')][_0x1a66('0x13')]);return _0x5402c3(_0x23d0d1[_0x1a66('0x11')]['message']);}logger[_0x1a66('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x147ac0,_0x23d0d1[_0x1a66('0x11')][_0x1a66('0x13')]);return _0x131788(_0x23d0d1[_0x1a66('0x11')][_0x1a66('0x13')]);}else{logger[_0x1a66('0x14')](_0x1a66('0xc'),_0x147ac0,_0x1a66('0xd'));_0x131788(_0x23d0d1[_0x1a66('0x15')][_0x1a66('0x13')]);}})[_0x1a66('0x16')](function(_0x17be94){logger[_0x1a66('0x11')](_0x1a66('0xc'),_0x147ac0,_0x17be94);_0x5402c3(_0x17be94);});});}
\ No newline at end of file
index 8379f96..d562b73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75b9=['delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','/:id','show','post','create','put','update'];(function(_0x57de44,_0x2bd26a){var _0x1fc3b4=function(_0x277a02){while(--_0x277a02){_0x57de44['push'](_0x57de44['shift']());}};_0x1fc3b4(++_0x2bd26a);}(_0x75b9,0x9b));var _0x975b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x75b9[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x975b('0x0'));var util=require('util');var path=require(_0x975b('0x1'));var timeout=require('connect-timeout');var express=require(_0x975b('0x2'));var router=express[_0x975b('0x3')]();var fs_extra=require(_0x975b('0x4'));var auth=require(_0x975b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x975b('0x6'));var controller=require(_0x975b('0x7'));router[_0x975b('0x8')]('/',auth[_0x975b('0x9')](),controller['index']);router['get'](_0x975b('0xa'),auth[_0x975b('0x9')](),controller[_0x975b('0xb')]);router[_0x975b('0xc')]('/',auth[_0x975b('0x9')](),controller[_0x975b('0xd')]);router[_0x975b('0xe')](_0x975b('0xa'),auth['isAuthenticated'](),controller[_0x975b('0xf')]);router[_0x975b('0x10')](_0x975b('0xa'),auth['isAuthenticated'](),controller[_0x975b('0x11')]);module[_0x975b('0x12')]=router;
\ No newline at end of file
+var _0x3430=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','exports','multer','util','path','connect-timeout'];(function(_0x4d3874,_0x37063a){var _0x4ba542=function(_0x563663){while(--_0x563663){_0x4d3874['push'](_0x4d3874['shift']());}};_0x4ba542(++_0x37063a);}(_0x3430,0xcc));var _0x0343=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x3430[_0x101e7b];return _0x4995c0;};'use strict';var multer=require(_0x0343('0x0'));var util=require(_0x0343('0x1'));var path=require(_0x0343('0x2'));var timeout=require(_0x0343('0x3'));var express=require(_0x0343('0x4'));var router=express[_0x0343('0x5')]();var fs_extra=require(_0x0343('0x6'));var auth=require(_0x0343('0x7'));var interaction=require(_0x0343('0x8'));var config=require(_0x0343('0x9'));var controller=require(_0x0343('0xa'));router[_0x0343('0xb')]('/',auth[_0x0343('0xc')](),controller[_0x0343('0xd')]);router['get'](_0x0343('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x0343('0xc')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x0343('0xe'),auth[_0x0343('0xc')](),controller['destroy']);module[_0x0343('0xf')]=router;
\ No newline at end of file
index fd0c924..dbd4922 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda77=['string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','exports'];(function(_0x173336,_0x3f98c4){var _0x12dc79=function(_0xae7bf5){while(--_0xae7bf5){_0x173336['push'](_0x173336['shift']());}};_0x12dc79(++_0x3f98c4);}(_0xda77,0x1a2));var _0x7da7=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0xda77[_0x1ccdf7];return _0x52a0ae;};'use strict';var Sequelize=require(_0x7da7('0x0'));module[_0x7da7('0x1')]={'type':{'type':Sequelize['ENUM'](_0x7da7('0x2'),_0x7da7('0x3'),_0x7da7('0x4'),_0x7da7('0x5'),_0x7da7('0x6')),'defaultValue':_0x7da7('0x2')},'content':{'type':Sequelize[_0x7da7('0x7')]},'key':{'type':Sequelize[_0x7da7('0x7')]},'keyType':{'type':Sequelize[_0x7da7('0x8')]('string','variable',_0x7da7('0x4'))},'keyContent':{'type':Sequelize[_0x7da7('0x7')]},'idField':{'type':Sequelize[_0x7da7('0x7')]},'nameField':{'type':Sequelize[_0x7da7('0x7')]},'customField':{'type':Sequelize[_0x7da7('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7da7('0x7')]}};
\ No newline at end of file
+var _0xecff=['string','variable','STRING','ENUM','customVariable','keyValue','picklist'];(function(_0x2a0040,_0x278b70){var _0x76a2e4=function(_0x31c4f2){while(--_0x31c4f2){_0x2a0040['push'](_0x2a0040['shift']());}};_0x76a2e4(++_0x278b70);}(_0xecff,0x130));var _0xfecf=function(_0x184667,_0x22bbcb){_0x184667=_0x184667-0x0;var _0x5898d5=_0xecff[_0x184667];return _0x5898d5;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xfecf('0x0')]('string','variable',_0xfecf('0x1'),_0xfecf('0x2'),_0xfecf('0x3')),'defaultValue':_0xfecf('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xfecf('0x0')](_0xfecf('0x4'),_0xfecf('0x5'),_0xfecf('0x1'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xfecf('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfecf('0x6')]}};
\ No newline at end of file
index af3b9f8..09342e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf89=['show','params','rawAttributes','include','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','Content-Range','apply','reject','save','update','then','destroy','error','name','index','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','ServicenowField','findAll','rows','catch'];(function(_0x3f758f,_0x302451){var _0x26e4ae=function(_0x54beae){while(--_0x54beae){_0x3f758f['push'](_0x3f758f['shift']());}};_0x26e4ae(++_0x302451);}(_0xdf89,0x97));var _0x9df8=function(_0x55a5e7,_0x4422ed){_0x55a5e7=_0x55a5e7-0x0;var _0x9780e3=_0xdf89[_0x55a5e7];return _0x9780e3;};'use strict';var emlformat=require(_0x9df8('0x0'));var rimraf=require(_0x9df8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9df8('0x2'));var rp=require(_0x9df8('0x3'));var moment=require(_0x9df8('0x4'));var BPromise=require(_0x9df8('0x5'));var Mustache=require(_0x9df8('0x6'));var util=require(_0x9df8('0x7'));var path=require(_0x9df8('0x8'));var sox=require(_0x9df8('0x9'));var csv=require(_0x9df8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9df8('0xb'));var _=require('lodash');var squel=require(_0x9df8('0xc'));var crypto=require('crypto');var jsforce=require(_0x9df8('0xd'));var deskjs=require(_0x9df8('0xe'));var toCsv=require(_0x9df8('0xa'));var querystring=require(_0x9df8('0xf'));var Papa=require(_0x9df8('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9df8('0x11'));var logger=require(_0x9df8('0x12'))(_0x9df8('0x13'));var utils=require('../../config/utils');var config=require(_0x9df8('0x14'));var licenseUtil=require(_0x9df8('0x15'));var db=require(_0x9df8('0x16'))['db'];function respondWithStatusCode(_0xad7a8a,_0xb84be1){_0xb84be1=_0xb84be1||0xcc;return function(_0x31f122){if(_0x31f122){return _0xad7a8a[_0x9df8('0x17')](_0xb84be1);}return _0xad7a8a[_0x9df8('0x18')](_0xb84be1)[_0x9df8('0x19')]();};}function respondWithResult(_0x37c8a8,_0x25d1dd){_0x25d1dd=_0x25d1dd||0xc8;return function(_0x47df63){if(_0x47df63){return _0x37c8a8['status'](_0x25d1dd)['json'](_0x47df63);}};}function respondWithFilteredResult(_0x485e81,_0x5e5c86){return function(_0xb7a9b8){if(_0xb7a9b8){var _0x426fac=typeof _0x5e5c86['offset']===_0x9df8('0x1a')&&typeof _0x5e5c86[_0x9df8('0x1b')]==='undefined';var _0x38530c=_0xb7a9b8['count'];var _0x5dd1be=_0x426fac?0x0:_0x5e5c86[_0x9df8('0x1c')];var _0x488534=_0x426fac?_0xb7a9b8[_0x9df8('0x1d')]:_0x5e5c86[_0x9df8('0x1c')]+_0x5e5c86['limit'];var _0x9386d3;if(_0x488534>=_0x38530c){_0x488534=_0x38530c;_0x9386d3=0xc8;}else{_0x9386d3=0xce;}_0x485e81['status'](_0x9386d3);return _0x485e81['set'](_0x9df8('0x1e'),_0x5dd1be+'-'+_0x488534+'/'+_0x38530c)['json'](_0xb7a9b8);}return null;};}function patchUpdates(_0x11bd86){return function(_0x3f94e7){try{jsonpatch[_0x9df8('0x1f')](_0x3f94e7,_0x11bd86,!![]);}catch(_0x355dac){return BPromise[_0x9df8('0x20')](_0x355dac);}return _0x3f94e7[_0x9df8('0x21')]();};}function saveUpdates(_0x5c4041,_0x5492ad){return function(_0x37938a){if(_0x37938a){return _0x37938a[_0x9df8('0x22')](_0x5c4041)[_0x9df8('0x23')](function(_0x1d4cf7){return _0x1d4cf7;});}return null;};}function removeEntity(_0xa4830c,_0x4a68f5){return function(_0x250cf2){if(_0x250cf2){return _0x250cf2[_0x9df8('0x24')]()['then'](function(){_0xa4830c[_0x9df8('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x58c6f2,_0x189ff2){return function(_0x527a82){if(!_0x527a82){_0x58c6f2[_0x9df8('0x17')](0x194);}return _0x527a82;};}function handleError(_0x57a96d,_0x1e4455){_0x1e4455=_0x1e4455||0x1f4;return function(_0x30a286){logger[_0x9df8('0x25')](_0x30a286['stack']);if(_0x30a286[_0x9df8('0x26')]){delete _0x30a286[_0x9df8('0x26')];}_0x57a96d[_0x9df8('0x18')](_0x1e4455)['send'](_0x30a286);};}exports[_0x9df8('0x27')]=function(_0x161c13,_0x2d1cbc){var _0xa01fbc={},_0x4cbb42={},_0x272bbb={'count':0x0,'rows':[]};var _0x15b0d7=_['map'](db['ServicenowField']['rawAttributes'],function(_0x103d49){return{'name':_0x103d49[_0x9df8('0x28')],'type':_0x103d49[_0x9df8('0x29')][_0x9df8('0x2a')]};});_0x4cbb42[_0x9df8('0x2b')]=_['map'](_0x15b0d7,_0x9df8('0x26'));_0x4cbb42['query']=_[_0x9df8('0x2c')](_0x161c13[_0x9df8('0x2d')]);_0x4cbb42[_0x9df8('0x2e')]=_[_0x9df8('0x2f')](_0x4cbb42[_0x9df8('0x2b')],_0x4cbb42['query']);_0xa01fbc[_0x9df8('0x30')]=_['intersection'](_0x4cbb42[_0x9df8('0x2b')],qs[_0x9df8('0x31')](_0x161c13[_0x9df8('0x2d')]['fields']));_0xa01fbc['attributes']=_0xa01fbc['attributes'][_0x9df8('0x32')]?_0xa01fbc['attributes']:_0x4cbb42[_0x9df8('0x2b')];if(!_0x161c13['query'][_0x9df8('0x33')]('nolimit')){_0xa01fbc[_0x9df8('0x1b')]=qs[_0x9df8('0x1b')](_0x161c13[_0x9df8('0x2d')]['limit']);_0xa01fbc[_0x9df8('0x1c')]=qs[_0x9df8('0x1c')](_0x161c13[_0x9df8('0x2d')][_0x9df8('0x1c')]);}_0xa01fbc[_0x9df8('0x34')]=qs['sort'](_0x161c13['query'][_0x9df8('0x35')]);_0xa01fbc[_0x9df8('0x36')]=qs[_0x9df8('0x2e')](_['pick'](_0x161c13[_0x9df8('0x2d')],_0x4cbb42['filters']),_0x15b0d7);if(_0x161c13[_0x9df8('0x2d')][_0x9df8('0x37')]){_0xa01fbc[_0x9df8('0x36')]=_[_0x9df8('0x38')](_0xa01fbc['where'],{'$or':_[_0x9df8('0x39')](_0x15b0d7,function(_0x2bd2a0){if(_0x2bd2a0['type']!==_0x9df8('0x3a')){var _0x39f21c={};_0x39f21c[_0x2bd2a0[_0x9df8('0x26')]]={'$like':'%'+_0x161c13[_0x9df8('0x2d')][_0x9df8('0x37')]+'%'};return _0x39f21c;}})});}_0xa01fbc=_[_0x9df8('0x38')]({},_0xa01fbc,_0x161c13[_0x9df8('0x3b')]);var _0x43da24={'where':_0xa01fbc[_0x9df8('0x36')]};return db['ServicenowField'][_0x9df8('0x1d')](_0x43da24)[_0x9df8('0x23')](function(_0x1750f9){_0x272bbb['count']=_0x1750f9;if(_0x161c13[_0x9df8('0x2d')][_0x9df8('0x3c')]){_0xa01fbc['include']=[{'all':!![]}];}return db[_0x9df8('0x3d')][_0x9df8('0x3e')](_0xa01fbc);})[_0x9df8('0x23')](function(_0x2435ed){_0x272bbb[_0x9df8('0x3f')]=_0x2435ed;return _0x272bbb;})[_0x9df8('0x23')](respondWithFilteredResult(_0x2d1cbc,_0xa01fbc))[_0x9df8('0x40')](handleError(_0x2d1cbc,null));};exports[_0x9df8('0x41')]=function(_0x248230,_0x3e9887){var _0x237ba9={'raw':!![],'where':{'id':_0x248230[_0x9df8('0x42')]['id']}},_0x2c4a25={};_0x2c4a25[_0x9df8('0x2b')]=_[_0x9df8('0x2c')](db[_0x9df8('0x3d')][_0x9df8('0x43')]);_0x2c4a25[_0x9df8('0x2d')]=_['keys'](_0x248230[_0x9df8('0x2d')]);_0x2c4a25[_0x9df8('0x2e')]=_[_0x9df8('0x2f')](_0x2c4a25[_0x9df8('0x2b')],_0x2c4a25[_0x9df8('0x2d')]);_0x237ba9['attributes']=_[_0x9df8('0x2f')](_0x2c4a25[_0x9df8('0x2b')],qs[_0x9df8('0x31')](_0x248230[_0x9df8('0x2d')][_0x9df8('0x31')]));_0x237ba9[_0x9df8('0x30')]=_0x237ba9['attributes'][_0x9df8('0x32')]?_0x237ba9[_0x9df8('0x30')]:_0x2c4a25[_0x9df8('0x2b')];if(_0x248230[_0x9df8('0x2d')][_0x9df8('0x3c')]){_0x237ba9[_0x9df8('0x44')]=[{'all':!![]}];}_0x237ba9=_[_0x9df8('0x38')]({},_0x237ba9,_0x248230['options']);return db[_0x9df8('0x3d')][_0x9df8('0x45')](_0x237ba9)['then'](handleEntityNotFound(_0x3e9887,null))['then'](respondWithResult(_0x3e9887,null))[_0x9df8('0x40')](handleError(_0x3e9887,null));};exports[_0x9df8('0x46')]=function(_0x298f50,_0x1da538){return db['ServicenowField']['create'](_0x298f50[_0x9df8('0x47')],{})[_0x9df8('0x23')](respondWithResult(_0x1da538,0xc9))[_0x9df8('0x40')](handleError(_0x1da538,null));};exports[_0x9df8('0x22')]=function(_0x316393,_0x4d72dd){if(_0x316393[_0x9df8('0x47')]['id']){delete _0x316393[_0x9df8('0x47')]['id'];}return db[_0x9df8('0x3d')][_0x9df8('0x45')]({'where':{'id':_0x316393[_0x9df8('0x42')]['id']}})[_0x9df8('0x23')](handleEntityNotFound(_0x4d72dd,null))[_0x9df8('0x23')](saveUpdates(_0x316393['body'],null))['then'](respondWithResult(_0x4d72dd,null))[_0x9df8('0x40')](handleError(_0x4d72dd,null));};exports[_0x9df8('0x24')]=function(_0x49fa39,_0x34d8a0){return db[_0x9df8('0x3d')][_0x9df8('0x45')]({'where':{'id':_0x49fa39['params']['id']}})[_0x9df8('0x23')](handleEntityNotFound(_0x34d8a0,null))[_0x9df8('0x23')](removeEntity(_0x34d8a0,null))[_0x9df8('0x40')](handleError(_0x34d8a0,null));};
\ No newline at end of file
+var _0xb5d8=['json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','ServicenowField','rawAttributes','fieldName','query','keys','model','attributes','intersection','fields','length','nolimit','order','sort','where','filters','pick','merge','type','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end'];(function(_0x17b18b,_0x26c070){var _0x2757bc=function(_0x100edf){while(--_0x100edf){_0x17b18b['push'](_0x17b18b['shift']());}};_0x2757bc(++_0x26c070);}(_0xb5d8,0x79));var _0x8b5d=function(_0x2f5016,_0x3316c0){_0x2f5016=_0x2f5016-0x0;var _0x2daef6=_0xb5d8[_0x2f5016];return _0x2daef6;};'use strict';var emlformat=require(_0x8b5d('0x0'));var rimraf=require(_0x8b5d('0x1'));var zipdir=require(_0x8b5d('0x2'));var jsonpatch=require(_0x8b5d('0x3'));var rp=require(_0x8b5d('0x4'));var moment=require(_0x8b5d('0x5'));var BPromise=require(_0x8b5d('0x6'));var Mustache=require(_0x8b5d('0x7'));var util=require(_0x8b5d('0x8'));var path=require('path');var sox=require(_0x8b5d('0x9'));var csv=require(_0x8b5d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b5d('0xb'));var _=require(_0x8b5d('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8b5d('0xd'));var deskjs=require(_0x8b5d('0xe'));var toCsv=require(_0x8b5d('0xa'));var querystring=require(_0x8b5d('0xf'));var Papa=require(_0x8b5d('0x10'));var Redis=require(_0x8b5d('0x11'));var authService=require(_0x8b5d('0x12'));var qs=require(_0x8b5d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b5d('0x14'))(_0x8b5d('0x15'));var utils=require(_0x8b5d('0x16'));var config=require(_0x8b5d('0x17'));var licenseUtil=require(_0x8b5d('0x18'));var db=require(_0x8b5d('0x19'))['db'];function respondWithStatusCode(_0x37110e,_0x52b5f1){_0x52b5f1=_0x52b5f1||0xcc;return function(_0x3af9fd){if(_0x3af9fd){return _0x37110e[_0x8b5d('0x1a')](_0x52b5f1);}return _0x37110e[_0x8b5d('0x1b')](_0x52b5f1)[_0x8b5d('0x1c')]();};}function respondWithResult(_0x39436e,_0x45e250){_0x45e250=_0x45e250||0xc8;return function(_0xe53de9){if(_0xe53de9){return _0x39436e['status'](_0x45e250)[_0x8b5d('0x1d')](_0xe53de9);}};}function respondWithFilteredResult(_0x78163e,_0x52c17d){return function(_0x492a85){if(_0x492a85){var _0x3fcfad=typeof _0x52c17d[_0x8b5d('0x1e')]===_0x8b5d('0x1f')&&typeof _0x52c17d[_0x8b5d('0x20')]==='undefined';var _0x16827f=_0x492a85[_0x8b5d('0x21')];var _0x44ed82=_0x3fcfad?0x0:_0x52c17d[_0x8b5d('0x1e')];var _0x1dd115=_0x3fcfad?_0x492a85['count']:_0x52c17d[_0x8b5d('0x1e')]+_0x52c17d[_0x8b5d('0x20')];var _0x5c968f;if(_0x1dd115>=_0x16827f){_0x1dd115=_0x16827f;_0x5c968f=0xc8;}else{_0x5c968f=0xce;}_0x78163e[_0x8b5d('0x1b')](_0x5c968f);return _0x78163e['set'](_0x8b5d('0x22'),_0x44ed82+'-'+_0x1dd115+'/'+_0x16827f)['json'](_0x492a85);}return null;};}function patchUpdates(_0x4c2ed1){return function(_0x1c8b3d){try{jsonpatch[_0x8b5d('0x23')](_0x1c8b3d,_0x4c2ed1,!![]);}catch(_0x53ae08){return BPromise['reject'](_0x53ae08);}return _0x1c8b3d[_0x8b5d('0x24')]();};}function saveUpdates(_0x51177d,_0x142a4c){return function(_0x1b5340){if(_0x1b5340){return _0x1b5340[_0x8b5d('0x25')](_0x51177d)[_0x8b5d('0x26')](function(_0x21e7f8){return _0x21e7f8;});}return null;};}function removeEntity(_0x249089,_0x4d567d){return function(_0x52332f){if(_0x52332f){return _0x52332f[_0x8b5d('0x27')]()[_0x8b5d('0x26')](function(){_0x249089['status'](0xcc)[_0x8b5d('0x1c')]();});}};}function handleEntityNotFound(_0x1b5d82,_0x341320){return function(_0x512af3){if(!_0x512af3){_0x1b5d82[_0x8b5d('0x1a')](0x194);}return _0x512af3;};}function handleError(_0x32df5d,_0x43de88){_0x43de88=_0x43de88||0x1f4;return function(_0x52e045){logger[_0x8b5d('0x28')](_0x52e045[_0x8b5d('0x29')]);if(_0x52e045[_0x8b5d('0x2a')]){delete _0x52e045[_0x8b5d('0x2a')];}_0x32df5d[_0x8b5d('0x1b')](_0x43de88)[_0x8b5d('0x2b')](_0x52e045);};}exports['index']=function(_0x5cfc0f,_0x39576e){var _0x273169={},_0x438837={},_0x251cd3={'count':0x0,'rows':[]};var _0x508e4f=_[_0x8b5d('0x2c')](db[_0x8b5d('0x2d')][_0x8b5d('0x2e')],function(_0x5896ad){return{'name':_0x5896ad[_0x8b5d('0x2f')],'type':_0x5896ad['type']['key']};});_0x438837['model']=_[_0x8b5d('0x2c')](_0x508e4f,'name');_0x438837[_0x8b5d('0x30')]=_[_0x8b5d('0x31')](_0x5cfc0f['query']);_0x438837['filters']=_['intersection'](_0x438837[_0x8b5d('0x32')],_0x438837[_0x8b5d('0x30')]);_0x273169[_0x8b5d('0x33')]=_[_0x8b5d('0x34')](_0x438837['model'],qs[_0x8b5d('0x35')](_0x5cfc0f[_0x8b5d('0x30')]['fields']));_0x273169[_0x8b5d('0x33')]=_0x273169[_0x8b5d('0x33')][_0x8b5d('0x36')]?_0x273169[_0x8b5d('0x33')]:_0x438837['model'];if(!_0x5cfc0f['query']['hasOwnProperty'](_0x8b5d('0x37'))){_0x273169['limit']=qs[_0x8b5d('0x20')](_0x5cfc0f['query'][_0x8b5d('0x20')]);_0x273169[_0x8b5d('0x1e')]=qs[_0x8b5d('0x1e')](_0x5cfc0f[_0x8b5d('0x30')]['offset']);}_0x273169[_0x8b5d('0x38')]=qs[_0x8b5d('0x39')](_0x5cfc0f[_0x8b5d('0x30')][_0x8b5d('0x39')]);_0x273169[_0x8b5d('0x3a')]=qs[_0x8b5d('0x3b')](_[_0x8b5d('0x3c')](_0x5cfc0f[_0x8b5d('0x30')],_0x438837[_0x8b5d('0x3b')]),_0x508e4f);if(_0x5cfc0f[_0x8b5d('0x30')]['filter']){_0x273169[_0x8b5d('0x3a')]=_[_0x8b5d('0x3d')](_0x273169['where'],{'$or':_[_0x8b5d('0x2c')](_0x508e4f,function(_0x22299d){if(_0x22299d[_0x8b5d('0x3e')]!=='VIRTUAL'){var _0x4d7a3b={};_0x4d7a3b[_0x22299d[_0x8b5d('0x2a')]]={'$like':'%'+_0x5cfc0f[_0x8b5d('0x30')][_0x8b5d('0x3f')]+'%'};return _0x4d7a3b;}})});}_0x273169=_[_0x8b5d('0x3d')]({},_0x273169,_0x5cfc0f[_0x8b5d('0x40')]);var _0x2b8776={'where':_0x273169['where']};return db[_0x8b5d('0x2d')][_0x8b5d('0x21')](_0x2b8776)[_0x8b5d('0x26')](function(_0x3c55c3){_0x251cd3[_0x8b5d('0x21')]=_0x3c55c3;if(_0x5cfc0f[_0x8b5d('0x30')][_0x8b5d('0x41')]){_0x273169[_0x8b5d('0x42')]=[{'all':!![]}];}return db[_0x8b5d('0x2d')][_0x8b5d('0x43')](_0x273169);})['then'](function(_0x4856e7){_0x251cd3[_0x8b5d('0x44')]=_0x4856e7;return _0x251cd3;})['then'](respondWithFilteredResult(_0x39576e,_0x273169))[_0x8b5d('0x45')](handleError(_0x39576e,null));};exports[_0x8b5d('0x46')]=function(_0x1c8a8e,_0x1ef085){var _0x3b359c={'raw':!![],'where':{'id':_0x1c8a8e[_0x8b5d('0x47')]['id']}},_0x218a02={};_0x218a02[_0x8b5d('0x32')]=_[_0x8b5d('0x31')](db[_0x8b5d('0x2d')][_0x8b5d('0x2e')]);_0x218a02[_0x8b5d('0x30')]=_[_0x8b5d('0x31')](_0x1c8a8e['query']);_0x218a02['filters']=_[_0x8b5d('0x34')](_0x218a02['model'],_0x218a02[_0x8b5d('0x30')]);_0x3b359c['attributes']=_[_0x8b5d('0x34')](_0x218a02[_0x8b5d('0x32')],qs[_0x8b5d('0x35')](_0x1c8a8e[_0x8b5d('0x30')][_0x8b5d('0x35')]));_0x3b359c[_0x8b5d('0x33')]=_0x3b359c[_0x8b5d('0x33')][_0x8b5d('0x36')]?_0x3b359c[_0x8b5d('0x33')]:_0x218a02[_0x8b5d('0x32')];if(_0x1c8a8e['query'][_0x8b5d('0x41')]){_0x3b359c[_0x8b5d('0x42')]=[{'all':!![]}];}_0x3b359c=_[_0x8b5d('0x3d')]({},_0x3b359c,_0x1c8a8e[_0x8b5d('0x40')]);return db[_0x8b5d('0x2d')][_0x8b5d('0x48')](_0x3b359c)[_0x8b5d('0x26')](handleEntityNotFound(_0x1ef085,null))[_0x8b5d('0x26')](respondWithResult(_0x1ef085,null))['catch'](handleError(_0x1ef085,null));};exports[_0x8b5d('0x49')]=function(_0x4b4fb0,_0x3ba2e4){return db[_0x8b5d('0x2d')]['create'](_0x4b4fb0[_0x8b5d('0x4a')],{})[_0x8b5d('0x26')](respondWithResult(_0x3ba2e4,0xc9))[_0x8b5d('0x45')](handleError(_0x3ba2e4,null));};exports[_0x8b5d('0x25')]=function(_0x4ff680,_0x553eb4){if(_0x4ff680[_0x8b5d('0x4a')]['id']){delete _0x4ff680[_0x8b5d('0x4a')]['id'];}return db[_0x8b5d('0x2d')][_0x8b5d('0x48')]({'where':{'id':_0x4ff680[_0x8b5d('0x47')]['id']}})[_0x8b5d('0x26')](handleEntityNotFound(_0x553eb4,null))['then'](saveUpdates(_0x4ff680[_0x8b5d('0x4a')],null))[_0x8b5d('0x26')](respondWithResult(_0x553eb4,null))[_0x8b5d('0x45')](handleError(_0x553eb4,null));};exports['destroy']=function(_0x3f8688,_0x4db44e){return db[_0x8b5d('0x2d')][_0x8b5d('0x48')]({'where':{'id':_0x3f8688[_0x8b5d('0x47')]['id']}})[_0x8b5d('0x26')](handleEntityNotFound(_0x4db44e,null))['then'](removeEntity(_0x4db44e,null))[_0x8b5d('0x45')](handleError(_0x4db44e,null));};
\ No newline at end of file
index 3f3798a..a3999d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef06=['api','bluebird','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','servicenow_unique_index','idField','FieldId','lodash','../../config/logger'];(function(_0x16337a,_0x4789a1){var _0x422365=function(_0x34f039){while(--_0x34f039){_0x16337a['push'](_0x16337a['shift']());}};_0x422365(++_0x4789a1);}(_0xef06,0x186));var _0x6ef0=function(_0x438fe1,_0x3308d5){_0x438fe1=_0x438fe1-0x0;var _0x3c8e1b=_0xef06[_0x438fe1];return _0x3c8e1b;};'use strict';var _=require(_0x6ef0('0x0'));var util=require('util');var logger=require(_0x6ef0('0x1'))(_0x6ef0('0x2'));var moment=require('moment');var BPromise=require(_0x6ef0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ef0('0x4'));var rimraf=require(_0x6ef0('0x5'));var config=require(_0x6ef0('0x6'));var attributes=require(_0x6ef0('0x7'));module[_0x6ef0('0x8')]=function(_0x69e99c,_0x46866b){return _0x69e99c[_0x6ef0('0x9')](_0x6ef0('0xa'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x6ef0('0xb'),'fields':[_0x6ef0('0xc'),_0x6ef0('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x2a33=['rimraf','../../config/environment','./intServicenowField.attributes','exports','ServicenowField','int_servicenow_fields','idField','FieldId','lodash','util','api','moment','bluebird','request-promise'];(function(_0x1d931b,_0x4bdf69){var _0x2b1594=function(_0x2fb23e){while(--_0x2fb23e){_0x1d931b['push'](_0x1d931b['shift']());}};_0x2b1594(++_0x4bdf69);}(_0x2a33,0xf6));var _0x32a3=function(_0x53c55a,_0x5997e3){_0x53c55a=_0x53c55a-0x0;var _0x3ed537=_0x2a33[_0x53c55a];return _0x3ed537;};'use strict';var _=require(_0x32a3('0x0'));var util=require(_0x32a3('0x1'));var logger=require('../../config/logger')(_0x32a3('0x2'));var moment=require(_0x32a3('0x3'));var BPromise=require(_0x32a3('0x4'));var rp=require(_0x32a3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x32a3('0x6'));var config=require(_0x32a3('0x7'));var attributes=require(_0x32a3('0x8'));module[_0x32a3('0x9')]=function(_0x10c771,_0x546e69){return _0x10c771['define'](_0x32a3('0xa'),attributes,{'tableName':_0x32a3('0xb'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x32a3('0xc'),_0x32a3('0xd')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 9b4d8dc..8c49242 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x41857c,_0x926c57){var _0xde1cdd=function(_0x474700){while(--_0x474700){_0x41857c['push'](_0x41857c['shift']());}};_0xde1cdd(++_0x926c57);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('ServicenowField,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}
\ No newline at end of file
+var _0xe706=['http','request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x25262c,_0x4c7f4d){var _0x2c4adf=function(_0xba0f29){while(--_0xba0f29){_0x25262c['push'](_0x25262c['shift']());}};_0x2c4adf(++_0x4c7f4d);}(_0xe706,0xa3));var _0x6e70=function(_0x329dd0,_0x47e04f){_0x329dd0=_0x329dd0-0x0;var _0x4f5b90=_0xe706[_0x329dd0];return _0x4f5b90;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('ServicenowField,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}
\ No newline at end of file
index 4c4f76a..fd280ac 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(_0x4505d0,_0x4aa5d6){var _0x1975e1=function(_0x2dd02d){while(--_0x2dd02d){_0x4505d0['push'](_0x4505d0['shift']());}};_0x1975e1(++_0x4aa5d6);}(_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['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(_0x1d3a9c,_0x4a2171){var _0x34a398=function(_0x408094){while(--_0x408094){_0x1d3a9c['push'](_0x1d3a9c['shift']());}};_0x34a398(++_0x4a2171);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('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 d12cc5d..58b89ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x1caf2e,_0x2540f1){var _0x462e4a=function(_0x3a4f15){while(--_0x3a4f15){_0x1caf2e['push'](_0x1caf2e['shift']());}};_0x462e4a(++_0x2540f1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ddedd,_0x485606){_0x1ddedd=_0x1ddedd-0x0;var _0xa3e1ac=_0xa9e0[_0x1ddedd];return _0xa3e1ac;};'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(_0x50229e,_0x4e0f51){var _0x81e1d9=function(_0x14c548){while(--_0x14c548){_0x50229e['push'](_0x50229e['shift']());}};_0x81e1d9(++_0x4e0f51);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xa9e0[_0x4e1d03];return _0x362d4b;};'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 8314e40..f57a432 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5548=['mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','then','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','SugarcrmAccount','include','findAll','rows','catch','params','includeAll','body','update','destroy','find','getConfigurations','findOne','SugarcrmConfiguration','pick','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','SugarcrmField','getFields','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_id','parent_name','direction','username','remoteUri','substring','POST','format','/service/v4_1/rest.php','login','JSON','PLAIN','Invalid\x20Login','Password\x20Expired','%s%s','get_module_fields','Calls','values','remove','includes','label','endsWith','value','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x381497,_0x4f195d){var _0x3a7865=function(_0x58c391){while(--_0x58c391){_0x381497['push'](_0x381497['shift']());}};_0x3a7865(++_0x4f195d);}(_0x5548,0x70));var _0x8554=function(_0x559434,_0x2f9870){_0x559434=_0x559434-0x0;var _0x252834=_0x5548[_0x559434];return _0x252834;};'use strict';var emlformat=require(_0x8554('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8554('0x1'));var jsonpatch=require(_0x8554('0x2'));var rp=require(_0x8554('0x3'));var moment=require(_0x8554('0x4'));var BPromise=require(_0x8554('0x5'));var Mustache=require(_0x8554('0x6'));var util=require(_0x8554('0x7'));var path=require(_0x8554('0x8'));var sox=require(_0x8554('0x9'));var csv=require(_0x8554('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8554('0xb'));var squel=require(_0x8554('0xc'));var crypto=require(_0x8554('0xd'));var jsforce=require(_0x8554('0xe'));var deskjs=require(_0x8554('0xf'));var toCsv=require(_0x8554('0xa'));var querystring=require(_0x8554('0x10'));var Papa=require(_0x8554('0x11'));var Redis=require('ioredis');var authService=require(_0x8554('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8554('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8554('0x14'));var utils=require(_0x8554('0x15'));var config=require(_0x8554('0x16'));var licenseUtil=require(_0x8554('0x17'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x28be37,_0xba71fd){_0xba71fd=_0xba71fd||0xcc;return function(_0x31d121){if(_0x31d121){return _0x28be37[_0x8554('0x18')](_0xba71fd);}return _0x28be37[_0x8554('0x19')](_0xba71fd)['end']();};}function respondWithResult(_0x57fe60,_0x3dde28){_0x3dde28=_0x3dde28||0xc8;return function(_0x526d2e){if(_0x526d2e){return _0x57fe60[_0x8554('0x19')](_0x3dde28)[_0x8554('0x1a')](_0x526d2e);}};}function respondWithFilteredResult(_0x5162a2,_0x2295ee){return function(_0x765312){if(_0x765312){var _0xe442ec=typeof _0x2295ee[_0x8554('0x1b')]===_0x8554('0x1c')&&typeof _0x2295ee[_0x8554('0x1d')]===_0x8554('0x1c');var _0x12397f=_0x765312[_0x8554('0x1e')];var _0xa35030=_0xe442ec?0x0:_0x2295ee['offset'];var _0x44be83=_0xe442ec?_0x765312[_0x8554('0x1e')]:_0x2295ee['offset']+_0x2295ee[_0x8554('0x1d')];var _0x540f1f;if(_0x44be83>=_0x12397f){_0x44be83=_0x12397f;_0x540f1f=0xc8;}else{_0x540f1f=0xce;}_0x5162a2[_0x8554('0x19')](_0x540f1f);return _0x5162a2[_0x8554('0x1f')]('Content-Range',_0xa35030+'-'+_0x44be83+'/'+_0x12397f)[_0x8554('0x1a')](_0x765312);}return null;};}function patchUpdates(_0x34ecd){return function(_0x19c118){try{jsonpatch[_0x8554('0x20')](_0x19c118,_0x34ecd,!![]);}catch(_0x26325e){return BPromise[_0x8554('0x21')](_0x26325e);}return _0x19c118[_0x8554('0x22')]();};}function saveUpdates(_0x47320f,_0x13bc26){return function(_0x31c1e8){if(_0x31c1e8){return _0x31c1e8['update'](_0x47320f)[_0x8554('0x23')](function(_0x3aab75){return _0x3aab75;});}return null;};}function removeEntity(_0x536b2b,_0x2862e3){return function(_0x48b268){if(_0x48b268){return _0x48b268['destroy']()[_0x8554('0x23')](function(){_0x536b2b[_0x8554('0x19')](0xcc)[_0x8554('0x24')]();});}};}function handleEntityNotFound(_0x4bd09c,_0x419b6f){return function(_0x3128c9){if(!_0x3128c9){_0x4bd09c['sendStatus'](0x194);}return _0x3128c9;};}function handleError(_0x3b91bb,_0x4c21e0){_0x4c21e0=_0x4c21e0||0x1f4;return function(_0x4c49b7){logger[_0x8554('0x25')](_0x4c49b7[_0x8554('0x26')]);if(_0x4c49b7[_0x8554('0x27')]){delete _0x4c49b7[_0x8554('0x27')];}_0x3b91bb['status'](_0x4c21e0)[_0x8554('0x28')](_0x4c49b7);};}exports['index']=function(_0x5918de,_0x35e26d){var _0x4e5113={},_0x1c47d4={},_0x1bddf3={'count':0x0,'rows':[]};var _0x3ef715=_[_0x8554('0x29')](db['SugarcrmAccount'][_0x8554('0x2a')],function(_0x451894){return{'name':_0x451894[_0x8554('0x2b')],'type':_0x451894[_0x8554('0x2c')][_0x8554('0x2d')]};});_0x1c47d4[_0x8554('0x2e')]=_['map'](_0x3ef715,_0x8554('0x27'));_0x1c47d4[_0x8554('0x2f')]=_[_0x8554('0x30')](_0x5918de[_0x8554('0x2f')]);_0x1c47d4[_0x8554('0x31')]=_['intersection'](_0x1c47d4['model'],_0x1c47d4[_0x8554('0x2f')]);_0x4e5113['attributes']=_[_0x8554('0x32')](_0x1c47d4[_0x8554('0x2e')],qs[_0x8554('0x33')](_0x5918de[_0x8554('0x2f')][_0x8554('0x33')]));_0x4e5113[_0x8554('0x34')]=_0x4e5113[_0x8554('0x34')][_0x8554('0x35')]?_0x4e5113[_0x8554('0x34')]:_0x1c47d4[_0x8554('0x2e')];if(!_0x5918de['query'][_0x8554('0x36')](_0x8554('0x37'))){_0x4e5113[_0x8554('0x1d')]=qs[_0x8554('0x1d')](_0x5918de['query'][_0x8554('0x1d')]);_0x4e5113[_0x8554('0x1b')]=qs[_0x8554('0x1b')](_0x5918de[_0x8554('0x2f')][_0x8554('0x1b')]);}_0x4e5113[_0x8554('0x38')]=qs[_0x8554('0x39')](_0x5918de[_0x8554('0x2f')][_0x8554('0x39')]);_0x4e5113['where']=qs['filters'](_['pick'](_0x5918de[_0x8554('0x2f')],_0x1c47d4[_0x8554('0x31')]),_0x3ef715);if(_0x5918de[_0x8554('0x2f')]['filter']){_0x4e5113[_0x8554('0x3a')]=_[_0x8554('0x3b')](_0x4e5113[_0x8554('0x3a')],{'$or':_['map'](_0x3ef715,function(_0x29d0c9){if(_0x29d0c9[_0x8554('0x2c')]!==_0x8554('0x3c')){var _0x30978b={};_0x30978b[_0x29d0c9['name']]={'$like':'%'+_0x5918de[_0x8554('0x2f')][_0x8554('0x3d')]+'%'};return _0x30978b;}})});}_0x4e5113=_[_0x8554('0x3b')]({},_0x4e5113,_0x5918de[_0x8554('0x3e')]);var _0x1e7238={'where':_0x4e5113[_0x8554('0x3a')]};return db[_0x8554('0x3f')][_0x8554('0x1e')](_0x1e7238)[_0x8554('0x23')](function(_0x48dcca){_0x1bddf3[_0x8554('0x1e')]=_0x48dcca;if(_0x5918de['query']['includeAll']){_0x4e5113[_0x8554('0x40')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0x8554('0x41')](_0x4e5113);})[_0x8554('0x23')](function(_0x37da9b){_0x1bddf3[_0x8554('0x42')]=_0x37da9b;return _0x1bddf3;})['then'](respondWithFilteredResult(_0x35e26d,_0x4e5113))[_0x8554('0x43')](handleError(_0x35e26d,null));};exports['show']=function(_0x140d82,_0x58662f){var _0x4fc387={'raw':![],'where':{'id':_0x140d82[_0x8554('0x44')]['id']}},_0x50e8c6={};_0x50e8c6[_0x8554('0x2e')]=_[_0x8554('0x30')](db[_0x8554('0x3f')][_0x8554('0x2a')]);_0x50e8c6['query']=_['keys'](_0x140d82[_0x8554('0x2f')]);_0x50e8c6['filters']=_['intersection'](_0x50e8c6[_0x8554('0x2e')],_0x50e8c6[_0x8554('0x2f')]);_0x4fc387[_0x8554('0x34')]=_[_0x8554('0x32')](_0x50e8c6['model'],qs[_0x8554('0x33')](_0x140d82[_0x8554('0x2f')][_0x8554('0x33')]));_0x4fc387['attributes']=_0x4fc387[_0x8554('0x34')]['length']?_0x4fc387[_0x8554('0x34')]:_0x50e8c6[_0x8554('0x2e')];if(_0x140d82[_0x8554('0x2f')][_0x8554('0x45')]){_0x4fc387[_0x8554('0x40')]=[{'all':!![]}];}_0x4fc387=_[_0x8554('0x3b')]({},_0x4fc387,_0x140d82[_0x8554('0x3e')]);return db[_0x8554('0x3f')]['find'](_0x4fc387)[_0x8554('0x23')](handleEntityNotFound(_0x58662f,null))[_0x8554('0x23')](respondWithResult(_0x58662f,null))['catch'](handleError(_0x58662f,null));};exports['create']=function(_0x13c749,_0x4442a3){return db[_0x8554('0x3f')]['create'](_0x13c749[_0x8554('0x46')],{})[_0x8554('0x23')](respondWithResult(_0x4442a3,0xc9))[_0x8554('0x43')](handleError(_0x4442a3,null));};exports[_0x8554('0x47')]=function(_0x4a4181,_0x59c167){if(_0x4a4181[_0x8554('0x46')]['id']){delete _0x4a4181['body']['id'];}return db[_0x8554('0x3f')]['find']({'where':{'id':_0x4a4181['params']['id']}})[_0x8554('0x23')](handleEntityNotFound(_0x59c167,null))[_0x8554('0x23')](saveUpdates(_0x4a4181[_0x8554('0x46')],null))[_0x8554('0x23')](respondWithResult(_0x59c167,null))[_0x8554('0x43')](handleError(_0x59c167,null));};exports[_0x8554('0x48')]=function(_0x1e5fd5,_0x2c7dbd){return db['SugarcrmAccount'][_0x8554('0x49')]({'where':{'id':_0x1e5fd5[_0x8554('0x44')]['id']}})[_0x8554('0x23')](handleEntityNotFound(_0x2c7dbd,null))[_0x8554('0x23')](removeEntity(_0x2c7dbd,null))[_0x8554('0x43')](handleError(_0x2c7dbd,null));};exports[_0x8554('0x4a')]=function(_0x590d0b,_0x3f9e59,_0x220ea4){var _0x2e74cc={};var _0x3f476d={};var _0x3093cd;var _0x38fbda;return db[_0x8554('0x3f')][_0x8554('0x4b')]({'where':{'id':_0x590d0b['params']['id']}})[_0x8554('0x23')](handleEntityNotFound(_0x3f9e59,null))['then'](function(_0x4b0343){if(_0x4b0343){_0x3093cd=_0x4b0343;_0x3f476d[_0x8554('0x2e')]=_[_0x8554('0x30')](db[_0x8554('0x4c')][_0x8554('0x2a')]);_0x3f476d['query']=_['keys'](_0x590d0b[_0x8554('0x2f')]);_0x3f476d[_0x8554('0x31')]=_[_0x8554('0x32')](_0x3f476d[_0x8554('0x2e')],_0x3f476d['query']);_0x2e74cc[_0x8554('0x34')]=_[_0x8554('0x32')](_0x3f476d['model'],qs[_0x8554('0x33')](_0x590d0b[_0x8554('0x2f')]['fields']));_0x2e74cc[_0x8554('0x34')]=_0x2e74cc[_0x8554('0x34')][_0x8554('0x35')]?_0x2e74cc['attributes']:_0x3f476d['model'];_0x2e74cc[_0x8554('0x38')]=qs['sort'](_0x590d0b['query'][_0x8554('0x39')]);_0x2e74cc[_0x8554('0x3a')]=qs[_0x8554('0x31')](_[_0x8554('0x4d')](_0x590d0b[_0x8554('0x2f')],_0x3f476d[_0x8554('0x31')]));if(_0x590d0b[_0x8554('0x2f')][_0x8554('0x3d')]){_0x2e74cc['where']=_[_0x8554('0x3b')](_0x2e74cc[_0x8554('0x3a')],{'$or':_[_0x8554('0x29')](_0x2e74cc['attributes'],function(_0x54e7d5){var _0x129cb9={};_0x129cb9[_0x54e7d5]={'$like':'%'+_0x590d0b[_0x8554('0x2f')][_0x8554('0x3d')]+'%'};return _0x129cb9;})});}_0x2e74cc=_['merge']({},_0x2e74cc,_0x590d0b[_0x8554('0x3e')]);return _0x3093cd['getConfigurations'](_0x2e74cc);}})[_0x8554('0x23')](function(_0x306dce){if(_0x306dce){_0x38fbda=_0x306dce[_0x8554('0x35')];if(!_0x590d0b[_0x8554('0x2f')][_0x8554('0x36')](_0x8554('0x37'))){_0x2e74cc[_0x8554('0x1d')]=qs['limit'](_0x590d0b[_0x8554('0x2f')][_0x8554('0x1d')]);_0x2e74cc[_0x8554('0x1b')]=qs[_0x8554('0x1b')](_0x590d0b[_0x8554('0x2f')][_0x8554('0x1b')]);}return _0x3093cd[_0x8554('0x4a')](_0x2e74cc);}})['then'](function(_0x12de4f){if(_0x12de4f){return _0x12de4f?{'count':_0x38fbda,'rows':_0x12de4f}:null;}})[_0x8554('0x23')](respondWithResult(_0x3f9e59,null))[_0x8554('0x43')](handleError(_0x3f9e59,null));};exports[_0x8554('0x4e')]=function(_0x157e6f,_0x98f9a6,_0x3c0b1c){if(_0x157e6f['body']['id']){delete _0x157e6f['body']['id'];}return db[_0x8554('0x3f')][_0x8554('0x4b')]({'where':{'id':_0x157e6f[_0x8554('0x44')]['id']}})[_0x8554('0x23')](handleEntityNotFound(_0x98f9a6,null))['then'](function(_0x4b844c){if(_0x4b844c){_0x157e6f[_0x8554('0x46')]['AccountId']=_0x4b844c['id'];_0x157e6f['body'][_0x8554('0x4f')]=integrations[_0x8554('0x50')](_0x157e6f['body'][_0x8554('0x51')],_0x157e6f['body'][_0x8554('0x2c')]);_0x157e6f[_0x8554('0x46')][_0x8554('0x52')]=integrations[_0x8554('0x53')](_0x157e6f['body']['channel'],_0x157e6f[_0x8554('0x46')][_0x8554('0x2c')]);return db[_0x8554('0x4c')][_0x8554('0x54')](_0x157e6f['body'],{'include':[{'model':db['SugarcrmField'],'as':_0x8554('0x4f')},{'model':db[_0x8554('0x55')],'as':_0x8554('0x52')}]});}return null;})[_0x8554('0x23')](respondWithResult(_0x98f9a6,null))[_0x8554('0x43')](handleError(_0x98f9a6,null));};exports[_0x8554('0x56')]=function(_0x124a24,_0x216f65,_0x33a18d){var _0x4f30af='';var _0x156913=['id','name',_0x8554('0x57'),_0x8554('0x58'),'description',_0x8554('0x59'),_0x8554('0x5a'),_0x8554('0x5b'),_0x8554('0x5c'),'parent_type',_0x8554('0x5d'),_0x8554('0x5e')];return db[_0x8554('0x3f')][_0x8554('0x4b')]({'where':{'id':_0x124a24[_0x8554('0x44')]['id']},'attributes':['id',_0x8554('0x5f'),'password',_0x8554('0x60')]})[_0x8554('0x23')](handleEntityNotFound(_0x216f65,null))[_0x8554('0x23')](function(_0x39ee60){if(_0x39ee60){_0x4f30af=_0x39ee60[_0x8554('0x60')];var _0x3b2bc5=_0x4f30af['slice'](-0x1);if(_0x3b2bc5==='/'){_0x4f30af=_0x4f30af[_0x8554('0x61')](0x0,_0x4f30af['lastIndexOf'](_0x3b2bc5));}return rp({'method':_0x8554('0x62'),'uri':util[_0x8554('0x63')]('%s%s',_0x4f30af,_0x8554('0x64')),'json':!![],'form':{'method':_0x8554('0x65'),'input_type':_0x8554('0x66'),'response_type':_0x8554('0x66'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x39ee60[_0x8554('0x5f')],'password':_0x39ee60['password'],'encryption':_0x8554('0x67')},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0x1a9f1e){if(_0x1a9f1e&&_0x1a9f1e['name']!==_0x8554('0x68')&&_0x1a9f1e[_0x8554('0x27')]!==_0x8554('0x69')){return rp({'method':_0x8554('0x62'),'uri':util[_0x8554('0x63')](_0x8554('0x6a'),_0x4f30af,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x8554('0x6b'),'input_type':_0x8554('0x66'),'response_type':_0x8554('0x66'),'rest_data':JSON['stringify']({'session':_0x1a9f1e['id'],'module_name':_0x8554('0x6c')})}})[_0x8554('0x23')](function(_0x53d15d){if(_0x53d15d){var _0xf753ac=_[_0x8554('0x6d')](_0x53d15d['module_fields']);_[_0x8554('0x6e')](_0xf753ac,function(_0x215e42){return _0x156913[_0x8554('0x6f')](_0x215e42[_0x8554('0x27')]);});return{'count':_0xf753ac[_0x8554('0x35')],'rows':_['map'](_0xf753ac,function(_0x3bc79e){return{'id':_0x3bc79e[_0x8554('0x27')],'name':_0x3bc79e[_0x8554('0x70')],'custom':_[_0x8554('0x71')](_0x3bc79e['name'],'_c')?!![]:![],'options':_0x3bc79e[_0x8554('0x3e')]?_[_0x8554('0x29')](_[_0x8554('0x6d')](_0x3bc79e[_0x8554('0x3e')]),function(_0x323b0f){return{'name':_0x323b0f[_0x8554('0x72')],'value':_0x323b0f[_0x8554('0x27')]};}):[]};})};}})[_0x8554('0x23')](respondWithResult(_0x216f65,null))['catch'](function(_0x523d2d){var _0x3acb27=_0x124a24['query'][_0x8554('0x73')]?0x1f4:_0x523d2d[_0x8554('0x74')]||0x1f4;logger[_0x8554('0x25')](_0x8554('0x75'),_0x8554('0x56'),_0x3acb27,JSON['stringify'](_0x523d2d));delete _0x523d2d['name'];if(_0x3acb27===0x191){_0x3acb27=0x190;}_0x216f65['status'](_0x3acb27)['send'](_0x124a24[_0x8554('0x2f')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x523d2d[_0x8554('0x74')]}:_0x523d2d);});}else{var _0x2269c1=0x1f4;_0x216f65[_0x8554('0x19')](_0x2269c1)[_0x8554('0x28')]({'message':'Wrong\x20credentials','statusCode':0x190});}});};
\ No newline at end of file
+var _0x20d2=['hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','rawAttributes','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','nolimit','addConfiguration','AccountId','getSubjects','channel','Descriptions','SugarcrmField','getFields','name','assigned_user_id','created_by','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','POST','%s%s','/service/v4_1/rest.php','JSON','stringify','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','format','get_module_fields','Calls','endsWith','values','value','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','stack','send','map','SugarcrmAccount','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x1d5877,_0x3df243){var _0x15095=function(_0x548b05){while(--_0x548b05){_0x1d5877['push'](_0x1d5877['shift']());}};_0x15095(++_0x3df243);}(_0x20d2,0x1a8));var _0x220d=function(_0x1c4f28,_0x59beb3){_0x1c4f28=_0x1c4f28-0x0;var _0x5b30a2=_0x20d2[_0x1c4f28];return _0x5b30a2;};'use strict';var emlformat=require(_0x220d('0x0'));var rimraf=require(_0x220d('0x1'));var zipdir=require(_0x220d('0x2'));var jsonpatch=require(_0x220d('0x3'));var rp=require(_0x220d('0x4'));var moment=require(_0x220d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x220d('0x6'));var util=require(_0x220d('0x7'));var path=require(_0x220d('0x8'));var sox=require(_0x220d('0x9'));var csv=require(_0x220d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x220d('0xb'));var _=require(_0x220d('0xc'));var squel=require('squel');var crypto=require(_0x220d('0xd'));var jsforce=require(_0x220d('0xe'));var deskjs=require(_0x220d('0xf'));var toCsv=require(_0x220d('0xa'));var querystring=require(_0x220d('0x10'));var Papa=require(_0x220d('0x11'));var Redis=require(_0x220d('0x12'));var authService=require(_0x220d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x220d('0x14'));var hardwareService=require(_0x220d('0x15'));var logger=require(_0x220d('0x16'))(_0x220d('0x17'));var utils=require('../../config/utils');var config=require(_0x220d('0x18'));var licenseUtil=require(_0x220d('0x19'));var db=require(_0x220d('0x1a'))['db'];var integrations=require(_0x220d('0x1b'));function respondWithStatusCode(_0x404ee9,_0x2093b8){_0x2093b8=_0x2093b8||0xcc;return function(_0x1d8a46){if(_0x1d8a46){return _0x404ee9[_0x220d('0x1c')](_0x2093b8);}return _0x404ee9['status'](_0x2093b8)[_0x220d('0x1d')]();};}function respondWithResult(_0x1c8c03,_0xef44f4){_0xef44f4=_0xef44f4||0xc8;return function(_0x3682f5){if(_0x3682f5){return _0x1c8c03[_0x220d('0x1e')](_0xef44f4)['json'](_0x3682f5);}};}function respondWithFilteredResult(_0x1bc10b,_0x12601f){return function(_0x2afeeb){if(_0x2afeeb){var _0x2a5932=typeof _0x12601f[_0x220d('0x1f')]===_0x220d('0x20')&&typeof _0x12601f[_0x220d('0x21')]==='undefined';var _0x5db5fa=_0x2afeeb[_0x220d('0x22')];var _0x2a362d=_0x2a5932?0x0:_0x12601f['offset'];var _0x3296b0=_0x2a5932?_0x2afeeb['count']:_0x12601f['offset']+_0x12601f[_0x220d('0x21')];var _0x461fa1;if(_0x3296b0>=_0x5db5fa){_0x3296b0=_0x5db5fa;_0x461fa1=0xc8;}else{_0x461fa1=0xce;}_0x1bc10b[_0x220d('0x1e')](_0x461fa1);return _0x1bc10b[_0x220d('0x23')](_0x220d('0x24'),_0x2a362d+'-'+_0x3296b0+'/'+_0x5db5fa)[_0x220d('0x25')](_0x2afeeb);}return null;};}function patchUpdates(_0x2ad29e){return function(_0x2f11e6){try{jsonpatch['apply'](_0x2f11e6,_0x2ad29e,!![]);}catch(_0xd2344e){return BPromise[_0x220d('0x26')](_0xd2344e);}return _0x2f11e6[_0x220d('0x27')]();};}function saveUpdates(_0x375b9e,_0x3af299){return function(_0x5e65fa){if(_0x5e65fa){return _0x5e65fa[_0x220d('0x28')](_0x375b9e)['then'](function(_0x49217b){return _0x49217b;});}return null;};}function removeEntity(_0x31f63b,_0x2399ef){return function(_0x230d8d){if(_0x230d8d){return _0x230d8d['destroy']()[_0x220d('0x29')](function(){_0x31f63b[_0x220d('0x1e')](0xcc)[_0x220d('0x1d')]();});}};}function handleEntityNotFound(_0xa6484d,_0x3829c3){return function(_0x2ccd93){if(!_0x2ccd93){_0xa6484d[_0x220d('0x1c')](0x194);}return _0x2ccd93;};}function handleError(_0x16252e,_0x40937d){_0x40937d=_0x40937d||0x1f4;return function(_0x3fee47){logger['error'](_0x3fee47[_0x220d('0x2a')]);if(_0x3fee47['name']){delete _0x3fee47['name'];}_0x16252e['status'](_0x40937d)[_0x220d('0x2b')](_0x3fee47);};}exports['index']=function(_0x57fe5b,_0xeb78b7){var _0x3ff171={},_0x55128f={},_0x20c610={'count':0x0,'rows':[]};var _0x639d2=_[_0x220d('0x2c')](db[_0x220d('0x2d')]['rawAttributes'],function(_0x41c90e){return{'name':_0x41c90e[_0x220d('0x2e')],'type':_0x41c90e['type'][_0x220d('0x2f')]};});_0x55128f[_0x220d('0x30')]=_[_0x220d('0x2c')](_0x639d2,'name');_0x55128f[_0x220d('0x31')]=_[_0x220d('0x32')](_0x57fe5b[_0x220d('0x31')]);_0x55128f[_0x220d('0x33')]=_[_0x220d('0x34')](_0x55128f[_0x220d('0x30')],_0x55128f['query']);_0x3ff171[_0x220d('0x35')]=_[_0x220d('0x34')](_0x55128f['model'],qs[_0x220d('0x36')](_0x57fe5b[_0x220d('0x31')]['fields']));_0x3ff171[_0x220d('0x35')]=_0x3ff171[_0x220d('0x35')][_0x220d('0x37')]?_0x3ff171[_0x220d('0x35')]:_0x55128f['model'];if(!_0x57fe5b[_0x220d('0x31')][_0x220d('0x38')]('nolimit')){_0x3ff171['limit']=qs['limit'](_0x57fe5b[_0x220d('0x31')][_0x220d('0x21')]);_0x3ff171[_0x220d('0x1f')]=qs[_0x220d('0x1f')](_0x57fe5b[_0x220d('0x31')][_0x220d('0x1f')]);}_0x3ff171[_0x220d('0x39')]=qs['sort'](_0x57fe5b[_0x220d('0x31')][_0x220d('0x3a')]);_0x3ff171[_0x220d('0x3b')]=qs[_0x220d('0x33')](_[_0x220d('0x3c')](_0x57fe5b[_0x220d('0x31')],_0x55128f['filters']),_0x639d2);if(_0x57fe5b[_0x220d('0x31')]['filter']){_0x3ff171[_0x220d('0x3b')]=_[_0x220d('0x3d')](_0x3ff171[_0x220d('0x3b')],{'$or':_['map'](_0x639d2,function(_0x73d571){if(_0x73d571[_0x220d('0x3e')]!==_0x220d('0x3f')){var _0x5706eb={};_0x5706eb[_0x73d571['name']]={'$like':'%'+_0x57fe5b[_0x220d('0x31')][_0x220d('0x40')]+'%'};return _0x5706eb;}})});}_0x3ff171=_['merge']({},_0x3ff171,_0x57fe5b[_0x220d('0x41')]);var _0x4453ee={'where':_0x3ff171[_0x220d('0x3b')]};return db[_0x220d('0x2d')][_0x220d('0x22')](_0x4453ee)[_0x220d('0x29')](function(_0x567cca){_0x20c610[_0x220d('0x22')]=_0x567cca;if(_0x57fe5b['query'][_0x220d('0x42')]){_0x3ff171['include']=[{'all':!![]}];}return db['SugarcrmAccount'][_0x220d('0x43')](_0x3ff171);})['then'](function(_0x9a0245){_0x20c610[_0x220d('0x44')]=_0x9a0245;return _0x20c610;})[_0x220d('0x29')](respondWithFilteredResult(_0xeb78b7,_0x3ff171))[_0x220d('0x45')](handleError(_0xeb78b7,null));};exports[_0x220d('0x46')]=function(_0x22d78c,_0x31cb95){var _0x381505={'raw':![],'where':{'id':_0x22d78c[_0x220d('0x47')]['id']}},_0x4ca3fa={};_0x4ca3fa[_0x220d('0x30')]=_[_0x220d('0x32')](db[_0x220d('0x2d')][_0x220d('0x48')]);_0x4ca3fa['query']=_[_0x220d('0x32')](_0x22d78c[_0x220d('0x31')]);_0x4ca3fa[_0x220d('0x33')]=_[_0x220d('0x34')](_0x4ca3fa[_0x220d('0x30')],_0x4ca3fa[_0x220d('0x31')]);_0x381505[_0x220d('0x35')]=_[_0x220d('0x34')](_0x4ca3fa[_0x220d('0x30')],qs[_0x220d('0x36')](_0x22d78c['query'][_0x220d('0x36')]));_0x381505['attributes']=_0x381505[_0x220d('0x35')][_0x220d('0x37')]?_0x381505[_0x220d('0x35')]:_0x4ca3fa[_0x220d('0x30')];if(_0x22d78c[_0x220d('0x31')][_0x220d('0x42')]){_0x381505['include']=[{'all':!![]}];}_0x381505=_[_0x220d('0x3d')]({},_0x381505,_0x22d78c[_0x220d('0x41')]);return db[_0x220d('0x2d')][_0x220d('0x49')](_0x381505)['then'](handleEntityNotFound(_0x31cb95,null))[_0x220d('0x29')](respondWithResult(_0x31cb95,null))[_0x220d('0x45')](handleError(_0x31cb95,null));};exports[_0x220d('0x4a')]=function(_0x1a2485,_0x160ced){return db[_0x220d('0x2d')][_0x220d('0x4a')](_0x1a2485[_0x220d('0x4b')],{})[_0x220d('0x29')](respondWithResult(_0x160ced,0xc9))[_0x220d('0x45')](handleError(_0x160ced,null));};exports[_0x220d('0x28')]=function(_0x6fd392,_0x30ac1a){if(_0x6fd392['body']['id']){delete _0x6fd392[_0x220d('0x4b')]['id'];}return db[_0x220d('0x2d')][_0x220d('0x49')]({'where':{'id':_0x6fd392[_0x220d('0x47')]['id']}})[_0x220d('0x29')](handleEntityNotFound(_0x30ac1a,null))[_0x220d('0x29')](saveUpdates(_0x6fd392[_0x220d('0x4b')],null))[_0x220d('0x29')](respondWithResult(_0x30ac1a,null))[_0x220d('0x45')](handleError(_0x30ac1a,null));};exports['destroy']=function(_0x221f62,_0x35ff44){return db[_0x220d('0x2d')]['find']({'where':{'id':_0x221f62[_0x220d('0x47')]['id']}})[_0x220d('0x29')](handleEntityNotFound(_0x35ff44,null))[_0x220d('0x29')](removeEntity(_0x35ff44,null))['catch'](handleError(_0x35ff44,null));};exports[_0x220d('0x4c')]=function(_0x599d5e,_0x42ee74,_0x71b625){var _0xb00bdc={};var _0x5c49e9={};var _0x4862bc;var _0x1a3fce;return db['SugarcrmAccount'][_0x220d('0x4d')]({'where':{'id':_0x599d5e[_0x220d('0x47')]['id']}})[_0x220d('0x29')](handleEntityNotFound(_0x42ee74,null))[_0x220d('0x29')](function(_0x28ab79){if(_0x28ab79){_0x4862bc=_0x28ab79;_0x5c49e9['model']=_[_0x220d('0x32')](db[_0x220d('0x4e')][_0x220d('0x48')]);_0x5c49e9['query']=_[_0x220d('0x32')](_0x599d5e[_0x220d('0x31')]);_0x5c49e9['filters']=_[_0x220d('0x34')](_0x5c49e9[_0x220d('0x30')],_0x5c49e9['query']);_0xb00bdc[_0x220d('0x35')]=_[_0x220d('0x34')](_0x5c49e9[_0x220d('0x30')],qs[_0x220d('0x36')](_0x599d5e[_0x220d('0x31')][_0x220d('0x36')]));_0xb00bdc[_0x220d('0x35')]=_0xb00bdc[_0x220d('0x35')][_0x220d('0x37')]?_0xb00bdc[_0x220d('0x35')]:_0x5c49e9[_0x220d('0x30')];_0xb00bdc[_0x220d('0x39')]=qs[_0x220d('0x3a')](_0x599d5e['query']['sort']);_0xb00bdc['where']=qs[_0x220d('0x33')](_[_0x220d('0x3c')](_0x599d5e[_0x220d('0x31')],_0x5c49e9['filters']));if(_0x599d5e[_0x220d('0x31')]['filter']){_0xb00bdc[_0x220d('0x3b')]=_[_0x220d('0x3d')](_0xb00bdc[_0x220d('0x3b')],{'$or':_[_0x220d('0x2c')](_0xb00bdc['attributes'],function(_0x24c3aa){var _0x589ffa={};_0x589ffa[_0x24c3aa]={'$like':'%'+_0x599d5e['query']['filter']+'%'};return _0x589ffa;})});}_0xb00bdc=_[_0x220d('0x3d')]({},_0xb00bdc,_0x599d5e['options']);return _0x4862bc[_0x220d('0x4c')](_0xb00bdc);}})[_0x220d('0x29')](function(_0x426167){if(_0x426167){_0x1a3fce=_0x426167[_0x220d('0x37')];if(!_0x599d5e[_0x220d('0x31')][_0x220d('0x38')](_0x220d('0x4f'))){_0xb00bdc[_0x220d('0x21')]=qs['limit'](_0x599d5e['query'][_0x220d('0x21')]);_0xb00bdc[_0x220d('0x1f')]=qs[_0x220d('0x1f')](_0x599d5e[_0x220d('0x31')][_0x220d('0x1f')]);}return _0x4862bc[_0x220d('0x4c')](_0xb00bdc);}})[_0x220d('0x29')](function(_0x21a711){if(_0x21a711){return _0x21a711?{'count':_0x1a3fce,'rows':_0x21a711}:null;}})[_0x220d('0x29')](respondWithResult(_0x42ee74,null))[_0x220d('0x45')](handleError(_0x42ee74,null));};exports[_0x220d('0x50')]=function(_0x1c94a7,_0x41b97c,_0x2f8357){if(_0x1c94a7[_0x220d('0x4b')]['id']){delete _0x1c94a7[_0x220d('0x4b')]['id'];}return db['SugarcrmAccount'][_0x220d('0x4d')]({'where':{'id':_0x1c94a7[_0x220d('0x47')]['id']}})[_0x220d('0x29')](handleEntityNotFound(_0x41b97c,null))[_0x220d('0x29')](function(_0x4efbc3){if(_0x4efbc3){_0x1c94a7[_0x220d('0x4b')][_0x220d('0x51')]=_0x4efbc3['id'];_0x1c94a7[_0x220d('0x4b')]['Subjects']=integrations[_0x220d('0x52')](_0x1c94a7[_0x220d('0x4b')][_0x220d('0x53')],_0x1c94a7[_0x220d('0x4b')]['type']);_0x1c94a7[_0x220d('0x4b')][_0x220d('0x54')]=integrations['getDescriptions'](_0x1c94a7['body'][_0x220d('0x53')],_0x1c94a7[_0x220d('0x4b')]['type']);return db['SugarcrmConfiguration'][_0x220d('0x4a')](_0x1c94a7[_0x220d('0x4b')],{'include':[{'model':db['SugarcrmField'],'as':'Subjects'},{'model':db[_0x220d('0x55')],'as':_0x220d('0x54')}]});}return null;})[_0x220d('0x29')](respondWithResult(_0x41b97c,null))[_0x220d('0x45')](handleError(_0x41b97c,null));};exports[_0x220d('0x56')]=function(_0x282f90,_0x3d1d03,_0x51b961){var _0x3c3cfb='';var _0x2c6df9=['id',_0x220d('0x57'),_0x220d('0x58'),_0x220d('0x59'),'description','date_start',_0x220d('0x5a'),_0x220d('0x5b'),_0x220d('0x5c'),_0x220d('0x5d'),_0x220d('0x5e'),_0x220d('0x5f')];return db[_0x220d('0x2d')][_0x220d('0x4d')]({'where':{'id':_0x282f90['params']['id']},'attributes':['id',_0x220d('0x60'),_0x220d('0x61'),_0x220d('0x62')]})[_0x220d('0x29')](handleEntityNotFound(_0x3d1d03,null))['then'](function(_0x52d286){if(_0x52d286){_0x3c3cfb=_0x52d286[_0x220d('0x62')];var _0x259aab=_0x3c3cfb[_0x220d('0x63')](-0x1);if(_0x259aab==='/'){_0x3c3cfb=_0x3c3cfb[_0x220d('0x64')](0x0,_0x3c3cfb['lastIndexOf'](_0x259aab));}return rp({'method':_0x220d('0x65'),'uri':util['format'](_0x220d('0x66'),_0x3c3cfb,_0x220d('0x67')),'json':!![],'form':{'method':'login','input_type':_0x220d('0x68'),'response_type':_0x220d('0x68'),'rest_data':JSON[_0x220d('0x69')]({'user_auth':{'user_name':_0x52d286[_0x220d('0x60')],'password':_0x52d286['password'],'encryption':'PLAIN'},'application':_0x220d('0x6a')})}});}})['then'](function(_0x1e22f5){if(_0x1e22f5&&_0x1e22f5[_0x220d('0x57')]!==_0x220d('0x6b')&&_0x1e22f5[_0x220d('0x57')]!==_0x220d('0x6c')){return rp({'method':_0x220d('0x65'),'uri':util[_0x220d('0x6d')](_0x220d('0x66'),_0x3c3cfb,_0x220d('0x67')),'json':!![],'form':{'method':_0x220d('0x6e'),'input_type':'JSON','response_type':_0x220d('0x68'),'rest_data':JSON['stringify']({'session':_0x1e22f5['id'],'module_name':_0x220d('0x6f')})}})[_0x220d('0x29')](function(_0x112f0b){if(_0x112f0b){var _0x597e19=_['values'](_0x112f0b['module_fields']);_['remove'](_0x597e19,function(_0x5b3db9){return _0x2c6df9['includes'](_0x5b3db9[_0x220d('0x57')]);});return{'count':_0x597e19[_0x220d('0x37')],'rows':_[_0x220d('0x2c')](_0x597e19,function(_0x562512){return{'id':_0x562512[_0x220d('0x57')],'name':_0x562512['label'],'custom':_[_0x220d('0x70')](_0x562512[_0x220d('0x57')],'_c')?!![]:![],'options':_0x562512[_0x220d('0x41')]?_[_0x220d('0x2c')](_[_0x220d('0x71')](_0x562512[_0x220d('0x41')]),function(_0x29e898){return{'name':_0x29e898[_0x220d('0x72')],'value':_0x29e898[_0x220d('0x57')]};}):[]};})};}})['then'](respondWithResult(_0x3d1d03,null))[_0x220d('0x45')](function(_0x2c6156){var _0x2d6c75=_0x282f90[_0x220d('0x31')][_0x220d('0x73')]?0x1f4:_0x2c6156[_0x220d('0x74')]||0x1f4;logger[_0x220d('0x75')](_0x220d('0x76'),_0x220d('0x56'),_0x2d6c75,JSON[_0x220d('0x69')](_0x2c6156));delete _0x2c6156[_0x220d('0x57')];if(_0x2d6c75===0x191){_0x2d6c75=0x190;}_0x3d1d03[_0x220d('0x1e')](_0x2d6c75)[_0x220d('0x2b')](_0x282f90[_0x220d('0x31')][_0x220d('0x73')]?{'message':_0x220d('0x77'),'statusCode':_0x2c6156[_0x220d('0x74')]}:_0x2c6156);});}else{var _0x37aa23=0x1f4;_0x3d1d03[_0x220d('0x1e')](_0x37aa23)[_0x220d('0x2b')]({'message':'Wrong\x20credentials','statusCode':0x190});}});};
\ No newline at end of file
index b296539..03d2322 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf1d4=['define','SugarcrmAccount','int_sugarcrm_accounts','lodash','../../config/logger','moment','bluebird','path','rimraf','../../components/integrations/configuration','exports'];(function(_0x5254e8,_0x4abf77){var _0x54731c=function(_0x336f89){while(--_0x336f89){_0x5254e8['push'](_0x5254e8['shift']());}};_0x54731c(++_0x4abf77);}(_0xf1d4,0x158));var _0x4f1d=function(_0x367f94,_0x557c2e){_0x367f94=_0x367f94-0x0;var _0x642387=_0xf1d4[_0x367f94];return _0x642387;};'use strict';var _=require(_0x4f1d('0x0'));var util=require('util');var logger=require(_0x4f1d('0x1'))('api');var moment=require(_0x4f1d('0x2'));var BPromise=require(_0x4f1d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f1d('0x4'));var rimraf=require(_0x4f1d('0x5'));var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x4f1d('0x6'));module[_0x4f1d('0x7')]=function(_0x49948e,_0x17b170){return _0x49948e[_0x4f1d('0x8')](_0x4f1d('0x9'),attributes,{'tableName':_0x4f1d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfff0=['./intSugarcrmAccount.attributes','exports','SugarcrmAccount','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x31ed23,_0xb706bf){var _0x1d4ce8=function(_0x44ce0b){while(--_0x44ce0b){_0x31ed23['push'](_0x31ed23['shift']());}};_0x1d4ce8(++_0xb706bf);}(_0xfff0,0x139));var _0x0fff=function(_0x47e5aa,_0x282fc3){_0x47e5aa=_0x47e5aa-0x0;var _0x14393a=_0xfff0[_0x47e5aa];return _0x14393a;};'use strict';var _=require('lodash');var util=require(_0x0fff('0x0'));var logger=require(_0x0fff('0x1'))(_0x0fff('0x2'));var moment=require('moment');var BPromise=require(_0x0fff('0x3'));var rp=require(_0x0fff('0x4'));var fs=require('fs');var path=require(_0x0fff('0x5'));var rimraf=require('rimraf');var config=require(_0x0fff('0x6'));var attributes=require(_0x0fff('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x0fff('0x8')]=function(_0x4c2221,_0x2f1d2b){return _0x4c2221['define'](_0x0fff('0x9'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f39f41d..9b4fcc2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd99=['include','map','model','ShowSugarcrmAccount','raw','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SugarcrmAccount,\x20%s,\x20%s','message','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','where','attributes','limit'];(function(_0x2f6541,_0x363cba){var _0x4d76d8=function(_0x86404){while(--_0x86404){_0x2f6541['push'](_0x2f6541['shift']());}};_0x4d76d8(++_0x363cba);}(_0xcd99,0x145));var _0x9cd9=function(_0x34c60e,_0x56bb45){_0x34c60e=_0x34c60e-0x0;var _0x40ae0b=_0xcd99[_0x34c60e];return _0x40ae0b;};'use strict';var _=require(_0x9cd9('0x0'));var util=require(_0x9cd9('0x1'));var moment=require(_0x9cd9('0x2'));var BPromise=require(_0x9cd9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9cd9('0x4'));var logger=require(_0x9cd9('0x5'))(_0x9cd9('0x6'));var config=require(_0x9cd9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9cd9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x538579,_0x1d2833,_0xaeebf3){return new BPromise(function(_0x548852,_0x2e0af2){return client[_0x9cd9('0x9')](_0x538579,_0xaeebf3)[_0x9cd9('0xa')](function(_0x22e66c){logger[_0x9cd9('0xb')]('SugarcrmAccount,\x20%s,\x20%s',_0x1d2833,_0x9cd9('0xc'));logger['debug'](_0x9cd9('0xd'),_0x1d2833,_0x9cd9('0xc'),JSON[_0x9cd9('0xe')](_0x22e66c));if(_0x22e66c['error']){if(_0x22e66c[_0x9cd9('0xf')][_0x9cd9('0x10')]===0x1f4){logger['error'](_0x9cd9('0x11'),_0x1d2833,_0x22e66c[_0x9cd9('0xf')]['message']);return _0x2e0af2(_0x22e66c[_0x9cd9('0xf')][_0x9cd9('0x12')]);}logger[_0x9cd9('0xf')](_0x9cd9('0x11'),_0x1d2833,_0x22e66c[_0x9cd9('0xf')][_0x9cd9('0x12')]);return _0x548852(_0x22e66c[_0x9cd9('0xf')]['message']);}else{logger[_0x9cd9('0xb')](_0x9cd9('0x11'),_0x1d2833,_0x9cd9('0xc'));_0x548852(_0x22e66c['result']['message']);}})[_0x9cd9('0x13')](function(_0x15180c){logger['error'](_0x9cd9('0x11'),_0x1d2833,_0x15180c);_0x2e0af2(_0x15180c);});});}exports[_0x9cd9('0x14')]=function(_0xf13b5b){var _0x556858=this;return new Promise(function(_0x5cb935,_0x4df7af){return db[_0x9cd9('0x15')][_0x9cd9('0x16')]({'raw':_0xf13b5b[_0x9cd9('0x17')]?_0xf13b5b['options']['raw']===undefined?!![]:![]:!![],'where':_0xf13b5b[_0x9cd9('0x17')]?_0xf13b5b[_0x9cd9('0x17')][_0x9cd9('0x18')]||null:null,'attributes':_0xf13b5b[_0x9cd9('0x17')]?_0xf13b5b[_0x9cd9('0x17')][_0x9cd9('0x19')]||null:null,'limit':_0xf13b5b[_0x9cd9('0x17')]?_0xf13b5b[_0x9cd9('0x17')][_0x9cd9('0x1a')]||null:null,'include':_0xf13b5b[_0x9cd9('0x17')]?_0xf13b5b[_0x9cd9('0x17')][_0x9cd9('0x1b')]?_[_0x9cd9('0x1c')](_0xf13b5b[_0x9cd9('0x17')][_0x9cd9('0x1b')],function(_0x19f7b6){return{'model':db[_0x19f7b6[_0x9cd9('0x1d')]],'as':_0x19f7b6['as'],'attributes':_0x19f7b6[_0x9cd9('0x19')],'include':_0x19f7b6[_0x9cd9('0x1b')]?_[_0x9cd9('0x1c')](_0x19f7b6[_0x9cd9('0x1b')],function(_0x35eef2){return{'model':db[_0x35eef2['model']],'as':_0x35eef2['as'],'attributes':_0x35eef2[_0x9cd9('0x19')],'include':_0x35eef2['include']?_[_0x9cd9('0x1c')](_0x35eef2[_0x9cd9('0x1b')],function(_0x4158eb){return{'model':db[_0x4158eb['model']],'as':_0x4158eb['as'],'attributes':_0x4158eb[_0x9cd9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9cd9('0xa')](function(_0x56838c){logger[_0x9cd9('0xb')](_0x9cd9('0x14'),_0xf13b5b);logger['debug']('GetSugarcrmAccount',_0xf13b5b,JSON[_0x9cd9('0xe')](_0x56838c));_0x5cb935(_0x56838c);})[_0x9cd9('0x13')](function(_0x3be6ec){logger[_0x9cd9('0xf')](_0x9cd9('0x14'),_0x3be6ec['message'],_0xf13b5b);_0x4df7af(_0x556858[_0x9cd9('0xf')](0x1f4,_0x3be6ec[_0x9cd9('0x12')]));});});};exports[_0x9cd9('0x1e')]=function(_0x31f212){var _0x1587f2=this;return new Promise(function(_0x36ff5b,_0x431134){return db[_0x9cd9('0x15')]['find']({'raw':_0x31f212[_0x9cd9('0x17')]?_0x31f212[_0x9cd9('0x17')][_0x9cd9('0x1f')]===undefined?!![]:![]:!![],'where':_0x31f212[_0x9cd9('0x17')]?_0x31f212['options'][_0x9cd9('0x18')]||null:null,'attributes':_0x31f212[_0x9cd9('0x17')]?_0x31f212['options'][_0x9cd9('0x19')]||null:null,'include':_0x31f212[_0x9cd9('0x17')]?_0x31f212[_0x9cd9('0x17')][_0x9cd9('0x1b')]?_['map'](_0x31f212['options'][_0x9cd9('0x1b')],function(_0x854ac){return{'model':db[_0x854ac[_0x9cd9('0x1d')]],'as':_0x854ac['as'],'attributes':_0x854ac['attributes'],'include':_0x854ac[_0x9cd9('0x1b')]?_[_0x9cd9('0x1c')](_0x854ac[_0x9cd9('0x1b')],function(_0x58a0ed){return{'model':db[_0x58a0ed[_0x9cd9('0x1d')]],'as':_0x58a0ed['as'],'attributes':_0x58a0ed[_0x9cd9('0x19')],'include':_0x58a0ed[_0x9cd9('0x1b')]?_[_0x9cd9('0x1c')](_0x58a0ed['include'],function(_0x2f5717){return{'model':db[_0x2f5717[_0x9cd9('0x1d')]],'as':_0x2f5717['as'],'attributes':_0x2f5717[_0x9cd9('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9cd9('0xa')](function(_0x5a6a59){logger[_0x9cd9('0xb')]('ShowSugarcrmAccount',_0x31f212);logger['debug'](_0x9cd9('0x1e'),_0x31f212,JSON['stringify'](_0x5a6a59));_0x36ff5b(_0x5a6a59);})['catch'](function(_0x5696d9){logger[_0x9cd9('0xf')](_0x9cd9('0x1e'),_0x5696d9[_0x9cd9('0x12')],_0x31f212);_0x431134(_0x1587f2[_0x9cd9('0xf')](0x1f4,_0x5696d9[_0x9cd9('0x12')]));});});};
\ No newline at end of file
+var _0xe6fa=['limit','include','model','attributes','map','ShowSugarcrmAccount','find','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','options','raw','where'];(function(_0xa46b86,_0x5c1465){var _0x417360=function(_0x4800d1){while(--_0x4800d1){_0xa46b86['push'](_0xa46b86['shift']());}};_0x417360(++_0x5c1465);}(_0xe6fa,0x13d));var _0xae6f=function(_0xe441a6,_0x3459f6){_0xe441a6=_0xe441a6-0x0;var _0x5faec8=_0xe6fa[_0xe441a6];return _0x5faec8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xae6f('0x0'));var BPromise=require('bluebird');var rs=require(_0xae6f('0x1'));var fs=require('fs');var Redis=require(_0xae6f('0x2'));var db=require(_0xae6f('0x3'))['db'];var utils=require(_0xae6f('0x4'));var logger=require(_0xae6f('0x5'))('rpc');var config=require(_0xae6f('0x6'));var jayson=require(_0xae6f('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x10da6e,_0x503465,_0x249b39){return new BPromise(function(_0x1f329c,_0xa4c4e7){return client[_0xae6f('0x8')](_0x10da6e,_0x249b39)[_0xae6f('0x9')](function(_0x111588){logger[_0xae6f('0xa')](_0xae6f('0xb'),_0x503465,_0xae6f('0xc'));logger[_0xae6f('0xd')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x503465,'request\x20sent',JSON[_0xae6f('0xe')](_0x111588));if(_0x111588[_0xae6f('0xf')]){if(_0x111588[_0xae6f('0xf')]['code']===0x1f4){logger[_0xae6f('0xf')](_0xae6f('0xb'),_0x503465,_0x111588[_0xae6f('0xf')][_0xae6f('0x10')]);return _0xa4c4e7(_0x111588['error'][_0xae6f('0x10')]);}logger[_0xae6f('0xf')](_0xae6f('0xb'),_0x503465,_0x111588[_0xae6f('0xf')][_0xae6f('0x10')]);return _0x1f329c(_0x111588['error'][_0xae6f('0x10')]);}else{logger[_0xae6f('0xa')](_0xae6f('0xb'),_0x503465,_0xae6f('0xc'));_0x1f329c(_0x111588[_0xae6f('0x11')]['message']);}})[_0xae6f('0x12')](function(_0x3649d4){logger['error'](_0xae6f('0xb'),_0x503465,_0x3649d4);_0xa4c4e7(_0x3649d4);});});}exports[_0xae6f('0x13')]=function(_0x8462ab){var _0x107c8a=this;return new Promise(function(_0x2dc403,_0x1a26ea){return db[_0xae6f('0x14')]['findAll']({'raw':_0x8462ab[_0xae6f('0x15')]?_0x8462ab[_0xae6f('0x15')][_0xae6f('0x16')]===undefined?!![]:![]:!![],'where':_0x8462ab[_0xae6f('0x15')]?_0x8462ab[_0xae6f('0x15')][_0xae6f('0x17')]||null:null,'attributes':_0x8462ab[_0xae6f('0x15')]?_0x8462ab[_0xae6f('0x15')]['attributes']||null:null,'limit':_0x8462ab[_0xae6f('0x15')]?_0x8462ab[_0xae6f('0x15')][_0xae6f('0x18')]||null:null,'include':_0x8462ab['options']?_0x8462ab[_0xae6f('0x15')][_0xae6f('0x19')]?_['map'](_0x8462ab['options'][_0xae6f('0x19')],function(_0x56c59c){return{'model':db[_0x56c59c[_0xae6f('0x1a')]],'as':_0x56c59c['as'],'attributes':_0x56c59c[_0xae6f('0x1b')],'include':_0x56c59c[_0xae6f('0x19')]?_[_0xae6f('0x1c')](_0x56c59c[_0xae6f('0x19')],function(_0x2b7bad){return{'model':db[_0x2b7bad['model']],'as':_0x2b7bad['as'],'attributes':_0x2b7bad[_0xae6f('0x1b')],'include':_0x2b7bad['include']?_['map'](_0x2b7bad[_0xae6f('0x19')],function(_0x3c41c4){return{'model':db[_0x3c41c4[_0xae6f('0x1a')]],'as':_0x3c41c4['as'],'attributes':_0x3c41c4['attributes']};}):[]};}):[]};}):[]:[]})[_0xae6f('0x9')](function(_0x417f10){logger[_0xae6f('0xa')]('GetSugarcrmAccount',_0x8462ab);logger[_0xae6f('0xd')]('GetSugarcrmAccount',_0x8462ab,JSON[_0xae6f('0xe')](_0x417f10));_0x2dc403(_0x417f10);})[_0xae6f('0x12')](function(_0x27a2c4){logger[_0xae6f('0xf')](_0xae6f('0x13'),_0x27a2c4['message'],_0x8462ab);_0x1a26ea(_0x107c8a['error'](0x1f4,_0x27a2c4[_0xae6f('0x10')]));});});};exports[_0xae6f('0x1d')]=function(_0x59e8f2){var _0x31df28=this;return new Promise(function(_0x1ff08c,_0x4765e1){return db[_0xae6f('0x14')][_0xae6f('0x1e')]({'raw':_0x59e8f2[_0xae6f('0x15')]?_0x59e8f2['options'][_0xae6f('0x16')]===undefined?!![]:![]:!![],'where':_0x59e8f2[_0xae6f('0x15')]?_0x59e8f2[_0xae6f('0x15')][_0xae6f('0x17')]||null:null,'attributes':_0x59e8f2['options']?_0x59e8f2[_0xae6f('0x15')][_0xae6f('0x1b')]||null:null,'include':_0x59e8f2[_0xae6f('0x15')]?_0x59e8f2[_0xae6f('0x15')][_0xae6f('0x19')]?_[_0xae6f('0x1c')](_0x59e8f2[_0xae6f('0x15')][_0xae6f('0x19')],function(_0x4f4a86){return{'model':db[_0x4f4a86[_0xae6f('0x1a')]],'as':_0x4f4a86['as'],'attributes':_0x4f4a86[_0xae6f('0x1b')],'include':_0x4f4a86[_0xae6f('0x19')]?_['map'](_0x4f4a86[_0xae6f('0x19')],function(_0x338f93){return{'model':db[_0x338f93[_0xae6f('0x1a')]],'as':_0x338f93['as'],'attributes':_0x338f93[_0xae6f('0x1b')],'include':_0x338f93['include']?_[_0xae6f('0x1c')](_0x338f93[_0xae6f('0x19')],function(_0x4615ae){return{'model':db[_0x4615ae[_0xae6f('0x1a')]],'as':_0x4615ae['as'],'attributes':_0x4615ae[_0xae6f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xae6f('0x9')](function(_0x3c2dc2){logger[_0xae6f('0xa')](_0xae6f('0x1d'),_0x59e8f2);logger[_0xae6f('0xd')](_0xae6f('0x1d'),_0x59e8f2,JSON[_0xae6f('0xe')](_0x3c2dc2));_0x1ff08c(_0x3c2dc2);})[_0xae6f('0x12')](function(_0x49b9e9){logger['error'](_0xae6f('0x1d'),_0x49b9e9[_0xae6f('0x10')],_0x59e8f2);_0x4765e1(_0x31df28[_0xae6f('0xf')](0x1f4,_0x49b9e9[_0xae6f('0x10')]));});});};
\ No newline at end of file
index 5edcf4e..29c99b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa611=['getSubjects','/:id/descriptions','post','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./intSugarcrmConfiguration.controller','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects'];(function(_0x57edc8,_0x1174bf){var _0x2734c2=function(_0x3170e1){while(--_0x3170e1){_0x57edc8['push'](_0x57edc8['shift']());}};_0x2734c2(++_0x1174bf);}(_0xa611,0x1ab));var _0x1a61=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa611[_0x173d7e];return _0x2220d6;};'use strict';var multer=require('multer');var util=require(_0x1a61('0x0'));var path=require(_0x1a61('0x1'));var timeout=require(_0x1a61('0x2'));var express=require(_0x1a61('0x3'));var router=express['Router']();var fs_extra=require(_0x1a61('0x4'));var auth=require(_0x1a61('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1a61('0x6'));router[_0x1a61('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1a61('0x7')]('/:id',auth[_0x1a61('0x8')](),controller[_0x1a61('0x9')]);router['get'](_0x1a61('0xa'),auth[_0x1a61('0x8')](),controller[_0x1a61('0xb')]);router[_0x1a61('0x7')](_0x1a61('0xc'),auth[_0x1a61('0x8')](),controller[_0x1a61('0xd')]);router[_0x1a61('0x7')](_0x1a61('0xe'),auth[_0x1a61('0x8')](),controller['getDescriptions']);router[_0x1a61('0xf')]('/',auth[_0x1a61('0x8')](),controller['create']);router[_0x1a61('0x10')](_0x1a61('0x11'),auth[_0x1a61('0x8')](),controller[_0x1a61('0x12')]);router[_0x1a61('0x13')]('/:id',auth[_0x1a61('0x8')](),controller[_0x1a61('0x14')]);module[_0x1a61('0x15')]=router;
\ No newline at end of file
+var _0x9657=['show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x53a7a8,_0xed2bff){var _0x555f71=function(_0x48e696){while(--_0x48e696){_0x53a7a8['push'](_0x53a7a8['shift']());}};_0x555f71(++_0xed2bff);}(_0x9657,0x137));var _0x7965=function(_0x5b22c3,_0x2b405c){_0x5b22c3=_0x5b22c3-0x0;var _0x5819d2=_0x9657[_0x5b22c3];return _0x5819d2;};'use strict';var multer=require(_0x7965('0x0'));var util=require(_0x7965('0x1'));var path=require(_0x7965('0x2'));var timeout=require(_0x7965('0x3'));var express=require(_0x7965('0x4'));var router=express[_0x7965('0x5')]();var fs_extra=require(_0x7965('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7965('0x7'));var config=require(_0x7965('0x8'));var controller=require(_0x7965('0x9'));router[_0x7965('0xa')]('/',auth[_0x7965('0xb')](),controller[_0x7965('0xc')]);router[_0x7965('0xa')](_0x7965('0xd'),auth[_0x7965('0xb')](),controller[_0x7965('0xe')]);router['get'](_0x7965('0xf'),auth[_0x7965('0xb')](),controller[_0x7965('0x10')]);router[_0x7965('0xa')](_0x7965('0x11'),auth[_0x7965('0xb')](),controller[_0x7965('0x12')]);router[_0x7965('0xa')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x7965('0x13')]);router[_0x7965('0x14')]('/',auth[_0x7965('0xb')](),controller[_0x7965('0x15')]);router['put'](_0x7965('0xd'),auth['isAuthenticated'](),controller[_0x7965('0x16')]);router['delete'](_0x7965('0xd'),auth[_0x7965('0xb')](),controller[_0x7965('0x17')]);module[_0x7965('0x18')]=router;
\ No newline at end of file
index cb41cc5..0411d6b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x61ea=['STRING','exports'];(function(_0xaa5cb8,_0x3b78cb){var _0x518b8c=function(_0x157b70){while(--_0x157b70){_0xaa5cb8['push'](_0xaa5cb8['shift']());}};_0x518b8c(++_0x3b78cb);}(_0x61ea,0x1df));var _0xa61e=function(_0x2b623c,_0x1eca8f){_0x2b623c=_0x2b623c-0x0;var _0x1e8df7=_0x61ea[_0x2b623c];return _0x1e8df7;};'use strict';var Sequelize=require('sequelize');module[_0xa61e('0x0')]={'name':{'type':Sequelize[_0xa61e('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x283f=['exports','STRING','sequelize'];(function(_0x2993ec,_0x55b034){var _0x35411f=function(_0x5986f6){while(--_0x5986f6){_0x2993ec['push'](_0x2993ec['shift']());}};_0x35411f(++_0x55b034);}(_0x283f,0x179));var _0xf283=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x283f[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xf283('0x0'));module[_0xf283('0x1')]={'name':{'type':Sequelize[_0xf283('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index d2991ec..82f6b60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21b3=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','map','VIRTUAL','options','includeAll','findAll','rows','catch','find','create','body','update','params','getFields','findOne','getSubjects','SugarcrmField','getDescriptions','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','limit','offset','count','Content-Range','apply','reject','save','destroy','then','end','error','stack','name','send','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x305677,_0xd67d7d){var _0x1b07a8=function(_0x2f8162){while(--_0x2f8162){_0x305677['push'](_0x305677['shift']());}};_0x1b07a8(++_0xd67d7d);}(_0x21b3,0x16e));var _0x321b=function(_0x2edcfc,_0x5f465a){_0x2edcfc=_0x2edcfc-0x0;var _0xfd5dc3=_0x21b3[_0x2edcfc];return _0xfd5dc3;};'use strict';var emlformat=require(_0x321b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x321b('0x1'));var jsonpatch=require(_0x321b('0x2'));var rp=require(_0x321b('0x3'));var moment=require(_0x321b('0x4'));var BPromise=require(_0x321b('0x5'));var Mustache=require(_0x321b('0x6'));var util=require(_0x321b('0x7'));var path=require(_0x321b('0x8'));var sox=require(_0x321b('0x9'));var csv=require(_0x321b('0xa'));var ejs=require(_0x321b('0xb'));var fs=require('fs');var fs_extra=require(_0x321b('0xc'));var _=require(_0x321b('0xd'));var squel=require(_0x321b('0xe'));var crypto=require(_0x321b('0xf'));var jsforce=require(_0x321b('0x10'));var deskjs=require(_0x321b('0x11'));var toCsv=require(_0x321b('0xa'));var querystring=require(_0x321b('0x12'));var Papa=require('papaparse');var Redis=require(_0x321b('0x13'));var authService=require(_0x321b('0x14'));var qs=require(_0x321b('0x15'));var as=require(_0x321b('0x16'));var hardwareService=require(_0x321b('0x17'));var logger=require(_0x321b('0x18'))(_0x321b('0x19'));var utils=require(_0x321b('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x321b('0x1b'))['db'];function respondWithStatusCode(_0x5c3ae4,_0x40c238){_0x40c238=_0x40c238||0xcc;return function(_0x27c602){if(_0x27c602){return _0x5c3ae4[_0x321b('0x1c')](_0x40c238);}return _0x5c3ae4[_0x321b('0x1d')](_0x40c238)['end']();};}function respondWithResult(_0x4f1bae,_0x43cd25){_0x43cd25=_0x43cd25||0xc8;return function(_0x46b910){if(_0x46b910){return _0x4f1bae['status'](_0x43cd25)[_0x321b('0x1e')](_0x46b910);}};}function respondWithFilteredResult(_0x4fb78b,_0x10a63f){return function(_0x24cfba){if(_0x24cfba){var _0x36988b=typeof _0x10a63f['offset']===_0x321b('0x1f')&&typeof _0x10a63f[_0x321b('0x20')]===_0x321b('0x1f');var _0x55efff=_0x24cfba['count'];var _0x43746e=_0x36988b?0x0:_0x10a63f[_0x321b('0x21')];var _0x1beb30=_0x36988b?_0x24cfba[_0x321b('0x22')]:_0x10a63f[_0x321b('0x21')]+_0x10a63f[_0x321b('0x20')];var _0x7cfb98;if(_0x1beb30>=_0x55efff){_0x1beb30=_0x55efff;_0x7cfb98=0xc8;}else{_0x7cfb98=0xce;}_0x4fb78b[_0x321b('0x1d')](_0x7cfb98);return _0x4fb78b['set'](_0x321b('0x23'),_0x43746e+'-'+_0x1beb30+'/'+_0x55efff)[_0x321b('0x1e')](_0x24cfba);}return null;};}function patchUpdates(_0x5e1f23){return function(_0x4ffdc3){try{jsonpatch[_0x321b('0x24')](_0x4ffdc3,_0x5e1f23,!![]);}catch(_0x45ace0){return BPromise[_0x321b('0x25')](_0x45ace0);}return _0x4ffdc3[_0x321b('0x26')]();};}function saveUpdates(_0x936eb0,_0x1bfa55){return function(_0x1549cd){if(_0x1549cd){return _0x1549cd['update'](_0x936eb0)['then'](function(_0x2fb307){return _0x2fb307;});}return null;};}function removeEntity(_0x411e0c,_0x34d3b6){return function(_0x58b435){if(_0x58b435){return _0x58b435[_0x321b('0x27')]()[_0x321b('0x28')](function(){_0x411e0c[_0x321b('0x1d')](0xcc)[_0x321b('0x29')]();});}};}function handleEntityNotFound(_0x96c326,_0x56027f){return function(_0x143f84){if(!_0x143f84){_0x96c326[_0x321b('0x1c')](0x194);}return _0x143f84;};}function handleError(_0x4dceaf,_0x2f31ca){_0x2f31ca=_0x2f31ca||0x1f4;return function(_0x51732b){logger[_0x321b('0x2a')](_0x51732b[_0x321b('0x2b')]);if(_0x51732b[_0x321b('0x2c')]){delete _0x51732b[_0x321b('0x2c')];}_0x4dceaf['status'](_0x2f31ca)[_0x321b('0x2d')](_0x51732b);};}exports['index']=function(_0x389c13,_0x34e0de){var _0x5d5b1f={},_0xdbcbb8={},_0xc10607={'count':0x0,'rows':[]};var _0x25e9e8=_['map'](db[_0x321b('0x2e')][_0x321b('0x2f')],function(_0x6dbc99){return{'name':_0x6dbc99[_0x321b('0x30')],'type':_0x6dbc99[_0x321b('0x31')][_0x321b('0x32')]};});_0xdbcbb8[_0x321b('0x33')]=_['map'](_0x25e9e8,_0x321b('0x2c'));_0xdbcbb8[_0x321b('0x34')]=_[_0x321b('0x35')](_0x389c13[_0x321b('0x34')]);_0xdbcbb8['filters']=_[_0x321b('0x36')](_0xdbcbb8[_0x321b('0x33')],_0xdbcbb8[_0x321b('0x34')]);_0x5d5b1f[_0x321b('0x37')]=_[_0x321b('0x36')](_0xdbcbb8[_0x321b('0x33')],qs[_0x321b('0x38')](_0x389c13['query'][_0x321b('0x38')]));_0x5d5b1f[_0x321b('0x37')]=_0x5d5b1f[_0x321b('0x37')][_0x321b('0x39')]?_0x5d5b1f[_0x321b('0x37')]:_0xdbcbb8[_0x321b('0x33')];if(!_0x389c13['query'][_0x321b('0x3a')](_0x321b('0x3b'))){_0x5d5b1f[_0x321b('0x20')]=qs[_0x321b('0x20')](_0x389c13[_0x321b('0x34')][_0x321b('0x20')]);_0x5d5b1f[_0x321b('0x21')]=qs['offset'](_0x389c13[_0x321b('0x34')][_0x321b('0x21')]);}_0x5d5b1f[_0x321b('0x3c')]=qs[_0x321b('0x3d')](_0x389c13[_0x321b('0x34')][_0x321b('0x3d')]);_0x5d5b1f['where']=qs[_0x321b('0x3e')](_[_0x321b('0x3f')](_0x389c13[_0x321b('0x34')],_0xdbcbb8[_0x321b('0x3e')]),_0x25e9e8);if(_0x389c13[_0x321b('0x34')][_0x321b('0x40')]){_0x5d5b1f['where']=_[_0x321b('0x41')](_0x5d5b1f[_0x321b('0x42')],{'$or':_[_0x321b('0x43')](_0x25e9e8,function(_0x3ca7eb){if(_0x3ca7eb[_0x321b('0x31')]!==_0x321b('0x44')){var _0xef9f7d={};_0xef9f7d[_0x3ca7eb['name']]={'$like':'%'+_0x389c13[_0x321b('0x34')]['filter']+'%'};return _0xef9f7d;}})});}_0x5d5b1f=_[_0x321b('0x41')]({},_0x5d5b1f,_0x389c13[_0x321b('0x45')]);var _0x243c5e={'where':_0x5d5b1f['where']};return db[_0x321b('0x2e')]['count'](_0x243c5e)[_0x321b('0x28')](function(_0x3c8f05){_0xc10607[_0x321b('0x22')]=_0x3c8f05;if(_0x389c13[_0x321b('0x34')][_0x321b('0x46')]){_0x5d5b1f['include']=[{'all':!![]}];}return db[_0x321b('0x2e')][_0x321b('0x47')](_0x5d5b1f);})[_0x321b('0x28')](function(_0x43a614){_0xc10607[_0x321b('0x48')]=_0x43a614;return _0xc10607;})[_0x321b('0x28')](respondWithFilteredResult(_0x34e0de,_0x5d5b1f))[_0x321b('0x49')](handleError(_0x34e0de,null));};exports['show']=function(_0x144ecd,_0xecfc6e){var _0x59256f={'raw':![],'where':{'id':_0x144ecd['params']['id']}},_0x47b4a3={};_0x47b4a3['model']=_[_0x321b('0x35')](db['SugarcrmConfiguration'][_0x321b('0x2f')]);_0x47b4a3[_0x321b('0x34')]=_['keys'](_0x144ecd[_0x321b('0x34')]);_0x47b4a3['filters']=_['intersection'](_0x47b4a3[_0x321b('0x33')],_0x47b4a3['query']);_0x59256f[_0x321b('0x37')]=_[_0x321b('0x36')](_0x47b4a3[_0x321b('0x33')],qs['fields'](_0x144ecd['query']['fields']));_0x59256f[_0x321b('0x37')]=_0x59256f[_0x321b('0x37')][_0x321b('0x39')]?_0x59256f['attributes']:_0x47b4a3[_0x321b('0x33')];if(_0x144ecd[_0x321b('0x34')]['includeAll']){_0x59256f['include']=[{'all':!![]}];}_0x59256f=_[_0x321b('0x41')]({},_0x59256f,_0x144ecd[_0x321b('0x45')]);return db[_0x321b('0x2e')][_0x321b('0x4a')](_0x59256f)[_0x321b('0x28')](handleEntityNotFound(_0xecfc6e,null))[_0x321b('0x28')](respondWithResult(_0xecfc6e,null))[_0x321b('0x49')](handleError(_0xecfc6e,null));};exports['create']=function(_0x36878a,_0x16f38c){return db[_0x321b('0x2e')][_0x321b('0x4b')](_0x36878a[_0x321b('0x4c')],{})[_0x321b('0x28')](respondWithResult(_0x16f38c,0xc9))[_0x321b('0x49')](handleError(_0x16f38c,null));};exports[_0x321b('0x4d')]=function(_0x54914d,_0x102917){if(_0x54914d[_0x321b('0x4c')]['id']){delete _0x54914d['body']['id'];}return db[_0x321b('0x2e')][_0x321b('0x4a')]({'where':{'id':_0x54914d[_0x321b('0x4e')]['id']}})[_0x321b('0x28')](handleEntityNotFound(_0x102917,null))[_0x321b('0x28')](saveUpdates(_0x54914d[_0x321b('0x4c')],null))['then'](respondWithResult(_0x102917,null))[_0x321b('0x49')](handleError(_0x102917,null));};exports[_0x321b('0x27')]=function(_0x54fe80,_0x5e303f){return db[_0x321b('0x2e')]['find']({'where':{'id':_0x54fe80['params']['id']}})['then'](handleEntityNotFound(_0x5e303f,null))[_0x321b('0x28')](removeEntity(_0x5e303f,null))['catch'](handleError(_0x5e303f,null));};exports[_0x321b('0x4f')]=function(_0x51db4a,_0x84eefe,_0x118a9e){var _0x16586b={};var _0x37b076={};var _0x4cc9ff;var _0x3780f2;return db[_0x321b('0x2e')][_0x321b('0x50')]({'where':{'id':_0x51db4a[_0x321b('0x4e')]['id']}})[_0x321b('0x28')](handleEntityNotFound(_0x84eefe,null))['then'](function(_0x35e61b){if(_0x35e61b){_0x4cc9ff=_0x35e61b;_0x37b076['model']=_[_0x321b('0x35')](db['SugarcrmField'][_0x321b('0x2f')]);_0x37b076[_0x321b('0x34')]=_[_0x321b('0x35')](_0x51db4a[_0x321b('0x34')]);_0x37b076['filters']=_['intersection'](_0x37b076[_0x321b('0x33')],_0x37b076[_0x321b('0x34')]);_0x16586b[_0x321b('0x37')]=_[_0x321b('0x36')](_0x37b076[_0x321b('0x33')],qs[_0x321b('0x38')](_0x51db4a[_0x321b('0x34')]['fields']));_0x16586b[_0x321b('0x37')]=_0x16586b[_0x321b('0x37')][_0x321b('0x39')]?_0x16586b[_0x321b('0x37')]:_0x37b076['model'];_0x16586b[_0x321b('0x3c')]=qs[_0x321b('0x3d')](_0x51db4a[_0x321b('0x34')][_0x321b('0x3d')]);_0x16586b[_0x321b('0x42')]=qs['filters'](_['pick'](_0x51db4a[_0x321b('0x34')],_0x37b076[_0x321b('0x3e')]));if(_0x51db4a[_0x321b('0x34')][_0x321b('0x40')]){_0x16586b[_0x321b('0x42')]=_[_0x321b('0x41')](_0x16586b[_0x321b('0x42')],{'$or':_[_0x321b('0x43')](_0x16586b[_0x321b('0x37')],function(_0x5aa4c3){var _0x17c8d6={};_0x17c8d6[_0x5aa4c3]={'$like':'%'+_0x51db4a['query'][_0x321b('0x40')]+'%'};return _0x17c8d6;})});}_0x16586b=_['merge']({},_0x16586b,_0x51db4a[_0x321b('0x45')]);return _0x4cc9ff['getFields'](_0x16586b);}})[_0x321b('0x28')](function(_0x4db3c1){if(_0x4db3c1){_0x3780f2=_0x4db3c1[_0x321b('0x39')];if(!_0x51db4a[_0x321b('0x34')][_0x321b('0x3a')](_0x321b('0x3b'))){_0x16586b['limit']=qs[_0x321b('0x20')](_0x51db4a['query'][_0x321b('0x20')]);_0x16586b[_0x321b('0x21')]=qs[_0x321b('0x21')](_0x51db4a[_0x321b('0x34')][_0x321b('0x21')]);}return _0x4cc9ff[_0x321b('0x4f')](_0x16586b);}})[_0x321b('0x28')](function(_0x306998){if(_0x306998){return _0x306998?{'count':_0x3780f2,'rows':_0x306998}:null;}})[_0x321b('0x28')](respondWithResult(_0x84eefe,null))[_0x321b('0x49')](handleError(_0x84eefe,null));};exports[_0x321b('0x51')]=function(_0x2096bc,_0x50c6f7,_0x20d435){var _0x2becf7={};var _0x99d325={};var _0x166763;var _0x3ec72b;return db['SugarcrmConfiguration'][_0x321b('0x50')]({'where':{'id':_0x2096bc[_0x321b('0x4e')]['id']}})[_0x321b('0x28')](handleEntityNotFound(_0x50c6f7,null))[_0x321b('0x28')](function(_0x487799){if(_0x487799){_0x166763=_0x487799;_0x99d325['model']=_[_0x321b('0x35')](db['SugarcrmField'][_0x321b('0x2f')]);_0x99d325[_0x321b('0x34')]=_[_0x321b('0x35')](_0x2096bc[_0x321b('0x34')]);_0x99d325['filters']=_[_0x321b('0x36')](_0x99d325['model'],_0x99d325[_0x321b('0x34')]);_0x2becf7['attributes']=_[_0x321b('0x36')](_0x99d325[_0x321b('0x33')],qs[_0x321b('0x38')](_0x2096bc['query']['fields']));_0x2becf7[_0x321b('0x37')]=_0x2becf7['attributes'][_0x321b('0x39')]?_0x2becf7[_0x321b('0x37')]:_0x99d325[_0x321b('0x33')];_0x2becf7[_0x321b('0x3c')]=qs['sort'](_0x2096bc[_0x321b('0x34')]['sort']);_0x2becf7['where']=qs[_0x321b('0x3e')](_[_0x321b('0x3f')](_0x2096bc[_0x321b('0x34')],_0x99d325['filters']));if(_0x2096bc['query']['filter']){_0x2becf7[_0x321b('0x42')]=_[_0x321b('0x41')](_0x2becf7[_0x321b('0x42')],{'$or':_[_0x321b('0x43')](_0x2becf7[_0x321b('0x37')],function(_0x475488){var _0x1ee68d={};_0x1ee68d[_0x475488]={'$like':'%'+_0x2096bc[_0x321b('0x34')]['filter']+'%'};return _0x1ee68d;})});}_0x2becf7=_[_0x321b('0x41')]({},_0x2becf7,_0x2096bc['options']);return _0x166763['getSubjects'](_0x2becf7);}})['then'](function(_0x3084c2){if(_0x3084c2){_0x3ec72b=_0x3084c2[_0x321b('0x39')];if(!_0x2096bc[_0x321b('0x34')][_0x321b('0x3a')](_0x321b('0x3b'))){_0x2becf7['limit']=qs[_0x321b('0x20')](_0x2096bc[_0x321b('0x34')]['limit']);_0x2becf7[_0x321b('0x21')]=qs['offset'](_0x2096bc[_0x321b('0x34')][_0x321b('0x21')]);}return _0x166763[_0x321b('0x51')](_0x2becf7);}})[_0x321b('0x28')](function(_0x514ab2){if(_0x514ab2){return _0x514ab2?{'count':_0x3ec72b,'rows':_0x514ab2}:null;}})[_0x321b('0x28')](respondWithResult(_0x50c6f7,null))[_0x321b('0x49')](handleError(_0x50c6f7,null));};exports['getDescriptions']=function(_0x433e50,_0x11db6,_0x163a2a){var _0x3a582e={};var _0x17a6f8={};var _0x5e9180;var _0x453120;return db[_0x321b('0x2e')][_0x321b('0x50')]({'where':{'id':_0x433e50['params']['id']}})['then'](handleEntityNotFound(_0x11db6,null))[_0x321b('0x28')](function(_0x2098c2){if(_0x2098c2){_0x5e9180=_0x2098c2;_0x17a6f8[_0x321b('0x33')]=_[_0x321b('0x35')](db[_0x321b('0x52')]['rawAttributes']);_0x17a6f8[_0x321b('0x34')]=_[_0x321b('0x35')](_0x433e50[_0x321b('0x34')]);_0x17a6f8[_0x321b('0x3e')]=_['intersection'](_0x17a6f8[_0x321b('0x33')],_0x17a6f8['query']);_0x3a582e[_0x321b('0x37')]=_[_0x321b('0x36')](_0x17a6f8[_0x321b('0x33')],qs[_0x321b('0x38')](_0x433e50[_0x321b('0x34')][_0x321b('0x38')]));_0x3a582e['attributes']=_0x3a582e[_0x321b('0x37')][_0x321b('0x39')]?_0x3a582e[_0x321b('0x37')]:_0x17a6f8['model'];_0x3a582e['order']=qs['sort'](_0x433e50[_0x321b('0x34')][_0x321b('0x3d')]);_0x3a582e[_0x321b('0x42')]=qs[_0x321b('0x3e')](_[_0x321b('0x3f')](_0x433e50[_0x321b('0x34')],_0x17a6f8[_0x321b('0x3e')]));if(_0x433e50[_0x321b('0x34')][_0x321b('0x40')]){_0x3a582e['where']=_[_0x321b('0x41')](_0x3a582e[_0x321b('0x42')],{'$or':_[_0x321b('0x43')](_0x3a582e[_0x321b('0x37')],function(_0x54cb9b){var _0x549a2d={};_0x549a2d[_0x54cb9b]={'$like':'%'+_0x433e50[_0x321b('0x34')]['filter']+'%'};return _0x549a2d;})});}_0x3a582e=_[_0x321b('0x41')]({},_0x3a582e,_0x433e50[_0x321b('0x45')]);return _0x5e9180['getDescriptions'](_0x3a582e);}})['then'](function(_0x2433c8){if(_0x2433c8){_0x453120=_0x2433c8[_0x321b('0x39')];if(!_0x433e50[_0x321b('0x34')][_0x321b('0x3a')](_0x321b('0x3b'))){_0x3a582e[_0x321b('0x20')]=qs[_0x321b('0x20')](_0x433e50[_0x321b('0x34')][_0x321b('0x20')]);_0x3a582e[_0x321b('0x21')]=qs[_0x321b('0x21')](_0x433e50['query'][_0x321b('0x21')]);}return _0x5e9180[_0x321b('0x53')](_0x3a582e);}})[_0x321b('0x28')](function(_0x3d1f0a){if(_0x3d1f0a){return _0x3d1f0a?{'count':_0x453120,'rows':_0x3d1f0a}:null;}})[_0x321b('0x28')](respondWithResult(_0x11db6,null))[_0x321b('0x49')](handleError(_0x11db6,null));};
\ No newline at end of file
+var _0x6f71=['create','body','SugarcrmField','getFields','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','SugarcrmConfiguration','includeAll','include','rows','show','params','keys','find','catch'];(function(_0x5e82cc,_0x4aa2f0){var _0x44cfd8=function(_0x5be39b){while(--_0x5be39b){_0x5e82cc['push'](_0x5e82cc['shift']());}};_0x44cfd8(++_0x4aa2f0);}(_0x6f71,0xaf));var _0x16f7=function(_0x477fd9,_0x3ea76a){_0x477fd9=_0x477fd9-0x0;var _0x2e382b=_0x6f71[_0x477fd9];return _0x2e382b;};'use strict';var emlformat=require(_0x16f7('0x0'));var rimraf=require(_0x16f7('0x1'));var zipdir=require(_0x16f7('0x2'));var jsonpatch=require(_0x16f7('0x3'));var rp=require('request-promise');var moment=require(_0x16f7('0x4'));var BPromise=require(_0x16f7('0x5'));var Mustache=require(_0x16f7('0x6'));var util=require(_0x16f7('0x7'));var path=require('path');var sox=require(_0x16f7('0x8'));var csv=require(_0x16f7('0x9'));var ejs=require(_0x16f7('0xa'));var fs=require('fs');var fs_extra=require(_0x16f7('0xb'));var _=require(_0x16f7('0xc'));var squel=require(_0x16f7('0xd'));var crypto=require(_0x16f7('0xe'));var jsforce=require(_0x16f7('0xf'));var deskjs=require(_0x16f7('0x10'));var toCsv=require('to-csv');var querystring=require(_0x16f7('0x11'));var Papa=require(_0x16f7('0x12'));var Redis=require(_0x16f7('0x13'));var authService=require(_0x16f7('0x14'));var qs=require(_0x16f7('0x15'));var as=require(_0x16f7('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x16f7('0x17'))(_0x16f7('0x18'));var utils=require(_0x16f7('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x16f7('0x1a'));var db=require(_0x16f7('0x1b'))['db'];function respondWithStatusCode(_0x40620e,_0x3f6529){_0x3f6529=_0x3f6529||0xcc;return function(_0x1bfd98){if(_0x1bfd98){return _0x40620e[_0x16f7('0x1c')](_0x3f6529);}return _0x40620e[_0x16f7('0x1d')](_0x3f6529)[_0x16f7('0x1e')]();};}function respondWithResult(_0x480b84,_0x5b5ce3){_0x5b5ce3=_0x5b5ce3||0xc8;return function(_0xe68674){if(_0xe68674){return _0x480b84[_0x16f7('0x1d')](_0x5b5ce3)[_0x16f7('0x1f')](_0xe68674);}};}function respondWithFilteredResult(_0x5261c7,_0x4c880e){return function(_0x587804){if(_0x587804){var _0x5ad4f5=typeof _0x4c880e[_0x16f7('0x20')]===_0x16f7('0x21')&&typeof _0x4c880e[_0x16f7('0x22')]===_0x16f7('0x21');var _0x2ef716=_0x587804[_0x16f7('0x23')];var _0xd34ee1=_0x5ad4f5?0x0:_0x4c880e[_0x16f7('0x20')];var _0x58ef82=_0x5ad4f5?_0x587804[_0x16f7('0x23')]:_0x4c880e[_0x16f7('0x20')]+_0x4c880e[_0x16f7('0x22')];var _0x372ae0;if(_0x58ef82>=_0x2ef716){_0x58ef82=_0x2ef716;_0x372ae0=0xc8;}else{_0x372ae0=0xce;}_0x5261c7[_0x16f7('0x1d')](_0x372ae0);return _0x5261c7['set'](_0x16f7('0x24'),_0xd34ee1+'-'+_0x58ef82+'/'+_0x2ef716)['json'](_0x587804);}return null;};}function patchUpdates(_0x5c248c){return function(_0x220197){try{jsonpatch['apply'](_0x220197,_0x5c248c,!![]);}catch(_0x532ff9){return BPromise[_0x16f7('0x25')](_0x532ff9);}return _0x220197['save']();};}function saveUpdates(_0x4c8b5a,_0x17a762){return function(_0x63d380){if(_0x63d380){return _0x63d380[_0x16f7('0x26')](_0x4c8b5a)[_0x16f7('0x27')](function(_0x696c7f){return _0x696c7f;});}return null;};}function removeEntity(_0x429d88,_0x3093ed){return function(_0x440bc3){if(_0x440bc3){return _0x440bc3[_0x16f7('0x28')]()[_0x16f7('0x27')](function(){_0x429d88[_0x16f7('0x1d')](0xcc)[_0x16f7('0x1e')]();});}};}function handleEntityNotFound(_0x4da6ea,_0x9ead4b){return function(_0x3e38a1){if(!_0x3e38a1){_0x4da6ea[_0x16f7('0x1c')](0x194);}return _0x3e38a1;};}function handleError(_0x3cfb6b,_0x35d2f2){_0x35d2f2=_0x35d2f2||0x1f4;return function(_0x2280ca){logger[_0x16f7('0x29')](_0x2280ca[_0x16f7('0x2a')]);if(_0x2280ca[_0x16f7('0x2b')]){delete _0x2280ca['name'];}_0x3cfb6b[_0x16f7('0x1d')](_0x35d2f2)[_0x16f7('0x2c')](_0x2280ca);};}exports[_0x16f7('0x2d')]=function(_0x37287e,_0x5a5e6c){var _0x267048={},_0x21ada7={},_0x5af446={'count':0x0,'rows':[]};var _0x1cebbb=_['map'](db['SugarcrmConfiguration'][_0x16f7('0x2e')],function(_0x12a392){return{'name':_0x12a392[_0x16f7('0x2f')],'type':_0x12a392[_0x16f7('0x30')][_0x16f7('0x31')]};});_0x21ada7[_0x16f7('0x32')]=_['map'](_0x1cebbb,'name');_0x21ada7[_0x16f7('0x33')]=_['keys'](_0x37287e[_0x16f7('0x33')]);_0x21ada7[_0x16f7('0x34')]=_[_0x16f7('0x35')](_0x21ada7[_0x16f7('0x32')],_0x21ada7[_0x16f7('0x33')]);_0x267048[_0x16f7('0x36')]=_[_0x16f7('0x35')](_0x21ada7[_0x16f7('0x32')],qs[_0x16f7('0x37')](_0x37287e[_0x16f7('0x33')][_0x16f7('0x37')]));_0x267048['attributes']=_0x267048['attributes'][_0x16f7('0x38')]?_0x267048[_0x16f7('0x36')]:_0x21ada7[_0x16f7('0x32')];if(!_0x37287e['query'][_0x16f7('0x39')](_0x16f7('0x3a'))){_0x267048[_0x16f7('0x22')]=qs['limit'](_0x37287e[_0x16f7('0x33')][_0x16f7('0x22')]);_0x267048[_0x16f7('0x20')]=qs['offset'](_0x37287e[_0x16f7('0x33')]['offset']);}_0x267048[_0x16f7('0x3b')]=qs['sort'](_0x37287e['query'][_0x16f7('0x3c')]);_0x267048[_0x16f7('0x3d')]=qs['filters'](_[_0x16f7('0x3e')](_0x37287e['query'],_0x21ada7[_0x16f7('0x34')]),_0x1cebbb);if(_0x37287e[_0x16f7('0x33')][_0x16f7('0x3f')]){_0x267048['where']=_[_0x16f7('0x40')](_0x267048[_0x16f7('0x3d')],{'$or':_[_0x16f7('0x41')](_0x1cebbb,function(_0x5510f2){if(_0x5510f2[_0x16f7('0x30')]!==_0x16f7('0x42')){var _0x4b6814={};_0x4b6814[_0x5510f2[_0x16f7('0x2b')]]={'$like':'%'+_0x37287e[_0x16f7('0x33')][_0x16f7('0x3f')]+'%'};return _0x4b6814;}})});}_0x267048=_[_0x16f7('0x40')]({},_0x267048,_0x37287e[_0x16f7('0x43')]);var _0x58d6f0={'where':_0x267048[_0x16f7('0x3d')]};return db[_0x16f7('0x44')]['count'](_0x58d6f0)[_0x16f7('0x27')](function(_0x3c66bb){_0x5af446[_0x16f7('0x23')]=_0x3c66bb;if(_0x37287e[_0x16f7('0x33')][_0x16f7('0x45')]){_0x267048[_0x16f7('0x46')]=[{'all':!![]}];}return db[_0x16f7('0x44')]['findAll'](_0x267048);})[_0x16f7('0x27')](function(_0x150ace){_0x5af446[_0x16f7('0x47')]=_0x150ace;return _0x5af446;})[_0x16f7('0x27')](respondWithFilteredResult(_0x5a5e6c,_0x267048))['catch'](handleError(_0x5a5e6c,null));};exports[_0x16f7('0x48')]=function(_0x2d9e75,_0x2dbe34){var _0x1f027d={'raw':![],'where':{'id':_0x2d9e75[_0x16f7('0x49')]['id']}},_0x4ea672={};_0x4ea672[_0x16f7('0x32')]=_[_0x16f7('0x4a')](db[_0x16f7('0x44')]['rawAttributes']);_0x4ea672[_0x16f7('0x33')]=_[_0x16f7('0x4a')](_0x2d9e75['query']);_0x4ea672[_0x16f7('0x34')]=_[_0x16f7('0x35')](_0x4ea672[_0x16f7('0x32')],_0x4ea672[_0x16f7('0x33')]);_0x1f027d[_0x16f7('0x36')]=_[_0x16f7('0x35')](_0x4ea672[_0x16f7('0x32')],qs['fields'](_0x2d9e75['query']['fields']));_0x1f027d[_0x16f7('0x36')]=_0x1f027d['attributes']['length']?_0x1f027d[_0x16f7('0x36')]:_0x4ea672[_0x16f7('0x32')];if(_0x2d9e75[_0x16f7('0x33')][_0x16f7('0x45')]){_0x1f027d[_0x16f7('0x46')]=[{'all':!![]}];}_0x1f027d=_['merge']({},_0x1f027d,_0x2d9e75['options']);return db[_0x16f7('0x44')][_0x16f7('0x4b')](_0x1f027d)['then'](handleEntityNotFound(_0x2dbe34,null))[_0x16f7('0x27')](respondWithResult(_0x2dbe34,null))[_0x16f7('0x4c')](handleError(_0x2dbe34,null));};exports[_0x16f7('0x4d')]=function(_0x56c7e6,_0x207a3b){return db[_0x16f7('0x44')]['create'](_0x56c7e6['body'],{})[_0x16f7('0x27')](respondWithResult(_0x207a3b,0xc9))[_0x16f7('0x4c')](handleError(_0x207a3b,null));};exports[_0x16f7('0x26')]=function(_0x3775f9,_0x11d304){if(_0x3775f9['body']['id']){delete _0x3775f9[_0x16f7('0x4e')]['id'];}return db[_0x16f7('0x44')][_0x16f7('0x4b')]({'where':{'id':_0x3775f9[_0x16f7('0x49')]['id']}})['then'](handleEntityNotFound(_0x11d304,null))[_0x16f7('0x27')](saveUpdates(_0x3775f9[_0x16f7('0x4e')],null))[_0x16f7('0x27')](respondWithResult(_0x11d304,null))[_0x16f7('0x4c')](handleError(_0x11d304,null));};exports['destroy']=function(_0x5789b0,_0x224945){return db['SugarcrmConfiguration'][_0x16f7('0x4b')]({'where':{'id':_0x5789b0[_0x16f7('0x49')]['id']}})[_0x16f7('0x27')](handleEntityNotFound(_0x224945,null))[_0x16f7('0x27')](removeEntity(_0x224945,null))[_0x16f7('0x4c')](handleError(_0x224945,null));};exports['getFields']=function(_0x18dda0,_0x4812b1,_0x48b781){var _0x156fc4={};var _0x1efb46={};var _0x3e0d33;var _0x37139b;return db[_0x16f7('0x44')]['findOne']({'where':{'id':_0x18dda0[_0x16f7('0x49')]['id']}})[_0x16f7('0x27')](handleEntityNotFound(_0x4812b1,null))['then'](function(_0x5cf8a1){if(_0x5cf8a1){_0x3e0d33=_0x5cf8a1;_0x1efb46[_0x16f7('0x32')]=_['keys'](db[_0x16f7('0x4f')][_0x16f7('0x2e')]);_0x1efb46[_0x16f7('0x33')]=_[_0x16f7('0x4a')](_0x18dda0[_0x16f7('0x33')]);_0x1efb46[_0x16f7('0x34')]=_[_0x16f7('0x35')](_0x1efb46['model'],_0x1efb46[_0x16f7('0x33')]);_0x156fc4[_0x16f7('0x36')]=_[_0x16f7('0x35')](_0x1efb46[_0x16f7('0x32')],qs[_0x16f7('0x37')](_0x18dda0[_0x16f7('0x33')][_0x16f7('0x37')]));_0x156fc4[_0x16f7('0x36')]=_0x156fc4['attributes'][_0x16f7('0x38')]?_0x156fc4[_0x16f7('0x36')]:_0x1efb46['model'];_0x156fc4['order']=qs[_0x16f7('0x3c')](_0x18dda0['query'][_0x16f7('0x3c')]);_0x156fc4[_0x16f7('0x3d')]=qs[_0x16f7('0x34')](_[_0x16f7('0x3e')](_0x18dda0['query'],_0x1efb46[_0x16f7('0x34')]));if(_0x18dda0['query']['filter']){_0x156fc4[_0x16f7('0x3d')]=_[_0x16f7('0x40')](_0x156fc4[_0x16f7('0x3d')],{'$or':_[_0x16f7('0x41')](_0x156fc4[_0x16f7('0x36')],function(_0x5ef4fa){var _0xa0ddf8={};_0xa0ddf8[_0x5ef4fa]={'$like':'%'+_0x18dda0[_0x16f7('0x33')][_0x16f7('0x3f')]+'%'};return _0xa0ddf8;})});}_0x156fc4=_[_0x16f7('0x40')]({},_0x156fc4,_0x18dda0[_0x16f7('0x43')]);return _0x3e0d33[_0x16f7('0x50')](_0x156fc4);}})[_0x16f7('0x27')](function(_0x38786d){if(_0x38786d){_0x37139b=_0x38786d[_0x16f7('0x38')];if(!_0x18dda0[_0x16f7('0x33')][_0x16f7('0x39')](_0x16f7('0x3a'))){_0x156fc4['limit']=qs['limit'](_0x18dda0[_0x16f7('0x33')][_0x16f7('0x22')]);_0x156fc4[_0x16f7('0x20')]=qs[_0x16f7('0x20')](_0x18dda0['query'][_0x16f7('0x20')]);}return _0x3e0d33[_0x16f7('0x50')](_0x156fc4);}})['then'](function(_0x2b1189){if(_0x2b1189){return _0x2b1189?{'count':_0x37139b,'rows':_0x2b1189}:null;}})[_0x16f7('0x27')](respondWithResult(_0x4812b1,null))[_0x16f7('0x4c')](handleError(_0x4812b1,null));};exports[_0x16f7('0x51')]=function(_0x253eba,_0x12346e,_0x9d422c){var _0x24287d={};var _0x204c04={};var _0x3b861c;var _0x59c764;return db[_0x16f7('0x44')]['findOne']({'where':{'id':_0x253eba[_0x16f7('0x49')]['id']}})[_0x16f7('0x27')](handleEntityNotFound(_0x12346e,null))['then'](function(_0x47f152){if(_0x47f152){_0x3b861c=_0x47f152;_0x204c04['model']=_[_0x16f7('0x4a')](db['SugarcrmField'][_0x16f7('0x2e')]);_0x204c04[_0x16f7('0x33')]=_[_0x16f7('0x4a')](_0x253eba[_0x16f7('0x33')]);_0x204c04[_0x16f7('0x34')]=_[_0x16f7('0x35')](_0x204c04[_0x16f7('0x32')],_0x204c04[_0x16f7('0x33')]);_0x24287d[_0x16f7('0x36')]=_[_0x16f7('0x35')](_0x204c04[_0x16f7('0x32')],qs[_0x16f7('0x37')](_0x253eba[_0x16f7('0x33')][_0x16f7('0x37')]));_0x24287d[_0x16f7('0x36')]=_0x24287d[_0x16f7('0x36')]['length']?_0x24287d[_0x16f7('0x36')]:_0x204c04['model'];_0x24287d[_0x16f7('0x3b')]=qs['sort'](_0x253eba[_0x16f7('0x33')][_0x16f7('0x3c')]);_0x24287d['where']=qs['filters'](_[_0x16f7('0x3e')](_0x253eba[_0x16f7('0x33')],_0x204c04[_0x16f7('0x34')]));if(_0x253eba['query']['filter']){_0x24287d['where']=_[_0x16f7('0x40')](_0x24287d[_0x16f7('0x3d')],{'$or':_[_0x16f7('0x41')](_0x24287d['attributes'],function(_0x155d06){var _0x102111={};_0x102111[_0x155d06]={'$like':'%'+_0x253eba[_0x16f7('0x33')]['filter']+'%'};return _0x102111;})});}_0x24287d=_[_0x16f7('0x40')]({},_0x24287d,_0x253eba[_0x16f7('0x43')]);return _0x3b861c[_0x16f7('0x51')](_0x24287d);}})[_0x16f7('0x27')](function(_0x4aec51){if(_0x4aec51){_0x59c764=_0x4aec51['length'];if(!_0x253eba['query'][_0x16f7('0x39')](_0x16f7('0x3a'))){_0x24287d[_0x16f7('0x22')]=qs[_0x16f7('0x22')](_0x253eba[_0x16f7('0x33')][_0x16f7('0x22')]);_0x24287d[_0x16f7('0x20')]=qs['offset'](_0x253eba[_0x16f7('0x33')][_0x16f7('0x20')]);}return _0x3b861c[_0x16f7('0x51')](_0x24287d);}})[_0x16f7('0x27')](function(_0x3cde46){if(_0x3cde46){return _0x3cde46?{'count':_0x59c764,'rows':_0x3cde46}:null;}})[_0x16f7('0x27')](respondWithResult(_0x12346e,null))[_0x16f7('0x4c')](handleError(_0x12346e,null));};exports['getDescriptions']=function(_0xac070a,_0x54a3c0,_0x21758d){var _0x1fa91a={};var _0x18ed9d={};var _0x48928d;var _0x276deb;return db['SugarcrmConfiguration'][_0x16f7('0x52')]({'where':{'id':_0xac070a['params']['id']}})[_0x16f7('0x27')](handleEntityNotFound(_0x54a3c0,null))[_0x16f7('0x27')](function(_0x4c1a73){if(_0x4c1a73){_0x48928d=_0x4c1a73;_0x18ed9d['model']=_['keys'](db[_0x16f7('0x4f')][_0x16f7('0x2e')]);_0x18ed9d[_0x16f7('0x33')]=_[_0x16f7('0x4a')](_0xac070a[_0x16f7('0x33')]);_0x18ed9d[_0x16f7('0x34')]=_[_0x16f7('0x35')](_0x18ed9d[_0x16f7('0x32')],_0x18ed9d['query']);_0x1fa91a[_0x16f7('0x36')]=_[_0x16f7('0x35')](_0x18ed9d['model'],qs[_0x16f7('0x37')](_0xac070a[_0x16f7('0x33')][_0x16f7('0x37')]));_0x1fa91a[_0x16f7('0x36')]=_0x1fa91a[_0x16f7('0x36')]['length']?_0x1fa91a[_0x16f7('0x36')]:_0x18ed9d[_0x16f7('0x32')];_0x1fa91a[_0x16f7('0x3b')]=qs['sort'](_0xac070a[_0x16f7('0x33')]['sort']);_0x1fa91a[_0x16f7('0x3d')]=qs[_0x16f7('0x34')](_[_0x16f7('0x3e')](_0xac070a[_0x16f7('0x33')],_0x18ed9d[_0x16f7('0x34')]));if(_0xac070a[_0x16f7('0x33')]['filter']){_0x1fa91a[_0x16f7('0x3d')]=_[_0x16f7('0x40')](_0x1fa91a['where'],{'$or':_[_0x16f7('0x41')](_0x1fa91a[_0x16f7('0x36')],function(_0xf5bf2c){var _0xbf19a8={};_0xbf19a8[_0xf5bf2c]={'$like':'%'+_0xac070a['query'][_0x16f7('0x3f')]+'%'};return _0xbf19a8;})});}_0x1fa91a=_[_0x16f7('0x40')]({},_0x1fa91a,_0xac070a['options']);return _0x48928d[_0x16f7('0x53')](_0x1fa91a);}})[_0x16f7('0x27')](function(_0x35a77a){if(_0x35a77a){_0x276deb=_0x35a77a['length'];if(!_0xac070a[_0x16f7('0x33')][_0x16f7('0x39')](_0x16f7('0x3a'))){_0x1fa91a[_0x16f7('0x22')]=qs[_0x16f7('0x22')](_0xac070a['query'][_0x16f7('0x22')]);_0x1fa91a[_0x16f7('0x20')]=qs['offset'](_0xac070a[_0x16f7('0x33')][_0x16f7('0x20')]);}return _0x48928d['getDescriptions'](_0x1fa91a);}})[_0x16f7('0x27')](function(_0x595ba9){if(_0x595ba9){return _0x595ba9?{'count':_0x276deb,'rows':_0x595ba9}:null;}})['then'](respondWithResult(_0x54a3c0,null))['catch'](handleError(_0x54a3c0,null));};
\ No newline at end of file
index b1af2da..2ba7573 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1943=['../../config/environment','./intSugarcrmConfiguration.attributes','define','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x1943,0x85));var _0x3194=function(_0x7005dc,_0xeb51c4){_0x7005dc=_0x7005dc-0x0;var _0x5b2497=_0x1943[_0x7005dc];return _0x5b2497;};'use strict';var _=require('lodash');var util=require(_0x3194('0x0'));var logger=require('../../config/logger')(_0x3194('0x1'));var moment=require(_0x3194('0x2'));var BPromise=require(_0x3194('0x3'));var rp=require(_0x3194('0x4'));var fs=require('fs');var path=require(_0x3194('0x5'));var rimraf=require(_0x3194('0x6'));var config=require(_0x3194('0x7'));var attributes=require(_0x3194('0x8'));module['exports']=function(_0x26ec4d,_0x47fdae){return _0x26ec4d[_0x3194('0x9')]('SugarcrmConfiguration',attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf167=['../../config/environment','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x56c844,_0x2bdc63){var _0x7b48b3=function(_0xe25dd6){while(--_0xe25dd6){_0x56c844['push'](_0x56c844['shift']());}};_0x7b48b3(++_0x2bdc63);}(_0xf167,0x87));var _0x7f16=function(_0x119880,_0x4f291f){_0x119880=_0x119880-0x0;var _0x4a1707=_0xf167[_0x119880];return _0x4a1707;};'use strict';var _=require(_0x7f16('0x0'));var util=require(_0x7f16('0x1'));var logger=require(_0x7f16('0x2'))('api');var moment=require(_0x7f16('0x3'));var BPromise=require(_0x7f16('0x4'));var rp=require(_0x7f16('0x5'));var fs=require('fs');var path=require(_0x7f16('0x6'));var rimraf=require(_0x7f16('0x7'));var config=require(_0x7f16('0x8'));var attributes=require('./intSugarcrmConfiguration.attributes');module['exports']=function(_0xee3b27,_0x10c28e){return _0xee3b27['define'](_0x7f16('0x9'),attributes,{'tableName':_0x7f16('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index a25b11d..5ef5dc6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ae5=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x543a5e,_0x33dd65){var _0x29afa6=function(_0x42d2ec){while(--_0x42d2ec){_0x543a5e['push'](_0x543a5e['shift']());}};_0x29afa6(++_0x33dd65);}(_0x1ae5,0x1a3));var _0x51ae=function(_0x4d5e2f,_0x5b91ed){_0x4d5e2f=_0x4d5e2f-0x0;var _0x4d9bd0=_0x1ae5[_0x4d5e2f];return _0x4d9bd0;};'use strict';var _=require(_0x51ae('0x0'));var util=require(_0x51ae('0x1'));var moment=require(_0x51ae('0x2'));var BPromise=require(_0x51ae('0x3'));var rs=require(_0x51ae('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x51ae('0x5'))['db'];var utils=require(_0x51ae('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x51ae('0x7'));var client=jayson[_0x51ae('0x8')][_0x51ae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c8720,_0x48c941,_0x4d2fe6){return new BPromise(function(_0x17746b,_0x1d76ad){return client[_0x51ae('0xa')](_0x2c8720,_0x4d2fe6)[_0x51ae('0xb')](function(_0x3154ea){logger['info'](_0x51ae('0xc'),_0x48c941,_0x51ae('0xd'));logger[_0x51ae('0xe')](_0x51ae('0xf'),_0x48c941,_0x51ae('0xd'),JSON[_0x51ae('0x10')](_0x3154ea));if(_0x3154ea[_0x51ae('0x11')]){if(_0x3154ea['error'][_0x51ae('0x12')]===0x1f4){logger[_0x51ae('0x11')](_0x51ae('0xc'),_0x48c941,_0x3154ea[_0x51ae('0x11')][_0x51ae('0x13')]);return _0x1d76ad(_0x3154ea['error'][_0x51ae('0x13')]);}logger[_0x51ae('0x11')](_0x51ae('0xc'),_0x48c941,_0x3154ea[_0x51ae('0x11')]['message']);return _0x17746b(_0x3154ea[_0x51ae('0x11')][_0x51ae('0x13')]);}else{logger['info'](_0x51ae('0xc'),_0x48c941,_0x51ae('0xd'));_0x17746b(_0x3154ea[_0x51ae('0x14')][_0x51ae('0x13')]);}})[_0x51ae('0x15')](function(_0x5ed9be){logger[_0x51ae('0x11')](_0x51ae('0xc'),_0x48c941,_0x5ed9be);_0x1d76ad(_0x5ed9be);});});}
\ No newline at end of file
+var _0xa6cc=['error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','jayson/promise','http','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x2b869b,_0x2c4e2e){var _0x15e9c5=function(_0x5343f4){while(--_0x5343f4){_0x2b869b['push'](_0x2b869b['shift']());}};_0x15e9c5(++_0x2c4e2e);}(_0xa6cc,0xa5));var _0xca6c=function(_0x2f0162,_0x561c38){_0x2f0162=_0x2f0162-0x0;var _0x4becec=_0xa6cc[_0x2f0162];return _0x4becec;};'use strict';var _=require(_0xca6c('0x0'));var util=require(_0xca6c('0x1'));var moment=require(_0xca6c('0x2'));var BPromise=require(_0xca6c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xca6c('0x4'))['db'];var utils=require(_0xca6c('0x5'));var logger=require('../../config/logger')(_0xca6c('0x6'));var config=require('../../config/environment');var jayson=require(_0xca6c('0x7'));var client=jayson['client'][_0xca6c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2931cb,_0x245dd0,_0x1e6be7){return new BPromise(function(_0x5a0797,_0x1623a8){return client['request'](_0x2931cb,_0x1e6be7)[_0xca6c('0x9')](function(_0x2a2c66){logger[_0xca6c('0xa')](_0xca6c('0xb'),_0x245dd0,_0xca6c('0xc'));logger[_0xca6c('0xd')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x245dd0,'request\x20sent',JSON[_0xca6c('0xe')](_0x2a2c66));if(_0x2a2c66[_0xca6c('0xf')]){if(_0x2a2c66[_0xca6c('0xf')][_0xca6c('0x10')]===0x1f4){logger[_0xca6c('0xf')](_0xca6c('0xb'),_0x245dd0,_0x2a2c66[_0xca6c('0xf')][_0xca6c('0x11')]);return _0x1623a8(_0x2a2c66[_0xca6c('0xf')]['message']);}logger[_0xca6c('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x245dd0,_0x2a2c66['error'][_0xca6c('0x11')]);return _0x5a0797(_0x2a2c66[_0xca6c('0xf')][_0xca6c('0x11')]);}else{logger[_0xca6c('0xa')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x245dd0,_0xca6c('0xc'));_0x5a0797(_0x2a2c66[_0xca6c('0x12')][_0xca6c('0x11')]);}})[_0xca6c('0x13')](function(_0x4a44aa){logger[_0xca6c('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x245dd0,_0x4a44aa);_0x1623a8(_0x4a44aa);});});}
\ No newline at end of file
index fc20abd..1f41af2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xacae=['post','create','put','delete','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','index','isAuthenticated'];(function(_0x27803b,_0x585f7e){var _0x59ca91=function(_0x143095){while(--_0x143095){_0x27803b['push'](_0x27803b['shift']());}};_0x59ca91(++_0x585f7e);}(_0xacae,0x1cf));var _0xeaca=function(_0x3e02a4,_0x362c89){_0x3e02a4=_0x3e02a4-0x0;var _0xaf9824=_0xacae[_0x3e02a4];return _0xaf9824;};'use strict';var multer=require('multer');var util=require(_0xeaca('0x0'));var path=require(_0xeaca('0x1'));var timeout=require(_0xeaca('0x2'));var express=require(_0xeaca('0x3'));var router=express[_0xeaca('0x4')]();var fs_extra=require(_0xeaca('0x5'));var auth=require(_0xeaca('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xeaca('0x7'));var controller=require(_0xeaca('0x8'));router[_0xeaca('0x9')]('/',auth['isAuthenticated'](),controller[_0xeaca('0xa')]);router['get']('/:id',auth[_0xeaca('0xb')](),controller['show']);router[_0xeaca('0xc')]('/',auth[_0xeaca('0xb')](),controller[_0xeaca('0xd')]);router[_0xeaca('0xe')]('/:id',auth[_0xeaca('0xb')](),controller['update']);router[_0xeaca('0xf')](_0xeaca('0x10'),auth[_0xeaca('0xb')](),controller[_0xeaca('0x11')]);module[_0xeaca('0x12')]=router;
\ No newline at end of file
+var _0x8d80=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','index','/:id','isAuthenticated','post','create','put','update','delete','exports'];(function(_0x4bd72a,_0x290e24){var _0x2c0638=function(_0x2fe441){while(--_0x2fe441){_0x4bd72a['push'](_0x4bd72a['shift']());}};_0x2c0638(++_0x290e24);}(_0x8d80,0x1db));var _0x08d8=function(_0x20c836,_0x44bfa5){_0x20c836=_0x20c836-0x0;var _0x25f8e1=_0x8d80[_0x20c836];return _0x25f8e1;};'use strict';var multer=require('multer');var util=require(_0x08d8('0x0'));var path=require(_0x08d8('0x1'));var timeout=require(_0x08d8('0x2'));var express=require(_0x08d8('0x3'));var router=express[_0x08d8('0x4')]();var fs_extra=require(_0x08d8('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x08d8('0x6'));var config=require(_0x08d8('0x7'));var controller=require(_0x08d8('0x8'));router[_0x08d8('0x9')]('/',auth['isAuthenticated'](),controller[_0x08d8('0xa')]);router[_0x08d8('0x9')](_0x08d8('0xb'),auth[_0x08d8('0xc')](),controller['show']);router[_0x08d8('0xd')]('/',auth[_0x08d8('0xc')](),controller[_0x08d8('0xe')]);router[_0x08d8('0xf')](_0x08d8('0xb'),auth[_0x08d8('0xc')](),controller[_0x08d8('0x10')]);router[_0x08d8('0x11')](_0x08d8('0xb'),auth[_0x08d8('0xc')](),controller['destroy']);module[_0x08d8('0x12')]=router;
\ No newline at end of file
index 612a946..3f4f9d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe33f=['BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x382353,_0x1ece1e){var _0xf42fa9=function(_0x399b28){while(--_0x399b28){_0x382353['push'](_0x382353['shift']());}};_0xf42fa9(++_0x1ece1e);}(_0xe33f,0x1b1));var _0xfe33=function(_0x34b852,_0x4b2534){_0x34b852=_0x34b852-0x0;var _0x254075=_0xe33f[_0x34b852];return _0x254075;};'use strict';var Sequelize=require(_0xfe33('0x0'));module[_0xfe33('0x1')]={'type':{'type':Sequelize[_0xfe33('0x2')](_0xfe33('0x3'),_0xfe33('0x4'),_0xfe33('0x5'),_0xfe33('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0xfe33('0x7')]},'key':{'type':Sequelize[_0xfe33('0x7')]},'keyType':{'type':Sequelize[_0xfe33('0x2')](_0xfe33('0x3'),'variable',_0xfe33('0x5'))},'keyContent':{'type':Sequelize[_0xfe33('0x7')]},'idField':{'type':Sequelize[_0xfe33('0x7')]},'nameField':{'type':Sequelize[_0xfe33('0x7')]},'customField':{'type':Sequelize[_0xfe33('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfe33('0x7')]}};
\ No newline at end of file
+var _0x37da=['exports','ENUM','variable','customVariable','keyValue','picklist','string','STRING','BOOLEAN'];(function(_0x26b288,_0x109285){var _0x3f6159=function(_0x5b4a4c){while(--_0x5b4a4c){_0x26b288['push'](_0x26b288['shift']());}};_0x3f6159(++_0x109285);}(_0x37da,0x183));var _0xa37d=function(_0x3ca7c7,_0x43922f){_0x3ca7c7=_0x3ca7c7-0x0;var _0x2a4fc4=_0x37da[_0x3ca7c7];return _0x2a4fc4;};'use strict';var Sequelize=require('sequelize');module[_0xa37d('0x0')]={'type':{'type':Sequelize[_0xa37d('0x1')]('string',_0xa37d('0x2'),_0xa37d('0x3'),_0xa37d('0x4'),_0xa37d('0x5')),'defaultValue':_0xa37d('0x6')},'content':{'type':Sequelize[_0xa37d('0x7')]},'key':{'type':Sequelize[_0xa37d('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xa37d('0x6'),_0xa37d('0x2'),_0xa37d('0x3'))},'keyContent':{'type':Sequelize[_0xa37d('0x7')]},'idField':{'type':Sequelize[_0xa37d('0x7')]},'nameField':{'type':Sequelize[_0xa37d('0x7')]},'customField':{'type':Sequelize[_0xa37d('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa37d('0x7')]}};
\ No newline at end of file
index d5d1a01..88a7003 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5cdb=['catch','show','params','includeAll','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','filters','pick','filter','merge','type','VIRTUAL','options','where','SugarcrmField','include','findAll','rows'];(function(_0x5545f7,_0x570414){var _0x52a979=function(_0x28eb97){while(--_0x28eb97){_0x5545f7['push'](_0x5545f7['shift']());}};_0x52a979(++_0x570414);}(_0x5cdb,0x12f));var _0xb5cd=function(_0x141b15,_0x26f272){_0x141b15=_0x141b15-0x0;var _0x3486c9=_0x5cdb[_0x141b15];return _0x3486c9;};'use strict';var emlformat=require(_0xb5cd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb5cd('0x1'));var jsonpatch=require(_0xb5cd('0x2'));var rp=require(_0xb5cd('0x3'));var moment=require(_0xb5cd('0x4'));var BPromise=require(_0xb5cd('0x5'));var Mustache=require(_0xb5cd('0x6'));var util=require(_0xb5cd('0x7'));var path=require(_0xb5cd('0x8'));var sox=require('sox');var csv=require(_0xb5cd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb5cd('0xa'));var _=require('lodash');var squel=require(_0xb5cd('0xb'));var crypto=require(_0xb5cd('0xc'));var jsforce=require(_0xb5cd('0xd'));var deskjs=require(_0xb5cd('0xe'));var toCsv=require(_0xb5cd('0x9'));var querystring=require(_0xb5cd('0xf'));var Papa=require(_0xb5cd('0x10'));var Redis=require(_0xb5cd('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb5cd('0x12'));var as=require(_0xb5cd('0x13'));var hardwareService=require(_0xb5cd('0x14'));var logger=require(_0xb5cd('0x15'))(_0xb5cd('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb5cd('0x17'));var db=require(_0xb5cd('0x18'))['db'];function respondWithStatusCode(_0x47f7af,_0x567041){_0x567041=_0x567041||0xcc;return function(_0x2d61af){if(_0x2d61af){return _0x47f7af['sendStatus'](_0x567041);}return _0x47f7af[_0xb5cd('0x19')](_0x567041)[_0xb5cd('0x1a')]();};}function respondWithResult(_0x2e34f0,_0x27bc96){_0x27bc96=_0x27bc96||0xc8;return function(_0x260aa7){if(_0x260aa7){return _0x2e34f0[_0xb5cd('0x19')](_0x27bc96)[_0xb5cd('0x1b')](_0x260aa7);}};}function respondWithFilteredResult(_0x29d4a6,_0xa90ea7){return function(_0xf25b2f){if(_0xf25b2f){var _0x58d3b0=typeof _0xa90ea7[_0xb5cd('0x1c')]===_0xb5cd('0x1d')&&typeof _0xa90ea7[_0xb5cd('0x1e')]===_0xb5cd('0x1d');var _0x2c49f0=_0xf25b2f[_0xb5cd('0x1f')];var _0x37162c=_0x58d3b0?0x0:_0xa90ea7[_0xb5cd('0x1c')];var _0x1b49e1=_0x58d3b0?_0xf25b2f[_0xb5cd('0x1f')]:_0xa90ea7[_0xb5cd('0x1c')]+_0xa90ea7[_0xb5cd('0x1e')];var _0x1a0966;if(_0x1b49e1>=_0x2c49f0){_0x1b49e1=_0x2c49f0;_0x1a0966=0xc8;}else{_0x1a0966=0xce;}_0x29d4a6['status'](_0x1a0966);return _0x29d4a6[_0xb5cd('0x20')](_0xb5cd('0x21'),_0x37162c+'-'+_0x1b49e1+'/'+_0x2c49f0)['json'](_0xf25b2f);}return null;};}function patchUpdates(_0x2cdbe2){return function(_0x263bcf){try{jsonpatch[_0xb5cd('0x22')](_0x263bcf,_0x2cdbe2,!![]);}catch(_0x550094){return BPromise[_0xb5cd('0x23')](_0x550094);}return _0x263bcf[_0xb5cd('0x24')]();};}function saveUpdates(_0x27c8f4,_0x202d68){return function(_0x1e1170){if(_0x1e1170){return _0x1e1170[_0xb5cd('0x25')](_0x27c8f4)[_0xb5cd('0x26')](function(_0x4bc86a){return _0x4bc86a;});}return null;};}function removeEntity(_0x1696b4,_0x126ccb){return function(_0x3cf7f8){if(_0x3cf7f8){return _0x3cf7f8[_0xb5cd('0x27')]()[_0xb5cd('0x26')](function(){_0x1696b4[_0xb5cd('0x19')](0xcc)[_0xb5cd('0x1a')]();});}};}function handleEntityNotFound(_0xf03e5b,_0xdb8e46){return function(_0x226724){if(!_0x226724){_0xf03e5b[_0xb5cd('0x28')](0x194);}return _0x226724;};}function handleError(_0x4e4dbb,_0x848776){_0x848776=_0x848776||0x1f4;return function(_0x2b1d06){logger[_0xb5cd('0x29')](_0x2b1d06[_0xb5cd('0x2a')]);if(_0x2b1d06['name']){delete _0x2b1d06[_0xb5cd('0x2b')];}_0x4e4dbb[_0xb5cd('0x19')](_0x848776)['send'](_0x2b1d06);};}exports[_0xb5cd('0x2c')]=function(_0x18ff66,_0x13330b){var _0x5585a1={},_0x29dc2c={},_0x3f8a22={'count':0x0,'rows':[]};var _0x1de15f=_[_0xb5cd('0x2d')](db['SugarcrmField'][_0xb5cd('0x2e')],function(_0x3ade4c){return{'name':_0x3ade4c['fieldName'],'type':_0x3ade4c['type'][_0xb5cd('0x2f')]};});_0x29dc2c[_0xb5cd('0x30')]=_[_0xb5cd('0x2d')](_0x1de15f,_0xb5cd('0x2b'));_0x29dc2c[_0xb5cd('0x31')]=_[_0xb5cd('0x32')](_0x18ff66[_0xb5cd('0x31')]);_0x29dc2c['filters']=_[_0xb5cd('0x33')](_0x29dc2c[_0xb5cd('0x30')],_0x29dc2c[_0xb5cd('0x31')]);_0x5585a1[_0xb5cd('0x34')]=_[_0xb5cd('0x33')](_0x29dc2c[_0xb5cd('0x30')],qs[_0xb5cd('0x35')](_0x18ff66[_0xb5cd('0x31')]['fields']));_0x5585a1[_0xb5cd('0x34')]=_0x5585a1[_0xb5cd('0x34')][_0xb5cd('0x36')]?_0x5585a1[_0xb5cd('0x34')]:_0x29dc2c[_0xb5cd('0x30')];if(!_0x18ff66['query']['hasOwnProperty']('nolimit')){_0x5585a1[_0xb5cd('0x1e')]=qs[_0xb5cd('0x1e')](_0x18ff66[_0xb5cd('0x31')]['limit']);_0x5585a1[_0xb5cd('0x1c')]=qs[_0xb5cd('0x1c')](_0x18ff66[_0xb5cd('0x31')][_0xb5cd('0x1c')]);}_0x5585a1['order']=qs['sort'](_0x18ff66['query']['sort']);_0x5585a1['where']=qs[_0xb5cd('0x37')](_[_0xb5cd('0x38')](_0x18ff66[_0xb5cd('0x31')],_0x29dc2c['filters']),_0x1de15f);if(_0x18ff66[_0xb5cd('0x31')][_0xb5cd('0x39')]){_0x5585a1['where']=_[_0xb5cd('0x3a')](_0x5585a1['where'],{'$or':_['map'](_0x1de15f,function(_0x45ddda){if(_0x45ddda[_0xb5cd('0x3b')]!==_0xb5cd('0x3c')){var _0x22d55f={};_0x22d55f[_0x45ddda['name']]={'$like':'%'+_0x18ff66[_0xb5cd('0x31')][_0xb5cd('0x39')]+'%'};return _0x22d55f;}})});}_0x5585a1=_[_0xb5cd('0x3a')]({},_0x5585a1,_0x18ff66[_0xb5cd('0x3d')]);var _0x549bd3={'where':_0x5585a1[_0xb5cd('0x3e')]};return db[_0xb5cd('0x3f')]['count'](_0x549bd3)[_0xb5cd('0x26')](function(_0x254a6b){_0x3f8a22[_0xb5cd('0x1f')]=_0x254a6b;if(_0x18ff66[_0xb5cd('0x31')]['includeAll']){_0x5585a1[_0xb5cd('0x40')]=[{'all':!![]}];}return db[_0xb5cd('0x3f')][_0xb5cd('0x41')](_0x5585a1);})[_0xb5cd('0x26')](function(_0x3810f2){_0x3f8a22[_0xb5cd('0x42')]=_0x3810f2;return _0x3f8a22;})[_0xb5cd('0x26')](respondWithFilteredResult(_0x13330b,_0x5585a1))[_0xb5cd('0x43')](handleError(_0x13330b,null));};exports[_0xb5cd('0x44')]=function(_0x478aef,_0x4b959a){var _0x431962={'raw':!![],'where':{'id':_0x478aef[_0xb5cd('0x45')]['id']}},_0x239f41={};_0x239f41[_0xb5cd('0x30')]=_[_0xb5cd('0x32')](db[_0xb5cd('0x3f')]['rawAttributes']);_0x239f41[_0xb5cd('0x31')]=_['keys'](_0x478aef[_0xb5cd('0x31')]);_0x239f41[_0xb5cd('0x37')]=_[_0xb5cd('0x33')](_0x239f41['model'],_0x239f41[_0xb5cd('0x31')]);_0x431962[_0xb5cd('0x34')]=_['intersection'](_0x239f41['model'],qs['fields'](_0x478aef[_0xb5cd('0x31')]['fields']));_0x431962['attributes']=_0x431962[_0xb5cd('0x34')][_0xb5cd('0x36')]?_0x431962[_0xb5cd('0x34')]:_0x239f41[_0xb5cd('0x30')];if(_0x478aef[_0xb5cd('0x31')][_0xb5cd('0x46')]){_0x431962['include']=[{'all':!![]}];}_0x431962=_[_0xb5cd('0x3a')]({},_0x431962,_0x478aef[_0xb5cd('0x3d')]);return db[_0xb5cd('0x3f')][_0xb5cd('0x47')](_0x431962)[_0xb5cd('0x26')](handleEntityNotFound(_0x4b959a,null))[_0xb5cd('0x26')](respondWithResult(_0x4b959a,null))[_0xb5cd('0x43')](handleError(_0x4b959a,null));};exports[_0xb5cd('0x48')]=function(_0x5e352d,_0x42c669){return db[_0xb5cd('0x3f')][_0xb5cd('0x48')](_0x5e352d['body'],{})[_0xb5cd('0x26')](respondWithResult(_0x42c669,0xc9))[_0xb5cd('0x43')](handleError(_0x42c669,null));};exports[_0xb5cd('0x25')]=function(_0x5e099f,_0x4e72a1){if(_0x5e099f[_0xb5cd('0x49')]['id']){delete _0x5e099f[_0xb5cd('0x49')]['id'];}return db['SugarcrmField'][_0xb5cd('0x47')]({'where':{'id':_0x5e099f['params']['id']}})[_0xb5cd('0x26')](handleEntityNotFound(_0x4e72a1,null))[_0xb5cd('0x26')](saveUpdates(_0x5e099f[_0xb5cd('0x49')],null))[_0xb5cd('0x26')](respondWithResult(_0x4e72a1,null))[_0xb5cd('0x43')](handleError(_0x4e72a1,null));};exports[_0xb5cd('0x27')]=function(_0x2d7dc7,_0x500d9a){return db['SugarcrmField'][_0xb5cd('0x47')]({'where':{'id':_0x2d7dc7[_0xb5cd('0x45')]['id']}})[_0xb5cd('0x26')](handleEntityNotFound(_0x500d9a,null))[_0xb5cd('0x26')](removeEntity(_0x500d9a,null))[_0xb5cd('0x43')](handleError(_0x500d9a,null));};
\ No newline at end of file
+var _0x51ab=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','SugarcrmField','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','findAll','rows','catch','show','params','rawAttributes','include','options','find','create','body','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x381b3e,_0x28c37a){var _0x4d0e65=function(_0x45bf84){while(--_0x45bf84){_0x381b3e['push'](_0x381b3e['shift']());}};_0x4d0e65(++_0x28c37a);}(_0x51ab,0xcd));var _0xb51a=function(_0x19f002,_0x56d27c){_0x19f002=_0x19f002-0x0;var _0x1c195e=_0x51ab[_0x19f002];return _0x1c195e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb51a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb51a('0x1'));var rp=require('request-promise');var moment=require(_0xb51a('0x2'));var BPromise=require(_0xb51a('0x3'));var Mustache=require(_0xb51a('0x4'));var util=require(_0xb51a('0x5'));var path=require(_0xb51a('0x6'));var sox=require(_0xb51a('0x7'));var csv=require(_0xb51a('0x8'));var ejs=require(_0xb51a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb51a('0xa'));var squel=require(_0xb51a('0xb'));var crypto=require(_0xb51a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb51a('0xd'));var toCsv=require(_0xb51a('0x8'));var querystring=require(_0xb51a('0xe'));var Papa=require(_0xb51a('0xf'));var Redis=require(_0xb51a('0x10'));var authService=require(_0xb51a('0x11'));var qs=require(_0xb51a('0x12'));var as=require(_0xb51a('0x13'));var hardwareService=require(_0xb51a('0x14'));var logger=require(_0xb51a('0x15'))(_0xb51a('0x16'));var utils=require(_0xb51a('0x17'));var config=require(_0xb51a('0x18'));var licenseUtil=require(_0xb51a('0x19'));var db=require(_0xb51a('0x1a'))['db'];function respondWithStatusCode(_0x1e9a0b,_0x339724){_0x339724=_0x339724||0xcc;return function(_0x4910d4){if(_0x4910d4){return _0x1e9a0b[_0xb51a('0x1b')](_0x339724);}return _0x1e9a0b[_0xb51a('0x1c')](_0x339724)[_0xb51a('0x1d')]();};}function respondWithResult(_0x1a59b7,_0x46b9b8){_0x46b9b8=_0x46b9b8||0xc8;return function(_0x434813){if(_0x434813){return _0x1a59b7[_0xb51a('0x1c')](_0x46b9b8)[_0xb51a('0x1e')](_0x434813);}};}function respondWithFilteredResult(_0x532e9f,_0x52bcf8){return function(_0x36556f){if(_0x36556f){var _0x218fc3=typeof _0x52bcf8[_0xb51a('0x1f')]===_0xb51a('0x20')&&typeof _0x52bcf8['limit']===_0xb51a('0x20');var _0x288368=_0x36556f[_0xb51a('0x21')];var _0x47b2fd=_0x218fc3?0x0:_0x52bcf8[_0xb51a('0x1f')];var _0x5d2e6d=_0x218fc3?_0x36556f[_0xb51a('0x21')]:_0x52bcf8[_0xb51a('0x1f')]+_0x52bcf8[_0xb51a('0x22')];var _0x30237f;if(_0x5d2e6d>=_0x288368){_0x5d2e6d=_0x288368;_0x30237f=0xc8;}else{_0x30237f=0xce;}_0x532e9f[_0xb51a('0x1c')](_0x30237f);return _0x532e9f['set'](_0xb51a('0x23'),_0x47b2fd+'-'+_0x5d2e6d+'/'+_0x288368)[_0xb51a('0x1e')](_0x36556f);}return null;};}function patchUpdates(_0x2918dc){return function(_0x5cde7e){try{jsonpatch[_0xb51a('0x24')](_0x5cde7e,_0x2918dc,!![]);}catch(_0x2a1055){return BPromise[_0xb51a('0x25')](_0x2a1055);}return _0x5cde7e[_0xb51a('0x26')]();};}function saveUpdates(_0x1f4c93,_0x4006dc){return function(_0x156410){if(_0x156410){return _0x156410[_0xb51a('0x27')](_0x1f4c93)[_0xb51a('0x28')](function(_0x9fbb92){return _0x9fbb92;});}return null;};}function removeEntity(_0x2d169d,_0x1dba79){return function(_0x221f6a){if(_0x221f6a){return _0x221f6a[_0xb51a('0x29')]()[_0xb51a('0x28')](function(){_0x2d169d['status'](0xcc)[_0xb51a('0x1d')]();});}};}function handleEntityNotFound(_0x3ab5e4,_0x3db963){return function(_0x2790fc){if(!_0x2790fc){_0x3ab5e4[_0xb51a('0x1b')](0x194);}return _0x2790fc;};}function handleError(_0x17f7ae,_0x3e66a3){_0x3e66a3=_0x3e66a3||0x1f4;return function(_0x3d0382){logger[_0xb51a('0x2a')](_0x3d0382['stack']);if(_0x3d0382[_0xb51a('0x2b')]){delete _0x3d0382[_0xb51a('0x2b')];}_0x17f7ae[_0xb51a('0x1c')](_0x3e66a3)['send'](_0x3d0382);};}exports[_0xb51a('0x2c')]=function(_0x30976d,_0x58aba7){var _0x1f0d0d={},_0x280a00={},_0x302db6={'count':0x0,'rows':[]};var _0x113452=_[_0xb51a('0x2d')](db[_0xb51a('0x2e')]['rawAttributes'],function(_0x365ec1){return{'name':_0x365ec1[_0xb51a('0x2f')],'type':_0x365ec1[_0xb51a('0x30')]['key']};});_0x280a00[_0xb51a('0x31')]=_['map'](_0x113452,_0xb51a('0x2b'));_0x280a00[_0xb51a('0x32')]=_[_0xb51a('0x33')](_0x30976d[_0xb51a('0x32')]);_0x280a00[_0xb51a('0x34')]=_['intersection'](_0x280a00[_0xb51a('0x31')],_0x280a00[_0xb51a('0x32')]);_0x1f0d0d[_0xb51a('0x35')]=_[_0xb51a('0x36')](_0x280a00[_0xb51a('0x31')],qs['fields'](_0x30976d[_0xb51a('0x32')][_0xb51a('0x37')]));_0x1f0d0d['attributes']=_0x1f0d0d[_0xb51a('0x35')][_0xb51a('0x38')]?_0x1f0d0d[_0xb51a('0x35')]:_0x280a00['model'];if(!_0x30976d[_0xb51a('0x32')][_0xb51a('0x39')](_0xb51a('0x3a'))){_0x1f0d0d[_0xb51a('0x22')]=qs[_0xb51a('0x22')](_0x30976d['query']['limit']);_0x1f0d0d[_0xb51a('0x1f')]=qs[_0xb51a('0x1f')](_0x30976d[_0xb51a('0x32')][_0xb51a('0x1f')]);}_0x1f0d0d[_0xb51a('0x3b')]=qs['sort'](_0x30976d['query'][_0xb51a('0x3c')]);_0x1f0d0d[_0xb51a('0x3d')]=qs[_0xb51a('0x34')](_['pick'](_0x30976d[_0xb51a('0x32')],_0x280a00['filters']),_0x113452);if(_0x30976d['query'][_0xb51a('0x3e')]){_0x1f0d0d[_0xb51a('0x3d')]=_[_0xb51a('0x3f')](_0x1f0d0d['where'],{'$or':_[_0xb51a('0x2d')](_0x113452,function(_0x5ed123){if(_0x5ed123[_0xb51a('0x30')]!==_0xb51a('0x40')){var _0x2583fb={};_0x2583fb[_0x5ed123[_0xb51a('0x2b')]]={'$like':'%'+_0x30976d[_0xb51a('0x32')]['filter']+'%'};return _0x2583fb;}})});}_0x1f0d0d=_[_0xb51a('0x3f')]({},_0x1f0d0d,_0x30976d['options']);var _0x4d9992={'where':_0x1f0d0d[_0xb51a('0x3d')]};return db[_0xb51a('0x2e')]['count'](_0x4d9992)[_0xb51a('0x28')](function(_0x338b3d){_0x302db6[_0xb51a('0x21')]=_0x338b3d;if(_0x30976d[_0xb51a('0x32')]['includeAll']){_0x1f0d0d['include']=[{'all':!![]}];}return db[_0xb51a('0x2e')][_0xb51a('0x41')](_0x1f0d0d);})[_0xb51a('0x28')](function(_0xaf91d6){_0x302db6[_0xb51a('0x42')]=_0xaf91d6;return _0x302db6;})['then'](respondWithFilteredResult(_0x58aba7,_0x1f0d0d))[_0xb51a('0x43')](handleError(_0x58aba7,null));};exports[_0xb51a('0x44')]=function(_0x37bd44,_0xedc759){var _0x170d34={'raw':!![],'where':{'id':_0x37bd44[_0xb51a('0x45')]['id']}},_0x448fd9={};_0x448fd9['model']=_[_0xb51a('0x33')](db[_0xb51a('0x2e')][_0xb51a('0x46')]);_0x448fd9[_0xb51a('0x32')]=_['keys'](_0x37bd44['query']);_0x448fd9['filters']=_[_0xb51a('0x36')](_0x448fd9[_0xb51a('0x31')],_0x448fd9[_0xb51a('0x32')]);_0x170d34['attributes']=_[_0xb51a('0x36')](_0x448fd9[_0xb51a('0x31')],qs[_0xb51a('0x37')](_0x37bd44[_0xb51a('0x32')][_0xb51a('0x37')]));_0x170d34[_0xb51a('0x35')]=_0x170d34[_0xb51a('0x35')][_0xb51a('0x38')]?_0x170d34['attributes']:_0x448fd9[_0xb51a('0x31')];if(_0x37bd44[_0xb51a('0x32')]['includeAll']){_0x170d34[_0xb51a('0x47')]=[{'all':!![]}];}_0x170d34=_[_0xb51a('0x3f')]({},_0x170d34,_0x37bd44[_0xb51a('0x48')]);return db[_0xb51a('0x2e')][_0xb51a('0x49')](_0x170d34)[_0xb51a('0x28')](handleEntityNotFound(_0xedc759,null))[_0xb51a('0x28')](respondWithResult(_0xedc759,null))[_0xb51a('0x43')](handleError(_0xedc759,null));};exports['create']=function(_0x5b35e5,_0x325f9a){return db[_0xb51a('0x2e')][_0xb51a('0x4a')](_0x5b35e5['body'],{})[_0xb51a('0x28')](respondWithResult(_0x325f9a,0xc9))[_0xb51a('0x43')](handleError(_0x325f9a,null));};exports['update']=function(_0x1d4e94,_0x66bcbd){if(_0x1d4e94['body']['id']){delete _0x1d4e94[_0xb51a('0x4b')]['id'];}return db[_0xb51a('0x2e')]['find']({'where':{'id':_0x1d4e94[_0xb51a('0x45')]['id']}})[_0xb51a('0x28')](handleEntityNotFound(_0x66bcbd,null))[_0xb51a('0x28')](saveUpdates(_0x1d4e94[_0xb51a('0x4b')],null))[_0xb51a('0x28')](respondWithResult(_0x66bcbd,null))[_0xb51a('0x43')](handleError(_0x66bcbd,null));};exports['destroy']=function(_0x2d2a93,_0x272319){return db[_0xb51a('0x2e')][_0xb51a('0x49')]({'where':{'id':_0x2d2a93[_0xb51a('0x45')]['id']}})[_0xb51a('0x28')](handleEntityNotFound(_0x272319,null))[_0xb51a('0x28')](removeEntity(_0x272319,null))[_0xb51a('0x43')](handleError(_0x272319,null));};
\ No newline at end of file
index b8d2464..40ecd12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa574=['int_sugarcrm_fields','sugarcrm_unique_index','idField','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField'];(function(_0x5766ed,_0x2fa1eb){var _0x36ee69=function(_0x1e18e5){while(--_0x1e18e5){_0x5766ed['push'](_0x5766ed['shift']());}};_0x36ee69(++_0x2fa1eb);}(_0xa574,0x1a7));var _0x4a57=function(_0x271b2a,_0xcd5e52){_0x271b2a=_0x271b2a-0x0;var _0x332785=_0xa574[_0x271b2a];return _0x332785;};'use strict';var _=require('lodash');var util=require(_0x4a57('0x0'));var logger=require(_0x4a57('0x1'))('api');var moment=require(_0x4a57('0x2'));var BPromise=require(_0x4a57('0x3'));var rp=require(_0x4a57('0x4'));var fs=require('fs');var path=require(_0x4a57('0x5'));var rimraf=require(_0x4a57('0x6'));var config=require(_0x4a57('0x7'));var attributes=require(_0x4a57('0x8'));module[_0x4a57('0x9')]=function(_0x53fd44,_0x581838){return _0x53fd44[_0x4a57('0xa')](_0x4a57('0xb'),attributes,{'tableName':_0x4a57('0xc'),'paranoid':![],'indexes':[{'name':_0x4a57('0xd'),'fields':[_0x4a57('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8e64=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','define','SugarcrmField','int_sugarcrm_fields','FieldId'];(function(_0xe76e64,_0x5a3ca5){var _0x70077a=function(_0x34ba8b){while(--_0x34ba8b){_0xe76e64['push'](_0xe76e64['shift']());}};_0x70077a(++_0x5a3ca5);}(_0x8e64,0x87));var _0x48e6=function(_0x3aa108,_0xd6eea9){_0x3aa108=_0x3aa108-0x0;var _0x37a6e1=_0x8e64[_0x3aa108];return _0x37a6e1;};'use strict';var _=require(_0x48e6('0x0'));var util=require(_0x48e6('0x1'));var logger=require(_0x48e6('0x2'))(_0x48e6('0x3'));var moment=require(_0x48e6('0x4'));var BPromise=require(_0x48e6('0x5'));var rp=require(_0x48e6('0x6'));var fs=require('fs');var path=require(_0x48e6('0x7'));var rimraf=require(_0x48e6('0x8'));var config=require(_0x48e6('0x9'));var attributes=require(_0x48e6('0xa'));module['exports']=function(_0x32800e,_0x8283ac){return _0x32800e[_0x48e6('0xb')](_0x48e6('0xc'),attributes,{'tableName':_0x48e6('0xd'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField',_0x48e6('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index ee9ad6c..7fb226d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11ba=['bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment'];(function(_0x4744cb,_0x398865){var _0x1e4370=function(_0x5b3d39){while(--_0x5b3d39){_0x4744cb['push'](_0x4744cb['shift']());}};_0x1e4370(++_0x398865);}(_0x11ba,0xed));var _0xa11b=function(_0x5a2272,_0x213cbf){_0x5a2272=_0x5a2272-0x0;var _0x2c8c62=_0x11ba[_0x5a2272];return _0x2c8c62;};'use strict';var _=require(_0xa11b('0x0'));var util=require(_0xa11b('0x1'));var moment=require(_0xa11b('0x2'));var BPromise=require(_0xa11b('0x3'));var rs=require(_0xa11b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa11b('0x5'));var logger=require('../../config/logger')(_0xa11b('0x6'));var config=require(_0xa11b('0x7'));var jayson=require(_0xa11b('0x8'));var client=jayson[_0xa11b('0x9')][_0xa11b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d68a2,_0x114606,_0x4ddeb0){return new BPromise(function(_0x1b3103,_0x1752e0){return client['request'](_0x1d68a2,_0x4ddeb0)['then'](function(_0x2e6666){logger[_0xa11b('0xb')](_0xa11b('0xc'),_0x114606,_0xa11b('0xd'));logger[_0xa11b('0xe')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x114606,_0xa11b('0xd'),JSON['stringify'](_0x2e6666));if(_0x2e6666[_0xa11b('0xf')]){if(_0x2e6666[_0xa11b('0xf')][_0xa11b('0x10')]===0x1f4){logger[_0xa11b('0xf')](_0xa11b('0xc'),_0x114606,_0x2e6666[_0xa11b('0xf')][_0xa11b('0x11')]);return _0x1752e0(_0x2e6666['error']['message']);}logger[_0xa11b('0xf')](_0xa11b('0xc'),_0x114606,_0x2e6666[_0xa11b('0xf')][_0xa11b('0x11')]);return _0x1b3103(_0x2e6666[_0xa11b('0xf')][_0xa11b('0x11')]);}else{logger['info'](_0xa11b('0xc'),_0x114606,_0xa11b('0xd'));_0x1b3103(_0x2e6666[_0xa11b('0x12')][_0xa11b('0x11')]);}})[_0xa11b('0x13')](function(_0x2e84b5){logger[_0xa11b('0xf')](_0xa11b('0xc'),_0x114606,_0x2e84b5);_0x1752e0(_0x2e84b5);});});}
\ No newline at end of file
+var _0xb3f8=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','message','SugarcrmField,\x20%s,\x20%s','result','catch','lodash','util'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xb3f8,0x157));var _0x8b3f=function(_0x2bc3f4,_0x470b26){_0x2bc3f4=_0x2bc3f4-0x0;var _0x14ac53=_0xb3f8[_0x2bc3f4];return _0x14ac53;};'use strict';var _=require(_0x8b3f('0x0'));var util=require(_0x8b3f('0x1'));var moment=require(_0x8b3f('0x2'));var BPromise=require(_0x8b3f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b3f('0x4'));var db=require(_0x8b3f('0x5'))['db'];var utils=require(_0x8b3f('0x6'));var logger=require(_0x8b3f('0x7'))('rpc');var config=require(_0x8b3f('0x8'));var jayson=require(_0x8b3f('0x9'));var client=jayson[_0x8b3f('0xa')][_0x8b3f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e600f,_0x2ca4fe,_0x5c9ff3){return new BPromise(function(_0x40db8b,_0x5e4059){return client[_0x8b3f('0xc')](_0x4e600f,_0x5c9ff3)[_0x8b3f('0xd')](function(_0x45a959){logger[_0x8b3f('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x2ca4fe,_0x8b3f('0xf'));logger[_0x8b3f('0x10')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x2ca4fe,_0x8b3f('0xf'),JSON[_0x8b3f('0x11')](_0x45a959));if(_0x45a959[_0x8b3f('0x12')]){if(_0x45a959[_0x8b3f('0x12')]['code']===0x1f4){logger['error']('SugarcrmField,\x20%s,\x20%s',_0x2ca4fe,_0x45a959[_0x8b3f('0x12')]['message']);return _0x5e4059(_0x45a959[_0x8b3f('0x12')][_0x8b3f('0x13')]);}logger[_0x8b3f('0x12')](_0x8b3f('0x14'),_0x2ca4fe,_0x45a959['error'][_0x8b3f('0x13')]);return _0x40db8b(_0x45a959[_0x8b3f('0x12')]['message']);}else{logger[_0x8b3f('0xe')](_0x8b3f('0x14'),_0x2ca4fe,'request\x20sent');_0x40db8b(_0x45a959[_0x8b3f('0x15')][_0x8b3f('0x13')]);}})[_0x8b3f('0x16')](function(_0x133a81){logger[_0x8b3f('0x12')](_0x8b3f('0x14'),_0x2ca4fe,_0x133a81);_0x5e4059(_0x133a81);});});}
\ No newline at end of file
index 880e515..eea3fcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6475=['getFields','post','addConfiguration','put','update','delete','/:id','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','show','get','/:id/configurations','/:id/fields'];(function(_0x15bbf1,_0x40ef96){var _0x5c4b47=function(_0x303b4f){while(--_0x303b4f){_0x15bbf1['push'](_0x15bbf1['shift']());}};_0x5c4b47(++_0x40ef96);}(_0x6475,0x133));var _0x5647=function(_0x5111a9,_0x353fa5){_0x5111a9=_0x5111a9-0x0;var _0x59a15a=_0x6475[_0x5111a9];return _0x59a15a;};'use strict';var multer=require(_0x5647('0x0'));var util=require(_0x5647('0x1'));var path=require(_0x5647('0x2'));var timeout=require('connect-timeout');var express=require(_0x5647('0x3'));var router=express[_0x5647('0x4')]();var fs_extra=require(_0x5647('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5647('0x6'));var config=require(_0x5647('0x7'));var controller=require(_0x5647('0x8'));router['get']('/',auth[_0x5647('0x9')](),controller[_0x5647('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x5647('0xb')]);router[_0x5647('0xc')](_0x5647('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x5647('0xc')](_0x5647('0xe'),auth[_0x5647('0x9')](),controller[_0x5647('0xf')]);router[_0x5647('0x10')]('/',auth[_0x5647('0x9')](),controller['create']);router[_0x5647('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x5647('0x11')]);router[_0x5647('0x12')]('/:id',auth[_0x5647('0x9')](),controller[_0x5647('0x13')]);router[_0x5647('0x14')](_0x5647('0x15'),auth[_0x5647('0x9')](),controller['destroy']);module[_0x5647('0x16')]=router;
\ No newline at end of file
+var _0x58e9=['index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x5eb1c1,_0x27fd74){var _0x27fd1c=function(_0x4e1956){while(--_0x4e1956){_0x5eb1c1['push'](_0x5eb1c1['shift']());}};_0x27fd1c(++_0x27fd74);}(_0x58e9,0x15e));var _0x958e=function(_0x1d3f11,_0x411d91){_0x1d3f11=_0x1d3f11-0x0;var _0x391a96=_0x58e9[_0x1d3f11];return _0x391a96;};'use strict';var multer=require(_0x958e('0x0'));var util=require(_0x958e('0x1'));var path=require('path');var timeout=require(_0x958e('0x2'));var express=require('express');var router=express[_0x958e('0x3')]();var fs_extra=require(_0x958e('0x4'));var auth=require(_0x958e('0x5'));var interaction=require(_0x958e('0x6'));var config=require(_0x958e('0x7'));var controller=require('./intVtigerAccount.controller');router[_0x958e('0x8')]('/',auth[_0x958e('0x9')](),controller[_0x958e('0xa')]);router['get'](_0x958e('0xb'),auth[_0x958e('0x9')](),controller[_0x958e('0xc')]);router[_0x958e('0x8')](_0x958e('0xd'),auth[_0x958e('0x9')](),controller[_0x958e('0xe')]);router[_0x958e('0x8')](_0x958e('0xf'),auth[_0x958e('0x9')](),controller[_0x958e('0x10')]);router[_0x958e('0x11')]('/',auth[_0x958e('0x9')](),controller[_0x958e('0x12')]);router[_0x958e('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x958e('0x13')]);router[_0x958e('0x14')](_0x958e('0xb'),auth[_0x958e('0x9')](),controller[_0x958e('0x15')]);router[_0x958e('0x16')](_0x958e('0xb'),auth[_0x958e('0x9')](),controller['destroy']);module[_0x958e('0x17')]=router;
\ No newline at end of file
index 9ad79ab..1280d4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1213=['HelpDesk','sequelize','STRING'];(function(_0xf0f87,_0x10c0ef){var _0x48623e=function(_0x2751be){while(--_0x2751be){_0xf0f87['push'](_0xf0f87['shift']());}};_0x48623e(++_0x10c0ef);}(_0x1213,0x14e));var _0x3121=function(_0x328b1c,_0xec0b4f){_0x328b1c=_0x328b1c-0x0;var _0x4dbeaa=_0x1213[_0x328b1c];return _0x4dbeaa;};'use strict';var Sequelize=require(_0x3121('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x3121('0x1')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3121('0x2')},'remoteUri':{'type':Sequelize[_0x3121('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x3121('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0x9def=['exports','STRING','HelpDesk','sequelize'];(function(_0xcedf57,_0x335b10){var _0x35eccf=function(_0x3d5d5f){while(--_0x3d5d5f){_0xcedf57['push'](_0xcedf57['shift']());}};_0x35eccf(++_0x335b10);}(_0x9def,0x6b));var _0xf9de=function(_0x2845f0,_0x233f02){_0x2845f0=_0x2845f0-0x0;var _0x24e301=_0x9def[_0x2845f0];return _0x24e301;};'use strict';var Sequelize=require(_0xf9de('0x0'));module[_0xf9de('0x1')]={'name':{'type':Sequelize[_0xf9de('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf9de('0x2')]},'username':{'type':Sequelize[_0xf9de('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xf9de('0x2')],'allowNull':![],'defaultValue':_0xf9de('0x3')},'remoteUri':{'type':Sequelize[_0xf9de('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xf9de('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
index fb80b79..b2bf11f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1f0=['name','send','index','map','VtigerAccount','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','lastIndexOf','success','POST','login','result','describe','reference','owner','remove','includes','false','startsWith','cf_','picklistValues','label','value','log','vTiger\x20error:\x20','test','statusCode','Wrong\x20credentials','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack'];(function(_0x1ea7d,_0x1514c2){var _0x43b911=function(_0x4b582d){while(--_0x4b582d){_0x1ea7d['push'](_0x1ea7d['shift']());}};_0x43b911(++_0x1514c2);}(_0xa1f0,0x13c));var _0x0a1f=function(_0x5a1a91,_0x51f4d4){_0x5a1a91=_0x5a1a91-0x0;var _0x3b3d66=_0xa1f0[_0x5a1a91];return _0x3b3d66;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0a1f('0x0'));var rp=require(_0x0a1f('0x1'));var moment=require(_0x0a1f('0x2'));var BPromise=require(_0x0a1f('0x3'));var Mustache=require(_0x0a1f('0x4'));var util=require('util');var path=require(_0x0a1f('0x5'));var sox=require(_0x0a1f('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a1f('0x7'));var _=require(_0x0a1f('0x8'));var squel=require(_0x0a1f('0x9'));var crypto=require(_0x0a1f('0xa'));var jsforce=require(_0x0a1f('0xb'));var deskjs=require(_0x0a1f('0xc'));var toCsv=require(_0x0a1f('0xd'));var querystring=require(_0x0a1f('0xe'));var Papa=require('papaparse');var Redis=require(_0x0a1f('0xf'));var authService=require(_0x0a1f('0x10'));var qs=require(_0x0a1f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0a1f('0x12'));var logger=require(_0x0a1f('0x13'))('api');var utils=require(_0x0a1f('0x14'));var config=require(_0x0a1f('0x15'));var licenseUtil=require(_0x0a1f('0x16'));var db=require(_0x0a1f('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x137315,_0x4fa939){_0x4fa939=_0x4fa939||0xcc;return function(_0x2ec222){if(_0x2ec222){return _0x137315['sendStatus'](_0x4fa939);}return _0x137315[_0x0a1f('0x18')](_0x4fa939)[_0x0a1f('0x19')]();};}function respondWithResult(_0x27e3bd,_0x374b89){_0x374b89=_0x374b89||0xc8;return function(_0x5e64ca){if(_0x5e64ca){return _0x27e3bd[_0x0a1f('0x18')](_0x374b89)[_0x0a1f('0x1a')](_0x5e64ca);}};}function respondWithFilteredResult(_0x3b79f6,_0x2d77f5){return function(_0x3a3932){if(_0x3a3932){var _0x31ca75=typeof _0x2d77f5[_0x0a1f('0x1b')]==='undefined'&&typeof _0x2d77f5['limit']===_0x0a1f('0x1c');var _0x407af7=_0x3a3932[_0x0a1f('0x1d')];var _0x33610d=_0x31ca75?0x0:_0x2d77f5[_0x0a1f('0x1b')];var _0x385912=_0x31ca75?_0x3a3932['count']:_0x2d77f5['offset']+_0x2d77f5['limit'];var _0x5afb2b;if(_0x385912>=_0x407af7){_0x385912=_0x407af7;_0x5afb2b=0xc8;}else{_0x5afb2b=0xce;}_0x3b79f6[_0x0a1f('0x18')](_0x5afb2b);return _0x3b79f6[_0x0a1f('0x1e')](_0x0a1f('0x1f'),_0x33610d+'-'+_0x385912+'/'+_0x407af7)[_0x0a1f('0x1a')](_0x3a3932);}return null;};}function patchUpdates(_0x371c6b){return function(_0x3ad333){try{jsonpatch[_0x0a1f('0x20')](_0x3ad333,_0x371c6b,!![]);}catch(_0x49b56a){return BPromise[_0x0a1f('0x21')](_0x49b56a);}return _0x3ad333[_0x0a1f('0x22')]();};}function saveUpdates(_0x5888d1,_0xb4d650){return function(_0xe77d62){if(_0xe77d62){return _0xe77d62[_0x0a1f('0x23')](_0x5888d1)[_0x0a1f('0x24')](function(_0x255e32){return _0x255e32;});}return null;};}function removeEntity(_0x27065f,_0x4e2d39){return function(_0x1d2d2f){if(_0x1d2d2f){return _0x1d2d2f[_0x0a1f('0x25')]()['then'](function(){_0x27065f[_0x0a1f('0x18')](0xcc)[_0x0a1f('0x19')]();});}};}function handleEntityNotFound(_0x817d5,_0x1f48a2){return function(_0x17d258){if(!_0x17d258){_0x817d5[_0x0a1f('0x26')](0x194);}return _0x17d258;};}function handleError(_0x57a421,_0xc16f){_0xc16f=_0xc16f||0x1f4;return function(_0x55f08d){logger[_0x0a1f('0x27')](_0x55f08d[_0x0a1f('0x28')]);if(_0x55f08d[_0x0a1f('0x29')]){delete _0x55f08d['name'];}_0x57a421['status'](_0xc16f)[_0x0a1f('0x2a')](_0x55f08d);};}exports[_0x0a1f('0x2b')]=function(_0x91aeeb,_0x72e43f){var _0x3eb176={},_0x52f4a1={},_0x47cc26={'count':0x0,'rows':[]};var _0x4b509d=_[_0x0a1f('0x2c')](db[_0x0a1f('0x2d')][_0x0a1f('0x2e')],function(_0x1fe1b7){return{'name':_0x1fe1b7[_0x0a1f('0x2f')],'type':_0x1fe1b7['type'][_0x0a1f('0x30')]};});_0x52f4a1['model']=_['map'](_0x4b509d,'name');_0x52f4a1[_0x0a1f('0x31')]=_[_0x0a1f('0x32')](_0x91aeeb[_0x0a1f('0x31')]);_0x52f4a1[_0x0a1f('0x33')]=_[_0x0a1f('0x34')](_0x52f4a1[_0x0a1f('0x35')],_0x52f4a1[_0x0a1f('0x31')]);_0x3eb176['attributes']=_[_0x0a1f('0x34')](_0x52f4a1['model'],qs[_0x0a1f('0x36')](_0x91aeeb[_0x0a1f('0x31')][_0x0a1f('0x36')]));_0x3eb176['attributes']=_0x3eb176[_0x0a1f('0x37')]['length']?_0x3eb176[_0x0a1f('0x37')]:_0x52f4a1[_0x0a1f('0x35')];if(!_0x91aeeb[_0x0a1f('0x31')][_0x0a1f('0x38')](_0x0a1f('0x39'))){_0x3eb176[_0x0a1f('0x3a')]=qs[_0x0a1f('0x3a')](_0x91aeeb[_0x0a1f('0x31')][_0x0a1f('0x3a')]);_0x3eb176[_0x0a1f('0x1b')]=qs[_0x0a1f('0x1b')](_0x91aeeb[_0x0a1f('0x31')][_0x0a1f('0x1b')]);}_0x3eb176[_0x0a1f('0x3b')]=qs[_0x0a1f('0x3c')](_0x91aeeb[_0x0a1f('0x31')][_0x0a1f('0x3c')]);_0x3eb176[_0x0a1f('0x3d')]=qs[_0x0a1f('0x33')](_['pick'](_0x91aeeb[_0x0a1f('0x31')],_0x52f4a1[_0x0a1f('0x33')]),_0x4b509d);if(_0x91aeeb['query'][_0x0a1f('0x3e')]){_0x3eb176[_0x0a1f('0x3d')]=_[_0x0a1f('0x3f')](_0x3eb176['where'],{'$or':_[_0x0a1f('0x2c')](_0x4b509d,function(_0x448c5e){if(_0x448c5e[_0x0a1f('0x40')]!==_0x0a1f('0x41')){var _0x3d26b3={};_0x3d26b3[_0x448c5e[_0x0a1f('0x29')]]={'$like':'%'+_0x91aeeb[_0x0a1f('0x31')][_0x0a1f('0x3e')]+'%'};return _0x3d26b3;}})});}_0x3eb176=_[_0x0a1f('0x3f')]({},_0x3eb176,_0x91aeeb[_0x0a1f('0x42')]);var _0x293663={'where':_0x3eb176[_0x0a1f('0x3d')]};return db[_0x0a1f('0x2d')][_0x0a1f('0x1d')](_0x293663)[_0x0a1f('0x24')](function(_0x2ff4d5){_0x47cc26[_0x0a1f('0x1d')]=_0x2ff4d5;if(_0x91aeeb[_0x0a1f('0x31')][_0x0a1f('0x43')]){_0x3eb176['include']=[{'all':!![]}];}return db[_0x0a1f('0x2d')][_0x0a1f('0x44')](_0x3eb176);})[_0x0a1f('0x24')](function(_0x4a59f3){_0x47cc26[_0x0a1f('0x45')]=_0x4a59f3;return _0x47cc26;})['then'](respondWithFilteredResult(_0x72e43f,_0x3eb176))[_0x0a1f('0x46')](handleError(_0x72e43f,null));};exports[_0x0a1f('0x47')]=function(_0x54710e,_0x7ade26){var _0x56593b={'raw':![],'where':{'id':_0x54710e[_0x0a1f('0x48')]['id']}},_0x1299e6={};_0x1299e6[_0x0a1f('0x35')]=_[_0x0a1f('0x32')](db[_0x0a1f('0x2d')][_0x0a1f('0x2e')]);_0x1299e6[_0x0a1f('0x31')]=_[_0x0a1f('0x32')](_0x54710e[_0x0a1f('0x31')]);_0x1299e6[_0x0a1f('0x33')]=_[_0x0a1f('0x34')](_0x1299e6['model'],_0x1299e6[_0x0a1f('0x31')]);_0x56593b['attributes']=_[_0x0a1f('0x34')](_0x1299e6['model'],qs['fields'](_0x54710e['query'][_0x0a1f('0x36')]));_0x56593b[_0x0a1f('0x37')]=_0x56593b[_0x0a1f('0x37')][_0x0a1f('0x49')]?_0x56593b[_0x0a1f('0x37')]:_0x1299e6[_0x0a1f('0x35')];if(_0x54710e[_0x0a1f('0x31')][_0x0a1f('0x43')]){_0x56593b[_0x0a1f('0x4a')]=[{'all':!![]}];}_0x56593b=_[_0x0a1f('0x3f')]({},_0x56593b,_0x54710e[_0x0a1f('0x42')]);return db[_0x0a1f('0x2d')][_0x0a1f('0x4b')](_0x56593b)[_0x0a1f('0x24')](handleEntityNotFound(_0x7ade26,null))[_0x0a1f('0x24')](respondWithResult(_0x7ade26,null))[_0x0a1f('0x46')](handleError(_0x7ade26,null));};exports[_0x0a1f('0x4c')]=function(_0xa69ea9,_0x4f62f5){return db[_0x0a1f('0x2d')][_0x0a1f('0x4c')](_0xa69ea9[_0x0a1f('0x4d')],{})[_0x0a1f('0x24')](respondWithResult(_0x4f62f5,0xc9))[_0x0a1f('0x46')](handleError(_0x4f62f5,null));};exports[_0x0a1f('0x23')]=function(_0x5b3d58,_0x3127c3){if(_0x5b3d58[_0x0a1f('0x4d')]['id']){delete _0x5b3d58['body']['id'];}return db[_0x0a1f('0x2d')]['find']({'where':{'id':_0x5b3d58['params']['id']}})[_0x0a1f('0x24')](handleEntityNotFound(_0x3127c3,null))[_0x0a1f('0x24')](saveUpdates(_0x5b3d58[_0x0a1f('0x4d')],null))[_0x0a1f('0x24')](respondWithResult(_0x3127c3,null))[_0x0a1f('0x46')](handleError(_0x3127c3,null));};exports[_0x0a1f('0x25')]=function(_0x15e304,_0x20a323){return db[_0x0a1f('0x2d')]['find']({'where':{'id':_0x15e304[_0x0a1f('0x48')]['id']}})[_0x0a1f('0x24')](handleEntityNotFound(_0x20a323,null))[_0x0a1f('0x24')](removeEntity(_0x20a323,null))[_0x0a1f('0x46')](handleError(_0x20a323,null));};exports[_0x0a1f('0x4e')]=function(_0x24322a,_0x1f8d9f,_0x161fa2){var _0x4ea4df={};var _0x102f38={};var _0x42667f;var _0x50a715;return db['VtigerAccount'][_0x0a1f('0x4f')]({'where':{'id':_0x24322a['params']['id']}})['then'](handleEntityNotFound(_0x1f8d9f,null))[_0x0a1f('0x24')](function(_0x28a536){if(_0x28a536){_0x42667f=_0x28a536;_0x102f38[_0x0a1f('0x35')]=_[_0x0a1f('0x32')](db['VtigerConfiguration']['rawAttributes']);_0x102f38[_0x0a1f('0x31')]=_['keys'](_0x24322a['query']);_0x102f38[_0x0a1f('0x33')]=_[_0x0a1f('0x34')](_0x102f38[_0x0a1f('0x35')],_0x102f38[_0x0a1f('0x31')]);_0x4ea4df[_0x0a1f('0x37')]=_[_0x0a1f('0x34')](_0x102f38['model'],qs[_0x0a1f('0x36')](_0x24322a[_0x0a1f('0x31')][_0x0a1f('0x36')]));_0x4ea4df['attributes']=_0x4ea4df['attributes'][_0x0a1f('0x49')]?_0x4ea4df[_0x0a1f('0x37')]:_0x102f38[_0x0a1f('0x35')];_0x4ea4df['order']=qs['sort'](_0x24322a[_0x0a1f('0x31')][_0x0a1f('0x3c')]);_0x4ea4df[_0x0a1f('0x3d')]=qs[_0x0a1f('0x33')](_['pick'](_0x24322a['query'],_0x102f38[_0x0a1f('0x33')]));if(_0x24322a[_0x0a1f('0x31')]['filter']){_0x4ea4df[_0x0a1f('0x3d')]=_[_0x0a1f('0x3f')](_0x4ea4df[_0x0a1f('0x3d')],{'$or':_[_0x0a1f('0x2c')](_0x4ea4df[_0x0a1f('0x37')],function(_0x5c4157){var _0x5a5ede={};_0x5a5ede[_0x5c4157]={'$like':'%'+_0x24322a[_0x0a1f('0x31')][_0x0a1f('0x3e')]+'%'};return _0x5a5ede;})});}_0x4ea4df=_[_0x0a1f('0x3f')]({},_0x4ea4df,_0x24322a[_0x0a1f('0x42')]);return _0x42667f[_0x0a1f('0x4e')](_0x4ea4df);}})[_0x0a1f('0x24')](function(_0x4a9867){if(_0x4a9867){_0x50a715=_0x4a9867['length'];if(!_0x24322a[_0x0a1f('0x31')][_0x0a1f('0x38')](_0x0a1f('0x39'))){_0x4ea4df[_0x0a1f('0x3a')]=qs['limit'](_0x24322a[_0x0a1f('0x31')][_0x0a1f('0x3a')]);_0x4ea4df[_0x0a1f('0x1b')]=qs[_0x0a1f('0x1b')](_0x24322a['query'][_0x0a1f('0x1b')]);}return _0x42667f['getConfigurations'](_0x4ea4df);}})[_0x0a1f('0x24')](function(_0x343893){if(_0x343893){return _0x343893?{'count':_0x50a715,'rows':_0x343893}:null;}})[_0x0a1f('0x24')](respondWithResult(_0x1f8d9f,null))['catch'](handleError(_0x1f8d9f,null));};exports[_0x0a1f('0x50')]=function(_0x93a507,_0x228170,_0xa3d62b){if(_0x93a507[_0x0a1f('0x4d')]['id']){delete _0x93a507[_0x0a1f('0x4d')]['id'];}return db[_0x0a1f('0x2d')]['findOne']({'where':{'id':_0x93a507[_0x0a1f('0x48')]['id']}})[_0x0a1f('0x24')](handleEntityNotFound(_0x228170,null))[_0x0a1f('0x24')](function(_0x38ff70){if(_0x38ff70){_0x93a507[_0x0a1f('0x4d')][_0x0a1f('0x51')]=_0x38ff70['id'];_0x93a507[_0x0a1f('0x4d')][_0x0a1f('0x52')]=integrations[_0x0a1f('0x53')](_0x93a507['body'][_0x0a1f('0x54')],_0x93a507['body']['type']);_0x93a507['body'][_0x0a1f('0x55')]=integrations[_0x0a1f('0x56')](_0x93a507[_0x0a1f('0x4d')][_0x0a1f('0x54')],_0x93a507[_0x0a1f('0x4d')]['type']);return db[_0x0a1f('0x57')][_0x0a1f('0x4c')](_0x93a507[_0x0a1f('0x4d')],{'include':[{'model':db[_0x0a1f('0x58')],'as':_0x0a1f('0x52')},{'model':db[_0x0a1f('0x58')],'as':_0x0a1f('0x55')}]});}return null;})[_0x0a1f('0x24')](respondWithResult(_0x228170,null))[_0x0a1f('0x46')](handleError(_0x228170,null));};var md5=require(_0x0a1f('0x59'));exports[_0x0a1f('0x5a')]=function(_0x329b97,_0x1d7d78,_0x10fcf2){var _0x11b1e6=null;var _0x2f8942=null;var _0x495bb6=null;var _0x3c046c=null;var _0x2186af='';return db[_0x0a1f('0x2d')][_0x0a1f('0x4f')]({'where':{'id':_0x329b97[_0x0a1f('0x48')]['id']},'attributes':['id',_0x0a1f('0x29'),_0x0a1f('0x5b'),_0x0a1f('0x5c'),_0x0a1f('0x5d'),_0x0a1f('0x5e'),_0x0a1f('0x5f'),_0x0a1f('0x60')]})[_0x0a1f('0x24')](handleEntityNotFound(_0x1d7d78,null))['then'](function(_0x64bd25){if(_0x64bd25){_0x11b1e6=_0x64bd25[_0x0a1f('0x5b')];_0x2f8942=_0x64bd25[_0x0a1f('0x60')];_0x495bb6=_0x64bd25[_0x0a1f('0x5d')];_0x2186af=_0x64bd25['remoteUri'];var _0x5c4e7b=_0x2186af[_0x0a1f('0x61')](-0x1);if(_0x5c4e7b==='/'){_0x2186af=_0x2186af['substring'](0x0,_0x2186af[_0x0a1f('0x62')](_0x5c4e7b));}_0x3c046c=util['format']('%s/webservice.php',_0x2186af);var _0x73ce05={'method':'GET','uri':_0x3c046c,'qs':{'operation':'getchallenge','username':_0x64bd25[_0x0a1f('0x5b')]},'json':!![]};return rp(_0x73ce05);}})['then'](function(_0x49a579){if(_0x49a579[_0x0a1f('0x63')]){var _0x4c8496={'method':_0x0a1f('0x64'),'uri':_0x3c046c,'form':{'operation':_0x0a1f('0x65'),'username':_0x11b1e6,'accessKey':md5(_0x49a579[_0x0a1f('0x66')]['token']+_0x2f8942)},'json':!![]};return rp(_0x4c8496);}})[_0x0a1f('0x24')](function(_0x474658){if(_0x474658[_0x0a1f('0x63')]){var _0x62bea8={'method':'GET','uri':_0x3c046c,'qs':{'operation':_0x0a1f('0x67'),'username':_0x11b1e6,'sessionName':_0x474658['result']['sessionName'],'elementType':_0x495bb6},'json':!![]};return rp(_0x62bea8);}})['then'](function(_0x362752){if(_0x362752[_0x0a1f('0x63')]){var _0x261174=['autogenerated',_0x0a1f('0x68'),_0x0a1f('0x69')];_[_0x0a1f('0x6a')](_0x362752[_0x0a1f('0x66')][_0x0a1f('0x36')],function(_0x3667d1){return _0x261174[_0x0a1f('0x6b')](_0x3667d1[_0x0a1f('0x40')][_0x0a1f('0x29')]);});_[_0x0a1f('0x6a')](_0x362752[_0x0a1f('0x66')][_0x0a1f('0x36')],function(_0x1f4dd6){return _0x1f4dd6['editable']===_0x0a1f('0x6c');});return{'count':_0x362752[_0x0a1f('0x66')][_0x0a1f('0x36')][_0x0a1f('0x49')],'rows':_['map'](_0x362752[_0x0a1f('0x66')][_0x0a1f('0x36')],function(_0x526806){return{'id':_0x526806[_0x0a1f('0x29')],'name':_0x526806['label'],'custom':_[_0x0a1f('0x6d')](_0x526806[_0x0a1f('0x29')],_0x0a1f('0x6e'))?!![]:![],'options':_0x526806[_0x0a1f('0x40')][_0x0a1f('0x29')]==='picklist'&&_0x526806[_0x0a1f('0x40')]['picklistValues']['length']>0x0?_['map'](_0x526806[_0x0a1f('0x40')][_0x0a1f('0x6f')],function(_0x5bdd4f){return{'name':_0x5bdd4f[_0x0a1f('0x70')],'value':_0x5bdd4f[_0x0a1f('0x71')]};}):[]};})};}})['then'](respondWithResult(_0x1d7d78,null))[_0x0a1f('0x46')](function(_0x3c1dc5){console[_0x0a1f('0x72')](_0x0a1f('0x73')+_0x3c1dc5);var _0x183722=_0x329b97['query'][_0x0a1f('0x74')]?0x1f4:_0x3c1dc5[_0x0a1f('0x75')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x0a1f('0x5a'),_0x183722,JSON['stringify'](_0x3c1dc5));delete _0x3c1dc5[_0x0a1f('0x29')];if(_0x183722===0x191){_0x183722=0x190;}_0x1d7d78[_0x0a1f('0x18')](_0x183722)[_0x0a1f('0x2a')](_0x329b97['query']['test']?{'message':_0x0a1f('0x76'),'statusCode':_0x3c1dc5['statusCode']}:_0x3c1dc5);});};
\ No newline at end of file
+var _0xb3ce=['lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/environment','../../config/license/util','../../components/integrations/configuration','status','json','offset','undefined','count','limit','set','Content-Range','reject','update','destroy','end','sendStatus','error','stack','name','map','VtigerAccount','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','catch','show','params','keys','find','create','body','getConfigurations','findOne','VtigerConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','getFields','moduleName','remoteUri','serverUrl','accessKey','username','slice','substring','format','%s/webservice.php','GET','getchallenge','success','POST','result','describe','sessionName','autogenerated','reference','owner','includes','remove','editable','false','label','startsWith','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x4feb08,_0x3a3487){var _0x28f07b=function(_0xe145d){while(--_0xe145d){_0x4feb08['push'](_0x4feb08['shift']());}};_0x28f07b(++_0x3a3487);}(_0xb3ce,0x1cd));var _0xeb3c=function(_0x366ebd,_0x378e4f){_0x366ebd=_0x366ebd-0x0;var _0x140bda=_0xb3ce[_0x366ebd];return _0x140bda;};'use strict';var emlformat=require(_0xeb3c('0x0'));var rimraf=require(_0xeb3c('0x1'));var zipdir=require(_0xeb3c('0x2'));var jsonpatch=require(_0xeb3c('0x3'));var rp=require('request-promise');var moment=require(_0xeb3c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xeb3c('0x5'));var util=require(_0xeb3c('0x6'));var path=require('path');var sox=require(_0xeb3c('0x7'));var csv=require(_0xeb3c('0x8'));var ejs=require(_0xeb3c('0x9'));var fs=require('fs');var fs_extra=require(_0xeb3c('0xa'));var _=require(_0xeb3c('0xb'));var squel=require(_0xeb3c('0xc'));var crypto=require(_0xeb3c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xeb3c('0xe'));var toCsv=require('to-csv');var querystring=require(_0xeb3c('0xf'));var Papa=require(_0xeb3c('0x10'));var Redis=require(_0xeb3c('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xeb3c('0x12'))(_0xeb3c('0x13'));var utils=require('../../config/utils');var config=require(_0xeb3c('0x14'));var licenseUtil=require(_0xeb3c('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xeb3c('0x16'));function respondWithStatusCode(_0x3e462e,_0x12b2b0){_0x12b2b0=_0x12b2b0||0xcc;return function(_0x542a22){if(_0x542a22){return _0x3e462e['sendStatus'](_0x12b2b0);}return _0x3e462e[_0xeb3c('0x17')](_0x12b2b0)['end']();};}function respondWithResult(_0x1b4cec,_0x1effc8){_0x1effc8=_0x1effc8||0xc8;return function(_0x172811){if(_0x172811){return _0x1b4cec[_0xeb3c('0x17')](_0x1effc8)[_0xeb3c('0x18')](_0x172811);}};}function respondWithFilteredResult(_0x40c587,_0x32b882){return function(_0xf30381){if(_0xf30381){var _0x46e67c=typeof _0x32b882[_0xeb3c('0x19')]===_0xeb3c('0x1a')&&typeof _0x32b882['limit']===_0xeb3c('0x1a');var _0x5b7d11=_0xf30381[_0xeb3c('0x1b')];var _0x748e6e=_0x46e67c?0x0:_0x32b882[_0xeb3c('0x19')];var _0x55ca3f=_0x46e67c?_0xf30381[_0xeb3c('0x1b')]:_0x32b882[_0xeb3c('0x19')]+_0x32b882[_0xeb3c('0x1c')];var _0x5cf954;if(_0x55ca3f>=_0x5b7d11){_0x55ca3f=_0x5b7d11;_0x5cf954=0xc8;}else{_0x5cf954=0xce;}_0x40c587[_0xeb3c('0x17')](_0x5cf954);return _0x40c587[_0xeb3c('0x1d')](_0xeb3c('0x1e'),_0x748e6e+'-'+_0x55ca3f+'/'+_0x5b7d11)[_0xeb3c('0x18')](_0xf30381);}return null;};}function patchUpdates(_0x21bdd0){return function(_0x2727a7){try{jsonpatch['apply'](_0x2727a7,_0x21bdd0,!![]);}catch(_0x392f24){return BPromise[_0xeb3c('0x1f')](_0x392f24);}return _0x2727a7['save']();};}function saveUpdates(_0x243beb,_0x4cdc24){return function(_0x494ead){if(_0x494ead){return _0x494ead[_0xeb3c('0x20')](_0x243beb)['then'](function(_0x1914aa){return _0x1914aa;});}return null;};}function removeEntity(_0x5080ff,_0x13084e){return function(_0x1a5a78){if(_0x1a5a78){return _0x1a5a78[_0xeb3c('0x21')]()['then'](function(){_0x5080ff[_0xeb3c('0x17')](0xcc)[_0xeb3c('0x22')]();});}};}function handleEntityNotFound(_0x43346d,_0x7e3f06){return function(_0x47cbca){if(!_0x47cbca){_0x43346d[_0xeb3c('0x23')](0x194);}return _0x47cbca;};}function handleError(_0x54fb07,_0x248312){_0x248312=_0x248312||0x1f4;return function(_0x471e63){logger[_0xeb3c('0x24')](_0x471e63[_0xeb3c('0x25')]);if(_0x471e63[_0xeb3c('0x26')]){delete _0x471e63[_0xeb3c('0x26')];}_0x54fb07[_0xeb3c('0x17')](_0x248312)['send'](_0x471e63);};}exports['index']=function(_0x333002,_0x45cd60){var _0x52ec52={},_0x1619fb={},_0x5f2508={'count':0x0,'rows':[]};var _0x54c330=_[_0xeb3c('0x27')](db[_0xeb3c('0x28')][_0xeb3c('0x29')],function(_0x3141d7){return{'name':_0x3141d7['fieldName'],'type':_0x3141d7[_0xeb3c('0x2a')][_0xeb3c('0x2b')]};});_0x1619fb[_0xeb3c('0x2c')]=_[_0xeb3c('0x27')](_0x54c330,_0xeb3c('0x26'));_0x1619fb[_0xeb3c('0x2d')]=_['keys'](_0x333002['query']);_0x1619fb[_0xeb3c('0x2e')]=_[_0xeb3c('0x2f')](_0x1619fb[_0xeb3c('0x2c')],_0x1619fb[_0xeb3c('0x2d')]);_0x52ec52[_0xeb3c('0x30')]=_[_0xeb3c('0x2f')](_0x1619fb[_0xeb3c('0x2c')],qs[_0xeb3c('0x31')](_0x333002[_0xeb3c('0x2d')][_0xeb3c('0x31')]));_0x52ec52[_0xeb3c('0x30')]=_0x52ec52[_0xeb3c('0x30')][_0xeb3c('0x32')]?_0x52ec52[_0xeb3c('0x30')]:_0x1619fb[_0xeb3c('0x2c')];if(!_0x333002[_0xeb3c('0x2d')][_0xeb3c('0x33')](_0xeb3c('0x34'))){_0x52ec52[_0xeb3c('0x1c')]=qs['limit'](_0x333002[_0xeb3c('0x2d')]['limit']);_0x52ec52[_0xeb3c('0x19')]=qs['offset'](_0x333002[_0xeb3c('0x2d')][_0xeb3c('0x19')]);}_0x52ec52[_0xeb3c('0x35')]=qs[_0xeb3c('0x36')](_0x333002['query']['sort']);_0x52ec52[_0xeb3c('0x37')]=qs[_0xeb3c('0x2e')](_[_0xeb3c('0x38')](_0x333002[_0xeb3c('0x2d')],_0x1619fb[_0xeb3c('0x2e')]),_0x54c330);if(_0x333002[_0xeb3c('0x2d')][_0xeb3c('0x39')]){_0x52ec52[_0xeb3c('0x37')]=_[_0xeb3c('0x3a')](_0x52ec52[_0xeb3c('0x37')],{'$or':_['map'](_0x54c330,function(_0x51f543){if(_0x51f543[_0xeb3c('0x2a')]!==_0xeb3c('0x3b')){var _0x5486e3={};_0x5486e3[_0x51f543[_0xeb3c('0x26')]]={'$like':'%'+_0x333002[_0xeb3c('0x2d')][_0xeb3c('0x39')]+'%'};return _0x5486e3;}})});}_0x52ec52=_['merge']({},_0x52ec52,_0x333002[_0xeb3c('0x3c')]);var _0xc10573={'where':_0x52ec52[_0xeb3c('0x37')]};return db[_0xeb3c('0x28')][_0xeb3c('0x1b')](_0xc10573)[_0xeb3c('0x3d')](function(_0x195f9f){_0x5f2508[_0xeb3c('0x1b')]=_0x195f9f;if(_0x333002[_0xeb3c('0x2d')][_0xeb3c('0x3e')]){_0x52ec52[_0xeb3c('0x3f')]=[{'all':!![]}];}return db['VtigerAccount'][_0xeb3c('0x40')](_0x52ec52);})[_0xeb3c('0x3d')](function(_0x192f56){_0x5f2508['rows']=_0x192f56;return _0x5f2508;})['then'](respondWithFilteredResult(_0x45cd60,_0x52ec52))[_0xeb3c('0x41')](handleError(_0x45cd60,null));};exports[_0xeb3c('0x42')]=function(_0x58bad3,_0x21c4d4){var _0x3ca785={'raw':![],'where':{'id':_0x58bad3[_0xeb3c('0x43')]['id']}},_0x27fa72={};_0x27fa72['model']=_[_0xeb3c('0x44')](db[_0xeb3c('0x28')][_0xeb3c('0x29')]);_0x27fa72[_0xeb3c('0x2d')]=_[_0xeb3c('0x44')](_0x58bad3[_0xeb3c('0x2d')]);_0x27fa72[_0xeb3c('0x2e')]=_[_0xeb3c('0x2f')](_0x27fa72[_0xeb3c('0x2c')],_0x27fa72[_0xeb3c('0x2d')]);_0x3ca785[_0xeb3c('0x30')]=_[_0xeb3c('0x2f')](_0x27fa72['model'],qs['fields'](_0x58bad3['query']['fields']));_0x3ca785[_0xeb3c('0x30')]=_0x3ca785['attributes'][_0xeb3c('0x32')]?_0x3ca785[_0xeb3c('0x30')]:_0x27fa72[_0xeb3c('0x2c')];if(_0x58bad3['query'][_0xeb3c('0x3e')]){_0x3ca785[_0xeb3c('0x3f')]=[{'all':!![]}];}_0x3ca785=_[_0xeb3c('0x3a')]({},_0x3ca785,_0x58bad3[_0xeb3c('0x3c')]);return db['VtigerAccount'][_0xeb3c('0x45')](_0x3ca785)[_0xeb3c('0x3d')](handleEntityNotFound(_0x21c4d4,null))['then'](respondWithResult(_0x21c4d4,null))[_0xeb3c('0x41')](handleError(_0x21c4d4,null));};exports[_0xeb3c('0x46')]=function(_0x146ab4,_0x58997c){return db[_0xeb3c('0x28')]['create'](_0x146ab4['body'],{})[_0xeb3c('0x3d')](respondWithResult(_0x58997c,0xc9))[_0xeb3c('0x41')](handleError(_0x58997c,null));};exports[_0xeb3c('0x20')]=function(_0x33662b,_0x2c4505){if(_0x33662b[_0xeb3c('0x47')]['id']){delete _0x33662b['body']['id'];}return db['VtigerAccount'][_0xeb3c('0x45')]({'where':{'id':_0x33662b[_0xeb3c('0x43')]['id']}})['then'](handleEntityNotFound(_0x2c4505,null))[_0xeb3c('0x3d')](saveUpdates(_0x33662b['body'],null))[_0xeb3c('0x3d')](respondWithResult(_0x2c4505,null))[_0xeb3c('0x41')](handleError(_0x2c4505,null));};exports[_0xeb3c('0x21')]=function(_0x177dab,_0x54dcc9){return db[_0xeb3c('0x28')][_0xeb3c('0x45')]({'where':{'id':_0x177dab[_0xeb3c('0x43')]['id']}})[_0xeb3c('0x3d')](handleEntityNotFound(_0x54dcc9,null))['then'](removeEntity(_0x54dcc9,null))['catch'](handleError(_0x54dcc9,null));};exports[_0xeb3c('0x48')]=function(_0x200ca8,_0x13f9f0,_0x2ae2a0){var _0x128559={};var _0x5a209e={};var _0x252732;var _0x55cc96;return db[_0xeb3c('0x28')][_0xeb3c('0x49')]({'where':{'id':_0x200ca8['params']['id']}})[_0xeb3c('0x3d')](handleEntityNotFound(_0x13f9f0,null))[_0xeb3c('0x3d')](function(_0x34abe4){if(_0x34abe4){_0x252732=_0x34abe4;_0x5a209e[_0xeb3c('0x2c')]=_[_0xeb3c('0x44')](db[_0xeb3c('0x4a')][_0xeb3c('0x29')]);_0x5a209e[_0xeb3c('0x2d')]=_[_0xeb3c('0x44')](_0x200ca8[_0xeb3c('0x2d')]);_0x5a209e[_0xeb3c('0x2e')]=_[_0xeb3c('0x2f')](_0x5a209e['model'],_0x5a209e[_0xeb3c('0x2d')]);_0x128559[_0xeb3c('0x30')]=_['intersection'](_0x5a209e[_0xeb3c('0x2c')],qs[_0xeb3c('0x31')](_0x200ca8['query']['fields']));_0x128559['attributes']=_0x128559[_0xeb3c('0x30')][_0xeb3c('0x32')]?_0x128559['attributes']:_0x5a209e[_0xeb3c('0x2c')];_0x128559[_0xeb3c('0x35')]=qs[_0xeb3c('0x36')](_0x200ca8[_0xeb3c('0x2d')][_0xeb3c('0x36')]);_0x128559[_0xeb3c('0x37')]=qs[_0xeb3c('0x2e')](_[_0xeb3c('0x38')](_0x200ca8['query'],_0x5a209e[_0xeb3c('0x2e')]));if(_0x200ca8['query'][_0xeb3c('0x39')]){_0x128559[_0xeb3c('0x37')]=_[_0xeb3c('0x3a')](_0x128559[_0xeb3c('0x37')],{'$or':_[_0xeb3c('0x27')](_0x128559['attributes'],function(_0x201919){var _0x30b274={};_0x30b274[_0x201919]={'$like':'%'+_0x200ca8['query'][_0xeb3c('0x39')]+'%'};return _0x30b274;})});}_0x128559=_[_0xeb3c('0x3a')]({},_0x128559,_0x200ca8[_0xeb3c('0x3c')]);return _0x252732['getConfigurations'](_0x128559);}})[_0xeb3c('0x3d')](function(_0x180fee){if(_0x180fee){_0x55cc96=_0x180fee[_0xeb3c('0x32')];if(!_0x200ca8['query'][_0xeb3c('0x33')](_0xeb3c('0x34'))){_0x128559[_0xeb3c('0x1c')]=qs['limit'](_0x200ca8[_0xeb3c('0x2d')][_0xeb3c('0x1c')]);_0x128559[_0xeb3c('0x19')]=qs[_0xeb3c('0x19')](_0x200ca8[_0xeb3c('0x2d')]['offset']);}return _0x252732[_0xeb3c('0x48')](_0x128559);}})[_0xeb3c('0x3d')](function(_0xae0e36){if(_0xae0e36){return _0xae0e36?{'count':_0x55cc96,'rows':_0xae0e36}:null;}})[_0xeb3c('0x3d')](respondWithResult(_0x13f9f0,null))[_0xeb3c('0x41')](handleError(_0x13f9f0,null));};exports[_0xeb3c('0x4b')]=function(_0x58ac4b,_0x2e343f,_0x345060){if(_0x58ac4b[_0xeb3c('0x47')]['id']){delete _0x58ac4b[_0xeb3c('0x47')]['id'];}return db[_0xeb3c('0x28')][_0xeb3c('0x49')]({'where':{'id':_0x58ac4b[_0xeb3c('0x43')]['id']}})[_0xeb3c('0x3d')](handleEntityNotFound(_0x2e343f,null))[_0xeb3c('0x3d')](function(_0x4ca3b5){if(_0x4ca3b5){_0x58ac4b[_0xeb3c('0x47')][_0xeb3c('0x4c')]=_0x4ca3b5['id'];_0x58ac4b[_0xeb3c('0x47')][_0xeb3c('0x4d')]=integrations[_0xeb3c('0x4e')](_0x58ac4b[_0xeb3c('0x47')][_0xeb3c('0x4f')],_0x58ac4b[_0xeb3c('0x47')][_0xeb3c('0x2a')]);_0x58ac4b['body'][_0xeb3c('0x50')]=integrations[_0xeb3c('0x51')](_0x58ac4b[_0xeb3c('0x47')][_0xeb3c('0x4f')],_0x58ac4b[_0xeb3c('0x47')][_0xeb3c('0x2a')]);return db[_0xeb3c('0x4a')][_0xeb3c('0x46')](_0x58ac4b['body'],{'include':[{'model':db[_0xeb3c('0x52')],'as':_0xeb3c('0x4d')},{'model':db['VtigerField'],'as':_0xeb3c('0x50')}]});}return null;})[_0xeb3c('0x3d')](respondWithResult(_0x2e343f,null))['catch'](handleError(_0x2e343f,null));};var md5=require('md5');exports[_0xeb3c('0x53')]=function(_0x281a01,_0xf32eb8,_0x1e618d){var _0xd90519=null;var _0x51103c=null;var _0x5068bc=null;var _0x1e88c3=null;var _0x3afe94='';return db['VtigerAccount']['findOne']({'where':{'id':_0x281a01[_0xeb3c('0x43')]['id']},'attributes':['id',_0xeb3c('0x26'),'username','description',_0xeb3c('0x54'),_0xeb3c('0x55'),_0xeb3c('0x56'),_0xeb3c('0x57')]})[_0xeb3c('0x3d')](handleEntityNotFound(_0xf32eb8,null))['then'](function(_0x8a8ea6){if(_0x8a8ea6){_0xd90519=_0x8a8ea6[_0xeb3c('0x58')];_0x51103c=_0x8a8ea6['accessKey'];_0x5068bc=_0x8a8ea6[_0xeb3c('0x54')];_0x3afe94=_0x8a8ea6[_0xeb3c('0x55')];var _0x1f3d22=_0x3afe94[_0xeb3c('0x59')](-0x1);if(_0x1f3d22==='/'){_0x3afe94=_0x3afe94[_0xeb3c('0x5a')](0x0,_0x3afe94['lastIndexOf'](_0x1f3d22));}_0x1e88c3=util[_0xeb3c('0x5b')](_0xeb3c('0x5c'),_0x3afe94);var _0x17d725={'method':_0xeb3c('0x5d'),'uri':_0x1e88c3,'qs':{'operation':_0xeb3c('0x5e'),'username':_0x8a8ea6[_0xeb3c('0x58')]},'json':!![]};return rp(_0x17d725);}})['then'](function(_0x53121e){if(_0x53121e[_0xeb3c('0x5f')]){var _0x1dc251={'method':_0xeb3c('0x60'),'uri':_0x1e88c3,'form':{'operation':'login','username':_0xd90519,'accessKey':md5(_0x53121e[_0xeb3c('0x61')]['token']+_0x51103c)},'json':!![]};return rp(_0x1dc251);}})['then'](function(_0x2ac8e1){if(_0x2ac8e1[_0xeb3c('0x5f')]){var _0x2be619={'method':_0xeb3c('0x5d'),'uri':_0x1e88c3,'qs':{'operation':_0xeb3c('0x62'),'username':_0xd90519,'sessionName':_0x2ac8e1['result'][_0xeb3c('0x63')],'elementType':_0x5068bc},'json':!![]};return rp(_0x2be619);}})['then'](function(_0x2dd9c1){if(_0x2dd9c1[_0xeb3c('0x5f')]){var _0x2170b4=[_0xeb3c('0x64'),_0xeb3c('0x65'),_0xeb3c('0x66')];_['remove'](_0x2dd9c1[_0xeb3c('0x61')][_0xeb3c('0x31')],function(_0x587a1d){return _0x2170b4[_0xeb3c('0x67')](_0x587a1d['type'][_0xeb3c('0x26')]);});_[_0xeb3c('0x68')](_0x2dd9c1[_0xeb3c('0x61')][_0xeb3c('0x31')],function(_0x334030){return _0x334030[_0xeb3c('0x69')]===_0xeb3c('0x6a');});return{'count':_0x2dd9c1[_0xeb3c('0x61')]['fields'][_0xeb3c('0x32')],'rows':_['map'](_0x2dd9c1['result'][_0xeb3c('0x31')],function(_0x3d63d0){return{'id':_0x3d63d0[_0xeb3c('0x26')],'name':_0x3d63d0[_0xeb3c('0x6b')],'custom':_[_0xeb3c('0x6c')](_0x3d63d0[_0xeb3c('0x26')],'cf_')?!![]:![],'options':_0x3d63d0[_0xeb3c('0x2a')][_0xeb3c('0x26')]===_0xeb3c('0x6d')&&_0x3d63d0['type'][_0xeb3c('0x6e')]['length']>0x0?_[_0xeb3c('0x27')](_0x3d63d0['type'][_0xeb3c('0x6e')],function(_0x273d6c){return{'name':_0x273d6c[_0xeb3c('0x6b')],'value':_0x273d6c[_0xeb3c('0x6f')]};}):[]};})};}})[_0xeb3c('0x3d')](respondWithResult(_0xf32eb8,null))['catch'](function(_0x18caeb){console[_0xeb3c('0x70')](_0xeb3c('0x71')+_0x18caeb);var _0x25c1ac=_0x281a01['query'][_0xeb3c('0x72')]?0x1f4:_0x18caeb[_0xeb3c('0x73')]||0x1f4;logger[_0xeb3c('0x24')](_0xeb3c('0x74'),_0xeb3c('0x53'),_0x25c1ac,JSON['stringify'](_0x18caeb));delete _0x18caeb[_0xeb3c('0x26')];if(_0x25c1ac===0x191){_0x25c1ac=0x190;}_0xf32eb8[_0xeb3c('0x17')](_0x25c1ac)['send'](_0x281a01[_0xeb3c('0x2d')][_0xeb3c('0x72')]?{'message':_0xeb3c('0x75'),'statusCode':_0x18caeb[_0xeb3c('0x73')]}:_0x18caeb);});};
\ No newline at end of file
index 6aa3518..7a51c48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc5c0=['request-promise','path','rimraf','../../config/environment','exports','define','VtigerAccount','lodash','../../config/logger','api','bluebird'];(function(_0x23859c,_0x5f24eb){var _0x581bcd=function(_0xadf906){while(--_0xadf906){_0x23859c['push'](_0x23859c['shift']());}};_0x581bcd(++_0x5f24eb);}(_0xc5c0,0xac));var _0x0c5c=function(_0x35a758,_0x43cfb8){_0x35a758=_0x35a758-0x0;var _0x19bfa6=_0xc5c0[_0x35a758];return _0x19bfa6;};'use strict';var _=require(_0x0c5c('0x0'));var util=require('util');var logger=require(_0x0c5c('0x1'))(_0x0c5c('0x2'));var moment=require('moment');var BPromise=require(_0x0c5c('0x3'));var rp=require(_0x0c5c('0x4'));var fs=require('fs');var path=require(_0x0c5c('0x5'));var rimraf=require(_0x0c5c('0x6'));var config=require(_0x0c5c('0x7'));var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0c5c('0x8')]=function(_0x1cb67b,_0x58164c){return _0x1cb67b[_0x0c5c('0x9')](_0x0c5c('0xa'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf6e1=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','../../config/logger'];(function(_0x46ab68,_0xe0f2ea){var _0x2332e3=function(_0x59c987){while(--_0x59c987){_0x46ab68['push'](_0x46ab68['shift']());}};_0x2332e3(++_0xe0f2ea);}(_0xf6e1,0x183));var _0x1f6e=function(_0x5564a9,_0x4ec69c){_0x5564a9=_0x5564a9-0x0;var _0x5a311a=_0xf6e1[_0x5564a9];return _0x5a311a;};'use strict';var _=require(_0x1f6e('0x0'));var util=require(_0x1f6e('0x1'));var logger=require(_0x1f6e('0x2'))(_0x1f6e('0x3'));var moment=require(_0x1f6e('0x4'));var BPromise=require(_0x1f6e('0x5'));var rp=require(_0x1f6e('0x6'));var fs=require('fs');var path=require(_0x1f6e('0x7'));var rimraf=require(_0x1f6e('0x8'));var config=require(_0x1f6e('0x9'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x1f6e('0xa'));module[_0x1f6e('0xb')]=function(_0x3ac9e4,_0x837d3e){return _0x3ac9e4[_0x1f6e('0xc')](_0x1f6e('0xd'),attributes,{'tableName':_0x1f6e('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 137493f..2e81ba1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bb5=['VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','options','raw','where','limit','map','include','model','attributes','GetVtigerAccount','ShowVtigerAccount','VtigerAccount','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info'];(function(_0x473ac3,_0xf8066a){var _0x563cfd=function(_0x54b0eb){while(--_0x54b0eb){_0x473ac3['push'](_0x473ac3['shift']());}};_0x563cfd(++_0xf8066a);}(_0x0bb5,0x148));var _0x50bb=function(_0xe616ba,_0x1f2b4c){_0xe616ba=_0xe616ba-0x0;var _0x587b5b=_0x0bb5[_0xe616ba];return _0x587b5b;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x50bb('0x2'));var fs=require('fs');var Redis=require(_0x50bb('0x3'));var db=require(_0x50bb('0x4'))['db'];var utils=require(_0x50bb('0x5'));var logger=require(_0x50bb('0x6'))(_0x50bb('0x7'));var config=require(_0x50bb('0x8'));var jayson=require(_0x50bb('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xfd7aeb,_0x35de5d,_0x2e5463){return new BPromise(function(_0x33ff54,_0x4f9172){return client['request'](_0xfd7aeb,_0x2e5463)[_0x50bb('0xa')](function(_0x1c2174){logger[_0x50bb('0xb')](_0x50bb('0xc'),_0x35de5d,'request\x20sent');logger[_0x50bb('0xd')](_0x50bb('0xe'),_0x35de5d,_0x50bb('0xf'),JSON[_0x50bb('0x10')](_0x1c2174));if(_0x1c2174[_0x50bb('0x11')]){if(_0x1c2174[_0x50bb('0x11')][_0x50bb('0x12')]===0x1f4){logger['error'](_0x50bb('0xc'),_0x35de5d,_0x1c2174['error'][_0x50bb('0x13')]);return _0x4f9172(_0x1c2174[_0x50bb('0x11')][_0x50bb('0x13')]);}logger['error'](_0x50bb('0xc'),_0x35de5d,_0x1c2174[_0x50bb('0x11')][_0x50bb('0x13')]);return _0x33ff54(_0x1c2174['error'][_0x50bb('0x13')]);}else{logger['info'](_0x50bb('0xc'),_0x35de5d,_0x50bb('0xf'));_0x33ff54(_0x1c2174[_0x50bb('0x14')][_0x50bb('0x13')]);}})[_0x50bb('0x15')](function(_0x4f2897){logger[_0x50bb('0x11')](_0x50bb('0xc'),_0x35de5d,_0x4f2897);_0x4f9172(_0x4f2897);});});}exports['GetVtigerAccount']=function(_0x24ba19){var _0x4796ec=this;return new Promise(function(_0x301f61,_0x431ed4){return db['VtigerAccount']['findAll']({'raw':_0x24ba19[_0x50bb('0x16')]?_0x24ba19[_0x50bb('0x16')][_0x50bb('0x17')]===undefined?!![]:![]:!![],'where':_0x24ba19[_0x50bb('0x16')]?_0x24ba19['options'][_0x50bb('0x18')]||null:null,'attributes':_0x24ba19[_0x50bb('0x16')]?_0x24ba19[_0x50bb('0x16')]['attributes']||null:null,'limit':_0x24ba19[_0x50bb('0x16')]?_0x24ba19[_0x50bb('0x16')][_0x50bb('0x19')]||null:null,'include':_0x24ba19['options']?_0x24ba19[_0x50bb('0x16')]['include']?_[_0x50bb('0x1a')](_0x24ba19[_0x50bb('0x16')][_0x50bb('0x1b')],function(_0x2ee87a){return{'model':db[_0x2ee87a[_0x50bb('0x1c')]],'as':_0x2ee87a['as'],'attributes':_0x2ee87a[_0x50bb('0x1d')],'include':_0x2ee87a['include']?_[_0x50bb('0x1a')](_0x2ee87a[_0x50bb('0x1b')],function(_0x284a76){return{'model':db[_0x284a76[_0x50bb('0x1c')]],'as':_0x284a76['as'],'attributes':_0x284a76['attributes'],'include':_0x284a76[_0x50bb('0x1b')]?_['map'](_0x284a76['include'],function(_0x2befd9){return{'model':db[_0x2befd9['model']],'as':_0x2befd9['as'],'attributes':_0x2befd9['attributes']};}):[]};}):[]};}):[]:[]})[_0x50bb('0xa')](function(_0x12ee2c){logger[_0x50bb('0xb')](_0x50bb('0x1e'),_0x24ba19);logger[_0x50bb('0xd')](_0x50bb('0x1e'),_0x24ba19,JSON[_0x50bb('0x10')](_0x12ee2c));_0x301f61(_0x12ee2c);})[_0x50bb('0x15')](function(_0x4f7514){logger[_0x50bb('0x11')](_0x50bb('0x1e'),_0x4f7514[_0x50bb('0x13')],_0x24ba19);_0x431ed4(_0x4796ec[_0x50bb('0x11')](0x1f4,_0x4f7514['message']));});});};exports[_0x50bb('0x1f')]=function(_0x1a62fb){var _0xc38da5=this;return new Promise(function(_0xb3c3ba,_0x3fd5f6){return db[_0x50bb('0x20')][_0x50bb('0x21')]({'raw':_0x1a62fb[_0x50bb('0x16')]?_0x1a62fb[_0x50bb('0x16')][_0x50bb('0x17')]===undefined?!![]:![]:!![],'where':_0x1a62fb[_0x50bb('0x16')]?_0x1a62fb[_0x50bb('0x16')]['where']||null:null,'attributes':_0x1a62fb[_0x50bb('0x16')]?_0x1a62fb[_0x50bb('0x16')][_0x50bb('0x1d')]||null:null,'include':_0x1a62fb[_0x50bb('0x16')]?_0x1a62fb[_0x50bb('0x16')][_0x50bb('0x1b')]?_[_0x50bb('0x1a')](_0x1a62fb[_0x50bb('0x16')][_0x50bb('0x1b')],function(_0x1cc4e2){return{'model':db[_0x1cc4e2[_0x50bb('0x1c')]],'as':_0x1cc4e2['as'],'attributes':_0x1cc4e2['attributes'],'include':_0x1cc4e2[_0x50bb('0x1b')]?_[_0x50bb('0x1a')](_0x1cc4e2[_0x50bb('0x1b')],function(_0x2bfb54){return{'model':db[_0x2bfb54[_0x50bb('0x1c')]],'as':_0x2bfb54['as'],'attributes':_0x2bfb54[_0x50bb('0x1d')],'include':_0x2bfb54['include']?_['map'](_0x2bfb54[_0x50bb('0x1b')],function(_0x5ed0b4){return{'model':db[_0x5ed0b4[_0x50bb('0x1c')]],'as':_0x5ed0b4['as'],'attributes':_0x5ed0b4[_0x50bb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x50bb('0xa')](function(_0x171c6b){logger[_0x50bb('0xb')]('ShowVtigerAccount',_0x1a62fb);logger[_0x50bb('0xd')]('ShowVtigerAccount',_0x1a62fb,JSON[_0x50bb('0x10')](_0x171c6b));_0xb3c3ba(_0x171c6b);})[_0x50bb('0x15')](function(_0x280e5a){logger['error']('ShowVtigerAccount',_0x280e5a[_0x50bb('0x13')],_0x1a62fb);_0x3fd5f6(_0xc38da5[_0x50bb('0x11')](0x1f4,_0x280e5a[_0x50bb('0x13')]));});});};
\ No newline at end of file
+var _0xf290=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetVtigerAccount','findAll','options','raw','where','map','include','model','attributes','stringify','VtigerAccount','ShowVtigerAccount','util','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf290,0xde));var _0x0f29=function(_0x418549,_0x11b13d){_0x418549=_0x418549-0x0;var _0x288826=_0xf290[_0x418549];return _0x288826;};'use strict';var _=require('lodash');var util=require(_0x0f29('0x0'));var moment=require('moment');var BPromise=require(_0x0f29('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f29('0x2'));var db=require(_0x0f29('0x3'))['db'];var utils=require(_0x0f29('0x4'));var logger=require(_0x0f29('0x5'))(_0x0f29('0x6'));var config=require('../../config/environment');var jayson=require(_0x0f29('0x7'));var client=jayson['client'][_0x0f29('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1c45ec,_0x355e21,_0xaa2675){return new BPromise(function(_0xc78ca2,_0x45350b){return client[_0x0f29('0x9')](_0x1c45ec,_0xaa2675)[_0x0f29('0xa')](function(_0x376de4){logger[_0x0f29('0xb')](_0x0f29('0xc'),_0x355e21,_0x0f29('0xd'));logger[_0x0f29('0xe')](_0x0f29('0xf'),_0x355e21,_0x0f29('0xd'),JSON['stringify'](_0x376de4));if(_0x376de4[_0x0f29('0x10')]){if(_0x376de4['error'][_0x0f29('0x11')]===0x1f4){logger[_0x0f29('0x10')](_0x0f29('0xc'),_0x355e21,_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);return _0x45350b(_0x376de4[_0x0f29('0x10')]['message']);}logger[_0x0f29('0x10')](_0x0f29('0xc'),_0x355e21,_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);return _0xc78ca2(_0x376de4[_0x0f29('0x10')][_0x0f29('0x12')]);}else{logger[_0x0f29('0xb')](_0x0f29('0xc'),_0x355e21,'request\x20sent');_0xc78ca2(_0x376de4['result'][_0x0f29('0x12')]);}})[_0x0f29('0x13')](function(_0x38031e){logger[_0x0f29('0x10')]('VtigerAccount,\x20%s,\x20%s',_0x355e21,_0x38031e);_0x45350b(_0x38031e);});});}exports[_0x0f29('0x14')]=function(_0x5d72a5){var _0x17b994=this;return new Promise(function(_0x4ca5e8,_0x5ddc74){return db['VtigerAccount'][_0x0f29('0x15')]({'raw':_0x5d72a5[_0x0f29('0x16')]?_0x5d72a5[_0x0f29('0x16')][_0x0f29('0x17')]===undefined?!![]:![]:!![],'where':_0x5d72a5[_0x0f29('0x16')]?_0x5d72a5[_0x0f29('0x16')][_0x0f29('0x18')]||null:null,'attributes':_0x5d72a5['options']?_0x5d72a5[_0x0f29('0x16')]['attributes']||null:null,'limit':_0x5d72a5['options']?_0x5d72a5['options']['limit']||null:null,'include':_0x5d72a5[_0x0f29('0x16')]?_0x5d72a5[_0x0f29('0x16')]['include']?_[_0x0f29('0x19')](_0x5d72a5[_0x0f29('0x16')][_0x0f29('0x1a')],function(_0x3402dc){return{'model':db[_0x3402dc[_0x0f29('0x1b')]],'as':_0x3402dc['as'],'attributes':_0x3402dc['attributes'],'include':_0x3402dc[_0x0f29('0x1a')]?_['map'](_0x3402dc[_0x0f29('0x1a')],function(_0x26f46f){return{'model':db[_0x26f46f[_0x0f29('0x1b')]],'as':_0x26f46f['as'],'attributes':_0x26f46f[_0x0f29('0x1c')],'include':_0x26f46f['include']?_[_0x0f29('0x19')](_0x26f46f['include'],function(_0x58b201){return{'model':db[_0x58b201[_0x0f29('0x1b')]],'as':_0x58b201['as'],'attributes':_0x58b201['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x57dcc7){logger['info'](_0x0f29('0x14'),_0x5d72a5);logger[_0x0f29('0xe')]('GetVtigerAccount',_0x5d72a5,JSON[_0x0f29('0x1d')](_0x57dcc7));_0x4ca5e8(_0x57dcc7);})[_0x0f29('0x13')](function(_0x274c9d){logger['error']('GetVtigerAccount',_0x274c9d[_0x0f29('0x12')],_0x5d72a5);_0x5ddc74(_0x17b994['error'](0x1f4,_0x274c9d[_0x0f29('0x12')]));});});};exports['ShowVtigerAccount']=function(_0x526364){var _0x7b10f=this;return new Promise(function(_0x409b19,_0xf59431){return db[_0x0f29('0x1e')]['find']({'raw':_0x526364['options']?_0x526364[_0x0f29('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x526364['options']?_0x526364[_0x0f29('0x16')]['where']||null:null,'attributes':_0x526364[_0x0f29('0x16')]?_0x526364['options']['attributes']||null:null,'include':_0x526364[_0x0f29('0x16')]?_0x526364[_0x0f29('0x16')][_0x0f29('0x1a')]?_[_0x0f29('0x19')](_0x526364[_0x0f29('0x16')]['include'],function(_0x426a3e){return{'model':db[_0x426a3e['model']],'as':_0x426a3e['as'],'attributes':_0x426a3e[_0x0f29('0x1c')],'include':_0x426a3e[_0x0f29('0x1a')]?_[_0x0f29('0x19')](_0x426a3e[_0x0f29('0x1a')],function(_0x4852a5){return{'model':db[_0x4852a5[_0x0f29('0x1b')]],'as':_0x4852a5['as'],'attributes':_0x4852a5[_0x0f29('0x1c')],'include':_0x4852a5['include']?_[_0x0f29('0x19')](_0x4852a5[_0x0f29('0x1a')],function(_0x5e40ac){return{'model':db[_0x5e40ac['model']],'as':_0x5e40ac['as'],'attributes':_0x5e40ac[_0x0f29('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x0f29('0xa')](function(_0x3691d4){logger[_0x0f29('0xb')](_0x0f29('0x1f'),_0x526364);logger[_0x0f29('0xe')]('ShowVtigerAccount',_0x526364,JSON[_0x0f29('0x1d')](_0x3691d4));_0x409b19(_0x3691d4);})['catch'](function(_0x331dc7){logger['error'](_0x0f29('0x1f'),_0x331dc7[_0x0f29('0x12')],_0x526364);_0xf59431(_0x7b10f[_0x0f29('0x10')](0x1f4,_0x331dc7['message']));});});};
\ No newline at end of file
index 2827739..098e470 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x62df=['../../config/environment','./intVtigerConfiguration.controller','isAuthenticated','index','/:id','/:id/fields','get','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x153f66,_0x378889){var _0x31dc3a=function(_0x15a3ea){while(--_0x15a3ea){_0x153f66['push'](_0x153f66['shift']());}};_0x31dc3a(++_0x378889);}(_0x62df,0x105));var _0xf62d=function(_0x1e2e4c,_0xd72dd4){_0x1e2e4c=_0x1e2e4c-0x0;var _0x5f50be=_0x62df[_0x1e2e4c];return _0x5f50be;};'use strict';var multer=require(_0xf62d('0x0'));var util=require(_0xf62d('0x1'));var path=require(_0xf62d('0x2'));var timeout=require(_0xf62d('0x3'));var express=require(_0xf62d('0x4'));var router=express[_0xf62d('0x5')]();var fs_extra=require(_0xf62d('0x6'));var auth=require(_0xf62d('0x7'));var interaction=require(_0xf62d('0x8'));var config=require(_0xf62d('0x9'));var controller=require(_0xf62d('0xa'));router['get']('/',auth[_0xf62d('0xb')](),controller[_0xf62d('0xc')]);router['get'](_0xf62d('0xd'),auth[_0xf62d('0xb')](),controller['show']);router['get'](_0xf62d('0xe'),auth[_0xf62d('0xb')](),controller['getFields']);router[_0xf62d('0xf')](_0xf62d('0x10'),auth[_0xf62d('0xb')](),controller[_0xf62d('0x11')]);router[_0xf62d('0xf')](_0xf62d('0x12'),auth['isAuthenticated'](),controller[_0xf62d('0x13')]);router[_0xf62d('0x14')]('/',auth[_0xf62d('0xb')](),controller[_0xf62d('0x15')]);router[_0xf62d('0x16')](_0xf62d('0xd'),auth['isAuthenticated'](),controller[_0xf62d('0x17')]);router[_0xf62d('0x18')]('/:id',auth[_0xf62d('0xb')](),controller[_0xf62d('0x19')]);module[_0xf62d('0x1a')]=router;
\ No newline at end of file
+var _0x3046=['/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','put','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x13ac59,_0x3a194e){var _0x7ce302=function(_0x206974){while(--_0x206974){_0x13ac59['push'](_0x13ac59['shift']());}};_0x7ce302(++_0x3a194e);}(_0x3046,0x1d9));var _0x6304=function(_0x403695,_0x1480ab){_0x403695=_0x403695-0x0;var _0x1771da=_0x3046[_0x403695];return _0x1771da;};'use strict';var multer=require(_0x6304('0x0'));var util=require(_0x6304('0x1'));var path=require(_0x6304('0x2'));var timeout=require('connect-timeout');var express=require(_0x6304('0x3'));var router=express[_0x6304('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6304('0x5'));var interaction=require(_0x6304('0x6'));var config=require(_0x6304('0x7'));var controller=require('./intVtigerConfiguration.controller');router[_0x6304('0x8')]('/',auth[_0x6304('0x9')](),controller[_0x6304('0xa')]);router['get'](_0x6304('0xb'),auth['isAuthenticated'](),controller[_0x6304('0xc')]);router[_0x6304('0x8')](_0x6304('0xd'),auth[_0x6304('0x9')](),controller['getFields']);router[_0x6304('0x8')](_0x6304('0xe'),auth['isAuthenticated'](),controller[_0x6304('0xf')]);router['get'](_0x6304('0x10'),auth['isAuthenticated'](),controller[_0x6304('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x6304('0x12')](_0x6304('0xb'),auth[_0x6304('0x9')](),controller[_0x6304('0x13')]);router['delete']('/:id',auth[_0x6304('0x9')](),controller[_0x6304('0x14')]);module[_0x6304('0x15')]=router;
\ No newline at end of file
index 7e57ace..5555f14 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d86=['sequelize','STRING'];(function(_0x3e151d,_0x5b96a8){var _0x10ad6a=function(_0x57fddf){while(--_0x57fddf){_0x3e151d['push'](_0x3e151d['shift']());}};_0x10ad6a(++_0x5b96a8);}(_0x1d86,0xe8));var _0x61d8=function(_0x2f61d3,_0x232a49){_0x2f61d3=_0x2f61d3-0x0;var _0xbdcdf9=_0x1d86[_0x2f61d3];return _0xbdcdf9;};'use strict';var Sequelize=require(_0x61d8('0x0'));module['exports']={'name':{'type':Sequelize[_0x61d8('0x1')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x0069=['exports','STRING'];(function(_0x100e36,_0x4da225){var _0x1df0c9=function(_0xe4b84f){while(--_0xe4b84f){_0x100e36['push'](_0x100e36['shift']());}};_0x1df0c9(++_0x4da225);}(_0x0069,0x1e8));var _0x9006=function(_0x116573,_0x234dde){_0x116573=_0x116573-0x0;var _0x4274e0=_0x0069[_0x116573];return _0x4274e0;};'use strict';var Sequelize=require('sequelize');module[_0x9006('0x0')]={'name':{'type':Sequelize[_0x9006('0x1')]},'description':{'type':Sequelize[_0x9006('0x1')]}};
\ No newline at end of file
index 10627a7..2dc34fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb1db=['mustache','util','path','sox','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','catch','params','includeAll','include','merge','find','create','body','getFields','findOne','VtigerField','pick','getSubjects','getDescriptions','fast-json-patch','request-promise','moment','bluebird'];(function(_0x9db5d3,_0x4eea5e){var _0x477a81=function(_0x28e774){while(--_0x28e774){_0x9db5d3['push'](_0x9db5d3['shift']());}};_0x477a81(++_0x4eea5e);}(_0xb1db,0x1be));var _0xbb1d=function(_0x7b102d,_0x414b58){_0x7b102d=_0x7b102d-0x0;var _0x235e07=_0xb1db[_0x7b102d];return _0x235e07;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbb1d('0x0'));var rp=require(_0xbb1d('0x1'));var moment=require(_0xbb1d('0x2'));var BPromise=require(_0xbb1d('0x3'));var Mustache=require(_0xbb1d('0x4'));var util=require(_0xbb1d('0x5'));var path=require(_0xbb1d('0x6'));var sox=require(_0xbb1d('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb1d('0x8'));var squel=require('squel');var crypto=require(_0xbb1d('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xbb1d('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbb1d('0xb'));var Redis=require(_0xbb1d('0xc'));var authService=require(_0xbb1d('0xd'));var qs=require(_0xbb1d('0xe'));var as=require(_0xbb1d('0xf'));var hardwareService=require(_0xbb1d('0x10'));var logger=require(_0xbb1d('0x11'))('api');var utils=require(_0xbb1d('0x12'));var config=require(_0xbb1d('0x13'));var licenseUtil=require(_0xbb1d('0x14'));var db=require(_0xbb1d('0x15'))['db'];function respondWithStatusCode(_0x306a5e,_0x5b745a){_0x5b745a=_0x5b745a||0xcc;return function(_0x12bbfb){if(_0x12bbfb){return _0x306a5e['sendStatus'](_0x5b745a);}return _0x306a5e[_0xbb1d('0x16')](_0x5b745a)[_0xbb1d('0x17')]();};}function respondWithResult(_0x5c77a7,_0x42bf50){_0x42bf50=_0x42bf50||0xc8;return function(_0x24c0a0){if(_0x24c0a0){return _0x5c77a7['status'](_0x42bf50)[_0xbb1d('0x18')](_0x24c0a0);}};}function respondWithFilteredResult(_0x35e3b4,_0x299f42){return function(_0x508d62){if(_0x508d62){var _0x823303=typeof _0x299f42[_0xbb1d('0x19')]===_0xbb1d('0x1a')&&typeof _0x299f42[_0xbb1d('0x1b')]===_0xbb1d('0x1a');var _0x3a6754=_0x508d62[_0xbb1d('0x1c')];var _0x3454a0=_0x823303?0x0:_0x299f42['offset'];var _0x2305a7=_0x823303?_0x508d62[_0xbb1d('0x1c')]:_0x299f42['offset']+_0x299f42['limit'];var _0x12f69e;if(_0x2305a7>=_0x3a6754){_0x2305a7=_0x3a6754;_0x12f69e=0xc8;}else{_0x12f69e=0xce;}_0x35e3b4[_0xbb1d('0x16')](_0x12f69e);return _0x35e3b4[_0xbb1d('0x1d')](_0xbb1d('0x1e'),_0x3454a0+'-'+_0x2305a7+'/'+_0x3a6754)[_0xbb1d('0x18')](_0x508d62);}return null;};}function patchUpdates(_0x3fa0f1){return function(_0x19e2f0){try{jsonpatch['apply'](_0x19e2f0,_0x3fa0f1,!![]);}catch(_0x364395){return BPromise['reject'](_0x364395);}return _0x19e2f0['save']();};}function saveUpdates(_0x1b19a6,_0x150a55){return function(_0x35e867){if(_0x35e867){return _0x35e867[_0xbb1d('0x1f')](_0x1b19a6)[_0xbb1d('0x20')](function(_0x3223f7){return _0x3223f7;});}return null;};}function removeEntity(_0x31b38a,_0xe9f35a){return function(_0x4a296b){if(_0x4a296b){return _0x4a296b[_0xbb1d('0x21')]()[_0xbb1d('0x20')](function(){_0x31b38a[_0xbb1d('0x16')](0xcc)[_0xbb1d('0x17')]();});}};}function handleEntityNotFound(_0x86e9ec,_0x9678c0){return function(_0x18f75e){if(!_0x18f75e){_0x86e9ec['sendStatus'](0x194);}return _0x18f75e;};}function handleError(_0x41c770,_0x59afb9){_0x59afb9=_0x59afb9||0x1f4;return function(_0x42e3ea){logger[_0xbb1d('0x22')](_0x42e3ea[_0xbb1d('0x23')]);if(_0x42e3ea[_0xbb1d('0x24')]){delete _0x42e3ea[_0xbb1d('0x24')];}_0x41c770[_0xbb1d('0x16')](_0x59afb9)[_0xbb1d('0x25')](_0x42e3ea);};}exports[_0xbb1d('0x26')]=function(_0x4173b7,_0x82af72){var _0x107e35={},_0x1bc70c={},_0x9bc6aa={'count':0x0,'rows':[]};var _0x1db0cc=_[_0xbb1d('0x27')](db[_0xbb1d('0x28')][_0xbb1d('0x29')],function(_0xcd3c94){return{'name':_0xcd3c94[_0xbb1d('0x2a')],'type':_0xcd3c94[_0xbb1d('0x2b')][_0xbb1d('0x2c')]};});_0x1bc70c[_0xbb1d('0x2d')]=_[_0xbb1d('0x27')](_0x1db0cc,_0xbb1d('0x24'));_0x1bc70c[_0xbb1d('0x2e')]=_[_0xbb1d('0x2f')](_0x4173b7['query']);_0x1bc70c[_0xbb1d('0x30')]=_[_0xbb1d('0x31')](_0x1bc70c[_0xbb1d('0x2d')],_0x1bc70c[_0xbb1d('0x2e')]);_0x107e35[_0xbb1d('0x32')]=_[_0xbb1d('0x31')](_0x1bc70c[_0xbb1d('0x2d')],qs['fields'](_0x4173b7[_0xbb1d('0x2e')][_0xbb1d('0x33')]));_0x107e35[_0xbb1d('0x32')]=_0x107e35[_0xbb1d('0x32')][_0xbb1d('0x34')]?_0x107e35['attributes']:_0x1bc70c[_0xbb1d('0x2d')];if(!_0x4173b7[_0xbb1d('0x2e')][_0xbb1d('0x35')](_0xbb1d('0x36'))){_0x107e35[_0xbb1d('0x1b')]=qs[_0xbb1d('0x1b')](_0x4173b7[_0xbb1d('0x2e')][_0xbb1d('0x1b')]);_0x107e35[_0xbb1d('0x19')]=qs['offset'](_0x4173b7['query']['offset']);}_0x107e35[_0xbb1d('0x37')]=qs[_0xbb1d('0x38')](_0x4173b7['query']['sort']);_0x107e35[_0xbb1d('0x39')]=qs['filters'](_['pick'](_0x4173b7['query'],_0x1bc70c[_0xbb1d('0x30')]),_0x1db0cc);if(_0x4173b7['query'][_0xbb1d('0x3a')]){_0x107e35[_0xbb1d('0x39')]=_['merge'](_0x107e35[_0xbb1d('0x39')],{'$or':_[_0xbb1d('0x27')](_0x1db0cc,function(_0x29f534){if(_0x29f534[_0xbb1d('0x2b')]!==_0xbb1d('0x3b')){var _0x53206f={};_0x53206f[_0x29f534[_0xbb1d('0x24')]]={'$like':'%'+_0x4173b7[_0xbb1d('0x2e')][_0xbb1d('0x3a')]+'%'};return _0x53206f;}})});}_0x107e35=_['merge']({},_0x107e35,_0x4173b7[_0xbb1d('0x3c')]);var _0x1f1090={'where':_0x107e35[_0xbb1d('0x39')]};return db[_0xbb1d('0x28')][_0xbb1d('0x1c')](_0x1f1090)[_0xbb1d('0x20')](function(_0x5149c5){_0x9bc6aa['count']=_0x5149c5;if(_0x4173b7['query']['includeAll']){_0x107e35['include']=[{'all':!![]}];}return db[_0xbb1d('0x28')]['findAll'](_0x107e35);})[_0xbb1d('0x20')](function(_0x4447fe){_0x9bc6aa['rows']=_0x4447fe;return _0x9bc6aa;})['then'](respondWithFilteredResult(_0x82af72,_0x107e35))[_0xbb1d('0x3d')](handleError(_0x82af72,null));};exports['show']=function(_0x2a7847,_0x3b18ff){var _0x526377={'raw':![],'where':{'id':_0x2a7847[_0xbb1d('0x3e')]['id']}},_0x46d5e9={};_0x46d5e9['model']=_[_0xbb1d('0x2f')](db[_0xbb1d('0x28')][_0xbb1d('0x29')]);_0x46d5e9['query']=_[_0xbb1d('0x2f')](_0x2a7847[_0xbb1d('0x2e')]);_0x46d5e9['filters']=_[_0xbb1d('0x31')](_0x46d5e9['model'],_0x46d5e9['query']);_0x526377[_0xbb1d('0x32')]=_[_0xbb1d('0x31')](_0x46d5e9[_0xbb1d('0x2d')],qs[_0xbb1d('0x33')](_0x2a7847['query'][_0xbb1d('0x33')]));_0x526377[_0xbb1d('0x32')]=_0x526377['attributes'][_0xbb1d('0x34')]?_0x526377[_0xbb1d('0x32')]:_0x46d5e9[_0xbb1d('0x2d')];if(_0x2a7847[_0xbb1d('0x2e')][_0xbb1d('0x3f')]){_0x526377[_0xbb1d('0x40')]=[{'all':!![]}];}_0x526377=_[_0xbb1d('0x41')]({},_0x526377,_0x2a7847[_0xbb1d('0x3c')]);return db[_0xbb1d('0x28')][_0xbb1d('0x42')](_0x526377)[_0xbb1d('0x20')](handleEntityNotFound(_0x3b18ff,null))['then'](respondWithResult(_0x3b18ff,null))[_0xbb1d('0x3d')](handleError(_0x3b18ff,null));};exports[_0xbb1d('0x43')]=function(_0x133f0a,_0x1a48ae){return db[_0xbb1d('0x28')]['create'](_0x133f0a[_0xbb1d('0x44')],{})[_0xbb1d('0x20')](respondWithResult(_0x1a48ae,0xc9))['catch'](handleError(_0x1a48ae,null));};exports[_0xbb1d('0x1f')]=function(_0x5b2ccc,_0x596602){if(_0x5b2ccc[_0xbb1d('0x44')]['id']){delete _0x5b2ccc[_0xbb1d('0x44')]['id'];}return db[_0xbb1d('0x28')]['find']({'where':{'id':_0x5b2ccc[_0xbb1d('0x3e')]['id']}})['then'](handleEntityNotFound(_0x596602,null))[_0xbb1d('0x20')](saveUpdates(_0x5b2ccc[_0xbb1d('0x44')],null))[_0xbb1d('0x20')](respondWithResult(_0x596602,null))[_0xbb1d('0x3d')](handleError(_0x596602,null));};exports[_0xbb1d('0x21')]=function(_0x450885,_0x29be01){return db['VtigerConfiguration'][_0xbb1d('0x42')]({'where':{'id':_0x450885[_0xbb1d('0x3e')]['id']}})['then'](handleEntityNotFound(_0x29be01,null))[_0xbb1d('0x20')](removeEntity(_0x29be01,null))[_0xbb1d('0x3d')](handleError(_0x29be01,null));};exports[_0xbb1d('0x45')]=function(_0x15c858,_0x312ad3,_0x5bf156){var _0x3bf167={};var _0x4cfb7e={};var _0x449938;var _0xfe7278;return db[_0xbb1d('0x28')][_0xbb1d('0x46')]({'where':{'id':_0x15c858[_0xbb1d('0x3e')]['id']}})['then'](handleEntityNotFound(_0x312ad3,null))[_0xbb1d('0x20')](function(_0x153cfc){if(_0x153cfc){_0x449938=_0x153cfc;_0x4cfb7e[_0xbb1d('0x2d')]=_[_0xbb1d('0x2f')](db[_0xbb1d('0x47')][_0xbb1d('0x29')]);_0x4cfb7e[_0xbb1d('0x2e')]=_['keys'](_0x15c858[_0xbb1d('0x2e')]);_0x4cfb7e[_0xbb1d('0x30')]=_[_0xbb1d('0x31')](_0x4cfb7e[_0xbb1d('0x2d')],_0x4cfb7e[_0xbb1d('0x2e')]);_0x3bf167[_0xbb1d('0x32')]=_[_0xbb1d('0x31')](_0x4cfb7e[_0xbb1d('0x2d')],qs[_0xbb1d('0x33')](_0x15c858[_0xbb1d('0x2e')][_0xbb1d('0x33')]));_0x3bf167[_0xbb1d('0x32')]=_0x3bf167['attributes'][_0xbb1d('0x34')]?_0x3bf167[_0xbb1d('0x32')]:_0x4cfb7e['model'];_0x3bf167[_0xbb1d('0x37')]=qs[_0xbb1d('0x38')](_0x15c858['query'][_0xbb1d('0x38')]);_0x3bf167[_0xbb1d('0x39')]=qs[_0xbb1d('0x30')](_[_0xbb1d('0x48')](_0x15c858['query'],_0x4cfb7e['filters']));if(_0x15c858[_0xbb1d('0x2e')][_0xbb1d('0x3a')]){_0x3bf167['where']=_[_0xbb1d('0x41')](_0x3bf167[_0xbb1d('0x39')],{'$or':_[_0xbb1d('0x27')](_0x3bf167[_0xbb1d('0x32')],function(_0x315189){var _0x57ee51={};_0x57ee51[_0x315189]={'$like':'%'+_0x15c858[_0xbb1d('0x2e')]['filter']+'%'};return _0x57ee51;})});}_0x3bf167=_[_0xbb1d('0x41')]({},_0x3bf167,_0x15c858[_0xbb1d('0x3c')]);return _0x449938[_0xbb1d('0x45')](_0x3bf167);}})['then'](function(_0x3277d0){if(_0x3277d0){_0xfe7278=_0x3277d0[_0xbb1d('0x34')];if(!_0x15c858[_0xbb1d('0x2e')][_0xbb1d('0x35')](_0xbb1d('0x36'))){_0x3bf167[_0xbb1d('0x1b')]=qs[_0xbb1d('0x1b')](_0x15c858[_0xbb1d('0x2e')][_0xbb1d('0x1b')]);_0x3bf167[_0xbb1d('0x19')]=qs[_0xbb1d('0x19')](_0x15c858['query']['offset']);}return _0x449938[_0xbb1d('0x45')](_0x3bf167);}})[_0xbb1d('0x20')](function(_0x3f9869){if(_0x3f9869){return _0x3f9869?{'count':_0xfe7278,'rows':_0x3f9869}:null;}})[_0xbb1d('0x20')](respondWithResult(_0x312ad3,null))[_0xbb1d('0x3d')](handleError(_0x312ad3,null));};exports['getSubjects']=function(_0x43770d,_0xc66624,_0x51b86c){var _0x5262cc={};var _0x4ceadd={};var _0x2b2536;var _0x2b128d;return db[_0xbb1d('0x28')][_0xbb1d('0x46')]({'where':{'id':_0x43770d[_0xbb1d('0x3e')]['id']}})[_0xbb1d('0x20')](handleEntityNotFound(_0xc66624,null))[_0xbb1d('0x20')](function(_0x13de43){if(_0x13de43){_0x2b2536=_0x13de43;_0x4ceadd[_0xbb1d('0x2d')]=_[_0xbb1d('0x2f')](db[_0xbb1d('0x47')][_0xbb1d('0x29')]);_0x4ceadd[_0xbb1d('0x2e')]=_[_0xbb1d('0x2f')](_0x43770d['query']);_0x4ceadd[_0xbb1d('0x30')]=_[_0xbb1d('0x31')](_0x4ceadd[_0xbb1d('0x2d')],_0x4ceadd[_0xbb1d('0x2e')]);_0x5262cc[_0xbb1d('0x32')]=_[_0xbb1d('0x31')](_0x4ceadd[_0xbb1d('0x2d')],qs[_0xbb1d('0x33')](_0x43770d[_0xbb1d('0x2e')]['fields']));_0x5262cc[_0xbb1d('0x32')]=_0x5262cc[_0xbb1d('0x32')][_0xbb1d('0x34')]?_0x5262cc[_0xbb1d('0x32')]:_0x4ceadd[_0xbb1d('0x2d')];_0x5262cc['order']=qs[_0xbb1d('0x38')](_0x43770d['query'][_0xbb1d('0x38')]);_0x5262cc[_0xbb1d('0x39')]=qs[_0xbb1d('0x30')](_[_0xbb1d('0x48')](_0x43770d[_0xbb1d('0x2e')],_0x4ceadd[_0xbb1d('0x30')]));if(_0x43770d['query'][_0xbb1d('0x3a')]){_0x5262cc[_0xbb1d('0x39')]=_[_0xbb1d('0x41')](_0x5262cc[_0xbb1d('0x39')],{'$or':_['map'](_0x5262cc['attributes'],function(_0x5932a9){var _0x5f5292={};_0x5f5292[_0x5932a9]={'$like':'%'+_0x43770d['query'][_0xbb1d('0x3a')]+'%'};return _0x5f5292;})});}_0x5262cc=_['merge']({},_0x5262cc,_0x43770d[_0xbb1d('0x3c')]);return _0x2b2536[_0xbb1d('0x49')](_0x5262cc);}})[_0xbb1d('0x20')](function(_0x559fd8){if(_0x559fd8){_0x2b128d=_0x559fd8[_0xbb1d('0x34')];if(!_0x43770d[_0xbb1d('0x2e')][_0xbb1d('0x35')](_0xbb1d('0x36'))){_0x5262cc[_0xbb1d('0x1b')]=qs[_0xbb1d('0x1b')](_0x43770d[_0xbb1d('0x2e')]['limit']);_0x5262cc[_0xbb1d('0x19')]=qs['offset'](_0x43770d[_0xbb1d('0x2e')][_0xbb1d('0x19')]);}return _0x2b2536['getSubjects'](_0x5262cc);}})[_0xbb1d('0x20')](function(_0x2349b9){if(_0x2349b9){return _0x2349b9?{'count':_0x2b128d,'rows':_0x2349b9}:null;}})[_0xbb1d('0x20')](respondWithResult(_0xc66624,null))[_0xbb1d('0x3d')](handleError(_0xc66624,null));};exports[_0xbb1d('0x4a')]=function(_0x12c2b3,_0x1a14e2,_0x23233e){var _0x2c15b4={};var _0x2715fb={};var _0xd9afc8;var _0xffd31d;return db['VtigerConfiguration'][_0xbb1d('0x46')]({'where':{'id':_0x12c2b3[_0xbb1d('0x3e')]['id']}})[_0xbb1d('0x20')](handleEntityNotFound(_0x1a14e2,null))[_0xbb1d('0x20')](function(_0x152303){if(_0x152303){_0xd9afc8=_0x152303;_0x2715fb['model']=_[_0xbb1d('0x2f')](db['VtigerField']['rawAttributes']);_0x2715fb[_0xbb1d('0x2e')]=_[_0xbb1d('0x2f')](_0x12c2b3[_0xbb1d('0x2e')]);_0x2715fb[_0xbb1d('0x30')]=_[_0xbb1d('0x31')](_0x2715fb[_0xbb1d('0x2d')],_0x2715fb[_0xbb1d('0x2e')]);_0x2c15b4[_0xbb1d('0x32')]=_[_0xbb1d('0x31')](_0x2715fb['model'],qs[_0xbb1d('0x33')](_0x12c2b3[_0xbb1d('0x2e')][_0xbb1d('0x33')]));_0x2c15b4['attributes']=_0x2c15b4[_0xbb1d('0x32')][_0xbb1d('0x34')]?_0x2c15b4['attributes']:_0x2715fb[_0xbb1d('0x2d')];_0x2c15b4[_0xbb1d('0x37')]=qs[_0xbb1d('0x38')](_0x12c2b3['query'][_0xbb1d('0x38')]);_0x2c15b4[_0xbb1d('0x39')]=qs[_0xbb1d('0x30')](_[_0xbb1d('0x48')](_0x12c2b3[_0xbb1d('0x2e')],_0x2715fb['filters']));if(_0x12c2b3[_0xbb1d('0x2e')][_0xbb1d('0x3a')]){_0x2c15b4[_0xbb1d('0x39')]=_[_0xbb1d('0x41')](_0x2c15b4[_0xbb1d('0x39')],{'$or':_[_0xbb1d('0x27')](_0x2c15b4[_0xbb1d('0x32')],function(_0x4202f2){var _0x25ac1d={};_0x25ac1d[_0x4202f2]={'$like':'%'+_0x12c2b3[_0xbb1d('0x2e')][_0xbb1d('0x3a')]+'%'};return _0x25ac1d;})});}_0x2c15b4=_[_0xbb1d('0x41')]({},_0x2c15b4,_0x12c2b3['options']);return _0xd9afc8['getDescriptions'](_0x2c15b4);}})[_0xbb1d('0x20')](function(_0x577a72){if(_0x577a72){_0xffd31d=_0x577a72[_0xbb1d('0x34')];if(!_0x12c2b3[_0xbb1d('0x2e')][_0xbb1d('0x35')](_0xbb1d('0x36'))){_0x2c15b4[_0xbb1d('0x1b')]=qs[_0xbb1d('0x1b')](_0x12c2b3['query']['limit']);_0x2c15b4['offset']=qs[_0xbb1d('0x19')](_0x12c2b3[_0xbb1d('0x2e')][_0xbb1d('0x19')]);}return _0xd9afc8[_0xbb1d('0x4a')](_0x2c15b4);}})[_0xbb1d('0x20')](function(_0x1a0d4c){if(_0x1a0d4c){return _0x1a0d4c?{'count':_0xffd31d,'rows':_0x1a0d4c}:null;}})[_0xbb1d('0x20')](respondWithResult(_0x1a14e2,null))['catch'](handleError(_0x1a14e2,null));};
\ No newline at end of file
+var _0xc5ab=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','keys','length','find','create','body','catch','getFields','findOne','VtigerField','getSubjects','getDescriptions','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort'];(function(_0x2ac512,_0x18d0fc){var _0x41a20e=function(_0x4c1ac2){while(--_0x4c1ac2){_0x2ac512['push'](_0x2ac512['shift']());}};_0x41a20e(++_0x18d0fc);}(_0xc5ab,0x19b));var _0xbc5a=function(_0x1d7da6,_0x1ac18a){_0x1d7da6=_0x1d7da6-0x0;var _0x48475c=_0xc5ab[_0x1d7da6];return _0x48475c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbc5a('0x0'));var zipdir=require(_0xbc5a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbc5a('0x2'));var moment=require(_0xbc5a('0x3'));var BPromise=require(_0xbc5a('0x4'));var Mustache=require('mustache');var util=require(_0xbc5a('0x5'));var path=require(_0xbc5a('0x6'));var sox=require(_0xbc5a('0x7'));var csv=require(_0xbc5a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbc5a('0x9'));var _=require(_0xbc5a('0xa'));var squel=require(_0xbc5a('0xb'));var crypto=require('crypto');var jsforce=require(_0xbc5a('0xc'));var deskjs=require(_0xbc5a('0xd'));var toCsv=require(_0xbc5a('0x8'));var querystring=require(_0xbc5a('0xe'));var Papa=require(_0xbc5a('0xf'));var Redis=require(_0xbc5a('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbc5a('0x11'));var hardwareService=require(_0xbc5a('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0xbc5a('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xbc5a('0x14'));var db=require(_0xbc5a('0x15'))['db'];function respondWithStatusCode(_0x34194d,_0x2a2364){_0x2a2364=_0x2a2364||0xcc;return function(_0x4560ff){if(_0x4560ff){return _0x34194d[_0xbc5a('0x16')](_0x2a2364);}return _0x34194d[_0xbc5a('0x17')](_0x2a2364)[_0xbc5a('0x18')]();};}function respondWithResult(_0x45850d,_0x13ef0c){_0x13ef0c=_0x13ef0c||0xc8;return function(_0x5f3afe){if(_0x5f3afe){return _0x45850d[_0xbc5a('0x17')](_0x13ef0c)[_0xbc5a('0x19')](_0x5f3afe);}};}function respondWithFilteredResult(_0x58d65e,_0x4b62da){return function(_0x30efed){if(_0x30efed){var _0x331e8e=typeof _0x4b62da[_0xbc5a('0x1a')]===_0xbc5a('0x1b')&&typeof _0x4b62da[_0xbc5a('0x1c')]===_0xbc5a('0x1b');var _0x1d94bb=_0x30efed[_0xbc5a('0x1d')];var _0x38ace4=_0x331e8e?0x0:_0x4b62da['offset'];var _0x58c6b2=_0x331e8e?_0x30efed[_0xbc5a('0x1d')]:_0x4b62da[_0xbc5a('0x1a')]+_0x4b62da['limit'];var _0x2be95c;if(_0x58c6b2>=_0x1d94bb){_0x58c6b2=_0x1d94bb;_0x2be95c=0xc8;}else{_0x2be95c=0xce;}_0x58d65e[_0xbc5a('0x17')](_0x2be95c);return _0x58d65e['set'](_0xbc5a('0x1e'),_0x38ace4+'-'+_0x58c6b2+'/'+_0x1d94bb)[_0xbc5a('0x19')](_0x30efed);}return null;};}function patchUpdates(_0x5db1bd){return function(_0x5d51d8){try{jsonpatch[_0xbc5a('0x1f')](_0x5d51d8,_0x5db1bd,!![]);}catch(_0x4e2a25){return BPromise[_0xbc5a('0x20')](_0x4e2a25);}return _0x5d51d8[_0xbc5a('0x21')]();};}function saveUpdates(_0x2c5f73,_0x4a4632){return function(_0x250f9c){if(_0x250f9c){return _0x250f9c[_0xbc5a('0x22')](_0x2c5f73)['then'](function(_0x175841){return _0x175841;});}return null;};}function removeEntity(_0xc32733,_0xda4ae1){return function(_0x181547){if(_0x181547){return _0x181547[_0xbc5a('0x23')]()[_0xbc5a('0x24')](function(){_0xc32733[_0xbc5a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39201c,_0x1dde73){return function(_0x2a5672){if(!_0x2a5672){_0x39201c[_0xbc5a('0x16')](0x194);}return _0x2a5672;};}function handleError(_0x2ebcc8,_0x42e2e0){_0x42e2e0=_0x42e2e0||0x1f4;return function(_0x512c4a){logger['error'](_0x512c4a[_0xbc5a('0x25')]);if(_0x512c4a[_0xbc5a('0x26')]){delete _0x512c4a[_0xbc5a('0x26')];}_0x2ebcc8[_0xbc5a('0x17')](_0x42e2e0)[_0xbc5a('0x27')](_0x512c4a);};}exports[_0xbc5a('0x28')]=function(_0x5467fa,_0xb2a53a){var _0xe8f451={},_0x2ebf9c={},_0x47347d={'count':0x0,'rows':[]};var _0x4f98ae=_[_0xbc5a('0x29')](db[_0xbc5a('0x2a')][_0xbc5a('0x2b')],function(_0x42e203){return{'name':_0x42e203[_0xbc5a('0x2c')],'type':_0x42e203[_0xbc5a('0x2d')][_0xbc5a('0x2e')]};});_0x2ebf9c[_0xbc5a('0x2f')]=_[_0xbc5a('0x29')](_0x4f98ae,_0xbc5a('0x26'));_0x2ebf9c[_0xbc5a('0x30')]=_['keys'](_0x5467fa[_0xbc5a('0x30')]);_0x2ebf9c[_0xbc5a('0x31')]=_[_0xbc5a('0x32')](_0x2ebf9c[_0xbc5a('0x2f')],_0x2ebf9c[_0xbc5a('0x30')]);_0xe8f451['attributes']=_['intersection'](_0x2ebf9c['model'],qs[_0xbc5a('0x33')](_0x5467fa[_0xbc5a('0x30')][_0xbc5a('0x33')]));_0xe8f451['attributes']=_0xe8f451[_0xbc5a('0x34')]['length']?_0xe8f451[_0xbc5a('0x34')]:_0x2ebf9c[_0xbc5a('0x2f')];if(!_0x5467fa[_0xbc5a('0x30')][_0xbc5a('0x35')](_0xbc5a('0x36'))){_0xe8f451['limit']=qs[_0xbc5a('0x1c')](_0x5467fa[_0xbc5a('0x30')][_0xbc5a('0x1c')]);_0xe8f451['offset']=qs[_0xbc5a('0x1a')](_0x5467fa[_0xbc5a('0x30')]['offset']);}_0xe8f451[_0xbc5a('0x37')]=qs['sort'](_0x5467fa['query'][_0xbc5a('0x38')]);_0xe8f451[_0xbc5a('0x39')]=qs[_0xbc5a('0x31')](_[_0xbc5a('0x3a')](_0x5467fa[_0xbc5a('0x30')],_0x2ebf9c['filters']),_0x4f98ae);if(_0x5467fa['query'][_0xbc5a('0x3b')]){_0xe8f451[_0xbc5a('0x39')]=_[_0xbc5a('0x3c')](_0xe8f451[_0xbc5a('0x39')],{'$or':_[_0xbc5a('0x29')](_0x4f98ae,function(_0x2cbcba){if(_0x2cbcba['type']!==_0xbc5a('0x3d')){var _0x2e3c49={};_0x2e3c49[_0x2cbcba['name']]={'$like':'%'+_0x5467fa[_0xbc5a('0x30')][_0xbc5a('0x3b')]+'%'};return _0x2e3c49;}})});}_0xe8f451=_[_0xbc5a('0x3c')]({},_0xe8f451,_0x5467fa[_0xbc5a('0x3e')]);var _0x35f91a={'where':_0xe8f451[_0xbc5a('0x39')]};return db[_0xbc5a('0x2a')]['count'](_0x35f91a)['then'](function(_0x28d131){_0x47347d[_0xbc5a('0x1d')]=_0x28d131;if(_0x5467fa['query'][_0xbc5a('0x3f')]){_0xe8f451[_0xbc5a('0x40')]=[{'all':!![]}];}return db[_0xbc5a('0x2a')][_0xbc5a('0x41')](_0xe8f451);})['then'](function(_0x1b48e7){_0x47347d['rows']=_0x1b48e7;return _0x47347d;})[_0xbc5a('0x24')](respondWithFilteredResult(_0xb2a53a,_0xe8f451))['catch'](handleError(_0xb2a53a,null));};exports['show']=function(_0x548a32,_0x2ba5b0){var _0x4533e5={'raw':![],'where':{'id':_0x548a32[_0xbc5a('0x42')]['id']}},_0x3b9723={};_0x3b9723[_0xbc5a('0x2f')]=_[_0xbc5a('0x43')](db[_0xbc5a('0x2a')][_0xbc5a('0x2b')]);_0x3b9723[_0xbc5a('0x30')]=_['keys'](_0x548a32['query']);_0x3b9723['filters']=_[_0xbc5a('0x32')](_0x3b9723[_0xbc5a('0x2f')],_0x3b9723[_0xbc5a('0x30')]);_0x4533e5[_0xbc5a('0x34')]=_[_0xbc5a('0x32')](_0x3b9723[_0xbc5a('0x2f')],qs[_0xbc5a('0x33')](_0x548a32[_0xbc5a('0x30')][_0xbc5a('0x33')]));_0x4533e5[_0xbc5a('0x34')]=_0x4533e5[_0xbc5a('0x34')][_0xbc5a('0x44')]?_0x4533e5[_0xbc5a('0x34')]:_0x3b9723[_0xbc5a('0x2f')];if(_0x548a32['query'][_0xbc5a('0x3f')]){_0x4533e5[_0xbc5a('0x40')]=[{'all':!![]}];}_0x4533e5=_[_0xbc5a('0x3c')]({},_0x4533e5,_0x548a32[_0xbc5a('0x3e')]);return db['VtigerConfiguration'][_0xbc5a('0x45')](_0x4533e5)[_0xbc5a('0x24')](handleEntityNotFound(_0x2ba5b0,null))[_0xbc5a('0x24')](respondWithResult(_0x2ba5b0,null))['catch'](handleError(_0x2ba5b0,null));};exports['create']=function(_0x4afb55,_0x417d76){return db[_0xbc5a('0x2a')][_0xbc5a('0x46')](_0x4afb55[_0xbc5a('0x47')],{})[_0xbc5a('0x24')](respondWithResult(_0x417d76,0xc9))[_0xbc5a('0x48')](handleError(_0x417d76,null));};exports[_0xbc5a('0x22')]=function(_0x1de3a2,_0x4fb045){if(_0x1de3a2[_0xbc5a('0x47')]['id']){delete _0x1de3a2[_0xbc5a('0x47')]['id'];}return db[_0xbc5a('0x2a')][_0xbc5a('0x45')]({'where':{'id':_0x1de3a2[_0xbc5a('0x42')]['id']}})['then'](handleEntityNotFound(_0x4fb045,null))['then'](saveUpdates(_0x1de3a2['body'],null))[_0xbc5a('0x24')](respondWithResult(_0x4fb045,null))[_0xbc5a('0x48')](handleError(_0x4fb045,null));};exports['destroy']=function(_0x1f6dfb,_0x4bbad5){return db[_0xbc5a('0x2a')][_0xbc5a('0x45')]({'where':{'id':_0x1f6dfb[_0xbc5a('0x42')]['id']}})['then'](handleEntityNotFound(_0x4bbad5,null))[_0xbc5a('0x24')](removeEntity(_0x4bbad5,null))[_0xbc5a('0x48')](handleError(_0x4bbad5,null));};exports[_0xbc5a('0x49')]=function(_0x5b7f2b,_0x2ad6d,_0xc68d0e){var _0x38edee={};var _0x23fef9={};var _0x448e25;var _0x33193c;return db[_0xbc5a('0x2a')][_0xbc5a('0x4a')]({'where':{'id':_0x5b7f2b[_0xbc5a('0x42')]['id']}})['then'](handleEntityNotFound(_0x2ad6d,null))[_0xbc5a('0x24')](function(_0x234fc6){if(_0x234fc6){_0x448e25=_0x234fc6;_0x23fef9['model']=_[_0xbc5a('0x43')](db[_0xbc5a('0x4b')][_0xbc5a('0x2b')]);_0x23fef9[_0xbc5a('0x30')]=_[_0xbc5a('0x43')](_0x5b7f2b[_0xbc5a('0x30')]);_0x23fef9['filters']=_['intersection'](_0x23fef9[_0xbc5a('0x2f')],_0x23fef9['query']);_0x38edee[_0xbc5a('0x34')]=_['intersection'](_0x23fef9['model'],qs[_0xbc5a('0x33')](_0x5b7f2b[_0xbc5a('0x30')][_0xbc5a('0x33')]));_0x38edee[_0xbc5a('0x34')]=_0x38edee[_0xbc5a('0x34')]['length']?_0x38edee[_0xbc5a('0x34')]:_0x23fef9[_0xbc5a('0x2f')];_0x38edee[_0xbc5a('0x37')]=qs[_0xbc5a('0x38')](_0x5b7f2b[_0xbc5a('0x30')][_0xbc5a('0x38')]);_0x38edee[_0xbc5a('0x39')]=qs[_0xbc5a('0x31')](_[_0xbc5a('0x3a')](_0x5b7f2b[_0xbc5a('0x30')],_0x23fef9['filters']));if(_0x5b7f2b[_0xbc5a('0x30')][_0xbc5a('0x3b')]){_0x38edee[_0xbc5a('0x39')]=_[_0xbc5a('0x3c')](_0x38edee[_0xbc5a('0x39')],{'$or':_[_0xbc5a('0x29')](_0x38edee[_0xbc5a('0x34')],function(_0x3bf80a){var _0x14273a={};_0x14273a[_0x3bf80a]={'$like':'%'+_0x5b7f2b[_0xbc5a('0x30')][_0xbc5a('0x3b')]+'%'};return _0x14273a;})});}_0x38edee=_['merge']({},_0x38edee,_0x5b7f2b[_0xbc5a('0x3e')]);return _0x448e25[_0xbc5a('0x49')](_0x38edee);}})[_0xbc5a('0x24')](function(_0x1f9b58){if(_0x1f9b58){_0x33193c=_0x1f9b58[_0xbc5a('0x44')];if(!_0x5b7f2b['query'][_0xbc5a('0x35')]('nolimit')){_0x38edee['limit']=qs['limit'](_0x5b7f2b[_0xbc5a('0x30')][_0xbc5a('0x1c')]);_0x38edee[_0xbc5a('0x1a')]=qs[_0xbc5a('0x1a')](_0x5b7f2b['query'][_0xbc5a('0x1a')]);}return _0x448e25[_0xbc5a('0x49')](_0x38edee);}})[_0xbc5a('0x24')](function(_0x55db99){if(_0x55db99){return _0x55db99?{'count':_0x33193c,'rows':_0x55db99}:null;}})[_0xbc5a('0x24')](respondWithResult(_0x2ad6d,null))['catch'](handleError(_0x2ad6d,null));};exports['getSubjects']=function(_0x535be9,_0x3bd95d,_0xeb847e){var _0x3b79fd={};var _0x58d8ce={};var _0x4c6050;var _0x5e6972;return db['VtigerConfiguration'][_0xbc5a('0x4a')]({'where':{'id':_0x535be9['params']['id']}})[_0xbc5a('0x24')](handleEntityNotFound(_0x3bd95d,null))[_0xbc5a('0x24')](function(_0x1aae02){if(_0x1aae02){_0x4c6050=_0x1aae02;_0x58d8ce['model']=_[_0xbc5a('0x43')](db[_0xbc5a('0x4b')][_0xbc5a('0x2b')]);_0x58d8ce['query']=_[_0xbc5a('0x43')](_0x535be9[_0xbc5a('0x30')]);_0x58d8ce[_0xbc5a('0x31')]=_[_0xbc5a('0x32')](_0x58d8ce[_0xbc5a('0x2f')],_0x58d8ce['query']);_0x3b79fd['attributes']=_[_0xbc5a('0x32')](_0x58d8ce[_0xbc5a('0x2f')],qs[_0xbc5a('0x33')](_0x535be9['query'][_0xbc5a('0x33')]));_0x3b79fd[_0xbc5a('0x34')]=_0x3b79fd[_0xbc5a('0x34')][_0xbc5a('0x44')]?_0x3b79fd[_0xbc5a('0x34')]:_0x58d8ce[_0xbc5a('0x2f')];_0x3b79fd['order']=qs[_0xbc5a('0x38')](_0x535be9[_0xbc5a('0x30')][_0xbc5a('0x38')]);_0x3b79fd[_0xbc5a('0x39')]=qs[_0xbc5a('0x31')](_[_0xbc5a('0x3a')](_0x535be9[_0xbc5a('0x30')],_0x58d8ce[_0xbc5a('0x31')]));if(_0x535be9['query'][_0xbc5a('0x3b')]){_0x3b79fd[_0xbc5a('0x39')]=_[_0xbc5a('0x3c')](_0x3b79fd[_0xbc5a('0x39')],{'$or':_['map'](_0x3b79fd[_0xbc5a('0x34')],function(_0x2d70fc){var _0x334005={};_0x334005[_0x2d70fc]={'$like':'%'+_0x535be9['query']['filter']+'%'};return _0x334005;})});}_0x3b79fd=_[_0xbc5a('0x3c')]({},_0x3b79fd,_0x535be9[_0xbc5a('0x3e')]);return _0x4c6050[_0xbc5a('0x4c')](_0x3b79fd);}})[_0xbc5a('0x24')](function(_0x50a29f){if(_0x50a29f){_0x5e6972=_0x50a29f[_0xbc5a('0x44')];if(!_0x535be9[_0xbc5a('0x30')][_0xbc5a('0x35')]('nolimit')){_0x3b79fd[_0xbc5a('0x1c')]=qs[_0xbc5a('0x1c')](_0x535be9[_0xbc5a('0x30')][_0xbc5a('0x1c')]);_0x3b79fd[_0xbc5a('0x1a')]=qs['offset'](_0x535be9[_0xbc5a('0x30')][_0xbc5a('0x1a')]);}return _0x4c6050[_0xbc5a('0x4c')](_0x3b79fd);}})[_0xbc5a('0x24')](function(_0x1c5632){if(_0x1c5632){return _0x1c5632?{'count':_0x5e6972,'rows':_0x1c5632}:null;}})[_0xbc5a('0x24')](respondWithResult(_0x3bd95d,null))[_0xbc5a('0x48')](handleError(_0x3bd95d,null));};exports[_0xbc5a('0x4d')]=function(_0x1c05ae,_0x4a26e2,_0x430023){var _0x1726cc={};var _0x17cd3e={};var _0x3c23e1;var _0x35dcd0;return db[_0xbc5a('0x2a')][_0xbc5a('0x4a')]({'where':{'id':_0x1c05ae['params']['id']}})[_0xbc5a('0x24')](handleEntityNotFound(_0x4a26e2,null))[_0xbc5a('0x24')](function(_0x3b1a54){if(_0x3b1a54){_0x3c23e1=_0x3b1a54;_0x17cd3e[_0xbc5a('0x2f')]=_[_0xbc5a('0x43')](db[_0xbc5a('0x4b')][_0xbc5a('0x2b')]);_0x17cd3e['query']=_[_0xbc5a('0x43')](_0x1c05ae[_0xbc5a('0x30')]);_0x17cd3e[_0xbc5a('0x31')]=_['intersection'](_0x17cd3e[_0xbc5a('0x2f')],_0x17cd3e[_0xbc5a('0x30')]);_0x1726cc['attributes']=_[_0xbc5a('0x32')](_0x17cd3e['model'],qs[_0xbc5a('0x33')](_0x1c05ae['query'][_0xbc5a('0x33')]));_0x1726cc[_0xbc5a('0x34')]=_0x1726cc['attributes'][_0xbc5a('0x44')]?_0x1726cc[_0xbc5a('0x34')]:_0x17cd3e[_0xbc5a('0x2f')];_0x1726cc[_0xbc5a('0x37')]=qs[_0xbc5a('0x38')](_0x1c05ae[_0xbc5a('0x30')][_0xbc5a('0x38')]);_0x1726cc[_0xbc5a('0x39')]=qs['filters'](_['pick'](_0x1c05ae[_0xbc5a('0x30')],_0x17cd3e[_0xbc5a('0x31')]));if(_0x1c05ae[_0xbc5a('0x30')][_0xbc5a('0x3b')]){_0x1726cc[_0xbc5a('0x39')]=_[_0xbc5a('0x3c')](_0x1726cc[_0xbc5a('0x39')],{'$or':_[_0xbc5a('0x29')](_0x1726cc['attributes'],function(_0x65a1f2){var _0x302a19={};_0x302a19[_0x65a1f2]={'$like':'%'+_0x1c05ae[_0xbc5a('0x30')][_0xbc5a('0x3b')]+'%'};return _0x302a19;})});}_0x1726cc=_[_0xbc5a('0x3c')]({},_0x1726cc,_0x1c05ae['options']);return _0x3c23e1[_0xbc5a('0x4d')](_0x1726cc);}})[_0xbc5a('0x24')](function(_0x1fdfec){if(_0x1fdfec){_0x35dcd0=_0x1fdfec[_0xbc5a('0x44')];if(!_0x1c05ae[_0xbc5a('0x30')][_0xbc5a('0x35')](_0xbc5a('0x36'))){_0x1726cc[_0xbc5a('0x1c')]=qs['limit'](_0x1c05ae['query'][_0xbc5a('0x1c')]);_0x1726cc[_0xbc5a('0x1a')]=qs[_0xbc5a('0x1a')](_0x1c05ae['query'][_0xbc5a('0x1a')]);}return _0x3c23e1[_0xbc5a('0x4d')](_0x1726cc);}})[_0xbc5a('0x24')](function(_0xb30cf0){if(_0xb30cf0){return _0xb30cf0?{'count':_0x35dcd0,'rows':_0xb30cf0}:null;}})[_0xbc5a('0x24')](respondWithResult(_0x4a26e2,null))['catch'](handleError(_0x4a26e2,null));};
\ No newline at end of file
index a13c3f5..20e1133 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe237=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','VtigerConfiguration','int_vtiger_configurations'];(function(_0x1a9ca4,_0x5115db){var _0x19a2c2=function(_0x13a68f){while(--_0x13a68f){_0x1a9ca4['push'](_0x1a9ca4['shift']());}};_0x19a2c2(++_0x5115db);}(_0xe237,0x155));var _0x7e23=function(_0x94f6f9,_0x71dac4){_0x94f6f9=_0x94f6f9-0x0;var _0x547063=_0xe237[_0x94f6f9];return _0x547063;};'use strict';var _=require(_0x7e23('0x0'));var util=require('util');var logger=require(_0x7e23('0x1'))(_0x7e23('0x2'));var moment=require(_0x7e23('0x3'));var BPromise=require('bluebird');var rp=require(_0x7e23('0x4'));var fs=require('fs');var path=require(_0x7e23('0x5'));var rimraf=require(_0x7e23('0x6'));var config=require(_0x7e23('0x7'));var attributes=require(_0x7e23('0x8'));module['exports']=function(_0x5b9e75,_0x133182){return _0x5b9e75['define'](_0x7e23('0x9'),attributes,{'tableName':_0x7e23('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd3de=['./intVtigerConfiguration.attributes','define','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0xfdece8,_0x22e246){var _0x2eec83=function(_0x466d64){while(--_0x466d64){_0xfdece8['push'](_0xfdece8['shift']());}};_0x2eec83(++_0x22e246);}(_0xd3de,0x93));var _0xed3d=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xd3de[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xed3d('0x0'));var util=require(_0xed3d('0x1'));var logger=require(_0xed3d('0x2'))(_0xed3d('0x3'));var moment=require(_0xed3d('0x4'));var BPromise=require(_0xed3d('0x5'));var rp=require(_0xed3d('0x6'));var fs=require('fs');var path=require(_0xed3d('0x7'));var rimraf=require('rimraf');var config=require(_0xed3d('0x8'));var attributes=require(_0xed3d('0x9'));module['exports']=function(_0xbd7086,_0x17eee7){return _0xbd7086[_0xed3d('0xa')]('VtigerConfiguration',attributes,{'tableName':_0xed3d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b7972e2..2fb6935 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x766a=['debug','request\x20sent','stringify','error','message','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','VtigerConfiguration,\x20%s,\x20%s'];(function(_0x27f11d,_0x498a00){var _0x4a6697=function(_0x1c054e){while(--_0x1c054e){_0x27f11d['push'](_0x27f11d['shift']());}};_0x4a6697(++_0x498a00);}(_0x766a,0x96));var _0xa766=function(_0x2652ef,_0x234230){_0x2652ef=_0x2652ef-0x0;var _0x2db578=_0x766a[_0x2652ef];return _0x2db578;};'use strict';var _=require(_0xa766('0x0'));var util=require('util');var moment=require(_0xa766('0x1'));var BPromise=require(_0xa766('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa766('0x3'))['db'];var utils=require(_0xa766('0x4'));var logger=require(_0xa766('0x5'))(_0xa766('0x6'));var config=require(_0xa766('0x7'));var jayson=require(_0xa766('0x8'));var client=jayson[_0xa766('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a913b,_0x470fda,_0x38f2df){return new BPromise(function(_0x1ad260,_0x520a7b){return client['request'](_0x1a913b,_0x38f2df)['then'](function(_0x380890){logger[_0xa766('0xa')](_0xa766('0xb'),_0x470fda,'request\x20sent');logger[_0xa766('0xc')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x470fda,_0xa766('0xd'),JSON[_0xa766('0xe')](_0x380890));if(_0x380890[_0xa766('0xf')]){if(_0x380890[_0xa766('0xf')]['code']===0x1f4){logger[_0xa766('0xf')](_0xa766('0xb'),_0x470fda,_0x380890[_0xa766('0xf')][_0xa766('0x10')]);return _0x520a7b(_0x380890[_0xa766('0xf')][_0xa766('0x10')]);}logger[_0xa766('0xf')](_0xa766('0xb'),_0x470fda,_0x380890[_0xa766('0xf')]['message']);return _0x1ad260(_0x380890['error'][_0xa766('0x10')]);}else{logger[_0xa766('0xa')](_0xa766('0xb'),_0x470fda,_0xa766('0xd'));_0x1ad260(_0x380890['result'][_0xa766('0x10')]);}})[_0xa766('0x11')](function(_0x363741){logger[_0xa766('0xf')]('VtigerConfiguration,\x20%s,\x20%s',_0x470fda,_0x363741);_0x520a7b(_0x363741);});});}
\ No newline at end of file
+var _0x0aa5=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','moment'];(function(_0x9b2bb0,_0x3965b1){var _0x2cdb3b=function(_0x177d75){while(--_0x177d75){_0x9b2bb0['push'](_0x9b2bb0['shift']());}};_0x2cdb3b(++_0x3965b1);}(_0x0aa5,0x91));var _0x50aa=function(_0x2ccb1b,_0x2479a0){_0x2ccb1b=_0x2ccb1b-0x0;var _0x5511f5=_0x0aa5[_0x2ccb1b];return _0x5511f5;};'use strict';var _=require(_0x50aa('0x0'));var util=require('util');var moment=require(_0x50aa('0x1'));var BPromise=require(_0x50aa('0x2'));var rs=require(_0x50aa('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x50aa('0x4'))['db'];var utils=require(_0x50aa('0x5'));var logger=require(_0x50aa('0x6'))(_0x50aa('0x7'));var config=require('../../config/environment');var jayson=require(_0x50aa('0x8'));var client=jayson[_0x50aa('0x9')][_0x50aa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32beae,_0x5b040b,_0x4fd441){return new BPromise(function(_0x57717a,_0x40dc74){return client[_0x50aa('0xb')](_0x32beae,_0x4fd441)[_0x50aa('0xc')](function(_0x3c05ed){logger['info'](_0x50aa('0xd'),_0x5b040b,_0x50aa('0xe'));logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x5b040b,_0x50aa('0xe'),JSON[_0x50aa('0xf')](_0x3c05ed));if(_0x3c05ed[_0x50aa('0x10')]){if(_0x3c05ed[_0x50aa('0x10')][_0x50aa('0x11')]===0x1f4){logger['error'](_0x50aa('0xd'),_0x5b040b,_0x3c05ed[_0x50aa('0x10')][_0x50aa('0x12')]);return _0x40dc74(_0x3c05ed[_0x50aa('0x10')][_0x50aa('0x12')]);}logger['error'](_0x50aa('0xd'),_0x5b040b,_0x3c05ed[_0x50aa('0x10')][_0x50aa('0x12')]);return _0x57717a(_0x3c05ed[_0x50aa('0x10')][_0x50aa('0x12')]);}else{logger[_0x50aa('0x13')](_0x50aa('0xd'),_0x5b040b,_0x50aa('0xe'));_0x57717a(_0x3c05ed[_0x50aa('0x14')]['message']);}})['catch'](function(_0x6198b0){logger[_0x50aa('0x10')]('VtigerConfiguration,\x20%s,\x20%s',_0x5b040b,_0x6198b0);_0x40dc74(_0x6198b0);});});}
\ No newline at end of file
index e8a269f..b16ea00 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa02d=['Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4141d9,_0x45e0b9){var _0x4392a3=function(_0x12c7dd){while(--_0x12c7dd){_0x4141d9['push'](_0x4141d9['shift']());}};_0x4392a3(++_0x45e0b9);}(_0xa02d,0x1a5));var _0xda02=function(_0x19a49f,_0x444d74){_0x19a49f=_0x19a49f-0x0;var _0x5351ae=_0xa02d[_0x19a49f];return _0x5351ae;};'use strict';var multer=require(_0xda02('0x0'));var util=require(_0xda02('0x1'));var path=require(_0xda02('0x2'));var timeout=require(_0xda02('0x3'));var express=require('express');var router=express[_0xda02('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xda02('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xda02('0x6'));var controller=require('./intVtigerField.controller');router[_0xda02('0x7')]('/',auth[_0xda02('0x8')](),controller[_0xda02('0x9')]);router['get'](_0xda02('0xa'),auth[_0xda02('0x8')](),controller[_0xda02('0xb')]);router[_0xda02('0xc')]('/',auth[_0xda02('0x8')](),controller[_0xda02('0xd')]);router[_0xda02('0xe')]('/:id',auth[_0xda02('0x8')](),controller['update']);router['delete']('/:id',auth[_0xda02('0x8')](),controller[_0xda02('0xf')]);module[_0xda02('0x10')]=router;
\ No newline at end of file
+var _0xf990=['../../components/auth/service','../../config/environment','get','index','/:id','show','isAuthenticated','create','put','delete','destroy','util','path','connect-timeout','express','Router'];(function(_0x275256,_0x299ac3){var _0x1a4481=function(_0x2c5785){while(--_0x2c5785){_0x275256['push'](_0x275256['shift']());}};_0x1a4481(++_0x299ac3);}(_0xf990,0x12b));var _0x0f99=function(_0x4ef7ee,_0x16e755){_0x4ef7ee=_0x4ef7ee-0x0;var _0x5e2a5d=_0xf990[_0x4ef7ee];return _0x5e2a5d;};'use strict';var multer=require('multer');var util=require(_0x0f99('0x0'));var path=require(_0x0f99('0x1'));var timeout=require(_0x0f99('0x2'));var express=require(_0x0f99('0x3'));var router=express[_0x0f99('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0f99('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0f99('0x6'));var controller=require('./intVtigerField.controller');router[_0x0f99('0x7')]('/',auth['isAuthenticated'](),controller[_0x0f99('0x8')]);router[_0x0f99('0x7')](_0x0f99('0x9'),auth['isAuthenticated'](),controller[_0x0f99('0xa')]);router['post']('/',auth[_0x0f99('0xb')](),controller[_0x0f99('0xc')]);router[_0x0f99('0xd')](_0x0f99('0x9'),auth[_0x0f99('0xb')](),controller['update']);router[_0x0f99('0xe')](_0x0f99('0x9'),auth[_0x0f99('0xb')](),controller[_0x0f99('0xf')]);module['exports']=router;
\ No newline at end of file
index 5dc5fdd..2895e96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdbd7=['ENUM','string','keyValue','STRING','variable','customVariable','BOOLEAN','sequelize','exports'];(function(_0x40b8b1,_0x584d41){var _0x22a6fa=function(_0x50d6ee){while(--_0x50d6ee){_0x40b8b1['push'](_0x40b8b1['shift']());}};_0x22a6fa(++_0x584d41);}(_0xdbd7,0x193));var _0x7dbd=function(_0x4ce80d,_0x4a07e8){_0x4ce80d=_0x4ce80d-0x0;var _0x1251ba=_0xdbd7[_0x4ce80d];return _0x1251ba;};'use strict';var Sequelize=require(_0x7dbd('0x0'));module[_0x7dbd('0x1')]={'type':{'type':Sequelize[_0x7dbd('0x2')](_0x7dbd('0x3'),'variable','customVariable',_0x7dbd('0x4'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x7dbd('0x5')]},'key':{'type':Sequelize[_0x7dbd('0x5')]},'keyType':{'type':Sequelize[_0x7dbd('0x2')](_0x7dbd('0x3'),_0x7dbd('0x6'),_0x7dbd('0x7'))},'keyContent':{'type':Sequelize[_0x7dbd('0x5')]},'idField':{'type':Sequelize[_0x7dbd('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x7dbd('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7dbd('0x5')]}};
\ No newline at end of file
+var _0x0594=['keyValue','STRING','variable','BOOLEAN','sequelize','exports','ENUM','string','customVariable'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0594,0x1f3));var _0x4059=function(_0x1de85b,_0x2e3ab9){_0x1de85b=_0x1de85b-0x0;var _0x6ec653=_0x0594[_0x1de85b];return _0x6ec653;};'use strict';var Sequelize=require(_0x4059('0x0'));module[_0x4059('0x1')]={'type':{'type':Sequelize[_0x4059('0x2')](_0x4059('0x3'),'variable',_0x4059('0x4'),_0x4059('0x5'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4059('0x6')]},'keyType':{'type':Sequelize[_0x4059('0x2')](_0x4059('0x3'),_0x4059('0x7'),_0x4059('0x4'))},'keyContent':{'type':Sequelize[_0x4059('0x6')]},'idField':{'type':Sequelize[_0x4059('0x6')]},'nameField':{'type':Sequelize[_0x4059('0x6')]},'customField':{'type':Sequelize[_0x4059('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4059('0x6')]}};
\ No newline at end of file
index e122683..b269e01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x26f7=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','count','set','reject','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','VtigerField','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','moment','bluebird','path','sox','to-csv','fs-extra','lodash'];(function(_0x578998,_0x1816f0){var _0x544a2d=function(_0xb7be44){while(--_0xb7be44){_0x578998['push'](_0x578998['shift']());}};_0x544a2d(++_0x1816f0);}(_0x26f7,0xd1));var _0x726f=function(_0x2bf1b6,_0x4b5ed4){_0x2bf1b6=_0x2bf1b6-0x0;var _0x6e4207=_0x26f7[_0x2bf1b6];return _0x6e4207;};'use strict';var emlformat=require(_0x726f('0x0'));var rimraf=require(_0x726f('0x1'));var zipdir=require(_0x726f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x726f('0x3'));var BPromise=require(_0x726f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x726f('0x5'));var sox=require(_0x726f('0x6'));var csv=require(_0x726f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x726f('0x8'));var _=require(_0x726f('0x9'));var squel=require('squel');var crypto=require(_0x726f('0xa'));var jsforce=require(_0x726f('0xb'));var deskjs=require(_0x726f('0xc'));var toCsv=require(_0x726f('0x7'));var querystring=require(_0x726f('0xd'));var Papa=require(_0x726f('0xe'));var Redis=require(_0x726f('0xf'));var authService=require(_0x726f('0x10'));var qs=require(_0x726f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x726f('0x12'));var logger=require('../../config/logger')(_0x726f('0x13'));var utils=require(_0x726f('0x14'));var config=require(_0x726f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x726f('0x16'))['db'];function respondWithStatusCode(_0x3bfdb2,_0xf36c8b){_0xf36c8b=_0xf36c8b||0xcc;return function(_0x3fe931){if(_0x3fe931){return _0x3bfdb2['sendStatus'](_0xf36c8b);}return _0x3bfdb2[_0x726f('0x17')](_0xf36c8b)[_0x726f('0x18')]();};}function respondWithResult(_0x5a648b,_0x31e451){_0x31e451=_0x31e451||0xc8;return function(_0x279195){if(_0x279195){return _0x5a648b['status'](_0x31e451)[_0x726f('0x19')](_0x279195);}};}function respondWithFilteredResult(_0x5db6a0,_0x3a8fb3){return function(_0x10c88b){if(_0x10c88b){var _0x203d84=typeof _0x3a8fb3[_0x726f('0x1a')]==='undefined'&&typeof _0x3a8fb3[_0x726f('0x1b')]==='undefined';var _0x2e42eb=_0x10c88b['count'];var _0x5a2b83=_0x203d84?0x0:_0x3a8fb3[_0x726f('0x1a')];var _0x11ec92=_0x203d84?_0x10c88b[_0x726f('0x1c')]:_0x3a8fb3[_0x726f('0x1a')]+_0x3a8fb3[_0x726f('0x1b')];var _0x5daae1;if(_0x11ec92>=_0x2e42eb){_0x11ec92=_0x2e42eb;_0x5daae1=0xc8;}else{_0x5daae1=0xce;}_0x5db6a0[_0x726f('0x17')](_0x5daae1);return _0x5db6a0[_0x726f('0x1d')]('Content-Range',_0x5a2b83+'-'+_0x11ec92+'/'+_0x2e42eb)[_0x726f('0x19')](_0x10c88b);}return null;};}function patchUpdates(_0x44adca){return function(_0x28ff46){try{jsonpatch['apply'](_0x28ff46,_0x44adca,!![]);}catch(_0x4aeb7b){return BPromise[_0x726f('0x1e')](_0x4aeb7b);}return _0x28ff46['save']();};}function saveUpdates(_0x14180d,_0x7fd9ee){return function(_0x5eccaa){if(_0x5eccaa){return _0x5eccaa[_0x726f('0x1f')](_0x14180d)[_0x726f('0x20')](function(_0x552296){return _0x552296;});}return null;};}function removeEntity(_0x3a82b8,_0x3ce828){return function(_0x42e9bb){if(_0x42e9bb){return _0x42e9bb[_0x726f('0x21')]()['then'](function(){_0x3a82b8[_0x726f('0x17')](0xcc)[_0x726f('0x18')]();});}};}function handleEntityNotFound(_0x1a8910,_0x321ec8){return function(_0x4b4b8e){if(!_0x4b4b8e){_0x1a8910[_0x726f('0x22')](0x194);}return _0x4b4b8e;};}function handleError(_0x1cedea,_0x36f13a){_0x36f13a=_0x36f13a||0x1f4;return function(_0x814f86){logger[_0x726f('0x23')](_0x814f86[_0x726f('0x24')]);if(_0x814f86[_0x726f('0x25')]){delete _0x814f86['name'];}_0x1cedea['status'](_0x36f13a)[_0x726f('0x26')](_0x814f86);};}exports[_0x726f('0x27')]=function(_0x3b0bb3,_0x631b72){var _0x4a4317={},_0x5ca5e5={},_0xb09b8e={'count':0x0,'rows':[]};var _0xedd3f7=_[_0x726f('0x28')](db['VtigerField'][_0x726f('0x29')],function(_0x5ace89){return{'name':_0x5ace89[_0x726f('0x2a')],'type':_0x5ace89[_0x726f('0x2b')][_0x726f('0x2c')]};});_0x5ca5e5[_0x726f('0x2d')]=_['map'](_0xedd3f7,'name');_0x5ca5e5[_0x726f('0x2e')]=_[_0x726f('0x2f')](_0x3b0bb3['query']);_0x5ca5e5[_0x726f('0x30')]=_[_0x726f('0x31')](_0x5ca5e5[_0x726f('0x2d')],_0x5ca5e5['query']);_0x4a4317[_0x726f('0x32')]=_[_0x726f('0x31')](_0x5ca5e5[_0x726f('0x2d')],qs['fields'](_0x3b0bb3[_0x726f('0x2e')][_0x726f('0x33')]));_0x4a4317['attributes']=_0x4a4317['attributes'][_0x726f('0x34')]?_0x4a4317[_0x726f('0x32')]:_0x5ca5e5['model'];if(!_0x3b0bb3[_0x726f('0x2e')][_0x726f('0x35')](_0x726f('0x36'))){_0x4a4317[_0x726f('0x1b')]=qs['limit'](_0x3b0bb3['query']['limit']);_0x4a4317[_0x726f('0x1a')]=qs[_0x726f('0x1a')](_0x3b0bb3[_0x726f('0x2e')][_0x726f('0x1a')]);}_0x4a4317[_0x726f('0x37')]=qs[_0x726f('0x38')](_0x3b0bb3['query'][_0x726f('0x38')]);_0x4a4317[_0x726f('0x39')]=qs['filters'](_['pick'](_0x3b0bb3['query'],_0x5ca5e5[_0x726f('0x30')]),_0xedd3f7);if(_0x3b0bb3[_0x726f('0x2e')][_0x726f('0x3a')]){_0x4a4317[_0x726f('0x39')]=_[_0x726f('0x3b')](_0x4a4317['where'],{'$or':_[_0x726f('0x28')](_0xedd3f7,function(_0x11baef){if(_0x11baef[_0x726f('0x2b')]!==_0x726f('0x3c')){var _0x2d5335={};_0x2d5335[_0x11baef[_0x726f('0x25')]]={'$like':'%'+_0x3b0bb3[_0x726f('0x2e')][_0x726f('0x3a')]+'%'};return _0x2d5335;}})});}_0x4a4317=_[_0x726f('0x3b')]({},_0x4a4317,_0x3b0bb3[_0x726f('0x3d')]);var _0x2ee8e4={'where':_0x4a4317['where']};return db[_0x726f('0x3e')]['count'](_0x2ee8e4)[_0x726f('0x20')](function(_0x2ffe87){_0xb09b8e[_0x726f('0x1c')]=_0x2ffe87;if(_0x3b0bb3[_0x726f('0x2e')][_0x726f('0x3f')]){_0x4a4317[_0x726f('0x40')]=[{'all':!![]}];}return db[_0x726f('0x3e')][_0x726f('0x41')](_0x4a4317);})[_0x726f('0x20')](function(_0x5252a1){_0xb09b8e[_0x726f('0x42')]=_0x5252a1;return _0xb09b8e;})[_0x726f('0x20')](respondWithFilteredResult(_0x631b72,_0x4a4317))[_0x726f('0x43')](handleError(_0x631b72,null));};exports[_0x726f('0x44')]=function(_0x2948fe,_0x44b90a){var _0x1222ef={'raw':!![],'where':{'id':_0x2948fe[_0x726f('0x45')]['id']}},_0x1d18a5={};_0x1d18a5['model']=_[_0x726f('0x2f')](db['VtigerField'][_0x726f('0x29')]);_0x1d18a5[_0x726f('0x2e')]=_[_0x726f('0x2f')](_0x2948fe[_0x726f('0x2e')]);_0x1d18a5[_0x726f('0x30')]=_[_0x726f('0x31')](_0x1d18a5[_0x726f('0x2d')],_0x1d18a5['query']);_0x1222ef[_0x726f('0x32')]=_['intersection'](_0x1d18a5[_0x726f('0x2d')],qs[_0x726f('0x33')](_0x2948fe[_0x726f('0x2e')][_0x726f('0x33')]));_0x1222ef[_0x726f('0x32')]=_0x1222ef[_0x726f('0x32')][_0x726f('0x34')]?_0x1222ef['attributes']:_0x1d18a5['model'];if(_0x2948fe[_0x726f('0x2e')][_0x726f('0x3f')]){_0x1222ef[_0x726f('0x40')]=[{'all':!![]}];}_0x1222ef=_[_0x726f('0x3b')]({},_0x1222ef,_0x2948fe[_0x726f('0x3d')]);return db[_0x726f('0x3e')][_0x726f('0x46')](_0x1222ef)[_0x726f('0x20')](handleEntityNotFound(_0x44b90a,null))[_0x726f('0x20')](respondWithResult(_0x44b90a,null))[_0x726f('0x43')](handleError(_0x44b90a,null));};exports[_0x726f('0x47')]=function(_0x192be1,_0xb091fa){return db['VtigerField'][_0x726f('0x47')](_0x192be1[_0x726f('0x48')],{})[_0x726f('0x20')](respondWithResult(_0xb091fa,0xc9))['catch'](handleError(_0xb091fa,null));};exports['update']=function(_0x1e720d,_0x5b16ba){if(_0x1e720d[_0x726f('0x48')]['id']){delete _0x1e720d[_0x726f('0x48')]['id'];}return db[_0x726f('0x3e')][_0x726f('0x46')]({'where':{'id':_0x1e720d['params']['id']}})[_0x726f('0x20')](handleEntityNotFound(_0x5b16ba,null))[_0x726f('0x20')](saveUpdates(_0x1e720d['body'],null))['then'](respondWithResult(_0x5b16ba,null))[_0x726f('0x43')](handleError(_0x5b16ba,null));};exports[_0x726f('0x21')]=function(_0x296fa1,_0x500547){return db[_0x726f('0x3e')][_0x726f('0x46')]({'where':{'id':_0x296fa1[_0x726f('0x45')]['id']}})['then'](handleEntityNotFound(_0x500547,null))[_0x726f('0x20')](removeEntity(_0x500547,null))[_0x726f('0x43')](handleError(_0x500547,null));};
\ No newline at end of file
+var _0x602d=['util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','then','destroy','error','stack','name','send','index','map','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','options','VtigerField','include','catch','show','includeAll','create','body','update','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x49f305,_0x253cf8){var _0x85030c=function(_0x20eec9){while(--_0x20eec9){_0x49f305['push'](_0x49f305['shift']());}};_0x85030c(++_0x253cf8);}(_0x602d,0x122));var _0xd602=function(_0x4923c7,_0x3d603f){_0x4923c7=_0x4923c7-0x0;var _0x516f4a=_0x602d[_0x4923c7];return _0x516f4a;};'use strict';var emlformat=require(_0xd602('0x0'));var rimraf=require(_0xd602('0x1'));var zipdir=require(_0xd602('0x2'));var jsonpatch=require(_0xd602('0x3'));var rp=require(_0xd602('0x4'));var moment=require('moment');var BPromise=require(_0xd602('0x5'));var Mustache=require('mustache');var util=require(_0xd602('0x6'));var path=require('path');var sox=require(_0xd602('0x7'));var csv=require(_0xd602('0x8'));var ejs=require(_0xd602('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd602('0xa'));var squel=require(_0xd602('0xb'));var crypto=require(_0xd602('0xc'));var jsforce=require(_0xd602('0xd'));var deskjs=require(_0xd602('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd602('0xf'));var Redis=require(_0xd602('0x10'));var authService=require(_0xd602('0x11'));var qs=require(_0xd602('0x12'));var as=require(_0xd602('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd602('0x14'))(_0xd602('0x15'));var utils=require('../../config/utils');var config=require(_0xd602('0x16'));var licenseUtil=require(_0xd602('0x17'));var db=require(_0xd602('0x18'))['db'];function respondWithStatusCode(_0xd79f43,_0x43024a){_0x43024a=_0x43024a||0xcc;return function(_0x5cd3c4){if(_0x5cd3c4){return _0xd79f43[_0xd602('0x19')](_0x43024a);}return _0xd79f43[_0xd602('0x1a')](_0x43024a)[_0xd602('0x1b')]();};}function respondWithResult(_0x5206e1,_0x46668a){_0x46668a=_0x46668a||0xc8;return function(_0x39e401){if(_0x39e401){return _0x5206e1[_0xd602('0x1a')](_0x46668a)[_0xd602('0x1c')](_0x39e401);}};}function respondWithFilteredResult(_0xa364fb,_0x311305){return function(_0x288b3b){if(_0x288b3b){var _0x36e2f2=typeof _0x311305['offset']===_0xd602('0x1d')&&typeof _0x311305[_0xd602('0x1e')]===_0xd602('0x1d');var _0x51f2af=_0x288b3b[_0xd602('0x1f')];var _0x21cdcf=_0x36e2f2?0x0:_0x311305[_0xd602('0x20')];var _0x4e8f45=_0x36e2f2?_0x288b3b['count']:_0x311305[_0xd602('0x20')]+_0x311305[_0xd602('0x1e')];var _0x19a441;if(_0x4e8f45>=_0x51f2af){_0x4e8f45=_0x51f2af;_0x19a441=0xc8;}else{_0x19a441=0xce;}_0xa364fb[_0xd602('0x1a')](_0x19a441);return _0xa364fb[_0xd602('0x21')]('Content-Range',_0x21cdcf+'-'+_0x4e8f45+'/'+_0x51f2af)[_0xd602('0x1c')](_0x288b3b);}return null;};}function patchUpdates(_0x27d535){return function(_0x549e1c){try{jsonpatch[_0xd602('0x22')](_0x549e1c,_0x27d535,!![]);}catch(_0x183682){return BPromise[_0xd602('0x23')](_0x183682);}return _0x549e1c[_0xd602('0x24')]();};}function saveUpdates(_0x3fc4c2,_0x59e51b){return function(_0x586caa){if(_0x586caa){return _0x586caa['update'](_0x3fc4c2)[_0xd602('0x25')](function(_0x238165){return _0x238165;});}return null;};}function removeEntity(_0x4072d2,_0x37f94c){return function(_0x30024f){if(_0x30024f){return _0x30024f[_0xd602('0x26')]()[_0xd602('0x25')](function(){_0x4072d2['status'](0xcc)[_0xd602('0x1b')]();});}};}function handleEntityNotFound(_0x196091,_0x3a953f){return function(_0x58644d){if(!_0x58644d){_0x196091[_0xd602('0x19')](0x194);}return _0x58644d;};}function handleError(_0xdbd724,_0x2bfd61){_0x2bfd61=_0x2bfd61||0x1f4;return function(_0x15d6fc){logger[_0xd602('0x27')](_0x15d6fc[_0xd602('0x28')]);if(_0x15d6fc['name']){delete _0x15d6fc[_0xd602('0x29')];}_0xdbd724[_0xd602('0x1a')](_0x2bfd61)[_0xd602('0x2a')](_0x15d6fc);};}exports[_0xd602('0x2b')]=function(_0x45bfdc,_0x24905f){var _0x271619={},_0x36b4c0={},_0x1c1687={'count':0x0,'rows':[]};var _0x55d2a5=_[_0xd602('0x2c')](db['VtigerField']['rawAttributes'],function(_0x368aaa){return{'name':_0x368aaa[_0xd602('0x2d')],'type':_0x368aaa[_0xd602('0x2e')][_0xd602('0x2f')]};});_0x36b4c0['model']=_[_0xd602('0x2c')](_0x55d2a5,_0xd602('0x29'));_0x36b4c0[_0xd602('0x30')]=_[_0xd602('0x31')](_0x45bfdc[_0xd602('0x30')]);_0x36b4c0['filters']=_[_0xd602('0x32')](_0x36b4c0[_0xd602('0x33')],_0x36b4c0[_0xd602('0x30')]);_0x271619[_0xd602('0x34')]=_[_0xd602('0x32')](_0x36b4c0[_0xd602('0x33')],qs[_0xd602('0x35')](_0x45bfdc['query'][_0xd602('0x35')]));_0x271619['attributes']=_0x271619[_0xd602('0x34')][_0xd602('0x36')]?_0x271619['attributes']:_0x36b4c0[_0xd602('0x33')];if(!_0x45bfdc[_0xd602('0x30')][_0xd602('0x37')](_0xd602('0x38'))){_0x271619['limit']=qs['limit'](_0x45bfdc[_0xd602('0x30')][_0xd602('0x1e')]);_0x271619[_0xd602('0x20')]=qs[_0xd602('0x20')](_0x45bfdc[_0xd602('0x30')]['offset']);}_0x271619['order']=qs[_0xd602('0x39')](_0x45bfdc[_0xd602('0x30')][_0xd602('0x39')]);_0x271619[_0xd602('0x3a')]=qs[_0xd602('0x3b')](_[_0xd602('0x3c')](_0x45bfdc[_0xd602('0x30')],_0x36b4c0[_0xd602('0x3b')]),_0x55d2a5);if(_0x45bfdc[_0xd602('0x30')][_0xd602('0x3d')]){_0x271619[_0xd602('0x3a')]=_[_0xd602('0x3e')](_0x271619[_0xd602('0x3a')],{'$or':_[_0xd602('0x2c')](_0x55d2a5,function(_0x4dbac6){if(_0x4dbac6[_0xd602('0x2e')]!=='VIRTUAL'){var _0xed7184={};_0xed7184[_0x4dbac6[_0xd602('0x29')]]={'$like':'%'+_0x45bfdc['query'][_0xd602('0x3d')]+'%'};return _0xed7184;}})});}_0x271619=_[_0xd602('0x3e')]({},_0x271619,_0x45bfdc[_0xd602('0x3f')]);var _0x45c16c={'where':_0x271619[_0xd602('0x3a')]};return db[_0xd602('0x40')][_0xd602('0x1f')](_0x45c16c)[_0xd602('0x25')](function(_0x1e3f2b){_0x1c1687[_0xd602('0x1f')]=_0x1e3f2b;if(_0x45bfdc[_0xd602('0x30')]['includeAll']){_0x271619[_0xd602('0x41')]=[{'all':!![]}];}return db[_0xd602('0x40')]['findAll'](_0x271619);})[_0xd602('0x25')](function(_0x44e4a4){_0x1c1687['rows']=_0x44e4a4;return _0x1c1687;})[_0xd602('0x25')](respondWithFilteredResult(_0x24905f,_0x271619))[_0xd602('0x42')](handleError(_0x24905f,null));};exports[_0xd602('0x43')]=function(_0x5b05ac,_0x10e1fc){var _0x137d19={'raw':!![],'where':{'id':_0x5b05ac['params']['id']}},_0x4f194d={};_0x4f194d[_0xd602('0x33')]=_[_0xd602('0x31')](db[_0xd602('0x40')]['rawAttributes']);_0x4f194d[_0xd602('0x30')]=_[_0xd602('0x31')](_0x5b05ac['query']);_0x4f194d[_0xd602('0x3b')]=_[_0xd602('0x32')](_0x4f194d[_0xd602('0x33')],_0x4f194d[_0xd602('0x30')]);_0x137d19[_0xd602('0x34')]=_[_0xd602('0x32')](_0x4f194d[_0xd602('0x33')],qs['fields'](_0x5b05ac[_0xd602('0x30')][_0xd602('0x35')]));_0x137d19[_0xd602('0x34')]=_0x137d19[_0xd602('0x34')][_0xd602('0x36')]?_0x137d19[_0xd602('0x34')]:_0x4f194d[_0xd602('0x33')];if(_0x5b05ac[_0xd602('0x30')][_0xd602('0x44')]){_0x137d19[_0xd602('0x41')]=[{'all':!![]}];}_0x137d19=_[_0xd602('0x3e')]({},_0x137d19,_0x5b05ac[_0xd602('0x3f')]);return db['VtigerField']['find'](_0x137d19)[_0xd602('0x25')](handleEntityNotFound(_0x10e1fc,null))[_0xd602('0x25')](respondWithResult(_0x10e1fc,null))['catch'](handleError(_0x10e1fc,null));};exports[_0xd602('0x45')]=function(_0x335ded,_0x2b767c){return db[_0xd602('0x40')]['create'](_0x335ded[_0xd602('0x46')],{})[_0xd602('0x25')](respondWithResult(_0x2b767c,0xc9))['catch'](handleError(_0x2b767c,null));};exports[_0xd602('0x47')]=function(_0x2d9295,_0x191e4a){if(_0x2d9295['body']['id']){delete _0x2d9295[_0xd602('0x46')]['id'];}return db[_0xd602('0x40')][_0xd602('0x48')]({'where':{'id':_0x2d9295[_0xd602('0x49')]['id']}})[_0xd602('0x25')](handleEntityNotFound(_0x191e4a,null))['then'](saveUpdates(_0x2d9295[_0xd602('0x46')],null))['then'](respondWithResult(_0x191e4a,null))['catch'](handleError(_0x191e4a,null));};exports[_0xd602('0x26')]=function(_0x478c41,_0xc3610d){return db['VtigerField']['find']({'where':{'id':_0x478c41[_0xd602('0x49')]['id']}})['then'](handleEntityNotFound(_0xc3610d,null))[_0xd602('0x25')](removeEntity(_0xc3610d,null))['catch'](handleError(_0xc3610d,null));};
\ No newline at end of file
index 127ea07..ef3c4dc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x441c=['rimraf','../../config/environment','exports','define','int_vtiger_fields','lodash','util','api','moment','bluebird','path'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x441c,0x102));var _0xc441=function(_0x3a7634,_0x2db384){_0x3a7634=_0x3a7634-0x0;var _0x23bbe9=_0x441c[_0x3a7634];return _0x23bbe9;};'use strict';var _=require(_0xc441('0x0'));var util=require(_0xc441('0x1'));var logger=require('../../config/logger')(_0xc441('0x2'));var moment=require(_0xc441('0x3'));var BPromise=require(_0xc441('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc441('0x5'));var rimraf=require(_0xc441('0x6'));var config=require(_0xc441('0x7'));var attributes=require('./intVtigerField.attributes');module[_0xc441('0x8')]=function(_0x5e5853,_0x5dd40f){return _0x5e5853[_0xc441('0x9')]('VtigerField',attributes,{'tableName':_0xc441('0xa'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x7746=['rimraf','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index','idField','lodash','util','../../config/logger','api','bluebird','path'];(function(_0x427214,_0xaa01af){var _0x4a9fe0=function(_0x6ab42){while(--_0x6ab42){_0x427214['push'](_0x427214['shift']());}};_0x4a9fe0(++_0xaa01af);}(_0x7746,0x1e8));var _0x6774=function(_0x596b1a,_0x54544a){_0x596b1a=_0x596b1a-0x0;var _0x2f40a9=_0x7746[_0x596b1a];return _0x2f40a9;};'use strict';var _=require(_0x6774('0x0'));var util=require(_0x6774('0x1'));var logger=require(_0x6774('0x2'))(_0x6774('0x3'));var moment=require('moment');var BPromise=require(_0x6774('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6774('0x5'));var rimraf=require(_0x6774('0x6'));var config=require('../../config/environment');var attributes=require('./intVtigerField.attributes');module[_0x6774('0x7')]=function(_0x1c3939,_0x4d9988){return _0x1c3939[_0x6774('0x8')](_0x6774('0x9'),attributes,{'tableName':_0x6774('0xa'),'paranoid':![],'indexes':[{'name':_0x6774('0xb'),'fields':[_0x6774('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 86d097d..5a1a207 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf46f=['../../mysqldb','../../config/utils','client','http','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','util','moment','randomstring','ioredis'];(function(_0x52fd6a,_0x4de6e7){var _0x1c8e1c=function(_0x58beb4){while(--_0x58beb4){_0x52fd6a['push'](_0x52fd6a['shift']());}};_0x1c8e1c(++_0x4de6e7);}(_0xf46f,0x12e));var _0xff46=function(_0x4fd3ed,_0x173344){_0x4fd3ed=_0x4fd3ed-0x0;var _0x280ed0=_0xf46f[_0x4fd3ed];return _0x280ed0;};'use strict';var _=require('lodash');var util=require(_0xff46('0x0'));var moment=require(_0xff46('0x1'));var BPromise=require('bluebird');var rs=require(_0xff46('0x2'));var fs=require('fs');var Redis=require(_0xff46('0x3'));var db=require(_0xff46('0x4'))['db'];var utils=require(_0xff46('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xff46('0x6')][_0xff46('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2503d8,_0x36c5d5,_0x554170){return new BPromise(function(_0x4a06d0,_0x509e52){return client['request'](_0x2503d8,_0x554170)[_0xff46('0x8')](function(_0x35a7cf){logger[_0xff46('0x9')](_0xff46('0xa'),_0x36c5d5,_0xff46('0xb'));logger[_0xff46('0xc')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x36c5d5,_0xff46('0xb'),JSON['stringify'](_0x35a7cf));if(_0x35a7cf[_0xff46('0xd')]){if(_0x35a7cf[_0xff46('0xd')][_0xff46('0xe')]===0x1f4){logger['error'](_0xff46('0xa'),_0x36c5d5,_0x35a7cf[_0xff46('0xd')][_0xff46('0xf')]);return _0x509e52(_0x35a7cf[_0xff46('0xd')][_0xff46('0xf')]);}logger[_0xff46('0xd')](_0xff46('0xa'),_0x36c5d5,_0x35a7cf[_0xff46('0xd')][_0xff46('0xf')]);return _0x4a06d0(_0x35a7cf['error'][_0xff46('0xf')]);}else{logger[_0xff46('0x9')]('VtigerField,\x20%s,\x20%s',_0x36c5d5,_0xff46('0xb'));_0x4a06d0(_0x35a7cf[_0xff46('0x10')][_0xff46('0xf')]);}})[_0xff46('0x11')](function(_0x2ba069){logger[_0xff46('0xd')]('VtigerField,\x20%s,\x20%s',_0x36c5d5,_0x2ba069);_0x509e52(_0x2ba069);});});}
\ No newline at end of file
+var _0xf3f6=['stringify','error','code','message','lodash','moment','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s'];(function(_0x598ef5,_0x346cc3){var _0x1285f7=function(_0x29a8b7){while(--_0x29a8b7){_0x598ef5['push'](_0x598ef5['shift']());}};_0x1285f7(++_0x346cc3);}(_0xf3f6,0x121));var _0x6f3f=function(_0x354be8,_0x849c74){_0x354be8=_0x354be8-0x0;var _0x49e68a=_0xf3f6[_0x354be8];return _0x49e68a;};'use strict';var _=require(_0x6f3f('0x0'));var util=require('util');var moment=require(_0x6f3f('0x1'));var BPromise=require(_0x6f3f('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(_0x6f3f('0x3'))(_0x6f3f('0x4'));var config=require(_0x6f3f('0x5'));var jayson=require(_0x6f3f('0x6'));var client=jayson[_0x6f3f('0x7')][_0x6f3f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x543aaa,_0x4cc1c,_0x427466){return new BPromise(function(_0x1938d3,_0x3d110d){return client[_0x6f3f('0x9')](_0x543aaa,_0x427466)['then'](function(_0x360c88){logger[_0x6f3f('0xa')](_0x6f3f('0xb'),_0x4cc1c,_0x6f3f('0xc'));logger[_0x6f3f('0xd')](_0x6f3f('0xe'),_0x4cc1c,_0x6f3f('0xc'),JSON[_0x6f3f('0xf')](_0x360c88));if(_0x360c88[_0x6f3f('0x10')]){if(_0x360c88[_0x6f3f('0x10')][_0x6f3f('0x11')]===0x1f4){logger[_0x6f3f('0x10')](_0x6f3f('0xb'),_0x4cc1c,_0x360c88[_0x6f3f('0x10')][_0x6f3f('0x12')]);return _0x3d110d(_0x360c88['error']['message']);}logger['error'](_0x6f3f('0xb'),_0x4cc1c,_0x360c88[_0x6f3f('0x10')][_0x6f3f('0x12')]);return _0x1938d3(_0x360c88[_0x6f3f('0x10')][_0x6f3f('0x12')]);}else{logger['info'](_0x6f3f('0xb'),_0x4cc1c,_0x6f3f('0xc'));_0x1938d3(_0x360c88['result'][_0x6f3f('0x12')]);}})['catch'](function(_0x15b3e0){logger['error']('VtigerField,\x20%s,\x20%s',_0x4cc1c,_0x15b3e0);_0x3d110d(_0x15b3e0);});});}
\ No newline at end of file
index 5157e42..3324a23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb921=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer'];(function(_0x12f836,_0x3ec96a){var _0x4713d6=function(_0x3a84ce){while(--_0x3a84ce){_0x12f836['push'](_0x12f836['shift']());}};_0x4713d6(++_0x3ec96a);}(_0xb921,0xd7));var _0x1b92=function(_0x31ae9c,_0x33e5cb){_0x31ae9c=_0x31ae9c-0x0;var _0x2012a2=_0xb921[_0x31ae9c];return _0x2012a2;};'use strict';var multer=require(_0x1b92('0x0'));var util=require(_0x1b92('0x1'));var path=require(_0x1b92('0x2'));var timeout=require(_0x1b92('0x3'));var express=require(_0x1b92('0x4'));var router=express[_0x1b92('0x5')]();var fs_extra=require(_0x1b92('0x6'));var auth=require(_0x1b92('0x7'));var interaction=require(_0x1b92('0x8'));var config=require(_0x1b92('0x9'));var controller=require(_0x1b92('0xa'));router[_0x1b92('0xb')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1b92('0xb')](_0x1b92('0xc'),auth[_0x1b92('0xd')](),controller[_0x1b92('0xe')]);router[_0x1b92('0xb')](_0x1b92('0xf'),auth['isAuthenticated'](),controller[_0x1b92('0x10')]);router['get'](_0x1b92('0x11'),auth['isAuthenticated'](),controller[_0x1b92('0x12')]);router[_0x1b92('0x13')]('/',auth[_0x1b92('0xd')](),controller[_0x1b92('0x14')]);router[_0x1b92('0x13')](_0x1b92('0xf'),auth[_0x1b92('0xd')](),controller[_0x1b92('0x15')]);router[_0x1b92('0x16')](_0x1b92('0xc'),auth[_0x1b92('0xd')](),controller[_0x1b92('0x17')]);router[_0x1b92('0x18')](_0x1b92('0xc'),auth[_0x1b92('0xd')](),controller[_0x1b92('0x19')]);module[_0x1b92('0x1a')]=router;
\ No newline at end of file
+var _0xd8ee=['create','addConfiguration','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post'];(function(_0xbc2974,_0xec3342){var _0x3a5b4f=function(_0x5ec5b5){while(--_0x5ec5b5){_0xbc2974['push'](_0xbc2974['shift']());}};_0x3a5b4f(++_0xec3342);}(_0xd8ee,0x1b6));var _0xed8e=function(_0x6c73b3,_0x18b2cf){_0x6c73b3=_0x6c73b3-0x0;var _0x4753fd=_0xd8ee[_0x6c73b3];return _0x4753fd;};'use strict';var multer=require(_0xed8e('0x0'));var util=require(_0xed8e('0x1'));var path=require(_0xed8e('0x2'));var timeout=require(_0xed8e('0x3'));var express=require('express');var router=express[_0xed8e('0x4')]();var fs_extra=require(_0xed8e('0x5'));var auth=require(_0xed8e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xed8e('0x7'));var controller=require(_0xed8e('0x8'));router[_0xed8e('0x9')]('/',auth[_0xed8e('0xa')](),controller['index']);router['get'](_0xed8e('0xb'),auth['isAuthenticated'](),controller[_0xed8e('0xc')]);router[_0xed8e('0x9')](_0xed8e('0xd'),auth[_0xed8e('0xa')](),controller[_0xed8e('0xe')]);router[_0xed8e('0x9')](_0xed8e('0xf'),auth['isAuthenticated'](),controller[_0xed8e('0x10')]);router[_0xed8e('0x11')]('/',auth[_0xed8e('0xa')](),controller[_0xed8e('0x12')]);router[_0xed8e('0x11')](_0xed8e('0xd'),auth[_0xed8e('0xa')](),controller[_0xed8e('0x13')]);router[_0xed8e('0x14')]('/:id',auth[_0xed8e('0xa')](),controller[_0xed8e('0x15')]);router[_0xed8e('0x16')](_0xed8e('0xb'),auth['isAuthenticated'](),controller[_0xed8e('0x17')]);module['exports']=router;
\ No newline at end of file
index 3d6fd0c..8c571e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1574=['STRING','username','remoteUri','ENUM','password','token','integrationTab','newTab','sequelize','exports'];(function(_0x295583,_0x4756aa){var _0x4c2ae6=function(_0xa20d19){while(--_0xa20d19){_0x295583['push'](_0x295583['shift']());}};_0x4c2ae6(++_0x4756aa);}(_0x1574,0x148));var _0x4157=function(_0x43a435,_0x1f811e){_0x43a435=_0x43a435-0x0;var _0x2a7284=_0x1574[_0x43a435];return _0x2a7284;};'use strict';var Sequelize=require(_0x4157('0x0'));module[_0x4157('0x1')]={'name':{'type':Sequelize[_0x4157('0x2')]},'description':{'type':Sequelize[_0x4157('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0x4157('0x3')},'password':{'type':Sequelize[_0x4157('0x2')]},'token':{'type':Sequelize[_0x4157('0x2')]},'remoteUri':{'type':Sequelize[_0x4157('0x2')],'unique':_0x4157('0x4')},'authType':{'type':Sequelize[_0x4157('0x5')](_0x4157('0x6'),_0x4157('0x7')),'defaultValue':_0x4157('0x6')},'serverUrl':{'type':Sequelize[_0x4157('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4157('0x5')](_0x4157('0x8'),_0x4157('0x9')),'defaultValue':_0x4157('0x8')}};
\ No newline at end of file
+var _0x4813=['password','token','newTab','integrationTab','sequelize','exports','STRING','username','remoteUri','ENUM'];(function(_0x434276,_0xac4ff8){var _0x41c7fd=function(_0x56521f){while(--_0x56521f){_0x434276['push'](_0x434276['shift']());}};_0x41c7fd(++_0xac4ff8);}(_0x4813,0x14e));var _0x3481=function(_0x20ccb3,_0x47fc14){_0x20ccb3=_0x20ccb3-0x0;var _0x38e5e7=_0x4813[_0x20ccb3];return _0x38e5e7;};'use strict';var Sequelize=require(_0x3481('0x0'));module[_0x3481('0x1')]={'name':{'type':Sequelize[_0x3481('0x2')]},'description':{'type':Sequelize[_0x3481('0x2')]},'username':{'type':Sequelize[_0x3481('0x2')],'unique':_0x3481('0x3')},'password':{'type':Sequelize[_0x3481('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3481('0x2')],'unique':_0x3481('0x4')},'authType':{'type':Sequelize[_0x3481('0x5')](_0x3481('0x6'),_0x3481('0x7')),'defaultValue':'password'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x3481('0x5')]('integrationTab',_0x3481('0x8')),'defaultValue':_0x3481('0x9')}};
\ No newline at end of file
index e9c3de6..c808616 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c00=['options','getConfigurations','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','ZendeskConfiguration','ZendeskField','Subjects','username','token','authType','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','ticket_fields','password','headers','%s:%s','toString','base64','%s/token:%s','Sequelize','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','request-promise','moment','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','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','error','stack','name','send','index','map','ZendeskAccount','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','includeAll','include','findAll','catch','show','find','create','body','update','params','destroy','findOne','filter'];(function(_0x4fb65f,_0x507407){var _0x230ef0=function(_0x14af52){while(--_0x14af52){_0x4fb65f['push'](_0x4fb65f['shift']());}};_0x230ef0(++_0x507407);}(_0x9c00,0x1a0));var _0x09c0=function(_0x2b63c9,_0x9b77ef){_0x2b63c9=_0x2b63c9-0x0;var _0x5928c6=_0x9c00[_0x2b63c9];return _0x5928c6;};'use strict';var emlformat=require(_0x09c0('0x0'));var rimraf=require(_0x09c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x09c0('0x2'));var moment=require(_0x09c0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x09c0('0x4'));var util=require(_0x09c0('0x5'));var path=require(_0x09c0('0x6'));var sox=require(_0x09c0('0x7'));var csv=require(_0x09c0('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x09c0('0x9'));var squel=require(_0x09c0('0xa'));var crypto=require(_0x09c0('0xb'));var jsforce=require(_0x09c0('0xc'));var deskjs=require(_0x09c0('0xd'));var toCsv=require('to-csv');var querystring=require(_0x09c0('0xe'));var Papa=require(_0x09c0('0xf'));var Redis=require(_0x09c0('0x10'));var authService=require(_0x09c0('0x11'));var qs=require(_0x09c0('0x12'));var as=require(_0x09c0('0x13'));var hardwareService=require(_0x09c0('0x14'));var logger=require(_0x09c0('0x15'))(_0x09c0('0x16'));var utils=require(_0x09c0('0x17'));var config=require(_0x09c0('0x18'));var licenseUtil=require(_0x09c0('0x19'));var db=require(_0x09c0('0x1a'))['db'];var integrations=require(_0x09c0('0x1b'));function respondWithStatusCode(_0x3b95cc,_0x331905){_0x331905=_0x331905||0xcc;return function(_0x6149a8){if(_0x6149a8){return _0x3b95cc[_0x09c0('0x1c')](_0x331905);}return _0x3b95cc[_0x09c0('0x1d')](_0x331905)[_0x09c0('0x1e')]();};}function respondWithResult(_0x16e490,_0x254598){_0x254598=_0x254598||0xc8;return function(_0x152140){if(_0x152140){return _0x16e490[_0x09c0('0x1d')](_0x254598)[_0x09c0('0x1f')](_0x152140);}};}function respondWithFilteredResult(_0x2fdf11,_0x4ff6b7){return function(_0x590129){if(_0x590129){var _0x558b4f=typeof _0x4ff6b7[_0x09c0('0x20')]===_0x09c0('0x21')&&typeof _0x4ff6b7[_0x09c0('0x22')]===_0x09c0('0x21');var _0x5dcab7=_0x590129[_0x09c0('0x23')];var _0x4aa8a5=_0x558b4f?0x0:_0x4ff6b7['offset'];var _0x2c12da=_0x558b4f?_0x590129['count']:_0x4ff6b7[_0x09c0('0x20')]+_0x4ff6b7[_0x09c0('0x22')];var _0x2da257;if(_0x2c12da>=_0x5dcab7){_0x2c12da=_0x5dcab7;_0x2da257=0xc8;}else{_0x2da257=0xce;}_0x2fdf11['status'](_0x2da257);return _0x2fdf11[_0x09c0('0x24')](_0x09c0('0x25'),_0x4aa8a5+'-'+_0x2c12da+'/'+_0x5dcab7)[_0x09c0('0x1f')](_0x590129);}return null;};}function patchUpdates(_0x3447c5){return function(_0x12bba7){try{jsonpatch[_0x09c0('0x26')](_0x12bba7,_0x3447c5,!![]);}catch(_0x8c6b9a){return BPromise['reject'](_0x8c6b9a);}return _0x12bba7[_0x09c0('0x27')]();};}function saveUpdates(_0x46f171,_0x473fbd){return function(_0x1d18e9){if(_0x1d18e9){return _0x1d18e9['update'](_0x46f171)['then'](function(_0x321bcc){return _0x321bcc;});}return null;};}function removeEntity(_0x25fdb5,_0x1e8a1c){return function(_0x3a5370){if(_0x3a5370){return _0x3a5370['destroy']()[_0x09c0('0x28')](function(){_0x25fdb5[_0x09c0('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c7202,_0x163a59){return function(_0x2e3d4d){if(!_0x2e3d4d){_0x2c7202[_0x09c0('0x1c')](0x194);}return _0x2e3d4d;};}function handleError(_0x1f8131,_0x1d2d9d){_0x1d2d9d=_0x1d2d9d||0x1f4;return function(_0x45cc64){logger[_0x09c0('0x29')](_0x45cc64[_0x09c0('0x2a')]);if(_0x45cc64[_0x09c0('0x2b')]){delete _0x45cc64[_0x09c0('0x2b')];}_0x1f8131['status'](_0x1d2d9d)[_0x09c0('0x2c')](_0x45cc64);};}exports[_0x09c0('0x2d')]=function(_0x53a7b8,_0x1d09e0){var _0x5aa0b9={},_0x3f5b10={},_0x4d6bdc={'count':0x0,'rows':[]};var _0x3ac8e4=_[_0x09c0('0x2e')](db[_0x09c0('0x2f')][_0x09c0('0x30')],function(_0x4e999a){return{'name':_0x4e999a['fieldName'],'type':_0x4e999a[_0x09c0('0x31')][_0x09c0('0x32')]};});_0x3f5b10[_0x09c0('0x33')]=_['map'](_0x3ac8e4,_0x09c0('0x2b'));_0x3f5b10['query']=_[_0x09c0('0x34')](_0x53a7b8[_0x09c0('0x35')]);_0x3f5b10[_0x09c0('0x36')]=_['intersection'](_0x3f5b10[_0x09c0('0x33')],_0x3f5b10[_0x09c0('0x35')]);_0x5aa0b9[_0x09c0('0x37')]=_[_0x09c0('0x38')](_0x3f5b10[_0x09c0('0x33')],qs[_0x09c0('0x39')](_0x53a7b8[_0x09c0('0x35')]['fields']));_0x5aa0b9[_0x09c0('0x37')]=_0x5aa0b9[_0x09c0('0x37')][_0x09c0('0x3a')]?_0x5aa0b9[_0x09c0('0x37')]:_0x3f5b10[_0x09c0('0x33')];if(!_0x53a7b8['query'][_0x09c0('0x3b')](_0x09c0('0x3c'))){_0x5aa0b9[_0x09c0('0x22')]=qs[_0x09c0('0x22')](_0x53a7b8[_0x09c0('0x35')]['limit']);_0x5aa0b9[_0x09c0('0x20')]=qs[_0x09c0('0x20')](_0x53a7b8[_0x09c0('0x35')][_0x09c0('0x20')]);}_0x5aa0b9[_0x09c0('0x3d')]=qs[_0x09c0('0x3e')](_0x53a7b8[_0x09c0('0x35')]['sort']);_0x5aa0b9[_0x09c0('0x3f')]=qs[_0x09c0('0x36')](_[_0x09c0('0x40')](_0x53a7b8[_0x09c0('0x35')],_0x3f5b10[_0x09c0('0x36')]),_0x3ac8e4);if(_0x53a7b8['query']['filter']){_0x5aa0b9['where']=_['merge'](_0x5aa0b9[_0x09c0('0x3f')],{'$or':_[_0x09c0('0x2e')](_0x3ac8e4,function(_0xfd295b){if(_0xfd295b[_0x09c0('0x31')]!==_0x09c0('0x41')){var _0x4bd637={};_0x4bd637[_0xfd295b[_0x09c0('0x2b')]]={'$like':'%'+_0x53a7b8[_0x09c0('0x35')]['filter']+'%'};return _0x4bd637;}})});}_0x5aa0b9=_[_0x09c0('0x42')]({},_0x5aa0b9,_0x53a7b8['options']);var _0x3ee063={'where':_0x5aa0b9['where']};return db[_0x09c0('0x2f')][_0x09c0('0x23')](_0x3ee063)['then'](function(_0x26a21c){_0x4d6bdc[_0x09c0('0x23')]=_0x26a21c;if(_0x53a7b8['query'][_0x09c0('0x43')]){_0x5aa0b9[_0x09c0('0x44')]=[{'all':!![]}];}return db[_0x09c0('0x2f')][_0x09c0('0x45')](_0x5aa0b9);})[_0x09c0('0x28')](function(_0x34326c){_0x4d6bdc['rows']=_0x34326c;return _0x4d6bdc;})[_0x09c0('0x28')](respondWithFilteredResult(_0x1d09e0,_0x5aa0b9))[_0x09c0('0x46')](handleError(_0x1d09e0,null));};exports[_0x09c0('0x47')]=function(_0x57835c,_0x193ed2){var _0x30c0c5={'raw':![],'where':{'id':_0x57835c['params']['id']}},_0x447224={};_0x447224[_0x09c0('0x33')]=_[_0x09c0('0x34')](db['ZendeskAccount']['rawAttributes']);_0x447224[_0x09c0('0x35')]=_[_0x09c0('0x34')](_0x57835c['query']);_0x447224[_0x09c0('0x36')]=_[_0x09c0('0x38')](_0x447224['model'],_0x447224[_0x09c0('0x35')]);_0x30c0c5[_0x09c0('0x37')]=_[_0x09c0('0x38')](_0x447224[_0x09c0('0x33')],qs[_0x09c0('0x39')](_0x57835c['query'][_0x09c0('0x39')]));_0x30c0c5['attributes']=_0x30c0c5['attributes'][_0x09c0('0x3a')]?_0x30c0c5[_0x09c0('0x37')]:_0x447224[_0x09c0('0x33')];if(_0x57835c[_0x09c0('0x35')][_0x09c0('0x43')]){_0x30c0c5[_0x09c0('0x44')]=[{'all':!![]}];}_0x30c0c5=_['merge']({},_0x30c0c5,_0x57835c['options']);return db['ZendeskAccount'][_0x09c0('0x48')](_0x30c0c5)[_0x09c0('0x28')](handleEntityNotFound(_0x193ed2,null))[_0x09c0('0x28')](respondWithResult(_0x193ed2,null))['catch'](handleError(_0x193ed2,null));};exports[_0x09c0('0x49')]=function(_0xff9650,_0x2016f1){return db[_0x09c0('0x2f')][_0x09c0('0x49')](_0xff9650[_0x09c0('0x4a')],{})[_0x09c0('0x28')](respondWithResult(_0x2016f1,0xc9))[_0x09c0('0x46')](handleError(_0x2016f1,null));};exports[_0x09c0('0x4b')]=function(_0x38085c,_0x1b0198){if(_0x38085c[_0x09c0('0x4a')]['id']){delete _0x38085c[_0x09c0('0x4a')]['id'];}return db[_0x09c0('0x2f')][_0x09c0('0x48')]({'where':{'id':_0x38085c[_0x09c0('0x4c')]['id']}})[_0x09c0('0x28')](handleEntityNotFound(_0x1b0198,null))[_0x09c0('0x28')](saveUpdates(_0x38085c[_0x09c0('0x4a')],null))[_0x09c0('0x28')](respondWithResult(_0x1b0198,null))['catch'](handleError(_0x1b0198,null));};exports[_0x09c0('0x4d')]=function(_0x44befb,_0x15b0a2){return db[_0x09c0('0x2f')][_0x09c0('0x48')]({'where':{'id':_0x44befb['params']['id']}})[_0x09c0('0x28')](handleEntityNotFound(_0x15b0a2,null))[_0x09c0('0x28')](removeEntity(_0x15b0a2,null))[_0x09c0('0x46')](handleError(_0x15b0a2,null));};exports['getConfigurations']=function(_0xe0b82a,_0x18c728,_0x14b701){var _0x25a36a={};var _0x55b0f0={};var _0xebfd6d;var _0x45ecd0;return db['ZendeskAccount'][_0x09c0('0x4e')]({'where':{'id':_0xe0b82a[_0x09c0('0x4c')]['id']}})[_0x09c0('0x28')](handleEntityNotFound(_0x18c728,null))[_0x09c0('0x28')](function(_0x21fe00){if(_0x21fe00){_0xebfd6d=_0x21fe00;_0x55b0f0[_0x09c0('0x33')]=_[_0x09c0('0x34')](db['ZendeskConfiguration']['rawAttributes']);_0x55b0f0[_0x09c0('0x35')]=_[_0x09c0('0x34')](_0xe0b82a[_0x09c0('0x35')]);_0x55b0f0['filters']=_[_0x09c0('0x38')](_0x55b0f0['model'],_0x55b0f0[_0x09c0('0x35')]);_0x25a36a[_0x09c0('0x37')]=_[_0x09c0('0x38')](_0x55b0f0[_0x09c0('0x33')],qs[_0x09c0('0x39')](_0xe0b82a[_0x09c0('0x35')][_0x09c0('0x39')]));_0x25a36a['attributes']=_0x25a36a[_0x09c0('0x37')][_0x09c0('0x3a')]?_0x25a36a[_0x09c0('0x37')]:_0x55b0f0[_0x09c0('0x33')];_0x25a36a[_0x09c0('0x3d')]=qs[_0x09c0('0x3e')](_0xe0b82a[_0x09c0('0x35')][_0x09c0('0x3e')]);_0x25a36a[_0x09c0('0x3f')]=qs[_0x09c0('0x36')](_[_0x09c0('0x40')](_0xe0b82a['query'],_0x55b0f0[_0x09c0('0x36')]));if(_0xe0b82a[_0x09c0('0x35')][_0x09c0('0x4f')]){_0x25a36a[_0x09c0('0x3f')]=_['merge'](_0x25a36a[_0x09c0('0x3f')],{'$or':_['map'](_0x25a36a[_0x09c0('0x37')],function(_0x9a4f4){var _0x1cfdb3={};_0x1cfdb3[_0x9a4f4]={'$like':'%'+_0xe0b82a['query']['filter']+'%'};return _0x1cfdb3;})});}_0x25a36a=_[_0x09c0('0x42')]({},_0x25a36a,_0xe0b82a[_0x09c0('0x50')]);return _0xebfd6d[_0x09c0('0x51')](_0x25a36a);}})[_0x09c0('0x28')](function(_0x4b65c7){if(_0x4b65c7){_0x45ecd0=_0x4b65c7[_0x09c0('0x3a')];if(!_0xe0b82a[_0x09c0('0x35')]['hasOwnProperty'](_0x09c0('0x3c'))){_0x25a36a[_0x09c0('0x22')]=qs[_0x09c0('0x22')](_0xe0b82a[_0x09c0('0x35')]['limit']);_0x25a36a[_0x09c0('0x20')]=qs[_0x09c0('0x20')](_0xe0b82a[_0x09c0('0x35')][_0x09c0('0x20')]);}return _0xebfd6d[_0x09c0('0x51')](_0x25a36a);}})[_0x09c0('0x28')](function(_0x30d976){if(_0x30d976){return _0x30d976?{'count':_0x45ecd0,'rows':_0x30d976}:null;}})[_0x09c0('0x28')](respondWithResult(_0x18c728,null))[_0x09c0('0x46')](handleError(_0x18c728,null));};exports[_0x09c0('0x52')]=function(_0x85adc7,_0x2906cb,_0x2d67e8){if(_0x85adc7['body']['id']){delete _0x85adc7[_0x09c0('0x4a')]['id'];}return db[_0x09c0('0x2f')][_0x09c0('0x4e')]({'where':{'id':_0x85adc7[_0x09c0('0x4c')]['id']}})[_0x09c0('0x28')](handleEntityNotFound(_0x2906cb,null))['then'](function(_0x1205da){if(_0x1205da){_0x85adc7[_0x09c0('0x4a')][_0x09c0('0x53')]=_0x1205da['id'];_0x85adc7[_0x09c0('0x4a')]['Subjects']=integrations[_0x09c0('0x54')](_0x85adc7[_0x09c0('0x4a')]['channel'],_0x85adc7[_0x09c0('0x4a')][_0x09c0('0x31')]);_0x85adc7[_0x09c0('0x4a')][_0x09c0('0x55')]=integrations[_0x09c0('0x56')](_0x85adc7['body'][_0x09c0('0x57')],_0x85adc7[_0x09c0('0x4a')][_0x09c0('0x31')]);return db[_0x09c0('0x58')][_0x09c0('0x49')](_0x85adc7['body'],{'include':[{'model':db[_0x09c0('0x59')],'as':_0x09c0('0x5a')},{'model':db[_0x09c0('0x59')],'as':_0x09c0('0x55')}]});}return null;})[_0x09c0('0x28')](respondWithResult(_0x2906cb,null))[_0x09c0('0x46')](handleError(_0x2906cb,null));};exports['getFields']=function(_0x51fc84,_0x583c0d,_0x52fe65){var _0x7c1cb8='';return db[_0x09c0('0x2f')][_0x09c0('0x4e')]({'where':{'id':_0x51fc84['params']['id']},'attributes':['id',_0x09c0('0x5b'),'password',_0x09c0('0x5c'),_0x09c0('0x5d'),'remoteUri']})[_0x09c0('0x28')](handleEntityNotFound(_0x583c0d,null))['then'](function(_0x4a42c4){if(_0x4a42c4){_0x7c1cb8=_0x4a42c4[_0x09c0('0x5e')];var _0x111647=_0x7c1cb8[_0x09c0('0x5f')](-0x1);if(_0x111647==='/'){_0x7c1cb8=_0x7c1cb8[_0x09c0('0x60')](0x0,_0x7c1cb8[_0x09c0('0x61')](_0x111647));}var _0x3ffd37={'method':_0x09c0('0x62'),'uri':util[_0x09c0('0x63')](_0x09c0('0x64'),_0x7c1cb8,_0x09c0('0x65')),'json':!![]};switch(_0x4a42c4['authType']){case _0x09c0('0x66'):_0x3ffd37[_0x09c0('0x67')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x09c0('0x63')](_0x09c0('0x68'),_0x4a42c4[_0x09c0('0x5b')],_0x4a42c4[_0x09c0('0x66')]))[_0x09c0('0x69')](_0x09c0('0x6a')))};break;case _0x09c0('0x5c'):_0x3ffd37['headers']={'Authorization':util[_0x09c0('0x63')]('Basic\x20%s',new Buffer(util[_0x09c0('0x63')](_0x09c0('0x6b'),_0x4a42c4[_0x09c0('0x5b')],_0x4a42c4[_0x09c0('0x5c')]))[_0x09c0('0x69')]('base64'))};break;default:throw new db[(_0x09c0('0x6c'))]['ValidationError'](_0x09c0('0x6d'));}return rp(_0x3ffd37);}})['then'](function(_0x35c446){if(_0x35c446){var _0x3e8b19=[_0x09c0('0x6e'),_0x09c0('0x6f'),_0x09c0('0x70'),_0x09c0('0x71')];_[_0x09c0('0x72')](_0x35c446['ticket_fields'],function(_0x4ab50d){return _0x3e8b19[_0x09c0('0x73')](_0x4ab50d[_0x09c0('0x31')]);});return{'count':_0x35c446[_0x09c0('0x65')][_0x09c0('0x3a')],'rows':_[_0x09c0('0x2e')](_0x35c446[_0x09c0('0x65')],function(_0x4060bb){return{'id':_0x4060bb['id'],'name':_0x4060bb[_0x09c0('0x74')]>0x7?_0x4060bb[_0x09c0('0x75')]:_0x4060bb[_0x09c0('0x31')],'custom':_0x4060bb['position']>0x7?!![]:![],'options':_0x4060bb['system_field_options']?_0x4060bb['system_field_options']:_0x4060bb[_0x09c0('0x76')]?_0x4060bb[_0x09c0('0x76')]:[]};})};}})[_0x09c0('0x28')](respondWithResult(_0x583c0d,null))['catch'](function(_0x5f1857){var _0x1618de=_0x51fc84['query'][_0x09c0('0x77')]?0x1f4:_0x5f1857[_0x09c0('0x78')]||0x1f4;logger['error'](_0x09c0('0x79'),'getFields',_0x1618de,JSON[_0x09c0('0x7a')](_0x5f1857));delete _0x5f1857[_0x09c0('0x2b')];if(_0x1618de===0x191){_0x1618de=0x190;}_0x583c0d[_0x09c0('0x1d')](_0x1618de)['send'](_0x51fc84[_0x09c0('0x35')][_0x09c0('0x77')]?{'message':_0x09c0('0x7b'),'statusCode':_0x5f1857[_0x09c0('0x78')]}:_0x5f1857);});};
\ No newline at end of file
+var _0x4ded=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','keys','rawAttributes','intersection','include','find','create','body','findOne','ZendeskConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','username','password','token','authType','remoteUri','substring','format','%s/%s','headers','Basic\x20%s','toString','base64','%s/token:%s','Sequelize','subject','description','group','assignee','ticket_fields','includes','position','system_field_options','custom_field_options','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZendeskAccount','type','model','query','filters','fields','attributes','length'];(function(_0x4637f3,_0x5137f7){var _0x497b5b=function(_0x3ceae0){while(--_0x3ceae0){_0x4637f3['push'](_0x4637f3['shift']());}};_0x497b5b(++_0x5137f7);}(_0x4ded,0x116));var _0xd4de=function(_0x5d91ae,_0x11646e){_0x5d91ae=_0x5d91ae-0x0;var _0x84287e=_0x4ded[_0x5d91ae];return _0x84287e;};'use strict';var emlformat=require(_0xd4de('0x0'));var rimraf=require(_0xd4de('0x1'));var zipdir=require(_0xd4de('0x2'));var jsonpatch=require(_0xd4de('0x3'));var rp=require(_0xd4de('0x4'));var moment=require(_0xd4de('0x5'));var BPromise=require(_0xd4de('0x6'));var Mustache=require(_0xd4de('0x7'));var util=require(_0xd4de('0x8'));var path=require(_0xd4de('0x9'));var sox=require(_0xd4de('0xa'));var csv=require(_0xd4de('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd4de('0xc'));var _=require(_0xd4de('0xd'));var squel=require(_0xd4de('0xe'));var crypto=require(_0xd4de('0xf'));var jsforce=require(_0xd4de('0x10'));var deskjs=require(_0xd4de('0x11'));var toCsv=require('to-csv');var querystring=require(_0xd4de('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd4de('0x13'));var as=require(_0xd4de('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd4de('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd4de('0x16'));var db=require(_0xd4de('0x17'))['db'];var integrations=require(_0xd4de('0x18'));function respondWithStatusCode(_0x2aa09d,_0x3ffc72){_0x3ffc72=_0x3ffc72||0xcc;return function(_0x3af6e0){if(_0x3af6e0){return _0x2aa09d[_0xd4de('0x19')](_0x3ffc72);}return _0x2aa09d[_0xd4de('0x1a')](_0x3ffc72)[_0xd4de('0x1b')]();};}function respondWithResult(_0x37cb9f,_0x691ba9){_0x691ba9=_0x691ba9||0xc8;return function(_0xd0d906){if(_0xd0d906){return _0x37cb9f[_0xd4de('0x1a')](_0x691ba9)[_0xd4de('0x1c')](_0xd0d906);}};}function respondWithFilteredResult(_0x102e5b,_0xa7c18b){return function(_0x325fba){if(_0x325fba){var _0x4b0a95=typeof _0xa7c18b['offset']===_0xd4de('0x1d')&&typeof _0xa7c18b[_0xd4de('0x1e')]===_0xd4de('0x1d');var _0x428aa2=_0x325fba['count'];var _0x4d0df6=_0x4b0a95?0x0:_0xa7c18b[_0xd4de('0x1f')];var _0x54b757=_0x4b0a95?_0x325fba[_0xd4de('0x20')]:_0xa7c18b[_0xd4de('0x1f')]+_0xa7c18b['limit'];var _0xc15081;if(_0x54b757>=_0x428aa2){_0x54b757=_0x428aa2;_0xc15081=0xc8;}else{_0xc15081=0xce;}_0x102e5b['status'](_0xc15081);return _0x102e5b[_0xd4de('0x21')](_0xd4de('0x22'),_0x4d0df6+'-'+_0x54b757+'/'+_0x428aa2)[_0xd4de('0x1c')](_0x325fba);}return null;};}function patchUpdates(_0x8e8712){return function(_0x5368f5){try{jsonpatch[_0xd4de('0x23')](_0x5368f5,_0x8e8712,!![]);}catch(_0x47311c){return BPromise[_0xd4de('0x24')](_0x47311c);}return _0x5368f5[_0xd4de('0x25')]();};}function saveUpdates(_0x1c631a,_0x2d092a){return function(_0x1561fd){if(_0x1561fd){return _0x1561fd[_0xd4de('0x26')](_0x1c631a)[_0xd4de('0x27')](function(_0x413f68){return _0x413f68;});}return null;};}function removeEntity(_0x534b37,_0xad333f){return function(_0x88a0b9){if(_0x88a0b9){return _0x88a0b9[_0xd4de('0x28')]()[_0xd4de('0x27')](function(){_0x534b37[_0xd4de('0x1a')](0xcc)[_0xd4de('0x1b')]();});}};}function handleEntityNotFound(_0xffe1cc,_0x36308c){return function(_0x2aa82a){if(!_0x2aa82a){_0xffe1cc[_0xd4de('0x19')](0x194);}return _0x2aa82a;};}function handleError(_0x2ea712,_0xb2d8a1){_0xb2d8a1=_0xb2d8a1||0x1f4;return function(_0x586126){logger[_0xd4de('0x29')](_0x586126[_0xd4de('0x2a')]);if(_0x586126['name']){delete _0x586126[_0xd4de('0x2b')];}_0x2ea712['status'](_0xb2d8a1)[_0xd4de('0x2c')](_0x586126);};}exports[_0xd4de('0x2d')]=function(_0x15d2b7,_0x4fa53a){var _0xd4de93={},_0x36f2f1={},_0x17f0a={'count':0x0,'rows':[]};var _0x50cb73=_[_0xd4de('0x2e')](db[_0xd4de('0x2f')]['rawAttributes'],function(_0x5103b5){return{'name':_0x5103b5['fieldName'],'type':_0x5103b5[_0xd4de('0x30')]['key']};});_0x36f2f1[_0xd4de('0x31')]=_[_0xd4de('0x2e')](_0x50cb73,_0xd4de('0x2b'));_0x36f2f1[_0xd4de('0x32')]=_['keys'](_0x15d2b7[_0xd4de('0x32')]);_0x36f2f1[_0xd4de('0x33')]=_['intersection'](_0x36f2f1[_0xd4de('0x31')],_0x36f2f1[_0xd4de('0x32')]);_0xd4de93['attributes']=_['intersection'](_0x36f2f1[_0xd4de('0x31')],qs[_0xd4de('0x34')](_0x15d2b7[_0xd4de('0x32')][_0xd4de('0x34')]));_0xd4de93['attributes']=_0xd4de93[_0xd4de('0x35')][_0xd4de('0x36')]?_0xd4de93['attributes']:_0x36f2f1[_0xd4de('0x31')];if(!_0x15d2b7[_0xd4de('0x32')][_0xd4de('0x37')](_0xd4de('0x38'))){_0xd4de93[_0xd4de('0x1e')]=qs[_0xd4de('0x1e')](_0x15d2b7['query']['limit']);_0xd4de93[_0xd4de('0x1f')]=qs[_0xd4de('0x1f')](_0x15d2b7[_0xd4de('0x32')]['offset']);}_0xd4de93[_0xd4de('0x39')]=qs[_0xd4de('0x3a')](_0x15d2b7['query'][_0xd4de('0x3a')]);_0xd4de93[_0xd4de('0x3b')]=qs[_0xd4de('0x33')](_[_0xd4de('0x3c')](_0x15d2b7['query'],_0x36f2f1['filters']),_0x50cb73);if(_0x15d2b7[_0xd4de('0x32')]['filter']){_0xd4de93[_0xd4de('0x3b')]=_['merge'](_0xd4de93[_0xd4de('0x3b')],{'$or':_[_0xd4de('0x2e')](_0x50cb73,function(_0x21cd77){if(_0x21cd77[_0xd4de('0x30')]!=='VIRTUAL'){var _0x21209d={};_0x21209d[_0x21cd77['name']]={'$like':'%'+_0x15d2b7[_0xd4de('0x32')][_0xd4de('0x3d')]+'%'};return _0x21209d;}})});}_0xd4de93=_[_0xd4de('0x3e')]({},_0xd4de93,_0x15d2b7[_0xd4de('0x3f')]);var _0x349c5f={'where':_0xd4de93[_0xd4de('0x3b')]};return db[_0xd4de('0x2f')]['count'](_0x349c5f)[_0xd4de('0x27')](function(_0x1eb001){_0x17f0a[_0xd4de('0x20')]=_0x1eb001;if(_0x15d2b7[_0xd4de('0x32')][_0xd4de('0x40')]){_0xd4de93['include']=[{'all':!![]}];}return db[_0xd4de('0x2f')][_0xd4de('0x41')](_0xd4de93);})[_0xd4de('0x27')](function(_0x593ee9){_0x17f0a[_0xd4de('0x42')]=_0x593ee9;return _0x17f0a;})[_0xd4de('0x27')](respondWithFilteredResult(_0x4fa53a,_0xd4de93))[_0xd4de('0x43')](handleError(_0x4fa53a,null));};exports['show']=function(_0x3b9026,_0x10a42c){var _0x419c49={'raw':![],'where':{'id':_0x3b9026[_0xd4de('0x44')]['id']}},_0x3f1e22={};_0x3f1e22[_0xd4de('0x31')]=_[_0xd4de('0x45')](db['ZendeskAccount'][_0xd4de('0x46')]);_0x3f1e22[_0xd4de('0x32')]=_[_0xd4de('0x45')](_0x3b9026['query']);_0x3f1e22[_0xd4de('0x33')]=_[_0xd4de('0x47')](_0x3f1e22[_0xd4de('0x31')],_0x3f1e22['query']);_0x419c49['attributes']=_[_0xd4de('0x47')](_0x3f1e22[_0xd4de('0x31')],qs['fields'](_0x3b9026[_0xd4de('0x32')][_0xd4de('0x34')]));_0x419c49[_0xd4de('0x35')]=_0x419c49[_0xd4de('0x35')]['length']?_0x419c49[_0xd4de('0x35')]:_0x3f1e22[_0xd4de('0x31')];if(_0x3b9026[_0xd4de('0x32')][_0xd4de('0x40')]){_0x419c49[_0xd4de('0x48')]=[{'all':!![]}];}_0x419c49=_[_0xd4de('0x3e')]({},_0x419c49,_0x3b9026['options']);return db[_0xd4de('0x2f')][_0xd4de('0x49')](_0x419c49)[_0xd4de('0x27')](handleEntityNotFound(_0x10a42c,null))[_0xd4de('0x27')](respondWithResult(_0x10a42c,null))[_0xd4de('0x43')](handleError(_0x10a42c,null));};exports[_0xd4de('0x4a')]=function(_0x40bf55,_0x425a7e){return db[_0xd4de('0x2f')][_0xd4de('0x4a')](_0x40bf55['body'],{})[_0xd4de('0x27')](respondWithResult(_0x425a7e,0xc9))[_0xd4de('0x43')](handleError(_0x425a7e,null));};exports[_0xd4de('0x26')]=function(_0x518bfe,_0x13a900){if(_0x518bfe[_0xd4de('0x4b')]['id']){delete _0x518bfe[_0xd4de('0x4b')]['id'];}return db[_0xd4de('0x2f')][_0xd4de('0x49')]({'where':{'id':_0x518bfe[_0xd4de('0x44')]['id']}})[_0xd4de('0x27')](handleEntityNotFound(_0x13a900,null))[_0xd4de('0x27')](saveUpdates(_0x518bfe[_0xd4de('0x4b')],null))[_0xd4de('0x27')](respondWithResult(_0x13a900,null))['catch'](handleError(_0x13a900,null));};exports[_0xd4de('0x28')]=function(_0x26d032,_0x215f85){return db[_0xd4de('0x2f')][_0xd4de('0x49')]({'where':{'id':_0x26d032['params']['id']}})['then'](handleEntityNotFound(_0x215f85,null))[_0xd4de('0x27')](removeEntity(_0x215f85,null))[_0xd4de('0x43')](handleError(_0x215f85,null));};exports['getConfigurations']=function(_0x48cb7d,_0x2d8589,_0x368081){var _0x377376={};var _0x199440={};var _0x34d772;var _0x15c8cd;return db[_0xd4de('0x2f')][_0xd4de('0x4c')]({'where':{'id':_0x48cb7d[_0xd4de('0x44')]['id']}})[_0xd4de('0x27')](handleEntityNotFound(_0x2d8589,null))[_0xd4de('0x27')](function(_0x2e1780){if(_0x2e1780){_0x34d772=_0x2e1780;_0x199440['model']=_[_0xd4de('0x45')](db[_0xd4de('0x4d')][_0xd4de('0x46')]);_0x199440[_0xd4de('0x32')]=_[_0xd4de('0x45')](_0x48cb7d[_0xd4de('0x32')]);_0x199440['filters']=_[_0xd4de('0x47')](_0x199440['model'],_0x199440['query']);_0x377376[_0xd4de('0x35')]=_[_0xd4de('0x47')](_0x199440[_0xd4de('0x31')],qs[_0xd4de('0x34')](_0x48cb7d['query'][_0xd4de('0x34')]));_0x377376[_0xd4de('0x35')]=_0x377376[_0xd4de('0x35')][_0xd4de('0x36')]?_0x377376[_0xd4de('0x35')]:_0x199440['model'];_0x377376['order']=qs['sort'](_0x48cb7d[_0xd4de('0x32')][_0xd4de('0x3a')]);_0x377376[_0xd4de('0x3b')]=qs[_0xd4de('0x33')](_['pick'](_0x48cb7d[_0xd4de('0x32')],_0x199440[_0xd4de('0x33')]));if(_0x48cb7d[_0xd4de('0x32')][_0xd4de('0x3d')]){_0x377376['where']=_[_0xd4de('0x3e')](_0x377376[_0xd4de('0x3b')],{'$or':_[_0xd4de('0x2e')](_0x377376[_0xd4de('0x35')],function(_0x598b60){var _0x4fd7c2={};_0x4fd7c2[_0x598b60]={'$like':'%'+_0x48cb7d['query'][_0xd4de('0x3d')]+'%'};return _0x4fd7c2;})});}_0x377376=_[_0xd4de('0x3e')]({},_0x377376,_0x48cb7d[_0xd4de('0x3f')]);return _0x34d772['getConfigurations'](_0x377376);}})[_0xd4de('0x27')](function(_0x3005c2){if(_0x3005c2){_0x15c8cd=_0x3005c2[_0xd4de('0x36')];if(!_0x48cb7d['query'][_0xd4de('0x37')]('nolimit')){_0x377376[_0xd4de('0x1e')]=qs[_0xd4de('0x1e')](_0x48cb7d[_0xd4de('0x32')][_0xd4de('0x1e')]);_0x377376[_0xd4de('0x1f')]=qs[_0xd4de('0x1f')](_0x48cb7d[_0xd4de('0x32')][_0xd4de('0x1f')]);}return _0x34d772['getConfigurations'](_0x377376);}})[_0xd4de('0x27')](function(_0x59f9d9){if(_0x59f9d9){return _0x59f9d9?{'count':_0x15c8cd,'rows':_0x59f9d9}:null;}})[_0xd4de('0x27')](respondWithResult(_0x2d8589,null))[_0xd4de('0x43')](handleError(_0x2d8589,null));};exports['addConfiguration']=function(_0x29c840,_0xb366b0,_0x21f7f7){if(_0x29c840[_0xd4de('0x4b')]['id']){delete _0x29c840[_0xd4de('0x4b')]['id'];}return db[_0xd4de('0x2f')][_0xd4de('0x4c')]({'where':{'id':_0x29c840[_0xd4de('0x44')]['id']}})[_0xd4de('0x27')](handleEntityNotFound(_0xb366b0,null))[_0xd4de('0x27')](function(_0x1e7e93){if(_0x1e7e93){_0x29c840[_0xd4de('0x4b')][_0xd4de('0x4e')]=_0x1e7e93['id'];_0x29c840['body'][_0xd4de('0x4f')]=integrations[_0xd4de('0x50')](_0x29c840[_0xd4de('0x4b')][_0xd4de('0x51')],_0x29c840[_0xd4de('0x4b')][_0xd4de('0x30')]);_0x29c840[_0xd4de('0x4b')][_0xd4de('0x52')]=integrations['getDescriptions'](_0x29c840[_0xd4de('0x4b')]['channel'],_0x29c840['body']['type']);return db[_0xd4de('0x4d')][_0xd4de('0x4a')](_0x29c840['body'],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db['ZendeskField'],'as':_0xd4de('0x52')}]});}return null;})['then'](respondWithResult(_0xb366b0,null))[_0xd4de('0x43')](handleError(_0xb366b0,null));};exports['getFields']=function(_0x1a0e6c,_0x223b1a,_0x4ee475){var _0x5df891='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x1a0e6c[_0xd4de('0x44')]['id']},'attributes':['id',_0xd4de('0x53'),_0xd4de('0x54'),_0xd4de('0x55'),_0xd4de('0x56'),_0xd4de('0x57')]})['then'](handleEntityNotFound(_0x223b1a,null))['then'](function(_0x53cbd9){if(_0x53cbd9){_0x5df891=_0x53cbd9[_0xd4de('0x57')];var _0x2bb19d=_0x5df891['slice'](-0x1);if(_0x2bb19d==='/'){_0x5df891=_0x5df891[_0xd4de('0x58')](0x0,_0x5df891['lastIndexOf'](_0x2bb19d));}var _0x1bc101={'method':'GET','uri':util[_0xd4de('0x59')](_0xd4de('0x5a'),_0x5df891,'ticket_fields'),'json':!![]};switch(_0x53cbd9[_0xd4de('0x56')]){case'password':_0x1bc101[_0xd4de('0x5b')]={'Authorization':util[_0xd4de('0x59')](_0xd4de('0x5c'),new Buffer(util[_0xd4de('0x59')]('%s:%s',_0x53cbd9[_0xd4de('0x53')],_0x53cbd9[_0xd4de('0x54')]))[_0xd4de('0x5d')](_0xd4de('0x5e')))};break;case _0xd4de('0x55'):_0x1bc101[_0xd4de('0x5b')]={'Authorization':util[_0xd4de('0x59')](_0xd4de('0x5c'),new Buffer(util[_0xd4de('0x59')](_0xd4de('0x5f'),_0x53cbd9[_0xd4de('0x53')],_0x53cbd9[_0xd4de('0x55')]))[_0xd4de('0x5d')]('base64'))};break;default:throw new db[(_0xd4de('0x60'))]['ValidationError']('Unknown\x20authentication\x20type');}return rp(_0x1bc101);}})[_0xd4de('0x27')](function(_0x595ee){if(_0x595ee){var _0x5f197d=[_0xd4de('0x61'),_0xd4de('0x62'),_0xd4de('0x63'),_0xd4de('0x64')];_['remove'](_0x595ee[_0xd4de('0x65')],function(_0xee18fc){return _0x5f197d[_0xd4de('0x66')](_0xee18fc[_0xd4de('0x30')]);});return{'count':_0x595ee[_0xd4de('0x65')]['length'],'rows':_['map'](_0x595ee['ticket_fields'],function(_0x4a2467){return{'id':_0x4a2467['id'],'name':_0x4a2467[_0xd4de('0x67')]>0x7?_0x4a2467['title']:_0x4a2467[_0xd4de('0x30')],'custom':_0x4a2467['position']>0x7?!![]:![],'options':_0x4a2467[_0xd4de('0x68')]?_0x4a2467[_0xd4de('0x68')]:_0x4a2467[_0xd4de('0x69')]?_0x4a2467[_0xd4de('0x69')]:[]};})};}})[_0xd4de('0x27')](respondWithResult(_0x223b1a,null))[_0xd4de('0x43')](function(_0x15f056){var _0x31b518=_0x1a0e6c['query'][_0xd4de('0x6a')]?0x1f4:_0x15f056[_0xd4de('0x6b')]||0x1f4;logger[_0xd4de('0x29')](_0xd4de('0x6c'),'getFields',_0x31b518,JSON[_0xd4de('0x6d')](_0x15f056));delete _0x15f056[_0xd4de('0x2b')];if(_0x31b518===0x191){_0x31b518=0x190;}_0x223b1a['status'](_0x31b518)[_0xd4de('0x2c')](_0x1a0e6c[_0xd4de('0x32')][_0xd4de('0x6a')]?{'message':_0xd4de('0x6e'),'statusCode':_0x15f056[_0xd4de('0x6b')]}:_0x15f056);});};
\ No newline at end of file
index e1cd2d8..adbf509 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01d9=['./intZendeskAccount.attributes','exports','define','int_zendesk_accounts','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x27fc8b,_0x36c64b){var _0x3cd69c=function(_0x2293ff){while(--_0x2293ff){_0x27fc8b['push'](_0x27fc8b['shift']());}};_0x3cd69c(++_0x36c64b);}(_0x01d9,0x16f));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x901d('0x0'));var moment=require(_0x901d('0x1'));var BPromise=require(_0x901d('0x2'));var rp=require(_0x901d('0x3'));var fs=require('fs');var path=require(_0x901d('0x4'));var rimraf=require(_0x901d('0x5'));var config=require(_0x901d('0x6'));var attributes=require(_0x901d('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x901d('0x8')]=function(_0x4ee5f1,_0x40e944){return _0x4ee5f1[_0x901d('0x9')]('ZendeskAccount',attributes,{'tableName':_0x901d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3067=['api','moment','bluebird','request-promise','path','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','int_zendesk_accounts','lodash','../../config/logger'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x3067,0x12a));var _0x7306=function(_0x54cb11,_0x3cc590){_0x54cb11=_0x54cb11-0x0;var _0x2dcd18=_0x3067[_0x54cb11];return _0x2dcd18;};'use strict';var _=require(_0x7306('0x0'));var util=require('util');var logger=require(_0x7306('0x1'))(_0x7306('0x2'));var moment=require(_0x7306('0x3'));var BPromise=require(_0x7306('0x4'));var rp=require(_0x7306('0x5'));var fs=require('fs');var path=require(_0x7306('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x7306('0x7'));var integrations=require(_0x7306('0x8'));module[_0x7306('0x9')]=function(_0x15e1b6,_0x70b4df){return _0x15e1b6[_0x7306('0xa')]('ZendeskAccount',attributes,{'tableName':_0x7306('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index cbb331b..a136f9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b38=['ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','catch','GetZendeskAccount','findAll','options','raw','where','attributes','include','map','model','debug','ShowZendeskAccount','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0x8b38,0x18a));var _0x88b3=function(_0x4fd109,_0x33c503){_0x4fd109=_0x4fd109-0x0;var _0x30f0a6=_0x8b38[_0x4fd109];return _0x30f0a6;};'use strict';var _=require(_0x88b3('0x0'));var util=require(_0x88b3('0x1'));var moment=require('moment');var BPromise=require(_0x88b3('0x2'));var rs=require(_0x88b3('0x3'));var fs=require('fs');var Redis=require(_0x88b3('0x4'));var db=require(_0x88b3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x88b3('0x6'))(_0x88b3('0x7'));var config=require(_0x88b3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x88b3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4197ca,_0x52ab52,_0x18370a){return new BPromise(function(_0x5190af,_0x202634){return client[_0x88b3('0xa')](_0x4197ca,_0x18370a)[_0x88b3('0xb')](function(_0x20dde7){logger[_0x88b3('0xc')]('ZendeskAccount,\x20%s,\x20%s',_0x52ab52,_0x88b3('0xd'));logger['debug'](_0x88b3('0xe'),_0x52ab52,_0x88b3('0xd'),JSON[_0x88b3('0xf')](_0x20dde7));if(_0x20dde7[_0x88b3('0x10')]){if(_0x20dde7[_0x88b3('0x10')][_0x88b3('0x11')]===0x1f4){logger['error'](_0x88b3('0x12'),_0x52ab52,_0x20dde7['error']['message']);return _0x202634(_0x20dde7[_0x88b3('0x10')]['message']);}logger[_0x88b3('0x10')](_0x88b3('0x12'),_0x52ab52,_0x20dde7[_0x88b3('0x10')][_0x88b3('0x13')]);return _0x5190af(_0x20dde7[_0x88b3('0x10')][_0x88b3('0x13')]);}else{logger['info'](_0x88b3('0x12'),_0x52ab52,'request\x20sent');_0x5190af(_0x20dde7[_0x88b3('0x14')][_0x88b3('0x13')]);}})[_0x88b3('0x15')](function(_0x42d49f){logger[_0x88b3('0x10')](_0x88b3('0x12'),_0x52ab52,_0x42d49f);_0x202634(_0x42d49f);});});}exports[_0x88b3('0x16')]=function(_0x49b17b){var _0x35b425=this;return new Promise(function(_0x2db3af,_0xf91135){return db['ZendeskAccount'][_0x88b3('0x17')]({'raw':_0x49b17b['options']?_0x49b17b[_0x88b3('0x18')][_0x88b3('0x19')]===undefined?!![]:![]:!![],'where':_0x49b17b[_0x88b3('0x18')]?_0x49b17b['options'][_0x88b3('0x1a')]||null:null,'attributes':_0x49b17b[_0x88b3('0x18')]?_0x49b17b['options'][_0x88b3('0x1b')]||null:null,'limit':_0x49b17b[_0x88b3('0x18')]?_0x49b17b[_0x88b3('0x18')]['limit']||null:null,'include':_0x49b17b[_0x88b3('0x18')]?_0x49b17b[_0x88b3('0x18')][_0x88b3('0x1c')]?_[_0x88b3('0x1d')](_0x49b17b[_0x88b3('0x18')][_0x88b3('0x1c')],function(_0x46f388){return{'model':db[_0x46f388[_0x88b3('0x1e')]],'as':_0x46f388['as'],'attributes':_0x46f388['attributes'],'include':_0x46f388[_0x88b3('0x1c')]?_['map'](_0x46f388[_0x88b3('0x1c')],function(_0x49307c){return{'model':db[_0x49307c['model']],'as':_0x49307c['as'],'attributes':_0x49307c[_0x88b3('0x1b')],'include':_0x49307c['include']?_['map'](_0x49307c[_0x88b3('0x1c')],function(_0x1d1144){return{'model':db[_0x1d1144[_0x88b3('0x1e')]],'as':_0x1d1144['as'],'attributes':_0x1d1144['attributes']};}):[]};}):[]};}):[]:[]})[_0x88b3('0xb')](function(_0x303d9e){logger[_0x88b3('0xc')](_0x88b3('0x16'),_0x49b17b);logger[_0x88b3('0x1f')](_0x88b3('0x16'),_0x49b17b,JSON[_0x88b3('0xf')](_0x303d9e));_0x2db3af(_0x303d9e);})[_0x88b3('0x15')](function(_0x3fd646){logger['error'](_0x88b3('0x16'),_0x3fd646[_0x88b3('0x13')],_0x49b17b);_0xf91135(_0x35b425[_0x88b3('0x10')](0x1f4,_0x3fd646[_0x88b3('0x13')]));});});};exports[_0x88b3('0x20')]=function(_0x5ddf43){var _0x1ac357=this;return new Promise(function(_0x1755ea,_0x5a33fa){return db['ZendeskAccount'][_0x88b3('0x21')]({'raw':_0x5ddf43[_0x88b3('0x18')]?_0x5ddf43['options']['raw']===undefined?!![]:![]:!![],'where':_0x5ddf43[_0x88b3('0x18')]?_0x5ddf43[_0x88b3('0x18')][_0x88b3('0x1a')]||null:null,'attributes':_0x5ddf43[_0x88b3('0x18')]?_0x5ddf43[_0x88b3('0x18')][_0x88b3('0x1b')]||null:null,'include':_0x5ddf43[_0x88b3('0x18')]?_0x5ddf43['options'][_0x88b3('0x1c')]?_['map'](_0x5ddf43['options']['include'],function(_0x20f0f1){return{'model':db[_0x20f0f1[_0x88b3('0x1e')]],'as':_0x20f0f1['as'],'attributes':_0x20f0f1['attributes'],'include':_0x20f0f1[_0x88b3('0x1c')]?_[_0x88b3('0x1d')](_0x20f0f1[_0x88b3('0x1c')],function(_0x1fc4c2){return{'model':db[_0x1fc4c2[_0x88b3('0x1e')]],'as':_0x1fc4c2['as'],'attributes':_0x1fc4c2['attributes'],'include':_0x1fc4c2['include']?_[_0x88b3('0x1d')](_0x1fc4c2[_0x88b3('0x1c')],function(_0x19be75){return{'model':db[_0x19be75[_0x88b3('0x1e')]],'as':_0x19be75['as'],'attributes':_0x19be75[_0x88b3('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d4b48){logger[_0x88b3('0xc')](_0x88b3('0x20'),_0x5ddf43);logger[_0x88b3('0x1f')]('ShowZendeskAccount',_0x5ddf43,JSON['stringify'](_0x4d4b48));_0x1755ea(_0x4d4b48);})[_0x88b3('0x15')](function(_0xb8b1a4){logger['error']('ShowZendeskAccount',_0xb8b1a4[_0x88b3('0x13')],_0x5ddf43);_0x5a33fa(_0x1ac357[_0x88b3('0x10')](0x1f4,_0xb8b1a4['message']));});});};
\ No newline at end of file
+var _0x00b3=['options','raw','where','limit','include','map','model','attributes','ShowZendeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','request\x20sent','result','catch','GetZendeskAccount','ZendeskAccount','findAll'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0x00b3,0x157));var _0x300b=function(_0x16c787,_0x3ff6fa){_0x16c787=_0x16c787-0x0;var _0x34c3a8=_0x00b3[_0x16c787];return _0x34c3a8;};'use strict';var _=require(_0x300b('0x0'));var util=require(_0x300b('0x1'));var moment=require(_0x300b('0x2'));var BPromise=require(_0x300b('0x3'));var rs=require(_0x300b('0x4'));var fs=require('fs');var Redis=require(_0x300b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x300b('0x6'));var logger=require(_0x300b('0x7'))('rpc');var config=require(_0x300b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x300b('0x9')][_0x300b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2533d3,_0x2caa7c,_0x291829){return new BPromise(function(_0x5501f7,_0x3aa555){return client[_0x300b('0xb')](_0x2533d3,_0x291829)[_0x300b('0xc')](function(_0xe6e730){logger[_0x300b('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x2caa7c,'request\x20sent');logger[_0x300b('0xe')](_0x300b('0xf'),_0x2caa7c,'request\x20sent',JSON[_0x300b('0x10')](_0xe6e730));if(_0xe6e730[_0x300b('0x11')]){if(_0xe6e730['error'][_0x300b('0x12')]===0x1f4){logger[_0x300b('0x11')](_0x300b('0x13'),_0x2caa7c,_0xe6e730[_0x300b('0x11')][_0x300b('0x14')]);return _0x3aa555(_0xe6e730[_0x300b('0x11')][_0x300b('0x14')]);}logger[_0x300b('0x11')](_0x300b('0x13'),_0x2caa7c,_0xe6e730['error']['message']);return _0x5501f7(_0xe6e730[_0x300b('0x11')][_0x300b('0x14')]);}else{logger['info']('ZendeskAccount,\x20%s,\x20%s',_0x2caa7c,_0x300b('0x15'));_0x5501f7(_0xe6e730[_0x300b('0x16')][_0x300b('0x14')]);}})[_0x300b('0x17')](function(_0x438bf4){logger[_0x300b('0x11')](_0x300b('0x13'),_0x2caa7c,_0x438bf4);_0x3aa555(_0x438bf4);});});}exports[_0x300b('0x18')]=function(_0x5be041){var _0x3909a3=this;return new Promise(function(_0x3860ab,_0x1a0224){return db[_0x300b('0x19')][_0x300b('0x1a')]({'raw':_0x5be041[_0x300b('0x1b')]?_0x5be041['options'][_0x300b('0x1c')]===undefined?!![]:![]:!![],'where':_0x5be041['options']?_0x5be041[_0x300b('0x1b')][_0x300b('0x1d')]||null:null,'attributes':_0x5be041['options']?_0x5be041[_0x300b('0x1b')]['attributes']||null:null,'limit':_0x5be041[_0x300b('0x1b')]?_0x5be041['options'][_0x300b('0x1e')]||null:null,'include':_0x5be041[_0x300b('0x1b')]?_0x5be041['options'][_0x300b('0x1f')]?_[_0x300b('0x20')](_0x5be041['options'][_0x300b('0x1f')],function(_0x516c25){return{'model':db[_0x516c25[_0x300b('0x21')]],'as':_0x516c25['as'],'attributes':_0x516c25[_0x300b('0x22')],'include':_0x516c25[_0x300b('0x1f')]?_[_0x300b('0x20')](_0x516c25[_0x300b('0x1f')],function(_0x29ba9e){return{'model':db[_0x29ba9e[_0x300b('0x21')]],'as':_0x29ba9e['as'],'attributes':_0x29ba9e['attributes'],'include':_0x29ba9e[_0x300b('0x1f')]?_[_0x300b('0x20')](_0x29ba9e['include'],function(_0x42913a){return{'model':db[_0x42913a['model']],'as':_0x42913a['as'],'attributes':_0x42913a[_0x300b('0x22')]};}):[]};}):[]};}):[]:[]})[_0x300b('0xc')](function(_0x3b4b5b){logger[_0x300b('0xd')](_0x300b('0x18'),_0x5be041);logger[_0x300b('0xe')](_0x300b('0x18'),_0x5be041,JSON['stringify'](_0x3b4b5b));_0x3860ab(_0x3b4b5b);})[_0x300b('0x17')](function(_0x395066){logger[_0x300b('0x11')](_0x300b('0x18'),_0x395066[_0x300b('0x14')],_0x5be041);_0x1a0224(_0x3909a3[_0x300b('0x11')](0x1f4,_0x395066['message']));});});};exports[_0x300b('0x23')]=function(_0x3c0d46){var _0x363261=this;return new Promise(function(_0x2390b5,_0x3e37a1){return db['ZendeskAccount'][_0x300b('0x24')]({'raw':_0x3c0d46[_0x300b('0x1b')]?_0x3c0d46[_0x300b('0x1b')][_0x300b('0x1c')]===undefined?!![]:![]:!![],'where':_0x3c0d46[_0x300b('0x1b')]?_0x3c0d46['options'][_0x300b('0x1d')]||null:null,'attributes':_0x3c0d46[_0x300b('0x1b')]?_0x3c0d46[_0x300b('0x1b')][_0x300b('0x22')]||null:null,'include':_0x3c0d46[_0x300b('0x1b')]?_0x3c0d46[_0x300b('0x1b')][_0x300b('0x1f')]?_['map'](_0x3c0d46['options'][_0x300b('0x1f')],function(_0x54978c){return{'model':db[_0x54978c[_0x300b('0x21')]],'as':_0x54978c['as'],'attributes':_0x54978c['attributes'],'include':_0x54978c['include']?_[_0x300b('0x20')](_0x54978c[_0x300b('0x1f')],function(_0x4c5832){return{'model':db[_0x4c5832[_0x300b('0x21')]],'as':_0x4c5832['as'],'attributes':_0x4c5832['attributes'],'include':_0x4c5832[_0x300b('0x1f')]?_[_0x300b('0x20')](_0x4c5832['include'],function(_0xc5a0af){return{'model':db[_0xc5a0af['model']],'as':_0xc5a0af['as'],'attributes':_0xc5a0af['attributes']};}):[]};}):[]};}):[]:[]})[_0x300b('0xc')](function(_0x4bd4e6){logger[_0x300b('0xd')](_0x300b('0x23'),_0x3c0d46);logger[_0x300b('0xe')](_0x300b('0x23'),_0x3c0d46,JSON[_0x300b('0x10')](_0x4bd4e6));_0x2390b5(_0x4bd4e6);})['catch'](function(_0x34b42e){logger['error'](_0x300b('0x23'),_0x34b42e['message'],_0x3c0d46);_0x3e37a1(_0x363261[_0x300b('0x11')](0x1f4,_0x34b42e[_0x300b('0x14')]));});});};
\ No newline at end of file
index d1e4730..dca7467 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','post','create','put','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x54425a,_0x406695){var _0x31f9f9=function(_0x58f707){while(--_0x58f707){_0x54425a['push'](_0x54425a['shift']());}};_0x31f9f9(++_0x406695);}(_0xda3f,0xec));var _0xfda3=function(_0x6fd218,_0x1ec710){_0x6fd218=_0x6fd218-0x0;var _0x4b8110=_0xda3f[_0x6fd218];return _0x4b8110;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./intZendeskConfiguration.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x5')](_0xfda3('0x9'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0x5')](_0xfda3('0xb'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0x5')]('/:id/descriptions',auth[_0xfda3('0x6')](),controller[_0xfda3('0xd')]);router[_0xfda3('0x5')](_0xfda3('0xe'),auth[_0xfda3('0x6')](),controller['getTags']);router[_0xfda3('0xf')]('/',auth['isAuthenticated'](),controller[_0xfda3('0x10')]);router[_0xfda3('0xf')]('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0xfda3('0x11')](_0xfda3('0x7'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x12')]);module[_0xfda3('0x13')]=router;
\ No newline at end of file
+var _0xac4a=['../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','get','show','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','setTags','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x579fda,_0x35afa7){var _0x40054f=function(_0x1e3923){while(--_0x1e3923){_0x579fda['push'](_0x579fda['shift']());}};_0x40054f(++_0x35afa7);}(_0xac4a,0x13f));var _0xaac4=function(_0x1242ca,_0x9f2090){_0x1242ca=_0x1242ca-0x0;var _0x51f60a=_0xac4a[_0x1242ca];return _0x51f60a;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var controller=require(_0xaac4('0x8'));router['get']('/',auth[_0xaac4('0x9')](),controller['index']);router[_0xaac4('0xa')]('/:id',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['get']('/:id/fields',auth[_0xaac4('0x9')](),controller['getFields']);router[_0xaac4('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router[_0xaac4('0xa')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xe')]);router['get']('/:id/tags',auth[_0xaac4('0x9')](),controller[_0xaac4('0xf')]);router[_0xaac4('0x10')]('/',auth['isAuthenticated'](),controller[_0xaac4('0x11')]);router[_0xaac4('0x10')]('/:id/tags',auth[_0xaac4('0x9')](),controller[_0xaac4('0x12')]);router[_0xaac4('0x13')](_0xaac4('0x14'),auth[_0xaac4('0x9')](),controller[_0xaac4('0x15')]);router[_0xaac4('0x16')](_0xaac4('0x14'),auth[_0xaac4('0x9')](),controller[_0xaac4('0x17')]);module[_0xaac4('0x18')]=router;
\ No newline at end of file
index c1e658d..5221392 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2ce=['STRING','exports'];(function(_0x31211d,_0x1735d2){var _0x537426=function(_0x21656e){while(--_0x21656e){_0x31211d['push'](_0x31211d['shift']());}};_0x537426(++_0x1735d2);}(_0xe2ce,0x10f));var _0xee2c=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xe2ce[_0x160c73];return _0xd9302;};'use strict';var Sequelize=require('sequelize');module[_0xee2c('0x0')]={'name':{'type':Sequelize[_0xee2c('0x1')]},'description':{'type':Sequelize[_0xee2c('0x1')]}};
\ No newline at end of file
+var _0x558f=['STRING','sequelize','exports'];(function(_0x3be0c4,_0x5b7eff){var _0x11af9f=function(_0x3f5113){while(--_0x3f5113){_0x3be0c4['push'](_0x3be0c4['shift']());}};_0x11af9f(++_0x5b7eff);}(_0x558f,0x1cf));var _0xf558=function(_0x47aa3e,_0x1fd279){_0x47aa3e=_0x47aa3e-0x0;var _0x5d0792=_0x558f[_0x47aa3e];return _0x5d0792;};'use strict';var Sequelize=require(_0xf558('0x0'));module[_0xf558('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf558('0x2')]}};
\ No newline at end of file
index b01f7b5..93fda1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2963=['intersection','options','find','catch','create','body','findOne','ZendeskField','getFields','getSubjects','order','hasOwnProperty','getDescriptions','Tag','getTags','setTags','ids','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','then','error','name','send','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','nolimit','sort','pick','merge','VIRTUAL','filter','where','includeAll','include','findAll','rows','show','params'];(function(_0x4cce65,_0x40021e){var _0x4d1b45=function(_0x54d290){while(--_0x54d290){_0x4cce65['push'](_0x4cce65['shift']());}};_0x4d1b45(++_0x40021e);}(_0x2963,0x1b5));var _0x3296=function(_0x2f982c,_0x12d464){_0x2f982c=_0x2f982c-0x0;var _0x24f4d7=_0x2963[_0x2f982c];return _0x24f4d7;};'use strict';var emlformat=require(_0x3296('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3296('0x1'));var BPromise=require(_0x3296('0x2'));var Mustache=require(_0x3296('0x3'));var util=require(_0x3296('0x4'));var path=require(_0x3296('0x5'));var sox=require(_0x3296('0x6'));var csv=require(_0x3296('0x7'));var ejs=require(_0x3296('0x8'));var fs=require('fs');var fs_extra=require(_0x3296('0x9'));var _=require(_0x3296('0xa'));var squel=require(_0x3296('0xb'));var crypto=require(_0x3296('0xc'));var jsforce=require(_0x3296('0xd'));var deskjs=require(_0x3296('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3296('0xf'));var Papa=require('papaparse');var Redis=require(_0x3296('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3296('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3296('0x12'));var utils=require(_0x3296('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x3296('0x14'));var db=require(_0x3296('0x15'))['db'];function respondWithStatusCode(_0x2c41bd,_0x5226e6){_0x5226e6=_0x5226e6||0xcc;return function(_0x1bfd64){if(_0x1bfd64){return _0x2c41bd[_0x3296('0x16')](_0x5226e6);}return _0x2c41bd[_0x3296('0x17')](_0x5226e6)[_0x3296('0x18')]();};}function respondWithResult(_0xf89efd,_0x2b3317){_0x2b3317=_0x2b3317||0xc8;return function(_0x287e56){if(_0x287e56){return _0xf89efd[_0x3296('0x17')](_0x2b3317)[_0x3296('0x19')](_0x287e56);}};}function respondWithFilteredResult(_0x506fb1,_0xbe308){return function(_0x87f8cb){if(_0x87f8cb){var _0x10835a=typeof _0xbe308[_0x3296('0x1a')]==='undefined'&&typeof _0xbe308[_0x3296('0x1b')]===_0x3296('0x1c');var _0x3d92b2=_0x87f8cb[_0x3296('0x1d')];var _0x1daed5=_0x10835a?0x0:_0xbe308['offset'];var _0x183664=_0x10835a?_0x87f8cb[_0x3296('0x1d')]:_0xbe308['offset']+_0xbe308[_0x3296('0x1b')];var _0x4835a1;if(_0x183664>=_0x3d92b2){_0x183664=_0x3d92b2;_0x4835a1=0xc8;}else{_0x4835a1=0xce;}_0x506fb1['status'](_0x4835a1);return _0x506fb1[_0x3296('0x1e')]('Content-Range',_0x1daed5+'-'+_0x183664+'/'+_0x3d92b2)[_0x3296('0x19')](_0x87f8cb);}return null;};}function patchUpdates(_0x48d4bb){return function(_0xdf64d3){try{jsonpatch[_0x3296('0x1f')](_0xdf64d3,_0x48d4bb,!![]);}catch(_0x58647b){return BPromise[_0x3296('0x20')](_0x58647b);}return _0xdf64d3[_0x3296('0x21')]();};}function saveUpdates(_0x1df8e2,_0x3e652b){return function(_0x4cbf9c){if(_0x4cbf9c){return _0x4cbf9c[_0x3296('0x22')](_0x1df8e2)['then'](function(_0x2796ce){return _0x2796ce;});}return null;};}function removeEntity(_0x5792e9,_0x10a943){return function(_0x3d6d42){if(_0x3d6d42){return _0x3d6d42[_0x3296('0x23')]()[_0x3296('0x24')](function(){_0x5792e9['status'](0xcc)[_0x3296('0x18')]();});}};}function handleEntityNotFound(_0x5a0e9c,_0x3e4775){return function(_0x58a5d4){if(!_0x58a5d4){_0x5a0e9c[_0x3296('0x16')](0x194);}return _0x58a5d4;};}function handleError(_0x229149,_0x1b8dac){_0x1b8dac=_0x1b8dac||0x1f4;return function(_0x7501bd){logger[_0x3296('0x25')](_0x7501bd['stack']);if(_0x7501bd[_0x3296('0x26')]){delete _0x7501bd[_0x3296('0x26')];}_0x229149[_0x3296('0x17')](_0x1b8dac)[_0x3296('0x27')](_0x7501bd);};}exports[_0x3296('0x28')]=function(_0x38c98b,_0x324a59){var _0x37d4c3={},_0x1bd61a={},_0x25bec1={'count':0x0,'rows':[]};var _0xb797af=_[_0x3296('0x29')](db[_0x3296('0x2a')][_0x3296('0x2b')],function(_0x1967fe){return{'name':_0x1967fe[_0x3296('0x2c')],'type':_0x1967fe[_0x3296('0x2d')][_0x3296('0x2e')]};});_0x1bd61a[_0x3296('0x2f')]=_[_0x3296('0x29')](_0xb797af,_0x3296('0x26'));_0x1bd61a['query']=_[_0x3296('0x30')](_0x38c98b[_0x3296('0x31')]);_0x1bd61a[_0x3296('0x32')]=_['intersection'](_0x1bd61a[_0x3296('0x2f')],_0x1bd61a[_0x3296('0x31')]);_0x37d4c3[_0x3296('0x33')]=_['intersection'](_0x1bd61a[_0x3296('0x2f')],qs[_0x3296('0x34')](_0x38c98b[_0x3296('0x31')][_0x3296('0x34')]));_0x37d4c3[_0x3296('0x33')]=_0x37d4c3[_0x3296('0x33')][_0x3296('0x35')]?_0x37d4c3[_0x3296('0x33')]:_0x1bd61a[_0x3296('0x2f')];if(!_0x38c98b[_0x3296('0x31')]['hasOwnProperty'](_0x3296('0x36'))){_0x37d4c3[_0x3296('0x1b')]=qs[_0x3296('0x1b')](_0x38c98b[_0x3296('0x31')][_0x3296('0x1b')]);_0x37d4c3[_0x3296('0x1a')]=qs[_0x3296('0x1a')](_0x38c98b[_0x3296('0x31')][_0x3296('0x1a')]);}_0x37d4c3['order']=qs[_0x3296('0x37')](_0x38c98b[_0x3296('0x31')][_0x3296('0x37')]);_0x37d4c3['where']=qs[_0x3296('0x32')](_[_0x3296('0x38')](_0x38c98b[_0x3296('0x31')],_0x1bd61a[_0x3296('0x32')]),_0xb797af);if(_0x38c98b[_0x3296('0x31')]['filter']){_0x37d4c3['where']=_[_0x3296('0x39')](_0x37d4c3['where'],{'$or':_[_0x3296('0x29')](_0xb797af,function(_0x50a190){if(_0x50a190[_0x3296('0x2d')]!==_0x3296('0x3a')){var _0x33969e={};_0x33969e[_0x50a190[_0x3296('0x26')]]={'$like':'%'+_0x38c98b[_0x3296('0x31')][_0x3296('0x3b')]+'%'};return _0x33969e;}})});}_0x37d4c3=_['merge']({},_0x37d4c3,_0x38c98b['options']);var _0x9a1404={'where':_0x37d4c3[_0x3296('0x3c')]};return db[_0x3296('0x2a')][_0x3296('0x1d')](_0x9a1404)['then'](function(_0x1cca62){_0x25bec1[_0x3296('0x1d')]=_0x1cca62;if(_0x38c98b[_0x3296('0x31')][_0x3296('0x3d')]){_0x37d4c3[_0x3296('0x3e')]=[{'all':!![]}];}return db[_0x3296('0x2a')][_0x3296('0x3f')](_0x37d4c3);})['then'](function(_0x426254){_0x25bec1[_0x3296('0x40')]=_0x426254;return _0x25bec1;})[_0x3296('0x24')](respondWithFilteredResult(_0x324a59,_0x37d4c3))['catch'](handleError(_0x324a59,null));};exports[_0x3296('0x41')]=function(_0x4f848c,_0x3400c3){var _0x11b5fe={'raw':![],'where':{'id':_0x4f848c[_0x3296('0x42')]['id']}},_0x11d54a={};_0x11d54a[_0x3296('0x2f')]=_[_0x3296('0x30')](db[_0x3296('0x2a')][_0x3296('0x2b')]);_0x11d54a[_0x3296('0x31')]=_['keys'](_0x4f848c[_0x3296('0x31')]);_0x11d54a[_0x3296('0x32')]=_[_0x3296('0x43')](_0x11d54a[_0x3296('0x2f')],_0x11d54a[_0x3296('0x31')]);_0x11b5fe[_0x3296('0x33')]=_[_0x3296('0x43')](_0x11d54a['model'],qs[_0x3296('0x34')](_0x4f848c['query'][_0x3296('0x34')]));_0x11b5fe[_0x3296('0x33')]=_0x11b5fe[_0x3296('0x33')][_0x3296('0x35')]?_0x11b5fe['attributes']:_0x11d54a[_0x3296('0x2f')];if(_0x4f848c[_0x3296('0x31')][_0x3296('0x3d')]){_0x11b5fe[_0x3296('0x3e')]=[{'all':!![]}];}_0x11b5fe=_[_0x3296('0x39')]({},_0x11b5fe,_0x4f848c[_0x3296('0x44')]);return db[_0x3296('0x2a')][_0x3296('0x45')](_0x11b5fe)[_0x3296('0x24')](handleEntityNotFound(_0x3400c3,null))[_0x3296('0x24')](respondWithResult(_0x3400c3,null))[_0x3296('0x46')](handleError(_0x3400c3,null));};exports[_0x3296('0x47')]=function(_0xfc13ff,_0x108653){return db[_0x3296('0x2a')]['create'](_0xfc13ff['body'],{})[_0x3296('0x24')](respondWithResult(_0x108653,0xc9))[_0x3296('0x46')](handleError(_0x108653,null));};exports['update']=function(_0xefe3a4,_0x58c169){if(_0xefe3a4['body']['id']){delete _0xefe3a4[_0x3296('0x48')]['id'];}return db[_0x3296('0x2a')][_0x3296('0x45')]({'where':{'id':_0xefe3a4['params']['id']}})[_0x3296('0x24')](handleEntityNotFound(_0x58c169,null))[_0x3296('0x24')](saveUpdates(_0xefe3a4[_0x3296('0x48')],null))['then'](respondWithResult(_0x58c169,null))[_0x3296('0x46')](handleError(_0x58c169,null));};exports[_0x3296('0x23')]=function(_0x4d0607,_0x14b850){return db['ZendeskConfiguration'][_0x3296('0x45')]({'where':{'id':_0x4d0607[_0x3296('0x42')]['id']}})[_0x3296('0x24')](handleEntityNotFound(_0x14b850,null))[_0x3296('0x24')](removeEntity(_0x14b850,null))['catch'](handleError(_0x14b850,null));};exports['getFields']=function(_0x54d571,_0xc62048,_0x121da5){var _0x567b65={};var _0x2c4dfa={};var _0x5d3088;var _0x264d9d;return db[_0x3296('0x2a')][_0x3296('0x49')]({'where':{'id':_0x54d571[_0x3296('0x42')]['id']}})[_0x3296('0x24')](handleEntityNotFound(_0xc62048,null))['then'](function(_0x1b9b8e){if(_0x1b9b8e){_0x5d3088=_0x1b9b8e;_0x2c4dfa[_0x3296('0x2f')]=_[_0x3296('0x30')](db[_0x3296('0x4a')][_0x3296('0x2b')]);_0x2c4dfa[_0x3296('0x31')]=_[_0x3296('0x30')](_0x54d571[_0x3296('0x31')]);_0x2c4dfa[_0x3296('0x32')]=_[_0x3296('0x43')](_0x2c4dfa[_0x3296('0x2f')],_0x2c4dfa[_0x3296('0x31')]);_0x567b65[_0x3296('0x33')]=_[_0x3296('0x43')](_0x2c4dfa[_0x3296('0x2f')],qs[_0x3296('0x34')](_0x54d571['query'][_0x3296('0x34')]));_0x567b65[_0x3296('0x33')]=_0x567b65[_0x3296('0x33')]['length']?_0x567b65[_0x3296('0x33')]:_0x2c4dfa[_0x3296('0x2f')];_0x567b65['order']=qs[_0x3296('0x37')](_0x54d571[_0x3296('0x31')]['sort']);_0x567b65[_0x3296('0x3c')]=qs[_0x3296('0x32')](_[_0x3296('0x38')](_0x54d571[_0x3296('0x31')],_0x2c4dfa['filters']));if(_0x54d571[_0x3296('0x31')][_0x3296('0x3b')]){_0x567b65[_0x3296('0x3c')]=_[_0x3296('0x39')](_0x567b65[_0x3296('0x3c')],{'$or':_[_0x3296('0x29')](_0x567b65[_0x3296('0x33')],function(_0x987726){var _0x1c7bcf={};_0x1c7bcf[_0x987726]={'$like':'%'+_0x54d571[_0x3296('0x31')][_0x3296('0x3b')]+'%'};return _0x1c7bcf;})});}_0x567b65=_[_0x3296('0x39')]({},_0x567b65,_0x54d571[_0x3296('0x44')]);return _0x5d3088[_0x3296('0x4b')](_0x567b65);}})[_0x3296('0x24')](function(_0x25da95){if(_0x25da95){_0x264d9d=_0x25da95[_0x3296('0x35')];if(!_0x54d571[_0x3296('0x31')]['hasOwnProperty']('nolimit')){_0x567b65[_0x3296('0x1b')]=qs[_0x3296('0x1b')](_0x54d571[_0x3296('0x31')][_0x3296('0x1b')]);_0x567b65[_0x3296('0x1a')]=qs[_0x3296('0x1a')](_0x54d571[_0x3296('0x31')][_0x3296('0x1a')]);}return _0x5d3088[_0x3296('0x4b')](_0x567b65);}})[_0x3296('0x24')](function(_0x58306e){if(_0x58306e){return _0x58306e?{'count':_0x264d9d,'rows':_0x58306e}:null;}})['then'](respondWithResult(_0xc62048,null))['catch'](handleError(_0xc62048,null));};exports[_0x3296('0x4c')]=function(_0x35a654,_0x47a62f,_0x8b19fa){var _0x466b18={};var _0x529679={};var _0x13af95;var _0x4dcac9;return db[_0x3296('0x2a')]['findOne']({'where':{'id':_0x35a654['params']['id']}})[_0x3296('0x24')](handleEntityNotFound(_0x47a62f,null))[_0x3296('0x24')](function(_0x496a3f){if(_0x496a3f){_0x13af95=_0x496a3f;_0x529679['model']=_[_0x3296('0x30')](db[_0x3296('0x4a')]['rawAttributes']);_0x529679[_0x3296('0x31')]=_['keys'](_0x35a654[_0x3296('0x31')]);_0x529679[_0x3296('0x32')]=_[_0x3296('0x43')](_0x529679[_0x3296('0x2f')],_0x529679[_0x3296('0x31')]);_0x466b18['attributes']=_[_0x3296('0x43')](_0x529679['model'],qs[_0x3296('0x34')](_0x35a654['query'][_0x3296('0x34')]));_0x466b18['attributes']=_0x466b18['attributes']['length']?_0x466b18[_0x3296('0x33')]:_0x529679[_0x3296('0x2f')];_0x466b18[_0x3296('0x4d')]=qs[_0x3296('0x37')](_0x35a654[_0x3296('0x31')][_0x3296('0x37')]);_0x466b18[_0x3296('0x3c')]=qs[_0x3296('0x32')](_[_0x3296('0x38')](_0x35a654['query'],_0x529679[_0x3296('0x32')]));if(_0x35a654['query']['filter']){_0x466b18[_0x3296('0x3c')]=_['merge'](_0x466b18[_0x3296('0x3c')],{'$or':_[_0x3296('0x29')](_0x466b18['attributes'],function(_0x29381c){var _0x18196f={};_0x18196f[_0x29381c]={'$like':'%'+_0x35a654[_0x3296('0x31')]['filter']+'%'};return _0x18196f;})});}_0x466b18=_['merge']({},_0x466b18,_0x35a654[_0x3296('0x44')]);return _0x13af95[_0x3296('0x4c')](_0x466b18);}})[_0x3296('0x24')](function(_0x30a9a2){if(_0x30a9a2){_0x4dcac9=_0x30a9a2[_0x3296('0x35')];if(!_0x35a654['query']['hasOwnProperty'](_0x3296('0x36'))){_0x466b18[_0x3296('0x1b')]=qs[_0x3296('0x1b')](_0x35a654['query']['limit']);_0x466b18['offset']=qs[_0x3296('0x1a')](_0x35a654[_0x3296('0x31')]['offset']);}return _0x13af95[_0x3296('0x4c')](_0x466b18);}})[_0x3296('0x24')](function(_0xee8463){if(_0xee8463){return _0xee8463?{'count':_0x4dcac9,'rows':_0xee8463}:null;}})[_0x3296('0x24')](respondWithResult(_0x47a62f,null))[_0x3296('0x46')](handleError(_0x47a62f,null));};exports['getDescriptions']=function(_0x506e7b,_0xbc2cdc,_0x553dfc){var _0x5e3568={};var _0x1f5326={};var _0x474b18;var _0xd1856b;return db[_0x3296('0x2a')]['findOne']({'where':{'id':_0x506e7b[_0x3296('0x42')]['id']}})[_0x3296('0x24')](handleEntityNotFound(_0xbc2cdc,null))['then'](function(_0x12d319){if(_0x12d319){_0x474b18=_0x12d319;_0x1f5326[_0x3296('0x2f')]=_[_0x3296('0x30')](db[_0x3296('0x4a')]['rawAttributes']);_0x1f5326[_0x3296('0x31')]=_['keys'](_0x506e7b[_0x3296('0x31')]);_0x1f5326[_0x3296('0x32')]=_[_0x3296('0x43')](_0x1f5326[_0x3296('0x2f')],_0x1f5326[_0x3296('0x31')]);_0x5e3568[_0x3296('0x33')]=_['intersection'](_0x1f5326[_0x3296('0x2f')],qs[_0x3296('0x34')](_0x506e7b[_0x3296('0x31')]['fields']));_0x5e3568[_0x3296('0x33')]=_0x5e3568[_0x3296('0x33')][_0x3296('0x35')]?_0x5e3568[_0x3296('0x33')]:_0x1f5326[_0x3296('0x2f')];_0x5e3568[_0x3296('0x4d')]=qs[_0x3296('0x37')](_0x506e7b['query']['sort']);_0x5e3568[_0x3296('0x3c')]=qs[_0x3296('0x32')](_[_0x3296('0x38')](_0x506e7b[_0x3296('0x31')],_0x1f5326['filters']));if(_0x506e7b[_0x3296('0x31')][_0x3296('0x3b')]){_0x5e3568[_0x3296('0x3c')]=_[_0x3296('0x39')](_0x5e3568['where'],{'$or':_[_0x3296('0x29')](_0x5e3568[_0x3296('0x33')],function(_0x1d0c29){var _0x989305={};_0x989305[_0x1d0c29]={'$like':'%'+_0x506e7b[_0x3296('0x31')][_0x3296('0x3b')]+'%'};return _0x989305;})});}_0x5e3568=_[_0x3296('0x39')]({},_0x5e3568,_0x506e7b[_0x3296('0x44')]);return _0x474b18['getDescriptions'](_0x5e3568);}})[_0x3296('0x24')](function(_0xf6aaa1){if(_0xf6aaa1){_0xd1856b=_0xf6aaa1[_0x3296('0x35')];if(!_0x506e7b[_0x3296('0x31')][_0x3296('0x4e')](_0x3296('0x36'))){_0x5e3568[_0x3296('0x1b')]=qs['limit'](_0x506e7b[_0x3296('0x31')][_0x3296('0x1b')]);_0x5e3568['offset']=qs['offset'](_0x506e7b[_0x3296('0x31')][_0x3296('0x1a')]);}return _0x474b18[_0x3296('0x4f')](_0x5e3568);}})['then'](function(_0x3814f0){if(_0x3814f0){return _0x3814f0?{'count':_0xd1856b,'rows':_0x3814f0}:null;}})['then'](respondWithResult(_0xbc2cdc,null))[_0x3296('0x46')](handleError(_0xbc2cdc,null));};exports['getTags']=function(_0x2897e5,_0x391862,_0x39f6d8){var _0xb2a1ef={};var _0x512d98={};var _0x551fe1;var _0x282b86;return db['ZendeskConfiguration'][_0x3296('0x49')]({'where':{'id':_0x2897e5[_0x3296('0x42')]['id']}})[_0x3296('0x24')](handleEntityNotFound(_0x391862,null))['then'](function(_0x1d307){if(_0x1d307){_0x551fe1=_0x1d307;_0x512d98[_0x3296('0x2f')]=_[_0x3296('0x30')](db[_0x3296('0x50')][_0x3296('0x2b')]);_0x512d98[_0x3296('0x31')]=_[_0x3296('0x30')](_0x2897e5[_0x3296('0x31')]);_0x512d98[_0x3296('0x32')]=_[_0x3296('0x43')](_0x512d98[_0x3296('0x2f')],_0x512d98[_0x3296('0x31')]);_0xb2a1ef[_0x3296('0x33')]=_[_0x3296('0x43')](_0x512d98[_0x3296('0x2f')],qs['fields'](_0x2897e5['query'][_0x3296('0x34')]));_0xb2a1ef[_0x3296('0x33')]=_0xb2a1ef[_0x3296('0x33')]['length']?_0xb2a1ef[_0x3296('0x33')]:_0x512d98[_0x3296('0x2f')];_0xb2a1ef[_0x3296('0x4d')]=qs['sort'](_0x2897e5[_0x3296('0x31')][_0x3296('0x37')]);_0xb2a1ef[_0x3296('0x3c')]=qs[_0x3296('0x32')](_['pick'](_0x2897e5['query'],_0x512d98['filters']));if(_0x2897e5[_0x3296('0x31')][_0x3296('0x3b')]){_0xb2a1ef['where']=_['merge'](_0xb2a1ef[_0x3296('0x3c')],{'$or':_['map'](_0xb2a1ef[_0x3296('0x33')],function(_0x5129bc){var _0x8120c2={};_0x8120c2[_0x5129bc]={'$like':'%'+_0x2897e5['query'][_0x3296('0x3b')]+'%'};return _0x8120c2;})});}_0xb2a1ef=_['merge']({},_0xb2a1ef,_0x2897e5['options']);return _0x551fe1[_0x3296('0x51')](_0xb2a1ef);}})[_0x3296('0x24')](function(_0x591a5c){if(_0x591a5c){_0x282b86=_0x591a5c[_0x3296('0x35')];if(!_0x2897e5['query'][_0x3296('0x4e')](_0x3296('0x36'))){_0xb2a1ef[_0x3296('0x1b')]=qs[_0x3296('0x1b')](_0x2897e5['query'][_0x3296('0x1b')]);_0xb2a1ef[_0x3296('0x1a')]=qs[_0x3296('0x1a')](_0x2897e5[_0x3296('0x31')][_0x3296('0x1a')]);}return _0x551fe1['getTags'](_0xb2a1ef);}})[_0x3296('0x24')](function(_0x5d3871){if(_0x5d3871){return _0x5d3871?{'count':_0x282b86,'rows':_0x5d3871}:null;}})[_0x3296('0x24')](respondWithResult(_0x391862,null))[_0x3296('0x46')](handleError(_0x391862,null));};exports[_0x3296('0x52')]=function(_0x376537,_0x3c1276,_0x1ce9fb){if(_0x376537[_0x3296('0x48')]['id']){delete _0x376537[_0x3296('0x48')]['id'];}return db[_0x3296('0x2a')]['findOne']({'where':{'id':_0x376537[_0x3296('0x42')]['id']}})['then'](handleEntityNotFound(_0x3c1276,null))[_0x3296('0x24')](function(_0xa05e16){if(_0xa05e16){return _0xa05e16[_0x3296('0x52')](_0x376537[_0x3296('0x48')][_0x3296('0x53')]||[]);}return null;})['then'](respondWithResult(_0x3c1276,null))[_0x3296('0x46')](handleError(_0x3c1276,null));};
\ No newline at end of file
+var _0xc777=['undefined','count','limit','json','apply','save','update','then','error','stack','name','send','map','ZendeskConfiguration','rawAttributes','type','query','keys','intersection','model','fields','attributes','length','nolimit','order','sort','filters','filter','merge','VIRTUAL','options','includeAll','rows','show','params','include','find','create','body','catch','findOne','where','hasOwnProperty','getFields','getSubjects','ZendeskField','pick','getDescriptions','getTags','Tag','setTags','ids','eml-format','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset'];(function(_0x3e6019,_0x231cf4){var _0x138a63=function(_0x21a049){while(--_0x21a049){_0x3e6019['push'](_0x3e6019['shift']());}};_0x138a63(++_0x231cf4);}(_0xc777,0x16c));var _0x7c77=function(_0x48ed18,_0x52839a){_0x48ed18=_0x48ed18-0x0;var _0x5b8cf1=_0xc777[_0x48ed18];return _0x5b8cf1;};'use strict';var emlformat=require(_0x7c77('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x7c77('0x1'));var rp=require(_0x7c77('0x2'));var moment=require(_0x7c77('0x3'));var BPromise=require(_0x7c77('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7c77('0x5'));var sox=require('sox');var csv=require(_0x7c77('0x6'));var ejs=require(_0x7c77('0x7'));var fs=require('fs');var fs_extra=require(_0x7c77('0x8'));var _=require('lodash');var squel=require(_0x7c77('0x9'));var crypto=require('crypto');var jsforce=require(_0x7c77('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x7c77('0x6'));var querystring=require(_0x7c77('0xb'));var Papa=require(_0x7c77('0xc'));var Redis=require(_0x7c77('0xd'));var authService=require(_0x7c77('0xe'));var qs=require(_0x7c77('0xf'));var as=require(_0x7c77('0x10'));var hardwareService=require(_0x7c77('0x11'));var logger=require(_0x7c77('0x12'))('api');var utils=require(_0x7c77('0x13'));var config=require(_0x7c77('0x14'));var licenseUtil=require(_0x7c77('0x15'));var db=require(_0x7c77('0x16'))['db'];function respondWithStatusCode(_0x24217c,_0x1d5faf){_0x1d5faf=_0x1d5faf||0xcc;return function(_0x1d2b36){if(_0x1d2b36){return _0x24217c['sendStatus'](_0x1d5faf);}return _0x24217c[_0x7c77('0x17')](_0x1d5faf)[_0x7c77('0x18')]();};}function respondWithResult(_0x5aa5a9,_0xc8f2a3){_0xc8f2a3=_0xc8f2a3||0xc8;return function(_0x2a5f2e){if(_0x2a5f2e){return _0x5aa5a9['status'](_0xc8f2a3)['json'](_0x2a5f2e);}};}function respondWithFilteredResult(_0x671da6,_0x2e0343){return function(_0x5a1b1e){if(_0x5a1b1e){var _0x38bfab=typeof _0x2e0343[_0x7c77('0x19')]===_0x7c77('0x1a')&&typeof _0x2e0343['limit']===_0x7c77('0x1a');var _0x33136f=_0x5a1b1e[_0x7c77('0x1b')];var _0x3cd25b=_0x38bfab?0x0:_0x2e0343[_0x7c77('0x19')];var _0x466b29=_0x38bfab?_0x5a1b1e[_0x7c77('0x1b')]:_0x2e0343[_0x7c77('0x19')]+_0x2e0343[_0x7c77('0x1c')];var _0x3cd69f;if(_0x466b29>=_0x33136f){_0x466b29=_0x33136f;_0x3cd69f=0xc8;}else{_0x3cd69f=0xce;}_0x671da6[_0x7c77('0x17')](_0x3cd69f);return _0x671da6['set']('Content-Range',_0x3cd25b+'-'+_0x466b29+'/'+_0x33136f)[_0x7c77('0x1d')](_0x5a1b1e);}return null;};}function patchUpdates(_0x246a5c){return function(_0x1bd0e8){try{jsonpatch[_0x7c77('0x1e')](_0x1bd0e8,_0x246a5c,!![]);}catch(_0x4b0de0){return BPromise['reject'](_0x4b0de0);}return _0x1bd0e8[_0x7c77('0x1f')]();};}function saveUpdates(_0x5d3cf3,_0x2c9e1e){return function(_0x561874){if(_0x561874){return _0x561874[_0x7c77('0x20')](_0x5d3cf3)[_0x7c77('0x21')](function(_0x34cbc2){return _0x34cbc2;});}return null;};}function removeEntity(_0x3a5a4b,_0x4f0798){return function(_0x26e5bd){if(_0x26e5bd){return _0x26e5bd['destroy']()[_0x7c77('0x21')](function(){_0x3a5a4b[_0x7c77('0x17')](0xcc)[_0x7c77('0x18')]();});}};}function handleEntityNotFound(_0x3b3fc0,_0x1f4a38){return function(_0x5e5cc9){if(!_0x5e5cc9){_0x3b3fc0['sendStatus'](0x194);}return _0x5e5cc9;};}function handleError(_0x3816f1,_0x3f78a3){_0x3f78a3=_0x3f78a3||0x1f4;return function(_0x300f50){logger[_0x7c77('0x22')](_0x300f50[_0x7c77('0x23')]);if(_0x300f50['name']){delete _0x300f50[_0x7c77('0x24')];}_0x3816f1[_0x7c77('0x17')](_0x3f78a3)[_0x7c77('0x25')](_0x300f50);};}exports['index']=function(_0x2c96ad,_0x2932ec){var _0x434fdb={},_0x2b030c={},_0x7d7e25={'count':0x0,'rows':[]};var _0x415a8a=_[_0x7c77('0x26')](db[_0x7c77('0x27')][_0x7c77('0x28')],function(_0x24f11c){return{'name':_0x24f11c['fieldName'],'type':_0x24f11c[_0x7c77('0x29')]['key']};});_0x2b030c['model']=_['map'](_0x415a8a,_0x7c77('0x24'));_0x2b030c[_0x7c77('0x2a')]=_[_0x7c77('0x2b')](_0x2c96ad['query']);_0x2b030c['filters']=_[_0x7c77('0x2c')](_0x2b030c[_0x7c77('0x2d')],_0x2b030c[_0x7c77('0x2a')]);_0x434fdb['attributes']=_[_0x7c77('0x2c')](_0x2b030c[_0x7c77('0x2d')],qs[_0x7c77('0x2e')](_0x2c96ad[_0x7c77('0x2a')][_0x7c77('0x2e')]));_0x434fdb[_0x7c77('0x2f')]=_0x434fdb[_0x7c77('0x2f')][_0x7c77('0x30')]?_0x434fdb['attributes']:_0x2b030c[_0x7c77('0x2d')];if(!_0x2c96ad[_0x7c77('0x2a')]['hasOwnProperty'](_0x7c77('0x31'))){_0x434fdb[_0x7c77('0x1c')]=qs[_0x7c77('0x1c')](_0x2c96ad[_0x7c77('0x2a')][_0x7c77('0x1c')]);_0x434fdb['offset']=qs[_0x7c77('0x19')](_0x2c96ad[_0x7c77('0x2a')][_0x7c77('0x19')]);}_0x434fdb[_0x7c77('0x32')]=qs[_0x7c77('0x33')](_0x2c96ad['query'][_0x7c77('0x33')]);_0x434fdb['where']=qs[_0x7c77('0x34')](_['pick'](_0x2c96ad[_0x7c77('0x2a')],_0x2b030c[_0x7c77('0x34')]),_0x415a8a);if(_0x2c96ad['query'][_0x7c77('0x35')]){_0x434fdb['where']=_[_0x7c77('0x36')](_0x434fdb['where'],{'$or':_[_0x7c77('0x26')](_0x415a8a,function(_0x558907){if(_0x558907['type']!==_0x7c77('0x37')){var _0x1251b7={};_0x1251b7[_0x558907[_0x7c77('0x24')]]={'$like':'%'+_0x2c96ad[_0x7c77('0x2a')][_0x7c77('0x35')]+'%'};return _0x1251b7;}})});}_0x434fdb=_[_0x7c77('0x36')]({},_0x434fdb,_0x2c96ad[_0x7c77('0x38')]);var _0x5e35d0={'where':_0x434fdb['where']};return db[_0x7c77('0x27')][_0x7c77('0x1b')](_0x5e35d0)['then'](function(_0x3b52ec){_0x7d7e25[_0x7c77('0x1b')]=_0x3b52ec;if(_0x2c96ad[_0x7c77('0x2a')][_0x7c77('0x39')]){_0x434fdb['include']=[{'all':!![]}];}return db['ZendeskConfiguration']['findAll'](_0x434fdb);})['then'](function(_0x49182e){_0x7d7e25[_0x7c77('0x3a')]=_0x49182e;return _0x7d7e25;})[_0x7c77('0x21')](respondWithFilteredResult(_0x2932ec,_0x434fdb))['catch'](handleError(_0x2932ec,null));};exports[_0x7c77('0x3b')]=function(_0x5f1d8e,_0x40aa50){var _0x492a78={'raw':![],'where':{'id':_0x5f1d8e[_0x7c77('0x3c')]['id']}},_0x16158a={};_0x16158a[_0x7c77('0x2d')]=_['keys'](db[_0x7c77('0x27')][_0x7c77('0x28')]);_0x16158a['query']=_[_0x7c77('0x2b')](_0x5f1d8e['query']);_0x16158a[_0x7c77('0x34')]=_[_0x7c77('0x2c')](_0x16158a[_0x7c77('0x2d')],_0x16158a[_0x7c77('0x2a')]);_0x492a78[_0x7c77('0x2f')]=_[_0x7c77('0x2c')](_0x16158a[_0x7c77('0x2d')],qs['fields'](_0x5f1d8e[_0x7c77('0x2a')][_0x7c77('0x2e')]));_0x492a78['attributes']=_0x492a78[_0x7c77('0x2f')][_0x7c77('0x30')]?_0x492a78[_0x7c77('0x2f')]:_0x16158a[_0x7c77('0x2d')];if(_0x5f1d8e[_0x7c77('0x2a')][_0x7c77('0x39')]){_0x492a78[_0x7c77('0x3d')]=[{'all':!![]}];}_0x492a78=_[_0x7c77('0x36')]({},_0x492a78,_0x5f1d8e[_0x7c77('0x38')]);return db[_0x7c77('0x27')][_0x7c77('0x3e')](_0x492a78)['then'](handleEntityNotFound(_0x40aa50,null))['then'](respondWithResult(_0x40aa50,null))['catch'](handleError(_0x40aa50,null));};exports[_0x7c77('0x3f')]=function(_0x2a1c78,_0x1ecab6){return db[_0x7c77('0x27')][_0x7c77('0x3f')](_0x2a1c78[_0x7c77('0x40')],{})[_0x7c77('0x21')](respondWithResult(_0x1ecab6,0xc9))[_0x7c77('0x41')](handleError(_0x1ecab6,null));};exports['update']=function(_0x53c771,_0x293b8e){if(_0x53c771[_0x7c77('0x40')]['id']){delete _0x53c771['body']['id'];}return db[_0x7c77('0x27')][_0x7c77('0x3e')]({'where':{'id':_0x53c771[_0x7c77('0x3c')]['id']}})[_0x7c77('0x21')](handleEntityNotFound(_0x293b8e,null))[_0x7c77('0x21')](saveUpdates(_0x53c771[_0x7c77('0x40')],null))[_0x7c77('0x21')](respondWithResult(_0x293b8e,null))[_0x7c77('0x41')](handleError(_0x293b8e,null));};exports['destroy']=function(_0x147b8d,_0x5fea12){return db[_0x7c77('0x27')][_0x7c77('0x3e')]({'where':{'id':_0x147b8d['params']['id']}})['then'](handleEntityNotFound(_0x5fea12,null))[_0x7c77('0x21')](removeEntity(_0x5fea12,null))[_0x7c77('0x41')](handleError(_0x5fea12,null));};exports['getFields']=function(_0x3ab398,_0xc9eba3,_0x42e61e){var _0x269050={};var _0x3c8c9b={};var _0x3883bb;var _0x4ce6a7;return db['ZendeskConfiguration'][_0x7c77('0x42')]({'where':{'id':_0x3ab398[_0x7c77('0x3c')]['id']}})[_0x7c77('0x21')](handleEntityNotFound(_0xc9eba3,null))['then'](function(_0xc4ea58){if(_0xc4ea58){_0x3883bb=_0xc4ea58;_0x3c8c9b[_0x7c77('0x2d')]=_[_0x7c77('0x2b')](db['ZendeskField'][_0x7c77('0x28')]);_0x3c8c9b['query']=_[_0x7c77('0x2b')](_0x3ab398['query']);_0x3c8c9b['filters']=_[_0x7c77('0x2c')](_0x3c8c9b[_0x7c77('0x2d')],_0x3c8c9b[_0x7c77('0x2a')]);_0x269050['attributes']=_[_0x7c77('0x2c')](_0x3c8c9b[_0x7c77('0x2d')],qs[_0x7c77('0x2e')](_0x3ab398[_0x7c77('0x2a')]['fields']));_0x269050[_0x7c77('0x2f')]=_0x269050['attributes'][_0x7c77('0x30')]?_0x269050['attributes']:_0x3c8c9b['model'];_0x269050['order']=qs[_0x7c77('0x33')](_0x3ab398[_0x7c77('0x2a')][_0x7c77('0x33')]);_0x269050['where']=qs[_0x7c77('0x34')](_['pick'](_0x3ab398[_0x7c77('0x2a')],_0x3c8c9b[_0x7c77('0x34')]));if(_0x3ab398[_0x7c77('0x2a')][_0x7c77('0x35')]){_0x269050[_0x7c77('0x43')]=_['merge'](_0x269050[_0x7c77('0x43')],{'$or':_[_0x7c77('0x26')](_0x269050[_0x7c77('0x2f')],function(_0x4c0fa0){var _0x585b84={};_0x585b84[_0x4c0fa0]={'$like':'%'+_0x3ab398[_0x7c77('0x2a')][_0x7c77('0x35')]+'%'};return _0x585b84;})});}_0x269050=_[_0x7c77('0x36')]({},_0x269050,_0x3ab398['options']);return _0x3883bb['getFields'](_0x269050);}})[_0x7c77('0x21')](function(_0x50e43c){if(_0x50e43c){_0x4ce6a7=_0x50e43c[_0x7c77('0x30')];if(!_0x3ab398['query'][_0x7c77('0x44')](_0x7c77('0x31'))){_0x269050['limit']=qs[_0x7c77('0x1c')](_0x3ab398[_0x7c77('0x2a')][_0x7c77('0x1c')]);_0x269050[_0x7c77('0x19')]=qs['offset'](_0x3ab398['query'][_0x7c77('0x19')]);}return _0x3883bb[_0x7c77('0x45')](_0x269050);}})[_0x7c77('0x21')](function(_0x4bc68b){if(_0x4bc68b){return _0x4bc68b?{'count':_0x4ce6a7,'rows':_0x4bc68b}:null;}})[_0x7c77('0x21')](respondWithResult(_0xc9eba3,null))['catch'](handleError(_0xc9eba3,null));};exports[_0x7c77('0x46')]=function(_0x2e107d,_0x25f8c6,_0x3da513){var _0x3e46dc={};var _0x8a4dc2={};var _0x5eddef;var _0x1bc050;return db[_0x7c77('0x27')][_0x7c77('0x42')]({'where':{'id':_0x2e107d['params']['id']}})[_0x7c77('0x21')](handleEntityNotFound(_0x25f8c6,null))[_0x7c77('0x21')](function(_0x1dd95a){if(_0x1dd95a){_0x5eddef=_0x1dd95a;_0x8a4dc2[_0x7c77('0x2d')]=_[_0x7c77('0x2b')](db[_0x7c77('0x47')]['rawAttributes']);_0x8a4dc2[_0x7c77('0x2a')]=_[_0x7c77('0x2b')](_0x2e107d[_0x7c77('0x2a')]);_0x8a4dc2[_0x7c77('0x34')]=_[_0x7c77('0x2c')](_0x8a4dc2[_0x7c77('0x2d')],_0x8a4dc2['query']);_0x3e46dc[_0x7c77('0x2f')]=_[_0x7c77('0x2c')](_0x8a4dc2[_0x7c77('0x2d')],qs[_0x7c77('0x2e')](_0x2e107d[_0x7c77('0x2a')][_0x7c77('0x2e')]));_0x3e46dc['attributes']=_0x3e46dc['attributes'][_0x7c77('0x30')]?_0x3e46dc[_0x7c77('0x2f')]:_0x8a4dc2[_0x7c77('0x2d')];_0x3e46dc[_0x7c77('0x32')]=qs[_0x7c77('0x33')](_0x2e107d[_0x7c77('0x2a')][_0x7c77('0x33')]);_0x3e46dc[_0x7c77('0x43')]=qs['filters'](_[_0x7c77('0x48')](_0x2e107d[_0x7c77('0x2a')],_0x8a4dc2[_0x7c77('0x34')]));if(_0x2e107d['query']['filter']){_0x3e46dc['where']=_['merge'](_0x3e46dc[_0x7c77('0x43')],{'$or':_[_0x7c77('0x26')](_0x3e46dc[_0x7c77('0x2f')],function(_0x5dbd70){var _0x295805={};_0x295805[_0x5dbd70]={'$like':'%'+_0x2e107d[_0x7c77('0x2a')][_0x7c77('0x35')]+'%'};return _0x295805;})});}_0x3e46dc=_[_0x7c77('0x36')]({},_0x3e46dc,_0x2e107d['options']);return _0x5eddef['getSubjects'](_0x3e46dc);}})[_0x7c77('0x21')](function(_0x209310){if(_0x209310){_0x1bc050=_0x209310[_0x7c77('0x30')];if(!_0x2e107d[_0x7c77('0x2a')]['hasOwnProperty'](_0x7c77('0x31'))){_0x3e46dc[_0x7c77('0x1c')]=qs[_0x7c77('0x1c')](_0x2e107d[_0x7c77('0x2a')][_0x7c77('0x1c')]);_0x3e46dc['offset']=qs[_0x7c77('0x19')](_0x2e107d[_0x7c77('0x2a')]['offset']);}return _0x5eddef['getSubjects'](_0x3e46dc);}})[_0x7c77('0x21')](function(_0x576845){if(_0x576845){return _0x576845?{'count':_0x1bc050,'rows':_0x576845}:null;}})[_0x7c77('0x21')](respondWithResult(_0x25f8c6,null))['catch'](handleError(_0x25f8c6,null));};exports[_0x7c77('0x49')]=function(_0x319d15,_0x350205,_0x32d5ac){var _0x167e81={};var _0x165e87={};var _0x930cf8;var _0x1af120;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x319d15['params']['id']}})[_0x7c77('0x21')](handleEntityNotFound(_0x350205,null))[_0x7c77('0x21')](function(_0x215ea8){if(_0x215ea8){_0x930cf8=_0x215ea8;_0x165e87['model']=_['keys'](db['ZendeskField'][_0x7c77('0x28')]);_0x165e87[_0x7c77('0x2a')]=_['keys'](_0x319d15['query']);_0x165e87[_0x7c77('0x34')]=_[_0x7c77('0x2c')](_0x165e87[_0x7c77('0x2d')],_0x165e87['query']);_0x167e81[_0x7c77('0x2f')]=_[_0x7c77('0x2c')](_0x165e87[_0x7c77('0x2d')],qs[_0x7c77('0x2e')](_0x319d15['query']['fields']));_0x167e81[_0x7c77('0x2f')]=_0x167e81[_0x7c77('0x2f')][_0x7c77('0x30')]?_0x167e81[_0x7c77('0x2f')]:_0x165e87[_0x7c77('0x2d')];_0x167e81['order']=qs[_0x7c77('0x33')](_0x319d15[_0x7c77('0x2a')][_0x7c77('0x33')]);_0x167e81[_0x7c77('0x43')]=qs[_0x7c77('0x34')](_['pick'](_0x319d15[_0x7c77('0x2a')],_0x165e87[_0x7c77('0x34')]));if(_0x319d15[_0x7c77('0x2a')][_0x7c77('0x35')]){_0x167e81[_0x7c77('0x43')]=_[_0x7c77('0x36')](_0x167e81[_0x7c77('0x43')],{'$or':_[_0x7c77('0x26')](_0x167e81['attributes'],function(_0x57ca25){var _0x131899={};_0x131899[_0x57ca25]={'$like':'%'+_0x319d15[_0x7c77('0x2a')][_0x7c77('0x35')]+'%'};return _0x131899;})});}_0x167e81=_[_0x7c77('0x36')]({},_0x167e81,_0x319d15[_0x7c77('0x38')]);return _0x930cf8[_0x7c77('0x49')](_0x167e81);}})[_0x7c77('0x21')](function(_0x35ccdb){if(_0x35ccdb){_0x1af120=_0x35ccdb[_0x7c77('0x30')];if(!_0x319d15[_0x7c77('0x2a')][_0x7c77('0x44')](_0x7c77('0x31'))){_0x167e81[_0x7c77('0x1c')]=qs[_0x7c77('0x1c')](_0x319d15[_0x7c77('0x2a')][_0x7c77('0x1c')]);_0x167e81[_0x7c77('0x19')]=qs['offset'](_0x319d15[_0x7c77('0x2a')]['offset']);}return _0x930cf8[_0x7c77('0x49')](_0x167e81);}})[_0x7c77('0x21')](function(_0x5a0b94){if(_0x5a0b94){return _0x5a0b94?{'count':_0x1af120,'rows':_0x5a0b94}:null;}})['then'](respondWithResult(_0x350205,null))[_0x7c77('0x41')](handleError(_0x350205,null));};exports[_0x7c77('0x4a')]=function(_0x328310,_0x2b469b,_0x123cea){var _0x236fe1={};var _0x11a783={};var _0x42ba00;var _0x1e85b7;return db[_0x7c77('0x27')]['findOne']({'where':{'id':_0x328310[_0x7c77('0x3c')]['id']}})[_0x7c77('0x21')](handleEntityNotFound(_0x2b469b,null))[_0x7c77('0x21')](function(_0x1dd42c){if(_0x1dd42c){_0x42ba00=_0x1dd42c;_0x11a783['model']=_['keys'](db[_0x7c77('0x4b')][_0x7c77('0x28')]);_0x11a783[_0x7c77('0x2a')]=_[_0x7c77('0x2b')](_0x328310[_0x7c77('0x2a')]);_0x11a783[_0x7c77('0x34')]=_[_0x7c77('0x2c')](_0x11a783['model'],_0x11a783[_0x7c77('0x2a')]);_0x236fe1[_0x7c77('0x2f')]=_[_0x7c77('0x2c')](_0x11a783[_0x7c77('0x2d')],qs['fields'](_0x328310['query']['fields']));_0x236fe1[_0x7c77('0x2f')]=_0x236fe1['attributes'][_0x7c77('0x30')]?_0x236fe1[_0x7c77('0x2f')]:_0x11a783[_0x7c77('0x2d')];_0x236fe1[_0x7c77('0x32')]=qs[_0x7c77('0x33')](_0x328310[_0x7c77('0x2a')]['sort']);_0x236fe1[_0x7c77('0x43')]=qs[_0x7c77('0x34')](_[_0x7c77('0x48')](_0x328310[_0x7c77('0x2a')],_0x11a783[_0x7c77('0x34')]));if(_0x328310[_0x7c77('0x2a')]['filter']){_0x236fe1['where']=_[_0x7c77('0x36')](_0x236fe1[_0x7c77('0x43')],{'$or':_[_0x7c77('0x26')](_0x236fe1[_0x7c77('0x2f')],function(_0x467349){var _0x13047d={};_0x13047d[_0x467349]={'$like':'%'+_0x328310[_0x7c77('0x2a')][_0x7c77('0x35')]+'%'};return _0x13047d;})});}_0x236fe1=_[_0x7c77('0x36')]({},_0x236fe1,_0x328310[_0x7c77('0x38')]);return _0x42ba00[_0x7c77('0x4a')](_0x236fe1);}})['then'](function(_0xe365a3){if(_0xe365a3){_0x1e85b7=_0xe365a3[_0x7c77('0x30')];if(!_0x328310[_0x7c77('0x2a')][_0x7c77('0x44')](_0x7c77('0x31'))){_0x236fe1[_0x7c77('0x1c')]=qs[_0x7c77('0x1c')](_0x328310[_0x7c77('0x2a')][_0x7c77('0x1c')]);_0x236fe1[_0x7c77('0x19')]=qs[_0x7c77('0x19')](_0x328310[_0x7c77('0x2a')][_0x7c77('0x19')]);}return _0x42ba00['getTags'](_0x236fe1);}})[_0x7c77('0x21')](function(_0x350a62){if(_0x350a62){return _0x350a62?{'count':_0x1e85b7,'rows':_0x350a62}:null;}})['then'](respondWithResult(_0x2b469b,null))[_0x7c77('0x41')](handleError(_0x2b469b,null));};exports['setTags']=function(_0xd1af36,_0x59b013,_0x5b5c3b){if(_0xd1af36['body']['id']){delete _0xd1af36[_0x7c77('0x40')]['id'];}return db[_0x7c77('0x27')][_0x7c77('0x42')]({'where':{'id':_0xd1af36[_0x7c77('0x3c')]['id']}})[_0x7c77('0x21')](handleEntityNotFound(_0x59b013,null))[_0x7c77('0x21')](function(_0x46c82f){if(_0x46c82f){return _0x46c82f[_0x7c77('0x4c')](_0xd1af36['body'][_0x7c77('0x4d')]||[]);}return null;})[_0x7c77('0x21')](respondWithResult(_0x59b013,null))[_0x7c77('0x41')](handleError(_0x59b013,null));};
\ No newline at end of file
index 4a6b06f..b04881e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa30a=['path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var logger=require(_0xaa30('0x2'))('api');var moment=require(_0xaa30('0x3'));var BPromise=require(_0xaa30('0x4'));var rp=require(_0xaa30('0x5'));var fs=require('fs');var path=require(_0xaa30('0x6'));var rimraf=require(_0xaa30('0x7'));var config=require(_0xaa30('0x8'));var attributes=require(_0xaa30('0x9'));module['exports']=function(_0x347cd5,_0x4efe89){return _0x347cd5[_0xaa30('0xa')](_0xaa30('0xb'),attributes,{'tableName':_0xaa30('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xda2d=['./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger','api','moment','bluebird','../../config/environment'];(function(_0x54a47c,_0x2b7d50){var _0x530157=function(_0x2bf14a){while(--_0x2bf14a){_0x54a47c['push'](_0x54a47c['shift']());}};_0x530157(++_0x2b7d50);}(_0xda2d,0x102));var _0xdda2=function(_0x1b0c66,_0x19b780){_0x1b0c66=_0x1b0c66-0x0;var _0x2cfe98=_0xda2d[_0x1b0c66];return _0x2cfe98;};'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':[],'timestamps':!![]});};
\ No newline at end of file
index b476c8f..308da81 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3871=['result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','info'];(function(_0x2e9015,_0x1602ee){var _0x1442fe=function(_0x348cf9){while(--_0x348cf9){_0x2e9015['push'](_0x2e9015['shift']());}};_0x1442fe(++_0x1602ee);}(_0x3871,0x9a));var _0x1387=function(_0x5d02ac,_0x5d31d5){_0x5d02ac=_0x5d02ac-0x0;var _0x1e325a=_0x3871[_0x5d02ac];return _0x1e325a;};'use strict';var _=require(_0x1387('0x0'));var util=require(_0x1387('0x1'));var moment=require('moment');var BPromise=require(_0x1387('0x2'));var rs=require(_0x1387('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1387('0x4'))['db'];var utils=require(_0x1387('0x5'));var logger=require(_0x1387('0x6'))(_0x1387('0x7'));var config=require('../../config/environment');var jayson=require(_0x1387('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x49377f,_0x14795f,_0xfd0195){return new BPromise(function(_0x1a21b7,_0x1b6079){return client['request'](_0x49377f,_0xfd0195)['then'](function(_0x3d1370){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x14795f,_0x1387('0x9'));logger[_0x1387('0xa')](_0x1387('0xb'),_0x14795f,_0x1387('0x9'),JSON['stringify'](_0x3d1370));if(_0x3d1370[_0x1387('0xc')]){if(_0x3d1370[_0x1387('0xc')][_0x1387('0xd')]===0x1f4){logger[_0x1387('0xc')](_0x1387('0xe'),_0x14795f,_0x3d1370[_0x1387('0xc')][_0x1387('0xf')]);return _0x1b6079(_0x3d1370['error'][_0x1387('0xf')]);}logger[_0x1387('0xc')](_0x1387('0xe'),_0x14795f,_0x3d1370[_0x1387('0xc')]['message']);return _0x1a21b7(_0x3d1370[_0x1387('0xc')][_0x1387('0xf')]);}else{logger[_0x1387('0x10')](_0x1387('0xe'),_0x14795f,_0x1387('0x9'));_0x1a21b7(_0x3d1370[_0x1387('0x11')]['message']);}})[_0x1387('0x12')](function(_0x28c592){logger[_0x1387('0xc')](_0x1387('0xe'),_0x14795f,_0x28c592);_0x1b6079(_0x28c592);});});}
\ No newline at end of file
+var _0x0699=['debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZendeskConfiguration,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','request\x20sent'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0699,0xce));var _0x9069=function(_0x91394,_0x29fce1){_0x91394=_0x91394-0x0;var _0x5a5d8b=_0x0699[_0x91394];return _0x5a5d8b;};'use strict';var _=require(_0x9069('0x0'));var util=require(_0x9069('0x1'));var moment=require(_0x9069('0x2'));var BPromise=require(_0x9069('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9069('0x4'));var db=require(_0x9069('0x5'))['db'];var utils=require(_0x9069('0x6'));var logger=require(_0x9069('0x7'))('rpc');var config=require(_0x9069('0x8'));var jayson=require(_0x9069('0x9'));var client=jayson[_0x9069('0xa')][_0x9069('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b0d42,_0x537887,_0x29b4c7){return new BPromise(function(_0x4dc6ae,_0xe0955c){return client['request'](_0x4b0d42,_0x29b4c7)['then'](function(_0x5ea51a){logger[_0x9069('0xc')]('ZendeskConfiguration,\x20%s,\x20%s',_0x537887,_0x9069('0xd'));logger[_0x9069('0xe')](_0x9069('0xf'),_0x537887,_0x9069('0xd'),JSON[_0x9069('0x10')](_0x5ea51a));if(_0x5ea51a[_0x9069('0x11')]){if(_0x5ea51a[_0x9069('0x11')][_0x9069('0x12')]===0x1f4){logger[_0x9069('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x537887,_0x5ea51a[_0x9069('0x11')]['message']);return _0xe0955c(_0x5ea51a['error'][_0x9069('0x13')]);}logger[_0x9069('0x11')](_0x9069('0x14'),_0x537887,_0x5ea51a[_0x9069('0x11')][_0x9069('0x13')]);return _0x4dc6ae(_0x5ea51a[_0x9069('0x11')][_0x9069('0x13')]);}else{logger[_0x9069('0xc')](_0x9069('0x14'),_0x537887,_0x9069('0xd'));_0x4dc6ae(_0x5ea51a['result']['message']);}})[_0x9069('0x15')](function(_0x317091){logger[_0x9069('0x11')](_0x9069('0x14'),_0x537887,_0x317091);_0xe0955c(_0x317091);});});}
\ No newline at end of file
index 865bfe1..5125028 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd45d=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','index','/:id','isAuthenticated','show','create','put','update','exports','multer','util'];(function(_0xe58d63,_0x4bbd12){var _0x9900c6=function(_0x12d447){while(--_0x12d447){_0xe58d63['push'](_0xe58d63['shift']());}};_0x9900c6(++_0x4bbd12);}(_0xd45d,0x154));var _0xdd45=function(_0x45243a,_0x58a4fc){_0x45243a=_0x45243a-0x0;var _0x374a3e=_0xd45d[_0x45243a];return _0x374a3e;};'use strict';var multer=require(_0xdd45('0x0'));var util=require(_0xdd45('0x1'));var path=require(_0xdd45('0x2'));var timeout=require(_0xdd45('0x3'));var express=require(_0xdd45('0x4'));var router=express['Router']();var fs_extra=require(_0xdd45('0x5'));var auth=require(_0xdd45('0x6'));var interaction=require(_0xdd45('0x7'));var config=require(_0xdd45('0x8'));var controller=require(_0xdd45('0x9'));router[_0xdd45('0xa')]('/',auth['isAuthenticated'](),controller[_0xdd45('0xb')]);router[_0xdd45('0xa')](_0xdd45('0xc'),auth[_0xdd45('0xd')](),controller[_0xdd45('0xe')]);router['post']('/',auth[_0xdd45('0xd')](),controller[_0xdd45('0xf')]);router[_0xdd45('0x10')]('/:id',auth[_0xdd45('0xd')](),controller[_0xdd45('0x11')]);router['delete'](_0xdd45('0xc'),auth[_0xdd45('0xd')](),controller['destroy']);module[_0xdd45('0x12')]=router;
\ No newline at end of file
+var _0x04a4=['post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','index','/:id','isAuthenticated'];(function(_0x496e6e,_0x29527e){var _0x4cf25e=function(_0x43fd04){while(--_0x43fd04){_0x496e6e['push'](_0x496e6e['shift']());}};_0x4cf25e(++_0x29527e);}(_0x04a4,0x1cf));var _0x404a=function(_0x1cf130,_0x2135ed){_0x1cf130=_0x1cf130-0x0;var _0x1e8bd2=_0x04a4[_0x1cf130];return _0x1e8bd2;};'use strict';var multer=require(_0x404a('0x0'));var util=require(_0x404a('0x1'));var path=require('path');var timeout=require(_0x404a('0x2'));var express=require(_0x404a('0x3'));var router=express['Router']();var fs_extra=require(_0x404a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x404a('0x5'));var config=require(_0x404a('0x6'));var controller=require(_0x404a('0x7'));router[_0x404a('0x8')]('/',auth['isAuthenticated'](),controller[_0x404a('0x9')]);router[_0x404a('0x8')](_0x404a('0xa'),auth[_0x404a('0xb')](),controller['show']);router[_0x404a('0xc')]('/',auth['isAuthenticated'](),controller[_0x404a('0xd')]);router[_0x404a('0xe')](_0x404a('0xa'),auth['isAuthenticated'](),controller[_0x404a('0xf')]);router[_0x404a('0x10')](_0x404a('0xa'),auth[_0x404a('0xb')](),controller[_0x404a('0x11')]);module[_0x404a('0x12')]=router;
\ No newline at end of file
index c2eb6b1..e2e6593 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6b98=['picklist','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x33553d,_0x84dede){var _0x187c94=function(_0x3fe42f){while(--_0x3fe42f){_0x33553d['push'](_0x33553d['shift']());}};_0x187c94(++_0x84dede);}(_0x6b98,0x6f));var _0x86b9=function(_0x42508b,_0x693bd2){_0x42508b=_0x42508b-0x0;var _0x4739b6=_0x6b98[_0x42508b];return _0x4739b6;};'use strict';var Sequelize=require('sequelize');module[_0x86b9('0x0')]={'type':{'type':Sequelize[_0x86b9('0x1')](_0x86b9('0x2'),_0x86b9('0x3'),_0x86b9('0x4'),_0x86b9('0x5'),_0x86b9('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x86b9('0x7')]},'key':{'type':Sequelize[_0x86b9('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x86b9('0x2'),'variable',_0x86b9('0x4'))},'keyContent':{'type':Sequelize[_0x86b9('0x7')]},'idField':{'type':Sequelize[_0x86b9('0x7')]},'nameField':{'type':Sequelize[_0x86b9('0x7')]},'customField':{'type':Sequelize[_0x86b9('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x1808=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x123e4a,_0x337dd9){var _0x279e0a=function(_0x2aab7a){while(--_0x2aab7a){_0x123e4a['push'](_0x123e4a['shift']());}};_0x279e0a(++_0x337dd9);}(_0x1808,0x73));var _0x8180=function(_0x1c8c2f,_0x1d99fe){_0x1c8c2f=_0x1c8c2f-0x0;var _0x24fa67=_0x1808[_0x1c8c2f];return _0x24fa67;};'use strict';var Sequelize=require(_0x8180('0x0'));module[_0x8180('0x1')]={'type':{'type':Sequelize[_0x8180('0x2')](_0x8180('0x3'),_0x8180('0x4'),_0x8180('0x5'),_0x8180('0x6'),_0x8180('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0x8180('0x8')]},'key':{'type':Sequelize[_0x8180('0x8')]},'keyType':{'type':Sequelize[_0x8180('0x2')]('string','variable',_0x8180('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x8180('0x8')]},'nameField':{'type':Sequelize[_0x8180('0x8')]},'customField':{'type':Sequelize[_0x8180('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8180('0x8')]}};
\ No newline at end of file
index 9bfa38d..48727ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd377=['save','update','then','destroy','error','stack','name','map','ZendeskField','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','show','includeAll','find','catch','create','body','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range'];(function(_0x1eb9b5,_0x5b8629){var _0x1cde4c=function(_0x48e6fc){while(--_0x48e6fc){_0x1eb9b5['push'](_0x1eb9b5['shift']());}};_0x1cde4c(++_0x5b8629);}(_0xd377,0x1a3));var _0x7d37=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xd377[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7d37('0x0'));var zipdir=require(_0x7d37('0x1'));var jsonpatch=require(_0x7d37('0x2'));var rp=require(_0x7d37('0x3'));var moment=require(_0x7d37('0x4'));var BPromise=require(_0x7d37('0x5'));var Mustache=require(_0x7d37('0x6'));var util=require(_0x7d37('0x7'));var path=require(_0x7d37('0x8'));var sox=require(_0x7d37('0x9'));var csv=require(_0x7d37('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7d37('0xb'));var _=require(_0x7d37('0xc'));var squel=require(_0x7d37('0xd'));var crypto=require(_0x7d37('0xe'));var jsforce=require(_0x7d37('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7d37('0x10'));var Redis=require(_0x7d37('0x11'));var authService=require(_0x7d37('0x12'));var qs=require(_0x7d37('0x13'));var as=require(_0x7d37('0x14'));var hardwareService=require(_0x7d37('0x15'));var logger=require(_0x7d37('0x16'))(_0x7d37('0x17'));var utils=require('../../config/utils');var config=require(_0x7d37('0x18'));var licenseUtil=require(_0x7d37('0x19'));var db=require(_0x7d37('0x1a'))['db'];function respondWithStatusCode(_0x55996f,_0x3832c4){_0x3832c4=_0x3832c4||0xcc;return function(_0x5b064f){if(_0x5b064f){return _0x55996f[_0x7d37('0x1b')](_0x3832c4);}return _0x55996f[_0x7d37('0x1c')](_0x3832c4)[_0x7d37('0x1d')]();};}function respondWithResult(_0x31de3f,_0x3a0d0d){_0x3a0d0d=_0x3a0d0d||0xc8;return function(_0x468199){if(_0x468199){return _0x31de3f[_0x7d37('0x1c')](_0x3a0d0d)[_0x7d37('0x1e')](_0x468199);}};}function respondWithFilteredResult(_0x530ce1,_0x33485f){return function(_0x5a9812){if(_0x5a9812){var _0x580933=typeof _0x33485f['offset']===_0x7d37('0x1f')&&typeof _0x33485f[_0x7d37('0x20')]==='undefined';var _0x4f3eb4=_0x5a9812[_0x7d37('0x21')];var _0x1e9e65=_0x580933?0x0:_0x33485f[_0x7d37('0x22')];var _0x5db8a6=_0x580933?_0x5a9812['count']:_0x33485f['offset']+_0x33485f[_0x7d37('0x20')];var _0x441ad0;if(_0x5db8a6>=_0x4f3eb4){_0x5db8a6=_0x4f3eb4;_0x441ad0=0xc8;}else{_0x441ad0=0xce;}_0x530ce1['status'](_0x441ad0);return _0x530ce1[_0x7d37('0x23')](_0x7d37('0x24'),_0x1e9e65+'-'+_0x5db8a6+'/'+_0x4f3eb4)[_0x7d37('0x1e')](_0x5a9812);}return null;};}function patchUpdates(_0x7c1489){return function(_0x43f969){try{jsonpatch['apply'](_0x43f969,_0x7c1489,!![]);}catch(_0x47105c){return BPromise['reject'](_0x47105c);}return _0x43f969[_0x7d37('0x25')]();};}function saveUpdates(_0x4cda1f,_0x260da7){return function(_0x25d8d2){if(_0x25d8d2){return _0x25d8d2[_0x7d37('0x26')](_0x4cda1f)[_0x7d37('0x27')](function(_0x256738){return _0x256738;});}return null;};}function removeEntity(_0x560f81,_0x307e69){return function(_0x2d6b6c){if(_0x2d6b6c){return _0x2d6b6c[_0x7d37('0x28')]()[_0x7d37('0x27')](function(){_0x560f81[_0x7d37('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x502397,_0x51e1a3){return function(_0x133852){if(!_0x133852){_0x502397[_0x7d37('0x1b')](0x194);}return _0x133852;};}function handleError(_0x828209,_0x40fe3c){_0x40fe3c=_0x40fe3c||0x1f4;return function(_0x23bdb0){logger[_0x7d37('0x29')](_0x23bdb0[_0x7d37('0x2a')]);if(_0x23bdb0[_0x7d37('0x2b')]){delete _0x23bdb0[_0x7d37('0x2b')];}_0x828209['status'](_0x40fe3c)['send'](_0x23bdb0);};}exports['index']=function(_0x53d7b6,_0x364eab){var _0x21d4e0={},_0x483822={},_0x34b113={'count':0x0,'rows':[]};var _0x370aae=_[_0x7d37('0x2c')](db[_0x7d37('0x2d')][_0x7d37('0x2e')],function(_0x4ee38d){return{'name':_0x4ee38d['fieldName'],'type':_0x4ee38d[_0x7d37('0x2f')][_0x7d37('0x30')]};});_0x483822[_0x7d37('0x31')]=_['map'](_0x370aae,_0x7d37('0x2b'));_0x483822[_0x7d37('0x32')]=_[_0x7d37('0x33')](_0x53d7b6['query']);_0x483822[_0x7d37('0x34')]=_[_0x7d37('0x35')](_0x483822[_0x7d37('0x31')],_0x483822[_0x7d37('0x32')]);_0x21d4e0['attributes']=_[_0x7d37('0x35')](_0x483822['model'],qs['fields'](_0x53d7b6['query'][_0x7d37('0x36')]));_0x21d4e0[_0x7d37('0x37')]=_0x21d4e0[_0x7d37('0x37')][_0x7d37('0x38')]?_0x21d4e0[_0x7d37('0x37')]:_0x483822['model'];if(!_0x53d7b6['query'][_0x7d37('0x39')](_0x7d37('0x3a'))){_0x21d4e0[_0x7d37('0x20')]=qs[_0x7d37('0x20')](_0x53d7b6[_0x7d37('0x32')]['limit']);_0x21d4e0['offset']=qs[_0x7d37('0x22')](_0x53d7b6[_0x7d37('0x32')][_0x7d37('0x22')]);}_0x21d4e0[_0x7d37('0x3b')]=qs['sort'](_0x53d7b6[_0x7d37('0x32')][_0x7d37('0x3c')]);_0x21d4e0[_0x7d37('0x3d')]=qs['filters'](_['pick'](_0x53d7b6['query'],_0x483822[_0x7d37('0x34')]),_0x370aae);if(_0x53d7b6[_0x7d37('0x32')][_0x7d37('0x3e')]){_0x21d4e0[_0x7d37('0x3d')]=_[_0x7d37('0x3f')](_0x21d4e0[_0x7d37('0x3d')],{'$or':_['map'](_0x370aae,function(_0x44c71f){if(_0x44c71f[_0x7d37('0x2f')]!==_0x7d37('0x40')){var _0x4dbe7f={};_0x4dbe7f[_0x44c71f[_0x7d37('0x2b')]]={'$like':'%'+_0x53d7b6['query'][_0x7d37('0x3e')]+'%'};return _0x4dbe7f;}})});}_0x21d4e0=_[_0x7d37('0x3f')]({},_0x21d4e0,_0x53d7b6[_0x7d37('0x41')]);var _0x144ce0={'where':_0x21d4e0[_0x7d37('0x3d')]};return db[_0x7d37('0x2d')][_0x7d37('0x21')](_0x144ce0)['then'](function(_0x4e4051){_0x34b113[_0x7d37('0x21')]=_0x4e4051;if(_0x53d7b6[_0x7d37('0x32')]['includeAll']){_0x21d4e0[_0x7d37('0x42')]=[{'all':!![]}];}return db['ZendeskField'][_0x7d37('0x43')](_0x21d4e0);})[_0x7d37('0x27')](function(_0x2f5173){_0x34b113[_0x7d37('0x44')]=_0x2f5173;return _0x34b113;})['then'](respondWithFilteredResult(_0x364eab,_0x21d4e0))['catch'](handleError(_0x364eab,null));};exports[_0x7d37('0x45')]=function(_0x40a022,_0x23fa31){var _0x213d7c={'raw':!![],'where':{'id':_0x40a022['params']['id']}},_0x57cbc5={};_0x57cbc5[_0x7d37('0x31')]=_[_0x7d37('0x33')](db[_0x7d37('0x2d')]['rawAttributes']);_0x57cbc5[_0x7d37('0x32')]=_['keys'](_0x40a022[_0x7d37('0x32')]);_0x57cbc5['filters']=_[_0x7d37('0x35')](_0x57cbc5['model'],_0x57cbc5['query']);_0x213d7c[_0x7d37('0x37')]=_['intersection'](_0x57cbc5[_0x7d37('0x31')],qs[_0x7d37('0x36')](_0x40a022[_0x7d37('0x32')]['fields']));_0x213d7c[_0x7d37('0x37')]=_0x213d7c[_0x7d37('0x37')][_0x7d37('0x38')]?_0x213d7c[_0x7d37('0x37')]:_0x57cbc5['model'];if(_0x40a022[_0x7d37('0x32')][_0x7d37('0x46')]){_0x213d7c[_0x7d37('0x42')]=[{'all':!![]}];}_0x213d7c=_[_0x7d37('0x3f')]({},_0x213d7c,_0x40a022[_0x7d37('0x41')]);return db['ZendeskField'][_0x7d37('0x47')](_0x213d7c)[_0x7d37('0x27')](handleEntityNotFound(_0x23fa31,null))[_0x7d37('0x27')](respondWithResult(_0x23fa31,null))[_0x7d37('0x48')](handleError(_0x23fa31,null));};exports[_0x7d37('0x49')]=function(_0x1e25df,_0x101544){return db[_0x7d37('0x2d')]['create'](_0x1e25df[_0x7d37('0x4a')],{})[_0x7d37('0x27')](respondWithResult(_0x101544,0xc9))[_0x7d37('0x48')](handleError(_0x101544,null));};exports['update']=function(_0x5f0423,_0x8d3fdd){if(_0x5f0423[_0x7d37('0x4a')]['id']){delete _0x5f0423[_0x7d37('0x4a')]['id'];}return db[_0x7d37('0x2d')][_0x7d37('0x47')]({'where':{'id':_0x5f0423[_0x7d37('0x4b')]['id']}})[_0x7d37('0x27')](handleEntityNotFound(_0x8d3fdd,null))[_0x7d37('0x27')](saveUpdates(_0x5f0423['body'],null))[_0x7d37('0x27')](respondWithResult(_0x8d3fdd,null))['catch'](handleError(_0x8d3fdd,null));};exports[_0x7d37('0x28')]=function(_0x1f310b,_0x172a38){return db[_0x7d37('0x2d')][_0x7d37('0x47')]({'where':{'id':_0x1f310b[_0x7d37('0x4b')]['id']}})['then'](handleEntityNotFound(_0x172a38,null))[_0x7d37('0x27')](removeEntity(_0x172a38,null))['catch'](handleError(_0x172a38,null));};
\ No newline at end of file
+var _0xb2e3=['findAll','rows','catch','show','params','length','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','ZendeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0x320112,_0x5f10ae){var _0x353564=function(_0x4ef01a){while(--_0x4ef01a){_0x320112['push'](_0x320112['shift']());}};_0x353564(++_0x5f10ae);}(_0xb2e3,0xf9));var _0x3b2e=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xb2e3[_0xdea41a];return _0x15d0d8;};'use strict';var emlformat=require(_0x3b2e('0x0'));var rimraf=require(_0x3b2e('0x1'));var zipdir=require(_0x3b2e('0x2'));var jsonpatch=require(_0x3b2e('0x3'));var rp=require(_0x3b2e('0x4'));var moment=require(_0x3b2e('0x5'));var BPromise=require(_0x3b2e('0x6'));var Mustache=require('mustache');var util=require(_0x3b2e('0x7'));var path=require(_0x3b2e('0x8'));var sox=require(_0x3b2e('0x9'));var csv=require(_0x3b2e('0xa'));var ejs=require(_0x3b2e('0xb'));var fs=require('fs');var fs_extra=require(_0x3b2e('0xc'));var _=require('lodash');var squel=require(_0x3b2e('0xd'));var crypto=require(_0x3b2e('0xe'));var jsforce=require(_0x3b2e('0xf'));var deskjs=require(_0x3b2e('0x10'));var toCsv=require(_0x3b2e('0xa'));var querystring=require(_0x3b2e('0x11'));var Papa=require(_0x3b2e('0x12'));var Redis=require('ioredis');var authService=require(_0x3b2e('0x13'));var qs=require(_0x3b2e('0x14'));var as=require(_0x3b2e('0x15'));var hardwareService=require(_0x3b2e('0x16'));var logger=require(_0x3b2e('0x17'))(_0x3b2e('0x18'));var utils=require(_0x3b2e('0x19'));var config=require(_0x3b2e('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x3b2e('0x1b'))['db'];function respondWithStatusCode(_0x45506a,_0x20eae6){_0x20eae6=_0x20eae6||0xcc;return function(_0x455790){if(_0x455790){return _0x45506a[_0x3b2e('0x1c')](_0x20eae6);}return _0x45506a[_0x3b2e('0x1d')](_0x20eae6)['end']();};}function respondWithResult(_0x3bb5a5,_0x46da44){_0x46da44=_0x46da44||0xc8;return function(_0x3c786a){if(_0x3c786a){return _0x3bb5a5['status'](_0x46da44)[_0x3b2e('0x1e')](_0x3c786a);}};}function respondWithFilteredResult(_0x467925,_0x256658){return function(_0x488593){if(_0x488593){var _0x11f813=typeof _0x256658[_0x3b2e('0x1f')]===_0x3b2e('0x20')&&typeof _0x256658['limit']===_0x3b2e('0x20');var _0x24de50=_0x488593['count'];var _0x5ca7fd=_0x11f813?0x0:_0x256658['offset'];var _0x1e3778=_0x11f813?_0x488593[_0x3b2e('0x21')]:_0x256658['offset']+_0x256658[_0x3b2e('0x22')];var _0x5b2ebe;if(_0x1e3778>=_0x24de50){_0x1e3778=_0x24de50;_0x5b2ebe=0xc8;}else{_0x5b2ebe=0xce;}_0x467925[_0x3b2e('0x1d')](_0x5b2ebe);return _0x467925[_0x3b2e('0x23')](_0x3b2e('0x24'),_0x5ca7fd+'-'+_0x1e3778+'/'+_0x24de50)[_0x3b2e('0x1e')](_0x488593);}return null;};}function patchUpdates(_0x2aaf28){return function(_0x347f1d){try{jsonpatch[_0x3b2e('0x25')](_0x347f1d,_0x2aaf28,!![]);}catch(_0x23bfc4){return BPromise['reject'](_0x23bfc4);}return _0x347f1d[_0x3b2e('0x26')]();};}function saveUpdates(_0x48e561,_0x1e4299){return function(_0x216441){if(_0x216441){return _0x216441[_0x3b2e('0x27')](_0x48e561)['then'](function(_0x1f0d91){return _0x1f0d91;});}return null;};}function removeEntity(_0x1ee3ea,_0x3714b3){return function(_0x356f67){if(_0x356f67){return _0x356f67[_0x3b2e('0x28')]()[_0x3b2e('0x29')](function(){_0x1ee3ea[_0x3b2e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x468010,_0x57d3ad){return function(_0x346e23){if(!_0x346e23){_0x468010['sendStatus'](0x194);}return _0x346e23;};}function handleError(_0x130ed1,_0xbbe540){_0xbbe540=_0xbbe540||0x1f4;return function(_0x2c1d27){logger[_0x3b2e('0x2a')](_0x2c1d27[_0x3b2e('0x2b')]);if(_0x2c1d27[_0x3b2e('0x2c')]){delete _0x2c1d27[_0x3b2e('0x2c')];}_0x130ed1[_0x3b2e('0x1d')](_0xbbe540)[_0x3b2e('0x2d')](_0x2c1d27);};}exports[_0x3b2e('0x2e')]=function(_0x3aeea4,_0x353b8a){var _0x29920c={},_0xd94722={},_0x4cdc90={'count':0x0,'rows':[]};var _0x40c5e0=_[_0x3b2e('0x2f')](db[_0x3b2e('0x30')][_0x3b2e('0x31')],function(_0x25e69c){return{'name':_0x25e69c[_0x3b2e('0x32')],'type':_0x25e69c[_0x3b2e('0x33')][_0x3b2e('0x34')]};});_0xd94722[_0x3b2e('0x35')]=_[_0x3b2e('0x2f')](_0x40c5e0,_0x3b2e('0x2c'));_0xd94722[_0x3b2e('0x36')]=_[_0x3b2e('0x37')](_0x3aeea4['query']);_0xd94722[_0x3b2e('0x38')]=_[_0x3b2e('0x39')](_0xd94722[_0x3b2e('0x35')],_0xd94722[_0x3b2e('0x36')]);_0x29920c[_0x3b2e('0x3a')]=_[_0x3b2e('0x39')](_0xd94722[_0x3b2e('0x35')],qs[_0x3b2e('0x3b')](_0x3aeea4[_0x3b2e('0x36')][_0x3b2e('0x3b')]));_0x29920c[_0x3b2e('0x3a')]=_0x29920c[_0x3b2e('0x3a')]['length']?_0x29920c['attributes']:_0xd94722[_0x3b2e('0x35')];if(!_0x3aeea4[_0x3b2e('0x36')][_0x3b2e('0x3c')](_0x3b2e('0x3d'))){_0x29920c['limit']=qs['limit'](_0x3aeea4['query'][_0x3b2e('0x22')]);_0x29920c[_0x3b2e('0x1f')]=qs[_0x3b2e('0x1f')](_0x3aeea4['query'][_0x3b2e('0x1f')]);}_0x29920c[_0x3b2e('0x3e')]=qs[_0x3b2e('0x3f')](_0x3aeea4['query'][_0x3b2e('0x3f')]);_0x29920c[_0x3b2e('0x40')]=qs[_0x3b2e('0x38')](_[_0x3b2e('0x41')](_0x3aeea4['query'],_0xd94722[_0x3b2e('0x38')]),_0x40c5e0);if(_0x3aeea4[_0x3b2e('0x36')]['filter']){_0x29920c['where']=_['merge'](_0x29920c[_0x3b2e('0x40')],{'$or':_[_0x3b2e('0x2f')](_0x40c5e0,function(_0x479296){if(_0x479296[_0x3b2e('0x33')]!=='VIRTUAL'){var _0x421290={};_0x421290[_0x479296['name']]={'$like':'%'+_0x3aeea4[_0x3b2e('0x36')][_0x3b2e('0x42')]+'%'};return _0x421290;}})});}_0x29920c=_[_0x3b2e('0x43')]({},_0x29920c,_0x3aeea4[_0x3b2e('0x44')]);var _0x2c11b0={'where':_0x29920c[_0x3b2e('0x40')]};return db['ZendeskField'][_0x3b2e('0x21')](_0x2c11b0)[_0x3b2e('0x29')](function(_0x194609){_0x4cdc90[_0x3b2e('0x21')]=_0x194609;if(_0x3aeea4[_0x3b2e('0x36')][_0x3b2e('0x45')]){_0x29920c[_0x3b2e('0x46')]=[{'all':!![]}];}return db[_0x3b2e('0x30')][_0x3b2e('0x47')](_0x29920c);})[_0x3b2e('0x29')](function(_0x5356fd){_0x4cdc90[_0x3b2e('0x48')]=_0x5356fd;return _0x4cdc90;})['then'](respondWithFilteredResult(_0x353b8a,_0x29920c))[_0x3b2e('0x49')](handleError(_0x353b8a,null));};exports[_0x3b2e('0x4a')]=function(_0x3c44de,_0x35549c){var _0x1d0388={'raw':!![],'where':{'id':_0x3c44de[_0x3b2e('0x4b')]['id']}},_0x1c3f51={};_0x1c3f51['model']=_[_0x3b2e('0x37')](db[_0x3b2e('0x30')][_0x3b2e('0x31')]);_0x1c3f51[_0x3b2e('0x36')]=_[_0x3b2e('0x37')](_0x3c44de[_0x3b2e('0x36')]);_0x1c3f51['filters']=_[_0x3b2e('0x39')](_0x1c3f51[_0x3b2e('0x35')],_0x1c3f51[_0x3b2e('0x36')]);_0x1d0388[_0x3b2e('0x3a')]=_[_0x3b2e('0x39')](_0x1c3f51['model'],qs[_0x3b2e('0x3b')](_0x3c44de[_0x3b2e('0x36')]['fields']));_0x1d0388[_0x3b2e('0x3a')]=_0x1d0388[_0x3b2e('0x3a')][_0x3b2e('0x4c')]?_0x1d0388[_0x3b2e('0x3a')]:_0x1c3f51[_0x3b2e('0x35')];if(_0x3c44de['query']['includeAll']){_0x1d0388[_0x3b2e('0x46')]=[{'all':!![]}];}_0x1d0388=_[_0x3b2e('0x43')]({},_0x1d0388,_0x3c44de['options']);return db[_0x3b2e('0x30')][_0x3b2e('0x4d')](_0x1d0388)[_0x3b2e('0x29')](handleEntityNotFound(_0x35549c,null))[_0x3b2e('0x29')](respondWithResult(_0x35549c,null))[_0x3b2e('0x49')](handleError(_0x35549c,null));};exports[_0x3b2e('0x4e')]=function(_0x12f550,_0x2f256e){return db['ZendeskField'][_0x3b2e('0x4e')](_0x12f550[_0x3b2e('0x4f')],{})['then'](respondWithResult(_0x2f256e,0xc9))['catch'](handleError(_0x2f256e,null));};exports[_0x3b2e('0x27')]=function(_0x5de99f,_0x42a43b){if(_0x5de99f[_0x3b2e('0x4f')]['id']){delete _0x5de99f[_0x3b2e('0x4f')]['id'];}return db[_0x3b2e('0x30')][_0x3b2e('0x4d')]({'where':{'id':_0x5de99f[_0x3b2e('0x4b')]['id']}})[_0x3b2e('0x29')](handleEntityNotFound(_0x42a43b,null))[_0x3b2e('0x29')](saveUpdates(_0x5de99f[_0x3b2e('0x4f')],null))['then'](respondWithResult(_0x42a43b,null))['catch'](handleError(_0x42a43b,null));};exports[_0x3b2e('0x28')]=function(_0x15e2d1,_0x417274){return db[_0x3b2e('0x30')][_0x3b2e('0x4d')]({'where':{'id':_0x15e2d1[_0x3b2e('0x4b')]['id']}})[_0x3b2e('0x29')](handleEntityNotFound(_0x417274,null))[_0x3b2e('0x29')](removeEntity(_0x417274,null))[_0x3b2e('0x49')](handleError(_0x417274,null));};
\ No newline at end of file
index 861da07..a37f9c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5278=['FieldId','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','zendesk_unique_index','idField'];(function(_0x404307,_0x57c281){var _0x2b558c=function(_0x491407){while(--_0x491407){_0x404307['push'](_0x404307['shift']());}};_0x2b558c(++_0x57c281);}(_0x5278,0x105));var _0x8527=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x5278[_0x1d1779];return _0x2377e9;};'use strict';var _=require(_0x8527('0x0'));var util=require(_0x8527('0x1'));var logger=require('../../config/logger')(_0x8527('0x2'));var moment=require(_0x8527('0x3'));var BPromise=require(_0x8527('0x4'));var rp=require(_0x8527('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8527('0x6'));var config=require(_0x8527('0x7'));var attributes=require('./intZendeskField.attributes');module[_0x8527('0x8')]=function(_0x15f074,_0x63e893){return _0x15f074[_0x8527('0x9')]('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':_0x8527('0xa'),'fields':[_0x8527('0xb'),_0x8527('0xc')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5d13=['../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5d13,0x1b9));var _0x35d1=function(_0x38042d,_0x477a8b){_0x38042d=_0x38042d-0x0;var _0x5e64eb=_0x5d13[_0x38042d];return _0x5e64eb;};'use strict';var _=require(_0x35d1('0x0'));var util=require(_0x35d1('0x1'));var logger=require(_0x35d1('0x2'))(_0x35d1('0x3'));var moment=require(_0x35d1('0x4'));var BPromise=require(_0x35d1('0x5'));var rp=require(_0x35d1('0x6'));var fs=require('fs');var path=require(_0x35d1('0x7'));var rimraf=require(_0x35d1('0x8'));var config=require(_0x35d1('0x9'));var attributes=require(_0x35d1('0xa'));module[_0x35d1('0xb')]=function(_0x5a8366,_0x35dc2b){return _0x5a8366[_0x35d1('0xc')](_0x35d1('0xd'),attributes,{'tableName':_0x35d1('0xe'),'paranoid':![],'indexes':[{'name':_0x35d1('0xf'),'fields':[_0x35d1('0x10'),_0x35d1('0x11')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index 05aebce..35d73fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e19=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','stringify','error','ZendeskField,\x20%s,\x20%s','message','lodash','util'];(function(_0x303fd7,_0x3697e8){var _0x5a0cae=function(_0x3dde58){while(--_0x3dde58){_0x303fd7['push'](_0x303fd7['shift']());}};_0x5a0cae(++_0x3697e8);}(_0x1e19,0x1de));var _0x91e1=function(_0x1d930e,_0x20d8b8){_0x1d930e=_0x1d930e-0x0;var _0x5bbd66=_0x1e19[_0x1d930e];return _0x5bbd66;};'use strict';var _=require(_0x91e1('0x0'));var util=require(_0x91e1('0x1'));var moment=require('moment');var BPromise=require(_0x91e1('0x2'));var rs=require(_0x91e1('0x3'));var fs=require('fs');var Redis=require(_0x91e1('0x4'));var db=require(_0x91e1('0x5'))['db'];var utils=require(_0x91e1('0x6'));var logger=require(_0x91e1('0x7'))(_0x91e1('0x8'));var config=require(_0x91e1('0x9'));var jayson=require(_0x91e1('0xa'));var client=jayson[_0x91e1('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53d825,_0x44c9b9,_0x2732c6){return new BPromise(function(_0x3bdc91,_0x52d637){return client[_0x91e1('0xc')](_0x53d825,_0x2732c6)['then'](function(_0x5b36b2){logger[_0x91e1('0xd')]('ZendeskField,\x20%s,\x20%s',_0x44c9b9,_0x91e1('0xe'));logger[_0x91e1('0xf')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x44c9b9,_0x91e1('0xe'),JSON[_0x91e1('0x10')](_0x5b36b2));if(_0x5b36b2['error']){if(_0x5b36b2['error']['code']===0x1f4){logger[_0x91e1('0x11')](_0x91e1('0x12'),_0x44c9b9,_0x5b36b2['error'][_0x91e1('0x13')]);return _0x52d637(_0x5b36b2[_0x91e1('0x11')]['message']);}logger[_0x91e1('0x11')]('ZendeskField,\x20%s,\x20%s',_0x44c9b9,_0x5b36b2['error'][_0x91e1('0x13')]);return _0x3bdc91(_0x5b36b2[_0x91e1('0x11')][_0x91e1('0x13')]);}else{logger[_0x91e1('0xd')](_0x91e1('0x12'),_0x44c9b9,'request\x20sent');_0x3bdc91(_0x5b36b2['result'][_0x91e1('0x13')]);}})['catch'](function(_0x26f7eb){logger[_0x91e1('0x11')]('ZendeskField,\x20%s,\x20%s',_0x44c9b9,_0x26f7eb);_0x52d637(_0x26f7eb);});});}
\ No newline at end of file
+var _0xe9ef=['stringify','error','code','ZendeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xe9ef,0x1a9));var _0xfe9e=function(_0x22f85a,_0x195ed5){_0x22f85a=_0x22f85a-0x0;var _0xaa717=_0xe9ef[_0x22f85a];return _0xaa717;};'use strict';var _=require(_0xfe9e('0x0'));var util=require(_0xfe9e('0x1'));var moment=require(_0xfe9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe9e('0x3'));var db=require(_0xfe9e('0x4'))['db'];var utils=require(_0xfe9e('0x5'));var logger=require(_0xfe9e('0x6'))(_0xfe9e('0x7'));var config=require(_0xfe9e('0x8'));var jayson=require(_0xfe9e('0x9'));var client=jayson[_0xfe9e('0xa')][_0xfe9e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c3fd5,_0x4eb68b,_0x5608c2){return new BPromise(function(_0x238f8b,_0xa859e3){return client['request'](_0x4c3fd5,_0x5608c2)['then'](function(_0x5b1b60){logger[_0xfe9e('0xc')]('ZendeskField,\x20%s,\x20%s',_0x4eb68b,_0xfe9e('0xd'));logger[_0xfe9e('0xe')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x4eb68b,_0xfe9e('0xd'),JSON[_0xfe9e('0xf')](_0x5b1b60));if(_0x5b1b60['error']){if(_0x5b1b60[_0xfe9e('0x10')][_0xfe9e('0x11')]===0x1f4){logger[_0xfe9e('0x10')]('ZendeskField,\x20%s,\x20%s',_0x4eb68b,_0x5b1b60[_0xfe9e('0x10')]['message']);return _0xa859e3(_0x5b1b60[_0xfe9e('0x10')]['message']);}logger['error'](_0xfe9e('0x12'),_0x4eb68b,_0x5b1b60[_0xfe9e('0x10')][_0xfe9e('0x13')]);return _0x238f8b(_0x5b1b60[_0xfe9e('0x10')][_0xfe9e('0x13')]);}else{logger[_0xfe9e('0xc')]('ZendeskField,\x20%s,\x20%s',_0x4eb68b,'request\x20sent');_0x238f8b(_0x5b1b60[_0xfe9e('0x14')][_0xfe9e('0x13')]);}})[_0xfe9e('0x15')](function(_0x512923){logger[_0xfe9e('0x10')](_0xfe9e('0x12'),_0x4eb68b,_0x512923);_0xa859e3(_0x512923);});});}
\ No newline at end of file
index 5316826..faf50d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8be5=['put','/:id','update','delete','exports','multer','util','connect-timeout','express','../../config/environment','get','isAuthenticated','show','/:id/configurations','getConfigurations','post','create','addConfiguration'];(function(_0xd8d167,_0x58d76b){var _0x12c50c=function(_0x253f17){while(--_0x253f17){_0xd8d167['push'](_0xd8d167['shift']());}};_0x12c50c(++_0x58d76b);}(_0x8be5,0x191));var _0x58be=function(_0x101aea,_0x8d805d){_0x101aea=_0x101aea-0x0;var _0x5280e9=_0x8be5[_0x101aea];return _0x5280e9;};'use strict';var multer=require(_0x58be('0x0'));var util=require(_0x58be('0x1'));var path=require('path');var timeout=require(_0x58be('0x2'));var express=require(_0x58be('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x58be('0x4'));var controller=require('./intZohoAccount.controller');router[_0x58be('0x5')]('/',auth[_0x58be('0x6')](),controller['index']);router[_0x58be('0x5')]('/:id',auth[_0x58be('0x6')](),controller[_0x58be('0x7')]);router[_0x58be('0x5')](_0x58be('0x8'),auth[_0x58be('0x6')](),controller[_0x58be('0x9')]);router[_0x58be('0x5')]('/:id/fields',auth[_0x58be('0x6')](),controller['getFields']);router[_0x58be('0xa')]('/',auth[_0x58be('0x6')](),controller[_0x58be('0xb')]);router[_0x58be('0xa')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x58be('0xc')]);router[_0x58be('0xd')](_0x58be('0xe'),auth[_0x58be('0x6')](),controller[_0x58be('0xf')]);router[_0x58be('0x10')](_0x58be('0xe'),auth[_0x58be('0x6')](),controller['destroy']);module[_0x58be('0x11')]=router;
\ No newline at end of file
+var _0x9e71=['create','addConfiguration','update','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intZohoAccount.controller','get','index','/:id','getConfigurations','/:id/fields','getFields','post','isAuthenticated'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x9e71,0x1a8));var _0x19e7=function(_0x4f4f43,_0x3818f5){_0x4f4f43=_0x4f4f43-0x0;var _0xfdf741=_0x9e71[_0x4f4f43];return _0xfdf741;};'use strict';var multer=require(_0x19e7('0x0'));var util=require(_0x19e7('0x1'));var path=require('path');var timeout=require(_0x19e7('0x2'));var express=require(_0x19e7('0x3'));var router=express[_0x19e7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x19e7('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x19e7('0x6'));var controller=require(_0x19e7('0x7'));router[_0x19e7('0x8')]('/',auth['isAuthenticated'](),controller[_0x19e7('0x9')]);router[_0x19e7('0x8')](_0x19e7('0xa'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/configurations',auth['isAuthenticated'](),controller[_0x19e7('0xb')]);router['get'](_0x19e7('0xc'),auth['isAuthenticated'](),controller[_0x19e7('0xd')]);router[_0x19e7('0xe')]('/',auth[_0x19e7('0xf')](),controller[_0x19e7('0x10')]);router[_0x19e7('0xe')]('/:id/configurations',auth[_0x19e7('0xf')](),controller[_0x19e7('0x11')]);router['put'](_0x19e7('0xa'),auth[_0x19e7('0xf')](),controller[_0x19e7('0x12')]);router['delete'](_0x19e7('0xa'),auth['isAuthenticated'](),controller[_0x19e7('0x13')]);module['exports']=router;
\ No newline at end of file
index 312c83a..c3b0650 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41bb=['exports','STRING','sequelize'];(function(_0x3df3c6,_0x496e1a){var _0x254c43=function(_0x371daa){while(--_0x371daa){_0x3df3c6['push'](_0x3df3c6['shift']());}};_0x254c43(++_0x496e1a);}(_0x41bb,0xc5));var _0xb41b=function(_0x165545,_0x46467e){_0x165545=_0x165545-0x0;var _0x5cf0b7=_0x41bb[_0x165545];return _0x5cf0b7;};'use strict';var Sequelize=require(_0xb41b('0x0'));module[_0xb41b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb41b('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xb41b('0x2')]},'clientId':{'type':Sequelize[_0xb41b('0x2')]},'clientSecret':{'type':Sequelize[_0xb41b('0x2')]},'serverUrl':{'type':Sequelize[_0xb41b('0x2')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xb41b('0x2')]}};
\ No newline at end of file
+var _0x4bc3=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4bc3,0x16e));var _0x34bc=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x4bc3[_0x255d5b];return _0x3e141a;};'use strict';var Sequelize=require(_0x34bc('0x0'));module[_0x34bc('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x34bc('0x2')]},'host':{'type':Sequelize[_0x34bc('0x2')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x34bc('0x2')]},'clientSecret':{'type':Sequelize[_0x34bc('0x2')]},'serverUrl':{'type':Sequelize[_0x34bc('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x34bc('0x2')]},'refreshToken':{'type':Sequelize[_0x34bc('0x2')]}};
\ No newline at end of file
index 81856a1..a692d7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc960=['custom_field','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','ZohoAccount','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','create','body','find','params','getConfigurations','ZohoConfiguration','nolimit','addConfiguration','findOne','AccountId','Subjects','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','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','serverUrl','host','zoho.eu','com','slice','substring','lastIndexOf','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label'];(function(_0x2103dd,_0x2cb8f6){var _0x457cf6=function(_0x1f9738){while(--_0x1f9738){_0x2103dd['push'](_0x2103dd['shift']());}};_0x457cf6(++_0x2cb8f6);}(_0xc960,0x8d));var _0x0c96=function(_0x29bc89,_0x424c24){_0x29bc89=_0x29bc89-0x0;var _0x3d6b79=_0xc960[_0x29bc89];return _0x3d6b79;};'use strict';var emlformat=require(_0x0c96('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0c96('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0c96('0x2'));var moment=require(_0x0c96('0x3'));var BPromise=require(_0x0c96('0x4'));var Mustache=require(_0x0c96('0x5'));var util=require(_0x0c96('0x6'));var path=require(_0x0c96('0x7'));var sox=require(_0x0c96('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0c96('0x9'));var squel=require(_0x0c96('0xa'));var crypto=require('crypto');var jsforce=require(_0x0c96('0xb'));var deskjs=require(_0x0c96('0xc'));var toCsv=require('to-csv');var querystring=require(_0x0c96('0xd'));var Papa=require(_0x0c96('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0c96('0xf'));var as=require(_0x0c96('0x10'));var hardwareService=require(_0x0c96('0x11'));var logger=require(_0x0c96('0x12'))(_0x0c96('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0c96('0x14'));var db=require(_0x0c96('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x376a74,_0x780730){_0x780730=_0x780730||0xcc;return function(_0x5db207){if(_0x5db207){return _0x376a74[_0x0c96('0x16')](_0x780730);}return _0x376a74['status'](_0x780730)[_0x0c96('0x17')]();};}function respondWithResult(_0x5425bf,_0x53d4af){_0x53d4af=_0x53d4af||0xc8;return function(_0x53888e){if(_0x53888e){return _0x5425bf[_0x0c96('0x18')](_0x53d4af)[_0x0c96('0x19')](_0x53888e);}};}function respondWithFilteredResult(_0x1cf3fd,_0x4972bf){return function(_0x45506){if(_0x45506){var _0x526574=typeof _0x4972bf[_0x0c96('0x1a')]===_0x0c96('0x1b')&&typeof _0x4972bf[_0x0c96('0x1c')]===_0x0c96('0x1b');var _0x389fca=_0x45506['count'];var _0x3edebe=_0x526574?0x0:_0x4972bf[_0x0c96('0x1a')];var _0x4582be=_0x526574?_0x45506[_0x0c96('0x1d')]:_0x4972bf[_0x0c96('0x1a')]+_0x4972bf['limit'];var _0x37fd8c;if(_0x4582be>=_0x389fca){_0x4582be=_0x389fca;_0x37fd8c=0xc8;}else{_0x37fd8c=0xce;}_0x1cf3fd[_0x0c96('0x18')](_0x37fd8c);return _0x1cf3fd[_0x0c96('0x1e')](_0x0c96('0x1f'),_0x3edebe+'-'+_0x4582be+'/'+_0x389fca)[_0x0c96('0x19')](_0x45506);}return null;};}function patchUpdates(_0x23727e){return function(_0x5453e0){try{jsonpatch[_0x0c96('0x20')](_0x5453e0,_0x23727e,!![]);}catch(_0xfdc2fd){return BPromise[_0x0c96('0x21')](_0xfdc2fd);}return _0x5453e0['save']();};}function saveUpdates(_0x433a8c,_0x1657c9){return function(_0x2d3c8c){if(_0x2d3c8c){return _0x2d3c8c[_0x0c96('0x22')](_0x433a8c)[_0x0c96('0x23')](function(_0x2ec755){return _0x2ec755;});}return null;};}function removeEntity(_0x8b7162,_0x548f72){return function(_0x4b03b4){if(_0x4b03b4){return _0x4b03b4[_0x0c96('0x24')]()[_0x0c96('0x23')](function(){_0x8b7162[_0x0c96('0x18')](0xcc)[_0x0c96('0x17')]();});}};}function handleEntityNotFound(_0x5d848d,_0x3c6435){return function(_0xf90f3c){if(!_0xf90f3c){_0x5d848d[_0x0c96('0x16')](0x194);}return _0xf90f3c;};}function handleError(_0x57649e,_0xfa9fb6){_0xfa9fb6=_0xfa9fb6||0x1f4;return function(_0x31bdfb){logger[_0x0c96('0x25')](_0x31bdfb[_0x0c96('0x26')]);if(_0x31bdfb[_0x0c96('0x27')]){delete _0x31bdfb[_0x0c96('0x27')];}_0x57649e[_0x0c96('0x18')](_0xfa9fb6)[_0x0c96('0x28')](_0x31bdfb);};}exports[_0x0c96('0x29')]=function(_0x40b12f,_0x3df7f4){var _0x5f2abc={},_0x4de242={},_0x373a2b={'count':0x0,'rows':[]};var _0x3dc2ab=_['map'](db[_0x0c96('0x2a')][_0x0c96('0x2b')],function(_0x5743cd){return{'name':_0x5743cd[_0x0c96('0x2c')],'type':_0x5743cd[_0x0c96('0x2d')][_0x0c96('0x2e')]};});_0x4de242[_0x0c96('0x2f')]=_[_0x0c96('0x30')](_0x3dc2ab,_0x0c96('0x27'));_0x4de242[_0x0c96('0x31')]=_['keys'](_0x40b12f['query']);_0x4de242['filters']=_[_0x0c96('0x32')](_0x4de242[_0x0c96('0x2f')],_0x4de242[_0x0c96('0x31')]);_0x5f2abc[_0x0c96('0x33')]=_[_0x0c96('0x32')](_0x4de242['model'],qs[_0x0c96('0x34')](_0x40b12f['query'][_0x0c96('0x34')]));_0x5f2abc['attributes']=_0x5f2abc['attributes'][_0x0c96('0x35')]?_0x5f2abc['attributes']:_0x4de242[_0x0c96('0x2f')];if(!_0x40b12f['query'][_0x0c96('0x36')]('nolimit')){_0x5f2abc['limit']=qs[_0x0c96('0x1c')](_0x40b12f['query'][_0x0c96('0x1c')]);_0x5f2abc['offset']=qs[_0x0c96('0x1a')](_0x40b12f[_0x0c96('0x31')][_0x0c96('0x1a')]);}_0x5f2abc[_0x0c96('0x37')]=qs[_0x0c96('0x38')](_0x40b12f[_0x0c96('0x31')][_0x0c96('0x38')]);_0x5f2abc[_0x0c96('0x39')]=qs[_0x0c96('0x3a')](_[_0x0c96('0x3b')](_0x40b12f[_0x0c96('0x31')],_0x4de242[_0x0c96('0x3a')]),_0x3dc2ab);if(_0x40b12f[_0x0c96('0x31')][_0x0c96('0x3c')]){_0x5f2abc[_0x0c96('0x39')]=_[_0x0c96('0x3d')](_0x5f2abc[_0x0c96('0x39')],{'$or':_['map'](_0x3dc2ab,function(_0x8f862c){if(_0x8f862c['type']!==_0x0c96('0x3e')){var _0x571996={};_0x571996[_0x8f862c['name']]={'$like':'%'+_0x40b12f[_0x0c96('0x31')][_0x0c96('0x3c')]+'%'};return _0x571996;}})});}_0x5f2abc=_[_0x0c96('0x3d')]({},_0x5f2abc,_0x40b12f[_0x0c96('0x3f')]);var _0x39bccd={'where':_0x5f2abc['where']};return db[_0x0c96('0x2a')][_0x0c96('0x1d')](_0x39bccd)[_0x0c96('0x23')](function(_0x3ad021){_0x373a2b[_0x0c96('0x1d')]=_0x3ad021;if(_0x40b12f[_0x0c96('0x31')][_0x0c96('0x40')]){_0x5f2abc[_0x0c96('0x41')]=[{'all':!![]}];}return db['ZohoAccount'][_0x0c96('0x42')](_0x5f2abc);})[_0x0c96('0x23')](function(_0x4ef4aa){_0x373a2b[_0x0c96('0x43')]=_0x4ef4aa;return _0x373a2b;})[_0x0c96('0x23')](respondWithFilteredResult(_0x3df7f4,_0x5f2abc))[_0x0c96('0x44')](handleError(_0x3df7f4,null));};exports[_0x0c96('0x45')]=function(_0x14882c,_0x318b6f){var _0x23a38c={'raw':![],'where':{'id':_0x14882c['params']['id']}},_0x1d879f={};_0x1d879f[_0x0c96('0x2f')]=_[_0x0c96('0x46')](db['ZohoAccount'][_0x0c96('0x2b')]);_0x1d879f[_0x0c96('0x31')]=_[_0x0c96('0x46')](_0x14882c[_0x0c96('0x31')]);_0x1d879f['filters']=_['intersection'](_0x1d879f[_0x0c96('0x2f')],_0x1d879f[_0x0c96('0x31')]);_0x23a38c[_0x0c96('0x33')]=_[_0x0c96('0x32')](_0x1d879f[_0x0c96('0x2f')],qs[_0x0c96('0x34')](_0x14882c['query']['fields']));_0x23a38c[_0x0c96('0x33')]=_0x23a38c['attributes'][_0x0c96('0x35')]?_0x23a38c[_0x0c96('0x33')]:_0x1d879f[_0x0c96('0x2f')];if(_0x14882c[_0x0c96('0x31')][_0x0c96('0x40')]){_0x23a38c[_0x0c96('0x41')]=[{'all':!![]}];}_0x23a38c=_[_0x0c96('0x3d')]({},_0x23a38c,_0x14882c[_0x0c96('0x3f')]);return db['ZohoAccount']['find'](_0x23a38c)['then'](handleEntityNotFound(_0x318b6f,null))[_0x0c96('0x23')](respondWithResult(_0x318b6f,null))[_0x0c96('0x44')](handleError(_0x318b6f,null));};exports[_0x0c96('0x47')]=function(_0x299897,_0x5db11c){return db[_0x0c96('0x2a')][_0x0c96('0x47')](_0x299897[_0x0c96('0x48')],{})['then'](respondWithResult(_0x5db11c,0xc9))[_0x0c96('0x44')](handleError(_0x5db11c,null));};exports['update']=function(_0x417be2,_0x2dc5ef){if(_0x417be2[_0x0c96('0x48')]['id']){delete _0x417be2['body']['id'];}return db[_0x0c96('0x2a')][_0x0c96('0x49')]({'where':{'id':_0x417be2[_0x0c96('0x4a')]['id']}})[_0x0c96('0x23')](handleEntityNotFound(_0x2dc5ef,null))[_0x0c96('0x23')](saveUpdates(_0x417be2[_0x0c96('0x48')],null))[_0x0c96('0x23')](respondWithResult(_0x2dc5ef,null))[_0x0c96('0x44')](handleError(_0x2dc5ef,null));};exports['destroy']=function(_0x16311a,_0x2699f7){return db[_0x0c96('0x2a')][_0x0c96('0x49')]({'where':{'id':_0x16311a[_0x0c96('0x4a')]['id']}})[_0x0c96('0x23')](handleEntityNotFound(_0x2699f7,null))[_0x0c96('0x23')](removeEntity(_0x2699f7,null))[_0x0c96('0x44')](handleError(_0x2699f7,null));};exports[_0x0c96('0x4b')]=function(_0x24a002,_0x55f82c,_0x559537){var _0x2678cb={};var _0x272dc1={};var _0xdda9ee;var _0xf99101;return db[_0x0c96('0x2a')]['findOne']({'where':{'id':_0x24a002['params']['id']}})[_0x0c96('0x23')](handleEntityNotFound(_0x55f82c,null))[_0x0c96('0x23')](function(_0x31c438){if(_0x31c438){_0xdda9ee=_0x31c438;_0x272dc1['model']=_[_0x0c96('0x46')](db[_0x0c96('0x4c')][_0x0c96('0x2b')]);_0x272dc1[_0x0c96('0x31')]=_['keys'](_0x24a002[_0x0c96('0x31')]);_0x272dc1[_0x0c96('0x3a')]=_[_0x0c96('0x32')](_0x272dc1['model'],_0x272dc1[_0x0c96('0x31')]);_0x2678cb[_0x0c96('0x33')]=_['intersection'](_0x272dc1['model'],qs[_0x0c96('0x34')](_0x24a002[_0x0c96('0x31')][_0x0c96('0x34')]));_0x2678cb['attributes']=_0x2678cb['attributes'][_0x0c96('0x35')]?_0x2678cb[_0x0c96('0x33')]:_0x272dc1[_0x0c96('0x2f')];_0x2678cb[_0x0c96('0x37')]=qs[_0x0c96('0x38')](_0x24a002[_0x0c96('0x31')]['sort']);_0x2678cb[_0x0c96('0x39')]=qs[_0x0c96('0x3a')](_['pick'](_0x24a002[_0x0c96('0x31')],_0x272dc1[_0x0c96('0x3a')]));if(_0x24a002[_0x0c96('0x31')][_0x0c96('0x3c')]){_0x2678cb['where']=_[_0x0c96('0x3d')](_0x2678cb['where'],{'$or':_[_0x0c96('0x30')](_0x2678cb[_0x0c96('0x33')],function(_0x506846){var _0x389bc8={};_0x389bc8[_0x506846]={'$like':'%'+_0x24a002[_0x0c96('0x31')][_0x0c96('0x3c')]+'%'};return _0x389bc8;})});}_0x2678cb=_[_0x0c96('0x3d')]({},_0x2678cb,_0x24a002['options']);return _0xdda9ee[_0x0c96('0x4b')](_0x2678cb);}})[_0x0c96('0x23')](function(_0x50e732){if(_0x50e732){_0xf99101=_0x50e732['length'];if(!_0x24a002[_0x0c96('0x31')][_0x0c96('0x36')](_0x0c96('0x4d'))){_0x2678cb['limit']=qs[_0x0c96('0x1c')](_0x24a002[_0x0c96('0x31')][_0x0c96('0x1c')]);_0x2678cb[_0x0c96('0x1a')]=qs[_0x0c96('0x1a')](_0x24a002['query'][_0x0c96('0x1a')]);}return _0xdda9ee[_0x0c96('0x4b')](_0x2678cb);}})[_0x0c96('0x23')](function(_0x29255d){if(_0x29255d){return _0x29255d?{'count':_0xf99101,'rows':_0x29255d}:null;}})[_0x0c96('0x23')](respondWithResult(_0x55f82c,null))[_0x0c96('0x44')](handleError(_0x55f82c,null));};exports[_0x0c96('0x4e')]=function(_0x41a3f9,_0xe71953,_0x134664){if(_0x41a3f9[_0x0c96('0x48')]['id']){delete _0x41a3f9[_0x0c96('0x48')]['id'];}return db[_0x0c96('0x2a')][_0x0c96('0x4f')]({'where':{'id':_0x41a3f9[_0x0c96('0x4a')]['id']}})[_0x0c96('0x23')](handleEntityNotFound(_0xe71953,null))[_0x0c96('0x23')](function(_0x45a17a){if(_0x45a17a){_0x41a3f9[_0x0c96('0x48')][_0x0c96('0x50')]=_0x45a17a['id'];_0x41a3f9['body'][_0x0c96('0x51')]=integrations['getSubjects'](_0x41a3f9[_0x0c96('0x48')][_0x0c96('0x52')],_0x41a3f9[_0x0c96('0x48')]['type']);_0x41a3f9[_0x0c96('0x48')][_0x0c96('0x53')]=integrations[_0x0c96('0x54')](_0x41a3f9[_0x0c96('0x48')][_0x0c96('0x52')],_0x41a3f9['body'][_0x0c96('0x2d')]);return db[_0x0c96('0x4c')][_0x0c96('0x47')](_0x41a3f9[_0x0c96('0x48')],{'include':[{'model':db[_0x0c96('0x55')],'as':_0x0c96('0x51')},{'model':db[_0x0c96('0x55')],'as':'Descriptions'}]});}return null;})[_0x0c96('0x23')](respondWithResult(_0xe71953,null))[_0x0c96('0x44')](handleError(_0xe71953,null));};function getAccessToken(_0x549d49){return new Promise(function(_0xb67791,_0x159c16){var _0x1777bc;switch(_0x549d49[_0x0c96('0x56')]){case'US':_0x1777bc=_0x0c96('0x57');break;case'AU':_0x1777bc=_0x0c96('0x58');break;case'EU':_0x1777bc=_0x0c96('0x59');break;case'IN':_0x1777bc=_0x0c96('0x5a');break;case'CN':_0x1777bc=_0x0c96('0x5b');break;default:_0x1777bc='https://accounts.zoho.eu';break;}var _0x3b1c37={'method':_0x0c96('0x5c'),'uri':_0x1777bc+_0x0c96('0x5d'),'qs':{'refresh_token':_0x549d49['refreshToken'],'client_id':_0x549d49[_0x0c96('0x5e')],'client_secret':_0x549d49[_0x0c96('0x5f')],'grant_type':_0x0c96('0x60')},'json':!![]};return rp(_0x3b1c37)[_0x0c96('0x23')](function(_0x10458a){if(_0x10458a[_0x0c96('0x61')]){_0xb67791(_0x10458a[_0x0c96('0x61')]);}else{_0x159c16(_0x0c96('0x62'));}})[_0x0c96('0x44')](function(_0x306576){_0x159c16(_0x306576);});});}exports[_0x0c96('0x63')]=function(_0x392e66,_0x4fbdd4,_0x18e1d5){var _0x1109e7,_0x3c5d5d,_0x540a9e,_0x4f1ac3,_0xa7a72f;return db[_0x0c96('0x2a')]['findOne']({'where':{'id':_0x392e66[_0x0c96('0x4a')]['id']},'attributes':['id','host',_0x0c96('0x56'),'clientId',_0x0c96('0x5f'),_0x0c96('0x64'),'code','refreshToken']})[_0x0c96('0x23')](handleEntityNotFound(_0x4fbdd4,null))[_0x0c96('0x23')](function(_0x1a1023){_0xa7a72f=_0x1a1023;_0x1109e7=_0xa7a72f[_0x0c96('0x65')];_0x3c5d5d=_0x1109e7===_0x0c96('0x66')?'eu':_0x0c96('0x67');_0x540a9e=_0xa7a72f[_0x0c96('0x64')];var _0x3c9043=_0x540a9e[_0x0c96('0x68')](-0x1);if(_0x3c9043==='/'||_0x3c9043==='\x5c'||_0x3c9043===':'){_0x540a9e=_0x540a9e[_0x0c96('0x69')](0x0,_0x540a9e[_0x0c96('0x6a')](_0x3c9043));}if(!_0xa7a72f['refreshToken']){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0xa7a72f);})[_0x0c96('0x23')](function(_0x5d0bd3){if(_0x5d0bd3){return rp({'method':'GET','uri':util['format'](_0x0c96('0x6b'),_0x3c5d5d),'qs':{'module':_0x0c96('0x6c')},'headers':{'Authorization':_0x0c96('0x6d')+_0x5d0bd3},'json':!![]});}})[_0x0c96('0x23')](function(_0x23615f){if(_0x23615f){if(_0x23615f[_0x0c96('0x6e')]&&_0x23615f[_0x0c96('0x6e')][_0x0c96('0x25')]){throw new Error(_0x23615f[_0x0c96('0x6e')][_0x0c96('0x25')][_0x0c96('0x6f')]);}var _0x3c1dbd=[];var _0x1b5878=[];var _0x3fd333=[_0x0c96('0x70'),'Subject',_0x0c96('0x71'),_0x0c96('0x72'),_0x0c96('0x73'),_0x0c96('0x74'),_0x0c96('0x75'),_0x0c96('0x76')];_0x1b5878=_[_0x0c96('0x77')](_0x23615f[_0x0c96('0x34')],function(_0x3cc317){return _0x3fd333[_0x0c96('0x78')](_0x3cc317[_0x0c96('0x79')]);});for(var _0xbd8eed=0x0;_0xbd8eed<_0x1b5878[_0x0c96('0x35')];_0xbd8eed++){if(_0x1b5878[_0xbd8eed][_0x0c96('0x7a')]===![]){_0x3c1dbd[_0x0c96('0x7b')]({'id':_0x1b5878[_0xbd8eed]['id'],'name':_0x1b5878[_0xbd8eed][_0x0c96('0x7c')],'custom':_0x1b5878[_0xbd8eed][_0x0c96('0x7d')],'options':_0x1b5878[_0xbd8eed][_0x0c96('0x7e')]===_0x0c96('0x7f')&&_0x1b5878[_0xbd8eed][_0x0c96('0x80')]['length']>-0x1?_[_0x0c96('0x30')](_0x1b5878[_0xbd8eed][_0x0c96('0x80')],function(_0x48eda4){return{'name':_0x48eda4,'value':_0x48eda4};}):[]});}}return{'count':_0x3c1dbd[_0x0c96('0x35')],'rows':_0x3c1dbd};}else{return{'count':0x0,'rows':[]};}})[_0x0c96('0x23')](respondWithResult(_0x4fbdd4,null))['catch'](function(_0xf3827c){var _0x461a27=_0x392e66['query'][_0x0c96('0x81')]?0x1f4:_0xf3827c[_0x0c96('0x82')]||0x1f4;logger[_0x0c96('0x25')](_0x0c96('0x83'),_0x0c96('0x63'),_0x461a27,JSON['stringify'](_0xf3827c));delete _0xf3827c[_0x0c96('0x27')];if(_0x461a27===0x191){_0x461a27=0x190;}_0x4fbdd4[_0x0c96('0x18')](_0x461a27)[_0x0c96('0x28')](_0x392e66['query'][_0x0c96('0x81')]?{'message':_0x0c96('0x84'),'statusCode':_0xf3827c[_0x0c96('0x82')]}:_0xf3827c);});};
\ No newline at end of file
+var _0xa17d=['pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','sort','where','filter','merge','options','ZohoAccount','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','length','find','create','body','destroy','getConfigurations','findOne','ZohoConfiguration','order','pick','hasOwnProperty','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','refreshToken','clientSecret','refresh_token','access_token','serverUrl','code','host','zoho.eu','com','slice','substring','lastIndexOf','GET','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','Description','Call_Duration','Call_Result','Call_Type','remove','system_mandatory','push','display_label','custom_field','data_type','picklist'];(function(_0x2116e0,_0x530f90){var _0x1d2b37=function(_0x156fd9){while(--_0x156fd9){_0x2116e0['push'](_0x2116e0['shift']());}};_0x1d2b37(++_0x530f90);}(_0xa17d,0xfa));var _0xda17=function(_0xe15270,_0x227d06){_0xe15270=_0xe15270-0x0;var _0x1e813b=_0xa17d[_0xe15270];return _0x1e813b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xda17('0x0'));var jsonpatch=require(_0xda17('0x1'));var rp=require(_0xda17('0x2'));var moment=require(_0xda17('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xda17('0x4'));var path=require(_0xda17('0x5'));var sox=require('sox');var csv=require(_0xda17('0x6'));var ejs=require(_0xda17('0x7'));var fs=require('fs');var fs_extra=require(_0xda17('0x8'));var _=require('lodash');var squel=require(_0xda17('0x9'));var crypto=require(_0xda17('0xa'));var jsforce=require(_0xda17('0xb'));var deskjs=require(_0xda17('0xc'));var toCsv=require(_0xda17('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xda17('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xda17('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xda17('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0xda17('0x10'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x594b9f,_0x4cb723){_0x4cb723=_0x4cb723||0xcc;return function(_0x5f2ee8){if(_0x5f2ee8){return _0x594b9f[_0xda17('0x11')](_0x4cb723);}return _0x594b9f[_0xda17('0x12')](_0x4cb723)[_0xda17('0x13')]();};}function respondWithResult(_0x204e15,_0x5c202f){_0x5c202f=_0x5c202f||0xc8;return function(_0x341287){if(_0x341287){return _0x204e15[_0xda17('0x12')](_0x5c202f)[_0xda17('0x14')](_0x341287);}};}function respondWithFilteredResult(_0x274fe4,_0x3a4c1d){return function(_0x4633cd){if(_0x4633cd){var _0x50ab9c=typeof _0x3a4c1d[_0xda17('0x15')]===_0xda17('0x16')&&typeof _0x3a4c1d[_0xda17('0x17')]===_0xda17('0x16');var _0x464b02=_0x4633cd[_0xda17('0x18')];var _0x20374c=_0x50ab9c?0x0:_0x3a4c1d[_0xda17('0x15')];var _0x109670=_0x50ab9c?_0x4633cd[_0xda17('0x18')]:_0x3a4c1d[_0xda17('0x15')]+_0x3a4c1d['limit'];var _0x3898f9;if(_0x109670>=_0x464b02){_0x109670=_0x464b02;_0x3898f9=0xc8;}else{_0x3898f9=0xce;}_0x274fe4[_0xda17('0x12')](_0x3898f9);return _0x274fe4['set'](_0xda17('0x19'),_0x20374c+'-'+_0x109670+'/'+_0x464b02)[_0xda17('0x14')](_0x4633cd);}return null;};}function patchUpdates(_0x187c20){return function(_0x4d4c75){try{jsonpatch[_0xda17('0x1a')](_0x4d4c75,_0x187c20,!![]);}catch(_0x24938f){return BPromise[_0xda17('0x1b')](_0x24938f);}return _0x4d4c75[_0xda17('0x1c')]();};}function saveUpdates(_0x5346a6,_0xce9f9a){return function(_0x4c8545){if(_0x4c8545){return _0x4c8545[_0xda17('0x1d')](_0x5346a6)['then'](function(_0x30a6e3){return _0x30a6e3;});}return null;};}function removeEntity(_0x2c5849,_0x1c31fd){return function(_0x2b7156){if(_0x2b7156){return _0x2b7156['destroy']()[_0xda17('0x1e')](function(){_0x2c5849[_0xda17('0x12')](0xcc)[_0xda17('0x13')]();});}};}function handleEntityNotFound(_0xc05fbb,_0x110560){return function(_0x2c572d){if(!_0x2c572d){_0xc05fbb['sendStatus'](0x194);}return _0x2c572d;};}function handleError(_0x14ca6f,_0xf9ffe){_0xf9ffe=_0xf9ffe||0x1f4;return function(_0x408d01){logger[_0xda17('0x1f')](_0x408d01[_0xda17('0x20')]);if(_0x408d01[_0xda17('0x21')]){delete _0x408d01[_0xda17('0x21')];}_0x14ca6f[_0xda17('0x12')](_0xf9ffe)['send'](_0x408d01);};}exports[_0xda17('0x22')]=function(_0x274428,_0x5921c7){var _0x971351={},_0x2ae536={},_0x239645={'count':0x0,'rows':[]};var _0x57dbd9=_[_0xda17('0x23')](db['ZohoAccount']['rawAttributes'],function(_0x3b9600){return{'name':_0x3b9600[_0xda17('0x24')],'type':_0x3b9600[_0xda17('0x25')][_0xda17('0x26')]};});_0x2ae536[_0xda17('0x27')]=_[_0xda17('0x23')](_0x57dbd9,_0xda17('0x21'));_0x2ae536[_0xda17('0x28')]=_['keys'](_0x274428[_0xda17('0x28')]);_0x2ae536[_0xda17('0x29')]=_[_0xda17('0x2a')](_0x2ae536['model'],_0x2ae536['query']);_0x971351[_0xda17('0x2b')]=_[_0xda17('0x2a')](_0x2ae536[_0xda17('0x27')],qs[_0xda17('0x2c')](_0x274428[_0xda17('0x28')][_0xda17('0x2c')]));_0x971351['attributes']=_0x971351[_0xda17('0x2b')]['length']?_0x971351[_0xda17('0x2b')]:_0x2ae536[_0xda17('0x27')];if(!_0x274428[_0xda17('0x28')]['hasOwnProperty']('nolimit')){_0x971351['limit']=qs[_0xda17('0x17')](_0x274428[_0xda17('0x28')][_0xda17('0x17')]);_0x971351['offset']=qs[_0xda17('0x15')](_0x274428[_0xda17('0x28')][_0xda17('0x15')]);}_0x971351['order']=qs[_0xda17('0x2d')](_0x274428[_0xda17('0x28')][_0xda17('0x2d')]);_0x971351[_0xda17('0x2e')]=qs[_0xda17('0x29')](_['pick'](_0x274428['query'],_0x2ae536[_0xda17('0x29')]),_0x57dbd9);if(_0x274428['query'][_0xda17('0x2f')]){_0x971351[_0xda17('0x2e')]=_[_0xda17('0x30')](_0x971351[_0xda17('0x2e')],{'$or':_['map'](_0x57dbd9,function(_0x5e0cec){if(_0x5e0cec['type']!=='VIRTUAL'){var _0x5b6c0a={};_0x5b6c0a[_0x5e0cec[_0xda17('0x21')]]={'$like':'%'+_0x274428['query'][_0xda17('0x2f')]+'%'};return _0x5b6c0a;}})});}_0x971351=_[_0xda17('0x30')]({},_0x971351,_0x274428[_0xda17('0x31')]);var _0xaaf68a={'where':_0x971351[_0xda17('0x2e')]};return db[_0xda17('0x32')][_0xda17('0x18')](_0xaaf68a)['then'](function(_0x561617){_0x239645[_0xda17('0x18')]=_0x561617;if(_0x274428[_0xda17('0x28')][_0xda17('0x33')]){_0x971351[_0xda17('0x34')]=[{'all':!![]}];}return db[_0xda17('0x32')][_0xda17('0x35')](_0x971351);})[_0xda17('0x1e')](function(_0x527ae5){_0x239645[_0xda17('0x36')]=_0x527ae5;return _0x239645;})[_0xda17('0x1e')](respondWithFilteredResult(_0x5921c7,_0x971351))[_0xda17('0x37')](handleError(_0x5921c7,null));};exports['show']=function(_0x5ed271,_0x57e23c){var _0x29afd1={'raw':![],'where':{'id':_0x5ed271[_0xda17('0x38')]['id']}},_0x60e75={};_0x60e75['model']=_[_0xda17('0x39')](db['ZohoAccount'][_0xda17('0x3a')]);_0x60e75[_0xda17('0x28')]=_[_0xda17('0x39')](_0x5ed271[_0xda17('0x28')]);_0x60e75[_0xda17('0x29')]=_['intersection'](_0x60e75['model'],_0x60e75['query']);_0x29afd1['attributes']=_[_0xda17('0x2a')](_0x60e75['model'],qs['fields'](_0x5ed271[_0xda17('0x28')][_0xda17('0x2c')]));_0x29afd1['attributes']=_0x29afd1[_0xda17('0x2b')][_0xda17('0x3b')]?_0x29afd1[_0xda17('0x2b')]:_0x60e75[_0xda17('0x27')];if(_0x5ed271[_0xda17('0x28')]['includeAll']){_0x29afd1['include']=[{'all':!![]}];}_0x29afd1=_[_0xda17('0x30')]({},_0x29afd1,_0x5ed271[_0xda17('0x31')]);return db[_0xda17('0x32')][_0xda17('0x3c')](_0x29afd1)[_0xda17('0x1e')](handleEntityNotFound(_0x57e23c,null))[_0xda17('0x1e')](respondWithResult(_0x57e23c,null))[_0xda17('0x37')](handleError(_0x57e23c,null));};exports[_0xda17('0x3d')]=function(_0x1e4007,_0x3fe3a7){return db[_0xda17('0x32')][_0xda17('0x3d')](_0x1e4007[_0xda17('0x3e')],{})[_0xda17('0x1e')](respondWithResult(_0x3fe3a7,0xc9))[_0xda17('0x37')](handleError(_0x3fe3a7,null));};exports['update']=function(_0x58496f,_0x51aa34){if(_0x58496f[_0xda17('0x3e')]['id']){delete _0x58496f[_0xda17('0x3e')]['id'];}return db['ZohoAccount']['find']({'where':{'id':_0x58496f[_0xda17('0x38')]['id']}})[_0xda17('0x1e')](handleEntityNotFound(_0x51aa34,null))[_0xda17('0x1e')](saveUpdates(_0x58496f[_0xda17('0x3e')],null))[_0xda17('0x1e')](respondWithResult(_0x51aa34,null))[_0xda17('0x37')](handleError(_0x51aa34,null));};exports[_0xda17('0x3f')]=function(_0x137c7b,_0x5d5fe0){return db[_0xda17('0x32')][_0xda17('0x3c')]({'where':{'id':_0x137c7b[_0xda17('0x38')]['id']}})['then'](handleEntityNotFound(_0x5d5fe0,null))[_0xda17('0x1e')](removeEntity(_0x5d5fe0,null))['catch'](handleError(_0x5d5fe0,null));};exports[_0xda17('0x40')]=function(_0x2f72d7,_0x4c6559,_0x4d444a){var _0x11ab10={};var _0x30fdc0={};var _0x486546;var _0x49ed3c;return db[_0xda17('0x32')][_0xda17('0x41')]({'where':{'id':_0x2f72d7[_0xda17('0x38')]['id']}})[_0xda17('0x1e')](handleEntityNotFound(_0x4c6559,null))['then'](function(_0x3d6562){if(_0x3d6562){_0x486546=_0x3d6562;_0x30fdc0[_0xda17('0x27')]=_[_0xda17('0x39')](db[_0xda17('0x42')][_0xda17('0x3a')]);_0x30fdc0[_0xda17('0x28')]=_[_0xda17('0x39')](_0x2f72d7[_0xda17('0x28')]);_0x30fdc0[_0xda17('0x29')]=_[_0xda17('0x2a')](_0x30fdc0['model'],_0x30fdc0[_0xda17('0x28')]);_0x11ab10[_0xda17('0x2b')]=_[_0xda17('0x2a')](_0x30fdc0[_0xda17('0x27')],qs[_0xda17('0x2c')](_0x2f72d7[_0xda17('0x28')]['fields']));_0x11ab10[_0xda17('0x2b')]=_0x11ab10[_0xda17('0x2b')][_0xda17('0x3b')]?_0x11ab10['attributes']:_0x30fdc0[_0xda17('0x27')];_0x11ab10[_0xda17('0x43')]=qs[_0xda17('0x2d')](_0x2f72d7[_0xda17('0x28')][_0xda17('0x2d')]);_0x11ab10[_0xda17('0x2e')]=qs[_0xda17('0x29')](_[_0xda17('0x44')](_0x2f72d7[_0xda17('0x28')],_0x30fdc0[_0xda17('0x29')]));if(_0x2f72d7[_0xda17('0x28')]['filter']){_0x11ab10[_0xda17('0x2e')]=_[_0xda17('0x30')](_0x11ab10['where'],{'$or':_['map'](_0x11ab10['attributes'],function(_0xcd5925){var _0x5d0764={};_0x5d0764[_0xcd5925]={'$like':'%'+_0x2f72d7['query']['filter']+'%'};return _0x5d0764;})});}_0x11ab10=_[_0xda17('0x30')]({},_0x11ab10,_0x2f72d7[_0xda17('0x31')]);return _0x486546['getConfigurations'](_0x11ab10);}})[_0xda17('0x1e')](function(_0x317def){if(_0x317def){_0x49ed3c=_0x317def[_0xda17('0x3b')];if(!_0x2f72d7[_0xda17('0x28')][_0xda17('0x45')](_0xda17('0x46'))){_0x11ab10['limit']=qs[_0xda17('0x17')](_0x2f72d7[_0xda17('0x28')]['limit']);_0x11ab10['offset']=qs[_0xda17('0x15')](_0x2f72d7[_0xda17('0x28')][_0xda17('0x15')]);}return _0x486546[_0xda17('0x40')](_0x11ab10);}})[_0xda17('0x1e')](function(_0x49d3aa){if(_0x49d3aa){return _0x49d3aa?{'count':_0x49ed3c,'rows':_0x49d3aa}:null;}})[_0xda17('0x1e')](respondWithResult(_0x4c6559,null))[_0xda17('0x37')](handleError(_0x4c6559,null));};exports['addConfiguration']=function(_0x1c16e6,_0x479f7e,_0x2d7ced){if(_0x1c16e6[_0xda17('0x3e')]['id']){delete _0x1c16e6['body']['id'];}return db[_0xda17('0x32')][_0xda17('0x41')]({'where':{'id':_0x1c16e6['params']['id']}})[_0xda17('0x1e')](handleEntityNotFound(_0x479f7e,null))[_0xda17('0x1e')](function(_0x4c7742){if(_0x4c7742){_0x1c16e6[_0xda17('0x3e')][_0xda17('0x47')]=_0x4c7742['id'];_0x1c16e6['body'][_0xda17('0x48')]=integrations[_0xda17('0x49')](_0x1c16e6[_0xda17('0x3e')][_0xda17('0x4a')],_0x1c16e6[_0xda17('0x3e')][_0xda17('0x25')]);_0x1c16e6[_0xda17('0x3e')][_0xda17('0x4b')]=integrations[_0xda17('0x4c')](_0x1c16e6[_0xda17('0x3e')][_0xda17('0x4a')],_0x1c16e6[_0xda17('0x3e')]['type']);return db[_0xda17('0x42')]['create'](_0x1c16e6['body'],{'include':[{'model':db['ZohoField'],'as':_0xda17('0x48')},{'model':db[_0xda17('0x4d')],'as':_0xda17('0x4b')}]});}return null;})[_0xda17('0x1e')](respondWithResult(_0x479f7e,null))[_0xda17('0x37')](handleError(_0x479f7e,null));};function getAccessToken(_0x54b7dc){return new Promise(function(_0x5b1809,_0x21230a){var _0x961dee;switch(_0x54b7dc[_0xda17('0x4e')]){case'US':_0x961dee=_0xda17('0x4f');break;case'AU':_0x961dee=_0xda17('0x50');break;case'EU':_0x961dee=_0xda17('0x51');break;case'IN':_0x961dee='https://accounts.zoho.in';break;case'CN':_0x961dee=_0xda17('0x52');break;default:_0x961dee=_0xda17('0x51');break;}var _0x38b929={'method':_0xda17('0x53'),'uri':_0x961dee+'/oauth/v2/token','qs':{'refresh_token':_0x54b7dc[_0xda17('0x54')],'client_id':_0x54b7dc['clientId'],'client_secret':_0x54b7dc[_0xda17('0x55')],'grant_type':_0xda17('0x56')},'json':!![]};return rp(_0x38b929)[_0xda17('0x1e')](function(_0x3c2a6f){if(_0x3c2a6f[_0xda17('0x57')]){_0x5b1809(_0x3c2a6f[_0xda17('0x57')]);}else{_0x21230a('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xda17('0x37')](function(_0x57d44b){_0x21230a(_0x57d44b);});});}exports['getFields']=function(_0x21b44b,_0x490474,_0x2cd0ad){var _0x45804b,_0x16b5d4,_0x245a30,_0x4df8fa,_0x1105e3;return db[_0xda17('0x32')][_0xda17('0x41')]({'where':{'id':_0x21b44b[_0xda17('0x38')]['id']},'attributes':['id','host',_0xda17('0x4e'),'clientId',_0xda17('0x55'),_0xda17('0x58'),_0xda17('0x59'),_0xda17('0x54')]})[_0xda17('0x1e')](handleEntityNotFound(_0x490474,null))[_0xda17('0x1e')](function(_0x3ee57a){_0x1105e3=_0x3ee57a;_0x45804b=_0x1105e3[_0xda17('0x5a')];_0x16b5d4=_0x45804b===_0xda17('0x5b')?'eu':_0xda17('0x5c');_0x245a30=_0x1105e3[_0xda17('0x58')];var _0x4dc8f1=_0x245a30[_0xda17('0x5d')](-0x1);if(_0x4dc8f1==='/'||_0x4dc8f1==='\x5c'||_0x4dc8f1===':'){_0x245a30=_0x245a30[_0xda17('0x5e')](0x0,_0x245a30[_0xda17('0x5f')](_0x4dc8f1));}if(!_0x1105e3[_0xda17('0x54')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x1105e3);})[_0xda17('0x1e')](function(_0x4d5c86){if(_0x4d5c86){return rp({'method':_0xda17('0x60'),'uri':util['format']('https://www.zohoapis.%s/crm/v2/settings/fields',_0x16b5d4),'qs':{'module':_0xda17('0x61')},'headers':{'Authorization':_0xda17('0x62')+_0x4d5c86},'json':!![]});}})[_0xda17('0x1e')](function(_0x504248){if(_0x504248){if(_0x504248['response']&&_0x504248['response'][_0xda17('0x1f')]){throw new Error(_0x504248[_0xda17('0x63')][_0xda17('0x1f')]['message']);}var _0x25d0c4=[];var _0x50d7c0=[];var _0x25cfb9=[_0xda17('0x64'),_0xda17('0x65'),_0xda17('0x66'),'WhoId',_0xda17('0x67'),_0xda17('0x68'),'Call_Start_Time',_0xda17('0x69')];_0x50d7c0=_[_0xda17('0x6a')](_0x504248[_0xda17('0x2c')],function(_0x2de70d){return _0x25cfb9['includes'](_0x2de70d['api_name']);});for(var _0x340a68=0x0;_0x340a68<_0x50d7c0[_0xda17('0x3b')];_0x340a68++){if(_0x50d7c0[_0x340a68][_0xda17('0x6b')]===![]){_0x25d0c4[_0xda17('0x6c')]({'id':_0x50d7c0[_0x340a68]['id'],'name':_0x50d7c0[_0x340a68][_0xda17('0x6d')],'custom':_0x50d7c0[_0x340a68][_0xda17('0x6e')],'options':_0x50d7c0[_0x340a68][_0xda17('0x6f')]===_0xda17('0x70')&&_0x50d7c0[_0x340a68]['pick_list_values'][_0xda17('0x3b')]>-0x1?_['map'](_0x50d7c0[_0x340a68][_0xda17('0x71')],function(_0x4fb8a1){return{'name':_0x4fb8a1,'value':_0x4fb8a1};}):[]});}}return{'count':_0x25d0c4[_0xda17('0x3b')],'rows':_0x25d0c4};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x490474,null))[_0xda17('0x37')](function(_0x400b41){var _0x263dc9=_0x21b44b[_0xda17('0x28')][_0xda17('0x72')]?0x1f4:_0x400b41[_0xda17('0x73')]||0x1f4;logger[_0xda17('0x1f')](_0xda17('0x74'),_0xda17('0x75'),_0x263dc9,JSON[_0xda17('0x76')](_0x400b41));delete _0x400b41[_0xda17('0x21')];if(_0x263dc9===0x191){_0x263dc9=0x190;}_0x490474[_0xda17('0x12')](_0x263dc9)[_0xda17('0x77')](_0x21b44b[_0xda17('0x28')][_0xda17('0x72')]?{'message':_0xda17('0x78'),'statusCode':_0x400b41[_0xda17('0x73')]}:_0x400b41);});};
\ No newline at end of file
index 4b8efa4..19de9f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e57=['clientId','clientSecret','application/x-www-form-urlencoded','parse','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','format','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','host','zone','https://accounts.zoho.in','then','refresh_token','refreshToken','error','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','code','slice','substring','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','POST','authorization_code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e57,0x8d));var _0x72e5=function(_0x170e44,_0x3193fb){_0x170e44=_0x170e44-0x0;var _0x5c1eef=_0x2e57[_0x170e44];return _0x5c1eef;};'use strict';var _=require(_0x72e5('0x0'));var util=require(_0x72e5('0x1'));var logger=require(_0x72e5('0x2'))(_0x72e5('0x3'));var moment=require('moment');var BPromise=require(_0x72e5('0x4'));var rp=require(_0x72e5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x72e5('0x6'));var attributes=require(_0x72e5('0x7'));var integrations=require(_0x72e5('0x8'));module[_0x72e5('0x9')]=function(_0x3c0d72,_0x1f49d4){return _0x3c0d72[_0x72e5('0xa')](_0x72e5('0xb'),attributes,{'tableName':_0x72e5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x17e5cd,_0x551bc0,_0x5ab695){if(_0x17e5cd[_0x72e5('0xd')]('zone')||_0x17e5cd[_0x72e5('0xd')](_0x72e5('0xe'))||_0x17e5cd['changed']('clientId')||_0x17e5cd['changed']('clientSecret')||_0x17e5cd[_0x72e5('0xd')](_0x72e5('0xf'))||_0x17e5cd[_0x72e5('0xd')]('host')){var _0x2335ec,_0x1c3c56;_0x2335ec=_0x17e5cd[_0x72e5('0xe')];var _0x34c538=_0x2335ec[_0x72e5('0x10')](-0x1);if(_0x34c538==='/'||_0x34c538==='\x5c'||_0x34c538===':'){_0x2335ec=_0x2335ec[_0x72e5('0x11')](0x0,_0x2335ec[_0x72e5('0x12')](_0x34c538));}switch(_0x17e5cd['zone']){case'US':_0x1c3c56='https://accounts.zoho.com';break;case'AU':_0x1c3c56=_0x72e5('0x13');break;case'IN':_0x1c3c56='https://accounts.zoho.in';break;case'CN':_0x1c3c56=_0x72e5('0x14');break;default:_0x1c3c56='https://accounts.zoho.eu';break;}var _0x585944={'method':_0x72e5('0x15'),'uri':_0x1c3c56+'/oauth/v2/token','form':{'grant_type':_0x72e5('0x16'),'client_id':_0x17e5cd[_0x72e5('0x17')],'client_secret':_0x17e5cd[_0x72e5('0x18')],'redirect_uri':_0x17e5cd[_0x72e5('0xe')],'code':_0x17e5cd[_0x72e5('0xf')]},'headers':{'Content-Type':_0x72e5('0x19')}};return rp(_0x585944)['then'](function(_0x2d909b){var _0x5ceea2=JSON[_0x72e5('0x1a')](_0x2d909b);if(_0x5ceea2['refresh_token']){_0x17e5cd['refreshToken']=_0x5ceea2['refresh_token'];logger[_0x72e5('0x1b')](util['format'](_0x72e5('0x1c'),_0x17e5cd[_0x72e5('0x1d')],_0x17e5cd['id']));}else{logger['error'](util[_0x72e5('0x1e')](_0x72e5('0x1f'),_0x17e5cd[_0x72e5('0x1d')],_0x17e5cd['id']),util[_0x72e5('0x20')](_0x5ceea2,{'showHidden':![],'depth':null}));}return _0x5ab695(null,_0x551bc0);})[_0x72e5('0x21')](function(_0x1112c3){logger['error'](util[_0x72e5('0x1e')](_0x72e5('0x1f'),_0x17e5cd[_0x72e5('0x1d')],_0x17e5cd['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x5ab695(_0x1112c3);});}else{return _0x5ab695(null,_0x551bc0);}},'beforeUpdate':function(_0x5af223,_0x2cdb78,_0x246bd6){if(_0x5af223[_0x72e5('0xd')]('zone')||_0x5af223[_0x72e5('0xd')](_0x72e5('0xe'))||_0x5af223[_0x72e5('0xd')](_0x72e5('0x17'))||_0x5af223[_0x72e5('0xd')](_0x72e5('0x18'))||_0x5af223[_0x72e5('0xd')](_0x72e5('0xf'))||_0x5af223[_0x72e5('0xd')](_0x72e5('0x22'))){var _0x5f2aa2,_0xdc67c9;_0x5f2aa2=_0x5af223['serverUrl'];var _0x5e0174=_0x5f2aa2['slice'](-0x1);if(_0x5e0174==='/'||_0x5e0174==='\x5c'||_0x5e0174===':'){_0x5f2aa2=_0x5f2aa2[_0x72e5('0x11')](0x0,_0x5f2aa2[_0x72e5('0x12')](_0x5e0174));}switch(_0x5af223[_0x72e5('0x23')]){case'US':_0xdc67c9='https://accounts.zoho.com';break;case'AU':_0xdc67c9=_0x72e5('0x13');break;case'IN':_0xdc67c9=_0x72e5('0x24');break;case'CN':_0xdc67c9=_0x72e5('0x14');break;default:_0xdc67c9='https://accounts.zoho.eu';break;}var _0x4fc93e={'method':'POST','uri':_0xdc67c9+'/oauth/v2/token','form':{'grant_type':'authorization_code','client_id':_0x5af223[_0x72e5('0x17')],'client_secret':_0x5af223[_0x72e5('0x18')],'redirect_uri':_0x5af223[_0x72e5('0xe')],'code':_0x5af223['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x4fc93e)[_0x72e5('0x25')](function(_0x34b377){var _0x40b0af=JSON[_0x72e5('0x1a')](_0x34b377);if(_0x40b0af[_0x72e5('0x26')]){_0x5af223[_0x72e5('0x27')]=_0x40b0af['refresh_token'];logger['info'](util[_0x72e5('0x1e')](_0x72e5('0x1c'),_0x5af223[_0x72e5('0x1d')],_0x5af223['id']));}else{logger[_0x72e5('0x28')](util[_0x72e5('0x1e')](_0x72e5('0x1f'),_0x5af223[_0x72e5('0x1d')],_0x5af223['id']),util[_0x72e5('0x20')](_0x40b0af,{'showHidden':![],'depth':null}));}return _0x246bd6(null,_0x2cdb78);})[_0x72e5('0x21')](function(_0x5a01d9){logger[_0x72e5('0x28')](util[_0x72e5('0x1e')](_0x72e5('0x1f'),_0x5af223[_0x72e5('0x1d')],_0x5af223['id']),util[_0x72e5('0x20')](parsedResult,{'showHidden':![],'depth':null}));return _0x246bd6(_0x5a01d9);});}else{return _0x246bd6(null,_0x2cdb78);}}}});};
\ No newline at end of file
+var _0xf894=['changed','zone','serverUrl','clientId','code','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.in','/oauth/v2/token','application/x-www-form-urlencoded','then','parse','refreshToken','refresh_token','format','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','clientSecret','https://accounts.zoho.com.au','POST','authorization_code','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts'];(function(_0x225c46,_0x31e49e){var _0x1ed094=function(_0x100516){while(--_0x100516){_0x225c46['push'](_0x225c46['shift']());}};_0x1ed094(++_0x31e49e);}(_0xf894,0x183));var _0x4f89=function(_0x5af47b,_0x1276c5){_0x5af47b=_0x5af47b-0x0;var _0x35fe04=_0xf894[_0x5af47b];return _0x35fe04;};'use strict';var _=require(_0x4f89('0x0'));var util=require('util');var logger=require(_0x4f89('0x1'))(_0x4f89('0x2'));var moment=require(_0x4f89('0x3'));var BPromise=require(_0x4f89('0x4'));var rp=require(_0x4f89('0x5'));var fs=require('fs');var path=require(_0x4f89('0x6'));var rimraf=require('rimraf');var config=require(_0x4f89('0x7'));var attributes=require(_0x4f89('0x8'));var integrations=require(_0x4f89('0x9'));module['exports']=function(_0x23dd61,_0x4aa3f7){return _0x23dd61[_0x4f89('0xa')](_0x4f89('0xb'),attributes,{'tableName':_0x4f89('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x10b762,_0x33cc12,_0x31a58c){if(_0x10b762[_0x4f89('0xd')](_0x4f89('0xe'))||_0x10b762[_0x4f89('0xd')](_0x4f89('0xf'))||_0x10b762['changed'](_0x4f89('0x10'))||_0x10b762[_0x4f89('0xd')]('clientSecret')||_0x10b762[_0x4f89('0xd')](_0x4f89('0x11'))||_0x10b762[_0x4f89('0xd')]('host')){var _0x7d1e5a,_0x21deaf;_0x7d1e5a=_0x10b762[_0x4f89('0xf')];var _0x36343c=_0x7d1e5a[_0x4f89('0x12')](-0x1);if(_0x36343c==='/'||_0x36343c==='\x5c'||_0x36343c===':'){_0x7d1e5a=_0x7d1e5a[_0x4f89('0x13')](0x0,_0x7d1e5a[_0x4f89('0x14')](_0x36343c));}switch(_0x10b762[_0x4f89('0xe')]){case'US':_0x21deaf=_0x4f89('0x15');break;case'AU':_0x21deaf='https://accounts.zoho.com.au';break;case'IN':_0x21deaf=_0x4f89('0x16');break;case'CN':_0x21deaf='https://accounts.zoho.com.cn';break;default:_0x21deaf='https://accounts.zoho.eu';break;}var _0x5d4219={'method':'POST','uri':_0x21deaf+_0x4f89('0x17'),'form':{'grant_type':'authorization_code','client_id':_0x10b762[_0x4f89('0x10')],'client_secret':_0x10b762['clientSecret'],'redirect_uri':_0x10b762[_0x4f89('0xf')],'code':_0x10b762[_0x4f89('0x11')]},'headers':{'Content-Type':_0x4f89('0x18')}};return rp(_0x5d4219)[_0x4f89('0x19')](function(_0x2ba1e6){var _0x50f37b=JSON[_0x4f89('0x1a')](_0x2ba1e6);if(_0x50f37b['refresh_token']){_0x10b762[_0x4f89('0x1b')]=_0x50f37b[_0x4f89('0x1c')];logger['info'](util[_0x4f89('0x1d')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x10b762[_0x4f89('0x1e')],_0x10b762['id']));}else{logger[_0x4f89('0x1f')](util[_0x4f89('0x1d')](_0x4f89('0x20'),_0x10b762[_0x4f89('0x1e')],_0x10b762['id']),util[_0x4f89('0x21')](_0x50f37b,{'showHidden':![],'depth':null}));}return _0x31a58c(null,_0x33cc12);})[_0x4f89('0x22')](function(_0x523f79){logger[_0x4f89('0x1f')](util['format'](_0x4f89('0x20'),_0x10b762[_0x4f89('0x1e')],_0x10b762['id']),util[_0x4f89('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x31a58c(_0x523f79);});}else{return _0x31a58c(null,_0x33cc12);}},'beforeUpdate':function(_0x5ddb27,_0x24e481,_0x2f89e2){if(_0x5ddb27[_0x4f89('0xd')](_0x4f89('0xe'))||_0x5ddb27[_0x4f89('0xd')](_0x4f89('0xf'))||_0x5ddb27[_0x4f89('0xd')]('clientId')||_0x5ddb27[_0x4f89('0xd')](_0x4f89('0x23'))||_0x5ddb27['changed']('code')||_0x5ddb27[_0x4f89('0xd')]('host')){var _0x1fc7ea,_0x18c9f9;_0x1fc7ea=_0x5ddb27[_0x4f89('0xf')];var _0x5ee05a=_0x1fc7ea['slice'](-0x1);if(_0x5ee05a==='/'||_0x5ee05a==='\x5c'||_0x5ee05a===':'){_0x1fc7ea=_0x1fc7ea[_0x4f89('0x13')](0x0,_0x1fc7ea[_0x4f89('0x14')](_0x5ee05a));}switch(_0x5ddb27[_0x4f89('0xe')]){case'US':_0x18c9f9=_0x4f89('0x15');break;case'AU':_0x18c9f9=_0x4f89('0x24');break;case'IN':_0x18c9f9=_0x4f89('0x16');break;case'CN':_0x18c9f9='https://accounts.zoho.com.cn';break;default:_0x18c9f9='https://accounts.zoho.eu';break;}var _0x5ddde3={'method':_0x4f89('0x25'),'uri':_0x18c9f9+_0x4f89('0x17'),'form':{'grant_type':_0x4f89('0x26'),'client_id':_0x5ddb27[_0x4f89('0x10')],'client_secret':_0x5ddb27[_0x4f89('0x23')],'redirect_uri':_0x5ddb27[_0x4f89('0xf')],'code':_0x5ddb27[_0x4f89('0x11')]},'headers':{'Content-Type':_0x4f89('0x18')}};return rp(_0x5ddde3)['then'](function(_0x1393f2){var _0x30bfcd=JSON[_0x4f89('0x1a')](_0x1393f2);if(_0x30bfcd[_0x4f89('0x1c')]){_0x5ddb27[_0x4f89('0x1b')]=_0x30bfcd[_0x4f89('0x1c')];logger['info'](util['format'](_0x4f89('0x27'),_0x5ddb27['name'],_0x5ddb27['id']));}else{logger['error'](util[_0x4f89('0x1d')](_0x4f89('0x20'),_0x5ddb27[_0x4f89('0x1e')],_0x5ddb27['id']),util['inspect'](_0x30bfcd,{'showHidden':![],'depth':null}));}return _0x2f89e2(null,_0x24e481);})[_0x4f89('0x22')](function(_0x314324){logger[_0x4f89('0x1f')](util[_0x4f89('0x1d')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5ddb27['name'],_0x5ddb27['id']),util[_0x4f89('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x2f89e2(_0x314324);});}else{return _0x2f89e2(null,_0x24e481);}}}});};
\ No newline at end of file
index bbc3800..dff992c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x672a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','GetZohoAccount','ZohoAccount','findAll','options','raw','where','limit','map','include','model','attributes','ShowZohoAccount','find','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x672a,0x122));var _0xa672=function(_0x3fdd34,_0x1d612a){_0x3fdd34=_0x3fdd34-0x0;var _0x14bb56=_0x672a[_0x3fdd34];return _0x14bb56;};'use strict';var _=require(_0xa672('0x0'));var util=require(_0xa672('0x1'));var moment=require(_0xa672('0x2'));var BPromise=require(_0xa672('0x3'));var rs=require(_0xa672('0x4'));var fs=require('fs');var Redis=require(_0xa672('0x5'));var db=require(_0xa672('0x6'))['db'];var utils=require(_0xa672('0x7'));var logger=require(_0xa672('0x8'))(_0xa672('0x9'));var config=require(_0xa672('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xa672('0xb')][_0xa672('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3a4797,_0x33dd0c,_0x13402c){return new BPromise(function(_0x3f18d8,_0x338516){return client[_0xa672('0xd')](_0x3a4797,_0x13402c)[_0xa672('0xe')](function(_0x370f20){logger[_0xa672('0xf')](_0xa672('0x10'),_0x33dd0c,_0xa672('0x11'));logger[_0xa672('0x12')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x33dd0c,_0xa672('0x11'),JSON[_0xa672('0x13')](_0x370f20));if(_0x370f20['error']){if(_0x370f20[_0xa672('0x14')][_0xa672('0x15')]===0x1f4){logger[_0xa672('0x14')](_0xa672('0x10'),_0x33dd0c,_0x370f20[_0xa672('0x14')][_0xa672('0x16')]);return _0x338516(_0x370f20[_0xa672('0x14')][_0xa672('0x16')]);}logger[_0xa672('0x14')]('ZohoAccount,\x20%s,\x20%s',_0x33dd0c,_0x370f20[_0xa672('0x14')][_0xa672('0x16')]);return _0x3f18d8(_0x370f20['error']['message']);}else{logger[_0xa672('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x33dd0c,'request\x20sent');_0x3f18d8(_0x370f20['result'][_0xa672('0x16')]);}})['catch'](function(_0x5a98a4){logger[_0xa672('0x14')](_0xa672('0x10'),_0x33dd0c,_0x5a98a4);_0x338516(_0x5a98a4);});});}exports[_0xa672('0x17')]=function(_0xc5eeb3){var _0x929a34=this;return new Promise(function(_0x10dc1c,_0x213861){return db[_0xa672('0x18')][_0xa672('0x19')]({'raw':_0xc5eeb3[_0xa672('0x1a')]?_0xc5eeb3['options'][_0xa672('0x1b')]===undefined?!![]:![]:!![],'where':_0xc5eeb3[_0xa672('0x1a')]?_0xc5eeb3[_0xa672('0x1a')][_0xa672('0x1c')]||null:null,'attributes':_0xc5eeb3[_0xa672('0x1a')]?_0xc5eeb3[_0xa672('0x1a')]['attributes']||null:null,'limit':_0xc5eeb3[_0xa672('0x1a')]?_0xc5eeb3[_0xa672('0x1a')][_0xa672('0x1d')]||null:null,'include':_0xc5eeb3[_0xa672('0x1a')]?_0xc5eeb3[_0xa672('0x1a')]['include']?_[_0xa672('0x1e')](_0xc5eeb3[_0xa672('0x1a')][_0xa672('0x1f')],function(_0x47000f){return{'model':db[_0x47000f['model']],'as':_0x47000f['as'],'attributes':_0x47000f['attributes'],'include':_0x47000f[_0xa672('0x1f')]?_['map'](_0x47000f[_0xa672('0x1f')],function(_0x31f755){return{'model':db[_0x31f755[_0xa672('0x20')]],'as':_0x31f755['as'],'attributes':_0x31f755[_0xa672('0x21')],'include':_0x31f755[_0xa672('0x1f')]?_[_0xa672('0x1e')](_0x31f755['include'],function(_0x5388f1){return{'model':db[_0x5388f1[_0xa672('0x20')]],'as':_0x5388f1['as'],'attributes':_0x5388f1[_0xa672('0x21')]};}):[]};}):[]};}):[]:[]})[_0xa672('0xe')](function(_0x5d3d6a){logger[_0xa672('0xf')](_0xa672('0x17'),_0xc5eeb3);logger['debug'](_0xa672('0x17'),_0xc5eeb3,JSON[_0xa672('0x13')](_0x5d3d6a));_0x10dc1c(_0x5d3d6a);})['catch'](function(_0x210c42){logger[_0xa672('0x14')](_0xa672('0x17'),_0x210c42[_0xa672('0x16')],_0xc5eeb3);_0x213861(_0x929a34[_0xa672('0x14')](0x1f4,_0x210c42[_0xa672('0x16')]));});});};exports[_0xa672('0x22')]=function(_0x1250eb){var _0x48ccf3=this;return new Promise(function(_0x89250e,_0x1bae9f){return db[_0xa672('0x18')][_0xa672('0x23')]({'raw':_0x1250eb[_0xa672('0x1a')]?_0x1250eb[_0xa672('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x1250eb[_0xa672('0x1a')]?_0x1250eb['options'][_0xa672('0x1c')]||null:null,'attributes':_0x1250eb[_0xa672('0x1a')]?_0x1250eb[_0xa672('0x1a')][_0xa672('0x21')]||null:null,'include':_0x1250eb[_0xa672('0x1a')]?_0x1250eb['options']['include']?_['map'](_0x1250eb[_0xa672('0x1a')]['include'],function(_0x1720a9){return{'model':db[_0x1720a9[_0xa672('0x20')]],'as':_0x1720a9['as'],'attributes':_0x1720a9[_0xa672('0x21')],'include':_0x1720a9[_0xa672('0x1f')]?_['map'](_0x1720a9[_0xa672('0x1f')],function(_0x10f785){return{'model':db[_0x10f785[_0xa672('0x20')]],'as':_0x10f785['as'],'attributes':_0x10f785[_0xa672('0x21')],'include':_0x10f785['include']?_['map'](_0x10f785[_0xa672('0x1f')],function(_0x23165c){return{'model':db[_0x23165c[_0xa672('0x20')]],'as':_0x23165c['as'],'attributes':_0x23165c[_0xa672('0x21')]};}):[]};}):[]};}):[]:[]})[_0xa672('0xe')](function(_0x38681b){logger['info'](_0xa672('0x22'),_0x1250eb);logger['debug'](_0xa672('0x22'),_0x1250eb,JSON[_0xa672('0x13')](_0x38681b));_0x89250e(_0x38681b);})[_0xa672('0x24')](function(_0x196cbd){logger[_0xa672('0x14')](_0xa672('0x22'),_0x196cbd['message'],_0x1250eb);_0x1bae9f(_0x48ccf3['error'](0x1f4,_0x196cbd[_0xa672('0x16')]));});});};
\ No newline at end of file
+var _0x4cb5=['../../config/environment','jayson/promise','http','request','then','info','ZohoAccount,\x20%s,\x20%s','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','limit','include','map','model','attributes','debug','find','where','ShowZohoAccount','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5f44b0,_0x588967){var _0x5d010d=function(_0x8951b1){while(--_0x8951b1){_0x5f44b0['push'](_0x5f44b0['shift']());}};_0x5d010d(++_0x588967);}(_0x4cb5,0x8f));var _0x54cb=function(_0x3403fd,_0x413103){_0x3403fd=_0x3403fd-0x0;var _0x23ae02=_0x4cb5[_0x3403fd];return _0x23ae02;};'use strict';var _=require(_0x54cb('0x0'));var util=require(_0x54cb('0x1'));var moment=require(_0x54cb('0x2'));var BPromise=require(_0x54cb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x54cb('0x4'));var db=require(_0x54cb('0x5'))['db'];var utils=require(_0x54cb('0x6'));var logger=require(_0x54cb('0x7'))(_0x54cb('0x8'));var config=require(_0x54cb('0x9'));var jayson=require(_0x54cb('0xa'));var client=jayson['client'][_0x54cb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a3817,_0x5f4830,_0x3f2076){return new BPromise(function(_0x53cc33,_0x3c2861){return client[_0x54cb('0xc')](_0x2a3817,_0x3f2076)[_0x54cb('0xd')](function(_0x25596b){logger[_0x54cb('0xe')](_0x54cb('0xf'),_0x5f4830,'request\x20sent');logger['debug'](_0x54cb('0x10'),_0x5f4830,_0x54cb('0x11'),JSON['stringify'](_0x25596b));if(_0x25596b[_0x54cb('0x12')]){if(_0x25596b[_0x54cb('0x12')][_0x54cb('0x13')]===0x1f4){logger[_0x54cb('0x12')](_0x54cb('0xf'),_0x5f4830,_0x25596b[_0x54cb('0x12')]['message']);return _0x3c2861(_0x25596b[_0x54cb('0x12')][_0x54cb('0x14')]);}logger[_0x54cb('0x12')](_0x54cb('0xf'),_0x5f4830,_0x25596b[_0x54cb('0x12')][_0x54cb('0x14')]);return _0x53cc33(_0x25596b['error'][_0x54cb('0x14')]);}else{logger[_0x54cb('0xe')](_0x54cb('0xf'),_0x5f4830,_0x54cb('0x11'));_0x53cc33(_0x25596b[_0x54cb('0x15')]['message']);}})[_0x54cb('0x16')](function(_0x256cf7){logger[_0x54cb('0x12')](_0x54cb('0xf'),_0x5f4830,_0x256cf7);_0x3c2861(_0x256cf7);});});}exports[_0x54cb('0x17')]=function(_0x4b4bef){var _0x4d1d19=this;return new Promise(function(_0x238364,_0x3ed6dc){return db[_0x54cb('0x18')][_0x54cb('0x19')]({'raw':_0x4b4bef[_0x54cb('0x1a')]?_0x4b4bef[_0x54cb('0x1a')][_0x54cb('0x1b')]===undefined?!![]:![]:!![],'where':_0x4b4bef[_0x54cb('0x1a')]?_0x4b4bef['options']['where']||null:null,'attributes':_0x4b4bef[_0x54cb('0x1a')]?_0x4b4bef[_0x54cb('0x1a')]['attributes']||null:null,'limit':_0x4b4bef[_0x54cb('0x1a')]?_0x4b4bef[_0x54cb('0x1a')][_0x54cb('0x1c')]||null:null,'include':_0x4b4bef[_0x54cb('0x1a')]?_0x4b4bef[_0x54cb('0x1a')][_0x54cb('0x1d')]?_[_0x54cb('0x1e')](_0x4b4bef['options']['include'],function(_0x725a5){return{'model':db[_0x725a5[_0x54cb('0x1f')]],'as':_0x725a5['as'],'attributes':_0x725a5[_0x54cb('0x20')],'include':_0x725a5[_0x54cb('0x1d')]?_['map'](_0x725a5[_0x54cb('0x1d')],function(_0x397f5f){return{'model':db[_0x397f5f[_0x54cb('0x1f')]],'as':_0x397f5f['as'],'attributes':_0x397f5f[_0x54cb('0x20')],'include':_0x397f5f[_0x54cb('0x1d')]?_[_0x54cb('0x1e')](_0x397f5f['include'],function(_0x4d6746){return{'model':db[_0x4d6746['model']],'as':_0x4d6746['as'],'attributes':_0x4d6746[_0x54cb('0x20')]};}):[]};}):[]};}):[]:[]})[_0x54cb('0xd')](function(_0x39787c){logger[_0x54cb('0xe')]('GetZohoAccount',_0x4b4bef);logger[_0x54cb('0x21')](_0x54cb('0x17'),_0x4b4bef,JSON['stringify'](_0x39787c));_0x238364(_0x39787c);})[_0x54cb('0x16')](function(_0x3cd390){logger[_0x54cb('0x12')](_0x54cb('0x17'),_0x3cd390[_0x54cb('0x14')],_0x4b4bef);_0x3ed6dc(_0x4d1d19[_0x54cb('0x12')](0x1f4,_0x3cd390[_0x54cb('0x14')]));});});};exports['ShowZohoAccount']=function(_0x469952){var _0x3d8e60=this;return new Promise(function(_0x134f14,_0x589b6b){return db[_0x54cb('0x18')][_0x54cb('0x22')]({'raw':_0x469952[_0x54cb('0x1a')]?_0x469952[_0x54cb('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x469952['options']?_0x469952[_0x54cb('0x1a')][_0x54cb('0x23')]||null:null,'attributes':_0x469952['options']?_0x469952['options'][_0x54cb('0x20')]||null:null,'include':_0x469952[_0x54cb('0x1a')]?_0x469952[_0x54cb('0x1a')]['include']?_[_0x54cb('0x1e')](_0x469952['options'][_0x54cb('0x1d')],function(_0x41de8a){return{'model':db[_0x41de8a[_0x54cb('0x1f')]],'as':_0x41de8a['as'],'attributes':_0x41de8a[_0x54cb('0x20')],'include':_0x41de8a[_0x54cb('0x1d')]?_[_0x54cb('0x1e')](_0x41de8a['include'],function(_0x59c466){return{'model':db[_0x59c466[_0x54cb('0x1f')]],'as':_0x59c466['as'],'attributes':_0x59c466[_0x54cb('0x20')],'include':_0x59c466[_0x54cb('0x1d')]?_[_0x54cb('0x1e')](_0x59c466[_0x54cb('0x1d')],function(_0x1819f3){return{'model':db[_0x1819f3['model']],'as':_0x1819f3['as'],'attributes':_0x1819f3[_0x54cb('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f3104){logger['info'](_0x54cb('0x24'),_0x469952);logger[_0x54cb('0x21')]('ShowZohoAccount',_0x469952,JSON[_0x54cb('0x25')](_0x1f3104));_0x134f14(_0x1f3104);})[_0x54cb('0x16')](function(_0x5e1bdf){logger[_0x54cb('0x12')]('ShowZohoAccount',_0x5e1bdf['message'],_0x469952);_0x589b6b(_0x3d8e60[_0x54cb('0x12')](0x1f4,_0x5e1bdf['message']));});});};
\ No newline at end of file
index 154be29..1816544 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b85=['get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intZohoConfiguration.controller'];(function(_0xd066c8,_0x46b223){var _0x369df2=function(_0x314fb9){while(--_0x314fb9){_0xd066c8['push'](_0xd066c8['shift']());}};_0x369df2(++_0x46b223);}(_0x0b85,0x168));var _0x50b8=function(_0x29a07c,_0x2987cd){_0x29a07c=_0x29a07c-0x0;var _0x252184=_0x0b85[_0x29a07c];return _0x252184;};'use strict';var multer=require('multer');var util=require(_0x50b8('0x0'));var path=require(_0x50b8('0x1'));var timeout=require(_0x50b8('0x2'));var express=require(_0x50b8('0x3'));var router=express[_0x50b8('0x4')]();var fs_extra=require(_0x50b8('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x50b8('0x6'));var controller=require(_0x50b8('0x7'));router[_0x50b8('0x8')]('/',auth[_0x50b8('0x9')](),controller[_0x50b8('0xa')]);router[_0x50b8('0x8')](_0x50b8('0xb'),auth[_0x50b8('0x9')](),controller[_0x50b8('0xc')]);router['get'](_0x50b8('0xd'),auth[_0x50b8('0x9')](),controller['getFields']);router[_0x50b8('0x8')](_0x50b8('0xe'),auth[_0x50b8('0x9')](),controller[_0x50b8('0xf')]);router[_0x50b8('0x8')](_0x50b8('0x10'),auth[_0x50b8('0x9')](),controller['getDescriptions']);router[_0x50b8('0x11')]('/',auth[_0x50b8('0x9')](),controller[_0x50b8('0x12')]);router[_0x50b8('0x13')](_0x50b8('0xb'),auth[_0x50b8('0x9')](),controller[_0x50b8('0x14')]);router[_0x50b8('0x15')](_0x50b8('0xb'),auth[_0x50b8('0x9')](),controller[_0x50b8('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0xad08=['/:id/fields','getFields','/:id/subjects','/:id/descriptions','post','put','update','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show'];(function(_0x1b5e78,_0x3b25bd){var _0x52aaf7=function(_0x58d62f){while(--_0x58d62f){_0x1b5e78['push'](_0x1b5e78['shift']());}};_0x52aaf7(++_0x3b25bd);}(_0xad08,0x1c0));var _0x8ad0=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xad08[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x8ad0('0x0'));var util=require(_0x8ad0('0x1'));var path=require('path');var timeout=require(_0x8ad0('0x2'));var express=require(_0x8ad0('0x3'));var router=express[_0x8ad0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8ad0('0x5'));var interaction=require(_0x8ad0('0x6'));var config=require(_0x8ad0('0x7'));var controller=require(_0x8ad0('0x8'));router[_0x8ad0('0x9')]('/',auth[_0x8ad0('0xa')](),controller[_0x8ad0('0xb')]);router[_0x8ad0('0x9')](_0x8ad0('0xc'),auth['isAuthenticated'](),controller[_0x8ad0('0xd')]);router[_0x8ad0('0x9')](_0x8ad0('0xe'),auth[_0x8ad0('0xa')](),controller[_0x8ad0('0xf')]);router['get'](_0x8ad0('0x10'),auth[_0x8ad0('0xa')](),controller['getSubjects']);router[_0x8ad0('0x9')](_0x8ad0('0x11'),auth[_0x8ad0('0xa')](),controller['getDescriptions']);router[_0x8ad0('0x12')]('/',auth[_0x8ad0('0xa')](),controller['create']);router[_0x8ad0('0x13')](_0x8ad0('0xc'),auth[_0x8ad0('0xa')](),controller[_0x8ad0('0x14')]);router['delete']('/:id',auth[_0x8ad0('0xa')](),controller[_0x8ad0('0x15')]);module['exports']=router;
\ No newline at end of file
index 9772a12..bbf7626 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5173=['contact','sequelize','exports','STRING','lead','nothing','ENUM','contact_lead'];(function(_0xd1308,_0x3bf065){var _0x218667=function(_0x28b087){while(--_0x28b087){_0xd1308['push'](_0xd1308['shift']());}};_0x218667(++_0x3bf065);}(_0x5173,0x109));var _0x3517=function(_0x346210,_0x272323){_0x346210=_0x346210-0x0;var _0x35536c=_0x5173[_0x346210];return _0x35536c;};'use strict';var Sequelize=require(_0x3517('0x0'));module[_0x3517('0x1')]={'name':{'type':Sequelize[_0x3517('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x3517('0x3'),'contact',_0x3517('0x4')),'defaultValue':_0x3517('0x3')},'moduleSearch':{'type':Sequelize[_0x3517('0x5')](_0x3517('0x6'),_0x3517('0x7'),_0x3517('0x3')),'defaultValue':_0x3517('0x6')},'description':{'type':Sequelize[_0x3517('0x2')]}};
\ No newline at end of file
+var _0xa318=['ENUM','lead','contact','nothing','contact_lead','sequelize','exports'];(function(_0x594bca,_0x3a8d3a){var _0x7c108=function(_0xa3f471){while(--_0xa3f471){_0x594bca['push'](_0x594bca['shift']());}};_0x7c108(++_0x3a8d3a);}(_0xa318,0xc2));var _0x8a31=function(_0x197644,_0x366eab){_0x197644=_0x197644-0x0;var _0x582b4c=_0xa318[_0x197644];return _0x582b4c;};'use strict';var Sequelize=require(_0x8a31('0x0'));module[_0x8a31('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x8a31('0x2')](_0x8a31('0x3'),_0x8a31('0x4'),_0x8a31('0x5')),'defaultValue':_0x8a31('0x3')},'moduleSearch':{'type':Sequelize['ENUM'](_0x8a31('0x6'),'contact',_0x8a31('0x3')),'defaultValue':_0x8a31('0x6')},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
index dbbf5a4..3b3e81d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf577=['name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','ZohoConfiguration','includeAll','include','findAll','catch','show','params','find','create','body','getFields','findOne','ZohoField','getSubjects','nolimit','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','stack'];(function(_0x4ffa41,_0x28b5e2){var _0x1872ce=function(_0x27d668){while(--_0x27d668){_0x4ffa41['push'](_0x4ffa41['shift']());}};_0x1872ce(++_0x28b5e2);}(_0xf577,0x1b4));var _0x7f57=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xf577[_0x1deb03];return _0x189fe7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f57('0x0'));var zipdir=require(_0x7f57('0x1'));var jsonpatch=require(_0x7f57('0x2'));var rp=require(_0x7f57('0x3'));var moment=require(_0x7f57('0x4'));var BPromise=require(_0x7f57('0x5'));var Mustache=require(_0x7f57('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7f57('0x7'));var ejs=require(_0x7f57('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7f57('0x9'));var jsforce=require(_0x7f57('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7f57('0xb'));var Redis=require(_0x7f57('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x7f57('0xd'));var as=require(_0x7f57('0xe'));var hardwareService=require(_0x7f57('0xf'));var logger=require(_0x7f57('0x10'))('api');var utils=require(_0x7f57('0x11'));var config=require(_0x7f57('0x12'));var licenseUtil=require(_0x7f57('0x13'));var db=require(_0x7f57('0x14'))['db'];function respondWithStatusCode(_0x406d14,_0x206801){_0x206801=_0x206801||0xcc;return function(_0x346ee2){if(_0x346ee2){return _0x406d14[_0x7f57('0x15')](_0x206801);}return _0x406d14[_0x7f57('0x16')](_0x206801)[_0x7f57('0x17')]();};}function respondWithResult(_0x69e3e2,_0x35f413){_0x35f413=_0x35f413||0xc8;return function(_0x1a1fae){if(_0x1a1fae){return _0x69e3e2[_0x7f57('0x16')](_0x35f413)[_0x7f57('0x18')](_0x1a1fae);}};}function respondWithFilteredResult(_0x4523fa,_0x5a4783){return function(_0x2b12ab){if(_0x2b12ab){var _0x1c2d05=typeof _0x5a4783[_0x7f57('0x19')]==='undefined'&&typeof _0x5a4783[_0x7f57('0x1a')]===_0x7f57('0x1b');var _0x18e18d=_0x2b12ab['count'];var _0x35e937=_0x1c2d05?0x0:_0x5a4783[_0x7f57('0x19')];var _0x445442=_0x1c2d05?_0x2b12ab[_0x7f57('0x1c')]:_0x5a4783[_0x7f57('0x19')]+_0x5a4783[_0x7f57('0x1a')];var _0x8a6152;if(_0x445442>=_0x18e18d){_0x445442=_0x18e18d;_0x8a6152=0xc8;}else{_0x8a6152=0xce;}_0x4523fa[_0x7f57('0x16')](_0x8a6152);return _0x4523fa[_0x7f57('0x1d')](_0x7f57('0x1e'),_0x35e937+'-'+_0x445442+'/'+_0x18e18d)[_0x7f57('0x18')](_0x2b12ab);}return null;};}function patchUpdates(_0x27eac0){return function(_0x4c957e){try{jsonpatch[_0x7f57('0x1f')](_0x4c957e,_0x27eac0,!![]);}catch(_0x697ccf){return BPromise[_0x7f57('0x20')](_0x697ccf);}return _0x4c957e[_0x7f57('0x21')]();};}function saveUpdates(_0x369aac,_0x1961be){return function(_0x3a7c28){if(_0x3a7c28){return _0x3a7c28['update'](_0x369aac)[_0x7f57('0x22')](function(_0x475fd6){return _0x475fd6;});}return null;};}function removeEntity(_0x54ac2c,_0x41a590){return function(_0x239483){if(_0x239483){return _0x239483[_0x7f57('0x23')]()[_0x7f57('0x22')](function(){_0x54ac2c[_0x7f57('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c23db,_0x4c5f8f){return function(_0x28fc97){if(!_0x28fc97){_0x5c23db['sendStatus'](0x194);}return _0x28fc97;};}function handleError(_0x487878,_0x3da562){_0x3da562=_0x3da562||0x1f4;return function(_0x58b0b8){logger[_0x7f57('0x24')](_0x58b0b8[_0x7f57('0x25')]);if(_0x58b0b8[_0x7f57('0x26')]){delete _0x58b0b8[_0x7f57('0x26')];}_0x487878[_0x7f57('0x16')](_0x3da562)[_0x7f57('0x27')](_0x58b0b8);};}exports[_0x7f57('0x28')]=function(_0x58b78a,_0x76c4b1){var _0x1eb86f={},_0x185733={},_0x3baa65={'count':0x0,'rows':[]};var _0x4e8d06=_[_0x7f57('0x29')](db['ZohoConfiguration'][_0x7f57('0x2a')],function(_0xa270fd){return{'name':_0xa270fd[_0x7f57('0x2b')],'type':_0xa270fd[_0x7f57('0x2c')][_0x7f57('0x2d')]};});_0x185733['model']=_[_0x7f57('0x29')](_0x4e8d06,_0x7f57('0x26'));_0x185733[_0x7f57('0x2e')]=_[_0x7f57('0x2f')](_0x58b78a['query']);_0x185733[_0x7f57('0x30')]=_[_0x7f57('0x31')](_0x185733[_0x7f57('0x32')],_0x185733[_0x7f57('0x2e')]);_0x1eb86f[_0x7f57('0x33')]=_[_0x7f57('0x31')](_0x185733[_0x7f57('0x32')],qs['fields'](_0x58b78a['query'][_0x7f57('0x34')]));_0x1eb86f[_0x7f57('0x33')]=_0x1eb86f[_0x7f57('0x33')][_0x7f57('0x35')]?_0x1eb86f[_0x7f57('0x33')]:_0x185733['model'];if(!_0x58b78a['query'][_0x7f57('0x36')]('nolimit')){_0x1eb86f[_0x7f57('0x1a')]=qs['limit'](_0x58b78a[_0x7f57('0x2e')][_0x7f57('0x1a')]);_0x1eb86f['offset']=qs[_0x7f57('0x19')](_0x58b78a[_0x7f57('0x2e')][_0x7f57('0x19')]);}_0x1eb86f[_0x7f57('0x37')]=qs[_0x7f57('0x38')](_0x58b78a[_0x7f57('0x2e')][_0x7f57('0x38')]);_0x1eb86f['where']=qs['filters'](_[_0x7f57('0x39')](_0x58b78a['query'],_0x185733['filters']),_0x4e8d06);if(_0x58b78a[_0x7f57('0x2e')][_0x7f57('0x3a')]){_0x1eb86f[_0x7f57('0x3b')]=_[_0x7f57('0x3c')](_0x1eb86f[_0x7f57('0x3b')],{'$or':_[_0x7f57('0x29')](_0x4e8d06,function(_0x1a7e2f){if(_0x1a7e2f[_0x7f57('0x2c')]!==_0x7f57('0x3d')){var _0x5c1f59={};_0x5c1f59[_0x1a7e2f[_0x7f57('0x26')]]={'$like':'%'+_0x58b78a[_0x7f57('0x2e')][_0x7f57('0x3a')]+'%'};return _0x5c1f59;}})});}_0x1eb86f=_['merge']({},_0x1eb86f,_0x58b78a[_0x7f57('0x3e')]);var _0x23c7f4={'where':_0x1eb86f[_0x7f57('0x3b')]};return db[_0x7f57('0x3f')]['count'](_0x23c7f4)[_0x7f57('0x22')](function(_0x319614){_0x3baa65['count']=_0x319614;if(_0x58b78a[_0x7f57('0x2e')][_0x7f57('0x40')]){_0x1eb86f[_0x7f57('0x41')]=[{'all':!![]}];}return db[_0x7f57('0x3f')][_0x7f57('0x42')](_0x1eb86f);})[_0x7f57('0x22')](function(_0x1633e4){_0x3baa65['rows']=_0x1633e4;return _0x3baa65;})[_0x7f57('0x22')](respondWithFilteredResult(_0x76c4b1,_0x1eb86f))[_0x7f57('0x43')](handleError(_0x76c4b1,null));};exports[_0x7f57('0x44')]=function(_0x4ad6e9,_0x344f0f){var _0x1b128d={'raw':![],'where':{'id':_0x4ad6e9[_0x7f57('0x45')]['id']}},_0x45e98a={};_0x45e98a[_0x7f57('0x32')]=_['keys'](db[_0x7f57('0x3f')]['rawAttributes']);_0x45e98a[_0x7f57('0x2e')]=_[_0x7f57('0x2f')](_0x4ad6e9['query']);_0x45e98a[_0x7f57('0x30')]=_[_0x7f57('0x31')](_0x45e98a[_0x7f57('0x32')],_0x45e98a['query']);_0x1b128d[_0x7f57('0x33')]=_[_0x7f57('0x31')](_0x45e98a[_0x7f57('0x32')],qs['fields'](_0x4ad6e9['query'][_0x7f57('0x34')]));_0x1b128d[_0x7f57('0x33')]=_0x1b128d[_0x7f57('0x33')]['length']?_0x1b128d[_0x7f57('0x33')]:_0x45e98a['model'];if(_0x4ad6e9[_0x7f57('0x2e')][_0x7f57('0x40')]){_0x1b128d[_0x7f57('0x41')]=[{'all':!![]}];}_0x1b128d=_['merge']({},_0x1b128d,_0x4ad6e9[_0x7f57('0x3e')]);return db[_0x7f57('0x3f')][_0x7f57('0x46')](_0x1b128d)[_0x7f57('0x22')](handleEntityNotFound(_0x344f0f,null))[_0x7f57('0x22')](respondWithResult(_0x344f0f,null))[_0x7f57('0x43')](handleError(_0x344f0f,null));};exports[_0x7f57('0x47')]=function(_0x52288e,_0x5d73cd){return db[_0x7f57('0x3f')][_0x7f57('0x47')](_0x52288e['body'],{})[_0x7f57('0x22')](respondWithResult(_0x5d73cd,0xc9))[_0x7f57('0x43')](handleError(_0x5d73cd,null));};exports['update']=function(_0xea0224,_0x41312f){if(_0xea0224[_0x7f57('0x48')]['id']){delete _0xea0224[_0x7f57('0x48')]['id'];}return db['ZohoConfiguration'][_0x7f57('0x46')]({'where':{'id':_0xea0224[_0x7f57('0x45')]['id']}})[_0x7f57('0x22')](handleEntityNotFound(_0x41312f,null))[_0x7f57('0x22')](saveUpdates(_0xea0224[_0x7f57('0x48')],null))[_0x7f57('0x22')](respondWithResult(_0x41312f,null))[_0x7f57('0x43')](handleError(_0x41312f,null));};exports[_0x7f57('0x23')]=function(_0x5673e5,_0x35fcd2){return db['ZohoConfiguration']['find']({'where':{'id':_0x5673e5[_0x7f57('0x45')]['id']}})[_0x7f57('0x22')](handleEntityNotFound(_0x35fcd2,null))[_0x7f57('0x22')](removeEntity(_0x35fcd2,null))[_0x7f57('0x43')](handleError(_0x35fcd2,null));};exports[_0x7f57('0x49')]=function(_0x151a02,_0x1b6a2b,_0xbd2934){var _0x2fd410={};var _0x5377dd={};var _0x10cc67;var _0x54af23;return db[_0x7f57('0x3f')][_0x7f57('0x4a')]({'where':{'id':_0x151a02[_0x7f57('0x45')]['id']}})['then'](handleEntityNotFound(_0x1b6a2b,null))[_0x7f57('0x22')](function(_0x360209){if(_0x360209){_0x10cc67=_0x360209;_0x5377dd[_0x7f57('0x32')]=_[_0x7f57('0x2f')](db[_0x7f57('0x4b')][_0x7f57('0x2a')]);_0x5377dd[_0x7f57('0x2e')]=_[_0x7f57('0x2f')](_0x151a02['query']);_0x5377dd[_0x7f57('0x30')]=_['intersection'](_0x5377dd[_0x7f57('0x32')],_0x5377dd['query']);_0x2fd410[_0x7f57('0x33')]=_[_0x7f57('0x31')](_0x5377dd[_0x7f57('0x32')],qs[_0x7f57('0x34')](_0x151a02['query'][_0x7f57('0x34')]));_0x2fd410[_0x7f57('0x33')]=_0x2fd410[_0x7f57('0x33')][_0x7f57('0x35')]?_0x2fd410[_0x7f57('0x33')]:_0x5377dd[_0x7f57('0x32')];_0x2fd410[_0x7f57('0x37')]=qs[_0x7f57('0x38')](_0x151a02[_0x7f57('0x2e')][_0x7f57('0x38')]);_0x2fd410[_0x7f57('0x3b')]=qs['filters'](_[_0x7f57('0x39')](_0x151a02['query'],_0x5377dd[_0x7f57('0x30')]));if(_0x151a02[_0x7f57('0x2e')][_0x7f57('0x3a')]){_0x2fd410['where']=_[_0x7f57('0x3c')](_0x2fd410[_0x7f57('0x3b')],{'$or':_[_0x7f57('0x29')](_0x2fd410[_0x7f57('0x33')],function(_0x38ee5c){var _0x2fba30={};_0x2fba30[_0x38ee5c]={'$like':'%'+_0x151a02['query'][_0x7f57('0x3a')]+'%'};return _0x2fba30;})});}_0x2fd410=_[_0x7f57('0x3c')]({},_0x2fd410,_0x151a02[_0x7f57('0x3e')]);return _0x10cc67[_0x7f57('0x49')](_0x2fd410);}})[_0x7f57('0x22')](function(_0x381be5){if(_0x381be5){_0x54af23=_0x381be5[_0x7f57('0x35')];if(!_0x151a02[_0x7f57('0x2e')]['hasOwnProperty']('nolimit')){_0x2fd410[_0x7f57('0x1a')]=qs[_0x7f57('0x1a')](_0x151a02[_0x7f57('0x2e')][_0x7f57('0x1a')]);_0x2fd410[_0x7f57('0x19')]=qs['offset'](_0x151a02[_0x7f57('0x2e')][_0x7f57('0x19')]);}return _0x10cc67[_0x7f57('0x49')](_0x2fd410);}})['then'](function(_0x4bd4d0){if(_0x4bd4d0){return _0x4bd4d0?{'count':_0x54af23,'rows':_0x4bd4d0}:null;}})[_0x7f57('0x22')](respondWithResult(_0x1b6a2b,null))[_0x7f57('0x43')](handleError(_0x1b6a2b,null));};exports['getSubjects']=function(_0xb1f7ee,_0x2771bf,_0x46c639){var _0x52e774={};var _0x117949={};var _0x2a06ae;var _0x365a92;return db['ZohoConfiguration']['findOne']({'where':{'id':_0xb1f7ee[_0x7f57('0x45')]['id']}})[_0x7f57('0x22')](handleEntityNotFound(_0x2771bf,null))[_0x7f57('0x22')](function(_0x122e94){if(_0x122e94){_0x2a06ae=_0x122e94;_0x117949['model']=_[_0x7f57('0x2f')](db[_0x7f57('0x4b')][_0x7f57('0x2a')]);_0x117949[_0x7f57('0x2e')]=_[_0x7f57('0x2f')](_0xb1f7ee[_0x7f57('0x2e')]);_0x117949[_0x7f57('0x30')]=_[_0x7f57('0x31')](_0x117949[_0x7f57('0x32')],_0x117949[_0x7f57('0x2e')]);_0x52e774['attributes']=_['intersection'](_0x117949[_0x7f57('0x32')],qs[_0x7f57('0x34')](_0xb1f7ee[_0x7f57('0x2e')][_0x7f57('0x34')]));_0x52e774[_0x7f57('0x33')]=_0x52e774[_0x7f57('0x33')][_0x7f57('0x35')]?_0x52e774[_0x7f57('0x33')]:_0x117949[_0x7f57('0x32')];_0x52e774[_0x7f57('0x37')]=qs[_0x7f57('0x38')](_0xb1f7ee[_0x7f57('0x2e')][_0x7f57('0x38')]);_0x52e774[_0x7f57('0x3b')]=qs[_0x7f57('0x30')](_[_0x7f57('0x39')](_0xb1f7ee[_0x7f57('0x2e')],_0x117949[_0x7f57('0x30')]));if(_0xb1f7ee['query']['filter']){_0x52e774[_0x7f57('0x3b')]=_[_0x7f57('0x3c')](_0x52e774[_0x7f57('0x3b')],{'$or':_[_0x7f57('0x29')](_0x52e774[_0x7f57('0x33')],function(_0x1d6be2){var _0x5c66f4={};_0x5c66f4[_0x1d6be2]={'$like':'%'+_0xb1f7ee[_0x7f57('0x2e')][_0x7f57('0x3a')]+'%'};return _0x5c66f4;})});}_0x52e774=_['merge']({},_0x52e774,_0xb1f7ee['options']);return _0x2a06ae[_0x7f57('0x4c')](_0x52e774);}})[_0x7f57('0x22')](function(_0x4566bd){if(_0x4566bd){_0x365a92=_0x4566bd[_0x7f57('0x35')];if(!_0xb1f7ee[_0x7f57('0x2e')]['hasOwnProperty'](_0x7f57('0x4d'))){_0x52e774['limit']=qs[_0x7f57('0x1a')](_0xb1f7ee['query'][_0x7f57('0x1a')]);_0x52e774[_0x7f57('0x19')]=qs[_0x7f57('0x19')](_0xb1f7ee[_0x7f57('0x2e')]['offset']);}return _0x2a06ae[_0x7f57('0x4c')](_0x52e774);}})['then'](function(_0xe8b4d4){if(_0xe8b4d4){return _0xe8b4d4?{'count':_0x365a92,'rows':_0xe8b4d4}:null;}})[_0x7f57('0x22')](respondWithResult(_0x2771bf,null))[_0x7f57('0x43')](handleError(_0x2771bf,null));};exports['getDescriptions']=function(_0x422cee,_0x4708fb,_0x2be15f){var _0x302079={};var _0x4d2d38={};var _0x1f4f8b;var _0x1f3589;return db[_0x7f57('0x3f')][_0x7f57('0x4a')]({'where':{'id':_0x422cee[_0x7f57('0x45')]['id']}})[_0x7f57('0x22')](handleEntityNotFound(_0x4708fb,null))[_0x7f57('0x22')](function(_0x46dc06){if(_0x46dc06){_0x1f4f8b=_0x46dc06;_0x4d2d38['model']=_[_0x7f57('0x2f')](db['ZohoField'][_0x7f57('0x2a')]);_0x4d2d38[_0x7f57('0x2e')]=_[_0x7f57('0x2f')](_0x422cee[_0x7f57('0x2e')]);_0x4d2d38[_0x7f57('0x30')]=_[_0x7f57('0x31')](_0x4d2d38['model'],_0x4d2d38[_0x7f57('0x2e')]);_0x302079[_0x7f57('0x33')]=_[_0x7f57('0x31')](_0x4d2d38['model'],qs['fields'](_0x422cee[_0x7f57('0x2e')][_0x7f57('0x34')]));_0x302079['attributes']=_0x302079[_0x7f57('0x33')][_0x7f57('0x35')]?_0x302079[_0x7f57('0x33')]:_0x4d2d38[_0x7f57('0x32')];_0x302079[_0x7f57('0x37')]=qs['sort'](_0x422cee[_0x7f57('0x2e')][_0x7f57('0x38')]);_0x302079['where']=qs[_0x7f57('0x30')](_[_0x7f57('0x39')](_0x422cee[_0x7f57('0x2e')],_0x4d2d38[_0x7f57('0x30')]));if(_0x422cee['query'][_0x7f57('0x3a')]){_0x302079[_0x7f57('0x3b')]=_[_0x7f57('0x3c')](_0x302079['where'],{'$or':_['map'](_0x302079[_0x7f57('0x33')],function(_0x3c5027){var _0xc45b0b={};_0xc45b0b[_0x3c5027]={'$like':'%'+_0x422cee[_0x7f57('0x2e')][_0x7f57('0x3a')]+'%'};return _0xc45b0b;})});}_0x302079=_[_0x7f57('0x3c')]({},_0x302079,_0x422cee[_0x7f57('0x3e')]);return _0x1f4f8b['getDescriptions'](_0x302079);}})[_0x7f57('0x22')](function(_0x34679e){if(_0x34679e){_0x1f3589=_0x34679e[_0x7f57('0x35')];if(!_0x422cee[_0x7f57('0x2e')][_0x7f57('0x36')]('nolimit')){_0x302079[_0x7f57('0x1a')]=qs[_0x7f57('0x1a')](_0x422cee['query'][_0x7f57('0x1a')]);_0x302079[_0x7f57('0x19')]=qs[_0x7f57('0x19')](_0x422cee[_0x7f57('0x2e')][_0x7f57('0x19')]);}return _0x1f4f8b[_0x7f57('0x4e')](_0x302079);}})[_0x7f57('0x22')](function(_0x273384){if(_0x273384){return _0x273384?{'count':_0x1f3589,'rows':_0x273384}:null;}})['then'](respondWithResult(_0x4708fb,null))[_0x7f57('0x43')](handleError(_0x4708fb,null));};
\ No newline at end of file
+var _0x8189=['hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','getFields','findOne','getSubjects','ZohoField','getDescriptions','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','apply','update','then','end','name','map','ZohoConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x8189,0x18a));var _0x9818=function(_0x1693fc,_0x19e28c){_0x1693fc=_0x1693fc-0x0;var _0x2baa58=_0x8189[_0x1693fc];return _0x2baa58;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9818('0x0'));var zipdir=require(_0x9818('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9818('0x2'));var moment=require('moment');var BPromise=require(_0x9818('0x3'));var Mustache=require(_0x9818('0x4'));var util=require(_0x9818('0x5'));var path=require(_0x9818('0x6'));var sox=require(_0x9818('0x7'));var csv=require(_0x9818('0x8'));var ejs=require(_0x9818('0x9'));var fs=require('fs');var fs_extra=require(_0x9818('0xa'));var _=require('lodash');var squel=require(_0x9818('0xb'));var crypto=require(_0x9818('0xc'));var jsforce=require(_0x9818('0xd'));var deskjs=require(_0x9818('0xe'));var toCsv=require(_0x9818('0x8'));var querystring=require(_0x9818('0xf'));var Papa=require(_0x9818('0x10'));var Redis=require(_0x9818('0x11'));var authService=require(_0x9818('0x12'));var qs=require(_0x9818('0x13'));var as=require(_0x9818('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9818('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x9818('0x16'));var licenseUtil=require(_0x9818('0x17'));var db=require(_0x9818('0x18'))['db'];function respondWithStatusCode(_0x3259fc,_0x3c7b8c){_0x3c7b8c=_0x3c7b8c||0xcc;return function(_0x54525f){if(_0x54525f){return _0x3259fc['sendStatus'](_0x3c7b8c);}return _0x3259fc['status'](_0x3c7b8c)['end']();};}function respondWithResult(_0x2e7e2c,_0x4dd221){_0x4dd221=_0x4dd221||0xc8;return function(_0x3d8b75){if(_0x3d8b75){return _0x2e7e2c[_0x9818('0x19')](_0x4dd221)['json'](_0x3d8b75);}};}function respondWithFilteredResult(_0x2c95c4,_0x52d0c3){return function(_0x2f8257){if(_0x2f8257){var _0x4d61bc=typeof _0x52d0c3[_0x9818('0x1a')]===_0x9818('0x1b')&&typeof _0x52d0c3[_0x9818('0x1c')]===_0x9818('0x1b');var _0x2e9e50=_0x2f8257[_0x9818('0x1d')];var _0x335ddc=_0x4d61bc?0x0:_0x52d0c3[_0x9818('0x1a')];var _0x2656d1=_0x4d61bc?_0x2f8257[_0x9818('0x1d')]:_0x52d0c3['offset']+_0x52d0c3['limit'];var _0x3e056e;if(_0x2656d1>=_0x2e9e50){_0x2656d1=_0x2e9e50;_0x3e056e=0xc8;}else{_0x3e056e=0xce;}_0x2c95c4[_0x9818('0x19')](_0x3e056e);return _0x2c95c4[_0x9818('0x1e')](_0x9818('0x1f'),_0x335ddc+'-'+_0x2656d1+'/'+_0x2e9e50)['json'](_0x2f8257);}return null;};}function patchUpdates(_0x1e88f0){return function(_0x4cea63){try{jsonpatch[_0x9818('0x20')](_0x4cea63,_0x1e88f0,!![]);}catch(_0x21ba1f){return BPromise['reject'](_0x21ba1f);}return _0x4cea63['save']();};}function saveUpdates(_0x412ed0,_0x22dded){return function(_0x224876){if(_0x224876){return _0x224876[_0x9818('0x21')](_0x412ed0)[_0x9818('0x22')](function(_0x1e1f09){return _0x1e1f09;});}return null;};}function removeEntity(_0x3fe0f6,_0x2553f8){return function(_0xfb8dbc){if(_0xfb8dbc){return _0xfb8dbc['destroy']()[_0x9818('0x22')](function(){_0x3fe0f6[_0x9818('0x19')](0xcc)[_0x9818('0x23')]();});}};}function handleEntityNotFound(_0x57adf0,_0x72bcc3){return function(_0x20cb0f){if(!_0x20cb0f){_0x57adf0['sendStatus'](0x194);}return _0x20cb0f;};}function handleError(_0x10ffcd,_0x592bab){_0x592bab=_0x592bab||0x1f4;return function(_0x5b554a){logger['error'](_0x5b554a['stack']);if(_0x5b554a[_0x9818('0x24')]){delete _0x5b554a[_0x9818('0x24')];}_0x10ffcd[_0x9818('0x19')](_0x592bab)['send'](_0x5b554a);};}exports['index']=function(_0x36467a,_0x5740ca){var _0xa029d9={},_0x5ace70={},_0x35e166={'count':0x0,'rows':[]};var _0x299673=_[_0x9818('0x25')](db[_0x9818('0x26')][_0x9818('0x27')],function(_0x8208db){return{'name':_0x8208db['fieldName'],'type':_0x8208db[_0x9818('0x28')][_0x9818('0x29')]};});_0x5ace70[_0x9818('0x2a')]=_[_0x9818('0x25')](_0x299673,'name');_0x5ace70[_0x9818('0x2b')]=_[_0x9818('0x2c')](_0x36467a[_0x9818('0x2b')]);_0x5ace70[_0x9818('0x2d')]=_[_0x9818('0x2e')](_0x5ace70[_0x9818('0x2a')],_0x5ace70['query']);_0xa029d9[_0x9818('0x2f')]=_[_0x9818('0x2e')](_0x5ace70[_0x9818('0x2a')],qs[_0x9818('0x30')](_0x36467a[_0x9818('0x2b')][_0x9818('0x30')]));_0xa029d9[_0x9818('0x2f')]=_0xa029d9['attributes'][_0x9818('0x31')]?_0xa029d9['attributes']:_0x5ace70[_0x9818('0x2a')];if(!_0x36467a[_0x9818('0x2b')][_0x9818('0x32')](_0x9818('0x33'))){_0xa029d9[_0x9818('0x1c')]=qs[_0x9818('0x1c')](_0x36467a[_0x9818('0x2b')][_0x9818('0x1c')]);_0xa029d9['offset']=qs[_0x9818('0x1a')](_0x36467a[_0x9818('0x2b')][_0x9818('0x1a')]);}_0xa029d9[_0x9818('0x34')]=qs[_0x9818('0x35')](_0x36467a[_0x9818('0x2b')][_0x9818('0x35')]);_0xa029d9['where']=qs[_0x9818('0x2d')](_[_0x9818('0x36')](_0x36467a['query'],_0x5ace70[_0x9818('0x2d')]),_0x299673);if(_0x36467a[_0x9818('0x2b')][_0x9818('0x37')]){_0xa029d9[_0x9818('0x38')]=_['merge'](_0xa029d9[_0x9818('0x38')],{'$or':_[_0x9818('0x25')](_0x299673,function(_0x3b94af){if(_0x3b94af['type']!==_0x9818('0x39')){var _0x149fd6={};_0x149fd6[_0x3b94af[_0x9818('0x24')]]={'$like':'%'+_0x36467a[_0x9818('0x2b')][_0x9818('0x37')]+'%'};return _0x149fd6;}})});}_0xa029d9=_[_0x9818('0x3a')]({},_0xa029d9,_0x36467a[_0x9818('0x3b')]);var _0x2ad63a={'where':_0xa029d9[_0x9818('0x38')]};return db[_0x9818('0x26')]['count'](_0x2ad63a)[_0x9818('0x22')](function(_0x660ee4){_0x35e166['count']=_0x660ee4;if(_0x36467a[_0x9818('0x2b')][_0x9818('0x3c')]){_0xa029d9[_0x9818('0x3d')]=[{'all':!![]}];}return db[_0x9818('0x26')][_0x9818('0x3e')](_0xa029d9);})['then'](function(_0x3eded6){_0x35e166['rows']=_0x3eded6;return _0x35e166;})[_0x9818('0x22')](respondWithFilteredResult(_0x5740ca,_0xa029d9))[_0x9818('0x3f')](handleError(_0x5740ca,null));};exports[_0x9818('0x40')]=function(_0x456f46,_0x781174){var _0xc055f8={'raw':![],'where':{'id':_0x456f46[_0x9818('0x41')]['id']}},_0xbdf229={};_0xbdf229[_0x9818('0x2a')]=_[_0x9818('0x2c')](db[_0x9818('0x26')][_0x9818('0x27')]);_0xbdf229['query']=_[_0x9818('0x2c')](_0x456f46[_0x9818('0x2b')]);_0xbdf229[_0x9818('0x2d')]=_[_0x9818('0x2e')](_0xbdf229[_0x9818('0x2a')],_0xbdf229[_0x9818('0x2b')]);_0xc055f8[_0x9818('0x2f')]=_[_0x9818('0x2e')](_0xbdf229[_0x9818('0x2a')],qs[_0x9818('0x30')](_0x456f46[_0x9818('0x2b')][_0x9818('0x30')]));_0xc055f8['attributes']=_0xc055f8[_0x9818('0x2f')][_0x9818('0x31')]?_0xc055f8[_0x9818('0x2f')]:_0xbdf229['model'];if(_0x456f46[_0x9818('0x2b')][_0x9818('0x3c')]){_0xc055f8[_0x9818('0x3d')]=[{'all':!![]}];}_0xc055f8=_[_0x9818('0x3a')]({},_0xc055f8,_0x456f46[_0x9818('0x3b')]);return db[_0x9818('0x26')][_0x9818('0x42')](_0xc055f8)[_0x9818('0x22')](handleEntityNotFound(_0x781174,null))['then'](respondWithResult(_0x781174,null))[_0x9818('0x3f')](handleError(_0x781174,null));};exports[_0x9818('0x43')]=function(_0x3e8382,_0x15d3c3){return db[_0x9818('0x26')][_0x9818('0x43')](_0x3e8382[_0x9818('0x44')],{})[_0x9818('0x22')](respondWithResult(_0x15d3c3,0xc9))[_0x9818('0x3f')](handleError(_0x15d3c3,null));};exports[_0x9818('0x21')]=function(_0x5a6cf8,_0x3e8445){if(_0x5a6cf8[_0x9818('0x44')]['id']){delete _0x5a6cf8[_0x9818('0x44')]['id'];}return db[_0x9818('0x26')]['find']({'where':{'id':_0x5a6cf8[_0x9818('0x41')]['id']}})[_0x9818('0x22')](handleEntityNotFound(_0x3e8445,null))['then'](saveUpdates(_0x5a6cf8['body'],null))['then'](respondWithResult(_0x3e8445,null))['catch'](handleError(_0x3e8445,null));};exports['destroy']=function(_0x358f2c,_0x1e14e2){return db[_0x9818('0x26')]['find']({'where':{'id':_0x358f2c[_0x9818('0x41')]['id']}})[_0x9818('0x22')](handleEntityNotFound(_0x1e14e2,null))[_0x9818('0x22')](removeEntity(_0x1e14e2,null))[_0x9818('0x3f')](handleError(_0x1e14e2,null));};exports[_0x9818('0x45')]=function(_0x1103a0,_0x3bd746,_0x212e47){var _0x210c17={};var _0x27be77={};var _0x5d17c0;var _0x42b3f4;return db['ZohoConfiguration'][_0x9818('0x46')]({'where':{'id':_0x1103a0['params']['id']}})[_0x9818('0x22')](handleEntityNotFound(_0x3bd746,null))[_0x9818('0x22')](function(_0xa42fd2){if(_0xa42fd2){_0x5d17c0=_0xa42fd2;_0x27be77['model']=_[_0x9818('0x2c')](db['ZohoField']['rawAttributes']);_0x27be77[_0x9818('0x2b')]=_['keys'](_0x1103a0[_0x9818('0x2b')]);_0x27be77[_0x9818('0x2d')]=_[_0x9818('0x2e')](_0x27be77['model'],_0x27be77[_0x9818('0x2b')]);_0x210c17[_0x9818('0x2f')]=_[_0x9818('0x2e')](_0x27be77[_0x9818('0x2a')],qs[_0x9818('0x30')](_0x1103a0['query'][_0x9818('0x30')]));_0x210c17[_0x9818('0x2f')]=_0x210c17[_0x9818('0x2f')][_0x9818('0x31')]?_0x210c17['attributes']:_0x27be77[_0x9818('0x2a')];_0x210c17[_0x9818('0x34')]=qs['sort'](_0x1103a0[_0x9818('0x2b')][_0x9818('0x35')]);_0x210c17['where']=qs[_0x9818('0x2d')](_['pick'](_0x1103a0[_0x9818('0x2b')],_0x27be77['filters']));if(_0x1103a0[_0x9818('0x2b')][_0x9818('0x37')]){_0x210c17[_0x9818('0x38')]=_[_0x9818('0x3a')](_0x210c17[_0x9818('0x38')],{'$or':_[_0x9818('0x25')](_0x210c17[_0x9818('0x2f')],function(_0x2d6c87){var _0x58f0bc={};_0x58f0bc[_0x2d6c87]={'$like':'%'+_0x1103a0['query'][_0x9818('0x37')]+'%'};return _0x58f0bc;})});}_0x210c17=_[_0x9818('0x3a')]({},_0x210c17,_0x1103a0[_0x9818('0x3b')]);return _0x5d17c0[_0x9818('0x45')](_0x210c17);}})['then'](function(_0x4aeebf){if(_0x4aeebf){_0x42b3f4=_0x4aeebf[_0x9818('0x31')];if(!_0x1103a0[_0x9818('0x2b')]['hasOwnProperty'](_0x9818('0x33'))){_0x210c17[_0x9818('0x1c')]=qs[_0x9818('0x1c')](_0x1103a0[_0x9818('0x2b')]['limit']);_0x210c17[_0x9818('0x1a')]=qs[_0x9818('0x1a')](_0x1103a0[_0x9818('0x2b')]['offset']);}return _0x5d17c0[_0x9818('0x45')](_0x210c17);}})[_0x9818('0x22')](function(_0x4e0e60){if(_0x4e0e60){return _0x4e0e60?{'count':_0x42b3f4,'rows':_0x4e0e60}:null;}})['then'](respondWithResult(_0x3bd746,null))[_0x9818('0x3f')](handleError(_0x3bd746,null));};exports[_0x9818('0x47')]=function(_0x1e76ed,_0x142afa,_0x52f50b){var _0x5a3698={};var _0x58ff06={};var _0x316ca3;var _0x4e8b5a;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x1e76ed[_0x9818('0x41')]['id']}})[_0x9818('0x22')](handleEntityNotFound(_0x142afa,null))[_0x9818('0x22')](function(_0x4db7e2){if(_0x4db7e2){_0x316ca3=_0x4db7e2;_0x58ff06[_0x9818('0x2a')]=_[_0x9818('0x2c')](db[_0x9818('0x48')][_0x9818('0x27')]);_0x58ff06['query']=_['keys'](_0x1e76ed['query']);_0x58ff06[_0x9818('0x2d')]=_[_0x9818('0x2e')](_0x58ff06[_0x9818('0x2a')],_0x58ff06['query']);_0x5a3698['attributes']=_[_0x9818('0x2e')](_0x58ff06[_0x9818('0x2a')],qs[_0x9818('0x30')](_0x1e76ed[_0x9818('0x2b')][_0x9818('0x30')]));_0x5a3698[_0x9818('0x2f')]=_0x5a3698[_0x9818('0x2f')][_0x9818('0x31')]?_0x5a3698[_0x9818('0x2f')]:_0x58ff06[_0x9818('0x2a')];_0x5a3698[_0x9818('0x34')]=qs[_0x9818('0x35')](_0x1e76ed[_0x9818('0x2b')][_0x9818('0x35')]);_0x5a3698['where']=qs[_0x9818('0x2d')](_[_0x9818('0x36')](_0x1e76ed[_0x9818('0x2b')],_0x58ff06[_0x9818('0x2d')]));if(_0x1e76ed[_0x9818('0x2b')][_0x9818('0x37')]){_0x5a3698[_0x9818('0x38')]=_[_0x9818('0x3a')](_0x5a3698[_0x9818('0x38')],{'$or':_[_0x9818('0x25')](_0x5a3698[_0x9818('0x2f')],function(_0x333a06){var _0x54cf11={};_0x54cf11[_0x333a06]={'$like':'%'+_0x1e76ed[_0x9818('0x2b')]['filter']+'%'};return _0x54cf11;})});}_0x5a3698=_[_0x9818('0x3a')]({},_0x5a3698,_0x1e76ed['options']);return _0x316ca3[_0x9818('0x47')](_0x5a3698);}})['then'](function(_0x5842eb){if(_0x5842eb){_0x4e8b5a=_0x5842eb[_0x9818('0x31')];if(!_0x1e76ed[_0x9818('0x2b')][_0x9818('0x32')](_0x9818('0x33'))){_0x5a3698[_0x9818('0x1c')]=qs[_0x9818('0x1c')](_0x1e76ed[_0x9818('0x2b')]['limit']);_0x5a3698[_0x9818('0x1a')]=qs[_0x9818('0x1a')](_0x1e76ed[_0x9818('0x2b')]['offset']);}return _0x316ca3[_0x9818('0x47')](_0x5a3698);}})[_0x9818('0x22')](function(_0x4f26f5){if(_0x4f26f5){return _0x4f26f5?{'count':_0x4e8b5a,'rows':_0x4f26f5}:null;}})[_0x9818('0x22')](respondWithResult(_0x142afa,null))[_0x9818('0x3f')](handleError(_0x142afa,null));};exports[_0x9818('0x49')]=function(_0xe7bad1,_0x95e957,_0x359a12){var _0x5ac630={};var _0xe8ec18={};var _0x41ecdf;var _0x1c038f;return db[_0x9818('0x26')]['findOne']({'where':{'id':_0xe7bad1[_0x9818('0x41')]['id']}})[_0x9818('0x22')](handleEntityNotFound(_0x95e957,null))[_0x9818('0x22')](function(_0x3ad6e4){if(_0x3ad6e4){_0x41ecdf=_0x3ad6e4;_0xe8ec18[_0x9818('0x2a')]=_['keys'](db[_0x9818('0x48')][_0x9818('0x27')]);_0xe8ec18[_0x9818('0x2b')]=_['keys'](_0xe7bad1['query']);_0xe8ec18['filters']=_[_0x9818('0x2e')](_0xe8ec18[_0x9818('0x2a')],_0xe8ec18[_0x9818('0x2b')]);_0x5ac630[_0x9818('0x2f')]=_[_0x9818('0x2e')](_0xe8ec18[_0x9818('0x2a')],qs[_0x9818('0x30')](_0xe7bad1[_0x9818('0x2b')][_0x9818('0x30')]));_0x5ac630[_0x9818('0x2f')]=_0x5ac630[_0x9818('0x2f')][_0x9818('0x31')]?_0x5ac630[_0x9818('0x2f')]:_0xe8ec18['model'];_0x5ac630[_0x9818('0x34')]=qs['sort'](_0xe7bad1[_0x9818('0x2b')][_0x9818('0x35')]);_0x5ac630[_0x9818('0x38')]=qs[_0x9818('0x2d')](_[_0x9818('0x36')](_0xe7bad1[_0x9818('0x2b')],_0xe8ec18[_0x9818('0x2d')]));if(_0xe7bad1[_0x9818('0x2b')]['filter']){_0x5ac630['where']=_[_0x9818('0x3a')](_0x5ac630['where'],{'$or':_[_0x9818('0x25')](_0x5ac630[_0x9818('0x2f')],function(_0xe44e13){var _0x54bdce={};_0x54bdce[_0xe44e13]={'$like':'%'+_0xe7bad1[_0x9818('0x2b')][_0x9818('0x37')]+'%'};return _0x54bdce;})});}_0x5ac630=_[_0x9818('0x3a')]({},_0x5ac630,_0xe7bad1['options']);return _0x41ecdf['getDescriptions'](_0x5ac630);}})[_0x9818('0x22')](function(_0x2980af){if(_0x2980af){_0x1c038f=_0x2980af['length'];if(!_0xe7bad1[_0x9818('0x2b')][_0x9818('0x32')](_0x9818('0x33'))){_0x5ac630['limit']=qs['limit'](_0xe7bad1['query'][_0x9818('0x1c')]);_0x5ac630[_0x9818('0x1a')]=qs[_0x9818('0x1a')](_0xe7bad1[_0x9818('0x2b')]['offset']);}return _0x41ecdf[_0x9818('0x49')](_0x5ac630);}})[_0x9818('0x22')](function(_0x5a0212){if(_0x5a0212){return _0x5a0212?{'count':_0x1c038f,'rows':_0x5a0212}:null;}})[_0x9818('0x22')](respondWithResult(_0x95e957,null))['catch'](handleError(_0x95e957,null));};
\ No newline at end of file
index 402fb9c..c011ce1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1ae3=['./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x472ea3,_0x105de8){var _0x16908d=function(_0x372a45){while(--_0x372a45){_0x472ea3['push'](_0x472ea3['shift']());}};_0x16908d(++_0x105de8);}(_0x1ae3,0x185));var _0x31ae=function(_0x2ca4d1,_0x148124){_0x2ca4d1=_0x2ca4d1-0x0;var _0x45589a=_0x1ae3[_0x2ca4d1];return _0x45589a;};'use strict';var _=require(_0x31ae('0x0'));var util=require(_0x31ae('0x1'));var logger=require(_0x31ae('0x2'))(_0x31ae('0x3'));var moment=require('moment');var BPromise=require(_0x31ae('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x31ae('0x5'));var rimraf=require(_0x31ae('0x6'));var config=require('../../config/environment');var attributes=require(_0x31ae('0x7'));module[_0x31ae('0x8')]=function(_0x5703d9,_0x3c5cf0){return _0x5703d9[_0x31ae('0x9')](_0x31ae('0xa'),attributes,{'tableName':_0x31ae('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2a3f=['./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x4b0ce4,_0xf7fc8a){var _0x1e441a=function(_0xc99a4d){while(--_0xc99a4d){_0x4b0ce4['push'](_0x4b0ce4['shift']());}};_0x1e441a(++_0xf7fc8a);}(_0x2a3f,0x1b5));var _0xf2a3=function(_0x4c3ece,_0x57053e){_0x4c3ece=_0x4c3ece-0x0;var _0x409c1d=_0x2a3f[_0x4c3ece];return _0x409c1d;};'use strict';var _=require(_0xf2a3('0x0'));var util=require(_0xf2a3('0x1'));var logger=require('../../config/logger')(_0xf2a3('0x2'));var moment=require(_0xf2a3('0x3'));var BPromise=require(_0xf2a3('0x4'));var rp=require(_0xf2a3('0x5'));var fs=require('fs');var path=require(_0xf2a3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf2a3('0x7'));module[_0xf2a3('0x8')]=function(_0x1f4313,_0x1246b0){return _0x1f4313[_0xf2a3('0x9')](_0xf2a3('0xa'),attributes,{'tableName':_0xf2a3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2f24a94..5af5b7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91a6=['catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoConfiguration,\x20%s,\x20%s','message'];(function(_0x4364b7,_0x3bf7cd){var _0xbd9b20=function(_0x8dc270){while(--_0x8dc270){_0x4364b7['push'](_0x4364b7['shift']());}};_0xbd9b20(++_0x3bf7cd);}(_0x91a6,0x1cd));var _0x691a=function(_0x32cacc,_0x5a6409){_0x32cacc=_0x32cacc-0x0;var _0x39ecd5=_0x91a6[_0x32cacc];return _0x39ecd5;};'use strict';var _=require(_0x691a('0x0'));var util=require(_0x691a('0x1'));var moment=require(_0x691a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x691a('0x3'))['db'];var utils=require(_0x691a('0x4'));var logger=require(_0x691a('0x5'))(_0x691a('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x691a('0x7')][_0x691a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x48f2b2,_0x3c48ca,_0x13bcb7){return new BPromise(function(_0x23619e,_0x61094){return client[_0x691a('0x9')](_0x48f2b2,_0x13bcb7)['then'](function(_0x449b42){logger[_0x691a('0xa')]('ZohoConfiguration,\x20%s,\x20%s',_0x3c48ca,_0x691a('0xb'));logger[_0x691a('0xc')](_0x691a('0xd'),_0x3c48ca,_0x691a('0xb'),JSON[_0x691a('0xe')](_0x449b42));if(_0x449b42[_0x691a('0xf')]){if(_0x449b42['error'][_0x691a('0x10')]===0x1f4){logger['error'](_0x691a('0x11'),_0x3c48ca,_0x449b42[_0x691a('0xf')][_0x691a('0x12')]);return _0x61094(_0x449b42[_0x691a('0xf')]['message']);}logger[_0x691a('0xf')](_0x691a('0x11'),_0x3c48ca,_0x449b42['error'][_0x691a('0x12')]);return _0x23619e(_0x449b42['error'][_0x691a('0x12')]);}else{logger[_0x691a('0xa')]('ZohoConfiguration,\x20%s,\x20%s',_0x3c48ca,_0x691a('0xb'));_0x23619e(_0x449b42['result'][_0x691a('0x12')]);}})[_0x691a('0x13')](function(_0x5dc0e9){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x3c48ca,_0x5dc0e9);_0x61094(_0x5dc0e9);});});}
\ No newline at end of file
+var _0xa18c=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird'];(function(_0x29d802,_0x12878c){var _0x36dd2d=function(_0x26ba77){while(--_0x26ba77){_0x29d802['push'](_0x29d802['shift']());}};_0x36dd2d(++_0x12878c);}(_0xa18c,0x1c9));var _0xca18=function(_0x36bb93,_0xd98721){_0x36bb93=_0x36bb93-0x0;var _0x3cabb5=_0xa18c[_0x36bb93];return _0x3cabb5;};'use strict';var _=require(_0xca18('0x0'));var util=require('util');var moment=require(_0xca18('0x1'));var BPromise=require(_0xca18('0x2'));var rs=require(_0xca18('0x3'));var fs=require('fs');var Redis=require(_0xca18('0x4'));var db=require(_0xca18('0x5'))['db'];var utils=require(_0xca18('0x6'));var logger=require(_0xca18('0x7'))(_0xca18('0x8'));var config=require('../../config/environment');var jayson=require(_0xca18('0x9'));var client=jayson[_0xca18('0xa')][_0xca18('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x549724,_0x5a1bee,_0x446c10){return new BPromise(function(_0x421c7d,_0x20eb26){return client[_0xca18('0xc')](_0x549724,_0x446c10)['then'](function(_0x561502){logger[_0xca18('0xd')]('ZohoConfiguration,\x20%s,\x20%s',_0x5a1bee,_0xca18('0xe'));logger[_0xca18('0xf')](_0xca18('0x10'),_0x5a1bee,_0xca18('0xe'),JSON['stringify'](_0x561502));if(_0x561502[_0xca18('0x11')]){if(_0x561502[_0xca18('0x11')][_0xca18('0x12')]===0x1f4){logger[_0xca18('0x11')](_0xca18('0x13'),_0x5a1bee,_0x561502[_0xca18('0x11')]['message']);return _0x20eb26(_0x561502[_0xca18('0x11')]['message']);}logger[_0xca18('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x5a1bee,_0x561502['error'][_0xca18('0x14')]);return _0x421c7d(_0x561502[_0xca18('0x11')][_0xca18('0x14')]);}else{logger['info'](_0xca18('0x13'),_0x5a1bee,_0xca18('0xe'));_0x421c7d(_0x561502[_0xca18('0x15')]['message']);}})[_0xca18('0x16')](function(_0x432c77){logger[_0xca18('0x11')](_0xca18('0x13'),_0x5a1bee,_0x432c77);_0x20eb26(_0x432c77);});});}
\ No newline at end of file
index 96202ea..a4980d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88f2=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','index','/:id','show','post','create','put'];(function(_0x1a0eda,_0xa53b9e){var _0x4fad57=function(_0x25f47f){while(--_0x25f47f){_0x1a0eda['push'](_0x1a0eda['shift']());}};_0x4fad57(++_0xa53b9e);}(_0x88f2,0xd5));var _0x288f=function(_0x88a159,_0x549558){_0x88a159=_0x88a159-0x0;var _0x5139e8=_0x88f2[_0x88a159];return _0x5139e8;};'use strict';var multer=require(_0x288f('0x0'));var util=require(_0x288f('0x1'));var path=require(_0x288f('0x2'));var timeout=require(_0x288f('0x3'));var express=require(_0x288f('0x4'));var router=express[_0x288f('0x5')]();var fs_extra=require(_0x288f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x288f('0x7'));var config=require(_0x288f('0x8'));var controller=require(_0x288f('0x9'));router[_0x288f('0xa')]('/',auth[_0x288f('0xb')](),controller[_0x288f('0xc')]);router[_0x288f('0xa')](_0x288f('0xd'),auth[_0x288f('0xb')](),controller[_0x288f('0xe')]);router[_0x288f('0xf')]('/',auth[_0x288f('0xb')](),controller[_0x288f('0x10')]);router[_0x288f('0x11')](_0x288f('0xd'),auth['isAuthenticated'](),controller[_0x288f('0x12')]);router['delete'](_0x288f('0xd'),auth[_0x288f('0xb')](),controller[_0x288f('0x13')]);module[_0x288f('0x14')]=router;
\ No newline at end of file
+var _0x98c7=['post','create','update','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x6baee6,_0x2e9e55){var _0x29d246=function(_0x39bbf2){while(--_0x39bbf2){_0x6baee6['push'](_0x6baee6['shift']());}};_0x29d246(++_0x2e9e55);}(_0x98c7,0x1f1));var _0x798c=function(_0x23e6bb,_0x5c2d69){_0x23e6bb=_0x23e6bb-0x0;var _0x1e3b4c=_0x98c7[_0x23e6bb];return _0x1e3b4c;};'use strict';var multer=require(_0x798c('0x0'));var util=require('util');var path=require(_0x798c('0x1'));var timeout=require(_0x798c('0x2'));var express=require(_0x798c('0x3'));var router=express[_0x798c('0x4')]();var fs_extra=require(_0x798c('0x5'));var auth=require(_0x798c('0x6'));var interaction=require(_0x798c('0x7'));var config=require(_0x798c('0x8'));var controller=require('./intZohoField.controller');router[_0x798c('0x9')]('/',auth[_0x798c('0xa')](),controller[_0x798c('0xb')]);router[_0x798c('0x9')](_0x798c('0xc'),auth[_0x798c('0xa')](),controller['show']);router[_0x798c('0xd')]('/',auth[_0x798c('0xa')](),controller[_0x798c('0xe')]);router['put'](_0x798c('0xc'),auth['isAuthenticated'](),controller[_0x798c('0xf')]);router['delete'](_0x798c('0xc'),auth[_0x798c('0xa')](),controller['destroy']);module[_0x798c('0x10')]=router;
\ No newline at end of file
index 5231fae..8f9dee8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8342=['ENUM','customVariable','BOOLEAN','sequelize','exports','variable','keyValue','picklist','string','STRING'];(function(_0x37cb14,_0x28abe0){var _0xf304fd=function(_0x13b3f2){while(--_0x13b3f2){_0x37cb14['push'](_0x37cb14['shift']());}};_0xf304fd(++_0x28abe0);}(_0x8342,0x107));var _0x2834=function(_0x42182d,_0x125b1a){_0x42182d=_0x42182d-0x0;var _0x26459b=_0x8342[_0x42182d];return _0x26459b;};'use strict';var Sequelize=require(_0x2834('0x0'));module[_0x2834('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x2834('0x2'),'customVariable',_0x2834('0x3'),_0x2834('0x4')),'defaultValue':_0x2834('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2834('0x6')]},'keyType':{'type':Sequelize[_0x2834('0x7')](_0x2834('0x5'),_0x2834('0x2'),_0x2834('0x8'))},'keyContent':{'type':Sequelize[_0x2834('0x6')]},'idField':{'type':Sequelize[_0x2834('0x6')]},'nameField':{'type':Sequelize[_0x2834('0x6')]},'customField':{'type':Sequelize[_0x2834('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2834('0x6')]}};
\ No newline at end of file
+var _0x671b=['STRING','ENUM','exports','variable','customVariable','keyValue','picklist','string'];(function(_0x4dab6e,_0x42a95b){var _0x5539d7=function(_0xbdfdfa){while(--_0xbdfdfa){_0x4dab6e['push'](_0x4dab6e['shift']());}};_0x5539d7(++_0x42a95b);}(_0x671b,0x10a));var _0xb671=function(_0x313811,_0x2842f5){_0x313811=_0x313811-0x0;var _0x1d6702=_0x671b[_0x313811];return _0x1d6702;};'use strict';var Sequelize=require('sequelize');module[_0xb671('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0xb671('0x1'),_0xb671('0x2'),_0xb671('0x3'),_0xb671('0x4')),'defaultValue':_0xb671('0x5')},'content':{'type':Sequelize[_0xb671('0x6')]},'key':{'type':Sequelize[_0xb671('0x6')]},'keyType':{'type':Sequelize[_0xb671('0x7')](_0xb671('0x5'),'variable',_0xb671('0x2'))},'keyContent':{'type':Sequelize[_0xb671('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb671('0x6')]}};
\ No newline at end of file
index 5ef65df..78b5f0f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7c8=['to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','then','destroy','error','name','send','index','map','ZohoField','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','includeAll','include','rows','show','keys','find','create','body','params','catch','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox'];(function(_0x115621,_0x341cde){var _0x5ef5ce=function(_0x2ca3f2){while(--_0x2ca3f2){_0x115621['push'](_0x115621['shift']());}};_0x5ef5ce(++_0x341cde);}(_0xa7c8,0x82));var _0x8a7c=function(_0x84e25e,_0x29211f){_0x84e25e=_0x84e25e-0x0;var _0x26a3ce=_0xa7c8[_0x84e25e];return _0x26a3ce;};'use strict';var emlformat=require(_0x8a7c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8a7c('0x1'));var jsonpatch=require(_0x8a7c('0x2'));var rp=require(_0x8a7c('0x3'));var moment=require('moment');var BPromise=require(_0x8a7c('0x4'));var Mustache=require('mustache');var util=require(_0x8a7c('0x5'));var path=require(_0x8a7c('0x6'));var sox=require(_0x8a7c('0x7'));var csv=require(_0x8a7c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a7c('0x9'));var _=require('lodash');var squel=require(_0x8a7c('0xa'));var crypto=require(_0x8a7c('0xb'));var jsforce=require(_0x8a7c('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8a7c('0xd'));var Papa=require(_0x8a7c('0xe'));var Redis=require(_0x8a7c('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8a7c('0x10'));var hardwareService=require(_0x8a7c('0x11'));var logger=require(_0x8a7c('0x12'))(_0x8a7c('0x13'));var utils=require(_0x8a7c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8a7c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa89e8e,_0x25aea2){_0x25aea2=_0x25aea2||0xcc;return function(_0x7b2382){if(_0x7b2382){return _0xa89e8e[_0x8a7c('0x16')](_0x25aea2);}return _0xa89e8e[_0x8a7c('0x17')](_0x25aea2)[_0x8a7c('0x18')]();};}function respondWithResult(_0x682348,_0x1de2e3){_0x1de2e3=_0x1de2e3||0xc8;return function(_0xca119a){if(_0xca119a){return _0x682348[_0x8a7c('0x17')](_0x1de2e3)[_0x8a7c('0x19')](_0xca119a);}};}function respondWithFilteredResult(_0x218e02,_0xe5c029){return function(_0x3ad57b){if(_0x3ad57b){var _0x509eb5=typeof _0xe5c029[_0x8a7c('0x1a')]===_0x8a7c('0x1b')&&typeof _0xe5c029['limit']===_0x8a7c('0x1b');var _0xcb241b=_0x3ad57b[_0x8a7c('0x1c')];var _0x2615ec=_0x509eb5?0x0:_0xe5c029['offset'];var _0x61dd44=_0x509eb5?_0x3ad57b[_0x8a7c('0x1c')]:_0xe5c029['offset']+_0xe5c029[_0x8a7c('0x1d')];var _0x216f44;if(_0x61dd44>=_0xcb241b){_0x61dd44=_0xcb241b;_0x216f44=0xc8;}else{_0x216f44=0xce;}_0x218e02[_0x8a7c('0x17')](_0x216f44);return _0x218e02[_0x8a7c('0x1e')](_0x8a7c('0x1f'),_0x2615ec+'-'+_0x61dd44+'/'+_0xcb241b)[_0x8a7c('0x19')](_0x3ad57b);}return null;};}function patchUpdates(_0xddcfc5){return function(_0x57170f){try{jsonpatch[_0x8a7c('0x20')](_0x57170f,_0xddcfc5,!![]);}catch(_0x1408f5){return BPromise['reject'](_0x1408f5);}return _0x57170f['save']();};}function saveUpdates(_0xc39305,_0x377d52){return function(_0x1cafeb){if(_0x1cafeb){return _0x1cafeb[_0x8a7c('0x21')](_0xc39305)[_0x8a7c('0x22')](function(_0x4b6009){return _0x4b6009;});}return null;};}function removeEntity(_0x4234ad,_0x70efdc){return function(_0x21ab6b){if(_0x21ab6b){return _0x21ab6b[_0x8a7c('0x23')]()['then'](function(){_0x4234ad[_0x8a7c('0x17')](0xcc)[_0x8a7c('0x18')]();});}};}function handleEntityNotFound(_0x1d1c6b,_0x4443c4){return function(_0x4ef459){if(!_0x4ef459){_0x1d1c6b[_0x8a7c('0x16')](0x194);}return _0x4ef459;};}function handleError(_0x2c061d,_0x3384c6){_0x3384c6=_0x3384c6||0x1f4;return function(_0x21f8d8){logger[_0x8a7c('0x24')](_0x21f8d8['stack']);if(_0x21f8d8[_0x8a7c('0x25')]){delete _0x21f8d8['name'];}_0x2c061d['status'](_0x3384c6)[_0x8a7c('0x26')](_0x21f8d8);};}exports[_0x8a7c('0x27')]=function(_0x2e0e07,_0x35acdd){var _0x5d1cb0={},_0x398305={},_0x4ba87c={'count':0x0,'rows':[]};var _0x2eccd3=_[_0x8a7c('0x28')](db[_0x8a7c('0x29')]['rawAttributes'],function(_0x5001ea){return{'name':_0x5001ea[_0x8a7c('0x2a')],'type':_0x5001ea[_0x8a7c('0x2b')][_0x8a7c('0x2c')]};});_0x398305[_0x8a7c('0x2d')]=_[_0x8a7c('0x28')](_0x2eccd3,_0x8a7c('0x25'));_0x398305[_0x8a7c('0x2e')]=_['keys'](_0x2e0e07[_0x8a7c('0x2e')]);_0x398305[_0x8a7c('0x2f')]=_[_0x8a7c('0x30')](_0x398305[_0x8a7c('0x2d')],_0x398305[_0x8a7c('0x2e')]);_0x5d1cb0[_0x8a7c('0x31')]=_[_0x8a7c('0x30')](_0x398305[_0x8a7c('0x2d')],qs[_0x8a7c('0x32')](_0x2e0e07[_0x8a7c('0x2e')][_0x8a7c('0x32')]));_0x5d1cb0[_0x8a7c('0x31')]=_0x5d1cb0[_0x8a7c('0x31')][_0x8a7c('0x33')]?_0x5d1cb0[_0x8a7c('0x31')]:_0x398305[_0x8a7c('0x2d')];if(!_0x2e0e07[_0x8a7c('0x2e')][_0x8a7c('0x34')]('nolimit')){_0x5d1cb0[_0x8a7c('0x1d')]=qs['limit'](_0x2e0e07[_0x8a7c('0x2e')][_0x8a7c('0x1d')]);_0x5d1cb0[_0x8a7c('0x1a')]=qs[_0x8a7c('0x1a')](_0x2e0e07[_0x8a7c('0x2e')]['offset']);}_0x5d1cb0[_0x8a7c('0x35')]=qs[_0x8a7c('0x36')](_0x2e0e07[_0x8a7c('0x2e')][_0x8a7c('0x36')]);_0x5d1cb0[_0x8a7c('0x37')]=qs['filters'](_[_0x8a7c('0x38')](_0x2e0e07[_0x8a7c('0x2e')],_0x398305[_0x8a7c('0x2f')]),_0x2eccd3);if(_0x2e0e07[_0x8a7c('0x2e')][_0x8a7c('0x39')]){_0x5d1cb0[_0x8a7c('0x37')]=_['merge'](_0x5d1cb0[_0x8a7c('0x37')],{'$or':_[_0x8a7c('0x28')](_0x2eccd3,function(_0x7c317a){if(_0x7c317a['type']!==_0x8a7c('0x3a')){var _0x3e904e={};_0x3e904e[_0x7c317a[_0x8a7c('0x25')]]={'$like':'%'+_0x2e0e07[_0x8a7c('0x2e')][_0x8a7c('0x39')]+'%'};return _0x3e904e;}})});}_0x5d1cb0=_['merge']({},_0x5d1cb0,_0x2e0e07['options']);var _0x2708c9={'where':_0x5d1cb0[_0x8a7c('0x37')]};return db[_0x8a7c('0x29')]['count'](_0x2708c9)[_0x8a7c('0x22')](function(_0x4e53aa){_0x4ba87c['count']=_0x4e53aa;if(_0x2e0e07['query'][_0x8a7c('0x3b')]){_0x5d1cb0[_0x8a7c('0x3c')]=[{'all':!![]}];}return db['ZohoField']['findAll'](_0x5d1cb0);})[_0x8a7c('0x22')](function(_0x464295){_0x4ba87c[_0x8a7c('0x3d')]=_0x464295;return _0x4ba87c;})['then'](respondWithFilteredResult(_0x35acdd,_0x5d1cb0))['catch'](handleError(_0x35acdd,null));};exports[_0x8a7c('0x3e')]=function(_0x4f4ae3,_0x1d28c3){var _0x339c8c={'raw':!![],'where':{'id':_0x4f4ae3['params']['id']}},_0xdc108d={};_0xdc108d[_0x8a7c('0x2d')]=_[_0x8a7c('0x3f')](db[_0x8a7c('0x29')]['rawAttributes']);_0xdc108d[_0x8a7c('0x2e')]=_[_0x8a7c('0x3f')](_0x4f4ae3['query']);_0xdc108d[_0x8a7c('0x2f')]=_['intersection'](_0xdc108d['model'],_0xdc108d[_0x8a7c('0x2e')]);_0x339c8c[_0x8a7c('0x31')]=_[_0x8a7c('0x30')](_0xdc108d['model'],qs[_0x8a7c('0x32')](_0x4f4ae3['query'][_0x8a7c('0x32')]));_0x339c8c[_0x8a7c('0x31')]=_0x339c8c['attributes'][_0x8a7c('0x33')]?_0x339c8c[_0x8a7c('0x31')]:_0xdc108d[_0x8a7c('0x2d')];if(_0x4f4ae3[_0x8a7c('0x2e')][_0x8a7c('0x3b')]){_0x339c8c[_0x8a7c('0x3c')]=[{'all':!![]}];}_0x339c8c=_['merge']({},_0x339c8c,_0x4f4ae3['options']);return db[_0x8a7c('0x29')][_0x8a7c('0x40')](_0x339c8c)['then'](handleEntityNotFound(_0x1d28c3,null))[_0x8a7c('0x22')](respondWithResult(_0x1d28c3,null))['catch'](handleError(_0x1d28c3,null));};exports[_0x8a7c('0x41')]=function(_0xdea6bb,_0x7742bd){return db['ZohoField'][_0x8a7c('0x41')](_0xdea6bb[_0x8a7c('0x42')],{})[_0x8a7c('0x22')](respondWithResult(_0x7742bd,0xc9))['catch'](handleError(_0x7742bd,null));};exports[_0x8a7c('0x21')]=function(_0x3f6173,_0x4bfa61){if(_0x3f6173[_0x8a7c('0x42')]['id']){delete _0x3f6173[_0x8a7c('0x42')]['id'];}return db[_0x8a7c('0x29')][_0x8a7c('0x40')]({'where':{'id':_0x3f6173[_0x8a7c('0x43')]['id']}})[_0x8a7c('0x22')](handleEntityNotFound(_0x4bfa61,null))[_0x8a7c('0x22')](saveUpdates(_0x3f6173[_0x8a7c('0x42')],null))[_0x8a7c('0x22')](respondWithResult(_0x4bfa61,null))[_0x8a7c('0x44')](handleError(_0x4bfa61,null));};exports['destroy']=function(_0x5b906a,_0x2779e4){return db[_0x8a7c('0x29')][_0x8a7c('0x40')]({'where':{'id':_0x5b906a['params']['id']}})['then'](handleEntityNotFound(_0x2779e4,null))[_0x8a7c('0x22')](removeEntity(_0x2779e4,null))[_0x8a7c('0x44')](handleError(_0x2779e4,null));};
\ No newline at end of file
+var _0x26c8=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','offset','undefined','count','limit','status','set','Content-Range','json','update','destroy','then','sendStatus','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','rows','show','params','include','options','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js'];(function(_0x5c2f8e,_0x1a05a2){var _0xb2d0a=function(_0x3cecd5){while(--_0x3cecd5){_0x5c2f8e['push'](_0x5c2f8e['shift']());}};_0xb2d0a(++_0x1a05a2);}(_0x26c8,0xc9));var _0x826c=function(_0x501d6a,_0x47b2c6){_0x501d6a=_0x501d6a-0x0;var _0x3c88ac=_0x26c8[_0x501d6a];return _0x3c88ac;};'use strict';var emlformat=require(_0x826c('0x0'));var rimraf=require(_0x826c('0x1'));var zipdir=require(_0x826c('0x2'));var jsonpatch=require(_0x826c('0x3'));var rp=require(_0x826c('0x4'));var moment=require(_0x826c('0x5'));var BPromise=require(_0x826c('0x6'));var Mustache=require(_0x826c('0x7'));var util=require(_0x826c('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x826c('0x9'));var ejs=require(_0x826c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x826c('0xb'));var crypto=require(_0x826c('0xc'));var jsforce=require(_0x826c('0xd'));var deskjs=require(_0x826c('0xe'));var toCsv=require(_0x826c('0x9'));var querystring=require(_0x826c('0xf'));var Papa=require(_0x826c('0x10'));var Redis=require(_0x826c('0x11'));var authService=require(_0x826c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x826c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x826c('0x14'))(_0x826c('0x15'));var utils=require(_0x826c('0x16'));var config=require(_0x826c('0x17'));var licenseUtil=require(_0x826c('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x349029,_0x34e8f4){_0x34e8f4=_0x34e8f4||0xcc;return function(_0x4d922f){if(_0x4d922f){return _0x349029['sendStatus'](_0x34e8f4);}return _0x349029['status'](_0x34e8f4)[_0x826c('0x19')]();};}function respondWithResult(_0x162e67,_0x309cbf){_0x309cbf=_0x309cbf||0xc8;return function(_0x317a85){if(_0x317a85){return _0x162e67['status'](_0x309cbf)['json'](_0x317a85);}};}function respondWithFilteredResult(_0x59fc01,_0xdc370e){return function(_0x1e82e5){if(_0x1e82e5){var _0x13fc9=typeof _0xdc370e[_0x826c('0x1a')]===_0x826c('0x1b')&&typeof _0xdc370e['limit']===_0x826c('0x1b');var _0x3cbd2a=_0x1e82e5['count'];var _0x4e3899=_0x13fc9?0x0:_0xdc370e['offset'];var _0x5867e5=_0x13fc9?_0x1e82e5[_0x826c('0x1c')]:_0xdc370e[_0x826c('0x1a')]+_0xdc370e[_0x826c('0x1d')];var _0x326982;if(_0x5867e5>=_0x3cbd2a){_0x5867e5=_0x3cbd2a;_0x326982=0xc8;}else{_0x326982=0xce;}_0x59fc01[_0x826c('0x1e')](_0x326982);return _0x59fc01[_0x826c('0x1f')](_0x826c('0x20'),_0x4e3899+'-'+_0x5867e5+'/'+_0x3cbd2a)[_0x826c('0x21')](_0x1e82e5);}return null;};}function patchUpdates(_0x5e51ae){return function(_0x4f0178){try{jsonpatch['apply'](_0x4f0178,_0x5e51ae,!![]);}catch(_0x4f02fa){return BPromise['reject'](_0x4f02fa);}return _0x4f0178['save']();};}function saveUpdates(_0x3020fe,_0x595fb3){return function(_0x3c0c46){if(_0x3c0c46){return _0x3c0c46[_0x826c('0x22')](_0x3020fe)['then'](function(_0x300fd6){return _0x300fd6;});}return null;};}function removeEntity(_0x54dd9b,_0x4d438f){return function(_0x50f755){if(_0x50f755){return _0x50f755[_0x826c('0x23')]()[_0x826c('0x24')](function(){_0x54dd9b['status'](0xcc)[_0x826c('0x19')]();});}};}function handleEntityNotFound(_0x3a3901,_0x275981){return function(_0x2968e6){if(!_0x2968e6){_0x3a3901[_0x826c('0x25')](0x194);}return _0x2968e6;};}function handleError(_0x28fb4e,_0x46f34f){_0x46f34f=_0x46f34f||0x1f4;return function(_0x4d63bf){logger['error'](_0x4d63bf['stack']);if(_0x4d63bf['name']){delete _0x4d63bf[_0x826c('0x26')];}_0x28fb4e[_0x826c('0x1e')](_0x46f34f)[_0x826c('0x27')](_0x4d63bf);};}exports[_0x826c('0x28')]=function(_0x354f73,_0x3c9718){var _0x3928c2={},_0x1ea994={},_0x4e6901={'count':0x0,'rows':[]};var _0x4632d3=_[_0x826c('0x29')](db[_0x826c('0x2a')][_0x826c('0x2b')],function(_0x3630d1){return{'name':_0x3630d1[_0x826c('0x2c')],'type':_0x3630d1[_0x826c('0x2d')][_0x826c('0x2e')]};});_0x1ea994[_0x826c('0x2f')]=_[_0x826c('0x29')](_0x4632d3,_0x826c('0x26'));_0x1ea994['query']=_[_0x826c('0x30')](_0x354f73[_0x826c('0x31')]);_0x1ea994['filters']=_[_0x826c('0x32')](_0x1ea994['model'],_0x1ea994['query']);_0x3928c2['attributes']=_[_0x826c('0x32')](_0x1ea994[_0x826c('0x2f')],qs['fields'](_0x354f73[_0x826c('0x31')][_0x826c('0x33')]));_0x3928c2[_0x826c('0x34')]=_0x3928c2[_0x826c('0x34')][_0x826c('0x35')]?_0x3928c2['attributes']:_0x1ea994[_0x826c('0x2f')];if(!_0x354f73[_0x826c('0x31')]['hasOwnProperty'](_0x826c('0x36'))){_0x3928c2['limit']=qs[_0x826c('0x1d')](_0x354f73['query'][_0x826c('0x1d')]);_0x3928c2['offset']=qs[_0x826c('0x1a')](_0x354f73[_0x826c('0x31')][_0x826c('0x1a')]);}_0x3928c2[_0x826c('0x37')]=qs['sort'](_0x354f73[_0x826c('0x31')][_0x826c('0x38')]);_0x3928c2['where']=qs[_0x826c('0x39')](_[_0x826c('0x3a')](_0x354f73[_0x826c('0x31')],_0x1ea994[_0x826c('0x39')]),_0x4632d3);if(_0x354f73[_0x826c('0x31')][_0x826c('0x3b')]){_0x3928c2[_0x826c('0x3c')]=_[_0x826c('0x3d')](_0x3928c2['where'],{'$or':_['map'](_0x4632d3,function(_0x4e313f){if(_0x4e313f[_0x826c('0x2d')]!==_0x826c('0x3e')){var _0x3973e4={};_0x3973e4[_0x4e313f[_0x826c('0x26')]]={'$like':'%'+_0x354f73[_0x826c('0x31')][_0x826c('0x3b')]+'%'};return _0x3973e4;}})});}_0x3928c2=_['merge']({},_0x3928c2,_0x354f73['options']);var _0x44bb2c={'where':_0x3928c2[_0x826c('0x3c')]};return db[_0x826c('0x2a')][_0x826c('0x1c')](_0x44bb2c)['then'](function(_0x5c0ad1){_0x4e6901[_0x826c('0x1c')]=_0x5c0ad1;if(_0x354f73[_0x826c('0x31')][_0x826c('0x3f')]){_0x3928c2['include']=[{'all':!![]}];}return db[_0x826c('0x2a')]['findAll'](_0x3928c2);})[_0x826c('0x24')](function(_0x33e4eb){_0x4e6901[_0x826c('0x40')]=_0x33e4eb;return _0x4e6901;})[_0x826c('0x24')](respondWithFilteredResult(_0x3c9718,_0x3928c2))['catch'](handleError(_0x3c9718,null));};exports[_0x826c('0x41')]=function(_0x26c97a,_0x27d18f){var _0x1fd699={'raw':!![],'where':{'id':_0x26c97a[_0x826c('0x42')]['id']}},_0x51180b={};_0x51180b['model']=_[_0x826c('0x30')](db[_0x826c('0x2a')][_0x826c('0x2b')]);_0x51180b[_0x826c('0x31')]=_[_0x826c('0x30')](_0x26c97a[_0x826c('0x31')]);_0x51180b[_0x826c('0x39')]=_[_0x826c('0x32')](_0x51180b[_0x826c('0x2f')],_0x51180b[_0x826c('0x31')]);_0x1fd699[_0x826c('0x34')]=_[_0x826c('0x32')](_0x51180b[_0x826c('0x2f')],qs[_0x826c('0x33')](_0x26c97a[_0x826c('0x31')][_0x826c('0x33')]));_0x1fd699[_0x826c('0x34')]=_0x1fd699[_0x826c('0x34')][_0x826c('0x35')]?_0x1fd699[_0x826c('0x34')]:_0x51180b[_0x826c('0x2f')];if(_0x26c97a[_0x826c('0x31')][_0x826c('0x3f')]){_0x1fd699[_0x826c('0x43')]=[{'all':!![]}];}_0x1fd699=_['merge']({},_0x1fd699,_0x26c97a[_0x826c('0x44')]);return db[_0x826c('0x2a')][_0x826c('0x45')](_0x1fd699)[_0x826c('0x24')](handleEntityNotFound(_0x27d18f,null))[_0x826c('0x24')](respondWithResult(_0x27d18f,null))[_0x826c('0x46')](handleError(_0x27d18f,null));};exports['create']=function(_0x3f816c,_0x4f13c2){return db[_0x826c('0x2a')]['create'](_0x3f816c[_0x826c('0x47')],{})[_0x826c('0x24')](respondWithResult(_0x4f13c2,0xc9))[_0x826c('0x46')](handleError(_0x4f13c2,null));};exports['update']=function(_0x2126cb,_0x8424aa){if(_0x2126cb['body']['id']){delete _0x2126cb[_0x826c('0x47')]['id'];}return db[_0x826c('0x2a')][_0x826c('0x45')]({'where':{'id':_0x2126cb[_0x826c('0x42')]['id']}})[_0x826c('0x24')](handleEntityNotFound(_0x8424aa,null))[_0x826c('0x24')](saveUpdates(_0x2126cb[_0x826c('0x47')],null))[_0x826c('0x24')](respondWithResult(_0x8424aa,null))['catch'](handleError(_0x8424aa,null));};exports['destroy']=function(_0x288156,_0x5c8ca4){return db[_0x826c('0x2a')][_0x826c('0x45')]({'where':{'id':_0x288156[_0x826c('0x42')]['id']}})[_0x826c('0x24')](handleEntityNotFound(_0x5c8ca4,null))[_0x826c('0x24')](removeEntity(_0x5c8ca4,null))[_0x826c('0x46')](handleError(_0x5c8ca4,null));};
\ No newline at end of file
index 3f64004..80bcae6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb145=['api','moment','bluebird','request-promise','path','rimraf','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','util','../../config/logger'];(function(_0x288325,_0x26e4ff){var _0x3b9fd7=function(_0x1f2816){while(--_0x1f2816){_0x288325['push'](_0x288325['shift']());}};_0x3b9fd7(++_0x26e4ff);}(_0xb145,0xa3));var _0x5b14=function(_0x5a532f,_0x257137){_0x5a532f=_0x5a532f-0x0;var _0x14b4e8=_0xb145[_0x5a532f];return _0x14b4e8;};'use strict';var _=require('lodash');var util=require(_0x5b14('0x0'));var logger=require(_0x5b14('0x1'))(_0x5b14('0x2'));var moment=require(_0x5b14('0x3'));var BPromise=require(_0x5b14('0x4'));var rp=require(_0x5b14('0x5'));var fs=require('fs');var path=require(_0x5b14('0x6'));var rimraf=require(_0x5b14('0x7'));var config=require('../../config/environment');var attributes=require(_0x5b14('0x8'));module[_0x5b14('0x9')]=function(_0x392425,_0x4d82ad){return _0x392425['define'](_0x5b14('0xa'),attributes,{'tableName':_0x5b14('0xb'),'paranoid':![],'indexes':[{'name':_0x5b14('0xc'),'fields':[_0x5b14('0xd'),_0x5b14('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xfcf0=['moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','zoho_unique_index','idField','FieldId','lodash','util','api'];(function(_0x316f7a,_0x4151a4){var _0x8b7290=function(_0x394611){while(--_0x394611){_0x316f7a['push'](_0x316f7a['shift']());}};_0x8b7290(++_0x4151a4);}(_0xfcf0,0x138));var _0x0fcf=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xfcf0[_0xc4001c];return _0x49f7bc;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var logger=require('../../config/logger')(_0x0fcf('0x2'));var moment=require(_0x0fcf('0x3'));var BPromise=require(_0x0fcf('0x4'));var rp=require(_0x0fcf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0fcf('0x6'));var config=require(_0x0fcf('0x7'));var attributes=require(_0x0fcf('0x8'));module[_0x0fcf('0x9')]=function(_0x1bace8,_0x1a7b03){return _0x1bace8[_0x0fcf('0xa')](_0x0fcf('0xb'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x0fcf('0xc'),'fields':[_0x0fcf('0xd'),_0x0fcf('0xe')],'unique':!![]}],'timestamps':!![]});};
\ No newline at end of file
index bfd6518..2c7a7b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a91=['info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','error','code','ZohoField,\x20%s,\x20%s','message'];(function(_0x108798,_0x339779){var _0x38168d=function(_0x5deef9){while(--_0x5deef9){_0x108798['push'](_0x108798['shift']());}};_0x38168d(++_0x339779);}(_0x4a91,0x16b));var _0x14a9=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x4a91[_0x38537f];return _0x141e23;};'use strict';var _=require(_0x14a9('0x0'));var util=require(_0x14a9('0x1'));var moment=require('moment');var BPromise=require(_0x14a9('0x2'));var rs=require(_0x14a9('0x3'));var fs=require('fs');var Redis=require(_0x14a9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x14a9('0x5'));var logger=require('../../config/logger')(_0x14a9('0x6'));var config=require('../../config/environment');var jayson=require(_0x14a9('0x7'));var client=jayson[_0x14a9('0x8')][_0x14a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d294f,_0x2a2d8d,_0x27e7c0){return new BPromise(function(_0x248322,_0x17fd11){return client[_0x14a9('0xa')](_0x1d294f,_0x27e7c0)['then'](function(_0x32c105){logger['info']('ZohoField,\x20%s,\x20%s',_0x2a2d8d,_0x14a9('0xb'));logger['debug'](_0x14a9('0xc'),_0x2a2d8d,_0x14a9('0xb'),JSON['stringify'](_0x32c105));if(_0x32c105['error']){if(_0x32c105[_0x14a9('0xd')][_0x14a9('0xe')]===0x1f4){logger[_0x14a9('0xd')](_0x14a9('0xf'),_0x2a2d8d,_0x32c105['error'][_0x14a9('0x10')]);return _0x17fd11(_0x32c105[_0x14a9('0xd')]['message']);}logger[_0x14a9('0xd')](_0x14a9('0xf'),_0x2a2d8d,_0x32c105[_0x14a9('0xd')][_0x14a9('0x10')]);return _0x248322(_0x32c105[_0x14a9('0xd')]['message']);}else{logger[_0x14a9('0x11')](_0x14a9('0xf'),_0x2a2d8d,'request\x20sent');_0x248322(_0x32c105[_0x14a9('0x12')]['message']);}})[_0x14a9('0x13')](function(_0x51d499){logger[_0x14a9('0xd')]('ZohoField,\x20%s,\x20%s',_0x2a2d8d,_0x51d499);_0x17fd11(_0x51d499);});});}
\ No newline at end of file
+var _0x48b0=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0xb33a99,_0x40080e){var _0x3c221e=function(_0x259ca6){while(--_0x259ca6){_0xb33a99['push'](_0xb33a99['shift']());}};_0x3c221e(++_0x40080e);}(_0x48b0,0xf7));var _0x048b=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x48b0[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x048b('0x0'));var util=require(_0x048b('0x1'));var moment=require(_0x048b('0x2'));var BPromise=require(_0x048b('0x3'));var rs=require(_0x048b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x048b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x048b('0x6'))('rpc');var config=require(_0x048b('0x7'));var jayson=require(_0x048b('0x8'));var client=jayson[_0x048b('0x9')][_0x048b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x328a3c,_0x11fa0b,_0x428eac){return new BPromise(function(_0x5155dd,_0x4a2e36){return client['request'](_0x328a3c,_0x428eac)[_0x048b('0xb')](function(_0xae8c7){logger[_0x048b('0xc')](_0x048b('0xd'),_0x11fa0b,_0x048b('0xe'));logger[_0x048b('0xf')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x11fa0b,_0x048b('0xe'),JSON[_0x048b('0x10')](_0xae8c7));if(_0xae8c7[_0x048b('0x11')]){if(_0xae8c7[_0x048b('0x11')][_0x048b('0x12')]===0x1f4){logger[_0x048b('0x11')]('ZohoField,\x20%s,\x20%s',_0x11fa0b,_0xae8c7[_0x048b('0x11')][_0x048b('0x13')]);return _0x4a2e36(_0xae8c7[_0x048b('0x11')][_0x048b('0x13')]);}logger['error'](_0x048b('0xd'),_0x11fa0b,_0xae8c7['error']['message']);return _0x5155dd(_0xae8c7[_0x048b('0x11')][_0x048b('0x13')]);}else{logger[_0x048b('0xc')](_0x048b('0xd'),_0x11fa0b,_0x048b('0xe'));_0x5155dd(_0xae8c7[_0x048b('0x14')][_0x048b('0x13')]);}})[_0x048b('0x15')](function(_0x1455e6){logger[_0x048b('0x11')](_0x048b('0xd'),_0x11fa0b,_0x1455e6);_0x4a2e36(_0x1455e6);});});}
\ No newline at end of file
index b2ea9de..9647526 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(_0xfd1945,_0x29827d){var _0x53d788=function(_0x34cbb6){while(--_0x34cbb6){_0xfd1945['push'](_0xfd1945['shift']());}};_0x53d788(++_0x29827d);}(_0x9c44,0x178));var _0x49c4=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x9c44[_0x45d55e];return _0x29812a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
+var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x9c8c83,_0x16ebdd){var _0x4636ac=function(_0x5bacfc){while(--_0x5bacfc){_0x9c8c83['push'](_0x9c8c83['shift']());}};_0x4636ac(++_0x16ebdd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 29599a3..8986530 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4c18=['INTEGER','state','sequelize','exports','unique_name_and_version','STRING'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x4c18,0x18e));var _0x84c1=function(_0x5139df,_0x8acdbf){_0x5139df=_0x5139df-0x0;var _0x1249db=_0x4c18[_0x5139df];return _0x1249db;};'use strict';var Sequelize=require(_0x84c1('0x0'));module[_0x84c1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x84c1('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x84c1('0x2')},'main':{'type':Sequelize[_0x84c1('0x3')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0x84c1('0x3')]},'path':{'type':Sequelize[_0x84c1('0x3')]},'type':{'type':Sequelize[_0x84c1('0x3')]},'size':{'type':Sequelize[_0x84c1('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x84c1('0x3')]},'state':{'type':Sequelize['STRING'],'unique':_0x84c1('0x5')},'description':{'type':Sequelize[_0x84c1('0x3')]},'title':{'type':Sequelize[_0x84c1('0x3')]},'remoteUri':{'type':Sequelize[_0x84c1('0x3')]},'link':{'type':Sequelize[_0x84c1('0x3')],'defaultValue':'#'}};
\ No newline at end of file
+var _0x6a14=['state','sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6a14,0x13c));var _0x46a1=function(_0x4ba769,_0x5d50fb){_0x4ba769=_0x4ba769-0x0;var _0x1f96d6=_0x6a14[_0x4ba769];return _0x1f96d6;};'use strict';var Sequelize=require(_0x46a1('0x0'));module[_0x46a1('0x1')]={'name':{'type':Sequelize[_0x46a1('0x2')],'allowNull':![],'unique':_0x46a1('0x3')},'version':{'type':Sequelize[_0x46a1('0x2')],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x46a1('0x2')],'defaultValue':_0x46a1('0x4')},'filename':{'type':Sequelize[_0x46a1('0x2')]},'path':{'type':Sequelize[_0x46a1('0x2')]},'type':{'type':Sequelize[_0x46a1('0x2')]},'size':{'type':Sequelize[_0x46a1('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x46a1('0x2')]},'state':{'type':Sequelize[_0x46a1('0x2')],'unique':_0x46a1('0x6')},'description':{'type':Sequelize[_0x46a1('0x2')]},'title':{'type':Sequelize[_0x46a1('0x2')]},'remoteUri':{'type':Sequelize[_0x46a1('0x2')]},'link':{'type':Sequelize[_0x46a1('0x2')],'defaultValue':'#'}};
\ No newline at end of file
index 1258c12..6943d18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc1c6=['type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','Integration','rawAttributes'];(function(_0x458f18,_0x3d2e64){var _0x4afb0e=function(_0xe5c943){while(--_0xe5c943){_0x458f18['push'](_0x458f18['shift']());}};_0x4afb0e(++_0x3d2e64);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x4bf37a,_0x4a1540){_0x4bf37a=_0x4bf37a-0x0;var _0x20ab3c=_0xc1c6[_0x4bf37a];return _0x20ab3c;};'use strict';var emlformat=require(_0x6c1c('0x0'));var rimraf=require(_0x6c1c('0x1'));var zipdir=require(_0x6c1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6c1c('0x3'));var moment=require('moment');var BPromise=require(_0x6c1c('0x4'));var Mustache=require(_0x6c1c('0x5'));var util=require(_0x6c1c('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6c1c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6c1c('0x8'));var _=require('lodash');var squel=require(_0x6c1c('0x9'));var crypto=require(_0x6c1c('0xa'));var jsforce=require(_0x6c1c('0xb'));var deskjs=require(_0x6c1c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6c1c('0xd'));var Papa=require(_0x6c1c('0xe'));var Redis=require('ioredis');var authService=require(_0x6c1c('0xf'));var qs=require(_0x6c1c('0x10'));var as=require(_0x6c1c('0x11'));var hardwareService=require(_0x6c1c('0x12'));var logger=require('../../config/logger')(_0x6c1c('0x13'));var utils=require(_0x6c1c('0x14'));var config=require(_0x6c1c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6c1c('0x16'))['db'];function respondWithStatusCode(_0x12a9e6,_0x2067bd){_0x2067bd=_0x2067bd||0xcc;return function(_0x49304f){if(_0x49304f){return _0x12a9e6[_0x6c1c('0x17')](_0x2067bd);}return _0x12a9e6['status'](_0x2067bd)[_0x6c1c('0x18')]();};}function respondWithResult(_0x15a1fc,_0x2d279e){_0x2d279e=_0x2d279e||0xc8;return function(_0x154107){if(_0x154107){return _0x15a1fc[_0x6c1c('0x19')](_0x2d279e)[_0x6c1c('0x1a')](_0x154107);}};}function respondWithFilteredResult(_0x297c33,_0x41aa74){return function(_0x448f35){if(_0x448f35){var _0x5f3758=typeof _0x41aa74[_0x6c1c('0x1b')]===_0x6c1c('0x1c')&&typeof _0x41aa74['limit']===_0x6c1c('0x1c');var _0x237cac=_0x448f35['count'];var _0x137770=_0x5f3758?0x0:_0x41aa74['offset'];var _0x338dc2=_0x5f3758?_0x448f35[_0x6c1c('0x1d')]:_0x41aa74['offset']+_0x41aa74[_0x6c1c('0x1e')];var _0x59ab38;if(_0x338dc2>=_0x237cac){_0x338dc2=_0x237cac;_0x59ab38=0xc8;}else{_0x59ab38=0xce;}_0x297c33[_0x6c1c('0x19')](_0x59ab38);return _0x297c33[_0x6c1c('0x1f')](_0x6c1c('0x20'),_0x137770+'-'+_0x338dc2+'/'+_0x237cac)[_0x6c1c('0x1a')](_0x448f35);}return null;};}function patchUpdates(_0x1acf7f){return function(_0x1efb19){try{jsonpatch[_0x6c1c('0x21')](_0x1efb19,_0x1acf7f,!![]);}catch(_0x2ed830){return BPromise[_0x6c1c('0x22')](_0x2ed830);}return _0x1efb19[_0x6c1c('0x23')]();};}function saveUpdates(_0x3d2bf3,_0x450b1f){return function(_0x2382c0){if(_0x2382c0){return _0x2382c0[_0x6c1c('0x24')](_0x3d2bf3)[_0x6c1c('0x25')](function(_0x19c269){return _0x19c269;});}return null;};}function removeEntity(_0x2319d3,_0x12c638){return function(_0x3a3f13){if(_0x3a3f13){return _0x3a3f13[_0x6c1c('0x26')]()[_0x6c1c('0x25')](function(){_0x2319d3[_0x6c1c('0x19')](0xcc)[_0x6c1c('0x18')]();});}};}function handleEntityNotFound(_0x7ff10d,_0x18452d){return function(_0x80bc05){if(!_0x80bc05){_0x7ff10d[_0x6c1c('0x17')](0x194);}return _0x80bc05;};}function handleError(_0x1b9d7d,_0x2feaf4){_0x2feaf4=_0x2feaf4||0x1f4;return function(_0x5f4568){logger[_0x6c1c('0x27')](_0x5f4568['stack']);if(_0x5f4568[_0x6c1c('0x28')]){delete _0x5f4568['name'];}_0x1b9d7d[_0x6c1c('0x19')](_0x2feaf4)['send'](_0x5f4568);};}exports[_0x6c1c('0x29')]=function(_0xf557ba,_0x504348){var _0x3b1a4f={},_0x24da4c={},_0x4e13e3={'count':0x0,'rows':[]};var _0x3b319a=_[_0x6c1c('0x2a')](db[_0x6c1c('0x2b')][_0x6c1c('0x2c')],function(_0x4fc279){return{'name':_0x4fc279['fieldName'],'type':_0x4fc279[_0x6c1c('0x2d')][_0x6c1c('0x2e')]};});_0x24da4c[_0x6c1c('0x2f')]=_[_0x6c1c('0x2a')](_0x3b319a,_0x6c1c('0x28'));_0x24da4c[_0x6c1c('0x30')]=_['keys'](_0xf557ba[_0x6c1c('0x30')]);_0x24da4c[_0x6c1c('0x31')]=_['intersection'](_0x24da4c[_0x6c1c('0x2f')],_0x24da4c[_0x6c1c('0x30')]);_0x3b1a4f[_0x6c1c('0x32')]=_[_0x6c1c('0x33')](_0x24da4c['model'],qs[_0x6c1c('0x34')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x3b1a4f['attributes']=_0x3b1a4f[_0x6c1c('0x32')]['length']?_0x3b1a4f[_0x6c1c('0x32')]:_0x24da4c['model'];if(!_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x35')](_0x6c1c('0x36'))){_0x3b1a4f['limit']=qs['limit'](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x1e')]);_0x3b1a4f[_0x6c1c('0x1b')]=qs['offset'](_0xf557ba[_0x6c1c('0x30')]['offset']);}_0x3b1a4f['order']=qs[_0x6c1c('0x37')](_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x37')]);_0x3b1a4f[_0x6c1c('0x38')]=qs['filters'](_[_0x6c1c('0x39')](_0xf557ba[_0x6c1c('0x30')],_0x24da4c[_0x6c1c('0x31')]),_0x3b319a);if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]){_0x3b1a4f[_0x6c1c('0x38')]=_[_0x6c1c('0x3b')](_0x3b1a4f[_0x6c1c('0x38')],{'$or':_[_0x6c1c('0x2a')](_0x3b319a,function(_0x232508){if(_0x232508['type']!==_0x6c1c('0x3c')){var _0x464549={};_0x464549[_0x232508[_0x6c1c('0x28')]]={'$like':'%'+_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3a')]+'%'};return _0x464549;}})});}_0x3b1a4f=_['merge']({},_0x3b1a4f,_0xf557ba['options']);var _0x549db1={'where':_0x3b1a4f[_0x6c1c('0x38')]};return db['Integration']['count'](_0x549db1)[_0x6c1c('0x25')](function(_0x37244e){_0x4e13e3['count']=_0x37244e;if(_0xf557ba[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x3b1a4f[_0x6c1c('0x3e')]=[{'all':!![]}];}return db['Integration'][_0x6c1c('0x3f')](_0x3b1a4f);})[_0x6c1c('0x25')](function(_0x502e75){_0x4e13e3[_0x6c1c('0x40')]=_0x502e75;return _0x4e13e3;})['then'](respondWithFilteredResult(_0x504348,_0x3b1a4f))[_0x6c1c('0x41')](handleError(_0x504348,null));};exports[_0x6c1c('0x42')]=function(_0x16a389,_0x174f2c){var _0x10764a={'raw':![],'where':{'id':_0x16a389[_0x6c1c('0x43')]['id']}},_0x595ba2={};_0x595ba2[_0x6c1c('0x2f')]=_[_0x6c1c('0x44')](db['Integration'][_0x6c1c('0x2c')]);_0x595ba2[_0x6c1c('0x30')]=_[_0x6c1c('0x44')](_0x16a389[_0x6c1c('0x30')]);_0x595ba2[_0x6c1c('0x31')]=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],_0x595ba2['query']);_0x10764a['attributes']=_['intersection'](_0x595ba2[_0x6c1c('0x2f')],qs[_0x6c1c('0x34')](_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x34')]));_0x10764a[_0x6c1c('0x32')]=_0x10764a[_0x6c1c('0x32')][_0x6c1c('0x45')]?_0x10764a[_0x6c1c('0x32')]:_0x595ba2['model'];if(_0x16a389[_0x6c1c('0x30')][_0x6c1c('0x3d')]){_0x10764a['include']=[{'all':!![]}];}_0x10764a=_[_0x6c1c('0x3b')]({},_0x10764a,_0x16a389['options']);return db[_0x6c1c('0x2b')][_0x6c1c('0x46')](_0x10764a)[_0x6c1c('0x25')](handleEntityNotFound(_0x174f2c,null))[_0x6c1c('0x25')](respondWithResult(_0x174f2c,null))[_0x6c1c('0x41')](handleError(_0x174f2c,null));};exports['create']=function(_0x1fe6e8,_0x58d075){return db[_0x6c1c('0x2b')][_0x6c1c('0x47')](_0x1fe6e8[_0x6c1c('0x48')],{})[_0x6c1c('0x25')](respondWithResult(_0x58d075,0xc9))[_0x6c1c('0x41')](handleError(_0x58d075,null));};exports[_0x6c1c('0x24')]=function(_0x52c14d,_0xa9889a){if(_0x52c14d[_0x6c1c('0x48')]['id']){delete _0x52c14d['body']['id'];}return db[_0x6c1c('0x2b')][_0x6c1c('0x46')]({'where':{'id':_0x52c14d[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0xa9889a,null))['then'](saveUpdates(_0x52c14d[_0x6c1c('0x48')],null))[_0x6c1c('0x25')](respondWithResult(_0xa9889a,null))[_0x6c1c('0x41')](handleError(_0xa9889a,null));};exports['destroy']=function(_0x5b8d69,_0x56b367){return db['Integration']['find']({'where':{'id':_0x5b8d69[_0x6c1c('0x43')]['id']}})[_0x6c1c('0x25')](handleEntityNotFound(_0x56b367,null))['then'](removeEntity(_0x56b367,null))[_0x6c1c('0x41')](handleError(_0x56b367,null));};
\ No newline at end of file
+var _0xf61e=['intersection','fields','attributes','length','hasOwnProperty','order','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','find','create','update','body','params','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','Integration','rawAttributes','key','model','query','keys','filters'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0xf61e,0x191));var _0xef61=function(_0x2d820e,_0x16b212){_0x2d820e=_0x2d820e-0x0;var _0x17e119=_0xf61e[_0x2d820e];return _0x17e119;};'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['Integration']['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['Integration'][_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));};
\ No newline at end of file
index 57370f8..ec023bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8028=['./integration.attributes','exports','Integration','integrations','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x2cb4e5,_0x3bf79a){var _0x547b38=function(_0x3f940e){while(--_0x3f940e){_0x2cb4e5['push'](_0x2cb4e5['shift']());}};_0x547b38(++_0x3bf79a);}(_0x8028,0x10c));var _0x8802=function(_0x30cb33,_0x47cf5d){_0x30cb33=_0x30cb33-0x0;var _0x563ee0=_0x8028[_0x30cb33];return _0x563ee0;};'use strict';var _=require('lodash');var util=require(_0x8802('0x0'));var logger=require(_0x8802('0x1'))(_0x8802('0x2'));var moment=require(_0x8802('0x3'));var BPromise=require('bluebird');var rp=require(_0x8802('0x4'));var fs=require('fs');var path=require(_0x8802('0x5'));var rimraf=require(_0x8802('0x6'));var config=require(_0x8802('0x7'));var attributes=require(_0x8802('0x8'));module[_0x8802('0x9')]=function(_0x3e1bf3,_0x1875e5){return _0x3e1bf3['define'](_0x8802('0xa'),attributes,{'tableName':_0x8802('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfaad=['define','Integration','integrations','lodash','util','moment','path','rimraf','../../config/environment'];(function(_0x1154b7,_0x77aa7f){var _0x2c8ee6=function(_0x32a97a){while(--_0x32a97a){_0x1154b7['push'](_0x1154b7['shift']());}};_0x2c8ee6(++_0x77aa7f);}(_0xfaad,0x1b3));var _0xdfaa=function(_0x11a1d2,_0x3baaaa){_0x11a1d2=_0x11a1d2-0x0;var _0x2acf0c=_0xfaad[_0x11a1d2];return _0x2acf0c;};'use strict';var _=require(_0xdfaa('0x0'));var util=require(_0xdfaa('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdfaa('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xdfaa('0x3'));var rimraf=require(_0xdfaa('0x4'));var config=require(_0xdfaa('0x5'));var attributes=require('./integration.attributes');module['exports']=function(_0xf81d8e,_0x47ba83){return _0xf81d8e[_0xdfaa('0x6')](_0xdfaa('0x7'),attributes,{'tableName':_0xdfaa('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1d28398..d04c376 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd943=['info','request\x20sent','Integration,\x20%s,\x20%s,\x20%s','error','code','Integration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','then'];(function(_0x66c8e8,_0x304ead){var _0x77f6e6=function(_0x18c7ce){while(--_0x18c7ce){_0x66c8e8['push'](_0x66c8e8['shift']());}};_0x77f6e6(++_0x304ead);}(_0xd943,0x15d));var _0x3d94=function(_0x1ab78a,_0x1805d9){_0x1ab78a=_0x1ab78a-0x0;var _0x1bdc69=_0xd943[_0x1ab78a];return _0x1bdc69;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var moment=require(_0x3d94('0x2'));var BPromise=require(_0x3d94('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d94('0x4'));var db=require(_0x3d94('0x5'))['db'];var utils=require(_0x3d94('0x6'));var logger=require(_0x3d94('0x7'))(_0x3d94('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3d94('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54e81f,_0x4d29e7,_0x20f4d1){return new BPromise(function(_0x35d36a,_0x5244c3){return client['request'](_0x54e81f,_0x20f4d1)[_0x3d94('0xa')](function(_0x27e381){logger[_0x3d94('0xb')]('Integration,\x20%s,\x20%s',_0x4d29e7,_0x3d94('0xc'));logger['debug'](_0x3d94('0xd'),_0x4d29e7,_0x3d94('0xc'),JSON['stringify'](_0x27e381));if(_0x27e381[_0x3d94('0xe')]){if(_0x27e381[_0x3d94('0xe')][_0x3d94('0xf')]===0x1f4){logger[_0x3d94('0xe')](_0x3d94('0x10'),_0x4d29e7,_0x27e381['error'][_0x3d94('0x11')]);return _0x5244c3(_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);}logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x27e381[_0x3d94('0xe')][_0x3d94('0x11')]);return _0x35d36a(_0x27e381['error'][_0x3d94('0x11')]);}else{logger[_0x3d94('0xb')](_0x3d94('0x10'),_0x4d29e7,_0x3d94('0xc'));_0x35d36a(_0x27e381[_0x3d94('0x12')][_0x3d94('0x11')]);}})[_0x3d94('0x13')](function(_0x9893cb){logger['error'](_0x3d94('0x10'),_0x4d29e7,_0x9893cb);_0x5244c3(_0x9893cb);});});}
\ No newline at end of file
+var _0x0b0e=['Integration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','debug'];(function(_0x4cfa2e,_0x5752b5){var _0x279b50=function(_0x3f817b){while(--_0x3f817b){_0x4cfa2e['push'](_0x4cfa2e['shift']());}};_0x279b50(++_0x5752b5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1faaa1,_0x1568dd){_0x1faaa1=_0x1faaa1-0x0;var _0x994ec=_0x0b0e[_0x1faaa1];return _0x994ec;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('Integration,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});}
\ No newline at end of file
index 953ed32..6c6c7b7 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','./integrationReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','update','delete','destroy','multer','util','connect-timeout'];(function(_0x41443d,_0x3e15e0){var _0x345a9d=function(_0x4591ee){while(--_0x4591ee){_0x41443d['push'](_0x41443d['shift']());}};_0x345a9d(++_0x3e15e0);}(_0x5fab,0x177));var _0xb5fa=function(_0x2ade6c,_0x2d42f2){_0x2ade6c=_0x2ade6c-0x0;var _0x2cb372=_0x5fab[_0x2ade6c];return _0x2cb372;};'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('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x12')]);router[_0xb5fa('0x13')](_0xb5fa('0xe'),auth[_0xb5fa('0xb')](),controller[_0xb5fa('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x1261=['create','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','index','get','isAuthenticated','describe','/:id','post'];(function(_0x1e4216,_0x3bae24){var _0x1b2bf0=function(_0x156a73){while(--_0x156a73){_0x1e4216['push'](_0x1e4216['shift']());}};_0x1b2bf0(++_0x3bae24);}(_0x1261,0x144));var _0x1126=function(_0x2b55b5,_0x78505e){_0x2b55b5=_0x2b55b5-0x0;var _0x103d28=_0x1261[_0x2b55b5];return _0x103d28;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/describe',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['show']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0xe'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x11')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x12')]);module[_0x1126('0x13')]=router;
\ No newline at end of file
index 9e1cab8..b1a9d67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe478=['STRING','INTEGER','DATE','BOOLEAN','TEXT','SENDING','RECEIVED','FAILED','sequelize'];(function(_0x5f481b,_0x3d4f4d){var _0x2f9650=function(_0x371b13){while(--_0x371b13){_0x5f481b['push'](_0x5f481b['shift']());}};_0x2f9650(++_0x3d4f4d);}(_0xe478,0x13a));var _0x8e47=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xe478[_0x45d55e];return _0x29812a;};'use strict';var Sequelize=require(_0x8e47('0x0'));module['exports']={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x8e47('0x1')]},'exitStatus':{'type':Sequelize[_0x8e47('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x8e47('0x2')]},'contacts':{'type':Sequelize[_0x8e47('0x1')]},'uniqueid':{'type':Sequelize[_0x8e47('0x1')]},'calleridnum':{'type':Sequelize[_0x8e47('0x1')]},'calleridname':{'type':Sequelize[_0x8e47('0x1')]},'queue':{'type':Sequelize[_0x8e47('0x1')]},'interface':{'type':Sequelize[_0x8e47('0x1')]},'membername':{'type':Sequelize[_0x8e47('0x1')]},'agentcalledAt':{'type':Sequelize[_0x8e47('0x3')]},'agentconnectAt':{'type':Sequelize[_0x8e47('0x3')]},'holdtime':{'type':Sequelize[_0x8e47('0x2')]},'agentcomplete':{'type':Sequelize[_0x8e47('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x8e47('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0x8e47('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x8e47('0x2')]},'reason':{'type':Sequelize[_0x8e47('0x1')]},'agentringnoanswer':{'type':Sequelize[_0x8e47('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x8e47('0x3')]},'agentdump':{'type':Sequelize[_0x8e47('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x8e47('0x3')]},'lastevent':{'type':Sequelize[_0x8e47('0x1')]},'channel':{'type':Sequelize[_0x8e47('0x1')]},'channelstate':{'type':Sequelize[_0x8e47('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x8e47('0x1')]},'connectedlinename':{'type':Sequelize[_0x8e47('0x1')]},'language':{'type':Sequelize[_0x8e47('0x1')]},'accountcode':{'type':Sequelize[_0x8e47('0x1')]},'context':{'type':Sequelize[_0x8e47('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x8e47('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x8e47('0x1')]},'destcalleridnum':{'type':Sequelize[_0x8e47('0x1')]},'destcalleridname':{'type':Sequelize[_0x8e47('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x8e47('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x8e47('0x1')]},'destaccountcode':{'type':Sequelize[_0x8e47('0x1')]},'destcontext':{'type':Sequelize[_0x8e47('0x1')]},'destexten':{'type':Sequelize[_0x8e47('0x1')]},'destpriority':{'type':Sequelize[_0x8e47('0x1')]},'destuniqueid':{'type':Sequelize[_0x8e47('0x1')]},'messageId':{'type':Sequelize[_0x8e47('0x1')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0x8e47('0x1')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x8e47('0x5')]},'html':{'type':Sequelize[_0x8e47('0x5')]},'text':{'type':Sequelize[_0x8e47('0x5')]},'status':{'type':Sequelize['ENUM']('SENT',_0x8e47('0x6'),_0x8e47('0x7'),_0x8e47('0x8'))},'url':{'type':Sequelize[_0x8e47('0x1')]},'app':{'type':Sequelize['STRING']},'appdata':{'type':Sequelize[_0x8e47('0x1')]},'projectId':{'type':Sequelize[_0x8e47('0x2')]}};
\ No newline at end of file
+var _0x8c5c=['sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8c5c,0x1ef));var _0xc8c5=function(_0x38b9b7,_0x51ccdb){_0x38b9b7=_0x38b9b7-0x0;var _0x3a218f=_0x8c5c[_0x38b9b7];return _0x3a218f;};'use strict';var Sequelize=require(_0xc8c5('0x0'));module[_0xc8c5('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0xc8c5('0x2')]},'exitStatus':{'type':Sequelize[_0xc8c5('0x2')]},'ticketId':{'type':Sequelize[_0xc8c5('0x2')]},'integrationId':{'type':Sequelize[_0xc8c5('0x3')]},'contacts':{'type':Sequelize[_0xc8c5('0x2')]},'uniqueid':{'type':Sequelize[_0xc8c5('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xc8c5('0x2')]},'membername':{'type':Sequelize[_0xc8c5('0x2')]},'agentcalledAt':{'type':Sequelize[_0xc8c5('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xc8c5('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0xc8c5('0x3')]},'agentacw':{'type':Sequelize[_0xc8c5('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xc8c5('0x3')]},'reason':{'type':Sequelize[_0xc8c5('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xc8c5('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xc8c5('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xc8c5('0x4')]},'lastevent':{'type':Sequelize[_0xc8c5('0x2')]},'channel':{'type':Sequelize[_0xc8c5('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xc8c5('0x2')]},'connectedlinenum':{'type':Sequelize[_0xc8c5('0x2')]},'connectedlinename':{'type':Sequelize[_0xc8c5('0x2')]},'language':{'type':Sequelize[_0xc8c5('0x2')]},'accountcode':{'type':Sequelize[_0xc8c5('0x2')]},'context':{'type':Sequelize[_0xc8c5('0x2')]},'exten':{'type':Sequelize[_0xc8c5('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xc8c5('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0xc8c5('0x2')]},'destcalleridnum':{'type':Sequelize[_0xc8c5('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xc8c5('0x2')]},'destpriority':{'type':Sequelize[_0xc8c5('0x2')]},'destuniqueid':{'type':Sequelize[_0xc8c5('0x2')]},'messageId':{'type':Sequelize[_0xc8c5('0x2')]},'inReplyTo':{'type':Sequelize[_0xc8c5('0x2')]},'subject':{'type':Sequelize[_0xc8c5('0x2')]},'from':{'type':Sequelize[_0xc8c5('0x2')]},'to':{'type':Sequelize[_0xc8c5('0x2')]},'cc':{'type':Sequelize[_0xc8c5('0x2')]},'attachment':{'type':Sequelize[_0xc8c5('0x6')]},'html':{'type':Sequelize[_0xc8c5('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0xc8c5('0x7')](_0xc8c5('0x8'),_0xc8c5('0x9'),_0xc8c5('0xa'),'FAILED')},'url':{'type':Sequelize[_0xc8c5('0x2')]},'app':{'type':Sequelize[_0xc8c5('0x2')]},'appdata':{'type':Sequelize[_0xc8c5('0x2')]},'projectId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 919c8e2..d6db4a7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20b8=['Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','IntegrationReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','catch','create','body','params','find','describe','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x51b8ab,_0x256429){var _0x3a8abb=function(_0x2cf07a){while(--_0x2cf07a){_0x51b8ab['push'](_0x51b8ab['shift']());}};_0x3a8abb(++_0x256429);}(_0x20b8,0x152));var _0x820b=function(_0x66b4a,_0x3c651b){_0x66b4a=_0x66b4a-0x0;var _0x44c585=_0x20b8[_0x66b4a];return _0x44c585;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x820b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x820b('0x1'));var BPromise=require(_0x820b('0x2'));var Mustache=require(_0x820b('0x3'));var util=require(_0x820b('0x4'));var path=require(_0x820b('0x5'));var sox=require(_0x820b('0x6'));var csv=require(_0x820b('0x7'));var ejs=require(_0x820b('0x8'));var fs=require('fs');var fs_extra=require(_0x820b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x820b('0xa'));var jsforce=require(_0x820b('0xb'));var deskjs=require(_0x820b('0xc'));var toCsv=require(_0x820b('0x7'));var querystring=require('querystring');var Papa=require(_0x820b('0xd'));var Redis=require(_0x820b('0xe'));var authService=require(_0x820b('0xf'));var qs=require(_0x820b('0x10'));var as=require(_0x820b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x820b('0x12'))('api');var utils=require(_0x820b('0x13'));var config=require(_0x820b('0x14'));var licenseUtil=require(_0x820b('0x15'));var db=require(_0x820b('0x16'))['db'];function respondWithStatusCode(_0x3791fa,_0x3885da){_0x3885da=_0x3885da||0xcc;return function(_0x2fd4cd){if(_0x2fd4cd){return _0x3791fa[_0x820b('0x17')](_0x3885da);}return _0x3791fa[_0x820b('0x18')](_0x3885da)[_0x820b('0x19')]();};}function respondWithResult(_0x491a2c,_0x4aa38e){_0x4aa38e=_0x4aa38e||0xc8;return function(_0x234f02){if(_0x234f02){return _0x491a2c[_0x820b('0x18')](_0x4aa38e)[_0x820b('0x1a')](_0x234f02);}};}function respondWithFilteredResult(_0xeab538,_0x4bb938){return function(_0x255e3d){if(_0x255e3d){var _0x57d99c=typeof _0x4bb938[_0x820b('0x1b')]===_0x820b('0x1c')&&typeof _0x4bb938[_0x820b('0x1d')]===_0x820b('0x1c');var _0x45332b=_0x255e3d['count'];var _0x578e3b=_0x57d99c?0x0:_0x4bb938[_0x820b('0x1b')];var _0x11c7cb=_0x57d99c?_0x255e3d[_0x820b('0x1e')]:_0x4bb938[_0x820b('0x1b')]+_0x4bb938[_0x820b('0x1d')];var _0x519cd7;if(_0x11c7cb>=_0x45332b){_0x11c7cb=_0x45332b;_0x519cd7=0xc8;}else{_0x519cd7=0xce;}_0xeab538[_0x820b('0x18')](_0x519cd7);return _0xeab538[_0x820b('0x1f')](_0x820b('0x20'),_0x578e3b+'-'+_0x11c7cb+'/'+_0x45332b)[_0x820b('0x1a')](_0x255e3d);}return null;};}function patchUpdates(_0x4d67cb){return function(_0x5670bb){try{jsonpatch[_0x820b('0x21')](_0x5670bb,_0x4d67cb,!![]);}catch(_0x8b8cfb){return BPromise[_0x820b('0x22')](_0x8b8cfb);}return _0x5670bb[_0x820b('0x23')]();};}function saveUpdates(_0x1b261a,_0x18e919){return function(_0x5982fe){if(_0x5982fe){return _0x5982fe[_0x820b('0x24')](_0x1b261a)[_0x820b('0x25')](function(_0x5994d9){return _0x5994d9;});}return null;};}function removeEntity(_0x388db5,_0x5a7d25){return function(_0x4f9bab){if(_0x4f9bab){return _0x4f9bab[_0x820b('0x26')]()[_0x820b('0x25')](function(){_0x388db5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3912e7,_0x3a978a){return function(_0x59413d){if(!_0x59413d){_0x3912e7[_0x820b('0x17')](0x194);}return _0x59413d;};}function handleError(_0x43f6d7,_0x572e6c){_0x572e6c=_0x572e6c||0x1f4;return function(_0x5ac2a9){logger[_0x820b('0x27')](_0x5ac2a9[_0x820b('0x28')]);if(_0x5ac2a9[_0x820b('0x29')]){delete _0x5ac2a9['name'];}_0x43f6d7['status'](_0x572e6c)['send'](_0x5ac2a9);};}exports[_0x820b('0x2a')]=function(_0x295fd6,_0x53d324){var _0xef1e45={},_0x477e2b={},_0x2aba96={'count':0x0,'rows':[]};var _0x58bee9=_[_0x820b('0x2b')](db[_0x820b('0x2c')][_0x820b('0x2d')],function(_0x133069){return{'name':_0x133069[_0x820b('0x2e')],'type':_0x133069[_0x820b('0x2f')]['key']};});_0x477e2b[_0x820b('0x30')]=_[_0x820b('0x2b')](_0x58bee9,'name');_0x477e2b[_0x820b('0x31')]=_[_0x820b('0x32')](_0x295fd6['query']);_0x477e2b['filters']=_[_0x820b('0x33')](_0x477e2b['model'],_0x477e2b[_0x820b('0x31')]);_0xef1e45[_0x820b('0x34')]=_['intersection'](_0x477e2b[_0x820b('0x30')],qs[_0x820b('0x35')](_0x295fd6['query'][_0x820b('0x35')]));_0xef1e45[_0x820b('0x34')]=_0xef1e45[_0x820b('0x34')][_0x820b('0x36')]?_0xef1e45[_0x820b('0x34')]:_0x477e2b['model'];if(!_0x295fd6[_0x820b('0x31')]['hasOwnProperty'](_0x820b('0x37'))){_0xef1e45['limit']=qs['limit'](_0x295fd6['query'][_0x820b('0x1d')]);_0xef1e45[_0x820b('0x1b')]=qs[_0x820b('0x1b')](_0x295fd6[_0x820b('0x31')][_0x820b('0x1b')]);}_0xef1e45[_0x820b('0x38')]=qs[_0x820b('0x39')](_0x295fd6[_0x820b('0x31')][_0x820b('0x39')]);_0xef1e45[_0x820b('0x3a')]=qs[_0x820b('0x3b')](_['pick'](_0x295fd6[_0x820b('0x31')],_0x477e2b[_0x820b('0x3b')]),_0x58bee9);if(_0x295fd6[_0x820b('0x31')][_0x820b('0x3c')]){_0xef1e45['where']=_[_0x820b('0x3d')](_0xef1e45[_0x820b('0x3a')],{'$or':_['map'](_0x58bee9,function(_0x270701){if(_0x270701[_0x820b('0x2f')]!==_0x820b('0x3e')){var _0x5d93d7={};_0x5d93d7[_0x270701[_0x820b('0x29')]]={'$like':'%'+_0x295fd6[_0x820b('0x31')][_0x820b('0x3c')]+'%'};return _0x5d93d7;}})});}_0xef1e45=_[_0x820b('0x3d')]({},_0xef1e45,_0x295fd6[_0x820b('0x3f')]);var _0x3a1e08={'where':_0xef1e45[_0x820b('0x3a')]};return db[_0x820b('0x2c')]['count'](_0x3a1e08)['then'](function(_0x3898ec){_0x2aba96[_0x820b('0x1e')]=_0x3898ec;if(_0x295fd6['query'][_0x820b('0x40')]){_0xef1e45[_0x820b('0x41')]=[{'all':!![]}];}return db['IntegrationReport'][_0x820b('0x42')](_0xef1e45);})[_0x820b('0x25')](function(_0x1fe37c){_0x2aba96['rows']=_0x1fe37c;return _0x2aba96;})['then'](respondWithFilteredResult(_0x53d324,_0xef1e45))['catch'](handleError(_0x53d324,null));};exports[_0x820b('0x43')]=function(_0x5a3cca,_0xc16907){var _0x37df9b={'raw':![],'where':{'id':_0x5a3cca['params']['id']}},_0x1e19cf={};_0x1e19cf['model']=_['keys'](db[_0x820b('0x2c')]['rawAttributes']);_0x1e19cf[_0x820b('0x31')]=_[_0x820b('0x32')](_0x5a3cca[_0x820b('0x31')]);_0x1e19cf[_0x820b('0x3b')]=_[_0x820b('0x33')](_0x1e19cf['model'],_0x1e19cf['query']);_0x37df9b[_0x820b('0x34')]=_[_0x820b('0x33')](_0x1e19cf['model'],qs[_0x820b('0x35')](_0x5a3cca[_0x820b('0x31')][_0x820b('0x35')]));_0x37df9b[_0x820b('0x34')]=_0x37df9b[_0x820b('0x34')][_0x820b('0x36')]?_0x37df9b['attributes']:_0x1e19cf[_0x820b('0x30')];if(_0x5a3cca[_0x820b('0x31')][_0x820b('0x40')]){_0x37df9b['include']=[{'all':!![]}];}_0x37df9b=_[_0x820b('0x3d')]({},_0x37df9b,_0x5a3cca[_0x820b('0x3f')]);return db[_0x820b('0x2c')]['find'](_0x37df9b)[_0x820b('0x25')](handleEntityNotFound(_0xc16907,null))['then'](respondWithResult(_0xc16907,null))[_0x820b('0x44')](handleError(_0xc16907,null));};exports[_0x820b('0x45')]=function(_0xaa2dd6,_0xad55c6){return db[_0x820b('0x2c')][_0x820b('0x45')](_0xaa2dd6[_0x820b('0x46')],{})[_0x820b('0x25')](respondWithResult(_0xad55c6,0xc9))[_0x820b('0x44')](handleError(_0xad55c6,null));};exports[_0x820b('0x24')]=function(_0x25c87a,_0x3c9271){if(_0x25c87a[_0x820b('0x46')]['id']){delete _0x25c87a[_0x820b('0x46')]['id'];}return db[_0x820b('0x2c')]['find']({'where':{'id':_0x25c87a[_0x820b('0x47')]['id']}})[_0x820b('0x25')](handleEntityNotFound(_0x3c9271,null))[_0x820b('0x25')](saveUpdates(_0x25c87a[_0x820b('0x46')],null))[_0x820b('0x25')](respondWithResult(_0x3c9271,null))[_0x820b('0x44')](handleError(_0x3c9271,null));};exports['destroy']=function(_0x2f8399,_0x4f271d){return db[_0x820b('0x2c')][_0x820b('0x48')]({'where':{'id':_0x2f8399[_0x820b('0x47')]['id']}})[_0x820b('0x25')](handleEntityNotFound(_0x4f271d,null))['then'](removeEntity(_0x4f271d,null))[_0x820b('0x44')](handleError(_0x4f271d,null));};exports[_0x820b('0x49')]=function(_0x384650,_0x4b162d){return db[_0x820b('0x2c')]['describe']()['then'](respondWithResult(_0x4b162d,null))[_0x820b('0x44')](handleError(_0x4b162d,null));};
\ No newline at end of file
+var _0xaf2b=['fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','IntegrationReport','includeAll','include','rows','show','params','find','catch','create','body','update','destroy','describe','eml-format','rimraf','zip-dir','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','then','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xaf2b,0x64));var _0xbaf2=function(_0x50b634,_0x1a9974){_0x50b634=_0x50b634-0x0;var _0xcbb832=_0xaf2b[_0x50b634];return _0xcbb832;};'use strict';var emlformat=require(_0xbaf2('0x0'));var rimraf=require(_0xbaf2('0x1'));var zipdir=require(_0xbaf2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbaf2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbaf2('0x4'));var util=require('util');var path=require(_0xbaf2('0x5'));var sox=require(_0xbaf2('0x6'));var csv=require(_0xbaf2('0x7'));var ejs=require(_0xbaf2('0x8'));var fs=require('fs');var fs_extra=require(_0xbaf2('0x9'));var _=require(_0xbaf2('0xa'));var squel=require(_0xbaf2('0xb'));var crypto=require(_0xbaf2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbaf2('0xd'));var toCsv=require(_0xbaf2('0x7'));var querystring=require(_0xbaf2('0xe'));var Papa=require(_0xbaf2('0xf'));var Redis=require(_0xbaf2('0x10'));var authService=require(_0xbaf2('0x11'));var qs=require(_0xbaf2('0x12'));var as=require(_0xbaf2('0x13'));var hardwareService=require(_0xbaf2('0x14'));var logger=require(_0xbaf2('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xbaf2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbaf2('0x17'))['db'];function respondWithStatusCode(_0x10d3ec,_0x41be48){_0x41be48=_0x41be48||0xcc;return function(_0x31a297){if(_0x31a297){return _0x10d3ec[_0xbaf2('0x18')](_0x41be48);}return _0x10d3ec[_0xbaf2('0x19')](_0x41be48)[_0xbaf2('0x1a')]();};}function respondWithResult(_0x3aac06,_0x5be08e){_0x5be08e=_0x5be08e||0xc8;return function(_0x8a8409){if(_0x8a8409){return _0x3aac06[_0xbaf2('0x19')](_0x5be08e)['json'](_0x8a8409);}};}function respondWithFilteredResult(_0x24f5c6,_0x5c5ed6){return function(_0x1716f3){if(_0x1716f3){var _0x581e61=typeof _0x5c5ed6['offset']===_0xbaf2('0x1b')&&typeof _0x5c5ed6['limit']===_0xbaf2('0x1b');var _0x5c1a94=_0x1716f3[_0xbaf2('0x1c')];var _0x497a31=_0x581e61?0x0:_0x5c5ed6[_0xbaf2('0x1d')];var _0x16d5ab=_0x581e61?_0x1716f3[_0xbaf2('0x1c')]:_0x5c5ed6['offset']+_0x5c5ed6[_0xbaf2('0x1e')];var _0x56bb88;if(_0x16d5ab>=_0x5c1a94){_0x16d5ab=_0x5c1a94;_0x56bb88=0xc8;}else{_0x56bb88=0xce;}_0x24f5c6['status'](_0x56bb88);return _0x24f5c6[_0xbaf2('0x1f')](_0xbaf2('0x20'),_0x497a31+'-'+_0x16d5ab+'/'+_0x5c1a94)[_0xbaf2('0x21')](_0x1716f3);}return null;};}function patchUpdates(_0x2a2248){return function(_0x39a2db){try{jsonpatch[_0xbaf2('0x22')](_0x39a2db,_0x2a2248,!![]);}catch(_0x52e3e0){return BPromise[_0xbaf2('0x23')](_0x52e3e0);}return _0x39a2db[_0xbaf2('0x24')]();};}function saveUpdates(_0x5db6d8,_0x59062f){return function(_0x29df31){if(_0x29df31){return _0x29df31['update'](_0x5db6d8)[_0xbaf2('0x25')](function(_0x3f36b0){return _0x3f36b0;});}return null;};}function removeEntity(_0x2683d2,_0x11fc88){return function(_0x9013da){if(_0x9013da){return _0x9013da['destroy']()[_0xbaf2('0x25')](function(){_0x2683d2['status'](0xcc)[_0xbaf2('0x1a')]();});}};}function handleEntityNotFound(_0x467415,_0x12cda9){return function(_0x18820a){if(!_0x18820a){_0x467415[_0xbaf2('0x18')](0x194);}return _0x18820a;};}function handleError(_0x106552,_0x136d4d){_0x136d4d=_0x136d4d||0x1f4;return function(_0x29ccee){logger[_0xbaf2('0x26')](_0x29ccee[_0xbaf2('0x27')]);if(_0x29ccee[_0xbaf2('0x28')]){delete _0x29ccee[_0xbaf2('0x28')];}_0x106552[_0xbaf2('0x19')](_0x136d4d)[_0xbaf2('0x29')](_0x29ccee);};}exports['index']=function(_0x396708,_0xf8d9f){var _0x5ba18f={},_0x16d2e5={},_0x51082a={'count':0x0,'rows':[]};var _0x1644c1=_[_0xbaf2('0x2a')](db['IntegrationReport'][_0xbaf2('0x2b')],function(_0x12e1be){return{'name':_0x12e1be[_0xbaf2('0x2c')],'type':_0x12e1be[_0xbaf2('0x2d')]['key']};});_0x16d2e5[_0xbaf2('0x2e')]=_['map'](_0x1644c1,_0xbaf2('0x28'));_0x16d2e5[_0xbaf2('0x2f')]=_[_0xbaf2('0x30')](_0x396708[_0xbaf2('0x2f')]);_0x16d2e5[_0xbaf2('0x31')]=_[_0xbaf2('0x32')](_0x16d2e5['model'],_0x16d2e5[_0xbaf2('0x2f')]);_0x5ba18f[_0xbaf2('0x33')]=_[_0xbaf2('0x32')](_0x16d2e5[_0xbaf2('0x2e')],qs[_0xbaf2('0x34')](_0x396708[_0xbaf2('0x2f')][_0xbaf2('0x34')]));_0x5ba18f[_0xbaf2('0x33')]=_0x5ba18f[_0xbaf2('0x33')][_0xbaf2('0x35')]?_0x5ba18f['attributes']:_0x16d2e5[_0xbaf2('0x2e')];if(!_0x396708['query'][_0xbaf2('0x36')]('nolimit')){_0x5ba18f[_0xbaf2('0x1e')]=qs[_0xbaf2('0x1e')](_0x396708['query']['limit']);_0x5ba18f[_0xbaf2('0x1d')]=qs[_0xbaf2('0x1d')](_0x396708[_0xbaf2('0x2f')][_0xbaf2('0x1d')]);}_0x5ba18f[_0xbaf2('0x37')]=qs['sort'](_0x396708[_0xbaf2('0x2f')][_0xbaf2('0x38')]);_0x5ba18f[_0xbaf2('0x39')]=qs[_0xbaf2('0x31')](_[_0xbaf2('0x3a')](_0x396708[_0xbaf2('0x2f')],_0x16d2e5['filters']),_0x1644c1);if(_0x396708[_0xbaf2('0x2f')][_0xbaf2('0x3b')]){_0x5ba18f[_0xbaf2('0x39')]=_[_0xbaf2('0x3c')](_0x5ba18f['where'],{'$or':_['map'](_0x1644c1,function(_0x553c8d){if(_0x553c8d[_0xbaf2('0x2d')]!==_0xbaf2('0x3d')){var _0x4ee67f={};_0x4ee67f[_0x553c8d[_0xbaf2('0x28')]]={'$like':'%'+_0x396708['query']['filter']+'%'};return _0x4ee67f;}})});}_0x5ba18f=_['merge']({},_0x5ba18f,_0x396708[_0xbaf2('0x3e')]);var _0x55be19={'where':_0x5ba18f[_0xbaf2('0x39')]};return db[_0xbaf2('0x3f')][_0xbaf2('0x1c')](_0x55be19)[_0xbaf2('0x25')](function(_0x331107){_0x51082a['count']=_0x331107;if(_0x396708[_0xbaf2('0x2f')][_0xbaf2('0x40')]){_0x5ba18f[_0xbaf2('0x41')]=[{'all':!![]}];}return db[_0xbaf2('0x3f')]['findAll'](_0x5ba18f);})[_0xbaf2('0x25')](function(_0x449106){_0x51082a[_0xbaf2('0x42')]=_0x449106;return _0x51082a;})[_0xbaf2('0x25')](respondWithFilteredResult(_0xf8d9f,_0x5ba18f))['catch'](handleError(_0xf8d9f,null));};exports[_0xbaf2('0x43')]=function(_0x2f545f,_0x178f02){var _0x1128c0={'raw':![],'where':{'id':_0x2f545f[_0xbaf2('0x44')]['id']}},_0xf4aea2={};_0xf4aea2[_0xbaf2('0x2e')]=_[_0xbaf2('0x30')](db['IntegrationReport'][_0xbaf2('0x2b')]);_0xf4aea2['query']=_[_0xbaf2('0x30')](_0x2f545f[_0xbaf2('0x2f')]);_0xf4aea2[_0xbaf2('0x31')]=_[_0xbaf2('0x32')](_0xf4aea2['model'],_0xf4aea2[_0xbaf2('0x2f')]);_0x1128c0[_0xbaf2('0x33')]=_[_0xbaf2('0x32')](_0xf4aea2['model'],qs[_0xbaf2('0x34')](_0x2f545f['query'][_0xbaf2('0x34')]));_0x1128c0[_0xbaf2('0x33')]=_0x1128c0[_0xbaf2('0x33')]['length']?_0x1128c0['attributes']:_0xf4aea2[_0xbaf2('0x2e')];if(_0x2f545f[_0xbaf2('0x2f')][_0xbaf2('0x40')]){_0x1128c0[_0xbaf2('0x41')]=[{'all':!![]}];}_0x1128c0=_[_0xbaf2('0x3c')]({},_0x1128c0,_0x2f545f[_0xbaf2('0x3e')]);return db['IntegrationReport'][_0xbaf2('0x45')](_0x1128c0)['then'](handleEntityNotFound(_0x178f02,null))[_0xbaf2('0x25')](respondWithResult(_0x178f02,null))[_0xbaf2('0x46')](handleError(_0x178f02,null));};exports[_0xbaf2('0x47')]=function(_0x94285a,_0x4a2cad){return db['IntegrationReport'][_0xbaf2('0x47')](_0x94285a[_0xbaf2('0x48')],{})[_0xbaf2('0x25')](respondWithResult(_0x4a2cad,0xc9))[_0xbaf2('0x46')](handleError(_0x4a2cad,null));};exports[_0xbaf2('0x49')]=function(_0xa8af21,_0x4380c8){if(_0xa8af21[_0xbaf2('0x48')]['id']){delete _0xa8af21['body']['id'];}return db[_0xbaf2('0x3f')][_0xbaf2('0x45')]({'where':{'id':_0xa8af21[_0xbaf2('0x44')]['id']}})[_0xbaf2('0x25')](handleEntityNotFound(_0x4380c8,null))[_0xbaf2('0x25')](saveUpdates(_0xa8af21['body'],null))['then'](respondWithResult(_0x4380c8,null))[_0xbaf2('0x46')](handleError(_0x4380c8,null));};exports[_0xbaf2('0x4a')]=function(_0x17c2d5,_0x3cc814){return db[_0xbaf2('0x3f')][_0xbaf2('0x45')]({'where':{'id':_0x17c2d5['params']['id']}})[_0xbaf2('0x25')](handleEntityNotFound(_0x3cc814,null))[_0xbaf2('0x25')](removeEntity(_0x3cc814,null))[_0xbaf2('0x46')](handleError(_0x3cc814,null));};exports[_0xbaf2('0x4b')]=function(_0x2d75e9,_0x1ac43a){return db['IntegrationReport'][_0xbaf2('0x4b')]()['then'](respondWithResult(_0x1ac43a,null))[_0xbaf2('0x46')](handleError(_0x1ac43a,null));};
\ No newline at end of file
index 1be2d9b..eeab025 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdfa6=['IntegrationReport','report_integration','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports'];(function(_0x3cc751,_0x38b8ff){var _0x3956a2=function(_0x237cbc){while(--_0x237cbc){_0x3cc751['push'](_0x3cc751['shift']());}};_0x3956a2(++_0x38b8ff);}(_0xdfa6,0x136));var _0x6dfa=function(_0x3cb6b7,_0x42b5f7){_0x3cb6b7=_0x3cb6b7-0x0;var _0x5c3622=_0xdfa6[_0x3cb6b7];return _0x5c3622;};'use strict';var _=require(_0x6dfa('0x0'));var util=require(_0x6dfa('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x6dfa('0x2'));var rp=require(_0x6dfa('0x3'));var fs=require('fs');var path=require(_0x6dfa('0x4'));var rimraf=require(_0x6dfa('0x5'));var config=require(_0x6dfa('0x6'));var attributes=require(_0x6dfa('0x7'));module[_0x6dfa('0x8')]=function(_0x3807f3,_0xcef5fc){return _0x3807f3['define'](_0x6dfa('0x9'),attributes,{'tableName':_0x6dfa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xcdc9=['IntegrationReport','report_integration','util','../../config/logger','bluebird','../../config/environment','./integrationReport.attributes','define'];(function(_0x376f50,_0x1b6855){var _0x1c5f2e=function(_0x50adf8){while(--_0x50adf8){_0x376f50['push'](_0x376f50['shift']());}};_0x1c5f2e(++_0x1b6855);}(_0xcdc9,0x1ea));var _0x9cdc=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xcdc9[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0x9cdc('0x0'));var logger=require(_0x9cdc('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9cdc('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9cdc('0x3'));var attributes=require(_0x9cdc('0x4'));module['exports']=function(_0x388134,_0x495229){return _0x388134[_0x9cdc('0x5')](_0x9cdc('0x6'),attributes,{'tableName':_0x9cdc('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 917c369..64d7e09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x24ead3,_0xd59aaf){var _0x3f876a=function(_0x456ba9){while(--_0x456ba9){_0x24ead3['push'](_0x24ead3['shift']());}};_0x3f876a(++_0xd59aaf);}(_0xdb28,0x106));var _0x8db2=function(_0x1c6b1e,_0x471eff){_0x1c6b1e=_0x1c6b1e-0x0;var _0x48ab00=_0xdb28[_0x1c6b1e];return _0x48ab00;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
+var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x50514b,_0x83db65){var _0x5d8587=function(_0x327ba5){while(--_0x327ba5){_0x50514b['push'](_0x50514b['shift']());}};_0x5d8587(++_0x83db65);}(_0xadb5,0xad));var _0x5adb=function(_0x2c6845,_0x4861c1){_0x2c6845=_0x2c6845-0x0;var _0x3c85b9=_0xadb5[_0x2c6845];return _0x3c85b9;};'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']('IntegrationReport,\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 f369961..5b9a186 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d17=['put','update','delete','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./interval.controller','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','post','addInterval','/:id/sub_intervals/create_many','addIntervals'];(function(_0x2e05ad,_0x2fd1c3){var _0x37f0d9=function(_0x419a10){while(--_0x419a10){_0x2e05ad['push'](_0x2e05ad['shift']());}};_0x37f0d9(++_0x2fd1c3);}(_0x5d17,0x114));var _0x75d1=function(_0x35c1c8,_0x14f618){_0x35c1c8=_0x35c1c8-0x0;var _0x3b0377=_0x5d17[_0x35c1c8];return _0x3b0377;};'use strict';var multer=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x75d1('0x2'));var router=express[_0x75d1('0x3')]();var fs_extra=require(_0x75d1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x75d1('0x5'));var config=require(_0x75d1('0x6'));var controller=require(_0x75d1('0x7'));router[_0x75d1('0x8')]('/',auth['isAuthenticated'](),controller[_0x75d1('0x9')]);router[_0x75d1('0x8')](_0x75d1('0xa'),auth[_0x75d1('0xb')](),controller[_0x75d1('0xc')]);router[_0x75d1('0x8')](_0x75d1('0xd'),auth['isAuthenticated'](),controller['getIntervals']);router[_0x75d1('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x75d1('0xe')](_0x75d1('0xd'),auth['isAuthenticated'](),controller[_0x75d1('0xf')]);router[_0x75d1('0xe')](_0x75d1('0x10'),auth[_0x75d1('0xb')](),controller[_0x75d1('0x11')]);router[_0x75d1('0x12')]('/:id',auth[_0x75d1('0xb')](),controller[_0x75d1('0x13')]);router[_0x75d1('0x14')](_0x75d1('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xbe41=['./interval.controller','isAuthenticated','index','get','/:id','getIntervals','post','create','/:id/sub_intervals','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x139d15,_0x1c2917){var _0x51f96d=function(_0x27b9a4){while(--_0x27b9a4){_0x139d15['push'](_0x139d15['shift']());}};_0x51f96d(++_0x1c2917);}(_0xbe41,0x1b9));var _0x1be4=function(_0x39b45f,_0x195c23){_0x39b45f=_0x39b45f-0x0;var _0x141715=_0xbe41[_0x39b45f];return _0x141715;};'use strict';var multer=require(_0x1be4('0x0'));var util=require(_0x1be4('0x1'));var path=require(_0x1be4('0x2'));var timeout=require(_0x1be4('0x3'));var express=require(_0x1be4('0x4'));var router=express[_0x1be4('0x5')]();var fs_extra=require(_0x1be4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x1be4('0x7'));var config=require(_0x1be4('0x8'));var controller=require(_0x1be4('0x9'));router['get']('/',auth[_0x1be4('0xa')](),controller[_0x1be4('0xb')]);router[_0x1be4('0xc')](_0x1be4('0xd'),auth[_0x1be4('0xa')](),controller['show']);router['get']('/:id/sub_intervals',auth['isAuthenticated'](),controller[_0x1be4('0xe')]);router[_0x1be4('0xf')]('/',auth[_0x1be4('0xa')](),controller[_0x1be4('0x10')]);router['post'](_0x1be4('0x11'),auth[_0x1be4('0xa')](),controller[_0x1be4('0x12')]);router[_0x1be4('0xf')](_0x1be4('0x13'),auth[_0x1be4('0xa')](),controller[_0x1be4('0x14')]);router[_0x1be4('0x15')](_0x1be4('0xd'),auth[_0x1be4('0xa')](),controller[_0x1be4('0x16')]);router['delete']('/:id',auth[_0x1be4('0xa')](),controller[_0x1be4('0x17')]);module[_0x1be4('0x18')]=router;
\ No newline at end of file
index 3fcc549..0b4a9d0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3460=['sequelize','exports'];(function(_0xeb850f,_0x39aadd){var _0x4be635=function(_0xbc4b05){while(--_0xbc4b05){_0xeb850f['push'](_0xeb850f['shift']());}};_0x4be635(++_0x39aadd);}(_0x3460,0x13e));var _0x0346=function(_0x2e0d80,_0x11d29f){_0x2e0d80=_0x2e0d80-0x0;var _0x333398=_0x3460[_0x2e0d80];return _0x333398;};'use strict';var Sequelize=require(_0x0346('0x0'));module[_0x0346('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}};
\ No newline at end of file
+var _0x2359=['exports','STRING','sequelize'];(function(_0x389fa3,_0x35fc4b){var _0x4a1809=function(_0x4f5d04){while(--_0x4f5d04){_0x389fa3['push'](_0x389fa3['shift']());}};_0x4a1809(++_0x35fc4b);}(_0x2359,0x173));var _0x9235=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x2359[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x9235('0x0'));module[_0x9235('0x1')]={'name':{'type':Sequelize[_0x9235('0x2')]},'description':{'type':Sequelize[_0x9235('0x2')]},'interval':{'type':Sequelize[_0x9235('0x2')],'allowNull':!![]}};
\ No newline at end of file
index 32089e2..1876261 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x048c=['keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Intervals','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','hasOwnProperty','addIntervals','findAll','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','status','json','offset','undefined','count','set','update','destroy','then','get','stack','name','index','Interval','rawAttributes','fieldName','type','key','model','map','query'];(function(_0x117d03,_0xdd48c5){var _0x197cc3=function(_0x1d5039){while(--_0x1d5039){_0x117d03['push'](_0x117d03['shift']());}};_0x197cc3(++_0xdd48c5);}(_0x048c,0x7f));var _0xc048=function(_0x33d5e3,_0x5b2be2){_0x33d5e3=_0x33d5e3-0x0;var _0xb267a2=_0x048c[_0x33d5e3];return _0xb267a2;};'use strict';var emlformat=require(_0xc048('0x0'));var rimraf=require(_0xc048('0x1'));var zipdir=require(_0xc048('0x2'));var jsonpatch=require(_0xc048('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc048('0x4'));var Mustache=require(_0xc048('0x5'));var util=require('util');var path=require(_0xc048('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc048('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc048('0x8'));var crypto=require(_0xc048('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xc048('0xa'));var toCsv=require(_0xc048('0xb'));var querystring=require(_0xc048('0xc'));var Papa=require(_0xc048('0xd'));var Redis=require('ioredis');var authService=require(_0xc048('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc048('0xf'));var hardwareService=require(_0xc048('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xc048('0x11'));var config=require(_0xc048('0x12'));var licenseUtil=require(_0xc048('0x13'));var db=require(_0xc048('0x14'))['db'];var extensions=require(_0xc048('0x15'));function respondWithStatusCode(_0x182507,_0x35731c){_0x35731c=_0x35731c||0xcc;return function(_0x21d830){if(_0x21d830){return _0x182507[_0xc048('0x16')](_0x35731c);}return _0x182507['status'](_0x35731c)[_0xc048('0x17')]();};}function respondWithResult(_0x40d050,_0x2f6b66){_0x2f6b66=_0x2f6b66||0xc8;return function(_0x11ab8a){if(_0x11ab8a){return _0x40d050[_0xc048('0x18')](_0x2f6b66)[_0xc048('0x19')](_0x11ab8a);}};}function respondWithFilteredResult(_0x4f0b6b,_0x34b5f3){return function(_0x4f951a){if(_0x4f951a){var _0x181656=typeof _0x34b5f3[_0xc048('0x1a')]===_0xc048('0x1b')&&typeof _0x34b5f3['limit']===_0xc048('0x1b');var _0x2a622b=_0x4f951a[_0xc048('0x1c')];var _0x5d9e66=_0x181656?0x0:_0x34b5f3[_0xc048('0x1a')];var _0x3b94b0=_0x181656?_0x4f951a[_0xc048('0x1c')]:_0x34b5f3['offset']+_0x34b5f3['limit'];var _0x565d0b;if(_0x3b94b0>=_0x2a622b){_0x3b94b0=_0x2a622b;_0x565d0b=0xc8;}else{_0x565d0b=0xce;}_0x4f0b6b[_0xc048('0x18')](_0x565d0b);return _0x4f0b6b[_0xc048('0x1d')]('Content-Range',_0x5d9e66+'-'+_0x3b94b0+'/'+_0x2a622b)[_0xc048('0x19')](_0x4f951a);}return null;};}function patchUpdates(_0x38ed4e){return function(_0x36c442){try{jsonpatch['apply'](_0x36c442,_0x38ed4e,!![]);}catch(_0x3b10f2){return BPromise['reject'](_0x3b10f2);}return _0x36c442['save']();};}function saveUpdates(_0x47e53d,_0x293285){return function(_0x411326){if(_0x411326){return _0x411326[_0xc048('0x1e')](_0x47e53d)['then'](function(_0x4947f4){return _0x4947f4;});}return null;};}function removeEntity(_0x493534,_0x31513a){return function(_0x39aecd){if(_0x39aecd){return _0x39aecd[_0xc048('0x1f')]()[_0xc048('0x20')](function(){var _0x5b690c=_0x39aecd[_0xc048('0x21')]({'plain':!![]});var _0x2ebf8a='Intervals';return db['UserProfileResource']['destroy']({'where':{'type':_0x2ebf8a,'resourceId':_0x5b690c['id']}})['then'](function(){return _0x39aecd;});})[_0xc048('0x20')](function(){_0x493534[_0xc048('0x18')](0xcc)[_0xc048('0x17')]();});}};}function handleEntityNotFound(_0x2b2263,_0x41ac15){return function(_0x3c532e){if(!_0x3c532e){_0x2b2263['sendStatus'](0x194);}return _0x3c532e;};}function handleError(_0x34d426,_0x18921c){_0x18921c=_0x18921c||0x1f4;return function(_0x13b601){logger['error'](_0x13b601[_0xc048('0x22')]);if(_0x13b601[_0xc048('0x23')]){delete _0x13b601[_0xc048('0x23')];}_0x34d426[_0xc048('0x18')](_0x18921c)['send'](_0x13b601);};}exports[_0xc048('0x24')]=function(_0x3c12a6,_0x262fd6){var _0x1a540c={},_0x2e0deb={},_0x206dfc={'count':0x0,'rows':[]};var _0x94f6be=_['map'](db[_0xc048('0x25')][_0xc048('0x26')],function(_0x42b632){return{'name':_0x42b632[_0xc048('0x27')],'type':_0x42b632[_0xc048('0x28')][_0xc048('0x29')]};});_0x2e0deb[_0xc048('0x2a')]=_[_0xc048('0x2b')](_0x94f6be,_0xc048('0x23'));_0x2e0deb[_0xc048('0x2c')]=_[_0xc048('0x2d')](_0x3c12a6[_0xc048('0x2c')]);_0x2e0deb[_0xc048('0x2e')]=_[_0xc048('0x2f')](_0x2e0deb[_0xc048('0x2a')],_0x2e0deb[_0xc048('0x2c')]);_0x1a540c[_0xc048('0x30')]=_[_0xc048('0x2f')](_0x2e0deb[_0xc048('0x2a')],qs[_0xc048('0x31')](_0x3c12a6[_0xc048('0x2c')][_0xc048('0x31')]));_0x1a540c[_0xc048('0x30')]=_0x1a540c[_0xc048('0x30')][_0xc048('0x32')]?_0x1a540c[_0xc048('0x30')]:_0x2e0deb[_0xc048('0x2a')];if(!_0x3c12a6[_0xc048('0x2c')]['hasOwnProperty'](_0xc048('0x33'))){_0x1a540c['limit']=qs[_0xc048('0x34')](_0x3c12a6[_0xc048('0x2c')][_0xc048('0x34')]);_0x1a540c['offset']=qs[_0xc048('0x1a')](_0x3c12a6[_0xc048('0x2c')][_0xc048('0x1a')]);}_0x1a540c[_0xc048('0x35')]=qs[_0xc048('0x36')](_0x3c12a6['query'][_0xc048('0x36')]);_0x1a540c[_0xc048('0x37')]=qs[_0xc048('0x2e')](_[_0xc048('0x38')](_0x3c12a6[_0xc048('0x2c')],_0x2e0deb[_0xc048('0x2e')]),_0x94f6be);if(_0x3c12a6[_0xc048('0x2c')]['filter']){_0x1a540c[_0xc048('0x37')]=_['merge'](_0x1a540c['where'],{'$or':_[_0xc048('0x2b')](_0x94f6be,function(_0xbb1a66){if(_0xbb1a66[_0xc048('0x28')]!==_0xc048('0x39')){var _0x459833={};_0x459833[_0xbb1a66[_0xc048('0x23')]]={'$like':'%'+_0x3c12a6[_0xc048('0x2c')][_0xc048('0x3a')]+'%'};return _0x459833;}})});}_0x1a540c=_[_0xc048('0x3b')]({},_0x1a540c,_0x3c12a6[_0xc048('0x3c')]);var _0x55c8a7={'where':_0x1a540c[_0xc048('0x37')]};return db['Interval'][_0xc048('0x1c')](_0x55c8a7)[_0xc048('0x20')](function(_0x578f3d){_0x206dfc[_0xc048('0x1c')]=_0x578f3d;if(_0x3c12a6['query'][_0xc048('0x3d')]){_0x1a540c[_0xc048('0x3e')]=[{'all':!![]}];}return db[_0xc048('0x25')]['findAll'](_0x1a540c);})[_0xc048('0x20')](function(_0x41afa9){_0x206dfc[_0xc048('0x3f')]=_0x41afa9;return _0x206dfc;})[_0xc048('0x20')](respondWithFilteredResult(_0x262fd6,_0x1a540c))[_0xc048('0x40')](handleError(_0x262fd6,null));};exports['show']=function(_0x15c1fd,_0x19ac91){var _0x13dcd5={'raw':!![],'where':{'id':_0x15c1fd[_0xc048('0x41')]['id']}},_0xec0b69={};_0xec0b69[_0xc048('0x2a')]=_[_0xc048('0x2d')](db[_0xc048('0x25')]['rawAttributes']);_0xec0b69[_0xc048('0x2c')]=_['keys'](_0x15c1fd[_0xc048('0x2c')]);_0xec0b69[_0xc048('0x2e')]=_[_0xc048('0x2f')](_0xec0b69[_0xc048('0x2a')],_0xec0b69['query']);_0x13dcd5[_0xc048('0x30')]=_[_0xc048('0x2f')](_0xec0b69['model'],qs['fields'](_0x15c1fd['query']['fields']));_0x13dcd5[_0xc048('0x30')]=_0x13dcd5[_0xc048('0x30')][_0xc048('0x32')]?_0x13dcd5[_0xc048('0x30')]:_0xec0b69[_0xc048('0x2a')];if(_0x15c1fd[_0xc048('0x2c')][_0xc048('0x3d')]){_0x13dcd5[_0xc048('0x3e')]=[{'all':!![]}];}_0x13dcd5=_[_0xc048('0x3b')]({},_0x13dcd5,_0x15c1fd[_0xc048('0x3c')]);return db[_0xc048('0x25')]['find'](_0x13dcd5)[_0xc048('0x20')](handleEntityNotFound(_0x19ac91,null))[_0xc048('0x20')](respondWithResult(_0x19ac91,null))[_0xc048('0x40')](handleError(_0x19ac91,null));};exports[_0xc048('0x42')]=function(_0x16c45e,_0x556f70){return db[_0xc048('0x25')][_0xc048('0x42')](_0x16c45e[_0xc048('0x43')],{})[_0xc048('0x20')](function(_0x1c8585){var _0x26279e=_0x16c45e[_0xc048('0x44')][_0xc048('0x21')]({'plain':!![]});if(!_0x26279e)throw new Error(_0xc048('0x45'));if(_0x26279e[_0xc048('0x46')]===_0xc048('0x44')){var _0x168a2d=_0x1c8585['get']({'plain':!![]});var _0x10833b=_0xc048('0x47');return db[_0xc048('0x48')][_0xc048('0x49')]({'where':{'name':_0x10833b,'userProfileId':_0x26279e[_0xc048('0x4a')]},'raw':!![]})['then'](function(_0x51baed){if(_0x51baed&&_0x51baed[_0xc048('0x4b')]===0x0){return db[_0xc048('0x4c')]['create']({'name':_0x168a2d[_0xc048('0x23')],'resourceId':_0x168a2d['id'],'type':_0x51baed[_0xc048('0x23')],'sectionId':_0x51baed['id']},{})[_0xc048('0x20')](function(){return _0x1c8585;});}else{return _0x1c8585;}})[_0xc048('0x40')](function(_0xbfce70){logger[_0xc048('0x4d')](_0xc048('0x4e'),_0xbfce70);throw _0xbfce70;});}return _0x1c8585;})[_0xc048('0x20')](respondWithResult(_0x556f70,0xc9))[_0xc048('0x40')](handleError(_0x556f70,null));};exports['update']=function(_0x5c3b2e,_0x1a9a86){if(_0x5c3b2e[_0xc048('0x43')]['id']){delete _0x5c3b2e['body']['id'];}return db[_0xc048('0x25')][_0xc048('0x49')]({'where':{'id':_0x5c3b2e[_0xc048('0x41')]['id']}})['then'](handleEntityNotFound(_0x1a9a86,null))[_0xc048('0x20')](saveUpdates(_0x5c3b2e[_0xc048('0x43')],null))[_0xc048('0x20')](respondWithResult(_0x1a9a86,null))[_0xc048('0x40')](handleError(_0x1a9a86,null));};exports[_0xc048('0x1f')]=function(_0x5be236,_0x559290){return db[_0xc048('0x25')]['find']({'where':{'id':_0x5be236['params']['id']}})['then'](handleEntityNotFound(_0x559290,null))[_0xc048('0x20')](removeEntity(_0x559290,null))[_0xc048('0x40')](handleError(_0x559290,null));};exports[_0xc048('0x4f')]=function(_0x35e56b,_0x28e860,_0x187942){if(_0x35e56b['body']['id']){delete _0x35e56b[_0xc048('0x43')]['id'];}return db[_0xc048('0x25')][_0xc048('0x49')]({'where':{'id':_0x35e56b[_0xc048('0x41')]['id']}})[_0xc048('0x20')](handleEntityNotFound(_0x28e860,null))[_0xc048('0x20')](function(_0x3a0482){if(_0x3a0482){_0x35e56b[_0xc048('0x43')][_0xc048('0x50')]=_0x3a0482['id'];return db[_0xc048('0x25')]['create'](_0x35e56b[_0xc048('0x43')]);}})[_0xc048('0x20')](respondWithResult(_0x28e860,null))[_0xc048('0x40')](handleError(_0x28e860,null));};exports[_0xc048('0x51')]=function(_0x4ad61c,_0x5e3ecc,_0x37e32c){var _0x4202d4={};var _0x92d85={};var _0x226320;var _0x8cbb27;return db[_0xc048('0x25')][_0xc048('0x52')]({'where':{'id':_0x4ad61c[_0xc048('0x41')]['id']}})[_0xc048('0x20')](handleEntityNotFound(_0x5e3ecc,null))[_0xc048('0x20')](function(_0x5cacbf){if(_0x5cacbf){_0x226320=_0x5cacbf;_0x92d85['model']=_[_0xc048('0x2d')](db[_0xc048('0x25')][_0xc048('0x26')]);_0x92d85['query']=_[_0xc048('0x2d')](_0x4ad61c[_0xc048('0x2c')]);_0x92d85['filters']=_['intersection'](_0x92d85[_0xc048('0x2a')],_0x92d85['query']);_0x4202d4[_0xc048('0x30')]=_[_0xc048('0x2f')](_0x92d85['model'],qs[_0xc048('0x31')](_0x4ad61c['query'][_0xc048('0x31')]));_0x4202d4[_0xc048('0x30')]=_0x4202d4[_0xc048('0x30')][_0xc048('0x32')]?_0x4202d4[_0xc048('0x30')]:_0x92d85[_0xc048('0x2a')];_0x4202d4['order']=qs[_0xc048('0x36')](_0x4ad61c['query'][_0xc048('0x36')]);_0x4202d4[_0xc048('0x37')]=qs['filters'](_[_0xc048('0x38')](_0x4ad61c[_0xc048('0x2c')],_0x92d85[_0xc048('0x2e')]));if(_0x4ad61c['query'][_0xc048('0x3a')]){_0x4202d4[_0xc048('0x37')]=_['merge'](_0x4202d4[_0xc048('0x37')],{'$or':_['map'](_0x4202d4['attributes'],function(_0x2bdb3d){var _0x3ee22f={};_0x3ee22f[_0x2bdb3d]={'$like':'%'+_0x4ad61c[_0xc048('0x2c')][_0xc048('0x3a')]+'%'};return _0x3ee22f;})});}_0x4202d4=_[_0xc048('0x3b')]({},_0x4202d4,_0x4ad61c['options']);return _0x226320['getIntervals'](_0x4202d4);}})[_0xc048('0x20')](function(_0xbb5d32){if(_0xbb5d32){_0x8cbb27=_0xbb5d32[_0xc048('0x32')];if(!_0x4ad61c['query'][_0xc048('0x53')](_0xc048('0x33'))){_0x4202d4[_0xc048('0x34')]=qs[_0xc048('0x34')](_0x4ad61c[_0xc048('0x2c')][_0xc048('0x34')]);_0x4202d4[_0xc048('0x1a')]=qs['offset'](_0x4ad61c['query'][_0xc048('0x1a')]);}return _0x226320[_0xc048('0x51')](_0x4202d4);}})[_0xc048('0x20')](function(_0x69b6ee){if(_0x69b6ee){return _0x69b6ee?{'count':_0x8cbb27,'rows':_0x69b6ee}:null;}})['then'](respondWithResult(_0x5e3ecc,null))[_0xc048('0x40')](handleError(_0x5e3ecc,null));};exports[_0xc048('0x54')]=function(_0x21e507,_0x4e180d,_0x57fd86){return db[_0xc048('0x25')][_0xc048('0x52')]({'where':{'id':_0x21e507[_0xc048('0x41')]['id']}})['then'](handleEntityNotFound(_0x4e180d,null))['then'](function(_0x368025){if(_0x368025){return db['sequelize']['transaction'](function(_0x104973){return db['Interval'][_0xc048('0x1f')]({'where':{'IntervalId':_0x21e507[_0xc048('0x41')]['id']},'transaction':_0x104973})[_0xc048('0x20')](function(_0x515f05){var _0x4c32cd=_[_0xc048('0x2b')](_0x21e507[_0xc048('0x43')],function(_0x3c9a6e){delete _0x3c9a6e['id'];_0x3c9a6e[_0xc048('0x50')]=_0x21e507['params']['id'];return _0x3c9a6e;});return db[_0xc048('0x25')]['bulkCreate'](_0x4c32cd,{'transaction':_0x104973});});})[_0xc048('0x20')](function(){return db[_0xc048('0x25')][_0xc048('0x55')]({'where':{'IntervalId':_0x21e507['params']['id']}});});}})[_0xc048('0x20')](respondWithResult(_0x4e180d,null))[_0xc048('0x40')](handleError(_0x4e180d,null));};
\ No newline at end of file
+var _0xed80=['update','then','get','Intervals','UserProfileResource','destroy','end','stack','name','send','map','Interval','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','sort','where','filter','merge','type','VIRTUAL','includeAll','findAll','show','include','options','find','catch','create','body','role','user','UserProfileSection','autoAssociation','error','params','addInterval','getIntervals','findOne','order','hasOwnProperty','nolimit','addIntervals','sequelize','transaction','IntervalId','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','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','../../components/extensions/rewrite','sendStatus','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save'];(function(_0x2ad502,_0x2b6085){var _0x24fdfc=function(_0x5821ec){while(--_0x5821ec){_0x2ad502['push'](_0x2ad502['shift']());}};_0x24fdfc(++_0x2b6085);}(_0xed80,0xef));var _0x0ed8=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xed80[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x0ed8('0x0'));var rimraf=require(_0x0ed8('0x1'));var zipdir=require(_0x0ed8('0x2'));var jsonpatch=require(_0x0ed8('0x3'));var rp=require('request-promise');var moment=require(_0x0ed8('0x4'));var BPromise=require(_0x0ed8('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x0ed8('0x6'));var sox=require(_0x0ed8('0x7'));var csv=require(_0x0ed8('0x8'));var ejs=require(_0x0ed8('0x9'));var fs=require('fs');var fs_extra=require(_0x0ed8('0xa'));var _=require(_0x0ed8('0xb'));var squel=require(_0x0ed8('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0ed8('0xd'));var toCsv=require(_0x0ed8('0x8'));var querystring=require(_0x0ed8('0xe'));var Papa=require(_0x0ed8('0xf'));var Redis=require('ioredis');var authService=require(_0x0ed8('0x10'));var qs=require(_0x0ed8('0x11'));var as=require(_0x0ed8('0x12'));var hardwareService=require(_0x0ed8('0x13'));var logger=require(_0x0ed8('0x14'))(_0x0ed8('0x15'));var utils=require(_0x0ed8('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0ed8('0x17'));var db=require('../../mysqldb')['db'];var extensions=require(_0x0ed8('0x18'));function respondWithStatusCode(_0x228f34,_0x489135){_0x489135=_0x489135||0xcc;return function(_0x1e2e17){if(_0x1e2e17){return _0x228f34[_0x0ed8('0x19')](_0x489135);}return _0x228f34[_0x0ed8('0x1a')](_0x489135)['end']();};}function respondWithResult(_0x15859a,_0x5e24b4){_0x5e24b4=_0x5e24b4||0xc8;return function(_0x3c4efc){if(_0x3c4efc){return _0x15859a[_0x0ed8('0x1a')](_0x5e24b4)[_0x0ed8('0x1b')](_0x3c4efc);}};}function respondWithFilteredResult(_0x1a50c6,_0x12247b){return function(_0x3fe64b){if(_0x3fe64b){var _0x549f6e=typeof _0x12247b['offset']===_0x0ed8('0x1c')&&typeof _0x12247b[_0x0ed8('0x1d')]===_0x0ed8('0x1c');var _0x191b67=_0x3fe64b['count'];var _0x457609=_0x549f6e?0x0:_0x12247b[_0x0ed8('0x1e')];var _0x30de2a=_0x549f6e?_0x3fe64b[_0x0ed8('0x1f')]:_0x12247b[_0x0ed8('0x1e')]+_0x12247b['limit'];var _0x2ab6ab;if(_0x30de2a>=_0x191b67){_0x30de2a=_0x191b67;_0x2ab6ab=0xc8;}else{_0x2ab6ab=0xce;}_0x1a50c6[_0x0ed8('0x1a')](_0x2ab6ab);return _0x1a50c6[_0x0ed8('0x20')](_0x0ed8('0x21'),_0x457609+'-'+_0x30de2a+'/'+_0x191b67)['json'](_0x3fe64b);}return null;};}function patchUpdates(_0x42712c){return function(_0xc414d0){try{jsonpatch[_0x0ed8('0x22')](_0xc414d0,_0x42712c,!![]);}catch(_0x4830c6){return BPromise[_0x0ed8('0x23')](_0x4830c6);}return _0xc414d0[_0x0ed8('0x24')]();};}function saveUpdates(_0x4ad4bc,_0x49dbc0){return function(_0x4cb625){if(_0x4cb625){return _0x4cb625[_0x0ed8('0x25')](_0x4ad4bc)[_0x0ed8('0x26')](function(_0x3ac667){return _0x3ac667;});}return null;};}function removeEntity(_0x58b74f,_0x2e9480){return function(_0x4086ce){if(_0x4086ce){return _0x4086ce['destroy']()['then'](function(){var _0x53c08c=_0x4086ce[_0x0ed8('0x27')]({'plain':!![]});var _0x27011b=_0x0ed8('0x28');return db[_0x0ed8('0x29')][_0x0ed8('0x2a')]({'where':{'type':_0x27011b,'resourceId':_0x53c08c['id']}})[_0x0ed8('0x26')](function(){return _0x4086ce;});})[_0x0ed8('0x26')](function(){_0x58b74f[_0x0ed8('0x1a')](0xcc)[_0x0ed8('0x2b')]();});}};}function handleEntityNotFound(_0x684aeb,_0x5b075a){return function(_0x38dcfc){if(!_0x38dcfc){_0x684aeb[_0x0ed8('0x19')](0x194);}return _0x38dcfc;};}function handleError(_0x4f8dc5,_0x1b8e1d){_0x1b8e1d=_0x1b8e1d||0x1f4;return function(_0x5c962e){logger['error'](_0x5c962e[_0x0ed8('0x2c')]);if(_0x5c962e[_0x0ed8('0x2d')]){delete _0x5c962e[_0x0ed8('0x2d')];}_0x4f8dc5['status'](_0x1b8e1d)[_0x0ed8('0x2e')](_0x5c962e);};}exports['index']=function(_0x5b7884,_0x122a2a){var _0x3e1890={},_0x33e3c4={},_0x284466={'count':0x0,'rows':[]};var _0x21ea60=_[_0x0ed8('0x2f')](db[_0x0ed8('0x30')][_0x0ed8('0x31')],function(_0x435f35){return{'name':_0x435f35[_0x0ed8('0x32')],'type':_0x435f35['type'][_0x0ed8('0x33')]};});_0x33e3c4[_0x0ed8('0x34')]=_[_0x0ed8('0x2f')](_0x21ea60,'name');_0x33e3c4[_0x0ed8('0x35')]=_[_0x0ed8('0x36')](_0x5b7884[_0x0ed8('0x35')]);_0x33e3c4[_0x0ed8('0x37')]=_['intersection'](_0x33e3c4[_0x0ed8('0x34')],_0x33e3c4[_0x0ed8('0x35')]);_0x3e1890['attributes']=_[_0x0ed8('0x38')](_0x33e3c4[_0x0ed8('0x34')],qs[_0x0ed8('0x39')](_0x5b7884['query'][_0x0ed8('0x39')]));_0x3e1890[_0x0ed8('0x3a')]=_0x3e1890[_0x0ed8('0x3a')][_0x0ed8('0x3b')]?_0x3e1890[_0x0ed8('0x3a')]:_0x33e3c4[_0x0ed8('0x34')];if(!_0x5b7884['query']['hasOwnProperty']('nolimit')){_0x3e1890[_0x0ed8('0x1d')]=qs[_0x0ed8('0x1d')](_0x5b7884[_0x0ed8('0x35')]['limit']);_0x3e1890[_0x0ed8('0x1e')]=qs[_0x0ed8('0x1e')](_0x5b7884['query'][_0x0ed8('0x1e')]);}_0x3e1890['order']=qs[_0x0ed8('0x3c')](_0x5b7884[_0x0ed8('0x35')][_0x0ed8('0x3c')]);_0x3e1890[_0x0ed8('0x3d')]=qs['filters'](_['pick'](_0x5b7884[_0x0ed8('0x35')],_0x33e3c4[_0x0ed8('0x37')]),_0x21ea60);if(_0x5b7884[_0x0ed8('0x35')][_0x0ed8('0x3e')]){_0x3e1890['where']=_[_0x0ed8('0x3f')](_0x3e1890[_0x0ed8('0x3d')],{'$or':_[_0x0ed8('0x2f')](_0x21ea60,function(_0xd36db){if(_0xd36db[_0x0ed8('0x40')]!==_0x0ed8('0x41')){var _0x44db26={};_0x44db26[_0xd36db[_0x0ed8('0x2d')]]={'$like':'%'+_0x5b7884[_0x0ed8('0x35')][_0x0ed8('0x3e')]+'%'};return _0x44db26;}})});}_0x3e1890=_['merge']({},_0x3e1890,_0x5b7884['options']);var _0x5a4c64={'where':_0x3e1890[_0x0ed8('0x3d')]};return db[_0x0ed8('0x30')][_0x0ed8('0x1f')](_0x5a4c64)[_0x0ed8('0x26')](function(_0x5c3262){_0x284466[_0x0ed8('0x1f')]=_0x5c3262;if(_0x5b7884[_0x0ed8('0x35')][_0x0ed8('0x42')]){_0x3e1890['include']=[{'all':!![]}];}return db[_0x0ed8('0x30')][_0x0ed8('0x43')](_0x3e1890);})[_0x0ed8('0x26')](function(_0x1baba4){_0x284466['rows']=_0x1baba4;return _0x284466;})['then'](respondWithFilteredResult(_0x122a2a,_0x3e1890))['catch'](handleError(_0x122a2a,null));};exports[_0x0ed8('0x44')]=function(_0x261759,_0x3f9690){var _0x1c9dac={'raw':!![],'where':{'id':_0x261759['params']['id']}},_0x165d0b={};_0x165d0b['model']=_[_0x0ed8('0x36')](db[_0x0ed8('0x30')][_0x0ed8('0x31')]);_0x165d0b['query']=_['keys'](_0x261759[_0x0ed8('0x35')]);_0x165d0b[_0x0ed8('0x37')]=_['intersection'](_0x165d0b['model'],_0x165d0b['query']);_0x1c9dac[_0x0ed8('0x3a')]=_[_0x0ed8('0x38')](_0x165d0b[_0x0ed8('0x34')],qs[_0x0ed8('0x39')](_0x261759[_0x0ed8('0x35')]['fields']));_0x1c9dac[_0x0ed8('0x3a')]=_0x1c9dac[_0x0ed8('0x3a')]['length']?_0x1c9dac[_0x0ed8('0x3a')]:_0x165d0b[_0x0ed8('0x34')];if(_0x261759[_0x0ed8('0x35')][_0x0ed8('0x42')]){_0x1c9dac[_0x0ed8('0x45')]=[{'all':!![]}];}_0x1c9dac=_[_0x0ed8('0x3f')]({},_0x1c9dac,_0x261759[_0x0ed8('0x46')]);return db[_0x0ed8('0x30')][_0x0ed8('0x47')](_0x1c9dac)[_0x0ed8('0x26')](handleEntityNotFound(_0x3f9690,null))[_0x0ed8('0x26')](respondWithResult(_0x3f9690,null))[_0x0ed8('0x48')](handleError(_0x3f9690,null));};exports[_0x0ed8('0x49')]=function(_0x27fbfc,_0x3127d6){return db[_0x0ed8('0x30')]['create'](_0x27fbfc[_0x0ed8('0x4a')],{})[_0x0ed8('0x26')](function(_0x5b84c6){var _0xa7dd71=_0x27fbfc['user'][_0x0ed8('0x27')]({'plain':!![]});if(!_0xa7dd71)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa7dd71[_0x0ed8('0x4b')]===_0x0ed8('0x4c')){var _0x427e9f=_0x5b84c6[_0x0ed8('0x27')]({'plain':!![]});var _0x1279af=_0x0ed8('0x28');return db[_0x0ed8('0x4d')][_0x0ed8('0x47')]({'where':{'name':_0x1279af,'userProfileId':_0xa7dd71['userProfileId']},'raw':!![]})[_0x0ed8('0x26')](function(_0x24431d){if(_0x24431d&&_0x24431d[_0x0ed8('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x427e9f[_0x0ed8('0x2d')],'resourceId':_0x427e9f['id'],'type':_0x24431d['name'],'sectionId':_0x24431d['id']},{})[_0x0ed8('0x26')](function(){return _0x5b84c6;});}else{return _0x5b84c6;}})[_0x0ed8('0x48')](function(_0x1e2177){logger[_0x0ed8('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e2177);throw _0x1e2177;});}return _0x5b84c6;})[_0x0ed8('0x26')](respondWithResult(_0x3127d6,0xc9))[_0x0ed8('0x48')](handleError(_0x3127d6,null));};exports['update']=function(_0xf95369,_0x32a9db){if(_0xf95369[_0x0ed8('0x4a')]['id']){delete _0xf95369[_0x0ed8('0x4a')]['id'];}return db[_0x0ed8('0x30')][_0x0ed8('0x47')]({'where':{'id':_0xf95369[_0x0ed8('0x50')]['id']}})[_0x0ed8('0x26')](handleEntityNotFound(_0x32a9db,null))['then'](saveUpdates(_0xf95369[_0x0ed8('0x4a')],null))[_0x0ed8('0x26')](respondWithResult(_0x32a9db,null))[_0x0ed8('0x48')](handleError(_0x32a9db,null));};exports[_0x0ed8('0x2a')]=function(_0x5d8046,_0x3aac39){return db[_0x0ed8('0x30')][_0x0ed8('0x47')]({'where':{'id':_0x5d8046[_0x0ed8('0x50')]['id']}})[_0x0ed8('0x26')](handleEntityNotFound(_0x3aac39,null))['then'](removeEntity(_0x3aac39,null))[_0x0ed8('0x48')](handleError(_0x3aac39,null));};exports[_0x0ed8('0x51')]=function(_0x134d49,_0x16955b,_0x59056e){if(_0x134d49[_0x0ed8('0x4a')]['id']){delete _0x134d49[_0x0ed8('0x4a')]['id'];}return db['Interval'][_0x0ed8('0x47')]({'where':{'id':_0x134d49[_0x0ed8('0x50')]['id']}})['then'](handleEntityNotFound(_0x16955b,null))[_0x0ed8('0x26')](function(_0x3609e6){if(_0x3609e6){_0x134d49['body']['IntervalId']=_0x3609e6['id'];return db['Interval'][_0x0ed8('0x49')](_0x134d49[_0x0ed8('0x4a')]);}})[_0x0ed8('0x26')](respondWithResult(_0x16955b,null))[_0x0ed8('0x48')](handleError(_0x16955b,null));};exports[_0x0ed8('0x52')]=function(_0x317c07,_0x23becb,_0x5ca25a){var _0x26ef6e={};var _0xde2d83={};var _0x27f95f;var _0x1b7633;return db['Interval'][_0x0ed8('0x53')]({'where':{'id':_0x317c07['params']['id']}})['then'](handleEntityNotFound(_0x23becb,null))[_0x0ed8('0x26')](function(_0x26e702){if(_0x26e702){_0x27f95f=_0x26e702;_0xde2d83[_0x0ed8('0x34')]=_[_0x0ed8('0x36')](db[_0x0ed8('0x30')]['rawAttributes']);_0xde2d83['query']=_[_0x0ed8('0x36')](_0x317c07[_0x0ed8('0x35')]);_0xde2d83[_0x0ed8('0x37')]=_[_0x0ed8('0x38')](_0xde2d83['model'],_0xde2d83['query']);_0x26ef6e[_0x0ed8('0x3a')]=_['intersection'](_0xde2d83[_0x0ed8('0x34')],qs[_0x0ed8('0x39')](_0x317c07[_0x0ed8('0x35')][_0x0ed8('0x39')]));_0x26ef6e[_0x0ed8('0x3a')]=_0x26ef6e[_0x0ed8('0x3a')][_0x0ed8('0x3b')]?_0x26ef6e['attributes']:_0xde2d83['model'];_0x26ef6e[_0x0ed8('0x54')]=qs[_0x0ed8('0x3c')](_0x317c07[_0x0ed8('0x35')]['sort']);_0x26ef6e['where']=qs[_0x0ed8('0x37')](_['pick'](_0x317c07['query'],_0xde2d83[_0x0ed8('0x37')]));if(_0x317c07[_0x0ed8('0x35')][_0x0ed8('0x3e')]){_0x26ef6e[_0x0ed8('0x3d')]=_['merge'](_0x26ef6e['where'],{'$or':_[_0x0ed8('0x2f')](_0x26ef6e[_0x0ed8('0x3a')],function(_0x1883b0){var _0x94d703={};_0x94d703[_0x1883b0]={'$like':'%'+_0x317c07['query'][_0x0ed8('0x3e')]+'%'};return _0x94d703;})});}_0x26ef6e=_[_0x0ed8('0x3f')]({},_0x26ef6e,_0x317c07[_0x0ed8('0x46')]);return _0x27f95f['getIntervals'](_0x26ef6e);}})[_0x0ed8('0x26')](function(_0x5d6d60){if(_0x5d6d60){_0x1b7633=_0x5d6d60[_0x0ed8('0x3b')];if(!_0x317c07[_0x0ed8('0x35')][_0x0ed8('0x55')](_0x0ed8('0x56'))){_0x26ef6e[_0x0ed8('0x1d')]=qs[_0x0ed8('0x1d')](_0x317c07[_0x0ed8('0x35')][_0x0ed8('0x1d')]);_0x26ef6e[_0x0ed8('0x1e')]=qs['offset'](_0x317c07[_0x0ed8('0x35')][_0x0ed8('0x1e')]);}return _0x27f95f['getIntervals'](_0x26ef6e);}})[_0x0ed8('0x26')](function(_0x2e55){if(_0x2e55){return _0x2e55?{'count':_0x1b7633,'rows':_0x2e55}:null;}})[_0x0ed8('0x26')](respondWithResult(_0x23becb,null))[_0x0ed8('0x48')](handleError(_0x23becb,null));};exports[_0x0ed8('0x57')]=function(_0x5cf5b6,_0x22d408,_0x2b6376){return db[_0x0ed8('0x30')][_0x0ed8('0x53')]({'where':{'id':_0x5cf5b6[_0x0ed8('0x50')]['id']}})['then'](handleEntityNotFound(_0x22d408,null))[_0x0ed8('0x26')](function(_0x4a70d5){if(_0x4a70d5){return db[_0x0ed8('0x58')][_0x0ed8('0x59')](function(_0x33687f){return db[_0x0ed8('0x30')][_0x0ed8('0x2a')]({'where':{'IntervalId':_0x5cf5b6[_0x0ed8('0x50')]['id']},'transaction':_0x33687f})[_0x0ed8('0x26')](function(_0x1765e7){var _0x6a6fa8=_[_0x0ed8('0x2f')](_0x5cf5b6[_0x0ed8('0x4a')],function(_0x27cb8a){delete _0x27cb8a['id'];_0x27cb8a[_0x0ed8('0x5a')]=_0x5cf5b6[_0x0ed8('0x50')]['id'];return _0x27cb8a;});return db['Interval'][_0x0ed8('0x5b')](_0x6a6fa8,{'transaction':_0x33687f});});})[_0x0ed8('0x26')](function(){return db[_0x0ed8('0x30')]['findAll']({'where':{'IntervalId':_0x5cf5b6['params']['id']}});});}})[_0x0ed8('0x26')](respondWithResult(_0x22d408,null))[_0x0ed8('0x48')](handleError(_0x22d408,null));};
\ No newline at end of file
index e47d52d..2347b25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb0cb=['rewrite','util','../../config/logger','path','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','Interval'];(function(_0x505f4b,_0x245f70){var _0x314a09=function(_0x26b50f){while(--_0x26b50f){_0x505f4b['push'](_0x505f4b['shift']());}};_0x314a09(++_0x245f70);}(_0xb0cb,0x1c3));var _0xbb0c=function(_0x5cb1af,_0x4bdc8c){_0x5cb1af=_0x5cb1af-0x0;var _0x8d7940=_0xb0cb[_0x5cb1af];return _0x8d7940;};'use strict';var _=require('lodash');var util=require(_0xbb0c('0x0'));var logger=require(_0xbb0c('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb0c('0x2'));var rimraf=require('rimraf');var config=require(_0xbb0c('0x3'));var attributes=require(_0xbb0c('0x4'));var extensions=require(_0xbb0c('0x5'));module[_0xbb0c('0x6')]=function(_0x57f7cc,_0xff23f5){return _0x57f7cc['define'](_0xbb0c('0x7'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x574994,_0x5d10ac){extensions['rewrite'](_0x57f7cc,_0x574994);},'afterBulkCreate':function(_0x1c153a,_0x21ee65,_0x3f11bc){_0x3f11bc();extensions[_0xbb0c('0x8')](_0x57f7cc,_0x1c153a[0x0]);},'afterUpdate':function(_0x20554c,_0x18fb52){extensions[_0xbb0c('0x8')](_0x57f7cc,_0x20554c);},'afterDestroy':function(_0x3d7d8d,_0x45332d){extensions[_0xbb0c('0x8')](_0x57f7cc,_0x3d7d8d);}}});};
\ No newline at end of file
+var _0x17ac=['tools_intervals','rewrite','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','define','Interval'];(function(_0x5a26db,_0x2c5ccd){var _0x4619dd=function(_0x21e28f){while(--_0x21e28f){_0x5a26db['push'](_0x5a26db['shift']());}};_0x4619dd(++_0x2c5ccd);}(_0x17ac,0x13a));var _0xc17a=function(_0x34beef,_0x41d368){_0x34beef=_0x34beef-0x0;var _0x5c45ca=_0x17ac[_0x34beef];return _0x5c45ca;};'use strict';var _=require(_0xc17a('0x0'));var util=require(_0xc17a('0x1'));var logger=require(_0xc17a('0x2'))('api');var moment=require(_0xc17a('0x3'));var BPromise=require(_0xc17a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc17a('0x5'));var config=require(_0xc17a('0x6'));var attributes=require(_0xc17a('0x7'));var extensions=require(_0xc17a('0x8'));module['exports']=function(_0x27ce5e,_0x1c60e1){return _0x27ce5e[_0xc17a('0x9')](_0xc17a('0xa'),attributes,{'tableName':_0xc17a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x278227,_0x448adf){extensions[_0xc17a('0xc')](_0x27ce5e,_0x278227);},'afterBulkCreate':function(_0x1a9588,_0x2b35e8,_0x1c93ae){_0x1c93ae();extensions[_0xc17a('0xc')](_0x27ce5e,_0x1a9588[0x0]);},'afterUpdate':function(_0x458392,_0x146bd3){extensions[_0xc17a('0xc')](_0x27ce5e,_0x458392);},'afterDestroy':function(_0x8c409c,_0x13de8c){extensions[_0xc17a('0xc')](_0x27ce5e,_0x8c409c);}}});};
\ No newline at end of file
index c01e423..6b10dc3 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(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}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(_0x1afabf,_0x56fdcc){var _0x497ff1=function(_0x2f6104){while(--_0x2f6104){_0x1afabf['push'](_0x1afabf['shift']());}};_0x497ff1(++_0x56fdcc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'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 26bbd48..2d4d3f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb28=['isAuthenticated','send','exports','express','Router','../../components/auth/service','./jira.controller'];(function(_0x416dd9,_0x167b0a){var _0x5e348c=function(_0x4415e8){while(--_0x4415e8){_0x416dd9['push'](_0x416dd9['shift']());}};_0x5e348c(++_0x167b0a);}(_0xdb28,0x106));var _0x8db2=function(_0x4b81c6,_0x535677){_0x4b81c6=_0x4b81c6-0x0;var _0x27fb13=_0xdb28[_0x4b81c6];return _0x27fb13;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['post']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);module[_0x8db2('0x6')]=router;
\ No newline at end of file
+var _0xb10b=['./jira.controller','post','send','exports','express','../../components/auth/service'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xb10b,0x12a));var _0xbb10=function(_0x18175b,_0x4d7376){_0x18175b=_0x18175b-0x0;var _0x210d45=_0xb10b[_0x18175b];return _0x210d45;};'use strict';var express=require(_0xbb10('0x0'));var router=express['Router']();var auth=require(_0xbb10('0x1'));var controller=require(_0xbb10('0x2'));router[_0xbb10('0x3')]('/',auth['isAuthenticated'](),controller[_0xbb10('0x4')]);module[_0xbb10('0x5')]=router;
\ No newline at end of file
index 8d8873a..203a449 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e97=['bluebird','https','api','key','MOTGUI','summary','description','stringify','issuetype','Bug','email','fields','customfield_11501','oldToken','newToken','customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','base64','request','setEncoding','utf8','status','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','end','openIssue','send','body','x-forwarded-for','connection','socket','remoteAddress'];(function(_0x386abf,_0x3780e1){var _0x2e44c4=function(_0x28ae2c){while(--_0x28ae2c){_0x386abf['push'](_0x386abf['shift']());}};_0x2e44c4(++_0x3780e1);}(_0x7e97,0xfc));var _0x77e9=function(_0x5cfc76,_0x552fce){_0x5cfc76=_0x5cfc76-0x0;var _0xab27b5=_0x7e97[_0x5cfc76];return _0xab27b5;};'use strict';var BPromise=require(_0x77e9('0x0'));var https=require(_0x77e9('0x1'));var logger=require('../../config/logger')(_0x77e9('0x2'));var USERNAME='support';var PASSWORD='3eAmWpBVP0';function openIssue(_0x208e61,_0x397e7f){var _0x47c9e1={'fields':{'project':{'key':_0x208e61[_0x77e9('0x3')]||_0x77e9('0x4')},'summary':(_0x208e61[_0x77e9('0x5')]||'Report')+'\x20from\x20'+_0x208e61['ip'],'description':_0x208e61[_0x77e9('0x6')]||JSON[_0x77e9('0x7')](_0x208e61),'issuetype':{'name':_0x208e61[_0x77e9('0x8')]||_0x77e9('0x9')}}};_0x47c9e1['fields']['customfield_11500']=_0x208e61[_0x77e9('0xa')];_0x47c9e1[_0x77e9('0xb')][_0x77e9('0xc')]=_0x208e61[_0x77e9('0xd')];_0x47c9e1[_0x77e9('0xb')]['customfield_11502']=_0x208e61[_0x77e9('0xe')];_0x47c9e1['fields'][_0x77e9('0xf')]=_0x208e61[_0x77e9('0x10')];_0x47c9e1[_0x77e9('0xb')]['customfield_11504']=_0x208e61[_0x77e9('0x11')];_0x47c9e1[_0x77e9('0xb')][_0x77e9('0x12')]=_0x208e61['ip'];var _0x2f2fc0={'host':_0x77e9('0x13'),'port':0x1bb,'path':_0x77e9('0x14'),'method':_0x77e9('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x77e9('0x16'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x77e9('0x17'))}};var _0x532f3e=JSON[_0x77e9('0x7')](_0x47c9e1);var _0x4801e4=https[_0x77e9('0x18')](_0x2f2fc0,function(_0x2f7e59){_0x2f7e59[_0x77e9('0x19')](_0x77e9('0x1a'));var _0x5ee2af='';_0x2f7e59['on']('data',function(_0x3c4ec7){_0x5ee2af+=_0x3c4ec7;});_0x2f7e59['on']('end',function(){if(_0x397e7f){return _0x397e7f[_0x77e9('0x1b')](_0x2f7e59['statusCode'])[_0x77e9('0x1c')](JSON[_0x77e9('0x1d')](_0x5ee2af));}});});_0x4801e4['on'](_0x77e9('0x1e'),function(_0x12f7ff){if(_0x397e7f){return _0x397e7f[_0x77e9('0x1b')](0x1f4)[_0x77e9('0x1c')]({'errors':[{'message':_0x77e9('0x1f'),'type':_0x77e9('0x20')}]});}});_0x4801e4[_0x77e9('0x21')](_0x532f3e);_0x4801e4[_0x77e9('0x22')]();}exports[_0x77e9('0x23')]=openIssue;exports[_0x77e9('0x24')]=function(_0x372eef,_0x501d47){_0x372eef[_0x77e9('0x25')]['ip']=_0x372eef['headers'][_0x77e9('0x26')]||_0x372eef[_0x77e9('0x27')]['remoteAddress']||_0x372eef[_0x77e9('0x28')][_0x77e9('0x29')]||_0x372eef['connection']['socket'][_0x77e9('0x29')];return openIssue(_0x372eef[_0x77e9('0x25')],_0x501d47);};
\ No newline at end of file
+var _0x9088=['/rest/api/2/issue','POST','application/json','Basic\x20','toString','base64','request','setEncoding','utf8','data','end','status','statusCode','json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','body','x-forwarded-for','remoteAddress','connection','https','../../config/logger','support','3eAmWpBVP0','key','summary','Report','\x20from\x20','description','stringify','Bug','email','fields','customfield_11501','oldToken','newToken','customfield_11503','name','customfield_11504'];(function(_0x21b36c,_0x543483){var _0x236627=function(_0x174f99){while(--_0x174f99){_0x21b36c['push'](_0x21b36c['shift']());}};_0x236627(++_0x543483);}(_0x9088,0x68));var _0x8908=function(_0x34131d,_0x3edb2e){_0x34131d=_0x34131d-0x0;var _0x1857da=_0x9088[_0x34131d];return _0x1857da;};'use strict';var BPromise=require('bluebird');var https=require(_0x8908('0x0'));var logger=require(_0x8908('0x1'))('api');var USERNAME=_0x8908('0x2');var PASSWORD=_0x8908('0x3');function openIssue(_0x3ce013,_0x1b548a){var _0x4abcb8={'fields':{'project':{'key':_0x3ce013[_0x8908('0x4')]||'MOTGUI'},'summary':(_0x3ce013[_0x8908('0x5')]||_0x8908('0x6'))+_0x8908('0x7')+_0x3ce013['ip'],'description':_0x3ce013[_0x8908('0x8')]||JSON[_0x8908('0x9')](_0x3ce013),'issuetype':{'name':_0x3ce013['issuetype']||_0x8908('0xa')}}};_0x4abcb8['fields']['customfield_11500']=_0x3ce013[_0x8908('0xb')];_0x4abcb8[_0x8908('0xc')][_0x8908('0xd')]=_0x3ce013[_0x8908('0xe')];_0x4abcb8[_0x8908('0xc')]['customfield_11502']=_0x3ce013[_0x8908('0xf')];_0x4abcb8[_0x8908('0xc')][_0x8908('0x10')]=_0x3ce013[_0x8908('0x11')];_0x4abcb8[_0x8908('0xc')][_0x8908('0x12')]=_0x3ce013['reason'];_0x4abcb8[_0x8908('0xc')]['customfield_10102']=_0x3ce013['ip'];var _0x5b2d0c={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x8908('0x13'),'method':_0x8908('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0x8908('0x15'),'Authorization':_0x8908('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0x8908('0x17')](_0x8908('0x18'))}};var _0x3ac1f0=JSON['stringify'](_0x4abcb8);var _0x281598=https[_0x8908('0x19')](_0x5b2d0c,function(_0x3ecaba){_0x3ecaba[_0x8908('0x1a')](_0x8908('0x1b'));var _0x3c2203='';_0x3ecaba['on'](_0x8908('0x1c'),function(_0x38b7ed){_0x3c2203+=_0x38b7ed;});_0x3ecaba['on'](_0x8908('0x1d'),function(){if(_0x1b548a){return _0x1b548a[_0x8908('0x1e')](_0x3ecaba[_0x8908('0x1f')])[_0x8908('0x20')](JSON['parse'](_0x3c2203));}});});_0x281598['on'](_0x8908('0x21'),function(_0x5a0940){if(_0x1b548a){return _0x1b548a[_0x8908('0x1e')](0x1f4)['json']({'errors':[{'message':_0x8908('0x22'),'type':_0x8908('0x23')}]});}});_0x281598[_0x8908('0x24')](_0x3ac1f0);_0x281598[_0x8908('0x1d')]();}exports['openIssue']=openIssue;exports['send']=function(_0x20cd0a,_0x4212cb){_0x20cd0a[_0x8908('0x25')]['ip']=_0x20cd0a['headers'][_0x8908('0x26')]||_0x20cd0a['connection'][_0x8908('0x27')]||_0x20cd0a['socket'][_0x8908('0x27')]||_0x20cd0a[_0x8908('0x28')]['socket'][_0x8908('0x27')];return openIssue(_0x20cd0a[_0x8908('0x25')],_0x4212cb);};
\ No newline at end of file
index 35f1d43..ced673f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbec5=['describe','/:id','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyAnswerReport.controller','get','index','/describe','isAuthenticated'];(function(_0x1046e8,_0x45086a){var _0xb4051e=function(_0x4d073c){while(--_0x4d073c){_0x1046e8['push'](_0x1046e8['shift']());}};_0xb4051e(++_0x45086a);}(_0xbec5,0xe5));var _0x5bec=function(_0x497b1e,_0x586379){_0x497b1e=_0x497b1e-0x0;var _0x3f72e1=_0xbec5[_0x497b1e];return _0x3f72e1;};'use strict';var multer=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var path=require('path');var timeout=require(_0x5bec('0x2'));var express=require(_0x5bec('0x3'));var router=express[_0x5bec('0x4')]();var fs_extra=require(_0x5bec('0x5'));var auth=require(_0x5bec('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5bec('0x7'));var controller=require(_0x5bec('0x8'));router[_0x5bec('0x9')]('/',auth['isAuthenticated'](),controller[_0x5bec('0xa')]);router[_0x5bec('0x9')](_0x5bec('0xb'),auth[_0x5bec('0xc')](),controller[_0x5bec('0xd')]);router[_0x5bec('0x9')](_0x5bec('0xe'),auth[_0x5bec('0xc')](),controller['show']);router[_0x5bec('0xf')]('/',auth['isAuthenticated'](),controller[_0x5bec('0x10')]);router[_0x5bec('0x11')](_0x5bec('0xe'),auth['isAuthenticated'](),controller[_0x5bec('0x12')]);router[_0x5bec('0x13')](_0x5bec('0xe'),auth['isAuthenticated'](),controller[_0x5bec('0x14')]);module[_0x5bec('0x15')]=router;
\ No newline at end of file
+var _0x6c76=['express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','multer','util','path'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x6c76,0x184));var _0x66c7=function(_0x1b0c08,_0xd7531f){_0x1b0c08=_0x1b0c08-0x0;var _0x123dbf=_0x6c76[_0x1b0c08];return _0x123dbf;};'use strict';var multer=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var path=require(_0x66c7('0x2'));var timeout=require('connect-timeout');var express=require(_0x66c7('0x3'));var router=express[_0x66c7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x66c7('0x5'));var config=require(_0x66c7('0x6'));var controller=require('./jscriptyAnswerReport.controller');router[_0x66c7('0x7')]('/',auth[_0x66c7('0x8')](),controller['index']);router[_0x66c7('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x66c7('0x9')]);router[_0x66c7('0x7')](_0x66c7('0xa'),auth['isAuthenticated'](),controller[_0x66c7('0xb')]);router[_0x66c7('0xc')]('/',auth[_0x66c7('0x8')](),controller[_0x66c7('0xd')]);router['put'](_0x66c7('0xa'),auth[_0x66c7('0x8')](),controller[_0x66c7('0xe')]);router[_0x66c7('0xf')](_0x66c7('0xa'),auth[_0x66c7('0x8')](),controller[_0x66c7('0x10')]);module['exports']=router;
\ No newline at end of file
index d0ffd84..07c1a20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x5b3c4b,_0x565928){_0x5b3c4b=_0x5b3c4b-0x0;var _0x1d7c0e=_0x7a54[_0x5b3c4b];return _0x1d7c0e;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}};
\ No newline at end of file
+var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x7a54,0x106));var _0x47a5=function(_0x56de2a,_0x14bfe1){_0x56de2a=_0x56de2a-0x0;var _0x56de52=_0x7a54[_0x56de2a];return _0x56de52;};'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 07d68ff..557996f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd101=['then','destroy','error','stack','name','send','map','JscriptyAnswerReport','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update'];(function(_0x3ce726,_0x4a7a8d){var _0x2cdef6=function(_0x25ae93){while(--_0x25ae93){_0x3ce726['push'](_0x3ce726['shift']());}};_0x2cdef6(++_0x4a7a8d);}(_0xd101,0xc1));var _0x1d10=function(_0x2b9d88,_0x569e02){_0x2b9d88=_0x2b9d88-0x0;var _0x92ad6a=_0xd101[_0x2b9d88];return _0x92ad6a;};'use strict';var emlformat=require(_0x1d10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1d10('0x1'));var jsonpatch=require(_0x1d10('0x2'));var rp=require(_0x1d10('0x3'));var moment=require(_0x1d10('0x4'));var BPromise=require(_0x1d10('0x5'));var Mustache=require(_0x1d10('0x6'));var util=require(_0x1d10('0x7'));var path=require(_0x1d10('0x8'));var sox=require('sox');var csv=require(_0x1d10('0x9'));var ejs=require(_0x1d10('0xa'));var fs=require('fs');var fs_extra=require(_0x1d10('0xb'));var _=require(_0x1d10('0xc'));var squel=require(_0x1d10('0xd'));var crypto=require(_0x1d10('0xe'));var jsforce=require(_0x1d10('0xf'));var deskjs=require(_0x1d10('0x10'));var toCsv=require(_0x1d10('0x9'));var querystring=require(_0x1d10('0x11'));var Papa=require(_0x1d10('0x12'));var Redis=require(_0x1d10('0x13'));var authService=require(_0x1d10('0x14'));var qs=require(_0x1d10('0x15'));var as=require(_0x1d10('0x16'));var hardwareService=require(_0x1d10('0x17'));var logger=require(_0x1d10('0x18'))('api');var utils=require(_0x1d10('0x19'));var config=require(_0x1d10('0x1a'));var licenseUtil=require(_0x1d10('0x1b'));var db=require(_0x1d10('0x1c'))['db'];function respondWithStatusCode(_0x268506,_0x5b71d8){_0x5b71d8=_0x5b71d8||0xcc;return function(_0x3f6bd8){if(_0x3f6bd8){return _0x268506[_0x1d10('0x1d')](_0x5b71d8);}return _0x268506[_0x1d10('0x1e')](_0x5b71d8)[_0x1d10('0x1f')]();};}function respondWithResult(_0x2224ff,_0x183bc4){_0x183bc4=_0x183bc4||0xc8;return function(_0x56bc3d){if(_0x56bc3d){return _0x2224ff[_0x1d10('0x1e')](_0x183bc4)[_0x1d10('0x20')](_0x56bc3d);}};}function respondWithFilteredResult(_0x306953,_0x2ad3c0){return function(_0x4f014a){if(_0x4f014a){var _0x3aedf7=typeof _0x2ad3c0[_0x1d10('0x21')]===_0x1d10('0x22')&&typeof _0x2ad3c0[_0x1d10('0x23')]===_0x1d10('0x22');var _0x382b37=_0x4f014a[_0x1d10('0x24')];var _0x4f3e2a=_0x3aedf7?0x0:_0x2ad3c0[_0x1d10('0x21')];var _0x1163dd=_0x3aedf7?_0x4f014a[_0x1d10('0x24')]:_0x2ad3c0[_0x1d10('0x21')]+_0x2ad3c0[_0x1d10('0x23')];var _0x5e61f8;if(_0x1163dd>=_0x382b37){_0x1163dd=_0x382b37;_0x5e61f8=0xc8;}else{_0x5e61f8=0xce;}_0x306953['status'](_0x5e61f8);return _0x306953[_0x1d10('0x25')]('Content-Range',_0x4f3e2a+'-'+_0x1163dd+'/'+_0x382b37)['json'](_0x4f014a);}return null;};}function patchUpdates(_0x5774f9){return function(_0x237b92){try{jsonpatch[_0x1d10('0x26')](_0x237b92,_0x5774f9,!![]);}catch(_0x24717c){return BPromise[_0x1d10('0x27')](_0x24717c);}return _0x237b92['save']();};}function saveUpdates(_0x5e5315,_0x140147){return function(_0x5da6cf){if(_0x5da6cf){return _0x5da6cf[_0x1d10('0x28')](_0x5e5315)[_0x1d10('0x29')](function(_0x160802){return _0x160802;});}return null;};}function removeEntity(_0x37f22d,_0x127b37){return function(_0x3601ba){if(_0x3601ba){return _0x3601ba[_0x1d10('0x2a')]()[_0x1d10('0x29')](function(){_0x37f22d[_0x1d10('0x1e')](0xcc)[_0x1d10('0x1f')]();});}};}function handleEntityNotFound(_0xf1e4c8,_0x5abc58){return function(_0x666012){if(!_0x666012){_0xf1e4c8[_0x1d10('0x1d')](0x194);}return _0x666012;};}function handleError(_0x475934,_0x15f2ee){_0x15f2ee=_0x15f2ee||0x1f4;return function(_0x18e7d9){logger[_0x1d10('0x2b')](_0x18e7d9[_0x1d10('0x2c')]);if(_0x18e7d9[_0x1d10('0x2d')]){delete _0x18e7d9['name'];}_0x475934[_0x1d10('0x1e')](_0x15f2ee)[_0x1d10('0x2e')](_0x18e7d9);};}exports['index']=function(_0x13a3dc,_0x52d514){var _0x4db221={},_0x41b5b8={},_0x597aea={'count':0x0,'rows':[]};var _0xa4e6aa=_[_0x1d10('0x2f')](db[_0x1d10('0x30')][_0x1d10('0x31')],function(_0x1a43fd){return{'name':_0x1a43fd[_0x1d10('0x32')],'type':_0x1a43fd['type']['key']};});_0x41b5b8[_0x1d10('0x33')]=_[_0x1d10('0x2f')](_0xa4e6aa,_0x1d10('0x2d'));_0x41b5b8[_0x1d10('0x34')]=_[_0x1d10('0x35')](_0x13a3dc[_0x1d10('0x34')]);_0x41b5b8[_0x1d10('0x36')]=_[_0x1d10('0x37')](_0x41b5b8[_0x1d10('0x33')],_0x41b5b8[_0x1d10('0x34')]);_0x4db221['attributes']=_[_0x1d10('0x37')](_0x41b5b8['model'],qs[_0x1d10('0x38')](_0x13a3dc[_0x1d10('0x34')]['fields']));_0x4db221[_0x1d10('0x39')]=_0x4db221['attributes'][_0x1d10('0x3a')]?_0x4db221[_0x1d10('0x39')]:_0x41b5b8[_0x1d10('0x33')];if(!_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x3b')]('nolimit')){_0x4db221['limit']=qs[_0x1d10('0x23')](_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x23')]);_0x4db221['offset']=qs['offset'](_0x13a3dc['query'][_0x1d10('0x21')]);}_0x4db221['order']=qs[_0x1d10('0x3c')](_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x3c')]);_0x4db221[_0x1d10('0x3d')]=qs['filters'](_['pick'](_0x13a3dc[_0x1d10('0x34')],_0x41b5b8[_0x1d10('0x36')]),_0xa4e6aa);if(_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x3e')]){_0x4db221['where']=_[_0x1d10('0x3f')](_0x4db221['where'],{'$or':_[_0x1d10('0x2f')](_0xa4e6aa,function(_0xec1f49){if(_0xec1f49[_0x1d10('0x40')]!==_0x1d10('0x41')){var _0x38addd={};_0x38addd[_0xec1f49[_0x1d10('0x2d')]]={'$like':'%'+_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x3e')]+'%'};return _0x38addd;}})});}_0x4db221=_[_0x1d10('0x3f')]({},_0x4db221,_0x13a3dc[_0x1d10('0x42')]);var _0x1cae38={'where':_0x4db221[_0x1d10('0x3d')]};return db[_0x1d10('0x30')]['count'](_0x1cae38)['then'](function(_0x35b2e3){_0x597aea[_0x1d10('0x24')]=_0x35b2e3;if(_0x13a3dc[_0x1d10('0x34')][_0x1d10('0x43')]){_0x4db221[_0x1d10('0x44')]=[{'all':!![]}];}return db[_0x1d10('0x30')][_0x1d10('0x45')](_0x4db221);})['then'](function(_0x1a67e9){_0x597aea[_0x1d10('0x46')]=_0x1a67e9;return _0x597aea;})[_0x1d10('0x29')](respondWithFilteredResult(_0x52d514,_0x4db221))['catch'](handleError(_0x52d514,null));};exports[_0x1d10('0x47')]=function(_0x427cd7,_0x2ee987){var _0x598973={'raw':!![],'where':{'id':_0x427cd7[_0x1d10('0x48')]['id']}},_0x5795f1={};_0x5795f1[_0x1d10('0x33')]=_[_0x1d10('0x35')](db[_0x1d10('0x30')][_0x1d10('0x31')]);_0x5795f1[_0x1d10('0x34')]=_[_0x1d10('0x35')](_0x427cd7['query']);_0x5795f1[_0x1d10('0x36')]=_[_0x1d10('0x37')](_0x5795f1['model'],_0x5795f1[_0x1d10('0x34')]);_0x598973['attributes']=_[_0x1d10('0x37')](_0x5795f1['model'],qs['fields'](_0x427cd7[_0x1d10('0x34')][_0x1d10('0x38')]));_0x598973[_0x1d10('0x39')]=_0x598973[_0x1d10('0x39')][_0x1d10('0x3a')]?_0x598973[_0x1d10('0x39')]:_0x5795f1[_0x1d10('0x33')];if(_0x427cd7[_0x1d10('0x34')][_0x1d10('0x43')]){_0x598973['include']=[{'all':!![]}];}_0x598973=_['merge']({},_0x598973,_0x427cd7[_0x1d10('0x42')]);return db[_0x1d10('0x30')][_0x1d10('0x49')](_0x598973)[_0x1d10('0x29')](handleEntityNotFound(_0x2ee987,null))[_0x1d10('0x29')](respondWithResult(_0x2ee987,null))[_0x1d10('0x4a')](handleError(_0x2ee987,null));};exports['create']=function(_0x2db27f,_0x1b8513){return db[_0x1d10('0x30')][_0x1d10('0x4b')](_0x2db27f[_0x1d10('0x4c')],{})[_0x1d10('0x29')](respondWithResult(_0x1b8513,0xc9))[_0x1d10('0x4a')](handleError(_0x1b8513,null));};exports[_0x1d10('0x28')]=function(_0x39bf64,_0x32a9a9){if(_0x39bf64[_0x1d10('0x4c')]['id']){delete _0x39bf64[_0x1d10('0x4c')]['id'];}return db[_0x1d10('0x30')][_0x1d10('0x49')]({'where':{'id':_0x39bf64['params']['id']}})['then'](handleEntityNotFound(_0x32a9a9,null))[_0x1d10('0x29')](saveUpdates(_0x39bf64['body'],null))['then'](respondWithResult(_0x32a9a9,null))[_0x1d10('0x4a')](handleError(_0x32a9a9,null));};exports[_0x1d10('0x2a')]=function(_0x375fb1,_0x35d8fb){return db[_0x1d10('0x30')]['find']({'where':{'id':_0x375fb1['params']['id']}})['then'](handleEntityNotFound(_0x35d8fb,null))['then'](removeEntity(_0x35d8fb,null))[_0x1d10('0x4a')](handleError(_0x35d8fb,null));};exports[_0x1d10('0x4d')]=function(_0x4570c4,_0x3a4167){return db['JscriptyAnswerReport'][_0x1d10('0x4d')]()[_0x1d10('0x29')](respondWithResult(_0x3a4167,null))[_0x1d10('0x4a')](handleError(_0x3a4167,null));};
\ No newline at end of file
+var _0x02a7=['then','destroy','end','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','describe','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','undefined','count','offset','status','set','Content-Range','json','apply','reject','save','update'];(function(_0x1f1305,_0x2435f5){var _0x571a9d=function(_0x411dfc){while(--_0x411dfc){_0x1f1305['push'](_0x1f1305['shift']());}};_0x571a9d(++_0x2435f5);}(_0x02a7,0x7a));var _0x702a=function(_0x1a35f3,_0x1dba47){_0x1a35f3=_0x1a35f3-0x0;var _0x5bc826=_0x02a7[_0x1a35f3];return _0x5bc826;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x702a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x702a('0x1'));var moment=require(_0x702a('0x2'));var BPromise=require(_0x702a('0x3'));var Mustache=require(_0x702a('0x4'));var util=require(_0x702a('0x5'));var path=require(_0x702a('0x6'));var sox=require(_0x702a('0x7'));var csv=require('to-csv');var ejs=require(_0x702a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x702a('0x9'));var squel=require(_0x702a('0xa'));var crypto=require(_0x702a('0xb'));var jsforce=require(_0x702a('0xc'));var deskjs=require(_0x702a('0xd'));var toCsv=require(_0x702a('0xe'));var querystring=require(_0x702a('0xf'));var Papa=require('papaparse');var Redis=require(_0x702a('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x702a('0x11'));var hardwareService=require(_0x702a('0x12'));var logger=require(_0x702a('0x13'))(_0x702a('0x14'));var utils=require('../../config/utils');var config=require(_0x702a('0x15'));var licenseUtil=require(_0x702a('0x16'));var db=require(_0x702a('0x17'))['db'];function respondWithStatusCode(_0x221b35,_0x4688d1){_0x4688d1=_0x4688d1||0xcc;return function(_0x75455){if(_0x75455){return _0x221b35[_0x702a('0x18')](_0x4688d1);}return _0x221b35['status'](_0x4688d1)['end']();};}function respondWithResult(_0x38139d,_0x57f5fc){_0x57f5fc=_0x57f5fc||0xc8;return function(_0x576cf8){if(_0x576cf8){return _0x38139d['status'](_0x57f5fc)['json'](_0x576cf8);}};}function respondWithFilteredResult(_0x5c768d,_0x44f7fd){return function(_0x3c9770){if(_0x3c9770){var _0xa124dd=typeof _0x44f7fd['offset']==='undefined'&&typeof _0x44f7fd['limit']===_0x702a('0x19');var _0x469cb2=_0x3c9770[_0x702a('0x1a')];var _0x492cfb=_0xa124dd?0x0:_0x44f7fd[_0x702a('0x1b')];var _0x5ec1b3=_0xa124dd?_0x3c9770[_0x702a('0x1a')]:_0x44f7fd[_0x702a('0x1b')]+_0x44f7fd['limit'];var _0x4f8b29;if(_0x5ec1b3>=_0x469cb2){_0x5ec1b3=_0x469cb2;_0x4f8b29=0xc8;}else{_0x4f8b29=0xce;}_0x5c768d[_0x702a('0x1c')](_0x4f8b29);return _0x5c768d[_0x702a('0x1d')](_0x702a('0x1e'),_0x492cfb+'-'+_0x5ec1b3+'/'+_0x469cb2)[_0x702a('0x1f')](_0x3c9770);}return null;};}function patchUpdates(_0x332254){return function(_0x3152bf){try{jsonpatch[_0x702a('0x20')](_0x3152bf,_0x332254,!![]);}catch(_0x3a4add){return BPromise[_0x702a('0x21')](_0x3a4add);}return _0x3152bf[_0x702a('0x22')]();};}function saveUpdates(_0x47d0f5,_0x1ecd28){return function(_0x3d213c){if(_0x3d213c){return _0x3d213c[_0x702a('0x23')](_0x47d0f5)[_0x702a('0x24')](function(_0x1d6dae){return _0x1d6dae;});}return null;};}function removeEntity(_0x466b74,_0x2aede0){return function(_0x156212){if(_0x156212){return _0x156212[_0x702a('0x25')]()['then'](function(){_0x466b74[_0x702a('0x1c')](0xcc)[_0x702a('0x26')]();});}};}function handleEntityNotFound(_0x57add6,_0xf08699){return function(_0x1a9fbf){if(!_0x1a9fbf){_0x57add6[_0x702a('0x18')](0x194);}return _0x1a9fbf;};}function handleError(_0xf6b463,_0x3d4ed0){_0x3d4ed0=_0x3d4ed0||0x1f4;return function(_0x2eff20){logger['error'](_0x2eff20[_0x702a('0x27')]);if(_0x2eff20[_0x702a('0x28')]){delete _0x2eff20['name'];}_0xf6b463[_0x702a('0x1c')](_0x3d4ed0)[_0x702a('0x29')](_0x2eff20);};}exports[_0x702a('0x2a')]=function(_0x21ba99,_0x1973c7){var _0xa0877a={},_0x1596a8={},_0x5c6da4={'count':0x0,'rows':[]};var _0x2d7044=_[_0x702a('0x2b')](db[_0x702a('0x2c')][_0x702a('0x2d')],function(_0x511e7e){return{'name':_0x511e7e[_0x702a('0x2e')],'type':_0x511e7e['type'][_0x702a('0x2f')]};});_0x1596a8[_0x702a('0x30')]=_['map'](_0x2d7044,'name');_0x1596a8[_0x702a('0x31')]=_[_0x702a('0x32')](_0x21ba99['query']);_0x1596a8[_0x702a('0x33')]=_['intersection'](_0x1596a8['model'],_0x1596a8[_0x702a('0x31')]);_0xa0877a[_0x702a('0x34')]=_[_0x702a('0x35')](_0x1596a8['model'],qs[_0x702a('0x36')](_0x21ba99[_0x702a('0x31')][_0x702a('0x36')]));_0xa0877a[_0x702a('0x34')]=_0xa0877a[_0x702a('0x34')][_0x702a('0x37')]?_0xa0877a[_0x702a('0x34')]:_0x1596a8[_0x702a('0x30')];if(!_0x21ba99[_0x702a('0x31')][_0x702a('0x38')](_0x702a('0x39'))){_0xa0877a[_0x702a('0x3a')]=qs[_0x702a('0x3a')](_0x21ba99[_0x702a('0x31')][_0x702a('0x3a')]);_0xa0877a[_0x702a('0x1b')]=qs[_0x702a('0x1b')](_0x21ba99[_0x702a('0x31')]['offset']);}_0xa0877a[_0x702a('0x3b')]=qs[_0x702a('0x3c')](_0x21ba99[_0x702a('0x31')][_0x702a('0x3c')]);_0xa0877a[_0x702a('0x3d')]=qs[_0x702a('0x33')](_[_0x702a('0x3e')](_0x21ba99[_0x702a('0x31')],_0x1596a8['filters']),_0x2d7044);if(_0x21ba99[_0x702a('0x31')][_0x702a('0x3f')]){_0xa0877a[_0x702a('0x3d')]=_[_0x702a('0x40')](_0xa0877a[_0x702a('0x3d')],{'$or':_[_0x702a('0x2b')](_0x2d7044,function(_0x3bc107){if(_0x3bc107[_0x702a('0x41')]!==_0x702a('0x42')){var _0x10fee4={};_0x10fee4[_0x3bc107[_0x702a('0x28')]]={'$like':'%'+_0x21ba99[_0x702a('0x31')][_0x702a('0x3f')]+'%'};return _0x10fee4;}})});}_0xa0877a=_[_0x702a('0x40')]({},_0xa0877a,_0x21ba99['options']);var _0x252b54={'where':_0xa0877a[_0x702a('0x3d')]};return db[_0x702a('0x2c')]['count'](_0x252b54)[_0x702a('0x24')](function(_0x202425){_0x5c6da4[_0x702a('0x1a')]=_0x202425;if(_0x21ba99[_0x702a('0x31')][_0x702a('0x43')]){_0xa0877a[_0x702a('0x44')]=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x702a('0x45')](_0xa0877a);})[_0x702a('0x24')](function(_0x34a26f){_0x5c6da4[_0x702a('0x46')]=_0x34a26f;return _0x5c6da4;})[_0x702a('0x24')](respondWithFilteredResult(_0x1973c7,_0xa0877a))[_0x702a('0x47')](handleError(_0x1973c7,null));};exports[_0x702a('0x48')]=function(_0x275262,_0x5a67df){var _0x41a7ab={'raw':!![],'where':{'id':_0x275262[_0x702a('0x49')]['id']}},_0x5dc8f8={};_0x5dc8f8[_0x702a('0x30')]=_[_0x702a('0x32')](db['JscriptyAnswerReport'][_0x702a('0x2d')]);_0x5dc8f8[_0x702a('0x31')]=_[_0x702a('0x32')](_0x275262[_0x702a('0x31')]);_0x5dc8f8[_0x702a('0x33')]=_[_0x702a('0x35')](_0x5dc8f8[_0x702a('0x30')],_0x5dc8f8['query']);_0x41a7ab['attributes']=_[_0x702a('0x35')](_0x5dc8f8[_0x702a('0x30')],qs['fields'](_0x275262['query']['fields']));_0x41a7ab[_0x702a('0x34')]=_0x41a7ab[_0x702a('0x34')][_0x702a('0x37')]?_0x41a7ab[_0x702a('0x34')]:_0x5dc8f8[_0x702a('0x30')];if(_0x275262[_0x702a('0x31')][_0x702a('0x43')]){_0x41a7ab[_0x702a('0x44')]=[{'all':!![]}];}_0x41a7ab=_[_0x702a('0x40')]({},_0x41a7ab,_0x275262[_0x702a('0x4a')]);return db[_0x702a('0x2c')][_0x702a('0x4b')](_0x41a7ab)[_0x702a('0x24')](handleEntityNotFound(_0x5a67df,null))['then'](respondWithResult(_0x5a67df,null))['catch'](handleError(_0x5a67df,null));};exports[_0x702a('0x4c')]=function(_0x919678,_0x5a1cdf){return db[_0x702a('0x2c')][_0x702a('0x4c')](_0x919678['body'],{})[_0x702a('0x24')](respondWithResult(_0x5a1cdf,0xc9))[_0x702a('0x47')](handleError(_0x5a1cdf,null));};exports[_0x702a('0x23')]=function(_0x55e380,_0x3b1bba){if(_0x55e380[_0x702a('0x4d')]['id']){delete _0x55e380['body']['id'];}return db[_0x702a('0x2c')][_0x702a('0x4b')]({'where':{'id':_0x55e380['params']['id']}})[_0x702a('0x24')](handleEntityNotFound(_0x3b1bba,null))[_0x702a('0x24')](saveUpdates(_0x55e380[_0x702a('0x4d')],null))[_0x702a('0x24')](respondWithResult(_0x3b1bba,null))[_0x702a('0x47')](handleError(_0x3b1bba,null));};exports[_0x702a('0x25')]=function(_0xee9f8d,_0xbf2b99){return db[_0x702a('0x2c')]['find']({'where':{'id':_0xee9f8d[_0x702a('0x49')]['id']}})[_0x702a('0x24')](handleEntityNotFound(_0xbf2b99,null))[_0x702a('0x24')](removeEntity(_0xbf2b99,null))[_0x702a('0x47')](handleError(_0xbf2b99,null));};exports['describe']=function(_0x859fe6,_0x4235b4){return db[_0x702a('0x2c')][_0x702a('0x4e')]()[_0x702a('0x24')](respondWithResult(_0x4235b4,null))['catch'](handleError(_0x4235b4,null));};
\ No newline at end of file
index 0816749..4e916b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7222=['rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','report_jscripty_answers','util','../../config/logger','moment','bluebird'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x7222,0xba));var _0x2722=function(_0x21774b,_0x4a6d2b){_0x21774b=_0x21774b-0x0;var _0x4675b2=_0x7222[_0x21774b];return _0x4675b2;};'use strict';var _=require('lodash');var util=require(_0x2722('0x0'));var logger=require(_0x2722('0x1'))('api');var moment=require(_0x2722('0x2'));var BPromise=require(_0x2722('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2722('0x4'));var config=require(_0x2722('0x5'));var attributes=require(_0x2722('0x6'));module[_0x2722('0x7')]=function(_0x2e5012,_0x4bd6e8){return _0x2e5012[_0x2722('0x8')]('JscriptyAnswerReport',attributes,{'tableName':_0x2722('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x94a5=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport','report_jscripty_answers','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x94a5,0x151));var _0x594a=function(_0xf4b05a,_0x301123){_0xf4b05a=_0xf4b05a-0x0;var _0x29812f=_0x94a5[_0xf4b05a];return _0x29812f;};'use strict';var _=require(_0x594a('0x0'));var util=require(_0x594a('0x1'));var logger=require(_0x594a('0x2'))(_0x594a('0x3'));var moment=require(_0x594a('0x4'));var BPromise=require('bluebird');var rp=require(_0x594a('0x5'));var fs=require('fs');var path=require(_0x594a('0x6'));var rimraf=require(_0x594a('0x7'));var config=require(_0x594a('0x8'));var attributes=require(_0x594a('0x9'));module['exports']=function(_0x48fe57,_0x5f630e){return _0x48fe57[_0x594a('0xa')](_0x594a('0xb'),attributes,{'tableName':_0x594a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index be25416..bb5fccd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed66=['randomstring','ioredis','rpc','jayson/promise','http','request','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3320f2,_0xdf25b8){var _0x391217=function(_0x53367e){while(--_0x53367e){_0x3320f2['push'](_0x3320f2['shift']());}};_0x391217(++_0xdf25b8);}(_0xed66,0x1a0));var _0x6ed6=function(_0x487131,_0x2c86e8){_0x487131=_0x487131-0x0;var _0xf320ff=_0xed66[_0x487131];return _0xf320ff;};'use strict';var _=require(_0x6ed6('0x0'));var util=require(_0x6ed6('0x1'));var moment=require(_0x6ed6('0x2'));var BPromise=require(_0x6ed6('0x3'));var rs=require(_0x6ed6('0x4'));var fs=require('fs');var Redis=require(_0x6ed6('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6ed6('0x6'));var config=require('../../config/environment');var jayson=require(_0x6ed6('0x7'));var client=jayson['client'][_0x6ed6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x57fbe3,_0x1c0bce,_0x3abdfd){return new BPromise(function(_0x5b9716,_0x3806b8){return client[_0x6ed6('0x9')](_0x57fbe3,_0x3abdfd)['then'](function(_0x4633d6){logger[_0x6ed6('0xa')](_0x6ed6('0xb'),_0x1c0bce,_0x6ed6('0xc'));logger[_0x6ed6('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x1c0bce,_0x6ed6('0xc'),JSON[_0x6ed6('0xe')](_0x4633d6));if(_0x4633d6['error']){if(_0x4633d6[_0x6ed6('0xf')][_0x6ed6('0x10')]===0x1f4){logger[_0x6ed6('0xf')](_0x6ed6('0xb'),_0x1c0bce,_0x4633d6[_0x6ed6('0xf')]['message']);return _0x3806b8(_0x4633d6[_0x6ed6('0xf')][_0x6ed6('0x11')]);}logger[_0x6ed6('0xf')](_0x6ed6('0xb'),_0x1c0bce,_0x4633d6[_0x6ed6('0xf')]['message']);return _0x5b9716(_0x4633d6[_0x6ed6('0xf')][_0x6ed6('0x11')]);}else{logger['info'](_0x6ed6('0xb'),_0x1c0bce,_0x6ed6('0xc'));_0x5b9716(_0x4633d6[_0x6ed6('0x12')][_0x6ed6('0x11')]);}})[_0x6ed6('0x13')](function(_0x5c75b9){logger['error'](_0x6ed6('0xb'),_0x1c0bce,_0x5c75b9);_0x3806b8(_0x5c75b9);});});}
\ No newline at end of file
+var _0x6422=['JscriptyAnswerReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','code'];(function(_0x258b93,_0x188ccc){var _0x35484b=function(_0x2563ea){while(--_0x2563ea){_0x258b93['push'](_0x258b93['shift']());}};_0x35484b(++_0x188ccc);}(_0x6422,0x194));var _0x2642=function(_0x486c6f,_0x916cf4){_0x486c6f=_0x486c6f-0x0;var _0x3e9ff8=_0x6422[_0x486c6f];return _0x3e9ff8;};'use strict';var _=require(_0x2642('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x2642('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2642('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2642('0x3'))(_0x2642('0x4'));var config=require(_0x2642('0x5'));var jayson=require(_0x2642('0x6'));var client=jayson[_0x2642('0x7')][_0x2642('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2bb1c1,_0x36687d,_0x26ea83){return new BPromise(function(_0x252c41,_0x3137c1){return client[_0x2642('0x9')](_0x2bb1c1,_0x26ea83)[_0x2642('0xa')](function(_0x5c2f0c){logger[_0x2642('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x36687d,_0x2642('0xc'));logger[_0x2642('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x36687d,'request\x20sent',JSON['stringify'](_0x5c2f0c));if(_0x5c2f0c[_0x2642('0xe')]){if(_0x5c2f0c['error'][_0x2642('0xf')]===0x1f4){logger[_0x2642('0xe')](_0x2642('0x10'),_0x36687d,_0x5c2f0c[_0x2642('0xe')][_0x2642('0x11')]);return _0x3137c1(_0x5c2f0c[_0x2642('0xe')]['message']);}logger[_0x2642('0xe')](_0x2642('0x10'),_0x36687d,_0x5c2f0c[_0x2642('0xe')]['message']);return _0x252c41(_0x5c2f0c['error']['message']);}else{logger[_0x2642('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x36687d,_0x2642('0xc'));_0x252c41(_0x5c2f0c[_0x2642('0x12')]['message']);}})[_0x2642('0x13')](function(_0x4b2694){logger[_0x2642('0xe')](_0x2642('0x10'),_0x36687d,_0x4b2694);_0x3137c1(_0x4b2694);});});}
\ No newline at end of file
index 71bb869..e9fe894 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe004=['getAnswers','/:id/summary','30s','getSummary','post','create','/:id/clone','clone','update','delete','destroy','multer','util','path','Router','../../config/environment','./jscriptyProject.controller','get','/:id','isAuthenticated','show','/:id/sessions','getSessions','/:id/answers'];(function(_0x30c150,_0x42da71){var _0x159181=function(_0x211f59){while(--_0x211f59){_0x30c150['push'](_0x30c150['shift']());}};_0x159181(++_0x42da71);}(_0xe004,0x143));var _0x4e00=function(_0xbc6df4,_0x50f996){_0xbc6df4=_0xbc6df4-0x0;var _0x455609=_0xe004[_0xbc6df4];return _0x455609;};'use strict';var multer=require(_0x4e00('0x0'));var util=require(_0x4e00('0x1'));var path=require(_0x4e00('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4e00('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x4e00('0x4'));var controller=require(_0x4e00('0x5'));router[_0x4e00('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4e00('0x6')](_0x4e00('0x7'),auth[_0x4e00('0x8')](),controller[_0x4e00('0x9')]);router[_0x4e00('0x6')](_0x4e00('0xa'),auth[_0x4e00('0x8')](),controller[_0x4e00('0xb')]);router[_0x4e00('0x6')](_0x4e00('0xc'),auth['isAuthenticated'](),controller[_0x4e00('0xd')]);router[_0x4e00('0x6')](_0x4e00('0xe'),auth[_0x4e00('0x8')](),timeout(_0x4e00('0xf')),controller[_0x4e00('0x10')]);router[_0x4e00('0x11')]('/',auth[_0x4e00('0x8')](),controller[_0x4e00('0x12')]);router[_0x4e00('0x11')](_0x4e00('0x13'),auth[_0x4e00('0x8')](),controller[_0x4e00('0x14')]);router['put'](_0x4e00('0x7'),auth[_0x4e00('0x8')](),controller[_0x4e00('0x15')]);router[_0x4e00('0x16')](_0x4e00('0x7'),auth['isAuthenticated'](),controller[_0x4e00('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0x7319=['Router','fs-extra','index','get','isAuthenticated','show','getSessions','/:id/answers','/:id/summary','30s','getSummary','post','clone','put','/:id','update','destroy','multer','util','path','connect-timeout','express'];(function(_0x3200bb,_0x57d0f2){var _0x3b4af8=function(_0x450f19){while(--_0x450f19){_0x3200bb['push'](_0x3200bb['shift']());}};_0x3b4af8(++_0x57d0f2);}(_0x7319,0x1df));var _0x9731=function(_0x4949ec,_0x45c7e5){_0x4949ec=_0x4949ec-0x0;var _0x260a59=_0x7319[_0x4949ec];return _0x260a59;};'use strict';var multer=require(_0x9731('0x0'));var util=require(_0x9731('0x1'));var path=require(_0x9731('0x2'));var timeout=require(_0x9731('0x3'));var express=require(_0x9731('0x4'));var router=express[_0x9731('0x5')]();var fs_extra=require(_0x9731('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./jscriptyProject.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x9731('0x7')]);router[_0x9731('0x8')]('/:id',auth[_0x9731('0x9')](),controller[_0x9731('0xa')]);router[_0x9731('0x8')]('/:id/sessions',auth[_0x9731('0x9')](),controller[_0x9731('0xb')]);router[_0x9731('0x8')](_0x9731('0xc'),auth[_0x9731('0x9')](),controller['getAnswers']);router[_0x9731('0x8')](_0x9731('0xd'),auth[_0x9731('0x9')](),timeout(_0x9731('0xe')),controller[_0x9731('0xf')]);router[_0x9731('0x10')]('/',auth[_0x9731('0x9')](),controller['create']);router['post']('/:id/clone',auth[_0x9731('0x9')](),controller[_0x9731('0x11')]);router[_0x9731('0x12')](_0x9731('0x13'),auth[_0x9731('0x9')](),controller[_0x9731('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x9731('0x15')]);module['exports']=router;
\ No newline at end of file
index 9bd7e1f..594c49e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc124=['description','BOOLEAN','sequelize','lodash','util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','stringify','formData','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue'];(function(_0x3ebabb,_0x1cef82){var _0x3488cf=function(_0x525578){while(--_0x525578){_0x3ebabb['push'](_0x3ebabb['shift']());}};_0x3488cf(++_0x1cef82);}(_0xc124,0x102));var _0x4c12=function(_0x15c4fb,_0x16ba98){_0x15c4fb=_0x15c4fb-0x0;var _0x57bf81=_0xc124[_0x15c4fb];return _0x57bf81;};'use strict';var Sequelize=require(_0x4c12('0x0'));var _=require(_0x4c12('0x1'));var util=require(_0x4c12('0x2'));module[_0x4c12('0x3')]={'name':{'type':Sequelize[_0x4c12('0x4')],'unique':_0x4c12('0x5')},'description':{'type':Sequelize[_0x4c12('0x4')]},'formData':{'type':Sequelize[_0x4c12('0x6')](_0x4c12('0x7')),'set':function(_0x4af878){if(_[_0x4c12('0x8')](_0x4af878)){this[_0x4c12('0x9')]('formData',JSON[_0x4c12('0xa')](_0x4af878));}else if(_['isString'](_0x4af878)){this[_0x4c12('0x9')](_0x4c12('0xb'),_0x4af878);}else{this[_0x4c12('0x9')](_0x4c12('0xb'),util['format'](_0x4c12('0xc'),this[_0x4c12('0xd')](_0x4c12('0x5'))||'',this['getDataValue'](_0x4c12('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x4c12('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x4c12('0xf')],'defaultValue':![]}};
\ No newline at end of file
+var _0xca8d=['formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','name','setDataValue'];(function(_0x5c13d5,_0x38a129){var _0x361eb9=function(_0x33e1aa){while(--_0x33e1aa){_0x5c13d5['push'](_0x5c13d5['shift']());}};_0x361eb9(++_0x38a129);}(_0xca8d,0xbc));var _0xdca8=function(_0x1e5db8,_0x44ef41){_0x1e5db8=_0x1e5db8-0x0;var _0x219a51=_0xca8d[_0x1e5db8];return _0x219a51;};'use strict';var Sequelize=require(_0xdca8('0x0'));var _=require(_0xdca8('0x1'));var util=require(_0xdca8('0x2'));module[_0xdca8('0x3')]={'name':{'type':Sequelize[_0xdca8('0x4')],'unique':_0xdca8('0x5')},'description':{'type':Sequelize[_0xdca8('0x4')]},'formData':{'type':Sequelize['TEXT']('long'),'set':function(_0x54fefc){if(_['isObjectLike'](_0x54fefc)){this[_0xdca8('0x6')](_0xdca8('0x7'),JSON['stringify'](_0x54fefc));}else if(_['isString'](_0x54fefc)){this['setDataValue']('formData',_0x54fefc);}else{this[_0xdca8('0x6')](_0xdca8('0x7'),util[_0xdca8('0x8')](_0xdca8('0x9'),this[_0xdca8('0xa')](_0xdca8('0x5'))||'',this[_0xdca8('0xa')](_0xdca8('0xb'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xdca8('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xdca8('0xc')],'defaultValue':![]}};
\ No newline at end of file
index f5370bc..d81b3ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7461=['end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','error','stack','name','index','map','JscriptyProject','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','fields','length','body','user','role','UserProfileSection','find','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','Projects','getSessions','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','answer','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7461,0xdb));var _0x1746=function(_0x5230eb,_0x29ec8a){_0x5230eb=_0x5230eb-0x0;var _0x23e301=_0x7461[_0x5230eb];return _0x23e301;};'use strict';var emlformat=require(_0x1746('0x0'));var rimraf=require(_0x1746('0x1'));var zipdir=require(_0x1746('0x2'));var jsonpatch=require(_0x1746('0x3'));var rp=require(_0x1746('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x1746('0x5'));var sox=require(_0x1746('0x6'));var csv=require(_0x1746('0x7'));var ejs=require(_0x1746('0x8'));var fs=require('fs');var fs_extra=require(_0x1746('0x9'));var _=require(_0x1746('0xa'));var squel=require(_0x1746('0xb'));var crypto=require(_0x1746('0xc'));var jsforce=require(_0x1746('0xd'));var deskjs=require(_0x1746('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1746('0xf'));var Papa=require('papaparse');var Redis=require(_0x1746('0x10'));var authService=require(_0x1746('0x11'));var qs=require(_0x1746('0x12'));var as=require(_0x1746('0x13'));var hardwareService=require(_0x1746('0x14'));var logger=require(_0x1746('0x15'))(_0x1746('0x16'));var utils=require(_0x1746('0x17'));var config=require(_0x1746('0x18'));var licenseUtil=require(_0x1746('0x19'));var db=require(_0x1746('0x1a'))['db'];function respondWithStatusCode(_0x39b57e,_0x35f0b0){_0x35f0b0=_0x35f0b0||0xcc;return function(_0x11ea81){if(_0x11ea81){return _0x39b57e[_0x1746('0x1b')](_0x35f0b0);}return _0x39b57e[_0x1746('0x1c')](_0x35f0b0)[_0x1746('0x1d')]();};}function respondWithResult(_0x243cad,_0x2b2ec8){_0x2b2ec8=_0x2b2ec8||0xc8;return function(_0x5654d7){if(_0x5654d7){return _0x243cad[_0x1746('0x1c')](_0x2b2ec8)[_0x1746('0x1e')](_0x5654d7);}};}function respondWithFilteredResult(_0x19f09d,_0x3bb7bd){return function(_0x34880f){if(_0x34880f){var _0x32e67f=typeof _0x3bb7bd['offset']===_0x1746('0x1f')&&typeof _0x3bb7bd[_0x1746('0x20')]===_0x1746('0x1f');var _0x1f4dd5=_0x34880f[_0x1746('0x21')];var _0x47aaf4=_0x32e67f?0x0:_0x3bb7bd[_0x1746('0x22')];var _0x1545c3=_0x32e67f?_0x34880f[_0x1746('0x21')]:_0x3bb7bd[_0x1746('0x22')]+_0x3bb7bd['limit'];var _0x4461f2;if(_0x1545c3>=_0x1f4dd5){_0x1545c3=_0x1f4dd5;_0x4461f2=0xc8;}else{_0x4461f2=0xce;}_0x19f09d[_0x1746('0x1c')](_0x4461f2);return _0x19f09d[_0x1746('0x23')](_0x1746('0x24'),_0x47aaf4+'-'+_0x1545c3+'/'+_0x1f4dd5)[_0x1746('0x1e')](_0x34880f);}return null;};}function patchUpdates(_0xab2a5a){return function(_0x28ecc0){try{jsonpatch[_0x1746('0x25')](_0x28ecc0,_0xab2a5a,!![]);}catch(_0x9e1a77){return BPromise[_0x1746('0x26')](_0x9e1a77);}return _0x28ecc0[_0x1746('0x27')]();};}function saveUpdates(_0x34f0d8,_0xb87d6e){return function(_0x4b737b){if(_0x4b737b){return _0x4b737b[_0x1746('0x28')](_0x34f0d8)['then'](function(_0x16e9dc){return _0x16e9dc;});}return null;};}function removeEntity(_0x51a380,_0x3428be){return function(_0x4b9ab2){if(_0x4b9ab2){return _0x4b9ab2['destroy']()[_0x1746('0x29')](function(){var _0x188e64=_0x4b9ab2[_0x1746('0x2a')]({'plain':!![]});var _0x59fc66='Projects';return db[_0x1746('0x2b')][_0x1746('0x2c')]({'where':{'type':_0x59fc66,'resourceId':_0x188e64['id']}})[_0x1746('0x29')](function(){return _0x4b9ab2;});})['then'](function(){_0x51a380['status'](0xcc)[_0x1746('0x1d')]();});}};}function handleEntityNotFound(_0x513e31,_0x54dc1e){return function(_0x2bbbca){if(!_0x2bbbca){_0x513e31[_0x1746('0x1b')](0x194);}return _0x2bbbca;};}function handleError(_0x20dc43,_0x1c4d47){_0x1c4d47=_0x1c4d47||0x1f4;return function(_0x2124f3){logger[_0x1746('0x2d')](_0x2124f3[_0x1746('0x2e')]);if(_0x2124f3[_0x1746('0x2f')]){delete _0x2124f3['name'];}_0x20dc43[_0x1746('0x1c')](_0x1c4d47)['send'](_0x2124f3);};}exports[_0x1746('0x30')]=function(_0xaea714,_0x6e58c3){var _0x49ba0e={},_0x286396={},_0x21a2d0={'count':0x0,'rows':[]};var _0x1fff91=_[_0x1746('0x31')](db[_0x1746('0x32')][_0x1746('0x33')],function(_0xd7d9c1){return{'name':_0xd7d9c1[_0x1746('0x34')],'type':_0xd7d9c1[_0x1746('0x35')][_0x1746('0x36')]};});_0x286396[_0x1746('0x37')]=_['map'](_0x1fff91,_0x1746('0x2f'));_0x286396[_0x1746('0x38')]=_['keys'](_0xaea714[_0x1746('0x38')]);_0x286396[_0x1746('0x39')]=_[_0x1746('0x3a')](_0x286396[_0x1746('0x37')],_0x286396['query']);_0x49ba0e['attributes']=_['intersection'](_0x286396[_0x1746('0x37')],qs['fields'](_0xaea714['query']['fields']));_0x49ba0e[_0x1746('0x3b')]=_0x49ba0e['attributes']['length']?_0x49ba0e[_0x1746('0x3b')]:_0x286396[_0x1746('0x37')];if(!_0xaea714['query'][_0x1746('0x3c')](_0x1746('0x3d'))){_0x49ba0e[_0x1746('0x20')]=qs[_0x1746('0x20')](_0xaea714[_0x1746('0x38')][_0x1746('0x20')]);_0x49ba0e[_0x1746('0x22')]=qs['offset'](_0xaea714[_0x1746('0x38')][_0x1746('0x22')]);}_0x49ba0e[_0x1746('0x3e')]=qs[_0x1746('0x3f')](_0xaea714[_0x1746('0x38')][_0x1746('0x3f')]);_0x49ba0e[_0x1746('0x40')]=qs[_0x1746('0x39')](_[_0x1746('0x41')](_0xaea714['query'],_0x286396[_0x1746('0x39')]),_0x1fff91);if(_0xaea714[_0x1746('0x38')][_0x1746('0x42')]){_0x49ba0e['where']=_[_0x1746('0x43')](_0x49ba0e[_0x1746('0x40')],{'$or':_[_0x1746('0x31')](_0x1fff91,function(_0x5a5b65){if(_0x5a5b65[_0x1746('0x35')]!==_0x1746('0x44')){var _0x25b757={};_0x25b757[_0x5a5b65[_0x1746('0x2f')]]={'$like':'%'+_0xaea714['query'][_0x1746('0x42')]+'%'};return _0x25b757;}})});}_0x49ba0e=_[_0x1746('0x43')]({},_0x49ba0e,_0xaea714[_0x1746('0x45')]);var _0x2bc28d={'where':_0x49ba0e[_0x1746('0x40')]};return db['JscriptyProject'][_0x1746('0x21')](_0x2bc28d)[_0x1746('0x29')](function(_0x33033b){_0x21a2d0[_0x1746('0x21')]=_0x33033b;if(_0xaea714[_0x1746('0x38')][_0x1746('0x46')]){_0x49ba0e[_0x1746('0x47')]=[{'all':!![]}];}return db[_0x1746('0x32')][_0x1746('0x48')](_0x49ba0e);})['then'](function(_0x1589bd){_0x21a2d0[_0x1746('0x49')]=_0x1589bd;return _0x21a2d0;})['then'](respondWithFilteredResult(_0x6e58c3,_0x49ba0e))[_0x1746('0x4a')](handleError(_0x6e58c3,null));};exports['show']=function(_0x5225ca,_0x20b9d7){var _0x24296a={'raw':![],'where':{'id':_0x5225ca['params']['id']}},_0x3eec47={};_0x3eec47['model']=_['keys'](db['JscriptyProject'][_0x1746('0x33')]);_0x3eec47[_0x1746('0x38')]=_[_0x1746('0x4b')](_0x5225ca[_0x1746('0x38')]);_0x3eec47[_0x1746('0x39')]=_[_0x1746('0x3a')](_0x3eec47[_0x1746('0x37')],_0x3eec47[_0x1746('0x38')]);_0x24296a['attributes']=_['intersection'](_0x3eec47[_0x1746('0x37')],qs[_0x1746('0x4c')](_0x5225ca['query'][_0x1746('0x4c')]));_0x24296a['attributes']=_0x24296a[_0x1746('0x3b')][_0x1746('0x4d')]?_0x24296a[_0x1746('0x3b')]:_0x3eec47[_0x1746('0x37')];if(_0x5225ca[_0x1746('0x38')][_0x1746('0x46')]){_0x24296a[_0x1746('0x47')]=[{'all':!![]}];}_0x24296a=_[_0x1746('0x43')]({},_0x24296a,_0x5225ca['options']);return db[_0x1746('0x32')]['find'](_0x24296a)[_0x1746('0x29')](handleEntityNotFound(_0x20b9d7,null))[_0x1746('0x29')](respondWithResult(_0x20b9d7,null))['catch'](handleError(_0x20b9d7,null));};exports['create']=function(_0xf04149,_0x4eb440){return db[_0x1746('0x32')]['create'](_0xf04149[_0x1746('0x4e')],{})[_0x1746('0x29')](function(_0x57fdaa){var _0xb3c7ef=_0xf04149[_0x1746('0x4f')][_0x1746('0x2a')]({'plain':!![]});if(!_0xb3c7ef)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xb3c7ef[_0x1746('0x50')]===_0x1746('0x4f')){var _0x1441bc=_0x57fdaa[_0x1746('0x2a')]({'plain':!![]});var _0x20962b='Projects';return db[_0x1746('0x51')][_0x1746('0x52')]({'where':{'name':_0x20962b,'userProfileId':_0xb3c7ef[_0x1746('0x53')]},'raw':!![]})[_0x1746('0x29')](function(_0x5a5560){if(_0x5a5560&&_0x5a5560['autoAssociation']===0x0){return db[_0x1746('0x2b')][_0x1746('0x54')]({'name':_0x1441bc[_0x1746('0x2f')],'resourceId':_0x1441bc['id'],'type':_0x5a5560[_0x1746('0x2f')],'sectionId':_0x5a5560['id']},{})[_0x1746('0x29')](function(){return _0x57fdaa;});}else{return _0x57fdaa;}})[_0x1746('0x4a')](function(_0x4a3971){logger[_0x1746('0x2d')](_0x1746('0x55'),_0x4a3971);throw _0x4a3971;});}return _0x57fdaa;})[_0x1746('0x29')](respondWithResult(_0x4eb440,0xc9))[_0x1746('0x4a')](handleError(_0x4eb440,null));};exports[_0x1746('0x56')]=function(_0x2158dc,_0x218e8c){var _0x5ae343={'where':{'id':_0x2158dc[_0x1746('0x57')]['id']}},_0x34f96e={};_0x34f96e['model']=_[_0x1746('0x4b')](db['JscriptyProject'][_0x1746('0x33')]);_0x5ae343['attributes']=_[_0x1746('0x3a')](_0x34f96e[_0x1746('0x37')],qs[_0x1746('0x4c')](_0x2158dc['query'][_0x1746('0x4c')]));_0x5ae343[_0x1746('0x3b')]=_0x5ae343[_0x1746('0x3b')][_0x1746('0x4d')]?_0x5ae343[_0x1746('0x3b')]:_0x34f96e[_0x1746('0x37')];if(_0x2158dc[_0x1746('0x38')][_0x1746('0x46')]){_0x5ae343[_0x1746('0x47')]=[{'all':!![]}];}_0x5ae343=_['merge']({},_0x5ae343,_0x2158dc[_0x1746('0x45')]);return db['JscriptyProject'][_0x1746('0x52')](_0x5ae343)[_0x1746('0x29')](handleEntityNotFound(_0x218e8c,null))['then'](function(_0x1c2c23){if(_0x1c2c23){var _0x14c0cf=_0x1c2c23[_0x1746('0x2a')]({'plain':!![]});_0x14c0cf=qs[_0x1746('0x58')](_0x14c0cf,['id',_0x1746('0x59'),_0x1746('0x5a')]);_0x2158dc[_0x1746('0x4e')]=_[_0x1746('0x58')](_0x2158dc['body'],['id',_0x1746('0x59'),_0x1746('0x5a')]);return db[_0x1746('0x32')][_0x1746('0x54')](_['merge'](_0x14c0cf,_0x2158dc[_0x1746('0x4e')]),{'include':_0x2158dc[_0x1746('0x38')][_0x1746('0x46')]?[{'all':!![]}]:undefined})['then'](function(_0x57cac5){var _0x248654=_0x2158dc[_0x1746('0x4f')][_0x1746('0x2a')]({'plain':!![]});if(!_0x248654)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x248654[_0x1746('0x50')]===_0x1746('0x4f')){var _0x46b111=_0x57cac5[_0x1746('0x2a')]({'plain':!![]});var _0x3b591a=_0x1746('0x5b');return db[_0x1746('0x51')][_0x1746('0x52')]({'where':{'name':_0x3b591a,'userProfileId':_0x248654[_0x1746('0x53')]},'raw':!![]})['then'](function(_0x566188){if(_0x566188&&_0x566188['autoAssociation']===0x0){return db[_0x1746('0x2b')][_0x1746('0x54')]({'name':_0x46b111[_0x1746('0x2f')],'resourceId':_0x46b111['id'],'type':_0x566188[_0x1746('0x2f')],'sectionId':_0x566188['id']},{})['then'](function(){return _0x57cac5;});}else{return _0x57cac5;}})[_0x1746('0x4a')](function(_0x4fd808){logger[_0x1746('0x2d')](_0x1746('0x55'),_0x4fd808);throw _0x4fd808;});}return _0x57cac5;});}})[_0x1746('0x29')](respondWithResult(_0x218e8c,0xc9))['catch'](handleError(_0x218e8c,null));};exports[_0x1746('0x28')]=function(_0x4b1e77,_0x42beff){if(_0x4b1e77['body']['id']){delete _0x4b1e77[_0x1746('0x4e')]['id'];}return db['JscriptyProject'][_0x1746('0x52')]({'where':{'id':_0x4b1e77['params']['id']}})[_0x1746('0x29')](handleEntityNotFound(_0x42beff,null))[_0x1746('0x29')](saveUpdates(_0x4b1e77[_0x1746('0x4e')],null))[_0x1746('0x29')](respondWithResult(_0x42beff,null))[_0x1746('0x4a')](handleError(_0x42beff,null));};exports['destroy']=function(_0x4b641a,_0x5dd2cc){return db[_0x1746('0x32')][_0x1746('0x52')]({'where':{'id':_0x4b641a[_0x1746('0x57')]['id']}})[_0x1746('0x29')](handleEntityNotFound(_0x5dd2cc,null))[_0x1746('0x29')](removeEntity(_0x5dd2cc,null))[_0x1746('0x4a')](handleError(_0x5dd2cc,null));};exports[_0x1746('0x5c')]=function(_0x57b391,_0x376bf0,_0x353336){var _0x797f0f={'raw':!![],'where':{}};var _0x221782={};var _0x224d07={'count':0x0,'rows':[]};return db[_0x1746('0x32')][_0x1746('0x5d')]({'where':{'id':_0x57b391[_0x1746('0x57')]['id']}})[_0x1746('0x29')](handleEntityNotFound(_0x376bf0,null))[_0x1746('0x29')](function(_0x145c23){if(_0x145c23){_0x221782['model']=_[_0x1746('0x4b')](db[_0x1746('0x5e')][_0x1746('0x33')]);_0x221782[_0x1746('0x38')]=_[_0x1746('0x4b')](_0x57b391[_0x1746('0x38')]);_0x221782[_0x1746('0x39')]=_[_0x1746('0x3a')](_0x221782[_0x1746('0x37')],_0x221782[_0x1746('0x38')]);_0x797f0f[_0x1746('0x3b')]=_['intersection'](_0x221782['model'],qs['fields'](_0x57b391[_0x1746('0x38')][_0x1746('0x4c')]));_0x797f0f[_0x1746('0x3b')]=_0x797f0f[_0x1746('0x3b')][_0x1746('0x4d')]?_0x797f0f[_0x1746('0x3b')]:_0x221782['model'];if(!_0x57b391[_0x1746('0x38')]['hasOwnProperty'](_0x1746('0x3d'))){_0x797f0f[_0x1746('0x20')]=qs['limit'](_0x57b391['query']['limit']);_0x797f0f[_0x1746('0x22')]=qs[_0x1746('0x22')](_0x57b391[_0x1746('0x38')][_0x1746('0x22')]);}_0x797f0f[_0x1746('0x3e')]=qs['sort'](_0x57b391[_0x1746('0x38')][_0x1746('0x3f')]);_0x797f0f[_0x1746('0x40')]=qs[_0x1746('0x39')](_[_0x1746('0x41')](_0x57b391['query'],_0x221782[_0x1746('0x39')]));_0x797f0f[_0x1746('0x40')][_0x1746('0x5f')]=_0x145c23['id'];if(_0x57b391['query'][_0x1746('0x42')]){_0x797f0f[_0x1746('0x40')]=_['merge'](_0x797f0f['where'],{'$or':_[_0x1746('0x31')](_0x797f0f[_0x1746('0x3b')],function(_0x255f35){var _0x27965c={};_0x27965c[_0x255f35]={'$like':'%'+_0x57b391[_0x1746('0x38')][_0x1746('0x42')]+'%'};return _0x27965c;})});}_0x797f0f=_[_0x1746('0x43')]({},_0x797f0f,_0x57b391[_0x1746('0x45')]);return db[_0x1746('0x5e')][_0x1746('0x21')]({'where':_0x797f0f[_0x1746('0x40')]})[_0x1746('0x29')](function(_0x1054f0){_0x224d07[_0x1746('0x21')]=_0x1054f0;if(_0x57b391[_0x1746('0x38')][_0x1746('0x46')]){_0x797f0f['include']=[{'all':!![]}];}return db[_0x1746('0x5e')]['findAll'](_0x797f0f);})[_0x1746('0x29')](function(_0x16b3c6){_0x224d07[_0x1746('0x49')]=_0x16b3c6;return _0x224d07;});}})['then'](respondWithFilteredResult(_0x376bf0,_0x797f0f))[_0x1746('0x4a')](handleError(_0x376bf0,null));};exports[_0x1746('0x60')]=function(_0x12ec14,_0xa184e5,_0x506fb3){var _0x42523a={'raw':!![],'where':{}};var _0x188e7a={};var _0x491a79={'count':0x0,'rows':[]};return db[_0x1746('0x32')][_0x1746('0x5d')]({'where':{'id':_0x12ec14[_0x1746('0x57')]['id']}})[_0x1746('0x29')](handleEntityNotFound(_0xa184e5,null))[_0x1746('0x29')](function(_0x4cb009){if(_0x4cb009){_0x188e7a[_0x1746('0x37')]=_['keys'](db[_0x1746('0x61')][_0x1746('0x33')]);_0x188e7a['query']=_[_0x1746('0x4b')](_0x12ec14[_0x1746('0x38')]);_0x188e7a[_0x1746('0x39')]=_[_0x1746('0x3a')](_0x188e7a[_0x1746('0x37')],_0x188e7a[_0x1746('0x38')]);_0x42523a['attributes']=_[_0x1746('0x3a')](_0x188e7a['model'],qs[_0x1746('0x4c')](_0x12ec14[_0x1746('0x38')]['fields']));_0x42523a['attributes']=_0x42523a['attributes']['length']?_0x42523a[_0x1746('0x3b')]:_0x188e7a[_0x1746('0x37')];if(!_0x12ec14['query'][_0x1746('0x3c')](_0x1746('0x3d'))){_0x42523a[_0x1746('0x20')]=qs[_0x1746('0x20')](_0x12ec14['query'][_0x1746('0x20')]);_0x42523a[_0x1746('0x22')]=qs[_0x1746('0x22')](_0x12ec14[_0x1746('0x38')]['offset']);}_0x42523a[_0x1746('0x3e')]=qs[_0x1746('0x3f')](_0x12ec14['query'][_0x1746('0x3f')]);_0x42523a[_0x1746('0x40')]=qs[_0x1746('0x39')](_['pick'](_0x12ec14['query'],_0x188e7a['filters']));_0x42523a[_0x1746('0x40')][_0x1746('0x5f')]=_0x4cb009['id'];if(_0x12ec14[_0x1746('0x38')][_0x1746('0x42')]){_0x42523a[_0x1746('0x40')]=_[_0x1746('0x43')](_0x42523a['where'],{'$or':_['map'](_0x42523a[_0x1746('0x3b')],function(_0x76a9b3){var _0x114a0c={};_0x114a0c[_0x76a9b3]={'$like':'%'+_0x12ec14['query']['filter']+'%'};return _0x114a0c;})});}_0x42523a=_[_0x1746('0x43')]({},_0x42523a,_0x12ec14[_0x1746('0x45')]);return db['JscriptyAnswerReport'][_0x1746('0x21')]({'where':_0x42523a[_0x1746('0x40')]})[_0x1746('0x29')](function(_0x4d59de){_0x491a79[_0x1746('0x21')]=_0x4d59de;if(_0x12ec14[_0x1746('0x38')][_0x1746('0x46')]){_0x42523a[_0x1746('0x47')]=[{'all':!![]}];}return db[_0x1746('0x61')]['findAll'](_0x42523a);})[_0x1746('0x29')](function(_0x583731){_0x491a79[_0x1746('0x49')]=_0x583731;return _0x491a79;});}})[_0x1746('0x29')](respondWithFilteredResult(_0xa184e5,_0x42523a))[_0x1746('0x4a')](handleError(_0xa184e5,null));};function char(_0x22f0eb){return _0x1746('0x62')===typeof _0x22f0eb?String[_0x1746('0x63')][_0x1746('0x25')](null,arguments):_0x22f0eb;}function needsEncapsulation(_0x55a4a2){return!!_0x55a4a2&&(_0x55a4a2[_0x1746('0x64')]()[_0x1746('0x65')](char(0xd))>=0x0||_0x55a4a2[_0x1746('0x64')]()['indexOf'](char(0xa))>=0x0||_0x55a4a2[_0x1746('0x64')]()['indexOf'](char(0x2c))>=0x0||_0x55a4a2[_0x1746('0x64')]()[_0x1746('0x65')](char(0x22))>=0x0);}function encapsulate(_0x3568d7){var _0x1750a9=char(0x22),_0x42bd62='\x5c'+char(0x22),_0xf6928a=_0x3568d7['toString']()[_0x1746('0x66')](new RegExp(_0x1750a9,'g'),_0x42bd62);return _0x1750a9+_0xf6928a+_0x1750a9;}exports[_0x1746('0x67')]=function(_0x5c5828,_0x56058b,_0xe6ae7f){var _0x111a26,_0x246f07;var _0xbaba90={'where':{'ProjectId':_0x5c5828[_0x1746('0x57')]['id']}};if(_0x5c5828[_0x1746('0x38')][_0x1746('0x68')]){_0xbaba90[_0x1746('0x40')]['starttime']=JSON[_0x1746('0x69')](_0x5c5828['query']['startTime']);}return db[_0x1746('0x5e')][_0x1746('0x48')](_0xbaba90)['then'](handleEntityNotFound(_0x56058b,null))[_0x1746('0x29')](function(_0x378847){if(_0x378847){_0x111a26=_0x378847;return db[_0x1746('0x6a')][_0x1746('0x48')]({'where':{'SessionId':{'$in':_[_0x1746('0x31')](_0x111a26,'id')},'ProjectId':_0x5c5828[_0x1746('0x57')]['id']},'order':_0x1746('0x6b')});}})[_0x1746('0x29')](handleEntityNotFound(_0x56058b,null))[_0x1746('0x29')](function(_0x2bc6fa){if(_0x2bc6fa){_0x246f07=_0x2bc6fa;var _0x591bae={};for(var _0x37e82c=0x0,_0xe7f2e8=_0x246f07[_0x1746('0x4d')];_0x37e82c<_0xe7f2e8;_0x37e82c++){if(!_0x591bae[_0x1746('0x3c')](_0x246f07[_0x37e82c][_0x1746('0x6c')])){_0x591bae[_0x246f07[_0x37e82c]['questionId']]=needsEncapsulation(_0x246f07[_0x37e82c][_0x1746('0x6d')])?encapsulate(_0x246f07[_0x37e82c][_0x1746('0x6d')]):_0x246f07[_0x37e82c][_0x1746('0x6d')];}}var _0x44a213=[],_0x3de2e8={};for(var _0x40dddd=0x0,_0x4956bf=_0x111a26['length'];_0x40dddd<_0x4956bf;_0x40dddd++){_0x3de2e8={'ProjectId':_0x5c5828['params']['id'],'SessionId':_0x111a26[_0x40dddd]['id'],'StartTime':moment(_0x111a26[_0x40dddd]['starttime'])[_0x1746('0x6e')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x37820f=0x0,_0x21e042=_0x246f07['length'];_0x37820f<_0x21e042;_0x37820f++){if(_0x246f07[_0x37820f]['SessionId']==_0x111a26[_0x40dddd]['id']&&_0x591bae[_0x1746('0x3c')](_0x246f07[_0x37820f][_0x1746('0x6c')])){_0x3de2e8[_0x591bae[_0x246f07[_0x37820f][_0x1746('0x6c')]]]=_0x246f07[_0x37820f][_0x1746('0x6f')];}}for(var _0x3ef419 in _0x591bae){if(!_0x3de2e8[_0x1746('0x3c')](_0x591bae[_0x3ef419])){_0x3de2e8[_0x591bae[_0x3ef419]]=null;}}_0x44a213[_0x1746('0x70')](_0x3de2e8);}return _0x44a213;}})[_0x1746('0x29')](function(_0x17e73b){if(!_[_0x1746('0x71')](_0x17e73b)){var _0x47b794=toCsv(_0x17e73b);var _0x24ca28=Date[_0x1746('0x72')]();fs[_0x1746('0x73')](util[_0x1746('0x6e')](_0x1746('0x74'),_0x5c5828['params']['id'],_0x24ca28),_0x47b794);_0x56058b[_0x1746('0x75')](_0x1746('0x76'),_0x1746('0x77')+util[_0x1746('0x6e')](_0x1746('0x78'),_0x5c5828[_0x1746('0x57')]['id'],_0x24ca28));_0x56058b[_0x1746('0x75')](_0x1746('0x79'),_0x1746('0x7a'));return _0x56058b[_0x1746('0x7b')](util['format'](_0x1746('0x74'),_0x5c5828[_0x1746('0x57')]['id'],_0x24ca28));}else{return _0x56058b['sendStatus'](0xcc);}})[_0x1746('0x4a')](handleError(_0x56058b,null));};
\ No newline at end of file
+var _0x13ae=['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','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','Projects','UserProfileResource','destroy','error','stack','name','index','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','merge','options','include','JscriptyProject','findAll','rows','catch','includeAll','create','user','get','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','omit','updatedAt','body','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getSessions','findOne','ProjectId','JscriptySessionReport','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','request-promise','moment','util','sox','to-csv','ejs'];(function(_0x41ca9f,_0x269c4f){var _0x1a458c=function(_0x6214cf){while(--_0x6214cf){_0x41ca9f['push'](_0x41ca9f['shift']());}};_0x1a458c(++_0x269c4f);}(_0x13ae,0xe6));var _0xe13a=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x13ae[_0x2dadb9];return _0x2f0097;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe13a('0x0'));var moment=require(_0xe13a('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe13a('0x2'));var path=require('path');var sox=require(_0xe13a('0x3'));var csv=require(_0xe13a('0x4'));var ejs=require(_0xe13a('0x5'));var fs=require('fs');var fs_extra=require(_0xe13a('0x6'));var _=require(_0xe13a('0x7'));var squel=require(_0xe13a('0x8'));var crypto=require(_0xe13a('0x9'));var jsforce=require(_0xe13a('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe13a('0xb'));var Papa=require(_0xe13a('0xc'));var Redis=require(_0xe13a('0xd'));var authService=require(_0xe13a('0xe'));var qs=require(_0xe13a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe13a('0x10'));var logger=require(_0xe13a('0x11'))(_0xe13a('0x12'));var utils=require(_0xe13a('0x13'));var config=require(_0xe13a('0x14'));var licenseUtil=require(_0xe13a('0x15'));var db=require(_0xe13a('0x16'))['db'];function respondWithStatusCode(_0x5e715,_0x54ea66){_0x54ea66=_0x54ea66||0xcc;return function(_0x2ab471){if(_0x2ab471){return _0x5e715[_0xe13a('0x17')](_0x54ea66);}return _0x5e715[_0xe13a('0x18')](_0x54ea66)[_0xe13a('0x19')]();};}function respondWithResult(_0x12f6f9,_0x19dc18){_0x19dc18=_0x19dc18||0xc8;return function(_0x462d0e){if(_0x462d0e){return _0x12f6f9['status'](_0x19dc18)['json'](_0x462d0e);}};}function respondWithFilteredResult(_0x463c25,_0x2fca0f){return function(_0x128986){if(_0x128986){var _0x20d162=typeof _0x2fca0f[_0xe13a('0x1a')]===_0xe13a('0x1b')&&typeof _0x2fca0f[_0xe13a('0x1c')]===_0xe13a('0x1b');var _0x165195=_0x128986[_0xe13a('0x1d')];var _0xc6f6d3=_0x20d162?0x0:_0x2fca0f['offset'];var _0x3c8f4f=_0x20d162?_0x128986[_0xe13a('0x1d')]:_0x2fca0f['offset']+_0x2fca0f[_0xe13a('0x1c')];var _0x12a8b9;if(_0x3c8f4f>=_0x165195){_0x3c8f4f=_0x165195;_0x12a8b9=0xc8;}else{_0x12a8b9=0xce;}_0x463c25['status'](_0x12a8b9);return _0x463c25[_0xe13a('0x1e')](_0xe13a('0x1f'),_0xc6f6d3+'-'+_0x3c8f4f+'/'+_0x165195)[_0xe13a('0x20')](_0x128986);}return null;};}function patchUpdates(_0x4489bd){return function(_0xeff2be){try{jsonpatch[_0xe13a('0x21')](_0xeff2be,_0x4489bd,!![]);}catch(_0x2c88bd){return BPromise[_0xe13a('0x22')](_0x2c88bd);}return _0xeff2be['save']();};}function saveUpdates(_0x5e8dea,_0x192240){return function(_0x48cdb8){if(_0x48cdb8){return _0x48cdb8[_0xe13a('0x23')](_0x5e8dea)[_0xe13a('0x24')](function(_0x3a5d29){return _0x3a5d29;});}return null;};}function removeEntity(_0x1d303c,_0x810633){return function(_0xd26093){if(_0xd26093){return _0xd26093['destroy']()[_0xe13a('0x24')](function(){var _0x4c3eea=_0xd26093['get']({'plain':!![]});var _0x3ed1f7=_0xe13a('0x25');return db[_0xe13a('0x26')][_0xe13a('0x27')]({'where':{'type':_0x3ed1f7,'resourceId':_0x4c3eea['id']}})[_0xe13a('0x24')](function(){return _0xd26093;});})[_0xe13a('0x24')](function(){_0x1d303c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x562360,_0x43b85e){return function(_0x1cb395){if(!_0x1cb395){_0x562360[_0xe13a('0x17')](0x194);}return _0x1cb395;};}function handleError(_0x2cad12,_0x4fcdf1){_0x4fcdf1=_0x4fcdf1||0x1f4;return function(_0x502bff){logger[_0xe13a('0x28')](_0x502bff[_0xe13a('0x29')]);if(_0x502bff[_0xe13a('0x2a')]){delete _0x502bff['name'];}_0x2cad12[_0xe13a('0x18')](_0x4fcdf1)['send'](_0x502bff);};}exports[_0xe13a('0x2b')]=function(_0xcf583b,_0xd1fdb5){var _0x3b24f3={},_0x425208={},_0xed408c={'count':0x0,'rows':[]};var _0x48ec1d=_['map'](db['JscriptyProject'][_0xe13a('0x2c')],function(_0x1a09db){return{'name':_0x1a09db['fieldName'],'type':_0x1a09db[_0xe13a('0x2d')][_0xe13a('0x2e')]};});_0x425208[_0xe13a('0x2f')]=_['map'](_0x48ec1d,_0xe13a('0x2a'));_0x425208[_0xe13a('0x30')]=_[_0xe13a('0x31')](_0xcf583b[_0xe13a('0x30')]);_0x425208[_0xe13a('0x32')]=_[_0xe13a('0x33')](_0x425208[_0xe13a('0x2f')],_0x425208[_0xe13a('0x30')]);_0x3b24f3[_0xe13a('0x34')]=_[_0xe13a('0x33')](_0x425208[_0xe13a('0x2f')],qs[_0xe13a('0x35')](_0xcf583b[_0xe13a('0x30')][_0xe13a('0x35')]));_0x3b24f3[_0xe13a('0x34')]=_0x3b24f3[_0xe13a('0x34')][_0xe13a('0x36')]?_0x3b24f3[_0xe13a('0x34')]:_0x425208['model'];if(!_0xcf583b[_0xe13a('0x30')][_0xe13a('0x37')](_0xe13a('0x38'))){_0x3b24f3[_0xe13a('0x1c')]=qs['limit'](_0xcf583b[_0xe13a('0x30')][_0xe13a('0x1c')]);_0x3b24f3[_0xe13a('0x1a')]=qs[_0xe13a('0x1a')](_0xcf583b['query'][_0xe13a('0x1a')]);}_0x3b24f3[_0xe13a('0x39')]=qs['sort'](_0xcf583b['query'][_0xe13a('0x3a')]);_0x3b24f3[_0xe13a('0x3b')]=qs[_0xe13a('0x32')](_[_0xe13a('0x3c')](_0xcf583b[_0xe13a('0x30')],_0x425208[_0xe13a('0x32')]),_0x48ec1d);if(_0xcf583b[_0xe13a('0x30')][_0xe13a('0x3d')]){_0x3b24f3['where']=_['merge'](_0x3b24f3[_0xe13a('0x3b')],{'$or':_[_0xe13a('0x3e')](_0x48ec1d,function(_0x3d24ad){if(_0x3d24ad[_0xe13a('0x2d')]!==_0xe13a('0x3f')){var _0x3a0872={};_0x3a0872[_0x3d24ad[_0xe13a('0x2a')]]={'$like':'%'+_0xcf583b['query'][_0xe13a('0x3d')]+'%'};return _0x3a0872;}})});}_0x3b24f3=_[_0xe13a('0x40')]({},_0x3b24f3,_0xcf583b[_0xe13a('0x41')]);var _0x37c3c1={'where':_0x3b24f3[_0xe13a('0x3b')]};return db['JscriptyProject'][_0xe13a('0x1d')](_0x37c3c1)[_0xe13a('0x24')](function(_0x348216){_0xed408c[_0xe13a('0x1d')]=_0x348216;if(_0xcf583b[_0xe13a('0x30')]['includeAll']){_0x3b24f3[_0xe13a('0x42')]=[{'all':!![]}];}return db[_0xe13a('0x43')][_0xe13a('0x44')](_0x3b24f3);})['then'](function(_0x3c047b){_0xed408c[_0xe13a('0x45')]=_0x3c047b;return _0xed408c;})[_0xe13a('0x24')](respondWithFilteredResult(_0xd1fdb5,_0x3b24f3))[_0xe13a('0x46')](handleError(_0xd1fdb5,null));};exports['show']=function(_0x55e93f,_0x196d76){var _0xed7258={'raw':![],'where':{'id':_0x55e93f['params']['id']}},_0x3d87ba={};_0x3d87ba['model']=_[_0xe13a('0x31')](db[_0xe13a('0x43')][_0xe13a('0x2c')]);_0x3d87ba[_0xe13a('0x30')]=_[_0xe13a('0x31')](_0x55e93f['query']);_0x3d87ba[_0xe13a('0x32')]=_[_0xe13a('0x33')](_0x3d87ba[_0xe13a('0x2f')],_0x3d87ba[_0xe13a('0x30')]);_0xed7258[_0xe13a('0x34')]=_[_0xe13a('0x33')](_0x3d87ba[_0xe13a('0x2f')],qs[_0xe13a('0x35')](_0x55e93f[_0xe13a('0x30')]['fields']));_0xed7258['attributes']=_0xed7258[_0xe13a('0x34')][_0xe13a('0x36')]?_0xed7258['attributes']:_0x3d87ba['model'];if(_0x55e93f[_0xe13a('0x30')][_0xe13a('0x47')]){_0xed7258[_0xe13a('0x42')]=[{'all':!![]}];}_0xed7258=_[_0xe13a('0x40')]({},_0xed7258,_0x55e93f[_0xe13a('0x41')]);return db[_0xe13a('0x43')]['find'](_0xed7258)[_0xe13a('0x24')](handleEntityNotFound(_0x196d76,null))[_0xe13a('0x24')](respondWithResult(_0x196d76,null))[_0xe13a('0x46')](handleError(_0x196d76,null));};exports[_0xe13a('0x48')]=function(_0x569da6,_0x55e08e){return db['JscriptyProject'][_0xe13a('0x48')](_0x569da6['body'],{})[_0xe13a('0x24')](function(_0x2faab8){var _0x6b2656=_0x569da6[_0xe13a('0x49')][_0xe13a('0x4a')]({'plain':!![]});if(!_0x6b2656)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6b2656[_0xe13a('0x4b')]===_0xe13a('0x49')){var _0x198210=_0x2faab8[_0xe13a('0x4a')]({'plain':!![]});var _0x523e2e=_0xe13a('0x25');return db[_0xe13a('0x4c')][_0xe13a('0x4d')]({'where':{'name':_0x523e2e,'userProfileId':_0x6b2656[_0xe13a('0x4e')]},'raw':!![]})[_0xe13a('0x24')](function(_0xfa0d2f){if(_0xfa0d2f&&_0xfa0d2f[_0xe13a('0x4f')]===0x0){return db['UserProfileResource'][_0xe13a('0x48')]({'name':_0x198210[_0xe13a('0x2a')],'resourceId':_0x198210['id'],'type':_0xfa0d2f['name'],'sectionId':_0xfa0d2f['id']},{})[_0xe13a('0x24')](function(){return _0x2faab8;});}else{return _0x2faab8;}})[_0xe13a('0x46')](function(_0x4fffdf){logger['error'](_0xe13a('0x50'),_0x4fffdf);throw _0x4fffdf;});}return _0x2faab8;})[_0xe13a('0x24')](respondWithResult(_0x55e08e,0xc9))[_0xe13a('0x46')](handleError(_0x55e08e,null));};exports['clone']=function(_0x2d0911,_0x1abc1b){var _0x384a0a={'where':{'id':_0x2d0911[_0xe13a('0x51')]['id']}},_0x5d187c={};_0x5d187c[_0xe13a('0x2f')]=_['keys'](db[_0xe13a('0x43')]['rawAttributes']);_0x384a0a[_0xe13a('0x34')]=_[_0xe13a('0x33')](_0x5d187c['model'],qs[_0xe13a('0x35')](_0x2d0911[_0xe13a('0x30')]['fields']));_0x384a0a[_0xe13a('0x34')]=_0x384a0a[_0xe13a('0x34')][_0xe13a('0x36')]?_0x384a0a[_0xe13a('0x34')]:_0x5d187c[_0xe13a('0x2f')];if(_0x2d0911[_0xe13a('0x30')]['includeAll']){_0x384a0a[_0xe13a('0x42')]=[{'all':!![]}];}_0x384a0a=_[_0xe13a('0x40')]({},_0x384a0a,_0x2d0911[_0xe13a('0x41')]);return db[_0xe13a('0x43')][_0xe13a('0x4d')](_0x384a0a)[_0xe13a('0x24')](handleEntityNotFound(_0x1abc1b,null))[_0xe13a('0x24')](function(_0x3c8bd0){if(_0x3c8bd0){var _0x54b139=_0x3c8bd0[_0xe13a('0x4a')]({'plain':!![]});_0x54b139=qs[_0xe13a('0x52')](_0x54b139,['id','createdAt',_0xe13a('0x53')]);_0x2d0911[_0xe13a('0x54')]=_[_0xe13a('0x52')](_0x2d0911['body'],['id',_0xe13a('0x55'),_0xe13a('0x53')]);return db[_0xe13a('0x43')][_0xe13a('0x48')](_['merge'](_0x54b139,_0x2d0911['body']),{'include':_0x2d0911['query'][_0xe13a('0x47')]?[{'all':!![]}]:undefined})[_0xe13a('0x24')](function(_0x7bed88){var _0x4f4dd5=_0x2d0911[_0xe13a('0x49')][_0xe13a('0x4a')]({'plain':!![]});if(!_0x4f4dd5)throw new Error(_0xe13a('0x56'));if(_0x4f4dd5[_0xe13a('0x4b')]===_0xe13a('0x49')){var _0x622dcb=_0x7bed88[_0xe13a('0x4a')]({'plain':!![]});var _0x48f11d='Projects';return db[_0xe13a('0x4c')][_0xe13a('0x4d')]({'where':{'name':_0x48f11d,'userProfileId':_0x4f4dd5[_0xe13a('0x4e')]},'raw':!![]})[_0xe13a('0x24')](function(_0x3dddb2){if(_0x3dddb2&&_0x3dddb2['autoAssociation']===0x0){return db['UserProfileResource'][_0xe13a('0x48')]({'name':_0x622dcb[_0xe13a('0x2a')],'resourceId':_0x622dcb['id'],'type':_0x3dddb2[_0xe13a('0x2a')],'sectionId':_0x3dddb2['id']},{})['then'](function(){return _0x7bed88;});}else{return _0x7bed88;}})[_0xe13a('0x46')](function(_0x1e01b4){logger[_0xe13a('0x28')](_0xe13a('0x50'),_0x1e01b4);throw _0x1e01b4;});}return _0x7bed88;});}})[_0xe13a('0x24')](respondWithResult(_0x1abc1b,0xc9))[_0xe13a('0x46')](handleError(_0x1abc1b,null));};exports[_0xe13a('0x23')]=function(_0x471fa9,_0x14f69f){if(_0x471fa9[_0xe13a('0x54')]['id']){delete _0x471fa9[_0xe13a('0x54')]['id'];}return db[_0xe13a('0x43')][_0xe13a('0x4d')]({'where':{'id':_0x471fa9[_0xe13a('0x51')]['id']}})['then'](handleEntityNotFound(_0x14f69f,null))[_0xe13a('0x24')](saveUpdates(_0x471fa9[_0xe13a('0x54')],null))[_0xe13a('0x24')](respondWithResult(_0x14f69f,null))[_0xe13a('0x46')](handleError(_0x14f69f,null));};exports[_0xe13a('0x27')]=function(_0x2db05f,_0x14dacb){return db[_0xe13a('0x43')][_0xe13a('0x4d')]({'where':{'id':_0x2db05f[_0xe13a('0x51')]['id']}})['then'](handleEntityNotFound(_0x14dacb,null))[_0xe13a('0x24')](removeEntity(_0x14dacb,null))[_0xe13a('0x46')](handleError(_0x14dacb,null));};exports[_0xe13a('0x57')]=function(_0x3add63,_0x3a2675,_0x47bff7){var _0x1cafed={'raw':!![],'where':{}};var _0x5f94f0={};var _0x32042b={'count':0x0,'rows':[]};return db[_0xe13a('0x43')][_0xe13a('0x58')]({'where':{'id':_0x3add63[_0xe13a('0x51')]['id']}})[_0xe13a('0x24')](handleEntityNotFound(_0x3a2675,null))['then'](function(_0xf74ff3){if(_0xf74ff3){_0x5f94f0[_0xe13a('0x2f')]=_[_0xe13a('0x31')](db['JscriptySessionReport'][_0xe13a('0x2c')]);_0x5f94f0['query']=_[_0xe13a('0x31')](_0x3add63[_0xe13a('0x30')]);_0x5f94f0['filters']=_[_0xe13a('0x33')](_0x5f94f0['model'],_0x5f94f0[_0xe13a('0x30')]);_0x1cafed[_0xe13a('0x34')]=_[_0xe13a('0x33')](_0x5f94f0['model'],qs[_0xe13a('0x35')](_0x3add63[_0xe13a('0x30')][_0xe13a('0x35')]));_0x1cafed['attributes']=_0x1cafed['attributes']['length']?_0x1cafed['attributes']:_0x5f94f0[_0xe13a('0x2f')];if(!_0x3add63[_0xe13a('0x30')]['hasOwnProperty'](_0xe13a('0x38'))){_0x1cafed[_0xe13a('0x1c')]=qs['limit'](_0x3add63[_0xe13a('0x30')]['limit']);_0x1cafed[_0xe13a('0x1a')]=qs[_0xe13a('0x1a')](_0x3add63['query'][_0xe13a('0x1a')]);}_0x1cafed[_0xe13a('0x39')]=qs[_0xe13a('0x3a')](_0x3add63['query']['sort']);_0x1cafed[_0xe13a('0x3b')]=qs[_0xe13a('0x32')](_[_0xe13a('0x3c')](_0x3add63['query'],_0x5f94f0['filters']));_0x1cafed[_0xe13a('0x3b')][_0xe13a('0x59')]=_0xf74ff3['id'];if(_0x3add63['query'][_0xe13a('0x3d')]){_0x1cafed[_0xe13a('0x3b')]=_['merge'](_0x1cafed[_0xe13a('0x3b')],{'$or':_['map'](_0x1cafed[_0xe13a('0x34')],function(_0x179abe){var _0x23d92e={};_0x23d92e[_0x179abe]={'$like':'%'+_0x3add63['query']['filter']+'%'};return _0x23d92e;})});}_0x1cafed=_[_0xe13a('0x40')]({},_0x1cafed,_0x3add63[_0xe13a('0x41')]);return db[_0xe13a('0x5a')][_0xe13a('0x1d')]({'where':_0x1cafed[_0xe13a('0x3b')]})['then'](function(_0x17e8d7){_0x32042b[_0xe13a('0x1d')]=_0x17e8d7;if(_0x3add63[_0xe13a('0x30')]['includeAll']){_0x1cafed[_0xe13a('0x42')]=[{'all':!![]}];}return db[_0xe13a('0x5a')]['findAll'](_0x1cafed);})['then'](function(_0x510641){_0x32042b[_0xe13a('0x45')]=_0x510641;return _0x32042b;});}})[_0xe13a('0x24')](respondWithFilteredResult(_0x3a2675,_0x1cafed))[_0xe13a('0x46')](handleError(_0x3a2675,null));};exports[_0xe13a('0x5b')]=function(_0x3a1b9f,_0x59a1b8,_0x4ef9b9){var _0x1996e9={'raw':!![],'where':{}};var _0x2661f6={};var _0x13291c={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x3a1b9f['params']['id']}})[_0xe13a('0x24')](handleEntityNotFound(_0x59a1b8,null))[_0xe13a('0x24')](function(_0x22f34a){if(_0x22f34a){_0x2661f6['model']=_[_0xe13a('0x31')](db[_0xe13a('0x5c')][_0xe13a('0x2c')]);_0x2661f6[_0xe13a('0x30')]=_[_0xe13a('0x31')](_0x3a1b9f[_0xe13a('0x30')]);_0x2661f6[_0xe13a('0x32')]=_[_0xe13a('0x33')](_0x2661f6[_0xe13a('0x2f')],_0x2661f6[_0xe13a('0x30')]);_0x1996e9[_0xe13a('0x34')]=_[_0xe13a('0x33')](_0x2661f6[_0xe13a('0x2f')],qs['fields'](_0x3a1b9f[_0xe13a('0x30')]['fields']));_0x1996e9[_0xe13a('0x34')]=_0x1996e9[_0xe13a('0x34')][_0xe13a('0x36')]?_0x1996e9['attributes']:_0x2661f6['model'];if(!_0x3a1b9f[_0xe13a('0x30')][_0xe13a('0x37')](_0xe13a('0x38'))){_0x1996e9['limit']=qs[_0xe13a('0x1c')](_0x3a1b9f['query']['limit']);_0x1996e9[_0xe13a('0x1a')]=qs[_0xe13a('0x1a')](_0x3a1b9f['query'][_0xe13a('0x1a')]);}_0x1996e9[_0xe13a('0x39')]=qs[_0xe13a('0x3a')](_0x3a1b9f['query'][_0xe13a('0x3a')]);_0x1996e9[_0xe13a('0x3b')]=qs[_0xe13a('0x32')](_[_0xe13a('0x3c')](_0x3a1b9f['query'],_0x2661f6[_0xe13a('0x32')]));_0x1996e9[_0xe13a('0x3b')][_0xe13a('0x59')]=_0x22f34a['id'];if(_0x3a1b9f['query'][_0xe13a('0x3d')]){_0x1996e9[_0xe13a('0x3b')]=_['merge'](_0x1996e9[_0xe13a('0x3b')],{'$or':_[_0xe13a('0x3e')](_0x1996e9[_0xe13a('0x34')],function(_0x16c7ef){var _0x4ad55e={};_0x4ad55e[_0x16c7ef]={'$like':'%'+_0x3a1b9f[_0xe13a('0x30')][_0xe13a('0x3d')]+'%'};return _0x4ad55e;})});}_0x1996e9=_['merge']({},_0x1996e9,_0x3a1b9f[_0xe13a('0x41')]);return db[_0xe13a('0x5c')]['count']({'where':_0x1996e9[_0xe13a('0x3b')]})['then'](function(_0x414768){_0x13291c['count']=_0x414768;if(_0x3a1b9f[_0xe13a('0x30')][_0xe13a('0x47')]){_0x1996e9['include']=[{'all':!![]}];}return db[_0xe13a('0x5c')][_0xe13a('0x44')](_0x1996e9);})['then'](function(_0x2d5c77){_0x13291c[_0xe13a('0x45')]=_0x2d5c77;return _0x13291c;});}})[_0xe13a('0x24')](respondWithFilteredResult(_0x59a1b8,_0x1996e9))[_0xe13a('0x46')](handleError(_0x59a1b8,null));};function char(_0x15fe68){return _0xe13a('0x5d')===typeof _0x15fe68?String[_0xe13a('0x5e')][_0xe13a('0x21')](null,arguments):_0x15fe68;}function needsEncapsulation(_0x324b6e){return!!_0x324b6e&&(_0x324b6e[_0xe13a('0x5f')]()[_0xe13a('0x60')](char(0xd))>=0x0||_0x324b6e[_0xe13a('0x5f')]()['indexOf'](char(0xa))>=0x0||_0x324b6e[_0xe13a('0x5f')]()[_0xe13a('0x60')](char(0x2c))>=0x0||_0x324b6e[_0xe13a('0x5f')]()[_0xe13a('0x60')](char(0x22))>=0x0);}function encapsulate(_0x4e29ed){var _0x6cf593=char(0x22),_0x3f6669='\x5c'+char(0x22),_0x38ffa4=_0x4e29ed[_0xe13a('0x5f')]()[_0xe13a('0x61')](new RegExp(_0x6cf593,'g'),_0x3f6669);return _0x6cf593+_0x38ffa4+_0x6cf593;}exports[_0xe13a('0x62')]=function(_0x42fc9f,_0x3e3b69,_0x4e9c37){var _0x83e460,_0x4848cf;var _0x2c02aa={'where':{'ProjectId':_0x42fc9f[_0xe13a('0x51')]['id']}};if(_0x42fc9f['query'][_0xe13a('0x63')]){_0x2c02aa[_0xe13a('0x3b')][_0xe13a('0x64')]=JSON[_0xe13a('0x65')](_0x42fc9f[_0xe13a('0x30')][_0xe13a('0x63')]);}return db[_0xe13a('0x5a')][_0xe13a('0x44')](_0x2c02aa)['then'](handleEntityNotFound(_0x3e3b69,null))[_0xe13a('0x24')](function(_0x3ae5f5){if(_0x3ae5f5){_0x83e460=_0x3ae5f5;return db[_0xe13a('0x66')][_0xe13a('0x44')]({'where':{'SessionId':{'$in':_[_0xe13a('0x3e')](_0x83e460,'id')},'ProjectId':_0x42fc9f[_0xe13a('0x51')]['id']},'order':_0xe13a('0x67')});}})[_0xe13a('0x24')](handleEntityNotFound(_0x3e3b69,null))[_0xe13a('0x24')](function(_0xf906cf){if(_0xf906cf){_0x4848cf=_0xf906cf;var _0x45947e={};for(var _0x149937=0x0,_0x492d80=_0x4848cf['length'];_0x149937<_0x492d80;_0x149937++){if(!_0x45947e['hasOwnProperty'](_0x4848cf[_0x149937][_0xe13a('0x68')])){_0x45947e[_0x4848cf[_0x149937][_0xe13a('0x68')]]=needsEncapsulation(_0x4848cf[_0x149937][_0xe13a('0x69')])?encapsulate(_0x4848cf[_0x149937][_0xe13a('0x69')]):_0x4848cf[_0x149937][_0xe13a('0x69')];}}var _0x2ab79a=[],_0x1cd5c4={};for(var _0xe9e2cf=0x0,_0x178c60=_0x83e460[_0xe13a('0x36')];_0xe9e2cf<_0x178c60;_0xe9e2cf++){_0x1cd5c4={'ProjectId':_0x42fc9f[_0xe13a('0x51')]['id'],'SessionId':_0x83e460[_0xe9e2cf]['id'],'StartTime':moment(_0x83e460[_0xe9e2cf]['starttime'])[_0xe13a('0x6a')](_0xe13a('0x6b'))};for(var _0xdfb32c=0x0,_0x16f36c=_0x4848cf['length'];_0xdfb32c<_0x16f36c;_0xdfb32c++){if(_0x4848cf[_0xdfb32c][_0xe13a('0x6c')]==_0x83e460[_0xe9e2cf]['id']&&_0x45947e[_0xe13a('0x37')](_0x4848cf[_0xdfb32c]['questionId'])){_0x1cd5c4[_0x45947e[_0x4848cf[_0xdfb32c]['questionId']]]=_0x4848cf[_0xdfb32c][_0xe13a('0x6d')];}}for(var _0x5635bd in _0x45947e){if(!_0x1cd5c4['hasOwnProperty'](_0x45947e[_0x5635bd])){_0x1cd5c4[_0x45947e[_0x5635bd]]=null;}}_0x2ab79a[_0xe13a('0x6e')](_0x1cd5c4);}return _0x2ab79a;}})[_0xe13a('0x24')](function(_0x1c82bf){if(!_['isEmpty'](_0x1c82bf)){var _0x43aaa6=toCsv(_0x1c82bf);var _0x5165e7=Date[_0xe13a('0x6f')]();fs['writeFileSync'](util[_0xe13a('0x6a')](_0xe13a('0x70'),_0x42fc9f[_0xe13a('0x51')]['id'],_0x5165e7),_0x43aaa6);_0x3e3b69['setHeader'](_0xe13a('0x71'),_0xe13a('0x72')+util[_0xe13a('0x6a')](_0xe13a('0x73'),_0x42fc9f['params']['id'],_0x5165e7));_0x3e3b69['setHeader'](_0xe13a('0x74'),_0xe13a('0x75'));return _0x3e3b69['download'](util['format'](_0xe13a('0x70'),_0x42fc9f[_0xe13a('0x51')]['id'],_0x5165e7));}else{return _0x3e3b69['sendStatus'](0xcc);}})[_0xe13a('0x46')](handleError(_0x3e3b69,null));};
\ No newline at end of file
index e572ea9..c3a1584 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2208=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','define','JscriptyProject','jscripty_projects'];(function(_0x16fe59,_0x1c6343){var _0x123472=function(_0x3cf1fd){while(--_0x3cf1fd){_0x16fe59['push'](_0x16fe59['shift']());}};_0x123472(++_0x1c6343);}(_0x2208,0x11e));var _0x8220=function(_0x44f6b7,_0x5b75af){_0x44f6b7=_0x44f6b7-0x0;var _0x5d612a=_0x2208[_0x44f6b7];return _0x5d612a;};'use strict';var _=require('lodash');var util=require(_0x8220('0x0'));var logger=require('../../config/logger')(_0x8220('0x1'));var moment=require('moment');var BPromise=require(_0x8220('0x2'));var rp=require(_0x8220('0x3'));var fs=require('fs');var path=require(_0x8220('0x4'));var rimraf=require(_0x8220('0x5'));var config=require(_0x8220('0x6'));var attributes=require(_0x8220('0x7'));module['exports']=function(_0x31a112,_0x4dd1a0){return _0x31a112[_0x8220('0x8')](_0x8220('0x9'),attributes,{'tableName':_0x8220('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7edb=['define','JscriptyProject','jscripty_projects','util','../../config/logger','api','moment','bluebird','path','./jscriptyProject.attributes','exports'];(function(_0x1bd1dd,_0x2efc7c){var _0x31752f=function(_0x529299){while(--_0x529299){_0x1bd1dd['push'](_0x1bd1dd['shift']());}};_0x31752f(++_0x2efc7c);}(_0x7edb,0x158));var _0xb7ed=function(_0x2f940d,_0x397991){_0x2f940d=_0x2f940d-0x0;var _0x2c32df=_0x7edb[_0x2f940d];return _0x2c32df;};'use strict';var _=require('lodash');var util=require(_0xb7ed('0x0'));var logger=require(_0xb7ed('0x1'))(_0xb7ed('0x2'));var moment=require(_0xb7ed('0x3'));var BPromise=require(_0xb7ed('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb7ed('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb7ed('0x6'));module[_0xb7ed('0x7')]=function(_0x2aa67d,_0x246cfa){return _0x2aa67d[_0xb7ed('0x8')](_0xb7ed('0x9'),attributes,{'tableName':_0xb7ed('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 96325de..2b18d1b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['code','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x5d8fe8,_0x186b6b){var _0x364d5e=function(_0x32d78f){while(--_0x32d78f){_0x5d8fe8['push'](_0x5d8fe8['shift']());}};_0x364d5e(++_0x186b6b);}(_0x70e0,0x17b));var _0x070e=function(_0x3af97b,_0x13c1c9){_0x3af97b=_0x3af97b-0x0;var _0x5ddb5e=_0x70e0[_0x3af97b];return _0x5ddb5e;};'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')]('JscriptyProject,\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')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('JscriptyProject,\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 _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyProject,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x29db89,_0x49c7e2){var _0x8f65da=function(_0x4c4ab9){while(--_0x4c4ab9){_0x29db89['push'](_0x29db89['shift']());}};_0x8f65da(++_0x49c7e2);}(_0xb43b,0x1b2));var _0xbb43=function(_0xbe5260,_0x310878){_0xbe5260=_0xbe5260-0x0;var _0xe728b0=_0xb43b[_0xbe5260];return _0xe728b0;};'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')]('JscriptyProject,\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')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});}
\ No newline at end of file
index c350a08..ab5034b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbe5c=['update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./jscriptyQuestionReport.controller','get','/describe','isAuthenticated','describe','show','create','put','/:id'];(function(_0x21beb4,_0x21fb6a){var _0x1c1741=function(_0xdcfe42){while(--_0xdcfe42){_0x21beb4['push'](_0x21beb4['shift']());}};_0x1c1741(++_0x21fb6a);}(_0xbe5c,0xd4));var _0xcbe5=function(_0x1f3e0e,_0x13d788){_0x1f3e0e=_0x1f3e0e-0x0;var _0x400ebe=_0xbe5c[_0x1f3e0e];return _0x400ebe;};'use strict';var multer=require(_0xcbe5('0x0'));var util=require(_0xcbe5('0x1'));var path=require(_0xcbe5('0x2'));var timeout=require(_0xcbe5('0x3'));var express=require(_0xcbe5('0x4'));var router=express['Router']();var fs_extra=require(_0xcbe5('0x5'));var auth=require(_0xcbe5('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcbe5('0x7'));router[_0xcbe5('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcbe5('0x8')](_0xcbe5('0x9'),auth[_0xcbe5('0xa')](),controller[_0xcbe5('0xb')]);router[_0xcbe5('0x8')]('/:id',auth[_0xcbe5('0xa')](),controller[_0xcbe5('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xcbe5('0xd')]);router[_0xcbe5('0xe')](_0xcbe5('0xf'),auth['isAuthenticated'](),controller[_0xcbe5('0x10')]);router[_0xcbe5('0x11')]('/:id',auth[_0xcbe5('0xa')](),controller['destroy']);module[_0xcbe5('0x12')]=router;
\ No newline at end of file
+var _0x7428=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','isAuthenticated','index','get','describe','/:id','show','post','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x10b2d5,_0x5a7743){var _0x14b8d1=function(_0x3b888c){while(--_0x3b888c){_0x10b2d5['push'](_0x10b2d5['shift']());}};_0x14b8d1(++_0x5a7743);}(_0x7428,0xba));var _0x8742=function(_0x2500ec,_0x43d349){_0x2500ec=_0x2500ec-0x0;var _0x561796=_0x7428[_0x2500ec];return _0x561796;};'use strict';var multer=require('multer');var util=require(_0x8742('0x0'));var path=require(_0x8742('0x1'));var timeout=require(_0x8742('0x2'));var express=require(_0x8742('0x3'));var router=express['Router']();var fs_extra=require(_0x8742('0x4'));var auth=require(_0x8742('0x5'));var interaction=require(_0x8742('0x6'));var config=require(_0x8742('0x7'));var controller=require(_0x8742('0x8'));router['get']('/',auth[_0x8742('0x9')](),controller[_0x8742('0xa')]);router[_0x8742('0xb')]('/describe',auth[_0x8742('0x9')](),controller[_0x8742('0xc')]);router['get'](_0x8742('0xd'),auth['isAuthenticated'](),controller[_0x8742('0xe')]);router[_0x8742('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8742('0x10')](_0x8742('0xd'),auth[_0x8742('0x9')](),controller[_0x8742('0x11')]);router[_0x8742('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x8742('0x13')]);module[_0x8742('0x14')]=router;
\ No newline at end of file
index bb3238a..2a85171 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x7a54,0x106));var _0x47a5=function(_0x27ad44,_0x51566a){_0x27ad44=_0x27ad44-0x0;var _0x575f20=_0x7a54[_0x27ad44];return _0x575f20;};'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(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x7a54,0x106));var _0x47a5=function(_0x7c71ec,_0x1f71da){_0x7c71ec=_0x7c71ec-0x0;var _0x2bfb9e=_0x7a54[_0x7c71ec];return _0x2bfb9e;};'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 10da4e3..19050a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12a6=['include','findAll','catch','show','params','keys','intersection','merge','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','desk.js','to-csv','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','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','attributes','fields','length','nolimit','sort','where','pick','filter','JscriptyQuestionReport','count','includeAll'];(function(_0x32583a,_0x491c77){var _0x1955c2=function(_0x43dd99){while(--_0x43dd99){_0x32583a['push'](_0x32583a['shift']());}};_0x1955c2(++_0x491c77);}(_0x12a6,0x1c8));var _0x612a=function(_0x24d711,_0x3cdb28){_0x24d711=_0x24d711-0x0;var _0x3491b4=_0x12a6[_0x24d711];return _0x3491b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x612a('0x0'));var zipdir=require(_0x612a('0x1'));var jsonpatch=require(_0x612a('0x2'));var rp=require(_0x612a('0x3'));var moment=require('moment');var BPromise=require(_0x612a('0x4'));var Mustache=require(_0x612a('0x5'));var util=require(_0x612a('0x6'));var path=require(_0x612a('0x7'));var sox=require(_0x612a('0x8'));var csv=require('to-csv');var ejs=require(_0x612a('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x612a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x612a('0xb'));var toCsv=require(_0x612a('0xc'));var querystring=require('querystring');var Papa=require(_0x612a('0xd'));var Redis=require(_0x612a('0xe'));var authService=require(_0x612a('0xf'));var qs=require(_0x612a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x612a('0x11'));var logger=require(_0x612a('0x12'))(_0x612a('0x13'));var utils=require(_0x612a('0x14'));var config=require(_0x612a('0x15'));var licenseUtil=require(_0x612a('0x16'));var db=require(_0x612a('0x17'))['db'];function respondWithStatusCode(_0x136751,_0x1b54c6){_0x1b54c6=_0x1b54c6||0xcc;return function(_0x283b4b){if(_0x283b4b){return _0x136751[_0x612a('0x18')](_0x1b54c6);}return _0x136751[_0x612a('0x19')](_0x1b54c6)[_0x612a('0x1a')]();};}function respondWithResult(_0x3788d1,_0x4a012a){_0x4a012a=_0x4a012a||0xc8;return function(_0x5dca6d){if(_0x5dca6d){return _0x3788d1[_0x612a('0x19')](_0x4a012a)[_0x612a('0x1b')](_0x5dca6d);}};}function respondWithFilteredResult(_0x565bcb,_0x5078ff){return function(_0x3ab782){if(_0x3ab782){var _0x4fd788=typeof _0x5078ff[_0x612a('0x1c')]===_0x612a('0x1d')&&typeof _0x5078ff['limit']===_0x612a('0x1d');var _0x4b3bcb=_0x3ab782['count'];var _0x22379c=_0x4fd788?0x0:_0x5078ff[_0x612a('0x1c')];var _0x83b8d9=_0x4fd788?_0x3ab782['count']:_0x5078ff[_0x612a('0x1c')]+_0x5078ff[_0x612a('0x1e')];var _0x1304bb;if(_0x83b8d9>=_0x4b3bcb){_0x83b8d9=_0x4b3bcb;_0x1304bb=0xc8;}else{_0x1304bb=0xce;}_0x565bcb[_0x612a('0x19')](_0x1304bb);return _0x565bcb[_0x612a('0x1f')](_0x612a('0x20'),_0x22379c+'-'+_0x83b8d9+'/'+_0x4b3bcb)[_0x612a('0x1b')](_0x3ab782);}return null;};}function patchUpdates(_0x3ef518){return function(_0x5290b7){try{jsonpatch[_0x612a('0x21')](_0x5290b7,_0x3ef518,!![]);}catch(_0x58d6f8){return BPromise[_0x612a('0x22')](_0x58d6f8);}return _0x5290b7[_0x612a('0x23')]();};}function saveUpdates(_0x28bc1b,_0x44e0c2){return function(_0x4ae33a){if(_0x4ae33a){return _0x4ae33a[_0x612a('0x24')](_0x28bc1b)[_0x612a('0x25')](function(_0x2dd574){return _0x2dd574;});}return null;};}function removeEntity(_0x275305,_0xfe5aa2){return function(_0x3e0c03){if(_0x3e0c03){return _0x3e0c03[_0x612a('0x26')]()[_0x612a('0x25')](function(){_0x275305[_0x612a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x253854,_0x33c309){return function(_0x381d5b){if(!_0x381d5b){_0x253854[_0x612a('0x18')](0x194);}return _0x381d5b;};}function handleError(_0x3ca710,_0xc9f5f8){_0xc9f5f8=_0xc9f5f8||0x1f4;return function(_0x2791ab){logger[_0x612a('0x27')](_0x2791ab[_0x612a('0x28')]);if(_0x2791ab[_0x612a('0x29')]){delete _0x2791ab['name'];}_0x3ca710[_0x612a('0x19')](_0xc9f5f8)[_0x612a('0x2a')](_0x2791ab);};}exports[_0x612a('0x2b')]=function(_0x156800,_0x12bc58){var _0x36d84b={},_0x59a4c0={},_0xb77e03={'count':0x0,'rows':[]};var _0x58e030=_[_0x612a('0x2c')](db['JscriptyQuestionReport'][_0x612a('0x2d')],function(_0x1ed70b){return{'name':_0x1ed70b['fieldName'],'type':_0x1ed70b[_0x612a('0x2e')][_0x612a('0x2f')]};});_0x59a4c0[_0x612a('0x30')]=_[_0x612a('0x2c')](_0x58e030,_0x612a('0x29'));_0x59a4c0[_0x612a('0x31')]=_['keys'](_0x156800[_0x612a('0x31')]);_0x59a4c0[_0x612a('0x32')]=_['intersection'](_0x59a4c0[_0x612a('0x30')],_0x59a4c0[_0x612a('0x31')]);_0x36d84b[_0x612a('0x33')]=_['intersection'](_0x59a4c0[_0x612a('0x30')],qs[_0x612a('0x34')](_0x156800[_0x612a('0x31')][_0x612a('0x34')]));_0x36d84b[_0x612a('0x33')]=_0x36d84b[_0x612a('0x33')][_0x612a('0x35')]?_0x36d84b[_0x612a('0x33')]:_0x59a4c0['model'];if(!_0x156800['query']['hasOwnProperty'](_0x612a('0x36'))){_0x36d84b[_0x612a('0x1e')]=qs['limit'](_0x156800[_0x612a('0x31')][_0x612a('0x1e')]);_0x36d84b[_0x612a('0x1c')]=qs[_0x612a('0x1c')](_0x156800[_0x612a('0x31')][_0x612a('0x1c')]);}_0x36d84b['order']=qs[_0x612a('0x37')](_0x156800[_0x612a('0x31')][_0x612a('0x37')]);_0x36d84b[_0x612a('0x38')]=qs['filters'](_[_0x612a('0x39')](_0x156800[_0x612a('0x31')],_0x59a4c0[_0x612a('0x32')]),_0x58e030);if(_0x156800['query'][_0x612a('0x3a')]){_0x36d84b[_0x612a('0x38')]=_['merge'](_0x36d84b[_0x612a('0x38')],{'$or':_[_0x612a('0x2c')](_0x58e030,function(_0x560cb1){if(_0x560cb1[_0x612a('0x2e')]!=='VIRTUAL'){var _0x1c274a={};_0x1c274a[_0x560cb1[_0x612a('0x29')]]={'$like':'%'+_0x156800[_0x612a('0x31')][_0x612a('0x3a')]+'%'};return _0x1c274a;}})});}_0x36d84b=_['merge']({},_0x36d84b,_0x156800['options']);var _0x19d8ff={'where':_0x36d84b[_0x612a('0x38')]};return db[_0x612a('0x3b')][_0x612a('0x3c')](_0x19d8ff)['then'](function(_0x4608ee){_0xb77e03[_0x612a('0x3c')]=_0x4608ee;if(_0x156800[_0x612a('0x31')][_0x612a('0x3d')]){_0x36d84b[_0x612a('0x3e')]=[{'all':!![]}];}return db[_0x612a('0x3b')][_0x612a('0x3f')](_0x36d84b);})[_0x612a('0x25')](function(_0x5cd486){_0xb77e03['rows']=_0x5cd486;return _0xb77e03;})[_0x612a('0x25')](respondWithFilteredResult(_0x12bc58,_0x36d84b))[_0x612a('0x40')](handleError(_0x12bc58,null));};exports[_0x612a('0x41')]=function(_0x2e241b,_0x12c197){var _0xa3aa20={'raw':!![],'where':{'id':_0x2e241b[_0x612a('0x42')]['id']}},_0x24ddb5={};_0x24ddb5[_0x612a('0x30')]=_['keys'](db['JscriptyQuestionReport'][_0x612a('0x2d')]);_0x24ddb5[_0x612a('0x31')]=_[_0x612a('0x43')](_0x2e241b[_0x612a('0x31')]);_0x24ddb5[_0x612a('0x32')]=_[_0x612a('0x44')](_0x24ddb5[_0x612a('0x30')],_0x24ddb5[_0x612a('0x31')]);_0xa3aa20['attributes']=_[_0x612a('0x44')](_0x24ddb5[_0x612a('0x30')],qs[_0x612a('0x34')](_0x2e241b[_0x612a('0x31')][_0x612a('0x34')]));_0xa3aa20['attributes']=_0xa3aa20[_0x612a('0x33')][_0x612a('0x35')]?_0xa3aa20[_0x612a('0x33')]:_0x24ddb5['model'];if(_0x2e241b[_0x612a('0x31')][_0x612a('0x3d')]){_0xa3aa20[_0x612a('0x3e')]=[{'all':!![]}];}_0xa3aa20=_[_0x612a('0x45')]({},_0xa3aa20,_0x2e241b['options']);return db[_0x612a('0x3b')][_0x612a('0x46')](_0xa3aa20)[_0x612a('0x25')](handleEntityNotFound(_0x12c197,null))['then'](respondWithResult(_0x12c197,null))['catch'](handleError(_0x12c197,null));};exports[_0x612a('0x47')]=function(_0x4962ff,_0xd6458d){return db['JscriptyQuestionReport']['create'](_0x4962ff[_0x612a('0x48')],{})[_0x612a('0x25')](respondWithResult(_0xd6458d,0xc9))[_0x612a('0x40')](handleError(_0xd6458d,null));};exports[_0x612a('0x24')]=function(_0x1c8599,_0x43f7a9){if(_0x1c8599[_0x612a('0x48')]['id']){delete _0x1c8599[_0x612a('0x48')]['id'];}return db[_0x612a('0x3b')][_0x612a('0x46')]({'where':{'id':_0x1c8599['params']['id']}})[_0x612a('0x25')](handleEntityNotFound(_0x43f7a9,null))[_0x612a('0x25')](saveUpdates(_0x1c8599['body'],null))[_0x612a('0x25')](respondWithResult(_0x43f7a9,null))[_0x612a('0x40')](handleError(_0x43f7a9,null));};exports[_0x612a('0x26')]=function(_0x4bc6b1,_0x34cbbf){return db[_0x612a('0x3b')][_0x612a('0x46')]({'where':{'id':_0x4bc6b1[_0x612a('0x42')]['id']}})[_0x612a('0x25')](handleEntityNotFound(_0x34cbbf,null))[_0x612a('0x25')](removeEntity(_0x34cbbf,null))[_0x612a('0x40')](handleError(_0x34cbbf,null));};exports['describe']=function(_0x5d3174,_0x2e8cd2){return db['JscriptyQuestionReport'][_0x612a('0x49')]()[_0x612a('0x25')](respondWithResult(_0x2e8cd2,null))[_0x612a('0x40')](handleError(_0x2e8cd2,null));};
\ No newline at end of file
+var _0x728b=['sort','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','fields','length','catch','create','find','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','JscriptyQuestionReport','type','model','map','query','filters','intersection','attributes','hasOwnProperty','order'];(function(_0x585b83,_0x25d403){var _0x2faa24=function(_0x2c756c){while(--_0x2c756c){_0x585b83['push'](_0x585b83['shift']());}};_0x2faa24(++_0x25d403);}(_0x728b,0x126));var _0xb728=function(_0x3fbcc5,_0xdfdb63){_0x3fbcc5=_0x3fbcc5-0x0;var _0x1a500f=_0x728b[_0x3fbcc5];return _0x1a500f;};'use strict';var emlformat=require(_0xb728('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb728('0x1'));var jsonpatch=require(_0xb728('0x2'));var rp=require(_0xb728('0x3'));var moment=require(_0xb728('0x4'));var BPromise=require(_0xb728('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb728('0x6'));var sox=require('sox');var csv=require(_0xb728('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb728('0x8'));var squel=require(_0xb728('0x9'));var crypto=require(_0xb728('0xa'));var jsforce=require(_0xb728('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb728('0x7'));var querystring=require(_0xb728('0xc'));var Papa=require('papaparse');var Redis=require(_0xb728('0xd'));var authService=require(_0xb728('0xe'));var qs=require(_0xb728('0xf'));var as=require(_0xb728('0x10'));var hardwareService=require(_0xb728('0x11'));var logger=require('../../config/logger')(_0xb728('0x12'));var utils=require(_0xb728('0x13'));var config=require(_0xb728('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb728('0x15'))['db'];function respondWithStatusCode(_0x3d2ece,_0x20eb98){_0x20eb98=_0x20eb98||0xcc;return function(_0x1ca56a){if(_0x1ca56a){return _0x3d2ece[_0xb728('0x16')](_0x20eb98);}return _0x3d2ece[_0xb728('0x17')](_0x20eb98)[_0xb728('0x18')]();};}function respondWithResult(_0x16e5cc,_0x2dfb50){_0x2dfb50=_0x2dfb50||0xc8;return function(_0x2c8ee3){if(_0x2c8ee3){return _0x16e5cc[_0xb728('0x17')](_0x2dfb50)[_0xb728('0x19')](_0x2c8ee3);}};}function respondWithFilteredResult(_0x2d0afa,_0x535a29){return function(_0x1da474){if(_0x1da474){var _0x4c7301=typeof _0x535a29[_0xb728('0x1a')]===_0xb728('0x1b')&&typeof _0x535a29[_0xb728('0x1c')]===_0xb728('0x1b');var _0x2bbe6c=_0x1da474[_0xb728('0x1d')];var _0x311938=_0x4c7301?0x0:_0x535a29[_0xb728('0x1a')];var _0x4fdf21=_0x4c7301?_0x1da474['count']:_0x535a29[_0xb728('0x1a')]+_0x535a29[_0xb728('0x1c')];var _0x1b8461;if(_0x4fdf21>=_0x2bbe6c){_0x4fdf21=_0x2bbe6c;_0x1b8461=0xc8;}else{_0x1b8461=0xce;}_0x2d0afa['status'](_0x1b8461);return _0x2d0afa['set'](_0xb728('0x1e'),_0x311938+'-'+_0x4fdf21+'/'+_0x2bbe6c)[_0xb728('0x19')](_0x1da474);}return null;};}function patchUpdates(_0x120b8b){return function(_0x5e92e0){try{jsonpatch[_0xb728('0x1f')](_0x5e92e0,_0x120b8b,!![]);}catch(_0x4ad770){return BPromise[_0xb728('0x20')](_0x4ad770);}return _0x5e92e0[_0xb728('0x21')]();};}function saveUpdates(_0x360919,_0x434fdb){return function(_0x3fd3c2){if(_0x3fd3c2){return _0x3fd3c2[_0xb728('0x22')](_0x360919)[_0xb728('0x23')](function(_0x2829dc){return _0x2829dc;});}return null;};}function removeEntity(_0x2364d1,_0x2b00b3){return function(_0x1702c8){if(_0x1702c8){return _0x1702c8[_0xb728('0x24')]()[_0xb728('0x23')](function(){_0x2364d1[_0xb728('0x17')](0xcc)[_0xb728('0x18')]();});}};}function handleEntityNotFound(_0x565478,_0x125874){return function(_0x35bf2f){if(!_0x35bf2f){_0x565478[_0xb728('0x16')](0x194);}return _0x35bf2f;};}function handleError(_0xe48981,_0x3c829e){_0x3c829e=_0x3c829e||0x1f4;return function(_0x3ce95c){logger['error'](_0x3ce95c[_0xb728('0x25')]);if(_0x3ce95c[_0xb728('0x26')]){delete _0x3ce95c[_0xb728('0x26')];}_0xe48981['status'](_0x3c829e)[_0xb728('0x27')](_0x3ce95c);};}exports[_0xb728('0x28')]=function(_0x52733b,_0x1e281c){var _0x957752={},_0x2731fc={},_0x5e2b06={'count':0x0,'rows':[]};var _0x126f86=_['map'](db[_0xb728('0x29')]['rawAttributes'],function(_0x4986a1){return{'name':_0x4986a1['fieldName'],'type':_0x4986a1[_0xb728('0x2a')]['key']};});_0x2731fc[_0xb728('0x2b')]=_[_0xb728('0x2c')](_0x126f86,'name');_0x2731fc[_0xb728('0x2d')]=_['keys'](_0x52733b[_0xb728('0x2d')]);_0x2731fc[_0xb728('0x2e')]=_[_0xb728('0x2f')](_0x2731fc[_0xb728('0x2b')],_0x2731fc[_0xb728('0x2d')]);_0x957752[_0xb728('0x30')]=_[_0xb728('0x2f')](_0x2731fc[_0xb728('0x2b')],qs['fields'](_0x52733b[_0xb728('0x2d')]['fields']));_0x957752[_0xb728('0x30')]=_0x957752[_0xb728('0x30')]['length']?_0x957752[_0xb728('0x30')]:_0x2731fc['model'];if(!_0x52733b['query'][_0xb728('0x31')]('nolimit')){_0x957752[_0xb728('0x1c')]=qs[_0xb728('0x1c')](_0x52733b[_0xb728('0x2d')]['limit']);_0x957752[_0xb728('0x1a')]=qs['offset'](_0x52733b['query'][_0xb728('0x1a')]);}_0x957752[_0xb728('0x32')]=qs['sort'](_0x52733b[_0xb728('0x2d')][_0xb728('0x33')]);_0x957752['where']=qs[_0xb728('0x2e')](_['pick'](_0x52733b[_0xb728('0x2d')],_0x2731fc[_0xb728('0x2e')]),_0x126f86);if(_0x52733b['query'][_0xb728('0x34')]){_0x957752['where']=_[_0xb728('0x35')](_0x957752['where'],{'$or':_['map'](_0x126f86,function(_0x109460){if(_0x109460[_0xb728('0x2a')]!==_0xb728('0x36')){var _0x9ba69e={};_0x9ba69e[_0x109460[_0xb728('0x26')]]={'$like':'%'+_0x52733b[_0xb728('0x2d')][_0xb728('0x34')]+'%'};return _0x9ba69e;}})});}_0x957752=_['merge']({},_0x957752,_0x52733b[_0xb728('0x37')]);var _0x505d84={'where':_0x957752['where']};return db['JscriptyQuestionReport'][_0xb728('0x1d')](_0x505d84)[_0xb728('0x23')](function(_0x19f0a9){_0x5e2b06[_0xb728('0x1d')]=_0x19f0a9;if(_0x52733b[_0xb728('0x2d')][_0xb728('0x38')]){_0x957752[_0xb728('0x39')]=[{'all':!![]}];}return db[_0xb728('0x29')][_0xb728('0x3a')](_0x957752);})[_0xb728('0x23')](function(_0x8c2dec){_0x5e2b06[_0xb728('0x3b')]=_0x8c2dec;return _0x5e2b06;})[_0xb728('0x23')](respondWithFilteredResult(_0x1e281c,_0x957752))['catch'](handleError(_0x1e281c,null));};exports['show']=function(_0x57ea5e,_0x21e7ff){var _0x23437a={'raw':!![],'where':{'id':_0x57ea5e[_0xb728('0x3c')]['id']}},_0x4a2c95={};_0x4a2c95[_0xb728('0x2b')]=_['keys'](db[_0xb728('0x29')][_0xb728('0x3d')]);_0x4a2c95[_0xb728('0x2d')]=_['keys'](_0x57ea5e['query']);_0x4a2c95[_0xb728('0x2e')]=_[_0xb728('0x2f')](_0x4a2c95[_0xb728('0x2b')],_0x4a2c95[_0xb728('0x2d')]);_0x23437a['attributes']=_[_0xb728('0x2f')](_0x4a2c95['model'],qs[_0xb728('0x3e')](_0x57ea5e[_0xb728('0x2d')]['fields']));_0x23437a['attributes']=_0x23437a[_0xb728('0x30')][_0xb728('0x3f')]?_0x23437a[_0xb728('0x30')]:_0x4a2c95[_0xb728('0x2b')];if(_0x57ea5e[_0xb728('0x2d')]['includeAll']){_0x23437a[_0xb728('0x39')]=[{'all':!![]}];}_0x23437a=_[_0xb728('0x35')]({},_0x23437a,_0x57ea5e[_0xb728('0x37')]);return db[_0xb728('0x29')]['find'](_0x23437a)['then'](handleEntityNotFound(_0x21e7ff,null))[_0xb728('0x23')](respondWithResult(_0x21e7ff,null))[_0xb728('0x40')](handleError(_0x21e7ff,null));};exports[_0xb728('0x41')]=function(_0x3b6e5e,_0x3c4219){return db[_0xb728('0x29')]['create'](_0x3b6e5e['body'],{})[_0xb728('0x23')](respondWithResult(_0x3c4219,0xc9))[_0xb728('0x40')](handleError(_0x3c4219,null));};exports[_0xb728('0x22')]=function(_0x47d32c,_0x14758e){if(_0x47d32c['body']['id']){delete _0x47d32c['body']['id'];}return db[_0xb728('0x29')][_0xb728('0x42')]({'where':{'id':_0x47d32c[_0xb728('0x3c')]['id']}})[_0xb728('0x23')](handleEntityNotFound(_0x14758e,null))[_0xb728('0x23')](saveUpdates(_0x47d32c[_0xb728('0x43')],null))[_0xb728('0x23')](respondWithResult(_0x14758e,null))[_0xb728('0x40')](handleError(_0x14758e,null));};exports[_0xb728('0x24')]=function(_0x2b1f3b,_0x4a8167){return db['JscriptyQuestionReport'][_0xb728('0x42')]({'where':{'id':_0x2b1f3b[_0xb728('0x3c')]['id']}})[_0xb728('0x23')](handleEntityNotFound(_0x4a8167,null))[_0xb728('0x23')](removeEntity(_0x4a8167,null))[_0xb728('0x40')](handleError(_0x4a8167,null));};exports[_0xb728('0x44')]=function(_0x2433bb,_0x4478d8){return db['JscriptyQuestionReport'][_0xb728('0x44')]()[_0xb728('0x23')](respondWithResult(_0x4478d8,null))[_0xb728('0x40')](handleError(_0x4478d8,null));};
\ No newline at end of file
index 0864217..a46ce87 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd809=['path','rimraf','./jscriptyQuestionReport.attributes','exports','define','report_jscripty_questions','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xd809,0x14a));var _0x9d80=function(_0x37b63a,_0x41fbb6){_0x37b63a=_0x37b63a-0x0;var _0x52b5da=_0xd809[_0x37b63a];return _0x52b5da;};'use strict';var _=require(_0x9d80('0x0'));var util=require('util');var logger=require(_0x9d80('0x1'))(_0x9d80('0x2'));var moment=require(_0x9d80('0x3'));var BPromise=require(_0x9d80('0x4'));var rp=require(_0x9d80('0x5'));var fs=require('fs');var path=require(_0x9d80('0x6'));var rimraf=require(_0x9d80('0x7'));var config=require('../../config/environment');var attributes=require(_0x9d80('0x8'));module[_0x9d80('0x9')]=function(_0x493f94,_0x493cff){return _0x493f94[_0x9d80('0xa')]('JscriptyQuestionReport',attributes,{'tableName':_0x9d80('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa687=['bluebird','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','moment'];(function(_0xa54d24,_0x59dc86){var _0x3912d7=function(_0x317a59){while(--_0x317a59){_0xa54d24['push'](_0xa54d24['shift']());}};_0x3912d7(++_0x59dc86);}(_0xa687,0x1a9));var _0x7a68=function(_0x12d79d,_0x3c4f12){_0x12d79d=_0x12d79d-0x0;var _0x5cbe01=_0xa687[_0x12d79d];return _0x5cbe01;};'use strict';var _=require(_0x7a68('0x0'));var util=require(_0x7a68('0x1'));var logger=require(_0x7a68('0x2'))('api');var moment=require(_0x7a68('0x3'));var BPromise=require(_0x7a68('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7a68('0x5'));var rimraf=require(_0x7a68('0x6'));var config=require(_0x7a68('0x7'));var attributes=require(_0x7a68('0x8'));module[_0x7a68('0x9')]=function(_0x449049,_0x1a929b){return _0x449049[_0x7a68('0xa')](_0x7a68('0xb'),attributes,{'tableName':_0x7a68('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index eba5311..d2f63e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9922=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','message','JscriptyQuestionReport,\x20%s,\x20%s','result','catch','lodash','util','moment','../../mysqldb','../../config/utils'];(function(_0x58f923,_0x2ac4a7){var _0x12088c=function(_0x415533){while(--_0x415533){_0x58f923['push'](_0x58f923['shift']());}};_0x12088c(++_0x2ac4a7);}(_0x9922,0x18a));var _0x2992=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9922[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2992('0x0'));var util=require(_0x2992('0x1'));var moment=require(_0x2992('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2992('0x3'))['db'];var utils=require(_0x2992('0x4'));var logger=require(_0x2992('0x5'))(_0x2992('0x6'));var config=require(_0x2992('0x7'));var jayson=require(_0x2992('0x8'));var client=jayson['client'][_0x2992('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4e4efb,_0xe5d41f,_0x28f3a1){return new BPromise(function(_0x5cc475,_0x1b17f3){return client[_0x2992('0xa')](_0x4e4efb,_0x28f3a1)[_0x2992('0xb')](function(_0x382fc8){logger[_0x2992('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xe5d41f,_0x2992('0xd'));logger[_0x2992('0xe')](_0x2992('0xf'),_0xe5d41f,_0x2992('0xd'),JSON['stringify'](_0x382fc8));if(_0x382fc8[_0x2992('0x10')]){if(_0x382fc8[_0x2992('0x10')]['code']===0x1f4){logger[_0x2992('0x10')]('JscriptyQuestionReport,\x20%s,\x20%s',_0xe5d41f,_0x382fc8[_0x2992('0x10')][_0x2992('0x11')]);return _0x1b17f3(_0x382fc8[_0x2992('0x10')]['message']);}logger[_0x2992('0x10')](_0x2992('0x12'),_0xe5d41f,_0x382fc8[_0x2992('0x10')]['message']);return _0x5cc475(_0x382fc8[_0x2992('0x10')][_0x2992('0x11')]);}else{logger[_0x2992('0xc')](_0x2992('0x12'),_0xe5d41f,_0x2992('0xd'));_0x5cc475(_0x382fc8[_0x2992('0x13')]['message']);}})[_0x2992('0x14')](function(_0x3d3283){logger[_0x2992('0x10')](_0x2992('0x12'),_0xe5d41f,_0x3d3283);_0x1b17f3(_0x3d3283);});});}
\ No newline at end of file
+var _0x6f50=['stringify','error','code','message','result','util','bluebird','randomstring','ioredis','../../config/logger','rpc','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f50,0x75));var _0x06f5=function(_0xe2c665,_0x5467a0){_0xe2c665=_0xe2c665-0x0;var _0x5bcbb7=_0x6f50[_0xe2c665];return _0x5bcbb7;};'use strict';var _=require('lodash');var util=require(_0x06f5('0x0'));var moment=require('moment');var BPromise=require(_0x06f5('0x1'));var rs=require(_0x06f5('0x2'));var fs=require('fs');var Redis=require(_0x06f5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x06f5('0x4'))(_0x06f5('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x27d7bd,_0x2215f0,_0x4f6520){return new BPromise(function(_0x33fe6e,_0x573755){return client['request'](_0x27d7bd,_0x4f6520)[_0x06f5('0x6')](function(_0x21caab){logger[_0x06f5('0x7')](_0x06f5('0x8'),_0x2215f0,_0x06f5('0x9'));logger[_0x06f5('0xa')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x2215f0,_0x06f5('0x9'),JSON[_0x06f5('0xb')](_0x21caab));if(_0x21caab[_0x06f5('0xc')]){if(_0x21caab[_0x06f5('0xc')][_0x06f5('0xd')]===0x1f4){logger['error'](_0x06f5('0x8'),_0x2215f0,_0x21caab[_0x06f5('0xc')][_0x06f5('0xe')]);return _0x573755(_0x21caab[_0x06f5('0xc')]['message']);}logger[_0x06f5('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2215f0,_0x21caab[_0x06f5('0xc')][_0x06f5('0xe')]);return _0x33fe6e(_0x21caab[_0x06f5('0xc')][_0x06f5('0xe')]);}else{logger[_0x06f5('0x7')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x2215f0,_0x06f5('0x9'));_0x33fe6e(_0x21caab[_0x06f5('0xf')][_0x06f5('0xe')]);}})['catch'](function(_0x1ab007){logger[_0x06f5('0xc')](_0x06f5('0x8'),_0x2215f0,_0x1ab007);_0x573755(_0x1ab007);});});}
\ No newline at end of file
index 3d52fc5..5624c78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d3f=['/:id','getQuestions','create','put','update','destroy','util','path','express','Router','fs-extra','../../components/auth/service','./jscriptySessionReport.controller','index','get','/describe','isAuthenticated','describe'];(function(_0x310eb9,_0x1aed15){var _0x28915c=function(_0x457fd6){while(--_0x457fd6){_0x310eb9['push'](_0x310eb9['shift']());}};_0x28915c(++_0x1aed15);}(_0x0d3f,0x114));var _0xf0d3=function(_0x4f4c2a,_0x5f5a28){_0x4f4c2a=_0x4f4c2a-0x0;var _0xd15be6=_0x0d3f[_0x4f4c2a];return _0xd15be6;};'use strict';var multer=require('multer');var util=require(_0xf0d3('0x0'));var path=require(_0xf0d3('0x1'));var timeout=require('connect-timeout');var express=require(_0xf0d3('0x2'));var router=express[_0xf0d3('0x3')]();var fs_extra=require(_0xf0d3('0x4'));var auth=require(_0xf0d3('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf0d3('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xf0d3('0x7')]);router[_0xf0d3('0x8')](_0xf0d3('0x9'),auth[_0xf0d3('0xa')](),controller[_0xf0d3('0xb')]);router[_0xf0d3('0x8')](_0xf0d3('0xc'),auth[_0xf0d3('0xa')](),controller['show']);router[_0xf0d3('0x8')]('/:id/questions',auth['isAuthenticated'](),controller[_0xf0d3('0xd')]);router['post']('/',auth[_0xf0d3('0xa')](),controller[_0xf0d3('0xe')]);router[_0xf0d3('0xf')](_0xf0d3('0xc'),auth[_0xf0d3('0xa')](),controller[_0xf0d3('0x10')]);router['delete'](_0xf0d3('0xc'),auth['isAuthenticated'](),controller[_0xf0d3('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xca92=['isAuthenticated','describe','show','getQuestions','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','./jscriptySessionReport.controller','get','index','/describe'];(function(_0x2242b9,_0x10285b){var _0x5ae8be=function(_0x41d49b){while(--_0x41d49b){_0x2242b9['push'](_0x2242b9['shift']());}};_0x5ae8be(++_0x10285b);}(_0xca92,0x122));var _0x2ca9=function(_0x1f5a63,_0x511504){_0x1f5a63=_0x1f5a63-0x0;var _0x30bb7a=_0xca92[_0x1f5a63];return _0x30bb7a;};'use strict';var multer=require(_0x2ca9('0x0'));var util=require(_0x2ca9('0x1'));var path=require(_0x2ca9('0x2'));var timeout=require(_0x2ca9('0x3'));var express=require('express');var router=express[_0x2ca9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2ca9('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2ca9('0x6'));router[_0x2ca9('0x7')]('/',auth['isAuthenticated'](),controller[_0x2ca9('0x8')]);router[_0x2ca9('0x7')](_0x2ca9('0x9'),auth[_0x2ca9('0xa')](),controller[_0x2ca9('0xb')]);router[_0x2ca9('0x7')]('/:id',auth[_0x2ca9('0xa')](),controller[_0x2ca9('0xc')]);router[_0x2ca9('0x7')]('/:id/questions',auth[_0x2ca9('0xa')](),controller[_0x2ca9('0xd')]);router['post']('/',auth[_0x2ca9('0xa')](),controller[_0x2ca9('0xe')]);router[_0x2ca9('0xf')](_0x2ca9('0x10'),auth[_0x2ca9('0xa')](),controller[_0x2ca9('0x11')]);router[_0x2ca9('0x12')](_0x2ca9('0x10'),auth[_0x2ca9('0xa')](),controller['destroy']);module[_0x2ca9('0x13')]=router;
\ No newline at end of file
index 430a72d..2135fc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeca5=['exports','setDataValue','format','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN','moment','sequelize'];(function(_0x4c5258,_0x3afb0f){var _0x3055db=function(_0x3edca1){while(--_0x3edca1){_0x4c5258['push'](_0x4c5258['shift']());}};_0x3055db(++_0x3afb0f);}(_0xeca5,0x1c9));var _0x5eca=function(_0x2db5a9,_0x4b3e9f){_0x2db5a9=_0x2db5a9-0x0;var _0x1e9c39=_0xeca5[_0x2db5a9];return _0x1e9c39;};'use strict';var moment=require(_0x5eca('0x0'));var Sequelize=require(_0x5eca('0x1'));module[_0x5eca('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x2dee6e){this[_0x5eca('0x3')]('starttime',_0x2dee6e);this['setDataValue']('endtime',moment()[_0x5eca('0x4')](_0x5eca('0x5')));}},'endtime':{'type':Sequelize[_0x5eca('0x6')]},'membername':{'type':Sequelize[_0x5eca('0x7')]},'projectname':{'type':Sequelize[_0x5eca('0x7')]},'queue':{'type':Sequelize[_0x5eca('0x7')]},'uniqueid':{'type':Sequelize[_0x5eca('0x7')]},'calleridname':{'type':Sequelize[_0x5eca('0x7')]},'calleridnum':{'type':Sequelize[_0x5eca('0x7')]},'completed':{'type':Sequelize[_0x5eca('0x8')],'defaultValue':![]}};
\ No newline at end of file
+var _0xafec=['moment','DATE','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN'];(function(_0x1b596f,_0x1d0814){var _0x48c840=function(_0x257118){while(--_0x257118){_0x1b596f['push'](_0x1b596f['shift']());}};_0x48c840(++_0x1d0814);}(_0xafec,0x168));var _0xcafe=function(_0x270dfb,_0x334d80){_0x270dfb=_0x270dfb-0x0;var _0x18b18f=_0xafec[_0x270dfb];return _0x18b18f;};'use strict';var moment=require(_0xcafe('0x0'));var Sequelize=require('sequelize');module['exports']={'starttime':{'type':Sequelize[_0xcafe('0x1')],'set':function(_0x2949c1){this[_0xcafe('0x2')](_0xcafe('0x3'),_0x2949c1);this[_0xcafe('0x2')](_0xcafe('0x4'),moment()[_0xcafe('0x5')](_0xcafe('0x6')));}},'endtime':{'type':Sequelize[_0xcafe('0x1')]},'membername':{'type':Sequelize[_0xcafe('0x7')]},'projectname':{'type':Sequelize[_0xcafe('0x7')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xcafe('0x7')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xcafe('0x7')]},'completed':{'type':Sequelize[_0xcafe('0x8')],'defaultValue':![]}};
\ No newline at end of file
index 6e0f80e..c45b4e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6f2=['index','map','JscriptySessionReport','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','type','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','create','body','find','describe','getQuestions','findOne','JscriptyQuestionReport','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send'];(function(_0x1c2fd7,_0x595cf1){var _0x369e9d=function(_0x12d274){while(--_0x12d274){_0x1c2fd7['push'](_0x1c2fd7['shift']());}};_0x369e9d(++_0x595cf1);}(_0xc6f2,0x16b));var _0x2c6f=function(_0x59dcf2,_0x1d065f){_0x59dcf2=_0x59dcf2-0x0;var _0x446ebf=_0xc6f2[_0x59dcf2];return _0x446ebf;};'use strict';var emlformat=require(_0x2c6f('0x0'));var rimraf=require(_0x2c6f('0x1'));var zipdir=require(_0x2c6f('0x2'));var jsonpatch=require(_0x2c6f('0x3'));var rp=require(_0x2c6f('0x4'));var moment=require(_0x2c6f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2c6f('0x6'));var util=require('util');var path=require(_0x2c6f('0x7'));var sox=require(_0x2c6f('0x8'));var csv=require('to-csv');var ejs=require(_0x2c6f('0x9'));var fs=require('fs');var fs_extra=require(_0x2c6f('0xa'));var _=require(_0x2c6f('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2c6f('0xc'));var toCsv=require(_0x2c6f('0xd'));var querystring=require('querystring');var Papa=require(_0x2c6f('0xe'));var Redis=require(_0x2c6f('0xf'));var authService=require(_0x2c6f('0x10'));var qs=require(_0x2c6f('0x11'));var as=require(_0x2c6f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2c6f('0x13'));var utils=require(_0x2c6f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x2c6f('0x15'));var db=require(_0x2c6f('0x16'))['db'];function respondWithStatusCode(_0x90652b,_0x969200){_0x969200=_0x969200||0xcc;return function(_0x2b742e){if(_0x2b742e){return _0x90652b[_0x2c6f('0x17')](_0x969200);}return _0x90652b[_0x2c6f('0x18')](_0x969200)[_0x2c6f('0x19')]();};}function respondWithResult(_0x4e692b,_0x510847){_0x510847=_0x510847||0xc8;return function(_0x450ab5){if(_0x450ab5){return _0x4e692b[_0x2c6f('0x18')](_0x510847)[_0x2c6f('0x1a')](_0x450ab5);}};}function respondWithFilteredResult(_0x191118,_0x13de47){return function(_0x13af24){if(_0x13af24){var _0x4a91b1=typeof _0x13de47[_0x2c6f('0x1b')]===_0x2c6f('0x1c')&&typeof _0x13de47[_0x2c6f('0x1d')]==='undefined';var _0x32c697=_0x13af24[_0x2c6f('0x1e')];var _0x3f3669=_0x4a91b1?0x0:_0x13de47[_0x2c6f('0x1b')];var _0x2efeae=_0x4a91b1?_0x13af24[_0x2c6f('0x1e')]:_0x13de47[_0x2c6f('0x1b')]+_0x13de47[_0x2c6f('0x1d')];var _0x17e6c5;if(_0x2efeae>=_0x32c697){_0x2efeae=_0x32c697;_0x17e6c5=0xc8;}else{_0x17e6c5=0xce;}_0x191118[_0x2c6f('0x18')](_0x17e6c5);return _0x191118[_0x2c6f('0x1f')](_0x2c6f('0x20'),_0x3f3669+'-'+_0x2efeae+'/'+_0x32c697)['json'](_0x13af24);}return null;};}function patchUpdates(_0x27df6f){return function(_0x3b55b3){try{jsonpatch['apply'](_0x3b55b3,_0x27df6f,!![]);}catch(_0x34566f){return BPromise[_0x2c6f('0x21')](_0x34566f);}return _0x3b55b3[_0x2c6f('0x22')]();};}function saveUpdates(_0x3c4b4f,_0x4c3cc5){return function(_0x1871b3){if(_0x1871b3){return _0x1871b3[_0x2c6f('0x23')](_0x3c4b4f)[_0x2c6f('0x24')](function(_0xe46fce){return _0xe46fce;});}return null;};}function removeEntity(_0x434667,_0x1fc666){return function(_0x4ff161){if(_0x4ff161){return _0x4ff161[_0x2c6f('0x25')]()[_0x2c6f('0x24')](function(){_0x434667[_0x2c6f('0x18')](0xcc)[_0x2c6f('0x19')]();});}};}function handleEntityNotFound(_0xa582c0,_0x22beef){return function(_0x2b20df){if(!_0x2b20df){_0xa582c0[_0x2c6f('0x17')](0x194);}return _0x2b20df;};}function handleError(_0x47be2a,_0xef77ab){_0xef77ab=_0xef77ab||0x1f4;return function(_0x3eb9f5){logger[_0x2c6f('0x26')](_0x3eb9f5[_0x2c6f('0x27')]);if(_0x3eb9f5[_0x2c6f('0x28')]){delete _0x3eb9f5[_0x2c6f('0x28')];}_0x47be2a[_0x2c6f('0x18')](_0xef77ab)[_0x2c6f('0x29')](_0x3eb9f5);};}exports[_0x2c6f('0x2a')]=function(_0x1dc7d0,_0x535414){var _0x98edce={},_0x4228d2={},_0x2d4b7b={'count':0x0,'rows':[]};var _0x48f5f2=_[_0x2c6f('0x2b')](db[_0x2c6f('0x2c')][_0x2c6f('0x2d')],function(_0x2f71b6){return{'name':_0x2f71b6[_0x2c6f('0x2e')],'type':_0x2f71b6['type'][_0x2c6f('0x2f')]};});_0x4228d2[_0x2c6f('0x30')]=_[_0x2c6f('0x2b')](_0x48f5f2,_0x2c6f('0x28'));_0x4228d2[_0x2c6f('0x31')]=_['keys'](_0x1dc7d0['query']);_0x4228d2['filters']=_[_0x2c6f('0x32')](_0x4228d2['model'],_0x4228d2[_0x2c6f('0x31')]);_0x98edce[_0x2c6f('0x33')]=_[_0x2c6f('0x32')](_0x4228d2[_0x2c6f('0x30')],qs[_0x2c6f('0x34')](_0x1dc7d0[_0x2c6f('0x31')]['fields']));_0x98edce['attributes']=_0x98edce[_0x2c6f('0x33')][_0x2c6f('0x35')]?_0x98edce[_0x2c6f('0x33')]:_0x4228d2[_0x2c6f('0x30')];if(!_0x1dc7d0[_0x2c6f('0x31')][_0x2c6f('0x36')](_0x2c6f('0x37'))){_0x98edce['limit']=qs[_0x2c6f('0x1d')](_0x1dc7d0['query']['limit']);_0x98edce[_0x2c6f('0x1b')]=qs[_0x2c6f('0x1b')](_0x1dc7d0['query'][_0x2c6f('0x1b')]);}_0x98edce[_0x2c6f('0x38')]=qs['sort'](_0x1dc7d0[_0x2c6f('0x31')][_0x2c6f('0x39')]);_0x98edce[_0x2c6f('0x3a')]=qs[_0x2c6f('0x3b')](_[_0x2c6f('0x3c')](_0x1dc7d0[_0x2c6f('0x31')],_0x4228d2[_0x2c6f('0x3b')]),_0x48f5f2);if(_0x1dc7d0[_0x2c6f('0x31')]['filter']){_0x98edce[_0x2c6f('0x3a')]=_[_0x2c6f('0x3d')](_0x98edce[_0x2c6f('0x3a')],{'$or':_[_0x2c6f('0x2b')](_0x48f5f2,function(_0x2c8402){if(_0x2c8402[_0x2c6f('0x3e')]!=='VIRTUAL'){var _0xa17a48={};_0xa17a48[_0x2c8402[_0x2c6f('0x28')]]={'$like':'%'+_0x1dc7d0[_0x2c6f('0x31')][_0x2c6f('0x3f')]+'%'};return _0xa17a48;}})});}_0x98edce=_[_0x2c6f('0x3d')]({},_0x98edce,_0x1dc7d0[_0x2c6f('0x40')]);var _0x309033={'where':_0x98edce['where']};return db['JscriptySessionReport'][_0x2c6f('0x1e')](_0x309033)['then'](function(_0x5769a6){_0x2d4b7b[_0x2c6f('0x1e')]=_0x5769a6;if(_0x1dc7d0['query'][_0x2c6f('0x41')]){_0x98edce[_0x2c6f('0x42')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x2c6f('0x43')](_0x98edce);})[_0x2c6f('0x24')](function(_0x3d9748){_0x2d4b7b[_0x2c6f('0x44')]=_0x3d9748;return _0x2d4b7b;})[_0x2c6f('0x24')](respondWithFilteredResult(_0x535414,_0x98edce))[_0x2c6f('0x45')](handleError(_0x535414,null));};exports[_0x2c6f('0x46')]=function(_0x110b84,_0x2feb84){var _0x4a53d9={'raw':!![],'where':{'id':_0x110b84[_0x2c6f('0x47')]['id']}},_0xc7872b={};_0xc7872b[_0x2c6f('0x30')]=_[_0x2c6f('0x48')](db[_0x2c6f('0x2c')][_0x2c6f('0x2d')]);_0xc7872b[_0x2c6f('0x31')]=_[_0x2c6f('0x48')](_0x110b84[_0x2c6f('0x31')]);_0xc7872b['filters']=_[_0x2c6f('0x32')](_0xc7872b['model'],_0xc7872b[_0x2c6f('0x31')]);_0x4a53d9['attributes']=_[_0x2c6f('0x32')](_0xc7872b[_0x2c6f('0x30')],qs['fields'](_0x110b84[_0x2c6f('0x31')]['fields']));_0x4a53d9[_0x2c6f('0x33')]=_0x4a53d9[_0x2c6f('0x33')][_0x2c6f('0x35')]?_0x4a53d9[_0x2c6f('0x33')]:_0xc7872b['model'];if(_0x110b84[_0x2c6f('0x31')]['includeAll']){_0x4a53d9[_0x2c6f('0x42')]=[{'all':!![]}];}_0x4a53d9=_[_0x2c6f('0x3d')]({},_0x4a53d9,_0x110b84[_0x2c6f('0x40')]);return db[_0x2c6f('0x2c')]['find'](_0x4a53d9)[_0x2c6f('0x24')](handleEntityNotFound(_0x2feb84,null))[_0x2c6f('0x24')](respondWithResult(_0x2feb84,null))[_0x2c6f('0x45')](handleError(_0x2feb84,null));};exports[_0x2c6f('0x49')]=function(_0x3036e5,_0x4ac736){return db[_0x2c6f('0x2c')]['create'](_0x3036e5[_0x2c6f('0x4a')],{})['then'](respondWithResult(_0x4ac736,0xc9))[_0x2c6f('0x45')](handleError(_0x4ac736,null));};exports['update']=function(_0x4a4381,_0x39c124){if(_0x4a4381['body']['id']){delete _0x4a4381['body']['id'];}return db[_0x2c6f('0x2c')][_0x2c6f('0x4b')]({'where':{'id':_0x4a4381[_0x2c6f('0x47')]['id']}})[_0x2c6f('0x24')](handleEntityNotFound(_0x39c124,null))[_0x2c6f('0x24')](saveUpdates(_0x4a4381[_0x2c6f('0x4a')],null))['then'](respondWithResult(_0x39c124,null))['catch'](handleError(_0x39c124,null));};exports['destroy']=function(_0x48f3b1,_0x7f41a8){return db[_0x2c6f('0x2c')][_0x2c6f('0x4b')]({'where':{'id':_0x48f3b1['params']['id']}})[_0x2c6f('0x24')](handleEntityNotFound(_0x7f41a8,null))['then'](removeEntity(_0x7f41a8,null))[_0x2c6f('0x45')](handleError(_0x7f41a8,null));};exports[_0x2c6f('0x4c')]=function(_0x22fb65,_0x566df9){return db[_0x2c6f('0x2c')][_0x2c6f('0x4c')]()[_0x2c6f('0x24')](respondWithResult(_0x566df9,null))[_0x2c6f('0x45')](handleError(_0x566df9,null));};exports[_0x2c6f('0x4d')]=function(_0x4d81d4,_0x208fbc,_0x4c96d6){var _0x5e0686={'raw':!![],'where':{}};var _0x333b1c={};var _0x328fd7={'count':0x0,'rows':[]};return db[_0x2c6f('0x2c')][_0x2c6f('0x4e')]({'where':{'id':_0x4d81d4['params']['id']}})[_0x2c6f('0x24')](handleEntityNotFound(_0x208fbc,null))['then'](function(_0x802c){if(_0x802c){_0x333b1c[_0x2c6f('0x30')]=_[_0x2c6f('0x48')](db[_0x2c6f('0x4f')]['rawAttributes']);_0x333b1c[_0x2c6f('0x31')]=_[_0x2c6f('0x48')](_0x4d81d4[_0x2c6f('0x31')]);_0x333b1c['filters']=_[_0x2c6f('0x32')](_0x333b1c[_0x2c6f('0x30')],_0x333b1c[_0x2c6f('0x31')]);_0x5e0686[_0x2c6f('0x33')]=_[_0x2c6f('0x32')](_0x333b1c[_0x2c6f('0x30')],qs[_0x2c6f('0x34')](_0x4d81d4['query']['fields']));_0x5e0686['attributes']=_0x5e0686[_0x2c6f('0x33')][_0x2c6f('0x35')]?_0x5e0686['attributes']:_0x333b1c[_0x2c6f('0x30')];if(!_0x4d81d4[_0x2c6f('0x31')][_0x2c6f('0x36')]('nolimit')){_0x5e0686[_0x2c6f('0x1d')]=qs['limit'](_0x4d81d4[_0x2c6f('0x31')][_0x2c6f('0x1d')]);_0x5e0686[_0x2c6f('0x1b')]=qs[_0x2c6f('0x1b')](_0x4d81d4[_0x2c6f('0x31')][_0x2c6f('0x1b')]);}_0x5e0686[_0x2c6f('0x38')]=qs['sort'](_0x4d81d4[_0x2c6f('0x31')][_0x2c6f('0x39')]);_0x5e0686[_0x2c6f('0x3a')]=qs[_0x2c6f('0x3b')](_[_0x2c6f('0x3c')](_0x4d81d4[_0x2c6f('0x31')],_0x333b1c[_0x2c6f('0x3b')]));_0x5e0686['where'][_0x2c6f('0x50')]=_0x802c['id'];if(_0x4d81d4[_0x2c6f('0x31')][_0x2c6f('0x3f')]){_0x5e0686[_0x2c6f('0x3a')]=_[_0x2c6f('0x3d')](_0x5e0686[_0x2c6f('0x3a')],{'$or':_[_0x2c6f('0x2b')](_0x5e0686[_0x2c6f('0x33')],function(_0x172054){var _0x1de2dc={};_0x1de2dc[_0x172054]={'$like':'%'+_0x4d81d4['query'][_0x2c6f('0x3f')]+'%'};return _0x1de2dc;})});}_0x5e0686=_[_0x2c6f('0x3d')]({},_0x5e0686,_0x4d81d4['options']);return db['JscriptyQuestionReport'][_0x2c6f('0x1e')]({'where':_0x5e0686[_0x2c6f('0x3a')]})['then'](function(_0x21dcce){_0x328fd7[_0x2c6f('0x1e')]=_0x21dcce;if(_0x4d81d4[_0x2c6f('0x31')][_0x2c6f('0x41')]){_0x5e0686['include']=[{'all':!![]}];}return db[_0x2c6f('0x4f')]['findAll'](_0x5e0686);})[_0x2c6f('0x24')](function(_0x1de89e){_0x328fd7[_0x2c6f('0x44')]=_0x1de89e;return _0x328fd7;});}})['then'](respondWithFilteredResult(_0x208fbc,_0x5e0686))[_0x2c6f('0x45')](handleError(_0x208fbc,null));};
\ No newline at end of file
+var _0xd1ec=['attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','catch','params','keys','includeAll','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','JscriptySessionReport','rawAttributes','type','key','model','query','intersection'];(function(_0x2af769,_0x13cc74){var _0x1ce13d=function(_0x5c4570){while(--_0x5c4570){_0x2af769['push'](_0x2af769['shift']());}};_0x1ce13d(++_0x13cc74);}(_0xd1ec,0x10a));var _0xcd1e=function(_0x3b38b2,_0x4f9520){_0x3b38b2=_0x3b38b2-0x0;var _0x1f3e21=_0xd1ec[_0x3b38b2];return _0x1f3e21;};'use strict';var emlformat=require(_0xcd1e('0x0'));var rimraf=require(_0xcd1e('0x1'));var zipdir=require(_0xcd1e('0x2'));var jsonpatch=require(_0xcd1e('0x3'));var rp=require(_0xcd1e('0x4'));var moment=require(_0xcd1e('0x5'));var BPromise=require(_0xcd1e('0x6'));var Mustache=require('mustache');var util=require(_0xcd1e('0x7'));var path=require(_0xcd1e('0x8'));var sox=require('sox');var csv=require(_0xcd1e('0x9'));var ejs=require(_0xcd1e('0xa'));var fs=require('fs');var fs_extra=require(_0xcd1e('0xb'));var _=require(_0xcd1e('0xc'));var squel=require(_0xcd1e('0xd'));var crypto=require('crypto');var jsforce=require(_0xcd1e('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcd1e('0x9'));var querystring=require(_0xcd1e('0xf'));var Papa=require(_0xcd1e('0x10'));var Redis=require(_0xcd1e('0x11'));var authService=require(_0xcd1e('0x12'));var qs=require(_0xcd1e('0x13'));var as=require(_0xcd1e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd1e('0x15'))(_0xcd1e('0x16'));var utils=require(_0xcd1e('0x17'));var config=require(_0xcd1e('0x18'));var licenseUtil=require(_0xcd1e('0x19'));var db=require(_0xcd1e('0x1a'))['db'];function respondWithStatusCode(_0x5b8ba9,_0x523189){_0x523189=_0x523189||0xcc;return function(_0x527618){if(_0x527618){return _0x5b8ba9[_0xcd1e('0x1b')](_0x523189);}return _0x5b8ba9['status'](_0x523189)['end']();};}function respondWithResult(_0x30a5c0,_0x204a04){_0x204a04=_0x204a04||0xc8;return function(_0x314441){if(_0x314441){return _0x30a5c0[_0xcd1e('0x1c')](_0x204a04)[_0xcd1e('0x1d')](_0x314441);}};}function respondWithFilteredResult(_0xb6d9bc,_0x3c7e56){return function(_0x9529e){if(_0x9529e){var _0x2904f2=typeof _0x3c7e56['offset']===_0xcd1e('0x1e')&&typeof _0x3c7e56[_0xcd1e('0x1f')]==='undefined';var _0x590ad1=_0x9529e[_0xcd1e('0x20')];var _0x19c4a2=_0x2904f2?0x0:_0x3c7e56[_0xcd1e('0x21')];var _0x522975=_0x2904f2?_0x9529e[_0xcd1e('0x20')]:_0x3c7e56[_0xcd1e('0x21')]+_0x3c7e56[_0xcd1e('0x1f')];var _0x222493;if(_0x522975>=_0x590ad1){_0x522975=_0x590ad1;_0x222493=0xc8;}else{_0x222493=0xce;}_0xb6d9bc[_0xcd1e('0x1c')](_0x222493);return _0xb6d9bc[_0xcd1e('0x22')]('Content-Range',_0x19c4a2+'-'+_0x522975+'/'+_0x590ad1)[_0xcd1e('0x1d')](_0x9529e);}return null;};}function patchUpdates(_0x43c221){return function(_0x4a9d7c){try{jsonpatch[_0xcd1e('0x23')](_0x4a9d7c,_0x43c221,!![]);}catch(_0x34cc0c){return BPromise[_0xcd1e('0x24')](_0x34cc0c);}return _0x4a9d7c[_0xcd1e('0x25')]();};}function saveUpdates(_0x92d3eb,_0x3da396){return function(_0x3208fa){if(_0x3208fa){return _0x3208fa[_0xcd1e('0x26')](_0x92d3eb)[_0xcd1e('0x27')](function(_0x21234c){return _0x21234c;});}return null;};}function removeEntity(_0x58ea10,_0x1e6958){return function(_0x33baff){if(_0x33baff){return _0x33baff[_0xcd1e('0x28')]()[_0xcd1e('0x27')](function(){_0x58ea10['status'](0xcc)[_0xcd1e('0x29')]();});}};}function handleEntityNotFound(_0x4f5adb,_0x173a53){return function(_0x14a020){if(!_0x14a020){_0x4f5adb[_0xcd1e('0x1b')](0x194);}return _0x14a020;};}function handleError(_0x54e7d4,_0x3f3f66){_0x3f3f66=_0x3f3f66||0x1f4;return function(_0x4cf5a8){logger[_0xcd1e('0x2a')](_0x4cf5a8[_0xcd1e('0x2b')]);if(_0x4cf5a8['name']){delete _0x4cf5a8[_0xcd1e('0x2c')];}_0x54e7d4[_0xcd1e('0x1c')](_0x3f3f66)[_0xcd1e('0x2d')](_0x4cf5a8);};}exports['index']=function(_0x145820,_0x43296b){var _0x1695c2={},_0x84b62b={},_0xed684d={'count':0x0,'rows':[]};var _0xd56450=_[_0xcd1e('0x2e')](db[_0xcd1e('0x2f')][_0xcd1e('0x30')],function(_0x5be771){return{'name':_0x5be771['fieldName'],'type':_0x5be771[_0xcd1e('0x31')][_0xcd1e('0x32')]};});_0x84b62b[_0xcd1e('0x33')]=_[_0xcd1e('0x2e')](_0xd56450,_0xcd1e('0x2c'));_0x84b62b[_0xcd1e('0x34')]=_['keys'](_0x145820[_0xcd1e('0x34')]);_0x84b62b['filters']=_[_0xcd1e('0x35')](_0x84b62b['model'],_0x84b62b[_0xcd1e('0x34')]);_0x1695c2[_0xcd1e('0x36')]=_['intersection'](_0x84b62b['model'],qs[_0xcd1e('0x37')](_0x145820[_0xcd1e('0x34')]['fields']));_0x1695c2[_0xcd1e('0x36')]=_0x1695c2[_0xcd1e('0x36')][_0xcd1e('0x38')]?_0x1695c2[_0xcd1e('0x36')]:_0x84b62b[_0xcd1e('0x33')];if(!_0x145820[_0xcd1e('0x34')]['hasOwnProperty'](_0xcd1e('0x39'))){_0x1695c2[_0xcd1e('0x1f')]=qs['limit'](_0x145820[_0xcd1e('0x34')]['limit']);_0x1695c2[_0xcd1e('0x21')]=qs[_0xcd1e('0x21')](_0x145820[_0xcd1e('0x34')][_0xcd1e('0x21')]);}_0x1695c2['order']=qs[_0xcd1e('0x3a')](_0x145820[_0xcd1e('0x34')]['sort']);_0x1695c2[_0xcd1e('0x3b')]=qs[_0xcd1e('0x3c')](_[_0xcd1e('0x3d')](_0x145820[_0xcd1e('0x34')],_0x84b62b[_0xcd1e('0x3c')]),_0xd56450);if(_0x145820[_0xcd1e('0x34')][_0xcd1e('0x3e')]){_0x1695c2[_0xcd1e('0x3b')]=_[_0xcd1e('0x3f')](_0x1695c2[_0xcd1e('0x3b')],{'$or':_[_0xcd1e('0x2e')](_0xd56450,function(_0x51a101){if(_0x51a101[_0xcd1e('0x31')]!==_0xcd1e('0x40')){var _0xbf271e={};_0xbf271e[_0x51a101[_0xcd1e('0x2c')]]={'$like':'%'+_0x145820['query']['filter']+'%'};return _0xbf271e;}})});}_0x1695c2=_[_0xcd1e('0x3f')]({},_0x1695c2,_0x145820[_0xcd1e('0x41')]);var _0x2dc496={'where':_0x1695c2['where']};return db['JscriptySessionReport'][_0xcd1e('0x20')](_0x2dc496)['then'](function(_0x3b73d0){_0xed684d[_0xcd1e('0x20')]=_0x3b73d0;if(_0x145820[_0xcd1e('0x34')]['includeAll']){_0x1695c2[_0xcd1e('0x42')]=[{'all':!![]}];}return db[_0xcd1e('0x2f')][_0xcd1e('0x43')](_0x1695c2);})[_0xcd1e('0x27')](function(_0x2fc532){_0xed684d['rows']=_0x2fc532;return _0xed684d;})[_0xcd1e('0x27')](respondWithFilteredResult(_0x43296b,_0x1695c2))[_0xcd1e('0x44')](handleError(_0x43296b,null));};exports['show']=function(_0x24c475,_0xd07aa3){var _0x21d497={'raw':!![],'where':{'id':_0x24c475[_0xcd1e('0x45')]['id']}},_0x26ef30={};_0x26ef30[_0xcd1e('0x33')]=_[_0xcd1e('0x46')](db[_0xcd1e('0x2f')][_0xcd1e('0x30')]);_0x26ef30[_0xcd1e('0x34')]=_[_0xcd1e('0x46')](_0x24c475[_0xcd1e('0x34')]);_0x26ef30[_0xcd1e('0x3c')]=_['intersection'](_0x26ef30[_0xcd1e('0x33')],_0x26ef30[_0xcd1e('0x34')]);_0x21d497[_0xcd1e('0x36')]=_['intersection'](_0x26ef30[_0xcd1e('0x33')],qs[_0xcd1e('0x37')](_0x24c475[_0xcd1e('0x34')]['fields']));_0x21d497[_0xcd1e('0x36')]=_0x21d497[_0xcd1e('0x36')]['length']?_0x21d497[_0xcd1e('0x36')]:_0x26ef30['model'];if(_0x24c475[_0xcd1e('0x34')][_0xcd1e('0x47')]){_0x21d497[_0xcd1e('0x42')]=[{'all':!![]}];}_0x21d497=_[_0xcd1e('0x3f')]({},_0x21d497,_0x24c475[_0xcd1e('0x41')]);return db[_0xcd1e('0x2f')][_0xcd1e('0x48')](_0x21d497)[_0xcd1e('0x27')](handleEntityNotFound(_0xd07aa3,null))[_0xcd1e('0x27')](respondWithResult(_0xd07aa3,null))[_0xcd1e('0x44')](handleError(_0xd07aa3,null));};exports[_0xcd1e('0x49')]=function(_0x5be74e,_0x4bfaa5){return db[_0xcd1e('0x2f')]['create'](_0x5be74e[_0xcd1e('0x4a')],{})['then'](respondWithResult(_0x4bfaa5,0xc9))[_0xcd1e('0x44')](handleError(_0x4bfaa5,null));};exports[_0xcd1e('0x26')]=function(_0xd52712,_0xb964b6){if(_0xd52712[_0xcd1e('0x4a')]['id']){delete _0xd52712[_0xcd1e('0x4a')]['id'];}return db[_0xcd1e('0x2f')][_0xcd1e('0x48')]({'where':{'id':_0xd52712[_0xcd1e('0x45')]['id']}})[_0xcd1e('0x27')](handleEntityNotFound(_0xb964b6,null))[_0xcd1e('0x27')](saveUpdates(_0xd52712[_0xcd1e('0x4a')],null))['then'](respondWithResult(_0xb964b6,null))['catch'](handleError(_0xb964b6,null));};exports[_0xcd1e('0x28')]=function(_0x35f8e1,_0x2ab406){return db[_0xcd1e('0x2f')][_0xcd1e('0x48')]({'where':{'id':_0x35f8e1[_0xcd1e('0x45')]['id']}})[_0xcd1e('0x27')](handleEntityNotFound(_0x2ab406,null))['then'](removeEntity(_0x2ab406,null))[_0xcd1e('0x44')](handleError(_0x2ab406,null));};exports[_0xcd1e('0x4b')]=function(_0x5c7eb1,_0x2a4811){return db[_0xcd1e('0x2f')][_0xcd1e('0x4b')]()[_0xcd1e('0x27')](respondWithResult(_0x2a4811,null))[_0xcd1e('0x44')](handleError(_0x2a4811,null));};exports[_0xcd1e('0x4c')]=function(_0x16d0bd,_0x433756,_0x228e61){var _0x413133={'raw':!![],'where':{}};var _0x229b15={};var _0x5f32db={'count':0x0,'rows':[]};return db[_0xcd1e('0x2f')][_0xcd1e('0x4d')]({'where':{'id':_0x16d0bd[_0xcd1e('0x45')]['id']}})[_0xcd1e('0x27')](handleEntityNotFound(_0x433756,null))[_0xcd1e('0x27')](function(_0x1e4f34){if(_0x1e4f34){_0x229b15['model']=_[_0xcd1e('0x46')](db[_0xcd1e('0x4e')][_0xcd1e('0x30')]);_0x229b15[_0xcd1e('0x34')]=_[_0xcd1e('0x46')](_0x16d0bd[_0xcd1e('0x34')]);_0x229b15['filters']=_['intersection'](_0x229b15[_0xcd1e('0x33')],_0x229b15[_0xcd1e('0x34')]);_0x413133['attributes']=_['intersection'](_0x229b15['model'],qs[_0xcd1e('0x37')](_0x16d0bd[_0xcd1e('0x34')][_0xcd1e('0x37')]));_0x413133['attributes']=_0x413133['attributes']['length']?_0x413133['attributes']:_0x229b15[_0xcd1e('0x33')];if(!_0x16d0bd[_0xcd1e('0x34')]['hasOwnProperty'](_0xcd1e('0x39'))){_0x413133[_0xcd1e('0x1f')]=qs[_0xcd1e('0x1f')](_0x16d0bd[_0xcd1e('0x34')][_0xcd1e('0x1f')]);_0x413133[_0xcd1e('0x21')]=qs[_0xcd1e('0x21')](_0x16d0bd[_0xcd1e('0x34')][_0xcd1e('0x21')]);}_0x413133[_0xcd1e('0x4f')]=qs[_0xcd1e('0x3a')](_0x16d0bd[_0xcd1e('0x34')][_0xcd1e('0x3a')]);_0x413133[_0xcd1e('0x3b')]=qs[_0xcd1e('0x3c')](_[_0xcd1e('0x3d')](_0x16d0bd['query'],_0x229b15[_0xcd1e('0x3c')]));_0x413133[_0xcd1e('0x3b')]['SessionId']=_0x1e4f34['id'];if(_0x16d0bd[_0xcd1e('0x34')][_0xcd1e('0x3e')]){_0x413133[_0xcd1e('0x3b')]=_[_0xcd1e('0x3f')](_0x413133[_0xcd1e('0x3b')],{'$or':_[_0xcd1e('0x2e')](_0x413133[_0xcd1e('0x36')],function(_0x28ff2d){var _0x593cb3={};_0x593cb3[_0x28ff2d]={'$like':'%'+_0x16d0bd[_0xcd1e('0x34')][_0xcd1e('0x3e')]+'%'};return _0x593cb3;})});}_0x413133=_[_0xcd1e('0x3f')]({},_0x413133,_0x16d0bd[_0xcd1e('0x41')]);return db[_0xcd1e('0x4e')][_0xcd1e('0x20')]({'where':_0x413133[_0xcd1e('0x3b')]})[_0xcd1e('0x27')](function(_0x1527ac){_0x5f32db[_0xcd1e('0x20')]=_0x1527ac;if(_0x16d0bd[_0xcd1e('0x34')][_0xcd1e('0x47')]){_0x413133[_0xcd1e('0x42')]=[{'all':!![]}];}return db[_0xcd1e('0x4e')]['findAll'](_0x413133);})[_0xcd1e('0x27')](function(_0x365af8){_0x5f32db['rows']=_0x365af8;return _0x5f32db;});}})[_0xcd1e('0x27')](respondWithFilteredResult(_0x433756,_0x413133))[_0xcd1e('0x44')](handleError(_0x433756,null));};
\ No newline at end of file
index 3f111f0..4cc7522 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53ec=['bluebird','path','../../config/environment','./jscriptySessionReport.attributes','define','JscriptySessionReport','lodash','util','../../config/logger','api','moment'];(function(_0x399841,_0x2bdcf9){var _0x227878=function(_0x160bdc){while(--_0x160bdc){_0x399841['push'](_0x399841['shift']());}};_0x227878(++_0x2bdcf9);}(_0x53ec,0x192));var _0xc53e=function(_0x52ad5f,_0x16d1a3){_0x52ad5f=_0x52ad5f-0x0;var _0xb217a2=_0x53ec[_0x52ad5f];return _0xb217a2;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9a5a=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','util'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x9a5a,0x194));var _0xa9a5=function(_0x309e97,_0x20950e){_0x309e97=_0x309e97-0x0;var _0x844ae=_0x9a5a[_0x309e97];return _0x844ae;};'use strict';var _=require(_0xa9a5('0x0'));var util=require(_0xa9a5('0x1'));var logger=require(_0xa9a5('0x2'))(_0xa9a5('0x3'));var moment=require(_0xa9a5('0x4'));var BPromise=require('bluebird');var rp=require(_0xa9a5('0x5'));var fs=require('fs');var path=require(_0xa9a5('0x6'));var rimraf=require(_0xa9a5('0x7'));var config=require(_0xa9a5('0x8'));var attributes=require(_0xa9a5('0x9'));module[_0xa9a5('0xa')]=function(_0x4a73f4,_0xb0ccd9){return _0x4a73f4[_0xa9a5('0xb')](_0xa9a5('0xc'),attributes,{'tableName':_0xa9a5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1d6cffb..4f77ecb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa456=['message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x54783e,_0xe85a52){var _0x4b03f4=function(_0x4095ba){while(--_0x4095ba){_0x54783e['push'](_0x54783e['shift']());}};_0x4b03f4(++_0xe85a52);}(_0xa456,0x142));var _0x6a45=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0xa456[_0x432fca];return _0x3adba4;};'use strict';var _=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var moment=require(_0x6a45('0x2'));var BPromise=require(_0x6a45('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6a45('0x4'));var db=require(_0x6a45('0x5'))['db'];var utils=require(_0x6a45('0x6'));var logger=require('../../config/logger')(_0x6a45('0x7'));var config=require(_0x6a45('0x8'));var jayson=require(_0x6a45('0x9'));var client=jayson[_0x6a45('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25cf8d,_0x26bfc0,_0x214514){return new BPromise(function(_0x19e67c,_0x3deb09){return client['request'](_0x25cf8d,_0x214514)[_0x6a45('0xb')](function(_0x517040){logger[_0x6a45('0xc')](_0x6a45('0xd'),_0x26bfc0,_0x6a45('0xe'));logger[_0x6a45('0xf')](_0x6a45('0x10'),_0x26bfc0,'request\x20sent',JSON['stringify'](_0x517040));if(_0x517040[_0x6a45('0x11')]){if(_0x517040[_0x6a45('0x11')]['code']===0x1f4){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x26bfc0,_0x517040[_0x6a45('0x11')][_0x6a45('0x12')]);return _0x3deb09(_0x517040[_0x6a45('0x11')][_0x6a45('0x12')]);}logger[_0x6a45('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x26bfc0,_0x517040['error'][_0x6a45('0x12')]);return _0x19e67c(_0x517040[_0x6a45('0x11')]['message']);}else{logger[_0x6a45('0xc')](_0x6a45('0xd'),_0x26bfc0,_0x6a45('0xe'));_0x19e67c(_0x517040[_0x6a45('0x13')]['message']);}})['catch'](function(_0x49023f){logger[_0x6a45('0x11')](_0x6a45('0xd'),_0x26bfc0,_0x49023f);_0x3deb09(_0x49023f);});});}
\ No newline at end of file
+var _0x7880=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1b0b59,_0x450a89){var _0x5976d8=function(_0x426763){while(--_0x426763){_0x1b0b59['push'](_0x1b0b59['shift']());}};_0x5976d8(++_0x450a89);}(_0x7880,0x1f4));var _0x0788=function(_0x1777e4,_0x38b4f8){_0x1777e4=_0x1777e4-0x0;var _0x21ecac=_0x7880[_0x1777e4];return _0x21ecac;};'use strict';var _=require('lodash');var util=require(_0x0788('0x0'));var moment=require(_0x0788('0x1'));var BPromise=require(_0x0788('0x2'));var rs=require(_0x0788('0x3'));var fs=require('fs');var Redis=require(_0x0788('0x4'));var db=require(_0x0788('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0788('0x6'))(_0x0788('0x7'));var config=require(_0x0788('0x8'));var jayson=require(_0x0788('0x9'));var client=jayson[_0x0788('0xa')][_0x0788('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f9cb8,_0x44bbb5,_0x3c29f3){return new BPromise(function(_0x422f8b,_0x55e48a){return client[_0x0788('0xc')](_0x3f9cb8,_0x3c29f3)['then'](function(_0xabaf81){logger['info'](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));logger[_0x0788('0xf')](_0x0788('0x10'),_0x44bbb5,_0x0788('0xe'),JSON['stringify'](_0xabaf81));if(_0xabaf81[_0x0788('0x11')]){if(_0xabaf81[_0x0788('0x11')][_0x0788('0x12')]===0x1f4){logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')][_0x0788('0x13')]);return _0x55e48a(_0xabaf81['error'][_0x0788('0x13')]);}logger[_0x0788('0x11')](_0x0788('0xd'),_0x44bbb5,_0xabaf81[_0x0788('0x11')]['message']);return _0x422f8b(_0xabaf81[_0x0788('0x11')]['message']);}else{logger[_0x0788('0x14')](_0x0788('0xd'),_0x44bbb5,_0x0788('0xe'));_0x422f8b(_0xabaf81[_0x0788('0x15')][_0x0788('0x13')]);}})[_0x0788('0x16')](function(_0x5e1a29){logger['error'](_0x0788('0xd'),_0x44bbb5,_0x5e1a29);_0x55e48a(_0x5e1a29);});});}
\ No newline at end of file
index 311d5fe..d94c4f0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xccc9=['index','put','/:id','isAuthenticated','update','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get'];(function(_0x5dcc02,_0xbb61e5){var _0x1305f7=function(_0x3dbd66){while(--_0x3dbd66){_0x5dcc02['push'](_0x5dcc02['shift']());}};_0x1305f7(++_0xbb61e5);}(_0xccc9,0xf4));var _0x9ccc=function(_0x4ae60b,_0x703aea){_0x4ae60b=_0x4ae60b-0x0;var _0x594c6c=_0xccc9[_0x4ae60b];return _0x594c6c;};'use strict';var multer=require(_0x9ccc('0x0'));var util=require(_0x9ccc('0x1'));var path=require(_0x9ccc('0x2'));var timeout=require(_0x9ccc('0x3'));var express=require('express');var router=express[_0x9ccc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9ccc('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9ccc('0x6'));var controller=require('./license.controller');router[_0x9ccc('0x7')]('/',controller[_0x9ccc('0x8')]);router[_0x9ccc('0x9')](_0x9ccc('0xa'),auth[_0x9ccc('0xb')](),controller[_0x9ccc('0xc')]);module[_0x9ccc('0xd')]=router;
\ No newline at end of file
+var _0xeff8=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./license.controller','index','put','/:id','isAuthenticated','exports','multer','util'];(function(_0x21125f,_0x8079f8){var _0x2f421d=function(_0x231299){while(--_0x231299){_0x21125f['push'](_0x21125f['shift']());}};_0x2f421d(++_0x8079f8);}(_0xeff8,0x186));var _0x8eff=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xeff8[_0x1ae5ab];return _0x1ce001;};'use strict';var multer=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var path=require('path');var timeout=require(_0x8eff('0x2'));var express=require(_0x8eff('0x3'));var router=express[_0x8eff('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8eff('0x5'));var interaction=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var controller=require(_0x8eff('0x8'));router['get']('/',controller[_0x8eff('0x9')]);router[_0x8eff('0xa')](_0x8eff('0xb'),auth[_0x8eff('0xc')](),controller['update']);module[_0x8eff('0xd')]=router;
\ No newline at end of file
index 2eba772..56aee52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa6b0=['exports','TEXT','STRING','sequelize'];(function(_0x695712,_0x35e158){var _0x4fa678=function(_0xaaa748){while(--_0xaaa748){_0x695712['push'](_0x695712['shift']());}};_0x4fa678(++_0x35e158);}(_0xa6b0,0x13b));var _0x0a6b=function(_0x44b762,_0x191d9a){_0x44b762=_0x44b762-0x0;var _0x3c025b=_0xa6b0[_0x44b762];return _0x3c025b;};'use strict';var Sequelize=require(_0x0a6b('0x0'));module[_0x0a6b('0x1')]={'license':{'type':Sequelize[_0x0a6b('0x2')]},'data1':{'type':Sequelize[_0x0a6b('0x3')]},'data2':{'type':Sequelize[_0x0a6b('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe0ce=['sequelize','TEXT','STRING'];(function(_0x32d34c,_0x9ad668){var _0x114e4b=function(_0x1bcd91){while(--_0x1bcd91){_0x32d34c['push'](_0x32d34c['shift']());}};_0x114e4b(++_0x9ad668);}(_0xe0ce,0x15c));var _0xee0c=function(_0x4e25eb,_0x350892){_0x4e25eb=_0x4e25eb-0x0;var _0x4d34ca=_0xe0ce[_0x4e25eb];return _0x4d34ca;};'use strict';var Sequelize=require(_0xee0c('0x0'));module['exports']={'license':{'type':Sequelize[_0xee0c('0x1')]},'data1':{'type':Sequelize[_0xee0c('0x2')]},'data2':{'type':Sequelize[_0xee0c('0x2')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index b4eee32..8bd6b6e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','name','send','index','model','keys','License','query','intersection','attributes','fields','merge','options','getLicense','catch','body','find','params','checkLicense','key','demo','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5fc3,0xa8));var _0x35fc=function(_0x57add2,_0x4f2b7d){_0x57add2=_0x57add2-0x0;var _0x4e3670=_0x5fc3[_0x57add2];return _0x4e3670;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){_0x2d8183['status'](0xcc)[_0x35fc('0x19')]();});}};}function handleEntityNotFound(_0x5a93df,_0x3d4a98){return function(_0x51cfec){if(!_0x51cfec){_0x5a93df[_0x35fc('0x17')](0x194);}return _0x51cfec;};}function handleError(_0x598d7a,_0x1bf180){_0x1bf180=_0x1bf180||0x1f4;return function(_0xdfab9f){logger['error'](_0xdfab9f['stack']);if(_0xdfab9f[_0x35fc('0x26')]){delete _0xdfab9f['name'];}_0x598d7a[_0x35fc('0x18')](_0x1bf180)[_0x35fc('0x27')](_0xdfab9f);};}var utilLicense=require('../../config/license/util');exports[_0x35fc('0x28')]=function(_0x645eac,_0x383837){var _0x9f3c8a={'raw':!![],'where':{'id':0x1}},_0x3735da={};_0x3735da[_0x35fc('0x29')]=_[_0x35fc('0x2a')](db[_0x35fc('0x2b')]['rawAttributes']);_0x3735da[_0x35fc('0x2c')]=_[_0x35fc('0x2a')](_0x645eac[_0x35fc('0x2c')]);_0x3735da['filters']=_[_0x35fc('0x2d')](_0x3735da[_0x35fc('0x29')],_0x3735da[_0x35fc('0x2c')]);_0x9f3c8a[_0x35fc('0x2e')]=_[_0x35fc('0x2d')](_0x3735da[_0x35fc('0x29')],qs[_0x35fc('0x2f')](_0x645eac[_0x35fc('0x2c')][_0x35fc('0x2f')]));_0x9f3c8a[_0x35fc('0x2e')]=_0x9f3c8a['attributes']['length']?_0x9f3c8a[_0x35fc('0x2e')]:_0x3735da['model'];_0x9f3c8a=_[_0x35fc('0x30')]({},_0x9f3c8a,_0x645eac[_0x35fc('0x31')]);return utilLicense[_0x35fc('0x32')](_0x9f3c8a)[_0x35fc('0x24')](respondWithResult(_0x383837,null))[_0x35fc('0x33')](handleError(_0x383837,null));};exports[_0x35fc('0x23')]=function(_0x4e43b4,_0x3fe193){if(_0x4e43b4[_0x35fc('0x34')]['id']){delete _0x4e43b4[_0x35fc('0x34')]['id'];}return db[_0x35fc('0x2b')][_0x35fc('0x35')]({'where':{'id':_0x4e43b4[_0x35fc('0x36')]['id']}})['then'](handleEntityNotFound(_0x3fe193,null))[_0x35fc('0x24')](function(_0x38193d){var _0x1fecdf=_0x38193d['get']({'plain':!![]});return utilLicense[_0x35fc('0x37')](_0x1fecdf,_0x4e43b4['body'][_0x35fc('0x38')]);})[_0x35fc('0x24')](function(_0x266a11){if(!_0x266a11[_0x35fc('0x39')]){return saveUpdates(_0x4e43b4['body'],null);}return _0x266a11;})['then'](respondWithResult(_0x3fe193,null))['catch'](handleError(_0x3fe193,null));};
\ No newline at end of file
+var _0x4975=['name','index','model','query','keys','intersection','fields','attributes','length','options','getLicense','catch','body','License','find','params','get','key','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','error','stack'];(function(_0x2dc1a8,_0x87f3c4){var _0x4ba310=function(_0x22fec7){while(--_0x22fec7){_0x2dc1a8['push'](_0x2dc1a8['shift']());}};_0x4ba310(++_0x87f3c4);}(_0x4975,0x86));var _0x5497=function(_0x2d407a,_0x56b7ea){_0x2d407a=_0x2d407a-0x0;var _0x28e9c3=_0x4975[_0x2d407a];return _0x28e9c3;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];function respondWithStatusCode(_0x1b23df,_0x1bb794){_0x1bb794=_0x1bb794||0xcc;return function(_0x984990){if(_0x984990){return _0x1b23df[_0x5497('0x18')](_0x1bb794);}return _0x1b23df[_0x5497('0x19')](_0x1bb794)[_0x5497('0x1a')]();};}function respondWithResult(_0xaca97d,_0x363a5b){_0x363a5b=_0x363a5b||0xc8;return function(_0x1a4c74){if(_0x1a4c74){return _0xaca97d['status'](_0x363a5b)[_0x5497('0x1b')](_0x1a4c74);}};}function respondWithFilteredResult(_0x4fb8e9,_0x4237a9){return function(_0x2bfd8a){if(_0x2bfd8a){var _0x19e5f3=typeof _0x4237a9[_0x5497('0x1c')]===_0x5497('0x1d')&&typeof _0x4237a9[_0x5497('0x1e')]===_0x5497('0x1d');var _0x575f6b=_0x2bfd8a['count'];var _0x3f4d20=_0x19e5f3?0x0:_0x4237a9[_0x5497('0x1c')];var _0x3a47fd=_0x19e5f3?_0x2bfd8a['count']:_0x4237a9[_0x5497('0x1c')]+_0x4237a9[_0x5497('0x1e')];var _0x18e8a8;if(_0x3a47fd>=_0x575f6b){_0x3a47fd=_0x575f6b;_0x18e8a8=0xc8;}else{_0x18e8a8=0xce;}_0x4fb8e9[_0x5497('0x19')](_0x18e8a8);return _0x4fb8e9[_0x5497('0x1f')](_0x5497('0x20'),_0x3f4d20+'-'+_0x3a47fd+'/'+_0x575f6b)[_0x5497('0x1b')](_0x2bfd8a);}return null;};}function patchUpdates(_0x10226f){return function(_0x2e3960){try{jsonpatch[_0x5497('0x21')](_0x2e3960,_0x10226f,!![]);}catch(_0x186065){return BPromise['reject'](_0x186065);}return _0x2e3960[_0x5497('0x22')]();};}function saveUpdates(_0x4d1b27,_0x19200a){return function(_0xd0868d){if(_0xd0868d){return _0xd0868d[_0x5497('0x23')](_0x4d1b27)[_0x5497('0x24')](function(_0x35ecd9){return _0x35ecd9;});}return null;};}function removeEntity(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(_0x54043a){return _0x54043a[_0x5497('0x25')]()[_0x5497('0x24')](function(){_0x3b2fbc[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x5223b5,_0x13b7a4){return function(_0x57268c){if(!_0x57268c){_0x5223b5[_0x5497('0x18')](0x194);}return _0x57268c;};}function handleError(_0x16a2b4,_0x429d36){_0x429d36=_0x429d36||0x1f4;return function(_0x34a1a5){logger[_0x5497('0x26')](_0x34a1a5[_0x5497('0x27')]);if(_0x34a1a5['name']){delete _0x34a1a5[_0x5497('0x28')];}_0x16a2b4['status'](_0x429d36)['send'](_0x34a1a5);};}var utilLicense=require('../../config/license/util');exports[_0x5497('0x29')]=function(_0x48d146,_0x5e9356){var _0xc3465={'raw':!![],'where':{'id':0x1}},_0xb14593={};_0xb14593[_0x5497('0x2a')]=_['keys'](db['License']['rawAttributes']);_0xb14593[_0x5497('0x2b')]=_[_0x5497('0x2c')](_0x48d146[_0x5497('0x2b')]);_0xb14593['filters']=_['intersection'](_0xb14593['model'],_0xb14593[_0x5497('0x2b')]);_0xc3465['attributes']=_[_0x5497('0x2d')](_0xb14593[_0x5497('0x2a')],qs[_0x5497('0x2e')](_0x48d146['query'][_0x5497('0x2e')]));_0xc3465[_0x5497('0x2f')]=_0xc3465['attributes'][_0x5497('0x30')]?_0xc3465[_0x5497('0x2f')]:_0xb14593[_0x5497('0x2a')];_0xc3465=_['merge']({},_0xc3465,_0x48d146[_0x5497('0x31')]);return utilLicense[_0x5497('0x32')](_0xc3465)[_0x5497('0x24')](respondWithResult(_0x5e9356,null))[_0x5497('0x33')](handleError(_0x5e9356,null));};exports[_0x5497('0x23')]=function(_0x4a6459,_0x386845){if(_0x4a6459[_0x5497('0x34')]['id']){delete _0x4a6459['body']['id'];}return db[_0x5497('0x35')][_0x5497('0x36')]({'where':{'id':_0x4a6459[_0x5497('0x37')]['id']}})[_0x5497('0x24')](handleEntityNotFound(_0x386845,null))[_0x5497('0x24')](function(_0x37011c){var _0x580e86=_0x37011c[_0x5497('0x38')]({'plain':!![]});return utilLicense['checkLicense'](_0x580e86,_0x4a6459[_0x5497('0x34')][_0x5497('0x39')]);})[_0x5497('0x24')](function(_0x5ab18c){if(!_0x5ab18c['demo']){return saveUpdates(_0x4a6459[_0x5497('0x34')],null);}return _0x5ab18c;})[_0x5497('0x24')](respondWithResult(_0x386845,null))[_0x5497('0x33')](handleError(_0x386845,null));};
\ No newline at end of file
index 167d99d..1d8230c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cf9=['path','rimraf','../../config/environment','./license.attributes','exports','define','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x2cf9,0x1c2));var _0x92cf=function(_0x2225c9,_0xe99b2e){_0x2225c9=_0x2225c9-0x0;var _0xe7b099=_0x2cf9[_0x2225c9];return _0xe7b099;};'use strict';var _=require(_0x92cf('0x0'));var util=require(_0x92cf('0x1'));var logger=require(_0x92cf('0x2'))(_0x92cf('0x3'));var moment=require(_0x92cf('0x4'));var BPromise=require('bluebird');var rp=require(_0x92cf('0x5'));var fs=require('fs');var path=require(_0x92cf('0x6'));var rimraf=require(_0x92cf('0x7'));var config=require(_0x92cf('0x8'));var attributes=require(_0x92cf('0x9'));module[_0x92cf('0xa')]=function(_0x33b32c,_0x37b775){return _0x33b32c[_0x92cf('0xb')]('License',attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x18e5=['License','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./license.attributes','exports','define'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x18e5,0x64));var _0x518e=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x18e5[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x518e('0x0'));var logger=require(_0x518e('0x1'))('api');var moment=require(_0x518e('0x2'));var BPromise=require(_0x518e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x518e('0x4'));var rimraf=require(_0x518e('0x5'));var config=require(_0x518e('0x6'));var attributes=require(_0x518e('0x7'));module[_0x518e('0x8')]=function(_0x2a2bfc,_0x330e28){return _0x2a2bfc[_0x518e('0x9')](_0x518e('0xa'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7d824f7..786f0ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc3cc=['client','http','request','then','info','debug','License,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','License,\x20%s,\x20%s','message','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x565bde,_0x1cdb6b){var _0x43de20=function(_0x42e1cc){while(--_0x42e1cc){_0x565bde['push'](_0x565bde['shift']());}};_0x43de20(++_0x1cdb6b);}(_0xc3cc,0x97));var _0xcc3c=function(_0xe2d14f,_0x49fd0e){_0xe2d14f=_0xe2d14f-0x0;var _0x4522d2=_0xc3cc[_0xe2d14f];return _0x4522d2;};'use strict';var _=require('lodash');var util=require(_0xcc3c('0x0'));var moment=require(_0xcc3c('0x1'));var BPromise=require(_0xcc3c('0x2'));var rs=require(_0xcc3c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcc3c('0x4'))['db'];var utils=require(_0xcc3c('0x5'));var logger=require(_0xcc3c('0x6'))(_0xcc3c('0x7'));var config=require(_0xcc3c('0x8'));var jayson=require(_0xcc3c('0x9'));var client=jayson[_0xcc3c('0xa')][_0xcc3c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa64510,_0x42f82d,_0x4042fb){return new BPromise(function(_0x4b6fb0,_0x22c885){return client[_0xcc3c('0xc')](_0xa64510,_0x4042fb)[_0xcc3c('0xd')](function(_0x175c69){logger[_0xcc3c('0xe')]('License,\x20%s,\x20%s',_0x42f82d,'request\x20sent');logger[_0xcc3c('0xf')](_0xcc3c('0x10'),_0x42f82d,_0xcc3c('0x11'),JSON[_0xcc3c('0x12')](_0x175c69));if(_0x175c69[_0xcc3c('0x13')]){if(_0x175c69[_0xcc3c('0x13')]['code']===0x1f4){logger[_0xcc3c('0x13')](_0xcc3c('0x14'),_0x42f82d,_0x175c69['error']['message']);return _0x22c885(_0x175c69[_0xcc3c('0x13')][_0xcc3c('0x15')]);}logger['error'](_0xcc3c('0x14'),_0x42f82d,_0x175c69[_0xcc3c('0x13')][_0xcc3c('0x15')]);return _0x4b6fb0(_0x175c69[_0xcc3c('0x13')][_0xcc3c('0x15')]);}else{logger['info'](_0xcc3c('0x14'),_0x42f82d,_0xcc3c('0x11'));_0x4b6fb0(_0x175c69[_0xcc3c('0x16')][_0xcc3c('0x15')]);}})['catch'](function(_0x59db0a){logger[_0xcc3c('0x13')]('License,\x20%s,\x20%s',_0x42f82d,_0x59db0a);_0x22c885(_0x59db0a);});});}
\ No newline at end of file
+var _0x24de=['code','License,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2b7ffe,_0x3129be){var _0x1a009a=function(_0x1c0a18){while(--_0x1c0a18){_0x2b7ffe['push'](_0x2b7ffe['shift']());}};_0x1a009a(++_0x3129be);}(_0x24de,0x116));var _0xe24d=function(_0x5cdebc,_0x21810f){_0x5cdebc=_0x5cdebc-0x0;var _0x4c56c7=_0x24de[_0x5cdebc];return _0x4c56c7;};'use strict';var _=require('lodash');var util=require(_0xe24d('0x0'));var moment=require('moment');var BPromise=require(_0xe24d('0x1'));var rs=require(_0xe24d('0x2'));var fs=require('fs');var Redis=require(_0xe24d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe24d('0x4'));var logger=require(_0xe24d('0x5'))(_0xe24d('0x6'));var config=require('../../config/environment');var jayson=require(_0xe24d('0x7'));var client=jayson[_0xe24d('0x8')][_0xe24d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4294ca,_0x1d3abd,_0x4b2a0b){return new BPromise(function(_0x10acb0,_0x2caffd){return client[_0xe24d('0xa')](_0x4294ca,_0x4b2a0b)[_0xe24d('0xb')](function(_0x24fe4c){logger[_0xe24d('0xc')]('License,\x20%s,\x20%s',_0x1d3abd,'request\x20sent');logger['debug'](_0xe24d('0xd'),_0x1d3abd,'request\x20sent',JSON[_0xe24d('0xe')](_0x24fe4c));if(_0x24fe4c[_0xe24d('0xf')]){if(_0x24fe4c[_0xe24d('0xf')][_0xe24d('0x10')]===0x1f4){logger[_0xe24d('0xf')](_0xe24d('0x11'),_0x1d3abd,_0x24fe4c[_0xe24d('0xf')][_0xe24d('0x12')]);return _0x2caffd(_0x24fe4c[_0xe24d('0xf')][_0xe24d('0x12')]);}logger[_0xe24d('0xf')](_0xe24d('0x11'),_0x1d3abd,_0x24fe4c[_0xe24d('0xf')]['message']);return _0x10acb0(_0x24fe4c[_0xe24d('0xf')][_0xe24d('0x12')]);}else{logger['info']('License,\x20%s,\x20%s',_0x1d3abd,'request\x20sent');_0x10acb0(_0x24fe4c[_0xe24d('0x13')][_0xe24d('0x12')]);}})[_0xe24d('0x14')](function(_0x4eeecf){logger[_0xe24d('0xf')](_0xe24d('0x11'),_0x1d3abd,_0x4eeecf);_0x2caffd(_0x4eeecf);});});}
\ No newline at end of file
index 200584c..30ccf28 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5276=['util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/canned_answers','getAnswers','/:id/in_servers','getSmtp','/:id/interactions','getInteractions','getApplications','/:id/messages','getMessages','/:id/verify','/:id/users','post','/:id/dispositions','addDisposition','create','/:id/out_servers','addSmtp','/:id/applications','/:id/send','addAgents','put','delete','removeDispositions','removeImap','destroy','removeAgents','exports','multer'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0x5276,0x1c2));var _0x6527=function(_0x530931,_0x4090c4){_0x530931=_0x530931-0x0;var _0x29ea44=_0x5276[_0x530931];return _0x29ea44;};'use strict';var multer=require(_0x6527('0x0'));var util=require(_0x6527('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6527('0x2')]();var fs_extra=require(_0x6527('0x3'));var auth=require(_0x6527('0x4'));var interaction=require(_0x6527('0x5'));var config=require(_0x6527('0x6'));var controller=require(_0x6527('0x7'));router[_0x6527('0x8')]('/',auth[_0x6527('0x9')](),controller['index']);router[_0x6527('0x8')](_0x6527('0xa'),auth['isAuthenticated'](),controller[_0x6527('0xb')]);router['get'](_0x6527('0xc'),auth[_0x6527('0x9')](),controller[_0x6527('0xd')]);router[_0x6527('0x8')]('/:id/dispositions',auth[_0x6527('0x9')](),controller['getDispositions']);router['get'](_0x6527('0xe'),auth['isAuthenticated'](),controller[_0x6527('0xf')]);router['get'](_0x6527('0x10'),auth[_0x6527('0x9')](),controller['getImap']);router['get']('/:id/out_servers',auth['isAuthenticated'](),controller[_0x6527('0x11')]);router[_0x6527('0x8')](_0x6527('0x12'),auth[_0x6527('0x9')](),controller[_0x6527('0x13')]);router[_0x6527('0x8')]('/:id/applications',auth['isAuthenticated'](),controller[_0x6527('0x14')]);router[_0x6527('0x8')](_0x6527('0x15'),auth[_0x6527('0x9')](),controller[_0x6527('0x16')]);router[_0x6527('0x8')](_0x6527('0x17'),auth[_0x6527('0x9')](),controller['verifySmtp']);router['get'](_0x6527('0x18'),auth[_0x6527('0x9')](),controller['getAgents']);router[_0x6527('0x19')](_0x6527('0x1a'),auth[_0x6527('0x9')](),controller[_0x6527('0x1b')]);router[_0x6527('0x19')](_0x6527('0xe'),auth['isAuthenticated'](),controller['addAnswer']);router[_0x6527('0x19')]('/',auth[_0x6527('0x9')](),controller[_0x6527('0x1c')]);router['post']('/:id/in_servers',auth[_0x6527('0x9')](),controller['addImap']);router[_0x6527('0x19')](_0x6527('0x1d'),auth[_0x6527('0x9')](),controller[_0x6527('0x1e')]);router[_0x6527('0x19')](_0x6527('0x12'),auth[_0x6527('0x9')](),controller['addInteraction']);router['post'](_0x6527('0x1f'),auth['isAuthenticated'](),controller['addApplications']);router[_0x6527('0x19')](_0x6527('0x20'),auth['isAuthenticated'](),controller['send']);router[_0x6527('0x19')](_0x6527('0x18'),auth[_0x6527('0x9')](),controller[_0x6527('0x21')]);router[_0x6527('0x22')](_0x6527('0xc'),auth[_0x6527('0x9')](),controller['update']);router[_0x6527('0x23')]('/:id/dispositions',auth[_0x6527('0x9')](),controller[_0x6527('0x24')]);router[_0x6527('0x23')](_0x6527('0xe'),auth[_0x6527('0x9')](),controller['removeAnswers']);router[_0x6527('0x23')](_0x6527('0x10'),auth[_0x6527('0x9')](),controller[_0x6527('0x25')]);router[_0x6527('0x23')](_0x6527('0x1d'),auth[_0x6527('0x9')](),controller['removeSmtp']);router[_0x6527('0x23')]('/:id',auth[_0x6527('0x9')](),controller[_0x6527('0x26')]);router[_0x6527('0x23')](_0x6527('0x18'),auth[_0x6527('0x9')](),controller[_0x6527('0x27')]);module[_0x6527('0x28')]=router;
\ No newline at end of file
+var _0x77f4=['/:id/send','put','update','delete','removeDispositions','removeAnswers','/:id/in_servers','removeImap','removeSmtp','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getImap','/:id/out_servers','getSmtp','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','post','addDisposition','addImap','addSmtp','/:id/interactions','/:id/applications','addApplications'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x77f4,0x9b));var _0x477f=function(_0x4eddc2,_0x16d25d){_0x4eddc2=_0x4eddc2-0x0;var _0x429ca2=_0x77f4[_0x4eddc2];return _0x429ca2;};'use strict';var multer=require(_0x477f('0x0'));var util=require(_0x477f('0x1'));var path=require(_0x477f('0x2'));var timeout=require(_0x477f('0x3'));var express=require(_0x477f('0x4'));var router=express[_0x477f('0x5')]();var fs_extra=require(_0x477f('0x6'));var auth=require(_0x477f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x477f('0x8'));var controller=require(_0x477f('0x9'));router[_0x477f('0xa')]('/',auth[_0x477f('0xb')](),controller[_0x477f('0xc')]);router[_0x477f('0xa')](_0x477f('0xd'),auth[_0x477f('0xb')](),controller[_0x477f('0xe')]);router[_0x477f('0xa')](_0x477f('0xf'),auth[_0x477f('0xb')](),controller[_0x477f('0x10')]);router['get'](_0x477f('0x11'),auth['isAuthenticated'](),controller[_0x477f('0x12')]);router[_0x477f('0xa')](_0x477f('0x13'),auth[_0x477f('0xb')](),controller[_0x477f('0x14')]);router['get']('/:id/in_servers',auth['isAuthenticated'](),controller[_0x477f('0x15')]);router[_0x477f('0xa')](_0x477f('0x16'),auth[_0x477f('0xb')](),controller[_0x477f('0x17')]);router['get']('/:id/interactions',auth['isAuthenticated'](),controller['getInteractions']);router['get']('/:id/applications',auth[_0x477f('0xb')](),controller[_0x477f('0x18')]);router[_0x477f('0xa')](_0x477f('0x19'),auth['isAuthenticated'](),controller[_0x477f('0x1a')]);router['get'](_0x477f('0x1b'),auth['isAuthenticated'](),controller[_0x477f('0x1c')]);router['get'](_0x477f('0x1d'),auth[_0x477f('0xb')](),controller['getAgents']);router[_0x477f('0x1e')](_0x477f('0x11'),auth[_0x477f('0xb')](),controller[_0x477f('0x1f')]);router[_0x477f('0x1e')](_0x477f('0x13'),auth[_0x477f('0xb')](),controller['addAnswer']);router['post']('/',auth[_0x477f('0xb')](),controller['create']);router[_0x477f('0x1e')]('/:id/in_servers',auth[_0x477f('0xb')](),controller[_0x477f('0x20')]);router[_0x477f('0x1e')](_0x477f('0x16'),auth[_0x477f('0xb')](),controller[_0x477f('0x21')]);router['post'](_0x477f('0x22'),auth['isAuthenticated'](),controller['addInteraction']);router[_0x477f('0x1e')](_0x477f('0x23'),auth[_0x477f('0xb')](),controller[_0x477f('0x24')]);router[_0x477f('0x1e')](_0x477f('0x25'),auth['isAuthenticated'](),controller['send']);router[_0x477f('0x1e')]('/:id/users',auth[_0x477f('0xb')](),controller['addAgents']);router[_0x477f('0x26')](_0x477f('0xf'),auth[_0x477f('0xb')](),controller[_0x477f('0x27')]);router[_0x477f('0x28')](_0x477f('0x11'),auth[_0x477f('0xb')](),controller[_0x477f('0x29')]);router[_0x477f('0x28')](_0x477f('0x13'),auth[_0x477f('0xb')](),controller[_0x477f('0x2a')]);router[_0x477f('0x28')](_0x477f('0x2b'),auth[_0x477f('0xb')](),controller[_0x477f('0x2c')]);router[_0x477f('0x28')](_0x477f('0x16'),auth['isAuthenticated'](),controller[_0x477f('0x2d')]);router['delete'](_0x477f('0xf'),auth[_0x477f('0xb')](),controller[_0x477f('0x2e')]);router[_0x477f('0x28')](_0x477f('0x1d'),auth['isAuthenticated'](),controller[_0x477f('0x2f')]);module['exports']=router;
\ No newline at end of file
index 81965c4..5e5d62b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c5a=['Arial,Helvetica,sans-serif','UNSIGNED','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT'];(function(_0x5d445e,_0x54a89a){var _0x30e69c=function(_0x2e9a07){while(--_0x2e9a07){_0x5d445e['push'](_0x5d445e['shift']());}};_0x30e69c(++_0x54a89a);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x485355,_0x262eea){_0x485355=_0x485355-0x0;var _0x77c1a4=_0x9c5a[_0x485355];return _0x77c1a4;};'use strict';var Sequelize=require(_0xa9c5('0x0'));module[_0xa9c5('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0xa9c5('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0xa9c5('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xa9c5('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xa9c5('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0xa9c5('0x4')]},'markAsUnread':{'type':Sequelize[_0xa9c5('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa9c5('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0xa9c5('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xa9c5('0x4')],'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[_0xa9c5('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa9c5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa9c5('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa9c5('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa9c5('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xa9c5('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x38e106){if(!_0x38e106)this[_0xa9c5('0x9')](_0xa9c5('0xa'),null);this[_0xa9c5('0x9')](_0xa9c5('0xb'),_0x38e106);}}};
\ No newline at end of file
+var _0xc474=['sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}<br/>Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc474,0xfc));var _0x4c47=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xc474[_0x5f309e];return _0x487b5e;};'use strict';var Sequelize=require(_0x4c47('0x0'));module[_0x4c47('0x1')]={'description':{'type':Sequelize[_0x4c47('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x4c47('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x4c47('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x4c47('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x4c47('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x4c47('0x4')]},'markAsUnread':{'type':Sequelize[_0x4c47('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x4c47('0x2')],'allowNull':![],'defaultValue':_0x4c47('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x4c47('0x4')],'defaultValue':function(){return _0x4c47('0x6');}},'notificationSound':{'type':Sequelize[_0x4c47('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4c47('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4c47('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4c47('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4c47('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4c47('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x4c47('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x4c47('0x3')],'defaultValue':![],'comment':_0x4c47('0x9'),'set':function(_0x492c49){if(!_0x492c49)this[_0x4c47('0xa')]('mandatoryDispositionPauseId',null);this[_0x4c47('0xa')](_0x4c47('0xb'),_0x492c49);}}};
\ No newline at end of file
index afb1616..37b45a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbfec=['priority','getApplications','getMessages','MailMessage','$gte','split','format','inlineCss','true','CmList','Contacts','updatedAt','DESC','from','%s\x20<%s>','email','attachments','join','root','secure','auth','SendMail','sendMail','List','defaults','messageId','subject','attach','YYYY-MM-DD\x20HH:mm:ss','out','Interaction','Messages','verifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','socket.io-emitter','./mailAccount.socket','jayson/promise','client','http','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','MailAccounts','stack','name','send','index','MailServerIn','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','Imap','keys','include','find','body','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','order','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','sort','removeAnswers','key','ListId','active','description','isNil','cservice','user','cuser','password','pass','cpassword','authentication','host','port','service','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','Owner','Tag','color','tag','transaction','MailApplication','destroy','bulkCreate'];(function(_0x21645a,_0x20bed3){var _0x3df4fc=function(_0x5d21e1){while(--_0x5d21e1){_0x21645a['push'](_0x21645a['shift']());}};_0x3df4fc(++_0x20bed3);}(_0xbfec,0x1b4));var _0xcbfe=function(_0x24168d,_0x1445a5){_0x24168d=_0x24168d-0x0;var _0x3ba872=_0xbfec[_0x24168d];return _0x3ba872;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcbfe('0x0'));var zipdir=require(_0xcbfe('0x1'));var jsonpatch=require(_0xcbfe('0x2'));var rp=require(_0xcbfe('0x3'));var moment=require('moment');var BPromise=require(_0xcbfe('0x4'));var Mustache=require(_0xcbfe('0x5'));var util=require('util');var path=require('path');var sox=require(_0xcbfe('0x6'));var csv=require(_0xcbfe('0x7'));var ejs=require(_0xcbfe('0x8'));var fs=require('fs');var fs_extra=require(_0xcbfe('0x9'));var _=require(_0xcbfe('0xa'));var squel=require(_0xcbfe('0xb'));var crypto=require(_0xcbfe('0xc'));var jsforce=require(_0xcbfe('0xd'));var deskjs=require(_0xcbfe('0xe'));var toCsv=require(_0xcbfe('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var htmlToText=require(_0xcbfe('0xf'));var juice=require(_0xcbfe('0x10'));var Redis=require(_0xcbfe('0x11'));var authService=require(_0xcbfe('0x12'));var qs=require(_0xcbfe('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcbfe('0x14'));var logger=require('../../config/logger')(_0xcbfe('0x15'));var utils=require(_0xcbfe('0x16'));var config=require(_0xcbfe('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xcbfe('0x18')]=_['defaults'](config[_0xcbfe('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xcbfe('0x19'))(new Redis(config['redis']));require(_0xcbfe('0x1a'))['register'](socket);var jayson=require(_0xcbfe('0x1b'));var client=jayson[_0xcbfe('0x1c')][_0xcbfe('0x1d')]({'port':0x232b});function respondWithRpcPromise(_0x3828c7,_0x22b1cc,_0x2c7b86,_0x340311){return new BPromise(function(_0x2ebb40,_0x73798a){var _0x4c892f=_0x340311||client;return _0x4c892f[_0xcbfe('0x1e')](_0x3828c7,_0x2c7b86)['then'](function(_0x4ee437){logger[_0xcbfe('0x1f')](_0xcbfe('0x20'),_0x22b1cc,_0xcbfe('0x21'));logger[_0xcbfe('0x22')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x22b1cc,_0xcbfe('0x21'),JSON[_0xcbfe('0x23')](_0x4ee437));if(_0x4ee437[_0xcbfe('0x24')]){if(_0x4ee437['error'][_0xcbfe('0x25')]===0x1f4){logger[_0xcbfe('0x24')](_0xcbfe('0x20'),_0x22b1cc,_0x4ee437[_0xcbfe('0x24')][_0xcbfe('0x26')]);return _0x73798a(_0x4ee437[_0xcbfe('0x24')]['message']);}logger[_0xcbfe('0x24')](_0xcbfe('0x20'),_0x22b1cc,_0x4ee437[_0xcbfe('0x24')]['message']);return _0x2ebb40(_0x4ee437[_0xcbfe('0x24')]['message']);}else{logger[_0xcbfe('0x1f')](_0xcbfe('0x20'),_0x22b1cc,_0xcbfe('0x21'));_0x2ebb40(_0x4ee437[_0xcbfe('0x27')][_0xcbfe('0x26')]);}})['catch'](function(_0x331493){logger[_0xcbfe('0x24')](_0xcbfe('0x20'),_0x22b1cc,_0x331493);_0x73798a(_0x331493);});});}function respondWithStatusCode(_0x311ac5,_0x557482){_0x557482=_0x557482||0xcc;return function(_0x126d15){if(_0x126d15){return _0x311ac5[_0xcbfe('0x28')](_0x557482);}return _0x311ac5['status'](_0x557482)[_0xcbfe('0x29')]();};}function respondWithResult(_0x2b8aa5,_0x508b72){_0x508b72=_0x508b72||0xc8;return function(_0x4d8cc8){if(_0x4d8cc8){return _0x2b8aa5[_0xcbfe('0x2a')](_0x508b72)[_0xcbfe('0x2b')](_0x4d8cc8);}};}function respondWithFilteredResult(_0x49e081,_0x990cf1){return function(_0x3f00c1){if(_0x3f00c1){var _0xbccc73=typeof _0x990cf1[_0xcbfe('0x2c')]===_0xcbfe('0x2d')&&typeof _0x990cf1[_0xcbfe('0x2e')]===_0xcbfe('0x2d');var _0x576f12=_0x3f00c1[_0xcbfe('0x2f')];var _0x5df11a=_0xbccc73?0x0:_0x990cf1['offset'];var _0x26024f=_0xbccc73?_0x3f00c1[_0xcbfe('0x2f')]:_0x990cf1[_0xcbfe('0x2c')]+_0x990cf1[_0xcbfe('0x2e')];var _0x3eac73;if(_0x26024f>=_0x576f12){_0x26024f=_0x576f12;_0x3eac73=0xc8;}else{_0x3eac73=0xce;}_0x49e081[_0xcbfe('0x2a')](_0x3eac73);return _0x49e081[_0xcbfe('0x30')](_0xcbfe('0x31'),_0x5df11a+'-'+_0x26024f+'/'+_0x576f12)['json'](_0x3f00c1);}return null;};}function patchUpdates(_0x24afed){return function(_0x568825){try{jsonpatch[_0xcbfe('0x32')](_0x568825,_0x24afed,!![]);}catch(_0x2bc75a){return BPromise[_0xcbfe('0x33')](_0x2bc75a);}return _0x568825[_0xcbfe('0x34')]();};}function saveUpdates(_0x1cc11e,_0x3dce28){return function(_0xa08dff){if(_0xa08dff){return _0xa08dff[_0xcbfe('0x35')](_0x1cc11e)['then'](function(_0x1cbb94){return _0x1cbb94;});}return null;};}function removeEntity(_0x1ebcdc,_0x43f9ba){return function(_0x59e317){if(_0x59e317){return _0x59e317['destroy']()[_0xcbfe('0x36')](function(){var _0x3c0991=_0x59e317[_0xcbfe('0x37')]({'plain':!![]});var _0xcd9ea5=_0xcbfe('0x38');return db['UserProfileResource']['destroy']({'where':{'type':_0xcd9ea5,'resourceId':_0x3c0991['id']}})[_0xcbfe('0x36')](function(){return _0x59e317;});})[_0xcbfe('0x36')](function(){_0x1ebcdc['status'](0xcc)[_0xcbfe('0x29')]();});}};}function handleEntityNotFound(_0x309386,_0x47d618){return function(_0x12b2fc){if(!_0x12b2fc){_0x309386[_0xcbfe('0x28')](0x194);}return _0x12b2fc;};}function handleError(_0x4e5e78,_0x2f0ed4){_0x2f0ed4=_0x2f0ed4||0x1f4;return function(_0x489018){logger[_0xcbfe('0x24')](_0x489018[_0xcbfe('0x39')]);if(_0x489018[_0xcbfe('0x3a')]){delete _0x489018[_0xcbfe('0x3a')];}_0x4e5e78[_0xcbfe('0x2a')](_0x2f0ed4)[_0xcbfe('0x3b')](_0x489018);};}exports[_0xcbfe('0x3c')]=function(_0x154786,_0x592bbc){var _0x5bab0a={'include':[{'model':db[_0xcbfe('0x3d')],'as':'Imap'},{'model':db[_0xcbfe('0x3e')],'as':_0xcbfe('0x3f')},{'model':db[_0xcbfe('0x40')],'as':_0xcbfe('0x41')}]},_0x9d3a58={},_0x1773f7={'count':0x0,'rows':[]};var _0x1a5eaf=_[_0xcbfe('0x42')](db[_0xcbfe('0x43')][_0xcbfe('0x44')],function(_0x44b463){return{'name':_0x44b463[_0xcbfe('0x45')],'type':_0x44b463[_0xcbfe('0x46')]['key']};});_0x9d3a58[_0xcbfe('0x47')]=_[_0xcbfe('0x42')](_0x1a5eaf,_0xcbfe('0x3a'));_0x9d3a58[_0xcbfe('0x48')]=_['keys'](_0x154786['query']);_0x9d3a58[_0xcbfe('0x49')]=_[_0xcbfe('0x4a')](_0x9d3a58[_0xcbfe('0x47')],_0x9d3a58['query']);_0x5bab0a[_0xcbfe('0x4b')]=_[_0xcbfe('0x4a')](_0x9d3a58['model'],qs['fields'](_0x154786[_0xcbfe('0x48')][_0xcbfe('0x4c')]));_0x5bab0a[_0xcbfe('0x4b')]=_0x5bab0a[_0xcbfe('0x4b')][_0xcbfe('0x4d')]?_0x5bab0a[_0xcbfe('0x4b')]:_0x9d3a58[_0xcbfe('0x47')];if(!_0x154786[_0xcbfe('0x48')][_0xcbfe('0x4e')](_0xcbfe('0x4f'))){_0x5bab0a[_0xcbfe('0x2e')]=qs['limit'](_0x154786[_0xcbfe('0x48')][_0xcbfe('0x2e')]);_0x5bab0a[_0xcbfe('0x2c')]=qs[_0xcbfe('0x2c')](_0x154786[_0xcbfe('0x48')][_0xcbfe('0x2c')]);}_0x5bab0a['order']=qs['sort'](_0x154786[_0xcbfe('0x48')]['sort']);_0x5bab0a[_0xcbfe('0x50')]=qs[_0xcbfe('0x49')](_['pick'](_0x154786[_0xcbfe('0x48')],_0x9d3a58[_0xcbfe('0x49')]),_0x1a5eaf);if(_0x154786[_0xcbfe('0x48')][_0xcbfe('0x51')]){_0x5bab0a['where']=_[_0xcbfe('0x52')](_0x5bab0a['where'],{'$or':_[_0xcbfe('0x42')](_0x1a5eaf,function(_0x444082){if(_0x444082['type']!==_0xcbfe('0x53')){var _0x3b6667={};_0x3b6667[_0x444082[_0xcbfe('0x3a')]]={'$like':'%'+_0x154786['query']['filter']+'%'};return _0x3b6667;}})});}_0x5bab0a=_['merge']({},_0x5bab0a,_0x154786[_0xcbfe('0x54')]);var _0x4ddb01={'where':_0x5bab0a['where']};return db['MailAccount']['count'](_0x4ddb01)[_0xcbfe('0x36')](function(_0x460f19){_0x1773f7[_0xcbfe('0x2f')]=_0x460f19;if(_0x154786[_0xcbfe('0x48')][_0xcbfe('0x55')]){_0x5bab0a['include']=[{'all':!![]}];}return db[_0xcbfe('0x43')][_0xcbfe('0x56')](_0x5bab0a);})[_0xcbfe('0x36')](function(_0x404b9b){_0x1773f7[_0xcbfe('0x57')]=_0x404b9b;return _0x1773f7;})[_0xcbfe('0x36')](respondWithFilteredResult(_0x592bbc,_0x5bab0a))[_0xcbfe('0x58')](handleError(_0x592bbc,null));};exports[_0xcbfe('0x59')]=function(_0x4dad71,_0x4508c4){var _0x58cb72={'raw':![],'where':{'id':_0x4dad71[_0xcbfe('0x5a')]['id']},'include':[{'model':db[_0xcbfe('0x3d')],'as':_0xcbfe('0x5b')},{'model':db[_0xcbfe('0x3e')],'as':'Smtp'},{'model':db[_0xcbfe('0x40')],'as':_0xcbfe('0x41')}]},_0x18f9ae={};_0x18f9ae[_0xcbfe('0x47')]=_[_0xcbfe('0x5c')](db['MailAccount'][_0xcbfe('0x44')]);_0x18f9ae['query']=_['keys'](_0x4dad71[_0xcbfe('0x48')]);_0x18f9ae[_0xcbfe('0x49')]=_[_0xcbfe('0x4a')](_0x18f9ae[_0xcbfe('0x47')],_0x18f9ae[_0xcbfe('0x48')]);_0x58cb72['attributes']=_[_0xcbfe('0x4a')](_0x18f9ae[_0xcbfe('0x47')],qs[_0xcbfe('0x4c')](_0x4dad71[_0xcbfe('0x48')]['fields']));_0x58cb72[_0xcbfe('0x4b')]=_0x58cb72[_0xcbfe('0x4b')][_0xcbfe('0x4d')]?_0x58cb72['attributes']:_0x18f9ae[_0xcbfe('0x47')];if(_0x4dad71[_0xcbfe('0x48')][_0xcbfe('0x55')]){_0x58cb72[_0xcbfe('0x5d')]=[{'all':!![]}];}_0x58cb72=_[_0xcbfe('0x52')]({},_0x58cb72,_0x4dad71['options']);return db[_0xcbfe('0x43')][_0xcbfe('0x5e')](_0x58cb72)[_0xcbfe('0x36')](handleEntityNotFound(_0x4508c4,null))[_0xcbfe('0x36')](respondWithResult(_0x4508c4,null))[_0xcbfe('0x58')](handleError(_0x4508c4,null));};exports['update']=function(_0x4b218f,_0x3185c4){if(_0x4b218f[_0xcbfe('0x5f')]['id']){delete _0x4b218f[_0xcbfe('0x5f')]['id'];}return db[_0xcbfe('0x43')]['find']({'where':{'id':_0x4b218f['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0xcbfe('0x5b')},{'model':db[_0xcbfe('0x3e')],'as':_0xcbfe('0x3f')},{'model':db['Pause'],'as':_0xcbfe('0x41')}]})[_0xcbfe('0x36')](handleEntityNotFound(_0x3185c4,null))[_0xcbfe('0x36')](saveUpdates(_0x4b218f[_0xcbfe('0x5f')],null))[_0xcbfe('0x36')](function(_0x345138){if(_0x345138&&_0x4b218f[_0xcbfe('0x5f')][_0xcbfe('0x5b')]){return db['MailServerIn'][_0xcbfe('0x35')](_0x4b218f[_0xcbfe('0x5f')][_0xcbfe('0x5b')],{'where':{'MailAccountId':_0x345138['id']}})[_0xcbfe('0x36')](function(){return _0x345138;});}return _0x345138;})[_0xcbfe('0x36')](function(_0x513574){if(_0x513574&&_0x4b218f[_0xcbfe('0x5f')][_0xcbfe('0x3f')]){return db[_0xcbfe('0x3e')][_0xcbfe('0x35')](_0x4b218f[_0xcbfe('0x5f')]['Smtp'],{'where':{'MailAccountId':_0x513574['id']}})[_0xcbfe('0x36')](function(){return _0x513574;});}return _0x513574;})[_0xcbfe('0x36')](respondWithResult(_0x3185c4,null))[_0xcbfe('0x58')](handleError(_0x3185c4,null));};exports[_0xcbfe('0x60')]=function(_0x15368b,_0x416510){return db[_0xcbfe('0x43')]['describe']()['then'](respondWithResult(_0x416510,null))[_0xcbfe('0x58')](handleError(_0x416510,null));};exports[_0xcbfe('0x61')]=function(_0xe6bba0,_0x29fc64,_0x3c3b54){if(_0xe6bba0[_0xcbfe('0x5f')]['id']){delete _0xe6bba0['body']['id'];}return db[_0xcbfe('0x43')][_0xcbfe('0x5e')]({'where':{'id':_0xe6bba0[_0xcbfe('0x5a')]['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0x29fc64,null))[_0xcbfe('0x36')](function(_0x2deccf){if(_0x2deccf){_0xe6bba0[_0xcbfe('0x5f')][_0xcbfe('0x62')]=_0x2deccf['id'];return db[_0xcbfe('0x63')][_0xcbfe('0x64')](_0xe6bba0[_0xcbfe('0x5f')]);}})[_0xcbfe('0x36')](respondWithResult(_0x29fc64,null))[_0xcbfe('0x58')](handleError(_0x29fc64,null));};exports[_0xcbfe('0x65')]=function(_0x101532,_0x4e911b,_0x41f2ee){var _0x3bc9c9={'raw':![],'where':{}};var _0x44c911={};var _0x549ee9={'count':0x0,'rows':[]};return db['MailAccount'][_0xcbfe('0x66')]({'where':{'id':_0x101532['params']['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0x4e911b,null))[_0xcbfe('0x36')](function(_0x7fb3a2){if(_0x7fb3a2){_0x44c911[_0xcbfe('0x47')]=_[_0xcbfe('0x5c')](db['Disposition'][_0xcbfe('0x44')]);_0x44c911[_0xcbfe('0x48')]=_[_0xcbfe('0x5c')](_0x101532['query']);_0x44c911[_0xcbfe('0x49')]=_[_0xcbfe('0x4a')](_0x44c911[_0xcbfe('0x47')],_0x44c911['query']);_0x3bc9c9[_0xcbfe('0x4b')]=_[_0xcbfe('0x4a')](_0x44c911[_0xcbfe('0x47')],qs[_0xcbfe('0x4c')](_0x101532[_0xcbfe('0x48')][_0xcbfe('0x4c')]));_0x3bc9c9['attributes']=_0x3bc9c9[_0xcbfe('0x4b')]['length']?_0x3bc9c9['attributes']:_0x44c911[_0xcbfe('0x47')];if(!_0x101532[_0xcbfe('0x48')][_0xcbfe('0x4e')](_0xcbfe('0x4f'))){_0x3bc9c9[_0xcbfe('0x2e')]=qs['limit'](_0x101532[_0xcbfe('0x48')][_0xcbfe('0x2e')]);_0x3bc9c9[_0xcbfe('0x2c')]=qs[_0xcbfe('0x2c')](_0x101532[_0xcbfe('0x48')][_0xcbfe('0x2c')]);}_0x3bc9c9[_0xcbfe('0x67')]=qs['sort'](_0x101532[_0xcbfe('0x48')]['sort']);_0x3bc9c9[_0xcbfe('0x50')]=qs[_0xcbfe('0x49')](_[_0xcbfe('0x68')](_0x101532[_0xcbfe('0x48')],_0x44c911[_0xcbfe('0x49')]));_0x3bc9c9[_0xcbfe('0x50')][_0xcbfe('0x62')]=_0x7fb3a2['id'];if(_0x101532[_0xcbfe('0x48')][_0xcbfe('0x51')]){_0x3bc9c9['where']=_[_0xcbfe('0x52')](_0x3bc9c9['where'],{'$or':_[_0xcbfe('0x42')](_0x3bc9c9[_0xcbfe('0x4b')],function(_0x37feb0){var _0x812327={};_0x812327[_0x37feb0]={'$like':'%'+_0x101532[_0xcbfe('0x48')][_0xcbfe('0x51')]+'%'};return _0x812327;})});}_0x3bc9c9=_[_0xcbfe('0x52')]({},_0x3bc9c9,_0x101532[_0xcbfe('0x54')]);return db[_0xcbfe('0x63')][_0xcbfe('0x2f')]({'where':_0x3bc9c9[_0xcbfe('0x50')]})[_0xcbfe('0x36')](function(_0x2a3411){_0x549ee9['count']=_0x2a3411;if(_0x101532[_0xcbfe('0x48')][_0xcbfe('0x55')]){_0x3bc9c9['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x3bc9c9);})['then'](function(_0x16ccc0){_0x549ee9[_0xcbfe('0x57')]=_0x16ccc0;return _0x549ee9;});}})[_0xcbfe('0x36')](respondWithFilteredResult(_0x4e911b,_0x3bc9c9))[_0xcbfe('0x58')](handleError(_0x4e911b,null));};exports['removeDispositions']=function(_0x25731b,_0x4715df,_0x9f384){return db[_0xcbfe('0x43')][_0xcbfe('0x5e')]({'where':{'id':_0x25731b[_0xcbfe('0x5a')]['id']}})['then'](handleEntityNotFound(_0x4715df,null))[_0xcbfe('0x36')](function(_0x31ddce){if(_0x31ddce){return _0x31ddce[_0xcbfe('0x69')](_0x25731b['query'][_0xcbfe('0x6a')]);}})['then'](respondWithStatusCode(_0x4715df,null))[_0xcbfe('0x58')](handleError(_0x4715df,null));};exports[_0xcbfe('0x6b')]=function(_0x89a7b1,_0x5014ec,_0x4cb557){if(_0x89a7b1[_0xcbfe('0x5f')]['id']){delete _0x89a7b1[_0xcbfe('0x5f')]['id'];}return db[_0xcbfe('0x43')]['find']({'where':{'id':_0x89a7b1[_0xcbfe('0x5a')]['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0x5014ec,null))[_0xcbfe('0x36')](function(_0x1fd1ed){if(_0x1fd1ed){_0x89a7b1[_0xcbfe('0x5f')]['MailAccountId']=_0x1fd1ed['id'];return db[_0xcbfe('0x6c')][_0xcbfe('0x64')](_0x89a7b1['body']);}})['then'](respondWithResult(_0x5014ec,null))[_0xcbfe('0x58')](handleError(_0x5014ec,null));};exports[_0xcbfe('0x6d')]=function(_0x4efb23,_0xd2fc7b,_0x29c39b){var _0x3bb117={'raw':![],'where':{}};var _0xf7514d={};var _0x13468a={'count':0x0,'rows':[]};return db[_0xcbfe('0x43')]['findOne']({'where':{'id':_0x4efb23['params']['id']}})['then'](handleEntityNotFound(_0xd2fc7b,null))[_0xcbfe('0x36')](function(_0x4724df){if(_0x4724df){_0xf7514d['model']=_['keys'](db[_0xcbfe('0x6c')][_0xcbfe('0x44')]);_0xf7514d['query']=_[_0xcbfe('0x5c')](_0x4efb23[_0xcbfe('0x48')]);_0xf7514d['filters']=_[_0xcbfe('0x4a')](_0xf7514d['model'],_0xf7514d[_0xcbfe('0x48')]);_0x3bb117[_0xcbfe('0x4b')]=_[_0xcbfe('0x4a')](_0xf7514d[_0xcbfe('0x47')],qs[_0xcbfe('0x4c')](_0x4efb23[_0xcbfe('0x48')]['fields']));_0x3bb117[_0xcbfe('0x4b')]=_0x3bb117['attributes'][_0xcbfe('0x4d')]?_0x3bb117[_0xcbfe('0x4b')]:_0xf7514d[_0xcbfe('0x47')];if(!_0x4efb23['query'][_0xcbfe('0x4e')](_0xcbfe('0x4f'))){_0x3bb117[_0xcbfe('0x2e')]=qs[_0xcbfe('0x2e')](_0x4efb23['query'][_0xcbfe('0x2e')]);_0x3bb117[_0xcbfe('0x2c')]=qs[_0xcbfe('0x2c')](_0x4efb23[_0xcbfe('0x48')][_0xcbfe('0x2c')]);}_0x3bb117[_0xcbfe('0x67')]=qs['sort'](_0x4efb23[_0xcbfe('0x48')][_0xcbfe('0x6e')]);_0x3bb117[_0xcbfe('0x50')]=qs[_0xcbfe('0x49')](_[_0xcbfe('0x68')](_0x4efb23[_0xcbfe('0x48')],_0xf7514d[_0xcbfe('0x49')]));_0x3bb117[_0xcbfe('0x50')][_0xcbfe('0x62')]=_0x4724df['id'];if(_0x4efb23[_0xcbfe('0x48')][_0xcbfe('0x51')]){_0x3bb117[_0xcbfe('0x50')]=_[_0xcbfe('0x52')](_0x3bb117[_0xcbfe('0x50')],{'$or':_['map'](_0x3bb117[_0xcbfe('0x4b')],function(_0xdbcd38){var _0x523a68={};_0x523a68[_0xdbcd38]={'$like':'%'+_0x4efb23['query']['filter']+'%'};return _0x523a68;})});}_0x3bb117=_[_0xcbfe('0x52')]({},_0x3bb117,_0x4efb23[_0xcbfe('0x54')]);return db['CannedAnswer'][_0xcbfe('0x2f')]({'where':_0x3bb117[_0xcbfe('0x50')]})[_0xcbfe('0x36')](function(_0x44ff53){_0x13468a[_0xcbfe('0x2f')]=_0x44ff53;if(_0x4efb23[_0xcbfe('0x48')][_0xcbfe('0x55')]){_0x3bb117[_0xcbfe('0x5d')]=[{'all':!![]}];}return db[_0xcbfe('0x6c')][_0xcbfe('0x56')](_0x3bb117);})[_0xcbfe('0x36')](function(_0x30b461){_0x13468a[_0xcbfe('0x57')]=_0x30b461;return _0x13468a;});}})[_0xcbfe('0x36')](respondWithFilteredResult(_0xd2fc7b,_0x3bb117))[_0xcbfe('0x58')](handleError(_0xd2fc7b,null));};exports[_0xcbfe('0x6f')]=function(_0x8c8642,_0x151bb3,_0x47e7fe){return db[_0xcbfe('0x43')][_0xcbfe('0x5e')]({'where':{'id':_0x8c8642[_0xcbfe('0x5a')]['id']}})['then'](handleEntityNotFound(_0x151bb3,null))[_0xcbfe('0x36')](function(_0x5a1beb){if(_0x5a1beb){return _0x5a1beb[_0xcbfe('0x6f')](_0x8c8642[_0xcbfe('0x48')][_0xcbfe('0x6a')]);}})['then'](respondWithStatusCode(_0x151bb3,null))[_0xcbfe('0x58')](handleError(_0x151bb3,null));};exports[_0xcbfe('0x64')]=function(_0x29ca55,_0x1158e1){var _0x5761de={'name':_0x29ca55[_0xcbfe('0x5f')]['name'],'key':_0x29ca55['body'][_0xcbfe('0x70')],'email':_0x29ca55['body']['email'],'ListId':_0x29ca55[_0xcbfe('0x5f')][_0xcbfe('0x71')],'active':!_['isNil'](_0x29ca55['body'][_0xcbfe('0x72')])?_0x29ca55[_0xcbfe('0x5f')][_0xcbfe('0x72')]:!![],'description':_0x29ca55[_0xcbfe('0x5f')][_0xcbfe('0x73')]||null,'Imap':{},'Smtp':{}};if(_[_0xcbfe('0x74')](_0x29ca55['body'][_0xcbfe('0x75')])){if(_0x29ca55[_0xcbfe('0x5f')]['cauthentication']){_0x5761de['Imap'][_0xcbfe('0x76')]=_0x5761de[_0xcbfe('0x3f')][_0xcbfe('0x76')]=_0x29ca55['body'][_0xcbfe('0x77')];_0x5761de['Imap'][_0xcbfe('0x78')]=_0x5761de[_0xcbfe('0x3f')][_0xcbfe('0x79')]=_0x29ca55[_0xcbfe('0x5f')][_0xcbfe('0x7a')];}else{_0x5761de[_0xcbfe('0x5b')]['authentication']=_0x5761de[_0xcbfe('0x3f')][_0xcbfe('0x7b')]=![];}_0x5761de[_0xcbfe('0x5b')][_0xcbfe('0x7c')]=_0x29ca55[_0xcbfe('0x5f')]['Imap']['host'];_0x5761de[_0xcbfe('0x5b')][_0xcbfe('0x7d')]=_0x29ca55[_0xcbfe('0x5f')][_0xcbfe('0x5b')]['port'];_0x5761de[_0xcbfe('0x3f')][_0xcbfe('0x7c')]=_0x29ca55[_0xcbfe('0x5f')][_0xcbfe('0x3f')][_0xcbfe('0x7c')];_0x5761de['Smtp'][_0xcbfe('0x7d')]=_0x29ca55['body']['Smtp']['port'];}else{_0x5761de[_0xcbfe('0x5b')][_0xcbfe('0x7e')]=_0x5761de['Smtp'][_0xcbfe('0x7e')]=_0x29ca55[_0xcbfe('0x5f')][_0xcbfe('0x75')];_0x5761de[_0xcbfe('0x5b')][_0xcbfe('0x76')]=_0x5761de['Smtp'][_0xcbfe('0x76')]=_0x29ca55['body']['cuser'];_0x5761de[_0xcbfe('0x5b')]['password']=_0x5761de[_0xcbfe('0x3f')]['pass']=_0x29ca55[_0xcbfe('0x5f')][_0xcbfe('0x7a')];}return db['MailAccount'][_0xcbfe('0x64')](_0x5761de,{'include':[{'model':db[_0xcbfe('0x3e')],'as':_0xcbfe('0x3f')},{'model':db['MailServerIn'],'as':'Imap'}]})['then'](function(_0x4c071a){var _0x3641eb=_0x29ca55[_0xcbfe('0x76')][_0xcbfe('0x37')]({'plain':!![]});if(!_0x3641eb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3641eb[_0xcbfe('0x7f')]===_0xcbfe('0x76')){var _0x46d82c=_0x4c071a[_0xcbfe('0x37')]({'plain':!![]});return db[_0xcbfe('0x80')][_0xcbfe('0x5e')]({'where':{'name':_0xcbfe('0x38'),'userProfileId':_0x3641eb[_0xcbfe('0x81')]},'raw':!![]})[_0xcbfe('0x36')](function(_0x5f4227){if(_0x5f4227&&_0x5f4227[_0xcbfe('0x82')]===0x0){return db[_0xcbfe('0x83')][_0xcbfe('0x64')]({'name':_0x46d82c[_0xcbfe('0x3a')],'resourceId':_0x46d82c['id'],'type':_0x5f4227[_0xcbfe('0x3a')],'sectionId':_0x5f4227['id']},{})[_0xcbfe('0x36')](function(){return _0x4c071a;});}else{return _0x4c071a;}})[_0xcbfe('0x58')](function(_0x10cfc5){logger[_0xcbfe('0x24')](_0xcbfe('0x84'),_0x10cfc5);throw _0x10cfc5;});}return _0x4c071a;})[_0xcbfe('0x36')](respondWithResult(_0x1158e1,0xc9))[_0xcbfe('0x58')](handleError(_0x1158e1,null));};exports[_0xcbfe('0x85')]=function(_0x5992f5,_0x585dc0,_0x34ae7c){return db['MailAccount'][_0xcbfe('0x66')]({'where':{'id':_0x5992f5['params']['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0x585dc0,null))['then'](function(_0x188cfb){if(_0x188cfb){return _0x188cfb['getImap']();}return null;})[_0xcbfe('0x36')](respondWithResult(_0x585dc0,null))[_0xcbfe('0x58')](handleError(_0x585dc0,null));};exports[_0xcbfe('0x86')]=function(_0x417700,_0x5f5dd7,_0x4c2ef1){if(_0x417700[_0xcbfe('0x5f')]['id']){delete _0x417700[_0xcbfe('0x5f')]['id'];}return db[_0xcbfe('0x43')][_0xcbfe('0x5e')]({'where':{'id':_0x417700[_0xcbfe('0x5a')]['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0x5f5dd7,null))[_0xcbfe('0x36')](function(_0x13eeea){if(_0x13eeea){_0x417700[_0xcbfe('0x5f')][_0xcbfe('0x62')]=_0x13eeea['id'];return db[_0xcbfe('0x3d')][_0xcbfe('0x64')](_0x417700[_0xcbfe('0x5f')]);}})[_0xcbfe('0x36')](respondWithResult(_0x5f5dd7,null))[_0xcbfe('0x58')](handleError(_0x5f5dd7,null));};exports[_0xcbfe('0x87')]=function(_0x2886d1,_0x58ec33,_0x44d54e){return db[_0xcbfe('0x43')][_0xcbfe('0x66')]({'where':{'id':_0x2886d1[_0xcbfe('0x5a')]['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0x58ec33,null))['then'](function(_0x560e4b){if(_0x560e4b){return _0x560e4b[_0xcbfe('0x88')](null);}return null;})['then'](respondWithStatusCode(_0x58ec33,null))[_0xcbfe('0x58')](handleError(_0x58ec33,null));};exports[_0xcbfe('0x89')]=function(_0x47dc32,_0xc9d277,_0x171265){return db[_0xcbfe('0x43')][_0xcbfe('0x66')]({'where':{'id':_0x47dc32[_0xcbfe('0x5a')]['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0xc9d277,null))[_0xcbfe('0x36')](function(_0x3f4480){if(_0x3f4480){return _0x3f4480[_0xcbfe('0x89')]();}return null;})[_0xcbfe('0x36')](respondWithResult(_0xc9d277,null))['catch'](handleError(_0xc9d277,null));};exports['addSmtp']=function(_0x178ccf,_0xe385a7,_0x5f310a){if(_0x178ccf[_0xcbfe('0x5f')]['id']){delete _0x178ccf[_0xcbfe('0x5f')]['id'];}return db[_0xcbfe('0x43')][_0xcbfe('0x5e')]({'where':{'id':_0x178ccf[_0xcbfe('0x5a')]['id']}})['then'](handleEntityNotFound(_0xe385a7,null))[_0xcbfe('0x36')](function(_0x396ed2){if(_0x396ed2){_0x178ccf[_0xcbfe('0x5f')][_0xcbfe('0x62')]=_0x396ed2['id'];return db[_0xcbfe('0x3e')][_0xcbfe('0x64')](_0x178ccf['body']);}})['then'](respondWithResult(_0xe385a7,null))[_0xcbfe('0x58')](handleError(_0xe385a7,null));};exports['removeSmtp']=function(_0x11f1ed,_0x41d507,_0x52b82b){return db['MailAccount'][_0xcbfe('0x66')]({'where':{'id':_0x11f1ed['params']['id']}})['then'](handleEntityNotFound(_0x41d507,null))[_0xcbfe('0x36')](function(_0x3e25e9){if(_0x3e25e9){return _0x3e25e9['setSmtp'](null);}return null;})[_0xcbfe('0x36')](respondWithStatusCode(_0x41d507,null))[_0xcbfe('0x58')](handleError(_0x41d507,null));};exports[_0xcbfe('0x8a')]=function(_0x2361cc,_0x1a015c,_0x20320f){return db[_0xcbfe('0x8b')]['find']({'where':{'id':_0x2361cc[_0xcbfe('0x5a')]['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0x1a015c,null))[_0xcbfe('0x36')](function(_0x932294){if(_0x932294){return _0x932294[_0xcbfe('0x8a')](_0x2361cc[_0xcbfe('0x5f')][_0xcbfe('0x6a')],_[_0xcbfe('0x8c')](_0x2361cc['body'],[_0xcbfe('0x6a'),'id'])||{});}})[_0xcbfe('0x36')](respondWithResult(_0x1a015c,null))[_0xcbfe('0x58')](handleError(_0x1a015c,null));};exports[_0xcbfe('0x8d')]=function(_0x34b4d7,_0x54b31c,_0x5b894a){var _0x32e26e={'raw':![],'where':{}};var _0x3c1c1c={};var _0x4ca823={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x34b4d7[_0xcbfe('0x5a')]['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0x54b31c,null))['then'](function(_0x6176e2){if(_0x6176e2){_0x3c1c1c[_0xcbfe('0x47')]=_[_0xcbfe('0x5c')](db[_0xcbfe('0x8b')]['rawAttributes']);_0x3c1c1c[_0xcbfe('0x48')]=_[_0xcbfe('0x5c')](_0x34b4d7['query']);_0x3c1c1c[_0xcbfe('0x49')]=_['intersection'](_0x3c1c1c['model'],_0x3c1c1c[_0xcbfe('0x48')]);_0x32e26e[_0xcbfe('0x4b')]=_['intersection'](_0x3c1c1c[_0xcbfe('0x47')],qs[_0xcbfe('0x4c')](_0x34b4d7['query'][_0xcbfe('0x4c')]));_0x32e26e[_0xcbfe('0x4b')]=_0x32e26e[_0xcbfe('0x4b')][_0xcbfe('0x4d')]?_0x32e26e[_0xcbfe('0x4b')]:_0x3c1c1c[_0xcbfe('0x47')];if(!_0x34b4d7[_0xcbfe('0x48')]['hasOwnProperty'](_0xcbfe('0x4f'))){_0x32e26e[_0xcbfe('0x2e')]=qs[_0xcbfe('0x2e')](_0x34b4d7[_0xcbfe('0x48')]['limit']);_0x32e26e[_0xcbfe('0x2c')]=qs['offset'](_0x34b4d7['query'][_0xcbfe('0x2c')]);}_0x32e26e['order']=qs[_0xcbfe('0x6e')](_0x34b4d7[_0xcbfe('0x48')][_0xcbfe('0x6e')]);_0x32e26e[_0xcbfe('0x50')]=qs[_0xcbfe('0x49')](_[_0xcbfe('0x68')](_0x34b4d7[_0xcbfe('0x48')],_0x3c1c1c[_0xcbfe('0x49')]));_0x32e26e[_0xcbfe('0x50')][_0xcbfe('0x62')]=_0x6176e2['id'];if(_0x34b4d7[_0xcbfe('0x48')][_0xcbfe('0x51')]){_0x32e26e[_0xcbfe('0x50')]=_['merge'](_0x32e26e[_0xcbfe('0x50')],{'$or':_[_0xcbfe('0x42')](_0x32e26e['attributes'],function(_0x4b7352){var _0x51beec={};_0x51beec[_0x4b7352]={'$like':'%'+_0x34b4d7[_0xcbfe('0x48')][_0xcbfe('0x51')]+'%'};return _0x51beec;})});}_0x32e26e=_[_0xcbfe('0x52')]({},_0x32e26e,_0x34b4d7['options']);return db[_0xcbfe('0x8b')][_0xcbfe('0x2f')]({'where':_0x32e26e[_0xcbfe('0x50')]})[_0xcbfe('0x36')](function(_0x245cea){_0x4ca823[_0xcbfe('0x2f')]=_0x245cea;if(_0x34b4d7[_0xcbfe('0x48')]['includeAll']){_0x32e26e[_0xcbfe('0x5d')]=[{'model':db[_0xcbfe('0x8e')],'as':_0xcbfe('0x8f'),'required':![]},{'model':db['User'],'as':_0xcbfe('0x90'),'attributes':[_0xcbfe('0x3a'),'fullname','internal'],'required':![]},{'model':db[_0xcbfe('0x91')],'as':'Tags','attributes':['id','name',_0xcbfe('0x92')],'where':_0x34b4d7[_0xcbfe('0x48')]['tag']?{'id':_0x34b4d7['query'][_0xcbfe('0x93')]}:undefined,'required':_0x34b4d7[_0xcbfe('0x48')][_0xcbfe('0x93')]?!![]:![]}];}return db[_0xcbfe('0x8b')][_0xcbfe('0x56')](_0x32e26e);})[_0xcbfe('0x36')](function(_0x2f8cc9){_0x4ca823[_0xcbfe('0x57')]=_0x2f8cc9;return _0x4ca823;});}})[_0xcbfe('0x36')](respondWithFilteredResult(_0x54b31c,_0x32e26e))['catch'](handleError(_0x54b31c,null));};exports['addApplications']=function(_0x547010,_0x43ae83,_0x546fd1){return db['MailAccount'][_0xcbfe('0x66')]({'where':{'id':_0x547010[_0xcbfe('0x5a')]['id']}})['then'](handleEntityNotFound(_0x43ae83,null))[_0xcbfe('0x36')](function(_0x41c499){if(_0x41c499){return db['sequelize'][_0xcbfe('0x94')](function(_0x503a7e){return db[_0xcbfe('0x95')][_0xcbfe('0x96')]({'where':{'MailAccountId':_0x547010['params']['id']},'transaction':_0x503a7e})[_0xcbfe('0x36')](function(_0x595f1c){var _0x16713e=_[_0xcbfe('0x42')](_0x547010[_0xcbfe('0x5f')],function(_0x491fd2){_0x491fd2[_0xcbfe('0x62')]=_0x547010[_0xcbfe('0x5a')]['id'];return _0x491fd2;});return db[_0xcbfe('0x95')][_0xcbfe('0x97')](_0x16713e,{'transaction':_0x503a7e});});})[_0xcbfe('0x36')](function(){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x547010['params']['id']},'order':_0xcbfe('0x98')});});}})['then'](respondWithResult(_0x43ae83,null))['catch'](handleError(_0x43ae83,null));};exports[_0xcbfe('0x99')]=function(_0x4b03e2,_0x23f08f,_0x37e5bb){var _0xf0cd77={};var _0x88b56e={};var _0x5ad7e6;var _0x88768b;return db[_0xcbfe('0x43')][_0xcbfe('0x66')]({'where':{'id':_0x4b03e2[_0xcbfe('0x5a')]['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0x23f08f,null))[_0xcbfe('0x36')](function(_0x2e45d0){if(_0x2e45d0){_0x5ad7e6=_0x2e45d0;_0x88b56e['model']=_[_0xcbfe('0x5c')](db[_0xcbfe('0x95')]['rawAttributes']);_0x88b56e[_0xcbfe('0x48')]=_[_0xcbfe('0x5c')](_0x4b03e2['query']);_0x88b56e[_0xcbfe('0x49')]=_[_0xcbfe('0x4a')](_0x88b56e[_0xcbfe('0x47')],_0x88b56e[_0xcbfe('0x48')]);_0xf0cd77[_0xcbfe('0x4b')]=_[_0xcbfe('0x4a')](_0x88b56e[_0xcbfe('0x47')],qs[_0xcbfe('0x4c')](_0x4b03e2[_0xcbfe('0x48')]['fields']));_0xf0cd77[_0xcbfe('0x4b')]=_0xf0cd77[_0xcbfe('0x4b')]['length']?_0xf0cd77[_0xcbfe('0x4b')]:_0x88b56e[_0xcbfe('0x47')];_0xf0cd77[_0xcbfe('0x67')]=qs[_0xcbfe('0x6e')](_0x4b03e2[_0xcbfe('0x48')][_0xcbfe('0x6e')]);_0xf0cd77[_0xcbfe('0x50')]=qs[_0xcbfe('0x49')](_['pick'](_0x4b03e2[_0xcbfe('0x48')],_0x88b56e[_0xcbfe('0x49')]));if(_0x4b03e2[_0xcbfe('0x48')][_0xcbfe('0x51')]){_0xf0cd77[_0xcbfe('0x50')]=_[_0xcbfe('0x52')](_0xf0cd77[_0xcbfe('0x50')],{'$or':_[_0xcbfe('0x42')](_0xf0cd77[_0xcbfe('0x4b')],function(_0x1ece42){var _0x42093c={};_0x42093c[_0x1ece42]={'$like':'%'+_0x4b03e2[_0xcbfe('0x48')][_0xcbfe('0x51')]+'%'};return _0x42093c;})});}_0xf0cd77=_['merge']({},_0xf0cd77,_0x4b03e2['options']);return _0x5ad7e6[_0xcbfe('0x99')](_0xf0cd77);}})[_0xcbfe('0x36')](function(_0x41281c){if(_0x41281c){_0x88768b=_0x41281c[_0xcbfe('0x4d')];if(!_0x4b03e2['query'][_0xcbfe('0x4e')](_0xcbfe('0x4f'))){_0xf0cd77[_0xcbfe('0x2e')]=qs[_0xcbfe('0x2e')](_0x4b03e2['query'][_0xcbfe('0x2e')]);_0xf0cd77[_0xcbfe('0x2c')]=qs['offset'](_0x4b03e2[_0xcbfe('0x48')][_0xcbfe('0x2c')]);}return _0x5ad7e6[_0xcbfe('0x99')](_0xf0cd77);}})[_0xcbfe('0x36')](function(_0x24aaa5){if(_0x24aaa5){return _0x24aaa5?{'count':_0x88768b,'rows':_0x24aaa5}:null;}})[_0xcbfe('0x36')](respondWithResult(_0x23f08f,null))[_0xcbfe('0x58')](handleError(_0x23f08f,null));};exports[_0xcbfe('0x9a')]=function(_0x2de4a4,_0xacbce5,_0x58387f){var _0x2a6ef4={'raw':!![],'where':{}};var _0x163949={};var _0x4ab0da={'count':0x0,'rows':[]};return db[_0xcbfe('0x43')][_0xcbfe('0x66')]({'where':{'id':_0x2de4a4[_0xcbfe('0x5a')]['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0xacbce5,null))['then'](function(_0x50c227){if(_0x50c227){_0x163949[_0xcbfe('0x47')]=_['keys'](db[_0xcbfe('0x9b')][_0xcbfe('0x44')]);_0x163949[_0xcbfe('0x48')]=_[_0xcbfe('0x5c')](_0x2de4a4['query']);_0x163949[_0xcbfe('0x49')]=_[_0xcbfe('0x4a')](_0x163949['model'],_0x163949['query']);_0x2a6ef4[_0xcbfe('0x4b')]=_[_0xcbfe('0x4a')](_0x163949[_0xcbfe('0x47')],qs[_0xcbfe('0x4c')](_0x2de4a4['query']['fields']));_0x2a6ef4[_0xcbfe('0x4b')]=_0x2a6ef4['attributes'][_0xcbfe('0x4d')]?_0x2a6ef4['attributes']:_0x163949[_0xcbfe('0x47')];if(!_0x2de4a4['query']['hasOwnProperty'](_0xcbfe('0x4f'))){_0x2a6ef4['limit']=qs[_0xcbfe('0x2e')](_0x2de4a4[_0xcbfe('0x48')]['limit']);_0x2a6ef4[_0xcbfe('0x2c')]=qs[_0xcbfe('0x2c')](_0x2de4a4['query'][_0xcbfe('0x2c')]);}_0x2a6ef4[_0xcbfe('0x67')]=qs['sort'](_0x2de4a4['query'][_0xcbfe('0x6e')]);_0x2a6ef4[_0xcbfe('0x50')]=qs[_0xcbfe('0x49')](_['pick'](_0x2de4a4[_0xcbfe('0x48')],_0x163949[_0xcbfe('0x49')]));_0x2a6ef4[_0xcbfe('0x50')]['MailAccountId']=_0x50c227['id'];if(_0x2de4a4['query']['filter']){_0x2a6ef4[_0xcbfe('0x50')]=_[_0xcbfe('0x52')](_0x2a6ef4[_0xcbfe('0x50')],{'$or':_[_0xcbfe('0x42')](_0x2a6ef4[_0xcbfe('0x4b')],function(_0x741981){var _0x505a97={};_0x505a97[_0x741981]={'$like':'%'+_0x2de4a4[_0xcbfe('0x48')]['filter']+'%'};return _0x505a97;})});}if(_0x2de4a4['query'][_0xcbfe('0x9c')]){var _0x5866a3=_0x2de4a4[_0xcbfe('0x48')][_0xcbfe('0x9c')][_0xcbfe('0x9d')](',');var _0x2ce547={};_0x2ce547[_0x5866a3[0x0]]={'$gte':moment(_0x5866a3[0x1])[_0xcbfe('0x9e')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2a6ef4['where']=_[_0xcbfe('0x52')](_0x2a6ef4[_0xcbfe('0x50')],_0x2ce547);}_0x2a6ef4=_[_0xcbfe('0x52')]({},_0x2a6ef4,_0x2de4a4[_0xcbfe('0x54')]);return db[_0xcbfe('0x9b')][_0xcbfe('0x2f')]({'where':_0x2a6ef4[_0xcbfe('0x50')]})['then'](function(_0x5b8f32){_0x4ab0da[_0xcbfe('0x2f')]=_0x5b8f32;if(_0x2de4a4[_0xcbfe('0x48')][_0xcbfe('0x55')]){_0x2a6ef4['include']=[{'all':!![]}];}return db[_0xcbfe('0x9b')][_0xcbfe('0x56')](_0x2a6ef4);})['then'](function(_0x346578){if(_0x2de4a4['query'][_0xcbfe('0x9f')]===_0xcbfe('0xa0')){for(var _0x12a9ad=0x0;_0x12a9ad<_0x346578['length'];_0x12a9ad++){_0x346578[_0x12a9ad][_0xcbfe('0x5f')]=juice(_0x346578[_0x12a9ad]['body']);}}_0x4ab0da[_0xcbfe('0x57')]=_0x346578;return _0x4ab0da;});}})[_0xcbfe('0x36')](respondWithFilteredResult(_0xacbce5,_0x2a6ef4))[_0xcbfe('0x58')](handleError(_0xacbce5,null));};exports['send']=function(_0x5282d4,_0x3891af,_0x303a1f){var _0x38cce6,_0x1c3bb5={},_0x544eac;if(_0x5282d4[_0xcbfe('0x5f')]['to']){_0x544eac=_0x5282d4[_0xcbfe('0x5f')]['to'][_0xcbfe('0x9d')](',')[0x0];}return db['MailAccount'][_0xcbfe('0x5e')]({'where':{'id':_0x5282d4[_0xcbfe('0x5a')]['id']},'include':[{'model':db[_0xcbfe('0xa1')],'as':'List','include':[{'model':db[_0xcbfe('0x8e')],'as':_0xcbfe('0xa2'),'where':{'email':_0x544eac},'limit':0x1,'order':[[_0xcbfe('0xa3'),_0xcbfe('0xa4')]]}]},{'model':db[_0xcbfe('0x3e')],'as':_0xcbfe('0x3f'),'raw':!![]}]})[_0xcbfe('0x36')](handleEntityNotFound(_0x3891af,null))['then'](function(_0x3d5739){if(_0x3d5739){_0x38cce6=_0x3d5739;if(_0x3d5739[_0xcbfe('0x3f')]){if(_[_0xcbfe('0x74')](_0x5282d4['body'][_0xcbfe('0xa5')])){_0x5282d4[_0xcbfe('0x5f')][_0xcbfe('0xa5')]=util[_0xcbfe('0x9e')](_0xcbfe('0xa6'),_0x3d5739[_0xcbfe('0x3a')],_0x3d5739[_0xcbfe('0xa7')]||_0x3d5739[_0xcbfe('0x3f')][_0xcbfe('0x76')]);}if(_0x5282d4[_0xcbfe('0x5f')][_0xcbfe('0xa8')]&&_0x5282d4[_0xcbfe('0x5f')]['attachments']['length']){for(var _0x399822=0x0;_0x399822<_0x5282d4['body'][_0xcbfe('0xa8')][_0xcbfe('0x4d')];_0x399822+=0x1){_0x5282d4[_0xcbfe('0x5f')][_0xcbfe('0xa8')][_0x399822]={'filename':_0x5282d4['body'][_0xcbfe('0xa8')][_0x399822]['name'],'path':path[_0xcbfe('0xa9')](config[_0xcbfe('0xaa')],'server/files/attachments',_0x5282d4[_0xcbfe('0x5f')][_0xcbfe('0xa8')][_0x399822]['basename'])};}}var _0x4a6fa3={'tls':{'rejectUnauthorized':![]}};if(_[_0xcbfe('0x74')](_0x3d5739[_0xcbfe('0x3f')][_0xcbfe('0x7e')])){if(_0x3d5739['Smtp'][_0xcbfe('0x7b')]){_0x4a6fa3['auth']={'user':_0x3d5739['Smtp']['user'],'pass':_0x3d5739[_0xcbfe('0x3f')][_0xcbfe('0x79')]};}_0x4a6fa3[_0xcbfe('0x7c')]=_0x3d5739[_0xcbfe('0x3f')][_0xcbfe('0x7c')];_0x4a6fa3[_0xcbfe('0x7d')]=_0x3d5739['Smtp'][_0xcbfe('0x7d')];_0x4a6fa3[_0xcbfe('0xab')]=_0x3d5739[_0xcbfe('0x3f')][_0xcbfe('0xab')];}else{_0x4a6fa3[_0xcbfe('0x7e')]=_0x3d5739['Smtp']['service'];_0x4a6fa3[_0xcbfe('0xac')]={'user':_0x3d5739[_0xcbfe('0x3f')]['user'],'pass':_0x3d5739['Smtp']['pass']};}return respondWithRpcPromise(_0xcbfe('0xad'),_0xcbfe('0xae'),{'account':_0x4a6fa3,'message':_0x5282d4[_0xcbfe('0x5f')]});}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x544753){if(_0x544753){_0x1c3bb5=_0x544753;if(_0x38cce6[_0xcbfe('0xaf')]){if(_0x38cce6[_0xcbfe('0xaf')]['Contacts'][_0xcbfe('0x4d')]){return _0x38cce6[_0xcbfe('0xaf')][_0xcbfe('0xa2')][0x0];}else{return db[_0xcbfe('0x8e')][_0xcbfe('0x64')](_[_0xcbfe('0xb0')](_0x5282d4['body'],{'firstName':_0x5282d4[_0xcbfe('0x5f')]['to'],'email':_0x5282d4[_0xcbfe('0x5f')]['to'],'phone':_0x5282d4[_0xcbfe('0x5f')]['to'],'ListId':_0x38cce6[_0xcbfe('0x71')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0xcbfe('0x36')](function(_0x81d360){if(_0x81d360){var _0x38bb0d={'UserId':_0x5282d4[_0xcbfe('0x76')]['id'],'ContactId':_0x81d360['id'],'MailAccountId':_0x38cce6['id'],'inReplyTo':_0x1c3bb5[_0xcbfe('0xb1')],'to':_0x5282d4[_0xcbfe('0x5f')][_0xcbfe('0xa5')],'cc':_0x5282d4[_0xcbfe('0x5f')]['cc'],'subject':_0x5282d4[_0xcbfe('0x5f')][_0xcbfe('0xb2')],'attach':_0x5282d4[_0xcbfe('0x5f')][_0xcbfe('0xb3')],'firstMsgDirection':'out','lastMsgAt':moment()['format'](_0xcbfe('0xb4')),'lastMsgDirection':_0xcbfe('0xb5'),'Messages':[_[_0xcbfe('0x52')](_0x5282d4['body'],{'messageId':_0x1c3bb5[_0xcbfe('0xb1')],'sentAt':moment()[_0xcbfe('0x9e')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x38cce6['id'],'UserId':_0x5282d4[_0xcbfe('0x76')]['id'],'ContactId':_0x81d360['id']})]};if(_0x5282d4[_0xcbfe('0x5f')][_0xcbfe('0xb6')]){_0x38bb0d=_['merge'](_0x38bb0d,_0x5282d4[_0xcbfe('0x5f')][_0xcbfe('0xb6')]);}return db[_0xcbfe('0x8b')][_0xcbfe('0x64')](_0x38bb0d,{'include':[{'model':db[_0xcbfe('0x9b')],'as':_0xcbfe('0xb7')}]});}})[_0xcbfe('0x36')](respondWithResult(_0x3891af,null))['catch'](handleError(_0x3891af,null));};exports['verifySmtp']=function(_0x1cf5ee,_0x58f589,_0x3c2140){return db['MailAccount'][_0xcbfe('0x5e')]({'where':{'id':_0x1cf5ee[_0xcbfe('0x5a')]['id']},'include':[{'model':db[_0xcbfe('0x3e')],'as':_0xcbfe('0x3f'),'raw':!![]}]})['then'](handleEntityNotFound(_0x58f589,null))[_0xcbfe('0x36')](function(_0x5c6368){if(_0x5c6368&&_0x5c6368[_0xcbfe('0x3f')]){var _0x4413d4={'id':_0x5c6368['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5c6368[_0xcbfe('0x3f')][_0xcbfe('0x7e')]){_0x4413d4[_0xcbfe('0x7e')]=_0x5c6368[_0xcbfe('0x3f')][_0xcbfe('0x7e')];}else{_0x4413d4[_0xcbfe('0x7c')]=_0x5c6368[_0xcbfe('0x3f')][_0xcbfe('0x7c')];_0x4413d4[_0xcbfe('0x7d')]=_0x5c6368['Smtp'][_0xcbfe('0x7d')];_0x4413d4[_0xcbfe('0xab')]=_0x5c6368['Smtp']['secure'];}if(_0x5c6368[_0xcbfe('0x3f')][_0xcbfe('0x7b')]){_0x4413d4[_0xcbfe('0xac')]={'user':_0x5c6368[_0xcbfe('0x3f')][_0xcbfe('0x76')],'pass':_0x5c6368[_0xcbfe('0x3f')][_0xcbfe('0x79')]};}return respondWithRpcPromise('VerifySmtp',_0xcbfe('0xb8'),{'account':_0x4413d4});}})[_0xcbfe('0x36')](respondWithResult(_0x58f589,null))[_0xcbfe('0x58')](handleError(_0x58f589,null));};exports[_0xcbfe('0x96')]=function(_0x3880c1,_0x589e6d){return db['MailAccount'][_0xcbfe('0x5e')]({'where':{'id':_0x3880c1['params']['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0x589e6d,null))['then'](function(_0x45d513){if(_0x45d513&&_0x45d513[_0xcbfe('0x7e')]){throw new db[(_0xcbfe('0xb9'))][(_0xcbfe('0xba'))](_0xcbfe('0xbb'));}return _0x45d513;})[_0xcbfe('0x36')](removeEntity(_0x589e6d,null))['catch'](handleError(_0x589e6d,null));};exports[_0xcbfe('0xbc')]=function(_0x3d374c,_0x463b5c,_0x350315){return db[_0xcbfe('0x43')]['find']({'where':{'id':_0x3d374c['params']['id']}})['then'](handleEntityNotFound(_0x463b5c,null))['then'](function(_0x3423ef){if(_0x3423ef){return _0x3423ef[_0xcbfe('0xbc')](_0x3d374c[_0xcbfe('0x5f')][_0xcbfe('0x6a')],_[_0xcbfe('0x8c')](_0x3d374c[_0xcbfe('0x5f')],[_0xcbfe('0x6a'),'id'])||{})[_0xcbfe('0xbd')](function(_0x39e8b4){for(var _0x34b0a5=0x0;_0x34b0a5<_0x3d374c[_0xcbfe('0x5f')][_0xcbfe('0x6a')][_0xcbfe('0x4d')];_0x34b0a5+=0x1){socket[_0xcbfe('0xbe')](_0xcbfe('0xbf'),{'UserId':Number(_0x3d374c['body']['ids'][_0x34b0a5]),'MailAccountId':Number(_0x3d374c[_0xcbfe('0x5a')]['id'])});}return _0x39e8b4;});}})[_0xcbfe('0x36')](respondWithResult(_0x463b5c,null))[_0xcbfe('0x58')](handleError(_0x463b5c,null));};exports[_0xcbfe('0xc0')]=function(_0x368405,_0x208283,_0x18a0ad){return db['MailAccount'][_0xcbfe('0x5e')]({'where':{'id':_0x368405[_0xcbfe('0x5a')]['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0x208283,null))[_0xcbfe('0x36')](function(_0x146b7f){if(_0x146b7f){return _0x146b7f[_0xcbfe('0xc0')](_0x368405[_0xcbfe('0x48')][_0xcbfe('0x6a')])[_0xcbfe('0x36')](function(){if(_[_0xcbfe('0xc1')](_0x368405[_0xcbfe('0x48')]['ids'])){for(var _0x536405=0x0;_0x536405<_0x368405[_0xcbfe('0x48')][_0xcbfe('0x6a')][_0xcbfe('0x4d')];_0x536405+=0x1){socket[_0xcbfe('0xbe')](_0xcbfe('0xc2'),{'UserId':Number(_0x368405[_0xcbfe('0x48')][_0xcbfe('0x6a')][_0x536405]),'MailAccountId':Number(_0x368405[_0xcbfe('0x5a')]['id'])});}}else{socket['emit']('userMailAccount:remove',{'UserId':Number(_0x368405['query'][_0xcbfe('0x6a')]),'MailAccountId':Number(_0x368405[_0xcbfe('0x5a')]['id'])});}});}})[_0xcbfe('0x36')](respondWithStatusCode(_0x208283,null))['catch'](handleError(_0x208283,null));};exports[_0xcbfe('0xc3')]=function(_0x234fe6,_0x47b539,_0x3a960d){var _0x213594={};var _0xa738cb={};var _0x14ccba;var _0x295f6d;return db[_0xcbfe('0x43')][_0xcbfe('0x66')]({'where':{'id':_0x234fe6[_0xcbfe('0x5a')]['id']}})[_0xcbfe('0x36')](handleEntityNotFound(_0x47b539,null))['then'](function(_0x3a42d8){if(_0x3a42d8){_0x14ccba=_0x3a42d8;_0xa738cb[_0xcbfe('0x47')]=_['keys'](db['User'][_0xcbfe('0x44')]);_0xa738cb[_0xcbfe('0x48')]=_[_0xcbfe('0x5c')](_0x234fe6[_0xcbfe('0x48')]);_0xa738cb[_0xcbfe('0x49')]=_[_0xcbfe('0x4a')](_0xa738cb[_0xcbfe('0x47')],_0xa738cb['query']);_0x213594[_0xcbfe('0x4b')]=_[_0xcbfe('0x4a')](_0xa738cb['model'],qs['fields'](_0x234fe6[_0xcbfe('0x48')]['fields']));_0x213594[_0xcbfe('0x4b')]=_0x213594[_0xcbfe('0x4b')]['length']?_0x213594[_0xcbfe('0x4b')]:_0xa738cb['model'];_0x213594[_0xcbfe('0x67')]=qs[_0xcbfe('0x6e')](_0x234fe6['query']['sort']);_0x213594['where']=qs[_0xcbfe('0x49')](_[_0xcbfe('0x68')](_0x234fe6[_0xcbfe('0x48')],_0xa738cb['filters']));if(_0x234fe6['query'][_0xcbfe('0x51')]){_0x213594[_0xcbfe('0x50')]=_[_0xcbfe('0x52')](_0x213594['where'],{'$or':_[_0xcbfe('0x42')](_0x213594['attributes'],function(_0x446d3b){var _0x39c9aa={};_0x39c9aa[_0x446d3b]={'$like':'%'+_0x234fe6[_0xcbfe('0x48')][_0xcbfe('0x51')]+'%'};return _0x39c9aa;})});}_0x213594=_[_0xcbfe('0x52')]({},_0x213594,_0x234fe6['options']);return _0x14ccba[_0xcbfe('0xc3')](_0x213594);}})['then'](function(_0x5c1ee3){if(_0x5c1ee3){_0x295f6d=_0x5c1ee3[_0xcbfe('0x4d')];if(!_0x234fe6['query'][_0xcbfe('0x4e')]('nolimit')){_0x213594['limit']=qs[_0xcbfe('0x2e')](_0x234fe6[_0xcbfe('0x48')]['limit']);_0x213594[_0xcbfe('0x2c')]=qs[_0xcbfe('0x2c')](_0x234fe6['query'][_0xcbfe('0x2c')]);}return _0x14ccba[_0xcbfe('0xc3')](_0x213594);}})['then'](function(_0x25bccf){if(_0x25bccf){return _0x25bccf?{'count':_0x295f6d,'rows':_0x25bccf}:null;}})[_0xcbfe('0x36')](respondWithResult(_0x47b539,null))['catch'](handleError(_0x47b539,null));};
\ No newline at end of file
+var _0x2b3b=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','html-to-text','juice','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','get','UserProfileResource','destroy','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','keys','body','params','describe','addDisposition','find','MailAccountId','create','findOne','Disposition','nolimit','order','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','active','description','isNil','cservice','cauthentication','user','cuser','password','pass','cpassword','authentication','host','port','service','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MailAccounts','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','omit','getInteractions','MailInteraction','CmContact','Contact','User','Owner','fullname','Tags','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','getMessages','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','CmList','Contacts','updatedAt','%s\x20<%s>','email','attachments','join','root','server/files/attachments','auth','secure','SendMail','List\x20not\x20found','List','ListId','from','subject','out','messageId','Interaction','Messages','verifySmtp','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','isArray','getAgents'];(function(_0x340823,_0x4e227f){var _0x456812=function(_0x2faa2c){while(--_0x2faa2c){_0x340823['push'](_0x340823['shift']());}};_0x456812(++_0x4e227f);}(_0x2b3b,0xc7));var _0xb2b3=function(_0x34d275,_0x5d84ee){_0x34d275=_0x34d275-0x0;var _0x1379cc=_0x2b3b[_0x34d275];return _0x1379cc;};'use strict';var emlformat=require(_0xb2b3('0x0'));var rimraf=require(_0xb2b3('0x1'));var zipdir=require(_0xb2b3('0x2'));var jsonpatch=require(_0xb2b3('0x3'));var rp=require(_0xb2b3('0x4'));var moment=require(_0xb2b3('0x5'));var BPromise=require(_0xb2b3('0x6'));var Mustache=require(_0xb2b3('0x7'));var util=require('util');var path=require(_0xb2b3('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb2b3('0x9'));var fs=require('fs');var fs_extra=require(_0xb2b3('0xa'));var _=require(_0xb2b3('0xb'));var squel=require(_0xb2b3('0xc'));var crypto=require(_0xb2b3('0xd'));var jsforce=require(_0xb2b3('0xe'));var deskjs=require(_0xb2b3('0xf'));var toCsv=require(_0xb2b3('0x10'));var querystring=require('querystring');var Papa=require(_0xb2b3('0x11'));var htmlToText=require(_0xb2b3('0x12'));var juice=require(_0xb2b3('0x13'));var Redis=require('ioredis');var authService=require(_0xb2b3('0x14'));var qs=require(_0xb2b3('0x15'));var as=require(_0xb2b3('0x16'));var hardwareService=require(_0xb2b3('0x17'));var logger=require('../../config/logger')(_0xb2b3('0x18'));var utils=require('../../config/utils');var config=require(_0xb2b3('0x19'));var licenseUtil=require(_0xb2b3('0x1a'));var db=require('../../mysqldb')['db'];config[_0xb2b3('0x1b')]=_[_0xb2b3('0x1c')](config[_0xb2b3('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0xb2b3('0x1d'))(new Redis(config[_0xb2b3('0x1b')]));require(_0xb2b3('0x1e'))[_0xb2b3('0x1f')](socket);var jayson=require(_0xb2b3('0x20'));var client=jayson[_0xb2b3('0x21')][_0xb2b3('0x22')]({'port':0x232b});function respondWithRpcPromise(_0x58edeb,_0x57d241,_0x3b232b,_0x3635f9){return new BPromise(function(_0x372e5e,_0x14d061){var _0x491cd1=_0x3635f9||client;return _0x491cd1[_0xb2b3('0x23')](_0x58edeb,_0x3b232b)[_0xb2b3('0x24')](function(_0x220fab){logger[_0xb2b3('0x25')](_0xb2b3('0x26'),_0x57d241,_0xb2b3('0x27'));logger['debug'](_0xb2b3('0x28'),_0x57d241,_0xb2b3('0x27'),JSON['stringify'](_0x220fab));if(_0x220fab[_0xb2b3('0x29')]){if(_0x220fab[_0xb2b3('0x29')][_0xb2b3('0x2a')]===0x1f4){logger[_0xb2b3('0x29')](_0xb2b3('0x26'),_0x57d241,_0x220fab['error']['message']);return _0x14d061(_0x220fab[_0xb2b3('0x29')][_0xb2b3('0x2b')]);}logger[_0xb2b3('0x29')](_0xb2b3('0x26'),_0x57d241,_0x220fab[_0xb2b3('0x29')][_0xb2b3('0x2b')]);return _0x372e5e(_0x220fab[_0xb2b3('0x29')]['message']);}else{logger[_0xb2b3('0x25')](_0xb2b3('0x26'),_0x57d241,_0xb2b3('0x27'));_0x372e5e(_0x220fab[_0xb2b3('0x2c')][_0xb2b3('0x2b')]);}})[_0xb2b3('0x2d')](function(_0x3212c7){logger['error'](_0xb2b3('0x26'),_0x57d241,_0x3212c7);_0x14d061(_0x3212c7);});});}function respondWithStatusCode(_0x563d98,_0x59db19){_0x59db19=_0x59db19||0xcc;return function(_0x316721){if(_0x316721){return _0x563d98[_0xb2b3('0x2e')](_0x59db19);}return _0x563d98[_0xb2b3('0x2f')](_0x59db19)['end']();};}function respondWithResult(_0x4c0030,_0x19f184){_0x19f184=_0x19f184||0xc8;return function(_0x3cd7de){if(_0x3cd7de){return _0x4c0030['status'](_0x19f184)[_0xb2b3('0x30')](_0x3cd7de);}};}function respondWithFilteredResult(_0x88fa79,_0x3faff3){return function(_0x8b0590){if(_0x8b0590){var _0x292739=typeof _0x3faff3[_0xb2b3('0x31')]==='undefined'&&typeof _0x3faff3[_0xb2b3('0x32')]===_0xb2b3('0x33');var _0x32881a=_0x8b0590['count'];var _0x450c91=_0x292739?0x0:_0x3faff3[_0xb2b3('0x31')];var _0x3211a1=_0x292739?_0x8b0590[_0xb2b3('0x34')]:_0x3faff3[_0xb2b3('0x31')]+_0x3faff3[_0xb2b3('0x32')];var _0x5c99f5;if(_0x3211a1>=_0x32881a){_0x3211a1=_0x32881a;_0x5c99f5=0xc8;}else{_0x5c99f5=0xce;}_0x88fa79[_0xb2b3('0x2f')](_0x5c99f5);return _0x88fa79[_0xb2b3('0x35')](_0xb2b3('0x36'),_0x450c91+'-'+_0x3211a1+'/'+_0x32881a)[_0xb2b3('0x30')](_0x8b0590);}return null;};}function patchUpdates(_0x24db5a){return function(_0x27c08b){try{jsonpatch[_0xb2b3('0x37')](_0x27c08b,_0x24db5a,!![]);}catch(_0x4233b1){return BPromise[_0xb2b3('0x38')](_0x4233b1);}return _0x27c08b[_0xb2b3('0x39')]();};}function saveUpdates(_0x16c2d2,_0x19fac5){return function(_0x28908a){if(_0x28908a){return _0x28908a[_0xb2b3('0x3a')](_0x16c2d2)[_0xb2b3('0x24')](function(_0x20a696){return _0x20a696;});}return null;};}function removeEntity(_0x49aa96,_0x3e4feb){return function(_0x2dd69c){if(_0x2dd69c){return _0x2dd69c['destroy']()['then'](function(){var _0x3f3410=_0x2dd69c[_0xb2b3('0x3b')]({'plain':!![]});var _0x22659c='MailAccounts';return db[_0xb2b3('0x3c')][_0xb2b3('0x3d')]({'where':{'type':_0x22659c,'resourceId':_0x3f3410['id']}})[_0xb2b3('0x24')](function(){return _0x2dd69c;});})[_0xb2b3('0x24')](function(){_0x49aa96[_0xb2b3('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x756909,_0x27f4a8){return function(_0x588d47){if(!_0x588d47){_0x756909[_0xb2b3('0x2e')](0x194);}return _0x588d47;};}function handleError(_0x1db625,_0x2ff0d2){_0x2ff0d2=_0x2ff0d2||0x1f4;return function(_0x1be241){logger[_0xb2b3('0x29')](_0x1be241[_0xb2b3('0x3e')]);if(_0x1be241['name']){delete _0x1be241[_0xb2b3('0x3f')];}_0x1db625[_0xb2b3('0x2f')](_0x2ff0d2)[_0xb2b3('0x40')](_0x1be241);};}exports[_0xb2b3('0x41')]=function(_0x125760,_0x769968){var _0x3137ec={'include':[{'model':db[_0xb2b3('0x42')],'as':_0xb2b3('0x43')},{'model':db[_0xb2b3('0x44')],'as':_0xb2b3('0x45')},{'model':db[_0xb2b3('0x46')],'as':_0xb2b3('0x47')}]},_0xb32c89={},_0x2dd2f0={'count':0x0,'rows':[]};var _0x19cb08=_['map'](db[_0xb2b3('0x48')][_0xb2b3('0x49')],function(_0x243652){return{'name':_0x243652[_0xb2b3('0x4a')],'type':_0x243652['type']['key']};});_0xb32c89[_0xb2b3('0x4b')]=_[_0xb2b3('0x4c')](_0x19cb08,_0xb2b3('0x3f'));_0xb32c89[_0xb2b3('0x4d')]=_['keys'](_0x125760[_0xb2b3('0x4d')]);_0xb32c89[_0xb2b3('0x4e')]=_[_0xb2b3('0x4f')](_0xb32c89['model'],_0xb32c89[_0xb2b3('0x4d')]);_0x3137ec[_0xb2b3('0x50')]=_[_0xb2b3('0x4f')](_0xb32c89[_0xb2b3('0x4b')],qs[_0xb2b3('0x51')](_0x125760[_0xb2b3('0x4d')][_0xb2b3('0x51')]));_0x3137ec[_0xb2b3('0x50')]=_0x3137ec[_0xb2b3('0x50')][_0xb2b3('0x52')]?_0x3137ec[_0xb2b3('0x50')]:_0xb32c89[_0xb2b3('0x4b')];if(!_0x125760[_0xb2b3('0x4d')][_0xb2b3('0x53')]('nolimit')){_0x3137ec['limit']=qs[_0xb2b3('0x32')](_0x125760[_0xb2b3('0x4d')][_0xb2b3('0x32')]);_0x3137ec[_0xb2b3('0x31')]=qs[_0xb2b3('0x31')](_0x125760[_0xb2b3('0x4d')][_0xb2b3('0x31')]);}_0x3137ec['order']=qs[_0xb2b3('0x54')](_0x125760[_0xb2b3('0x4d')]['sort']);_0x3137ec[_0xb2b3('0x55')]=qs[_0xb2b3('0x4e')](_[_0xb2b3('0x56')](_0x125760[_0xb2b3('0x4d')],_0xb32c89[_0xb2b3('0x4e')]),_0x19cb08);if(_0x125760['query'][_0xb2b3('0x57')]){_0x3137ec[_0xb2b3('0x55')]=_[_0xb2b3('0x58')](_0x3137ec[_0xb2b3('0x55')],{'$or':_[_0xb2b3('0x4c')](_0x19cb08,function(_0x18c76e){if(_0x18c76e[_0xb2b3('0x59')]!==_0xb2b3('0x5a')){var _0x193e87={};_0x193e87[_0x18c76e['name']]={'$like':'%'+_0x125760[_0xb2b3('0x4d')][_0xb2b3('0x57')]+'%'};return _0x193e87;}})});}_0x3137ec=_[_0xb2b3('0x58')]({},_0x3137ec,_0x125760[_0xb2b3('0x5b')]);var _0x433c39={'where':_0x3137ec[_0xb2b3('0x55')]};return db[_0xb2b3('0x48')][_0xb2b3('0x34')](_0x433c39)[_0xb2b3('0x24')](function(_0x11eecc){_0x2dd2f0['count']=_0x11eecc;if(_0x125760['query'][_0xb2b3('0x5c')]){_0x3137ec[_0xb2b3('0x5d')]=[{'all':!![]}];}return db[_0xb2b3('0x48')][_0xb2b3('0x5e')](_0x3137ec);})[_0xb2b3('0x24')](function(_0x10046f){_0x2dd2f0[_0xb2b3('0x5f')]=_0x10046f;return _0x2dd2f0;})[_0xb2b3('0x24')](respondWithFilteredResult(_0x769968,_0x3137ec))['catch'](handleError(_0x769968,null));};exports[_0xb2b3('0x60')]=function(_0x541828,_0x58dfbf){var _0xbb702d={'raw':![],'where':{'id':_0x541828['params']['id']},'include':[{'model':db[_0xb2b3('0x42')],'as':_0xb2b3('0x43')},{'model':db['MailServerOut'],'as':_0xb2b3('0x45')},{'model':db[_0xb2b3('0x46')],'as':_0xb2b3('0x47')}]},_0x89022c={};_0x89022c[_0xb2b3('0x4b')]=_[_0xb2b3('0x61')](db['MailAccount'][_0xb2b3('0x49')]);_0x89022c[_0xb2b3('0x4d')]=_[_0xb2b3('0x61')](_0x541828['query']);_0x89022c[_0xb2b3('0x4e')]=_[_0xb2b3('0x4f')](_0x89022c[_0xb2b3('0x4b')],_0x89022c['query']);_0xbb702d[_0xb2b3('0x50')]=_[_0xb2b3('0x4f')](_0x89022c[_0xb2b3('0x4b')],qs[_0xb2b3('0x51')](_0x541828[_0xb2b3('0x4d')][_0xb2b3('0x51')]));_0xbb702d['attributes']=_0xbb702d[_0xb2b3('0x50')][_0xb2b3('0x52')]?_0xbb702d['attributes']:_0x89022c[_0xb2b3('0x4b')];if(_0x541828['query']['includeAll']){_0xbb702d[_0xb2b3('0x5d')]=[{'all':!![]}];}_0xbb702d=_[_0xb2b3('0x58')]({},_0xbb702d,_0x541828[_0xb2b3('0x5b')]);return db[_0xb2b3('0x48')]['find'](_0xbb702d)['then'](handleEntityNotFound(_0x58dfbf,null))['then'](respondWithResult(_0x58dfbf,null))[_0xb2b3('0x2d')](handleError(_0x58dfbf,null));};exports['update']=function(_0x2c3b3f,_0x132338){if(_0x2c3b3f[_0xb2b3('0x62')]['id']){delete _0x2c3b3f[_0xb2b3('0x62')]['id'];}return db[_0xb2b3('0x48')]['find']({'where':{'id':_0x2c3b3f[_0xb2b3('0x63')]['id']},'include':[{'model':db[_0xb2b3('0x42')],'as':_0xb2b3('0x43')},{'model':db[_0xb2b3('0x44')],'as':_0xb2b3('0x45')},{'model':db[_0xb2b3('0x46')],'as':'mandatoryDispositionPause'}]})[_0xb2b3('0x24')](handleEntityNotFound(_0x132338,null))[_0xb2b3('0x24')](saveUpdates(_0x2c3b3f[_0xb2b3('0x62')],null))[_0xb2b3('0x24')](function(_0x178ce4){if(_0x178ce4&&_0x2c3b3f[_0xb2b3('0x62')][_0xb2b3('0x43')]){return db[_0xb2b3('0x42')][_0xb2b3('0x3a')](_0x2c3b3f[_0xb2b3('0x62')][_0xb2b3('0x43')],{'where':{'MailAccountId':_0x178ce4['id']}})['then'](function(){return _0x178ce4;});}return _0x178ce4;})[_0xb2b3('0x24')](function(_0x43bcc0){if(_0x43bcc0&&_0x2c3b3f[_0xb2b3('0x62')][_0xb2b3('0x45')]){return db['MailServerOut'][_0xb2b3('0x3a')](_0x2c3b3f[_0xb2b3('0x62')][_0xb2b3('0x45')],{'where':{'MailAccountId':_0x43bcc0['id']}})[_0xb2b3('0x24')](function(){return _0x43bcc0;});}return _0x43bcc0;})['then'](respondWithResult(_0x132338,null))[_0xb2b3('0x2d')](handleError(_0x132338,null));};exports['describe']=function(_0x55c1e9,_0x3854b9){return db[_0xb2b3('0x48')][_0xb2b3('0x64')]()['then'](respondWithResult(_0x3854b9,null))[_0xb2b3('0x2d')](handleError(_0x3854b9,null));};exports[_0xb2b3('0x65')]=function(_0x5e9176,_0x34b5a8,_0x57c837){if(_0x5e9176[_0xb2b3('0x62')]['id']){delete _0x5e9176[_0xb2b3('0x62')]['id'];}return db[_0xb2b3('0x48')][_0xb2b3('0x66')]({'where':{'id':_0x5e9176['params']['id']}})['then'](handleEntityNotFound(_0x34b5a8,null))[_0xb2b3('0x24')](function(_0x4b8a88){if(_0x4b8a88){_0x5e9176[_0xb2b3('0x62')][_0xb2b3('0x67')]=_0x4b8a88['id'];return db['Disposition'][_0xb2b3('0x68')](_0x5e9176[_0xb2b3('0x62')]);}})[_0xb2b3('0x24')](respondWithResult(_0x34b5a8,null))[_0xb2b3('0x2d')](handleError(_0x34b5a8,null));};exports['getDispositions']=function(_0x386107,_0x1b3e1c,_0x332211){var _0x1fe682={'raw':![],'where':{}};var _0x262e60={};var _0x9f11d0={'count':0x0,'rows':[]};return db[_0xb2b3('0x48')][_0xb2b3('0x69')]({'where':{'id':_0x386107[_0xb2b3('0x63')]['id']}})[_0xb2b3('0x24')](handleEntityNotFound(_0x1b3e1c,null))[_0xb2b3('0x24')](function(_0x14f66e){if(_0x14f66e){_0x262e60['model']=_[_0xb2b3('0x61')](db[_0xb2b3('0x6a')][_0xb2b3('0x49')]);_0x262e60[_0xb2b3('0x4d')]=_[_0xb2b3('0x61')](_0x386107['query']);_0x262e60[_0xb2b3('0x4e')]=_['intersection'](_0x262e60[_0xb2b3('0x4b')],_0x262e60['query']);_0x1fe682[_0xb2b3('0x50')]=_[_0xb2b3('0x4f')](_0x262e60[_0xb2b3('0x4b')],qs[_0xb2b3('0x51')](_0x386107[_0xb2b3('0x4d')][_0xb2b3('0x51')]));_0x1fe682['attributes']=_0x1fe682[_0xb2b3('0x50')][_0xb2b3('0x52')]?_0x1fe682[_0xb2b3('0x50')]:_0x262e60[_0xb2b3('0x4b')];if(!_0x386107[_0xb2b3('0x4d')][_0xb2b3('0x53')](_0xb2b3('0x6b'))){_0x1fe682[_0xb2b3('0x32')]=qs[_0xb2b3('0x32')](_0x386107['query'][_0xb2b3('0x32')]);_0x1fe682[_0xb2b3('0x31')]=qs[_0xb2b3('0x31')](_0x386107[_0xb2b3('0x4d')][_0xb2b3('0x31')]);}_0x1fe682[_0xb2b3('0x6c')]=qs[_0xb2b3('0x54')](_0x386107[_0xb2b3('0x4d')][_0xb2b3('0x54')]);_0x1fe682[_0xb2b3('0x55')]=qs['filters'](_['pick'](_0x386107[_0xb2b3('0x4d')],_0x262e60[_0xb2b3('0x4e')]));_0x1fe682[_0xb2b3('0x55')][_0xb2b3('0x67')]=_0x14f66e['id'];if(_0x386107['query'][_0xb2b3('0x57')]){_0x1fe682[_0xb2b3('0x55')]=_['merge'](_0x1fe682['where'],{'$or':_[_0xb2b3('0x4c')](_0x1fe682[_0xb2b3('0x50')],function(_0x5b5437){var _0x11da49={};_0x11da49[_0x5b5437]={'$like':'%'+_0x386107[_0xb2b3('0x4d')][_0xb2b3('0x57')]+'%'};return _0x11da49;})});}_0x1fe682=_['merge']({},_0x1fe682,_0x386107[_0xb2b3('0x5b')]);return db[_0xb2b3('0x6a')][_0xb2b3('0x34')]({'where':_0x1fe682['where']})[_0xb2b3('0x24')](function(_0x97e531){_0x9f11d0['count']=_0x97e531;if(_0x386107[_0xb2b3('0x4d')][_0xb2b3('0x5c')]){_0x1fe682[_0xb2b3('0x5d')]=[{'all':!![]}];}return db[_0xb2b3('0x6a')][_0xb2b3('0x5e')](_0x1fe682);})[_0xb2b3('0x24')](function(_0x532c24){_0x9f11d0['rows']=_0x532c24;return _0x9f11d0;});}})['then'](respondWithFilteredResult(_0x1b3e1c,_0x1fe682))[_0xb2b3('0x2d')](handleError(_0x1b3e1c,null));};exports[_0xb2b3('0x6d')]=function(_0x3983ae,_0x3091b1,_0x5e46b8){return db[_0xb2b3('0x48')][_0xb2b3('0x66')]({'where':{'id':_0x3983ae[_0xb2b3('0x63')]['id']}})[_0xb2b3('0x24')](handleEntityNotFound(_0x3091b1,null))[_0xb2b3('0x24')](function(_0x465d6e){if(_0x465d6e){return _0x465d6e[_0xb2b3('0x6d')](_0x3983ae['query'][_0xb2b3('0x6e')]);}})[_0xb2b3('0x24')](respondWithStatusCode(_0x3091b1,null))['catch'](handleError(_0x3091b1,null));};exports[_0xb2b3('0x6f')]=function(_0x5f3036,_0x136adb,_0x4459cb){if(_0x5f3036[_0xb2b3('0x62')]['id']){delete _0x5f3036[_0xb2b3('0x62')]['id'];}return db[_0xb2b3('0x48')][_0xb2b3('0x66')]({'where':{'id':_0x5f3036['params']['id']}})['then'](handleEntityNotFound(_0x136adb,null))['then'](function(_0x12c04f){if(_0x12c04f){_0x5f3036['body'][_0xb2b3('0x67')]=_0x12c04f['id'];return db[_0xb2b3('0x70')]['create'](_0x5f3036[_0xb2b3('0x62')]);}})['then'](respondWithResult(_0x136adb,null))[_0xb2b3('0x2d')](handleError(_0x136adb,null));};exports['getAnswers']=function(_0x435feb,_0x24908d,_0x54ccb3){var _0xee29c9={'raw':![],'where':{}};var _0x272ecf={};var _0xf31440={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x435feb[_0xb2b3('0x63')]['id']}})[_0xb2b3('0x24')](handleEntityNotFound(_0x24908d,null))[_0xb2b3('0x24')](function(_0x476a81){if(_0x476a81){_0x272ecf[_0xb2b3('0x4b')]=_[_0xb2b3('0x61')](db[_0xb2b3('0x70')][_0xb2b3('0x49')]);_0x272ecf[_0xb2b3('0x4d')]=_[_0xb2b3('0x61')](_0x435feb[_0xb2b3('0x4d')]);_0x272ecf[_0xb2b3('0x4e')]=_['intersection'](_0x272ecf['model'],_0x272ecf[_0xb2b3('0x4d')]);_0xee29c9['attributes']=_[_0xb2b3('0x4f')](_0x272ecf[_0xb2b3('0x4b')],qs[_0xb2b3('0x51')](_0x435feb[_0xb2b3('0x4d')][_0xb2b3('0x51')]));_0xee29c9[_0xb2b3('0x50')]=_0xee29c9[_0xb2b3('0x50')]['length']?_0xee29c9[_0xb2b3('0x50')]:_0x272ecf['model'];if(!_0x435feb[_0xb2b3('0x4d')][_0xb2b3('0x53')](_0xb2b3('0x6b'))){_0xee29c9[_0xb2b3('0x32')]=qs['limit'](_0x435feb[_0xb2b3('0x4d')][_0xb2b3('0x32')]);_0xee29c9[_0xb2b3('0x31')]=qs[_0xb2b3('0x31')](_0x435feb[_0xb2b3('0x4d')][_0xb2b3('0x31')]);}_0xee29c9[_0xb2b3('0x6c')]=qs[_0xb2b3('0x54')](_0x435feb['query']['sort']);_0xee29c9[_0xb2b3('0x55')]=qs[_0xb2b3('0x4e')](_[_0xb2b3('0x56')](_0x435feb[_0xb2b3('0x4d')],_0x272ecf[_0xb2b3('0x4e')]));_0xee29c9[_0xb2b3('0x55')][_0xb2b3('0x67')]=_0x476a81['id'];if(_0x435feb[_0xb2b3('0x4d')][_0xb2b3('0x57')]){_0xee29c9[_0xb2b3('0x55')]=_[_0xb2b3('0x58')](_0xee29c9[_0xb2b3('0x55')],{'$or':_[_0xb2b3('0x4c')](_0xee29c9[_0xb2b3('0x50')],function(_0xee308c){var _0x29bca1={};_0x29bca1[_0xee308c]={'$like':'%'+_0x435feb[_0xb2b3('0x4d')]['filter']+'%'};return _0x29bca1;})});}_0xee29c9=_[_0xb2b3('0x58')]({},_0xee29c9,_0x435feb[_0xb2b3('0x5b')]);return db[_0xb2b3('0x70')][_0xb2b3('0x34')]({'where':_0xee29c9[_0xb2b3('0x55')]})[_0xb2b3('0x24')](function(_0x387167){_0xf31440['count']=_0x387167;if(_0x435feb[_0xb2b3('0x4d')]['includeAll']){_0xee29c9[_0xb2b3('0x5d')]=[{'all':!![]}];}return db[_0xb2b3('0x70')][_0xb2b3('0x5e')](_0xee29c9);})['then'](function(_0x15cd74){_0xf31440[_0xb2b3('0x5f')]=_0x15cd74;return _0xf31440;});}})[_0xb2b3('0x24')](respondWithFilteredResult(_0x24908d,_0xee29c9))[_0xb2b3('0x2d')](handleError(_0x24908d,null));};exports[_0xb2b3('0x71')]=function(_0x5abb07,_0x24feda,_0x10a1b2){return db[_0xb2b3('0x48')][_0xb2b3('0x66')]({'where':{'id':_0x5abb07[_0xb2b3('0x63')]['id']}})['then'](handleEntityNotFound(_0x24feda,null))[_0xb2b3('0x24')](function(_0x134eed){if(_0x134eed){return _0x134eed['removeAnswers'](_0x5abb07[_0xb2b3('0x4d')]['ids']);}})['then'](respondWithStatusCode(_0x24feda,null))[_0xb2b3('0x2d')](handleError(_0x24feda,null));};exports['create']=function(_0x10c013,_0x27bbab){var _0x3ab633={'name':_0x10c013['body']['name'],'key':_0x10c013[_0xb2b3('0x62')]['key'],'email':_0x10c013[_0xb2b3('0x62')]['email'],'ListId':_0x10c013[_0xb2b3('0x62')]['ListId'],'active':!_['isNil'](_0x10c013[_0xb2b3('0x62')]['active'])?_0x10c013[_0xb2b3('0x62')][_0xb2b3('0x72')]:!![],'description':_0x10c013[_0xb2b3('0x62')][_0xb2b3('0x73')]||null,'Imap':{},'Smtp':{}};if(_[_0xb2b3('0x74')](_0x10c013[_0xb2b3('0x62')][_0xb2b3('0x75')])){if(_0x10c013[_0xb2b3('0x62')][_0xb2b3('0x76')]){_0x3ab633[_0xb2b3('0x43')]['user']=_0x3ab633[_0xb2b3('0x45')][_0xb2b3('0x77')]=_0x10c013[_0xb2b3('0x62')][_0xb2b3('0x78')];_0x3ab633[_0xb2b3('0x43')][_0xb2b3('0x79')]=_0x3ab633[_0xb2b3('0x45')][_0xb2b3('0x7a')]=_0x10c013[_0xb2b3('0x62')][_0xb2b3('0x7b')];}else{_0x3ab633[_0xb2b3('0x43')][_0xb2b3('0x7c')]=_0x3ab633[_0xb2b3('0x45')][_0xb2b3('0x7c')]=![];}_0x3ab633['Imap'][_0xb2b3('0x7d')]=_0x10c013[_0xb2b3('0x62')]['Imap']['host'];_0x3ab633[_0xb2b3('0x43')][_0xb2b3('0x7e')]=_0x10c013[_0xb2b3('0x62')][_0xb2b3('0x43')][_0xb2b3('0x7e')];_0x3ab633['Smtp'][_0xb2b3('0x7d')]=_0x10c013[_0xb2b3('0x62')]['Smtp']['host'];_0x3ab633['Smtp'][_0xb2b3('0x7e')]=_0x10c013[_0xb2b3('0x62')][_0xb2b3('0x45')][_0xb2b3('0x7e')];}else{_0x3ab633[_0xb2b3('0x43')][_0xb2b3('0x7f')]=_0x3ab633[_0xb2b3('0x45')]['service']=_0x10c013[_0xb2b3('0x62')]['cservice'];_0x3ab633[_0xb2b3('0x43')][_0xb2b3('0x77')]=_0x3ab633[_0xb2b3('0x45')][_0xb2b3('0x77')]=_0x10c013[_0xb2b3('0x62')][_0xb2b3('0x78')];_0x3ab633[_0xb2b3('0x43')][_0xb2b3('0x79')]=_0x3ab633['Smtp'][_0xb2b3('0x7a')]=_0x10c013['body']['cpassword'];}return db['MailAccount'][_0xb2b3('0x68')](_0x3ab633,{'include':[{'model':db[_0xb2b3('0x44')],'as':_0xb2b3('0x45')},{'model':db[_0xb2b3('0x42')],'as':_0xb2b3('0x43')}]})[_0xb2b3('0x24')](function(_0x137009){var _0x1d65d5=_0x10c013['user']['get']({'plain':!![]});if(!_0x1d65d5)throw new Error(_0xb2b3('0x80'));if(_0x1d65d5[_0xb2b3('0x81')]===_0xb2b3('0x77')){var _0x179ae0=_0x137009[_0xb2b3('0x3b')]({'plain':!![]});return db[_0xb2b3('0x82')][_0xb2b3('0x66')]({'where':{'name':_0xb2b3('0x83'),'userProfileId':_0x1d65d5[_0xb2b3('0x84')]},'raw':!![]})[_0xb2b3('0x24')](function(_0x5dcb95){if(_0x5dcb95&&_0x5dcb95['autoAssociation']===0x0){return db['UserProfileResource'][_0xb2b3('0x68')]({'name':_0x179ae0[_0xb2b3('0x3f')],'resourceId':_0x179ae0['id'],'type':_0x5dcb95['name'],'sectionId':_0x5dcb95['id']},{})[_0xb2b3('0x24')](function(){return _0x137009;});}else{return _0x137009;}})[_0xb2b3('0x2d')](function(_0x42177b){logger[_0xb2b3('0x29')](_0xb2b3('0x85'),_0x42177b);throw _0x42177b;});}return _0x137009;})[_0xb2b3('0x24')](respondWithResult(_0x27bbab,0xc9))[_0xb2b3('0x2d')](handleError(_0x27bbab,null));};exports[_0xb2b3('0x86')]=function(_0x9ce9fb,_0xfe9e16,_0x21dcc6){return db[_0xb2b3('0x48')][_0xb2b3('0x69')]({'where':{'id':_0x9ce9fb[_0xb2b3('0x63')]['id']}})[_0xb2b3('0x24')](handleEntityNotFound(_0xfe9e16,null))[_0xb2b3('0x24')](function(_0x44289d){if(_0x44289d){return _0x44289d[_0xb2b3('0x86')]();}return null;})[_0xb2b3('0x24')](respondWithResult(_0xfe9e16,null))[_0xb2b3('0x2d')](handleError(_0xfe9e16,null));};exports[_0xb2b3('0x87')]=function(_0xc2a823,_0x96f363,_0x3106a3){if(_0xc2a823['body']['id']){delete _0xc2a823[_0xb2b3('0x62')]['id'];}return db[_0xb2b3('0x48')][_0xb2b3('0x66')]({'where':{'id':_0xc2a823[_0xb2b3('0x63')]['id']}})[_0xb2b3('0x24')](handleEntityNotFound(_0x96f363,null))[_0xb2b3('0x24')](function(_0x360000){if(_0x360000){_0xc2a823[_0xb2b3('0x62')][_0xb2b3('0x67')]=_0x360000['id'];return db[_0xb2b3('0x42')]['create'](_0xc2a823[_0xb2b3('0x62')]);}})[_0xb2b3('0x24')](respondWithResult(_0x96f363,null))['catch'](handleError(_0x96f363,null));};exports[_0xb2b3('0x88')]=function(_0x1bfb37,_0x50c24e,_0x1e6233){return db[_0xb2b3('0x48')]['findOne']({'where':{'id':_0x1bfb37[_0xb2b3('0x63')]['id']}})[_0xb2b3('0x24')](handleEntityNotFound(_0x50c24e,null))['then'](function(_0x2f8aa0){if(_0x2f8aa0){return _0x2f8aa0[_0xb2b3('0x89')](null);}return null;})['then'](respondWithStatusCode(_0x50c24e,null))[_0xb2b3('0x2d')](handleError(_0x50c24e,null));};exports[_0xb2b3('0x8a')]=function(_0x1ed8e7,_0x48fe3c,_0x330c87){return db['MailAccount']['findOne']({'where':{'id':_0x1ed8e7['params']['id']}})[_0xb2b3('0x24')](handleEntityNotFound(_0x48fe3c,null))[_0xb2b3('0x24')](function(_0x23e773){if(_0x23e773){return _0x23e773[_0xb2b3('0x8a')]();}return null;})[_0xb2b3('0x24')](respondWithResult(_0x48fe3c,null))[_0xb2b3('0x2d')](handleError(_0x48fe3c,null));};exports[_0xb2b3('0x8b')]=function(_0x2ec77c,_0x3b8ffa,_0x1e9e63){if(_0x2ec77c[_0xb2b3('0x62')]['id']){delete _0x2ec77c[_0xb2b3('0x62')]['id'];}return db[_0xb2b3('0x48')][_0xb2b3('0x66')]({'where':{'id':_0x2ec77c['params']['id']}})[_0xb2b3('0x24')](handleEntityNotFound(_0x3b8ffa,null))['then'](function(_0x3b1fea){if(_0x3b1fea){_0x2ec77c[_0xb2b3('0x62')][_0xb2b3('0x67')]=_0x3b1fea['id'];return db[_0xb2b3('0x44')][_0xb2b3('0x68')](_0x2ec77c[_0xb2b3('0x62')]);}})[_0xb2b3('0x24')](respondWithResult(_0x3b8ffa,null))[_0xb2b3('0x2d')](handleError(_0x3b8ffa,null));};exports[_0xb2b3('0x8c')]=function(_0x329813,_0x497836,_0x855f7b){return db[_0xb2b3('0x48')][_0xb2b3('0x69')]({'where':{'id':_0x329813[_0xb2b3('0x63')]['id']}})['then'](handleEntityNotFound(_0x497836,null))[_0xb2b3('0x24')](function(_0xec9659){if(_0xec9659){return _0xec9659[_0xb2b3('0x8d')](null);}return null;})['then'](respondWithStatusCode(_0x497836,null))[_0xb2b3('0x2d')](handleError(_0x497836,null));};exports[_0xb2b3('0x8e')]=function(_0x16404b,_0x141796,_0x4d7348){return db['MailInteraction'][_0xb2b3('0x66')]({'where':{'id':_0x16404b[_0xb2b3('0x63')]['id']}})[_0xb2b3('0x24')](handleEntityNotFound(_0x141796,null))[_0xb2b3('0x24')](function(_0x27ed41){if(_0x27ed41){return _0x27ed41[_0xb2b3('0x8e')](_0x16404b[_0xb2b3('0x62')][_0xb2b3('0x6e')],_[_0xb2b3('0x8f')](_0x16404b['body'],[_0xb2b3('0x6e'),'id'])||{});}})[_0xb2b3('0x24')](respondWithResult(_0x141796,null))[_0xb2b3('0x2d')](handleError(_0x141796,null));};exports[_0xb2b3('0x90')]=function(_0x3c589f,_0x3fbed4,_0x86b9f3){var _0x23768a={'raw':![],'where':{}};var _0x58ce8f={};var _0x152763={'count':0x0,'rows':[]};return db[_0xb2b3('0x48')][_0xb2b3('0x69')]({'where':{'id':_0x3c589f[_0xb2b3('0x63')]['id']}})['then'](handleEntityNotFound(_0x3fbed4,null))[_0xb2b3('0x24')](function(_0x132622){if(_0x132622){_0x58ce8f['model']=_[_0xb2b3('0x61')](db[_0xb2b3('0x91')]['rawAttributes']);_0x58ce8f[_0xb2b3('0x4d')]=_['keys'](_0x3c589f[_0xb2b3('0x4d')]);_0x58ce8f['filters']=_['intersection'](_0x58ce8f['model'],_0x58ce8f['query']);_0x23768a[_0xb2b3('0x50')]=_[_0xb2b3('0x4f')](_0x58ce8f[_0xb2b3('0x4b')],qs[_0xb2b3('0x51')](_0x3c589f[_0xb2b3('0x4d')][_0xb2b3('0x51')]));_0x23768a['attributes']=_0x23768a['attributes'][_0xb2b3('0x52')]?_0x23768a[_0xb2b3('0x50')]:_0x58ce8f[_0xb2b3('0x4b')];if(!_0x3c589f[_0xb2b3('0x4d')][_0xb2b3('0x53')](_0xb2b3('0x6b'))){_0x23768a[_0xb2b3('0x32')]=qs[_0xb2b3('0x32')](_0x3c589f['query'][_0xb2b3('0x32')]);_0x23768a[_0xb2b3('0x31')]=qs[_0xb2b3('0x31')](_0x3c589f[_0xb2b3('0x4d')][_0xb2b3('0x31')]);}_0x23768a[_0xb2b3('0x6c')]=qs[_0xb2b3('0x54')](_0x3c589f[_0xb2b3('0x4d')][_0xb2b3('0x54')]);_0x23768a['where']=qs[_0xb2b3('0x4e')](_[_0xb2b3('0x56')](_0x3c589f['query'],_0x58ce8f[_0xb2b3('0x4e')]));_0x23768a[_0xb2b3('0x55')]['MailAccountId']=_0x132622['id'];if(_0x3c589f['query'][_0xb2b3('0x57')]){_0x23768a[_0xb2b3('0x55')]=_[_0xb2b3('0x58')](_0x23768a[_0xb2b3('0x55')],{'$or':_['map'](_0x23768a['attributes'],function(_0xc299b9){var _0x36cfdf={};_0x36cfdf[_0xc299b9]={'$like':'%'+_0x3c589f[_0xb2b3('0x4d')]['filter']+'%'};return _0x36cfdf;})});}_0x23768a=_[_0xb2b3('0x58')]({},_0x23768a,_0x3c589f[_0xb2b3('0x5b')]);return db[_0xb2b3('0x91')][_0xb2b3('0x34')]({'where':_0x23768a[_0xb2b3('0x55')]})[_0xb2b3('0x24')](function(_0x2943b8){_0x152763[_0xb2b3('0x34')]=_0x2943b8;if(_0x3c589f[_0xb2b3('0x4d')][_0xb2b3('0x5c')]){_0x23768a[_0xb2b3('0x5d')]=[{'model':db[_0xb2b3('0x92')],'as':_0xb2b3('0x93'),'required':![]},{'model':db[_0xb2b3('0x94')],'as':_0xb2b3('0x95'),'attributes':[_0xb2b3('0x3f'),_0xb2b3('0x96'),'internal'],'required':![]},{'model':db['Tag'],'as':_0xb2b3('0x97'),'attributes':['id','name','color'],'where':_0x3c589f['query'][_0xb2b3('0x98')]?{'id':_0x3c589f[_0xb2b3('0x4d')][_0xb2b3('0x98')]}:undefined,'required':_0x3c589f[_0xb2b3('0x4d')][_0xb2b3('0x98')]?!![]:![]}];}return db[_0xb2b3('0x91')]['findAll'](_0x23768a);})[_0xb2b3('0x24')](function(_0xd5ac22){_0x152763[_0xb2b3('0x5f')]=_0xd5ac22;return _0x152763;});}})[_0xb2b3('0x24')](respondWithFilteredResult(_0x3fbed4,_0x23768a))['catch'](handleError(_0x3fbed4,null));};exports[_0xb2b3('0x99')]=function(_0x272b4e,_0x8b72f,_0xbe50ce){return db[_0xb2b3('0x48')]['findOne']({'where':{'id':_0x272b4e['params']['id']}})['then'](handleEntityNotFound(_0x8b72f,null))[_0xb2b3('0x24')](function(_0xc7a925){if(_0xc7a925){return db[_0xb2b3('0x9a')][_0xb2b3('0x9b')](function(_0x2b0bed){return db['MailApplication'][_0xb2b3('0x3d')]({'where':{'MailAccountId':_0x272b4e[_0xb2b3('0x63')]['id']},'transaction':_0x2b0bed})[_0xb2b3('0x24')](function(_0xdb1081){var _0x109ef1=_[_0xb2b3('0x4c')](_0x272b4e[_0xb2b3('0x62')],function(_0xea6fd2){_0xea6fd2[_0xb2b3('0x67')]=_0x272b4e[_0xb2b3('0x63')]['id'];return _0xea6fd2;});return db[_0xb2b3('0x9c')][_0xb2b3('0x9d')](_0x109ef1,{'transaction':_0x2b0bed});});})[_0xb2b3('0x24')](function(){return db[_0xb2b3('0x9c')][_0xb2b3('0x9e')]({'where':{'MailAccountId':_0x272b4e[_0xb2b3('0x63')]['id']},'order':_0xb2b3('0x9f')});});}})[_0xb2b3('0x24')](respondWithResult(_0x8b72f,null))[_0xb2b3('0x2d')](handleError(_0x8b72f,null));};exports[_0xb2b3('0xa0')]=function(_0x454809,_0x4386fc,_0x318af4){var _0x4d71a6={};var _0x2ed718={};var _0x5b1125;var _0xe99e94;return db[_0xb2b3('0x48')][_0xb2b3('0x69')]({'where':{'id':_0x454809[_0xb2b3('0x63')]['id']}})[_0xb2b3('0x24')](handleEntityNotFound(_0x4386fc,null))[_0xb2b3('0x24')](function(_0x4ee500){if(_0x4ee500){_0x5b1125=_0x4ee500;_0x2ed718['model']=_[_0xb2b3('0x61')](db['MailApplication'][_0xb2b3('0x49')]);_0x2ed718['query']=_['keys'](_0x454809[_0xb2b3('0x4d')]);_0x2ed718[_0xb2b3('0x4e')]=_[_0xb2b3('0x4f')](_0x2ed718[_0xb2b3('0x4b')],_0x2ed718['query']);_0x4d71a6[_0xb2b3('0x50')]=_[_0xb2b3('0x4f')](_0x2ed718['model'],qs[_0xb2b3('0x51')](_0x454809[_0xb2b3('0x4d')][_0xb2b3('0x51')]));_0x4d71a6[_0xb2b3('0x50')]=_0x4d71a6[_0xb2b3('0x50')]['length']?_0x4d71a6[_0xb2b3('0x50')]:_0x2ed718['model'];_0x4d71a6[_0xb2b3('0x6c')]=qs[_0xb2b3('0x54')](_0x454809['query'][_0xb2b3('0x54')]);_0x4d71a6[_0xb2b3('0x55')]=qs['filters'](_['pick'](_0x454809[_0xb2b3('0x4d')],_0x2ed718[_0xb2b3('0x4e')]));if(_0x454809[_0xb2b3('0x4d')][_0xb2b3('0x57')]){_0x4d71a6[_0xb2b3('0x55')]=_[_0xb2b3('0x58')](_0x4d71a6[_0xb2b3('0x55')],{'$or':_['map'](_0x4d71a6[_0xb2b3('0x50')],function(_0x5afaf3){var _0xa2f29={};_0xa2f29[_0x5afaf3]={'$like':'%'+_0x454809[_0xb2b3('0x4d')][_0xb2b3('0x57')]+'%'};return _0xa2f29;})});}_0x4d71a6=_[_0xb2b3('0x58')]({},_0x4d71a6,_0x454809[_0xb2b3('0x5b')]);return _0x5b1125[_0xb2b3('0xa0')](_0x4d71a6);}})[_0xb2b3('0x24')](function(_0x569009){if(_0x569009){_0xe99e94=_0x569009[_0xb2b3('0x52')];if(!_0x454809[_0xb2b3('0x4d')][_0xb2b3('0x53')]('nolimit')){_0x4d71a6[_0xb2b3('0x32')]=qs[_0xb2b3('0x32')](_0x454809[_0xb2b3('0x4d')]['limit']);_0x4d71a6[_0xb2b3('0x31')]=qs[_0xb2b3('0x31')](_0x454809[_0xb2b3('0x4d')]['offset']);}return _0x5b1125[_0xb2b3('0xa0')](_0x4d71a6);}})[_0xb2b3('0x24')](function(_0xe6a1b6){if(_0xe6a1b6){return _0xe6a1b6?{'count':_0xe99e94,'rows':_0xe6a1b6}:null;}})[_0xb2b3('0x24')](respondWithResult(_0x4386fc,null))[_0xb2b3('0x2d')](handleError(_0x4386fc,null));};exports[_0xb2b3('0xa1')]=function(_0x120226,_0x4123a6,_0x19e77b){var _0x24b186={'raw':!![],'where':{}};var _0x5306cb={};var _0x1f0e98={'count':0x0,'rows':[]};return db[_0xb2b3('0x48')][_0xb2b3('0x69')]({'where':{'id':_0x120226['params']['id']}})[_0xb2b3('0x24')](handleEntityNotFound(_0x4123a6,null))['then'](function(_0x28ad38){if(_0x28ad38){_0x5306cb[_0xb2b3('0x4b')]=_[_0xb2b3('0x61')](db[_0xb2b3('0xa2')][_0xb2b3('0x49')]);_0x5306cb['query']=_[_0xb2b3('0x61')](_0x120226[_0xb2b3('0x4d')]);_0x5306cb[_0xb2b3('0x4e')]=_[_0xb2b3('0x4f')](_0x5306cb[_0xb2b3('0x4b')],_0x5306cb[_0xb2b3('0x4d')]);_0x24b186[_0xb2b3('0x50')]=_[_0xb2b3('0x4f')](_0x5306cb[_0xb2b3('0x4b')],qs[_0xb2b3('0x51')](_0x120226[_0xb2b3('0x4d')]['fields']));_0x24b186[_0xb2b3('0x50')]=_0x24b186[_0xb2b3('0x50')][_0xb2b3('0x52')]?_0x24b186[_0xb2b3('0x50')]:_0x5306cb[_0xb2b3('0x4b')];if(!_0x120226[_0xb2b3('0x4d')][_0xb2b3('0x53')]('nolimit')){_0x24b186['limit']=qs[_0xb2b3('0x32')](_0x120226[_0xb2b3('0x4d')]['limit']);_0x24b186['offset']=qs[_0xb2b3('0x31')](_0x120226[_0xb2b3('0x4d')][_0xb2b3('0x31')]);}_0x24b186[_0xb2b3('0x6c')]=qs[_0xb2b3('0x54')](_0x120226[_0xb2b3('0x4d')]['sort']);_0x24b186[_0xb2b3('0x55')]=qs[_0xb2b3('0x4e')](_[_0xb2b3('0x56')](_0x120226[_0xb2b3('0x4d')],_0x5306cb[_0xb2b3('0x4e')]));_0x24b186[_0xb2b3('0x55')][_0xb2b3('0x67')]=_0x28ad38['id'];if(_0x120226[_0xb2b3('0x4d')]['filter']){_0x24b186[_0xb2b3('0x55')]=_[_0xb2b3('0x58')](_0x24b186[_0xb2b3('0x55')],{'$or':_[_0xb2b3('0x4c')](_0x24b186['attributes'],function(_0x358f80){var _0x3f233d={};_0x3f233d[_0x358f80]={'$like':'%'+_0x120226[_0xb2b3('0x4d')][_0xb2b3('0x57')]+'%'};return _0x3f233d;})});}if(_0x120226['query'][_0xb2b3('0xa3')]){var _0x46d97f=_0x120226[_0xb2b3('0x4d')][_0xb2b3('0xa3')][_0xb2b3('0xa4')](',');var _0x4d373c={};_0x4d373c[_0x46d97f[0x0]]={'$gte':moment(_0x46d97f[0x1])[_0xb2b3('0xa5')](_0xb2b3('0xa6'))};_0x24b186[_0xb2b3('0x55')]=_[_0xb2b3('0x58')](_0x24b186[_0xb2b3('0x55')],_0x4d373c);}_0x24b186=_[_0xb2b3('0x58')]({},_0x24b186,_0x120226[_0xb2b3('0x5b')]);return db[_0xb2b3('0xa2')][_0xb2b3('0x34')]({'where':_0x24b186[_0xb2b3('0x55')]})[_0xb2b3('0x24')](function(_0x5f303c){_0x1f0e98[_0xb2b3('0x34')]=_0x5f303c;if(_0x120226['query']['includeAll']){_0x24b186[_0xb2b3('0x5d')]=[{'all':!![]}];}return db[_0xb2b3('0xa2')][_0xb2b3('0x5e')](_0x24b186);})[_0xb2b3('0x24')](function(_0x17c9e9){if(_0x120226[_0xb2b3('0x4d')][_0xb2b3('0xa7')]==='true'){for(var _0x1f8368=0x0;_0x1f8368<_0x17c9e9[_0xb2b3('0x52')];_0x1f8368++){_0x17c9e9[_0x1f8368][_0xb2b3('0x62')]=juice(_0x17c9e9[_0x1f8368][_0xb2b3('0x62')]);}}_0x1f0e98['rows']=_0x17c9e9;return _0x1f0e98;});}})[_0xb2b3('0x24')](respondWithFilteredResult(_0x4123a6,_0x24b186))[_0xb2b3('0x2d')](handleError(_0x4123a6,null));};exports[_0xb2b3('0x40')]=function(_0x366ce3,_0x3121be,_0x49d56f){var _0x4d2cfd,_0x3bfe0d={},_0x15e5f1;if(_0x366ce3[_0xb2b3('0x62')]['to']){_0x15e5f1=_0x366ce3[_0xb2b3('0x62')]['to'][_0xb2b3('0xa4')](',')[0x0];}return db['MailAccount'][_0xb2b3('0x66')]({'where':{'id':_0x366ce3[_0xb2b3('0x63')]['id']},'include':[{'model':db[_0xb2b3('0xa8')],'as':'List','include':[{'model':db[_0xb2b3('0x92')],'as':_0xb2b3('0xa9'),'where':{'email':_0x15e5f1},'limit':0x1,'order':[[_0xb2b3('0xaa'),'DESC']]}]},{'model':db[_0xb2b3('0x44')],'as':_0xb2b3('0x45'),'raw':!![]}]})[_0xb2b3('0x24')](handleEntityNotFound(_0x3121be,null))[_0xb2b3('0x24')](function(_0x5ba7b4){if(_0x5ba7b4){_0x4d2cfd=_0x5ba7b4;if(_0x5ba7b4[_0xb2b3('0x45')]){if(_[_0xb2b3('0x74')](_0x366ce3[_0xb2b3('0x62')]['from'])){_0x366ce3[_0xb2b3('0x62')]['from']=util['format'](_0xb2b3('0xab'),_0x5ba7b4[_0xb2b3('0x3f')],_0x5ba7b4[_0xb2b3('0xac')]||_0x5ba7b4[_0xb2b3('0x45')][_0xb2b3('0x77')]);}if(_0x366ce3['body'][_0xb2b3('0xad')]&&_0x366ce3[_0xb2b3('0x62')][_0xb2b3('0xad')]['length']){for(var _0x22b2de=0x0;_0x22b2de<_0x366ce3[_0xb2b3('0x62')][_0xb2b3('0xad')][_0xb2b3('0x52')];_0x22b2de+=0x1){_0x366ce3[_0xb2b3('0x62')][_0xb2b3('0xad')][_0x22b2de]={'filename':_0x366ce3[_0xb2b3('0x62')][_0xb2b3('0xad')][_0x22b2de][_0xb2b3('0x3f')],'path':path[_0xb2b3('0xae')](config[_0xb2b3('0xaf')],_0xb2b3('0xb0'),_0x366ce3[_0xb2b3('0x62')]['attachments'][_0x22b2de]['basename'])};}}var _0x14f13f={'tls':{'rejectUnauthorized':![]}};if(_[_0xb2b3('0x74')](_0x5ba7b4[_0xb2b3('0x45')][_0xb2b3('0x7f')])){if(_0x5ba7b4[_0xb2b3('0x45')]['authentication']){_0x14f13f[_0xb2b3('0xb1')]={'user':_0x5ba7b4['Smtp'][_0xb2b3('0x77')],'pass':_0x5ba7b4[_0xb2b3('0x45')][_0xb2b3('0x7a')]};}_0x14f13f[_0xb2b3('0x7d')]=_0x5ba7b4[_0xb2b3('0x45')][_0xb2b3('0x7d')];_0x14f13f[_0xb2b3('0x7e')]=_0x5ba7b4[_0xb2b3('0x45')]['port'];_0x14f13f[_0xb2b3('0xb2')]=_0x5ba7b4[_0xb2b3('0x45')]['secure'];}else{_0x14f13f[_0xb2b3('0x7f')]=_0x5ba7b4['Smtp'][_0xb2b3('0x7f')];_0x14f13f[_0xb2b3('0xb1')]={'user':_0x5ba7b4[_0xb2b3('0x45')][_0xb2b3('0x77')],'pass':_0x5ba7b4[_0xb2b3('0x45')]['pass']};}return respondWithRpcPromise(_0xb2b3('0xb3'),'sendMail',{'account':_0x14f13f,'message':_0x366ce3[_0xb2b3('0x62')]});}else{throw new Error(_0xb2b3('0xb4'));}}})['then'](function(_0x358b4b){if(_0x358b4b){_0x3bfe0d=_0x358b4b;if(_0x4d2cfd[_0xb2b3('0xb5')]){if(_0x4d2cfd['List'][_0xb2b3('0xa9')][_0xb2b3('0x52')]){return _0x4d2cfd['List'][_0xb2b3('0xa9')][0x0];}else{return db[_0xb2b3('0x92')][_0xb2b3('0x68')](_[_0xb2b3('0x1c')](_0x366ce3[_0xb2b3('0x62')],{'firstName':_0x366ce3['body']['to'],'email':_0x366ce3[_0xb2b3('0x62')]['to'],'phone':_0x366ce3[_0xb2b3('0x62')]['to'],'ListId':_0x4d2cfd[_0xb2b3('0xb6')]}));}}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x4bf199){if(_0x4bf199){var _0x137672={'UserId':_0x366ce3[_0xb2b3('0x77')]['id'],'ContactId':_0x4bf199['id'],'MailAccountId':_0x4d2cfd['id'],'inReplyTo':_0x3bfe0d['messageId'],'to':_0x366ce3[_0xb2b3('0x62')][_0xb2b3('0xb7')],'cc':_0x366ce3[_0xb2b3('0x62')]['cc'],'subject':_0x366ce3[_0xb2b3('0x62')][_0xb2b3('0xb8')],'attach':_0x366ce3[_0xb2b3('0x62')]['attach'],'firstMsgDirection':_0xb2b3('0xb9'),'lastMsgAt':moment()['format'](_0xb2b3('0xa6')),'lastMsgDirection':_0xb2b3('0xb9'),'Messages':[_[_0xb2b3('0x58')](_0x366ce3['body'],{'messageId':_0x3bfe0d[_0xb2b3('0xba')],'sentAt':moment()[_0xb2b3('0xa5')](_0xb2b3('0xa6')),'read':!![],'MailAccountId':_0x4d2cfd['id'],'UserId':_0x366ce3[_0xb2b3('0x77')]['id'],'ContactId':_0x4bf199['id']})]};if(_0x366ce3[_0xb2b3('0x62')][_0xb2b3('0xbb')]){_0x137672=_[_0xb2b3('0x58')](_0x137672,_0x366ce3['body'][_0xb2b3('0xbb')]);}return db['MailInteraction'][_0xb2b3('0x68')](_0x137672,{'include':[{'model':db['MailMessage'],'as':_0xb2b3('0xbc')}]});}})[_0xb2b3('0x24')](respondWithResult(_0x3121be,null))[_0xb2b3('0x2d')](handleError(_0x3121be,null));};exports[_0xb2b3('0xbd')]=function(_0x4adb94,_0x4c644c,_0x175055){return db[_0xb2b3('0x48')][_0xb2b3('0x66')]({'where':{'id':_0x4adb94['params']['id']},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0xb2b3('0x24')](handleEntityNotFound(_0x4c644c,null))[_0xb2b3('0x24')](function(_0x30c16b){if(_0x30c16b&&_0x30c16b[_0xb2b3('0x45')]){var _0x48a05b={'id':_0x30c16b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x30c16b[_0xb2b3('0x45')][_0xb2b3('0x7f')]){_0x48a05b[_0xb2b3('0x7f')]=_0x30c16b['Smtp'][_0xb2b3('0x7f')];}else{_0x48a05b['host']=_0x30c16b['Smtp'][_0xb2b3('0x7d')];_0x48a05b['port']=_0x30c16b['Smtp'][_0xb2b3('0x7e')];_0x48a05b[_0xb2b3('0xb2')]=_0x30c16b[_0xb2b3('0x45')][_0xb2b3('0xb2')];}if(_0x30c16b[_0xb2b3('0x45')]['authentication']){_0x48a05b[_0xb2b3('0xb1')]={'user':_0x30c16b[_0xb2b3('0x45')]['user'],'pass':_0x30c16b[_0xb2b3('0x45')][_0xb2b3('0x7a')]};}return respondWithRpcPromise(_0xb2b3('0xbe'),_0xb2b3('0xbd'),{'account':_0x48a05b});}})[_0xb2b3('0x24')](respondWithResult(_0x4c644c,null))['catch'](handleError(_0x4c644c,null));};exports[_0xb2b3('0x3d')]=function(_0x1f689a,_0x5e6e0c){return db[_0xb2b3('0x48')][_0xb2b3('0x66')]({'where':{'id':_0x1f689a['params']['id']}})[_0xb2b3('0x24')](handleEntityNotFound(_0x5e6e0c,null))[_0xb2b3('0x24')](function(_0x3cd3be){if(_0x3cd3be&&_0x3cd3be[_0xb2b3('0x7f')]){throw new db['Sequelize'][(_0xb2b3('0xbf'))](_0xb2b3('0xc0'));}return _0x3cd3be;})[_0xb2b3('0x24')](removeEntity(_0x5e6e0c,null))[_0xb2b3('0x2d')](handleError(_0x5e6e0c,null));};exports[_0xb2b3('0xc1')]=function(_0x5367bc,_0x182264,_0x80ce72){return db[_0xb2b3('0x48')]['find']({'where':{'id':_0x5367bc['params']['id']}})['then'](handleEntityNotFound(_0x182264,null))[_0xb2b3('0x24')](function(_0x3f4726){if(_0x3f4726){return _0x3f4726[_0xb2b3('0xc1')](_0x5367bc[_0xb2b3('0x62')]['ids'],_[_0xb2b3('0x8f')](_0x5367bc[_0xb2b3('0x62')],[_0xb2b3('0x6e'),'id'])||{})['spread'](function(_0xbe2433){for(var _0x48167c=0x0;_0x48167c<_0x5367bc[_0xb2b3('0x62')][_0xb2b3('0x6e')][_0xb2b3('0x52')];_0x48167c+=0x1){socket[_0xb2b3('0xc2')](_0xb2b3('0xc3'),{'UserId':Number(_0x5367bc[_0xb2b3('0x62')][_0xb2b3('0x6e')][_0x48167c]),'MailAccountId':Number(_0x5367bc['params']['id'])});}return _0xbe2433;});}})[_0xb2b3('0x24')](respondWithResult(_0x182264,null))['catch'](handleError(_0x182264,null));};exports[_0xb2b3('0xc4')]=function(_0xc2645,_0x1414a4,_0x5d2ee7){return db['MailAccount'][_0xb2b3('0x66')]({'where':{'id':_0xc2645[_0xb2b3('0x63')]['id']}})['then'](handleEntityNotFound(_0x1414a4,null))['then'](function(_0x553ded){if(_0x553ded){return _0x553ded[_0xb2b3('0xc4')](_0xc2645[_0xb2b3('0x4d')]['ids'])[_0xb2b3('0x24')](function(){if(_[_0xb2b3('0xc5')](_0xc2645[_0xb2b3('0x4d')][_0xb2b3('0x6e')])){for(var _0x564ce0=0x0;_0x564ce0<_0xc2645[_0xb2b3('0x4d')][_0xb2b3('0x6e')][_0xb2b3('0x52')];_0x564ce0+=0x1){socket[_0xb2b3('0xc2')]('userMailAccount:remove',{'UserId':Number(_0xc2645[_0xb2b3('0x4d')][_0xb2b3('0x6e')][_0x564ce0]),'MailAccountId':Number(_0xc2645[_0xb2b3('0x63')]['id'])});}}else{socket[_0xb2b3('0xc2')]('userMailAccount:remove',{'UserId':Number(_0xc2645[_0xb2b3('0x4d')][_0xb2b3('0x6e')]),'MailAccountId':Number(_0xc2645[_0xb2b3('0x63')]['id'])});}});}})[_0xb2b3('0x24')](respondWithStatusCode(_0x1414a4,null))[_0xb2b3('0x2d')](handleError(_0x1414a4,null));};exports[_0xb2b3('0xc6')]=function(_0x8c682e,_0x28e5c4,_0x5d9f37){var _0x547822={};var _0x366e03={};var _0x59cd4a;var _0x1a31cb;return db['MailAccount']['findOne']({'where':{'id':_0x8c682e[_0xb2b3('0x63')]['id']}})[_0xb2b3('0x24')](handleEntityNotFound(_0x28e5c4,null))[_0xb2b3('0x24')](function(_0x1515fa){if(_0x1515fa){_0x59cd4a=_0x1515fa;_0x366e03['model']=_['keys'](db[_0xb2b3('0x94')]['rawAttributes']);_0x366e03[_0xb2b3('0x4d')]=_[_0xb2b3('0x61')](_0x8c682e[_0xb2b3('0x4d')]);_0x366e03[_0xb2b3('0x4e')]=_['intersection'](_0x366e03[_0xb2b3('0x4b')],_0x366e03[_0xb2b3('0x4d')]);_0x547822[_0xb2b3('0x50')]=_[_0xb2b3('0x4f')](_0x366e03[_0xb2b3('0x4b')],qs[_0xb2b3('0x51')](_0x8c682e[_0xb2b3('0x4d')][_0xb2b3('0x51')]));_0x547822[_0xb2b3('0x50')]=_0x547822[_0xb2b3('0x50')][_0xb2b3('0x52')]?_0x547822[_0xb2b3('0x50')]:_0x366e03[_0xb2b3('0x4b')];_0x547822[_0xb2b3('0x6c')]=qs[_0xb2b3('0x54')](_0x8c682e[_0xb2b3('0x4d')][_0xb2b3('0x54')]);_0x547822[_0xb2b3('0x55')]=qs[_0xb2b3('0x4e')](_['pick'](_0x8c682e[_0xb2b3('0x4d')],_0x366e03['filters']));if(_0x8c682e[_0xb2b3('0x4d')]['filter']){_0x547822[_0xb2b3('0x55')]=_[_0xb2b3('0x58')](_0x547822[_0xb2b3('0x55')],{'$or':_['map'](_0x547822['attributes'],function(_0x6ed06){var _0x5e9410={};_0x5e9410[_0x6ed06]={'$like':'%'+_0x8c682e[_0xb2b3('0x4d')][_0xb2b3('0x57')]+'%'};return _0x5e9410;})});}_0x547822=_['merge']({},_0x547822,_0x8c682e[_0xb2b3('0x5b')]);return _0x59cd4a['getAgents'](_0x547822);}})[_0xb2b3('0x24')](function(_0x86b054){if(_0x86b054){_0x1a31cb=_0x86b054[_0xb2b3('0x52')];if(!_0x8c682e[_0xb2b3('0x4d')][_0xb2b3('0x53')]('nolimit')){_0x547822['limit']=qs[_0xb2b3('0x32')](_0x8c682e[_0xb2b3('0x4d')]['limit']);_0x547822[_0xb2b3('0x31')]=qs['offset'](_0x8c682e[_0xb2b3('0x4d')][_0xb2b3('0x31')]);}return _0x59cd4a['getAgents'](_0x547822);}})[_0xb2b3('0x24')](function(_0x5bb516){if(_0x5bb516){return _0x5bb516?{'count':_0x1a31cb,'rows':_0x5bb516}:null;}})[_0xb2b3('0x24')](respondWithResult(_0x28e5c4,null))[_0xb2b3('0x2d')](handleError(_0x28e5c4,null));};
\ No newline at end of file
index e32de0f..c488c83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba18=['events','../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2ffc6b,_0x24d65d){var _0x34ecf4=function(_0xe6ae7b){while(--_0xe6ae7b){_0x2ffc6b['push'](_0x2ffc6b['shift']());}};_0x34ecf4(++_0x24d65d);}(_0xba18,0x1ea));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x8ba1('0x0'));var MailAccount=require(_0x8ba1('0x1'))['db'][_0x8ba1('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x8ba1('0x3')](0x0);var events={'afterCreate':_0x8ba1('0x4'),'afterUpdate':_0x8ba1('0x5'),'afterDestroy':_0x8ba1('0x6')};function emitEvent(_0x3b5254){return function(_0x59c54c,_0xe3bc16,_0x3136d7){MailAccountEvents[_0x8ba1('0x7')](_0x3b5254+':'+_0x59c54c['id'],_0x59c54c);MailAccountEvents[_0x8ba1('0x7')](_0x3b5254,_0x59c54c);_0x3136d7(null);};}for(var e in events){if(events[_0x8ba1('0x8')](e)){var event=events[e];MailAccount[_0x8ba1('0x9')](e,emitEvent(event));}}module['exports']=MailAccountEvents;
\ No newline at end of file
+var _0xb1ad=['MailAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x459423,_0x3416a8){var _0x42ed14=function(_0x1d4f69){while(--_0x1d4f69){_0x459423['push'](_0x459423['shift']());}};_0x42ed14(++_0x3416a8);}(_0xb1ad,0x184));var _0xdb1a=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0xb1ad[_0x1abb09];return _0xea1c07;};'use strict';var EventEmitter=require(_0xdb1a('0x0'));var MailAccount=require(_0xdb1a('0x1'))['db'][_0xdb1a('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xdb1a('0x3')](0x0);var events={'afterCreate':_0xdb1a('0x4'),'afterUpdate':_0xdb1a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1a0d04){return function(_0x15cb4f,_0x24b01f,_0x10b9c1){MailAccountEvents[_0xdb1a('0x6')](_0x1a0d04+':'+_0x15cb4f['id'],_0x15cb4f);MailAccountEvents[_0xdb1a('0x6')](_0x1a0d04,_0x15cb4f);_0x10b9c1(null);};}for(var e in events){if(events[_0xdb1a('0x7')](e)){var event=events[e];MailAccount[_0xdb1a('0x8')](e,emitEvent(event));}}module[_0xdb1a('0x9')]=MailAccountEvents;
\ No newline at end of file
index d6674be..50c2eef 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda51=['mail_accounts','lodash','util','api','bluebird','request-promise','path','rimraf','./mailAccount.attributes','exports','define','MailAccount'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xda51,0x91));var _0x1da5=function(_0x366388,_0x4595a6){_0x366388=_0x366388-0x0;var _0x41c97e=_0xda51[_0x366388];return _0x41c97e;};'use strict';var _=require(_0x1da5('0x0'));var util=require(_0x1da5('0x1'));var logger=require('../../config/logger')(_0x1da5('0x2'));var moment=require('moment');var BPromise=require(_0x1da5('0x3'));var rp=require(_0x1da5('0x4'));var fs=require('fs');var path=require(_0x1da5('0x5'));var rimraf=require(_0x1da5('0x6'));var config=require('../../config/environment');var attributes=require(_0x1da5('0x7'));module[_0x1da5('0x8')]=function(_0x240352,_0x3e9242){return _0x240352[_0x1da5('0x9')](_0x1da5('0xa'),attributes,{'tableName':_0x1da5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa0f4=['request-promise','path','rimraf','../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','api'];(function(_0x1b1f88,_0x3fe1cb){var _0x5045b9=function(_0x5c1367){while(--_0x5c1367){_0x1b1f88['push'](_0x1b1f88['shift']());}};_0x5045b9(++_0x3fe1cb);}(_0xa0f4,0x1ad));var _0x4a0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0f4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x4a0f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4a0f('0x1'));var fs=require('fs');var path=require(_0x4a0f('0x2'));var rimraf=require(_0x4a0f('0x3'));var config=require(_0x4a0f('0x4'));var attributes=require(_0x4a0f('0x5'));module[_0x4a0f('0x6')]=function(_0x325aa8,_0x305a9c){return _0x325aa8[_0x4a0f('0x7')](_0x4a0f('0x8'),attributes,{'tableName':_0x4a0f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3bc05c0..fd4148d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0118=['isNil','from','from\x20is\x20mandatory','mapKey','includes','account','CmList','List','Contacts','MailApplication','MailServerOut','Smtp','get','omit','applications','orderBy','priority','autoclose','push','length','close','Applications','messageId','generate','subject','attach','YYYY-MM-DD\x20HH:mm:ss','Messages','Contact\x20not\x20found','spread','update','format','interaction','MailMessage','create','attachments','originTo','originChannel','Email','Attachment','Attachments','UserId','User','unshift','name','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','lodash','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','MailAccount,\x20%s,\x20%s,\x20%s','error','code','MailAccount,\x20%s,\x20%s','message','info','request\x20sent','catch','GetMailAccount','MailAccount','findAll','options','raw','attributes','limit','map','model','include','debug','stringify','ShowMailAccount','find','NotifyMailAccount','body','CmContact','createdAt','updatedAt','CompanyId','ListId'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0118,0x151));var _0x8011=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0118[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8011('0x0'));var util=require(_0x8011('0x1'));var moment=require('moment');var BPromise=require(_0x8011('0x2'));var rs=require(_0x8011('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8011('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8011('0x5'));var config=require(_0x8011('0x6'));var jayson=require(_0x8011('0x7'));var client=jayson[_0x8011('0x8')][_0x8011('0x9')]({'port':0x232c});config[_0x8011('0xa')]=_[_0x8011('0xb')](config[_0x8011('0xa')],{'host':_0x8011('0xc'),'port':0x18eb});var socket=require(_0x8011('0xd'))(new Redis(config[_0x8011('0xa')]));require(_0x8011('0xe'))[_0x8011('0xf')](socket);function respondWithRpcPromise(_0x3abb55,_0x2b02cf,_0x22b242){return new BPromise(function(_0x2c3923,_0x504075){return client[_0x8011('0x10')](_0x3abb55,_0x22b242)[_0x8011('0x11')](function(_0x178ac7){logger['info']('MailAccount,\x20%s,\x20%s',_0x2b02cf,'request\x20sent');logger['debug'](_0x8011('0x12'),_0x2b02cf,'request\x20sent',JSON['stringify'](_0x178ac7));if(_0x178ac7[_0x8011('0x13')]){if(_0x178ac7[_0x8011('0x13')][_0x8011('0x14')]===0x1f4){logger[_0x8011('0x13')](_0x8011('0x15'),_0x2b02cf,_0x178ac7[_0x8011('0x13')][_0x8011('0x16')]);return _0x504075(_0x178ac7[_0x8011('0x13')]['message']);}logger[_0x8011('0x13')](_0x8011('0x15'),_0x2b02cf,_0x178ac7[_0x8011('0x13')][_0x8011('0x16')]);return _0x2c3923(_0x178ac7['error'][_0x8011('0x16')]);}else{logger[_0x8011('0x17')](_0x8011('0x15'),_0x2b02cf,_0x8011('0x18'));_0x2c3923(_0x178ac7['result']['message']);}})[_0x8011('0x19')](function(_0x38cca5){logger['error'](_0x8011('0x15'),_0x2b02cf,_0x38cca5);_0x504075(_0x38cca5);});});}exports[_0x8011('0x1a')]=function(_0x2b1f0c){var _0x2f1328=this;return new Promise(function(_0x133a3e,_0x594780){return db[_0x8011('0x1b')][_0x8011('0x1c')]({'raw':_0x2b1f0c[_0x8011('0x1d')]?_0x2b1f0c[_0x8011('0x1d')][_0x8011('0x1e')]===undefined?!![]:![]:!![],'where':_0x2b1f0c[_0x8011('0x1d')]?_0x2b1f0c[_0x8011('0x1d')]['where']||null:null,'attributes':_0x2b1f0c[_0x8011('0x1d')]?_0x2b1f0c[_0x8011('0x1d')][_0x8011('0x1f')]||null:null,'limit':_0x2b1f0c[_0x8011('0x1d')]?_0x2b1f0c[_0x8011('0x1d')][_0x8011('0x20')]||null:null,'include':_0x2b1f0c['options']?_0x2b1f0c[_0x8011('0x1d')]['include']?_[_0x8011('0x21')](_0x2b1f0c[_0x8011('0x1d')]['include'],function(_0x43f7f5){return{'model':db[_0x43f7f5[_0x8011('0x22')]],'as':_0x43f7f5['as'],'attributes':_0x43f7f5[_0x8011('0x1f')],'include':_0x43f7f5[_0x8011('0x23')]?_[_0x8011('0x21')](_0x43f7f5[_0x8011('0x23')],function(_0x5314eb){return{'model':db[_0x5314eb[_0x8011('0x22')]],'as':_0x5314eb['as'],'attributes':_0x5314eb[_0x8011('0x1f')],'include':_0x5314eb[_0x8011('0x23')]?_[_0x8011('0x21')](_0x5314eb['include'],function(_0x52a841){return{'model':db[_0x52a841['model']],'as':_0x52a841['as'],'attributes':_0x52a841[_0x8011('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4778b5){logger[_0x8011('0x17')](_0x8011('0x1a'),_0x2b1f0c);logger[_0x8011('0x24')]('GetMailAccount',_0x2b1f0c,JSON[_0x8011('0x25')](_0x4778b5));_0x133a3e(_0x4778b5);})[_0x8011('0x19')](function(_0x5ceb99){logger[_0x8011('0x13')]('GetMailAccount',_0x5ceb99[_0x8011('0x16')],_0x2b1f0c);_0x594780(_0x2f1328[_0x8011('0x13')](0x1f4,_0x5ceb99[_0x8011('0x16')]));});});};exports[_0x8011('0x26')]=function(_0x102730){var _0x3b6af8=this;return new Promise(function(_0x8da134,_0x48f20c){return db[_0x8011('0x1b')][_0x8011('0x27')]({'raw':_0x102730['options']?_0x102730[_0x8011('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x102730[_0x8011('0x1d')]?_0x102730[_0x8011('0x1d')]['where']||null:null,'attributes':_0x102730[_0x8011('0x1d')]?_0x102730[_0x8011('0x1d')]['attributes']||null:null,'include':_0x102730[_0x8011('0x1d')]?_0x102730['options'][_0x8011('0x23')]?_[_0x8011('0x21')](_0x102730[_0x8011('0x1d')][_0x8011('0x23')],function(_0x20a6ed){return{'model':db[_0x20a6ed['model']],'as':_0x20a6ed['as'],'attributes':_0x20a6ed[_0x8011('0x1f')],'include':_0x20a6ed['include']?_['map'](_0x20a6ed[_0x8011('0x23')],function(_0x1d9b27){return{'model':db[_0x1d9b27[_0x8011('0x22')]],'as':_0x1d9b27['as'],'attributes':_0x1d9b27[_0x8011('0x1f')],'include':_0x1d9b27['include']?_[_0x8011('0x21')](_0x1d9b27['include'],function(_0xb15ba1){return{'model':db[_0xb15ba1[_0x8011('0x22')]],'as':_0xb15ba1['as'],'attributes':_0xb15ba1[_0x8011('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x8011('0x11')](function(_0x5df4cf){logger[_0x8011('0x17')](_0x8011('0x26'),_0x102730);logger[_0x8011('0x24')](_0x8011('0x26'),_0x102730,JSON[_0x8011('0x25')](_0x5df4cf));_0x8da134(_0x5df4cf);})[_0x8011('0x19')](function(_0x3d5b20){logger[_0x8011('0x13')]('ShowMailAccount',_0x3d5b20[_0x8011('0x16')],_0x102730);_0x48f20c(_0x3b6af8[_0x8011('0x13')](0x1f4,_0x3d5b20[_0x8011('0x16')]));});});};exports[_0x8011('0x28')]=function(_0x80479c){var _0x1ae69c=this;return new Promise(function(_0x83274f,_0x1161d6){var _0x50116a={'body':_0x80479c[_0x8011('0x29')],'channel':'mail'};var _0x174843=_['difference'](_['keys'](db[_0x8011('0x2a')]['rawAttributes']),[_0x8011('0x2b'),_0x8011('0x2c'),_0x8011('0x2d'),_0x8011('0x2e')]);var _0x586ba4=![];if(_0x80479c['body']['id']){delete _0x80479c[_0x8011('0x29')]['id'];}if(_[_0x8011('0x2f')](_0x80479c['body'][_0x8011('0x30')])){return _0x1161d6(_0x1ae69c[_0x8011('0x13')](0x1f4,_0x8011('0x31')));}if(_['isNil'](_0x80479c['body'][_0x8011('0x29')])||_0x80479c[_0x8011('0x29')]['body']===''){return _0x1161d6(_0x1ae69c[_0x8011('0x13')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_['isNil'](_0x80479c[_0x8011('0x29')][_0x8011('0x32')])){return _0x1161d6(_0x1ae69c[_0x8011('0x13')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x174843));}if(!_[_0x8011('0x33')](_0x174843,_0x80479c['body'][_0x8011('0x32')])){return _0x1161d6(_0x1ae69c['error'](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x174843));}var _0x5dd79c={};_0x5dd79c[_0x80479c[_0x8011('0x29')][_0x8011('0x32')]]=_0x80479c[_0x8011('0x29')]['from'];return db['MailAccount'][_0x8011('0x27')]({'where':{'id':_0x80479c[_0x8011('0x34')]['id']},'include':[{'model':db[_0x8011('0x35')],'as':_0x8011('0x36'),'include':[{'model':db[_0x8011('0x2a')],'as':_0x8011('0x37'),'where':_0x5dd79c,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x8011('0x38')],'as':'Applications'},{'model':db[_0x8011('0x39')],'as':_0x8011('0x3a')}]})['then'](function(_0x8d0074){if(_0x8d0074&&_0x8d0074['List']){var _0xf62e70=_0x8d0074[_0x8011('0x3b')]({'plain':!![]});_0x50116a[_0x8011('0x34')]=_[_0x8011('0x3c')](_0xf62e70,['Applications',_0x8011('0x36')]);_0x50116a['applications']=_0xf62e70['Applications'];_0x50116a['list']=_0xf62e70['List'];_0x50116a[_0x8011('0x3d')]=_[_0x8011('0x3e')](_0x50116a['applications'],[_0x8011('0x3f')],['asc']);if(_0x50116a[_0x8011('0x34')]&&_0x50116a[_0x8011('0x34')][_0x8011('0x40')]){_0x50116a[_0x8011('0x3d')][_0x8011('0x41')]({'id':0x0,'priority':_0x50116a[_0x8011('0x3d')][_0x8011('0x42')]+0x1,'app':_0x8011('0x43'),'appdata':'autoclose','interval':'*,*,*,*'});}if(_0x50116a[_0x8011('0x34')][_0x8011('0x44')]){delete _0x50116a[_0x8011('0x34')][_0x8011('0x44')];}if(_0x50116a['account'][_0x8011('0x36')]){delete _0x50116a[_0x8011('0x34')][_0x8011('0x36')];}if(_0xf62e70[_0x8011('0x36')]['Contacts'][_0x8011('0x42')]){return _0xf62e70[_0x8011('0x36')][_0x8011('0x37')][0x0];}var _0x3527e3=_[_0x8011('0xb')](_0x80479c['body'],{'firstName':_0x80479c[_0x8011('0x29')][_0x8011('0x30')],'ListId':_0xf62e70[_0x8011('0x2e')]});_0x3527e3[_0x80479c[_0x8011('0x29')][_0x8011('0x32')]]=_0x80479c[_0x8011('0x29')][_0x8011('0x30')];return db[_0x8011('0x2a')]['create'](_0x3527e3);}else{throw new Error('List\x20not\x20found');}})[_0x8011('0x11')](function(_0x56fa08){_0x50116a['contact']=_0x56fa08;if(_0x56fa08){if(!_0x80479c[_0x8011('0x29')][_0x8011('0x16')][_0x8011('0x45')]){_0x80479c[_0x8011('0x29')][_0x8011('0x16')][_0x8011('0x45')]=rs[_0x8011('0x46')]()+'\x20'+_0x80479c[_0x8011('0x29')]['message'][_0x8011('0x30')];}var _0x4dbc5b={'ContactId':_0x56fa08['id'],'MailAccountId':_0x80479c[_0x8011('0x34')]['id'],'inReplyTo':_0x80479c[_0x8011('0x29')]['message'][_0x8011('0x45')],'to':_0x80479c[_0x8011('0x29')][_0x8011('0x16')][_0x8011('0x30')],'cc':_0x80479c[_0x8011('0x29')][_0x8011('0x16')]['cc'],'subject':_0x80479c['body'][_0x8011('0x16')][_0x8011('0x47')],'attach':_0x80479c[_0x8011('0x29')][_0x8011('0x16')][_0x8011('0x48')],'lastMsgAt':moment()['format'](_0x8011('0x49')),'lastMsgDirection':'in'};return db['MailInteraction'][_0x8011('0x27')]({'where':{'closed':![],'MailAccountId':_0x80479c[_0x8011('0x34')]['id']},'include':[{'model':db['MailMessage'],'as':_0x8011('0x4a'),'attributes':[_0x8011('0x45')],'where':{'messageId':_0x80479c[_0x8011('0x29')][_0x8011('0x16')]['inReplyTo']}}]})[_0x8011('0x11')](function(_0x5acfd1){if(_0x5acfd1){return[_0x5acfd1,![]];}return db['MailInteraction']['create'](_0x4dbc5b)[_0x8011('0x11')](function(_0x5e58f7){return[_0x5e58f7,!![]];});});}else{throw new Error(_0x8011('0x4b'));}})[_0x8011('0x4c')](function(_0x5a9be3,_0x7c4ab0){if(_0x5a9be3){_0x586ba4=_0x7c4ab0;if(!_0x7c4ab0){return _0x5a9be3[_0x8011('0x4d')]({'inReplyTo':_0x80479c[_0x8011('0x29')][_0x8011('0x16')]['messageId'],'to':_0x80479c[_0x8011('0x29')][_0x8011('0x16')]['from'],'cc':_0x80479c['body'][_0x8011('0x16')]['cc'],'subject':_0x80479c[_0x8011('0x29')]['message'][_0x8011('0x47')],'attach':_0x5a9be3[_0x8011('0x48')]?_0x5a9be3[_0x8011('0x48')]:_0x80479c[_0x8011('0x29')][_0x8011('0x16')][_0x8011('0x48')],'substatus':null,'substatusAt':moment()[_0x8011('0x4e')](_0x8011('0x49')),'lastMsgAt':moment()[_0x8011('0x4e')](_0x8011('0x49')),'lastMsgDirection':'in'});}else{return _0x5a9be3;}}})[_0x8011('0x11')](function(_0x3543eb){_0x50116a['interaction']=_0x3543eb[_0x8011('0x3b')]({'plain':!![]});_0x50116a[_0x8011('0x4f')]['created']=_0x586ba4;return db[_0x8011('0x50')][_0x8011('0x51')]({'body':_0x80479c[_0x8011('0x29')][_0x8011('0x29')],'MailAccountId':_0x80479c[_0x8011('0x34')]['id'],'MailInteractionId':_0x3543eb['id'],'direction':'in','ContactId':_0x50116a['contact']['id'],'messageId':_0x80479c['body'][_0x8011('0x16')]['messageId'],'from':_0x80479c[_0x8011('0x29')][_0x8011('0x16')][_0x8011('0x30')],'to':_0x80479c[_0x8011('0x29')]['message']['to'],'cc':_0x80479c[_0x8011('0x29')][_0x8011('0x16')]['cc'],'subject':_0x80479c['body'][_0x8011('0x16')][_0x8011('0x47')],'attach':_0x80479c[_0x8011('0x29')]['message']['attach'],'Attachments':_0x80479c[_0x8011('0x29')][_0x8011('0x16')][_0x8011('0x52')],'originTo':_0x80479c[_0x8011('0x29')][_0x8011('0x16')][_0x8011('0x53')],'originCc':_0x80479c[_0x8011('0x29')][_0x8011('0x16')]['originCc'],'bcc':_0x80479c[_0x8011('0x29')][_0x8011('0x16')]['bcc'],'ChatWebsiteId':_0x80479c[_0x8011('0x29')][_0x8011('0x16')]['ChatWebsiteId']||null,'originChannel':_0x80479c[_0x8011('0x29')]['message'][_0x8011('0x54')]||_0x8011('0x55'),'ChatOfflineMessageId':_0x80479c[_0x8011('0x29')][_0x8011('0x16')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x8011('0x56')],'as':_0x8011('0x57')}]});})[_0x8011('0x11')](function(_0x308101){_0x50116a['message']=_0x308101;if(_0x50116a['interaction'][_0x8011('0x58')]){return db[_0x8011('0x59')]['find']({'attributes':['id','name'],'where':{'id':_0x50116a[_0x8011('0x4f')][_0x8011('0x58')]}})['then'](function(_0x2a7de5){if(_0x2a7de5){_0x50116a[_0x8011('0x3d')][_0x8011('0x5a')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x2a7de5[_0x8011('0x5b')]+','+(_0x50116a['account'][_0x8011('0x5c')]||0xa),'interval':_0x8011('0x5d')});}return respondWithRpcPromise(_0x8011('0x5e'),_0x8011('0x5f'),_0x50116a);});}return respondWithRpcPromise(_0x8011('0x5e'),_0x8011('0x5f'),_0x50116a);})['then'](function(_0xf7519f){_0x83274f(_0xf7519f);})['catch'](function(_0x1a8097){_0x1161d6(_0x1ae69c['error'](0x1f4,_0x1a8097['message']));});});};
\ No newline at end of file
+var _0xe505=['include','model','map','then','ShowMailAccount','body','mail','rawAttributes','createdAt','updatedAt','ListId','isNil','from','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','account','CmList','List','CmContact','DESC','MailApplication','MailServerOut','Smtp','get','omit','list','applications','priority','asc','autoclose','push','length','close','*,*,*,*','Contacts','create','contact','generate','messageId','subject','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','find','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','format','interaction','created','originCc','ChatOfflineMessageId','Attachment','Attachments','UserId','agent','name','Start','startRouting','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailAccount','findAll','options','raw','where','attributes','limit'];(function(_0x238c72,_0x42d60b){var _0x3961f2=function(_0xc40492){while(--_0xc40492){_0x238c72['push'](_0x238c72['shift']());}};_0x3961f2(++_0x42d60b);}(_0xe505,0x105));var _0x5e50=function(_0x98ee7c,_0x499bff){_0x98ee7c=_0x98ee7c-0x0;var _0xe4d709=_0xe505[_0x98ee7c];return _0xe4d709;};'use strict';var _=require('lodash');var util=require(_0x5e50('0x0'));var moment=require('moment');var BPromise=require(_0x5e50('0x1'));var rs=require(_0x5e50('0x2'));var fs=require('fs');var Redis=require(_0x5e50('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e50('0x4'));var logger=require(_0x5e50('0x5'))(_0x5e50('0x6'));var config=require(_0x5e50('0x7'));var jayson=require(_0x5e50('0x8'));var client=jayson[_0x5e50('0x9')][_0x5e50('0xa')]({'port':0x232c});config[_0x5e50('0xb')]=_[_0x5e50('0xc')](config[_0x5e50('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x5e50('0xd'))(new Redis(config[_0x5e50('0xb')]));require('./mailAccount.socket')[_0x5e50('0xe')](socket);function respondWithRpcPromise(_0xd1bc9e,_0x541621,_0x445b2e){return new BPromise(function(_0x228194,_0x2a832d){return client[_0x5e50('0xf')](_0xd1bc9e,_0x445b2e)['then'](function(_0x3dc1a9){logger[_0x5e50('0x10')](_0x5e50('0x11'),_0x541621,_0x5e50('0x12'));logger[_0x5e50('0x13')](_0x5e50('0x14'),_0x541621,'request\x20sent',JSON[_0x5e50('0x15')](_0x3dc1a9));if(_0x3dc1a9['error']){if(_0x3dc1a9[_0x5e50('0x16')][_0x5e50('0x17')]===0x1f4){logger['error'](_0x5e50('0x11'),_0x541621,_0x3dc1a9[_0x5e50('0x16')][_0x5e50('0x18')]);return _0x2a832d(_0x3dc1a9[_0x5e50('0x16')][_0x5e50('0x18')]);}logger[_0x5e50('0x16')](_0x5e50('0x11'),_0x541621,_0x3dc1a9[_0x5e50('0x16')][_0x5e50('0x18')]);return _0x228194(_0x3dc1a9[_0x5e50('0x16')][_0x5e50('0x18')]);}else{logger[_0x5e50('0x10')](_0x5e50('0x11'),_0x541621,'request\x20sent');_0x228194(_0x3dc1a9['result']['message']);}})[_0x5e50('0x19')](function(_0x56f150){logger[_0x5e50('0x16')]('MailAccount,\x20%s,\x20%s',_0x541621,_0x56f150);_0x2a832d(_0x56f150);});});}exports[_0x5e50('0x1a')]=function(_0x3eb5a2){var _0x33c680=this;return new Promise(function(_0x264494,_0x1c7dee){return db['MailAccount'][_0x5e50('0x1b')]({'raw':_0x3eb5a2[_0x5e50('0x1c')]?_0x3eb5a2['options'][_0x5e50('0x1d')]===undefined?!![]:![]:!![],'where':_0x3eb5a2[_0x5e50('0x1c')]?_0x3eb5a2['options'][_0x5e50('0x1e')]||null:null,'attributes':_0x3eb5a2['options']?_0x3eb5a2['options'][_0x5e50('0x1f')]||null:null,'limit':_0x3eb5a2[_0x5e50('0x1c')]?_0x3eb5a2[_0x5e50('0x1c')][_0x5e50('0x20')]||null:null,'include':_0x3eb5a2[_0x5e50('0x1c')]?_0x3eb5a2[_0x5e50('0x1c')][_0x5e50('0x21')]?_['map'](_0x3eb5a2['options'][_0x5e50('0x21')],function(_0x411a9a){return{'model':db[_0x411a9a[_0x5e50('0x22')]],'as':_0x411a9a['as'],'attributes':_0x411a9a['attributes'],'include':_0x411a9a[_0x5e50('0x21')]?_[_0x5e50('0x23')](_0x411a9a[_0x5e50('0x21')],function(_0x2a5d11){return{'model':db[_0x2a5d11['model']],'as':_0x2a5d11['as'],'attributes':_0x2a5d11[_0x5e50('0x1f')],'include':_0x2a5d11[_0x5e50('0x21')]?_['map'](_0x2a5d11[_0x5e50('0x21')],function(_0xc76277){return{'model':db[_0xc76277['model']],'as':_0xc76277['as'],'attributes':_0xc76277[_0x5e50('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5e50('0x24')](function(_0x1abf0a){logger[_0x5e50('0x10')](_0x5e50('0x1a'),_0x3eb5a2);logger[_0x5e50('0x13')](_0x5e50('0x1a'),_0x3eb5a2,JSON[_0x5e50('0x15')](_0x1abf0a));_0x264494(_0x1abf0a);})[_0x5e50('0x19')](function(_0x3aefda){logger[_0x5e50('0x16')](_0x5e50('0x1a'),_0x3aefda[_0x5e50('0x18')],_0x3eb5a2);_0x1c7dee(_0x33c680[_0x5e50('0x16')](0x1f4,_0x3aefda[_0x5e50('0x18')]));});});};exports[_0x5e50('0x25')]=function(_0xe65a49){var _0x5bf8d5=this;return new Promise(function(_0x3130a8,_0x5f085c){return db['MailAccount']['find']({'raw':_0xe65a49[_0x5e50('0x1c')]?_0xe65a49[_0x5e50('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0xe65a49['options']?_0xe65a49['options']['where']||null:null,'attributes':_0xe65a49[_0x5e50('0x1c')]?_0xe65a49[_0x5e50('0x1c')]['attributes']||null:null,'include':_0xe65a49[_0x5e50('0x1c')]?_0xe65a49[_0x5e50('0x1c')][_0x5e50('0x21')]?_[_0x5e50('0x23')](_0xe65a49[_0x5e50('0x1c')][_0x5e50('0x21')],function(_0x25ddd7){return{'model':db[_0x25ddd7[_0x5e50('0x22')]],'as':_0x25ddd7['as'],'attributes':_0x25ddd7[_0x5e50('0x1f')],'include':_0x25ddd7[_0x5e50('0x21')]?_[_0x5e50('0x23')](_0x25ddd7['include'],function(_0x14b3d4){return{'model':db[_0x14b3d4['model']],'as':_0x14b3d4['as'],'attributes':_0x14b3d4[_0x5e50('0x1f')],'include':_0x14b3d4[_0x5e50('0x21')]?_[_0x5e50('0x23')](_0x14b3d4[_0x5e50('0x21')],function(_0x4b015a){return{'model':db[_0x4b015a['model']],'as':_0x4b015a['as'],'attributes':_0x4b015a[_0x5e50('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5e50('0x24')](function(_0x43ed85){logger['info'](_0x5e50('0x25'),_0xe65a49);logger[_0x5e50('0x13')](_0x5e50('0x25'),_0xe65a49,JSON[_0x5e50('0x15')](_0x43ed85));_0x3130a8(_0x43ed85);})[_0x5e50('0x19')](function(_0x51e4fa){logger[_0x5e50('0x16')]('ShowMailAccount',_0x51e4fa[_0x5e50('0x18')],_0xe65a49);_0x5f085c(_0x5bf8d5['error'](0x1f4,_0x51e4fa[_0x5e50('0x18')]));});});};exports['NotifyMailAccount']=function(_0x5b0e76){var _0x257f2c=this;return new Promise(function(_0x3cf304,_0x268fcb){var _0x42cbe7={'body':_0x5b0e76[_0x5e50('0x26')],'channel':_0x5e50('0x27')};var _0x3e00d0=_['difference'](_['keys'](db['CmContact'][_0x5e50('0x28')]),[_0x5e50('0x29'),_0x5e50('0x2a'),'CompanyId',_0x5e50('0x2b')]);var _0x465ffb=![];if(_0x5b0e76[_0x5e50('0x26')]['id']){delete _0x5b0e76['body']['id'];}if(_[_0x5e50('0x2c')](_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x2d')])){return _0x268fcb(_0x257f2c[_0x5e50('0x16')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x5e50('0x2c')](_0x5b0e76[_0x5e50('0x26')]['body'])||_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x26')]===''){return _0x268fcb(_0x257f2c['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x5e50('0x2c')](_0x5b0e76[_0x5e50('0x26')]['mapKey'])){return _0x268fcb(_0x257f2c[_0x5e50('0x16')](0x1f4,_0x5e50('0x2e')+_0x3e00d0));}if(!_[_0x5e50('0x2f')](_0x3e00d0,_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x30')])){return _0x268fcb(_0x257f2c[_0x5e50('0x16')](0x1f4,_0x5e50('0x31')+_0x3e00d0));}var _0x407e2d={};_0x407e2d[_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x30')]]=_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x2d')];return db[_0x5e50('0x32')]['find']({'where':{'id':_0x5b0e76[_0x5e50('0x33')]['id']},'include':[{'model':db[_0x5e50('0x34')],'as':_0x5e50('0x35'),'include':[{'model':db[_0x5e50('0x36')],'as':'Contacts','where':_0x407e2d,'limit':0x1,'order':[[_0x5e50('0x2a'),_0x5e50('0x37')]]}]},{'model':db[_0x5e50('0x38')],'as':'Applications'},{'model':db[_0x5e50('0x39')],'as':_0x5e50('0x3a')}]})[_0x5e50('0x24')](function(_0x584b27){if(_0x584b27&&_0x584b27[_0x5e50('0x35')]){var _0x11b8b4=_0x584b27[_0x5e50('0x3b')]({'plain':!![]});_0x42cbe7[_0x5e50('0x33')]=_[_0x5e50('0x3c')](_0x11b8b4,['Applications',_0x5e50('0x35')]);_0x42cbe7['applications']=_0x11b8b4['Applications'];_0x42cbe7[_0x5e50('0x3d')]=_0x11b8b4[_0x5e50('0x35')];_0x42cbe7[_0x5e50('0x3e')]=_['orderBy'](_0x42cbe7[_0x5e50('0x3e')],[_0x5e50('0x3f')],[_0x5e50('0x40')]);if(_0x42cbe7['account']&&_0x42cbe7[_0x5e50('0x33')][_0x5e50('0x41')]){_0x42cbe7[_0x5e50('0x3e')][_0x5e50('0x42')]({'id':0x0,'priority':_0x42cbe7[_0x5e50('0x3e')][_0x5e50('0x43')]+0x1,'app':_0x5e50('0x44'),'appdata':_0x5e50('0x41'),'interval':_0x5e50('0x45')});}if(_0x42cbe7['account']['Applications']){delete _0x42cbe7['account']['Applications'];}if(_0x42cbe7[_0x5e50('0x33')]['List']){delete _0x42cbe7[_0x5e50('0x33')][_0x5e50('0x35')];}if(_0x11b8b4[_0x5e50('0x35')]['Contacts'][_0x5e50('0x43')]){return _0x11b8b4[_0x5e50('0x35')][_0x5e50('0x46')][0x0];}var _0x58204d=_[_0x5e50('0xc')](_0x5b0e76[_0x5e50('0x26')],{'firstName':_0x5b0e76['body'][_0x5e50('0x2d')],'ListId':_0x11b8b4[_0x5e50('0x2b')]});_0x58204d[_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x30')]]=_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x2d')];return db[_0x5e50('0x36')][_0x5e50('0x47')](_0x58204d);}else{throw new Error('List\x20not\x20found');}})['then'](function(_0x5de77a){_0x42cbe7[_0x5e50('0x48')]=_0x5de77a;if(_0x5de77a){if(!_0x5b0e76['body'][_0x5e50('0x18')]['messageId']){_0x5b0e76['body']['message']['messageId']=rs[_0x5e50('0x49')]()+'\x20'+_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x18')][_0x5e50('0x2d')];}var _0x10f8a2={'ContactId':_0x5de77a['id'],'MailAccountId':_0x5b0e76[_0x5e50('0x33')]['id'],'inReplyTo':_0x5b0e76['body'][_0x5e50('0x18')][_0x5e50('0x4a')],'to':_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x18')][_0x5e50('0x2d')],'cc':_0x5b0e76[_0x5e50('0x26')]['message']['cc'],'subject':_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x18')][_0x5e50('0x4b')],'attach':_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x18')][_0x5e50('0x4c')],'lastMsgAt':moment()['format'](_0x5e50('0x4d')),'lastMsgDirection':'in'};return db[_0x5e50('0x4e')][_0x5e50('0x4f')]({'where':{'closed':![],'MailAccountId':_0x5b0e76[_0x5e50('0x33')]['id']},'include':[{'model':db[_0x5e50('0x50')],'as':_0x5e50('0x51'),'attributes':[_0x5e50('0x4a')],'where':{'messageId':_0x5b0e76['body'][_0x5e50('0x18')][_0x5e50('0x52')]}}]})[_0x5e50('0x24')](function(_0x52c9e4){if(_0x52c9e4){return[_0x52c9e4,![]];}return db[_0x5e50('0x4e')][_0x5e50('0x47')](_0x10f8a2)[_0x5e50('0x24')](function(_0xd701b0){return[_0xd701b0,!![]];});});}else{throw new Error(_0x5e50('0x53'));}})[_0x5e50('0x54')](function(_0x4ef37d,_0x43590d){if(_0x4ef37d){_0x465ffb=_0x43590d;if(!_0x43590d){return _0x4ef37d[_0x5e50('0x55')]({'inReplyTo':_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x18')][_0x5e50('0x4a')],'to':_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x18')][_0x5e50('0x2d')],'cc':_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x18')]['cc'],'subject':_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x18')][_0x5e50('0x4b')],'attach':_0x4ef37d[_0x5e50('0x4c')]?_0x4ef37d[_0x5e50('0x4c')]:_0x5b0e76['body'][_0x5e50('0x18')][_0x5e50('0x4c')],'substatus':null,'substatusAt':moment()[_0x5e50('0x56')](_0x5e50('0x4d')),'lastMsgAt':moment()[_0x5e50('0x56')](_0x5e50('0x4d')),'lastMsgDirection':'in'});}else{return _0x4ef37d;}}})['then'](function(_0x5afe89){_0x42cbe7[_0x5e50('0x57')]=_0x5afe89[_0x5e50('0x3b')]({'plain':!![]});_0x42cbe7['interaction'][_0x5e50('0x58')]=_0x465ffb;return db[_0x5e50('0x50')][_0x5e50('0x47')]({'body':_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x26')],'MailAccountId':_0x5b0e76[_0x5e50('0x33')]['id'],'MailInteractionId':_0x5afe89['id'],'direction':'in','ContactId':_0x42cbe7[_0x5e50('0x48')]['id'],'messageId':_0x5b0e76[_0x5e50('0x26')]['message'][_0x5e50('0x4a')],'from':_0x5b0e76['body'][_0x5e50('0x18')][_0x5e50('0x2d')],'to':_0x5b0e76['body'][_0x5e50('0x18')]['to'],'cc':_0x5b0e76['body'][_0x5e50('0x18')]['cc'],'subject':_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x18')][_0x5e50('0x4b')],'attach':_0x5b0e76[_0x5e50('0x26')]['message'][_0x5e50('0x4c')],'Attachments':_0x5b0e76['body'][_0x5e50('0x18')]['attachments'],'originTo':_0x5b0e76['body'][_0x5e50('0x18')]['originTo'],'originCc':_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x18')][_0x5e50('0x59')],'bcc':_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x18')]['bcc'],'ChatWebsiteId':_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x18')]['ChatWebsiteId']||null,'originChannel':_0x5b0e76['body'][_0x5e50('0x18')]['originChannel']||'Email','ChatOfflineMessageId':_0x5b0e76[_0x5e50('0x26')][_0x5e50('0x18')][_0x5e50('0x5a')]||null},{'include':[{'model':db[_0x5e50('0x5b')],'as':_0x5e50('0x5c')}]});})[_0x5e50('0x24')](function(_0x475b48){_0x42cbe7['message']=_0x475b48;if(_0x42cbe7[_0x5e50('0x57')][_0x5e50('0x5d')]){return db['User'][_0x5e50('0x4f')]({'attributes':['id','name'],'where':{'id':_0x42cbe7[_0x5e50('0x57')]['UserId']}})[_0x5e50('0x24')](function(_0x2a6a78){if(_0x2a6a78){_0x42cbe7[_0x5e50('0x3e')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5e50('0x5e'),'appdata':_0x2a6a78[_0x5e50('0x5f')]+','+(_0x42cbe7[_0x5e50('0x33')]['waitForTheAssignedAgent']||0xa),'interval':_0x5e50('0x45')});}return respondWithRpcPromise(_0x5e50('0x60'),_0x5e50('0x61'),_0x42cbe7);});}return respondWithRpcPromise(_0x5e50('0x60'),_0x5e50('0x61'),_0x42cbe7);})['then'](function(_0x55c7fb){_0x3cf304(_0x55c7fb);})[_0x5e50('0x19')](function(_0x358150){_0x268fcb(_0x257f2c[_0x5e50('0x16')](0x1f4,_0x358150['message']));});});};
\ No newline at end of file
index ffcf767..8c22865 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa149=['./mailAccount.events','save','remove','update','emit','removeListener','register','length','mailAccount:'];(function(_0x1deba7,_0x30f270){var _0x2dcc31=function(_0x57a708){while(--_0x57a708){_0x1deba7['push'](_0x1deba7['shift']());}};_0x2dcc31(++_0x30f270);}(_0xa149,0x18c));var _0x9a14=function(_0x7cc01d,_0x564117){_0x7cc01d=_0x7cc01d-0x0;var _0x560f5a=_0xa149[_0x7cc01d];return _0x560f5a;};'use strict';var MailAccountEvents=require(_0x9a14('0x0'));var events=[_0x9a14('0x1'),_0x9a14('0x2'),_0x9a14('0x3')];function createListener(_0x45983b,_0x46ea98){return function(_0x2bb2ac){_0x46ea98[_0x9a14('0x4')](_0x45983b,_0x2bb2ac);};}function removeListener(_0x3b061a,_0x4a8f02){return function(){MailAccountEvents[_0x9a14('0x5')](_0x3b061a,_0x4a8f02);};}exports[_0x9a14('0x6')]=function(_0x5abb12){for(var _0x417648=0x0,_0x3beb93=events[_0x9a14('0x7')];_0x417648<_0x3beb93;_0x417648++){var _0x17d2e5=events[_0x417648];var _0x109f69=createListener(_0x9a14('0x8')+_0x17d2e5,_0x5abb12);MailAccountEvents['on'](_0x17d2e5,_0x109f69);}};
\ No newline at end of file
+var _0x4d00=['removeListener','register','length','mailAccount:','./mailAccount.events','save','update','emit'];(function(_0x2c1e7a,_0x155f86){var _0xcacb4f=function(_0x2b2eb3){while(--_0x2b2eb3){_0x2c1e7a['push'](_0x2c1e7a['shift']());}};_0xcacb4f(++_0x155f86);}(_0x4d00,0x7c));var _0x04d0=function(_0x955836,_0x2fc415){_0x955836=_0x955836-0x0;var _0x8de282=_0x4d00[_0x955836];return _0x8de282;};'use strict';var MailAccountEvents=require(_0x04d0('0x0'));var events=[_0x04d0('0x1'),'remove',_0x04d0('0x2')];function createListener(_0x381b73,_0x38c783){return function(_0x3c3f50){_0x38c783[_0x04d0('0x3')](_0x381b73,_0x3c3f50);};}function removeListener(_0x3307ff,_0xe00684){return function(){MailAccountEvents[_0x04d0('0x4')](_0x3307ff,_0xe00684);};}exports[_0x04d0('0x5')]=function(_0x5d6246){for(var _0x11608c=0x0,_0x1b652a=events[_0x04d0('0x6')];_0x11608c<_0x1b652a;_0x11608c++){var _0xbc896=events[_0x11608c];var _0x5c1cdb=createListener(_0x04d0('0x7')+_0xbc896,_0x5d6246);MailAccountEvents['on'](_0xbc896,_0x5c1cdb);}};
\ No newline at end of file
index 61dbb01..28da13d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd7d=['/:id','show','isAuthenticated','update','delete','destroy','exports','multer','connect-timeout','Router','../../components/interaction/service','./mailApplication.controller','get'];(function(_0x70b5cb,_0x2fe319){var _0x353b2f=function(_0x42ed17){while(--_0x42ed17){_0x70b5cb['push'](_0x70b5cb['shift']());}};_0x353b2f(++_0x2fe319);}(_0xcd7d,0x180));var _0xdcd7=function(_0x5527c3,_0x571434){_0x5527c3=_0x5527c3-0x0;var _0xed3601=_0xcd7d[_0x5527c3];return _0xed3601;};'use strict';var multer=require(_0xdcd7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xdcd7('0x1'));var express=require('express');var router=express[_0xdcd7('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xdcd7('0x3'));var config=require('../../config/environment');var controller=require(_0xdcd7('0x4'));router[_0xdcd7('0x5')](_0xdcd7('0x6'),auth['isAuthenticated'](),controller[_0xdcd7('0x7')]);router['put'](_0xdcd7('0x6'),auth[_0xdcd7('0x8')](),controller[_0xdcd7('0x9')]);router[_0xdcd7('0xa')](_0xdcd7('0x6'),auth[_0xdcd7('0x8')](),controller[_0xdcd7('0xb')]);module[_0xdcd7('0xc')]=router;
\ No newline at end of file
+var _0x14ca=['util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailApplication.controller','isAuthenticated','show','put','/:id','delete','destroy','exports','multer'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0x14ca,0x1cf));var _0xa14c=function(_0x41c78d,_0x4c3628){_0x41c78d=_0x41c78d-0x0;var _0x26d028=_0x14ca[_0x41c78d];return _0x26d028;};'use strict';var multer=require(_0xa14c('0x0'));var util=require(_0xa14c('0x1'));var path=require(_0xa14c('0x2'));var timeout=require(_0xa14c('0x3'));var express=require('express');var router=express[_0xa14c('0x4')]();var fs_extra=require(_0xa14c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa14c('0x6'));var config=require(_0xa14c('0x7'));var controller=require(_0xa14c('0x8'));router['get']('/:id',auth[_0xa14c('0x9')](),controller[_0xa14c('0xa')]);router[_0xa14c('0xb')](_0xa14c('0xc'),auth[_0xa14c('0x9')](),controller['update']);router[_0xa14c('0xd')](_0xa14c('0xc'),auth['isAuthenticated'](),controller[_0xa14c('0xe')]);module[_0xa14c('0xf')]=router;
\ No newline at end of file
index f375cee..d15e795 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7215=['STRING','noop','TEXT','sequelize','exports'];(function(_0x3ebda8,_0x5a494d){var _0x2208ba=function(_0x5cbe3b){while(--_0x5cbe3b){_0x3ebda8['push'](_0x3ebda8['shift']());}};_0x2208ba(++_0x5a494d);}(_0x7215,0xf3));var _0x5721=function(_0x3f8084,_0x1175ea){_0x3f8084=_0x3f8084-0x0;var _0x1288aa=_0x7215[_0x3f8084];return _0x1288aa;};'use strict';var Sequelize=require(_0x5721('0x0'));module[_0x5721('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x5721('0x2')],'allowNull':![],'defaultValue':_0x5721('0x3')},'appdata':{'type':Sequelize[_0x5721('0x4')]()},'description':{'type':Sequelize[_0x5721('0x2')]},'interval':{'type':Sequelize[_0x5721('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0xe604=['exports','INTEGER','STRING','noop','sequelize'];(function(_0x59056b,_0x4f5327){var _0x582465=function(_0x30233b){while(--_0x30233b){_0x59056b['push'](_0x59056b['shift']());}};_0x582465(++_0x4f5327);}(_0xe604,0x16c));var _0x4e60=function(_0x383750,_0x57dd10){_0x383750=_0x383750-0x0;var _0xff9d0a=_0xe604[_0x383750];return _0xff9d0a;};'use strict';var Sequelize=require(_0x4e60('0x0'));module[_0x4e60('0x1')]={'priority':{'type':Sequelize[_0x4e60('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4e60('0x3')],'allowNull':![],'defaultValue':_0x4e60('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index 1be55a5..7767e61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbdb7=['update','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','attributes','length','includeAll','merge','find','then','body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save'];(function(_0x43de22,_0x1eced6){var _0x4b15ee=function(_0x6e36da){while(--_0x6e36da){_0x43de22['push'](_0x43de22['shift']());}};_0x4b15ee(++_0x1eced6);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x5dbc6a,_0x55c7c6){_0x5dbc6a=_0x5dbc6a-0x0;var _0x33c9c7=_0xbdb7[_0x5dbc6a];return _0x33c9c7;};'use strict';var emlformat=require(_0x7bdb('0x0'));var rimraf=require(_0x7bdb('0x1'));var zipdir=require(_0x7bdb('0x2'));var jsonpatch=require(_0x7bdb('0x3'));var rp=require(_0x7bdb('0x4'));var moment=require(_0x7bdb('0x5'));var BPromise=require(_0x7bdb('0x6'));var Mustache=require(_0x7bdb('0x7'));var util=require(_0x7bdb('0x8'));var path=require('path');var sox=require(_0x7bdb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bdb('0xa'));var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7bdb('0x16'))['db'];function respondWithStatusCode(_0x25e3cb,_0x496613){_0x496613=_0x496613||0xcc;return function(_0x8d74ff){if(_0x8d74ff){return _0x25e3cb['sendStatus'](_0x496613);}return _0x25e3cb['status'](_0x496613)[_0x7bdb('0x17')]();};}function respondWithResult(_0x46dd4a,_0x4fd91a){_0x4fd91a=_0x4fd91a||0xc8;return function(_0x50eeca){if(_0x50eeca){return _0x46dd4a['status'](_0x4fd91a)[_0x7bdb('0x18')](_0x50eeca);}};}function respondWithFilteredResult(_0x195b2e,_0xe9919f){return function(_0x25d417){if(_0x25d417){var _0x31c909=typeof _0xe9919f[_0x7bdb('0x19')]===_0x7bdb('0x1a')&&typeof _0xe9919f[_0x7bdb('0x1b')]==='undefined';var _0x1c5750=_0x25d417[_0x7bdb('0x1c')];var _0x5723f4=_0x31c909?0x0:_0xe9919f[_0x7bdb('0x19')];var _0x4ffd4b=_0x31c909?_0x25d417[_0x7bdb('0x1c')]:_0xe9919f[_0x7bdb('0x19')]+_0xe9919f['limit'];var _0x3e5f8e;if(_0x4ffd4b>=_0x1c5750){_0x4ffd4b=_0x1c5750;_0x3e5f8e=0xc8;}else{_0x3e5f8e=0xce;}_0x195b2e[_0x7bdb('0x1d')](_0x3e5f8e);return _0x195b2e[_0x7bdb('0x1e')](_0x7bdb('0x1f'),_0x5723f4+'-'+_0x4ffd4b+'/'+_0x1c5750)[_0x7bdb('0x18')](_0x25d417);}return null;};}function patchUpdates(_0x5bfc35){return function(_0x49f353){try{jsonpatch[_0x7bdb('0x20')](_0x49f353,_0x5bfc35,!![]);}catch(_0xcb25f2){return BPromise['reject'](_0xcb25f2);}return _0x49f353[_0x7bdb('0x21')]();};}function saveUpdates(_0x118ea1,_0x346c72){return function(_0x3f53e7){if(_0x3f53e7){return _0x3f53e7[_0x7bdb('0x22')](_0x118ea1)['then'](function(_0x1d37ac){return _0x1d37ac;});}return null;};}function removeEntity(_0xdad53d,_0x40c447){return function(_0x3a456f){if(_0x3a456f){return _0x3a456f['destroy']()['then'](function(){_0xdad53d[_0x7bdb('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47abaf,_0x4a9e02){return function(_0x2abef6){if(!_0x2abef6){_0x47abaf['sendStatus'](0x194);}return _0x2abef6;};}function handleError(_0x2b14bc,_0x72ba69){_0x72ba69=_0x72ba69||0x1f4;return function(_0x3ec129){logger[_0x7bdb('0x23')](_0x3ec129[_0x7bdb('0x24')]);if(_0x3ec129['name']){delete _0x3ec129[_0x7bdb('0x25')];}_0x2b14bc[_0x7bdb('0x1d')](_0x72ba69)[_0x7bdb('0x26')](_0x3ec129);};}exports[_0x7bdb('0x27')]=function(_0x371e8a,_0x2e8e65){var _0x1e9996={'raw':!![],'where':{'id':_0x371e8a[_0x7bdb('0x28')]['id']}},_0xd2d7be={};_0xd2d7be[_0x7bdb('0x29')]=_[_0x7bdb('0x2a')](db[_0x7bdb('0x2b')]['rawAttributes']);_0xd2d7be[_0x7bdb('0x2c')]=_[_0x7bdb('0x2a')](_0x371e8a[_0x7bdb('0x2c')]);_0xd2d7be[_0x7bdb('0x2d')]=_[_0x7bdb('0x2e')](_0xd2d7be['model'],_0xd2d7be[_0x7bdb('0x2c')]);_0x1e9996[_0x7bdb('0x2f')]=_[_0x7bdb('0x2e')](_0xd2d7be[_0x7bdb('0x29')],qs['fields'](_0x371e8a['query']['fields']));_0x1e9996[_0x7bdb('0x2f')]=_0x1e9996['attributes'][_0x7bdb('0x30')]?_0x1e9996['attributes']:_0xd2d7be[_0x7bdb('0x29')];if(_0x371e8a[_0x7bdb('0x2c')][_0x7bdb('0x31')]){_0x1e9996['include']=[{'all':!![]}];}_0x1e9996=_[_0x7bdb('0x32')]({},_0x1e9996,_0x371e8a['options']);return db['MailApplication'][_0x7bdb('0x33')](_0x1e9996)['then'](handleEntityNotFound(_0x2e8e65,null))[_0x7bdb('0x34')](respondWithResult(_0x2e8e65,null))['catch'](handleError(_0x2e8e65,null));};exports['update']=function(_0x206c26,_0x353b26){if(_0x206c26[_0x7bdb('0x35')]['id']){delete _0x206c26[_0x7bdb('0x35')]['id'];}return db[_0x7bdb('0x2b')][_0x7bdb('0x33')]({'where':{'id':_0x206c26['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x353b26,null))[_0x7bdb('0x34')](saveUpdates(_0x206c26[_0x7bdb('0x35')],null))[_0x7bdb('0x34')](respondWithResult(_0x353b26,null))[_0x7bdb('0x36')](handleError(_0x353b26,null));};exports[_0x7bdb('0x37')]=function(_0x228340,_0x2587af){return db[_0x7bdb('0x2b')]['find']({'where':{'id':_0x228340['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x2587af,null))[_0x7bdb('0x34')](removeEntity(_0x2587af,null))[_0x7bdb('0x36')](handleError(_0x2587af,null));};
\ No newline at end of file
+var _0xcb91=['send','show','params','keys','rawAttributes','query','intersection','attributes','fields','length','model','includeAll','include','merge','options','MailApplication','find','catch','body','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name'];(function(_0x37522a,_0x303b60){var _0x4dcf7f=function(_0x1f4037){while(--_0x1f4037){_0x37522a['push'](_0x37522a['shift']());}};_0x4dcf7f(++_0x303b60);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xc69f39,_0x2ce0cf){_0xc69f39=_0xc69f39-0x0;var _0x93be41=_0xcb91[_0xc69f39];return _0x93be41;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1cb9('0x0'));var jsonpatch=require(_0x1cb9('0x1'));var rp=require(_0x1cb9('0x2'));var moment=require(_0x1cb9('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1cb9('0x4'));var util=require(_0x1cb9('0x5'));var path=require('path');var sox=require(_0x1cb9('0x6'));var csv=require(_0x1cb9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1cb9('0x8'));var _=require(_0x1cb9('0x9'));var squel=require('squel');var crypto=require(_0x1cb9('0xa'));var jsforce=require(_0x1cb9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1cb9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1cb9('0xc'));var authService=require(_0x1cb9('0xd'));var qs=require(_0x1cb9('0xe'));var as=require(_0x1cb9('0xf'));var hardwareService=require(_0x1cb9('0x10'));var logger=require('../../config/logger')(_0x1cb9('0x11'));var utils=require(_0x1cb9('0x12'));var config=require(_0x1cb9('0x13'));var licenseUtil=require(_0x1cb9('0x14'));var db=require(_0x1cb9('0x15'))['db'];function respondWithStatusCode(_0x5445e1,_0x5e3c19){_0x5e3c19=_0x5e3c19||0xcc;return function(_0x59dec3){if(_0x59dec3){return _0x5445e1[_0x1cb9('0x16')](_0x5e3c19);}return _0x5445e1[_0x1cb9('0x17')](_0x5e3c19)[_0x1cb9('0x18')]();};}function respondWithResult(_0x1c714f,_0x56884d){_0x56884d=_0x56884d||0xc8;return function(_0x397727){if(_0x397727){return _0x1c714f[_0x1cb9('0x17')](_0x56884d)[_0x1cb9('0x19')](_0x397727);}};}function respondWithFilteredResult(_0x8dfa55,_0x3e2d11){return function(_0x5806d8){if(_0x5806d8){var _0x5572cb=typeof _0x3e2d11[_0x1cb9('0x1a')]===_0x1cb9('0x1b')&&typeof _0x3e2d11[_0x1cb9('0x1c')]===_0x1cb9('0x1b');var _0x3e21e0=_0x5806d8[_0x1cb9('0x1d')];var _0x23d3a9=_0x5572cb?0x0:_0x3e2d11['offset'];var _0x479d43=_0x5572cb?_0x5806d8[_0x1cb9('0x1d')]:_0x3e2d11[_0x1cb9('0x1a')]+_0x3e2d11[_0x1cb9('0x1c')];var _0x31481a;if(_0x479d43>=_0x3e21e0){_0x479d43=_0x3e21e0;_0x31481a=0xc8;}else{_0x31481a=0xce;}_0x8dfa55[_0x1cb9('0x17')](_0x31481a);return _0x8dfa55[_0x1cb9('0x1e')](_0x1cb9('0x1f'),_0x23d3a9+'-'+_0x479d43+'/'+_0x3e21e0)['json'](_0x5806d8);}return null;};}function patchUpdates(_0x559bcc){return function(_0x1a5a72){try{jsonpatch['apply'](_0x1a5a72,_0x559bcc,!![]);}catch(_0x4750b1){return BPromise[_0x1cb9('0x20')](_0x4750b1);}return _0x1a5a72['save']();};}function saveUpdates(_0x599275,_0x2e3854){return function(_0x325637){if(_0x325637){return _0x325637[_0x1cb9('0x21')](_0x599275)[_0x1cb9('0x22')](function(_0x45b8d3){return _0x45b8d3;});}return null;};}function removeEntity(_0x27db16,_0x59ebea){return function(_0x55b232){if(_0x55b232){return _0x55b232[_0x1cb9('0x23')]()['then'](function(){_0x27db16[_0x1cb9('0x17')](0xcc)[_0x1cb9('0x18')]();});}};}function handleEntityNotFound(_0x69b4c8,_0x44d3c4){return function(_0x43a100){if(!_0x43a100){_0x69b4c8['sendStatus'](0x194);}return _0x43a100;};}function handleError(_0x195f16,_0x9df250){_0x9df250=_0x9df250||0x1f4;return function(_0x4c8d76){logger[_0x1cb9('0x24')](_0x4c8d76[_0x1cb9('0x25')]);if(_0x4c8d76[_0x1cb9('0x26')]){delete _0x4c8d76[_0x1cb9('0x26')];}_0x195f16[_0x1cb9('0x17')](_0x9df250)[_0x1cb9('0x27')](_0x4c8d76);};}exports[_0x1cb9('0x28')]=function(_0xb644b3,_0x41e5c2){var _0x9de64b={'raw':!![],'where':{'id':_0xb644b3[_0x1cb9('0x29')]['id']}},_0x48888d={};_0x48888d['model']=_[_0x1cb9('0x2a')](db['MailApplication'][_0x1cb9('0x2b')]);_0x48888d[_0x1cb9('0x2c')]=_[_0x1cb9('0x2a')](_0xb644b3[_0x1cb9('0x2c')]);_0x48888d['filters']=_[_0x1cb9('0x2d')](_0x48888d['model'],_0x48888d[_0x1cb9('0x2c')]);_0x9de64b[_0x1cb9('0x2e')]=_[_0x1cb9('0x2d')](_0x48888d['model'],qs[_0x1cb9('0x2f')](_0xb644b3['query'][_0x1cb9('0x2f')]));_0x9de64b['attributes']=_0x9de64b[_0x1cb9('0x2e')][_0x1cb9('0x30')]?_0x9de64b[_0x1cb9('0x2e')]:_0x48888d[_0x1cb9('0x31')];if(_0xb644b3['query'][_0x1cb9('0x32')]){_0x9de64b[_0x1cb9('0x33')]=[{'all':!![]}];}_0x9de64b=_[_0x1cb9('0x34')]({},_0x9de64b,_0xb644b3[_0x1cb9('0x35')]);return db[_0x1cb9('0x36')][_0x1cb9('0x37')](_0x9de64b)[_0x1cb9('0x22')](handleEntityNotFound(_0x41e5c2,null))[_0x1cb9('0x22')](respondWithResult(_0x41e5c2,null))[_0x1cb9('0x38')](handleError(_0x41e5c2,null));};exports[_0x1cb9('0x21')]=function(_0x294eec,_0x26b950){if(_0x294eec[_0x1cb9('0x39')]['id']){delete _0x294eec['body']['id'];}return db['MailApplication'][_0x1cb9('0x37')]({'where':{'id':_0x294eec[_0x1cb9('0x29')]['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x26b950,null))[_0x1cb9('0x22')](saveUpdates(_0x294eec[_0x1cb9('0x39')],null))[_0x1cb9('0x22')](respondWithResult(_0x26b950,null))[_0x1cb9('0x38')](handleError(_0x26b950,null));};exports[_0x1cb9('0x23')]=function(_0x4d3e39,_0x2aa59b){return db[_0x1cb9('0x36')][_0x1cb9('0x37')]({'where':{'id':_0x4d3e39['params']['id']}})[_0x1cb9('0x22')](handleEntityNotFound(_0x2aa59b,null))['then'](removeEntity(_0x2aa59b,null))[_0x1cb9('0x38')](handleError(_0x2aa59b,null));};
\ No newline at end of file
index 27b013c..615dd46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8010=['rimraf','./mailApplication.attributes','exports','define','MailApplication','mail_applications','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x30ae2c,_0x4d5adf){var _0x57c603=function(_0x4da449){while(--_0x4da449){_0x30ae2c['push'](_0x30ae2c['shift']());}};_0x57c603(++_0x4d5adf);}(_0x8010,0x10a));var _0x0801=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8010[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x0801('0x0'));var logger=require(_0x0801('0x1'))(_0x0801('0x2'));var moment=require(_0x0801('0x3'));var BPromise=require(_0x0801('0x4'));var rp=require(_0x0801('0x5'));var fs=require('fs');var path=require(_0x0801('0x6'));var rimraf=require(_0x0801('0x7'));var config=require('../../config/environment');var attributes=require(_0x0801('0x8'));module[_0x0801('0x9')]=function(_0x376272,_0x494779){return _0x376272[_0x0801('0xa')](_0x0801('0xb'),attributes,{'tableName':_0x0801('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x1090=['./mailApplication.attributes','exports','MailApplication','mail_applications','utf8mb4','lodash','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x9bdad1,_0x1c715b){var _0x5ed47e=function(_0x449ea9){while(--_0x449ea9){_0x9bdad1['push'](_0x9bdad1['shift']());}};_0x5ed47e(++_0x1c715b);}(_0x1090,0x68));var _0x0109=function(_0x3e251f,_0x3347f0){_0x3e251f=_0x3e251f-0x0;var _0x49a26e=_0x1090[_0x3e251f];return _0x49a26e;};'use strict';var _=require(_0x0109('0x0'));var util=require('util');var logger=require(_0x0109('0x1'))(_0x0109('0x2'));var moment=require('moment');var BPromise=require(_0x0109('0x3'));var rp=require(_0x0109('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0109('0x5'));var config=require('../../config/environment');var attributes=require(_0x0109('0x6'));module[_0x0109('0x7')]=function(_0x421c84,_0x3fbad3){return _0x421c84['define'](_0x0109('0x8'),attributes,{'tableName':_0x0109('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0109('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index dc6c3a2..e1b4458 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf938=['moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','MailApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','UpdateMailApplication','MailApplication','update','options','raw','util'];(function(_0x3c0986,_0x1e284b){var _0x11c7b1=function(_0x588e62){while(--_0x588e62){_0x3c0986['push'](_0x3c0986['shift']());}};_0x11c7b1(++_0x1e284b);}(_0xf938,0x86));var _0x8f93=function(_0x426dd2,_0x4b0012){_0x426dd2=_0x426dd2-0x0;var _0x4bc76c=_0xf938[_0x426dd2];return _0x4bc76c;};'use strict';var _=require('lodash');var util=require(_0x8f93('0x0'));var moment=require(_0x8f93('0x1'));var BPromise=require('bluebird');var rs=require(_0x8f93('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f93('0x3'))['db'];var utils=require(_0x8f93('0x4'));var logger=require(_0x8f93('0x5'))('rpc');var config=require(_0x8f93('0x6'));var jayson=require(_0x8f93('0x7'));var client=jayson[_0x8f93('0x8')][_0x8f93('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x337804,_0x18e882,_0x2752b2){return new BPromise(function(_0x2a242c,_0x53aebc){return client[_0x8f93('0xa')](_0x337804,_0x2752b2)[_0x8f93('0xb')](function(_0x518c93){logger['info'](_0x8f93('0xc'),_0x18e882,'request\x20sent');logger[_0x8f93('0xd')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x18e882,_0x8f93('0xe'),JSON[_0x8f93('0xf')](_0x518c93));if(_0x518c93[_0x8f93('0x10')]){if(_0x518c93[_0x8f93('0x10')][_0x8f93('0x11')]===0x1f4){logger[_0x8f93('0x10')](_0x8f93('0xc'),_0x18e882,_0x518c93[_0x8f93('0x10')][_0x8f93('0x12')]);return _0x53aebc(_0x518c93[_0x8f93('0x10')]['message']);}logger[_0x8f93('0x10')](_0x8f93('0xc'),_0x18e882,_0x518c93[_0x8f93('0x10')][_0x8f93('0x12')]);return _0x2a242c(_0x518c93[_0x8f93('0x10')][_0x8f93('0x12')]);}else{logger[_0x8f93('0x13')]('MailApplication,\x20%s,\x20%s',_0x18e882,_0x8f93('0xe'));_0x2a242c(_0x518c93[_0x8f93('0x14')][_0x8f93('0x12')]);}})[_0x8f93('0x15')](function(_0x571ac6){logger['error'](_0x8f93('0xc'),_0x18e882,_0x571ac6);_0x53aebc(_0x571ac6);});});}exports[_0x8f93('0x16')]=function(_0x3a0209){var _0x479ed5=this;return new Promise(function(_0x1023b5,_0x35ad09){return db[_0x8f93('0x17')][_0x8f93('0x18')](_0x3a0209['body'],{'raw':_0x3a0209['options']?_0x3a0209[_0x8f93('0x19')][_0x8f93('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a0209['options']?_0x3a0209[_0x8f93('0x19')]['where']||null:null,'attributes':_0x3a0209['options']?_0x3a0209[_0x8f93('0x19')]['attributes']||null:null,'limit':_0x3a0209[_0x8f93('0x19')]?_0x3a0209[_0x8f93('0x19')]['limit']||null:null})['then'](function(_0x6ae32b){logger['info'](_0x8f93('0x16'),_0x3a0209);logger['debug'](_0x8f93('0x16'),_0x3a0209,JSON[_0x8f93('0xf')](_0x6ae32b));_0x1023b5(_0x6ae32b);})[_0x8f93('0x15')](function(_0x131438){logger['error'](_0x8f93('0x16'),_0x131438[_0x8f93('0x12')],_0x3a0209);_0x35ad09(_0x479ed5['error'](0x1f4,_0x131438[_0x8f93('0x12')]));});});};
\ No newline at end of file
+var _0x8c1d=['code','message','result','catch','UpdateMailApplication','update','options','raw','where','attributes','then','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8c1d,0x173));var _0xd8c1=function(_0x58a64c,_0x684602){_0x58a64c=_0x58a64c-0x0;var _0x1d419e=_0x8c1d[_0x58a64c];return _0x1d419e;};'use strict';var _=require(_0xd8c1('0x0'));var util=require(_0xd8c1('0x1'));var moment=require(_0xd8c1('0x2'));var BPromise=require(_0xd8c1('0x3'));var rs=require(_0xd8c1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd8c1('0x5'))['db'];var utils=require(_0xd8c1('0x6'));var logger=require(_0xd8c1('0x7'))(_0xd8c1('0x8'));var config=require('../../config/environment');var jayson=require(_0xd8c1('0x9'));var client=jayson[_0xd8c1('0xa')][_0xd8c1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x57869e,_0x5c224e,_0x5d9c03){return new BPromise(function(_0x238587,_0x576424){return client[_0xd8c1('0xc')](_0x57869e,_0x5d9c03)['then'](function(_0x757611){logger[_0xd8c1('0xd')](_0xd8c1('0xe'),_0x5c224e,_0xd8c1('0xf'));logger[_0xd8c1('0x10')](_0xd8c1('0x11'),_0x5c224e,_0xd8c1('0xf'),JSON['stringify'](_0x757611));if(_0x757611[_0xd8c1('0x12')]){if(_0x757611[_0xd8c1('0x12')][_0xd8c1('0x13')]===0x1f4){logger[_0xd8c1('0x12')](_0xd8c1('0xe'),_0x5c224e,_0x757611[_0xd8c1('0x12')][_0xd8c1('0x14')]);return _0x576424(_0x757611[_0xd8c1('0x12')][_0xd8c1('0x14')]);}logger[_0xd8c1('0x12')](_0xd8c1('0xe'),_0x5c224e,_0x757611[_0xd8c1('0x12')][_0xd8c1('0x14')]);return _0x238587(_0x757611[_0xd8c1('0x12')][_0xd8c1('0x14')]);}else{logger[_0xd8c1('0xd')](_0xd8c1('0xe'),_0x5c224e,_0xd8c1('0xf'));_0x238587(_0x757611[_0xd8c1('0x15')]['message']);}})[_0xd8c1('0x16')](function(_0x3df551){logger['error'](_0xd8c1('0xe'),_0x5c224e,_0x3df551);_0x576424(_0x3df551);});});}exports[_0xd8c1('0x17')]=function(_0x371c25){var _0x213b65=this;return new Promise(function(_0x410906,_0xd88b06){return db['MailApplication'][_0xd8c1('0x18')](_0x371c25['body'],{'raw':_0x371c25[_0xd8c1('0x19')]?_0x371c25[_0xd8c1('0x19')][_0xd8c1('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x371c25[_0xd8c1('0x19')]?_0x371c25[_0xd8c1('0x19')][_0xd8c1('0x1b')]||null:null,'attributes':_0x371c25['options']?_0x371c25[_0xd8c1('0x19')][_0xd8c1('0x1c')]||null:null,'limit':_0x371c25[_0xd8c1('0x19')]?_0x371c25[_0xd8c1('0x19')]['limit']||null:null})[_0xd8c1('0x1d')](function(_0x4b2f73){logger['info']('UpdateMailApplication',_0x371c25);logger['debug']('UpdateMailApplication',_0x371c25,JSON['stringify'](_0x4b2f73));_0x410906(_0x4b2f73);})['catch'](function(_0x37ae37){logger['error'](_0xd8c1('0x17'),_0x37ae37[_0xd8c1('0x14')],_0x371c25);_0xd88b06(_0x213b65[_0xd8c1('0x12')](0x1f4,_0x37ae37[_0xd8c1('0x14')]));});});};
\ No newline at end of file
index cba3a86..8f60401 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a07=['put','update','delete','mailinteraction:destroy','destroy','removeTags','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/messages','getMessages','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags'];(function(_0x130a00,_0x3e95a0){var _0x630677=function(_0x2a867d){while(--_0x2a867d){_0x130a00['push'](_0x130a00['shift']());}};_0x630677(++_0x3e95a0);}(_0x9a07,0xc4));var _0x79a0=function(_0x26f6e4,_0x396790){_0x26f6e4=_0x26f6e4-0x0;var _0x23280e=_0x9a07[_0x26f6e4];return _0x23280e;};'use strict';var express=require(_0x79a0('0x0'));var router=express[_0x79a0('0x1')]();var auth=require(_0x79a0('0x2'));var interaction=require(_0x79a0('0x3'));var controller=require(_0x79a0('0x4'));router['get']('/',auth[_0x79a0('0x5')](),controller['index']);router[_0x79a0('0x6')](_0x79a0('0x7'),auth[_0x79a0('0x5')](),controller[_0x79a0('0x8')]);router[_0x79a0('0x6')](_0x79a0('0x9'),auth[_0x79a0('0x5')](),controller[_0x79a0('0xa')]);router[_0x79a0('0x6')](_0x79a0('0xb'),auth['isAuthenticated'](),controller[_0x79a0('0xc')]);router[_0x79a0('0x6')]('/:id/download',auth[_0x79a0('0x5')](),controller['download']);router[_0x79a0('0xd')]('/',auth[_0x79a0('0x5')](),controller[_0x79a0('0xe')]);router[_0x79a0('0xd')](_0x79a0('0xb'),auth[_0x79a0('0x5')](),controller[_0x79a0('0xf')]);router['post'](_0x79a0('0x10'),auth['isAuthenticated'](),interaction[_0x79a0('0x11')](_0x79a0('0x12'),_0x79a0('0x13')),controller['addTags']);router[_0x79a0('0x14')](_0x79a0('0x9'),auth['isAuthenticated'](),interaction[_0x79a0('0x11')]('mail','mailinteraction:update'),controller[_0x79a0('0x15')]);router[_0x79a0('0x16')]('/:id',auth[_0x79a0('0x5')](),interaction[_0x79a0('0x11')](_0x79a0('0x12'),_0x79a0('0x17')),controller[_0x79a0('0x18')]);router[_0x79a0('0x16')](_0x79a0('0x10'),auth[_0x79a0('0x5')](),controller[_0x79a0('0x19')]);module[_0x79a0('0x1a')]=router;
\ No newline at end of file
+var _0x4596=['Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','isAuthenticated','index','describe','get','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','tracked','mailinteraction:update','update','delete','mailinteraction:destroy','removeTags','exports','express'];(function(_0x5512e4,_0x34de29){var _0x15d881=function(_0xf80e9c){while(--_0xf80e9c){_0x5512e4['push'](_0x5512e4['shift']());}};_0x15d881(++_0x34de29);}(_0x4596,0xfb));var _0x6459=function(_0x2d5bde,_0x516e42){_0x2d5bde=_0x2d5bde-0x0;var _0x4fc0ce=_0x4596[_0x2d5bde];return _0x4fc0ce;};'use strict';var express=require(_0x6459('0x0'));var router=express[_0x6459('0x1')]();var auth=require(_0x6459('0x2'));var interaction=require(_0x6459('0x3'));var controller=require(_0x6459('0x4'));router['get']('/',auth[_0x6459('0x5')](),controller[_0x6459('0x6')]);router['get']('/describe',auth[_0x6459('0x5')](),controller[_0x6459('0x7')]);router[_0x6459('0x8')](_0x6459('0x9'),auth['isAuthenticated'](),controller[_0x6459('0xa')]);router[_0x6459('0x8')](_0x6459('0xb'),auth[_0x6459('0x5')](),controller[_0x6459('0xc')]);router['get']('/:id/download',auth[_0x6459('0x5')](),controller[_0x6459('0xd')]);router[_0x6459('0xe')]('/',auth[_0x6459('0x5')](),controller[_0x6459('0xf')]);router[_0x6459('0xe')](_0x6459('0xb'),auth[_0x6459('0x5')](),controller[_0x6459('0x10')]);router[_0x6459('0xe')](_0x6459('0x11'),auth['isAuthenticated'](),interaction['tracked'](_0x6459('0x12'),_0x6459('0x13')),controller[_0x6459('0x14')]);router['put'](_0x6459('0x9'),auth[_0x6459('0x5')](),interaction[_0x6459('0x15')]('mail',_0x6459('0x16')),controller[_0x6459('0x17')]);router[_0x6459('0x18')](_0x6459('0x9'),auth[_0x6459('0x5')](),interaction[_0x6459('0x15')](_0x6459('0x12'),_0x6459('0x19')),controller['destroy']);router[_0x6459('0x18')]('/:id/tags',auth['isAuthenticated'](),controller[_0x6459('0x1a')]);module[_0x6459('0x1b')]=router;
\ No newline at end of file
index 7f29831..4f3d24f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb15=['long','ENUM','out','sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT'];(function(_0x451d04,_0x999e7d){var _0x32c6fe=function(_0x2be910){while(--_0x2be910){_0x451d04['push'](_0x451d04['shift']());}};_0x32c6fe(++_0x999e7d);}(_0xfb15,0x12f));var _0x5fb1=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xfb15[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require(_0x5fb1('0x0'));var iconv=require(_0x5fb1('0x1'));module[_0x5fb1('0x2')]={'closed':{'type':Sequelize[_0x5fb1('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x5fb1('0x4')]},'disposition':{'type':Sequelize[_0x5fb1('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x5fb1('0x5')]},'note':{'type':Sequelize[_0x5fb1('0x5')]},'inReplyTo':{'type':Sequelize[_0x5fb1('0x5')](0x1fe)},'to':{'type':Sequelize[_0x5fb1('0x5')]},'cc':{'type':Sequelize[_0x5fb1('0x6')](_0x5fb1('0x7'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize[_0x5fb1('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x5fb1('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x5fb1('0x8')]('in',_0x5fb1('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x5fb1('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x5fb1('0x8')]('in',_0x5fb1('0x9')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x5fb1('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x3e5e=['exports','BOOLEAN','DATE','STRING','TEXT','long','ENUM','out','sequelize'];(function(_0x4883cb,_0x3df63c){var _0x33aad7=function(_0x2e901e){while(--_0x2e901e){_0x4883cb['push'](_0x4883cb['shift']());}};_0x33aad7(++_0x3df63c);}(_0x3e5e,0x14c));var _0xe3e5=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x3e5e[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xe3e5('0x0'));var iconv=require('iconv');module[_0xe3e5('0x1')]={'closed':{'type':Sequelize[_0xe3e5('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe3e5('0x3')]},'disposition':{'type':Sequelize[_0xe3e5('0x4')]},'secondDisposition':{'type':Sequelize[_0xe3e5('0x4')]},'thirdDisposition':{'type':Sequelize[_0xe3e5('0x4')]},'note':{'type':Sequelize[_0xe3e5('0x4')]},'inReplyTo':{'type':Sequelize[_0xe3e5('0x4')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xe3e5('0x5')](_0xe3e5('0x6'))},'subject':{'type':Sequelize[_0xe3e5('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xe3e5('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xe3e5('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xe3e5('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xe3e5('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
index afe3731..e1ef0f9 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(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xb10b,0x12a));var _0xbb10=function(_0x953a55,_0x736d43){_0x953a55=_0x953a55-0x0;var _0x43fa9a=_0xb10b[_0x953a55];return _0x43fa9a;};'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(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xb10b,0x12a));var _0xbb10=function(_0x5560f6,_0x225f9c){_0x5560f6=_0x5560f6-0x0;var _0x25d4ef=_0xb10b[_0x5560f6];return _0x25d4ef;};'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 fce1d86..5eeefcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9646=['MailMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','map','findAll','then','length','emit','catch','hook','exports','events','MailInteraction','../../mysqldb'];(function(_0x4e832a,_0x52e7f8){var _0x6bae7d=function(_0x24bcbc){while(--_0x24bcbc){_0x4e832a['push'](_0x4e832a['shift']());}};_0x6bae7d(++_0x52e7f8);}(_0x9646,0x179));var _0x6964=function(_0x5c660a,_0x4b5262){_0x5c660a=_0x5c660a-0x0;var _0x3a77a4=_0x9646[_0x5c660a];return _0x3a77a4;};'use strict';var EventEmitter=require(_0x6964('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x6964('0x1')];var MailMessage=require(_0x6964('0x2'))['db'][_0x6964('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x6964('0x4')](0x0);var events={'afterCreate':_0x6964('0x5'),'afterUpdate':_0x6964('0x6'),'afterDestroy':_0x6964('0x7')};function emitEvent(_0x9c7aa7){return function(_0x1db904,_0x2c8853,_0x4125c1){_0x1db904[_0x6964('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4c740b){_0x1db904[_0x6964('0x9')](_0x6964('0xa'),_0x4c740b[_0x6964('0xb')](function(_0x3641b2){return{'id':_0x3641b2['id']};}));return MailMessage[_0x6964('0xc')]({'where':{'MailInteractionId':_0x1db904['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6964('0xd')](function(_0x4dfeaa){_0x1db904[_0x6964('0x9')]('unreadMessages',_0x4dfeaa[_0x6964('0xe')]);MailInteractionEvents[_0x6964('0xf')](_0x9c7aa7+':'+_0x1db904['id'],_0x1db904);MailInteractionEvents[_0x6964('0xf')](_0x9c7aa7,_0x1db904);_0x4125c1(null);})[_0x6964('0x10')](_0x4125c1(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x6964('0x11')](e,emitEvent(event));}}module[_0x6964('0x12')]=MailInteractionEvents;
\ No newline at end of file
+var _0x94df=['../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers','then','Users','map','setDataValue','unreadMessages','length','emit','catch','hook','exports','events'];(function(_0x11ba83,_0xd5611a){var _0x3f3925=function(_0x3d7cb0){while(--_0x3d7cb0){_0x11ba83['push'](_0x11ba83['shift']());}};_0x3f3925(++_0xd5611a);}(_0x94df,0xe3));var _0xf94d=function(_0x39a66e,_0x340bb3){_0x39a66e=_0x39a66e-0x0;var _0x230641=_0x94df[_0x39a66e];return _0x230641;};'use strict';var EventEmitter=require(_0xf94d('0x0'));var MailInteraction=require(_0xf94d('0x1'))['db'][_0xf94d('0x2')];var MailMessage=require('../../mysqldb')['db'][_0xf94d('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xf94d('0x4')](0x0);var events={'afterCreate':_0xf94d('0x5'),'afterUpdate':_0xf94d('0x6'),'afterDestroy':_0xf94d('0x7')};function emitEvent(_0x911bb9){return function(_0x1d8fa8,_0x55d456,_0xb81f4c){_0x1d8fa8[_0xf94d('0x8')]({'attributes':['id'],'raw':!![]})[_0xf94d('0x9')](function(_0x1639cb){_0x1d8fa8['setDataValue'](_0xf94d('0xa'),_0x1639cb[_0xf94d('0xb')](function(_0x28f29c){return{'id':_0x28f29c['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x1d8fa8['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf94d('0x9')](function(_0x56cc1c){_0x1d8fa8[_0xf94d('0xc')](_0xf94d('0xd'),_0x56cc1c[_0xf94d('0xe')]);MailInteractionEvents[_0xf94d('0xf')](_0x911bb9+':'+_0x1d8fa8['id'],_0x1d8fa8);MailInteractionEvents[_0xf94d('0xf')](_0x911bb9,_0x1d8fa8);_0xb81f4c(null);})[_0xf94d('0x10')](_0xb81f4c(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0xf94d('0x11')](e,emitEvent(event));}}module[_0xf94d('0x12')]=MailInteractionEvents;
\ No newline at end of file
index 28c9a14..71cb216 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63d6=['subject','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','models','update','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x63d6,0xaf));var _0x663d=function(_0x123049,_0x2353dc){_0x123049=_0x123049-0x0;var _0x10a3cc=_0x63d6[_0x123049];return _0x10a3cc;};'use strict';var _=require('lodash');var util=require(_0x663d('0x0'));var logger=require(_0x663d('0x1'))(_0x663d('0x2'));var moment=require(_0x663d('0x3'));var BPromise=require(_0x663d('0x4'));var rp=require(_0x663d('0x5'));var fs=require('fs');var path=require(_0x663d('0x6'));var rimraf=require(_0x663d('0x7'));var config=require('../../config/environment');var attributes=require(_0x663d('0x8'));module[_0x663d('0x9')]=function(_0x48d498,_0x42718f){return _0x48d498[_0x663d('0xa')](_0x663d('0xb'),attributes,{'tableName':_0x663d('0xc'),'paranoid':![],'indexes':[{'name':_0x663d('0xd'),'fields':[_0x663d('0xe'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xb119f9,_0x20d3e3,_0x4d3842){if(_0xb119f9[_0x663d('0xf')]){_0xb119f9[_0x663d('0x10')]=moment()['format'](_0x663d('0x11'));}if(_0xb119f9[_0x663d('0x12')]){_0xb119f9[_0x663d('0x13')]=moment()[_0x663d('0x14')](_0x663d('0x11'));}_0x4d3842(null,_0x20d3e3);},'beforeUpdate':function(_0x370fc3,_0x19966e,_0x1191bf){if(_0x370fc3[_0x663d('0x15')]('substatus')){_0x370fc3[_0x663d('0x10')]=_0x370fc3['substatus']?moment()[_0x663d('0x14')](_0x663d('0x11')):null;}if(_0x370fc3[_0x663d('0x15')]('closed')){_0x370fc3[_0x663d('0x13')]=moment()['format'](_0x663d('0x11'));_0x370fc3[_0x663d('0xf')]=null;_0x370fc3['substatusAt']=null;}_0x1191bf(null,_0x370fc3);},'afterUpdate':function(_0x499b36,_0x451728,_0x42061a){var _0x58582a=_0x48d498[_0x663d('0x16')];var _0x47fa27=_0x499b36['get']({'plain':!![]});if(_0x47fa27[_0x663d('0x12')]){return _0x58582a['MailMessage'][_0x663d('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x47fa27['id']}})['then'](function(){_0x42061a();})[_0x663d('0x18')](function(_0x27441d){_0x42061a(_0x27441d);});}else{_0x42061a();}}},'charset':_0x663d('0x19'),'collate':_0x663d('0x1a')});};
\ No newline at end of file
+var _0x56ad=['MailMessage','update','then','catch','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss','closed','format','changed','closedAt','models'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x56ad,0x1a4));var _0xd56a=function(_0x47012a,_0x30352d){_0x47012a=_0x47012a-0x0;var _0x15eb81=_0x56ad[_0x47012a];return _0x15eb81;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd56a('0x0'))(_0xd56a('0x1'));var moment=require('moment');var BPromise=require(_0xd56a('0x2'));var rp=require(_0xd56a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd56a('0x4'));var config=require(_0xd56a('0x5'));var attributes=require(_0xd56a('0x6'));module[_0xd56a('0x7')]=function(_0x48d380,_0x55d599){return _0x48d380[_0xd56a('0x8')](_0xd56a('0x9'),attributes,{'tableName':_0xd56a('0xa'),'paranoid':![],'indexes':[{'name':_0xd56a('0xb'),'fields':[_0xd56a('0xc'),'to'],'type':_0xd56a('0xd')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x527faf,_0x27eaa7,_0xed3391){if(_0x527faf[_0xd56a('0xe')]){_0x527faf[_0xd56a('0xf')]=moment()['format'](_0xd56a('0x10'));}if(_0x527faf[_0xd56a('0x11')]){_0x527faf['closedAt']=moment()[_0xd56a('0x12')](_0xd56a('0x10'));}_0xed3391(null,_0x27eaa7);},'beforeUpdate':function(_0x5462a4,_0xa0bc7b,_0x4ed9a1){if(_0x5462a4[_0xd56a('0x13')]('substatus')){_0x5462a4[_0xd56a('0xf')]=_0x5462a4[_0xd56a('0xe')]?moment()[_0xd56a('0x12')](_0xd56a('0x10')):null;}if(_0x5462a4[_0xd56a('0x13')](_0xd56a('0x11'))){_0x5462a4[_0xd56a('0x14')]=moment()[_0xd56a('0x12')](_0xd56a('0x10'));_0x5462a4['substatus']=null;_0x5462a4['substatusAt']=null;}_0x4ed9a1(null,_0x5462a4);},'afterUpdate':function(_0x2b17ac,_0x293100,_0x2b18cc){var _0x5cb4e0=_0x48d380[_0xd56a('0x15')];var _0x1d4c93=_0x2b17ac['get']({'plain':!![]});if(_0x1d4c93[_0xd56a('0x11')]){return _0x5cb4e0[_0xd56a('0x16')][_0xd56a('0x17')]({'read':!![]},{'where':{'MailInteractionId':_0x1d4c93['id']}})[_0xd56a('0x18')](function(){_0x2b18cc();})[_0xd56a('0x19')](function(_0x329ef5){_0x2b18cc(_0x329ef5);});}else{_0x2b18cc();}}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
index bf0465b..edda086 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f81=['debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','stringify','catch','addTags','ids','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','then','info','MailInteraction,\x20%s,\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7f81,0x185));var _0x17f8=function(_0x9b3b61,_0x25734e){_0x9b3b61=_0x9b3b61-0x0;var _0x1e1df9=_0x7f81[_0x9b3b61];return _0x1e1df9;};'use strict';var _=require(_0x17f8('0x0'));var util=require(_0x17f8('0x1'));var moment=require(_0x17f8('0x2'));var BPromise=require(_0x17f8('0x3'));var rs=require(_0x17f8('0x4'));var fs=require('fs');var Redis=require(_0x17f8('0x5'));var db=require(_0x17f8('0x6'))['db'];var utils=require(_0x17f8('0x7'));var logger=require('../../config/logger')(_0x17f8('0x8'));var config=require(_0x17f8('0x9'));var jayson=require(_0x17f8('0xa'));var client=jayson[_0x17f8('0xb')][_0x17f8('0xc')]({'port':0x232a});config[_0x17f8('0xd')]=_['defaults'](config[_0x17f8('0xd')],{'host':_0x17f8('0xe'),'port':0x18eb});var socket=require(_0x17f8('0xf'))(new Redis(config[_0x17f8('0xd')]));require(_0x17f8('0x10'))[_0x17f8('0x11')](socket);function respondWithRpcPromise(_0x4e3beb,_0x1e690f,_0x24507b){return new BPromise(function(_0x58c13f,_0x11a6d1){return client['request'](_0x4e3beb,_0x24507b)[_0x17f8('0x12')](function(_0x5a4719){logger[_0x17f8('0x13')](_0x17f8('0x14'),_0x1e690f,'request\x20sent');logger[_0x17f8('0x15')](_0x17f8('0x16'),_0x1e690f,_0x17f8('0x17'),JSON['stringify'](_0x5a4719));if(_0x5a4719[_0x17f8('0x18')]){if(_0x5a4719[_0x17f8('0x18')][_0x17f8('0x19')]===0x1f4){logger[_0x17f8('0x18')]('MailInteraction,\x20%s,\x20%s',_0x1e690f,_0x5a4719[_0x17f8('0x18')][_0x17f8('0x1a')]);return _0x11a6d1(_0x5a4719[_0x17f8('0x18')][_0x17f8('0x1a')]);}logger['error'](_0x17f8('0x14'),_0x1e690f,_0x5a4719['error']['message']);return _0x58c13f(_0x5a4719[_0x17f8('0x18')]['message']);}else{logger[_0x17f8('0x13')]('MailInteraction,\x20%s,\x20%s',_0x1e690f,_0x17f8('0x17'));_0x58c13f(_0x5a4719['result'][_0x17f8('0x1a')]);}})['catch'](function(_0x40fd55){logger[_0x17f8('0x18')](_0x17f8('0x14'),_0x1e690f,_0x40fd55);_0x11a6d1(_0x40fd55);});});}exports[_0x17f8('0x1b')]=function(_0x13b2b9){var _0x197dd4=this;return new Promise(function(_0x34a7ad,_0x38b4e8){return db[_0x17f8('0x1c')][_0x17f8('0x1d')](_0x13b2b9[_0x17f8('0x1e')],{'raw':_0x13b2b9[_0x17f8('0x1f')]?_0x13b2b9['options'][_0x17f8('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x13b2b9['options']?_0x13b2b9[_0x17f8('0x1f')][_0x17f8('0x21')]||null:null,'attributes':_0x13b2b9[_0x17f8('0x1f')]?_0x13b2b9[_0x17f8('0x1f')][_0x17f8('0x22')]||null:null,'limit':_0x13b2b9[_0x17f8('0x1f')]?_0x13b2b9['options'][_0x17f8('0x23')]||null:null})['then'](function(_0x1023ab){logger['info']('UpdateMailInteraction',_0x13b2b9);logger[_0x17f8('0x15')](_0x17f8('0x1b'),_0x13b2b9,JSON[_0x17f8('0x24')](_0x1023ab));_0x34a7ad(_0x1023ab);})[_0x17f8('0x25')](function(_0x595fd8){logger['error'](_0x17f8('0x1b'),_0x595fd8[_0x17f8('0x1a')],_0x13b2b9);_0x38b4e8(_0x197dd4[_0x17f8('0x18')](0x1f4,_0x595fd8[_0x17f8('0x1a')]));});});};exports['AddTagsToMailInteraction']=function(_0xabf6cc){return new Promise(function(_0x2ea038,_0x2ba940){return db['MailInteraction']['find']({'where':_0xabf6cc[_0x17f8('0x1f')]?_0xabf6cc['options'][_0x17f8('0x21')]||null:null})[_0x17f8('0x12')](function(_0x35fcd7){if(_0x35fcd7){return _0x35fcd7[_0x17f8('0x26')](_0xabf6cc[_0x17f8('0x1e')]['ids'],_['omit'](_0xabf6cc[_0x17f8('0x1e')],[_0x17f8('0x27'),'id'])||{});}})['spread'](function(_0x2d984b){logger['info'](_0x17f8('0x28'),_0xabf6cc);logger[_0x17f8('0x15')](_0x17f8('0x28'),_0xabf6cc,JSON[_0x17f8('0x24')](_0x2d984b));_0x2ea038(_0x2d984b);})[_0x17f8('0x25')](function(_0x241904){logger[_0x17f8('0x18')](_0x17f8('0x28'),_0x241904[_0x17f8('0x1a')],_0xabf6cc);_0x2ba940(_this[_0x17f8('0x18')](0x1f4,_0x241904[_0x17f8('0x1a')]));});});};
\ No newline at end of file
+var _0x13f6=['util','bluebird','randomstring','../../config/utils','../../config/logger','client','http','redis','socket.io-emitter','register','info','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','update','options','where','attributes','then','debug','find','addTags','body','ids','omit','spread','AddTags'];(function(_0x38146e,_0x3ce0ec){var _0x354052=function(_0x4d7383){while(--_0x4d7383){_0x38146e['push'](_0x38146e['shift']());}};_0x354052(++_0x3ce0ec);}(_0x13f6,0xaf));var _0x613f=function(_0x27f4e9,_0x2f2f75){_0x27f4e9=_0x27f4e9-0x0;var _0x7226e=_0x13f6[_0x27f4e9];return _0x7226e;};'use strict';var _=require('lodash');var util=require(_0x613f('0x0'));var moment=require('moment');var BPromise=require(_0x613f('0x1'));var rs=require(_0x613f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x613f('0x3'));var logger=require(_0x613f('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x613f('0x5')][_0x613f('0x6')]({'port':0x232a});config['redis']=_['defaults'](config[_0x613f('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0x613f('0x8'))(new Redis(config[_0x613f('0x7')]));require('./mailInteraction.socket')[_0x613f('0x9')](socket);function respondWithRpcPromise(_0x3395b1,_0x21dc4,_0x186a64){return new BPromise(function(_0x32f260,_0x115352){return client['request'](_0x3395b1,_0x186a64)['then'](function(_0x4070c2){logger[_0x613f('0xa')](_0x613f('0xb'),_0x21dc4,_0x613f('0xc'));logger['debug'](_0x613f('0xd'),_0x21dc4,_0x613f('0xc'),JSON[_0x613f('0xe')](_0x4070c2));if(_0x4070c2[_0x613f('0xf')]){if(_0x4070c2[_0x613f('0xf')][_0x613f('0x10')]===0x1f4){logger[_0x613f('0xf')]('MailInteraction,\x20%s,\x20%s',_0x21dc4,_0x4070c2[_0x613f('0xf')]['message']);return _0x115352(_0x4070c2[_0x613f('0xf')][_0x613f('0x11')]);}logger[_0x613f('0xf')](_0x613f('0xb'),_0x21dc4,_0x4070c2[_0x613f('0xf')]['message']);return _0x32f260(_0x4070c2[_0x613f('0xf')][_0x613f('0x11')]);}else{logger['info'](_0x613f('0xb'),_0x21dc4,_0x613f('0xc'));_0x32f260(_0x4070c2[_0x613f('0x12')][_0x613f('0x11')]);}})[_0x613f('0x13')](function(_0x124417){logger['error'](_0x613f('0xb'),_0x21dc4,_0x124417);_0x115352(_0x124417);});});}exports[_0x613f('0x14')]=function(_0x11dc42){var _0x5462b3=this;return new Promise(function(_0x141c7d,_0x6b4b79){return db[_0x613f('0x15')][_0x613f('0x16')](_0x11dc42['body'],{'raw':_0x11dc42['options']?_0x11dc42[_0x613f('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11dc42[_0x613f('0x17')]?_0x11dc42['options'][_0x613f('0x18')]||null:null,'attributes':_0x11dc42[_0x613f('0x17')]?_0x11dc42[_0x613f('0x17')][_0x613f('0x19')]||null:null,'limit':_0x11dc42[_0x613f('0x17')]?_0x11dc42[_0x613f('0x17')]['limit']||null:null})[_0x613f('0x1a')](function(_0x38363c){logger[_0x613f('0xa')](_0x613f('0x14'),_0x11dc42);logger[_0x613f('0x1b')](_0x613f('0x14'),_0x11dc42,JSON[_0x613f('0xe')](_0x38363c));_0x141c7d(_0x38363c);})[_0x613f('0x13')](function(_0x5e4ed2){logger[_0x613f('0xf')](_0x613f('0x14'),_0x5e4ed2[_0x613f('0x11')],_0x11dc42);_0x6b4b79(_0x5462b3[_0x613f('0xf')](0x1f4,_0x5e4ed2['message']));});});};exports['AddTagsToMailInteraction']=function(_0x1e5619){return new Promise(function(_0x2902a6,_0x29d575){return db[_0x613f('0x15')][_0x613f('0x1c')]({'where':_0x1e5619['options']?_0x1e5619[_0x613f('0x17')]['where']||null:null})[_0x613f('0x1a')](function(_0x656273){if(_0x656273){return _0x656273[_0x613f('0x1d')](_0x1e5619[_0x613f('0x1e')][_0x613f('0x1f')],_[_0x613f('0x20')](_0x1e5619[_0x613f('0x1e')],[_0x613f('0x1f'),'id'])||{});}})[_0x613f('0x21')](function(_0x19f015){logger[_0x613f('0xa')]('AddTags',_0x1e5619);logger[_0x613f('0x1b')](_0x613f('0x22'),_0x1e5619,JSON[_0x613f('0xe')](_0x19f015));_0x2902a6(_0x19f015);})[_0x613f('0x13')](function(_0x207451){logger['error'](_0x613f('0x22'),_0x207451[_0x613f('0x11')],_0x1e5619);_0x29d575(_this[_0x613f('0xf')](0x1f4,_0x207451[_0x613f('0x11')]));});});};
\ No newline at end of file
index 57359be..67beea4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d05=['mailInteraction:','./mailInteraction.events','save','update','emit','register','length'];(function(_0x3ab687,_0x2f3a18){var _0x512596=function(_0x981ef2){while(--_0x981ef2){_0x3ab687['push'](_0x3ab687['shift']());}};_0x512596(++_0x2f3a18);}(_0x9d05,0x127));var _0x59d0=function(_0x5903ec,_0x5a31f0){_0x5903ec=_0x5903ec-0x0;var _0x4d84f8=_0x9d05[_0x5903ec];return _0x4d84f8;};'use strict';var MailInteractionEvents=require(_0x59d0('0x0'));var events=[_0x59d0('0x1'),'remove',_0x59d0('0x2')];function createListener(_0x284e40,_0x46cee5){return function(_0x1045fd){_0x46cee5[_0x59d0('0x3')](_0x284e40,_0x1045fd);};}function removeListener(_0xeb558a,_0x19dcad){return function(){MailInteractionEvents['removeListener'](_0xeb558a,_0x19dcad);};}exports[_0x59d0('0x4')]=function(_0x2e18a7){for(var _0xe839ea=0x0,_0x5c672b=events[_0x59d0('0x5')];_0xe839ea<_0x5c672b;_0xe839ea++){var _0x40d569=events[_0xe839ea];var _0x31db7f=createListener(_0x59d0('0x6')+_0x40d569,_0x2e18a7);MailInteractionEvents['on'](_0x40d569,_0x31db7f);}};
\ No newline at end of file
+var _0x0b98=['mailInteraction:','./mailInteraction.events','update','emit','removeListener','register'];(function(_0x3d7a10,_0x21bc7b){var _0x5b0b11=function(_0x366e31){while(--_0x366e31){_0x3d7a10['push'](_0x3d7a10['shift']());}};_0x5b0b11(++_0x21bc7b);}(_0x0b98,0xe5));var _0x80b9=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0b98[_0x14add3];return _0x4a174f;};'use strict';var MailInteractionEvents=require(_0x80b9('0x0'));var events=['save','remove',_0x80b9('0x1')];function createListener(_0x34efe8,_0x25594c){return function(_0x191f03){_0x25594c[_0x80b9('0x2')](_0x34efe8,_0x191f03);};}function removeListener(_0x45546d,_0x1c8a23){return function(){MailInteractionEvents[_0x80b9('0x3')](_0x45546d,_0x1c8a23);};}exports[_0x80b9('0x4')]=function(_0x53da1c){for(var _0x5416f2=0x0,_0x2da362=events['length'];_0x5416f2<_0x2da362;_0x5416f2++){var _0x41c075=events[_0x5416f2];var _0x12e96b=createListener(_0x80b9('0x5')+_0x41c075,_0x53da1c);MailInteractionEvents['on'](_0x41c075,_0x12e96b);}};
\ No newline at end of file
index 106a5ba..d224a9c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c5e=['../../config/environment','get','isAuthenticated','index','describe','/:id','/:id/download','download','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','../../components/interaction/service'];(function(_0x2a6ede,_0x5af3e6){var _0x39f3ab=function(_0x31e7c6){while(--_0x31e7c6){_0x2a6ede['push'](_0x2a6ede['shift']());}};_0x39f3ab(++_0x5af3e6);}(_0x9c5e,0x9c));var _0xe9c5=function(_0x52fa21,_0x7518da){_0x52fa21=_0x52fa21-0x0;var _0x1c5195=_0x9c5e[_0x52fa21];return _0x1c5195;};'use strict';var multer=require(_0xe9c5('0x0'));var util=require(_0xe9c5('0x1'));var path=require(_0xe9c5('0x2'));var timeout=require(_0xe9c5('0x3'));var express=require(_0xe9c5('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe9c5('0x5'));var config=require(_0xe9c5('0x6'));var controller=require('./mailMessage.controller');router[_0xe9c5('0x7')]('/',auth[_0xe9c5('0x8')](),controller[_0xe9c5('0x9')]);router[_0xe9c5('0x7')]('/describe',auth[_0xe9c5('0x8')](),controller[_0xe9c5('0xa')]);router[_0xe9c5('0x7')](_0xe9c5('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xe9c5('0x7')](_0xe9c5('0xc'),auth[_0xe9c5('0x8')](),controller[_0xe9c5('0xd')]);router[_0xe9c5('0xe')]('/',auth[_0xe9c5('0x8')](),interaction[_0xe9c5('0xf')](_0xe9c5('0x10'),_0xe9c5('0x11')),controller[_0xe9c5('0x12')]);router[_0xe9c5('0x13')](_0xe9c5('0xb'),auth[_0xe9c5('0x8')](),controller[_0xe9c5('0x14')]);router[_0xe9c5('0x13')](_0xe9c5('0x15'),auth['isAuthenticated'](),controller[_0xe9c5('0x16')]);router[_0xe9c5('0x13')](_0xe9c5('0x17'),auth[_0xe9c5('0x8')](),controller[_0xe9c5('0x18')]);router[_0xe9c5('0x19')]('/:id',auth[_0xe9c5('0x8')](),controller[_0xe9c5('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0x3360=['../../config/environment','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','tracked','mail','mailmessage:create','create','update','put','/:id/accept','accept','/:id/reject','delete','destroy','multer','util','Router','../../components/interaction/service'];(function(_0x1a1795,_0x35958e){var _0x56b714=function(_0x2867f0){while(--_0x2867f0){_0x1a1795['push'](_0x1a1795['shift']());}};_0x56b714(++_0x35958e);}(_0x3360,0x1d7));var _0x0336=function(_0x12983c,_0x3355bc){_0x12983c=_0x12983c-0x0;var _0x45df19=_0x3360[_0x12983c];return _0x45df19;};'use strict';var multer=require(_0x0336('0x0'));var util=require(_0x0336('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0336('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0336('0x3'));var config=require(_0x0336('0x4'));var controller=require(_0x0336('0x5'));router[_0x0336('0x6')]('/',auth[_0x0336('0x7')](),controller['index']);router['get'](_0x0336('0x8'),auth[_0x0336('0x7')](),controller[_0x0336('0x9')]);router[_0x0336('0x6')](_0x0336('0xa'),auth['isAuthenticated'](),controller[_0x0336('0xb')]);router[_0x0336('0x6')](_0x0336('0xc'),auth['isAuthenticated'](),controller[_0x0336('0xd')]);router['post']('/',auth[_0x0336('0x7')](),interaction[_0x0336('0xe')](_0x0336('0xf'),_0x0336('0x10')),controller[_0x0336('0x11')]);router['put'](_0x0336('0xa'),auth[_0x0336('0x7')](),controller[_0x0336('0x12')]);router[_0x0336('0x13')](_0x0336('0x14'),auth['isAuthenticated'](),controller[_0x0336('0x15')]);router[_0x0336('0x13')](_0x0336('0x16'),auth[_0x0336('0x7')](),controller['reject']);router[_0x0336('0x17')]('/:id',auth[_0x0336('0x7')](),controller[_0x0336('0x18')]);module['exports']=router;
\ No newline at end of file
index 4c4cab0..068d467 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7aad=['Chat','sequelize','TEXT','long','medium','BOOLEAN','out','STRING','DATE','INTEGER','ENUM','Email'];(function(_0x40fc31,_0x3e6602){var _0x4b2a4f=function(_0x2791da){while(--_0x2791da){_0x40fc31['push'](_0x40fc31['shift']());}};_0x4b2a4f(++_0x3e6602);}(_0x7aad,0x1e1));var _0xd7aa=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x7aad[_0x1c546c];return _0x2cc384;};'use strict';var Sequelize=require(_0xd7aa('0x0'));var _=require('lodash');module['exports']={'body':{'type':Sequelize[_0xd7aa('0x1')](_0xd7aa('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0xd7aa('0x3'))},'read':{'type':Sequelize[_0xd7aa('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xd7aa('0x5')),'defaultValue':_0xd7aa('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xd7aa('0x6')](0x1fe)},'from':{'type':Sequelize[_0xd7aa('0x6')]},'to':{'type':Sequelize[_0xd7aa('0x1')](_0xd7aa('0x2'))},'cc':{'type':Sequelize[_0xd7aa('0x1')](_0xd7aa('0x2'))},'bcc':{'type':Sequelize[_0xd7aa('0x1')](_0xd7aa('0x2'))},'subject':{'type':Sequelize[_0xd7aa('0x1')]},'sentAt':{'type':Sequelize[_0xd7aa('0x7')]},'attach':{'type':Sequelize[_0xd7aa('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xd7aa('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xd7aa('0x1')](_0xd7aa('0x2'))},'originCc':{'type':Sequelize[_0xd7aa('0x1')]('long')},'originChannel':{'type':Sequelize[_0xd7aa('0x9')](_0xd7aa('0xa'),_0xd7aa('0xb')),'defaultValue':'Email','allowNull':![]}};
\ No newline at end of file
+var _0xd1b2=['Chat','exports','TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Email'];(function(_0x2734f2,_0x4cb5f5){var _0x53e119=function(_0x474dfe){while(--_0x474dfe){_0x2734f2['push'](_0x2734f2['shift']());}};_0x53e119(++_0x4cb5f5);}(_0xd1b2,0xc1));var _0x2d1b=function(_0x10578f,_0x4253c0){_0x10578f=_0x10578f-0x0;var _0x5b103d=_0xd1b2[_0x10578f];return _0x5b103d;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module[_0x2d1b('0x0')]={'body':{'type':Sequelize[_0x2d1b('0x1')](_0x2d1b('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x2d1b('0x1')](_0x2d1b('0x3'))},'read':{'type':Sequelize[_0x2d1b('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2d1b('0x5')]('in',_0x2d1b('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x2d1b('0x7')](0x1fe)},'from':{'type':Sequelize[_0x2d1b('0x7')]},'to':{'type':Sequelize[_0x2d1b('0x1')](_0x2d1b('0x2'))},'cc':{'type':Sequelize['TEXT'](_0x2d1b('0x2'))},'bcc':{'type':Sequelize[_0x2d1b('0x1')](_0x2d1b('0x2'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x2d1b('0x8')]},'attach':{'type':Sequelize[_0x2d1b('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x2d1b('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x2d1b('0x8')]},'originTo':{'type':Sequelize[_0x2d1b('0x1')](_0x2d1b('0x2'))},'originCc':{'type':Sequelize[_0x2d1b('0x1')](_0x2d1b('0x2'))},'originChannel':{'type':Sequelize[_0x2d1b('0x5')](_0x2d1b('0xa'),_0x2d1b('0xb')),'defaultValue':_0x2d1b('0xa'),'allowNull':![]}};
\ No newline at end of file
index e0d370f..a7fb834 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92ca=['read','readAt','UserId','agent','get','MailInteraction','MailInteractionId','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','internal','interface','format','channel','motionChannel','EventManager','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','User','email','event','rejectmessage','files','tmp','server','from','subject','createdAt','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','bcc','basename','existsSync','push','readFileSync','build','download','moment','util','path','lodash','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','request','then','MailMessage,\x20%s,\x20%s','debug','error','code','message','info','request\x20sent','catch','status','json','offset','undefined','count','limit','set','Content-Range','end','sendStatus','name','send','index','MailMessage','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','show','params','keys','rawAttributes','include','find','update','body','destroy','direction','out','split','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','defaults','ListId','List\x20not\x20found','SendMail','YYYY-MM-DD\x20HH:mm:ss','mail'];(function(_0x10061b,_0x51277b){var _0x672211=function(_0x5e5d0e){while(--_0x5e5d0e){_0x10061b['push'](_0x10061b['shift']());}};_0x672211(++_0x51277b);}(_0x92ca,0x16c));var _0xa92c=function(_0x3d4a2b,_0xca71a8){_0x3d4a2b=_0x3d4a2b-0x0;var _0x5c55c6=_0x92ca[_0x3d4a2b];return _0x5c55c6;};'use strict';var emlformat=require('eml-format');var moment=require(_0xa92c('0x0'));var BPromise=require('bluebird');var util=require(_0xa92c('0x1'));var path=require(_0xa92c('0x2'));var fs=require('fs');var _=require(_0xa92c('0x3'));var Redis=require('ioredis');var htmlToText=require('html-to-text');var qs=require('../../components/parsers/qs');var logger=require(_0xa92c('0x4'))(_0xa92c('0x5'));var interaction_log=require('../../config/logger')(_0xa92c('0x6'));var config=require(_0xa92c('0x7'));var db=require(_0xa92c('0x8'))['db'];config[_0xa92c('0x9')]=_['defaults'](config['redis'],{'host':_0xa92c('0xa'),'port':0x18eb});var socket=require(_0xa92c('0xb'))(new Redis(config['redis']));require(_0xa92c('0xc'))[_0xa92c('0xd')](socket);var jayson=require(_0xa92c('0xe'));var client=jayson[_0xa92c('0xf')][_0xa92c('0x10')]({'port':0x232c});var client9003=jayson[_0xa92c('0xf')][_0xa92c('0x10')]({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x145c12,_0x3ad3d0,_0x1a1fb4,_0x319e0c){return new BPromise(function(_0x21be49,_0x3ea74a){var _0x5476e1=_0x319e0c||client;return _0x5476e1[_0xa92c('0x11')](_0x145c12,_0x1a1fb4)[_0xa92c('0x12')](function(_0x3aa338){logger['info'](_0xa92c('0x13'),_0x3ad3d0,'request\x20sent');logger[_0xa92c('0x14')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x3ad3d0,'request\x20sent',JSON['stringify'](_0x3aa338));if(_0x3aa338[_0xa92c('0x15')]){if(_0x3aa338[_0xa92c('0x15')][_0xa92c('0x16')]===0x1f4){logger[_0xa92c('0x15')](_0xa92c('0x13'),_0x3ad3d0,_0x3aa338[_0xa92c('0x15')][_0xa92c('0x17')]);return _0x3ea74a(_0x3aa338[_0xa92c('0x15')][_0xa92c('0x17')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x3ad3d0,_0x3aa338[_0xa92c('0x15')][_0xa92c('0x17')]);return _0x21be49(_0x3aa338['error'][_0xa92c('0x17')]);}else{logger[_0xa92c('0x18')](_0xa92c('0x13'),_0x3ad3d0,_0xa92c('0x19'));_0x21be49(_0x3aa338['result']['message']);}})[_0xa92c('0x1a')](function(_0x42b18f){logger[_0xa92c('0x15')](_0xa92c('0x13'),_0x3ad3d0,_0x42b18f);_0x3ea74a(_0x42b18f);});});}function respondWithResult(_0x587384,_0xc359){_0xc359=_0xc359||0xc8;return function(_0x597bd8){if(_0x597bd8){return _0x587384[_0xa92c('0x1b')](_0xc359)[_0xa92c('0x1c')](_0x597bd8);}};}function respondWithFilteredResult(_0x53f767,_0x9c1f70){return function(_0x144acc){if(_0x144acc){var _0x31dd31=typeof _0x9c1f70[_0xa92c('0x1d')]===_0xa92c('0x1e')&&typeof _0x9c1f70['limit']===_0xa92c('0x1e');var _0xc3c557=_0x144acc[_0xa92c('0x1f')];var _0x13ea30=_0x31dd31?0x0:_0x9c1f70[_0xa92c('0x1d')];var _0x548099=_0x31dd31?_0x144acc[_0xa92c('0x1f')]:_0x9c1f70[_0xa92c('0x1d')]+_0x9c1f70[_0xa92c('0x20')];var _0x947a95;if(_0x548099>=_0xc3c557){_0x548099=_0xc3c557;_0x947a95=0xc8;}else{_0x947a95=0xce;}_0x53f767[_0xa92c('0x1b')](_0x947a95);return _0x53f767[_0xa92c('0x21')](_0xa92c('0x22'),_0x13ea30+'-'+_0x548099+'/'+_0xc3c557)[_0xa92c('0x1c')](_0x144acc);}return null;};}function saveUpdates(_0x53b001){return function(_0x4e8fe5){if(_0x4e8fe5){return _0x4e8fe5['update'](_0x53b001)[_0xa92c('0x12')](function(_0xb9bf25){return _0xb9bf25;});}return null;};}function removeEntity(_0x395b8e){return function(_0x40121a){if(_0x40121a){return _0x40121a['destroy']()['then'](function(){_0x395b8e[_0xa92c('0x1b')](0xcc)[_0xa92c('0x23')]();});}};}function handleEntityNotFound(_0x151f85){return function(_0x1fd8a0){if(!_0x1fd8a0){_0x151f85[_0xa92c('0x24')](0x194);}return _0x1fd8a0;};}function handleError(_0x3bf50c,_0x53bb95){_0x53bb95=_0x53bb95||0x1f4;return function(_0x3d52bc){logger['error'](_0x3d52bc['stack']);if(_0x3d52bc[_0xa92c('0x25')]){delete _0x3d52bc['name'];}_0x3bf50c[_0xa92c('0x1b')](_0x53bb95)[_0xa92c('0x26')](_0x3d52bc);};}exports[_0xa92c('0x27')]=function(_0x333800,_0x186681){var _0x10203a={},_0x4eb9a7={},_0x3e4ffa={'count':0x0,'rows':[]};var _0x248282=_['map'](db[_0xa92c('0x28')]['rawAttributes'],function(_0xfa5c6d){return{'name':_0xfa5c6d[_0xa92c('0x29')],'type':_0xfa5c6d[_0xa92c('0x2a')][_0xa92c('0x2b')]};});_0x4eb9a7[_0xa92c('0x2c')]=_[_0xa92c('0x2d')](_0x248282,_0xa92c('0x25'));_0x4eb9a7[_0xa92c('0x2e')]=_['keys'](_0x333800[_0xa92c('0x2e')]);_0x4eb9a7[_0xa92c('0x2f')]=_[_0xa92c('0x30')](_0x4eb9a7[_0xa92c('0x2c')],_0x4eb9a7['query']);_0x10203a[_0xa92c('0x31')]=_['intersection'](_0x4eb9a7[_0xa92c('0x2c')],qs[_0xa92c('0x32')](_0x333800[_0xa92c('0x2e')][_0xa92c('0x32')]));_0x10203a[_0xa92c('0x31')]=_0x10203a['attributes'][_0xa92c('0x33')]?_0x10203a[_0xa92c('0x31')]:_0x4eb9a7[_0xa92c('0x2c')];if(!_0x333800[_0xa92c('0x2e')]['hasOwnProperty'](_0xa92c('0x34'))){_0x10203a[_0xa92c('0x20')]=qs[_0xa92c('0x20')](_0x333800['query'][_0xa92c('0x20')]);_0x10203a['offset']=qs[_0xa92c('0x1d')](_0x333800[_0xa92c('0x2e')][_0xa92c('0x1d')]);}_0x10203a[_0xa92c('0x35')]=qs['sort'](_0x333800['query'][_0xa92c('0x36')]);_0x10203a[_0xa92c('0x37')]=qs[_0xa92c('0x2f')](_[_0xa92c('0x38')](_0x333800[_0xa92c('0x2e')],_0x4eb9a7[_0xa92c('0x2f')]),_0x248282);if(_0x333800[_0xa92c('0x2e')][_0xa92c('0x39')]){_0x10203a[_0xa92c('0x37')]=_[_0xa92c('0x3a')](_0x10203a['where'],{'$or':_[_0xa92c('0x2d')](_0x248282,function(_0x3cb221){if(_0x3cb221[_0xa92c('0x2a')]!==_0xa92c('0x3b')){var _0x35bb1e={};_0x35bb1e[_0x3cb221['name']]={'$like':'%'+_0x333800[_0xa92c('0x2e')][_0xa92c('0x39')]+'%'};return _0x35bb1e;}})});}_0x10203a=_[_0xa92c('0x3a')]({},_0x10203a,_0x333800[_0xa92c('0x3c')]);var _0x5bcae1={'where':_0x10203a[_0xa92c('0x37')]};return db[_0xa92c('0x28')][_0xa92c('0x1f')](_0x5bcae1)[_0xa92c('0x12')](function(_0x3f49ef){_0x3e4ffa[_0xa92c('0x1f')]=_0x3f49ef;if(_0x333800[_0xa92c('0x2e')]['includeAll']){_0x10203a['include']=[{'all':!![]}];}return db[_0xa92c('0x28')]['findAll'](_0x10203a);})[_0xa92c('0x12')](function(_0x4db20e){_0x3e4ffa['rows']=_0x4db20e;return _0x3e4ffa;})['then'](respondWithFilteredResult(_0x186681,_0x10203a))[_0xa92c('0x1a')](handleError(_0x186681,null));};exports[_0xa92c('0x3d')]=function(_0x334987,_0x45cd96){var _0x5e0891={'raw':!![],'where':{'id':_0x334987[_0xa92c('0x3e')]['id']}},_0x526bd6={};_0x526bd6['model']=_[_0xa92c('0x3f')](db[_0xa92c('0x28')][_0xa92c('0x40')]);_0x526bd6[_0xa92c('0x2e')]=_['keys'](_0x334987[_0xa92c('0x2e')]);_0x526bd6[_0xa92c('0x2f')]=_[_0xa92c('0x30')](_0x526bd6[_0xa92c('0x2c')],_0x526bd6[_0xa92c('0x2e')]);_0x5e0891[_0xa92c('0x31')]=_[_0xa92c('0x30')](_0x526bd6[_0xa92c('0x2c')],qs[_0xa92c('0x32')](_0x334987[_0xa92c('0x2e')]['fields']));_0x5e0891[_0xa92c('0x31')]=_0x5e0891[_0xa92c('0x31')][_0xa92c('0x33')]?_0x5e0891[_0xa92c('0x31')]:_0x526bd6['model'];if(_0x334987[_0xa92c('0x2e')]['includeAll']){_0x5e0891[_0xa92c('0x41')]=[{'all':!![]}];}_0x5e0891=_[_0xa92c('0x3a')]({},_0x5e0891,_0x334987[_0xa92c('0x3c')]);return db['MailMessage'][_0xa92c('0x42')](_0x5e0891)[_0xa92c('0x12')](handleEntityNotFound(_0x45cd96,null))[_0xa92c('0x12')](respondWithResult(_0x45cd96,null))[_0xa92c('0x1a')](handleError(_0x45cd96,null));};exports[_0xa92c('0x43')]=function(_0x59989a,_0xe8ef0e){if(_0x59989a['body']['id']){delete _0x59989a[_0xa92c('0x44')]['id'];}return db[_0xa92c('0x28')][_0xa92c('0x42')]({'where':{'id':_0x59989a[_0xa92c('0x3e')]['id']}})['then'](handleEntityNotFound(_0xe8ef0e,null))[_0xa92c('0x12')](saveUpdates(_0x59989a[_0xa92c('0x44')],null))[_0xa92c('0x12')](respondWithResult(_0xe8ef0e,null))[_0xa92c('0x1a')](handleError(_0xe8ef0e,null));};exports[_0xa92c('0x45')]=function(_0x55f1ad,_0x506392){return db[_0xa92c('0x28')][_0xa92c('0x42')]({'where':{'id':_0x55f1ad[_0xa92c('0x3e')]['id']}})['then'](handleEntityNotFound(_0x506392,null))[_0xa92c('0x12')](removeEntity(_0x506392,null))[_0xa92c('0x1a')](handleError(_0x506392,null));};exports['describe']=function(_0x2a1759,_0x3bfa89){return db[_0xa92c('0x28')]['describe']()[_0xa92c('0x12')](respondWithResult(_0x3bfa89,null))[_0xa92c('0x1a')](handleError(_0x3bfa89,null));};exports['create']=function(_0x271d4a,_0x8a3d49){return db['MailMessage']['create'](_0x271d4a[_0xa92c('0x44')])['then'](function(_0x333411){if(_0x333411){if(_0x333411[_0xa92c('0x46')]===_0xa92c('0x47')&&!_0x333411['secret']){var _0x54ed9c,_0x13d555,_0x59f37b;if(_0x271d4a[_0xa92c('0x44')]['to']){_0x13d555=_0x271d4a['body']['to'][_0xa92c('0x48')](',')[0x0];}return db['MailAccount'][_0xa92c('0x49')]({'where':{'id':_0x333411[_0xa92c('0x4a')]},'include':[{'model':db[_0xa92c('0x4b')],'as':_0xa92c('0x4c'),'include':[{'model':db[_0xa92c('0x4d')],'as':_0xa92c('0x4e'),'where':{'email':_0x13d555},'limit':0x1,'order':[[_0xa92c('0x4f'),_0xa92c('0x50')]]}]},{'model':db[_0xa92c('0x51')],'as':_0xa92c('0x52'),'raw':!![]}]})[_0xa92c('0x12')](function(_0x962048){_0x54ed9c=_0x962048;if(_0x54ed9c&&_0x54ed9c[_0xa92c('0x52')]){var _0x5a98cf={'tls':{'rejectUnauthorized':![]}};if(_[_0xa92c('0x53')](_0x54ed9c[_0xa92c('0x52')][_0xa92c('0x54')])){_0x5a98cf[_0xa92c('0x55')]=_0x54ed9c[_0xa92c('0x52')][_0xa92c('0x55')];_0x5a98cf['port']=_0x54ed9c[_0xa92c('0x52')][_0xa92c('0x56')];_0x5a98cf[_0xa92c('0x57')]=_0x54ed9c['Smtp']['secure'];if(_0x54ed9c[_0xa92c('0x52')][_0xa92c('0x58')]){_0x5a98cf[_0xa92c('0x59')]={'user':_0x54ed9c['Smtp'][_0xa92c('0x5a')],'pass':_0x54ed9c['Smtp'][_0xa92c('0x5b')]};}}else{_0x5a98cf[_0xa92c('0x54')]=_0x54ed9c[_0xa92c('0x52')][_0xa92c('0x54')];_0x5a98cf[_0xa92c('0x59')]={'user':_0x54ed9c[_0xa92c('0x52')]['user'],'pass':_0x54ed9c[_0xa92c('0x52')][_0xa92c('0x5b')]};_0x5a98cf[_0xa92c('0x57')]=_0x54ed9c[_0xa92c('0x52')][_0xa92c('0x57')];}if(_0x271d4a[_0xa92c('0x44')][_0xa92c('0x5c')]&&_0x271d4a[_0xa92c('0x44')]['attachments'][_0xa92c('0x33')]){for(var _0x23b829=0x0;_0x23b829<_0x271d4a[_0xa92c('0x44')][_0xa92c('0x5c')][_0xa92c('0x33')];_0x23b829+=0x1){_0x271d4a['body'][_0xa92c('0x5c')][_0x23b829]={'filename':_0x271d4a[_0xa92c('0x44')][_0xa92c('0x5c')][_0x23b829][_0xa92c('0x25')],'path':path[_0xa92c('0x5d')](config[_0xa92c('0x5e')],'server/files/attachments',_0x271d4a[_0xa92c('0x44')]['attachments'][_0x23b829]['basename'])};}}_0x59f37b={'account':_0x5a98cf,'message':_0x271d4a['body']};return;}})['then'](function(){if(_0x54ed9c[_0xa92c('0x4c')]){if(_0x54ed9c[_0xa92c('0x4c')][_0xa92c('0x4e')][_0xa92c('0x33')]){return _0x54ed9c[_0xa92c('0x4c')][_0xa92c('0x4e')][0x0];}else{return db[_0xa92c('0x4d')]['create'](_[_0xa92c('0x5f')](_0x271d4a[_0xa92c('0x44')],{'firstName':_0x271d4a[_0xa92c('0x44')]['to'],'email':_0x271d4a[_0xa92c('0x44')]['to'],'phone':_0x271d4a[_0xa92c('0x44')]['to'],'ListId':_0x54ed9c[_0xa92c('0x60')]}));}}else{throw new Error(_0xa92c('0x61'));}})[_0xa92c('0x12')](function(){if(_0x59f37b){return respondWithRpcPromise(_0xa92c('0x62'),'sendMail',_0x59f37b,client9003)[_0xa92c('0x12')](function(_0x26ed63){return _0x333411['update']({'read':!![],'messageId':_0x26ed63['messageId'],'sentAt':moment()['format'](_0xa92c('0x63'))});})[_0xa92c('0x1a')](function(_0x644b87){logger[_0xa92c('0x15')]('%s',JSON['stringify'](_0x644b87));return _0x333411;});}return _0x333411;});}return _0x333411;}})[_0xa92c('0x12')](respondWithResult(_0x8a3d49,0xc9))[_0xa92c('0x1a')](handleError(_0x8a3d49,null));};exports['accept']=function(_0xd6f76c,_0x4c8ec6){var _0x5b9917={'agent':{},'channel':_0xa92c('0x64')};if(_0xd6f76c[_0xa92c('0x44')]['id']){delete _0xd6f76c[_0xa92c('0x44')]['id'];}_0xd6f76c['body'][_0xa92c('0x65')]=!![];_0xd6f76c[_0xa92c('0x44')][_0xa92c('0x66')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0xd6f76c[_0xa92c('0x44')][_0xa92c('0x67')]=_0xd6f76c[_0xa92c('0x44')][_0xa92c('0x67')]||_0xd6f76c['user']['id'];_0x5b9917[_0xa92c('0x68')]['id']=_0xd6f76c['body'][_0xa92c('0x67')];return db[_0xa92c('0x28')][_0xa92c('0x42')]({'where':{'id':_0xd6f76c[_0xa92c('0x3e')]['id'],'UserId':null}})[_0xa92c('0x12')](handleEntityNotFound(_0x4c8ec6,null))[_0xa92c('0x12')](saveUpdates(_0xd6f76c[_0xa92c('0x44')],null))[_0xa92c('0x12')](function(_0x33ffcb){if(_0x33ffcb){_0x5b9917[_0xa92c('0x17')]=_0x33ffcb[_0xa92c('0x69')]({'plain':!![]});return db[_0xa92c('0x6a')][_0xa92c('0x42')]({'where':{'id':_0x33ffcb[_0xa92c('0x6b')]}});}return null;})[_0xa92c('0x12')](handleEntityNotFound(_0x4c8ec6,null))[_0xa92c('0x12')](function(_0x223628){if(_0x223628){return _0x223628[_0xa92c('0x43')]({'UserId':_0xd6f76c[_0xa92c('0x44')]['UserId'],'read1stAt':_[_0xa92c('0x53')](_0x223628[_0xa92c('0x6c')])?moment()['format'](_0xa92c('0x63')):undefined});}return null;})['then'](function(_0x14d782){if(_0x14d782){_0x5b9917[_0xa92c('0x6d')]=_0x14d782[_0xa92c('0x69')]({'plain':!![]});interaction_log[_0xa92c('0x18')](_0xa92c('0x6e'),_0xd6f76c[_0xa92c('0x5a')]['id'],_0xd6f76c[_0xa92c('0x5a')]['name'],_0xd6f76c[_0xa92c('0x5a')][_0xa92c('0x6f')],_0x5b9917['interaction']['id'],_0xd6f76c[_0xa92c('0x44')]?JSON[_0xa92c('0x70')](_0xd6f76c[_0xa92c('0x44')]):'null');return respondWithRpcPromise(_0xa92c('0x71'),_0xa92c('0x72'),_0x5b9917);}return null;})[_0xa92c('0x12')](function(_0x3ea24a){var _0x1f9f29=_0xa92c('0x73')+_0x3ea24a[_0xa92c('0x17')][_0xa92c('0x74')];return db[_0xa92c('0x75')][_0xa92c('0x2e')](_0x1f9f29,{'type':db[_0xa92c('0x76')][_0xa92c('0x77')][_0xa92c('0x78')],'raw':!![]})[_0xa92c('0x12')](function(_0x351af5){return _0x351af5;});})['then'](function(_0x1182b7){if(_0x1182b7){_0x5b9917[_0xa92c('0x17')][_0xa92c('0x79')]=_0x1182b7[0x0];if(!_0xd6f76c[_0xa92c('0x44')][_0xa92c('0x67')])return;return db['User'][_0xa92c('0x42')]({'where':{'id':_0xd6f76c['body'][_0xa92c('0x67')],'role':'agent'},'attributes':['id',_0xa92c('0x25'),_0xa92c('0x7a'),'email',_0xa92c('0x7b')],'raw':!![]});}return null;})[_0xa92c('0x12')](function(_0x4c3b1a){if(!_0x4c3b1a)return null;_0x5b9917[_0xa92c('0x17')]['agent']=_0x4c3b1a;return _0x5b9917;})[_0xa92c('0x12')](function(_0x3d9144){if(_0x3d9144){if(_0xd6f76c['body']['manual']){_0x5b9917['message'][_0xa92c('0x7c')]=util[_0xa92c('0x7d')]('SIP/%s',_0xd6f76c[_0xa92c('0x5a')][_0xa92c('0x25')]);_0x5b9917[_0xa92c('0x17')]['channel']=_0x5b9917[_0xa92c('0x7e')];_0x5b9917[_0xa92c('0x17')][_0xa92c('0x7f')]=_0x5b9917['channel'];_0x5b9917['message']['event']='accept';_0x5b9917['message']['body']=htmlToText['fromString'](_0x5b9917[_0xa92c('0x17')]['body']);return respondWithRpcPromise(_0xa92c('0x80'),'EventManager',{'event':'acceptmessage','message':_0x5b9917['message']},client9002)[_0xa92c('0x12')](function(){return _0x5b9917;});}return _0x5b9917;}return null;})[_0xa92c('0x12')](respondWithResult(_0x4c8ec6,null))[_0xa92c('0x1a')](handleError(_0x4c8ec6,null));};exports[_0xa92c('0x81')]=function(_0x136bae,_0x4fe6b3){var _0x5e26ee={'agent':{},'channel':_0xa92c('0x64')};if(_0x136bae['body']['id']){delete _0x136bae[_0xa92c('0x44')]['id'];}_0x136bae[_0xa92c('0x44')][_0xa92c('0x67')]=_0x136bae[_0xa92c('0x44')][_0xa92c('0x67')]||_0x136bae[_0xa92c('0x5a')]['id'];_0x5e26ee[_0xa92c('0x68')]['id']=_0x136bae[_0xa92c('0x44')][_0xa92c('0x67')];return db[_0xa92c('0x28')][_0xa92c('0x42')]({'where':{'id':_0x136bae[_0xa92c('0x3e')]['id'],'UserId':null}})[_0xa92c('0x12')](handleEntityNotFound(_0x4fe6b3,null))[_0xa92c('0x12')](function(_0x953323){if(_0x953323){_0x5e26ee[_0xa92c('0x17')]=_0x953323[_0xa92c('0x69')]({'plain':!![]});return db[_0xa92c('0x6a')][_0xa92c('0x42')]({'where':{'id':_0x953323['MailInteractionId']}});}return null;})[_0xa92c('0x12')](handleEntityNotFound(_0x4fe6b3,null))[_0xa92c('0x12')](function(_0x549cdc){if(_0x549cdc){_0x5e26ee[_0xa92c('0x6d')]=_0x549cdc['get']({'plain':!![]});interaction_log[_0xa92c('0x18')](_0xa92c('0x82'),_0x136bae['user']['id'],_0x136bae[_0xa92c('0x5a')][_0xa92c('0x25')],_0x136bae[_0xa92c('0x5a')][_0xa92c('0x6f')],_0x5e26ee[_0xa92c('0x6d')]['id'],_0x136bae[_0xa92c('0x44')]?JSON[_0xa92c('0x70')](_0x136bae[_0xa92c('0x44')]):_0xa92c('0x83'));return respondWithRpcPromise(_0xa92c('0x84'),_0xa92c('0x85'),_0x5e26ee);}return null;})[_0xa92c('0x12')](function(_0x269019){var _0x20403b=_0xa92c('0x73')+_0x269019[_0xa92c('0x17')][_0xa92c('0x74')];return db[_0xa92c('0x75')][_0xa92c('0x2e')](_0x20403b,{'type':db[_0xa92c('0x76')][_0xa92c('0x77')][_0xa92c('0x78')],'raw':!![]})[_0xa92c('0x12')](function(_0x15643f){return _0x15643f;});})[_0xa92c('0x12')](function(_0x4acbb3){if(_0x4acbb3){_0x5e26ee[_0xa92c('0x17')][_0xa92c('0x79')]=_0x4acbb3[0x0];if(!_0x136bae[_0xa92c('0x44')]['UserId'])return;return db[_0xa92c('0x86')][_0xa92c('0x42')]({'where':{'id':_0x136bae[_0xa92c('0x44')][_0xa92c('0x67')],'role':_0xa92c('0x68')},'attributes':['id',_0xa92c('0x25'),_0xa92c('0x7a'),_0xa92c('0x87'),'internal'],'raw':!![]});}return null;})[_0xa92c('0x12')](function(_0x362531){if(!_0x362531)return null;_0x5e26ee['message']['agent']=_0x362531;return _0x5e26ee;})['then'](function(_0x4a6e0c){if(_0x4a6e0c){_0x4a6e0c['message'][_0xa92c('0x7c')]=util[_0xa92c('0x7d')]('SIP/%s',_0x136bae['user'][_0xa92c('0x25')]);_0x4a6e0c['message'][_0xa92c('0x7e')]=_0x5e26ee[_0xa92c('0x7e')];_0x4a6e0c['message']['motionChannel']=_0x5e26ee[_0xa92c('0x7e')];_0x4a6e0c[_0xa92c('0x17')][_0xa92c('0x88')]=_0xa92c('0x81');_0x4a6e0c[_0xa92c('0x17')][_0xa92c('0x44')]=htmlToText['fromString'](_0x5e26ee[_0xa92c('0x17')][_0xa92c('0x44')]);respondWithRpcPromise(_0xa92c('0x80'),'EventManager',{'event':_0xa92c('0x89'),'message':_0x4a6e0c['message']},client9002);return _0x5e26ee;}return null;})['then'](respondWithResult(_0x4fe6b3,null))[_0xa92c('0x1a')](handleError(_0x4fe6b3,null));};exports['download']=function(_0xf455c4,_0x1d4b19){var _0x1dfb38=moment()['unix']()['toString']();var _0x2dcab6=path['join'](config[_0xa92c('0x5e')],'server',_0xa92c('0x8a'),_0xa92c('0x8b'));var _0x3646e9=path[_0xa92c('0x5d')](config[_0xa92c('0x5e')],_0xa92c('0x8c'),_0xa92c('0x8a'),_0xa92c('0x5c'));var _0xc5e894=util[_0xa92c('0x7d')]('message-%s.eml',_0x1dfb38);return db[_0xa92c('0x28')][_0xa92c('0x42')]({'where':{'id':_0xf455c4[_0xa92c('0x3e')]['id']},'attributes':['id','body',_0xa92c('0x8d'),'to','cc','bcc',_0xa92c('0x8e'),_0xa92c('0x8f')],'include':_0xf455c4['query'][_0xa92c('0x5c')]?[{'model':db['Attachment'],'as':_0xa92c('0x90')}]:undefined})[_0xa92c('0x12')](handleEntityNotFound(_0x1d4b19,null))[_0xa92c('0x12')](function(_0x3c7e89){if(_0x3c7e89){var _0x33b10f=_0x3c7e89;var _0x28db6a={'from':_0x33b10f[_0xa92c('0x8d')],'to':_0x33b10f['to'],'subject':_0x33b10f[_0xa92c('0x8e')],'html':_0x33b10f['body'],'headers':{'Date':moment(_0x33b10f[_0xa92c('0x8f')])[_0xa92c('0x7d')](_0xa92c('0x91'))},'attachments':[]};if(_0x3c7e89['cc']){_0x28db6a[_0xa92c('0x92')]['Cc']=_0x3c7e89['cc'];}if(_0x3c7e89['bcc']){_0x28db6a[_0xa92c('0x92')][_0xa92c('0x93')]=_0x3c7e89[_0xa92c('0x94')];}return new BPromise(function(_0x3b435d,_0x290ea4){if(_0x3c7e89['Attachments']){for(var _0x176461=0x0;_0x176461<_0x3c7e89[_0xa92c('0x90')][_0xa92c('0x33')];_0x176461++){var _0x35bdda=_0x3c7e89[_0xa92c('0x90')][_0x176461];var _0xc2bc0a=path[_0xa92c('0x5d')](_0x3646e9,_0x35bdda[_0xa92c('0x95')]);if(fs[_0xa92c('0x96')](_0xc2bc0a)){_0x28db6a[_0xa92c('0x5c')][_0xa92c('0x97')]({'name':_0x35bdda['name'],'contentType':_0x35bdda[_0xa92c('0x2a')],'data':fs[_0xa92c('0x98')](_0xc2bc0a)});}}}emlformat[_0xa92c('0x99')](_0x28db6a,function(_0x46025a,_0x44ad18){if(_0x46025a)return _0x290ea4(_0x46025a);fs['writeFileSync'](path[_0xa92c('0x5d')](_0x2dcab6,_0xc5e894),_0x44ad18);return _0x3b435d(_0x44ad18);});});}})[_0xa92c('0x12')](function(_0xde8ee8){if(_0xde8ee8){return _0x1d4b19[_0xa92c('0x9a')](path[_0xa92c('0x5d')](_0x2dcab6,_0xc5e894),_0xc5e894,function(_0x24bf76){if(!_0x24bf76)fs['unlinkSync'](path[_0xa92c('0x5d')](_0x2dcab6,_0xc5e894));});}})[_0xa92c('0x1a')](handleError(_0x1d4b19,null));};
\ No newline at end of file
+var _0xb53b=['role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','fromString','EventManager','acceptmessage','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','fullname','reject','rejectmessage','download','unix','toString','root','server','files','message-%s.eml','from','bcc','subject','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','request','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','MailMessage,\x20%s,\x20%s','result','catch','status','offset','undefined','limit','count','set','Content-Range','json','update','destroy','sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','include','rows','show','params','includeAll','find','body','describe','create','out','split','findOne','MailAccountId','CmList','List','Contacts','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','pass','auth','attachments','join','CmContact','SendMail','sendMail','messageId','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','agent','get','MailInteraction','read1stAt','format','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user'];(function(_0x4c440b,_0x3ea627){var _0x2d48cf=function(_0x56bac7){while(--_0x56bac7){_0x4c440b['push'](_0x4c440b['shift']());}};_0x2d48cf(++_0x3ea627);}(_0xb53b,0xd7));var _0xbb53=function(_0x28669c,_0x1f62c4){_0x28669c=_0x28669c-0x0;var _0x4a3af6=_0xb53b[_0x28669c];return _0x4a3af6;};'use strict';var emlformat=require(_0xbb53('0x0'));var moment=require(_0xbb53('0x1'));var BPromise=require(_0xbb53('0x2'));var util=require(_0xbb53('0x3'));var path=require('path');var fs=require('fs');var _=require(_0xbb53('0x4'));var Redis=require(_0xbb53('0x5'));var htmlToText=require('html-to-text');var qs=require(_0xbb53('0x6'));var logger=require(_0xbb53('0x7'))('api');var interaction_log=require(_0xbb53('0x7'))(_0xbb53('0x8'));var config=require(_0xbb53('0x9'));var db=require(_0xbb53('0xa'))['db'];config[_0xbb53('0xb')]=_[_0xbb53('0xc')](config[_0xbb53('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xbb53('0xd'))(new Redis(config['redis']));require(_0xbb53('0xe'))[_0xbb53('0xf')](socket);var jayson=require(_0xbb53('0x10'));var client=jayson[_0xbb53('0x11')][_0xbb53('0x12')]({'port':0x232c});var client9003=jayson['client'][_0xbb53('0x12')]({'port':0x232b});var client9002=jayson[_0xbb53('0x11')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2469a0,_0x27bbdf,_0x5b79ac,_0x21517c){return new BPromise(function(_0x144f2e,_0x1870d6){var _0xb7da6=_0x21517c||client;return _0xb7da6[_0xbb53('0x13')](_0x2469a0,_0x5b79ac)[_0xbb53('0x14')](function(_0x485207){logger[_0xbb53('0x15')]('MailMessage,\x20%s,\x20%s',_0x27bbdf,'request\x20sent');logger[_0xbb53('0x16')](_0xbb53('0x17'),_0x27bbdf,_0xbb53('0x18'),JSON[_0xbb53('0x19')](_0x485207));if(_0x485207['error']){if(_0x485207[_0xbb53('0x1a')]['code']===0x1f4){logger[_0xbb53('0x1a')]('MailMessage,\x20%s,\x20%s',_0x27bbdf,_0x485207['error'][_0xbb53('0x1b')]);return _0x1870d6(_0x485207[_0xbb53('0x1a')]['message']);}logger[_0xbb53('0x1a')](_0xbb53('0x1c'),_0x27bbdf,_0x485207[_0xbb53('0x1a')][_0xbb53('0x1b')]);return _0x144f2e(_0x485207[_0xbb53('0x1a')]['message']);}else{logger[_0xbb53('0x15')](_0xbb53('0x1c'),_0x27bbdf,_0xbb53('0x18'));_0x144f2e(_0x485207[_0xbb53('0x1d')]['message']);}})[_0xbb53('0x1e')](function(_0x4ae2c4){logger[_0xbb53('0x1a')](_0xbb53('0x1c'),_0x27bbdf,_0x4ae2c4);_0x1870d6(_0x4ae2c4);});});}function respondWithResult(_0x42ee66,_0x629e4c){_0x629e4c=_0x629e4c||0xc8;return function(_0x180aa3){if(_0x180aa3){return _0x42ee66[_0xbb53('0x1f')](_0x629e4c)['json'](_0x180aa3);}};}function respondWithFilteredResult(_0x4484a7,_0x5031a1){return function(_0x58021f){if(_0x58021f){var _0x173141=typeof _0x5031a1[_0xbb53('0x20')]===_0xbb53('0x21')&&typeof _0x5031a1[_0xbb53('0x22')]===_0xbb53('0x21');var _0x30344e=_0x58021f['count'];var _0x1b88c4=_0x173141?0x0:_0x5031a1[_0xbb53('0x20')];var _0x2df845=_0x173141?_0x58021f[_0xbb53('0x23')]:_0x5031a1[_0xbb53('0x20')]+_0x5031a1[_0xbb53('0x22')];var _0x4d3f57;if(_0x2df845>=_0x30344e){_0x2df845=_0x30344e;_0x4d3f57=0xc8;}else{_0x4d3f57=0xce;}_0x4484a7[_0xbb53('0x1f')](_0x4d3f57);return _0x4484a7[_0xbb53('0x24')](_0xbb53('0x25'),_0x1b88c4+'-'+_0x2df845+'/'+_0x30344e)[_0xbb53('0x26')](_0x58021f);}return null;};}function saveUpdates(_0x55407f){return function(_0x2ae982){if(_0x2ae982){return _0x2ae982[_0xbb53('0x27')](_0x55407f)['then'](function(_0x2fe1cb){return _0x2fe1cb;});}return null;};}function removeEntity(_0x25bdfd){return function(_0x5542ef){if(_0x5542ef){return _0x5542ef[_0xbb53('0x28')]()[_0xbb53('0x14')](function(){_0x25bdfd[_0xbb53('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x530dee){return function(_0x49e905){if(!_0x49e905){_0x530dee[_0xbb53('0x29')](0x194);}return _0x49e905;};}function handleError(_0x46fdc2,_0x4f7a18){_0x4f7a18=_0x4f7a18||0x1f4;return function(_0xd3474a){logger[_0xbb53('0x1a')](_0xd3474a[_0xbb53('0x2a')]);if(_0xd3474a[_0xbb53('0x2b')]){delete _0xd3474a['name'];}_0x46fdc2[_0xbb53('0x1f')](_0x4f7a18)[_0xbb53('0x2c')](_0xd3474a);};}exports[_0xbb53('0x2d')]=function(_0x5f8005,_0xddc430){var _0x3ef8c1={},_0x4f65fe={},_0x4dfa8a={'count':0x0,'rows':[]};var _0x32bf6e=_[_0xbb53('0x2e')](db[_0xbb53('0x2f')][_0xbb53('0x30')],function(_0x370e7c){return{'name':_0x370e7c[_0xbb53('0x31')],'type':_0x370e7c[_0xbb53('0x32')][_0xbb53('0x33')]};});_0x4f65fe[_0xbb53('0x34')]=_[_0xbb53('0x2e')](_0x32bf6e,_0xbb53('0x2b'));_0x4f65fe[_0xbb53('0x35')]=_[_0xbb53('0x36')](_0x5f8005[_0xbb53('0x35')]);_0x4f65fe[_0xbb53('0x37')]=_[_0xbb53('0x38')](_0x4f65fe['model'],_0x4f65fe[_0xbb53('0x35')]);_0x3ef8c1[_0xbb53('0x39')]=_[_0xbb53('0x38')](_0x4f65fe['model'],qs[_0xbb53('0x3a')](_0x5f8005[_0xbb53('0x35')][_0xbb53('0x3a')]));_0x3ef8c1[_0xbb53('0x39')]=_0x3ef8c1[_0xbb53('0x39')][_0xbb53('0x3b')]?_0x3ef8c1['attributes']:_0x4f65fe['model'];if(!_0x5f8005['query'][_0xbb53('0x3c')]('nolimit')){_0x3ef8c1[_0xbb53('0x22')]=qs[_0xbb53('0x22')](_0x5f8005[_0xbb53('0x35')][_0xbb53('0x22')]);_0x3ef8c1[_0xbb53('0x20')]=qs[_0xbb53('0x20')](_0x5f8005[_0xbb53('0x35')][_0xbb53('0x20')]);}_0x3ef8c1[_0xbb53('0x3d')]=qs[_0xbb53('0x3e')](_0x5f8005[_0xbb53('0x35')]['sort']);_0x3ef8c1[_0xbb53('0x3f')]=qs[_0xbb53('0x37')](_[_0xbb53('0x40')](_0x5f8005[_0xbb53('0x35')],_0x4f65fe[_0xbb53('0x37')]),_0x32bf6e);if(_0x5f8005['query'][_0xbb53('0x41')]){_0x3ef8c1[_0xbb53('0x3f')]=_['merge'](_0x3ef8c1[_0xbb53('0x3f')],{'$or':_[_0xbb53('0x2e')](_0x32bf6e,function(_0x1a2581){if(_0x1a2581[_0xbb53('0x32')]!==_0xbb53('0x42')){var _0x516191={};_0x516191[_0x1a2581[_0xbb53('0x2b')]]={'$like':'%'+_0x5f8005[_0xbb53('0x35')]['filter']+'%'};return _0x516191;}})});}_0x3ef8c1=_[_0xbb53('0x43')]({},_0x3ef8c1,_0x5f8005[_0xbb53('0x44')]);var _0x5c01ac={'where':_0x3ef8c1[_0xbb53('0x3f')]};return db[_0xbb53('0x2f')][_0xbb53('0x23')](_0x5c01ac)[_0xbb53('0x14')](function(_0x570487){_0x4dfa8a[_0xbb53('0x23')]=_0x570487;if(_0x5f8005[_0xbb53('0x35')]['includeAll']){_0x3ef8c1[_0xbb53('0x45')]=[{'all':!![]}];}return db[_0xbb53('0x2f')]['findAll'](_0x3ef8c1);})[_0xbb53('0x14')](function(_0x3f9b0e){_0x4dfa8a[_0xbb53('0x46')]=_0x3f9b0e;return _0x4dfa8a;})[_0xbb53('0x14')](respondWithFilteredResult(_0xddc430,_0x3ef8c1))['catch'](handleError(_0xddc430,null));};exports[_0xbb53('0x47')]=function(_0x59a030,_0x41036b){var _0x542f95={'raw':!![],'where':{'id':_0x59a030[_0xbb53('0x48')]['id']}},_0x536a79={};_0x536a79[_0xbb53('0x34')]=_[_0xbb53('0x36')](db[_0xbb53('0x2f')][_0xbb53('0x30')]);_0x536a79[_0xbb53('0x35')]=_['keys'](_0x59a030[_0xbb53('0x35')]);_0x536a79[_0xbb53('0x37')]=_[_0xbb53('0x38')](_0x536a79[_0xbb53('0x34')],_0x536a79[_0xbb53('0x35')]);_0x542f95[_0xbb53('0x39')]=_['intersection'](_0x536a79['model'],qs[_0xbb53('0x3a')](_0x59a030[_0xbb53('0x35')][_0xbb53('0x3a')]));_0x542f95[_0xbb53('0x39')]=_0x542f95[_0xbb53('0x39')][_0xbb53('0x3b')]?_0x542f95[_0xbb53('0x39')]:_0x536a79[_0xbb53('0x34')];if(_0x59a030[_0xbb53('0x35')][_0xbb53('0x49')]){_0x542f95[_0xbb53('0x45')]=[{'all':!![]}];}_0x542f95=_[_0xbb53('0x43')]({},_0x542f95,_0x59a030[_0xbb53('0x44')]);return db['MailMessage'][_0xbb53('0x4a')](_0x542f95)[_0xbb53('0x14')](handleEntityNotFound(_0x41036b,null))[_0xbb53('0x14')](respondWithResult(_0x41036b,null))['catch'](handleError(_0x41036b,null));};exports['update']=function(_0x569213,_0x50dc38){if(_0x569213[_0xbb53('0x4b')]['id']){delete _0x569213['body']['id'];}return db[_0xbb53('0x2f')]['find']({'where':{'id':_0x569213[_0xbb53('0x48')]['id']}})[_0xbb53('0x14')](handleEntityNotFound(_0x50dc38,null))[_0xbb53('0x14')](saveUpdates(_0x569213[_0xbb53('0x4b')],null))[_0xbb53('0x14')](respondWithResult(_0x50dc38,null))['catch'](handleError(_0x50dc38,null));};exports[_0xbb53('0x28')]=function(_0x18cd5b,_0x42f28c){return db[_0xbb53('0x2f')][_0xbb53('0x4a')]({'where':{'id':_0x18cd5b[_0xbb53('0x48')]['id']}})[_0xbb53('0x14')](handleEntityNotFound(_0x42f28c,null))[_0xbb53('0x14')](removeEntity(_0x42f28c,null))[_0xbb53('0x1e')](handleError(_0x42f28c,null));};exports[_0xbb53('0x4c')]=function(_0xddfdbc,_0x219c90){return db[_0xbb53('0x2f')][_0xbb53('0x4c')]()[_0xbb53('0x14')](respondWithResult(_0x219c90,null))[_0xbb53('0x1e')](handleError(_0x219c90,null));};exports[_0xbb53('0x4d')]=function(_0x248528,_0x58e5a5){return db['MailMessage'][_0xbb53('0x4d')](_0x248528[_0xbb53('0x4b')])['then'](function(_0x44fd80){if(_0x44fd80){if(_0x44fd80['direction']===_0xbb53('0x4e')&&!_0x44fd80['secret']){var _0x2d91b3,_0x209fc9,_0x59b59d;if(_0x248528[_0xbb53('0x4b')]['to']){_0x209fc9=_0x248528[_0xbb53('0x4b')]['to'][_0xbb53('0x4f')](',')[0x0];}return db['MailAccount'][_0xbb53('0x50')]({'where':{'id':_0x44fd80[_0xbb53('0x51')]},'include':[{'model':db[_0xbb53('0x52')],'as':_0xbb53('0x53'),'include':[{'model':db['CmContact'],'as':_0xbb53('0x54'),'where':{'email':_0x209fc9},'limit':0x1,'order':[['updatedAt',_0xbb53('0x55')]]}]},{'model':db[_0xbb53('0x56')],'as':_0xbb53('0x57'),'raw':!![]}]})[_0xbb53('0x14')](function(_0x3c1168){_0x2d91b3=_0x3c1168;if(_0x2d91b3&&_0x2d91b3[_0xbb53('0x57')]){var _0x21526a={'tls':{'rejectUnauthorized':![]}};if(_[_0xbb53('0x58')](_0x2d91b3[_0xbb53('0x57')][_0xbb53('0x59')])){_0x21526a[_0xbb53('0x5a')]=_0x2d91b3['Smtp']['host'];_0x21526a['port']=_0x2d91b3[_0xbb53('0x57')][_0xbb53('0x5b')];_0x21526a[_0xbb53('0x5c')]=_0x2d91b3['Smtp']['secure'];if(_0x2d91b3[_0xbb53('0x57')]['authentication']){_0x21526a['auth']={'user':_0x2d91b3['Smtp']['user'],'pass':_0x2d91b3[_0xbb53('0x57')][_0xbb53('0x5d')]};}}else{_0x21526a['service']=_0x2d91b3[_0xbb53('0x57')][_0xbb53('0x59')];_0x21526a[_0xbb53('0x5e')]={'user':_0x2d91b3[_0xbb53('0x57')]['user'],'pass':_0x2d91b3[_0xbb53('0x57')][_0xbb53('0x5d')]};_0x21526a[_0xbb53('0x5c')]=_0x2d91b3[_0xbb53('0x57')][_0xbb53('0x5c')];}if(_0x248528[_0xbb53('0x4b')][_0xbb53('0x5f')]&&_0x248528['body'][_0xbb53('0x5f')][_0xbb53('0x3b')]){for(var _0x5d92f4=0x0;_0x5d92f4<_0x248528[_0xbb53('0x4b')]['attachments'][_0xbb53('0x3b')];_0x5d92f4+=0x1){_0x248528[_0xbb53('0x4b')][_0xbb53('0x5f')][_0x5d92f4]={'filename':_0x248528[_0xbb53('0x4b')][_0xbb53('0x5f')][_0x5d92f4][_0xbb53('0x2b')],'path':path[_0xbb53('0x60')](config['root'],'server/files/attachments',_0x248528['body'][_0xbb53('0x5f')][_0x5d92f4]['basename'])};}}_0x59b59d={'account':_0x21526a,'message':_0x248528[_0xbb53('0x4b')]};return;}})[_0xbb53('0x14')](function(){if(_0x2d91b3['List']){if(_0x2d91b3[_0xbb53('0x53')][_0xbb53('0x54')]['length']){return _0x2d91b3[_0xbb53('0x53')]['Contacts'][0x0];}else{return db[_0xbb53('0x61')][_0xbb53('0x4d')](_[_0xbb53('0xc')](_0x248528[_0xbb53('0x4b')],{'firstName':_0x248528[_0xbb53('0x4b')]['to'],'email':_0x248528[_0xbb53('0x4b')]['to'],'phone':_0x248528[_0xbb53('0x4b')]['to'],'ListId':_0x2d91b3['ListId']}));}}else{throw new Error('List\x20not\x20found');}})[_0xbb53('0x14')](function(){if(_0x59b59d){return respondWithRpcPromise(_0xbb53('0x62'),_0xbb53('0x63'),_0x59b59d,client9003)['then'](function(_0x29391b){return _0x44fd80[_0xbb53('0x27')]({'read':!![],'messageId':_0x29391b[_0xbb53('0x64')],'sentAt':moment()['format'](_0xbb53('0x65'))});})[_0xbb53('0x1e')](function(_0x5e139a){logger['error']('%s',JSON['stringify'](_0x5e139a));return _0x44fd80;});}return _0x44fd80;});}return _0x44fd80;}})[_0xbb53('0x14')](respondWithResult(_0x58e5a5,0xc9))['catch'](handleError(_0x58e5a5,null));};exports[_0xbb53('0x66')]=function(_0x58137b,_0xe4ea95){var _0x40ca2e={'agent':{},'channel':_0xbb53('0x67')};if(_0x58137b[_0xbb53('0x4b')]['id']){delete _0x58137b[_0xbb53('0x4b')]['id'];}_0x58137b[_0xbb53('0x4b')][_0xbb53('0x68')]=!![];_0x58137b['body'][_0xbb53('0x69')]=moment()['format'](_0xbb53('0x65'));_0x58137b[_0xbb53('0x4b')][_0xbb53('0x6a')]=_0x58137b['body']['UserId']||_0x58137b['user']['id'];_0x40ca2e[_0xbb53('0x6b')]['id']=_0x58137b[_0xbb53('0x4b')]['UserId'];return db['MailMessage']['find']({'where':{'id':_0x58137b['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0xe4ea95,null))[_0xbb53('0x14')](saveUpdates(_0x58137b[_0xbb53('0x4b')],null))[_0xbb53('0x14')](function(_0x29cd8b){if(_0x29cd8b){_0x40ca2e['message']=_0x29cd8b[_0xbb53('0x6c')]({'plain':!![]});return db[_0xbb53('0x6d')][_0xbb53('0x4a')]({'where':{'id':_0x29cd8b['MailInteractionId']}});}return null;})[_0xbb53('0x14')](handleEntityNotFound(_0xe4ea95,null))['then'](function(_0x199e62){if(_0x199e62){return _0x199e62[_0xbb53('0x27')]({'UserId':_0x58137b[_0xbb53('0x4b')][_0xbb53('0x6a')],'read1stAt':_[_0xbb53('0x58')](_0x199e62[_0xbb53('0x6e')])?moment()[_0xbb53('0x6f')](_0xbb53('0x65')):undefined});}return null;})['then'](function(_0x2d82ad){if(_0x2d82ad){_0x40ca2e[_0xbb53('0x70')]=_0x2d82ad[_0xbb53('0x6c')]({'plain':!![]});interaction_log[_0xbb53('0x15')](_0xbb53('0x71'),_0x58137b[_0xbb53('0x72')]['id'],_0x58137b[_0xbb53('0x72')]['name'],_0x58137b[_0xbb53('0x72')][_0xbb53('0x73')],_0x40ca2e[_0xbb53('0x70')]['id'],_0x58137b['body']?JSON[_0xbb53('0x19')](_0x58137b['body']):_0xbb53('0x74'));return respondWithRpcPromise(_0xbb53('0x75'),_0xbb53('0x76'),_0x40ca2e);}return null;})['then'](function(_0x3eebbc){var _0x326372=_0xbb53('0x77')+_0x3eebbc[_0xbb53('0x1b')][_0xbb53('0x78')];return db['sequelize'][_0xbb53('0x35')](_0x326372,{'type':db[_0xbb53('0x79')][_0xbb53('0x7a')][_0xbb53('0x7b')],'raw':!![]})[_0xbb53('0x14')](function(_0x4a3e6b){return _0x4a3e6b;});})[_0xbb53('0x14')](function(_0x2b56ff){if(_0x2b56ff){_0x40ca2e[_0xbb53('0x1b')][_0xbb53('0x7c')]=_0x2b56ff[0x0];if(!_0x58137b[_0xbb53('0x4b')][_0xbb53('0x6a')])return;return db[_0xbb53('0x7d')]['find']({'where':{'id':_0x58137b[_0xbb53('0x4b')]['UserId'],'role':_0xbb53('0x6b')},'attributes':['id',_0xbb53('0x2b'),'fullname',_0xbb53('0x7e'),_0xbb53('0x7f')],'raw':!![]});}return null;})['then'](function(_0x10b74f){if(!_0x10b74f)return null;_0x40ca2e['message'][_0xbb53('0x6b')]=_0x10b74f;return _0x40ca2e;})[_0xbb53('0x14')](function(_0x2fa7a3){if(_0x2fa7a3){if(_0x58137b['body'][_0xbb53('0x80')]){_0x40ca2e[_0xbb53('0x1b')][_0xbb53('0x81')]=util[_0xbb53('0x6f')](_0xbb53('0x82'),_0x58137b[_0xbb53('0x72')][_0xbb53('0x2b')]);_0x40ca2e[_0xbb53('0x1b')][_0xbb53('0x83')]=_0x40ca2e['channel'];_0x40ca2e['message'][_0xbb53('0x84')]=_0x40ca2e[_0xbb53('0x83')];_0x40ca2e[_0xbb53('0x1b')][_0xbb53('0x85')]='accept';_0x40ca2e[_0xbb53('0x1b')][_0xbb53('0x4b')]=htmlToText[_0xbb53('0x86')](_0x40ca2e[_0xbb53('0x1b')][_0xbb53('0x4b')]);return respondWithRpcPromise(_0xbb53('0x87'),_0xbb53('0x87'),{'event':_0xbb53('0x88'),'message':_0x40ca2e[_0xbb53('0x1b')]},client9002)[_0xbb53('0x14')](function(){return _0x40ca2e;});}return _0x40ca2e;}return null;})[_0xbb53('0x14')](respondWithResult(_0xe4ea95,null))['catch'](handleError(_0xe4ea95,null));};exports['reject']=function(_0x32aa6f,_0x3e0153){var _0x881704={'agent':{},'channel':_0xbb53('0x67')};if(_0x32aa6f['body']['id']){delete _0x32aa6f[_0xbb53('0x4b')]['id'];}_0x32aa6f[_0xbb53('0x4b')][_0xbb53('0x6a')]=_0x32aa6f[_0xbb53('0x4b')]['UserId']||_0x32aa6f[_0xbb53('0x72')]['id'];_0x881704[_0xbb53('0x6b')]['id']=_0x32aa6f[_0xbb53('0x4b')][_0xbb53('0x6a')];return db['MailMessage'][_0xbb53('0x4a')]({'where':{'id':_0x32aa6f[_0xbb53('0x48')]['id'],'UserId':null}})[_0xbb53('0x14')](handleEntityNotFound(_0x3e0153,null))['then'](function(_0x48fcd3){if(_0x48fcd3){_0x881704[_0xbb53('0x1b')]=_0x48fcd3['get']({'plain':!![]});return db[_0xbb53('0x6d')][_0xbb53('0x4a')]({'where':{'id':_0x48fcd3[_0xbb53('0x89')]}});}return null;})['then'](handleEntityNotFound(_0x3e0153,null))[_0xbb53('0x14')](function(_0x2a40dd){if(_0x2a40dd){_0x881704['interaction']=_0x2a40dd[_0xbb53('0x6c')]({'plain':!![]});interaction_log['info'](_0xbb53('0x8a'),_0x32aa6f[_0xbb53('0x72')]['id'],_0x32aa6f[_0xbb53('0x72')]['name'],_0x32aa6f[_0xbb53('0x72')][_0xbb53('0x73')],_0x881704[_0xbb53('0x70')]['id'],_0x32aa6f['body']?JSON[_0xbb53('0x19')](_0x32aa6f[_0xbb53('0x4b')]):'null');return respondWithRpcPromise(_0xbb53('0x8b'),_0xbb53('0x8c'),_0x881704);}return null;})['then'](function(_0x52e3b2){var _0x3d55c4=_0xbb53('0x77')+_0x52e3b2[_0xbb53('0x1b')]['ContactId'];return db[_0xbb53('0x8d')][_0xbb53('0x35')](_0x3d55c4,{'type':db[_0xbb53('0x79')][_0xbb53('0x7a')][_0xbb53('0x7b')],'raw':!![]})[_0xbb53('0x14')](function(_0x20b647){return _0x20b647;});})[_0xbb53('0x14')](function(_0x32d577){if(_0x32d577){_0x881704['message'][_0xbb53('0x7c')]=_0x32d577[0x0];if(!_0x32aa6f[_0xbb53('0x4b')][_0xbb53('0x6a')])return;return db[_0xbb53('0x7d')][_0xbb53('0x4a')]({'where':{'id':_0x32aa6f[_0xbb53('0x4b')][_0xbb53('0x6a')],'role':'agent'},'attributes':['id',_0xbb53('0x2b'),_0xbb53('0x8e'),_0xbb53('0x7e'),_0xbb53('0x7f')],'raw':!![]});}return null;})[_0xbb53('0x14')](function(_0x49f52f){if(!_0x49f52f)return null;_0x881704[_0xbb53('0x1b')][_0xbb53('0x6b')]=_0x49f52f;return _0x881704;})[_0xbb53('0x14')](function(_0x2a7355){if(_0x2a7355){_0x2a7355[_0xbb53('0x1b')]['interface']=util[_0xbb53('0x6f')](_0xbb53('0x82'),_0x32aa6f['user'][_0xbb53('0x2b')]);_0x2a7355['message'][_0xbb53('0x83')]=_0x881704['channel'];_0x2a7355[_0xbb53('0x1b')][_0xbb53('0x84')]=_0x881704[_0xbb53('0x83')];_0x2a7355[_0xbb53('0x1b')][_0xbb53('0x85')]=_0xbb53('0x8f');_0x2a7355['message']['body']=htmlToText[_0xbb53('0x86')](_0x881704['message'][_0xbb53('0x4b')]);respondWithRpcPromise('EventManager',_0xbb53('0x87'),{'event':_0xbb53('0x90'),'message':_0x2a7355[_0xbb53('0x1b')]},client9002);return _0x881704;}return null;})[_0xbb53('0x14')](respondWithResult(_0x3e0153,null))['catch'](handleError(_0x3e0153,null));};exports[_0xbb53('0x91')]=function(_0x497616,_0x920c49){var _0xca2a8e=moment()[_0xbb53('0x92')]()[_0xbb53('0x93')]();var _0x53a3a3=path[_0xbb53('0x60')](config[_0xbb53('0x94')],_0xbb53('0x95'),_0xbb53('0x96'),'tmp');var _0xe0a103=path[_0xbb53('0x60')](config['root'],_0xbb53('0x95'),'files',_0xbb53('0x5f'));var _0x4d0aef=util[_0xbb53('0x6f')](_0xbb53('0x97'),_0xca2a8e);return db[_0xbb53('0x2f')][_0xbb53('0x4a')]({'where':{'id':_0x497616[_0xbb53('0x48')]['id']},'attributes':['id',_0xbb53('0x4b'),_0xbb53('0x98'),'to','cc',_0xbb53('0x99'),_0xbb53('0x9a'),'createdAt'],'include':_0x497616[_0xbb53('0x35')][_0xbb53('0x5f')]?[{'model':db[_0xbb53('0x9b')],'as':_0xbb53('0x9c')}]:undefined})[_0xbb53('0x14')](handleEntityNotFound(_0x920c49,null))[_0xbb53('0x14')](function(_0x394145){if(_0x394145){var _0x5c994d=_0x394145;var _0x50598b={'from':_0x5c994d[_0xbb53('0x98')],'to':_0x5c994d['to'],'subject':_0x5c994d['subject'],'html':_0x5c994d[_0xbb53('0x4b')],'headers':{'Date':moment(_0x5c994d['createdAt'])[_0xbb53('0x6f')](_0xbb53('0x9d'))},'attachments':[]};if(_0x394145['cc']){_0x50598b[_0xbb53('0x9e')]['Cc']=_0x394145['cc'];}if(_0x394145[_0xbb53('0x99')]){_0x50598b['headers'][_0xbb53('0x9f')]=_0x394145['bcc'];}return new BPromise(function(_0x127771,_0x90982f){if(_0x394145[_0xbb53('0x9c')]){for(var _0x2ac484=0x0;_0x2ac484<_0x394145[_0xbb53('0x9c')][_0xbb53('0x3b')];_0x2ac484++){var _0x2d9bd1=_0x394145[_0xbb53('0x9c')][_0x2ac484];var _0x6302b5=path[_0xbb53('0x60')](_0xe0a103,_0x2d9bd1[_0xbb53('0xa0')]);if(fs[_0xbb53('0xa1')](_0x6302b5)){_0x50598b[_0xbb53('0x5f')]['push']({'name':_0x2d9bd1['name'],'contentType':_0x2d9bd1['type'],'data':fs['readFileSync'](_0x6302b5)});}}}emlformat[_0xbb53('0xa2')](_0x50598b,function(_0x1e2126,_0x4481e5){if(_0x1e2126)return _0x90982f(_0x1e2126);fs[_0xbb53('0xa3')](path['join'](_0x53a3a3,_0x4d0aef),_0x4481e5);return _0x127771(_0x4481e5);});});}})[_0xbb53('0x14')](function(_0x1d6e22){if(_0x1d6e22){return _0x920c49['download'](path['join'](_0x53a3a3,_0x4d0aef),_0x4d0aef,function(_0x355e4b){if(!_0x355e4b)fs[_0xbb53('0xa4')](path[_0xbb53('0x60')](_0x53a3a3,_0x4d0aef));});}})[_0xbb53('0x1e')](handleError(_0x920c49,null));};
\ No newline at end of file
index a12648c..8af3be2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d33=['events','../../mysqldb','setMaxListeners','save','emit','hasOwnProperty','hook','exports'];(function(_0x7c0074,_0x1ffdcf){var _0x13e95b=function(_0x521212){while(--_0x521212){_0x7c0074['push'](_0x7c0074['shift']());}};_0x13e95b(++_0x1ffdcf);}(_0x5d33,0x78));var _0x35d3=function(_0x346f7c,_0x5a7108){_0x346f7c=_0x346f7c-0x0;var _0x16281c=_0x5d33[_0x346f7c];return _0x16281c;};'use strict';var EventEmitter=require(_0x35d3('0x0'));var MailMessage=require(_0x35d3('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x35d3('0x2')](0x0);var events={'afterCreate':_0x35d3('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1554cf){return function(_0x195eec,_0x197332,_0x210fa1){MailMessageEvents[_0x35d3('0x4')](_0x1554cf+':'+_0x195eec['id'],_0x195eec);MailMessageEvents[_0x35d3('0x4')](_0x1554cf,_0x195eec);_0x210fa1(null);};}for(var e in events){if(events[_0x35d3('0x5')](e)){var event=events[e];MailMessage[_0x35d3('0x6')](e,emitEvent(event));}}module[_0x35d3('0x7')]=MailMessageEvents;
\ No newline at end of file
+var _0xc003=['emit','hasOwnProperty','hook','exports','../../mysqldb','MailMessage','setMaxListeners','save','update','remove'];(function(_0x498f93,_0x255d50){var _0x4a2395=function(_0x4c3ece){while(--_0x4c3ece){_0x498f93['push'](_0x498f93['shift']());}};_0x4a2395(++_0x255d50);}(_0xc003,0x1d0));var _0x3c00=function(_0x1f7110,_0xe16b5a){_0x1f7110=_0x1f7110-0x0;var _0x3a2a56=_0xc003[_0x1f7110];return _0x3a2a56;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x3c00('0x0'))['db'][_0x3c00('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x3c00('0x2')](0x0);var events={'afterCreate':_0x3c00('0x3'),'afterUpdate':_0x3c00('0x4'),'afterDestroy':_0x3c00('0x5')};function emitEvent(_0x46a709){return function(_0x3270e1,_0x1d023c,_0x55ac){MailMessageEvents[_0x3c00('0x6')](_0x46a709+':'+_0x3270e1['id'],_0x3270e1);MailMessageEvents[_0x3c00('0x6')](_0x46a709,_0x3270e1);_0x55ac(null);};}for(var e in events){if(events[_0x3c00('0x7')](e)){var event=events[e];MailMessage[_0x3c00('0x8')](e,emitEvent(event));}}module[_0x3c00('0x9')]=MailMessageEvents;
\ No newline at end of file
index e36184e..b96267f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x880d=['direction','toLowerCase','out','UserId','MailInteraction','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','bluebird','request-promise','html-to-text','../../config/environment','exports','MailMessage','mail_messages','messageId','plainBody','body','fromString'];(function(_0x715d76,_0x402d60){var _0x48fe88=function(_0x4dd0ea){while(--_0x4dd0ea){_0x715d76['push'](_0x715d76['shift']());}};_0x48fe88(++_0x402d60);}(_0x880d,0x1bd));var _0xd880=function(_0x5ad771,_0x34186f){_0x5ad771=_0x5ad771-0x0;var _0x5b5dce=_0x880d[_0x5ad771];return _0x5b5dce;};'use strict';var _=require(_0xd880('0x0'));var util=require(_0xd880('0x1'));var logger=require('../../config/logger')(_0xd880('0x2'));var moment=require('moment');var BPromise=require(_0xd880('0x3'));var rp=require(_0xd880('0x4'));var htmlToText=require(_0xd880('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd880('0x6'));var attributes=require('./mailMessage.attributes');module[_0xd880('0x7')]=function(_0x3575b9,_0x3d4780){return _0x3575b9['define'](_0xd880('0x8'),attributes,{'tableName':_0xd880('0x9'),'paranoid':![],'indexes':[{'name':_0xd880('0xa'),'fields':[_0xd880('0xa')]},{'name':'fti_mail_messages','fields':[_0xd880('0xb'),'subject'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5107a4,_0x33526a,_0x28690f){if(_0x5107a4[_0xd880('0xc')]){_0x5107a4['plainBody']=htmlToText[_0xd880('0xd')](_0x5107a4['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x28690f(null,_0x33526a);},'afterCreate':function(_0x37cd66,_0x2ff977,_0x23fca0){var _0x15e932=_0x3575b9['models'];var _0x340ed0=_0x37cd66['get']({'plain':!![]});if(_0x340ed0[_0xd880('0xe')][_0xd880('0xf')]()==='in'||_0x340ed0['direction']['toLowerCase']()===_0xd880('0x10')&&!_0x340ed0['secret']&&!_['isNil'](_0x340ed0[_0xd880('0x11')])){_0x15e932[_0xd880('0x12')]['findOne']({'where':{'id':_0x340ed0[_0xd880('0x13')]}})[_0xd880('0x14')](function(_0x559f72){if(_0x559f72){_0x559f72[_0xd880('0x15')]({'lastMsgAt':_0x340ed0[_0xd880('0x16')],'lastMsgDirection':_0x340ed0[_0xd880('0xe')][_0xd880('0xf')]()});}})[_0xd880('0x17')](function(_0x16f56a){console[_0xd880('0x18')](_0x16f56a);});}_0x23fca0();}},'charset':_0xd880('0x19'),'collate':_0xd880('0x1a')});};
\ No newline at end of file
+var _0x06eb=['direction','toLowerCase','isNil','MailInteraction','findOne','catch','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','html-to-text','../../config/environment','exports','messageId','plainBody','body'];(function(_0xad384e,_0x256cd8){var _0x19308d=function(_0x35d0f4){while(--_0x35d0f4){_0xad384e['push'](_0xad384e['shift']());}};_0x19308d(++_0x256cd8);}(_0x06eb,0x125));var _0xb06e=function(_0x569e1d,_0x1131aa){_0x569e1d=_0x569e1d-0x0;var _0x27c04d=_0x06eb[_0x569e1d];return _0x27c04d;};'use strict';var _=require(_0xb06e('0x0'));var util=require(_0xb06e('0x1'));var logger=require(_0xb06e('0x2'))(_0xb06e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb06e('0x4'));var htmlToText=require(_0xb06e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb06e('0x6'));var attributes=require('./mailMessage.attributes');module[_0xb06e('0x7')]=function(_0x5e8307,_0x39959e){return _0x5e8307['define']('MailMessage',attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0xb06e('0x8'),'fields':[_0xb06e('0x8')]},{'name':'fti_mail_messages','fields':[_0xb06e('0x9'),'subject'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x206594,_0x1e389d,_0x31096b){if(_0x206594[_0xb06e('0xa')]){_0x206594[_0xb06e('0x9')]=htmlToText['fromString'](_0x206594[_0xb06e('0xa')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x31096b(null,_0x1e389d);},'afterCreate':function(_0x2ad1a2,_0x18da1b,_0x4fa861){var _0x24d890=_0x5e8307['models'];var _0x543179=_0x2ad1a2['get']({'plain':!![]});if(_0x543179['direction']['toLowerCase']()==='in'||_0x543179[_0xb06e('0xb')][_0xb06e('0xc')]()==='out'&&!_0x543179['secret']&&!_[_0xb06e('0xd')](_0x543179['UserId'])){_0x24d890[_0xb06e('0xe')][_0xb06e('0xf')]({'where':{'id':_0x543179['MailInteractionId']}})['then'](function(_0x146d2c){if(_0x146d2c){_0x146d2c['update']({'lastMsgAt':_0x543179['createdAt'],'lastMsgDirection':_0x543179['direction'][_0xb06e('0xc')]()});}})[_0xb06e('0x10')](function(_0x29304a){console[_0xb06e('0x11')](_0x29304a);});}_0x4fa861();}},'charset':'utf8mb4','collate':_0xb06e('0x12')});};
\ No newline at end of file
index cba07a0..0a6a0c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xef0f=['code','message','result','catch','CreateMailMessage','create','options','debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4177fb,_0x275d43){var _0x597ce6=function(_0xb4f452){while(--_0xb4f452){_0x4177fb['push'](_0x4177fb['shift']());}};_0x597ce6(++_0x275d43);}(_0xef0f,0x168));var _0xfef0=function(_0x49c0d2,_0x2a283d){_0x49c0d2=_0x49c0d2-0x0;var _0x94bbb8=_0xef0f[_0x49c0d2];return _0x94bbb8;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var moment=require(_0xfef0('0x1'));var BPromise=require(_0xfef0('0x2'));var rs=require(_0xfef0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfef0('0x4'))['db'];var utils=require(_0xfef0('0x5'));var logger=require(_0xfef0('0x6'))('rpc');var config=require(_0xfef0('0x7'));var jayson=require(_0xfef0('0x8'));var client=jayson[_0xfef0('0x9')][_0xfef0('0xa')]({'port':0x232a});config[_0xfef0('0xb')]=_[_0xfef0('0xc')](config['redis'],{'host':_0xfef0('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfef0('0xb')]));require(_0xfef0('0xe'))[_0xfef0('0xf')](socket);function respondWithRpcPromise(_0x2d42dc,_0x334e74,_0x402dff){return new BPromise(function(_0xc177db,_0x4bd6f2){return client[_0xfef0('0x10')](_0x2d42dc,_0x402dff)[_0xfef0('0x11')](function(_0x410234){logger[_0xfef0('0x12')](_0xfef0('0x13'),_0x334e74,_0xfef0('0x14'));logger['debug'](_0xfef0('0x15'),_0x334e74,_0xfef0('0x14'),JSON[_0xfef0('0x16')](_0x410234));if(_0x410234[_0xfef0('0x17')]){if(_0x410234[_0xfef0('0x17')][_0xfef0('0x18')]===0x1f4){logger[_0xfef0('0x17')]('MailMessage,\x20%s,\x20%s',_0x334e74,_0x410234[_0xfef0('0x17')]['message']);return _0x4bd6f2(_0x410234['error']['message']);}logger[_0xfef0('0x17')](_0xfef0('0x13'),_0x334e74,_0x410234[_0xfef0('0x17')][_0xfef0('0x19')]);return _0xc177db(_0x410234[_0xfef0('0x17')][_0xfef0('0x19')]);}else{logger[_0xfef0('0x12')](_0xfef0('0x13'),_0x334e74,'request\x20sent');_0xc177db(_0x410234[_0xfef0('0x1a')][_0xfef0('0x19')]);}})[_0xfef0('0x1b')](function(_0x39f9d3){logger[_0xfef0('0x17')]('MailMessage,\x20%s,\x20%s',_0x334e74,_0x39f9d3);_0x4bd6f2(_0x39f9d3);});});}exports[_0xfef0('0x1c')]=function(_0x4e24de){var _0x20826b=this;return new Promise(function(_0x1a0aa0,_0x28dee1){return db['MailMessage'][_0xfef0('0x1d')](_0x4e24de['body'],{'raw':_0x4e24de[_0xfef0('0x1e')]?_0x4e24de[_0xfef0('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4b8b22){logger[_0xfef0('0x12')]('CreateMailMessage',_0x4e24de);logger[_0xfef0('0x1f')](_0xfef0('0x1c'),_0x4e24de,JSON[_0xfef0('0x16')](_0x4b8b22));_0x1a0aa0(_0x4b8b22);})[_0xfef0('0x1b')](function(_0x249fe4){logger[_0xfef0('0x17')]('CreateMailMessage',_0x249fe4['message'],_0x4e24de);_0x28dee1(_0x20826b[_0xfef0('0x17')](0x1f4,_0x249fe4[_0xfef0('0x19')]));});});};
\ No newline at end of file
+var _0xa30a=['then','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','MailMessage','create','body','options','raw','CreateMailMessage','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./mailMessage.socket','register'];(function(_0x15dbca,_0x1d7c3c){var _0x326533=function(_0x507ee2){while(--_0x507ee2){_0x15dbca['push'](_0x15dbca['shift']());}};_0x326533(++_0x1d7c3c);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var 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});config[_0xaa30('0xb')]=_[_0xaa30('0xc')](config[_0xaa30('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xaa30('0xd'))(new Redis(config[_0xaa30('0xb')]));require(_0xaa30('0xe'))[_0xaa30('0xf')](socket);function respondWithRpcPromise(_0x14a6a6,_0x45419f,_0x56f686){return new BPromise(function(_0x5afbf5,_0x12a8ce){return client['request'](_0x14a6a6,_0x56f686)[_0xaa30('0x10')](function(_0x1a5681){logger[_0xaa30('0x11')](_0xaa30('0x12'),_0x45419f,'request\x20sent');logger[_0xaa30('0x13')](_0xaa30('0x14'),_0x45419f,_0xaa30('0x15'),JSON['stringify'](_0x1a5681));if(_0x1a5681[_0xaa30('0x16')]){if(_0x1a5681[_0xaa30('0x16')][_0xaa30('0x17')]===0x1f4){logger[_0xaa30('0x16')](_0xaa30('0x12'),_0x45419f,_0x1a5681[_0xaa30('0x16')][_0xaa30('0x18')]);return _0x12a8ce(_0x1a5681[_0xaa30('0x16')][_0xaa30('0x18')]);}logger[_0xaa30('0x16')]('MailMessage,\x20%s,\x20%s',_0x45419f,_0x1a5681[_0xaa30('0x16')]['message']);return _0x5afbf5(_0x1a5681['error'][_0xaa30('0x18')]);}else{logger[_0xaa30('0x11')](_0xaa30('0x12'),_0x45419f,'request\x20sent');_0x5afbf5(_0x1a5681['result']['message']);}})[_0xaa30('0x19')](function(_0x4acdfa){logger[_0xaa30('0x16')](_0xaa30('0x12'),_0x45419f,_0x4acdfa);_0x12a8ce(_0x4acdfa);});});}exports['CreateMailMessage']=function(_0x4e29f9){var _0x520abb=this;return new Promise(function(_0x3cbf92,_0x3e4f1d){return db[_0xaa30('0x1a')][_0xaa30('0x1b')](_0x4e29f9[_0xaa30('0x1c')],{'raw':_0x4e29f9['options']?_0x4e29f9[_0xaa30('0x1d')][_0xaa30('0x1e')]===undefined?!![]:![]:!![]})[_0xaa30('0x10')](function(_0x2d9e35){logger[_0xaa30('0x11')]('CreateMailMessage',_0x4e29f9);logger[_0xaa30('0x13')](_0xaa30('0x1f'),_0x4e29f9,JSON[_0xaa30('0x20')](_0x2d9e35));_0x3cbf92(_0x2d9e35);})[_0xaa30('0x19')](function(_0x57d1ca){logger[_0xaa30('0x16')](_0xaa30('0x1f'),_0x57d1ca[_0xaa30('0x18')],_0x4e29f9);_0x3e4f1d(_0x520abb[_0xaa30('0x16')](0x1f4,_0x57d1ca[_0xaa30('0x18')]));});});};
\ No newline at end of file
index 093a1ea..d24e6b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c9c=['emit','removeListener','register','./mailMessage.events','save','remove','update'];(function(_0x23ccc7,_0xb0909d){var _0x55c03f=function(_0x1121ae){while(--_0x1121ae){_0x23ccc7['push'](_0x23ccc7['shift']());}};_0x55c03f(++_0xb0909d);}(_0x5c9c,0x1d1));var _0xc5c9=function(_0x5c5a2b,_0x5606a7){_0x5c5a2b=_0x5c5a2b-0x0;var _0x161cb7=_0x5c9c[_0x5c5a2b];return _0x161cb7;};'use strict';var MailMessageEvents=require(_0xc5c9('0x0'));var events=[_0xc5c9('0x1'),_0xc5c9('0x2'),_0xc5c9('0x3')];function createListener(_0x24fc2c,_0x543896){return function(_0x1d3ab9){_0x543896[_0xc5c9('0x4')](_0x24fc2c,_0x1d3ab9);};}function removeListener(_0x3476e4,_0x3c8342){return function(){MailMessageEvents[_0xc5c9('0x5')](_0x3476e4,_0x3c8342);};}exports[_0xc5c9('0x6')]=function(_0x576fb2){for(var _0x3d7538=0x0,_0xcdf0af=events['length'];_0x3d7538<_0xcdf0af;_0x3d7538++){var _0x3ed0f5=events[_0x3d7538];var _0x527849=createListener('mailMessage:'+_0x3ed0f5,_0x576fb2);MailMessageEvents['on'](_0x3ed0f5,_0x527849);}};
\ No newline at end of file
+var _0x7bfa=['update','emit','removeListener','register','length','./mailMessage.events'];(function(_0x3c6ae2,_0x5c52d8){var _0x4edda=function(_0x5593eb){while(--_0x5593eb){_0x3c6ae2['push'](_0x3c6ae2['shift']());}};_0x4edda(++_0x5c52d8);}(_0x7bfa,0x173));var _0xa7bf=function(_0x1261c2,_0x3ef819){_0x1261c2=_0x1261c2-0x0;var _0x3aabd2=_0x7bfa[_0x1261c2];return _0x3aabd2;};'use strict';var MailMessageEvents=require(_0xa7bf('0x0'));var events=['save','remove',_0xa7bf('0x1')];function createListener(_0x73b4db,_0x488dcd){return function(_0x191037){_0x488dcd[_0xa7bf('0x2')](_0x73b4db,_0x191037);};}function removeListener(_0x39223a,_0x10fbf0){return function(){MailMessageEvents[_0xa7bf('0x3')](_0x39223a,_0x10fbf0);};}exports[_0xa7bf('0x4')]=function(_0x10c016){for(var _0x36b622=0x0,_0x390652=events[_0xa7bf('0x5')];_0x36b622<_0x390652;_0x36b622++){var _0x14ef7f=events[_0x36b622];var _0x5a0ec7=createListener('mailMessage:'+_0x14ef7f,_0x10c016);MailMessageEvents['on'](_0x14ef7f,_0x5a0ec7);}};
\ No newline at end of file
index 3613431..b805314 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x99a6=['addAgents','put','/:id','delete','destroy','removeTeams','exports','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','getAgents','create','post','/:id/teams','/:id/users'];(function(_0x4cdb9b,_0x138fdb){var _0x5b171f=function(_0x29cfe){while(--_0x29cfe){_0x4cdb9b['push'](_0x4cdb9b['shift']());}};_0x5b171f(++_0x138fdb);}(_0x99a6,0x173));var _0x699a=function(_0x262957,_0x34c699){_0x262957=_0x262957-0x0;var _0x27e221=_0x99a6[_0x262957];return _0x27e221;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x699a('0x0'));var timeout=require(_0x699a('0x1'));var express=require('express');var router=express[_0x699a('0x2')]();var fs_extra=require(_0x699a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x699a('0x4'));var config=require(_0x699a('0x5'));var controller=require(_0x699a('0x6'));router[_0x699a('0x7')]('/',auth[_0x699a('0x8')](),controller[_0x699a('0x9')]);router[_0x699a('0x7')](_0x699a('0xa'),auth[_0x699a('0x8')](),controller[_0x699a('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x699a('0xc')]);router[_0x699a('0x7')](_0x699a('0xd'),auth[_0x699a('0x8')](),controller[_0x699a('0xe')]);router[_0x699a('0x7')]('/:id/teams',auth[_0x699a('0x8')](),controller[_0x699a('0xf')]);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x699a('0x10')]);router['post']('/',auth[_0x699a('0x8')](),controller[_0x699a('0x11')]);router[_0x699a('0x12')](_0x699a('0x13'),auth['isAuthenticated'](),controller['addTeams']);router[_0x699a('0x12')](_0x699a('0x14'),auth[_0x699a('0x8')](),controller[_0x699a('0x15')]);router[_0x699a('0x16')](_0x699a('0x17'),auth[_0x699a('0x8')](),controller['update']);router[_0x699a('0x18')](_0x699a('0x17'),auth['isAuthenticated'](),controller[_0x699a('0x19')]);router['delete'](_0x699a('0x13'),auth[_0x699a('0x8')](),controller[_0x699a('0x1a')]);router[_0x699a('0x18')](_0x699a('0x14'),auth[_0x699a('0x8')](),controller['removeAgents']);module[_0x699a('0x1b')]=router;
\ No newline at end of file
+var _0x8234=['util','path','connect-timeout','express','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getAgents','post','create','/:id/users','addAgents','update','delete','removeAgents','exports','multer'];(function(_0x5675ee,_0x18febe){var _0x471480=function(_0x353993){while(--_0x353993){_0x5675ee['push'](_0x5675ee['shift']());}};_0x471480(++_0x18febe);}(_0x8234,0xd7));var _0x4823=function(_0x227955,_0x108525){_0x227955=_0x227955-0x0;var _0x3aa837=_0x8234[_0x227955];return _0x3aa837;};'use strict';var multer=require(_0x4823('0x0'));var util=require(_0x4823('0x1'));var path=require(_0x4823('0x2'));var timeout=require(_0x4823('0x3'));var express=require(_0x4823('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4823('0x5'));var config=require('../../config/environment');var controller=require('./mailQueue.controller');router[_0x4823('0x6')]('/',auth[_0x4823('0x7')](),controller[_0x4823('0x8')]);router[_0x4823('0x6')](_0x4823('0x9'),auth[_0x4823('0x7')](),controller[_0x4823('0xa')]);router[_0x4823('0x6')](_0x4823('0xb'),auth[_0x4823('0x7')](),controller['show']);router[_0x4823('0x6')](_0x4823('0xc'),auth[_0x4823('0x7')](),controller[_0x4823('0xd')]);router['get'](_0x4823('0xe'),auth[_0x4823('0x7')](),controller['getTeams']);router[_0x4823('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0x4823('0xf')]);router[_0x4823('0x10')]('/',auth[_0x4823('0x7')](),controller[_0x4823('0x11')]);router['post'](_0x4823('0xe'),auth[_0x4823('0x7')](),controller['addTeams']);router[_0x4823('0x10')](_0x4823('0x12'),auth[_0x4823('0x7')](),controller[_0x4823('0x13')]);router['put']('/:id',auth[_0x4823('0x7')](),controller[_0x4823('0x14')]);router[_0x4823('0x15')](_0x4823('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0x4823('0x15')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router['delete']('/:id/users',auth[_0x4823('0x7')](),controller[_0x4823('0x16')]);module[_0x4823('0x17')]=router;
\ No newline at end of file
index 00b3985..d998db9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x991f=['ENUM','rrmemory','beepall','sequelize','STRING','name','INTEGER'];(function(_0x160351,_0x56c7da){var _0x2013d3=function(_0x25dc4e){while(--_0x25dc4e){_0x160351['push'](_0x160351['shift']());}};_0x2013d3(++_0x56c7da);}(_0x991f,0x1ca));var _0xf991=function(_0x4b7147,_0x122aff){_0x4b7147=_0x4b7147-0x0;var _0x4ba310=_0x991f[_0x4b7147];return _0x4ba310;};'use strict';var Sequelize=require(_0xf991('0x0'));module['exports']={'name':{'type':Sequelize[_0xf991('0x1')],'unique':_0xf991('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf991('0x1')]},'timeout':{'type':Sequelize[_0xf991('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf991('0x4')](_0xf991('0x5'),_0xf991('0x6'),'roundrobin')}};
\ No newline at end of file
+var _0xa419=['rrmemory','exports','STRING','name','INTEGER'];(function(_0x2040c2,_0x28da6b){var _0x525ce0=function(_0x104860){while(--_0x104860){_0x2040c2['push'](_0x2040c2['shift']());}};_0x525ce0(++_0x28da6b);}(_0xa419,0x178));var _0x9a41=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xa419[_0x278e3c];return _0x3e2d9b;};'use strict';var Sequelize=require('sequelize');module[_0x9a41('0x0')]={'name':{'type':Sequelize[_0x9a41('0x1')],'unique':_0x9a41('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9a41('0x1')]},'timeout':{'type':Sequelize[_0x9a41('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x9a41('0x4'),'beepall','roundrobin')}};
\ No newline at end of file
index 64d5def..933d250 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4065=['rawAttributes','fieldName','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','type','options','include','rows','catch','params','model','length','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','order','pick','MailQueueId','findAll','User','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','Team','getTeams','online','Agents','addTeams','findOrCreate','userMailQueue:save','removeTeams','select','field','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','sequelize','toString','QueryTypes','every','TeamId','all','union','compact','transaction','ids','isEmpty','removeAgents','forEach','emit','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','save','update','then','destroy','get','MailQueues','UserProfileResource','error','stack','name','send','index','map','MailQueue'];(function(_0x4174f9,_0x476bd6){var _0x4a6022=function(_0x2f65ce){while(--_0x2f65ce){_0x4174f9['push'](_0x4174f9['shift']());}};_0x4a6022(++_0x476bd6);}(_0x4065,0xdc));var _0x5406=function(_0x16ecf3,_0x44607e){_0x16ecf3=_0x16ecf3-0x0;var _0x35f29a=_0x4065[_0x16ecf3];return _0x35f29a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5406('0x0'));var rp=require('request-promise');var moment=require(_0x5406('0x1'));var BPromise=require(_0x5406('0x2'));var Mustache=require(_0x5406('0x3'));var util=require('util');var path=require(_0x5406('0x4'));var sox=require(_0x5406('0x5'));var csv=require('to-csv');var ejs=require(_0x5406('0x6'));var fs=require('fs');var fs_extra=require(_0x5406('0x7'));var _=require(_0x5406('0x8'));var squel=require(_0x5406('0x9'));var crypto=require(_0x5406('0xa'));var jsforce=require(_0x5406('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5406('0xc'));var querystring=require(_0x5406('0xd'));var Papa=require(_0x5406('0xe'));var Redis=require(_0x5406('0xf'));var authService=require(_0x5406('0x10'));var qs=require(_0x5406('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5406('0x12'));var logger=require(_0x5406('0x13'))(_0x5406('0x14'));var utils=require(_0x5406('0x15'));var config=require(_0x5406('0x16'));var licenseUtil=require(_0x5406('0x17'));var db=require('../../mysqldb')['db'];config[_0x5406('0x18')]=_[_0x5406('0x19')](config['redis'],{'host':_0x5406('0x1a'),'port':0x18eb});var socket=require(_0x5406('0x1b'))(new Redis(config[_0x5406('0x18')]));require(_0x5406('0x1c'))[_0x5406('0x1d')](socket);function respondWithStatusCode(_0x333e24,_0x16bf9b){_0x16bf9b=_0x16bf9b||0xcc;return function(_0x2a6603){if(_0x2a6603){return _0x333e24[_0x5406('0x1e')](_0x16bf9b);}return _0x333e24['status'](_0x16bf9b)[_0x5406('0x1f')]();};}function respondWithResult(_0x17806b,_0xb982cc){_0xb982cc=_0xb982cc||0xc8;return function(_0xb25b29){if(_0xb25b29){return _0x17806b['status'](_0xb982cc)[_0x5406('0x20')](_0xb25b29);}};}function respondWithFilteredResult(_0x1bf1f1,_0x43279d){return function(_0x22f6ba){if(_0x22f6ba){var _0x5cb4c3=typeof _0x43279d[_0x5406('0x21')]===_0x5406('0x22')&&typeof _0x43279d[_0x5406('0x23')]==='undefined';var _0x453ee5=_0x22f6ba[_0x5406('0x24')];var _0x498a7c=_0x5cb4c3?0x0:_0x43279d[_0x5406('0x21')];var _0x323442=_0x5cb4c3?_0x22f6ba[_0x5406('0x24')]:_0x43279d['offset']+_0x43279d[_0x5406('0x23')];var _0x353e89;if(_0x323442>=_0x453ee5){_0x323442=_0x453ee5;_0x353e89=0xc8;}else{_0x353e89=0xce;}_0x1bf1f1[_0x5406('0x25')](_0x353e89);return _0x1bf1f1[_0x5406('0x26')](_0x5406('0x27'),_0x498a7c+'-'+_0x323442+'/'+_0x453ee5)[_0x5406('0x20')](_0x22f6ba);}return null;};}function patchUpdates(_0x12c6b6){return function(_0x4225e7){try{jsonpatch['apply'](_0x4225e7,_0x12c6b6,!![]);}catch(_0x15aea4){return BPromise['reject'](_0x15aea4);}return _0x4225e7[_0x5406('0x28')]();};}function saveUpdates(_0x3856fa,_0x57c331){return function(_0x471032){if(_0x471032){return _0x471032[_0x5406('0x29')](_0x3856fa)[_0x5406('0x2a')](function(_0xc3e2e8){return _0xc3e2e8;});}return null;};}function removeEntity(_0x98d6fb,_0x6c96ec){return function(_0x2517ae){if(_0x2517ae){return _0x2517ae[_0x5406('0x2b')]()['then'](function(){var _0x2256bd=_0x2517ae[_0x5406('0x2c')]({'plain':!![]});var _0xfba3e7=_0x5406('0x2d');return db[_0x5406('0x2e')][_0x5406('0x2b')]({'where':{'type':_0xfba3e7,'resourceId':_0x2256bd['id']}})[_0x5406('0x2a')](function(){return _0x2517ae;});})[_0x5406('0x2a')](function(){_0x98d6fb['status'](0xcc)[_0x5406('0x1f')]();});}};}function handleEntityNotFound(_0x49a7a5,_0x1b6123){return function(_0x5cb836){if(!_0x5cb836){_0x49a7a5[_0x5406('0x1e')](0x194);}return _0x5cb836;};}function handleError(_0x3cf64f,_0x3e0b7f){_0x3e0b7f=_0x3e0b7f||0x1f4;return function(_0x24255f){logger[_0x5406('0x2f')](_0x24255f[_0x5406('0x30')]);if(_0x24255f[_0x5406('0x31')]){delete _0x24255f[_0x5406('0x31')];}_0x3cf64f['status'](_0x3e0b7f)[_0x5406('0x32')](_0x24255f);};}exports[_0x5406('0x33')]=function(_0x2e9ab9,_0x506abf){var _0x431e70={},_0x294993={},_0x565475={'count':0x0,'rows':[]};var _0x4f751c=_[_0x5406('0x34')](db[_0x5406('0x35')][_0x5406('0x36')],function(_0x1ff0d4){return{'name':_0x1ff0d4[_0x5406('0x37')],'type':_0x1ff0d4['type']['key']};});_0x294993['model']=_[_0x5406('0x34')](_0x4f751c,_0x5406('0x31'));_0x294993[_0x5406('0x38')]=_[_0x5406('0x39')](_0x2e9ab9['query']);_0x294993[_0x5406('0x3a')]=_[_0x5406('0x3b')](_0x294993['model'],_0x294993[_0x5406('0x38')]);_0x431e70[_0x5406('0x3c')]=_[_0x5406('0x3b')](_0x294993['model'],qs[_0x5406('0x3d')](_0x2e9ab9[_0x5406('0x38')][_0x5406('0x3d')]));_0x431e70['attributes']=_0x431e70['attributes']['length']?_0x431e70[_0x5406('0x3c')]:_0x294993['model'];if(!_0x2e9ab9['query'][_0x5406('0x3e')](_0x5406('0x3f'))){_0x431e70[_0x5406('0x23')]=qs['limit'](_0x2e9ab9['query']['limit']);_0x431e70[_0x5406('0x21')]=qs[_0x5406('0x21')](_0x2e9ab9[_0x5406('0x38')][_0x5406('0x21')]);}_0x431e70['order']=qs['sort'](_0x2e9ab9[_0x5406('0x38')][_0x5406('0x40')]);_0x431e70[_0x5406('0x41')]=qs['filters'](_['pick'](_0x2e9ab9[_0x5406('0x38')],_0x294993['filters']),_0x4f751c);if(_0x2e9ab9[_0x5406('0x38')][_0x5406('0x42')]){_0x431e70['where']=_[_0x5406('0x43')](_0x431e70[_0x5406('0x41')],{'$or':_[_0x5406('0x34')](_0x4f751c,function(_0x724619){if(_0x724619[_0x5406('0x44')]!=='VIRTUAL'){var _0x238d2a={};_0x238d2a[_0x724619[_0x5406('0x31')]]={'$like':'%'+_0x2e9ab9[_0x5406('0x38')][_0x5406('0x42')]+'%'};return _0x238d2a;}})});}_0x431e70=_[_0x5406('0x43')]({},_0x431e70,_0x2e9ab9[_0x5406('0x45')]);var _0x45aa06={'where':_0x431e70[_0x5406('0x41')]};return db['MailQueue'][_0x5406('0x24')](_0x45aa06)[_0x5406('0x2a')](function(_0x1f6175){_0x565475[_0x5406('0x24')]=_0x1f6175;if(_0x2e9ab9[_0x5406('0x38')]['includeAll']){_0x431e70[_0x5406('0x46')]=[{'all':!![]}];}return db['MailQueue']['findAll'](_0x431e70);})['then'](function(_0x549351){_0x565475[_0x5406('0x47')]=_0x549351;return _0x565475;})[_0x5406('0x2a')](respondWithFilteredResult(_0x506abf,_0x431e70))[_0x5406('0x48')](handleError(_0x506abf,null));};exports['show']=function(_0x535e07,_0xf24d3d){var _0x1aa5d6={'raw':!![],'where':{'id':_0x535e07[_0x5406('0x49')]['id']}},_0xbd7cde={};_0xbd7cde[_0x5406('0x4a')]=_[_0x5406('0x39')](db[_0x5406('0x35')][_0x5406('0x36')]);_0xbd7cde[_0x5406('0x38')]=_[_0x5406('0x39')](_0x535e07[_0x5406('0x38')]);_0xbd7cde[_0x5406('0x3a')]=_[_0x5406('0x3b')](_0xbd7cde[_0x5406('0x4a')],_0xbd7cde[_0x5406('0x38')]);_0x1aa5d6['attributes']=_[_0x5406('0x3b')](_0xbd7cde['model'],qs[_0x5406('0x3d')](_0x535e07[_0x5406('0x38')]['fields']));_0x1aa5d6['attributes']=_0x1aa5d6[_0x5406('0x3c')][_0x5406('0x4b')]?_0x1aa5d6[_0x5406('0x3c')]:_0xbd7cde[_0x5406('0x4a')];if(_0x535e07[_0x5406('0x38')]['includeAll']){_0x1aa5d6[_0x5406('0x46')]=[{'all':!![]}];}_0x1aa5d6=_[_0x5406('0x43')]({},_0x1aa5d6,_0x535e07[_0x5406('0x45')]);return db['MailQueue'][_0x5406('0x4c')](_0x1aa5d6)[_0x5406('0x2a')](handleEntityNotFound(_0xf24d3d,null))[_0x5406('0x2a')](respondWithResult(_0xf24d3d,null))[_0x5406('0x48')](handleError(_0xf24d3d,null));};exports['create']=function(_0x40c851,_0x1b1475){return db[_0x5406('0x35')]['create'](_0x40c851[_0x5406('0x4d')],{})['then'](function(_0xfc5264){var _0x51e7b8=_0x40c851[_0x5406('0x4e')]['get']({'plain':!![]});if(!_0x51e7b8)throw new Error(_0x5406('0x4f'));if(_0x51e7b8[_0x5406('0x50')]===_0x5406('0x4e')){var _0x27dc86=_0xfc5264[_0x5406('0x2c')]({'plain':!![]});var _0x2220b0=_0x5406('0x2d');return db[_0x5406('0x51')][_0x5406('0x4c')]({'where':{'name':_0x2220b0,'userProfileId':_0x51e7b8[_0x5406('0x52')]},'raw':!![]})[_0x5406('0x2a')](function(_0x227510){if(_0x227510&&_0x227510[_0x5406('0x53')]===0x0){return db[_0x5406('0x2e')][_0x5406('0x54')]({'name':_0x27dc86['name'],'resourceId':_0x27dc86['id'],'type':_0x227510[_0x5406('0x31')],'sectionId':_0x227510['id']},{})['then'](function(){return _0xfc5264;});}else{return _0xfc5264;}})[_0x5406('0x48')](function(_0x3934bd){logger[_0x5406('0x2f')](_0x5406('0x55'),_0x3934bd);throw _0x3934bd;});}return _0xfc5264;})['then'](respondWithResult(_0x1b1475,0xc9))[_0x5406('0x48')](handleError(_0x1b1475,null));};exports[_0x5406('0x29')]=function(_0x432c2a,_0x30d55d){if(_0x432c2a[_0x5406('0x4d')]['id']){delete _0x432c2a[_0x5406('0x4d')]['id'];}return db['MailQueue'][_0x5406('0x4c')]({'where':{'id':_0x432c2a[_0x5406('0x49')]['id']}})[_0x5406('0x2a')](handleEntityNotFound(_0x30d55d,null))[_0x5406('0x2a')](saveUpdates(_0x432c2a[_0x5406('0x4d')],null))[_0x5406('0x2a')](respondWithResult(_0x30d55d,null))[_0x5406('0x48')](handleError(_0x30d55d,null));};exports['destroy']=function(_0x4702f4,_0x409be1){return db[_0x5406('0x35')][_0x5406('0x4c')]({'where':{'id':_0x4702f4[_0x5406('0x49')]['id']}})[_0x5406('0x2a')](handleEntityNotFound(_0x409be1,null))[_0x5406('0x2a')](removeEntity(_0x409be1,null))['catch'](handleError(_0x409be1,null));};exports[_0x5406('0x56')]=function(_0x47faaa,_0x41b191){return db[_0x5406('0x35')][_0x5406('0x56')]()['then'](respondWithResult(_0x41b191,null))[_0x5406('0x48')](handleError(_0x41b191,null));};exports[_0x5406('0x57')]=function(_0x3e648b,_0x3ed768,_0x364340){var _0x26bdbb={'raw':!![],'where':{}},_0x558f2c={},_0x17c4cd;return db[_0x5406('0x35')][_0x5406('0x58')]({'where':{'id':_0x3e648b[_0x5406('0x49')]['id']}})[_0x5406('0x2a')](handleEntityNotFound(_0x3ed768,null))['then'](function(_0x4ff8db){if(_0x4ff8db){_0x17c4cd=_0x4ff8db[_0x5406('0x2c')]({'plain':!![]});_0x558f2c[_0x5406('0x4a')]=_['keys'](db['UserMailQueue'][_0x5406('0x36')]);_0x558f2c[_0x5406('0x38')]=_[_0x5406('0x39')](_0x3e648b[_0x5406('0x38')]);_0x558f2c[_0x5406('0x3a')]=_[_0x5406('0x3b')](_0x558f2c[_0x5406('0x4a')],_0x558f2c['query']);_0x26bdbb[_0x5406('0x3c')]=_[_0x5406('0x3b')](_0x558f2c[_0x5406('0x4a')],qs['fields'](_0x3e648b['query'][_0x5406('0x3d')]));_0x26bdbb[_0x5406('0x3c')]=_0x26bdbb[_0x5406('0x3c')]['length']?_0x26bdbb[_0x5406('0x3c')]:_0x558f2c['model'];if(!_0x3e648b[_0x5406('0x38')]['hasOwnProperty'](_0x5406('0x3f'))){_0x26bdbb[_0x5406('0x23')]=qs['limit'](_0x3e648b[_0x5406('0x38')]['limit']);_0x26bdbb['offset']=qs[_0x5406('0x21')](_0x3e648b[_0x5406('0x38')]['offset']);}_0x26bdbb[_0x5406('0x59')]=qs['sort'](_0x3e648b['query']['sort']);_0x26bdbb['where']=qs[_0x5406('0x3a')](_[_0x5406('0x5a')](_0x3e648b[_0x5406('0x38')],_0x558f2c[_0x5406('0x3a')]));_0x26bdbb[_0x5406('0x41')][_0x5406('0x5b')]=_0x4ff8db['id'];if(_0x3e648b['query'][_0x5406('0x42')]){_0x26bdbb[_0x5406('0x41')]=_[_0x5406('0x43')](_0x26bdbb[_0x5406('0x41')],{'$or':_[_0x5406('0x34')](_0x26bdbb['attributes'],function(_0x38bb72){var _0x4e3726={};_0x4e3726[_0x38bb72]={'$like':'%'+_0x3e648b['query'][_0x5406('0x42')]+'%'};return _0x4e3726;})});}_0x26bdbb=_[_0x5406('0x43')]({},_0x26bdbb,_0x3e648b[_0x5406('0x45')]);return db['UserMailQueue'][_0x5406('0x5c')](_0x26bdbb);}})[_0x5406('0x2a')](function(_0x5cd5a6){if(_0x5cd5a6){return db[_0x5406('0x5d')]['findAndCountAll']({'where':{'id':_['map'](_0x5cd5a6,_0x5406('0x5e')),'role':_0x5406('0x5f')},'attributes':['id',_0x5406('0x31'),_0x5406('0x60'),_0x5406('0x61'),_0x5406('0x62')]});}})[_0x5406('0x2a')](function(_0x479777){if(_0x479777){return{'count':_0x479777[_0x5406('0x24')],'rows':_[_0x5406('0x34')](_0x479777[_0x5406('0x47')],function(_0x1929c5){return{'membername':_0x1929c5[_0x5406('0x31')],'UserId':_0x1929c5['id'],'queue_name':_0x17c4cd['name'],'MailQueueId':_0x17c4cd['id'],'interface':util[_0x5406('0x63')](_0x5406('0x64'),_0x5406('0x65'),_0x1929c5[_0x5406('0x31')]),'penalty':0x0,'paused':_0x1929c5[_0x5406('0x60')],'createdAt':_0x1929c5['createdAt'],'updatedAt':_0x1929c5['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x5406('0x2a')](respondWithFilteredResult(_0x3ed768,_0x26bdbb))[_0x5406('0x48')](handleError(_0x3ed768,null));};exports['getTeams']=function(_0x211eb7,_0x655fca,_0x46cb82){var _0x19c43b={};var _0x1c1f1e={};var _0x19dab2;var _0x275fa8;return db[_0x5406('0x35')][_0x5406('0x58')]({'where':{'id':_0x211eb7[_0x5406('0x49')]['id']}})[_0x5406('0x2a')](handleEntityNotFound(_0x655fca,null))[_0x5406('0x2a')](function(_0x333b4d){if(_0x333b4d){_0x19dab2=_0x333b4d;_0x1c1f1e[_0x5406('0x4a')]=_[_0x5406('0x39')](db[_0x5406('0x66')][_0x5406('0x36')]);_0x1c1f1e[_0x5406('0x38')]=_[_0x5406('0x39')](_0x211eb7[_0x5406('0x38')]);_0x1c1f1e['filters']=_[_0x5406('0x3b')](_0x1c1f1e['model'],_0x1c1f1e[_0x5406('0x38')]);_0x19c43b[_0x5406('0x3c')]=_[_0x5406('0x3b')](_0x1c1f1e['model'],qs[_0x5406('0x3d')](_0x211eb7['query']['fields']));_0x19c43b[_0x5406('0x3c')]=_0x19c43b[_0x5406('0x3c')][_0x5406('0x4b')]?_0x19c43b[_0x5406('0x3c')]:_0x1c1f1e[_0x5406('0x4a')];_0x19c43b['order']=qs[_0x5406('0x40')](_0x211eb7[_0x5406('0x38')]['sort']);_0x19c43b[_0x5406('0x41')]=qs['filters'](_[_0x5406('0x5a')](_0x211eb7[_0x5406('0x38')],_0x1c1f1e[_0x5406('0x3a')]));if(_0x211eb7[_0x5406('0x38')][_0x5406('0x42')]){_0x19c43b[_0x5406('0x41')]=_[_0x5406('0x43')](_0x19c43b[_0x5406('0x41')],{'$or':_[_0x5406('0x34')](_0x19c43b[_0x5406('0x3c')],function(_0x2ae2df){var _0x193e46={};_0x193e46[_0x2ae2df]={'$like':'%'+_0x211eb7[_0x5406('0x38')][_0x5406('0x42')]+'%'};return _0x193e46;})});}_0x19c43b=_[_0x5406('0x43')]({},_0x19c43b,_0x211eb7[_0x5406('0x45')]);return _0x19dab2[_0x5406('0x67')](_0x19c43b);}})[_0x5406('0x2a')](function(_0x30dfe9){if(_0x30dfe9){_0x275fa8=_0x30dfe9[_0x5406('0x4b')];if(!_0x211eb7['query'][_0x5406('0x3e')](_0x5406('0x3f'))){_0x19c43b['limit']=qs['limit'](_0x211eb7[_0x5406('0x38')][_0x5406('0x23')]);_0x19c43b[_0x5406('0x21')]=qs[_0x5406('0x21')](_0x211eb7[_0x5406('0x38')][_0x5406('0x21')]);}return _0x19dab2['getTeams'](_0x19c43b);}})[_0x5406('0x2a')](function(_0x5ae9b6){if(_0x5ae9b6){return _0x5ae9b6?{'count':_0x275fa8,'rows':_0x5ae9b6}:null;}})[_0x5406('0x2a')](respondWithResult(_0x655fca,null))['catch'](handleError(_0x655fca,null));};exports['addTeams']=function(_0x1c1387,_0x404697,_0x4f2c21){var _0x3dcda3=_0x1c1387[_0x5406('0x4d')]['ids'];return db[_0x5406('0x66')][_0x5406('0x5c')]({'where':{'id':_0x3dcda3},'attributes':['id'],'include':[{'model':db[_0x5406('0x5d')],'as':'Agents','attributes':['id',_0x5406('0x31'),_0x5406('0x68'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x165903){if(_0x165903){var _0x2f0100=_['flatMap'](_0x165903,function(_0x2e28f0){var _0xe3cd44=_0x2e28f0[_0x5406('0x2c')]({'plain':!![]});return _0xe3cd44[_0x5406('0x69')];});return db[_0x5406('0x35')][_0x5406('0x4c')]({'where':{'id':_0x1c1387[_0x5406('0x49')]['id']}})['then'](function(_0x282acb){return db['sequelize']['transaction'](function(_0x316ef5){return _0x282acb[_0x5406('0x6a')](_0x3dcda3,{'transaction':_0x316ef5})[_0x5406('0x2a')](function(){return BPromise['each'](_0x2f0100,function(_0x144b8e){return db['UserMailQueue'][_0x5406('0x6b')]({'where':{'UserId':_0x144b8e['id'],'MailQueueId':_0x1c1387[_0x5406('0x49')]['id']},'transaction':_0x316ef5});});})[_0x5406('0x2a')](function(){_0x2f0100['forEach'](function(_0x8b6299){socket['emit'](_0x5406('0x6c'),{'UserId':_0x8b6299['id'],'MailQueueId':_0x282acb['id']});});});});});}})[_0x5406('0x2a')](respondWithStatusCode(_0x404697,null))['catch'](handleError(_0x404697,null));};exports[_0x5406('0x6d')]=function(_0x1a0bdf,_0x353e76,_0x1abbbd){return db['Team']['findAll']({'where':{'id':_0x1a0bdf['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x5406('0x5d')],'as':_0x5406('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x353e76,null))[_0x5406('0x2a')](function(_0x26b2bd){var _0x552ca3=_[_0x5406('0x34')](_0x26b2bd,'id');var _0x1b42e7=[];var _0x29dd39=[];var _0x344d79=squel[_0x5406('0x6e')]();_0x344d79[_0x5406('0x6f')]('tq.TeamId')['from'](_0x5406('0x70'),'tq')[_0x5406('0x71')](_0x5406('0x72'),'ut',_0x5406('0x73'))['where']('MailQueueId\x20=\x20?',_0x1a0bdf['params']['id']);for(var _0x3be0d9=0x0;_0x3be0d9<_0x26b2bd[_0x5406('0x4b')];_0x3be0d9+=0x1){let _0x5b234d=_0x26b2bd[_0x3be0d9];for(var _0x277dcf=0x0;_0x277dcf<_0x5b234d[_0x5406('0x69')][_0x5406('0x4b')];_0x277dcf+=0x1){let _0x5e6c8f=_0x5b234d[_0x5406('0x69')][_0x277dcf];var _0x32515f=_0x344d79[_0x5406('0x74')]();_0x32515f[_0x5406('0x41')]('ut.UserId\x20=\x20?',_0x5e6c8f['id']);_0x29dd39['push'](db[_0x5406('0x75')][_0x5406('0x38')](_0x32515f[_0x5406('0x76')](),{'type':db[_0x5406('0x75')][_0x5406('0x77')]['SELECT']})[_0x5406('0x2a')](function(_0x367211){if(_0x367211[_0x5406('0x4b')]===0x1){return _0x5e6c8f['id'];}else{var _0x455b16=_[_0x5406('0x78')](_[_0x5406('0x34')](_0x367211,_0x5406('0x79')),function(_0xcfc136){return _['includes'](_0x552ca3,_0xcfc136);});if(_0x455b16){return _0x5e6c8f['id'];}}}));}}return BPromise[_0x5406('0x7a')](_0x29dd39)[_0x5406('0x2a')](function(_0x5cbbb0){_0x1b42e7=_(_0x1b42e7)[_0x5406('0x7b')](_0x5cbbb0)[_0x5406('0x7c')]()['value']();return db[_0x5406('0x35')][_0x5406('0x4c')]({'where':{'id':_0x1a0bdf[_0x5406('0x49')]['id']}})[_0x5406('0x2a')](function(_0x97936){return db[_0x5406('0x75')][_0x5406('0x7d')](function(_0x5d95ec){return _0x97936[_0x5406('0x6d')](_0x1a0bdf[_0x5406('0x38')][_0x5406('0x7e')],{'transaction':_0x5d95ec})[_0x5406('0x2a')](function(){if(!_[_0x5406('0x7f')](_0x1b42e7)){return _0x97936[_0x5406('0x80')](_0x1b42e7,{'transaction':_0x5d95ec});}})[_0x5406('0x2a')](function(){_0x1b42e7[_0x5406('0x81')](function(_0x2cbf12){socket[_0x5406('0x82')](_0x5406('0x83'),{'UserId':_0x2cbf12,'MailQueueId':_0x97936['id']});});});});});});})['then'](respondWithStatusCode(_0x353e76,null))['catch'](handleError(_0x353e76,null));};exports[_0x5406('0x84')]=function(_0x4965c1,_0x20f8a3,_0x27c479){return db[_0x5406('0x35')]['find']({'where':{'id':_0x4965c1[_0x5406('0x49')]['id']}})['then'](handleEntityNotFound(_0x20f8a3,null))[_0x5406('0x2a')](function(_0x47d9a1){if(_0x47d9a1){return _0x47d9a1[_0x5406('0x84')](_0x4965c1[_0x5406('0x4d')][_0x5406('0x7e')],_[_0x5406('0x85')](_0x4965c1[_0x5406('0x4d')],['ids','id'])||{})[_0x5406('0x86')](function(_0x16bc35){for(var _0x4e80a0=0x0;_0x4e80a0<_0x4965c1['body'][_0x5406('0x7e')][_0x5406('0x4b')];_0x4e80a0+=0x1){socket[_0x5406('0x82')](_0x5406('0x6c'),{'UserId':Number(_0x4965c1[_0x5406('0x4d')][_0x5406('0x7e')][_0x4e80a0]),'MailQueueId':Number(_0x4965c1[_0x5406('0x49')]['id'])});}return _0x16bc35;});}})[_0x5406('0x2a')](respondWithResult(_0x20f8a3,null))['catch'](handleError(_0x20f8a3,null));};exports[_0x5406('0x80')]=function(_0x2b0fb1,_0x21f6a3,_0x4a535d){return db['MailQueue']['find']({'where':{'id':_0x2b0fb1['params']['id']}})[_0x5406('0x2a')](handleEntityNotFound(_0x21f6a3,null))[_0x5406('0x2a')](function(_0x579a53){if(_0x579a53){return _0x579a53[_0x5406('0x80')](_0x2b0fb1['query']['ids'])['then'](function(){if(_[_0x5406('0x87')](_0x2b0fb1[_0x5406('0x38')]['ids'])){for(var _0x259f7d=0x0;_0x259f7d<_0x2b0fb1[_0x5406('0x38')]['ids'][_0x5406('0x4b')];_0x259f7d+=0x1){socket['emit'](_0x5406('0x83'),{'UserId':Number(_0x2b0fb1[_0x5406('0x38')][_0x5406('0x7e')][_0x259f7d]),'MailQueueId':Number(_0x2b0fb1[_0x5406('0x49')]['id'])});}}else{socket[_0x5406('0x82')]('userMailQueue:remove',{'UserId':Number(_0x2b0fb1[_0x5406('0x38')][_0x5406('0x7e')]),'MailQueueId':Number(_0x2b0fb1[_0x5406('0x49')]['id'])});}});}})[_0x5406('0x2a')](respondWithStatusCode(_0x21f6a3,null))[_0x5406('0x48')](handleError(_0x21f6a3,null));};exports[_0x5406('0x88')]=function(_0xfce2bb,_0x4d83c9,_0x453df0){var _0x1587fa={};var _0x37128d={};var _0x251067;var _0x2a1153;return db[_0x5406('0x35')]['findOne']({'where':{'id':_0xfce2bb['params']['id']}})[_0x5406('0x2a')](handleEntityNotFound(_0x4d83c9,null))['then'](function(_0x8fcb90){if(_0x8fcb90){_0x251067=_0x8fcb90;_0x37128d['model']=_['keys'](db[_0x5406('0x5d')]['rawAttributes']);_0x37128d[_0x5406('0x38')]=_['keys'](_0xfce2bb[_0x5406('0x38')]);_0x37128d['filters']=_[_0x5406('0x3b')](_0x37128d['model'],_0x37128d[_0x5406('0x38')]);_0x1587fa[_0x5406('0x3c')]=_['intersection'](_0x37128d[_0x5406('0x4a')],qs[_0x5406('0x3d')](_0xfce2bb[_0x5406('0x38')][_0x5406('0x3d')]));_0x1587fa[_0x5406('0x3c')]=_0x1587fa[_0x5406('0x3c')][_0x5406('0x4b')]?_0x1587fa[_0x5406('0x3c')]:_0x37128d['model'];_0x1587fa[_0x5406('0x59')]=qs[_0x5406('0x40')](_0xfce2bb[_0x5406('0x38')][_0x5406('0x40')]);_0x1587fa['where']=qs['filters'](_[_0x5406('0x5a')](_0xfce2bb[_0x5406('0x38')],_0x37128d[_0x5406('0x3a')]));if(_0xfce2bb[_0x5406('0x38')][_0x5406('0x42')]){_0x1587fa['where']=_['merge'](_0x1587fa[_0x5406('0x41')],{'$or':_['map'](_0x1587fa[_0x5406('0x3c')],function(_0x537abe){var _0x3b79dc={};_0x3b79dc[_0x537abe]={'$like':'%'+_0xfce2bb[_0x5406('0x38')][_0x5406('0x42')]+'%'};return _0x3b79dc;})});}_0x1587fa=_[_0x5406('0x43')]({},_0x1587fa,_0xfce2bb[_0x5406('0x45')]);return _0x251067[_0x5406('0x88')](_0x1587fa);}})[_0x5406('0x2a')](function(_0x1a58cf){if(_0x1a58cf){_0x2a1153=_0x1a58cf[_0x5406('0x4b')];if(!_0xfce2bb['query'][_0x5406('0x3e')](_0x5406('0x3f'))){_0x1587fa[_0x5406('0x23')]=qs[_0x5406('0x23')](_0xfce2bb[_0x5406('0x38')][_0x5406('0x23')]);_0x1587fa['offset']=qs[_0x5406('0x21')](_0xfce2bb[_0x5406('0x38')][_0x5406('0x21')]);}return _0x251067[_0x5406('0x88')](_0x1587fa);}})['then'](function(_0x5e92ed){if(_0x5e92ed){return _0x5e92ed?{'count':_0x2a1153,'rows':_0x5e92ed}:null;}})[_0x5406('0x2a')](respondWithResult(_0x4d83c9,null))['catch'](handleError(_0x4d83c9,null));};
\ No newline at end of file
+var _0x9829=['./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','get','MailQueues','UserProfileResource','error','stack','name','index','MailQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserMailQueue','hasOwnProperty','MailQueueId','User','findAndCountAll','UserId','mailPause','updatedAt','createdAt','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','SELECT','includes','compact','value','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','userMailQueue:save','isArray','getAgents','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost'];(function(_0x31e9cc,_0x84d7f0){var _0x3b4181=function(_0x2a45a6){while(--_0x2a45a6){_0x31e9cc['push'](_0x31e9cc['shift']());}};_0x3b4181(++_0x84d7f0);}(_0x9829,0xfb));var _0x9982=function(_0x4bcf38,_0x3c12be){_0x4bcf38=_0x4bcf38-0x0;var _0x4a89be=_0x9829[_0x4bcf38];return _0x4a89be;};'use strict';var emlformat=require(_0x9982('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9982('0x1'));var rp=require('request-promise');var moment=require(_0x9982('0x2'));var BPromise=require(_0x9982('0x3'));var Mustache=require(_0x9982('0x4'));var util=require('util');var path=require(_0x9982('0x5'));var sox=require(_0x9982('0x6'));var csv=require(_0x9982('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9982('0x8'));var squel=require(_0x9982('0x9'));var crypto=require('crypto');var jsforce=require(_0x9982('0xa'));var deskjs=require(_0x9982('0xb'));var toCsv=require(_0x9982('0x7'));var querystring=require('querystring');var Papa=require(_0x9982('0xc'));var Redis=require(_0x9982('0xd'));var authService=require(_0x9982('0xe'));var qs=require(_0x9982('0xf'));var as=require(_0x9982('0x10'));var hardwareService=require(_0x9982('0x11'));var logger=require(_0x9982('0x12'))(_0x9982('0x13'));var utils=require(_0x9982('0x14'));var config=require(_0x9982('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x9982('0x16'))['db'];config[_0x9982('0x17')]=_['defaults'](config['redis'],{'host':_0x9982('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9982('0x17')]));require(_0x9982('0x19'))[_0x9982('0x1a')](socket);function respondWithStatusCode(_0x4271ff,_0x2559d4){_0x2559d4=_0x2559d4||0xcc;return function(_0x3236bd){if(_0x3236bd){return _0x4271ff[_0x9982('0x1b')](_0x2559d4);}return _0x4271ff[_0x9982('0x1c')](_0x2559d4)[_0x9982('0x1d')]();};}function respondWithResult(_0x2fb2dd,_0x340b85){_0x340b85=_0x340b85||0xc8;return function(_0x14deec){if(_0x14deec){return _0x2fb2dd[_0x9982('0x1c')](_0x340b85)[_0x9982('0x1e')](_0x14deec);}};}function respondWithFilteredResult(_0x3fd17c,_0x31c128){return function(_0xecdd2a){if(_0xecdd2a){var _0x1368e0=typeof _0x31c128[_0x9982('0x1f')]===_0x9982('0x20')&&typeof _0x31c128[_0x9982('0x21')]==='undefined';var _0x46b101=_0xecdd2a['count'];var _0x3d4629=_0x1368e0?0x0:_0x31c128[_0x9982('0x1f')];var _0x2f44b1=_0x1368e0?_0xecdd2a[_0x9982('0x22')]:_0x31c128[_0x9982('0x1f')]+_0x31c128[_0x9982('0x21')];var _0x3f71dc;if(_0x2f44b1>=_0x46b101){_0x2f44b1=_0x46b101;_0x3f71dc=0xc8;}else{_0x3f71dc=0xce;}_0x3fd17c['status'](_0x3f71dc);return _0x3fd17c[_0x9982('0x23')](_0x9982('0x24'),_0x3d4629+'-'+_0x2f44b1+'/'+_0x46b101)[_0x9982('0x1e')](_0xecdd2a);}return null;};}function patchUpdates(_0x7a9646){return function(_0x78a0e4){try{jsonpatch[_0x9982('0x25')](_0x78a0e4,_0x7a9646,!![]);}catch(_0x2af814){return BPromise[_0x9982('0x26')](_0x2af814);}return _0x78a0e4[_0x9982('0x27')]();};}function saveUpdates(_0x358345,_0x95dd7c){return function(_0x354ab7){if(_0x354ab7){return _0x354ab7['update'](_0x358345)[_0x9982('0x28')](function(_0x2bb108){return _0x2bb108;});}return null;};}function removeEntity(_0x12e8c2,_0x2fa48d){return function(_0xdf3dae){if(_0xdf3dae){return _0xdf3dae[_0x9982('0x29')]()['then'](function(){var _0x55c636=_0xdf3dae[_0x9982('0x2a')]({'plain':!![]});var _0x5335c7=_0x9982('0x2b');return db[_0x9982('0x2c')][_0x9982('0x29')]({'where':{'type':_0x5335c7,'resourceId':_0x55c636['id']}})[_0x9982('0x28')](function(){return _0xdf3dae;});})['then'](function(){_0x12e8c2[_0x9982('0x1c')](0xcc)[_0x9982('0x1d')]();});}};}function handleEntityNotFound(_0x3e8fed,_0x13aae4){return function(_0xd0b324){if(!_0xd0b324){_0x3e8fed['sendStatus'](0x194);}return _0xd0b324;};}function handleError(_0x3e8651,_0x3b47a0){_0x3b47a0=_0x3b47a0||0x1f4;return function(_0x868f62){logger[_0x9982('0x2d')](_0x868f62[_0x9982('0x2e')]);if(_0x868f62[_0x9982('0x2f')]){delete _0x868f62['name'];}_0x3e8651['status'](_0x3b47a0)['send'](_0x868f62);};}exports[_0x9982('0x30')]=function(_0x242c7e,_0x65a4fb){var _0x29db5b={},_0xf52b6c={},_0x4100d5={'count':0x0,'rows':[]};var _0x47a150=_['map'](db[_0x9982('0x31')][_0x9982('0x32')],function(_0x29f1f0){return{'name':_0x29f1f0[_0x9982('0x33')],'type':_0x29f1f0[_0x9982('0x34')][_0x9982('0x35')]};});_0xf52b6c[_0x9982('0x36')]=_[_0x9982('0x37')](_0x47a150,_0x9982('0x2f'));_0xf52b6c[_0x9982('0x38')]=_[_0x9982('0x39')](_0x242c7e[_0x9982('0x38')]);_0xf52b6c[_0x9982('0x3a')]=_[_0x9982('0x3b')](_0xf52b6c[_0x9982('0x36')],_0xf52b6c['query']);_0x29db5b[_0x9982('0x3c')]=_[_0x9982('0x3b')](_0xf52b6c[_0x9982('0x36')],qs['fields'](_0x242c7e['query'][_0x9982('0x3d')]));_0x29db5b['attributes']=_0x29db5b[_0x9982('0x3c')][_0x9982('0x3e')]?_0x29db5b['attributes']:_0xf52b6c[_0x9982('0x36')];if(!_0x242c7e[_0x9982('0x38')]['hasOwnProperty'](_0x9982('0x3f'))){_0x29db5b[_0x9982('0x21')]=qs[_0x9982('0x21')](_0x242c7e[_0x9982('0x38')][_0x9982('0x21')]);_0x29db5b['offset']=qs[_0x9982('0x1f')](_0x242c7e[_0x9982('0x38')][_0x9982('0x1f')]);}_0x29db5b[_0x9982('0x40')]=qs[_0x9982('0x41')](_0x242c7e[_0x9982('0x38')][_0x9982('0x41')]);_0x29db5b[_0x9982('0x42')]=qs[_0x9982('0x3a')](_[_0x9982('0x43')](_0x242c7e[_0x9982('0x38')],_0xf52b6c[_0x9982('0x3a')]),_0x47a150);if(_0x242c7e[_0x9982('0x38')][_0x9982('0x44')]){_0x29db5b[_0x9982('0x42')]=_[_0x9982('0x45')](_0x29db5b[_0x9982('0x42')],{'$or':_[_0x9982('0x37')](_0x47a150,function(_0x2058cd){if(_0x2058cd['type']!==_0x9982('0x46')){var _0x4b6565={};_0x4b6565[_0x2058cd[_0x9982('0x2f')]]={'$like':'%'+_0x242c7e[_0x9982('0x38')][_0x9982('0x44')]+'%'};return _0x4b6565;}})});}_0x29db5b=_['merge']({},_0x29db5b,_0x242c7e[_0x9982('0x47')]);var _0x294da8={'where':_0x29db5b['where']};return db['MailQueue'][_0x9982('0x22')](_0x294da8)[_0x9982('0x28')](function(_0x28b26c){_0x4100d5[_0x9982('0x22')]=_0x28b26c;if(_0x242c7e[_0x9982('0x38')]['includeAll']){_0x29db5b[_0x9982('0x48')]=[{'all':!![]}];}return db['MailQueue'][_0x9982('0x49')](_0x29db5b);})['then'](function(_0x5ea205){_0x4100d5[_0x9982('0x4a')]=_0x5ea205;return _0x4100d5;})['then'](respondWithFilteredResult(_0x65a4fb,_0x29db5b))[_0x9982('0x4b')](handleError(_0x65a4fb,null));};exports[_0x9982('0x4c')]=function(_0x2d60bb,_0x50103d){var _0x2a64c9={'raw':!![],'where':{'id':_0x2d60bb[_0x9982('0x4d')]['id']}},_0x7cf317={};_0x7cf317[_0x9982('0x36')]=_['keys'](db['MailQueue'][_0x9982('0x32')]);_0x7cf317[_0x9982('0x38')]=_['keys'](_0x2d60bb['query']);_0x7cf317[_0x9982('0x3a')]=_[_0x9982('0x3b')](_0x7cf317[_0x9982('0x36')],_0x7cf317[_0x9982('0x38')]);_0x2a64c9[_0x9982('0x3c')]=_[_0x9982('0x3b')](_0x7cf317['model'],qs[_0x9982('0x3d')](_0x2d60bb[_0x9982('0x38')][_0x9982('0x3d')]));_0x2a64c9[_0x9982('0x3c')]=_0x2a64c9[_0x9982('0x3c')][_0x9982('0x3e')]?_0x2a64c9[_0x9982('0x3c')]:_0x7cf317['model'];if(_0x2d60bb[_0x9982('0x38')][_0x9982('0x4e')]){_0x2a64c9['include']=[{'all':!![]}];}_0x2a64c9=_[_0x9982('0x45')]({},_0x2a64c9,_0x2d60bb[_0x9982('0x47')]);return db[_0x9982('0x31')]['find'](_0x2a64c9)['then'](handleEntityNotFound(_0x50103d,null))[_0x9982('0x28')](respondWithResult(_0x50103d,null))[_0x9982('0x4b')](handleError(_0x50103d,null));};exports['create']=function(_0x4ac259,_0x3adda3){return db[_0x9982('0x31')]['create'](_0x4ac259['body'],{})[_0x9982('0x28')](function(_0x3839db){var _0x5a2f4e=_0x4ac259['user'][_0x9982('0x2a')]({'plain':!![]});if(!_0x5a2f4e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a2f4e[_0x9982('0x4f')]==='user'){var _0x4db454=_0x3839db['get']({'plain':!![]});var _0x11a1a5=_0x9982('0x2b');return db[_0x9982('0x50')][_0x9982('0x51')]({'where':{'name':_0x11a1a5,'userProfileId':_0x5a2f4e[_0x9982('0x52')]},'raw':!![]})[_0x9982('0x28')](function(_0x32da75){if(_0x32da75&&_0x32da75[_0x9982('0x53')]===0x0){return db[_0x9982('0x2c')]['create']({'name':_0x4db454[_0x9982('0x2f')],'resourceId':_0x4db454['id'],'type':_0x32da75[_0x9982('0x2f')],'sectionId':_0x32da75['id']},{})[_0x9982('0x28')](function(){return _0x3839db;});}else{return _0x3839db;}})[_0x9982('0x4b')](function(_0x289845){logger[_0x9982('0x2d')](_0x9982('0x54'),_0x289845);throw _0x289845;});}return _0x3839db;})[_0x9982('0x28')](respondWithResult(_0x3adda3,0xc9))[_0x9982('0x4b')](handleError(_0x3adda3,null));};exports['update']=function(_0x1570ef,_0x5aed9a){if(_0x1570ef[_0x9982('0x55')]['id']){delete _0x1570ef['body']['id'];}return db[_0x9982('0x31')][_0x9982('0x51')]({'where':{'id':_0x1570ef[_0x9982('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5aed9a,null))['then'](saveUpdates(_0x1570ef['body'],null))[_0x9982('0x28')](respondWithResult(_0x5aed9a,null))[_0x9982('0x4b')](handleError(_0x5aed9a,null));};exports[_0x9982('0x29')]=function(_0x331109,_0x3c6464){return db[_0x9982('0x31')][_0x9982('0x51')]({'where':{'id':_0x331109[_0x9982('0x4d')]['id']}})[_0x9982('0x28')](handleEntityNotFound(_0x3c6464,null))[_0x9982('0x28')](removeEntity(_0x3c6464,null))[_0x9982('0x4b')](handleError(_0x3c6464,null));};exports[_0x9982('0x56')]=function(_0x2ea1d0,_0x31c1ca){return db[_0x9982('0x31')][_0x9982('0x56')]()[_0x9982('0x28')](respondWithResult(_0x31c1ca,null))[_0x9982('0x4b')](handleError(_0x31c1ca,null));};exports[_0x9982('0x57')]=function(_0x27e776,_0xb776ab,_0x3c4f85){var _0x5b158a={'raw':!![],'where':{}},_0x55b8aa={},_0x163cef;return db[_0x9982('0x31')][_0x9982('0x58')]({'where':{'id':_0x27e776['params']['id']}})[_0x9982('0x28')](handleEntityNotFound(_0xb776ab,null))[_0x9982('0x28')](function(_0x4ba80e){if(_0x4ba80e){_0x163cef=_0x4ba80e[_0x9982('0x2a')]({'plain':!![]});_0x55b8aa['model']=_['keys'](db[_0x9982('0x59')][_0x9982('0x32')]);_0x55b8aa[_0x9982('0x38')]=_[_0x9982('0x39')](_0x27e776[_0x9982('0x38')]);_0x55b8aa['filters']=_[_0x9982('0x3b')](_0x55b8aa[_0x9982('0x36')],_0x55b8aa[_0x9982('0x38')]);_0x5b158a['attributes']=_['intersection'](_0x55b8aa[_0x9982('0x36')],qs[_0x9982('0x3d')](_0x27e776[_0x9982('0x38')][_0x9982('0x3d')]));_0x5b158a['attributes']=_0x5b158a['attributes'][_0x9982('0x3e')]?_0x5b158a[_0x9982('0x3c')]:_0x55b8aa[_0x9982('0x36')];if(!_0x27e776[_0x9982('0x38')][_0x9982('0x5a')]('nolimit')){_0x5b158a['limit']=qs[_0x9982('0x21')](_0x27e776['query']['limit']);_0x5b158a[_0x9982('0x1f')]=qs['offset'](_0x27e776[_0x9982('0x38')]['offset']);}_0x5b158a[_0x9982('0x40')]=qs['sort'](_0x27e776[_0x9982('0x38')][_0x9982('0x41')]);_0x5b158a[_0x9982('0x42')]=qs[_0x9982('0x3a')](_['pick'](_0x27e776[_0x9982('0x38')],_0x55b8aa[_0x9982('0x3a')]));_0x5b158a[_0x9982('0x42')][_0x9982('0x5b')]=_0x4ba80e['id'];if(_0x27e776[_0x9982('0x38')][_0x9982('0x44')]){_0x5b158a[_0x9982('0x42')]=_[_0x9982('0x45')](_0x5b158a[_0x9982('0x42')],{'$or':_[_0x9982('0x37')](_0x5b158a[_0x9982('0x3c')],function(_0x69313){var _0x4fb588={};_0x4fb588[_0x69313]={'$like':'%'+_0x27e776[_0x9982('0x38')][_0x9982('0x44')]+'%'};return _0x4fb588;})});}_0x5b158a=_[_0x9982('0x45')]({},_0x5b158a,_0x27e776[_0x9982('0x47')]);return db[_0x9982('0x59')]['findAll'](_0x5b158a);}})['then'](function(_0x4aa1a6){if(_0x4aa1a6){return db[_0x9982('0x5c')][_0x9982('0x5d')]({'where':{'id':_['map'](_0x4aa1a6,_0x9982('0x5e')),'role':'agent'},'attributes':['id',_0x9982('0x2f'),_0x9982('0x5f'),_0x9982('0x60'),_0x9982('0x61')]});}})[_0x9982('0x28')](function(_0x153758){if(_0x153758){return{'count':_0x153758[_0x9982('0x22')],'rows':_[_0x9982('0x37')](_0x153758[_0x9982('0x4a')],function(_0x27f4e4){return{'membername':_0x27f4e4['name'],'UserId':_0x27f4e4['id'],'queue_name':_0x163cef['name'],'MailQueueId':_0x163cef['id'],'interface':util['format'](_0x9982('0x62'),_0x9982('0x63'),_0x27f4e4[_0x9982('0x2f')]),'penalty':0x0,'paused':_0x27f4e4[_0x9982('0x5f')],'createdAt':_0x27f4e4['createdAt'],'updatedAt':_0x27f4e4[_0x9982('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xb776ab,_0x5b158a))[_0x9982('0x4b')](handleError(_0xb776ab,null));};exports[_0x9982('0x64')]=function(_0x1be9fb,_0x4f7fe0,_0x192d81){var _0x3d8aba={};var _0x1b8c49={};var _0x333574;var _0x513b40;return db[_0x9982('0x31')][_0x9982('0x58')]({'where':{'id':_0x1be9fb[_0x9982('0x4d')]['id']}})[_0x9982('0x28')](handleEntityNotFound(_0x4f7fe0,null))['then'](function(_0x2431da){if(_0x2431da){_0x333574=_0x2431da;_0x1b8c49[_0x9982('0x36')]=_[_0x9982('0x39')](db[_0x9982('0x65')][_0x9982('0x32')]);_0x1b8c49[_0x9982('0x38')]=_['keys'](_0x1be9fb[_0x9982('0x38')]);_0x1b8c49[_0x9982('0x3a')]=_[_0x9982('0x3b')](_0x1b8c49[_0x9982('0x36')],_0x1b8c49[_0x9982('0x38')]);_0x3d8aba[_0x9982('0x3c')]=_[_0x9982('0x3b')](_0x1b8c49['model'],qs[_0x9982('0x3d')](_0x1be9fb[_0x9982('0x38')][_0x9982('0x3d')]));_0x3d8aba[_0x9982('0x3c')]=_0x3d8aba[_0x9982('0x3c')][_0x9982('0x3e')]?_0x3d8aba[_0x9982('0x3c')]:_0x1b8c49[_0x9982('0x36')];_0x3d8aba[_0x9982('0x40')]=qs[_0x9982('0x41')](_0x1be9fb[_0x9982('0x38')][_0x9982('0x41')]);_0x3d8aba[_0x9982('0x42')]=qs[_0x9982('0x3a')](_[_0x9982('0x43')](_0x1be9fb['query'],_0x1b8c49[_0x9982('0x3a')]));if(_0x1be9fb[_0x9982('0x38')][_0x9982('0x44')]){_0x3d8aba[_0x9982('0x42')]=_[_0x9982('0x45')](_0x3d8aba['where'],{'$or':_['map'](_0x3d8aba[_0x9982('0x3c')],function(_0x5b1aa5){var _0x359702={};_0x359702[_0x5b1aa5]={'$like':'%'+_0x1be9fb['query'][_0x9982('0x44')]+'%'};return _0x359702;})});}_0x3d8aba=_[_0x9982('0x45')]({},_0x3d8aba,_0x1be9fb[_0x9982('0x47')]);return _0x333574['getTeams'](_0x3d8aba);}})[_0x9982('0x28')](function(_0x7f4ec1){if(_0x7f4ec1){_0x513b40=_0x7f4ec1[_0x9982('0x3e')];if(!_0x1be9fb['query'][_0x9982('0x5a')](_0x9982('0x3f'))){_0x3d8aba[_0x9982('0x21')]=qs[_0x9982('0x21')](_0x1be9fb['query']['limit']);_0x3d8aba[_0x9982('0x1f')]=qs[_0x9982('0x1f')](_0x1be9fb['query'][_0x9982('0x1f')]);}return _0x333574[_0x9982('0x64')](_0x3d8aba);}})['then'](function(_0x2df4c6){if(_0x2df4c6){return _0x2df4c6?{'count':_0x513b40,'rows':_0x2df4c6}:null;}})[_0x9982('0x28')](respondWithResult(_0x4f7fe0,null))[_0x9982('0x4b')](handleError(_0x4f7fe0,null));};exports[_0x9982('0x66')]=function(_0x463ff7,_0x2b1512,_0x5b6412){var _0x355f9e=_0x463ff7[_0x9982('0x55')][_0x9982('0x67')];return db[_0x9982('0x65')][_0x9982('0x49')]({'where':{'id':_0x355f9e},'attributes':['id'],'include':[{'model':db[_0x9982('0x5c')],'as':_0x9982('0x68'),'attributes':['id',_0x9982('0x2f'),_0x9982('0x69'),_0x9982('0x6a'),_0x9982('0x6b')],'raw':!![]}]})[_0x9982('0x28')](function(_0x4774fb){if(_0x4774fb){var _0x3e754a=_[_0x9982('0x6c')](_0x4774fb,function(_0x1c94db){var _0x396d9d=_0x1c94db[_0x9982('0x2a')]({'plain':!![]});return _0x396d9d[_0x9982('0x68')];});return db[_0x9982('0x31')][_0x9982('0x51')]({'where':{'id':_0x463ff7[_0x9982('0x4d')]['id']}})[_0x9982('0x28')](function(_0x44b83f){return db['sequelize'][_0x9982('0x6d')](function(_0x345ae1){return _0x44b83f[_0x9982('0x66')](_0x355f9e,{'transaction':_0x345ae1})[_0x9982('0x28')](function(){return BPromise[_0x9982('0x6e')](_0x3e754a,function(_0x3cf476){return db[_0x9982('0x59')][_0x9982('0x6f')]({'where':{'UserId':_0x3cf476['id'],'MailQueueId':_0x463ff7[_0x9982('0x4d')]['id']},'transaction':_0x345ae1});});})[_0x9982('0x28')](function(){_0x3e754a[_0x9982('0x70')](function(_0x11e58f){socket[_0x9982('0x71')]('userMailQueue:save',{'UserId':_0x11e58f['id'],'MailQueueId':_0x44b83f['id']});});});});});}})[_0x9982('0x28')](respondWithStatusCode(_0x2b1512,null))[_0x9982('0x4b')](handleError(_0x2b1512,null));};exports[_0x9982('0x72')]=function(_0x376cff,_0x24e826,_0x56b89b){return db['Team'][_0x9982('0x49')]({'where':{'id':_0x376cff[_0x9982('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x9982('0x5c')],'as':_0x9982('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x24e826,null))[_0x9982('0x28')](function(_0x1d6a8f){var _0x3eaebb=_[_0x9982('0x37')](_0x1d6a8f,'id');var _0x993f30=[];var _0xd4e2cf=[];var _0x123cde=squel[_0x9982('0x73')]();_0x123cde[_0x9982('0x74')](_0x9982('0x75'))['from'](_0x9982('0x76'),'tq')[_0x9982('0x77')]('user_has_teams','ut',_0x9982('0x78'))[_0x9982('0x42')](_0x9982('0x79'),_0x376cff['params']['id']);for(var _0x12c9d3=0x0;_0x12c9d3<_0x1d6a8f[_0x9982('0x3e')];_0x12c9d3+=0x1){let _0x2d2ff4=_0x1d6a8f[_0x12c9d3];for(var _0xa87d0=0x0;_0xa87d0<_0x2d2ff4[_0x9982('0x68')][_0x9982('0x3e')];_0xa87d0+=0x1){let _0x56cfcc=_0x2d2ff4[_0x9982('0x68')][_0xa87d0];var _0x507ee7=_0x123cde[_0x9982('0x7a')]();_0x507ee7[_0x9982('0x42')](_0x9982('0x7b'),_0x56cfcc['id']);_0xd4e2cf['push'](db[_0x9982('0x7c')][_0x9982('0x38')](_0x507ee7['toString'](),{'type':db[_0x9982('0x7c')]['QueryTypes'][_0x9982('0x7d')]})[_0x9982('0x28')](function(_0x41f736){if(_0x41f736[_0x9982('0x3e')]===0x1){return _0x56cfcc['id'];}else{var _0x48aac7=_['every'](_['map'](_0x41f736,'TeamId'),function(_0x28a2c2){return _[_0x9982('0x7e')](_0x3eaebb,_0x28a2c2);});if(_0x48aac7){return _0x56cfcc['id'];}}}));}}return BPromise['all'](_0xd4e2cf)[_0x9982('0x28')](function(_0x242f00){_0x993f30=_(_0x993f30)['union'](_0x242f00)[_0x9982('0x7f')]()[_0x9982('0x80')]();return db[_0x9982('0x31')][_0x9982('0x51')]({'where':{'id':_0x376cff[_0x9982('0x4d')]['id']}})[_0x9982('0x28')](function(_0x33786e){return db[_0x9982('0x7c')][_0x9982('0x6d')](function(_0x1338d8){return _0x33786e[_0x9982('0x72')](_0x376cff[_0x9982('0x38')]['ids'],{'transaction':_0x1338d8})[_0x9982('0x28')](function(){if(!_[_0x9982('0x81')](_0x993f30)){return _0x33786e[_0x9982('0x82')](_0x993f30,{'transaction':_0x1338d8});}})['then'](function(){_0x993f30['forEach'](function(_0x46dc57){socket['emit'](_0x9982('0x83'),{'UserId':_0x46dc57,'MailQueueId':_0x33786e['id']});});});});});});})[_0x9982('0x28')](respondWithStatusCode(_0x24e826,null))['catch'](handleError(_0x24e826,null));};exports['addAgents']=function(_0x18a269,_0xb6396a,_0x10b2fb){return db[_0x9982('0x31')][_0x9982('0x51')]({'where':{'id':_0x18a269[_0x9982('0x4d')]['id']}})[_0x9982('0x28')](handleEntityNotFound(_0xb6396a,null))[_0x9982('0x28')](function(_0x335af6){if(_0x335af6){return _0x335af6[_0x9982('0x84')](_0x18a269[_0x9982('0x55')]['ids'],_[_0x9982('0x85')](_0x18a269[_0x9982('0x55')],[_0x9982('0x67'),'id'])||{})[_0x9982('0x86')](function(_0x297fa8){for(var _0x8733e2=0x0;_0x8733e2<_0x18a269[_0x9982('0x55')][_0x9982('0x67')][_0x9982('0x3e')];_0x8733e2+=0x1){socket[_0x9982('0x71')](_0x9982('0x87'),{'UserId':Number(_0x18a269[_0x9982('0x55')]['ids'][_0x8733e2]),'MailQueueId':Number(_0x18a269[_0x9982('0x4d')]['id'])});}return _0x297fa8;});}})[_0x9982('0x28')](respondWithResult(_0xb6396a,null))[_0x9982('0x4b')](handleError(_0xb6396a,null));};exports[_0x9982('0x82')]=function(_0x210cf7,_0x472ebc,_0xb60092){return db[_0x9982('0x31')]['find']({'where':{'id':_0x210cf7[_0x9982('0x4d')]['id']}})[_0x9982('0x28')](handleEntityNotFound(_0x472ebc,null))['then'](function(_0x5c11a8){if(_0x5c11a8){return _0x5c11a8[_0x9982('0x82')](_0x210cf7[_0x9982('0x38')][_0x9982('0x67')])['then'](function(){if(_[_0x9982('0x88')](_0x210cf7['query']['ids'])){for(var _0x128649=0x0;_0x128649<_0x210cf7['query'][_0x9982('0x67')]['length'];_0x128649+=0x1){socket[_0x9982('0x71')](_0x9982('0x83'),{'UserId':Number(_0x210cf7['query'][_0x9982('0x67')][_0x128649]),'MailQueueId':Number(_0x210cf7[_0x9982('0x4d')]['id'])});}}else{socket[_0x9982('0x71')](_0x9982('0x83'),{'UserId':Number(_0x210cf7[_0x9982('0x38')][_0x9982('0x67')]),'MailQueueId':Number(_0x210cf7[_0x9982('0x4d')]['id'])});}});}})['then'](respondWithStatusCode(_0x472ebc,null))[_0x9982('0x4b')](handleError(_0x472ebc,null));};exports[_0x9982('0x89')]=function(_0x2fe445,_0xda4f7e,_0xf87334){var _0x3fdadf={};var _0x2586f5={};var _0x5aa40a;var _0x5c933e;return db[_0x9982('0x31')][_0x9982('0x58')]({'where':{'id':_0x2fe445[_0x9982('0x4d')]['id']}})['then'](handleEntityNotFound(_0xda4f7e,null))[_0x9982('0x28')](function(_0x8935e3){if(_0x8935e3){_0x5aa40a=_0x8935e3;_0x2586f5['model']=_[_0x9982('0x39')](db[_0x9982('0x5c')]['rawAttributes']);_0x2586f5[_0x9982('0x38')]=_[_0x9982('0x39')](_0x2fe445['query']);_0x2586f5[_0x9982('0x3a')]=_[_0x9982('0x3b')](_0x2586f5[_0x9982('0x36')],_0x2586f5[_0x9982('0x38')]);_0x3fdadf[_0x9982('0x3c')]=_[_0x9982('0x3b')](_0x2586f5[_0x9982('0x36')],qs[_0x9982('0x3d')](_0x2fe445[_0x9982('0x38')][_0x9982('0x3d')]));_0x3fdadf[_0x9982('0x3c')]=_0x3fdadf[_0x9982('0x3c')]['length']?_0x3fdadf[_0x9982('0x3c')]:_0x2586f5[_0x9982('0x36')];_0x3fdadf[_0x9982('0x40')]=qs[_0x9982('0x41')](_0x2fe445[_0x9982('0x38')][_0x9982('0x41')]);_0x3fdadf[_0x9982('0x42')]=qs[_0x9982('0x3a')](_[_0x9982('0x43')](_0x2fe445[_0x9982('0x38')],_0x2586f5[_0x9982('0x3a')]));if(_0x2fe445[_0x9982('0x38')][_0x9982('0x44')]){_0x3fdadf[_0x9982('0x42')]=_['merge'](_0x3fdadf[_0x9982('0x42')],{'$or':_[_0x9982('0x37')](_0x3fdadf[_0x9982('0x3c')],function(_0x29cdf3){var _0x28c91d={};_0x28c91d[_0x29cdf3]={'$like':'%'+_0x2fe445['query'][_0x9982('0x44')]+'%'};return _0x28c91d;})});}_0x3fdadf=_[_0x9982('0x45')]({},_0x3fdadf,_0x2fe445[_0x9982('0x47')]);return _0x5aa40a[_0x9982('0x89')](_0x3fdadf);}})[_0x9982('0x28')](function(_0x186d2a){if(_0x186d2a){_0x5c933e=_0x186d2a[_0x9982('0x3e')];if(!_0x2fe445[_0x9982('0x38')]['hasOwnProperty'](_0x9982('0x3f'))){_0x3fdadf[_0x9982('0x21')]=qs[_0x9982('0x21')](_0x2fe445[_0x9982('0x38')][_0x9982('0x21')]);_0x3fdadf[_0x9982('0x1f')]=qs[_0x9982('0x1f')](_0x2fe445['query'][_0x9982('0x1f')]);}return _0x5aa40a['getAgents'](_0x3fdadf);}})['then'](function(_0x348376){if(_0x348376){return _0x348376?{'count':_0x5c933e,'rows':_0x348376}:null;}})[_0x9982('0x28')](respondWithResult(_0xda4f7e,null))[_0x9982('0x4b')](handleError(_0xda4f7e,null));};
\ No newline at end of file
index a42b3dd..acdd5fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30a5=['setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3d7f76,_0x464b31){var _0x289613=function(_0x5a3689){while(--_0x5a3689){_0x3d7f76['push'](_0x3d7f76['shift']());}};_0x289613(++_0x464b31);}(_0x30a5,0xcc));var _0x530a=function(_0x29d4b5,_0x1913e2){_0x29d4b5=_0x29d4b5-0x0;var _0x3fbb01=_0x30a5[_0x29d4b5];return _0x3fbb01;};'use strict';var EventEmitter=require('events');var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x530a('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x530a('0x1')};function emitEvent(_0x3c5e55){return function(_0x11a5d5,_0x1fb39d,_0x10aec4){MailQueueEvents[_0x530a('0x2')](_0x3c5e55+':'+_0x11a5d5['id'],_0x11a5d5);MailQueueEvents['emit'](_0x3c5e55,_0x11a5d5);_0x10aec4(null);};}for(var e in events){if(events[_0x530a('0x3')](e)){var event=events[e];MailQueue[_0x530a('0x4')](e,emitEvent(event));}}module[_0x530a('0x5')]=MailQueueEvents;
\ No newline at end of file
+var _0xaefb=['emit','hasOwnProperty','exports','events','MailQueue','setMaxListeners','save','remove'];(function(_0xdaf7d4,_0x341fec){var _0x2daecf=function(_0x3a55f5){while(--_0x3a55f5){_0xdaf7d4['push'](_0xdaf7d4['shift']());}};_0x2daecf(++_0x341fec);}(_0xaefb,0x1f3));var _0xbaef=function(_0xb4cc12,_0x41436e){_0xb4cc12=_0xb4cc12-0x0;var _0x8593b5=_0xaefb[_0xb4cc12];return _0x8593b5;};'use strict';var EventEmitter=require(_0xbaef('0x0'));var MailQueue=require('../../mysqldb')['db'][_0xbaef('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xbaef('0x2')](0x0);var events={'afterCreate':_0xbaef('0x3'),'afterUpdate':'update','afterDestroy':_0xbaef('0x4')};function emitEvent(_0x48d639){return function(_0x3916d8,_0x4374b8,_0x53a2a5){MailQueueEvents[_0xbaef('0x5')](_0x48d639+':'+_0x3916d8['id'],_0x3916d8);MailQueueEvents[_0xbaef('0x5')](_0x48d639,_0x3916d8);_0x53a2a5(null);};}for(var e in events){if(events[_0xbaef('0x6')](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0xbaef('0x7')]=MailQueueEvents;
\ No newline at end of file
index 7850a27..3778857 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1d04=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes','define','MailQueue','../../config/logger'];(function(_0x2257c3,_0x38dc9b){var _0x53638c=function(_0x26bcdb){while(--_0x26bcdb){_0x2257c3['push'](_0x2257c3['shift']());}};_0x53638c(++_0x38dc9b);}(_0x1d04,0x15f));var _0x41d0=function(_0x3bee55,_0x4e25c8){_0x3bee55=_0x3bee55-0x0;var _0x5649d2=_0x1d04[_0x3bee55];return _0x5649d2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x41d0('0x0'))(_0x41d0('0x1'));var moment=require(_0x41d0('0x2'));var BPromise=require(_0x41d0('0x3'));var rp=require(_0x41d0('0x4'));var fs=require('fs');var path=require(_0x41d0('0x5'));var rimraf=require(_0x41d0('0x6'));var config=require(_0x41d0('0x7'));var attributes=require(_0x41d0('0x8'));module['exports']=function(_0x55771c,_0x58cb4c){return _0x55771c[_0x41d0('0x9')](_0x41d0('0xa'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x178c=['MailQueue','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./mailQueue.attributes','exports','define'];(function(_0x145bfb,_0x4f974b){var _0x46af90=function(_0x3a95d7){while(--_0x3a95d7){_0x145bfb['push'](_0x145bfb['shift']());}};_0x46af90(++_0x4f974b);}(_0x178c,0x161));var _0xc178=function(_0x5b8524,_0x45cf3b){_0x5b8524=_0x5b8524-0x0;var _0x54c541=_0x178c[_0x5b8524];return _0x54c541;};'use strict';var _=require(_0xc178('0x0'));var util=require('util');var logger=require(_0xc178('0x1'))(_0xc178('0x2'));var moment=require('moment');var BPromise=require(_0xc178('0x3'));var rp=require(_0xc178('0x4'));var fs=require('fs');var path=require(_0xc178('0x5'));var rimraf=require('rimraf');var config=require(_0xc178('0x6'));var attributes=require(_0xc178('0x7'));module[_0xc178('0x8')]=function(_0x236a26,_0x27345e){return _0x236a26[_0xc178('0x9')](_0xc178('0xa'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d4a1413..d71a1d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda79=['request','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','MailQueue','findAll','options','raw','where','attributes','limit','map','include','model','then','GetMailQueue','find','ShowMailQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register'];(function(_0x10c634,_0x406922){var _0x57390b=function(_0x2bce24){while(--_0x2bce24){_0x10c634['push'](_0x10c634['shift']());}};_0x57390b(++_0x406922);}(_0xda79,0x6f));var _0x9da7=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xda79[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x9da7('0x0'));var util=require(_0x9da7('0x1'));var moment=require(_0x9da7('0x2'));var BPromise=require(_0x9da7('0x3'));var rs=require(_0x9da7('0x4'));var fs=require('fs');var Redis=require(_0x9da7('0x5'));var db=require(_0x9da7('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9da7('0x7'))(_0x9da7('0x8'));var config=require(_0x9da7('0x9'));var jayson=require(_0x9da7('0xa'));var client=jayson['client'][_0x9da7('0xb')]({'port':0x232a});config[_0x9da7('0xc')]=_[_0x9da7('0xd')](config[_0x9da7('0xc')],{'host':_0x9da7('0xe'),'port':0x18eb});var socket=require(_0x9da7('0xf'))(new Redis(config['redis']));require(_0x9da7('0x10'))[_0x9da7('0x11')](socket);function respondWithRpcPromise(_0x50f34c,_0x536e44,_0xc49400){return new BPromise(function(_0xeceba8,_0x220c52){return client[_0x9da7('0x12')](_0x50f34c,_0xc49400)['then'](function(_0x3b368a){logger[_0x9da7('0x13')](_0x9da7('0x14'),_0x536e44,_0x9da7('0x15'));logger[_0x9da7('0x16')](_0x9da7('0x17'),_0x536e44,_0x9da7('0x15'),JSON[_0x9da7('0x18')](_0x3b368a));if(_0x3b368a[_0x9da7('0x19')]){if(_0x3b368a[_0x9da7('0x19')]['code']===0x1f4){logger[_0x9da7('0x19')](_0x9da7('0x14'),_0x536e44,_0x3b368a['error']['message']);return _0x220c52(_0x3b368a[_0x9da7('0x19')][_0x9da7('0x1a')]);}logger[_0x9da7('0x19')](_0x9da7('0x14'),_0x536e44,_0x3b368a['error'][_0x9da7('0x1a')]);return _0xeceba8(_0x3b368a[_0x9da7('0x19')][_0x9da7('0x1a')]);}else{logger['info'](_0x9da7('0x14'),_0x536e44,_0x9da7('0x15'));_0xeceba8(_0x3b368a[_0x9da7('0x1b')][_0x9da7('0x1a')]);}})[_0x9da7('0x1c')](function(_0x57574d){logger['error'](_0x9da7('0x14'),_0x536e44,_0x57574d);_0x220c52(_0x57574d);});});}exports['GetMailQueue']=function(_0x2502e7){var _0x466a08=this;return new Promise(function(_0x425fb5,_0x168d4d){return db[_0x9da7('0x1d')][_0x9da7('0x1e')]({'raw':_0x2502e7['options']?_0x2502e7[_0x9da7('0x1f')][_0x9da7('0x20')]===undefined?!![]:![]:!![],'where':_0x2502e7['options']?_0x2502e7['options'][_0x9da7('0x21')]||null:null,'attributes':_0x2502e7[_0x9da7('0x1f')]?_0x2502e7[_0x9da7('0x1f')][_0x9da7('0x22')]||null:null,'limit':_0x2502e7['options']?_0x2502e7[_0x9da7('0x1f')][_0x9da7('0x23')]||null:null,'include':_0x2502e7['options']?_0x2502e7[_0x9da7('0x1f')]['include']?_[_0x9da7('0x24')](_0x2502e7[_0x9da7('0x1f')][_0x9da7('0x25')],function(_0x4eacef){return{'model':db[_0x4eacef[_0x9da7('0x26')]],'as':_0x4eacef['as'],'attributes':_0x4eacef[_0x9da7('0x22')],'include':_0x4eacef[_0x9da7('0x25')]?_[_0x9da7('0x24')](_0x4eacef[_0x9da7('0x25')],function(_0x5a7ca3){return{'model':db[_0x5a7ca3['model']],'as':_0x5a7ca3['as'],'attributes':_0x5a7ca3['attributes'],'include':_0x5a7ca3[_0x9da7('0x25')]?_[_0x9da7('0x24')](_0x5a7ca3[_0x9da7('0x25')],function(_0x78f36){return{'model':db[_0x78f36[_0x9da7('0x26')]],'as':_0x78f36['as'],'attributes':_0x78f36[_0x9da7('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9da7('0x27')](function(_0x4b39de){logger['info'](_0x9da7('0x28'),_0x2502e7);logger[_0x9da7('0x16')](_0x9da7('0x28'),_0x2502e7,JSON[_0x9da7('0x18')](_0x4b39de));_0x425fb5(_0x4b39de);})['catch'](function(_0x1df677){logger[_0x9da7('0x19')](_0x9da7('0x28'),_0x1df677[_0x9da7('0x1a')],_0x2502e7);_0x168d4d(_0x466a08['error'](0x1f4,_0x1df677[_0x9da7('0x1a')]));});});};exports['ShowMailQueue']=function(_0x29ccf7){var _0x20ea0a=this;return new Promise(function(_0xb5c9bc,_0x33f8dc){return db[_0x9da7('0x1d')][_0x9da7('0x29')]({'raw':_0x29ccf7[_0x9da7('0x1f')]?_0x29ccf7[_0x9da7('0x1f')][_0x9da7('0x20')]===undefined?!![]:![]:!![],'where':_0x29ccf7['options']?_0x29ccf7[_0x9da7('0x1f')][_0x9da7('0x21')]||null:null,'attributes':_0x29ccf7['options']?_0x29ccf7['options'][_0x9da7('0x22')]||null:null,'include':_0x29ccf7['options']?_0x29ccf7[_0x9da7('0x1f')]['include']?_[_0x9da7('0x24')](_0x29ccf7['options']['include'],function(_0x1a98b1){return{'model':db[_0x1a98b1[_0x9da7('0x26')]],'as':_0x1a98b1['as'],'attributes':_0x1a98b1[_0x9da7('0x22')],'include':_0x1a98b1[_0x9da7('0x25')]?_['map'](_0x1a98b1['include'],function(_0x597597){return{'model':db[_0x597597[_0x9da7('0x26')]],'as':_0x597597['as'],'attributes':_0x597597[_0x9da7('0x22')],'include':_0x597597[_0x9da7('0x25')]?_['map'](_0x597597['include'],function(_0x352929){return{'model':db[_0x352929[_0x9da7('0x26')]],'as':_0x352929['as'],'attributes':_0x352929[_0x9da7('0x22')]};}):[]};}):[]};}):[]:[]})[_0x9da7('0x27')](function(_0x1ae417){logger[_0x9da7('0x13')]('ShowMailQueue',_0x29ccf7);logger[_0x9da7('0x16')](_0x9da7('0x2a'),_0x29ccf7,JSON[_0x9da7('0x18')](_0x1ae417));_0xb5c9bc(_0x1ae417);})['catch'](function(_0x3e5543){logger['error'](_0x9da7('0x2a'),_0x3e5543[_0x9da7('0x1a')],_0x29ccf7);_0x33f8dc(_0x20ea0a['error'](0x1f4,_0x3e5543[_0x9da7('0x1a')]));});});};
\ No newline at end of file
+var _0xff6e=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./mailQueue.socket','register','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','MailQueue','findAll','options','raw','where','attributes','limit','include','model','map','GetMailQueue','find','ShowMailQueue','lodash'];(function(_0x4f3cd1,_0x4b666e){var _0x4f304d=function(_0x5691ad){while(--_0x5691ad){_0x4f3cd1['push'](_0x4f3cd1['shift']());}};_0x4f304d(++_0x4b666e);}(_0xff6e,0x179));var _0xeff6=function(_0x2df724,_0x411382){_0x2df724=_0x2df724-0x0;var _0x1b2504=_0xff6e[_0x2df724];return _0x1b2504;};'use strict';var _=require(_0xeff6('0x0'));var util=require(_0xeff6('0x1'));var moment=require(_0xeff6('0x2'));var BPromise=require(_0xeff6('0x3'));var rs=require(_0xeff6('0x4'));var fs=require('fs');var Redis=require(_0xeff6('0x5'));var db=require(_0xeff6('0x6'))['db'];var utils=require(_0xeff6('0x7'));var logger=require(_0xeff6('0x8'))(_0xeff6('0x9'));var config=require(_0xeff6('0xa'));var jayson=require(_0xeff6('0xb'));var client=jayson['client'][_0xeff6('0xc')]({'port':0x232a});config[_0xeff6('0xd')]=_['defaults'](config[_0xeff6('0xd')],{'host':_0xeff6('0xe'),'port':0x18eb});var socket=require(_0xeff6('0xf'))(new Redis(config['redis']));require(_0xeff6('0x10'))[_0xeff6('0x11')](socket);function respondWithRpcPromise(_0x4d5e2d,_0x44ec5b,_0x3c1da6){return new BPromise(function(_0x5441ba,_0x403c2c){return client['request'](_0x4d5e2d,_0x3c1da6)[_0xeff6('0x12')](function(_0x1de259){logger[_0xeff6('0x13')](_0xeff6('0x14'),_0x44ec5b,_0xeff6('0x15'));logger[_0xeff6('0x16')](_0xeff6('0x17'),_0x44ec5b,_0xeff6('0x15'),JSON[_0xeff6('0x18')](_0x1de259));if(_0x1de259['error']){if(_0x1de259[_0xeff6('0x19')]['code']===0x1f4){logger['error'](_0xeff6('0x14'),_0x44ec5b,_0x1de259['error']['message']);return _0x403c2c(_0x1de259[_0xeff6('0x19')][_0xeff6('0x1a')]);}logger[_0xeff6('0x19')]('MailQueue,\x20%s,\x20%s',_0x44ec5b,_0x1de259[_0xeff6('0x19')][_0xeff6('0x1a')]);return _0x5441ba(_0x1de259['error'][_0xeff6('0x1a')]);}else{logger[_0xeff6('0x13')]('MailQueue,\x20%s,\x20%s',_0x44ec5b,_0xeff6('0x15'));_0x5441ba(_0x1de259[_0xeff6('0x1b')][_0xeff6('0x1a')]);}})[_0xeff6('0x1c')](function(_0x1e791){logger[_0xeff6('0x19')](_0xeff6('0x14'),_0x44ec5b,_0x1e791);_0x403c2c(_0x1e791);});});}exports['GetMailQueue']=function(_0xa7d1a5){var _0x3c78c4=this;return new Promise(function(_0x271ef8,_0x4e4c1c){return db[_0xeff6('0x1d')][_0xeff6('0x1e')]({'raw':_0xa7d1a5[_0xeff6('0x1f')]?_0xa7d1a5[_0xeff6('0x1f')][_0xeff6('0x20')]===undefined?!![]:![]:!![],'where':_0xa7d1a5['options']?_0xa7d1a5[_0xeff6('0x1f')][_0xeff6('0x21')]||null:null,'attributes':_0xa7d1a5[_0xeff6('0x1f')]?_0xa7d1a5['options'][_0xeff6('0x22')]||null:null,'limit':_0xa7d1a5[_0xeff6('0x1f')]?_0xa7d1a5[_0xeff6('0x1f')][_0xeff6('0x23')]||null:null,'include':_0xa7d1a5[_0xeff6('0x1f')]?_0xa7d1a5[_0xeff6('0x1f')][_0xeff6('0x24')]?_['map'](_0xa7d1a5['options'][_0xeff6('0x24')],function(_0x1261ca){return{'model':db[_0x1261ca[_0xeff6('0x25')]],'as':_0x1261ca['as'],'attributes':_0x1261ca['attributes'],'include':_0x1261ca['include']?_[_0xeff6('0x26')](_0x1261ca[_0xeff6('0x24')],function(_0x467505){return{'model':db[_0x467505[_0xeff6('0x25')]],'as':_0x467505['as'],'attributes':_0x467505[_0xeff6('0x22')],'include':_0x467505['include']?_[_0xeff6('0x26')](_0x467505[_0xeff6('0x24')],function(_0x1ebf48){return{'model':db[_0x1ebf48[_0xeff6('0x25')]],'as':_0x1ebf48['as'],'attributes':_0x1ebf48['attributes']};}):[]};}):[]};}):[]:[]})[_0xeff6('0x12')](function(_0x2cf887){logger[_0xeff6('0x13')](_0xeff6('0x27'),_0xa7d1a5);logger[_0xeff6('0x16')](_0xeff6('0x27'),_0xa7d1a5,JSON[_0xeff6('0x18')](_0x2cf887));_0x271ef8(_0x2cf887);})['catch'](function(_0x458a7b){logger[_0xeff6('0x19')](_0xeff6('0x27'),_0x458a7b[_0xeff6('0x1a')],_0xa7d1a5);_0x4e4c1c(_0x3c78c4[_0xeff6('0x19')](0x1f4,_0x458a7b[_0xeff6('0x1a')]));});});};exports['ShowMailQueue']=function(_0x505e36){var _0x43a9e2=this;return new Promise(function(_0x23f4cf,_0xec149c){return db[_0xeff6('0x1d')][_0xeff6('0x28')]({'raw':_0x505e36[_0xeff6('0x1f')]?_0x505e36['options'][_0xeff6('0x20')]===undefined?!![]:![]:!![],'where':_0x505e36['options']?_0x505e36[_0xeff6('0x1f')][_0xeff6('0x21')]||null:null,'attributes':_0x505e36[_0xeff6('0x1f')]?_0x505e36[_0xeff6('0x1f')][_0xeff6('0x22')]||null:null,'include':_0x505e36[_0xeff6('0x1f')]?_0x505e36[_0xeff6('0x1f')][_0xeff6('0x24')]?_[_0xeff6('0x26')](_0x505e36[_0xeff6('0x1f')][_0xeff6('0x24')],function(_0x33389c){return{'model':db[_0x33389c[_0xeff6('0x25')]],'as':_0x33389c['as'],'attributes':_0x33389c[_0xeff6('0x22')],'include':_0x33389c[_0xeff6('0x24')]?_['map'](_0x33389c[_0xeff6('0x24')],function(_0x1a588f){return{'model':db[_0x1a588f[_0xeff6('0x25')]],'as':_0x1a588f['as'],'attributes':_0x1a588f[_0xeff6('0x22')],'include':_0x1a588f['include']?_[_0xeff6('0x26')](_0x1a588f['include'],function(_0x3e5428){return{'model':db[_0x3e5428[_0xeff6('0x25')]],'as':_0x3e5428['as'],'attributes':_0x3e5428[_0xeff6('0x22')]};}):[]};}):[]};}):[]:[]})[_0xeff6('0x12')](function(_0x25f50c){logger[_0xeff6('0x13')]('ShowMailQueue',_0x505e36);logger['debug'](_0xeff6('0x29'),_0x505e36,JSON[_0xeff6('0x18')](_0x25f50c));_0x23f4cf(_0x25f50c);})[_0xeff6('0x1c')](function(_0x5758f1){logger[_0xeff6('0x19')]('ShowMailQueue',_0x5758f1[_0xeff6('0x1a')],_0x505e36);_0xec149c(_0x43a9e2[_0xeff6('0x19')](0x1f4,_0x5758f1['message']));});});};
\ No newline at end of file
index a32da40..23076b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb846=['mailQueue:','./mailQueue.events','save','remove','update','emit','removeListener','register','length'];(function(_0x419450,_0x1c50e4){var _0x26584f=function(_0x546559){while(--_0x546559){_0x419450['push'](_0x419450['shift']());}};_0x26584f(++_0x1c50e4);}(_0xb846,0x145));var _0x6b84=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xb846[_0x1beef3];return _0x5af964;};'use strict';var MailQueueEvents=require(_0x6b84('0x0'));var events=[_0x6b84('0x1'),_0x6b84('0x2'),_0x6b84('0x3')];function createListener(_0x4e4a7f,_0x56696f){return function(_0x4abc20){_0x56696f[_0x6b84('0x4')](_0x4e4a7f,_0x4abc20);};}function removeListener(_0x3a6ddd,_0x14f110){return function(){MailQueueEvents[_0x6b84('0x5')](_0x3a6ddd,_0x14f110);};}exports[_0x6b84('0x6')]=function(_0x5ef7c1){for(var _0x42609a=0x0,_0x10509e=events[_0x6b84('0x7')];_0x42609a<_0x10509e;_0x42609a++){var _0x4d158f=events[_0x42609a];var _0x1a488a=createListener(_0x6b84('0x8')+_0x4d158f,_0x5ef7c1);MailQueueEvents['on'](_0x4d158f,_0x1a488a);}};
\ No newline at end of file
+var _0x722d=['emit','removeListener','register','mailQueue:','./mailQueue.events','save','update'];(function(_0x4e16e9,_0x1ce58e){var _0x4f9971=function(_0x2b1810){while(--_0x2b1810){_0x4e16e9['push'](_0x4e16e9['shift']());}};_0x4f9971(++_0x1ce58e);}(_0x722d,0x17e));var _0xd722=function(_0x5303a2,_0x49716b){_0x5303a2=_0x5303a2-0x0;var _0x448ac5=_0x722d[_0x5303a2];return _0x448ac5;};'use strict';var MailQueueEvents=require(_0xd722('0x0'));var events=[_0xd722('0x1'),'remove',_0xd722('0x2')];function createListener(_0x186a01,_0x8c9a9f){return function(_0x3dbdbc){_0x8c9a9f[_0xd722('0x3')](_0x186a01,_0x3dbdbc);};}function removeListener(_0x109417,_0x2417ba){return function(){MailQueueEvents[_0xd722('0x4')](_0x109417,_0x2417ba);};}exports[_0xd722('0x5')]=function(_0x588587){for(var _0x188813=0x0,_0x283aef=events['length'];_0x188813<_0x283aef;_0x188813++){var _0x25b63a=events[_0x188813];var _0x4bd156=createListener(_0xd722('0x6')+_0x25b63a,_0x588587);MailQueueEvents['on'](_0x25b63a,_0x4bd156);}};
\ No newline at end of file
index 415e9f5..41f53e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6725=['/:id','post','create','put','update','destroy','exports','util','path','express','Router','../../components/interaction/service','./mailQueueReport.controller','isAuthenticated','index','get'];(function(_0x2a55b1,_0x1bde59){var _0x422256=function(_0x551bfd){while(--_0x551bfd){_0x2a55b1['push'](_0x2a55b1['shift']());}};_0x422256(++_0x1bde59);}(_0x6725,0x67));var _0x5672=function(_0xf4dc7e,_0x3a9746){_0xf4dc7e=_0xf4dc7e-0x0;var _0x330d3e=_0x6725[_0xf4dc7e];return _0x330d3e;};'use strict';var multer=require('multer');var util=require(_0x5672('0x0'));var path=require(_0x5672('0x1'));var timeout=require('connect-timeout');var express=require(_0x5672('0x2'));var router=express[_0x5672('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5672('0x4'));var config=require('../../config/environment');var controller=require(_0x5672('0x5'));router['get']('/',auth[_0x5672('0x6')](),controller[_0x5672('0x7')]);router[_0x5672('0x8')]('/describe',auth[_0x5672('0x6')](),controller['describe']);router[_0x5672('0x8')](_0x5672('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x5672('0xa')]('/',auth[_0x5672('0x6')](),controller[_0x5672('0xb')]);router[_0x5672('0xc')](_0x5672('0x9'),auth[_0x5672('0x6')](),controller[_0x5672('0xd')]);router['delete'](_0x5672('0x9'),auth[_0x5672('0x6')](),controller[_0x5672('0xe')]);module[_0x5672('0xf')]=router;
\ No newline at end of file
+var _0x2664=['get','post','isAuthenticated','create','put','/:id','update','destroy','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','/describe','describe'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x2664,0x13b));var _0x4266=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x2664[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x4266('0x0'));var util=require(_0x4266('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4266('0x2'));var router=express[_0x4266('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x4266('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4266('0x5'));var controller=require('./mailQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4266('0x6'),auth['isAuthenticated'](),controller[_0x4266('0x7')]);router[_0x4266('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x4266('0x9')]('/',auth[_0x4266('0xa')](),controller[_0x4266('0xb')]);router[_0x4266('0xc')](_0x4266('0xd'),auth[_0x4266('0xa')](),controller[_0x4266('0xe')]);router['delete'](_0x4266('0xd'),auth[_0x4266('0xa')](),controller[_0x4266('0xf')]);module[_0x4266('0x10')]=router;
\ No newline at end of file
index 7fa979d..dbb03ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0698=['moment','sequelize','STRING','DATE'];(function(_0x52c408,_0x35f852){var _0x31ad08=function(_0x42da3f){while(--_0x42da3f){_0x52c408['push'](_0x52c408['shift']());}};_0x31ad08(++_0x35f852);}(_0x0698,0xc4));var _0x8069=function(_0x46dd35,_0x20fb64){_0x46dd35=_0x46dd35-0x0;var _0x3a3708=_0x0698[_0x46dd35];return _0x3a3708;};'use strict';var moment=require(_0x8069('0x0'));var Sequelize=require(_0x8069('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x8069('0x2')]},'joinAt':{'type':Sequelize[_0x8069('0x3')]},'leaveAt':{'type':Sequelize[_0x8069('0x3')]},'acceptAt':{'type':Sequelize[_0x8069('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xd17f=['moment','sequelize','exports','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd17f,0x10e));var _0xfd17=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xd17f[_0xbca1b1];return _0x4e1686;};'use strict';var moment=require(_0xfd17('0x0'));var Sequelize=require(_0xfd17('0x1'));module[_0xfd17('0x2')]={'uniqueid':{'type':Sequelize[_0xfd17('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xfd17('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xfd17('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xfd17('0x3')]}};
\ No newline at end of file
index e872cf5..f1ed34f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x160f=['sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','rawAttributes','type','key','map','intersection','model','query','attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','MailQueueReport','include','findAll','rows','show','params','keys','fields','includeAll','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x1a4a8a,_0x27ce9e){var _0x4d8f00=function(_0x5a05b7){while(--_0x5a05b7){_0x1a4a8a['push'](_0x1a4a8a['shift']());}};_0x4d8f00(++_0x27ce9e);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf160('0x0'));var rimraf=require(_0xf160('0x1'));var zipdir=require(_0xf160('0x2'));var jsonpatch=require(_0xf160('0x3'));var rp=require('request-promise');var moment=require(_0xf160('0x4'));var BPromise=require(_0xf160('0x5'));var Mustache=require(_0xf160('0x6'));var util=require(_0xf160('0x7'));var path=require(_0xf160('0x8'));var sox=require(_0xf160('0x9'));var csv=require('to-csv');var ejs=require(_0xf160('0xa'));var fs=require('fs');var fs_extra=require(_0xf160('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xf160('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf160('0xd'));var Papa=require(_0xf160('0xe'));var Redis=require(_0xf160('0xf'));var authService=require(_0xf160('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf160('0x11'));var logger=require(_0xf160('0x12'))(_0xf160('0x13'));var utils=require('../../config/utils');var config=require(_0xf160('0x14'));var licenseUtil=require(_0xf160('0x15'));var db=require(_0xf160('0x16'))['db'];function respondWithStatusCode(_0x3b09ea,_0x2d8854){_0x2d8854=_0x2d8854||0xcc;return function(_0x523af5){if(_0x523af5){return _0x3b09ea[_0xf160('0x17')](_0x2d8854);}return _0x3b09ea['status'](_0x2d8854)[_0xf160('0x18')]();};}function respondWithResult(_0x26951a,_0x12549a){_0x12549a=_0x12549a||0xc8;return function(_0x2bb6c7){if(_0x2bb6c7){return _0x26951a[_0xf160('0x19')](_0x12549a)[_0xf160('0x1a')](_0x2bb6c7);}};}function respondWithFilteredResult(_0x2643ba,_0x172337){return function(_0x1396ba){if(_0x1396ba){var _0x59ac02=typeof _0x172337[_0xf160('0x1b')]===_0xf160('0x1c')&&typeof _0x172337[_0xf160('0x1d')]===_0xf160('0x1c');var _0x51824b=_0x1396ba[_0xf160('0x1e')];var _0x4b8185=_0x59ac02?0x0:_0x172337[_0xf160('0x1b')];var _0x1cf6ba=_0x59ac02?_0x1396ba[_0xf160('0x1e')]:_0x172337[_0xf160('0x1b')]+_0x172337[_0xf160('0x1d')];var _0x205afa;if(_0x1cf6ba>=_0x51824b){_0x1cf6ba=_0x51824b;_0x205afa=0xc8;}else{_0x205afa=0xce;}_0x2643ba[_0xf160('0x19')](_0x205afa);return _0x2643ba[_0xf160('0x1f')](_0xf160('0x20'),_0x4b8185+'-'+_0x1cf6ba+'/'+_0x51824b)['json'](_0x1396ba);}return null;};}function patchUpdates(_0x40ccf0){return function(_0xa20d5a){try{jsonpatch[_0xf160('0x21')](_0xa20d5a,_0x40ccf0,!![]);}catch(_0x5ad173){return BPromise[_0xf160('0x22')](_0x5ad173);}return _0xa20d5a[_0xf160('0x23')]();};}function saveUpdates(_0x454e63,_0x36d0cb){return function(_0x2e03c8){if(_0x2e03c8){return _0x2e03c8[_0xf160('0x24')](_0x454e63)[_0xf160('0x25')](function(_0x5a72d1){return _0x5a72d1;});}return null;};}function removeEntity(_0x3d1f6c,_0x28bf27){return function(_0x305f6a){if(_0x305f6a){return _0x305f6a[_0xf160('0x26')]()['then'](function(){_0x3d1f6c[_0xf160('0x19')](0xcc)[_0xf160('0x18')]();});}};}function handleEntityNotFound(_0x4a8003,_0x487c0c){return function(_0x168a09){if(!_0x168a09){_0x4a8003[_0xf160('0x17')](0x194);}return _0x168a09;};}function handleError(_0x39c0e3,_0x4c0c51){_0x4c0c51=_0x4c0c51||0x1f4;return function(_0xcfa9bd){logger[_0xf160('0x27')](_0xcfa9bd[_0xf160('0x28')]);if(_0xcfa9bd[_0xf160('0x29')]){delete _0xcfa9bd[_0xf160('0x29')];}_0x39c0e3[_0xf160('0x19')](_0x4c0c51)['send'](_0xcfa9bd);};}exports['index']=function(_0x48145e,_0x26e7b9){var _0x16a5fa={},_0xcaab39={},_0x26e06b={'count':0x0,'rows':[]};var _0x399cce=_['map'](db['MailQueueReport'][_0xf160('0x2a')],function(_0x558596){return{'name':_0x558596['fieldName'],'type':_0x558596[_0xf160('0x2b')][_0xf160('0x2c')]};});_0xcaab39['model']=_[_0xf160('0x2d')](_0x399cce,_0xf160('0x29'));_0xcaab39['query']=_['keys'](_0x48145e['query']);_0xcaab39['filters']=_[_0xf160('0x2e')](_0xcaab39[_0xf160('0x2f')],_0xcaab39[_0xf160('0x30')]);_0x16a5fa[_0xf160('0x31')]=_[_0xf160('0x2e')](_0xcaab39[_0xf160('0x2f')],qs['fields'](_0x48145e['query']['fields']));_0x16a5fa[_0xf160('0x31')]=_0x16a5fa['attributes']['length']?_0x16a5fa[_0xf160('0x31')]:_0xcaab39[_0xf160('0x2f')];if(!_0x48145e['query'][_0xf160('0x32')](_0xf160('0x33'))){_0x16a5fa[_0xf160('0x1d')]=qs[_0xf160('0x1d')](_0x48145e[_0xf160('0x30')]['limit']);_0x16a5fa[_0xf160('0x1b')]=qs[_0xf160('0x1b')](_0x48145e[_0xf160('0x30')]['offset']);}_0x16a5fa[_0xf160('0x34')]=qs[_0xf160('0x35')](_0x48145e[_0xf160('0x30')][_0xf160('0x35')]);_0x16a5fa[_0xf160('0x36')]=qs[_0xf160('0x37')](_['pick'](_0x48145e['query'],_0xcaab39[_0xf160('0x37')]),_0x399cce);if(_0x48145e[_0xf160('0x30')][_0xf160('0x38')]){_0x16a5fa[_0xf160('0x36')]=_[_0xf160('0x39')](_0x16a5fa[_0xf160('0x36')],{'$or':_[_0xf160('0x2d')](_0x399cce,function(_0x38a33e){if(_0x38a33e[_0xf160('0x2b')]!==_0xf160('0x3a')){var _0x1e65d4={};_0x1e65d4[_0x38a33e[_0xf160('0x29')]]={'$like':'%'+_0x48145e[_0xf160('0x30')][_0xf160('0x38')]+'%'};return _0x1e65d4;}})});}_0x16a5fa=_[_0xf160('0x39')]({},_0x16a5fa,_0x48145e[_0xf160('0x3b')]);var _0x161f06={'where':_0x16a5fa[_0xf160('0x36')]};return db[_0xf160('0x3c')][_0xf160('0x1e')](_0x161f06)[_0xf160('0x25')](function(_0x8fe1de){_0x26e06b[_0xf160('0x1e')]=_0x8fe1de;if(_0x48145e[_0xf160('0x30')]['includeAll']){_0x16a5fa[_0xf160('0x3d')]=[{'all':!![]}];}return db[_0xf160('0x3c')][_0xf160('0x3e')](_0x16a5fa);})[_0xf160('0x25')](function(_0x3d273d){_0x26e06b[_0xf160('0x3f')]=_0x3d273d;return _0x26e06b;})[_0xf160('0x25')](respondWithFilteredResult(_0x26e7b9,_0x16a5fa))['catch'](handleError(_0x26e7b9,null));};exports[_0xf160('0x40')]=function(_0x5be7ce,_0xa80a5f){var _0x477ded={'raw':!![],'where':{'id':_0x5be7ce[_0xf160('0x41')]['id']}},_0x530fc5={};_0x530fc5[_0xf160('0x2f')]=_[_0xf160('0x42')](db[_0xf160('0x3c')][_0xf160('0x2a')]);_0x530fc5[_0xf160('0x30')]=_[_0xf160('0x42')](_0x5be7ce['query']);_0x530fc5[_0xf160('0x37')]=_[_0xf160('0x2e')](_0x530fc5[_0xf160('0x2f')],_0x530fc5[_0xf160('0x30')]);_0x477ded[_0xf160('0x31')]=_[_0xf160('0x2e')](_0x530fc5[_0xf160('0x2f')],qs[_0xf160('0x43')](_0x5be7ce[_0xf160('0x30')][_0xf160('0x43')]));_0x477ded[_0xf160('0x31')]=_0x477ded['attributes']['length']?_0x477ded[_0xf160('0x31')]:_0x530fc5[_0xf160('0x2f')];if(_0x5be7ce[_0xf160('0x30')][_0xf160('0x44')]){_0x477ded[_0xf160('0x3d')]=[{'all':!![]}];}_0x477ded=_[_0xf160('0x39')]({},_0x477ded,_0x5be7ce['options']);return db[_0xf160('0x3c')]['find'](_0x477ded)['then'](handleEntityNotFound(_0xa80a5f,null))[_0xf160('0x25')](respondWithResult(_0xa80a5f,null))[_0xf160('0x45')](handleError(_0xa80a5f,null));};exports['create']=function(_0x5ea49d,_0x2f1648){return db[_0xf160('0x3c')][_0xf160('0x46')](_0x5ea49d[_0xf160('0x47')],{})['then'](respondWithResult(_0x2f1648,0xc9))['catch'](handleError(_0x2f1648,null));};exports['update']=function(_0x50a97d,_0x406494){if(_0x50a97d['body']['id']){delete _0x50a97d[_0xf160('0x47')]['id'];}return db[_0xf160('0x3c')][_0xf160('0x48')]({'where':{'id':_0x50a97d[_0xf160('0x41')]['id']}})['then'](handleEntityNotFound(_0x406494,null))[_0xf160('0x25')](saveUpdates(_0x50a97d[_0xf160('0x47')],null))[_0xf160('0x25')](respondWithResult(_0x406494,null))['catch'](handleError(_0x406494,null));};exports[_0xf160('0x26')]=function(_0x40f855,_0x87ad7e){return db['MailQueueReport'][_0xf160('0x48')]({'where':{'id':_0x40f855[_0xf160('0x41')]['id']}})[_0xf160('0x25')](handleEntityNotFound(_0x87ad7e,null))[_0xf160('0x25')](removeEntity(_0x87ad7e,null))[_0xf160('0x45')](handleError(_0x87ad7e,null));};exports['describe']=function(_0x4c90ab,_0x3c8765){return db['MailQueueReport'][_0xf160('0x49')]()[_0xf160('0x25')](respondWithResult(_0x3c8765,null))['catch'](handleError(_0x3c8765,null));};
\ No newline at end of file
+var _0x4325=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','MailQueueReport','findAll','catch','show','params','include','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x4325,0x1da));var _0x5432=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x4325[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require(_0x5432('0x0'));var rimraf=require(_0x5432('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5432('0x2'));var rp=require(_0x5432('0x3'));var moment=require(_0x5432('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5432('0x5'));var path=require(_0x5432('0x6'));var sox=require(_0x5432('0x7'));var csv=require('to-csv');var ejs=require(_0x5432('0x8'));var fs=require('fs');var fs_extra=require(_0x5432('0x9'));var _=require('lodash');var squel=require(_0x5432('0xa'));var crypto=require('crypto');var jsforce=require(_0x5432('0xb'));var deskjs=require(_0x5432('0xc'));var toCsv=require(_0x5432('0xd'));var querystring=require(_0x5432('0xe'));var Papa=require(_0x5432('0xf'));var Redis=require('ioredis');var authService=require(_0x5432('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5432('0x11'));var hardwareService=require(_0x5432('0x12'));var logger=require(_0x5432('0x13'))(_0x5432('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5432('0x15'));var db=require(_0x5432('0x16'))['db'];function respondWithStatusCode(_0x5366a0,_0x10a289){_0x10a289=_0x10a289||0xcc;return function(_0x111c54){if(_0x111c54){return _0x5366a0[_0x5432('0x17')](_0x10a289);}return _0x5366a0[_0x5432('0x18')](_0x10a289)[_0x5432('0x19')]();};}function respondWithResult(_0x1a084d,_0x54f41a){_0x54f41a=_0x54f41a||0xc8;return function(_0x5617ce){if(_0x5617ce){return _0x1a084d[_0x5432('0x18')](_0x54f41a)[_0x5432('0x1a')](_0x5617ce);}};}function respondWithFilteredResult(_0x3859d1,_0x364152){return function(_0x9d2023){if(_0x9d2023){var _0x11db3c=typeof _0x364152['offset']===_0x5432('0x1b')&&typeof _0x364152['limit']===_0x5432('0x1b');var _0x3de07a=_0x9d2023[_0x5432('0x1c')];var _0x32fe60=_0x11db3c?0x0:_0x364152[_0x5432('0x1d')];var _0x5f011f=_0x11db3c?_0x9d2023[_0x5432('0x1c')]:_0x364152[_0x5432('0x1d')]+_0x364152[_0x5432('0x1e')];var _0x2bfe04;if(_0x5f011f>=_0x3de07a){_0x5f011f=_0x3de07a;_0x2bfe04=0xc8;}else{_0x2bfe04=0xce;}_0x3859d1[_0x5432('0x18')](_0x2bfe04);return _0x3859d1[_0x5432('0x1f')](_0x5432('0x20'),_0x32fe60+'-'+_0x5f011f+'/'+_0x3de07a)['json'](_0x9d2023);}return null;};}function patchUpdates(_0x66911a){return function(_0x29cde7){try{jsonpatch[_0x5432('0x21')](_0x29cde7,_0x66911a,!![]);}catch(_0xa6c864){return BPromise[_0x5432('0x22')](_0xa6c864);}return _0x29cde7['save']();};}function saveUpdates(_0x5901e2,_0x4d09cd){return function(_0x61827e){if(_0x61827e){return _0x61827e[_0x5432('0x23')](_0x5901e2)[_0x5432('0x24')](function(_0x1f4870){return _0x1f4870;});}return null;};}function removeEntity(_0x4af9f6,_0x4af5f4){return function(_0x3e0b66){if(_0x3e0b66){return _0x3e0b66[_0x5432('0x25')]()['then'](function(){_0x4af9f6[_0x5432('0x18')](0xcc)[_0x5432('0x19')]();});}};}function handleEntityNotFound(_0x637582,_0x4b6ea5){return function(_0xd9928a){if(!_0xd9928a){_0x637582[_0x5432('0x17')](0x194);}return _0xd9928a;};}function handleError(_0xe7eda2,_0x520da1){_0x520da1=_0x520da1||0x1f4;return function(_0x4ab09d){logger[_0x5432('0x26')](_0x4ab09d[_0x5432('0x27')]);if(_0x4ab09d['name']){delete _0x4ab09d[_0x5432('0x28')];}_0xe7eda2[_0x5432('0x18')](_0x520da1)[_0x5432('0x29')](_0x4ab09d);};}exports['index']=function(_0x29dc15,_0x5be867){var _0x4821be={},_0x6fc7f5={},_0x4a52ba={'count':0x0,'rows':[]};var _0x428141=_['map'](db['MailQueueReport'][_0x5432('0x2a')],function(_0x21735e){return{'name':_0x21735e[_0x5432('0x2b')],'type':_0x21735e['type'][_0x5432('0x2c')]};});_0x6fc7f5[_0x5432('0x2d')]=_[_0x5432('0x2e')](_0x428141,_0x5432('0x28'));_0x6fc7f5[_0x5432('0x2f')]=_[_0x5432('0x30')](_0x29dc15[_0x5432('0x2f')]);_0x6fc7f5[_0x5432('0x31')]=_[_0x5432('0x32')](_0x6fc7f5['model'],_0x6fc7f5['query']);_0x4821be[_0x5432('0x33')]=_[_0x5432('0x32')](_0x6fc7f5[_0x5432('0x2d')],qs[_0x5432('0x34')](_0x29dc15[_0x5432('0x2f')]['fields']));_0x4821be[_0x5432('0x33')]=_0x4821be['attributes'][_0x5432('0x35')]?_0x4821be[_0x5432('0x33')]:_0x6fc7f5[_0x5432('0x2d')];if(!_0x29dc15[_0x5432('0x2f')][_0x5432('0x36')](_0x5432('0x37'))){_0x4821be['limit']=qs[_0x5432('0x1e')](_0x29dc15[_0x5432('0x2f')][_0x5432('0x1e')]);_0x4821be[_0x5432('0x1d')]=qs['offset'](_0x29dc15[_0x5432('0x2f')][_0x5432('0x1d')]);}_0x4821be[_0x5432('0x38')]=qs[_0x5432('0x39')](_0x29dc15[_0x5432('0x2f')][_0x5432('0x39')]);_0x4821be[_0x5432('0x3a')]=qs[_0x5432('0x31')](_[_0x5432('0x3b')](_0x29dc15[_0x5432('0x2f')],_0x6fc7f5[_0x5432('0x31')]),_0x428141);if(_0x29dc15[_0x5432('0x2f')][_0x5432('0x3c')]){_0x4821be[_0x5432('0x3a')]=_['merge'](_0x4821be[_0x5432('0x3a')],{'$or':_['map'](_0x428141,function(_0x6f5006){if(_0x6f5006[_0x5432('0x3d')]!==_0x5432('0x3e')){var _0x1a5561={};_0x1a5561[_0x6f5006['name']]={'$like':'%'+_0x29dc15['query']['filter']+'%'};return _0x1a5561;}})});}_0x4821be=_[_0x5432('0x3f')]({},_0x4821be,_0x29dc15[_0x5432('0x40')]);var _0x139d0a={'where':_0x4821be[_0x5432('0x3a')]};return db['MailQueueReport'][_0x5432('0x1c')](_0x139d0a)[_0x5432('0x24')](function(_0x3cd343){_0x4a52ba['count']=_0x3cd343;if(_0x29dc15[_0x5432('0x2f')][_0x5432('0x41')]){_0x4821be['include']=[{'all':!![]}];}return db[_0x5432('0x42')][_0x5432('0x43')](_0x4821be);})['then'](function(_0x23f8f4){_0x4a52ba['rows']=_0x23f8f4;return _0x4a52ba;})[_0x5432('0x24')](respondWithFilteredResult(_0x5be867,_0x4821be))[_0x5432('0x44')](handleError(_0x5be867,null));};exports[_0x5432('0x45')]=function(_0x11c7f2,_0x5cf59a){var _0x9cfb8b={'raw':!![],'where':{'id':_0x11c7f2[_0x5432('0x46')]['id']}},_0x4b93b4={};_0x4b93b4[_0x5432('0x2d')]=_[_0x5432('0x30')](db[_0x5432('0x42')][_0x5432('0x2a')]);_0x4b93b4[_0x5432('0x2f')]=_[_0x5432('0x30')](_0x11c7f2['query']);_0x4b93b4[_0x5432('0x31')]=_[_0x5432('0x32')](_0x4b93b4[_0x5432('0x2d')],_0x4b93b4[_0x5432('0x2f')]);_0x9cfb8b[_0x5432('0x33')]=_[_0x5432('0x32')](_0x4b93b4[_0x5432('0x2d')],qs['fields'](_0x11c7f2[_0x5432('0x2f')][_0x5432('0x34')]));_0x9cfb8b[_0x5432('0x33')]=_0x9cfb8b[_0x5432('0x33')][_0x5432('0x35')]?_0x9cfb8b['attributes']:_0x4b93b4[_0x5432('0x2d')];if(_0x11c7f2['query'][_0x5432('0x41')]){_0x9cfb8b[_0x5432('0x47')]=[{'all':!![]}];}_0x9cfb8b=_['merge']({},_0x9cfb8b,_0x11c7f2[_0x5432('0x40')]);return db['MailQueueReport'][_0x5432('0x48')](_0x9cfb8b)[_0x5432('0x24')](handleEntityNotFound(_0x5cf59a,null))['then'](respondWithResult(_0x5cf59a,null))['catch'](handleError(_0x5cf59a,null));};exports[_0x5432('0x49')]=function(_0xa971bd,_0x3718be){return db[_0x5432('0x42')][_0x5432('0x49')](_0xa971bd[_0x5432('0x4a')],{})[_0x5432('0x24')](respondWithResult(_0x3718be,0xc9))['catch'](handleError(_0x3718be,null));};exports[_0x5432('0x23')]=function(_0x14763c,_0x429da8){if(_0x14763c['body']['id']){delete _0x14763c['body']['id'];}return db['MailQueueReport']['find']({'where':{'id':_0x14763c[_0x5432('0x46')]['id']}})[_0x5432('0x24')](handleEntityNotFound(_0x429da8,null))[_0x5432('0x24')](saveUpdates(_0x14763c[_0x5432('0x4a')],null))[_0x5432('0x24')](respondWithResult(_0x429da8,null))['catch'](handleError(_0x429da8,null));};exports[_0x5432('0x25')]=function(_0xce691b,_0x7937f9){return db['MailQueueReport'][_0x5432('0x48')]({'where':{'id':_0xce691b[_0x5432('0x46')]['id']}})[_0x5432('0x24')](handleEntityNotFound(_0x7937f9,null))[_0x5432('0x24')](removeEntity(_0x7937f9,null))[_0x5432('0x44')](handleError(_0x7937f9,null));};exports['describe']=function(_0xbcf523,_0x5bbedb){return db[_0x5432('0x42')]['describe']()[_0x5432('0x24')](respondWithResult(_0x5bbedb,null))[_0x5432('0x44')](handleError(_0x5bbedb,null));};
\ No newline at end of file
index 6fdd90d..f03c5d6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3a6=['path','rimraf','../../config/environment','exports','define','MailQueueReport','uniqueid','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x436851,_0x2aa809){var _0x1c2829=function(_0x29aea7){while(--_0x29aea7){_0x436851['push'](_0x436851['shift']());}};_0x1c2829(++_0x2aa809);}(_0xa3a6,0x10f));var _0x6a3a=function(_0x3a39eb,_0x2fae4b){_0x3a39eb=_0x3a39eb-0x0;var _0x58f629=_0xa3a6[_0x3a39eb];return _0x58f629;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6a3a('0x0'))(_0x6a3a('0x1'));var moment=require(_0x6a3a('0x2'));var BPromise=require(_0x6a3a('0x3'));var rp=require(_0x6a3a('0x4'));var fs=require('fs');var path=require(_0x6a3a('0x5'));var rimraf=require(_0x6a3a('0x6'));var config=require(_0x6a3a('0x7'));var attributes=require('./mailQueueReport.attributes');module[_0x6a3a('0x8')]=function(_0x4f75e4,_0x43dd6a){return _0x4f75e4[_0x6a3a('0x9')](_0x6a3a('0xa'),attributes,{'tableName':'report_mail_queue','paranoid':![],'indexes':[{'name':_0x6a3a('0xb'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x0f7b=['exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','moment','bluebird','request-promise','path','../../config/environment','./mailQueueReport.attributes'];(function(_0x48d3fa,_0x3808a6){var _0x4c4995=function(_0x3fab11){while(--_0x3fab11){_0x48d3fa['push'](_0x48d3fa['shift']());}};_0x4c4995(++_0x3808a6);}(_0x0f7b,0x1a5));var _0xb0f7=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0x0f7b[_0x5ddaac];return _0x2a9c58;};'use strict';var _=require(_0xb0f7('0x0'));var util=require(_0xb0f7('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb0f7('0x2'));var BPromise=require(_0xb0f7('0x3'));var rp=require(_0xb0f7('0x4'));var fs=require('fs');var path=require(_0xb0f7('0x5'));var rimraf=require('rimraf');var config=require(_0xb0f7('0x6'));var attributes=require(_0xb0f7('0x7'));module[_0xb0f7('0x8')]=function(_0x2e3d45,_0x535f37){return _0x2e3d45[_0xb0f7('0x9')](_0xb0f7('0xa'),attributes,{'tableName':_0xb0f7('0xb'),'paranoid':![],'indexes':[{'name':_0xb0f7('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
index 998a044..fedf4c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x56da85,_0x48cc39){var _0x166a0c=function(_0x1f9e19){while(--_0x1f9e19){_0x56da85['push'](_0x56da85['shift']());}};_0x166a0c(++_0x48cc39);}(_0x7a54,0x106));var _0x47a5=function(_0x4a5f3f,_0x330371){_0x4a5f3f=_0x4a5f3f-0x0;var _0x4508ee=_0x7a54[_0x4a5f3f];return _0x4508ee;};'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')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateMailQueueReport']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateMailQueueReport',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('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(_0x4aa932,_0x251c95){var _0x62b42c=function(_0x53913b){while(--_0x53913b){_0x4aa932['push'](_0x4aa932['shift']());}};_0x62b42c(++_0x251c95);}(_0xadb5,0xad));var _0x5adb=function(_0x43d25c,_0x5b71fd){_0x43d25c=_0x43d25c-0x0;var _0x3d2f7e=_0xadb5[_0x43d25c];return _0x3d2f7e;};'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 a2c578e..79e9f7f 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(_0x92d580,_0x4928fb){var _0x4ee344=function(_0x55aa0c){while(--_0x55aa0c){_0x92d580['push'](_0x92d580['shift']());}};_0x4ee344(++_0x4928fb);}(_0x9c44,0x178));var _0x49c4=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x9c44[_0x4f9b18];return _0x29f20c;};'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(_0x384a33,_0x5b6ee9){var _0x5ce999=function(_0x7eb9e5){while(--_0x7eb9e5){_0x384a33['push'](_0x384a33['shift']());}};_0x5ce999(++_0x5b6ee9);}(_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 f188f2c..8f989ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8caf=['INBOX','INTEGER','exports','STRING','BOOLEAN'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0x8caf,0x1ab));var _0xf8ca=function(_0x3f3b97,_0x395d93){_0x3f3b97=_0x3f3b97-0x0;var _0xb6ab0c=_0x8caf[_0x3f3b97];return _0xb6ab0c;};'use strict';var Sequelize=require('sequelize');module[_0xf8ca('0x0')]={'description':{'type':Sequelize[_0xf8ca('0x1')]},'host':{'type':Sequelize[_0xf8ca('0x1')]},'authentication':{'type':Sequelize[_0xf8ca('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xf8ca('0x1')]},'password':{'type':Sequelize[_0xf8ca('0x1')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0xf8ca('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xf8ca('0x1')],'defaultValue':_0xf8ca('0x3')},'connTimeout':{'type':Sequelize[_0xf8ca('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xf8ca('0x4')],'defaultValue':0x5},'service':{'type':Sequelize[_0xf8ca('0x1')]}};
\ No newline at end of file
+var _0x351d=['sequelize','STRING','BOOLEAN','INTEGER'];(function(_0x529b3a,_0x30bed5){var _0x1a712e=function(_0x52e8ef){while(--_0x52e8ef){_0x529b3a['push'](_0x529b3a['shift']());}};_0x1a712e(++_0x30bed5);}(_0x351d,0x90));var _0xd351=function(_0x3f3614,_0x5c0595){_0x3f3614=_0x3f3614-0x0;var _0x206c8f=_0x351d[_0x3f3614];return _0x206c8f;};'use strict';var Sequelize=require(_0xd351('0x0'));module['exports']={'description':{'type':Sequelize[_0xd351('0x1')]},'host':{'type':Sequelize[_0xd351('0x1')]},'authentication':{'type':Sequelize[_0xd351('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xd351('0x1')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize[_0xd351('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xd351('0x1')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0xd351('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xd351('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xd351('0x1')]}};
\ No newline at end of file
index ff9b08b..1d619b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x791a=['./mailServerIn.attributes','exports','define','lodash','moment','bluebird','request-promise','path'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x791a,0x1c3));var _0xa791=function(_0x4aad3f,_0x21fc56){_0x4aad3f=_0x4aad3f-0x0;var _0x2ac128=_0x791a[_0x4aad3f];return _0x2ac128;};'use strict';var _=require(_0xa791('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xa791('0x1'));var BPromise=require(_0xa791('0x2'));var rp=require(_0xa791('0x3'));var fs=require('fs');var path=require(_0xa791('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa791('0x5'));module[_0xa791('0x6')]=function(_0xb6f4c1,_0x10c471){return _0xb6f4c1[_0xa791('0x7')]('MailServerIn',attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8dd3=['MailServerIn','util','api','bluebird','path','../../config/environment','./mailServerIn.attributes','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8dd3,0x133));var _0x38dd=function(_0x5667cd,_0x232918){_0x5667cd=_0x5667cd-0x0;var _0x1b2a2f=_0x8dd3[_0x5667cd];return _0x1b2a2f;};'use strict';var _=require('lodash');var util=require(_0x38dd('0x0'));var logger=require('../../config/logger')(_0x38dd('0x1'));var moment=require('moment');var BPromise=require(_0x38dd('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x38dd('0x3'));var rimraf=require('rimraf');var config=require(_0x38dd('0x4'));var attributes=require(_0x38dd('0x5'));module[_0x38dd('0x6')]=function(_0x40f0b,_0x332b5b){return _0x40f0b[_0x38dd('0x7')](_0x38dd('0x8'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0b49087..36b78c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1094=['rpc','jayson/promise','client','http','request','then','info','debug','request\x20sent','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','include','map','model','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x500512,_0x172eeb){var _0x2ab71c=function(_0x1ca762){while(--_0x1ca762){_0x500512['push'](_0x500512['shift']());}};_0x2ab71c(++_0x172eeb);}(_0x1094,0x143));var _0x4109=function(_0x15a26e,_0x334582){_0x15a26e=_0x15a26e-0x0;var _0x25bef6=_0x1094[_0x15a26e];return _0x25bef6;};'use strict';var _=require(_0x4109('0x0'));var util=require(_0x4109('0x1'));var moment=require('moment');var BPromise=require(_0x4109('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4109('0x3'));var db=require(_0x4109('0x4'))['db'];var utils=require(_0x4109('0x5'));var logger=require(_0x4109('0x6'))(_0x4109('0x7'));var config=require('../../config/environment');var jayson=require(_0x4109('0x8'));var client=jayson[_0x4109('0x9')][_0x4109('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36c3e9,_0xd2df16,_0x2c34f){return new BPromise(function(_0x5512e8,_0x5b4ecf){return client[_0x4109('0xb')](_0x36c3e9,_0x2c34f)[_0x4109('0xc')](function(_0x2fa1d8){logger[_0x4109('0xd')]('MailServerIn,\x20%s,\x20%s',_0xd2df16,'request\x20sent');logger[_0x4109('0xe')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0xd2df16,_0x4109('0xf'),JSON[_0x4109('0x10')](_0x2fa1d8));if(_0x2fa1d8[_0x4109('0x11')]){if(_0x2fa1d8['error'][_0x4109('0x12')]===0x1f4){logger[_0x4109('0x11')](_0x4109('0x13'),_0xd2df16,_0x2fa1d8[_0x4109('0x11')][_0x4109('0x14')]);return _0x5b4ecf(_0x2fa1d8['error'][_0x4109('0x14')]);}logger[_0x4109('0x11')](_0x4109('0x13'),_0xd2df16,_0x2fa1d8[_0x4109('0x11')]['message']);return _0x5512e8(_0x2fa1d8['error'][_0x4109('0x14')]);}else{logger[_0x4109('0xd')](_0x4109('0x13'),_0xd2df16,_0x4109('0xf'));_0x5512e8(_0x2fa1d8[_0x4109('0x15')][_0x4109('0x14')]);}})[_0x4109('0x16')](function(_0x3c6542){logger['error']('MailServerIn,\x20%s,\x20%s',_0xd2df16,_0x3c6542);_0x5b4ecf(_0x3c6542);});});}exports[_0x4109('0x17')]=function(_0x328f1c){var _0x6945ae=this;return new Promise(function(_0x2e3fd6,_0x415e48){return db[_0x4109('0x18')][_0x4109('0x19')]({'raw':_0x328f1c[_0x4109('0x1a')]?_0x328f1c[_0x4109('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x328f1c[_0x4109('0x1a')]?_0x328f1c[_0x4109('0x1a')]['where']||null:null,'attributes':_0x328f1c[_0x4109('0x1a')]?_0x328f1c[_0x4109('0x1a')]['attributes']||null:null,'limit':_0x328f1c['options']?_0x328f1c[_0x4109('0x1a')]['limit']||null:null,'include':_0x328f1c[_0x4109('0x1a')]?_0x328f1c[_0x4109('0x1a')][_0x4109('0x1b')]?_[_0x4109('0x1c')](_0x328f1c['options'][_0x4109('0x1b')],function(_0x438f4f){return{'model':db[_0x438f4f[_0x4109('0x1d')]],'as':_0x438f4f['as'],'attributes':_0x438f4f['attributes'],'include':_0x438f4f[_0x4109('0x1b')]?_[_0x4109('0x1c')](_0x438f4f[_0x4109('0x1b')],function(_0x57768e){return{'model':db[_0x57768e['model']],'as':_0x57768e['as'],'attributes':_0x57768e['attributes'],'include':_0x57768e[_0x4109('0x1b')]?_[_0x4109('0x1c')](_0x57768e[_0x4109('0x1b')],function(_0x1ef8fb){return{'model':db[_0x1ef8fb[_0x4109('0x1d')]],'as':_0x1ef8fb['as'],'attributes':_0x1ef8fb['attributes']};}):[]};}):[]};}):[]:[]})[_0x4109('0xc')](function(_0x357ce6){logger['info'](_0x4109('0x17'),_0x328f1c);logger['debug'](_0x4109('0x17'),_0x328f1c,JSON[_0x4109('0x10')](_0x357ce6));_0x2e3fd6(_0x357ce6);})[_0x4109('0x16')](function(_0x3165c5){logger[_0x4109('0x11')]('GetMailServerIn',_0x3165c5[_0x4109('0x14')],_0x328f1c);_0x415e48(_0x6945ae['error'](0x1f4,_0x3165c5[_0x4109('0x14')]));});});};
\ No newline at end of file
+var _0x2ceb=['../../config/logger','../../config/environment','jayson/promise','http','info','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','attributes','limit','include','model','map','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2bac87,_0x3b314b){var _0x3cc409=function(_0x3612c6){while(--_0x3612c6){_0x2bac87['push'](_0x2bac87['shift']());}};_0x3cc409(++_0x3b314b);}(_0x2ceb,0x110));var _0xb2ce=function(_0x23f85a,_0x379559){_0x23f85a=_0x23f85a-0x0;var _0xb017d=_0x2ceb[_0x23f85a];return _0xb017d;};'use strict';var _=require(_0xb2ce('0x0'));var util=require(_0xb2ce('0x1'));var moment=require('moment');var BPromise=require(_0xb2ce('0x2'));var rs=require(_0xb2ce('0x3'));var fs=require('fs');var Redis=require(_0xb2ce('0x4'));var db=require(_0xb2ce('0x5'))['db'];var utils=require(_0xb2ce('0x6'));var logger=require(_0xb2ce('0x7'))('rpc');var config=require(_0xb2ce('0x8'));var jayson=require(_0xb2ce('0x9'));var client=jayson['client'][_0xb2ce('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3dfaee,_0x51040c,_0x39120a){return new BPromise(function(_0x9fb07c,_0x10c67c){return client['request'](_0x3dfaee,_0x39120a)['then'](function(_0x17f7da){logger[_0xb2ce('0xb')]('MailServerIn,\x20%s,\x20%s',_0x51040c,_0xb2ce('0xc'));logger[_0xb2ce('0xd')](_0xb2ce('0xe'),_0x51040c,_0xb2ce('0xc'),JSON[_0xb2ce('0xf')](_0x17f7da));if(_0x17f7da[_0xb2ce('0x10')]){if(_0x17f7da['error'][_0xb2ce('0x11')]===0x1f4){logger[_0xb2ce('0x10')](_0xb2ce('0x12'),_0x51040c,_0x17f7da[_0xb2ce('0x10')][_0xb2ce('0x13')]);return _0x10c67c(_0x17f7da['error']['message']);}logger[_0xb2ce('0x10')](_0xb2ce('0x12'),_0x51040c,_0x17f7da[_0xb2ce('0x10')][_0xb2ce('0x13')]);return _0x9fb07c(_0x17f7da[_0xb2ce('0x10')][_0xb2ce('0x13')]);}else{logger[_0xb2ce('0xb')](_0xb2ce('0x12'),_0x51040c,_0xb2ce('0xc'));_0x9fb07c(_0x17f7da[_0xb2ce('0x14')][_0xb2ce('0x13')]);}})[_0xb2ce('0x15')](function(_0x13ee00){logger[_0xb2ce('0x10')](_0xb2ce('0x12'),_0x51040c,_0x13ee00);_0x10c67c(_0x13ee00);});});}exports[_0xb2ce('0x16')]=function(_0x2e0336){var _0x3f135e=this;return new Promise(function(_0x2563f6,_0x3715d3){return db[_0xb2ce('0x17')][_0xb2ce('0x18')]({'raw':_0x2e0336[_0xb2ce('0x19')]?_0x2e0336[_0xb2ce('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2e0336[_0xb2ce('0x19')]?_0x2e0336[_0xb2ce('0x19')]['where']||null:null,'attributes':_0x2e0336[_0xb2ce('0x19')]?_0x2e0336['options'][_0xb2ce('0x1a')]||null:null,'limit':_0x2e0336[_0xb2ce('0x19')]?_0x2e0336[_0xb2ce('0x19')][_0xb2ce('0x1b')]||null:null,'include':_0x2e0336['options']?_0x2e0336['options'][_0xb2ce('0x1c')]?_['map'](_0x2e0336[_0xb2ce('0x19')][_0xb2ce('0x1c')],function(_0x534806){return{'model':db[_0x534806[_0xb2ce('0x1d')]],'as':_0x534806['as'],'attributes':_0x534806[_0xb2ce('0x1a')],'include':_0x534806[_0xb2ce('0x1c')]?_[_0xb2ce('0x1e')](_0x534806[_0xb2ce('0x1c')],function(_0x4f547e){return{'model':db[_0x4f547e[_0xb2ce('0x1d')]],'as':_0x4f547e['as'],'attributes':_0x4f547e['attributes'],'include':_0x4f547e[_0xb2ce('0x1c')]?_['map'](_0x4f547e['include'],function(_0x367e18){return{'model':db[_0x367e18[_0xb2ce('0x1d')]],'as':_0x367e18['as'],'attributes':_0x367e18[_0xb2ce('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2354bf){logger[_0xb2ce('0xb')]('GetMailServerIn',_0x2e0336);logger[_0xb2ce('0xd')](_0xb2ce('0x16'),_0x2e0336,JSON[_0xb2ce('0xf')](_0x2354bf));_0x2563f6(_0x2354bf);})['catch'](function(_0x1add93){logger[_0xb2ce('0x10')](_0xb2ce('0x16'),_0x1add93[_0xb2ce('0x13')],_0x2e0336);_0x3715d3(_0x3f135e[_0xb2ce('0x10')](0x1f4,_0x1add93[_0xb2ce('0x13')]));});});};
\ No newline at end of file
index 70a8c5b..89eb0fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router;
\ No newline at end of file
+var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x7a54,0x106));var _0x47a5=function(_0x85c32,_0x241a7d){_0x85c32=_0x85c32-0x0;var _0x5ddfee=_0x7a54[_0x85c32];return _0x5ddfee;};'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 9ed282e..b472ff9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1edd=['STRING','INTEGER','BOOLEAN','sequelize','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x1edd,0x111));var _0xd1ed=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x1edd[_0x4243a3];return _0x1b2a33;};'use strict';var Sequelize=require(_0xd1ed('0x0'));module[_0xd1ed('0x1')]={'description':{'type':Sequelize[_0xd1ed('0x2')]},'host':{'type':Sequelize[_0xd1ed('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xd1ed('0x2')]},'port':{'type':Sequelize[_0xd1ed('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xd1ed('0x4')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x028a=['BOOLEAN','exports','STRING','INTEGER'];(function(_0x34e747,_0x173163){var _0x200a90=function(_0x2cfb42){while(--_0x2cfb42){_0x34e747['push'](_0x34e747['shift']());}};_0x200a90(++_0x173163);}(_0x028a,0x1b5));var _0xa028=function(_0x356c06,_0x18522f){_0x356c06=_0x356c06-0x0;var _0x2e71cf=_0x028a[_0x356c06];return _0x2e71cf;};'use strict';var Sequelize=require('sequelize');module[_0xa028('0x0')]={'description':{'type':Sequelize[_0xa028('0x1')]},'host':{'type':Sequelize[_0xa028('0x1')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0xa028('0x1')]},'port':{'type':Sequelize[_0xa028('0x2')]},'secure':{'type':Sequelize[_0xa028('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xa028('0x1')]},'authentication':{'type':Sequelize[_0xa028('0x3')],'defaultValue':!![]}};
\ No newline at end of file
index aac8bf7..68c4f93 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x288f=['limit','count','offset','set','Content-Range','apply','update','then','destroy','end','stack','name','send','map','MailServerOut','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined'];(function(_0x568e85,_0x2dcfb7){var _0x262688=function(_0x335586){while(--_0x335586){_0x568e85['push'](_0x568e85['shift']());}};_0x262688(++_0x2dcfb7);}(_0x288f,0xbe));var _0xf288=function(_0x52b828,_0x359d0f){_0x52b828=_0x52b828-0x0;var _0x2721d8=_0x288f[_0x52b828];return _0x2721d8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf288('0x0'));var zipdir=require(_0xf288('0x1'));var jsonpatch=require(_0xf288('0x2'));var rp=require('request-promise');var moment=require(_0xf288('0x3'));var BPromise=require(_0xf288('0x4'));var Mustache=require(_0xf288('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xf288('0x6'));var ejs=require(_0xf288('0x7'));var fs=require('fs');var fs_extra=require(_0xf288('0x8'));var _=require('lodash');var squel=require(_0xf288('0x9'));var crypto=require(_0xf288('0xa'));var jsforce=require(_0xf288('0xb'));var deskjs=require(_0xf288('0xc'));var toCsv=require('to-csv');var querystring=require(_0xf288('0xd'));var Papa=require(_0xf288('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf288('0xf'));var hardwareService=require(_0xf288('0x10'));var logger=require(_0xf288('0x11'))(_0xf288('0x12'));var utils=require(_0xf288('0x13'));var config=require(_0xf288('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf288('0x15'))['db'];function respondWithStatusCode(_0x5f01e6,_0x4de63e){_0x4de63e=_0x4de63e||0xcc;return function(_0x2fe7ab){if(_0x2fe7ab){return _0x5f01e6[_0xf288('0x16')](_0x4de63e);}return _0x5f01e6['status'](_0x4de63e)['end']();};}function respondWithResult(_0x46ad3e,_0x3c8f4e){_0x3c8f4e=_0x3c8f4e||0xc8;return function(_0x9b93fe){if(_0x9b93fe){return _0x46ad3e[_0xf288('0x17')](_0x3c8f4e)[_0xf288('0x18')](_0x9b93fe);}};}function respondWithFilteredResult(_0x62ce61,_0x56e910){return function(_0x17fc31){if(_0x17fc31){var _0x57839d=typeof _0x56e910['offset']===_0xf288('0x19')&&typeof _0x56e910[_0xf288('0x1a')]===_0xf288('0x19');var _0x19319b=_0x17fc31[_0xf288('0x1b')];var _0xd1aff0=_0x57839d?0x0:_0x56e910[_0xf288('0x1c')];var _0x4582fc=_0x57839d?_0x17fc31['count']:_0x56e910[_0xf288('0x1c')]+_0x56e910[_0xf288('0x1a')];var _0x2d35a1;if(_0x4582fc>=_0x19319b){_0x4582fc=_0x19319b;_0x2d35a1=0xc8;}else{_0x2d35a1=0xce;}_0x62ce61['status'](_0x2d35a1);return _0x62ce61[_0xf288('0x1d')](_0xf288('0x1e'),_0xd1aff0+'-'+_0x4582fc+'/'+_0x19319b)[_0xf288('0x18')](_0x17fc31);}return null;};}function patchUpdates(_0x4720a2){return function(_0x334853){try{jsonpatch[_0xf288('0x1f')](_0x334853,_0x4720a2,!![]);}catch(_0x25d840){return BPromise['reject'](_0x25d840);}return _0x334853['save']();};}function saveUpdates(_0x521cf9,_0xcaa6b8){return function(_0x25ba65){if(_0x25ba65){return _0x25ba65[_0xf288('0x20')](_0x521cf9)[_0xf288('0x21')](function(_0x310e62){return _0x310e62;});}return null;};}function removeEntity(_0x2df471,_0x1e47d5){return function(_0x52ee2c){if(_0x52ee2c){return _0x52ee2c[_0xf288('0x22')]()[_0xf288('0x21')](function(){_0x2df471['status'](0xcc)[_0xf288('0x23')]();});}};}function handleEntityNotFound(_0x34d8cd,_0x59df19){return function(_0x67387){if(!_0x67387){_0x34d8cd[_0xf288('0x16')](0x194);}return _0x67387;};}function handleError(_0x48afe0,_0x267dc1){_0x267dc1=_0x267dc1||0x1f4;return function(_0xa6d28f){logger['error'](_0xa6d28f[_0xf288('0x24')]);if(_0xa6d28f['name']){delete _0xa6d28f[_0xf288('0x25')];}_0x48afe0[_0xf288('0x17')](_0x267dc1)[_0xf288('0x26')](_0xa6d28f);};}exports['index']=function(_0x1f4719,_0x3fa91a){var _0x192585={},_0x3585f8={},_0x4c8e4a={'count':0x0,'rows':[]};var _0x29dae2=_[_0xf288('0x27')](db[_0xf288('0x28')]['rawAttributes'],function(_0xf705e4){return{'name':_0xf705e4[_0xf288('0x29')],'type':_0xf705e4[_0xf288('0x2a')][_0xf288('0x2b')]};});_0x3585f8[_0xf288('0x2c')]=_[_0xf288('0x27')](_0x29dae2,'name');_0x3585f8[_0xf288('0x2d')]=_[_0xf288('0x2e')](_0x1f4719['query']);_0x3585f8[_0xf288('0x2f')]=_[_0xf288('0x30')](_0x3585f8[_0xf288('0x2c')],_0x3585f8[_0xf288('0x2d')]);_0x192585[_0xf288('0x31')]=_[_0xf288('0x30')](_0x3585f8['model'],qs[_0xf288('0x32')](_0x1f4719['query'][_0xf288('0x32')]));_0x192585[_0xf288('0x31')]=_0x192585[_0xf288('0x31')]['length']?_0x192585[_0xf288('0x31')]:_0x3585f8['model'];if(!_0x1f4719['query'][_0xf288('0x33')](_0xf288('0x34'))){_0x192585[_0xf288('0x1a')]=qs['limit'](_0x1f4719[_0xf288('0x2d')][_0xf288('0x1a')]);_0x192585[_0xf288('0x1c')]=qs[_0xf288('0x1c')](_0x1f4719[_0xf288('0x2d')][_0xf288('0x1c')]);}_0x192585[_0xf288('0x35')]=qs['sort'](_0x1f4719[_0xf288('0x2d')][_0xf288('0x36')]);_0x192585[_0xf288('0x37')]=qs['filters'](_[_0xf288('0x38')](_0x1f4719[_0xf288('0x2d')],_0x3585f8[_0xf288('0x2f')]),_0x29dae2);if(_0x1f4719[_0xf288('0x2d')][_0xf288('0x39')]){_0x192585[_0xf288('0x37')]=_[_0xf288('0x3a')](_0x192585[_0xf288('0x37')],{'$or':_[_0xf288('0x27')](_0x29dae2,function(_0x54ad1e){if(_0x54ad1e[_0xf288('0x2a')]!==_0xf288('0x3b')){var _0x2b9176={};_0x2b9176[_0x54ad1e[_0xf288('0x25')]]={'$like':'%'+_0x1f4719['query'][_0xf288('0x39')]+'%'};return _0x2b9176;}})});}_0x192585=_[_0xf288('0x3a')]({},_0x192585,_0x1f4719[_0xf288('0x3c')]);var _0x237e70={'where':_0x192585['where']};return db[_0xf288('0x28')][_0xf288('0x1b')](_0x237e70)['then'](function(_0x5df566){_0x4c8e4a[_0xf288('0x1b')]=_0x5df566;if(_0x1f4719[_0xf288('0x2d')][_0xf288('0x3d')]){_0x192585[_0xf288('0x3e')]=[{'all':!![]}];}return db[_0xf288('0x28')][_0xf288('0x3f')](_0x192585);})[_0xf288('0x21')](function(_0x1813ae){_0x4c8e4a[_0xf288('0x40')]=_0x1813ae;return _0x4c8e4a;})[_0xf288('0x21')](respondWithFilteredResult(_0x3fa91a,_0x192585))[_0xf288('0x41')](handleError(_0x3fa91a,null));};exports[_0xf288('0x42')]=function(_0x2c03d9,_0x4bb307){var _0x424150={'raw':!![],'where':{'id':_0x2c03d9[_0xf288('0x43')]['id']}},_0x58ea29={};_0x58ea29[_0xf288('0x2c')]=_[_0xf288('0x2e')](db[_0xf288('0x28')][_0xf288('0x44')]);_0x58ea29[_0xf288('0x2d')]=_[_0xf288('0x2e')](_0x2c03d9['query']);_0x58ea29['filters']=_[_0xf288('0x30')](_0x58ea29['model'],_0x58ea29[_0xf288('0x2d')]);_0x424150[_0xf288('0x31')]=_[_0xf288('0x30')](_0x58ea29[_0xf288('0x2c')],qs[_0xf288('0x32')](_0x2c03d9['query'][_0xf288('0x32')]));_0x424150[_0xf288('0x31')]=_0x424150[_0xf288('0x31')]['length']?_0x424150[_0xf288('0x31')]:_0x58ea29[_0xf288('0x2c')];if(_0x2c03d9[_0xf288('0x2d')][_0xf288('0x3d')]){_0x424150[_0xf288('0x3e')]=[{'all':!![]}];}_0x424150=_[_0xf288('0x3a')]({},_0x424150,_0x2c03d9[_0xf288('0x3c')]);return db['MailServerOut'][_0xf288('0x45')](_0x424150)[_0xf288('0x21')](handleEntityNotFound(_0x4bb307,null))[_0xf288('0x21')](respondWithResult(_0x4bb307,null))[_0xf288('0x41')](handleError(_0x4bb307,null));};exports[_0xf288('0x46')]=function(_0x20a847,_0x3f5299){return db['MailServerOut'][_0xf288('0x46')](_0x20a847['body'],{})[_0xf288('0x21')](respondWithResult(_0x3f5299,0xc9))[_0xf288('0x41')](handleError(_0x3f5299,null));};exports['update']=function(_0x1c5d15,_0x2b9d7b){if(_0x1c5d15[_0xf288('0x47')]['id']){delete _0x1c5d15['body']['id'];}return db[_0xf288('0x28')][_0xf288('0x45')]({'where':{'id':_0x1c5d15['params']['id']}})[_0xf288('0x21')](handleEntityNotFound(_0x2b9d7b,null))[_0xf288('0x21')](saveUpdates(_0x1c5d15[_0xf288('0x47')],null))[_0xf288('0x21')](respondWithResult(_0x2b9d7b,null))[_0xf288('0x41')](handleError(_0x2b9d7b,null));};exports[_0xf288('0x22')]=function(_0x3d5328,_0x38bae7){return db[_0xf288('0x28')][_0xf288('0x45')]({'where':{'id':_0x3d5328[_0xf288('0x43')]['id']}})[_0xf288('0x21')](handleEntityNotFound(_0x38bae7,null))[_0xf288('0x21')](removeEntity(_0x38bae7,null))['catch'](handleError(_0x38bae7,null));};
\ No newline at end of file
+var _0x950f=['map','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','MailServerOut','include','show','params','keys','includeAll','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model'];(function(_0x2f31ea,_0x351d88){var _0x5b6a5d=function(_0xf990d6){while(--_0xf990d6){_0x2f31ea['push'](_0x2f31ea['shift']());}};_0x5b6a5d(++_0x351d88);}(_0x950f,0xa5));var _0xf950=function(_0x52f1e6,_0xf70489){_0x52f1e6=_0x52f1e6-0x0;var _0x21f104=_0x950f[_0x52f1e6];return _0x21f104;};'use strict';var emlformat=require(_0xf950('0x0'));var rimraf=require(_0xf950('0x1'));var zipdir=require(_0xf950('0x2'));var jsonpatch=require(_0xf950('0x3'));var rp=require(_0xf950('0x4'));var moment=require(_0xf950('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf950('0x6'));var util=require(_0xf950('0x7'));var path=require(_0xf950('0x8'));var sox=require('sox');var csv=require(_0xf950('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf950('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf950('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf950('0x9'));var querystring=require(_0xf950('0xc'));var Papa=require('papaparse');var Redis=require(_0xf950('0xd'));var authService=require(_0xf950('0xe'));var qs=require(_0xf950('0xf'));var as=require(_0xf950('0x10'));var hardwareService=require(_0xf950('0x11'));var logger=require('../../config/logger')(_0xf950('0x12'));var utils=require(_0xf950('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf950('0x14'))['db'];function respondWithStatusCode(_0xdf2eac,_0x3cb33b){_0x3cb33b=_0x3cb33b||0xcc;return function(_0x653ee9){if(_0x653ee9){return _0xdf2eac[_0xf950('0x15')](_0x3cb33b);}return _0xdf2eac[_0xf950('0x16')](_0x3cb33b)[_0xf950('0x17')]();};}function respondWithResult(_0x15011d,_0x1f7fbd){_0x1f7fbd=_0x1f7fbd||0xc8;return function(_0x345fc6){if(_0x345fc6){return _0x15011d[_0xf950('0x16')](_0x1f7fbd)[_0xf950('0x18')](_0x345fc6);}};}function respondWithFilteredResult(_0x5239cd,_0x24e1ad){return function(_0x53410c){if(_0x53410c){var _0x137f0a=typeof _0x24e1ad[_0xf950('0x19')]===_0xf950('0x1a')&&typeof _0x24e1ad['limit']===_0xf950('0x1a');var _0x58b47a=_0x53410c[_0xf950('0x1b')];var _0x4b69a0=_0x137f0a?0x0:_0x24e1ad[_0xf950('0x19')];var _0x475f34=_0x137f0a?_0x53410c[_0xf950('0x1b')]:_0x24e1ad[_0xf950('0x19')]+_0x24e1ad[_0xf950('0x1c')];var _0x517b50;if(_0x475f34>=_0x58b47a){_0x475f34=_0x58b47a;_0x517b50=0xc8;}else{_0x517b50=0xce;}_0x5239cd[_0xf950('0x16')](_0x517b50);return _0x5239cd['set'](_0xf950('0x1d'),_0x4b69a0+'-'+_0x475f34+'/'+_0x58b47a)[_0xf950('0x18')](_0x53410c);}return null;};}function patchUpdates(_0x50edde){return function(_0x40306e){try{jsonpatch[_0xf950('0x1e')](_0x40306e,_0x50edde,!![]);}catch(_0x178b8b){return BPromise['reject'](_0x178b8b);}return _0x40306e[_0xf950('0x1f')]();};}function saveUpdates(_0x2bf625,_0x12d2e2){return function(_0x269985){if(_0x269985){return _0x269985[_0xf950('0x20')](_0x2bf625)[_0xf950('0x21')](function(_0x48b687){return _0x48b687;});}return null;};}function removeEntity(_0xc9bf72,_0x133b92){return function(_0x4afa8a){if(_0x4afa8a){return _0x4afa8a[_0xf950('0x22')]()[_0xf950('0x21')](function(){_0xc9bf72['status'](0xcc)[_0xf950('0x17')]();});}};}function handleEntityNotFound(_0x1685aa,_0xb7dd7b){return function(_0x39652c){if(!_0x39652c){_0x1685aa[_0xf950('0x15')](0x194);}return _0x39652c;};}function handleError(_0x2f6b39,_0x431c82){_0x431c82=_0x431c82||0x1f4;return function(_0x689f64){logger[_0xf950('0x23')](_0x689f64[_0xf950('0x24')]);if(_0x689f64[_0xf950('0x25')]){delete _0x689f64[_0xf950('0x25')];}_0x2f6b39[_0xf950('0x16')](_0x431c82)[_0xf950('0x26')](_0x689f64);};}exports[_0xf950('0x27')]=function(_0x56c5c3,_0x271f6c){var _0x296b25={},_0x263dae={},_0x58e6b3={'count':0x0,'rows':[]};var _0x9b60c7=_['map'](db['MailServerOut'][_0xf950('0x28')],function(_0x31f4b5){return{'name':_0x31f4b5[_0xf950('0x29')],'type':_0x31f4b5[_0xf950('0x2a')][_0xf950('0x2b')]};});_0x263dae[_0xf950('0x2c')]=_[_0xf950('0x2d')](_0x9b60c7,_0xf950('0x25'));_0x263dae[_0xf950('0x2e')]=_['keys'](_0x56c5c3[_0xf950('0x2e')]);_0x263dae[_0xf950('0x2f')]=_[_0xf950('0x30')](_0x263dae[_0xf950('0x2c')],_0x263dae[_0xf950('0x2e')]);_0x296b25[_0xf950('0x31')]=_[_0xf950('0x30')](_0x263dae[_0xf950('0x2c')],qs[_0xf950('0x32')](_0x56c5c3['query']['fields']));_0x296b25['attributes']=_0x296b25[_0xf950('0x31')][_0xf950('0x33')]?_0x296b25[_0xf950('0x31')]:_0x263dae['model'];if(!_0x56c5c3[_0xf950('0x2e')]['hasOwnProperty'](_0xf950('0x34'))){_0x296b25[_0xf950('0x1c')]=qs[_0xf950('0x1c')](_0x56c5c3['query'][_0xf950('0x1c')]);_0x296b25[_0xf950('0x19')]=qs['offset'](_0x56c5c3[_0xf950('0x2e')]['offset']);}_0x296b25['order']=qs[_0xf950('0x35')](_0x56c5c3[_0xf950('0x2e')][_0xf950('0x35')]);_0x296b25[_0xf950('0x36')]=qs[_0xf950('0x2f')](_[_0xf950('0x37')](_0x56c5c3[_0xf950('0x2e')],_0x263dae['filters']),_0x9b60c7);if(_0x56c5c3['query'][_0xf950('0x38')]){_0x296b25[_0xf950('0x36')]=_[_0xf950('0x39')](_0x296b25[_0xf950('0x36')],{'$or':_[_0xf950('0x2d')](_0x9b60c7,function(_0x3592ef){if(_0x3592ef[_0xf950('0x2a')]!==_0xf950('0x3a')){var _0x4ea18f={};_0x4ea18f[_0x3592ef[_0xf950('0x25')]]={'$like':'%'+_0x56c5c3[_0xf950('0x2e')][_0xf950('0x38')]+'%'};return _0x4ea18f;}})});}_0x296b25=_[_0xf950('0x39')]({},_0x296b25,_0x56c5c3[_0xf950('0x3b')]);var _0x7de307={'where':_0x296b25[_0xf950('0x36')]};return db[_0xf950('0x3c')][_0xf950('0x1b')](_0x7de307)[_0xf950('0x21')](function(_0x1200c0){_0x58e6b3[_0xf950('0x1b')]=_0x1200c0;if(_0x56c5c3[_0xf950('0x2e')]['includeAll']){_0x296b25[_0xf950('0x3d')]=[{'all':!![]}];}return db[_0xf950('0x3c')]['findAll'](_0x296b25);})[_0xf950('0x21')](function(_0x5219d2){_0x58e6b3['rows']=_0x5219d2;return _0x58e6b3;})[_0xf950('0x21')](respondWithFilteredResult(_0x271f6c,_0x296b25))['catch'](handleError(_0x271f6c,null));};exports[_0xf950('0x3e')]=function(_0x93808d,_0x39c9c9){var _0x14c236={'raw':!![],'where':{'id':_0x93808d[_0xf950('0x3f')]['id']}},_0x2e4d6c={};_0x2e4d6c[_0xf950('0x2c')]=_[_0xf950('0x40')](db[_0xf950('0x3c')][_0xf950('0x28')]);_0x2e4d6c[_0xf950('0x2e')]=_[_0xf950('0x40')](_0x93808d[_0xf950('0x2e')]);_0x2e4d6c[_0xf950('0x2f')]=_[_0xf950('0x30')](_0x2e4d6c['model'],_0x2e4d6c[_0xf950('0x2e')]);_0x14c236['attributes']=_[_0xf950('0x30')](_0x2e4d6c[_0xf950('0x2c')],qs['fields'](_0x93808d[_0xf950('0x2e')][_0xf950('0x32')]));_0x14c236[_0xf950('0x31')]=_0x14c236['attributes'][_0xf950('0x33')]?_0x14c236[_0xf950('0x31')]:_0x2e4d6c['model'];if(_0x93808d[_0xf950('0x2e')][_0xf950('0x41')]){_0x14c236[_0xf950('0x3d')]=[{'all':!![]}];}_0x14c236=_[_0xf950('0x39')]({},_0x14c236,_0x93808d['options']);return db['MailServerOut']['find'](_0x14c236)[_0xf950('0x21')](handleEntityNotFound(_0x39c9c9,null))[_0xf950('0x21')](respondWithResult(_0x39c9c9,null))[_0xf950('0x42')](handleError(_0x39c9c9,null));};exports['create']=function(_0x473c2f,_0x15392f){return db['MailServerOut'][_0xf950('0x43')](_0x473c2f['body'],{})['then'](respondWithResult(_0x15392f,0xc9))[_0xf950('0x42')](handleError(_0x15392f,null));};exports[_0xf950('0x20')]=function(_0x279293,_0x233ee0){if(_0x279293[_0xf950('0x44')]['id']){delete _0x279293[_0xf950('0x44')]['id'];}return db[_0xf950('0x3c')][_0xf950('0x45')]({'where':{'id':_0x279293[_0xf950('0x3f')]['id']}})[_0xf950('0x21')](handleEntityNotFound(_0x233ee0,null))[_0xf950('0x21')](saveUpdates(_0x279293['body'],null))[_0xf950('0x21')](respondWithResult(_0x233ee0,null))[_0xf950('0x42')](handleError(_0x233ee0,null));};exports['destroy']=function(_0x22cc9f,_0x4c17a2){return db[_0xf950('0x3c')]['find']({'where':{'id':_0x22cc9f[_0xf950('0x3f')]['id']}})[_0xf950('0x21')](handleEntityNotFound(_0x4c17a2,null))[_0xf950('0x21')](removeEntity(_0x4c17a2,null))[_0xf950('0x42')](handleError(_0x4c17a2,null));};
\ No newline at end of file
index 9c36ad5..1b21c37 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13e6=['../../config/logger','api','moment','request-promise','rimraf','../../config/environment','MailServerOut','mail_servers_out','lodash','util'];(function(_0x1e369b,_0x674ecd){var _0x1b493d=function(_0x31306a){while(--_0x31306a){_0x1e369b['push'](_0x1e369b['shift']());}};_0x1b493d(++_0x674ecd);}(_0x13e6,0x10c));var _0x613e=function(_0x17c650,_0x57dc03){_0x17c650=_0x17c650-0x0;var _0x3100bb=_0x13e6[_0x17c650];return _0x3100bb;};'use strict';var _=require(_0x613e('0x0'));var util=require(_0x613e('0x1'));var logger=require(_0x613e('0x2'))(_0x613e('0x3'));var moment=require(_0x613e('0x4'));var BPromise=require('bluebird');var rp=require(_0x613e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x613e('0x6'));var config=require(_0x613e('0x7'));var attributes=require('./mailServerOut.attributes');module['exports']=function(_0x2c7349,_0x32056a){return _0x2c7349['define'](_0x613e('0x8'),attributes,{'tableName':_0x613e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x252f=['bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','../../config/logger','api','moment'];(function(_0x147497,_0x43e433){var _0x35f45=function(_0x584421){while(--_0x584421){_0x147497['push'](_0x147497['shift']());}};_0x35f45(++_0x43e433);}(_0x252f,0xa4));var _0xf252=function(_0x17d713,_0x19b690){_0x17d713=_0x17d713-0x0;var _0x452666=_0x252f[_0x17d713];return _0x452666;};'use strict';var _=require(_0xf252('0x0'));var util=require('util');var logger=require(_0xf252('0x1'))(_0xf252('0x2'));var moment=require(_0xf252('0x3'));var BPromise=require(_0xf252('0x4'));var rp=require(_0xf252('0x5'));var fs=require('fs');var path=require(_0xf252('0x6'));var rimraf=require(_0xf252('0x7'));var config=require(_0xf252('0x8'));var attributes=require(_0xf252('0x9'));module[_0xf252('0xa')]=function(_0xe63095,_0x5dd7c4){return _0xe63095[_0xf252('0xb')](_0xf252('0xc'),attributes,{'tableName':_0xf252('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 6b3f133..0709f34 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x470ea4,_0x76804f){var _0x9c7b1a=function(_0x133af1){while(--_0x133af1){_0x470ea4['push'](_0x470ea4['shift']());}};_0x9c7b1a(++_0x76804f);}(_0x1261,0x144));var _0x1126=function(_0x16b561,_0x5a914f){_0x16b561=_0x16b561-0x0;var _0x22599f=_0x1261[_0x16b561];return _0x22599f;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('MailServerOut,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x16cf42,_0x39bd4c){var _0x1e678a=function(_0x349230){while(--_0x349230){_0x16cf42['push'](_0x16cf42['shift']());}};_0x1e678a(++_0x39bd4c);}(_0xdb28,0x106));var _0x8db2=function(_0x1e5996,_0x22a78f){_0x1e5996=_0x1e5996-0x0;var _0x262f78=_0xdb28[_0x1e5996];return _0x262f78;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
index e7c960b..ba6746f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f3d=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x391932,_0x3c1b9f){var _0x49ca90=function(_0x589776){while(--_0x589776){_0x391932['push'](_0x391932['shift']());}};_0x49ca90(++_0x3c1b9f);}(_0x4f3d,0x8c));var _0xd4f3=function(_0x4730e3,_0x3e5620){_0x4730e3=_0x4730e3-0x0;var _0x59d9ee=_0x4f3d[_0x4730e3];return _0x59d9ee;};'use strict';var multer=require(_0xd4f3('0x0'));var util=require('util');var path=require(_0xd4f3('0x1'));var timeout=require(_0xd4f3('0x2'));var express=require(_0xd4f3('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd4f3('0x4'));var interaction=require(_0xd4f3('0x5'));var config=require('../../config/environment');var controller=require('./mailSubstatus.controller');router[_0xd4f3('0x6')]('/',auth[_0xd4f3('0x7')](),controller[_0xd4f3('0x8')]);router[_0xd4f3('0x6')](_0xd4f3('0x9'),auth[_0xd4f3('0x7')](),controller[_0xd4f3('0xa')]);router['get'](_0xd4f3('0xb'),auth[_0xd4f3('0x7')](),controller[_0xd4f3('0xc')]);router[_0xd4f3('0xd')]('/',auth[_0xd4f3('0x7')](),controller[_0xd4f3('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xd4f3('0xf')](_0xd4f3('0xb'),auth[_0xd4f3('0x7')](),controller[_0xd4f3('0x10')]);module[_0xd4f3('0x11')]=router;
\ No newline at end of file
+var _0x7ca4=['isAuthenticated','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','show','post','create','put'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x7ca4,0x138));var _0x47ca=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7ca4[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0x47ca('0x0'));var path=require(_0x47ca('0x1'));var timeout=require(_0x47ca('0x2'));var express=require(_0x47ca('0x3'));var router=express[_0x47ca('0x4')]();var fs_extra=require(_0x47ca('0x5'));var auth=require(_0x47ca('0x6'));var interaction=require(_0x47ca('0x7'));var config=require(_0x47ca('0x8'));var controller=require('./mailSubstatus.controller');router[_0x47ca('0x9')]('/',auth['isAuthenticated'](),controller[_0x47ca('0xa')]);router[_0x47ca('0x9')](_0x47ca('0xb'),auth['isAuthenticated'](),controller[_0x47ca('0xc')]);router[_0x47ca('0x9')](_0x47ca('0xd'),auth['isAuthenticated'](),controller[_0x47ca('0xe')]);router[_0x47ca('0xf')]('/',auth['isAuthenticated'](),controller[_0x47ca('0x10')]);router[_0x47ca('0x11')]('/:id',auth[_0x47ca('0x12')](),controller[_0x47ca('0x13')]);router[_0x47ca('0x14')](_0x47ca('0xd'),auth[_0x47ca('0x12')](),controller[_0x47ca('0x15')]);module['exports']=router;
\ No newline at end of file
index 69dd8d2..4a90327 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaf1b=['STRING','name','sequelize','exports'];(function(_0x5924e7,_0x4a398e){var _0x4b6d1f=function(_0x165654){while(--_0x165654){_0x5924e7['push'](_0x5924e7['shift']());}};_0x4b6d1f(++_0x4a398e);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x10ffd0,_0x1d108c){_0x10ffd0=_0x10ffd0-0x0;var _0x427351=_0xaf1b[_0x10ffd0];return _0x427351;};'use strict';var Sequelize=require(_0xbaf1('0x0'));module[_0xbaf1('0x1')]={'name':{'type':Sequelize[_0xbaf1('0x2')],'unique':_0xbaf1('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbaf1('0x2')]}};
\ No newline at end of file
+var _0xacf4=['name','STRING'];(function(_0x4d18c2,_0x9b85d0){var _0x1cadf9=function(_0xbb421c){while(--_0xbb421c){_0x4d18c2['push'](_0x4d18c2['shift']());}};_0x1cadf9(++_0x9b85d0);}(_0xacf4,0xe7));var _0x4acf=function(_0x3e4ee8,_0x4194f6){_0x3e4ee8=_0x3e4ee8-0x0;var _0x10b191=_0xacf4[_0x3e4ee8];return _0x10b191;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4acf('0x0')],'unique':_0x4acf('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4acf('0x0')]}};
\ No newline at end of file
index 3217d90..4b02ddb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8707=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','reject','save','update','then','error','name','send','index','map','MailSubstatus','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter'];(function(_0x45583c,_0x45dfe3){var _0x4adb26=function(_0x1e5b3e){while(--_0x1e5b3e){_0x45583c['push'](_0x45583c['shift']());}};_0x4adb26(++_0x45dfe3);}(_0x8707,0xa1));var _0x7870=function(_0x5ac475,_0x669c3){_0x5ac475=_0x5ac475-0x0;var _0x1caba5=_0x8707[_0x5ac475];return _0x1caba5;};'use strict';var emlformat=require(_0x7870('0x0'));var rimraf=require(_0x7870('0x1'));var zipdir=require(_0x7870('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7870('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7870('0x4'));var path=require(_0x7870('0x5'));var sox=require(_0x7870('0x6'));var csv=require(_0x7870('0x7'));var ejs=require(_0x7870('0x8'));var fs=require('fs');var fs_extra=require(_0x7870('0x9'));var _=require(_0x7870('0xa'));var squel=require(_0x7870('0xb'));var crypto=require(_0x7870('0xc'));var jsforce=require(_0x7870('0xd'));var deskjs=require(_0x7870('0xe'));var toCsv=require(_0x7870('0x7'));var querystring=require(_0x7870('0xf'));var Papa=require(_0x7870('0x10'));var Redis=require(_0x7870('0x11'));var authService=require(_0x7870('0x12'));var qs=require(_0x7870('0x13'));var as=require(_0x7870('0x14'));var hardwareService=require(_0x7870('0x15'));var logger=require('../../config/logger')(_0x7870('0x16'));var utils=require(_0x7870('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x7870('0x18'));var db=require(_0x7870('0x19'))['db'];function respondWithStatusCode(_0x330da6,_0x1fa717){_0x1fa717=_0x1fa717||0xcc;return function(_0x2b05e2){if(_0x2b05e2){return _0x330da6[_0x7870('0x1a')](_0x1fa717);}return _0x330da6[_0x7870('0x1b')](_0x1fa717)[_0x7870('0x1c')]();};}function respondWithResult(_0x16e356,_0x5a036a){_0x5a036a=_0x5a036a||0xc8;return function(_0x16a218){if(_0x16a218){return _0x16e356['status'](_0x5a036a)['json'](_0x16a218);}};}function respondWithFilteredResult(_0x3ced68,_0x4d79c8){return function(_0x3b5adb){if(_0x3b5adb){var _0x118f57=typeof _0x4d79c8[_0x7870('0x1d')]===_0x7870('0x1e')&&typeof _0x4d79c8[_0x7870('0x1f')]===_0x7870('0x1e');var _0x32fb14=_0x3b5adb[_0x7870('0x20')];var _0x57a305=_0x118f57?0x0:_0x4d79c8[_0x7870('0x1d')];var _0x31d840=_0x118f57?_0x3b5adb[_0x7870('0x20')]:_0x4d79c8[_0x7870('0x1d')]+_0x4d79c8[_0x7870('0x1f')];var _0x252373;if(_0x31d840>=_0x32fb14){_0x31d840=_0x32fb14;_0x252373=0xc8;}else{_0x252373=0xce;}_0x3ced68[_0x7870('0x1b')](_0x252373);return _0x3ced68['set'](_0x7870('0x21'),_0x57a305+'-'+_0x31d840+'/'+_0x32fb14)['json'](_0x3b5adb);}return null;};}function patchUpdates(_0x2d341f){return function(_0x2b43a6){try{jsonpatch['apply'](_0x2b43a6,_0x2d341f,!![]);}catch(_0x33ab4e){return BPromise[_0x7870('0x22')](_0x33ab4e);}return _0x2b43a6[_0x7870('0x23')]();};}function saveUpdates(_0x586e8e,_0x40eae1){return function(_0x107c57){if(_0x107c57){return _0x107c57[_0x7870('0x24')](_0x586e8e)[_0x7870('0x25')](function(_0x2d2351){return _0x2d2351;});}return null;};}function removeEntity(_0x32dd3d,_0x483051){return function(_0x18ccda){if(_0x18ccda){return _0x18ccda['destroy']()[_0x7870('0x25')](function(){_0x32dd3d[_0x7870('0x1b')](0xcc)[_0x7870('0x1c')]();});}};}function handleEntityNotFound(_0x2c0931,_0x586d8d){return function(_0x1163f){if(!_0x1163f){_0x2c0931[_0x7870('0x1a')](0x194);}return _0x1163f;};}function handleError(_0x5cd2a0,_0x2fc039){_0x2fc039=_0x2fc039||0x1f4;return function(_0x19418a){logger[_0x7870('0x26')](_0x19418a['stack']);if(_0x19418a['name']){delete _0x19418a[_0x7870('0x27')];}_0x5cd2a0[_0x7870('0x1b')](_0x2fc039)[_0x7870('0x28')](_0x19418a);};}exports[_0x7870('0x29')]=function(_0x34d298,_0x356706){var _0x5847c6={},_0x52019a={},_0x10f07e={'count':0x0,'rows':[]};var _0x1f53c5=_[_0x7870('0x2a')](db[_0x7870('0x2b')]['rawAttributes'],function(_0x3aeab3){return{'name':_0x3aeab3['fieldName'],'type':_0x3aeab3[_0x7870('0x2c')]['key']};});_0x52019a[_0x7870('0x2d')]=_[_0x7870('0x2a')](_0x1f53c5,_0x7870('0x27'));_0x52019a[_0x7870('0x2e')]=_['keys'](_0x34d298['query']);_0x52019a[_0x7870('0x2f')]=_[_0x7870('0x30')](_0x52019a[_0x7870('0x2d')],_0x52019a[_0x7870('0x2e')]);_0x5847c6[_0x7870('0x31')]=_[_0x7870('0x30')](_0x52019a['model'],qs[_0x7870('0x32')](_0x34d298['query'][_0x7870('0x32')]));_0x5847c6[_0x7870('0x31')]=_0x5847c6[_0x7870('0x31')][_0x7870('0x33')]?_0x5847c6[_0x7870('0x31')]:_0x52019a['model'];if(!_0x34d298[_0x7870('0x2e')][_0x7870('0x34')](_0x7870('0x35'))){_0x5847c6[_0x7870('0x1f')]=qs[_0x7870('0x1f')](_0x34d298['query']['limit']);_0x5847c6['offset']=qs[_0x7870('0x1d')](_0x34d298[_0x7870('0x2e')][_0x7870('0x1d')]);}_0x5847c6['order']=qs[_0x7870('0x36')](_0x34d298[_0x7870('0x2e')]['sort']);_0x5847c6[_0x7870('0x37')]=qs[_0x7870('0x2f')](_[_0x7870('0x38')](_0x34d298[_0x7870('0x2e')],_0x52019a[_0x7870('0x2f')]),_0x1f53c5);if(_0x34d298[_0x7870('0x2e')][_0x7870('0x39')]){_0x5847c6[_0x7870('0x37')]=_[_0x7870('0x3a')](_0x5847c6[_0x7870('0x37')],{'$or':_['map'](_0x1f53c5,function(_0x54dc16){if(_0x54dc16['type']!==_0x7870('0x3b')){var _0x51f41a={};_0x51f41a[_0x54dc16[_0x7870('0x27')]]={'$like':'%'+_0x34d298[_0x7870('0x2e')][_0x7870('0x39')]+'%'};return _0x51f41a;}})});}_0x5847c6=_[_0x7870('0x3a')]({},_0x5847c6,_0x34d298[_0x7870('0x3c')]);var _0x2379fd={'where':_0x5847c6[_0x7870('0x37')]};return db[_0x7870('0x2b')][_0x7870('0x20')](_0x2379fd)[_0x7870('0x25')](function(_0x2f0d6d){_0x10f07e['count']=_0x2f0d6d;if(_0x34d298[_0x7870('0x2e')][_0x7870('0x3d')]){_0x5847c6[_0x7870('0x3e')]=[{'all':!![]}];}return db[_0x7870('0x2b')][_0x7870('0x3f')](_0x5847c6);})[_0x7870('0x25')](function(_0x5a33db){_0x10f07e[_0x7870('0x40')]=_0x5a33db;return _0x10f07e;})[_0x7870('0x25')](respondWithFilteredResult(_0x356706,_0x5847c6))[_0x7870('0x41')](handleError(_0x356706,null));};exports['show']=function(_0x319674,_0x340458){var _0x2894ee={'raw':!![],'where':{'id':_0x319674[_0x7870('0x42')]['id']}},_0x41efbe={};_0x41efbe[_0x7870('0x2d')]=_[_0x7870('0x43')](db[_0x7870('0x2b')][_0x7870('0x44')]);_0x41efbe[_0x7870('0x2e')]=_[_0x7870('0x43')](_0x319674[_0x7870('0x2e')]);_0x41efbe[_0x7870('0x2f')]=_['intersection'](_0x41efbe[_0x7870('0x2d')],_0x41efbe[_0x7870('0x2e')]);_0x2894ee[_0x7870('0x31')]=_[_0x7870('0x30')](_0x41efbe['model'],qs[_0x7870('0x32')](_0x319674[_0x7870('0x2e')][_0x7870('0x32')]));_0x2894ee[_0x7870('0x31')]=_0x2894ee[_0x7870('0x31')][_0x7870('0x33')]?_0x2894ee[_0x7870('0x31')]:_0x41efbe[_0x7870('0x2d')];if(_0x319674[_0x7870('0x2e')][_0x7870('0x3d')]){_0x2894ee[_0x7870('0x3e')]=[{'all':!![]}];}_0x2894ee=_[_0x7870('0x3a')]({},_0x2894ee,_0x319674['options']);return db[_0x7870('0x2b')][_0x7870('0x45')](_0x2894ee)[_0x7870('0x25')](handleEntityNotFound(_0x340458,null))[_0x7870('0x25')](respondWithResult(_0x340458,null))[_0x7870('0x41')](handleError(_0x340458,null));};exports[_0x7870('0x46')]=function(_0x2693fb,_0x3beb73){return db[_0x7870('0x2b')][_0x7870('0x46')](_0x2693fb[_0x7870('0x47')],{})[_0x7870('0x25')](respondWithResult(_0x3beb73,0xc9))[_0x7870('0x41')](handleError(_0x3beb73,null));};exports[_0x7870('0x24')]=function(_0x111f6e,_0x173ea7){if(_0x111f6e[_0x7870('0x47')]['id']){delete _0x111f6e[_0x7870('0x47')]['id'];}return db[_0x7870('0x2b')][_0x7870('0x45')]({'where':{'id':_0x111f6e['params']['id']}})[_0x7870('0x25')](handleEntityNotFound(_0x173ea7,null))[_0x7870('0x25')](saveUpdates(_0x111f6e[_0x7870('0x47')],null))['then'](respondWithResult(_0x173ea7,null))[_0x7870('0x41')](handleError(_0x173ea7,null));};exports['destroy']=function(_0x3d2352,_0x17f337){return db[_0x7870('0x2b')][_0x7870('0x45')]({'where':{'id':_0x3d2352['params']['id']}})[_0x7870('0x25')](handleEntityNotFound(_0x17f337,null))[_0x7870('0x25')](removeEntity(_0x17f337,null))[_0x7870('0x41')](handleError(_0x17f337,null));};exports[_0x7870('0x48')]=function(_0x194eac,_0x350c6e){return db[_0x7870('0x2b')]['describe']()[_0x7870('0x25')](respondWithResult(_0x350c6e,null))[_0x7870('0x41')](handleError(_0x350c6e,null));};
\ No newline at end of file
+var _0xc79a=['hasOwnProperty','nolimit','offset','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','rows','catch','show','params','keys','fields','options','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','json','apply','reject','save','update','then','destroy','name','send','index','map','MailSubstatus','fieldName','type','key','model','query','filters','intersection','attributes','length'];(function(_0x195a53,_0x24f149){var _0x283883=function(_0x4d9408){while(--_0x4d9408){_0x195a53['push'](_0x195a53['shift']());}};_0x283883(++_0x24f149);}(_0xc79a,0x183));var _0xac79=function(_0xbf99dd,_0x255ca3){_0xbf99dd=_0xbf99dd-0x0;var _0x3f173d=_0xc79a[_0xbf99dd];return _0x3f173d;};'use strict';var emlformat=require(_0xac79('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xac79('0x1'));var jsonpatch=require(_0xac79('0x2'));var rp=require(_0xac79('0x3'));var moment=require('moment');var BPromise=require(_0xac79('0x4'));var Mustache=require(_0xac79('0x5'));var util=require(_0xac79('0x6'));var path=require(_0xac79('0x7'));var sox=require('sox');var csv=require(_0xac79('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xac79('0x9'));var _=require(_0xac79('0xa'));var squel=require(_0xac79('0xb'));var crypto=require(_0xac79('0xc'));var jsforce=require(_0xac79('0xd'));var deskjs=require(_0xac79('0xe'));var toCsv=require(_0xac79('0x8'));var querystring=require(_0xac79('0xf'));var Papa=require('papaparse');var Redis=require(_0xac79('0x10'));var authService=require(_0xac79('0x11'));var qs=require(_0xac79('0x12'));var as=require(_0xac79('0x13'));var hardwareService=require(_0xac79('0x14'));var logger=require(_0xac79('0x15'))('api');var utils=require(_0xac79('0x16'));var config=require(_0xac79('0x17'));var licenseUtil=require(_0xac79('0x18'));var db=require(_0xac79('0x19'))['db'];function respondWithStatusCode(_0x32d3c7,_0xd872ba){_0xd872ba=_0xd872ba||0xcc;return function(_0x1e7796){if(_0x1e7796){return _0x32d3c7[_0xac79('0x1a')](_0xd872ba);}return _0x32d3c7[_0xac79('0x1b')](_0xd872ba)[_0xac79('0x1c')]();};}function respondWithResult(_0x2148a9,_0x3762b7){_0x3762b7=_0x3762b7||0xc8;return function(_0x35dbaa){if(_0x35dbaa){return _0x2148a9[_0xac79('0x1b')](_0x3762b7)['json'](_0x35dbaa);}};}function respondWithFilteredResult(_0x4d8522,_0x5e1d5d){return function(_0x767c36){if(_0x767c36){var _0x1fb754=typeof _0x5e1d5d['offset']==='undefined'&&typeof _0x5e1d5d[_0xac79('0x1d')]==='undefined';var _0x32b811=_0x767c36['count'];var _0x2a57ad=_0x1fb754?0x0:_0x5e1d5d['offset'];var _0x24a916=_0x1fb754?_0x767c36['count']:_0x5e1d5d['offset']+_0x5e1d5d[_0xac79('0x1d')];var _0x3599a8;if(_0x24a916>=_0x32b811){_0x24a916=_0x32b811;_0x3599a8=0xc8;}else{_0x3599a8=0xce;}_0x4d8522['status'](_0x3599a8);return _0x4d8522['set']('Content-Range',_0x2a57ad+'-'+_0x24a916+'/'+_0x32b811)[_0xac79('0x1e')](_0x767c36);}return null;};}function patchUpdates(_0x1e9e26){return function(_0x10d09b){try{jsonpatch[_0xac79('0x1f')](_0x10d09b,_0x1e9e26,!![]);}catch(_0x5acac7){return BPromise[_0xac79('0x20')](_0x5acac7);}return _0x10d09b[_0xac79('0x21')]();};}function saveUpdates(_0x3dcbed,_0x1f1f98){return function(_0x5c5516){if(_0x5c5516){return _0x5c5516[_0xac79('0x22')](_0x3dcbed)[_0xac79('0x23')](function(_0xd47e98){return _0xd47e98;});}return null;};}function removeEntity(_0x5a886e,_0x219398){return function(_0x4cb99d){if(_0x4cb99d){return _0x4cb99d[_0xac79('0x24')]()[_0xac79('0x23')](function(){_0x5a886e[_0xac79('0x1b')](0xcc)[_0xac79('0x1c')]();});}};}function handleEntityNotFound(_0x23511a,_0x4ae9e3){return function(_0x446b36){if(!_0x446b36){_0x23511a[_0xac79('0x1a')](0x194);}return _0x446b36;};}function handleError(_0x24cf79,_0x2aabfa){_0x2aabfa=_0x2aabfa||0x1f4;return function(_0x4d0aa0){logger['error'](_0x4d0aa0['stack']);if(_0x4d0aa0[_0xac79('0x25')]){delete _0x4d0aa0[_0xac79('0x25')];}_0x24cf79[_0xac79('0x1b')](_0x2aabfa)[_0xac79('0x26')](_0x4d0aa0);};}exports[_0xac79('0x27')]=function(_0x25b00d,_0x335d6f){var _0x6d0273={},_0xca05e4={},_0xf4e8a7={'count':0x0,'rows':[]};var _0x595669=_[_0xac79('0x28')](db[_0xac79('0x29')]['rawAttributes'],function(_0x6c6311){return{'name':_0x6c6311[_0xac79('0x2a')],'type':_0x6c6311[_0xac79('0x2b')][_0xac79('0x2c')]};});_0xca05e4[_0xac79('0x2d')]=_['map'](_0x595669,_0xac79('0x25'));_0xca05e4['query']=_['keys'](_0x25b00d[_0xac79('0x2e')]);_0xca05e4[_0xac79('0x2f')]=_[_0xac79('0x30')](_0xca05e4[_0xac79('0x2d')],_0xca05e4[_0xac79('0x2e')]);_0x6d0273[_0xac79('0x31')]=_[_0xac79('0x30')](_0xca05e4['model'],qs['fields'](_0x25b00d[_0xac79('0x2e')]['fields']));_0x6d0273[_0xac79('0x31')]=_0x6d0273['attributes'][_0xac79('0x32')]?_0x6d0273[_0xac79('0x31')]:_0xca05e4[_0xac79('0x2d')];if(!_0x25b00d['query'][_0xac79('0x33')](_0xac79('0x34'))){_0x6d0273[_0xac79('0x1d')]=qs[_0xac79('0x1d')](_0x25b00d['query'][_0xac79('0x1d')]);_0x6d0273[_0xac79('0x35')]=qs[_0xac79('0x35')](_0x25b00d[_0xac79('0x2e')][_0xac79('0x35')]);}_0x6d0273['order']=qs[_0xac79('0x36')](_0x25b00d[_0xac79('0x2e')][_0xac79('0x36')]);_0x6d0273[_0xac79('0x37')]=qs[_0xac79('0x2f')](_[_0xac79('0x38')](_0x25b00d[_0xac79('0x2e')],_0xca05e4['filters']),_0x595669);if(_0x25b00d[_0xac79('0x2e')][_0xac79('0x39')]){_0x6d0273[_0xac79('0x37')]=_[_0xac79('0x3a')](_0x6d0273['where'],{'$or':_['map'](_0x595669,function(_0xab06f8){if(_0xab06f8[_0xac79('0x2b')]!==_0xac79('0x3b')){var _0x5e1645={};_0x5e1645[_0xab06f8['name']]={'$like':'%'+_0x25b00d[_0xac79('0x2e')]['filter']+'%'};return _0x5e1645;}})});}_0x6d0273=_[_0xac79('0x3a')]({},_0x6d0273,_0x25b00d['options']);var _0x40a9f9={'where':_0x6d0273['where']};return db[_0xac79('0x29')][_0xac79('0x3c')](_0x40a9f9)['then'](function(_0x6bb287){_0xf4e8a7[_0xac79('0x3c')]=_0x6bb287;if(_0x25b00d[_0xac79('0x2e')][_0xac79('0x3d')]){_0x6d0273[_0xac79('0x3e')]=[{'all':!![]}];}return db[_0xac79('0x29')]['findAll'](_0x6d0273);})[_0xac79('0x23')](function(_0x300ae7){_0xf4e8a7[_0xac79('0x3f')]=_0x300ae7;return _0xf4e8a7;})[_0xac79('0x23')](respondWithFilteredResult(_0x335d6f,_0x6d0273))[_0xac79('0x40')](handleError(_0x335d6f,null));};exports[_0xac79('0x41')]=function(_0x3229e2,_0x3560bb){var _0x403c74={'raw':!![],'where':{'id':_0x3229e2[_0xac79('0x42')]['id']}},_0x5d70cd={};_0x5d70cd[_0xac79('0x2d')]=_[_0xac79('0x43')](db[_0xac79('0x29')]['rawAttributes']);_0x5d70cd[_0xac79('0x2e')]=_[_0xac79('0x43')](_0x3229e2[_0xac79('0x2e')]);_0x5d70cd['filters']=_[_0xac79('0x30')](_0x5d70cd['model'],_0x5d70cd[_0xac79('0x2e')]);_0x403c74['attributes']=_[_0xac79('0x30')](_0x5d70cd['model'],qs['fields'](_0x3229e2['query'][_0xac79('0x44')]));_0x403c74[_0xac79('0x31')]=_0x403c74[_0xac79('0x31')][_0xac79('0x32')]?_0x403c74['attributes']:_0x5d70cd['model'];if(_0x3229e2[_0xac79('0x2e')]['includeAll']){_0x403c74[_0xac79('0x3e')]=[{'all':!![]}];}_0x403c74=_[_0xac79('0x3a')]({},_0x403c74,_0x3229e2[_0xac79('0x45')]);return db['MailSubstatus'][_0xac79('0x46')](_0x403c74)[_0xac79('0x23')](handleEntityNotFound(_0x3560bb,null))[_0xac79('0x23')](respondWithResult(_0x3560bb,null))['catch'](handleError(_0x3560bb,null));};exports[_0xac79('0x47')]=function(_0x6e73b2,_0x392d40){return db[_0xac79('0x29')]['create'](_0x6e73b2[_0xac79('0x48')],{})[_0xac79('0x23')](respondWithResult(_0x392d40,0xc9))[_0xac79('0x40')](handleError(_0x392d40,null));};exports[_0xac79('0x22')]=function(_0x10d7e1,_0x58b551){if(_0x10d7e1[_0xac79('0x48')]['id']){delete _0x10d7e1[_0xac79('0x48')]['id'];}return db['MailSubstatus']['find']({'where':{'id':_0x10d7e1[_0xac79('0x42')]['id']}})[_0xac79('0x23')](handleEntityNotFound(_0x58b551,null))[_0xac79('0x23')](saveUpdates(_0x10d7e1[_0xac79('0x48')],null))[_0xac79('0x23')](respondWithResult(_0x58b551,null))['catch'](handleError(_0x58b551,null));};exports[_0xac79('0x24')]=function(_0xf992d4,_0x420fdf){return db['MailSubstatus']['find']({'where':{'id':_0xf992d4[_0xac79('0x42')]['id']}})['then'](handleEntityNotFound(_0x420fdf,null))[_0xac79('0x23')](removeEntity(_0x420fdf,null))['catch'](handleError(_0x420fdf,null));};exports['describe']=function(_0x37c059,_0x606f2a){return db[_0xac79('0x29')]['describe']()[_0xac79('0x23')](respondWithResult(_0x606f2a,null))[_0xac79('0x40')](handleError(_0x606f2a,null));};
\ No newline at end of file
index 36bea07..20574b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x709d=['events','../../mysqldb','update','emit','hasOwnProperty'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x709d,0x122));var _0xd709=function(_0x4b4da7,_0x34ea60){_0x4b4da7=_0x4b4da7-0x0;var _0x29b00e=_0x709d[_0x4b4da7];return _0x29b00e;};'use strict';var EventEmitter=require(_0xd709('0x0'));var MailSubstatus=require(_0xd709('0x1'))['db']['MailSubstatus'];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0xd709('0x2')};function emitEvent(_0x5131e8){return function(_0x2828fd,_0x14e202,_0xf55c0c){MailSubstatusEvents['emit'](_0x5131e8+':'+_0x2828fd['id'],_0x2828fd);MailSubstatusEvents[_0xd709('0x3')](_0x5131e8,_0x2828fd);_0xf55c0c(null);};}for(var e in events){if(events[_0xd709('0x4')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module['exports']=MailSubstatusEvents;
\ No newline at end of file
+var _0xe5b6=['MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x32b5da,_0x45d994){var _0x1304ab=function(_0x30b6e6){while(--_0x30b6e6){_0x32b5da['push'](_0x32b5da['shift']());}};_0x1304ab(++_0x45d994);}(_0xe5b6,0x16e));var _0x6e5b=function(_0x57b9cb,_0xce24ed){_0x57b9cb=_0x57b9cb-0x0;var _0x1ee317=_0xe5b6[_0x57b9cb];return _0x1ee317;};'use strict';var EventEmitter=require(_0x6e5b('0x0'));var MailSubstatus=require(_0x6e5b('0x1'))['db'][_0x6e5b('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x6e5b('0x3')](0x0);var events={'afterUpdate':_0x6e5b('0x4')};function emitEvent(_0x386bfd){return function(_0x3bee65,_0x3b5e1c,_0x30d9de){MailSubstatusEvents[_0x6e5b('0x5')](_0x386bfd+':'+_0x3bee65['id'],_0x3bee65);MailSubstatusEvents[_0x6e5b('0x5')](_0x386bfd,_0x3bee65);_0x30d9de(null);};}for(var e in events){if(events[_0x6e5b('0x6')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module[_0x6e5b('0x7')]=MailSubstatusEvents;
\ No newline at end of file
index be41fce..5cccadb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9d44=['then','catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses','Condition','update','mailSubstatus','_previousDataValues','name'];(function(_0x12b1c2,_0x2bb3ab){var _0x30c2ed=function(_0xf1d5dd){while(--_0xf1d5dd){_0x12b1c2['push'](_0x12b1c2['shift']());}};_0x30c2ed(++_0x2bb3ab);}(_0x9d44,0x1af));var _0x49d4=function(_0x421791,_0x3625d8){_0x421791=_0x421791-0x0;var _0x495838=_0x9d44[_0x421791];return _0x495838;};'use strict';var attributes=require(_0x49d4('0x0'));module[_0x49d4('0x1')]=function(_0x2d4b23){var _0x259700=_0x2d4b23[_0x49d4('0x2')];return _0x2d4b23[_0x49d4('0x3')](_0x49d4('0x4'),attributes,{'tableName':_0x49d4('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x247382,_0x686b51,_0x3827ca){return _0x259700[_0x49d4('0x6')][_0x49d4('0x7')]({'value':_0x247382['name']},{'where':{'field':_0x49d4('0x8'),'value':_0x247382[_0x49d4('0x9')][_0x49d4('0xa')]}})[_0x49d4('0xb')](function(){_0x3827ca();})[_0x49d4('0xc')](function(_0x9b09de){_0x3827ca(_0x9b09de);});}}});};
\ No newline at end of file
+var _0xc7aa=['exports','models','define','Condition','mailSubstatus','name','then','catch'];(function(_0x2197c1,_0x5d09a5){var _0x438d1e=function(_0x184bcd){while(--_0x184bcd){_0x2197c1['push'](_0x2197c1['shift']());}};_0x438d1e(++_0x5d09a5);}(_0xc7aa,0xf8));var _0xac7a=function(_0x3f2ba1,_0x2b9e9f){_0x3f2ba1=_0x3f2ba1-0x0;var _0x901200=_0xc7aa[_0x3f2ba1];return _0x901200;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0xac7a('0x0')]=function(_0x2e5007){var _0x1e5cdf=_0x2e5007[_0xac7a('0x1')];return _0x2e5007[_0xac7a('0x2')]('MailSubstatus',attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x4a5730,_0x1de389,_0x1d79f7){return _0x1e5cdf[_0xac7a('0x3')]['update']({'value':_0x4a5730['name']},{'where':{'field':_0xac7a('0x4'),'value':_0x4a5730['_previousDataValues'][_0xac7a('0x5')]}})[_0xac7a('0x6')](function(){_0x1d79f7();})[_0xac7a('0x7')](function(_0x3717a1){_0x1d79f7(_0x3717a1);});}}});};
\ No newline at end of file
index fd9e2ff..f1f0b7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6935=['client','http','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1892f6,_0x2b1675){var _0x5dc2b9=function(_0x2a6711){while(--_0x2a6711){_0x1892f6['push'](_0x1892f6['shift']());}};_0x5dc2b9(++_0x2b1675);}(_0x6935,0x1c5));var _0x5693=function(_0x3bda74,_0x138905){_0x3bda74=_0x3bda74-0x0;var _0x1de48a=_0x6935[_0x3bda74];return _0x1de48a;};'use strict';var _=require(_0x5693('0x0'));var util=require(_0x5693('0x1'));var moment=require(_0x5693('0x2'));var BPromise=require(_0x5693('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5693('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5693('0x5'));var logger=require(_0x5693('0x6'))(_0x5693('0x7'));var config=require(_0x5693('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5693('0x9')][_0x5693('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x42c296,_0x36fb31,_0x12d7be){return new BPromise(function(_0x1e9483,_0x479543){return client['request'](_0x42c296,_0x12d7be)[_0x5693('0xb')](function(_0x535233){logger[_0x5693('0xc')](_0x5693('0xd'),_0x36fb31,_0x5693('0xe'));logger[_0x5693('0xf')](_0x5693('0x10'),_0x36fb31,_0x5693('0xe'),JSON[_0x5693('0x11')](_0x535233));if(_0x535233['error']){if(_0x535233[_0x5693('0x12')][_0x5693('0x13')]===0x1f4){logger[_0x5693('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x36fb31,_0x535233[_0x5693('0x12')][_0x5693('0x14')]);return _0x479543(_0x535233[_0x5693('0x12')][_0x5693('0x14')]);}logger[_0x5693('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x36fb31,_0x535233['error']['message']);return _0x1e9483(_0x535233[_0x5693('0x12')]['message']);}else{logger[_0x5693('0xc')](_0x5693('0xd'),_0x36fb31,_0x5693('0xe'));_0x1e9483(_0x535233[_0x5693('0x15')]['message']);}})['catch'](function(_0x4d75ee){logger[_0x5693('0x12')](_0x5693('0xd'),_0x36fb31,_0x4d75ee);_0x479543(_0x4d75ee);});});}
\ No newline at end of file
+var _0xb9ce=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x55d58f,_0x2bea83){var _0x1ad6e6=function(_0x31447e){while(--_0x31447e){_0x55d58f['push'](_0x55d58f['shift']());}};_0x1ad6e6(++_0x2bea83);}(_0xb9ce,0x188));var _0xeb9c=function(_0x229c60,_0x18c31e){_0x229c60=_0x229c60-0x0;var _0x9f154e=_0xb9ce[_0x229c60];return _0x9f154e;};'use strict';var _=require(_0xeb9c('0x0'));var util=require(_0xeb9c('0x1'));var moment=require(_0xeb9c('0x2'));var BPromise=require(_0xeb9c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb9c('0x4'));var db=require(_0xeb9c('0x5'))['db'];var utils=require(_0xeb9c('0x6'));var logger=require(_0xeb9c('0x7'))('rpc');var config=require(_0xeb9c('0x8'));var jayson=require(_0xeb9c('0x9'));var client=jayson[_0xeb9c('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30de88,_0x396c1a,_0x110135){return new BPromise(function(_0x1e8cd6,_0x3fc487){return client[_0xeb9c('0xb')](_0x30de88,_0x110135)[_0xeb9c('0xc')](function(_0x7b66ff){logger[_0xeb9c('0xd')](_0xeb9c('0xe'),_0x396c1a,_0xeb9c('0xf'));logger['debug']('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x396c1a,'request\x20sent',JSON[_0xeb9c('0x10')](_0x7b66ff));if(_0x7b66ff['error']){if(_0x7b66ff[_0xeb9c('0x11')][_0xeb9c('0x12')]===0x1f4){logger[_0xeb9c('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x396c1a,_0x7b66ff['error'][_0xeb9c('0x13')]);return _0x3fc487(_0x7b66ff[_0xeb9c('0x11')][_0xeb9c('0x13')]);}logger[_0xeb9c('0x11')](_0xeb9c('0xe'),_0x396c1a,_0x7b66ff['error']['message']);return _0x1e8cd6(_0x7b66ff[_0xeb9c('0x11')]['message']);}else{logger['info'](_0xeb9c('0xe'),_0x396c1a,'request\x20sent');_0x1e8cd6(_0x7b66ff[_0xeb9c('0x14')][_0xeb9c('0x13')]);}})[_0xeb9c('0x15')](function(_0x8f3049){logger[_0xeb9c('0x11')](_0xeb9c('0xe'),_0x396c1a,_0x8f3049);_0x3fc487(_0x8f3049);});});}
\ No newline at end of file
index aafece6..4fb3e97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x08f0=['get','isAuthenticated','index','describe','/:id','post','create','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x463d36,_0x407ae7){var _0x454c7c=function(_0x3565e5){while(--_0x3565e5){_0x463d36['push'](_0x463d36['shift']());}};_0x454c7c(++_0x407ae7);}(_0x08f0,0x19b));var _0x008f=function(_0x477b98,_0x8e913){_0x477b98=_0x477b98-0x0;var _0x2f5ce5=_0x08f0[_0x477b98];return _0x2f5ce5;};'use strict';var multer=require(_0x008f('0x0'));var util=require(_0x008f('0x1'));var path=require(_0x008f('0x2'));var timeout=require('connect-timeout');var express=require(_0x008f('0x3'));var router=express[_0x008f('0x4')]();var fs_extra=require(_0x008f('0x5'));var auth=require(_0x008f('0x6'));var interaction=require(_0x008f('0x7'));var config=require(_0x008f('0x8'));var controller=require('./mailTransferReport.controller');router[_0x008f('0x9')]('/',auth[_0x008f('0xa')](),controller[_0x008f('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x008f('0xc')]);router[_0x008f('0x9')](_0x008f('0xd'),auth[_0x008f('0xa')](),controller['show']);router[_0x008f('0xe')]('/',auth[_0x008f('0xa')](),controller[_0x008f('0xf')]);router['put'](_0x008f('0xd'),auth[_0x008f('0xa')](),controller[_0x008f('0x10')]);router[_0x008f('0x11')](_0x008f('0xd'),auth['isAuthenticated'](),controller[_0x008f('0x12')]);module[_0x008f('0x13')]=router;
\ No newline at end of file
+var _0x646e=['index','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x450076,_0x10983b){var _0x2029cc=function(_0x4a5e76){while(--_0x4a5e76){_0x450076['push'](_0x450076['shift']());}};_0x2029cc(++_0x10983b);}(_0x646e,0x1c3));var _0xe646=function(_0x379274,_0x1cc88f){_0x379274=_0x379274-0x0;var _0xfebf80=_0x646e[_0x379274];return _0xfebf80;};'use strict';var multer=require(_0xe646('0x0'));var util=require(_0xe646('0x1'));var path=require(_0xe646('0x2'));var timeout=require(_0xe646('0x3'));var express=require(_0xe646('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe646('0x5'));var interaction=require(_0xe646('0x6'));var config=require(_0xe646('0x7'));var controller=require('./mailTransferReport.controller');router[_0xe646('0x8')]('/',auth['isAuthenticated'](),controller[_0xe646('0x9')]);router['get']('/describe',auth[_0xe646('0xa')](),controller[_0xe646('0xb')]);router[_0xe646('0x8')](_0xe646('0xc'),auth['isAuthenticated'](),controller[_0xe646('0xd')]);router[_0xe646('0xe')]('/',auth[_0xe646('0xa')](),controller[_0xe646('0xf')]);router[_0xe646('0x10')](_0xe646('0xc'),auth[_0xe646('0xa')](),controller[_0xe646('0x11')]);router[_0xe646('0x12')](_0xe646('0xc'),auth[_0xe646('0xa')](),controller[_0xe646('0x13')]);module['exports']=router;
\ No newline at end of file
index 49eaddc..4bf85d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x3bcf7e,_0x130804){var _0x4f7684=function(_0xdd51d4){while(--_0xdd51d4){_0x3bcf7e['push'](_0x3bcf7e['shift']());}};_0x4f7684(++_0x130804);}(_0xf4eb,0xec));var _0xbf4e=function(_0x449f60,_0x55787b){_0x449f60=_0x449f60-0x0;var _0x2dde9e=_0xf4eb[_0x449f60];return _0x2dde9e;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
+var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x3e0763,_0x3d12be){var _0x351ca2=function(_0x9beae7){while(--_0x9beae7){_0x3e0763['push'](_0x3e0763['shift']());}};_0x351ca2(++_0x3d12be);}(_0x9bde,0xe1));var _0xe9bd=function(_0x8b2a44,_0x3cf633){_0x8b2a44=_0x8b2a44-0x0;var _0x384a70=_0x9bde[_0x8b2a44];return _0x384a70;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
index e85c0a8..2e2556e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9753=['create','body','catch','destroy','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','crypto','to-csv','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','limit','Content-Range','apply','save','update','then','name','send','index','map','MailTransferReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','where','filter','merge','options','includeAll','findAll','rows','show','params','include','find'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x9753,0x1af));var _0x3975=function(_0x3407be,_0x3ad78b){_0x3407be=_0x3407be-0x0;var _0x1743e2=_0x9753[_0x3407be];return _0x1743e2;};'use strict';var emlformat=require(_0x3975('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3975('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3975('0x2'));var moment=require(_0x3975('0x3'));var BPromise=require(_0x3975('0x4'));var Mustache=require(_0x3975('0x5'));var util=require(_0x3975('0x6'));var path=require('path');var sox=require(_0x3975('0x7'));var csv=require('to-csv');var ejs=require(_0x3975('0x8'));var fs=require('fs');var fs_extra=require(_0x3975('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3975('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3975('0xb'));var querystring=require('querystring');var Papa=require(_0x3975('0xc'));var Redis=require(_0x3975('0xd'));var authService=require(_0x3975('0xe'));var qs=require(_0x3975('0xf'));var as=require(_0x3975('0x10'));var hardwareService=require(_0x3975('0x11'));var logger=require(_0x3975('0x12'))(_0x3975('0x13'));var utils=require(_0x3975('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3975('0x15'));var db=require(_0x3975('0x16'))['db'];function respondWithStatusCode(_0x1c566c,_0x59e48d){_0x59e48d=_0x59e48d||0xcc;return function(_0x5347fc){if(_0x5347fc){return _0x1c566c[_0x3975('0x17')](_0x59e48d);}return _0x1c566c[_0x3975('0x18')](_0x59e48d)[_0x3975('0x19')]();};}function respondWithResult(_0x2408f0,_0x1c1bb2){_0x1c1bb2=_0x1c1bb2||0xc8;return function(_0x48140a){if(_0x48140a){return _0x2408f0[_0x3975('0x18')](_0x1c1bb2)[_0x3975('0x1a')](_0x48140a);}};}function respondWithFilteredResult(_0x2685c9,_0x30cc67){return function(_0x3c985d){if(_0x3c985d){var _0x49adda=typeof _0x30cc67[_0x3975('0x1b')]===_0x3975('0x1c')&&typeof _0x30cc67['limit']===_0x3975('0x1c');var _0x4fa085=_0x3c985d[_0x3975('0x1d')];var _0x330443=_0x49adda?0x0:_0x30cc67[_0x3975('0x1b')];var _0x7cc97a=_0x49adda?_0x3c985d['count']:_0x30cc67[_0x3975('0x1b')]+_0x30cc67[_0x3975('0x1e')];var _0x232939;if(_0x7cc97a>=_0x4fa085){_0x7cc97a=_0x4fa085;_0x232939=0xc8;}else{_0x232939=0xce;}_0x2685c9['status'](_0x232939);return _0x2685c9['set'](_0x3975('0x1f'),_0x330443+'-'+_0x7cc97a+'/'+_0x4fa085)[_0x3975('0x1a')](_0x3c985d);}return null;};}function patchUpdates(_0x32193e){return function(_0x2ff303){try{jsonpatch[_0x3975('0x20')](_0x2ff303,_0x32193e,!![]);}catch(_0x38064d){return BPromise['reject'](_0x38064d);}return _0x2ff303[_0x3975('0x21')]();};}function saveUpdates(_0x2147d7,_0xd0088a){return function(_0x5d42b2){if(_0x5d42b2){return _0x5d42b2[_0x3975('0x22')](_0x2147d7)[_0x3975('0x23')](function(_0xec0eb7){return _0xec0eb7;});}return null;};}function removeEntity(_0x312a57,_0x53e8e6){return function(_0x3178cb){if(_0x3178cb){return _0x3178cb['destroy']()[_0x3975('0x23')](function(){_0x312a57[_0x3975('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57c197,_0x133eea){return function(_0x170335){if(!_0x170335){_0x57c197[_0x3975('0x17')](0x194);}return _0x170335;};}function handleError(_0x244bb0,_0x58ef68){_0x58ef68=_0x58ef68||0x1f4;return function(_0x559f19){logger['error'](_0x559f19['stack']);if(_0x559f19['name']){delete _0x559f19[_0x3975('0x24')];}_0x244bb0[_0x3975('0x18')](_0x58ef68)[_0x3975('0x25')](_0x559f19);};}exports[_0x3975('0x26')]=function(_0x364ada,_0x1cfa59){var _0x11238b={},_0x43ae16={},_0x445d17={'count':0x0,'rows':[]};var _0x5e270c=_[_0x3975('0x27')](db[_0x3975('0x28')][_0x3975('0x29')],function(_0x525960){return{'name':_0x525960[_0x3975('0x2a')],'type':_0x525960[_0x3975('0x2b')][_0x3975('0x2c')]};});_0x43ae16[_0x3975('0x2d')]=_[_0x3975('0x27')](_0x5e270c,_0x3975('0x24'));_0x43ae16['query']=_[_0x3975('0x2e')](_0x364ada[_0x3975('0x2f')]);_0x43ae16[_0x3975('0x30')]=_[_0x3975('0x31')](_0x43ae16[_0x3975('0x2d')],_0x43ae16[_0x3975('0x2f')]);_0x11238b[_0x3975('0x32')]=_[_0x3975('0x31')](_0x43ae16[_0x3975('0x2d')],qs[_0x3975('0x33')](_0x364ada['query'][_0x3975('0x33')]));_0x11238b[_0x3975('0x32')]=_0x11238b['attributes'][_0x3975('0x34')]?_0x11238b[_0x3975('0x32')]:_0x43ae16[_0x3975('0x2d')];if(!_0x364ada[_0x3975('0x2f')]['hasOwnProperty'](_0x3975('0x35'))){_0x11238b['limit']=qs[_0x3975('0x1e')](_0x364ada[_0x3975('0x2f')][_0x3975('0x1e')]);_0x11238b[_0x3975('0x1b')]=qs[_0x3975('0x1b')](_0x364ada[_0x3975('0x2f')]['offset']);}_0x11238b[_0x3975('0x36')]=qs['sort'](_0x364ada['query']['sort']);_0x11238b[_0x3975('0x37')]=qs[_0x3975('0x30')](_['pick'](_0x364ada[_0x3975('0x2f')],_0x43ae16[_0x3975('0x30')]),_0x5e270c);if(_0x364ada[_0x3975('0x2f')][_0x3975('0x38')]){_0x11238b['where']=_[_0x3975('0x39')](_0x11238b[_0x3975('0x37')],{'$or':_['map'](_0x5e270c,function(_0x27b4f3){if(_0x27b4f3[_0x3975('0x2b')]!=='VIRTUAL'){var _0x18b599={};_0x18b599[_0x27b4f3[_0x3975('0x24')]]={'$like':'%'+_0x364ada[_0x3975('0x2f')][_0x3975('0x38')]+'%'};return _0x18b599;}})});}_0x11238b=_[_0x3975('0x39')]({},_0x11238b,_0x364ada[_0x3975('0x3a')]);var _0x518a28={'where':_0x11238b[_0x3975('0x37')]};return db[_0x3975('0x28')][_0x3975('0x1d')](_0x518a28)[_0x3975('0x23')](function(_0x4d5dfe){_0x445d17[_0x3975('0x1d')]=_0x4d5dfe;if(_0x364ada[_0x3975('0x2f')][_0x3975('0x3b')]){_0x11238b['include']=[{'all':!![]}];}return db['MailTransferReport'][_0x3975('0x3c')](_0x11238b);})[_0x3975('0x23')](function(_0x559065){_0x445d17[_0x3975('0x3d')]=_0x559065;return _0x445d17;})[_0x3975('0x23')](respondWithFilteredResult(_0x1cfa59,_0x11238b))['catch'](handleError(_0x1cfa59,null));};exports[_0x3975('0x3e')]=function(_0xb08160,_0x857ef2){var _0x41f5ef={'raw':!![],'where':{'id':_0xb08160[_0x3975('0x3f')]['id']}},_0x442530={};_0x442530[_0x3975('0x2d')]=_[_0x3975('0x2e')](db['MailTransferReport'][_0x3975('0x29')]);_0x442530[_0x3975('0x2f')]=_[_0x3975('0x2e')](_0xb08160[_0x3975('0x2f')]);_0x442530[_0x3975('0x30')]=_[_0x3975('0x31')](_0x442530[_0x3975('0x2d')],_0x442530[_0x3975('0x2f')]);_0x41f5ef[_0x3975('0x32')]=_['intersection'](_0x442530['model'],qs[_0x3975('0x33')](_0xb08160[_0x3975('0x2f')][_0x3975('0x33')]));_0x41f5ef['attributes']=_0x41f5ef['attributes'][_0x3975('0x34')]?_0x41f5ef[_0x3975('0x32')]:_0x442530['model'];if(_0xb08160[_0x3975('0x2f')][_0x3975('0x3b')]){_0x41f5ef[_0x3975('0x40')]=[{'all':!![]}];}_0x41f5ef=_[_0x3975('0x39')]({},_0x41f5ef,_0xb08160['options']);return db[_0x3975('0x28')][_0x3975('0x41')](_0x41f5ef)[_0x3975('0x23')](handleEntityNotFound(_0x857ef2,null))[_0x3975('0x23')](respondWithResult(_0x857ef2,null))['catch'](handleError(_0x857ef2,null));};exports[_0x3975('0x42')]=function(_0x530bb4,_0x506e7e){return db[_0x3975('0x28')][_0x3975('0x42')](_0x530bb4[_0x3975('0x43')],{})[_0x3975('0x23')](respondWithResult(_0x506e7e,0xc9))[_0x3975('0x44')](handleError(_0x506e7e,null));};exports[_0x3975('0x22')]=function(_0x18bd81,_0x32ca7c){if(_0x18bd81[_0x3975('0x43')]['id']){delete _0x18bd81[_0x3975('0x43')]['id'];}return db[_0x3975('0x28')]['find']({'where':{'id':_0x18bd81[_0x3975('0x3f')]['id']}})['then'](handleEntityNotFound(_0x32ca7c,null))[_0x3975('0x23')](saveUpdates(_0x18bd81[_0x3975('0x43')],null))[_0x3975('0x23')](respondWithResult(_0x32ca7c,null))['catch'](handleError(_0x32ca7c,null));};exports[_0x3975('0x45')]=function(_0x3ce8d4,_0x59be87){return db[_0x3975('0x28')][_0x3975('0x41')]({'where':{'id':_0x3ce8d4[_0x3975('0x3f')]['id']}})[_0x3975('0x23')](handleEntityNotFound(_0x59be87,null))[_0x3975('0x23')](removeEntity(_0x59be87,null))[_0x3975('0x44')](handleError(_0x59be87,null));};exports[_0x3975('0x46')]=function(_0x4bfcd3,_0x5b65ab){return db[_0x3975('0x28')][_0x3975('0x46')]()[_0x3975('0x23')](respondWithResult(_0x5b65ab,null))[_0x3975('0x44')](handleError(_0x5b65ab,null));};
\ No newline at end of file
+var _0x9a32=['Content-Range','save','destroy','error','name','send','index','map','MailTransferReport','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','count','then','includeAll','findAll','rows','catch','show','params','rawAttributes','include','create','body','update','find','eml-format','rimraf','fast-json-patch','request-promise','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set'];(function(_0x2a238a,_0x1d5054){var _0xeef802=function(_0x583637){while(--_0x583637){_0x2a238a['push'](_0x2a238a['shift']());}};_0xeef802(++_0x1d5054);}(_0x9a32,0x70));var _0x29a3=function(_0x3dcf55,_0x484e7b){_0x3dcf55=_0x3dcf55-0x0;var _0x5e8b44=_0x9a32[_0x3dcf55];return _0x5e8b44;};'use strict';var emlformat=require(_0x29a3('0x0'));var rimraf=require(_0x29a3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x29a3('0x2'));var rp=require(_0x29a3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x29a3('0x4'));var path=require(_0x29a3('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x29a3('0x6'));var fs=require('fs');var fs_extra=require(_0x29a3('0x7'));var _=require(_0x29a3('0x8'));var squel=require(_0x29a3('0x9'));var crypto=require(_0x29a3('0xa'));var jsforce=require(_0x29a3('0xb'));var deskjs=require(_0x29a3('0xc'));var toCsv=require(_0x29a3('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x29a3('0xe'));var authService=require(_0x29a3('0xf'));var qs=require(_0x29a3('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x29a3('0x11'))(_0x29a3('0x12'));var utils=require('../../config/utils');var config=require(_0x29a3('0x13'));var licenseUtil=require(_0x29a3('0x14'));var db=require(_0x29a3('0x15'))['db'];function respondWithStatusCode(_0x3cc4ab,_0x8f4208){_0x8f4208=_0x8f4208||0xcc;return function(_0x4ceecd){if(_0x4ceecd){return _0x3cc4ab[_0x29a3('0x16')](_0x8f4208);}return _0x3cc4ab[_0x29a3('0x17')](_0x8f4208)[_0x29a3('0x18')]();};}function respondWithResult(_0x59bd36,_0x5e8590){_0x5e8590=_0x5e8590||0xc8;return function(_0x5d37b3){if(_0x5d37b3){return _0x59bd36[_0x29a3('0x17')](_0x5e8590)[_0x29a3('0x19')](_0x5d37b3);}};}function respondWithFilteredResult(_0x149736,_0x526f64){return function(_0x4d001c){if(_0x4d001c){var _0x29e26b=typeof _0x526f64[_0x29a3('0x1a')]===_0x29a3('0x1b')&&typeof _0x526f64['limit']===_0x29a3('0x1b');var _0x5646ce=_0x4d001c['count'];var _0x30ef3d=_0x29e26b?0x0:_0x526f64['offset'];var _0x1b8f9b=_0x29e26b?_0x4d001c['count']:_0x526f64[_0x29a3('0x1a')]+_0x526f64[_0x29a3('0x1c')];var _0x236b6f;if(_0x1b8f9b>=_0x5646ce){_0x1b8f9b=_0x5646ce;_0x236b6f=0xc8;}else{_0x236b6f=0xce;}_0x149736[_0x29a3('0x17')](_0x236b6f);return _0x149736[_0x29a3('0x1d')](_0x29a3('0x1e'),_0x30ef3d+'-'+_0x1b8f9b+'/'+_0x5646ce)[_0x29a3('0x19')](_0x4d001c);}return null;};}function patchUpdates(_0x413b12){return function(_0x54fa49){try{jsonpatch['apply'](_0x54fa49,_0x413b12,!![]);}catch(_0x17102d){return BPromise['reject'](_0x17102d);}return _0x54fa49[_0x29a3('0x1f')]();};}function saveUpdates(_0x1fd1df,_0x2f3c65){return function(_0x2f564a){if(_0x2f564a){return _0x2f564a['update'](_0x1fd1df)['then'](function(_0x12593e){return _0x12593e;});}return null;};}function removeEntity(_0x51f080,_0x3f148f){return function(_0x1466be){if(_0x1466be){return _0x1466be[_0x29a3('0x20')]()['then'](function(){_0x51f080['status'](0xcc)[_0x29a3('0x18')]();});}};}function handleEntityNotFound(_0x3ad28e,_0x28ea41){return function(_0x160e1c){if(!_0x160e1c){_0x3ad28e[_0x29a3('0x16')](0x194);}return _0x160e1c;};}function handleError(_0xfc076,_0xf08dd){_0xf08dd=_0xf08dd||0x1f4;return function(_0x45829c){logger[_0x29a3('0x21')](_0x45829c['stack']);if(_0x45829c[_0x29a3('0x22')]){delete _0x45829c[_0x29a3('0x22')];}_0xfc076['status'](_0xf08dd)[_0x29a3('0x23')](_0x45829c);};}exports[_0x29a3('0x24')]=function(_0x21f160,_0x18f610){var _0x42be69={},_0x9e6b4={},_0x374d44={'count':0x0,'rows':[]};var _0x4bfa45=_[_0x29a3('0x25')](db[_0x29a3('0x26')]['rawAttributes'],function(_0x12fcee){return{'name':_0x12fcee['fieldName'],'type':_0x12fcee[_0x29a3('0x27')][_0x29a3('0x28')]};});_0x9e6b4[_0x29a3('0x29')]=_[_0x29a3('0x25')](_0x4bfa45,_0x29a3('0x22'));_0x9e6b4[_0x29a3('0x2a')]=_[_0x29a3('0x2b')](_0x21f160[_0x29a3('0x2a')]);_0x9e6b4['filters']=_['intersection'](_0x9e6b4['model'],_0x9e6b4[_0x29a3('0x2a')]);_0x42be69[_0x29a3('0x2c')]=_[_0x29a3('0x2d')](_0x9e6b4[_0x29a3('0x29')],qs[_0x29a3('0x2e')](_0x21f160[_0x29a3('0x2a')][_0x29a3('0x2e')]));_0x42be69['attributes']=_0x42be69[_0x29a3('0x2c')][_0x29a3('0x2f')]?_0x42be69[_0x29a3('0x2c')]:_0x9e6b4[_0x29a3('0x29')];if(!_0x21f160[_0x29a3('0x2a')][_0x29a3('0x30')]('nolimit')){_0x42be69[_0x29a3('0x1c')]=qs[_0x29a3('0x1c')](_0x21f160[_0x29a3('0x2a')]['limit']);_0x42be69[_0x29a3('0x1a')]=qs[_0x29a3('0x1a')](_0x21f160[_0x29a3('0x2a')]['offset']);}_0x42be69[_0x29a3('0x31')]=qs[_0x29a3('0x32')](_0x21f160[_0x29a3('0x2a')][_0x29a3('0x32')]);_0x42be69[_0x29a3('0x33')]=qs[_0x29a3('0x34')](_[_0x29a3('0x35')](_0x21f160[_0x29a3('0x2a')],_0x9e6b4[_0x29a3('0x34')]),_0x4bfa45);if(_0x21f160[_0x29a3('0x2a')]['filter']){_0x42be69['where']=_[_0x29a3('0x36')](_0x42be69[_0x29a3('0x33')],{'$or':_[_0x29a3('0x25')](_0x4bfa45,function(_0x28f263){if(_0x28f263['type']!==_0x29a3('0x37')){var _0x3e6084={};_0x3e6084[_0x28f263[_0x29a3('0x22')]]={'$like':'%'+_0x21f160[_0x29a3('0x2a')][_0x29a3('0x38')]+'%'};return _0x3e6084;}})});}_0x42be69=_['merge']({},_0x42be69,_0x21f160['options']);var _0x296311={'where':_0x42be69[_0x29a3('0x33')]};return db['MailTransferReport'][_0x29a3('0x39')](_0x296311)[_0x29a3('0x3a')](function(_0xe0e808){_0x374d44['count']=_0xe0e808;if(_0x21f160[_0x29a3('0x2a')][_0x29a3('0x3b')]){_0x42be69['include']=[{'all':!![]}];}return db[_0x29a3('0x26')][_0x29a3('0x3c')](_0x42be69);})[_0x29a3('0x3a')](function(_0x279cf){_0x374d44[_0x29a3('0x3d')]=_0x279cf;return _0x374d44;})[_0x29a3('0x3a')](respondWithFilteredResult(_0x18f610,_0x42be69))[_0x29a3('0x3e')](handleError(_0x18f610,null));};exports[_0x29a3('0x3f')]=function(_0x216c2f,_0x33c70e){var _0x1ac943={'raw':!![],'where':{'id':_0x216c2f[_0x29a3('0x40')]['id']}},_0x115425={};_0x115425[_0x29a3('0x29')]=_['keys'](db['MailTransferReport'][_0x29a3('0x41')]);_0x115425[_0x29a3('0x2a')]=_[_0x29a3('0x2b')](_0x216c2f[_0x29a3('0x2a')]);_0x115425[_0x29a3('0x34')]=_['intersection'](_0x115425['model'],_0x115425[_0x29a3('0x2a')]);_0x1ac943[_0x29a3('0x2c')]=_[_0x29a3('0x2d')](_0x115425[_0x29a3('0x29')],qs['fields'](_0x216c2f[_0x29a3('0x2a')][_0x29a3('0x2e')]));_0x1ac943[_0x29a3('0x2c')]=_0x1ac943['attributes'][_0x29a3('0x2f')]?_0x1ac943[_0x29a3('0x2c')]:_0x115425[_0x29a3('0x29')];if(_0x216c2f[_0x29a3('0x2a')][_0x29a3('0x3b')]){_0x1ac943[_0x29a3('0x42')]=[{'all':!![]}];}_0x1ac943=_[_0x29a3('0x36')]({},_0x1ac943,_0x216c2f['options']);return db['MailTransferReport']['find'](_0x1ac943)['then'](handleEntityNotFound(_0x33c70e,null))[_0x29a3('0x3a')](respondWithResult(_0x33c70e,null))[_0x29a3('0x3e')](handleError(_0x33c70e,null));};exports[_0x29a3('0x43')]=function(_0x3d3e5c,_0x3f8fdc){return db[_0x29a3('0x26')][_0x29a3('0x43')](_0x3d3e5c[_0x29a3('0x44')],{})[_0x29a3('0x3a')](respondWithResult(_0x3f8fdc,0xc9))[_0x29a3('0x3e')](handleError(_0x3f8fdc,null));};exports[_0x29a3('0x45')]=function(_0x3cf0a0,_0x2cf19b){if(_0x3cf0a0[_0x29a3('0x44')]['id']){delete _0x3cf0a0[_0x29a3('0x44')]['id'];}return db[_0x29a3('0x26')][_0x29a3('0x46')]({'where':{'id':_0x3cf0a0['params']['id']}})[_0x29a3('0x3a')](handleEntityNotFound(_0x2cf19b,null))['then'](saveUpdates(_0x3cf0a0['body'],null))[_0x29a3('0x3a')](respondWithResult(_0x2cf19b,null))[_0x29a3('0x3e')](handleError(_0x2cf19b,null));};exports[_0x29a3('0x20')]=function(_0x2d4b2a,_0x545c3c){return db[_0x29a3('0x26')][_0x29a3('0x46')]({'where':{'id':_0x2d4b2a[_0x29a3('0x40')]['id']}})[_0x29a3('0x3a')](handleEntityNotFound(_0x545c3c,null))[_0x29a3('0x3a')](removeEntity(_0x545c3c,null))[_0x29a3('0x3e')](handleError(_0x545c3c,null));};exports['describe']=function(_0x2ff029,_0x313f2a){return db['MailTransferReport']['describe']()['then'](respondWithResult(_0x313f2a,null))[_0x29a3('0x3e')](handleError(_0x313f2a,null));};
\ No newline at end of file
index ae90aeb..bb48691 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8aaa=['bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','report_mail_transfer','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x405911,_0xcd61ab){var _0x33b1ff=function(_0x1f8815){while(--_0x1f8815){_0x405911['push'](_0x405911['shift']());}};_0x33b1ff(++_0xcd61ab);}(_0x8aaa,0x64));var _0xa8aa=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x8aaa[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0xa8aa('0x0'));var util=require(_0xa8aa('0x1'));var logger=require(_0xa8aa('0x2'))('api');var moment=require(_0xa8aa('0x3'));var BPromise=require(_0xa8aa('0x4'));var rp=require(_0xa8aa('0x5'));var fs=require('fs');var path=require(_0xa8aa('0x6'));var rimraf=require(_0xa8aa('0x7'));var config=require(_0xa8aa('0x8'));var attributes=require(_0xa8aa('0x9'));module[_0xa8aa('0xa')]=function(_0x5db8ce,_0x1aa721){return _0x5db8ce['define']('MailTransferReport',attributes,{'tableName':_0xa8aa('0xb'),'paranoid':![],'indexes':[{'name':_0xa8aa('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xa6b3=['exports','MailTransferReport','report_mail_transfer','uniqueid','util','api','bluebird','request-promise','rimraf','../../config/environment','./mailTransferReport.attributes'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xa6b3,0x72));var _0x3a6b=function(_0x244965,_0x4fde7b){_0x244965=_0x244965-0x0;var _0x4cae6d=_0xa6b3[_0x244965];return _0x4cae6d;};'use strict';var _=require('lodash');var util=require(_0x3a6b('0x0'));var logger=require('../../config/logger')(_0x3a6b('0x1'));var moment=require('moment');var BPromise=require(_0x3a6b('0x2'));var rp=require(_0x3a6b('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3a6b('0x4'));var config=require(_0x3a6b('0x5'));var attributes=require(_0x3a6b('0x6'));module[_0x3a6b('0x7')]=function(_0x425173,_0x1aa276){return _0x425173['define'](_0x3a6b('0x8'),attributes,{'tableName':_0x3a6b('0x9'),'paranoid':![],'indexes':[{'name':_0x3a6b('0xa'),'fields':[_0x3a6b('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
index 4e5c135..de96864 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc17f=['debug','request\x20sent','stringify','error','code','message','catch','lodash','util','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MailTransferReport,\x20%s,\x20%s'];(function(_0xa99103,_0x4d30a2){var _0x4021f5=function(_0x34d886){while(--_0x34d886){_0xa99103['push'](_0xa99103['shift']());}};_0x4021f5(++_0x4d30a2);}(_0xc17f,0x8c));var _0xfc17=function(_0x2e7426,_0x21caa7){_0x2e7426=_0x2e7426-0x0;var _0x4ddeb6=_0xc17f[_0x2e7426];return _0x4ddeb6;};'use strict';var _=require(_0xfc17('0x0'));var util=require(_0xfc17('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc17('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfc17('0x3'))(_0xfc17('0x4'));var config=require(_0xfc17('0x5'));var jayson=require(_0xfc17('0x6'));var client=jayson[_0xfc17('0x7')][_0xfc17('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d3682,_0xf2f206,_0x1dba10){return new BPromise(function(_0x4097d5,_0x40d438){return client['request'](_0x1d3682,_0x1dba10)[_0xfc17('0x9')](function(_0x1630c9){logger[_0xfc17('0xa')](_0xfc17('0xb'),_0xf2f206,'request\x20sent');logger[_0xfc17('0xc')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0xf2f206,_0xfc17('0xd'),JSON[_0xfc17('0xe')](_0x1630c9));if(_0x1630c9['error']){if(_0x1630c9[_0xfc17('0xf')][_0xfc17('0x10')]===0x1f4){logger[_0xfc17('0xf')](_0xfc17('0xb'),_0xf2f206,_0x1630c9[_0xfc17('0xf')][_0xfc17('0x11')]);return _0x40d438(_0x1630c9[_0xfc17('0xf')][_0xfc17('0x11')]);}logger[_0xfc17('0xf')](_0xfc17('0xb'),_0xf2f206,_0x1630c9['error'][_0xfc17('0x11')]);return _0x4097d5(_0x1630c9[_0xfc17('0xf')]['message']);}else{logger[_0xfc17('0xa')](_0xfc17('0xb'),_0xf2f206,_0xfc17('0xd'));_0x4097d5(_0x1630c9['result']['message']);}})[_0xfc17('0x12')](function(_0x124aad){logger[_0xfc17('0xf')](_0xfc17('0xb'),_0xf2f206,_0x124aad);_0x40d438(_0x124aad);});});}
\ No newline at end of file
+var _0x1773=['MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','info','MailTransferReport,\x20%s,\x20%s','debug'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0x1773,0x14a));var _0x3177=function(_0x1f491f,_0xfb5792){_0x1f491f=_0x1f491f-0x0;var _0x2d301c=_0x1773[_0x1f491f];return _0x2d301c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3177('0x0'));var BPromise=require(_0x3177('0x1'));var rs=require(_0x3177('0x2'));var fs=require('fs');var Redis=require(_0x3177('0x3'));var db=require(_0x3177('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3177('0x5'))(_0x3177('0x6'));var config=require(_0x3177('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3177('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x255967,_0x2de478,_0x2304df){return new BPromise(function(_0x33c5d3,_0x4fcf45){return client['request'](_0x255967,_0x2304df)['then'](function(_0x5c9c9e){logger[_0x3177('0x9')](_0x3177('0xa'),_0x2de478,'request\x20sent');logger[_0x3177('0xb')](_0x3177('0xc'),_0x2de478,'request\x20sent',JSON[_0x3177('0xd')](_0x5c9c9e));if(_0x5c9c9e[_0x3177('0xe')]){if(_0x5c9c9e['error'][_0x3177('0xf')]===0x1f4){logger[_0x3177('0xe')](_0x3177('0xa'),_0x2de478,_0x5c9c9e['error'][_0x3177('0x10')]);return _0x4fcf45(_0x5c9c9e[_0x3177('0xe')][_0x3177('0x10')]);}logger[_0x3177('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x2de478,_0x5c9c9e[_0x3177('0xe')][_0x3177('0x10')]);return _0x33c5d3(_0x5c9c9e[_0x3177('0xe')][_0x3177('0x10')]);}else{logger[_0x3177('0x9')](_0x3177('0xa'),_0x2de478,'request\x20sent');_0x33c5d3(_0x5c9c9e[_0x3177('0x11')]['message']);}})[_0x3177('0x12')](function(_0x3b6b06){logger['error'](_0x3177('0xa'),_0x2de478,_0x3b6b06);_0x4fcf45(_0x3b6b06);});});}
\ No newline at end of file
index e71fdbf..bfdc440 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb61f=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','update','destroy','exports'];(function(_0x59bece,_0x102ed9){var _0x42468b=function(_0x22ce1a){while(--_0x22ce1a){_0x59bece['push'](_0x59bece['shift']());}};_0x42468b(++_0x102ed9);}(_0xb61f,0x84));var _0xfb61=function(_0x4a7d9d,_0x46e1dd){_0x4a7d9d=_0x4a7d9d-0x0;var _0x4ecabf=_0xb61f[_0x4a7d9d];return _0x4ecabf;};'use strict';var multer=require(_0xfb61('0x0'));var util=require(_0xfb61('0x1'));var path=require(_0xfb61('0x2'));var timeout=require(_0xfb61('0x3'));var express=require(_0xfb61('0x4'));var router=express[_0xfb61('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xfb61('0x6'));var interaction=require(_0xfb61('0x7'));var config=require(_0xfb61('0x8'));var controller=require(_0xfb61('0x9'));router[_0xfb61('0xa')]('/',auth[_0xfb61('0xb')](),controller[_0xfb61('0xc')]);router[_0xfb61('0xa')](_0xfb61('0xd'),auth[_0xfb61('0xb')](),controller[_0xfb61('0xe')]);router[_0xfb61('0xa')]('/:id',auth[_0xfb61('0xb')](),controller['show']);router[_0xfb61('0xf')]('/',auth[_0xfb61('0xb')](),controller[_0xfb61('0x10')]);router[_0xfb61('0x11')](_0xfb61('0x12'),auth[_0xfb61('0xb')](),controller[_0xfb61('0x13')]);router['delete'](_0xfb61('0x12'),auth[_0xfb61('0xb')](),controller[_0xfb61('0x14')]);module[_0xfb61('0x15')]=router;
\ No newline at end of file
+var _0x5c19=['isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller'];(function(_0xd35539,_0x3f5457){var _0x249d61=function(_0x186855){while(--_0x186855){_0xd35539['push'](_0xd35539['shift']());}};_0x249d61(++_0x3f5457);}(_0x5c19,0xa1));var _0x95c1=function(_0x34fb46,_0x2c9b1b){_0x34fb46=_0x34fb46-0x0;var _0x56800d=_0x5c19[_0x34fb46];return _0x56800d;};'use strict';var multer=require('multer');var util=require(_0x95c1('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x95c1('0x1')]();var fs_extra=require(_0x95c1('0x2'));var auth=require(_0x95c1('0x3'));var interaction=require(_0x95c1('0x4'));var config=require(_0x95c1('0x5'));var controller=require(_0x95c1('0x6'));router['get']('/',auth[_0x95c1('0x7')](),controller[_0x95c1('0x8')]);router[_0x95c1('0x9')](_0x95c1('0xa'),auth[_0x95c1('0x7')](),controller[_0x95c1('0xb')]);router[_0x95c1('0x9')](_0x95c1('0xc'),auth[_0x95c1('0x7')](),controller[_0x95c1('0xd')]);router[_0x95c1('0xe')]('/',auth[_0x95c1('0x7')](),controller[_0x95c1('0xf')]);router[_0x95c1('0x10')](_0x95c1('0xc'),auth['isAuthenticated'](),controller[_0x95c1('0x11')]);router[_0x95c1('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x95c1('0x13')]);module[_0x95c1('0x14')]=router;
\ No newline at end of file
index c3bac9f..4002e99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc090=['duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','INTEGER','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','enterAt','diff','setDataValue','exitAt'];(function(_0x381ad2,_0x2d8ecb){var _0x3b1869=function(_0x1fd403){while(--_0x1fd403){_0x381ad2['push'](_0x381ad2['shift']());}};_0x3b1869(++_0x2d8ecb);}(_0xc090,0x112));var _0x0c09=function(_0x15af07,_0xf00420){_0x15af07=_0x15af07-0x0;var _0x102765=_0xc090[_0x15af07];return _0x102765;};'use strict';var Sequelize=require(_0x0c09('0x0'));var moment=require(_0x0c09('0x1'));module[_0x0c09('0x2')]={'channel':{'type':Sequelize[_0x0c09('0x3')]},'membername':{'type':Sequelize[_0x0c09('0x3')]},'interface':{'type':Sequelize[_0x0c09('0x3')]},'type':{'type':Sequelize[_0x0c09('0x3')],'defaultValue':_0x0c09('0x4'),'comment':_0x0c09('0x5')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0x0c09('0x6')]},'exitAt':{'type':Sequelize[_0x0c09('0x6')],'set':function(_0x4f3f48){var _0x49a403=moment(_0x4f3f48);var _0x4c2143=moment(this['getDataValue'](_0x0c09('0x7')));var _0x2854d8=_0x49a403[_0x0c09('0x8')](_0x4c2143,'seconds');this[_0x0c09('0x9')](_0x0c09('0xa'),_0x4f3f48);this['setDataValue'](_0x0c09('0xb'),_0x2854d8||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x0c09('0xc')},'data2':{'type':Sequelize[_0x0c09('0x3')],'comment':_0x0c09('0xd')},'data3':{'type':Sequelize[_0x0c09('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize['STRING'],'comment':'talk:[dial\x20string]'},'data5':{'type':Sequelize[_0x0c09('0x3')],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x0c09('0xe')]},'uniqueid':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xcfac=['LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','INTEGER','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE'];(function(_0x5cb714,_0x3a4609){var _0x4b9d36=function(_0x5d2a26){while(--_0x5d2a26){_0x5cb714['push'](_0x5cb714['shift']());}};_0x4b9d36(++_0x3a4609);}(_0xcfac,0x105));var _0xccfa=function(_0x51a010,_0x4b0807){_0x51a010=_0x51a010-0x0;var _0x38b619=_0xcfac[_0x51a010];return _0x38b619;};'use strict';var Sequelize=require(_0xccfa('0x0'));var moment=require(_0xccfa('0x1'));module[_0xccfa('0x2')]={'channel':{'type':Sequelize[_0xccfa('0x3')]},'membername':{'type':Sequelize[_0xccfa('0x3')]},'interface':{'type':Sequelize[_0xccfa('0x3')]},'type':{'type':Sequelize[_0xccfa('0x3')],'defaultValue':_0xccfa('0x4'),'comment':_0xccfa('0x5')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xccfa('0x6')]},'exitAt':{'type':Sequelize[_0xccfa('0x6')],'set':function(_0x2d2ddf){var _0x1ba378=moment(_0x2d2ddf);var _0x1529e7=moment(this[_0xccfa('0x7')](_0xccfa('0x8')));var _0x5c5f2f=_0x1ba378[_0xccfa('0x9')](_0x1529e7,_0xccfa('0xa'));this[_0xccfa('0xb')](_0xccfa('0xc'),_0x2d2ddf);this[_0xccfa('0xb')]('duration',_0x5c5f2f||null);}},'data1':{'type':Sequelize[_0xccfa('0x3')],'comment':_0xccfa('0xd')},'data2':{'type':Sequelize['STRING'],'comment':_0xccfa('0xe')},'data3':{'type':Sequelize[_0xccfa('0x3')],'comment':_0xccfa('0xf')},'data4':{'type':Sequelize[_0xccfa('0x3')],'comment':_0xccfa('0x10')},'data5':{'type':Sequelize['STRING'],'comment':_0xccfa('0x11')},'role':{'type':Sequelize[_0xccfa('0x3')]},'internal':{'type':Sequelize[_0xccfa('0x12')]},'uniqueid':{'type':Sequelize[_0xccfa('0x3')]}};
\ No newline at end of file
index 787e122..a111b06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','MemberReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','catch','show','params','keys','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util'];(function(_0x256d6a,_0x2f002f){var _0x460058=function(_0x195be7){while(--_0x195be7){_0x256d6a['push'](_0x256d6a['shift']());}};_0x460058(++_0x2f002f);}(_0x34e8,0x12c));var _0x834e=function(_0x27146e,_0x15519e){_0x27146e=_0x27146e-0x0;var _0x219597=_0x34e8[_0x27146e];return _0x219597;};'use strict';var emlformat=require(_0x834e('0x0'));var rimraf=require(_0x834e('0x1'));var zipdir=require(_0x834e('0x2'));var jsonpatch=require(_0x834e('0x3'));var rp=require('request-promise');var moment=require(_0x834e('0x4'));var BPromise=require(_0x834e('0x5'));var Mustache=require(_0x834e('0x6'));var util=require(_0x834e('0x7'));var path=require(_0x834e('0x8'));var sox=require(_0x834e('0x9'));var csv=require(_0x834e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x834e('0xb'));var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0xa'));var querystring=require(_0x834e('0x10'));var Papa=require(_0x834e('0x11'));var Redis=require(_0x834e('0x12'));var authService=require(_0x834e('0x13'));var qs=require(_0x834e('0x14'));var as=require(_0x834e('0x15'));var hardwareService=require(_0x834e('0x16'));var logger=require(_0x834e('0x17'))(_0x834e('0x18'));var utils=require(_0x834e('0x19'));var config=require(_0x834e('0x1a'));var licenseUtil=require(_0x834e('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e5b6d,_0x6cd9b9){_0x6cd9b9=_0x6cd9b9||0xcc;return function(_0x58a27e){if(_0x58a27e){return _0x5e5b6d[_0x834e('0x1c')](_0x6cd9b9);}return _0x5e5b6d[_0x834e('0x1d')](_0x6cd9b9)[_0x834e('0x1e')]();};}function respondWithResult(_0x21cc0a,_0x50e860){_0x50e860=_0x50e860||0xc8;return function(_0x43156c){if(_0x43156c){return _0x21cc0a[_0x834e('0x1d')](_0x50e860)['json'](_0x43156c);}};}function respondWithFilteredResult(_0x316205,_0x4a9cdc){return function(_0x38a8cd){if(_0x38a8cd){var _0x36d443=typeof _0x4a9cdc['offset']===_0x834e('0x1f')&&typeof _0x4a9cdc[_0x834e('0x20')]===_0x834e('0x1f');var _0x50b3f6=_0x38a8cd[_0x834e('0x21')];var _0x211e9a=_0x36d443?0x0:_0x4a9cdc[_0x834e('0x22')];var _0xb993a1=_0x36d443?_0x38a8cd[_0x834e('0x21')]:_0x4a9cdc[_0x834e('0x22')]+_0x4a9cdc[_0x834e('0x20')];var _0x595515;if(_0xb993a1>=_0x50b3f6){_0xb993a1=_0x50b3f6;_0x595515=0xc8;}else{_0x595515=0xce;}_0x316205[_0x834e('0x1d')](_0x595515);return _0x316205[_0x834e('0x23')](_0x834e('0x24'),_0x211e9a+'-'+_0xb993a1+'/'+_0x50b3f6)[_0x834e('0x25')](_0x38a8cd);}return null;};}function patchUpdates(_0x4ab05d){return function(_0x45a630){try{jsonpatch[_0x834e('0x26')](_0x45a630,_0x4ab05d,!![]);}catch(_0x5a05c0){return BPromise[_0x834e('0x27')](_0x5a05c0);}return _0x45a630[_0x834e('0x28')]();};}function saveUpdates(_0x8d406e,_0x5c55ca){return function(_0x4e3f48){if(_0x4e3f48){return _0x4e3f48[_0x834e('0x29')](_0x8d406e)[_0x834e('0x2a')](function(_0x589dde){return _0x589dde;});}return null;};}function removeEntity(_0x25ee1d,_0x1dc1e0){return function(_0x58f4fd){if(_0x58f4fd){return _0x58f4fd[_0x834e('0x2b')]()[_0x834e('0x2a')](function(){_0x25ee1d[_0x834e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24fcf7,_0x3e310f){return function(_0x5e1cc5){if(!_0x5e1cc5){_0x24fcf7['sendStatus'](0x194);}return _0x5e1cc5;};}function handleError(_0x1e713a,_0x508a1d){_0x508a1d=_0x508a1d||0x1f4;return function(_0x2826ec){logger[_0x834e('0x2c')](_0x2826ec[_0x834e('0x2d')]);if(_0x2826ec[_0x834e('0x2e')]){delete _0x2826ec[_0x834e('0x2e')];}_0x1e713a[_0x834e('0x1d')](_0x508a1d)['send'](_0x2826ec);};}exports['index']=function(_0x4dc64a,_0x58c1d7){var _0x2c7a8d={},_0x567cea={},_0x106d6a={'count':0x0,'rows':[]};var _0x5dacc1=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x1e026a){return{'name':_0x1e026a[_0x834e('0x32')],'type':_0x1e026a[_0x834e('0x33')][_0x834e('0x34')]};});_0x567cea[_0x834e('0x35')]=_[_0x834e('0x2f')](_0x5dacc1,'name');_0x567cea[_0x834e('0x36')]=_['keys'](_0x4dc64a[_0x834e('0x36')]);_0x567cea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],_0x567cea[_0x834e('0x36')]);_0x2c7a8d[_0x834e('0x39')]=_[_0x834e('0x38')](_0x567cea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x4dc64a[_0x834e('0x36')]['fields']));_0x2c7a8d[_0x834e('0x39')]=_0x2c7a8d[_0x834e('0x39')][_0x834e('0x3b')]?_0x2c7a8d[_0x834e('0x39')]:_0x567cea['model'];if(!_0x4dc64a[_0x834e('0x36')][_0x834e('0x3c')]('nolimit')){_0x2c7a8d['limit']=qs['limit'](_0x4dc64a[_0x834e('0x36')][_0x834e('0x20')]);_0x2c7a8d[_0x834e('0x22')]=qs[_0x834e('0x22')](_0x4dc64a[_0x834e('0x36')][_0x834e('0x22')]);}_0x2c7a8d['order']=qs[_0x834e('0x3d')](_0x4dc64a['query'][_0x834e('0x3d')]);_0x2c7a8d[_0x834e('0x3e')]=qs['filters'](_[_0x834e('0x3f')](_0x4dc64a[_0x834e('0x36')],_0x567cea['filters']),_0x5dacc1);if(_0x4dc64a['query'][_0x834e('0x40')]){_0x2c7a8d[_0x834e('0x3e')]=_[_0x834e('0x41')](_0x2c7a8d[_0x834e('0x3e')],{'$or':_[_0x834e('0x2f')](_0x5dacc1,function(_0x4ca43c){if(_0x4ca43c[_0x834e('0x33')]!=='VIRTUAL'){var _0x50c243={};_0x50c243[_0x4ca43c[_0x834e('0x2e')]]={'$like':'%'+_0x4dc64a['query'][_0x834e('0x40')]+'%'};return _0x50c243;}})});}_0x2c7a8d=_[_0x834e('0x41')]({},_0x2c7a8d,_0x4dc64a[_0x834e('0x42')]);var _0x3c59af={'where':_0x2c7a8d[_0x834e('0x3e')]};return db['MemberReport'][_0x834e('0x21')](_0x3c59af)[_0x834e('0x2a')](function(_0x38f266){_0x106d6a['count']=_0x38f266;if(_0x4dc64a[_0x834e('0x36')][_0x834e('0x43')]){_0x2c7a8d['include']=[{'all':!![]}];}return db[_0x834e('0x30')]['findAll'](_0x2c7a8d);})[_0x834e('0x2a')](function(_0x585335){_0x106d6a['rows']=_0x585335;return _0x106d6a;})['then'](respondWithFilteredResult(_0x58c1d7,_0x2c7a8d))[_0x834e('0x44')](handleError(_0x58c1d7,null));};exports[_0x834e('0x45')]=function(_0x3bcbf4,_0xbc1571){var _0x8ad264={'raw':!![],'where':{'id':_0x3bcbf4[_0x834e('0x46')]['id']}},_0x23feea={};_0x23feea['model']=_[_0x834e('0x47')](db['MemberReport'][_0x834e('0x31')]);_0x23feea['query']=_[_0x834e('0x47')](_0x3bcbf4['query']);_0x23feea[_0x834e('0x37')]=_[_0x834e('0x38')](_0x23feea['model'],_0x23feea[_0x834e('0x36')]);_0x8ad264[_0x834e('0x39')]=_[_0x834e('0x38')](_0x23feea[_0x834e('0x35')],qs[_0x834e('0x3a')](_0x3bcbf4[_0x834e('0x36')][_0x834e('0x3a')]));_0x8ad264[_0x834e('0x39')]=_0x8ad264[_0x834e('0x39')][_0x834e('0x3b')]?_0x8ad264['attributes']:_0x23feea[_0x834e('0x35')];if(_0x3bcbf4[_0x834e('0x36')]['includeAll']){_0x8ad264[_0x834e('0x48')]=[{'all':!![]}];}_0x8ad264=_[_0x834e('0x41')]({},_0x8ad264,_0x3bcbf4[_0x834e('0x42')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x8ad264)[_0x834e('0x2a')](handleEntityNotFound(_0xbc1571,null))['then'](respondWithResult(_0xbc1571,null))['catch'](handleError(_0xbc1571,null));};exports[_0x834e('0x4a')]=function(_0x1a5444,_0x30568e){return db[_0x834e('0x30')][_0x834e('0x4a')](_0x1a5444[_0x834e('0x4b')],{})[_0x834e('0x2a')](respondWithResult(_0x30568e,0xc9))[_0x834e('0x44')](handleError(_0x30568e,null));};exports[_0x834e('0x29')]=function(_0x390c45,_0xf02f0d){if(_0x390c45[_0x834e('0x4b')]['id']){delete _0x390c45[_0x834e('0x4b')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x390c45[_0x834e('0x46')]['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0xf02f0d,null))[_0x834e('0x2a')](saveUpdates(_0x390c45[_0x834e('0x4b')],null))[_0x834e('0x2a')](respondWithResult(_0xf02f0d,null))['catch'](handleError(_0xf02f0d,null));};exports[_0x834e('0x2b')]=function(_0x1f08b9,_0x4e73e0){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1f08b9['params']['id']}})[_0x834e('0x2a')](handleEntityNotFound(_0x4e73e0,null))[_0x834e('0x2a')](removeEntity(_0x4e73e0,null))[_0x834e('0x44')](handleError(_0x4e73e0,null));};exports[_0x834e('0x4c')]=function(_0x4288e4,_0xb77aab){return db[_0x834e('0x30')]['describe']()[_0x834e('0x2a')](respondWithResult(_0xb77aab,null))[_0x834e('0x44')](handleError(_0xb77aab,null));};
\ No newline at end of file
+var _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xedd9,0xfc));var _0x9edd=function(_0x31a268,_0x4b5616){_0x31a268=_0x31a268-0x0;var _0x2a8b21=_0xedd9[_0x31a268];return _0x2a8b21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));};
\ No newline at end of file
index ae60372..e0dd924 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91f8=['define','report_member','membername_interface','membername','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./memberReport.attributes','exports'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x91f8,0x13f));var _0x891f=function(_0x18a71e,_0x1887ec){_0x18a71e=_0x18a71e-0x0;var _0x6a2ef7=_0x91f8[_0x18a71e];return _0x6a2ef7;};'use strict';var _=require(_0x891f('0x0'));var util=require(_0x891f('0x1'));var logger=require(_0x891f('0x2'))(_0x891f('0x3'));var moment=require(_0x891f('0x4'));var BPromise=require(_0x891f('0x5'));var rp=require(_0x891f('0x6'));var fs=require('fs');var path=require(_0x891f('0x7'));var rimraf=require('rimraf');var config=require(_0x891f('0x8'));var attributes=require(_0x891f('0x9'));module[_0x891f('0xa')]=function(_0x892594,_0x59a2e4){return _0x892594[_0x891f('0xb')]('MemberReport',attributes,{'tableName':_0x891f('0xc'),'paranoid':![],'indexes':[{'name':_0x891f('0xd'),'fields':[_0x891f('0xe'),'interface']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xedbf=['util','../../config/logger','moment','request-promise','path','rimraf','exports','membername','interface','lodash'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xedbf,0x103));var _0xfedb=function(_0x2bc1fe,_0x45da98){_0x2bc1fe=_0x2bc1fe-0x0;var _0x1a47a5=_0xedbf[_0x2bc1fe];return _0x1a47a5;};'use strict';var _=require(_0xfedb('0x0'));var util=require(_0xfedb('0x1'));var logger=require(_0xfedb('0x2'))('api');var moment=require(_0xfedb('0x3'));var BPromise=require('bluebird');var rp=require(_0xfedb('0x4'));var fs=require('fs');var path=require(_0xfedb('0x5'));var rimraf=require(_0xfedb('0x6'));var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module[_0xfedb('0x7')]=function(_0x4ae9d0,_0x47d3e5){return _0x4ae9d0['define']('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0xfedb('0x8'),_0xfedb('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index 015df99..155000d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcf6=['model','include','map','stringify','CreateMemberReport','create','UpdateMemberReport','update','body','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','MemberReport,\x20%s,\x20%s','message','info','result','catch','GetMemberReport','MemberReport','options','raw','where','attributes','limit'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0xdcf6,0x1b6));var _0x6dcf=function(_0x3b87f4,_0x112243){_0x3b87f4=_0x3b87f4-0x0;var _0x63d16e=_0xdcf6[_0x3b87f4];return _0x63d16e;};'use strict';var _=require('lodash');var util=require(_0x6dcf('0x0'));var moment=require(_0x6dcf('0x1'));var BPromise=require(_0x6dcf('0x2'));var rs=require(_0x6dcf('0x3'));var fs=require('fs');var Redis=require(_0x6dcf('0x4'));var db=require(_0x6dcf('0x5'))['db'];var utils=require(_0x6dcf('0x6'));var logger=require('../../config/logger')(_0x6dcf('0x7'));var config=require(_0x6dcf('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6dcf('0x9')][_0x6dcf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5abd79,_0x56fdb2,_0x5766db){return new BPromise(function(_0x34517a,_0x4e2877){return client[_0x6dcf('0xb')](_0x5abd79,_0x5766db)[_0x6dcf('0xc')](function(_0x304a75){logger['info']('MemberReport,\x20%s,\x20%s',_0x56fdb2,'request\x20sent');logger[_0x6dcf('0xd')](_0x6dcf('0xe'),_0x56fdb2,_0x6dcf('0xf'),JSON['stringify'](_0x304a75));if(_0x304a75[_0x6dcf('0x10')]){if(_0x304a75[_0x6dcf('0x10')][_0x6dcf('0x11')]===0x1f4){logger[_0x6dcf('0x10')](_0x6dcf('0x12'),_0x56fdb2,_0x304a75[_0x6dcf('0x10')][_0x6dcf('0x13')]);return _0x4e2877(_0x304a75[_0x6dcf('0x10')][_0x6dcf('0x13')]);}logger[_0x6dcf('0x10')](_0x6dcf('0x12'),_0x56fdb2,_0x304a75[_0x6dcf('0x10')][_0x6dcf('0x13')]);return _0x34517a(_0x304a75[_0x6dcf('0x10')][_0x6dcf('0x13')]);}else{logger[_0x6dcf('0x14')](_0x6dcf('0x12'),_0x56fdb2,'request\x20sent');_0x34517a(_0x304a75[_0x6dcf('0x15')][_0x6dcf('0x13')]);}})[_0x6dcf('0x16')](function(_0x4874ff){logger[_0x6dcf('0x10')](_0x6dcf('0x12'),_0x56fdb2,_0x4874ff);_0x4e2877(_0x4874ff);});});}exports[_0x6dcf('0x17')]=function(_0x40b6ac){var _0x821c86=this;return new Promise(function(_0x83da87,_0x1bed56){return db[_0x6dcf('0x18')]['findAll']({'raw':_0x40b6ac[_0x6dcf('0x19')]?_0x40b6ac[_0x6dcf('0x19')][_0x6dcf('0x1a')]===undefined?!![]:![]:!![],'where':_0x40b6ac[_0x6dcf('0x19')]?_0x40b6ac[_0x6dcf('0x19')][_0x6dcf('0x1b')]||null:null,'attributes':_0x40b6ac[_0x6dcf('0x19')]?_0x40b6ac['options'][_0x6dcf('0x1c')]||null:null,'limit':_0x40b6ac['options']?_0x40b6ac[_0x6dcf('0x19')][_0x6dcf('0x1d')]||null:null,'include':_0x40b6ac[_0x6dcf('0x19')]?_0x40b6ac[_0x6dcf('0x19')]['include']?_['map'](_0x40b6ac[_0x6dcf('0x19')]['include'],function(_0x1df874){return{'model':db[_0x1df874[_0x6dcf('0x1e')]],'as':_0x1df874['as'],'attributes':_0x1df874[_0x6dcf('0x1c')],'include':_0x1df874[_0x6dcf('0x1f')]?_['map'](_0x1df874[_0x6dcf('0x1f')],function(_0x2b6dbe){return{'model':db[_0x2b6dbe[_0x6dcf('0x1e')]],'as':_0x2b6dbe['as'],'attributes':_0x2b6dbe[_0x6dcf('0x1c')],'include':_0x2b6dbe['include']?_[_0x6dcf('0x20')](_0x2b6dbe[_0x6dcf('0x1f')],function(_0x2dc909){return{'model':db[_0x2dc909[_0x6dcf('0x1e')]],'as':_0x2dc909['as'],'attributes':_0x2dc909[_0x6dcf('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6dcf('0xc')](function(_0x3fad7e){logger[_0x6dcf('0x14')](_0x6dcf('0x17'),_0x40b6ac);logger[_0x6dcf('0xd')](_0x6dcf('0x17'),_0x40b6ac,JSON[_0x6dcf('0x21')](_0x3fad7e));_0x83da87(_0x3fad7e);})['catch'](function(_0x3a4356){logger[_0x6dcf('0x10')]('GetMemberReport',_0x3a4356['message'],_0x40b6ac);_0x1bed56(_0x821c86['error'](0x1f4,_0x3a4356['message']));});});};exports[_0x6dcf('0x22')]=function(_0x356ad1){var _0x4c106c=this;return new Promise(function(_0x3d4615,_0x271c8e){return db[_0x6dcf('0x18')][_0x6dcf('0x23')](_0x356ad1['body'],{'raw':_0x356ad1[_0x6dcf('0x19')]?_0x356ad1[_0x6dcf('0x19')][_0x6dcf('0x1a')]===undefined?!![]:![]:!![]})[_0x6dcf('0xc')](function(_0x1dd58c){logger[_0x6dcf('0x14')](_0x6dcf('0x22'),_0x356ad1);logger[_0x6dcf('0xd')](_0x6dcf('0x22'),_0x356ad1,JSON[_0x6dcf('0x21')](_0x1dd58c));_0x3d4615(_0x1dd58c);})[_0x6dcf('0x16')](function(_0x20f59d){logger[_0x6dcf('0x10')]('CreateMemberReport',_0x20f59d[_0x6dcf('0x13')],_0x356ad1);_0x271c8e(_0x4c106c[_0x6dcf('0x10')](0x1f4,_0x20f59d['message']));});});};exports[_0x6dcf('0x24')]=function(_0x212475){var _0x40587e=this;return new Promise(function(_0x9ed57e,_0x2d9d12){return db[_0x6dcf('0x18')][_0x6dcf('0x25')](_0x212475[_0x6dcf('0x26')],{'raw':_0x212475['options']?_0x212475[_0x6dcf('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x212475[_0x6dcf('0x19')]?_0x212475[_0x6dcf('0x19')][_0x6dcf('0x1b')]||null:null,'attributes':_0x212475[_0x6dcf('0x19')]?_0x212475[_0x6dcf('0x19')][_0x6dcf('0x1c')]||null:null,'limit':_0x212475['options']?_0x212475[_0x6dcf('0x19')]['limit']||null:null})[_0x6dcf('0xc')](function(_0x59f505){logger[_0x6dcf('0x14')](_0x6dcf('0x24'),_0x212475);logger[_0x6dcf('0xd')]('UpdateMemberReport',_0x212475,JSON[_0x6dcf('0x21')](_0x59f505));_0x9ed57e(_0x59f505);})['catch'](function(_0x310c79){logger['error'](_0x6dcf('0x24'),_0x310c79['message'],_0x212475);_0x2d9d12(_0x40587e[_0x6dcf('0x10')](0x1f4,_0x310c79[_0x6dcf('0x13')]));});});};
\ No newline at end of file
+var _0xc962=['body','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','MemberReport,\x20%s,\x20%s','message','catch','GetMemberReport','findAll','options','where','attributes','limit','include','map','model','CreateMemberReport','MemberReport','create','raw','info','UpdateMemberReport'];(function(_0x5e6cb8,_0x16cf56){var _0x3faeb3=function(_0x1a7355){while(--_0x1a7355){_0x5e6cb8['push'](_0x5e6cb8['shift']());}};_0x3faeb3(++_0x16cf56);}(_0xc962,0x6d));var _0x2c96=function(_0x31b37c,_0x5a6ed7){_0x31b37c=_0x31b37c-0x0;var _0x416388=_0xc962[_0x31b37c];return _0x416388;};'use strict';var _=require(_0x2c96('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2c96('0x1'));var fs=require('fs');var Redis=require(_0x2c96('0x2'));var db=require(_0x2c96('0x3'))['db'];var utils=require(_0x2c96('0x4'));var logger=require(_0x2c96('0x5'))(_0x2c96('0x6'));var config=require(_0x2c96('0x7'));var jayson=require(_0x2c96('0x8'));var client=jayson['client'][_0x2c96('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2df446,_0x1f9859,_0x17a493){return new BPromise(function(_0x13aee2,_0x36dd95){return client[_0x2c96('0xa')](_0x2df446,_0x17a493)[_0x2c96('0xb')](function(_0x30ffef){logger['info']('MemberReport,\x20%s,\x20%s',_0x1f9859,_0x2c96('0xc'));logger[_0x2c96('0xd')](_0x2c96('0xe'),_0x1f9859,_0x2c96('0xc'),JSON[_0x2c96('0xf')](_0x30ffef));if(_0x30ffef[_0x2c96('0x10')]){if(_0x30ffef['error']['code']===0x1f4){logger[_0x2c96('0x10')](_0x2c96('0x11'),_0x1f9859,_0x30ffef[_0x2c96('0x10')][_0x2c96('0x12')]);return _0x36dd95(_0x30ffef[_0x2c96('0x10')][_0x2c96('0x12')]);}logger[_0x2c96('0x10')]('MemberReport,\x20%s,\x20%s',_0x1f9859,_0x30ffef['error']['message']);return _0x13aee2(_0x30ffef[_0x2c96('0x10')][_0x2c96('0x12')]);}else{logger['info'](_0x2c96('0x11'),_0x1f9859,_0x2c96('0xc'));_0x13aee2(_0x30ffef['result'][_0x2c96('0x12')]);}})[_0x2c96('0x13')](function(_0x2b26b4){logger[_0x2c96('0x10')](_0x2c96('0x11'),_0x1f9859,_0x2b26b4);_0x36dd95(_0x2b26b4);});});}exports[_0x2c96('0x14')]=function(_0x2ccbed){var _0x2529b0=this;return new Promise(function(_0x3fde3e,_0x48b420){return db['MemberReport'][_0x2c96('0x15')]({'raw':_0x2ccbed[_0x2c96('0x16')]?_0x2ccbed[_0x2c96('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2ccbed[_0x2c96('0x16')]?_0x2ccbed[_0x2c96('0x16')][_0x2c96('0x17')]||null:null,'attributes':_0x2ccbed['options']?_0x2ccbed[_0x2c96('0x16')][_0x2c96('0x18')]||null:null,'limit':_0x2ccbed['options']?_0x2ccbed[_0x2c96('0x16')][_0x2c96('0x19')]||null:null,'include':_0x2ccbed[_0x2c96('0x16')]?_0x2ccbed[_0x2c96('0x16')][_0x2c96('0x1a')]?_[_0x2c96('0x1b')](_0x2ccbed[_0x2c96('0x16')]['include'],function(_0x3d8b21){return{'model':db[_0x3d8b21['model']],'as':_0x3d8b21['as'],'attributes':_0x3d8b21['attributes'],'include':_0x3d8b21[_0x2c96('0x1a')]?_['map'](_0x3d8b21[_0x2c96('0x1a')],function(_0x66cd41){return{'model':db[_0x66cd41[_0x2c96('0x1c')]],'as':_0x66cd41['as'],'attributes':_0x66cd41[_0x2c96('0x18')],'include':_0x66cd41['include']?_[_0x2c96('0x1b')](_0x66cd41[_0x2c96('0x1a')],function(_0x490f14){return{'model':db[_0x490f14[_0x2c96('0x1c')]],'as':_0x490f14['as'],'attributes':_0x490f14[_0x2c96('0x18')]};}):[]};}):[]};}):[]:[]})[_0x2c96('0xb')](function(_0x1abae0){logger['info'](_0x2c96('0x14'),_0x2ccbed);logger[_0x2c96('0xd')](_0x2c96('0x14'),_0x2ccbed,JSON[_0x2c96('0xf')](_0x1abae0));_0x3fde3e(_0x1abae0);})['catch'](function(_0x19ee5d){logger[_0x2c96('0x10')]('GetMemberReport',_0x19ee5d[_0x2c96('0x12')],_0x2ccbed);_0x48b420(_0x2529b0['error'](0x1f4,_0x19ee5d[_0x2c96('0x12')]));});});};exports[_0x2c96('0x1d')]=function(_0x18df4d){var _0x363da9=this;return new Promise(function(_0x303aa3,_0x30799f){return db[_0x2c96('0x1e')][_0x2c96('0x1f')](_0x18df4d['body'],{'raw':_0x18df4d[_0x2c96('0x16')]?_0x18df4d[_0x2c96('0x16')][_0x2c96('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0xc296ca){logger[_0x2c96('0x21')](_0x2c96('0x1d'),_0x18df4d);logger['debug'](_0x2c96('0x1d'),_0x18df4d,JSON[_0x2c96('0xf')](_0xc296ca));_0x303aa3(_0xc296ca);})[_0x2c96('0x13')](function(_0xe39a58){logger[_0x2c96('0x10')]('CreateMemberReport',_0xe39a58[_0x2c96('0x12')],_0x18df4d);_0x30799f(_0x363da9[_0x2c96('0x10')](0x1f4,_0xe39a58[_0x2c96('0x12')]));});});};exports[_0x2c96('0x22')]=function(_0x3d12cf){var _0x2ed3a1=this;return new Promise(function(_0x2c1fbd,_0x171ad7){return db['MemberReport']['update'](_0x3d12cf[_0x2c96('0x23')],{'raw':_0x3d12cf[_0x2c96('0x16')]?_0x3d12cf[_0x2c96('0x16')][_0x2c96('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3d12cf['options']?_0x3d12cf[_0x2c96('0x16')]['where']||null:null,'attributes':_0x3d12cf[_0x2c96('0x16')]?_0x3d12cf[_0x2c96('0x16')][_0x2c96('0x18')]||null:null,'limit':_0x3d12cf[_0x2c96('0x16')]?_0x3d12cf[_0x2c96('0x16')]['limit']||null:null})[_0x2c96('0xb')](function(_0x498bbd){logger[_0x2c96('0x21')](_0x2c96('0x22'),_0x3d12cf);logger['debug']('UpdateMemberReport',_0x3d12cf,JSON[_0x2c96('0xf')](_0x498bbd));_0x2c1fbd(_0x498bbd);})[_0x2c96('0x13')](function(_0x1622fd){logger[_0x2c96('0x10')](_0x2c96('0x22'),_0x1622fd[_0x2c96('0x12')],_0x3d12cf);_0x171ad7(_0x2ed3a1['error'](0x1f4,_0x1622fd[_0x2c96('0x12')]));});});};
\ No newline at end of file
index 4d0a446..b2443a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x607c=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./migration.controller','get','util'];(function(_0x22dac7,_0x45d32a){var _0x3e6cfa=function(_0x4c2e9d){while(--_0x4c2e9d){_0x22dac7['push'](_0x22dac7['shift']());}};_0x3e6cfa(++_0x45d32a);}(_0x607c,0x1dc));var _0xc607=function(_0x1c6d5f,_0x1a9b2c){_0x1c6d5f=_0x1c6d5f-0x0;var _0x26a3f8=_0x607c[_0x1c6d5f];return _0x26a3f8;};'use strict';var multer=require('multer');var util=require(_0xc607('0x0'));var path=require(_0xc607('0x1'));var timeout=require('connect-timeout');var express=require(_0xc607('0x2'));var router=express[_0xc607('0x3')]();var fs_extra=require(_0xc607('0x4'));var auth=require(_0xc607('0x5'));var interaction=require(_0xc607('0x6'));var config=require('../../config/environment');var controller=require(_0xc607('0x7'));router[_0xc607('0x8')]('/',controller['index']);module['exports']=router;
\ No newline at end of file
+var _0x91d9=['util','express','fs-extra','../../config/environment','index','exports'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x91d9,0x1ec));var _0x991d=function(_0x1ef827,_0x4f002c){_0x1ef827=_0x1ef827-0x0;var _0x574d68=_0x91d9[_0x1ef827];return _0x574d68;};'use strict';var multer=require('multer');var util=require(_0x991d('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x991d('0x1'));var router=express['Router']();var fs_extra=require(_0x991d('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x991d('0x3'));var controller=require('./migration.controller');router['get']('/',controller[_0x991d('0x4')]);module[_0x991d('0x5')]=router;
\ No newline at end of file
index 0af50ff..9d80ea0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac31=['STRING','exports'];(function(_0x5c58cb,_0x421722){var _0x35964f=function(_0x24b7f7){while(--_0x24b7f7){_0x5c58cb['push'](_0x5c58cb['shift']());}};_0x35964f(++_0x421722);}(_0xac31,0x16f));var _0x1ac3=function(_0x54309e,_0x3f8984){_0x54309e=_0x54309e-0x0;var _0x1ebb41=_0xac31[_0x54309e];return _0x1ebb41;};'use strict';var Sequelize=require('sequelize');module[_0x1ac3('0x0')]={'version':{'type':Sequelize[_0x1ac3('0x1')],'unique':'version'}};
\ No newline at end of file
+var _0xabe4=['exports','STRING','version','sequelize'];(function(_0x105ad4,_0x13e888){var _0x5de604=function(_0x4fb3f6){while(--_0x4fb3f6){_0x105ad4['push'](_0x105ad4['shift']());}};_0x5de604(++_0x13e888);}(_0xabe4,0x197));var _0x4abe=function(_0x95411e,_0x38b4c3){_0x95411e=_0x95411e-0x0;var _0x2c8718=_0xabe4[_0x95411e];return _0x2c8718;};'use strict';var Sequelize=require(_0x4abe('0x0'));module[_0x4abe('0x1')]={'version':{'type':Sequelize[_0x4abe('0x2')],'unique':_0x4abe('0x3')}};
\ No newline at end of file
index 28ca9bc..ba0edd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb48d=['filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','findAll','rows','catch','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','sendStatus','error','stack','name','send','Migration','fieldName','type','key','model','map','query'];(function(_0x25c533,_0x3da107){var _0x232d71=function(_0x127428){while(--_0x127428){_0x25c533['push'](_0x25c533['shift']());}};_0x232d71(++_0x3da107);}(_0xb48d,0xdb));var _0xdb48=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xb48d[_0x27af45];return _0x18df21;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdb48('0x0'));var zipdir=require(_0xdb48('0x1'));var jsonpatch=require(_0xdb48('0x2'));var rp=require(_0xdb48('0x3'));var moment=require('moment');var BPromise=require(_0xdb48('0x4'));var Mustache=require(_0xdb48('0x5'));var util=require(_0xdb48('0x6'));var path=require('path');var sox=require(_0xdb48('0x7'));var csv=require(_0xdb48('0x8'));var ejs=require(_0xdb48('0x9'));var fs=require('fs');var fs_extra=require(_0xdb48('0xa'));var _=require('lodash');var squel=require(_0xdb48('0xb'));var crypto=require(_0xdb48('0xc'));var jsforce=require(_0xdb48('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdb48('0xe'));var Papa=require('papaparse');var Redis=require(_0xdb48('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xdb48('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdb48('0x11'));var logger=require(_0xdb48('0x12'))(_0xdb48('0x13'));var utils=require(_0xdb48('0x14'));var config=require(_0xdb48('0x15'));var licenseUtil=require(_0xdb48('0x16'));var db=require(_0xdb48('0x17'))['db'];function respondWithStatusCode(_0x4b670f,_0xfa9623){_0xfa9623=_0xfa9623||0xcc;return function(_0x5e7453){if(_0x5e7453){return _0x4b670f['sendStatus'](_0xfa9623);}return _0x4b670f[_0xdb48('0x18')](_0xfa9623)[_0xdb48('0x19')]();};}function respondWithResult(_0x583b01,_0x5585cc){_0x5585cc=_0x5585cc||0xc8;return function(_0x47cc34){if(_0x47cc34){return _0x583b01[_0xdb48('0x18')](_0x5585cc)[_0xdb48('0x1a')](_0x47cc34);}};}function respondWithFilteredResult(_0x51748e,_0x41e7a0){return function(_0x448aa5){if(_0x448aa5){var _0x27d514=typeof _0x41e7a0[_0xdb48('0x1b')]===_0xdb48('0x1c')&&typeof _0x41e7a0[_0xdb48('0x1d')]==='undefined';var _0x970286=_0x448aa5['count'];var _0x93a085=_0x27d514?0x0:_0x41e7a0['offset'];var _0x24deb5=_0x27d514?_0x448aa5[_0xdb48('0x1e')]:_0x41e7a0['offset']+_0x41e7a0['limit'];var _0x4888fb;if(_0x24deb5>=_0x970286){_0x24deb5=_0x970286;_0x4888fb=0xc8;}else{_0x4888fb=0xce;}_0x51748e[_0xdb48('0x18')](_0x4888fb);return _0x51748e[_0xdb48('0x1f')](_0xdb48('0x20'),_0x93a085+'-'+_0x24deb5+'/'+_0x970286)[_0xdb48('0x1a')](_0x448aa5);}return null;};}function patchUpdates(_0x59a880){return function(_0x419e62){try{jsonpatch[_0xdb48('0x21')](_0x419e62,_0x59a880,!![]);}catch(_0x41b2bb){return BPromise['reject'](_0x41b2bb);}return _0x419e62['save']();};}function saveUpdates(_0x3a0250,_0x10be1a){return function(_0x52e2bf){if(_0x52e2bf){return _0x52e2bf[_0xdb48('0x22')](_0x3a0250)[_0xdb48('0x23')](function(_0x26bfee){return _0x26bfee;});}return null;};}function removeEntity(_0x303716,_0x2738d5){return function(_0x589519){if(_0x589519){return _0x589519[_0xdb48('0x24')]()[_0xdb48('0x23')](function(){_0x303716[_0xdb48('0x18')](0xcc)[_0xdb48('0x19')]();});}};}function handleEntityNotFound(_0x34f506,_0x36e641){return function(_0x45b160){if(!_0x45b160){_0x34f506[_0xdb48('0x25')](0x194);}return _0x45b160;};}function handleError(_0x107bac,_0x5ed5f6){_0x5ed5f6=_0x5ed5f6||0x1f4;return function(_0xb4bc3e){logger[_0xdb48('0x26')](_0xb4bc3e[_0xdb48('0x27')]);if(_0xb4bc3e[_0xdb48('0x28')]){delete _0xb4bc3e[_0xdb48('0x28')];}_0x107bac[_0xdb48('0x18')](_0x5ed5f6)[_0xdb48('0x29')](_0xb4bc3e);};}exports['index']=function(_0x8e9b85,_0x2db54b){var _0x466088={},_0x585520={},_0x555c39={'count':0x0,'rows':[]};var _0x3ebef9=_['map'](db[_0xdb48('0x2a')]['rawAttributes'],function(_0x1184d0){return{'name':_0x1184d0[_0xdb48('0x2b')],'type':_0x1184d0[_0xdb48('0x2c')][_0xdb48('0x2d')]};});_0x585520[_0xdb48('0x2e')]=_[_0xdb48('0x2f')](_0x3ebef9,_0xdb48('0x28'));_0x585520[_0xdb48('0x30')]=_['keys'](_0x8e9b85[_0xdb48('0x30')]);_0x585520[_0xdb48('0x31')]=_[_0xdb48('0x32')](_0x585520['model'],_0x585520[_0xdb48('0x30')]);_0x466088[_0xdb48('0x33')]=_['intersection'](_0x585520[_0xdb48('0x2e')],qs[_0xdb48('0x34')](_0x8e9b85[_0xdb48('0x30')][_0xdb48('0x34')]));_0x466088[_0xdb48('0x33')]=_0x466088['attributes'][_0xdb48('0x35')]?_0x466088[_0xdb48('0x33')]:_0x585520[_0xdb48('0x2e')];if(!_0x8e9b85[_0xdb48('0x30')][_0xdb48('0x36')]('nolimit')){_0x466088[_0xdb48('0x1d')]=qs[_0xdb48('0x1d')](_0x8e9b85[_0xdb48('0x30')][_0xdb48('0x1d')]);_0x466088['offset']=qs[_0xdb48('0x1b')](_0x8e9b85['query'][_0xdb48('0x1b')]);}_0x466088[_0xdb48('0x37')]=qs[_0xdb48('0x38')](_0x8e9b85[_0xdb48('0x30')]['sort']);_0x466088[_0xdb48('0x39')]=qs[_0xdb48('0x31')](_[_0xdb48('0x3a')](_0x8e9b85[_0xdb48('0x30')],_0x585520[_0xdb48('0x31')]),_0x3ebef9);if(_0x8e9b85[_0xdb48('0x30')]['filter']){_0x466088[_0xdb48('0x39')]=_['merge'](_0x466088[_0xdb48('0x39')],{'$or':_[_0xdb48('0x2f')](_0x3ebef9,function(_0x84488d){if(_0x84488d[_0xdb48('0x2c')]!==_0xdb48('0x3b')){var _0x5e94d0={};_0x5e94d0[_0x84488d['name']]={'$like':'%'+_0x8e9b85['query'][_0xdb48('0x3c')]+'%'};return _0x5e94d0;}})});}_0x466088=_[_0xdb48('0x3d')]({},_0x466088,_0x8e9b85[_0xdb48('0x3e')]);var _0x1267a5={'where':_0x466088[_0xdb48('0x39')]};return db[_0xdb48('0x2a')][_0xdb48('0x1e')](_0x1267a5)[_0xdb48('0x23')](function(_0x14983f){_0x555c39['count']=_0x14983f;if(_0x8e9b85[_0xdb48('0x30')][_0xdb48('0x3f')]){_0x466088['include']=[{'all':!![]}];}return db[_0xdb48('0x2a')][_0xdb48('0x40')](_0x466088);})['then'](function(_0x373141){_0x555c39[_0xdb48('0x41')]=_0x373141;return _0x555c39;})[_0xdb48('0x23')](respondWithFilteredResult(_0x2db54b,_0x466088))[_0xdb48('0x42')](handleError(_0x2db54b,null));};
\ No newline at end of file
+var _0x01cf=['merge','VIRTUAL','options','include','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','error','name','index','map','Migration','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x2c48e4,_0x3b6e4a){var _0x32a4d0=function(_0x1becc7){while(--_0x1becc7){_0x2c48e4['push'](_0x2c48e4['shift']());}};_0x32a4d0(++_0x3b6e4a);}(_0x01cf,0x190));var _0xf01c=function(_0x662865,_0x575515){_0x662865=_0x662865-0x0;var _0x1929c2=_0x01cf[_0x662865];return _0x1929c2;};'use strict';var emlformat=require(_0xf01c('0x0'));var rimraf=require(_0xf01c('0x1'));var zipdir=require(_0xf01c('0x2'));var jsonpatch=require(_0xf01c('0x3'));var rp=require('request-promise');var moment=require(_0xf01c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf01c('0x5'));var util=require('util');var path=require(_0xf01c('0x6'));var sox=require(_0xf01c('0x7'));var csv=require(_0xf01c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf01c('0x9'));var _=require(_0xf01c('0xa'));var squel=require(_0xf01c('0xb'));var crypto=require('crypto');var jsforce=require(_0xf01c('0xc'));var deskjs=require(_0xf01c('0xd'));var toCsv=require(_0xf01c('0x8'));var querystring=require('querystring');var Papa=require(_0xf01c('0xe'));var Redis=require(_0xf01c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf01c('0x10'));var as=require(_0xf01c('0x11'));var hardwareService=require(_0xf01c('0x12'));var logger=require(_0xf01c('0x13'))(_0xf01c('0x14'));var utils=require(_0xf01c('0x15'));var config=require(_0xf01c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf01c('0x17'))['db'];function respondWithStatusCode(_0x1d0349,_0x1527d5){_0x1527d5=_0x1527d5||0xcc;return function(_0x4ac4ae){if(_0x4ac4ae){return _0x1d0349[_0xf01c('0x18')](_0x1527d5);}return _0x1d0349[_0xf01c('0x19')](_0x1527d5)[_0xf01c('0x1a')]();};}function respondWithResult(_0x58b404,_0x25a288){_0x25a288=_0x25a288||0xc8;return function(_0x3525df){if(_0x3525df){return _0x58b404[_0xf01c('0x19')](_0x25a288)[_0xf01c('0x1b')](_0x3525df);}};}function respondWithFilteredResult(_0x241f6d,_0xc88359){return function(_0x109b5b){if(_0x109b5b){var _0x5438ba=typeof _0xc88359[_0xf01c('0x1c')]===_0xf01c('0x1d')&&typeof _0xc88359[_0xf01c('0x1e')]===_0xf01c('0x1d');var _0x35a932=_0x109b5b[_0xf01c('0x1f')];var _0x4cb8a3=_0x5438ba?0x0:_0xc88359[_0xf01c('0x1c')];var _0x9f3f92=_0x5438ba?_0x109b5b['count']:_0xc88359[_0xf01c('0x1c')]+_0xc88359[_0xf01c('0x1e')];var _0x230d91;if(_0x9f3f92>=_0x35a932){_0x9f3f92=_0x35a932;_0x230d91=0xc8;}else{_0x230d91=0xce;}_0x241f6d['status'](_0x230d91);return _0x241f6d[_0xf01c('0x20')]('Content-Range',_0x4cb8a3+'-'+_0x9f3f92+'/'+_0x35a932)['json'](_0x109b5b);}return null;};}function patchUpdates(_0x28a28d){return function(_0x49970b){try{jsonpatch[_0xf01c('0x21')](_0x49970b,_0x28a28d,!![]);}catch(_0xad0031){return BPromise[_0xf01c('0x22')](_0xad0031);}return _0x49970b['save']();};}function saveUpdates(_0x137fc7,_0x2c4635){return function(_0x1108eb){if(_0x1108eb){return _0x1108eb[_0xf01c('0x23')](_0x137fc7)[_0xf01c('0x24')](function(_0x1d532b){return _0x1d532b;});}return null;};}function removeEntity(_0x393b4c,_0x4236b5){return function(_0xb1ad07){if(_0xb1ad07){return _0xb1ad07[_0xf01c('0x25')]()[_0xf01c('0x24')](function(){_0x393b4c[_0xf01c('0x19')](0xcc)[_0xf01c('0x1a')]();});}};}function handleEntityNotFound(_0x182bfa,_0x568c4f){return function(_0x594aa3){if(!_0x594aa3){_0x182bfa[_0xf01c('0x18')](0x194);}return _0x594aa3;};}function handleError(_0x60b4ce,_0x450271){_0x450271=_0x450271||0x1f4;return function(_0x1d7686){logger[_0xf01c('0x26')](_0x1d7686['stack']);if(_0x1d7686[_0xf01c('0x27')]){delete _0x1d7686[_0xf01c('0x27')];}_0x60b4ce[_0xf01c('0x19')](_0x450271)['send'](_0x1d7686);};}exports[_0xf01c('0x28')]=function(_0x1e7ec4,_0x4983ba){var _0x5da6a3={},_0x17d616={},_0x2163c4={'count':0x0,'rows':[]};var _0x30de1c=_[_0xf01c('0x29')](db[_0xf01c('0x2a')][_0xf01c('0x2b')],function(_0x4a635e){return{'name':_0x4a635e[_0xf01c('0x2c')],'type':_0x4a635e[_0xf01c('0x2d')][_0xf01c('0x2e')]};});_0x17d616[_0xf01c('0x2f')]=_[_0xf01c('0x29')](_0x30de1c,_0xf01c('0x27'));_0x17d616['query']=_[_0xf01c('0x30')](_0x1e7ec4['query']);_0x17d616[_0xf01c('0x31')]=_[_0xf01c('0x32')](_0x17d616['model'],_0x17d616[_0xf01c('0x33')]);_0x5da6a3[_0xf01c('0x34')]=_['intersection'](_0x17d616[_0xf01c('0x2f')],qs[_0xf01c('0x35')](_0x1e7ec4[_0xf01c('0x33')][_0xf01c('0x35')]));_0x5da6a3[_0xf01c('0x34')]=_0x5da6a3['attributes'][_0xf01c('0x36')]?_0x5da6a3[_0xf01c('0x34')]:_0x17d616[_0xf01c('0x2f')];if(!_0x1e7ec4[_0xf01c('0x33')][_0xf01c('0x37')](_0xf01c('0x38'))){_0x5da6a3[_0xf01c('0x1e')]=qs[_0xf01c('0x1e')](_0x1e7ec4['query'][_0xf01c('0x1e')]);_0x5da6a3[_0xf01c('0x1c')]=qs[_0xf01c('0x1c')](_0x1e7ec4[_0xf01c('0x33')][_0xf01c('0x1c')]);}_0x5da6a3[_0xf01c('0x39')]=qs[_0xf01c('0x3a')](_0x1e7ec4[_0xf01c('0x33')]['sort']);_0x5da6a3[_0xf01c('0x3b')]=qs['filters'](_[_0xf01c('0x3c')](_0x1e7ec4[_0xf01c('0x33')],_0x17d616[_0xf01c('0x31')]),_0x30de1c);if(_0x1e7ec4[_0xf01c('0x33')][_0xf01c('0x3d')]){_0x5da6a3[_0xf01c('0x3b')]=_[_0xf01c('0x3e')](_0x5da6a3[_0xf01c('0x3b')],{'$or':_[_0xf01c('0x29')](_0x30de1c,function(_0x566d72){if(_0x566d72[_0xf01c('0x2d')]!==_0xf01c('0x3f')){var _0x24adc8={};_0x24adc8[_0x566d72[_0xf01c('0x27')]]={'$like':'%'+_0x1e7ec4[_0xf01c('0x33')]['filter']+'%'};return _0x24adc8;}})});}_0x5da6a3=_[_0xf01c('0x3e')]({},_0x5da6a3,_0x1e7ec4[_0xf01c('0x40')]);var _0x190e5f={'where':_0x5da6a3[_0xf01c('0x3b')]};return db[_0xf01c('0x2a')][_0xf01c('0x1f')](_0x190e5f)[_0xf01c('0x24')](function(_0x36dc7d){_0x2163c4['count']=_0x36dc7d;if(_0x1e7ec4[_0xf01c('0x33')]['includeAll']){_0x5da6a3[_0xf01c('0x41')]=[{'all':!![]}];}return db[_0xf01c('0x2a')]['findAll'](_0x5da6a3);})[_0xf01c('0x24')](function(_0x56727a){_0x2163c4['rows']=_0x56727a;return _0x2163c4;})[_0xf01c('0x24')](respondWithFilteredResult(_0x4983ba,_0x5da6a3))['catch'](handleError(_0x4983ba,null));};
\ No newline at end of file
index 535aeba..5018e01 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb18=['Migration','migrations','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define'];(function(_0x52261b,_0x3060e2){var _0x4e2ff6=function(_0x2ca4c1){while(--_0x2ca4c1){_0x52261b['push'](_0x52261b['shift']());}};_0x4e2ff6(++_0x3060e2);}(_0xcb18,0x1a6));var _0x8cb1=function(_0x27bb2e,_0x248bfa){_0x27bb2e=_0x27bb2e-0x0;var _0x169a48=_0xcb18[_0x27bb2e];return _0x169a48;};'use strict';var _=require(_0x8cb1('0x0'));var util=require(_0x8cb1('0x1'));var logger=require(_0x8cb1('0x2'))(_0x8cb1('0x3'));var moment=require(_0x8cb1('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8cb1('0x5'));var rimraf=require(_0x8cb1('0x6'));var config=require(_0x8cb1('0x7'));var attributes=require('./migration.attributes');module[_0x8cb1('0x8')]=function(_0xe66b17,_0x5f3dd2){return _0xe66b17[_0x8cb1('0x9')](_0x8cb1('0xa'),attributes,{'tableName':_0x8cb1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9017=['migrations','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','Migration'];(function(_0x1c6ea2,_0x5d565a){var _0xdb5d78=function(_0x735082){while(--_0x735082){_0x1c6ea2['push'](_0x1c6ea2['shift']());}};_0xdb5d78(++_0x5d565a);}(_0x9017,0xc9));var _0x7901=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9017[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7901('0x0'));var util=require(_0x7901('0x1'));var logger=require(_0x7901('0x2'))('api');var moment=require(_0x7901('0x3'));var BPromise=require(_0x7901('0x4'));var rp=require(_0x7901('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7901('0x6'));var config=require(_0x7901('0x7'));var attributes=require('./migration.attributes');module['exports']=function(_0xa6b6d0,_0x166164){return _0xa6b6d0['define'](_0x7901('0x8'),attributes,{'tableName':_0x7901('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index e4b9fcf..b02bf99 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa902=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','debug','Migration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x47e549,_0x2e53d6){var _0x251374=function(_0x400458){while(--_0x400458){_0x47e549['push'](_0x47e549['shift']());}};_0x251374(++_0x2e53d6);}(_0xa902,0x8d));var _0x2a90=function(_0x2d14fc,_0x3dacaa){_0x2d14fc=_0x2d14fc-0x0;var _0x30eda2=_0xa902[_0x2d14fc];return _0x30eda2;};'use strict';var _=require(_0x2a90('0x0'));var util=require(_0x2a90('0x1'));var moment=require(_0x2a90('0x2'));var BPromise=require(_0x2a90('0x3'));var rs=require(_0x2a90('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2a90('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2a90('0x6'));var config=require(_0x2a90('0x7'));var jayson=require(_0x2a90('0x8'));var client=jayson[_0x2a90('0x9')][_0x2a90('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25bcfc,_0x58369a,_0x4109e6){return new BPromise(function(_0x570659,_0x5ec2b9){return client[_0x2a90('0xb')](_0x25bcfc,_0x4109e6)[_0x2a90('0xc')](function(_0xe500bc){logger[_0x2a90('0xd')](_0x2a90('0xe'),_0x58369a,'request\x20sent');logger[_0x2a90('0xf')](_0x2a90('0x10'),_0x58369a,_0x2a90('0x11'),JSON[_0x2a90('0x12')](_0xe500bc));if(_0xe500bc['error']){if(_0xe500bc[_0x2a90('0x13')]['code']===0x1f4){logger[_0x2a90('0x13')]('Migration,\x20%s,\x20%s',_0x58369a,_0xe500bc[_0x2a90('0x13')]['message']);return _0x5ec2b9(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}logger[_0x2a90('0x13')]('Migration,\x20%s,\x20%s',_0x58369a,_0xe500bc['error']['message']);return _0x570659(_0xe500bc[_0x2a90('0x13')][_0x2a90('0x14')]);}else{logger['info'](_0x2a90('0xe'),_0x58369a,_0x2a90('0x11'));_0x570659(_0xe500bc[_0x2a90('0x15')][_0x2a90('0x14')]);}})[_0x2a90('0x16')](function(_0x37858e){logger[_0x2a90('0x13')](_0x2a90('0xe'),_0x58369a,_0x37858e);_0x5ec2b9(_0x37858e);});});}
\ No newline at end of file
+var _0xaaa2=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','stringify','error','code','Migration,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird'];(function(_0x49a84f,_0x3511e7){var _0xc79bb0=function(_0x67ac31){while(--_0x67ac31){_0x49a84f['push'](_0x49a84f['shift']());}};_0xc79bb0(++_0x3511e7);}(_0xaaa2,0xac));var _0x2aaa=function(_0x18dfc5,_0x11e545){_0x18dfc5=_0x18dfc5-0x0;var _0x51f497=_0xaaa2[_0x18dfc5];return _0x51f497;};'use strict';var _=require(_0x2aaa('0x0'));var util=require(_0x2aaa('0x1'));var moment=require(_0x2aaa('0x2'));var BPromise=require(_0x2aaa('0x3'));var rs=require(_0x2aaa('0x4'));var fs=require('fs');var Redis=require(_0x2aaa('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2aaa('0x6'));var logger=require('../../config/logger')(_0x2aaa('0x7'));var config=require(_0x2aaa('0x8'));var jayson=require(_0x2aaa('0x9'));var client=jayson[_0x2aaa('0xa')][_0x2aaa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x106af9,_0x4f51e6,_0x2f16d7){return new BPromise(function(_0x514c32,_0x505fe8){return client[_0x2aaa('0xc')](_0x106af9,_0x2f16d7)['then'](function(_0x1ad6e9){logger['info']('Migration,\x20%s,\x20%s',_0x4f51e6,_0x2aaa('0xd'));logger[_0x2aaa('0xe')]('Migration,\x20%s,\x20%s,\x20%s',_0x4f51e6,_0x2aaa('0xd'),JSON[_0x2aaa('0xf')](_0x1ad6e9));if(_0x1ad6e9[_0x2aaa('0x10')]){if(_0x1ad6e9['error'][_0x2aaa('0x11')]===0x1f4){logger[_0x2aaa('0x10')](_0x2aaa('0x12'),_0x4f51e6,_0x1ad6e9[_0x2aaa('0x10')][_0x2aaa('0x13')]);return _0x505fe8(_0x1ad6e9[_0x2aaa('0x10')][_0x2aaa('0x13')]);}logger[_0x2aaa('0x10')](_0x2aaa('0x12'),_0x4f51e6,_0x1ad6e9[_0x2aaa('0x10')][_0x2aaa('0x13')]);return _0x514c32(_0x1ad6e9[_0x2aaa('0x10')]['message']);}else{logger[_0x2aaa('0x14')]('Migration,\x20%s,\x20%s',_0x4f51e6,_0x2aaa('0xd'));_0x514c32(_0x1ad6e9[_0x2aaa('0x15')]['message']);}})['catch'](function(_0x50a767){logger[_0x2aaa('0x10')](_0x2aaa('0x12'),_0x4f51e6,_0x50a767);_0x505fe8(_0x50a767);});});}
\ No newline at end of file
index d5d2242..b4cd898 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7795=['update','delete','destroy','exports','util','express','Router','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put'];(function(_0xccb9a3,_0x35b7b9){var _0x516bf6=function(_0x4b7b3a){while(--_0x4b7b3a){_0xccb9a3['push'](_0xccb9a3['shift']());}};_0x516bf6(++_0x35b7b9);}(_0x7795,0x1a4));var _0x5779=function(_0x3d6373,_0x33e4a6){_0x3d6373=_0x3d6373-0x0;var _0x2d99c7=_0x7795[_0x3d6373];return _0x2d99c7;};'use strict';var multer=require('multer');var util=require(_0x5779('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5779('0x1'));var router=express[_0x5779('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5779('0x3'));var config=require(_0x5779('0x4'));var controller=require('./network.controller');router[_0x5779('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5779('0x5')](_0x5779('0x6'),auth[_0x5779('0x7')](),controller[_0x5779('0x8')]);router[_0x5779('0x9')]('/',auth['isAuthenticated'](),controller[_0x5779('0xa')]);router[_0x5779('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x5779('0xc')]);router[_0x5779('0xd')](_0x5779('0x6'),auth[_0x5779('0x7')](),controller[_0x5779('0xe')]);module[_0x5779('0xf')]=router;
\ No newline at end of file
+var _0x9536=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x591d02,_0x3ac586){var _0x5958f4=function(_0x3d913a){while(--_0x3d913a){_0x591d02['push'](_0x591d02['shift']());}};_0x5958f4(++_0x3ac586);}(_0x9536,0x179));var _0x6953=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9536[_0x465a0c];return _0x1e202e;};'use strict';var multer=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var path=require(_0x6953('0x2'));var timeout=require(_0x6953('0x3'));var express=require('express');var router=express[_0x6953('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6953('0x5'));var interaction=require(_0x6953('0x6'));var config=require(_0x6953('0x7'));var controller=require(_0x6953('0x8'));router[_0x6953('0x9')]('/',auth['isAuthenticated'](),controller[_0x6953('0xa')]);router[_0x6953('0x9')](_0x6953('0xb'),auth[_0x6953('0xc')](),controller[_0x6953('0xd')]);router['post']('/',auth[_0x6953('0xc')](),controller[_0x6953('0xe')]);router[_0x6953('0xf')]('/:id',auth[_0x6953('0xc')](),controller[_0x6953('0x10')]);router[_0x6953('0x11')](_0x6953('0xb'),auth[_0x6953('0xc')](),controller[_0x6953('0x12')]);module[_0x6953('0x13')]=router;
\ No newline at end of file
index cade893..0006800 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f49=['localnet','stun','turn','STRING','sequelize','exports','ENUM'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0x5f49,0x193));var _0x95f4=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x5f49[_0x1d1779];return _0x2377e9;};'use strict';var Sequelize=require(_0x95f4('0x0'));module[_0x95f4('0x1')]={'type':{'type':Sequelize[_0x95f4('0x2')](_0x95f4('0x3'),'externip',_0x95f4('0x4'),_0x95f4('0x5'))},'value':{'type':Sequelize[_0x95f4('0x6')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x95f4('0x6')]}};
\ No newline at end of file
+var _0xf713=['localnet','externip','stun','STRING','sequelize','exports','ENUM'];(function(_0x107848,_0x1f4f5f){var _0x4da5e1=function(_0x276067){while(--_0x276067){_0x107848['push'](_0x107848['shift']());}};_0x4da5e1(++_0x1f4f5f);}(_0xf713,0xeb));var _0x3f71=function(_0x45adb4,_0x2abb06){_0x45adb4=_0x45adb4-0x0;var _0x137296=_0xf713[_0x45adb4];return _0x137296;};'use strict';var Sequelize=require(_0x3f71('0x0'));module[_0x3f71('0x1')]={'type':{'type':Sequelize[_0x3f71('0x2')](_0x3f71('0x3'),_0x3f71('0x4'),_0x3f71('0x5'),'turn')},'value':{'type':Sequelize[_0x3f71('0x6')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 6433daf..25ea578 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b8a=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','destroy','stack','name','send','index','type','key','model','map','keys','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','options','Network','include','findAll','rows','show','params','rawAttributes','includeAll','find','create','transaction','body','toUpperCase','join','root','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','TURN','readFileSync','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','sequelize','STUN','server/files/templates/stun_multiple.ejs'];(function(_0x3026fb,_0x4154d4){var _0x5cd212=function(_0x5474a2){while(--_0x5474a2){_0x3026fb['push'](_0x3026fb['shift']());}};_0x5cd212(++_0x4154d4);}(_0x5b8a,0x14d));var _0xa5b8=function(_0x1ffef0,_0x4f71f1){_0x1ffef0=_0x1ffef0-0x0;var _0x1434cd=_0x5b8a[_0x1ffef0];return _0x1434cd;};'use strict';var emlformat=require(_0xa5b8('0x0'));var rimraf=require(_0xa5b8('0x1'));var zipdir=require(_0xa5b8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa5b8('0x3'));var moment=require(_0xa5b8('0x4'));var BPromise=require(_0xa5b8('0x5'));var Mustache=require(_0xa5b8('0x6'));var util=require(_0xa5b8('0x7'));var path=require(_0xa5b8('0x8'));var sox=require(_0xa5b8('0x9'));var csv=require('to-csv');var ejs=require(_0xa5b8('0xa'));var fs=require('fs');var fs_extra=require(_0xa5b8('0xb'));var _=require(_0xa5b8('0xc'));var squel=require(_0xa5b8('0xd'));var crypto=require('crypto');var jsforce=require(_0xa5b8('0xe'));var deskjs=require(_0xa5b8('0xf'));var toCsv=require(_0xa5b8('0x10'));var querystring=require('querystring');var Papa=require(_0xa5b8('0x11'));var Redis=require('ioredis');var authService=require(_0xa5b8('0x12'));var qs=require(_0xa5b8('0x13'));var as=require(_0xa5b8('0x14'));var hardwareService=require(_0xa5b8('0x15'));var logger=require('../../config/logger')(_0xa5b8('0x16'));var utils=require(_0xa5b8('0x17'));var config=require(_0xa5b8('0x18'));var licenseUtil=require(_0xa5b8('0x19'));var db=require(_0xa5b8('0x1a'))['db'];var jayson=require(_0xa5b8('0x1b'));var client=jayson[_0xa5b8('0x1c')][_0xa5b8('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x17db49,_0x254379,_0x212363,_0x551925){return new BPromise(function(_0x589e67,_0x168b4f){var _0x128765=_0x551925||client;return _0x128765[_0xa5b8('0x1e')](_0x17db49,_0x212363)[_0xa5b8('0x1f')](function(_0x469149){logger['info'](_0xa5b8('0x20'),_0x254379,_0xa5b8('0x21'));logger[_0xa5b8('0x22')](_0xa5b8('0x23'),_0x254379,_0xa5b8('0x21'),JSON[_0xa5b8('0x24')](_0x469149));if(_0x469149[_0xa5b8('0x25')]){if(_0x469149[_0xa5b8('0x25')][_0xa5b8('0x26')]===0x1f4){logger[_0xa5b8('0x25')](_0xa5b8('0x20'),_0x254379,_0x469149['error'][_0xa5b8('0x27')]);return _0x168b4f(_0x469149['error'][_0xa5b8('0x27')]);}logger[_0xa5b8('0x25')](_0xa5b8('0x20'),_0x254379,_0x469149[_0xa5b8('0x25')][_0xa5b8('0x27')]);return _0x589e67(_0x469149[_0xa5b8('0x25')]['message']);}else{logger[_0xa5b8('0x28')](_0xa5b8('0x20'),_0x254379,_0xa5b8('0x21'));_0x589e67(_0x469149['result'][_0xa5b8('0x27')]);}})[_0xa5b8('0x29')](function(_0x5c658c){logger['error']('Network,\x20%s,\x20%s',_0x254379,_0x5c658c);_0x168b4f(_0x5c658c);});});}function respondWithStatusCode(_0x26a4db,_0xf32250){_0xf32250=_0xf32250||0xcc;return function(_0x32222e){if(_0x32222e){return _0x26a4db[_0xa5b8('0x2a')](_0xf32250);}return _0x26a4db[_0xa5b8('0x2b')](_0xf32250)[_0xa5b8('0x2c')]();};}function respondWithResult(_0x13ee6e,_0x4546a1){_0x4546a1=_0x4546a1||0xc8;return function(_0xef3731){if(_0xef3731){return _0x13ee6e[_0xa5b8('0x2b')](_0x4546a1)['json'](_0xef3731);}};}function respondWithFilteredResult(_0x23924e,_0x30826c){return function(_0x13ff25){if(_0x13ff25){var _0x8158a6=typeof _0x30826c[_0xa5b8('0x2d')]===_0xa5b8('0x2e')&&typeof _0x30826c['limit']===_0xa5b8('0x2e');var _0x3dc432=_0x13ff25[_0xa5b8('0x2f')];var _0x2609f8=_0x8158a6?0x0:_0x30826c[_0xa5b8('0x2d')];var _0x2f11f7=_0x8158a6?_0x13ff25[_0xa5b8('0x2f')]:_0x30826c[_0xa5b8('0x2d')]+_0x30826c[_0xa5b8('0x30')];var _0x3dbc94;if(_0x2f11f7>=_0x3dc432){_0x2f11f7=_0x3dc432;_0x3dbc94=0xc8;}else{_0x3dbc94=0xce;}_0x23924e[_0xa5b8('0x2b')](_0x3dbc94);return _0x23924e[_0xa5b8('0x31')]('Content-Range',_0x2609f8+'-'+_0x2f11f7+'/'+_0x3dc432)[_0xa5b8('0x32')](_0x13ff25);}return null;};}function patchUpdates(_0x2ef2da){return function(_0x3e6c88){try{jsonpatch[_0xa5b8('0x33')](_0x3e6c88,_0x2ef2da,!![]);}catch(_0x4eab89){return BPromise[_0xa5b8('0x34')](_0x4eab89);}return _0x3e6c88[_0xa5b8('0x35')]();};}function saveUpdates(_0x13b150,_0x4e56fc){return function(_0x14c4b1){if(_0x14c4b1){return _0x14c4b1[_0xa5b8('0x36')](_0x13b150)[_0xa5b8('0x1f')](function(_0x218b37){return _0x218b37;});}return null;};}function removeEntity(_0x105925,_0x3bf589){return function(_0x53eca1){if(_0x53eca1){return _0x53eca1[_0xa5b8('0x37')]()[_0xa5b8('0x1f')](function(){_0x105925['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf6b9f9,_0x59d3a3){return function(_0x545a0a){if(!_0x545a0a){_0xf6b9f9[_0xa5b8('0x2a')](0x194);}return _0x545a0a;};}function handleError(_0x34399c,_0x566dad){_0x566dad=_0x566dad||0x1f4;return function(_0x43fd44){logger[_0xa5b8('0x25')](_0x43fd44[_0xa5b8('0x38')]);if(_0x43fd44['name']){delete _0x43fd44[_0xa5b8('0x39')];}_0x34399c[_0xa5b8('0x2b')](_0x566dad)[_0xa5b8('0x3a')](_0x43fd44);};}exports[_0xa5b8('0x3b')]=function(_0x110dd7,_0x4fd84a){var _0xffe16a={},_0x2b1778={},_0x5c0736={'count':0x0,'rows':[]};var _0xdc06cd=_['map'](db['Network']['rawAttributes'],function(_0x4f6c93){return{'name':_0x4f6c93['fieldName'],'type':_0x4f6c93[_0xa5b8('0x3c')][_0xa5b8('0x3d')]};});_0x2b1778[_0xa5b8('0x3e')]=_[_0xa5b8('0x3f')](_0xdc06cd,_0xa5b8('0x39'));_0x2b1778['query']=_[_0xa5b8('0x40')](_0x110dd7[_0xa5b8('0x41')]);_0x2b1778[_0xa5b8('0x42')]=_['intersection'](_0x2b1778['model'],_0x2b1778[_0xa5b8('0x41')]);_0xffe16a[_0xa5b8('0x43')]=_[_0xa5b8('0x44')](_0x2b1778['model'],qs[_0xa5b8('0x45')](_0x110dd7[_0xa5b8('0x41')][_0xa5b8('0x45')]));_0xffe16a[_0xa5b8('0x43')]=_0xffe16a[_0xa5b8('0x43')]['length']?_0xffe16a['attributes']:_0x2b1778[_0xa5b8('0x3e')];if(!_0x110dd7['query']['hasOwnProperty'](_0xa5b8('0x46'))){_0xffe16a['limit']=qs['limit'](_0x110dd7[_0xa5b8('0x41')]['limit']);_0xffe16a['offset']=qs[_0xa5b8('0x2d')](_0x110dd7['query'][_0xa5b8('0x2d')]);}_0xffe16a[_0xa5b8('0x47')]=qs['sort'](_0x110dd7['query'][_0xa5b8('0x48')]);_0xffe16a[_0xa5b8('0x49')]=qs[_0xa5b8('0x42')](_[_0xa5b8('0x4a')](_0x110dd7[_0xa5b8('0x41')],_0x2b1778['filters']),_0xdc06cd);if(_0x110dd7[_0xa5b8('0x41')][_0xa5b8('0x4b')]){_0xffe16a['where']=_['merge'](_0xffe16a[_0xa5b8('0x49')],{'$or':_['map'](_0xdc06cd,function(_0x225eee){if(_0x225eee[_0xa5b8('0x3c')]!==_0xa5b8('0x4c')){var _0x111175={};_0x111175[_0x225eee['name']]={'$like':'%'+_0x110dd7[_0xa5b8('0x41')]['filter']+'%'};return _0x111175;}})});}_0xffe16a=_['merge']({},_0xffe16a,_0x110dd7[_0xa5b8('0x4d')]);var _0x50a365={'where':_0xffe16a[_0xa5b8('0x49')]};return db[_0xa5b8('0x4e')][_0xa5b8('0x2f')](_0x50a365)[_0xa5b8('0x1f')](function(_0x27c70b){_0x5c0736[_0xa5b8('0x2f')]=_0x27c70b;if(_0x110dd7[_0xa5b8('0x41')]['includeAll']){_0xffe16a[_0xa5b8('0x4f')]=[{'all':!![]}];}return db['Network'][_0xa5b8('0x50')](_0xffe16a);})[_0xa5b8('0x1f')](function(_0x370a8e){_0x5c0736[_0xa5b8('0x51')]=_0x370a8e;return _0x5c0736;})[_0xa5b8('0x1f')](respondWithFilteredResult(_0x4fd84a,_0xffe16a))['catch'](handleError(_0x4fd84a,null));};exports[_0xa5b8('0x52')]=function(_0x51f194,_0x432109){var _0x111aef={'raw':!![],'where':{'id':_0x51f194[_0xa5b8('0x53')]['id']}},_0x6b807={};_0x6b807['model']=_[_0xa5b8('0x40')](db[_0xa5b8('0x4e')][_0xa5b8('0x54')]);_0x6b807[_0xa5b8('0x41')]=_[_0xa5b8('0x40')](_0x51f194[_0xa5b8('0x41')]);_0x6b807[_0xa5b8('0x42')]=_['intersection'](_0x6b807[_0xa5b8('0x3e')],_0x6b807[_0xa5b8('0x41')]);_0x111aef['attributes']=_[_0xa5b8('0x44')](_0x6b807[_0xa5b8('0x3e')],qs[_0xa5b8('0x45')](_0x51f194[_0xa5b8('0x41')]['fields']));_0x111aef[_0xa5b8('0x43')]=_0x111aef[_0xa5b8('0x43')]['length']?_0x111aef[_0xa5b8('0x43')]:_0x6b807[_0xa5b8('0x3e')];if(_0x51f194[_0xa5b8('0x41')][_0xa5b8('0x55')]){_0x111aef[_0xa5b8('0x4f')]=[{'all':!![]}];}_0x111aef=_['merge']({},_0x111aef,_0x51f194[_0xa5b8('0x4d')]);return db[_0xa5b8('0x4e')][_0xa5b8('0x56')](_0x111aef)[_0xa5b8('0x1f')](handleEntityNotFound(_0x432109,null))[_0xa5b8('0x1f')](respondWithResult(_0x432109,null))[_0xa5b8('0x29')](handleError(_0x432109,null));};exports[_0xa5b8('0x57')]=function(_0x1d7a49,_0x5492b5,_0xbf7a20){var _0x2d8f98;return db['sequelize'][_0xa5b8('0x58')](function(_0x5231ee){return db[_0xa5b8('0x4e')][_0xa5b8('0x57')](_0x1d7a49[_0xa5b8('0x59')],{'raw':!![]})[_0xa5b8('0x1f')](function(_0x45fa6c){_0x2d8f98=_0x45fa6c;return db[_0xa5b8('0x4e')]['findAll']({'where':{'type':_0x1d7a49[_0xa5b8('0x59')]['type']},'raw':!![]});})[_0xa5b8('0x1f')](function(_0x9b0f3f){if(_0x2d8f98[_0xa5b8('0x3c')][_0xa5b8('0x5a')]()=='STUN'){var _0x3679a9=fs['readFileSync'](path[_0xa5b8('0x5b')](config[_0xa5b8('0x5c')],'server/files/templates/stun_multiple.ejs'),_0xa5b8('0x5d'));var _0x5ec47c=ejs[_0xa5b8('0x5e')](_0x3679a9,{'networks':_0x9b0f3f||[]});fs[_0xa5b8('0x5f')](_0xa5b8('0x60'),_0x5ec47c);return respondWithRpcPromise(_0xa5b8('0x61'),_0xa5b8('0x57'),{'module':_0xa5b8('0x62')});}else if(_0x2d8f98[_0xa5b8('0x3c')]['toUpperCase']()==_0xa5b8('0x63')){var _0x4cdd86=fs[_0xa5b8('0x64')](path['join'](config[_0xa5b8('0x5c')],_0xa5b8('0x65')),'utf8');var _0x30796c=ejs['render'](_0x4cdd86,{'networks':_0x9b0f3f||[]});fs[_0xa5b8('0x5f')](_0xa5b8('0x66'),_0x30796c);return respondWithRpcPromise(_0xa5b8('0x61'),_0xa5b8('0x57'),{'module':_0xa5b8('0x62')});}else{var _0x40ded8=fs[_0xa5b8('0x64')](path['join'](config['root'],_0xa5b8('0x67')),_0xa5b8('0x5d'));var _0x45114d=ejs[_0xa5b8('0x5e')](_0x40ded8,{'networks':_0x9b0f3f||[]});fs[_0xa5b8('0x5f')](util[_0xa5b8('0x68')](_0xa5b8('0x69'),_0x1d7a49[_0xa5b8('0x59')][_0xa5b8('0x3c')][_0xa5b8('0x6a')]()),_0x45114d);return respondWithRpcPromise('Reload',_0xa5b8('0x57'),{'module':_0xa5b8('0x6b')});}return null;})['then'](function(){return _0x2d8f98;});})[_0xa5b8('0x1f')](respondWithResult(_0x5492b5,0xc9))[_0xa5b8('0x29')](handleError(_0x5492b5,null));};exports[_0xa5b8('0x36')]=function(_0x391f30,_0x5d90b2,_0x3054ba){var _0x2f9628;return db[_0xa5b8('0x6c')]['transaction'](function(_0x58623f){return db[_0xa5b8('0x4e')][_0xa5b8('0x56')]({'where':{'id':_0x391f30[_0xa5b8('0x53')]['id']}})[_0xa5b8('0x1f')](handleEntityNotFound(_0x5d90b2,null))[_0xa5b8('0x1f')](saveUpdates(_0x391f30[_0xa5b8('0x59')],null))[_0xa5b8('0x1f')](function(_0x4c8e5e){if(_0x4c8e5e){_0x2f9628=_0x4c8e5e;return db[_0xa5b8('0x4e')]['findAll']({'where':{'type':_0x2f9628['type']},'raw':!![]});}return null;})[_0xa5b8('0x1f')](function(_0x5492f6){if(_0x2f9628[_0xa5b8('0x3c')][_0xa5b8('0x5a')]()==_0xa5b8('0x6d')){var _0x5a9f9e=fs[_0xa5b8('0x64')](path[_0xa5b8('0x5b')](config[_0xa5b8('0x5c')],_0xa5b8('0x6e')),_0xa5b8('0x5d'));var _0x16af9e=ejs[_0xa5b8('0x5e')](_0x5a9f9e,{'networks':_0x5492f6||[]});fs[_0xa5b8('0x5f')](_0xa5b8('0x60'),_0x16af9e);return respondWithRpcPromise(_0xa5b8('0x61'),_0xa5b8('0x36'),{'module':_0xa5b8('0x62')});}else if(_0x2f9628[_0xa5b8('0x3c')][_0xa5b8('0x5a')]()==_0xa5b8('0x63')){var _0x266de2=fs[_0xa5b8('0x64')](path[_0xa5b8('0x5b')](config[_0xa5b8('0x5c')],_0xa5b8('0x65')),_0xa5b8('0x5d'));var _0x5c401d=ejs['render'](_0x266de2,{'networks':_0x5492f6||[]});fs[_0xa5b8('0x5f')](_0xa5b8('0x66'),_0x5c401d);return respondWithRpcPromise(_0xa5b8('0x61'),'update',{'module':_0xa5b8('0x62')});}else{var _0x4b8f21=fs['readFileSync'](path[_0xa5b8('0x5b')](config[_0xa5b8('0x5c')],'server/files/templates/network.ejs'),'utf8');var _0x164ee6=ejs[_0xa5b8('0x5e')](_0x4b8f21,{'networks':_0x5492f6||[]});fs[_0xa5b8('0x5f')](util[_0xa5b8('0x68')](_0xa5b8('0x69'),_0x391f30[_0xa5b8('0x59')][_0xa5b8('0x3c')][_0xa5b8('0x6a')]()),_0x164ee6);return respondWithRpcPromise(_0xa5b8('0x61'),_0xa5b8('0x36'),{'module':_0xa5b8('0x6b')});}return null;})[_0xa5b8('0x1f')](function(_0x2bae2c){if(_0x2bae2c){return _0x2f9628;}return null;});})[_0xa5b8('0x1f')](respondWithResult(_0x5d90b2,null))[_0xa5b8('0x29')](handleError(_0x5d90b2,null));};exports['destroy']=function(_0x1f2d00,_0x1593b4,_0x1bb596){var _0x2440c1;return db[_0xa5b8('0x4e')]['find']({'where':{'id':_0x1f2d00[_0xa5b8('0x53')]['id']}})[_0xa5b8('0x1f')](function(_0x4fdc0f){_0x2440c1=_0x4fdc0f;return _0x4fdc0f;})[_0xa5b8('0x1f')](handleEntityNotFound(_0x1593b4,null))[_0xa5b8('0x1f')](removeEntity(_0x1593b4,null))['then'](function(){if(_0x2440c1){return db[_0xa5b8('0x4e')][_0xa5b8('0x50')]({'where':{'type':_0x2440c1['type']},'raw':!![]});}})[_0xa5b8('0x1f')](function(_0x501917){if(_0x2440c1[_0xa5b8('0x3c')]['toUpperCase']()=='STUN'){var _0x5b6690=fs['readFileSync'](path[_0xa5b8('0x5b')](config[_0xa5b8('0x5c')],_0xa5b8('0x6e')),_0xa5b8('0x5d'));var _0x537b9a=ejs[_0xa5b8('0x5e')](_0x5b6690,{'networks':_0x501917||[]});fs['writeFileSync'](_0xa5b8('0x60'),_0x537b9a);return respondWithRpcPromise(_0xa5b8('0x61'),_0xa5b8('0x37'),{'module':_0xa5b8('0x62')});}else if(_0x2440c1[_0xa5b8('0x3c')][_0xa5b8('0x5a')]()=='TURN'){var _0x222224=fs[_0xa5b8('0x64')](path[_0xa5b8('0x5b')](config[_0xa5b8('0x5c')],_0xa5b8('0x65')),_0xa5b8('0x5d'));var _0x40c493=ejs[_0xa5b8('0x5e')](_0x222224,{'networks':_0x501917||[]});fs[_0xa5b8('0x5f')](_0xa5b8('0x66'),_0x40c493);return respondWithRpcPromise(_0xa5b8('0x61'),_0xa5b8('0x37'),{'module':_0xa5b8('0x62')});}else{var _0x498747=fs[_0xa5b8('0x64')](path[_0xa5b8('0x5b')](config[_0xa5b8('0x5c')],_0xa5b8('0x67')),_0xa5b8('0x5d'));var _0x3c7a8b=ejs[_0xa5b8('0x5e')](_0x498747,{'networks':_0x501917||[]});fs[_0xa5b8('0x5f')](util[_0xa5b8('0x68')](_0xa5b8('0x69'),_0x1f2d00[_0xa5b8('0x59')][_0xa5b8('0x3c')][_0xa5b8('0x6a')]()),_0x3c7a8b);return respondWithRpcPromise(_0xa5b8('0x61'),'destroy',{'module':_0xa5b8('0x6b')});}return null;})[_0xa5b8('0x29')](handleError(_0x1593b4,null));};
\ No newline at end of file
+var _0xe1c3=['map','Network','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','rawAttributes','length','find','create','transaction','body','toUpperCase','STUN','readFileSync','join','root','utf8','render','Reload','res_stun_monitor.so','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','update','sequelize','/etc/asterisk/stun_xcally.conf','TURN','destroy','server/files/templates/stun_multiple.ejs','eml-format','rimraf','zip-dir','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then','info','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','Network,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','name','send','index'];(function(_0x1bee7a,_0xacfa2a){var _0x5d69d7=function(_0x3b8891){while(--_0x3b8891){_0x1bee7a['push'](_0x1bee7a['shift']());}};_0x5d69d7(++_0xacfa2a);}(_0xe1c3,0x1de));var _0x3e1c=function(_0x2ef8ac,_0x46d2cd){_0x2ef8ac=_0x2ef8ac-0x0;var _0x2bb01f=_0xe1c3[_0x2ef8ac];return _0x2bb01f;};'use strict';var emlformat=require(_0x3e1c('0x0'));var rimraf=require(_0x3e1c('0x1'));var zipdir=require(_0x3e1c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3e1c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3e1c('0x4'));var util=require(_0x3e1c('0x5'));var path=require('path');var sox=require(_0x3e1c('0x6'));var csv=require(_0x3e1c('0x7'));var ejs=require(_0x3e1c('0x8'));var fs=require('fs');var fs_extra=require(_0x3e1c('0x9'));var _=require(_0x3e1c('0xa'));var squel=require(_0x3e1c('0xb'));var crypto=require('crypto');var jsforce=require(_0x3e1c('0xc'));var deskjs=require(_0x3e1c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3e1c('0xe'));var Papa=require('papaparse');var Redis=require(_0x3e1c('0xf'));var authService=require(_0x3e1c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3e1c('0x11'));var hardwareService=require(_0x3e1c('0x12'));var logger=require(_0x3e1c('0x13'))(_0x3e1c('0x14'));var utils=require(_0x3e1c('0x15'));var config=require(_0x3e1c('0x16'));var licenseUtil=require(_0x3e1c('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x3e1c('0x18'));var client=jayson[_0x3e1c('0x19')][_0x3e1c('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x430710,_0x179ea3,_0xebd44,_0x2956e5){return new BPromise(function(_0xcce3c9,_0x158e34){var _0x47620e=_0x2956e5||client;return _0x47620e[_0x3e1c('0x1b')](_0x430710,_0xebd44)[_0x3e1c('0x1c')](function(_0x3e2d90){logger[_0x3e1c('0x1d')]('Network,\x20%s,\x20%s',_0x179ea3,_0x3e1c('0x1e'));logger[_0x3e1c('0x1f')](_0x3e1c('0x20'),_0x179ea3,_0x3e1c('0x1e'),JSON['stringify'](_0x3e2d90));if(_0x3e2d90[_0x3e1c('0x21')]){if(_0x3e2d90['error']['code']===0x1f4){logger[_0x3e1c('0x21')](_0x3e1c('0x22'),_0x179ea3,_0x3e2d90[_0x3e1c('0x21')]['message']);return _0x158e34(_0x3e2d90[_0x3e1c('0x21')][_0x3e1c('0x23')]);}logger[_0x3e1c('0x21')](_0x3e1c('0x22'),_0x179ea3,_0x3e2d90[_0x3e1c('0x21')]['message']);return _0xcce3c9(_0x3e2d90[_0x3e1c('0x21')][_0x3e1c('0x23')]);}else{logger['info']('Network,\x20%s,\x20%s',_0x179ea3,_0x3e1c('0x1e'));_0xcce3c9(_0x3e2d90['result'][_0x3e1c('0x23')]);}})[_0x3e1c('0x24')](function(_0x23dacf){logger[_0x3e1c('0x21')](_0x3e1c('0x22'),_0x179ea3,_0x23dacf);_0x158e34(_0x23dacf);});});}function respondWithStatusCode(_0x22b977,_0x5f08c8){_0x5f08c8=_0x5f08c8||0xcc;return function(_0x4e0fa2){if(_0x4e0fa2){return _0x22b977[_0x3e1c('0x25')](_0x5f08c8);}return _0x22b977[_0x3e1c('0x26')](_0x5f08c8)[_0x3e1c('0x27')]();};}function respondWithResult(_0x575097,_0x394e9f){_0x394e9f=_0x394e9f||0xc8;return function(_0x14541e){if(_0x14541e){return _0x575097['status'](_0x394e9f)[_0x3e1c('0x28')](_0x14541e);}};}function respondWithFilteredResult(_0xef7ac3,_0x4ae385){return function(_0x3959d1){if(_0x3959d1){var _0x54925e=typeof _0x4ae385[_0x3e1c('0x29')]==='undefined'&&typeof _0x4ae385[_0x3e1c('0x2a')]===_0x3e1c('0x2b');var _0xb13ed=_0x3959d1[_0x3e1c('0x2c')];var _0x1d46da=_0x54925e?0x0:_0x4ae385['offset'];var _0x4f5f2e=_0x54925e?_0x3959d1[_0x3e1c('0x2c')]:_0x4ae385[_0x3e1c('0x29')]+_0x4ae385[_0x3e1c('0x2a')];var _0x3c5cfe;if(_0x4f5f2e>=_0xb13ed){_0x4f5f2e=_0xb13ed;_0x3c5cfe=0xc8;}else{_0x3c5cfe=0xce;}_0xef7ac3[_0x3e1c('0x26')](_0x3c5cfe);return _0xef7ac3[_0x3e1c('0x2d')]('Content-Range',_0x1d46da+'-'+_0x4f5f2e+'/'+_0xb13ed)[_0x3e1c('0x28')](_0x3959d1);}return null;};}function patchUpdates(_0x46ae67){return function(_0x40605c){try{jsonpatch[_0x3e1c('0x2e')](_0x40605c,_0x46ae67,!![]);}catch(_0x587520){return BPromise[_0x3e1c('0x2f')](_0x587520);}return _0x40605c[_0x3e1c('0x30')]();};}function saveUpdates(_0x3d4314,_0x978ed1){return function(_0xf293f0){if(_0xf293f0){return _0xf293f0['update'](_0x3d4314)[_0x3e1c('0x1c')](function(_0x59dd35){return _0x59dd35;});}return null;};}function removeEntity(_0xdb3a3b,_0x982a88){return function(_0x2477eb){if(_0x2477eb){return _0x2477eb['destroy']()['then'](function(){_0xdb3a3b[_0x3e1c('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9a42a3,_0x10c462){return function(_0x3bd773){if(!_0x3bd773){_0x9a42a3[_0x3e1c('0x25')](0x194);}return _0x3bd773;};}function handleError(_0x46c47c,_0x4e25eb){_0x4e25eb=_0x4e25eb||0x1f4;return function(_0x15b5cd){logger[_0x3e1c('0x21')](_0x15b5cd['stack']);if(_0x15b5cd['name']){delete _0x15b5cd[_0x3e1c('0x31')];}_0x46c47c[_0x3e1c('0x26')](_0x4e25eb)[_0x3e1c('0x32')](_0x15b5cd);};}exports[_0x3e1c('0x33')]=function(_0xc6857e,_0x49fda0){var _0x54e903={},_0x19baaa={},_0x37e209={'count':0x0,'rows':[]};var _0x5d5221=_[_0x3e1c('0x34')](db[_0x3e1c('0x35')]['rawAttributes'],function(_0x176cec){return{'name':_0x176cec[_0x3e1c('0x36')],'type':_0x176cec[_0x3e1c('0x37')][_0x3e1c('0x38')]};});_0x19baaa['model']=_[_0x3e1c('0x34')](_0x5d5221,_0x3e1c('0x31'));_0x19baaa[_0x3e1c('0x39')]=_[_0x3e1c('0x3a')](_0xc6857e[_0x3e1c('0x39')]);_0x19baaa[_0x3e1c('0x3b')]=_[_0x3e1c('0x3c')](_0x19baaa['model'],_0x19baaa[_0x3e1c('0x39')]);_0x54e903['attributes']=_[_0x3e1c('0x3c')](_0x19baaa[_0x3e1c('0x3d')],qs[_0x3e1c('0x3e')](_0xc6857e[_0x3e1c('0x39')][_0x3e1c('0x3e')]));_0x54e903[_0x3e1c('0x3f')]=_0x54e903[_0x3e1c('0x3f')]['length']?_0x54e903[_0x3e1c('0x3f')]:_0x19baaa['model'];if(!_0xc6857e[_0x3e1c('0x39')][_0x3e1c('0x40')]('nolimit')){_0x54e903[_0x3e1c('0x2a')]=qs[_0x3e1c('0x2a')](_0xc6857e[_0x3e1c('0x39')][_0x3e1c('0x2a')]);_0x54e903[_0x3e1c('0x29')]=qs[_0x3e1c('0x29')](_0xc6857e['query'][_0x3e1c('0x29')]);}_0x54e903['order']=qs['sort'](_0xc6857e[_0x3e1c('0x39')][_0x3e1c('0x41')]);_0x54e903[_0x3e1c('0x42')]=qs[_0x3e1c('0x3b')](_[_0x3e1c('0x43')](_0xc6857e['query'],_0x19baaa['filters']),_0x5d5221);if(_0xc6857e[_0x3e1c('0x39')][_0x3e1c('0x44')]){_0x54e903['where']=_[_0x3e1c('0x45')](_0x54e903[_0x3e1c('0x42')],{'$or':_['map'](_0x5d5221,function(_0x1cdc4b){if(_0x1cdc4b['type']!==_0x3e1c('0x46')){var _0x1bcd72={};_0x1bcd72[_0x1cdc4b[_0x3e1c('0x31')]]={'$like':'%'+_0xc6857e[_0x3e1c('0x39')][_0x3e1c('0x44')]+'%'};return _0x1bcd72;}})});}_0x54e903=_[_0x3e1c('0x45')]({},_0x54e903,_0xc6857e[_0x3e1c('0x47')]);var _0xc44aa={'where':_0x54e903[_0x3e1c('0x42')]};return db[_0x3e1c('0x35')]['count'](_0xc44aa)['then'](function(_0x56c8d1){_0x37e209['count']=_0x56c8d1;if(_0xc6857e[_0x3e1c('0x39')][_0x3e1c('0x48')]){_0x54e903[_0x3e1c('0x49')]=[{'all':!![]}];}return db['Network'][_0x3e1c('0x4a')](_0x54e903);})[_0x3e1c('0x1c')](function(_0x5a7f95){_0x37e209['rows']=_0x5a7f95;return _0x37e209;})['then'](respondWithFilteredResult(_0x49fda0,_0x54e903))[_0x3e1c('0x24')](handleError(_0x49fda0,null));};exports[_0x3e1c('0x4b')]=function(_0x4a6eb4,_0x2b2ae4){var _0x8ce839={'raw':!![],'where':{'id':_0x4a6eb4[_0x3e1c('0x4c')]['id']}},_0x5aca5e={};_0x5aca5e[_0x3e1c('0x3d')]=_[_0x3e1c('0x3a')](db[_0x3e1c('0x35')][_0x3e1c('0x4d')]);_0x5aca5e[_0x3e1c('0x39')]=_[_0x3e1c('0x3a')](_0x4a6eb4[_0x3e1c('0x39')]);_0x5aca5e[_0x3e1c('0x3b')]=_['intersection'](_0x5aca5e[_0x3e1c('0x3d')],_0x5aca5e[_0x3e1c('0x39')]);_0x8ce839[_0x3e1c('0x3f')]=_[_0x3e1c('0x3c')](_0x5aca5e['model'],qs[_0x3e1c('0x3e')](_0x4a6eb4['query'][_0x3e1c('0x3e')]));_0x8ce839[_0x3e1c('0x3f')]=_0x8ce839[_0x3e1c('0x3f')][_0x3e1c('0x4e')]?_0x8ce839[_0x3e1c('0x3f')]:_0x5aca5e[_0x3e1c('0x3d')];if(_0x4a6eb4[_0x3e1c('0x39')][_0x3e1c('0x48')]){_0x8ce839[_0x3e1c('0x49')]=[{'all':!![]}];}_0x8ce839=_[_0x3e1c('0x45')]({},_0x8ce839,_0x4a6eb4[_0x3e1c('0x47')]);return db[_0x3e1c('0x35')][_0x3e1c('0x4f')](_0x8ce839)[_0x3e1c('0x1c')](handleEntityNotFound(_0x2b2ae4,null))[_0x3e1c('0x1c')](respondWithResult(_0x2b2ae4,null))[_0x3e1c('0x24')](handleError(_0x2b2ae4,null));};exports[_0x3e1c('0x50')]=function(_0x5a00d2,_0xac842d,_0x549f26){var _0x2bc181;return db['sequelize'][_0x3e1c('0x51')](function(_0x458772){return db[_0x3e1c('0x35')][_0x3e1c('0x50')](_0x5a00d2[_0x3e1c('0x52')],{'raw':!![]})[_0x3e1c('0x1c')](function(_0x28e898){_0x2bc181=_0x28e898;return db['Network']['findAll']({'where':{'type':_0x5a00d2[_0x3e1c('0x52')][_0x3e1c('0x37')]},'raw':!![]});})[_0x3e1c('0x1c')](function(_0x5da612){if(_0x2bc181[_0x3e1c('0x37')][_0x3e1c('0x53')]()==_0x3e1c('0x54')){var _0x2a02ec=fs[_0x3e1c('0x55')](path[_0x3e1c('0x56')](config[_0x3e1c('0x57')],'server/files/templates/stun_multiple.ejs'),_0x3e1c('0x58'));var _0x71cfe9=ejs[_0x3e1c('0x59')](_0x2a02ec,{'networks':_0x5da612||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x71cfe9);return respondWithRpcPromise(_0x3e1c('0x5a'),_0x3e1c('0x50'),{'module':_0x3e1c('0x5b')});}else if(_0x2bc181[_0x3e1c('0x37')][_0x3e1c('0x53')]()=='TURN'){var _0x103430=fs[_0x3e1c('0x55')](path['join'](config['root'],_0x3e1c('0x5c')),_0x3e1c('0x58'));var _0x26978f=ejs[_0x3e1c('0x59')](_0x103430,{'networks':_0x5da612||[]});fs[_0x3e1c('0x5d')](_0x3e1c('0x5e'),_0x26978f);return respondWithRpcPromise(_0x3e1c('0x5a'),_0x3e1c('0x50'),{'module':_0x3e1c('0x5b')});}else{var _0x16c01c=fs[_0x3e1c('0x55')](path[_0x3e1c('0x56')](config['root'],_0x3e1c('0x5f')),_0x3e1c('0x58'));var _0x2acf20=ejs['render'](_0x16c01c,{'networks':_0x5da612||[]});fs[_0x3e1c('0x5d')](util[_0x3e1c('0x60')](_0x3e1c('0x61'),_0x5a00d2[_0x3e1c('0x52')][_0x3e1c('0x37')][_0x3e1c('0x62')]()),_0x2acf20);return respondWithRpcPromise('Reload',_0x3e1c('0x50'),{'module':_0x3e1c('0x63')});}return null;})['then'](function(){return _0x2bc181;});})[_0x3e1c('0x1c')](respondWithResult(_0xac842d,0xc9))[_0x3e1c('0x24')](handleError(_0xac842d,null));};exports[_0x3e1c('0x64')]=function(_0x4dd17e,_0x3276ec,_0x4d05de){var _0x60ad0a;return db[_0x3e1c('0x65')]['transaction'](function(_0xd6f304){return db[_0x3e1c('0x35')]['find']({'where':{'id':_0x4dd17e['params']['id']}})[_0x3e1c('0x1c')](handleEntityNotFound(_0x3276ec,null))['then'](saveUpdates(_0x4dd17e[_0x3e1c('0x52')],null))['then'](function(_0x23b596){if(_0x23b596){_0x60ad0a=_0x23b596;return db[_0x3e1c('0x35')]['findAll']({'where':{'type':_0x60ad0a[_0x3e1c('0x37')]},'raw':!![]});}return null;})['then'](function(_0x3408fc){if(_0x60ad0a['type'][_0x3e1c('0x53')]()==_0x3e1c('0x54')){var _0xa3db55=fs[_0x3e1c('0x55')](path['join'](config[_0x3e1c('0x57')],'server/files/templates/stun_multiple.ejs'),'utf8');var _0x46a950=ejs[_0x3e1c('0x59')](_0xa3db55,{'networks':_0x3408fc||[]});fs[_0x3e1c('0x5d')](_0x3e1c('0x66'),_0x46a950);return respondWithRpcPromise(_0x3e1c('0x5a'),'update',{'module':_0x3e1c('0x5b')});}else if(_0x60ad0a[_0x3e1c('0x37')][_0x3e1c('0x53')]()==_0x3e1c('0x67')){var _0x1efaa4=fs[_0x3e1c('0x55')](path[_0x3e1c('0x56')](config['root'],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x50c9af=ejs['render'](_0x1efaa4,{'networks':_0x3408fc||[]});fs[_0x3e1c('0x5d')]('/etc/asterisk/turn_xcally.conf',_0x50c9af);return respondWithRpcPromise(_0x3e1c('0x5a'),_0x3e1c('0x64'),{'module':_0x3e1c('0x5b')});}else{var _0x419b1b=fs[_0x3e1c('0x55')](path[_0x3e1c('0x56')](config[_0x3e1c('0x57')],_0x3e1c('0x5f')),_0x3e1c('0x58'));var _0x1bc0ef=ejs[_0x3e1c('0x59')](_0x419b1b,{'networks':_0x3408fc||[]});fs['writeFileSync'](util[_0x3e1c('0x60')](_0x3e1c('0x61'),_0x4dd17e[_0x3e1c('0x52')][_0x3e1c('0x37')]['toLowerCase']()),_0x1bc0ef);return respondWithRpcPromise(_0x3e1c('0x5a'),_0x3e1c('0x64'),{'module':_0x3e1c('0x63')});}return null;})[_0x3e1c('0x1c')](function(_0xb0c4ee){if(_0xb0c4ee){return _0x60ad0a;}return null;});})[_0x3e1c('0x1c')](respondWithResult(_0x3276ec,null))['catch'](handleError(_0x3276ec,null));};exports[_0x3e1c('0x68')]=function(_0x12238c,_0x23b7e7,_0x3f97b1){var _0x28885c;return db['Network']['find']({'where':{'id':_0x12238c[_0x3e1c('0x4c')]['id']}})['then'](function(_0x10aa21){_0x28885c=_0x10aa21;return _0x10aa21;})[_0x3e1c('0x1c')](handleEntityNotFound(_0x23b7e7,null))[_0x3e1c('0x1c')](removeEntity(_0x23b7e7,null))['then'](function(){if(_0x28885c){return db[_0x3e1c('0x35')]['findAll']({'where':{'type':_0x28885c[_0x3e1c('0x37')]},'raw':!![]});}})[_0x3e1c('0x1c')](function(_0x309ada){if(_0x28885c[_0x3e1c('0x37')][_0x3e1c('0x53')]()=='STUN'){var _0x159635=fs[_0x3e1c('0x55')](path['join'](config['root'],_0x3e1c('0x69')),'utf8');var _0x50e9e8=ejs[_0x3e1c('0x59')](_0x159635,{'networks':_0x309ada||[]});fs[_0x3e1c('0x5d')](_0x3e1c('0x66'),_0x50e9e8);return respondWithRpcPromise(_0x3e1c('0x5a'),'destroy',{'module':_0x3e1c('0x5b')});}else if(_0x28885c[_0x3e1c('0x37')]['toUpperCase']()=='TURN'){var _0x2d12d1=fs[_0x3e1c('0x55')](path['join'](config[_0x3e1c('0x57')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x2e923f=ejs[_0x3e1c('0x59')](_0x2d12d1,{'networks':_0x309ada||[]});fs[_0x3e1c('0x5d')](_0x3e1c('0x5e'),_0x2e923f);return respondWithRpcPromise('Reload',_0x3e1c('0x68'),{'module':_0x3e1c('0x5b')});}else{var _0x175b58=fs[_0x3e1c('0x55')](path[_0x3e1c('0x56')](config['root'],_0x3e1c('0x5f')),'utf8');var _0x294cf4=ejs[_0x3e1c('0x59')](_0x175b58,{'networks':_0x309ada||[]});fs[_0x3e1c('0x5d')](util[_0x3e1c('0x60')](_0x3e1c('0x61'),_0x12238c['body'][_0x3e1c('0x37')][_0x3e1c('0x62')]()),_0x294cf4);return respondWithRpcPromise(_0x3e1c('0x5a'),_0x3e1c('0x68'),{'module':_0x3e1c('0x63')});}return null;})[_0x3e1c('0x24')](handleError(_0x23b7e7,null));};
\ No newline at end of file
index c08f549..6f202a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a2c=['path','rimraf','../../config/environment','exports','network','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1a2ec2,_0x26533e){var _0x2c040c=function(_0x46769f){while(--_0x46769f){_0x1a2ec2['push'](_0x1a2ec2['shift']());}};_0x2c040c(++_0x26533e);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x2a864c,_0x16307b){_0x2a864c=_0x2a864c-0x0;var _0x1866a2=_0x7a2c[_0x2a864c];return _0x1866a2;};'use strict';var _=require(_0xc7a2('0x0'));var util=require('util');var logger=require(_0xc7a2('0x1'))(_0xc7a2('0x2'));var moment=require(_0xc7a2('0x3'));var BPromise=require(_0xc7a2('0x4'));var rp=require(_0xc7a2('0x5'));var fs=require('fs');var path=require(_0xc7a2('0x6'));var rimraf=require(_0xc7a2('0x7'));var config=require(_0xc7a2('0x8'));var attributes=require('./network.attributes');module[_0xc7a2('0x9')]=function(_0x1ddbae,_0x5f334e){return _0x1ddbae['define']('Network',attributes,{'tableName':_0xc7a2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3667=['network','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./network.attributes','exports','Network'];(function(_0x4cf48,_0x32239a){var _0x112a8d=function(_0x50c34a){while(--_0x50c34a){_0x4cf48['push'](_0x4cf48['shift']());}};_0x112a8d(++_0x32239a);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7366('0x0'));var util=require(_0x7366('0x1'));var logger=require(_0x7366('0x2'))(_0x7366('0x3'));var moment=require(_0x7366('0x4'));var BPromise=require('bluebird');var rp=require(_0x7366('0x5'));var fs=require('fs');var path=require(_0x7366('0x6'));var rimraf=require('rimraf');var config=require(_0x7366('0x7'));var attributes=require(_0x7366('0x8'));module[_0x7366('0x9')]=function(_0x1c0cf4,_0x101e3d){return _0x1c0cf4['define'](_0x7366('0xa'),attributes,{'tableName':_0x7366('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 37388ff..1f2e022 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x3eb559,_0x375066){_0x3eb559=_0x3eb559-0x0;var _0x2716ee=_0x7a54[_0x3eb559];return _0x2716ee;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
+var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x7a54,0x106));var _0x47a5=function(_0x1dfcaa,_0x39635c){_0x1dfcaa=_0x1dfcaa-0x0;var _0x55d4b9=_0x7a54[_0x1dfcaa];return _0x55d4b9;};'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 4e8fe4d..8212fb4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4db3=['exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications','getInteractions','/:id/users','getAgents','post','create','addDisposition','/:id/notify','notify','addApplications','addAgents','send','put','update','delete','destroy','removeDispositions','removeAgents'];(function(_0x4087cc,_0x2b2f48){var _0x52874a=function(_0x563a4e){while(--_0x563a4e){_0x4087cc['push'](_0x4087cc['shift']());}};_0x52874a(++_0x2b2f48);}(_0x4db3,0x1b1));var _0x34db=function(_0x3c5013,_0x3e326a){_0x3c5013=_0x3c5013-0x0;var _0x28ccb1=_0x4db3[_0x3c5013];return _0x28ccb1;};'use strict';var multer=require(_0x34db('0x0'));var util=require(_0x34db('0x1'));var path=require(_0x34db('0x2'));var timeout=require(_0x34db('0x3'));var express=require('express');var router=express[_0x34db('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x34db('0x5'));var config=require(_0x34db('0x6'));var controller=require('./openchannelAccount.controller');router[_0x34db('0x7')]('/',auth[_0x34db('0x8')](),controller[_0x34db('0x9')]);router[_0x34db('0x7')]('/describe',auth[_0x34db('0x8')](),controller[_0x34db('0xa')]);router['get'](_0x34db('0xb'),auth[_0x34db('0x8')](),controller[_0x34db('0xc')]);router[_0x34db('0x7')](_0x34db('0xd'),auth['isAuthenticated'](),controller[_0x34db('0xe')]);router['get'](_0x34db('0xf'),auth[_0x34db('0x8')](),controller['getAnswers']);router[_0x34db('0x7')](_0x34db('0x10'),auth[_0x34db('0x8')](),controller[_0x34db('0x11')]);router[_0x34db('0x7')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x34db('0x12')]);router[_0x34db('0x7')](_0x34db('0x13'),auth[_0x34db('0x8')](),controller[_0x34db('0x14')]);router[_0x34db('0x15')]('/',auth['isAuthenticated'](),controller[_0x34db('0x16')]);router[_0x34db('0x15')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x34db('0x17')]);router[_0x34db('0x15')](_0x34db('0xf'),auth[_0x34db('0x8')](),controller['addAnswer']);router['post'](_0x34db('0x18'),controller[_0x34db('0x19')]);router[_0x34db('0x15')]('/:id/applications',auth['isAuthenticated'](),controller[_0x34db('0x1a')]);router[_0x34db('0x15')](_0x34db('0x13'),auth['isAuthenticated'](),controller[_0x34db('0x1b')]);router[_0x34db('0x15')]('/:id/send',auth[_0x34db('0x8')](),controller[_0x34db('0x1c')]);router[_0x34db('0x1d')]('/:id',auth['isAuthenticated'](),controller[_0x34db('0x1e')]);router[_0x34db('0x1f')](_0x34db('0xb'),auth['isAuthenticated'](),controller[_0x34db('0x20')]);router[_0x34db('0x1f')]('/:id/dispositions',auth[_0x34db('0x8')](),controller[_0x34db('0x21')]);router[_0x34db('0x1f')](_0x34db('0xf'),auth[_0x34db('0x8')](),controller['removeAnswers']);router[_0x34db('0x1f')]('/:id/users',auth[_0x34db('0x8')](),controller[_0x34db('0x22')]);module[_0x34db('0x23')]=router;
\ No newline at end of file
+var _0x7cc0=['/:id/dispositions','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','show','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','create','post','addDisposition','addAnswer','/:id/notify','notify','/:id/applications','addApplications','/:id/send','send','put','/:id','update','delete'];(function(_0x25a4c3,_0x47a662){var _0x3f7c43=function(_0x374f5b){while(--_0x374f5b){_0x25a4c3['push'](_0x25a4c3['shift']());}};_0x3f7c43(++_0x47a662);}(_0x7cc0,0x15b));var _0x07cc=function(_0x6a8397,_0x150428){_0x6a8397=_0x6a8397-0x0;var _0x2d56e6=_0x7cc0[_0x6a8397];return _0x2d56e6;};'use strict';var multer=require(_0x07cc('0x0'));var util=require(_0x07cc('0x1'));var path=require('path');var timeout=require(_0x07cc('0x2'));var express=require('express');var router=express[_0x07cc('0x3')]();var fs_extra=require(_0x07cc('0x4'));var auth=require(_0x07cc('0x5'));var interaction=require(_0x07cc('0x6'));var config=require(_0x07cc('0x7'));var controller=require(_0x07cc('0x8'));router[_0x07cc('0x9')]('/',auth[_0x07cc('0xa')](),controller['index']);router[_0x07cc('0x9')]('/describe',auth[_0x07cc('0xa')](),controller['describe']);router[_0x07cc('0x9')]('/:id',auth[_0x07cc('0xa')](),controller[_0x07cc('0xb')]);router[_0x07cc('0x9')]('/:id/dispositions',auth[_0x07cc('0xa')](),controller['getDispositions']);router[_0x07cc('0x9')](_0x07cc('0xc'),auth['isAuthenticated'](),controller[_0x07cc('0xd')]);router[_0x07cc('0x9')]('/:id/applications',auth[_0x07cc('0xa')](),controller[_0x07cc('0xe')]);router['get'](_0x07cc('0xf'),auth[_0x07cc('0xa')](),controller[_0x07cc('0x10')]);router[_0x07cc('0x9')](_0x07cc('0x11'),auth[_0x07cc('0xa')](),controller[_0x07cc('0x12')]);router['post']('/',auth[_0x07cc('0xa')](),controller[_0x07cc('0x13')]);router[_0x07cc('0x14')]('/:id/dispositions',auth[_0x07cc('0xa')](),controller[_0x07cc('0x15')]);router[_0x07cc('0x14')](_0x07cc('0xc'),auth[_0x07cc('0xa')](),controller[_0x07cc('0x16')]);router[_0x07cc('0x14')](_0x07cc('0x17'),controller[_0x07cc('0x18')]);router[_0x07cc('0x14')](_0x07cc('0x19'),auth[_0x07cc('0xa')](),controller[_0x07cc('0x1a')]);router[_0x07cc('0x14')](_0x07cc('0x11'),auth[_0x07cc('0xa')](),controller['addAgents']);router[_0x07cc('0x14')](_0x07cc('0x1b'),auth[_0x07cc('0xa')](),controller[_0x07cc('0x1c')]);router[_0x07cc('0x1d')](_0x07cc('0x1e'),auth[_0x07cc('0xa')](),controller[_0x07cc('0x1f')]);router[_0x07cc('0x20')](_0x07cc('0x1e'),auth[_0x07cc('0xa')](),controller['destroy']);router[_0x07cc('0x20')](_0x07cc('0x21'),auth[_0x07cc('0xa')](),controller[_0x07cc('0x22')]);router['delete'](_0x07cc('0xc'),auth[_0x07cc('0xa')](),controller[_0x07cc('0x23')]);router[_0x07cc('0x20')](_0x07cc('0x11'),auth[_0x07cc('0xa')](),controller[_0x07cc('0x24')]);module[_0x07cc('0x25')]=router;
\ No newline at end of file
index ecf9c5a..3642524 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb86f=['generate','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','STRING','name'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb86f,0x141));var _0xfb86=function(_0x181030,_0x210b2f){_0x181030=_0x181030-0x0;var _0x458a57=_0xb86f[_0x181030];return _0x458a57;};'use strict';var Sequelize=require(_0xfb86('0x0'));var rs=require(_0xfb86('0x1'));module['exports']={'name':{'type':Sequelize[_0xfb86('0x2')],'unique':_0xfb86('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xfb86('0x2')],'defaultValue':function(){return rs[_0xfb86('0x4')]();}},'replyUri':{'type':Sequelize[_0xfb86('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xfb86('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xfb86('0x5')],'defaultValue':function(){return _0xfb86('0x6');}},'notificationSound':{'type':Sequelize[_0xfb86('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfb86('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xfb86('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfb86('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xfb86('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xfb86('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xfb86('0x7')],'defaultValue':![],'comment':_0xfb86('0xa'),'set':function(_0x468abd){if(!_0x468abd)this[_0xfb86('0xb')](_0xfb86('0xc'),null);this['setDataValue']('mandatoryDisposition',_0x468abd);}}};
\ No newline at end of file
+var _0x828c=['randomstring','exports','STRING','name','generate','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x828c,0x1db));var _0xc828=function(_0x4c463a,_0x4411bb){_0x4c463a=_0x4c463a-0x0;var _0x54f816=_0x828c[_0x4c463a];return _0x54f816;};'use strict';var Sequelize=require(_0xc828('0x0'));var rs=require(_0xc828('0x1'));module[_0xc828('0x2')]={'name':{'type':Sequelize[_0xc828('0x3')],'unique':_0xc828('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xc828('0x5')]();}},'replyUri':{'type':Sequelize[_0xc828('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xc828('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xc828('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc828('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc828('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xc828('0x3')]},'queueTransfer':{'type':Sequelize[_0xc828('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc828('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xc828('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc828('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0xc828('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xc828('0xa'),'set':function(_0x5ccc03){if(!_0x5ccc03)this[_0xc828('0xb')](_0xc828('0xc'),null);this[_0xc828('0xb')](_0xc828('0xd'),_0x5ccc03);}}};
\ No newline at end of file
index 6253e3f..823f4ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac38=['filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','Pause','describe','OpenchannelAccountId','Disposition','getDispositions','findOne','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','Sequelize','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','isNil','from','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','asc','ListId','contact','firstName','lastName','threadId','OpenchannelInteraction','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','bulkCreate','findAndCountAll','priority','getApplications','Owner','fullname','internal','Tags','color','tag','addAgents','emit','userOpenchannelAccount:save','removeAgents','userOpenchannelAccount:remove','getAgents','OpenchannelMessage','dataValues','Messages','rimraf','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','stack','name','send','index','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','key','model','query'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xac38,0x135));var _0x8ac3=function(_0x9cfe28,_0x1a335c){_0x9cfe28=_0x9cfe28-0x0;var _0x54a1d0=_0xac38[_0x9cfe28];return _0x54a1d0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ac3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8ac3('0x1'));var moment=require(_0x8ac3('0x2'));var BPromise=require(_0x8ac3('0x3'));var Mustache=require(_0x8ac3('0x4'));var util=require('util');var path=require(_0x8ac3('0x5'));var sox=require(_0x8ac3('0x6'));var csv=require(_0x8ac3('0x7'));var ejs=require(_0x8ac3('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8ac3('0x9'));var jsforce=require(_0x8ac3('0xa'));var deskjs=require(_0x8ac3('0xb'));var toCsv=require('to-csv');var querystring=require(_0x8ac3('0xc'));var Papa=require(_0x8ac3('0xd'));var Redis=require(_0x8ac3('0xe'));var authService=require(_0x8ac3('0xf'));var qs=require(_0x8ac3('0x10'));var as=require(_0x8ac3('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8ac3('0x12'))(_0x8ac3('0x13'));var utils=require(_0x8ac3('0x14'));var config=require(_0x8ac3('0x15'));var licenseUtil=require(_0x8ac3('0x16'));var db=require('../../mysqldb')['db'];config[_0x8ac3('0x17')]=_[_0x8ac3('0x18')](config[_0x8ac3('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x8ac3('0x19'))(new Redis(config[_0x8ac3('0x17')]));require(_0x8ac3('0x1a'))['register'](socket);var jayson=require(_0x8ac3('0x1b'));var client=jayson[_0x8ac3('0x1c')][_0x8ac3('0x1d')]({'port':0x232c});var client9002=jayson[_0x8ac3('0x1c')][_0x8ac3('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x46dfc5,_0x522911,_0x3063c2,_0x4221a5){return new BPromise(function(_0x597eb4,_0x3ed33c){var _0x3f0b67=_0x4221a5||client;return _0x3f0b67['request'](_0x46dfc5,_0x3063c2)[_0x8ac3('0x1e')](function(_0x12f501){logger[_0x8ac3('0x1f')](_0x8ac3('0x20'),_0x522911,'request\x20sent');logger[_0x8ac3('0x21')](_0x8ac3('0x22'),_0x522911,_0x8ac3('0x23'),JSON[_0x8ac3('0x24')](_0x12f501));if(_0x12f501['error']){if(_0x12f501[_0x8ac3('0x25')][_0x8ac3('0x26')]===0x1f4){logger['error'](_0x8ac3('0x20'),_0x522911,_0x12f501[_0x8ac3('0x25')][_0x8ac3('0x27')]);return _0x3ed33c(_0x12f501[_0x8ac3('0x25')][_0x8ac3('0x27')]);}logger['error'](_0x8ac3('0x20'),_0x522911,_0x12f501[_0x8ac3('0x25')]['message']);return _0x597eb4(_0x12f501[_0x8ac3('0x25')]['message']);}else{logger[_0x8ac3('0x1f')](_0x8ac3('0x20'),_0x522911,_0x8ac3('0x23'));_0x597eb4(_0x12f501['result']['message']);}})[_0x8ac3('0x28')](function(_0xdb6fa1){logger[_0x8ac3('0x25')](_0x8ac3('0x20'),_0x522911,_0xdb6fa1);_0x3ed33c(_0xdb6fa1);});});}function respondWithStatusCode(_0x30ef15,_0x57cd69){_0x57cd69=_0x57cd69||0xcc;return function(_0x348529){if(_0x348529){return _0x30ef15[_0x8ac3('0x29')](_0x57cd69);}return _0x30ef15[_0x8ac3('0x2a')](_0x57cd69)[_0x8ac3('0x2b')]();};}function respondWithResult(_0x14dfb0,_0x330e05){_0x330e05=_0x330e05||0xc8;return function(_0x4a26e3){if(_0x4a26e3){return _0x14dfb0[_0x8ac3('0x2a')](_0x330e05)['json'](_0x4a26e3);}};}function respondWithFilteredResult(_0x833d95,_0x535729){return function(_0x5d8a07){if(_0x5d8a07){var _0x4dd187=typeof _0x535729[_0x8ac3('0x2c')]===_0x8ac3('0x2d')&&typeof _0x535729['limit']==='undefined';var _0x2ef800=_0x5d8a07[_0x8ac3('0x2e')];var _0x344d6d=_0x4dd187?0x0:_0x535729['offset'];var _0x4873e0=_0x4dd187?_0x5d8a07[_0x8ac3('0x2e')]:_0x535729[_0x8ac3('0x2c')]+_0x535729['limit'];var _0x3bde32;if(_0x4873e0>=_0x2ef800){_0x4873e0=_0x2ef800;_0x3bde32=0xc8;}else{_0x3bde32=0xce;}_0x833d95['status'](_0x3bde32);return _0x833d95[_0x8ac3('0x2f')](_0x8ac3('0x30'),_0x344d6d+'-'+_0x4873e0+'/'+_0x2ef800)[_0x8ac3('0x31')](_0x5d8a07);}return null;};}function patchUpdates(_0xfcd3d7){return function(_0x2356c6){try{jsonpatch[_0x8ac3('0x32')](_0x2356c6,_0xfcd3d7,!![]);}catch(_0xe7c3dd){return BPromise[_0x8ac3('0x33')](_0xe7c3dd);}return _0x2356c6[_0x8ac3('0x34')]();};}function saveUpdates(_0x5eb0ee,_0x37bee2){return function(_0x449167){if(_0x449167){return _0x449167[_0x8ac3('0x35')](_0x5eb0ee)[_0x8ac3('0x1e')](function(_0x3b872b){return _0x3b872b;});}return null;};}function removeEntity(_0x57073f,_0x3338bc){return function(_0x4115a5){if(_0x4115a5){return _0x4115a5[_0x8ac3('0x36')]()['then'](function(){var _0x1b0d6c=_0x4115a5[_0x8ac3('0x37')]({'plain':!![]});var _0x32e763=_0x8ac3('0x38');return db[_0x8ac3('0x39')][_0x8ac3('0x36')]({'where':{'type':_0x32e763,'resourceId':_0x1b0d6c['id']}})[_0x8ac3('0x1e')](function(){return _0x4115a5;});})[_0x8ac3('0x1e')](function(){_0x57073f[_0x8ac3('0x2a')](0xcc)[_0x8ac3('0x2b')]();});}};}function handleEntityNotFound(_0x594134,_0x2d71ce){return function(_0x3ef094){if(!_0x3ef094){_0x594134[_0x8ac3('0x29')](0x194);}return _0x3ef094;};}function handleError(_0x1bc4b1,_0x4b058a){_0x4b058a=_0x4b058a||0x1f4;return function(_0x453ef0){logger['error'](_0x453ef0[_0x8ac3('0x3a')]);if(_0x453ef0['name']){delete _0x453ef0[_0x8ac3('0x3b')];}_0x1bc4b1[_0x8ac3('0x2a')](_0x4b058a)[_0x8ac3('0x3c')](_0x453ef0);};}exports[_0x8ac3('0x3d')]=function(_0x3e5ccf,_0x1f353c){var _0x3e60ca={'include':[{'model':db['Pause'],'as':_0x8ac3('0x3e')}]},_0x5dd3df={},_0x2aa319={'count':0x0,'rows':[]};var _0xbe7c75=_[_0x8ac3('0x3f')](db[_0x8ac3('0x40')][_0x8ac3('0x41')],function(_0x5e74c3){return{'name':_0x5e74c3['fieldName'],'type':_0x5e74c3['type'][_0x8ac3('0x42')]};});_0x5dd3df[_0x8ac3('0x43')]=_[_0x8ac3('0x3f')](_0xbe7c75,_0x8ac3('0x3b'));_0x5dd3df[_0x8ac3('0x44')]=_['keys'](_0x3e5ccf[_0x8ac3('0x44')]);_0x5dd3df[_0x8ac3('0x45')]=_[_0x8ac3('0x46')](_0x5dd3df['model'],_0x5dd3df['query']);_0x3e60ca['attributes']=_[_0x8ac3('0x46')](_0x5dd3df[_0x8ac3('0x43')],qs[_0x8ac3('0x47')](_0x3e5ccf[_0x8ac3('0x44')]['fields']));_0x3e60ca[_0x8ac3('0x48')]=_0x3e60ca[_0x8ac3('0x48')][_0x8ac3('0x49')]?_0x3e60ca['attributes']:_0x5dd3df[_0x8ac3('0x43')];if(!_0x3e5ccf[_0x8ac3('0x44')][_0x8ac3('0x4a')](_0x8ac3('0x4b'))){_0x3e60ca[_0x8ac3('0x4c')]=qs[_0x8ac3('0x4c')](_0x3e5ccf['query'][_0x8ac3('0x4c')]);_0x3e60ca[_0x8ac3('0x2c')]=qs[_0x8ac3('0x2c')](_0x3e5ccf[_0x8ac3('0x44')][_0x8ac3('0x2c')]);}_0x3e60ca[_0x8ac3('0x4d')]=qs[_0x8ac3('0x4e')](_0x3e5ccf[_0x8ac3('0x44')][_0x8ac3('0x4e')]);_0x3e60ca[_0x8ac3('0x4f')]=qs[_0x8ac3('0x45')](_[_0x8ac3('0x50')](_0x3e5ccf['query'],_0x5dd3df[_0x8ac3('0x45')]),_0xbe7c75);if(_0x3e5ccf[_0x8ac3('0x44')][_0x8ac3('0x51')]){_0x3e60ca[_0x8ac3('0x4f')]=_[_0x8ac3('0x52')](_0x3e60ca[_0x8ac3('0x4f')],{'$or':_[_0x8ac3('0x3f')](_0xbe7c75,function(_0x4a30ad){if(_0x4a30ad[_0x8ac3('0x53')]!==_0x8ac3('0x54')){var _0x177bdb={};_0x177bdb[_0x4a30ad[_0x8ac3('0x3b')]]={'$like':'%'+_0x3e5ccf[_0x8ac3('0x44')]['filter']+'%'};return _0x177bdb;}})});}_0x3e60ca=_['merge']({},_0x3e60ca,_0x3e5ccf[_0x8ac3('0x55')]);var _0x4fc844={'where':_0x3e60ca['where']};return db[_0x8ac3('0x40')]['count'](_0x4fc844)[_0x8ac3('0x1e')](function(_0x6f40b4){_0x2aa319[_0x8ac3('0x2e')]=_0x6f40b4;if(_0x3e5ccf['query'][_0x8ac3('0x56')]){_0x3e60ca[_0x8ac3('0x57')]=[{'all':!![]}];}return db[_0x8ac3('0x40')][_0x8ac3('0x58')](_0x3e60ca);})[_0x8ac3('0x1e')](function(_0x57c706){_0x2aa319['rows']=_0x57c706;return _0x2aa319;})[_0x8ac3('0x1e')](respondWithFilteredResult(_0x1f353c,_0x3e60ca))['catch'](handleError(_0x1f353c,null));};exports[_0x8ac3('0x59')]=function(_0x1a013f,_0x4c1be9){var _0x2c5ec1={'raw':![],'where':{'id':_0x1a013f['params']['id']},'include':[{'model':db['Pause'],'as':_0x8ac3('0x3e')}]},_0x5a6265={};_0x5a6265[_0x8ac3('0x43')]=_[_0x8ac3('0x5a')](db['OpenchannelAccount'][_0x8ac3('0x41')]);_0x5a6265['query']=_[_0x8ac3('0x5a')](_0x1a013f['query']);_0x5a6265[_0x8ac3('0x45')]=_[_0x8ac3('0x46')](_0x5a6265[_0x8ac3('0x43')],_0x5a6265['query']);_0x2c5ec1[_0x8ac3('0x48')]=_[_0x8ac3('0x46')](_0x5a6265[_0x8ac3('0x43')],qs[_0x8ac3('0x47')](_0x1a013f[_0x8ac3('0x44')][_0x8ac3('0x47')]));_0x2c5ec1[_0x8ac3('0x48')]=_0x2c5ec1[_0x8ac3('0x48')][_0x8ac3('0x49')]?_0x2c5ec1[_0x8ac3('0x48')]:_0x5a6265['model'];if(_0x1a013f[_0x8ac3('0x44')]['includeAll']){_0x2c5ec1[_0x8ac3('0x57')]=[{'all':!![]}];}_0x2c5ec1=_[_0x8ac3('0x52')]({},_0x2c5ec1,_0x1a013f[_0x8ac3('0x55')]);return db[_0x8ac3('0x40')][_0x8ac3('0x5b')](_0x2c5ec1)['then'](handleEntityNotFound(_0x4c1be9,null))[_0x8ac3('0x1e')](respondWithResult(_0x4c1be9,null))[_0x8ac3('0x28')](handleError(_0x4c1be9,null));};exports[_0x8ac3('0x5c')]=function(_0x329c06,_0x1b7cac){return db[_0x8ac3('0x40')][_0x8ac3('0x5c')](_0x329c06[_0x8ac3('0x5d')],{})['then'](function(_0x385920){var _0x192006=_0x329c06[_0x8ac3('0x5e')][_0x8ac3('0x37')]({'plain':!![]});if(!_0x192006)throw new Error(_0x8ac3('0x5f'));if(_0x192006[_0x8ac3('0x60')]===_0x8ac3('0x5e')){var _0x953f9c=_0x385920['get']({'plain':!![]});var _0x5f2889=_0x8ac3('0x38');return db['UserProfileSection'][_0x8ac3('0x5b')]({'where':{'name':_0x5f2889,'userProfileId':_0x192006[_0x8ac3('0x61')]},'raw':!![]})[_0x8ac3('0x1e')](function(_0x36a556){if(_0x36a556&&_0x36a556[_0x8ac3('0x62')]===0x0){return db[_0x8ac3('0x39')]['create']({'name':_0x953f9c[_0x8ac3('0x3b')],'resourceId':_0x953f9c['id'],'type':_0x36a556[_0x8ac3('0x3b')],'sectionId':_0x36a556['id']},{})[_0x8ac3('0x1e')](function(){return _0x385920;});}else{return _0x385920;}})[_0x8ac3('0x28')](function(_0x336956){logger[_0x8ac3('0x25')](_0x8ac3('0x63'),_0x336956);throw _0x336956;});}return _0x385920;})['then'](respondWithResult(_0x1b7cac,0xc9))['catch'](handleError(_0x1b7cac,null));};exports[_0x8ac3('0x35')]=function(_0x173991,_0x4c8143){if(_0x173991[_0x8ac3('0x5d')]['id']){delete _0x173991[_0x8ac3('0x5d')]['id'];}return db[_0x8ac3('0x40')][_0x8ac3('0x5b')]({'where':{'id':_0x173991[_0x8ac3('0x64')]['id']},'include':[{'model':db[_0x8ac3('0x65')],'as':'mandatoryDispositionPause'}]})[_0x8ac3('0x1e')](handleEntityNotFound(_0x4c8143,null))[_0x8ac3('0x1e')](saveUpdates(_0x173991[_0x8ac3('0x5d')],null))[_0x8ac3('0x1e')](respondWithResult(_0x4c8143,null))[_0x8ac3('0x28')](handleError(_0x4c8143,null));};exports[_0x8ac3('0x36')]=function(_0x1da4e3,_0x45cc57){return db[_0x8ac3('0x40')][_0x8ac3('0x5b')]({'where':{'id':_0x1da4e3['params']['id']}})[_0x8ac3('0x1e')](handleEntityNotFound(_0x45cc57,null))[_0x8ac3('0x1e')](removeEntity(_0x45cc57,null))['catch'](handleError(_0x45cc57,null));};exports[_0x8ac3('0x66')]=function(_0x5d552e,_0x4d031d){return db[_0x8ac3('0x40')][_0x8ac3('0x66')]()[_0x8ac3('0x1e')](respondWithResult(_0x4d031d,null))[_0x8ac3('0x28')](handleError(_0x4d031d,null));};exports['addDisposition']=function(_0x3e1118,_0x2ebb02,_0x2c5761){if(_0x3e1118['body']['id']){delete _0x3e1118['body']['id'];}return db[_0x8ac3('0x40')][_0x8ac3('0x5b')]({'where':{'id':_0x3e1118['params']['id']}})[_0x8ac3('0x1e')](handleEntityNotFound(_0x2ebb02,null))[_0x8ac3('0x1e')](function(_0x5cc5f5){if(_0x5cc5f5){_0x3e1118[_0x8ac3('0x5d')][_0x8ac3('0x67')]=_0x5cc5f5['id'];return db[_0x8ac3('0x68')][_0x8ac3('0x5c')](_0x3e1118['body']);}})[_0x8ac3('0x1e')](respondWithResult(_0x2ebb02,null))[_0x8ac3('0x28')](handleError(_0x2ebb02,null));};exports[_0x8ac3('0x69')]=function(_0x1c3bd8,_0x12c73f,_0x19c6d9){var _0x31126b={'raw':![],'where':{}};var _0x21d57d={};var _0x277607={'count':0x0,'rows':[]};return db[_0x8ac3('0x40')][_0x8ac3('0x6a')]({'where':{'id':_0x1c3bd8[_0x8ac3('0x64')]['id']}})['then'](handleEntityNotFound(_0x12c73f,null))[_0x8ac3('0x1e')](function(_0x36598e){if(_0x36598e){_0x21d57d['model']=_[_0x8ac3('0x5a')](db[_0x8ac3('0x68')][_0x8ac3('0x41')]);_0x21d57d[_0x8ac3('0x44')]=_[_0x8ac3('0x5a')](_0x1c3bd8[_0x8ac3('0x44')]);_0x21d57d['filters']=_[_0x8ac3('0x46')](_0x21d57d[_0x8ac3('0x43')],_0x21d57d[_0x8ac3('0x44')]);_0x31126b[_0x8ac3('0x48')]=_[_0x8ac3('0x46')](_0x21d57d['model'],qs['fields'](_0x1c3bd8['query'][_0x8ac3('0x47')]));_0x31126b['attributes']=_0x31126b[_0x8ac3('0x48')][_0x8ac3('0x49')]?_0x31126b[_0x8ac3('0x48')]:_0x21d57d[_0x8ac3('0x43')];if(!_0x1c3bd8['query'][_0x8ac3('0x4a')](_0x8ac3('0x4b'))){_0x31126b[_0x8ac3('0x4c')]=qs['limit'](_0x1c3bd8[_0x8ac3('0x44')]['limit']);_0x31126b[_0x8ac3('0x2c')]=qs[_0x8ac3('0x2c')](_0x1c3bd8[_0x8ac3('0x44')][_0x8ac3('0x2c')]);}_0x31126b[_0x8ac3('0x4d')]=qs[_0x8ac3('0x4e')](_0x1c3bd8[_0x8ac3('0x44')][_0x8ac3('0x4e')]);_0x31126b[_0x8ac3('0x4f')]=qs[_0x8ac3('0x45')](_[_0x8ac3('0x50')](_0x1c3bd8[_0x8ac3('0x44')],_0x21d57d[_0x8ac3('0x45')]));_0x31126b[_0x8ac3('0x4f')]['OpenchannelAccountId']=_0x36598e['id'];if(_0x1c3bd8[_0x8ac3('0x44')][_0x8ac3('0x51')]){_0x31126b[_0x8ac3('0x4f')]=_[_0x8ac3('0x52')](_0x31126b[_0x8ac3('0x4f')],{'$or':_[_0x8ac3('0x3f')](_0x31126b['attributes'],function(_0x51bde4){var _0x2f50e3={};_0x2f50e3[_0x51bde4]={'$like':'%'+_0x1c3bd8[_0x8ac3('0x44')][_0x8ac3('0x51')]+'%'};return _0x2f50e3;})});}_0x31126b=_['merge']({},_0x31126b,_0x1c3bd8[_0x8ac3('0x55')]);return db[_0x8ac3('0x68')][_0x8ac3('0x2e')]({'where':_0x31126b[_0x8ac3('0x4f')]})[_0x8ac3('0x1e')](function(_0x2f0216){_0x277607['count']=_0x2f0216;if(_0x1c3bd8['query'][_0x8ac3('0x56')]){_0x31126b[_0x8ac3('0x57')]=[{'all':!![]}];}return db[_0x8ac3('0x68')][_0x8ac3('0x58')](_0x31126b);})[_0x8ac3('0x1e')](function(_0x228c20){_0x277607[_0x8ac3('0x6b')]=_0x228c20;return _0x277607;});}})[_0x8ac3('0x1e')](respondWithFilteredResult(_0x12c73f,_0x31126b))[_0x8ac3('0x28')](handleError(_0x12c73f,null));};exports['removeDispositions']=function(_0xf696f7,_0x3dba62,_0x28bb92){return db[_0x8ac3('0x40')][_0x8ac3('0x5b')]({'where':{'id':_0xf696f7['params']['id']}})['then'](handleEntityNotFound(_0x3dba62,null))['then'](function(_0x29df84){if(_0x29df84){return _0x29df84[_0x8ac3('0x6c')](_0xf696f7[_0x8ac3('0x44')][_0x8ac3('0x6d')]);}})['then'](respondWithStatusCode(_0x3dba62,null))[_0x8ac3('0x28')](handleError(_0x3dba62,null));};exports[_0x8ac3('0x6e')]=function(_0x40b544,_0xa781c2,_0x14fe07){if(_0x40b544['body']['id']){delete _0x40b544[_0x8ac3('0x5d')]['id'];}return db['OpenchannelAccount'][_0x8ac3('0x5b')]({'where':{'id':_0x40b544[_0x8ac3('0x64')]['id']}})[_0x8ac3('0x1e')](handleEntityNotFound(_0xa781c2,null))['then'](function(_0x156a0f){if(_0x156a0f){_0x40b544[_0x8ac3('0x5d')][_0x8ac3('0x67')]=_0x156a0f['id'];return db[_0x8ac3('0x6f')][_0x8ac3('0x5c')](_0x40b544[_0x8ac3('0x5d')]);}})['then'](respondWithResult(_0xa781c2,null))['catch'](handleError(_0xa781c2,null));};exports[_0x8ac3('0x70')]=function(_0x1b19a8,_0x57298d,_0x347b24){var _0x31c3d8={'raw':![],'where':{}};var _0x37c724={};var _0x5e71cc={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x8ac3('0x6a')]({'where':{'id':_0x1b19a8[_0x8ac3('0x64')]['id']}})[_0x8ac3('0x1e')](handleEntityNotFound(_0x57298d,null))[_0x8ac3('0x1e')](function(_0x5cc5a2){if(_0x5cc5a2){_0x37c724[_0x8ac3('0x43')]=_[_0x8ac3('0x5a')](db[_0x8ac3('0x6f')][_0x8ac3('0x41')]);_0x37c724['query']=_['keys'](_0x1b19a8[_0x8ac3('0x44')]);_0x37c724['filters']=_[_0x8ac3('0x46')](_0x37c724[_0x8ac3('0x43')],_0x37c724[_0x8ac3('0x44')]);_0x31c3d8['attributes']=_[_0x8ac3('0x46')](_0x37c724[_0x8ac3('0x43')],qs[_0x8ac3('0x47')](_0x1b19a8[_0x8ac3('0x44')]['fields']));_0x31c3d8[_0x8ac3('0x48')]=_0x31c3d8[_0x8ac3('0x48')][_0x8ac3('0x49')]?_0x31c3d8[_0x8ac3('0x48')]:_0x37c724[_0x8ac3('0x43')];if(!_0x1b19a8[_0x8ac3('0x44')]['hasOwnProperty'](_0x8ac3('0x4b'))){_0x31c3d8[_0x8ac3('0x4c')]=qs[_0x8ac3('0x4c')](_0x1b19a8[_0x8ac3('0x44')][_0x8ac3('0x4c')]);_0x31c3d8[_0x8ac3('0x2c')]=qs[_0x8ac3('0x2c')](_0x1b19a8[_0x8ac3('0x44')][_0x8ac3('0x2c')]);}_0x31c3d8[_0x8ac3('0x4d')]=qs[_0x8ac3('0x4e')](_0x1b19a8[_0x8ac3('0x44')][_0x8ac3('0x4e')]);_0x31c3d8['where']=qs['filters'](_[_0x8ac3('0x50')](_0x1b19a8[_0x8ac3('0x44')],_0x37c724[_0x8ac3('0x45')]));_0x31c3d8[_0x8ac3('0x4f')]['OpenchannelAccountId']=_0x5cc5a2['id'];if(_0x1b19a8[_0x8ac3('0x44')]['filter']){_0x31c3d8[_0x8ac3('0x4f')]=_[_0x8ac3('0x52')](_0x31c3d8[_0x8ac3('0x4f')],{'$or':_[_0x8ac3('0x3f')](_0x31c3d8[_0x8ac3('0x48')],function(_0x47e536){var _0xc1988b={};_0xc1988b[_0x47e536]={'$like':'%'+_0x1b19a8['query'][_0x8ac3('0x51')]+'%'};return _0xc1988b;})});}_0x31c3d8=_[_0x8ac3('0x52')]({},_0x31c3d8,_0x1b19a8[_0x8ac3('0x55')]);return db[_0x8ac3('0x6f')]['count']({'where':_0x31c3d8[_0x8ac3('0x4f')]})['then'](function(_0x26be20){_0x5e71cc[_0x8ac3('0x2e')]=_0x26be20;if(_0x1b19a8[_0x8ac3('0x44')][_0x8ac3('0x56')]){_0x31c3d8['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x8ac3('0x58')](_0x31c3d8);})[_0x8ac3('0x1e')](function(_0x8786a2){_0x5e71cc['rows']=_0x8786a2;return _0x5e71cc;});}})[_0x8ac3('0x1e')](respondWithFilteredResult(_0x57298d,_0x31c3d8))[_0x8ac3('0x28')](handleError(_0x57298d,null));};exports[_0x8ac3('0x71')]=function(_0x29d00c,_0x2ca4ab,_0x3ff0ea){return db['OpenchannelAccount']['find']({'where':{'id':_0x29d00c[_0x8ac3('0x64')]['id']}})[_0x8ac3('0x1e')](handleEntityNotFound(_0x2ca4ab,null))[_0x8ac3('0x1e')](function(_0x3a0c69){if(_0x3a0c69){return _0x3a0c69[_0x8ac3('0x71')](_0x29d00c[_0x8ac3('0x44')][_0x8ac3('0x6d')]);}})[_0x8ac3('0x1e')](respondWithStatusCode(_0x2ca4ab,null))[_0x8ac3('0x28')](handleError(_0x2ca4ab,null));};exports[_0x8ac3('0x72')]=function(_0x4b8fd4,_0xc412ab,_0x2825b4){var _0x345d81={'body':_0x4b8fd4[_0x8ac3('0x5d')],'channel':_0x8ac3('0x73')};var _0x310c3f=[];var _0x179b07=[];var _0x2ee4c7={};var _0x577b75=![];return db['CmContact'][_0x8ac3('0x66')]()[_0x8ac3('0x1e')](function(_0x3ff56d){if(!_0x3ff56d){throw new db[(_0x8ac3('0x74'))]['ValidationError'](_0x8ac3('0x75'));}_0x310c3f=_['difference'](_[_0x8ac3('0x5a')](_0x3ff56d),[_0x8ac3('0x76'),_0x8ac3('0x77')]);_0x179b07=_[_0x8ac3('0x78')](_[_0x8ac3('0x5a')](_0x3ff56d),['createdAt',_0x8ac3('0x77'),_0x8ac3('0x79'),'ListId']);if(_0x4b8fd4[_0x8ac3('0x5d')]['id']){delete _0x4b8fd4['body']['id'];}if(_[_0x8ac3('0x7a')](_0x4b8fd4[_0x8ac3('0x5d')][_0x8ac3('0x7b')])){throw new db[(_0x8ac3('0x74'))]['ValidationError'](_0x8ac3('0x7c'));}if(_[_0x8ac3('0x7a')](_0x4b8fd4['body'][_0x8ac3('0x5d')])||_0x4b8fd4[_0x8ac3('0x5d')]['body']===''){throw new db['Sequelize'][(_0x8ac3('0x7d'))](_0x8ac3('0x7e'));}if(_[_0x8ac3('0x7a')](_0x4b8fd4[_0x8ac3('0x5d')]['mapKey'])){throw new db[(_0x8ac3('0x74'))][(_0x8ac3('0x7d'))](_0x8ac3('0x7f')+_0x179b07);}if(!_[_0x8ac3('0x80')](_0x179b07,_0x4b8fd4['body'][_0x8ac3('0x81')])){throw new db[(_0x8ac3('0x74'))][(_0x8ac3('0x7d'))](_0x8ac3('0x82')+_0x179b07);}_0x2ee4c7[_0x4b8fd4[_0x8ac3('0x5d')][_0x8ac3('0x81')]]=_0x4b8fd4[_0x8ac3('0x5d')][_0x8ac3('0x7b')];})[_0x8ac3('0x1e')](function(){return db[_0x8ac3('0x40')][_0x8ac3('0x5b')]({'where':{'id':_0x4b8fd4[_0x8ac3('0x64')]['id']},'include':[{'model':db[_0x8ac3('0x83')],'as':_0x8ac3('0x84'),'include':[{'model':db[_0x8ac3('0x85')],'as':_0x8ac3('0x86'),'where':_0x2ee4c7,'limit':0x1,'order':[[_0x8ac3('0x77'),_0x8ac3('0x87')]]}]},{'model':db[_0x8ac3('0x88')],'as':_0x8ac3('0x89')}]});})[_0x8ac3('0x1e')](handleEntityNotFound(_0xc412ab,null))['then'](function(_0x456be8){if(_0x456be8&&_0x456be8['List']){_0x345d81[_0x8ac3('0x8a')]=_0x456be8;_0x345d81[_0x8ac3('0x8b')]=_0x456be8['Applications'];_0x345d81[_0x8ac3('0x8c')]=_0x456be8[_0x8ac3('0x84')];_0x345d81[_0x8ac3('0x8b')]=_['orderBy'](_0x345d81['applications'],['priority'],[_0x8ac3('0x8d')]);if(_0x345d81[_0x8ac3('0x8a')][_0x8ac3('0x89')]){delete _0x345d81[_0x8ac3('0x8a')][_0x8ac3('0x89')];}if(_0x345d81[_0x8ac3('0x8a')]['List']&&_0x345d81[_0x8ac3('0x8a')][_0x8ac3('0x84')][_0x8ac3('0x86')][_0x8ac3('0x49')]){return _0x345d81[_0x8ac3('0x8a')][_0x8ac3('0x84')][_0x8ac3('0x86')][0x0];}var _0x46b3fd=_[_0x8ac3('0x18')](_0x4b8fd4['body'],{'firstName':_0x4b8fd4[_0x8ac3('0x5d')][_0x8ac3('0x7b')],'ListId':_0x456be8[_0x8ac3('0x8e')]});_0x46b3fd[_0x4b8fd4['body'][_0x8ac3('0x81')]]=_0x4b8fd4['body']['from'];return db[_0x8ac3('0x85')][_0x8ac3('0x5c')](_0x46b3fd,{'fields':_0x310c3f,'raw':!![]});}})[_0x8ac3('0x1e')](handleEntityNotFound(_0xc412ab,null))['then'](function(_0x2909c5){_0x345d81[_0x8ac3('0x8f')]=_0x2909c5;if(_0x2909c5){var _0x429e3f={'ContactId':_0x2909c5['id'],'OpenchannelAccountId':_0x4b8fd4[_0x8ac3('0x64')]['id'],'from':(_0x2909c5[_0x8ac3('0x90')]||'')+'\x20'+(_0x2909c5[_0x8ac3('0x91')]||'')};var _0x252c61={'OpenchannelAccountId':_0x4b8fd4['params']['id'],'closed':![]};if(_0x4b8fd4[_0x8ac3('0x5d')]['threadId']){_0x252c61['threadId']=_0x4b8fd4[_0x8ac3('0x5d')][_0x8ac3('0x92')];return db[_0x8ac3('0x93')][_0x8ac3('0x5b')]({'where':_0x252c61})['then'](function(_0x2ecdf5){if(_0x2ecdf5){return[_0x2ecdf5,![]];}_0x429e3f[_0x8ac3('0x92')]=_0x4b8fd4[_0x8ac3('0x5d')][_0x8ac3('0x92')];_0x429e3f['externalUrl']=_0x4b8fd4[_0x8ac3('0x5d')]['externalUrl'];return db['OpenchannelInteraction'][_0x8ac3('0x5c')](_0x429e3f)[_0x8ac3('0x1e')](function(_0x3f4a0c){return[_0x3f4a0c,!![]];});});}else{_0x252c61['threadId']=null;}_0x252c61[_0x8ac3('0x94')]=_0x2909c5['id'];return db[_0x8ac3('0x93')][_0x8ac3('0x5b')]({'where':_0x252c61})[_0x8ac3('0x1e')](function(_0x35fafe){if(_0x35fafe){return[_0x35fafe,![]];}return db[_0x8ac3('0x93')]['create'](_0x429e3f)[_0x8ac3('0x1e')](function(_0x345910){return[_0x345910,!![]];});});}})[_0x8ac3('0x95')](function(_0x4367f8,_0x4d3d42){if(_0x4367f8){_0x577b75=_0x4d3d42;if(!_0x4d3d42){var _0x315af={'from':(_0x345d81[_0x8ac3('0x8f')]['firstName']||'')+'\x20'+(_0x345d81['contact'][_0x8ac3('0x91')]||'')};if(_0x4b8fd4[_0x8ac3('0x5d')][_0x8ac3('0x92')]&&_0x4b8fd4[_0x8ac3('0x5d')]['messageId']&&_0x4b8fd4[_0x8ac3('0x5d')][_0x8ac3('0x92')]!=_0x4b8fd4[_0x8ac3('0x5d')]['messageId']){_0x315af[_0x8ac3('0x92')]=_0x4b8fd4['body'][_0x8ac3('0x96')];}return _0x4367f8[_0x8ac3('0x35')](_0x315af);}else{return _0x4367f8;}}})[_0x8ac3('0x1e')](function(_0x5022fc){_0x345d81[_0x8ac3('0x97')]=_0x5022fc[_0x8ac3('0x37')]({'plain':!![]});_0x345d81[_0x8ac3('0x97')]['created']=_0x577b75;if(_0x345d81[_0x8ac3('0x97')][_0x8ac3('0x98')]){if(_0x345d81['account'][_0x8ac3('0x99')]){_0x345d81[_0x8ac3('0x8b')][_0x8ac3('0x9a')]({'id':0x0,'priority':_0x345d81[_0x8ac3('0x8b')][_0x8ac3('0x49')]+0x1,'app':_0x8ac3('0x9b'),'appdata':_0x8ac3('0x9c'),'interval':_0x8ac3('0x9d')});}}return db['OpenchannelMessage'][_0x8ac3('0x5c')]({'body':_0x4b8fd4['body'][_0x8ac3('0x5d')],'OpenchannelAccountId':_0x4b8fd4[_0x8ac3('0x64')]['id'],'OpenchannelInteractionId':_0x5022fc['id'],'direction':'in','ContactId':_0x345d81['contact']['id'],'AttachmentId':_0x4b8fd4[_0x8ac3('0x5d')][_0x8ac3('0x9e')]});})[_0x8ac3('0x1e')](function(_0x11b2a8){_0x345d81['message']=_0x11b2a8;if(_0x345d81[_0x8ac3('0x97')][_0x8ac3('0x9f')]){return db[_0x8ac3('0xa0')][_0x8ac3('0x5b')]({'attributes':['id',_0x8ac3('0x3b')],'where':{'id':_0x345d81['interaction']['UserId']}})[_0x8ac3('0x1e')](function(_0x5b9805){if(_0x5b9805){_0x345d81[_0x8ac3('0x8b')][_0x8ac3('0xa1')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5b9805['name']+','+(_0x345d81[_0x8ac3('0x8a')][_0x8ac3('0xa2')]||0xa),'interval':_0x8ac3('0x9d')});_0x345d81[_0x8ac3('0xa3')]=![];}return respondWithRpcPromise(_0x8ac3('0xa4'),_0x8ac3('0xa5'),_0x345d81);});}return respondWithRpcPromise(_0x8ac3('0xa4'),_0x8ac3('0xa5'),_0x345d81);})['then'](function(_0x468999){respondWithRpcPromise(_0x8ac3('0xa6'),_0x8ac3('0xa6'),{'event':'notify','message':_0x468999},client9002);return _0x468999;})[_0x8ac3('0x1e')](respondWithResult(_0xc412ab,null))['catch'](handleError(_0xc412ab,null));};exports[_0x8ac3('0xa7')]=function(_0x4afb1d,_0xdac845,_0x2de1ae){return db['OpenchannelAccount'][_0x8ac3('0x6a')]({'where':{'id':_0x4afb1d['params']['id']}})[_0x8ac3('0x1e')](handleEntityNotFound(_0xdac845,null))[_0x8ac3('0x1e')](function(_0x61e40){if(_0x61e40){return db[_0x8ac3('0xa8')][_0x8ac3('0xa9')](function(_0x13e9b7){return db[_0x8ac3('0x88')][_0x8ac3('0x36')]({'where':{'OpenchannelAccountId':_0x4afb1d[_0x8ac3('0x64')]['id']},'transaction':_0x13e9b7})[_0x8ac3('0x1e')](function(_0x14a710){var _0x1d0f09=_[_0x8ac3('0x3f')](_0x4afb1d[_0x8ac3('0x5d')],function(_0x126068){_0x126068['OpenchannelAccountId']=_0x4afb1d[_0x8ac3('0x64')]['id'];return _0x126068;});return db[_0x8ac3('0x88')][_0x8ac3('0xaa')](_0x1d0f09,{'transaction':_0x13e9b7});});})[_0x8ac3('0x1e')](function(){return db[_0x8ac3('0x88')][_0x8ac3('0xab')]({'where':{'OpenchannelAccountId':_0x4afb1d[_0x8ac3('0x64')]['id']},'order':_0x8ac3('0xac')});});}})[_0x8ac3('0x1e')](respondWithResult(_0xdac845,null))[_0x8ac3('0x28')](handleError(_0xdac845,null));};exports[_0x8ac3('0xad')]=function(_0x5c9227,_0x567215,_0x1ed4b2){var _0x1f9a8e={};var _0x182ce9={};var _0x27793c;var _0x5c45dd;return db[_0x8ac3('0x40')]['findOne']({'where':{'id':_0x5c9227['params']['id']}})['then'](handleEntityNotFound(_0x567215,null))[_0x8ac3('0x1e')](function(_0x1ec22a){if(_0x1ec22a){_0x27793c=_0x1ec22a;_0x182ce9[_0x8ac3('0x43')]=_['keys'](db[_0x8ac3('0x88')][_0x8ac3('0x41')]);_0x182ce9[_0x8ac3('0x44')]=_[_0x8ac3('0x5a')](_0x5c9227[_0x8ac3('0x44')]);_0x182ce9[_0x8ac3('0x45')]=_[_0x8ac3('0x46')](_0x182ce9[_0x8ac3('0x43')],_0x182ce9[_0x8ac3('0x44')]);_0x1f9a8e[_0x8ac3('0x48')]=_['intersection'](_0x182ce9[_0x8ac3('0x43')],qs[_0x8ac3('0x47')](_0x5c9227['query'][_0x8ac3('0x47')]));_0x1f9a8e['attributes']=_0x1f9a8e[_0x8ac3('0x48')][_0x8ac3('0x49')]?_0x1f9a8e[_0x8ac3('0x48')]:_0x182ce9[_0x8ac3('0x43')];_0x1f9a8e[_0x8ac3('0x4d')]=qs[_0x8ac3('0x4e')](_0x5c9227['query'][_0x8ac3('0x4e')]);_0x1f9a8e[_0x8ac3('0x4f')]=qs[_0x8ac3('0x45')](_[_0x8ac3('0x50')](_0x5c9227[_0x8ac3('0x44')],_0x182ce9[_0x8ac3('0x45')]));if(_0x5c9227[_0x8ac3('0x44')][_0x8ac3('0x51')]){_0x1f9a8e[_0x8ac3('0x4f')]=_[_0x8ac3('0x52')](_0x1f9a8e[_0x8ac3('0x4f')],{'$or':_[_0x8ac3('0x3f')](_0x1f9a8e[_0x8ac3('0x48')],function(_0x4d9cf0){var _0x4d5a02={};_0x4d5a02[_0x4d9cf0]={'$like':'%'+_0x5c9227[_0x8ac3('0x44')][_0x8ac3('0x51')]+'%'};return _0x4d5a02;})});}_0x1f9a8e=_[_0x8ac3('0x52')]({},_0x1f9a8e,_0x5c9227['options']);return _0x27793c[_0x8ac3('0xad')](_0x1f9a8e);}})[_0x8ac3('0x1e')](function(_0x238280){if(_0x238280){_0x5c45dd=_0x238280[_0x8ac3('0x49')];if(!_0x5c9227['query']['hasOwnProperty'](_0x8ac3('0x4b'))){_0x1f9a8e[_0x8ac3('0x4c')]=qs['limit'](_0x5c9227[_0x8ac3('0x44')][_0x8ac3('0x4c')]);_0x1f9a8e[_0x8ac3('0x2c')]=qs[_0x8ac3('0x2c')](_0x5c9227[_0x8ac3('0x44')][_0x8ac3('0x2c')]);}return _0x27793c[_0x8ac3('0xad')](_0x1f9a8e);}})[_0x8ac3('0x1e')](function(_0x1aff59){if(_0x1aff59){return _0x1aff59?{'count':_0x5c45dd,'rows':_0x1aff59}:null;}})['then'](respondWithResult(_0x567215,null))[_0x8ac3('0x28')](handleError(_0x567215,null));};exports['getInteractions']=function(_0x207e60,_0x1cf5f7,_0x3fc1e1){var _0xb95eaf={'raw':![],'where':{}};var _0x2d5e46={};var _0x43cd85={'count':0x0,'rows':[]};return db[_0x8ac3('0x40')][_0x8ac3('0x6a')]({'where':{'id':_0x207e60['params']['id']}})[_0x8ac3('0x1e')](handleEntityNotFound(_0x1cf5f7,null))['then'](function(_0x1b839a){if(_0x1b839a){_0x2d5e46['model']=_['keys'](db[_0x8ac3('0x93')][_0x8ac3('0x41')]);_0x2d5e46[_0x8ac3('0x44')]=_[_0x8ac3('0x5a')](_0x207e60[_0x8ac3('0x44')]);_0x2d5e46[_0x8ac3('0x45')]=_[_0x8ac3('0x46')](_0x2d5e46[_0x8ac3('0x43')],_0x2d5e46['query']);_0xb95eaf[_0x8ac3('0x48')]=_['intersection'](_0x2d5e46[_0x8ac3('0x43')],qs[_0x8ac3('0x47')](_0x207e60[_0x8ac3('0x44')]['fields']));_0xb95eaf['attributes']=_0xb95eaf['attributes'][_0x8ac3('0x49')]?_0xb95eaf[_0x8ac3('0x48')]:_0x2d5e46[_0x8ac3('0x43')];if(!_0x207e60['query'][_0x8ac3('0x4a')]('nolimit')){_0xb95eaf[_0x8ac3('0x4c')]=qs[_0x8ac3('0x4c')](_0x207e60[_0x8ac3('0x44')]['limit']);_0xb95eaf[_0x8ac3('0x2c')]=qs[_0x8ac3('0x2c')](_0x207e60['query']['offset']);}_0xb95eaf[_0x8ac3('0x4d')]=qs[_0x8ac3('0x4e')](_0x207e60[_0x8ac3('0x44')]['sort']);_0xb95eaf[_0x8ac3('0x4f')]=qs['filters'](_[_0x8ac3('0x50')](_0x207e60[_0x8ac3('0x44')],_0x2d5e46['filters']));_0xb95eaf[_0x8ac3('0x4f')][_0x8ac3('0x67')]=_0x1b839a['id'];if(_0x207e60[_0x8ac3('0x44')][_0x8ac3('0x51')]){_0xb95eaf[_0x8ac3('0x4f')]=_[_0x8ac3('0x52')](_0xb95eaf[_0x8ac3('0x4f')],{'$or':_[_0x8ac3('0x3f')](_0xb95eaf['attributes'],function(_0x15fc9b){var _0x5364fe={};_0x5364fe[_0x15fc9b]={'$like':'%'+_0x207e60['query'][_0x8ac3('0x51')]+'%'};return _0x5364fe;})});}_0xb95eaf=_[_0x8ac3('0x52')]({},_0xb95eaf,_0x207e60[_0x8ac3('0x55')]);return db['OpenchannelInteraction'][_0x8ac3('0x2e')]({'where':_0xb95eaf[_0x8ac3('0x4f')]})[_0x8ac3('0x1e')](function(_0x16e08c){_0x43cd85['count']=_0x16e08c;if(_0x207e60[_0x8ac3('0x44')]['includeAll']){_0xb95eaf[_0x8ac3('0x57')]=[{'model':db[_0x8ac3('0x85')],'as':'Contact','required':![]},{'model':db[_0x8ac3('0xa0')],'as':_0x8ac3('0xae'),'attributes':[_0x8ac3('0x3b'),_0x8ac3('0xaf'),_0x8ac3('0xb0')],'required':![]},{'model':db['Tag'],'as':_0x8ac3('0xb1'),'attributes':['id','name',_0x8ac3('0xb2')],'where':_0x207e60['query'][_0x8ac3('0xb3')]?{'id':_0x207e60[_0x8ac3('0x44')][_0x8ac3('0xb3')]}:undefined,'required':_0x207e60[_0x8ac3('0x44')]['tag']?!![]:![]}];}return db[_0x8ac3('0x93')][_0x8ac3('0x58')](_0xb95eaf);})[_0x8ac3('0x1e')](function(_0x379df3){_0x43cd85[_0x8ac3('0x6b')]=_0x379df3;return _0x43cd85;});}})['then'](respondWithFilteredResult(_0x1cf5f7,_0xb95eaf))[_0x8ac3('0x28')](handleError(_0x1cf5f7,null));};exports['addAgents']=function(_0x590d23,_0xe2d227,_0x513ea1){return db[_0x8ac3('0x40')][_0x8ac3('0x5b')]({'where':{'id':_0x590d23['params']['id']}})[_0x8ac3('0x1e')](handleEntityNotFound(_0xe2d227,null))['then'](function(_0x1ac428){if(_0x1ac428){return _0x1ac428[_0x8ac3('0xb4')](_0x590d23[_0x8ac3('0x5d')]['ids'],_['omit'](_0x590d23[_0x8ac3('0x5d')],[_0x8ac3('0x6d'),'id'])||{})[_0x8ac3('0x95')](function(_0x304812){for(var _0x3fbec3=0x0;_0x3fbec3<_0x590d23['body']['ids'][_0x8ac3('0x49')];_0x3fbec3+=0x1){socket[_0x8ac3('0xb5')](_0x8ac3('0xb6'),{'UserId':Number(_0x590d23[_0x8ac3('0x5d')][_0x8ac3('0x6d')][_0x3fbec3]),'OpenchannelAccountId':Number(_0x590d23[_0x8ac3('0x64')]['id'])});}return _0x304812;});}})[_0x8ac3('0x1e')](respondWithResult(_0xe2d227,null))[_0x8ac3('0x28')](handleError(_0xe2d227,null));};exports[_0x8ac3('0xb7')]=function(_0xfd5e85,_0x32fe70,_0x46b556){return db['OpenchannelAccount']['find']({'where':{'id':_0xfd5e85[_0x8ac3('0x64')]['id']}})[_0x8ac3('0x1e')](handleEntityNotFound(_0x32fe70,null))[_0x8ac3('0x1e')](function(_0x4c6bab){if(_0x4c6bab){return _0x4c6bab[_0x8ac3('0xb7')](_0xfd5e85[_0x8ac3('0x44')]['ids'])[_0x8ac3('0x1e')](function(){if(_['isArray'](_0xfd5e85[_0x8ac3('0x44')][_0x8ac3('0x6d')])){for(var _0x124974=0x0;_0x124974<_0xfd5e85[_0x8ac3('0x44')]['ids'][_0x8ac3('0x49')];_0x124974+=0x1){socket[_0x8ac3('0xb5')](_0x8ac3('0xb8'),{'UserId':Number(_0xfd5e85[_0x8ac3('0x44')][_0x8ac3('0x6d')][_0x124974]),'OpenchannelAccountId':Number(_0xfd5e85[_0x8ac3('0x64')]['id'])});}}else{socket['emit'](_0x8ac3('0xb8'),{'UserId':Number(_0xfd5e85[_0x8ac3('0x44')][_0x8ac3('0x6d')]),'OpenchannelAccountId':Number(_0xfd5e85[_0x8ac3('0x64')]['id'])});}});}})[_0x8ac3('0x1e')](respondWithStatusCode(_0x32fe70,null))['catch'](handleError(_0x32fe70,null));};exports[_0x8ac3('0xb9')]=function(_0xac860,_0x115746,_0x4f4065){var _0xab61d3={};var _0x44704a={};var _0xbeeb96;var _0x24de10;return db[_0x8ac3('0x40')][_0x8ac3('0x6a')]({'where':{'id':_0xac860['params']['id']}})['then'](handleEntityNotFound(_0x115746,null))[_0x8ac3('0x1e')](function(_0x45a03e){if(_0x45a03e){_0xbeeb96=_0x45a03e;_0x44704a[_0x8ac3('0x43')]=_[_0x8ac3('0x5a')](db[_0x8ac3('0xa0')]['rawAttributes']);_0x44704a['query']=_[_0x8ac3('0x5a')](_0xac860[_0x8ac3('0x44')]);_0x44704a['filters']=_['intersection'](_0x44704a[_0x8ac3('0x43')],_0x44704a['query']);_0xab61d3[_0x8ac3('0x48')]=_['intersection'](_0x44704a[_0x8ac3('0x43')],qs[_0x8ac3('0x47')](_0xac860[_0x8ac3('0x44')][_0x8ac3('0x47')]));_0xab61d3[_0x8ac3('0x48')]=_0xab61d3[_0x8ac3('0x48')][_0x8ac3('0x49')]?_0xab61d3[_0x8ac3('0x48')]:_0x44704a[_0x8ac3('0x43')];_0xab61d3[_0x8ac3('0x4d')]=qs[_0x8ac3('0x4e')](_0xac860[_0x8ac3('0x44')][_0x8ac3('0x4e')]);_0xab61d3[_0x8ac3('0x4f')]=qs[_0x8ac3('0x45')](_[_0x8ac3('0x50')](_0xac860[_0x8ac3('0x44')],_0x44704a[_0x8ac3('0x45')]));if(_0xac860[_0x8ac3('0x44')]['filter']){_0xab61d3[_0x8ac3('0x4f')]=_[_0x8ac3('0x52')](_0xab61d3[_0x8ac3('0x4f')],{'$or':_['map'](_0xab61d3[_0x8ac3('0x48')],function(_0x21c28c){var _0xb3dab3={};_0xb3dab3[_0x21c28c]={'$like':'%'+_0xac860[_0x8ac3('0x44')]['filter']+'%'};return _0xb3dab3;})});}_0xab61d3=_['merge']({},_0xab61d3,_0xac860['options']);return _0xbeeb96[_0x8ac3('0xb9')](_0xab61d3);}})[_0x8ac3('0x1e')](function(_0x4e5016){if(_0x4e5016){_0x24de10=_0x4e5016[_0x8ac3('0x49')];if(!_0xac860['query'][_0x8ac3('0x4a')](_0x8ac3('0x4b'))){_0xab61d3[_0x8ac3('0x4c')]=qs[_0x8ac3('0x4c')](_0xac860['query'][_0x8ac3('0x4c')]);_0xab61d3[_0x8ac3('0x2c')]=qs[_0x8ac3('0x2c')](_0xac860['query'][_0x8ac3('0x2c')]);}return _0xbeeb96[_0x8ac3('0xb9')](_0xab61d3);}})[_0x8ac3('0x1e')](function(_0x2db70c){if(_0x2db70c){return _0x2db70c?{'count':_0x24de10,'rows':_0x2db70c}:null;}})[_0x8ac3('0x1e')](respondWithResult(_0x115746,null))[_0x8ac3('0x28')](handleError(_0x115746,null));};exports[_0x8ac3('0x3c')]=function(_0x2d17a6,_0x21a53b,_0x3640fe){var _0x37ddff,_0x24cc8f,_0x3a37cd;if(_[_0x8ac3('0x7a')](_0x2d17a6['body'][_0x8ac3('0x5d')])||_0x2d17a6['body']['body']===''){throw new db['Sequelize'][(_0x8ac3('0x7d'))](_0x8ac3('0x7e'));}if(_['isNil'](_0x2d17a6[_0x8ac3('0x5d')]['to'])){}_0x37ddff=_0x2d17a6[_0x8ac3('0x5d')]['to'];return db[_0x8ac3('0x40')][_0x8ac3('0x6a')]({'where':{'id':_0x2d17a6[_0x8ac3('0x64')]['id']}})[_0x8ac3('0x1e')](handleEntityNotFound(_0x21a53b,null))[_0x8ac3('0x1e')](function(_0x598e03){if(_0x598e03){return db[_0x8ac3('0x40')][_0x8ac3('0x5b')]({'where':{'id':_0x598e03['id']},'include':[{'model':db[_0x8ac3('0x83')],'as':_0x8ac3('0x84'),'include':[{'model':db[_0x8ac3('0x85')],'as':_0x8ac3('0x86'),'where':{[_0x598e03[_0x8ac3('0x81')]]:_0x37ddff},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x8ac3('0x1e')](handleEntityNotFound(_0x21a53b,null))[_0x8ac3('0x1e')](function(_0x456fc5){if(_0x456fc5&&_0x456fc5[_0x8ac3('0x84')]){_0x24cc8f=_0x456fc5['get']({'plain':!![]});if(_0x24cc8f[_0x8ac3('0x84')]&&_0x24cc8f['List']['Contacts'][_0x8ac3('0x49')]){return _0x24cc8f['List'][_0x8ac3('0x86')][0x0];}return db[_0x8ac3('0x85')][_0x8ac3('0x5c')](_[_0x8ac3('0x18')](_0x2d17a6[_0x8ac3('0x5d')],{'firstName':_0x37ddff,[_0x456fc5['mapKey']]:_0x37ddff,'phone':_0x37ddff,'ListId':_0x24cc8f[_0x8ac3('0x8e')]}));}})[_0x8ac3('0x1e')](handleEntityNotFound(_0x21a53b,null))['then'](function(_0x326908){if(_0x326908){_0x3a37cd=_0x326908;return db[_0x8ac3('0x93')][_0x8ac3('0x5b')]({'where':{'ContactId':_0x3a37cd['id'],'closed':![],'OpenchannelAccountId':_0x24cc8f['id']}})[_0x8ac3('0x1e')](function(_0x4ef50d){if(_0x4ef50d){return[_0x4ef50d,![]];}return db['OpenchannelInteraction']['create']({'UserId':_0x2d17a6[_0x8ac3('0x5e')]['id'],'ContactId':_0x3a37cd['id'],'OpenchannelAccountId':_0x24cc8f['id'],'lastMsgDirection':'out','Messages':[_[_0x8ac3('0x52')](_0x2d17a6[_0x8ac3('0x5d')],{'read':![],'body':_0x2d17a6[_0x8ac3('0x5d')][_0x8ac3('0x5d')],'OpenchannelAccountId':_0x24cc8f['id'],'UserId':_0x2d17a6[_0x8ac3('0x5e')]['id'],'ContactId':_0x3a37cd['id']})]},{'include':[{'model':db[_0x8ac3('0xba')],'as':'Messages'}]})[_0x8ac3('0x1e')](function(_0x547812){return[_0x547812,!![]];});});}})[_0x8ac3('0x95')](function(_0x5f564e,_0x49f0f1){if(_0x49f0f1){return _0x5f564e;}return db[_0x8ac3('0xba')][_0x8ac3('0x5c')](_[_0x8ac3('0x52')](_0x2d17a6['body'],{'read':![],'body':_0x2d17a6[_0x8ac3('0x5d')][_0x8ac3('0x5d')],'OpenchannelAccountId':_0x24cc8f['id'],'OpenchannelInteractionId':_0x5f564e['id'],'UserId':_0x2d17a6['user']['id'],'ContactId':_0x3a37cd['id']}))[_0x8ac3('0x1e')](function(_0x5376ad){_0x5f564e[_0x8ac3('0xbb')][_0x8ac3('0xbc')]=[];_0x5f564e[_0x8ac3('0xbb')][_0x8ac3('0xbc')][_0x8ac3('0x9a')](_0x5376ad[_0x8ac3('0xbb')]);return _0x5f564e;});});}})[_0x8ac3('0x1e')](respondWithResult(_0x21a53b,null))[_0x8ac3('0x28')](handleError(_0x21a53b,null));};
\ No newline at end of file
+var _0x8ed3=['externalUrl','ContactId','messageId','interaction','created','OpenchannelMessage','User','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','addApplications','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','pick','Contact','Owner','fullname','internal','Tag','color','tag','addAgents','omit','spread','emit','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','send','out','Messages','dataValues','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','status','end','json','undefined','limit','offset','set','Content-Range','apply','reject','save','destroy','get','OpenchannelAccounts','name','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','getDispositions','findOne','Disposition','OpenchannelAccountId','count','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','findAll','notify','openchannel','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','isNil','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','updatedAt','DESC','OpenchannelApplication','Applications','applications','list','List','orderBy','priority','asc','account','contact','firstName','lastName','threadId','OpenchannelInteraction'];(function(_0x378952,_0x5bc189){var _0x485956=function(_0x547f29){while(--_0x547f29){_0x378952['push'](_0x378952['shift']());}};_0x485956(++_0x5bc189);}(_0x8ed3,0xe6));var _0x38ed=function(_0x1e2447,_0x5fea89){_0x1e2447=_0x1e2447-0x0;var _0x306f03=_0x8ed3[_0x1e2447];return _0x306f03;};'use strict';var emlformat=require(_0x38ed('0x0'));var rimraf=require(_0x38ed('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x38ed('0x2'));var rp=require(_0x38ed('0x3'));var moment=require('moment');var BPromise=require(_0x38ed('0x4'));var Mustache=require('mustache');var util=require(_0x38ed('0x5'));var path=require(_0x38ed('0x6'));var sox=require(_0x38ed('0x7'));var csv=require(_0x38ed('0x8'));var ejs=require(_0x38ed('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x38ed('0xa'));var squel=require(_0x38ed('0xb'));var crypto=require(_0x38ed('0xc'));var jsforce=require(_0x38ed('0xd'));var deskjs=require(_0x38ed('0xe'));var toCsv=require(_0x38ed('0x8'));var querystring=require('querystring');var Papa=require(_0x38ed('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x38ed('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x38ed('0x11'));var logger=require(_0x38ed('0x12'))(_0x38ed('0x13'));var utils=require('../../config/utils');var config=require(_0x38ed('0x14'));var licenseUtil=require(_0x38ed('0x15'));var db=require(_0x38ed('0x16'))['db'];config[_0x38ed('0x17')]=_[_0x38ed('0x18')](config[_0x38ed('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x38ed('0x19'))(new Redis(config[_0x38ed('0x17')]));require(_0x38ed('0x1a'))[_0x38ed('0x1b')](socket);var jayson=require(_0x38ed('0x1c'));var client=jayson[_0x38ed('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x38ed('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x419fed,_0x878487,_0x442cf3,_0x3d49ea){return new BPromise(function(_0x11b107,_0x365a4d){var _0x4f09a5=_0x3d49ea||client;return _0x4f09a5[_0x38ed('0x1e')](_0x419fed,_0x442cf3)[_0x38ed('0x1f')](function(_0x47fbfc){logger[_0x38ed('0x20')](_0x38ed('0x21'),_0x878487,_0x38ed('0x22'));logger[_0x38ed('0x23')](_0x38ed('0x24'),_0x878487,_0x38ed('0x22'),JSON['stringify'](_0x47fbfc));if(_0x47fbfc[_0x38ed('0x25')]){if(_0x47fbfc['error'][_0x38ed('0x26')]===0x1f4){logger[_0x38ed('0x25')](_0x38ed('0x21'),_0x878487,_0x47fbfc[_0x38ed('0x25')][_0x38ed('0x27')]);return _0x365a4d(_0x47fbfc['error'][_0x38ed('0x27')]);}logger[_0x38ed('0x25')](_0x38ed('0x21'),_0x878487,_0x47fbfc[_0x38ed('0x25')][_0x38ed('0x27')]);return _0x11b107(_0x47fbfc['error'][_0x38ed('0x27')]);}else{logger['info'](_0x38ed('0x21'),_0x878487,_0x38ed('0x22'));_0x11b107(_0x47fbfc[_0x38ed('0x28')][_0x38ed('0x27')]);}})['catch'](function(_0x5ea4be){logger[_0x38ed('0x25')](_0x38ed('0x21'),_0x878487,_0x5ea4be);_0x365a4d(_0x5ea4be);});});}function respondWithStatusCode(_0x955ebc,_0x5d724d){_0x5d724d=_0x5d724d||0xcc;return function(_0x38b4d4){if(_0x38b4d4){return _0x955ebc['sendStatus'](_0x5d724d);}return _0x955ebc[_0x38ed('0x29')](_0x5d724d)[_0x38ed('0x2a')]();};}function respondWithResult(_0x295d3f,_0xfcbf14){_0xfcbf14=_0xfcbf14||0xc8;return function(_0x1f079f){if(_0x1f079f){return _0x295d3f[_0x38ed('0x29')](_0xfcbf14)[_0x38ed('0x2b')](_0x1f079f);}};}function respondWithFilteredResult(_0x38daf2,_0x2239c4){return function(_0x12fd73){if(_0x12fd73){var _0x40fb08=typeof _0x2239c4['offset']===_0x38ed('0x2c')&&typeof _0x2239c4[_0x38ed('0x2d')]===_0x38ed('0x2c');var _0x31f82e=_0x12fd73['count'];var _0x4bdf91=_0x40fb08?0x0:_0x2239c4[_0x38ed('0x2e')];var _0x18e8bc=_0x40fb08?_0x12fd73['count']:_0x2239c4[_0x38ed('0x2e')]+_0x2239c4[_0x38ed('0x2d')];var _0x4b1fe4;if(_0x18e8bc>=_0x31f82e){_0x18e8bc=_0x31f82e;_0x4b1fe4=0xc8;}else{_0x4b1fe4=0xce;}_0x38daf2['status'](_0x4b1fe4);return _0x38daf2[_0x38ed('0x2f')](_0x38ed('0x30'),_0x4bdf91+'-'+_0x18e8bc+'/'+_0x31f82e)[_0x38ed('0x2b')](_0x12fd73);}return null;};}function patchUpdates(_0x2db1e9){return function(_0x36a325){try{jsonpatch[_0x38ed('0x31')](_0x36a325,_0x2db1e9,!![]);}catch(_0x42e609){return BPromise[_0x38ed('0x32')](_0x42e609);}return _0x36a325[_0x38ed('0x33')]();};}function saveUpdates(_0x233f59,_0x204fa9){return function(_0x21341c){if(_0x21341c){return _0x21341c['update'](_0x233f59)[_0x38ed('0x1f')](function(_0x3242b1){return _0x3242b1;});}return null;};}function removeEntity(_0x2076f7,_0x226af0){return function(_0x7fb25e){if(_0x7fb25e){return _0x7fb25e[_0x38ed('0x34')]()[_0x38ed('0x1f')](function(){var _0x182d87=_0x7fb25e[_0x38ed('0x35')]({'plain':!![]});var _0x584c80=_0x38ed('0x36');return db['UserProfileResource'][_0x38ed('0x34')]({'where':{'type':_0x584c80,'resourceId':_0x182d87['id']}})['then'](function(){return _0x7fb25e;});})[_0x38ed('0x1f')](function(){_0x2076f7['status'](0xcc)[_0x38ed('0x2a')]();});}};}function handleEntityNotFound(_0x4736a2,_0x506e3b){return function(_0x11054e){if(!_0x11054e){_0x4736a2['sendStatus'](0x194);}return _0x11054e;};}function handleError(_0x1f9ac6,_0x3c7713){_0x3c7713=_0x3c7713||0x1f4;return function(_0xca91bd){logger['error'](_0xca91bd['stack']);if(_0xca91bd['name']){delete _0xca91bd[_0x38ed('0x37')];}_0x1f9ac6[_0x38ed('0x29')](_0x3c7713)['send'](_0xca91bd);};}exports[_0x38ed('0x38')]=function(_0x2445c0,_0x35c03f){var _0x1b0034={'include':[{'model':db[_0x38ed('0x39')],'as':_0x38ed('0x3a')}]},_0x4b9986={},_0x4ca213={'count':0x0,'rows':[]};var _0x5ed791=_['map'](db[_0x38ed('0x3b')][_0x38ed('0x3c')],function(_0x54fc48){return{'name':_0x54fc48['fieldName'],'type':_0x54fc48[_0x38ed('0x3d')][_0x38ed('0x3e')]};});_0x4b9986[_0x38ed('0x3f')]=_[_0x38ed('0x40')](_0x5ed791,'name');_0x4b9986[_0x38ed('0x41')]=_[_0x38ed('0x42')](_0x2445c0[_0x38ed('0x41')]);_0x4b9986[_0x38ed('0x43')]=_[_0x38ed('0x44')](_0x4b9986[_0x38ed('0x3f')],_0x4b9986[_0x38ed('0x41')]);_0x1b0034[_0x38ed('0x45')]=_[_0x38ed('0x44')](_0x4b9986[_0x38ed('0x3f')],qs[_0x38ed('0x46')](_0x2445c0[_0x38ed('0x41')][_0x38ed('0x46')]));_0x1b0034['attributes']=_0x1b0034['attributes'][_0x38ed('0x47')]?_0x1b0034[_0x38ed('0x45')]:_0x4b9986[_0x38ed('0x3f')];if(!_0x2445c0[_0x38ed('0x41')][_0x38ed('0x48')](_0x38ed('0x49'))){_0x1b0034[_0x38ed('0x2d')]=qs['limit'](_0x2445c0[_0x38ed('0x41')][_0x38ed('0x2d')]);_0x1b0034['offset']=qs[_0x38ed('0x2e')](_0x2445c0['query']['offset']);}_0x1b0034[_0x38ed('0x4a')]=qs[_0x38ed('0x4b')](_0x2445c0[_0x38ed('0x41')][_0x38ed('0x4b')]);_0x1b0034[_0x38ed('0x4c')]=qs[_0x38ed('0x43')](_['pick'](_0x2445c0[_0x38ed('0x41')],_0x4b9986['filters']),_0x5ed791);if(_0x2445c0[_0x38ed('0x41')][_0x38ed('0x4d')]){_0x1b0034['where']=_[_0x38ed('0x4e')](_0x1b0034['where'],{'$or':_[_0x38ed('0x40')](_0x5ed791,function(_0xef485e){if(_0xef485e[_0x38ed('0x3d')]!==_0x38ed('0x4f')){var _0x244903={};_0x244903[_0xef485e['name']]={'$like':'%'+_0x2445c0[_0x38ed('0x41')][_0x38ed('0x4d')]+'%'};return _0x244903;}})});}_0x1b0034=_[_0x38ed('0x4e')]({},_0x1b0034,_0x2445c0[_0x38ed('0x50')]);var _0x3ce4f8={'where':_0x1b0034[_0x38ed('0x4c')]};return db[_0x38ed('0x3b')]['count'](_0x3ce4f8)[_0x38ed('0x1f')](function(_0x15f8fa){_0x4ca213['count']=_0x15f8fa;if(_0x2445c0['query'][_0x38ed('0x51')]){_0x1b0034[_0x38ed('0x52')]=[{'all':!![]}];}return db[_0x38ed('0x3b')]['findAll'](_0x1b0034);})[_0x38ed('0x1f')](function(_0xd5946a){_0x4ca213[_0x38ed('0x53')]=_0xd5946a;return _0x4ca213;})[_0x38ed('0x1f')](respondWithFilteredResult(_0x35c03f,_0x1b0034))[_0x38ed('0x54')](handleError(_0x35c03f,null));};exports[_0x38ed('0x55')]=function(_0x25458c,_0x3b3a2b){var _0x17b367={'raw':![],'where':{'id':_0x25458c[_0x38ed('0x56')]['id']},'include':[{'model':db[_0x38ed('0x39')],'as':'mandatoryDispositionPause'}]},_0xd7eff5={};_0xd7eff5['model']=_[_0x38ed('0x42')](db['OpenchannelAccount']['rawAttributes']);_0xd7eff5['query']=_[_0x38ed('0x42')](_0x25458c['query']);_0xd7eff5[_0x38ed('0x43')]=_['intersection'](_0xd7eff5['model'],_0xd7eff5[_0x38ed('0x41')]);_0x17b367[_0x38ed('0x45')]=_[_0x38ed('0x44')](_0xd7eff5[_0x38ed('0x3f')],qs['fields'](_0x25458c['query'][_0x38ed('0x46')]));_0x17b367['attributes']=_0x17b367[_0x38ed('0x45')][_0x38ed('0x47')]?_0x17b367['attributes']:_0xd7eff5[_0x38ed('0x3f')];if(_0x25458c['query'][_0x38ed('0x51')]){_0x17b367[_0x38ed('0x52')]=[{'all':!![]}];}_0x17b367=_[_0x38ed('0x4e')]({},_0x17b367,_0x25458c[_0x38ed('0x50')]);return db['OpenchannelAccount']['find'](_0x17b367)[_0x38ed('0x1f')](handleEntityNotFound(_0x3b3a2b,null))['then'](respondWithResult(_0x3b3a2b,null))[_0x38ed('0x54')](handleError(_0x3b3a2b,null));};exports[_0x38ed('0x57')]=function(_0x521bed,_0x380fe0){return db[_0x38ed('0x3b')]['create'](_0x521bed['body'],{})[_0x38ed('0x1f')](function(_0x34f64c){var _0x585ea7=_0x521bed[_0x38ed('0x58')][_0x38ed('0x35')]({'plain':!![]});if(!_0x585ea7)throw new Error(_0x38ed('0x59'));if(_0x585ea7[_0x38ed('0x5a')]==='user'){var _0x4fe374=_0x34f64c['get']({'plain':!![]});var _0x4d3378=_0x38ed('0x36');return db['UserProfileSection'][_0x38ed('0x5b')]({'where':{'name':_0x4d3378,'userProfileId':_0x585ea7['userProfileId']},'raw':!![]})['then'](function(_0x1d678e){if(_0x1d678e&&_0x1d678e[_0x38ed('0x5c')]===0x0){return db[_0x38ed('0x5d')][_0x38ed('0x57')]({'name':_0x4fe374[_0x38ed('0x37')],'resourceId':_0x4fe374['id'],'type':_0x1d678e[_0x38ed('0x37')],'sectionId':_0x1d678e['id']},{})[_0x38ed('0x1f')](function(){return _0x34f64c;});}else{return _0x34f64c;}})['catch'](function(_0x28076f){logger[_0x38ed('0x25')](_0x38ed('0x5e'),_0x28076f);throw _0x28076f;});}return _0x34f64c;})[_0x38ed('0x1f')](respondWithResult(_0x380fe0,0xc9))[_0x38ed('0x54')](handleError(_0x380fe0,null));};exports[_0x38ed('0x5f')]=function(_0x3b050a,_0x48f4ae){if(_0x3b050a[_0x38ed('0x60')]['id']){delete _0x3b050a['body']['id'];}return db[_0x38ed('0x3b')][_0x38ed('0x5b')]({'where':{'id':_0x3b050a[_0x38ed('0x56')]['id']},'include':[{'model':db[_0x38ed('0x39')],'as':_0x38ed('0x3a')}]})[_0x38ed('0x1f')](handleEntityNotFound(_0x48f4ae,null))['then'](saveUpdates(_0x3b050a['body'],null))[_0x38ed('0x1f')](respondWithResult(_0x48f4ae,null))['catch'](handleError(_0x48f4ae,null));};exports[_0x38ed('0x34')]=function(_0x3ec5f9,_0x19a193){return db['OpenchannelAccount'][_0x38ed('0x5b')]({'where':{'id':_0x3ec5f9[_0x38ed('0x56')]['id']}})['then'](handleEntityNotFound(_0x19a193,null))[_0x38ed('0x1f')](removeEntity(_0x19a193,null))[_0x38ed('0x54')](handleError(_0x19a193,null));};exports['describe']=function(_0x81bad,_0x475cfd){return db[_0x38ed('0x3b')][_0x38ed('0x61')]()[_0x38ed('0x1f')](respondWithResult(_0x475cfd,null))[_0x38ed('0x54')](handleError(_0x475cfd,null));};exports[_0x38ed('0x62')]=function(_0x2f2bf7,_0x151a0f,_0x1bc0fb){if(_0x2f2bf7[_0x38ed('0x60')]['id']){delete _0x2f2bf7[_0x38ed('0x60')]['id'];}return db[_0x38ed('0x3b')]['find']({'where':{'id':_0x2f2bf7[_0x38ed('0x56')]['id']}})['then'](handleEntityNotFound(_0x151a0f,null))[_0x38ed('0x1f')](function(_0x3dafd2){if(_0x3dafd2){_0x2f2bf7['body']['OpenchannelAccountId']=_0x3dafd2['id'];return db['Disposition'][_0x38ed('0x57')](_0x2f2bf7['body']);}})[_0x38ed('0x1f')](respondWithResult(_0x151a0f,null))[_0x38ed('0x54')](handleError(_0x151a0f,null));};exports[_0x38ed('0x63')]=function(_0x18e732,_0x2d108c,_0x3d2da1){var _0x410b95={'raw':![],'where':{}};var _0x27c6ab={};var _0x5392bd={'count':0x0,'rows':[]};return db[_0x38ed('0x3b')][_0x38ed('0x64')]({'where':{'id':_0x18e732['params']['id']}})[_0x38ed('0x1f')](handleEntityNotFound(_0x2d108c,null))[_0x38ed('0x1f')](function(_0x496c06){if(_0x496c06){_0x27c6ab[_0x38ed('0x3f')]=_[_0x38ed('0x42')](db[_0x38ed('0x65')][_0x38ed('0x3c')]);_0x27c6ab[_0x38ed('0x41')]=_[_0x38ed('0x42')](_0x18e732['query']);_0x27c6ab[_0x38ed('0x43')]=_[_0x38ed('0x44')](_0x27c6ab[_0x38ed('0x3f')],_0x27c6ab[_0x38ed('0x41')]);_0x410b95[_0x38ed('0x45')]=_[_0x38ed('0x44')](_0x27c6ab[_0x38ed('0x3f')],qs[_0x38ed('0x46')](_0x18e732[_0x38ed('0x41')][_0x38ed('0x46')]));_0x410b95[_0x38ed('0x45')]=_0x410b95[_0x38ed('0x45')][_0x38ed('0x47')]?_0x410b95[_0x38ed('0x45')]:_0x27c6ab[_0x38ed('0x3f')];if(!_0x18e732[_0x38ed('0x41')]['hasOwnProperty']('nolimit')){_0x410b95[_0x38ed('0x2d')]=qs[_0x38ed('0x2d')](_0x18e732[_0x38ed('0x41')][_0x38ed('0x2d')]);_0x410b95[_0x38ed('0x2e')]=qs['offset'](_0x18e732['query']['offset']);}_0x410b95[_0x38ed('0x4a')]=qs[_0x38ed('0x4b')](_0x18e732[_0x38ed('0x41')]['sort']);_0x410b95[_0x38ed('0x4c')]=qs['filters'](_['pick'](_0x18e732['query'],_0x27c6ab[_0x38ed('0x43')]));_0x410b95['where'][_0x38ed('0x66')]=_0x496c06['id'];if(_0x18e732['query']['filter']){_0x410b95[_0x38ed('0x4c')]=_[_0x38ed('0x4e')](_0x410b95[_0x38ed('0x4c')],{'$or':_[_0x38ed('0x40')](_0x410b95['attributes'],function(_0x3bd476){var _0x4e279e={};_0x4e279e[_0x3bd476]={'$like':'%'+_0x18e732[_0x38ed('0x41')][_0x38ed('0x4d')]+'%'};return _0x4e279e;})});}_0x410b95=_['merge']({},_0x410b95,_0x18e732[_0x38ed('0x50')]);return db[_0x38ed('0x65')]['count']({'where':_0x410b95[_0x38ed('0x4c')]})[_0x38ed('0x1f')](function(_0x4b90ee){_0x5392bd[_0x38ed('0x67')]=_0x4b90ee;if(_0x18e732[_0x38ed('0x41')][_0x38ed('0x51')]){_0x410b95[_0x38ed('0x52')]=[{'all':!![]}];}return db[_0x38ed('0x65')]['findAll'](_0x410b95);})[_0x38ed('0x1f')](function(_0xdd01ab){_0x5392bd[_0x38ed('0x53')]=_0xdd01ab;return _0x5392bd;});}})['then'](respondWithFilteredResult(_0x2d108c,_0x410b95))['catch'](handleError(_0x2d108c,null));};exports[_0x38ed('0x68')]=function(_0x36e1a5,_0x400483,_0x164fec){return db['OpenchannelAccount']['find']({'where':{'id':_0x36e1a5[_0x38ed('0x56')]['id']}})[_0x38ed('0x1f')](handleEntityNotFound(_0x400483,null))['then'](function(_0x35df66){if(_0x35df66){return _0x35df66['removeDispositions'](_0x36e1a5[_0x38ed('0x41')][_0x38ed('0x69')]);}})['then'](respondWithStatusCode(_0x400483,null))[_0x38ed('0x54')](handleError(_0x400483,null));};exports[_0x38ed('0x6a')]=function(_0x258bd9,_0x5cf2f1,_0x225af3){if(_0x258bd9[_0x38ed('0x60')]['id']){delete _0x258bd9['body']['id'];}return db[_0x38ed('0x3b')][_0x38ed('0x5b')]({'where':{'id':_0x258bd9[_0x38ed('0x56')]['id']}})['then'](handleEntityNotFound(_0x5cf2f1,null))[_0x38ed('0x1f')](function(_0x24cfd2){if(_0x24cfd2){_0x258bd9['body']['OpenchannelAccountId']=_0x24cfd2['id'];return db['CannedAnswer'][_0x38ed('0x57')](_0x258bd9[_0x38ed('0x60')]);}})['then'](respondWithResult(_0x5cf2f1,null))[_0x38ed('0x54')](handleError(_0x5cf2f1,null));};exports[_0x38ed('0x6b')]=function(_0x3060d4,_0x542896,_0x2e1875){var _0x5846d7={'raw':![],'where':{}};var _0x4cb121={};var _0x4c7268={'count':0x0,'rows':[]};return db[_0x38ed('0x3b')][_0x38ed('0x64')]({'where':{'id':_0x3060d4[_0x38ed('0x56')]['id']}})['then'](handleEntityNotFound(_0x542896,null))['then'](function(_0x3fa113){if(_0x3fa113){_0x4cb121[_0x38ed('0x3f')]=_[_0x38ed('0x42')](db['CannedAnswer'][_0x38ed('0x3c')]);_0x4cb121[_0x38ed('0x41')]=_['keys'](_0x3060d4[_0x38ed('0x41')]);_0x4cb121['filters']=_[_0x38ed('0x44')](_0x4cb121['model'],_0x4cb121[_0x38ed('0x41')]);_0x5846d7[_0x38ed('0x45')]=_[_0x38ed('0x44')](_0x4cb121[_0x38ed('0x3f')],qs['fields'](_0x3060d4[_0x38ed('0x41')][_0x38ed('0x46')]));_0x5846d7[_0x38ed('0x45')]=_0x5846d7[_0x38ed('0x45')][_0x38ed('0x47')]?_0x5846d7[_0x38ed('0x45')]:_0x4cb121['model'];if(!_0x3060d4[_0x38ed('0x41')]['hasOwnProperty']('nolimit')){_0x5846d7[_0x38ed('0x2d')]=qs[_0x38ed('0x2d')](_0x3060d4[_0x38ed('0x41')]['limit']);_0x5846d7[_0x38ed('0x2e')]=qs[_0x38ed('0x2e')](_0x3060d4['query'][_0x38ed('0x2e')]);}_0x5846d7[_0x38ed('0x4a')]=qs[_0x38ed('0x4b')](_0x3060d4[_0x38ed('0x41')]['sort']);_0x5846d7[_0x38ed('0x4c')]=qs[_0x38ed('0x43')](_['pick'](_0x3060d4[_0x38ed('0x41')],_0x4cb121[_0x38ed('0x43')]));_0x5846d7[_0x38ed('0x4c')][_0x38ed('0x66')]=_0x3fa113['id'];if(_0x3060d4[_0x38ed('0x41')]['filter']){_0x5846d7[_0x38ed('0x4c')]=_[_0x38ed('0x4e')](_0x5846d7[_0x38ed('0x4c')],{'$or':_[_0x38ed('0x40')](_0x5846d7['attributes'],function(_0x29c227){var _0x304c4c={};_0x304c4c[_0x29c227]={'$like':'%'+_0x3060d4['query']['filter']+'%'};return _0x304c4c;})});}_0x5846d7=_[_0x38ed('0x4e')]({},_0x5846d7,_0x3060d4[_0x38ed('0x50')]);return db[_0x38ed('0x6c')][_0x38ed('0x67')]({'where':_0x5846d7[_0x38ed('0x4c')]})[_0x38ed('0x1f')](function(_0x20d820){_0x4c7268[_0x38ed('0x67')]=_0x20d820;if(_0x3060d4[_0x38ed('0x41')][_0x38ed('0x51')]){_0x5846d7[_0x38ed('0x52')]=[{'all':!![]}];}return db[_0x38ed('0x6c')][_0x38ed('0x6d')](_0x5846d7);})[_0x38ed('0x1f')](function(_0x12810c){_0x4c7268['rows']=_0x12810c;return _0x4c7268;});}})[_0x38ed('0x1f')](respondWithFilteredResult(_0x542896,_0x5846d7))[_0x38ed('0x54')](handleError(_0x542896,null));};exports['removeAnswers']=function(_0x6e0670,_0x4452e5,_0x68edeb){return db[_0x38ed('0x3b')][_0x38ed('0x5b')]({'where':{'id':_0x6e0670[_0x38ed('0x56')]['id']}})[_0x38ed('0x1f')](handleEntityNotFound(_0x4452e5,null))['then'](function(_0x1e12e1){if(_0x1e12e1){return _0x1e12e1['removeAnswers'](_0x6e0670[_0x38ed('0x41')][_0x38ed('0x69')]);}})[_0x38ed('0x1f')](respondWithStatusCode(_0x4452e5,null))[_0x38ed('0x54')](handleError(_0x4452e5,null));};exports[_0x38ed('0x6e')]=function(_0x51a569,_0x3df6df,_0x5b48a5){var _0x44b353={'body':_0x51a569[_0x38ed('0x60')],'channel':_0x38ed('0x6f')};var _0x25b793=[];var _0x30aa30=[];var _0xe5f000={};var _0x5783d9=![];return db[_0x38ed('0x70')][_0x38ed('0x61')]()[_0x38ed('0x1f')](function(_0x56bb09){if(!_0x56bb09){throw new db['Sequelize'][(_0x38ed('0x71'))](_0x38ed('0x72'));}_0x25b793=_[_0x38ed('0x73')](_[_0x38ed('0x42')](_0x56bb09),[_0x38ed('0x74'),'updatedAt']);_0x30aa30=_[_0x38ed('0x73')](_[_0x38ed('0x42')](_0x56bb09),[_0x38ed('0x74'),'updatedAt',_0x38ed('0x75'),_0x38ed('0x76')]);if(_0x51a569[_0x38ed('0x60')]['id']){delete _0x51a569['body']['id'];}if(_[_0x38ed('0x77')](_0x51a569['body'][_0x38ed('0x78')])){throw new db[(_0x38ed('0x79'))]['ValidationError'](_0x38ed('0x7a'));}if(_[_0x38ed('0x77')](_0x51a569[_0x38ed('0x60')][_0x38ed('0x60')])||_0x51a569[_0x38ed('0x60')][_0x38ed('0x60')]===''){throw new db['Sequelize'][(_0x38ed('0x71'))](_0x38ed('0x7b'));}if(_[_0x38ed('0x77')](_0x51a569[_0x38ed('0x60')][_0x38ed('0x7c')])){throw new db['Sequelize'][(_0x38ed('0x71'))](_0x38ed('0x7d')+_0x30aa30);}if(!_[_0x38ed('0x7e')](_0x30aa30,_0x51a569[_0x38ed('0x60')][_0x38ed('0x7c')])){throw new db[(_0x38ed('0x79'))][(_0x38ed('0x71'))](_0x38ed('0x7f')+_0x30aa30);}_0xe5f000[_0x51a569[_0x38ed('0x60')][_0x38ed('0x7c')]]=_0x51a569[_0x38ed('0x60')][_0x38ed('0x78')];})['then'](function(){return db[_0x38ed('0x3b')][_0x38ed('0x5b')]({'where':{'id':_0x51a569['params']['id']},'include':[{'model':db[_0x38ed('0x80')],'as':'List','include':[{'model':db[_0x38ed('0x70')],'as':_0x38ed('0x81'),'where':_0xe5f000,'limit':0x1,'order':[[_0x38ed('0x82'),_0x38ed('0x83')]]}]},{'model':db[_0x38ed('0x84')],'as':_0x38ed('0x85')}]});})[_0x38ed('0x1f')](handleEntityNotFound(_0x3df6df,null))[_0x38ed('0x1f')](function(_0x71a905){if(_0x71a905&&_0x71a905['List']){_0x44b353['account']=_0x71a905;_0x44b353[_0x38ed('0x86')]=_0x71a905['Applications'];_0x44b353[_0x38ed('0x87')]=_0x71a905[_0x38ed('0x88')];_0x44b353[_0x38ed('0x86')]=_[_0x38ed('0x89')](_0x44b353[_0x38ed('0x86')],[_0x38ed('0x8a')],[_0x38ed('0x8b')]);if(_0x44b353[_0x38ed('0x8c')][_0x38ed('0x85')]){delete _0x44b353[_0x38ed('0x8c')][_0x38ed('0x85')];}if(_0x44b353[_0x38ed('0x8c')][_0x38ed('0x88')]&&_0x44b353[_0x38ed('0x8c')][_0x38ed('0x88')][_0x38ed('0x81')][_0x38ed('0x47')]){return _0x44b353[_0x38ed('0x8c')][_0x38ed('0x88')][_0x38ed('0x81')][0x0];}var _0x50d5c4=_[_0x38ed('0x18')](_0x51a569[_0x38ed('0x60')],{'firstName':_0x51a569[_0x38ed('0x60')][_0x38ed('0x78')],'ListId':_0x71a905[_0x38ed('0x76')]});_0x50d5c4[_0x51a569['body']['mapKey']]=_0x51a569[_0x38ed('0x60')]['from'];return db['CmContact']['create'](_0x50d5c4,{'fields':_0x25b793,'raw':!![]});}})[_0x38ed('0x1f')](handleEntityNotFound(_0x3df6df,null))[_0x38ed('0x1f')](function(_0x2dcc7c){_0x44b353[_0x38ed('0x8d')]=_0x2dcc7c;if(_0x2dcc7c){var _0x25e3a6={'ContactId':_0x2dcc7c['id'],'OpenchannelAccountId':_0x51a569['params']['id'],'from':(_0x2dcc7c[_0x38ed('0x8e')]||'')+'\x20'+(_0x2dcc7c[_0x38ed('0x8f')]||'')};var _0x371211={'OpenchannelAccountId':_0x51a569['params']['id'],'closed':![]};if(_0x51a569[_0x38ed('0x60')][_0x38ed('0x90')]){_0x371211['threadId']=_0x51a569['body'][_0x38ed('0x90')];return db[_0x38ed('0x91')][_0x38ed('0x5b')]({'where':_0x371211})[_0x38ed('0x1f')](function(_0xe55f3e){if(_0xe55f3e){return[_0xe55f3e,![]];}_0x25e3a6[_0x38ed('0x90')]=_0x51a569[_0x38ed('0x60')][_0x38ed('0x90')];_0x25e3a6[_0x38ed('0x92')]=_0x51a569['body']['externalUrl'];return db[_0x38ed('0x91')][_0x38ed('0x57')](_0x25e3a6)[_0x38ed('0x1f')](function(_0x1eb766){return[_0x1eb766,!![]];});});}else{_0x371211[_0x38ed('0x90')]=null;}_0x371211[_0x38ed('0x93')]=_0x2dcc7c['id'];return db[_0x38ed('0x91')][_0x38ed('0x5b')]({'where':_0x371211})[_0x38ed('0x1f')](function(_0x21fc71){if(_0x21fc71){return[_0x21fc71,![]];}return db['OpenchannelInteraction'][_0x38ed('0x57')](_0x25e3a6)['then'](function(_0x2915d0){return[_0x2915d0,!![]];});});}})['spread'](function(_0x2c59bf,_0x4bdb38){if(_0x2c59bf){_0x5783d9=_0x4bdb38;if(!_0x4bdb38){var _0x280b12={'from':(_0x44b353[_0x38ed('0x8d')][_0x38ed('0x8e')]||'')+'\x20'+(_0x44b353[_0x38ed('0x8d')][_0x38ed('0x8f')]||'')};if(_0x51a569[_0x38ed('0x60')][_0x38ed('0x90')]&&_0x51a569[_0x38ed('0x60')][_0x38ed('0x94')]&&_0x51a569[_0x38ed('0x60')][_0x38ed('0x90')]!=_0x51a569[_0x38ed('0x60')][_0x38ed('0x94')]){_0x280b12[_0x38ed('0x90')]=_0x51a569[_0x38ed('0x60')][_0x38ed('0x94')];}return _0x2c59bf[_0x38ed('0x5f')](_0x280b12);}else{return _0x2c59bf;}}})[_0x38ed('0x1f')](function(_0x21aec6){_0x44b353[_0x38ed('0x95')]=_0x21aec6[_0x38ed('0x35')]({'plain':!![]});_0x44b353[_0x38ed('0x95')]['created']=_0x5783d9;if(_0x44b353[_0x38ed('0x95')][_0x38ed('0x96')]){if(_0x44b353[_0x38ed('0x8c')]['autoclose']){_0x44b353['applications']['push']({'id':0x0,'priority':_0x44b353['applications'][_0x38ed('0x47')]+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}}return db[_0x38ed('0x97')][_0x38ed('0x57')]({'body':_0x51a569[_0x38ed('0x60')][_0x38ed('0x60')],'OpenchannelAccountId':_0x51a569['params']['id'],'OpenchannelInteractionId':_0x21aec6['id'],'direction':'in','ContactId':_0x44b353['contact']['id'],'AttachmentId':_0x51a569['body']['AttachmentId']});})[_0x38ed('0x1f')](function(_0x3aaec9){_0x44b353[_0x38ed('0x27')]=_0x3aaec9;if(_0x44b353[_0x38ed('0x95')]['UserId']){return db[_0x38ed('0x98')][_0x38ed('0x5b')]({'attributes':['id',_0x38ed('0x37')],'where':{'id':_0x44b353[_0x38ed('0x95')][_0x38ed('0x99')]}})['then'](function(_0x5a9661){if(_0x5a9661){_0x44b353[_0x38ed('0x86')][_0x38ed('0x9a')]({'id':0x0,'priority':0x0,'app':_0x38ed('0x9b'),'appdata':_0x5a9661[_0x38ed('0x37')]+','+(_0x44b353[_0x38ed('0x8c')][_0x38ed('0x9c')]||0xa),'interval':_0x38ed('0x9d')});_0x44b353[_0x38ed('0x9e')]=![];}return respondWithRpcPromise(_0x38ed('0x9f'),_0x38ed('0xa0'),_0x44b353);});}return respondWithRpcPromise(_0x38ed('0x9f'),_0x38ed('0xa0'),_0x44b353);})['then'](function(_0x1d973e){respondWithRpcPromise(_0x38ed('0xa1'),'EventManager',{'event':_0x38ed('0x6e'),'message':_0x1d973e},client9002);return _0x1d973e;})[_0x38ed('0x1f')](respondWithResult(_0x3df6df,null))[_0x38ed('0x54')](handleError(_0x3df6df,null));};exports[_0x38ed('0xa2')]=function(_0x38ce36,_0x4a0df8,_0x4fbb88){return db[_0x38ed('0x3b')]['findOne']({'where':{'id':_0x38ce36['params']['id']}})[_0x38ed('0x1f')](handleEntityNotFound(_0x4a0df8,null))[_0x38ed('0x1f')](function(_0x15a2e4){if(_0x15a2e4){return db['sequelize'][_0x38ed('0xa3')](function(_0x2918ad){return db[_0x38ed('0x84')][_0x38ed('0x34')]({'where':{'OpenchannelAccountId':_0x38ce36[_0x38ed('0x56')]['id']},'transaction':_0x2918ad})[_0x38ed('0x1f')](function(_0x2b5167){var _0x296766=_[_0x38ed('0x40')](_0x38ce36[_0x38ed('0x60')],function(_0x33cbd8){_0x33cbd8[_0x38ed('0x66')]=_0x38ce36[_0x38ed('0x56')]['id'];return _0x33cbd8;});return db['OpenchannelApplication'][_0x38ed('0xa4')](_0x296766,{'transaction':_0x2918ad});});})[_0x38ed('0x1f')](function(){return db[_0x38ed('0x84')][_0x38ed('0xa5')]({'where':{'OpenchannelAccountId':_0x38ce36[_0x38ed('0x56')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x4a0df8,null))['catch'](handleError(_0x4a0df8,null));};exports[_0x38ed('0xa6')]=function(_0x3b4b11,_0x394b9c,_0x548cd3){var _0x5607d1={};var _0x3c4cc8={};var _0x254246;var _0x5e3154;return db[_0x38ed('0x3b')][_0x38ed('0x64')]({'where':{'id':_0x3b4b11[_0x38ed('0x56')]['id']}})[_0x38ed('0x1f')](handleEntityNotFound(_0x394b9c,null))['then'](function(_0x461c35){if(_0x461c35){_0x254246=_0x461c35;_0x3c4cc8[_0x38ed('0x3f')]=_[_0x38ed('0x42')](db[_0x38ed('0x84')][_0x38ed('0x3c')]);_0x3c4cc8[_0x38ed('0x41')]=_[_0x38ed('0x42')](_0x3b4b11[_0x38ed('0x41')]);_0x3c4cc8[_0x38ed('0x43')]=_[_0x38ed('0x44')](_0x3c4cc8['model'],_0x3c4cc8[_0x38ed('0x41')]);_0x5607d1['attributes']=_[_0x38ed('0x44')](_0x3c4cc8[_0x38ed('0x3f')],qs[_0x38ed('0x46')](_0x3b4b11['query'][_0x38ed('0x46')]));_0x5607d1['attributes']=_0x5607d1[_0x38ed('0x45')][_0x38ed('0x47')]?_0x5607d1[_0x38ed('0x45')]:_0x3c4cc8[_0x38ed('0x3f')];_0x5607d1[_0x38ed('0x4a')]=qs[_0x38ed('0x4b')](_0x3b4b11['query'][_0x38ed('0x4b')]);_0x5607d1[_0x38ed('0x4c')]=qs[_0x38ed('0x43')](_['pick'](_0x3b4b11[_0x38ed('0x41')],_0x3c4cc8[_0x38ed('0x43')]));if(_0x3b4b11['query']['filter']){_0x5607d1[_0x38ed('0x4c')]=_[_0x38ed('0x4e')](_0x5607d1['where'],{'$or':_[_0x38ed('0x40')](_0x5607d1['attributes'],function(_0x4da606){var _0x3341f3={};_0x3341f3[_0x4da606]={'$like':'%'+_0x3b4b11[_0x38ed('0x41')][_0x38ed('0x4d')]+'%'};return _0x3341f3;})});}_0x5607d1=_[_0x38ed('0x4e')]({},_0x5607d1,_0x3b4b11['options']);return _0x254246['getApplications'](_0x5607d1);}})['then'](function(_0x4da95b){if(_0x4da95b){_0x5e3154=_0x4da95b[_0x38ed('0x47')];if(!_0x3b4b11[_0x38ed('0x41')][_0x38ed('0x48')]('nolimit')){_0x5607d1[_0x38ed('0x2d')]=qs[_0x38ed('0x2d')](_0x3b4b11[_0x38ed('0x41')][_0x38ed('0x2d')]);_0x5607d1[_0x38ed('0x2e')]=qs[_0x38ed('0x2e')](_0x3b4b11[_0x38ed('0x41')][_0x38ed('0x2e')]);}return _0x254246[_0x38ed('0xa6')](_0x5607d1);}})[_0x38ed('0x1f')](function(_0xb6ab01){if(_0xb6ab01){return _0xb6ab01?{'count':_0x5e3154,'rows':_0xb6ab01}:null;}})[_0x38ed('0x1f')](respondWithResult(_0x394b9c,null))[_0x38ed('0x54')](handleError(_0x394b9c,null));};exports[_0x38ed('0xa7')]=function(_0x3e576c,_0x973889,_0x5e58f1){var _0x316fb4={'raw':![],'where':{}};var _0x1f0c13={};var _0x4837ac={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x38ed('0x64')]({'where':{'id':_0x3e576c['params']['id']}})[_0x38ed('0x1f')](handleEntityNotFound(_0x973889,null))[_0x38ed('0x1f')](function(_0x3f79be){if(_0x3f79be){_0x1f0c13['model']=_['keys'](db[_0x38ed('0x91')]['rawAttributes']);_0x1f0c13[_0x38ed('0x41')]=_[_0x38ed('0x42')](_0x3e576c['query']);_0x1f0c13[_0x38ed('0x43')]=_[_0x38ed('0x44')](_0x1f0c13[_0x38ed('0x3f')],_0x1f0c13['query']);_0x316fb4[_0x38ed('0x45')]=_[_0x38ed('0x44')](_0x1f0c13[_0x38ed('0x3f')],qs[_0x38ed('0x46')](_0x3e576c[_0x38ed('0x41')][_0x38ed('0x46')]));_0x316fb4[_0x38ed('0x45')]=_0x316fb4[_0x38ed('0x45')][_0x38ed('0x47')]?_0x316fb4['attributes']:_0x1f0c13[_0x38ed('0x3f')];if(!_0x3e576c[_0x38ed('0x41')][_0x38ed('0x48')](_0x38ed('0x49'))){_0x316fb4[_0x38ed('0x2d')]=qs[_0x38ed('0x2d')](_0x3e576c[_0x38ed('0x41')]['limit']);_0x316fb4['offset']=qs[_0x38ed('0x2e')](_0x3e576c[_0x38ed('0x41')][_0x38ed('0x2e')]);}_0x316fb4[_0x38ed('0x4a')]=qs[_0x38ed('0x4b')](_0x3e576c['query']['sort']);_0x316fb4[_0x38ed('0x4c')]=qs[_0x38ed('0x43')](_[_0x38ed('0xa8')](_0x3e576c[_0x38ed('0x41')],_0x1f0c13['filters']));_0x316fb4['where']['OpenchannelAccountId']=_0x3f79be['id'];if(_0x3e576c[_0x38ed('0x41')][_0x38ed('0x4d')]){_0x316fb4[_0x38ed('0x4c')]=_[_0x38ed('0x4e')](_0x316fb4[_0x38ed('0x4c')],{'$or':_[_0x38ed('0x40')](_0x316fb4[_0x38ed('0x45')],function(_0x45e783){var _0x1ac284={};_0x1ac284[_0x45e783]={'$like':'%'+_0x3e576c[_0x38ed('0x41')][_0x38ed('0x4d')]+'%'};return _0x1ac284;})});}_0x316fb4=_[_0x38ed('0x4e')]({},_0x316fb4,_0x3e576c[_0x38ed('0x50')]);return db[_0x38ed('0x91')]['count']({'where':_0x316fb4['where']})[_0x38ed('0x1f')](function(_0x1c5b6a){_0x4837ac['count']=_0x1c5b6a;if(_0x3e576c[_0x38ed('0x41')][_0x38ed('0x51')]){_0x316fb4[_0x38ed('0x52')]=[{'model':db[_0x38ed('0x70')],'as':_0x38ed('0xa9'),'required':![]},{'model':db[_0x38ed('0x98')],'as':_0x38ed('0xaa'),'attributes':['name',_0x38ed('0xab'),_0x38ed('0xac')],'required':![]},{'model':db[_0x38ed('0xad')],'as':'Tags','attributes':['id',_0x38ed('0x37'),_0x38ed('0xae')],'where':_0x3e576c['query'][_0x38ed('0xaf')]?{'id':_0x3e576c['query'][_0x38ed('0xaf')]}:undefined,'required':_0x3e576c['query']['tag']?!![]:![]}];}return db[_0x38ed('0x91')]['findAll'](_0x316fb4);})['then'](function(_0x50131d){_0x4837ac[_0x38ed('0x53')]=_0x50131d;return _0x4837ac;});}})[_0x38ed('0x1f')](respondWithFilteredResult(_0x973889,_0x316fb4))[_0x38ed('0x54')](handleError(_0x973889,null));};exports[_0x38ed('0xb0')]=function(_0x3beb99,_0x3c4446,_0x24927d){return db[_0x38ed('0x3b')][_0x38ed('0x5b')]({'where':{'id':_0x3beb99['params']['id']}})[_0x38ed('0x1f')](handleEntityNotFound(_0x3c4446,null))[_0x38ed('0x1f')](function(_0xf8a11c){if(_0xf8a11c){return _0xf8a11c[_0x38ed('0xb0')](_0x3beb99[_0x38ed('0x60')][_0x38ed('0x69')],_[_0x38ed('0xb1')](_0x3beb99['body'],['ids','id'])||{})[_0x38ed('0xb2')](function(_0x4aac53){for(var _0x39e8ae=0x0;_0x39e8ae<_0x3beb99[_0x38ed('0x60')][_0x38ed('0x69')][_0x38ed('0x47')];_0x39e8ae+=0x1){socket[_0x38ed('0xb3')]('userOpenchannelAccount:save',{'UserId':Number(_0x3beb99['body']['ids'][_0x39e8ae]),'OpenchannelAccountId':Number(_0x3beb99[_0x38ed('0x56')]['id'])});}return _0x4aac53;});}})[_0x38ed('0x1f')](respondWithResult(_0x3c4446,null))['catch'](handleError(_0x3c4446,null));};exports[_0x38ed('0xb4')]=function(_0x12b264,_0x4ebbcf,_0x3e73d5){return db[_0x38ed('0x3b')]['find']({'where':{'id':_0x12b264[_0x38ed('0x56')]['id']}})[_0x38ed('0x1f')](handleEntityNotFound(_0x4ebbcf,null))[_0x38ed('0x1f')](function(_0x191f30){if(_0x191f30){return _0x191f30[_0x38ed('0xb4')](_0x12b264[_0x38ed('0x41')]['ids'])['then'](function(){if(_[_0x38ed('0xb5')](_0x12b264['query'][_0x38ed('0x69')])){for(var _0x139a93=0x0;_0x139a93<_0x12b264[_0x38ed('0x41')]['ids']['length'];_0x139a93+=0x1){socket[_0x38ed('0xb3')](_0x38ed('0xb6'),{'UserId':Number(_0x12b264[_0x38ed('0x41')]['ids'][_0x139a93]),'OpenchannelAccountId':Number(_0x12b264['params']['id'])});}}else{socket[_0x38ed('0xb3')](_0x38ed('0xb6'),{'UserId':Number(_0x12b264[_0x38ed('0x41')][_0x38ed('0x69')]),'OpenchannelAccountId':Number(_0x12b264[_0x38ed('0x56')]['id'])});}});}})[_0x38ed('0x1f')](respondWithStatusCode(_0x4ebbcf,null))[_0x38ed('0x54')](handleError(_0x4ebbcf,null));};exports['getAgents']=function(_0x1d5561,_0x2e81c9,_0x2735b4){var _0x55ffaa={};var _0x48002a={};var _0x46bc6a;var _0x29929b;return db[_0x38ed('0x3b')][_0x38ed('0x64')]({'where':{'id':_0x1d5561[_0x38ed('0x56')]['id']}})[_0x38ed('0x1f')](handleEntityNotFound(_0x2e81c9,null))[_0x38ed('0x1f')](function(_0x1ec476){if(_0x1ec476){_0x46bc6a=_0x1ec476;_0x48002a[_0x38ed('0x3f')]=_['keys'](db[_0x38ed('0x98')][_0x38ed('0x3c')]);_0x48002a['query']=_[_0x38ed('0x42')](_0x1d5561[_0x38ed('0x41')]);_0x48002a['filters']=_['intersection'](_0x48002a[_0x38ed('0x3f')],_0x48002a[_0x38ed('0x41')]);_0x55ffaa[_0x38ed('0x45')]=_[_0x38ed('0x44')](_0x48002a['model'],qs[_0x38ed('0x46')](_0x1d5561[_0x38ed('0x41')][_0x38ed('0x46')]));_0x55ffaa['attributes']=_0x55ffaa[_0x38ed('0x45')]['length']?_0x55ffaa[_0x38ed('0x45')]:_0x48002a['model'];_0x55ffaa[_0x38ed('0x4a')]=qs['sort'](_0x1d5561[_0x38ed('0x41')]['sort']);_0x55ffaa[_0x38ed('0x4c')]=qs[_0x38ed('0x43')](_['pick'](_0x1d5561[_0x38ed('0x41')],_0x48002a[_0x38ed('0x43')]));if(_0x1d5561[_0x38ed('0x41')]['filter']){_0x55ffaa['where']=_['merge'](_0x55ffaa[_0x38ed('0x4c')],{'$or':_[_0x38ed('0x40')](_0x55ffaa[_0x38ed('0x45')],function(_0x136954){var _0x3b9e6f={};_0x3b9e6f[_0x136954]={'$like':'%'+_0x1d5561[_0x38ed('0x41')][_0x38ed('0x4d')]+'%'};return _0x3b9e6f;})});}_0x55ffaa=_[_0x38ed('0x4e')]({},_0x55ffaa,_0x1d5561[_0x38ed('0x50')]);return _0x46bc6a[_0x38ed('0xb7')](_0x55ffaa);}})[_0x38ed('0x1f')](function(_0x1e0009){if(_0x1e0009){_0x29929b=_0x1e0009[_0x38ed('0x47')];if(!_0x1d5561[_0x38ed('0x41')][_0x38ed('0x48')]('nolimit')){_0x55ffaa[_0x38ed('0x2d')]=qs['limit'](_0x1d5561[_0x38ed('0x41')][_0x38ed('0x2d')]);_0x55ffaa['offset']=qs[_0x38ed('0x2e')](_0x1d5561[_0x38ed('0x41')][_0x38ed('0x2e')]);}return _0x46bc6a[_0x38ed('0xb7')](_0x55ffaa);}})['then'](function(_0x1118b5){if(_0x1118b5){return _0x1118b5?{'count':_0x29929b,'rows':_0x1118b5}:null;}})['then'](respondWithResult(_0x2e81c9,null))[_0x38ed('0x54')](handleError(_0x2e81c9,null));};exports[_0x38ed('0xb8')]=function(_0x4799df,_0x5bfdc2,_0x5d0f2a){var _0x641d42,_0x39374c,_0x1c15ac;if(_[_0x38ed('0x77')](_0x4799df[_0x38ed('0x60')][_0x38ed('0x60')])||_0x4799df[_0x38ed('0x60')][_0x38ed('0x60')]===''){throw new db[(_0x38ed('0x79'))][(_0x38ed('0x71'))](_0x38ed('0x7b'));}if(_[_0x38ed('0x77')](_0x4799df[_0x38ed('0x60')]['to'])){}_0x641d42=_0x4799df[_0x38ed('0x60')]['to'];return db['OpenchannelAccount'][_0x38ed('0x64')]({'where':{'id':_0x4799df[_0x38ed('0x56')]['id']}})['then'](handleEntityNotFound(_0x5bfdc2,null))[_0x38ed('0x1f')](function(_0x3d2d42){if(_0x3d2d42){return db['OpenchannelAccount'][_0x38ed('0x5b')]({'where':{'id':_0x3d2d42['id']},'include':[{'model':db[_0x38ed('0x80')],'as':'List','include':[{'model':db[_0x38ed('0x70')],'as':_0x38ed('0x81'),'where':{[_0x3d2d42['mapKey']]:_0x641d42},'limit':0x1,'order':[[_0x38ed('0x82'),_0x38ed('0x83')]]}]}]})['then'](handleEntityNotFound(_0x5bfdc2,null))[_0x38ed('0x1f')](function(_0x51a09c){if(_0x51a09c&&_0x51a09c[_0x38ed('0x88')]){_0x39374c=_0x51a09c['get']({'plain':!![]});if(_0x39374c[_0x38ed('0x88')]&&_0x39374c[_0x38ed('0x88')]['Contacts'][_0x38ed('0x47')]){return _0x39374c[_0x38ed('0x88')]['Contacts'][0x0];}return db['CmContact'][_0x38ed('0x57')](_[_0x38ed('0x18')](_0x4799df[_0x38ed('0x60')],{'firstName':_0x641d42,[_0x51a09c[_0x38ed('0x7c')]]:_0x641d42,'phone':_0x641d42,'ListId':_0x39374c[_0x38ed('0x76')]}));}})[_0x38ed('0x1f')](handleEntityNotFound(_0x5bfdc2,null))[_0x38ed('0x1f')](function(_0x5d216a){if(_0x5d216a){_0x1c15ac=_0x5d216a;return db[_0x38ed('0x91')][_0x38ed('0x5b')]({'where':{'ContactId':_0x1c15ac['id'],'closed':![],'OpenchannelAccountId':_0x39374c['id']}})[_0x38ed('0x1f')](function(_0x549edf){if(_0x549edf){return[_0x549edf,![]];}return db[_0x38ed('0x91')][_0x38ed('0x57')]({'UserId':_0x4799df['user']['id'],'ContactId':_0x1c15ac['id'],'OpenchannelAccountId':_0x39374c['id'],'lastMsgDirection':_0x38ed('0xb9'),'Messages':[_[_0x38ed('0x4e')](_0x4799df[_0x38ed('0x60')],{'read':![],'body':_0x4799df[_0x38ed('0x60')]['body'],'OpenchannelAccountId':_0x39374c['id'],'UserId':_0x4799df[_0x38ed('0x58')]['id'],'ContactId':_0x1c15ac['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x38ed('0xba')}]})[_0x38ed('0x1f')](function(_0x2565b2){return[_0x2565b2,!![]];});});}})['spread'](function(_0x57f74f,_0x4851ea){if(_0x4851ea){return _0x57f74f;}return db[_0x38ed('0x97')][_0x38ed('0x57')](_['merge'](_0x4799df[_0x38ed('0x60')],{'read':![],'body':_0x4799df[_0x38ed('0x60')][_0x38ed('0x60')],'OpenchannelAccountId':_0x39374c['id'],'OpenchannelInteractionId':_0x57f74f['id'],'UserId':_0x4799df[_0x38ed('0x58')]['id'],'ContactId':_0x1c15ac['id']}))[_0x38ed('0x1f')](function(_0xfb0db6){_0x57f74f[_0x38ed('0xbb')][_0x38ed('0xba')]=[];_0x57f74f[_0x38ed('0xbb')][_0x38ed('0xba')]['push'](_0xfb0db6[_0x38ed('0xbb')]);return _0x57f74f;});});}})[_0x38ed('0x1f')](respondWithResult(_0x5bfdc2,null))['catch'](handleError(_0x5bfdc2,null));};
\ No newline at end of file
index 37eef11..61a623e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4483=['../../mysqldb','OpenchannelAccount','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4483,0x1a3));var _0x3448=function(_0x220333,_0x350bdb){_0x220333=_0x220333-0x0;var _0x2be9fb=_0x4483[_0x220333];return _0x2be9fb;};'use strict';var EventEmitter=require(_0x3448('0x0'));var OpenchannelAccount=require(_0x3448('0x1'))['db'][_0x3448('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3448('0x3'),'afterUpdate':_0x3448('0x4'),'afterDestroy':_0x3448('0x5')};function emitEvent(_0x3a7178){return function(_0xef1a93,_0x5f5163,_0xeb5b8){OpenchannelAccountEvents[_0x3448('0x6')](_0x3a7178+':'+_0xef1a93['id'],_0xef1a93);OpenchannelAccountEvents[_0x3448('0x6')](_0x3a7178,_0xef1a93);_0xeb5b8(null);};}for(var e in events){if(events[_0x3448('0x7')](e)){var event=events[e];OpenchannelAccount[_0x3448('0x8')](e,emitEvent(event));}}module[_0x3448('0x9')]=OpenchannelAccountEvents;
\ No newline at end of file
+var _0x668b=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0xc5a279,_0x155360){var _0xc755d3=function(_0x15051c){while(--_0x15051c){_0xc5a279['push'](_0xc5a279['shift']());}};_0xc755d3(++_0x155360);}(_0x668b,0x140));var _0xb668=function(_0x57645b,_0x25f73a){_0x57645b=_0x57645b-0x0;var _0xe82f00=_0x668b[_0x57645b];return _0xe82f00;};'use strict';var EventEmitter=require(_0xb668('0x0'));var OpenchannelAccount=require(_0xb668('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xb668('0x2')](0x0);var events={'afterCreate':_0xb668('0x3'),'afterUpdate':'update','afterDestroy':_0xb668('0x4')};function emitEvent(_0x5e2e83){return function(_0x2fab11,_0x4092a6,_0x2960f5){OpenchannelAccountEvents['emit'](_0x5e2e83+':'+_0x2fab11['id'],_0x2fab11);OpenchannelAccountEvents[_0xb668('0x5')](_0x5e2e83,_0x2fab11);_0x2960f5(null);};}for(var e in events){if(events[_0xb668('0x6')](e)){var event=events[e];OpenchannelAccount[_0xb668('0x7')](e,emitEvent(event));}}module[_0xb668('0x8')]=OpenchannelAccountEvents;
\ No newline at end of file
index f34408a..03f2b88 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(_0x335ac6,_0xeaeed6){var _0x5f2582=function(_0x2e5435){while(--_0x2e5435){_0x335ac6['push'](_0x335ac6['shift']());}};_0x5f2582(++_0xeaeed6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xa9e0[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x483743,_0x12eb0b){var _0x114f93=function(_0xdf0265){while(--_0xdf0265){_0x483743['push'](_0x483743['shift']());}};_0x114f93(++_0x12eb0b);}(_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 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 2db0776..8feb461 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbaf0=['OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','OpenchannelAccount,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','request','then','info','debug'];(function(_0x70e5f7,_0x5572b4){var _0xdc2a76=function(_0x3d60c6){while(--_0x3d60c6){_0x70e5f7['push'](_0x70e5f7['shift']());}};_0xdc2a76(++_0x5572b4);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});config[_0x0baf('0xc')]=_[_0x0baf('0xd')](config[_0x0baf('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0baf('0xe'))(new Redis(config['redis']));require(_0x0baf('0xf'))[_0x0baf('0x10')](socket);function respondWithRpcPromise(_0x465528,_0x2f46e8,_0x7f54d4){return new BPromise(function(_0xf4c8ac,_0x41cead){return client[_0x0baf('0x11')](_0x465528,_0x7f54d4)[_0x0baf('0x12')](function(_0x1d60a2){logger[_0x0baf('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x2f46e8,'request\x20sent');logger[_0x0baf('0x14')](_0x0baf('0x15'),_0x2f46e8,_0x0baf('0x16'),JSON[_0x0baf('0x17')](_0x1d60a2));if(_0x1d60a2['error']){if(_0x1d60a2[_0x0baf('0x18')]['code']===0x1f4){logger[_0x0baf('0x18')](_0x0baf('0x19'),_0x2f46e8,_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);return _0x41cead(_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x2f46e8,_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);return _0xf4c8ac(_0x1d60a2[_0x0baf('0x18')][_0x0baf('0x1a')]);}else{logger[_0x0baf('0x13')](_0x0baf('0x19'),_0x2f46e8,'request\x20sent');_0xf4c8ac(_0x1d60a2[_0x0baf('0x1b')][_0x0baf('0x1a')]);}})[_0x0baf('0x1c')](function(_0x3e9cb4){logger[_0x0baf('0x18')](_0x0baf('0x19'),_0x2f46e8,_0x3e9cb4);_0x41cead(_0x3e9cb4);});});}
\ No newline at end of file
+var _0x8130=['redis','defaults','localhost','socket.io-emitter','register','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http'];(function(_0x10a3c2,_0x2ed862){var _0x53c749=function(_0x35b96a){while(--_0x35b96a){_0x10a3c2['push'](_0x10a3c2['shift']());}};_0x53c749(++_0x2ed862);}(_0x8130,0x146));var _0x0813=function(_0x1da999,_0x5035f0){_0x1da999=_0x1da999-0x0;var _0x1973be=_0x8130[_0x1da999];return _0x1973be;};'use strict';var _=require(_0x0813('0x0'));var util=require(_0x0813('0x1'));var moment=require('moment');var BPromise=require(_0x0813('0x2'));var rs=require(_0x0813('0x3'));var fs=require('fs');var Redis=require(_0x0813('0x4'));var db=require(_0x0813('0x5'))['db'];var utils=require(_0x0813('0x6'));var logger=require(_0x0813('0x7'))('rpc');var config=require(_0x0813('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0813('0x9')]({'port':0x232a});config[_0x0813('0xa')]=_[_0x0813('0xb')](config[_0x0813('0xa')],{'host':_0x0813('0xc'),'port':0x18eb});var socket=require(_0x0813('0xd'))(new Redis(config[_0x0813('0xa')]));require('./openchannelAccount.socket')[_0x0813('0xe')](socket);function respondWithRpcPromise(_0x1815be,_0x251ca8,_0x5a9c5e){return new BPromise(function(_0x5550c8,_0x15f8d6){return client['request'](_0x1815be,_0x5a9c5e)[_0x0813('0xf')](function(_0x5b54ec){logger[_0x0813('0x10')](_0x0813('0x11'),_0x251ca8,_0x0813('0x12'));logger[_0x0813('0x13')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x251ca8,'request\x20sent',JSON[_0x0813('0x14')](_0x5b54ec));if(_0x5b54ec[_0x0813('0x15')]){if(_0x5b54ec['error'][_0x0813('0x16')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x251ca8,_0x5b54ec[_0x0813('0x15')][_0x0813('0x17')]);return _0x15f8d6(_0x5b54ec['error'][_0x0813('0x17')]);}logger['error'](_0x0813('0x11'),_0x251ca8,_0x5b54ec[_0x0813('0x15')][_0x0813('0x17')]);return _0x5550c8(_0x5b54ec[_0x0813('0x15')][_0x0813('0x17')]);}else{logger[_0x0813('0x10')](_0x0813('0x11'),_0x251ca8,_0x0813('0x12'));_0x5550c8(_0x5b54ec['result'][_0x0813('0x17')]);}})['catch'](function(_0x112720){logger[_0x0813('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x251ca8,_0x112720);_0x15f8d6(_0x112720);});});}
\ No newline at end of file
index bdead1f..290d65c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc8b=['emit','removeListener','register','save','update'];(function(_0x4f0f25,_0x5f5bdf){var _0x30e140=function(_0xa34e54){while(--_0xa34e54){_0x4f0f25['push'](_0x4f0f25['shift']());}};_0x30e140(++_0x5f5bdf);}(_0xbc8b,0x16b));var _0xbbc8=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0xbc8b[_0x4dcc2d];return _0x1bbd79;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0xbbc8('0x0'),'remove',_0xbbc8('0x1')];function createListener(_0x258371,_0x472e52){return function(_0x1bb600){_0x472e52[_0xbbc8('0x2')](_0x258371,_0x1bb600);};}function removeListener(_0x8abfdb,_0x49218a){return function(){OpenchannelAccountEvents[_0xbbc8('0x3')](_0x8abfdb,_0x49218a);};}exports[_0xbbc8('0x4')]=function(_0x15cdc6){for(var _0x21f15a=0x0,_0x18c3d7=events['length'];_0x21f15a<_0x18c3d7;_0x21f15a++){var _0x396aa2=events[_0x21f15a];var _0x313a01=createListener('openchannelAccount:'+_0x396aa2,_0x15cdc6);OpenchannelAccountEvents['on'](_0x396aa2,_0x313a01);}};
\ No newline at end of file
+var _0x3098=['remove','update','emit','removeListener','register','openchannelAccount:','./openchannelAccount.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3098,0x86));var _0x8309=function(_0x38fb0d,_0x52b5db){_0x38fb0d=_0x38fb0d-0x0;var _0x30a5d6=_0x3098[_0x38fb0d];return _0x30a5d6;};'use strict';var OpenchannelAccountEvents=require(_0x8309('0x0'));var events=[_0x8309('0x1'),_0x8309('0x2'),_0x8309('0x3')];function createListener(_0x4b9381,_0x316d5c){return function(_0x2ebbd9){_0x316d5c[_0x8309('0x4')](_0x4b9381,_0x2ebbd9);};}function removeListener(_0x2e58f5,_0x1e658e){return function(){OpenchannelAccountEvents[_0x8309('0x5')](_0x2e58f5,_0x1e658e);};}exports[_0x8309('0x6')]=function(_0x2ddf0b){for(var _0x2aa50b=0x0,_0x1e9ac6=events['length'];_0x2aa50b<_0x1e9ac6;_0x2aa50b++){var _0x35ca92=events[_0x2aa50b];var _0x5c2cd1=createListener(_0x8309('0x7')+_0x35ca92,_0x2ddf0b);OpenchannelAccountEvents['on'](_0x35ca92,_0x5c2cd1);}};
\ No newline at end of file
index cf44ee6..d1a9865 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49ae=['./openchannelApplication.controller','get','isAuthenticated','index','post','put','update','/:id','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x24b81e,_0xfdf544){var _0x11ab4d=function(_0x5874a0){while(--_0x5874a0){_0x24b81e['push'](_0x24b81e['shift']());}};_0x11ab4d(++_0xfdf544);}(_0x49ae,0x196));var _0xe49a=function(_0x31a810,_0x32cbb){_0x31a810=_0x31a810-0x0;var _0x272fe7=_0x49ae[_0x31a810];return _0x272fe7;};'use strict';var multer=require('multer');var util=require(_0xe49a('0x0'));var path=require('path');var timeout=require(_0xe49a('0x1'));var express=require(_0xe49a('0x2'));var router=express[_0xe49a('0x3')]();var fs_extra=require(_0xe49a('0x4'));var auth=require(_0xe49a('0x5'));var interaction=require(_0xe49a('0x6'));var config=require(_0xe49a('0x7'));var controller=require(_0xe49a('0x8'));router[_0xe49a('0x9')]('/',auth[_0xe49a('0xa')](),controller[_0xe49a('0xb')]);router['get']('/:id',auth[_0xe49a('0xa')](),controller['show']);router[_0xe49a('0xc')]('/',auth[_0xe49a('0xa')](),controller['create']);router[_0xe49a('0xd')]('/:id',auth[_0xe49a('0xa')](),controller[_0xe49a('0xe')]);router['delete'](_0xe49a('0xf'),auth[_0xe49a('0xa')](),controller[_0xe49a('0x10')]);module[_0xe49a('0x11')]=router;
\ No newline at end of file
+var _0x1774=['../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x5d8018,_0x588592){var _0x151ac4=function(_0x548679){while(--_0x548679){_0x5d8018['push'](_0x5d8018['shift']());}};_0x151ac4(++_0x588592);}(_0x1774,0x105));var _0x4177=function(_0x26392b,_0x19dd91){_0x26392b=_0x26392b-0x0;var _0x3b62db=_0x1774[_0x26392b];return _0x3b62db;};'use strict';var multer=require(_0x4177('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4177('0x1'));var express=require('express');var router=express[_0x4177('0x2')]();var fs_extra=require(_0x4177('0x3'));var auth=require(_0x4177('0x4'));var interaction=require(_0x4177('0x5'));var config=require(_0x4177('0x6'));var controller=require(_0x4177('0x7'));router[_0x4177('0x8')]('/',auth[_0x4177('0x9')](),controller[_0x4177('0xa')]);router[_0x4177('0x8')](_0x4177('0xb'),auth[_0x4177('0x9')](),controller[_0x4177('0xc')]);router[_0x4177('0xd')]('/',auth[_0x4177('0x9')](),controller[_0x4177('0xe')]);router[_0x4177('0xf')](_0x4177('0xb'),auth[_0x4177('0x9')](),controller[_0x4177('0x10')]);router[_0x4177('0x11')](_0x4177('0xb'),auth[_0x4177('0x9')](),controller[_0x4177('0x12')]);module['exports']=router;
\ No newline at end of file
index 3c1d4f9..f3305ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c9b=['STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x6c9b,0x149));var _0xb6c9=function(_0x27278c,_0x2862ad){_0x27278c=_0x27278c-0x0;var _0x404579=_0x6c9b[_0x27278c];return _0x404579;};'use strict';var Sequelize=require('sequelize');module[_0xb6c9('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xb6c9('0x1')],'allowNull':![],'defaultValue':_0xb6c9('0x2')},'appdata':{'type':Sequelize[_0xb6c9('0x3')]()},'description':{'type':Sequelize[_0xb6c9('0x1')]},'interval':{'type':Sequelize[_0xb6c9('0x1')],'defaultValue':_0xb6c9('0x4')}};
\ No newline at end of file
+var _0x4361=['exports','INTEGER','noop','STRING','*,*,*,*'];(function(_0x3bb370,_0x3c6548){var _0x3c119=function(_0x130d22){while(--_0x130d22){_0x3bb370['push'](_0x3bb370['shift']());}};_0x3c119(++_0x3c6548);}(_0x4361,0x1ea));var _0x1436=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x4361[_0x2bf141];return _0x48277b;};'use strict';var Sequelize=require('sequelize');module[_0x1436('0x0')]={'priority':{'type':Sequelize[_0x1436('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1436('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x1436('0x3')],'defaultValue':_0x1436('0x4')}};
\ No newline at end of file
index 636b342..525c6e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5d74=['ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','keys','includeAll','create','update','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse'];(function(_0x3960c1,_0x25b449){var _0x57d66a=function(_0x346707){while(--_0x346707){_0x3960c1['push'](_0x3960c1['shift']());}};_0x57d66a(++_0x25b449);}(_0x5d74,0x82));var _0x45d7=function(_0x2c00ee,_0x5d89cc){_0x2c00ee=_0x2c00ee-0x0;var _0x3a52d6=_0x5d74[_0x2c00ee];return _0x3a52d6;};'use strict';var emlformat=require(_0x45d7('0x0'));var rimraf=require(_0x45d7('0x1'));var zipdir=require(_0x45d7('0x2'));var jsonpatch=require(_0x45d7('0x3'));var rp=require(_0x45d7('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x45d7('0x5'));var path=require(_0x45d7('0x6'));var sox=require(_0x45d7('0x7'));var csv=require(_0x45d7('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x45d7('0x9'));var squel=require('squel');var crypto=require(_0x45d7('0xa'));var jsforce=require(_0x45d7('0xb'));var deskjs=require(_0x45d7('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x45d7('0xd'));var Redis=require(_0x45d7('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x45d7('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x45d7('0x10'))(_0x45d7('0x11'));var utils=require(_0x45d7('0x12'));var config=require(_0x45d7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x45d7('0x14'))['db'];function respondWithStatusCode(_0x45455a,_0x31056e){_0x31056e=_0x31056e||0xcc;return function(_0x4a6d60){if(_0x4a6d60){return _0x45455a[_0x45d7('0x15')](_0x31056e);}return _0x45455a[_0x45d7('0x16')](_0x31056e)[_0x45d7('0x17')]();};}function respondWithResult(_0x56ea6b,_0x335192){_0x335192=_0x335192||0xc8;return function(_0xbeff03){if(_0xbeff03){return _0x56ea6b['status'](_0x335192)['json'](_0xbeff03);}};}function respondWithFilteredResult(_0x44e8a6,_0x433863){return function(_0x4f138d){if(_0x4f138d){var _0x5d46e9=typeof _0x433863[_0x45d7('0x18')]===_0x45d7('0x19')&&typeof _0x433863[_0x45d7('0x1a')]===_0x45d7('0x19');var _0x475239=_0x4f138d[_0x45d7('0x1b')];var _0x4bb2f6=_0x5d46e9?0x0:_0x433863[_0x45d7('0x18')];var _0x225da6=_0x5d46e9?_0x4f138d[_0x45d7('0x1b')]:_0x433863[_0x45d7('0x18')]+_0x433863[_0x45d7('0x1a')];var _0x320cee;if(_0x225da6>=_0x475239){_0x225da6=_0x475239;_0x320cee=0xc8;}else{_0x320cee=0xce;}_0x44e8a6[_0x45d7('0x16')](_0x320cee);return _0x44e8a6[_0x45d7('0x1c')](_0x45d7('0x1d'),_0x4bb2f6+'-'+_0x225da6+'/'+_0x475239)[_0x45d7('0x1e')](_0x4f138d);}return null;};}function patchUpdates(_0x54aa59){return function(_0x386a1a){try{jsonpatch[_0x45d7('0x1f')](_0x386a1a,_0x54aa59,!![]);}catch(_0x274edd){return BPromise['reject'](_0x274edd);}return _0x386a1a[_0x45d7('0x20')]();};}function saveUpdates(_0x5eb1b1,_0x5566ed){return function(_0x3f25d8){if(_0x3f25d8){return _0x3f25d8['update'](_0x5eb1b1)[_0x45d7('0x21')](function(_0x20fd2a){return _0x20fd2a;});}return null;};}function removeEntity(_0x3adde6,_0x41286d){return function(_0x373f8f){if(_0x373f8f){return _0x373f8f[_0x45d7('0x22')]()[_0x45d7('0x21')](function(){_0x3adde6[_0x45d7('0x16')](0xcc)[_0x45d7('0x17')]();});}};}function handleEntityNotFound(_0xc9584b,_0x3e4436){return function(_0x557cb2){if(!_0x557cb2){_0xc9584b[_0x45d7('0x15')](0x194);}return _0x557cb2;};}function handleError(_0x25b75a,_0x461cf9){_0x461cf9=_0x461cf9||0x1f4;return function(_0x4cae1a){logger[_0x45d7('0x23')](_0x4cae1a[_0x45d7('0x24')]);if(_0x4cae1a[_0x45d7('0x25')]){delete _0x4cae1a[_0x45d7('0x25')];}_0x25b75a[_0x45d7('0x16')](_0x461cf9)[_0x45d7('0x26')](_0x4cae1a);};}exports[_0x45d7('0x27')]=function(_0x191d2d,_0x365052){var _0x5e3892={},_0x2c91c3={},_0x308dcd={'count':0x0,'rows':[]};var _0x1d371b=_[_0x45d7('0x28')](db[_0x45d7('0x29')][_0x45d7('0x2a')],function(_0x439bb2){return{'name':_0x439bb2[_0x45d7('0x2b')],'type':_0x439bb2[_0x45d7('0x2c')][_0x45d7('0x2d')]};});_0x2c91c3[_0x45d7('0x2e')]=_[_0x45d7('0x28')](_0x1d371b,_0x45d7('0x25'));_0x2c91c3[_0x45d7('0x2f')]=_['keys'](_0x191d2d[_0x45d7('0x2f')]);_0x2c91c3[_0x45d7('0x30')]=_['intersection'](_0x2c91c3['model'],_0x2c91c3['query']);_0x5e3892['attributes']=_[_0x45d7('0x31')](_0x2c91c3[_0x45d7('0x2e')],qs['fields'](_0x191d2d['query'][_0x45d7('0x32')]));_0x5e3892[_0x45d7('0x33')]=_0x5e3892[_0x45d7('0x33')][_0x45d7('0x34')]?_0x5e3892[_0x45d7('0x33')]:_0x2c91c3[_0x45d7('0x2e')];if(!_0x191d2d[_0x45d7('0x2f')][_0x45d7('0x35')](_0x45d7('0x36'))){_0x5e3892[_0x45d7('0x1a')]=qs[_0x45d7('0x1a')](_0x191d2d[_0x45d7('0x2f')]['limit']);_0x5e3892['offset']=qs[_0x45d7('0x18')](_0x191d2d[_0x45d7('0x2f')]['offset']);}_0x5e3892['order']=qs[_0x45d7('0x37')](_0x191d2d[_0x45d7('0x2f')]['sort']);_0x5e3892[_0x45d7('0x38')]=qs[_0x45d7('0x30')](_['pick'](_0x191d2d[_0x45d7('0x2f')],_0x2c91c3[_0x45d7('0x30')]),_0x1d371b);if(_0x191d2d[_0x45d7('0x2f')][_0x45d7('0x39')]){_0x5e3892[_0x45d7('0x38')]=_[_0x45d7('0x3a')](_0x5e3892[_0x45d7('0x38')],{'$or':_['map'](_0x1d371b,function(_0x583779){if(_0x583779[_0x45d7('0x2c')]!==_0x45d7('0x3b')){var _0x322479={};_0x322479[_0x583779[_0x45d7('0x25')]]={'$like':'%'+_0x191d2d[_0x45d7('0x2f')][_0x45d7('0x39')]+'%'};return _0x322479;}})});}_0x5e3892=_['merge']({},_0x5e3892,_0x191d2d[_0x45d7('0x3c')]);var _0x9de60f={'where':_0x5e3892['where']};return db[_0x45d7('0x29')][_0x45d7('0x1b')](_0x9de60f)[_0x45d7('0x21')](function(_0x43f7a7){_0x308dcd[_0x45d7('0x1b')]=_0x43f7a7;if(_0x191d2d['query']['includeAll']){_0x5e3892[_0x45d7('0x3d')]=[{'all':!![]}];}return db[_0x45d7('0x29')][_0x45d7('0x3e')](_0x5e3892);})['then'](function(_0x54053d){_0x308dcd[_0x45d7('0x3f')]=_0x54053d;return _0x308dcd;})[_0x45d7('0x21')](respondWithFilteredResult(_0x365052,_0x5e3892))[_0x45d7('0x40')](handleError(_0x365052,null));};exports['show']=function(_0xeb8d02,_0x186506){var _0x3274ea={'raw':!![],'where':{'id':_0xeb8d02['params']['id']}},_0x189699={};_0x189699[_0x45d7('0x2e')]=_[_0x45d7('0x41')](db['OpenchannelApplication'][_0x45d7('0x2a')]);_0x189699[_0x45d7('0x2f')]=_[_0x45d7('0x41')](_0xeb8d02[_0x45d7('0x2f')]);_0x189699[_0x45d7('0x30')]=_[_0x45d7('0x31')](_0x189699[_0x45d7('0x2e')],_0x189699[_0x45d7('0x2f')]);_0x3274ea['attributes']=_['intersection'](_0x189699[_0x45d7('0x2e')],qs[_0x45d7('0x32')](_0xeb8d02[_0x45d7('0x2f')][_0x45d7('0x32')]));_0x3274ea[_0x45d7('0x33')]=_0x3274ea[_0x45d7('0x33')][_0x45d7('0x34')]?_0x3274ea[_0x45d7('0x33')]:_0x189699[_0x45d7('0x2e')];if(_0xeb8d02[_0x45d7('0x2f')][_0x45d7('0x42')]){_0x3274ea[_0x45d7('0x3d')]=[{'all':!![]}];}_0x3274ea=_[_0x45d7('0x3a')]({},_0x3274ea,_0xeb8d02[_0x45d7('0x3c')]);return db[_0x45d7('0x29')]['find'](_0x3274ea)[_0x45d7('0x21')](handleEntityNotFound(_0x186506,null))[_0x45d7('0x21')](respondWithResult(_0x186506,null))[_0x45d7('0x40')](handleError(_0x186506,null));};exports['create']=function(_0x230cc2,_0x5915e4){return db['OpenchannelApplication'][_0x45d7('0x43')](_0x230cc2['body'],{})[_0x45d7('0x21')](respondWithResult(_0x5915e4,0xc9))[_0x45d7('0x40')](handleError(_0x5915e4,null));};exports[_0x45d7('0x44')]=function(_0x408fe9,_0x2bc4e1){if(_0x408fe9[_0x45d7('0x45')]['id']){delete _0x408fe9[_0x45d7('0x45')]['id'];}return db['OpenchannelApplication'][_0x45d7('0x46')]({'where':{'id':_0x408fe9[_0x45d7('0x47')]['id']}})[_0x45d7('0x21')](handleEntityNotFound(_0x2bc4e1,null))[_0x45d7('0x21')](saveUpdates(_0x408fe9[_0x45d7('0x45')],null))[_0x45d7('0x21')](respondWithResult(_0x2bc4e1,null))[_0x45d7('0x40')](handleError(_0x2bc4e1,null));};exports['destroy']=function(_0xee1005,_0x3bb668){return db[_0x45d7('0x29')]['find']({'where':{'id':_0xee1005['params']['id']}})[_0x45d7('0x21')](handleEntityNotFound(_0x3bb668,null))[_0x45d7('0x21')](removeEntity(_0x3bb668,null))['catch'](handleError(_0x3bb668,null));};
\ No newline at end of file
+var _0x61b8=['model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','length','include','create','body','find','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','name','send','OpenchannelApplication','rawAttributes','fieldName','type','key'];(function(_0x8ff4a4,_0x1748c1){var _0x26d655=function(_0x319941){while(--_0x319941){_0x8ff4a4['push'](_0x8ff4a4['shift']());}};_0x26d655(++_0x1748c1);}(_0x61b8,0xad));var _0x861b=function(_0x4cc47c,_0x18f1e3){_0x4cc47c=_0x4cc47c-0x0;var _0x19ddd0=_0x61b8[_0x4cc47c];return _0x19ddd0;};'use strict';var emlformat=require(_0x861b('0x0'));var rimraf=require(_0x861b('0x1'));var zipdir=require(_0x861b('0x2'));var jsonpatch=require(_0x861b('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x861b('0x4'));var Mustache=require('mustache');var util=require(_0x861b('0x5'));var path=require('path');var sox=require(_0x861b('0x6'));var csv=require('to-csv');var ejs=require(_0x861b('0x7'));var fs=require('fs');var fs_extra=require(_0x861b('0x8'));var _=require(_0x861b('0x9'));var squel=require(_0x861b('0xa'));var crypto=require('crypto');var jsforce=require(_0x861b('0xb'));var deskjs=require(_0x861b('0xc'));var toCsv=require(_0x861b('0xd'));var querystring=require(_0x861b('0xe'));var Papa=require(_0x861b('0xf'));var Redis=require(_0x861b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x861b('0x11'));var hardwareService=require(_0x861b('0x12'));var logger=require('../../config/logger')(_0x861b('0x13'));var utils=require(_0x861b('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x861b('0x15'));var db=require(_0x861b('0x16'))['db'];function respondWithStatusCode(_0x1d8e57,_0x39e660){_0x39e660=_0x39e660||0xcc;return function(_0x2eb2f8){if(_0x2eb2f8){return _0x1d8e57['sendStatus'](_0x39e660);}return _0x1d8e57[_0x861b('0x17')](_0x39e660)[_0x861b('0x18')]();};}function respondWithResult(_0x290769,_0x3f9c0a){_0x3f9c0a=_0x3f9c0a||0xc8;return function(_0x88e38b){if(_0x88e38b){return _0x290769['status'](_0x3f9c0a)[_0x861b('0x19')](_0x88e38b);}};}function respondWithFilteredResult(_0x308cde,_0x1d39a5){return function(_0x50bca0){if(_0x50bca0){var _0x28cca9=typeof _0x1d39a5[_0x861b('0x1a')]===_0x861b('0x1b')&&typeof _0x1d39a5[_0x861b('0x1c')]===_0x861b('0x1b');var _0x32b606=_0x50bca0[_0x861b('0x1d')];var _0x1d466c=_0x28cca9?0x0:_0x1d39a5['offset'];var _0x2d2bb0=_0x28cca9?_0x50bca0[_0x861b('0x1d')]:_0x1d39a5[_0x861b('0x1a')]+_0x1d39a5['limit'];var _0x148a4d;if(_0x2d2bb0>=_0x32b606){_0x2d2bb0=_0x32b606;_0x148a4d=0xc8;}else{_0x148a4d=0xce;}_0x308cde['status'](_0x148a4d);return _0x308cde[_0x861b('0x1e')](_0x861b('0x1f'),_0x1d466c+'-'+_0x2d2bb0+'/'+_0x32b606)[_0x861b('0x19')](_0x50bca0);}return null;};}function patchUpdates(_0x3cff35){return function(_0x4854be){try{jsonpatch[_0x861b('0x20')](_0x4854be,_0x3cff35,!![]);}catch(_0x2db3c9){return BPromise['reject'](_0x2db3c9);}return _0x4854be[_0x861b('0x21')]();};}function saveUpdates(_0x5d1cdb,_0x3c7435){return function(_0x594e77){if(_0x594e77){return _0x594e77[_0x861b('0x22')](_0x5d1cdb)[_0x861b('0x23')](function(_0x234c39){return _0x234c39;});}return null;};}function removeEntity(_0x1bad5d,_0x51bfc3){return function(_0x4d7b38){if(_0x4d7b38){return _0x4d7b38['destroy']()[_0x861b('0x23')](function(){_0x1bad5d['status'](0xcc)[_0x861b('0x18')]();});}};}function handleEntityNotFound(_0x92508,_0x448829){return function(_0x3a96ca){if(!_0x3a96ca){_0x92508['sendStatus'](0x194);}return _0x3a96ca;};}function handleError(_0x456128,_0x546ede){_0x546ede=_0x546ede||0x1f4;return function(_0x2013cb){logger['error'](_0x2013cb['stack']);if(_0x2013cb[_0x861b('0x24')]){delete _0x2013cb[_0x861b('0x24')];}_0x456128[_0x861b('0x17')](_0x546ede)[_0x861b('0x25')](_0x2013cb);};}exports['index']=function(_0x4cbc71,_0x3db532){var _0x11f8c4={},_0x1df5e1={},_0x549e12={'count':0x0,'rows':[]};var _0x2082d5=_['map'](db[_0x861b('0x26')][_0x861b('0x27')],function(_0x1dfa25){return{'name':_0x1dfa25[_0x861b('0x28')],'type':_0x1dfa25[_0x861b('0x29')][_0x861b('0x2a')]};});_0x1df5e1[_0x861b('0x2b')]=_[_0x861b('0x2c')](_0x2082d5,_0x861b('0x24'));_0x1df5e1[_0x861b('0x2d')]=_[_0x861b('0x2e')](_0x4cbc71['query']);_0x1df5e1[_0x861b('0x2f')]=_[_0x861b('0x30')](_0x1df5e1['model'],_0x1df5e1[_0x861b('0x2d')]);_0x11f8c4[_0x861b('0x31')]=_[_0x861b('0x30')](_0x1df5e1[_0x861b('0x2b')],qs[_0x861b('0x32')](_0x4cbc71[_0x861b('0x2d')][_0x861b('0x32')]));_0x11f8c4[_0x861b('0x31')]=_0x11f8c4[_0x861b('0x31')]['length']?_0x11f8c4[_0x861b('0x31')]:_0x1df5e1[_0x861b('0x2b')];if(!_0x4cbc71['query'][_0x861b('0x33')]('nolimit')){_0x11f8c4[_0x861b('0x1c')]=qs[_0x861b('0x1c')](_0x4cbc71[_0x861b('0x2d')][_0x861b('0x1c')]);_0x11f8c4[_0x861b('0x1a')]=qs[_0x861b('0x1a')](_0x4cbc71[_0x861b('0x2d')]['offset']);}_0x11f8c4[_0x861b('0x34')]=qs[_0x861b('0x35')](_0x4cbc71[_0x861b('0x2d')][_0x861b('0x35')]);_0x11f8c4[_0x861b('0x36')]=qs[_0x861b('0x2f')](_[_0x861b('0x37')](_0x4cbc71[_0x861b('0x2d')],_0x1df5e1[_0x861b('0x2f')]),_0x2082d5);if(_0x4cbc71['query'][_0x861b('0x38')]){_0x11f8c4[_0x861b('0x36')]=_[_0x861b('0x39')](_0x11f8c4[_0x861b('0x36')],{'$or':_[_0x861b('0x2c')](_0x2082d5,function(_0x836b9e){if(_0x836b9e[_0x861b('0x29')]!==_0x861b('0x3a')){var _0x41a665={};_0x41a665[_0x836b9e[_0x861b('0x24')]]={'$like':'%'+_0x4cbc71[_0x861b('0x2d')][_0x861b('0x38')]+'%'};return _0x41a665;}})});}_0x11f8c4=_['merge']({},_0x11f8c4,_0x4cbc71[_0x861b('0x3b')]);var _0x668850={'where':_0x11f8c4[_0x861b('0x36')]};return db[_0x861b('0x26')][_0x861b('0x1d')](_0x668850)[_0x861b('0x23')](function(_0x16dea7){_0x549e12['count']=_0x16dea7;if(_0x4cbc71[_0x861b('0x2d')][_0x861b('0x3c')]){_0x11f8c4['include']=[{'all':!![]}];}return db[_0x861b('0x26')][_0x861b('0x3d')](_0x11f8c4);})[_0x861b('0x23')](function(_0x15ff0a){_0x549e12[_0x861b('0x3e')]=_0x15ff0a;return _0x549e12;})[_0x861b('0x23')](respondWithFilteredResult(_0x3db532,_0x11f8c4))[_0x861b('0x3f')](handleError(_0x3db532,null));};exports[_0x861b('0x40')]=function(_0xf24dcb,_0x5c630e){var _0x4566e2={'raw':!![],'where':{'id':_0xf24dcb['params']['id']}},_0x500064={};_0x500064[_0x861b('0x2b')]=_['keys'](db[_0x861b('0x26')]['rawAttributes']);_0x500064[_0x861b('0x2d')]=_[_0x861b('0x2e')](_0xf24dcb[_0x861b('0x2d')]);_0x500064['filters']=_[_0x861b('0x30')](_0x500064[_0x861b('0x2b')],_0x500064[_0x861b('0x2d')]);_0x4566e2[_0x861b('0x31')]=_['intersection'](_0x500064[_0x861b('0x2b')],qs[_0x861b('0x32')](_0xf24dcb[_0x861b('0x2d')][_0x861b('0x32')]));_0x4566e2['attributes']=_0x4566e2[_0x861b('0x31')][_0x861b('0x41')]?_0x4566e2[_0x861b('0x31')]:_0x500064['model'];if(_0xf24dcb[_0x861b('0x2d')]['includeAll']){_0x4566e2[_0x861b('0x42')]=[{'all':!![]}];}_0x4566e2=_[_0x861b('0x39')]({},_0x4566e2,_0xf24dcb[_0x861b('0x3b')]);return db['OpenchannelApplication']['find'](_0x4566e2)[_0x861b('0x23')](handleEntityNotFound(_0x5c630e,null))[_0x861b('0x23')](respondWithResult(_0x5c630e,null))[_0x861b('0x3f')](handleError(_0x5c630e,null));};exports[_0x861b('0x43')]=function(_0x4ed9ca,_0x26d6db){return db[_0x861b('0x26')][_0x861b('0x43')](_0x4ed9ca[_0x861b('0x44')],{})[_0x861b('0x23')](respondWithResult(_0x26d6db,0xc9))[_0x861b('0x3f')](handleError(_0x26d6db,null));};exports[_0x861b('0x22')]=function(_0x48c5bc,_0x373931){if(_0x48c5bc[_0x861b('0x44')]['id']){delete _0x48c5bc['body']['id'];}return db[_0x861b('0x26')][_0x861b('0x45')]({'where':{'id':_0x48c5bc[_0x861b('0x46')]['id']}})[_0x861b('0x23')](handleEntityNotFound(_0x373931,null))[_0x861b('0x23')](saveUpdates(_0x48c5bc[_0x861b('0x44')],null))[_0x861b('0x23')](respondWithResult(_0x373931,null))['catch'](handleError(_0x373931,null));};exports[_0x861b('0x47')]=function(_0x1fe06f,_0x356ebd){return db[_0x861b('0x26')][_0x861b('0x45')]({'where':{'id':_0x1fe06f['params']['id']}})[_0x861b('0x23')](handleEntityNotFound(_0x356ebd,null))[_0x861b('0x23')](removeEntity(_0x356ebd,null))[_0x861b('0x3f')](handleError(_0x356ebd,null));};
\ No newline at end of file
index 36d5920..1f4260d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc12c=['exports','define','OpenchannelApplication','openchannel_applications','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','./openchannelApplication.attributes'];(function(_0x412a61,_0x3aa608){var _0xb283e5=function(_0x2087ca){while(--_0x2087ca){_0x412a61['push'](_0x412a61['shift']());}};_0xb283e5(++_0x3aa608);}(_0xc12c,0x191));var _0xcc12=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xc12c[_0x4baae2];return _0x1a2285;};'use strict';var _=require(_0xcc12('0x0'));var util=require(_0xcc12('0x1'));var logger=require('../../config/logger')(_0xcc12('0x2'));var moment=require(_0xcc12('0x3'));var BPromise=require(_0xcc12('0x4'));var rp=require(_0xcc12('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcc12('0x6'));module[_0xcc12('0x7')]=function(_0x2458b0,_0x2dafff){return _0x2458b0[_0xcc12('0x8')](_0xcc12('0x9'),attributes,{'tableName':_0xcc12('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xcc12('0xb')});};
\ No newline at end of file
+var _0x76ff=['OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports'];(function(_0x352764,_0x2e0b01){var _0x3c45a8=function(_0x1ce919){while(--_0x1ce919){_0x352764['push'](_0x352764['shift']());}};_0x3c45a8(++_0x2e0b01);}(_0x76ff,0xdc));var _0xf76f=function(_0xe27bd2,_0x605528){_0xe27bd2=_0xe27bd2-0x0;var _0x5b1a64=_0x76ff[_0xe27bd2];return _0x5b1a64;};'use strict';var _=require(_0xf76f('0x0'));var util=require('util');var logger=require(_0xf76f('0x1'))(_0xf76f('0x2'));var moment=require(_0xf76f('0x3'));var BPromise=require(_0xf76f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf76f('0x5'));var config=require(_0xf76f('0x6'));var attributes=require('./openchannelApplication.attributes');module[_0xf76f('0x7')]=function(_0xa721e9,_0xc25f00){return _0xa721e9['define'](_0xf76f('0x8'),attributes,{'tableName':_0xf76f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf76f('0xa'),'collate':_0xf76f('0xb')});};
\ No newline at end of file
index 9d8d44a..df12b60 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e14=['request\x20sent','debug','stringify','error','message','info','result','catch','UpdateOpenchannelApplication','body','options','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','OpenchannelApplication,\x20%s,\x20%s'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x8e14,0xa5));var _0x48e1=function(_0x1bbbac,_0x5b2538){_0x1bbbac=_0x1bbbac-0x0;var _0xcbf2ea=_0x8e14[_0x1bbbac];return _0xcbf2ea;};'use strict';var _=require(_0x48e1('0x0'));var util=require(_0x48e1('0x1'));var moment=require(_0x48e1('0x2'));var BPromise=require(_0x48e1('0x3'));var rs=require(_0x48e1('0x4'));var fs=require('fs');var Redis=require(_0x48e1('0x5'));var db=require(_0x48e1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x48e1('0x7'))(_0x48e1('0x8'));var config=require(_0x48e1('0x9'));var jayson=require(_0x48e1('0xa'));var client=jayson[_0x48e1('0xb')][_0x48e1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4e43bc,_0x39fbe5,_0x1be8da){return new BPromise(function(_0x4c9480,_0x33058a){return client['request'](_0x4e43bc,_0x1be8da)[_0x48e1('0xd')](function(_0x5cb7eb){logger['info'](_0x48e1('0xe'),_0x39fbe5,_0x48e1('0xf'));logger[_0x48e1('0x10')]('OpenchannelApplication,\x20%s,\x20%s,\x20%s',_0x39fbe5,_0x48e1('0xf'),JSON[_0x48e1('0x11')](_0x5cb7eb));if(_0x5cb7eb[_0x48e1('0x12')]){if(_0x5cb7eb[_0x48e1('0x12')]['code']===0x1f4){logger[_0x48e1('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x39fbe5,_0x5cb7eb[_0x48e1('0x12')][_0x48e1('0x13')]);return _0x33058a(_0x5cb7eb[_0x48e1('0x12')]['message']);}logger['error'](_0x48e1('0xe'),_0x39fbe5,_0x5cb7eb[_0x48e1('0x12')][_0x48e1('0x13')]);return _0x4c9480(_0x5cb7eb[_0x48e1('0x12')]['message']);}else{logger[_0x48e1('0x14')](_0x48e1('0xe'),_0x39fbe5,'request\x20sent');_0x4c9480(_0x5cb7eb[_0x48e1('0x15')]['message']);}})[_0x48e1('0x16')](function(_0x2d681a){logger[_0x48e1('0x12')](_0x48e1('0xe'),_0x39fbe5,_0x2d681a);_0x33058a(_0x2d681a);});});}exports[_0x48e1('0x17')]=function(_0x409957){var _0x1ded76=this;return new Promise(function(_0x5764f7,_0x3ca98b){return db['OpenchannelApplication']['update'](_0x409957[_0x48e1('0x18')],{'raw':_0x409957[_0x48e1('0x19')]?_0x409957[_0x48e1('0x19')][_0x48e1('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x409957[_0x48e1('0x19')]?_0x409957['options'][_0x48e1('0x1b')]||null:null,'attributes':_0x409957[_0x48e1('0x19')]?_0x409957[_0x48e1('0x19')][_0x48e1('0x1c')]||null:null,'limit':_0x409957['options']?_0x409957[_0x48e1('0x19')][_0x48e1('0x1d')]||null:null})[_0x48e1('0xd')](function(_0x3c5f36){logger[_0x48e1('0x14')](_0x48e1('0x17'),_0x409957);logger[_0x48e1('0x10')]('UpdateOpenchannelApplication',_0x409957,JSON[_0x48e1('0x11')](_0x3c5f36));_0x5764f7(_0x3c5f36);})[_0x48e1('0x16')](function(_0x88b15e){logger[_0x48e1('0x12')]('UpdateOpenchannelApplication',_0x88b15e[_0x48e1('0x13')],_0x409957);_0x3ca98b(_0x1ded76[_0x48e1('0x12')](0x1f4,_0x88b15e[_0x48e1('0x13')]));});});};
\ No newline at end of file
+var _0x50da=['request','then','info','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelApplication,\x20%s,\x20%s','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','where','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http'];(function(_0x3a3b9e,_0xc59037){var _0x148103=function(_0x406731){while(--_0x406731){_0x3a3b9e['push'](_0x3a3b9e['shift']());}};_0x148103(++_0xc59037);}(_0x50da,0x105));var _0xa50d=function(_0xd90dd,_0x2d5c82){_0xd90dd=_0xd90dd-0x0;var _0x271492=_0x50da[_0xd90dd];return _0x271492;};'use strict';var _=require('lodash');var util=require(_0xa50d('0x0'));var moment=require(_0xa50d('0x1'));var BPromise=require(_0xa50d('0x2'));var rs=require(_0xa50d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa50d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa50d('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa50d('0x6'));var client=jayson[_0xa50d('0x7')][_0xa50d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x160974,_0x4b474d,_0x158649){return new BPromise(function(_0x433b56,_0x5337aa){return client[_0xa50d('0x9')](_0x160974,_0x158649)[_0xa50d('0xa')](function(_0xfa8619){logger[_0xa50d('0xb')]('OpenchannelApplication,\x20%s,\x20%s',_0x4b474d,_0xa50d('0xc'));logger[_0xa50d('0xd')](_0xa50d('0xe'),_0x4b474d,'request\x20sent',JSON[_0xa50d('0xf')](_0xfa8619));if(_0xfa8619[_0xa50d('0x10')]){if(_0xfa8619[_0xa50d('0x10')][_0xa50d('0x11')]===0x1f4){logger[_0xa50d('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x4b474d,_0xfa8619[_0xa50d('0x10')][_0xa50d('0x12')]);return _0x5337aa(_0xfa8619[_0xa50d('0x10')][_0xa50d('0x12')]);}logger[_0xa50d('0x10')]('OpenchannelApplication,\x20%s,\x20%s',_0x4b474d,_0xfa8619['error']['message']);return _0x433b56(_0xfa8619[_0xa50d('0x10')][_0xa50d('0x12')]);}else{logger[_0xa50d('0xb')](_0xa50d('0x13'),_0x4b474d,_0xa50d('0xc'));_0x433b56(_0xfa8619[_0xa50d('0x14')][_0xa50d('0x12')]);}})[_0xa50d('0x15')](function(_0x4b6468){logger[_0xa50d('0x10')](_0xa50d('0x13'),_0x4b474d,_0x4b6468);_0x5337aa(_0x4b6468);});});}exports[_0xa50d('0x16')]=function(_0x35d1c0){var _0xd545a=this;return new Promise(function(_0x55d737,_0x3bffac){return db[_0xa50d('0x17')][_0xa50d('0x18')](_0x35d1c0[_0xa50d('0x19')],{'raw':_0x35d1c0[_0xa50d('0x1a')]?_0x35d1c0[_0xa50d('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35d1c0[_0xa50d('0x1a')]?_0x35d1c0[_0xa50d('0x1a')][_0xa50d('0x1b')]||null:null,'attributes':_0x35d1c0[_0xa50d('0x1a')]?_0x35d1c0[_0xa50d('0x1a')][_0xa50d('0x1c')]||null:null,'limit':_0x35d1c0['options']?_0x35d1c0[_0xa50d('0x1a')][_0xa50d('0x1d')]||null:null})[_0xa50d('0xa')](function(_0x50a356){logger[_0xa50d('0xb')](_0xa50d('0x16'),_0x35d1c0);logger[_0xa50d('0xd')]('UpdateOpenchannelApplication',_0x35d1c0,JSON[_0xa50d('0xf')](_0x50a356));_0x55d737(_0x50a356);})[_0xa50d('0x15')](function(_0xad4733){logger['error'](_0xa50d('0x16'),_0xad4733[_0xa50d('0x12')],_0x35d1c0);_0x3bffac(_0xd545a['error'](0x1f4,_0xad4733[_0xa50d('0x12')]));});});};
\ No newline at end of file
index 83c5481..0c75db8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x243e=['/:id/tags','removeTags','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','destroy'];(function(_0x4978bb,_0x1f558a){var _0x53b6f4=function(_0x21294a){while(--_0x21294a){_0x4978bb['push'](_0x4978bb['shift']());}};_0x53b6f4(++_0x1f558a);}(_0x243e,0x1c3));var _0xe243=function(_0xb21926,_0x13739d){_0xb21926=_0xb21926-0x0;var _0x44864a=_0x243e[_0xb21926];return _0x44864a;};'use strict';var multer=require(_0xe243('0x0'));var util=require(_0xe243('0x1'));var path=require('path');var timeout=require(_0xe243('0x2'));var express=require('express');var router=express[_0xe243('0x3')]();var fs_extra=require(_0xe243('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xe243('0x5'));var config=require(_0xe243('0x6'));var controller=require(_0xe243('0x7'));router[_0xe243('0x8')]('/',auth[_0xe243('0x9')](),controller[_0xe243('0xa')]);router[_0xe243('0x8')](_0xe243('0xb'),auth[_0xe243('0x9')](),controller['describe']);router[_0xe243('0x8')](_0xe243('0xc'),auth['isAuthenticated'](),controller[_0xe243('0xd')]);router[_0xe243('0x8')](_0xe243('0xe'),auth[_0xe243('0x9')](),controller[_0xe243('0xf')]);router[_0xe243('0x8')](_0xe243('0x10'),auth[_0xe243('0x9')](),controller['download']);router[_0xe243('0x11')]('/',auth[_0xe243('0x9')](),controller[_0xe243('0x12')]);router['post']('/:id/messages',auth[_0xe243('0x9')](),controller[_0xe243('0x13')]);router[_0xe243('0x11')]('/:id/tags',auth[_0xe243('0x9')](),interaction[_0xe243('0x14')](_0xe243('0x15'),_0xe243('0x16')),controller[_0xe243('0x17')]);router[_0xe243('0x18')](_0xe243('0xc'),auth[_0xe243('0x9')](),interaction[_0xe243('0x14')](_0xe243('0x15'),_0xe243('0x19')),controller[_0xe243('0x1a')]);router[_0xe243('0x1b')](_0xe243('0xc'),auth[_0xe243('0x9')](),interaction[_0xe243('0x14')](_0xe243('0x15'),'openchannelinteraction:destroy'),controller[_0xe243('0x1c')]);router['delete'](_0xe243('0x1d'),auth[_0xe243('0x9')](),controller[_0xe243('0x1e')]);module[_0xe243('0x1f')]=router;
\ No newline at end of file
+var _0xbc50=['removeTags','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/describe','isAuthenticated','describe','get','/:id','/:id/messages','getMessages','/:id/download','post','addMessage','/:id/tags','openchannelinteraction:addtags','put','tracked','openchannel','delete','openchannelinteraction:destroy','destroy'];(function(_0x33444b,_0x7ae2ea){var _0x53ecbb=function(_0x45c637){while(--_0x45c637){_0x33444b['push'](_0x33444b['shift']());}};_0x53ecbb(++_0x7ae2ea);}(_0xbc50,0x93));var _0x0bc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc50[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x0bc5('0x0'));var util=require('util');var path=require(_0x0bc5('0x1'));var timeout=require('connect-timeout');var express=require(_0x0bc5('0x2'));var router=express[_0x0bc5('0x3')]();var fs_extra=require(_0x0bc5('0x4'));var auth=require(_0x0bc5('0x5'));var interaction=require(_0x0bc5('0x6'));var config=require(_0x0bc5('0x7'));var controller=require('./openchannelInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0bc5('0x8')]);router['get'](_0x0bc5('0x9'),auth[_0x0bc5('0xa')](),controller[_0x0bc5('0xb')]);router[_0x0bc5('0xc')](_0x0bc5('0xd'),auth[_0x0bc5('0xa')](),controller['show']);router[_0x0bc5('0xc')](_0x0bc5('0xe'),auth['isAuthenticated'](),controller[_0x0bc5('0xf')]);router[_0x0bc5('0xc')](_0x0bc5('0x10'),auth[_0x0bc5('0xa')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x0bc5('0x11')]('/:id/messages',auth[_0x0bc5('0xa')](),controller[_0x0bc5('0x12')]);router[_0x0bc5('0x11')](_0x0bc5('0x13'),auth[_0x0bc5('0xa')](),interaction['tracked']('openchannel',_0x0bc5('0x14')),controller['addTags']);router[_0x0bc5('0x15')](_0x0bc5('0xd'),auth['isAuthenticated'](),interaction[_0x0bc5('0x16')](_0x0bc5('0x17'),'openchannelinteraction:update'),controller['update']);router[_0x0bc5('0x18')](_0x0bc5('0xd'),auth[_0x0bc5('0xa')](),interaction[_0x0bc5('0x16')](_0x0bc5('0x17'),_0x0bc5('0x19')),controller[_0x0bc5('0x1a')]);router['delete'](_0x0bc5('0x13'),auth[_0x0bc5('0xa')](),controller[_0x0bc5('0x1b')]);module[_0x0bc5('0x1c')]=router;
\ No newline at end of file
index 4fe8df7..b1d55a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfaba=['sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x14adfa,_0x4bb7e8){var _0x139619=function(_0x2e21a6){while(--_0x2e21a6){_0x14adfa['push'](_0x14adfa['shift']());}};_0x139619(++_0x4bb7e8);}(_0xfaba,0xa2));var _0xafab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfaba[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xafab('0x0'));module[_0xafab('0x1')]={'closed':{'type':Sequelize[_0xafab('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xafab('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xafab('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xafab('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xafab('0x4')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xafab('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xafab('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xafab('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x863f=['ENUM','out','exports','BOOLEAN','DATE','STRING'];(function(_0x4b309e,_0x311f2c){var _0x4ea7dc=function(_0x5bbb04){while(--_0x5bbb04){_0x4b309e['push'](_0x4b309e['shift']());}};_0x4ea7dc(++_0x311f2c);}(_0x863f,0xda));var _0xf863=function(_0x2e1bf6,_0x41b290){_0x2e1bf6=_0x2e1bf6-0x0;var _0x18cd3a=_0x863f[_0x2e1bf6];return _0x18cd3a;};'use strict';var Sequelize=require('sequelize');module[_0xf863('0x0')]={'closed':{'type':Sequelize[_0xf863('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xf863('0x2')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xf863('0x3')]},'thirdDisposition':{'type':Sequelize[_0xf863('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xf863('0x2')]},'threadId':{'type':Sequelize[_0xf863('0x3')]},'externalUrl':{'type':Sequelize[_0xf863('0x3')]},'lastMsgAt':{'type':Sequelize[_0xf863('0x2')]},'lastMsgDirection':{'type':Sequelize[_0xf863('0x4')]('in',_0xf863('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xf863('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0xf863('0x1')],'defaultValue':![]}};
\ No newline at end of file
index 39b9736..7863204 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa3e5=['getMessages','format','options','findAll','addTags','setTags','omit','spread','color','openchannelInteractionTags:save','removeTags','unix','join','root','files','tmp','server','attachments','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','Owner','get','Openchannel','N.A.','closedAt','disposition','threadId','Public','Private','basename','createReadStream','createWriteStream','YYYY-MM-DD\x20HH:mm:ss','out','System','firstName','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/export/pdf','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','stack','name','fullname','TagIds','Tags','split','forEach','push','catch','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.fullname','ui.OpenchannelInteractionId','users','openchannel_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','search','parseSearch','sqlOperator','conditions','find','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?','buildExpression','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','body','some','compact','isEmpty','OpenchannelAccountId','concat','createdAt','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)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','toString','sequelize','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','rows','show','params','includeAll','include','create','describe','addMessage','OpenchannelMessage','ids'];(function(_0x5ce25c,_0x2a2b55){var _0x3a2958=function(_0x34d516){while(--_0x34d516){_0x5ce25c['push'](_0x5ce25c['shift']());}};_0x3a2958(++_0x2a2b55);}(_0xa3e5,0x11f));var _0x5a3e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa3e5[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5a3e('0x0'));var zipdir=require(_0x5a3e('0x1'));var jsonpatch=require(_0x5a3e('0x2'));var rp=require('request-promise');var moment=require(_0x5a3e('0x3'));var BPromise=require(_0x5a3e('0x4'));var Mustache=require(_0x5a3e('0x5'));var util=require('util');var path=require(_0x5a3e('0x6'));var sox=require(_0x5a3e('0x7'));var csv=require('to-csv');var ejs=require(_0x5a3e('0x8'));var fs=require('fs');var fs_extra=require(_0x5a3e('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5a3e('0xa'));var jsforce=require(_0x5a3e('0xb'));var deskjs=require(_0x5a3e('0xc'));var toCsv=require(_0x5a3e('0xd'));var querystring=require(_0x5a3e('0xe'));var Papa=require(_0x5a3e('0xf'));var Redis=require(_0x5a3e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5a3e('0x11'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x5a3e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5a3e('0x13'))['db'];config[_0x5a3e('0x14')]=_[_0x5a3e('0x15')](config['redis'],{'host':_0x5a3e('0x16'),'port':0x18eb});var socket=require(_0x5a3e('0x17'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x5a3e('0x18')](socket);function respondWithStatusCode(_0x30fa0,_0x17a0ce){_0x17a0ce=_0x17a0ce||0xcc;return function(_0x1dc1c1){if(_0x1dc1c1){return _0x30fa0[_0x5a3e('0x19')](_0x17a0ce);}return _0x30fa0[_0x5a3e('0x1a')](_0x17a0ce)[_0x5a3e('0x1b')]();};}function respondWithResult(_0x122cee,_0x125984){_0x125984=_0x125984||0xc8;return function(_0x241276){if(_0x241276){return _0x122cee[_0x5a3e('0x1a')](_0x125984)[_0x5a3e('0x1c')](_0x241276);}};}function respondWithFilteredResult(_0x3a957a,_0x5d864b){return function(_0x3cf367){if(_0x3cf367){var _0x5ed9c0=typeof _0x5d864b[_0x5a3e('0x1d')]===_0x5a3e('0x1e')&&typeof _0x5d864b[_0x5a3e('0x1f')]===_0x5a3e('0x1e');var _0xc48c3f=_0x3cf367['count'];var _0x76f603=_0x5ed9c0?0x0:_0x5d864b[_0x5a3e('0x1d')];var _0x2120f4=_0x5ed9c0?_0x3cf367[_0x5a3e('0x20')]:_0x5d864b[_0x5a3e('0x1d')]+_0x5d864b[_0x5a3e('0x1f')];var _0x1cd2f7;if(_0x2120f4>=_0xc48c3f){_0x2120f4=_0xc48c3f;_0x1cd2f7=0xc8;}else{_0x1cd2f7=0xce;}_0x3a957a['status'](_0x1cd2f7);return _0x3a957a[_0x5a3e('0x21')](_0x5a3e('0x22'),_0x76f603+'-'+_0x2120f4+'/'+_0xc48c3f)[_0x5a3e('0x1c')](_0x3cf367);}return null;};}function patchUpdates(_0x2129f1){return function(_0x3a67a8){try{jsonpatch['apply'](_0x3a67a8,_0x2129f1,!![]);}catch(_0x208ff7){return BPromise['reject'](_0x208ff7);}return _0x3a67a8[_0x5a3e('0x23')]();};}function saveUpdates(_0xbf5a7,_0x25b33a){return function(_0xd725aa){if(_0xd725aa){return _0xd725aa[_0x5a3e('0x24')](_0xbf5a7)[_0x5a3e('0x25')](function(_0x1fe3bd){return _0x1fe3bd;});}return null;};}function removeEntity(_0x2d25bd,_0x5ac5e7){return function(_0xd770a5){if(_0xd770a5){return _0xd770a5[_0x5a3e('0x26')]()['then'](function(){_0x2d25bd[_0x5a3e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fccca,_0x9f2ed){return function(_0x5eabd2){if(!_0x5eabd2){_0x2fccca['sendStatus'](0x194);}return _0x5eabd2;};}function handleError(_0x1e0c2a,_0x42cae9){_0x42cae9=_0x42cae9||0x1f4;return function(_0xf24e4){logger[_0x5a3e('0x27')](_0xf24e4[_0x5a3e('0x28')]);if(_0xf24e4[_0x5a3e('0x29')]){delete _0xf24e4[_0x5a3e('0x29')];}_0x1e0c2a['status'](_0x42cae9)['send'](_0xf24e4);};}function getInteractionUsers(_0x143273,_0x12a0ce){return new BPromise(function(_0x5e4879,_0x3b4d42){try{if(_0x12a0ce[_0x143273['id']]){_0x143273['Users']=_['map'](_0x12a0ce[_0x143273['id']],function(_0x599d81){return{'id':_0x599d81['id'],'fullname':_0x599d81[_0x5a3e('0x2a')]};});}}catch(_0x2a8211){_0x3b4d42(_0x2a8211);}_0x5e4879(_0x143273);});}function getInteractionTags(_0x2c128f,_0x13cf88){return new BPromise(function(_0x1b9d84,_0x5de877){try{if(_0x2c128f[_0x5a3e('0x2b')]){_0x2c128f[_0x5a3e('0x2c')]=[];_0x2c128f[_0x5a3e('0x2b')][_0x5a3e('0x2d')](',')[_0x5a3e('0x2e')](function(_0x985c02){_0x2c128f['Tags'][_0x5a3e('0x2f')](_0x13cf88[_0x985c02]);});}delete _0x2c128f['TagIds'];}catch(_0xc52931){_0x5de877(_0xc52931);}_0x1b9d84(_0x2c128f);});}function updateOpenchannelInteraction(_0x55bacf,_0x40c2f6,_0x15fb27){return new BPromise(function(_0x5570cf,_0x5a0efc){return getInteractionUsers(_0x55bacf,_0x15fb27)[_0x5a3e('0x25')](function(_0x34660a){return getInteractionTags(_0x34660a,_0x40c2f6);})[_0x5a3e('0x25')](function(_0x3e353a){_0x5570cf(_0x3e353a);})[_0x5a3e('0x30')](function(_0x4383d8){_0x5a0efc(_0x4383d8);});});}exports['index']=function(_0x1857f4,_0x34c0ff){var _0x3210f1={},_0x525da5={},_0x39c24a={'count':0x0,'rows':[]};var _0x1d0ce9=_[_0x5a3e('0x31')](db[_0x5a3e('0x32')][_0x5a3e('0x33')],function(_0x3d357e){return{'name':_0x3d357e[_0x5a3e('0x34')],'type':_0x3d357e[_0x5a3e('0x35')][_0x5a3e('0x36')]};});_0x525da5['model']=_['map'](_0x1d0ce9,_0x5a3e('0x29'));_0x525da5[_0x5a3e('0x37')]=_[_0x5a3e('0x38')](_0x1857f4[_0x5a3e('0x37')]);_0x525da5[_0x5a3e('0x39')]=_[_0x5a3e('0x3a')](_0x525da5[_0x5a3e('0x3b')],_0x525da5[_0x5a3e('0x37')]);_0x3210f1['attributes']=_['intersection'](_0x525da5[_0x5a3e('0x3b')],qs[_0x5a3e('0x3c')](_0x1857f4['query'][_0x5a3e('0x3c')]));_0x3210f1[_0x5a3e('0x3d')]=_0x3210f1[_0x5a3e('0x3d')][_0x5a3e('0x3e')]?_0x3210f1[_0x5a3e('0x3d')]:_0x525da5[_0x5a3e('0x3b')];if(!_0x1857f4[_0x5a3e('0x37')][_0x5a3e('0x3f')](_0x5a3e('0x40'))){_0x3210f1[_0x5a3e('0x1f')]=qs[_0x5a3e('0x1f')](_0x1857f4[_0x5a3e('0x37')][_0x5a3e('0x1f')]);_0x3210f1[_0x5a3e('0x1d')]=qs[_0x5a3e('0x1d')](_0x1857f4[_0x5a3e('0x37')][_0x5a3e('0x1d')]);}_0x3210f1[_0x5a3e('0x41')]=qs[_0x5a3e('0x42')](_0x1857f4['query'][_0x5a3e('0x42')]);_0x3210f1[_0x5a3e('0x43')]=qs[_0x5a3e('0x39')](_[_0x5a3e('0x44')](_0x1857f4[_0x5a3e('0x37')],_0x525da5[_0x5a3e('0x39')]),_0x1d0ce9);var _0x58e7f0=[];var _0x4c771d=squel[_0x5a3e('0x45')]()[_0x5a3e('0x46')]('id')['field']('name')[_0x5a3e('0x46')]('color')[_0x5a3e('0x47')](_0x5a3e('0x48'));var _0x4e8ef3=squel[_0x5a3e('0x45')]()['field']('u.id')['field'](_0x5a3e('0x49'))[_0x5a3e('0x46')](_0x5a3e('0x4a'))[_0x5a3e('0x47')]('user_has_openchannel_interactions','ui')['left_join'](_0x5a3e('0x4b'),'u','u.id\x20=\x20ui.UserId');var _0xa3ba85=squel[_0x5a3e('0x45')]()[_0x5a3e('0x47')](_0x5a3e('0x4c'),'i')[_0x5a3e('0x4d')]('cm_contacts','c',_0x5a3e('0x4e'))[_0x5a3e('0x4d')]('users','o',_0x5a3e('0x4f'))[_0x5a3e('0x4d')](_0x5a3e('0x50'),'a',_0x5a3e('0x51'))[_0x5a3e('0x4d')](_0x5a3e('0x52'),'me',_0x5a3e('0x53'))[_0x5a3e('0x4d')](_0x5a3e('0x54'),'it',_0x5a3e('0x55'))[_0x5a3e('0x4d')]('tools_tags','t',_0x5a3e('0x56'));var _0x5eb561=squel['expr']();var _0x57bf75=[];var _0x16c7fe=squel['expr']();var _0xb630e5;if(_0x1857f4[_0x5a3e('0x37')][_0x5a3e('0x57')]){_0xb630e5=as[_0x5a3e('0x58')](_0x1857f4['query'][_0x5a3e('0x57')]);var _0x3ad528=_0xb630e5[_0x5a3e('0x59')];for(var _0x3ac8d9=0x0;_0x3ac8d9<_0xb630e5[_0x5a3e('0x5a')]['length'];_0x3ac8d9++){var _0x330e0f=_0xb630e5['conditions'][_0x3ac8d9];var _0x1e8c78='i';var _0x3582ec=_[_0x5a3e('0x5b')](_0x1d0ce9,['name',_0x330e0f[_0x5a3e('0x46')]]);if(!_0x3582ec){switch(_0x330e0f['field']){case'unreadMessages':if(_0x330e0f[_0x5a3e('0x5c')]==0x1){_0xa3ba85['having']('`'+_0x330e0f[_0x5a3e('0x46')]+'`\x20=\x200');}else{_0xa3ba85[_0x5a3e('0x5d')]('`'+_0x330e0f[_0x5a3e('0x46')]+_0x5a3e('0x5e'));}break;case _0x5a3e('0x5f'):if(_0x330e0f[_0x5a3e('0x60')]===_0x5a3e('0x61')){if(_0x330e0f['value'][_0x5a3e('0x2d')]('\x20')[_0x5a3e('0x3e')]>0x1){_0x5eb561[_0x3ad528](_0x5a3e('0x62'),qs[_0x5a3e('0x63')](_0x330e0f[_0x5a3e('0x5c')]),null);}else{var _0x48b9fc='%'+_0x330e0f[_0x5a3e('0x5c')]+'%';_0x5eb561[_0x3ad528](_0x5a3e('0x64'),_0x48b9fc,_0x48b9fc,_0x48b9fc);}}else{_0x3582ec=_[_0x5a3e('0x5b')](_0x1d0ce9,[_0x5a3e('0x29'),'ContactId']);_0x330e0f['field']='ContactId';_0x1ca5a1=as[_0x5a3e('0x65')](_0x1e8c78,_0x3582ec[_0x5a3e('0x35')],_0x330e0f);_0x5eb561[_0x3ad528](_0x1ca5a1[_0x5a3e('0x66')],_0x1ca5a1['value']['start'],_0x1ca5a1[_0x5a3e('0x5c')]['end']);}break;case _0x5a3e('0x67'):var _0x5ac68e=_0x330e0f[_0x5a3e('0x5c')][_0x5a3e('0x2d')](',')['map'](function(_0x1b9017){return Number(_0x1b9017);});_0x5ac68e[_0x5a3e('0x2e')](function(_0x1e1ced){_0x16c7fe['or'](_0x5a3e('0x68'),'%,'+_0x1e1ced+',%');});_0x57bf75=_[_0x5a3e('0x69')](_0x57bf75,_0x5ac68e);break;case _0x5a3e('0x6a'):if(_0x330e0f[_0x5a3e('0x60')]===_0x5a3e('0x61')){_0x5eb561[_0x3ad528](_0x5a3e('0x6b'),'%'+_0x330e0f[_0x5a3e('0x5c')]+'%',null);}else{_0x3582ec=_[_0x5a3e('0x5b')](_0x1d0ce9,[_0x5a3e('0x29'),_0x5a3e('0x6c')]);_0x330e0f['field']=_0x5a3e('0x6c');_0x1ca5a1=as[_0x5a3e('0x65')](_0x1e8c78,_0x3582ec[_0x5a3e('0x35')],_0x330e0f);_0x5eb561[_0x3ad528](_0x1ca5a1['text'],_0x1ca5a1[_0x5a3e('0x5c')][_0x5a3e('0x6d')],_0x1ca5a1[_0x5a3e('0x5c')][_0x5a3e('0x1b')]);}break;case _0x5a3e('0x6e'):_0x1ca5a1=as[_0x5a3e('0x65')]('me',null,_0x330e0f);_0x5eb561[_0x3ad528](_0x1ca5a1[_0x5a3e('0x66')],_0x1ca5a1[_0x5a3e('0x5c')][_0x5a3e('0x6d')],_0x1ca5a1[_0x5a3e('0x5c')][_0x5a3e('0x1b')]);break;}}else{var _0x1ca5a1=as[_0x5a3e('0x65')](_0x1e8c78,_0x3582ec[_0x5a3e('0x35')],_0x330e0f);_0x5eb561[_0x3ad528](_0x1ca5a1[_0x5a3e('0x66')],_0x1ca5a1[_0x5a3e('0x5c')][_0x5a3e('0x6d')],_0x1ca5a1[_0x5a3e('0x5c')][_0x5a3e('0x1b')]);}}}else{var _0x4925a3=_(_0x1857f4[_0x5a3e('0x37')])[_0x5a3e('0x38')]()[_0x5a3e('0x31')](function(_0x4fe9ea){return _[_0x5a3e('0x6f')](_0x1d0ce9,[_0x5a3e('0x29'),_0x4fe9ea])?_0x4fe9ea:undefined;})[_0x5a3e('0x70')]()['value']();if(!_[_0x5a3e('0x71')](_0x4925a3)){_0x4925a3[_0x5a3e('0x2e')](function(_0x108161){if(_0x108161===_0x5a3e('0x72')){_0xa3ba85['where']('i.OpenchannelAccountId\x20IN\x20?',[][_0x5a3e('0x73')](_0x1857f4[_0x5a3e('0x37')][_0x108161]));}else if(_0x108161===_0x5a3e('0x74')){var _0x35533c=JSON[_0x5a3e('0x75')](_0x1857f4['query'][_0x108161])[_0x5a3e('0x76')];var _0x4d2f0c=JSON[_0x5a3e('0x75')](_0x1857f4[_0x5a3e('0x37')][_0x108161])[_0x5a3e('0x77')];_0xa3ba85[_0x5a3e('0x43')](_0x5a3e('0x78'),_0x35533c,_0x4d2f0c);}else{if(_0x1857f4[_0x5a3e('0x37')][_0x108161]==='null'){_0xa3ba85[_0x5a3e('0x43')]('i.'+_0x108161+_0x5a3e('0x79'));}else{_0xa3ba85[_0x5a3e('0x43')]('i.'+_0x108161+_0x5a3e('0x7a'),_0x1857f4[_0x5a3e('0x37')][_0x108161]);}}});}if(_0x1857f4[_0x5a3e('0x37')][_0x5a3e('0x7b')]){if(_0x1857f4['query'][_0x5a3e('0x7b')]==0x1){_0xa3ba85[_0x5a3e('0x5d')](_0x5a3e('0x7c'));}else{_0xa3ba85['having'](_0x5a3e('0x7d'));}}if(_0x1857f4[_0x5a3e('0x37')][_0x5a3e('0x7e')]){_0x57bf75=_[_0x5a3e('0x7f')](_0x1857f4['query'][_0x5a3e('0x7e')])?_0x1857f4[_0x5a3e('0x37')]['tag']:new Array(_0x1857f4[_0x5a3e('0x37')][_0x5a3e('0x7e')]);_0x57bf75[_0x5a3e('0x2e')](function(_0x2bf07e){_0x16c7fe['or'](_0x5a3e('0x68'),'%,'+_0x2bf07e+',%');});}if(_0x1857f4[_0x5a3e('0x37')][_0x5a3e('0x80')]){var _0xa87a0c=_0x1857f4['query'][_0x5a3e('0x80')][_0x5a3e('0x81')]('\x5c','\x5c\x5c')[_0x5a3e('0x81')](/'/g,'\x27\x27');if(qs[_0x5a3e('0x82')](_0xa87a0c)){_0x5eb561['or'](_0x5a3e('0x83'),_0xa87a0c+'%');}else{_0x5eb561['or'](_0x5a3e('0x84'),qs[_0x5a3e('0x63')](_0xa87a0c))['or'](_0x5a3e('0x85'),_0xa87a0c+'%')['or'](_0x5a3e('0x86'),_0xa87a0c+'%');}}}_0xa3ba85[_0x5a3e('0x43')](_0x5eb561);_0xa3ba85[_0x5a3e('0x87')]('i.id');var _0x2586fe={'type':db[_0x5a3e('0x88')][_0x5a3e('0x89')]['SELECT'],'raw':!![]};var _0x332a7f=_0xa3ba85['clone']();_0x332a7f['field'](_0x5a3e('0x8a'));_0x332a7f['field'](_0x5a3e('0x8b'),_0x5a3e('0x8c'));if(_0x3210f1['order']){_0x3210f1['order'][_0x5a3e('0x2e')](function(_0xfb5a51){var _0xd749ff=_0xfb5a51[0x0]===_0x5a3e('0x8d')?_0xfb5a51[0x0]:'i.'+_0xfb5a51[0x0];_0xa3ba85['order'](_0xd749ff,_0xfb5a51[0x1]===_0x5a3e('0x8e')?![]:!![]);});}if(!_[_0x5a3e('0x71')](_0x57bf75)){_0xa3ba85[_0x5a3e('0x5d')](_0x16c7fe);_0x332a7f[_0x5a3e('0x43')](_0x5a3e('0x8f'),_0x57bf75);}BPromise[_0x5a3e('0x90')]()['then'](function(){if(!_0xb630e5){if(_0x1857f4[_0x5a3e('0x37')][_0x5a3e('0x72')])return;_0x332a7f[_0x5a3e('0x43')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');_0xa3ba85[_0x5a3e('0x43')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x1857f4[_0x5a3e('0x91')][_0x5a3e('0x92')]!==_0x5a3e('0x93'))return;return _0x1857f4[_0x5a3e('0x91')][_0x5a3e('0x94')]({'attributes':['id'],'raw':!![]})[_0x5a3e('0x25')](function(_0x3bf5d5){if(_[_0x5a3e('0x71')](_0x3bf5d5)){_0x332a7f[_0x5a3e('0x43')](_0x5a3e('0x95'));_0xa3ba85['where'](_0x5a3e('0x95'));}else{_0x332a7f[_0x5a3e('0x43')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x5a3e('0x31')](_0x3bf5d5,'id'));_0xa3ba85[_0x5a3e('0x43')](_0x5a3e('0x96'),_[_0x5a3e('0x31')](_0x3bf5d5,'id'));}});})[_0x5a3e('0x25')](function(){if(_0x1857f4[_0x5a3e('0x91')][_0x5a3e('0x92')]===_0x5a3e('0x93')&&!_0xb630e5&&!_0x1857f4['query'][_0x5a3e('0x72')])return[];return db['sequelize'][_0x5a3e('0x37')](_0x332a7f[_0x5a3e('0x97')](),_0x2586fe);})['then'](function(_0x3c827e){_0x39c24a[_0x5a3e('0x20')]=_0x3c827e['length'];if(_0x39c24a['count']===0x0)return[];return db[_0x5a3e('0x98')][_0x5a3e('0x37')](_0x4c771d[_0x5a3e('0x97')](),_0x2586fe)[_0x5a3e('0x25')](function(_0x35286c){_0x58e7f0=_[_0x5a3e('0x99')](_0x35286c,'id');_0x2586fe=_[_0x5a3e('0x9a')](_0x2586fe,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1857f4[_0x5a3e('0x37')]['fields']){_0x3210f1['attributes'][_0x5a3e('0x2e')](function(_0x310e54){_0xa3ba85[_0x5a3e('0x46')]('i.'+_0x310e54);});}else{_0xa3ba85['field'](_0x5a3e('0x8b'),_0x5a3e('0x8c'));_0xa3ba85[_0x5a3e('0x46')](_0x5a3e('0x9b'),_0x5a3e('0x9c'));_0xa3ba85[_0x5a3e('0x46')](_0x5a3e('0x9d'),_0x5a3e('0x9e'));_0xa3ba85[_0x5a3e('0x46')]('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',_0x5a3e('0x8d'));_0xa3ba85[_0x5a3e('0x46')](_0x5a3e('0x9f'));_0xa3ba85['field'](_0x5a3e('0xa0'),_0x5a3e('0xa1'));_0xa3ba85[_0x5a3e('0x46')](_0x5a3e('0xa2'),'Contact.lastName');_0xa3ba85['field']('c.email','Contact.email');_0xa3ba85['field'](_0x5a3e('0xa3'),_0x5a3e('0xa4'));_0xa3ba85[_0x5a3e('0x46')](_0x5a3e('0xa5'),_0x5a3e('0xa6'));_0xa3ba85['field']('c.fax',_0x5a3e('0xa7'));_0xa3ba85[_0x5a3e('0x46')](_0x5a3e('0xa8'),_0x5a3e('0xa9'));_0xa3ba85['field'](_0x5a3e('0xaa'),_0x5a3e('0xab'));_0xa3ba85['field'](_0x5a3e('0xac'),_0x5a3e('0x2b'));}if(_0x3210f1[_0x5a3e('0x1f')])_0xa3ba85[_0x5a3e('0x1f')](_0x3210f1[_0x5a3e('0x1f')]);if(_0x3210f1[_0x5a3e('0x1d')])_0xa3ba85[_0x5a3e('0x1d')](_0x3210f1[_0x5a3e('0x1d')]);return db[_0x5a3e('0x98')][_0x5a3e('0x37')](_0xa3ba85[_0x5a3e('0x97')](),_0x2586fe);})['then'](function(_0x436fb5){if(_0x436fb5[_0x5a3e('0x3e')]>0x0)_0x4e8ef3['where'](_0x5a3e('0xad'),_[_0x5a3e('0x31')](_0x436fb5,'id'));return db[_0x5a3e('0x98')]['query'](_0x4e8ef3[_0x5a3e('0x97')](),_0x2586fe)[_0x5a3e('0x25')](function(_0x257ca0){var _0x133b28=_[_0x5a3e('0xae')](_0x257ca0,_0x5a3e('0xaf'));var _0x4f10c5=[];_0x436fb5[_0x5a3e('0x2e')](function(_0x4709f9){_0x4f10c5[_0x5a3e('0x2f')](updateOpenchannelInteraction(_0x4709f9,_0x58e7f0,_0x133b28));});return BPromise[_0x5a3e('0xb0')](_0x4f10c5);});});})['then'](function(_0x3f55a7){_0x39c24a[_0x5a3e('0xb1')]=_0x3f55a7;return _0x39c24a;})[_0x5a3e('0x25')](respondWithFilteredResult(_0x34c0ff,_0x3210f1))[_0x5a3e('0x30')](handleError(_0x34c0ff,null));};exports[_0x5a3e('0xb2')]=function(_0x552879,_0x6bff64){var _0x3c0cda={};if(_0x552879[_0x5a3e('0x37')][_0x5a3e('0x35')]&&_0x552879[_0x5a3e('0x37')][_0x5a3e('0x35')]==='from'){_0x3c0cda[_0x5a3e('0x47')]=_0x552879[_0x5a3e('0xb3')]['id'];}else{_0x3c0cda['id']=_0x552879[_0x5a3e('0xb3')]['id'];}var _0x3645aa={'raw':![],'where':_0x3c0cda},_0x4840a4={};_0x4840a4['model']=_[_0x5a3e('0x38')](db[_0x5a3e('0x32')][_0x5a3e('0x33')]);_0x4840a4[_0x5a3e('0x37')]=_['keys'](_0x552879[_0x5a3e('0x37')]);_0x4840a4['filters']=_[_0x5a3e('0x3a')](_0x4840a4['model'],_0x4840a4[_0x5a3e('0x37')]);_0x3645aa[_0x5a3e('0x3d')]=_['intersection'](_0x4840a4[_0x5a3e('0x3b')],qs[_0x5a3e('0x3c')](_0x552879[_0x5a3e('0x37')]['fields']));_0x3645aa['attributes']=_0x3645aa[_0x5a3e('0x3d')][_0x5a3e('0x3e')]?_0x3645aa['attributes']:_0x4840a4[_0x5a3e('0x3b')];if(_0x552879[_0x5a3e('0x37')][_0x5a3e('0xb4')]){_0x3645aa[_0x5a3e('0xb5')]=[{'all':!![]}];}_0x3645aa=_[_0x5a3e('0x9a')]({},_0x3645aa,_0x552879['options']);return db['OpenchannelInteraction'][_0x5a3e('0x5b')](_0x3645aa)[_0x5a3e('0x25')](handleEntityNotFound(_0x6bff64,null))[_0x5a3e('0x25')](respondWithResult(_0x6bff64,null))['catch'](handleError(_0x6bff64,null));};exports[_0x5a3e('0xb6')]=function(_0x5d7db,_0x17a376){return db[_0x5a3e('0x32')][_0x5a3e('0xb6')](_0x5d7db['body'],{})['then'](respondWithResult(_0x17a376,0xc9))[_0x5a3e('0x30')](handleError(_0x17a376,null));};exports['update']=function(_0x3d12da,_0x535486){if(_0x3d12da['body']['id']){delete _0x3d12da['body']['id'];}return db['OpenchannelInteraction'][_0x5a3e('0x5b')]({'where':{'id':_0x3d12da[_0x5a3e('0xb3')]['id']}})[_0x5a3e('0x25')](handleEntityNotFound(_0x535486,null))[_0x5a3e('0x25')](saveUpdates(_0x3d12da[_0x5a3e('0x6e')],null))[_0x5a3e('0x25')](respondWithResult(_0x535486,null))['catch'](handleError(_0x535486,null));};exports[_0x5a3e('0x26')]=function(_0x5ad313,_0x35c681){return db[_0x5a3e('0x32')][_0x5a3e('0x5b')]({'where':{'id':_0x5ad313[_0x5a3e('0xb3')]['id']}})[_0x5a3e('0x25')](handleEntityNotFound(_0x35c681,null))['then'](removeEntity(_0x35c681,null))[_0x5a3e('0x30')](handleError(_0x35c681,null));};exports[_0x5a3e('0xb7')]=function(_0x18b1b1,_0x53d21e){return db[_0x5a3e('0x32')][_0x5a3e('0xb7')]()['then'](respondWithResult(_0x53d21e,null))[_0x5a3e('0x30')](handleError(_0x53d21e,null));};exports[_0x5a3e('0xb8')]=function(_0x4d1866,_0x56a2a5,_0x512e68){return db[_0x5a3e('0xb9')][_0x5a3e('0x5b')]({'where':{'id':_0x4d1866[_0x5a3e('0xb3')]['id']}})[_0x5a3e('0x25')](handleEntityNotFound(_0x56a2a5,null))['then'](function(_0x12ec41){if(_0x12ec41){return _0x12ec41['addMessage'](_0x4d1866['body'][_0x5a3e('0xba')],_['omit'](_0x4d1866[_0x5a3e('0x6e')],[_0x5a3e('0xba'),'id'])||{});}})[_0x5a3e('0x25')](respondWithResult(_0x56a2a5,null))[_0x5a3e('0x30')](handleError(_0x56a2a5,null));};exports[_0x5a3e('0xbb')]=function(_0x2c71fc,_0x4b1fa5,_0x32493b){var _0x3bbfee={'raw':![],'where':{}};var _0x246458={};var _0x275e95={'count':0x0,'rows':[]};return db[_0x5a3e('0x32')]['findOne']({'where':{'id':_0x2c71fc[_0x5a3e('0xb3')]['id']}})['then'](handleEntityNotFound(_0x4b1fa5,null))[_0x5a3e('0x25')](function(_0x372771){if(_0x372771){_0x246458[_0x5a3e('0x3b')]=_['keys'](db[_0x5a3e('0xb9')]['rawAttributes']);_0x246458[_0x5a3e('0x37')]=_['keys'](_0x2c71fc['query']);_0x246458[_0x5a3e('0x39')]=_[_0x5a3e('0x3a')](_0x246458['model'],_0x246458[_0x5a3e('0x37')]);_0x3bbfee[_0x5a3e('0x3d')]=_['intersection'](_0x246458[_0x5a3e('0x3b')],qs[_0x5a3e('0x3c')](_0x2c71fc[_0x5a3e('0x37')][_0x5a3e('0x3c')]));_0x3bbfee['attributes']=_0x3bbfee[_0x5a3e('0x3d')][_0x5a3e('0x3e')]?_0x3bbfee[_0x5a3e('0x3d')]:_0x246458[_0x5a3e('0x3b')];if(!_0x2c71fc[_0x5a3e('0x37')][_0x5a3e('0x3f')](_0x5a3e('0x40'))){_0x3bbfee[_0x5a3e('0x1f')]=qs[_0x5a3e('0x1f')](_0x2c71fc[_0x5a3e('0x37')][_0x5a3e('0x1f')]);_0x3bbfee[_0x5a3e('0x1d')]=qs['offset'](_0x2c71fc['query']['offset']);}_0x3bbfee[_0x5a3e('0x41')]=qs[_0x5a3e('0x42')](_0x2c71fc[_0x5a3e('0x37')][_0x5a3e('0x42')]);_0x3bbfee[_0x5a3e('0x43')]=qs[_0x5a3e('0x39')](_['pick'](_0x2c71fc[_0x5a3e('0x37')],_0x246458['filters']));_0x3bbfee[_0x5a3e('0x43')]['OpenchannelInteractionId']=_0x372771['id'];if(_0x2c71fc[_0x5a3e('0x37')]['filter']){_0x3bbfee[_0x5a3e('0x43')]=_[_0x5a3e('0x9a')](_0x3bbfee[_0x5a3e('0x43')],{'$or':_[_0x5a3e('0x31')](_0x3bbfee[_0x5a3e('0x3d')],function(_0x46bc8e){var _0x187c19={};_0x187c19[_0x46bc8e]={'$like':'%'+_0x2c71fc[_0x5a3e('0x37')][_0x5a3e('0x80')]+'%'};return _0x187c19;})});}if(_0x2c71fc['query']['$gte']){var _0x10b1f0=_0x2c71fc['query']['$gte']['split'](',');var _0x1d763a={};_0x1d763a[_0x10b1f0[0x0]]={'$gte':moment(_0x10b1f0[0x1])[_0x5a3e('0xbc')]('YYYY-MM-DD\x20HH:mm:ss')};_0x3bbfee['where']=_[_0x5a3e('0x9a')](_0x3bbfee['where'],_0x1d763a);}_0x3bbfee=_[_0x5a3e('0x9a')]({},_0x3bbfee,_0x2c71fc[_0x5a3e('0xbd')]);return db[_0x5a3e('0xb9')]['count']({'where':_0x3bbfee['where']})[_0x5a3e('0x25')](function(_0x5d1391){_0x275e95[_0x5a3e('0x20')]=_0x5d1391;if(_0x2c71fc['query']['includeAll']){_0x3bbfee[_0x5a3e('0xb5')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x5a3e('0xbe')](_0x3bbfee);})[_0x5a3e('0x25')](function(_0x29645a){_0x275e95['rows']=_0x29645a;return _0x275e95;});}})[_0x5a3e('0x25')](respondWithFilteredResult(_0x4b1fa5,_0x3bbfee))[_0x5a3e('0x30')](handleError(_0x4b1fa5,null));};exports[_0x5a3e('0xbf')]=function(_0x182d73,_0x56df00,_0x47b03e){return db[_0x5a3e('0x32')][_0x5a3e('0x5b')]({'where':{'id':_0x182d73['params']['id']}})['then'](handleEntityNotFound(_0x56df00,null))[_0x5a3e('0x25')](function(_0xe75b6f){if(_0xe75b6f){return _0xe75b6f[_0x5a3e('0xc0')](_0x182d73[_0x5a3e('0x6e')]['ids'],_[_0x5a3e('0xc1')](_0x182d73[_0x5a3e('0x6e')],[_0x5a3e('0xba'),'id'])||{})[_0x5a3e('0xc2')](function(){return db[_0x5a3e('0x67')][_0x5a3e('0xbe')]({'attributes':['id',_0x5a3e('0x29'),_0x5a3e('0xc3')],'where':{'id':_0x182d73['body']['ids']}});})['then'](function(_0x342aa0){socket['emit'](_0x5a3e('0xc4'),{'id':Number(_0x182d73[_0x5a3e('0xb3')]['id']),'tags':_0x342aa0||[]});return{'id':Number(_0x182d73[_0x5a3e('0xb3')]['id']),'tags':_0x342aa0||[]};});}})[_0x5a3e('0x25')](respondWithResult(_0x56df00,null))[_0x5a3e('0x30')](handleError(_0x56df00,null));};exports[_0x5a3e('0xc5')]=function(_0x373e6a,_0x4a9c49,_0x33a948){return db[_0x5a3e('0x32')][_0x5a3e('0x5b')]({'where':{'id':_0x373e6a[_0x5a3e('0xb3')]['id']}})[_0x5a3e('0x25')](handleEntityNotFound(_0x4a9c49,null))[_0x5a3e('0x25')](function(_0x507695){if(_0x507695){return _0x507695[_0x5a3e('0xc5')](_0x373e6a['query'][_0x5a3e('0xba')]);}})[_0x5a3e('0x25')](respondWithStatusCode(_0x4a9c49,null))[_0x5a3e('0x30')](handleError(_0x4a9c49,null));};exports['download']=function(_0x22ac10,_0x4fc971){var _0x408f1a=moment()[_0x5a3e('0xc6')]()[_0x5a3e('0x97')]();var _0x4db313=path[_0x5a3e('0xc7')](config[_0x5a3e('0xc8')],'server',_0x5a3e('0xc9'),_0x5a3e('0xca'));var _0x363d6f=path[_0x5a3e('0xc7')](config[_0x5a3e('0xc8')],_0x5a3e('0xcb'),'files',_0x5a3e('0xcc'));var _0x42906e=path[_0x5a3e('0xc7')](_0x4db313,_0x408f1a);var _0x414b2f=util[_0x5a3e('0xbc')]('transcript-%d-%s.zip',_0x22ac10['params']['id'],_0x408f1a);var _0x2a1c2f=path['join'](_0x4db313,_0x414b2f);var _0x5702cb=[];_0x5702cb[_0x5a3e('0x2f')]({'model':db[_0x5a3e('0x6a')],'as':_0x5a3e('0x6a'),'attributes':['id',_0x5a3e('0x2a')],'raw':!![]});_0x5702cb['push']({'model':db['CmContact'],'as':_0x5a3e('0x5f'),'attributes':['id','firstName',_0x5a3e('0xcd')],'raw':!![]});if(_0x22ac10['query'][_0x5a3e('0xcc')]){_0x5702cb[_0x5a3e('0x2f')]({'model':db['Attachment'],'as':_0x5a3e('0xce'),'raw':!![]});}var _0x2a571a=[{'model':db[_0x5a3e('0xb9')],'as':_0x5a3e('0xcf'),'attributes':['id',_0x5a3e('0x6e'),'createdAt',_0x5a3e('0xd0'),_0x5a3e('0xd1'),_0x5a3e('0x7b')],'include':_0x5702cb}];_0x2a571a['push']({'model':db[_0x5a3e('0xd2')],'as':_0x5a3e('0xd3'),'attributes':['id',_0x5a3e('0x29')]});_0x2a571a[_0x5a3e('0x2f')]({'model':db[_0x5a3e('0x6a')],'as':_0x5a3e('0xd4'),'attributes':['id',_0x5a3e('0x2a')]});return db[_0x5a3e('0x32')][_0x5a3e('0x5b')]({'where':{'id':_0x22ac10[_0x5a3e('0xb3')]['id']},'include':_0x2a571a})[_0x5a3e('0x25')](handleEntityNotFound(_0x4fc971,null))[_0x5a3e('0x25')](function(_0x536cb7){if(_0x536cb7){var _0x29a58=_0x536cb7[_0x5a3e('0xd5')]({'plain':!![]});fs['mkdirSync'](_0x42906e);var _0x4a51cd={'channel':_0x5a3e('0xd6'),'account':_0x29a58[_0x5a3e('0xd3')][_0x5a3e('0x29')],'agent':_0x29a58['Owner']?_0x29a58[_0x5a3e('0xd4')][_0x5a3e('0x2a')]:_0x5a3e('0xd7'),'createdAt':moment(_0x29a58[_0x5a3e('0x74')])[_0x5a3e('0xbc')]('YYYY-MM-DD\x20HH:mm:ss')[_0x5a3e('0x97')](),'closedAt':_0x29a58['closed']?moment(_0x29a58[_0x5a3e('0xd8')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x5a3e('0x97')]():'','disposition':_0x29a58[_0x5a3e('0xd9')],'visibility':_0x29a58[_0x5a3e('0xda')]?_0x5a3e('0xdb'):_0x5a3e('0xdc'),'messages':_(_0x29a58[_0x5a3e('0xcf')])[_0x5a3e('0x80')]({'secret':![]})[_0x5a3e('0x31')](function(_0x899a65){if(_0x899a65[_0x5a3e('0xce')]){var _0x4ea106=path[_0x5a3e('0xc7')](_0x363d6f,_0x899a65['Attachment'][_0x5a3e('0xdd')]);if(fs['existsSync'](_0x4ea106)){fs[_0x5a3e('0xde')](_0x4ea106)['pipe'](fs[_0x5a3e('0xdf')](path[_0x5a3e('0xc7')](_0x42906e,_0x899a65[_0x5a3e('0xce')]['basename'])));}}return{'date':moment(_0x899a65[_0x5a3e('0x74')])[_0x5a3e('0xbc')](_0x5a3e('0xe0'))['toString'](),'sender':_0x899a65['direction']===_0x5a3e('0xe1')?_0x899a65['User']?_0x899a65[_0x5a3e('0x6a')][_0x5a3e('0x2a')]:_0x5a3e('0xe2'):_0x899a65[_0x5a3e('0x5f')][_0x5a3e('0xe3')]+(_0x899a65[_0x5a3e('0x5f')][_0x5a3e('0xcd')]?'\x20'+_0x899a65[_0x5a3e('0x5f')][_0x5a3e('0xcd')]:''),'body':_0x899a65['Attachment']?_0x899a65[_0x5a3e('0xce')][_0x5a3e('0xdd')]:_0x899a65[_0x5a3e('0x6e')],'direction':_0x899a65[_0x5a3e('0xd0')]==='out'?'A':'C','secret':_0x899a65[_0x5a3e('0xd1')],'read':_0x899a65[_0x5a3e('0x7b')],'attachment':_0x899a65[_0x5a3e('0xce')]};})[_0x5a3e('0x5c')]()};return ejs[_0x5a3e('0xe4')](path[_0x5a3e('0xc7')](config['root'],_0x5a3e('0xcb'),'views',_0x5a3e('0xe5')),{'interaction':_0x4a51cd})[_0x5a3e('0x25')](function(_0x1a9377){var _0x48c445=path['join'](_0x42906e,_0x5a3e('0xe6')+_0x29a58['id']+'-'+_0x408f1a+_0x5a3e('0xe7'));var _0xe3da17={'path':_0x48c445,'channel':_0x5a3e('0xd6'),'interactionId':_0x29a58['id']};return pdf[_0x5a3e('0xe8')](_0x1a9377,_0xe3da17);})[_0x5a3e('0x25')](function(){return new BPromise(function(_0x144465,_0x4837fc){zipdir(_0x42906e,{'saveTo':_0x2a1c2f},function(_0xe3ecb3,_0x52bbf1){if(_0xe3ecb3)return _0x4837fc(_0xe3ecb3);return _0x144465(_0x52bbf1);});})[_0x5a3e('0x25')](function(){return new BPromise(function(_0x1e7f98,_0x3f1c9c){rimraf(_0x42906e,function(_0x4ffde6){if(_0x4ffde6)_0x3f1c9c(_0x4ffde6);return _0x1e7f98();});});})[_0x5a3e('0x25')](function(){return _0x4fc971[_0x5a3e('0xe9')](_0x2a1c2f,_0x414b2f,function(_0x51d083){if(_0x51d083){console[_0x5a3e('0xea')](_0x5a3e('0xeb'),_0x51d083);}else{fs[_0x5a3e('0xec')](_0x2a1c2f);}});});});}else{return _0x4fc971['sendStatus'](0xc8);}})['catch'](handleError(_0x4fc971,null));};
\ No newline at end of file
+var _0x6859=['sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','destroy','then','error','name','send','TagIds','Tags','forEach','catch','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','limit','order','sort','pick','select','field','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','length','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','type','text','start','Tag','UserId','body','some','compact','isEmpty','where','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','clone','contactName','DESC','t.id\x20IN\x20?','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','agent','sequelize','toString','keyBy','merge','OpenchannelInteraction','a.key','Account.key','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','OpenchannelInteractionId','push','all','rows','show','params','includeAll','options','create','describe','addMessage','ids','omit','getMessages','findOne','nolimit','YYYY-MM-DD\x20HH:mm:ss','OpenchannelMessage','include','findAll','addTags','setTags','spread','color','emit','openchannelInteractionTags:save','removeTags','unix','join','root','files','tmp','attachments','format','transcript-%d-%s.zip','User','fullname','Contact','lastName','Attachment','direction','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','closed','closedAt','disposition','Public','Private','createReadStream','createWriteStream','out','System','basename','secret','renderFile','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','err','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket'];(function(_0x2baeac,_0x5ac1c5){var _0xfaa91f=function(_0x1d5e3f){while(--_0x1d5e3f){_0x2baeac['push'](_0x2baeac['shift']());}};_0xfaa91f(++_0x5ac1c5);}(_0x6859,0x1b8));var _0x9685=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x6859[_0x1cb18a];return _0x22442e;};'use strict';var emlformat=require(_0x9685('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9685('0x1'));var jsonpatch=require(_0x9685('0x2'));var rp=require('request-promise');var moment=require(_0x9685('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x9685('0x4'));var util=require(_0x9685('0x5'));var path=require(_0x9685('0x6'));var sox=require(_0x9685('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9685('0x8'));var squel=require(_0x9685('0x9'));var crypto=require('crypto');var jsforce=require(_0x9685('0xa'));var deskjs=require(_0x9685('0xb'));var toCsv=require(_0x9685('0xc'));var querystring=require(_0x9685('0xd'));var Papa=require('papaparse');var Redis=require(_0x9685('0xe'));var authService=require(_0x9685('0xf'));var qs=require(_0x9685('0x10'));var as=require(_0x9685('0x11'));var pdf=require(_0x9685('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9685('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x9685('0x14'));var licenseUtil=require(_0x9685('0x15'));var db=require(_0x9685('0x16'))['db'];config[_0x9685('0x17')]=_[_0x9685('0x18')](config['redis'],{'host':_0x9685('0x19'),'port':0x18eb});var socket=require(_0x9685('0x1a'))(new Redis(config[_0x9685('0x17')]));require(_0x9685('0x1b'))['register'](socket);function respondWithStatusCode(_0xa6cf3a,_0x3805b1){_0x3805b1=_0x3805b1||0xcc;return function(_0x3450d8){if(_0x3450d8){return _0xa6cf3a[_0x9685('0x1c')](_0x3805b1);}return _0xa6cf3a[_0x9685('0x1d')](_0x3805b1)[_0x9685('0x1e')]();};}function respondWithResult(_0xe51382,_0x45b6a8){_0x45b6a8=_0x45b6a8||0xc8;return function(_0x4aaacc){if(_0x4aaacc){return _0xe51382[_0x9685('0x1d')](_0x45b6a8)[_0x9685('0x1f')](_0x4aaacc);}};}function respondWithFilteredResult(_0x224325,_0x332ecd){return function(_0x5deefd){if(_0x5deefd){var _0x5bb0ac=typeof _0x332ecd[_0x9685('0x20')]==='undefined'&&typeof _0x332ecd['limit']===_0x9685('0x21');var _0x6ec77d=_0x5deefd[_0x9685('0x22')];var _0x5842f9=_0x5bb0ac?0x0:_0x332ecd[_0x9685('0x20')];var _0x2a55ca=_0x5bb0ac?_0x5deefd[_0x9685('0x22')]:_0x332ecd[_0x9685('0x20')]+_0x332ecd['limit'];var _0x10b5e3;if(_0x2a55ca>=_0x6ec77d){_0x2a55ca=_0x6ec77d;_0x10b5e3=0xc8;}else{_0x10b5e3=0xce;}_0x224325[_0x9685('0x1d')](_0x10b5e3);return _0x224325[_0x9685('0x23')](_0x9685('0x24'),_0x5842f9+'-'+_0x2a55ca+'/'+_0x6ec77d)[_0x9685('0x1f')](_0x5deefd);}return null;};}function patchUpdates(_0x8a1496){return function(_0x4c7922){try{jsonpatch[_0x9685('0x25')](_0x4c7922,_0x8a1496,!![]);}catch(_0x5cf783){return BPromise[_0x9685('0x26')](_0x5cf783);}return _0x4c7922['save']();};}function saveUpdates(_0xae4a25,_0x12e96a){return function(_0x266be5){if(_0x266be5){return _0x266be5[_0x9685('0x27')](_0xae4a25)['then'](function(_0x34cfad){return _0x34cfad;});}return null;};}function removeEntity(_0x23f836,_0x167f9e){return function(_0x2f44ea){if(_0x2f44ea){return _0x2f44ea[_0x9685('0x28')]()[_0x9685('0x29')](function(){_0x23f836[_0x9685('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x160363,_0x5d89e5){return function(_0x475f86){if(!_0x475f86){_0x160363[_0x9685('0x1c')](0x194);}return _0x475f86;};}function handleError(_0x2f4468,_0x5cabaa){_0x5cabaa=_0x5cabaa||0x1f4;return function(_0x2531aa){logger[_0x9685('0x2a')](_0x2531aa['stack']);if(_0x2531aa[_0x9685('0x2b')]){delete _0x2531aa[_0x9685('0x2b')];}_0x2f4468[_0x9685('0x1d')](_0x5cabaa)[_0x9685('0x2c')](_0x2531aa);};}function getInteractionUsers(_0x2b68ce,_0x431231){return new BPromise(function(_0x3fd8df,_0x2e9ea8){try{if(_0x431231[_0x2b68ce['id']]){_0x2b68ce['Users']=_['map'](_0x431231[_0x2b68ce['id']],function(_0xe00029){return{'id':_0xe00029['id'],'fullname':_0xe00029['fullname']};});}}catch(_0x2b0f98){_0x2e9ea8(_0x2b0f98);}_0x3fd8df(_0x2b68ce);});}function getInteractionTags(_0x4a814d,_0x3b6c80){return new BPromise(function(_0x5b5a20,_0x277da5){try{if(_0x4a814d[_0x9685('0x2d')]){_0x4a814d[_0x9685('0x2e')]=[];_0x4a814d[_0x9685('0x2d')]['split'](',')[_0x9685('0x2f')](function(_0x102a3b){_0x4a814d[_0x9685('0x2e')]['push'](_0x3b6c80[_0x102a3b]);});}delete _0x4a814d[_0x9685('0x2d')];}catch(_0x3eaa16){_0x277da5(_0x3eaa16);}_0x5b5a20(_0x4a814d);});}function updateOpenchannelInteraction(_0x2d3394,_0x47b673,_0x15720e){return new BPromise(function(_0x93d3b9,_0x5433fe){return getInteractionUsers(_0x2d3394,_0x15720e)[_0x9685('0x29')](function(_0x9888be){return getInteractionTags(_0x9888be,_0x47b673);})[_0x9685('0x29')](function(_0x1af97a){_0x93d3b9(_0x1af97a);})[_0x9685('0x30')](function(_0x432ab4){_0x5433fe(_0x432ab4);});});}exports['index']=function(_0x3ba8ac,_0x1d74ab){var _0x3a9524={},_0x5c713c={},_0x59f94c={'count':0x0,'rows':[]};var _0x34bbb6=_[_0x9685('0x31')](db['OpenchannelInteraction'][_0x9685('0x32')],function(_0x3cda67){return{'name':_0x3cda67[_0x9685('0x33')],'type':_0x3cda67['type'][_0x9685('0x34')]};});_0x5c713c[_0x9685('0x35')]=_[_0x9685('0x31')](_0x34bbb6,_0x9685('0x2b'));_0x5c713c[_0x9685('0x36')]=_[_0x9685('0x37')](_0x3ba8ac[_0x9685('0x36')]);_0x5c713c[_0x9685('0x38')]=_['intersection'](_0x5c713c['model'],_0x5c713c[_0x9685('0x36')]);_0x3a9524['attributes']=_[_0x9685('0x39')](_0x5c713c[_0x9685('0x35')],qs[_0x9685('0x3a')](_0x3ba8ac[_0x9685('0x36')][_0x9685('0x3a')]));_0x3a9524['attributes']=_0x3a9524[_0x9685('0x3b')]['length']?_0x3a9524['attributes']:_0x5c713c[_0x9685('0x35')];if(!_0x3ba8ac[_0x9685('0x36')][_0x9685('0x3c')]('nolimit')){_0x3a9524['limit']=qs['limit'](_0x3ba8ac[_0x9685('0x36')][_0x9685('0x3d')]);_0x3a9524[_0x9685('0x20')]=qs['offset'](_0x3ba8ac[_0x9685('0x36')][_0x9685('0x20')]);}_0x3a9524[_0x9685('0x3e')]=qs['sort'](_0x3ba8ac[_0x9685('0x36')][_0x9685('0x3f')]);_0x3a9524['where']=qs['filters'](_[_0x9685('0x40')](_0x3ba8ac[_0x9685('0x36')],_0x5c713c[_0x9685('0x38')]),_0x34bbb6);var _0xf3765c=[];var _0x3ac286=squel[_0x9685('0x41')]()[_0x9685('0x42')]('id')[_0x9685('0x42')](_0x9685('0x2b'))['field']('color')[_0x9685('0x43')](_0x9685('0x44'));var _0x4e6c55=squel[_0x9685('0x41')]()[_0x9685('0x42')](_0x9685('0x45'))[_0x9685('0x42')](_0x9685('0x46'))['field'](_0x9685('0x47'))[_0x9685('0x43')](_0x9685('0x48'),'ui')[_0x9685('0x49')](_0x9685('0x4a'),'u',_0x9685('0x4b'));var _0x48b899=squel[_0x9685('0x41')]()[_0x9685('0x43')](_0x9685('0x4c'),'i')[_0x9685('0x49')](_0x9685('0x4d'),'c',_0x9685('0x4e'))['left_join'](_0x9685('0x4a'),'o','o.id\x20=\x20i.UserId')[_0x9685('0x49')](_0x9685('0x4f'),'a',_0x9685('0x50'))[_0x9685('0x49')](_0x9685('0x51'),'me',_0x9685('0x52'))[_0x9685('0x49')](_0x9685('0x53'),'it',_0x9685('0x54'))['left_join']('tools_tags','t',_0x9685('0x55'));var _0x5441a3=squel[_0x9685('0x56')]();var _0x163d46=[];var _0x3f8ed0=squel[_0x9685('0x56')]();var _0x26c0d2;if(_0x3ba8ac[_0x9685('0x36')][_0x9685('0x57')]){_0x26c0d2=as[_0x9685('0x58')](_0x3ba8ac[_0x9685('0x36')][_0x9685('0x57')]);var _0x278060=_0x26c0d2[_0x9685('0x59')];for(var _0x59fd0c=0x0;_0x59fd0c<_0x26c0d2['conditions'][_0x9685('0x5a')];_0x59fd0c++){var _0x19ecc7=_0x26c0d2[_0x9685('0x5b')][_0x59fd0c];var _0x2fcd23='i';var _0x27e563=_[_0x9685('0x5c')](_0x34bbb6,[_0x9685('0x2b'),_0x19ecc7['field']]);if(!_0x27e563){switch(_0x19ecc7[_0x9685('0x42')]){case _0x9685('0x5d'):if(_0x19ecc7[_0x9685('0x5e')]==0x1){_0x48b899[_0x9685('0x5f')]('`'+_0x19ecc7[_0x9685('0x42')]+_0x9685('0x60'));}else{_0x48b899[_0x9685('0x5f')]('`'+_0x19ecc7[_0x9685('0x42')]+_0x9685('0x61'));}break;case'Contact':if(_0x19ecc7[_0x9685('0x62')]===_0x9685('0x63')){if(_0x19ecc7[_0x9685('0x5e')][_0x9685('0x64')]('\x20')[_0x9685('0x5a')]>0x1){_0x5441a3[_0x278060](_0x9685('0x65'),qs[_0x9685('0x66')](_0x19ecc7[_0x9685('0x5e')]),null);}else{var _0x55006a='%'+_0x19ecc7['value']+'%';_0x5441a3[_0x278060]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x55006a,_0x55006a,_0x55006a);}}else{_0x27e563=_[_0x9685('0x5c')](_0x34bbb6,[_0x9685('0x2b'),_0x9685('0x67')]);_0x19ecc7[_0x9685('0x42')]='ContactId';_0xf251f=as[_0x9685('0x68')](_0x2fcd23,_0x27e563[_0x9685('0x69')],_0x19ecc7);_0x5441a3[_0x278060](_0xf251f[_0x9685('0x6a')],_0xf251f[_0x9685('0x5e')][_0x9685('0x6b')],_0xf251f['value'][_0x9685('0x1e')]);}break;case _0x9685('0x6c'):var _0x3b3d5f=_0x19ecc7[_0x9685('0x5e')][_0x9685('0x64')](',')['map'](function(_0x1f77b1){return Number(_0x1f77b1);});_0x3b3d5f[_0x9685('0x2f')](function(_0x49cfeb){_0x3f8ed0['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x49cfeb+',%');});_0x163d46=_['union'](_0x163d46,_0x3b3d5f);break;case'User':if(_0x19ecc7[_0x9685('0x62')]===_0x9685('0x63')){_0x5441a3[_0x278060]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x19ecc7[_0x9685('0x5e')]+'%',null);}else{_0x27e563=_[_0x9685('0x5c')](_0x34bbb6,[_0x9685('0x2b'),_0x9685('0x6d')]);_0x19ecc7[_0x9685('0x42')]=_0x9685('0x6d');_0xf251f=as[_0x9685('0x68')](_0x2fcd23,_0x27e563[_0x9685('0x69')],_0x19ecc7);_0x5441a3[_0x278060](_0xf251f[_0x9685('0x6a')],_0xf251f[_0x9685('0x5e')]['start'],_0xf251f['value']['end']);}break;case _0x9685('0x6e'):_0xf251f=as[_0x9685('0x68')]('me',null,_0x19ecc7);_0x5441a3[_0x278060](_0xf251f[_0x9685('0x6a')],_0xf251f['value'][_0x9685('0x6b')],_0xf251f[_0x9685('0x5e')]['end']);break;}}else{var _0xf251f=as[_0x9685('0x68')](_0x2fcd23,_0x27e563[_0x9685('0x69')],_0x19ecc7);_0x5441a3[_0x278060](_0xf251f['text'],_0xf251f[_0x9685('0x5e')]['start'],_0xf251f['value'][_0x9685('0x1e')]);}}}else{var _0x495fd2=_(_0x3ba8ac[_0x9685('0x36')])[_0x9685('0x37')]()['map'](function(_0x42cbc1){return _[_0x9685('0x6f')](_0x34bbb6,[_0x9685('0x2b'),_0x42cbc1])?_0x42cbc1:undefined;})[_0x9685('0x70')]()['value']();if(!_[_0x9685('0x71')](_0x495fd2)){_0x495fd2[_0x9685('0x2f')](function(_0x25e3fc){if(_0x25e3fc==='OpenchannelAccountId'){_0x48b899[_0x9685('0x72')]('i.OpenchannelAccountId\x20IN\x20?',[][_0x9685('0x73')](_0x3ba8ac['query'][_0x25e3fc]));}else if(_0x25e3fc===_0x9685('0x74')){var _0x2f7233=JSON[_0x9685('0x75')](_0x3ba8ac[_0x9685('0x36')][_0x25e3fc])[_0x9685('0x76')];var _0x48f507=JSON[_0x9685('0x75')](_0x3ba8ac['query'][_0x25e3fc])[_0x9685('0x77')];_0x48b899['where'](_0x9685('0x78'),_0x2f7233,_0x48f507);}else{if(_0x3ba8ac['query'][_0x25e3fc]===_0x9685('0x79')){_0x48b899[_0x9685('0x72')]('i.'+_0x25e3fc+'\x20IS\x20NULL');}else{_0x48b899[_0x9685('0x72')]('i.'+_0x25e3fc+'\x20=\x20?',_0x3ba8ac[_0x9685('0x36')][_0x25e3fc]);}}});}if(_0x3ba8ac[_0x9685('0x36')][_0x9685('0x7a')]){if(_0x3ba8ac[_0x9685('0x36')][_0x9685('0x7a')]==0x1){_0x48b899[_0x9685('0x5f')]('`unreadMessages`\x20=\x200');}else{_0x48b899['having'](_0x9685('0x7b'));}}if(_0x3ba8ac[_0x9685('0x36')][_0x9685('0x7c')]){_0x163d46=_[_0x9685('0x7d')](_0x3ba8ac[_0x9685('0x36')]['tag'])?_0x3ba8ac['query'][_0x9685('0x7c')]:new Array(_0x3ba8ac[_0x9685('0x36')]['tag']);_0x163d46[_0x9685('0x2f')](function(_0x270609){_0x3f8ed0['or'](_0x9685('0x7e'),'%,'+_0x270609+',%');});}if(_0x3ba8ac[_0x9685('0x36')][_0x9685('0x7f')]){var _0x4d2c73=_0x3ba8ac[_0x9685('0x36')]['filter'][_0x9685('0x80')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x4d2c73)){_0x5441a3['or'](_0x9685('0x81'),_0x4d2c73+'%');}else{_0x5441a3['or'](_0x9685('0x82'),qs[_0x9685('0x66')](_0x4d2c73))['or'](_0x9685('0x83'),_0x4d2c73+'%')['or'](_0x9685('0x84'),_0x4d2c73+'%');}}}_0x48b899[_0x9685('0x72')](_0x5441a3);_0x48b899[_0x9685('0x85')](_0x9685('0x86'));var _0x10569a={'type':db[_0x9685('0x87')]['QueryTypes']['SELECT'],'raw':!![]};var _0x1216a7=_0x48b899[_0x9685('0x88')]();_0x1216a7[_0x9685('0x42')](_0x9685('0x86'));_0x1216a7['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x3a9524[_0x9685('0x3e')]){_0x3a9524[_0x9685('0x3e')][_0x9685('0x2f')](function(_0x35bcca){var _0x125127=_0x35bcca[0x0]===_0x9685('0x89')?_0x35bcca[0x0]:'i.'+_0x35bcca[0x0];_0x48b899[_0x9685('0x3e')](_0x125127,_0x35bcca[0x1]===_0x9685('0x8a')?![]:!![]);});}if(!_['isEmpty'](_0x163d46)){_0x48b899[_0x9685('0x5f')](_0x3f8ed0);_0x1216a7['where'](_0x9685('0x8b'),_0x163d46);}BPromise[_0x9685('0x8c')]()[_0x9685('0x29')](function(){if(!_0x26c0d2){if(_0x3ba8ac['query'][_0x9685('0x8d')])return;_0x1216a7['where'](_0x9685('0x8e'));_0x48b899[_0x9685('0x72')](_0x9685('0x8e'));return;}if(_0x3ba8ac[_0x9685('0x8f')]['role']!=='agent')return;return _0x3ba8ac[_0x9685('0x8f')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0x9685('0x29')](function(_0x8f3a0d){if(_[_0x9685('0x71')](_0x8f3a0d)){_0x1216a7[_0x9685('0x72')](_0x9685('0x90'));_0x48b899[_0x9685('0x72')](_0x9685('0x90'));}else{_0x1216a7[_0x9685('0x72')](_0x9685('0x91'),_[_0x9685('0x31')](_0x8f3a0d,'id'));_0x48b899[_0x9685('0x72')](_0x9685('0x91'),_['map'](_0x8f3a0d,'id'));}});})['then'](function(){if(_0x3ba8ac['user']['role']===_0x9685('0x92')&&!_0x26c0d2&&!_0x3ba8ac['query']['OpenchannelAccountId'])return[];return db[_0x9685('0x93')][_0x9685('0x36')](_0x1216a7[_0x9685('0x94')](),_0x10569a);})['then'](function(_0x458b18){_0x59f94c[_0x9685('0x22')]=_0x458b18[_0x9685('0x5a')];if(_0x59f94c[_0x9685('0x22')]===0x0)return[];return db[_0x9685('0x93')]['query'](_0x3ac286[_0x9685('0x94')](),_0x10569a)[_0x9685('0x29')](function(_0x536d58){_0xf3765c=_[_0x9685('0x95')](_0x536d58,'id');_0x10569a=_[_0x9685('0x96')](_0x10569a,{'model':db[_0x9685('0x97')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3ba8ac['query'][_0x9685('0x3a')]){_0x3a9524['attributes'][_0x9685('0x2f')](function(_0xfcaaf3){_0x48b899['field']('i.'+_0xfcaaf3);});}else{_0x48b899[_0x9685('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x9685('0x5d'));_0x48b899[_0x9685('0x42')](_0x9685('0x98'),_0x9685('0x99'));_0x48b899[_0x9685('0x42')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x48b899[_0x9685('0x42')](_0x9685('0x9a'),_0x9685('0x89'));_0x48b899[_0x9685('0x42')](_0x9685('0x9b'));_0x48b899['field'](_0x9685('0x9c'),_0x9685('0x9d'));_0x48b899[_0x9685('0x42')](_0x9685('0x9e'),_0x9685('0x9f'));_0x48b899[_0x9685('0x42')](_0x9685('0xa0'),_0x9685('0xa1'));_0x48b899[_0x9685('0x42')](_0x9685('0xa2'),'Contact.phone');_0x48b899[_0x9685('0x42')]('c.mobile','Contact.mobile');_0x48b899[_0x9685('0x42')](_0x9685('0xa3'),'Contact.fax');_0x48b899[_0x9685('0x42')](_0x9685('0xa4'),_0x9685('0xa5'));_0x48b899['field'](_0x9685('0xa6'),'Owner.internal');_0x48b899['field'](_0x9685('0xa7'),_0x9685('0x2d'));}if(_0x3a9524[_0x9685('0x3d')])_0x48b899[_0x9685('0x3d')](_0x3a9524[_0x9685('0x3d')]);if(_0x3a9524['offset'])_0x48b899[_0x9685('0x20')](_0x3a9524['offset']);return db[_0x9685('0x93')][_0x9685('0x36')](_0x48b899[_0x9685('0x94')](),_0x10569a);})[_0x9685('0x29')](function(_0x345d9a){if(_0x345d9a[_0x9685('0x5a')]>0x0)_0x4e6c55[_0x9685('0x72')]('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x9685('0x31')](_0x345d9a,'id'));return db['sequelize'][_0x9685('0x36')](_0x4e6c55[_0x9685('0x94')](),_0x10569a)['then'](function(_0x75052f){var _0x1b8ace=_[_0x9685('0xa8')](_0x75052f,_0x9685('0xa9'));var _0x23caaa=[];_0x345d9a[_0x9685('0x2f')](function(_0x551da9){_0x23caaa[_0x9685('0xaa')](updateOpenchannelInteraction(_0x551da9,_0xf3765c,_0x1b8ace));});return BPromise[_0x9685('0xab')](_0x23caaa);});});})[_0x9685('0x29')](function(_0x26b4ee){_0x59f94c[_0x9685('0xac')]=_0x26b4ee;return _0x59f94c;})[_0x9685('0x29')](respondWithFilteredResult(_0x1d74ab,_0x3a9524))[_0x9685('0x30')](handleError(_0x1d74ab,null));};exports[_0x9685('0xad')]=function(_0x134278,_0x3b6e21){var _0x3c6dcf={};if(_0x134278[_0x9685('0x36')][_0x9685('0x69')]&&_0x134278[_0x9685('0x36')][_0x9685('0x69')]===_0x9685('0x43')){_0x3c6dcf[_0x9685('0x43')]=_0x134278[_0x9685('0xae')]['id'];}else{_0x3c6dcf['id']=_0x134278[_0x9685('0xae')]['id'];}var _0xc50d0a={'raw':![],'where':_0x3c6dcf},_0x36c628={};_0x36c628['model']=_[_0x9685('0x37')](db[_0x9685('0x97')]['rawAttributes']);_0x36c628[_0x9685('0x36')]=_[_0x9685('0x37')](_0x134278[_0x9685('0x36')]);_0x36c628[_0x9685('0x38')]=_[_0x9685('0x39')](_0x36c628[_0x9685('0x35')],_0x36c628[_0x9685('0x36')]);_0xc50d0a[_0x9685('0x3b')]=_[_0x9685('0x39')](_0x36c628[_0x9685('0x35')],qs[_0x9685('0x3a')](_0x134278[_0x9685('0x36')][_0x9685('0x3a')]));_0xc50d0a[_0x9685('0x3b')]=_0xc50d0a[_0x9685('0x3b')]['length']?_0xc50d0a[_0x9685('0x3b')]:_0x36c628['model'];if(_0x134278['query'][_0x9685('0xaf')]){_0xc50d0a['include']=[{'all':!![]}];}_0xc50d0a=_[_0x9685('0x96')]({},_0xc50d0a,_0x134278[_0x9685('0xb0')]);return db[_0x9685('0x97')]['find'](_0xc50d0a)['then'](handleEntityNotFound(_0x3b6e21,null))['then'](respondWithResult(_0x3b6e21,null))[_0x9685('0x30')](handleError(_0x3b6e21,null));};exports[_0x9685('0xb1')]=function(_0x1dee6e,_0x4cd144){return db[_0x9685('0x97')][_0x9685('0xb1')](_0x1dee6e['body'],{})[_0x9685('0x29')](respondWithResult(_0x4cd144,0xc9))[_0x9685('0x30')](handleError(_0x4cd144,null));};exports[_0x9685('0x27')]=function(_0x50ee2f,_0x5b7e2c){if(_0x50ee2f['body']['id']){delete _0x50ee2f['body']['id'];}return db[_0x9685('0x97')][_0x9685('0x5c')]({'where':{'id':_0x50ee2f[_0x9685('0xae')]['id']}})[_0x9685('0x29')](handleEntityNotFound(_0x5b7e2c,null))[_0x9685('0x29')](saveUpdates(_0x50ee2f[_0x9685('0x6e')],null))['then'](respondWithResult(_0x5b7e2c,null))[_0x9685('0x30')](handleError(_0x5b7e2c,null));};exports[_0x9685('0x28')]=function(_0x4f92c9,_0x59eea6){return db[_0x9685('0x97')][_0x9685('0x5c')]({'where':{'id':_0x4f92c9[_0x9685('0xae')]['id']}})['then'](handleEntityNotFound(_0x59eea6,null))[_0x9685('0x29')](removeEntity(_0x59eea6,null))[_0x9685('0x30')](handleError(_0x59eea6,null));};exports[_0x9685('0xb2')]=function(_0x59812b,_0xeb0ed1){return db[_0x9685('0x97')]['describe']()[_0x9685('0x29')](respondWithResult(_0xeb0ed1,null))[_0x9685('0x30')](handleError(_0xeb0ed1,null));};exports['addMessage']=function(_0x4d026a,_0x29823a,_0x2f0856){return db['OpenchannelMessage'][_0x9685('0x5c')]({'where':{'id':_0x4d026a['params']['id']}})['then'](handleEntityNotFound(_0x29823a,null))[_0x9685('0x29')](function(_0x23fb85){if(_0x23fb85){return _0x23fb85[_0x9685('0xb3')](_0x4d026a[_0x9685('0x6e')][_0x9685('0xb4')],_[_0x9685('0xb5')](_0x4d026a['body'],['ids','id'])||{});}})[_0x9685('0x29')](respondWithResult(_0x29823a,null))[_0x9685('0x30')](handleError(_0x29823a,null));};exports[_0x9685('0xb6')]=function(_0x27b57d,_0x4db05f,_0x307b91){var _0x10b613={'raw':![],'where':{}};var _0xb768f7={};var _0x4eda70={'count':0x0,'rows':[]};return db[_0x9685('0x97')][_0x9685('0xb7')]({'where':{'id':_0x27b57d['params']['id']}})[_0x9685('0x29')](handleEntityNotFound(_0x4db05f,null))[_0x9685('0x29')](function(_0x463d63){if(_0x463d63){_0xb768f7[_0x9685('0x35')]=_['keys'](db['OpenchannelMessage'][_0x9685('0x32')]);_0xb768f7[_0x9685('0x36')]=_[_0x9685('0x37')](_0x27b57d['query']);_0xb768f7[_0x9685('0x38')]=_[_0x9685('0x39')](_0xb768f7[_0x9685('0x35')],_0xb768f7[_0x9685('0x36')]);_0x10b613['attributes']=_[_0x9685('0x39')](_0xb768f7[_0x9685('0x35')],qs[_0x9685('0x3a')](_0x27b57d[_0x9685('0x36')]['fields']));_0x10b613[_0x9685('0x3b')]=_0x10b613[_0x9685('0x3b')][_0x9685('0x5a')]?_0x10b613[_0x9685('0x3b')]:_0xb768f7[_0x9685('0x35')];if(!_0x27b57d[_0x9685('0x36')][_0x9685('0x3c')](_0x9685('0xb8'))){_0x10b613[_0x9685('0x3d')]=qs[_0x9685('0x3d')](_0x27b57d[_0x9685('0x36')][_0x9685('0x3d')]);_0x10b613[_0x9685('0x20')]=qs[_0x9685('0x20')](_0x27b57d['query'][_0x9685('0x20')]);}_0x10b613['order']=qs['sort'](_0x27b57d['query']['sort']);_0x10b613[_0x9685('0x72')]=qs[_0x9685('0x38')](_[_0x9685('0x40')](_0x27b57d[_0x9685('0x36')],_0xb768f7[_0x9685('0x38')]));_0x10b613[_0x9685('0x72')][_0x9685('0xa9')]=_0x463d63['id'];if(_0x27b57d['query'][_0x9685('0x7f')]){_0x10b613[_0x9685('0x72')]=_[_0x9685('0x96')](_0x10b613[_0x9685('0x72')],{'$or':_['map'](_0x10b613['attributes'],function(_0x23e1ea){var _0x1db29f={};_0x1db29f[_0x23e1ea]={'$like':'%'+_0x27b57d['query'][_0x9685('0x7f')]+'%'};return _0x1db29f;})});}if(_0x27b57d['query'][_0x9685('0x76')]){var _0x5b6f49=_0x27b57d[_0x9685('0x36')][_0x9685('0x76')]['split'](',');var _0x192dfa={};_0x192dfa[_0x5b6f49[0x0]]={'$gte':moment(_0x5b6f49[0x1])['format'](_0x9685('0xb9'))};_0x10b613[_0x9685('0x72')]=_[_0x9685('0x96')](_0x10b613[_0x9685('0x72')],_0x192dfa);}_0x10b613=_[_0x9685('0x96')]({},_0x10b613,_0x27b57d['options']);return db[_0x9685('0xba')][_0x9685('0x22')]({'where':_0x10b613[_0x9685('0x72')]})[_0x9685('0x29')](function(_0x28df88){_0x4eda70['count']=_0x28df88;if(_0x27b57d[_0x9685('0x36')][_0x9685('0xaf')]){_0x10b613[_0x9685('0xbb')]=[{'all':!![]}];}return db[_0x9685('0xba')][_0x9685('0xbc')](_0x10b613);})[_0x9685('0x29')](function(_0x7473e9){_0x4eda70[_0x9685('0xac')]=_0x7473e9;return _0x4eda70;});}})[_0x9685('0x29')](respondWithFilteredResult(_0x4db05f,_0x10b613))[_0x9685('0x30')](handleError(_0x4db05f,null));};exports[_0x9685('0xbd')]=function(_0x3b3fc6,_0x3ab35a,_0x1e0192){return db[_0x9685('0x97')][_0x9685('0x5c')]({'where':{'id':_0x3b3fc6[_0x9685('0xae')]['id']}})['then'](handleEntityNotFound(_0x3ab35a,null))[_0x9685('0x29')](function(_0x943163){if(_0x943163){return _0x943163[_0x9685('0xbe')](_0x3b3fc6[_0x9685('0x6e')][_0x9685('0xb4')],_[_0x9685('0xb5')](_0x3b3fc6[_0x9685('0x6e')],['ids','id'])||{})[_0x9685('0xbf')](function(){return db[_0x9685('0x6c')]['findAll']({'attributes':['id',_0x9685('0x2b'),_0x9685('0xc0')],'where':{'id':_0x3b3fc6[_0x9685('0x6e')][_0x9685('0xb4')]}});})[_0x9685('0x29')](function(_0x40cfe2){socket[_0x9685('0xc1')](_0x9685('0xc2'),{'id':Number(_0x3b3fc6[_0x9685('0xae')]['id']),'tags':_0x40cfe2||[]});return{'id':Number(_0x3b3fc6[_0x9685('0xae')]['id']),'tags':_0x40cfe2||[]};});}})[_0x9685('0x29')](respondWithResult(_0x3ab35a,null))[_0x9685('0x30')](handleError(_0x3ab35a,null));};exports[_0x9685('0xc3')]=function(_0x424b61,_0x2ed860,_0x422d24){return db[_0x9685('0x97')][_0x9685('0x5c')]({'where':{'id':_0x424b61[_0x9685('0xae')]['id']}})['then'](handleEntityNotFound(_0x2ed860,null))[_0x9685('0x29')](function(_0x4f9758){if(_0x4f9758){return _0x4f9758[_0x9685('0xc3')](_0x424b61[_0x9685('0x36')]['ids']);}})[_0x9685('0x29')](respondWithStatusCode(_0x2ed860,null))[_0x9685('0x30')](handleError(_0x2ed860,null));};exports['download']=function(_0x4b8b16,_0xb80829){var _0x36a6be=moment()[_0x9685('0xc4')]()[_0x9685('0x94')]();var _0x53ab70=path[_0x9685('0xc5')](config[_0x9685('0xc6')],'server',_0x9685('0xc7'),_0x9685('0xc8'));var _0x3d27ff=path[_0x9685('0xc5')](config[_0x9685('0xc6')],'server','files',_0x9685('0xc9'));var _0x5bde90=path[_0x9685('0xc5')](_0x53ab70,_0x36a6be);var _0xc988f5=util[_0x9685('0xca')](_0x9685('0xcb'),_0x4b8b16['params']['id'],_0x36a6be);var _0x4a8513=path[_0x9685('0xc5')](_0x53ab70,_0xc988f5);var _0x183054=[];_0x183054[_0x9685('0xaa')]({'model':db[_0x9685('0xcc')],'as':_0x9685('0xcc'),'attributes':['id',_0x9685('0xcd')],'raw':!![]});_0x183054['push']({'model':db['CmContact'],'as':_0x9685('0xce'),'attributes':['id','firstName',_0x9685('0xcf')],'raw':!![]});if(_0x4b8b16[_0x9685('0x36')][_0x9685('0xc9')]){_0x183054[_0x9685('0xaa')]({'model':db[_0x9685('0xd0')],'as':_0x9685('0xd0'),'raw':!![]});}var _0x59ffc2=[{'model':db[_0x9685('0xba')],'as':'Messages','attributes':['id',_0x9685('0x6e'),_0x9685('0x74'),_0x9685('0xd1'),'secret',_0x9685('0x7a')],'include':_0x183054}];_0x59ffc2[_0x9685('0xaa')]({'model':db[_0x9685('0xd2')],'as':_0x9685('0xd3'),'attributes':['id',_0x9685('0x2b')]});_0x59ffc2[_0x9685('0xaa')]({'model':db[_0x9685('0xcc')],'as':_0x9685('0xd4'),'attributes':['id',_0x9685('0xcd')]});return db['OpenchannelInteraction'][_0x9685('0x5c')]({'where':{'id':_0x4b8b16[_0x9685('0xae')]['id']},'include':_0x59ffc2})[_0x9685('0x29')](handleEntityNotFound(_0xb80829,null))[_0x9685('0x29')](function(_0x14529c){if(_0x14529c){var _0xb3598a=_0x14529c[_0x9685('0xd5')]({'plain':!![]});fs[_0x9685('0xd6')](_0x5bde90);var _0x3611f7={'channel':_0x9685('0xd7'),'account':_0xb3598a[_0x9685('0xd3')]['name'],'agent':_0xb3598a[_0x9685('0xd4')]?_0xb3598a[_0x9685('0xd4')]['fullname']:_0x9685('0xd8'),'createdAt':moment(_0xb3598a['createdAt'])[_0x9685('0xca')](_0x9685('0xb9'))[_0x9685('0x94')](),'closedAt':_0xb3598a[_0x9685('0xd9')]?moment(_0xb3598a[_0x9685('0xda')])['format'](_0x9685('0xb9'))['toString']():'','disposition':_0xb3598a[_0x9685('0xdb')],'visibility':_0xb3598a['threadId']?_0x9685('0xdc'):_0x9685('0xdd'),'messages':_(_0xb3598a['Messages'])[_0x9685('0x7f')]({'secret':![]})[_0x9685('0x31')](function(_0x34af7e){if(_0x34af7e[_0x9685('0xd0')]){var _0x414d24=path[_0x9685('0xc5')](_0x3d27ff,_0x34af7e[_0x9685('0xd0')]['basename']);if(fs['existsSync'](_0x414d24)){fs[_0x9685('0xde')](_0x414d24)['pipe'](fs[_0x9685('0xdf')](path[_0x9685('0xc5')](_0x5bde90,_0x34af7e[_0x9685('0xd0')]['basename'])));}}return{'date':moment(_0x34af7e[_0x9685('0x74')])['format'](_0x9685('0xb9'))[_0x9685('0x94')](),'sender':_0x34af7e[_0x9685('0xd1')]===_0x9685('0xe0')?_0x34af7e[_0x9685('0xcc')]?_0x34af7e['User'][_0x9685('0xcd')]:_0x9685('0xe1'):_0x34af7e[_0x9685('0xce')]['firstName']+(_0x34af7e[_0x9685('0xce')]['lastName']?'\x20'+_0x34af7e['Contact'][_0x9685('0xcf')]:''),'body':_0x34af7e['Attachment']?_0x34af7e[_0x9685('0xd0')][_0x9685('0xe2')]:_0x34af7e[_0x9685('0x6e')],'direction':_0x34af7e[_0x9685('0xd1')]===_0x9685('0xe0')?'A':'C','secret':_0x34af7e[_0x9685('0xe3')],'read':_0x34af7e[_0x9685('0x7a')],'attachment':_0x34af7e['Attachment']};})['value']()};return ejs[_0x9685('0xe4')](path[_0x9685('0xc5')](config[_0x9685('0xc6')],'server',_0x9685('0xe5'),_0x9685('0xe6')),{'interaction':_0x3611f7})[_0x9685('0x29')](function(_0x895a00){var _0x8f85c1=path['join'](_0x5bde90,_0x9685('0xe7')+_0xb3598a['id']+'-'+_0x36a6be+'.pdf');var _0x1d9514={'path':_0x8f85c1,'channel':_0x9685('0xd7'),'interactionId':_0xb3598a['id']};return pdf[_0x9685('0xe8')](_0x895a00,_0x1d9514);})[_0x9685('0x29')](function(){return new BPromise(function(_0x1a495d,_0x47ea7c){zipdir(_0x5bde90,{'saveTo':_0x4a8513},function(_0x2fc737,_0x2f7333){if(_0x2fc737)return _0x47ea7c(_0x2fc737);return _0x1a495d(_0x2f7333);});})[_0x9685('0x29')](function(){return new BPromise(function(_0x150916,_0x52729d){rimraf(_0x5bde90,function(_0x219b4b){if(_0x219b4b)_0x52729d(_0x219b4b);return _0x150916();});});})[_0x9685('0x29')](function(){return _0xb80829['download'](_0x4a8513,_0xc988f5,function(_0x27529b){if(_0x27529b){console['log'](_0x9685('0xe9'),_0x27529b);}else{fs['unlinkSync'](_0x4a8513);}});});});}else{return _0xb80829[_0x9685('0x1c')](0xc8);}})[_0x9685('0x30')](handleError(_0xb80829,null));};
\ No newline at end of file
index 0ccf239..49ae65f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5bb1=['getUsers','then','setDataValue','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','save','update','remove'];(function(_0x2a0a73,_0x3046e4){var _0x4e451b=function(_0x5d23b2){while(--_0x5d23b2){_0x2a0a73['push'](_0x2a0a73['shift']());}};_0x4e451b(++_0x3046e4);}(_0x5bb1,0x1d6));var _0x15bb=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x5bb1[_0x39c734];return _0xb2a2f9;};'use strict';var EventEmitter=require(_0x15bb('0x0'));var OpenchannelInteraction=require(_0x15bb('0x1'))['db'][_0x15bb('0x2')];var OpenchannelMessage=require(_0x15bb('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x15bb('0x3'),'afterUpdate':_0x15bb('0x4'),'afterDestroy':_0x15bb('0x5')};function emitEvent(_0x4a03de){return function(_0x1267c2,_0x48572b,_0x14e214){_0x1267c2[_0x15bb('0x6')]({'attributes':['id'],'raw':!![]})[_0x15bb('0x7')](function(_0x15c0b4){_0x1267c2[_0x15bb('0x8')]('Users',_0x15c0b4['map'](function(_0x452424){return{'id':_0x452424['id']};}));return OpenchannelMessage[_0x15bb('0x9')]({'where':{'OpenchannelInteractionId':_0x1267c2['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x4624ca){_0x1267c2[_0x15bb('0x8')](_0x15bb('0xa'),_0x4624ca[_0x15bb('0xb')]);OpenchannelInteractionEvents[_0x15bb('0xc')](_0x4a03de+':'+_0x1267c2['id'],_0x1267c2);OpenchannelInteractionEvents[_0x15bb('0xc')](_0x4a03de,_0x1267c2);_0x14e214(null);})[_0x15bb('0xd')](_0x14e214(null));};}for(var e in events){if(events[_0x15bb('0xe')](e)){var event=events[e];OpenchannelInteraction[_0x15bb('0xf')](e,emitEvent(event));}}module[_0x15bb('0x10')]=OpenchannelInteractionEvents;
\ No newline at end of file
+var _0x3a5d=['remove','Users','map','findAll','then','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','OpenchannelInteraction','../../mysqldb','save','update'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x3a5d,0xab));var _0xd3a5=function(_0x390b0b,_0x52dff6){_0x390b0b=_0x390b0b-0x0;var _0x167608=_0x3a5d[_0x390b0b];return _0x167608;};'use strict';var EventEmitter=require(_0xd3a5('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db'][_0xd3a5('0x1')];var OpenchannelMessage=require(_0xd3a5('0x2'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd3a5('0x3'),'afterUpdate':_0xd3a5('0x4'),'afterDestroy':_0xd3a5('0x5')};function emitEvent(_0x1f96a7){return function(_0x348813,_0x226930,_0x29ff21){_0x348813['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x260c8e){_0x348813['setDataValue'](_0xd3a5('0x6'),_0x260c8e[_0xd3a5('0x7')](function(_0x4a7243){return{'id':_0x4a7243['id']};}));return OpenchannelMessage[_0xd3a5('0x8')]({'where':{'OpenchannelInteractionId':_0x348813['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd3a5('0x9')](function(_0x4c561b){_0x348813['setDataValue'](_0xd3a5('0xa'),_0x4c561b[_0xd3a5('0xb')]);OpenchannelInteractionEvents[_0xd3a5('0xc')](_0x1f96a7+':'+_0x348813['id'],_0x348813);OpenchannelInteractionEvents[_0xd3a5('0xc')](_0x1f96a7,_0x348813);_0x29ff21(null);})['catch'](_0x29ff21(null));};}for(var e in events){if(events[_0xd3a5('0xd')](e)){var event=events[e];OpenchannelInteraction[_0xd3a5('0xe')](e,emitEvent(event));}}module[_0xd3a5('0xf')]=OpenchannelInteractionEvents;
\ No newline at end of file
index 5fe2d77..695210c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc05e=['../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction','utf8mb4','utf8mb4_unicode_ci','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x45be7e,_0x34cef8){var _0x2ec7ce=function(_0x3ec04e){while(--_0x3ec04e){_0x45be7e['push'](_0x45be7e['shift']());}};_0x2ec7ce(++_0x34cef8);}(_0xc05e,0x17f));var _0xec05=function(_0x353600,_0xfa13f5){_0x353600=_0x353600-0x0;var _0x4c7337=_0xc05e[_0x353600];return _0x4c7337;};'use strict';var _=require(_0xec05('0x0'));var util=require(_0xec05('0x1'));var logger=require(_0xec05('0x2'))('api');var moment=require(_0xec05('0x3'));var BPromise=require('bluebird');var rp=require(_0xec05('0x4'));var fs=require('fs');var path=require(_0xec05('0x5'));var rimraf=require(_0xec05('0x6'));var config=require(_0xec05('0x7'));var attributes=require(_0xec05('0x8'));module[_0xec05('0x9')]=function(_0xc0240f,_0x19f035){return _0xc0240f['define'](_0xec05('0xa'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xec05('0xb'),'collate':_0xec05('0xc'),'hooks':{'beforeUpdate':function(_0x1ffb42,_0x11a283,_0x555b9f){if(_0x1ffb42['changed']('closed')){_0x1ffb42['closedAt']=moment()[_0xec05('0xd')](_0xec05('0xe'));}_0x555b9f(null,_0x1ffb42);}}});};
\ No newline at end of file
+var _0x7f19=['exports','define','OpenchannelInteraction','openchannel_interactions','utf8mb4_unicode_ci','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./openchannelInteraction.attributes'];(function(_0x45a34b,_0x40a5e0){var _0x5b54b4=function(_0x4fdba9){while(--_0x4fdba9){_0x45a34b['push'](_0x45a34b['shift']());}};_0x5b54b4(++_0x40a5e0);}(_0x7f19,0x8e));var _0x97f1=function(_0x2468a7,_0x5e2ab4){_0x2468a7=_0x2468a7-0x0;var _0x42ee58=_0x7f19[_0x2468a7];return _0x42ee58;};'use strict';var _=require(_0x97f1('0x0'));var util=require(_0x97f1('0x1'));var logger=require(_0x97f1('0x2'))(_0x97f1('0x3'));var moment=require(_0x97f1('0x4'));var BPromise=require(_0x97f1('0x5'));var rp=require(_0x97f1('0x6'));var fs=require('fs');var path=require(_0x97f1('0x7'));var rimraf=require(_0x97f1('0x8'));var config=require('../../config/environment');var attributes=require(_0x97f1('0x9'));module[_0x97f1('0xa')]=function(_0x3f0839,_0xa64a6b){return _0x3f0839[_0x97f1('0xb')](_0x97f1('0xc'),attributes,{'tableName':_0x97f1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x97f1('0xe'),'hooks':{'beforeUpdate':function(_0x5a7908,_0x5ac938,_0x33c46a){if(_0x5a7908[_0x97f1('0xf')](_0x97f1('0x10'))){_0x5a7908['closedAt']=moment()[_0x97f1('0x11')](_0x97f1('0x12'));}_0x33c46a(null,_0x5a7908);}}});};
\ No newline at end of file
index a5d181d..627fb3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6daa=['omit','spread','AddTags','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./openchannelInteraction.socket','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','OpenchannelInteraction','update','body','options','raw','attributes','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','find','addTags','ids'];(function(_0x4f217f,_0x313163){var _0x3b583a=function(_0x334971){while(--_0x334971){_0x4f217f['push'](_0x4f217f['shift']());}};_0x3b583a(++_0x313163);}(_0x6daa,0x1d1));var _0xa6da=function(_0x191d49,_0xcac38b){_0x191d49=_0x191d49-0x0;var _0x31a14b=_0x6daa[_0x191d49];return _0x31a14b;};'use strict';var _=require(_0xa6da('0x0'));var util=require(_0xa6da('0x1'));var moment=require(_0xa6da('0x2'));var BPromise=require('bluebird');var rs=require(_0xa6da('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa6da('0x4'))['db'];var utils=require(_0xa6da('0x5'));var logger=require(_0xa6da('0x6'))(_0xa6da('0x7'));var config=require('../../config/environment');var jayson=require(_0xa6da('0x8'));var client=jayson[_0xa6da('0x9')][_0xa6da('0xa')]({'port':0x232a});config[_0xa6da('0xb')]=_[_0xa6da('0xc')](config[_0xa6da('0xb')],{'host':_0xa6da('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa6da('0xb')]));require(_0xa6da('0xe'))[_0xa6da('0xf')](socket);function respondWithRpcPromise(_0x142ce2,_0x1e7dd9,_0x5baeaa){return new BPromise(function(_0x2341f7,_0x15be74){return client['request'](_0x142ce2,_0x5baeaa)[_0xa6da('0x10')](function(_0x25d87d){logger[_0xa6da('0x11')](_0xa6da('0x12'),_0x1e7dd9,'request\x20sent');logger[_0xa6da('0x13')](_0xa6da('0x14'),_0x1e7dd9,_0xa6da('0x15'),JSON[_0xa6da('0x16')](_0x25d87d));if(_0x25d87d[_0xa6da('0x17')]){if(_0x25d87d['error'][_0xa6da('0x18')]===0x1f4){logger[_0xa6da('0x17')](_0xa6da('0x12'),_0x1e7dd9,_0x25d87d[_0xa6da('0x17')]['message']);return _0x15be74(_0x25d87d[_0xa6da('0x17')][_0xa6da('0x19')]);}logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x1e7dd9,_0x25d87d[_0xa6da('0x17')]['message']);return _0x2341f7(_0x25d87d['error'][_0xa6da('0x19')]);}else{logger[_0xa6da('0x11')](_0xa6da('0x12'),_0x1e7dd9,'request\x20sent');_0x2341f7(_0x25d87d[_0xa6da('0x1a')][_0xa6da('0x19')]);}})[_0xa6da('0x1b')](function(_0xe804f0){logger[_0xa6da('0x17')](_0xa6da('0x12'),_0x1e7dd9,_0xe804f0);_0x15be74(_0xe804f0);});});}exports['UpdateOpenchannelInteraction']=function(_0x3a1827){var _0xfb7984=this;return new Promise(function(_0x2e0ac4,_0x4f7025){return db[_0xa6da('0x1c')][_0xa6da('0x1d')](_0x3a1827[_0xa6da('0x1e')],{'raw':_0x3a1827[_0xa6da('0x1f')]?_0x3a1827['options'][_0xa6da('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a1827[_0xa6da('0x1f')]?_0x3a1827[_0xa6da('0x1f')]['where']||null:null,'attributes':_0x3a1827[_0xa6da('0x1f')]?_0x3a1827[_0xa6da('0x1f')][_0xa6da('0x21')]||null:null,'limit':_0x3a1827[_0xa6da('0x1f')]?_0x3a1827[_0xa6da('0x1f')]['limit']||null:null})[_0xa6da('0x10')](function(_0x2665e5){logger[_0xa6da('0x11')](_0xa6da('0x22'),_0x3a1827);logger[_0xa6da('0x13')]('UpdateOpenchannelInteraction',_0x3a1827,JSON[_0xa6da('0x16')](_0x2665e5));_0x2e0ac4(_0x2665e5);})[_0xa6da('0x1b')](function(_0x466151){logger[_0xa6da('0x17')]('UpdateOpenchannelInteraction',_0x466151[_0xa6da('0x19')],_0x3a1827);_0x4f7025(_0xfb7984[_0xa6da('0x17')](0x1f4,_0x466151[_0xa6da('0x19')]));});});};exports[_0xa6da('0x23')]=function(_0x5af580){return new Promise(function(_0x545927,_0x4d874a){return db['OpenchannelInteraction'][_0xa6da('0x24')]({'where':_0x5af580[_0xa6da('0x1f')]?_0x5af580['options']['where']||null:null})[_0xa6da('0x10')](function(_0x58281a){if(_0x58281a){return _0x58281a[_0xa6da('0x25')](_0x5af580[_0xa6da('0x1e')][_0xa6da('0x26')],_[_0xa6da('0x27')](_0x5af580[_0xa6da('0x1e')],['ids','id'])||{});}})[_0xa6da('0x28')](function(_0x40113d){logger[_0xa6da('0x11')]('AddTags',_0x5af580);logger[_0xa6da('0x13')]('AddTags',_0x5af580,JSON[_0xa6da('0x16')](_0x40113d));_0x545927(_0x40113d);})[_0xa6da('0x1b')](function(_0x86050d){logger[_0xa6da('0x17')](_0xa6da('0x29'),_0x86050d[_0xa6da('0x19')],_0x5af580);_0x4d874a(_this[_0xa6da('0x17')](0x1f4,_0x86050d[_0xa6da('0x19')]));});});};
\ No newline at end of file
+var _0xab61=['AddTags','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./openchannelInteraction.socket','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','OpenchannelInteraction','update','body','options','where','attributes','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xab61,0x79));var _0x1ab6=function(_0x784768,_0x3d0c75){_0x784768=_0x784768-0x0;var _0x3b76fc=_0xab61[_0x784768];return _0x3b76fc;};'use strict';var _=require(_0x1ab6('0x0'));var util=require('util');var moment=require(_0x1ab6('0x1'));var BPromise=require('bluebird');var rs=require(_0x1ab6('0x2'));var fs=require('fs');var Redis=require(_0x1ab6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1ab6('0x4'));var logger=require(_0x1ab6('0x5'))(_0x1ab6('0x6'));var config=require(_0x1ab6('0x7'));var jayson=require(_0x1ab6('0x8'));var client=jayson[_0x1ab6('0x9')][_0x1ab6('0xa')]({'port':0x232a});config[_0x1ab6('0xb')]=_['defaults'](config[_0x1ab6('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x1ab6('0xc'))(new Redis(config[_0x1ab6('0xb')]));require(_0x1ab6('0xd'))[_0x1ab6('0xe')](socket);function respondWithRpcPromise(_0x1dbae2,_0x593272,_0x176844){return new BPromise(function(_0xe88306,_0x2e9635){return client['request'](_0x1dbae2,_0x176844)[_0x1ab6('0xf')](function(_0x3cc0bd){logger[_0x1ab6('0x10')](_0x1ab6('0x11'),_0x593272,_0x1ab6('0x12'));logger[_0x1ab6('0x13')](_0x1ab6('0x14'),_0x593272,_0x1ab6('0x12'),JSON[_0x1ab6('0x15')](_0x3cc0bd));if(_0x3cc0bd[_0x1ab6('0x16')]){if(_0x3cc0bd['error'][_0x1ab6('0x17')]===0x1f4){logger['error'](_0x1ab6('0x11'),_0x593272,_0x3cc0bd['error']['message']);return _0x2e9635(_0x3cc0bd[_0x1ab6('0x16')][_0x1ab6('0x18')]);}logger[_0x1ab6('0x16')](_0x1ab6('0x11'),_0x593272,_0x3cc0bd[_0x1ab6('0x16')][_0x1ab6('0x18')]);return _0xe88306(_0x3cc0bd['error'][_0x1ab6('0x18')]);}else{logger[_0x1ab6('0x10')](_0x1ab6('0x11'),_0x593272,'request\x20sent');_0xe88306(_0x3cc0bd['result']['message']);}})[_0x1ab6('0x19')](function(_0x2fb6f7){logger[_0x1ab6('0x16')](_0x1ab6('0x11'),_0x593272,_0x2fb6f7);_0x2e9635(_0x2fb6f7);});});}exports['UpdateOpenchannelInteraction']=function(_0x591048){var _0x446caf=this;return new Promise(function(_0x50d99e,_0x147dbf){return db[_0x1ab6('0x1a')][_0x1ab6('0x1b')](_0x591048[_0x1ab6('0x1c')],{'raw':_0x591048['options']?_0x591048[_0x1ab6('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x591048[_0x1ab6('0x1d')]?_0x591048[_0x1ab6('0x1d')][_0x1ab6('0x1e')]||null:null,'attributes':_0x591048[_0x1ab6('0x1d')]?_0x591048[_0x1ab6('0x1d')][_0x1ab6('0x1f')]||null:null,'limit':_0x591048['options']?_0x591048[_0x1ab6('0x1d')]['limit']||null:null})['then'](function(_0x3e458c){logger[_0x1ab6('0x10')](_0x1ab6('0x20'),_0x591048);logger[_0x1ab6('0x13')]('UpdateOpenchannelInteraction',_0x591048,JSON[_0x1ab6('0x15')](_0x3e458c));_0x50d99e(_0x3e458c);})[_0x1ab6('0x19')](function(_0x53a9c7){logger[_0x1ab6('0x16')](_0x1ab6('0x20'),_0x53a9c7['message'],_0x591048);_0x147dbf(_0x446caf['error'](0x1f4,_0x53a9c7[_0x1ab6('0x18')]));});});};exports[_0x1ab6('0x21')]=function(_0xa0f437){return new Promise(function(_0x27501f,_0x5ceed0){return db['OpenchannelInteraction'][_0x1ab6('0x22')]({'where':_0xa0f437[_0x1ab6('0x1d')]?_0xa0f437[_0x1ab6('0x1d')][_0x1ab6('0x1e')]||null:null})[_0x1ab6('0xf')](function(_0x5d17ce){if(_0x5d17ce){return _0x5d17ce[_0x1ab6('0x23')](_0xa0f437[_0x1ab6('0x1c')][_0x1ab6('0x24')],_[_0x1ab6('0x25')](_0xa0f437[_0x1ab6('0x1c')],[_0x1ab6('0x24'),'id'])||{});}})[_0x1ab6('0x26')](function(_0x552b51){logger[_0x1ab6('0x10')]('AddTags',_0xa0f437);logger[_0x1ab6('0x13')](_0x1ab6('0x27'),_0xa0f437,JSON[_0x1ab6('0x15')](_0x552b51));_0x27501f(_0x552b51);})[_0x1ab6('0x19')](function(_0x538308){logger[_0x1ab6('0x16')](_0x1ab6('0x27'),_0x538308[_0x1ab6('0x18')],_0xa0f437);_0x5ceed0(_this[_0x1ab6('0x16')](0x1f4,_0x538308[_0x1ab6('0x18')]));});});};
\ No newline at end of file
index 23d893e..0e0c757 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8884=['save','update','emit','register','length','./openchannelInteraction.events'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x8884,0x83));var _0x4888=function(_0x1b1ade,_0x327971){_0x1b1ade=_0x1b1ade-0x0;var _0x50cac0=_0x8884[_0x1b1ade];return _0x50cac0;};'use strict';var OpenchannelInteractionEvents=require(_0x4888('0x0'));var events=[_0x4888('0x1'),'remove',_0x4888('0x2')];function createListener(_0x5061c4,_0x4c005f){return function(_0x2472fb){_0x4c005f[_0x4888('0x3')](_0x5061c4,_0x2472fb);};}function removeListener(_0x4bb01a,_0x3d61c2){return function(){OpenchannelInteractionEvents['removeListener'](_0x4bb01a,_0x3d61c2);};}exports[_0x4888('0x4')]=function(_0x352b0a){for(var _0x3cb27a=0x0,_0x2337dd=events[_0x4888('0x5')];_0x3cb27a<_0x2337dd;_0x3cb27a++){var _0xcc7577=events[_0x3cb27a];var _0x2ee283=createListener('openchannelInteraction:'+_0xcc7577,_0x352b0a);OpenchannelInteractionEvents['on'](_0xcc7577,_0x2ee283);}};
\ No newline at end of file
+var _0x6546=['./openchannelInteraction.events','save','remove','update','emit','removeListener','register','openchannelInteraction:'];(function(_0x38c632,_0x14e8e6){var _0x12737e=function(_0x3e0fe4){while(--_0x3e0fe4){_0x38c632['push'](_0x38c632['shift']());}};_0x12737e(++_0x14e8e6);}(_0x6546,0x118));var _0x6654=function(_0x2abeff,_0x4c3bfb){_0x2abeff=_0x2abeff-0x0;var _0x35bd24=_0x6546[_0x2abeff];return _0x35bd24;};'use strict';var OpenchannelInteractionEvents=require(_0x6654('0x0'));var events=[_0x6654('0x1'),_0x6654('0x2'),_0x6654('0x3')];function createListener(_0x5d45db,_0xe84b18){return function(_0x3405d7){_0xe84b18[_0x6654('0x4')](_0x5d45db,_0x3405d7);};}function removeListener(_0xf4cdb3,_0x42ee90){return function(){OpenchannelInteractionEvents[_0x6654('0x5')](_0xf4cdb3,_0x42ee90);};}exports[_0x6654('0x6')]=function(_0x401567){for(var _0x212d34=0x0,_0x11ff1f=events['length'];_0x212d34<_0x11ff1f;_0x212d34++){var _0x2d03b0=events[_0x212d34];var _0x2e3510=createListener(_0x6654('0x7')+_0x2d03b0,_0x401567);OpenchannelInteractionEvents['on'](_0x2d03b0,_0x2e3510);}};
\ No newline at end of file
index 0326bf9..db70530 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(_0x3bd019,_0x126b7c){var _0x136936=function(_0x569f9a){while(--_0x569f9a){_0x3bd019['push'](_0x3bd019['shift']());}};_0x136936(++_0x126b7c);}(_0x9c44,0x178));var _0x49c4=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x9c44[_0xdea41a];return _0x15d0d8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util'];(function(_0x185d8f,_0x16b7f1){var _0x39072b=function(_0x188220){while(--_0x188220){_0x185d8f['push'](_0x185d8f['shift']());}};_0x39072b(++_0x16b7f1);}(_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('./openchannelMessage.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),interaction[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x0d8b('0x10')),controller['create']);router[_0x0d8b('0x11')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0x13'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x14')]);router[_0x0d8b('0x11')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x16')]);router[_0x0d8b('0x17')](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x18')]);module['exports']=router;
\ No newline at end of file
index 97c18d7..eb9d865 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f3a=['medium','BOOLEAN','ENUM','out','STRING','sequelize'];(function(_0x18d426,_0x36b0ef){var _0x22e5db=function(_0x216b62){while(--_0x216b62){_0x18d426['push'](_0x18d426['shift']());}};_0x22e5db(++_0x36b0ef);}(_0x2f3a,0xfb));var _0xa2f3=function(_0x1adba8,_0x5eebcb){_0x1adba8=_0x1adba8-0x0;var _0x69cfe7=_0x2f3a[_0x1adba8];return _0x69cfe7;};'use strict';var Sequelize=require(_0xa2f3('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xa2f3('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xa2f3('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xa2f3('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa2f3('0x3')]('in',_0xa2f3('0x4')),'defaultValue':_0xa2f3('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xa2f3('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x0647=['medium','BOOLEAN','ENUM','DATE','STRING','sequelize','TEXT'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0647,0xd0));var _0x7064=function(_0x35d8af,_0x14fd75){_0x35d8af=_0x35d8af-0x0;var _0x1d08b0=_0x0647[_0x35d8af];return _0x1d08b0;};'use strict';var Sequelize=require(_0x7064('0x0'));module['exports']={'body':{'type':Sequelize[_0x7064('0x1')](_0x7064('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x7064('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x7064('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7064('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x7064('0x5')]},'providerName':{'type':Sequelize[_0x7064('0x6')]},'providerResponse':{'type':Sequelize[_0x7064('0x1')]}};
\ No newline at end of file
index b069a4c..8fca236 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x24fb=['interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','agent','fullname','email','internal','manual','interface','channel','motionChannel','EventManager','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SIP/%s','event','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./openchannelMessage.socket','register','jayson/promise','client','http','then','info','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','sendStatus','stack','name','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','show','include','options','find','create','body','describe','../../config/logger','accept','openchannel','read','readAt','format','UserId','user','params','get','OpenchannelInteraction','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x40f4c1,_0x3490b9){var _0x31a93e=function(_0xf56258){while(--_0xf56258){_0x40f4c1['push'](_0x40f4c1['shift']());}};_0x31a93e(++_0x3490b9);}(_0x24fb,0x121));var _0xb24f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x24fb[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb24f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb24f('0x1'));var rp=require(_0xb24f('0x2'));var moment=require(_0xb24f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb24f('0x4'));var path=require('path');var sox=require(_0xb24f('0x5'));var csv=require(_0xb24f('0x6'));var ejs=require(_0xb24f('0x7'));var fs=require('fs');var fs_extra=require(_0xb24f('0x8'));var _=require(_0xb24f('0x9'));var squel=require('squel');var crypto=require(_0xb24f('0xa'));var jsforce=require(_0xb24f('0xb'));var deskjs=require(_0xb24f('0xc'));var toCsv=require(_0xb24f('0x6'));var querystring=require(_0xb24f('0xd'));var Papa=require(_0xb24f('0xe'));var Redis=require(_0xb24f('0xf'));var authService=require(_0xb24f('0x10'));var qs=require(_0xb24f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb24f('0x12'));var utils=require(_0xb24f('0x13'));var config=require(_0xb24f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb24f('0x15'))['db'];config['redis']=_[_0xb24f('0x16')](config[_0xb24f('0x17')],{'host':_0xb24f('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb24f('0x17')]));require(_0xb24f('0x19'))[_0xb24f('0x1a')](socket);var jayson=require(_0xb24f('0x1b'));var client=jayson[_0xb24f('0x1c')][_0xb24f('0x1d')]({'port':0x232c});var client9002=jayson[_0xb24f('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1342fd,_0x59c238,_0x2d4bdd,_0x4b1418){return new BPromise(function(_0x294441,_0x9b4cba){var _0x5bcf4b=_0x4b1418||client;return _0x5bcf4b['request'](_0x1342fd,_0x2d4bdd)[_0xb24f('0x1e')](function(_0x4a80f7){logger[_0xb24f('0x1f')]('OpenchannelMessage,\x20%s,\x20%s',_0x59c238,_0xb24f('0x20'));logger['debug'](_0xb24f('0x21'),_0x59c238,_0xb24f('0x20'),JSON[_0xb24f('0x22')](_0x4a80f7));if(_0x4a80f7[_0xb24f('0x23')]){if(_0x4a80f7[_0xb24f('0x23')]['code']===0x1f4){logger[_0xb24f('0x23')](_0xb24f('0x24'),_0x59c238,_0x4a80f7[_0xb24f('0x23')]['message']);return _0x9b4cba(_0x4a80f7[_0xb24f('0x23')]['message']);}logger[_0xb24f('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x59c238,_0x4a80f7[_0xb24f('0x23')][_0xb24f('0x25')]);return _0x294441(_0x4a80f7[_0xb24f('0x23')]['message']);}else{logger[_0xb24f('0x1f')](_0xb24f('0x24'),_0x59c238,_0xb24f('0x20'));_0x294441(_0x4a80f7[_0xb24f('0x26')]['message']);}})[_0xb24f('0x27')](function(_0x309c17){logger[_0xb24f('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x59c238,_0x309c17);_0x9b4cba(_0x309c17);});});}function respondWithStatusCode(_0x488268,_0x996e82){_0x996e82=_0x996e82||0xcc;return function(_0x76bb66){if(_0x76bb66){return _0x488268['sendStatus'](_0x996e82);}return _0x488268['status'](_0x996e82)[_0xb24f('0x28')]();};}function respondWithResult(_0x4dda34,_0x5ddf95){_0x5ddf95=_0x5ddf95||0xc8;return function(_0x5e38f0){if(_0x5e38f0){return _0x4dda34[_0xb24f('0x29')](_0x5ddf95)[_0xb24f('0x2a')](_0x5e38f0);}};}function respondWithFilteredResult(_0xcd6a5c,_0x59558c){return function(_0xc9d402){if(_0xc9d402){var _0x5333c0=typeof _0x59558c[_0xb24f('0x2b')]===_0xb24f('0x2c')&&typeof _0x59558c[_0xb24f('0x2d')]===_0xb24f('0x2c');var _0x558ffb=_0xc9d402[_0xb24f('0x2e')];var _0x13f9e9=_0x5333c0?0x0:_0x59558c[_0xb24f('0x2b')];var _0x242713=_0x5333c0?_0xc9d402['count']:_0x59558c[_0xb24f('0x2b')]+_0x59558c[_0xb24f('0x2d')];var _0x2ac4da;if(_0x242713>=_0x558ffb){_0x242713=_0x558ffb;_0x2ac4da=0xc8;}else{_0x2ac4da=0xce;}_0xcd6a5c['status'](_0x2ac4da);return _0xcd6a5c[_0xb24f('0x2f')](_0xb24f('0x30'),_0x13f9e9+'-'+_0x242713+'/'+_0x558ffb)[_0xb24f('0x2a')](_0xc9d402);}return null;};}function patchUpdates(_0xf306f3){return function(_0xb1a09b){try{jsonpatch['apply'](_0xb1a09b,_0xf306f3,!![]);}catch(_0x37f434){return BPromise[_0xb24f('0x31')](_0x37f434);}return _0xb1a09b[_0xb24f('0x32')]();};}function saveUpdates(_0x3d0501,_0x715d34){return function(_0x1669ff){if(_0x1669ff){return _0x1669ff[_0xb24f('0x33')](_0x3d0501)['then'](function(_0x328eb0){return _0x328eb0;});}return null;};}function removeEntity(_0x246ee5,_0x4e59f6){return function(_0x1c7fe5){if(_0x1c7fe5){return _0x1c7fe5[_0xb24f('0x34')]()['then'](function(){_0x246ee5[_0xb24f('0x29')](0xcc)[_0xb24f('0x28')]();});}};}function handleEntityNotFound(_0x8d4808,_0xa9567b){return function(_0x3be407){if(!_0x3be407){_0x8d4808[_0xb24f('0x35')](0x194);}return _0x3be407;};}function handleError(_0xac6251,_0x2c2b04){_0x2c2b04=_0x2c2b04||0x1f4;return function(_0x35b2d9){logger[_0xb24f('0x23')](_0x35b2d9[_0xb24f('0x36')]);if(_0x35b2d9['name']){delete _0x35b2d9[_0xb24f('0x37')];}_0xac6251[_0xb24f('0x29')](_0x2c2b04)['send'](_0x35b2d9);};}exports[_0xb24f('0x38')]=function(_0xd85ff8,_0x4fb4d0){var _0x4dcfe2={},_0x6b6fe4={},_0x4c6e1e={'count':0x0,'rows':[]};var _0x443098=_[_0xb24f('0x39')](db[_0xb24f('0x3a')][_0xb24f('0x3b')],function(_0x373b2d){return{'name':_0x373b2d[_0xb24f('0x3c')],'type':_0x373b2d[_0xb24f('0x3d')][_0xb24f('0x3e')]};});_0x6b6fe4[_0xb24f('0x3f')]=_[_0xb24f('0x39')](_0x443098,_0xb24f('0x37'));_0x6b6fe4['query']=_[_0xb24f('0x40')](_0xd85ff8[_0xb24f('0x41')]);_0x6b6fe4[_0xb24f('0x42')]=_[_0xb24f('0x43')](_0x6b6fe4[_0xb24f('0x3f')],_0x6b6fe4['query']);_0x4dcfe2[_0xb24f('0x44')]=_[_0xb24f('0x43')](_0x6b6fe4['model'],qs[_0xb24f('0x45')](_0xd85ff8[_0xb24f('0x41')][_0xb24f('0x45')]));_0x4dcfe2['attributes']=_0x4dcfe2[_0xb24f('0x44')][_0xb24f('0x46')]?_0x4dcfe2[_0xb24f('0x44')]:_0x6b6fe4[_0xb24f('0x3f')];if(!_0xd85ff8[_0xb24f('0x41')][_0xb24f('0x47')](_0xb24f('0x48'))){_0x4dcfe2[_0xb24f('0x2d')]=qs[_0xb24f('0x2d')](_0xd85ff8[_0xb24f('0x41')][_0xb24f('0x2d')]);_0x4dcfe2[_0xb24f('0x2b')]=qs['offset'](_0xd85ff8['query'][_0xb24f('0x2b')]);}_0x4dcfe2[_0xb24f('0x49')]=qs[_0xb24f('0x4a')](_0xd85ff8[_0xb24f('0x41')]['sort']);_0x4dcfe2[_0xb24f('0x4b')]=qs[_0xb24f('0x42')](_[_0xb24f('0x4c')](_0xd85ff8[_0xb24f('0x41')],_0x6b6fe4['filters']),_0x443098);if(_0xd85ff8['query'][_0xb24f('0x4d')]){_0x4dcfe2[_0xb24f('0x4b')]=_[_0xb24f('0x4e')](_0x4dcfe2['where'],{'$or':_[_0xb24f('0x39')](_0x443098,function(_0x110e65){if(_0x110e65[_0xb24f('0x3d')]!==_0xb24f('0x4f')){var _0x1d3a62={};_0x1d3a62[_0x110e65[_0xb24f('0x37')]]={'$like':'%'+_0xd85ff8[_0xb24f('0x41')][_0xb24f('0x4d')]+'%'};return _0x1d3a62;}})});}_0x4dcfe2=_['merge']({},_0x4dcfe2,_0xd85ff8['options']);var _0x31a605={'where':_0x4dcfe2[_0xb24f('0x4b')]};return db['OpenchannelMessage'][_0xb24f('0x2e')](_0x31a605)[_0xb24f('0x1e')](function(_0x1efc2a){_0x4c6e1e['count']=_0x1efc2a;if(_0xd85ff8[_0xb24f('0x41')][_0xb24f('0x50')]){_0x4dcfe2['include']=[{'all':!![]}];}return db[_0xb24f('0x3a')][_0xb24f('0x51')](_0x4dcfe2);})[_0xb24f('0x1e')](function(_0x33ce44){_0x4c6e1e['rows']=_0x33ce44;return _0x4c6e1e;})[_0xb24f('0x1e')](respondWithFilteredResult(_0x4fb4d0,_0x4dcfe2))[_0xb24f('0x27')](handleError(_0x4fb4d0,null));};exports[_0xb24f('0x52')]=function(_0x48e3d9,_0xfcf1e2){var _0x1eb121={'raw':!![],'where':{'id':_0x48e3d9['params']['id']}},_0x46ec47={};_0x46ec47['model']=_[_0xb24f('0x40')](db['OpenchannelMessage'][_0xb24f('0x3b')]);_0x46ec47[_0xb24f('0x41')]=_[_0xb24f('0x40')](_0x48e3d9[_0xb24f('0x41')]);_0x46ec47['filters']=_[_0xb24f('0x43')](_0x46ec47[_0xb24f('0x3f')],_0x46ec47[_0xb24f('0x41')]);_0x1eb121[_0xb24f('0x44')]=_['intersection'](_0x46ec47[_0xb24f('0x3f')],qs[_0xb24f('0x45')](_0x48e3d9[_0xb24f('0x41')]['fields']));_0x1eb121['attributes']=_0x1eb121[_0xb24f('0x44')]['length']?_0x1eb121[_0xb24f('0x44')]:_0x46ec47[_0xb24f('0x3f')];if(_0x48e3d9[_0xb24f('0x41')][_0xb24f('0x50')]){_0x1eb121[_0xb24f('0x53')]=[{'all':!![]}];}_0x1eb121=_[_0xb24f('0x4e')]({},_0x1eb121,_0x48e3d9[_0xb24f('0x54')]);return db['OpenchannelMessage'][_0xb24f('0x55')](_0x1eb121)[_0xb24f('0x1e')](handleEntityNotFound(_0xfcf1e2,null))[_0xb24f('0x1e')](respondWithResult(_0xfcf1e2,null))['catch'](handleError(_0xfcf1e2,null));};exports[_0xb24f('0x56')]=function(_0x22d058,_0x233047){return db['OpenchannelMessage'][_0xb24f('0x56')](_0x22d058[_0xb24f('0x57')],{})[_0xb24f('0x1e')](respondWithResult(_0x233047,0xc9))['catch'](handleError(_0x233047,null));};exports[_0xb24f('0x33')]=function(_0x422cf9,_0xdccb48){if(_0x422cf9[_0xb24f('0x57')]['id']){delete _0x422cf9['body']['id'];}return db[_0xb24f('0x3a')][_0xb24f('0x55')]({'where':{'id':_0x422cf9['params']['id']}})[_0xb24f('0x1e')](handleEntityNotFound(_0xdccb48,null))[_0xb24f('0x1e')](saveUpdates(_0x422cf9[_0xb24f('0x57')],null))[_0xb24f('0x1e')](respondWithResult(_0xdccb48,null))['catch'](handleError(_0xdccb48,null));};exports[_0xb24f('0x34')]=function(_0x532c22,_0x53da7b){return db[_0xb24f('0x3a')][_0xb24f('0x55')]({'where':{'id':_0x532c22['params']['id']}})['then'](handleEntityNotFound(_0x53da7b,null))[_0xb24f('0x1e')](removeEntity(_0x53da7b,null))[_0xb24f('0x27')](handleError(_0x53da7b,null));};exports[_0xb24f('0x58')]=function(_0x558a79,_0x106836){return db[_0xb24f('0x3a')][_0xb24f('0x58')]()[_0xb24f('0x1e')](respondWithResult(_0x106836,null))[_0xb24f('0x27')](handleError(_0x106836,null));};var interaction_log=require(_0xb24f('0x59'))('openchannel-interactions');exports[_0xb24f('0x5a')]=function(_0x5891f0,_0x107723,_0x4f4cc1){var _0x4f4a4f={'agent':{},'channel':_0xb24f('0x5b')};if(_0x5891f0[_0xb24f('0x57')]['id']){delete _0x5891f0[_0xb24f('0x57')]['id'];}_0x5891f0[_0xb24f('0x57')][_0xb24f('0x5c')]=!![];_0x5891f0['body'][_0xb24f('0x5d')]=moment()[_0xb24f('0x5e')]('YYYY-MM-DD\x20HH:mm:ss');_0x5891f0[_0xb24f('0x57')][_0xb24f('0x5f')]=_0x5891f0[_0xb24f('0x57')][_0xb24f('0x5f')]||_0x5891f0[_0xb24f('0x60')]['id'];_0x4f4a4f['agent']['id']=_0x5891f0[_0xb24f('0x57')][_0xb24f('0x5f')];return db[_0xb24f('0x3a')][_0xb24f('0x55')]({'where':{'id':_0x5891f0[_0xb24f('0x61')]['id'],'UserId':null}})[_0xb24f('0x1e')](handleEntityNotFound(_0x107723,null))['then'](saveUpdates(_0x5891f0['body'],null))[_0xb24f('0x1e')](function(_0x31e94e){if(_0x31e94e){_0x4f4a4f[_0xb24f('0x25')]=_0x31e94e[_0xb24f('0x62')]({'plain':!![]});return db[_0xb24f('0x63')][_0xb24f('0x55')]({'where':{'id':_0x31e94e['OpenchannelInteractionId']}});}return null;})[_0xb24f('0x1e')](handleEntityNotFound(_0x107723,null))[_0xb24f('0x1e')](function(_0x5585da){if(_0x5585da){return _0x5585da[_0xb24f('0x33')]({'UserId':_0x5891f0[_0xb24f('0x57')]['UserId'],'read1stAt':_[_0xb24f('0x64')](_0x5585da[_0xb24f('0x65')])?moment()[_0xb24f('0x5e')](_0xb24f('0x66')):undefined});}return null;})[_0xb24f('0x1e')](function(_0xa47ada){if(_0xa47ada){_0x4f4a4f['interaction']=_0xa47ada[_0xb24f('0x62')]({'plain':!![]});interaction_log[_0xb24f('0x1f')](_0xb24f('0x67'),_0x5891f0[_0xb24f('0x60')]['id'],_0x5891f0[_0xb24f('0x60')]['name'],_0x5891f0[_0xb24f('0x60')]['role'],_0x4f4a4f[_0xb24f('0x68')]['id'],_0x5891f0[_0xb24f('0x57')]?JSON['stringify'](_0x5891f0[_0xb24f('0x57')]):_0xb24f('0x69'));return respondWithRpcPromise(_0xb24f('0x6a'),_0xb24f('0x6b'),_0x4f4a4f);}return null;})[_0xb24f('0x1e')](function(_0xdfd0b9){var _0x29ca4f=_0xb24f('0x6c')+_0xdfd0b9['message'][_0xb24f('0x6d')];return db[_0xb24f('0x6e')]['query'](_0x29ca4f,{'type':db[_0xb24f('0x6f')][_0xb24f('0x70')][_0xb24f('0x71')],'raw':!![]})[_0xb24f('0x1e')](function(_0x510a9c){return _0x510a9c;});})['then'](function(_0x16e1f6){if(_0x16e1f6){_0x4f4a4f[_0xb24f('0x25')][_0xb24f('0x72')]=_0x16e1f6[0x0];if(!_0x5891f0['body']['UserId'])return;return db['User'][_0xb24f('0x55')]({'where':{'id':_0x5891f0['body'][_0xb24f('0x5f')],'role':_0xb24f('0x73')},'attributes':['id','name',_0xb24f('0x74'),_0xb24f('0x75'),_0xb24f('0x76')],'raw':!![]});}return null;})[_0xb24f('0x1e')](function(_0x31a007){if(!_0x31a007)return null;_0x4f4a4f[_0xb24f('0x25')][_0xb24f('0x73')]=_0x31a007;return _0x4f4a4f;})[_0xb24f('0x1e')](function(_0x5e013f){if(_0x5e013f){if(_0x5891f0['body'][_0xb24f('0x77')]){_0x4f4a4f['message'][_0xb24f('0x78')]=util['format']('SIP/%s',_0x5891f0[_0xb24f('0x60')][_0xb24f('0x37')]);_0x4f4a4f[_0xb24f('0x25')][_0xb24f('0x79')]=_0x4f4a4f['channel'];_0x4f4a4f['message'][_0xb24f('0x7a')]=_0x4f4a4f['channel'];_0x4f4a4f[_0xb24f('0x25')]['event']=_0xb24f('0x5a');return respondWithRpcPromise(_0xb24f('0x7b'),_0xb24f('0x7b'),{'event':'acceptmessage','message':_0x4f4a4f[_0xb24f('0x25')]},client9002)[_0xb24f('0x1e')](function(){return _0x4f4a4f;});}return _0x4f4a4f;}return null;})[_0xb24f('0x1e')](respondWithResult(_0x107723,null))['catch'](handleError(_0x107723,null));};var interaction_log=require(_0xb24f('0x59'))('openchannel-interactions');exports[_0xb24f('0x31')]=function(_0x575237,_0x4a161b,_0x376c71){var _0x29845b={'agent':{},'channel':'openchannel'};if(_0x575237[_0xb24f('0x57')]['id']){delete _0x575237[_0xb24f('0x57')]['id'];}_0x575237[_0xb24f('0x57')][_0xb24f('0x5f')]=_0x575237[_0xb24f('0x57')][_0xb24f('0x5f')]||_0x575237[_0xb24f('0x60')]['id'];_0x29845b['agent']['id']=_0x575237[_0xb24f('0x57')][_0xb24f('0x5f')];return db[_0xb24f('0x3a')][_0xb24f('0x55')]({'where':{'id':_0x575237[_0xb24f('0x61')]['id'],'UserId':null}})[_0xb24f('0x1e')](handleEntityNotFound(_0x4a161b,null))[_0xb24f('0x1e')](function(_0x1d6012){if(_0x1d6012){_0x29845b[_0xb24f('0x25')]=_0x1d6012['get']({'plain':!![]});return db[_0xb24f('0x63')]['find']({'where':{'id':_0x1d6012[_0xb24f('0x7c')]}});}return null;})[_0xb24f('0x1e')](handleEntityNotFound(_0x4a161b,null))[_0xb24f('0x1e')](function(_0x36529e){if(_0x36529e){_0x29845b['interaction']=_0x36529e[_0xb24f('0x62')]({'plain':!![]});interaction_log[_0xb24f('0x1f')](_0xb24f('0x7d'),_0x575237[_0xb24f('0x60')]['id'],_0x575237[_0xb24f('0x60')][_0xb24f('0x37')],_0x575237[_0xb24f('0x60')][_0xb24f('0x7e')],_0x29845b[_0xb24f('0x68')]['id'],_0x575237['body']?JSON['stringify'](_0x575237[_0xb24f('0x57')]):_0xb24f('0x69'));return respondWithRpcPromise(_0xb24f('0x7f'),_0xb24f('0x80'),_0x29845b);}return null;})['then'](function(_0x480936){var _0x320e9f=_0xb24f('0x6c')+_0x480936[_0xb24f('0x25')]['ContactId'];return db[_0xb24f('0x6e')][_0xb24f('0x41')](_0x320e9f,{'type':db[_0xb24f('0x6f')]['QueryTypes'][_0xb24f('0x71')],'raw':!![]})[_0xb24f('0x1e')](function(_0x373c67){return _0x373c67;});})[_0xb24f('0x1e')](function(_0x39f452){if(_0x39f452){_0x29845b[_0xb24f('0x25')][_0xb24f('0x72')]=_0x39f452[0x0];if(!_0x575237['body']['UserId'])return;return db['User'][_0xb24f('0x55')]({'where':{'id':_0x575237['body'][_0xb24f('0x5f')],'role':_0xb24f('0x73')},'attributes':['id',_0xb24f('0x37'),_0xb24f('0x74'),_0xb24f('0x75'),_0xb24f('0x76')],'raw':!![]});}return null;})[_0xb24f('0x1e')](function(_0x4dd493){if(!_0x4dd493)return null;_0x29845b[_0xb24f('0x25')][_0xb24f('0x73')]=_0x4dd493;return _0x29845b;})[_0xb24f('0x1e')](function(_0x14867d){if(_0x14867d){_0x14867d[_0xb24f('0x25')]['interface']=util[_0xb24f('0x5e')](_0xb24f('0x81'),_0x575237[_0xb24f('0x60')][_0xb24f('0x37')]);_0x14867d[_0xb24f('0x25')]['channel']=_0x29845b[_0xb24f('0x79')];_0x14867d['message'][_0xb24f('0x7a')]=_0x29845b['channel'];_0x14867d['message'][_0xb24f('0x82')]=_0xb24f('0x31');respondWithRpcPromise(_0xb24f('0x7b'),_0xb24f('0x7b'),{'event':'rejectmessage','message':_0x14867d[_0xb24f('0x25')]},client9002);return _0x29845b;}return null;})[_0xb24f('0x1e')](respondWithResult(_0x4a161b,null))['catch'](handleError(_0x4a161b,null));};
\ No newline at end of file
+var _0x5309=['UserId','user','agent','find','get','OpenchannelInteraction','read1stAt','format','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','sequelize','Sequelize','SELECT','contact','User','fullname','interface','channel','acceptmessage','OpenchannelInteractionId','null','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','QueryTypes','email','internal','SIP/%s','motionChannel','EventManager','rejectmessage','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','offset','undefined','count','limit','set','json','apply','reject','save','destroy','end','stack','name','send','index','map','OpenchannelMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','merge','filter','options','includeAll','findAll','rows','catch','show','params','create','update','body','describe','openchannel-interactions','accept','openchannel','read','readAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3affe2,_0x116968){var _0x4470f6=function(_0x64b626){while(--_0x64b626){_0x3affe2['push'](_0x3affe2['shift']());}};_0x4470f6(++_0x116968);}(_0x5309,0x125));var _0x9530=function(_0xdd827a,_0x482ad2){_0xdd827a=_0xdd827a-0x0;var _0x2f46f1=_0x5309[_0xdd827a];return _0x2f46f1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9530('0x0'));var zipdir=require(_0x9530('0x1'));var jsonpatch=require(_0x9530('0x2'));var rp=require(_0x9530('0x3'));var moment=require(_0x9530('0x4'));var BPromise=require(_0x9530('0x5'));var Mustache=require(_0x9530('0x6'));var util=require('util');var path=require('path');var sox=require(_0x9530('0x7'));var csv=require(_0x9530('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9530('0x9'));var _=require(_0x9530('0xa'));var squel=require(_0x9530('0xb'));var crypto=require(_0x9530('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9530('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9530('0xe'));var Papa=require(_0x9530('0xf'));var Redis=require(_0x9530('0x10'));var authService=require(_0x9530('0x11'));var qs=require(_0x9530('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9530('0x13'));var logger=require(_0x9530('0x14'))(_0x9530('0x15'));var utils=require('../../config/utils');var config=require(_0x9530('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9530('0x17'))['db'];config[_0x9530('0x18')]=_[_0x9530('0x19')](config['redis'],{'host':_0x9530('0x1a'),'port':0x18eb});var socket=require(_0x9530('0x1b'))(new Redis(config[_0x9530('0x18')]));require(_0x9530('0x1c'))[_0x9530('0x1d')](socket);var jayson=require(_0x9530('0x1e'));var client=jayson[_0x9530('0x1f')][_0x9530('0x20')]({'port':0x232c});var client9002=jayson['client'][_0x9530('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x2df9a1,_0x3d3906,_0x4fa991,_0x3933b2){return new BPromise(function(_0x29ec4d,_0x23af5e){var _0x58abb8=_0x3933b2||client;return _0x58abb8[_0x9530('0x21')](_0x2df9a1,_0x4fa991)[_0x9530('0x22')](function(_0xee0efb){logger[_0x9530('0x23')](_0x9530('0x24'),_0x3d3906,_0x9530('0x25'));logger[_0x9530('0x26')](_0x9530('0x27'),_0x3d3906,_0x9530('0x25'),JSON[_0x9530('0x28')](_0xee0efb));if(_0xee0efb['error']){if(_0xee0efb['error']['code']===0x1f4){logger[_0x9530('0x29')](_0x9530('0x24'),_0x3d3906,_0xee0efb[_0x9530('0x29')]['message']);return _0x23af5e(_0xee0efb[_0x9530('0x29')][_0x9530('0x2a')]);}logger[_0x9530('0x29')](_0x9530('0x24'),_0x3d3906,_0xee0efb[_0x9530('0x29')]['message']);return _0x29ec4d(_0xee0efb[_0x9530('0x29')][_0x9530('0x2a')]);}else{logger['info'](_0x9530('0x24'),_0x3d3906,'request\x20sent');_0x29ec4d(_0xee0efb[_0x9530('0x2b')][_0x9530('0x2a')]);}})['catch'](function(_0x2121c0){logger['error'](_0x9530('0x24'),_0x3d3906,_0x2121c0);_0x23af5e(_0x2121c0);});});}function respondWithStatusCode(_0x582930,_0x4ff6f5){_0x4ff6f5=_0x4ff6f5||0xcc;return function(_0x592d7b){if(_0x592d7b){return _0x582930[_0x9530('0x2c')](_0x4ff6f5);}return _0x582930[_0x9530('0x2d')](_0x4ff6f5)['end']();};}function respondWithResult(_0xd1caeb,_0x3679e){_0x3679e=_0x3679e||0xc8;return function(_0x1e6b68){if(_0x1e6b68){return _0xd1caeb[_0x9530('0x2d')](_0x3679e)['json'](_0x1e6b68);}};}function respondWithFilteredResult(_0x29489f,_0x13c4b8){return function(_0x3e5e1f){if(_0x3e5e1f){var _0x371d89=typeof _0x13c4b8[_0x9530('0x2e')]===_0x9530('0x2f')&&typeof _0x13c4b8['limit']===_0x9530('0x2f');var _0x21e961=_0x3e5e1f[_0x9530('0x30')];var _0x480e7f=_0x371d89?0x0:_0x13c4b8[_0x9530('0x2e')];var _0x5af477=_0x371d89?_0x3e5e1f[_0x9530('0x30')]:_0x13c4b8[_0x9530('0x2e')]+_0x13c4b8[_0x9530('0x31')];var _0x1868de;if(_0x5af477>=_0x21e961){_0x5af477=_0x21e961;_0x1868de=0xc8;}else{_0x1868de=0xce;}_0x29489f[_0x9530('0x2d')](_0x1868de);return _0x29489f[_0x9530('0x32')]('Content-Range',_0x480e7f+'-'+_0x5af477+'/'+_0x21e961)[_0x9530('0x33')](_0x3e5e1f);}return null;};}function patchUpdates(_0x24fa25){return function(_0x3458aa){try{jsonpatch[_0x9530('0x34')](_0x3458aa,_0x24fa25,!![]);}catch(_0x57e1ae){return BPromise[_0x9530('0x35')](_0x57e1ae);}return _0x3458aa[_0x9530('0x36')]();};}function saveUpdates(_0x487dff,_0x329de1){return function(_0x28db4a){if(_0x28db4a){return _0x28db4a['update'](_0x487dff)[_0x9530('0x22')](function(_0x2b0f49){return _0x2b0f49;});}return null;};}function removeEntity(_0xf7bea3,_0x51826d){return function(_0x582c2d){if(_0x582c2d){return _0x582c2d[_0x9530('0x37')]()[_0x9530('0x22')](function(){_0xf7bea3['status'](0xcc)[_0x9530('0x38')]();});}};}function handleEntityNotFound(_0x1337fc,_0x7e91f8){return function(_0x331301){if(!_0x331301){_0x1337fc[_0x9530('0x2c')](0x194);}return _0x331301;};}function handleError(_0x35725a,_0x1ca932){_0x1ca932=_0x1ca932||0x1f4;return function(_0x2675f6){logger['error'](_0x2675f6[_0x9530('0x39')]);if(_0x2675f6[_0x9530('0x3a')]){delete _0x2675f6[_0x9530('0x3a')];}_0x35725a[_0x9530('0x2d')](_0x1ca932)[_0x9530('0x3b')](_0x2675f6);};}exports[_0x9530('0x3c')]=function(_0x351fad,_0x3f01a7){var _0x3a6b42={},_0x20b865={},_0x53e945={'count':0x0,'rows':[]};var _0x43dd47=_[_0x9530('0x3d')](db[_0x9530('0x3e')][_0x9530('0x3f')],function(_0x44c99c){return{'name':_0x44c99c['fieldName'],'type':_0x44c99c[_0x9530('0x40')][_0x9530('0x41')]};});_0x20b865[_0x9530('0x42')]=_[_0x9530('0x3d')](_0x43dd47,_0x9530('0x3a'));_0x20b865[_0x9530('0x43')]=_[_0x9530('0x44')](_0x351fad['query']);_0x20b865[_0x9530('0x45')]=_[_0x9530('0x46')](_0x20b865['model'],_0x20b865[_0x9530('0x43')]);_0x3a6b42[_0x9530('0x47')]=_['intersection'](_0x20b865['model'],qs[_0x9530('0x48')](_0x351fad[_0x9530('0x43')][_0x9530('0x48')]));_0x3a6b42['attributes']=_0x3a6b42['attributes'][_0x9530('0x49')]?_0x3a6b42[_0x9530('0x47')]:_0x20b865[_0x9530('0x42')];if(!_0x351fad[_0x9530('0x43')]['hasOwnProperty']('nolimit')){_0x3a6b42[_0x9530('0x31')]=qs['limit'](_0x351fad['query'][_0x9530('0x31')]);_0x3a6b42[_0x9530('0x2e')]=qs[_0x9530('0x2e')](_0x351fad[_0x9530('0x43')]['offset']);}_0x3a6b42[_0x9530('0x4a')]=qs['sort'](_0x351fad[_0x9530('0x43')][_0x9530('0x4b')]);_0x3a6b42[_0x9530('0x4c')]=qs[_0x9530('0x45')](_[_0x9530('0x4d')](_0x351fad[_0x9530('0x43')],_0x20b865['filters']),_0x43dd47);if(_0x351fad[_0x9530('0x43')]['filter']){_0x3a6b42['where']=_[_0x9530('0x4e')](_0x3a6b42[_0x9530('0x4c')],{'$or':_[_0x9530('0x3d')](_0x43dd47,function(_0x1966ea){if(_0x1966ea[_0x9530('0x40')]!=='VIRTUAL'){var _0x1b6cda={};_0x1b6cda[_0x1966ea['name']]={'$like':'%'+_0x351fad[_0x9530('0x43')][_0x9530('0x4f')]+'%'};return _0x1b6cda;}})});}_0x3a6b42=_['merge']({},_0x3a6b42,_0x351fad[_0x9530('0x50')]);var _0x4f816b={'where':_0x3a6b42[_0x9530('0x4c')]};return db[_0x9530('0x3e')][_0x9530('0x30')](_0x4f816b)[_0x9530('0x22')](function(_0x42cf41){_0x53e945['count']=_0x42cf41;if(_0x351fad[_0x9530('0x43')][_0x9530('0x51')]){_0x3a6b42['include']=[{'all':!![]}];}return db[_0x9530('0x3e')][_0x9530('0x52')](_0x3a6b42);})[_0x9530('0x22')](function(_0xa4d609){_0x53e945[_0x9530('0x53')]=_0xa4d609;return _0x53e945;})[_0x9530('0x22')](respondWithFilteredResult(_0x3f01a7,_0x3a6b42))[_0x9530('0x54')](handleError(_0x3f01a7,null));};exports[_0x9530('0x55')]=function(_0x55a133,_0x2e05e1){var _0x361425={'raw':!![],'where':{'id':_0x55a133[_0x9530('0x56')]['id']}},_0x1379cf={};_0x1379cf[_0x9530('0x42')]=_['keys'](db[_0x9530('0x3e')][_0x9530('0x3f')]);_0x1379cf[_0x9530('0x43')]=_[_0x9530('0x44')](_0x55a133['query']);_0x1379cf[_0x9530('0x45')]=_[_0x9530('0x46')](_0x1379cf[_0x9530('0x42')],_0x1379cf['query']);_0x361425[_0x9530('0x47')]=_['intersection'](_0x1379cf[_0x9530('0x42')],qs[_0x9530('0x48')](_0x55a133[_0x9530('0x43')]['fields']));_0x361425[_0x9530('0x47')]=_0x361425[_0x9530('0x47')]['length']?_0x361425[_0x9530('0x47')]:_0x1379cf['model'];if(_0x55a133['query']['includeAll']){_0x361425['include']=[{'all':!![]}];}_0x361425=_[_0x9530('0x4e')]({},_0x361425,_0x55a133['options']);return db[_0x9530('0x3e')]['find'](_0x361425)[_0x9530('0x22')](handleEntityNotFound(_0x2e05e1,null))[_0x9530('0x22')](respondWithResult(_0x2e05e1,null))[_0x9530('0x54')](handleError(_0x2e05e1,null));};exports[_0x9530('0x57')]=function(_0xff871a,_0x2a7c17){return db[_0x9530('0x3e')]['create'](_0xff871a['body'],{})['then'](respondWithResult(_0x2a7c17,0xc9))[_0x9530('0x54')](handleError(_0x2a7c17,null));};exports[_0x9530('0x58')]=function(_0x3b7369,_0x414437){if(_0x3b7369[_0x9530('0x59')]['id']){delete _0x3b7369[_0x9530('0x59')]['id'];}return db[_0x9530('0x3e')]['find']({'where':{'id':_0x3b7369[_0x9530('0x56')]['id']}})[_0x9530('0x22')](handleEntityNotFound(_0x414437,null))[_0x9530('0x22')](saveUpdates(_0x3b7369['body'],null))[_0x9530('0x22')](respondWithResult(_0x414437,null))[_0x9530('0x54')](handleError(_0x414437,null));};exports[_0x9530('0x37')]=function(_0x3be263,_0x41d0c6){return db[_0x9530('0x3e')]['find']({'where':{'id':_0x3be263[_0x9530('0x56')]['id']}})[_0x9530('0x22')](handleEntityNotFound(_0x41d0c6,null))[_0x9530('0x22')](removeEntity(_0x41d0c6,null))['catch'](handleError(_0x41d0c6,null));};exports['describe']=function(_0xbfe260,_0xc30f9a){return db[_0x9530('0x3e')][_0x9530('0x5a')]()[_0x9530('0x22')](respondWithResult(_0xc30f9a,null))[_0x9530('0x54')](handleError(_0xc30f9a,null));};var interaction_log=require('../../config/logger')(_0x9530('0x5b'));exports[_0x9530('0x5c')]=function(_0x439b2a,_0x57b8ca,_0x6aee55){var _0x5f4e44={'agent':{},'channel':_0x9530('0x5d')};if(_0x439b2a['body']['id']){delete _0x439b2a[_0x9530('0x59')]['id'];}_0x439b2a[_0x9530('0x59')][_0x9530('0x5e')]=!![];_0x439b2a[_0x9530('0x59')][_0x9530('0x5f')]=moment()['format'](_0x9530('0x60'));_0x439b2a[_0x9530('0x59')][_0x9530('0x61')]=_0x439b2a[_0x9530('0x59')][_0x9530('0x61')]||_0x439b2a[_0x9530('0x62')]['id'];_0x5f4e44[_0x9530('0x63')]['id']=_0x439b2a[_0x9530('0x59')][_0x9530('0x61')];return db[_0x9530('0x3e')][_0x9530('0x64')]({'where':{'id':_0x439b2a['params']['id'],'UserId':null}})[_0x9530('0x22')](handleEntityNotFound(_0x57b8ca,null))[_0x9530('0x22')](saveUpdates(_0x439b2a['body'],null))[_0x9530('0x22')](function(_0x2cdaf2){if(_0x2cdaf2){_0x5f4e44[_0x9530('0x2a')]=_0x2cdaf2[_0x9530('0x65')]({'plain':!![]});return db[_0x9530('0x66')][_0x9530('0x64')]({'where':{'id':_0x2cdaf2['OpenchannelInteractionId']}});}return null;})[_0x9530('0x22')](handleEntityNotFound(_0x57b8ca,null))[_0x9530('0x22')](function(_0x29c548){if(_0x29c548){return _0x29c548[_0x9530('0x58')]({'UserId':_0x439b2a[_0x9530('0x59')][_0x9530('0x61')],'read1stAt':_['isNil'](_0x29c548[_0x9530('0x67')])?moment()[_0x9530('0x68')](_0x9530('0x60')):undefined});}return null;})[_0x9530('0x22')](function(_0x64fe49){if(_0x64fe49){_0x5f4e44[_0x9530('0x69')]=_0x64fe49['get']({'plain':!![]});interaction_log[_0x9530('0x23')](_0x9530('0x6a'),_0x439b2a[_0x9530('0x62')]['id'],_0x439b2a[_0x9530('0x62')][_0x9530('0x3a')],_0x439b2a['user'][_0x9530('0x6b')],_0x5f4e44[_0x9530('0x69')]['id'],_0x439b2a[_0x9530('0x59')]?JSON[_0x9530('0x28')](_0x439b2a[_0x9530('0x59')]):'null');return respondWithRpcPromise('AcceptMessage',_0x9530('0x6c'),_0x5f4e44);}return null;})[_0x9530('0x22')](function(_0x28e30e){var _0x6cbacb='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x28e30e[_0x9530('0x2a')]['ContactId'];return db[_0x9530('0x6d')][_0x9530('0x43')](_0x6cbacb,{'type':db[_0x9530('0x6e')]['QueryTypes'][_0x9530('0x6f')],'raw':!![]})['then'](function(_0x155cf5){return _0x155cf5;});})[_0x9530('0x22')](function(_0x3d8596){if(_0x3d8596){_0x5f4e44[_0x9530('0x2a')][_0x9530('0x70')]=_0x3d8596[0x0];if(!_0x439b2a[_0x9530('0x59')]['UserId'])return;return db[_0x9530('0x71')][_0x9530('0x64')]({'where':{'id':_0x439b2a['body'][_0x9530('0x61')],'role':_0x9530('0x63')},'attributes':['id',_0x9530('0x3a'),_0x9530('0x72'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x343723){if(!_0x343723)return null;_0x5f4e44[_0x9530('0x2a')][_0x9530('0x63')]=_0x343723;return _0x5f4e44;})[_0x9530('0x22')](function(_0x229922){if(_0x229922){if(_0x439b2a['body']['manual']){_0x5f4e44[_0x9530('0x2a')][_0x9530('0x73')]=util[_0x9530('0x68')]('SIP/%s',_0x439b2a[_0x9530('0x62')][_0x9530('0x3a')]);_0x5f4e44['message'][_0x9530('0x74')]=_0x5f4e44[_0x9530('0x74')];_0x5f4e44[_0x9530('0x2a')]['motionChannel']=_0x5f4e44[_0x9530('0x74')];_0x5f4e44[_0x9530('0x2a')]['event']=_0x9530('0x5c');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x9530('0x75'),'message':_0x5f4e44[_0x9530('0x2a')]},client9002)[_0x9530('0x22')](function(){return _0x5f4e44;});}return _0x5f4e44;}return null;})['then'](respondWithResult(_0x57b8ca,null))[_0x9530('0x54')](handleError(_0x57b8ca,null));};var interaction_log=require(_0x9530('0x14'))('openchannel-interactions');exports[_0x9530('0x35')]=function(_0xe4e54a,_0x18aeeb,_0x1a505b){var _0x49f332={'agent':{},'channel':_0x9530('0x5d')};if(_0xe4e54a[_0x9530('0x59')]['id']){delete _0xe4e54a[_0x9530('0x59')]['id'];}_0xe4e54a[_0x9530('0x59')][_0x9530('0x61')]=_0xe4e54a['body'][_0x9530('0x61')]||_0xe4e54a[_0x9530('0x62')]['id'];_0x49f332[_0x9530('0x63')]['id']=_0xe4e54a['body']['UserId'];return db[_0x9530('0x3e')][_0x9530('0x64')]({'where':{'id':_0xe4e54a[_0x9530('0x56')]['id'],'UserId':null}})[_0x9530('0x22')](handleEntityNotFound(_0x18aeeb,null))[_0x9530('0x22')](function(_0x1369b){if(_0x1369b){_0x49f332[_0x9530('0x2a')]=_0x1369b[_0x9530('0x65')]({'plain':!![]});return db[_0x9530('0x66')][_0x9530('0x64')]({'where':{'id':_0x1369b[_0x9530('0x76')]}});}return null;})['then'](handleEntityNotFound(_0x18aeeb,null))[_0x9530('0x22')](function(_0x59dac3){if(_0x59dac3){_0x49f332[_0x9530('0x69')]=_0x59dac3['get']({'plain':!![]});interaction_log[_0x9530('0x23')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xe4e54a[_0x9530('0x62')]['id'],_0xe4e54a[_0x9530('0x62')]['name'],_0xe4e54a['user'][_0x9530('0x6b')],_0x49f332['interaction']['id'],_0xe4e54a[_0x9530('0x59')]?JSON['stringify'](_0xe4e54a['body']):_0x9530('0x77'));return respondWithRpcPromise(_0x9530('0x78'),'rejectMessage',_0x49f332);}return null;})[_0x9530('0x22')](function(_0x15d20c){var _0x24c241=_0x9530('0x79')+_0x15d20c['message'][_0x9530('0x7a')];return db[_0x9530('0x6d')]['query'](_0x24c241,{'type':db[_0x9530('0x6e')][_0x9530('0x7b')][_0x9530('0x6f')],'raw':!![]})[_0x9530('0x22')](function(_0x7156a0){return _0x7156a0;});})[_0x9530('0x22')](function(_0x535af5){if(_0x535af5){_0x49f332[_0x9530('0x2a')]['contact']=_0x535af5[0x0];if(!_0xe4e54a[_0x9530('0x59')]['UserId'])return;return db['User']['find']({'where':{'id':_0xe4e54a[_0x9530('0x59')][_0x9530('0x61')],'role':_0x9530('0x63')},'attributes':['id',_0x9530('0x3a'),_0x9530('0x72'),_0x9530('0x7c'),_0x9530('0x7d')],'raw':!![]});}return null;})['then'](function(_0xbe6a0){if(!_0xbe6a0)return null;_0x49f332[_0x9530('0x2a')][_0x9530('0x63')]=_0xbe6a0;return _0x49f332;})[_0x9530('0x22')](function(_0x19ee17){if(_0x19ee17){_0x19ee17[_0x9530('0x2a')]['interface']=util[_0x9530('0x68')](_0x9530('0x7e'),_0xe4e54a['user'][_0x9530('0x3a')]);_0x19ee17['message'][_0x9530('0x74')]=_0x49f332[_0x9530('0x74')];_0x19ee17[_0x9530('0x2a')][_0x9530('0x7f')]=_0x49f332[_0x9530('0x74')];_0x19ee17[_0x9530('0x2a')]['event']=_0x9530('0x35');respondWithRpcPromise(_0x9530('0x80'),_0x9530('0x80'),{'event':_0x9530('0x81'),'message':_0x19ee17[_0x9530('0x2a')]},client9002);return _0x49f332;}return null;})[_0x9530('0x22')](respondWithResult(_0x18aeeb,null))[_0x9530('0x54')](handleError(_0x18aeeb,null));};
\ No newline at end of file
index 7ebc72c..608e02b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e7f=['hook','OpenchannelMessage','setMaxListeners','update','remove','emit'];(function(_0x2693b8,_0x5f52ef){var _0x2a4684=function(_0x26e72c){while(--_0x26e72c){_0x2693b8['push'](_0x2693b8['shift']());}};_0x2a4684(++_0x5f52ef);}(_0x1e7f,0x14b));var _0xf1e7=function(_0x5f56dd,_0x440faa){_0x5f56dd=_0x5f56dd-0x0;var _0x34eebb=_0x1e7f[_0x5f56dd];return _0x34eebb;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require('../../mysqldb')['db'][_0xf1e7('0x0')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xf1e7('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf1e7('0x2'),'afterDestroy':_0xf1e7('0x3')};function emitEvent(_0x5a1ae4){return function(_0x100ec3,_0x24ef06,_0x107a18){OpenchannelMessageEvents[_0xf1e7('0x4')](_0x5a1ae4+':'+_0x100ec3['id'],_0x100ec3);OpenchannelMessageEvents[_0xf1e7('0x4')](_0x5a1ae4,_0x100ec3);_0x107a18(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0xf1e7('0x5')](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents;
\ No newline at end of file
+var _0xf7c1=['../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x100682,_0x11afec){var _0xcb6e87=function(_0x3ef421){while(--_0x3ef421){_0x100682['push'](_0x100682['shift']());}};_0xcb6e87(++_0x11afec);}(_0xf7c1,0x149));var _0x1f7c=function(_0x598831,_0x221147){_0x598831=_0x598831-0x0;var _0x571a2d=_0xf7c1[_0x598831];return _0x571a2d;};'use strict';var EventEmitter=require(_0x1f7c('0x0'));var OpenchannelMessage=require(_0x1f7c('0x1'))['db'][_0x1f7c('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x1f7c('0x3')](0x0);var events={'afterCreate':_0x1f7c('0x4'),'afterUpdate':_0x1f7c('0x5'),'afterDestroy':_0x1f7c('0x6')};function emitEvent(_0x27b497){return function(_0x2897fe,_0x10621d,_0x3f984a){OpenchannelMessageEvents[_0x1f7c('0x7')](_0x27b497+':'+_0x2897fe['id'],_0x2897fe);OpenchannelMessageEvents[_0x1f7c('0x7')](_0x27b497,_0x2897fe);_0x3f984a(null);};}for(var e in events){if(events[_0x1f7c('0x8')](e)){var event=events[e];OpenchannelMessage[_0x1f7c('0x9')](e,emitEvent(event));}}module[_0x1f7c('0xa')]=OpenchannelMessageEvents;
\ No newline at end of file
index 93bad60..237ccf7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fc2=['length','omit','Contact','POST','method','OpenchannelMessage,\x20%s,\x20%s','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','update','finally','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./openchannelMessage.attributes','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','createdAt','catch','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','keys','info','afterCreate','Forwarding\x20message\x20%d\x20to\x20%s','replyUri'];(function(_0x1f6704,_0x106f36){var _0x4acab6=function(_0x398633){while(--_0x398633){_0x1f6704['push'](_0x1f6704['shift']());}};_0x4acab6(++_0x106f36);}(_0x4fc2,0x111));var _0x24fc=function(_0x217ecd,_0x5b35da){_0x217ecd=_0x217ecd-0x0;var _0x50b480=_0x4fc2[_0x217ecd];return _0x50b480;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var logger=require(_0x24fc('0x2'))(_0x24fc('0x3'));var moment=require('moment');var BPromise=require(_0x24fc('0x4'));var rp=require(_0x24fc('0x5'));var fs=require('fs');var path=require(_0x24fc('0x6'));var rimraf=require('rimraf');var config=require(_0x24fc('0x7'));var attributes=require(_0x24fc('0x8'));module['exports']=function(_0x26fcc6,_0x12d602){return _0x26fcc6['define'](_0x24fc('0x9'),attributes,{'tableName':_0x24fc('0xa'),'paranoid':![],'indexes':[{'name':_0x24fc('0xb'),'fields':[_0x24fc('0xc')],'type':_0x24fc('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x47349b,_0x5afdf1,_0x44caca){var _0x1819a5=_0x26fcc6[_0x24fc('0xe')];var _0x133438=_0x47349b[_0x24fc('0xf')]({'plain':!![]});if(_0x133438[_0x24fc('0x10')][_0x24fc('0x11')]()==='in'||_0x133438[_0x24fc('0x10')]['toLowerCase']()===_0x24fc('0x12')&&!_0x133438[_0x24fc('0x13')]&&!_['isNil'](_0x133438[_0x24fc('0x14')])){_0x1819a5[_0x24fc('0x15')][_0x24fc('0x16')]({'where':{'id':_0x133438[_0x24fc('0x17')]}})[_0x24fc('0x18')](function(_0x326276){if(_0x326276){_0x326276['update']({'lastMsgAt':_0x133438[_0x24fc('0x19')],'lastMsgDirection':_0x133438[_0x24fc('0x10')][_0x24fc('0x11')]()});}})[_0x24fc('0x1a')](function(_0x4acd36){console[_0x24fc('0x1b')](_0x4acd36);});}if(_0x133438['direction']===_0x24fc('0x12')&&!_0x133438[_0x24fc('0x13')]){var _0x218fb6;_0x1819a5[_0x24fc('0x1c')][_0x24fc('0x1d')]()['then'](function(_0x23873c){return _0x1819a5[_0x24fc('0x1e')][_0x24fc('0x1f')]({'where':{'id':_0x133438[_0x24fc('0x20')]},'include':[{'model':_0x1819a5['OpenchannelInteraction'],'as':_0x24fc('0x21'),'where':{'id':_0x133438[_0x24fc('0x17')]},'limit':0x1,'include':[{'model':_0x1819a5[_0x24fc('0x1c')],'as':'Contact','attributes':_[_0x24fc('0x22')](_0x23873c)}]}]});})[_0x24fc('0x18')](function(_0xbf1d6b){_0x218fb6=_0xbf1d6b[_0x24fc('0xf')]({'plain':!![]});if(_0x218fb6&&_0x218fb6['replyUri']){logger[_0x24fc('0x23')]('OpenchannelMessage,\x20%s,\x20%s',_0x24fc('0x24'),util['format'](_0x24fc('0x25'),_0x133438['id'],_0x218fb6[_0x24fc('0x26')]));if(_0x218fb6[_0x24fc('0x21')]&&_0x218fb6['Interactions'][_0x24fc('0x27')]){_0x133438['Interaction']=_[_0x24fc('0x28')](_0x218fb6[_0x24fc('0x21')][0x0],_0x24fc('0x29'));_0x133438[_0x24fc('0x29')]=_0x218fb6[_0x24fc('0x21')][0x0][_0x24fc('0x29')];}var _0x5afdf1={'method':_0x24fc('0x2a'),'uri':encodeURI(_0x218fb6[_0x24fc('0x26')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5afdf1[_0x24fc('0x2b')]){case'GET':_0x5afdf1['qs']=_0x133438;break;case _0x24fc('0x2a'):_0x5afdf1[_0x24fc('0xc')]=_0x133438;break;}return rp(_0x5afdf1)[_0x24fc('0x18')](function(_0x5bb4c8){logger[_0x24fc('0x23')](_0x24fc('0x2c'),_0x24fc('0x24'),util[_0x24fc('0x2d')](_0x24fc('0x2e'),_0x133438['id'],_0x218fb6[_0x24fc('0x26')]));if(_0x5bb4c8['body'][_0x24fc('0x2f')]&&_0x5bb4c8[_0x24fc('0xc')][_0x24fc('0x2f')]!=_0x133438[_0x24fc('0x30')][_0x24fc('0x2f')]){return _0x1819a5['OpenchannelInteraction']['update']({'threadId':_0x5bb4c8['body'][_0x24fc('0x2f')]},{'logging':!![],'where':{'id':_0x133438['Interaction']['id']}});}else{return;}})[_0x24fc('0x18')](function(){return _0x47349b[_0x24fc('0x31')]({'read':!![]});})[_0x24fc('0x1a')](function(_0x2086c0){logger['error'](_0x24fc('0x2c'),_0x24fc('0x24'),util['inspect'](_0x2086c0,{'showHidden':![],'depth':null}));_0x44caca();});}else{_0x44caca();}})[_0x24fc('0x32')](function(){_0x44caca();});}else{_0x44caca();}}},'charset':_0x24fc('0x33'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x8e3f=['get','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','findOne','then','update','catch','error','secret','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteractionId','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','omit','POST','method','GET','info','Message\x20%d\x20forwarded\x20to\x20%s','threadId','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x8e3f[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0xf8e3('0x0'));var util=require(_0xf8e3('0x1'));var logger=require(_0xf8e3('0x2'))('api');var moment=require(_0xf8e3('0x3'));var BPromise=require(_0xf8e3('0x4'));var rp=require(_0xf8e3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf8e3('0x6'));var config=require(_0xf8e3('0x7'));var attributes=require('./openchannelMessage.attributes');module[_0xf8e3('0x8')]=function(_0xb21f8d,_0x2621c5){return _0xb21f8d[_0xf8e3('0x9')]('OpenchannelMessage',attributes,{'tableName':_0xf8e3('0xa'),'paranoid':![],'indexes':[{'name':_0xf8e3('0xb'),'fields':[_0xf8e3('0xc')],'type':_0xf8e3('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x38f8e8,_0x4055e2,_0x299a7e){var _0x2a3b59=_0xb21f8d[_0xf8e3('0xe')];var _0x2bc3cd=_0x38f8e8[_0xf8e3('0xf')]({'plain':!![]});if(_0x2bc3cd[_0xf8e3('0x10')]['toLowerCase']()==='in'||_0x2bc3cd[_0xf8e3('0x10')][_0xf8e3('0x11')]()===_0xf8e3('0x12')&&!_0x2bc3cd['secret']&&!_[_0xf8e3('0x13')](_0x2bc3cd[_0xf8e3('0x14')])){_0x2a3b59[_0xf8e3('0x15')][_0xf8e3('0x16')]({'where':{'id':_0x2bc3cd['OpenchannelInteractionId']}})[_0xf8e3('0x17')](function(_0xa856f5){if(_0xa856f5){_0xa856f5[_0xf8e3('0x18')]({'lastMsgAt':_0x2bc3cd['createdAt'],'lastMsgDirection':_0x2bc3cd[_0xf8e3('0x10')]['toLowerCase']()});}})[_0xf8e3('0x19')](function(_0x40c196){console[_0xf8e3('0x1a')](_0x40c196);});}if(_0x2bc3cd['direction']==='out'&&!_0x2bc3cd[_0xf8e3('0x1b')]){var _0x385dde;_0x2a3b59[_0xf8e3('0x1c')][_0xf8e3('0x1d')]()[_0xf8e3('0x17')](function(_0x11d4cc){return _0x2a3b59[_0xf8e3('0x1e')][_0xf8e3('0x1f')]({'where':{'id':_0x2bc3cd[_0xf8e3('0x20')]},'include':[{'model':_0x2a3b59[_0xf8e3('0x15')],'as':'Interactions','where':{'id':_0x2bc3cd[_0xf8e3('0x21')]},'limit':0x1,'include':[{'model':_0x2a3b59[_0xf8e3('0x1c')],'as':_0xf8e3('0x22'),'attributes':_[_0xf8e3('0x23')](_0x11d4cc)}]}]});})[_0xf8e3('0x17')](function(_0x11c58e){_0x385dde=_0x11c58e[_0xf8e3('0xf')]({'plain':!![]});if(_0x385dde&&_0x385dde[_0xf8e3('0x24')]){logger['info'](_0xf8e3('0x25'),_0xf8e3('0x26'),util[_0xf8e3('0x27')](_0xf8e3('0x28'),_0x2bc3cd['id'],_0x385dde['replyUri']));if(_0x385dde[_0xf8e3('0x29')]&&_0x385dde['Interactions'][_0xf8e3('0x2a')]){_0x2bc3cd[_0xf8e3('0x2b')]=_[_0xf8e3('0x2c')](_0x385dde[_0xf8e3('0x29')][0x0],_0xf8e3('0x22'));_0x2bc3cd[_0xf8e3('0x22')]=_0x385dde['Interactions'][0x0][_0xf8e3('0x22')];}var _0x4055e2={'method':_0xf8e3('0x2d'),'uri':encodeURI(_0x385dde[_0xf8e3('0x24')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4055e2[_0xf8e3('0x2e')]){case _0xf8e3('0x2f'):_0x4055e2['qs']=_0x2bc3cd;break;case _0xf8e3('0x2d'):_0x4055e2[_0xf8e3('0xc')]=_0x2bc3cd;break;}return rp(_0x4055e2)['then'](function(_0x356e0a){logger[_0xf8e3('0x30')](_0xf8e3('0x25'),_0xf8e3('0x26'),util[_0xf8e3('0x27')](_0xf8e3('0x31'),_0x2bc3cd['id'],_0x385dde[_0xf8e3('0x24')]));if(_0x356e0a[_0xf8e3('0xc')]['threadId']&&_0x356e0a[_0xf8e3('0xc')][_0xf8e3('0x32')]!=_0x2bc3cd[_0xf8e3('0x2b')][_0xf8e3('0x32')]){return _0x2a3b59['OpenchannelInteraction'][_0xf8e3('0x18')]({'threadId':_0x356e0a[_0xf8e3('0xc')][_0xf8e3('0x32')]},{'logging':!![],'where':{'id':_0x2bc3cd[_0xf8e3('0x2b')]['id']}});}else{return;}})[_0xf8e3('0x17')](function(){return _0x38f8e8[_0xf8e3('0x18')]({'read':!![]});})[_0xf8e3('0x19')](function(_0x18c8ae){logger['error'](_0xf8e3('0x25'),_0xf8e3('0x26'),util['inspect'](_0x18c8ae,{'showHidden':![],'depth':null}));_0x299a7e();});}else{_0x299a7e();}})['finally'](function(){_0x299a7e();});}else{_0x299a7e();}}},'charset':'utf8mb4','collate':_0xf8e3('0x33')});};
\ No newline at end of file
index d7174e5..c4d2356 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3a9b11,_0xb6c98){var _0x5e6324=function(_0x18058d){while(--_0x18058d){_0x3a9b11['push'](_0x3a9b11['shift']());}};_0x5e6324(++_0xb6c98);}(_0x1261,0x144));var _0x1126=function(_0x5263d2,_0x476862){_0x5263d2=_0x5263d2-0x0;var _0x2363a0=_0x1261[_0x5263d2];return _0x2363a0;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});};
\ No newline at end of file
+var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0xaed410,_0x3f1770){var _0x2d06e2=function(_0x156189){while(--_0x156189){_0xaed410['push'](_0xaed410['shift']());}};_0x2d06e2(++_0x3f1770);}(_0x2ef3,0xba));var _0x32ef=function(_0x3ee5d1,_0x32a3c6){_0x3ee5d1=_0x3ee5d1-0x0;var _0x1ad473=_0x2ef3[_0x3ee5d1];return _0x1ad473;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});};
\ No newline at end of file
index 5e23120..9bd4325 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe64b=['save','remove','emit','register','openchannelMessage:','./openchannelMessage.events'];(function(_0x3574f7,_0x1d8e89){var _0x2a554f=function(_0x1d231a){while(--_0x1d231a){_0x3574f7['push'](_0x3574f7['shift']());}};_0x2a554f(++_0x1d8e89);}(_0xe64b,0x1a3));var _0xbe64=function(_0x5c47f9,_0x23861e){_0x5c47f9=_0x5c47f9-0x0;var _0x3f9439=_0xe64b[_0x5c47f9];return _0x3f9439;};'use strict';var OpenchannelMessageEvents=require(_0xbe64('0x0'));var events=[_0xbe64('0x1'),_0xbe64('0x2'),'update'];function createListener(_0x65fcae,_0xadf1c5){return function(_0x4d5ff8){_0xadf1c5[_0xbe64('0x3')](_0x65fcae,_0x4d5ff8);};}function removeListener(_0x24e586,_0x4e62da){return function(){OpenchannelMessageEvents['removeListener'](_0x24e586,_0x4e62da);};}exports[_0xbe64('0x4')]=function(_0x4286e3){for(var _0x37a226=0x0,_0x56f0cc=events['length'];_0x37a226<_0x56f0cc;_0x37a226++){var _0xe3eabc=events[_0x37a226];var _0x1b4025=createListener(_0xbe64('0x5')+_0xe3eabc,_0x4286e3);OpenchannelMessageEvents['on'](_0xe3eabc,_0x1b4025);}};
\ No newline at end of file
+var _0x4f96=['openchannelMessage:','./openchannelMessage.events','save','remove','update','emit','removeListener','length'];(function(_0x85d5a8,_0x1977be){var _0x20479b=function(_0x125248){while(--_0x125248){_0x85d5a8['push'](_0x85d5a8['shift']());}};_0x20479b(++_0x1977be);}(_0x4f96,0xb9));var _0x64f9=function(_0x336b65,_0x3f857a){_0x336b65=_0x336b65-0x0;var _0xb8017f=_0x4f96[_0x336b65];return _0xb8017f;};'use strict';var OpenchannelMessageEvents=require(_0x64f9('0x0'));var events=[_0x64f9('0x1'),_0x64f9('0x2'),_0x64f9('0x3')];function createListener(_0x241264,_0x31e759){return function(_0x4a87d5){_0x31e759[_0x64f9('0x4')](_0x241264,_0x4a87d5);};}function removeListener(_0x4c95fa,_0x5c4300){return function(){OpenchannelMessageEvents[_0x64f9('0x5')](_0x4c95fa,_0x5c4300);};}exports['register']=function(_0x727113){for(var _0x307cb5=0x0,_0x3569eb=events[_0x64f9('0x6')];_0x307cb5<_0x3569eb;_0x307cb5++){var _0x1bc33d=events[_0x307cb5];var _0x512be8=createListener(_0x64f9('0x7')+_0x1bc33d,_0x727113);OpenchannelMessageEvents['on'](_0x1bc33d,_0x512be8);}};
\ No newline at end of file
index e608c70..17e60ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2f6=['create','post','addTeams','addAgents','put','/:id','update','delete','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','get','index','isAuthenticated','describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xd2f6,0x173));var _0x6d2f=function(_0x44dbaf,_0x45cc41){_0x44dbaf=_0x44dbaf-0x0;var _0x34c7b8=_0xd2f6[_0x44dbaf];return _0x34c7b8;};'use strict';var multer=require(_0x6d2f('0x0'));var util=require('util');var path=require(_0x6d2f('0x1'));var timeout=require(_0x6d2f('0x2'));var express=require(_0x6d2f('0x3'));var router=express[_0x6d2f('0x4')]();var fs_extra=require(_0x6d2f('0x5'));var auth=require(_0x6d2f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6d2f('0x7'));var controller=require(_0x6d2f('0x8'));router[_0x6d2f('0x9')]('/',auth['isAuthenticated'](),controller[_0x6d2f('0xa')]);router['get']('/describe',auth[_0x6d2f('0xb')](),controller[_0x6d2f('0xc')]);router['get']('/:id',auth[_0x6d2f('0xb')](),controller[_0x6d2f('0xd')]);router[_0x6d2f('0x9')](_0x6d2f('0xe'),auth['isAuthenticated'](),controller['getMembers']);router[_0x6d2f('0x9')](_0x6d2f('0xf'),auth['isAuthenticated'](),controller[_0x6d2f('0x10')]);router[_0x6d2f('0x9')](_0x6d2f('0x11'),auth[_0x6d2f('0xb')](),controller[_0x6d2f('0x12')]);router['post']('/',auth[_0x6d2f('0xb')](),controller[_0x6d2f('0x13')]);router[_0x6d2f('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x6d2f('0x15')]);router['post'](_0x6d2f('0x11'),auth[_0x6d2f('0xb')](),controller[_0x6d2f('0x16')]);router[_0x6d2f('0x17')](_0x6d2f('0x18'),auth[_0x6d2f('0xb')](),controller[_0x6d2f('0x19')]);router[_0x6d2f('0x1a')](_0x6d2f('0x18'),auth[_0x6d2f('0xb')](),controller['destroy']);router[_0x6d2f('0x1a')](_0x6d2f('0xf'),auth['isAuthenticated'](),controller[_0x6d2f('0x1b')]);router[_0x6d2f('0x1a')](_0x6d2f('0x11'),auth[_0x6d2f('0xb')](),controller[_0x6d2f('0x1c')]);module[_0x6d2f('0x1d')]=router;
\ No newline at end of file
+var _0x4a41=['describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','update','delete','destroy','removeAgents','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueue.controller','isAuthenticated','index','get','/describe'];(function(_0x3fdfa0,_0x2b8975){var _0x527193=function(_0xf5cd25){while(--_0xf5cd25){_0x3fdfa0['push'](_0x3fdfa0['shift']());}};_0x527193(++_0x2b8975);}(_0x4a41,0x1d4));var _0x14a4=function(_0x84b7f2,_0x3bbc1d){_0x84b7f2=_0x84b7f2-0x0;var _0x52f617=_0x4a41[_0x84b7f2];return _0x52f617;};'use strict';var multer=require(_0x14a4('0x0'));var util=require('util');var path=require(_0x14a4('0x1'));var timeout=require(_0x14a4('0x2'));var express=require(_0x14a4('0x3'));var router=express['Router']();var fs_extra=require(_0x14a4('0x4'));var auth=require(_0x14a4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x14a4('0x6'));var controller=require(_0x14a4('0x7'));router['get']('/',auth[_0x14a4('0x8')](),controller[_0x14a4('0x9')]);router[_0x14a4('0xa')](_0x14a4('0xb'),auth[_0x14a4('0x8')](),controller[_0x14a4('0xc')]);router[_0x14a4('0xa')](_0x14a4('0xd'),auth['isAuthenticated'](),controller[_0x14a4('0xe')]);router['get'](_0x14a4('0xf'),auth[_0x14a4('0x8')](),controller[_0x14a4('0x10')]);router[_0x14a4('0xa')](_0x14a4('0x11'),auth[_0x14a4('0x8')](),controller[_0x14a4('0x12')]);router[_0x14a4('0xa')](_0x14a4('0x13'),auth[_0x14a4('0x8')](),controller[_0x14a4('0x14')]);router['post']('/',auth['isAuthenticated'](),controller[_0x14a4('0x15')]);router[_0x14a4('0x16')]('/:id/teams',auth['isAuthenticated'](),controller[_0x14a4('0x17')]);router[_0x14a4('0x16')](_0x14a4('0x13'),auth[_0x14a4('0x8')](),controller[_0x14a4('0x18')]);router['put'](_0x14a4('0xd'),auth[_0x14a4('0x8')](),controller[_0x14a4('0x19')]);router[_0x14a4('0x1a')](_0x14a4('0xd'),auth[_0x14a4('0x8')](),controller[_0x14a4('0x1b')]);router[_0x14a4('0x1a')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router[_0x14a4('0x1a')](_0x14a4('0x13'),auth['isAuthenticated'](),controller[_0x14a4('0x1c')]);module[_0x14a4('0x1d')]=router;
\ No newline at end of file
index 5e22aa2..b548a48 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51e7=['exports','STRING','INTEGER','ENUM','rrmemory','beepall','sequelize'];(function(_0x279841,_0x4e9e3b){var _0x4d3a9f=function(_0x261c2d){while(--_0x261c2d){_0x279841['push'](_0x279841['shift']());}};_0x4d3a9f(++_0x4e9e3b);}(_0x51e7,0x179));var _0x751e=function(_0x2d25ed,_0x1527f7){_0x2d25ed=_0x2d25ed-0x0;var _0x58ba35=_0x51e7[_0x2d25ed];return _0x58ba35;};'use strict';var Sequelize=require(_0x751e('0x0'));module[_0x751e('0x1')]={'name':{'type':Sequelize[_0x751e('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x751e('0x2')]},'timeout':{'type':Sequelize[_0x751e('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x751e('0x4')](_0x751e('0x5'),_0x751e('0x6'),'roundrobin')}};
\ No newline at end of file
+var _0xbf19=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x46567a,_0x407004){var _0x837fd2=function(_0x30e27a){while(--_0x30e27a){_0x46567a['push'](_0x46567a['shift']());}};_0x837fd2(++_0x407004);}(_0xbf19,0x6b));var _0x9bf1=function(_0x2b3bbd,_0x2aa8c){_0x2b3bbd=_0x2b3bbd-0x0;var _0x7bf5d7=_0xbf19[_0x2b3bbd];return _0x7bf5d7;};'use strict';var Sequelize=require(_0x9bf1('0x0'));module[_0x9bf1('0x1')]={'name':{'type':Sequelize[_0x9bf1('0x2')],'unique':_0x9bf1('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x9bf1('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9bf1('0x5')](_0x9bf1('0x6'),_0x9bf1('0x7'),_0x9bf1('0x8'))}};
\ No newline at end of file
index d27263f..62f6685 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9081=['OpenchannelQueue','fieldName','type','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','UserId','agent','openchannelPause','updatedAt','format','Team','getTeams','ids','findAll','online','voicePause','interface','flatMap','transaction','addTeams','findOrCreate','forEach','userOpenchannelQueue:save','removeTeams','Agents','select','from','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','toString','sequelize','QueryTypes','SELECT','every','includes','compact','value','isEmpty','removeAgents','emit','userOpenchannelQueue:remove','omit','spread','getAgents','nolimit','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','get','destroy','error','name','send','map'];(function(_0x1ccf4f,_0x18ce33){var _0x3f747c=function(_0x166f08){while(--_0x166f08){_0x1ccf4f['push'](_0x1ccf4f['shift']());}};_0x3f747c(++_0x18ce33);}(_0x9081,0x16c));var _0x1908=function(_0x528cbc,_0x2d5422){_0x528cbc=_0x528cbc-0x0;var _0x5bb7e7=_0x9081[_0x528cbc];return _0x5bb7e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1908('0x0'));var zipdir=require(_0x1908('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1908('0x2'));var moment=require(_0x1908('0x3'));var BPromise=require(_0x1908('0x4'));var Mustache=require(_0x1908('0x5'));var util=require(_0x1908('0x6'));var path=require(_0x1908('0x7'));var sox=require(_0x1908('0x8'));var csv=require('to-csv');var ejs=require(_0x1908('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1908('0xa'));var squel=require(_0x1908('0xb'));var crypto=require(_0x1908('0xc'));var jsforce=require(_0x1908('0xd'));var deskjs=require(_0x1908('0xe'));var toCsv=require(_0x1908('0xf'));var querystring=require(_0x1908('0x10'));var Papa=require(_0x1908('0x11'));var Redis=require(_0x1908('0x12'));var authService=require(_0x1908('0x13'));var qs=require(_0x1908('0x14'));var as=require(_0x1908('0x15'));var hardwareService=require(_0x1908('0x16'));var logger=require(_0x1908('0x17'))(_0x1908('0x18'));var utils=require(_0x1908('0x19'));var config=require(_0x1908('0x1a'));var licenseUtil=require(_0x1908('0x1b'));var db=require(_0x1908('0x1c'))['db'];config[_0x1908('0x1d')]=_['defaults'](config[_0x1908('0x1d')],{'host':_0x1908('0x1e'),'port':0x18eb});var socket=require(_0x1908('0x1f'))(new Redis(config[_0x1908('0x1d')]));require(_0x1908('0x20'))[_0x1908('0x21')](socket);function respondWithStatusCode(_0x42c1c2,_0x3d8604){_0x3d8604=_0x3d8604||0xcc;return function(_0xf64bb8){if(_0xf64bb8){return _0x42c1c2[_0x1908('0x22')](_0x3d8604);}return _0x42c1c2['status'](_0x3d8604)[_0x1908('0x23')]();};}function respondWithResult(_0x133fe5,_0xbc8c7a){_0xbc8c7a=_0xbc8c7a||0xc8;return function(_0x41b7e8){if(_0x41b7e8){return _0x133fe5[_0x1908('0x24')](_0xbc8c7a)[_0x1908('0x25')](_0x41b7e8);}};}function respondWithFilteredResult(_0x57ba37,_0x4091cd){return function(_0x345a82){if(_0x345a82){var _0x1d5cbd=typeof _0x4091cd[_0x1908('0x26')]===_0x1908('0x27')&&typeof _0x4091cd[_0x1908('0x28')]===_0x1908('0x27');var _0x37d394=_0x345a82[_0x1908('0x29')];var _0x25ee03=_0x1d5cbd?0x0:_0x4091cd[_0x1908('0x26')];var _0x5bdeb0=_0x1d5cbd?_0x345a82[_0x1908('0x29')]:_0x4091cd[_0x1908('0x26')]+_0x4091cd['limit'];var _0x2b0275;if(_0x5bdeb0>=_0x37d394){_0x5bdeb0=_0x37d394;_0x2b0275=0xc8;}else{_0x2b0275=0xce;}_0x57ba37[_0x1908('0x24')](_0x2b0275);return _0x57ba37[_0x1908('0x2a')](_0x1908('0x2b'),_0x25ee03+'-'+_0x5bdeb0+'/'+_0x37d394)['json'](_0x345a82);}return null;};}function patchUpdates(_0xdba86d){return function(_0x2fdf29){try{jsonpatch['apply'](_0x2fdf29,_0xdba86d,!![]);}catch(_0x3b8932){return BPromise[_0x1908('0x2c')](_0x3b8932);}return _0x2fdf29['save']();};}function saveUpdates(_0x5aeeb0,_0x4c82ae){return function(_0x4142f1){if(_0x4142f1){return _0x4142f1[_0x1908('0x2d')](_0x5aeeb0)[_0x1908('0x2e')](function(_0x26ec73){return _0x26ec73;});}return null;};}function removeEntity(_0x5e434e,_0x4ef7a8){return function(_0x1d24f1){if(_0x1d24f1){return _0x1d24f1['destroy']()[_0x1908('0x2e')](function(){var _0x1c10ad=_0x1d24f1[_0x1908('0x2f')]({'plain':!![]});var _0x412226='OpenchannelQueues';return db['UserProfileResource'][_0x1908('0x30')]({'where':{'type':_0x412226,'resourceId':_0x1c10ad['id']}})[_0x1908('0x2e')](function(){return _0x1d24f1;});})[_0x1908('0x2e')](function(){_0x5e434e['status'](0xcc)[_0x1908('0x23')]();});}};}function handleEntityNotFound(_0x4d7bb2,_0x2f1669){return function(_0x10404c){if(!_0x10404c){_0x4d7bb2[_0x1908('0x22')](0x194);}return _0x10404c;};}function handleError(_0x372efb,_0x497082){_0x497082=_0x497082||0x1f4;return function(_0x398d32){logger[_0x1908('0x31')](_0x398d32['stack']);if(_0x398d32[_0x1908('0x32')]){delete _0x398d32['name'];}_0x372efb[_0x1908('0x24')](_0x497082)[_0x1908('0x33')](_0x398d32);};}exports['index']=function(_0x16295f,_0x21a6ad){var _0x14e25c={},_0x52c8b8={},_0xf6a66e={'count':0x0,'rows':[]};var _0xfa3959=_[_0x1908('0x34')](db[_0x1908('0x35')]['rawAttributes'],function(_0x36f22c){return{'name':_0x36f22c[_0x1908('0x36')],'type':_0x36f22c[_0x1908('0x37')]['key']};});_0x52c8b8['model']=_[_0x1908('0x34')](_0xfa3959,_0x1908('0x32'));_0x52c8b8[_0x1908('0x38')]=_['keys'](_0x16295f[_0x1908('0x38')]);_0x52c8b8[_0x1908('0x39')]=_[_0x1908('0x3a')](_0x52c8b8['model'],_0x52c8b8[_0x1908('0x38')]);_0x14e25c[_0x1908('0x3b')]=_[_0x1908('0x3a')](_0x52c8b8[_0x1908('0x3c')],qs[_0x1908('0x3d')](_0x16295f[_0x1908('0x38')]['fields']));_0x14e25c[_0x1908('0x3b')]=_0x14e25c[_0x1908('0x3b')][_0x1908('0x3e')]?_0x14e25c[_0x1908('0x3b')]:_0x52c8b8[_0x1908('0x3c')];if(!_0x16295f[_0x1908('0x38')][_0x1908('0x3f')]('nolimit')){_0x14e25c[_0x1908('0x28')]=qs[_0x1908('0x28')](_0x16295f[_0x1908('0x38')][_0x1908('0x28')]);_0x14e25c[_0x1908('0x26')]=qs[_0x1908('0x26')](_0x16295f['query']['offset']);}_0x14e25c[_0x1908('0x40')]=qs[_0x1908('0x41')](_0x16295f[_0x1908('0x38')][_0x1908('0x41')]);_0x14e25c[_0x1908('0x42')]=qs[_0x1908('0x39')](_[_0x1908('0x43')](_0x16295f[_0x1908('0x38')],_0x52c8b8[_0x1908('0x39')]),_0xfa3959);if(_0x16295f[_0x1908('0x38')][_0x1908('0x44')]){_0x14e25c['where']=_[_0x1908('0x45')](_0x14e25c[_0x1908('0x42')],{'$or':_[_0x1908('0x34')](_0xfa3959,function(_0x190778){if(_0x190778[_0x1908('0x37')]!==_0x1908('0x46')){var _0x295dde={};_0x295dde[_0x190778['name']]={'$like':'%'+_0x16295f[_0x1908('0x38')][_0x1908('0x44')]+'%'};return _0x295dde;}})});}_0x14e25c=_['merge']({},_0x14e25c,_0x16295f[_0x1908('0x47')]);var _0x4dbe95={'where':_0x14e25c[_0x1908('0x42')]};return db[_0x1908('0x35')]['count'](_0x4dbe95)['then'](function(_0x82bffc){_0xf6a66e[_0x1908('0x29')]=_0x82bffc;if(_0x16295f['query'][_0x1908('0x48')]){_0x14e25c[_0x1908('0x49')]=[{'all':!![]}];}return db[_0x1908('0x35')]['findAll'](_0x14e25c);})[_0x1908('0x2e')](function(_0xb118d4){_0xf6a66e[_0x1908('0x4a')]=_0xb118d4;return _0xf6a66e;})[_0x1908('0x2e')](respondWithFilteredResult(_0x21a6ad,_0x14e25c))[_0x1908('0x4b')](handleError(_0x21a6ad,null));};exports[_0x1908('0x4c')]=function(_0x2f57c4,_0x56e241){var _0xef3d7b={'raw':!![],'where':{'id':_0x2f57c4[_0x1908('0x4d')]['id']}},_0x3f0823={};_0x3f0823[_0x1908('0x3c')]=_[_0x1908('0x4e')](db['OpenchannelQueue'][_0x1908('0x4f')]);_0x3f0823[_0x1908('0x38')]=_[_0x1908('0x4e')](_0x2f57c4[_0x1908('0x38')]);_0x3f0823[_0x1908('0x39')]=_[_0x1908('0x3a')](_0x3f0823[_0x1908('0x3c')],_0x3f0823[_0x1908('0x38')]);_0xef3d7b[_0x1908('0x3b')]=_[_0x1908('0x3a')](_0x3f0823['model'],qs['fields'](_0x2f57c4['query'][_0x1908('0x3d')]));_0xef3d7b[_0x1908('0x3b')]=_0xef3d7b[_0x1908('0x3b')][_0x1908('0x3e')]?_0xef3d7b['attributes']:_0x3f0823[_0x1908('0x3c')];if(_0x2f57c4[_0x1908('0x38')][_0x1908('0x48')]){_0xef3d7b['include']=[{'all':!![]}];}_0xef3d7b=_[_0x1908('0x45')]({},_0xef3d7b,_0x2f57c4[_0x1908('0x47')]);return db['OpenchannelQueue'][_0x1908('0x50')](_0xef3d7b)[_0x1908('0x2e')](handleEntityNotFound(_0x56e241,null))[_0x1908('0x2e')](respondWithResult(_0x56e241,null))[_0x1908('0x4b')](handleError(_0x56e241,null));};exports[_0x1908('0x51')]=function(_0x5d9c46,_0x454d29){return db[_0x1908('0x35')][_0x1908('0x51')](_0x5d9c46['body'],{})['then'](function(_0x5086f8){var _0x30f971=_0x5d9c46[_0x1908('0x52')][_0x1908('0x2f')]({'plain':!![]});if(!_0x30f971)throw new Error(_0x1908('0x53'));if(_0x30f971['role']===_0x1908('0x52')){var _0x388538=_0x5086f8[_0x1908('0x2f')]({'plain':!![]});var _0x151cd4='OpenchannelQueues';return db[_0x1908('0x54')][_0x1908('0x50')]({'where':{'name':_0x151cd4,'userProfileId':_0x30f971[_0x1908('0x55')]},'raw':!![]})[_0x1908('0x2e')](function(_0x4ce019){if(_0x4ce019&&_0x4ce019[_0x1908('0x56')]===0x0){return db[_0x1908('0x57')][_0x1908('0x51')]({'name':_0x388538[_0x1908('0x32')],'resourceId':_0x388538['id'],'type':_0x4ce019[_0x1908('0x32')],'sectionId':_0x4ce019['id']},{})[_0x1908('0x2e')](function(){return _0x5086f8;});}else{return _0x5086f8;}})['catch'](function(_0x23de8f){logger['error'](_0x1908('0x58'),_0x23de8f);throw _0x23de8f;});}return _0x5086f8;})[_0x1908('0x2e')](respondWithResult(_0x454d29,0xc9))[_0x1908('0x4b')](handleError(_0x454d29,null));};exports[_0x1908('0x2d')]=function(_0x5955a1,_0x5124fc){if(_0x5955a1[_0x1908('0x59')]['id']){delete _0x5955a1[_0x1908('0x59')]['id'];}return db[_0x1908('0x35')][_0x1908('0x50')]({'where':{'id':_0x5955a1[_0x1908('0x4d')]['id']}})[_0x1908('0x2e')](handleEntityNotFound(_0x5124fc,null))['then'](saveUpdates(_0x5955a1[_0x1908('0x59')],null))[_0x1908('0x2e')](respondWithResult(_0x5124fc,null))[_0x1908('0x4b')](handleError(_0x5124fc,null));};exports[_0x1908('0x30')]=function(_0x59426e,_0x3b45ec){return db[_0x1908('0x35')][_0x1908('0x50')]({'where':{'id':_0x59426e[_0x1908('0x4d')]['id']}})[_0x1908('0x2e')](handleEntityNotFound(_0x3b45ec,null))[_0x1908('0x2e')](removeEntity(_0x3b45ec,null))['catch'](handleError(_0x3b45ec,null));};exports[_0x1908('0x5a')]=function(_0x576d4c,_0x3bb13f){return db['OpenchannelQueue'][_0x1908('0x5a')]()[_0x1908('0x2e')](respondWithResult(_0x3bb13f,null))[_0x1908('0x4b')](handleError(_0x3bb13f,null));};exports[_0x1908('0x5b')]=function(_0x4ac411,_0x5984a0,_0xf4d457){var _0x250009={'raw':!![],'where':{}},_0x4647c7={},_0x4eb6ac;return db['OpenchannelQueue'][_0x1908('0x5c')]({'where':{'id':_0x4ac411[_0x1908('0x4d')]['id']}})[_0x1908('0x2e')](handleEntityNotFound(_0x5984a0,null))[_0x1908('0x2e')](function(_0x58d2ea){if(_0x58d2ea){_0x4eb6ac=_0x58d2ea[_0x1908('0x2f')]({'plain':!![]});_0x4647c7[_0x1908('0x3c')]=_[_0x1908('0x4e')](db[_0x1908('0x5d')]['rawAttributes']);_0x4647c7[_0x1908('0x38')]=_['keys'](_0x4ac411['query']);_0x4647c7[_0x1908('0x39')]=_[_0x1908('0x3a')](_0x4647c7[_0x1908('0x3c')],_0x4647c7[_0x1908('0x38')]);_0x250009[_0x1908('0x3b')]=_[_0x1908('0x3a')](_0x4647c7[_0x1908('0x3c')],qs['fields'](_0x4ac411[_0x1908('0x38')]['fields']));_0x250009[_0x1908('0x3b')]=_0x250009['attributes']['length']?_0x250009[_0x1908('0x3b')]:_0x4647c7['model'];if(!_0x4ac411[_0x1908('0x38')]['hasOwnProperty']('nolimit')){_0x250009[_0x1908('0x28')]=qs[_0x1908('0x28')](_0x4ac411[_0x1908('0x38')]['limit']);_0x250009[_0x1908('0x26')]=qs[_0x1908('0x26')](_0x4ac411['query'][_0x1908('0x26')]);}_0x250009[_0x1908('0x40')]=qs[_0x1908('0x41')](_0x4ac411['query'][_0x1908('0x41')]);_0x250009['where']=qs['filters'](_['pick'](_0x4ac411[_0x1908('0x38')],_0x4647c7[_0x1908('0x39')]));_0x250009[_0x1908('0x42')][_0x1908('0x5e')]=_0x58d2ea['id'];if(_0x4ac411[_0x1908('0x38')][_0x1908('0x44')]){_0x250009[_0x1908('0x42')]=_[_0x1908('0x45')](_0x250009[_0x1908('0x42')],{'$or':_[_0x1908('0x34')](_0x250009['attributes'],function(_0x272a27){var _0x2e11ac={};_0x2e11ac[_0x272a27]={'$like':'%'+_0x4ac411[_0x1908('0x38')][_0x1908('0x44')]+'%'};return _0x2e11ac;})});}_0x250009=_[_0x1908('0x45')]({},_0x250009,_0x4ac411[_0x1908('0x47')]);return db[_0x1908('0x5d')]['findAll'](_0x250009);}})[_0x1908('0x2e')](function(_0x313793){if(_0x313793){return db[_0x1908('0x5f')]['findAndCountAll']({'where':{'id':_[_0x1908('0x34')](_0x313793,_0x1908('0x60')),'role':_0x1908('0x61')},'attributes':['id','name',_0x1908('0x62'),_0x1908('0x63'),'createdAt']});}})[_0x1908('0x2e')](function(_0x5724c5){if(_0x5724c5){return{'count':_0x5724c5[_0x1908('0x29')],'rows':_['map'](_0x5724c5[_0x1908('0x4a')],function(_0x18aed1){return{'membername':_0x18aed1[_0x1908('0x32')],'UserId':_0x18aed1['id'],'queue_name':_0x4eb6ac[_0x1908('0x32')],'OpenchannelQueueId':_0x4eb6ac['id'],'interface':util[_0x1908('0x64')]('%s/%s','SIP',_0x18aed1['name']),'penalty':0x0,'paused':_0x18aed1[_0x1908('0x62')],'createdAt':_0x18aed1['createdAt'],'updatedAt':_0x18aed1[_0x1908('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5984a0,_0x250009))[_0x1908('0x4b')](handleError(_0x5984a0,null));};exports['getTeams']=function(_0x1d8fc5,_0x58f4d8,_0x4b3d84){var _0x501e2c={};var _0x308494={};var _0x38c84b;var _0xb28ff0;return db[_0x1908('0x35')][_0x1908('0x5c')]({'where':{'id':_0x1d8fc5[_0x1908('0x4d')]['id']}})[_0x1908('0x2e')](handleEntityNotFound(_0x58f4d8,null))[_0x1908('0x2e')](function(_0xab4236){if(_0xab4236){_0x38c84b=_0xab4236;_0x308494[_0x1908('0x3c')]=_[_0x1908('0x4e')](db[_0x1908('0x65')][_0x1908('0x4f')]);_0x308494[_0x1908('0x38')]=_[_0x1908('0x4e')](_0x1d8fc5[_0x1908('0x38')]);_0x308494[_0x1908('0x39')]=_[_0x1908('0x3a')](_0x308494[_0x1908('0x3c')],_0x308494[_0x1908('0x38')]);_0x501e2c[_0x1908('0x3b')]=_[_0x1908('0x3a')](_0x308494[_0x1908('0x3c')],qs[_0x1908('0x3d')](_0x1d8fc5['query'][_0x1908('0x3d')]));_0x501e2c[_0x1908('0x3b')]=_0x501e2c[_0x1908('0x3b')][_0x1908('0x3e')]?_0x501e2c[_0x1908('0x3b')]:_0x308494[_0x1908('0x3c')];_0x501e2c[_0x1908('0x40')]=qs[_0x1908('0x41')](_0x1d8fc5[_0x1908('0x38')][_0x1908('0x41')]);_0x501e2c[_0x1908('0x42')]=qs[_0x1908('0x39')](_['pick'](_0x1d8fc5[_0x1908('0x38')],_0x308494[_0x1908('0x39')]));if(_0x1d8fc5[_0x1908('0x38')][_0x1908('0x44')]){_0x501e2c['where']=_[_0x1908('0x45')](_0x501e2c['where'],{'$or':_[_0x1908('0x34')](_0x501e2c[_0x1908('0x3b')],function(_0x1b17bd){var _0x1d8b45={};_0x1d8b45[_0x1b17bd]={'$like':'%'+_0x1d8fc5[_0x1908('0x38')][_0x1908('0x44')]+'%'};return _0x1d8b45;})});}_0x501e2c=_[_0x1908('0x45')]({},_0x501e2c,_0x1d8fc5['options']);return _0x38c84b[_0x1908('0x66')](_0x501e2c);}})['then'](function(_0x590256){if(_0x590256){_0xb28ff0=_0x590256[_0x1908('0x3e')];if(!_0x1d8fc5[_0x1908('0x38')]['hasOwnProperty']('nolimit')){_0x501e2c['limit']=qs[_0x1908('0x28')](_0x1d8fc5[_0x1908('0x38')][_0x1908('0x28')]);_0x501e2c[_0x1908('0x26')]=qs['offset'](_0x1d8fc5[_0x1908('0x38')][_0x1908('0x26')]);}return _0x38c84b['getTeams'](_0x501e2c);}})[_0x1908('0x2e')](function(_0x31e034){if(_0x31e034){return _0x31e034?{'count':_0xb28ff0,'rows':_0x31e034}:null;}})[_0x1908('0x2e')](respondWithResult(_0x58f4d8,null))[_0x1908('0x4b')](handleError(_0x58f4d8,null));};exports['addTeams']=function(_0x16a64e,_0x4f9338,_0x12de9b){var _0x302605=_0x16a64e[_0x1908('0x59')][_0x1908('0x67')];return db['Team'][_0x1908('0x68')]({'where':{'id':_0x302605},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x1908('0x32'),_0x1908('0x69'),_0x1908('0x6a'),_0x1908('0x6b')],'raw':!![]}]})[_0x1908('0x2e')](function(_0x2700b8){if(_0x2700b8){var _0x320543=_[_0x1908('0x6c')](_0x2700b8,function(_0x9bac96){var _0x12e2ab=_0x9bac96[_0x1908('0x2f')]({'plain':!![]});return _0x12e2ab['Agents'];});return db[_0x1908('0x35')][_0x1908('0x50')]({'where':{'id':_0x16a64e['params']['id']}})[_0x1908('0x2e')](function(_0x266c01){return db['sequelize'][_0x1908('0x6d')](function(_0x72fea9){return _0x266c01[_0x1908('0x6e')](_0x302605,{'transaction':_0x72fea9})[_0x1908('0x2e')](function(){return BPromise['each'](_0x320543,function(_0x9fdf8b){return db[_0x1908('0x5d')][_0x1908('0x6f')]({'where':{'UserId':_0x9fdf8b['id'],'OpenchannelQueueId':_0x16a64e['params']['id']},'transaction':_0x72fea9});});})[_0x1908('0x2e')](function(){_0x320543[_0x1908('0x70')](function(_0x52a810){socket['emit'](_0x1908('0x71'),{'UserId':_0x52a810['id'],'OpenchannelQueueId':_0x266c01['id']});});});});});}})[_0x1908('0x2e')](respondWithStatusCode(_0x4f9338,null))[_0x1908('0x4b')](handleError(_0x4f9338,null));};exports[_0x1908('0x72')]=function(_0x4212f2,_0x76ecf,_0x4672d2){return db[_0x1908('0x65')][_0x1908('0x68')]({'where':{'id':_0x4212f2[_0x1908('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x1908('0x5f')],'as':_0x1908('0x73'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x76ecf,null))[_0x1908('0x2e')](function(_0x243fe0){var _0xb375bc=_[_0x1908('0x34')](_0x243fe0,'id');var _0x3ef94e=[];var _0x79b8f=[];var _0x40e7f5=squel[_0x1908('0x74')]();_0x40e7f5['field']('tq.TeamId')[_0x1908('0x75')]('team_has_openchannel_queues','tq')[_0x1908('0x76')]('user_has_teams','ut',_0x1908('0x77'))[_0x1908('0x42')](_0x1908('0x78'),_0x4212f2['params']['id']);for(var _0x296ada=0x0;_0x296ada<_0x243fe0[_0x1908('0x3e')];_0x296ada+=0x1){let _0x4a2afb=_0x243fe0[_0x296ada];for(var _0x26bdee=0x0;_0x26bdee<_0x4a2afb['Agents'][_0x1908('0x3e')];_0x26bdee+=0x1){let _0x2dd02b=_0x4a2afb[_0x1908('0x73')][_0x26bdee];var _0x4dcfe1=_0x40e7f5[_0x1908('0x79')]();_0x4dcfe1[_0x1908('0x42')]('ut.UserId\x20=\x20?',_0x2dd02b['id']);_0x79b8f[_0x1908('0x7a')](db['sequelize']['query'](_0x4dcfe1[_0x1908('0x7b')](),{'type':db[_0x1908('0x7c')][_0x1908('0x7d')][_0x1908('0x7e')]})[_0x1908('0x2e')](function(_0x40270f){if(_0x40270f[_0x1908('0x3e')]===0x1){return _0x2dd02b['id'];}else{var _0x41a4c6=_[_0x1908('0x7f')](_[_0x1908('0x34')](_0x40270f,'TeamId'),function(_0x501959){return _[_0x1908('0x80')](_0xb375bc,_0x501959);});if(_0x41a4c6){return _0x2dd02b['id'];}}}));}}return BPromise['all'](_0x79b8f)[_0x1908('0x2e')](function(_0x2db4bd){_0x3ef94e=_(_0x3ef94e)['union'](_0x2db4bd)[_0x1908('0x81')]()[_0x1908('0x82')]();return db['OpenchannelQueue'][_0x1908('0x50')]({'where':{'id':_0x4212f2[_0x1908('0x4d')]['id']}})[_0x1908('0x2e')](function(_0x29382b){return db[_0x1908('0x7c')][_0x1908('0x6d')](function(_0xa74963){return _0x29382b[_0x1908('0x72')](_0x4212f2[_0x1908('0x38')]['ids'],{'transaction':_0xa74963})['then'](function(){if(!_[_0x1908('0x83')](_0x3ef94e)){return _0x29382b[_0x1908('0x84')](_0x3ef94e,{'transaction':_0xa74963});}})[_0x1908('0x2e')](function(){_0x3ef94e['forEach'](function(_0x5bfec8){socket[_0x1908('0x85')](_0x1908('0x86'),{'UserId':_0x5bfec8,'OpenchannelQueueId':_0x29382b['id']});});});});});});})[_0x1908('0x2e')](respondWithStatusCode(_0x76ecf,null))[_0x1908('0x4b')](handleError(_0x76ecf,null));};exports['addAgents']=function(_0x3cf40c,_0xb059a2,_0x5270ac){return db[_0x1908('0x35')][_0x1908('0x50')]({'where':{'id':_0x3cf40c[_0x1908('0x4d')]['id']}})[_0x1908('0x2e')](handleEntityNotFound(_0xb059a2,null))[_0x1908('0x2e')](function(_0x65536){if(_0x65536){return _0x65536['addAgents'](_0x3cf40c['body'][_0x1908('0x67')],_[_0x1908('0x87')](_0x3cf40c[_0x1908('0x59')],[_0x1908('0x67'),'id'])||{})[_0x1908('0x88')](function(_0x5b6e53){for(var _0x2888c5=0x0;_0x2888c5<_0x3cf40c[_0x1908('0x59')][_0x1908('0x67')][_0x1908('0x3e')];_0x2888c5+=0x1){socket[_0x1908('0x85')](_0x1908('0x71'),{'UserId':Number(_0x3cf40c[_0x1908('0x59')][_0x1908('0x67')][_0x2888c5]),'OpenchannelQueueId':Number(_0x3cf40c[_0x1908('0x4d')]['id'])});}return _0x5b6e53;});}})['then'](respondWithResult(_0xb059a2,null))[_0x1908('0x4b')](handleError(_0xb059a2,null));};exports[_0x1908('0x84')]=function(_0x582127,_0x281f22,_0x5be263){return db[_0x1908('0x35')]['find']({'where':{'id':_0x582127[_0x1908('0x4d')]['id']}})[_0x1908('0x2e')](handleEntityNotFound(_0x281f22,null))[_0x1908('0x2e')](function(_0x5f1b24){if(_0x5f1b24){return _0x5f1b24[_0x1908('0x84')](_0x582127['query'][_0x1908('0x67')])[_0x1908('0x2e')](function(){if(_['isArray'](_0x582127[_0x1908('0x38')][_0x1908('0x67')])){for(var _0x31f9fc=0x0;_0x31f9fc<_0x582127[_0x1908('0x38')]['ids'][_0x1908('0x3e')];_0x31f9fc+=0x1){socket[_0x1908('0x85')](_0x1908('0x86'),{'UserId':Number(_0x582127[_0x1908('0x38')][_0x1908('0x67')][_0x31f9fc]),'OpenchannelQueueId':Number(_0x582127['params']['id'])});}}else{socket[_0x1908('0x85')]('userOpenchannelQueue:remove',{'UserId':Number(_0x582127[_0x1908('0x38')][_0x1908('0x67')]),'OpenchannelQueueId':Number(_0x582127[_0x1908('0x4d')]['id'])});}});}})[_0x1908('0x2e')](respondWithStatusCode(_0x281f22,null))[_0x1908('0x4b')](handleError(_0x281f22,null));};exports[_0x1908('0x89')]=function(_0x2c1b45,_0x14f0fb,_0x32727b){var _0x44e76a={};var _0x475849={};var _0x5638fb;var _0x412bcb;return db[_0x1908('0x35')][_0x1908('0x5c')]({'where':{'id':_0x2c1b45[_0x1908('0x4d')]['id']}})[_0x1908('0x2e')](handleEntityNotFound(_0x14f0fb,null))[_0x1908('0x2e')](function(_0x34c81e){if(_0x34c81e){_0x5638fb=_0x34c81e;_0x475849[_0x1908('0x3c')]=_[_0x1908('0x4e')](db[_0x1908('0x5f')][_0x1908('0x4f')]);_0x475849[_0x1908('0x38')]=_[_0x1908('0x4e')](_0x2c1b45[_0x1908('0x38')]);_0x475849[_0x1908('0x39')]=_[_0x1908('0x3a')](_0x475849[_0x1908('0x3c')],_0x475849[_0x1908('0x38')]);_0x44e76a[_0x1908('0x3b')]=_[_0x1908('0x3a')](_0x475849[_0x1908('0x3c')],qs[_0x1908('0x3d')](_0x2c1b45[_0x1908('0x38')]['fields']));_0x44e76a['attributes']=_0x44e76a[_0x1908('0x3b')][_0x1908('0x3e')]?_0x44e76a[_0x1908('0x3b')]:_0x475849['model'];_0x44e76a[_0x1908('0x40')]=qs[_0x1908('0x41')](_0x2c1b45[_0x1908('0x38')][_0x1908('0x41')]);_0x44e76a[_0x1908('0x42')]=qs['filters'](_[_0x1908('0x43')](_0x2c1b45['query'],_0x475849[_0x1908('0x39')]));if(_0x2c1b45[_0x1908('0x38')][_0x1908('0x44')]){_0x44e76a[_0x1908('0x42')]=_[_0x1908('0x45')](_0x44e76a[_0x1908('0x42')],{'$or':_[_0x1908('0x34')](_0x44e76a['attributes'],function(_0x133938){var _0x4e162f={};_0x4e162f[_0x133938]={'$like':'%'+_0x2c1b45[_0x1908('0x38')][_0x1908('0x44')]+'%'};return _0x4e162f;})});}_0x44e76a=_['merge']({},_0x44e76a,_0x2c1b45[_0x1908('0x47')]);return _0x5638fb[_0x1908('0x89')](_0x44e76a);}})[_0x1908('0x2e')](function(_0x649cd2){if(_0x649cd2){_0x412bcb=_0x649cd2[_0x1908('0x3e')];if(!_0x2c1b45['query'][_0x1908('0x3f')](_0x1908('0x8a'))){_0x44e76a['limit']=qs[_0x1908('0x28')](_0x2c1b45[_0x1908('0x38')][_0x1908('0x28')]);_0x44e76a[_0x1908('0x26')]=qs[_0x1908('0x26')](_0x2c1b45[_0x1908('0x38')][_0x1908('0x26')]);}return _0x5638fb[_0x1908('0x89')](_0x44e76a);}})[_0x1908('0x2e')](function(_0x21d18b){if(_0x21d18b){return _0x21d18b?{'count':_0x412bcb,'rows':_0x21d18b}:null;}})[_0x1908('0x2e')](respondWithResult(_0x14f0fb,null))[_0x1908('0x4b')](handleError(_0x14f0fb,null));};
\ No newline at end of file
+var _0xe8ac=['compact','value','emit','userOpenchannelQueue:remove','spread','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','get','OpenchannelQueues','UserProfileResource','destroy','error','stack','name','map','OpenchannelQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','update','body','describe','getMembers','UserOpenchannelQueue','length','nolimit','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','format','%s/%s','createdAt','findOne','Team','addTeams','ids','voicePause','interface','Agents','sequelize','transaction','findOrCreate','forEach','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes'];(function(_0x3a6b8f,_0x3ee3a1){var _0x4a9573=function(_0x289c51){while(--_0x289c51){_0x3a6b8f['push'](_0x3a6b8f['shift']());}};_0x4a9573(++_0x3ee3a1);}(_0xe8ac,0x91));var _0xce8a=function(_0x23fb65,_0x56a873){_0x23fb65=_0x23fb65-0x0;var _0x42d6bb=_0xe8ac[_0x23fb65];return _0x42d6bb;};'use strict';var emlformat=require(_0xce8a('0x0'));var rimraf=require(_0xce8a('0x1'));var zipdir=require(_0xce8a('0x2'));var jsonpatch=require(_0xce8a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xce8a('0x4'));var Mustache=require(_0xce8a('0x5'));var util=require('util');var path=require(_0xce8a('0x6'));var sox=require(_0xce8a('0x7'));var csv=require(_0xce8a('0x8'));var ejs=require(_0xce8a('0x9'));var fs=require('fs');var fs_extra=require(_0xce8a('0xa'));var _=require(_0xce8a('0xb'));var squel=require(_0xce8a('0xc'));var crypto=require(_0xce8a('0xd'));var jsforce=require(_0xce8a('0xe'));var deskjs=require(_0xce8a('0xf'));var toCsv=require(_0xce8a('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xce8a('0x10'));var qs=require(_0xce8a('0x11'));var as=require(_0xce8a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xce8a('0x13'))('api');var utils=require(_0xce8a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xce8a('0x15'));var db=require(_0xce8a('0x16'))['db'];config[_0xce8a('0x17')]=_[_0xce8a('0x18')](config[_0xce8a('0x17')],{'host':_0xce8a('0x19'),'port':0x18eb});var socket=require(_0xce8a('0x1a'))(new Redis(config[_0xce8a('0x17')]));require(_0xce8a('0x1b'))[_0xce8a('0x1c')](socket);function respondWithStatusCode(_0x49e720,_0x51f8ed){_0x51f8ed=_0x51f8ed||0xcc;return function(_0x531242){if(_0x531242){return _0x49e720[_0xce8a('0x1d')](_0x51f8ed);}return _0x49e720['status'](_0x51f8ed)[_0xce8a('0x1e')]();};}function respondWithResult(_0x3ad819,_0x26668d){_0x26668d=_0x26668d||0xc8;return function(_0x58c15b){if(_0x58c15b){return _0x3ad819[_0xce8a('0x1f')](_0x26668d)[_0xce8a('0x20')](_0x58c15b);}};}function respondWithFilteredResult(_0x19924b,_0x1a6b6d){return function(_0x66b454){if(_0x66b454){var _0xf49d62=typeof _0x1a6b6d[_0xce8a('0x21')]===_0xce8a('0x22')&&typeof _0x1a6b6d[_0xce8a('0x23')]==='undefined';var _0x56445c=_0x66b454[_0xce8a('0x24')];var _0x373b07=_0xf49d62?0x0:_0x1a6b6d[_0xce8a('0x21')];var _0x1b7fd9=_0xf49d62?_0x66b454[_0xce8a('0x24')]:_0x1a6b6d[_0xce8a('0x21')]+_0x1a6b6d[_0xce8a('0x23')];var _0x33ed30;if(_0x1b7fd9>=_0x56445c){_0x1b7fd9=_0x56445c;_0x33ed30=0xc8;}else{_0x33ed30=0xce;}_0x19924b[_0xce8a('0x1f')](_0x33ed30);return _0x19924b[_0xce8a('0x25')](_0xce8a('0x26'),_0x373b07+'-'+_0x1b7fd9+'/'+_0x56445c)[_0xce8a('0x20')](_0x66b454);}return null;};}function patchUpdates(_0x3f6299){return function(_0x3407c0){try{jsonpatch[_0xce8a('0x27')](_0x3407c0,_0x3f6299,!![]);}catch(_0x3ea32f){return BPromise[_0xce8a('0x28')](_0x3ea32f);}return _0x3407c0['save']();};}function saveUpdates(_0x451516,_0x1b7ede){return function(_0xfb07b){if(_0xfb07b){return _0xfb07b['update'](_0x451516)[_0xce8a('0x29')](function(_0x109b45){return _0x109b45;});}return null;};}function removeEntity(_0x1600c1,_0x2aa959){return function(_0x253601){if(_0x253601){return _0x253601['destroy']()[_0xce8a('0x29')](function(){var _0x59b3da=_0x253601[_0xce8a('0x2a')]({'plain':!![]});var _0x4a4d22=_0xce8a('0x2b');return db[_0xce8a('0x2c')][_0xce8a('0x2d')]({'where':{'type':_0x4a4d22,'resourceId':_0x59b3da['id']}})[_0xce8a('0x29')](function(){return _0x253601;});})[_0xce8a('0x29')](function(){_0x1600c1['status'](0xcc)[_0xce8a('0x1e')]();});}};}function handleEntityNotFound(_0x42083e,_0x5446ef){return function(_0x512387){if(!_0x512387){_0x42083e[_0xce8a('0x1d')](0x194);}return _0x512387;};}function handleError(_0x3a2622,_0x2fe5c0){_0x2fe5c0=_0x2fe5c0||0x1f4;return function(_0x4f2101){logger[_0xce8a('0x2e')](_0x4f2101[_0xce8a('0x2f')]);if(_0x4f2101[_0xce8a('0x30')]){delete _0x4f2101['name'];}_0x3a2622[_0xce8a('0x1f')](_0x2fe5c0)['send'](_0x4f2101);};}exports['index']=function(_0x4bd229,_0x207111){var _0x43debd={},_0x18d5da={},_0x26e74f={'count':0x0,'rows':[]};var _0x2c09fb=_[_0xce8a('0x31')](db[_0xce8a('0x32')][_0xce8a('0x33')],function(_0x4bf8cf){return{'name':_0x4bf8cf[_0xce8a('0x34')],'type':_0x4bf8cf['type'][_0xce8a('0x35')]};});_0x18d5da[_0xce8a('0x36')]=_['map'](_0x2c09fb,_0xce8a('0x30'));_0x18d5da[_0xce8a('0x37')]=_[_0xce8a('0x38')](_0x4bd229[_0xce8a('0x37')]);_0x18d5da[_0xce8a('0x39')]=_[_0xce8a('0x3a')](_0x18d5da[_0xce8a('0x36')],_0x18d5da['query']);_0x43debd[_0xce8a('0x3b')]=_[_0xce8a('0x3a')](_0x18d5da[_0xce8a('0x36')],qs[_0xce8a('0x3c')](_0x4bd229[_0xce8a('0x37')]['fields']));_0x43debd[_0xce8a('0x3b')]=_0x43debd[_0xce8a('0x3b')]['length']?_0x43debd[_0xce8a('0x3b')]:_0x18d5da[_0xce8a('0x36')];if(!_0x4bd229['query'][_0xce8a('0x3d')]('nolimit')){_0x43debd['limit']=qs[_0xce8a('0x23')](_0x4bd229[_0xce8a('0x37')][_0xce8a('0x23')]);_0x43debd[_0xce8a('0x21')]=qs[_0xce8a('0x21')](_0x4bd229[_0xce8a('0x37')]['offset']);}_0x43debd[_0xce8a('0x3e')]=qs['sort'](_0x4bd229[_0xce8a('0x37')][_0xce8a('0x3f')]);_0x43debd[_0xce8a('0x40')]=qs[_0xce8a('0x39')](_[_0xce8a('0x41')](_0x4bd229['query'],_0x18d5da[_0xce8a('0x39')]),_0x2c09fb);if(_0x4bd229['query'][_0xce8a('0x42')]){_0x43debd[_0xce8a('0x40')]=_[_0xce8a('0x43')](_0x43debd[_0xce8a('0x40')],{'$or':_['map'](_0x2c09fb,function(_0x2e0016){if(_0x2e0016[_0xce8a('0x44')]!==_0xce8a('0x45')){var _0x2e9e44={};_0x2e9e44[_0x2e0016[_0xce8a('0x30')]]={'$like':'%'+_0x4bd229[_0xce8a('0x37')][_0xce8a('0x42')]+'%'};return _0x2e9e44;}})});}_0x43debd=_[_0xce8a('0x43')]({},_0x43debd,_0x4bd229[_0xce8a('0x46')]);var _0x2679e7={'where':_0x43debd[_0xce8a('0x40')]};return db['OpenchannelQueue'][_0xce8a('0x24')](_0x2679e7)[_0xce8a('0x29')](function(_0x3af54e){_0x26e74f[_0xce8a('0x24')]=_0x3af54e;if(_0x4bd229[_0xce8a('0x37')]['includeAll']){_0x43debd[_0xce8a('0x47')]=[{'all':!![]}];}return db[_0xce8a('0x32')][_0xce8a('0x48')](_0x43debd);})[_0xce8a('0x29')](function(_0x4a0280){_0x26e74f[_0xce8a('0x49')]=_0x4a0280;return _0x26e74f;})[_0xce8a('0x29')](respondWithFilteredResult(_0x207111,_0x43debd))[_0xce8a('0x4a')](handleError(_0x207111,null));};exports[_0xce8a('0x4b')]=function(_0x2e685c,_0x3aba8b){var _0x45772b={'raw':!![],'where':{'id':_0x2e685c[_0xce8a('0x4c')]['id']}},_0x5ea5c9={};_0x5ea5c9[_0xce8a('0x36')]=_[_0xce8a('0x38')](db[_0xce8a('0x32')][_0xce8a('0x33')]);_0x5ea5c9[_0xce8a('0x37')]=_[_0xce8a('0x38')](_0x2e685c[_0xce8a('0x37')]);_0x5ea5c9['filters']=_['intersection'](_0x5ea5c9[_0xce8a('0x36')],_0x5ea5c9[_0xce8a('0x37')]);_0x45772b[_0xce8a('0x3b')]=_[_0xce8a('0x3a')](_0x5ea5c9[_0xce8a('0x36')],qs[_0xce8a('0x3c')](_0x2e685c['query'][_0xce8a('0x3c')]));_0x45772b[_0xce8a('0x3b')]=_0x45772b[_0xce8a('0x3b')]['length']?_0x45772b['attributes']:_0x5ea5c9[_0xce8a('0x36')];if(_0x2e685c[_0xce8a('0x37')][_0xce8a('0x4d')]){_0x45772b[_0xce8a('0x47')]=[{'all':!![]}];}_0x45772b=_[_0xce8a('0x43')]({},_0x45772b,_0x2e685c[_0xce8a('0x46')]);return db['OpenchannelQueue']['find'](_0x45772b)[_0xce8a('0x29')](handleEntityNotFound(_0x3aba8b,null))[_0xce8a('0x29')](respondWithResult(_0x3aba8b,null))[_0xce8a('0x4a')](handleError(_0x3aba8b,null));};exports[_0xce8a('0x4e')]=function(_0x448659,_0x2d44f9){return db[_0xce8a('0x32')][_0xce8a('0x4e')](_0x448659['body'],{})[_0xce8a('0x29')](function(_0x55cba1){var _0x5163c0=_0x448659[_0xce8a('0x4f')][_0xce8a('0x2a')]({'plain':!![]});if(!_0x5163c0)throw new Error(_0xce8a('0x50'));if(_0x5163c0[_0xce8a('0x51')]===_0xce8a('0x4f')){var _0x2635dd=_0x55cba1[_0xce8a('0x2a')]({'plain':!![]});var _0x2f1b7f=_0xce8a('0x2b');return db[_0xce8a('0x52')][_0xce8a('0x53')]({'where':{'name':_0x2f1b7f,'userProfileId':_0x5163c0[_0xce8a('0x54')]},'raw':!![]})[_0xce8a('0x29')](function(_0x37c85f){if(_0x37c85f&&_0x37c85f[_0xce8a('0x55')]===0x0){return db[_0xce8a('0x2c')][_0xce8a('0x4e')]({'name':_0x2635dd['name'],'resourceId':_0x2635dd['id'],'type':_0x37c85f[_0xce8a('0x30')],'sectionId':_0x37c85f['id']},{})[_0xce8a('0x29')](function(){return _0x55cba1;});}else{return _0x55cba1;}})['catch'](function(_0x85be34){logger[_0xce8a('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x85be34);throw _0x85be34;});}return _0x55cba1;})['then'](respondWithResult(_0x2d44f9,0xc9))[_0xce8a('0x4a')](handleError(_0x2d44f9,null));};exports[_0xce8a('0x56')]=function(_0x3177df,_0x56df8e){if(_0x3177df['body']['id']){delete _0x3177df[_0xce8a('0x57')]['id'];}return db['OpenchannelQueue'][_0xce8a('0x53')]({'where':{'id':_0x3177df[_0xce8a('0x4c')]['id']}})[_0xce8a('0x29')](handleEntityNotFound(_0x56df8e,null))['then'](saveUpdates(_0x3177df[_0xce8a('0x57')],null))[_0xce8a('0x29')](respondWithResult(_0x56df8e,null))['catch'](handleError(_0x56df8e,null));};exports[_0xce8a('0x2d')]=function(_0x3d81a5,_0x15a2a4){return db[_0xce8a('0x32')]['find']({'where':{'id':_0x3d81a5[_0xce8a('0x4c')]['id']}})[_0xce8a('0x29')](handleEntityNotFound(_0x15a2a4,null))[_0xce8a('0x29')](removeEntity(_0x15a2a4,null))['catch'](handleError(_0x15a2a4,null));};exports['describe']=function(_0x5bfdcc,_0x1f35ed){return db['OpenchannelQueue'][_0xce8a('0x58')]()[_0xce8a('0x29')](respondWithResult(_0x1f35ed,null))[_0xce8a('0x4a')](handleError(_0x1f35ed,null));};exports[_0xce8a('0x59')]=function(_0x35a7aa,_0xffeeba,_0xade6c9){var _0x1275d7={'raw':!![],'where':{}},_0x991e71={},_0x58f8a8;return db[_0xce8a('0x32')]['findOne']({'where':{'id':_0x35a7aa[_0xce8a('0x4c')]['id']}})[_0xce8a('0x29')](handleEntityNotFound(_0xffeeba,null))[_0xce8a('0x29')](function(_0x5da431){if(_0x5da431){_0x58f8a8=_0x5da431[_0xce8a('0x2a')]({'plain':!![]});_0x991e71['model']=_[_0xce8a('0x38')](db[_0xce8a('0x5a')][_0xce8a('0x33')]);_0x991e71[_0xce8a('0x37')]=_['keys'](_0x35a7aa[_0xce8a('0x37')]);_0x991e71[_0xce8a('0x39')]=_[_0xce8a('0x3a')](_0x991e71['model'],_0x991e71[_0xce8a('0x37')]);_0x1275d7[_0xce8a('0x3b')]=_[_0xce8a('0x3a')](_0x991e71[_0xce8a('0x36')],qs['fields'](_0x35a7aa[_0xce8a('0x37')]['fields']));_0x1275d7[_0xce8a('0x3b')]=_0x1275d7[_0xce8a('0x3b')][_0xce8a('0x5b')]?_0x1275d7[_0xce8a('0x3b')]:_0x991e71[_0xce8a('0x36')];if(!_0x35a7aa[_0xce8a('0x37')][_0xce8a('0x3d')](_0xce8a('0x5c'))){_0x1275d7['limit']=qs['limit'](_0x35a7aa[_0xce8a('0x37')]['limit']);_0x1275d7['offset']=qs[_0xce8a('0x21')](_0x35a7aa[_0xce8a('0x37')][_0xce8a('0x21')]);}_0x1275d7[_0xce8a('0x3e')]=qs[_0xce8a('0x3f')](_0x35a7aa[_0xce8a('0x37')][_0xce8a('0x3f')]);_0x1275d7[_0xce8a('0x40')]=qs[_0xce8a('0x39')](_[_0xce8a('0x41')](_0x35a7aa['query'],_0x991e71[_0xce8a('0x39')]));_0x1275d7[_0xce8a('0x40')][_0xce8a('0x5d')]=_0x5da431['id'];if(_0x35a7aa[_0xce8a('0x37')][_0xce8a('0x42')]){_0x1275d7['where']=_[_0xce8a('0x43')](_0x1275d7['where'],{'$or':_[_0xce8a('0x31')](_0x1275d7[_0xce8a('0x3b')],function(_0x198399){var _0x21b1ec={};_0x21b1ec[_0x198399]={'$like':'%'+_0x35a7aa['query'][_0xce8a('0x42')]+'%'};return _0x21b1ec;})});}_0x1275d7=_[_0xce8a('0x43')]({},_0x1275d7,_0x35a7aa[_0xce8a('0x46')]);return db[_0xce8a('0x5a')]['findAll'](_0x1275d7);}})[_0xce8a('0x29')](function(_0x235b53){if(_0x235b53){return db[_0xce8a('0x5e')][_0xce8a('0x5f')]({'where':{'id':_[_0xce8a('0x31')](_0x235b53,_0xce8a('0x60')),'role':_0xce8a('0x61')},'attributes':['id',_0xce8a('0x30'),_0xce8a('0x62'),_0xce8a('0x63'),'createdAt']});}})[_0xce8a('0x29')](function(_0x25775b){if(_0x25775b){return{'count':_0x25775b[_0xce8a('0x24')],'rows':_['map'](_0x25775b[_0xce8a('0x49')],function(_0x572ba6){return{'membername':_0x572ba6[_0xce8a('0x30')],'UserId':_0x572ba6['id'],'queue_name':_0x58f8a8[_0xce8a('0x30')],'OpenchannelQueueId':_0x58f8a8['id'],'interface':util[_0xce8a('0x64')](_0xce8a('0x65'),'SIP',_0x572ba6[_0xce8a('0x30')]),'penalty':0x0,'paused':_0x572ba6['openchannelPause'],'createdAt':_0x572ba6[_0xce8a('0x66')],'updatedAt':_0x572ba6[_0xce8a('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xce8a('0x29')](respondWithFilteredResult(_0xffeeba,_0x1275d7))[_0xce8a('0x4a')](handleError(_0xffeeba,null));};exports['getTeams']=function(_0x3eea77,_0x35713e,_0x404a49){var _0x73c842={};var _0x32eb66={};var _0x319098;var _0x9c0da4;return db[_0xce8a('0x32')][_0xce8a('0x67')]({'where':{'id':_0x3eea77['params']['id']}})[_0xce8a('0x29')](handleEntityNotFound(_0x35713e,null))[_0xce8a('0x29')](function(_0x581f51){if(_0x581f51){_0x319098=_0x581f51;_0x32eb66[_0xce8a('0x36')]=_[_0xce8a('0x38')](db[_0xce8a('0x68')][_0xce8a('0x33')]);_0x32eb66['query']=_['keys'](_0x3eea77['query']);_0x32eb66[_0xce8a('0x39')]=_[_0xce8a('0x3a')](_0x32eb66['model'],_0x32eb66[_0xce8a('0x37')]);_0x73c842[_0xce8a('0x3b')]=_[_0xce8a('0x3a')](_0x32eb66[_0xce8a('0x36')],qs[_0xce8a('0x3c')](_0x3eea77[_0xce8a('0x37')]['fields']));_0x73c842['attributes']=_0x73c842['attributes']['length']?_0x73c842[_0xce8a('0x3b')]:_0x32eb66[_0xce8a('0x36')];_0x73c842[_0xce8a('0x3e')]=qs[_0xce8a('0x3f')](_0x3eea77['query'][_0xce8a('0x3f')]);_0x73c842['where']=qs['filters'](_['pick'](_0x3eea77[_0xce8a('0x37')],_0x32eb66[_0xce8a('0x39')]));if(_0x3eea77[_0xce8a('0x37')][_0xce8a('0x42')]){_0x73c842[_0xce8a('0x40')]=_['merge'](_0x73c842[_0xce8a('0x40')],{'$or':_['map'](_0x73c842[_0xce8a('0x3b')],function(_0x3dda98){var _0x4efbd3={};_0x4efbd3[_0x3dda98]={'$like':'%'+_0x3eea77[_0xce8a('0x37')]['filter']+'%'};return _0x4efbd3;})});}_0x73c842=_[_0xce8a('0x43')]({},_0x73c842,_0x3eea77[_0xce8a('0x46')]);return _0x319098['getTeams'](_0x73c842);}})[_0xce8a('0x29')](function(_0x3346b4){if(_0x3346b4){_0x9c0da4=_0x3346b4[_0xce8a('0x5b')];if(!_0x3eea77[_0xce8a('0x37')]['hasOwnProperty'](_0xce8a('0x5c'))){_0x73c842[_0xce8a('0x23')]=qs[_0xce8a('0x23')](_0x3eea77['query']['limit']);_0x73c842[_0xce8a('0x21')]=qs[_0xce8a('0x21')](_0x3eea77['query'][_0xce8a('0x21')]);}return _0x319098['getTeams'](_0x73c842);}})[_0xce8a('0x29')](function(_0x199cef){if(_0x199cef){return _0x199cef?{'count':_0x9c0da4,'rows':_0x199cef}:null;}})[_0xce8a('0x29')](respondWithResult(_0x35713e,null))[_0xce8a('0x4a')](handleError(_0x35713e,null));};exports[_0xce8a('0x69')]=function(_0x387ef6,_0x38416c,_0x398bd5){var _0x53bf9d=_0x387ef6[_0xce8a('0x57')][_0xce8a('0x6a')];return db[_0xce8a('0x68')][_0xce8a('0x48')]({'where':{'id':_0x53bf9d},'attributes':['id'],'include':[{'model':db[_0xce8a('0x5e')],'as':'Agents','attributes':['id',_0xce8a('0x30'),'online',_0xce8a('0x6b'),_0xce8a('0x6c')],'raw':!![]}]})[_0xce8a('0x29')](function(_0x2881a1){if(_0x2881a1){var _0x39b78=_['flatMap'](_0x2881a1,function(_0x2c5aef){var _0x37e2d6=_0x2c5aef[_0xce8a('0x2a')]({'plain':!![]});return _0x37e2d6[_0xce8a('0x6d')];});return db[_0xce8a('0x32')][_0xce8a('0x53')]({'where':{'id':_0x387ef6[_0xce8a('0x4c')]['id']}})[_0xce8a('0x29')](function(_0x22e026){return db[_0xce8a('0x6e')][_0xce8a('0x6f')](function(_0x517162){return _0x22e026[_0xce8a('0x69')](_0x53bf9d,{'transaction':_0x517162})[_0xce8a('0x29')](function(){return BPromise['each'](_0x39b78,function(_0x395cc6){return db['UserOpenchannelQueue'][_0xce8a('0x70')]({'where':{'UserId':_0x395cc6['id'],'OpenchannelQueueId':_0x387ef6[_0xce8a('0x4c')]['id']},'transaction':_0x517162});});})[_0xce8a('0x29')](function(){_0x39b78[_0xce8a('0x71')](function(_0x588504){socket['emit'](_0xce8a('0x72'),{'UserId':_0x588504['id'],'OpenchannelQueueId':_0x22e026['id']});});});});});}})[_0xce8a('0x29')](respondWithStatusCode(_0x38416c,null))['catch'](handleError(_0x38416c,null));};exports[_0xce8a('0x73')]=function(_0x4038f5,_0x46df6f,_0x2945f5){return db['Team'][_0xce8a('0x48')]({'where':{'id':_0x4038f5['query'][_0xce8a('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xce8a('0x5e')],'as':_0xce8a('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xce8a('0x29')](handleEntityNotFound(_0x46df6f,null))[_0xce8a('0x29')](function(_0x3ec694){var _0x367b1a=_[_0xce8a('0x31')](_0x3ec694,'id');var _0x351334=[];var _0x52f04d=[];var _0x2d4130=squel[_0xce8a('0x74')]();_0x2d4130[_0xce8a('0x75')](_0xce8a('0x76'))[_0xce8a('0x77')](_0xce8a('0x78'),'tq')[_0xce8a('0x79')](_0xce8a('0x7a'),'ut',_0xce8a('0x7b'))[_0xce8a('0x40')]('OpenchannelQueueId\x20=\x20?',_0x4038f5['params']['id']);for(var _0x4e87ab=0x0;_0x4e87ab<_0x3ec694[_0xce8a('0x5b')];_0x4e87ab+=0x1){let _0x16c1d4=_0x3ec694[_0x4e87ab];for(var _0x57fbf0=0x0;_0x57fbf0<_0x16c1d4['Agents'][_0xce8a('0x5b')];_0x57fbf0+=0x1){let _0x5003df=_0x16c1d4[_0xce8a('0x6d')][_0x57fbf0];var _0x1ceee3=_0x2d4130[_0xce8a('0x7c')]();_0x1ceee3[_0xce8a('0x40')](_0xce8a('0x7d'),_0x5003df['id']);_0x52f04d['push'](db[_0xce8a('0x6e')][_0xce8a('0x37')](_0x1ceee3[_0xce8a('0x7e')](),{'type':db[_0xce8a('0x6e')]['QueryTypes'][_0xce8a('0x7f')]})[_0xce8a('0x29')](function(_0xf66e85){if(_0xf66e85[_0xce8a('0x5b')]===0x1){return _0x5003df['id'];}else{var _0x23b5d4=_[_0xce8a('0x80')](_[_0xce8a('0x31')](_0xf66e85,_0xce8a('0x81')),function(_0x233cfc){return _[_0xce8a('0x82')](_0x367b1a,_0x233cfc);});if(_0x23b5d4){return _0x5003df['id'];}}}));}}return BPromise['all'](_0x52f04d)['then'](function(_0x36c3aa){_0x351334=_(_0x351334)['union'](_0x36c3aa)[_0xce8a('0x83')]()[_0xce8a('0x84')]();return db[_0xce8a('0x32')][_0xce8a('0x53')]({'where':{'id':_0x4038f5[_0xce8a('0x4c')]['id']}})[_0xce8a('0x29')](function(_0x58ac36){return db['sequelize'][_0xce8a('0x6f')](function(_0x29c4b4){return _0x58ac36[_0xce8a('0x73')](_0x4038f5[_0xce8a('0x37')]['ids'],{'transaction':_0x29c4b4})[_0xce8a('0x29')](function(){if(!_['isEmpty'](_0x351334)){return _0x58ac36['removeAgents'](_0x351334,{'transaction':_0x29c4b4});}})[_0xce8a('0x29')](function(){_0x351334[_0xce8a('0x71')](function(_0x3ae043){socket[_0xce8a('0x85')](_0xce8a('0x86'),{'UserId':_0x3ae043,'OpenchannelQueueId':_0x58ac36['id']});});});});});});})['then'](respondWithStatusCode(_0x46df6f,null))[_0xce8a('0x4a')](handleError(_0x46df6f,null));};exports['addAgents']=function(_0x3fa1cf,_0x37d7bd,_0x11c25c){return db[_0xce8a('0x32')]['find']({'where':{'id':_0x3fa1cf[_0xce8a('0x4c')]['id']}})[_0xce8a('0x29')](handleEntityNotFound(_0x37d7bd,null))[_0xce8a('0x29')](function(_0x1c5e58){if(_0x1c5e58){return _0x1c5e58['addAgents'](_0x3fa1cf['body'][_0xce8a('0x6a')],_['omit'](_0x3fa1cf[_0xce8a('0x57')],[_0xce8a('0x6a'),'id'])||{})[_0xce8a('0x87')](function(_0x3bb1ed){for(var _0x340cf3=0x0;_0x340cf3<_0x3fa1cf[_0xce8a('0x57')][_0xce8a('0x6a')][_0xce8a('0x5b')];_0x340cf3+=0x1){socket[_0xce8a('0x85')](_0xce8a('0x72'),{'UserId':Number(_0x3fa1cf['body'][_0xce8a('0x6a')][_0x340cf3]),'OpenchannelQueueId':Number(_0x3fa1cf[_0xce8a('0x4c')]['id'])});}return _0x3bb1ed;});}})[_0xce8a('0x29')](respondWithResult(_0x37d7bd,null))[_0xce8a('0x4a')](handleError(_0x37d7bd,null));};exports['removeAgents']=function(_0x4b23b0,_0x5c639d,_0x2493e6){return db[_0xce8a('0x32')][_0xce8a('0x53')]({'where':{'id':_0x4b23b0[_0xce8a('0x4c')]['id']}})[_0xce8a('0x29')](handleEntityNotFound(_0x5c639d,null))[_0xce8a('0x29')](function(_0x2e0bb8){if(_0x2e0bb8){return _0x2e0bb8[_0xce8a('0x88')](_0x4b23b0['query'][_0xce8a('0x6a')])['then'](function(){if(_['isArray'](_0x4b23b0[_0xce8a('0x37')]['ids'])){for(var _0x15f10c=0x0;_0x15f10c<_0x4b23b0['query'][_0xce8a('0x6a')][_0xce8a('0x5b')];_0x15f10c+=0x1){socket[_0xce8a('0x85')](_0xce8a('0x86'),{'UserId':Number(_0x4b23b0[_0xce8a('0x37')][_0xce8a('0x6a')][_0x15f10c]),'OpenchannelQueueId':Number(_0x4b23b0['params']['id'])});}}else{socket[_0xce8a('0x85')](_0xce8a('0x86'),{'UserId':Number(_0x4b23b0[_0xce8a('0x37')][_0xce8a('0x6a')]),'OpenchannelQueueId':Number(_0x4b23b0[_0xce8a('0x4c')]['id'])});}});}})['then'](respondWithStatusCode(_0x5c639d,null))['catch'](handleError(_0x5c639d,null));};exports['getAgents']=function(_0x2969de,_0x45c72d,_0x480ac4){var _0x2af2a9={};var _0x40b94a={};var _0x38dd4d;var _0x60bae9;return db[_0xce8a('0x32')]['findOne']({'where':{'id':_0x2969de[_0xce8a('0x4c')]['id']}})[_0xce8a('0x29')](handleEntityNotFound(_0x45c72d,null))[_0xce8a('0x29')](function(_0x3fec8f){if(_0x3fec8f){_0x38dd4d=_0x3fec8f;_0x40b94a[_0xce8a('0x36')]=_[_0xce8a('0x38')](db[_0xce8a('0x5e')][_0xce8a('0x33')]);_0x40b94a[_0xce8a('0x37')]=_[_0xce8a('0x38')](_0x2969de[_0xce8a('0x37')]);_0x40b94a[_0xce8a('0x39')]=_['intersection'](_0x40b94a['model'],_0x40b94a[_0xce8a('0x37')]);_0x2af2a9[_0xce8a('0x3b')]=_[_0xce8a('0x3a')](_0x40b94a['model'],qs['fields'](_0x2969de[_0xce8a('0x37')][_0xce8a('0x3c')]));_0x2af2a9[_0xce8a('0x3b')]=_0x2af2a9[_0xce8a('0x3b')][_0xce8a('0x5b')]?_0x2af2a9[_0xce8a('0x3b')]:_0x40b94a[_0xce8a('0x36')];_0x2af2a9[_0xce8a('0x3e')]=qs[_0xce8a('0x3f')](_0x2969de[_0xce8a('0x37')][_0xce8a('0x3f')]);_0x2af2a9[_0xce8a('0x40')]=qs[_0xce8a('0x39')](_[_0xce8a('0x41')](_0x2969de[_0xce8a('0x37')],_0x40b94a[_0xce8a('0x39')]));if(_0x2969de[_0xce8a('0x37')][_0xce8a('0x42')]){_0x2af2a9[_0xce8a('0x40')]=_[_0xce8a('0x43')](_0x2af2a9[_0xce8a('0x40')],{'$or':_[_0xce8a('0x31')](_0x2af2a9['attributes'],function(_0x40d07b){var _0x594fec={};_0x594fec[_0x40d07b]={'$like':'%'+_0x2969de[_0xce8a('0x37')]['filter']+'%'};return _0x594fec;})});}_0x2af2a9=_['merge']({},_0x2af2a9,_0x2969de[_0xce8a('0x46')]);return _0x38dd4d[_0xce8a('0x89')](_0x2af2a9);}})[_0xce8a('0x29')](function(_0x48bd81){if(_0x48bd81){_0x60bae9=_0x48bd81['length'];if(!_0x2969de[_0xce8a('0x37')][_0xce8a('0x3d')](_0xce8a('0x5c'))){_0x2af2a9[_0xce8a('0x23')]=qs['limit'](_0x2969de['query'][_0xce8a('0x23')]);_0x2af2a9[_0xce8a('0x21')]=qs[_0xce8a('0x21')](_0x2969de[_0xce8a('0x37')][_0xce8a('0x21')]);}return _0x38dd4d[_0xce8a('0x89')](_0x2af2a9);}})[_0xce8a('0x29')](function(_0x536dbe){if(_0x536dbe){return _0x536dbe?{'count':_0x60bae9,'rows':_0x536dbe}:null;}})['then'](respondWithResult(_0x45c72d,null))[_0xce8a('0x4a')](handleError(_0x45c72d,null));};
\ No newline at end of file
index 5e6cfe4..1fe9272 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x38d1=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','remove','emit'];(function(_0x349c60,_0x39cec6){var _0x4e1f90=function(_0x45efab){while(--_0x45efab){_0x349c60['push'](_0x349c60['shift']());}};_0x4e1f90(++_0x39cec6);}(_0x38d1,0x162));var _0x138d=function(_0x19522b,_0x3bb69b){_0x19522b=_0x19522b-0x0;var _0x16129d=_0x38d1[_0x19522b];return _0x16129d;};'use strict';var EventEmitter=require(_0x138d('0x0'));var OpenchannelQueue=require(_0x138d('0x1'))['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x138d('0x2'),'afterUpdate':_0x138d('0x3'),'afterDestroy':_0x138d('0x4')};function emitEvent(_0x1b6e88){return function(_0x1fdcb9,_0x49de4c,_0x1fd05c){OpenchannelQueueEvents[_0x138d('0x5')](_0x1b6e88+':'+_0x1fdcb9['id'],_0x1fdcb9);OpenchannelQueueEvents[_0x138d('0x5')](_0x1b6e88,_0x1fdcb9);_0x1fd05c(null);};}for(var e in events){if(events[_0x138d('0x6')](e)){var event=events[e];OpenchannelQueue[_0x138d('0x7')](e,emitEvent(event));}}module[_0x138d('0x8')]=OpenchannelQueueEvents;
\ No newline at end of file
+var _0x7a97=['hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','emit'];(function(_0x2036c1,_0x437f74){var _0x133fab=function(_0x27781d){while(--_0x27781d){_0x2036c1['push'](_0x2036c1['shift']());}};_0x133fab(++_0x437f74);}(_0x7a97,0x1e2));var _0x77a9=function(_0x59200e,_0xdf0984){_0x59200e=_0x59200e-0x0;var _0x13aa0b=_0x7a97[_0x59200e];return _0x13aa0b;};'use strict';var EventEmitter=require(_0x77a9('0x0'));var OpenchannelQueue=require(_0x77a9('0x1'))['db'][_0x77a9('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x77a9('0x3')](0x0);var events={'afterCreate':_0x77a9('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x12876b){return function(_0x53eac6,_0x26829d,_0x108826){OpenchannelQueueEvents[_0x77a9('0x5')](_0x12876b+':'+_0x53eac6['id'],_0x53eac6);OpenchannelQueueEvents['emit'](_0x12876b,_0x53eac6);_0x108826(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x77a9('0x6')](e,emitEvent(event));}}module[_0x77a9('0x7')]=OpenchannelQueueEvents;
\ No newline at end of file
index 98d8cf2..913d214 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc21f=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','openchannel_queues'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0xc21f,0x9c));var _0xfc21=function(_0xffa5aa,_0x43acda){_0xffa5aa=_0xffa5aa-0x0;var _0x40abaa=_0xc21f[_0xffa5aa];return _0x40abaa;};'use strict';var _=require(_0xfc21('0x0'));var util=require(_0xfc21('0x1'));var logger=require('../../config/logger')(_0xfc21('0x2'));var moment=require(_0xfc21('0x3'));var BPromise=require(_0xfc21('0x4'));var rp=require(_0xfc21('0x5'));var fs=require('fs');var path=require(_0xfc21('0x6'));var rimraf=require(_0xfc21('0x7'));var config=require(_0xfc21('0x8'));var attributes=require(_0xfc21('0x9'));module[_0xfc21('0xa')]=function(_0x218e82,_0x29b084){return _0x218e82[_0xfc21('0xb')]('OpenchannelQueue',attributes,{'tableName':_0xfc21('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x577d=['exports','define','openchannel_queues','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./openchannelQueue.attributes'];(function(_0x2ac437,_0x5bf280){var _0x4f090a=function(_0x1ab5c1){while(--_0x1ab5c1){_0x2ac437['push'](_0x2ac437['shift']());}};_0x4f090a(++_0x5bf280);}(_0x577d,0xb7));var _0xd577=function(_0x435053,_0x19a944){_0x435053=_0x435053-0x0;var _0x18ce2b=_0x577d[_0x435053];return _0x18ce2b;};'use strict';var _=require(_0xd577('0x0'));var util=require(_0xd577('0x1'));var logger=require(_0xd577('0x2'))(_0xd577('0x3'));var moment=require(_0xd577('0x4'));var BPromise=require('bluebird');var rp=require(_0xd577('0x5'));var fs=require('fs');var path=require(_0xd577('0x6'));var rimraf=require('rimraf');var config=require(_0xd577('0x7'));var attributes=require(_0xd577('0x8'));module[_0xd577('0x9')]=function(_0x41be9d,_0x2aafb4){return _0x41be9d[_0xd577('0xa')]('OpenchannelQueue',attributes,{'tableName':_0xd577('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0b291aa..b610e7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe221=['raw','ShowOpenchannelQueue','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','register','request','info','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','OpenchannelQueue','findAll','options','where','limit','include','map','model','attributes','GetOpenchannelQueue','find'];(function(_0x25c2ce,_0x529639){var _0x5baa45=function(_0x5ab8db){while(--_0x5ab8db){_0x25c2ce['push'](_0x25c2ce['shift']());}};_0x5baa45(++_0x529639);}(_0xe221,0x174));var _0x1e22=function(_0x1a4712,_0x54c083){_0x1a4712=_0x1a4712-0x0;var _0xdb6ed7=_0xe221[_0x1a4712];return _0xdb6ed7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1e22('0x0'));var BPromise=require(_0x1e22('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e22('0x2'));var db=require(_0x1e22('0x3'))['db'];var utils=require(_0x1e22('0x4'));var logger=require(_0x1e22('0x5'))(_0x1e22('0x6'));var config=require(_0x1e22('0x7'));var jayson=require(_0x1e22('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x1e22('0x9')]=_[_0x1e22('0xa')](config[_0x1e22('0x9')],{'host':_0x1e22('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./openchannelQueue.socket')[_0x1e22('0xc')](socket);function respondWithRpcPromise(_0x2a5912,_0x351431,_0x35d918){return new BPromise(function(_0x540979,_0x290d5c){return client[_0x1e22('0xd')](_0x2a5912,_0x35d918)['then'](function(_0x5d61be){logger[_0x1e22('0xe')](_0x1e22('0xf'),_0x351431,'request\x20sent');logger[_0x1e22('0x10')](_0x1e22('0x11'),_0x351431,_0x1e22('0x12'),JSON[_0x1e22('0x13')](_0x5d61be));if(_0x5d61be[_0x1e22('0x14')]){if(_0x5d61be['error'][_0x1e22('0x15')]===0x1f4){logger['error'](_0x1e22('0xf'),_0x351431,_0x5d61be[_0x1e22('0x14')]['message']);return _0x290d5c(_0x5d61be[_0x1e22('0x14')]['message']);}logger[_0x1e22('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x351431,_0x5d61be[_0x1e22('0x14')][_0x1e22('0x16')]);return _0x540979(_0x5d61be[_0x1e22('0x14')][_0x1e22('0x16')]);}else{logger[_0x1e22('0xe')](_0x1e22('0xf'),_0x351431,_0x1e22('0x12'));_0x540979(_0x5d61be['result'][_0x1e22('0x16')]);}})[_0x1e22('0x17')](function(_0x2b2008){logger[_0x1e22('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0x351431,_0x2b2008);_0x290d5c(_0x2b2008);});});}exports['GetOpenchannelQueue']=function(_0x39a716){var _0x2cda2a=this;return new Promise(function(_0x4c72de,_0x1a3742){return db[_0x1e22('0x18')][_0x1e22('0x19')]({'raw':_0x39a716['options']?_0x39a716[_0x1e22('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x39a716['options']?_0x39a716[_0x1e22('0x1a')][_0x1e22('0x1b')]||null:null,'attributes':_0x39a716['options']?_0x39a716[_0x1e22('0x1a')]['attributes']||null:null,'limit':_0x39a716[_0x1e22('0x1a')]?_0x39a716[_0x1e22('0x1a')][_0x1e22('0x1c')]||null:null,'include':_0x39a716['options']?_0x39a716[_0x1e22('0x1a')][_0x1e22('0x1d')]?_[_0x1e22('0x1e')](_0x39a716['options'][_0x1e22('0x1d')],function(_0x466954){return{'model':db[_0x466954[_0x1e22('0x1f')]],'as':_0x466954['as'],'attributes':_0x466954[_0x1e22('0x20')],'include':_0x466954[_0x1e22('0x1d')]?_[_0x1e22('0x1e')](_0x466954[_0x1e22('0x1d')],function(_0x40acb3){return{'model':db[_0x40acb3[_0x1e22('0x1f')]],'as':_0x40acb3['as'],'attributes':_0x40acb3[_0x1e22('0x20')],'include':_0x40acb3[_0x1e22('0x1d')]?_[_0x1e22('0x1e')](_0x40acb3[_0x1e22('0x1d')],function(_0x437b12){return{'model':db[_0x437b12['model']],'as':_0x437b12['as'],'attributes':_0x437b12[_0x1e22('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42fc5a){logger[_0x1e22('0xe')](_0x1e22('0x21'),_0x39a716);logger['debug'](_0x1e22('0x21'),_0x39a716,JSON['stringify'](_0x42fc5a));_0x4c72de(_0x42fc5a);})['catch'](function(_0x2323f4){logger[_0x1e22('0x14')](_0x1e22('0x21'),_0x2323f4[_0x1e22('0x16')],_0x39a716);_0x1a3742(_0x2cda2a[_0x1e22('0x14')](0x1f4,_0x2323f4[_0x1e22('0x16')]));});});};exports['ShowOpenchannelQueue']=function(_0x554b43){var _0x27ac2b=this;return new Promise(function(_0x25e034,_0x10547e){return db['OpenchannelQueue'][_0x1e22('0x22')]({'raw':_0x554b43['options']?_0x554b43[_0x1e22('0x1a')][_0x1e22('0x23')]===undefined?!![]:![]:!![],'where':_0x554b43[_0x1e22('0x1a')]?_0x554b43[_0x1e22('0x1a')]['where']||null:null,'attributes':_0x554b43[_0x1e22('0x1a')]?_0x554b43['options'][_0x1e22('0x20')]||null:null,'include':_0x554b43[_0x1e22('0x1a')]?_0x554b43[_0x1e22('0x1a')][_0x1e22('0x1d')]?_[_0x1e22('0x1e')](_0x554b43[_0x1e22('0x1a')][_0x1e22('0x1d')],function(_0x7364ed){return{'model':db[_0x7364ed['model']],'as':_0x7364ed['as'],'attributes':_0x7364ed['attributes'],'include':_0x7364ed[_0x1e22('0x1d')]?_[_0x1e22('0x1e')](_0x7364ed[_0x1e22('0x1d')],function(_0x4ac20c){return{'model':db[_0x4ac20c[_0x1e22('0x1f')]],'as':_0x4ac20c['as'],'attributes':_0x4ac20c[_0x1e22('0x20')],'include':_0x4ac20c[_0x1e22('0x1d')]?_['map'](_0x4ac20c[_0x1e22('0x1d')],function(_0x275b7a){return{'model':db[_0x275b7a[_0x1e22('0x1f')]],'as':_0x275b7a['as'],'attributes':_0x275b7a[_0x1e22('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ae907){logger[_0x1e22('0xe')](_0x1e22('0x24'),_0x554b43);logger[_0x1e22('0x10')]('ShowOpenchannelQueue',_0x554b43,JSON[_0x1e22('0x13')](_0x4ae907));_0x25e034(_0x4ae907);})[_0x1e22('0x17')](function(_0x5a4f7c){logger[_0x1e22('0x14')](_0x1e22('0x24'),_0x5a4f7c[_0x1e22('0x16')],_0x554b43);_0x10547e(_0x27ac2b[_0x1e22('0x14')](0x1f4,_0x5a4f7c['message']));});});};
\ No newline at end of file
+var _0x2d16=['GetOpenchannelQueue','ShowOpenchannelQueue','OpenchannelQueue','find','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./openchannelQueue.socket','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','findAll','options','raw','where','limit','include','model','map','attributes'];(function(_0x52a073,_0x225c33){var _0x14c817=function(_0x24c042){while(--_0x24c042){_0x52a073['push'](_0x52a073['shift']());}};_0x14c817(++_0x225c33);}(_0x2d16,0x79));var _0x62d1=function(_0x441c9d,_0x3ad5b2){_0x441c9d=_0x441c9d-0x0;var _0x369587=_0x2d16[_0x441c9d];return _0x369587;};'use strict';var _=require(_0x62d1('0x0'));var util=require('util');var moment=require(_0x62d1('0x1'));var BPromise=require(_0x62d1('0x2'));var rs=require(_0x62d1('0x3'));var fs=require('fs');var Redis=require(_0x62d1('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x62d1('0x5'))(_0x62d1('0x6'));var config=require(_0x62d1('0x7'));var jayson=require(_0x62d1('0x8'));var client=jayson[_0x62d1('0x9')]['http']({'port':0x232a});config[_0x62d1('0xa')]=_['defaults'](config[_0x62d1('0xa')],{'host':_0x62d1('0xb'),'port':0x18eb});var socket=require(_0x62d1('0xc'))(new Redis(config[_0x62d1('0xa')]));require(_0x62d1('0xd'))['register'](socket);function respondWithRpcPromise(_0x5ba5a5,_0x5bc4a5,_0xdeeba9){return new BPromise(function(_0x56d1e4,_0x400740){return client[_0x62d1('0xe')](_0x5ba5a5,_0xdeeba9)[_0x62d1('0xf')](function(_0x2f38ce){logger[_0x62d1('0x10')](_0x62d1('0x11'),_0x5bc4a5,_0x62d1('0x12'));logger[_0x62d1('0x13')](_0x62d1('0x14'),_0x5bc4a5,_0x62d1('0x12'),JSON['stringify'](_0x2f38ce));if(_0x2f38ce[_0x62d1('0x15')]){if(_0x2f38ce[_0x62d1('0x15')][_0x62d1('0x16')]===0x1f4){logger[_0x62d1('0x15')](_0x62d1('0x11'),_0x5bc4a5,_0x2f38ce[_0x62d1('0x15')][_0x62d1('0x17')]);return _0x400740(_0x2f38ce[_0x62d1('0x15')][_0x62d1('0x17')]);}logger['error'](_0x62d1('0x11'),_0x5bc4a5,_0x2f38ce[_0x62d1('0x15')][_0x62d1('0x17')]);return _0x56d1e4(_0x2f38ce[_0x62d1('0x15')][_0x62d1('0x17')]);}else{logger[_0x62d1('0x10')](_0x62d1('0x11'),_0x5bc4a5,_0x62d1('0x12'));_0x56d1e4(_0x2f38ce[_0x62d1('0x18')][_0x62d1('0x17')]);}})[_0x62d1('0x19')](function(_0x339f0a){logger['error'](_0x62d1('0x11'),_0x5bc4a5,_0x339f0a);_0x400740(_0x339f0a);});});}exports['GetOpenchannelQueue']=function(_0x2638c7){var _0x40f532=this;return new Promise(function(_0x7a95b1,_0x1e9480){return db['OpenchannelQueue'][_0x62d1('0x1a')]({'raw':_0x2638c7[_0x62d1('0x1b')]?_0x2638c7[_0x62d1('0x1b')][_0x62d1('0x1c')]===undefined?!![]:![]:!![],'where':_0x2638c7[_0x62d1('0x1b')]?_0x2638c7[_0x62d1('0x1b')][_0x62d1('0x1d')]||null:null,'attributes':_0x2638c7[_0x62d1('0x1b')]?_0x2638c7[_0x62d1('0x1b')]['attributes']||null:null,'limit':_0x2638c7[_0x62d1('0x1b')]?_0x2638c7[_0x62d1('0x1b')][_0x62d1('0x1e')]||null:null,'include':_0x2638c7[_0x62d1('0x1b')]?_0x2638c7[_0x62d1('0x1b')][_0x62d1('0x1f')]?_['map'](_0x2638c7[_0x62d1('0x1b')]['include'],function(_0x24eefc){return{'model':db[_0x24eefc[_0x62d1('0x20')]],'as':_0x24eefc['as'],'attributes':_0x24eefc['attributes'],'include':_0x24eefc[_0x62d1('0x1f')]?_[_0x62d1('0x21')](_0x24eefc[_0x62d1('0x1f')],function(_0x1eb5bc){return{'model':db[_0x1eb5bc[_0x62d1('0x20')]],'as':_0x1eb5bc['as'],'attributes':_0x1eb5bc[_0x62d1('0x22')],'include':_0x1eb5bc['include']?_[_0x62d1('0x21')](_0x1eb5bc[_0x62d1('0x1f')],function(_0x10c4f1){return{'model':db[_0x10c4f1[_0x62d1('0x20')]],'as':_0x10c4f1['as'],'attributes':_0x10c4f1[_0x62d1('0x22')]};}):[]};}):[]};}):[]:[]})[_0x62d1('0xf')](function(_0x34029a){logger[_0x62d1('0x10')](_0x62d1('0x23'),_0x2638c7);logger['debug'](_0x62d1('0x23'),_0x2638c7,JSON['stringify'](_0x34029a));_0x7a95b1(_0x34029a);})[_0x62d1('0x19')](function(_0x2e5003){logger[_0x62d1('0x15')](_0x62d1('0x23'),_0x2e5003[_0x62d1('0x17')],_0x2638c7);_0x1e9480(_0x40f532[_0x62d1('0x15')](0x1f4,_0x2e5003[_0x62d1('0x17')]));});});};exports[_0x62d1('0x24')]=function(_0x3e53b0){var _0x166a8f=this;return new Promise(function(_0x223e5a,_0x79bd35){return db[_0x62d1('0x25')][_0x62d1('0x26')]({'raw':_0x3e53b0[_0x62d1('0x1b')]?_0x3e53b0[_0x62d1('0x1b')][_0x62d1('0x1c')]===undefined?!![]:![]:!![],'where':_0x3e53b0['options']?_0x3e53b0['options'][_0x62d1('0x1d')]||null:null,'attributes':_0x3e53b0['options']?_0x3e53b0[_0x62d1('0x1b')][_0x62d1('0x22')]||null:null,'include':_0x3e53b0[_0x62d1('0x1b')]?_0x3e53b0[_0x62d1('0x1b')][_0x62d1('0x1f')]?_[_0x62d1('0x21')](_0x3e53b0[_0x62d1('0x1b')][_0x62d1('0x1f')],function(_0x10cc91){return{'model':db[_0x10cc91['model']],'as':_0x10cc91['as'],'attributes':_0x10cc91[_0x62d1('0x22')],'include':_0x10cc91['include']?_['map'](_0x10cc91[_0x62d1('0x1f')],function(_0xbaac49){return{'model':db[_0xbaac49[_0x62d1('0x20')]],'as':_0xbaac49['as'],'attributes':_0xbaac49[_0x62d1('0x22')],'include':_0xbaac49[_0x62d1('0x1f')]?_[_0x62d1('0x21')](_0xbaac49[_0x62d1('0x1f')],function(_0x457c54){return{'model':db[_0x457c54[_0x62d1('0x20')]],'as':_0x457c54['as'],'attributes':_0x457c54[_0x62d1('0x22')]};}):[]};}):[]};}):[]:[]})[_0x62d1('0xf')](function(_0x55f831){logger[_0x62d1('0x10')]('ShowOpenchannelQueue',_0x3e53b0);logger[_0x62d1('0x13')]('ShowOpenchannelQueue',_0x3e53b0,JSON['stringify'](_0x55f831));_0x223e5a(_0x55f831);})[_0x62d1('0x19')](function(_0x261b11){logger[_0x62d1('0x15')]('ShowOpenchannelQueue',_0x261b11[_0x62d1('0x17')],_0x3e53b0);_0x79bd35(_0x166a8f[_0x62d1('0x15')](0x1f4,_0x261b11['message']));});});};
\ No newline at end of file
index 8bd8ed6..d62dc18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29be=['save','remove','update','emit','removeListener','register','length','openchannelQueue:','./openchannelQueue.events'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x29be,0x1dc));var _0xe29b=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x29be[_0x618414];return _0x21c19a;};'use strict';var OpenchannelQueueEvents=require(_0xe29b('0x0'));var events=[_0xe29b('0x1'),_0xe29b('0x2'),_0xe29b('0x3')];function createListener(_0x4b1981,_0x1c318f){return function(_0x16639e){_0x1c318f[_0xe29b('0x4')](_0x4b1981,_0x16639e);};}function removeListener(_0x1d8594,_0x1c4d03){return function(){OpenchannelQueueEvents[_0xe29b('0x5')](_0x1d8594,_0x1c4d03);};}exports[_0xe29b('0x6')]=function(_0x4667ca){for(var _0x1cfac4=0x0,_0x4f3a0a=events[_0xe29b('0x7')];_0x1cfac4<_0x4f3a0a;_0x1cfac4++){var _0x289910=events[_0x1cfac4];var _0x1bb6da=createListener(_0xe29b('0x8')+_0x289910,_0x4667ca);OpenchannelQueueEvents['on'](_0x289910,_0x1bb6da);}};
\ No newline at end of file
+var _0x286c=['removeListener','register','length','save','emit'];(function(_0x6ac137,_0x363ee9){var _0x1da975=function(_0xe1601e){while(--_0xe1601e){_0x6ac137['push'](_0x6ac137['shift']());}};_0x1da975(++_0x363ee9);}(_0x286c,0x116));var _0xc286=function(_0x338653,_0x26ea8b){_0x338653=_0x338653-0x0;var _0xf9e3d8=_0x286c[_0x338653];return _0xf9e3d8;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xc286('0x0'),'remove','update'];function createListener(_0x539a2f,_0x2113d3){return function(_0x228391){_0x2113d3[_0xc286('0x1')](_0x539a2f,_0x228391);};}function removeListener(_0x460a94,_0x78c8b7){return function(){OpenchannelQueueEvents[_0xc286('0x2')](_0x460a94,_0x78c8b7);};}exports[_0xc286('0x3')]=function(_0x518b09){for(var _0x34d138=0x0,_0x526e71=events[_0xc286('0x4')];_0x34d138<_0x526e71;_0x34d138++){var _0x1625d2=events[_0x34d138];var _0x981351=createListener('openchannelQueue:'+_0x1625d2,_0x518b09);OpenchannelQueueEvents['on'](_0x1625d2,_0x981351);}};
\ No newline at end of file
index c9fae1e..fae604f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0e7=['delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe0e7,0x1d1));var _0x7e0e=function(_0x301dab,_0x38050a){_0x301dab=_0x301dab-0x0;var _0x2500a2=_0xe0e7[_0x301dab];return _0x2500a2;};'use strict';var multer=require('multer');var util=require(_0x7e0e('0x0'));var path=require(_0x7e0e('0x1'));var timeout=require(_0x7e0e('0x2'));var express=require(_0x7e0e('0x3'));var router=express[_0x7e0e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7e0e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7e0e('0x6'));var controller=require(_0x7e0e('0x7'));router[_0x7e0e('0x8')]('/',auth[_0x7e0e('0x9')](),controller['index']);router[_0x7e0e('0x8')](_0x7e0e('0xa'),auth[_0x7e0e('0x9')](),controller[_0x7e0e('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7e0e('0xc')]);router[_0x7e0e('0xd')]('/',auth[_0x7e0e('0x9')](),controller[_0x7e0e('0xe')]);router[_0x7e0e('0xf')](_0x7e0e('0x10'),auth['isAuthenticated'](),controller[_0x7e0e('0x11')]);router[_0x7e0e('0x12')](_0x7e0e('0x10'),auth[_0x7e0e('0x9')](),controller[_0x7e0e('0x13')]);module[_0x7e0e('0x14')]=router;
\ No newline at end of file
+var _0xd664=['./openchannelQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x3ff851,_0x43191c){var _0x41ed4b=function(_0x1b5793){while(--_0x1b5793){_0x3ff851['push'](_0x3ff851['shift']());}};_0x41ed4b(++_0x43191c);}(_0xd664,0xa5));var _0x4d66=function(_0x3cf13e,_0x47a695){_0x3cf13e=_0x3cf13e-0x0;var _0x77dbde=_0xd664[_0x3cf13e];return _0x77dbde;};'use strict';var multer=require(_0x4d66('0x0'));var util=require(_0x4d66('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4d66('0x2')]();var fs_extra=require(_0x4d66('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x4d66('0x4'));var config=require(_0x4d66('0x5'));var controller=require(_0x4d66('0x6'));router[_0x4d66('0x7')]('/',auth[_0x4d66('0x8')](),controller['index']);router[_0x4d66('0x7')](_0x4d66('0x9'),auth[_0x4d66('0x8')](),controller[_0x4d66('0xa')]);router[_0x4d66('0x7')](_0x4d66('0xb'),auth[_0x4d66('0x8')](),controller[_0x4d66('0xc')]);router[_0x4d66('0xd')]('/',auth[_0x4d66('0x8')](),controller['create']);router[_0x4d66('0xe')](_0x4d66('0xb'),auth[_0x4d66('0x8')](),controller[_0x4d66('0xf')]);router[_0x4d66('0x10')](_0x4d66('0xb'),auth[_0x4d66('0x8')](),controller[_0x4d66('0x11')]);module[_0x4d66('0x12')]=router;
\ No newline at end of file
index db0933e..5ea3b89 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfd5f=['sequelize','exports','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd5f,0x7b));var _0xffd5=function(_0x3c6f97,_0x295580){_0x3c6f97=_0x3c6f97-0x0;var _0xde4c43=_0xfd5f[_0x3c6f97];return _0xde4c43;};'use strict';var moment=require('moment');var Sequelize=require(_0xffd5('0x0'));module[_0xffd5('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xffd5('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xffd5('0x2')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xe409=['DATE','moment','exports','STRING'];(function(_0xe110eb,_0x3a5532){var _0x195c5c=function(_0x55b079){while(--_0x55b079){_0xe110eb['push'](_0xe110eb['shift']());}};_0x195c5c(++_0x3a5532);}(_0xe409,0x195));var _0x9e40=function(_0x3ae7b9,_0x38b113){_0x3ae7b9=_0x3ae7b9-0x0;var _0x4fd404=_0xe409[_0x3ae7b9];return _0x4fd404;};'use strict';var moment=require(_0x9e40('0x0'));var Sequelize=require('sequelize');module[_0x9e40('0x1')]={'uniqueid':{'type':Sequelize[_0x9e40('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9e40('0x2')]},'joinAt':{'type':Sequelize[_0x9e40('0x3')]},'leaveAt':{'type':Sequelize[_0x9e40('0x3')]},'acceptAt':{'type':Sequelize[_0x9e40('0x3')]},'exitAt':{'type':Sequelize[_0x9e40('0x3')]},'reason':{'type':Sequelize[_0x9e40('0x2')]}};
\ No newline at end of file
index 49d1710..3dec4f5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6786=['count','limit','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','include','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','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','end','offset','undefined'];(function(_0x15f3c0,_0x165a64){var _0x1adfe0=function(_0x212cfc){while(--_0x212cfc){_0x15f3c0['push'](_0x15f3c0['shift']());}};_0x1adfe0(++_0x165a64);}(_0x6786,0x19d));var _0x6678=function(_0x2ff739,_0x1c8e0f){_0x2ff739=_0x2ff739-0x0;var _0x12dc13=_0x6786[_0x2ff739];return _0x12dc13;};'use strict';var emlformat=require(_0x6678('0x0'));var rimraf=require(_0x6678('0x1'));var zipdir=require(_0x6678('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6678('0x3'));var moment=require(_0x6678('0x4'));var BPromise=require(_0x6678('0x5'));var Mustache=require(_0x6678('0x6'));var util=require(_0x6678('0x7'));var path=require(_0x6678('0x8'));var sox=require('sox');var csv=require(_0x6678('0x9'));var ejs=require(_0x6678('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6678('0xb'));var squel=require(_0x6678('0xc'));var crypto=require('crypto');var jsforce=require(_0x6678('0xd'));var deskjs=require(_0x6678('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6678('0xf'));var Papa=require(_0x6678('0x10'));var Redis=require(_0x6678('0x11'));var authService=require(_0x6678('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6678('0x13'));var hardwareService=require(_0x6678('0x14'));var logger=require(_0x6678('0x15'))(_0x6678('0x16'));var utils=require('../../config/utils');var config=require(_0x6678('0x17'));var licenseUtil=require(_0x6678('0x18'));var db=require(_0x6678('0x19'))['db'];function respondWithStatusCode(_0x1773f1,_0x39645d){_0x39645d=_0x39645d||0xcc;return function(_0x68ccec){if(_0x68ccec){return _0x1773f1[_0x6678('0x1a')](_0x39645d);}return _0x1773f1[_0x6678('0x1b')](_0x39645d)[_0x6678('0x1c')]();};}function respondWithResult(_0x50e157,_0x26c073){_0x26c073=_0x26c073||0xc8;return function(_0x2002c3){if(_0x2002c3){return _0x50e157['status'](_0x26c073)['json'](_0x2002c3);}};}function respondWithFilteredResult(_0x3453ea,_0x55957b){return function(_0x256f3d){if(_0x256f3d){var _0x56999b=typeof _0x55957b[_0x6678('0x1d')]===_0x6678('0x1e')&&typeof _0x55957b['limit']==='undefined';var _0x16963a=_0x256f3d[_0x6678('0x1f')];var _0x4bbed3=_0x56999b?0x0:_0x55957b[_0x6678('0x1d')];var _0x2db7ec=_0x56999b?_0x256f3d[_0x6678('0x1f')]:_0x55957b[_0x6678('0x1d')]+_0x55957b[_0x6678('0x20')];var _0x3b0fee;if(_0x2db7ec>=_0x16963a){_0x2db7ec=_0x16963a;_0x3b0fee=0xc8;}else{_0x3b0fee=0xce;}_0x3453ea['status'](_0x3b0fee);return _0x3453ea[_0x6678('0x21')](_0x6678('0x22'),_0x4bbed3+'-'+_0x2db7ec+'/'+_0x16963a)[_0x6678('0x23')](_0x256f3d);}return null;};}function patchUpdates(_0x19099a){return function(_0x3ae2d2){try{jsonpatch[_0x6678('0x24')](_0x3ae2d2,_0x19099a,!![]);}catch(_0x5281ef){return BPromise[_0x6678('0x25')](_0x5281ef);}return _0x3ae2d2['save']();};}function saveUpdates(_0x2bf70e,_0x4e2446){return function(_0x1ece31){if(_0x1ece31){return _0x1ece31[_0x6678('0x26')](_0x2bf70e)[_0x6678('0x27')](function(_0x11b7e7){return _0x11b7e7;});}return null;};}function removeEntity(_0x3f596a,_0x474bc1){return function(_0x4d48b1){if(_0x4d48b1){return _0x4d48b1[_0x6678('0x28')]()[_0x6678('0x27')](function(){_0x3f596a[_0x6678('0x1b')](0xcc)[_0x6678('0x1c')]();});}};}function handleEntityNotFound(_0x401663,_0x2e13a2){return function(_0x547515){if(!_0x547515){_0x401663['sendStatus'](0x194);}return _0x547515;};}function handleError(_0x376a20,_0x40e324){_0x40e324=_0x40e324||0x1f4;return function(_0x496a93){logger[_0x6678('0x29')](_0x496a93[_0x6678('0x2a')]);if(_0x496a93[_0x6678('0x2b')]){delete _0x496a93['name'];}_0x376a20[_0x6678('0x1b')](_0x40e324)[_0x6678('0x2c')](_0x496a93);};}exports['index']=function(_0x5ab783,_0x58861d){var _0x6da8f1={},_0x4f9bc7={},_0xc4af83={'count':0x0,'rows':[]};var _0x351916=_['map'](db[_0x6678('0x2d')][_0x6678('0x2e')],function(_0xe215c7){return{'name':_0xe215c7[_0x6678('0x2f')],'type':_0xe215c7[_0x6678('0x30')][_0x6678('0x31')]};});_0x4f9bc7[_0x6678('0x32')]=_[_0x6678('0x33')](_0x351916,_0x6678('0x2b'));_0x4f9bc7[_0x6678('0x34')]=_[_0x6678('0x35')](_0x5ab783['query']);_0x4f9bc7[_0x6678('0x36')]=_[_0x6678('0x37')](_0x4f9bc7[_0x6678('0x32')],_0x4f9bc7['query']);_0x6da8f1[_0x6678('0x38')]=_[_0x6678('0x37')](_0x4f9bc7[_0x6678('0x32')],qs[_0x6678('0x39')](_0x5ab783[_0x6678('0x34')][_0x6678('0x39')]));_0x6da8f1[_0x6678('0x38')]=_0x6da8f1[_0x6678('0x38')][_0x6678('0x3a')]?_0x6da8f1[_0x6678('0x38')]:_0x4f9bc7[_0x6678('0x32')];if(!_0x5ab783[_0x6678('0x34')]['hasOwnProperty']('nolimit')){_0x6da8f1[_0x6678('0x20')]=qs[_0x6678('0x20')](_0x5ab783['query'][_0x6678('0x20')]);_0x6da8f1['offset']=qs[_0x6678('0x1d')](_0x5ab783[_0x6678('0x34')][_0x6678('0x1d')]);}_0x6da8f1['order']=qs['sort'](_0x5ab783['query'][_0x6678('0x3b')]);_0x6da8f1[_0x6678('0x3c')]=qs[_0x6678('0x36')](_['pick'](_0x5ab783[_0x6678('0x34')],_0x4f9bc7[_0x6678('0x36')]),_0x351916);if(_0x5ab783['query'][_0x6678('0x3d')]){_0x6da8f1[_0x6678('0x3c')]=_[_0x6678('0x3e')](_0x6da8f1[_0x6678('0x3c')],{'$or':_[_0x6678('0x33')](_0x351916,function(_0x510dc4){if(_0x510dc4[_0x6678('0x30')]!==_0x6678('0x3f')){var _0x112088={};_0x112088[_0x510dc4[_0x6678('0x2b')]]={'$like':'%'+_0x5ab783[_0x6678('0x34')][_0x6678('0x3d')]+'%'};return _0x112088;}})});}_0x6da8f1=_[_0x6678('0x3e')]({},_0x6da8f1,_0x5ab783[_0x6678('0x40')]);var _0x21cc59={'where':_0x6da8f1['where']};return db['OpenchannelQueueReport'][_0x6678('0x1f')](_0x21cc59)[_0x6678('0x27')](function(_0x7b8f65){_0xc4af83[_0x6678('0x1f')]=_0x7b8f65;if(_0x5ab783[_0x6678('0x34')][_0x6678('0x41')]){_0x6da8f1['include']=[{'all':!![]}];}return db[_0x6678('0x2d')]['findAll'](_0x6da8f1);})[_0x6678('0x27')](function(_0x55cffe){_0xc4af83[_0x6678('0x42')]=_0x55cffe;return _0xc4af83;})[_0x6678('0x27')](respondWithFilteredResult(_0x58861d,_0x6da8f1))[_0x6678('0x43')](handleError(_0x58861d,null));};exports[_0x6678('0x44')]=function(_0x176587,_0x17ad5f){var _0x3b65e4={'raw':!![],'where':{'id':_0x176587['params']['id']}},_0x17efba={};_0x17efba['model']=_[_0x6678('0x35')](db[_0x6678('0x2d')][_0x6678('0x2e')]);_0x17efba[_0x6678('0x34')]=_[_0x6678('0x35')](_0x176587[_0x6678('0x34')]);_0x17efba[_0x6678('0x36')]=_[_0x6678('0x37')](_0x17efba[_0x6678('0x32')],_0x17efba['query']);_0x3b65e4[_0x6678('0x38')]=_['intersection'](_0x17efba[_0x6678('0x32')],qs['fields'](_0x176587[_0x6678('0x34')][_0x6678('0x39')]));_0x3b65e4[_0x6678('0x38')]=_0x3b65e4[_0x6678('0x38')]['length']?_0x3b65e4[_0x6678('0x38')]:_0x17efba[_0x6678('0x32')];if(_0x176587[_0x6678('0x34')][_0x6678('0x41')]){_0x3b65e4[_0x6678('0x45')]=[{'all':!![]}];}_0x3b65e4=_[_0x6678('0x3e')]({},_0x3b65e4,_0x176587[_0x6678('0x40')]);return db[_0x6678('0x2d')][_0x6678('0x46')](_0x3b65e4)[_0x6678('0x27')](handleEntityNotFound(_0x17ad5f,null))[_0x6678('0x27')](respondWithResult(_0x17ad5f,null))['catch'](handleError(_0x17ad5f,null));};exports[_0x6678('0x47')]=function(_0x4c7620,_0x4e4e5f){return db['OpenchannelQueueReport'][_0x6678('0x47')](_0x4c7620[_0x6678('0x48')],{})[_0x6678('0x27')](respondWithResult(_0x4e4e5f,0xc9))[_0x6678('0x43')](handleError(_0x4e4e5f,null));};exports['update']=function(_0xb952e0,_0x5e550f){if(_0xb952e0[_0x6678('0x48')]['id']){delete _0xb952e0['body']['id'];}return db[_0x6678('0x2d')][_0x6678('0x46')]({'where':{'id':_0xb952e0['params']['id']}})['then'](handleEntityNotFound(_0x5e550f,null))[_0x6678('0x27')](saveUpdates(_0xb952e0[_0x6678('0x48')],null))[_0x6678('0x27')](respondWithResult(_0x5e550f,null))[_0x6678('0x43')](handleError(_0x5e550f,null));};exports[_0x6678('0x28')]=function(_0x497e72,_0x55dc84){return db[_0x6678('0x2d')][_0x6678('0x46')]({'where':{'id':_0x497e72['params']['id']}})['then'](handleEntityNotFound(_0x55dc84,null))[_0x6678('0x27')](removeEntity(_0x55dc84,null))[_0x6678('0x43')](handleError(_0x55dc84,null));};exports['describe']=function(_0x2cdafd,_0x3ff394){return db[_0x6678('0x2d')][_0x6678('0x49')]()['then'](respondWithResult(_0x3ff394,null))['catch'](handleError(_0x3ff394,null));};
\ No newline at end of file
+var _0xec4b=['query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','destroy','describe','rimraf','zip-dir','request-promise','moment','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','stack','name','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key'];(function(_0x3d8240,_0x2663d4){var _0x3d0372=function(_0xc47c6b){while(--_0xc47c6b){_0x3d8240['push'](_0x3d8240['shift']());}};_0x3d0372(++_0x2663d4);}(_0xec4b,0xf6));var _0xbec4=function(_0x166984,_0x2195f2){_0x166984=_0x166984-0x0;var _0x3225d6=_0xec4b[_0x166984];return _0x3225d6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbec4('0x0'));var zipdir=require(_0xbec4('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbec4('0x2'));var moment=require(_0xbec4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbec4('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xbec4('0x5'));var ejs=require(_0xbec4('0x6'));var fs=require('fs');var fs_extra=require(_0xbec4('0x7'));var _=require(_0xbec4('0x8'));var squel=require(_0xbec4('0x9'));var crypto=require(_0xbec4('0xa'));var jsforce=require(_0xbec4('0xb'));var deskjs=require(_0xbec4('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbec4('0xd'));var Redis=require(_0xbec4('0xe'));var authService=require(_0xbec4('0xf'));var qs=require(_0xbec4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbec4('0x11'));var logger=require(_0xbec4('0x12'))('api');var utils=require(_0xbec4('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xbec4('0x14'));var db=require(_0xbec4('0x15'))['db'];function respondWithStatusCode(_0x2cb892,_0x495fe2){_0x495fe2=_0x495fe2||0xcc;return function(_0x47d28d){if(_0x47d28d){return _0x2cb892['sendStatus'](_0x495fe2);}return _0x2cb892[_0xbec4('0x16')](_0x495fe2)['end']();};}function respondWithResult(_0x58f60b,_0x399851){_0x399851=_0x399851||0xc8;return function(_0x5589cc){if(_0x5589cc){return _0x58f60b[_0xbec4('0x16')](_0x399851)['json'](_0x5589cc);}};}function respondWithFilteredResult(_0x22e07e,_0x24ffcf){return function(_0x594567){if(_0x594567){var _0x2c82d1=typeof _0x24ffcf[_0xbec4('0x17')]===_0xbec4('0x18')&&typeof _0x24ffcf[_0xbec4('0x19')]===_0xbec4('0x18');var _0x4624b2=_0x594567[_0xbec4('0x1a')];var _0x1ac247=_0x2c82d1?0x0:_0x24ffcf[_0xbec4('0x17')];var _0x356ee0=_0x2c82d1?_0x594567[_0xbec4('0x1a')]:_0x24ffcf[_0xbec4('0x17')]+_0x24ffcf['limit'];var _0x25c95d;if(_0x356ee0>=_0x4624b2){_0x356ee0=_0x4624b2;_0x25c95d=0xc8;}else{_0x25c95d=0xce;}_0x22e07e[_0xbec4('0x16')](_0x25c95d);return _0x22e07e[_0xbec4('0x1b')](_0xbec4('0x1c'),_0x1ac247+'-'+_0x356ee0+'/'+_0x4624b2)[_0xbec4('0x1d')](_0x594567);}return null;};}function patchUpdates(_0x2b1751){return function(_0x14722f){try{jsonpatch['apply'](_0x14722f,_0x2b1751,!![]);}catch(_0x39c00b){return BPromise[_0xbec4('0x1e')](_0x39c00b);}return _0x14722f[_0xbec4('0x1f')]();};}function saveUpdates(_0x4649d7,_0x1befd7){return function(_0xb8179d){if(_0xb8179d){return _0xb8179d['update'](_0x4649d7)[_0xbec4('0x20')](function(_0x3828fd){return _0x3828fd;});}return null;};}function removeEntity(_0x4ca51e,_0x203920){return function(_0x1b67be){if(_0x1b67be){return _0x1b67be['destroy']()[_0xbec4('0x20')](function(){_0x4ca51e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x57ee17,_0x166d4e){return function(_0x3a793c){if(!_0x3a793c){_0x57ee17['sendStatus'](0x194);}return _0x3a793c;};}function handleError(_0x208eba,_0x33cb67){_0x33cb67=_0x33cb67||0x1f4;return function(_0x10003f){logger['error'](_0x10003f[_0xbec4('0x21')]);if(_0x10003f[_0xbec4('0x22')]){delete _0x10003f[_0xbec4('0x22')];}_0x208eba[_0xbec4('0x16')](_0x33cb67)['send'](_0x10003f);};}exports[_0xbec4('0x23')]=function(_0x1e744e,_0x4f4bf2){var _0x15561e={},_0x27d486={},_0x2b85a1={'count':0x0,'rows':[]};var _0x1ba557=_[_0xbec4('0x24')](db[_0xbec4('0x25')][_0xbec4('0x26')],function(_0x9bdd3c){return{'name':_0x9bdd3c[_0xbec4('0x27')],'type':_0x9bdd3c[_0xbec4('0x28')][_0xbec4('0x29')]};});_0x27d486['model']=_[_0xbec4('0x24')](_0x1ba557,'name');_0x27d486[_0xbec4('0x2a')]=_[_0xbec4('0x2b')](_0x1e744e['query']);_0x27d486[_0xbec4('0x2c')]=_['intersection'](_0x27d486[_0xbec4('0x2d')],_0x27d486[_0xbec4('0x2a')]);_0x15561e[_0xbec4('0x2e')]=_[_0xbec4('0x2f')](_0x27d486[_0xbec4('0x2d')],qs[_0xbec4('0x30')](_0x1e744e[_0xbec4('0x2a')][_0xbec4('0x30')]));_0x15561e[_0xbec4('0x2e')]=_0x15561e[_0xbec4('0x2e')][_0xbec4('0x31')]?_0x15561e['attributes']:_0x27d486[_0xbec4('0x2d')];if(!_0x1e744e[_0xbec4('0x2a')][_0xbec4('0x32')](_0xbec4('0x33'))){_0x15561e['limit']=qs[_0xbec4('0x19')](_0x1e744e[_0xbec4('0x2a')][_0xbec4('0x19')]);_0x15561e[_0xbec4('0x17')]=qs['offset'](_0x1e744e['query']['offset']);}_0x15561e['order']=qs[_0xbec4('0x34')](_0x1e744e[_0xbec4('0x2a')][_0xbec4('0x34')]);_0x15561e[_0xbec4('0x35')]=qs[_0xbec4('0x2c')](_[_0xbec4('0x36')](_0x1e744e['query'],_0x27d486[_0xbec4('0x2c')]),_0x1ba557);if(_0x1e744e[_0xbec4('0x2a')][_0xbec4('0x37')]){_0x15561e[_0xbec4('0x35')]=_[_0xbec4('0x38')](_0x15561e[_0xbec4('0x35')],{'$or':_[_0xbec4('0x24')](_0x1ba557,function(_0x233a7a){if(_0x233a7a[_0xbec4('0x28')]!==_0xbec4('0x39')){var _0xef0e6d={};_0xef0e6d[_0x233a7a[_0xbec4('0x22')]]={'$like':'%'+_0x1e744e[_0xbec4('0x2a')]['filter']+'%'};return _0xef0e6d;}})});}_0x15561e=_[_0xbec4('0x38')]({},_0x15561e,_0x1e744e[_0xbec4('0x3a')]);var _0x457b14={'where':_0x15561e[_0xbec4('0x35')]};return db['OpenchannelQueueReport'][_0xbec4('0x1a')](_0x457b14)[_0xbec4('0x20')](function(_0x527abb){_0x2b85a1[_0xbec4('0x1a')]=_0x527abb;if(_0x1e744e[_0xbec4('0x2a')][_0xbec4('0x3b')]){_0x15561e[_0xbec4('0x3c')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xbec4('0x3d')](_0x15561e);})[_0xbec4('0x20')](function(_0x3ca317){_0x2b85a1[_0xbec4('0x3e')]=_0x3ca317;return _0x2b85a1;})[_0xbec4('0x20')](respondWithFilteredResult(_0x4f4bf2,_0x15561e))[_0xbec4('0x3f')](handleError(_0x4f4bf2,null));};exports[_0xbec4('0x40')]=function(_0xe16258,_0x1c1696){var _0x31b4f6={'raw':!![],'where':{'id':_0xe16258[_0xbec4('0x41')]['id']}},_0x5bc97c={};_0x5bc97c['model']=_[_0xbec4('0x2b')](db[_0xbec4('0x25')][_0xbec4('0x26')]);_0x5bc97c[_0xbec4('0x2a')]=_[_0xbec4('0x2b')](_0xe16258['query']);_0x5bc97c['filters']=_['intersection'](_0x5bc97c[_0xbec4('0x2d')],_0x5bc97c[_0xbec4('0x2a')]);_0x31b4f6[_0xbec4('0x2e')]=_['intersection'](_0x5bc97c[_0xbec4('0x2d')],qs[_0xbec4('0x30')](_0xe16258[_0xbec4('0x2a')]['fields']));_0x31b4f6[_0xbec4('0x2e')]=_0x31b4f6[_0xbec4('0x2e')][_0xbec4('0x31')]?_0x31b4f6['attributes']:_0x5bc97c[_0xbec4('0x2d')];if(_0xe16258[_0xbec4('0x2a')]['includeAll']){_0x31b4f6[_0xbec4('0x3c')]=[{'all':!![]}];}_0x31b4f6=_[_0xbec4('0x38')]({},_0x31b4f6,_0xe16258[_0xbec4('0x3a')]);return db[_0xbec4('0x25')][_0xbec4('0x42')](_0x31b4f6)[_0xbec4('0x20')](handleEntityNotFound(_0x1c1696,null))[_0xbec4('0x20')](respondWithResult(_0x1c1696,null))[_0xbec4('0x3f')](handleError(_0x1c1696,null));};exports[_0xbec4('0x43')]=function(_0x42518e,_0x265789){return db[_0xbec4('0x25')][_0xbec4('0x43')](_0x42518e[_0xbec4('0x44')],{})[_0xbec4('0x20')](respondWithResult(_0x265789,0xc9))['catch'](handleError(_0x265789,null));};exports[_0xbec4('0x45')]=function(_0x445f82,_0x5e2fd3){if(_0x445f82[_0xbec4('0x44')]['id']){delete _0x445f82[_0xbec4('0x44')]['id'];}return db[_0xbec4('0x25')]['find']({'where':{'id':_0x445f82[_0xbec4('0x41')]['id']}})[_0xbec4('0x20')](handleEntityNotFound(_0x5e2fd3,null))[_0xbec4('0x20')](saveUpdates(_0x445f82[_0xbec4('0x44')],null))[_0xbec4('0x20')](respondWithResult(_0x5e2fd3,null))[_0xbec4('0x3f')](handleError(_0x5e2fd3,null));};exports[_0xbec4('0x46')]=function(_0x436861,_0x103cb5){return db[_0xbec4('0x25')][_0xbec4('0x42')]({'where':{'id':_0x436861[_0xbec4('0x41')]['id']}})['then'](handleEntityNotFound(_0x103cb5,null))[_0xbec4('0x20')](removeEntity(_0x103cb5,null))['catch'](handleError(_0x103cb5,null));};exports[_0xbec4('0x47')]=function(_0x12ca1c,_0x701819){return db[_0xbec4('0x25')][_0xbec4('0x47')]()[_0xbec4('0x20')](respondWithResult(_0x701819,null))['catch'](handleError(_0x701819,null));};
\ No newline at end of file
index 1bb8d31..a14975a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x333714,_0x3370ac){var _0x4c211e=function(_0x34219b){while(--_0x34219b){_0x333714['push'](_0x333714['shift']());}};_0x4c211e(++_0x3370ac);}(_0x814b,0x1a2));var _0xb814=function(_0x1e05c1,_0x3cffa3){_0x1e05c1=_0x1e05c1-0x0;var _0x15f1ca=_0x814b[_0x1e05c1];return _0x15f1ca;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x4d81c4,_0x16bd75){var _0x1c856b=function(_0x22079d){while(--_0x22079d){_0x4d81c4['push'](_0x4d81c4['shift']());}};_0x1c856b(++_0x16bd75);}(_0x1261,0x144));var _0x1126=function(_0x1293fa,_0x446d6b){_0x1293fa=_0x1293fa-0x0;var _0x1dd054=_0x1261[_0x1293fa];return _0x1dd054;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 0f46f86..40f82cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc91=['stringify','error','code','message','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','update','attributes','limit','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x18215f,_0x3bbe0b){var _0x4652ee=function(_0x1d45d9){while(--_0x1d45d9){_0x18215f['push'](_0x18215f['shift']());}};_0x4652ee(++_0x3bbe0b);}(_0xdc91,0x8b));var _0x1dc9=function(_0xfc0237,_0x197303){_0xfc0237=_0xfc0237-0x0;var _0x72aaf3=_0xdc91[_0xfc0237];return _0x72aaf3;};'use strict';var _=require(_0x1dc9('0x0'));var util=require(_0x1dc9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1dc9('0x2'))['db'];var utils=require(_0x1dc9('0x3'));var logger=require(_0x1dc9('0x4'))(_0x1dc9('0x5'));var config=require(_0x1dc9('0x6'));var jayson=require(_0x1dc9('0x7'));var client=jayson[_0x1dc9('0x8')][_0x1dc9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ac058,_0x2c6e6c,_0x25a752){return new BPromise(function(_0x316995,_0x3d1772){return client[_0x1dc9('0xa')](_0x5ac058,_0x25a752)[_0x1dc9('0xb')](function(_0x43c405){logger[_0x1dc9('0xc')](_0x1dc9('0xd'),_0x2c6e6c,_0x1dc9('0xe'));logger['debug'](_0x1dc9('0xf'),_0x2c6e6c,'request\x20sent',JSON[_0x1dc9('0x10')](_0x43c405));if(_0x43c405['error']){if(_0x43c405[_0x1dc9('0x11')][_0x1dc9('0x12')]===0x1f4){logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x43c405['error'][_0x1dc9('0x13')]);return _0x3d1772(_0x43c405[_0x1dc9('0x11')]['message']);}logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x43c405['error']['message']);return _0x316995(_0x43c405[_0x1dc9('0x11')][_0x1dc9('0x13')]);}else{logger[_0x1dc9('0xc')](_0x1dc9('0xd'),_0x2c6e6c,'request\x20sent');_0x316995(_0x43c405['result'][_0x1dc9('0x13')]);}})[_0x1dc9('0x14')](function(_0x5cccb9){logger[_0x1dc9('0x11')](_0x1dc9('0xd'),_0x2c6e6c,_0x5cccb9);_0x3d1772(_0x5cccb9);});});}exports[_0x1dc9('0x15')]=function(_0x197bcd){var _0x335590=this;return new Promise(function(_0x1e845a,_0x2442d0){return db[_0x1dc9('0x16')][_0x1dc9('0x17')](_0x197bcd[_0x1dc9('0x18')],{'raw':_0x197bcd[_0x1dc9('0x19')]?_0x197bcd[_0x1dc9('0x19')][_0x1dc9('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x49bd5b){logger[_0x1dc9('0xc')]('CreateOpenchannelQueueReport',_0x197bcd);logger['debug']('CreateOpenchannelQueueReport',_0x197bcd,JSON[_0x1dc9('0x10')](_0x49bd5b));_0x1e845a(_0x49bd5b);})[_0x1dc9('0x14')](function(_0x277499){logger[_0x1dc9('0x11')](_0x1dc9('0x15'),_0x277499[_0x1dc9('0x13')],_0x197bcd);_0x2442d0(_0x335590[_0x1dc9('0x11')](0x1f4,_0x277499['message']));});});};exports[_0x1dc9('0x1b')]=function(_0x2a4740){var _0x14181d=this;return new Promise(function(_0x4c6e65,_0x39f3f7){return db[_0x1dc9('0x16')][_0x1dc9('0x1c')](_0x2a4740[_0x1dc9('0x18')],{'raw':_0x2a4740[_0x1dc9('0x19')]?_0x2a4740[_0x1dc9('0x19')][_0x1dc9('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a4740[_0x1dc9('0x19')]?_0x2a4740[_0x1dc9('0x19')]['where']||null:null,'attributes':_0x2a4740['options']?_0x2a4740[_0x1dc9('0x19')][_0x1dc9('0x1d')]||null:null,'limit':_0x2a4740[_0x1dc9('0x19')]?_0x2a4740[_0x1dc9('0x19')][_0x1dc9('0x1e')]||null:null})[_0x1dc9('0xb')](function(_0x10123d){logger[_0x1dc9('0xc')](_0x1dc9('0x1b'),_0x2a4740);logger['debug'](_0x1dc9('0x1b'),_0x2a4740,JSON[_0x1dc9('0x10')](_0x10123d));_0x4c6e65(_0x10123d);})[_0x1dc9('0x14')](function(_0x2d75bc){logger[_0x1dc9('0x11')](_0x1dc9('0x1b'),_0x2d75bc['message'],_0x2a4740);_0x39f3f7(_0x14181d['error'](0x1f4,_0x2d75bc[_0x1dc9('0x13')]));});});};
\ No newline at end of file
+var _0x056b=['CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','then','debug','update','body','where','attributes','UpdateOpenchannelQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x4b0235,_0x25b269){var _0x22d370=function(_0x473c6d){while(--_0x473c6d){_0x4b0235['push'](_0x4b0235['shift']());}};_0x22d370(++_0x25b269);}(_0x056b,0xb6));var _0xb056=function(_0x49d27a,_0x166543){_0x49d27a=_0x49d27a-0x0;var _0x3f0b62=_0x056b[_0x49d27a];return _0x3f0b62;};'use strict';var _=require('lodash');var util=require(_0xb056('0x0'));var moment=require(_0xb056('0x1'));var BPromise=require(_0xb056('0x2'));var rs=require(_0xb056('0x3'));var fs=require('fs');var Redis=require(_0xb056('0x4'));var db=require(_0xb056('0x5'))['db'];var utils=require(_0xb056('0x6'));var logger=require(_0xb056('0x7'))(_0xb056('0x8'));var config=require(_0xb056('0x9'));var jayson=require(_0xb056('0xa'));var client=jayson['client'][_0xb056('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x314637,_0x3eae69,_0x3c9b89){return new BPromise(function(_0x80daf1,_0x6bf4c){return client['request'](_0x314637,_0x3c9b89)['then'](function(_0x37a86d){logger[_0xb056('0xc')](_0xb056('0xd'),_0x3eae69,_0xb056('0xe'));logger['debug'](_0xb056('0xf'),_0x3eae69,'request\x20sent',JSON[_0xb056('0x10')](_0x37a86d));if(_0x37a86d[_0xb056('0x11')]){if(_0x37a86d[_0xb056('0x11')][_0xb056('0x12')]===0x1f4){logger[_0xb056('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3eae69,_0x37a86d['error'][_0xb056('0x13')]);return _0x6bf4c(_0x37a86d[_0xb056('0x11')]['message']);}logger[_0xb056('0x11')](_0xb056('0xd'),_0x3eae69,_0x37a86d[_0xb056('0x11')][_0xb056('0x13')]);return _0x80daf1(_0x37a86d[_0xb056('0x11')][_0xb056('0x13')]);}else{logger[_0xb056('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3eae69,_0xb056('0xe'));_0x80daf1(_0x37a86d[_0xb056('0x14')][_0xb056('0x13')]);}})[_0xb056('0x15')](function(_0x5a4ef1){logger[_0xb056('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x3eae69,_0x5a4ef1);_0x6bf4c(_0x5a4ef1);});});}exports[_0xb056('0x16')]=function(_0x311eb9){var _0x48e140=this;return new Promise(function(_0x29c77e,_0x4c57e6){return db[_0xb056('0x17')][_0xb056('0x18')](_0x311eb9['body'],{'raw':_0x311eb9[_0xb056('0x19')]?_0x311eb9['options'][_0xb056('0x1a')]===undefined?!![]:![]:!![]})[_0xb056('0x1b')](function(_0x457b54){logger[_0xb056('0xc')]('CreateOpenchannelQueueReport',_0x311eb9);logger[_0xb056('0x1c')]('CreateOpenchannelQueueReport',_0x311eb9,JSON[_0xb056('0x10')](_0x457b54));_0x29c77e(_0x457b54);})['catch'](function(_0x324ce6){logger[_0xb056('0x11')](_0xb056('0x16'),_0x324ce6[_0xb056('0x13')],_0x311eb9);_0x4c57e6(_0x48e140[_0xb056('0x11')](0x1f4,_0x324ce6[_0xb056('0x13')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x1016da){var _0x18a3f2=this;return new Promise(function(_0x341544,_0x1bd6ac){return db['OpenchannelQueueReport'][_0xb056('0x1d')](_0x1016da[_0xb056('0x1e')],{'raw':_0x1016da['options']?_0x1016da[_0xb056('0x19')][_0xb056('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1016da[_0xb056('0x19')]?_0x1016da[_0xb056('0x19')][_0xb056('0x1f')]||null:null,'attributes':_0x1016da[_0xb056('0x19')]?_0x1016da[_0xb056('0x19')][_0xb056('0x20')]||null:null,'limit':_0x1016da['options']?_0x1016da[_0xb056('0x19')]['limit']||null:null})[_0xb056('0x1b')](function(_0x9c6f4a){logger[_0xb056('0xc')]('UpdateOpenchannelQueueReport',_0x1016da);logger[_0xb056('0x1c')](_0xb056('0x21'),_0x1016da,JSON['stringify'](_0x9c6f4a));_0x341544(_0x9c6f4a);})[_0xb056('0x15')](function(_0x43aa63){logger[_0xb056('0x11')](_0xb056('0x21'),_0x43aa63[_0xb056('0x13')],_0x1016da);_0x1bd6ac(_0x18a3f2['error'](0x1f4,_0x43aa63[_0xb056('0x13')]));});});};
\ No newline at end of file
index 272f6e8..eebcd8c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd49d=['delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','index','get','/describe','isAuthenticated','describe','create','put','/:id','update'];(function(_0x47b9c9,_0x3ffeb3){var _0x2587f6=function(_0x43c79){while(--_0x43c79){_0x47b9c9['push'](_0x47b9c9['shift']());}};_0x2587f6(++_0x3ffeb3);}(_0xd49d,0x16a));var _0xdd49=function(_0x1867c0,_0x359504){_0x1867c0=_0x1867c0-0x0;var _0x26d2a8=_0xd49d[_0x1867c0];return _0x26d2a8;};'use strict';var multer=require(_0xdd49('0x0'));var util=require(_0xdd49('0x1'));var path=require(_0xdd49('0x2'));var timeout=require(_0xdd49('0x3'));var express=require(_0xdd49('0x4'));var router=express['Router']();var fs_extra=require(_0xdd49('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xdd49('0x6'));var config=require(_0xdd49('0x7'));var controller=require(_0xdd49('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xdd49('0x9')]);router[_0xdd49('0xa')](_0xdd49('0xb'),auth[_0xdd49('0xc')](),controller[_0xdd49('0xd')]);router[_0xdd49('0xa')]('/:id',auth[_0xdd49('0xc')](),controller['show']);router['post']('/',auth[_0xdd49('0xc')](),controller[_0xdd49('0xe')]);router[_0xdd49('0xf')](_0xdd49('0x10'),auth['isAuthenticated'](),controller[_0xdd49('0x11')]);router[_0xdd49('0x12')](_0xdd49('0x10'),auth[_0xdd49('0xc')](),controller['destroy']);module[_0xdd49('0x13')]=router;
\ No newline at end of file
+var _0xe817=['get','isAuthenticated','/:id','show','post','create','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller'];(function(_0x1d4cac,_0x2145a5){var _0x26ecdb=function(_0x3b32b3){while(--_0x3b32b3){_0x1d4cac['push'](_0x1d4cac['shift']());}};_0x26ecdb(++_0x2145a5);}(_0xe817,0x13a));var _0x7e81=function(_0x258ea7,_0x28ccf6){_0x258ea7=_0x258ea7-0x0;var _0x38840a=_0xe817[_0x258ea7];return _0x38840a;};'use strict';var multer=require(_0x7e81('0x0'));var util=require(_0x7e81('0x1'));var path=require(_0x7e81('0x2'));var timeout=require('connect-timeout');var express=require(_0x7e81('0x3'));var router=express[_0x7e81('0x4')]();var fs_extra=require(_0x7e81('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7e81('0x6'));var config=require(_0x7e81('0x7'));var controller=require(_0x7e81('0x8'));router[_0x7e81('0x9')]('/',auth[_0x7e81('0xa')](),controller['index']);router[_0x7e81('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x7e81('0x9')](_0x7e81('0xb'),auth[_0x7e81('0xa')](),controller[_0x7e81('0xc')]);router[_0x7e81('0xd')]('/',auth[_0x7e81('0xa')](),controller[_0x7e81('0xe')]);router['put'](_0x7e81('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x7e81('0xf')](_0x7e81('0xb'),auth[_0x7e81('0xa')](),controller[_0x7e81('0x10')]);module['exports']=router;
\ No newline at end of file
index 585b9bb..18b6c90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x12f4af,_0x4a2bb9){var _0x4c4d50=function(_0x25a7f7){while(--_0x25a7f7){_0x12f4af['push'](_0x12f4af['shift']());}};_0x4c4d50(++_0x4a2bb9);}(_0x34e8,0x12c));var _0x834e=function(_0x47f32a,_0x404221){_0x47f32a=_0x47f32a-0x0;var _0x26e10c=_0x34e8[_0x47f32a];return _0x26e10c;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}};
\ No newline at end of file
+var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x151132,_0x32026a){var _0x13c2ad=function(_0x4dcd81){while(--_0x4dcd81){_0x151132['push'](_0x151132['shift']());}};_0x13c2ad(++_0x32026a);}(_0x54ef,0x112));var _0xf54e=function(_0x38051f,_0x47eb35){_0x38051f=_0x38051f-0x0;var _0x4f4ceb=_0x54ef[_0x38051f];return _0x4f4ceb;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}};
\ No newline at end of file
index f4f8b02..bcfa128 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd466=['order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','length','find','create','body','destroy','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','status','end','json','undefined','count','offset','limit','set','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','key','model','query','keys','filters','attributes','fields'];(function(_0x277208,_0x57ab06){var _0x3e2c03=function(_0x22d743){while(--_0x22d743){_0x277208['push'](_0x277208['shift']());}};_0x3e2c03(++_0x57ab06);}(_0xd466,0xf5));var _0x6d46=function(_0x48fddb,_0x37a2d3){_0x48fddb=_0x48fddb-0x0;var _0x22dad1=_0xd466[_0x48fddb];return _0x22dad1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6d46('0x0'));var zipdir=require(_0x6d46('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d46('0x2'));var moment=require(_0x6d46('0x3'));var BPromise=require(_0x6d46('0x4'));var Mustache=require(_0x6d46('0x5'));var util=require(_0x6d46('0x6'));var path=require(_0x6d46('0x7'));var sox=require(_0x6d46('0x8'));var csv=require(_0x6d46('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d46('0xa'));var _=require(_0x6d46('0xb'));var squel=require(_0x6d46('0xc'));var crypto=require(_0x6d46('0xd'));var jsforce=require(_0x6d46('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6d46('0x9'));var querystring=require(_0x6d46('0xf'));var Papa=require(_0x6d46('0x10'));var Redis=require('ioredis');var authService=require(_0x6d46('0x11'));var qs=require(_0x6d46('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6d46('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x6d46('0x14'));var config=require(_0x6d46('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x137eb5,_0x2965a5){_0x2965a5=_0x2965a5||0xcc;return function(_0x494ea9){if(_0x494ea9){return _0x137eb5['sendStatus'](_0x2965a5);}return _0x137eb5[_0x6d46('0x16')](_0x2965a5)[_0x6d46('0x17')]();};}function respondWithResult(_0x19b67c,_0x10a5be){_0x10a5be=_0x10a5be||0xc8;return function(_0x5bc6b7){if(_0x5bc6b7){return _0x19b67c[_0x6d46('0x16')](_0x10a5be)[_0x6d46('0x18')](_0x5bc6b7);}};}function respondWithFilteredResult(_0x403a28,_0x4f4e13){return function(_0x4e18c2){if(_0x4e18c2){var _0xbebee6=typeof _0x4f4e13['offset']==='undefined'&&typeof _0x4f4e13['limit']===_0x6d46('0x19');var _0x391a84=_0x4e18c2[_0x6d46('0x1a')];var _0x9fe945=_0xbebee6?0x0:_0x4f4e13[_0x6d46('0x1b')];var _0x1c7790=_0xbebee6?_0x4e18c2[_0x6d46('0x1a')]:_0x4f4e13[_0x6d46('0x1b')]+_0x4f4e13[_0x6d46('0x1c')];var _0x30fa;if(_0x1c7790>=_0x391a84){_0x1c7790=_0x391a84;_0x30fa=0xc8;}else{_0x30fa=0xce;}_0x403a28[_0x6d46('0x16')](_0x30fa);return _0x403a28[_0x6d46('0x1d')]('Content-Range',_0x9fe945+'-'+_0x1c7790+'/'+_0x391a84)[_0x6d46('0x18')](_0x4e18c2);}return null;};}function patchUpdates(_0x14b7c4){return function(_0x4ce173){try{jsonpatch[_0x6d46('0x1e')](_0x4ce173,_0x14b7c4,!![]);}catch(_0x3d5f92){return BPromise[_0x6d46('0x1f')](_0x3d5f92);}return _0x4ce173[_0x6d46('0x20')]();};}function saveUpdates(_0x55ce19,_0x46e1be){return function(_0x1b50cb){if(_0x1b50cb){return _0x1b50cb[_0x6d46('0x21')](_0x55ce19)[_0x6d46('0x22')](function(_0x5b46cc){return _0x5b46cc;});}return null;};}function removeEntity(_0x36d138,_0x4679db){return function(_0x5e90d3){if(_0x5e90d3){return _0x5e90d3['destroy']()[_0x6d46('0x22')](function(){_0x36d138['status'](0xcc)[_0x6d46('0x17')]();});}};}function handleEntityNotFound(_0xabb83b,_0x341018){return function(_0x547ff5){if(!_0x547ff5){_0xabb83b[_0x6d46('0x23')](0x194);}return _0x547ff5;};}function handleError(_0x32d471,_0x528519){_0x528519=_0x528519||0x1f4;return function(_0x4498cb){logger[_0x6d46('0x24')](_0x4498cb[_0x6d46('0x25')]);if(_0x4498cb['name']){delete _0x4498cb[_0x6d46('0x26')];}_0x32d471[_0x6d46('0x16')](_0x528519)[_0x6d46('0x27')](_0x4498cb);};}exports[_0x6d46('0x28')]=function(_0x4756f9,_0x294dee){var _0x1c36a9={},_0x184d9d={},_0x341a3f={'count':0x0,'rows':[]};var _0x6499f7=_[_0x6d46('0x29')](db[_0x6d46('0x2a')][_0x6d46('0x2b')],function(_0x2c7c34){return{'name':_0x2c7c34['fieldName'],'type':_0x2c7c34['type'][_0x6d46('0x2c')]};});_0x184d9d[_0x6d46('0x2d')]=_[_0x6d46('0x29')](_0x6499f7,'name');_0x184d9d[_0x6d46('0x2e')]=_[_0x6d46('0x2f')](_0x4756f9['query']);_0x184d9d[_0x6d46('0x30')]=_['intersection'](_0x184d9d['model'],_0x184d9d[_0x6d46('0x2e')]);_0x1c36a9[_0x6d46('0x31')]=_['intersection'](_0x184d9d['model'],qs[_0x6d46('0x32')](_0x4756f9[_0x6d46('0x2e')][_0x6d46('0x32')]));_0x1c36a9[_0x6d46('0x31')]=_0x1c36a9[_0x6d46('0x31')]['length']?_0x1c36a9[_0x6d46('0x31')]:_0x184d9d['model'];if(!_0x4756f9[_0x6d46('0x2e')]['hasOwnProperty']('nolimit')){_0x1c36a9[_0x6d46('0x1c')]=qs[_0x6d46('0x1c')](_0x4756f9['query'][_0x6d46('0x1c')]);_0x1c36a9[_0x6d46('0x1b')]=qs[_0x6d46('0x1b')](_0x4756f9[_0x6d46('0x2e')]['offset']);}_0x1c36a9[_0x6d46('0x33')]=qs[_0x6d46('0x34')](_0x4756f9[_0x6d46('0x2e')][_0x6d46('0x34')]);_0x1c36a9['where']=qs['filters'](_[_0x6d46('0x35')](_0x4756f9['query'],_0x184d9d[_0x6d46('0x30')]),_0x6499f7);if(_0x4756f9[_0x6d46('0x2e')][_0x6d46('0x36')]){_0x1c36a9[_0x6d46('0x37')]=_[_0x6d46('0x38')](_0x1c36a9[_0x6d46('0x37')],{'$or':_[_0x6d46('0x29')](_0x6499f7,function(_0xd74845){if(_0xd74845[_0x6d46('0x39')]!==_0x6d46('0x3a')){var _0x4523d4={};_0x4523d4[_0xd74845['name']]={'$like':'%'+_0x4756f9['query'][_0x6d46('0x36')]+'%'};return _0x4523d4;}})});}_0x1c36a9=_[_0x6d46('0x38')]({},_0x1c36a9,_0x4756f9[_0x6d46('0x3b')]);var _0x45c434={'where':_0x1c36a9[_0x6d46('0x37')]};return db[_0x6d46('0x2a')][_0x6d46('0x1a')](_0x45c434)[_0x6d46('0x22')](function(_0x3f97db){_0x341a3f['count']=_0x3f97db;if(_0x4756f9[_0x6d46('0x2e')][_0x6d46('0x3c')]){_0x1c36a9[_0x6d46('0x3d')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x6d46('0x3e')](_0x1c36a9);})[_0x6d46('0x22')](function(_0x396877){_0x341a3f[_0x6d46('0x3f')]=_0x396877;return _0x341a3f;})[_0x6d46('0x22')](respondWithFilteredResult(_0x294dee,_0x1c36a9))[_0x6d46('0x40')](handleError(_0x294dee,null));};exports[_0x6d46('0x41')]=function(_0x63645d,_0x183db0){var _0x3f5bda={'raw':!![],'where':{'id':_0x63645d[_0x6d46('0x42')]['id']}},_0x6443a={};_0x6443a[_0x6d46('0x2d')]=_[_0x6d46('0x2f')](db[_0x6d46('0x2a')][_0x6d46('0x2b')]);_0x6443a[_0x6d46('0x2e')]=_[_0x6d46('0x2f')](_0x63645d['query']);_0x6443a[_0x6d46('0x30')]=_[_0x6d46('0x43')](_0x6443a[_0x6d46('0x2d')],_0x6443a[_0x6d46('0x2e')]);_0x3f5bda[_0x6d46('0x31')]=_[_0x6d46('0x43')](_0x6443a[_0x6d46('0x2d')],qs[_0x6d46('0x32')](_0x63645d[_0x6d46('0x2e')][_0x6d46('0x32')]));_0x3f5bda[_0x6d46('0x31')]=_0x3f5bda[_0x6d46('0x31')][_0x6d46('0x44')]?_0x3f5bda['attributes']:_0x6443a[_0x6d46('0x2d')];if(_0x63645d[_0x6d46('0x2e')][_0x6d46('0x3c')]){_0x3f5bda[_0x6d46('0x3d')]=[{'all':!![]}];}_0x3f5bda=_[_0x6d46('0x38')]({},_0x3f5bda,_0x63645d[_0x6d46('0x3b')]);return db[_0x6d46('0x2a')][_0x6d46('0x45')](_0x3f5bda)[_0x6d46('0x22')](handleEntityNotFound(_0x183db0,null))[_0x6d46('0x22')](respondWithResult(_0x183db0,null))['catch'](handleError(_0x183db0,null));};exports[_0x6d46('0x46')]=function(_0x37a613,_0x43cf55){return db[_0x6d46('0x2a')]['create'](_0x37a613[_0x6d46('0x47')],{})[_0x6d46('0x22')](respondWithResult(_0x43cf55,0xc9))[_0x6d46('0x40')](handleError(_0x43cf55,null));};exports[_0x6d46('0x21')]=function(_0x44b049,_0x2df449){if(_0x44b049[_0x6d46('0x47')]['id']){delete _0x44b049[_0x6d46('0x47')]['id'];}return db[_0x6d46('0x2a')]['find']({'where':{'id':_0x44b049[_0x6d46('0x42')]['id']}})[_0x6d46('0x22')](handleEntityNotFound(_0x2df449,null))[_0x6d46('0x22')](saveUpdates(_0x44b049[_0x6d46('0x47')],null))[_0x6d46('0x22')](respondWithResult(_0x2df449,null))[_0x6d46('0x40')](handleError(_0x2df449,null));};exports[_0x6d46('0x48')]=function(_0x3ad673,_0x5a9fb6){return db['OpenchannelTransferReport'][_0x6d46('0x45')]({'where':{'id':_0x3ad673['params']['id']}})[_0x6d46('0x22')](handleEntityNotFound(_0x5a9fb6,null))['then'](removeEntity(_0x5a9fb6,null))['catch'](handleError(_0x5a9fb6,null));};exports['describe']=function(_0x17a07d,_0x9ec017){return db[_0x6d46('0x2a')][_0x6d46('0x49')]()[_0x6d46('0x22')](respondWithResult(_0x9ec017,null))[_0x6d46('0x40')](handleError(_0x9ec017,null));};
\ No newline at end of file
+var _0x06d3=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','OpenchannelTransferReport','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x2be310,_0xd52fbe){var _0x5554e7=function(_0x566516){while(--_0x566516){_0x2be310['push'](_0x2be310['shift']());}};_0x5554e7(++_0xd52fbe);}(_0x06d3,0x1b0));var _0x306d=function(_0x5490de,_0x7ddd3f){_0x5490de=_0x5490de-0x0;var _0xaf14ba=_0x06d3[_0x5490de];return _0xaf14ba;};'use strict';var emlformat=require(_0x306d('0x0'));var rimraf=require(_0x306d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x306d('0x2'));var rp=require(_0x306d('0x3'));var moment=require(_0x306d('0x4'));var BPromise=require(_0x306d('0x5'));var Mustache=require(_0x306d('0x6'));var util=require(_0x306d('0x7'));var path=require('path');var sox=require(_0x306d('0x8'));var csv=require(_0x306d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x306d('0xa'));var _=require(_0x306d('0xb'));var squel=require('squel');var crypto=require(_0x306d('0xc'));var jsforce=require(_0x306d('0xd'));var deskjs=require(_0x306d('0xe'));var toCsv=require(_0x306d('0x9'));var querystring=require('querystring');var Papa=require(_0x306d('0xf'));var Redis=require(_0x306d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x306d('0x11'));var as=require(_0x306d('0x12'));var hardwareService=require(_0x306d('0x13'));var logger=require(_0x306d('0x14'))('api');var utils=require(_0x306d('0x15'));var config=require(_0x306d('0x16'));var licenseUtil=require(_0x306d('0x17'));var db=require(_0x306d('0x18'))['db'];function respondWithStatusCode(_0x342369,_0x1a10eb){_0x1a10eb=_0x1a10eb||0xcc;return function(_0x126cdf){if(_0x126cdf){return _0x342369[_0x306d('0x19')](_0x1a10eb);}return _0x342369[_0x306d('0x1a')](_0x1a10eb)[_0x306d('0x1b')]();};}function respondWithResult(_0x479dd7,_0x12744e){_0x12744e=_0x12744e||0xc8;return function(_0x21e60f){if(_0x21e60f){return _0x479dd7['status'](_0x12744e)[_0x306d('0x1c')](_0x21e60f);}};}function respondWithFilteredResult(_0x32ab85,_0x158fb5){return function(_0x19bff7){if(_0x19bff7){var _0x567766=typeof _0x158fb5[_0x306d('0x1d')]===_0x306d('0x1e')&&typeof _0x158fb5[_0x306d('0x1f')]==='undefined';var _0x207ba2=_0x19bff7['count'];var _0x2405a3=_0x567766?0x0:_0x158fb5['offset'];var _0x17815e=_0x567766?_0x19bff7[_0x306d('0x20')]:_0x158fb5[_0x306d('0x1d')]+_0x158fb5[_0x306d('0x1f')];var _0x343ea7;if(_0x17815e>=_0x207ba2){_0x17815e=_0x207ba2;_0x343ea7=0xc8;}else{_0x343ea7=0xce;}_0x32ab85[_0x306d('0x1a')](_0x343ea7);return _0x32ab85[_0x306d('0x21')](_0x306d('0x22'),_0x2405a3+'-'+_0x17815e+'/'+_0x207ba2)['json'](_0x19bff7);}return null;};}function patchUpdates(_0x7f7ce1){return function(_0x567375){try{jsonpatch[_0x306d('0x23')](_0x567375,_0x7f7ce1,!![]);}catch(_0x17f358){return BPromise[_0x306d('0x24')](_0x17f358);}return _0x567375[_0x306d('0x25')]();};}function saveUpdates(_0x389978,_0x4f6e51){return function(_0x41981e){if(_0x41981e){return _0x41981e[_0x306d('0x26')](_0x389978)[_0x306d('0x27')](function(_0x1501da){return _0x1501da;});}return null;};}function removeEntity(_0xb59013,_0x5b425f){return function(_0x1d07be){if(_0x1d07be){return _0x1d07be[_0x306d('0x28')]()[_0x306d('0x27')](function(){_0xb59013['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262462,_0x4b6d64){return function(_0x2b7a72){if(!_0x2b7a72){_0x262462['sendStatus'](0x194);}return _0x2b7a72;};}function handleError(_0x4c592c,_0x92ee20){_0x92ee20=_0x92ee20||0x1f4;return function(_0x3a2bbb){logger['error'](_0x3a2bbb[_0x306d('0x29')]);if(_0x3a2bbb[_0x306d('0x2a')]){delete _0x3a2bbb[_0x306d('0x2a')];}_0x4c592c[_0x306d('0x1a')](_0x92ee20)['send'](_0x3a2bbb);};}exports[_0x306d('0x2b')]=function(_0x341c07,_0x3b80a1){var _0x27439b={},_0x438708={},_0x3bbed4={'count':0x0,'rows':[]};var _0x391cad=_[_0x306d('0x2c')](db[_0x306d('0x2d')][_0x306d('0x2e')],function(_0x3d32bd){return{'name':_0x3d32bd['fieldName'],'type':_0x3d32bd['type'][_0x306d('0x2f')]};});_0x438708[_0x306d('0x30')]=_[_0x306d('0x2c')](_0x391cad,_0x306d('0x2a'));_0x438708['query']=_[_0x306d('0x31')](_0x341c07[_0x306d('0x32')]);_0x438708[_0x306d('0x33')]=_[_0x306d('0x34')](_0x438708['model'],_0x438708[_0x306d('0x32')]);_0x27439b[_0x306d('0x35')]=_[_0x306d('0x34')](_0x438708[_0x306d('0x30')],qs[_0x306d('0x36')](_0x341c07[_0x306d('0x32')]['fields']));_0x27439b[_0x306d('0x35')]=_0x27439b[_0x306d('0x35')][_0x306d('0x37')]?_0x27439b[_0x306d('0x35')]:_0x438708[_0x306d('0x30')];if(!_0x341c07[_0x306d('0x32')][_0x306d('0x38')]('nolimit')){_0x27439b[_0x306d('0x1f')]=qs[_0x306d('0x1f')](_0x341c07['query']['limit']);_0x27439b[_0x306d('0x1d')]=qs[_0x306d('0x1d')](_0x341c07[_0x306d('0x32')][_0x306d('0x1d')]);}_0x27439b[_0x306d('0x39')]=qs[_0x306d('0x3a')](_0x341c07[_0x306d('0x32')][_0x306d('0x3a')]);_0x27439b['where']=qs['filters'](_[_0x306d('0x3b')](_0x341c07[_0x306d('0x32')],_0x438708[_0x306d('0x33')]),_0x391cad);if(_0x341c07[_0x306d('0x32')][_0x306d('0x3c')]){_0x27439b[_0x306d('0x3d')]=_[_0x306d('0x3e')](_0x27439b[_0x306d('0x3d')],{'$or':_['map'](_0x391cad,function(_0x3616a4){if(_0x3616a4['type']!==_0x306d('0x3f')){var _0x406c4b={};_0x406c4b[_0x3616a4['name']]={'$like':'%'+_0x341c07['query'][_0x306d('0x3c')]+'%'};return _0x406c4b;}})});}_0x27439b=_['merge']({},_0x27439b,_0x341c07[_0x306d('0x40')]);var _0x205f8a={'where':_0x27439b[_0x306d('0x3d')]};return db[_0x306d('0x2d')][_0x306d('0x20')](_0x205f8a)[_0x306d('0x27')](function(_0x1b3743){_0x3bbed4[_0x306d('0x20')]=_0x1b3743;if(_0x341c07['query']['includeAll']){_0x27439b[_0x306d('0x41')]=[{'all':!![]}];}return db[_0x306d('0x2d')][_0x306d('0x42')](_0x27439b);})['then'](function(_0x603929){_0x3bbed4[_0x306d('0x43')]=_0x603929;return _0x3bbed4;})[_0x306d('0x27')](respondWithFilteredResult(_0x3b80a1,_0x27439b))[_0x306d('0x44')](handleError(_0x3b80a1,null));};exports[_0x306d('0x45')]=function(_0x41e4b6,_0x54235a){var _0xbec94d={'raw':!![],'where':{'id':_0x41e4b6[_0x306d('0x46')]['id']}},_0x5e3c64={};_0x5e3c64[_0x306d('0x30')]=_[_0x306d('0x31')](db[_0x306d('0x2d')]['rawAttributes']);_0x5e3c64[_0x306d('0x32')]=_[_0x306d('0x31')](_0x41e4b6[_0x306d('0x32')]);_0x5e3c64[_0x306d('0x33')]=_[_0x306d('0x34')](_0x5e3c64['model'],_0x5e3c64[_0x306d('0x32')]);_0xbec94d[_0x306d('0x35')]=_[_0x306d('0x34')](_0x5e3c64[_0x306d('0x30')],qs[_0x306d('0x36')](_0x41e4b6[_0x306d('0x32')][_0x306d('0x36')]));_0xbec94d[_0x306d('0x35')]=_0xbec94d[_0x306d('0x35')][_0x306d('0x37')]?_0xbec94d[_0x306d('0x35')]:_0x5e3c64['model'];if(_0x41e4b6[_0x306d('0x32')][_0x306d('0x47')]){_0xbec94d['include']=[{'all':!![]}];}_0xbec94d=_['merge']({},_0xbec94d,_0x41e4b6['options']);return db[_0x306d('0x2d')][_0x306d('0x48')](_0xbec94d)[_0x306d('0x27')](handleEntityNotFound(_0x54235a,null))[_0x306d('0x27')](respondWithResult(_0x54235a,null))['catch'](handleError(_0x54235a,null));};exports[_0x306d('0x49')]=function(_0x47a59e,_0x32d1b2){return db['OpenchannelTransferReport'][_0x306d('0x49')](_0x47a59e[_0x306d('0x4a')],{})[_0x306d('0x27')](respondWithResult(_0x32d1b2,0xc9))[_0x306d('0x44')](handleError(_0x32d1b2,null));};exports[_0x306d('0x26')]=function(_0x1b9051,_0x3ac8b6){if(_0x1b9051['body']['id']){delete _0x1b9051[_0x306d('0x4a')]['id'];}return db[_0x306d('0x2d')][_0x306d('0x48')]({'where':{'id':_0x1b9051[_0x306d('0x46')]['id']}})[_0x306d('0x27')](handleEntityNotFound(_0x3ac8b6,null))['then'](saveUpdates(_0x1b9051[_0x306d('0x4a')],null))['then'](respondWithResult(_0x3ac8b6,null))[_0x306d('0x44')](handleError(_0x3ac8b6,null));};exports['destroy']=function(_0x209ce4,_0x55640e){return db[_0x306d('0x2d')][_0x306d('0x48')]({'where':{'id':_0x209ce4[_0x306d('0x46')]['id']}})[_0x306d('0x27')](handleEntityNotFound(_0x55640e,null))['then'](removeEntity(_0x55640e,null))[_0x306d('0x44')](handleError(_0x55640e,null));};exports[_0x306d('0x4b')]=function(_0x1e508e,_0x13de47){return db['OpenchannelTransferReport'][_0x306d('0x4b')]()[_0x306d('0x27')](respondWithResult(_0x13de47,null))['catch'](handleError(_0x13de47,null));};
\ No newline at end of file
index a96671c..7bd178f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd99e=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','define','report_openchannel_transfer'];(function(_0x59dbc3,_0xfc1f22){var _0x1ba735=function(_0x5bc380){while(--_0x5bc380){_0x59dbc3['push'](_0x59dbc3['shift']());}};_0x1ba735(++_0xfc1f22);}(_0xd99e,0x68));var _0xed99=function(_0x333767,_0x3e6f9c){_0x333767=_0x333767-0x0;var _0x51661b=_0xd99e[_0x333767];return _0x51661b;};'use strict';var _=require(_0xed99('0x0'));var util=require(_0xed99('0x1'));var logger=require(_0xed99('0x2'))(_0xed99('0x3'));var moment=require(_0xed99('0x4'));var BPromise=require(_0xed99('0x5'));var rp=require(_0xed99('0x6'));var fs=require('fs');var path=require(_0xed99('0x7'));var rimraf=require(_0xed99('0x8'));var config=require(_0xed99('0x9'));var attributes=require(_0xed99('0xa'));module['exports']=function(_0x412c4b,_0x23e052){return _0x412c4b[_0xed99('0xb')]('OpenchannelTransferReport',attributes,{'tableName':_0xed99('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xff29=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid'];(function(_0x4d9403,_0x33c5f0){var _0x5eef11=function(_0x50bb5c){while(--_0x50bb5c){_0x4d9403['push'](_0x4d9403['shift']());}};_0x5eef11(++_0x33c5f0);}(_0xff29,0x1c7));var _0x9ff2=function(_0x4aa288,_0x14b86b){_0x4aa288=_0x4aa288-0x0;var _0x5ab027=_0xff29[_0x4aa288];return _0x5ab027;};'use strict';var _=require('lodash');var util=require(_0x9ff2('0x0'));var logger=require(_0x9ff2('0x1'))(_0x9ff2('0x2'));var moment=require('moment');var BPromise=require(_0x9ff2('0x3'));var rp=require(_0x9ff2('0x4'));var fs=require('fs');var path=require(_0x9ff2('0x5'));var rimraf=require(_0x9ff2('0x6'));var config=require(_0x9ff2('0x7'));var attributes=require('./openchannelTransferReport.attributes');module[_0x9ff2('0x8')]=function(_0x40ee3d,_0x2a4a41){return _0x40ee3d[_0x9ff2('0x9')](_0x9ff2('0xa'),attributes,{'tableName':_0x9ff2('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x9ff2('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 67a86e6..06652d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x04f9=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x04f9,0xb3));var _0x904f=function(_0x58d66a,_0x167ce5){_0x58d66a=_0x58d66a-0x0;var _0x55aeb6=_0x04f9[_0x58d66a];return _0x55aeb6;};'use strict';var _=require('lodash');var util=require(_0x904f('0x0'));var moment=require(_0x904f('0x1'));var BPromise=require(_0x904f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x904f('0x3'));var db=require(_0x904f('0x4'))['db'];var utils=require(_0x904f('0x5'));var logger=require(_0x904f('0x6'))(_0x904f('0x7'));var config=require(_0x904f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x904f('0x9')][_0x904f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x175c38,_0x21dce4,_0x34cbd7){return new BPromise(function(_0x506239,_0xa90c3f){return client[_0x904f('0xb')](_0x175c38,_0x34cbd7)[_0x904f('0xc')](function(_0x4f8d32){logger[_0x904f('0xd')](_0x904f('0xe'),_0x21dce4,_0x904f('0xf'));logger[_0x904f('0x10')](_0x904f('0x11'),_0x21dce4,_0x904f('0xf'),JSON[_0x904f('0x12')](_0x4f8d32));if(_0x4f8d32[_0x904f('0x13')]){if(_0x4f8d32[_0x904f('0x13')][_0x904f('0x14')]===0x1f4){logger[_0x904f('0x13')](_0x904f('0xe'),_0x21dce4,_0x4f8d32[_0x904f('0x13')][_0x904f('0x15')]);return _0xa90c3f(_0x4f8d32[_0x904f('0x13')][_0x904f('0x15')]);}logger[_0x904f('0x13')](_0x904f('0xe'),_0x21dce4,_0x4f8d32[_0x904f('0x13')][_0x904f('0x15')]);return _0x506239(_0x4f8d32[_0x904f('0x13')][_0x904f('0x15')]);}else{logger[_0x904f('0xd')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x21dce4,'request\x20sent');_0x506239(_0x4f8d32[_0x904f('0x16')][_0x904f('0x15')]);}})['catch'](function(_0x58c4d6){logger['error'](_0x904f('0xe'),_0x21dce4,_0x58c4d6);_0xa90c3f(_0x58c4d6);});});}
\ No newline at end of file
+var _0x0958=['moment','randomstring','ioredis','../../config/logger','rpc','client','http','request','then','OpenchannelTransferReport,\x20%s,\x20%s','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','util'];(function(_0x1a073d,_0x4db2d9){var _0x45daab=function(_0xf4cae){while(--_0xf4cae){_0x1a073d['push'](_0x1a073d['shift']());}};_0x45daab(++_0x4db2d9);}(_0x0958,0x7c));var _0x8095=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0958[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x8095('0x0'));var util=require(_0x8095('0x1'));var moment=require(_0x8095('0x2'));var BPromise=require('bluebird');var rs=require(_0x8095('0x3'));var fs=require('fs');var Redis=require(_0x8095('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8095('0x5'))(_0x8095('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8095('0x7')][_0x8095('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x439ecc,_0x1dac39,_0x1fac84){return new BPromise(function(_0x4d5ee3,_0x5a19ef){return client[_0x8095('0x9')](_0x439ecc,_0x1fac84)[_0x8095('0xa')](function(_0x4967a5){logger['info'](_0x8095('0xb'),_0x1dac39,'request\x20sent');logger[_0x8095('0xc')](_0x8095('0xd'),_0x1dac39,_0x8095('0xe'),JSON[_0x8095('0xf')](_0x4967a5));if(_0x4967a5[_0x8095('0x10')]){if(_0x4967a5['error'][_0x8095('0x11')]===0x1f4){logger['error'](_0x8095('0xb'),_0x1dac39,_0x4967a5[_0x8095('0x10')][_0x8095('0x12')]);return _0x5a19ef(_0x4967a5[_0x8095('0x10')][_0x8095('0x12')]);}logger[_0x8095('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1dac39,_0x4967a5[_0x8095('0x10')][_0x8095('0x12')]);return _0x4d5ee3(_0x4967a5[_0x8095('0x10')]['message']);}else{logger[_0x8095('0x13')](_0x8095('0xb'),_0x1dac39,_0x8095('0xe'));_0x4d5ee3(_0x4967a5[_0x8095('0x14')][_0x8095('0x12')]);}})['catch'](function(_0x1b1ca3){logger[_0x8095('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1dac39,_0x1b1ca3);_0x5a19ef(_0x1b1ca3);});});}
\ No newline at end of file
index a7f35e9..1da8058 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0817=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','isAuthenticated','index','show','post','create'];(function(_0x55a89e,_0x1a05ab){var _0x3aa2bd=function(_0x4b9d09){while(--_0x4b9d09){_0x55a89e['push'](_0x55a89e['shift']());}};_0x3aa2bd(++_0x1a05ab);}(_0x0817,0x90));var _0x7081=function(_0x1b262b,_0x10c7c6){_0x1b262b=_0x1b262b-0x0;var _0x54ac1f=_0x0817[_0x1b262b];return _0x54ac1f;};'use strict';var multer=require(_0x7081('0x0'));var util=require('util');var path=require(_0x7081('0x1'));var timeout=require(_0x7081('0x2'));var express=require(_0x7081('0x3'));var router=express[_0x7081('0x4')]();var fs_extra=require(_0x7081('0x5'));var auth=require(_0x7081('0x6'));var interaction=require(_0x7081('0x7'));var config=require(_0x7081('0x8'));var controller=require(_0x7081('0x9'));router[_0x7081('0xa')]('/',auth[_0x7081('0xb')](),controller[_0x7081('0xc')]);router[_0x7081('0xa')]('/:id',auth[_0x7081('0xb')](),controller[_0x7081('0xd')]);router[_0x7081('0xe')]('/',auth['isAuthenticated'](),controller[_0x7081('0xf')]);router['put']('/:id',auth[_0x7081('0xb')](),controller[_0x7081('0x10')]);router[_0x7081('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x7081('0x12')]);module[_0x7081('0x13')]=router;
\ No newline at end of file
+var _0x8339=['isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get'];(function(_0x3f401e,_0x3cc202){var _0x31e23f=function(_0x5caef2){while(--_0x5caef2){_0x3f401e['push'](_0x3f401e['shift']());}};_0x31e23f(++_0x3cc202);}(_0x8339,0x180));var _0x9833=function(_0x27bcb2,_0x412da4){_0x27bcb2=_0x27bcb2-0x0;var _0xef0f33=_0x8339[_0x27bcb2];return _0xef0f33;};'use strict';var multer=require(_0x9833('0x0'));var util=require(_0x9833('0x1'));var path=require(_0x9833('0x2'));var timeout=require(_0x9833('0x3'));var express=require(_0x9833('0x4'));var router=express[_0x9833('0x5')]();var fs_extra=require(_0x9833('0x6'));var auth=require(_0x9833('0x7'));var interaction=require(_0x9833('0x8'));var config=require(_0x9833('0x9'));var controller=require(_0x9833('0xa'));router[_0x9833('0xb')]('/',auth[_0x9833('0xc')](),controller['index']);router[_0x9833('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x9833('0xd')]);router[_0x9833('0xe')]('/',auth[_0x9833('0xc')](),controller[_0x9833('0xf')]);router[_0x9833('0x10')](_0x9833('0x11'),auth[_0x9833('0xc')](),controller[_0x9833('0x12')]);router[_0x9833('0x13')]('/:id',auth[_0x9833('0xc')](),controller[_0x9833('0x14')]);module[_0x9833('0x15')]=router;
\ No newline at end of file
index 5aa0aca..0e1b431 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0f1=['exports','STRING','name'];(function(_0x4104d6,_0x208918){var _0x1026af=function(_0x42c2d6){while(--_0x42c2d6){_0x4104d6['push'](_0x4104d6['shift']());}};_0x1026af(++_0x208918);}(_0xe0f1,0xa5));var _0x1e0f=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0xe0f1[_0x4e93a9];return _0x43013c;};'use strict';var Sequelize=require('sequelize');module[_0x1e0f('0x0')]={'name':{'type':Sequelize[_0x1e0f('0x1')],'unique':_0x1e0f('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x1e0f('0x1')]}};
\ No newline at end of file
+var _0xad8d=['STRING','name','sequelize','exports'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xad8d,0x1a2));var _0xdad8=function(_0x290e14,_0x53d210){_0x290e14=_0x290e14-0x0;var _0x2533ec=_0xad8d[_0x290e14];return _0x2533ec;};'use strict';var Sequelize=require(_0xdad8('0x0'));module[_0xdad8('0x1')]={'name':{'type':Sequelize[_0xdad8('0x2')],'unique':_0xdad8('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xdad8('0x2')]}};
\ No newline at end of file
index aa67548..38684b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7049=['filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','save','update','destroy','get','Pauses','then','end','stack','name','index','map','Pause','rawAttributes','type','model','keys','query','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick'];(function(_0x1590e6,_0x5cb128){var _0x42b188=function(_0x21b4e3){while(--_0x21b4e3){_0x1590e6['push'](_0x1590e6['shift']());}};_0x42b188(++_0x5cb128);}(_0x7049,0x1d9));var _0x9704=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0x7049[_0x1ae5ab];return _0x1ce001;};'use strict';var emlformat=require(_0x9704('0x0'));var rimraf=require(_0x9704('0x1'));var zipdir=require(_0x9704('0x2'));var jsonpatch=require(_0x9704('0x3'));var rp=require(_0x9704('0x4'));var moment=require(_0x9704('0x5'));var BPromise=require(_0x9704('0x6'));var Mustache=require(_0x9704('0x7'));var util=require(_0x9704('0x8'));var path=require(_0x9704('0x9'));var sox=require(_0x9704('0xa'));var csv=require('to-csv');var ejs=require(_0x9704('0xb'));var fs=require('fs');var fs_extra=require(_0x9704('0xc'));var _=require(_0x9704('0xd'));var squel=require(_0x9704('0xe'));var crypto=require(_0x9704('0xf'));var jsforce=require(_0x9704('0x10'));var deskjs=require(_0x9704('0x11'));var toCsv=require(_0x9704('0x12'));var querystring=require(_0x9704('0x13'));var Papa=require(_0x9704('0x14'));var Redis=require(_0x9704('0x15'));var authService=require(_0x9704('0x16'));var qs=require(_0x9704('0x17'));var as=require(_0x9704('0x18'));var hardwareService=require(_0x9704('0x19'));var logger=require(_0x9704('0x1a'))('api');var utils=require(_0x9704('0x1b'));var config=require(_0x9704('0x1c'));var licenseUtil=require(_0x9704('0x1d'));var db=require(_0x9704('0x1e'))['db'];function respondWithStatusCode(_0x3450c4,_0x50ee8f){_0x50ee8f=_0x50ee8f||0xcc;return function(_0x4df36a){if(_0x4df36a){return _0x3450c4[_0x9704('0x1f')](_0x50ee8f);}return _0x3450c4[_0x9704('0x20')](_0x50ee8f)['end']();};}function respondWithResult(_0x34044a,_0x3372c2){_0x3372c2=_0x3372c2||0xc8;return function(_0xaad760){if(_0xaad760){return _0x34044a['status'](_0x3372c2)[_0x9704('0x21')](_0xaad760);}};}function respondWithFilteredResult(_0x9759d5,_0x2cf223){return function(_0x26faeb){if(_0x26faeb){var _0x50a515=typeof _0x2cf223[_0x9704('0x22')]==='undefined'&&typeof _0x2cf223[_0x9704('0x23')]===_0x9704('0x24');var _0x1fe47f=_0x26faeb[_0x9704('0x25')];var _0x7529f7=_0x50a515?0x0:_0x2cf223[_0x9704('0x22')];var _0xc99256=_0x50a515?_0x26faeb[_0x9704('0x25')]:_0x2cf223[_0x9704('0x22')]+_0x2cf223[_0x9704('0x23')];var _0xd5930d;if(_0xc99256>=_0x1fe47f){_0xc99256=_0x1fe47f;_0xd5930d=0xc8;}else{_0xd5930d=0xce;}_0x9759d5[_0x9704('0x20')](_0xd5930d);return _0x9759d5[_0x9704('0x26')]('Content-Range',_0x7529f7+'-'+_0xc99256+'/'+_0x1fe47f)[_0x9704('0x21')](_0x26faeb);}return null;};}function patchUpdates(_0x24121d){return function(_0x3caff5){try{jsonpatch[_0x9704('0x27')](_0x3caff5,_0x24121d,!![]);}catch(_0x330ef6){return BPromise[_0x9704('0x28')](_0x330ef6);}return _0x3caff5[_0x9704('0x29')]();};}function saveUpdates(_0x3d32c7,_0x313e58){return function(_0x798bab){if(_0x798bab){return _0x798bab[_0x9704('0x2a')](_0x3d32c7)['then'](function(_0x35c9df){return _0x35c9df;});}return null;};}function removeEntity(_0x18f8b2,_0x7dcd77){return function(_0x41f560){if(_0x41f560){return _0x41f560[_0x9704('0x2b')]()['then'](function(){var _0x1be6a5=_0x41f560[_0x9704('0x2c')]({'plain':!![]});var _0x8af3c9=_0x9704('0x2d');return db['UserProfileResource']['destroy']({'where':{'type':_0x8af3c9,'resourceId':_0x1be6a5['id']}})[_0x9704('0x2e')](function(){return _0x41f560;});})[_0x9704('0x2e')](function(){_0x18f8b2[_0x9704('0x20')](0xcc)[_0x9704('0x2f')]();});}};}function handleEntityNotFound(_0x4ae470,_0x54f8ac){return function(_0x4e2b66){if(!_0x4e2b66){_0x4ae470['sendStatus'](0x194);}return _0x4e2b66;};}function handleError(_0x5da6a7,_0x502bef){_0x502bef=_0x502bef||0x1f4;return function(_0x10e9b9){logger['error'](_0x10e9b9[_0x9704('0x30')]);if(_0x10e9b9[_0x9704('0x31')]){delete _0x10e9b9['name'];}_0x5da6a7['status'](_0x502bef)['send'](_0x10e9b9);};}exports[_0x9704('0x32')]=function(_0x236392,_0x35c634){var _0x82c005={},_0x1fdc96={},_0x4347f9={'count':0x0,'rows':[]};var _0x581ae1=_[_0x9704('0x33')](db[_0x9704('0x34')][_0x9704('0x35')],function(_0x324282){return{'name':_0x324282['fieldName'],'type':_0x324282[_0x9704('0x36')]['key']};});_0x1fdc96[_0x9704('0x37')]=_[_0x9704('0x33')](_0x581ae1,_0x9704('0x31'));_0x1fdc96['query']=_[_0x9704('0x38')](_0x236392[_0x9704('0x39')]);_0x1fdc96[_0x9704('0x3a')]=_[_0x9704('0x3b')](_0x1fdc96[_0x9704('0x37')],_0x1fdc96[_0x9704('0x39')]);_0x82c005[_0x9704('0x3c')]=_[_0x9704('0x3b')](_0x1fdc96['model'],qs['fields'](_0x236392['query']['fields']));_0x82c005[_0x9704('0x3c')]=_0x82c005['attributes'][_0x9704('0x3d')]?_0x82c005['attributes']:_0x1fdc96[_0x9704('0x37')];if(!_0x236392[_0x9704('0x39')][_0x9704('0x3e')]('nolimit')){_0x82c005[_0x9704('0x23')]=qs[_0x9704('0x23')](_0x236392[_0x9704('0x39')]['limit']);_0x82c005[_0x9704('0x22')]=qs['offset'](_0x236392[_0x9704('0x39')]['offset']);}_0x82c005[_0x9704('0x3f')]=qs[_0x9704('0x40')](_0x236392[_0x9704('0x39')][_0x9704('0x40')]);_0x82c005[_0x9704('0x41')]=qs[_0x9704('0x3a')](_[_0x9704('0x42')](_0x236392[_0x9704('0x39')],_0x1fdc96[_0x9704('0x3a')]),_0x581ae1);if(_0x236392[_0x9704('0x39')][_0x9704('0x43')]){_0x82c005['where']=_[_0x9704('0x44')](_0x82c005[_0x9704('0x41')],{'$or':_[_0x9704('0x33')](_0x581ae1,function(_0x3f301e){if(_0x3f301e['type']!==_0x9704('0x45')){var _0x5d0ffb={};_0x5d0ffb[_0x3f301e[_0x9704('0x31')]]={'$like':'%'+_0x236392[_0x9704('0x39')]['filter']+'%'};return _0x5d0ffb;}})});}_0x82c005=_[_0x9704('0x44')]({},_0x82c005,_0x236392[_0x9704('0x46')]);var _0xcc6c74={'where':_0x82c005[_0x9704('0x41')]};return db[_0x9704('0x34')][_0x9704('0x25')](_0xcc6c74)[_0x9704('0x2e')](function(_0x4e24d5){_0x4347f9[_0x9704('0x25')]=_0x4e24d5;if(_0x236392[_0x9704('0x39')][_0x9704('0x47')]){_0x82c005[_0x9704('0x48')]=[{'all':!![]}];}return db['Pause'][_0x9704('0x49')](_0x82c005);})['then'](function(_0x159020){_0x4347f9[_0x9704('0x4a')]=_0x159020;return _0x4347f9;})[_0x9704('0x2e')](respondWithFilteredResult(_0x35c634,_0x82c005))[_0x9704('0x4b')](handleError(_0x35c634,null));};exports[_0x9704('0x4c')]=function(_0x4612ac,_0x35948b){var _0x1043e4={'raw':!![],'where':{'id':_0x4612ac[_0x9704('0x4d')]['id']}},_0x5c30c8={};_0x5c30c8[_0x9704('0x37')]=_[_0x9704('0x38')](db[_0x9704('0x34')][_0x9704('0x35')]);_0x5c30c8[_0x9704('0x39')]=_[_0x9704('0x38')](_0x4612ac[_0x9704('0x39')]);_0x5c30c8['filters']=_[_0x9704('0x3b')](_0x5c30c8[_0x9704('0x37')],_0x5c30c8['query']);_0x1043e4[_0x9704('0x3c')]=_[_0x9704('0x3b')](_0x5c30c8['model'],qs[_0x9704('0x4e')](_0x4612ac[_0x9704('0x39')]['fields']));_0x1043e4[_0x9704('0x3c')]=_0x1043e4[_0x9704('0x3c')][_0x9704('0x3d')]?_0x1043e4[_0x9704('0x3c')]:_0x5c30c8[_0x9704('0x37')];if(_0x4612ac[_0x9704('0x39')][_0x9704('0x47')]){_0x1043e4[_0x9704('0x48')]=[{'all':!![]}];}_0x1043e4=_['merge']({},_0x1043e4,_0x4612ac[_0x9704('0x46')]);return db[_0x9704('0x34')][_0x9704('0x4f')](_0x1043e4)[_0x9704('0x2e')](handleEntityNotFound(_0x35948b,null))[_0x9704('0x2e')](respondWithResult(_0x35948b,null))[_0x9704('0x4b')](handleError(_0x35948b,null));};exports[_0x9704('0x50')]=function(_0x3cf7d3,_0x7a07a0){return db['Pause']['create'](_0x3cf7d3[_0x9704('0x51')],{})[_0x9704('0x2e')](function(_0x1fb8cc){var _0x9d0bc=_0x3cf7d3[_0x9704('0x52')][_0x9704('0x2c')]({'plain':!![]});if(!_0x9d0bc)throw new Error(_0x9704('0x53'));if(_0x9d0bc[_0x9704('0x54')]==='user'){var _0x13505c=_0x1fb8cc['get']({'plain':!![]});var _0x537298=_0x9704('0x2d');return db[_0x9704('0x55')]['find']({'where':{'name':_0x537298,'userProfileId':_0x9d0bc[_0x9704('0x56')]},'raw':!![]})[_0x9704('0x2e')](function(_0x3b5d5c){if(_0x3b5d5c&&_0x3b5d5c[_0x9704('0x57')]===0x0){return db[_0x9704('0x58')][_0x9704('0x50')]({'name':_0x13505c[_0x9704('0x31')],'resourceId':_0x13505c['id'],'type':_0x3b5d5c[_0x9704('0x31')],'sectionId':_0x3b5d5c['id']},{})[_0x9704('0x2e')](function(){return _0x1fb8cc;});}else{return _0x1fb8cc;}})[_0x9704('0x4b')](function(_0x228779){logger[_0x9704('0x59')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x228779);throw _0x228779;});}return _0x1fb8cc;})[_0x9704('0x2e')](respondWithResult(_0x7a07a0,0xc9))[_0x9704('0x4b')](handleError(_0x7a07a0,null));};exports[_0x9704('0x2a')]=function(_0x1171f8,_0x559d39){if(_0x1171f8[_0x9704('0x51')]['id']){delete _0x1171f8['body']['id'];}return db['Pause'][_0x9704('0x4f')]({'where':{'id':_0x1171f8[_0x9704('0x4d')]['id']}})[_0x9704('0x2e')](handleEntityNotFound(_0x559d39,null))[_0x9704('0x2e')](saveUpdates(_0x1171f8[_0x9704('0x51')],null))[_0x9704('0x2e')](respondWithResult(_0x559d39,null))['catch'](handleError(_0x559d39,null));};exports[_0x9704('0x2b')]=function(_0x5f4fa2,_0x56be80){return db['Pause']['find']({'where':{'id':_0x5f4fa2[_0x9704('0x4d')]['id']}})[_0x9704('0x2e')](handleEntityNotFound(_0x56be80,null))[_0x9704('0x2e')](removeEntity(_0x56be80,null))[_0x9704('0x4b')](handleError(_0x56be80,null));};
\ No newline at end of file
+var _0x535a=['json','offset','undefined','count','set','Content-Range','apply','reject','save','then','get','Pauses','UserProfileResource','destroy','error','stack','name','send','index','Pause','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','update','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x535a,0xe0));var _0xa535=function(_0x1747e0,_0x42d2fc){_0x1747e0=_0x1747e0-0x0;var _0x4b163c=_0x535a[_0x1747e0];return _0x4b163c;};'use strict';var emlformat=require(_0xa535('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa535('0x1'));var jsonpatch=require(_0xa535('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa535('0x3'));var Mustache=require(_0xa535('0x4'));var util=require(_0xa535('0x5'));var path=require(_0xa535('0x6'));var sox=require(_0xa535('0x7'));var csv=require(_0xa535('0x8'));var ejs=require(_0xa535('0x9'));var fs=require('fs');var fs_extra=require(_0xa535('0xa'));var _=require(_0xa535('0xb'));var squel=require(_0xa535('0xc'));var crypto=require(_0xa535('0xd'));var jsforce=require(_0xa535('0xe'));var deskjs=require(_0xa535('0xf'));var toCsv=require(_0xa535('0x8'));var querystring=require('querystring');var Papa=require(_0xa535('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa535('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa535('0x12'));var utils=require('../../config/utils');var config=require(_0xa535('0x13'));var licenseUtil=require(_0xa535('0x14'));var db=require(_0xa535('0x15'))['db'];function respondWithStatusCode(_0x4c5baf,_0x3e5c36){_0x3e5c36=_0x3e5c36||0xcc;return function(_0x16d34c){if(_0x16d34c){return _0x4c5baf[_0xa535('0x16')](_0x3e5c36);}return _0x4c5baf['status'](_0x3e5c36)[_0xa535('0x17')]();};}function respondWithResult(_0x127201,_0x1d15ca){_0x1d15ca=_0x1d15ca||0xc8;return function(_0x1e3c7f){if(_0x1e3c7f){return _0x127201[_0xa535('0x18')](_0x1d15ca)[_0xa535('0x19')](_0x1e3c7f);}};}function respondWithFilteredResult(_0x2444e8,_0x5596de){return function(_0x38d9ae){if(_0x38d9ae){var _0x447fbf=typeof _0x5596de[_0xa535('0x1a')]===_0xa535('0x1b')&&typeof _0x5596de['limit']===_0xa535('0x1b');var _0xdf3561=_0x38d9ae[_0xa535('0x1c')];var _0x1d18e0=_0x447fbf?0x0:_0x5596de[_0xa535('0x1a')];var _0x301331=_0x447fbf?_0x38d9ae[_0xa535('0x1c')]:_0x5596de[_0xa535('0x1a')]+_0x5596de['limit'];var _0x5a4f3b;if(_0x301331>=_0xdf3561){_0x301331=_0xdf3561;_0x5a4f3b=0xc8;}else{_0x5a4f3b=0xce;}_0x2444e8[_0xa535('0x18')](_0x5a4f3b);return _0x2444e8[_0xa535('0x1d')](_0xa535('0x1e'),_0x1d18e0+'-'+_0x301331+'/'+_0xdf3561)[_0xa535('0x19')](_0x38d9ae);}return null;};}function patchUpdates(_0x538942){return function(_0x58604b){try{jsonpatch[_0xa535('0x1f')](_0x58604b,_0x538942,!![]);}catch(_0x42af20){return BPromise[_0xa535('0x20')](_0x42af20);}return _0x58604b[_0xa535('0x21')]();};}function saveUpdates(_0x244f33,_0x479888){return function(_0x410a90){if(_0x410a90){return _0x410a90['update'](_0x244f33)[_0xa535('0x22')](function(_0x189018){return _0x189018;});}return null;};}function removeEntity(_0x563924,_0x362a53){return function(_0x3556de){if(_0x3556de){return _0x3556de['destroy']()[_0xa535('0x22')](function(){var _0x260263=_0x3556de[_0xa535('0x23')]({'plain':!![]});var _0x3ed505=_0xa535('0x24');return db[_0xa535('0x25')][_0xa535('0x26')]({'where':{'type':_0x3ed505,'resourceId':_0x260263['id']}})['then'](function(){return _0x3556de;});})[_0xa535('0x22')](function(){_0x563924[_0xa535('0x18')](0xcc)[_0xa535('0x17')]();});}};}function handleEntityNotFound(_0x5c419d,_0x4ad530){return function(_0x293c89){if(!_0x293c89){_0x5c419d[_0xa535('0x16')](0x194);}return _0x293c89;};}function handleError(_0x44ca94,_0x2b14cc){_0x2b14cc=_0x2b14cc||0x1f4;return function(_0x17a3cd){logger[_0xa535('0x27')](_0x17a3cd[_0xa535('0x28')]);if(_0x17a3cd[_0xa535('0x29')]){delete _0x17a3cd[_0xa535('0x29')];}_0x44ca94['status'](_0x2b14cc)[_0xa535('0x2a')](_0x17a3cd);};}exports[_0xa535('0x2b')]=function(_0x14bbcc,_0xcb4cc9){var _0x5ca46b={},_0x5ba306={},_0x4f44f2={'count':0x0,'rows':[]};var _0x57f920=_['map'](db[_0xa535('0x2c')][_0xa535('0x2d')],function(_0xe32de4){return{'name':_0xe32de4[_0xa535('0x2e')],'type':_0xe32de4['type'][_0xa535('0x2f')]};});_0x5ba306[_0xa535('0x30')]=_[_0xa535('0x31')](_0x57f920,_0xa535('0x29'));_0x5ba306[_0xa535('0x32')]=_[_0xa535('0x33')](_0x14bbcc[_0xa535('0x32')]);_0x5ba306[_0xa535('0x34')]=_[_0xa535('0x35')](_0x5ba306[_0xa535('0x30')],_0x5ba306[_0xa535('0x32')]);_0x5ca46b['attributes']=_[_0xa535('0x35')](_0x5ba306[_0xa535('0x30')],qs[_0xa535('0x36')](_0x14bbcc['query'][_0xa535('0x36')]));_0x5ca46b['attributes']=_0x5ca46b[_0xa535('0x37')][_0xa535('0x38')]?_0x5ca46b[_0xa535('0x37')]:_0x5ba306['model'];if(!_0x14bbcc[_0xa535('0x32')][_0xa535('0x39')]('nolimit')){_0x5ca46b[_0xa535('0x3a')]=qs[_0xa535('0x3a')](_0x14bbcc['query']['limit']);_0x5ca46b[_0xa535('0x1a')]=qs[_0xa535('0x1a')](_0x14bbcc['query'][_0xa535('0x1a')]);}_0x5ca46b[_0xa535('0x3b')]=qs[_0xa535('0x3c')](_0x14bbcc[_0xa535('0x32')][_0xa535('0x3c')]);_0x5ca46b[_0xa535('0x3d')]=qs[_0xa535('0x34')](_[_0xa535('0x3e')](_0x14bbcc['query'],_0x5ba306[_0xa535('0x34')]),_0x57f920);if(_0x14bbcc['query'][_0xa535('0x3f')]){_0x5ca46b['where']=_['merge'](_0x5ca46b[_0xa535('0x3d')],{'$or':_[_0xa535('0x31')](_0x57f920,function(_0x106894){if(_0x106894['type']!==_0xa535('0x40')){var _0x50ae40={};_0x50ae40[_0x106894[_0xa535('0x29')]]={'$like':'%'+_0x14bbcc[_0xa535('0x32')][_0xa535('0x3f')]+'%'};return _0x50ae40;}})});}_0x5ca46b=_[_0xa535('0x41')]({},_0x5ca46b,_0x14bbcc['options']);var _0x20f841={'where':_0x5ca46b[_0xa535('0x3d')]};return db[_0xa535('0x2c')]['count'](_0x20f841)['then'](function(_0x57045b){_0x4f44f2[_0xa535('0x1c')]=_0x57045b;if(_0x14bbcc[_0xa535('0x32')][_0xa535('0x42')]){_0x5ca46b['include']=[{'all':!![]}];}return db[_0xa535('0x2c')][_0xa535('0x43')](_0x5ca46b);})['then'](function(_0x294c57){_0x4f44f2[_0xa535('0x44')]=_0x294c57;return _0x4f44f2;})[_0xa535('0x22')](respondWithFilteredResult(_0xcb4cc9,_0x5ca46b))[_0xa535('0x45')](handleError(_0xcb4cc9,null));};exports[_0xa535('0x46')]=function(_0x3b7700,_0x5a9594){var _0x446f6f={'raw':!![],'where':{'id':_0x3b7700[_0xa535('0x47')]['id']}},_0x1cf5a9={};_0x1cf5a9['model']=_[_0xa535('0x33')](db[_0xa535('0x2c')][_0xa535('0x2d')]);_0x1cf5a9[_0xa535('0x32')]=_[_0xa535('0x33')](_0x3b7700[_0xa535('0x32')]);_0x1cf5a9[_0xa535('0x34')]=_[_0xa535('0x35')](_0x1cf5a9[_0xa535('0x30')],_0x1cf5a9[_0xa535('0x32')]);_0x446f6f[_0xa535('0x37')]=_['intersection'](_0x1cf5a9['model'],qs['fields'](_0x3b7700[_0xa535('0x32')][_0xa535('0x36')]));_0x446f6f[_0xa535('0x37')]=_0x446f6f[_0xa535('0x37')][_0xa535('0x38')]?_0x446f6f[_0xa535('0x37')]:_0x1cf5a9['model'];if(_0x3b7700['query'][_0xa535('0x42')]){_0x446f6f['include']=[{'all':!![]}];}_0x446f6f=_['merge']({},_0x446f6f,_0x3b7700[_0xa535('0x48')]);return db[_0xa535('0x2c')]['find'](_0x446f6f)[_0xa535('0x22')](handleEntityNotFound(_0x5a9594,null))['then'](respondWithResult(_0x5a9594,null))[_0xa535('0x45')](handleError(_0x5a9594,null));};exports[_0xa535('0x49')]=function(_0x34530b,_0x2a6ac6){return db[_0xa535('0x2c')][_0xa535('0x49')](_0x34530b[_0xa535('0x4a')],{})[_0xa535('0x22')](function(_0x139c86){var _0x4ce2e3=_0x34530b[_0xa535('0x4b')]['get']({'plain':!![]});if(!_0x4ce2e3)throw new Error(_0xa535('0x4c'));if(_0x4ce2e3[_0xa535('0x4d')]===_0xa535('0x4b')){var _0x185a39=_0x139c86['get']({'plain':!![]});var _0x196cf8=_0xa535('0x24');return db[_0xa535('0x4e')][_0xa535('0x4f')]({'where':{'name':_0x196cf8,'userProfileId':_0x4ce2e3[_0xa535('0x50')]},'raw':!![]})[_0xa535('0x22')](function(_0x360226){if(_0x360226&&_0x360226[_0xa535('0x51')]===0x0){return db['UserProfileResource']['create']({'name':_0x185a39[_0xa535('0x29')],'resourceId':_0x185a39['id'],'type':_0x360226[_0xa535('0x29')],'sectionId':_0x360226['id']},{})['then'](function(){return _0x139c86;});}else{return _0x139c86;}})[_0xa535('0x45')](function(_0x28b54f){logger[_0xa535('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28b54f);throw _0x28b54f;});}return _0x139c86;})[_0xa535('0x22')](respondWithResult(_0x2a6ac6,0xc9))['catch'](handleError(_0x2a6ac6,null));};exports[_0xa535('0x52')]=function(_0x39cc0c,_0x35345c){if(_0x39cc0c['body']['id']){delete _0x39cc0c[_0xa535('0x4a')]['id'];}return db[_0xa535('0x2c')][_0xa535('0x4f')]({'where':{'id':_0x39cc0c['params']['id']}})[_0xa535('0x22')](handleEntityNotFound(_0x35345c,null))['then'](saveUpdates(_0x39cc0c['body'],null))['then'](respondWithResult(_0x35345c,null))[_0xa535('0x45')](handleError(_0x35345c,null));};exports['destroy']=function(_0x1ccf46,_0x4b48d4){return db[_0xa535('0x2c')][_0xa535('0x4f')]({'where':{'id':_0x1ccf46[_0xa535('0x47')]['id']}})[_0xa535('0x22')](handleEntityNotFound(_0x4b48d4,null))[_0xa535('0x22')](removeEntity(_0x4b48d4,null))[_0xa535('0x45')](handleError(_0x4b48d4,null));};
\ No newline at end of file
index 11e0300..0b52372 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x814b=['define','Pause','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./pause.attributes','exports'];(function(_0x307877,_0x54ff05){var _0x4bcc90=function(_0x2b86c6){while(--_0x2b86c6){_0x307877['push'](_0x307877['shift']());}};_0x4bcc90(++_0x54ff05);}(_0x814b,0x1a2));var _0xb814=function(_0xb8cfbe,_0x2e81b6){_0xb8cfbe=_0xb8cfbe-0x0;var _0x227d51=_0x814b[_0xb8cfbe];return _0x227d51;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x55ca=['./pause.attributes','exports','define','tools_pauses','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4a7843,_0x24f6d1){var _0x2c57fe=function(_0x37fbc9){while(--_0x37fbc9){_0x4a7843['push'](_0x4a7843['shift']());}};_0x2c57fe(++_0x24f6d1);}(_0x55ca,0x126));var _0xa55c=function(_0x60878f,_0x1166d3){_0x60878f=_0x60878f-0x0;var _0x1fbefb=_0x55ca[_0x60878f];return _0x1fbefb;};'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')]('Pause',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 2f428ff..e681fda 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(_0x14b412,_0x18a129){var _0x1c1352=function(_0x24b680){while(--_0x24b680){_0x14b412['push'](_0x14b412['shift']());}};_0x1c1352(++_0x18a129);}(_0xb10b,0x12a));var _0xbb10=function(_0x1786e0,_0x19dc8c){_0x1786e0=_0x1786e0-0x0;var _0x4a6229=_0xb10b[_0x1786e0];return _0x4a6229;};'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(_0x3fced0,_0x163a81){var _0x5742e8=function(_0x3ed8e7){while(--_0x3ed8e7){_0x3fced0['push'](_0x3fced0['shift']());}};_0x5742e8(++_0x163a81);}(_0xb10b,0x12a));var _0xbb10=function(_0xffd1b5,_0x1ede18){_0xffd1b5=_0xffd1b5-0x0;var _0x3176d6=_0xb10b[_0xffd1b5];return _0x3176d6;};'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 cc950c4..e4a9506 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac9d=['put','update','delete','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/webhook','webhookGet','/:id','show','/:id/download','download','diskStorage','root','server/files/plugins','originalname','replace','format','%s-%s%s','extname','post','single','file','upload'];(function(_0x4017b0,_0x4347db){var _0x5ed4f7=function(_0x706c26){while(--_0x706c26){_0x4017b0['push'](_0x4017b0['shift']());}};_0x5ed4f7(++_0x4347db);}(_0xac9d,0x14d));var _0xdac9=function(_0x2f965f,_0x100aca){_0x2f965f=_0x2f965f-0x0;var _0x73f2b9=_0xac9d[_0x2f965f];return _0x73f2b9;};'use strict';var multer=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var path=require(_0xdac9('0x2'));var timeout=require(_0xdac9('0x3'));var express=require(_0xdac9('0x4'));var router=express[_0xdac9('0x5')]();var fs_extra=require(_0xdac9('0x6'));var auth=require(_0xdac9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdac9('0x8'));var controller=require('./plugin.controller');router[_0xdac9('0x9')]('/',auth[_0xdac9('0xa')](),controller[_0xdac9('0xb')]);router[_0xdac9('0x9')](_0xdac9('0xc'),controller[_0xdac9('0xd')]);router['get'](_0xdac9('0xe'),auth['isAuthenticated'](),controller[_0xdac9('0xf')]);router[_0xdac9('0x9')](_0xdac9('0x10'),auth[_0xdac9('0xa')](),controller[_0xdac9('0x11')]);var upload=multer({'storage':multer[_0xdac9('0x12')]({'destination':function(_0x255627,_0x1b604a,_0xbb5615){_0xbb5615(null,path['join'](config[_0xdac9('0x13')],_0xdac9('0x14')));},'filename':function(_0x5a9bde,_0x3d8e97,_0xeddbc1){_0x3d8e97[_0xdac9('0x15')]=_0x3d8e97['originalname'][_0xdac9('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xeddbc1(null,util[_0xdac9('0x17')](_0xdac9('0x18'),path['basename'](_0x3d8e97['originalname'],path[_0xdac9('0x19')](_0x3d8e97[_0xdac9('0x15')])),Date['now'](),path[_0xdac9('0x19')](_0x3d8e97[_0xdac9('0x15')])));}})});router[_0xdac9('0x1a')]('/',upload[_0xdac9('0x1b')](_0xdac9('0x1c')),controller[_0xdac9('0x1d')]);router[_0xdac9('0x1a')](_0xdac9('0xc'),controller['webhookPost']);router[_0xdac9('0x1e')](_0xdac9('0xe'),auth['isAuthenticated'](),controller[_0xdac9('0x1f')]);router[_0xdac9('0x20')](_0xdac9('0xe'),auth[_0xdac9('0xa')](),controller['delete']);module['exports']=router;
\ No newline at end of file
+var _0x5c12=['util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','isAuthenticated','index','get','/:id','show','download','diskStorage','join','root','originalname','basename','extname','now','upload','post','put','update','delete','exports'];(function(_0x5185b3,_0x4c3c27){var _0xd9c050=function(_0x2a5d54){while(--_0x2a5d54){_0x5185b3['push'](_0x5185b3['shift']());}};_0xd9c050(++_0x4c3c27);}(_0x5c12,0x188));var _0x25c1=function(_0x2e8418,_0x58c529){_0x2e8418=_0x2e8418-0x0;var _0x548fe6=_0x5c12[_0x2e8418];return _0x548fe6;};'use strict';var multer=require('multer');var util=require(_0x25c1('0x0'));var path=require(_0x25c1('0x1'));var timeout=require('connect-timeout');var express=require(_0x25c1('0x2'));var router=express[_0x25c1('0x3')]();var fs_extra=require(_0x25c1('0x4'));var auth=require(_0x25c1('0x5'));var interaction=require(_0x25c1('0x6'));var config=require(_0x25c1('0x7'));var controller=require(_0x25c1('0x8'));router['get']('/',auth[_0x25c1('0x9')](),controller[_0x25c1('0xa')]);router[_0x25c1('0xb')]('/webhook',controller['webhookGet']);router[_0x25c1('0xb')](_0x25c1('0xc'),auth[_0x25c1('0x9')](),controller[_0x25c1('0xd')]);router[_0x25c1('0xb')]('/:id/download',auth[_0x25c1('0x9')](),controller[_0x25c1('0xe')]);var upload=multer({'storage':multer[_0x25c1('0xf')]({'destination':function(_0x81f0f4,_0x2872b2,_0x5e44e2){_0x5e44e2(null,path[_0x25c1('0x10')](config[_0x25c1('0x11')],'server/files/plugins'));},'filename':function(_0x256ecd,_0x209af5,_0x323d3c){_0x209af5[_0x25c1('0x12')]=_0x209af5['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x323d3c(null,util['format']('%s-%s%s',path[_0x25c1('0x13')](_0x209af5[_0x25c1('0x12')],path[_0x25c1('0x14')](_0x209af5[_0x25c1('0x12')])),Date[_0x25c1('0x15')](),path['extname'](_0x209af5[_0x25c1('0x12')])));}})});router['post']('/',upload['single']('file'),controller[_0x25c1('0x16')]);router[_0x25c1('0x17')]('/webhook',controller['webhookPost']);router[_0x25c1('0x18')]('/:id',auth[_0x25c1('0x9')](),controller[_0x25c1('0x19')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x25c1('0x1a')]);module[_0x25c1('0x1b')]=router;
\ No newline at end of file
index 6128dff..49ce08d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3aff=['TEXT','STRING','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','agentOnly','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','html'];(function(_0x4d8728,_0x541ab7){var _0x5d81aa=function(_0x586257){while(--_0x586257){_0x4d8728['push'](_0x4d8728['shift']());}};_0x5d81aa(++_0x541ab7);}(_0x3aff,0x148));var _0xf3af=function(_0x18b5c2,_0x1a7f3f){_0x18b5c2=_0x18b5c2-0x0;var _0x3ffdbd=_0x3aff[_0x18b5c2];return _0x3ffdbd;};'use strict';var Sequelize=require(_0xf3af('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0xf3af('0x1'),'script')},'description':{'type':Sequelize[_0xf3af('0x2')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0xf3af('0x3')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0xf3af('0x4')],'defaultValue':0x0,'comment':_0xf3af('0x5')},'sidebar':{'type':Sequelize[_0xf3af('0x6')](_0xf3af('0x7'),_0xf3af('0x8'),'always',_0xf3af('0x9')),'defaultValue':'always','comment':_0xf3af('0xa')},'icon':{'type':Sequelize[_0xf3af('0x3')]},'adminUrl':{'type':Sequelize[_0xf3af('0x3')]},'agentUrl':{'type':Sequelize[_0xf3af('0x3')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0xf3af('0x3')]}};
\ No newline at end of file
+var _0x359b=['script','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','always','never','exports','ENUM'];(function(_0x4f97dd,_0x29fb8e){var _0x26395e=function(_0x567c69){while(--_0x567c69){_0x4f97dd['push'](_0x4f97dd['shift']());}};_0x26395e(++_0x29fb8e);}(_0x359b,0x77));var _0xb359=function(_0x464425,_0x2f7ac2){_0x464425=_0x464425-0x0;var _0x4006c8=_0x359b[_0x464425];return _0x4006c8;};'use strict';var Sequelize=require('sequelize');module[_0xb359('0x0')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb359('0x1')]('html',_0xb359('0x2'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0xb359('0x3')]},'path':{'type':Sequelize[_0xb359('0x4')],'comment':_0xb359('0x5')},'active':{'type':Sequelize[_0xb359('0x6')],'defaultValue':0x0,'comment':_0xb359('0x7')},'sidebar':{'type':Sequelize['ENUM'](_0xb359('0x8'),'agentOnly',_0xb359('0x9'),_0xb359('0xa')),'defaultValue':_0xb359('0x9'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0xb359('0x4')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0xb359('0x4')]},'scriptName':{'type':Sequelize[_0xb359('0x4')]},'scriptPath':{'type':Sequelize[_0xb359('0x4')]}};
\ No newline at end of file
index 3a2eccb..295b433 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x678f=['Invalid\x20plugin\x20structure','isFile','isDirectory','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','type','html','Invalid\x20manifest:\x20views\x20missing','views','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptPath','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Extracted\x20folder\x20removed','update','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','%s%s','headers','content-length','content-type','endsWith','statusCode','method','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./plugin.socket','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','save','then','destroy','Plugins','end','error','name','send','index','map','Plugin','rawAttributes','key','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','model','keys','includeAll','find','download','path','join','root','server/files/plugins','format','%s.zip','basename','zip','warning','ENOENT','Sequelize','Error','pipe','glob','dirname','node_modules/**/*','attachments/**/*','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','readdirSync'];(function(_0x27862e,_0xb096be){var _0x413eed=function(_0x1b884e){while(--_0x1b884e){_0x27862e['push'](_0x27862e['shift']());}};_0x413eed(++_0xb096be);}(_0x678f,0x181));var _0xf678=function(_0x33c1b1,_0x2355fb){_0x33c1b1=_0x33c1b1-0x0;var _0x2c2037=_0x678f[_0x33c1b1];return _0x2c2037;};'use strict';var emlformat=require(_0xf678('0x0'));var rimraf=require(_0xf678('0x1'));var zipdir=require(_0xf678('0x2'));var jsonpatch=require(_0xf678('0x3'));var rp=require('request-promise');var moment=require(_0xf678('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf678('0x5'));var util=require(_0xf678('0x6'));var path=require('path');var sox=require(_0xf678('0x7'));var csv=require(_0xf678('0x8'));var ejs=require(_0xf678('0x9'));var fs=require('fs');var fs_extra=require(_0xf678('0xa'));var _=require(_0xf678('0xb'));var squel=require('squel');var crypto=require(_0xf678('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf678('0xd'));var toCsv=require(_0xf678('0x8'));var querystring=require(_0xf678('0xe'));var Papa=require('papaparse');var extract=require('extract-zip');var rimraf=require(_0xf678('0x1'));var archiver=require('archiver');var Redis=require(_0xf678('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf678('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf678('0x11'));var logger=require(_0xf678('0x12'))(_0xf678('0x13'));var utils=require(_0xf678('0x14'));var config=require(_0xf678('0x15'));var licenseUtil=require(_0xf678('0x16'));var db=require(_0xf678('0x17'))['db'];config[_0xf678('0x18')]=_[_0xf678('0x19')](config[_0xf678('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xf678('0x1a'))(new Redis(config[_0xf678('0x18')]));require(_0xf678('0x1b'))['register'](socket);function respondWithStatusCode(_0x5a553e,_0x3350f7){_0x3350f7=_0x3350f7||0xcc;return function(_0x58da78){if(_0x58da78){return _0x5a553e[_0xf678('0x1c')](_0x3350f7);}return _0x5a553e[_0xf678('0x1d')](_0x3350f7)['end']();};}function respondWithResult(_0x3801be,_0x8b0f64){_0x8b0f64=_0x8b0f64||0xc8;return function(_0x61652d){if(_0x61652d){return _0x3801be[_0xf678('0x1d')](_0x8b0f64)[_0xf678('0x1e')](_0x61652d);}};}function respondWithFilteredResult(_0x27ece7,_0x198308){return function(_0x520f4b){if(_0x520f4b){var _0x5f1195=typeof _0x198308[_0xf678('0x1f')]==='undefined'&&typeof _0x198308[_0xf678('0x20')]===_0xf678('0x21');var _0x15d540=_0x520f4b[_0xf678('0x22')];var _0x3c655d=_0x5f1195?0x0:_0x198308[_0xf678('0x1f')];var _0x51d249=_0x5f1195?_0x520f4b[_0xf678('0x22')]:_0x198308[_0xf678('0x1f')]+_0x198308['limit'];var _0x57dc9c;if(_0x51d249>=_0x15d540){_0x51d249=_0x15d540;_0x57dc9c=0xc8;}else{_0x57dc9c=0xce;}_0x27ece7[_0xf678('0x1d')](_0x57dc9c);return _0x27ece7[_0xf678('0x23')](_0xf678('0x24'),_0x3c655d+'-'+_0x51d249+'/'+_0x15d540)[_0xf678('0x1e')](_0x520f4b);}return null;};}function patchUpdates(_0x32880f){return function(_0x3464a6){try{jsonpatch['apply'](_0x3464a6,_0x32880f,!![]);}catch(_0x5d66e1){return BPromise['reject'](_0x5d66e1);}return _0x3464a6[_0xf678('0x25')]();};}function saveUpdates(_0x58fbd2,_0x5c1330){return function(_0x77a13f){if(_0x77a13f){return _0x77a13f['update'](_0x58fbd2)[_0xf678('0x26')](function(_0x35c072){return _0x35c072;});}return null;};}function removeEntity(_0x56f569,_0x5e6892){return function(_0x2b6e2d){if(_0x2b6e2d){return _0x2b6e2d[_0xf678('0x27')]()['then'](function(){var _0x5f264a=_0x2b6e2d['get']({'plain':!![]});var _0x2abc13=_0xf678('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x2abc13,'resourceId':_0x5f264a['id']}})[_0xf678('0x26')](function(){return _0x2b6e2d;});})['then'](function(){_0x56f569[_0xf678('0x1d')](0xcc)[_0xf678('0x29')]();});}};}function handleEntityNotFound(_0x5738ea,_0x223174){return function(_0x510dd1){if(!_0x510dd1){_0x5738ea['sendStatus'](0x194);}return _0x510dd1;};}function handleError(_0x252a50,_0x5c0cb1){_0x5c0cb1=_0x5c0cb1||0x1f4;return function(_0x3ac800){logger[_0xf678('0x2a')](_0x3ac800['stack']);if(_0x3ac800['name']){delete _0x3ac800[_0xf678('0x2b')];}_0x252a50[_0xf678('0x1d')](_0x5c0cb1)[_0xf678('0x2c')](_0x3ac800);};}exports[_0xf678('0x2d')]=function(_0x1a2f1d,_0x240ce6){var _0x598458={},_0x2b4928={},_0x39d22e={'count':0x0,'rows':[]};var _0x16127f=_[_0xf678('0x2e')](db[_0xf678('0x2f')][_0xf678('0x30')],function(_0x5876a9){return{'name':_0x5876a9['fieldName'],'type':_0x5876a9['type'][_0xf678('0x31')]};});_0x2b4928['model']=_[_0xf678('0x2e')](_0x16127f,'name');_0x2b4928[_0xf678('0x32')]=_['keys'](_0x1a2f1d[_0xf678('0x32')]);_0x2b4928[_0xf678('0x33')]=_['intersection'](_0x2b4928['model'],_0x2b4928[_0xf678('0x32')]);_0x598458[_0xf678('0x34')]=_[_0xf678('0x35')](_0x2b4928['model'],qs[_0xf678('0x36')](_0x1a2f1d[_0xf678('0x32')][_0xf678('0x36')]));_0x598458['attributes']=_0x598458[_0xf678('0x34')][_0xf678('0x37')]?_0x598458['attributes']:_0x2b4928['model'];if(!_0x1a2f1d['query'][_0xf678('0x38')](_0xf678('0x39'))){_0x598458[_0xf678('0x20')]=qs[_0xf678('0x20')](_0x1a2f1d[_0xf678('0x32')]['limit']);_0x598458['offset']=qs[_0xf678('0x1f')](_0x1a2f1d['query']['offset']);}_0x598458[_0xf678('0x3a')]=qs['sort'](_0x1a2f1d[_0xf678('0x32')]['sort']);_0x598458[_0xf678('0x3b')]=qs[_0xf678('0x33')](_[_0xf678('0x3c')](_0x1a2f1d[_0xf678('0x32')],_0x2b4928['filters']),_0x16127f);if(_0x1a2f1d[_0xf678('0x32')][_0xf678('0x3d')]){_0x598458[_0xf678('0x3b')]=_[_0xf678('0x3e')](_0x598458[_0xf678('0x3b')],{'$or':_[_0xf678('0x2e')](_0x16127f,function(_0x12b7be){if(_0x12b7be['type']!=='VIRTUAL'){var _0x5a32ec={};_0x5a32ec[_0x12b7be[_0xf678('0x2b')]]={'$like':'%'+_0x1a2f1d['query']['filter']+'%'};return _0x5a32ec;}})});}_0x598458=_[_0xf678('0x3e')]({},_0x598458,_0x1a2f1d[_0xf678('0x3f')]);var _0x31957c={'where':_0x598458[_0xf678('0x3b')]};return db[_0xf678('0x2f')][_0xf678('0x22')](_0x31957c)[_0xf678('0x26')](function(_0x4cc6d5){_0x39d22e['count']=_0x4cc6d5;if(_0x1a2f1d[_0xf678('0x32')]['includeAll']){_0x598458[_0xf678('0x40')]=[{'all':!![]}];}return db[_0xf678('0x2f')][_0xf678('0x41')](_0x598458);})[_0xf678('0x26')](function(_0x506e33){_0x39d22e[_0xf678('0x42')]=_0x506e33;return _0x39d22e;})[_0xf678('0x26')](respondWithFilteredResult(_0x240ce6,_0x598458))[_0xf678('0x43')](handleError(_0x240ce6,null));};exports[_0xf678('0x44')]=function(_0x4edf7b,_0xcb17e8){var _0x343747={'raw':!![],'where':{'id':_0x4edf7b[_0xf678('0x45')]['id']}},_0x4ddc23={};_0x4ddc23[_0xf678('0x46')]=_[_0xf678('0x47')](db[_0xf678('0x2f')]['rawAttributes']);_0x4ddc23[_0xf678('0x32')]=_['keys'](_0x4edf7b[_0xf678('0x32')]);_0x4ddc23[_0xf678('0x33')]=_[_0xf678('0x35')](_0x4ddc23[_0xf678('0x46')],_0x4ddc23[_0xf678('0x32')]);_0x343747[_0xf678('0x34')]=_[_0xf678('0x35')](_0x4ddc23['model'],qs[_0xf678('0x36')](_0x4edf7b[_0xf678('0x32')]['fields']));_0x343747[_0xf678('0x34')]=_0x343747['attributes'][_0xf678('0x37')]?_0x343747[_0xf678('0x34')]:_0x4ddc23[_0xf678('0x46')];if(_0x4edf7b[_0xf678('0x32')][_0xf678('0x48')]){_0x343747['include']=[{'all':!![]}];}_0x343747=_[_0xf678('0x3e')]({},_0x343747,_0x4edf7b[_0xf678('0x3f')]);return db[_0xf678('0x2f')][_0xf678('0x49')](_0x343747)[_0xf678('0x26')](handleEntityNotFound(_0xcb17e8,null))['then'](respondWithResult(_0xcb17e8,null))[_0xf678('0x43')](handleError(_0xcb17e8,null));};exports[_0xf678('0x4a')]=function(_0x2878f7,_0x561d43,_0x52e1e3){return db[_0xf678('0x2f')]['find']({'where':{'id':_0x2878f7[_0xf678('0x45')]['id']},'attributes':[_0xf678('0x2b'),_0xf678('0x4b')],'raw':!![]})[_0xf678('0x26')](handleEntityNotFound(_0x561d43,null))[_0xf678('0x26')](function(_0x49c4ff){if(_0x49c4ff){var _0x119947=path[_0xf678('0x4c')](config[_0xf678('0x4d')],_0xf678('0x4e'),util[_0xf678('0x4f')](_0xf678('0x50'),path[_0xf678('0x51')](_0x49c4ff[_0xf678('0x4b')])));var _0x129cb1=fs['createWriteStream'](_0x119947);var _0x58b597=archiver(_0xf678('0x52'),{'zlib':{'level':0x9}});_0x58b597['on'](_0xf678('0x53'),function(_0x48fd9a){if(_0x48fd9a['code']===_0xf678('0x54')){logger['error'](_0x48fd9a);}else{throw new db[(_0xf678('0x55'))][(_0xf678('0x56'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x58b597['on']('error',function(_0x2aba65){throw new db[(_0xf678('0x55'))][(_0xf678('0x56'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x58b597[_0xf678('0x57')](_0x129cb1);_0x58b597[_0xf678('0x58')]('**/*',{'cwd':path[_0xf678('0x4c')](config[_0xf678('0x4d')],_0xf678('0x4e'),path[_0xf678('0x59')](_0x49c4ff[_0xf678('0x4b')])),'ignore':[path[_0xf678('0x4c')](path['basename'](_0x49c4ff[_0xf678('0x4b')]),_0xf678('0x5a')),path[_0xf678('0x4c')](path['basename'](_0x49c4ff[_0xf678('0x4b')]),_0xf678('0x5b'))],'nodir':!![]})['finalize']();_0x129cb1['on']('close',function(){if(!fs['existsSync'](_0x119947)){throw new db['Sequelize'][(_0xf678('0x56'))]('Plugin\x20not\x20found');}return _0x561d43[_0xf678('0x4a')](_0x119947,util['format'](_0xf678('0x50'),path['basename'](_0x49c4ff[_0xf678('0x4b')])),function(_0x3fbfbf){if(_0x3fbfbf){throw new db[(_0xf678('0x55'))][(_0xf678('0x56'))](_0xf678('0x5c'));}fs['unlinkSync'](_0x119947);logger[_0xf678('0x5d')](_0xf678('0x5e'));logger['info'](_0xf678('0x5f'));});});}return null;})[_0xf678('0x43')](handleError(_0x561d43,null));};exports[_0xf678('0x60')]=function(_0x557efc,_0x57d8db,_0x2f940a){var _0x4a0c89=path['basename'](_0x557efc[_0xf678('0x61')][_0xf678('0x62')],path[_0xf678('0x63')](_0x557efc[_0xf678('0x61')][_0xf678('0x62')]));var _0x41d4c7=path[_0xf678('0x4c')](config[_0xf678('0x4d')],_0xf678('0x4e'),_0x557efc[_0xf678('0x61')][_0xf678('0x62')]);var _0x441c58=path[_0xf678('0x4c')](config[_0xf678('0x4d')],_0xf678('0x4e'),_0x4a0c89);logger['info'](_0xf678('0x64'),_0x41d4c7);logger[_0xf678('0x5d')]('Plugin\x20upload\x20destination:\x20%s',_0x441c58);try{fs[_0xf678('0x65')](_0x41d4c7,parseInt(_0xf678('0x66'),0x8));extract(_0x41d4c7,{'dir':_0x441c58},function(_0x534d5d){if(_0x534d5d){logger['error'](_0x534d5d);handleError(_0x534d5d,!![]);};var _0x16162c=fs[_0xf678('0x67')](_0x441c58);if(_0x16162c['length']>0x1){removeReferences(_0x41d4c7,_0x441c58);logger[_0xf678('0x2a')](_0xf678('0x68'));return _0x2f940a(new Error(_0xf678('0x68')));}var _0x34bfdc=fs['lstatSync'](path['join'](_0x441c58,_0x16162c[0x0]));if(_0x34bfdc[_0xf678('0x69')]()){removeReferences(_0x41d4c7,_0x441c58);logger[_0xf678('0x2a')](_0xf678('0x68'));return _0x2f940a(new Error('Invalid\x20plugin\x20structure'));}if(_0x34bfdc[_0xf678('0x6a')]()){var _0x1fa2cb=fs[_0xf678('0x67')](path[_0xf678('0x4c')](_0x441c58,_0x16162c[0x0]));if(_0x1fa2cb[_0xf678('0x37')]===0x0){removeReferences(_0x41d4c7,_0x441c58);logger[_0xf678('0x2a')](_0xf678('0x68'));return _0x2f940a(new Error(_0xf678('0x68')));}var _0x34763c=_0x1fa2cb['some'](function(_0xb09bab){return _0xb09bab==='manifest.json';});if(!_0x34763c){return _0x2f940a(new Error('Plugin\x20manifest\x20missing'));}var _0x4699ec=fs[_0xf678('0x6b')](path[_0xf678('0x4c')](_0x441c58,_0x16162c[0x0],_0xf678('0x6c')));var _0x46f318=JSON[_0xf678('0x6d')](_0x4699ec);if('undefined'==typeof _0x46f318['name']){return _0x2f940a(new Error(_0xf678('0x6e')));}if(_0xf678('0x21')==typeof _0x46f318['type']){return _0x2f940a(new Error(_0xf678('0x6f')));}if('undefined'==typeof _0x46f318[_0xf678('0x70')]){return _0x2f940a(new Error(_0xf678('0x71')));}if(_0xf678('0x21')==typeof _0x46f318[_0xf678('0x72')]){return _0x2f940a(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x46f318[_0xf678('0x73')]===_0xf678('0x74')){if(_0xf678('0x21')==typeof _0x46f318['parameters']['views']){return _0x2f940a(new Error(_0xf678('0x75')));}if('undefined'==typeof _0x46f318['parameters'][_0xf678('0x76')]['admin']&&'undefined'==typeof _0x46f318[_0xf678('0x72')][_0xf678('0x76')][_0xf678('0x77')]){return _0x2f940a(new Error(_0xf678('0x78')));}}else if(_0x46f318[_0xf678('0x73')]==='script'){if(_0xf678('0x21')==typeof _0x46f318[_0xf678('0x72')]['scriptName']){return _0x2f940a(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if('undefined'==typeof _0x46f318['parameters'][_0xf678('0x79')]){return _0x2f940a(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x2f940a(new Error(_0xf678('0x7a')));}var _0x52ec75=_0x46f318[_0xf678('0x2b')];var _0x2e7ec0=_0x46f318[_0xf678('0x7b')];var _0x255010=_0x46f318[_0xf678('0x73')];var _0x3162bb=_0x46f318[_0xf678('0x7c')]?_0x46f318[_0xf678('0x7c')]:_0xf678('0x7d');var _0x46858d=_0x46f318[_0xf678('0x7e')]?_0x46f318['icon']:_0xf678('0x7f');var _0x2c1a21='';var _0x337a78='';var _0x298153='';var _0x277ed7='';var _0x470f61=_0x46f318[_0xf678('0x70')];if(_0x255010===_0xf678('0x74')){if('undefined'!=typeof _0x46f318['parameters'][_0xf678('0x76')][_0xf678('0x80')]){var _0x5b5272=_0x46f318[_0xf678('0x72')][_0xf678('0x76')][_0xf678('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xf678('0x81')](_0x5b5272)){_0x2c1a21=path[_0xf678('0x4c')](_0xf678('0x82'),_0x4a0c89,_0x16162c[0x0],_0x5b5272);}else{_0x2c1a21=_0x5b5272;}}else{logger[_0xf678('0x5d')](_0xf678('0x83'));}if('undefined'!=typeof _0x46f318[_0xf678('0x72')][_0xf678('0x76')][_0xf678('0x77')]){var _0x2545de=_0x46f318['parameters'][_0xf678('0x76')][_0xf678('0x77')];if(!/^(f|ht)tps?:\/\//i[_0xf678('0x81')](_0x2545de)){_0x337a78=path['join'](_0xf678('0x82'),_0x4a0c89,_0x16162c[0x0],_0x2545de);}else{_0x337a78=_0x2545de;}}else{logger[_0xf678('0x5d')](_0xf678('0x84'));}}else if(_0x255010==='script'){_0x298153=_0x46f318[_0xf678('0x72')][_0xf678('0x85')];_0x277ed7=_0x46f318[_0xf678('0x72')][_0xf678('0x79')];if('undefined'!=typeof _0x46f318['parameters'][_0xf678('0x76')]){if('undefined'!=typeof _0x46f318[_0xf678('0x72')]['views'][_0xf678('0x80')]){var _0x5b5272=_0x46f318['parameters'][_0xf678('0x76')][_0xf678('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xf678('0x81')](_0x5b5272)){_0x2c1a21=path[_0xf678('0x4c')](_0xf678('0x82'),_0x4a0c89,_0x16162c[0x0],_0x5b5272);}else{_0x2c1a21=_0x5b5272;}}if('undefined'!=typeof _0x46f318[_0xf678('0x72')]['views'][_0xf678('0x77')]){var _0x2545de=_0x46f318[_0xf678('0x72')]['views'][_0xf678('0x77')];if(!/^(f|ht)tps?:\/\//i[_0xf678('0x81')](_0x2545de)){_0x337a78=path[_0xf678('0x4c')](_0xf678('0x82'),_0x4a0c89,_0x16162c[0x0],_0x2545de);}else{_0x337a78=_0x2545de;}}}}var _0xbdf932={'name':_0x52ec75,'description':_0x2e7ec0,'path':path[_0xf678('0x4c')](_0x4a0c89,_0x16162c[0x0]),'type':_0x255010,'sidebar':_0x3162bb,'icon':_0x46858d,'adminUrl':_0x2c1a21,'agentUrl':_0x337a78,'scriptName':_0x298153,'scriptPath':_0x277ed7,'version':_0x470f61};removeReferences(_0x41d4c7,null);return db['Plugin'][_0xf678('0x86')](_0xbdf932)[_0xf678('0x26')](function(_0x39117e){var _0x14cbca={'role':_0x557efc['body']['role'],'userProfileId':_0x557efc[_0xf678('0x87')][_0xf678('0x88')]};if(!_0x14cbca)throw new Error(_0xf678('0x89'));if(_0x14cbca[_0xf678('0x8a')]===_0xf678('0x8b')){var _0x4f0ed4=_0x39117e[_0xf678('0x8c')]({'plain':!![]});return db[_0xf678('0x8d')][_0xf678('0x49')]({'where':{'name':_0xf678('0x28'),'userProfileId':_0x14cbca[_0xf678('0x88')]},'raw':!![]})['then'](function(_0x582262){if(_0x582262&&_0x582262['autoAssociation']===0x0){return db[_0xf678('0x8e')]['create']({'name':_0x4f0ed4['name'],'resourceId':_0x4f0ed4['id'],'type':_0x582262[_0xf678('0x2b')],'sectionId':_0x582262['id']},{})[_0xf678('0x26')](function(){return _0x39117e;});}else{return _0x39117e;}})[_0xf678('0x43')](function(_0x10cbec){logger[_0xf678('0x2a')](_0xf678('0x8f'),_0x10cbec);throw _0x10cbec;});}return _0x39117e;})[_0xf678('0x26')](respondWithResult(_0x57d8db,null))[_0xf678('0x43')](handleError(_0x57d8db,null));}});}catch(_0x13d46c){_0x57d8db[_0xf678('0x1d')](0x1f4)[_0xf678('0x2c')](_0x13d46c);}};function removeReferences(_0x121d40,_0x3c2f37){try{if(_0x121d40){fs[_0xf678('0x90')](_0x121d40);logger['info']('Zip\x20archive\x20removed');}if(_0x3c2f37){rimraf(_0x3c2f37,function(){});logger['info'](_0xf678('0x91'));}}catch(_0x5d3141){logger[_0xf678('0x2a')](_0x5d3141);}}exports[_0xf678('0x92')]=function(_0x299725,_0x6b051,_0x446537){return db[_0xf678('0x2f')][_0xf678('0x49')]({'where':{'id':_0x299725[_0xf678('0x45')]['id']}})['then'](handleEntityNotFound(_0x6b051,null))[_0xf678('0x26')](saveUpdates(_0x299725[_0xf678('0x87')],null))[_0xf678('0x26')](respondWithResult(_0x6b051,null))[_0xf678('0x43')](handleError(_0x6b051,null));};exports[_0xf678('0x93')]=function(_0x1cc65d,_0x304b77,_0x12794d){return db['Plugin'][_0xf678('0x49')]({'where':{'id':_0x1cc65d['params']['id']}})[_0xf678('0x26')](function(_0x3e4778){if(_0x3e4778){return _0x3e4778[_0xf678('0x27')]();}})['then'](function(_0x22a688){rimraf(path['join'](config['root'],_0xf678('0x4e'),path[_0xf678('0x59')](_0x22a688['path'])),function(){});return _0x22a688;})[_0xf678('0x26')](handleEntityNotFound(_0x304b77,null))[_0xf678('0x26')](respondWithStatusCode(_0x304b77,null))[_0xf678('0x43')](handleError(_0x304b77,null));};exports[_0xf678('0x94')]=function(_0xd1acd0,_0x78e99b,_0x3c5de0){return BPromise[_0xf678('0x95')]()[_0xf678('0x26')](function(){if(!_0xd1acd0[_0xf678('0x32')][_0xf678('0x4b')]){throw new Error(_0xf678('0x96'));}if(!_0xd1acd0[_0xf678('0x32')][_0xf678('0x97')]){throw new Error(_0xf678('0x98'));}var _0x2dfb86=_0xd1acd0[_0xf678('0x32')]['hostname']?_0xd1acd0[_0xf678('0x32')][_0xf678('0x99')]+':'+_0xd1acd0[_0xf678('0x32')][_0xf678('0x97')]:_0xf678('0x9a')+_0xd1acd0[_0xf678('0x32')][_0xf678('0x97')];var _0x6033cd=_0xd1acd0[_0xf678('0x32')][_0xf678('0x1e')]?_0xd1acd0[_0xf678('0x32')][_0xf678('0x1e')]:!![];var _0x5a7d60=_0xd1acd0[_0xf678('0x32')][_0xf678('0x9b')]?_0xd1acd0[_0xf678('0x32')][_0xf678('0x9b')]:null;var _0x5e03a4={'method':_0xd1acd0['method'],'uri':util[_0xf678('0x4f')](_0xf678('0x9c'),_0x2dfb86,_0xd1acd0[_0xf678('0x32')][_0xf678('0x4b')]),'json':_0x6033cd,'resolveWithFullResponse':!![],'encoding':_0x5a7d60,'qs':_0xd1acd0['query']};if(_0xd1acd0[_0xf678('0x9d')]){_0x5e03a4[_0xf678('0x9d')]=_0xd1acd0['headers'];if(_0x5e03a4[_0xf678('0x9d')]['content-length']){delete _0x5e03a4[_0xf678('0x9d')][_0xf678('0x9e')];}}if(_0x5e03a4[_0xf678('0x9d')][_0xf678('0x9f')]){delete _0x5e03a4['headers'][_0xf678('0x9f')];}return rp(_0x5e03a4);})[_0xf678('0x26')](function(_0x513092){if(_0x513092){_0x78e99b[_0xf678('0x23')](_0x513092[_0xf678('0x9d')]);logger['info'](_0x513092[_0xf678('0x87')]);if(_[_0xf678('0xa0')](_0xd1acd0[_0xf678('0x32')][_0xf678('0x4b')],_0xf678('0x4a'))&&_0x513092[_0xf678('0xa1')]==0x1f4){return _0x78e99b['sendStatus'](_0x513092[_0xf678('0xa1')]);}else{return _0x78e99b[_0xf678('0x1d')](_0x513092['statusCode'])[_0xf678('0x2c')](_0x513092[_0xf678('0x87')]);}}else{return _0x78e99b['sendStatus'](0xc8);}})['catch'](handleError(_0x78e99b,null));};exports['webhookPost']=function(_0x309f5d,_0x5d48ea,_0x3dcef4){return BPromise[_0xf678('0x95')]()[_0xf678('0x26')](function(){if(!_0x309f5d[_0xf678('0x32')][_0xf678('0x4b')]){throw new Error(_0xf678('0x96'));}if(!_0x309f5d[_0xf678('0x32')][_0xf678('0x97')]){throw new Error(_0xf678('0x98'));}var _0x1250cc=_0x309f5d[_0xf678('0x32')]['hostname']?_0x309f5d['query']['hostname']+':'+_0x309f5d[_0xf678('0x32')][_0xf678('0x97')]:_0xf678('0x9a')+_0x309f5d['query'][_0xf678('0x97')];var _0x536da2=_0x309f5d[_0xf678('0x32')][_0xf678('0x1e')]?_0x309f5d[_0xf678('0x32')]['json']:!![];var _0x12fcef=_0x309f5d['query'][_0xf678('0x9b')]?_0x309f5d['query'][_0xf678('0x9b')]:null;var _0x5dc269={'method':_0x309f5d[_0xf678('0xa2')],'uri':util[_0xf678('0x4f')](_0xf678('0x9c'),_0x1250cc,_0x309f5d['query'][_0xf678('0x4b')]),'json':_0x536da2,'resolveWithFullResponse':!![],'encoding':_0x12fcef,'body':_0x309f5d[_0xf678('0x87')]};if(_0x309f5d[_0xf678('0x9d')]){_0x5dc269['headers']=_0x309f5d['headers'];if(_0x5dc269['headers'][_0xf678('0x9e')]){delete _0x5dc269[_0xf678('0x9d')][_0xf678('0x9e')];}}if(_0x5dc269[_0xf678('0x9d')][_0xf678('0x9f')]){delete _0x5dc269[_0xf678('0x9d')][_0xf678('0x9f')];}return rp(_0x5dc269);})['then'](function(_0x4710a8){if(_0x4710a8){_0x5d48ea['set'](_0x4710a8[_0xf678('0x9d')]);logger['info'](_0x4710a8[_0xf678('0x87')]);return _0x5d48ea['status'](_0x4710a8[_0xf678('0xa1')])[_0xf678('0x2c')](_0x4710a8[_0xf678('0x87')]);}else{return _0x5d48ea[_0xf678('0x1c')](0xc8);}})[_0xf678('0x43')](handleError(_0x5d48ea,null));};
\ No newline at end of file
+var _0x2672=['encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','\x27PORT\x27\x20parameter\x20not\x20specified','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','rimraf','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','register','sendStatus','status','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','Plugins','UserProfileResource','end','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','download','join','root','server/files/plugins','%s.zip','basename','createWriteStream','zip','warning','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','**/*','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','format','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','isDirectory','readdirSync','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Zip\x20archive\x20removed','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:'];(function(_0xf32f11,_0x4fcbcc){var _0x1601f4=function(_0x5d9a86){while(--_0x5d9a86){_0xf32f11['push'](_0xf32f11['shift']());}};_0x1601f4(++_0x4fcbcc);}(_0x2672,0xbc));var _0x2267=function(_0x474d4,_0xaea238){_0x474d4=_0x474d4-0x0;var _0x43814d=_0x2672[_0x474d4];return _0x43814d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2267('0x0'));var jsonpatch=require(_0x2267('0x1'));var rp=require('request-promise');var moment=require(_0x2267('0x2'));var BPromise=require(_0x2267('0x3'));var Mustache=require('mustache');var util=require(_0x2267('0x4'));var path=require(_0x2267('0x5'));var sox=require(_0x2267('0x6'));var csv=require(_0x2267('0x7'));var ejs=require(_0x2267('0x8'));var fs=require('fs');var fs_extra=require(_0x2267('0x9'));var _=require(_0x2267('0xa'));var squel=require(_0x2267('0xb'));var crypto=require(_0x2267('0xc'));var jsforce=require(_0x2267('0xd'));var deskjs=require(_0x2267('0xe'));var toCsv=require(_0x2267('0x7'));var querystring=require(_0x2267('0xf'));var Papa=require(_0x2267('0x10'));var extract=require('extract-zip');var rimraf=require(_0x2267('0x11'));var archiver=require('archiver');var Redis=require(_0x2267('0x12'));var authService=require(_0x2267('0x13'));var qs=require(_0x2267('0x14'));var as=require(_0x2267('0x15'));var hardwareService=require(_0x2267('0x16'));var logger=require(_0x2267('0x17'))(_0x2267('0x18'));var utils=require(_0x2267('0x19'));var config=require(_0x2267('0x1a'));var licenseUtil=require(_0x2267('0x1b'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x2267('0x1c')],{'host':_0x2267('0x1d'),'port':0x18eb});var socket=require(_0x2267('0x1e'))(new Redis(config['redis']));require('./plugin.socket')[_0x2267('0x1f')](socket);function respondWithStatusCode(_0x3e6e42,_0x382b26){_0x382b26=_0x382b26||0xcc;return function(_0x4eee5c){if(_0x4eee5c){return _0x3e6e42[_0x2267('0x20')](_0x382b26);}return _0x3e6e42[_0x2267('0x21')](_0x382b26)['end']();};}function respondWithResult(_0xa17dd3,_0x14b771){_0x14b771=_0x14b771||0xc8;return function(_0xe00867){if(_0xe00867){return _0xa17dd3[_0x2267('0x21')](_0x14b771)[_0x2267('0x22')](_0xe00867);}};}function respondWithFilteredResult(_0x5550e5,_0x39c683){return function(_0x2ed8a0){if(_0x2ed8a0){var _0xf10c68=typeof _0x39c683['offset']===_0x2267('0x23')&&typeof _0x39c683['limit']===_0x2267('0x23');var _0x163da0=_0x2ed8a0['count'];var _0x59c40b=_0xf10c68?0x0:_0x39c683[_0x2267('0x24')];var _0x329682=_0xf10c68?_0x2ed8a0[_0x2267('0x25')]:_0x39c683[_0x2267('0x24')]+_0x39c683[_0x2267('0x26')];var _0xe67001;if(_0x329682>=_0x163da0){_0x329682=_0x163da0;_0xe67001=0xc8;}else{_0xe67001=0xce;}_0x5550e5['status'](_0xe67001);return _0x5550e5[_0x2267('0x27')](_0x2267('0x28'),_0x59c40b+'-'+_0x329682+'/'+_0x163da0)['json'](_0x2ed8a0);}return null;};}function patchUpdates(_0x5aa536){return function(_0x497364){try{jsonpatch[_0x2267('0x29')](_0x497364,_0x5aa536,!![]);}catch(_0x1074dd){return BPromise[_0x2267('0x2a')](_0x1074dd);}return _0x497364[_0x2267('0x2b')]();};}function saveUpdates(_0x436a18,_0x2e6e0e){return function(_0x571fd8){if(_0x571fd8){return _0x571fd8[_0x2267('0x2c')](_0x436a18)['then'](function(_0x598ef1){return _0x598ef1;});}return null;};}function removeEntity(_0x4406f4,_0x56e936){return function(_0x2881fc){if(_0x2881fc){return _0x2881fc[_0x2267('0x2d')]()[_0x2267('0x2e')](function(){var _0x223832=_0x2881fc[_0x2267('0x2f')]({'plain':!![]});var _0x1ca10f=_0x2267('0x30');return db[_0x2267('0x31')][_0x2267('0x2d')]({'where':{'type':_0x1ca10f,'resourceId':_0x223832['id']}})['then'](function(){return _0x2881fc;});})[_0x2267('0x2e')](function(){_0x4406f4[_0x2267('0x21')](0xcc)[_0x2267('0x32')]();});}};}function handleEntityNotFound(_0x3a4d46,_0x39db51){return function(_0x1fee08){if(!_0x1fee08){_0x3a4d46[_0x2267('0x20')](0x194);}return _0x1fee08;};}function handleError(_0x2c394d,_0x1f066){_0x1f066=_0x1f066||0x1f4;return function(_0x1889d2){logger[_0x2267('0x33')](_0x1889d2[_0x2267('0x34')]);if(_0x1889d2[_0x2267('0x35')]){delete _0x1889d2[_0x2267('0x35')];}_0x2c394d[_0x2267('0x21')](_0x1f066)[_0x2267('0x36')](_0x1889d2);};}exports[_0x2267('0x37')]=function(_0x153cb6,_0x511794){var _0x270131={},_0x164e97={},_0x455790={'count':0x0,'rows':[]};var _0x3d9085=_[_0x2267('0x38')](db[_0x2267('0x39')][_0x2267('0x3a')],function(_0x209b4e){return{'name':_0x209b4e[_0x2267('0x3b')],'type':_0x209b4e[_0x2267('0x3c')][_0x2267('0x3d')]};});_0x164e97[_0x2267('0x3e')]=_[_0x2267('0x38')](_0x3d9085,_0x2267('0x35'));_0x164e97[_0x2267('0x3f')]=_[_0x2267('0x40')](_0x153cb6['query']);_0x164e97[_0x2267('0x41')]=_[_0x2267('0x42')](_0x164e97[_0x2267('0x3e')],_0x164e97[_0x2267('0x3f')]);_0x270131['attributes']=_[_0x2267('0x42')](_0x164e97[_0x2267('0x3e')],qs['fields'](_0x153cb6[_0x2267('0x3f')][_0x2267('0x43')]));_0x270131['attributes']=_0x270131[_0x2267('0x44')][_0x2267('0x45')]?_0x270131[_0x2267('0x44')]:_0x164e97[_0x2267('0x3e')];if(!_0x153cb6[_0x2267('0x3f')][_0x2267('0x46')](_0x2267('0x47'))){_0x270131[_0x2267('0x26')]=qs['limit'](_0x153cb6[_0x2267('0x3f')][_0x2267('0x26')]);_0x270131['offset']=qs[_0x2267('0x24')](_0x153cb6[_0x2267('0x3f')]['offset']);}_0x270131[_0x2267('0x48')]=qs[_0x2267('0x49')](_0x153cb6[_0x2267('0x3f')]['sort']);_0x270131[_0x2267('0x4a')]=qs[_0x2267('0x41')](_[_0x2267('0x4b')](_0x153cb6[_0x2267('0x3f')],_0x164e97['filters']),_0x3d9085);if(_0x153cb6['query'][_0x2267('0x4c')]){_0x270131['where']=_['merge'](_0x270131[_0x2267('0x4a')],{'$or':_[_0x2267('0x38')](_0x3d9085,function(_0x44e4de){if(_0x44e4de['type']!==_0x2267('0x4d')){var _0x3261bd={};_0x3261bd[_0x44e4de['name']]={'$like':'%'+_0x153cb6[_0x2267('0x3f')][_0x2267('0x4c')]+'%'};return _0x3261bd;}})});}_0x270131=_[_0x2267('0x4e')]({},_0x270131,_0x153cb6[_0x2267('0x4f')]);var _0x19843a={'where':_0x270131[_0x2267('0x4a')]};return db[_0x2267('0x39')]['count'](_0x19843a)[_0x2267('0x2e')](function(_0x544c5a){_0x455790[_0x2267('0x25')]=_0x544c5a;if(_0x153cb6[_0x2267('0x3f')][_0x2267('0x50')]){_0x270131[_0x2267('0x51')]=[{'all':!![]}];}return db[_0x2267('0x39')][_0x2267('0x52')](_0x270131);})[_0x2267('0x2e')](function(_0x2ce172){_0x455790[_0x2267('0x53')]=_0x2ce172;return _0x455790;})[_0x2267('0x2e')](respondWithFilteredResult(_0x511794,_0x270131))[_0x2267('0x54')](handleError(_0x511794,null));};exports[_0x2267('0x55')]=function(_0x49c19c,_0xe43e01){var _0x499786={'raw':!![],'where':{'id':_0x49c19c[_0x2267('0x56')]['id']}},_0x5d7ded={};_0x5d7ded[_0x2267('0x3e')]=_[_0x2267('0x40')](db[_0x2267('0x39')][_0x2267('0x3a')]);_0x5d7ded[_0x2267('0x3f')]=_[_0x2267('0x40')](_0x49c19c['query']);_0x5d7ded[_0x2267('0x41')]=_[_0x2267('0x42')](_0x5d7ded[_0x2267('0x3e')],_0x5d7ded['query']);_0x499786[_0x2267('0x44')]=_[_0x2267('0x42')](_0x5d7ded[_0x2267('0x3e')],qs[_0x2267('0x43')](_0x49c19c['query'][_0x2267('0x43')]));_0x499786['attributes']=_0x499786[_0x2267('0x44')][_0x2267('0x45')]?_0x499786[_0x2267('0x44')]:_0x5d7ded[_0x2267('0x3e')];if(_0x49c19c[_0x2267('0x3f')]['includeAll']){_0x499786[_0x2267('0x51')]=[{'all':!![]}];}_0x499786=_['merge']({},_0x499786,_0x49c19c[_0x2267('0x4f')]);return db['Plugin'][_0x2267('0x57')](_0x499786)[_0x2267('0x2e')](handleEntityNotFound(_0xe43e01,null))[_0x2267('0x2e')](respondWithResult(_0xe43e01,null))[_0x2267('0x54')](handleError(_0xe43e01,null));};exports[_0x2267('0x58')]=function(_0x38bee4,_0x4680e3,_0xe421c7){return db[_0x2267('0x39')]['find']({'where':{'id':_0x38bee4['params']['id']},'attributes':[_0x2267('0x35'),_0x2267('0x5')],'raw':!![]})[_0x2267('0x2e')](handleEntityNotFound(_0x4680e3,null))['then'](function(_0x694edb){if(_0x694edb){var _0x51cb1e=path[_0x2267('0x59')](config[_0x2267('0x5a')],_0x2267('0x5b'),util['format'](_0x2267('0x5c'),path[_0x2267('0x5d')](_0x694edb['path'])));var _0x2ac103=fs[_0x2267('0x5e')](_0x51cb1e);var _0x2f9932=archiver(_0x2267('0x5f'),{'zlib':{'level':0x9}});_0x2f9932['on'](_0x2267('0x60'),function(_0x1fd4b3){if(_0x1fd4b3['code']==='ENOENT'){logger[_0x2267('0x33')](_0x1fd4b3);}else{throw new db['Sequelize'][(_0x2267('0x61'))](_0x2267('0x62'));}});_0x2f9932['on'](_0x2267('0x33'),function(_0x5f25d1){throw new db[(_0x2267('0x63'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x2f9932[_0x2267('0x64')](_0x2ac103);_0x2f9932[_0x2267('0x65')](_0x2267('0x66'),{'cwd':path[_0x2267('0x59')](config[_0x2267('0x5a')],_0x2267('0x5b'),path[_0x2267('0x67')](_0x694edb['path'])),'ignore':[path[_0x2267('0x59')](path[_0x2267('0x5d')](_0x694edb[_0x2267('0x5')]),_0x2267('0x68')),path[_0x2267('0x59')](path[_0x2267('0x5d')](_0x694edb[_0x2267('0x5')]),_0x2267('0x69'))],'nodir':!![]})[_0x2267('0x6a')]();_0x2ac103['on'](_0x2267('0x6b'),function(){if(!fs[_0x2267('0x6c')](_0x51cb1e)){throw new db[(_0x2267('0x63'))][(_0x2267('0x61'))]('Plugin\x20not\x20found');}return _0x4680e3['download'](_0x51cb1e,util[_0x2267('0x6d')]('%s.zip',path[_0x2267('0x5d')](_0x694edb[_0x2267('0x5')])),function(_0x5ca843){if(_0x5ca843){throw new db[(_0x2267('0x63'))][(_0x2267('0x61'))](_0x2267('0x6e'));}fs[_0x2267('0x6f')](_0x51cb1e);logger[_0x2267('0x70')]('Download\x20completed');logger[_0x2267('0x70')]('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x4680e3,null));};exports[_0x2267('0x71')]=function(_0x2dc296,_0x505824,_0x97a863){var _0x4dd8f3=path[_0x2267('0x5d')](_0x2dc296[_0x2267('0x72')][_0x2267('0x73')],path[_0x2267('0x74')](_0x2dc296[_0x2267('0x72')]['filename']));var _0x3403b6=path[_0x2267('0x59')](config['root'],'server/files/plugins',_0x2dc296['file']['filename']);var _0x50841b=path[_0x2267('0x59')](config[_0x2267('0x5a')],_0x2267('0x5b'),_0x4dd8f3);logger[_0x2267('0x70')](_0x2267('0x75'),_0x3403b6);logger[_0x2267('0x70')]('Plugin\x20upload\x20destination:\x20%s',_0x50841b);try{fs[_0x2267('0x76')](_0x3403b6,parseInt(_0x2267('0x77'),0x8));extract(_0x3403b6,{'dir':_0x50841b},function(_0x18ac98){if(_0x18ac98){logger[_0x2267('0x33')](_0x18ac98);handleError(_0x18ac98,!![]);};var _0x448638=fs['readdirSync'](_0x50841b);if(_0x448638[_0x2267('0x45')]>0x1){removeReferences(_0x3403b6,_0x50841b);logger[_0x2267('0x33')](_0x2267('0x78'));return _0x97a863(new Error('Invalid\x20plugin\x20structure'));}var _0x2e8223=fs[_0x2267('0x79')](path[_0x2267('0x59')](_0x50841b,_0x448638[0x0]));if(_0x2e8223['isFile']()){removeReferences(_0x3403b6,_0x50841b);logger['error']('Invalid\x20plugin\x20structure');return _0x97a863(new Error(_0x2267('0x78')));}if(_0x2e8223[_0x2267('0x7a')]()){var _0x5a1ceb=fs[_0x2267('0x7b')](path[_0x2267('0x59')](_0x50841b,_0x448638[0x0]));if(_0x5a1ceb[_0x2267('0x45')]===0x0){removeReferences(_0x3403b6,_0x50841b);logger[_0x2267('0x33')](_0x2267('0x78'));return _0x97a863(new Error(_0x2267('0x78')));}var _0x5626ae=_0x5a1ceb[_0x2267('0x7c')](function(_0xef39f6){return _0xef39f6==='manifest.json';});if(!_0x5626ae){return _0x97a863(new Error(_0x2267('0x7d')));}var _0x522e4d=fs[_0x2267('0x7e')](path[_0x2267('0x59')](_0x50841b,_0x448638[0x0],_0x2267('0x7f')));var _0x5b6426=JSON[_0x2267('0x80')](_0x522e4d);if('undefined'==typeof _0x5b6426['name']){return _0x97a863(new Error(_0x2267('0x81')));}if(_0x2267('0x23')==typeof _0x5b6426[_0x2267('0x3c')]){return _0x97a863(new Error(_0x2267('0x82')));}if(_0x2267('0x23')==typeof _0x5b6426[_0x2267('0x83')]){return _0x97a863(new Error(_0x2267('0x84')));}if(_0x2267('0x23')==typeof _0x5b6426[_0x2267('0x85')]){return _0x97a863(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x5b6426['type']===_0x2267('0x86')){if(_0x2267('0x23')==typeof _0x5b6426[_0x2267('0x85')]['views']){return _0x97a863(new Error(_0x2267('0x87')));}if(_0x2267('0x23')==typeof _0x5b6426[_0x2267('0x85')][_0x2267('0x88')][_0x2267('0x89')]&&'undefined'==typeof _0x5b6426['parameters'][_0x2267('0x88')][_0x2267('0x8a')]){return _0x97a863(new Error(_0x2267('0x8b')));}}else if(_0x5b6426[_0x2267('0x3c')]===_0x2267('0x8c')){if(_0x2267('0x23')==typeof _0x5b6426['parameters'][_0x2267('0x8d')]){return _0x97a863(new Error(_0x2267('0x8e')));}if(_0x2267('0x23')==typeof _0x5b6426[_0x2267('0x85')][_0x2267('0x8f')]){return _0x97a863(new Error(_0x2267('0x90')));}}else{return _0x97a863(new Error(_0x2267('0x91')));}var _0xd93a36=_0x5b6426['name'];var _0x4f4d16=_0x5b6426['description'];var _0x4cb1f1=_0x5b6426[_0x2267('0x3c')];var _0x3414bf=_0x5b6426['sidebar']?_0x5b6426[_0x2267('0x92')]:_0x2267('0x93');var _0x535d12=_0x5b6426['icon']?_0x5b6426[_0x2267('0x94')]:_0x2267('0x95');var _0x193add='';var _0x3d0ae9='';var _0x2beb7b='';var _0x3d2dbd='';var _0x30d226=_0x5b6426['version'];if(_0x4cb1f1===_0x2267('0x86')){if(_0x2267('0x23')!=typeof _0x5b6426[_0x2267('0x85')]['views']['admin']){var _0x97e662=_0x5b6426['parameters'][_0x2267('0x88')][_0x2267('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x2267('0x96')](_0x97e662)){_0x193add=path[_0x2267('0x59')](_0x2267('0x97'),_0x4dd8f3,_0x448638[0x0],_0x97e662);}else{_0x193add=_0x97e662;}}else{logger['info'](_0x2267('0x98'));}if(_0x2267('0x23')!=typeof _0x5b6426[_0x2267('0x85')][_0x2267('0x88')]['agent']){var _0x4736ff=_0x5b6426['parameters'][_0x2267('0x88')][_0x2267('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0x2267('0x96')](_0x4736ff)){_0x3d0ae9=path[_0x2267('0x59')](_0x2267('0x97'),_0x4dd8f3,_0x448638[0x0],_0x4736ff);}else{_0x3d0ae9=_0x4736ff;}}else{logger[_0x2267('0x70')](_0x2267('0x99'));}}else if(_0x4cb1f1===_0x2267('0x8c')){_0x2beb7b=_0x5b6426[_0x2267('0x85')][_0x2267('0x8d')];_0x3d2dbd=_0x5b6426[_0x2267('0x85')][_0x2267('0x8f')];if('undefined'!=typeof _0x5b6426['parameters'][_0x2267('0x88')]){if(_0x2267('0x23')!=typeof _0x5b6426[_0x2267('0x85')][_0x2267('0x88')][_0x2267('0x89')]){var _0x97e662=_0x5b6426[_0x2267('0x85')]['views'][_0x2267('0x89')];if(!/^(f|ht)tps?:\/\//i['test'](_0x97e662)){_0x193add=path[_0x2267('0x59')](_0x2267('0x97'),_0x4dd8f3,_0x448638[0x0],_0x97e662);}else{_0x193add=_0x97e662;}}if(_0x2267('0x23')!=typeof _0x5b6426[_0x2267('0x85')][_0x2267('0x88')][_0x2267('0x8a')]){var _0x4736ff=_0x5b6426[_0x2267('0x85')][_0x2267('0x88')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x2267('0x96')](_0x4736ff)){_0x3d0ae9=path['join'](_0x2267('0x97'),_0x4dd8f3,_0x448638[0x0],_0x4736ff);}else{_0x3d0ae9=_0x4736ff;}}}}var _0x500812={'name':_0xd93a36,'description':_0x4f4d16,'path':path[_0x2267('0x59')](_0x4dd8f3,_0x448638[0x0]),'type':_0x4cb1f1,'sidebar':_0x3414bf,'icon':_0x535d12,'adminUrl':_0x193add,'agentUrl':_0x3d0ae9,'scriptName':_0x2beb7b,'scriptPath':_0x3d2dbd,'version':_0x30d226};removeReferences(_0x3403b6,null);return db['Plugin'][_0x2267('0x9a')](_0x500812)[_0x2267('0x2e')](function(_0x2cba87){var _0x3c55bd={'role':_0x2dc296[_0x2267('0x9b')][_0x2267('0x9c')],'userProfileId':_0x2dc296[_0x2267('0x9b')][_0x2267('0x9d')]};if(!_0x3c55bd)throw new Error(_0x2267('0x9e'));if(_0x3c55bd[_0x2267('0x9c')]===_0x2267('0x9f')){var _0x543584=_0x2cba87['get']({'plain':!![]});return db[_0x2267('0xa0')][_0x2267('0x57')]({'where':{'name':'Plugins','userProfileId':_0x3c55bd[_0x2267('0x9d')]},'raw':!![]})[_0x2267('0x2e')](function(_0x559706){if(_0x559706&&_0x559706[_0x2267('0xa1')]===0x0){return db[_0x2267('0x31')][_0x2267('0x9a')]({'name':_0x543584[_0x2267('0x35')],'resourceId':_0x543584['id'],'type':_0x559706[_0x2267('0x35')],'sectionId':_0x559706['id']},{})[_0x2267('0x2e')](function(){return _0x2cba87;});}else{return _0x2cba87;}})[_0x2267('0x54')](function(_0x5e2c39){logger[_0x2267('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5e2c39);throw _0x5e2c39;});}return _0x2cba87;})[_0x2267('0x2e')](respondWithResult(_0x505824,null))['catch'](handleError(_0x505824,null));}});}catch(_0x34ce07){_0x505824[_0x2267('0x21')](0x1f4)[_0x2267('0x36')](_0x34ce07);}};function removeReferences(_0x51befa,_0x191886){try{if(_0x51befa){fs['unlinkSync'](_0x51befa);logger[_0x2267('0x70')](_0x2267('0xa2'));}if(_0x191886){rimraf(_0x191886,function(){});logger[_0x2267('0x70')]('Extracted\x20folder\x20removed');}}catch(_0x276d0a){logger[_0x2267('0x33')](_0x276d0a);}}exports['update']=function(_0x7952e7,_0x254e1e,_0xae3e8b){return db[_0x2267('0x39')][_0x2267('0x57')]({'where':{'id':_0x7952e7[_0x2267('0x56')]['id']}})[_0x2267('0x2e')](handleEntityNotFound(_0x254e1e,null))[_0x2267('0x2e')](saveUpdates(_0x7952e7[_0x2267('0x9b')],null))[_0x2267('0x2e')](respondWithResult(_0x254e1e,null))['catch'](handleError(_0x254e1e,null));};exports[_0x2267('0xa3')]=function(_0x33de28,_0x5ce854,_0x1bc757){return db[_0x2267('0x39')][_0x2267('0x57')]({'where':{'id':_0x33de28['params']['id']}})[_0x2267('0x2e')](function(_0x320ab7){if(_0x320ab7){return _0x320ab7[_0x2267('0x2d')]();}})[_0x2267('0x2e')](function(_0x147987){rimraf(path['join'](config[_0x2267('0x5a')],'server/files/plugins',path[_0x2267('0x67')](_0x147987['path'])),function(){});return _0x147987;})[_0x2267('0x2e')](handleEntityNotFound(_0x5ce854,null))[_0x2267('0x2e')](respondWithStatusCode(_0x5ce854,null))[_0x2267('0x54')](handleError(_0x5ce854,null));};exports[_0x2267('0xa4')]=function(_0x5b0d2f,_0xe2327b,_0x19a631){return BPromise[_0x2267('0xa5')]()['then'](function(){if(!_0x5b0d2f['query'][_0x2267('0x5')]){throw new Error(_0x2267('0xa6'));}if(!_0x5b0d2f[_0x2267('0x3f')][_0x2267('0xa7')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x26e47d=_0x5b0d2f['query'][_0x2267('0xa8')]?_0x5b0d2f[_0x2267('0x3f')][_0x2267('0xa8')]+':'+_0x5b0d2f[_0x2267('0x3f')][_0x2267('0xa7')]:_0x2267('0xa9')+_0x5b0d2f['query'][_0x2267('0xa7')];var _0x412aea=_0x5b0d2f['query']['json']?_0x5b0d2f[_0x2267('0x3f')][_0x2267('0x22')]:!![];var _0x4a313d=_0x5b0d2f[_0x2267('0x3f')][_0x2267('0xaa')]?_0x5b0d2f[_0x2267('0x3f')][_0x2267('0xaa')]:null;var _0x4286c4={'method':_0x5b0d2f[_0x2267('0xab')],'uri':util['format'](_0x2267('0xac'),_0x26e47d,_0x5b0d2f[_0x2267('0x3f')][_0x2267('0x5')]),'json':_0x412aea,'resolveWithFullResponse':!![],'encoding':_0x4a313d,'qs':_0x5b0d2f['query']};if(_0x5b0d2f[_0x2267('0xad')]){_0x4286c4[_0x2267('0xad')]=_0x5b0d2f[_0x2267('0xad')];if(_0x4286c4[_0x2267('0xad')][_0x2267('0xae')]){delete _0x4286c4[_0x2267('0xad')][_0x2267('0xae')];}}if(_0x4286c4[_0x2267('0xad')][_0x2267('0xaf')]){delete _0x4286c4[_0x2267('0xad')][_0x2267('0xaf')];}return rp(_0x4286c4);})[_0x2267('0x2e')](function(_0x436f11){if(_0x436f11){_0xe2327b['set'](_0x436f11['headers']);logger['info'](_0x436f11['body']);if(_[_0x2267('0xb0')](_0x5b0d2f[_0x2267('0x3f')][_0x2267('0x5')],_0x2267('0x58'))&&_0x436f11[_0x2267('0xb1')]==0x1f4){return _0xe2327b[_0x2267('0x20')](_0x436f11[_0x2267('0xb1')]);}else{return _0xe2327b['status'](_0x436f11[_0x2267('0xb1')])['send'](_0x436f11[_0x2267('0x9b')]);}}else{return _0xe2327b[_0x2267('0x20')](0xc8);}})[_0x2267('0x54')](handleError(_0xe2327b,null));};exports['webhookPost']=function(_0x3c12b8,_0x2561af,_0x5aaf46){return BPromise['resolve']()[_0x2267('0x2e')](function(){if(!_0x3c12b8[_0x2267('0x3f')][_0x2267('0x5')]){throw new Error(_0x2267('0xa6'));}if(!_0x3c12b8[_0x2267('0x3f')][_0x2267('0xa7')]){throw new Error(_0x2267('0xb2'));}var _0x4557e3=_0x3c12b8['query']['hostname']?_0x3c12b8[_0x2267('0x3f')][_0x2267('0xa8')]+':'+_0x3c12b8['query'][_0x2267('0xa7')]:_0x2267('0xa9')+_0x3c12b8[_0x2267('0x3f')]['port'];var _0x414fdd=_0x3c12b8['query'][_0x2267('0x22')]?_0x3c12b8[_0x2267('0x3f')]['json']:!![];var _0x4a5a99=_0x3c12b8[_0x2267('0x3f')][_0x2267('0xaa')]?_0x3c12b8['query'][_0x2267('0xaa')]:null;var _0x4ea8be={'method':_0x3c12b8[_0x2267('0xab')],'uri':util['format'](_0x2267('0xac'),_0x4557e3,_0x3c12b8[_0x2267('0x3f')][_0x2267('0x5')]),'json':_0x414fdd,'resolveWithFullResponse':!![],'encoding':_0x4a5a99,'body':_0x3c12b8[_0x2267('0x9b')]};if(_0x3c12b8[_0x2267('0xad')]){_0x4ea8be[_0x2267('0xad')]=_0x3c12b8[_0x2267('0xad')];if(_0x4ea8be[_0x2267('0xad')][_0x2267('0xae')]){delete _0x4ea8be[_0x2267('0xad')][_0x2267('0xae')];}}if(_0x4ea8be[_0x2267('0xad')][_0x2267('0xaf')]){delete _0x4ea8be[_0x2267('0xad')][_0x2267('0xaf')];}return rp(_0x4ea8be);})['then'](function(_0x38d6c3){if(_0x38d6c3){_0x2561af[_0x2267('0x27')](_0x38d6c3[_0x2267('0xad')]);logger[_0x2267('0x70')](_0x38d6c3['body']);return _0x2561af[_0x2267('0x21')](_0x38d6c3[_0x2267('0xb1')])[_0x2267('0x36')](_0x38d6c3[_0x2267('0x9b')]);}else{return _0x2561af[_0x2267('0x20')](0xc8);}})[_0x2267('0x54')](handleError(_0x2561af,null));};
\ No newline at end of file
index 8793aea..c8359ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b69=['hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','update','emit'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0x9b69,0xa3));var _0x99b6=function(_0x44d20f,_0x292582){_0x44d20f=_0x44d20f-0x0;var _0x509a0b=_0x9b69[_0x44d20f];return _0x509a0b;};'use strict';var EventEmitter=require(_0x99b6('0x0'));var Plugin=require(_0x99b6('0x1'))['db'][_0x99b6('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x99b6('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2d5904){return function(_0x3a05b4,_0x293e09,_0x4a62c6){PluginEvents[_0x99b6('0x4')](_0x2d5904+':'+_0x3a05b4['id'],_0x3a05b4);PluginEvents['emit'](_0x2d5904,_0x3a05b4);_0x4a62c6(null);};}for(var e in events){if(events[_0x99b6('0x5')](e)){var event=events[e];Plugin[_0x99b6('0x6')](e,emitEvent(event));}}module[_0x99b6('0x7')]=PluginEvents;
\ No newline at end of file
+var _0x06ae=['save','update','remove','hasOwnProperty','hook','exports','../../mysqldb','Plugin','setMaxListeners'];(function(_0xffe019,_0x34b5e0){var _0xf5abad=function(_0x2a2c88){while(--_0x2a2c88){_0xffe019['push'](_0xffe019['shift']());}};_0xf5abad(++_0x34b5e0);}(_0x06ae,0x16e));var _0xe06a=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x06ae[_0xa464c9];return _0x3d73c4;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xe06a('0x0'))['db'][_0xe06a('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xe06a('0x2')](0x0);var events={'afterCreate':_0xe06a('0x3'),'afterUpdate':_0xe06a('0x4'),'afterDestroy':_0xe06a('0x5')};function emitEvent(_0x2dfe68){return function(_0x1d695f,_0x1e7706,_0x4de363){PluginEvents['emit'](_0x2dfe68+':'+_0x1d695f['id'],_0x1d695f);PluginEvents['emit'](_0x2dfe68,_0x1d695f);_0x4de363(null);};}for(var e in events){if(events[_0xe06a('0x6')](e)){var event=events[e];Plugin[_0xe06a('0x7')](e,emitEvent(event));}}module[_0xe06a('0x8')]=PluginEvents;
\ No newline at end of file
index 5ccafa7..033b6e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe002=['Plugin','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define'];(function(_0xf9d98e,_0x234354){var _0x2053eb=function(_0x20e6fb){while(--_0x20e6fb){_0xf9d98e['push'](_0xf9d98e['shift']());}};_0x2053eb(++_0x234354);}(_0xe002,0x15f));var _0x2e00=function(_0xf04c6d,_0xe98786){_0xf04c6d=_0xf04c6d-0x0;var _0x4a804e=_0xe002[_0xf04c6d];return _0x4a804e;};'use strict';var _=require(_0x2e00('0x0'));var util=require(_0x2e00('0x1'));var logger=require(_0x2e00('0x2'))(_0x2e00('0x3'));var moment=require(_0x2e00('0x4'));var BPromise=require(_0x2e00('0x5'));var rp=require(_0x2e00('0x6'));var fs=require('fs');var path=require(_0x2e00('0x7'));var rimraf=require(_0x2e00('0x8'));var config=require(_0x2e00('0x9'));var attributes=require(_0x2e00('0xa'));module[_0x2e00('0xb')]=function(_0x4f57ac,_0x50555c){return _0x4f57ac[_0x2e00('0xc')](_0x2e00('0xd'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3910=['../../config/environment','./plugin.attributes','define','Plugin','plugins','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x3910,0x102));var _0x0391=function(_0x3091de,_0x105e82){_0x3091de=_0x3091de-0x0;var _0x5d963c=_0x3910[_0x3091de];return _0x5d963c;};'use strict';var _=require(_0x0391('0x0'));var util=require('util');var logger=require(_0x0391('0x1'))(_0x0391('0x2'));var moment=require(_0x0391('0x3'));var BPromise=require(_0x0391('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0391('0x5'));var rimraf=require('rimraf');var config=require(_0x0391('0x6'));var attributes=require(_0x0391('0x7'));module['exports']=function(_0x32a535,_0x3ddb77){return _0x32a535[_0x0391('0x8')](_0x0391('0x9'),attributes,{'tableName':_0x0391('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b5ee139..9de9aa8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37c0=['defaults','localhost','./plugin.socket','register','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','create','options','raw','CreatePlugin','debug','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis'];(function(_0x56274c,_0xa76dc0){var _0x47a265=function(_0x4e87ce){while(--_0x4e87ce){_0x56274c['push'](_0x56274c['shift']());}};_0x47a265(++_0xa76dc0);}(_0x37c0,0x18b));var _0x037c=function(_0x2ea736,_0x32d4ad){_0x2ea736=_0x2ea736-0x0;var _0x3a2024=_0x37c0[_0x2ea736];return _0x3a2024;};'use strict';var _=require(_0x037c('0x0'));var util=require(_0x037c('0x1'));var moment=require(_0x037c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x037c('0x3'));var db=require(_0x037c('0x4'))['db'];var utils=require(_0x037c('0x5'));var logger=require(_0x037c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x037c('0x7'));var client=jayson[_0x037c('0x8')][_0x037c('0x9')]({'port':0x232a});config[_0x037c('0xa')]=_[_0x037c('0xb')](config[_0x037c('0xa')],{'host':_0x037c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x037c('0xa')]));require(_0x037c('0xd'))[_0x037c('0xe')](socket);function respondWithRpcPromise(_0x3fb5dd,_0x54090d,_0x1aaea8){return new BPromise(function(_0x48eb56,_0x337375){return client['request'](_0x3fb5dd,_0x1aaea8)['then'](function(_0xd950ff){logger[_0x037c('0xf')](_0x037c('0x10'),_0x54090d,_0x037c('0x11'));logger['debug'](_0x037c('0x12'),_0x54090d,_0x037c('0x11'),JSON[_0x037c('0x13')](_0xd950ff));if(_0xd950ff[_0x037c('0x14')]){if(_0xd950ff[_0x037c('0x14')][_0x037c('0x15')]===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0x54090d,_0xd950ff[_0x037c('0x14')][_0x037c('0x16')]);return _0x337375(_0xd950ff[_0x037c('0x14')][_0x037c('0x16')]);}logger['error'](_0x037c('0x10'),_0x54090d,_0xd950ff[_0x037c('0x14')][_0x037c('0x16')]);return _0x48eb56(_0xd950ff[_0x037c('0x14')][_0x037c('0x16')]);}else{logger[_0x037c('0xf')]('Plugin,\x20%s,\x20%s',_0x54090d,_0x037c('0x11'));_0x48eb56(_0xd950ff['result'][_0x037c('0x16')]);}})['catch'](function(_0x190283){logger['error'](_0x037c('0x10'),_0x54090d,_0x190283);_0x337375(_0x190283);});});}exports['CreatePlugin']=function(_0x4f9701){var _0x26a915=this;return new Promise(function(_0x253242,_0x2c1ed7){return db['Plugin'][_0x037c('0x17')](_0x4f9701['body'],{'raw':_0x4f9701[_0x037c('0x18')]?_0x4f9701[_0x037c('0x18')][_0x037c('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x2940d2){logger[_0x037c('0xf')](_0x037c('0x1a'),_0x4f9701);logger[_0x037c('0x1b')]('CreatePlugin',_0x4f9701,JSON[_0x037c('0x13')](_0x2940d2));_0x253242(_0x2940d2);})[_0x037c('0x1c')](function(_0x441c7d){logger[_0x037c('0x14')]('CreatePlugin',_0x441c7d[_0x037c('0x16')],_0x4f9701);_0x2c1ed7(_0x26a915['error'](0x1f4,_0x441c7d[_0x037c('0x16')]));});});};
\ No newline at end of file
+var _0xa32a=['debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','then','lodash','moment','bluebird','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./plugin.socket','info','Plugin,\x20%s,\x20%s','request\x20sent'];(function(_0x22074d,_0x33df85){var _0x3a24ce=function(_0x1dfb83){while(--_0x1dfb83){_0x22074d['push'](_0x22074d['shift']());}};_0x3a24ce(++_0x33df85);}(_0xa32a,0x1a5));var _0xaa32=function(_0x3b1d1e,_0x10d8d9){_0x3b1d1e=_0x3b1d1e-0x0;var _0x5670b7=_0xa32a[_0x3b1d1e];return _0x5670b7;};'use strict';var _=require(_0xaa32('0x0'));var util=require('util');var moment=require(_0xaa32('0x1'));var BPromise=require(_0xaa32('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(_0xaa32('0x3'))('rpc');var config=require(_0xaa32('0x4'));var jayson=require(_0xaa32('0x5'));var client=jayson['client']['http']({'port':0x232a});config[_0xaa32('0x6')]=_[_0xaa32('0x7')](config['redis'],{'host':_0xaa32('0x8'),'port':0x18eb});var socket=require(_0xaa32('0x9'))(new Redis(config[_0xaa32('0x6')]));require(_0xaa32('0xa'))['register'](socket);function respondWithRpcPromise(_0x5c6e54,_0x1d39b,_0x41dafb){return new BPromise(function(_0x351409,_0x505745){return client['request'](_0x5c6e54,_0x41dafb)['then'](function(_0x1a2718){logger[_0xaa32('0xb')](_0xaa32('0xc'),_0x1d39b,_0xaa32('0xd'));logger[_0xaa32('0xe')](_0xaa32('0xf'),_0x1d39b,_0xaa32('0xd'),JSON[_0xaa32('0x10')](_0x1a2718));if(_0x1a2718[_0xaa32('0x11')]){if(_0x1a2718[_0xaa32('0x11')][_0xaa32('0x12')]===0x1f4){logger[_0xaa32('0x11')](_0xaa32('0xc'),_0x1d39b,_0x1a2718[_0xaa32('0x11')][_0xaa32('0x13')]);return _0x505745(_0x1a2718[_0xaa32('0x11')]['message']);}logger[_0xaa32('0x11')](_0xaa32('0xc'),_0x1d39b,_0x1a2718[_0xaa32('0x11')][_0xaa32('0x13')]);return _0x351409(_0x1a2718[_0xaa32('0x11')][_0xaa32('0x13')]);}else{logger['info']('Plugin,\x20%s,\x20%s',_0x1d39b,_0xaa32('0xd'));_0x351409(_0x1a2718[_0xaa32('0x14')]['message']);}})[_0xaa32('0x15')](function(_0x299b11){logger[_0xaa32('0x11')](_0xaa32('0xc'),_0x1d39b,_0x299b11);_0x505745(_0x299b11);});});}exports[_0xaa32('0x16')]=function(_0x57942d){var _0xf08566=this;return new Promise(function(_0x7c56d1,_0x438a0b){return db[_0xaa32('0x17')][_0xaa32('0x18')](_0x57942d[_0xaa32('0x19')],{'raw':_0x57942d[_0xaa32('0x1a')]?_0x57942d[_0xaa32('0x1a')][_0xaa32('0x1b')]===undefined?!![]:![]:!![]})[_0xaa32('0x1c')](function(_0x83bef9){logger[_0xaa32('0xb')](_0xaa32('0x16'),_0x57942d);logger['debug'](_0xaa32('0x16'),_0x57942d,JSON['stringify'](_0x83bef9));_0x7c56d1(_0x83bef9);})['catch'](function(_0xfbf4ea){logger[_0xaa32('0x11')](_0xaa32('0x16'),_0xfbf4ea[_0xaa32('0x13')],_0x57942d);_0x438a0b(_0xf08566['error'](0x1f4,_0xfbf4ea[_0xaa32('0x13')]));});});};
\ No newline at end of file
index 937cccb..c5fb627 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfaa4=['plugin:','./plugin.events','update','emit','removeListener','register'];(function(_0x551bc4,_0x330316){var _0x5af907=function(_0x41d277){while(--_0x41d277){_0x551bc4['push'](_0x551bc4['shift']());}};_0x5af907(++_0x330316);}(_0xfaa4,0x169));var _0x4faa=function(_0x402b25,_0xd52516){_0x402b25=_0x402b25-0x0;var _0x55152b=_0xfaa4[_0x402b25];return _0x55152b;};'use strict';var PluginEvents=require(_0x4faa('0x0'));var events=['save','remove',_0x4faa('0x1')];function createListener(_0x42c79f,_0x5af106){return function(_0x1f8145){_0x5af106[_0x4faa('0x2')](_0x42c79f,_0x1f8145);};}function removeListener(_0x25ef57,_0x57b4df){return function(){PluginEvents[_0x4faa('0x3')](_0x25ef57,_0x57b4df);};}exports[_0x4faa('0x4')]=function(_0x8ce165){for(var _0x26aa59=0x0,_0x28ec9f=events['length'];_0x26aa59<_0x28ec9f;_0x26aa59++){var _0x1bf5f2=events[_0x26aa59];var _0x264fbf=createListener(_0x4faa('0x5')+_0x1bf5f2,_0x8ce165);PluginEvents['on'](_0x1bf5f2,_0x264fbf);}};
\ No newline at end of file
+var _0x5838=['./plugin.events','save','remove','update','emit','register','length','plugin:'];(function(_0x254db2,_0x1f6015){var _0x241804=function(_0x4aa6fd){while(--_0x4aa6fd){_0x254db2['push'](_0x254db2['shift']());}};_0x241804(++_0x1f6015);}(_0x5838,0x1c8));var _0x8583=function(_0xdd54de,_0x1b6766){_0xdd54de=_0xdd54de-0x0;var _0x3715a4=_0x5838[_0xdd54de];return _0x3715a4;};'use strict';var PluginEvents=require(_0x8583('0x0'));var events=[_0x8583('0x1'),_0x8583('0x2'),_0x8583('0x3')];function createListener(_0xdd5584,_0x1f6f19){return function(_0x49bf5c){_0x1f6f19[_0x8583('0x4')](_0xdd5584,_0x49bf5c);};}function removeListener(_0x430dc8,_0xaf0112){return function(){PluginEvents['removeListener'](_0x430dc8,_0xaf0112);};}exports[_0x8583('0x5')]=function(_0x5c902e){for(var _0x543b88=0x0,_0x23c662=events[_0x8583('0x6')];_0x543b88<_0x23c662;_0x543b88++){var _0xf6b402=events[_0x543b88];var _0x4ec707=createListener(_0x8583('0x7')+_0xf6b402,_0x5c902e);PluginEvents['on'](_0xf6b402,_0x4ec707);}};
\ No newline at end of file
index 0918536..b1a3d12 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(_0x5d2143,_0x485800){var _0x260617=function(_0x42a7b2){while(--_0x42a7b2){_0x5d2143['push'](_0x5d2143['shift']());}};_0x260617(++_0x485800);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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(_0x14d2e1,_0x3c66cb){var _0x3e0edf=function(_0x475424){while(--_0x475424){_0x14d2e1['push'](_0x14d2e1['shift']());}};_0x3e0edf(++_0x3c66cb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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 5d65a0e..afadb1d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdace=['path','exec','bluebird','sendStatus','status','json','error','stack','send','npm\x20install','info','index','list','then','reject','name','express','length','catch','show','create','body','script','join','../../files/plugins','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','params','Unknown\x20status','destroy','Unknown\x20id','lodash','../../config/logger','api'];(function(_0xd0d7da,_0x2ccf94){var _0x281ba5=function(_0x3f2519){while(--_0x3f2519){_0xd0d7da['push'](_0xd0d7da['shift']());}};_0x281ba5(++_0x2ccf94);}(_0xdace,0xc5));var _0xedac=function(_0x18d631,_0x4376d2){_0x18d631=_0x18d631-0x0;var _0x50d708=_0xdace[_0x18d631];return _0x50d708;};'use strict';var _=require(_0xedac('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xedac('0x1'))(_0xedac('0x2'));var path=require(_0xedac('0x3'));var exec=require('child_process')[_0xedac('0x4')];var BPromise=require(_0xedac('0x5'));function handleEntityNotFound(_0x15d3bd,_0xefb142){return function(_0x5a97c0){if(!_0x5a97c0){_0x15d3bd[_0xedac('0x6')](0x194);;}return _0x5a97c0;};}function respondWithResult(_0x1cba89,_0x39328a){_0x39328a=_0x39328a||0xc8;return function(_0x5ecbd3){if(_0x5ecbd3){return _0x1cba89[_0xedac('0x7')](_0x39328a)[_0xedac('0x8')](_0x5ecbd3);}return null;};}function handleError(_0x162eea,_0x53fa43){_0x53fa43=_0x53fa43||0x1f4;return function(_0x27243f){logger[_0xedac('0x9')](_0x27243f[_0xedac('0xa')]);if(_0x27243f['name']){delete _0x27243f['name'];}_0x162eea[_0xedac('0x7')](_0x53fa43)[_0xedac('0xb')](_0x27243f);};}function execChildProcess(){return new BPromise(function(_0x57e1bf,_0x4d6a29){exec(_0xedac('0xc'),function(_0x25395d,_0x57f637,_0x261401){logger['info'](_0x57f637);logger[_0xedac('0xd')](_0x261401);if(_0x25395d){logger[_0xedac('0x9')](_0x25395d);return _0x4d6a29(_0x25395d);}return _0x57e1bf(_0x57f637);});});}exports[_0xedac('0xe')]=function(_0x342186,_0x9a79a0){return pm2[_0xedac('0xf')]()[_0xedac('0x10')](function(_0x11f0b0){if(_0x11f0b0){var _0x593030=_[_0xedac('0x11')](_0x11f0b0,function(_0x4651d4){return _0x4651d4[_0xedac('0x12')]===_0xedac('0x13')||_0x4651d4[_0xedac('0x12')]==='motion2';});return{'rows':_0x593030,'count':_0x593030[_0xedac('0x14')]};}return null;})['then'](respondWithResult(_0x9a79a0,null))[_0xedac('0x15')](handleError(_0x9a79a0,null));};exports[_0xedac('0x16')]=function(_0xdad128,_0xba0c93){return pm2['describe'](_0xdad128['params']['id'])[_0xedac('0x10')](respondWithResult(_0xba0c93,null))[_0xedac('0x10')](handleEntityNotFound(_0xba0c93,null))[_0xedac('0x15')](handleError(_0xba0c93,null));};exports[_0xedac('0x17')]=function(_0x5a5438,_0x4a699b){if(_0x5a5438[_0xedac('0x18')][_0xedac('0x12')]&&_0x5a5438[_0xedac('0x18')][_0xedac('0x19')]){var _0x2f5eee=path[_0xedac('0x1a')](__dirname,_0xedac('0x1b'),_0x5a5438[_0xedac('0x18')]['script']);var _0x4593e8=process['cwd']();process[_0xedac('0x1c')](path[_0xedac('0x1d')](_0x2f5eee));return execChildProcess()['then'](function(_0x46e09d){process[_0xedac('0x1c')](_0x4593e8);return pm2[_0xedac('0x1e')]({'name':_0x5a5438[_0xedac('0x18')][_0xedac('0x12')],'script':_0x2f5eee});})[_0xedac('0x10')](function(_0x5d7c31){pm2[_0xedac('0x1f')]();return _0x5d7c31[0x0];})[_0xedac('0x10')](respondWithResult(_0x4a699b,0xc9))[_0xedac('0x15')](handleError(_0x4a699b,null));}else{return _0x4a699b[_0xedac('0x7')](0x1f4)[_0xedac('0xb')]({'message':_0xedac('0x20')});}};exports[_0xedac('0x21')]=function(_0x26c6f7,_0x409825){if(_0x26c6f7[_0xedac('0x18')]['id']){delete _0x26c6f7['body']['id'];}var _0x25d7f5={'online':_0xedac('0x22'),'stopped':_0xedac('0x23')};if(_0x25d7f5['hasOwnProperty'](_0x26c6f7[_0xedac('0x18')]['status'])){return pm2[_0x25d7f5[_0x26c6f7['body'][_0xedac('0x7')]]](_0x26c6f7[_0xedac('0x24')]['id'])[_0xedac('0x10')](respondWithResult(_0x409825,0xc8))[_0xedac('0x15')](handleError(_0x409825,null));}else{return _0x409825['status'](0x1f4)['send']({'message':_0xedac('0x25')});}};exports[_0xedac('0x26')]=function(_0x24b182,_0x2ee8d7){if(_0x24b182[_0xedac('0x18')]['id']){delete _0x24b182[_0xedac('0x18')]['id'];}if(_0x24b182[_0xedac('0x24')]['id']){return pm2['delete'](_0x24b182[_0xedac('0x24')]['id'])[_0xedac('0x10')](function(_0x2cbe33){pm2['dump']();return _0x2cbe33[0x0];})[_0xedac('0x10')](respondWithResult(_0x2ee8d7,null))[_0xedac('0x15')](handleError(_0x2ee8d7,null));}else{return _0x2ee8d7['status'](0x1f4)[_0xedac('0xb')]({'message':_0xedac('0x27')});}};
\ No newline at end of file
+var _0xe205=['cwd','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','json','error','name','status','send','npm\x20install','info','index','list','reject','express','length','then','catch','show','describe','params','body','script'];(function(_0x21750a,_0x35ee25){var _0x3c391f=function(_0x16b047){while(--_0x16b047){_0x21750a['push'](_0x21750a['shift']());}};_0x3c391f(++_0x35ee25);}(_0xe205,0xa7));var _0x5e20=function(_0x19e9cc,_0x579907){_0x19e9cc=_0x19e9cc-0x0;var _0x47c240=_0xe205[_0x19e9cc];return _0x47c240;};'use strict';var _=require(_0x5e20('0x0'));var pm2=require(_0x5e20('0x1'));var logger=require(_0x5e20('0x2'))(_0x5e20('0x3'));var path=require(_0x5e20('0x4'));var exec=require(_0x5e20('0x5'))[_0x5e20('0x6')];var BPromise=require(_0x5e20('0x7'));function handleEntityNotFound(_0x37c5e9,_0x4ac934){return function(_0x1a6198){if(!_0x1a6198){_0x37c5e9[_0x5e20('0x8')](0x194);;}return _0x1a6198;};}function respondWithResult(_0x44dbb3,_0x3c4203){_0x3c4203=_0x3c4203||0xc8;return function(_0x5eca5c){if(_0x5eca5c){return _0x44dbb3['status'](_0x3c4203)[_0x5e20('0x9')](_0x5eca5c);}return null;};}function handleError(_0x4c9332,_0x533e18){_0x533e18=_0x533e18||0x1f4;return function(_0x30b757){logger[_0x5e20('0xa')](_0x30b757['stack']);if(_0x30b757[_0x5e20('0xb')]){delete _0x30b757[_0x5e20('0xb')];}_0x4c9332[_0x5e20('0xc')](_0x533e18)[_0x5e20('0xd')](_0x30b757);};}function execChildProcess(){return new BPromise(function(_0x5cb51d,_0x349613){exec(_0x5e20('0xe'),function(_0x270689,_0x27f1f9,_0x165824){logger[_0x5e20('0xf')](_0x27f1f9);logger['info'](_0x165824);if(_0x270689){logger[_0x5e20('0xa')](_0x270689);return _0x349613(_0x270689);}return _0x5cb51d(_0x27f1f9);});});}exports[_0x5e20('0x10')]=function(_0x22540d,_0x5868c0){return pm2[_0x5e20('0x11')]()['then'](function(_0x1f47f3){if(_0x1f47f3){var _0x5ba833=_[_0x5e20('0x12')](_0x1f47f3,function(_0x330cdf){return _0x330cdf[_0x5e20('0xb')]===_0x5e20('0x13')||_0x330cdf[_0x5e20('0xb')]==='motion2';});return{'rows':_0x5ba833,'count':_0x5ba833[_0x5e20('0x14')]};}return null;})[_0x5e20('0x15')](respondWithResult(_0x5868c0,null))[_0x5e20('0x16')](handleError(_0x5868c0,null));};exports[_0x5e20('0x17')]=function(_0x2f194b,_0x3b353f){return pm2[_0x5e20('0x18')](_0x2f194b[_0x5e20('0x19')]['id'])['then'](respondWithResult(_0x3b353f,null))[_0x5e20('0x15')](handleEntityNotFound(_0x3b353f,null))[_0x5e20('0x16')](handleError(_0x3b353f,null));};exports['create']=function(_0x295eb3,_0x1b1457){if(_0x295eb3[_0x5e20('0x1a')][_0x5e20('0xb')]&&_0x295eb3['body'][_0x5e20('0x1b')]){var _0x50f222=path['join'](__dirname,'../../files/plugins',_0x295eb3['body'][_0x5e20('0x1b')]);var _0x5cca90=process[_0x5e20('0x1c')]();process[_0x5e20('0x1d')](path[_0x5e20('0x1e')](_0x50f222));return execChildProcess()[_0x5e20('0x15')](function(_0x3ef7fa){process[_0x5e20('0x1d')](_0x5cca90);return pm2['start']({'name':_0x295eb3[_0x5e20('0x1a')]['name'],'script':_0x50f222});})['then'](function(_0x33993a){pm2[_0x5e20('0x1f')]();return _0x33993a[0x0];})[_0x5e20('0x15')](respondWithResult(_0x1b1457,0xc9))[_0x5e20('0x16')](handleError(_0x1b1457,null));}else{return _0x1b1457[_0x5e20('0xc')](0x1f4)[_0x5e20('0xd')]({'message':_0x5e20('0x20')});}};exports['update']=function(_0x3bf4f4,_0x420f63){if(_0x3bf4f4[_0x5e20('0x1a')]['id']){delete _0x3bf4f4[_0x5e20('0x1a')]['id'];}var _0x4c799d={'online':_0x5e20('0x21'),'stopped':_0x5e20('0x22')};if(_0x4c799d[_0x5e20('0x23')](_0x3bf4f4[_0x5e20('0x1a')][_0x5e20('0xc')])){return pm2[_0x4c799d[_0x3bf4f4[_0x5e20('0x1a')]['status']]](_0x3bf4f4[_0x5e20('0x19')]['id'])[_0x5e20('0x15')](respondWithResult(_0x420f63,0xc8))['catch'](handleError(_0x420f63,null));}else{return _0x420f63[_0x5e20('0xc')](0x1f4)[_0x5e20('0xd')]({'message':_0x5e20('0x24')});}};exports[_0x5e20('0x25')]=function(_0x1548c8,_0x395a27){if(_0x1548c8['body']['id']){delete _0x1548c8[_0x5e20('0x1a')]['id'];}if(_0x1548c8[_0x5e20('0x19')]['id']){return pm2[_0x5e20('0x26')](_0x1548c8[_0x5e20('0x19')]['id'])[_0x5e20('0x15')](function(_0x1ac162){pm2[_0x5e20('0x1f')]();return _0x1ac162[0x0];})[_0x5e20('0x15')](respondWithResult(_0x395a27,null))[_0x5e20('0x16')](handleError(_0x395a27,null));}else{return _0x395a27[_0x5e20('0xc')](0x1f4)[_0x5e20('0xd')]({'message':'Unknown\x20id'});}};
\ No newline at end of file
index bbd3d07..0357d27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a13=['get','/queues','isAuthenticated','getQueues','exports','express','Router','./realtime.controller'];(function(_0x482e60,_0x5b40b2){var _0x315451=function(_0x3c5195){while(--_0x3c5195){_0x482e60['push'](_0x482e60['shift']());}};_0x315451(++_0x5b40b2);}(_0x5a13,0x145));var _0x35a1=function(_0x48f7a8,_0x2664ba){_0x48f7a8=_0x48f7a8-0x0;var _0xbfa9e0=_0x5a13[_0x48f7a8];return _0xbfa9e0;};'use strict';var express=require(_0x35a1('0x0'));var router=express[_0x35a1('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x35a1('0x2'));router[_0x35a1('0x3')](_0x35a1('0x4'),auth[_0x35a1('0x5')](),controller[_0x35a1('0x6')]);module[_0x35a1('0x7')]=router;
\ No newline at end of file
+var _0x18f3=['Router','../../components/auth/service','./realtime.controller','isAuthenticated','exports'];(function(_0x301188,_0x51f6ed){var _0x4f79ad=function(_0x149363){while(--_0x149363){_0x301188['push'](_0x301188['shift']());}};_0x4f79ad(++_0x51f6ed);}(_0x18f3,0x19f));var _0x318f=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x18f3[_0x580576];return _0x3f55a0;};'use strict';var express=require('express');var router=express[_0x318f('0x0')]();var auth=require(_0x318f('0x1'));var controller=require(_0x318f('0x2'));router['get']('/queues',auth[_0x318f('0x3')](),controller['getQueues']);module[_0x318f('0x4')]=router;
\ No newline at end of file
index 8464841..db57d96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7046=['fieldName','type','key','user','role','userProfileId','outbound','QueueCampaigns','Queues','filter','UserProfile','findAndCountAll','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','waiting','talking','paused','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','map','loggedInDb','agents','find','merge','pick','online','getMembers','UserId','User','Pause','findAll','agent','length','all','util','lodash','jayson/promise','../../components/parsers/qs','api','../../mysqldb','client','http','offset','undefined','count','limit','status','Content-Range','json','error','stack','name','send','getQueues','mail','sms','openchannel','fax','whatsapp','voice','resolve','then','query','includes','channel','toLowerCase','Invalid\x20channel','startCase','Queue','rawAttributes'];(function(_0x27b49f,_0x5609d2){var _0x1b75c2=function(_0x4908ae){while(--_0x4908ae){_0x27b49f['push'](_0x27b49f['shift']());}};_0x1b75c2(++_0x5609d2);}(_0x7046,0x144));var _0x6704=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x7046[_0x4e676e];return _0x336a3c;};'use strict';var util=require(_0x6704('0x0'));var _=require(_0x6704('0x1'));var jayson=require(_0x6704('0x2'));var qs=require(_0x6704('0x3'));var logger=require('../../config/logger')(_0x6704('0x4'));var db=require(_0x6704('0x5'))['db'];var client=jayson[_0x6704('0x6')]['http']({'port':0x232a});var routingClient=jayson[_0x6704('0x6')][_0x6704('0x7')]({'port':0x232c});function respondWithFilteredResult(_0x3f4169,_0x626a14){return function(_0x2917be){if(_0x2917be){var _0x4badf8=typeof _0x626a14[_0x6704('0x8')]==='undefined'&&typeof _0x626a14['limit']===_0x6704('0x9');var _0x510221=_0x2917be['count'];var _0x3ca599=_0x4badf8?0x0:_0x626a14[_0x6704('0x8')];var _0x37a1ad=_0x4badf8?_0x2917be[_0x6704('0xa')]:_0x626a14[_0x6704('0x8')]+_0x626a14[_0x6704('0xb')];var _0x3dfda4;if(_0x37a1ad>=_0x510221){_0x37a1ad=_0x510221;_0x3dfda4=0xc8;}else{_0x3dfda4=0xce;}_0x3f4169[_0x6704('0xc')](_0x3dfda4);return _0x3f4169['set'](_0x6704('0xd'),_0x3ca599+'-'+_0x37a1ad+'/'+_0x510221)[_0x6704('0xe')](_0x2917be);}return null;};}function handleError(_0x575aa6,_0x2feb52){_0x2feb52=_0x2feb52||0x1f4;return function(_0x1db0ad){logger[_0x6704('0xf')](_0x1db0ad[_0x6704('0x10')]);if(_0x1db0ad[_0x6704('0x11')]){delete _0x1db0ad[_0x6704('0x11')];}_0x575aa6[_0x6704('0xc')](_0x2feb52)[_0x6704('0x12')](_0x1db0ad);};}exports[_0x6704('0x13')]=function(_0x49048f,_0x168258){var _0x1752bc=[_0x6704('0x14'),'chat',_0x6704('0x15'),_0x6704('0x16'),_0x6704('0x17'),_0x6704('0x18'),_0x6704('0x19')];var _0x5adb35={'count':0x0,'rows':[]},_0x1e5f6e={},_0x31d732;Promise[_0x6704('0x1a')]()[_0x6704('0x1b')](function(){if(_0x49048f[_0x6704('0x1c')]['channel']){if(!_[_0x6704('0x1d')](_0x1752bc,_0x49048f[_0x6704('0x1c')][_0x6704('0x1e')][_0x6704('0x1f')]()))throw new Error(_0x6704('0x20'));_0x31d732=_0x49048f[_0x6704('0x1c')][_0x6704('0x1e')]['toLowerCase']();}var _0x1df6d7=_[_0x6704('0x21')](_0x31d732)+_0x6704('0x22');var _0x59dc43=_['map'](db[_0x1df6d7][_0x6704('0x23')],function(_0x3e183b){return{'name':_0x3e183b[_0x6704('0x24')],'type':_0x3e183b[_0x6704('0x25')][_0x6704('0x26')]};});_0x1e5f6e=qs['getOptions'](_0x59dc43,_0x49048f);if(_0x49048f[_0x6704('0x27')][_0x6704('0x28')]===_0x6704('0x27')){var _0x348fcb={'params':{'id':_0x49048f[_0x6704('0x27')][_0x6704('0x29')]},'query':{'section':_0x31d732===_0x6704('0x19')&&_0x49048f[_0x6704('0x1c')][_0x6704('0x25')]===_0x6704('0x2a')?_0x6704('0x2b'):_[_0x6704('0x21')](_0x31d732)+_0x6704('0x2c'),'type':_0x49048f['query']['type'],'nolimit':!![],'sort':_0x6704('0x11'),'filter':_0x49048f[_0x6704('0x1c')][_0x6704('0x2d')]}};return db[_0x6704('0x2e')]['getResources'](_0x348fcb);}return db[_0x1df6d7][_0x6704('0x2f')](_0x1e5f6e);})[_0x6704('0x1b')](function(_0x5c229d){_0x5adb35['count']=_0x5c229d[_0x6704('0xa')];var _0x5363c9=_0x31d732===_0x6704('0x19')?client:routingClient;return _0x5363c9['request'](_['startCase'](_0x31d732)+_0x6704('0x2c'),_0x49048f)[_0x6704('0x1b')](function(_0x45a286){if(_0x45a286['error'])throw new Error(util[_0x6704('0x30')](_0x6704('0x31'),_0x31d732));var _0x3c8263=_0x45a286[_0x6704('0x32')];var _0x920914=[_0x6704('0x33'),_0x6704('0x34'),_0x6704('0x35'),_0x6704('0x36'),_0x6704('0x37')];if(_0x31d732===_0x6704('0x19')&&_0x49048f[_0x6704('0x1c')][_0x6704('0x25')]===_0x6704('0x2a')){_0x920914[_0x6704('0x38')](_0x6704('0x39'),_0x6704('0x3a'),_0x6704('0x3b'),_0x6704('0x3c'),_0x6704('0x3d'),_0x6704('0x3e'),_0x6704('0x3f'),_0x6704('0x40'),_0x6704('0x41'),_0x6704('0x42'),'erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval',_0x6704('0x43'),_0x6704('0x44'),_0x6704('0x45'),'predictiveIntervalTotalCalls',_0x6704('0x46'),'predictiveIntervalDroppedCallsTimeout',_0x6704('0x47'),_0x6704('0x48'),_0x6704('0x49'));}var _0x18a118=_0x5c229d[_0x6704('0x4a')][_0x6704('0x4b')](function(_0x39d92c){var _0x2fba31=_0x39d92c['get']({'plain':!![]});_0x2fba31['paused']=0x0;_0x2fba31[_0x6704('0x4c')]=0x0;_0x2fba31[_0x6704('0x33')]=0x0;_0x2fba31['available']=0x0;_0x2fba31['paused']=0x0;_0x2fba31[_0x6704('0x35')]=0x0;if(_0x31d732==='voice'){_0x2fba31[_0x6704('0x36')]=0x0;if(_0x49048f[_0x6704('0x1c')][_0x6704('0x25')]===_0x6704('0x2a')){_0x2fba31['pTalking']=0x0;_0x2fba31[_0x6704('0x3a')]=0x0;}}_0x2fba31[_0x6704('0x4d')]=[];var _0x5630b7=_[_0x6704('0x4e')](_0x3c8263['rows'],['id',_0x2fba31['id']]);if(_0x5630b7)_[_0x6704('0x4f')](_0x2fba31,_[_0x6704('0x50')](_0x5630b7,_0x920914));if(_0x31d732===_0x6704('0x19')){return _0x39d92c['getAgents']({'attributes':['id',_0x6704('0x11'),_0x6704('0x51')],'joinTableAttributes':[],'raw':!![]})[_0x6704('0x1b')](function(_0x5c04fe){return _0x39d92c[_0x6704('0x52')]({'raw':!![]})[_0x6704('0x1b')](function(_0x336ef2){for(var _0xf12c3f=0x0;_0xf12c3f<_0x5c04fe['length'];_0xf12c3f++){var _0x29ad03=_['find'](_0x336ef2,[_0x6704('0x53'),_0x5c04fe[_0xf12c3f]['id']]);var _0x45a217={'id':_0x5c04fe[_0xf12c3f]['id'],'name':_0x5c04fe[_0xf12c3f][_0x6704('0x11')],'online':Boolean(_0x5c04fe[_0xf12c3f][_0x6704('0x51')]),'paused':_0x29ad03?Boolean(_0x29ad03['paused']):![]};if(_0x45a217['online'])_0x2fba31['loggedInDb']++;if(_0x45a217[_0x6704('0x37')])_0x2fba31['paused']++;_0x2fba31[_0x6704('0x4d')]['push'](_0x45a217);}return _0x2fba31;});});}else{var _0x3e8e48=_0x6704('0x54')+_['startCase'](_0x31d732)+_0x6704('0x22');var _0x19ddb9=_0x31d732+_0x6704('0x55');return db[_0x3e8e48][_0x6704('0x56')]({'where':{[_[_0x6704('0x21')](_0x31d732)+'QueueId']:_0x39d92c['id']},'raw':!![]})[_0x6704('0x1b')](function(_0x4ff7a8){return db[_0x6704('0x54')][_0x6704('0x56')]({'attributes':['id',_0x6704('0x11'),'online',_0x19ddb9],'where':{'id':_[_0x6704('0x4b')](_0x4ff7a8,'UserId'),'role':_0x6704('0x57')},'raw':!![]});})[_0x6704('0x1b')](function(_0x2ee518){for(var _0x207595=0x0;_0x207595<_0x2ee518[_0x6704('0x58')];_0x207595++){var _0x50f5da={'id':_0x2ee518[_0x207595]['id'],'name':_0x2ee518[_0x207595][_0x6704('0x11')],'online':Boolean(_0x2ee518[_0x207595][_0x6704('0x51')]),'paused':Boolean(_0x2ee518[_0x207595][_0x19ddb9])};if(_0x50f5da['online'])_0x2fba31[_0x6704('0x4c')]++;if(_0x50f5da[_0x6704('0x37')])_0x2fba31[_0x6704('0x37')]++;_0x2fba31[_0x6704('0x4d')][_0x6704('0x38')](_0x50f5da);}return _0x2fba31;});}});return Promise[_0x6704('0x59')](_0x18a118);});})['then'](function(_0x237f59){_0x5adb35['rows']=_0x237f59;return _0x5adb35;})[_0x6704('0x1b')](respondWithFilteredResult(_0x168258,_0x1e5f6e))['catch'](handleError(_0x168258,null));};
\ No newline at end of file
+var _0x77d4=['lodash','../../components/parsers/qs','api','../../mysqldb','client','http','limit','count','offset','status','set','json','error','stack','name','mail','chat','openchannel','fax','whatsapp','voice','resolve','then','query','channel','includes','toLowerCase','startCase','Queue','map','rawAttributes','fieldName','type','key','getOptions','role','user','userProfileId','outbound','QueueCampaigns','filter','UserProfile','getResources','findAndCountAll','request','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','waiting','talking','paused','push','pTalking','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','rows','originated','agents','find','pick','getMembers','length','online','Pause','findAll','User','UserId','agent','loggedInDb','all','catch'];(function(_0x224f65,_0x4750bf){var _0x3f921c=function(_0x1b5f64){while(--_0x1b5f64){_0x224f65['push'](_0x224f65['shift']());}};_0x3f921c(++_0x4750bf);}(_0x77d4,0x108));var _0x477d=function(_0x4883c8,_0x1281a3){_0x4883c8=_0x4883c8-0x0;var _0x3a404b=_0x77d4[_0x4883c8];return _0x3a404b;};'use strict';var util=require('util');var _=require(_0x477d('0x0'));var jayson=require('jayson/promise');var qs=require(_0x477d('0x1'));var logger=require('../../config/logger')(_0x477d('0x2'));var db=require(_0x477d('0x3'))['db'];var client=jayson['client']['http']({'port':0x232a});var routingClient=jayson[_0x477d('0x4')][_0x477d('0x5')]({'port':0x232c});function respondWithFilteredResult(_0x3d2f8d,_0x471fca){return function(_0x2545e5){if(_0x2545e5){var _0x45ca2d=typeof _0x471fca['offset']==='undefined'&&typeof _0x471fca[_0x477d('0x6')]==='undefined';var _0x5da70c=_0x2545e5[_0x477d('0x7')];var _0x29f11b=_0x45ca2d?0x0:_0x471fca[_0x477d('0x8')];var _0x2c326c=_0x45ca2d?_0x2545e5[_0x477d('0x7')]:_0x471fca['offset']+_0x471fca[_0x477d('0x6')];var _0x4f11bc;if(_0x2c326c>=_0x5da70c){_0x2c326c=_0x5da70c;_0x4f11bc=0xc8;}else{_0x4f11bc=0xce;}_0x3d2f8d[_0x477d('0x9')](_0x4f11bc);return _0x3d2f8d[_0x477d('0xa')]('Content-Range',_0x29f11b+'-'+_0x2c326c+'/'+_0x5da70c)[_0x477d('0xb')](_0x2545e5);}return null;};}function handleError(_0x3d362a,_0x5a190c){_0x5a190c=_0x5a190c||0x1f4;return function(_0x5dd33c){logger[_0x477d('0xc')](_0x5dd33c[_0x477d('0xd')]);if(_0x5dd33c['name']){delete _0x5dd33c[_0x477d('0xe')];}_0x3d362a[_0x477d('0x9')](_0x5a190c)['send'](_0x5dd33c);};}exports['getQueues']=function(_0x38a0a8,_0x4bbfef){var _0x30481f=[_0x477d('0xf'),_0x477d('0x10'),'sms',_0x477d('0x11'),_0x477d('0x12'),_0x477d('0x13'),_0x477d('0x14')];var _0x57b38e={'count':0x0,'rows':[]},_0x28f17a={},_0x5d5553;Promise[_0x477d('0x15')]()[_0x477d('0x16')](function(){if(_0x38a0a8[_0x477d('0x17')][_0x477d('0x18')]){if(!_[_0x477d('0x19')](_0x30481f,_0x38a0a8[_0x477d('0x17')]['channel'][_0x477d('0x1a')]()))throw new Error('Invalid\x20channel');_0x5d5553=_0x38a0a8[_0x477d('0x17')][_0x477d('0x18')][_0x477d('0x1a')]();}var _0x14cbd5=_[_0x477d('0x1b')](_0x5d5553)+_0x477d('0x1c');var _0x435a3b=_[_0x477d('0x1d')](db[_0x14cbd5][_0x477d('0x1e')],function(_0x5981a){return{'name':_0x5981a[_0x477d('0x1f')],'type':_0x5981a[_0x477d('0x20')][_0x477d('0x21')]};});_0x28f17a=qs[_0x477d('0x22')](_0x435a3b,_0x38a0a8);if(_0x38a0a8['user'][_0x477d('0x23')]==='user'){var _0x239b56={'params':{'id':_0x38a0a8[_0x477d('0x24')][_0x477d('0x25')]},'query':{'section':_0x5d5553===_0x477d('0x14')&&_0x38a0a8['query'][_0x477d('0x20')]===_0x477d('0x26')?_0x477d('0x27'):_['startCase'](_0x5d5553)+'Queues','type':_0x38a0a8[_0x477d('0x17')][_0x477d('0x20')],'nolimit':!![],'sort':_0x477d('0xe'),'filter':_0x38a0a8['query'][_0x477d('0x28')]}};return db[_0x477d('0x29')][_0x477d('0x2a')](_0x239b56);}return db[_0x14cbd5][_0x477d('0x2b')](_0x28f17a);})[_0x477d('0x16')](function(_0x537fc4){_0x57b38e[_0x477d('0x7')]=_0x537fc4[_0x477d('0x7')];var _0x17dd16=_0x5d5553===_0x477d('0x14')?client:routingClient;return _0x17dd16[_0x477d('0x2c')](_[_0x477d('0x1b')](_0x5d5553)+_0x477d('0x2d'),_0x38a0a8)[_0x477d('0x16')](function(_0x204541){if(_0x204541[_0x477d('0xc')])throw new Error(util[_0x477d('0x2e')](_0x477d('0x2f'),_0x5d5553));var _0x138c6d=_0x204541[_0x477d('0x30')];var _0x16042d=[_0x477d('0x31'),_0x477d('0x32'),_0x477d('0x33'),_0x477d('0x34'),_0x477d('0x35')];if(_0x5d5553==='voice'&&_0x38a0a8[_0x477d('0x17')]['type']===_0x477d('0x26')){_0x16042d[_0x477d('0x36')](_0x477d('0x37'),'originated',_0x477d('0x38'),_0x477d('0x39'),_0x477d('0x3a'),_0x477d('0x3b'),_0x477d('0x3c'),_0x477d('0x3d'),_0x477d('0x3e'),_0x477d('0x3f'),_0x477d('0x40'),_0x477d('0x41'),'dialPredictiveInterval',_0x477d('0x42'),_0x477d('0x43'),_0x477d('0x44'),'predictiveIntervalTotalCalls',_0x477d('0x45'),_0x477d('0x46'),_0x477d('0x47'),'predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime');}var _0x21de5c=_0x537fc4[_0x477d('0x48')][_0x477d('0x1d')](function(_0x13ac50){var _0x1c0d86=_0x13ac50['get']({'plain':!![]});_0x1c0d86[_0x477d('0x35')]=0x0;_0x1c0d86['loggedInDb']=0x0;_0x1c0d86[_0x477d('0x31')]=0x0;_0x1c0d86[_0x477d('0x32')]=0x0;_0x1c0d86[_0x477d('0x35')]=0x0;_0x1c0d86['waiting']=0x0;if(_0x5d5553==='voice'){_0x1c0d86[_0x477d('0x34')]=0x0;if(_0x38a0a8[_0x477d('0x17')][_0x477d('0x20')]===_0x477d('0x26')){_0x1c0d86['pTalking']=0x0;_0x1c0d86[_0x477d('0x49')]=0x0;}}_0x1c0d86[_0x477d('0x4a')]=[];var _0x40fdc0=_[_0x477d('0x4b')](_0x138c6d[_0x477d('0x48')],['id',_0x1c0d86['id']]);if(_0x40fdc0)_['merge'](_0x1c0d86,_[_0x477d('0x4c')](_0x40fdc0,_0x16042d));if(_0x5d5553===_0x477d('0x14')){return _0x13ac50['getAgents']({'attributes':['id',_0x477d('0xe'),'online'],'joinTableAttributes':[],'raw':!![]})[_0x477d('0x16')](function(_0x7a5a47){return _0x13ac50[_0x477d('0x4d')]({'raw':!![]})[_0x477d('0x16')](function(_0x1f9552){for(var _0x10bbed=0x0;_0x10bbed<_0x7a5a47[_0x477d('0x4e')];_0x10bbed++){var _0xb94247=_[_0x477d('0x4b')](_0x1f9552,['UserId',_0x7a5a47[_0x10bbed]['id']]);var _0x5759f={'id':_0x7a5a47[_0x10bbed]['id'],'name':_0x7a5a47[_0x10bbed][_0x477d('0xe')],'online':Boolean(_0x7a5a47[_0x10bbed][_0x477d('0x4f')]),'paused':_0xb94247?Boolean(_0xb94247[_0x477d('0x35')]):![]};if(_0x5759f['online'])_0x1c0d86['loggedInDb']++;if(_0x5759f[_0x477d('0x35')])_0x1c0d86[_0x477d('0x35')]++;_0x1c0d86['agents'][_0x477d('0x36')](_0x5759f);}return _0x1c0d86;});});}else{var _0x4fb6f5='User'+_[_0x477d('0x1b')](_0x5d5553)+_0x477d('0x1c');var _0x133b81=_0x5d5553+_0x477d('0x50');return db[_0x4fb6f5][_0x477d('0x51')]({'where':{[_[_0x477d('0x1b')](_0x5d5553)+'QueueId']:_0x13ac50['id']},'raw':!![]})[_0x477d('0x16')](function(_0xed1fb2){return db[_0x477d('0x52')][_0x477d('0x51')]({'attributes':['id',_0x477d('0xe'),'online',_0x133b81],'where':{'id':_['map'](_0xed1fb2,_0x477d('0x53')),'role':_0x477d('0x54')},'raw':!![]});})[_0x477d('0x16')](function(_0x59dc4c){for(var _0x45a5da=0x0;_0x45a5da<_0x59dc4c[_0x477d('0x4e')];_0x45a5da++){var _0x3154da={'id':_0x59dc4c[_0x45a5da]['id'],'name':_0x59dc4c[_0x45a5da][_0x477d('0xe')],'online':Boolean(_0x59dc4c[_0x45a5da][_0x477d('0x4f')]),'paused':Boolean(_0x59dc4c[_0x45a5da][_0x133b81])};if(_0x3154da[_0x477d('0x4f')])_0x1c0d86[_0x477d('0x55')]++;if(_0x3154da['paused'])_0x1c0d86[_0x477d('0x35')]++;_0x1c0d86[_0x477d('0x4a')][_0x477d('0x36')](_0x3154da);}return _0x1c0d86;});}});return Promise[_0x477d('0x56')](_0x21de5c);});})[_0x477d('0x16')](function(_0x32b430){_0x57b38e[_0x477d('0x48')]=_0x32b430;return _0x57b38e;})[_0x477d('0x16')](respondWithFilteredResult(_0x4bbfef,_0x28f17a))[_0x477d('0x57')](handleError(_0x4bbfef,null));};
\ No newline at end of file
index 43a02b1..8e4a70e 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(_0x3468d3,_0x5f0f55){var _0x549184=function(_0x11c8a1){while(--_0x11c8a1){_0x3468d3['push'](_0x3468d3['shift']());}};_0x549184(++_0x5f0f55);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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(_0x597f88,_0x338c40){var _0x1ac48a=function(_0x20b20c){while(--_0x20b20c){_0x597f88['push'](_0x597f88['shift']());}};_0x1ac48a(++_0x338c40);}(_0xe706,0xa3));var _0x6e70=function(_0x5aa3e3,_0x5559be){_0x5aa3e3=_0x5aa3e3-0x0;var _0x31f5b9=_0xe706[_0x5aa3e3];return _0x31f5b9;};'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 6af8255..c5b80ad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9fe7=['exports','STRING','DATE','sequelize'];(function(_0x2237e6,_0x28cb0c){var _0x42124e=function(_0x55b6e3){while(--_0x55b6e3){_0x2237e6['push'](_0x2237e6['shift']());}};_0x42124e(++_0x28cb0c);}(_0x9fe7,0x1df));var _0x79fe=function(_0x281022,_0x39a6fe){_0x281022=_0x281022-0x0;var _0x544fd6=_0x9fe7[_0x281022];return _0x544fd6;};'use strict';var Sequelize=require(_0x79fe('0x0'));module[_0x79fe('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x79fe('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x79fe('0x2')]},'starttime':{'type':Sequelize[_0x79fe('0x3')]},'responsetime':{'type':Sequelize[_0x79fe('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x79fe('0x2')]},'campaigntype':{'type':Sequelize[_0x79fe('0x2')]},'membername':{'type':Sequelize[_0x79fe('0x2')]}};
\ No newline at end of file
+var _0xb2ac=['STRING','DATE','sequelize','exports','INTEGER'];(function(_0x5735c6,_0x3d5b17){var _0x180e61=function(_0x5250fa){while(--_0x5250fa){_0x5735c6['push'](_0x5735c6['shift']());}};_0x180e61(++_0x3d5b17);}(_0xb2ac,0x16a));var _0xcb2a=function(_0x3ee215,_0x3aca45){_0x3ee215=_0x3ee215-0x0;var _0x21a808=_0xb2ac[_0x3ee215];return _0x21a808;};'use strict';var Sequelize=require(_0xcb2a('0x0'));module[_0xcb2a('0x1')]={'state':{'type':Sequelize[_0xcb2a('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xcb2a('0x3')]},'scheduledat':{'type':Sequelize[_0xcb2a('0x4')]},'uniqueid':{'type':Sequelize[_0xcb2a('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xcb2a('0x4')]},'ringtime':{'type':Sequelize[_0xcb2a('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xcb2a('0x3')]},'campaigntype':{'type':Sequelize[_0xcb2a('0x3')]},'membername':{'type':Sequelize[_0xcb2a('0x3')]}};
\ No newline at end of file
index 541ed32..49b478c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe315=['api','moment','bluebird','request-promise','path','rimraf','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger'];(function(_0x9ae99e,_0x2ac9e7){var _0x281db5=function(_0x44f834){while(--_0x44f834){_0x9ae99e['push'](_0x9ae99e['shift']());}};_0x281db5(++_0x2ac9e7);}(_0xe315,0xdd));var _0x5e31=function(_0x630504,_0x12ec6e){_0x630504=_0x630504-0x0;var _0x41c7d0=_0xe315[_0x630504];return _0x41c7d0;};'use strict';var _=require(_0x5e31('0x0'));var util=require(_0x5e31('0x1'));var logger=require(_0x5e31('0x2'))(_0x5e31('0x3'));var moment=require(_0x5e31('0x4'));var BPromise=require(_0x5e31('0x5'));var rp=require(_0x5e31('0x6'));var fs=require('fs');var path=require(_0x5e31('0x7'));var rimraf=require(_0x5e31('0x8'));var config=require('../../config/environment');var attributes=require(_0x5e31('0x9'));module[_0x5e31('0xa')]=function(_0x47de8a,_0xcaba59){return _0x47de8a[_0x5e31('0xb')](_0x5e31('0xc'),attributes,{'tableName':_0x5e31('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa30c=['api','moment','bluebird','request-promise','path','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa30c,0x10e));var _0xca30=function(_0x20d52c,_0x4bf9a7){_0x20d52c=_0x20d52c-0x0;var _0x5f253e=_0xa30c[_0x20d52c];return _0x5f253e;};'use strict';var _=require(_0xca30('0x0'));var util=require(_0xca30('0x1'));var logger=require(_0xca30('0x2'))(_0xca30('0x3'));var moment=require(_0xca30('0x4'));var BPromise=require(_0xca30('0x5'));var rp=require(_0xca30('0x6'));var fs=require('fs');var path=require(_0xca30('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xca30('0x8'));module[_0xca30('0x9')]=function(_0x1f226b,_0x558e9f){return _0x1f226b[_0xca30('0xa')](_0xca30('0xb'),attributes,{'tableName':_0xca30('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ccd3d9f..f53d53b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc345=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','ReportAgentPreview,\x20%s,\x20%s','message','request\x20sent','result','catch','ReportAgentPreview','create','options','CreateReportAgentPreview','lodash','moment','bluebird','../../mysqldb'];(function(_0x4a21d4,_0x10963d){var _0x469f78=function(_0x1a0d75){while(--_0x1a0d75){_0x4a21d4['push'](_0x4a21d4['shift']());}};_0x469f78(++_0x10963d);}(_0xc345,0x173));var _0x5c34=function(_0x1cfba1,_0xceafc){_0x1cfba1=_0x1cfba1-0x0;var _0x4fd6aa=_0xc345[_0x1cfba1];return _0x4fd6aa;};'use strict';var _=require(_0x5c34('0x0'));var util=require('util');var moment=require(_0x5c34('0x1'));var BPromise=require(_0x5c34('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5c34('0x3'))['db'];var utils=require(_0x5c34('0x4'));var logger=require(_0x5c34('0x5'))(_0x5c34('0x6'));var config=require(_0x5c34('0x7'));var jayson=require(_0x5c34('0x8'));var client=jayson['client'][_0x5c34('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27b35f,_0x45a182,_0x28b4aa){return new BPromise(function(_0x8d3329,_0x207ab5){return client[_0x5c34('0xa')](_0x27b35f,_0x28b4aa)[_0x5c34('0xb')](function(_0x4b7381){logger[_0x5c34('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x45a182,'request\x20sent');logger['debug'](_0x5c34('0xd'),_0x45a182,'request\x20sent',JSON[_0x5c34('0xe')](_0x4b7381));if(_0x4b7381[_0x5c34('0xf')]){if(_0x4b7381[_0x5c34('0xf')]['code']===0x1f4){logger[_0x5c34('0xf')](_0x5c34('0x10'),_0x45a182,_0x4b7381[_0x5c34('0xf')][_0x5c34('0x11')]);return _0x207ab5(_0x4b7381['error'][_0x5c34('0x11')]);}logger[_0x5c34('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x45a182,_0x4b7381['error']['message']);return _0x8d3329(_0x4b7381[_0x5c34('0xf')][_0x5c34('0x11')]);}else{logger[_0x5c34('0xc')]('ReportAgentPreview,\x20%s,\x20%s',_0x45a182,_0x5c34('0x12'));_0x8d3329(_0x4b7381[_0x5c34('0x13')][_0x5c34('0x11')]);}})[_0x5c34('0x14')](function(_0x496d68){logger[_0x5c34('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x45a182,_0x496d68);_0x207ab5(_0x496d68);});});}exports['CreateReportAgentPreview']=function(_0x40be64){var _0x299fbb=this;return new Promise(function(_0x53c302,_0xc19d3a){return db[_0x5c34('0x15')][_0x5c34('0x16')](_0x40be64['body'],{'raw':_0x40be64[_0x5c34('0x17')]?_0x40be64['options']['raw']===undefined?!![]:![]:!![]})[_0x5c34('0xb')](function(_0x353794){logger[_0x5c34('0xc')]('CreateReportAgentPreview',_0x40be64);logger['debug'](_0x5c34('0x18'),_0x40be64,JSON[_0x5c34('0xe')](_0x353794));_0x53c302(_0x353794);})[_0x5c34('0x14')](function(_0x3c8c7e){logger[_0x5c34('0xf')](_0x5c34('0x18'),_0x3c8c7e[_0x5c34('0x11')],_0x40be64);_0xc19d3a(_0x299fbb[_0x5c34('0xf')](0x1f4,_0x3c8c7e['message']));});});};
\ No newline at end of file
+var _0x5122=['../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','then','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0xae3f70,_0x559b2a){var _0x1593e9=function(_0x1fd717){while(--_0x1fd717){_0xae3f70['push'](_0xae3f70['shift']());}};_0x1593e9(++_0x559b2a);}(_0x5122,0x12f));var _0x2512=function(_0x89e913,_0x2273e2){_0x89e913=_0x89e913-0x0;var _0x1e2d4c=_0x5122[_0x89e913];return _0x1e2d4c;};'use strict';var _=require(_0x2512('0x0'));var util=require('util');var moment=require(_0x2512('0x1'));var BPromise=require(_0x2512('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2512('0x3'));var db=require(_0x2512('0x4'))['db'];var utils=require(_0x2512('0x5'));var logger=require('../../config/logger')(_0x2512('0x6'));var config=require(_0x2512('0x7'));var jayson=require(_0x2512('0x8'));var client=jayson[_0x2512('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c17e6,_0x3a9830,_0x315800){return new BPromise(function(_0x586082,_0x12fef8){return client[_0x2512('0xa')](_0x5c17e6,_0x315800)['then'](function(_0x2ae87b){logger[_0x2512('0xb')](_0x2512('0xc'),_0x3a9830,_0x2512('0xd'));logger[_0x2512('0xe')](_0x2512('0xf'),_0x3a9830,_0x2512('0xd'),JSON['stringify'](_0x2ae87b));if(_0x2ae87b['error']){if(_0x2ae87b['error'][_0x2512('0x10')]===0x1f4){logger[_0x2512('0x11')](_0x2512('0xc'),_0x3a9830,_0x2ae87b[_0x2512('0x11')][_0x2512('0x12')]);return _0x12fef8(_0x2ae87b[_0x2512('0x11')][_0x2512('0x12')]);}logger[_0x2512('0x11')](_0x2512('0xc'),_0x3a9830,_0x2ae87b['error'][_0x2512('0x12')]);return _0x586082(_0x2ae87b['error'][_0x2512('0x12')]);}else{logger[_0x2512('0xb')](_0x2512('0xc'),_0x3a9830,_0x2512('0xd'));_0x586082(_0x2ae87b[_0x2512('0x13')][_0x2512('0x12')]);}})[_0x2512('0x14')](function(_0xa3c987){logger[_0x2512('0x11')]('ReportAgentPreview,\x20%s,\x20%s',_0x3a9830,_0xa3c987);_0x12fef8(_0xa3c987);});});}exports[_0x2512('0x15')]=function(_0x34f2c3){var _0x2ab6b8=this;return new Promise(function(_0x42f36f,_0x56149a){return db[_0x2512('0x16')][_0x2512('0x17')](_0x34f2c3[_0x2512('0x18')],{'raw':_0x34f2c3[_0x2512('0x19')]?_0x34f2c3[_0x2512('0x19')][_0x2512('0x1a')]===undefined?!![]:![]:!![]})[_0x2512('0x1b')](function(_0x27a5d6){logger[_0x2512('0xb')]('CreateReportAgentPreview',_0x34f2c3);logger['debug'](_0x2512('0x15'),_0x34f2c3,JSON['stringify'](_0x27a5d6));_0x42f36f(_0x27a5d6);})[_0x2512('0x14')](function(_0x3e6a9e){logger['error'](_0x2512('0x15'),_0x3e6a9e[_0x2512('0x12')],_0x34f2c3);_0x56149a(_0x2ab6b8[_0x2512('0x11')](0x1f4,_0x3e6a9e[_0x2512('0x12')]));});});};
\ No newline at end of file
index f2243bf..fc62061 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96d2=['/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','/chat/queues/:id/notify','chat','showChatQueues','fax','/fax/queues/:id','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','multer','path','express','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','voiceQueues','/chat/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','/outbound','outbound','/outbound/channels','outboundChannels','agents','/agents/:id/capacity','/telephones','telephones','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts'];(function(_0x573542,_0x415977){var _0x27834b=function(_0xbfdf8d){while(--_0xbfdf8d){_0x573542['push'](_0x573542['shift']());}};_0x27834b(++_0x415977);}(_0x96d2,0x10d));var _0x296d=function(_0x479509,_0x1daf8a){_0x479509=_0x479509-0x0;var _0x382da8=_0x96d2[_0x479509];return _0x382da8;};'use strict';var multer=require(_0x296d('0x0'));var util=require('util');var path=require(_0x296d('0x1'));var express=require(_0x296d('0x2'));var router=express['Router']();var auth=require(_0x296d('0x3'));var controller=require(_0x296d('0x4'));router[_0x296d('0x5')](_0x296d('0x6'),auth[_0x296d('0x7')](),controller[_0x296d('0x8')]);router[_0x296d('0x5')](_0x296d('0x9'),auth[_0x296d('0x7')](),controller['voiceChannelMixMonitor']);router[_0x296d('0x5')](_0x296d('0xa'),auth['isAuthenticated'](),controller[_0x296d('0xb')]);router[_0x296d('0x5')]('/voice/queues',auth[_0x296d('0x7')](),controller[_0x296d('0xc')]);router['get'](_0x296d('0xd'),auth[_0x296d('0x7')](),controller['chatQueues']);router[_0x296d('0x5')]('/mail/queues',auth[_0x296d('0x7')](),controller[_0x296d('0xe')]);router[_0x296d('0x5')](_0x296d('0xf'),auth[_0x296d('0x7')](),controller[_0x296d('0x10')]);router[_0x296d('0x5')](_0x296d('0x11'),auth[_0x296d('0x7')](),controller[_0x296d('0x12')]);router[_0x296d('0x5')](_0x296d('0x13'),auth[_0x296d('0x7')](),controller[_0x296d('0x14')]);router['get'](_0x296d('0x15'),auth[_0x296d('0x7')](),controller[_0x296d('0x16')]);router[_0x296d('0x5')](_0x296d('0x17'),auth[_0x296d('0x7')](),controller['faxQueues']);router[_0x296d('0x5')](_0x296d('0x18'),auth[_0x296d('0x7')](),controller[_0x296d('0x19')]);router[_0x296d('0x5')](_0x296d('0x1a'),auth['isAuthenticated'](),controller[_0x296d('0x1b')]);router[_0x296d('0x5')](_0x296d('0x1c'),auth['isAuthenticated'](),controller[_0x296d('0x1d')]);router[_0x296d('0x5')](_0x296d('0x1e'),auth[_0x296d('0x7')](),controller[_0x296d('0x1f')]);router[_0x296d('0x5')](_0x296d('0x20'),auth[_0x296d('0x7')](),controller[_0x296d('0x21')]);router['get'](_0x296d('0x22'),auth[_0x296d('0x7')](),controller[_0x296d('0x23')]);router[_0x296d('0x24')](_0x296d('0x22'),auth[_0x296d('0x7')](),controller[_0x296d('0x25')]);router['get'](_0x296d('0x26'),auth[_0x296d('0x7')](),controller[_0x296d('0x27')]);router[_0x296d('0x5')](_0x296d('0x28'),auth[_0x296d('0x7')](),controller[_0x296d('0x29')]);router[_0x296d('0x5')]('/agents',auth[_0x296d('0x7')](),controller[_0x296d('0x2a')]);router[_0x296d('0x24')](_0x296d('0x2b'),auth[_0x296d('0x7')](),controller['agentCapacity']);router[_0x296d('0x5')](_0x296d('0x2c'),auth['isAuthenticated'](),controller[_0x296d('0x2d')]);router[_0x296d('0x5')]('/trunks',auth['isAuthenticated'](),controller[_0x296d('0x2e')]);router[_0x296d('0x5')](_0x296d('0x2f'),auth[_0x296d('0x7')](),controller[_0x296d('0x30')]);router[_0x296d('0x5')](_0x296d('0x31'),auth[_0x296d('0x7')](),controller[_0x296d('0x32')]);router[_0x296d('0x5')](_0x296d('0x33'),auth[_0x296d('0x7')](),controller['chatQueuesWaitingInteractions']);router[_0x296d('0x5')](_0x296d('0x34'),auth[_0x296d('0x7')](),controller['mailQueuesWaitingInteractions']);router[_0x296d('0x5')](_0x296d('0x35'),auth[_0x296d('0x7')](),controller[_0x296d('0x36')]);router['get'](_0x296d('0x37'),auth['isAuthenticated'](),controller[_0x296d('0x38')]);router[_0x296d('0x5')]('/sms/queues/waitinginteractions',auth[_0x296d('0x7')](),controller['smsQueuesWaitingInteractions']);router[_0x296d('0x5')](_0x296d('0x39'),auth[_0x296d('0x7')](),controller[_0x296d('0x3a')]);router[_0x296d('0x5')](_0x296d('0x3b'),auth[_0x296d('0x7')](),controller[_0x296d('0x3c')]);router[_0x296d('0x3d')](_0x296d('0x3e'),auth[_0x296d('0x7')](),controller[_0x296d('0x3f')]('mail'));router['get'](_0x296d('0x40'),auth['isAuthenticated'](),controller['showMailQueues']);router[_0x296d('0x3d')](_0x296d('0x41'),auth[_0x296d('0x7')](),controller[_0x296d('0x3f')](_0x296d('0x42')));router['get']('/chat/queues/:id',auth[_0x296d('0x7')](),controller[_0x296d('0x43')]);router[_0x296d('0x3d')]('/fax/queues/:id/notify',auth['isAuthenticated'](),controller['queueNotify'](_0x296d('0x44')));router[_0x296d('0x5')](_0x296d('0x45'),auth[_0x296d('0x7')](),controller['showFaxQueues']);router[_0x296d('0x3d')]('/openchannel/queues/:id/notify',auth[_0x296d('0x7')](),controller[_0x296d('0x3f')](_0x296d('0x46')));router[_0x296d('0x5')](_0x296d('0x47'),auth[_0x296d('0x7')](),controller[_0x296d('0x48')]);router[_0x296d('0x3d')](_0x296d('0x49'),auth[_0x296d('0x7')](),controller[_0x296d('0x3f')]('sms'));router[_0x296d('0x3d')](_0x296d('0x4a'),auth['isAuthenticated'](),controller[_0x296d('0x3f')]('whatsapp'));router[_0x296d('0x5')]('/sms/queues/:id',auth[_0x296d('0x7')](),controller[_0x296d('0x4b')]);router[_0x296d('0x5')](_0x296d('0x4c'),auth[_0x296d('0x7')](),controller['showWhatsappQueues']);router['post'](_0x296d('0x4d'),auth[_0x296d('0x7')](),controller[_0x296d('0x4e')]);module[_0x296d('0x4f')]=router;
\ No newline at end of file
+var _0x16bc=['faxQueues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','updateVoiceQueue','outbound','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','/sms/queues/:id/notify','/whatsapp/queues/:id/notify','whatsapp','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','multer','path','../../components/auth/service','./rpc.controller','/voice/channels','isAuthenticated','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues'];(function(_0x62c995,_0x4ffac5){var _0x5e6f75=function(_0xf645b3){while(--_0xf645b3){_0x62c995['push'](_0x62c995['shift']());}};_0x5e6f75(++_0x4ffac5);}(_0x16bc,0x11e));var _0xc16b=function(_0x2330c5,_0x5ddb84){_0x2330c5=_0x2330c5-0x0;var _0x48133d=_0x16bc[_0x2330c5];return _0x48133d;};'use strict';var multer=require(_0xc16b('0x0'));var util=require('util');var path=require(_0xc16b('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xc16b('0x2'));var controller=require(_0xc16b('0x3'));router['get'](_0xc16b('0x4'),auth[_0xc16b('0x5')](),controller['voiceChannels']);router[_0xc16b('0x6')](_0xc16b('0x7'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x8')]);router[_0xc16b('0x6')](_0xc16b('0x9'),auth[_0xc16b('0x5')](),controller['voiceChannelStopMixMonitor']);router[_0xc16b('0x6')](_0xc16b('0xa'),auth[_0xc16b('0x5')](),controller[_0xc16b('0xb')]);router[_0xc16b('0x6')](_0xc16b('0xc'),auth[_0xc16b('0x5')](),controller[_0xc16b('0xd')]);router[_0xc16b('0x6')](_0xc16b('0xe'),auth[_0xc16b('0x5')](),controller['mailQueues']);router['get'](_0xc16b('0xf'),auth[_0xc16b('0x5')](),controller['mailAccounts']);router[_0xc16b('0x6')](_0xc16b('0x10'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x11')]);router['get'](_0xc16b('0x12'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x13')]);router[_0xc16b('0x6')]('/whatsapp/queues',auth[_0xc16b('0x5')](),controller[_0xc16b('0x14')]);router['get'](_0xc16b('0x15'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x16')]);router[_0xc16b('0x6')](_0xc16b('0x17'),auth['isAuthenticated'](),controller['voiceQueuesPreview']);router[_0xc16b('0x6')](_0xc16b('0x18'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x19')]);router[_0xc16b('0x6')](_0xc16b('0x1a'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x1b')]);router[_0xc16b('0x6')](_0xc16b('0x1c'),auth[_0xc16b('0x5')](),controller['voiceQueuesChannelHangup']);router[_0xc16b('0x6')](_0xc16b('0x1d'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x1e')]);router[_0xc16b('0x6')](_0xc16b('0x1f'),auth[_0xc16b('0x5')](),controller['showVoiceQueues']);router['put'](_0xc16b('0x1f'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x20')]);router[_0xc16b('0x6')]('/outbound',auth[_0xc16b('0x5')](),controller[_0xc16b('0x21')]);router[_0xc16b('0x6')]('/outbound/channels',auth['isAuthenticated'](),controller[_0xc16b('0x22')]);router['get'](_0xc16b('0x23'),auth['isAuthenticated'](),controller[_0xc16b('0x24')]);router['put'](_0xc16b('0x25'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x26')]);router[_0xc16b('0x6')]('/telephones',auth[_0xc16b('0x5')](),controller[_0xc16b('0x27')]);router[_0xc16b('0x6')](_0xc16b('0x28'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x29')]);router[_0xc16b('0x6')]('/campaigns',auth[_0xc16b('0x5')](),controller[_0xc16b('0x2a')]);router['get'](_0xc16b('0x2b'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x2c')]);router[_0xc16b('0x6')](_0xc16b('0x2d'),auth[_0xc16b('0x5')](),controller['chatQueuesWaitingInteractions']);router[_0xc16b('0x6')]('/mail/queues/waitinginteractions',auth[_0xc16b('0x5')](),controller[_0xc16b('0x2e')]);router[_0xc16b('0x6')](_0xc16b('0x2f'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x30')]);router[_0xc16b('0x6')]('/openchannel/queues/:id/waitinginteractions',auth[_0xc16b('0x5')](),controller[_0xc16b('0x31')]);router[_0xc16b('0x6')](_0xc16b('0x32'),auth[_0xc16b('0x5')](),controller['smsQueuesWaitingInteractions']);router['get'](_0xc16b('0x33'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x34')]);router['get'](_0xc16b('0x35'),auth['isAuthenticated'](),controller[_0xc16b('0x36')]);router[_0xc16b('0x37')](_0xc16b('0x38'),auth['isAuthenticated'](),controller[_0xc16b('0x39')](_0xc16b('0x3a')));router[_0xc16b('0x6')](_0xc16b('0x3b'),auth[_0xc16b('0x5')](),controller['showMailQueues']);router['post'](_0xc16b('0x3c'),auth['isAuthenticated'](),controller[_0xc16b('0x39')](_0xc16b('0x3d')));router[_0xc16b('0x6')](_0xc16b('0x3e'),auth['isAuthenticated'](),controller[_0xc16b('0x3f')]);router['post'](_0xc16b('0x40'),auth[_0xc16b('0x5')](),controller['queueNotify'](_0xc16b('0x41')));router['get'](_0xc16b('0x42'),auth['isAuthenticated'](),controller['showFaxQueues']);router['post'](_0xc16b('0x43'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x39')](_0xc16b('0x44')));router[_0xc16b('0x6')](_0xc16b('0x45'),auth['isAuthenticated'](),controller['showOpenchannelQueues']);router[_0xc16b('0x37')](_0xc16b('0x46'),auth['isAuthenticated'](),controller['queueNotify']('sms'));router[_0xc16b('0x37')](_0xc16b('0x47'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x39')](_0xc16b('0x48')));router[_0xc16b('0x6')]('/sms/queues/:id',auth[_0xc16b('0x5')](),controller['showSmsQueues']);router['get'](_0xc16b('0x49'),auth[_0xc16b('0x5')](),controller['showWhatsappQueues']);router[_0xc16b('0x37')](_0xc16b('0x4a'),auth[_0xc16b('0x5')](),controller[_0xc16b('0x4b')]);module[_0xc16b('0x4c')]=router;
\ No newline at end of file
index 30be244..5aa0430 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6f47=['voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','interface','agent','internal','telephones','trunks','Trunks','Campaigns','showChatQueues','ChatQueues','MailQueues','showMailQueues','mailAccounts','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','Start','queueTransferTimeout','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','User','create','moment','lodash','../../mysqldb','api','client','http','request','then','error','code','message','result','catch','status','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel'];(function(_0x3da41e,_0x2ce6a3){var _0x147480=function(_0x47c3d3){while(--_0x47c3d3){_0x3da41e['push'](_0x3da41e['shift']());}};_0x147480(++_0x2ce6a3);}(_0x6f47,0xc7));var _0x76f4=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x6f47[_0xd1d19a];return _0x52a79d;};'use strict';var BPromise=require('bluebird');var moment=require(_0x76f4('0x0'));var _=require(_0x76f4('0x1'));var util=require('util');var db=require(_0x76f4('0x2'))['db'];var logger=require('../../config/logger')(_0x76f4('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x76f4('0x4')][_0x76f4('0x5')]({'port':0x232a});var mailClient=jayson[_0x76f4('0x4')][_0x76f4('0x5')]({'port':0x232b});var routingClient=jayson['client'][_0x76f4('0x5')]({'port':0x232c});function respondWithRpcPromise(_0xfc2405,_0x2176a7,_0x497f99){return new BPromise(function(_0x1a3172,_0x25656d){var _0x65d2c7=_0x497f99?_0x497f99:amiClient;return _0x65d2c7[_0x76f4('0x6')](_0xfc2405,_0x2176a7)[_0x76f4('0x7')](function(_0x4c6b5c){if(_0x4c6b5c['error']){if(_0x4c6b5c[_0x76f4('0x8')][_0x76f4('0x9')]===0x1f4){return _0x25656d(_0x4c6b5c['error']['message']);}return _0x1a3172(_0x4c6b5c[_0x76f4('0x8')][_0x76f4('0xa')]);}else{_0x1a3172(_0x4c6b5c[_0x76f4('0xb')]);}})[_0x76f4('0xc')](function(_0x1aee7f){_0x25656d(_0x1aee7f);});});}function respondWithResult(_0xafd21e,_0xf7e347){_0xf7e347=_0xf7e347||0xc8;return function(_0x3ec740){if(_0x3ec740){return _0xafd21e[_0x76f4('0xd')](_0xf7e347)['json'](_0x3ec740);}return _0xafd21e[_0x76f4('0xe')](0x194);};}function handleError(_0x30dabf,_0x5da1ff){_0x5da1ff=_0x5da1ff||0x1f4;return function(_0x4b6021){logger['error'](_0x4b6021[_0x76f4('0xf')]);if(_0x4b6021[_0x76f4('0x10')]){delete _0x4b6021[_0x76f4('0x10')];}_0x30dabf[_0x76f4('0xd')](_0x5da1ff)[_0x76f4('0x11')](_0x4b6021);};}function findById(_0x2b5e23){return function(_0x46ba51){if(!_[_0x76f4('0x12')](_0x2b5e23)&&!_[_0x76f4('0x12')](_0x46ba51)&&!_[_0x76f4('0x12')](_0x46ba51[_0x76f4('0x13')])){return _[_0x76f4('0x14')](_0x46ba51[_0x76f4('0x13')],function(_0x38450e){return _0x38450e['id']==_0x2b5e23;});}return null;};}exports[_0x76f4('0x15')]=function(_0x397360,_0xfedbe4){return respondWithRpcPromise(_0x76f4('0x16'),_0x397360[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0xfedbe4,null))[_0x76f4('0xc')](handleError(_0xfedbe4,null));};exports[_0x76f4('0x18')]=function(_0x5bf3d5,_0x262937){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0x76f4('0x19')](_0x5bf3d5[_0x76f4('0x17')],_0x5bf3d5[_0x76f4('0x1a')]))['then'](respondWithResult(_0x262937,null))['catch'](handleError(_0x262937,null));};exports['voiceChannelStopMixMonitor']=function(_0x465240,_0x681d67){return respondWithRpcPromise(_0x76f4('0x1b'),_[_0x76f4('0x19')](_0x465240[_0x76f4('0x17')],_0x465240[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x681d67,null))['catch'](handleError(_0x681d67,null));};exports['voiceQueues']=function(_0x3794fa,_0x497913){return respondWithRpcPromise(_0x76f4('0x1c'),_0x3794fa['query'])['then'](respondWithResult(_0x497913,null))['catch'](handleError(_0x497913,null));};exports[_0x76f4('0x1d')]=function(_0x38300d,_0xd368a2){return respondWithRpcPromise(_0x76f4('0x1c'),_0x38300d[_0x76f4('0x17')])[_0x76f4('0x7')](findById(_0x38300d['params']['id']))[_0x76f4('0x7')](respondWithResult(_0xd368a2,null))['catch'](handleError(_0xd368a2,null));};exports['updateVoiceQueue']=function(_0x5b3f07,_0x10ddb4){return respondWithRpcPromise(_0x76f4('0x1e'),_[_0x76f4('0x19')](_0x5b3f07[_0x76f4('0x1f')],_0x5b3f07['params']))[_0x76f4('0x7')](respondWithResult(_0x10ddb4,null))['catch'](handleError(_0x10ddb4,null));};exports[_0x76f4('0x20')]=function(_0x3c7513,_0x43ac4a){return respondWithRpcPromise(_0x76f4('0x21'),_[_0x76f4('0x19')](_0x3c7513['query'],_0x3c7513['params']))[_0x76f4('0x7')](respondWithResult(_0x43ac4a,null))[_0x76f4('0xc')](handleError(_0x43ac4a,null));};exports[_0x76f4('0x22')]=function(_0x281db6,_0x1f2adf){return respondWithRpcPromise(_0x76f4('0x23'),_0x281db6[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x1f2adf,null))[_0x76f4('0xc')](handleError(_0x1f2adf,null));};exports[_0x76f4('0x24')]=function(_0x308af2,_0x2527a6){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x308af2['query'],_0x308af2['params']))[_0x76f4('0x7')](respondWithResult(_0x2527a6,null))[_0x76f4('0xc')](handleError(_0x2527a6,null));};exports[_0x76f4('0x25')]=function(_0x456b1f,_0x26fdd6){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x76f4('0x19')](_0x456b1f[_0x76f4('0x17')],_0x456b1f[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x26fdd6,null))[_0x76f4('0xc')](handleError(_0x26fdd6,null));};exports[_0x76f4('0x26')]=function(_0xb806cc,_0x28d9d6){return respondWithRpcPromise(_0x76f4('0x27'),_[_0x76f4('0x19')](_0xb806cc[_0x76f4('0x17')],_0xb806cc[_0x76f4('0x1a')]))[_0x76f4('0x7')](respondWithResult(_0x28d9d6,null))[_0x76f4('0xc')](handleError(_0x28d9d6,null));};exports[_0x76f4('0x28')]=function(_0x88506b,_0x3308e3){return respondWithRpcPromise(_0x76f4('0x29'),_0x88506b['query'])[_0x76f4('0x7')](respondWithResult(_0x3308e3,null))[_0x76f4('0xc')](handleError(_0x3308e3,null));};exports[_0x76f4('0x2a')]=function(_0x589637,_0x597e83){return respondWithRpcPromise(_0x76f4('0x2b'),_0x589637['query'])[_0x76f4('0x7')](respondWithResult(_0x597e83,null))['catch'](handleError(_0x597e83,null));};exports[_0x76f4('0x2c')]=function(_0x16f36d,_0x312243){var _0x378675;return respondWithRpcPromise(_0x76f4('0x2d'),_0x16f36d[_0x76f4('0x17')])[_0x76f4('0x7')](function(_0x109ad9){_0x378675=_0x109ad9;return respondWithRpcPromise(_0x76f4('0x2d'),_0x16f36d[_0x76f4('0x17')],routingClient);})['then'](function(_0x5b8d2d){return _[_0x76f4('0x19')]({},_0x5b8d2d,_0x378675);})[_0x76f4('0x7')](respondWithResult(_0x312243,null))[_0x76f4('0xc')](handleError(_0x312243,null));};exports[_0x76f4('0x2e')]=function(_0x2b7dc8,_0x2d6068){if(_0x2b7dc8[_0x76f4('0x1f')]&&_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')]&&_0x2b7dc8['user']&&_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')]){for(var _0x4f0d1a in _0x2b7dc8['body'][_0x76f4('0x2f')]){if(_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x76f4('0x31')](_0x4f0d1a)){db[_0x76f4('0x32')]['findAll']({'where':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'type':_0x76f4('0x33'),'exitAt':null,'uniqueid':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a]&&_0x2b7dc8[_0x76f4('0x1f')]['interaction'][_0x4f0d1a][_0x76f4('0x34')]?{'$notIn':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a]}:{'$ne':null}}})['then'](function(_0x571261){var _0x11ea58=moment()[_0x76f4('0x35')](_0x76f4('0x36'));for(var _0x2bea6d=0x0,_0x36fa03=_0x571261['length'];_0x2bea6d<_0x36fa03;_0x2bea6d+=0x1){_0x571261[_0x2bea6d]['updateAttributes']({'exitAt':_0x11ea58});}});for(var _0x8e5b60=0x0;_0x8e5b60<_0x2b7dc8['body'][_0x76f4('0x2f')][_0x4f0d1a][_0x76f4('0x34')];_0x8e5b60+=0x1){db['MemberReport']['findOrCreate']({'where':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'type':_0x76f4('0x33'),'uniqueid':_0x2b7dc8[_0x76f4('0x1f')]['interaction'][_0x4f0d1a][_0x8e5b60],'exitAt':null},'defaults':{'channel':_0x4f0d1a,'membername':_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x10')],'interface':_[_0x76f4('0x12')](_0x2b7dc8['user'][_0x76f4('0x37')])?util[_0x76f4('0x35')]('SIP/%s',_0x2b7dc8['user'][_0x76f4('0x10')]):_0x2b7dc8[_0x76f4('0x30')][_0x76f4('0x37')],'type':_0x76f4('0x33'),'enterAt':moment()[_0x76f4('0x35')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x76f4('0x38'),'internal':_0x2b7dc8['user'][_0x76f4('0x39')],'uniqueid':_0x2b7dc8[_0x76f4('0x1f')][_0x76f4('0x2f')][_0x4f0d1a][_0x8e5b60]}});}}}}return respondWithRpcPromise('AgentCapacity',{'id':_0x2b7dc8[_0x76f4('0x1a')]['id'],'capacity':_0x2b7dc8[_0x76f4('0x1f')]['capacity']},routingClient)[_0x76f4('0x7')](respondWithResult(_0x2d6068,null))[_0x76f4('0xc')](handleError(_0x2d6068,null));};exports[_0x76f4('0x3a')]=function(_0x1c658c,_0x40ff20){return respondWithRpcPromise('Telephones',_0x1c658c[_0x76f4('0x17')])['then'](respondWithResult(_0x40ff20,null))[_0x76f4('0xc')](handleError(_0x40ff20,null));};exports[_0x76f4('0x3b')]=function(_0x154ba,_0x5121ec){return respondWithRpcPromise(_0x76f4('0x3c'),_0x154ba[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x5121ec,null))[_0x76f4('0xc')](handleError(_0x5121ec,null));};exports['campaigns']=function(_0x2028e9,_0xf11e07){return respondWithRpcPromise(_0x76f4('0x3d'),_0x2028e9[_0x76f4('0x17')])['then'](respondWithResult(_0xf11e07,null))[_0x76f4('0xc')](handleError(_0xf11e07,null));};exports['chatQueues']=function(_0x129048,_0x190c8d){return respondWithRpcPromise('ChatQueues',_0x129048['query'],routingClient)[_0x76f4('0x7')](respondWithResult(_0x190c8d,null))[_0x76f4('0xc')](handleError(_0x190c8d,null));};exports[_0x76f4('0x3e')]=function(_0x596b51,_0x27ba06){return respondWithRpcPromise(_0x76f4('0x3f'),_0x596b51[_0x76f4('0x17')],routingClient)['then'](findById(_0x596b51['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x27ba06,null))[_0x76f4('0xc')](handleError(_0x27ba06,null));};exports['mailQueues']=function(_0x490ced,_0x3f1840){return respondWithRpcPromise(_0x76f4('0x40'),_0x490ced[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x3f1840,null))[_0x76f4('0xc')](handleError(_0x3f1840,null));};exports[_0x76f4('0x41')]=function(_0x97be11,_0x36a52a){return respondWithRpcPromise(_0x76f4('0x40'),_0x97be11['query'],routingClient)['then'](findById(_0x97be11['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x36a52a,null))[_0x76f4('0xc')](handleError(_0x36a52a,null));};exports[_0x76f4('0x42')]=function(_0x3b6c16,_0x4c9d64){return respondWithRpcPromise('MailAccounts',_0x3b6c16[_0x76f4('0x17')],mailClient)['then'](respondWithResult(_0x4c9d64,null))[_0x76f4('0xc')](handleError(_0x4c9d64,null));};exports['openchannelQueues']=function(_0x4285dd,_0x25e510){return respondWithRpcPromise(_0x76f4('0x43'),_0x4285dd[_0x76f4('0x17')],routingClient)['then'](respondWithResult(_0x25e510,null))[_0x76f4('0xc')](handleError(_0x25e510,null));};exports[_0x76f4('0x44')]=function(_0x22a0cc,_0x40c170){return respondWithRpcPromise(_0x76f4('0x43'),_0x22a0cc[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](findById(_0x22a0cc['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x40c170,null))[_0x76f4('0xc')](handleError(_0x40c170,null));};exports[_0x76f4('0x45')]=function(_0x320a87,_0x28cf4c){return respondWithRpcPromise(_0x76f4('0x46'),_0x320a87[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x28cf4c,null))['catch'](handleError(_0x28cf4c,null));};exports['showSmsQueues']=function(_0xa3091a,_0x617924){return respondWithRpcPromise(_0x76f4('0x46'),_0xa3091a['query'],routingClient)[_0x76f4('0x7')](findById(_0xa3091a['params']['id']))[_0x76f4('0x7')](respondWithResult(_0x617924,null))[_0x76f4('0xc')](handleError(_0x617924,null));};exports['whatsappQueues']=function(_0xda0ac2,_0x37b7f7){return respondWithRpcPromise(_0x76f4('0x47'),_0xda0ac2[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x37b7f7,null))[_0x76f4('0xc')](handleError(_0x37b7f7,null));};exports[_0x76f4('0x48')]=function(_0x410d83,_0x1f7257){return respondWithRpcPromise('WhatsappQueues',_0x410d83[_0x76f4('0x17')],routingClient)['then'](findById(_0x410d83[_0x76f4('0x1a')]['id']))[_0x76f4('0x7')](respondWithResult(_0x1f7257,null))[_0x76f4('0xc')](handleError(_0x1f7257,null));};exports[_0x76f4('0x49')]=function(_0xfbb52c,_0x8de630){return respondWithRpcPromise(_0x76f4('0x4a'),_0xfbb52c[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x8de630,null))[_0x76f4('0xc')](handleError(_0x8de630,null));};exports['showFaxQueues']=function(_0x30f3de,_0x6f874d){return respondWithRpcPromise('FaxQueues',_0x30f3de[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](findById(_0x30f3de[_0x76f4('0x1a')]['id']))['then'](respondWithResult(_0x6f874d,null))[_0x76f4('0xc')](handleError(_0x6f874d,null));};exports[_0x76f4('0x4b')]=function(_0x3e829f,_0x52610a){return respondWithRpcPromise(_0x76f4('0x4c'),_0x3e829f[_0x76f4('0x17')])[_0x76f4('0x7')](respondWithResult(_0x52610a,null))[_0x76f4('0xc')](handleError(_0x52610a,null));};exports[_0x76f4('0x4d')]=function(_0x10ee07,_0x19b99c){return respondWithRpcPromise(_0x76f4('0x4e'),_0x10ee07[_0x76f4('0x17')],routingClient)['then'](respondWithResult(_0x19b99c,null))[_0x76f4('0xc')](handleError(_0x19b99c,null));};exports[_0x76f4('0x4f')]=function(_0x19fdc3,_0x39c9af){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x19fdc3[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x39c9af,null))[_0x76f4('0xc')](handleError(_0x39c9af,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x43b44d,_0x1375d5){return respondWithRpcPromise(_0x76f4('0x50'),_0x43b44d[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x1375d5,null))['catch'](handleError(_0x1375d5,null));};exports[_0x76f4('0x51')]=function(_0x4dd41f,_0x2b8467){return respondWithRpcPromise(_0x76f4('0x50'),_0x4dd41f['query'],routingClient)['then'](function(_0x58251e){if(_0x4dd41f[_0x76f4('0x17')][_0x76f4('0x52')]!==undefined){var _0x1e7b6=_(_0x58251e[_0x76f4('0x13')])[_0x76f4('0x53')]([_0x4dd41f[_0x76f4('0x17')]['type'],_0x4dd41f[_0x76f4('0x1a')]['id']])[_0x76f4('0x54')](_0x76f4('0x55'))[_0x76f4('0x56')]()[_0x76f4('0x57')]();return _0x58251e[_0x76f4('0x13')][_0x76f4('0x53')](function(_0x202fc8){return _0x1e7b6['indexOf'](_0x202fc8[_0x76f4('0x55')])>-0x1;});}else{return _0x58251e['rows'][_0x76f4('0x53')](function(_0x30358a){return _0x30358a[_0x76f4('0x55')]===parseInt(_0x4dd41f[_0x76f4('0x1a')]['id']);});}})[_0x76f4('0x7')](respondWithResult(_0x2b8467,null))[_0x76f4('0xc')](handleError(_0x2b8467,null));};exports[_0x76f4('0x58')]=function(_0x2a0491,_0x54729b){return respondWithRpcPromise(_0x76f4('0x59'),_0x2a0491['query'],routingClient)['then'](respondWithResult(_0x54729b,null))['catch'](handleError(_0x54729b,null));};exports[_0x76f4('0x5a')]=function(_0x402209,_0x279040){return respondWithRpcPromise(_0x76f4('0x5b'),_0x402209['query'],routingClient)[_0x76f4('0x7')](respondWithResult(_0x279040,null))[_0x76f4('0xc')](handleError(_0x279040,null));};exports[_0x76f4('0x5c')]=function(_0x5f5c24,_0x12f16e){return respondWithRpcPromise(_0x76f4('0x5d'),_0x5f5c24[_0x76f4('0x17')],routingClient)[_0x76f4('0x7')](respondWithResult(_0x12f16e,null))[_0x76f4('0xc')](handleError(_0x12f16e,null));};exports[_0x76f4('0x5e')]=function(_0x3b5e15){return function(_0x4b562c,_0x2e991e){var _0xa49e2a,_0x4c7307;var _0x3bc914=_[_0x76f4('0x5f')](_0x3b5e15);var _0x5e6393=_0x3b5e15===_0x76f4('0x60')?_0x76f4('0x61'):_0x76f4('0x62');return db[_0x3bc914+_0x76f4('0x63')][_0x76f4('0x64')]({'raw':!![],'where':{'id':_0x4b562c[_0x76f4('0x1a')]['id']}})['then'](function(_0x2dac86){if(_[_0x76f4('0x12')](_0x2dac86)){throw new Error(_0x3bc914+_0x76f4('0x65'));}_0xa49e2a=_0x2dac86;return db[_0x3bc914+_0x76f4('0x66')]['findOne']({'where':{'id':_0x4b562c[_0x76f4('0x1f')]['messageId']},'include':[{'model':db[_0x3bc914+_0x76f4('0x67')],'as':'Interaction'},{'model':db[_0x3bc914+_0x5e6393],'as':_0x76f4('0x62')}]});})[_0x76f4('0x7')](function(_0x59e9ed){if(_['isNil'](_0x59e9ed)){throw new Error(_0x3bc914+_0x76f4('0x68'));}_0x4c7307=_0x59e9ed;return _0x59e9ed[_0x76f4('0x69')]({'read':0x0,'readAt':null,'UserId':null});})[_0x76f4('0x7')](function(){var _0x4a2969={'uniqueid':_0x3b5e15+'.'+_0x4c7307['id']+'.'+_0x4c7307['Interaction']['id'],'FromUserId':_0x4b562c[_0x76f4('0x30')]['id'],'type':_0x76f4('0x6a')};_0x4a2969[_0x3bc914+_0x76f4('0x6b')]=_0x4c7307['id'];_0x4a2969[_0x3bc914+_0x76f4('0x6c')]=_0x4c7307[_0x76f4('0x67')]['id'];_0x4a2969[_0x76f4('0x6d')+_0x3bc914+_0x5e6393+'Id']=_0x4c7307[_0x76f4('0x62')]['id'];_0x4a2969['To'+_0x3bc914+_0x76f4('0x6e')]=_0xa49e2a['id'];return db[_0x3bc914+'TransferReport']['create'](_0x4a2969);})[_0x76f4('0x7')](function(){return respondWithRpcPromise(_0x76f4('0x6f'),{'channel':_0x3b5e15,'interaction':_0x4c7307[_0x76f4('0x67')],'message':_0x4c7307,'account':_0x4c7307['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x76f4('0x6a'),'appdata':_0xa49e2a[_0x76f4('0x10')]+','+(_0x4c7307[_0x76f4('0x62')][_0x76f4('0x70')]||0x12c),'interval':_0x76f4('0x71')}]},routingClient);})[_0x76f4('0x7')](respondWithResult(_0x2e991e,null))[_0x76f4('0xc')](handleError(_0x2e991e,null));};};exports['agentNotify']=function(_0x13cf2a,_0x316f86){var _0x3e537b,_0x53252e;if(_[_0x76f4('0x12')](_0x13cf2a[_0x76f4('0x1f')][_0x76f4('0x72')])){throw new Error(_0x76f4('0x73'));}var _0x5080a9=_0x13cf2a[_0x76f4('0x1f')]['channel'];var _0xc80d4c=_['capitalize'](_0x5080a9);var _0x238df3=_0x5080a9===_0x76f4('0x60')?_0x76f4('0x61'):'Account';return db[_0x76f4('0x74')][_0x76f4('0x64')]({'raw':!![],'where':{'id':_0x13cf2a[_0x76f4('0x1a')]['id'],'role':'agent'}})[_0x76f4('0x7')](function(_0x460867){if(_['isNil'](_0x460867)){throw new Error('Agent\x20not\x20found');}_0x3e537b=_0x460867;return db[_0xc80d4c+_0x76f4('0x66')][_0x76f4('0x64')]({'where':{'id':_0x13cf2a['body']['messageId']},'include':[{'model':db[_0xc80d4c+_0x76f4('0x67')],'as':_0x76f4('0x67')},{'model':db[_0xc80d4c+_0x238df3],'as':'Account'}]});})[_0x76f4('0x7')](function(_0x54ae6c){if(_['isNil'](_0x54ae6c)){throw new Error(_0xc80d4c+'\x20Message\x20not\x20found');}_0x53252e=_0x54ae6c;return _0x54ae6c[_0x76f4('0x69')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x59265d={'uniqueid':_0x5080a9+'.'+_0x53252e['id']+'.'+_0x53252e[_0x76f4('0x67')]['id'],'FromUserId':_0x13cf2a['user']['id'],'type':'queue','ToUserId':_0x3e537b['id']};_0x59265d[_0xc80d4c+_0x76f4('0x6b')]=_0x53252e['id'];_0x59265d[_0xc80d4c+'InteractionId']=_0x53252e[_0x76f4('0x67')]['id'];_0x59265d[_0x76f4('0x6d')+_0xc80d4c+_0x238df3+'Id']=_0x53252e['Account']['id'];return db[_0xc80d4c+'TransferReport'][_0x76f4('0x75')](_0x59265d);})[_0x76f4('0x7')](function(){return respondWithRpcPromise(_0x76f4('0x6f'),{'channel':_0x5080a9,'interaction':_0x53252e['Interaction'],'message':_0x53252e,'account':_0x53252e[_0x76f4('0x62')],'applications':[{'id':0x0,'priority':0x1,'app':_0x76f4('0x38'),'appdata':_0x3e537b[_0x76f4('0x10')]+','+(_0x53252e[_0x76f4('0x62')]['agentTransferTimeout']||0x12c),'interval':_0x76f4('0x71')}]},routingClient);})[_0x76f4('0x7')](respondWithResult(_0x316f86,null))[_0x76f4('0xc')](handleError(_0x316f86,null));};
\ No newline at end of file
+var _0xabce=['InteractionId','From','QueueId','TransferReport','create','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Agent\x20not\x20found','update','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','jayson/promise','client','http','request','then','error','code','message','result','catch','json','sendStatus','stack','name','status','send','isNil','rows','find','voiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','Outbound','OutboundChannels','Agents','agentCapacity','interaction','MemberReport','findAll','user','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','agent','internal','AgentCapacity','telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues','FaxAccounts','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','map','value','indexOf','queue_id','filter','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','queue','MessageId'];(function(_0x2e1b3f,_0x5bbe92){var _0x202a55=function(_0x32c677){while(--_0x32c677){_0x2e1b3f['push'](_0x2e1b3f['shift']());}};_0x202a55(++_0x5bbe92);}(_0xabce,0x103));var _0xeabc=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xabce[_0x5c3c0b];return _0x52ecd2;};'use strict';var BPromise=require(_0xeabc('0x0'));var moment=require(_0xeabc('0x1'));var _=require(_0xeabc('0x2'));var util=require(_0xeabc('0x3'));var db=require(_0xeabc('0x4'))['db'];var logger=require('../../config/logger')('api');var jayson=require(_0xeabc('0x5'));var amiClient=jayson[_0xeabc('0x6')][_0xeabc('0x7')]({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson[_0xeabc('0x6')]['http']({'port':0x232c});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){var _0x5d59d5=_0x3bdc29?_0x3bdc29:amiClient;return _0x5d59d5[_0xeabc('0x8')](_0x229ba4,_0x52ede8)[_0xeabc('0x9')](function(_0x2f73e9){if(_0x2f73e9[_0xeabc('0xa')]){if(_0x2f73e9[_0xeabc('0xa')][_0xeabc('0xb')]===0x1f4){return _0x8434c5(_0x2f73e9[_0xeabc('0xa')][_0xeabc('0xc')]);}return _0x9417af(_0x2f73e9[_0xeabc('0xa')][_0xeabc('0xc')]);}else{_0x9417af(_0x2f73e9[_0xeabc('0xd')]);}})[_0xeabc('0xe')](function(_0x435ea7){_0x8434c5(_0x435ea7);});});}function respondWithResult(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xc8;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['status'](_0x36a92e)[_0xeabc('0xf')](_0xcfbf06);}return _0x3fd0b5[_0xeabc('0x10')](0x194);};}function handleError(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0x1f4;return function(_0x5f4ee8){logger[_0xeabc('0xa')](_0x5f4ee8[_0xeabc('0x11')]);if(_0x5f4ee8[_0xeabc('0x12')]){delete _0x5f4ee8['name'];}_0x3251c6[_0xeabc('0x13')](_0x55f0de)[_0xeabc('0x14')](_0x5f4ee8);};}function findById(_0x49f2d8){return function(_0x53fe28){if(!_[_0xeabc('0x15')](_0x49f2d8)&&!_['isNil'](_0x53fe28)&&!_[_0xeabc('0x15')](_0x53fe28[_0xeabc('0x16')])){return _[_0xeabc('0x17')](_0x53fe28[_0xeabc('0x16')],function(_0x31dd53){return _0x31dd53['id']==_0x49f2d8;});}return null;};}exports[_0xeabc('0x18')]=function(_0x384be5,_0x5e30ee){return respondWithRpcPromise('VoiceChannels',_0x384be5[_0xeabc('0x19')])['then'](respondWithResult(_0x5e30ee,null))[_0xeabc('0xe')](handleError(_0x5e30ee,null));};exports[_0xeabc('0x1a')]=function(_0x502947,_0x28063a){return respondWithRpcPromise(_0xeabc('0x1b'),_[_0xeabc('0x1c')](_0x502947[_0xeabc('0x19')],_0x502947[_0xeabc('0x1d')]))['then'](respondWithResult(_0x28063a,null))[_0xeabc('0xe')](handleError(_0x28063a,null));};exports[_0xeabc('0x1e')]=function(_0x91ab00,_0x5bdd57){return respondWithRpcPromise(_0xeabc('0x1f'),_[_0xeabc('0x1c')](_0x91ab00[_0xeabc('0x19')],_0x91ab00[_0xeabc('0x1d')]))['then'](respondWithResult(_0x5bdd57,null))[_0xeabc('0xe')](handleError(_0x5bdd57,null));};exports['voiceQueues']=function(_0x27dbaf,_0x4d4e29){return respondWithRpcPromise(_0xeabc('0x20'),_0x27dbaf[_0xeabc('0x19')])[_0xeabc('0x9')](respondWithResult(_0x4d4e29,null))[_0xeabc('0xe')](handleError(_0x4d4e29,null));};exports[_0xeabc('0x21')]=function(_0x137293,_0x131722){return respondWithRpcPromise('VoiceQueues',_0x137293['query'])[_0xeabc('0x9')](findById(_0x137293['params']['id']))[_0xeabc('0x9')](respondWithResult(_0x131722,null))[_0xeabc('0xe')](handleError(_0x131722,null));};exports['updateVoiceQueue']=function(_0x2163e6,_0x38572d){return respondWithRpcPromise(_0xeabc('0x22'),_[_0xeabc('0x1c')](_0x2163e6[_0xeabc('0x23')],_0x2163e6[_0xeabc('0x1d')]))[_0xeabc('0x9')](respondWithResult(_0x38572d,null))[_0xeabc('0xe')](handleError(_0x38572d,null));};exports[_0xeabc('0x24')]=function(_0x5ebb86,_0x5b34dd){return respondWithRpcPromise('VoiceQueuesPreview',_[_0xeabc('0x1c')](_0x5ebb86[_0xeabc('0x19')],_0x5ebb86[_0xeabc('0x1d')]))[_0xeabc('0x9')](respondWithResult(_0x5b34dd,null))[_0xeabc('0xe')](handleError(_0x5b34dd,null));};exports[_0xeabc('0x25')]=function(_0x61c0af,_0x545d7f){return respondWithRpcPromise(_0xeabc('0x26'),_0x61c0af[_0xeabc('0x19')])[_0xeabc('0x9')](respondWithResult(_0x545d7f,null))['catch'](handleError(_0x545d7f,null));};exports[_0xeabc('0x27')]=function(_0x3777c1,_0x4492fd){return respondWithRpcPromise('VoiceQueuesChannel',_[_0xeabc('0x1c')](_0x3777c1[_0xeabc('0x19')],_0x3777c1[_0xeabc('0x1d')]))['then'](respondWithResult(_0x4492fd,null))[_0xeabc('0xe')](handleError(_0x4492fd,null));};exports[_0xeabc('0x28')]=function(_0x5d9acf,_0x50cca2){return respondWithRpcPromise(_0xeabc('0x29'),_[_0xeabc('0x1c')](_0x5d9acf['query'],_0x5d9acf[_0xeabc('0x1d')]))[_0xeabc('0x9')](respondWithResult(_0x50cca2,null))[_0xeabc('0xe')](handleError(_0x50cca2,null));};exports[_0xeabc('0x2a')]=function(_0x34057c,_0x4b7923){return respondWithRpcPromise(_0xeabc('0x2b'),_['merge'](_0x34057c[_0xeabc('0x19')],_0x34057c[_0xeabc('0x1d')]))[_0xeabc('0x9')](respondWithResult(_0x4b7923,null))['catch'](handleError(_0x4b7923,null));};exports['outbound']=function(_0x452580,_0x560d4a){return respondWithRpcPromise(_0xeabc('0x2c'),_0x452580['query'])['then'](respondWithResult(_0x560d4a,null))['catch'](handleError(_0x560d4a,null));};exports['outboundChannels']=function(_0x1e222a,_0x593588){return respondWithRpcPromise(_0xeabc('0x2d'),_0x1e222a[_0xeabc('0x19')])['then'](respondWithResult(_0x593588,null))[_0xeabc('0xe')](handleError(_0x593588,null));};exports['agents']=function(_0x3d48f4,_0x58aafe){var _0xbd7f03;return respondWithRpcPromise(_0xeabc('0x2e'),_0x3d48f4[_0xeabc('0x19')])['then'](function(_0x5a00d0){_0xbd7f03=_0x5a00d0;return respondWithRpcPromise('Agents',_0x3d48f4[_0xeabc('0x19')],routingClient);})[_0xeabc('0x9')](function(_0xafa59b){return _['merge']({},_0xafa59b,_0xbd7f03);})['then'](respondWithResult(_0x58aafe,null))[_0xeabc('0xe')](handleError(_0x58aafe,null));};exports[_0xeabc('0x2f')]=function(_0x5e9cb3,_0xc6af4d){if(_0x5e9cb3['body']&&_0x5e9cb3[_0xeabc('0x23')]['interaction']&&_0x5e9cb3['user']&&_0x5e9cb3['user'][_0xeabc('0x12')]){for(var _0x37c926 in _0x5e9cb3[_0xeabc('0x23')][_0xeabc('0x30')]){if(_0x5e9cb3['body'][_0xeabc('0x30')]['hasOwnProperty'](_0x37c926)){db[_0xeabc('0x31')][_0xeabc('0x32')]({'where':{'channel':_0x37c926,'membername':_0x5e9cb3[_0xeabc('0x33')][_0xeabc('0x12')],'type':_0xeabc('0x34'),'exitAt':null,'uniqueid':_0x5e9cb3['body']['interaction'][_0x37c926]&&_0x5e9cb3[_0xeabc('0x23')]['interaction'][_0x37c926][_0xeabc('0x35')]?{'$notIn':_0x5e9cb3[_0xeabc('0x23')]['interaction'][_0x37c926]}:{'$ne':null}}})[_0xeabc('0x9')](function(_0x2b3c28){var _0x459c98=moment()[_0xeabc('0x36')](_0xeabc('0x37'));for(var _0xcaa5b9=0x0,_0x2003a7=_0x2b3c28['length'];_0xcaa5b9<_0x2003a7;_0xcaa5b9+=0x1){_0x2b3c28[_0xcaa5b9][_0xeabc('0x38')]({'exitAt':_0x459c98});}});for(var _0x2c85f0=0x0;_0x2c85f0<_0x5e9cb3[_0xeabc('0x23')][_0xeabc('0x30')][_0x37c926][_0xeabc('0x35')];_0x2c85f0+=0x1){db[_0xeabc('0x31')][_0xeabc('0x39')]({'where':{'channel':_0x37c926,'membername':_0x5e9cb3[_0xeabc('0x33')][_0xeabc('0x12')],'type':_0xeabc('0x34'),'uniqueid':_0x5e9cb3['body'][_0xeabc('0x30')][_0x37c926][_0x2c85f0],'exitAt':null},'defaults':{'channel':_0x37c926,'membername':_0x5e9cb3[_0xeabc('0x33')][_0xeabc('0x12')],'interface':_[_0xeabc('0x15')](_0x5e9cb3[_0xeabc('0x33')][_0xeabc('0x3a')])?util[_0xeabc('0x36')]('SIP/%s',_0x5e9cb3[_0xeabc('0x33')][_0xeabc('0x12')]):_0x5e9cb3[_0xeabc('0x33')][_0xeabc('0x3a')],'type':_0xeabc('0x34'),'enterAt':moment()['format'](_0xeabc('0x37')),'role':_0xeabc('0x3b'),'internal':_0x5e9cb3[_0xeabc('0x33')][_0xeabc('0x3c')],'uniqueid':_0x5e9cb3['body'][_0xeabc('0x30')][_0x37c926][_0x2c85f0]}});}}}}return respondWithRpcPromise(_0xeabc('0x3d'),{'id':_0x5e9cb3['params']['id'],'capacity':_0x5e9cb3[_0xeabc('0x23')]['capacity']},routingClient)[_0xeabc('0x9')](respondWithResult(_0xc6af4d,null))['catch'](handleError(_0xc6af4d,null));};exports[_0xeabc('0x3e')]=function(_0x2ec94c,_0x38f988){return respondWithRpcPromise(_0xeabc('0x3f'),_0x2ec94c[_0xeabc('0x19')])[_0xeabc('0x9')](respondWithResult(_0x38f988,null))[_0xeabc('0xe')](handleError(_0x38f988,null));};exports[_0xeabc('0x40')]=function(_0x31aedf,_0x6423f3){return respondWithRpcPromise('Trunks',_0x31aedf[_0xeabc('0x19')])[_0xeabc('0x9')](respondWithResult(_0x6423f3,null))[_0xeabc('0xe')](handleError(_0x6423f3,null));};exports[_0xeabc('0x41')]=function(_0x555d6b,_0x1cef45){return respondWithRpcPromise(_0xeabc('0x42'),_0x555d6b[_0xeabc('0x19')])[_0xeabc('0x9')](respondWithResult(_0x1cef45,null))['catch'](handleError(_0x1cef45,null));};exports[_0xeabc('0x43')]=function(_0x1c7679,_0x3a1b84){return respondWithRpcPromise(_0xeabc('0x44'),_0x1c7679[_0xeabc('0x19')],routingClient)[_0xeabc('0x9')](respondWithResult(_0x3a1b84,null))[_0xeabc('0xe')](handleError(_0x3a1b84,null));};exports[_0xeabc('0x45')]=function(_0x17acf8,_0x58ab08){return respondWithRpcPromise(_0xeabc('0x44'),_0x17acf8['query'],routingClient)['then'](findById(_0x17acf8['params']['id']))[_0xeabc('0x9')](respondWithResult(_0x58ab08,null))[_0xeabc('0xe')](handleError(_0x58ab08,null));};exports[_0xeabc('0x46')]=function(_0xb35103,_0xe89728){return respondWithRpcPromise(_0xeabc('0x47'),_0xb35103['query'],routingClient)[_0xeabc('0x9')](respondWithResult(_0xe89728,null))[_0xeabc('0xe')](handleError(_0xe89728,null));};exports[_0xeabc('0x48')]=function(_0x104c1e,_0x2ddc53){return respondWithRpcPromise(_0xeabc('0x47'),_0x104c1e[_0xeabc('0x19')],routingClient)[_0xeabc('0x9')](findById(_0x104c1e['params']['id']))['then'](respondWithResult(_0x2ddc53,null))[_0xeabc('0xe')](handleError(_0x2ddc53,null));};exports[_0xeabc('0x49')]=function(_0x2c0894,_0x4b3794){return respondWithRpcPromise(_0xeabc('0x4a'),_0x2c0894['query'],mailClient)['then'](respondWithResult(_0x4b3794,null))[_0xeabc('0xe')](handleError(_0x4b3794,null));};exports[_0xeabc('0x4b')]=function(_0x13f04f,_0x4f5451){return respondWithRpcPromise(_0xeabc('0x4c'),_0x13f04f[_0xeabc('0x19')],routingClient)['then'](respondWithResult(_0x4f5451,null))[_0xeabc('0xe')](handleError(_0x4f5451,null));};exports[_0xeabc('0x4d')]=function(_0x321a90,_0x7697f7){return respondWithRpcPromise(_0xeabc('0x4c'),_0x321a90[_0xeabc('0x19')],routingClient)['then'](findById(_0x321a90[_0xeabc('0x1d')]['id']))[_0xeabc('0x9')](respondWithResult(_0x7697f7,null))[_0xeabc('0xe')](handleError(_0x7697f7,null));};exports[_0xeabc('0x4e')]=function(_0x1b61a8,_0x19faa4){return respondWithRpcPromise(_0xeabc('0x4f'),_0x1b61a8[_0xeabc('0x19')],routingClient)[_0xeabc('0x9')](respondWithResult(_0x19faa4,null))['catch'](handleError(_0x19faa4,null));};exports[_0xeabc('0x50')]=function(_0x590439,_0x404846){return respondWithRpcPromise(_0xeabc('0x4f'),_0x590439[_0xeabc('0x19')],routingClient)[_0xeabc('0x9')](findById(_0x590439[_0xeabc('0x1d')]['id']))[_0xeabc('0x9')](respondWithResult(_0x404846,null))[_0xeabc('0xe')](handleError(_0x404846,null));};exports[_0xeabc('0x51')]=function(_0x5d4bc2,_0x24d0e5){return respondWithRpcPromise('WhatsappQueues',_0x5d4bc2[_0xeabc('0x19')],routingClient)[_0xeabc('0x9')](respondWithResult(_0x24d0e5,null))[_0xeabc('0xe')](handleError(_0x24d0e5,null));};exports[_0xeabc('0x52')]=function(_0x5b4430,_0x12fd48){return respondWithRpcPromise('WhatsappQueues',_0x5b4430['query'],routingClient)[_0xeabc('0x9')](findById(_0x5b4430[_0xeabc('0x1d')]['id']))[_0xeabc('0x9')](respondWithResult(_0x12fd48,null))[_0xeabc('0xe')](handleError(_0x12fd48,null));};exports['faxQueues']=function(_0x51a0c7,_0x2e712e){return respondWithRpcPromise('FaxQueues',_0x51a0c7['query'],routingClient)[_0xeabc('0x9')](respondWithResult(_0x2e712e,null))['catch'](handleError(_0x2e712e,null));};exports['showFaxQueues']=function(_0xa44f2d,_0x1c84b5){return respondWithRpcPromise('FaxQueues',_0xa44f2d['query'],routingClient)[_0xeabc('0x9')](findById(_0xa44f2d['params']['id']))[_0xeabc('0x9')](respondWithResult(_0x1c84b5,null))[_0xeabc('0xe')](handleError(_0x1c84b5,null));};exports['faxAccounts']=function(_0x5d6477,_0x24365a){return respondWithRpcPromise(_0xeabc('0x53'),_0x5d6477[_0xeabc('0x19')])[_0xeabc('0x9')](respondWithResult(_0x24365a,null))[_0xeabc('0xe')](handleError(_0x24365a,null));};exports['chatQueuesWaitingInteractions']=function(_0x53f578,_0x391cae){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x53f578[_0xeabc('0x19')],routingClient)['then'](respondWithResult(_0x391cae,null))[_0xeabc('0xe')](handleError(_0x391cae,null));};exports['mailQueuesWaitingInteractions']=function(_0x1fdaba,_0x53ac31){return respondWithRpcPromise(_0xeabc('0x54'),_0x1fdaba[_0xeabc('0x19')],routingClient)[_0xeabc('0x9')](respondWithResult(_0x53ac31,null))[_0xeabc('0xe')](handleError(_0x53ac31,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x6ee7cf,_0x4fa682){return respondWithRpcPromise(_0xeabc('0x55'),_0x6ee7cf[_0xeabc('0x19')],routingClient)[_0xeabc('0x9')](respondWithResult(_0x4fa682,null))[_0xeabc('0xe')](handleError(_0x4fa682,null));};exports[_0xeabc('0x56')]=function(_0x5c1ab2,_0x239350){return respondWithRpcPromise(_0xeabc('0x55'),_0x5c1ab2[_0xeabc('0x19')],routingClient)[_0xeabc('0x9')](function(_0x5427c8){if(_0x5c1ab2[_0xeabc('0x19')][_0xeabc('0x57')]!==undefined){var _0xe60b11=_(_0x5427c8[_0xeabc('0x16')])['filter']([_0x5c1ab2[_0xeabc('0x19')][_0xeabc('0x57')],_0x5c1ab2[_0xeabc('0x1d')]['id']])[_0xeabc('0x58')]('queue_id')['uniq']()[_0xeabc('0x59')]();return _0x5427c8['rows']['filter'](function(_0x3271b6){return _0xe60b11[_0xeabc('0x5a')](_0x3271b6[_0xeabc('0x5b')])>-0x1;});}else{return _0x5427c8['rows'][_0xeabc('0x5c')](function(_0x403b18){return _0x403b18['queue_id']===parseInt(_0x5c1ab2[_0xeabc('0x1d')]['id']);});}})[_0xeabc('0x9')](respondWithResult(_0x239350,null))[_0xeabc('0xe')](handleError(_0x239350,null));};exports[_0xeabc('0x5d')]=function(_0x2ece2c,_0x4bf9d8){return respondWithRpcPromise(_0xeabc('0x5e'),_0x2ece2c['query'],routingClient)['then'](respondWithResult(_0x4bf9d8,null))['catch'](handleError(_0x4bf9d8,null));};exports[_0xeabc('0x5f')]=function(_0x1c8a51,_0x1b6e9e){return respondWithRpcPromise(_0xeabc('0x60'),_0x1c8a51[_0xeabc('0x19')],routingClient)['then'](respondWithResult(_0x1b6e9e,null))[_0xeabc('0xe')](handleError(_0x1b6e9e,null));};exports['faxQueuesWaitingInteractions']=function(_0x1795fe,_0x2f95c7){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x1795fe[_0xeabc('0x19')],routingClient)['then'](respondWithResult(_0x2f95c7,null))['catch'](handleError(_0x2f95c7,null));};exports[_0xeabc('0x61')]=function(_0xa5c4ca){return function(_0x439a48,_0x3acb88){var _0x3c6a49,_0x4dfc4b;var _0x399735=_[_0xeabc('0x62')](_0xa5c4ca);var _0x33e5fb=_0xa5c4ca===_0xeabc('0x63')?_0xeabc('0x64'):_0xeabc('0x65');return db[_0x399735+_0xeabc('0x66')][_0xeabc('0x67')]({'raw':!![],'where':{'id':_0x439a48[_0xeabc('0x1d')]['id']}})[_0xeabc('0x9')](function(_0x522c6e){if(_[_0xeabc('0x15')](_0x522c6e)){throw new Error(_0x399735+_0xeabc('0x68'));}_0x3c6a49=_0x522c6e;return db[_0x399735+_0xeabc('0x69')]['findOne']({'where':{'id':_0x439a48['body'][_0xeabc('0x6a')]},'include':[{'model':db[_0x399735+_0xeabc('0x6b')],'as':_0xeabc('0x6b')},{'model':db[_0x399735+_0x33e5fb],'as':_0xeabc('0x65')}]});})[_0xeabc('0x9')](function(_0x5f5a47){if(_[_0xeabc('0x15')](_0x5f5a47)){throw new Error(_0x399735+'\x20Message\x20not\x20found');}_0x4dfc4b=_0x5f5a47;return _0x5f5a47['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xeabc('0x9')](function(){var _0x302e94={'uniqueid':_0xa5c4ca+'.'+_0x4dfc4b['id']+'.'+_0x4dfc4b['Interaction']['id'],'FromUserId':_0x439a48[_0xeabc('0x33')]['id'],'type':_0xeabc('0x6c')};_0x302e94[_0x399735+_0xeabc('0x6d')]=_0x4dfc4b['id'];_0x302e94[_0x399735+_0xeabc('0x6e')]=_0x4dfc4b[_0xeabc('0x6b')]['id'];_0x302e94[_0xeabc('0x6f')+_0x399735+_0x33e5fb+'Id']=_0x4dfc4b[_0xeabc('0x65')]['id'];_0x302e94['To'+_0x399735+_0xeabc('0x70')]=_0x3c6a49['id'];return db[_0x399735+_0xeabc('0x71')][_0xeabc('0x72')](_0x302e94);})[_0xeabc('0x9')](function(){return respondWithRpcPromise('Start',{'channel':_0xa5c4ca,'interaction':_0x4dfc4b[_0xeabc('0x6b')],'message':_0x4dfc4b,'account':_0x4dfc4b['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xeabc('0x6c'),'appdata':_0x3c6a49[_0xeabc('0x12')]+','+(_0x4dfc4b[_0xeabc('0x65')][_0xeabc('0x73')]||0x12c),'interval':_0xeabc('0x74')}]},routingClient);})[_0xeabc('0x9')](respondWithResult(_0x3acb88,null))[_0xeabc('0xe')](handleError(_0x3acb88,null));};};exports[_0xeabc('0x75')]=function(_0xb85c3d,_0x156e20){var _0x42e92b,_0x5d471f;if(_[_0xeabc('0x15')](_0xb85c3d[_0xeabc('0x23')][_0xeabc('0x76')])){throw new Error(_0xeabc('0x77'));}var _0x5b00d6=_0xb85c3d[_0xeabc('0x23')][_0xeabc('0x76')];var _0x580661=_[_0xeabc('0x62')](_0x5b00d6);var _0x22ef88=_0x5b00d6==='chat'?'Website':'Account';return db['User'][_0xeabc('0x67')]({'raw':!![],'where':{'id':_0xb85c3d[_0xeabc('0x1d')]['id'],'role':_0xeabc('0x3b')}})[_0xeabc('0x9')](function(_0x1d8dca){if(_[_0xeabc('0x15')](_0x1d8dca)){throw new Error(_0xeabc('0x78'));}_0x42e92b=_0x1d8dca;return db[_0x580661+_0xeabc('0x69')][_0xeabc('0x67')]({'where':{'id':_0xb85c3d[_0xeabc('0x23')]['messageId']},'include':[{'model':db[_0x580661+_0xeabc('0x6b')],'as':_0xeabc('0x6b')},{'model':db[_0x580661+_0x22ef88],'as':'Account'}]});})[_0xeabc('0x9')](function(_0x32063c){if(_[_0xeabc('0x15')](_0x32063c)){throw new Error(_0x580661+'\x20Message\x20not\x20found');}_0x5d471f=_0x32063c;return _0x32063c[_0xeabc('0x79')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x425e5c={'uniqueid':_0x5b00d6+'.'+_0x5d471f['id']+'.'+_0x5d471f[_0xeabc('0x6b')]['id'],'FromUserId':_0xb85c3d[_0xeabc('0x33')]['id'],'type':_0xeabc('0x6c'),'ToUserId':_0x42e92b['id']};_0x425e5c[_0x580661+_0xeabc('0x6d')]=_0x5d471f['id'];_0x425e5c[_0x580661+'InteractionId']=_0x5d471f['Interaction']['id'];_0x425e5c['From'+_0x580661+_0x22ef88+'Id']=_0x5d471f['Account']['id'];return db[_0x580661+_0xeabc('0x71')][_0xeabc('0x72')](_0x425e5c);})[_0xeabc('0x9')](function(){return respondWithRpcPromise('Start',{'channel':_0x5b00d6,'interaction':_0x5d471f[_0xeabc('0x6b')],'message':_0x5d471f,'account':_0x5d471f[_0xeabc('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0xeabc('0x3b'),'appdata':_0x42e92b[_0xeabc('0x12')]+','+(_0x5d471f[_0xeabc('0x65')][_0xeabc('0x7a')]||0x12c),'interval':_0xeabc('0x74')}]},routingClient);})[_0xeabc('0x9')](respondWithResult(_0x156e20,null))[_0xeabc('0xe')](handleError(_0x156e20,null));};
\ No newline at end of file
index 4c5b9b7..f3cc882 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4f4=['destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./schedule.controller','isAuthenticated','index','get','/:id','show','/:id/run','run','post','put'];(function(_0x354df6,_0x4fb714){var _0x3b8676=function(_0x5a0296){while(--_0x5a0296){_0x354df6['push'](_0x354df6['shift']());}};_0x3b8676(++_0x4fb714);}(_0xd4f4,0x1b1));var _0x4d4f=function(_0x582220,_0x56d24b){_0x582220=_0x582220-0x0;var _0x555614=_0xd4f4[_0x582220];return _0x555614;};'use strict';var multer=require(_0x4d4f('0x0'));var util=require('util');var path=require(_0x4d4f('0x1'));var timeout=require(_0x4d4f('0x2'));var express=require(_0x4d4f('0x3'));var router=express[_0x4d4f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x4d4f('0x5'));var config=require(_0x4d4f('0x6'));var controller=require(_0x4d4f('0x7'));router['get']('/',auth[_0x4d4f('0x8')](),controller[_0x4d4f('0x9')]);router[_0x4d4f('0xa')](_0x4d4f('0xb'),auth['isAuthenticated'](),controller[_0x4d4f('0xc')]);router[_0x4d4f('0xa')](_0x4d4f('0xd'),auth['isAuthenticated'](),controller[_0x4d4f('0xe')]);router[_0x4d4f('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x4d4f('0x10')]('/:id',auth[_0x4d4f('0x8')](),controller['update']);router['delete']('/:id',auth[_0x4d4f('0x8')](),controller[_0x4d4f('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0xdea0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./schedule.controller','isAuthenticated','index','get','/:id','show','/:id/run','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x25bdaf,_0x21c383){var _0x42696e=function(_0x307ada){while(--_0x307ada){_0x25bdaf['push'](_0x25bdaf['shift']());}};_0x42696e(++_0x21c383);}(_0xdea0,0x88));var _0x0dea=function(_0xb90145,_0x13c2a0){_0xb90145=_0xb90145-0x0;var _0x3bdeba=_0xdea0[_0xb90145];return _0x3bdeba;};'use strict';var multer=require(_0x0dea('0x0'));var util=require(_0x0dea('0x1'));var path=require(_0x0dea('0x2'));var timeout=require('connect-timeout');var express=require(_0x0dea('0x3'));var router=express[_0x0dea('0x4')]();var fs_extra=require(_0x0dea('0x5'));var auth=require(_0x0dea('0x6'));var interaction=require(_0x0dea('0x7'));var config=require('../../config/environment');var controller=require(_0x0dea('0x8'));router['get']('/',auth[_0x0dea('0x9')](),controller[_0x0dea('0xa')]);router[_0x0dea('0xb')](_0x0dea('0xc'),auth[_0x0dea('0x9')](),controller[_0x0dea('0xd')]);router['get'](_0x0dea('0xe'),auth[_0x0dea('0x9')](),controller['run']);router['post']('/',auth[_0x0dea('0x9')](),controller['create']);router[_0x0dea('0xf')](_0x0dea('0xc'),auth['isAuthenticated'](),controller[_0x0dea('0x10')]);router[_0x0dea('0x11')](_0x0dea('0xc'),auth[_0x0dea('0x9')](),controller[_0x0dea('0x12')]);module[_0x0dea('0x13')]=router;
\ No newline at end of file
index 3b5db80..c73f4b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed05=['csv','xlsx','default','custom','TEXT','sequelize','STRING','BOOLEAN','DATE','ENUM','years','weeks','days','minutes'];(function(_0x154a2b,_0x253064){var _0x3bdb5f=function(_0x1cfe46){while(--_0x1cfe46){_0x154a2b['push'](_0x154a2b['shift']());}};_0x3bdb5f(++_0x253064);}(_0xed05,0x75));var _0x5ed0=function(_0x1704e5,_0x160461){_0x1704e5=_0x1704e5-0x0;var _0x5328f3=_0xed05[_0x1704e5];return _0x5328f3;};'use strict';var Sequelize=require(_0x5ed0('0x0'));module['exports']={'name':{'type':Sequelize[_0x5ed0('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x5ed0('0x1')]},'active':{'type':Sequelize[_0x5ed0('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x5ed0('0x1')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x5ed0('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x5ed0('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x5ed0('0x4')](_0x5ed0('0x5'),'quarters','months',_0x5ed0('0x6'),_0x5ed0('0x7'),'hours',_0x5ed0('0x8')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x5ed0('0x4')](_0x5ed0('0x9'),'pdf',_0x5ed0('0xa')),'allowNull':![],'defaultValue':_0x5ed0('0x9')},'type':{'type':Sequelize['ENUM']('custom',_0x5ed0('0xb')),'allowNull':![],'defaultValue':_0x5ed0('0xc')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x5ed0('0xd')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x5ed0('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xafdf=['INTEGER','ENUM','years','quarters','months','days','hours','minutes','csv','xlsx','custom','default','TEXT','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE'];(function(_0x3e0a8c,_0x1f2bf8){var _0x24e2ef=function(_0x45ff13){while(--_0x45ff13){_0x3e0a8c['push'](_0x3e0a8c['shift']());}};_0x24e2ef(++_0x1f2bf8);}(_0xafdf,0xe5));var _0xfafd=function(_0x9781fb,_0x356c8e){_0x9781fb=_0x9781fb-0x0;var _0x2561b7=_0xafdf[_0x9781fb];return _0x2561b7;};'use strict';var Sequelize=require('sequelize');module[_0xfafd('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xfafd('0x1')]},'active':{'type':Sequelize[_0xfafd('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xfafd('0x1')],'allowNull':![],'defaultValue':_0xfafd('0x3')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0xfafd('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xfafd('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xfafd('0x6')](_0xfafd('0x7'),_0xfafd('0x8'),_0xfafd('0x9'),'weeks',_0xfafd('0xa'),_0xfafd('0xb'),_0xfafd('0xc')),'allowNull':![],'defaultValue':_0xfafd('0xa')},'output':{'type':Sequelize[_0xfafd('0x6')](_0xfafd('0xd'),'pdf',_0xfafd('0xe')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xfafd('0x6')](_0xfafd('0xf'),_0xfafd('0x10')),'allowNull':![],'defaultValue':_0xfafd('0xf')},'sendMail':{'type':Sequelize[_0xfafd('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xfafd('0x11')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
index 700d517..c81b120 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc18c=['create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Scheduler','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','run','../../config/schedule','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','update','then','destroy','get','error','stack','name','send','index','map','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','Schedule','rows','catch','fields','find'];(function(_0x1a773e,_0x251779){var _0x33103b=function(_0x53b5a2){while(--_0x53b5a2){_0x1a773e['push'](_0x1a773e['shift']());}};_0x33103b(++_0x251779);}(_0xc18c,0x1f2));var _0xcc18=function(_0x3d4227,_0x5bb4ca){_0x3d4227=_0x3d4227-0x0;var _0x36f169=_0xc18c[_0x3d4227];return _0x36f169;};'use strict';var emlformat=require(_0xcc18('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcc18('0x1'));var jsonpatch=require(_0xcc18('0x2'));var rp=require(_0xcc18('0x3'));var moment=require(_0xcc18('0x4'));var BPromise=require(_0xcc18('0x5'));var Mustache=require(_0xcc18('0x6'));var util=require(_0xcc18('0x7'));var path=require('path');var sox=require(_0xcc18('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcc18('0x9'));var squel=require(_0xcc18('0xa'));var crypto=require(_0xcc18('0xb'));var jsforce=require(_0xcc18('0xc'));var deskjs=require(_0xcc18('0xd'));var toCsv=require(_0xcc18('0xe'));var querystring=require(_0xcc18('0xf'));var Papa=require('papaparse');var Redis=require(_0xcc18('0x10'));var authService=require(_0xcc18('0x11'));var qs=require(_0xcc18('0x12'));var as=require(_0xcc18('0x13'));var hardwareService=require(_0xcc18('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xcc18('0x15'));var licenseUtil=require(_0xcc18('0x16'));var db=require(_0xcc18('0x17'))['db'];function respondWithStatusCode(_0xf074a1,_0x5233ed){_0x5233ed=_0x5233ed||0xcc;return function(_0x41a592){if(_0x41a592){return _0xf074a1[_0xcc18('0x18')](_0x5233ed);}return _0xf074a1[_0xcc18('0x19')](_0x5233ed)[_0xcc18('0x1a')]();};}function respondWithResult(_0x296f49,_0x146ab0){_0x146ab0=_0x146ab0||0xc8;return function(_0x298e75){if(_0x298e75){return _0x296f49[_0xcc18('0x19')](_0x146ab0)[_0xcc18('0x1b')](_0x298e75);}};}function respondWithFilteredResult(_0x2264ed,_0x3f75c8){return function(_0x31e771){if(_0x31e771){var _0x5ed030=typeof _0x3f75c8[_0xcc18('0x1c')]==='undefined'&&typeof _0x3f75c8[_0xcc18('0x1d')]==='undefined';var _0x57d075=_0x31e771[_0xcc18('0x1e')];var _0x59ead8=_0x5ed030?0x0:_0x3f75c8[_0xcc18('0x1c')];var _0xceade2=_0x5ed030?_0x31e771[_0xcc18('0x1e')]:_0x3f75c8[_0xcc18('0x1c')]+_0x3f75c8[_0xcc18('0x1d')];var _0x511688;if(_0xceade2>=_0x57d075){_0xceade2=_0x57d075;_0x511688=0xc8;}else{_0x511688=0xce;}_0x2264ed['status'](_0x511688);return _0x2264ed[_0xcc18('0x1f')](_0xcc18('0x20'),_0x59ead8+'-'+_0xceade2+'/'+_0x57d075)[_0xcc18('0x1b')](_0x31e771);}return null;};}function patchUpdates(_0x50a59c){return function(_0x545009){try{jsonpatch[_0xcc18('0x21')](_0x545009,_0x50a59c,!![]);}catch(_0x2e3f75){return BPromise['reject'](_0x2e3f75);}return _0x545009['save']();};}function saveUpdates(_0x371b4e,_0x47ad4c){return function(_0x25fd11){if(_0x25fd11){return _0x25fd11[_0xcc18('0x22')](_0x371b4e)[_0xcc18('0x23')](function(_0x1406a7){return _0x1406a7;});}return null;};}function removeEntity(_0x398e22,_0x2f7a4d){return function(_0x138124){if(_0x138124){return _0x138124[_0xcc18('0x24')]()['then'](function(){var _0x14a09a=_0x138124[_0xcc18('0x25')]({'plain':!![]});var _0x307bb4='Scheduler';return db['UserProfileResource'][_0xcc18('0x24')]({'where':{'type':_0x307bb4,'resourceId':_0x14a09a['id']}})['then'](function(){return _0x138124;});})[_0xcc18('0x23')](function(){_0x398e22[_0xcc18('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf1a773,_0x290585){return function(_0xdac357){if(!_0xdac357){_0xf1a773[_0xcc18('0x18')](0x194);}return _0xdac357;};}function handleError(_0x463fda,_0x2d25cd){_0x2d25cd=_0x2d25cd||0x1f4;return function(_0xa10c28){logger[_0xcc18('0x26')](_0xa10c28[_0xcc18('0x27')]);if(_0xa10c28[_0xcc18('0x28')]){delete _0xa10c28[_0xcc18('0x28')];}_0x463fda[_0xcc18('0x19')](_0x2d25cd)[_0xcc18('0x29')](_0xa10c28);};}exports[_0xcc18('0x2a')]=function(_0x3337e8,_0x3a8f0a){var _0x35a9bc={},_0x412227={},_0xe92a25={'count':0x0,'rows':[]};var _0x27bc49=_[_0xcc18('0x2b')](db['Schedule'][_0xcc18('0x2c')],function(_0x32b8e4){return{'name':_0x32b8e4['fieldName'],'type':_0x32b8e4[_0xcc18('0x2d')][_0xcc18('0x2e')]};});_0x412227[_0xcc18('0x2f')]=_[_0xcc18('0x2b')](_0x27bc49,_0xcc18('0x28'));_0x412227['query']=_[_0xcc18('0x30')](_0x3337e8['query']);_0x412227[_0xcc18('0x31')]=_[_0xcc18('0x32')](_0x412227[_0xcc18('0x2f')],_0x412227[_0xcc18('0x33')]);_0x35a9bc[_0xcc18('0x34')]=_[_0xcc18('0x32')](_0x412227[_0xcc18('0x2f')],qs['fields'](_0x3337e8[_0xcc18('0x33')]['fields']));_0x35a9bc[_0xcc18('0x34')]=_0x35a9bc[_0xcc18('0x34')][_0xcc18('0x35')]?_0x35a9bc[_0xcc18('0x34')]:_0x412227[_0xcc18('0x2f')];if(!_0x3337e8[_0xcc18('0x33')][_0xcc18('0x36')]('nolimit')){_0x35a9bc['limit']=qs[_0xcc18('0x1d')](_0x3337e8[_0xcc18('0x33')][_0xcc18('0x1d')]);_0x35a9bc[_0xcc18('0x1c')]=qs['offset'](_0x3337e8['query'][_0xcc18('0x1c')]);}_0x35a9bc[_0xcc18('0x37')]=qs[_0xcc18('0x38')](_0x3337e8[_0xcc18('0x33')][_0xcc18('0x38')]);_0x35a9bc[_0xcc18('0x39')]=qs['filters'](_[_0xcc18('0x3a')](_0x3337e8['query'],_0x412227[_0xcc18('0x31')]),_0x27bc49);if(_0x3337e8['query'][_0xcc18('0x3b')]){_0x35a9bc['where']=_[_0xcc18('0x3c')](_0x35a9bc[_0xcc18('0x39')],{'$or':_[_0xcc18('0x2b')](_0x27bc49,function(_0x3a57dc){if(_0x3a57dc[_0xcc18('0x2d')]!==_0xcc18('0x3d')){var _0x259f22={};_0x259f22[_0x3a57dc[_0xcc18('0x28')]]={'$like':'%'+_0x3337e8['query'][_0xcc18('0x3b')]+'%'};return _0x259f22;}})});}_0x35a9bc=_[_0xcc18('0x3c')]({},_0x35a9bc,_0x3337e8[_0xcc18('0x3e')]);var _0x55d6f6={'where':_0x35a9bc[_0xcc18('0x39')]};return db['Schedule'][_0xcc18('0x1e')](_0x55d6f6)['then'](function(_0x25ae1b){_0xe92a25[_0xcc18('0x1e')]=_0x25ae1b;if(_0x3337e8['query']['includeAll']){_0x35a9bc[_0xcc18('0x3f')]=[{'all':!![]}];}return db[_0xcc18('0x40')]['findAll'](_0x35a9bc);})[_0xcc18('0x23')](function(_0x2b6d60){_0xe92a25[_0xcc18('0x41')]=_0x2b6d60;return _0xe92a25;})[_0xcc18('0x23')](respondWithFilteredResult(_0x3a8f0a,_0x35a9bc))[_0xcc18('0x42')](handleError(_0x3a8f0a,null));};exports['show']=function(_0x75f4c2,_0x457e63){var _0x4e37a7={'raw':![],'where':{'id':_0x75f4c2['params']['id']}},_0x1faa45={};_0x1faa45[_0xcc18('0x2f')]=_[_0xcc18('0x30')](db[_0xcc18('0x40')][_0xcc18('0x2c')]);_0x1faa45['query']=_[_0xcc18('0x30')](_0x75f4c2[_0xcc18('0x33')]);_0x1faa45[_0xcc18('0x31')]=_['intersection'](_0x1faa45[_0xcc18('0x2f')],_0x1faa45['query']);_0x4e37a7[_0xcc18('0x34')]=_[_0xcc18('0x32')](_0x1faa45['model'],qs[_0xcc18('0x43')](_0x75f4c2['query'][_0xcc18('0x43')]));_0x4e37a7[_0xcc18('0x34')]=_0x4e37a7['attributes']['length']?_0x4e37a7[_0xcc18('0x34')]:_0x1faa45[_0xcc18('0x2f')];if(_0x75f4c2[_0xcc18('0x33')]['includeAll']){_0x4e37a7[_0xcc18('0x3f')]=[{'all':!![]}];}_0x4e37a7=_[_0xcc18('0x3c')]({},_0x4e37a7,_0x75f4c2[_0xcc18('0x3e')]);return db['Schedule'][_0xcc18('0x44')](_0x4e37a7)['then'](handleEntityNotFound(_0x457e63,null))['then'](respondWithResult(_0x457e63,null))[_0xcc18('0x42')](handleError(_0x457e63,null));};exports[_0xcc18('0x45')]=function(_0x549cce,_0x1a3210){return db[_0xcc18('0x40')][_0xcc18('0x45')](_0x549cce['body'],{})[_0xcc18('0x23')](function(_0x5775b1){var _0x14268b=_0x549cce['user'][_0xcc18('0x25')]({'plain':!![]});if(!_0x14268b)throw new Error(_0xcc18('0x46'));if(_0x14268b[_0xcc18('0x47')]===_0xcc18('0x48')){var _0x273b9d=_0x5775b1[_0xcc18('0x25')]({'plain':!![]});var _0x4f5f55=_0xcc18('0x49');return db[_0xcc18('0x4a')][_0xcc18('0x44')]({'where':{'name':_0x4f5f55,'userProfileId':_0x14268b['userProfileId']},'raw':!![]})[_0xcc18('0x23')](function(_0x5a9a92){if(_0x5a9a92&&_0x5a9a92['autoAssociation']===0x0){return db[_0xcc18('0x4b')][_0xcc18('0x45')]({'name':_0x273b9d[_0xcc18('0x28')],'resourceId':_0x273b9d['id'],'type':_0x5a9a92['name'],'sectionId':_0x5a9a92['id']},{})[_0xcc18('0x23')](function(){return _0x5775b1;});}else{return _0x5775b1;}})['catch'](function(_0x38309b){logger[_0xcc18('0x26')](_0xcc18('0x4c'),_0x38309b);throw _0x38309b;});}return _0x5775b1;})[_0xcc18('0x23')](respondWithResult(_0x1a3210,0xc9))['catch'](handleError(_0x1a3210,null));};exports[_0xcc18('0x22')]=function(_0xdb6d06,_0x44a821){if(_0xdb6d06[_0xcc18('0x4d')]['id']){delete _0xdb6d06['body']['id'];}return db[_0xcc18('0x40')][_0xcc18('0x44')]({'where':{'id':_0xdb6d06[_0xcc18('0x4e')]['id']}})[_0xcc18('0x23')](handleEntityNotFound(_0x44a821,null))[_0xcc18('0x23')](saveUpdates(_0xdb6d06[_0xcc18('0x4d')],null))['then'](respondWithResult(_0x44a821,null))[_0xcc18('0x42')](handleError(_0x44a821,null));};exports[_0xcc18('0x24')]=function(_0x221f9f,_0x456313){return db[_0xcc18('0x40')][_0xcc18('0x44')]({'where':{'id':_0x221f9f[_0xcc18('0x4e')]['id']}})[_0xcc18('0x23')](handleEntityNotFound(_0x456313,null))[_0xcc18('0x23')](removeEntity(_0x456313,null))[_0xcc18('0x42')](handleError(_0x456313,null));};exports[_0xcc18('0x4f')]=function(_0x28c1f9,_0x21996b,_0x331b60){var _0x2eae43=require(_0xcc18('0x50'));return db[_0xcc18('0x40')][_0xcc18('0x44')]({'where':{'id':_0x28c1f9[_0xcc18('0x4e')]['id']},'raw':!![]})[_0xcc18('0x23')](handleEntityNotFound(_0x21996b,null))[_0xcc18('0x23')](function(){_0x2eae43[_0xcc18('0x4f')](_0x28c1f9[_0xcc18('0x4e')]['id']);})['then'](respondWithStatusCode(_0x21996b,null))[_0xcc18('0x42')](handleError(_0x21996b,null));};
\ No newline at end of file
+var _0x0788=['index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','sort','where','filters','merge','VIRTUAL','options','Schedule','includeAll','rows','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','run','../../config/schedule','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','update','then','get','Scheduler','UserProfileResource','destroy','error','stack','name'];(function(_0x2fbbd3,_0x4308cc){var _0x43aabc=function(_0x2df53a){while(--_0x2df53a){_0x2fbbd3['push'](_0x2fbbd3['shift']());}};_0x43aabc(++_0x4308cc);}(_0x0788,0x1a6));var _0x8078=function(_0x30b4c8,_0x41d880){_0x30b4c8=_0x30b4c8-0x0;var _0x3f6542=_0x0788[_0x30b4c8];return _0x3f6542;};'use strict';var emlformat=require(_0x8078('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8078('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8078('0x2'));var moment=require(_0x8078('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8078('0x4'));var util=require(_0x8078('0x5'));var path=require(_0x8078('0x6'));var sox=require(_0x8078('0x7'));var csv=require(_0x8078('0x8'));var ejs=require(_0x8078('0x9'));var fs=require('fs');var fs_extra=require(_0x8078('0xa'));var _=require('lodash');var squel=require(_0x8078('0xb'));var crypto=require(_0x8078('0xc'));var jsforce=require(_0x8078('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8078('0x8'));var querystring=require(_0x8078('0xe'));var Papa=require('papaparse');var Redis=require(_0x8078('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8078('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8078('0x11'));var logger=require(_0x8078('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x8078('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x8078('0x14'))['db'];function respondWithStatusCode(_0x21f5a8,_0x4079e1){_0x4079e1=_0x4079e1||0xcc;return function(_0x19765d){if(_0x19765d){return _0x21f5a8[_0x8078('0x15')](_0x4079e1);}return _0x21f5a8[_0x8078('0x16')](_0x4079e1)[_0x8078('0x17')]();};}function respondWithResult(_0x51a2c6,_0x3071ff){_0x3071ff=_0x3071ff||0xc8;return function(_0x22584b){if(_0x22584b){return _0x51a2c6[_0x8078('0x16')](_0x3071ff)[_0x8078('0x18')](_0x22584b);}};}function respondWithFilteredResult(_0x540dd0,_0x1cc2fa){return function(_0x54288e){if(_0x54288e){var _0x5e6db1=typeof _0x1cc2fa['offset']===_0x8078('0x19')&&typeof _0x1cc2fa[_0x8078('0x1a')]===_0x8078('0x19');var _0x6eb65f=_0x54288e[_0x8078('0x1b')];var _0x149019=_0x5e6db1?0x0:_0x1cc2fa[_0x8078('0x1c')];var _0x29a3a2=_0x5e6db1?_0x54288e[_0x8078('0x1b')]:_0x1cc2fa[_0x8078('0x1c')]+_0x1cc2fa[_0x8078('0x1a')];var _0x79ef05;if(_0x29a3a2>=_0x6eb65f){_0x29a3a2=_0x6eb65f;_0x79ef05=0xc8;}else{_0x79ef05=0xce;}_0x540dd0[_0x8078('0x16')](_0x79ef05);return _0x540dd0['set']('Content-Range',_0x149019+'-'+_0x29a3a2+'/'+_0x6eb65f)['json'](_0x54288e);}return null;};}function patchUpdates(_0x4db381){return function(_0xdbe7ce){try{jsonpatch[_0x8078('0x1d')](_0xdbe7ce,_0x4db381,!![]);}catch(_0x552649){return BPromise[_0x8078('0x1e')](_0x552649);}return _0xdbe7ce['save']();};}function saveUpdates(_0x50fd58,_0x2e3650){return function(_0x4bbc51){if(_0x4bbc51){return _0x4bbc51[_0x8078('0x1f')](_0x50fd58)[_0x8078('0x20')](function(_0x48d764){return _0x48d764;});}return null;};}function removeEntity(_0xc50b2f,_0x2f9b16){return function(_0x43e0f9){if(_0x43e0f9){return _0x43e0f9['destroy']()['then'](function(){var _0x3a9adc=_0x43e0f9[_0x8078('0x21')]({'plain':!![]});var _0x34bcb0=_0x8078('0x22');return db[_0x8078('0x23')][_0x8078('0x24')]({'where':{'type':_0x34bcb0,'resourceId':_0x3a9adc['id']}})['then'](function(){return _0x43e0f9;});})[_0x8078('0x20')](function(){_0xc50b2f[_0x8078('0x16')](0xcc)[_0x8078('0x17')]();});}};}function handleEntityNotFound(_0x3a724e,_0x161e3c){return function(_0x2e48e2){if(!_0x2e48e2){_0x3a724e[_0x8078('0x15')](0x194);}return _0x2e48e2;};}function handleError(_0x74cfd3,_0x23b838){_0x23b838=_0x23b838||0x1f4;return function(_0x2a0a90){logger[_0x8078('0x25')](_0x2a0a90[_0x8078('0x26')]);if(_0x2a0a90[_0x8078('0x27')]){delete _0x2a0a90[_0x8078('0x27')];}_0x74cfd3[_0x8078('0x16')](_0x23b838)['send'](_0x2a0a90);};}exports[_0x8078('0x28')]=function(_0x5434c8,_0x3ba231){var _0x4ed4a2={},_0x2e9528={},_0x16813a={'count':0x0,'rows':[]};var _0x20ed7d=_[_0x8078('0x29')](db['Schedule'][_0x8078('0x2a')],function(_0x53eb94){return{'name':_0x53eb94[_0x8078('0x2b')],'type':_0x53eb94[_0x8078('0x2c')][_0x8078('0x2d')]};});_0x2e9528[_0x8078('0x2e')]=_[_0x8078('0x29')](_0x20ed7d,_0x8078('0x27'));_0x2e9528[_0x8078('0x2f')]=_[_0x8078('0x30')](_0x5434c8[_0x8078('0x2f')]);_0x2e9528['filters']=_[_0x8078('0x31')](_0x2e9528[_0x8078('0x2e')],_0x2e9528['query']);_0x4ed4a2['attributes']=_[_0x8078('0x31')](_0x2e9528[_0x8078('0x2e')],qs[_0x8078('0x32')](_0x5434c8['query'][_0x8078('0x32')]));_0x4ed4a2[_0x8078('0x33')]=_0x4ed4a2['attributes'][_0x8078('0x34')]?_0x4ed4a2[_0x8078('0x33')]:_0x2e9528[_0x8078('0x2e')];if(!_0x5434c8['query']['hasOwnProperty'](_0x8078('0x35'))){_0x4ed4a2['limit']=qs[_0x8078('0x1a')](_0x5434c8['query'][_0x8078('0x1a')]);_0x4ed4a2[_0x8078('0x1c')]=qs[_0x8078('0x1c')](_0x5434c8['query'][_0x8078('0x1c')]);}_0x4ed4a2['order']=qs[_0x8078('0x36')](_0x5434c8[_0x8078('0x2f')]['sort']);_0x4ed4a2[_0x8078('0x37')]=qs['filters'](_['pick'](_0x5434c8[_0x8078('0x2f')],_0x2e9528[_0x8078('0x38')]),_0x20ed7d);if(_0x5434c8[_0x8078('0x2f')]['filter']){_0x4ed4a2['where']=_[_0x8078('0x39')](_0x4ed4a2[_0x8078('0x37')],{'$or':_[_0x8078('0x29')](_0x20ed7d,function(_0x5cf35c){if(_0x5cf35c[_0x8078('0x2c')]!==_0x8078('0x3a')){var _0x4631c6={};_0x4631c6[_0x5cf35c['name']]={'$like':'%'+_0x5434c8[_0x8078('0x2f')]['filter']+'%'};return _0x4631c6;}})});}_0x4ed4a2=_[_0x8078('0x39')]({},_0x4ed4a2,_0x5434c8[_0x8078('0x3b')]);var _0x5096b4={'where':_0x4ed4a2[_0x8078('0x37')]};return db[_0x8078('0x3c')][_0x8078('0x1b')](_0x5096b4)[_0x8078('0x20')](function(_0x14bab3){_0x16813a['count']=_0x14bab3;if(_0x5434c8[_0x8078('0x2f')][_0x8078('0x3d')]){_0x4ed4a2['include']=[{'all':!![]}];}return db[_0x8078('0x3c')]['findAll'](_0x4ed4a2);})['then'](function(_0x54ffac){_0x16813a[_0x8078('0x3e')]=_0x54ffac;return _0x16813a;})['then'](respondWithFilteredResult(_0x3ba231,_0x4ed4a2))[_0x8078('0x3f')](handleError(_0x3ba231,null));};exports[_0x8078('0x40')]=function(_0x316a53,_0x3fff66){var _0x312c43={'raw':![],'where':{'id':_0x316a53['params']['id']}},_0x11d576={};_0x11d576['model']=_[_0x8078('0x30')](db[_0x8078('0x3c')][_0x8078('0x2a')]);_0x11d576[_0x8078('0x2f')]=_[_0x8078('0x30')](_0x316a53[_0x8078('0x2f')]);_0x11d576['filters']=_[_0x8078('0x31')](_0x11d576[_0x8078('0x2e')],_0x11d576['query']);_0x312c43[_0x8078('0x33')]=_[_0x8078('0x31')](_0x11d576[_0x8078('0x2e')],qs[_0x8078('0x32')](_0x316a53['query'][_0x8078('0x32')]));_0x312c43[_0x8078('0x33')]=_0x312c43[_0x8078('0x33')][_0x8078('0x34')]?_0x312c43['attributes']:_0x11d576[_0x8078('0x2e')];if(_0x316a53[_0x8078('0x2f')]['includeAll']){_0x312c43[_0x8078('0x41')]=[{'all':!![]}];}_0x312c43=_[_0x8078('0x39')]({},_0x312c43,_0x316a53['options']);return db[_0x8078('0x3c')][_0x8078('0x42')](_0x312c43)['then'](handleEntityNotFound(_0x3fff66,null))[_0x8078('0x20')](respondWithResult(_0x3fff66,null))[_0x8078('0x3f')](handleError(_0x3fff66,null));};exports[_0x8078('0x43')]=function(_0x2bcce9,_0x1cf4d6){return db[_0x8078('0x3c')][_0x8078('0x43')](_0x2bcce9['body'],{})[_0x8078('0x20')](function(_0x205f48){var _0x33c0d1=_0x2bcce9[_0x8078('0x44')]['get']({'plain':!![]});if(!_0x33c0d1)throw new Error(_0x8078('0x45'));if(_0x33c0d1['role']===_0x8078('0x44')){var _0x4681f4=_0x205f48[_0x8078('0x21')]({'plain':!![]});var _0x2a7d29=_0x8078('0x22');return db[_0x8078('0x46')][_0x8078('0x42')]({'where':{'name':_0x2a7d29,'userProfileId':_0x33c0d1['userProfileId']},'raw':!![]})[_0x8078('0x20')](function(_0x2c5aa1){if(_0x2c5aa1&&_0x2c5aa1[_0x8078('0x47')]===0x0){return db['UserProfileResource'][_0x8078('0x43')]({'name':_0x4681f4[_0x8078('0x27')],'resourceId':_0x4681f4['id'],'type':_0x2c5aa1[_0x8078('0x27')],'sectionId':_0x2c5aa1['id']},{})[_0x8078('0x20')](function(){return _0x205f48;});}else{return _0x205f48;}})[_0x8078('0x3f')](function(_0x153e0d){logger[_0x8078('0x25')](_0x8078('0x48'),_0x153e0d);throw _0x153e0d;});}return _0x205f48;})[_0x8078('0x20')](respondWithResult(_0x1cf4d6,0xc9))[_0x8078('0x3f')](handleError(_0x1cf4d6,null));};exports[_0x8078('0x1f')]=function(_0x51f56e,_0x322315){if(_0x51f56e[_0x8078('0x49')]['id']){delete _0x51f56e['body']['id'];}return db[_0x8078('0x3c')][_0x8078('0x42')]({'where':{'id':_0x51f56e[_0x8078('0x4a')]['id']}})['then'](handleEntityNotFound(_0x322315,null))[_0x8078('0x20')](saveUpdates(_0x51f56e[_0x8078('0x49')],null))[_0x8078('0x20')](respondWithResult(_0x322315,null))['catch'](handleError(_0x322315,null));};exports['destroy']=function(_0x1c8829,_0x145095){return db[_0x8078('0x3c')][_0x8078('0x42')]({'where':{'id':_0x1c8829[_0x8078('0x4a')]['id']}})['then'](handleEntityNotFound(_0x145095,null))[_0x8078('0x20')](removeEntity(_0x145095,null))[_0x8078('0x3f')](handleError(_0x145095,null));};exports[_0x8078('0x4b')]=function(_0x23bae1,_0x5a713a,_0x2df614){var _0x51120b=require(_0x8078('0x4c'));return db[_0x8078('0x3c')][_0x8078('0x42')]({'where':{'id':_0x23bae1[_0x8078('0x4a')]['id']},'raw':!![]})[_0x8078('0x20')](handleEntityNotFound(_0x5a713a,null))[_0x8078('0x20')](function(){_0x51120b[_0x8078('0x4b')](_0x23bae1[_0x8078('0x4a')]['id']);})['then'](respondWithStatusCode(_0x5a713a,null))['catch'](handleError(_0x5a713a,null));};
\ No newline at end of file
index 73fecca..1fa8bd1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe956=['moment','bluebird','rimraf','./schedule.attributes','exports','define','tools_schedules','lodash','../../config/logger','api'];(function(_0x4b14b8,_0x312731){var _0x298396=function(_0x498c1d){while(--_0x498c1d){_0x4b14b8['push'](_0x4b14b8['shift']());}};_0x298396(++_0x312731);}(_0xe956,0xa7));var _0x6e95=function(_0x3eec3b,_0x544f37){_0x3eec3b=_0x3eec3b-0x0;var _0x2b283f=_0xe956[_0x3eec3b];return _0x2b283f;};'use strict';var _=require(_0x6e95('0x0'));var util=require('util');var logger=require(_0x6e95('0x1'))(_0x6e95('0x2'));var moment=require(_0x6e95('0x3'));var BPromise=require(_0x6e95('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6e95('0x5'));var config=require('../../config/environment');var attributes=require(_0x6e95('0x6'));module[_0x6e95('0x7')]=function(_0x3093ff,_0x4a4fa9){return _0x3093ff[_0x6e95('0x8')]('Schedule',attributes,{'tableName':_0x6e95('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8234=['Schedule','tools_schedules','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./schedule.attributes','define'];(function(_0x455c6c,_0x1e78b7){var _0x488242=function(_0x3e8fb0){while(--_0x3e8fb0){_0x455c6c['push'](_0x455c6c['shift']());}};_0x488242(++_0x1e78b7);}(_0x8234,0x1d6));var _0x4823=function(_0xc8fdda,_0x3c5514){_0xc8fdda=_0xc8fdda-0x0;var _0x3cf95b=_0x8234[_0xc8fdda];return _0x3cf95b;};'use strict';var _=require(_0x4823('0x0'));var util=require(_0x4823('0x1'));var logger=require('../../config/logger')(_0x4823('0x2'));var moment=require(_0x4823('0x3'));var BPromise=require(_0x4823('0x4'));var rp=require(_0x4823('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4823('0x6'));var config=require(_0x4823('0x7'));var attributes=require(_0x4823('0x8'));module['exports']=function(_0x2e61f4,_0x90b4ef){return _0x2e61f4[_0x4823('0x9')](_0x4823('0xa'),attributes,{'tableName':_0x4823('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index ae27092..a1e3d63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6c1b=['http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3d3ddd,_0x59b504){var _0x52a4f9=function(_0x349a69){while(--_0x349a69){_0x3d3ddd['push'](_0x3d3ddd['shift']());}};_0x52a4f9(++_0x59b504);}(_0x6c1b,0xee));var _0xb6c1=function(_0xe2ed88,_0x2dd704){_0xe2ed88=_0xe2ed88-0x0;var _0x194e53=_0x6c1b[_0xe2ed88];return _0x194e53;};'use strict';var _=require(_0xb6c1('0x0'));var util=require(_0xb6c1('0x1'));var moment=require(_0xb6c1('0x2'));var BPromise=require(_0xb6c1('0x3'));var rs=require(_0xb6c1('0x4'));var fs=require('fs');var Redis=require(_0xb6c1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb6c1('0x6'));var logger=require(_0xb6c1('0x7'))(_0xb6c1('0x8'));var config=require(_0xb6c1('0x9'));var jayson=require(_0xb6c1('0xa'));var client=jayson[_0xb6c1('0xb')][_0xb6c1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xbdcd21,_0x39e369,_0x3ab61c){return new BPromise(function(_0x232fc5,_0xb9740e){return client[_0xb6c1('0xd')](_0xbdcd21,_0x3ab61c)[_0xb6c1('0xe')](function(_0x48819f){logger[_0xb6c1('0xf')](_0xb6c1('0x10'),_0x39e369,_0xb6c1('0x11'));logger[_0xb6c1('0x12')](_0xb6c1('0x13'),_0x39e369,_0xb6c1('0x11'),JSON[_0xb6c1('0x14')](_0x48819f));if(_0x48819f['error']){if(_0x48819f['error'][_0xb6c1('0x15')]===0x1f4){logger[_0xb6c1('0x16')](_0xb6c1('0x10'),_0x39e369,_0x48819f['error'][_0xb6c1('0x17')]);return _0xb9740e(_0x48819f[_0xb6c1('0x16')][_0xb6c1('0x17')]);}logger['error'](_0xb6c1('0x10'),_0x39e369,_0x48819f[_0xb6c1('0x16')][_0xb6c1('0x17')]);return _0x232fc5(_0x48819f['error'][_0xb6c1('0x17')]);}else{logger[_0xb6c1('0xf')](_0xb6c1('0x10'),_0x39e369,_0xb6c1('0x11'));_0x232fc5(_0x48819f['result'][_0xb6c1('0x17')]);}})[_0xb6c1('0x18')](function(_0x4294e4){logger['error'](_0xb6c1('0x10'),_0x39e369,_0x4294e4);_0xb9740e(_0x4294e4);});});}
\ No newline at end of file
+var _0x1b42=['then','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','error','code','message','info','Schedule,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x267775,_0x1d38cd){var _0x1e9f21=function(_0x9c2d62){while(--_0x9c2d62){_0x267775['push'](_0x267775['shift']());}};_0x1e9f21(++_0x1d38cd);}(_0x1b42,0x95));var _0x21b4=function(_0x4fab6d,_0x244b72){_0x4fab6d=_0x4fab6d-0x0;var _0x1c454c=_0x1b42[_0x4fab6d];return _0x1c454c;};'use strict';var _=require(_0x21b4('0x0'));var util=require(_0x21b4('0x1'));var moment=require(_0x21b4('0x2'));var BPromise=require(_0x21b4('0x3'));var rs=require(_0x21b4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x21b4('0x5'));var logger=require(_0x21b4('0x6'))(_0x21b4('0x7'));var config=require(_0x21b4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x21b4('0x9')][_0x21b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x331a64,_0xeaad6d,_0xa9d0f0){return new BPromise(function(_0x345976,_0x3be694){return client[_0x21b4('0xb')](_0x331a64,_0xa9d0f0)[_0x21b4('0xc')](function(_0x4c87d1){logger['info']('Schedule,\x20%s,\x20%s',_0xeaad6d,_0x21b4('0xd'));logger[_0x21b4('0xe')](_0x21b4('0xf'),_0xeaad6d,_0x21b4('0xd'),JSON['stringify'](_0x4c87d1));if(_0x4c87d1[_0x21b4('0x10')]){if(_0x4c87d1[_0x21b4('0x10')][_0x21b4('0x11')]===0x1f4){logger[_0x21b4('0x10')]('Schedule,\x20%s,\x20%s',_0xeaad6d,_0x4c87d1['error'][_0x21b4('0x12')]);return _0x3be694(_0x4c87d1['error'][_0x21b4('0x12')]);}logger['error']('Schedule,\x20%s,\x20%s',_0xeaad6d,_0x4c87d1['error'][_0x21b4('0x12')]);return _0x345976(_0x4c87d1[_0x21b4('0x10')][_0x21b4('0x12')]);}else{logger[_0x21b4('0x13')](_0x21b4('0x14'),_0xeaad6d,_0x21b4('0xd'));_0x345976(_0x4c87d1[_0x21b4('0x15')][_0x21b4('0x12')]);}})[_0x21b4('0x16')](function(_0x36743a){logger[_0x21b4('0x10')](_0x21b4('0x14'),_0xeaad6d,_0x36743a);_0x3be694(_0x36743a);});});}
\ No newline at end of file
index 08efd6e..0122b66 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x21c2=['get','isAuthenticated','index','/describe','/:id','/:id/download','download','post','create','put','update','delete','destroy','exports','path','express','Router','fs-extra','../../config/environment','./screenRecording.controller'];(function(_0x44511f,_0x1eed33){var _0xa1dd0d=function(_0x1b1069){while(--_0x1b1069){_0x44511f['push'](_0x44511f['shift']());}};_0xa1dd0d(++_0x1eed33);}(_0x21c2,0x86));var _0x221c=function(_0x2b10d7,_0x33db4f){_0x2b10d7=_0x2b10d7-0x0;var _0x47c1c3=_0x21c2[_0x2b10d7];return _0x47c1c3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x221c('0x0'));var timeout=require('connect-timeout');var express=require(_0x221c('0x1'));var router=express[_0x221c('0x2')]();var fs_extra=require(_0x221c('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x221c('0x4'));var controller=require(_0x221c('0x5'));router[_0x221c('0x6')]('/',auth[_0x221c('0x7')](),controller[_0x221c('0x8')]);router[_0x221c('0x6')](_0x221c('0x9'),auth[_0x221c('0x7')](),controller['describe']);router[_0x221c('0x6')](_0x221c('0xa'),auth[_0x221c('0x7')](),controller['show']);router[_0x221c('0x6')](_0x221c('0xb'),auth[_0x221c('0x7')](),controller[_0x221c('0xc')]);router[_0x221c('0xd')]('/',auth['isAuthenticated'](),controller[_0x221c('0xe')]);router[_0x221c('0xf')](_0x221c('0xa'),auth[_0x221c('0x7')](),controller[_0x221c('0x10')]);router[_0x221c('0x11')](_0x221c('0xa'),auth['isAuthenticated'](),controller[_0x221c('0x12')]);module[_0x221c('0x13')]=router;
\ No newline at end of file
+var _0xce86=['./screenRecording.controller','get','index','/describe','isAuthenticated','describe','show','download','post','create','put','update','delete','/:id','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment'];(function(_0xacb84e,_0x2c8663){var _0x484514=function(_0x2fb392){while(--_0x2fb392){_0xacb84e['push'](_0xacb84e['shift']());}};_0x484514(++_0x2c8663);}(_0xce86,0x19b));var _0x6ce8=function(_0x383dbb,_0x17d41b){_0x383dbb=_0x383dbb-0x0;var _0x6e8bde=_0xce86[_0x383dbb];return _0x6e8bde;};'use strict';var multer=require(_0x6ce8('0x0'));var util=require(_0x6ce8('0x1'));var path=require(_0x6ce8('0x2'));var timeout=require(_0x6ce8('0x3'));var express=require(_0x6ce8('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6ce8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6ce8('0x6'));var controller=require(_0x6ce8('0x7'));router[_0x6ce8('0x8')]('/',auth['isAuthenticated'](),controller[_0x6ce8('0x9')]);router['get'](_0x6ce8('0xa'),auth[_0x6ce8('0xb')](),controller[_0x6ce8('0xc')]);router[_0x6ce8('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x6ce8('0xd')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x6ce8('0xe')]);router[_0x6ce8('0xf')]('/',auth['isAuthenticated'](),controller[_0x6ce8('0x10')]);router[_0x6ce8('0x11')]('/:id',auth[_0x6ce8('0xb')](),controller[_0x6ce8('0x12')]);router[_0x6ce8('0x13')](_0x6ce8('0x14'),auth[_0x6ce8('0xb')](),controller[_0x6ce8('0x15')]);module['exports']=router;
\ No newline at end of file
index 34d4e54..73858b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcefd=['subtract','closedAt','duration','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','STRING','replace','setDataValue','INTEGER'];(function(_0x178dfe,_0x23a6b3){var _0x16e620=function(_0x4cbe78){while(--_0x4cbe78){_0x178dfe['push'](_0x178dfe['shift']());}};_0x16e620(++_0x23a6b3);}(_0xcefd,0x1bd));var _0xdcef=function(_0x17a29e,_0x242d8c){_0x17a29e=_0x17a29e-0x0;var _0x26f32e=_0xcefd[_0x17a29e];return _0x26f32e;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xdcef('0x0'));var path=require(_0xdcef('0x1'));var config=require(_0xdcef('0x2'));module[_0xdcef('0x3')]={'format':{'type':Sequelize[_0xdcef('0x4')],'get':function(){return this[_0xdcef('0x5')](_0xdcef('0x6'))?path['extname'](this[_0xdcef('0x5')](_0xdcef('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xdcef('0x7')]},'channel':{'type':Sequelize[_0xdcef('0x7')]},'value':{'type':Sequelize[_0xdcef('0x7')],'set':function(_0x4ba458){var _0x3b9fec=_0x4ba458[_0xdcef('0x8')](/\\/g,'/');this[_0xdcef('0x9')](_0xdcef('0x6'),_0x3b9fec);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xdcef('0xa')],'set':function(_0xbb7067){this[_0xdcef('0x9')]('startedAt',moment()[_0xdcef('0xb')](_0xbb7067,'ms'));this['setDataValue'](_0xdcef('0xc'),moment());this[_0xdcef('0x9')](_0xdcef('0xd'),_0xbb7067);}},'startedAt':{'type':Sequelize[_0xdcef('0xe')],'get':function(){return moment(this[_0xdcef('0x5')]('startedAt'))[_0xdcef('0xf')](_0xdcef('0x10'))['toString']();}},'closedAt':{'type':Sequelize[_0xdcef('0xe')],'get':function(){return moment(this['getDataValue'](_0xdcef('0xc')))[_0xdcef('0xf')](_0xdcef('0x10'))[_0xdcef('0x11')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xdcef('0x5')](_0xdcef('0x12')))['format'](_0xdcef('0x10'))[_0xdcef('0x11')]();}},'updatedAt':{'type':Sequelize[_0xdcef('0xe')],'get':function(){return moment(this['getDataValue']('updatedAt'))[_0xdcef('0xf')](_0xdcef('0x10'))[_0xdcef('0x11')]();}}};
\ No newline at end of file
+var _0xf5b6=['format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','path','../../config/environment','exports','VIRTUAL','value','extname','getDataValue','STRING','setDataValue','INTEGER','startedAt','closedAt','duration','DATE'];(function(_0x4f2fc1,_0x3e5049){var _0x3944a0=function(_0x3e941b){while(--_0x3e941b){_0x4f2fc1['push'](_0x4f2fc1['shift']());}};_0x3944a0(++_0x3e5049);}(_0xf5b6,0x1b4));var _0x6f5b=function(_0xfefff8,_0x47ab74){_0xfefff8=_0xfefff8-0x0;var _0x22b3b5=_0xf5b6[_0xfefff8];return _0x22b3b5;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var path=require(_0x6f5b('0x0'));var config=require(_0x6f5b('0x1'));module[_0x6f5b('0x2')]={'format':{'type':Sequelize[_0x6f5b('0x3')],'get':function(){return this['getDataValue'](_0x6f5b('0x4'))?path[_0x6f5b('0x5')](this[_0x6f5b('0x6')](_0x6f5b('0x4'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x6f5b('0x7')],'set':function(_0x5cf395){var _0x58899e=_0x5cf395['replace'](/\\/g,'/');this[_0x6f5b('0x8')]('value',_0x58899e);}},'rating':{'type':Sequelize[_0x6f5b('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0x6f5b('0x9')],'set':function(_0x17692b){this['setDataValue'](_0x6f5b('0xa'),moment()['subtract'](_0x17692b,'ms'));this[_0x6f5b('0x8')](_0x6f5b('0xb'),moment());this[_0x6f5b('0x8')](_0x6f5b('0xc'),_0x17692b);}},'startedAt':{'type':Sequelize[_0x6f5b('0xd')],'get':function(){return moment(this['getDataValue'](_0x6f5b('0xa')))[_0x6f5b('0xe')](_0x6f5b('0xf'))['toString']();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x6f5b('0x6')](_0x6f5b('0xb')))[_0x6f5b('0xe')](_0x6f5b('0xf'))[_0x6f5b('0x10')]();}},'createdAt':{'type':Sequelize[_0x6f5b('0xd')],'get':function(){return moment(this[_0x6f5b('0x6')]('createdAt'))[_0x6f5b('0xe')](_0x6f5b('0xf'))['toString']();}},'updatedAt':{'type':Sequelize[_0x6f5b('0xd')],'get':function(){return moment(this[_0x6f5b('0x6')](_0x6f5b('0x11')))[_0x6f5b('0xe')](_0x6f5b('0xf'))[_0x6f5b('0x10')]();}}};
\ No newline at end of file
index 2dda225..142cdfb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bd8=['unlink','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','index','ScreenRecording','rawAttributes','type','model','differenceBy','map','name','format','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','include','rows','catch','show','params','find','create','body','duration','createdAt','closedAt','value','../../components/encryptor','uniqueid','%s.cypher','secrets','recording','join','root','server/files/screen_recordings','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','download','extname'];(function(_0x392c38,_0x520ad2){var _0x1deca8=function(_0x4980e8){while(--_0x4980e8){_0x392c38['push'](_0x392c38['shift']());}};_0x1deca8(++_0x520ad2);}(_0x2bd8,0x130));var _0x82bd=function(_0x1bd591,_0x58c7af){_0x1bd591=_0x1bd591-0x0;var _0x17745d=_0x2bd8[_0x1bd591];return _0x17745d;};'use strict';var emlformat=require(_0x82bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x82bd('0x1'));var jsonpatch=require(_0x82bd('0x2'));var rp=require(_0x82bd('0x3'));var moment=require(_0x82bd('0x4'));var BPromise=require(_0x82bd('0x5'));var Mustache=require(_0x82bd('0x6'));var util=require(_0x82bd('0x7'));var path=require('path');var sox=require(_0x82bd('0x8'));var csv=require(_0x82bd('0x9'));var ejs=require(_0x82bd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82bd('0xb'));var squel=require(_0x82bd('0xc'));var crypto=require(_0x82bd('0xd'));var jsforce=require(_0x82bd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x82bd('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x82bd('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x82bd('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x82bd('0x11'));var config=require(_0x82bd('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x82bd('0x13'))['db'];function respondWithStatusCode(_0x5f1ab9,_0xfaccf7){_0xfaccf7=_0xfaccf7||0xcc;return function(_0x51e17e){if(_0x51e17e){return _0x5f1ab9[_0x82bd('0x14')](_0xfaccf7);}return _0x5f1ab9[_0x82bd('0x15')](_0xfaccf7)[_0x82bd('0x16')]();};}function respondWithResult(_0x2ca530,_0x58d82b){_0x58d82b=_0x58d82b||0xc8;return function(_0x446ffc){if(_0x446ffc){return _0x2ca530[_0x82bd('0x15')](_0x58d82b)['json'](_0x446ffc);}};}function respondWithFilteredResult(_0x3667ef,_0x4db39d){return function(_0x35dd09){if(_0x35dd09){var _0x433e7d=typeof _0x4db39d[_0x82bd('0x17')]===_0x82bd('0x18')&&typeof _0x4db39d[_0x82bd('0x19')]===_0x82bd('0x18');var _0x387d21=_0x35dd09[_0x82bd('0x1a')];var _0x31a350=_0x433e7d?0x0:_0x4db39d[_0x82bd('0x17')];var _0x390107=_0x433e7d?_0x35dd09[_0x82bd('0x1a')]:_0x4db39d[_0x82bd('0x17')]+_0x4db39d[_0x82bd('0x19')];var _0x4a1e62;if(_0x390107>=_0x387d21){_0x390107=_0x387d21;_0x4a1e62=0xc8;}else{_0x4a1e62=0xce;}_0x3667ef['status'](_0x4a1e62);return _0x3667ef[_0x82bd('0x1b')](_0x82bd('0x1c'),_0x31a350+'-'+_0x390107+'/'+_0x387d21)[_0x82bd('0x1d')](_0x35dd09);}return null;};}function patchUpdates(_0xc9fcdf){return function(_0x34899b){try{jsonpatch[_0x82bd('0x1e')](_0x34899b,_0xc9fcdf,!![]);}catch(_0x2c1810){return BPromise[_0x82bd('0x1f')](_0x2c1810);}return _0x34899b[_0x82bd('0x20')]();};}function saveUpdates(_0x3291cd,_0x2caa29){return function(_0x177025){if(_0x177025){return _0x177025[_0x82bd('0x21')](_0x3291cd)[_0x82bd('0x22')](function(_0x3d9f03){return _0x3d9f03;});}return null;};}function removeEntity(_0x2d9d95,_0x13a42a){return function(_0x3b6b93){if(_0x3b6b93){return _0x3b6b93[_0x82bd('0x23')]()['then'](function(){_0x2d9d95['status'](0xcc)[_0x82bd('0x16')]();});}};}function handleEntityNotFound(_0x436ecd,_0x1cb292){return function(_0x3eb6a5){if(!_0x3eb6a5){_0x436ecd[_0x82bd('0x14')](0x194);}return _0x3eb6a5;};}function handleError(_0x10d101,_0x3c7751){_0x3c7751=_0x3c7751||0x1f4;return function(_0xbef23b){logger[_0x82bd('0x24')](_0xbef23b[_0x82bd('0x25')]);if(_0xbef23b['name']){delete _0xbef23b['name'];}_0x10d101['status'](_0x3c7751)['send'](_0xbef23b);};}exports[_0x82bd('0x26')]=function(_0x52bcd8,_0x351d3d){var _0x190bca={},_0x363ef9={},_0x50585e={'count':0x0,'rows':[]};var _0x516c6d=_['map'](db[_0x82bd('0x27')][_0x82bd('0x28')],function(_0x40884f){return{'name':_0x40884f['fieldName'],'type':_0x40884f[_0x82bd('0x29')]['key']};});_0x363ef9[_0x82bd('0x2a')]=_[_0x82bd('0x2b')](_[_0x82bd('0x2c')](_0x516c6d,_0x82bd('0x2d')),[_0x82bd('0x2e')]);_0x363ef9[_0x82bd('0x2f')]=_['keys'](_0x52bcd8[_0x82bd('0x2f')]);_0x363ef9[_0x82bd('0x30')]=_[_0x82bd('0x31')](_0x363ef9['model'],_0x363ef9[_0x82bd('0x2f')]);_0x190bca['attributes']=_['intersection'](_0x363ef9[_0x82bd('0x2a')],qs[_0x82bd('0x32')](_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x32')]));_0x190bca[_0x82bd('0x33')]=_0x190bca[_0x82bd('0x33')][_0x82bd('0x34')]?_0x190bca[_0x82bd('0x33')]:_0x363ef9[_0x82bd('0x2a')];if(!_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x35')](_0x82bd('0x36'))){_0x190bca[_0x82bd('0x19')]=qs[_0x82bd('0x19')](_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x19')]);_0x190bca[_0x82bd('0x17')]=qs['offset'](_0x52bcd8['query']['offset']);}_0x190bca[_0x82bd('0x37')]=qs[_0x82bd('0x38')](_0x52bcd8['query'][_0x82bd('0x38')]);_0x190bca['where']=qs['filters'](_['pick'](_0x52bcd8[_0x82bd('0x2f')],_0x363ef9[_0x82bd('0x30')]),_0x516c6d);if(_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x39')]){_0x190bca[_0x82bd('0x3a')]=_['merge'](_0x190bca['where'],{'$or':_['map'](_0x516c6d,function(_0x64bc54){if(_0x64bc54['type']!=='VIRTUAL'){var _0xba38a4={};_0xba38a4[_0x64bc54[_0x82bd('0x2d')]]={'$like':'%'+_0x52bcd8[_0x82bd('0x2f')][_0x82bd('0x39')]+'%'};return _0xba38a4;}})});}_0x190bca=_[_0x82bd('0x3b')]({},_0x190bca,_0x52bcd8[_0x82bd('0x3c')]);var _0x65335b={'where':_0x190bca[_0x82bd('0x3a')]};return db[_0x82bd('0x27')]['count'](_0x65335b)['then'](function(_0xe210f4){_0x50585e[_0x82bd('0x1a')]=_0xe210f4;if(_0x52bcd8['query']['includeAll']){_0x190bca[_0x82bd('0x3d')]=[{'all':!![]}];}return db[_0x82bd('0x27')]['findAll'](_0x190bca);})[_0x82bd('0x22')](function(_0x21868d){_0x50585e[_0x82bd('0x3e')]=_0x21868d;return _0x50585e;})[_0x82bd('0x22')](respondWithFilteredResult(_0x351d3d,_0x190bca))[_0x82bd('0x3f')](handleError(_0x351d3d,null));};exports[_0x82bd('0x40')]=function(_0x2a18c3,_0x2c429d){var _0x21d7d4={'raw':![],'where':{'id':_0x2a18c3[_0x82bd('0x41')]['id']}},_0x239d48={};_0x239d48[_0x82bd('0x2a')]=_['keys'](db[_0x82bd('0x27')][_0x82bd('0x28')]);_0x239d48['query']=_['keys'](_0x2a18c3[_0x82bd('0x2f')]);_0x239d48[_0x82bd('0x30')]=_[_0x82bd('0x31')](_0x239d48[_0x82bd('0x2a')],_0x239d48[_0x82bd('0x2f')]);_0x21d7d4['attributes']=_['intersection'](_0x239d48[_0x82bd('0x2a')],qs[_0x82bd('0x32')](_0x2a18c3['query'][_0x82bd('0x32')]));_0x21d7d4['attributes']=_0x21d7d4[_0x82bd('0x33')][_0x82bd('0x34')]?_0x21d7d4['attributes']:_0x239d48[_0x82bd('0x2a')];if(_0x2a18c3[_0x82bd('0x2f')]['includeAll']){_0x21d7d4['include']=[{'all':!![]}];}_0x21d7d4=_[_0x82bd('0x3b')]({},_0x21d7d4,_0x2a18c3['options']);return db[_0x82bd('0x27')][_0x82bd('0x42')](_0x21d7d4)[_0x82bd('0x22')](handleEntityNotFound(_0x2c429d,null))[_0x82bd('0x22')](respondWithResult(_0x2c429d,null))['catch'](handleError(_0x2c429d,null));};exports['create']=function(_0x1852f2,_0x5a0ca6){return db['ScreenRecording'][_0x82bd('0x43')](_0x1852f2[_0x82bd('0x44')],{})[_0x82bd('0x22')](respondWithResult(_0x5a0ca6,0xc9))['catch'](handleError(_0x5a0ca6,null));};exports[_0x82bd('0x21')]=function(_0x92ba88,_0x1db61b){if(_0x92ba88[_0x82bd('0x44')]['id']){delete _0x92ba88[_0x82bd('0x44')]['id'];}delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x45')];delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x46')];delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x47')];delete _0x92ba88[_0x82bd('0x44')][_0x82bd('0x48')];return db['ScreenRecording'][_0x82bd('0x42')]({'where':{'id':_0x92ba88[_0x82bd('0x41')]['id']}})['then'](handleEntityNotFound(_0x1db61b,null))[_0x82bd('0x22')](saveUpdates(_0x92ba88[_0x82bd('0x44')],null))[_0x82bd('0x22')](respondWithResult(_0x1db61b,null))[_0x82bd('0x3f')](handleError(_0x1db61b,null));};exports['describe']=function(_0x5b4fd2,_0x37d1f0){return db['ScreenRecording']['describe']()[_0x82bd('0x22')](respondWithResult(_0x37d1f0,null))['catch'](handleError(_0x37d1f0,null));};exports['download']=function(_0x31b41d,_0x3f94f3,_0x3dbee7){var _0xcfb5ef=require(_0x82bd('0x49'));var _0x1a7402=![];var _0x417c29={};if(_0x31b41d[_0x82bd('0x2f')][_0x82bd('0x29')]&&_0x31b41d[_0x82bd('0x2f')][_0x82bd('0x29')]===_0x82bd('0x4a')){_0x417c29[_0x82bd('0x4a')]=_0x31b41d[_0x82bd('0x41')]['id'];}else{_0x417c29['id']=_0x31b41d[_0x82bd('0x41')]['id'];}return db['ScreenRecording'][_0x82bd('0x42')]({'where':_0x417c29,'attributes':['id',_0x82bd('0x48')],'raw':!![]})[_0x82bd('0x22')](handleEntityNotFound(_0x3f94f3,null))[_0x82bd('0x22')](function(_0x9bf8fa){if(_0x9bf8fa){var _0x5466d9=path['join'](config['root'],'server/files/screen_recordings',_0x9bf8fa[_0x82bd('0x48')]);var _0x2cc6ea=util[_0x82bd('0x2e')](_0x82bd('0x4b'),_0x5466d9);if(fs['existsSync'](_0x2cc6ea)){_0x1a7402=!![];return _0xcfb5ef['decryptFile'](_0x2cc6ea,_0x5466d9,config[_0x82bd('0x4c')][_0x82bd('0x4d')])[_0x82bd('0x22')](function(){return _0x9bf8fa;});}return _0x9bf8fa;}})['then'](function(_0x2657bc){if(_0x2657bc){var _0x2252ef=path[_0x82bd('0x4e')](config[_0x82bd('0x4f')],_0x82bd('0x50'),_0x2657bc[_0x82bd('0x48')]);if(!fs[_0x82bd('0x51')](_0x2252ef)){throw new db[(_0x82bd('0x52'))][(_0x82bd('0x53'))](_0x82bd('0x54'));}if(_0x2657bc[_0x82bd('0x55')]){return _0x3f94f3[_0x82bd('0x56')](_0x2252ef,_0x2657bc[_0x82bd('0x55')]+path[_0x82bd('0x57')](_0x2252ef),function(){if(_0x1a7402){fs[_0x82bd('0x58')](_0x2252ef);}});}else{return _0x3f94f3[_0x82bd('0x56')](_0x2252ef,function(_0x124ca4){if(_0x1a7402){fs[_0x82bd('0x58')](_0x2252ef);}});}}})['catch'](function(_0x566b01){if(_0x566b01['message']==='ScreenRecording\x20not\x20found'){_0x3f94f3[_0x82bd('0x15')](0x194)['send'](_0x82bd('0x59'));}else{return handleError(_0x3f94f3,null);}});};exports[_0x82bd('0x23')]=function(_0x3ee7c7,_0x409b06){return db[_0x82bd('0x27')][_0x82bd('0x42')]({'where':{'id':_0x3ee7c7[_0x82bd('0x41')]['id']}})[_0x82bd('0x22')](function(_0x40d6cf){if(_[_0x82bd('0x5a')](_0x40d6cf)){throw new ReferenceError(_0x82bd('0x5b'));}return _0x40d6cf;})['then'](function(_0x4c54f0){var _0x419965=path[_0x82bd('0x4e')](config['root'],'server/files/screen_recordings',_0x4c54f0[_0x82bd('0x48')]);logger[_0x82bd('0x5c')](_0x82bd('0x5d'),_0x419965);if(!_[_0x82bd('0x5a')](_0x4c54f0['value'])&&fs[_0x82bd('0x51')](_0x419965)){logger['info'](_0x82bd('0x5e')+_0x419965+_0x82bd('0x5f'));fs['unlinkSync'](_0x419965);}_0x419965=_0x419965+_0x82bd('0x60');if(!_[_0x82bd('0x5a')](_0x4c54f0[_0x82bd('0x48')])&&fs[_0x82bd('0x51')](_0x419965)){logger['info'](_0x82bd('0x5e')+_0x419965+_0x82bd('0x5f'));fs[_0x82bd('0x61')](_0x419965);}return _0x4c54f0;})[_0x82bd('0x22')](function(_0x243fba){if(!_0x243fba)throw new InternalError();return _0x243fba[_0x82bd('0x23')]();})[_0x82bd('0x22')](function(){_0x409b06[_0x82bd('0x15')](0xcc)[_0x82bd('0x16')]();})['catch'](handleError(_0x409b06,null));};
\ No newline at end of file
+var _0x9957=['sort','pick','filter','where','merge','map','VIRTUAL','options','ScreenRecording','includeAll','include','catch','show','rawAttributes','find','create','body','duration','closedAt','params','describe','download','uniqueid','value','join','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','Sequelize','filename','extname','unlink','message','ScreenRecording\x20not\x20found','isNil','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','differenceBy','format','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order'];(function(_0x267a12,_0x4dcd65){var _0x3edf10=function(_0x426a14){while(--_0x426a14){_0x267a12['push'](_0x267a12['shift']());}};_0x3edf10(++_0x4dcd65);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ScreenRecording']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_['map'](_0x4253e5,'name'),[_0x7995('0x31')]);_0x456a28['query']=_[_0x7995('0x32')](_0x4b6f99[_0x7995('0x33')]);_0x456a28[_0x7995('0x34')]=_[_0x7995('0x35')](_0x456a28[_0x7995('0x2f')],_0x456a28['query']);_0x514445[_0x7995('0x36')]=_[_0x7995('0x35')](_0x456a28['model'],qs['fields'](_0x4b6f99['query'][_0x7995('0x37')]));_0x514445[_0x7995('0x36')]=_0x514445['attributes'][_0x7995('0x38')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99[_0x7995('0x33')][_0x7995('0x39')]('nolimit')){_0x514445['limit']=qs[_0x7995('0x21')](_0x4b6f99['query']['limit']);_0x514445[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x4b6f99['query'][_0x7995('0x20')]);}_0x514445[_0x7995('0x3a')]=qs[_0x7995('0x3b')](_0x4b6f99[_0x7995('0x33')][_0x7995('0x3b')]);_0x514445['where']=qs[_0x7995('0x34')](_[_0x7995('0x3c')](_0x4b6f99[_0x7995('0x33')],_0x456a28[_0x7995('0x34')]),_0x4253e5);if(_0x4b6f99['query'][_0x7995('0x3d')]){_0x514445[_0x7995('0x3e')]=_[_0x7995('0x3f')](_0x514445[_0x7995('0x3e')],{'$or':_[_0x7995('0x40')](_0x4253e5,function(_0x1035dc){if(_0x1035dc['type']!==_0x7995('0x41')){var _0x3be298={};_0x3be298[_0x1035dc[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x33')][_0x7995('0x3d')]+'%'};return _0x3be298;}})});}_0x514445=_[_0x7995('0x3f')]({},_0x514445,_0x4b6f99[_0x7995('0x42')]);var _0x270c0e={'where':_0x514445[_0x7995('0x3e')]};return db[_0x7995('0x43')][_0x7995('0x1f')](_0x270c0e)[_0x7995('0x26')](function(_0x7b4e67){_0x3250e0['count']=_0x7b4e67;if(_0x4b6f99['query'][_0x7995('0x44')]){_0x514445[_0x7995('0x45')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x514445);})[_0x7995('0x26')](function(_0x4a9fef){_0x3250e0['rows']=_0x4a9fef;return _0x3250e0;})[_0x7995('0x26')](respondWithFilteredResult(_0x9b2a15,_0x514445))[_0x7995('0x46')](handleError(_0x9b2a15,null));};exports[_0x7995('0x47')]=function(_0x576b96,_0x46ac4f){var _0x5e85b9={'raw':![],'where':{'id':_0x576b96['params']['id']}},_0x3993b5={};_0x3993b5['model']=_[_0x7995('0x32')](db[_0x7995('0x43')][_0x7995('0x48')]);_0x3993b5[_0x7995('0x33')]=_['keys'](_0x576b96[_0x7995('0x33')]);_0x3993b5[_0x7995('0x34')]=_[_0x7995('0x35')](_0x3993b5[_0x7995('0x2f')],_0x3993b5['query']);_0x5e85b9['attributes']=_[_0x7995('0x35')](_0x3993b5['model'],qs[_0x7995('0x37')](_0x576b96['query'][_0x7995('0x37')]));_0x5e85b9['attributes']=_0x5e85b9[_0x7995('0x36')][_0x7995('0x38')]?_0x5e85b9['attributes']:_0x3993b5[_0x7995('0x2f')];if(_0x576b96[_0x7995('0x33')][_0x7995('0x44')]){_0x5e85b9[_0x7995('0x45')]=[{'all':!![]}];}_0x5e85b9=_['merge']({},_0x5e85b9,_0x576b96[_0x7995('0x42')]);return db[_0x7995('0x43')][_0x7995('0x49')](_0x5e85b9)['then'](handleEntityNotFound(_0x46ac4f,null))[_0x7995('0x26')](respondWithResult(_0x46ac4f,null))[_0x7995('0x46')](handleError(_0x46ac4f,null));};exports[_0x7995('0x4a')]=function(_0x3d8ae3,_0x255313){return db['ScreenRecording'][_0x7995('0x4a')](_0x3d8ae3[_0x7995('0x4b')],{})['then'](respondWithResult(_0x255313,0xc9))[_0x7995('0x46')](handleError(_0x255313,null));};exports['update']=function(_0x1d87f9,_0x187735){if(_0x1d87f9[_0x7995('0x4b')]['id']){delete _0x1d87f9[_0x7995('0x4b')]['id'];}delete _0x1d87f9[_0x7995('0x4b')][_0x7995('0x4c')];delete _0x1d87f9[_0x7995('0x4b')]['createdAt'];delete _0x1d87f9[_0x7995('0x4b')][_0x7995('0x4d')];delete _0x1d87f9[_0x7995('0x4b')]['value'];return db[_0x7995('0x43')][_0x7995('0x49')]({'where':{'id':_0x1d87f9[_0x7995('0x4e')]['id']}})['then'](handleEntityNotFound(_0x187735,null))['then'](saveUpdates(_0x1d87f9['body'],null))[_0x7995('0x26')](respondWithResult(_0x187735,null))[_0x7995('0x46')](handleError(_0x187735,null));};exports['describe']=function(_0x1cd85,_0x29f300){return db[_0x7995('0x43')][_0x7995('0x4f')]()[_0x7995('0x26')](respondWithResult(_0x29f300,null))['catch'](handleError(_0x29f300,null));};exports[_0x7995('0x50')]=function(_0x4ab09f,_0x14fe7f,_0x33c801){var _0x206d2a=require('../../components/encryptor');var _0x5e1f34=![];var _0x54e2b1={};if(_0x4ab09f['query'][_0x7995('0x2d')]&&_0x4ab09f[_0x7995('0x33')][_0x7995('0x2d')]===_0x7995('0x51')){_0x54e2b1[_0x7995('0x51')]=_0x4ab09f[_0x7995('0x4e')]['id'];}else{_0x54e2b1['id']=_0x4ab09f[_0x7995('0x4e')]['id'];}return db[_0x7995('0x43')][_0x7995('0x49')]({'where':_0x54e2b1,'attributes':['id',_0x7995('0x52')],'raw':!![]})[_0x7995('0x26')](handleEntityNotFound(_0x14fe7f,null))[_0x7995('0x26')](function(_0x3da72b){if(_0x3da72b){var _0x35bea3=path[_0x7995('0x53')](config[_0x7995('0x54')],_0x7995('0x55'),_0x3da72b[_0x7995('0x52')]);var _0x45e86e=util['format'](_0x7995('0x56'),_0x35bea3);if(fs[_0x7995('0x57')](_0x45e86e)){_0x5e1f34=!![];return _0x206d2a[_0x7995('0x58')](_0x45e86e,_0x35bea3,config[_0x7995('0x59')]['recording'])['then'](function(){return _0x3da72b;});}return _0x3da72b;}})[_0x7995('0x26')](function(_0x197b52){if(_0x197b52){var _0x5b9467=path[_0x7995('0x53')](config['root'],_0x7995('0x55'),_0x197b52[_0x7995('0x52')]);if(!fs[_0x7995('0x57')](_0x5b9467)){throw new db[(_0x7995('0x5a'))]['ValidationError']('ScreenRecording\x20not\x20found');}if(_0x197b52[_0x7995('0x5b')]){return _0x14fe7f[_0x7995('0x50')](_0x5b9467,_0x197b52[_0x7995('0x5b')]+path[_0x7995('0x5c')](_0x5b9467),function(){if(_0x5e1f34){fs[_0x7995('0x5d')](_0x5b9467);}});}else{return _0x14fe7f[_0x7995('0x50')](_0x5b9467,function(_0x1d4689){if(_0x5e1f34){fs[_0x7995('0x5d')](_0x5b9467);}});}}})[_0x7995('0x46')](function(_0x50caf5){if(_0x50caf5[_0x7995('0x5e')]===_0x7995('0x5f')){_0x14fe7f[_0x7995('0x1c')](0x194)[_0x7995('0x2a')]('Not\x20found');}else{return handleError(_0x14fe7f,null);}});};exports['destroy']=function(_0x3053fd,_0xebb5c8){return db['ScreenRecording'][_0x7995('0x49')]({'where':{'id':_0x3053fd[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](function(_0x57727e){if(_[_0x7995('0x60')](_0x57727e)){throw new ReferenceError('Entity\x20not\x20found');}return _0x57727e;})[_0x7995('0x26')](function(_0x564fca){var _0x3e0a46=path[_0x7995('0x53')](config[_0x7995('0x54')],_0x7995('0x55'),_0x564fca[_0x7995('0x52')]);logger[_0x7995('0x61')](_0x7995('0x62'),_0x3e0a46);if(!_[_0x7995('0x60')](_0x564fca[_0x7995('0x52')])&&fs[_0x7995('0x57')](_0x3e0a46)){logger[_0x7995('0x61')](_0x7995('0x63')+_0x3e0a46+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x7995('0x64')](_0x3e0a46);}_0x3e0a46=_0x3e0a46+_0x7995('0x65');if(!_[_0x7995('0x60')](_0x564fca[_0x7995('0x52')])&&fs[_0x7995('0x57')](_0x3e0a46)){logger['info']('File:\x20\x22'+_0x3e0a46+_0x7995('0x66'));fs[_0x7995('0x64')](_0x3e0a46);}return _0x564fca;})[_0x7995('0x26')](function(_0xae6166){if(!_0xae6166)throw new InternalError();return _0xae6166['destroy']();})[_0x7995('0x26')](function(){_0xebb5c8['status'](0xcc)['end']();})[_0x7995('0x46')](handleError(_0xebb5c8,null));};
\ No newline at end of file
index aefa413..06f6034 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf063=['api','moment','request-promise','rimraf','../../config/environment','./screenRecording.attributes','exports','ScreenRecording','screen_recordings','interactionid','../../config/logger'];(function(_0x533528,_0x409d05){var _0x3189f1=function(_0x5e63d2){while(--_0x5e63d2){_0x533528['push'](_0x533528['shift']());}};_0x3189f1(++_0x409d05);}(_0xf063,0x128));var _0x3f06=function(_0x5afd8c,_0x18d15f){_0x5afd8c=_0x5afd8c-0x0;var _0x12a75e=_0xf063[_0x5afd8c];return _0x12a75e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3f06('0x0'))(_0x3f06('0x1'));var moment=require(_0x3f06('0x2'));var BPromise=require('bluebird');var rp=require(_0x3f06('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3f06('0x4'));var config=require(_0x3f06('0x5'));var attributes=require(_0x3f06('0x6'));module[_0x3f06('0x7')]=function(_0x844235,_0x3c0b64){return _0x844235['define'](_0x3f06('0x8'),attributes,{'tableName':_0x3f06('0x9'),'paranoid':![],'indexes':[{'name':_0x3f06('0xa'),'fields':[_0x3f06('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x316c=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','define','ScreenRecording','screen_recordings','interactionid','lodash','util'];(function(_0x1cb455,_0x183114){var _0x5f1d53=function(_0x5e2c11){while(--_0x5e2c11){_0x1cb455['push'](_0x1cb455['shift']());}};_0x5f1d53(++_0x183114);}(_0x316c,0x14e));var _0xc316=function(_0x1d34ea,_0x45b052){_0x1d34ea=_0x1d34ea-0x0;var _0x5cb60b=_0x316c[_0x1d34ea];return _0x5cb60b;};'use strict';var _=require(_0xc316('0x0'));var util=require(_0xc316('0x1'));var logger=require(_0xc316('0x2'))(_0xc316('0x3'));var moment=require(_0xc316('0x4'));var BPromise=require('bluebird');var rp=require(_0xc316('0x5'));var fs=require('fs');var path=require(_0xc316('0x6'));var rimraf=require(_0xc316('0x7'));var config=require(_0xc316('0x8'));var attributes=require(_0xc316('0x9'));module['exports']=function(_0x3e25cd,_0x154a40){return _0x3e25cd[_0xc316('0xa')](_0xc316('0xb'),attributes,{'tableName':_0xc316('0xc'),'paranoid':![],'indexes':[{'name':_0xc316('0xd'),'fields':[_0xc316('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index d9696bc..adb65b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff2e=['ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x56560e,_0x554ced){var _0x302ec3=function(_0x1b04be){while(--_0x1b04be){_0x56560e['push'](_0x56560e['shift']());}};_0x302ec3(++_0x554ced);}(_0xff2e,0x1ec));var _0xeff2=function(_0x1ed4e1,_0xb792d6){_0x1ed4e1=_0x1ed4e1-0x0;var _0x5cade3=_0xff2e[_0x1ed4e1];return _0x5cade3;};'use strict';var _=require(_0xeff2('0x0'));var util=require('util');var moment=require(_0xeff2('0x1'));var BPromise=require(_0xeff2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeff2('0x3'));var db=require(_0xeff2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xeff2('0x5'))(_0xeff2('0x6'));var config=require(_0xeff2('0x7'));var jayson=require(_0xeff2('0x8'));var client=jayson[_0xeff2('0x9')][_0xeff2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x336463,_0x1e0246,_0x3fdbe8){return new BPromise(function(_0x1b0776,_0x2bfcde){return client['request'](_0x336463,_0x3fdbe8)['then'](function(_0x2064bf){logger['info'](_0xeff2('0xb'),_0x1e0246,_0xeff2('0xc'));logger[_0xeff2('0xd')](_0xeff2('0xe'),_0x1e0246,_0xeff2('0xc'),JSON[_0xeff2('0xf')](_0x2064bf));if(_0x2064bf[_0xeff2('0x10')]){if(_0x2064bf[_0xeff2('0x10')][_0xeff2('0x11')]===0x1f4){logger[_0xeff2('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x1e0246,_0x2064bf[_0xeff2('0x10')][_0xeff2('0x12')]);return _0x2bfcde(_0x2064bf[_0xeff2('0x10')][_0xeff2('0x12')]);}logger[_0xeff2('0x10')](_0xeff2('0xb'),_0x1e0246,_0x2064bf[_0xeff2('0x10')][_0xeff2('0x12')]);return _0x1b0776(_0x2064bf[_0xeff2('0x10')][_0xeff2('0x12')]);}else{logger[_0xeff2('0x13')](_0xeff2('0xb'),_0x1e0246,_0xeff2('0xc'));_0x1b0776(_0x2064bf[_0xeff2('0x14')]['message']);}})[_0xeff2('0x15')](function(_0x62688a){logger[_0xeff2('0x10')](_0xeff2('0xb'),_0x1e0246,_0x62688a);_0x2bfcde(_0x62688a);});});}
\ No newline at end of file
+var _0xa40a=['ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','ScreenRecording,\x20%s,\x20%s','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent'];(function(_0x265772,_0x47fd5d){var _0x1402ab=function(_0x365648){while(--_0x365648){_0x265772['push'](_0x265772['shift']());}};_0x1402ab(++_0x47fd5d);}(_0xa40a,0x13b));var _0xaa40=function(_0x5923e8,_0xc8d316){_0x5923e8=_0x5923e8-0x0;var _0x7a1148=_0xa40a[_0x5923e8];return _0x7a1148;};'use strict';var _=require(_0xaa40('0x0'));var util=require('util');var moment=require(_0xaa40('0x1'));var BPromise=require('bluebird');var rs=require(_0xaa40('0x2'));var fs=require('fs');var Redis=require(_0xaa40('0x3'));var db=require(_0xaa40('0x4'))['db'];var utils=require(_0xaa40('0x5'));var logger=require(_0xaa40('0x6'))(_0xaa40('0x7'));var config=require(_0xaa40('0x8'));var jayson=require(_0xaa40('0x9'));var client=jayson[_0xaa40('0xa')][_0xaa40('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42d391,_0x3e8743,_0x480ef0){return new BPromise(function(_0x13723a,_0x27b18a){return client[_0xaa40('0xc')](_0x42d391,_0x480ef0)['then'](function(_0x47d8c3){logger[_0xaa40('0xd')]('ScreenRecording,\x20%s,\x20%s',_0x3e8743,_0xaa40('0xe'));logger['debug'](_0xaa40('0xf'),_0x3e8743,'request\x20sent',JSON[_0xaa40('0x10')](_0x47d8c3));if(_0x47d8c3['error']){if(_0x47d8c3[_0xaa40('0x11')]['code']===0x1f4){logger['error']('ScreenRecording,\x20%s,\x20%s',_0x3e8743,_0x47d8c3[_0xaa40('0x11')][_0xaa40('0x12')]);return _0x27b18a(_0x47d8c3[_0xaa40('0x11')][_0xaa40('0x12')]);}logger[_0xaa40('0x11')](_0xaa40('0x13'),_0x3e8743,_0x47d8c3[_0xaa40('0x11')][_0xaa40('0x12')]);return _0x13723a(_0x47d8c3[_0xaa40('0x11')]['message']);}else{logger['info'](_0xaa40('0x13'),_0x3e8743,_0xaa40('0xe'));_0x13723a(_0x47d8c3[_0xaa40('0x14')][_0xaa40('0x12')]);}})[_0xaa40('0x15')](function(_0x3436dd){logger[_0xaa40('0x11')](_0xaa40('0x13'),_0x3e8743,_0x3436dd);_0x27b18a(_0x3436dd);});});}
\ No newline at end of file
index 4f89236..5475b25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5840=['isAuthenticated','index','get','/now','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','getPreferred','/:id/favicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','post','single','file','addLogo','logologin','addLogoLogin','preferred','/:id/preferred','addPreferred','favicon','addFavicon','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./setting.controller'];(function(_0x3a5882,_0x11bc32){var _0x2ae703=function(_0x4877d0){while(--_0x4877d0){_0x3a5882['push'](_0x3a5882['shift']());}};_0x2ae703(++_0x11bc32);}(_0x5840,0x1e7));var _0x0584=function(_0x173366,_0x492151){_0x173366=_0x173366-0x0;var _0x2ccdfa=_0x5840[_0x173366];return _0x2ccdfa;};'use strict';var multer=require(_0x0584('0x0'));var util=require(_0x0584('0x1'));var path=require(_0x0584('0x2'));var timeout=require(_0x0584('0x3'));var express=require('express');var router=express[_0x0584('0x4')]();var fs_extra=require(_0x0584('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0584('0x6'));var config=require('../../config/environment');var controller=require(_0x0584('0x7'));router['get']('/',auth[_0x0584('0x8')](),controller[_0x0584('0x9')]);router[_0x0584('0xa')](_0x0584('0xb'),controller['getDate']);router[_0x0584('0xa')](_0x0584('0xc'),controller[_0x0584('0xd')]);router[_0x0584('0xa')](_0x0584('0xe'),controller[_0x0584('0xf')]);router[_0x0584('0xa')](_0x0584('0x10'),controller[_0x0584('0x11')]);router[_0x0584('0xa')](_0x0584('0x12'),controller[_0x0584('0x13')]);router['get']('/:id/preferred',controller[_0x0584('0x14')]);router[_0x0584('0xa')](_0x0584('0x15'),controller['getFavicon']);var upload=multer({'storage':multer[_0x0584('0x16')]({'destination':function(_0x27e87a,_0x565f6a,_0x89cd8d){_0x89cd8d(null,path[_0x0584('0x17')](config[_0x0584('0x18')],_0x0584('0x19')));},'filename':function(_0x543ced,_0x4ba6f9,_0x5c6d5a){_0x5c6d5a(null,util[_0x0584('0x1a')](_0x0584('0x1b'),_0x0584('0x1c'),path[_0x0584('0x1d')](_0x4ba6f9[_0x0584('0x1e')])));}})});router[_0x0584('0x1f')](_0x0584('0xe'),upload[_0x0584('0x20')](_0x0584('0x21')),controller[_0x0584('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x62c688,_0x551370,_0xfb2a2){_0xfb2a2(null,path[_0x0584('0x17')](config[_0x0584('0x18')],_0x0584('0x19')));},'filename':function(_0x12f466,_0x23e791,_0x51f92e){_0x51f92e(null,util[_0x0584('0x1a')](_0x0584('0x1b'),_0x0584('0x23'),path['extname'](_0x23e791[_0x0584('0x1e')])));}})});router[_0x0584('0x1f')](_0x0584('0x10'),upload['single'](_0x0584('0x21')),controller[_0x0584('0x24')]);var upload=multer({'storage':multer[_0x0584('0x16')]({'destination':function(_0x10e5d3,_0x24cade,_0x5ce199){_0x5ce199(null,path[_0x0584('0x17')](config[_0x0584('0x18')],_0x0584('0x19')));},'filename':function(_0x522ba9,_0x5bf18a,_0x392bb2){_0x392bb2(null,util[_0x0584('0x1a')](_0x0584('0x1b'),_0x0584('0x25'),path[_0x0584('0x1d')](_0x5bf18a[_0x0584('0x1e')])));}})});router[_0x0584('0x1f')](_0x0584('0x26'),upload[_0x0584('0x20')](_0x0584('0x21')),controller[_0x0584('0x27')]);var upload=multer({'storage':multer[_0x0584('0x16')]({'destination':function(_0x43b13e,_0x2efdfb,_0x31f925){_0x31f925(null,path[_0x0584('0x17')](config[_0x0584('0x18')],'server/files/images/logos/'));},'filename':function(_0x3359a4,_0x172d71,_0x290cae){_0x290cae(null,util['format'](_0x0584('0x1b'),_0x0584('0x28'),path[_0x0584('0x1d')](_0x172d71['originalname'])));}})});router[_0x0584('0x1f')]('/:id/favicon',upload[_0x0584('0x20')](_0x0584('0x21')),controller[_0x0584('0x29')]);router[_0x0584('0x2a')](_0x0584('0xc'),auth[_0x0584('0x8')](),controller[_0x0584('0x2b')]);module[_0x0584('0x2c')]=router;
\ No newline at end of file
+var _0x64cf=['isAuthenticated','update','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','index','/now','getDate','/:id','show','getLogo','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getFavicon','diskStorage','join','root','server/files/images/logos/','%s%s','logo','extname','post','/:id/logo','single','file','addLogo','format','logologin','originalname','/:id/logo_login','addLogoLogin','preferred','addPreferred','favicon','/:id/favicon','addFavicon','put'];(function(_0x360041,_0x50b099){var _0x2b80a7=function(_0x5386d8){while(--_0x5386d8){_0x360041['push'](_0x360041['shift']());}};_0x2b80a7(++_0x50b099);}(_0x64cf,0x1ce));var _0xf64c=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x64cf[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0xf64c('0x0'));var util=require('util');var path=require(_0xf64c('0x1'));var timeout=require(_0xf64c('0x2'));var express=require('express');var router=express[_0xf64c('0x3')]();var fs_extra=require(_0xf64c('0x4'));var auth=require(_0xf64c('0x5'));var interaction=require(_0xf64c('0x6'));var config=require(_0xf64c('0x7'));var controller=require(_0xf64c('0x8'));router[_0xf64c('0x9')]('/',auth['isAuthenticated'](),controller[_0xf64c('0xa')]);router[_0xf64c('0x9')](_0xf64c('0xb'),controller[_0xf64c('0xc')]);router[_0xf64c('0x9')](_0xf64c('0xd'),controller[_0xf64c('0xe')]);router[_0xf64c('0x9')]('/:id/logo',controller[_0xf64c('0xf')]);router['get']('/:id/logo_login',controller[_0xf64c('0x10')]);router['get'](_0xf64c('0x11'),controller[_0xf64c('0x12')]);router[_0xf64c('0x9')](_0xf64c('0x13'),controller['getPreferred']);router[_0xf64c('0x9')]('/:id/favicon',controller[_0xf64c('0x14')]);var upload=multer({'storage':multer[_0xf64c('0x15')]({'destination':function(_0x11bb7e,_0x255e78,_0x4e8b04){_0x4e8b04(null,path[_0xf64c('0x16')](config[_0xf64c('0x17')],_0xf64c('0x18')));},'filename':function(_0x36c0c5,_0x54d7f7,_0x2906f0){_0x2906f0(null,util['format'](_0xf64c('0x19'),_0xf64c('0x1a'),path[_0xf64c('0x1b')](_0x54d7f7['originalname'])));}})});router[_0xf64c('0x1c')](_0xf64c('0x1d'),upload[_0xf64c('0x1e')](_0xf64c('0x1f')),controller[_0xf64c('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5e045b,_0x16f4bc,_0x36aa6b){_0x36aa6b(null,path[_0xf64c('0x16')](config[_0xf64c('0x17')],_0xf64c('0x18')));},'filename':function(_0x2a1d47,_0x241162,_0x457bb6){_0x457bb6(null,util[_0xf64c('0x21')]('%s%s',_0xf64c('0x22'),path[_0xf64c('0x1b')](_0x241162[_0xf64c('0x23')])));}})});router[_0xf64c('0x1c')](_0xf64c('0x24'),upload[_0xf64c('0x1e')](_0xf64c('0x1f')),controller[_0xf64c('0x25')]);var upload=multer({'storage':multer[_0xf64c('0x15')]({'destination':function(_0x55951f,_0x2ad2b5,_0x1fa20e){_0x1fa20e(null,path[_0xf64c('0x16')](config[_0xf64c('0x17')],'server/files/images/logos/'));},'filename':function(_0xe3e2df,_0x1d37df,_0x5e69cf){_0x5e69cf(null,util[_0xf64c('0x21')](_0xf64c('0x19'),_0xf64c('0x26'),path[_0xf64c('0x1b')](_0x1d37df['originalname'])));}})});router['post'](_0xf64c('0x13'),upload[_0xf64c('0x1e')](_0xf64c('0x1f')),controller[_0xf64c('0x27')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x15f2d3,_0x1fa783,_0x4a5e06){_0x4a5e06(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x293bcc,_0x115385,_0x382bba){_0x382bba(null,util[_0xf64c('0x21')](_0xf64c('0x19'),_0xf64c('0x28'),path[_0xf64c('0x1b')](_0x115385['originalname'])));}})});router['post'](_0xf64c('0x29'),upload[_0xf64c('0x1e')]('file'),controller[_0xf64c('0x2a')]);router[_0xf64c('0x2b')](_0xf64c('0xd'),auth[_0xf64c('0x2c')](),controller[_0xf64c('0x2d')]);module['exports']=router;
\ No newline at end of file
index b2f7920..aa2510b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-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(_0x479160,_0x3ab560){var _0x47ac6d=function(_0x3f7314){while(--_0x3f7314){_0x479160['push'](_0x479160['shift']());}};_0x47ac6d(++_0x3ab560);}(_0xadb5,0xad));var _0x5adb=function(_0x198481,_0x396d48){_0x198481=_0x198481-0x0;var _0x11072f=_0xadb5[_0x198481];return _0x11072f;};'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
+var _0x7a54=['UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','alternate'];(function(_0x4c2234,_0x123640){var _0x14cde8=function(_0x1937c9){while(--_0x1937c9){_0x4c2234['push'](_0x4c2234['shift']());}};_0x14cde8(++_0x123640);}(_0x7a54,0x106));var _0x47a5=function(_0x3e9507,_0x5c7bf7){_0x3e9507=_0x3e9507-0x0;var _0x352415=_0x7a54[_0x3e9507];return _0x352415;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'min_internal':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x47a5('0x2')](0xb),'unique':_0x47a5('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x5')},'logo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLogo':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x47a5('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x47a5('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x47a5('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize['STRING']},'defaultPageTitle':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x47a5('0x4')],'defaultValue':_0x47a5('0x7')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x47a5('0x4')]},'defaultPreferred':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x47a5('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x47a5('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x47a5('0x2')]},'transcribeRegion':{'type':Sequelize[_0x47a5('0x4')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x47a5('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'bucket':{'type':Sequelize[_0x47a5('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x47a5('0x2')](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)[_0x47a5('0x8')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x47a5('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x47a5('0x6')],'defaultValue':![]}};
\ No newline at end of file
index e8c93e1..e43a5b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6334=['defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','toLower','join','default_logo.svg','default','upperFirst','custom','root','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','default_loginLogo.svg','gdpr','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','end','name','send','index','Setting','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','map','type','VIRTUAL','options','findAll','rows','show','keys','length','includeAll','body','find','params','addLogo','file','filename','logo','addLogoLogin','../../config/license/util','server/files/images/logos','getLicense','loginLogo','preferred','favicon'];(function(_0x28b0b2,_0x723ba5){var _0x40cfe2=function(_0x4f5b00){while(--_0x4f5b00){_0x28b0b2['push'](_0x28b0b2['shift']());}};_0x40cfe2(++_0x723ba5);}(_0x6334,0x119));var _0x4633=function(_0x4d8dc3,_0x585fd1){_0x4d8dc3=_0x4d8dc3-0x0;var _0x9b03d9=_0x6334[_0x4d8dc3];return _0x9b03d9;};'use strict';var emlformat=require(_0x4633('0x0'));var rimraf=require(_0x4633('0x1'));var zipdir=require(_0x4633('0x2'));var jsonpatch=require(_0x4633('0x3'));var rp=require(_0x4633('0x4'));var moment=require(_0x4633('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4633('0x6'));var util=require(_0x4633('0x7'));var path=require(_0x4633('0x8'));var sox=require(_0x4633('0x9'));var csv=require(_0x4633('0xa'));var ejs=require(_0x4633('0xb'));var fs=require('fs');var fs_extra=require(_0x4633('0xc'));var _=require('lodash');var squel=require(_0x4633('0xd'));var crypto=require('crypto');var jsforce=require(_0x4633('0xe'));var deskjs=require(_0x4633('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4633('0x10'));var Papa=require(_0x4633('0x11'));var Redis=require(_0x4633('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4633('0x13'));var as=require(_0x4633('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4633('0x15'))(_0x4633('0x16'));var utils=require(_0x4633('0x17'));var config=require(_0x4633('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x4633('0x19'))['db'];var jayson=require(_0x4633('0x1a'));var client=jayson[_0x4633('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d0b96,_0x49f5c3,_0x28e2bc,_0x1fd00c){return new BPromise(function(_0x579229,_0x52955e){var _0x1d967e=_0x1fd00c||client;return _0x1d967e['request'](_0x4d0b96,_0x28e2bc)[_0x4633('0x1c')](function(_0x33b6e7){logger[_0x4633('0x1d')](_0x4633('0x1e'),_0x49f5c3,'request\x20sent');logger[_0x4633('0x1f')](_0x4633('0x20'),_0x49f5c3,_0x4633('0x21'),JSON['stringify'](_0x33b6e7));if(_0x33b6e7[_0x4633('0x22')]){if(_0x33b6e7[_0x4633('0x22')][_0x4633('0x23')]===0x1f4){logger[_0x4633('0x22')](_0x4633('0x1e'),_0x49f5c3,_0x33b6e7['error'][_0x4633('0x24')]);return _0x52955e(_0x33b6e7[_0x4633('0x22')]['message']);}logger['error'](_0x4633('0x1e'),_0x49f5c3,_0x33b6e7['error'][_0x4633('0x24')]);return _0x579229(_0x33b6e7['error']['message']);}else{logger[_0x4633('0x1d')](_0x4633('0x1e'),_0x49f5c3,_0x4633('0x21'));_0x579229(_0x33b6e7[_0x4633('0x25')][_0x4633('0x24')]);}})[_0x4633('0x26')](function(_0x513fe5){logger[_0x4633('0x22')]('Setting,\x20%s,\x20%s',_0x49f5c3,_0x513fe5);_0x52955e(_0x513fe5);});});}function respondWithStatusCode(_0x22d9c1,_0xcfac3f){_0xcfac3f=_0xcfac3f||0xcc;return function(_0xe77cfc){if(_0xe77cfc){return _0x22d9c1[_0x4633('0x27')](_0xcfac3f);}return _0x22d9c1[_0x4633('0x28')](_0xcfac3f)['end']();};}function respondWithResult(_0x3af747,_0x399220){_0x399220=_0x399220||0xc8;return function(_0x37e3c4){if(_0x37e3c4){return _0x3af747[_0x4633('0x28')](_0x399220)[_0x4633('0x29')](_0x37e3c4);}};}function respondWithFilteredResult(_0x471d13,_0x1ba1ed){return function(_0x368582){if(_0x368582){var _0xef2ecf=typeof _0x1ba1ed[_0x4633('0x2a')]===_0x4633('0x2b')&&typeof _0x1ba1ed[_0x4633('0x2c')]===_0x4633('0x2b');var _0x2970a6=_0x368582[_0x4633('0x2d')];var _0x3f03aa=_0xef2ecf?0x0:_0x1ba1ed[_0x4633('0x2a')];var _0x139e5e=_0xef2ecf?_0x368582['count']:_0x1ba1ed[_0x4633('0x2a')]+_0x1ba1ed[_0x4633('0x2c')];var _0x393639;if(_0x139e5e>=_0x2970a6){_0x139e5e=_0x2970a6;_0x393639=0xc8;}else{_0x393639=0xce;}_0x471d13[_0x4633('0x28')](_0x393639);return _0x471d13[_0x4633('0x2e')](_0x4633('0x2f'),_0x3f03aa+'-'+_0x139e5e+'/'+_0x2970a6)['json'](_0x368582);}return null;};}function patchUpdates(_0x23c33c){return function(_0x52fc85){try{jsonpatch[_0x4633('0x30')](_0x52fc85,_0x23c33c,!![]);}catch(_0x20aa07){return BPromise[_0x4633('0x31')](_0x20aa07);}return _0x52fc85[_0x4633('0x32')]();};}function saveUpdates(_0xf32012,_0x1c4652){return function(_0x43e23f){if(_0x43e23f){return _0x43e23f[_0x4633('0x33')](_0xf32012)[_0x4633('0x1c')](function(_0x2c5505){return _0x2c5505;});}return null;};}function removeEntity(_0xa6d4db,_0x53eeea){return function(_0x37ce05){if(_0x37ce05){return _0x37ce05[_0x4633('0x34')]()['then'](function(){_0xa6d4db['status'](0xcc)[_0x4633('0x35')]();});}};}function handleEntityNotFound(_0x26625a,_0x5177f2){return function(_0x34b211){if(!_0x34b211){_0x26625a[_0x4633('0x27')](0x194);}return _0x34b211;};}function handleError(_0x439005,_0x3dd3be){_0x3dd3be=_0x3dd3be||0x1f4;return function(_0x483c5d){logger[_0x4633('0x22')](_0x483c5d['stack']);if(_0x483c5d[_0x4633('0x36')]){delete _0x483c5d[_0x4633('0x36')];}_0x439005[_0x4633('0x28')](_0x3dd3be)[_0x4633('0x37')](_0x483c5d);};}exports[_0x4633('0x38')]=function(_0x343bd3,_0x15c02e){var _0x439a04={},_0x546390={},_0x29b0b5={'count':0x0,'rows':[]};var _0x107616=_['map'](db[_0x4633('0x39')][_0x4633('0x3a')],function(_0x11fb61){return{'name':_0x11fb61[_0x4633('0x3b')],'type':_0x11fb61['type']['key']};});_0x546390[_0x4633('0x3c')]=_['map'](_0x107616,'name');_0x546390[_0x4633('0x3d')]=_['keys'](_0x343bd3['query']);_0x546390[_0x4633('0x3e')]=_[_0x4633('0x3f')](_0x546390[_0x4633('0x3c')],_0x546390[_0x4633('0x3d')]);_0x439a04[_0x4633('0x40')]=_['intersection'](_0x546390[_0x4633('0x3c')],qs['fields'](_0x343bd3[_0x4633('0x3d')][_0x4633('0x41')]));_0x439a04[_0x4633('0x40')]=_0x439a04[_0x4633('0x40')]['length']?_0x439a04[_0x4633('0x40')]:_0x546390['model'];if(!_0x343bd3[_0x4633('0x3d')][_0x4633('0x42')](_0x4633('0x43'))){_0x439a04[_0x4633('0x2c')]=qs[_0x4633('0x2c')](_0x343bd3['query']['limit']);_0x439a04[_0x4633('0x2a')]=qs[_0x4633('0x2a')](_0x343bd3[_0x4633('0x3d')][_0x4633('0x2a')]);}_0x439a04[_0x4633('0x44')]=qs['sort'](_0x343bd3[_0x4633('0x3d')]['sort']);_0x439a04[_0x4633('0x45')]=qs['filters'](_[_0x4633('0x46')](_0x343bd3['query'],_0x546390[_0x4633('0x3e')]),_0x107616);if(_0x343bd3[_0x4633('0x3d')][_0x4633('0x47')]){_0x439a04[_0x4633('0x45')]=_[_0x4633('0x48')](_0x439a04[_0x4633('0x45')],{'$or':_[_0x4633('0x49')](_0x107616,function(_0x4649d1){if(_0x4649d1[_0x4633('0x4a')]!==_0x4633('0x4b')){var _0x2e6b11={};_0x2e6b11[_0x4649d1[_0x4633('0x36')]]={'$like':'%'+_0x343bd3[_0x4633('0x3d')][_0x4633('0x47')]+'%'};return _0x2e6b11;}})});}_0x439a04=_[_0x4633('0x48')]({},_0x439a04,_0x343bd3[_0x4633('0x4c')]);var _0x13ffa5={'where':_0x439a04[_0x4633('0x45')]};return db[_0x4633('0x39')][_0x4633('0x2d')](_0x13ffa5)[_0x4633('0x1c')](function(_0x486c29){_0x29b0b5['count']=_0x486c29;if(_0x343bd3[_0x4633('0x3d')]['includeAll']){_0x439a04['include']=[{'all':!![]}];}return db['Setting'][_0x4633('0x4d')](_0x439a04);})[_0x4633('0x1c')](function(_0x5cb4cc){_0x29b0b5[_0x4633('0x4e')]=_0x5cb4cc;return _0x29b0b5;})[_0x4633('0x1c')](respondWithFilteredResult(_0x15c02e,_0x439a04))[_0x4633('0x26')](handleError(_0x15c02e,null));};exports[_0x4633('0x4f')]=function(_0x3c752b,_0x1273f6){var _0x4d3cf4={'raw':![],'where':{'id':_0x3c752b['params']['id']}},_0x4ca3d6={};_0x4ca3d6[_0x4633('0x3c')]=_[_0x4633('0x50')](db[_0x4633('0x39')]['rawAttributes']);_0x4ca3d6[_0x4633('0x3d')]=_[_0x4633('0x50')](_0x3c752b['query']);_0x4ca3d6[_0x4633('0x3e')]=_[_0x4633('0x3f')](_0x4ca3d6[_0x4633('0x3c')],_0x4ca3d6['query']);_0x4d3cf4['attributes']=_[_0x4633('0x3f')](_0x4ca3d6[_0x4633('0x3c')],qs[_0x4633('0x41')](_0x3c752b[_0x4633('0x3d')][_0x4633('0x41')]));_0x4d3cf4['attributes']=_0x4d3cf4[_0x4633('0x40')][_0x4633('0x51')]?_0x4d3cf4[_0x4633('0x40')]:_0x4ca3d6[_0x4633('0x3c')];if(_0x3c752b[_0x4633('0x3d')][_0x4633('0x52')]){_0x4d3cf4['include']=[{'all':!![]}];}_0x4d3cf4=_[_0x4633('0x48')]({},_0x4d3cf4,_0x3c752b['options']);return db['Setting']['find'](_0x4d3cf4)[_0x4633('0x1c')](handleEntityNotFound(_0x1273f6,null))[_0x4633('0x1c')](respondWithResult(_0x1273f6,null))[_0x4633('0x26')](handleError(_0x1273f6,null));};exports[_0x4633('0x33')]=function(_0x555b7c,_0x13fe90){if(_0x555b7c['body']['id']){delete _0x555b7c[_0x4633('0x53')]['id'];}return db[_0x4633('0x39')][_0x4633('0x54')]({'where':{'id':_0x555b7c[_0x4633('0x55')]['id']}})[_0x4633('0x1c')](handleEntityNotFound(_0x13fe90,null))[_0x4633('0x1c')](saveUpdates(_0x555b7c[_0x4633('0x53')],null))[_0x4633('0x1c')](respondWithResult(_0x13fe90,null))['catch'](handleError(_0x13fe90,null));};exports[_0x4633('0x56')]=function(_0x5ebb5a,_0x413707,_0x22ed63){if(_0x5ebb5a[_0x4633('0x57')]&&_0x5ebb5a[_0x4633('0x57')][_0x4633('0x58')]){_0x5ebb5a[_0x4633('0x53')][_0x4633('0x59')]=_0x5ebb5a[_0x4633('0x57')][_0x4633('0x58')];}return db[_0x4633('0x39')][_0x4633('0x54')]({'where':{'id':_0x5ebb5a[_0x4633('0x55')]['id']}})[_0x4633('0x1c')](handleEntityNotFound(_0x413707,null))['then'](saveUpdates(_0x5ebb5a[_0x4633('0x53')],null))[_0x4633('0x1c')](respondWithResult(_0x413707,null))[_0x4633('0x26')](handleError(_0x413707,null));};exports[_0x4633('0x5a')]=function(_0x11050c,_0x19b192,_0x219aad){if(_0x11050c[_0x4633('0x57')]&&_0x11050c[_0x4633('0x57')][_0x4633('0x58')]){_0x11050c[_0x4633('0x53')]['loginLogo']=_0x11050c['file'][_0x4633('0x58')];}return db['Setting'][_0x4633('0x54')]({'where':{'id':_0x11050c[_0x4633('0x55')]['id']}})['then'](handleEntityNotFound(_0x19b192,null))[_0x4633('0x1c')](saveUpdates(_0x11050c[_0x4633('0x53')],null))[_0x4633('0x1c')](respondWithResult(_0x19b192,null))[_0x4633('0x26')](handleError(_0x19b192,null));};var utilLicense=require(_0x4633('0x5b'));exports['getLogo']=function(_0x22271a,_0x3eab58,_0x3f2bf2){var _0x2adc7c=_0x4633('0x5c');var _0x4fba21={'custom':![]};return utilLicense[_0x4633('0x5d')]()[_0x4633('0x1c')](function(_0xd29fcb){if(_0xd29fcb){_0x4fba21=_0xd29fcb;}return db['Setting'][_0x4633('0x54')]({'where':{'id':_0x22271a[_0x4633('0x55')]['id']},'attributes':[_0x4633('0x59'),_0x4633('0x5e'),_0x4633('0x5f'),_0x4633('0x60'),_0x4633('0x61'),_0x4633('0x62'),_0x4633('0x63'),_0x4633('0x64')],'raw':!![]});})[_0x4633('0x1c')](handleEntityNotFound(_0x3eab58,null))['then'](function(_0x4e11cd){if(_0x4e11cd){var _0x144ae3=_0x4e11cd[_0x4633('0x59')]&&fs[_0x4633('0x65')](path['join'](config['root'],_0x2adc7c,_[_0x4633('0x66')](_0x4e11cd[_0x4633('0x59')])))?path[_0x4633('0x67')](config['root'],_0x2adc7c,_[_0x4633('0x66')](_0x4e11cd[_0x4633('0x59')])):path[_0x4633('0x67')](config['root'],_0x2adc7c,_['toLower'](_0x4633('0x68')));var _0x5e8efc=_0x4633('0x69')+_[_0x4633('0x6a')]('logo');if(_0x4e11cd[_0x5e8efc]||!_0x4fba21[_0x4633('0x6b')]){_0x144ae3=path[_0x4633('0x67')](config[_0x4633('0x6c')],_0x2adc7c,_[_0x4633('0x66')]('default_logo.svg'));}if(!fs[_0x4633('0x65')](_0x144ae3)){throw new db[(_0x4633('0x6d'))][(_0x4633('0x6e'))](_[_0x4633('0x6a')](_0x4633('0x59'))+_0x4633('0x6f'));}return _0x3eab58[_0x4633('0x70')](_0x144ae3);}})['catch'](handleError(_0x3eab58,null));};var utilLicense=require(_0x4633('0x5b'));exports[_0x4633('0x71')]=function(_0x91a8fe,_0x2fa28f,_0x5507d9){var _0x51453e=_0x4633('0x5c');var _0x4a4470={'custom':![]};return utilLicense[_0x4633('0x5d')]()['then'](function(_0x48ca0f){if(_0x48ca0f){_0x4a4470=_0x48ca0f;}return db[_0x4633('0x39')][_0x4633('0x54')]({'where':{'id':_0x91a8fe['params']['id']},'attributes':[_0x4633('0x59'),_0x4633('0x5e'),_0x4633('0x5f'),_0x4633('0x60'),_0x4633('0x61'),_0x4633('0x62'),_0x4633('0x63'),_0x4633('0x64')],'raw':!![]});})['then'](handleEntityNotFound(_0x2fa28f,null))[_0x4633('0x1c')](function(_0x5c52e6){if(_0x5c52e6){var _0x1ba99d=_0x5c52e6['loginLogo']&&fs[_0x4633('0x65')](path[_0x4633('0x67')](config[_0x4633('0x6c')],_0x51453e,_[_0x4633('0x66')](_0x5c52e6[_0x4633('0x5e')])))?path[_0x4633('0x67')](config['root'],_0x51453e,_[_0x4633('0x66')](_0x5c52e6[_0x4633('0x5e')])):path[_0x4633('0x67')](config['root'],_0x51453e,_[_0x4633('0x66')](_0x4633('0x72')));var _0xf8dbcf=_0x4633('0x69')+_[_0x4633('0x6a')](_0x4633('0x5e'));if(_0x5c52e6[_0xf8dbcf]||!_0x4a4470['custom']){_0x1ba99d=path['join'](config[_0x4633('0x6c')],_0x51453e,_['toLower']('default_loginLogo.svg'));}if(!fs['existsSync'](_0x1ba99d)){throw new db['Sequelize'][(_0x4633('0x6e'))](_[_0x4633('0x6a')](_0x4633('0x5e'))+_0x4633('0x6f'));}return _0x2fa28f[_0x4633('0x70')](_0x1ba99d);}})['catch'](handleError(_0x2fa28f,null));};exports[_0x4633('0x73')]=function(_0x303b7e,_0x24be82){return db[_0x4633('0x39')][_0x4633('0x54')]({'where':{'id':_0x303b7e[_0x4633('0x55')]['id']},'attributes':['securePassword']})[_0x4633('0x1c')](respondWithResult(_0x24be82,null))['catch'](handleError(_0x24be82,null));};exports[_0x4633('0x74')]=function(_0xec89db,_0x53b7ca,_0x2ee435){if(_0xec89db[_0x4633('0x57')]&&_0xec89db['file'][_0x4633('0x58')]){_0xec89db[_0x4633('0x53')][_0x4633('0x5f')]=_0xec89db['file']['filename'];}return db['Setting'][_0x4633('0x54')]({'where':{'id':_0xec89db['params']['id']}})[_0x4633('0x1c')](handleEntityNotFound(_0x53b7ca,null))['then'](saveUpdates(_0xec89db[_0x4633('0x53')],null))[_0x4633('0x1c')](respondWithResult(_0x53b7ca,null))[_0x4633('0x26')](handleError(_0x53b7ca,null));};var utilLicense=require(_0x4633('0x5b'));exports[_0x4633('0x75')]=function(_0x40e4ae,_0x37a8d1,_0x3b44c9){var _0x7c187c=_0x4633('0x5c');var _0x2be991={'custom':![]};return utilLicense['getLicense']()[_0x4633('0x1c')](function(_0x43a9e7){if(_0x43a9e7){_0x2be991=_0x43a9e7;}return db[_0x4633('0x39')][_0x4633('0x54')]({'where':{'id':_0x40e4ae[_0x4633('0x55')]['id']},'attributes':[_0x4633('0x59'),'loginLogo',_0x4633('0x5f'),_0x4633('0x60'),_0x4633('0x61'),_0x4633('0x62'),_0x4633('0x63'),_0x4633('0x64')],'raw':!![]});})[_0x4633('0x1c')](handleEntityNotFound(_0x37a8d1,null))['then'](function(_0x4e820a){if(_0x4e820a){var _0x479679=_0x4e820a['preferred']&&fs['existsSync'](path[_0x4633('0x67')](config['root'],_0x7c187c,_['toLower'](_0x4e820a[_0x4633('0x5f')])))?path[_0x4633('0x67')](config[_0x4633('0x6c')],_0x7c187c,_[_0x4633('0x66')](_0x4e820a[_0x4633('0x5f')])):path[_0x4633('0x67')](config['root'],_0x7c187c,_[_0x4633('0x66')](_0x4633('0x76')));var _0x519447=_0x4633('0x69')+_[_0x4633('0x6a')](_0x4633('0x5f'));if(_0x4e820a[_0x519447]||!_0x2be991[_0x4633('0x6b')]||!_0x2be991[_0x4633('0x5f')]){_0x479679=path[_0x4633('0x67')](config[_0x4633('0x6c')],_0x7c187c,_['toLower'](_0x4633('0x76')));}if(!fs[_0x4633('0x65')](_0x479679)){throw new db['Sequelize'][(_0x4633('0x6e'))](_[_0x4633('0x6a')](_0x4633('0x5f'))+_0x4633('0x6f'));}return _0x37a8d1['download'](_0x479679);}})[_0x4633('0x26')](handleError(_0x37a8d1,null));};exports[_0x4633('0x77')]=function(_0x15d271,_0x2ed130,_0x44d7b6){if(_0x15d271[_0x4633('0x57')]&&_0x15d271[_0x4633('0x57')]['filename']){_0x15d271[_0x4633('0x53')][_0x4633('0x60')]=_0x15d271[_0x4633('0x57')][_0x4633('0x58')];}return db[_0x4633('0x39')][_0x4633('0x54')]({'where':{'id':_0x15d271[_0x4633('0x55')]['id']}})[_0x4633('0x1c')](handleEntityNotFound(_0x2ed130,null))['then'](saveUpdates(_0x15d271['body'],null))[_0x4633('0x1c')](respondWithResult(_0x2ed130,null))[_0x4633('0x26')](handleError(_0x2ed130,null));};var utilLicense=require('../../config/license/util');exports[_0x4633('0x78')]=function(_0x277a4b,_0x24d05c,_0x9157bd){var _0x4275f8=_0x4633('0x5c');var _0x35b95d={'custom':![]};return utilLicense[_0x4633('0x5d')]()[_0x4633('0x1c')](function(_0x28d397){if(_0x28d397){_0x35b95d=_0x28d397;}return db[_0x4633('0x39')][_0x4633('0x54')]({'where':{'id':_0x277a4b['params']['id']},'attributes':[_0x4633('0x59'),'loginLogo',_0x4633('0x5f'),_0x4633('0x60'),_0x4633('0x61'),_0x4633('0x62'),_0x4633('0x63'),_0x4633('0x64')],'raw':!![]});})[_0x4633('0x1c')](handleEntityNotFound(_0x24d05c,null))['then'](function(_0x125d90){if(_0x125d90){var _0x220415=_0x125d90['favicon']&&fs[_0x4633('0x65')](path[_0x4633('0x67')](config[_0x4633('0x6c')],_0x4275f8,_[_0x4633('0x66')](_0x125d90[_0x4633('0x60')])))?path[_0x4633('0x67')](config['root'],_0x4275f8,_[_0x4633('0x66')](_0x125d90['favicon'])):path['join'](config[_0x4633('0x6c')],_0x4275f8,_[_0x4633('0x66')](_0x4633('0x79')));var _0xcbd3a3=_0x4633('0x69')+_[_0x4633('0x6a')](_0x4633('0x60'));if(_0x125d90[_0xcbd3a3]||!_0x35b95d[_0x4633('0x6b')]){_0x220415=path[_0x4633('0x67')](config[_0x4633('0x6c')],_0x4275f8,_['toLower'](_0x4633('0x79')));}if(!fs['existsSync'](_0x220415)){throw new db[(_0x4633('0x6d'))][(_0x4633('0x6e'))](_[_0x4633('0x6a')]('favicon')+_0x4633('0x6f'));}return _0x24d05c[_0x4633('0x70')](_0x220415);}})[_0x4633('0x26')](handleError(_0x24d05c,null));};exports[_0x4633('0x7a')]=function(_0x2a9c3b,_0x38712e){var _0x50bbf7={'offset':moment()[_0x4633('0x7b')]()};_0x50bbf7[_0x4633('0x7c')]=moment()[_0x4633('0x7b')](_0x50bbf7['offset'])['format'](_0x4633('0x7d'));return _0x38712e[_0x4633('0x28')](0xc8)['send'](_0x50bbf7);};
\ No newline at end of file
+var _0x37f8=['error','Setting,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','destroy','stack','name','send','index','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','filter','type','VIRTUAL','merge','options','Setting','includeAll','include','findAll','rows','show','params','length','body','find','file','filename','logo','addLogoLogin','loginLogo','getLogo','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','join','root','toLower','default_logo.svg','Sequelize','ValidationError','upperFirst','download','server/files/images/logos','default_loginLogo.svg','default','custom','\x20not\x20found','gdpr','securePassword','addPreferred','getPreferred','defaultFavicon','default_preferred.png','addFavicon','getFavicon','getDate','utcOffset','now','format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','http','request','then','info','request\x20sent','debug','stringify'];(function(_0x332d0c,_0x59d5dc){var _0x2c7ab5=function(_0x99dd21){while(--_0x99dd21){_0x332d0c['push'](_0x332d0c['shift']());}};_0x2c7ab5(++_0x59d5dc);}(_0x37f8,0xd2));var _0x837f=function(_0x530b03,_0x16c200){_0x530b03=_0x530b03-0x0;var _0x518292=_0x37f8[_0x530b03];return _0x518292;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x837f('0x0'));var zipdir=require(_0x837f('0x1'));var jsonpatch=require(_0x837f('0x2'));var rp=require(_0x837f('0x3'));var moment=require('moment');var BPromise=require(_0x837f('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x837f('0x5'));var fs=require('fs');var fs_extra=require(_0x837f('0x6'));var _=require(_0x837f('0x7'));var squel=require(_0x837f('0x8'));var crypto=require(_0x837f('0x9'));var jsforce=require(_0x837f('0xa'));var deskjs=require(_0x837f('0xb'));var toCsv=require(_0x837f('0xc'));var querystring=require(_0x837f('0xd'));var Papa=require(_0x837f('0xe'));var Redis=require(_0x837f('0xf'));var authService=require(_0x837f('0x10'));var qs=require(_0x837f('0x11'));var as=require(_0x837f('0x12'));var hardwareService=require(_0x837f('0x13'));var logger=require('../../config/logger')(_0x837f('0x14'));var utils=require(_0x837f('0x15'));var config=require(_0x837f('0x16'));var licenseUtil=require(_0x837f('0x17'));var db=require(_0x837f('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x837f('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x3ccec4,_0x20be3c,_0x3e38ea,_0x2b3cd6){return new BPromise(function(_0x483267,_0x18d8aa){var _0xb5b3f4=_0x2b3cd6||client;return _0xb5b3f4[_0x837f('0x1a')](_0x3ccec4,_0x3e38ea)[_0x837f('0x1b')](function(_0x2e4257){logger[_0x837f('0x1c')]('Setting,\x20%s,\x20%s',_0x20be3c,_0x837f('0x1d'));logger[_0x837f('0x1e')]('Setting,\x20%s,\x20%s,\x20%s',_0x20be3c,_0x837f('0x1d'),JSON[_0x837f('0x1f')](_0x2e4257));if(_0x2e4257[_0x837f('0x20')]){if(_0x2e4257[_0x837f('0x20')]['code']===0x1f4){logger[_0x837f('0x20')](_0x837f('0x21'),_0x20be3c,_0x2e4257[_0x837f('0x20')][_0x837f('0x22')]);return _0x18d8aa(_0x2e4257[_0x837f('0x20')]['message']);}logger[_0x837f('0x20')](_0x837f('0x21'),_0x20be3c,_0x2e4257[_0x837f('0x20')][_0x837f('0x22')]);return _0x483267(_0x2e4257[_0x837f('0x20')]['message']);}else{logger[_0x837f('0x1c')](_0x837f('0x21'),_0x20be3c,_0x837f('0x1d'));_0x483267(_0x2e4257[_0x837f('0x23')][_0x837f('0x22')]);}})[_0x837f('0x24')](function(_0x41d102){logger[_0x837f('0x20')](_0x837f('0x21'),_0x20be3c,_0x41d102);_0x18d8aa(_0x41d102);});});}function respondWithStatusCode(_0x168455,_0x3fa18e){_0x3fa18e=_0x3fa18e||0xcc;return function(_0xfb4df0){if(_0xfb4df0){return _0x168455[_0x837f('0x25')](_0x3fa18e);}return _0x168455[_0x837f('0x26')](_0x3fa18e)[_0x837f('0x27')]();};}function respondWithResult(_0x11eb55,_0x43ca7d){_0x43ca7d=_0x43ca7d||0xc8;return function(_0x38da9f){if(_0x38da9f){return _0x11eb55[_0x837f('0x26')](_0x43ca7d)[_0x837f('0x28')](_0x38da9f);}};}function respondWithFilteredResult(_0x2c6a90,_0x246637){return function(_0x21f826){if(_0x21f826){var _0x4d2c23=typeof _0x246637[_0x837f('0x29')]===_0x837f('0x2a')&&typeof _0x246637[_0x837f('0x2b')]==='undefined';var _0x530f6d=_0x21f826[_0x837f('0x2c')];var _0x1ab2e4=_0x4d2c23?0x0:_0x246637[_0x837f('0x29')];var _0x4072a4=_0x4d2c23?_0x21f826[_0x837f('0x2c')]:_0x246637[_0x837f('0x29')]+_0x246637[_0x837f('0x2b')];var _0x507984;if(_0x4072a4>=_0x530f6d){_0x4072a4=_0x530f6d;_0x507984=0xc8;}else{_0x507984=0xce;}_0x2c6a90[_0x837f('0x26')](_0x507984);return _0x2c6a90[_0x837f('0x2d')](_0x837f('0x2e'),_0x1ab2e4+'-'+_0x4072a4+'/'+_0x530f6d)[_0x837f('0x28')](_0x21f826);}return null;};}function patchUpdates(_0x5d53c6){return function(_0x4e4528){try{jsonpatch['apply'](_0x4e4528,_0x5d53c6,!![]);}catch(_0x282ecb){return BPromise[_0x837f('0x2f')](_0x282ecb);}return _0x4e4528[_0x837f('0x30')]();};}function saveUpdates(_0x422498,_0x5e186e){return function(_0x223bf8){if(_0x223bf8){return _0x223bf8['update'](_0x422498)[_0x837f('0x1b')](function(_0x48f651){return _0x48f651;});}return null;};}function removeEntity(_0x5e98b5,_0x12bcec){return function(_0x252ea2){if(_0x252ea2){return _0x252ea2[_0x837f('0x31')]()[_0x837f('0x1b')](function(){_0x5e98b5[_0x837f('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56ddfc,_0xb66cab){return function(_0x4c6710){if(!_0x4c6710){_0x56ddfc[_0x837f('0x25')](0x194);}return _0x4c6710;};}function handleError(_0x22a721,_0x59cdc4){_0x59cdc4=_0x59cdc4||0x1f4;return function(_0x245342){logger[_0x837f('0x20')](_0x245342[_0x837f('0x32')]);if(_0x245342[_0x837f('0x33')]){delete _0x245342[_0x837f('0x33')];}_0x22a721['status'](_0x59cdc4)[_0x837f('0x34')](_0x245342);};}exports[_0x837f('0x35')]=function(_0x2a8c50,_0x1cab29){var _0x901cf={},_0x53215a={},_0x562b48={'count':0x0,'rows':[]};var _0x452daa=_['map'](db['Setting'][_0x837f('0x36')],function(_0x1c7352){return{'name':_0x1c7352['fieldName'],'type':_0x1c7352['type'][_0x837f('0x37')]};});_0x53215a[_0x837f('0x38')]=_[_0x837f('0x39')](_0x452daa,'name');_0x53215a[_0x837f('0x3a')]=_[_0x837f('0x3b')](_0x2a8c50[_0x837f('0x3a')]);_0x53215a[_0x837f('0x3c')]=_[_0x837f('0x3d')](_0x53215a['model'],_0x53215a['query']);_0x901cf[_0x837f('0x3e')]=_[_0x837f('0x3d')](_0x53215a[_0x837f('0x38')],qs['fields'](_0x2a8c50['query'][_0x837f('0x3f')]));_0x901cf[_0x837f('0x3e')]=_0x901cf[_0x837f('0x3e')]['length']?_0x901cf[_0x837f('0x3e')]:_0x53215a[_0x837f('0x38')];if(!_0x2a8c50['query']['hasOwnProperty']('nolimit')){_0x901cf[_0x837f('0x2b')]=qs[_0x837f('0x2b')](_0x2a8c50[_0x837f('0x3a')][_0x837f('0x2b')]);_0x901cf[_0x837f('0x29')]=qs[_0x837f('0x29')](_0x2a8c50[_0x837f('0x3a')][_0x837f('0x29')]);}_0x901cf[_0x837f('0x40')]=qs[_0x837f('0x41')](_0x2a8c50['query'][_0x837f('0x41')]);_0x901cf[_0x837f('0x42')]=qs['filters'](_[_0x837f('0x43')](_0x2a8c50[_0x837f('0x3a')],_0x53215a[_0x837f('0x3c')]),_0x452daa);if(_0x2a8c50[_0x837f('0x3a')][_0x837f('0x44')]){_0x901cf[_0x837f('0x42')]=_['merge'](_0x901cf[_0x837f('0x42')],{'$or':_[_0x837f('0x39')](_0x452daa,function(_0x28377a){if(_0x28377a[_0x837f('0x45')]!==_0x837f('0x46')){var _0x4530ac={};_0x4530ac[_0x28377a[_0x837f('0x33')]]={'$like':'%'+_0x2a8c50[_0x837f('0x3a')]['filter']+'%'};return _0x4530ac;}})});}_0x901cf=_[_0x837f('0x47')]({},_0x901cf,_0x2a8c50[_0x837f('0x48')]);var _0x4f9dcf={'where':_0x901cf[_0x837f('0x42')]};return db[_0x837f('0x49')]['count'](_0x4f9dcf)[_0x837f('0x1b')](function(_0x259a70){_0x562b48[_0x837f('0x2c')]=_0x259a70;if(_0x2a8c50[_0x837f('0x3a')][_0x837f('0x4a')]){_0x901cf[_0x837f('0x4b')]=[{'all':!![]}];}return db['Setting'][_0x837f('0x4c')](_0x901cf);})['then'](function(_0x1146ef){_0x562b48[_0x837f('0x4d')]=_0x1146ef;return _0x562b48;})[_0x837f('0x1b')](respondWithFilteredResult(_0x1cab29,_0x901cf))[_0x837f('0x24')](handleError(_0x1cab29,null));};exports[_0x837f('0x4e')]=function(_0x1e82aa,_0x50bd1b){var _0x554f74={'raw':![],'where':{'id':_0x1e82aa[_0x837f('0x4f')]['id']}},_0x5edfcc={};_0x5edfcc[_0x837f('0x38')]=_['keys'](db[_0x837f('0x49')]['rawAttributes']);_0x5edfcc[_0x837f('0x3a')]=_[_0x837f('0x3b')](_0x1e82aa[_0x837f('0x3a')]);_0x5edfcc[_0x837f('0x3c')]=_[_0x837f('0x3d')](_0x5edfcc[_0x837f('0x38')],_0x5edfcc['query']);_0x554f74[_0x837f('0x3e')]=_['intersection'](_0x5edfcc[_0x837f('0x38')],qs[_0x837f('0x3f')](_0x1e82aa[_0x837f('0x3a')]['fields']));_0x554f74[_0x837f('0x3e')]=_0x554f74[_0x837f('0x3e')][_0x837f('0x50')]?_0x554f74[_0x837f('0x3e')]:_0x5edfcc[_0x837f('0x38')];if(_0x1e82aa[_0x837f('0x3a')]['includeAll']){_0x554f74[_0x837f('0x4b')]=[{'all':!![]}];}_0x554f74=_[_0x837f('0x47')]({},_0x554f74,_0x1e82aa[_0x837f('0x48')]);return db[_0x837f('0x49')]['find'](_0x554f74)[_0x837f('0x1b')](handleEntityNotFound(_0x50bd1b,null))['then'](respondWithResult(_0x50bd1b,null))[_0x837f('0x24')](handleError(_0x50bd1b,null));};exports['update']=function(_0x23d555,_0x4655fb){if(_0x23d555[_0x837f('0x51')]['id']){delete _0x23d555[_0x837f('0x51')]['id'];}return db[_0x837f('0x49')][_0x837f('0x52')]({'where':{'id':_0x23d555[_0x837f('0x4f')]['id']}})[_0x837f('0x1b')](handleEntityNotFound(_0x4655fb,null))[_0x837f('0x1b')](saveUpdates(_0x23d555[_0x837f('0x51')],null))[_0x837f('0x1b')](respondWithResult(_0x4655fb,null))[_0x837f('0x24')](handleError(_0x4655fb,null));};exports['addLogo']=function(_0x4ade1b,_0x16cb00,_0x53d46d){if(_0x4ade1b[_0x837f('0x53')]&&_0x4ade1b[_0x837f('0x53')][_0x837f('0x54')]){_0x4ade1b[_0x837f('0x51')][_0x837f('0x55')]=_0x4ade1b[_0x837f('0x53')][_0x837f('0x54')];}return db[_0x837f('0x49')][_0x837f('0x52')]({'where':{'id':_0x4ade1b[_0x837f('0x4f')]['id']}})[_0x837f('0x1b')](handleEntityNotFound(_0x16cb00,null))[_0x837f('0x1b')](saveUpdates(_0x4ade1b[_0x837f('0x51')],null))['then'](respondWithResult(_0x16cb00,null))[_0x837f('0x24')](handleError(_0x16cb00,null));};exports[_0x837f('0x56')]=function(_0xc595c9,_0x5acfab,_0x6db423){if(_0xc595c9[_0x837f('0x53')]&&_0xc595c9[_0x837f('0x53')][_0x837f('0x54')]){_0xc595c9[_0x837f('0x51')][_0x837f('0x57')]=_0xc595c9[_0x837f('0x53')]['filename'];}return db[_0x837f('0x49')][_0x837f('0x52')]({'where':{'id':_0xc595c9[_0x837f('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5acfab,null))[_0x837f('0x1b')](saveUpdates(_0xc595c9[_0x837f('0x51')],null))[_0x837f('0x1b')](respondWithResult(_0x5acfab,null))[_0x837f('0x24')](handleError(_0x5acfab,null));};var utilLicense=require('../../config/license/util');exports[_0x837f('0x58')]=function(_0x19a371,_0x37621e,_0x5df561){var _0x53c966='server/files/images/logos';var _0x323344={'custom':![]};return utilLicense[_0x837f('0x59')]()[_0x837f('0x1b')](function(_0x19cbd4){if(_0x19cbd4){_0x323344=_0x19cbd4;}return db[_0x837f('0x49')][_0x837f('0x52')]({'where':{'id':_0x19a371[_0x837f('0x4f')]['id']},'attributes':[_0x837f('0x55'),_0x837f('0x57'),_0x837f('0x5a'),_0x837f('0x5b'),_0x837f('0x5c'),_0x837f('0x5d'),_0x837f('0x5e'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x37621e,null))['then'](function(_0x128011){if(_0x128011){var _0x3b1c64=_0x128011[_0x837f('0x55')]&&fs[_0x837f('0x5f')](path[_0x837f('0x60')](config[_0x837f('0x61')],_0x53c966,_['toLower'](_0x128011[_0x837f('0x55')])))?path[_0x837f('0x60')](config['root'],_0x53c966,_[_0x837f('0x62')](_0x128011[_0x837f('0x55')])):path[_0x837f('0x60')](config['root'],_0x53c966,_[_0x837f('0x62')](_0x837f('0x63')));var _0x3016eb='default'+_['upperFirst'](_0x837f('0x55'));if(_0x128011[_0x3016eb]||!_0x323344['custom']){_0x3b1c64=path[_0x837f('0x60')](config[_0x837f('0x61')],_0x53c966,_[_0x837f('0x62')](_0x837f('0x63')));}if(!fs['existsSync'](_0x3b1c64)){throw new db[(_0x837f('0x64'))][(_0x837f('0x65'))](_[_0x837f('0x66')]('logo')+'\x20not\x20found');}return _0x37621e[_0x837f('0x67')](_0x3b1c64);}})[_0x837f('0x24')](handleError(_0x37621e,null));};var utilLicense=require(_0x837f('0x17'));exports['getLogoLogin']=function(_0x5c9d05,_0x5a78d3,_0x42071d){var _0x306ae2=_0x837f('0x68');var _0xf7a946={'custom':![]};return utilLicense['getLicense']()[_0x837f('0x1b')](function(_0x164ed4){if(_0x164ed4){_0xf7a946=_0x164ed4;}return db['Setting'][_0x837f('0x52')]({'where':{'id':_0x5c9d05['params']['id']},'attributes':[_0x837f('0x55'),_0x837f('0x57'),_0x837f('0x5a'),_0x837f('0x5b'),_0x837f('0x5c'),'defaultLoginLogo',_0x837f('0x5e'),'defaultFavicon'],'raw':!![]});})[_0x837f('0x1b')](handleEntityNotFound(_0x5a78d3,null))[_0x837f('0x1b')](function(_0x882897){if(_0x882897){var _0x166b55=_0x882897['loginLogo']&&fs[_0x837f('0x5f')](path[_0x837f('0x60')](config['root'],_0x306ae2,_[_0x837f('0x62')](_0x882897['loginLogo'])))?path[_0x837f('0x60')](config[_0x837f('0x61')],_0x306ae2,_['toLower'](_0x882897[_0x837f('0x57')])):path[_0x837f('0x60')](config[_0x837f('0x61')],_0x306ae2,_[_0x837f('0x62')](_0x837f('0x69')));var _0x24e5f6=_0x837f('0x6a')+_[_0x837f('0x66')]('loginLogo');if(_0x882897[_0x24e5f6]||!_0xf7a946[_0x837f('0x6b')]){_0x166b55=path[_0x837f('0x60')](config[_0x837f('0x61')],_0x306ae2,_['toLower'](_0x837f('0x69')));}if(!fs[_0x837f('0x5f')](_0x166b55)){throw new db[(_0x837f('0x64'))]['ValidationError'](_[_0x837f('0x66')](_0x837f('0x57'))+_0x837f('0x6c'));}return _0x5a78d3['download'](_0x166b55);}})[_0x837f('0x24')](handleError(_0x5a78d3,null));};exports[_0x837f('0x6d')]=function(_0x2bf07f,_0x3a341a){return db['Setting'][_0x837f('0x52')]({'where':{'id':_0x2bf07f[_0x837f('0x4f')]['id']},'attributes':[_0x837f('0x6e')]})[_0x837f('0x1b')](respondWithResult(_0x3a341a,null))[_0x837f('0x24')](handleError(_0x3a341a,null));};exports[_0x837f('0x6f')]=function(_0x3e20f5,_0xef98af,_0x31f7c0){if(_0x3e20f5[_0x837f('0x53')]&&_0x3e20f5[_0x837f('0x53')][_0x837f('0x54')]){_0x3e20f5['body'][_0x837f('0x5a')]=_0x3e20f5[_0x837f('0x53')][_0x837f('0x54')];}return db[_0x837f('0x49')][_0x837f('0x52')]({'where':{'id':_0x3e20f5[_0x837f('0x4f')]['id']}})[_0x837f('0x1b')](handleEntityNotFound(_0xef98af,null))[_0x837f('0x1b')](saveUpdates(_0x3e20f5['body'],null))['then'](respondWithResult(_0xef98af,null))[_0x837f('0x24')](handleError(_0xef98af,null));};var utilLicense=require(_0x837f('0x17'));exports[_0x837f('0x70')]=function(_0xe7a459,_0x166a50,_0x471633){var _0x552778=_0x837f('0x68');var _0x2cc02a={'custom':![]};return utilLicense[_0x837f('0x59')]()[_0x837f('0x1b')](function(_0x31984f){if(_0x31984f){_0x2cc02a=_0x31984f;}return db[_0x837f('0x49')]['find']({'where':{'id':_0xe7a459[_0x837f('0x4f')]['id']},'attributes':[_0x837f('0x55'),_0x837f('0x57'),'preferred',_0x837f('0x5b'),'defaultLogo',_0x837f('0x5d'),'defaultPreferred',_0x837f('0x71')],'raw':!![]});})[_0x837f('0x1b')](handleEntityNotFound(_0x166a50,null))['then'](function(_0x48ddbf){if(_0x48ddbf){var _0x3289b7=_0x48ddbf[_0x837f('0x5a')]&&fs['existsSync'](path['join'](config[_0x837f('0x61')],_0x552778,_[_0x837f('0x62')](_0x48ddbf[_0x837f('0x5a')])))?path[_0x837f('0x60')](config[_0x837f('0x61')],_0x552778,_[_0x837f('0x62')](_0x48ddbf[_0x837f('0x5a')])):path[_0x837f('0x60')](config[_0x837f('0x61')],_0x552778,_[_0x837f('0x62')](_0x837f('0x72')));var _0x66c876='default'+_[_0x837f('0x66')](_0x837f('0x5a'));if(_0x48ddbf[_0x66c876]||!_0x2cc02a[_0x837f('0x6b')]||!_0x2cc02a[_0x837f('0x5a')]){_0x3289b7=path[_0x837f('0x60')](config[_0x837f('0x61')],_0x552778,_[_0x837f('0x62')]('default_preferred.png'));}if(!fs[_0x837f('0x5f')](_0x3289b7)){throw new db[(_0x837f('0x64'))][(_0x837f('0x65'))](_[_0x837f('0x66')]('preferred')+_0x837f('0x6c'));}return _0x166a50[_0x837f('0x67')](_0x3289b7);}})['catch'](handleError(_0x166a50,null));};exports[_0x837f('0x73')]=function(_0x41fc30,_0xef053c,_0x210ab8){if(_0x41fc30[_0x837f('0x53')]&&_0x41fc30[_0x837f('0x53')][_0x837f('0x54')]){_0x41fc30[_0x837f('0x51')]['favicon']=_0x41fc30[_0x837f('0x53')][_0x837f('0x54')];}return db[_0x837f('0x49')]['find']({'where':{'id':_0x41fc30[_0x837f('0x4f')]['id']}})[_0x837f('0x1b')](handleEntityNotFound(_0xef053c,null))[_0x837f('0x1b')](saveUpdates(_0x41fc30[_0x837f('0x51')],null))[_0x837f('0x1b')](respondWithResult(_0xef053c,null))['catch'](handleError(_0xef053c,null));};var utilLicense=require(_0x837f('0x17'));exports[_0x837f('0x74')]=function(_0x1000c3,_0xa9b002,_0x38e255){var _0x26ea4a='server/files/images/logos';var _0x4e4fb6={'custom':![]};return utilLicense[_0x837f('0x59')]()[_0x837f('0x1b')](function(_0xfc0905){if(_0xfc0905){_0x4e4fb6=_0xfc0905;}return db[_0x837f('0x49')]['find']({'where':{'id':_0x1000c3[_0x837f('0x4f')]['id']},'attributes':[_0x837f('0x55'),'loginLogo',_0x837f('0x5a'),_0x837f('0x5b'),'defaultLogo',_0x837f('0x5d'),'defaultPreferred',_0x837f('0x71')],'raw':!![]});})[_0x837f('0x1b')](handleEntityNotFound(_0xa9b002,null))['then'](function(_0x141aeb){if(_0x141aeb){var _0x585ee8=_0x141aeb[_0x837f('0x5b')]&&fs[_0x837f('0x5f')](path[_0x837f('0x60')](config['root'],_0x26ea4a,_[_0x837f('0x62')](_0x141aeb[_0x837f('0x5b')])))?path[_0x837f('0x60')](config[_0x837f('0x61')],_0x26ea4a,_[_0x837f('0x62')](_0x141aeb[_0x837f('0x5b')])):path[_0x837f('0x60')](config[_0x837f('0x61')],_0x26ea4a,_['toLower']('default_favicon.ico'));var _0x1f6a00=_0x837f('0x6a')+_[_0x837f('0x66')](_0x837f('0x5b'));if(_0x141aeb[_0x1f6a00]||!_0x4e4fb6['custom']){_0x585ee8=path[_0x837f('0x60')](config['root'],_0x26ea4a,_[_0x837f('0x62')]('default_favicon.ico'));}if(!fs['existsSync'](_0x585ee8)){throw new db[(_0x837f('0x64'))][(_0x837f('0x65'))](_[_0x837f('0x66')](_0x837f('0x5b'))+_0x837f('0x6c'));}return _0xa9b002['download'](_0x585ee8);}})[_0x837f('0x24')](handleError(_0xa9b002,null));};exports[_0x837f('0x75')]=function(_0xc92a78,_0x2ff476){var _0x52d3f8={'offset':moment()[_0x837f('0x76')]()};_0x52d3f8[_0x837f('0x77')]=moment()['utcOffset'](_0x52d3f8[_0x837f('0x29')])[_0x837f('0x78')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x2ff476['status'](0xc8)['send'](_0x52d3f8);};
\ No newline at end of file
index b9b8f91..13af672 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x3f2d02,_0x2c7deb){var _0x54092b=function(_0x427ff8){while(--_0x427ff8){_0x3f2d02['push'](_0x3f2d02['shift']());}};_0x54092b(++_0x2c7deb);}(_0x008c,0x188));var _0xc008=function(_0x575783,_0x4f66f6){_0x575783=_0x575783-0x0;var _0x1aeae0=_0x008c[_0x575783];return _0x1aeae0;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3e74=['exports','Setting','settings','lodash','../../config/logger','api','moment','path','../../config/environment','./setting.attributes'];(function(_0x55fb83,_0x1d3856){var _0x59a87a=function(_0x38bdd1){while(--_0x38bdd1){_0x55fb83['push'](_0x55fb83['shift']());}};_0x59a87a(++_0x1d3856);}(_0x3e74,0x175));var _0x43e7=function(_0x270fbc,_0x43692b){_0x270fbc=_0x270fbc-0x0;var _0x86e04b=_0x3e74[_0x270fbc];return _0x86e04b;};'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 95069bc..71057c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6cf1=['code','Setting,\x20%s,\x20%s','message','result','Setting','options','raw','attributes','map','include','model','ShowSetting','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5ec385,_0x59b5f2){var _0x272dba=function(_0x10cca8){while(--_0x10cca8){_0x5ec385['push'](_0x5ec385['shift']());}};_0x272dba(++_0x59b5f2);}(_0x6cf1,0x99));var _0x16cf=function(_0x369546,_0x41aecb){_0x369546=_0x369546-0x0;var _0x4d8690=_0x6cf1[_0x369546];return _0x4d8690;};'use strict';var _=require(_0x16cf('0x0'));var util=require('util');var moment=require(_0x16cf('0x1'));var BPromise=require(_0x16cf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x16cf('0x3'));var db=require(_0x16cf('0x4'))['db'];var utils=require(_0x16cf('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x16cf('0x6'));var jayson=require(_0x16cf('0x7'));var client=jayson[_0x16cf('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d7b69,_0x1653ba,_0x4b869b){return new BPromise(function(_0x318833,_0x1bed9e){return client['request'](_0x5d7b69,_0x4b869b)['then'](function(_0x245229){logger[_0x16cf('0x9')]('Setting,\x20%s,\x20%s',_0x1653ba,_0x16cf('0xa'));logger[_0x16cf('0xb')](_0x16cf('0xc'),_0x1653ba,'request\x20sent',JSON[_0x16cf('0xd')](_0x245229));if(_0x245229[_0x16cf('0xe')]){if(_0x245229['error'][_0x16cf('0xf')]===0x1f4){logger[_0x16cf('0xe')](_0x16cf('0x10'),_0x1653ba,_0x245229['error'][_0x16cf('0x11')]);return _0x1bed9e(_0x245229[_0x16cf('0xe')][_0x16cf('0x11')]);}logger['error'](_0x16cf('0x10'),_0x1653ba,_0x245229[_0x16cf('0xe')][_0x16cf('0x11')]);return _0x318833(_0x245229['error'][_0x16cf('0x11')]);}else{logger[_0x16cf('0x9')](_0x16cf('0x10'),_0x1653ba,_0x16cf('0xa'));_0x318833(_0x245229[_0x16cf('0x12')][_0x16cf('0x11')]);}})['catch'](function(_0x5c2c01){logger[_0x16cf('0xe')](_0x16cf('0x10'),_0x1653ba,_0x5c2c01);_0x1bed9e(_0x5c2c01);});});}exports['ShowSetting']=function(_0x537d84){var _0x4dc1af=this;return new Promise(function(_0x405747,_0x511d38){return db[_0x16cf('0x13')]['find']({'raw':_0x537d84[_0x16cf('0x14')]?_0x537d84[_0x16cf('0x14')][_0x16cf('0x15')]===undefined?!![]:![]:!![],'where':_0x537d84[_0x16cf('0x14')]?_0x537d84['options']['where']||null:null,'attributes':_0x537d84['options']?_0x537d84['options'][_0x16cf('0x16')]||null:null,'include':_0x537d84[_0x16cf('0x14')]?_0x537d84['options']['include']?_[_0x16cf('0x17')](_0x537d84[_0x16cf('0x14')][_0x16cf('0x18')],function(_0x33e2ac){return{'model':db[_0x33e2ac[_0x16cf('0x19')]],'as':_0x33e2ac['as'],'attributes':_0x33e2ac[_0x16cf('0x16')],'include':_0x33e2ac['include']?_['map'](_0x33e2ac[_0x16cf('0x18')],function(_0x57ad3d){return{'model':db[_0x57ad3d[_0x16cf('0x19')]],'as':_0x57ad3d['as'],'attributes':_0x57ad3d['attributes'],'include':_0x57ad3d[_0x16cf('0x18')]?_['map'](_0x57ad3d['include'],function(_0x336757){return{'model':db[_0x336757[_0x16cf('0x19')]],'as':_0x336757['as'],'attributes':_0x336757['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x21a5d3){logger[_0x16cf('0x9')](_0x16cf('0x1a'),_0x537d84);logger['debug'](_0x16cf('0x1a'),_0x537d84,JSON[_0x16cf('0xd')](_0x21a5d3));_0x405747(_0x21a5d3);})[_0x16cf('0x1b')](function(_0x475c15){logger[_0x16cf('0xe')]('ShowSetting',_0x475c15[_0x16cf('0x11')],_0x537d84);_0x511d38(_0x4dc1af[_0x16cf('0xe')](0x1f4,_0x475c15['message']));});});};
\ No newline at end of file
+var _0xbe60=['../../config/environment','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSetting','Setting','raw','options','where','include','map','model','attributes','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xca1091,_0x539dbf){var _0xd3019c=function(_0xd629e0){while(--_0xd629e0){_0xca1091['push'](_0xca1091['shift']());}};_0xd3019c(++_0x539dbf);}(_0xbe60,0xfe));var _0x0be6=function(_0x4c8a19,_0x19cb81){_0x4c8a19=_0x4c8a19-0x0;var _0x4fbd23=_0xbe60[_0x4c8a19];return _0x4fbd23;};'use strict';var _=require(_0x0be6('0x0'));var util=require(_0x0be6('0x1'));var moment=require(_0x0be6('0x2'));var BPromise=require(_0x0be6('0x3'));var rs=require(_0x0be6('0x4'));var fs=require('fs');var Redis=require(_0x0be6('0x5'));var db=require(_0x0be6('0x6'))['db'];var utils=require(_0x0be6('0x7'));var logger=require(_0x0be6('0x8'))(_0x0be6('0x9'));var config=require(_0x0be6('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0be6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d7282,_0x5ba3c8,_0x6ace0a){return new BPromise(function(_0x7a9f39,_0x4a644e){return client[_0x0be6('0xc')](_0x5d7282,_0x6ace0a)[_0x0be6('0xd')](function(_0x18054e){logger[_0x0be6('0xe')](_0x0be6('0xf'),_0x5ba3c8,_0x0be6('0x10'));logger[_0x0be6('0x11')](_0x0be6('0x12'),_0x5ba3c8,_0x0be6('0x10'),JSON[_0x0be6('0x13')](_0x18054e));if(_0x18054e[_0x0be6('0x14')]){if(_0x18054e[_0x0be6('0x14')]['code']===0x1f4){logger[_0x0be6('0x14')]('Setting,\x20%s,\x20%s',_0x5ba3c8,_0x18054e[_0x0be6('0x14')]['message']);return _0x4a644e(_0x18054e[_0x0be6('0x14')][_0x0be6('0x15')]);}logger['error'](_0x0be6('0xf'),_0x5ba3c8,_0x18054e[_0x0be6('0x14')]['message']);return _0x7a9f39(_0x18054e[_0x0be6('0x14')][_0x0be6('0x15')]);}else{logger[_0x0be6('0xe')](_0x0be6('0xf'),_0x5ba3c8,_0x0be6('0x10'));_0x7a9f39(_0x18054e[_0x0be6('0x16')][_0x0be6('0x15')]);}})[_0x0be6('0x17')](function(_0x5af6ac){logger['error'](_0x0be6('0xf'),_0x5ba3c8,_0x5af6ac);_0x4a644e(_0x5af6ac);});});}exports[_0x0be6('0x18')]=function(_0x4eafa0){var _0x1d904a=this;return new Promise(function(_0x17e874,_0x2e4ea8){return db[_0x0be6('0x19')]['find']({'raw':_0x4eafa0['options']?_0x4eafa0['options'][_0x0be6('0x1a')]===undefined?!![]:![]:!![],'where':_0x4eafa0[_0x0be6('0x1b')]?_0x4eafa0[_0x0be6('0x1b')][_0x0be6('0x1c')]||null:null,'attributes':_0x4eafa0['options']?_0x4eafa0[_0x0be6('0x1b')]['attributes']||null:null,'include':_0x4eafa0[_0x0be6('0x1b')]?_0x4eafa0[_0x0be6('0x1b')][_0x0be6('0x1d')]?_[_0x0be6('0x1e')](_0x4eafa0[_0x0be6('0x1b')][_0x0be6('0x1d')],function(_0x10c848){return{'model':db[_0x10c848[_0x0be6('0x1f')]],'as':_0x10c848['as'],'attributes':_0x10c848[_0x0be6('0x20')],'include':_0x10c848[_0x0be6('0x1d')]?_['map'](_0x10c848[_0x0be6('0x1d')],function(_0x5f0eec){return{'model':db[_0x5f0eec[_0x0be6('0x1f')]],'as':_0x5f0eec['as'],'attributes':_0x5f0eec[_0x0be6('0x20')],'include':_0x5f0eec[_0x0be6('0x1d')]?_[_0x0be6('0x1e')](_0x5f0eec[_0x0be6('0x1d')],function(_0x1d5bba){return{'model':db[_0x1d5bba[_0x0be6('0x1f')]],'as':_0x1d5bba['as'],'attributes':_0x1d5bba[_0x0be6('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0be6('0xd')](function(_0x45b95b){logger['info'](_0x0be6('0x18'),_0x4eafa0);logger['debug'](_0x0be6('0x18'),_0x4eafa0,JSON['stringify'](_0x45b95b));_0x17e874(_0x45b95b);})[_0x0be6('0x17')](function(_0x297b49){logger[_0x0be6('0x14')](_0x0be6('0x18'),_0x297b49[_0x0be6('0x15')],_0x4eafa0);_0x2e4ea8(_0x1d904a['error'](0x1f4,_0x297b49[_0x0be6('0x15')]));});});};
\ No newline at end of file
index 2e7cfe9..bcd342c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['getInteractions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/status','status','addAgents','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions'];(function(_0x2487cd,_0x299728){var _0x1956f1=function(_0x48bb65){while(--_0x48bb65){_0x2487cd['push'](_0x2487cd['shift']());}};_0x1956f1(++_0x299728);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/canned_answers',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x9')](_0x7995('0x14'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router['get']('/:id/status',controller[_0x7995('0x16')]);router[_0x7995('0x9')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x1a')]);router['post'](_0x7995('0xf'),auth['isAuthenticated'](),controller[_0x7995('0x1b')]);router[_0x7995('0x19')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router[_0x7995('0x19')]('/:id/notify',controller['notify']);router[_0x7995('0x19')]('/:id/applications',auth['isAuthenticated'](),controller[_0x7995('0x1e')]);router[_0x7995('0x19')]('/:id/send',auth[_0x7995('0xa')](),controller['send']);router['post'](_0x7995('0x1f'),controller[_0x7995('0x20')]);router[_0x7995('0x19')](_0x7995('0x17'),auth[_0x7995('0xa')](),controller[_0x7995('0x21')]);router['put'](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x23')]);router[_0x7995('0x24')](_0x7995('0x22'),auth[_0x7995('0xa')](),controller[_0x7995('0x25')]);router[_0x7995('0x24')]('/:id/dispositions',auth[_0x7995('0xa')](),controller[_0x7995('0x26')]);router[_0x7995('0x24')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x27')]);router['delete'](_0x7995('0x17'),auth['isAuthenticated'](),controller[_0x7995('0x28')]);module[_0x7995('0x29')]=router;
\ No newline at end of file
+var _0x814b=['/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/send','status','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated'];(function(_0x940009,_0x32b94b){var _0x1529d2=function(_0x20de13){while(--_0x20de13){_0x940009['push'](_0x940009['shift']());}};_0x1529d2(++_0x32b94b);}(_0x814b,0x1a2));var _0xb814=function(_0x1eb585,_0x202476){_0x1eb585=_0x1eb585-0x0;var _0x497ee2=_0x814b[_0x1eb585];return _0x497ee2;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0xa')](_0xb814('0x16'),auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0xa')](_0xb814('0x18'),controller[_0xb814('0x19')]);router[_0xb814('0xa')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router[_0xb814('0x1c')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x1e')]);router['post'](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x1f')]);router[_0xb814('0x1c')]('/:id/notify',controller['notify']);router['post'](_0xb814('0x14'),auth['isAuthenticated'](),controller['addApplications']);router[_0xb814('0x1c')](_0xb814('0x20'),auth[_0xb814('0xb')](),controller['send']);router[_0xb814('0x1c')]('/:id/status',controller[_0xb814('0x21')]);router[_0xb814('0x1c')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x22')]);router[_0xb814('0x23')](_0xb814('0xe'),auth['isAuthenticated'](),controller[_0xb814('0x24')]);router['delete'](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x25')]);router[_0xb814('0x26')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x27')]);router['delete'](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x28')]);router[_0xb814('0x26')](_0xb814('0x1a'),auth[_0xb814('0xb')](),controller[_0xb814('0x29')]);module[_0xb814('0x2a')]=router;
\ No newline at end of file
index dbb9958..c16483e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a18=['twilio','skebby','connectel','clicksend','clickatell','csc','infobip','intelepeer','BOOLEAN','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','name','generate','ENUM'];(function(_0x3d0fe1,_0x1d72cc){var _0x2999fa=function(_0x42fc41){while(--_0x42fc41){_0x3d0fe1['push'](_0x3d0fe1['shift']());}};_0x2999fa(++_0x1d72cc);}(_0x9a18,0x1b1));var _0x89a1=function(_0x3114df,_0x1cc087){_0x3114df=_0x3114df-0x0;var _0x82ddad=_0x9a18[_0x3114df];return _0x82ddad;};'use strict';var Sequelize=require(_0x89a1('0x0'));var rs=require(_0x89a1('0x1'));module[_0x89a1('0x2')]={'name':{'type':Sequelize[_0x89a1('0x3')],'unique':_0x89a1('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x89a1('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x89a1('0x3')],'defaultValue':function(){return rs[_0x89a1('0x5')]();}},'phone':{'type':Sequelize[_0x89a1('0x3')]},'type':{'type':Sequelize[_0x89a1('0x6')](_0x89a1('0x7'),_0x89a1('0x8'),_0x89a1('0x9'),_0x89a1('0xa'),'plivo',_0x89a1('0xb'),'bandwidth',_0x89a1('0xc'),_0x89a1('0xd'),_0x89a1('0xe'))},'accountSid':{'type':Sequelize[_0x89a1('0x3')]},'authId':{'type':Sequelize[_0x89a1('0x3')]},'authToken':{'type':Sequelize[_0x89a1('0x3')]},'smsMethod':{'type':Sequelize[_0x89a1('0x6')]('SI','TI','GP')},'username':{'type':Sequelize[_0x89a1('0x3')]},'password':{'type':Sequelize[_0x89a1('0x3')]},'apiKey':{'type':Sequelize[_0x89a1('0x3')]},'applicationId':{'type':Sequelize[_0x89a1('0x3')]},'accountId':{'type':Sequelize[_0x89a1('0x3')]},'senderString':{'type':Sequelize[_0x89a1('0x3')]},'deliveryReport':{'type':Sequelize[_0x89a1('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0x89a1('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x89a1('0x10');}},'notificationSound':{'type':Sequelize[_0x89a1('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x89a1('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x89a1('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x89a1('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x89a1('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x89a1('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x89a1('0x11')],'comment':_0x89a1('0x12')},'mandatoryDisposition':{'type':Sequelize[_0x89a1('0xf')],'defaultValue':![],'comment':_0x89a1('0x13'),'set':function(_0x593e30){if(!_0x593e30)this[_0x89a1('0x14')]('mandatoryDispositionPauseId',null);this[_0x89a1('0x14')](_0x89a1('0x15'),_0x593e30);}}};
\ No newline at end of file
+var _0x47e6=['clickatell','csc','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','twilio','clicksend','plivo'];(function(_0x128ab2,_0xe48ec3){var _0x4c9d34=function(_0x1478cf){while(--_0x1478cf){_0x128ab2['push'](_0x128ab2['shift']());}};_0x4c9d34(++_0xe48ec3);}(_0x47e6,0x1e6));var _0x647e=function(_0x4f4c0b,_0xce28fe){_0x4f4c0b=_0x4f4c0b-0x0;var _0x1dc865=_0x47e6[_0x4f4c0b];return _0x1dc865;};'use strict';var Sequelize=require(_0x647e('0x0'));var rs=require('randomstring');module[_0x647e('0x1')]={'name':{'type':Sequelize[_0x647e('0x2')],'unique':_0x647e('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x647e('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x647e('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x647e('0x4')](_0x647e('0x5'),'skebby','connectel',_0x647e('0x6'),_0x647e('0x7'),_0x647e('0x8'),'bandwidth',_0x647e('0x9'),'infobip',_0x647e('0xa'))},'accountSid':{'type':Sequelize[_0x647e('0x2')]},'authId':{'type':Sequelize[_0x647e('0x2')]},'authToken':{'type':Sequelize[_0x647e('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x647e('0x2')]},'password':{'type':Sequelize[_0x647e('0x2')]},'apiKey':{'type':Sequelize[_0x647e('0x2')]},'applicationId':{'type':Sequelize['STRING']},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x647e('0xb')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x647e('0xc')],'defaultValue':function(){return _0x647e('0xd');}},'notificationSound':{'type':Sequelize[_0x647e('0xb')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x647e('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x647e('0xb')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x647e('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x647e('0xb')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x647e('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x647e('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x647e('0xe')],'comment':_0x647e('0xf')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x647e('0x10'),'set':function(_0x24406a){if(!_0x24406a)this[_0x647e('0x11')]('mandatoryDispositionPauseId',null);this[_0x647e('0x11')](_0x647e('0x12'),_0x24406a);}}};
\ No newline at end of file
index a4fa7a0..c0127f4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x652f=['http','request','then','info','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','SmsAccount,\x20%s,\x20%s','message','catch','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','sort','filter','where','type','VIRTUAL','merge','include','show','params','keys','rawAttributes','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','hasOwnProperty','order','pick','findAll','rows','ids','CannedAnswer','removeAnswers','SmsApplication','Applications','applications','orderBy','priority','asc','account','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','skebby','sender','text','connectel','message_id','plivo','MessageUUID','infobip','results','csc','originatingAddress','clickatell','replyMessageId','bandwidth','refid','isNil','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','updatedAt','DESC','omit','SmsInteraction','spread','interaction','autoclose','push','close','created','SmsMessage','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','debug','Content-Type','text/xml','<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>','json','addApplications','transaction','getApplications','getInteractions','User','Owner','fullname','internal','Tags','color','tag','List','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','clicksend','status_code','groupName','DELIVERED','intelepeer','redif','error_code','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','statusGet','state','message-id','addAgents','userSmsAccount:save','removeAgents','isArray','emit','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','client'];(function(_0x4fb605,_0x4f098b){var _0x4ff438=function(_0x35e8c4){while(--_0x35e8c4){_0x4fb605['push'](_0x4fb605['shift']());}};_0x4ff438(++_0x4f098b);}(_0x652f,0xbe));var _0xf652=function(_0x1d1357,_0x203a07){_0x1d1357=_0x1d1357-0x0;var _0x4422ba=_0x652f[_0x1d1357];return _0x4422ba;};'use strict';var emlformat=require(_0xf652('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf652('0x1'));var jsonpatch=require(_0xf652('0x2'));var rp=require('request-promise');var moment=require(_0xf652('0x3'));var BPromise=require(_0xf652('0x4'));var Mustache=require(_0xf652('0x5'));var util=require(_0xf652('0x6'));var path=require(_0xf652('0x7'));var sox=require(_0xf652('0x8'));var csv=require(_0xf652('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf652('0xa'));var _=require(_0xf652('0xb'));var squel=require(_0xf652('0xc'));var crypto=require(_0xf652('0xd'));var jsforce=require(_0xf652('0xe'));var deskjs=require(_0xf652('0xf'));var toCsv=require(_0xf652('0x9'));var querystring=require(_0xf652('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf652('0x11'));var qs=require(_0xf652('0x12'));var as=require(_0xf652('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf652('0x14'))(_0xf652('0x15'));var utils=require(_0xf652('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xf652('0x17'))['db'];config['redis']=_[_0xf652('0x18')](config[_0xf652('0x19')],{'host':_0xf652('0x1a'),'port':0x18eb});var socket=require(_0xf652('0x1b'))(new Redis(config['redis']));require(_0xf652('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0xf652('0x1d')][_0xf652('0x1e')]({'port':0x232c});function respondWithRpcPromise(_0x3a6b00,_0x9465c3,_0x41d4a0,_0x1535bb){return new BPromise(function(_0x3bfb56,_0x18afe5){var _0x390a22=_0x1535bb||client;return _0x390a22[_0xf652('0x1f')](_0x3a6b00,_0x41d4a0)[_0xf652('0x20')](function(_0x51d214){logger[_0xf652('0x21')]('SmsAccount,\x20%s,\x20%s',_0x9465c3,_0xf652('0x22'));logger['debug'](_0xf652('0x23'),_0x9465c3,'request\x20sent',JSON[_0xf652('0x24')](_0x51d214));if(_0x51d214[_0xf652('0x25')]){if(_0x51d214['error']['code']===0x1f4){logger[_0xf652('0x25')](_0xf652('0x26'),_0x9465c3,_0x51d214[_0xf652('0x25')]['message']);return _0x18afe5(_0x51d214[_0xf652('0x25')][_0xf652('0x27')]);}logger[_0xf652('0x25')](_0xf652('0x26'),_0x9465c3,_0x51d214[_0xf652('0x25')][_0xf652('0x27')]);return _0x3bfb56(_0x51d214[_0xf652('0x25')][_0xf652('0x27')]);}else{logger[_0xf652('0x21')]('SmsAccount,\x20%s,\x20%s',_0x9465c3,'request\x20sent');_0x3bfb56(_0x51d214['result'][_0xf652('0x27')]);}})[_0xf652('0x28')](function(_0x4193ae){logger[_0xf652('0x25')]('SmsAccount,\x20%s,\x20%s',_0x9465c3,_0x4193ae);_0x18afe5(_0x4193ae);});});}function respondWithStatusCode(_0x3b6e2c,_0x404ce2){_0x404ce2=_0x404ce2||0xcc;return function(_0x16f650){if(_0x16f650){return _0x3b6e2c[_0xf652('0x29')](_0x404ce2);}return _0x3b6e2c[_0xf652('0x2a')](_0x404ce2)[_0xf652('0x2b')]();};}function respondWithResult(_0x29bd14,_0x125119){_0x125119=_0x125119||0xc8;return function(_0x3bcf5f){if(_0x3bcf5f){return _0x29bd14[_0xf652('0x2a')](_0x125119)['json'](_0x3bcf5f);}};}function respondWithFilteredResult(_0x174ce6,_0x2a7201){return function(_0x446660){if(_0x446660){var _0x2c06c9=typeof _0x2a7201[_0xf652('0x2c')]==='undefined'&&typeof _0x2a7201[_0xf652('0x2d')]===_0xf652('0x2e');var _0x4a4f37=_0x446660[_0xf652('0x2f')];var _0x14b7ce=_0x2c06c9?0x0:_0x2a7201[_0xf652('0x2c')];var _0x2d4881=_0x2c06c9?_0x446660[_0xf652('0x2f')]:_0x2a7201[_0xf652('0x2c')]+_0x2a7201[_0xf652('0x2d')];var _0x1efd5e;if(_0x2d4881>=_0x4a4f37){_0x2d4881=_0x4a4f37;_0x1efd5e=0xc8;}else{_0x1efd5e=0xce;}_0x174ce6['status'](_0x1efd5e);return _0x174ce6[_0xf652('0x30')](_0xf652('0x31'),_0x14b7ce+'-'+_0x2d4881+'/'+_0x4a4f37)['json'](_0x446660);}return null;};}function patchUpdates(_0x1d0962){return function(_0x3cd82e){try{jsonpatch[_0xf652('0x32')](_0x3cd82e,_0x1d0962,!![]);}catch(_0x53af55){return BPromise[_0xf652('0x33')](_0x53af55);}return _0x3cd82e[_0xf652('0x34')]();};}function saveUpdates(_0x930582,_0x37891d){return function(_0x46a893){if(_0x46a893){return _0x46a893[_0xf652('0x35')](_0x930582)[_0xf652('0x20')](function(_0x35cfc4){return _0x35cfc4;});}return null;};}function removeEntity(_0x61a6c4,_0x497403){return function(_0x398513){if(_0x398513){return _0x398513[_0xf652('0x36')]()[_0xf652('0x20')](function(){var _0xf53598=_0x398513[_0xf652('0x37')]({'plain':!![]});var _0xb289bc=_0xf652('0x38');return db[_0xf652('0x39')][_0xf652('0x36')]({'where':{'type':_0xb289bc,'resourceId':_0xf53598['id']}})['then'](function(){return _0x398513;});})[_0xf652('0x20')](function(){_0x61a6c4[_0xf652('0x2a')](0xcc)[_0xf652('0x2b')]();});}};}function handleEntityNotFound(_0x5c4b23,_0x39b017){return function(_0x125a11){if(!_0x125a11){_0x5c4b23[_0xf652('0x29')](0x194);}return _0x125a11;};}function handleError(_0x4264f2,_0x1e631f){_0x1e631f=_0x1e631f||0x1f4;return function(_0x3d88a9){logger[_0xf652('0x25')](_0x3d88a9[_0xf652('0x3a')]);if(_0x3d88a9[_0xf652('0x3b')]){delete _0x3d88a9[_0xf652('0x3b')];}_0x4264f2[_0xf652('0x2a')](_0x1e631f)[_0xf652('0x3c')](_0x3d88a9);};}exports[_0xf652('0x3d')]=function(_0x1e272d,_0x37f22c){var _0x773c1={'include':[{'model':db[_0xf652('0x3e')],'as':_0xf652('0x3f')}]},_0x5ab5cd={},_0x4b0512={'count':0x0,'rows':[]};var _0x42050c=_[_0xf652('0x40')](db[_0xf652('0x41')]['rawAttributes'],function(_0x695c4a){return{'name':_0x695c4a[_0xf652('0x42')],'type':_0x695c4a['type'][_0xf652('0x43')]};});_0x5ab5cd[_0xf652('0x44')]=_[_0xf652('0x40')](_0x42050c,_0xf652('0x3b'));_0x5ab5cd[_0xf652('0x45')]=_['keys'](_0x1e272d['query']);_0x5ab5cd[_0xf652('0x46')]=_[_0xf652('0x47')](_0x5ab5cd[_0xf652('0x44')],_0x5ab5cd['query']);_0x773c1[_0xf652('0x48')]=_[_0xf652('0x47')](_0x5ab5cd['model'],qs['fields'](_0x1e272d['query'][_0xf652('0x49')]));_0x773c1['attributes']=_0x773c1[_0xf652('0x48')][_0xf652('0x4a')]?_0x773c1[_0xf652('0x48')]:_0x5ab5cd['model'];if(!_0x1e272d[_0xf652('0x45')]['hasOwnProperty'](_0xf652('0x4b'))){_0x773c1[_0xf652('0x2d')]=qs[_0xf652('0x2d')](_0x1e272d[_0xf652('0x45')][_0xf652('0x2d')]);_0x773c1[_0xf652('0x2c')]=qs[_0xf652('0x2c')](_0x1e272d[_0xf652('0x45')][_0xf652('0x2c')]);}_0x773c1['order']=qs[_0xf652('0x4c')](_0x1e272d[_0xf652('0x45')][_0xf652('0x4c')]);_0x773c1['where']=qs['filters'](_['pick'](_0x1e272d[_0xf652('0x45')],_0x5ab5cd['filters']),_0x42050c);if(_0x1e272d['query'][_0xf652('0x4d')]){_0x773c1[_0xf652('0x4e')]=_['merge'](_0x773c1[_0xf652('0x4e')],{'$or':_[_0xf652('0x40')](_0x42050c,function(_0x5d2de7){if(_0x5d2de7[_0xf652('0x4f')]!==_0xf652('0x50')){var _0xfbfbb5={};_0xfbfbb5[_0x5d2de7[_0xf652('0x3b')]]={'$like':'%'+_0x1e272d[_0xf652('0x45')][_0xf652('0x4d')]+'%'};return _0xfbfbb5;}})});}_0x773c1=_[_0xf652('0x51')]({},_0x773c1,_0x1e272d['options']);var _0x564a8c={'where':_0x773c1[_0xf652('0x4e')]};return db[_0xf652('0x41')][_0xf652('0x2f')](_0x564a8c)[_0xf652('0x20')](function(_0x363f7b){_0x4b0512[_0xf652('0x2f')]=_0x363f7b;if(_0x1e272d[_0xf652('0x45')]['includeAll']){_0x773c1[_0xf652('0x52')]=[{'all':!![]}];}return db[_0xf652('0x41')]['findAll'](_0x773c1);})[_0xf652('0x20')](function(_0x408fee){_0x4b0512['rows']=_0x408fee;return _0x4b0512;})['then'](respondWithFilteredResult(_0x37f22c,_0x773c1))[_0xf652('0x28')](handleError(_0x37f22c,null));};exports[_0xf652('0x53')]=function(_0x1be00f,_0x58d642){var _0x42ad1b={'raw':![],'where':{'id':_0x1be00f[_0xf652('0x54')]['id']},'include':[{'model':db[_0xf652('0x3e')],'as':_0xf652('0x3f')}]},_0x47f06f={};_0x47f06f['model']=_[_0xf652('0x55')](db[_0xf652('0x41')][_0xf652('0x56')]);_0x47f06f[_0xf652('0x45')]=_[_0xf652('0x55')](_0x1be00f[_0xf652('0x45')]);_0x47f06f[_0xf652('0x46')]=_[_0xf652('0x47')](_0x47f06f[_0xf652('0x44')],_0x47f06f['query']);_0x42ad1b[_0xf652('0x48')]=_[_0xf652('0x47')](_0x47f06f[_0xf652('0x44')],qs['fields'](_0x1be00f[_0xf652('0x45')][_0xf652('0x49')]));_0x42ad1b['attributes']=_0x42ad1b[_0xf652('0x48')][_0xf652('0x4a')]?_0x42ad1b[_0xf652('0x48')]:_0x47f06f[_0xf652('0x44')];if(_0x1be00f['query'][_0xf652('0x57')]){_0x42ad1b[_0xf652('0x52')]=[{'all':!![]}];}_0x42ad1b=_[_0xf652('0x51')]({},_0x42ad1b,_0x1be00f[_0xf652('0x58')]);return db[_0xf652('0x41')][_0xf652('0x59')](_0x42ad1b)['then'](handleEntityNotFound(_0x58d642,null))['then'](respondWithResult(_0x58d642,null))[_0xf652('0x28')](handleError(_0x58d642,null));};exports[_0xf652('0x5a')]=function(_0x413444,_0xe542ec){return db[_0xf652('0x41')][_0xf652('0x5a')](_0x413444[_0xf652('0x5b')],{})[_0xf652('0x20')](function(_0x4b92b5){var _0x30e484=_0x413444[_0xf652('0x5c')][_0xf652('0x37')]({'plain':!![]});if(!_0x30e484)throw new Error(_0xf652('0x5d'));if(_0x30e484[_0xf652('0x5e')]==='user'){var _0x742ae3=_0x4b92b5[_0xf652('0x37')]({'plain':!![]});var _0x204f9f=_0xf652('0x38');return db[_0xf652('0x5f')][_0xf652('0x59')]({'where':{'name':_0x204f9f,'userProfileId':_0x30e484[_0xf652('0x60')]},'raw':!![]})['then'](function(_0x10acf8){if(_0x10acf8&&_0x10acf8[_0xf652('0x61')]===0x0){return db[_0xf652('0x39')][_0xf652('0x5a')]({'name':_0x742ae3[_0xf652('0x3b')],'resourceId':_0x742ae3['id'],'type':_0x10acf8[_0xf652('0x3b')],'sectionId':_0x10acf8['id']},{})[_0xf652('0x20')](function(){return _0x4b92b5;});}else{return _0x4b92b5;}})[_0xf652('0x28')](function(_0xe1d16c){logger[_0xf652('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xe1d16c);throw _0xe1d16c;});}return _0x4b92b5;})['then'](respondWithResult(_0xe542ec,0xc9))[_0xf652('0x28')](handleError(_0xe542ec,null));};exports[_0xf652('0x35')]=function(_0x2bf890,_0x6487a1){if(_0x2bf890[_0xf652('0x5b')]['id']){delete _0x2bf890[_0xf652('0x5b')]['id'];}return db[_0xf652('0x41')][_0xf652('0x59')]({'where':{'id':_0x2bf890[_0xf652('0x54')]['id']},'include':[{'model':db[_0xf652('0x3e')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x6487a1,null))[_0xf652('0x20')](saveUpdates(_0x2bf890[_0xf652('0x5b')],null))[_0xf652('0x20')](respondWithResult(_0x6487a1,null))[_0xf652('0x28')](handleError(_0x6487a1,null));};exports[_0xf652('0x36')]=function(_0x5a5863,_0x3482cb){return db[_0xf652('0x41')][_0xf652('0x59')]({'where':{'id':_0x5a5863[_0xf652('0x54')]['id']}})['then'](handleEntityNotFound(_0x3482cb,null))[_0xf652('0x20')](removeEntity(_0x3482cb,null))[_0xf652('0x28')](handleError(_0x3482cb,null));};exports[_0xf652('0x62')]=function(_0x599beb,_0xaf4443){return db[_0xf652('0x41')][_0xf652('0x62')]()[_0xf652('0x20')](respondWithResult(_0xaf4443,null))[_0xf652('0x28')](handleError(_0xaf4443,null));};exports[_0xf652('0x63')]=function(_0x21313f,_0x3693a6,_0x3877f2){if(_0x21313f[_0xf652('0x5b')]['id']){delete _0x21313f['body']['id'];}return db[_0xf652('0x41')][_0xf652('0x59')]({'where':{'id':_0x21313f[_0xf652('0x54')]['id']}})[_0xf652('0x20')](handleEntityNotFound(_0x3693a6,null))[_0xf652('0x20')](function(_0x2fb947){if(_0x2fb947){_0x21313f[_0xf652('0x5b')][_0xf652('0x64')]=_0x2fb947['id'];return db[_0xf652('0x65')][_0xf652('0x5a')](_0x21313f[_0xf652('0x5b')]);}})['then'](respondWithResult(_0x3693a6,null))[_0xf652('0x28')](handleError(_0x3693a6,null));};exports[_0xf652('0x66')]=function(_0x2f8a83,_0x25bb85,_0x2ae2e8){var _0x9cd01c={'raw':![],'where':{}};var _0x1eed4f={};var _0x4da976={'count':0x0,'rows':[]};return db[_0xf652('0x41')][_0xf652('0x67')]({'where':{'id':_0x2f8a83['params']['id']}})[_0xf652('0x20')](handleEntityNotFound(_0x25bb85,null))['then'](function(_0xd67ab3){if(_0xd67ab3){_0x1eed4f[_0xf652('0x44')]=_[_0xf652('0x55')](db[_0xf652('0x65')][_0xf652('0x56')]);_0x1eed4f['query']=_['keys'](_0x2f8a83[_0xf652('0x45')]);_0x1eed4f['filters']=_[_0xf652('0x47')](_0x1eed4f[_0xf652('0x44')],_0x1eed4f[_0xf652('0x45')]);_0x9cd01c[_0xf652('0x48')]=_[_0xf652('0x47')](_0x1eed4f['model'],qs[_0xf652('0x49')](_0x2f8a83[_0xf652('0x45')]['fields']));_0x9cd01c[_0xf652('0x48')]=_0x9cd01c[_0xf652('0x48')][_0xf652('0x4a')]?_0x9cd01c['attributes']:_0x1eed4f[_0xf652('0x44')];if(!_0x2f8a83[_0xf652('0x45')][_0xf652('0x68')](_0xf652('0x4b'))){_0x9cd01c[_0xf652('0x2d')]=qs[_0xf652('0x2d')](_0x2f8a83[_0xf652('0x45')][_0xf652('0x2d')]);_0x9cd01c['offset']=qs[_0xf652('0x2c')](_0x2f8a83['query'][_0xf652('0x2c')]);}_0x9cd01c[_0xf652('0x69')]=qs[_0xf652('0x4c')](_0x2f8a83['query']['sort']);_0x9cd01c[_0xf652('0x4e')]=qs[_0xf652('0x46')](_[_0xf652('0x6a')](_0x2f8a83[_0xf652('0x45')],_0x1eed4f[_0xf652('0x46')]));_0x9cd01c[_0xf652('0x4e')][_0xf652('0x64')]=_0xd67ab3['id'];if(_0x2f8a83[_0xf652('0x45')][_0xf652('0x4d')]){_0x9cd01c[_0xf652('0x4e')]=_[_0xf652('0x51')](_0x9cd01c['where'],{'$or':_[_0xf652('0x40')](_0x9cd01c['attributes'],function(_0x568a7a){var _0x1f1fa4={};_0x1f1fa4[_0x568a7a]={'$like':'%'+_0x2f8a83[_0xf652('0x45')][_0xf652('0x4d')]+'%'};return _0x1f1fa4;})});}_0x9cd01c=_[_0xf652('0x51')]({},_0x9cd01c,_0x2f8a83['options']);return db[_0xf652('0x65')][_0xf652('0x2f')]({'where':_0x9cd01c['where']})['then'](function(_0x263d2e){_0x4da976[_0xf652('0x2f')]=_0x263d2e;if(_0x2f8a83['query']['includeAll']){_0x9cd01c[_0xf652('0x52')]=[{'all':!![]}];}return db[_0xf652('0x65')][_0xf652('0x6b')](_0x9cd01c);})[_0xf652('0x20')](function(_0x222796){_0x4da976[_0xf652('0x6c')]=_0x222796;return _0x4da976;});}})[_0xf652('0x20')](respondWithFilteredResult(_0x25bb85,_0x9cd01c))[_0xf652('0x28')](handleError(_0x25bb85,null));};exports['removeDispositions']=function(_0x29b61c,_0x22cc29,_0x14234d){return db[_0xf652('0x41')][_0xf652('0x59')]({'where':{'id':_0x29b61c[_0xf652('0x54')]['id']}})[_0xf652('0x20')](handleEntityNotFound(_0x22cc29,null))[_0xf652('0x20')](function(_0x1a7707){if(_0x1a7707){return _0x1a7707['removeDispositions'](_0x29b61c[_0xf652('0x45')][_0xf652('0x6d')]);}})['then'](respondWithStatusCode(_0x22cc29,null))['catch'](handleError(_0x22cc29,null));};exports['addAnswer']=function(_0x17430c,_0x53ea75,_0x450312){if(_0x17430c['body']['id']){delete _0x17430c[_0xf652('0x5b')]['id'];}return db[_0xf652('0x41')][_0xf652('0x59')]({'where':{'id':_0x17430c['params']['id']}})['then'](handleEntityNotFound(_0x53ea75,null))[_0xf652('0x20')](function(_0x13063c){if(_0x13063c){_0x17430c[_0xf652('0x5b')]['SmsAccountId']=_0x13063c['id'];return db[_0xf652('0x6e')][_0xf652('0x5a')](_0x17430c[_0xf652('0x5b')]);}})[_0xf652('0x20')](respondWithResult(_0x53ea75,null))[_0xf652('0x28')](handleError(_0x53ea75,null));};exports['getAnswers']=function(_0x14ee61,_0xd99051,_0x203573){var _0x772075={'raw':![],'where':{}};var _0x362b3f={};var _0x507efd={'count':0x0,'rows':[]};return db[_0xf652('0x41')]['findOne']({'where':{'id':_0x14ee61['params']['id']}})[_0xf652('0x20')](handleEntityNotFound(_0xd99051,null))[_0xf652('0x20')](function(_0x1b4f48){if(_0x1b4f48){_0x362b3f[_0xf652('0x44')]=_[_0xf652('0x55')](db[_0xf652('0x6e')][_0xf652('0x56')]);_0x362b3f[_0xf652('0x45')]=_[_0xf652('0x55')](_0x14ee61[_0xf652('0x45')]);_0x362b3f[_0xf652('0x46')]=_[_0xf652('0x47')](_0x362b3f[_0xf652('0x44')],_0x362b3f[_0xf652('0x45')]);_0x772075[_0xf652('0x48')]=_[_0xf652('0x47')](_0x362b3f[_0xf652('0x44')],qs['fields'](_0x14ee61[_0xf652('0x45')][_0xf652('0x49')]));_0x772075[_0xf652('0x48')]=_0x772075[_0xf652('0x48')]['length']?_0x772075[_0xf652('0x48')]:_0x362b3f[_0xf652('0x44')];if(!_0x14ee61[_0xf652('0x45')][_0xf652('0x68')](_0xf652('0x4b'))){_0x772075[_0xf652('0x2d')]=qs[_0xf652('0x2d')](_0x14ee61[_0xf652('0x45')][_0xf652('0x2d')]);_0x772075[_0xf652('0x2c')]=qs[_0xf652('0x2c')](_0x14ee61['query'][_0xf652('0x2c')]);}_0x772075[_0xf652('0x69')]=qs[_0xf652('0x4c')](_0x14ee61[_0xf652('0x45')][_0xf652('0x4c')]);_0x772075[_0xf652('0x4e')]=qs[_0xf652('0x46')](_[_0xf652('0x6a')](_0x14ee61['query'],_0x362b3f[_0xf652('0x46')]));_0x772075[_0xf652('0x4e')][_0xf652('0x64')]=_0x1b4f48['id'];if(_0x14ee61['query'][_0xf652('0x4d')]){_0x772075['where']=_[_0xf652('0x51')](_0x772075[_0xf652('0x4e')],{'$or':_[_0xf652('0x40')](_0x772075[_0xf652('0x48')],function(_0x27359e){var _0x1493e6={};_0x1493e6[_0x27359e]={'$like':'%'+_0x14ee61[_0xf652('0x45')][_0xf652('0x4d')]+'%'};return _0x1493e6;})});}_0x772075=_[_0xf652('0x51')]({},_0x772075,_0x14ee61[_0xf652('0x58')]);return db[_0xf652('0x6e')][_0xf652('0x2f')]({'where':_0x772075[_0xf652('0x4e')]})[_0xf652('0x20')](function(_0x58c01a){_0x507efd[_0xf652('0x2f')]=_0x58c01a;if(_0x14ee61[_0xf652('0x45')][_0xf652('0x57')]){_0x772075[_0xf652('0x52')]=[{'all':!![]}];}return db[_0xf652('0x6e')]['findAll'](_0x772075);})[_0xf652('0x20')](function(_0x394b47){_0x507efd['rows']=_0x394b47;return _0x507efd;});}})['then'](respondWithFilteredResult(_0xd99051,_0x772075))[_0xf652('0x28')](handleError(_0xd99051,null));};exports['removeAnswers']=function(_0x4ad1ed,_0x31301e,_0x3d2188){return db['SmsAccount'][_0xf652('0x59')]({'where':{'id':_0x4ad1ed[_0xf652('0x54')]['id']}})[_0xf652('0x20')](handleEntityNotFound(_0x31301e,null))['then'](function(_0x2aea75){if(_0x2aea75){return _0x2aea75[_0xf652('0x6f')](_0x4ad1ed[_0xf652('0x45')][_0xf652('0x6d')]);}})[_0xf652('0x20')](respondWithStatusCode(_0x31301e,null))['catch'](handleError(_0x31301e,null));};exports['notify']=function(_0x1f0071,_0xb23822,_0x292ff1){var _0x288f2a={'channel':'sms'};var _0x3555f1=[];var _0x5aa30f=[];var _0x550b08={};return db[_0xf652('0x41')][_0xf652('0x59')]({'where':{'id':_0x1f0071[_0xf652('0x54')]['id']},'include':[{'model':db[_0xf652('0x70')],'as':_0xf652('0x71')}]})[_0xf652('0x20')](handleEntityNotFound(_0xb23822,null))[_0xf652('0x20')](function(_0x3c51f2){_0x288f2a['account']=_0x3c51f2;_0x288f2a[_0xf652('0x72')]=_[_0xf652('0x73')](_0x3c51f2['Applications'],[_0xf652('0x74')],[_0xf652('0x75')]);if(_0x288f2a[_0xf652('0x76')][_0xf652('0x71')]){delete _0x288f2a[_0xf652('0x76')][_0xf652('0x71')];}return db[_0xf652('0x77')][_0xf652('0x62')]();})['then'](function(_0x58b9c2){if(!_0x58b9c2){throw new db[(_0xf652('0x78'))][(_0xf652('0x79'))](_0xf652('0x7a'));}_0x3555f1=_[_0xf652('0x7b')](_[_0xf652('0x55')](_0x58b9c2),[_0xf652('0x7c'),'updatedAt']);_0x5aa30f=_[_0xf652('0x7b')](_[_0xf652('0x55')](_0x58b9c2),[_0xf652('0x7c'),'updatedAt',_0xf652('0x7d'),_0xf652('0x7e')]);_0x288f2a[_0xf652('0x5b')]={'mapKey':_0xf652('0x7f')};if(_0x288f2a[_0xf652('0x76')][_0xf652('0x4f')]){switch(_0x288f2a[_0xf652('0x76')]['type']){case _0xf652('0x80'):_0x288f2a[_0xf652('0x5b')][_0xf652('0x81')]=_0x1f0071[_0xf652('0x5b')][_0xf652('0x82')];_0x288f2a[_0xf652('0x5b')][_0xf652('0x5b')]=_0x1f0071[_0xf652('0x5b')][_0xf652('0x83')];_0x288f2a['body'][_0xf652('0x84')]=_0x1f0071['body']['MessageSid'];break;case _0xf652('0x85'):_0x288f2a['body'][_0xf652('0x81')]='+'+_0x1f0071[_0xf652('0x5b')][_0xf652('0x86')];_0x288f2a[_0xf652('0x5b')][_0xf652('0x5b')]=_0x1f0071[_0xf652('0x5b')][_0xf652('0x87')];break;case _0xf652('0x88'):_0x288f2a[_0xf652('0x5b')][_0xf652('0x81')]=_0x1f0071['body'][_0xf652('0x81')];_0x288f2a[_0xf652('0x5b')][_0xf652('0x5b')]=_0x1f0071[_0xf652('0x5b')][_0xf652('0x27')];break;case'clicksend':_0x288f2a['body'][_0xf652('0x81')]=_0x1f0071[_0xf652('0x5b')][_0xf652('0x81')];_0x288f2a[_0xf652('0x5b')]['body']=_0x1f0071['body'][_0xf652('0x5b')];_0x288f2a[_0xf652('0x5b')]['messageId']=_0x1f0071['body'][_0xf652('0x89')];break;case _0xf652('0x8a'):_0x288f2a['body'][_0xf652('0x81')]=_0x1f0071[_0xf652('0x5b')][_0xf652('0x82')];_0x288f2a[_0xf652('0x5b')][_0xf652('0x5b')]=_0x1f0071[_0xf652('0x5b')]['Text'];_0x288f2a[_0xf652('0x5b')][_0xf652('0x84')]=_0x1f0071[_0xf652('0x5b')][_0xf652('0x8b')];break;case _0xf652('0x8c'):_0x288f2a['body'][_0xf652('0x81')]='+'+_0x1f0071[_0xf652('0x5b')][_0xf652('0x8d')][0x0][_0xf652('0x81')];_0x288f2a[_0xf652('0x5b')][_0xf652('0x5b')]=_0x1f0071['body'][_0xf652('0x8d')][0x0][_0xf652('0x87')];_0x288f2a['body'][_0xf652('0x84')]=_0x1f0071[_0xf652('0x5b')]['results'][0x0][_0xf652('0x84')];break;case _0xf652('0x8e'):_0x288f2a[_0xf652('0x5b')][_0xf652('0x81')]=_0x1f0071[_0xf652('0x5b')][_0xf652('0x8f')];_0x288f2a['body'][_0xf652('0x5b')]=_0x1f0071[_0xf652('0x5b')]['segmentedMessage']['message'];break;case _0xf652('0x90'):_0x288f2a['body'][_0xf652('0x81')]=_0x1f0071[_0xf652('0x5b')]['fromNumber'];_0x288f2a[_0xf652('0x5b')][_0xf652('0x5b')]=_0x1f0071[_0xf652('0x5b')][_0xf652('0x87')];_0x288f2a[_0xf652('0x5b')][_0xf652('0x84')]=_0x1f0071[_0xf652('0x5b')][_0xf652('0x91')];break;case _0xf652('0x92'):_0x288f2a[_0xf652('0x5b')]['messageId']=_0x1f0071[_0xf652('0x5b')][0x0][_0xf652('0x27')]['id'];_0x288f2a[_0xf652('0x5b')][_0xf652('0x81')]=_0x1f0071[_0xf652('0x5b')][0x0][_0xf652('0x27')]['from'];_0x288f2a[_0xf652('0x5b')][_0xf652('0x5b')]=_0x1f0071[_0xf652('0x5b')][0x0]['message'][_0xf652('0x87')];break;case'intelepeer':_0x288f2a['body']['from']=_0x1f0071[_0xf652('0x5b')][_0xf652('0x81')];_0x288f2a['body'][_0xf652('0x5b')]=_0x1f0071['body'][_0xf652('0x27')];_0x288f2a[_0xf652('0x5b')][_0xf652('0x84')]=_0x1f0071[_0xf652('0x5b')][_0xf652('0x93')];break;}}if(_0x288f2a[_0xf652('0x5b')]['id']){delete _0x288f2a[_0xf652('0x5b')]['id'];}if(_[_0xf652('0x94')](_0x288f2a['body'][_0xf652('0x81')])){throw new db[(_0xf652('0x78'))][(_0xf652('0x79'))](_0xf652('0x95'));}if(_[_0xf652('0x94')](_0x288f2a[_0xf652('0x5b')][_0xf652('0x5b')])||_0x288f2a[_0xf652('0x5b')][_0xf652('0x5b')]===''){throw new db[(_0xf652('0x78'))][(_0xf652('0x79'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf652('0x94')](_0x288f2a[_0xf652('0x5b')]['mapKey'])){throw new db['Sequelize'][(_0xf652('0x79'))](_0xf652('0x96')+_0x5aa30f);}if(!_[_0xf652('0x97')](_0x5aa30f,_0x288f2a[_0xf652('0x5b')][_0xf652('0x98')])){throw new db['Sequelize']['ValidationError'](_0xf652('0x99')+_0x5aa30f);}_0x550b08[_0x288f2a[_0xf652('0x5b')]['mapKey']]=_0x288f2a[_0xf652('0x5b')][_0xf652('0x81')];return db[_0xf652('0x9a')]['find']({'where':{'id':_0x288f2a[_0xf652('0x76')][_0xf652('0x7e')]},'include':[{'model':db[_0xf652('0x77')],'as':_0xf652('0x9b'),'where':_0x550b08,'limit':0x1,'order':[[_0xf652('0x9c'),_0xf652('0x9d')]]}]});})[_0xf652('0x20')](handleEntityNotFound(_0xb23822,null))[_0xf652('0x20')](function(_0x3f0e7d){if(_0x3f0e7d){_0x288f2a['list']=_[_0xf652('0x9e')](_0x3f0e7d,[_0xf652('0x9b')]);if(_0x3f0e7d[_0xf652('0x9b')][_0xf652('0x4a')]){return _0x3f0e7d[_0xf652('0x9b')][0x0];}var _0x24b160=_[_0xf652('0x18')](_0x288f2a[_0xf652('0x5b')],{'firstName':_0x288f2a[_0xf652('0x5b')][_0xf652('0x81')],'ListId':_0x3f0e7d['id']});_0x24b160[_0x288f2a[_0xf652('0x5b')][_0xf652('0x98')]]=_0x288f2a[_0xf652('0x5b')][_0xf652('0x81')];return db[_0xf652('0x77')][_0xf652('0x5a')](_0x24b160,{'fields':_0x3555f1,'raw':!![]});}})[_0xf652('0x20')](handleEntityNotFound(_0xb23822,null))[_0xf652('0x20')](function(_0x442bd9){if(_0x442bd9){_0x288f2a['contact']=_0x442bd9;var _0x50ea52={'ContactId':_0x442bd9['id'],'phone':_0x288f2a[_0xf652('0x5b')][_0xf652('0x81')],'SmsAccountId':_0x1f0071[_0xf652('0x54')]['id']};var _0x5a2546={'ContactId':_0x442bd9['id'],'SmsAccountId':_0x1f0071[_0xf652('0x54')]['id'],'closed':![]};return db['SmsInteraction'][_0xf652('0x59')]({'where':_0x5a2546})[_0xf652('0x20')](function(_0x18eefc){if(_0x18eefc){return[_0x18eefc,![]];}return db[_0xf652('0x9f')][_0xf652('0x5a')](_0x50ea52)['then'](function(_0x1ceb6d){return[_0x1ceb6d,!![]];});});}})[_0xf652('0xa0')](function(_0x23466c,_0x1f90a5){_0x288f2a[_0xf652('0xa1')]=_0x23466c[_0xf652('0x37')]({'plain':!![]});_0x288f2a[_0xf652('0xa1')]['created']=![];if(_0x1f90a5){if(_0x288f2a[_0xf652('0x76')][_0xf652('0xa2')]){_0x288f2a['applications'][_0xf652('0xa3')]({'id':0x0,'priority':_0x288f2a[_0xf652('0x72')]['length']+0x1,'app':_0xf652('0xa4'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x288f2a[_0xf652('0xa1')][_0xf652('0xa5')]=!![];}return db[_0xf652('0xa6')][_0xf652('0x5a')]({'phone':_0x288f2a[_0xf652('0x5b')]['from'],'messageId':_0x288f2a[_0xf652('0x5b')]['messageId'],'body':_0x288f2a[_0xf652('0x5b')][_0xf652('0x5b')],'SmsAccountId':_0x1f0071[_0xf652('0x54')]['id'],'SmsInteractionId':_0x23466c['id'],'direction':'in','ContactId':_0x23466c[_0xf652('0xa7')],'AttachmentId':_0x288f2a[_0xf652('0x5b')][_0xf652('0xa8')]});})[_0xf652('0x20')](function(_0x2d007c){_0x288f2a[_0xf652('0x27')]=_0x2d007c;if(_0x288f2a['interaction']['UserId']){return db['User']['find']({'attributes':['id',_0xf652('0x3b')],'where':{'id':_0x288f2a['interaction'][_0xf652('0xa9')]}})[_0xf652('0x20')](function(_0xe9fdf5){if(_0xe9fdf5){_0x288f2a[_0xf652('0x72')]['unshift']({'id':0x0,'priority':0x0,'app':_0xf652('0xaa'),'appdata':_0xe9fdf5[_0xf652('0x3b')]+','+(_0x288f2a[_0xf652('0x76')][_0xf652('0xab')]||0xa),'interval':_0xf652('0xac')});}return respondWithRpcPromise(_0xf652('0xad'),_0xf652('0xae'),_0x288f2a);});}return respondWithRpcPromise(_0xf652('0xad'),_0xf652('0xae'),_0x288f2a);})[_0xf652('0x20')](function(_0xb826d3){if(_0xb826d3){var _0x38486c=0xc8;var _0xebb768=_0xf652('0xaf');logger['info'](_0xf652('0x23'),_0xebb768,_0x38486c,_0xf652('0xb0'));logger[_0xf652('0xb1')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0xebb768,_0x38486c,'entity\x20found',JSON[_0xf652('0x24')](_0xb826d3));if(_0x288f2a[_0xf652('0x76')][_0xf652('0x4f')]===_0xf652('0x80')){return _0xb23822['status'](_0x38486c)[_0xf652('0x30')](_0xf652('0xb2'),_0xf652('0xb3'))[_0xf652('0x3c')](_0xf652('0xb4'));}else{return _0xb23822['status'](_0x38486c)[_0xf652('0xb5')](_0xb826d3);}}})[_0xf652('0x28')](handleError(_0xb23822,null));};exports[_0xf652('0xb6')]=function(_0x45e114,_0x1dde17,_0x4151af){return db[_0xf652('0x41')][_0xf652('0x67')]({'where':{'id':_0x45e114['params']['id']}})[_0xf652('0x20')](handleEntityNotFound(_0x1dde17,null))[_0xf652('0x20')](function(_0x101335){if(_0x101335){return db['sequelize'][_0xf652('0xb7')](function(_0x2a6686){return db['SmsApplication']['destroy']({'where':{'SmsAccountId':_0x45e114[_0xf652('0x54')]['id']},'transaction':_0x2a6686})[_0xf652('0x20')](function(_0x335e49){var _0x16fb63=_['map'](_0x45e114[_0xf652('0x5b')],function(_0x4a9d5d){_0x4a9d5d['SmsAccountId']=_0x45e114[_0xf652('0x54')]['id'];return _0x4a9d5d;});return db[_0xf652('0x70')]['bulkCreate'](_0x16fb63,{'transaction':_0x2a6686});});})['then'](function(){return db[_0xf652('0x70')]['findAndCountAll']({'where':{'SmsAccountId':_0x45e114['params']['id']},'order':_0xf652('0x74')});});}})[_0xf652('0x20')](respondWithResult(_0x1dde17,null))[_0xf652('0x28')](handleError(_0x1dde17,null));};exports[_0xf652('0xb8')]=function(_0xa3d32c,_0x45da90,_0x51ea97){var _0x3d3f91={};var _0x3797bc={};var _0x33469a;var _0x11116c;return db['SmsAccount']['findOne']({'where':{'id':_0xa3d32c[_0xf652('0x54')]['id']}})[_0xf652('0x20')](handleEntityNotFound(_0x45da90,null))['then'](function(_0x2e85d5){if(_0x2e85d5){_0x33469a=_0x2e85d5;_0x3797bc[_0xf652('0x44')]=_[_0xf652('0x55')](db['SmsApplication'][_0xf652('0x56')]);_0x3797bc[_0xf652('0x45')]=_[_0xf652('0x55')](_0xa3d32c['query']);_0x3797bc[_0xf652('0x46')]=_[_0xf652('0x47')](_0x3797bc[_0xf652('0x44')],_0x3797bc['query']);_0x3d3f91[_0xf652('0x48')]=_[_0xf652('0x47')](_0x3797bc[_0xf652('0x44')],qs[_0xf652('0x49')](_0xa3d32c['query'][_0xf652('0x49')]));_0x3d3f91[_0xf652('0x48')]=_0x3d3f91[_0xf652('0x48')][_0xf652('0x4a')]?_0x3d3f91[_0xf652('0x48')]:_0x3797bc[_0xf652('0x44')];_0x3d3f91[_0xf652('0x69')]=qs[_0xf652('0x4c')](_0xa3d32c[_0xf652('0x45')][_0xf652('0x4c')]);_0x3d3f91[_0xf652('0x4e')]=qs[_0xf652('0x46')](_['pick'](_0xa3d32c[_0xf652('0x45')],_0x3797bc['filters']));if(_0xa3d32c[_0xf652('0x45')][_0xf652('0x4d')]){_0x3d3f91[_0xf652('0x4e')]=_[_0xf652('0x51')](_0x3d3f91[_0xf652('0x4e')],{'$or':_['map'](_0x3d3f91[_0xf652('0x48')],function(_0x579657){var _0x466106={};_0x466106[_0x579657]={'$like':'%'+_0xa3d32c['query'][_0xf652('0x4d')]+'%'};return _0x466106;})});}_0x3d3f91=_[_0xf652('0x51')]({},_0x3d3f91,_0xa3d32c[_0xf652('0x58')]);return _0x33469a[_0xf652('0xb8')](_0x3d3f91);}})[_0xf652('0x20')](function(_0x594eca){if(_0x594eca){_0x11116c=_0x594eca[_0xf652('0x4a')];if(!_0xa3d32c['query'][_0xf652('0x68')](_0xf652('0x4b'))){_0x3d3f91[_0xf652('0x2d')]=qs['limit'](_0xa3d32c['query'][_0xf652('0x2d')]);_0x3d3f91[_0xf652('0x2c')]=qs[_0xf652('0x2c')](_0xa3d32c['query'][_0xf652('0x2c')]);}return _0x33469a[_0xf652('0xb8')](_0x3d3f91);}})[_0xf652('0x20')](function(_0x34dfb0){if(_0x34dfb0){return _0x34dfb0?{'count':_0x11116c,'rows':_0x34dfb0}:null;}})[_0xf652('0x20')](respondWithResult(_0x45da90,null))[_0xf652('0x28')](handleError(_0x45da90,null));};exports[_0xf652('0xb9')]=function(_0x52c5a2,_0x2f34e6,_0x2c2a50){var _0x3789da={'raw':![],'where':{}};var _0x2b7d85={};var _0x1ad058={'count':0x0,'rows':[]};return db[_0xf652('0x41')]['findOne']({'where':{'id':_0x52c5a2[_0xf652('0x54')]['id']}})['then'](handleEntityNotFound(_0x2f34e6,null))[_0xf652('0x20')](function(_0x547073){if(_0x547073){_0x2b7d85[_0xf652('0x44')]=_['keys'](db[_0xf652('0x9f')][_0xf652('0x56')]);_0x2b7d85[_0xf652('0x45')]=_['keys'](_0x52c5a2[_0xf652('0x45')]);_0x2b7d85[_0xf652('0x46')]=_[_0xf652('0x47')](_0x2b7d85[_0xf652('0x44')],_0x2b7d85['query']);_0x3789da[_0xf652('0x48')]=_['intersection'](_0x2b7d85['model'],qs[_0xf652('0x49')](_0x52c5a2[_0xf652('0x45')][_0xf652('0x49')]));_0x3789da['attributes']=_0x3789da[_0xf652('0x48')][_0xf652('0x4a')]?_0x3789da['attributes']:_0x2b7d85[_0xf652('0x44')];if(!_0x52c5a2[_0xf652('0x45')]['hasOwnProperty']('nolimit')){_0x3789da[_0xf652('0x2d')]=qs['limit'](_0x52c5a2[_0xf652('0x45')][_0xf652('0x2d')]);_0x3789da[_0xf652('0x2c')]=qs[_0xf652('0x2c')](_0x52c5a2[_0xf652('0x45')][_0xf652('0x2c')]);}_0x3789da[_0xf652('0x69')]=qs[_0xf652('0x4c')](_0x52c5a2[_0xf652('0x45')][_0xf652('0x4c')]);_0x3789da[_0xf652('0x4e')]=qs[_0xf652('0x46')](_[_0xf652('0x6a')](_0x52c5a2[_0xf652('0x45')],_0x2b7d85[_0xf652('0x46')]));_0x3789da[_0xf652('0x4e')][_0xf652('0x64')]=_0x547073['id'];if(_0x52c5a2[_0xf652('0x45')]['filter']){_0x3789da[_0xf652('0x4e')]=_[_0xf652('0x51')](_0x3789da[_0xf652('0x4e')],{'$or':_[_0xf652('0x40')](_0x3789da[_0xf652('0x48')],function(_0x27cfc8){var _0x19df9a={};_0x19df9a[_0x27cfc8]={'$like':'%'+_0x52c5a2[_0xf652('0x45')][_0xf652('0x4d')]+'%'};return _0x19df9a;})});}_0x3789da=_[_0xf652('0x51')]({},_0x3789da,_0x52c5a2[_0xf652('0x58')]);return db[_0xf652('0x9f')][_0xf652('0x2f')]({'where':_0x3789da['where']})[_0xf652('0x20')](function(_0x306944){_0x1ad058[_0xf652('0x2f')]=_0x306944;if(_0x52c5a2[_0xf652('0x45')][_0xf652('0x57')]){_0x3789da[_0xf652('0x52')]=[{'model':db[_0xf652('0x77')],'as':'Contact','required':![]},{'model':db[_0xf652('0xba')],'as':_0xf652('0xbb'),'attributes':[_0xf652('0x3b'),_0xf652('0xbc'),_0xf652('0xbd')],'required':![]},{'model':db['Tag'],'as':_0xf652('0xbe'),'attributes':['id',_0xf652('0x3b'),_0xf652('0xbf')],'where':_0x52c5a2[_0xf652('0x45')][_0xf652('0xc0')]?{'id':_0x52c5a2['query'][_0xf652('0xc0')]}:undefined,'required':_0x52c5a2[_0xf652('0x45')]['tag']?!![]:![]}];}return db['SmsInteraction'][_0xf652('0x6b')](_0x3789da);})['then'](function(_0x44c26f){_0x1ad058[_0xf652('0x6c')]=_0x44c26f;return _0x1ad058;});}})['then'](respondWithFilteredResult(_0x2f34e6,_0x3789da))[_0xf652('0x28')](handleError(_0x2f34e6,null));};exports[_0xf652('0x3c')]=function(_0x4b25d7,_0x3896af,_0x36edce){var _0x43fed3,_0x4832f3,_0xef4b80;if(_[_0xf652('0x94')](_0x4b25d7[_0xf652('0x5b')]['body'])||_0x4b25d7[_0xf652('0x5b')]['body']===''){throw new db[(_0xf652('0x78'))][(_0xf652('0x79'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf652('0x94')](_0x4b25d7['body']['to'])){throw new db[(_0xf652('0x78'))][(_0xf652('0x79'))]('to\x20is\x20mandatory');}_0x43fed3=_0x4b25d7[_0xf652('0x5b')]['to'];return db[_0xf652('0x41')][_0xf652('0x59')]({'where':{'id':_0x4b25d7[_0xf652('0x54')]['id']},'include':[{'model':db[_0xf652('0x9a')],'as':_0xf652('0xc1'),'include':[{'model':db[_0xf652('0x77')],'as':_0xf652('0x9b'),'where':{'mobile':_0x43fed3},'limit':0x1,'order':[['updatedAt',_0xf652('0x9d')]]}]}]})[_0xf652('0x20')](handleEntityNotFound(_0x3896af,null))[_0xf652('0x20')](function(_0x68c4ee){if(_0x68c4ee&&_0x68c4ee[_0xf652('0xc1')]){_0x4832f3=_0x68c4ee[_0xf652('0x37')]({'plain':!![]});if(_0x4832f3['List']&&_0x4832f3['List'][_0xf652('0x9b')]['length']){return _0x4832f3[_0xf652('0xc1')][_0xf652('0x9b')][0x0];}return db['CmContact'][_0xf652('0x5a')](_['defaults'](_0x4b25d7['body'],{'firstName':_0x43fed3,'mobile':_0x43fed3,'phone':_0x43fed3,'ListId':_0x4832f3[_0xf652('0x7e')]}));}})['then'](handleEntityNotFound(_0x3896af,null))[_0xf652('0x20')](function(_0x5de004){if(_0x5de004){_0xef4b80=_0x5de004;return db[_0xf652('0x9f')][_0xf652('0x59')]({'where':{'ContactId':_0xef4b80['id'],'closed':![],'SmsAccountId':_0x4832f3['id']}})['then'](function(_0x278476){if(_0x278476){return[_0x278476,![]];}return db[_0xf652('0x9f')]['create']({'UserId':_0x4b25d7[_0xf652('0x5c')]['id'],'ContactId':_0xef4b80['id'],'SmsAccountId':_0x4832f3['id'],'phone':_0x43fed3,'firstMsgDirection':'out','Messages':[_['merge'](_0x4b25d7[_0xf652('0x5b')],{'read':![],'body':_0x4b25d7[_0xf652('0x5b')][_0xf652('0x5b')],'phone':_0x43fed3,'SmsAccountId':_0x4832f3['id'],'UserId':_0x4b25d7[_0xf652('0x5c')]['id'],'ContactId':_0xef4b80['id']})]},{'include':[{'model':db[_0xf652('0xa6')],'as':_0xf652('0xc2')}]})[_0xf652('0x20')](function(_0x1f4fbc){return[_0x1f4fbc,!![]];});});}})[_0xf652('0xa0')](function(_0x4fc023,_0x81a1b3){if(_0x81a1b3){return _0x4fc023;}return db['SmsMessage']['create'](_['merge'](_0x4b25d7[_0xf652('0x5b')],{'read':![],'body':_0x4b25d7['body'][_0xf652('0x5b')],'phone':_0x43fed3,'SmsAccountId':_0x4832f3['id'],'SmsInteractionId':_0x4fc023['id'],'UserId':_0x4b25d7[_0xf652('0x5c')]['id'],'ContactId':_0xef4b80['id']}))[_0xf652('0x20')](function(_0x5ec18b){_0x4fc023[_0xf652('0xc3')][_0xf652('0xc2')]=[];_0x4fc023[_0xf652('0xc3')]['Messages']['push'](_0x5ec18b[_0xf652('0xc3')]);return _0x4fc023;});})[_0xf652('0x20')](respondWithResult(_0x3896af,null))[_0xf652('0x28')](handleError(_0x3896af,null));};exports[_0xf652('0x2a')]=function(_0x4802c0,_0x2be6f8,_0x1ac163){if(_0x4802c0[_0xf652('0x5b')]['id']){delete _0x4802c0[_0xf652('0x5b')]['id'];}var _0x2b4f05,_0x3d4481,_0x2864bd;return db[_0xf652('0x41')][_0xf652('0x59')]({'where':{'id':_0x4802c0['params']['id']}})[_0xf652('0x20')](handleEntityNotFound(_0x2be6f8,null))[_0xf652('0x20')](function(_0x133b90){if(_0x133b90){_0x2864bd=_0x133b90;logger[_0xf652('0xb1')](_0xf652('0x23'),'status',_0xf652('0xc4'),_0x133b90[_0xf652('0x4f')],util[_0xf652('0xc5')](_0x4802c0['body'],{'showHidden':![],'depth':null}));switch(_0x133b90[_0xf652('0x4f')]){case _0xf652('0x85'):if(_0x4802c0[_0xf652('0x5b')][_0xf652('0xc6')]&&_0x4802c0[_0xf652('0x5b')][_0xf652('0x2a')]){_0x3d4481=_0x4802c0['body'][_0xf652('0x2a')];return db[_0xf652('0xa6')][_0xf652('0x59')]({'where':{'messageId':_0x4802c0['body'][_0xf652('0xc6')]}});}break;case _0xf652('0x88'):if(_0x4802c0[_0xf652('0x5b')][_0xf652('0xc7')]&&_0x4802c0[_0xf652('0x5b')][_0xf652('0xc8')]){_0x3d4481=_0x4802c0['body'][_0xf652('0xc8')];return db[_0xf652('0xa6')][_0xf652('0x59')]({'where':{'messageId':_0x4802c0['body'][_0xf652('0xc7')]}});}break;case _0xf652('0xc9'):if(_0x4802c0[_0xf652('0x5b')][_0xf652('0x89')]&&_0x4802c0[_0xf652('0x5b')][_0xf652('0xca')]){_0x3d4481=_0x4802c0['body']['status_code'];return db[_0xf652('0xa6')][_0xf652('0x59')]({'where':{'messageId':_0x4802c0['body'][_0xf652('0x89')]}});}break;case'infobip':var _0x553da6=_0x4802c0[_0xf652('0x5b')][_0xf652('0x8d')][0x0];if(_0x553da6['messageId']&&_0x553da6['status'][_0xf652('0xcb')]===_0xf652('0xcc')){_0x3d4481=_0x553da6[_0xf652('0x2a')][_0xf652('0xcb')];return db[_0xf652('0xa6')][_0xf652('0x59')]({'where':{'messageId':_0x553da6[_0xf652('0x84')]}});}break;case _0xf652('0x90'):if(_0x4802c0['body'][_0xf652('0x84')]&&_0x4802c0[_0xf652('0x5b')][_0xf652('0x2a')]){_0x3d4481=_0x4802c0['body']['status'];return db[_0xf652('0xa6')][_0xf652('0x59')]({'where':{'messageId':_0x4802c0[_0xf652('0x5b')][_0xf652('0x84')]}});}break;case'bandwidth':if(_0x4802c0[_0xf652('0x5b')][0x0][_0xf652('0x27')]['id']){_0x3d4481=_0x4802c0[_0xf652('0x5b')][0x0][_0xf652('0x4f')];return db[_0xf652('0xa6')][_0xf652('0x59')]({'where':{'messageId':_0x4802c0[_0xf652('0x5b')][0x0][_0xf652('0x27')]['id']}});}break;case _0xf652('0xcd'):if(_0x4802c0['body']['redif']&&_0x4802c0[_0xf652('0x5b')][_0xf652('0x2a')]){_0x3d4481=_0x4802c0[_0xf652('0x5b')][_0xf652('0x2a')];return db[_0xf652('0xa6')][_0xf652('0x59')]({'where':{'messageId':_0x4802c0[_0xf652('0x5b')][_0xf652('0xce')]}});}break;}}})[_0xf652('0x20')](handleEntityNotFound(_0x2be6f8,null))[_0xf652('0x20')](function(_0x50c8ed){if(_0x50c8ed){_0x2b4f05=_0x50c8ed;switch(_0x2864bd[_0xf652('0x4f')]){case _0xf652('0x85'):if(_0x3d4481===_0xf652('0xcc')){return _0x2b4f05[_0xf652('0x35')]({'read':!![]});}else{logger[_0xf652('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','skebby',util['inspect'](_0x4802c0[_0xf652('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xf652('0x88'):if(_0x3d4481==='1'){return _0x2b4f05[_0xf652('0x35')]({'read':!![]});}else{logger[_0xf652('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xf652('0x2a'),'skebby',util['inspect'](_0x4802c0[_0xf652('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xf652('0xc9'):if(!_0x4802c0['body'][_0xf652('0xcf')]&&_0x3d4481>=0xc8&&_0x3d4481<=0xce){return _0x2b4f05[_0xf652('0x35')]({'read':!![]});}else{logger[_0xf652('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xf652('0x2a'),'clicksend',util[_0xf652('0xc5')](_0x4802c0[_0xf652('0x5b')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x3875e1=_0x4802c0[_0xf652('0x5b')][_0xf652('0x8d')][0x0];if(_0x3875e1[_0xf652('0x2a')][_0xf652('0xcb')]===_0xf652('0xcc')){return _0x2b4f05[_0xf652('0x35')]({'read':!![]});}else{logger[_0xf652('0x25')](_0xf652('0x23'),_0xf652('0x2a'),_0xf652('0x8c'),util[_0xf652('0xc5')](_0x4802c0[_0xf652('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xf652('0x90'):if(_0x3d4481=='DELIVERED_TO_GATEWAY'||_0x3d4481==_0xf652('0xd0')){return _0x2b4f05[_0xf652('0x35')]({'read':!![]});}else{logger[_0xf652('0x25')](_0xf652('0x23'),_0xf652('0x2a'),_0xf652('0x90'),util[_0xf652('0xc5')](_0x4802c0['body'],{'showHidden':![],'depth':null}));}break;case _0xf652('0x92'):if(_0x3d4481==_0xf652('0xd1')){return _0x2b4f05[_0xf652('0x35')]({'read':!![]});}else{logger[_0xf652('0x25')](_0xf652('0x23'),_0xf652('0x2a'),_0xf652('0x92'),util[_0xf652('0xc5')](_0x4802c0[_0xf652('0x5b')],{'showHidden':![],'depth':null}));}break;case _0xf652('0xcd'):if(_0x3d4481===_0xf652('0xd2')||_0x3d4481==='ACCEPTD'){return _0x2b4f05[_0xf652('0x35')]({'read':!![]});}else{logger[_0xf652('0x25')](_0xf652('0x23'),_0xf652('0x2a'),_0xf652('0xcd'),util[_0xf652('0xc5')](_0x4802c0['body'],{'showHidden':![],'depth':null}));}break;}return _0x2b4f05;}})[_0xf652('0x20')](respondWithResult(_0x2be6f8,null))[_0xf652('0x28')](handleError(_0x2be6f8,null));};exports[_0xf652('0xd3')]=function(_0x141b0d,_0x3d3470,_0x343084){var _0x2427f8,_0x2e3f74,_0x1b5232;return db['SmsAccount'][_0xf652('0x59')]({'where':{'id':_0x141b0d[_0xf652('0x54')]['id']}})['then'](handleEntityNotFound(_0x3d3470,null))[_0xf652('0x20')](function(_0x450738){if(_0x450738){_0x1b5232=_0x450738;logger[_0xf652('0xb1')](_0xf652('0x23'),_0xf652('0x2a'),_0xf652('0xc4'),_0x450738[_0xf652('0x4f')],util[_0xf652('0xc5')](_0x141b0d[_0xf652('0x45')],{'showHidden':![],'depth':null}));switch(_0x450738[_0xf652('0x4f')]){case'csc':if(_0x141b0d[_0xf652('0x45')]['message-id']&&_0x141b0d['query'][_0xf652('0xd4')]){_0x2e3f74=_0x141b0d['query'][_0xf652('0xd4')];return db[_0xf652('0xa6')][_0xf652('0x59')]({'where':{'messageId':_0x141b0d[_0xf652('0x45')][_0xf652('0xd5')]}});}break;}}})[_0xf652('0x20')](handleEntityNotFound(_0x3d3470,null))[_0xf652('0x20')](function(_0x2524f9){if(_0x2524f9){_0x2427f8=_0x2524f9;switch(_0x1b5232['type']){case'csc':if(_0x2e3f74==='2'||_0x2e3f74==='6'){return _0x2427f8[_0xf652('0x35')]({'read':!![]});}else{logger[_0xf652('0x25')](_0xf652('0x23'),_0xf652('0x2a'),_0xf652('0x8e'),util['inspect'](_0x141b0d[_0xf652('0x45')],{'showHidden':![],'depth':null}));};break;}return _0x2427f8;}})['then'](respondWithResult(_0x3d3470,null))['catch'](handleError(_0x3d3470,null));};exports['addAgents']=function(_0x10eac2,_0x3494f,_0x11230b){return db[_0xf652('0x41')]['find']({'where':{'id':_0x10eac2[_0xf652('0x54')]['id']}})[_0xf652('0x20')](handleEntityNotFound(_0x3494f,null))[_0xf652('0x20')](function(_0x46c63e){if(_0x46c63e){return _0x46c63e[_0xf652('0xd6')](_0x10eac2[_0xf652('0x5b')][_0xf652('0x6d')],_[_0xf652('0x9e')](_0x10eac2['body'],[_0xf652('0x6d'),'id'])||{})[_0xf652('0xa0')](function(_0x168187){for(var _0x4d8dad=0x0;_0x4d8dad<_0x10eac2[_0xf652('0x5b')][_0xf652('0x6d')]['length'];_0x4d8dad+=0x1){socket['emit'](_0xf652('0xd7'),{'UserId':Number(_0x10eac2[_0xf652('0x5b')]['ids'][_0x4d8dad]),'SmsAccountId':Number(_0x10eac2[_0xf652('0x54')]['id'])});}return _0x168187;});}})[_0xf652('0x20')](respondWithResult(_0x3494f,null))[_0xf652('0x28')](handleError(_0x3494f,null));};exports['removeAgents']=function(_0x5acc64,_0x56db32,_0x1d5b2f){return db[_0xf652('0x41')]['find']({'where':{'id':_0x5acc64[_0xf652('0x54')]['id']}})[_0xf652('0x20')](handleEntityNotFound(_0x56db32,null))[_0xf652('0x20')](function(_0x27348e){if(_0x27348e){return _0x27348e[_0xf652('0xd8')](_0x5acc64[_0xf652('0x45')][_0xf652('0x6d')])[_0xf652('0x20')](function(){if(_[_0xf652('0xd9')](_0x5acc64[_0xf652('0x45')][_0xf652('0x6d')])){for(var _0x24b926=0x0;_0x24b926<_0x5acc64[_0xf652('0x45')][_0xf652('0x6d')][_0xf652('0x4a')];_0x24b926+=0x1){socket[_0xf652('0xda')]('userSmsAccount:remove',{'UserId':Number(_0x5acc64['query'][_0xf652('0x6d')][_0x24b926]),'SmsAccountId':Number(_0x5acc64['params']['id'])});}}else{socket[_0xf652('0xda')]('userSmsAccount:remove',{'UserId':Number(_0x5acc64[_0xf652('0x45')]['ids']),'SmsAccountId':Number(_0x5acc64[_0xf652('0x54')]['id'])});}});}})[_0xf652('0x20')](respondWithStatusCode(_0x56db32,null))[_0xf652('0x28')](handleError(_0x56db32,null));};exports[_0xf652('0xdb')]=function(_0x3af8b7,_0x3db549,_0x3b8798){var _0x4da8b3={};var _0x37418b={};var _0x176ccc;var _0x13b37e;return db[_0xf652('0x41')][_0xf652('0x67')]({'where':{'id':_0x3af8b7[_0xf652('0x54')]['id']}})[_0xf652('0x20')](handleEntityNotFound(_0x3db549,null))[_0xf652('0x20')](function(_0x2e6a21){if(_0x2e6a21){_0x176ccc=_0x2e6a21;_0x37418b[_0xf652('0x44')]=_[_0xf652('0x55')](db[_0xf652('0xba')][_0xf652('0x56')]);_0x37418b[_0xf652('0x45')]=_['keys'](_0x3af8b7[_0xf652('0x45')]);_0x37418b[_0xf652('0x46')]=_['intersection'](_0x37418b[_0xf652('0x44')],_0x37418b['query']);_0x4da8b3[_0xf652('0x48')]=_['intersection'](_0x37418b[_0xf652('0x44')],qs[_0xf652('0x49')](_0x3af8b7[_0xf652('0x45')][_0xf652('0x49')]));_0x4da8b3[_0xf652('0x48')]=_0x4da8b3[_0xf652('0x48')][_0xf652('0x4a')]?_0x4da8b3['attributes']:_0x37418b[_0xf652('0x44')];_0x4da8b3[_0xf652('0x69')]=qs[_0xf652('0x4c')](_0x3af8b7[_0xf652('0x45')]['sort']);_0x4da8b3['where']=qs['filters'](_[_0xf652('0x6a')](_0x3af8b7['query'],_0x37418b[_0xf652('0x46')]));if(_0x3af8b7[_0xf652('0x45')]['filter']){_0x4da8b3[_0xf652('0x4e')]=_[_0xf652('0x51')](_0x4da8b3['where'],{'$or':_[_0xf652('0x40')](_0x4da8b3[_0xf652('0x48')],function(_0x35d28b){var _0x1ec7ca={};_0x1ec7ca[_0x35d28b]={'$like':'%'+_0x3af8b7[_0xf652('0x45')][_0xf652('0x4d')]+'%'};return _0x1ec7ca;})});}_0x4da8b3=_['merge']({},_0x4da8b3,_0x3af8b7[_0xf652('0x58')]);return _0x176ccc[_0xf652('0xdb')](_0x4da8b3);}})['then'](function(_0x42e572){if(_0x42e572){_0x13b37e=_0x42e572[_0xf652('0x4a')];if(!_0x3af8b7[_0xf652('0x45')]['hasOwnProperty'](_0xf652('0x4b'))){_0x4da8b3[_0xf652('0x2d')]=qs[_0xf652('0x2d')](_0x3af8b7[_0xf652('0x45')]['limit']);_0x4da8b3[_0xf652('0x2c')]=qs[_0xf652('0x2c')](_0x3af8b7[_0xf652('0x45')]['offset']);}return _0x176ccc[_0xf652('0xdb')](_0x4da8b3);}})[_0xf652('0x20')](function(_0x5c32f5){if(_0x5c32f5){return _0x5c32f5?{'count':_0x13b37e,'rows':_0x5c32f5}:null;}})[_0xf652('0x20')](respondWithResult(_0x3db549,null))[_0xf652('0x28')](handleError(_0x3db549,null));};
\ No newline at end of file
+var _0xddbb=['DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','received\x20delivery\x20report\x20from','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','jayson/promise','client','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','stringify','error','result','message','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','get','SmsAccounts','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','includeAll','include','findAll','rows','show','params','options','find','create','body','user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','SmsAccountId','Disposition','getDispositions','findOne','keys','removeDispositions','addAnswer','CannedAnswer','getAnswers','ids','notify','sms','Applications','account','applications','orderBy','asc','Sequelize','ValidationError','difference','updatedAt','createdAt','CompanyId','ListId','mobile','twilio','from','messageId','MessageSid','sender','text','connectel','clicksend','plivo','From','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','omit','contact','spread','interaction','autoclose','push','*,*,*,*','created','SmsMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','SmsAccount,\x20%s,\x20%s,\x20%s','entity\x20found','debug','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','sequelize','transaction','SmsApplication','findAndCountAll','priority','getApplications','SmsInteraction','Owner','fullname','internal','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','inspect','skebby','skebby_dispatch_id','statusInt','requestid','status_code','groupName','DELIVERED','redif'];(function(_0x42c333,_0x3df5f2){var _0xd47dc4=function(_0x296faf){while(--_0x296faf){_0x42c333['push'](_0x42c333['shift']());}};_0xd47dc4(++_0x3df5f2);}(_0xddbb,0xf1));var _0xbddb=function(_0x329ddd,_0x233b58){_0x329ddd=_0x329ddd-0x0;var _0x2025a1=_0xddbb[_0x329ddd];return _0x2025a1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbddb('0x0'));var zipdir=require(_0xbddb('0x1'));var jsonpatch=require(_0xbddb('0x2'));var rp=require(_0xbddb('0x3'));var moment=require(_0xbddb('0x4'));var BPromise=require(_0xbddb('0x5'));var Mustache=require(_0xbddb('0x6'));var util=require(_0xbddb('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbddb('0x8'));var fs=require('fs');var fs_extra=require(_0xbddb('0x9'));var _=require('lodash');var squel=require(_0xbddb('0xa'));var crypto=require(_0xbddb('0xb'));var jsforce=require(_0xbddb('0xc'));var deskjs=require(_0xbddb('0xd'));var toCsv=require(_0xbddb('0xe'));var querystring=require(_0xbddb('0xf'));var Papa=require(_0xbddb('0x10'));var Redis=require(_0xbddb('0x11'));var authService=require(_0xbddb('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbddb('0x13'));var hardwareService=require(_0xbddb('0x14'));var logger=require(_0xbddb('0x15'))(_0xbddb('0x16'));var utils=require(_0xbddb('0x17'));var config=require(_0xbddb('0x18'));var licenseUtil=require(_0xbddb('0x19'));var db=require(_0xbddb('0x1a'))['db'];config[_0xbddb('0x1b')]=_[_0xbddb('0x1c')](config['redis'],{'host':_0xbddb('0x1d'),'port':0x18eb});var socket=require(_0xbddb('0x1e'))(new Redis(config[_0xbddb('0x1b')]));require(_0xbddb('0x1f'))['register'](socket);var jayson=require(_0xbddb('0x20'));var client=jayson[_0xbddb('0x21')]['http']({'port':0x232c});function respondWithRpcPromise(_0x104d07,_0x220d74,_0xdcb1b4,_0x37b73d){return new BPromise(function(_0x4a2b82,_0x37d6bc){var _0x4aa7a1=_0x37b73d||client;return _0x4aa7a1[_0xbddb('0x22')](_0x104d07,_0xdcb1b4)[_0xbddb('0x23')](function(_0x337501){logger[_0xbddb('0x24')](_0xbddb('0x25'),_0x220d74,_0xbddb('0x26'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x220d74,'request\x20sent',JSON[_0xbddb('0x27')](_0x337501));if(_0x337501[_0xbddb('0x28')]){if(_0x337501[_0xbddb('0x28')]['code']===0x1f4){logger['error'](_0xbddb('0x25'),_0x220d74,_0x337501[_0xbddb('0x28')]['message']);return _0x37d6bc(_0x337501['error']['message']);}logger[_0xbddb('0x28')](_0xbddb('0x25'),_0x220d74,_0x337501[_0xbddb('0x28')]['message']);return _0x4a2b82(_0x337501[_0xbddb('0x28')]['message']);}else{logger[_0xbddb('0x24')](_0xbddb('0x25'),_0x220d74,_0xbddb('0x26'));_0x4a2b82(_0x337501[_0xbddb('0x29')][_0xbddb('0x2a')]);}})[_0xbddb('0x2b')](function(_0x333f2f){logger['error']('SmsAccount,\x20%s,\x20%s',_0x220d74,_0x333f2f);_0x37d6bc(_0x333f2f);});});}function respondWithStatusCode(_0xb1ebf0,_0x2dacbd){_0x2dacbd=_0x2dacbd||0xcc;return function(_0x10beeb){if(_0x10beeb){return _0xb1ebf0[_0xbddb('0x2c')](_0x2dacbd);}return _0xb1ebf0[_0xbddb('0x2d')](_0x2dacbd)[_0xbddb('0x2e')]();};}function respondWithResult(_0x5c66fc,_0x3b490d){_0x3b490d=_0x3b490d||0xc8;return function(_0x583f1){if(_0x583f1){return _0x5c66fc['status'](_0x3b490d)[_0xbddb('0x2f')](_0x583f1);}};}function respondWithFilteredResult(_0x2f5d39,_0x5978be){return function(_0x58716c){if(_0x58716c){var _0x152436=typeof _0x5978be[_0xbddb('0x30')]===_0xbddb('0x31')&&typeof _0x5978be[_0xbddb('0x32')]===_0xbddb('0x31');var _0x3339a8=_0x58716c[_0xbddb('0x33')];var _0x7d1b2e=_0x152436?0x0:_0x5978be['offset'];var _0x8ea7b=_0x152436?_0x58716c[_0xbddb('0x33')]:_0x5978be[_0xbddb('0x30')]+_0x5978be[_0xbddb('0x32')];var _0x18e700;if(_0x8ea7b>=_0x3339a8){_0x8ea7b=_0x3339a8;_0x18e700=0xc8;}else{_0x18e700=0xce;}_0x2f5d39[_0xbddb('0x2d')](_0x18e700);return _0x2f5d39[_0xbddb('0x34')]('Content-Range',_0x7d1b2e+'-'+_0x8ea7b+'/'+_0x3339a8)['json'](_0x58716c);}return null;};}function patchUpdates(_0x5dfc00){return function(_0x417458){try{jsonpatch[_0xbddb('0x35')](_0x417458,_0x5dfc00,!![]);}catch(_0x36d319){return BPromise[_0xbddb('0x36')](_0x36d319);}return _0x417458['save']();};}function saveUpdates(_0xa155c2,_0x1e26aa){return function(_0x3a5b58){if(_0x3a5b58){return _0x3a5b58[_0xbddb('0x37')](_0xa155c2)['then'](function(_0x8c214){return _0x8c214;});}return null;};}function removeEntity(_0x12c28e,_0x3a10f4){return function(_0xd506d8){if(_0xd506d8){return _0xd506d8[_0xbddb('0x38')]()[_0xbddb('0x23')](function(){var _0x4e5935=_0xd506d8[_0xbddb('0x39')]({'plain':!![]});var _0x1d2714=_0xbddb('0x3a');return db['UserProfileResource']['destroy']({'where':{'type':_0x1d2714,'resourceId':_0x4e5935['id']}})[_0xbddb('0x23')](function(){return _0xd506d8;});})[_0xbddb('0x23')](function(){_0x12c28e[_0xbddb('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2825fc,_0x457894){return function(_0x52ba23){if(!_0x52ba23){_0x2825fc[_0xbddb('0x2c')](0x194);}return _0x52ba23;};}function handleError(_0xb9e372,_0x3905fe){_0x3905fe=_0x3905fe||0x1f4;return function(_0x57a1d1){logger[_0xbddb('0x28')](_0x57a1d1[_0xbddb('0x3b')]);if(_0x57a1d1[_0xbddb('0x3c')]){delete _0x57a1d1['name'];}_0xb9e372[_0xbddb('0x2d')](_0x3905fe)[_0xbddb('0x3d')](_0x57a1d1);};}exports[_0xbddb('0x3e')]=function(_0x156b6d,_0x3f3ac6){var _0x499959={'include':[{'model':db[_0xbddb('0x3f')],'as':_0xbddb('0x40')}]},_0x296501={},_0x1a0642={'count':0x0,'rows':[]};var _0x5f394d=_[_0xbddb('0x41')](db[_0xbddb('0x42')][_0xbddb('0x43')],function(_0x579942){return{'name':_0x579942[_0xbddb('0x44')],'type':_0x579942[_0xbddb('0x45')][_0xbddb('0x46')]};});_0x296501[_0xbddb('0x47')]=_['map'](_0x5f394d,_0xbddb('0x3c'));_0x296501[_0xbddb('0x48')]=_['keys'](_0x156b6d[_0xbddb('0x48')]);_0x296501[_0xbddb('0x49')]=_['intersection'](_0x296501[_0xbddb('0x47')],_0x296501[_0xbddb('0x48')]);_0x499959['attributes']=_[_0xbddb('0x4a')](_0x296501[_0xbddb('0x47')],qs['fields'](_0x156b6d[_0xbddb('0x48')][_0xbddb('0x4b')]));_0x499959[_0xbddb('0x4c')]=_0x499959[_0xbddb('0x4c')][_0xbddb('0x4d')]?_0x499959[_0xbddb('0x4c')]:_0x296501['model'];if(!_0x156b6d[_0xbddb('0x48')][_0xbddb('0x4e')](_0xbddb('0x4f'))){_0x499959[_0xbddb('0x32')]=qs[_0xbddb('0x32')](_0x156b6d[_0xbddb('0x48')][_0xbddb('0x32')]);_0x499959['offset']=qs[_0xbddb('0x30')](_0x156b6d[_0xbddb('0x48')][_0xbddb('0x30')]);}_0x499959[_0xbddb('0x50')]=qs[_0xbddb('0x51')](_0x156b6d['query'][_0xbddb('0x51')]);_0x499959['where']=qs[_0xbddb('0x49')](_[_0xbddb('0x52')](_0x156b6d['query'],_0x296501['filters']),_0x5f394d);if(_0x156b6d['query']['filter']){_0x499959[_0xbddb('0x53')]=_['merge'](_0x499959['where'],{'$or':_[_0xbddb('0x41')](_0x5f394d,function(_0x59081d){if(_0x59081d[_0xbddb('0x45')]!==_0xbddb('0x54')){var _0x16bbf3={};_0x16bbf3[_0x59081d[_0xbddb('0x3c')]]={'$like':'%'+_0x156b6d['query'][_0xbddb('0x55')]+'%'};return _0x16bbf3;}})});}_0x499959=_[_0xbddb('0x56')]({},_0x499959,_0x156b6d['options']);var _0x45b3a4={'where':_0x499959[_0xbddb('0x53')]};return db[_0xbddb('0x42')][_0xbddb('0x33')](_0x45b3a4)['then'](function(_0x495f8d){_0x1a0642['count']=_0x495f8d;if(_0x156b6d[_0xbddb('0x48')][_0xbddb('0x57')]){_0x499959[_0xbddb('0x58')]=[{'all':!![]}];}return db[_0xbddb('0x42')][_0xbddb('0x59')](_0x499959);})[_0xbddb('0x23')](function(_0xc51c83){_0x1a0642[_0xbddb('0x5a')]=_0xc51c83;return _0x1a0642;})[_0xbddb('0x23')](respondWithFilteredResult(_0x3f3ac6,_0x499959))[_0xbddb('0x2b')](handleError(_0x3f3ac6,null));};exports[_0xbddb('0x5b')]=function(_0x359396,_0x6f1a47){var _0x36882b={'raw':![],'where':{'id':_0x359396[_0xbddb('0x5c')]['id']},'include':[{'model':db[_0xbddb('0x3f')],'as':'mandatoryDispositionPause'}]},_0x4bead9={};_0x4bead9[_0xbddb('0x47')]=_['keys'](db[_0xbddb('0x42')][_0xbddb('0x43')]);_0x4bead9[_0xbddb('0x48')]=_['keys'](_0x359396[_0xbddb('0x48')]);_0x4bead9[_0xbddb('0x49')]=_['intersection'](_0x4bead9['model'],_0x4bead9[_0xbddb('0x48')]);_0x36882b[_0xbddb('0x4c')]=_['intersection'](_0x4bead9[_0xbddb('0x47')],qs[_0xbddb('0x4b')](_0x359396[_0xbddb('0x48')][_0xbddb('0x4b')]));_0x36882b[_0xbddb('0x4c')]=_0x36882b[_0xbddb('0x4c')][_0xbddb('0x4d')]?_0x36882b[_0xbddb('0x4c')]:_0x4bead9[_0xbddb('0x47')];if(_0x359396[_0xbddb('0x48')][_0xbddb('0x57')]){_0x36882b[_0xbddb('0x58')]=[{'all':!![]}];}_0x36882b=_[_0xbddb('0x56')]({},_0x36882b,_0x359396[_0xbddb('0x5d')]);return db['SmsAccount'][_0xbddb('0x5e')](_0x36882b)[_0xbddb('0x23')](handleEntityNotFound(_0x6f1a47,null))[_0xbddb('0x23')](respondWithResult(_0x6f1a47,null))[_0xbddb('0x2b')](handleError(_0x6f1a47,null));};exports[_0xbddb('0x5f')]=function(_0x3a1ea9,_0x4740bb){return db[_0xbddb('0x42')]['create'](_0x3a1ea9[_0xbddb('0x60')],{})[_0xbddb('0x23')](function(_0x3a8093){var _0x69057c=_0x3a1ea9[_0xbddb('0x61')][_0xbddb('0x39')]({'plain':!![]});if(!_0x69057c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x69057c[_0xbddb('0x62')]===_0xbddb('0x61')){var _0x734ee9=_0x3a8093['get']({'plain':!![]});var _0x4dcc60='SmsAccounts';return db[_0xbddb('0x63')][_0xbddb('0x5e')]({'where':{'name':_0x4dcc60,'userProfileId':_0x69057c['userProfileId']},'raw':!![]})[_0xbddb('0x23')](function(_0x231aa3){if(_0x231aa3&&_0x231aa3[_0xbddb('0x64')]===0x0){return db[_0xbddb('0x65')][_0xbddb('0x5f')]({'name':_0x734ee9['name'],'resourceId':_0x734ee9['id'],'type':_0x231aa3[_0xbddb('0x3c')],'sectionId':_0x231aa3['id']},{})[_0xbddb('0x23')](function(){return _0x3a8093;});}else{return _0x3a8093;}})[_0xbddb('0x2b')](function(_0x5c42fd){logger[_0xbddb('0x28')](_0xbddb('0x66'),_0x5c42fd);throw _0x5c42fd;});}return _0x3a8093;})[_0xbddb('0x23')](respondWithResult(_0x4740bb,0xc9))[_0xbddb('0x2b')](handleError(_0x4740bb,null));};exports['update']=function(_0x155742,_0x23af6a){if(_0x155742['body']['id']){delete _0x155742['body']['id'];}return db[_0xbddb('0x42')][_0xbddb('0x5e')]({'where':{'id':_0x155742[_0xbddb('0x5c')]['id']},'include':[{'model':db[_0xbddb('0x3f')],'as':_0xbddb('0x40')}]})[_0xbddb('0x23')](handleEntityNotFound(_0x23af6a,null))['then'](saveUpdates(_0x155742[_0xbddb('0x60')],null))[_0xbddb('0x23')](respondWithResult(_0x23af6a,null))[_0xbddb('0x2b')](handleError(_0x23af6a,null));};exports[_0xbddb('0x38')]=function(_0x3bb3bf,_0x3f7317){return db['SmsAccount'][_0xbddb('0x5e')]({'where':{'id':_0x3bb3bf['params']['id']}})[_0xbddb('0x23')](handleEntityNotFound(_0x3f7317,null))[_0xbddb('0x23')](removeEntity(_0x3f7317,null))['catch'](handleError(_0x3f7317,null));};exports[_0xbddb('0x67')]=function(_0x55e81e,_0x3c91c6){return db[_0xbddb('0x42')][_0xbddb('0x67')]()[_0xbddb('0x23')](respondWithResult(_0x3c91c6,null))[_0xbddb('0x2b')](handleError(_0x3c91c6,null));};exports['addDisposition']=function(_0x1911d4,_0x4a2ce0,_0x1e0a90){if(_0x1911d4[_0xbddb('0x60')]['id']){delete _0x1911d4[_0xbddb('0x60')]['id'];}return db[_0xbddb('0x42')][_0xbddb('0x5e')]({'where':{'id':_0x1911d4[_0xbddb('0x5c')]['id']}})[_0xbddb('0x23')](handleEntityNotFound(_0x4a2ce0,null))[_0xbddb('0x23')](function(_0x44279a){if(_0x44279a){_0x1911d4[_0xbddb('0x60')][_0xbddb('0x68')]=_0x44279a['id'];return db[_0xbddb('0x69')][_0xbddb('0x5f')](_0x1911d4[_0xbddb('0x60')]);}})[_0xbddb('0x23')](respondWithResult(_0x4a2ce0,null))[_0xbddb('0x2b')](handleError(_0x4a2ce0,null));};exports[_0xbddb('0x6a')]=function(_0x40af5c,_0x54aeed,_0x1b4059){var _0xfe61a0={'raw':![],'where':{}};var _0x199d34={};var _0x19879d={'count':0x0,'rows':[]};return db[_0xbddb('0x42')][_0xbddb('0x6b')]({'where':{'id':_0x40af5c[_0xbddb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x54aeed,null))['then'](function(_0x107de8){if(_0x107de8){_0x199d34[_0xbddb('0x47')]=_['keys'](db[_0xbddb('0x69')][_0xbddb('0x43')]);_0x199d34[_0xbddb('0x48')]=_[_0xbddb('0x6c')](_0x40af5c[_0xbddb('0x48')]);_0x199d34[_0xbddb('0x49')]=_[_0xbddb('0x4a')](_0x199d34['model'],_0x199d34['query']);_0xfe61a0[_0xbddb('0x4c')]=_['intersection'](_0x199d34[_0xbddb('0x47')],qs[_0xbddb('0x4b')](_0x40af5c[_0xbddb('0x48')][_0xbddb('0x4b')]));_0xfe61a0['attributes']=_0xfe61a0[_0xbddb('0x4c')][_0xbddb('0x4d')]?_0xfe61a0[_0xbddb('0x4c')]:_0x199d34['model'];if(!_0x40af5c[_0xbddb('0x48')][_0xbddb('0x4e')]('nolimit')){_0xfe61a0[_0xbddb('0x32')]=qs[_0xbddb('0x32')](_0x40af5c[_0xbddb('0x48')]['limit']);_0xfe61a0[_0xbddb('0x30')]=qs[_0xbddb('0x30')](_0x40af5c[_0xbddb('0x48')]['offset']);}_0xfe61a0[_0xbddb('0x50')]=qs[_0xbddb('0x51')](_0x40af5c[_0xbddb('0x48')]['sort']);_0xfe61a0['where']=qs['filters'](_[_0xbddb('0x52')](_0x40af5c[_0xbddb('0x48')],_0x199d34['filters']));_0xfe61a0['where']['SmsAccountId']=_0x107de8['id'];if(_0x40af5c[_0xbddb('0x48')][_0xbddb('0x55')]){_0xfe61a0[_0xbddb('0x53')]=_[_0xbddb('0x56')](_0xfe61a0['where'],{'$or':_[_0xbddb('0x41')](_0xfe61a0[_0xbddb('0x4c')],function(_0x55a624){var _0x4e8399={};_0x4e8399[_0x55a624]={'$like':'%'+_0x40af5c['query'][_0xbddb('0x55')]+'%'};return _0x4e8399;})});}_0xfe61a0=_['merge']({},_0xfe61a0,_0x40af5c[_0xbddb('0x5d')]);return db[_0xbddb('0x69')][_0xbddb('0x33')]({'where':_0xfe61a0[_0xbddb('0x53')]})[_0xbddb('0x23')](function(_0x3bfcfe){_0x19879d[_0xbddb('0x33')]=_0x3bfcfe;if(_0x40af5c[_0xbddb('0x48')]['includeAll']){_0xfe61a0[_0xbddb('0x58')]=[{'all':!![]}];}return db['Disposition'][_0xbddb('0x59')](_0xfe61a0);})[_0xbddb('0x23')](function(_0x58717f){_0x19879d['rows']=_0x58717f;return _0x19879d;});}})['then'](respondWithFilteredResult(_0x54aeed,_0xfe61a0))[_0xbddb('0x2b')](handleError(_0x54aeed,null));};exports[_0xbddb('0x6d')]=function(_0x515948,_0x3305da,_0x1a8b65){return db[_0xbddb('0x42')][_0xbddb('0x5e')]({'where':{'id':_0x515948[_0xbddb('0x5c')]['id']}})[_0xbddb('0x23')](handleEntityNotFound(_0x3305da,null))['then'](function(_0x5d6d8c){if(_0x5d6d8c){return _0x5d6d8c[_0xbddb('0x6d')](_0x515948['query']['ids']);}})['then'](respondWithStatusCode(_0x3305da,null))[_0xbddb('0x2b')](handleError(_0x3305da,null));};exports[_0xbddb('0x6e')]=function(_0x27c830,_0x7170b3,_0x190aea){if(_0x27c830[_0xbddb('0x60')]['id']){delete _0x27c830[_0xbddb('0x60')]['id'];}return db[_0xbddb('0x42')][_0xbddb('0x5e')]({'where':{'id':_0x27c830[_0xbddb('0x5c')]['id']}})[_0xbddb('0x23')](handleEntityNotFound(_0x7170b3,null))['then'](function(_0x37dc88){if(_0x37dc88){_0x27c830['body'][_0xbddb('0x68')]=_0x37dc88['id'];return db[_0xbddb('0x6f')][_0xbddb('0x5f')](_0x27c830[_0xbddb('0x60')]);}})['then'](respondWithResult(_0x7170b3,null))[_0xbddb('0x2b')](handleError(_0x7170b3,null));};exports[_0xbddb('0x70')]=function(_0x216da0,_0x249d41,_0x1c6cca){var _0x126bc0={'raw':![],'where':{}};var _0x1f267a={};var _0x3c1a8f={'count':0x0,'rows':[]};return db[_0xbddb('0x42')]['findOne']({'where':{'id':_0x216da0[_0xbddb('0x5c')]['id']}})[_0xbddb('0x23')](handleEntityNotFound(_0x249d41,null))[_0xbddb('0x23')](function(_0x9901f0){if(_0x9901f0){_0x1f267a['model']=_[_0xbddb('0x6c')](db['CannedAnswer']['rawAttributes']);_0x1f267a[_0xbddb('0x48')]=_[_0xbddb('0x6c')](_0x216da0[_0xbddb('0x48')]);_0x1f267a[_0xbddb('0x49')]=_[_0xbddb('0x4a')](_0x1f267a[_0xbddb('0x47')],_0x1f267a[_0xbddb('0x48')]);_0x126bc0['attributes']=_['intersection'](_0x1f267a[_0xbddb('0x47')],qs[_0xbddb('0x4b')](_0x216da0[_0xbddb('0x48')][_0xbddb('0x4b')]));_0x126bc0[_0xbddb('0x4c')]=_0x126bc0[_0xbddb('0x4c')]['length']?_0x126bc0['attributes']:_0x1f267a[_0xbddb('0x47')];if(!_0x216da0['query'][_0xbddb('0x4e')](_0xbddb('0x4f'))){_0x126bc0[_0xbddb('0x32')]=qs[_0xbddb('0x32')](_0x216da0[_0xbddb('0x48')]['limit']);_0x126bc0[_0xbddb('0x30')]=qs[_0xbddb('0x30')](_0x216da0['query'][_0xbddb('0x30')]);}_0x126bc0['order']=qs[_0xbddb('0x51')](_0x216da0[_0xbddb('0x48')][_0xbddb('0x51')]);_0x126bc0[_0xbddb('0x53')]=qs[_0xbddb('0x49')](_[_0xbddb('0x52')](_0x216da0[_0xbddb('0x48')],_0x1f267a[_0xbddb('0x49')]));_0x126bc0[_0xbddb('0x53')][_0xbddb('0x68')]=_0x9901f0['id'];if(_0x216da0['query'][_0xbddb('0x55')]){_0x126bc0[_0xbddb('0x53')]=_[_0xbddb('0x56')](_0x126bc0['where'],{'$or':_[_0xbddb('0x41')](_0x126bc0['attributes'],function(_0x50a121){var _0x87d40f={};_0x87d40f[_0x50a121]={'$like':'%'+_0x216da0[_0xbddb('0x48')][_0xbddb('0x55')]+'%'};return _0x87d40f;})});}_0x126bc0=_[_0xbddb('0x56')]({},_0x126bc0,_0x216da0[_0xbddb('0x5d')]);return db[_0xbddb('0x6f')][_0xbddb('0x33')]({'where':_0x126bc0[_0xbddb('0x53')]})[_0xbddb('0x23')](function(_0x338018){_0x3c1a8f[_0xbddb('0x33')]=_0x338018;if(_0x216da0[_0xbddb('0x48')]['includeAll']){_0x126bc0[_0xbddb('0x58')]=[{'all':!![]}];}return db[_0xbddb('0x6f')][_0xbddb('0x59')](_0x126bc0);})[_0xbddb('0x23')](function(_0x4d0b65){_0x3c1a8f['rows']=_0x4d0b65;return _0x3c1a8f;});}})[_0xbddb('0x23')](respondWithFilteredResult(_0x249d41,_0x126bc0))['catch'](handleError(_0x249d41,null));};exports['removeAnswers']=function(_0x131dc0,_0x16da7f,_0x117147){return db[_0xbddb('0x42')][_0xbddb('0x5e')]({'where':{'id':_0x131dc0[_0xbddb('0x5c')]['id']}})[_0xbddb('0x23')](handleEntityNotFound(_0x16da7f,null))['then'](function(_0x5aec15){if(_0x5aec15){return _0x5aec15['removeAnswers'](_0x131dc0[_0xbddb('0x48')][_0xbddb('0x71')]);}})[_0xbddb('0x23')](respondWithStatusCode(_0x16da7f,null))['catch'](handleError(_0x16da7f,null));};exports[_0xbddb('0x72')]=function(_0x5e80a9,_0x1e1b70,_0x4ee33d){var _0x233c19={'channel':_0xbddb('0x73')};var _0x4e03a8=[];var _0x44eb6c=[];var _0x5d09db={};return db[_0xbddb('0x42')][_0xbddb('0x5e')]({'where':{'id':_0x5e80a9[_0xbddb('0x5c')]['id']},'include':[{'model':db['SmsApplication'],'as':_0xbddb('0x74')}]})[_0xbddb('0x23')](handleEntityNotFound(_0x1e1b70,null))[_0xbddb('0x23')](function(_0x2469b5){_0x233c19[_0xbddb('0x75')]=_0x2469b5;_0x233c19[_0xbddb('0x76')]=_[_0xbddb('0x77')](_0x2469b5[_0xbddb('0x74')],['priority'],[_0xbddb('0x78')]);if(_0x233c19[_0xbddb('0x75')][_0xbddb('0x74')]){delete _0x233c19[_0xbddb('0x75')][_0xbddb('0x74')];}return db['CmContact'][_0xbddb('0x67')]();})[_0xbddb('0x23')](function(_0x3e3efa){if(!_0x3e3efa){throw new db[(_0xbddb('0x79'))][(_0xbddb('0x7a'))]('no\x20available\x20attributes');}_0x4e03a8=_[_0xbddb('0x7b')](_[_0xbddb('0x6c')](_0x3e3efa),['createdAt',_0xbddb('0x7c')]);_0x44eb6c=_[_0xbddb('0x7b')](_['keys'](_0x3e3efa),[_0xbddb('0x7d'),_0xbddb('0x7c'),_0xbddb('0x7e'),_0xbddb('0x7f')]);_0x233c19[_0xbddb('0x60')]={'mapKey':_0xbddb('0x80')};if(_0x233c19[_0xbddb('0x75')][_0xbddb('0x45')]){switch(_0x233c19[_0xbddb('0x75')][_0xbddb('0x45')]){case _0xbddb('0x81'):_0x233c19[_0xbddb('0x60')][_0xbddb('0x82')]=_0x5e80a9[_0xbddb('0x60')]['From'];_0x233c19[_0xbddb('0x60')][_0xbddb('0x60')]=_0x5e80a9[_0xbddb('0x60')]['Body'];_0x233c19[_0xbddb('0x60')][_0xbddb('0x83')]=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x84')];break;case'skebby':_0x233c19['body']['from']='+'+_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x85')];_0x233c19[_0xbddb('0x60')][_0xbddb('0x60')]=_0x5e80a9['body'][_0xbddb('0x86')];break;case _0xbddb('0x87'):_0x233c19[_0xbddb('0x60')]['from']=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x82')];_0x233c19[_0xbddb('0x60')]['body']=_0x5e80a9['body'][_0xbddb('0x2a')];break;case _0xbddb('0x88'):_0x233c19['body'][_0xbddb('0x82')]=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x82')];_0x233c19['body'][_0xbddb('0x60')]=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x60')];_0x233c19[_0xbddb('0x60')][_0xbddb('0x83')]=_0x5e80a9['body']['message_id'];break;case _0xbddb('0x89'):_0x233c19['body']['from']=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x8a')];_0x233c19[_0xbddb('0x60')][_0xbddb('0x60')]=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x8b')];_0x233c19[_0xbddb('0x60')][_0xbddb('0x83')]=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x8c')];break;case _0xbddb('0x8d'):_0x233c19[_0xbddb('0x60')]['from']='+'+_0x5e80a9['body']['results'][0x0][_0xbddb('0x82')];_0x233c19[_0xbddb('0x60')][_0xbddb('0x60')]=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x8e')][0x0][_0xbddb('0x86')];_0x233c19['body'][_0xbddb('0x83')]=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x8e')][0x0]['messageId'];break;case _0xbddb('0x8f'):_0x233c19[_0xbddb('0x60')][_0xbddb('0x82')]=_0x5e80a9['body'][_0xbddb('0x90')];_0x233c19[_0xbddb('0x60')][_0xbddb('0x60')]=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x91')][_0xbddb('0x2a')];break;case _0xbddb('0x92'):_0x233c19[_0xbddb('0x60')][_0xbddb('0x82')]=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x93')];_0x233c19['body']['body']=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x86')];_0x233c19[_0xbddb('0x60')][_0xbddb('0x83')]=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x94')];break;case _0xbddb('0x95'):_0x233c19[_0xbddb('0x60')][_0xbddb('0x83')]=_0x5e80a9[_0xbddb('0x60')][0x0]['message']['id'];_0x233c19[_0xbddb('0x60')][_0xbddb('0x82')]=_0x5e80a9[_0xbddb('0x60')][0x0]['message'][_0xbddb('0x82')];_0x233c19[_0xbddb('0x60')][_0xbddb('0x60')]=_0x5e80a9[_0xbddb('0x60')][0x0][_0xbddb('0x2a')][_0xbddb('0x86')];break;case _0xbddb('0x96'):_0x233c19[_0xbddb('0x60')]['from']=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x82')];_0x233c19[_0xbddb('0x60')][_0xbddb('0x60')]=_0x5e80a9[_0xbddb('0x60')][_0xbddb('0x2a')];_0x233c19[_0xbddb('0x60')]['messageId']=_0x5e80a9[_0xbddb('0x60')]['refid'];break;}}if(_0x233c19[_0xbddb('0x60')]['id']){delete _0x233c19[_0xbddb('0x60')]['id'];}if(_['isNil'](_0x233c19[_0xbddb('0x60')][_0xbddb('0x82')])){throw new db[(_0xbddb('0x79'))]['ValidationError'](_0xbddb('0x97'));}if(_[_0xbddb('0x98')](_0x233c19[_0xbddb('0x60')][_0xbddb('0x60')])||_0x233c19[_0xbddb('0x60')][_0xbddb('0x60')]===''){throw new db[(_0xbddb('0x79'))][(_0xbddb('0x7a'))](_0xbddb('0x99'));}if(_[_0xbddb('0x98')](_0x233c19[_0xbddb('0x60')][_0xbddb('0x9a')])){throw new db['Sequelize']['ValidationError'](_0xbddb('0x9b')+_0x44eb6c);}if(!_['includes'](_0x44eb6c,_0x233c19[_0xbddb('0x60')][_0xbddb('0x9a')])){throw new db[(_0xbddb('0x79'))][(_0xbddb('0x7a'))](_0xbddb('0x9c')+_0x44eb6c);}_0x5d09db[_0x233c19['body'][_0xbddb('0x9a')]]=_0x233c19['body'][_0xbddb('0x82')];return db[_0xbddb('0x9d')][_0xbddb('0x5e')]({'where':{'id':_0x233c19[_0xbddb('0x75')][_0xbddb('0x7f')]},'include':[{'model':db[_0xbddb('0x9e')],'as':_0xbddb('0x9f'),'where':_0x5d09db,'limit':0x1,'order':[['updatedAt',_0xbddb('0xa0')]]}]});})[_0xbddb('0x23')](handleEntityNotFound(_0x1e1b70,null))[_0xbddb('0x23')](function(_0x5890c4){if(_0x5890c4){_0x233c19['list']=_[_0xbddb('0xa1')](_0x5890c4,[_0xbddb('0x9f')]);if(_0x5890c4[_0xbddb('0x9f')]['length']){return _0x5890c4[_0xbddb('0x9f')][0x0];}var _0x4c062b=_[_0xbddb('0x1c')](_0x233c19['body'],{'firstName':_0x233c19['body'][_0xbddb('0x82')],'ListId':_0x5890c4['id']});_0x4c062b[_0x233c19['body']['mapKey']]=_0x233c19[_0xbddb('0x60')][_0xbddb('0x82')];return db[_0xbddb('0x9e')][_0xbddb('0x5f')](_0x4c062b,{'fields':_0x4e03a8,'raw':!![]});}})['then'](handleEntityNotFound(_0x1e1b70,null))[_0xbddb('0x23')](function(_0x3f748d){if(_0x3f748d){_0x233c19[_0xbddb('0xa2')]=_0x3f748d;var _0x2b227b={'ContactId':_0x3f748d['id'],'phone':_0x233c19[_0xbddb('0x60')][_0xbddb('0x82')],'SmsAccountId':_0x5e80a9[_0xbddb('0x5c')]['id']};var _0xe86eb9={'ContactId':_0x3f748d['id'],'SmsAccountId':_0x5e80a9['params']['id'],'closed':![]};return db['SmsInteraction'][_0xbddb('0x5e')]({'where':_0xe86eb9})[_0xbddb('0x23')](function(_0xe14fcb){if(_0xe14fcb){return[_0xe14fcb,![]];}return db['SmsInteraction'][_0xbddb('0x5f')](_0x2b227b)[_0xbddb('0x23')](function(_0x3dc0d1){return[_0x3dc0d1,!![]];});});}})[_0xbddb('0xa3')](function(_0x5e313f,_0x47b032){_0x233c19['interaction']=_0x5e313f[_0xbddb('0x39')]({'plain':!![]});_0x233c19[_0xbddb('0xa4')]['created']=![];if(_0x47b032){if(_0x233c19[_0xbddb('0x75')][_0xbddb('0xa5')]){_0x233c19[_0xbddb('0x76')][_0xbddb('0xa6')]({'id':0x0,'priority':_0x233c19[_0xbddb('0x76')][_0xbddb('0x4d')]+0x1,'app':'close','appdata':'unmanaged','interval':_0xbddb('0xa7')});}_0x233c19['interaction'][_0xbddb('0xa8')]=!![];}return db[_0xbddb('0xa9')]['create']({'phone':_0x233c19[_0xbddb('0x60')][_0xbddb('0x82')],'messageId':_0x233c19[_0xbddb('0x60')][_0xbddb('0x83')],'body':_0x233c19[_0xbddb('0x60')]['body'],'SmsAccountId':_0x5e80a9['params']['id'],'SmsInteractionId':_0x5e313f['id'],'direction':'in','ContactId':_0x5e313f['ContactId'],'AttachmentId':_0x233c19['body'][_0xbddb('0xaa')]});})[_0xbddb('0x23')](function(_0x3e8fb3){_0x233c19[_0xbddb('0x2a')]=_0x3e8fb3;if(_0x233c19[_0xbddb('0xa4')][_0xbddb('0xab')]){return db[_0xbddb('0xac')]['find']({'attributes':['id',_0xbddb('0x3c')],'where':{'id':_0x233c19[_0xbddb('0xa4')]['UserId']}})[_0xbddb('0x23')](function(_0x5d6bc6){if(_0x5d6bc6){_0x233c19[_0xbddb('0x76')][_0xbddb('0xad')]({'id':0x0,'priority':0x0,'app':_0xbddb('0xae'),'appdata':_0x5d6bc6[_0xbddb('0x3c')]+','+(_0x233c19[_0xbddb('0x75')][_0xbddb('0xaf')]||0xa),'interval':_0xbddb('0xa7')});}return respondWithRpcPromise(_0xbddb('0xb0'),'startRouting',_0x233c19);});}return respondWithRpcPromise(_0xbddb('0xb0'),_0xbddb('0xb1'),_0x233c19);})['then'](function(_0x29afca){if(_0x29afca){var _0x245504=0xc8;var _0x4dd83f='receiveMessage';logger[_0xbddb('0x24')](_0xbddb('0xb2'),_0x4dd83f,_0x245504,_0xbddb('0xb3'));logger[_0xbddb('0xb4')](_0xbddb('0xb5'),_0x4dd83f,_0x245504,'entity\x20found',JSON[_0xbddb('0x27')](_0x29afca));if(_0x233c19['account'][_0xbddb('0x45')]===_0xbddb('0x81')){return _0x1e1b70[_0xbddb('0x2d')](_0x245504)['set'](_0xbddb('0xb6'),_0xbddb('0xb7'))['send'](_0xbddb('0xb8'));}else{return _0x1e1b70[_0xbddb('0x2d')](_0x245504)[_0xbddb('0x2f')](_0x29afca);}}})[_0xbddb('0x2b')](handleError(_0x1e1b70,null));};exports[_0xbddb('0xb9')]=function(_0x15b0c1,_0x245b8d,_0x440b4b){return db[_0xbddb('0x42')][_0xbddb('0x6b')]({'where':{'id':_0x15b0c1['params']['id']}})['then'](handleEntityNotFound(_0x245b8d,null))[_0xbddb('0x23')](function(_0x5edbdd){if(_0x5edbdd){return db[_0xbddb('0xba')][_0xbddb('0xbb')](function(_0x4f2ecb){return db[_0xbddb('0xbc')][_0xbddb('0x38')]({'where':{'SmsAccountId':_0x15b0c1['params']['id']},'transaction':_0x4f2ecb})[_0xbddb('0x23')](function(_0x50d8e0){var _0x14e74e=_[_0xbddb('0x41')](_0x15b0c1[_0xbddb('0x60')],function(_0xbe950d){_0xbe950d[_0xbddb('0x68')]=_0x15b0c1[_0xbddb('0x5c')]['id'];return _0xbe950d;});return db[_0xbddb('0xbc')]['bulkCreate'](_0x14e74e,{'transaction':_0x4f2ecb});});})[_0xbddb('0x23')](function(){return db[_0xbddb('0xbc')][_0xbddb('0xbd')]({'where':{'SmsAccountId':_0x15b0c1['params']['id']},'order':_0xbddb('0xbe')});});}})[_0xbddb('0x23')](respondWithResult(_0x245b8d,null))[_0xbddb('0x2b')](handleError(_0x245b8d,null));};exports['getApplications']=function(_0x5581b4,_0x24b608,_0x2efea2){var _0x574959={};var _0x357b30={};var _0x30f0f7;var _0x1561a3;return db[_0xbddb('0x42')][_0xbddb('0x6b')]({'where':{'id':_0x5581b4[_0xbddb('0x5c')]['id']}})[_0xbddb('0x23')](handleEntityNotFound(_0x24b608,null))[_0xbddb('0x23')](function(_0x2cfd08){if(_0x2cfd08){_0x30f0f7=_0x2cfd08;_0x357b30[_0xbddb('0x47')]=_[_0xbddb('0x6c')](db['SmsApplication'][_0xbddb('0x43')]);_0x357b30[_0xbddb('0x48')]=_['keys'](_0x5581b4[_0xbddb('0x48')]);_0x357b30['filters']=_[_0xbddb('0x4a')](_0x357b30[_0xbddb('0x47')],_0x357b30[_0xbddb('0x48')]);_0x574959[_0xbddb('0x4c')]=_[_0xbddb('0x4a')](_0x357b30[_0xbddb('0x47')],qs[_0xbddb('0x4b')](_0x5581b4[_0xbddb('0x48')][_0xbddb('0x4b')]));_0x574959[_0xbddb('0x4c')]=_0x574959['attributes'][_0xbddb('0x4d')]?_0x574959['attributes']:_0x357b30[_0xbddb('0x47')];_0x574959['order']=qs['sort'](_0x5581b4[_0xbddb('0x48')][_0xbddb('0x51')]);_0x574959[_0xbddb('0x53')]=qs[_0xbddb('0x49')](_[_0xbddb('0x52')](_0x5581b4[_0xbddb('0x48')],_0x357b30[_0xbddb('0x49')]));if(_0x5581b4[_0xbddb('0x48')]['filter']){_0x574959['where']=_[_0xbddb('0x56')](_0x574959['where'],{'$or':_[_0xbddb('0x41')](_0x574959['attributes'],function(_0x418e4d){var _0x52539a={};_0x52539a[_0x418e4d]={'$like':'%'+_0x5581b4[_0xbddb('0x48')]['filter']+'%'};return _0x52539a;})});}_0x574959=_['merge']({},_0x574959,_0x5581b4[_0xbddb('0x5d')]);return _0x30f0f7[_0xbddb('0xbf')](_0x574959);}})[_0xbddb('0x23')](function(_0x56c180){if(_0x56c180){_0x1561a3=_0x56c180[_0xbddb('0x4d')];if(!_0x5581b4[_0xbddb('0x48')]['hasOwnProperty']('nolimit')){_0x574959[_0xbddb('0x32')]=qs['limit'](_0x5581b4[_0xbddb('0x48')][_0xbddb('0x32')]);_0x574959['offset']=qs[_0xbddb('0x30')](_0x5581b4[_0xbddb('0x48')][_0xbddb('0x30')]);}return _0x30f0f7[_0xbddb('0xbf')](_0x574959);}})[_0xbddb('0x23')](function(_0x8d534c){if(_0x8d534c){return _0x8d534c?{'count':_0x1561a3,'rows':_0x8d534c}:null;}})['then'](respondWithResult(_0x24b608,null))[_0xbddb('0x2b')](handleError(_0x24b608,null));};exports['getInteractions']=function(_0x2906f3,_0x31bd22,_0x4bd426){var _0x3ccd41={'raw':![],'where':{}};var _0x4733ac={};var _0x26bf59={'count':0x0,'rows':[]};return db[_0xbddb('0x42')][_0xbddb('0x6b')]({'where':{'id':_0x2906f3[_0xbddb('0x5c')]['id']}})[_0xbddb('0x23')](handleEntityNotFound(_0x31bd22,null))[_0xbddb('0x23')](function(_0xc6281b){if(_0xc6281b){_0x4733ac['model']=_[_0xbddb('0x6c')](db[_0xbddb('0xc0')][_0xbddb('0x43')]);_0x4733ac[_0xbddb('0x48')]=_[_0xbddb('0x6c')](_0x2906f3['query']);_0x4733ac['filters']=_[_0xbddb('0x4a')](_0x4733ac['model'],_0x4733ac[_0xbddb('0x48')]);_0x3ccd41[_0xbddb('0x4c')]=_[_0xbddb('0x4a')](_0x4733ac[_0xbddb('0x47')],qs[_0xbddb('0x4b')](_0x2906f3[_0xbddb('0x48')][_0xbddb('0x4b')]));_0x3ccd41[_0xbddb('0x4c')]=_0x3ccd41[_0xbddb('0x4c')][_0xbddb('0x4d')]?_0x3ccd41['attributes']:_0x4733ac['model'];if(!_0x2906f3[_0xbddb('0x48')][_0xbddb('0x4e')](_0xbddb('0x4f'))){_0x3ccd41['limit']=qs[_0xbddb('0x32')](_0x2906f3['query']['limit']);_0x3ccd41[_0xbddb('0x30')]=qs['offset'](_0x2906f3[_0xbddb('0x48')]['offset']);}_0x3ccd41[_0xbddb('0x50')]=qs[_0xbddb('0x51')](_0x2906f3[_0xbddb('0x48')][_0xbddb('0x51')]);_0x3ccd41[_0xbddb('0x53')]=qs[_0xbddb('0x49')](_[_0xbddb('0x52')](_0x2906f3[_0xbddb('0x48')],_0x4733ac[_0xbddb('0x49')]));_0x3ccd41['where'][_0xbddb('0x68')]=_0xc6281b['id'];if(_0x2906f3[_0xbddb('0x48')][_0xbddb('0x55')]){_0x3ccd41['where']=_['merge'](_0x3ccd41['where'],{'$or':_[_0xbddb('0x41')](_0x3ccd41[_0xbddb('0x4c')],function(_0x4e29d3){var _0x2e86ed={};_0x2e86ed[_0x4e29d3]={'$like':'%'+_0x2906f3[_0xbddb('0x48')][_0xbddb('0x55')]+'%'};return _0x2e86ed;})});}_0x3ccd41=_[_0xbddb('0x56')]({},_0x3ccd41,_0x2906f3[_0xbddb('0x5d')]);return db[_0xbddb('0xc0')]['count']({'where':_0x3ccd41[_0xbddb('0x53')]})[_0xbddb('0x23')](function(_0x185f83){_0x26bf59[_0xbddb('0x33')]=_0x185f83;if(_0x2906f3[_0xbddb('0x48')][_0xbddb('0x57')]){_0x3ccd41['include']=[{'model':db[_0xbddb('0x9e')],'as':'Contact','required':![]},{'model':db['User'],'as':_0xbddb('0xc1'),'attributes':[_0xbddb('0x3c'),_0xbddb('0xc2'),_0xbddb('0xc3')],'required':![]},{'model':db['Tag'],'as':_0xbddb('0xc4'),'attributes':['id',_0xbddb('0x3c'),_0xbddb('0xc5')],'where':_0x2906f3['query']['tag']?{'id':_0x2906f3['query']['tag']}:undefined,'required':_0x2906f3[_0xbddb('0x48')][_0xbddb('0xc6')]?!![]:![]}];}return db[_0xbddb('0xc0')][_0xbddb('0x59')](_0x3ccd41);})['then'](function(_0x3e1ce3){_0x26bf59[_0xbddb('0x5a')]=_0x3e1ce3;return _0x26bf59;});}})[_0xbddb('0x23')](respondWithFilteredResult(_0x31bd22,_0x3ccd41))['catch'](handleError(_0x31bd22,null));};exports['send']=function(_0x5b2a9a,_0x2d7e9e,_0x30c42a){var _0xdc27f4,_0xa62a05,_0x21eff0;if(_[_0xbddb('0x98')](_0x5b2a9a[_0xbddb('0x60')][_0xbddb('0x60')])||_0x5b2a9a[_0xbddb('0x60')][_0xbddb('0x60')]===''){throw new db[(_0xbddb('0x79'))][(_0xbddb('0x7a'))](_0xbddb('0x99'));}if(_[_0xbddb('0x98')](_0x5b2a9a[_0xbddb('0x60')]['to'])){throw new db['Sequelize']['ValidationError'](_0xbddb('0xc7'));}_0xdc27f4=_0x5b2a9a[_0xbddb('0x60')]['to'];return db[_0xbddb('0x42')][_0xbddb('0x5e')]({'where':{'id':_0x5b2a9a[_0xbddb('0x5c')]['id']},'include':[{'model':db[_0xbddb('0x9d')],'as':_0xbddb('0xc8'),'include':[{'model':db[_0xbddb('0x9e')],'as':_0xbddb('0x9f'),'where':{'mobile':_0xdc27f4},'limit':0x1,'order':[[_0xbddb('0x7c'),_0xbddb('0xa0')]]}]}]})[_0xbddb('0x23')](handleEntityNotFound(_0x2d7e9e,null))[_0xbddb('0x23')](function(_0x40243f){if(_0x40243f&&_0x40243f[_0xbddb('0xc8')]){_0xa62a05=_0x40243f['get']({'plain':!![]});if(_0xa62a05['List']&&_0xa62a05[_0xbddb('0xc8')][_0xbddb('0x9f')][_0xbddb('0x4d')]){return _0xa62a05[_0xbddb('0xc8')][_0xbddb('0x9f')][0x0];}return db[_0xbddb('0x9e')]['create'](_[_0xbddb('0x1c')](_0x5b2a9a[_0xbddb('0x60')],{'firstName':_0xdc27f4,'mobile':_0xdc27f4,'phone':_0xdc27f4,'ListId':_0xa62a05[_0xbddb('0x7f')]}));}})[_0xbddb('0x23')](handleEntityNotFound(_0x2d7e9e,null))['then'](function(_0x1ccc6a){if(_0x1ccc6a){_0x21eff0=_0x1ccc6a;return db['SmsInteraction']['find']({'where':{'ContactId':_0x21eff0['id'],'closed':![],'SmsAccountId':_0xa62a05['id']}})[_0xbddb('0x23')](function(_0x452587){if(_0x452587){return[_0x452587,![]];}return db[_0xbddb('0xc0')][_0xbddb('0x5f')]({'UserId':_0x5b2a9a['user']['id'],'ContactId':_0x21eff0['id'],'SmsAccountId':_0xa62a05['id'],'phone':_0xdc27f4,'firstMsgDirection':_0xbddb('0xc9'),'Messages':[_[_0xbddb('0x56')](_0x5b2a9a[_0xbddb('0x60')],{'read':![],'body':_0x5b2a9a['body'][_0xbddb('0x60')],'phone':_0xdc27f4,'SmsAccountId':_0xa62a05['id'],'UserId':_0x5b2a9a['user']['id'],'ContactId':_0x21eff0['id']})]},{'include':[{'model':db[_0xbddb('0xa9')],'as':_0xbddb('0xca')}]})[_0xbddb('0x23')](function(_0x4a7d71){return[_0x4a7d71,!![]];});});}})[_0xbddb('0xa3')](function(_0x3f2076,_0x3be9d2){if(_0x3be9d2){return _0x3f2076;}return db[_0xbddb('0xa9')][_0xbddb('0x5f')](_['merge'](_0x5b2a9a['body'],{'read':![],'body':_0x5b2a9a['body'][_0xbddb('0x60')],'phone':_0xdc27f4,'SmsAccountId':_0xa62a05['id'],'SmsInteractionId':_0x3f2076['id'],'UserId':_0x5b2a9a['user']['id'],'ContactId':_0x21eff0['id']}))[_0xbddb('0x23')](function(_0xef947d){_0x3f2076[_0xbddb('0xcb')]['Messages']=[];_0x3f2076[_0xbddb('0xcb')][_0xbddb('0xca')][_0xbddb('0xa6')](_0xef947d[_0xbddb('0xcb')]);return _0x3f2076;});})[_0xbddb('0x23')](respondWithResult(_0x2d7e9e,null))[_0xbddb('0x2b')](handleError(_0x2d7e9e,null));};exports[_0xbddb('0x2d')]=function(_0x1ed702,_0x242ddb,_0x11a954){if(_0x1ed702[_0xbddb('0x60')]['id']){delete _0x1ed702[_0xbddb('0x60')]['id'];}var _0x5bef63,_0x3b802b,_0xcbd49;return db[_0xbddb('0x42')][_0xbddb('0x5e')]({'where':{'id':_0x1ed702[_0xbddb('0x5c')]['id']}})[_0xbddb('0x23')](handleEntityNotFound(_0x242ddb,null))[_0xbddb('0x23')](function(_0x2fdd5d){if(_0x2fdd5d){_0xcbd49=_0x2fdd5d;logger[_0xbddb('0xb4')](_0xbddb('0xb2'),_0xbddb('0x2d'),'received\x20delivery\x20report\x20from',_0x2fdd5d[_0xbddb('0x45')],util[_0xbddb('0xcc')](_0x1ed702[_0xbddb('0x60')],{'showHidden':![],'depth':null}));switch(_0x2fdd5d[_0xbddb('0x45')]){case _0xbddb('0xcd'):if(_0x1ed702[_0xbddb('0x60')][_0xbddb('0xce')]&&_0x1ed702[_0xbddb('0x60')]['status']){_0x3b802b=_0x1ed702[_0xbddb('0x60')][_0xbddb('0x2d')];return db[_0xbddb('0xa9')][_0xbddb('0x5e')]({'where':{'messageId':_0x1ed702['body'][_0xbddb('0xce')]}});}break;case _0xbddb('0x87'):if(_0x1ed702['body']['requestid']&&_0x1ed702[_0xbddb('0x60')][_0xbddb('0xcf')]){_0x3b802b=_0x1ed702['body'][_0xbddb('0xcf')];return db['SmsMessage'][_0xbddb('0x5e')]({'where':{'messageId':_0x1ed702[_0xbddb('0x60')][_0xbddb('0xd0')]}});}break;case _0xbddb('0x88'):if(_0x1ed702['body']['message_id']&&_0x1ed702[_0xbddb('0x60')][_0xbddb('0xd1')]){_0x3b802b=_0x1ed702['body'][_0xbddb('0xd1')];return db['SmsMessage'][_0xbddb('0x5e')]({'where':{'messageId':_0x1ed702[_0xbddb('0x60')]['message_id']}});}break;case _0xbddb('0x8d'):var _0x56ac37=_0x1ed702[_0xbddb('0x60')][_0xbddb('0x8e')][0x0];if(_0x56ac37[_0xbddb('0x83')]&&_0x56ac37['status'][_0xbddb('0xd2')]===_0xbddb('0xd3')){_0x3b802b=_0x56ac37[_0xbddb('0x2d')][_0xbddb('0xd2')];return db[_0xbddb('0xa9')][_0xbddb('0x5e')]({'where':{'messageId':_0x56ac37[_0xbddb('0x83')]}});}break;case _0xbddb('0x92'):if(_0x1ed702[_0xbddb('0x60')][_0xbddb('0x83')]&&_0x1ed702[_0xbddb('0x60')]['status']){_0x3b802b=_0x1ed702[_0xbddb('0x60')]['status'];return db[_0xbddb('0xa9')][_0xbddb('0x5e')]({'where':{'messageId':_0x1ed702[_0xbddb('0x60')][_0xbddb('0x83')]}});}break;case _0xbddb('0x95'):if(_0x1ed702[_0xbddb('0x60')][0x0]['message']['id']){_0x3b802b=_0x1ed702[_0xbddb('0x60')][0x0][_0xbddb('0x45')];return db['SmsMessage'][_0xbddb('0x5e')]({'where':{'messageId':_0x1ed702[_0xbddb('0x60')][0x0][_0xbddb('0x2a')]['id']}});}break;case _0xbddb('0x96'):if(_0x1ed702['body'][_0xbddb('0xd4')]&&_0x1ed702['body'][_0xbddb('0x2d')]){_0x3b802b=_0x1ed702['body']['status'];return db['SmsMessage'][_0xbddb('0x5e')]({'where':{'messageId':_0x1ed702[_0xbddb('0x60')]['redif']}});}break;}}})['then'](handleEntityNotFound(_0x242ddb,null))['then'](function(_0x5bc601){if(_0x5bc601){_0x5bef63=_0x5bc601;switch(_0xcbd49['type']){case _0xbddb('0xcd'):if(_0x3b802b===_0xbddb('0xd3')){return _0x5bef63[_0xbddb('0x37')]({'read':!![]});}else{logger[_0xbddb('0x28')](_0xbddb('0xb2'),_0xbddb('0x2d'),_0xbddb('0xcd'),util[_0xbddb('0xcc')](_0x1ed702[_0xbddb('0x60')],{'showHidden':![],'depth':null}));}break;case _0xbddb('0x87'):if(_0x3b802b==='1'){return _0x5bef63[_0xbddb('0x37')]({'read':!![]});}else{logger['error'](_0xbddb('0xb2'),_0xbddb('0x2d'),'skebby',util[_0xbddb('0xcc')](_0x1ed702[_0xbddb('0x60')],{'showHidden':![],'depth':null}));}break;case _0xbddb('0x88'):if(!_0x1ed702[_0xbddb('0x60')]['error_code']&&_0x3b802b>=0xc8&&_0x3b802b<=0xce){return _0x5bef63['update']({'read':!![]});}else{logger['error'](_0xbddb('0xb2'),_0xbddb('0x2d'),'clicksend',util[_0xbddb('0xcc')](_0x1ed702[_0xbddb('0x60')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x1cfbc4=_0x1ed702[_0xbddb('0x60')][_0xbddb('0x8e')][0x0];if(_0x1cfbc4[_0xbddb('0x2d')][_0xbddb('0xd2')]===_0xbddb('0xd3')){return _0x5bef63[_0xbddb('0x37')]({'read':!![]});}else{logger[_0xbddb('0x28')](_0xbddb('0xb2'),_0xbddb('0x2d'),_0xbddb('0x8d'),util['inspect'](_0x1ed702[_0xbddb('0x60')],{'showHidden':![],'depth':null}));}break;case _0xbddb('0x92'):if(_0x3b802b==_0xbddb('0xd5')||_0x3b802b==_0xbddb('0xd6')){return _0x5bef63[_0xbddb('0x37')]({'read':!![]});}else{logger['error'](_0xbddb('0xb2'),_0xbddb('0x2d'),_0xbddb('0x92'),util[_0xbddb('0xcc')](_0x1ed702['body'],{'showHidden':![],'depth':null}));}break;case _0xbddb('0x95'):if(_0x3b802b==_0xbddb('0xd7')){return _0x5bef63['update']({'read':!![]});}else{logger[_0xbddb('0x28')](_0xbddb('0xb2'),_0xbddb('0x2d'),'bandwidth',util[_0xbddb('0xcc')](_0x1ed702[_0xbddb('0x60')],{'showHidden':![],'depth':null}));}break;case _0xbddb('0x96'):if(_0x3b802b==='DELIVRD'||_0x3b802b===_0xbddb('0xd8')){return _0x5bef63[_0xbddb('0x37')]({'read':!![]});}else{logger['error'](_0xbddb('0xb2'),_0xbddb('0x2d'),_0xbddb('0x96'),util['inspect'](_0x1ed702[_0xbddb('0x60')],{'showHidden':![],'depth':null}));}break;}return _0x5bef63;}})[_0xbddb('0x23')](respondWithResult(_0x242ddb,null))['catch'](handleError(_0x242ddb,null));};exports['statusGet']=function(_0x91083,_0x3b56c2,_0x546902){var _0x4b0352,_0x3d9a6d,_0x101f9b;return db[_0xbddb('0x42')]['find']({'where':{'id':_0x91083[_0xbddb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3b56c2,null))[_0xbddb('0x23')](function(_0x48ea71){if(_0x48ea71){_0x101f9b=_0x48ea71;logger['debug'](_0xbddb('0xb2'),_0xbddb('0x2d'),_0xbddb('0xd9'),_0x48ea71[_0xbddb('0x45')],util[_0xbddb('0xcc')](_0x91083[_0xbddb('0x48')],{'showHidden':![],'depth':null}));switch(_0x48ea71[_0xbddb('0x45')]){case _0xbddb('0x8f'):if(_0x91083[_0xbddb('0x48')][_0xbddb('0xda')]&&_0x91083[_0xbddb('0x48')]['state']){_0x3d9a6d=_0x91083[_0xbddb('0x48')][_0xbddb('0xdb')];return db['SmsMessage'][_0xbddb('0x5e')]({'where':{'messageId':_0x91083[_0xbddb('0x48')][_0xbddb('0xda')]}});}break;}}})[_0xbddb('0x23')](handleEntityNotFound(_0x3b56c2,null))[_0xbddb('0x23')](function(_0x2580b2){if(_0x2580b2){_0x4b0352=_0x2580b2;switch(_0x101f9b[_0xbddb('0x45')]){case'csc':if(_0x3d9a6d==='2'||_0x3d9a6d==='6'){return _0x4b0352[_0xbddb('0x37')]({'read':!![]});}else{logger[_0xbddb('0x28')](_0xbddb('0xb2'),_0xbddb('0x2d'),_0xbddb('0x8f'),util[_0xbddb('0xcc')](_0x91083[_0xbddb('0x48')],{'showHidden':![],'depth':null}));};break;}return _0x4b0352;}})[_0xbddb('0x23')](respondWithResult(_0x3b56c2,null))[_0xbddb('0x2b')](handleError(_0x3b56c2,null));};exports[_0xbddb('0xdc')]=function(_0x325019,_0x50424d,_0x24c29c){return db[_0xbddb('0x42')][_0xbddb('0x5e')]({'where':{'id':_0x325019[_0xbddb('0x5c')]['id']}})[_0xbddb('0x23')](handleEntityNotFound(_0x50424d,null))['then'](function(_0x3fa484){if(_0x3fa484){return _0x3fa484[_0xbddb('0xdc')](_0x325019[_0xbddb('0x60')][_0xbddb('0x71')],_[_0xbddb('0xa1')](_0x325019[_0xbddb('0x60')],[_0xbddb('0x71'),'id'])||{})[_0xbddb('0xa3')](function(_0x3b9306){for(var _0x389ead=0x0;_0x389ead<_0x325019['body'][_0xbddb('0x71')][_0xbddb('0x4d')];_0x389ead+=0x1){socket[_0xbddb('0xdd')](_0xbddb('0xde'),{'UserId':Number(_0x325019[_0xbddb('0x60')][_0xbddb('0x71')][_0x389ead]),'SmsAccountId':Number(_0x325019['params']['id'])});}return _0x3b9306;});}})['then'](respondWithResult(_0x50424d,null))[_0xbddb('0x2b')](handleError(_0x50424d,null));};exports[_0xbddb('0xdf')]=function(_0x3b65ff,_0x432e24,_0x57e36c){return db['SmsAccount'][_0xbddb('0x5e')]({'where':{'id':_0x3b65ff[_0xbddb('0x5c')]['id']}})['then'](handleEntityNotFound(_0x432e24,null))[_0xbddb('0x23')](function(_0x2d1164){if(_0x2d1164){return _0x2d1164[_0xbddb('0xdf')](_0x3b65ff[_0xbddb('0x48')][_0xbddb('0x71')])[_0xbddb('0x23')](function(){if(_[_0xbddb('0xe0')](_0x3b65ff['query'][_0xbddb('0x71')])){for(var _0x1d89a1=0x0;_0x1d89a1<_0x3b65ff[_0xbddb('0x48')][_0xbddb('0x71')]['length'];_0x1d89a1+=0x1){socket['emit'](_0xbddb('0xe1'),{'UserId':Number(_0x3b65ff['query'][_0xbddb('0x71')][_0x1d89a1]),'SmsAccountId':Number(_0x3b65ff[_0xbddb('0x5c')]['id'])});}}else{socket['emit'](_0xbddb('0xe1'),{'UserId':Number(_0x3b65ff['query'][_0xbddb('0x71')]),'SmsAccountId':Number(_0x3b65ff[_0xbddb('0x5c')]['id'])});}});}})[_0xbddb('0x23')](respondWithStatusCode(_0x432e24,null))['catch'](handleError(_0x432e24,null));};exports[_0xbddb('0xe2')]=function(_0x360aa6,_0x17bc83,_0x2f4efd){var _0x27382a={};var _0x113d9d={};var _0xe3f5dc;var _0x348b74;return db[_0xbddb('0x42')][_0xbddb('0x6b')]({'where':{'id':_0x360aa6[_0xbddb('0x5c')]['id']}})[_0xbddb('0x23')](handleEntityNotFound(_0x17bc83,null))[_0xbddb('0x23')](function(_0x37101d){if(_0x37101d){_0xe3f5dc=_0x37101d;_0x113d9d[_0xbddb('0x47')]=_[_0xbddb('0x6c')](db['User']['rawAttributes']);_0x113d9d[_0xbddb('0x48')]=_[_0xbddb('0x6c')](_0x360aa6[_0xbddb('0x48')]);_0x113d9d[_0xbddb('0x49')]=_[_0xbddb('0x4a')](_0x113d9d['model'],_0x113d9d[_0xbddb('0x48')]);_0x27382a[_0xbddb('0x4c')]=_['intersection'](_0x113d9d['model'],qs[_0xbddb('0x4b')](_0x360aa6[_0xbddb('0x48')][_0xbddb('0x4b')]));_0x27382a[_0xbddb('0x4c')]=_0x27382a[_0xbddb('0x4c')]['length']?_0x27382a['attributes']:_0x113d9d[_0xbddb('0x47')];_0x27382a[_0xbddb('0x50')]=qs['sort'](_0x360aa6[_0xbddb('0x48')]['sort']);_0x27382a[_0xbddb('0x53')]=qs[_0xbddb('0x49')](_[_0xbddb('0x52')](_0x360aa6[_0xbddb('0x48')],_0x113d9d[_0xbddb('0x49')]));if(_0x360aa6[_0xbddb('0x48')][_0xbddb('0x55')]){_0x27382a[_0xbddb('0x53')]=_[_0xbddb('0x56')](_0x27382a[_0xbddb('0x53')],{'$or':_['map'](_0x27382a[_0xbddb('0x4c')],function(_0x129302){var _0xdb1944={};_0xdb1944[_0x129302]={'$like':'%'+_0x360aa6[_0xbddb('0x48')][_0xbddb('0x55')]+'%'};return _0xdb1944;})});}_0x27382a=_[_0xbddb('0x56')]({},_0x27382a,_0x360aa6[_0xbddb('0x5d')]);return _0xe3f5dc[_0xbddb('0xe2')](_0x27382a);}})[_0xbddb('0x23')](function(_0x459449){if(_0x459449){_0x348b74=_0x459449[_0xbddb('0x4d')];if(!_0x360aa6[_0xbddb('0x48')][_0xbddb('0x4e')](_0xbddb('0x4f'))){_0x27382a[_0xbddb('0x32')]=qs['limit'](_0x360aa6[_0xbddb('0x48')][_0xbddb('0x32')]);_0x27382a[_0xbddb('0x30')]=qs[_0xbddb('0x30')](_0x360aa6[_0xbddb('0x48')]['offset']);}return _0xe3f5dc[_0xbddb('0xe2')](_0x27382a);}})[_0xbddb('0x23')](function(_0x4411fd){if(_0x4411fd){return _0x4411fd?{'count':_0x348b74,'rows':_0x4411fd}:null;}})['then'](respondWithResult(_0x17bc83,null))[_0xbddb('0x2b')](handleError(_0x17bc83,null));};
\ No newline at end of file
index 61f86fe..276d992 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa861=['events','SmsAccount','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xa861,0xa8));var _0x1a86=function(_0x31a938,_0x4daec6){_0x31a938=_0x31a938-0x0;var _0x1bf341=_0xa861[_0x31a938];return _0x1bf341;};'use strict';var EventEmitter=require(_0x1a86('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x1a86('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1a86('0x2'),'afterUpdate':_0x1a86('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2cf4f6){return function(_0x21cce8,_0x3491ec,_0x4a3b3b){SmsAccountEvents[_0x1a86('0x4')](_0x2cf4f6+':'+_0x21cce8['id'],_0x21cce8);SmsAccountEvents['emit'](_0x2cf4f6,_0x21cce8);_0x4a3b3b(null);};}for(var e in events){if(events[_0x1a86('0x5')](e)){var event=events[e];SmsAccount[_0x1a86('0x6')](e,emitEvent(event));}}module[_0x1a86('0x7')]=SmsAccountEvents;
\ No newline at end of file
+var _0x5d2f=['remove','emit','hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners','save','update'];(function(_0x2a98c8,_0x812400){var _0x156121=function(_0x335af7){while(--_0x335af7){_0x2a98c8['push'](_0x2a98c8['shift']());}};_0x156121(++_0x812400);}(_0x5d2f,0x7c));var _0xf5d2=function(_0x135a1c,_0x28b5f6){_0x135a1c=_0x135a1c-0x0;var _0x295c98=_0x5d2f[_0x135a1c];return _0x295c98;};'use strict';var EventEmitter=require(_0xf5d2('0x0'));var SmsAccount=require(_0xf5d2('0x1'))['db'][_0xf5d2('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xf5d2('0x3')](0x0);var events={'afterCreate':_0xf5d2('0x4'),'afterUpdate':_0xf5d2('0x5'),'afterDestroy':_0xf5d2('0x6')};function emitEvent(_0x26237c){return function(_0x4a4869,_0x52ac74,_0x590f8c){SmsAccountEvents['emit'](_0x26237c+':'+_0x4a4869['id'],_0x4a4869);SmsAccountEvents[_0xf5d2('0x7')](_0x26237c,_0x4a4869);_0x590f8c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xf5d2('0x8')](e,emitEvent(event));}}module[_0xf5d2('0x9')]=SmsAccountEvents;
\ No newline at end of file
index 1d0f833..4302cf6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e36=['bluebird','request-promise','rimraf','exports','SmsAccount','lodash','util','../../config/logger','api','moment'];(function(_0x2e5a33,_0x2e768c){var _0x1f5221=function(_0x29f9df){while(--_0x29f9df){_0x2e5a33['push'](_0x2e5a33['shift']());}};_0x1f5221(++_0x2e768c);}(_0x6e36,0xeb));var _0x66e3=function(_0x217f30,_0x214ec2){_0x217f30=_0x217f30-0x0;var _0x551715=_0x6e36[_0x217f30];return _0x551715;};'use strict';var _=require(_0x66e3('0x0'));var util=require(_0x66e3('0x1'));var logger=require(_0x66e3('0x2'))(_0x66e3('0x3'));var moment=require(_0x66e3('0x4'));var BPromise=require(_0x66e3('0x5'));var rp=require(_0x66e3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x66e3('0x7'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module[_0x66e3('0x8')]=function(_0x3d1465,_0x45698c){return _0x3d1465['define'](_0x66e3('0x9'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe5d1=['exports','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','./smsAccount.attributes'];(function(_0x4ef3ff,_0x4fc675){var _0x420e01=function(_0xff3d7f){while(--_0xff3d7f){_0x4ef3ff['push'](_0x4ef3ff['shift']());}};_0x420e01(++_0x4fc675);}(_0xe5d1,0x1e7));var _0x1e5d=function(_0x3df871,_0xda2e11){_0x3df871=_0x3df871-0x0;var _0x570f7b=_0xe5d1[_0x3df871];return _0x570f7b;};'use strict';var _=require(_0x1e5d('0x0'));var util=require(_0x1e5d('0x1'));var logger=require(_0x1e5d('0x2'))(_0x1e5d('0x3'));var moment=require(_0x1e5d('0x4'));var BPromise=require(_0x1e5d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e5d('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1e5d('0x7'));module[_0x1e5d('0x8')]=function(_0x486fbe,_0x229d30){return _0x486fbe['define'](_0x1e5d('0x9'),attributes,{'tableName':_0x1e5d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 16e4ef4..fbf98de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe71a=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','then','info','request\x20sent','debug','stringify','error','SmsAccount,\x20%s,\x20%s','message','catch','ShowSmsAccount','SmsAccount','find','options','raw','where','include','model','attributes','map','util','moment','bluebird','randomstring'];(function(_0x2170e3,_0x39d8c4){var _0x4b1363=function(_0x1dd4c1){while(--_0x1dd4c1){_0x2170e3['push'](_0x2170e3['shift']());}};_0x4b1363(++_0x39d8c4);}(_0xe71a,0xf1));var _0xae71=function(_0x552e90,_0x55534a){_0x552e90=_0x552e90-0x0;var _0x151c86=_0xe71a[_0x552e90];return _0x151c86;};'use strict';var _=require('lodash');var util=require(_0xae71('0x0'));var moment=require(_0xae71('0x1'));var BPromise=require(_0xae71('0x2'));var rs=require(_0xae71('0x3'));var fs=require('fs');var Redis=require(_0xae71('0x4'));var db=require(_0xae71('0x5'))['db'];var utils=require(_0xae71('0x6'));var logger=require(_0xae71('0x7'))('rpc');var config=require(_0xae71('0x8'));var jayson=require(_0xae71('0x9'));var client=jayson[_0xae71('0xa')][_0xae71('0xb')]({'port':0x232a});config[_0xae71('0xc')]=_[_0xae71('0xd')](config[_0xae71('0xc')],{'host':_0xae71('0xe'),'port':0x18eb});var socket=require(_0xae71('0xf'))(new Redis(config[_0xae71('0xc')]));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x5e3a04,_0x324fcf,_0x1e65cc){return new BPromise(function(_0x29bc08,_0x48baff){return client['request'](_0x5e3a04,_0x1e65cc)[_0xae71('0x10')](function(_0x115bd7){logger[_0xae71('0x11')]('SmsAccount,\x20%s,\x20%s',_0x324fcf,_0xae71('0x12'));logger[_0xae71('0x13')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x324fcf,_0xae71('0x12'),JSON[_0xae71('0x14')](_0x115bd7));if(_0x115bd7['error']){if(_0x115bd7['error']['code']===0x1f4){logger[_0xae71('0x15')](_0xae71('0x16'),_0x324fcf,_0x115bd7[_0xae71('0x15')][_0xae71('0x17')]);return _0x48baff(_0x115bd7['error'][_0xae71('0x17')]);}logger[_0xae71('0x15')](_0xae71('0x16'),_0x324fcf,_0x115bd7[_0xae71('0x15')][_0xae71('0x17')]);return _0x29bc08(_0x115bd7[_0xae71('0x15')]['message']);}else{logger[_0xae71('0x11')](_0xae71('0x16'),_0x324fcf,_0xae71('0x12'));_0x29bc08(_0x115bd7['result'][_0xae71('0x17')]);}})[_0xae71('0x18')](function(_0x4d7380){logger[_0xae71('0x15')](_0xae71('0x16'),_0x324fcf,_0x4d7380);_0x48baff(_0x4d7380);});});}exports[_0xae71('0x19')]=function(_0x29314e){var _0x3d4559=this;return new Promise(function(_0x89cf84,_0x3cba90){return db[_0xae71('0x1a')][_0xae71('0x1b')]({'raw':_0x29314e['options']?_0x29314e[_0xae71('0x1c')][_0xae71('0x1d')]===undefined?!![]:![]:!![],'where':_0x29314e[_0xae71('0x1c')]?_0x29314e[_0xae71('0x1c')][_0xae71('0x1e')]||null:null,'attributes':_0x29314e[_0xae71('0x1c')]?_0x29314e[_0xae71('0x1c')]['attributes']||null:null,'include':_0x29314e[_0xae71('0x1c')]?_0x29314e[_0xae71('0x1c')]['include']?_['map'](_0x29314e[_0xae71('0x1c')][_0xae71('0x1f')],function(_0x3c8579){return{'model':db[_0x3c8579[_0xae71('0x20')]],'as':_0x3c8579['as'],'attributes':_0x3c8579[_0xae71('0x21')],'include':_0x3c8579[_0xae71('0x1f')]?_[_0xae71('0x22')](_0x3c8579[_0xae71('0x1f')],function(_0x1e3279){return{'model':db[_0x1e3279[_0xae71('0x20')]],'as':_0x1e3279['as'],'attributes':_0x1e3279['attributes'],'include':_0x1e3279['include']?_[_0xae71('0x22')](_0x1e3279['include'],function(_0x409135){return{'model':db[_0x409135[_0xae71('0x20')]],'as':_0x409135['as'],'attributes':_0x409135[_0xae71('0x21')]};}):[]};}):[]};}):[]:[]})[_0xae71('0x10')](function(_0x47549e){logger[_0xae71('0x11')](_0xae71('0x19'),_0x29314e);logger[_0xae71('0x13')](_0xae71('0x19'),_0x29314e,JSON[_0xae71('0x14')](_0x47549e));_0x89cf84(_0x47549e);})[_0xae71('0x18')](function(_0x58da19){logger[_0xae71('0x15')](_0xae71('0x19'),_0x58da19[_0xae71('0x17')],_0x29314e);_0x3cba90(_0x3d4559['error'](0x1f4,_0x58da19[_0xae71('0x17')]));});});};
\ No newline at end of file
+var _0x8cf8=['request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','ShowSmsAccount','SmsAccount','find','options','where','attributes','include','map','then','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','defaults','redis','localhost','register','request','SmsAccount,\x20%s,\x20%s'];(function(_0x39008d,_0x5c672d){var _0x4366fc=function(_0x5c6566){while(--_0x5c6566){_0x39008d['push'](_0x39008d['shift']());}};_0x4366fc(++_0x5c672d);}(_0x8cf8,0x172));var _0x88cf=function(_0x344096,_0x13a350){_0x344096=_0x344096-0x0;var _0x371256=_0x8cf8[_0x344096];return _0x371256;};'use strict';var _=require(_0x88cf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x88cf('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x88cf('0x2'))['db'];var utils=require(_0x88cf('0x3'));var logger=require(_0x88cf('0x4'))(_0x88cf('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x88cf('0x6')][_0x88cf('0x7')]({'port':0x232a});config['redis']=_[_0x88cf('0x8')](config[_0x88cf('0x9')],{'host':_0x88cf('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x88cf('0x9')]));require('./smsAccount.socket')[_0x88cf('0xb')](socket);function respondWithRpcPromise(_0x22db03,_0x5ea587,_0x5d4f6e){return new BPromise(function(_0x2ef215,_0x30eb4e){return client[_0x88cf('0xc')](_0x22db03,_0x5d4f6e)['then'](function(_0x2a7b65){logger['info'](_0x88cf('0xd'),_0x5ea587,_0x88cf('0xe'));logger[_0x88cf('0xf')](_0x88cf('0x10'),_0x5ea587,_0x88cf('0xe'),JSON[_0x88cf('0x11')](_0x2a7b65));if(_0x2a7b65[_0x88cf('0x12')]){if(_0x2a7b65['error'][_0x88cf('0x13')]===0x1f4){logger[_0x88cf('0x12')](_0x88cf('0xd'),_0x5ea587,_0x2a7b65[_0x88cf('0x12')][_0x88cf('0x14')]);return _0x30eb4e(_0x2a7b65[_0x88cf('0x12')][_0x88cf('0x14')]);}logger[_0x88cf('0x12')](_0x88cf('0xd'),_0x5ea587,_0x2a7b65[_0x88cf('0x12')]['message']);return _0x2ef215(_0x2a7b65[_0x88cf('0x12')][_0x88cf('0x14')]);}else{logger[_0x88cf('0x15')](_0x88cf('0xd'),_0x5ea587,'request\x20sent');_0x2ef215(_0x2a7b65['result'][_0x88cf('0x14')]);}})[_0x88cf('0x16')](function(_0x16eaa1){logger[_0x88cf('0x12')](_0x88cf('0xd'),_0x5ea587,_0x16eaa1);_0x30eb4e(_0x16eaa1);});});}exports[_0x88cf('0x17')]=function(_0x13dac6){var _0x2f372e=this;return new Promise(function(_0x3405c4,_0x27192d){return db[_0x88cf('0x18')][_0x88cf('0x19')]({'raw':_0x13dac6[_0x88cf('0x1a')]?_0x13dac6['options']['raw']===undefined?!![]:![]:!![],'where':_0x13dac6[_0x88cf('0x1a')]?_0x13dac6[_0x88cf('0x1a')][_0x88cf('0x1b')]||null:null,'attributes':_0x13dac6[_0x88cf('0x1a')]?_0x13dac6[_0x88cf('0x1a')][_0x88cf('0x1c')]||null:null,'include':_0x13dac6['options']?_0x13dac6[_0x88cf('0x1a')][_0x88cf('0x1d')]?_[_0x88cf('0x1e')](_0x13dac6[_0x88cf('0x1a')]['include'],function(_0x49cdc6){return{'model':db[_0x49cdc6['model']],'as':_0x49cdc6['as'],'attributes':_0x49cdc6[_0x88cf('0x1c')],'include':_0x49cdc6['include']?_[_0x88cf('0x1e')](_0x49cdc6[_0x88cf('0x1d')],function(_0x7f2b1b){return{'model':db[_0x7f2b1b['model']],'as':_0x7f2b1b['as'],'attributes':_0x7f2b1b[_0x88cf('0x1c')],'include':_0x7f2b1b[_0x88cf('0x1d')]?_[_0x88cf('0x1e')](_0x7f2b1b['include'],function(_0x5b0e90){return{'model':db[_0x5b0e90['model']],'as':_0x5b0e90['as'],'attributes':_0x5b0e90[_0x88cf('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x88cf('0x1f')](function(_0x2168ea){logger['info']('ShowSmsAccount',_0x13dac6);logger[_0x88cf('0xf')](_0x88cf('0x17'),_0x13dac6,JSON['stringify'](_0x2168ea));_0x3405c4(_0x2168ea);})[_0x88cf('0x16')](function(_0x3f4d9e){logger['error'](_0x88cf('0x17'),_0x3f4d9e[_0x88cf('0x14')],_0x13dac6);_0x27192d(_0x2f372e[_0x88cf('0x12')](0x1f4,_0x3f4d9e[_0x88cf('0x14')]));});});};
\ No newline at end of file
index f4d8032..44a1668 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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}};
\ No newline at end of file
index 4e73372..7f9986f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7217=['Router','fs-extra','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x1fd5c3,_0x101259){var _0x5666a2=function(_0x2299b5){while(--_0x2299b5){_0x1fd5c3['push'](_0x1fd5c3['shift']());}};_0x5666a2(++_0x101259);}(_0x7217,0x19e));var _0x7721=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x7217[_0x4dbaad];return _0x226c72;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router;
\ No newline at end of file
+var _0x008c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','post','put','/:id'];(function(_0x48bd15,_0x495dbe){var _0x376bcc=function(_0x59f737){while(--_0x59f737){_0x48bd15['push'](_0x48bd15['shift']());}};_0x376bcc(++_0x495dbe);}(_0x008c,0x188));var _0xc008=function(_0x56dc8c,_0x1b15ca){_0x56dc8c=_0x56dc8c-0x0;var _0x166838=_0x008c[_0x56dc8c];return _0x166838;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/:id',auth[_0xc008('0xb')](),controller['show']);router[_0xc008('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc008('0xe')](_0xc008('0xf'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xc008('0xf'),auth[_0xc008('0xb')](),controller['destroy']);module[_0xc008('0x10')]=router;
\ No newline at end of file
index 3bf84ca..33283fe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x139c=['*,*,*,*','exports','INTEGER','STRING','noop','TEXT'];(function(_0x478225,_0x1fc818){var _0x42116c=function(_0x409b9e){while(--_0x409b9e){_0x478225['push'](_0x478225['shift']());}};_0x42116c(++_0x1fc818);}(_0x139c,0x11b));var _0xc139=function(_0x5dee7f,_0x41f933){_0x5dee7f=_0x5dee7f-0x0;var _0x12f9eb=_0x139c[_0x5dee7f];return _0x12f9eb;};'use strict';var Sequelize=require('sequelize');module[_0xc139('0x0')]={'priority':{'type':Sequelize[_0xc139('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc139('0x2')],'allowNull':![],'defaultValue':_0xc139('0x3')},'appdata':{'type':Sequelize[_0xc139('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xc139('0x2')],'defaultValue':_0xc139('0x5')}};
\ No newline at end of file
+var _0xf3de=['noop','TEXT','STRING','sequelize','exports','INTEGER'];(function(_0x10df18,_0x13338c){var _0x1f9a1d=function(_0x3157f4){while(--_0x3157f4){_0x10df18['push'](_0x10df18['shift']());}};_0x1f9a1d(++_0x13338c);}(_0xf3de,0x1dd));var _0xef3d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf3de[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xef3d('0x0'));module[_0xef3d('0x1')]={'priority':{'type':Sequelize[_0xef3d('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xef3d('0x3')},'appdata':{'type':Sequelize[_0xef3d('0x4')]()},'description':{'type':Sequelize[_0xef3d('0x5')]},'interval':{'type':Sequelize[_0xef3d('0x5')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index ac6203e..72d96b9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd2a7=['SmsApplication','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','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','../../config/utils','../../config/environment','end','status','offset','undefined','count','limit','set','json','reject','save','update','destroy','sendStatus','error','stack','name','map'];(function(_0x1ac41c,_0x1dacbf){var _0x561d64=function(_0x2654df){while(--_0x2654df){_0x1ac41c['push'](_0x1ac41c['shift']());}};_0x561d64(++_0x1dacbf);}(_0xd2a7,0x14d));var _0x7d2a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2a7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7d2a('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7d2a('0x1'));var moment=require(_0x7d2a('0x2'));var BPromise=require(_0x7d2a('0x3'));var Mustache=require('mustache');var util=require(_0x7d2a('0x4'));var path=require(_0x7d2a('0x5'));var sox=require(_0x7d2a('0x6'));var csv=require(_0x7d2a('0x7'));var ejs=require(_0x7d2a('0x8'));var fs=require('fs');var fs_extra=require(_0x7d2a('0x9'));var _=require(_0x7d2a('0xa'));var squel=require(_0x7d2a('0xb'));var crypto=require(_0x7d2a('0xc'));var jsforce=require(_0x7d2a('0xd'));var deskjs=require(_0x7d2a('0xe'));var toCsv=require(_0x7d2a('0x7'));var querystring=require(_0x7d2a('0xf'));var Papa=require(_0x7d2a('0x10'));var Redis=require(_0x7d2a('0x11'));var authService=require(_0x7d2a('0x12'));var qs=require(_0x7d2a('0x13'));var as=require(_0x7d2a('0x14'));var hardwareService=require(_0x7d2a('0x15'));var logger=require(_0x7d2a('0x16'))('api');var utils=require(_0x7d2a('0x17'));var config=require(_0x7d2a('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5dd0da,_0x2c1457){_0x2c1457=_0x2c1457||0xcc;return function(_0x18b0bf){if(_0x18b0bf){return _0x5dd0da['sendStatus'](_0x2c1457);}return _0x5dd0da['status'](_0x2c1457)[_0x7d2a('0x19')]();};}function respondWithResult(_0x54a589,_0x5da6a8){_0x5da6a8=_0x5da6a8||0xc8;return function(_0x8624bf){if(_0x8624bf){return _0x54a589[_0x7d2a('0x1a')](_0x5da6a8)['json'](_0x8624bf);}};}function respondWithFilteredResult(_0x5c59d7,_0x5cc022){return function(_0x5d3c5e){if(_0x5d3c5e){var _0x14d66b=typeof _0x5cc022[_0x7d2a('0x1b')]===_0x7d2a('0x1c')&&typeof _0x5cc022['limit']===_0x7d2a('0x1c');var _0x40cfff=_0x5d3c5e[_0x7d2a('0x1d')];var _0x54a470=_0x14d66b?0x0:_0x5cc022['offset'];var _0x4b4d0d=_0x14d66b?_0x5d3c5e[_0x7d2a('0x1d')]:_0x5cc022[_0x7d2a('0x1b')]+_0x5cc022[_0x7d2a('0x1e')];var _0x306ff9;if(_0x4b4d0d>=_0x40cfff){_0x4b4d0d=_0x40cfff;_0x306ff9=0xc8;}else{_0x306ff9=0xce;}_0x5c59d7[_0x7d2a('0x1a')](_0x306ff9);return _0x5c59d7[_0x7d2a('0x1f')]('Content-Range',_0x54a470+'-'+_0x4b4d0d+'/'+_0x40cfff)[_0x7d2a('0x20')](_0x5d3c5e);}return null;};}function patchUpdates(_0x4bfa4f){return function(_0x10766e){try{jsonpatch['apply'](_0x10766e,_0x4bfa4f,!![]);}catch(_0x5bdc3f){return BPromise[_0x7d2a('0x21')](_0x5bdc3f);}return _0x10766e[_0x7d2a('0x22')]();};}function saveUpdates(_0x505d1b,_0x16321a){return function(_0x5850fb){if(_0x5850fb){return _0x5850fb[_0x7d2a('0x23')](_0x505d1b)['then'](function(_0x2de4b6){return _0x2de4b6;});}return null;};}function removeEntity(_0x4aad0e,_0x39dcf1){return function(_0x8301d3){if(_0x8301d3){return _0x8301d3[_0x7d2a('0x24')]()['then'](function(){_0x4aad0e[_0x7d2a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4277a7,_0x565568){return function(_0x1a2e43){if(!_0x1a2e43){_0x4277a7[_0x7d2a('0x25')](0x194);}return _0x1a2e43;};}function handleError(_0x1e0301,_0x1f095a){_0x1f095a=_0x1f095a||0x1f4;return function(_0x2b583c){logger[_0x7d2a('0x26')](_0x2b583c[_0x7d2a('0x27')]);if(_0x2b583c[_0x7d2a('0x28')]){delete _0x2b583c['name'];}_0x1e0301[_0x7d2a('0x1a')](_0x1f095a)['send'](_0x2b583c);};}exports['index']=function(_0x117f2d,_0x33292d){var _0x37c1c4={},_0x27a474={},_0x4a3fc1={'count':0x0,'rows':[]};var _0x29f7bd=_[_0x7d2a('0x29')](db[_0x7d2a('0x2a')][_0x7d2a('0x2b')],function(_0x105aeb){return{'name':_0x105aeb[_0x7d2a('0x2c')],'type':_0x105aeb[_0x7d2a('0x2d')][_0x7d2a('0x2e')]};});_0x27a474[_0x7d2a('0x2f')]=_[_0x7d2a('0x29')](_0x29f7bd,_0x7d2a('0x28'));_0x27a474[_0x7d2a('0x30')]=_['keys'](_0x117f2d['query']);_0x27a474[_0x7d2a('0x31')]=_[_0x7d2a('0x32')](_0x27a474[_0x7d2a('0x2f')],_0x27a474[_0x7d2a('0x30')]);_0x37c1c4['attributes']=_[_0x7d2a('0x32')](_0x27a474[_0x7d2a('0x2f')],qs[_0x7d2a('0x33')](_0x117f2d[_0x7d2a('0x30')][_0x7d2a('0x33')]));_0x37c1c4[_0x7d2a('0x34')]=_0x37c1c4['attributes'][_0x7d2a('0x35')]?_0x37c1c4[_0x7d2a('0x34')]:_0x27a474[_0x7d2a('0x2f')];if(!_0x117f2d[_0x7d2a('0x30')][_0x7d2a('0x36')]('nolimit')){_0x37c1c4[_0x7d2a('0x1e')]=qs[_0x7d2a('0x1e')](_0x117f2d[_0x7d2a('0x30')][_0x7d2a('0x1e')]);_0x37c1c4[_0x7d2a('0x1b')]=qs[_0x7d2a('0x1b')](_0x117f2d[_0x7d2a('0x30')]['offset']);}_0x37c1c4[_0x7d2a('0x37')]=qs[_0x7d2a('0x38')](_0x117f2d[_0x7d2a('0x30')]['sort']);_0x37c1c4['where']=qs[_0x7d2a('0x31')](_[_0x7d2a('0x39')](_0x117f2d[_0x7d2a('0x30')],_0x27a474['filters']),_0x29f7bd);if(_0x117f2d[_0x7d2a('0x30')][_0x7d2a('0x3a')]){_0x37c1c4[_0x7d2a('0x3b')]=_[_0x7d2a('0x3c')](_0x37c1c4[_0x7d2a('0x3b')],{'$or':_[_0x7d2a('0x29')](_0x29f7bd,function(_0x12218b){if(_0x12218b[_0x7d2a('0x2d')]!==_0x7d2a('0x3d')){var _0xf5c165={};_0xf5c165[_0x12218b['name']]={'$like':'%'+_0x117f2d[_0x7d2a('0x30')]['filter']+'%'};return _0xf5c165;}})});}_0x37c1c4=_[_0x7d2a('0x3c')]({},_0x37c1c4,_0x117f2d[_0x7d2a('0x3e')]);var _0x162555={'where':_0x37c1c4['where']};return db[_0x7d2a('0x2a')][_0x7d2a('0x1d')](_0x162555)[_0x7d2a('0x3f')](function(_0x8c60d8){_0x4a3fc1[_0x7d2a('0x1d')]=_0x8c60d8;if(_0x117f2d['query'][_0x7d2a('0x40')]){_0x37c1c4[_0x7d2a('0x41')]=[{'all':!![]}];}return db[_0x7d2a('0x2a')][_0x7d2a('0x42')](_0x37c1c4);})[_0x7d2a('0x3f')](function(_0x1ac859){_0x4a3fc1[_0x7d2a('0x43')]=_0x1ac859;return _0x4a3fc1;})[_0x7d2a('0x3f')](respondWithFilteredResult(_0x33292d,_0x37c1c4))[_0x7d2a('0x44')](handleError(_0x33292d,null));};exports[_0x7d2a('0x45')]=function(_0x2393d5,_0x4bda58){var _0x5eeb96={'raw':!![],'where':{'id':_0x2393d5[_0x7d2a('0x46')]['id']}},_0x52ba1a={};_0x52ba1a[_0x7d2a('0x2f')]=_['keys'](db['SmsApplication'][_0x7d2a('0x2b')]);_0x52ba1a['query']=_[_0x7d2a('0x47')](_0x2393d5[_0x7d2a('0x30')]);_0x52ba1a['filters']=_[_0x7d2a('0x32')](_0x52ba1a[_0x7d2a('0x2f')],_0x52ba1a[_0x7d2a('0x30')]);_0x5eeb96['attributes']=_[_0x7d2a('0x32')](_0x52ba1a[_0x7d2a('0x2f')],qs[_0x7d2a('0x33')](_0x2393d5[_0x7d2a('0x30')][_0x7d2a('0x33')]));_0x5eeb96['attributes']=_0x5eeb96[_0x7d2a('0x34')][_0x7d2a('0x35')]?_0x5eeb96[_0x7d2a('0x34')]:_0x52ba1a[_0x7d2a('0x2f')];if(_0x2393d5[_0x7d2a('0x30')]['includeAll']){_0x5eeb96['include']=[{'all':!![]}];}_0x5eeb96=_[_0x7d2a('0x3c')]({},_0x5eeb96,_0x2393d5[_0x7d2a('0x3e')]);return db[_0x7d2a('0x2a')][_0x7d2a('0x48')](_0x5eeb96)[_0x7d2a('0x3f')](handleEntityNotFound(_0x4bda58,null))[_0x7d2a('0x3f')](respondWithResult(_0x4bda58,null))[_0x7d2a('0x44')](handleError(_0x4bda58,null));};exports[_0x7d2a('0x49')]=function(_0x202bc2,_0x1766c8){return db['SmsApplication'][_0x7d2a('0x49')](_0x202bc2['body'],{})['then'](respondWithResult(_0x1766c8,0xc9))[_0x7d2a('0x44')](handleError(_0x1766c8,null));};exports[_0x7d2a('0x23')]=function(_0x246861,_0x4b96ef){if(_0x246861[_0x7d2a('0x4a')]['id']){delete _0x246861[_0x7d2a('0x4a')]['id'];}return db[_0x7d2a('0x2a')][_0x7d2a('0x48')]({'where':{'id':_0x246861['params']['id']}})[_0x7d2a('0x3f')](handleEntityNotFound(_0x4b96ef,null))[_0x7d2a('0x3f')](saveUpdates(_0x246861['body'],null))[_0x7d2a('0x3f')](respondWithResult(_0x4b96ef,null))['catch'](handleError(_0x4b96ef,null));};exports[_0x7d2a('0x24')]=function(_0x4ba5d3,_0x38e03d){return db[_0x7d2a('0x2a')][_0x7d2a('0x48')]({'where':{'id':_0x4ba5d3['params']['id']}})['then'](handleEntityNotFound(_0x38e03d,null))[_0x7d2a('0x3f')](removeEntity(_0x38e03d,null))[_0x7d2a('0x44')](handleError(_0x38e03d,null));};
\ No newline at end of file
+var _0x130d=['filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','body','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','SmsApplication','fieldName','type','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0x130d,0x9a));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd130('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd130('0x1'));var rp=require('request-promise');var moment=require(_0xd130('0x2'));var BPromise=require(_0xd130('0x3'));var Mustache=require(_0xd130('0x4'));var util=require(_0xd130('0x5'));var path=require(_0xd130('0x6'));var sox=require(_0xd130('0x7'));var csv=require(_0xd130('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd130('0x9'));var _=require(_0xd130('0xa'));var squel=require('squel');var crypto=require(_0xd130('0xb'));var jsforce=require(_0xd130('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd130('0xd'));var authService=require(_0xd130('0xe'));var qs=require(_0xd130('0xf'));var as=require(_0xd130('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd130('0x11'));var utils=require(_0xd130('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xd130('0x13'))['db'];function respondWithStatusCode(_0xc750e,_0x34149d){_0x34149d=_0x34149d||0xcc;return function(_0x4a4f9f){if(_0x4a4f9f){return _0xc750e[_0xd130('0x14')](_0x34149d);}return _0xc750e['status'](_0x34149d)['end']();};}function respondWithResult(_0x5d8756,_0xa334ca){_0xa334ca=_0xa334ca||0xc8;return function(_0x5475f0){if(_0x5475f0){return _0x5d8756[_0xd130('0x15')](_0xa334ca)[_0xd130('0x16')](_0x5475f0);}};}function respondWithFilteredResult(_0x514030,_0x4a64ad){return function(_0x1c45f0){if(_0x1c45f0){var _0x2f181f=typeof _0x4a64ad[_0xd130('0x17')]===_0xd130('0x18')&&typeof _0x4a64ad[_0xd130('0x19')]===_0xd130('0x18');var _0x3da6b3=_0x1c45f0[_0xd130('0x1a')];var _0x154630=_0x2f181f?0x0:_0x4a64ad[_0xd130('0x17')];var _0x2ccec6=_0x2f181f?_0x1c45f0[_0xd130('0x1a')]:_0x4a64ad['offset']+_0x4a64ad[_0xd130('0x19')];var _0xba7c3d;if(_0x2ccec6>=_0x3da6b3){_0x2ccec6=_0x3da6b3;_0xba7c3d=0xc8;}else{_0xba7c3d=0xce;}_0x514030[_0xd130('0x15')](_0xba7c3d);return _0x514030['set'](_0xd130('0x1b'),_0x154630+'-'+_0x2ccec6+'/'+_0x3da6b3)[_0xd130('0x16')](_0x1c45f0);}return null;};}function patchUpdates(_0x4d35ca){return function(_0x358069){try{jsonpatch[_0xd130('0x1c')](_0x358069,_0x4d35ca,!![]);}catch(_0x58928b){return BPromise[_0xd130('0x1d')](_0x58928b);}return _0x358069[_0xd130('0x1e')]();};}function saveUpdates(_0x3ebbf0,_0x552ea8){return function(_0x353b76){if(_0x353b76){return _0x353b76[_0xd130('0x1f')](_0x3ebbf0)[_0xd130('0x20')](function(_0x335f76){return _0x335f76;});}return null;};}function removeEntity(_0x3c7bb7,_0x5c5b85){return function(_0x16ead6){if(_0x16ead6){return _0x16ead6[_0xd130('0x21')]()[_0xd130('0x20')](function(){_0x3c7bb7[_0xd130('0x15')](0xcc)[_0xd130('0x22')]();});}};}function handleEntityNotFound(_0x484a3b,_0x382d15){return function(_0x216758){if(!_0x216758){_0x484a3b[_0xd130('0x14')](0x194);}return _0x216758;};}function handleError(_0x64500f,_0x55e44d){_0x55e44d=_0x55e44d||0x1f4;return function(_0x3b5f13){logger[_0xd130('0x23')](_0x3b5f13[_0xd130('0x24')]);if(_0x3b5f13['name']){delete _0x3b5f13[_0xd130('0x25')];}_0x64500f[_0xd130('0x15')](_0x55e44d)[_0xd130('0x26')](_0x3b5f13);};}exports['index']=function(_0x7c7429,_0x97bab2){var _0x42a508={},_0x353063={},_0x3a6493={'count':0x0,'rows':[]};var _0x28174d=_['map'](db[_0xd130('0x27')]['rawAttributes'],function(_0x4f526f){return{'name':_0x4f526f[_0xd130('0x28')],'type':_0x4f526f[_0xd130('0x29')]['key']};});_0x353063['model']=_['map'](_0x28174d,_0xd130('0x25'));_0x353063[_0xd130('0x2a')]=_[_0xd130('0x2b')](_0x7c7429[_0xd130('0x2a')]);_0x353063['filters']=_[_0xd130('0x2c')](_0x353063['model'],_0x353063['query']);_0x42a508[_0xd130('0x2d')]=_[_0xd130('0x2c')](_0x353063[_0xd130('0x2e')],qs[_0xd130('0x2f')](_0x7c7429['query'][_0xd130('0x2f')]));_0x42a508[_0xd130('0x2d')]=_0x42a508[_0xd130('0x2d')][_0xd130('0x30')]?_0x42a508['attributes']:_0x353063[_0xd130('0x2e')];if(!_0x7c7429[_0xd130('0x2a')][_0xd130('0x31')](_0xd130('0x32'))){_0x42a508[_0xd130('0x19')]=qs[_0xd130('0x19')](_0x7c7429[_0xd130('0x2a')][_0xd130('0x19')]);_0x42a508[_0xd130('0x17')]=qs[_0xd130('0x17')](_0x7c7429[_0xd130('0x2a')][_0xd130('0x17')]);}_0x42a508['order']=qs['sort'](_0x7c7429[_0xd130('0x2a')][_0xd130('0x33')]);_0x42a508[_0xd130('0x34')]=qs[_0xd130('0x35')](_[_0xd130('0x36')](_0x7c7429[_0xd130('0x2a')],_0x353063[_0xd130('0x35')]),_0x28174d);if(_0x7c7429['query'][_0xd130('0x37')]){_0x42a508[_0xd130('0x34')]=_[_0xd130('0x38')](_0x42a508[_0xd130('0x34')],{'$or':_['map'](_0x28174d,function(_0x4a3a36){if(_0x4a3a36[_0xd130('0x29')]!==_0xd130('0x39')){var _0x14fc39={};_0x14fc39[_0x4a3a36[_0xd130('0x25')]]={'$like':'%'+_0x7c7429[_0xd130('0x2a')][_0xd130('0x37')]+'%'};return _0x14fc39;}})});}_0x42a508=_[_0xd130('0x38')]({},_0x42a508,_0x7c7429[_0xd130('0x3a')]);var _0xa973b4={'where':_0x42a508[_0xd130('0x34')]};return db['SmsApplication']['count'](_0xa973b4)[_0xd130('0x20')](function(_0x334db0){_0x3a6493[_0xd130('0x1a')]=_0x334db0;if(_0x7c7429[_0xd130('0x2a')][_0xd130('0x3b')]){_0x42a508[_0xd130('0x3c')]=[{'all':!![]}];}return db[_0xd130('0x27')][_0xd130('0x3d')](_0x42a508);})[_0xd130('0x20')](function(_0x2c1bc6){_0x3a6493[_0xd130('0x3e')]=_0x2c1bc6;return _0x3a6493;})[_0xd130('0x20')](respondWithFilteredResult(_0x97bab2,_0x42a508))[_0xd130('0x3f')](handleError(_0x97bab2,null));};exports[_0xd130('0x40')]=function(_0x4fde17,_0x3a672d){var _0x636065={'raw':!![],'where':{'id':_0x4fde17[_0xd130('0x41')]['id']}},_0x493a0c={};_0x493a0c[_0xd130('0x2e')]=_['keys'](db[_0xd130('0x27')][_0xd130('0x42')]);_0x493a0c[_0xd130('0x2a')]=_['keys'](_0x4fde17['query']);_0x493a0c[_0xd130('0x35')]=_[_0xd130('0x2c')](_0x493a0c['model'],_0x493a0c[_0xd130('0x2a')]);_0x636065[_0xd130('0x2d')]=_['intersection'](_0x493a0c[_0xd130('0x2e')],qs[_0xd130('0x2f')](_0x4fde17['query'][_0xd130('0x2f')]));_0x636065[_0xd130('0x2d')]=_0x636065[_0xd130('0x2d')]['length']?_0x636065[_0xd130('0x2d')]:_0x493a0c[_0xd130('0x2e')];if(_0x4fde17[_0xd130('0x2a')]['includeAll']){_0x636065['include']=[{'all':!![]}];}_0x636065=_[_0xd130('0x38')]({},_0x636065,_0x4fde17[_0xd130('0x3a')]);return db[_0xd130('0x27')][_0xd130('0x43')](_0x636065)[_0xd130('0x20')](handleEntityNotFound(_0x3a672d,null))[_0xd130('0x20')](respondWithResult(_0x3a672d,null))[_0xd130('0x3f')](handleError(_0x3a672d,null));};exports['create']=function(_0x5e4951,_0x3c9950){return db[_0xd130('0x27')]['create'](_0x5e4951[_0xd130('0x44')],{})[_0xd130('0x20')](respondWithResult(_0x3c9950,0xc9))[_0xd130('0x3f')](handleError(_0x3c9950,null));};exports[_0xd130('0x1f')]=function(_0x32ffbb,_0x266440){if(_0x32ffbb['body']['id']){delete _0x32ffbb[_0xd130('0x44')]['id'];}return db[_0xd130('0x27')][_0xd130('0x43')]({'where':{'id':_0x32ffbb[_0xd130('0x41')]['id']}})[_0xd130('0x20')](handleEntityNotFound(_0x266440,null))[_0xd130('0x20')](saveUpdates(_0x32ffbb[_0xd130('0x44')],null))[_0xd130('0x20')](respondWithResult(_0x266440,null))[_0xd130('0x3f')](handleError(_0x266440,null));};exports[_0xd130('0x21')]=function(_0x31b4e7,_0x1a8207){return db[_0xd130('0x27')][_0xd130('0x43')]({'where':{'id':_0x31b4e7['params']['id']}})[_0xd130('0x20')](handleEntityNotFound(_0x1a8207,null))[_0xd130('0x20')](removeEntity(_0x1a8207,null))[_0xd130('0x3f')](handleError(_0x1a8207,null));};
\ No newline at end of file
index d268c06..b7dbd21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd268=['../../config/environment','./smsApplication.attributes','exports','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x340eb6,_0x1eac76){var _0x4d833c=function(_0x1d2115){while(--_0x1d2115){_0x340eb6['push'](_0x340eb6['shift']());}};_0x4d833c(++_0x1eac76);}(_0xd268,0x123));var _0x8d26=function(_0x15ee63,_0x43b48c){_0x15ee63=_0x15ee63-0x0;var _0x39d87a=_0xd268[_0x15ee63];return _0x39d87a;};'use strict';var _=require(_0x8d26('0x0'));var util=require('util');var logger=require(_0x8d26('0x1'))(_0x8d26('0x2'));var moment=require(_0x8d26('0x3'));var BPromise=require(_0x8d26('0x4'));var rp=require(_0x8d26('0x5'));var fs=require('fs');var path=require(_0x8d26('0x6'));var rimraf=require(_0x8d26('0x7'));var config=require(_0x8d26('0x8'));var attributes=require(_0x8d26('0x9'));module[_0x8d26('0xa')]=function(_0x48b92c,_0x465fd0){return _0x48b92c['define']('SmsApplication',attributes,{'tableName':'sms_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8d26('0xb'),'collate':_0x8d26('0xc')});};
\ No newline at end of file
+var _0x0c48=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./smsApplication.attributes','exports','define','SmsApplication','sms_applications'];(function(_0x4a59d7,_0x33d394){var _0x3248ef=function(_0x2cd1b8){while(--_0x2cd1b8){_0x4a59d7['push'](_0x4a59d7['shift']());}};_0x3248ef(++_0x33d394);}(_0x0c48,0xd3));var _0x80c4=function(_0x20d282,_0x292d4d){_0x20d282=_0x20d282-0x0;var _0x1331aa=_0x0c48[_0x20d282];return _0x1331aa;};'use strict';var _=require(_0x80c4('0x0'));var util=require(_0x80c4('0x1'));var logger=require(_0x80c4('0x2'))(_0x80c4('0x3'));var moment=require(_0x80c4('0x4'));var BPromise=require(_0x80c4('0x5'));var rp=require(_0x80c4('0x6'));var fs=require('fs');var path=require(_0x80c4('0x7'));var rimraf=require(_0x80c4('0x8'));var config=require('../../config/environment');var attributes=require(_0x80c4('0x9'));module[_0x80c4('0xa')]=function(_0x2ab2bc,_0x1c5753){return _0x2ab2bc[_0x80c4('0xb')](_0x80c4('0xc'),attributes,{'tableName':_0x80c4('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x80c4('0xe')});};
\ No newline at end of file
index a204e16..a0e8710 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5276=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','SmsApplication,\x20%s,\x20%s','info','moment','bluebird'];(function(_0x2cb946,_0x320302){var _0x4ded31=function(_0x9ee79a){while(--_0x9ee79a){_0x2cb946['push'](_0x2cb946['shift']());}};_0x4ded31(++_0x320302);}(_0x5276,0x163));var _0x6527=function(_0x54d01f,_0x1f19e4){_0x54d01f=_0x54d01f-0x0;var _0x4c1529=_0x5276[_0x54d01f];return _0x4c1529;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6527('0x0'));var BPromise=require(_0x6527('0x1'));var rs=require(_0x6527('0x2'));var fs=require('fs');var Redis=require(_0x6527('0x3'));var db=require(_0x6527('0x4'))['db'];var utils=require(_0x6527('0x5'));var logger=require(_0x6527('0x6'))(_0x6527('0x7'));var config=require(_0x6527('0x8'));var jayson=require(_0x6527('0x9'));var client=jayson[_0x6527('0xa')][_0x6527('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x188c61,_0x50fd9d,_0x2b27ec){return new BPromise(function(_0x5a739d,_0x295871){return client[_0x6527('0xc')](_0x188c61,_0x2b27ec)['then'](function(_0x598649){logger['info']('SmsApplication,\x20%s,\x20%s',_0x50fd9d,_0x6527('0xd'));logger[_0x6527('0xe')](_0x6527('0xf'),_0x50fd9d,_0x6527('0xd'),JSON['stringify'](_0x598649));if(_0x598649['error']){if(_0x598649[_0x6527('0x10')][_0x6527('0x11')]===0x1f4){logger[_0x6527('0x10')]('SmsApplication,\x20%s,\x20%s',_0x50fd9d,_0x598649['error']['message']);return _0x295871(_0x598649[_0x6527('0x10')][_0x6527('0x12')]);}logger['error'](_0x6527('0x13'),_0x50fd9d,_0x598649['error'][_0x6527('0x12')]);return _0x5a739d(_0x598649[_0x6527('0x10')][_0x6527('0x12')]);}else{logger[_0x6527('0x14')](_0x6527('0x13'),_0x50fd9d,_0x6527('0xd'));_0x5a739d(_0x598649['result'][_0x6527('0x12')]);}})['catch'](function(_0x7df46a){logger[_0x6527('0x10')](_0x6527('0x13'),_0x50fd9d,_0x7df46a);_0x295871(_0x7df46a);});});}
\ No newline at end of file
+var _0xf7d9=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x160a5d,_0x5de817){var _0x471c93=function(_0x54cf74){while(--_0x54cf74){_0x160a5d['push'](_0x160a5d['shift']());}};_0x471c93(++_0x5de817);}(_0xf7d9,0x122));var _0x9f7d=function(_0xe2f6f5,_0x3999bc){_0xe2f6f5=_0xe2f6f5-0x0;var _0x2a2800=_0xf7d9[_0xe2f6f5];return _0x2a2800;};'use strict';var _=require(_0x9f7d('0x0'));var util=require(_0x9f7d('0x1'));var moment=require(_0x9f7d('0x2'));var BPromise=require(_0x9f7d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f7d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f7d('0x5'))(_0x9f7d('0x6'));var config=require(_0x9f7d('0x7'));var jayson=require(_0x9f7d('0x8'));var client=jayson[_0x9f7d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4dc6b9,_0xf09259,_0x2333e8){return new BPromise(function(_0x218628,_0x2893a5){return client[_0x9f7d('0xa')](_0x4dc6b9,_0x2333e8)[_0x9f7d('0xb')](function(_0x5290e2){logger[_0x9f7d('0xc')](_0x9f7d('0xd'),_0xf09259,'request\x20sent');logger[_0x9f7d('0xe')](_0x9f7d('0xf'),_0xf09259,_0x9f7d('0x10'),JSON['stringify'](_0x5290e2));if(_0x5290e2[_0x9f7d('0x11')]){if(_0x5290e2[_0x9f7d('0x11')][_0x9f7d('0x12')]===0x1f4){logger[_0x9f7d('0x11')](_0x9f7d('0xd'),_0xf09259,_0x5290e2[_0x9f7d('0x11')]['message']);return _0x2893a5(_0x5290e2[_0x9f7d('0x11')][_0x9f7d('0x13')]);}logger[_0x9f7d('0x11')](_0x9f7d('0xd'),_0xf09259,_0x5290e2['error'][_0x9f7d('0x13')]);return _0x218628(_0x5290e2[_0x9f7d('0x11')][_0x9f7d('0x13')]);}else{logger[_0x9f7d('0xc')](_0x9f7d('0xd'),_0xf09259,_0x9f7d('0x10'));_0x218628(_0x5290e2[_0x9f7d('0x14')]['message']);}})['catch'](function(_0x402609){logger[_0x9f7d('0x11')](_0x9f7d('0xd'),_0xf09259,_0x402609);_0x2893a5(_0x402609);});});}
\ No newline at end of file
index c94efe5..ff17765 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x13f6=['isAuthenticated','index','get','/:id','show','/:id/messages','getMessages','/:id/download','download','create','addMessage','post','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','update','delete','smsinteraction:destroy','destroy','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller'];(function(_0x21c589,_0x4ccb0d){var _0x394114=function(_0x7afb63){while(--_0x7afb63){_0x21c589['push'](_0x21c589['shift']());}};_0x394114(++_0x4ccb0d);}(_0x13f6,0x124));var _0x613f=function(_0x1f357d,_0x58ba15){_0x1f357d=_0x1f357d-0x0;var _0x2d56e6=_0x13f6[_0x1f357d];return _0x2d56e6;};'use strict';var multer=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x613f('0x2'));var router=express[_0x613f('0x3')]();var fs_extra=require(_0x613f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x613f('0x5'));var config=require(_0x613f('0x6'));var controller=require(_0x613f('0x7'));router['get']('/',auth[_0x613f('0x8')](),controller[_0x613f('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x613f('0xa')](_0x613f('0xb'),auth[_0x613f('0x8')](),controller[_0x613f('0xc')]);router['get'](_0x613f('0xd'),auth[_0x613f('0x8')](),controller[_0x613f('0xe')]);router['get'](_0x613f('0xf'),auth[_0x613f('0x8')](),controller[_0x613f('0x10')]);router['post']('/',auth[_0x613f('0x8')](),controller[_0x613f('0x11')]);router['post']('/:id/messages',auth['isAuthenticated'](),controller[_0x613f('0x12')]);router[_0x613f('0x13')](_0x613f('0x14'),auth[_0x613f('0x8')](),interaction[_0x613f('0x15')](_0x613f('0x16'),_0x613f('0x17')),controller[_0x613f('0x18')]);router[_0x613f('0x19')](_0x613f('0xb'),auth['isAuthenticated'](),interaction[_0x613f('0x15')]('sms','smsinteraction:update'),controller[_0x613f('0x1a')]);router[_0x613f('0x1b')]('/:id',auth[_0x613f('0x8')](),interaction['tracked'](_0x613f('0x16'),_0x613f('0x1c')),controller[_0x613f('0x1d')]);router[_0x613f('0x1b')](_0x613f('0x14'),auth[_0x613f('0x8')](),controller['removeTags']);module['exports']=router;
\ No newline at end of file
+var _0x2547=['/:id/messages','getMessages','/:id/download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x7da33c,_0xabbc19){var _0x205045=function(_0x182896){while(--_0x182896){_0x7da33c['push'](_0x7da33c['shift']());}};_0x205045(++_0xabbc19);}(_0x2547,0x1cd));var _0x7254=function(_0x405cbd,_0x1db56f){_0x405cbd=_0x405cbd-0x0;var _0x13e338=_0x2547[_0x405cbd];return _0x13e338;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var fs_extra=require(_0x7254('0x5'));var auth=require(_0x7254('0x6'));var interaction=require(_0x7254('0x7'));var config=require('../../config/environment');var controller=require(_0x7254('0x8'));router[_0x7254('0x9')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0xb')]);router['get'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0xd')]);router['get'](_0x7254('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x10')]);router[_0x7254('0x9')](_0x7254('0x11'),auth[_0x7254('0xa')](),controller['download']);router[_0x7254('0x12')]('/',auth['isAuthenticated'](),controller[_0x7254('0x13')]);router['post'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x14')]);router[_0x7254('0x12')](_0x7254('0x15'),auth[_0x7254('0xa')](),interaction[_0x7254('0x16')](_0x7254('0x17'),_0x7254('0x18')),controller[_0x7254('0x19')]);router[_0x7254('0x1a')](_0x7254('0xe'),auth[_0x7254('0xa')](),interaction['tracked'](_0x7254('0x17'),_0x7254('0x1b')),controller[_0x7254('0x1c')]);router[_0x7254('0x1d')](_0x7254('0xe'),auth[_0x7254('0xa')](),interaction[_0x7254('0x16')]('sms',_0x7254('0x1e')),controller[_0x7254('0x1f')]);router[_0x7254('0x1d')](_0x7254('0x15'),auth[_0x7254('0xa')](),controller[_0x7254('0x20')]);module[_0x7254('0x21')]=router;
\ No newline at end of file
index 3206ec5..87437f8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb66=['ENUM','out','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xcb66,0x19f));var _0x6cb6=function(_0xb66df,_0x4fb5ce){_0xb66df=_0xb66df-0x0;var _0x42a702=_0xcb66[_0xb66df];return _0x42a702;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6cb6('0x0'));module[_0x6cb6('0x1')]={'closed':{'type':Sequelize[_0x6cb6('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x6cb6('0x3')]},'disposition':{'type':Sequelize[_0x6cb6('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x6cb6('0x4')]},'note':{'type':Sequelize[_0x6cb6('0x4')]},'phone':{'type':Sequelize[_0x6cb6('0x4')]},'read1stAt':{'type':Sequelize[_0x6cb6('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x6cb6('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x6cb6('0x5')]('in',_0x6cb6('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x6cb6('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0xbf07=['sequelize','moment','exports','BOOLEAN','STRING','DATE','ENUM'];(function(_0x2d4421,_0x15a84f){var _0x2d3b01=function(_0xb9e94c){while(--_0xb9e94c){_0x2d4421['push'](_0x2d4421['shift']());}};_0x2d3b01(++_0x15a84f);}(_0xbf07,0x77));var _0x7bf0=function(_0xd1c39b,_0x16f0c6){_0xd1c39b=_0xd1c39b-0x0;var _0x58f5bc=_0xbf07[_0xd1c39b];return _0x58f5bc;};'use strict';var Sequelize=require(_0x7bf0('0x0'));var moment=require(_0x7bf0('0x1'));module[_0x7bf0('0x2')]={'closed':{'type':Sequelize[_0x7bf0('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x7bf0('0x4')]},'secondDisposition':{'type':Sequelize[_0x7bf0('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x7bf0('0x5')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x7bf0('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x7bf0('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 6ac9708..6cadd17 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcf5f=['get','mkdirSync','N.A.','closed','closedAt','disposition','out','System','renderFile','downloadInteraction.ejs','transcript-','Sms','createPdfFromHTML','download','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./smsInteraction.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','name','send','map','Tags','TagIds','split','forEach','push','index','SmsInteraction','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','sort','pick','select','field','color','tools_tags','u.id','u.fullname','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','cm_contacts','users','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','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)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','isEmpty','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','t.id\x20IN\x20?','resolve','user','role','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','agent','keyBy','merge','fields','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','sequelize','toString','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','rows','catch','show','params','includeAll','include','options','create','update','describe','addMessage','SmsMessage','omit','ids','getMessages','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','Tag','emit','smsInteractionTags:save','removeTags','join','server','files','tmp','root','format','fullname','CmContact','firstName','lastName','Messages','direction','secret','SmsAccount','Account','Owner'];(function(_0x299acf,_0x3a215d){var _0x3cf11b=function(_0x2cc86e){while(--_0x2cc86e){_0x299acf['push'](_0x299acf['shift']());}};_0x3cf11b(++_0x3a215d);}(_0xcf5f,0xfe));var _0xfcf5=function(_0x55c37e,_0x229490){_0x55c37e=_0x55c37e-0x0;var _0x10d6ab=_0xcf5f[_0x55c37e];return _0x10d6ab;};'use strict';var emlformat=require(_0xfcf5('0x0'));var rimraf=require(_0xfcf5('0x1'));var zipdir=require(_0xfcf5('0x2'));var jsonpatch=require(_0xfcf5('0x3'));var rp=require(_0xfcf5('0x4'));var moment=require(_0xfcf5('0x5'));var BPromise=require(_0xfcf5('0x6'));var Mustache=require(_0xfcf5('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xfcf5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfcf5('0x9'));var _=require(_0xfcf5('0xa'));var squel=require(_0xfcf5('0xb'));var crypto=require(_0xfcf5('0xc'));var jsforce=require(_0xfcf5('0xd'));var deskjs=require(_0xfcf5('0xe'));var toCsv=require(_0xfcf5('0x8'));var querystring=require(_0xfcf5('0xf'));var Papa=require(_0xfcf5('0x10'));var Redis=require(_0xfcf5('0x11'));var authService=require(_0xfcf5('0x12'));var qs=require(_0xfcf5('0x13'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xfcf5('0x14'));var hardwareService=require(_0xfcf5('0x15'));var logger=require(_0xfcf5('0x16'))(_0xfcf5('0x17'));var utils=require(_0xfcf5('0x18'));var config=require(_0xfcf5('0x19'));var licenseUtil=require(_0xfcf5('0x1a'));var db=require(_0xfcf5('0x1b'))['db'];config[_0xfcf5('0x1c')]=_['defaults'](config[_0xfcf5('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0xfcf5('0x1d'))(new Redis(config[_0xfcf5('0x1c')]));require(_0xfcf5('0x1e'))['register'](socket);function respondWithStatusCode(_0x585590,_0x2adfab){_0x2adfab=_0x2adfab||0xcc;return function(_0x1ad672){if(_0x1ad672){return _0x585590[_0xfcf5('0x1f')](_0x2adfab);}return _0x585590[_0xfcf5('0x20')](_0x2adfab)[_0xfcf5('0x21')]();};}function respondWithResult(_0x3455e1,_0xdc6c27){_0xdc6c27=_0xdc6c27||0xc8;return function(_0x50f70c){if(_0x50f70c){return _0x3455e1[_0xfcf5('0x20')](_0xdc6c27)[_0xfcf5('0x22')](_0x50f70c);}};}function respondWithFilteredResult(_0x1f68be,_0x43969c){return function(_0x3dd71e){if(_0x3dd71e){var _0x5efbd9=typeof _0x43969c[_0xfcf5('0x23')]===_0xfcf5('0x24')&&typeof _0x43969c[_0xfcf5('0x25')]===_0xfcf5('0x24');var _0x1e4aa0=_0x3dd71e[_0xfcf5('0x26')];var _0x4d4c4f=_0x5efbd9?0x0:_0x43969c['offset'];var _0x4491ea=_0x5efbd9?_0x3dd71e[_0xfcf5('0x26')]:_0x43969c[_0xfcf5('0x23')]+_0x43969c['limit'];var _0x4729b6;if(_0x4491ea>=_0x1e4aa0){_0x4491ea=_0x1e4aa0;_0x4729b6=0xc8;}else{_0x4729b6=0xce;}_0x1f68be[_0xfcf5('0x20')](_0x4729b6);return _0x1f68be[_0xfcf5('0x27')]('Content-Range',_0x4d4c4f+'-'+_0x4491ea+'/'+_0x1e4aa0)[_0xfcf5('0x22')](_0x3dd71e);}return null;};}function patchUpdates(_0x2d1502){return function(_0x19fe3b){try{jsonpatch[_0xfcf5('0x28')](_0x19fe3b,_0x2d1502,!![]);}catch(_0xc25dfe){return BPromise[_0xfcf5('0x29')](_0xc25dfe);}return _0x19fe3b['save']();};}function saveUpdates(_0x587e8e,_0x4befef){return function(_0x4d35f5){if(_0x4d35f5){return _0x4d35f5['update'](_0x587e8e)[_0xfcf5('0x2a')](function(_0x1eb8b8){return _0x1eb8b8;});}return null;};}function removeEntity(_0x436ac5,_0x492d4f){return function(_0x70c5ff){if(_0x70c5ff){return _0x70c5ff[_0xfcf5('0x2b')]()['then'](function(){_0x436ac5['status'](0xcc)[_0xfcf5('0x21')]();});}};}function handleEntityNotFound(_0x24c194,_0x5d4c92){return function(_0x43f5b7){if(!_0x43f5b7){_0x24c194[_0xfcf5('0x1f')](0x194);}return _0x43f5b7;};}function handleError(_0xec6934,_0x597de4){_0x597de4=_0x597de4||0x1f4;return function(_0xdb9f0c){logger['error'](_0xdb9f0c['stack']);if(_0xdb9f0c[_0xfcf5('0x2c')]){delete _0xdb9f0c[_0xfcf5('0x2c')];}_0xec6934[_0xfcf5('0x20')](_0x597de4)[_0xfcf5('0x2d')](_0xdb9f0c);};}function getInteractionUsers(_0x1362f9,_0x5d3060){return new BPromise(function(_0x22ce6c,_0x5ceec8){try{if(_0x5d3060[_0x1362f9['id']]){_0x1362f9['Users']=_[_0xfcf5('0x2e')](_0x5d3060[_0x1362f9['id']],function(_0x40d0aa){return{'id':_0x40d0aa['id'],'fullname':_0x40d0aa['fullname']};});}}catch(_0x1bf046){_0x5ceec8(_0x1bf046);}_0x22ce6c(_0x1362f9);});}function getInteractionTags(_0x40482b,_0x1db199){return new BPromise(function(_0x1b0e4a,_0x5cd7f5){try{if(_0x40482b['TagIds']){_0x40482b[_0xfcf5('0x2f')]=[];_0x40482b[_0xfcf5('0x30')][_0xfcf5('0x31')](',')[_0xfcf5('0x32')](function(_0x5ceb05){_0x40482b[_0xfcf5('0x2f')][_0xfcf5('0x33')](_0x1db199[_0x5ceb05]);});}delete _0x40482b[_0xfcf5('0x30')];}catch(_0x4a6b33){_0x5cd7f5(_0x4a6b33);}_0x1b0e4a(_0x40482b);});}function updateSmsInteraction(_0x416caa,_0x2a689b,_0x45e1d9){return new BPromise(function(_0x2a6c78,_0x50aa26){return getInteractionUsers(_0x416caa,_0x45e1d9)['then'](function(_0x5c5d55){return getInteractionTags(_0x5c5d55,_0x2a689b);})[_0xfcf5('0x2a')](function(_0x4ddbe5){_0x2a6c78(_0x4ddbe5);})['catch'](function(_0x5d681d){_0x50aa26(_0x5d681d);});});}exports[_0xfcf5('0x34')]=function(_0x282d59,_0x9ae8d1){var _0x487745={},_0x54a4b3={},_0x34b714={'count':0x0,'rows':[]};var _0x4abb7d=_[_0xfcf5('0x2e')](db[_0xfcf5('0x35')][_0xfcf5('0x36')],function(_0x76f666){return{'name':_0x76f666[_0xfcf5('0x37')],'type':_0x76f666[_0xfcf5('0x38')]['key']};});_0x54a4b3['model']=_['map'](_0x4abb7d,_0xfcf5('0x2c'));_0x54a4b3[_0xfcf5('0x39')]=_[_0xfcf5('0x3a')](_0x282d59['query']);_0x54a4b3[_0xfcf5('0x3b')]=_[_0xfcf5('0x3c')](_0x54a4b3[_0xfcf5('0x3d')],_0x54a4b3[_0xfcf5('0x39')]);_0x487745[_0xfcf5('0x3e')]=_[_0xfcf5('0x3c')](_0x54a4b3[_0xfcf5('0x3d')],qs['fields'](_0x282d59[_0xfcf5('0x39')]['fields']));_0x487745[_0xfcf5('0x3e')]=_0x487745['attributes'][_0xfcf5('0x3f')]?_0x487745[_0xfcf5('0x3e')]:_0x54a4b3['model'];if(!_0x282d59['query'][_0xfcf5('0x40')](_0xfcf5('0x41'))){_0x487745[_0xfcf5('0x25')]=qs['limit'](_0x282d59[_0xfcf5('0x39')][_0xfcf5('0x25')]);_0x487745[_0xfcf5('0x23')]=qs['offset'](_0x282d59[_0xfcf5('0x39')][_0xfcf5('0x23')]);}_0x487745['order']=qs[_0xfcf5('0x42')](_0x282d59['query'][_0xfcf5('0x42')]);_0x487745['where']=qs[_0xfcf5('0x3b')](_[_0xfcf5('0x43')](_0x282d59['query'],_0x54a4b3[_0xfcf5('0x3b')]),_0x4abb7d);var _0x2092e0=[];var _0x16cd88=squel[_0xfcf5('0x44')]()[_0xfcf5('0x45')]('id')['field'](_0xfcf5('0x2c'))[_0xfcf5('0x45')](_0xfcf5('0x46'))['from'](_0xfcf5('0x47'));var _0x8a79df=squel[_0xfcf5('0x44')]()['field'](_0xfcf5('0x48'))[_0xfcf5('0x45')](_0xfcf5('0x49'))[_0xfcf5('0x45')](_0xfcf5('0x4a'))[_0xfcf5('0x4b')](_0xfcf5('0x4c'),'ui')[_0xfcf5('0x4d')]('users','u',_0xfcf5('0x4e'));var _0x27514b=squel[_0xfcf5('0x44')]()[_0xfcf5('0x4b')]('sms_interactions','i')['left_join'](_0xfcf5('0x4f'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xfcf5('0x50'),'o',_0xfcf5('0x51'))[_0xfcf5('0x4d')](_0xfcf5('0x52'),'a',_0xfcf5('0x53'))[_0xfcf5('0x4d')](_0xfcf5('0x54'),'me',_0xfcf5('0x55'))['left_join']('sms_interaction_has_tags','it',_0xfcf5('0x56'))['left_join'](_0xfcf5('0x47'),'t',_0xfcf5('0x57'));var _0x504e1c=squel[_0xfcf5('0x58')]();var _0x234364=[];var _0x3d90cd=squel[_0xfcf5('0x58')]();var _0xa1efb9;if(_0x282d59['query'][_0xfcf5('0x59')]){_0xa1efb9=as[_0xfcf5('0x5a')](_0x282d59[_0xfcf5('0x39')][_0xfcf5('0x59')]);var _0x2a9dc4=_0xa1efb9[_0xfcf5('0x5b')];for(var _0x4e5f49=0x0;_0x4e5f49<_0xa1efb9[_0xfcf5('0x5c')][_0xfcf5('0x3f')];_0x4e5f49++){var _0x127383=_0xa1efb9[_0xfcf5('0x5c')][_0x4e5f49];var _0x1cc827='i';var _0x5290f6=_[_0xfcf5('0x5d')](_0x4abb7d,[_0xfcf5('0x2c'),_0x127383[_0xfcf5('0x45')]]);if(!_0x5290f6){switch(_0x127383[_0xfcf5('0x45')]){case _0xfcf5('0x5e'):if(_0x127383[_0xfcf5('0x5f')]==0x1){_0x27514b[_0xfcf5('0x60')]('`'+_0x127383[_0xfcf5('0x45')]+_0xfcf5('0x61'));}else{_0x27514b[_0xfcf5('0x60')]('`'+_0x127383[_0xfcf5('0x45')]+_0xfcf5('0x62'));}break;case _0xfcf5('0x63'):if(_0x127383[_0xfcf5('0x64')]==='$substring'){if(_0x127383['value'][_0xfcf5('0x31')]('\x20')[_0xfcf5('0x3f')]>0x1){_0x504e1c[_0x2a9dc4](_0xfcf5('0x65'),qs['getFullTextValue'](_0x127383[_0xfcf5('0x5f')]),null);}else{var _0x2dc4c4='%'+_0x127383[_0xfcf5('0x5f')]+'%';_0x504e1c[_0x2a9dc4](_0xfcf5('0x66'),_0x2dc4c4,_0x2dc4c4,_0x2dc4c4);}}else{_0x5290f6=_[_0xfcf5('0x5d')](_0x4abb7d,[_0xfcf5('0x2c'),_0xfcf5('0x67')]);_0x127383[_0xfcf5('0x45')]=_0xfcf5('0x67');_0x4c643c=as[_0xfcf5('0x68')](_0x1cc827,_0x5290f6[_0xfcf5('0x38')],_0x127383);_0x504e1c[_0x2a9dc4](_0x4c643c[_0xfcf5('0x69')],_0x4c643c['value'][_0xfcf5('0x6a')],_0x4c643c['value'][_0xfcf5('0x21')]);}break;case'Tag':var _0x3fafde=_0x127383[_0xfcf5('0x5f')][_0xfcf5('0x31')](',')[_0xfcf5('0x2e')](function(_0x3d2b11){return Number(_0x3d2b11);});_0x3fafde[_0xfcf5('0x32')](function(_0x57f991){_0x3d90cd['or'](_0xfcf5('0x6b'),'%,'+_0x57f991+',%');});_0x234364=_['union'](_0x234364,_0x3fafde);break;case _0xfcf5('0x6c'):if(_0x127383[_0xfcf5('0x64')]===_0xfcf5('0x6d')){_0x504e1c[_0x2a9dc4](_0xfcf5('0x6e'),'%'+_0x127383[_0xfcf5('0x5f')]+'%',null);}else{_0x5290f6=_[_0xfcf5('0x5d')](_0x4abb7d,[_0xfcf5('0x2c'),_0xfcf5('0x6f')]);_0x127383[_0xfcf5('0x45')]='UserId';_0x4c643c=as['buildExpression'](_0x1cc827,_0x5290f6['type'],_0x127383);_0x504e1c[_0x2a9dc4](_0x4c643c[_0xfcf5('0x69')],_0x4c643c[_0xfcf5('0x5f')][_0xfcf5('0x6a')],_0x4c643c['value']['end']);}break;case _0xfcf5('0x70'):_0x4c643c=as[_0xfcf5('0x68')]('me',null,_0x127383);_0x504e1c[_0x2a9dc4](_0x4c643c[_0xfcf5('0x69')],_0x4c643c['value'][_0xfcf5('0x6a')],_0x4c643c[_0xfcf5('0x5f')]['end']);break;}}else{var _0x4c643c=as[_0xfcf5('0x68')](_0x1cc827,_0x5290f6['type'],_0x127383);_0x504e1c[_0x2a9dc4](_0x4c643c[_0xfcf5('0x69')],_0x4c643c['value'][_0xfcf5('0x6a')],_0x4c643c[_0xfcf5('0x5f')][_0xfcf5('0x21')]);}}}else{var _0xed261c=_(_0x282d59[_0xfcf5('0x39')])[_0xfcf5('0x3a')]()[_0xfcf5('0x2e')](function(_0x233812){return _[_0xfcf5('0x71')](_0x4abb7d,[_0xfcf5('0x2c'),_0x233812])?_0x233812:undefined;})[_0xfcf5('0x72')]()[_0xfcf5('0x5f')]();if(!_[_0xfcf5('0x73')](_0xed261c)){_0xed261c[_0xfcf5('0x32')](function(_0x4b66a9){if(_0x4b66a9===_0xfcf5('0x74')){_0x27514b[_0xfcf5('0x75')](_0xfcf5('0x76'),[][_0xfcf5('0x77')](_0x282d59[_0xfcf5('0x39')][_0x4b66a9]));}else if(_0x4b66a9===_0xfcf5('0x78')){var _0x1cde82=JSON[_0xfcf5('0x79')](_0x282d59[_0xfcf5('0x39')][_0x4b66a9])[_0xfcf5('0x7a')];var _0xff4ac3=JSON['parse'](_0x282d59[_0xfcf5('0x39')][_0x4b66a9])[_0xfcf5('0x7b')];_0x27514b[_0xfcf5('0x75')](_0xfcf5('0x7c'),_0x1cde82,_0xff4ac3);}else{if(_0x282d59[_0xfcf5('0x39')][_0x4b66a9]==='null'){_0x27514b[_0xfcf5('0x75')]('i.'+_0x4b66a9+'\x20IS\x20NULL');}else{_0x27514b[_0xfcf5('0x75')]('i.'+_0x4b66a9+_0xfcf5('0x7d'),_0x282d59[_0xfcf5('0x39')][_0x4b66a9]);}}});}if(_0x282d59[_0xfcf5('0x39')]['read']){if(_0x282d59[_0xfcf5('0x39')][_0xfcf5('0x7e')]==0x1){_0x27514b[_0xfcf5('0x60')](_0xfcf5('0x7f'));}else{_0x27514b[_0xfcf5('0x60')](_0xfcf5('0x80'));}}if(_0x282d59['query'][_0xfcf5('0x81')]){_0x234364=_[_0xfcf5('0x82')](_0x282d59[_0xfcf5('0x39')][_0xfcf5('0x81')])?_0x282d59['query'][_0xfcf5('0x81')]:new Array(_0x282d59[_0xfcf5('0x39')][_0xfcf5('0x81')]);_0x234364['forEach'](function(_0x5e7e42){_0x3d90cd['or'](_0xfcf5('0x6b'),'%,'+_0x5e7e42+',%');});}if(_0x282d59[_0xfcf5('0x39')]['filter']){var _0x49968c=_0x282d59[_0xfcf5('0x39')][_0xfcf5('0x83')][_0xfcf5('0x84')]('\x5c','\x5c\x5c')[_0xfcf5('0x84')](/'/g,'\x27\x27');if(qs[_0xfcf5('0x85')](_0x49968c)){_0x504e1c['or'](_0xfcf5('0x86'),_0x49968c+'%')['or'](_0xfcf5('0x87'),_0x49968c+'%');}else{_0x504e1c['or'](_0xfcf5('0x88'),qs[_0xfcf5('0x89')](_0x49968c))['or'](_0xfcf5('0x8a'),_0x49968c+'%');}}}_0x27514b['where'](_0x504e1c);_0x27514b[_0xfcf5('0x8b')]('i.id');var _0x538274={'type':db[_0xfcf5('0x8c')][_0xfcf5('0x8d')][_0xfcf5('0x8e')],'raw':!![]};var _0x610ac=_0x27514b['clone']();_0x610ac['field'](_0xfcf5('0x8f'));_0x610ac['field'](_0xfcf5('0x90'),_0xfcf5('0x5e'));if(_0x487745['order']){_0x487745[_0xfcf5('0x91')][_0xfcf5('0x32')](function(_0x548c6a){var _0x5505a0=_0x548c6a[0x0]==='contactName'?_0x548c6a[0x0]:'i.'+_0x548c6a[0x0];_0x27514b[_0xfcf5('0x91')](_0x5505a0,_0x548c6a[0x1]==='DESC'?![]:!![]);});}if(!_[_0xfcf5('0x73')](_0x234364)){_0x27514b[_0xfcf5('0x60')](_0x3d90cd);_0x610ac['where'](_0xfcf5('0x92'),_0x234364);}BPromise[_0xfcf5('0x93')]()[_0xfcf5('0x2a')](function(){if(!_0xa1efb9){if(_0x282d59[_0xfcf5('0x39')][_0xfcf5('0x74')])return;_0x610ac[_0xfcf5('0x75')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x27514b[_0xfcf5('0x75')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x282d59[_0xfcf5('0x94')][_0xfcf5('0x95')]!=='agent')return;return _0x282d59[_0xfcf5('0x94')][_0xfcf5('0x96')]({'attributes':['id'],'raw':!![]})[_0xfcf5('0x2a')](function(_0x1c443f){if(_['isEmpty'](_0x1c443f)){_0x610ac[_0xfcf5('0x75')](_0xfcf5('0x97'));_0x27514b[_0xfcf5('0x75')](_0xfcf5('0x97'));}else{_0x610ac['where'](_0xfcf5('0x76'),_[_0xfcf5('0x2e')](_0x1c443f,'id'));_0x27514b[_0xfcf5('0x75')](_0xfcf5('0x76'),_[_0xfcf5('0x2e')](_0x1c443f,'id'));}});})['then'](function(){if(_0x282d59[_0xfcf5('0x94')]['role']===_0xfcf5('0x98')&&!_0xa1efb9&&!_0x282d59[_0xfcf5('0x39')]['SmsAccountId'])return[];return db['sequelize']['query'](_0x610ac['toString'](),_0x538274);})['then'](function(_0x34beff){_0x34b714[_0xfcf5('0x26')]=_0x34beff[_0xfcf5('0x3f')];if(_0x34b714[_0xfcf5('0x26')]===0x0)return[];return db['sequelize'][_0xfcf5('0x39')](_0x16cd88['toString'](),_0x538274)['then'](function(_0x265da3){_0x2092e0=_[_0xfcf5('0x99')](_0x265da3,'id');_0x538274=_[_0xfcf5('0x9a')](_0x538274,{'model':db[_0xfcf5('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x282d59[_0xfcf5('0x39')][_0xfcf5('0x9b')]){_0x487745[_0xfcf5('0x3e')][_0xfcf5('0x32')](function(_0x1d9817){_0x27514b[_0xfcf5('0x45')]('i.'+_0x1d9817);});}else{_0x27514b[_0xfcf5('0x45')](_0xfcf5('0x90'),'unreadMessages');_0x27514b[_0xfcf5('0x45')](_0xfcf5('0x9c'),_0xfcf5('0x9d'));_0x27514b['field'](_0xfcf5('0x9e'),_0xfcf5('0x9f'));_0x27514b['field'](_0xfcf5('0xa0'),_0xfcf5('0xa1'));_0x27514b[_0xfcf5('0x45')](_0xfcf5('0xa2'));_0x27514b[_0xfcf5('0x45')](_0xfcf5('0xa3'),_0xfcf5('0xa4'));_0x27514b[_0xfcf5('0x45')](_0xfcf5('0xa5'),_0xfcf5('0xa6'));_0x27514b[_0xfcf5('0x45')](_0xfcf5('0xa7'),_0xfcf5('0xa8'));_0x27514b[_0xfcf5('0x45')](_0xfcf5('0xa9'),'Contact.phone');_0x27514b[_0xfcf5('0x45')](_0xfcf5('0xaa'),'Contact.mobile');_0x27514b[_0xfcf5('0x45')](_0xfcf5('0xab'),_0xfcf5('0xac'));_0x27514b['field'](_0xfcf5('0xad'),'Owner.fullname');_0x27514b[_0xfcf5('0x45')](_0xfcf5('0xae'),_0xfcf5('0xaf'));_0x27514b[_0xfcf5('0x45')](_0xfcf5('0xb0'),_0xfcf5('0x30'));}if(_0x487745[_0xfcf5('0x25')])_0x27514b['limit'](_0x487745['limit']);if(_0x487745['offset'])_0x27514b[_0xfcf5('0x23')](_0x487745[_0xfcf5('0x23')]);return db[_0xfcf5('0xb1')][_0xfcf5('0x39')](_0x27514b[_0xfcf5('0xb2')](),_0x538274);})[_0xfcf5('0x2a')](function(_0x981360){if(_0x981360[_0xfcf5('0x3f')]>0x0)_0x8a79df['where'](_0xfcf5('0xb3'),_[_0xfcf5('0x2e')](_0x981360,'id'));return db['sequelize'][_0xfcf5('0x39')](_0x8a79df[_0xfcf5('0xb2')](),_0x538274)[_0xfcf5('0x2a')](function(_0x3035c4){var _0x11da02=_[_0xfcf5('0xb4')](_0x3035c4,_0xfcf5('0xb5'));var _0x45ba07=[];_0x981360[_0xfcf5('0x32')](function(_0xe6eb0d){_0x45ba07['push'](updateSmsInteraction(_0xe6eb0d,_0x2092e0,_0x11da02));});return BPromise['all'](_0x45ba07);});});})['then'](function(_0x19ffa0){_0x34b714[_0xfcf5('0xb6')]=_0x19ffa0;return _0x34b714;})[_0xfcf5('0x2a')](respondWithFilteredResult(_0x9ae8d1,_0x487745))[_0xfcf5('0xb7')](handleError(_0x9ae8d1,null));};exports[_0xfcf5('0xb8')]=function(_0x4f39b0,_0x27719a){var _0x336d5d={'raw':![],'where':{'id':_0x4f39b0[_0xfcf5('0xb9')]['id']}},_0x3e2221={};_0x3e2221[_0xfcf5('0x3d')]=_[_0xfcf5('0x3a')](db[_0xfcf5('0x35')][_0xfcf5('0x36')]);_0x3e2221[_0xfcf5('0x39')]=_[_0xfcf5('0x3a')](_0x4f39b0[_0xfcf5('0x39')]);_0x3e2221[_0xfcf5('0x3b')]=_[_0xfcf5('0x3c')](_0x3e2221[_0xfcf5('0x3d')],_0x3e2221['query']);_0x336d5d[_0xfcf5('0x3e')]=_['intersection'](_0x3e2221[_0xfcf5('0x3d')],qs[_0xfcf5('0x9b')](_0x4f39b0[_0xfcf5('0x39')]['fields']));_0x336d5d[_0xfcf5('0x3e')]=_0x336d5d[_0xfcf5('0x3e')][_0xfcf5('0x3f')]?_0x336d5d[_0xfcf5('0x3e')]:_0x3e2221[_0xfcf5('0x3d')];if(_0x4f39b0['query'][_0xfcf5('0xba')]){_0x336d5d[_0xfcf5('0xbb')]=[{'all':!![]}];}_0x336d5d=_[_0xfcf5('0x9a')]({},_0x336d5d,_0x4f39b0[_0xfcf5('0xbc')]);return db[_0xfcf5('0x35')][_0xfcf5('0x5d')](_0x336d5d)['then'](handleEntityNotFound(_0x27719a,null))[_0xfcf5('0x2a')](respondWithResult(_0x27719a,null))['catch'](handleError(_0x27719a,null));};exports[_0xfcf5('0xbd')]=function(_0xdd8763,_0x2153bd){return db[_0xfcf5('0x35')][_0xfcf5('0xbd')](_0xdd8763['body'],{})[_0xfcf5('0x2a')](respondWithResult(_0x2153bd,0xc9))['catch'](handleError(_0x2153bd,null));};exports[_0xfcf5('0xbe')]=function(_0x5d33e2,_0x5ef6af){if(_0x5d33e2[_0xfcf5('0x70')]['id']){delete _0x5d33e2[_0xfcf5('0x70')]['id'];}return db[_0xfcf5('0x35')]['find']({'where':{'id':_0x5d33e2[_0xfcf5('0xb9')]['id']}})[_0xfcf5('0x2a')](handleEntityNotFound(_0x5ef6af,null))[_0xfcf5('0x2a')](saveUpdates(_0x5d33e2[_0xfcf5('0x70')],null))[_0xfcf5('0x2a')](respondWithResult(_0x5ef6af,null))[_0xfcf5('0xb7')](handleError(_0x5ef6af,null));};exports[_0xfcf5('0x2b')]=function(_0x3211da,_0x184425){return db['SmsInteraction']['find']({'where':{'id':_0x3211da[_0xfcf5('0xb9')]['id']}})[_0xfcf5('0x2a')](handleEntityNotFound(_0x184425,null))[_0xfcf5('0x2a')](removeEntity(_0x184425,null))[_0xfcf5('0xb7')](handleError(_0x184425,null));};exports[_0xfcf5('0xbf')]=function(_0x22a931,_0x48e0b3){return db[_0xfcf5('0x35')]['describe']()[_0xfcf5('0x2a')](respondWithResult(_0x48e0b3,null))[_0xfcf5('0xb7')](handleError(_0x48e0b3,null));};exports[_0xfcf5('0xc0')]=function(_0x10754f,_0x46efac,_0x3a5714){return db[_0xfcf5('0xc1')][_0xfcf5('0x5d')]({'where':{'id':_0x10754f['params']['id']}})[_0xfcf5('0x2a')](handleEntityNotFound(_0x46efac,null))[_0xfcf5('0x2a')](function(_0xf1b0ef){if(_0xf1b0ef){return _0xf1b0ef[_0xfcf5('0xc0')](_0x10754f['body']['ids'],_[_0xfcf5('0xc2')](_0x10754f[_0xfcf5('0x70')],[_0xfcf5('0xc3'),'id'])||{});}})[_0xfcf5('0x2a')](respondWithResult(_0x46efac,null))[_0xfcf5('0xb7')](handleError(_0x46efac,null));};exports[_0xfcf5('0xc4')]=function(_0x294734,_0x5812f9,_0x4ec187){var _0x1873e9={'raw':![],'where':{}};var _0x2dd177={};var _0x26cc25={'count':0x0,'rows':[]};return db[_0xfcf5('0x35')]['findOne']({'where':{'id':_0x294734[_0xfcf5('0xb9')]['id']}})[_0xfcf5('0x2a')](handleEntityNotFound(_0x5812f9,null))[_0xfcf5('0x2a')](function(_0x43fd77){if(_0x43fd77){_0x2dd177[_0xfcf5('0x3d')]=_[_0xfcf5('0x3a')](db[_0xfcf5('0xc1')][_0xfcf5('0x36')]);_0x2dd177['query']=_[_0xfcf5('0x3a')](_0x294734[_0xfcf5('0x39')]);_0x2dd177[_0xfcf5('0x3b')]=_[_0xfcf5('0x3c')](_0x2dd177['model'],_0x2dd177['query']);_0x1873e9[_0xfcf5('0x3e')]=_[_0xfcf5('0x3c')](_0x2dd177[_0xfcf5('0x3d')],qs[_0xfcf5('0x9b')](_0x294734[_0xfcf5('0x39')][_0xfcf5('0x9b')]));_0x1873e9[_0xfcf5('0x3e')]=_0x1873e9[_0xfcf5('0x3e')][_0xfcf5('0x3f')]?_0x1873e9['attributes']:_0x2dd177[_0xfcf5('0x3d')];if(!_0x294734[_0xfcf5('0x39')][_0xfcf5('0x40')](_0xfcf5('0x41'))){_0x1873e9[_0xfcf5('0x25')]=qs[_0xfcf5('0x25')](_0x294734[_0xfcf5('0x39')][_0xfcf5('0x25')]);_0x1873e9['offset']=qs['offset'](_0x294734['query'][_0xfcf5('0x23')]);}_0x1873e9[_0xfcf5('0x91')]=qs[_0xfcf5('0x42')](_0x294734[_0xfcf5('0x39')][_0xfcf5('0x42')]);_0x1873e9[_0xfcf5('0x75')]=qs['filters'](_[_0xfcf5('0x43')](_0x294734[_0xfcf5('0x39')],_0x2dd177['filters']));_0x1873e9[_0xfcf5('0x75')][_0xfcf5('0xb5')]=_0x43fd77['id'];if(_0x294734[_0xfcf5('0x39')][_0xfcf5('0x83')]){_0x1873e9[_0xfcf5('0x75')]=_[_0xfcf5('0x9a')](_0x1873e9[_0xfcf5('0x75')],{'$or':_['map'](_0x1873e9[_0xfcf5('0x3e')],function(_0x55736f){var _0x32aa90={};_0x32aa90[_0x55736f]={'$like':'%'+_0x294734[_0xfcf5('0x39')][_0xfcf5('0x83')]+'%'};return _0x32aa90;})});}if(_0x294734['query'][_0xfcf5('0x7a')]){var _0x1c9f14=_0x294734[_0xfcf5('0x39')][_0xfcf5('0x7a')]['split'](',');var _0x4df2ad={};_0x4df2ad[_0x1c9f14[0x0]]={'$gte':moment(_0x1c9f14[0x1])['format'](_0xfcf5('0xc5'))};_0x1873e9[_0xfcf5('0x75')]=_[_0xfcf5('0x9a')](_0x1873e9[_0xfcf5('0x75')],_0x4df2ad);}_0x1873e9=_[_0xfcf5('0x9a')]({},_0x1873e9,_0x294734[_0xfcf5('0xbc')]);return db[_0xfcf5('0xc1')][_0xfcf5('0x26')]({'where':_0x1873e9['where']})[_0xfcf5('0x2a')](function(_0x138d19){_0x26cc25[_0xfcf5('0x26')]=_0x138d19;if(_0x294734[_0xfcf5('0x39')][_0xfcf5('0xba')]){_0x1873e9[_0xfcf5('0xbb')]=[{'all':!![]}];}return db[_0xfcf5('0xc1')][_0xfcf5('0xc6')](_0x1873e9);})[_0xfcf5('0x2a')](function(_0xa08f6c){_0x26cc25['rows']=_0xa08f6c;return _0x26cc25;});}})[_0xfcf5('0x2a')](respondWithFilteredResult(_0x5812f9,_0x1873e9))[_0xfcf5('0xb7')](handleError(_0x5812f9,null));};exports[_0xfcf5('0xc7')]=function(_0x3dca25,_0x5e6b97,_0x1b6443){return db['SmsInteraction']['find']({'where':{'id':_0x3dca25[_0xfcf5('0xb9')]['id']}})['then'](handleEntityNotFound(_0x5e6b97,null))[_0xfcf5('0x2a')](function(_0x162a11){if(_0x162a11){return _0x162a11[_0xfcf5('0xc8')](_0x3dca25[_0xfcf5('0x70')]['ids'],_[_0xfcf5('0xc2')](_0x3dca25['body'],[_0xfcf5('0xc3'),'id'])||{})[_0xfcf5('0xc9')](function(){return db[_0xfcf5('0xca')][_0xfcf5('0xc6')]({'attributes':['id',_0xfcf5('0x2c'),_0xfcf5('0x46')],'where':{'id':_0x3dca25[_0xfcf5('0x70')][_0xfcf5('0xc3')]}});})['then'](function(_0x29b7f6){socket[_0xfcf5('0xcb')](_0xfcf5('0xcc'),{'id':Number(_0x3dca25[_0xfcf5('0xb9')]['id']),'tags':_0x29b7f6||[]});return{'id':Number(_0x3dca25[_0xfcf5('0xb9')]['id']),'tags':_0x29b7f6||[]};});}})['then'](respondWithResult(_0x5e6b97,null))[_0xfcf5('0xb7')](handleError(_0x5e6b97,null));};exports['removeTags']=function(_0x4d3728,_0x2ce438,_0x5de7fe){return db[_0xfcf5('0x35')][_0xfcf5('0x5d')]({'where':{'id':_0x4d3728['params']['id']}})['then'](handleEntityNotFound(_0x2ce438,null))[_0xfcf5('0x2a')](function(_0x14e0f6){if(_0x14e0f6){return _0x14e0f6[_0xfcf5('0xcd')](_0x4d3728[_0xfcf5('0x39')][_0xfcf5('0xc3')]);}})['then'](respondWithStatusCode(_0x2ce438,null))[_0xfcf5('0xb7')](handleError(_0x2ce438,null));};exports['download']=function(_0x5667f0,_0x175ba7){var _0xd6be95=moment()['unix']()['toString']();var _0x265238=path[_0xfcf5('0xce')](config['root'],_0xfcf5('0xcf'),_0xfcf5('0xd0'),_0xfcf5('0xd1'));var _0x519ae3=path[_0xfcf5('0xce')](config[_0xfcf5('0xd2')],'server','files','attachments');var _0x179ed6=path['join'](_0x265238,_0xd6be95);var _0x55a27c=util[_0xfcf5('0xd3')]('transcript-%d-%s.zip',_0x5667f0[_0xfcf5('0xb9')]['id'],_0xd6be95);var _0x74618e=path[_0xfcf5('0xce')](_0x265238,_0x55a27c);var _0x19c7b9=[];_0x19c7b9[_0xfcf5('0x33')]({'model':db['User'],'as':_0xfcf5('0x6c'),'attributes':['id',_0xfcf5('0xd4')],'raw':!![]});_0x19c7b9['push']({'model':db[_0xfcf5('0xd5')],'as':_0xfcf5('0x63'),'attributes':['id',_0xfcf5('0xd6'),_0xfcf5('0xd7')],'raw':!![]});var _0x9b32e2=[{'model':db[_0xfcf5('0xc1')],'as':_0xfcf5('0xd8'),'attributes':['id',_0xfcf5('0x70'),_0xfcf5('0x78'),_0xfcf5('0xd9'),_0xfcf5('0xda'),_0xfcf5('0x7e')],'include':_0x19c7b9}];_0x9b32e2['push']({'model':db[_0xfcf5('0xdb')],'as':_0xfcf5('0xdc'),'attributes':['id','name']});_0x9b32e2['push']({'model':db[_0xfcf5('0x6c')],'as':_0xfcf5('0xdd'),'attributes':['id',_0xfcf5('0xd4')]});return db[_0xfcf5('0x35')][_0xfcf5('0x5d')]({'where':{'id':_0x5667f0[_0xfcf5('0xb9')]['id']},'include':_0x9b32e2})[_0xfcf5('0x2a')](handleEntityNotFound(_0x175ba7,null))[_0xfcf5('0x2a')](function(_0x488b72){if(_0x488b72){var _0x1720dc=_0x488b72[_0xfcf5('0xde')]({'plain':!![]});fs[_0xfcf5('0xdf')](_0x179ed6);var _0x4771dd={'channel':'Sms','account':_0x1720dc[_0xfcf5('0xdc')][_0xfcf5('0x2c')],'agent':_0x1720dc['Owner']?_0x1720dc[_0xfcf5('0xdd')][_0xfcf5('0xd4')]:_0xfcf5('0xe0'),'createdAt':moment(_0x1720dc['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xfcf5('0xb2')](),'closedAt':_0x1720dc[_0xfcf5('0xe1')]?moment(_0x1720dc[_0xfcf5('0xe2')])[_0xfcf5('0xd3')](_0xfcf5('0xc5'))[_0xfcf5('0xb2')]():'','disposition':_0x1720dc[_0xfcf5('0xe3')],'messages':_(_0x1720dc[_0xfcf5('0xd8')])[_0xfcf5('0x83')]({'secret':![]})[_0xfcf5('0x2e')](function(_0x292a21){return{'date':moment(_0x292a21['createdAt'])[_0xfcf5('0xd3')](_0xfcf5('0xc5'))[_0xfcf5('0xb2')](),'sender':_0x292a21[_0xfcf5('0xd9')]===_0xfcf5('0xe4')?_0x292a21[_0xfcf5('0x6c')]?_0x292a21[_0xfcf5('0x6c')][_0xfcf5('0xd4')]:_0xfcf5('0xe5'):_0x292a21[_0xfcf5('0x63')][_0xfcf5('0xd6')]+(_0x292a21[_0xfcf5('0x63')]['lastName']?'\x20'+_0x292a21[_0xfcf5('0x63')][_0xfcf5('0xd7')]:''),'body':_0x292a21[_0xfcf5('0x70')],'direction':_0x292a21[_0xfcf5('0xd9')]===_0xfcf5('0xe4')?'A':'C','secret':_0x292a21[_0xfcf5('0xda')],'read':_0x292a21[_0xfcf5('0x7e')]};})['value']()};return ejs[_0xfcf5('0xe6')](path[_0xfcf5('0xce')](config[_0xfcf5('0xd2')],_0xfcf5('0xcf'),'views',_0xfcf5('0xe7')),{'interaction':_0x4771dd})[_0xfcf5('0x2a')](function(_0x2f5fad){var _0x341686=path[_0xfcf5('0xce')](_0x179ed6,_0xfcf5('0xe8')+_0x1720dc['id']+'-'+_0xd6be95+'.pdf');var _0x41320b={'path':_0x341686,'channel':_0xfcf5('0xe9'),'interactionId':_0x1720dc['id']};return pdf[_0xfcf5('0xea')](_0x2f5fad,_0x41320b);})[_0xfcf5('0x2a')](function(){return new BPromise(function(_0x413962,_0x2a6dd0){zipdir(_0x179ed6,{'saveTo':_0x74618e},function(_0x2ff14c,_0x5706d9){if(_0x2ff14c)return _0x2a6dd0(_0x2ff14c);return _0x413962(_0x5706d9);});})[_0xfcf5('0x2a')](function(){return new BPromise(function(_0x29b92f,_0x351560){rimraf(_0x179ed6,function(_0x5e15d4){if(_0x5e15d4)_0x351560(_0x5e15d4);return _0x29b92f();});});})['then'](function(){return _0x175ba7[_0xfcf5('0xeb')](_0x74618e,_0x55a27c,function(_0x3f8b7e){if(_0x3f8b7e){console['log'](_0xfcf5('0xec'),_0x3f8b7e);}else{fs[_0xfcf5('0xed')](_0x74618e);}});});});}else{return _0x175ba7[_0xfcf5('0x1f')](0xc8);}})['catch'](handleError(_0x175ba7,null));};
\ No newline at end of file
+var _0x4e48=['u.id','u.fullname','ui.SmsInteractionId','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','isEmpty','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','i.id','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','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','all','catch','show','params','intersection','includeAll','include','create','describe','addMessage','omit','ids','getMessages','SmsMessage','format','options','rows','addTags','setTags','findAll','removeTags','download','join','root','server','files','tmp','CmContact','firstName','Messages','direction','secret','SmsAccount','mkdirSync','Sms','Account','Owner','N.A.','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','disposition','System','lastName','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','index','SmsInteraction','rawAttributes','fieldName','type','key','model','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','select','field','color','from','tools_tags'];(function(_0x4e1bdc,_0x58a233){var _0x9bc2fc=function(_0x56a812){while(--_0x56a812){_0x4e1bdc['push'](_0x4e1bdc['shift']());}};_0x9bc2fc(++_0x58a233);}(_0x4e48,0x9c));var _0x84e4=function(_0x13783d,_0x19ebbb){_0x13783d=_0x13783d-0x0;var _0x312525=_0x4e48[_0x13783d];return _0x312525;};'use strict';var emlformat=require(_0x84e4('0x0'));var rimraf=require(_0x84e4('0x1'));var zipdir=require(_0x84e4('0x2'));var jsonpatch=require(_0x84e4('0x3'));var rp=require('request-promise');var moment=require(_0x84e4('0x4'));var BPromise=require(_0x84e4('0x5'));var Mustache=require(_0x84e4('0x6'));var util=require(_0x84e4('0x7'));var path=require(_0x84e4('0x8'));var sox=require(_0x84e4('0x9'));var csv=require(_0x84e4('0xa'));var ejs=require(_0x84e4('0xb'));var fs=require('fs');var fs_extra=require(_0x84e4('0xc'));var _=require(_0x84e4('0xd'));var squel=require(_0x84e4('0xe'));var crypto=require(_0x84e4('0xf'));var jsforce=require(_0x84e4('0x10'));var deskjs=require(_0x84e4('0x11'));var toCsv=require(_0x84e4('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x84e4('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x84e4('0x13'));var as=require(_0x84e4('0x14'));var pdf=require(_0x84e4('0x15'));var hardwareService=require(_0x84e4('0x16'));var logger=require(_0x84e4('0x17'))(_0x84e4('0x18'));var utils=require(_0x84e4('0x19'));var config=require(_0x84e4('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x84e4('0x1b'))['db'];config[_0x84e4('0x1c')]=_['defaults'](config[_0x84e4('0x1c')],{'host':_0x84e4('0x1d'),'port':0x18eb});var socket=require(_0x84e4('0x1e'))(new Redis(config['redis']));require(_0x84e4('0x1f'))[_0x84e4('0x20')](socket);function respondWithStatusCode(_0x42f37f,_0x46be07){_0x46be07=_0x46be07||0xcc;return function(_0x11445e){if(_0x11445e){return _0x42f37f[_0x84e4('0x21')](_0x46be07);}return _0x42f37f[_0x84e4('0x22')](_0x46be07)[_0x84e4('0x23')]();};}function respondWithResult(_0x57715b,_0x2c1e1a){_0x2c1e1a=_0x2c1e1a||0xc8;return function(_0x1ba000){if(_0x1ba000){return _0x57715b['status'](_0x2c1e1a)[_0x84e4('0x24')](_0x1ba000);}};}function respondWithFilteredResult(_0x4a19c4,_0xdad1db){return function(_0x1451e4){if(_0x1451e4){var _0x5568ef=typeof _0xdad1db['offset']===_0x84e4('0x25')&&typeof _0xdad1db[_0x84e4('0x26')]===_0x84e4('0x25');var _0x3ec7a9=_0x1451e4[_0x84e4('0x27')];var _0x36be2b=_0x5568ef?0x0:_0xdad1db[_0x84e4('0x28')];var _0x4fb094=_0x5568ef?_0x1451e4[_0x84e4('0x27')]:_0xdad1db[_0x84e4('0x28')]+_0xdad1db[_0x84e4('0x26')];var _0x5a03f8;if(_0x4fb094>=_0x3ec7a9){_0x4fb094=_0x3ec7a9;_0x5a03f8=0xc8;}else{_0x5a03f8=0xce;}_0x4a19c4['status'](_0x5a03f8);return _0x4a19c4[_0x84e4('0x29')](_0x84e4('0x2a'),_0x36be2b+'-'+_0x4fb094+'/'+_0x3ec7a9)[_0x84e4('0x24')](_0x1451e4);}return null;};}function patchUpdates(_0x398906){return function(_0x2ddb1e){try{jsonpatch['apply'](_0x2ddb1e,_0x398906,!![]);}catch(_0x1a6978){return BPromise[_0x84e4('0x2b')](_0x1a6978);}return _0x2ddb1e[_0x84e4('0x2c')]();};}function saveUpdates(_0xe2099e,_0xfd5cd2){return function(_0x45611c){if(_0x45611c){return _0x45611c[_0x84e4('0x2d')](_0xe2099e)['then'](function(_0x49f386){return _0x49f386;});}return null;};}function removeEntity(_0x9e705b,_0x44be7e){return function(_0x46fdd9){if(_0x46fdd9){return _0x46fdd9['destroy']()[_0x84e4('0x2e')](function(){_0x9e705b[_0x84e4('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x579d49,_0x4d5c5b){return function(_0x36bba8){if(!_0x36bba8){_0x579d49[_0x84e4('0x21')](0x194);}return _0x36bba8;};}function handleError(_0x1c40df,_0xa29a59){_0xa29a59=_0xa29a59||0x1f4;return function(_0x4460ac){logger['error'](_0x4460ac['stack']);if(_0x4460ac[_0x84e4('0x2f')]){delete _0x4460ac[_0x84e4('0x2f')];}_0x1c40df[_0x84e4('0x22')](_0xa29a59)[_0x84e4('0x30')](_0x4460ac);};}function getInteractionUsers(_0x275766,_0x1edbe4){return new BPromise(function(_0x4a917a,_0x4d1335){try{if(_0x1edbe4[_0x275766['id']]){_0x275766[_0x84e4('0x31')]=_[_0x84e4('0x32')](_0x1edbe4[_0x275766['id']],function(_0x1dae9e){return{'id':_0x1dae9e['id'],'fullname':_0x1dae9e[_0x84e4('0x33')]};});}}catch(_0x32f732){_0x4d1335(_0x32f732);}_0x4a917a(_0x275766);});}function getInteractionTags(_0x2e86f1,_0x4c3a92){return new BPromise(function(_0x360d65,_0x8761dd){try{if(_0x2e86f1[_0x84e4('0x34')]){_0x2e86f1[_0x84e4('0x35')]=[];_0x2e86f1[_0x84e4('0x34')][_0x84e4('0x36')](',')[_0x84e4('0x37')](function(_0x2512c4){_0x2e86f1['Tags'][_0x84e4('0x38')](_0x4c3a92[_0x2512c4]);});}delete _0x2e86f1[_0x84e4('0x34')];}catch(_0x568d41){_0x8761dd(_0x568d41);}_0x360d65(_0x2e86f1);});}function updateSmsInteraction(_0x3f8a07,_0x1130b1,_0x3853d3){return new BPromise(function(_0x2fba7f,_0x428823){return getInteractionUsers(_0x3f8a07,_0x3853d3)[_0x84e4('0x2e')](function(_0x1f6f52){return getInteractionTags(_0x1f6f52,_0x1130b1);})['then'](function(_0x2fd9dc){_0x2fba7f(_0x2fd9dc);})['catch'](function(_0x70789a){_0x428823(_0x70789a);});});}exports[_0x84e4('0x39')]=function(_0x4bdf6f,_0x5627a6){var _0x2307ab={},_0x54f640={},_0x30aecd={'count':0x0,'rows':[]};var _0x14bb1e=_[_0x84e4('0x32')](db[_0x84e4('0x3a')][_0x84e4('0x3b')],function(_0x426b39){return{'name':_0x426b39[_0x84e4('0x3c')],'type':_0x426b39[_0x84e4('0x3d')][_0x84e4('0x3e')]};});_0x54f640[_0x84e4('0x3f')]=_[_0x84e4('0x32')](_0x14bb1e,'name');_0x54f640['query']=_[_0x84e4('0x40')](_0x4bdf6f[_0x84e4('0x41')]);_0x54f640[_0x84e4('0x42')]=_['intersection'](_0x54f640[_0x84e4('0x3f')],_0x54f640[_0x84e4('0x41')]);_0x2307ab['attributes']=_['intersection'](_0x54f640[_0x84e4('0x3f')],qs[_0x84e4('0x43')](_0x4bdf6f[_0x84e4('0x41')][_0x84e4('0x43')]));_0x2307ab[_0x84e4('0x44')]=_0x2307ab['attributes'][_0x84e4('0x45')]?_0x2307ab[_0x84e4('0x44')]:_0x54f640[_0x84e4('0x3f')];if(!_0x4bdf6f[_0x84e4('0x41')][_0x84e4('0x46')](_0x84e4('0x47'))){_0x2307ab[_0x84e4('0x26')]=qs['limit'](_0x4bdf6f[_0x84e4('0x41')][_0x84e4('0x26')]);_0x2307ab[_0x84e4('0x28')]=qs[_0x84e4('0x28')](_0x4bdf6f[_0x84e4('0x41')]['offset']);}_0x2307ab[_0x84e4('0x48')]=qs[_0x84e4('0x49')](_0x4bdf6f[_0x84e4('0x41')][_0x84e4('0x49')]);_0x2307ab['where']=qs[_0x84e4('0x42')](_['pick'](_0x4bdf6f[_0x84e4('0x41')],_0x54f640[_0x84e4('0x42')]),_0x14bb1e);var _0x3fc36b=[];var _0x2bcbd9=squel[_0x84e4('0x4a')]()['field']('id')[_0x84e4('0x4b')]('name')[_0x84e4('0x4b')](_0x84e4('0x4c'))[_0x84e4('0x4d')](_0x84e4('0x4e'));var _0x361ac5=squel['select']()[_0x84e4('0x4b')](_0x84e4('0x4f'))[_0x84e4('0x4b')](_0x84e4('0x50'))[_0x84e4('0x4b')](_0x84e4('0x51'))[_0x84e4('0x4d')]('user_has_sms_interactions','ui')[_0x84e4('0x52')](_0x84e4('0x53'),'u',_0x84e4('0x54'));var _0x409bb7=squel[_0x84e4('0x4a')]()[_0x84e4('0x4d')](_0x84e4('0x55'),'i')['left_join'](_0x84e4('0x56'),'c',_0x84e4('0x57'))[_0x84e4('0x52')](_0x84e4('0x53'),'o',_0x84e4('0x58'))[_0x84e4('0x52')](_0x84e4('0x59'),'a',_0x84e4('0x5a'))[_0x84e4('0x52')](_0x84e4('0x5b'),'me','me.SmsInteractionId\x20=\x20i.id')['left_join'](_0x84e4('0x5c'),'it',_0x84e4('0x5d'))[_0x84e4('0x52')](_0x84e4('0x4e'),'t',_0x84e4('0x5e'));var _0x1e0aac=squel[_0x84e4('0x5f')]();var _0x1e378a=[];var _0x3e1892=squel[_0x84e4('0x5f')]();var _0x27b832;if(_0x4bdf6f[_0x84e4('0x41')]['search']){_0x27b832=as[_0x84e4('0x60')](_0x4bdf6f[_0x84e4('0x41')][_0x84e4('0x61')]);var _0x2b7049=_0x27b832[_0x84e4('0x62')];for(var _0x2650a1=0x0;_0x2650a1<_0x27b832[_0x84e4('0x63')][_0x84e4('0x45')];_0x2650a1++){var _0x3504b3=_0x27b832[_0x84e4('0x63')][_0x2650a1];var _0x1db47c='i';var _0x4e768d=_[_0x84e4('0x64')](_0x14bb1e,[_0x84e4('0x2f'),_0x3504b3[_0x84e4('0x4b')]]);if(!_0x4e768d){switch(_0x3504b3[_0x84e4('0x4b')]){case _0x84e4('0x65'):if(_0x3504b3[_0x84e4('0x66')]==0x1){_0x409bb7[_0x84e4('0x67')]('`'+_0x3504b3[_0x84e4('0x4b')]+_0x84e4('0x68'));}else{_0x409bb7[_0x84e4('0x67')]('`'+_0x3504b3[_0x84e4('0x4b')]+_0x84e4('0x69'));}break;case _0x84e4('0x6a'):if(_0x3504b3[_0x84e4('0x6b')]===_0x84e4('0x6c')){if(_0x3504b3[_0x84e4('0x66')][_0x84e4('0x36')]('\x20')['length']>0x1){_0x1e0aac[_0x2b7049]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x84e4('0x6d')](_0x3504b3['value']),null);}else{var _0x59e8c7='%'+_0x3504b3[_0x84e4('0x66')]+'%';_0x1e0aac[_0x2b7049](_0x84e4('0x6e'),_0x59e8c7,_0x59e8c7,_0x59e8c7);}}else{_0x4e768d=_[_0x84e4('0x64')](_0x14bb1e,[_0x84e4('0x2f'),'ContactId']);_0x3504b3[_0x84e4('0x4b')]='ContactId';_0x208e63=as[_0x84e4('0x6f')](_0x1db47c,_0x4e768d['type'],_0x3504b3);_0x1e0aac[_0x2b7049](_0x208e63[_0x84e4('0x70')],_0x208e63[_0x84e4('0x66')][_0x84e4('0x71')],_0x208e63[_0x84e4('0x66')]['end']);}break;case _0x84e4('0x72'):var _0x1be8f8=_0x3504b3['value'][_0x84e4('0x36')](',')['map'](function(_0x318767){return Number(_0x318767);});_0x1be8f8[_0x84e4('0x37')](function(_0x234d63){_0x3e1892['or'](_0x84e4('0x73'),'%,'+_0x234d63+',%');});_0x1e378a=_[_0x84e4('0x74')](_0x1e378a,_0x1be8f8);break;case _0x84e4('0x75'):if(_0x3504b3['operator']==='$substring'){_0x1e0aac[_0x2b7049](_0x84e4('0x76'),'%'+_0x3504b3[_0x84e4('0x66')]+'%',null);}else{_0x4e768d=_[_0x84e4('0x64')](_0x14bb1e,['name','UserId']);_0x3504b3[_0x84e4('0x4b')]='UserId';_0x208e63=as['buildExpression'](_0x1db47c,_0x4e768d[_0x84e4('0x3d')],_0x3504b3);_0x1e0aac[_0x2b7049](_0x208e63[_0x84e4('0x70')],_0x208e63[_0x84e4('0x66')][_0x84e4('0x71')],_0x208e63['value'][_0x84e4('0x23')]);}break;case _0x84e4('0x77'):_0x208e63=as[_0x84e4('0x6f')]('me',null,_0x3504b3);_0x1e0aac[_0x2b7049](_0x208e63['text'],_0x208e63[_0x84e4('0x66')][_0x84e4('0x71')],_0x208e63[_0x84e4('0x66')]['end']);break;}}else{var _0x208e63=as['buildExpression'](_0x1db47c,_0x4e768d[_0x84e4('0x3d')],_0x3504b3);_0x1e0aac[_0x2b7049](_0x208e63[_0x84e4('0x70')],_0x208e63[_0x84e4('0x66')][_0x84e4('0x71')],_0x208e63[_0x84e4('0x66')][_0x84e4('0x23')]);}}}else{var _0x2cf929=_(_0x4bdf6f[_0x84e4('0x41')])['keys']()['map'](function(_0x1c8271){return _[_0x84e4('0x78')](_0x14bb1e,[_0x84e4('0x2f'),_0x1c8271])?_0x1c8271:undefined;})[_0x84e4('0x79')]()[_0x84e4('0x66')]();if(!_[_0x84e4('0x7a')](_0x2cf929)){_0x2cf929[_0x84e4('0x37')](function(_0x4cd278){if(_0x4cd278===_0x84e4('0x7b')){_0x409bb7[_0x84e4('0x7c')](_0x84e4('0x7d'),[][_0x84e4('0x7e')](_0x4bdf6f[_0x84e4('0x41')][_0x4cd278]));}else if(_0x4cd278===_0x84e4('0x7f')){var _0x3b93ec=JSON[_0x84e4('0x80')](_0x4bdf6f[_0x84e4('0x41')][_0x4cd278])[_0x84e4('0x81')];var _0x4f3722=JSON['parse'](_0x4bdf6f[_0x84e4('0x41')][_0x4cd278])[_0x84e4('0x82')];_0x409bb7[_0x84e4('0x7c')](_0x84e4('0x83'),_0x3b93ec,_0x4f3722);}else{if(_0x4bdf6f[_0x84e4('0x41')][_0x4cd278]===_0x84e4('0x84')){_0x409bb7['where']('i.'+_0x4cd278+_0x84e4('0x85'));}else{_0x409bb7[_0x84e4('0x7c')]('i.'+_0x4cd278+_0x84e4('0x86'),_0x4bdf6f[_0x84e4('0x41')][_0x4cd278]);}}});}if(_0x4bdf6f[_0x84e4('0x41')][_0x84e4('0x87')]){if(_0x4bdf6f['query'][_0x84e4('0x87')]==0x1){_0x409bb7[_0x84e4('0x67')]('`unreadMessages`\x20=\x200');}else{_0x409bb7[_0x84e4('0x67')](_0x84e4('0x88'));}}if(_0x4bdf6f[_0x84e4('0x41')][_0x84e4('0x89')]){_0x1e378a=_[_0x84e4('0x8a')](_0x4bdf6f['query'][_0x84e4('0x89')])?_0x4bdf6f[_0x84e4('0x41')][_0x84e4('0x89')]:new Array(_0x4bdf6f[_0x84e4('0x41')]['tag']);_0x1e378a[_0x84e4('0x37')](function(_0x245420){_0x3e1892['or'](_0x84e4('0x73'),'%,'+_0x245420+',%');});}if(_0x4bdf6f[_0x84e4('0x41')][_0x84e4('0x8b')]){var _0x3b8a0d=_0x4bdf6f['query']['filter'][_0x84e4('0x8c')]('\x5c','\x5c\x5c')[_0x84e4('0x8c')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x3b8a0d)){_0x1e0aac['or'](_0x84e4('0x8d'),_0x3b8a0d+'%')['or'](_0x84e4('0x8e'),_0x3b8a0d+'%');}else{_0x1e0aac['or'](_0x84e4('0x8f'),qs['getFullTextValue'](_0x3b8a0d))['or'](_0x84e4('0x90'),_0x3b8a0d+'%');}}}_0x409bb7['where'](_0x1e0aac);_0x409bb7[_0x84e4('0x91')]('i.id');var _0x4eb0d7={'type':db[_0x84e4('0x92')][_0x84e4('0x93')][_0x84e4('0x94')],'raw':!![]};var _0xb13e26=_0x409bb7['clone']();_0xb13e26[_0x84e4('0x4b')](_0x84e4('0x95'));_0xb13e26['field'](_0x84e4('0x96'),_0x84e4('0x65'));if(_0x2307ab[_0x84e4('0x48')]){_0x2307ab['order'][_0x84e4('0x37')](function(_0x2e9aea){var _0x59c953=_0x2e9aea[0x0]===_0x84e4('0x97')?_0x2e9aea[0x0]:'i.'+_0x2e9aea[0x0];_0x409bb7[_0x84e4('0x48')](_0x59c953,_0x2e9aea[0x1]===_0x84e4('0x98')?![]:!![]);});}if(!_['isEmpty'](_0x1e378a)){_0x409bb7[_0x84e4('0x67')](_0x3e1892);_0xb13e26['where'](_0x84e4('0x99'),_0x1e378a);}BPromise[_0x84e4('0x9a')]()[_0x84e4('0x2e')](function(){if(!_0x27b832){if(_0x4bdf6f['query'][_0x84e4('0x7b')])return;_0xb13e26[_0x84e4('0x7c')](_0x84e4('0x9b'));_0x409bb7[_0x84e4('0x7c')](_0x84e4('0x9b'));return;}if(_0x4bdf6f[_0x84e4('0x9c')][_0x84e4('0x9d')]!=='agent')return;return _0x4bdf6f[_0x84e4('0x9c')][_0x84e4('0x9e')]({'attributes':['id'],'raw':!![]})['then'](function(_0x24bacf){if(_[_0x84e4('0x7a')](_0x24bacf)){_0xb13e26[_0x84e4('0x7c')]('i.SmsAccountId\x20IS\x20NULL');_0x409bb7[_0x84e4('0x7c')](_0x84e4('0x9f'));}else{_0xb13e26[_0x84e4('0x7c')](_0x84e4('0x7d'),_[_0x84e4('0x32')](_0x24bacf,'id'));_0x409bb7['where'](_0x84e4('0x7d'),_[_0x84e4('0x32')](_0x24bacf,'id'));}});})[_0x84e4('0x2e')](function(){if(_0x4bdf6f['user'][_0x84e4('0x9d')]===_0x84e4('0xa0')&&!_0x27b832&&!_0x4bdf6f[_0x84e4('0x41')][_0x84e4('0x7b')])return[];return db[_0x84e4('0xa1')][_0x84e4('0x41')](_0xb13e26[_0x84e4('0xa2')](),_0x4eb0d7);})[_0x84e4('0x2e')](function(_0x4efdaf){_0x30aecd[_0x84e4('0x27')]=_0x4efdaf['length'];if(_0x30aecd['count']===0x0)return[];return db[_0x84e4('0xa1')][_0x84e4('0x41')](_0x2bcbd9[_0x84e4('0xa2')](),_0x4eb0d7)[_0x84e4('0x2e')](function(_0x487bd1){_0x3fc36b=_[_0x84e4('0xa3')](_0x487bd1,'id');_0x4eb0d7=_[_0x84e4('0xa4')](_0x4eb0d7,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4bdf6f['query'][_0x84e4('0x43')]){_0x2307ab[_0x84e4('0x44')][_0x84e4('0x37')](function(_0x47a74f){_0x409bb7['field']('i.'+_0x47a74f);});}else{_0x409bb7['field'](_0x84e4('0x96'),_0x84e4('0x65'));_0x409bb7[_0x84e4('0x4b')](_0x84e4('0xa5'),_0x84e4('0xa6'));_0x409bb7[_0x84e4('0x4b')](_0x84e4('0xa7'),'Account.mandatoryDisposition');_0x409bb7[_0x84e4('0x4b')](_0x84e4('0xa8'),_0x84e4('0x97'));_0x409bb7[_0x84e4('0x4b')](_0x84e4('0xa9'));_0x409bb7[_0x84e4('0x4b')](_0x84e4('0xaa'),_0x84e4('0xab'));_0x409bb7['field'](_0x84e4('0xac'),_0x84e4('0xad'));_0x409bb7['field'](_0x84e4('0xae'),_0x84e4('0xaf'));_0x409bb7[_0x84e4('0x4b')](_0x84e4('0xb0'),_0x84e4('0xb1'));_0x409bb7[_0x84e4('0x4b')](_0x84e4('0xb2'),'Contact.mobile');_0x409bb7[_0x84e4('0x4b')](_0x84e4('0xb3'),_0x84e4('0xb4'));_0x409bb7[_0x84e4('0x4b')](_0x84e4('0xb5'),'Owner.fullname');_0x409bb7[_0x84e4('0x4b')](_0x84e4('0xb6'),'Owner.internal');_0x409bb7[_0x84e4('0x4b')](_0x84e4('0xb7'),_0x84e4('0x34'));}if(_0x2307ab[_0x84e4('0x26')])_0x409bb7[_0x84e4('0x26')](_0x2307ab[_0x84e4('0x26')]);if(_0x2307ab[_0x84e4('0x28')])_0x409bb7[_0x84e4('0x28')](_0x2307ab[_0x84e4('0x28')]);return db[_0x84e4('0xa1')][_0x84e4('0x41')](_0x409bb7[_0x84e4('0xa2')](),_0x4eb0d7);})[_0x84e4('0x2e')](function(_0x17b11c){if(_0x17b11c[_0x84e4('0x45')]>0x0)_0x361ac5['where']('ui.SmsInteractionId\x20IN\x20?',_['map'](_0x17b11c,'id'));return db[_0x84e4('0xa1')]['query'](_0x361ac5[_0x84e4('0xa2')](),_0x4eb0d7)[_0x84e4('0x2e')](function(_0x1b02c2){var _0x5bfa10=_[_0x84e4('0xb8')](_0x1b02c2,'SmsInteractionId');var _0x578b76=[];_0x17b11c[_0x84e4('0x37')](function(_0x436111){_0x578b76[_0x84e4('0x38')](updateSmsInteraction(_0x436111,_0x3fc36b,_0x5bfa10));});return BPromise[_0x84e4('0xb9')](_0x578b76);});});})[_0x84e4('0x2e')](function(_0x2319c8){_0x30aecd['rows']=_0x2319c8;return _0x30aecd;})[_0x84e4('0x2e')](respondWithFilteredResult(_0x5627a6,_0x2307ab))[_0x84e4('0xba')](handleError(_0x5627a6,null));};exports[_0x84e4('0xbb')]=function(_0x2df39e,_0x72e50d){var _0x393641={'raw':![],'where':{'id':_0x2df39e[_0x84e4('0xbc')]['id']}},_0x5d08da={};_0x5d08da['model']=_[_0x84e4('0x40')](db[_0x84e4('0x3a')]['rawAttributes']);_0x5d08da[_0x84e4('0x41')]=_['keys'](_0x2df39e[_0x84e4('0x41')]);_0x5d08da['filters']=_[_0x84e4('0xbd')](_0x5d08da[_0x84e4('0x3f')],_0x5d08da[_0x84e4('0x41')]);_0x393641[_0x84e4('0x44')]=_['intersection'](_0x5d08da[_0x84e4('0x3f')],qs[_0x84e4('0x43')](_0x2df39e[_0x84e4('0x41')]['fields']));_0x393641[_0x84e4('0x44')]=_0x393641[_0x84e4('0x44')][_0x84e4('0x45')]?_0x393641[_0x84e4('0x44')]:_0x5d08da[_0x84e4('0x3f')];if(_0x2df39e['query'][_0x84e4('0xbe')]){_0x393641[_0x84e4('0xbf')]=[{'all':!![]}];}_0x393641=_[_0x84e4('0xa4')]({},_0x393641,_0x2df39e['options']);return db[_0x84e4('0x3a')][_0x84e4('0x64')](_0x393641)[_0x84e4('0x2e')](handleEntityNotFound(_0x72e50d,null))['then'](respondWithResult(_0x72e50d,null))[_0x84e4('0xba')](handleError(_0x72e50d,null));};exports[_0x84e4('0xc0')]=function(_0x456acc,_0x18a4fc){return db[_0x84e4('0x3a')][_0x84e4('0xc0')](_0x456acc[_0x84e4('0x77')],{})[_0x84e4('0x2e')](respondWithResult(_0x18a4fc,0xc9))[_0x84e4('0xba')](handleError(_0x18a4fc,null));};exports['update']=function(_0xfa5625,_0x49506b){if(_0xfa5625['body']['id']){delete _0xfa5625[_0x84e4('0x77')]['id'];}return db[_0x84e4('0x3a')][_0x84e4('0x64')]({'where':{'id':_0xfa5625[_0x84e4('0xbc')]['id']}})[_0x84e4('0x2e')](handleEntityNotFound(_0x49506b,null))[_0x84e4('0x2e')](saveUpdates(_0xfa5625[_0x84e4('0x77')],null))[_0x84e4('0x2e')](respondWithResult(_0x49506b,null))[_0x84e4('0xba')](handleError(_0x49506b,null));};exports['destroy']=function(_0x5a4583,_0x1b248c){return db[_0x84e4('0x3a')][_0x84e4('0x64')]({'where':{'id':_0x5a4583[_0x84e4('0xbc')]['id']}})[_0x84e4('0x2e')](handleEntityNotFound(_0x1b248c,null))[_0x84e4('0x2e')](removeEntity(_0x1b248c,null))[_0x84e4('0xba')](handleError(_0x1b248c,null));};exports['describe']=function(_0x1c3116,_0x2bfb17){return db[_0x84e4('0x3a')][_0x84e4('0xc1')]()[_0x84e4('0x2e')](respondWithResult(_0x2bfb17,null))['catch'](handleError(_0x2bfb17,null));};exports['addMessage']=function(_0x5c4138,_0x4150c9,_0x993de7){return db['SmsMessage'][_0x84e4('0x64')]({'where':{'id':_0x5c4138[_0x84e4('0xbc')]['id']}})[_0x84e4('0x2e')](handleEntityNotFound(_0x4150c9,null))['then'](function(_0x560329){if(_0x560329){return _0x560329[_0x84e4('0xc2')](_0x5c4138[_0x84e4('0x77')]['ids'],_[_0x84e4('0xc3')](_0x5c4138[_0x84e4('0x77')],[_0x84e4('0xc4'),'id'])||{});}})['then'](respondWithResult(_0x4150c9,null))[_0x84e4('0xba')](handleError(_0x4150c9,null));};exports[_0x84e4('0xc5')]=function(_0xec4098,_0x217623,_0x383b1b){var _0xa7bff7={'raw':![],'where':{}};var _0x4c8d6a={};var _0x402e8f={'count':0x0,'rows':[]};return db[_0x84e4('0x3a')]['findOne']({'where':{'id':_0xec4098[_0x84e4('0xbc')]['id']}})[_0x84e4('0x2e')](handleEntityNotFound(_0x217623,null))[_0x84e4('0x2e')](function(_0x1351c8){if(_0x1351c8){_0x4c8d6a[_0x84e4('0x3f')]=_[_0x84e4('0x40')](db[_0x84e4('0xc6')][_0x84e4('0x3b')]);_0x4c8d6a[_0x84e4('0x41')]=_['keys'](_0xec4098['query']);_0x4c8d6a[_0x84e4('0x42')]=_[_0x84e4('0xbd')](_0x4c8d6a[_0x84e4('0x3f')],_0x4c8d6a[_0x84e4('0x41')]);_0xa7bff7['attributes']=_[_0x84e4('0xbd')](_0x4c8d6a['model'],qs[_0x84e4('0x43')](_0xec4098[_0x84e4('0x41')][_0x84e4('0x43')]));_0xa7bff7['attributes']=_0xa7bff7[_0x84e4('0x44')]['length']?_0xa7bff7['attributes']:_0x4c8d6a[_0x84e4('0x3f')];if(!_0xec4098[_0x84e4('0x41')]['hasOwnProperty'](_0x84e4('0x47'))){_0xa7bff7[_0x84e4('0x26')]=qs[_0x84e4('0x26')](_0xec4098['query'][_0x84e4('0x26')]);_0xa7bff7[_0x84e4('0x28')]=qs[_0x84e4('0x28')](_0xec4098['query']['offset']);}_0xa7bff7[_0x84e4('0x48')]=qs[_0x84e4('0x49')](_0xec4098[_0x84e4('0x41')]['sort']);_0xa7bff7[_0x84e4('0x7c')]=qs[_0x84e4('0x42')](_['pick'](_0xec4098[_0x84e4('0x41')],_0x4c8d6a[_0x84e4('0x42')]));_0xa7bff7[_0x84e4('0x7c')]['SmsInteractionId']=_0x1351c8['id'];if(_0xec4098[_0x84e4('0x41')][_0x84e4('0x8b')]){_0xa7bff7['where']=_['merge'](_0xa7bff7['where'],{'$or':_[_0x84e4('0x32')](_0xa7bff7[_0x84e4('0x44')],function(_0x4336c2){var _0x424766={};_0x424766[_0x4336c2]={'$like':'%'+_0xec4098[_0x84e4('0x41')][_0x84e4('0x8b')]+'%'};return _0x424766;})});}if(_0xec4098['query'][_0x84e4('0x81')]){var _0x14e6cf=_0xec4098[_0x84e4('0x41')][_0x84e4('0x81')][_0x84e4('0x36')](',');var _0x3dc951={};_0x3dc951[_0x14e6cf[0x0]]={'$gte':moment(_0x14e6cf[0x1])[_0x84e4('0xc7')]('YYYY-MM-DD\x20HH:mm:ss')};_0xa7bff7[_0x84e4('0x7c')]=_[_0x84e4('0xa4')](_0xa7bff7[_0x84e4('0x7c')],_0x3dc951);}_0xa7bff7=_['merge']({},_0xa7bff7,_0xec4098[_0x84e4('0xc8')]);return db['SmsMessage'][_0x84e4('0x27')]({'where':_0xa7bff7[_0x84e4('0x7c')]})[_0x84e4('0x2e')](function(_0x2d702e){_0x402e8f['count']=_0x2d702e;if(_0xec4098['query'][_0x84e4('0xbe')]){_0xa7bff7[_0x84e4('0xbf')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0xa7bff7);})[_0x84e4('0x2e')](function(_0x580327){_0x402e8f[_0x84e4('0xc9')]=_0x580327;return _0x402e8f;});}})['then'](respondWithFilteredResult(_0x217623,_0xa7bff7))[_0x84e4('0xba')](handleError(_0x217623,null));};exports[_0x84e4('0xca')]=function(_0x59d66b,_0x2ae213,_0x2e917d){return db[_0x84e4('0x3a')][_0x84e4('0x64')]({'where':{'id':_0x59d66b[_0x84e4('0xbc')]['id']}})[_0x84e4('0x2e')](handleEntityNotFound(_0x2ae213,null))[_0x84e4('0x2e')](function(_0x4cd4ec){if(_0x4cd4ec){return _0x4cd4ec[_0x84e4('0xcb')](_0x59d66b[_0x84e4('0x77')][_0x84e4('0xc4')],_[_0x84e4('0xc3')](_0x59d66b['body'],[_0x84e4('0xc4'),'id'])||{})['spread'](function(){return db[_0x84e4('0x72')][_0x84e4('0xcc')]({'attributes':['id',_0x84e4('0x2f'),_0x84e4('0x4c')],'where':{'id':_0x59d66b['body'][_0x84e4('0xc4')]}});})[_0x84e4('0x2e')](function(_0x359442){socket['emit']('smsInteractionTags:save',{'id':Number(_0x59d66b[_0x84e4('0xbc')]['id']),'tags':_0x359442||[]});return{'id':Number(_0x59d66b[_0x84e4('0xbc')]['id']),'tags':_0x359442||[]};});}})[_0x84e4('0x2e')](respondWithResult(_0x2ae213,null))[_0x84e4('0xba')](handleError(_0x2ae213,null));};exports['removeTags']=function(_0x59a431,_0x5c2112,_0x49b94d){return db[_0x84e4('0x3a')][_0x84e4('0x64')]({'where':{'id':_0x59a431['params']['id']}})[_0x84e4('0x2e')](handleEntityNotFound(_0x5c2112,null))['then'](function(_0x3d6d61){if(_0x3d6d61){return _0x3d6d61[_0x84e4('0xcd')](_0x59a431[_0x84e4('0x41')][_0x84e4('0xc4')]);}})[_0x84e4('0x2e')](respondWithStatusCode(_0x5c2112,null))[_0x84e4('0xba')](handleError(_0x5c2112,null));};exports[_0x84e4('0xce')]=function(_0x4717bf,_0x1d2a2d){var _0x180b7a=moment()['unix']()[_0x84e4('0xa2')]();var _0x51ba04=path[_0x84e4('0xcf')](config[_0x84e4('0xd0')],_0x84e4('0xd1'),_0x84e4('0xd2'),_0x84e4('0xd3'));var _0x5f420a=path['join'](config[_0x84e4('0xd0')],_0x84e4('0xd1'),_0x84e4('0xd2'),'attachments');var _0x509c1e=path[_0x84e4('0xcf')](_0x51ba04,_0x180b7a);var _0x2e48e3=util['format']('transcript-%d-%s.zip',_0x4717bf[_0x84e4('0xbc')]['id'],_0x180b7a);var _0x507733=path['join'](_0x51ba04,_0x2e48e3);var _0x32943b=[];_0x32943b['push']({'model':db[_0x84e4('0x75')],'as':_0x84e4('0x75'),'attributes':['id',_0x84e4('0x33')],'raw':!![]});_0x32943b[_0x84e4('0x38')]({'model':db[_0x84e4('0xd4')],'as':_0x84e4('0x6a'),'attributes':['id',_0x84e4('0xd5'),'lastName'],'raw':!![]});var _0x477e86=[{'model':db['SmsMessage'],'as':_0x84e4('0xd6'),'attributes':['id','body',_0x84e4('0x7f'),_0x84e4('0xd7'),_0x84e4('0xd8'),_0x84e4('0x87')],'include':_0x32943b}];_0x477e86[_0x84e4('0x38')]({'model':db[_0x84e4('0xd9')],'as':'Account','attributes':['id',_0x84e4('0x2f')]});_0x477e86[_0x84e4('0x38')]({'model':db['User'],'as':'Owner','attributes':['id',_0x84e4('0x33')]});return db['SmsInteraction'][_0x84e4('0x64')]({'where':{'id':_0x4717bf[_0x84e4('0xbc')]['id']},'include':_0x477e86})['then'](handleEntityNotFound(_0x1d2a2d,null))[_0x84e4('0x2e')](function(_0x15e9e8){if(_0x15e9e8){var _0x1a8cef=_0x15e9e8['get']({'plain':!![]});fs[_0x84e4('0xda')](_0x509c1e);var _0x3e7f6b={'channel':_0x84e4('0xdb'),'account':_0x1a8cef[_0x84e4('0xdc')]['name'],'agent':_0x1a8cef['Owner']?_0x1a8cef[_0x84e4('0xdd')][_0x84e4('0x33')]:_0x84e4('0xde'),'createdAt':moment(_0x1a8cef[_0x84e4('0x7f')])[_0x84e4('0xc7')](_0x84e4('0xdf'))[_0x84e4('0xa2')](),'closedAt':_0x1a8cef[_0x84e4('0xe0')]?moment(_0x1a8cef[_0x84e4('0xe1')])[_0x84e4('0xc7')](_0x84e4('0xdf'))['toString']():'','disposition':_0x1a8cef[_0x84e4('0xe2')],'messages':_(_0x1a8cef['Messages'])[_0x84e4('0x8b')]({'secret':![]})[_0x84e4('0x32')](function(_0xa970e8){return{'date':moment(_0xa970e8[_0x84e4('0x7f')])[_0x84e4('0xc7')](_0x84e4('0xdf'))[_0x84e4('0xa2')](),'sender':_0xa970e8['direction']==='out'?_0xa970e8['User']?_0xa970e8['User'][_0x84e4('0x33')]:_0x84e4('0xe3'):_0xa970e8[_0x84e4('0x6a')]['firstName']+(_0xa970e8['Contact'][_0x84e4('0xe4')]?'\x20'+_0xa970e8[_0x84e4('0x6a')]['lastName']:''),'body':_0xa970e8[_0x84e4('0x77')],'direction':_0xa970e8[_0x84e4('0xd7')]==='out'?'A':'C','secret':_0xa970e8['secret'],'read':_0xa970e8['read']};})[_0x84e4('0x66')]()};return ejs['renderFile'](path[_0x84e4('0xcf')](config[_0x84e4('0xd0')],_0x84e4('0xd1'),_0x84e4('0xe5'),_0x84e4('0xe6')),{'interaction':_0x3e7f6b})[_0x84e4('0x2e')](function(_0x3d25e4){var _0x1d5bc5=path['join'](_0x509c1e,_0x84e4('0xe7')+_0x1a8cef['id']+'-'+_0x180b7a+_0x84e4('0xe8'));var _0x13016c={'path':_0x1d5bc5,'channel':_0x84e4('0xdb'),'interactionId':_0x1a8cef['id']};return pdf[_0x84e4('0xe9')](_0x3d25e4,_0x13016c);})[_0x84e4('0x2e')](function(){return new BPromise(function(_0xed4101,_0x50b2c6){zipdir(_0x509c1e,{'saveTo':_0x507733},function(_0x465075,_0x337a1e){if(_0x465075)return _0x50b2c6(_0x465075);return _0xed4101(_0x337a1e);});})[_0x84e4('0x2e')](function(){return new BPromise(function(_0x49ea66,_0x2e0707){rimraf(_0x509c1e,function(_0x80bec0){if(_0x80bec0)_0x2e0707(_0x80bec0);return _0x49ea66();});});})[_0x84e4('0x2e')](function(){return _0x1d2a2d[_0x84e4('0xce')](_0x507733,_0x2e48e3,function(_0x19204a){if(_0x19204a){console['log'](_0x84e4('0xea'),_0x19204a);}else{fs['unlinkSync'](_0x507733);}});});});}else{return _0x1d2a2d['sendStatus'](0xc8);}})[_0x84e4('0xba')](handleError(_0x1d2a2d,null));};
\ No newline at end of file
index 3231c7f..fb1930a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5204=['hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','getUsers','then','setDataValue','Users','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x57d225,_0xc0ebf6){var _0x23f7e5=function(_0x458e8e){while(--_0x458e8e){_0x57d225['push'](_0x57d225['shift']());}};_0x23f7e5(++_0xc0ebf6);}(_0x5204,0xdf));var _0x4520=function(_0x2adfb1,_0x406e6e){_0x2adfb1=_0x2adfb1-0x0;var _0xa52d45=_0x5204[_0x2adfb1];return _0xa52d45;};'use strict';var EventEmitter=require(_0x4520('0x0'));var SmsInteraction=require(_0x4520('0x1'))['db']['SmsInteraction'];var SmsMessage=require(_0x4520('0x1'))['db'][_0x4520('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x4520('0x3')](0x0);var events={'afterCreate':_0x4520('0x4'),'afterUpdate':_0x4520('0x5'),'afterDestroy':'remove'};function emitEvent(_0x41d89c){return function(_0x58b8a8,_0x180174,_0x209381){_0x58b8a8[_0x4520('0x6')]({'attributes':['id'],'raw':!![]})[_0x4520('0x7')](function(_0x396d29){_0x58b8a8[_0x4520('0x8')](_0x4520('0x9'),_0x396d29['map'](function(_0x297f0a){return{'id':_0x297f0a['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x58b8a8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4520('0x7')](function(_0x37a617){_0x58b8a8[_0x4520('0x8')](_0x4520('0xa'),_0x37a617[_0x4520('0xb')]);SmsInteractionEvents[_0x4520('0xc')](_0x41d89c+':'+_0x58b8a8['id'],_0x58b8a8);SmsInteractionEvents[_0x4520('0xc')](_0x41d89c,_0x58b8a8);_0x209381(null);})[_0x4520('0xd')](_0x209381(null));};}for(var e in events){if(events[_0x4520('0xe')](e)){var event=events[e];SmsInteraction[_0x4520('0xf')](e,emitEvent(event));}}module[_0x4520('0x10')]=SmsInteractionEvents;
\ No newline at end of file
+var _0xdb28=['Users','map','findAll','then','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','SmsInteraction','setMaxListeners','save','update','remove','setDataValue'];(function(_0x128450,_0x5869ba){var _0x4d80ed=function(_0x4a2da3){while(--_0x4a2da3){_0x128450['push'](_0x128450['shift']());}};_0x4d80ed(++_0x5869ba);}(_0xdb28,0x106));var _0x8db2=function(_0xc56355,_0x9e66fa){_0xc56355=_0xc56355-0x0;var _0x3633b5=_0xdb28[_0xc56355];return _0x3633b5;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var SmsInteraction=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var SmsMessage=require(_0x8db2('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':_0x8db2('0x4'),'afterUpdate':_0x8db2('0x5'),'afterDestroy':_0x8db2('0x6')};function emitEvent(_0x11109e){return function(_0x52bf99,_0x21a03e,_0x1d2dd3){_0x52bf99['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x477f50){_0x52bf99[_0x8db2('0x7')](_0x8db2('0x8'),_0x477f50[_0x8db2('0x9')](function(_0x2f3f2f){return{'id':_0x2f3f2f['id']};}));return SmsMessage[_0x8db2('0xa')]({'where':{'SmsInteractionId':_0x52bf99['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8db2('0xb')](function(_0x4ba340){_0x52bf99[_0x8db2('0x7')](_0x8db2('0xc'),_0x4ba340[_0x8db2('0xd')]);SmsInteractionEvents['emit'](_0x11109e+':'+_0x52bf99['id'],_0x52bf99);SmsInteractionEvents[_0x8db2('0xe')](_0x11109e,_0x52bf99);_0x1d2dd3(null);})[_0x8db2('0xf')](_0x1d2dd3(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0x8db2('0x10')](e,emitEvent(event));}}module[_0x8db2('0x11')]=SmsInteractionEvents;
\ No newline at end of file
index 169a0c5..86da177 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7397=['sms_interactions','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./smsInteraction.attributes','SmsInteraction'];(function(_0x3022dd,_0x470d35){var _0x28647a=function(_0xff47be){while(--_0xff47be){_0x3022dd['push'](_0x3022dd['shift']());}};_0x28647a(++_0x470d35);}(_0x7397,0x162));var _0x7739=function(_0x2e527e,_0x282675){_0x2e527e=_0x2e527e-0x0;var _0x1f80aa=_0x7397[_0x2e527e];return _0x1f80aa;};'use strict';var _=require(_0x7739('0x0'));var util=require(_0x7739('0x1'));var logger=require(_0x7739('0x2'))(_0x7739('0x3'));var moment=require(_0x7739('0x4'));var BPromise=require('bluebird');var rp=require(_0x7739('0x5'));var fs=require('fs');var path=require(_0x7739('0x6'));var rimraf=require(_0x7739('0x7'));var config=require('../../config/environment');var attributes=require(_0x7739('0x8'));module['exports']=function(_0x5a0802,_0x365d68){return _0x5a0802['define'](_0x7739('0x9'),attributes,{'tableName':_0x7739('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x70a86c,_0x6002,_0x123b33){if(_0x70a86c['changed'](_0x7739('0xb'))){_0x70a86c[_0x7739('0xc')]=moment()['format'](_0x7739('0xd'));}_0x123b33(null,_0x70a86c);}}});};
\ No newline at end of file
+var _0xbbba=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format','lodash','util'];(function(_0xa5bd84,_0x287943){var _0x22bcca=function(_0x13f6f4){while(--_0x13f6f4){_0xa5bd84['push'](_0xa5bd84['shift']());}};_0x22bcca(++_0x287943);}(_0xbbba,0x86));var _0xabbb=function(_0x1bb812,_0x23eacc){_0x1bb812=_0x1bb812-0x0;var _0x372adb=_0xbbba[_0x1bb812];return _0x372adb;};'use strict';var _=require(_0xabbb('0x0'));var util=require(_0xabbb('0x1'));var logger=require(_0xabbb('0x2'))(_0xabbb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xabbb('0x4'));var fs=require('fs');var path=require(_0xabbb('0x5'));var rimraf=require(_0xabbb('0x6'));var config=require(_0xabbb('0x7'));var attributes=require(_0xabbb('0x8'));module[_0xabbb('0x9')]=function(_0x36ca1c,_0x364449){return _0x36ca1c[_0xabbb('0xa')](_0xabbb('0xb'),attributes,{'tableName':_0xabbb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x14680a,_0x2ece14,_0x62728f){if(_0x14680a[_0xabbb('0xd')](_0xabbb('0xe'))){_0x14680a[_0xabbb('0xf')]=moment()[_0xabbb('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x62728f(null,_0x14680a);}}});};
\ No newline at end of file
index f35ff01..87d5372 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cf7=['message','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','limit','AddTagsToSmsInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x10df1e,_0xf56f85){var _0x3e24fb=function(_0x5cdb59){while(--_0x5cdb59){_0x10df1e['push'](_0x10df1e['shift']());}};_0x3e24fb(++_0xf56f85);}(_0x8cf7,0xcb));var _0x78cf=function(_0x47654c,_0x45c6f0){_0x47654c=_0x47654c-0x0;var _0x28004e=_0x8cf7[_0x47654c];return _0x28004e;};'use strict';var _=require(_0x78cf('0x0'));var util=require(_0x78cf('0x1'));var moment=require(_0x78cf('0x2'));var BPromise=require(_0x78cf('0x3'));var rs=require(_0x78cf('0x4'));var fs=require('fs');var Redis=require(_0x78cf('0x5'));var db=require(_0x78cf('0x6'))['db'];var utils=require(_0x78cf('0x7'));var logger=require(_0x78cf('0x8'))(_0x78cf('0x9'));var config=require('../../config/environment');var jayson=require(_0x78cf('0xa'));var client=jayson[_0x78cf('0xb')]['http']({'port':0x232a});config[_0x78cf('0xc')]=_[_0x78cf('0xd')](config[_0x78cf('0xc')],{'host':_0x78cf('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x78cf('0xc')]));require(_0x78cf('0xf'))[_0x78cf('0x10')](socket);function respondWithRpcPromise(_0x55e87f,_0x34173e,_0x481468){return new BPromise(function(_0x5b37ba,_0x148d6d){return client[_0x78cf('0x11')](_0x55e87f,_0x481468)[_0x78cf('0x12')](function(_0x4b8591){logger[_0x78cf('0x13')](_0x78cf('0x14'),_0x34173e,_0x78cf('0x15'));logger[_0x78cf('0x16')](_0x78cf('0x17'),_0x34173e,_0x78cf('0x15'),JSON[_0x78cf('0x18')](_0x4b8591));if(_0x4b8591[_0x78cf('0x19')]){if(_0x4b8591[_0x78cf('0x19')][_0x78cf('0x1a')]===0x1f4){logger[_0x78cf('0x19')](_0x78cf('0x14'),_0x34173e,_0x4b8591['error'][_0x78cf('0x1b')]);return _0x148d6d(_0x4b8591[_0x78cf('0x19')][_0x78cf('0x1b')]);}logger[_0x78cf('0x19')](_0x78cf('0x14'),_0x34173e,_0x4b8591[_0x78cf('0x19')][_0x78cf('0x1b')]);return _0x5b37ba(_0x4b8591[_0x78cf('0x19')][_0x78cf('0x1b')]);}else{logger[_0x78cf('0x13')](_0x78cf('0x14'),_0x34173e,_0x78cf('0x15'));_0x5b37ba(_0x4b8591[_0x78cf('0x1c')][_0x78cf('0x1b')]);}})[_0x78cf('0x1d')](function(_0x6b0c5e){logger[_0x78cf('0x19')](_0x78cf('0x14'),_0x34173e,_0x6b0c5e);_0x148d6d(_0x6b0c5e);});});}exports[_0x78cf('0x1e')]=function(_0xb0a2a5){var _0x52c8a8=this;return new Promise(function(_0x19aaa2,_0xa5a375){return db[_0x78cf('0x1f')][_0x78cf('0x20')](_0xb0a2a5[_0x78cf('0x21')],{'raw':_0xb0a2a5[_0x78cf('0x22')]?_0xb0a2a5[_0x78cf('0x22')][_0x78cf('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb0a2a5[_0x78cf('0x22')]?_0xb0a2a5[_0x78cf('0x22')][_0x78cf('0x24')]||null:null,'attributes':_0xb0a2a5['options']?_0xb0a2a5[_0x78cf('0x22')][_0x78cf('0x25')]||null:null,'limit':_0xb0a2a5['options']?_0xb0a2a5[_0x78cf('0x22')][_0x78cf('0x26')]||null:null})[_0x78cf('0x12')](function(_0x7e0157){logger[_0x78cf('0x13')](_0x78cf('0x1e'),_0xb0a2a5);logger[_0x78cf('0x16')](_0x78cf('0x1e'),_0xb0a2a5,JSON[_0x78cf('0x18')](_0x7e0157));_0x19aaa2(_0x7e0157);})[_0x78cf('0x1d')](function(_0x43d314){logger[_0x78cf('0x19')](_0x78cf('0x1e'),_0x43d314[_0x78cf('0x1b')],_0xb0a2a5);_0xa5a375(_0x52c8a8[_0x78cf('0x19')](0x1f4,_0x43d314[_0x78cf('0x1b')]));});});};exports[_0x78cf('0x27')]=function(_0x5b0f9d){return new Promise(function(_0x13ecf0,_0x50b8fb){return db[_0x78cf('0x1f')][_0x78cf('0x28')]({'where':_0x5b0f9d['options']?_0x5b0f9d[_0x78cf('0x22')][_0x78cf('0x24')]||null:null})[_0x78cf('0x12')](function(_0x3a91b3){if(_0x3a91b3){return _0x3a91b3[_0x78cf('0x29')](_0x5b0f9d['body'][_0x78cf('0x2a')],_[_0x78cf('0x2b')](_0x5b0f9d['body'],[_0x78cf('0x2a'),'id'])||{});}})[_0x78cf('0x2c')](function(_0x413dee){logger['info'](_0x78cf('0x2d'),_0x5b0f9d);logger[_0x78cf('0x16')](_0x78cf('0x2d'),_0x5b0f9d,JSON[_0x78cf('0x18')](_0x413dee));_0x13ecf0(_0x413dee);})[_0x78cf('0x1d')](function(_0x48872d){logger[_0x78cf('0x19')](_0x78cf('0x2d'),_0x48872d['message'],_0x5b0f9d);_0x50b8fb(_this[_0x78cf('0x19')](0x1f4,_0x48872d[_0x78cf('0x1b')]));});});};
\ No newline at end of file
+var _0x6ab4=['ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message','result','catch','UpdateSmsInteraction','SmsInteraction','body','options','raw','where','attributes','limit','find','addTags','omit'];(function(_0x57c2c7,_0x2851b6){var _0x12efc7=function(_0x409905){while(--_0x409905){_0x57c2c7['push'](_0x57c2c7['shift']());}};_0x12efc7(++_0x2851b6);}(_0x6ab4,0x15b));var _0x46ab=function(_0x2b71da,_0x1a6441){_0x2b71da=_0x2b71da-0x0;var _0x314281=_0x6ab4[_0x2b71da];return _0x314281;};'use strict';var _=require(_0x46ab('0x0'));var util=require(_0x46ab('0x1'));var moment=require(_0x46ab('0x2'));var BPromise=require(_0x46ab('0x3'));var rs=require(_0x46ab('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x46ab('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x46ab('0x6'));var config=require(_0x46ab('0x7'));var jayson=require(_0x46ab('0x8'));var client=jayson[_0x46ab('0x9')][_0x46ab('0xa')]({'port':0x232a});config[_0x46ab('0xb')]=_[_0x46ab('0xc')](config[_0x46ab('0xb')],{'host':_0x46ab('0xd'),'port':0x18eb});var socket=require(_0x46ab('0xe'))(new Redis(config[_0x46ab('0xb')]));require(_0x46ab('0xf'))[_0x46ab('0x10')](socket);function respondWithRpcPromise(_0x54d5b3,_0xf7fb28,_0x561595){return new BPromise(function(_0x346d03,_0x54aa85){return client[_0x46ab('0x11')](_0x54d5b3,_0x561595)[_0x46ab('0x12')](function(_0x19e7a6){logger[_0x46ab('0x13')]('SmsInteraction,\x20%s,\x20%s',_0xf7fb28,_0x46ab('0x14'));logger[_0x46ab('0x15')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0xf7fb28,_0x46ab('0x14'),JSON[_0x46ab('0x16')](_0x19e7a6));if(_0x19e7a6['error']){if(_0x19e7a6[_0x46ab('0x17')][_0x46ab('0x18')]===0x1f4){logger['error'](_0x46ab('0x19'),_0xf7fb28,_0x19e7a6['error'][_0x46ab('0x1a')]);return _0x54aa85(_0x19e7a6['error'][_0x46ab('0x1a')]);}logger[_0x46ab('0x17')](_0x46ab('0x19'),_0xf7fb28,_0x19e7a6[_0x46ab('0x17')][_0x46ab('0x1a')]);return _0x346d03(_0x19e7a6[_0x46ab('0x17')]['message']);}else{logger[_0x46ab('0x13')](_0x46ab('0x19'),_0xf7fb28,_0x46ab('0x14'));_0x346d03(_0x19e7a6[_0x46ab('0x1b')][_0x46ab('0x1a')]);}})[_0x46ab('0x1c')](function(_0x2da9d7){logger[_0x46ab('0x17')](_0x46ab('0x19'),_0xf7fb28,_0x2da9d7);_0x54aa85(_0x2da9d7);});});}exports[_0x46ab('0x1d')]=function(_0x543fde){var _0x1db9d5=this;return new Promise(function(_0x5f57e5,_0x2089cc){return db[_0x46ab('0x1e')]['update'](_0x543fde[_0x46ab('0x1f')],{'raw':_0x543fde[_0x46ab('0x20')]?_0x543fde[_0x46ab('0x20')][_0x46ab('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x543fde['options']?_0x543fde[_0x46ab('0x20')][_0x46ab('0x22')]||null:null,'attributes':_0x543fde[_0x46ab('0x20')]?_0x543fde[_0x46ab('0x20')][_0x46ab('0x23')]||null:null,'limit':_0x543fde[_0x46ab('0x20')]?_0x543fde[_0x46ab('0x20')][_0x46ab('0x24')]||null:null})['then'](function(_0x332ab1){logger[_0x46ab('0x13')](_0x46ab('0x1d'),_0x543fde);logger[_0x46ab('0x15')]('UpdateSmsInteraction',_0x543fde,JSON[_0x46ab('0x16')](_0x332ab1));_0x5f57e5(_0x332ab1);})[_0x46ab('0x1c')](function(_0x499b9a){logger[_0x46ab('0x17')](_0x46ab('0x1d'),_0x499b9a[_0x46ab('0x1a')],_0x543fde);_0x2089cc(_0x1db9d5[_0x46ab('0x17')](0x1f4,_0x499b9a[_0x46ab('0x1a')]));});});};exports['AddTagsToSmsInteraction']=function(_0x38f5e2){return new Promise(function(_0x2aa6cd,_0x322b44){return db['SmsInteraction'][_0x46ab('0x25')]({'where':_0x38f5e2[_0x46ab('0x20')]?_0x38f5e2[_0x46ab('0x20')][_0x46ab('0x22')]||null:null})[_0x46ab('0x12')](function(_0x5857d9){if(_0x5857d9){return _0x5857d9[_0x46ab('0x26')](_0x38f5e2[_0x46ab('0x1f')]['ids'],_[_0x46ab('0x27')](_0x38f5e2[_0x46ab('0x1f')],[_0x46ab('0x28'),'id'])||{});}})[_0x46ab('0x29')](function(_0x518f03){logger[_0x46ab('0x13')](_0x46ab('0x2a'),_0x38f5e2);logger[_0x46ab('0x15')]('AddTags',_0x38f5e2,JSON[_0x46ab('0x16')](_0x518f03));_0x2aa6cd(_0x518f03);})[_0x46ab('0x1c')](function(_0x3ed095){logger[_0x46ab('0x17')](_0x46ab('0x2a'),_0x3ed095[_0x46ab('0x1a')],_0x38f5e2);_0x322b44(_this[_0x46ab('0x17')](0x1f4,_0x3ed095[_0x46ab('0x1a')]));});});};
\ No newline at end of file
index b316e42..a1107c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2477=['emit','removeListener','register','length','smsInteraction:','./smsInteraction.events','save','remove','update'];(function(_0x1bb812,_0x23eacc){var _0x372adb=function(_0x5ad456){while(--_0x5ad456){_0x1bb812['push'](_0x1bb812['shift']());}};_0x372adb(++_0x23eacc);}(_0x2477,0x1be));var _0x7247=function(_0x369534,_0x5557c4){_0x369534=_0x369534-0x0;var _0x524bf9=_0x2477[_0x369534];return _0x524bf9;};'use strict';var SmsInteractionEvents=require(_0x7247('0x0'));var events=[_0x7247('0x1'),_0x7247('0x2'),_0x7247('0x3')];function createListener(_0x1185b1,_0x50bf36){return function(_0x2988ad){_0x50bf36[_0x7247('0x4')](_0x1185b1,_0x2988ad);};}function removeListener(_0x75967a,_0x469d04){return function(){SmsInteractionEvents[_0x7247('0x5')](_0x75967a,_0x469d04);};}exports[_0x7247('0x6')]=function(_0x47fa88){for(var _0x391a64=0x0,_0x68986b=events[_0x7247('0x7')];_0x391a64<_0x68986b;_0x391a64++){var _0x450af1=events[_0x391a64];var _0x4d54ab=createListener(_0x7247('0x8')+_0x450af1,_0x47fa88);SmsInteractionEvents['on'](_0x450af1,_0x4d54ab);}};
\ No newline at end of file
+var _0x964e=['save','update','emit','removeListener','register','length','./smsInteraction.events'];(function(_0x86ba8,_0x31c204){var _0x636d08=function(_0x2f9262){while(--_0x2f9262){_0x86ba8['push'](_0x86ba8['shift']());}};_0x636d08(++_0x31c204);}(_0x964e,0x1e2));var _0xe964=function(_0x246e3a,_0x24c566){_0x246e3a=_0x246e3a-0x0;var _0x364850=_0x964e[_0x246e3a];return _0x364850;};'use strict';var SmsInteractionEvents=require(_0xe964('0x0'));var events=[_0xe964('0x1'),'remove',_0xe964('0x2')];function createListener(_0x2a273a,_0x194f39){return function(_0x856665){_0x194f39[_0xe964('0x3')](_0x2a273a,_0x856665);};}function removeListener(_0x261445,_0x15ae84){return function(){SmsInteractionEvents[_0xe964('0x4')](_0x261445,_0x15ae84);};}exports[_0xe964('0x5')]=function(_0x36e8db){for(var _0x4bcc34=0x0,_0x4352cf=events[_0xe964('0x6')];_0x4bcc34<_0x4352cf;_0x4bcc34++){var _0x47a5db=events[_0x4bcc34];var _0x17fd39=createListener('smsInteraction:'+_0x47a5db,_0x36e8db);SmsInteractionEvents['on'](_0x47a5db,_0x17fd39);}};
\ No newline at end of file
index 44c4a19..b327091 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0344=['smsmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','sms'];(function(_0x7762d6,_0x1934b7){var _0x2627c3=function(_0x2fcf01){while(--_0x2fcf01){_0x7762d6['push'](_0x7762d6['shift']());}};_0x2627c3(++_0x1934b7);}(_0x0344,0x14b));var _0x4034=function(_0xe5851f,_0x4dec24){_0xe5851f=_0xe5851f-0x0;var _0x52a62d=_0x0344[_0xe5851f];return _0x52a62d;};'use strict';var multer=require(_0x4034('0x0'));var util=require(_0x4034('0x1'));var path=require('path');var timeout=require(_0x4034('0x2'));var express=require(_0x4034('0x3'));var router=express[_0x4034('0x4')]();var fs_extra=require(_0x4034('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x4034('0x6'));var config=require('../../config/environment');var controller=require(_0x4034('0x7'));router[_0x4034('0x8')]('/',auth[_0x4034('0x9')](),controller[_0x4034('0xa')]);router[_0x4034('0x8')](_0x4034('0xb'),auth['isAuthenticated'](),controller[_0x4034('0xc')]);router['get'](_0x4034('0xd'),auth[_0x4034('0x9')](),controller[_0x4034('0xe')]);router[_0x4034('0xf')]('/',auth[_0x4034('0x9')](),interaction['tracked'](_0x4034('0x10'),_0x4034('0x11')),controller[_0x4034('0x12')]);router[_0x4034('0xf')](_0x4034('0x13'),controller[_0x4034('0x14')]);router[_0x4034('0x15')](_0x4034('0xd'),auth[_0x4034('0x9')](),controller[_0x4034('0x16')]);router[_0x4034('0x15')](_0x4034('0x17'),auth[_0x4034('0x9')](),controller[_0x4034('0x18')]);router[_0x4034('0x15')](_0x4034('0x19'),auth[_0x4034('0x9')](),controller[_0x4034('0x1a')]);router[_0x4034('0x1b')](_0x4034('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x4034('0x1c')]=router;
\ No newline at end of file
+var _0x0117=['/:id/accept','accept','/:id/reject','reject','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','isAuthenticated','index','/describe','describe','get','/:id','show','post','tracked','smsmessage:create','create','/:id/status','put','update'];(function(_0x247844,_0x3ed02d){var _0x3e4156=function(_0xadbaa5){while(--_0xadbaa5){_0x247844['push'](_0x247844['shift']());}};_0x3e4156(++_0x3ed02d);}(_0x0117,0x114));var _0x7011=function(_0x3fa025,_0x25b949){_0x3fa025=_0x3fa025-0x0;var _0x2d3564=_0x0117[_0x3fa025];return _0x2d3564;};'use strict';var multer=require(_0x7011('0x0'));var util=require(_0x7011('0x1'));var path=require('path');var timeout=require(_0x7011('0x2'));var express=require(_0x7011('0x3'));var router=express[_0x7011('0x4')]();var fs_extra=require(_0x7011('0x5'));var auth=require(_0x7011('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsMessage.controller');router['get']('/',auth[_0x7011('0x7')](),controller[_0x7011('0x8')]);router['get'](_0x7011('0x9'),auth['isAuthenticated'](),controller[_0x7011('0xa')]);router[_0x7011('0xb')](_0x7011('0xc'),auth[_0x7011('0x7')](),controller[_0x7011('0xd')]);router[_0x7011('0xe')]('/',auth[_0x7011('0x7')](),interaction[_0x7011('0xf')]('sms',_0x7011('0x10')),controller[_0x7011('0x11')]);router[_0x7011('0xe')](_0x7011('0x12'),controller['status']);router[_0x7011('0x13')](_0x7011('0xc'),auth[_0x7011('0x7')](),controller[_0x7011('0x14')]);router[_0x7011('0x13')](_0x7011('0x15'),auth[_0x7011('0x7')](),controller[_0x7011('0x16')]);router[_0x7011('0x13')](_0x7011('0x17'),auth[_0x7011('0x7')](),controller[_0x7011('0x18')]);router[_0x7011('0x19')](_0x7011('0xc'),auth[_0x7011('0x7')](),controller['destroy']);module[_0x7011('0x1a')]=router;
\ No newline at end of file
index 73037ce..cd2e50b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x808f=['BOOLEAN','ENUM','out','STRING','exports','TEXT'];(function(_0x2694bd,_0x17ec8c){var _0x16d8e1=function(_0x4243e0){while(--_0x4243e0){_0x2694bd['push'](_0x2694bd['shift']());}};_0x16d8e1(++_0x17ec8c);}(_0x808f,0x1ea));var _0xf808=function(_0x414b18,_0x52bfdf){_0x414b18=_0x414b18-0x0;var _0x88d2d2=_0x808f[_0x414b18];return _0x88d2d2;};'use strict';var Sequelize=require('sequelize');module[_0xf808('0x0')]={'body':{'type':Sequelize[_0xf808('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xf808('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xf808('0x3')]('in','out'),'defaultValue':_0xf808('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xf808('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xf808('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xf808('0x5')]},'providerResponse':{'type':Sequelize[_0xf808('0x1')]}};
\ No newline at end of file
+var _0x6469=['TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports'];(function(_0x444d22,_0x2379a3){var _0x37df5d=function(_0x2a05b0){while(--_0x2a05b0){_0x444d22['push'](_0x444d22['shift']());}};_0x37df5d(++_0x2379a3);}(_0x6469,0x142));var _0x9646=function(_0x487b57,_0x4d148a){_0x487b57=_0x487b57-0x0;var _0x175ba5=_0x6469[_0x487b57];return _0x175ba5;};'use strict';var Sequelize=require(_0x9646('0x0'));module[_0x9646('0x1')]={'body':{'type':Sequelize[_0x9646('0x2')](_0x9646('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9646('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9646('0x5')]('in',_0x9646('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x9646('0x7')](0xbe)},'phone':{'type':Sequelize[_0x9646('0x7')]},'readAt':{'type':Sequelize[_0x9646('0x8')]},'secret':{'type':Sequelize[_0x9646('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x9646('0x7')]},'providerResponse':{'type':Sequelize[_0x9646('0x2')]}};
\ No newline at end of file
index 4acaa93..c645cc6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6a0b=['set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','keys','includeAll','find','catch','create','body','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','read1stAt','interaction','role','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','../../config/logger','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','fullname','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','delivered','Status','results','groupName','infobip','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','error','message','sendStatus','end','status','offset','undefined','limit','count'];(function(_0x888385,_0x9cdc66){var _0x22d5c2=function(_0x3b1599){while(--_0x3b1599){_0x888385['push'](_0x888385['shift']());}};_0x22d5c2(++_0x9cdc66);}(_0x6a0b,0xf6));var _0xb6a0=function(_0x52b1ed,_0x12fcfa){_0x52b1ed=_0x52b1ed-0x0;var _0xaecb5a=_0x6a0b[_0x52b1ed];return _0xaecb5a;};'use strict';var emlformat=require(_0xb6a0('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb6a0('0x1'));var rp=require(_0xb6a0('0x2'));var moment=require('moment');var BPromise=require(_0xb6a0('0x3'));var Mustache=require(_0xb6a0('0x4'));var util=require(_0xb6a0('0x5'));var path=require(_0xb6a0('0x6'));var sox=require(_0xb6a0('0x7'));var csv=require('to-csv');var ejs=require(_0xb6a0('0x8'));var fs=require('fs');var fs_extra=require(_0xb6a0('0x9'));var _=require(_0xb6a0('0xa'));var squel=require(_0xb6a0('0xb'));var crypto=require(_0xb6a0('0xc'));var jsforce=require(_0xb6a0('0xd'));var deskjs=require(_0xb6a0('0xe'));var toCsv=require(_0xb6a0('0xf'));var querystring=require(_0xb6a0('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb6a0('0x11'));var logger=require('../../config/logger')(_0xb6a0('0x12'));var utils=require(_0xb6a0('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xb6a0('0x14'));var db=require(_0xb6a0('0x15'))['db'];config[_0xb6a0('0x16')]=_[_0xb6a0('0x17')](config[_0xb6a0('0x16')],{'host':_0xb6a0('0x18'),'port':0x18eb});var socket=require(_0xb6a0('0x19'))(new Redis(config[_0xb6a0('0x16')]));require(_0xb6a0('0x1a'))[_0xb6a0('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb6a0('0x1c')][_0xb6a0('0x1d')]({'port':0x232c});var client9002=jayson[_0xb6a0('0x1c')][_0xb6a0('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x45a4df,_0x242694,_0x374b74,_0xb864a1){return new BPromise(function(_0x1cb284,_0x4a242e){var _0x390330=_0xb864a1||client;return _0x390330[_0xb6a0('0x1e')](_0x45a4df,_0x374b74)[_0xb6a0('0x1f')](function(_0x5db250){logger[_0xb6a0('0x20')](_0xb6a0('0x21'),_0x242694,_0xb6a0('0x22'));logger[_0xb6a0('0x23')](_0xb6a0('0x24'),_0x242694,'request\x20sent',JSON['stringify'](_0x5db250));if(_0x5db250[_0xb6a0('0x25')]){if(_0x5db250[_0xb6a0('0x25')]['code']===0x1f4){logger[_0xb6a0('0x25')]('SmsMessage,\x20%s,\x20%s',_0x242694,_0x5db250[_0xb6a0('0x25')][_0xb6a0('0x26')]);return _0x4a242e(_0x5db250[_0xb6a0('0x25')]['message']);}logger[_0xb6a0('0x25')](_0xb6a0('0x21'),_0x242694,_0x5db250[_0xb6a0('0x25')]['message']);return _0x1cb284(_0x5db250[_0xb6a0('0x25')][_0xb6a0('0x26')]);}else{logger['info'](_0xb6a0('0x21'),_0x242694,'request\x20sent');_0x1cb284(_0x5db250['result'][_0xb6a0('0x26')]);}})['catch'](function(_0x814060){logger[_0xb6a0('0x25')](_0xb6a0('0x21'),_0x242694,_0x814060);_0x4a242e(_0x814060);});});}function respondWithStatusCode(_0x40e911,_0x2aa557){_0x2aa557=_0x2aa557||0xcc;return function(_0x27bb68){if(_0x27bb68){return _0x40e911[_0xb6a0('0x27')](_0x2aa557);}return _0x40e911['status'](_0x2aa557)[_0xb6a0('0x28')]();};}function respondWithResult(_0x29dbb9,_0xd6e536){_0xd6e536=_0xd6e536||0xc8;return function(_0x17274){if(_0x17274){return _0x29dbb9[_0xb6a0('0x29')](_0xd6e536)['json'](_0x17274);}};}function respondWithFilteredResult(_0x28f593,_0x5d8caf){return function(_0x25ed03){if(_0x25ed03){var _0x261ed7=typeof _0x5d8caf[_0xb6a0('0x2a')]===_0xb6a0('0x2b')&&typeof _0x5d8caf[_0xb6a0('0x2c')]===_0xb6a0('0x2b');var _0x5a2137=_0x25ed03['count'];var _0x31ce9a=_0x261ed7?0x0:_0x5d8caf[_0xb6a0('0x2a')];var _0x1fc80b=_0x261ed7?_0x25ed03[_0xb6a0('0x2d')]:_0x5d8caf[_0xb6a0('0x2a')]+_0x5d8caf['limit'];var _0x56c69c;if(_0x1fc80b>=_0x5a2137){_0x1fc80b=_0x5a2137;_0x56c69c=0xc8;}else{_0x56c69c=0xce;}_0x28f593[_0xb6a0('0x29')](_0x56c69c);return _0x28f593[_0xb6a0('0x2e')](_0xb6a0('0x2f'),_0x31ce9a+'-'+_0x1fc80b+'/'+_0x5a2137)[_0xb6a0('0x30')](_0x25ed03);}return null;};}function patchUpdates(_0x5a6a37){return function(_0x4bb109){try{jsonpatch[_0xb6a0('0x31')](_0x4bb109,_0x5a6a37,!![]);}catch(_0x16f681){return BPromise[_0xb6a0('0x32')](_0x16f681);}return _0x4bb109[_0xb6a0('0x33')]();};}function saveUpdates(_0x1e4849,_0x4ad056){return function(_0x4b9fbf){if(_0x4b9fbf){return _0x4b9fbf[_0xb6a0('0x34')](_0x1e4849)[_0xb6a0('0x1f')](function(_0x3daa1a){return _0x3daa1a;});}return null;};}function removeEntity(_0x1db231,_0x3b1d35){return function(_0x15984e){if(_0x15984e){return _0x15984e[_0xb6a0('0x35')]()['then'](function(){_0x1db231[_0xb6a0('0x29')](0xcc)[_0xb6a0('0x28')]();});}};}function handleEntityNotFound(_0x88a1a1,_0x56cbe5){return function(_0x2f81a8){if(!_0x2f81a8){_0x88a1a1[_0xb6a0('0x27')](0x194);}return _0x2f81a8;};}function handleError(_0x518139,_0x2c05b0){_0x2c05b0=_0x2c05b0||0x1f4;return function(_0x31106a){logger[_0xb6a0('0x25')](_0x31106a[_0xb6a0('0x36')]);if(_0x31106a[_0xb6a0('0x37')]){delete _0x31106a[_0xb6a0('0x37')];}_0x518139['status'](_0x2c05b0)[_0xb6a0('0x38')](_0x31106a);};}exports[_0xb6a0('0x39')]=function(_0x2a5516,_0x512877){var _0x4befc3={},_0x107b7f={},_0x317ad4={'count':0x0,'rows':[]};var _0x2501f5=_[_0xb6a0('0x3a')](db[_0xb6a0('0x3b')][_0xb6a0('0x3c')],function(_0x30c35f){return{'name':_0x30c35f['fieldName'],'type':_0x30c35f[_0xb6a0('0x3d')]['key']};});_0x107b7f[_0xb6a0('0x3e')]=_[_0xb6a0('0x3a')](_0x2501f5,'name');_0x107b7f[_0xb6a0('0x3f')]=_['keys'](_0x2a5516['query']);_0x107b7f[_0xb6a0('0x40')]=_['intersection'](_0x107b7f[_0xb6a0('0x3e')],_0x107b7f['query']);_0x4befc3['attributes']=_[_0xb6a0('0x41')](_0x107b7f[_0xb6a0('0x3e')],qs[_0xb6a0('0x42')](_0x2a5516[_0xb6a0('0x3f')][_0xb6a0('0x42')]));_0x4befc3[_0xb6a0('0x43')]=_0x4befc3[_0xb6a0('0x43')][_0xb6a0('0x44')]?_0x4befc3[_0xb6a0('0x43')]:_0x107b7f[_0xb6a0('0x3e')];if(!_0x2a5516[_0xb6a0('0x3f')][_0xb6a0('0x45')](_0xb6a0('0x46'))){_0x4befc3[_0xb6a0('0x2c')]=qs[_0xb6a0('0x2c')](_0x2a5516[_0xb6a0('0x3f')]['limit']);_0x4befc3[_0xb6a0('0x2a')]=qs['offset'](_0x2a5516['query'][_0xb6a0('0x2a')]);}_0x4befc3[_0xb6a0('0x47')]=qs[_0xb6a0('0x48')](_0x2a5516[_0xb6a0('0x3f')][_0xb6a0('0x48')]);_0x4befc3[_0xb6a0('0x49')]=qs[_0xb6a0('0x40')](_[_0xb6a0('0x4a')](_0x2a5516[_0xb6a0('0x3f')],_0x107b7f[_0xb6a0('0x40')]),_0x2501f5);if(_0x2a5516[_0xb6a0('0x3f')][_0xb6a0('0x4b')]){_0x4befc3[_0xb6a0('0x49')]=_[_0xb6a0('0x4c')](_0x4befc3[_0xb6a0('0x49')],{'$or':_[_0xb6a0('0x3a')](_0x2501f5,function(_0x43eeb2){if(_0x43eeb2[_0xb6a0('0x3d')]!=='VIRTUAL'){var _0x109066={};_0x109066[_0x43eeb2[_0xb6a0('0x37')]]={'$like':'%'+_0x2a5516[_0xb6a0('0x3f')]['filter']+'%'};return _0x109066;}})});}_0x4befc3=_[_0xb6a0('0x4c')]({},_0x4befc3,_0x2a5516[_0xb6a0('0x4d')]);var _0x557a59={'where':_0x4befc3[_0xb6a0('0x49')]};return db['SmsMessage'][_0xb6a0('0x2d')](_0x557a59)[_0xb6a0('0x1f')](function(_0x379a96){_0x317ad4['count']=_0x379a96;if(_0x2a5516[_0xb6a0('0x3f')]['includeAll']){_0x4befc3[_0xb6a0('0x4e')]=[{'all':!![]}];}return db[_0xb6a0('0x3b')][_0xb6a0('0x4f')](_0x4befc3);})[_0xb6a0('0x1f')](function(_0x5e8d5e){_0x317ad4[_0xb6a0('0x50')]=_0x5e8d5e;return _0x317ad4;})[_0xb6a0('0x1f')](respondWithFilteredResult(_0x512877,_0x4befc3))['catch'](handleError(_0x512877,null));};exports[_0xb6a0('0x51')]=function(_0x14c75d,_0x433917){var _0x1379b9={'raw':!![],'where':{'id':_0x14c75d[_0xb6a0('0x52')]['id']}},_0x373aac={};_0x373aac[_0xb6a0('0x3e')]=_[_0xb6a0('0x53')](db['SmsMessage']['rawAttributes']);_0x373aac[_0xb6a0('0x3f')]=_[_0xb6a0('0x53')](_0x14c75d[_0xb6a0('0x3f')]);_0x373aac[_0xb6a0('0x40')]=_[_0xb6a0('0x41')](_0x373aac[_0xb6a0('0x3e')],_0x373aac['query']);_0x1379b9[_0xb6a0('0x43')]=_[_0xb6a0('0x41')](_0x373aac[_0xb6a0('0x3e')],qs['fields'](_0x14c75d[_0xb6a0('0x3f')][_0xb6a0('0x42')]));_0x1379b9[_0xb6a0('0x43')]=_0x1379b9['attributes'][_0xb6a0('0x44')]?_0x1379b9[_0xb6a0('0x43')]:_0x373aac[_0xb6a0('0x3e')];if(_0x14c75d[_0xb6a0('0x3f')][_0xb6a0('0x54')]){_0x1379b9['include']=[{'all':!![]}];}_0x1379b9=_[_0xb6a0('0x4c')]({},_0x1379b9,_0x14c75d['options']);return db[_0xb6a0('0x3b')][_0xb6a0('0x55')](_0x1379b9)[_0xb6a0('0x1f')](handleEntityNotFound(_0x433917,null))[_0xb6a0('0x1f')](respondWithResult(_0x433917,null))[_0xb6a0('0x56')](handleError(_0x433917,null));};exports[_0xb6a0('0x57')]=function(_0x29e835,_0x18e723){return db[_0xb6a0('0x3b')][_0xb6a0('0x57')](_0x29e835['body'],{})['then'](respondWithResult(_0x18e723,0xc9))[_0xb6a0('0x56')](handleError(_0x18e723,null));};exports[_0xb6a0('0x34')]=function(_0x469f7d,_0x43482c){if(_0x469f7d[_0xb6a0('0x58')]['id']){delete _0x469f7d['body']['id'];}return db[_0xb6a0('0x3b')][_0xb6a0('0x55')]({'where':{'id':_0x469f7d[_0xb6a0('0x52')]['id']}})['then'](handleEntityNotFound(_0x43482c,null))['then'](saveUpdates(_0x469f7d[_0xb6a0('0x58')],null))['then'](respondWithResult(_0x43482c,null))['catch'](handleError(_0x43482c,null));};exports['destroy']=function(_0x43fd79,_0xab87f8){return db['SmsMessage'][_0xb6a0('0x55')]({'where':{'id':_0x43fd79[_0xb6a0('0x52')]['id']}})[_0xb6a0('0x1f')](handleEntityNotFound(_0xab87f8,null))['then'](removeEntity(_0xab87f8,null))[_0xb6a0('0x56')](handleError(_0xab87f8,null));};exports['describe']=function(_0x3d5ca1,_0x4d3a00){return db[_0xb6a0('0x3b')][_0xb6a0('0x59')]()[_0xb6a0('0x1f')](respondWithResult(_0x4d3a00,null))[_0xb6a0('0x56')](handleError(_0x4d3a00,null));};var interaction_log=require('../../config/logger')(_0xb6a0('0x5a'));exports[_0xb6a0('0x5b')]=function(_0x207f6b,_0x1ce0a4,_0x5ac8af){var _0x3712c6={'agent':{},'channel':_0xb6a0('0x5c')};if(_0x207f6b[_0xb6a0('0x58')]['id']){delete _0x207f6b[_0xb6a0('0x58')]['id'];}_0x207f6b['body'][_0xb6a0('0x5d')]=!![];_0x207f6b['body'][_0xb6a0('0x5e')]=moment()[_0xb6a0('0x5f')](_0xb6a0('0x60'));_0x207f6b['body']['UserId']=_0x207f6b['body'][_0xb6a0('0x61')]||_0x207f6b[_0xb6a0('0x62')]['id'];_0x3712c6[_0xb6a0('0x63')]['id']=_0x207f6b[_0xb6a0('0x58')][_0xb6a0('0x61')];return db['SmsMessage'][_0xb6a0('0x55')]({'where':{'id':_0x207f6b[_0xb6a0('0x52')]['id'],'UserId':null}})[_0xb6a0('0x1f')](handleEntityNotFound(_0x1ce0a4,null))[_0xb6a0('0x1f')](saveUpdates(_0x207f6b[_0xb6a0('0x58')],null))[_0xb6a0('0x1f')](function(_0x14f7f7){if(_0x14f7f7){_0x3712c6[_0xb6a0('0x26')]=_0x14f7f7[_0xb6a0('0x64')]({'plain':!![]});return db[_0xb6a0('0x65')]['find']({'where':{'id':_0x14f7f7[_0xb6a0('0x66')]}});}return null;})[_0xb6a0('0x1f')](handleEntityNotFound(_0x1ce0a4,null))[_0xb6a0('0x1f')](function(_0x357bae){if(_0x357bae){return _0x357bae[_0xb6a0('0x34')]({'UserId':_0x207f6b['body'][_0xb6a0('0x61')],'read1stAt':_['isNil'](_0x357bae[_0xb6a0('0x67')])?moment()['format'](_0xb6a0('0x60')):undefined});}return null;})[_0xb6a0('0x1f')](function(_0x37759c){if(_0x37759c){_0x3712c6[_0xb6a0('0x68')]=_0x37759c['get']({'plain':!![]});interaction_log['info']('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x207f6b[_0xb6a0('0x62')]['id'],_0x207f6b[_0xb6a0('0x62')]['name'],_0x207f6b['user'][_0xb6a0('0x69')],_0x3712c6[_0xb6a0('0x68')]['id'],_0x207f6b[_0xb6a0('0x58')]?JSON[_0xb6a0('0x6a')](_0x207f6b[_0xb6a0('0x58')]):_0xb6a0('0x6b'));return respondWithRpcPromise(_0xb6a0('0x6c'),_0xb6a0('0x6d'),_0x3712c6);}return null;})[_0xb6a0('0x1f')](function(_0x5204ed){var _0x5ea09e=_0xb6a0('0x6e')+_0x5204ed[_0xb6a0('0x26')][_0xb6a0('0x6f')];return db[_0xb6a0('0x70')]['query'](_0x5ea09e,{'type':db['Sequelize']['QueryTypes'][_0xb6a0('0x71')],'raw':!![]})[_0xb6a0('0x1f')](function(_0x44af5d){return _0x44af5d;});})[_0xb6a0('0x1f')](function(_0x1a23ca){if(_0x1a23ca){_0x3712c6[_0xb6a0('0x26')][_0xb6a0('0x72')]=_0x1a23ca[0x0];if(!_0x207f6b['body'][_0xb6a0('0x61')])return;return db[_0xb6a0('0x73')]['find']({'where':{'id':_0x207f6b[_0xb6a0('0x58')]['UserId'],'role':_0xb6a0('0x63')},'attributes':['id','name','fullname',_0xb6a0('0x74'),_0xb6a0('0x75')],'raw':!![]});}return null;})[_0xb6a0('0x1f')](function(_0x2977eb){if(!_0x2977eb)return null;_0x3712c6['message'][_0xb6a0('0x63')]=_0x2977eb;return _0x3712c6;})[_0xb6a0('0x1f')](function(_0x181287){if(_0x181287){if(_0x207f6b[_0xb6a0('0x58')][_0xb6a0('0x76')]){_0x3712c6['message'][_0xb6a0('0x77')]=util[_0xb6a0('0x5f')](_0xb6a0('0x78'),_0x207f6b[_0xb6a0('0x62')][_0xb6a0('0x37')]);_0x3712c6[_0xb6a0('0x26')][_0xb6a0('0x79')]=_0x3712c6['channel'];_0x3712c6['message'][_0xb6a0('0x7a')]=_0x3712c6['channel'];_0x3712c6['message'][_0xb6a0('0x7b')]=_0xb6a0('0x5b');return respondWithRpcPromise(_0xb6a0('0x7c'),'EventManager',{'event':'acceptmessage','message':_0x3712c6['message']},client9002)[_0xb6a0('0x1f')](function(){return _0x3712c6;});}return _0x3712c6;}return null;})[_0xb6a0('0x1f')](respondWithResult(_0x1ce0a4,null))[_0xb6a0('0x56')](handleError(_0x1ce0a4,null));};var interaction_log=require(_0xb6a0('0x7d'))(_0xb6a0('0x5a'));exports[_0xb6a0('0x32')]=function(_0x3e6fb1,_0x5a0d70,_0x89cce2){var _0x56d20c={'agent':{},'channel':'sms'};if(_0x3e6fb1[_0xb6a0('0x58')]['id']){delete _0x3e6fb1[_0xb6a0('0x58')]['id'];}_0x3e6fb1[_0xb6a0('0x58')][_0xb6a0('0x61')]=_0x3e6fb1[_0xb6a0('0x58')]['UserId']||_0x3e6fb1['user']['id'];_0x56d20c['agent']['id']=_0x3e6fb1[_0xb6a0('0x58')][_0xb6a0('0x61')];return db[_0xb6a0('0x3b')][_0xb6a0('0x55')]({'where':{'id':_0x3e6fb1[_0xb6a0('0x52')]['id'],'UserId':null}})[_0xb6a0('0x1f')](handleEntityNotFound(_0x5a0d70,null))[_0xb6a0('0x1f')](function(_0x125ce6){if(_0x125ce6){_0x56d20c[_0xb6a0('0x26')]=_0x125ce6['get']({'plain':!![]});return db[_0xb6a0('0x65')][_0xb6a0('0x55')]({'where':{'id':_0x125ce6[_0xb6a0('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x5a0d70,null))['then'](function(_0x3e2971){if(_0x3e2971){_0x56d20c['interaction']=_0x3e2971[_0xb6a0('0x64')]({'plain':!![]});interaction_log[_0xb6a0('0x20')](_0xb6a0('0x7e'),_0x3e6fb1[_0xb6a0('0x62')]['id'],_0x3e6fb1[_0xb6a0('0x62')][_0xb6a0('0x37')],_0x3e6fb1[_0xb6a0('0x62')][_0xb6a0('0x69')],_0x56d20c[_0xb6a0('0x68')]['id'],_0x3e6fb1['body']?JSON[_0xb6a0('0x6a')](_0x3e6fb1[_0xb6a0('0x58')]):_0xb6a0('0x6b'));return respondWithRpcPromise(_0xb6a0('0x7f'),_0xb6a0('0x80'),_0x56d20c);}return null;})[_0xb6a0('0x1f')](function(_0x9f2334){var _0x2e6468='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x9f2334[_0xb6a0('0x26')][_0xb6a0('0x6f')];return db[_0xb6a0('0x70')]['query'](_0x2e6468,{'type':db['Sequelize'][_0xb6a0('0x81')][_0xb6a0('0x71')],'raw':!![]})['then'](function(_0x18b03d){return _0x18b03d;});})[_0xb6a0('0x1f')](function(_0x362ffe){if(_0x362ffe){_0x56d20c['message'][_0xb6a0('0x72')]=_0x362ffe[0x0];if(!_0x3e6fb1[_0xb6a0('0x58')][_0xb6a0('0x61')])return;return db[_0xb6a0('0x73')]['find']({'where':{'id':_0x3e6fb1['body'][_0xb6a0('0x61')],'role':_0xb6a0('0x63')},'attributes':['id',_0xb6a0('0x37'),_0xb6a0('0x82'),_0xb6a0('0x74'),_0xb6a0('0x75')],'raw':!![]});}return null;})[_0xb6a0('0x1f')](function(_0x1155f9){if(!_0x1155f9)return null;_0x56d20c[_0xb6a0('0x26')][_0xb6a0('0x63')]=_0x1155f9;return _0x56d20c;})[_0xb6a0('0x1f')](function(_0x6d75f1){if(_0x6d75f1){_0x6d75f1[_0xb6a0('0x26')]['interface']=util['format']('SIP/%s',_0x3e6fb1['user'][_0xb6a0('0x37')]);_0x6d75f1[_0xb6a0('0x26')]['channel']=_0x56d20c['channel'];_0x6d75f1[_0xb6a0('0x26')][_0xb6a0('0x7a')]=_0x56d20c[_0xb6a0('0x79')];_0x6d75f1[_0xb6a0('0x26')][_0xb6a0('0x7b')]=_0xb6a0('0x32');respondWithRpcPromise(_0xb6a0('0x7c'),_0xb6a0('0x7c'),{'event':'rejectmessage','message':_0x6d75f1[_0xb6a0('0x26')]},client9002);return _0x56d20c;}return null;})[_0xb6a0('0x1f')](respondWithResult(_0x5a0d70,null))['catch'](handleError(_0x5a0d70,null));};exports['status']=function(_0xdee8fc,_0x3ecf5d,_0x47b365){if(_0xdee8fc[_0xb6a0('0x58')]['id']){delete _0xdee8fc[_0xb6a0('0x58')]['id'];}var _0x3c002a;return db[_0xb6a0('0x3b')][_0xb6a0('0x55')]({'where':{'id':_0xdee8fc['params']['id']}})['then'](handleEntityNotFound(_0x3ecf5d,null))[_0xb6a0('0x1f')](function(_0x406d96){if(_0x406d96){_0x3c002a=_0x406d96;return db['SmsAccount']['find']({'where':{'id':_0x406d96[_0xb6a0('0x83')]}});}})[_0xb6a0('0x1f')](handleEntityNotFound(_0x3ecf5d,null))[_0xb6a0('0x1f')](function(_0x74640c){if(_0x74640c){logger[_0xb6a0('0x23')](_0xb6a0('0x24'),'status',_0xb6a0('0x84'),_0x74640c[_0xb6a0('0x3d')],util[_0xb6a0('0x85')](_0xdee8fc[_0xb6a0('0x58')],{'showHidden':![],'depth':null}));switch(_0x74640c[_0xb6a0('0x3d')]){case _0xb6a0('0x86'):if(_0xdee8fc[_0xb6a0('0x58')]['MessageSid']&&_0xdee8fc[_0xb6a0('0x58')][_0xb6a0('0x87')]===_0x3c002a[_0xb6a0('0x88')]){return _0x3c002a[_0xb6a0('0x34')]({'read':!![]});}else{logger[_0xb6a0('0x25')](_0xb6a0('0x89'),_0xb6a0('0x29'),_0xb6a0('0x86'),util[_0xb6a0('0x85')](_0xdee8fc[_0xb6a0('0x58')],{'showHidden':![],'depth':null}));}break;case _0xb6a0('0x8a'):if(_0xdee8fc['body'][_0xb6a0('0x8b')]&&_0xdee8fc['body'][_0xb6a0('0x8b')]===_0x3c002a['messageId']&&_[_0xb6a0('0x8c')](['sent',_0xb6a0('0x8d')],_0xdee8fc['body'][_0xb6a0('0x8e')])>=0x0){return _0x3c002a[_0xb6a0('0x34')]({'read':!![]});}else{logger[_0xb6a0('0x25')](_0xb6a0('0x89'),_0xb6a0('0x29'),'plivio',util['inspect'](_0xdee8fc[_0xb6a0('0x58')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x426740=_0xdee8fc[_0xb6a0('0x58')][_0xb6a0('0x8f')][0x0];if(_0x426740[_0xb6a0('0x29')][_0xb6a0('0x90')]==='DELIVERED'){return _0x3c002a[_0xb6a0('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb6a0('0x29'),_0xb6a0('0x91'),util[_0xb6a0('0x85')](_0xdee8fc['body'],{'showHidden':![],'depth':null}));}break;}return _0x3c002a;}})[_0xb6a0('0x1f')](respondWithResult(_0x3ecf5d,null))[_0xb6a0('0x56')](handleError(_0x3ecf5d,null));};
\ No newline at end of file
+var _0x7969=['twilio','plivo','MessageUUID','messageId','indexOf','sent','infobip','groupName','DELIVERED','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','undefined','offset','count','set','Content-Range','json','apply','reject','save','update','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','findAll','rows','params','include','create','body','find','describe','sms-interactions','accept','sms','read','readAt','format','UserId','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','user','role','null','AcceptMessage','acceptMessage','ContactId','QueryTypes','contact','User','agent','fullname','manual','SIP/%s','channel','motionChannel','event','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','Sequelize','email','internal','interface','EventManager','SmsAccount','inspect','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s'];(function(_0x26617d,_0x1d0ac0){var _0xcfd674=function(_0x1bc473){while(--_0x1bc473){_0x26617d['push'](_0x26617d['shift']());}};_0xcfd674(++_0x1d0ac0);}(_0x7969,0x1c2));var _0x9796=function(_0x54f6f0,_0x3ab272){_0x54f6f0=_0x54f6f0-0x0;var _0x1987d2=_0x7969[_0x54f6f0];return _0x1987d2;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9796('0x0'));var jsonpatch=require(_0x9796('0x1'));var rp=require(_0x9796('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9796('0x3'));var util=require(_0x9796('0x4'));var path=require(_0x9796('0x5'));var sox=require(_0x9796('0x6'));var csv=require(_0x9796('0x7'));var ejs=require(_0x9796('0x8'));var fs=require('fs');var fs_extra=require(_0x9796('0x9'));var _=require(_0x9796('0xa'));var squel=require('squel');var crypto=require(_0x9796('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9796('0x7'));var querystring=require('querystring');var Papa=require(_0x9796('0xc'));var Redis=require('ioredis');var authService=require(_0x9796('0xd'));var qs=require(_0x9796('0xe'));var as=require(_0x9796('0xf'));var hardwareService=require(_0x9796('0x10'));var logger=require(_0x9796('0x11'))(_0x9796('0x12'));var utils=require(_0x9796('0x13'));var config=require(_0x9796('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9796('0x15'))['db'];config['redis']=_[_0x9796('0x16')](config['redis'],{'host':_0x9796('0x17'),'port':0x18eb});var socket=require(_0x9796('0x18'))(new Redis(config[_0x9796('0x19')]));require(_0x9796('0x1a'))[_0x9796('0x1b')](socket);var jayson=require(_0x9796('0x1c'));var client=jayson[_0x9796('0x1d')][_0x9796('0x1e')]({'port':0x232c});var client9002=jayson[_0x9796('0x1d')][_0x9796('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x432a00,_0xf2fd9a,_0x4d894d,_0x49d3b3){return new BPromise(function(_0x4f5a81,_0x312b5f){var _0x146c58=_0x49d3b3||client;return _0x146c58[_0x9796('0x1f')](_0x432a00,_0x4d894d)[_0x9796('0x20')](function(_0x26dd7b){logger[_0x9796('0x21')](_0x9796('0x22'),_0xf2fd9a,_0x9796('0x23'));logger[_0x9796('0x24')](_0x9796('0x25'),_0xf2fd9a,_0x9796('0x23'),JSON[_0x9796('0x26')](_0x26dd7b));if(_0x26dd7b[_0x9796('0x27')]){if(_0x26dd7b[_0x9796('0x27')][_0x9796('0x28')]===0x1f4){logger[_0x9796('0x27')]('SmsMessage,\x20%s,\x20%s',_0xf2fd9a,_0x26dd7b[_0x9796('0x27')][_0x9796('0x29')]);return _0x312b5f(_0x26dd7b[_0x9796('0x27')][_0x9796('0x29')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0xf2fd9a,_0x26dd7b[_0x9796('0x27')][_0x9796('0x29')]);return _0x4f5a81(_0x26dd7b['error'][_0x9796('0x29')]);}else{logger[_0x9796('0x21')](_0x9796('0x22'),_0xf2fd9a,_0x9796('0x23'));_0x4f5a81(_0x26dd7b[_0x9796('0x2a')][_0x9796('0x29')]);}})[_0x9796('0x2b')](function(_0x5e12ce){logger[_0x9796('0x27')]('SmsMessage,\x20%s,\x20%s',_0xf2fd9a,_0x5e12ce);_0x312b5f(_0x5e12ce);});});}function respondWithStatusCode(_0x272d97,_0x39e162){_0x39e162=_0x39e162||0xcc;return function(_0x358bbe){if(_0x358bbe){return _0x272d97[_0x9796('0x2c')](_0x39e162);}return _0x272d97[_0x9796('0x2d')](_0x39e162)[_0x9796('0x2e')]();};}function respondWithResult(_0x118022,_0x2e98ca){_0x2e98ca=_0x2e98ca||0xc8;return function(_0x587d04){if(_0x587d04){return _0x118022[_0x9796('0x2d')](_0x2e98ca)['json'](_0x587d04);}};}function respondWithFilteredResult(_0x5e268d,_0x2575b7){return function(_0x36cc6f){if(_0x36cc6f){var _0x3e9d62=typeof _0x2575b7['offset']===_0x9796('0x2f')&&typeof _0x2575b7['limit']===_0x9796('0x2f');var _0x156b26=_0x36cc6f['count'];var _0x29b1fe=_0x3e9d62?0x0:_0x2575b7[_0x9796('0x30')];var _0x336e61=_0x3e9d62?_0x36cc6f[_0x9796('0x31')]:_0x2575b7[_0x9796('0x30')]+_0x2575b7['limit'];var _0x5a7507;if(_0x336e61>=_0x156b26){_0x336e61=_0x156b26;_0x5a7507=0xc8;}else{_0x5a7507=0xce;}_0x5e268d[_0x9796('0x2d')](_0x5a7507);return _0x5e268d[_0x9796('0x32')](_0x9796('0x33'),_0x29b1fe+'-'+_0x336e61+'/'+_0x156b26)[_0x9796('0x34')](_0x36cc6f);}return null;};}function patchUpdates(_0x2af039){return function(_0x119f7c){try{jsonpatch[_0x9796('0x35')](_0x119f7c,_0x2af039,!![]);}catch(_0x406e09){return BPromise[_0x9796('0x36')](_0x406e09);}return _0x119f7c[_0x9796('0x37')]();};}function saveUpdates(_0x2ca645,_0x4eb11d){return function(_0x3db26f){if(_0x3db26f){return _0x3db26f[_0x9796('0x38')](_0x2ca645)[_0x9796('0x20')](function(_0x5a5eee){return _0x5a5eee;});}return null;};}function removeEntity(_0x134745,_0x37a2fb){return function(_0x274c79){if(_0x274c79){return _0x274c79[_0x9796('0x39')]()[_0x9796('0x20')](function(){_0x134745['status'](0xcc)[_0x9796('0x2e')]();});}};}function handleEntityNotFound(_0x1677f5,_0x3e1844){return function(_0x4e24b5){if(!_0x4e24b5){_0x1677f5['sendStatus'](0x194);}return _0x4e24b5;};}function handleError(_0x545d41,_0xe9762e){_0xe9762e=_0xe9762e||0x1f4;return function(_0x441de2){logger[_0x9796('0x27')](_0x441de2[_0x9796('0x3a')]);if(_0x441de2[_0x9796('0x3b')]){delete _0x441de2[_0x9796('0x3b')];}_0x545d41[_0x9796('0x2d')](_0xe9762e)[_0x9796('0x3c')](_0x441de2);};}exports[_0x9796('0x3d')]=function(_0x5559d7,_0x18237d){var _0xaf2a74={},_0x3b9f89={},_0x130257={'count':0x0,'rows':[]};var _0x46a155=_[_0x9796('0x3e')](db[_0x9796('0x3f')][_0x9796('0x40')],function(_0x5a2c6c){return{'name':_0x5a2c6c[_0x9796('0x41')],'type':_0x5a2c6c[_0x9796('0x42')][_0x9796('0x43')]};});_0x3b9f89[_0x9796('0x44')]=_[_0x9796('0x3e')](_0x46a155,'name');_0x3b9f89[_0x9796('0x45')]=_[_0x9796('0x46')](_0x5559d7['query']);_0x3b9f89[_0x9796('0x47')]=_[_0x9796('0x48')](_0x3b9f89[_0x9796('0x44')],_0x3b9f89['query']);_0xaf2a74['attributes']=_[_0x9796('0x48')](_0x3b9f89[_0x9796('0x44')],qs[_0x9796('0x49')](_0x5559d7[_0x9796('0x45')][_0x9796('0x49')]));_0xaf2a74[_0x9796('0x4a')]=_0xaf2a74['attributes'][_0x9796('0x4b')]?_0xaf2a74[_0x9796('0x4a')]:_0x3b9f89['model'];if(!_0x5559d7['query'][_0x9796('0x4c')]('nolimit')){_0xaf2a74[_0x9796('0x4d')]=qs[_0x9796('0x4d')](_0x5559d7[_0x9796('0x45')][_0x9796('0x4d')]);_0xaf2a74[_0x9796('0x30')]=qs[_0x9796('0x30')](_0x5559d7[_0x9796('0x45')]['offset']);}_0xaf2a74[_0x9796('0x4e')]=qs[_0x9796('0x4f')](_0x5559d7[_0x9796('0x45')][_0x9796('0x4f')]);_0xaf2a74['where']=qs[_0x9796('0x47')](_['pick'](_0x5559d7[_0x9796('0x45')],_0x3b9f89[_0x9796('0x47')]),_0x46a155);if(_0x5559d7[_0x9796('0x45')]['filter']){_0xaf2a74[_0x9796('0x50')]=_['merge'](_0xaf2a74[_0x9796('0x50')],{'$or':_[_0x9796('0x3e')](_0x46a155,function(_0x5bef68){if(_0x5bef68['type']!==_0x9796('0x51')){var _0x31c022={};_0x31c022[_0x5bef68[_0x9796('0x3b')]]={'$like':'%'+_0x5559d7[_0x9796('0x45')][_0x9796('0x52')]+'%'};return _0x31c022;}})});}_0xaf2a74=_[_0x9796('0x53')]({},_0xaf2a74,_0x5559d7[_0x9796('0x54')]);var _0x5609df={'where':_0xaf2a74[_0x9796('0x50')]};return db[_0x9796('0x3f')][_0x9796('0x31')](_0x5609df)['then'](function(_0x5c6993){_0x130257['count']=_0x5c6993;if(_0x5559d7[_0x9796('0x45')][_0x9796('0x55')]){_0xaf2a74['include']=[{'all':!![]}];}return db[_0x9796('0x3f')][_0x9796('0x56')](_0xaf2a74);})['then'](function(_0x3b0fad){_0x130257[_0x9796('0x57')]=_0x3b0fad;return _0x130257;})[_0x9796('0x20')](respondWithFilteredResult(_0x18237d,_0xaf2a74))[_0x9796('0x2b')](handleError(_0x18237d,null));};exports['show']=function(_0x241555,_0x5018f5){var _0x2d2061={'raw':!![],'where':{'id':_0x241555[_0x9796('0x58')]['id']}},_0x4c40f9={};_0x4c40f9[_0x9796('0x44')]=_[_0x9796('0x46')](db[_0x9796('0x3f')]['rawAttributes']);_0x4c40f9['query']=_[_0x9796('0x46')](_0x241555['query']);_0x4c40f9[_0x9796('0x47')]=_['intersection'](_0x4c40f9[_0x9796('0x44')],_0x4c40f9[_0x9796('0x45')]);_0x2d2061[_0x9796('0x4a')]=_[_0x9796('0x48')](_0x4c40f9[_0x9796('0x44')],qs[_0x9796('0x49')](_0x241555[_0x9796('0x45')]['fields']));_0x2d2061['attributes']=_0x2d2061[_0x9796('0x4a')]['length']?_0x2d2061['attributes']:_0x4c40f9[_0x9796('0x44')];if(_0x241555[_0x9796('0x45')]['includeAll']){_0x2d2061[_0x9796('0x59')]=[{'all':!![]}];}_0x2d2061=_[_0x9796('0x53')]({},_0x2d2061,_0x241555['options']);return db['SmsMessage']['find'](_0x2d2061)[_0x9796('0x20')](handleEntityNotFound(_0x5018f5,null))['then'](respondWithResult(_0x5018f5,null))[_0x9796('0x2b')](handleError(_0x5018f5,null));};exports[_0x9796('0x5a')]=function(_0x53108a,_0x4ab974){return db['SmsMessage'][_0x9796('0x5a')](_0x53108a[_0x9796('0x5b')],{})['then'](respondWithResult(_0x4ab974,0xc9))[_0x9796('0x2b')](handleError(_0x4ab974,null));};exports[_0x9796('0x38')]=function(_0x2178e5,_0x1f3daa){if(_0x2178e5[_0x9796('0x5b')]['id']){delete _0x2178e5[_0x9796('0x5b')]['id'];}return db[_0x9796('0x3f')][_0x9796('0x5c')]({'where':{'id':_0x2178e5['params']['id']}})[_0x9796('0x20')](handleEntityNotFound(_0x1f3daa,null))['then'](saveUpdates(_0x2178e5[_0x9796('0x5b')],null))[_0x9796('0x20')](respondWithResult(_0x1f3daa,null))[_0x9796('0x2b')](handleError(_0x1f3daa,null));};exports[_0x9796('0x39')]=function(_0x528cc7,_0x3100a4){return db[_0x9796('0x3f')][_0x9796('0x5c')]({'where':{'id':_0x528cc7[_0x9796('0x58')]['id']}})[_0x9796('0x20')](handleEntityNotFound(_0x3100a4,null))[_0x9796('0x20')](removeEntity(_0x3100a4,null))[_0x9796('0x2b')](handleError(_0x3100a4,null));};exports['describe']=function(_0x19c422,_0xdeabfd){return db[_0x9796('0x3f')][_0x9796('0x5d')]()[_0x9796('0x20')](respondWithResult(_0xdeabfd,null))[_0x9796('0x2b')](handleError(_0xdeabfd,null));};var interaction_log=require(_0x9796('0x11'))(_0x9796('0x5e'));exports[_0x9796('0x5f')]=function(_0x42c6f7,_0x4bf599,_0x214dda){var _0x11b2b4={'agent':{},'channel':_0x9796('0x60')};if(_0x42c6f7['body']['id']){delete _0x42c6f7['body']['id'];}_0x42c6f7[_0x9796('0x5b')][_0x9796('0x61')]=!![];_0x42c6f7['body'][_0x9796('0x62')]=moment()[_0x9796('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x42c6f7[_0x9796('0x5b')][_0x9796('0x64')]=_0x42c6f7[_0x9796('0x5b')]['UserId']||_0x42c6f7['user']['id'];_0x11b2b4['agent']['id']=_0x42c6f7[_0x9796('0x5b')][_0x9796('0x64')];return db[_0x9796('0x3f')][_0x9796('0x5c')]({'where':{'id':_0x42c6f7[_0x9796('0x58')]['id'],'UserId':null}})[_0x9796('0x20')](handleEntityNotFound(_0x4bf599,null))[_0x9796('0x20')](saveUpdates(_0x42c6f7['body'],null))[_0x9796('0x20')](function(_0x49be22){if(_0x49be22){_0x11b2b4[_0x9796('0x29')]=_0x49be22[_0x9796('0x65')]({'plain':!![]});return db[_0x9796('0x66')][_0x9796('0x5c')]({'where':{'id':_0x49be22[_0x9796('0x67')]}});}return null;})[_0x9796('0x20')](handleEntityNotFound(_0x4bf599,null))[_0x9796('0x20')](function(_0xb3fe78){if(_0xb3fe78){return _0xb3fe78['update']({'UserId':_0x42c6f7[_0x9796('0x5b')]['UserId'],'read1stAt':_[_0x9796('0x68')](_0xb3fe78[_0x9796('0x69')])?moment()['format'](_0x9796('0x6a')):undefined});}return null;})[_0x9796('0x20')](function(_0x431670){if(_0x431670){_0x11b2b4[_0x9796('0x6b')]=_0x431670[_0x9796('0x65')]({'plain':!![]});interaction_log[_0x9796('0x21')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x42c6f7[_0x9796('0x6c')]['id'],_0x42c6f7['user'][_0x9796('0x3b')],_0x42c6f7[_0x9796('0x6c')][_0x9796('0x6d')],_0x11b2b4[_0x9796('0x6b')]['id'],_0x42c6f7[_0x9796('0x5b')]?JSON[_0x9796('0x26')](_0x42c6f7[_0x9796('0x5b')]):_0x9796('0x6e'));return respondWithRpcPromise(_0x9796('0x6f'),_0x9796('0x70'),_0x11b2b4);}return null;})[_0x9796('0x20')](function(_0x3a64e){var _0x572e8='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x3a64e[_0x9796('0x29')][_0x9796('0x71')];return db['sequelize'][_0x9796('0x45')](_0x572e8,{'type':db['Sequelize'][_0x9796('0x72')]['SELECT'],'raw':!![]})[_0x9796('0x20')](function(_0x4e7cfd){return _0x4e7cfd;});})['then'](function(_0x5ebeab){if(_0x5ebeab){_0x11b2b4[_0x9796('0x29')][_0x9796('0x73')]=_0x5ebeab[0x0];if(!_0x42c6f7[_0x9796('0x5b')]['UserId'])return;return db[_0x9796('0x74')][_0x9796('0x5c')]({'where':{'id':_0x42c6f7[_0x9796('0x5b')]['UserId'],'role':_0x9796('0x75')},'attributes':['id',_0x9796('0x3b'),_0x9796('0x76'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0xd7606d){if(!_0xd7606d)return null;_0x11b2b4[_0x9796('0x29')][_0x9796('0x75')]=_0xd7606d;return _0x11b2b4;})[_0x9796('0x20')](function(_0x477650){if(_0x477650){if(_0x42c6f7[_0x9796('0x5b')][_0x9796('0x77')]){_0x11b2b4[_0x9796('0x29')]['interface']=util[_0x9796('0x63')](_0x9796('0x78'),_0x42c6f7[_0x9796('0x6c')][_0x9796('0x3b')]);_0x11b2b4[_0x9796('0x29')][_0x9796('0x79')]=_0x11b2b4['channel'];_0x11b2b4['message'][_0x9796('0x7a')]=_0x11b2b4[_0x9796('0x79')];_0x11b2b4['message'][_0x9796('0x7b')]=_0x9796('0x5f');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x9796('0x7c'),'message':_0x11b2b4['message']},client9002)[_0x9796('0x20')](function(){return _0x11b2b4;});}return _0x11b2b4;}return null;})[_0x9796('0x20')](respondWithResult(_0x4bf599,null))['catch'](handleError(_0x4bf599,null));};var interaction_log=require(_0x9796('0x11'))(_0x9796('0x5e'));exports[_0x9796('0x36')]=function(_0x335e86,_0xb1375e,_0x311100){var _0x1f7073={'agent':{},'channel':_0x9796('0x60')};if(_0x335e86[_0x9796('0x5b')]['id']){delete _0x335e86['body']['id'];}_0x335e86['body']['UserId']=_0x335e86[_0x9796('0x5b')][_0x9796('0x64')]||_0x335e86[_0x9796('0x6c')]['id'];_0x1f7073[_0x9796('0x75')]['id']=_0x335e86['body'][_0x9796('0x64')];return db['SmsMessage'][_0x9796('0x5c')]({'where':{'id':_0x335e86[_0x9796('0x58')]['id'],'UserId':null}})[_0x9796('0x20')](handleEntityNotFound(_0xb1375e,null))[_0x9796('0x20')](function(_0x4c7d15){if(_0x4c7d15){_0x1f7073[_0x9796('0x29')]=_0x4c7d15[_0x9796('0x65')]({'plain':!![]});return db[_0x9796('0x66')]['find']({'where':{'id':_0x4c7d15['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0xb1375e,null))[_0x9796('0x20')](function(_0x26383b){if(_0x26383b){_0x1f7073[_0x9796('0x6b')]=_0x26383b[_0x9796('0x65')]({'plain':!![]});interaction_log[_0x9796('0x21')](_0x9796('0x7d'),_0x335e86['user']['id'],_0x335e86[_0x9796('0x6c')]['name'],_0x335e86[_0x9796('0x6c')][_0x9796('0x6d')],_0x1f7073[_0x9796('0x6b')]['id'],_0x335e86[_0x9796('0x5b')]?JSON['stringify'](_0x335e86[_0x9796('0x5b')]):_0x9796('0x6e'));return respondWithRpcPromise(_0x9796('0x7e'),_0x9796('0x7f'),_0x1f7073);}return null;})['then'](function(_0xe66310){var _0x33d8db='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xe66310[_0x9796('0x29')][_0x9796('0x71')];return db[_0x9796('0x80')][_0x9796('0x45')](_0x33d8db,{'type':db[_0x9796('0x81')][_0x9796('0x72')]['SELECT'],'raw':!![]})[_0x9796('0x20')](function(_0x48eb7b){return _0x48eb7b;});})[_0x9796('0x20')](function(_0x256a2c){if(_0x256a2c){_0x1f7073[_0x9796('0x29')][_0x9796('0x73')]=_0x256a2c[0x0];if(!_0x335e86[_0x9796('0x5b')]['UserId'])return;return db[_0x9796('0x74')][_0x9796('0x5c')]({'where':{'id':_0x335e86[_0x9796('0x5b')][_0x9796('0x64')],'role':'agent'},'attributes':['id',_0x9796('0x3b'),_0x9796('0x76'),_0x9796('0x82'),_0x9796('0x83')],'raw':!![]});}return null;})[_0x9796('0x20')](function(_0x2175a4){if(!_0x2175a4)return null;_0x1f7073[_0x9796('0x29')][_0x9796('0x75')]=_0x2175a4;return _0x1f7073;})[_0x9796('0x20')](function(_0x425bb7){if(_0x425bb7){_0x425bb7[_0x9796('0x29')][_0x9796('0x84')]=util[_0x9796('0x63')](_0x9796('0x78'),_0x335e86[_0x9796('0x6c')]['name']);_0x425bb7[_0x9796('0x29')]['channel']=_0x1f7073['channel'];_0x425bb7['message'][_0x9796('0x7a')]=_0x1f7073[_0x9796('0x79')];_0x425bb7[_0x9796('0x29')]['event']=_0x9796('0x36');respondWithRpcPromise(_0x9796('0x85'),_0x9796('0x85'),{'event':'rejectmessage','message':_0x425bb7[_0x9796('0x29')]},client9002);return _0x1f7073;}return null;})[_0x9796('0x20')](respondWithResult(_0xb1375e,null))[_0x9796('0x2b')](handleError(_0xb1375e,null));};exports[_0x9796('0x2d')]=function(_0x289798,_0x13af18,_0xb36a04){if(_0x289798[_0x9796('0x5b')]['id']){delete _0x289798['body']['id'];}var _0x49adad;return db['SmsMessage'][_0x9796('0x5c')]({'where':{'id':_0x289798['params']['id']}})[_0x9796('0x20')](handleEntityNotFound(_0x13af18,null))[_0x9796('0x20')](function(_0x56c660){if(_0x56c660){_0x49adad=_0x56c660;return db[_0x9796('0x86')][_0x9796('0x5c')]({'where':{'id':_0x56c660['SmsAccountId']}});}})[_0x9796('0x20')](handleEntityNotFound(_0x13af18,null))[_0x9796('0x20')](function(_0x2433b7){if(_0x2433b7){logger[_0x9796('0x24')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9796('0x2d'),'received\x20delivery\x20report\x20from',_0x2433b7[_0x9796('0x42')],util[_0x9796('0x87')](_0x289798[_0x9796('0x5b')],{'showHidden':![],'depth':null}));switch(_0x2433b7['type']){case'twilio':if(_0x289798[_0x9796('0x5b')][_0x9796('0x88')]&&_0x289798[_0x9796('0x5b')][_0x9796('0x88')]===_0x49adad['messageId']){return _0x49adad[_0x9796('0x38')]({'read':!![]});}else{logger[_0x9796('0x27')](_0x9796('0x89'),'status',_0x9796('0x8a'),util[_0x9796('0x87')](_0x289798[_0x9796('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x9796('0x8b'):if(_0x289798[_0x9796('0x5b')][_0x9796('0x8c')]&&_0x289798[_0x9796('0x5b')][_0x9796('0x8c')]===_0x49adad[_0x9796('0x8d')]&&_[_0x9796('0x8e')]([_0x9796('0x8f'),'delivered'],_0x289798['body']['Status'])>=0x0){return _0x49adad[_0x9796('0x38')]({'read':!![]});}else{logger['error'](_0x9796('0x89'),_0x9796('0x2d'),'plivio',util[_0x9796('0x87')](_0x289798['body'],{'showHidden':![],'depth':null}));}break;case _0x9796('0x90'):var _0x16e109=_0x289798['body']['results'][0x0];if(_0x16e109[_0x9796('0x2d')][_0x9796('0x91')]===_0x9796('0x92')){return _0x49adad[_0x9796('0x38')]({'read':!![]});}else{logger[_0x9796('0x27')](_0x9796('0x89'),_0x9796('0x2d'),_0x9796('0x90'),util[_0x9796('0x87')](_0x289798[_0x9796('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x49adad;}})[_0x9796('0x20')](respondWithResult(_0x13af18,null))[_0x9796('0x2b')](handleError(_0x13af18,null));};
\ No newline at end of file
index 291a8b8..95cb1b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x73d3=['SmsMessage','setMaxListeners','save','remove','emit','hook','../../mysqldb'];(function(_0x5512bf,_0x31ed23){var _0x317e8b=function(_0x3e1cf8){while(--_0x3e1cf8){_0x5512bf['push'](_0x5512bf['shift']());}};_0x317e8b(++_0x31ed23);}(_0x73d3,0xc3));var _0x373d=function(_0x1d56ca,_0x2e3a76){_0x1d56ca=_0x1d56ca-0x0;var _0x4747d2=_0x73d3[_0x1d56ca];return _0x4747d2;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x373d('0x0'))['db'][_0x373d('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x373d('0x2')](0x0);var events={'afterCreate':_0x373d('0x3'),'afterUpdate':'update','afterDestroy':_0x373d('0x4')};function emitEvent(_0x13d1ec){return function(_0x579195,_0x40cad6,_0x1ad940){SmsMessageEvents[_0x373d('0x5')](_0x13d1ec+':'+_0x579195['id'],_0x579195);SmsMessageEvents[_0x373d('0x5')](_0x13d1ec,_0x579195);_0x1ad940(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x373d('0x6')](e,emitEvent(event));}}module['exports']=SmsMessageEvents;
\ No newline at end of file
+var _0x64ad=['events','../../mysqldb','setMaxListeners','exports'];(function(_0xbb777d,_0x53746a){var _0x5dde69=function(_0xf1c4b4){while(--_0xf1c4b4){_0xbb777d['push'](_0xbb777d['shift']());}};_0x5dde69(++_0x53746a);}(_0x64ad,0xa8));var _0xd64a=function(_0x1b2255,_0x3de34f){_0x1b2255=_0x1b2255-0x0;var _0x33e57d=_0x64ad[_0x1b2255];return _0x33e57d;};'use strict';var EventEmitter=require(_0xd64a('0x0'));var SmsMessage=require(_0xd64a('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xd64a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x44b4d6){return function(_0x5760a7,_0x31486b,_0x126845){SmsMessageEvents['emit'](_0x44b4d6+':'+_0x5760a7['id'],_0x5760a7);SmsMessageEvents['emit'](_0x44b4d6,_0x5760a7);_0x126845(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xd64a('0x3')]=SmsMessageEvents;
\ No newline at end of file
index fac2f5e..7fd0026 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1542=['hex','signature=','GET','/external/get/send.php?','Missing\x20parameters:\x20apiKey','clickatell','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','findOne','createdAt','SmsAccount','find','SmsAccountId','then','type','twilio','accountSid','authToken','messages','phone','/status?token=','token','update','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','split','sms','POST','user_key','session_key','total_sent','read','error','inspect','Missing\x20parameters:\x20username,\x20password','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','connectel','clicksend','xCALLY\x20Motion','format','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','head','message_id','clickSend','plivo','authId','remote','/api/sms/messages/','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','timestamp','keys','sort','length','createHash','md5','digest'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1542,0x116));var _0x2154=function(_0xcf22a8,_0x35d51c){_0xcf22a8=_0xcf22a8-0x0;var _0x1137eb=_0x1542[_0xcf22a8];return _0x1137eb;};'use strict';var _=require(_0x2154('0x0'));var util=require(_0x2154('0x1'));var logger=require(_0x2154('0x2'))(_0x2154('0x3'));var moment=require(_0x2154('0x4'));var BPromise=require('bluebird');var rp=require(_0x2154('0x5'));var fs=require('fs');var path=require(_0x2154('0x6'));var rimraf=require(_0x2154('0x7'));var config=require('../../config/environment');var attributes=require(_0x2154('0x8'));module[_0x2154('0x9')]=function(_0x5406f9,_0x13d9c2){return _0x5406f9[_0x2154('0xa')](_0x2154('0xb'),attributes,{'tableName':_0x2154('0xc'),'paranoid':![],'indexes':[{'name':_0x2154('0xd'),'fields':[_0x2154('0xd')]},{'name':_0x2154('0xe'),'fields':[_0x2154('0xf')],'type':_0x2154('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a5489,_0x4fcde5,_0xe2c6bd){var _0x388079=_0x5406f9[_0x2154('0x11')];var _0x5a4858=_0x1a5489['get']({'plain':!![]});if(_0x5a4858[_0x2154('0x12')][_0x2154('0x13')]()==='in'||_0x5a4858['direction'][_0x2154('0x13')]()===_0x2154('0x14')&&!_0x5a4858[_0x2154('0x15')]&&!_[_0x2154('0x16')](_0x5a4858[_0x2154('0x17')])){_0x388079[_0x2154('0x18')][_0x2154('0x19')]({'where':{'id':_0x5a4858['SmsInteractionId']}})['then'](function(_0x160517){if(_0x160517){_0x160517['update']({'lastMsgAt':_0x5a4858[_0x2154('0x1a')],'lastMsgDirection':_0x5a4858['direction']['toLowerCase']()});}})['catch'](function(_0x46c995){console['error'](_0x46c995);});}if(_0x5a4858[_0x2154('0x12')]==='out'&&!_0x5a4858[_0x2154('0x15')]){var _0x369ab6;_0x388079[_0x2154('0x1b')][_0x2154('0x1c')]({'where':{'id':_0x5a4858[_0x2154('0x1d')]},'raw':!![]})[_0x2154('0x1e')](function(_0x15c197){_0x369ab6=_0x15c197;if(_0x369ab6&&_0x369ab6[_0x2154('0x1f')]){switch(_0x369ab6[_0x2154('0x1f')]){case _0x2154('0x20'):var _0x50ed9b=require(_0x2154('0x20'));if(_0x369ab6[_0x2154('0x21')]&&_0x369ab6[_0x2154('0x22')]&&_0x369ab6['phone']){var _0x2af3dd=new _0x50ed9b(_0x369ab6[_0x2154('0x21')],_0x369ab6[_0x2154('0x22')]);_0x2af3dd[_0x2154('0x23')]['create']({'body':_0x5a4858[_0x2154('0xf')],'to':_0x5a4858[_0x2154('0x24')],'from':_0x369ab6[_0x2154('0x24')],'statusCallback':_0x369ab6['remote']+'/api/sms/messages/'+_0x5a4858['id']+_0x2154('0x25')+_0x369ab6[_0x2154('0x26')]})[_0x2154('0x1e')](function(_0x4ef4f7){if(_0x4ef4f7['sid']){return _0x1a5489[_0x2154('0x27')]({'messageId':_0x4ef4f7[_0x2154('0x28')]});}})[_0x2154('0x29')](function(_0x3b4fa8){logger['error'](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x20'),util['inspect'](_0x3b4fa8,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x20'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x2154('0x2c'):var _0xd780d=_0x2154('0x2d');if(_0x369ab6[_0x2154('0x2e')]&&_0x369ab6[_0x2154('0x2f')]){var _0x5cd152={'recipient':[_0x5a4858[_0x2154('0x24')]],'message':_0x5a4858[_0x2154('0xf')],'message_type':_0x369ab6[_0x2154('0x30')]};if(_0x369ab6[_0x2154('0x30')]&&_0x369ab6[_0x2154('0x30')]!=='SI'){_0x5cd152[_0x2154('0x31')]=_0x369ab6[_0x2154('0x24')];}var _0x133f98={'url':_0xd780d+_0x2154('0x32')+_0x369ab6[_0x2154('0x2e')]+'&password='+_0x369ab6[_0x2154('0x2f')],'method':'GET'};rp(_0x133f98)['then'](function(_0x883503){var _0x106d3e=_0x883503[_0x2154('0x33')](';');var _0x5a701e={'user_key':_0x106d3e[0x0],'session_key':_0x106d3e[0x1]};_0x133f98={'url':_0xd780d+_0x2154('0x34'),'method':_0x2154('0x35'),'headers':{'user_key':_0x5a701e[_0x2154('0x36')],'Session_key':_0x5a701e[_0x2154('0x37')]},'json':!![],'body':_0x5cd152};return rp(_0x133f98);})[_0x2154('0x1e')](function(_0x3a252a){if(_0x3a252a[_0x2154('0x38')]>=0x1){var _0x3d38f3={'messageId':_0x3a252a['internal_order_id']};if(_0x369ab6[_0x2154('0x30')]!=='GP'||!_0x369ab6['deliveryReport']){_0x3d38f3[_0x2154('0x39')]=!![];}return _0x1a5489[_0x2154('0x27')](_0x3d38f3);}else{return logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),'skebby',util['inspect'](_0x3a252a,{'showHidden':![],'depth':null}));}})[_0x2154('0x29')](function(_0x3ff05a){return logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x2c'),util[_0x2154('0x3b')](_0x3ff05a,{'showHidden':![],'depth':null}));});}else{logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),'skebby',_0x2154('0x3c'));}break;case'connectel':if(_0x369ab6[_0x2154('0x22')]){var _0x2a1edb={'recipient':_0x5a4858[_0x2154('0x24')],'message':_0x5a4858[_0x2154('0xf')],'sender':_0x369ab6[_0x2154('0x3d')]||_0x369ab6[_0x2154('0x24')],'authorization':_0x369ab6['authToken']};var _0x4fcde5={'method':_0x2154('0x35'),'uri':_0x2154('0x3e'),'body':_0x2a1edb,'json':!![]};rp(_0x4fcde5)[_0x2154('0x1e')](function(_0x1a4167){var _0x12e7c5={'messageId':_0x1a4167[_0x2154('0x3f')]};if(!_0x369ab6[_0x2154('0x40')]){_0x12e7c5[_0x2154('0x39')]=!![];}return _0x1a5489[_0x2154('0x27')](_0x12e7c5);})['catch'](function(_0x5d77b0){logger[_0x2154('0x3a')](_0x2154('0x2a'),'afterCreate',_0x2154('0x41'),util[_0x2154('0x3b')](_0x5d77b0,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2154('0x2a'),_0x2154('0x2b'),'connectel','Missing\x20parameters:\x20authToken');}break;case _0x2154('0x42'):if(_0x369ab6[_0x2154('0x2e')]&&_0x369ab6[_0x2154('0x2f')]){var _0x2a1edb={'messages':[{'source':_0x2154('0x43'),'to':_0x5a4858[_0x2154('0x24')],'body':_0x5a4858[_0x2154('0xf')],'from':_0x369ab6[_0x2154('0x3d')]||_0x369ab6[_0x2154('0x24')]}]};var _0x61a813=util[_0x2154('0x44')]('%s:%s',_0x369ab6['username'],_0x369ab6[_0x2154('0x2f')]);var _0x4fcde5={'method':_0x2154('0x35'),'uri':_0x2154('0x45'),'body':_0x2a1edb,'headers':{'Authorization':util[_0x2154('0x44')](_0x2154('0x46'),new Buffer(_0x61a813)['toString'](_0x2154('0x47')))},'json':!![]};rp(_0x4fcde5)[_0x2154('0x1e')](function(_0x243dc0){if(_0x243dc0[_0x2154('0x48')]>=0xc8&&_0x243dc0[_0x2154('0x48')]<=0xce){if(_0x243dc0[_0x2154('0x49')]&&_0x243dc0['data']['queued_count']>0x0){var _0x4dbc52=_[_0x2154('0x4a')](_0x243dc0['data']['messages']);var _0x18f0ba={'messageId':_0x4dbc52[_0x2154('0x4b')]};if(!_0x369ab6[_0x2154('0x40')]){_0x18f0ba[_0x2154('0x39')]=!![];}return _0x1a5489[_0x2154('0x27')](_0x18f0ba);}else{logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),'clickSend',util[_0x2154('0x3b')](_0x243dc0,{'showHidden':![],'depth':null}));}}else{logger[_0x2154('0x3a')](_0x2154('0x2a'),'afterCreate','clickSend',util[_0x2154('0x3b')](_0x243dc0,{'showHidden':![],'depth':null}));}})[_0x2154('0x29')](function(_0x3ab5aa){logger['error'](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x4c'),util[_0x2154('0x3b')](_0x3ab5aa,{'showHidden':![],'depth':null}));});}else{logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x4c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x2154('0x4d'):if(_0x369ab6[_0x2154('0x4e')]&&_0x369ab6[_0x2154('0x22')]){var _0x2a1edb={'dst':_0x5a4858['phone'],'text':_0x5a4858[_0x2154('0xf')],'src':_0x369ab6['senderString']||_0x369ab6['phone'],'url':_0x369ab6[_0x2154('0x4f')]+_0x2154('0x50')+_0x5a4858['id']+_0x2154('0x25')+_0x369ab6[_0x2154('0x26')]};var _0x61a813=util[_0x2154('0x44')](_0x2154('0x51'),_0x369ab6[_0x2154('0x4e')],_0x369ab6[_0x2154('0x22')]);var _0x4fcde5={'method':'POST','uri':util['format'](_0x2154('0x52'),_0x369ab6['authId']),'body':_0x2a1edb,'headers':{'Authorization':util[_0x2154('0x44')]('Basic\x20%s',new Buffer(_0x61a813)[_0x2154('0x53')](_0x2154('0x47')))},'json':!![]};rp(_0x4fcde5)[_0x2154('0x1e')](function(_0x3b948c){var _0xfa774b={'messageId':_0x3b948c[_0x2154('0x54')][0x0]};return _0x1a5489[_0x2154('0x27')](_0xfa774b);})[_0x2154('0x29')](function(_0x3a7f71){logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x4d'),util[_0x2154('0x3b')](_0x3a7f71,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2154('0x2b'),_0x2154('0x4d'),_0x2154('0x55'));}break;case _0x2154('0x56'):if(_0x369ab6[_0x2154('0x2e')]&&_0x369ab6['password']){if(_0x369ab6['baseUrl']){var _0x5a7f97={'method':_0x2154('0x35'),'uri':_0x369ab6[_0x2154('0x57')]+_0x2154('0x58'),'body':{'username':_0x369ab6[_0x2154('0x2e')],'password':_0x369ab6['password']},'json':!![]};return rp(_0x5a7f97)[_0x2154('0x1e')](function(_0x420702){var _0x186040={'method':_0x2154('0x35'),'uri':_0x369ab6[_0x2154('0x57')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x369ab6[_0x2154('0x24')],'destinations':[{'to':_0x5a4858['phone']}],'text':_0x5a4858[_0x2154('0xf')],'notifyUrl':_0x369ab6[_0x2154('0x4f')]+_0x2154('0x50')+_0x5a4858['id']+_0x2154('0x25')+_0x369ab6[_0x2154('0x26')],'notifyContentType':_0x2154('0x59'),'callbackData':_0x369ab6['phone']+';'+_0x5a4858[_0x2154('0xf')]}]},'headers':{'Authorization':_0x2154('0x5a')+_0x420702[_0x2154('0x26')]},'json':!![]};return rp(_0x186040)[_0x2154('0x1e')](function(_0xae4338){if(_0xae4338[_0x2154('0x23')]){var _0xc1c1a4={'messageId':_0xae4338['messages'][0x0][_0x2154('0xd')]};if(!_0x369ab6[_0x2154('0x40')]){_0xc1c1a4[_0x2154('0x39')]=!![];}return _0x1a5489['update'](_0xc1c1a4);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2154('0x2b'),'infobip',util[_0x2154('0x3b')](_0xae4338,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x49c55a){return logger[_0x2154('0x3a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2154('0x2b'),_0x2154('0x56'),util[_0x2154('0x3b')](_0x49c55a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x2154('0x2a'),'afterCreate','infobip',_0x2154('0x5b'));}}else{logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x56'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x2154('0x5c'):var _0x5cdc86=require(_0x2154('0x5d'));if(_0x369ab6[_0x2154('0x5e')]){var _0xc1dd4f={};_0xc1dd4f[_0x2154('0x5f')]=_0x369ab6['username'];_0xc1dd4f[_0x2154('0x24')]=_0x5a4858['phone'];_0xc1dd4f[_0x2154('0x31')]=_0x369ab6[_0x2154('0x24')];_0xc1dd4f['text']=_0x5a4858[_0x2154('0xf')];_0xc1dd4f[_0x2154('0x60')]=+new Date();var _0x3c148d='';var _0x5730bc='';var _0x5076bd=Object[_0x2154('0x61')](_0xc1dd4f);_0x5076bd[_0x2154('0x62')]();for(var _0x589c4a=0x0;_0x589c4a<_0x5076bd[_0x2154('0x63')];_0x589c4a++){if(_0x3c148d!=''){_0x3c148d+='&';}_0x3c148d+=_0x5076bd[_0x589c4a]+'='+encodeURIComponent(_0xc1dd4f[_0x5076bd[_0x589c4a]]);_0x5730bc+=_0xc1dd4f[_0x5076bd[_0x589c4a]];}_0x5730bc+=_0x369ab6[_0x2154('0x5e')];_0x5730bc=_0x5cdc86[_0x2154('0x64')](_0x2154('0x65'))[_0x2154('0x27')](_0x5730bc)[_0x2154('0x66')](_0x2154('0x67'));if(_0x3c148d!==''){_0x3c148d+='&';}_0x3c148d+=_0x2154('0x68')+_0x5730bc;var _0x133f98={'method':_0x2154('0x69'),'uri':_0x369ab6[_0x2154('0x57')]+_0x2154('0x6a')+_0x3c148d,'json':!![]};return rp(_0x133f98)[_0x2154('0x1e')](function(_0x305b09){var _0x170113=Object[_0x2154('0x61')](_0x305b09);if(_0x305b09[_0x170113[0x0]][_0x2154('0x3a')]&&parseInt(_0x305b09[_0x170113[0x0]][_0x2154('0x3a')])===0x0){var _0x106df9={'messageId':_0x305b09[_0x170113[0x0]]['id_sms']};if(!_0x369ab6[_0x2154('0x40')]){_0x106df9[_0x2154('0x39')]=!![];}return _0x1a5489[_0x2154('0x27')](_0x106df9);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2154('0x2b'),'csc',util['inspect'](_0x305b09['error'],{'showHidden':![],'depth':null}));}})[_0x2154('0x29')](function(_0xea4ecb){return logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),'csc',util[_0x2154('0x3b')](_0xea4ecb,{'showHidden':![],'depth':null}));});}else{logger[_0x2154('0x3a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2154('0x2b'),_0x2154('0x5c'),_0x2154('0x6b'));}break;case _0x2154('0x6c'):if(_0x369ab6[_0x2154('0x5e')]){var _0x50021b={'method':'POST','uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x369ab6['apiKey']},'body':{'content':_0x5a4858[_0x2154('0xf')],'to':[_0x5a4858[_0x2154('0x24')]],'from':_0x369ab6['phone'],'binary':![],'clientMessageId':_0x2154('0x6d'),'charset':_0x2154('0x6e')},'json':!![]};rp(_0x50021b)[_0x2154('0x1e')](function(_0x4eac49){if(!_0x4eac49[_0x2154('0x3a')]){var _0x380a61={'messageId':_0x4eac49['messages'][0x0][_0x2154('0x6f')]};if(!_0x369ab6[_0x2154('0x40')]){_0x380a61[_0x2154('0x39')]=!![];}return _0x1a5489[_0x2154('0x27')](_0x380a61);}else{return logger[_0x2154('0x3a')](_0x2154('0x2a'),'afterCreate',_0x2154('0x6c'),util[_0x2154('0x3b')](_0x4eac49[_0x2154('0x3a')],{'showHidden':![],'depth':null}));}})[_0x2154('0x29')](function(_0x152691){return logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),'clickatell',util[_0x2154('0x3b')](_0x152691,{'showHidden':![],'depth':null}));});}else{logger[_0x2154('0x3a')](_0x2154('0x2a'),'afterCreate',_0x2154('0x6c'),_0x2154('0x6b'));}break;case _0x2154('0x70'):if(_0x369ab6['username']&&_0x369ab6[_0x2154('0x2f')]){var _0x61a813=util[_0x2154('0x44')](_0x2154('0x51'),_0x369ab6[_0x2154('0x2e')],_0x369ab6['password']);var _0x4fcde5={'method':_0x2154('0x35'),'uri':_0x2154('0x71')+_0x369ab6[_0x2154('0x72')]+'/messages','body':{'to':[_0x5a4858[_0x2154('0x24')]],'text':_0x5a4858[_0x2154('0xf')],'from':_0x369ab6['phone'],'applicationId':_0x369ab6[_0x2154('0x73')]},'headers':{'Authorization':util[_0x2154('0x44')](_0x2154('0x46'),new Buffer(_0x61a813)['toString'](_0x2154('0x47')))},'json':!![]};rp(_0x4fcde5)[_0x2154('0x1e')](function(_0x4c422c){if(_0x4c422c['id']){var _0x1feca3={'messageId':_0x4c422c['id']};return _0x1a5489['update'](_0x1feca3);}else{logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x70'),util['inspect'](_0x4c422c,{'showHidden':![],'depth':null}));}})[_0x2154('0x29')](function(_0x33ffb7){logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x70'),util['inspect'](_0x33ffb7,{'showHidden':![],'depth':null}));});}else{logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x70'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x2154('0x74'):if(_0x369ab6[_0x2154('0x5e')]){var _0x5f3da9={};var _0x133f98={'method':_0x2154('0x35'),'uri':_0x2154('0x75'),'headers':{'Authorization':_0x2154('0x76')+_0x369ab6[_0x2154('0x5e')],'Content-Type':'application/json'},'body':{'from':_0x369ab6[_0x2154('0x24')],'to':_0x5a4858[_0x2154('0x24')],'text':_0x5a4858[_0x2154('0xf')]},'json':!![]};return rp(_0x133f98)[_0x2154('0x1e')](function(_0x357414){if(_0x357414[_0x2154('0x77')]==0xca){_0x5f3da9[_0x2154('0x78')]=_0x357414;var _0x3a559e={'method':_0x2154('0x35'),'uri':_0x2154('0x79'),'headers':{'Authorization':'Bearer\x20'+_0x369ab6[_0x2154('0x5e')],'Content-Type':_0x2154('0x59')},'body':{'refid':_0x5f3da9[_0x2154('0x78')][_0x2154('0x7a')]},'json':!![]};return rp(_0x3a559e)[_0x2154('0x1e')](function(_0x405dd6){_0x5f3da9[_0x2154('0x7b')]=_0x405dd6;var _0x143be5={'messageId':_0x5f3da9[_0x2154('0x78')]['refid'],'read':!![]};return _0x1a5489[_0x2154('0x27')](_0x143be5);});}else{return logger[_0x2154('0x3a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2154('0x2b'),_0x2154('0x74'),util[_0x2154('0x3b')](_0x357414,{'showHidden':![],'depth':null}));}})['catch'](function(_0x30cecb){return logger[_0x2154('0x3a')](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x74'),util[_0x2154('0x3b')](_0x30cecb,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x2154('0x2a'),_0x2154('0x2b'),_0x2154('0x74'),_0x2154('0x7c'));}break;}}})[_0x2154('0x7d')](function(){_0xe2c6bd();});}else{_0xe2c6bd();}}},'charset':_0x2154('0x7e'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x92d7=['UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','smsMethod','sender','GET','split','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','connectel','senderString','POST','requestid','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','https://api.plivo.com/v1/Account/%s/Message/','toString','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','login','timestamp','sort','length','apiKey','digest','signature=','/external/get/send.php?','keys','clickatell','uuid'];(function(_0x5d88c0,_0x5d7d83){var _0x1b40f0=function(_0x3fde10){while(--_0x3fde10){_0x5d88c0['push'](_0x5d88c0['shift']());}};_0x1b40f0(++_0x5d7d83);}(_0x92d7,0x17b));var _0x792d=function(_0x1a4e80,_0x58016c){_0x1a4e80=_0x1a4e80-0x0;var _0x5198c3=_0x92d7[_0x1a4e80];return _0x5198c3;};'use strict';var _=require(_0x792d('0x0'));var util=require('util');var logger=require(_0x792d('0x1'))(_0x792d('0x2'));var moment=require(_0x792d('0x3'));var BPromise=require(_0x792d('0x4'));var rp=require(_0x792d('0x5'));var fs=require('fs');var path=require(_0x792d('0x6'));var rimraf=require(_0x792d('0x7'));var config=require(_0x792d('0x8'));var attributes=require(_0x792d('0x9'));module[_0x792d('0xa')]=function(_0x54374f,_0x3e95c4){return _0x54374f[_0x792d('0xb')](_0x792d('0xc'),attributes,{'tableName':_0x792d('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x792d('0xe')]},{'name':_0x792d('0xf'),'fields':[_0x792d('0x10')],'type':_0x792d('0x11')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x35bf20,_0x1cef60,_0xf33083){var _0x4be215=_0x54374f[_0x792d('0x12')];var _0x4fb7cb=_0x35bf20[_0x792d('0x13')]({'plain':!![]});if(_0x4fb7cb[_0x792d('0x14')]['toLowerCase']()==='in'||_0x4fb7cb['direction'][_0x792d('0x15')]()===_0x792d('0x16')&&!_0x4fb7cb[_0x792d('0x17')]&&!_['isNil'](_0x4fb7cb[_0x792d('0x18')])){_0x4be215[_0x792d('0x19')][_0x792d('0x1a')]({'where':{'id':_0x4fb7cb[_0x792d('0x1b')]}})[_0x792d('0x1c')](function(_0x3ead79){if(_0x3ead79){_0x3ead79[_0x792d('0x1d')]({'lastMsgAt':_0x4fb7cb[_0x792d('0x1e')],'lastMsgDirection':_0x4fb7cb[_0x792d('0x14')][_0x792d('0x15')]()});}})[_0x792d('0x1f')](function(_0x252b34){console[_0x792d('0x20')](_0x252b34);});}if(_0x4fb7cb[_0x792d('0x14')]===_0x792d('0x16')&&!_0x4fb7cb['secret']){var _0x4069f3;_0x4be215[_0x792d('0x21')][_0x792d('0x22')]({'where':{'id':_0x4fb7cb[_0x792d('0x23')]},'raw':!![]})['then'](function(_0x78ed2c){_0x4069f3=_0x78ed2c;if(_0x4069f3&&_0x4069f3['type']){switch(_0x4069f3['type']){case'twilio':var _0x5764de=require(_0x792d('0x24'));if(_0x4069f3[_0x792d('0x25')]&&_0x4069f3[_0x792d('0x26')]&&_0x4069f3[_0x792d('0x27')]){var _0x5b089a=new _0x5764de(_0x4069f3['accountSid'],_0x4069f3[_0x792d('0x26')]);_0x5b089a[_0x792d('0x28')][_0x792d('0x29')]({'body':_0x4fb7cb[_0x792d('0x10')],'to':_0x4fb7cb[_0x792d('0x27')],'from':_0x4069f3[_0x792d('0x27')],'statusCallback':_0x4069f3[_0x792d('0x2a')]+_0x792d('0x2b')+_0x4fb7cb['id']+_0x792d('0x2c')+_0x4069f3[_0x792d('0x2d')]})[_0x792d('0x1c')](function(_0x101a5c){if(_0x101a5c[_0x792d('0x2e')]){return _0x35bf20[_0x792d('0x1d')]({'messageId':_0x101a5c[_0x792d('0x2e')]});}})[_0x792d('0x1f')](function(_0x49258e){logger[_0x792d('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x792d('0x2f'),'twilio',util['inspect'](_0x49258e,{'showHidden':![],'depth':null}));});}else{logger[_0x792d('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x792d('0x2f'),'twilio',_0x792d('0x30'));}break;case _0x792d('0x31'):var _0x3543d4='https://api.skebby.it/API/v1.0/REST/';if(_0x4069f3[_0x792d('0x32')]&&_0x4069f3[_0x792d('0x33')]){var _0x1b4435={'recipient':[_0x4fb7cb[_0x792d('0x27')]],'message':_0x4fb7cb[_0x792d('0x10')],'message_type':_0x4069f3[_0x792d('0x34')]};if(_0x4069f3[_0x792d('0x34')]&&_0x4069f3['smsMethod']!=='SI'){_0x1b4435[_0x792d('0x35')]=_0x4069f3[_0x792d('0x27')];}var _0xa509de={'url':_0x3543d4+'login?username='+_0x4069f3[_0x792d('0x32')]+'&password='+_0x4069f3[_0x792d('0x33')],'method':_0x792d('0x36')};rp(_0xa509de)[_0x792d('0x1c')](function(_0x31ed20){var _0xc2d3f4=_0x31ed20[_0x792d('0x37')](';');var _0x44cd71={'user_key':_0xc2d3f4[0x0],'session_key':_0xc2d3f4[0x1]};_0xa509de={'url':_0x3543d4+'sms','method':'POST','headers':{'user_key':_0x44cd71[_0x792d('0x38')],'Session_key':_0x44cd71[_0x792d('0x39')]},'json':!![],'body':_0x1b4435};return rp(_0xa509de);})['then'](function(_0x76cf6f){if(_0x76cf6f[_0x792d('0x3a')]>=0x1){var _0x3055a0={'messageId':_0x76cf6f[_0x792d('0x3b')]};if(_0x4069f3[_0x792d('0x34')]!=='GP'||!_0x4069f3[_0x792d('0x3c')]){_0x3055a0[_0x792d('0x3d')]=!![];}return _0x35bf20[_0x792d('0x1d')](_0x3055a0);}else{return logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x31'),util[_0x792d('0x3f')](_0x76cf6f,{'showHidden':![],'depth':null}));}})[_0x792d('0x1f')](function(_0x5915ef){return logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x31'),util['inspect'](_0x5915ef,{'showHidden':![],'depth':null}));});}else{logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x31'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x792d('0x40'):if(_0x4069f3[_0x792d('0x26')]){var _0x33526d={'recipient':_0x4fb7cb[_0x792d('0x27')],'message':_0x4fb7cb['body'],'sender':_0x4069f3[_0x792d('0x41')]||_0x4069f3[_0x792d('0x27')],'authorization':_0x4069f3[_0x792d('0x26')]};var _0x1cef60={'method':_0x792d('0x42'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x33526d,'json':!![]};rp(_0x1cef60)[_0x792d('0x1c')](function(_0x30c7bb){var _0x518a4c={'messageId':_0x30c7bb[_0x792d('0x43')]};if(!_0x4069f3['deliveryReport']){_0x518a4c['read']=!![];}return _0x35bf20[_0x792d('0x1d')](_0x518a4c);})[_0x792d('0x1f')](function(_0x48a951){logger['error'](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x40'),util[_0x792d('0x3f')](_0x48a951,{'showHidden':![],'depth':null}));});}else{logger[_0x792d('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x792d('0x2f'),'connectel','Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x4069f3[_0x792d('0x32')]&&_0x4069f3['password']){var _0x33526d={'messages':[{'source':'xCALLY\x20Motion','to':_0x4fb7cb['phone'],'body':_0x4fb7cb[_0x792d('0x10')],'from':_0x4069f3[_0x792d('0x41')]||_0x4069f3[_0x792d('0x27')]}]};var _0x490d0e=util[_0x792d('0x44')](_0x792d('0x45'),_0x4069f3[_0x792d('0x32')],_0x4069f3[_0x792d('0x33')]);var _0x1cef60={'method':_0x792d('0x42'),'uri':_0x792d('0x46'),'body':_0x33526d,'headers':{'Authorization':util[_0x792d('0x44')](_0x792d('0x47'),new Buffer(_0x490d0e)['toString'](_0x792d('0x48')))},'json':!![]};rp(_0x1cef60)['then'](function(_0x19ea13){if(_0x19ea13[_0x792d('0x49')]>=0xc8&&_0x19ea13['http_code']<=0xce){if(_0x19ea13[_0x792d('0x4a')]&&_0x19ea13[_0x792d('0x4a')]['queued_count']>0x0){var _0x8c156c=_['head'](_0x19ea13[_0x792d('0x4a')][_0x792d('0x28')]);var _0x2d6579={'messageId':_0x8c156c[_0x792d('0x4b')]};if(!_0x4069f3[_0x792d('0x3c')]){_0x2d6579['read']=!![];}return _0x35bf20[_0x792d('0x1d')](_0x2d6579);}else{logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x4c'),util[_0x792d('0x3f')](_0x19ea13,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x4c'),util['inspect'](_0x19ea13,{'showHidden':![],'depth':null}));}})['catch'](function(_0x3267e5){logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x4c'),util[_0x792d('0x3f')](_0x3267e5,{'showHidden':![],'depth':null}));});}else{logger[_0x792d('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x792d('0x4c'),_0x792d('0x4d'));}break;case _0x792d('0x4e'):if(_0x4069f3['authId']&&_0x4069f3[_0x792d('0x26')]){var _0x33526d={'dst':_0x4fb7cb[_0x792d('0x27')],'text':_0x4fb7cb[_0x792d('0x10')],'src':_0x4069f3['senderString']||_0x4069f3[_0x792d('0x27')],'url':_0x4069f3['remote']+_0x792d('0x2b')+_0x4fb7cb['id']+'/status?token='+_0x4069f3[_0x792d('0x2d')]};var _0x490d0e=util['format'](_0x792d('0x45'),_0x4069f3['authId'],_0x4069f3[_0x792d('0x26')]);var _0x1cef60={'method':_0x792d('0x42'),'uri':util['format'](_0x792d('0x4f'),_0x4069f3['authId']),'body':_0x33526d,'headers':{'Authorization':util[_0x792d('0x44')](_0x792d('0x47'),new Buffer(_0x490d0e)[_0x792d('0x50')](_0x792d('0x48')))},'json':!![]};rp(_0x1cef60)['then'](function(_0x368c16){var _0x399e61={'messageId':_0x368c16['message_uuid'][0x0]};return _0x35bf20['update'](_0x399e61);})[_0x792d('0x1f')](function(_0x1007e5){logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),'plivo',util['inspect'](_0x1007e5,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x4e'),_0x792d('0x51'));}break;case _0x792d('0x52'):if(_0x4069f3['username']&&_0x4069f3['password']){if(_0x4069f3[_0x792d('0x53')]){var _0x3ec7aa={'method':_0x792d('0x42'),'uri':_0x4069f3[_0x792d('0x53')]+'/auth/1/session','body':{'username':_0x4069f3['username'],'password':_0x4069f3[_0x792d('0x33')]},'json':!![]};return rp(_0x3ec7aa)[_0x792d('0x1c')](function(_0x1391d1){var _0x8786e9={'method':_0x792d('0x42'),'uri':_0x4069f3[_0x792d('0x53')]+_0x792d('0x54'),'body':{'messages':[{'from':_0x4069f3[_0x792d('0x27')],'destinations':[{'to':_0x4fb7cb[_0x792d('0x27')]}],'text':_0x4fb7cb[_0x792d('0x10')],'notifyUrl':_0x4069f3['remote']+_0x792d('0x2b')+_0x4fb7cb['id']+_0x792d('0x2c')+_0x4069f3[_0x792d('0x2d')],'notifyContentType':_0x792d('0x55'),'callbackData':_0x4069f3['phone']+';'+_0x4fb7cb[_0x792d('0x10')]}]},'headers':{'Authorization':_0x792d('0x56')+_0x1391d1[_0x792d('0x2d')]},'json':!![]};return rp(_0x8786e9)[_0x792d('0x1c')](function(_0x1c121e){if(_0x1c121e[_0x792d('0x28')]){var _0x1f9fcb={'messageId':_0x1c121e[_0x792d('0x28')][0x0][_0x792d('0xe')]};if(!_0x4069f3[_0x792d('0x3c')]){_0x1f9fcb[_0x792d('0x3d')]=!![];}return _0x35bf20[_0x792d('0x1d')](_0x1f9fcb);}else{return logger['error'](_0x792d('0x3e'),_0x792d('0x2f'),'infobip',util[_0x792d('0x3f')](_0x1c121e,{'showHidden':![],'depth':null}));}});})[_0x792d('0x1f')](function(_0x4e378d){return logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x52'),util[_0x792d('0x3f')](_0x4e378d,{'showHidden':![],'depth':null}));});}else{logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x52'),_0x792d('0x57'));}}else{logger[_0x792d('0x20')](_0x792d('0x3e'),'afterCreate',_0x792d('0x52'),_0x792d('0x4d'));}break;case _0x792d('0x58'):var _0x192b4b=require(_0x792d('0x59'));if(_0x4069f3['apiKey']){var _0x5198ea={};_0x5198ea[_0x792d('0x5a')]=_0x4069f3['username'];_0x5198ea[_0x792d('0x27')]=_0x4fb7cb[_0x792d('0x27')];_0x5198ea[_0x792d('0x35')]=_0x4069f3[_0x792d('0x27')];_0x5198ea['text']=_0x4fb7cb[_0x792d('0x10')];_0x5198ea[_0x792d('0x5b')]=+new Date();var _0x1192be='';var _0x1948f8='';var _0x3e87bb=Object['keys'](_0x5198ea);_0x3e87bb[_0x792d('0x5c')]();for(var _0x5dcb08=0x0;_0x5dcb08<_0x3e87bb[_0x792d('0x5d')];_0x5dcb08++){if(_0x1192be!=''){_0x1192be+='&';}_0x1192be+=_0x3e87bb[_0x5dcb08]+'='+encodeURIComponent(_0x5198ea[_0x3e87bb[_0x5dcb08]]);_0x1948f8+=_0x5198ea[_0x3e87bb[_0x5dcb08]];}_0x1948f8+=_0x4069f3[_0x792d('0x5e')];_0x1948f8=_0x192b4b['createHash']('md5')[_0x792d('0x1d')](_0x1948f8)[_0x792d('0x5f')]('hex');if(_0x1192be!==''){_0x1192be+='&';}_0x1192be+=_0x792d('0x60')+_0x1948f8;var _0xa509de={'method':_0x792d('0x36'),'uri':_0x4069f3['baseUrl']+_0x792d('0x61')+_0x1192be,'json':!![]};return rp(_0xa509de)[_0x792d('0x1c')](function(_0x141ee8){var _0x1cac4a=Object[_0x792d('0x62')](_0x141ee8);if(_0x141ee8[_0x1cac4a[0x0]][_0x792d('0x20')]&&parseInt(_0x141ee8[_0x1cac4a[0x0]][_0x792d('0x20')])===0x0){var _0xc84135={'messageId':_0x141ee8[_0x1cac4a[0x0]]['id_sms']};if(!_0x4069f3[_0x792d('0x3c')]){_0xc84135[_0x792d('0x3d')]=!![];}return _0x35bf20[_0x792d('0x1d')](_0xc84135);}else{return logger[_0x792d('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x792d('0x58'),util['inspect'](_0x141ee8[_0x792d('0x20')],{'showHidden':![],'depth':null}));}})[_0x792d('0x1f')](function(_0x2e3234){return logger['error'](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x58'),util[_0x792d('0x3f')](_0x2e3234,{'showHidden':![],'depth':null}));});}else{logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x58'),'Missing\x20parameters:\x20apiKey');}break;case _0x792d('0x63'):if(_0x4069f3[_0x792d('0x5e')]){var _0x139d8e={'method':'POST','uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x4069f3['apiKey']},'body':{'content':_0x4fb7cb[_0x792d('0x10')],'to':[_0x4fb7cb[_0x792d('0x27')]],'from':_0x4069f3[_0x792d('0x27')],'binary':![],'clientMessageId':_0x792d('0x64'),'charset':_0x792d('0x65')},'json':!![]};rp(_0x139d8e)[_0x792d('0x1c')](function(_0x15ea77){if(!_0x15ea77[_0x792d('0x20')]){var _0xd11a3a={'messageId':_0x15ea77['messages'][0x0][_0x792d('0x66')]};if(!_0x4069f3[_0x792d('0x3c')]){_0xd11a3a[_0x792d('0x3d')]=!![];}return _0x35bf20[_0x792d('0x1d')](_0xd11a3a);}else{return logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x63'),util[_0x792d('0x3f')](_0x15ea77[_0x792d('0x20')],{'showHidden':![],'depth':null}));}})[_0x792d('0x1f')](function(_0x15d594){return logger[_0x792d('0x20')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x792d('0x2f'),_0x792d('0x63'),util[_0x792d('0x3f')](_0x15d594,{'showHidden':![],'depth':null}));});}else{logger[_0x792d('0x20')](_0x792d('0x3e'),'afterCreate','clickatell','Missing\x20parameters:\x20apiKey');}break;case _0x792d('0x67'):if(_0x4069f3[_0x792d('0x32')]&&_0x4069f3[_0x792d('0x33')]){var _0x490d0e=util[_0x792d('0x44')](_0x792d('0x45'),_0x4069f3[_0x792d('0x32')],_0x4069f3[_0x792d('0x33')]);var _0x1cef60={'method':_0x792d('0x42'),'uri':_0x792d('0x68')+_0x4069f3[_0x792d('0x69')]+_0x792d('0x6a'),'body':{'to':[_0x4fb7cb[_0x792d('0x27')]],'text':_0x4fb7cb[_0x792d('0x10')],'from':_0x4069f3['phone'],'applicationId':_0x4069f3[_0x792d('0x6b')]},'headers':{'Authorization':util[_0x792d('0x44')]('Basic\x20%s',new Buffer(_0x490d0e)['toString']('base64'))},'json':!![]};rp(_0x1cef60)[_0x792d('0x1c')](function(_0x54f14a){if(_0x54f14a['id']){var _0x538353={'messageId':_0x54f14a['id']};return _0x35bf20[_0x792d('0x1d')](_0x538353);}else{logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x67'),util[_0x792d('0x3f')](_0x54f14a,{'showHidden':![],'depth':null}));}})[_0x792d('0x1f')](function(_0x58c10d){logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x67'),util['inspect'](_0x58c10d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x792d('0x3e'),'afterCreate',_0x792d('0x67'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x792d('0x6c'):if(_0x4069f3[_0x792d('0x5e')]){var _0x585ff4={};var _0xa509de={'method':_0x792d('0x42'),'uri':_0x792d('0x6d'),'headers':{'Authorization':_0x792d('0x6e')+_0x4069f3['apiKey'],'Content-Type':_0x792d('0x55')},'body':{'from':_0x4069f3[_0x792d('0x27')],'to':_0x4fb7cb[_0x792d('0x27')],'text':_0x4fb7cb['body']},'json':!![]};return rp(_0xa509de)['then'](function(_0x102ad2){if(_0x102ad2[_0x792d('0x6f')]==0xca){_0x585ff4[_0x792d('0x70')]=_0x102ad2;var _0x3bc10d={'method':'POST','uri':_0x792d('0x71'),'headers':{'Authorization':_0x792d('0x6e')+_0x4069f3[_0x792d('0x5e')],'Content-Type':_0x792d('0x55')},'body':{'refid':_0x585ff4[_0x792d('0x70')][_0x792d('0x72')]},'json':!![]};return rp(_0x3bc10d)[_0x792d('0x1c')](function(_0x4564c2){_0x585ff4[_0x792d('0x73')]=_0x4564c2;var _0x1958b0={'messageId':_0x585ff4[_0x792d('0x70')][_0x792d('0x72')],'read':!![]};return _0x35bf20[_0x792d('0x1d')](_0x1958b0);});}else{return logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x6c'),util[_0x792d('0x3f')](_0x102ad2,{'showHidden':![],'depth':null}));}})[_0x792d('0x1f')](function(_0x63af22){return logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x6c'),util[_0x792d('0x3f')](_0x63af22,{'showHidden':![],'depth':null}));});}else{return logger[_0x792d('0x20')](_0x792d('0x3e'),_0x792d('0x2f'),_0x792d('0x6c'),_0x792d('0x74'));}break;}}})[_0x792d('0x75')](function(){_0xf33083();});}else{_0xf33083();}}},'charset':_0x792d('0x76'),'collate':_0x792d('0x77')});};
\ No newline at end of file
index c41d908..fe02073 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd179=['jayson/promise','client','http','defaults','redis','localhost','./smsMessage.socket','register','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','SmsMessage','body','options','raw','then','CreateSmsMessage','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x509c71,_0x15734b){var _0x32e44c=function(_0x10e513){while(--_0x10e513){_0x509c71['push'](_0x509c71['shift']());}};_0x32e44c(++_0x15734b);}(_0xd179,0x132));var _0x9d17=function(_0x158f01,_0x12af3e){_0x158f01=_0x158f01-0x0;var _0x5ef74e=_0xd179[_0x158f01];return _0x5ef74e;};'use strict';var _=require(_0x9d17('0x0'));var util=require(_0x9d17('0x1'));var moment=require('moment');var BPromise=require(_0x9d17('0x2'));var rs=require(_0x9d17('0x3'));var fs=require('fs');var Redis=require(_0x9d17('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9d17('0x5'));var logger=require(_0x9d17('0x6'))(_0x9d17('0x7'));var config=require(_0x9d17('0x8'));var jayson=require(_0x9d17('0x9'));var client=jayson[_0x9d17('0xa')][_0x9d17('0xb')]({'port':0x232a});config['redis']=_[_0x9d17('0xc')](config[_0x9d17('0xd')],{'host':_0x9d17('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9d17('0xf'))[_0x9d17('0x10')](socket);function respondWithRpcPromise(_0x41c788,_0x4d2fd3,_0x3b79b9){return new BPromise(function(_0x41a5ad,_0x258dac){return client[_0x9d17('0x11')](_0x41c788,_0x3b79b9)['then'](function(_0x444164){logger[_0x9d17('0x12')](_0x9d17('0x13'),_0x4d2fd3,_0x9d17('0x14'));logger[_0x9d17('0x15')](_0x9d17('0x16'),_0x4d2fd3,_0x9d17('0x14'),JSON[_0x9d17('0x17')](_0x444164));if(_0x444164[_0x9d17('0x18')]){if(_0x444164[_0x9d17('0x18')][_0x9d17('0x19')]===0x1f4){logger[_0x9d17('0x18')]('SmsMessage,\x20%s,\x20%s',_0x4d2fd3,_0x444164[_0x9d17('0x18')][_0x9d17('0x1a')]);return _0x258dac(_0x444164[_0x9d17('0x18')][_0x9d17('0x1a')]);}logger[_0x9d17('0x18')](_0x9d17('0x13'),_0x4d2fd3,_0x444164[_0x9d17('0x18')][_0x9d17('0x1a')]);return _0x41a5ad(_0x444164[_0x9d17('0x18')][_0x9d17('0x1a')]);}else{logger['info'](_0x9d17('0x13'),_0x4d2fd3,'request\x20sent');_0x41a5ad(_0x444164[_0x9d17('0x1b')]['message']);}})[_0x9d17('0x1c')](function(_0x50f687){logger[_0x9d17('0x18')](_0x9d17('0x13'),_0x4d2fd3,_0x50f687);_0x258dac(_0x50f687);});});}exports['CreateSmsMessage']=function(_0xbf331d){var _0x40dca3=this;return new Promise(function(_0x3b7c2f,_0x5599fe){return db[_0x9d17('0x1d')]['create'](_0xbf331d[_0x9d17('0x1e')],{'raw':_0xbf331d[_0x9d17('0x1f')]?_0xbf331d[_0x9d17('0x1f')][_0x9d17('0x20')]===undefined?!![]:![]:!![]})[_0x9d17('0x21')](function(_0x163f99){logger[_0x9d17('0x12')](_0x9d17('0x22'),_0xbf331d);logger[_0x9d17('0x15')]('CreateSmsMessage',_0xbf331d,JSON[_0x9d17('0x17')](_0x163f99));_0x3b7c2f(_0x163f99);})[_0x9d17('0x1c')](function(_0x1ad328){logger[_0x9d17('0x18')](_0x9d17('0x22'),_0x1ad328[_0x9d17('0x1a')],_0xbf331d);_0x5599fe(_0x40dca3[_0x9d17('0x18')](0x1f4,_0x1ad328[_0x9d17('0x1a')]));});});};
\ No newline at end of file
+var _0x2e7e=['error','message','result','SmsMessage','create','body','options','raw','then','CreateSmsMessage','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','./smsMessage.socket','request','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x2e7e,0x65));var _0xe2e7=function(_0x3d2994,_0x10a066){_0x3d2994=_0x3d2994-0x0;var _0xe3bbf6=_0x2e7e[_0x3d2994];return _0xe3bbf6;};'use strict';var _=require(_0xe2e7('0x0'));var util=require('util');var moment=require(_0xe2e7('0x1'));var BPromise=require('bluebird');var rs=require(_0xe2e7('0x2'));var fs=require('fs');var Redis=require(_0xe2e7('0x3'));var db=require(_0xe2e7('0x4'))['db'];var utils=require(_0xe2e7('0x5'));var logger=require(_0xe2e7('0x6'))(_0xe2e7('0x7'));var config=require('../../config/environment');var jayson=require(_0xe2e7('0x8'));var client=jayson[_0xe2e7('0x9')][_0xe2e7('0xa')]({'port':0x232a});config[_0xe2e7('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe2e7('0xc'))['register'](socket);function respondWithRpcPromise(_0x40eeb8,_0x164267,_0x2a3b75){return new BPromise(function(_0x2122f9,_0x1566cb){return client[_0xe2e7('0xd')](_0x40eeb8,_0x2a3b75)['then'](function(_0x55eda2){logger[_0xe2e7('0xe')](_0xe2e7('0xf'),_0x164267,'request\x20sent');logger[_0xe2e7('0x10')](_0xe2e7('0x11'),_0x164267,'request\x20sent',JSON[_0xe2e7('0x12')](_0x55eda2));if(_0x55eda2[_0xe2e7('0x13')]){if(_0x55eda2[_0xe2e7('0x13')]['code']===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x164267,_0x55eda2[_0xe2e7('0x13')][_0xe2e7('0x14')]);return _0x1566cb(_0x55eda2['error'][_0xe2e7('0x14')]);}logger[_0xe2e7('0x13')](_0xe2e7('0xf'),_0x164267,_0x55eda2[_0xe2e7('0x13')][_0xe2e7('0x14')]);return _0x2122f9(_0x55eda2['error'][_0xe2e7('0x14')]);}else{logger['info'](_0xe2e7('0xf'),_0x164267,'request\x20sent');_0x2122f9(_0x55eda2[_0xe2e7('0x15')][_0xe2e7('0x14')]);}})['catch'](function(_0x1eac89){logger['error']('SmsMessage,\x20%s,\x20%s',_0x164267,_0x1eac89);_0x1566cb(_0x1eac89);});});}exports['CreateSmsMessage']=function(_0x2578e5){var _0x3e5399=this;return new Promise(function(_0x3b5935,_0x461222){return db[_0xe2e7('0x16')][_0xe2e7('0x17')](_0x2578e5[_0xe2e7('0x18')],{'raw':_0x2578e5[_0xe2e7('0x19')]?_0x2578e5[_0xe2e7('0x19')][_0xe2e7('0x1a')]===undefined?!![]:![]:!![]})[_0xe2e7('0x1b')](function(_0x5b2bb6){logger['info']('CreateSmsMessage',_0x2578e5);logger[_0xe2e7('0x10')](_0xe2e7('0x1c'),_0x2578e5,JSON[_0xe2e7('0x12')](_0x5b2bb6));_0x3b5935(_0x5b2bb6);})[_0xe2e7('0x1d')](function(_0x47b40c){logger[_0xe2e7('0x13')](_0xe2e7('0x1c'),_0x47b40c[_0xe2e7('0x14')],_0x2578e5);_0x461222(_0x3e5399[_0xe2e7('0x13')](0x1f4,_0x47b40c[_0xe2e7('0x14')]));});});};
\ No newline at end of file
index 37aedfa..c0bd1e9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed40=['length','smsMessage:','remove','update','emit','removeListener'];(function(_0x19f040,_0x4b2d63){var _0x3ea60d=function(_0x1e093d){while(--_0x1e093d){_0x19f040['push'](_0x19f040['shift']());}};_0x3ea60d(++_0x4b2d63);}(_0xed40,0xec));var _0x0ed4=function(_0x41be5a,_0x2fa5a3){_0x41be5a=_0x41be5a-0x0;var _0x7eb7b=_0xed40[_0x41be5a];return _0x7eb7b;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=['save',_0x0ed4('0x0'),_0x0ed4('0x1')];function createListener(_0x512178,_0x1523a8){return function(_0x26830c){_0x1523a8[_0x0ed4('0x2')](_0x512178,_0x26830c);};}function removeListener(_0xab7c4,_0x4ac282){return function(){SmsMessageEvents[_0x0ed4('0x3')](_0xab7c4,_0x4ac282);};}exports['register']=function(_0x559a63){for(var _0x4ce8f6=0x0,_0x306399=events[_0x0ed4('0x4')];_0x4ce8f6<_0x306399;_0x4ce8f6++){var _0x5a05c1=events[_0x4ce8f6];var _0x28a789=createListener(_0x0ed4('0x5')+_0x5a05c1,_0x559a63);SmsMessageEvents['on'](_0x5a05c1,_0x28a789);}};
\ No newline at end of file
+var _0x27f8=['length','smsMessage:','./smsMessage.events','save','remove','emit','removeListener','register'];(function(_0xb65e77,_0x238c3d){var _0x38134b=function(_0x39da21){while(--_0x39da21){_0xb65e77['push'](_0xb65e77['shift']());}};_0x38134b(++_0x238c3d);}(_0x27f8,0xa2));var _0x827f=function(_0x461c9e,_0x9a67cd){_0x461c9e=_0x461c9e-0x0;var _0x144e35=_0x27f8[_0x461c9e];return _0x144e35;};'use strict';var SmsMessageEvents=require(_0x827f('0x0'));var events=[_0x827f('0x1'),_0x827f('0x2'),'update'];function createListener(_0x50b1f7,_0x5f4349){return function(_0x29f85c){_0x5f4349[_0x827f('0x3')](_0x50b1f7,_0x29f85c);};}function removeListener(_0x2b08f9,_0x54c1ff){return function(){SmsMessageEvents[_0x827f('0x4')](_0x2b08f9,_0x54c1ff);};}exports[_0x827f('0x5')]=function(_0x5dbf92){for(var _0x202769=0x0,_0x3cd43f=events[_0x827f('0x6')];_0x202769<_0x3cd43f;_0x202769++){var _0x44266e=events[_0x202769];var _0x1133a3=createListener(_0x827f('0x7')+_0x44266e,_0x5dbf92);SmsMessageEvents['on'](_0x44266e,_0x1133a3);}};
\ No newline at end of file
index 8590657..ffeb13f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf95a=['isAuthenticated','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','post','/:id/teams','addAgents','put','delete','removeTeams','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x5cb1e1,_0x16a838){var _0x32947a=function(_0x149fcb){while(--_0x149fcb){_0x5cb1e1['push'](_0x5cb1e1['shift']());}};_0x32947a(++_0x16a838);}(_0xf95a,0x1ca));var _0xaf95=function(_0xfaeca1,_0x250140){_0xfaeca1=_0xfaeca1-0x0;var _0x587458=_0xf95a[_0xfaeca1];return _0x587458;};'use strict';var multer=require(_0xaf95('0x0'));var util=require('util');var path=require(_0xaf95('0x1'));var timeout=require(_0xaf95('0x2'));var express=require(_0xaf95('0x3'));var router=express[_0xaf95('0x4')]();var fs_extra=require(_0xaf95('0x5'));var auth=require(_0xaf95('0x6'));var interaction=require(_0xaf95('0x7'));var config=require(_0xaf95('0x8'));var controller=require('./smsQueue.controller');router[_0xaf95('0x9')]('/',auth[_0xaf95('0xa')](),controller['index']);router['get'](_0xaf95('0xb'),auth[_0xaf95('0xa')](),controller[_0xaf95('0xc')]);router['get'](_0xaf95('0xd'),auth[_0xaf95('0xa')](),controller[_0xaf95('0xe')]);router[_0xaf95('0x9')](_0xaf95('0xf'),auth['isAuthenticated'](),controller[_0xaf95('0x10')]);router[_0xaf95('0x9')]('/:id/teams',auth[_0xaf95('0xa')](),controller[_0xaf95('0x11')]);router['get'](_0xaf95('0x12'),auth[_0xaf95('0xa')](),controller['getAgents']);router[_0xaf95('0x13')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xaf95('0x14'),auth[_0xaf95('0xa')](),controller['addTeams']);router[_0xaf95('0x13')](_0xaf95('0x12'),auth[_0xaf95('0xa')](),controller[_0xaf95('0x15')]);router[_0xaf95('0x16')](_0xaf95('0xd'),auth[_0xaf95('0xa')](),controller['update']);router[_0xaf95('0x17')](_0xaf95('0xd'),auth[_0xaf95('0xa')](),controller['destroy']);router[_0xaf95('0x17')](_0xaf95('0x14'),auth['isAuthenticated'](),controller[_0xaf95('0x18')]);router['delete'](_0xaf95('0x12'),auth[_0xaf95('0xa')](),controller['removeAgents']);module[_0xaf95('0x19')]=router;
\ No newline at end of file
+var _0x38f4=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','create','post','addTeams','/:id/users','addAgents','put','update','destroy','delete','removeTeams','removeAgents','exports','multer'];(function(_0x51251a,_0x2bebf2){var _0x5d9d37=function(_0x353793){while(--_0x353793){_0x51251a['push'](_0x51251a['shift']());}};_0x5d9d37(++_0x2bebf2);}(_0x38f4,0x192));var _0x438f=function(_0x1a5ad1,_0x357407){_0x1a5ad1=_0x1a5ad1-0x0;var _0x7b8b22=_0x38f4[_0x1a5ad1];return _0x7b8b22;};'use strict';var multer=require(_0x438f('0x0'));var util=require(_0x438f('0x1'));var path=require('path');var timeout=require(_0x438f('0x2'));var express=require(_0x438f('0x3'));var router=express[_0x438f('0x4')]();var fs_extra=require(_0x438f('0x5'));var auth=require(_0x438f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x438f('0x7'));var controller=require('./smsQueue.controller');router['get']('/',auth[_0x438f('0x8')](),controller[_0x438f('0x9')]);router[_0x438f('0xa')](_0x438f('0xb'),auth[_0x438f('0x8')](),controller[_0x438f('0xc')]);router[_0x438f('0xa')](_0x438f('0xd'),auth[_0x438f('0x8')](),controller[_0x438f('0xe')]);router[_0x438f('0xa')](_0x438f('0xf'),auth[_0x438f('0x8')](),controller[_0x438f('0x10')]);router[_0x438f('0xa')](_0x438f('0x11'),auth[_0x438f('0x8')](),controller[_0x438f('0x12')]);router[_0x438f('0xa')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth[_0x438f('0x8')](),controller[_0x438f('0x13')]);router[_0x438f('0x14')](_0x438f('0x11'),auth[_0x438f('0x8')](),controller[_0x438f('0x15')]);router['post'](_0x438f('0x16'),auth[_0x438f('0x8')](),controller[_0x438f('0x17')]);router[_0x438f('0x18')](_0x438f('0xd'),auth[_0x438f('0x8')](),controller[_0x438f('0x19')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x438f('0x1a')]);router[_0x438f('0x1b')]('/:id/teams',auth[_0x438f('0x8')](),controller[_0x438f('0x1c')]);router[_0x438f('0x1b')](_0x438f('0x16'),auth[_0x438f('0x8')](),controller[_0x438f('0x1d')]);module[_0x438f('0x1e')]=router;
\ No newline at end of file
index 5c4e3a5..6873016 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb198=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x6a3f00,_0x334350){var _0x5a5f5e=function(_0xedceb1){while(--_0xedceb1){_0x6a3f00['push'](_0x6a3f00['shift']());}};_0x5a5f5e(++_0x334350);}(_0xb198,0x141));var _0x8b19=function(_0x44c4dc,_0x3cf883){_0x44c4dc=_0x44c4dc-0x0;var _0x18ccc3=_0xb198[_0x44c4dc];return _0x18ccc3;};'use strict';var Sequelize=require(_0x8b19('0x0'));module[_0x8b19('0x1')]={'name':{'type':Sequelize[_0x8b19('0x2')],'unique':_0x8b19('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8b19('0x2')]},'timeout':{'type':Sequelize[_0x8b19('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8b19('0x5')](_0x8b19('0x6'),_0x8b19('0x7'),_0x8b19('0x8'))}};
\ No newline at end of file
+var _0x9b8b=['name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING'];(function(_0x9378f1,_0x58e12d){var _0x34458f=function(_0x25920d){while(--_0x25920d){_0x9378f1['push'](_0x9378f1['shift']());}};_0x34458f(++_0x58e12d);}(_0x9b8b,0x7b));var _0xb9b8=function(_0x238ee7,_0x29f9c2){_0x238ee7=_0x238ee7-0x0;var _0x35f5ea=_0x9b8b[_0x238ee7];return _0x35f5ea;};'use strict';var Sequelize=require(_0xb9b8('0x0'));module[_0xb9b8('0x1')]={'name':{'type':Sequelize[_0xb9b8('0x2')],'unique':_0xb9b8('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb9b8('0x2')]},'timeout':{'type':Sequelize[_0xb9b8('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb9b8('0x5')](_0xb9b8('0x6'),_0xb9b8('0x7'),_0xb9b8('0x8'))}};
\ No newline at end of file
index 01c3211..457cd24 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x594e=['forEach','emit','userSmsQueue:save','removeTeams','select','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?','SELECT','TeamId','all','union','compact','value','userSmsQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','then','get','SmsQueues','UserProfileResource','destroy','send','index','map','SmsQueue','rawAttributes','fieldName','type','name','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','includeAll','findAll','rows','catch','show','params','length','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','describe','findOne','SmsQueueId','UserSmsQueue','User','findAndCountAll','UserId','createdAt','format','%s/%s','SIP','smsPause','updatedAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each'];(function(_0x3d0c12,_0x2304fb){var _0x16d3d8=function(_0x3974ed){while(--_0x3974ed){_0x3d0c12['push'](_0x3d0c12['shift']());}};_0x16d3d8(++_0x2304fb);}(_0x594e,0x11e));var _0xe594=function(_0x11c5ef,_0x1e2cb7){_0x11c5ef=_0x11c5ef-0x0;var _0x3a334c=_0x594e[_0x11c5ef];return _0x3a334c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe594('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe594('0x1'));var moment=require('moment');var BPromise=require(_0xe594('0x2'));var Mustache=require(_0xe594('0x3'));var util=require(_0xe594('0x4'));var path=require(_0xe594('0x5'));var sox=require('sox');var csv=require(_0xe594('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe594('0x7'));var squel=require(_0xe594('0x8'));var crypto=require('crypto');var jsforce=require(_0xe594('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xe594('0x6'));var querystring=require('querystring');var Papa=require(_0xe594('0xa'));var Redis=require(_0xe594('0xb'));var authService=require('../../components/auth/service');var qs=require(_0xe594('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe594('0xd'));var logger=require('../../config/logger')(_0xe594('0xe'));var utils=require(_0xe594('0xf'));var config=require(_0xe594('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0xe594('0x11'))['db'];config[_0xe594('0x12')]=_[_0xe594('0x13')](config[_0xe594('0x12')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe594('0x12')]));require('./smsQueue.socket')['register'](socket);function respondWithStatusCode(_0x39dbd8,_0x48c28a){_0x48c28a=_0x48c28a||0xcc;return function(_0x1d6694){if(_0x1d6694){return _0x39dbd8[_0xe594('0x14')](_0x48c28a);}return _0x39dbd8[_0xe594('0x15')](_0x48c28a)[_0xe594('0x16')]();};}function respondWithResult(_0x2d66b4,_0x348d10){_0x348d10=_0x348d10||0xc8;return function(_0x3b1519){if(_0x3b1519){return _0x2d66b4['status'](_0x348d10)[_0xe594('0x17')](_0x3b1519);}};}function respondWithFilteredResult(_0x2d8f66,_0xd29778){return function(_0x21fd14){if(_0x21fd14){var _0x298ce4=typeof _0xd29778[_0xe594('0x18')]===_0xe594('0x19')&&typeof _0xd29778[_0xe594('0x1a')]==='undefined';var _0x4be8a1=_0x21fd14[_0xe594('0x1b')];var _0x788a9e=_0x298ce4?0x0:_0xd29778[_0xe594('0x18')];var _0x2ab6e8=_0x298ce4?_0x21fd14['count']:_0xd29778['offset']+_0xd29778[_0xe594('0x1a')];var _0x975349;if(_0x2ab6e8>=_0x4be8a1){_0x2ab6e8=_0x4be8a1;_0x975349=0xc8;}else{_0x975349=0xce;}_0x2d8f66[_0xe594('0x15')](_0x975349);return _0x2d8f66['set'](_0xe594('0x1c'),_0x788a9e+'-'+_0x2ab6e8+'/'+_0x4be8a1)[_0xe594('0x17')](_0x21fd14);}return null;};}function patchUpdates(_0x27f3e0){return function(_0x3cb664){try{jsonpatch['apply'](_0x3cb664,_0x27f3e0,!![]);}catch(_0x170b22){return BPromise['reject'](_0x170b22);}return _0x3cb664[_0xe594('0x1d')]();};}function saveUpdates(_0x3c5537,_0x44b902){return function(_0x492d50){if(_0x492d50){return _0x492d50['update'](_0x3c5537)['then'](function(_0x3b4bc6){return _0x3b4bc6;});}return null;};}function removeEntity(_0x2ef1a7,_0xfcf22d){return function(_0x24b9f3){if(_0x24b9f3){return _0x24b9f3['destroy']()[_0xe594('0x1e')](function(){var _0x518be5=_0x24b9f3[_0xe594('0x1f')]({'plain':!![]});var _0x22d844=_0xe594('0x20');return db[_0xe594('0x21')][_0xe594('0x22')]({'where':{'type':_0x22d844,'resourceId':_0x518be5['id']}})['then'](function(){return _0x24b9f3;});})['then'](function(){_0x2ef1a7[_0xe594('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x862cbe,_0x472b21){return function(_0x1452f4){if(!_0x1452f4){_0x862cbe[_0xe594('0x14')](0x194);}return _0x1452f4;};}function handleError(_0x3971ac,_0x27a2b8){_0x27a2b8=_0x27a2b8||0x1f4;return function(_0x117c94){logger['error'](_0x117c94['stack']);if(_0x117c94['name']){delete _0x117c94['name'];}_0x3971ac[_0xe594('0x15')](_0x27a2b8)[_0xe594('0x23')](_0x117c94);};}exports[_0xe594('0x24')]=function(_0x6765c8,_0xc146f4){var _0x5c2b7c={},_0x41f953={},_0x18ddca={'count':0x0,'rows':[]};var _0xd61b05=_[_0xe594('0x25')](db[_0xe594('0x26')][_0xe594('0x27')],function(_0x42e2fa){return{'name':_0x42e2fa[_0xe594('0x28')],'type':_0x42e2fa[_0xe594('0x29')]['key']};});_0x41f953['model']=_[_0xe594('0x25')](_0xd61b05,_0xe594('0x2a'));_0x41f953[_0xe594('0x2b')]=_[_0xe594('0x2c')](_0x6765c8[_0xe594('0x2b')]);_0x41f953['filters']=_[_0xe594('0x2d')](_0x41f953[_0xe594('0x2e')],_0x41f953['query']);_0x5c2b7c[_0xe594('0x2f')]=_[_0xe594('0x2d')](_0x41f953['model'],qs[_0xe594('0x30')](_0x6765c8['query'][_0xe594('0x30')]));_0x5c2b7c[_0xe594('0x2f')]=_0x5c2b7c[_0xe594('0x2f')]['length']?_0x5c2b7c['attributes']:_0x41f953[_0xe594('0x2e')];if(!_0x6765c8['query'][_0xe594('0x31')](_0xe594('0x32'))){_0x5c2b7c[_0xe594('0x1a')]=qs[_0xe594('0x1a')](_0x6765c8['query']['limit']);_0x5c2b7c[_0xe594('0x18')]=qs['offset'](_0x6765c8[_0xe594('0x2b')][_0xe594('0x18')]);}_0x5c2b7c[_0xe594('0x33')]=qs[_0xe594('0x34')](_0x6765c8[_0xe594('0x2b')][_0xe594('0x34')]);_0x5c2b7c[_0xe594('0x35')]=qs[_0xe594('0x36')](_[_0xe594('0x37')](_0x6765c8['query'],_0x41f953[_0xe594('0x36')]),_0xd61b05);if(_0x6765c8[_0xe594('0x2b')][_0xe594('0x38')]){_0x5c2b7c['where']=_['merge'](_0x5c2b7c[_0xe594('0x35')],{'$or':_[_0xe594('0x25')](_0xd61b05,function(_0x51a313){if(_0x51a313[_0xe594('0x29')]!==_0xe594('0x39')){var _0x4272fd={};_0x4272fd[_0x51a313['name']]={'$like':'%'+_0x6765c8[_0xe594('0x2b')][_0xe594('0x38')]+'%'};return _0x4272fd;}})});}_0x5c2b7c=_['merge']({},_0x5c2b7c,_0x6765c8['options']);var _0x469186={'where':_0x5c2b7c['where']};return db[_0xe594('0x26')][_0xe594('0x1b')](_0x469186)[_0xe594('0x1e')](function(_0xd89499){_0x18ddca[_0xe594('0x1b')]=_0xd89499;if(_0x6765c8[_0xe594('0x2b')][_0xe594('0x3a')]){_0x5c2b7c['include']=[{'all':!![]}];}return db[_0xe594('0x26')][_0xe594('0x3b')](_0x5c2b7c);})[_0xe594('0x1e')](function(_0x2c432f){_0x18ddca[_0xe594('0x3c')]=_0x2c432f;return _0x18ddca;})[_0xe594('0x1e')](respondWithFilteredResult(_0xc146f4,_0x5c2b7c))[_0xe594('0x3d')](handleError(_0xc146f4,null));};exports[_0xe594('0x3e')]=function(_0xb684eb,_0xe866f){var _0x4285a1={'raw':!![],'where':{'id':_0xb684eb[_0xe594('0x3f')]['id']}},_0x3a51dc={};_0x3a51dc[_0xe594('0x2e')]=_[_0xe594('0x2c')](db['SmsQueue']['rawAttributes']);_0x3a51dc[_0xe594('0x2b')]=_[_0xe594('0x2c')](_0xb684eb[_0xe594('0x2b')]);_0x3a51dc['filters']=_[_0xe594('0x2d')](_0x3a51dc['model'],_0x3a51dc['query']);_0x4285a1['attributes']=_['intersection'](_0x3a51dc['model'],qs[_0xe594('0x30')](_0xb684eb[_0xe594('0x2b')]['fields']));_0x4285a1[_0xe594('0x2f')]=_0x4285a1[_0xe594('0x2f')][_0xe594('0x40')]?_0x4285a1[_0xe594('0x2f')]:_0x3a51dc[_0xe594('0x2e')];if(_0xb684eb[_0xe594('0x2b')]['includeAll']){_0x4285a1['include']=[{'all':!![]}];}_0x4285a1=_[_0xe594('0x41')]({},_0x4285a1,_0xb684eb[_0xe594('0x42')]);return db[_0xe594('0x26')][_0xe594('0x43')](_0x4285a1)[_0xe594('0x1e')](handleEntityNotFound(_0xe866f,null))[_0xe594('0x1e')](respondWithResult(_0xe866f,null))['catch'](handleError(_0xe866f,null));};exports[_0xe594('0x44')]=function(_0x537f96,_0x2c7610){return db['SmsQueue'][_0xe594('0x44')](_0x537f96[_0xe594('0x45')],{})[_0xe594('0x1e')](function(_0x4e1178){var _0x1b1044=_0x537f96[_0xe594('0x46')][_0xe594('0x1f')]({'plain':!![]});if(!_0x1b1044)throw new Error(_0xe594('0x47'));if(_0x1b1044[_0xe594('0x48')]===_0xe594('0x46')){var _0x3da005=_0x4e1178[_0xe594('0x1f')]({'plain':!![]});var _0x2e0c95='SmsQueues';return db[_0xe594('0x49')][_0xe594('0x43')]({'where':{'name':_0x2e0c95,'userProfileId':_0x1b1044[_0xe594('0x4a')]},'raw':!![]})[_0xe594('0x1e')](function(_0x81d74e){if(_0x81d74e&&_0x81d74e[_0xe594('0x4b')]===0x0){return db[_0xe594('0x21')]['create']({'name':_0x3da005[_0xe594('0x2a')],'resourceId':_0x3da005['id'],'type':_0x81d74e[_0xe594('0x2a')],'sectionId':_0x81d74e['id']},{})[_0xe594('0x1e')](function(){return _0x4e1178;});}else{return _0x4e1178;}})['catch'](function(_0x141c76){logger[_0xe594('0x4c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x141c76);throw _0x141c76;});}return _0x4e1178;})['then'](respondWithResult(_0x2c7610,0xc9))[_0xe594('0x3d')](handleError(_0x2c7610,null));};exports['update']=function(_0x1e52df,_0x5551f5){if(_0x1e52df[_0xe594('0x45')]['id']){delete _0x1e52df[_0xe594('0x45')]['id'];}return db['SmsQueue'][_0xe594('0x43')]({'where':{'id':_0x1e52df[_0xe594('0x3f')]['id']}})[_0xe594('0x1e')](handleEntityNotFound(_0x5551f5,null))[_0xe594('0x1e')](saveUpdates(_0x1e52df[_0xe594('0x45')],null))[_0xe594('0x1e')](respondWithResult(_0x5551f5,null))[_0xe594('0x3d')](handleError(_0x5551f5,null));};exports['destroy']=function(_0x369591,_0x3d01b5){return db[_0xe594('0x26')][_0xe594('0x43')]({'where':{'id':_0x369591['params']['id']}})[_0xe594('0x1e')](handleEntityNotFound(_0x3d01b5,null))[_0xe594('0x1e')](removeEntity(_0x3d01b5,null))[_0xe594('0x3d')](handleError(_0x3d01b5,null));};exports['describe']=function(_0x6179ee,_0x507897){return db[_0xe594('0x26')][_0xe594('0x4d')]()[_0xe594('0x1e')](respondWithResult(_0x507897,null))[_0xe594('0x3d')](handleError(_0x507897,null));};exports['getMembers']=function(_0xafd0a9,_0x37745d,_0x2e1228){var _0x4b800c={'raw':!![],'where':{}},_0x114b77={},_0x1b3066;return db[_0xe594('0x26')][_0xe594('0x4e')]({'where':{'id':_0xafd0a9[_0xe594('0x3f')]['id']}})[_0xe594('0x1e')](handleEntityNotFound(_0x37745d,null))['then'](function(_0x15ff7d){if(_0x15ff7d){_0x1b3066=_0x15ff7d[_0xe594('0x1f')]({'plain':!![]});_0x114b77['model']=_[_0xe594('0x2c')](db['UserSmsQueue'][_0xe594('0x27')]);_0x114b77['query']=_[_0xe594('0x2c')](_0xafd0a9[_0xe594('0x2b')]);_0x114b77[_0xe594('0x36')]=_['intersection'](_0x114b77['model'],_0x114b77[_0xe594('0x2b')]);_0x4b800c[_0xe594('0x2f')]=_[_0xe594('0x2d')](_0x114b77[_0xe594('0x2e')],qs[_0xe594('0x30')](_0xafd0a9[_0xe594('0x2b')]['fields']));_0x4b800c[_0xe594('0x2f')]=_0x4b800c[_0xe594('0x2f')][_0xe594('0x40')]?_0x4b800c['attributes']:_0x114b77[_0xe594('0x2e')];if(!_0xafd0a9[_0xe594('0x2b')][_0xe594('0x31')]('nolimit')){_0x4b800c[_0xe594('0x1a')]=qs[_0xe594('0x1a')](_0xafd0a9['query'][_0xe594('0x1a')]);_0x4b800c[_0xe594('0x18')]=qs['offset'](_0xafd0a9['query'][_0xe594('0x18')]);}_0x4b800c[_0xe594('0x33')]=qs[_0xe594('0x34')](_0xafd0a9[_0xe594('0x2b')][_0xe594('0x34')]);_0x4b800c[_0xe594('0x35')]=qs[_0xe594('0x36')](_['pick'](_0xafd0a9[_0xe594('0x2b')],_0x114b77['filters']));_0x4b800c[_0xe594('0x35')][_0xe594('0x4f')]=_0x15ff7d['id'];if(_0xafd0a9[_0xe594('0x2b')][_0xe594('0x38')]){_0x4b800c[_0xe594('0x35')]=_['merge'](_0x4b800c['where'],{'$or':_['map'](_0x4b800c[_0xe594('0x2f')],function(_0x149d5d){var _0x5310e8={};_0x5310e8[_0x149d5d]={'$like':'%'+_0xafd0a9[_0xe594('0x2b')][_0xe594('0x38')]+'%'};return _0x5310e8;})});}_0x4b800c=_[_0xe594('0x41')]({},_0x4b800c,_0xafd0a9['options']);return db[_0xe594('0x50')]['findAll'](_0x4b800c);}})[_0xe594('0x1e')](function(_0x29467f){if(_0x29467f){return db[_0xe594('0x51')][_0xe594('0x52')]({'where':{'id':_[_0xe594('0x25')](_0x29467f,_0xe594('0x53')),'role':'agent'},'attributes':['id','name','smsPause','updatedAt',_0xe594('0x54')]});}})[_0xe594('0x1e')](function(_0x33e275){if(_0x33e275){return{'count':_0x33e275[_0xe594('0x1b')],'rows':_[_0xe594('0x25')](_0x33e275[_0xe594('0x3c')],function(_0x4eab99){return{'membername':_0x4eab99[_0xe594('0x2a')],'UserId':_0x4eab99['id'],'queue_name':_0x1b3066[_0xe594('0x2a')],'SmsQueueId':_0x1b3066['id'],'interface':util[_0xe594('0x55')](_0xe594('0x56'),_0xe594('0x57'),_0x4eab99[_0xe594('0x2a')]),'penalty':0x0,'paused':_0x4eab99[_0xe594('0x58')],'createdAt':_0x4eab99[_0xe594('0x54')],'updatedAt':_0x4eab99[_0xe594('0x59')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe594('0x1e')](respondWithFilteredResult(_0x37745d,_0x4b800c))['catch'](handleError(_0x37745d,null));};exports[_0xe594('0x5a')]=function(_0x27cea7,_0x707682,_0x59b518){var _0x41efbb={};var _0x558059={};var _0x572999;var _0x4ea37c;return db[_0xe594('0x26')]['findOne']({'where':{'id':_0x27cea7[_0xe594('0x3f')]['id']}})[_0xe594('0x1e')](handleEntityNotFound(_0x707682,null))[_0xe594('0x1e')](function(_0x224cfc){if(_0x224cfc){_0x572999=_0x224cfc;_0x558059[_0xe594('0x2e')]=_['keys'](db[_0xe594('0x5b')][_0xe594('0x27')]);_0x558059[_0xe594('0x2b')]=_[_0xe594('0x2c')](_0x27cea7[_0xe594('0x2b')]);_0x558059[_0xe594('0x36')]=_[_0xe594('0x2d')](_0x558059['model'],_0x558059[_0xe594('0x2b')]);_0x41efbb['attributes']=_[_0xe594('0x2d')](_0x558059['model'],qs[_0xe594('0x30')](_0x27cea7[_0xe594('0x2b')][_0xe594('0x30')]));_0x41efbb[_0xe594('0x2f')]=_0x41efbb[_0xe594('0x2f')]['length']?_0x41efbb['attributes']:_0x558059['model'];_0x41efbb[_0xe594('0x33')]=qs['sort'](_0x27cea7['query'][_0xe594('0x34')]);_0x41efbb[_0xe594('0x35')]=qs[_0xe594('0x36')](_['pick'](_0x27cea7[_0xe594('0x2b')],_0x558059['filters']));if(_0x27cea7[_0xe594('0x2b')][_0xe594('0x38')]){_0x41efbb[_0xe594('0x35')]=_[_0xe594('0x41')](_0x41efbb[_0xe594('0x35')],{'$or':_[_0xe594('0x25')](_0x41efbb[_0xe594('0x2f')],function(_0x926d4c){var _0x22961a={};_0x22961a[_0x926d4c]={'$like':'%'+_0x27cea7['query'][_0xe594('0x38')]+'%'};return _0x22961a;})});}_0x41efbb=_[_0xe594('0x41')]({},_0x41efbb,_0x27cea7[_0xe594('0x42')]);return _0x572999[_0xe594('0x5a')](_0x41efbb);}})[_0xe594('0x1e')](function(_0x4cb8f9){if(_0x4cb8f9){_0x4ea37c=_0x4cb8f9['length'];if(!_0x27cea7[_0xe594('0x2b')][_0xe594('0x31')]('nolimit')){_0x41efbb[_0xe594('0x1a')]=qs['limit'](_0x27cea7[_0xe594('0x2b')][_0xe594('0x1a')]);_0x41efbb['offset']=qs[_0xe594('0x18')](_0x27cea7[_0xe594('0x2b')][_0xe594('0x18')]);}return _0x572999[_0xe594('0x5a')](_0x41efbb);}})[_0xe594('0x1e')](function(_0x3ea9c1){if(_0x3ea9c1){return _0x3ea9c1?{'count':_0x4ea37c,'rows':_0x3ea9c1}:null;}})['then'](respondWithResult(_0x707682,null))[_0xe594('0x3d')](handleError(_0x707682,null));};exports[_0xe594('0x5c')]=function(_0x3092b2,_0x3895c2,_0x245d36){var _0x4418c1=_0x3092b2[_0xe594('0x45')][_0xe594('0x5d')];return db[_0xe594('0x5b')][_0xe594('0x3b')]({'where':{'id':_0x4418c1},'attributes':['id'],'include':[{'model':db[_0xe594('0x51')],'as':_0xe594('0x5e'),'attributes':['id',_0xe594('0x2a'),_0xe594('0x5f'),_0xe594('0x60'),_0xe594('0x61')],'raw':!![]}]})['then'](function(_0x314bc2){if(_0x314bc2){var _0xe76edc=_['flatMap'](_0x314bc2,function(_0x556aeb){var _0x174921=_0x556aeb[_0xe594('0x1f')]({'plain':!![]});return _0x174921[_0xe594('0x5e')];});return db[_0xe594('0x26')][_0xe594('0x43')]({'where':{'id':_0x3092b2[_0xe594('0x3f')]['id']}})[_0xe594('0x1e')](function(_0x415ede){return db[_0xe594('0x62')][_0xe594('0x63')](function(_0x5d07b9){return _0x415ede[_0xe594('0x5c')](_0x4418c1,{'transaction':_0x5d07b9})[_0xe594('0x1e')](function(){return BPromise[_0xe594('0x64')](_0xe76edc,function(_0xbd3fc9){return db[_0xe594('0x50')]['findOrCreate']({'where':{'UserId':_0xbd3fc9['id'],'SmsQueueId':_0x3092b2[_0xe594('0x3f')]['id']},'transaction':_0x5d07b9});});})[_0xe594('0x1e')](function(){_0xe76edc[_0xe594('0x65')](function(_0x3f10ab){socket[_0xe594('0x66')](_0xe594('0x67'),{'UserId':_0x3f10ab['id'],'SmsQueueId':_0x415ede['id']});});});});});}})[_0xe594('0x1e')](respondWithStatusCode(_0x3895c2,null))[_0xe594('0x3d')](handleError(_0x3895c2,null));};exports[_0xe594('0x68')]=function(_0xbe9ad5,_0x1fec2d,_0x46d440){return db[_0xe594('0x5b')][_0xe594('0x3b')]({'where':{'id':_0xbe9ad5[_0xe594('0x2b')]['ids']},'attributes':['id'],'include':[{'model':db[_0xe594('0x51')],'as':_0xe594('0x5e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1fec2d,null))[_0xe594('0x1e')](function(_0xa3c307){var _0x592554=_[_0xe594('0x25')](_0xa3c307,'id');var _0x49fa1c=[];var _0x1ec49b=[];var _0x2bd07c=squel[_0xe594('0x69')]();_0x2bd07c[_0xe594('0x6a')](_0xe594('0x6b'))[_0xe594('0x6c')](_0xe594('0x6d'),'tq')[_0xe594('0x6e')](_0xe594('0x6f'),'ut',_0xe594('0x70'))[_0xe594('0x35')](_0xe594('0x71'),_0xbe9ad5[_0xe594('0x3f')]['id']);for(var _0x4c0888=0x0;_0x4c0888<_0xa3c307['length'];_0x4c0888+=0x1){let _0x46046f=_0xa3c307[_0x4c0888];for(var _0x1fd00f=0x0;_0x1fd00f<_0x46046f[_0xe594('0x5e')][_0xe594('0x40')];_0x1fd00f+=0x1){let _0xaf4ee9=_0x46046f[_0xe594('0x5e')][_0x1fd00f];var _0xf2be15=_0x2bd07c[_0xe594('0x72')]();_0xf2be15[_0xe594('0x35')](_0xe594('0x73'),_0xaf4ee9['id']);_0x1ec49b['push'](db[_0xe594('0x62')][_0xe594('0x2b')](_0xf2be15['toString'](),{'type':db[_0xe594('0x62')]['QueryTypes'][_0xe594('0x74')]})[_0xe594('0x1e')](function(_0x216711){if(_0x216711[_0xe594('0x40')]===0x1){return _0xaf4ee9['id'];}else{var _0x3029b0=_['every'](_['map'](_0x216711,_0xe594('0x75')),function(_0x79653e){return _['includes'](_0x592554,_0x79653e);});if(_0x3029b0){return _0xaf4ee9['id'];}}}));}}return BPromise[_0xe594('0x76')](_0x1ec49b)[_0xe594('0x1e')](function(_0xbff98b){_0x49fa1c=_(_0x49fa1c)[_0xe594('0x77')](_0xbff98b)[_0xe594('0x78')]()[_0xe594('0x79')]();return db['SmsQueue'][_0xe594('0x43')]({'where':{'id':_0xbe9ad5[_0xe594('0x3f')]['id']}})[_0xe594('0x1e')](function(_0x2f1b2b){return db['sequelize'][_0xe594('0x63')](function(_0x3f9dbb){return _0x2f1b2b[_0xe594('0x68')](_0xbe9ad5[_0xe594('0x2b')][_0xe594('0x5d')],{'transaction':_0x3f9dbb})[_0xe594('0x1e')](function(){if(!_['isEmpty'](_0x49fa1c)){return _0x2f1b2b['removeAgents'](_0x49fa1c,{'transaction':_0x3f9dbb});}})[_0xe594('0x1e')](function(){_0x49fa1c['forEach'](function(_0x5b37bb){socket['emit'](_0xe594('0x7a'),{'UserId':_0x5b37bb,'SmsQueueId':_0x2f1b2b['id']});});});});});});})['then'](respondWithStatusCode(_0x1fec2d,null))[_0xe594('0x3d')](handleError(_0x1fec2d,null));};exports[_0xe594('0x7b')]=function(_0x38db50,_0x1b6e44,_0x20cdf4){return db[_0xe594('0x26')]['find']({'where':{'id':_0x38db50[_0xe594('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1b6e44,null))[_0xe594('0x1e')](function(_0x2ad526){if(_0x2ad526){return _0x2ad526[_0xe594('0x7b')](_0x38db50['body'][_0xe594('0x5d')],_[_0xe594('0x7c')](_0x38db50[_0xe594('0x45')],[_0xe594('0x5d'),'id'])||{})[_0xe594('0x7d')](function(_0x47bfab){for(var _0x2275ed=0x0;_0x2275ed<_0x38db50['body']['ids'][_0xe594('0x40')];_0x2275ed+=0x1){socket['emit'](_0xe594('0x67'),{'UserId':Number(_0x38db50[_0xe594('0x45')][_0xe594('0x5d')][_0x2275ed]),'SmsQueueId':Number(_0x38db50['params']['id'])});}return _0x47bfab;});}})[_0xe594('0x1e')](respondWithResult(_0x1b6e44,null))[_0xe594('0x3d')](handleError(_0x1b6e44,null));};exports['removeAgents']=function(_0x42b3e9,_0x48fd86,_0x17b2bd){return db[_0xe594('0x26')]['find']({'where':{'id':_0x42b3e9[_0xe594('0x3f')]['id']}})['then'](handleEntityNotFound(_0x48fd86,null))[_0xe594('0x1e')](function(_0x4be99d){if(_0x4be99d){return _0x4be99d[_0xe594('0x7e')](_0x42b3e9[_0xe594('0x2b')][_0xe594('0x5d')])[_0xe594('0x1e')](function(){if(_[_0xe594('0x7f')](_0x42b3e9['query']['ids'])){for(var _0xe2140d=0x0;_0xe2140d<_0x42b3e9[_0xe594('0x2b')][_0xe594('0x5d')][_0xe594('0x40')];_0xe2140d+=0x1){socket[_0xe594('0x66')](_0xe594('0x7a'),{'UserId':Number(_0x42b3e9[_0xe594('0x2b')][_0xe594('0x5d')][_0xe2140d]),'SmsQueueId':Number(_0x42b3e9['params']['id'])});}}else{socket[_0xe594('0x66')](_0xe594('0x7a'),{'UserId':Number(_0x42b3e9[_0xe594('0x2b')]['ids']),'SmsQueueId':Number(_0x42b3e9[_0xe594('0x3f')]['id'])});}});}})['then'](respondWithStatusCode(_0x48fd86,null))[_0xe594('0x3d')](handleError(_0x48fd86,null));};exports[_0xe594('0x80')]=function(_0x421d30,_0x1545d9,_0x3db486){var _0x246576={};var _0x47eade={};var _0x3128d4;var _0x336ba8;return db['SmsQueue'][_0xe594('0x4e')]({'where':{'id':_0x421d30[_0xe594('0x3f')]['id']}})[_0xe594('0x1e')](handleEntityNotFound(_0x1545d9,null))[_0xe594('0x1e')](function(_0x2415e2){if(_0x2415e2){_0x3128d4=_0x2415e2;_0x47eade[_0xe594('0x2e')]=_[_0xe594('0x2c')](db[_0xe594('0x51')][_0xe594('0x27')]);_0x47eade[_0xe594('0x2b')]=_[_0xe594('0x2c')](_0x421d30[_0xe594('0x2b')]);_0x47eade[_0xe594('0x36')]=_[_0xe594('0x2d')](_0x47eade[_0xe594('0x2e')],_0x47eade[_0xe594('0x2b')]);_0x246576['attributes']=_[_0xe594('0x2d')](_0x47eade[_0xe594('0x2e')],qs[_0xe594('0x30')](_0x421d30['query'][_0xe594('0x30')]));_0x246576[_0xe594('0x2f')]=_0x246576['attributes'][_0xe594('0x40')]?_0x246576['attributes']:_0x47eade[_0xe594('0x2e')];_0x246576[_0xe594('0x33')]=qs[_0xe594('0x34')](_0x421d30[_0xe594('0x2b')][_0xe594('0x34')]);_0x246576['where']=qs['filters'](_[_0xe594('0x37')](_0x421d30[_0xe594('0x2b')],_0x47eade[_0xe594('0x36')]));if(_0x421d30[_0xe594('0x2b')][_0xe594('0x38')]){_0x246576['where']=_['merge'](_0x246576[_0xe594('0x35')],{'$or':_[_0xe594('0x25')](_0x246576['attributes'],function(_0x385673){var _0x101d53={};_0x101d53[_0x385673]={'$like':'%'+_0x421d30[_0xe594('0x2b')]['filter']+'%'};return _0x101d53;})});}_0x246576=_[_0xe594('0x41')]({},_0x246576,_0x421d30[_0xe594('0x42')]);return _0x3128d4[_0xe594('0x80')](_0x246576);}})[_0xe594('0x1e')](function(_0x5be93c){if(_0x5be93c){_0x336ba8=_0x5be93c[_0xe594('0x40')];if(!_0x421d30[_0xe594('0x2b')][_0xe594('0x31')]('nolimit')){_0x246576[_0xe594('0x1a')]=qs[_0xe594('0x1a')](_0x421d30[_0xe594('0x2b')]['limit']);_0x246576[_0xe594('0x18')]=qs[_0xe594('0x18')](_0x421d30[_0xe594('0x2b')]['offset']);}return _0x3128d4[_0xe594('0x80')](_0x246576);}})['then'](function(_0x3d4b8d){if(_0x3d4b8d){return _0x3d4b8d?{'count':_0x336ba8,'rows':_0x3d4b8d}:null;}})['then'](respondWithResult(_0x1545d9,null))[_0xe594('0x3d')](handleError(_0x1545d9,null));};
\ No newline at end of file
+var _0xb131=['desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','end','offset','undefined','count','limit','set','json','reject','then','destroy','SmsQueues','UserProfileResource','stack','name','send','map','rawAttributes','fieldName','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','SmsQueue','includeAll','include','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','update','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','findAll','findAndCountAll','UserId','updatedAt','createdAt','rows','format','smsPause','getTeams','Team','User','Agents','online','voicePause','flatMap','transaction','findOrCreate','userSmsQueue:save','removeTeams','ids','select','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','toString','sequelize','QueryTypes','SELECT','all','union','compact','value','removeAgents','emit','omit','spread','isArray','userSmsQueue:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xb131,0x187));var _0x1b13=function(_0x249e96,_0x3ea39d){_0x249e96=_0x249e96-0x0;var _0x17444c=_0xb131[_0x249e96];return _0x17444c;};'use strict';var emlformat=require(_0x1b13('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1b13('0x1'));var jsonpatch=require(_0x1b13('0x2'));var rp=require(_0x1b13('0x3'));var moment=require(_0x1b13('0x4'));var BPromise=require(_0x1b13('0x5'));var Mustache=require(_0x1b13('0x6'));var util=require(_0x1b13('0x7'));var path=require(_0x1b13('0x8'));var sox=require('sox');var csv=require(_0x1b13('0x9'));var ejs=require(_0x1b13('0xa'));var fs=require('fs');var fs_extra=require(_0x1b13('0xb'));var _=require(_0x1b13('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1b13('0xd'));var deskjs=require(_0x1b13('0xe'));var toCsv=require('to-csv');var querystring=require(_0x1b13('0xf'));var Papa=require(_0x1b13('0x10'));var Redis=require('ioredis');var authService=require(_0x1b13('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1b13('0x12'));var logger=require(_0x1b13('0x13'))(_0x1b13('0x14'));var utils=require(_0x1b13('0x15'));var config=require(_0x1b13('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b13('0x17'))['db'];config[_0x1b13('0x18')]=_[_0x1b13('0x19')](config['redis'],{'host':_0x1b13('0x1a'),'port':0x18eb});var socket=require(_0x1b13('0x1b'))(new Redis(config[_0x1b13('0x18')]));require('./smsQueue.socket')['register'](socket);function respondWithStatusCode(_0x516476,_0x28b268){_0x28b268=_0x28b268||0xcc;return function(_0x1f4145){if(_0x1f4145){return _0x516476['sendStatus'](_0x28b268);}return _0x516476[_0x1b13('0x1c')](_0x28b268)[_0x1b13('0x1d')]();};}function respondWithResult(_0x3eb07b,_0x442e90){_0x442e90=_0x442e90||0xc8;return function(_0x19fbd4){if(_0x19fbd4){return _0x3eb07b[_0x1b13('0x1c')](_0x442e90)['json'](_0x19fbd4);}};}function respondWithFilteredResult(_0x36a9e4,_0x448dd3){return function(_0x1ae638){if(_0x1ae638){var _0x1d622a=typeof _0x448dd3[_0x1b13('0x1e')]===_0x1b13('0x1f')&&typeof _0x448dd3['limit']===_0x1b13('0x1f');var _0x589e1a=_0x1ae638[_0x1b13('0x20')];var _0x1fb20a=_0x1d622a?0x0:_0x448dd3[_0x1b13('0x1e')];var _0x13d0b4=_0x1d622a?_0x1ae638[_0x1b13('0x20')]:_0x448dd3[_0x1b13('0x1e')]+_0x448dd3[_0x1b13('0x21')];var _0x381a2f;if(_0x13d0b4>=_0x589e1a){_0x13d0b4=_0x589e1a;_0x381a2f=0xc8;}else{_0x381a2f=0xce;}_0x36a9e4[_0x1b13('0x1c')](_0x381a2f);return _0x36a9e4[_0x1b13('0x22')]('Content-Range',_0x1fb20a+'-'+_0x13d0b4+'/'+_0x589e1a)[_0x1b13('0x23')](_0x1ae638);}return null;};}function patchUpdates(_0xa39e5e){return function(_0x93eb08){try{jsonpatch['apply'](_0x93eb08,_0xa39e5e,!![]);}catch(_0x3c5527){return BPromise[_0x1b13('0x24')](_0x3c5527);}return _0x93eb08['save']();};}function saveUpdates(_0x323320,_0x1672d8){return function(_0x3bcfe9){if(_0x3bcfe9){return _0x3bcfe9['update'](_0x323320)[_0x1b13('0x25')](function(_0x5a4dc6){return _0x5a4dc6;});}return null;};}function removeEntity(_0x1b316d,_0x3a42df){return function(_0x5e9516){if(_0x5e9516){return _0x5e9516[_0x1b13('0x26')]()['then'](function(){var _0x1dcf1f=_0x5e9516['get']({'plain':!![]});var _0x52a4a9=_0x1b13('0x27');return db[_0x1b13('0x28')][_0x1b13('0x26')]({'where':{'type':_0x52a4a9,'resourceId':_0x1dcf1f['id']}})['then'](function(){return _0x5e9516;});})[_0x1b13('0x25')](function(){_0x1b316d['status'](0xcc)[_0x1b13('0x1d')]();});}};}function handleEntityNotFound(_0xf714ca,_0x16e94f){return function(_0x5788d3){if(!_0x5788d3){_0xf714ca['sendStatus'](0x194);}return _0x5788d3;};}function handleError(_0x2aedeb,_0x4affe6){_0x4affe6=_0x4affe6||0x1f4;return function(_0x5fdecb){logger['error'](_0x5fdecb[_0x1b13('0x29')]);if(_0x5fdecb[_0x1b13('0x2a')]){delete _0x5fdecb[_0x1b13('0x2a')];}_0x2aedeb[_0x1b13('0x1c')](_0x4affe6)[_0x1b13('0x2b')](_0x5fdecb);};}exports['index']=function(_0x340542,_0x4af549){var _0x38935e={},_0x7e8a95={},_0x209bd1={'count':0x0,'rows':[]};var _0x418518=_[_0x1b13('0x2c')](db['SmsQueue'][_0x1b13('0x2d')],function(_0x5d9ce4){return{'name':_0x5d9ce4[_0x1b13('0x2e')],'type':_0x5d9ce4['type'][_0x1b13('0x2f')]};});_0x7e8a95['model']=_[_0x1b13('0x2c')](_0x418518,'name');_0x7e8a95['query']=_[_0x1b13('0x30')](_0x340542['query']);_0x7e8a95[_0x1b13('0x31')]=_[_0x1b13('0x32')](_0x7e8a95[_0x1b13('0x33')],_0x7e8a95[_0x1b13('0x34')]);_0x38935e[_0x1b13('0x35')]=_['intersection'](_0x7e8a95[_0x1b13('0x33')],qs['fields'](_0x340542[_0x1b13('0x34')][_0x1b13('0x36')]));_0x38935e['attributes']=_0x38935e[_0x1b13('0x35')][_0x1b13('0x37')]?_0x38935e[_0x1b13('0x35')]:_0x7e8a95[_0x1b13('0x33')];if(!_0x340542[_0x1b13('0x34')][_0x1b13('0x38')](_0x1b13('0x39'))){_0x38935e['limit']=qs['limit'](_0x340542[_0x1b13('0x34')][_0x1b13('0x21')]);_0x38935e[_0x1b13('0x1e')]=qs[_0x1b13('0x1e')](_0x340542['query'][_0x1b13('0x1e')]);}_0x38935e[_0x1b13('0x3a')]=qs[_0x1b13('0x3b')](_0x340542[_0x1b13('0x34')][_0x1b13('0x3b')]);_0x38935e[_0x1b13('0x3c')]=qs[_0x1b13('0x31')](_[_0x1b13('0x3d')](_0x340542[_0x1b13('0x34')],_0x7e8a95[_0x1b13('0x31')]),_0x418518);if(_0x340542[_0x1b13('0x34')][_0x1b13('0x3e')]){_0x38935e['where']=_['merge'](_0x38935e[_0x1b13('0x3c')],{'$or':_[_0x1b13('0x2c')](_0x418518,function(_0xa03af7){if(_0xa03af7['type']!==_0x1b13('0x3f')){var _0x2f0979={};_0x2f0979[_0xa03af7['name']]={'$like':'%'+_0x340542[_0x1b13('0x34')]['filter']+'%'};return _0x2f0979;}})});}_0x38935e=_[_0x1b13('0x40')]({},_0x38935e,_0x340542[_0x1b13('0x41')]);var _0x2e5137={'where':_0x38935e['where']};return db[_0x1b13('0x42')][_0x1b13('0x20')](_0x2e5137)[_0x1b13('0x25')](function(_0x499f1c){_0x209bd1[_0x1b13('0x20')]=_0x499f1c;if(_0x340542[_0x1b13('0x34')][_0x1b13('0x43')]){_0x38935e[_0x1b13('0x44')]=[{'all':!![]}];}return db['SmsQueue']['findAll'](_0x38935e);})[_0x1b13('0x25')](function(_0x256486){_0x209bd1['rows']=_0x256486;return _0x209bd1;})['then'](respondWithFilteredResult(_0x4af549,_0x38935e))[_0x1b13('0x45')](handleError(_0x4af549,null));};exports[_0x1b13('0x46')]=function(_0x4b6e7c,_0x5bea5a){var _0x39bfc5={'raw':!![],'where':{'id':_0x4b6e7c[_0x1b13('0x47')]['id']}},_0xd059fb={};_0xd059fb[_0x1b13('0x33')]=_[_0x1b13('0x30')](db[_0x1b13('0x42')]['rawAttributes']);_0xd059fb[_0x1b13('0x34')]=_[_0x1b13('0x30')](_0x4b6e7c['query']);_0xd059fb['filters']=_[_0x1b13('0x32')](_0xd059fb[_0x1b13('0x33')],_0xd059fb['query']);_0x39bfc5[_0x1b13('0x35')]=_['intersection'](_0xd059fb[_0x1b13('0x33')],qs[_0x1b13('0x36')](_0x4b6e7c[_0x1b13('0x34')]['fields']));_0x39bfc5[_0x1b13('0x35')]=_0x39bfc5[_0x1b13('0x35')][_0x1b13('0x37')]?_0x39bfc5[_0x1b13('0x35')]:_0xd059fb[_0x1b13('0x33')];if(_0x4b6e7c[_0x1b13('0x34')][_0x1b13('0x43')]){_0x39bfc5['include']=[{'all':!![]}];}_0x39bfc5=_['merge']({},_0x39bfc5,_0x4b6e7c[_0x1b13('0x41')]);return db['SmsQueue'][_0x1b13('0x48')](_0x39bfc5)[_0x1b13('0x25')](handleEntityNotFound(_0x5bea5a,null))[_0x1b13('0x25')](respondWithResult(_0x5bea5a,null))[_0x1b13('0x45')](handleError(_0x5bea5a,null));};exports[_0x1b13('0x49')]=function(_0x4105b9,_0x85db59){return db[_0x1b13('0x42')][_0x1b13('0x49')](_0x4105b9[_0x1b13('0x4a')],{})[_0x1b13('0x25')](function(_0x44c22c){var _0x763229=_0x4105b9[_0x1b13('0x4b')][_0x1b13('0x4c')]({'plain':!![]});if(!_0x763229)throw new Error(_0x1b13('0x4d'));if(_0x763229[_0x1b13('0x4e')]==='user'){var _0xc4de59=_0x44c22c[_0x1b13('0x4c')]({'plain':!![]});var _0x388838='SmsQueues';return db[_0x1b13('0x4f')][_0x1b13('0x48')]({'where':{'name':_0x388838,'userProfileId':_0x763229['userProfileId']},'raw':!![]})[_0x1b13('0x25')](function(_0xbf05bb){if(_0xbf05bb&&_0xbf05bb[_0x1b13('0x50')]===0x0){return db[_0x1b13('0x28')][_0x1b13('0x49')]({'name':_0xc4de59['name'],'resourceId':_0xc4de59['id'],'type':_0xbf05bb[_0x1b13('0x2a')],'sectionId':_0xbf05bb['id']},{})[_0x1b13('0x25')](function(){return _0x44c22c;});}else{return _0x44c22c;}})[_0x1b13('0x45')](function(_0x163357){logger[_0x1b13('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x163357);throw _0x163357;});}return _0x44c22c;})[_0x1b13('0x25')](respondWithResult(_0x85db59,0xc9))[_0x1b13('0x45')](handleError(_0x85db59,null));};exports[_0x1b13('0x52')]=function(_0x51b64b,_0x578d64){if(_0x51b64b[_0x1b13('0x4a')]['id']){delete _0x51b64b[_0x1b13('0x4a')]['id'];}return db[_0x1b13('0x42')][_0x1b13('0x48')]({'where':{'id':_0x51b64b['params']['id']}})['then'](handleEntityNotFound(_0x578d64,null))[_0x1b13('0x25')](saveUpdates(_0x51b64b[_0x1b13('0x4a')],null))['then'](respondWithResult(_0x578d64,null))[_0x1b13('0x45')](handleError(_0x578d64,null));};exports[_0x1b13('0x26')]=function(_0x2ed5f7,_0x3b3264){return db[_0x1b13('0x42')]['find']({'where':{'id':_0x2ed5f7[_0x1b13('0x47')]['id']}})[_0x1b13('0x25')](handleEntityNotFound(_0x3b3264,null))[_0x1b13('0x25')](removeEntity(_0x3b3264,null))[_0x1b13('0x45')](handleError(_0x3b3264,null));};exports[_0x1b13('0x53')]=function(_0x43ea95,_0x1dbb5f){return db[_0x1b13('0x42')]['describe']()[_0x1b13('0x25')](respondWithResult(_0x1dbb5f,null))[_0x1b13('0x45')](handleError(_0x1dbb5f,null));};exports[_0x1b13('0x54')]=function(_0x5dad2a,_0x2d56bb,_0x52310d){var _0x5418ab={'raw':!![],'where':{}},_0x4c365f={},_0x99355e;return db[_0x1b13('0x42')][_0x1b13('0x55')]({'where':{'id':_0x5dad2a[_0x1b13('0x47')]['id']}})[_0x1b13('0x25')](handleEntityNotFound(_0x2d56bb,null))[_0x1b13('0x25')](function(_0x1e3c58){if(_0x1e3c58){_0x99355e=_0x1e3c58[_0x1b13('0x4c')]({'plain':!![]});_0x4c365f[_0x1b13('0x33')]=_[_0x1b13('0x30')](db[_0x1b13('0x56')][_0x1b13('0x2d')]);_0x4c365f[_0x1b13('0x34')]=_[_0x1b13('0x30')](_0x5dad2a['query']);_0x4c365f[_0x1b13('0x31')]=_['intersection'](_0x4c365f[_0x1b13('0x33')],_0x4c365f[_0x1b13('0x34')]);_0x5418ab[_0x1b13('0x35')]=_['intersection'](_0x4c365f['model'],qs[_0x1b13('0x36')](_0x5dad2a[_0x1b13('0x34')][_0x1b13('0x36')]));_0x5418ab[_0x1b13('0x35')]=_0x5418ab[_0x1b13('0x35')][_0x1b13('0x37')]?_0x5418ab['attributes']:_0x4c365f['model'];if(!_0x5dad2a[_0x1b13('0x34')][_0x1b13('0x38')](_0x1b13('0x39'))){_0x5418ab[_0x1b13('0x21')]=qs['limit'](_0x5dad2a[_0x1b13('0x34')][_0x1b13('0x21')]);_0x5418ab[_0x1b13('0x1e')]=qs[_0x1b13('0x1e')](_0x5dad2a[_0x1b13('0x34')][_0x1b13('0x1e')]);}_0x5418ab[_0x1b13('0x3a')]=qs['sort'](_0x5dad2a['query'][_0x1b13('0x3b')]);_0x5418ab['where']=qs['filters'](_[_0x1b13('0x3d')](_0x5dad2a[_0x1b13('0x34')],_0x4c365f[_0x1b13('0x31')]));_0x5418ab['where'][_0x1b13('0x57')]=_0x1e3c58['id'];if(_0x5dad2a['query'][_0x1b13('0x3e')]){_0x5418ab[_0x1b13('0x3c')]=_[_0x1b13('0x40')](_0x5418ab[_0x1b13('0x3c')],{'$or':_[_0x1b13('0x2c')](_0x5418ab[_0x1b13('0x35')],function(_0x47914f){var _0x40be73={};_0x40be73[_0x47914f]={'$like':'%'+_0x5dad2a[_0x1b13('0x34')][_0x1b13('0x3e')]+'%'};return _0x40be73;})});}_0x5418ab=_[_0x1b13('0x40')]({},_0x5418ab,_0x5dad2a[_0x1b13('0x41')]);return db[_0x1b13('0x56')][_0x1b13('0x58')](_0x5418ab);}})[_0x1b13('0x25')](function(_0x9f3682){if(_0x9f3682){return db['User'][_0x1b13('0x59')]({'where':{'id':_[_0x1b13('0x2c')](_0x9f3682,_0x1b13('0x5a')),'role':'agent'},'attributes':['id',_0x1b13('0x2a'),'smsPause',_0x1b13('0x5b'),_0x1b13('0x5c')]});}})[_0x1b13('0x25')](function(_0x1e633d){if(_0x1e633d){return{'count':_0x1e633d[_0x1b13('0x20')],'rows':_[_0x1b13('0x2c')](_0x1e633d[_0x1b13('0x5d')],function(_0x3d09b3){return{'membername':_0x3d09b3['name'],'UserId':_0x3d09b3['id'],'queue_name':_0x99355e[_0x1b13('0x2a')],'SmsQueueId':_0x99355e['id'],'interface':util[_0x1b13('0x5e')]('%s/%s','SIP',_0x3d09b3[_0x1b13('0x2a')]),'penalty':0x0,'paused':_0x3d09b3[_0x1b13('0x5f')],'createdAt':_0x3d09b3[_0x1b13('0x5c')],'updatedAt':_0x3d09b3[_0x1b13('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1b13('0x25')](respondWithFilteredResult(_0x2d56bb,_0x5418ab))['catch'](handleError(_0x2d56bb,null));};exports[_0x1b13('0x60')]=function(_0x52f913,_0x12c527,_0x57642d){var _0x388e1a={};var _0xa8662a={};var _0x11bec9;var _0xefb663;return db['SmsQueue'][_0x1b13('0x55')]({'where':{'id':_0x52f913[_0x1b13('0x47')]['id']}})['then'](handleEntityNotFound(_0x12c527,null))['then'](function(_0x3b8265){if(_0x3b8265){_0x11bec9=_0x3b8265;_0xa8662a[_0x1b13('0x33')]=_[_0x1b13('0x30')](db[_0x1b13('0x61')][_0x1b13('0x2d')]);_0xa8662a['query']=_[_0x1b13('0x30')](_0x52f913[_0x1b13('0x34')]);_0xa8662a[_0x1b13('0x31')]=_['intersection'](_0xa8662a[_0x1b13('0x33')],_0xa8662a['query']);_0x388e1a['attributes']=_[_0x1b13('0x32')](_0xa8662a[_0x1b13('0x33')],qs[_0x1b13('0x36')](_0x52f913[_0x1b13('0x34')][_0x1b13('0x36')]));_0x388e1a[_0x1b13('0x35')]=_0x388e1a[_0x1b13('0x35')]['length']?_0x388e1a['attributes']:_0xa8662a[_0x1b13('0x33')];_0x388e1a[_0x1b13('0x3a')]=qs[_0x1b13('0x3b')](_0x52f913[_0x1b13('0x34')][_0x1b13('0x3b')]);_0x388e1a[_0x1b13('0x3c')]=qs['filters'](_[_0x1b13('0x3d')](_0x52f913['query'],_0xa8662a[_0x1b13('0x31')]));if(_0x52f913[_0x1b13('0x34')]['filter']){_0x388e1a['where']=_[_0x1b13('0x40')](_0x388e1a['where'],{'$or':_['map'](_0x388e1a[_0x1b13('0x35')],function(_0x1ee2e9){var _0x27f4f9={};_0x27f4f9[_0x1ee2e9]={'$like':'%'+_0x52f913['query'][_0x1b13('0x3e')]+'%'};return _0x27f4f9;})});}_0x388e1a=_[_0x1b13('0x40')]({},_0x388e1a,_0x52f913[_0x1b13('0x41')]);return _0x11bec9[_0x1b13('0x60')](_0x388e1a);}})[_0x1b13('0x25')](function(_0xebed4e){if(_0xebed4e){_0xefb663=_0xebed4e[_0x1b13('0x37')];if(!_0x52f913[_0x1b13('0x34')][_0x1b13('0x38')](_0x1b13('0x39'))){_0x388e1a[_0x1b13('0x21')]=qs[_0x1b13('0x21')](_0x52f913[_0x1b13('0x34')][_0x1b13('0x21')]);_0x388e1a[_0x1b13('0x1e')]=qs[_0x1b13('0x1e')](_0x52f913[_0x1b13('0x34')][_0x1b13('0x1e')]);}return _0x11bec9[_0x1b13('0x60')](_0x388e1a);}})[_0x1b13('0x25')](function(_0x53b66f){if(_0x53b66f){return _0x53b66f?{'count':_0xefb663,'rows':_0x53b66f}:null;}})[_0x1b13('0x25')](respondWithResult(_0x12c527,null))[_0x1b13('0x45')](handleError(_0x12c527,null));};exports['addTeams']=function(_0x52da34,_0x40ad91,_0x1213d4){var _0x176671=_0x52da34['body']['ids'];return db[_0x1b13('0x61')][_0x1b13('0x58')]({'where':{'id':_0x176671},'attributes':['id'],'include':[{'model':db[_0x1b13('0x62')],'as':_0x1b13('0x63'),'attributes':['id',_0x1b13('0x2a'),_0x1b13('0x64'),_0x1b13('0x65'),'interface'],'raw':!![]}]})[_0x1b13('0x25')](function(_0x483bef){if(_0x483bef){var _0x2f7c32=_[_0x1b13('0x66')](_0x483bef,function(_0x99a08){var _0x284729=_0x99a08['get']({'plain':!![]});return _0x284729['Agents'];});return db[_0x1b13('0x42')][_0x1b13('0x48')]({'where':{'id':_0x52da34[_0x1b13('0x47')]['id']}})['then'](function(_0x489bfd){return db['sequelize'][_0x1b13('0x67')](function(_0x64eceb){return _0x489bfd['addTeams'](_0x176671,{'transaction':_0x64eceb})['then'](function(){return BPromise['each'](_0x2f7c32,function(_0x1d06b0){return db['UserSmsQueue'][_0x1b13('0x68')]({'where':{'UserId':_0x1d06b0['id'],'SmsQueueId':_0x52da34[_0x1b13('0x47')]['id']},'transaction':_0x64eceb});});})[_0x1b13('0x25')](function(){_0x2f7c32['forEach'](function(_0x583e7d){socket['emit'](_0x1b13('0x69'),{'UserId':_0x583e7d['id'],'SmsQueueId':_0x489bfd['id']});});});});});}})[_0x1b13('0x25')](respondWithStatusCode(_0x40ad91,null))[_0x1b13('0x45')](handleError(_0x40ad91,null));};exports[_0x1b13('0x6a')]=function(_0x5b3611,_0x17e6bf,_0xb125cc){return db[_0x1b13('0x61')][_0x1b13('0x58')]({'where':{'id':_0x5b3611[_0x1b13('0x34')][_0x1b13('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x1b13('0x62')],'as':_0x1b13('0x63'),'attributes':['id'],'raw':!![]}]})[_0x1b13('0x25')](handleEntityNotFound(_0x17e6bf,null))[_0x1b13('0x25')](function(_0x39a28e){var _0x477ab2=_[_0x1b13('0x2c')](_0x39a28e,'id');var _0x4d2b46=[];var _0x2d0442=[];var _0x1eb486=squel[_0x1b13('0x6c')]();_0x1eb486[_0x1b13('0x6d')](_0x1b13('0x6e'))[_0x1b13('0x6f')](_0x1b13('0x70'),'tq')[_0x1b13('0x71')](_0x1b13('0x72'),'ut',_0x1b13('0x73'))['where'](_0x1b13('0x74'),_0x5b3611[_0x1b13('0x47')]['id']);for(var _0x56ef38=0x0;_0x56ef38<_0x39a28e['length'];_0x56ef38+=0x1){let _0x5f2070=_0x39a28e[_0x56ef38];for(var _0x26633c=0x0;_0x26633c<_0x5f2070[_0x1b13('0x63')][_0x1b13('0x37')];_0x26633c+=0x1){let _0x3f7cba=_0x5f2070[_0x1b13('0x63')][_0x26633c];var _0x466576=_0x1eb486[_0x1b13('0x75')]();_0x466576['where'](_0x1b13('0x76'),_0x3f7cba['id']);_0x2d0442[_0x1b13('0x77')](db['sequelize'][_0x1b13('0x34')](_0x466576[_0x1b13('0x78')](),{'type':db[_0x1b13('0x79')][_0x1b13('0x7a')][_0x1b13('0x7b')]})[_0x1b13('0x25')](function(_0x2cd5fd){if(_0x2cd5fd[_0x1b13('0x37')]===0x1){return _0x3f7cba['id'];}else{var _0x5ad813=_['every'](_['map'](_0x2cd5fd,'TeamId'),function(_0x492629){return _['includes'](_0x477ab2,_0x492629);});if(_0x5ad813){return _0x3f7cba['id'];}}}));}}return BPromise[_0x1b13('0x7c')](_0x2d0442)[_0x1b13('0x25')](function(_0x3f81c7){_0x4d2b46=_(_0x4d2b46)[_0x1b13('0x7d')](_0x3f81c7)[_0x1b13('0x7e')]()[_0x1b13('0x7f')]();return db[_0x1b13('0x42')][_0x1b13('0x48')]({'where':{'id':_0x5b3611[_0x1b13('0x47')]['id']}})[_0x1b13('0x25')](function(_0x5f36ed){return db['sequelize'][_0x1b13('0x67')](function(_0x3ca95e){return _0x5f36ed[_0x1b13('0x6a')](_0x5b3611[_0x1b13('0x34')]['ids'],{'transaction':_0x3ca95e})[_0x1b13('0x25')](function(){if(!_['isEmpty'](_0x4d2b46)){return _0x5f36ed[_0x1b13('0x80')](_0x4d2b46,{'transaction':_0x3ca95e});}})[_0x1b13('0x25')](function(){_0x4d2b46['forEach'](function(_0x347649){socket[_0x1b13('0x81')]('userSmsQueue:remove',{'UserId':_0x347649,'SmsQueueId':_0x5f36ed['id']});});});});});});})['then'](respondWithStatusCode(_0x17e6bf,null))[_0x1b13('0x45')](handleError(_0x17e6bf,null));};exports['addAgents']=function(_0x437663,_0x1aa018,_0x251af6){return db[_0x1b13('0x42')]['find']({'where':{'id':_0x437663[_0x1b13('0x47')]['id']}})[_0x1b13('0x25')](handleEntityNotFound(_0x1aa018,null))[_0x1b13('0x25')](function(_0x136da1){if(_0x136da1){return _0x136da1['addAgents'](_0x437663[_0x1b13('0x4a')][_0x1b13('0x6b')],_[_0x1b13('0x82')](_0x437663[_0x1b13('0x4a')],[_0x1b13('0x6b'),'id'])||{})[_0x1b13('0x83')](function(_0x30d6c4){for(var _0x3bf1ce=0x0;_0x3bf1ce<_0x437663[_0x1b13('0x4a')][_0x1b13('0x6b')][_0x1b13('0x37')];_0x3bf1ce+=0x1){socket[_0x1b13('0x81')](_0x1b13('0x69'),{'UserId':Number(_0x437663['body'][_0x1b13('0x6b')][_0x3bf1ce]),'SmsQueueId':Number(_0x437663[_0x1b13('0x47')]['id'])});}return _0x30d6c4;});}})[_0x1b13('0x25')](respondWithResult(_0x1aa018,null))[_0x1b13('0x45')](handleError(_0x1aa018,null));};exports[_0x1b13('0x80')]=function(_0x4dedc4,_0x2111a3,_0x158115){return db[_0x1b13('0x42')]['find']({'where':{'id':_0x4dedc4['params']['id']}})['then'](handleEntityNotFound(_0x2111a3,null))['then'](function(_0x25d2a1){if(_0x25d2a1){return _0x25d2a1[_0x1b13('0x80')](_0x4dedc4['query']['ids'])[_0x1b13('0x25')](function(){if(_[_0x1b13('0x84')](_0x4dedc4[_0x1b13('0x34')][_0x1b13('0x6b')])){for(var _0x4619f4=0x0;_0x4619f4<_0x4dedc4['query'][_0x1b13('0x6b')][_0x1b13('0x37')];_0x4619f4+=0x1){socket[_0x1b13('0x81')](_0x1b13('0x85'),{'UserId':Number(_0x4dedc4['query'][_0x1b13('0x6b')][_0x4619f4]),'SmsQueueId':Number(_0x4dedc4[_0x1b13('0x47')]['id'])});}}else{socket[_0x1b13('0x81')]('userSmsQueue:remove',{'UserId':Number(_0x4dedc4[_0x1b13('0x34')][_0x1b13('0x6b')]),'SmsQueueId':Number(_0x4dedc4['params']['id'])});}});}})[_0x1b13('0x25')](respondWithStatusCode(_0x2111a3,null))['catch'](handleError(_0x2111a3,null));};exports['getAgents']=function(_0x37e054,_0x12286c,_0x520e3a){var _0x99fed3={};var _0x137a0d={};var _0x51374b;var _0x2a596e;return db[_0x1b13('0x42')][_0x1b13('0x55')]({'where':{'id':_0x37e054[_0x1b13('0x47')]['id']}})[_0x1b13('0x25')](handleEntityNotFound(_0x12286c,null))[_0x1b13('0x25')](function(_0x101c82){if(_0x101c82){_0x51374b=_0x101c82;_0x137a0d['model']=_[_0x1b13('0x30')](db['User'][_0x1b13('0x2d')]);_0x137a0d[_0x1b13('0x34')]=_[_0x1b13('0x30')](_0x37e054[_0x1b13('0x34')]);_0x137a0d['filters']=_[_0x1b13('0x32')](_0x137a0d[_0x1b13('0x33')],_0x137a0d[_0x1b13('0x34')]);_0x99fed3[_0x1b13('0x35')]=_[_0x1b13('0x32')](_0x137a0d[_0x1b13('0x33')],qs[_0x1b13('0x36')](_0x37e054[_0x1b13('0x34')][_0x1b13('0x36')]));_0x99fed3[_0x1b13('0x35')]=_0x99fed3[_0x1b13('0x35')]['length']?_0x99fed3[_0x1b13('0x35')]:_0x137a0d[_0x1b13('0x33')];_0x99fed3['order']=qs[_0x1b13('0x3b')](_0x37e054[_0x1b13('0x34')][_0x1b13('0x3b')]);_0x99fed3[_0x1b13('0x3c')]=qs[_0x1b13('0x31')](_[_0x1b13('0x3d')](_0x37e054[_0x1b13('0x34')],_0x137a0d['filters']));if(_0x37e054[_0x1b13('0x34')][_0x1b13('0x3e')]){_0x99fed3[_0x1b13('0x3c')]=_['merge'](_0x99fed3[_0x1b13('0x3c')],{'$or':_['map'](_0x99fed3['attributes'],function(_0x190061){var _0x1f5e0a={};_0x1f5e0a[_0x190061]={'$like':'%'+_0x37e054[_0x1b13('0x34')]['filter']+'%'};return _0x1f5e0a;})});}_0x99fed3=_[_0x1b13('0x40')]({},_0x99fed3,_0x37e054[_0x1b13('0x41')]);return _0x51374b[_0x1b13('0x86')](_0x99fed3);}})['then'](function(_0x1faf61){if(_0x1faf61){_0x2a596e=_0x1faf61['length'];if(!_0x37e054['query'][_0x1b13('0x38')](_0x1b13('0x39'))){_0x99fed3[_0x1b13('0x21')]=qs[_0x1b13('0x21')](_0x37e054[_0x1b13('0x34')][_0x1b13('0x21')]);_0x99fed3['offset']=qs[_0x1b13('0x1e')](_0x37e054[_0x1b13('0x34')][_0x1b13('0x1e')]);}return _0x51374b[_0x1b13('0x86')](_0x99fed3);}})['then'](function(_0x50dd38){if(_0x50dd38){return _0x50dd38?{'count':_0x2a596e,'rows':_0x50dd38}:null;}})[_0x1b13('0x25')](respondWithResult(_0x12286c,null))[_0x1b13('0x45')](handleError(_0x12286c,null));};
\ No newline at end of file
index df7232d..de73e16 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x30cb=['SmsQueue','setMaxListeners','save','update','remove','emit','hook','events'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0x30cb,0xb7));var _0xb30c=function(_0x5d11d3,_0x91dd5d){_0x5d11d3=_0x5d11d3-0x0;var _0x1f86f9=_0x30cb[_0x5d11d3];return _0x1f86f9;};'use strict';var EventEmitter=require(_0xb30c('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0xb30c('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xb30c('0x2')](0x0);var events={'afterCreate':_0xb30c('0x3'),'afterUpdate':_0xb30c('0x4'),'afterDestroy':_0xb30c('0x5')};function emitEvent(_0x52d7fe){return function(_0x240c8a,_0x33393c,_0x25d95d){SmsQueueEvents[_0xb30c('0x6')](_0x52d7fe+':'+_0x240c8a['id'],_0x240c8a);SmsQueueEvents[_0xb30c('0x6')](_0x52d7fe,_0x240c8a);_0x25d95d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0xb30c('0x7')](e,emitEvent(event));}}module['exports']=SmsQueueEvents;
\ No newline at end of file
+var _0x1242=['SmsQueue','setMaxListeners','save','update','remove','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x1242,0xcd));var _0x2124=function(_0x59130e,_0x5b4bb0){_0x59130e=_0x59130e-0x0;var _0x1fe51e=_0x1242[_0x59130e];return _0x1fe51e;};'use strict';var EventEmitter=require(_0x2124('0x0'));var SmsQueue=require(_0x2124('0x1'))['db'][_0x2124('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x2124('0x3')](0x0);var events={'afterCreate':_0x2124('0x4'),'afterUpdate':_0x2124('0x5'),'afterDestroy':_0x2124('0x6')};function emitEvent(_0x1fd98f){return function(_0x58f59d,_0x5c9003,_0x120f36){SmsQueueEvents['emit'](_0x1fd98f+':'+_0x58f59d['id'],_0x58f59d);SmsQueueEvents['emit'](_0x1fd98f,_0x58f59d);_0x120f36(null);};}for(var e in events){if(events[_0x2124('0x7')](e)){var event=events[e];SmsQueue[_0x2124('0x8')](e,emitEvent(event));}}module['exports']=SmsQueueEvents;
\ No newline at end of file
index c1ca27a..8601c90 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5646=['bluebird','path','rimraf','./smsQueue.attributes','exports','lodash','util','../../config/logger','api','moment'];(function(_0x519d24,_0x181f31){var _0x1a1fa5=function(_0x5ab6ca){while(--_0x5ab6ca){_0x519d24['push'](_0x519d24['shift']());}};_0x1a1fa5(++_0x181f31);}(_0x5646,0xcd));var _0x6564=function(_0x4c260a,_0x148241){_0x4c260a=_0x4c260a-0x0;var _0x17bbdd=_0x5646[_0x4c260a];return _0x17bbdd;};'use strict';var _=require(_0x6564('0x0'));var util=require(_0x6564('0x1'));var logger=require(_0x6564('0x2'))(_0x6564('0x3'));var moment=require(_0x6564('0x4'));var BPromise=require(_0x6564('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6564('0x6'));var rimraf=require(_0x6564('0x7'));var config=require('../../config/environment');var attributes=require(_0x6564('0x8'));module[_0x6564('0x9')]=function(_0x447126,_0x1d5907){return _0x447126['define']('SmsQueue',attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8dc=['util','../../config/logger','moment','request-promise','rimraf','define','SmsQueue','sms_queues','lodash'];(function(_0x151721,_0x20d5bc){var _0x2deaa7=function(_0x499812){while(--_0x499812){_0x151721['push'](_0x151721['shift']());}};_0x2deaa7(++_0x20d5bc);}(_0xd8dc,0x1a6));var _0xcd8d=function(_0x5cdae9,_0x5e30a9){_0x5cdae9=_0x5cdae9-0x0;var _0x417701=_0xd8dc[_0x5cdae9];return _0x417701;};'use strict';var _=require(_0xcd8d('0x0'));var util=require(_0xcd8d('0x1'));var logger=require(_0xcd8d('0x2'))('api');var moment=require(_0xcd8d('0x3'));var BPromise=require('bluebird');var rp=require(_0xcd8d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcd8d('0x5'));var config=require('../../config/environment');var attributes=require('./smsQueue.attributes');module['exports']=function(_0x46fdf2,_0x5cce72){return _0x46fdf2[_0xcd8d('0x6')](_0xcd8d('0x7'),attributes,{'tableName':_0xcd8d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3cabe94..03ea4e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf2b=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','request','info','SmsQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','GetSmsQueue','SmsQueue','findAll','options','raw','where','limit','include','map','attributes','model','then','catch','ShowSmsQueue'];(function(_0xc8bc46,_0x554ee3){var _0xc67cc=function(_0x4258cc){while(--_0x4258cc){_0xc8bc46['push'](_0xc8bc46['shift']());}};_0xc67cc(++_0x554ee3);}(_0xdf2b,0x168));var _0xbdf2=function(_0x550071,_0x9ba498){_0x550071=_0x550071-0x0;var _0x3c7b4c=_0xdf2b[_0x550071];return _0x3c7b4c;};'use strict';var _=require(_0xbdf2('0x0'));var util=require(_0xbdf2('0x1'));var moment=require(_0xbdf2('0x2'));var BPromise=require(_0xbdf2('0x3'));var rs=require(_0xbdf2('0x4'));var fs=require('fs');var Redis=require(_0xbdf2('0x5'));var db=require(_0xbdf2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xbdf2('0x7'))(_0xbdf2('0x8'));var config=require(_0xbdf2('0x9'));var jayson=require(_0xbdf2('0xa'));var client=jayson[_0xbdf2('0xb')]['http']({'port':0x232a});config[_0xbdf2('0xc')]=_[_0xbdf2('0xd')](config[_0xbdf2('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xbdf2('0xe'))(new Redis(config[_0xbdf2('0xc')]));require('./smsQueue.socket')[_0xbdf2('0xf')](socket);function respondWithRpcPromise(_0x4e7b38,_0x5b76c1,_0x45b85d){return new BPromise(function(_0x582b03,_0x202f84){return client[_0xbdf2('0x10')](_0x4e7b38,_0x45b85d)['then'](function(_0x3c05be){logger[_0xbdf2('0x11')](_0xbdf2('0x12'),_0x5b76c1,'request\x20sent');logger[_0xbdf2('0x13')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x5b76c1,_0xbdf2('0x14'),JSON[_0xbdf2('0x15')](_0x3c05be));if(_0x3c05be[_0xbdf2('0x16')]){if(_0x3c05be[_0xbdf2('0x16')][_0xbdf2('0x17')]===0x1f4){logger[_0xbdf2('0x16')](_0xbdf2('0x12'),_0x5b76c1,_0x3c05be[_0xbdf2('0x16')]['message']);return _0x202f84(_0x3c05be[_0xbdf2('0x16')][_0xbdf2('0x18')]);}logger[_0xbdf2('0x16')]('SmsQueue,\x20%s,\x20%s',_0x5b76c1,_0x3c05be[_0xbdf2('0x16')][_0xbdf2('0x18')]);return _0x582b03(_0x3c05be[_0xbdf2('0x16')][_0xbdf2('0x18')]);}else{logger[_0xbdf2('0x11')](_0xbdf2('0x12'),_0x5b76c1,_0xbdf2('0x14'));_0x582b03(_0x3c05be[_0xbdf2('0x19')][_0xbdf2('0x18')]);}})['catch'](function(_0x3ea7d1){logger[_0xbdf2('0x16')](_0xbdf2('0x12'),_0x5b76c1,_0x3ea7d1);_0x202f84(_0x3ea7d1);});});}exports[_0xbdf2('0x1a')]=function(_0x32692e){var _0x3812ec=this;return new Promise(function(_0x2430b4,_0x90927b){return db[_0xbdf2('0x1b')][_0xbdf2('0x1c')]({'raw':_0x32692e[_0xbdf2('0x1d')]?_0x32692e['options'][_0xbdf2('0x1e')]===undefined?!![]:![]:!![],'where':_0x32692e[_0xbdf2('0x1d')]?_0x32692e[_0xbdf2('0x1d')][_0xbdf2('0x1f')]||null:null,'attributes':_0x32692e['options']?_0x32692e[_0xbdf2('0x1d')]['attributes']||null:null,'limit':_0x32692e[_0xbdf2('0x1d')]?_0x32692e[_0xbdf2('0x1d')][_0xbdf2('0x20')]||null:null,'include':_0x32692e[_0xbdf2('0x1d')]?_0x32692e[_0xbdf2('0x1d')][_0xbdf2('0x21')]?_[_0xbdf2('0x22')](_0x32692e[_0xbdf2('0x1d')][_0xbdf2('0x21')],function(_0x11f268){return{'model':db[_0x11f268['model']],'as':_0x11f268['as'],'attributes':_0x11f268[_0xbdf2('0x23')],'include':_0x11f268['include']?_[_0xbdf2('0x22')](_0x11f268['include'],function(_0x3bbefb){return{'model':db[_0x3bbefb[_0xbdf2('0x24')]],'as':_0x3bbefb['as'],'attributes':_0x3bbefb[_0xbdf2('0x23')],'include':_0x3bbefb[_0xbdf2('0x21')]?_[_0xbdf2('0x22')](_0x3bbefb['include'],function(_0x475eb3){return{'model':db[_0x475eb3[_0xbdf2('0x24')]],'as':_0x475eb3['as'],'attributes':_0x475eb3['attributes']};}):[]};}):[]};}):[]:[]})[_0xbdf2('0x25')](function(_0x1717a8){logger[_0xbdf2('0x11')](_0xbdf2('0x1a'),_0x32692e);logger[_0xbdf2('0x13')]('GetSmsQueue',_0x32692e,JSON[_0xbdf2('0x15')](_0x1717a8));_0x2430b4(_0x1717a8);})[_0xbdf2('0x26')](function(_0x34d853){logger[_0xbdf2('0x16')](_0xbdf2('0x1a'),_0x34d853['message'],_0x32692e);_0x90927b(_0x3812ec[_0xbdf2('0x16')](0x1f4,_0x34d853[_0xbdf2('0x18')]));});});};exports[_0xbdf2('0x27')]=function(_0x45e068){var _0x2fef1a=this;return new Promise(function(_0x37a04f,_0x16c37c){return db[_0xbdf2('0x1b')]['find']({'raw':_0x45e068['options']?_0x45e068[_0xbdf2('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x45e068[_0xbdf2('0x1d')]?_0x45e068['options'][_0xbdf2('0x1f')]||null:null,'attributes':_0x45e068[_0xbdf2('0x1d')]?_0x45e068[_0xbdf2('0x1d')][_0xbdf2('0x23')]||null:null,'include':_0x45e068[_0xbdf2('0x1d')]?_0x45e068['options'][_0xbdf2('0x21')]?_[_0xbdf2('0x22')](_0x45e068[_0xbdf2('0x1d')][_0xbdf2('0x21')],function(_0x175cad){return{'model':db[_0x175cad['model']],'as':_0x175cad['as'],'attributes':_0x175cad[_0xbdf2('0x23')],'include':_0x175cad[_0xbdf2('0x21')]?_[_0xbdf2('0x22')](_0x175cad[_0xbdf2('0x21')],function(_0xe28dfe){return{'model':db[_0xe28dfe[_0xbdf2('0x24')]],'as':_0xe28dfe['as'],'attributes':_0xe28dfe['attributes'],'include':_0xe28dfe[_0xbdf2('0x21')]?_['map'](_0xe28dfe['include'],function(_0x3fd9f1){return{'model':db[_0x3fd9f1['model']],'as':_0x3fd9f1['as'],'attributes':_0x3fd9f1[_0xbdf2('0x23')]};}):[]};}):[]};}):[]:[]})[_0xbdf2('0x25')](function(_0x59b510){logger['info'](_0xbdf2('0x27'),_0x45e068);logger[_0xbdf2('0x13')](_0xbdf2('0x27'),_0x45e068,JSON[_0xbdf2('0x15')](_0x59b510));_0x37a04f(_0x59b510);})['catch'](function(_0x1adcd9){logger[_0xbdf2('0x16')](_0xbdf2('0x27'),_0x1adcd9['message'],_0x45e068);_0x16c37c(_0x2fef1a[_0xbdf2('0x16')](0x1f4,_0x1adcd9[_0xbdf2('0x18')]));});});};
\ No newline at end of file
+var _0xbc9e=['options','raw','where','attributes','limit','include','map','model','find','ShowSmsQueue','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetSmsQueue','SmsQueue','findAll'];(function(_0x56a871,_0x18b7fe){var _0x124954=function(_0x39b7a1){while(--_0x39b7a1){_0x56a871['push'](_0x56a871['shift']());}};_0x124954(++_0x18b7fe);}(_0xbc9e,0xaa));var _0xebc9=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xbc9e[_0x21549c];return _0x426cbd;};'use strict';var _=require(_0xebc9('0x0'));var util=require(_0xebc9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xebc9('0x2'))['db'];var utils=require(_0xebc9('0x3'));var logger=require(_0xebc9('0x4'))(_0xebc9('0x5'));var config=require('../../config/environment');var jayson=require(_0xebc9('0x6'));var client=jayson[_0xebc9('0x7')]['http']({'port':0x232a});config[_0xebc9('0x8')]=_[_0xebc9('0x9')](config[_0xebc9('0x8')],{'host':_0xebc9('0xa'),'port':0x18eb});var socket=require(_0xebc9('0xb'))(new Redis(config[_0xebc9('0x8')]));require(_0xebc9('0xc'))[_0xebc9('0xd')](socket);function respondWithRpcPromise(_0x5f3fda,_0x508c89,_0x365390){return new BPromise(function(_0x289dd7,_0x2b163d){return client[_0xebc9('0xe')](_0x5f3fda,_0x365390)[_0xebc9('0xf')](function(_0x46f5b0){logger['info'](_0xebc9('0x10'),_0x508c89,_0xebc9('0x11'));logger[_0xebc9('0x12')](_0xebc9('0x13'),_0x508c89,_0xebc9('0x11'),JSON[_0xebc9('0x14')](_0x46f5b0));if(_0x46f5b0['error']){if(_0x46f5b0[_0xebc9('0x15')][_0xebc9('0x16')]===0x1f4){logger[_0xebc9('0x15')](_0xebc9('0x10'),_0x508c89,_0x46f5b0['error']['message']);return _0x2b163d(_0x46f5b0[_0xebc9('0x15')][_0xebc9('0x17')]);}logger['error'](_0xebc9('0x10'),_0x508c89,_0x46f5b0[_0xebc9('0x15')][_0xebc9('0x17')]);return _0x289dd7(_0x46f5b0['error'][_0xebc9('0x17')]);}else{logger[_0xebc9('0x18')](_0xebc9('0x10'),_0x508c89,_0xebc9('0x11'));_0x289dd7(_0x46f5b0[_0xebc9('0x19')][_0xebc9('0x17')]);}})[_0xebc9('0x1a')](function(_0x24d06d){logger[_0xebc9('0x15')]('SmsQueue,\x20%s,\x20%s',_0x508c89,_0x24d06d);_0x2b163d(_0x24d06d);});});}exports[_0xebc9('0x1b')]=function(_0x3e49db){var _0x2b543c=this;return new Promise(function(_0x3c0014,_0x144875){return db[_0xebc9('0x1c')][_0xebc9('0x1d')]({'raw':_0x3e49db['options']?_0x3e49db[_0xebc9('0x1e')][_0xebc9('0x1f')]===undefined?!![]:![]:!![],'where':_0x3e49db[_0xebc9('0x1e')]?_0x3e49db['options'][_0xebc9('0x20')]||null:null,'attributes':_0x3e49db['options']?_0x3e49db[_0xebc9('0x1e')][_0xebc9('0x21')]||null:null,'limit':_0x3e49db[_0xebc9('0x1e')]?_0x3e49db['options'][_0xebc9('0x22')]||null:null,'include':_0x3e49db['options']?_0x3e49db[_0xebc9('0x1e')][_0xebc9('0x23')]?_[_0xebc9('0x24')](_0x3e49db[_0xebc9('0x1e')][_0xebc9('0x23')],function(_0x33856a){return{'model':db[_0x33856a['model']],'as':_0x33856a['as'],'attributes':_0x33856a[_0xebc9('0x21')],'include':_0x33856a[_0xebc9('0x23')]?_[_0xebc9('0x24')](_0x33856a[_0xebc9('0x23')],function(_0x31dd5d){return{'model':db[_0x31dd5d[_0xebc9('0x25')]],'as':_0x31dd5d['as'],'attributes':_0x31dd5d[_0xebc9('0x21')],'include':_0x31dd5d[_0xebc9('0x23')]?_['map'](_0x31dd5d[_0xebc9('0x23')],function(_0x14f25a){return{'model':db[_0x14f25a[_0xebc9('0x25')]],'as':_0x14f25a['as'],'attributes':_0x14f25a['attributes']};}):[]};}):[]};}):[]:[]})[_0xebc9('0xf')](function(_0x39e9d7){logger['info'](_0xebc9('0x1b'),_0x3e49db);logger[_0xebc9('0x12')](_0xebc9('0x1b'),_0x3e49db,JSON['stringify'](_0x39e9d7));_0x3c0014(_0x39e9d7);})['catch'](function(_0x4ed1f0){logger[_0xebc9('0x15')](_0xebc9('0x1b'),_0x4ed1f0[_0xebc9('0x17')],_0x3e49db);_0x144875(_0x2b543c['error'](0x1f4,_0x4ed1f0[_0xebc9('0x17')]));});});};exports['ShowSmsQueue']=function(_0x5aff76){var _0x1f190f=this;return new Promise(function(_0x56051f,_0x4ecd87){return db['SmsQueue'][_0xebc9('0x26')]({'raw':_0x5aff76[_0xebc9('0x1e')]?_0x5aff76[_0xebc9('0x1e')][_0xebc9('0x1f')]===undefined?!![]:![]:!![],'where':_0x5aff76[_0xebc9('0x1e')]?_0x5aff76[_0xebc9('0x1e')][_0xebc9('0x20')]||null:null,'attributes':_0x5aff76[_0xebc9('0x1e')]?_0x5aff76['options'][_0xebc9('0x21')]||null:null,'include':_0x5aff76[_0xebc9('0x1e')]?_0x5aff76[_0xebc9('0x1e')]['include']?_['map'](_0x5aff76[_0xebc9('0x1e')][_0xebc9('0x23')],function(_0xbe50a5){return{'model':db[_0xbe50a5[_0xebc9('0x25')]],'as':_0xbe50a5['as'],'attributes':_0xbe50a5['attributes'],'include':_0xbe50a5['include']?_[_0xebc9('0x24')](_0xbe50a5[_0xebc9('0x23')],function(_0x5d0eed){return{'model':db[_0x5d0eed[_0xebc9('0x25')]],'as':_0x5d0eed['as'],'attributes':_0x5d0eed[_0xebc9('0x21')],'include':_0x5d0eed[_0xebc9('0x23')]?_[_0xebc9('0x24')](_0x5d0eed['include'],function(_0x5b2597){return{'model':db[_0x5b2597[_0xebc9('0x25')]],'as':_0x5b2597['as'],'attributes':_0x5b2597[_0xebc9('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x488537){logger[_0xebc9('0x18')](_0xebc9('0x27'),_0x5aff76);logger['debug'](_0xebc9('0x27'),_0x5aff76,JSON[_0xebc9('0x14')](_0x488537));_0x56051f(_0x488537);})[_0xebc9('0x1a')](function(_0x37b3c9){logger[_0xebc9('0x15')](_0xebc9('0x27'),_0x37b3c9[_0xebc9('0x17')],_0x5aff76);_0x4ecd87(_0x1f190f[_0xebc9('0x15')](0x1f4,_0x37b3c9['message']));});});};
\ No newline at end of file
index 218b3e0..e50296a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc362=['emit','register','length','smsQueue:','./smsQueue.events','save','remove','update'];(function(_0x4ed3ee,_0x5bbe4f){var _0x5bafe2=function(_0x3d798b){while(--_0x3d798b){_0x4ed3ee['push'](_0x4ed3ee['shift']());}};_0x5bafe2(++_0x5bbe4f);}(_0xc362,0xc4));var _0x2c36=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc362[_0x3dd15e];return _0x231fd0;};'use strict';var SmsQueueEvents=require(_0x2c36('0x0'));var events=[_0x2c36('0x1'),_0x2c36('0x2'),_0x2c36('0x3')];function createListener(_0x4cfd5c,_0x5ddae4){return function(_0x2ad9b1){_0x5ddae4[_0x2c36('0x4')](_0x4cfd5c,_0x2ad9b1);};}function removeListener(_0x245878,_0x3fb4a9){return function(){SmsQueueEvents['removeListener'](_0x245878,_0x3fb4a9);};}exports[_0x2c36('0x5')]=function(_0x5d5644){for(var _0x240be1=0x0,_0x74b6e7=events[_0x2c36('0x6')];_0x240be1<_0x74b6e7;_0x240be1++){var _0x50060a=events[_0x240be1];var _0x53a1a3=createListener(_0x2c36('0x7')+_0x50060a,_0x5d5644);SmsQueueEvents['on'](_0x50060a,_0x53a1a3);}};
\ No newline at end of file
+var _0x38db=['smsQueue:','./smsQueue.events','save','emit','length'];(function(_0x19146b,_0x5d29ec){var _0x216fdd=function(_0x33a8dc){while(--_0x33a8dc){_0x19146b['push'](_0x19146b['shift']());}};_0x216fdd(++_0x5d29ec);}(_0x38db,0x1b9));var _0xb38d=function(_0x37281e,_0x3c643c){_0x37281e=_0x37281e-0x0;var _0x3a2386=_0x38db[_0x37281e];return _0x3a2386;};'use strict';var SmsQueueEvents=require(_0xb38d('0x0'));var events=[_0xb38d('0x1'),'remove','update'];function createListener(_0x4b6410,_0x495f13){return function(_0x13793f){_0x495f13[_0xb38d('0x2')](_0x4b6410,_0x13793f);};}function removeListener(_0x985214,_0x1ccb0f){return function(){SmsQueueEvents['removeListener'](_0x985214,_0x1ccb0f);};}exports['register']=function(_0x17c857){for(var _0x30540f=0x0,_0x38bbf9=events[_0xb38d('0x3')];_0x30540f<_0x38bbf9;_0x30540f++){var _0x3456c7=events[_0x30540f];var _0x15ec38=createListener(_0xb38d('0x4')+_0x3456c7,_0x17c857);SmsQueueEvents['on'](_0x3456c7,_0x15ec38);}};
\ No newline at end of file
index a1f4ac3..c1fdfec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x776f=['fs-extra','../../components/interaction/service','./smsQueueReport.controller','get','index','isAuthenticated','describe','/:id','post','create','put','update','delete','exports','path','connect-timeout','express','Router'];(function(_0x2b0b8a,_0x232980){var _0x492a12=function(_0x4a9705){while(--_0x4a9705){_0x2b0b8a['push'](_0x2b0b8a['shift']());}};_0x492a12(++_0x232980);}(_0x776f,0x68));var _0xf776=function(_0x3e8f4d,_0x2973ed){_0x3e8f4d=_0x3e8f4d-0x0;var _0x590a2e=_0x776f[_0x3e8f4d];return _0x590a2e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf776('0x0'));var timeout=require(_0xf776('0x1'));var express=require(_0xf776('0x2'));var router=express[_0xf776('0x3')]();var fs_extra=require(_0xf776('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf776('0x5'));var config=require('../../config/environment');var controller=require(_0xf776('0x6'));router[_0xf776('0x7')]('/',auth['isAuthenticated'](),controller[_0xf776('0x8')]);router[_0xf776('0x7')]('/describe',auth[_0xf776('0x9')](),controller[_0xf776('0xa')]);router['get'](_0xf776('0xb'),auth[_0xf776('0x9')](),controller['show']);router[_0xf776('0xc')]('/',auth['isAuthenticated'](),controller[_0xf776('0xd')]);router[_0xf776('0xe')](_0xf776('0xb'),auth[_0xf776('0x9')](),controller[_0xf776('0xf')]);router[_0xf776('0x10')]('/:id',auth[_0xf776('0x9')](),controller['destroy']);module[_0xf776('0x11')]=router;
\ No newline at end of file
+var _0x1a96=['destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete'];(function(_0x251f2c,_0x28085f){var _0x9f9def=function(_0x42dfc5){while(--_0x42dfc5){_0x251f2c['push'](_0x251f2c['shift']());}};_0x9f9def(++_0x28085f);}(_0x1a96,0x1a3));var _0x61a9=function(_0x14b568,_0x535f78){_0x14b568=_0x14b568-0x0;var _0x4191d9=_0x1a96[_0x14b568];return _0x4191d9;};'use strict';var multer=require(_0x61a9('0x0'));var util=require(_0x61a9('0x1'));var path=require(_0x61a9('0x2'));var timeout=require(_0x61a9('0x3'));var express=require('express');var router=express[_0x61a9('0x4')]();var fs_extra=require(_0x61a9('0x5'));var auth=require(_0x61a9('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x61a9('0x7'));var controller=require(_0x61a9('0x8'));router[_0x61a9('0x9')]('/',auth[_0x61a9('0xa')](),controller[_0x61a9('0xb')]);router['get'](_0x61a9('0xc'),auth[_0x61a9('0xa')](),controller[_0x61a9('0xd')]);router[_0x61a9('0x9')](_0x61a9('0xe'),auth['isAuthenticated'](),controller[_0x61a9('0xf')]);router[_0x61a9('0x10')]('/',auth[_0x61a9('0xa')](),controller[_0x61a9('0x11')]);router[_0x61a9('0x12')](_0x61a9('0xe'),auth[_0x61a9('0xa')](),controller[_0x61a9('0x13')]);router[_0x61a9('0x14')](_0x61a9('0xe'),auth['isAuthenticated'](),controller[_0x61a9('0x15')]);module['exports']=router;
\ No newline at end of file
index 49f3a98..7cd58bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3dff=['STRING','DATE'];(function(_0x3b6833,_0x235a55){var _0x56c54f=function(_0x54bb18){while(--_0x54bb18){_0x3b6833['push'](_0x3b6833['shift']());}};_0x56c54f(++_0x235a55);}(_0x3dff,0x1bc));var _0xf3df=function(_0x6fdb05,_0x126f86){_0x6fdb05=_0x6fdb05-0x0;var _0x400f4f=_0x3dff[_0x6fdb05];return _0x400f4f;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xf3df('0x0')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xf3df('0x1')]},'leaveAt':{'type':Sequelize[_0xf3df('0x1')]},'acceptAt':{'type':Sequelize[_0xf3df('0x1')]},'exitAt':{'type':Sequelize[_0xf3df('0x1')]},'reason':{'type':Sequelize[_0xf3df('0x0')]}};
\ No newline at end of file
+var _0x474f=['moment','exports','STRING','DATE'];(function(_0x33c699,_0x25d26a){var _0x1e9db9=function(_0x59cac0){while(--_0x59cac0){_0x33c699['push'](_0x33c699['shift']());}};_0x1e9db9(++_0x25d26a);}(_0x474f,0xac));var _0xf474=function(_0xf888d4,_0x103b6b){_0xf888d4=_0xf888d4-0x0;var _0x1ccc12=_0x474f[_0xf888d4];return _0x1ccc12;};'use strict';var moment=require(_0xf474('0x0'));var Sequelize=require('sequelize');module[_0xf474('0x1')]={'uniqueid':{'type':Sequelize[_0xf474('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xf474('0x2')]},'joinAt':{'type':Sequelize[_0xf474('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xf474('0x3')]},'reason':{'type':Sequelize[_0xf474('0x2')]}};
\ No newline at end of file
index e8c5083..93ea10e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc25a=['show','params','find','create','body','catch','destroy','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','end','error','name','send','map','rawAttributes','fieldName','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','SmsQueueReport','includeAll','include','rows'];(function(_0x575057,_0x14baf3){var _0x49dbc8=function(_0x23599a){while(--_0x23599a){_0x575057['push'](_0x575057['shift']());}};_0x49dbc8(++_0x14baf3);}(_0xc25a,0x13c));var _0xac25=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xc25a[_0x4c12ec];return _0x3ae42c;};'use strict';var emlformat=require(_0xac25('0x0'));var rimraf=require(_0xac25('0x1'));var zipdir=require(_0xac25('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xac25('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xac25('0x4'));var util=require(_0xac25('0x5'));var path=require(_0xac25('0x6'));var sox=require(_0xac25('0x7'));var csv=require(_0xac25('0x8'));var ejs=require(_0xac25('0x9'));var fs=require('fs');var fs_extra=require(_0xac25('0xa'));var _=require('lodash');var squel=require(_0xac25('0xb'));var crypto=require(_0xac25('0xc'));var jsforce=require(_0xac25('0xd'));var deskjs=require(_0xac25('0xe'));var toCsv=require(_0xac25('0x8'));var querystring=require(_0xac25('0xf'));var Papa=require(_0xac25('0x10'));var Redis=require(_0xac25('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xac25('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xac25('0x13'))(_0xac25('0x14'));var utils=require(_0xac25('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xac25('0x16'));var db=require(_0xac25('0x17'))['db'];function respondWithStatusCode(_0xaa12,_0x830b36){_0x830b36=_0x830b36||0xcc;return function(_0x20966c){if(_0x20966c){return _0xaa12[_0xac25('0x18')](_0x830b36);}return _0xaa12[_0xac25('0x19')](_0x830b36)['end']();};}function respondWithResult(_0x233acd,_0x430f19){_0x430f19=_0x430f19||0xc8;return function(_0x282c86){if(_0x282c86){return _0x233acd[_0xac25('0x19')](_0x430f19)[_0xac25('0x1a')](_0x282c86);}};}function respondWithFilteredResult(_0xc226ed,_0x5d6254){return function(_0x33499b){if(_0x33499b){var _0x4eadef=typeof _0x5d6254[_0xac25('0x1b')]===_0xac25('0x1c')&&typeof _0x5d6254['limit']===_0xac25('0x1c');var _0x824b9f=_0x33499b[_0xac25('0x1d')];var _0x3054bf=_0x4eadef?0x0:_0x5d6254[_0xac25('0x1b')];var _0x2d514b=_0x4eadef?_0x33499b['count']:_0x5d6254[_0xac25('0x1b')]+_0x5d6254[_0xac25('0x1e')];var _0x6f697f;if(_0x2d514b>=_0x824b9f){_0x2d514b=_0x824b9f;_0x6f697f=0xc8;}else{_0x6f697f=0xce;}_0xc226ed[_0xac25('0x19')](_0x6f697f);return _0xc226ed[_0xac25('0x1f')](_0xac25('0x20'),_0x3054bf+'-'+_0x2d514b+'/'+_0x824b9f)['json'](_0x33499b);}return null;};}function patchUpdates(_0x168ab6){return function(_0x591e6c){try{jsonpatch[_0xac25('0x21')](_0x591e6c,_0x168ab6,!![]);}catch(_0x392820){return BPromise[_0xac25('0x22')](_0x392820);}return _0x591e6c[_0xac25('0x23')]();};}function saveUpdates(_0x3530dc,_0x13c889){return function(_0x237a16){if(_0x237a16){return _0x237a16[_0xac25('0x24')](_0x3530dc)[_0xac25('0x25')](function(_0x37c17e){return _0x37c17e;});}return null;};}function removeEntity(_0x3b9cac,_0x36188b){return function(_0x2d6fe8){if(_0x2d6fe8){return _0x2d6fe8['destroy']()[_0xac25('0x25')](function(){_0x3b9cac[_0xac25('0x19')](0xcc)[_0xac25('0x26')]();});}};}function handleEntityNotFound(_0x20fe97,_0x3e5c28){return function(_0x712067){if(!_0x712067){_0x20fe97[_0xac25('0x18')](0x194);}return _0x712067;};}function handleError(_0x27060c,_0x13b7b9){_0x13b7b9=_0x13b7b9||0x1f4;return function(_0x4fc0af){logger[_0xac25('0x27')](_0x4fc0af['stack']);if(_0x4fc0af[_0xac25('0x28')]){delete _0x4fc0af[_0xac25('0x28')];}_0x27060c[_0xac25('0x19')](_0x13b7b9)[_0xac25('0x29')](_0x4fc0af);};}exports['index']=function(_0x2db825,_0x2e1631){var _0x5298fa={},_0x4dcaff={},_0x351fd3={'count':0x0,'rows':[]};var _0x212abc=_[_0xac25('0x2a')](db['SmsQueueReport'][_0xac25('0x2b')],function(_0x46d1d4){return{'name':_0x46d1d4[_0xac25('0x2c')],'type':_0x46d1d4['type'][_0xac25('0x2d')]};});_0x4dcaff['model']=_[_0xac25('0x2a')](_0x212abc,'name');_0x4dcaff['query']=_[_0xac25('0x2e')](_0x2db825[_0xac25('0x2f')]);_0x4dcaff[_0xac25('0x30')]=_[_0xac25('0x31')](_0x4dcaff['model'],_0x4dcaff['query']);_0x5298fa[_0xac25('0x32')]=_['intersection'](_0x4dcaff[_0xac25('0x33')],qs[_0xac25('0x34')](_0x2db825['query']['fields']));_0x5298fa[_0xac25('0x32')]=_0x5298fa[_0xac25('0x32')][_0xac25('0x35')]?_0x5298fa[_0xac25('0x32')]:_0x4dcaff[_0xac25('0x33')];if(!_0x2db825[_0xac25('0x2f')][_0xac25('0x36')](_0xac25('0x37'))){_0x5298fa[_0xac25('0x1e')]=qs[_0xac25('0x1e')](_0x2db825['query'][_0xac25('0x1e')]);_0x5298fa[_0xac25('0x1b')]=qs[_0xac25('0x1b')](_0x2db825[_0xac25('0x2f')]['offset']);}_0x5298fa[_0xac25('0x38')]=qs['sort'](_0x2db825['query'][_0xac25('0x39')]);_0x5298fa[_0xac25('0x3a')]=qs[_0xac25('0x30')](_[_0xac25('0x3b')](_0x2db825['query'],_0x4dcaff['filters']),_0x212abc);if(_0x2db825[_0xac25('0x2f')][_0xac25('0x3c')]){_0x5298fa[_0xac25('0x3a')]=_[_0xac25('0x3d')](_0x5298fa[_0xac25('0x3a')],{'$or':_[_0xac25('0x2a')](_0x212abc,function(_0x436e20){if(_0x436e20[_0xac25('0x3e')]!==_0xac25('0x3f')){var _0x428463={};_0x428463[_0x436e20[_0xac25('0x28')]]={'$like':'%'+_0x2db825[_0xac25('0x2f')][_0xac25('0x3c')]+'%'};return _0x428463;}})});}_0x5298fa=_[_0xac25('0x3d')]({},_0x5298fa,_0x2db825[_0xac25('0x40')]);var _0x5430b5={'where':_0x5298fa['where']};return db[_0xac25('0x41')][_0xac25('0x1d')](_0x5430b5)[_0xac25('0x25')](function(_0x2d2761){_0x351fd3[_0xac25('0x1d')]=_0x2d2761;if(_0x2db825[_0xac25('0x2f')][_0xac25('0x42')]){_0x5298fa[_0xac25('0x43')]=[{'all':!![]}];}return db['SmsQueueReport']['findAll'](_0x5298fa);})[_0xac25('0x25')](function(_0x2d8074){_0x351fd3[_0xac25('0x44')]=_0x2d8074;return _0x351fd3;})[_0xac25('0x25')](respondWithFilteredResult(_0x2e1631,_0x5298fa))['catch'](handleError(_0x2e1631,null));};exports[_0xac25('0x45')]=function(_0x541452,_0x13ac45){var _0x1dfeb1={'raw':!![],'where':{'id':_0x541452[_0xac25('0x46')]['id']}},_0x5339f7={};_0x5339f7['model']=_[_0xac25('0x2e')](db[_0xac25('0x41')][_0xac25('0x2b')]);_0x5339f7[_0xac25('0x2f')]=_['keys'](_0x541452['query']);_0x5339f7['filters']=_[_0xac25('0x31')](_0x5339f7[_0xac25('0x33')],_0x5339f7[_0xac25('0x2f')]);_0x1dfeb1[_0xac25('0x32')]=_[_0xac25('0x31')](_0x5339f7['model'],qs[_0xac25('0x34')](_0x541452['query'][_0xac25('0x34')]));_0x1dfeb1[_0xac25('0x32')]=_0x1dfeb1[_0xac25('0x32')][_0xac25('0x35')]?_0x1dfeb1['attributes']:_0x5339f7['model'];if(_0x541452[_0xac25('0x2f')][_0xac25('0x42')]){_0x1dfeb1[_0xac25('0x43')]=[{'all':!![]}];}_0x1dfeb1=_[_0xac25('0x3d')]({},_0x1dfeb1,_0x541452[_0xac25('0x40')]);return db[_0xac25('0x41')][_0xac25('0x47')](_0x1dfeb1)[_0xac25('0x25')](handleEntityNotFound(_0x13ac45,null))[_0xac25('0x25')](respondWithResult(_0x13ac45,null))['catch'](handleError(_0x13ac45,null));};exports[_0xac25('0x48')]=function(_0x159e3d,_0x3ee394){return db[_0xac25('0x41')][_0xac25('0x48')](_0x159e3d[_0xac25('0x49')],{})['then'](respondWithResult(_0x3ee394,0xc9))['catch'](handleError(_0x3ee394,null));};exports[_0xac25('0x24')]=function(_0x3a0c02,_0x24f42d){if(_0x3a0c02[_0xac25('0x49')]['id']){delete _0x3a0c02[_0xac25('0x49')]['id'];}return db[_0xac25('0x41')][_0xac25('0x47')]({'where':{'id':_0x3a0c02[_0xac25('0x46')]['id']}})[_0xac25('0x25')](handleEntityNotFound(_0x24f42d,null))[_0xac25('0x25')](saveUpdates(_0x3a0c02['body'],null))['then'](respondWithResult(_0x24f42d,null))[_0xac25('0x4a')](handleError(_0x24f42d,null));};exports[_0xac25('0x4b')]=function(_0x50ad94,_0x49a3db){return db[_0xac25('0x41')]['find']({'where':{'id':_0x50ad94[_0xac25('0x46')]['id']}})[_0xac25('0x25')](handleEntityNotFound(_0x49a3db,null))[_0xac25('0x25')](removeEntity(_0x49a3db,null))[_0xac25('0x4a')](handleError(_0x49a3db,null));};exports[_0xac25('0x4c')]=function(_0xe4795b,_0x29844b){return db['SmsQueueReport'][_0xac25('0x4c')]()[_0xac25('0x25')](respondWithResult(_0x29844b,null))['catch'](handleError(_0x29844b,null));};
\ No newline at end of file
+var _0x3733=['sendStatus','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','SmsQueueReport','includeAll','include','findAll','rows','catch','show','rawAttributes','create','body','find','params','describe','eml-format','moment','util','path','sox','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','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x3733,0xc2));var _0x3373=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3733[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x3373('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3373('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3373('0x2'));var path=require(_0x3373('0x3'));var sox=require(_0x3373('0x4'));var csv=require('to-csv');var ejs=require(_0x3373('0x5'));var fs=require('fs');var fs_extra=require(_0x3373('0x6'));var _=require(_0x3373('0x7'));var squel=require(_0x3373('0x8'));var crypto=require('crypto');var jsforce=require(_0x3373('0x9'));var deskjs=require(_0x3373('0xa'));var toCsv=require('to-csv');var querystring=require(_0x3373('0xb'));var Papa=require(_0x3373('0xc'));var Redis=require(_0x3373('0xd'));var authService=require(_0x3373('0xe'));var qs=require(_0x3373('0xf'));var as=require(_0x3373('0x10'));var hardwareService=require(_0x3373('0x11'));var logger=require(_0x3373('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x3373('0x13'));var licenseUtil=require(_0x3373('0x14'));var db=require(_0x3373('0x15'))['db'];function respondWithStatusCode(_0x1327d3,_0x2bc629){_0x2bc629=_0x2bc629||0xcc;return function(_0xcdd652){if(_0xcdd652){return _0x1327d3[_0x3373('0x16')](_0x2bc629);}return _0x1327d3['status'](_0x2bc629)['end']();};}function respondWithResult(_0x2edc4f,_0xe5e6cf){_0xe5e6cf=_0xe5e6cf||0xc8;return function(_0x201705){if(_0x201705){return _0x2edc4f['status'](_0xe5e6cf)[_0x3373('0x17')](_0x201705);}};}function respondWithFilteredResult(_0x2de965,_0x3c117c){return function(_0x4b229f){if(_0x4b229f){var _0x47c6dc=typeof _0x3c117c[_0x3373('0x18')]===_0x3373('0x19')&&typeof _0x3c117c[_0x3373('0x1a')]===_0x3373('0x19');var _0x210672=_0x4b229f[_0x3373('0x1b')];var _0x37fcd1=_0x47c6dc?0x0:_0x3c117c['offset'];var _0x8b986a=_0x47c6dc?_0x4b229f['count']:_0x3c117c[_0x3373('0x18')]+_0x3c117c[_0x3373('0x1a')];var _0x1ca93d;if(_0x8b986a>=_0x210672){_0x8b986a=_0x210672;_0x1ca93d=0xc8;}else{_0x1ca93d=0xce;}_0x2de965[_0x3373('0x1c')](_0x1ca93d);return _0x2de965['set'](_0x3373('0x1d'),_0x37fcd1+'-'+_0x8b986a+'/'+_0x210672)[_0x3373('0x17')](_0x4b229f);}return null;};}function patchUpdates(_0x4db385){return function(_0x3bc1eb){try{jsonpatch[_0x3373('0x1e')](_0x3bc1eb,_0x4db385,!![]);}catch(_0x57e382){return BPromise[_0x3373('0x1f')](_0x57e382);}return _0x3bc1eb[_0x3373('0x20')]();};}function saveUpdates(_0x5ccabe,_0x4f964c){return function(_0x328e9c){if(_0x328e9c){return _0x328e9c[_0x3373('0x21')](_0x5ccabe)[_0x3373('0x22')](function(_0x5e03b2){return _0x5e03b2;});}return null;};}function removeEntity(_0x7fae72,_0x459116){return function(_0x13cc2d){if(_0x13cc2d){return _0x13cc2d[_0x3373('0x23')]()[_0x3373('0x22')](function(){_0x7fae72[_0x3373('0x1c')](0xcc)[_0x3373('0x24')]();});}};}function handleEntityNotFound(_0x283e21,_0x267670){return function(_0x20dd91){if(!_0x20dd91){_0x283e21[_0x3373('0x16')](0x194);}return _0x20dd91;};}function handleError(_0x24aa4b,_0x31d540){_0x31d540=_0x31d540||0x1f4;return function(_0x543da9){logger[_0x3373('0x25')](_0x543da9['stack']);if(_0x543da9[_0x3373('0x26')]){delete _0x543da9[_0x3373('0x26')];}_0x24aa4b[_0x3373('0x1c')](_0x31d540)[_0x3373('0x27')](_0x543da9);};}exports[_0x3373('0x28')]=function(_0x341705,_0x3bafc){var _0xa21866={},_0x54b4e5={},_0x14aab7={'count':0x0,'rows':[]};var _0x51ef7e=_['map'](db['SmsQueueReport']['rawAttributes'],function(_0x5c1774){return{'name':_0x5c1774[_0x3373('0x29')],'type':_0x5c1774[_0x3373('0x2a')][_0x3373('0x2b')]};});_0x54b4e5[_0x3373('0x2c')]=_['map'](_0x51ef7e,_0x3373('0x26'));_0x54b4e5[_0x3373('0x2d')]=_[_0x3373('0x2e')](_0x341705['query']);_0x54b4e5[_0x3373('0x2f')]=_['intersection'](_0x54b4e5[_0x3373('0x2c')],_0x54b4e5[_0x3373('0x2d')]);_0xa21866[_0x3373('0x30')]=_[_0x3373('0x31')](_0x54b4e5[_0x3373('0x2c')],qs[_0x3373('0x32')](_0x341705['query'][_0x3373('0x32')]));_0xa21866[_0x3373('0x30')]=_0xa21866[_0x3373('0x30')][_0x3373('0x33')]?_0xa21866['attributes']:_0x54b4e5[_0x3373('0x2c')];if(!_0x341705[_0x3373('0x2d')]['hasOwnProperty']('nolimit')){_0xa21866[_0x3373('0x1a')]=qs[_0x3373('0x1a')](_0x341705['query'][_0x3373('0x1a')]);_0xa21866['offset']=qs[_0x3373('0x18')](_0x341705[_0x3373('0x2d')][_0x3373('0x18')]);}_0xa21866[_0x3373('0x34')]=qs[_0x3373('0x35')](_0x341705[_0x3373('0x2d')]['sort']);_0xa21866[_0x3373('0x36')]=qs[_0x3373('0x2f')](_[_0x3373('0x37')](_0x341705[_0x3373('0x2d')],_0x54b4e5[_0x3373('0x2f')]),_0x51ef7e);if(_0x341705[_0x3373('0x2d')][_0x3373('0x38')]){_0xa21866[_0x3373('0x36')]=_['merge'](_0xa21866[_0x3373('0x36')],{'$or':_['map'](_0x51ef7e,function(_0x5d3952){if(_0x5d3952[_0x3373('0x2a')]!==_0x3373('0x39')){var _0x4c6b86={};_0x4c6b86[_0x5d3952[_0x3373('0x26')]]={'$like':'%'+_0x341705[_0x3373('0x2d')][_0x3373('0x38')]+'%'};return _0x4c6b86;}})});}_0xa21866=_[_0x3373('0x3a')]({},_0xa21866,_0x341705['options']);var _0x54782b={'where':_0xa21866[_0x3373('0x36')]};return db[_0x3373('0x3b')][_0x3373('0x1b')](_0x54782b)[_0x3373('0x22')](function(_0x178ea2){_0x14aab7['count']=_0x178ea2;if(_0x341705[_0x3373('0x2d')][_0x3373('0x3c')]){_0xa21866[_0x3373('0x3d')]=[{'all':!![]}];}return db[_0x3373('0x3b')][_0x3373('0x3e')](_0xa21866);})[_0x3373('0x22')](function(_0x24ef48){_0x14aab7[_0x3373('0x3f')]=_0x24ef48;return _0x14aab7;})[_0x3373('0x22')](respondWithFilteredResult(_0x3bafc,_0xa21866))[_0x3373('0x40')](handleError(_0x3bafc,null));};exports[_0x3373('0x41')]=function(_0x43020c,_0x35a833){var _0x596c77={'raw':!![],'where':{'id':_0x43020c['params']['id']}},_0x252a5d={};_0x252a5d[_0x3373('0x2c')]=_[_0x3373('0x2e')](db[_0x3373('0x3b')][_0x3373('0x42')]);_0x252a5d[_0x3373('0x2d')]=_[_0x3373('0x2e')](_0x43020c[_0x3373('0x2d')]);_0x252a5d['filters']=_[_0x3373('0x31')](_0x252a5d[_0x3373('0x2c')],_0x252a5d[_0x3373('0x2d')]);_0x596c77[_0x3373('0x30')]=_['intersection'](_0x252a5d[_0x3373('0x2c')],qs[_0x3373('0x32')](_0x43020c[_0x3373('0x2d')][_0x3373('0x32')]));_0x596c77['attributes']=_0x596c77[_0x3373('0x30')][_0x3373('0x33')]?_0x596c77[_0x3373('0x30')]:_0x252a5d[_0x3373('0x2c')];if(_0x43020c['query']['includeAll']){_0x596c77[_0x3373('0x3d')]=[{'all':!![]}];}_0x596c77=_[_0x3373('0x3a')]({},_0x596c77,_0x43020c['options']);return db[_0x3373('0x3b')]['find'](_0x596c77)[_0x3373('0x22')](handleEntityNotFound(_0x35a833,null))[_0x3373('0x22')](respondWithResult(_0x35a833,null))[_0x3373('0x40')](handleError(_0x35a833,null));};exports[_0x3373('0x43')]=function(_0x5c3af9,_0x1cf396){return db[_0x3373('0x3b')][_0x3373('0x43')](_0x5c3af9[_0x3373('0x44')],{})[_0x3373('0x22')](respondWithResult(_0x1cf396,0xc9))[_0x3373('0x40')](handleError(_0x1cf396,null));};exports[_0x3373('0x21')]=function(_0x10c577,_0x3a3988){if(_0x10c577[_0x3373('0x44')]['id']){delete _0x10c577[_0x3373('0x44')]['id'];}return db[_0x3373('0x3b')][_0x3373('0x45')]({'where':{'id':_0x10c577[_0x3373('0x46')]['id']}})['then'](handleEntityNotFound(_0x3a3988,null))[_0x3373('0x22')](saveUpdates(_0x10c577[_0x3373('0x44')],null))[_0x3373('0x22')](respondWithResult(_0x3a3988,null))[_0x3373('0x40')](handleError(_0x3a3988,null));};exports[_0x3373('0x23')]=function(_0x591b97,_0x5efebc){return db[_0x3373('0x3b')][_0x3373('0x45')]({'where':{'id':_0x591b97[_0x3373('0x46')]['id']}})[_0x3373('0x22')](handleEntityNotFound(_0x5efebc,null))[_0x3373('0x22')](removeEntity(_0x5efebc,null))[_0x3373('0x40')](handleError(_0x5efebc,null));};exports[_0x3373('0x47')]=function(_0x29341c,_0x4687f5){return db['SmsQueueReport'][_0x3373('0x47')]()['then'](respondWithResult(_0x4687f5,null))[_0x3373('0x40')](handleError(_0x4687f5,null));};
\ No newline at end of file
index 0b488b6..5531f44 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['util','../../config/logger','bluebird','request-promise','path','rimraf','./smsQueueReport.attributes','report_sms_queue','uniqueid','lodash'];(function(_0x2b9fde,_0x40d273){var _0xda9dd7=function(_0x10f441){while(--_0x10f441){_0x2b9fde['push'](_0x2b9fde['shift']());}};_0xda9dd7(++_0x40d273);}(_0x70e0,0x17b));var _0x070e=function(_0x318e91,_0x3b4416){_0x318e91=_0x318e91-0x0;var _0x44fa35=_0x70e0[_0x318e91];return _0x44fa35;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x070e('0x3'));var rp=require(_0x070e('0x4'));var fs=require('fs');var path=require(_0x070e('0x5'));var rimraf=require(_0x070e('0x6'));var config=require('../../config/environment');var attributes=require(_0x070e('0x7'));module['exports']=function(_0x46fe68,_0x4b041d){return _0x46fe68['define']('SmsQueueReport',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[{'name':_0x070e('0x9'),'fields':[_0x070e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x52193c,_0x16ab99){var _0x293ef1=function(_0x37af70){while(--_0x37af70){_0x52193c['push'](_0x52193c['shift']());}};_0x293ef1(++_0x16ab99);}(_0xb7e7,0x121));var _0x7b7e=function(_0x46d0c9,_0x526bfa){_0x46d0c9=_0x46d0c9-0x0;var _0x174506=_0xb7e7[_0x46d0c9];return _0x174506;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index efadfcd..7b9c485 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0161=['limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateSmsQueueReport','create','body','options','stringify','UpdateSmsQueueReport','SmsQueueReport','update','where','attributes'];(function(_0x4e2861,_0x199be0){var _0x2265e3=function(_0x469693){while(--_0x469693){_0x4e2861['push'](_0x4e2861['shift']());}};_0x2265e3(++_0x199be0);}(_0x0161,0x1c8));var _0x1016=function(_0x21a7ee,_0x3726d3){_0x21a7ee=_0x21a7ee-0x0;var _0x3257ce=_0x0161[_0x21a7ee];return _0x3257ce;};'use strict';var _=require(_0x1016('0x0'));var util=require(_0x1016('0x1'));var moment=require(_0x1016('0x2'));var BPromise=require(_0x1016('0x3'));var rs=require(_0x1016('0x4'));var fs=require('fs');var Redis=require(_0x1016('0x5'));var db=require(_0x1016('0x6'))['db'];var utils=require(_0x1016('0x7'));var logger=require(_0x1016('0x8'))(_0x1016('0x9'));var config=require(_0x1016('0xa'));var jayson=require(_0x1016('0xb'));var client=jayson[_0x1016('0xc')][_0x1016('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2ab644,_0x514b78,_0xbcb67f){return new BPromise(function(_0x410f7c,_0x52372d){return client['request'](_0x2ab644,_0xbcb67f)[_0x1016('0xe')](function(_0x444f27){logger[_0x1016('0xf')](_0x1016('0x10'),_0x514b78,'request\x20sent');logger[_0x1016('0x11')](_0x1016('0x12'),_0x514b78,_0x1016('0x13'),JSON['stringify'](_0x444f27));if(_0x444f27[_0x1016('0x14')]){if(_0x444f27['error']['code']===0x1f4){logger[_0x1016('0x14')](_0x1016('0x10'),_0x514b78,_0x444f27[_0x1016('0x14')][_0x1016('0x15')]);return _0x52372d(_0x444f27[_0x1016('0x14')][_0x1016('0x15')]);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x514b78,_0x444f27[_0x1016('0x14')][_0x1016('0x15')]);return _0x410f7c(_0x444f27[_0x1016('0x14')]['message']);}else{logger[_0x1016('0xf')](_0x1016('0x10'),_0x514b78,_0x1016('0x13'));_0x410f7c(_0x444f27[_0x1016('0x16')][_0x1016('0x15')]);}})[_0x1016('0x17')](function(_0x576849){logger[_0x1016('0x14')](_0x1016('0x10'),_0x514b78,_0x576849);_0x52372d(_0x576849);});});}exports[_0x1016('0x18')]=function(_0x509bf3){var _0x3c78bb=this;return new Promise(function(_0x145245,_0xc5ce08){return db['SmsQueueReport'][_0x1016('0x19')](_0x509bf3[_0x1016('0x1a')],{'raw':_0x509bf3[_0x1016('0x1b')]?_0x509bf3[_0x1016('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x53c6f8){logger[_0x1016('0xf')]('CreateSmsQueueReport',_0x509bf3);logger['debug']('CreateSmsQueueReport',_0x509bf3,JSON[_0x1016('0x1c')](_0x53c6f8));_0x145245(_0x53c6f8);})[_0x1016('0x17')](function(_0x2b1ae7){logger[_0x1016('0x14')](_0x1016('0x18'),_0x2b1ae7[_0x1016('0x15')],_0x509bf3);_0xc5ce08(_0x3c78bb[_0x1016('0x14')](0x1f4,_0x2b1ae7['message']));});});};exports[_0x1016('0x1d')]=function(_0x105d2f){var _0x569b28=this;return new Promise(function(_0xe6c79c,_0xdd82c5){return db[_0x1016('0x1e')][_0x1016('0x1f')](_0x105d2f[_0x1016('0x1a')],{'raw':_0x105d2f['options']?_0x105d2f[_0x1016('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x105d2f[_0x1016('0x1b')]?_0x105d2f['options'][_0x1016('0x20')]||null:null,'attributes':_0x105d2f[_0x1016('0x1b')]?_0x105d2f['options'][_0x1016('0x21')]||null:null,'limit':_0x105d2f[_0x1016('0x1b')]?_0x105d2f[_0x1016('0x1b')][_0x1016('0x22')]||null:null})['then'](function(_0x54f2a7){logger[_0x1016('0xf')](_0x1016('0x1d'),_0x105d2f);logger[_0x1016('0x11')](_0x1016('0x1d'),_0x105d2f,JSON[_0x1016('0x1c')](_0x54f2a7));_0xe6c79c(_0x54f2a7);})[_0x1016('0x17')](function(_0x39d83c){logger[_0x1016('0x14')](_0x1016('0x1d'),_0x39d83c[_0x1016('0x15')],_0x105d2f);_0xdd82c5(_0x569b28[_0x1016('0x14')](0x1f4,_0x39d83c['message']));});});};
\ No newline at end of file
+var _0x801c=['limit','UpdateSmsQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','body','options','raw','stringify','attributes'];(function(_0xaef3f,_0x1f3c49){var _0x5383c6=function(_0x15bbc8){while(--_0x15bbc8){_0xaef3f['push'](_0xaef3f['shift']());}};_0x5383c6(++_0x1f3c49);}(_0x801c,0x183));var _0xc801=function(_0x116125,_0x5188e0){_0x116125=_0x116125-0x0;var _0x5d6669=_0x801c[_0x116125];return _0x5d6669;};'use strict';var _=require(_0xc801('0x0'));var util=require(_0xc801('0x1'));var moment=require(_0xc801('0x2'));var BPromise=require(_0xc801('0x3'));var rs=require(_0xc801('0x4'));var fs=require('fs');var Redis=require(_0xc801('0x5'));var db=require(_0xc801('0x6'))['db'];var utils=require(_0xc801('0x7'));var logger=require(_0xc801('0x8'))(_0xc801('0x9'));var config=require(_0xc801('0xa'));var jayson=require(_0xc801('0xb'));var client=jayson[_0xc801('0xc')][_0xc801('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5b30b7,_0x392279,_0x6eb740){return new BPromise(function(_0x19994b,_0x28d29e){return client[_0xc801('0xe')](_0x5b30b7,_0x6eb740)[_0xc801('0xf')](function(_0x2faa0b){logger[_0xc801('0x10')](_0xc801('0x11'),_0x392279,'request\x20sent');logger[_0xc801('0x12')](_0xc801('0x13'),_0x392279,_0xc801('0x14'),JSON['stringify'](_0x2faa0b));if(_0x2faa0b[_0xc801('0x15')]){if(_0x2faa0b[_0xc801('0x15')][_0xc801('0x16')]===0x1f4){logger['error'](_0xc801('0x11'),_0x392279,_0x2faa0b[_0xc801('0x15')][_0xc801('0x17')]);return _0x28d29e(_0x2faa0b[_0xc801('0x15')][_0xc801('0x17')]);}logger[_0xc801('0x15')](_0xc801('0x11'),_0x392279,_0x2faa0b[_0xc801('0x15')][_0xc801('0x17')]);return _0x19994b(_0x2faa0b[_0xc801('0x15')][_0xc801('0x17')]);}else{logger[_0xc801('0x10')](_0xc801('0x11'),_0x392279,'request\x20sent');_0x19994b(_0x2faa0b[_0xc801('0x18')][_0xc801('0x17')]);}})[_0xc801('0x19')](function(_0x1803ec){logger[_0xc801('0x15')]('SmsQueueReport,\x20%s,\x20%s',_0x392279,_0x1803ec);_0x28d29e(_0x1803ec);});});}exports[_0xc801('0x1a')]=function(_0x4934a7){var _0x157034=this;return new Promise(function(_0xd5249b,_0x1b44fe){return db[_0xc801('0x1b')]['create'](_0x4934a7[_0xc801('0x1c')],{'raw':_0x4934a7[_0xc801('0x1d')]?_0x4934a7[_0xc801('0x1d')][_0xc801('0x1e')]===undefined?!![]:![]:!![]})[_0xc801('0xf')](function(_0x5aac0e){logger[_0xc801('0x10')](_0xc801('0x1a'),_0x4934a7);logger['debug'](_0xc801('0x1a'),_0x4934a7,JSON[_0xc801('0x1f')](_0x5aac0e));_0xd5249b(_0x5aac0e);})['catch'](function(_0x52363d){logger['error'](_0xc801('0x1a'),_0x52363d[_0xc801('0x17')],_0x4934a7);_0x1b44fe(_0x157034[_0xc801('0x15')](0x1f4,_0x52363d[_0xc801('0x17')]));});});};exports['UpdateSmsQueueReport']=function(_0x5c17e0){var _0x2f62ea=this;return new Promise(function(_0x2efa1a,_0x4ed7aa){return db[_0xc801('0x1b')]['update'](_0x5c17e0[_0xc801('0x1c')],{'raw':_0x5c17e0[_0xc801('0x1d')]?_0x5c17e0[_0xc801('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c17e0[_0xc801('0x1d')]?_0x5c17e0[_0xc801('0x1d')]['where']||null:null,'attributes':_0x5c17e0[_0xc801('0x1d')]?_0x5c17e0[_0xc801('0x1d')][_0xc801('0x20')]||null:null,'limit':_0x5c17e0[_0xc801('0x1d')]?_0x5c17e0[_0xc801('0x1d')][_0xc801('0x21')]||null:null})[_0xc801('0xf')](function(_0x2debc0){logger[_0xc801('0x10')](_0xc801('0x22'),_0x5c17e0);logger[_0xc801('0x12')](_0xc801('0x22'),_0x5c17e0,JSON[_0xc801('0x1f')](_0x2debc0));_0x2efa1a(_0x2debc0);})[_0xc801('0x19')](function(_0x1140c3){logger[_0xc801('0x15')](_0xc801('0x22'),_0x1140c3['message'],_0x5c17e0);_0x4ed7aa(_0x2f62ea[_0xc801('0x15')](0x1f4,_0x1140c3['message']));});});};
\ No newline at end of file
index ec58e96..ec818e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43fd=['create','put','update','delete','destroy','exports','util','express','Router','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','/describe','describe','/:id','post'];(function(_0x208c26,_0xd03b50){var _0x160b08=function(_0x43770d){while(--_0x43770d){_0x208c26['push'](_0x208c26['shift']());}};_0x160b08(++_0xd03b50);}(_0x43fd,0x1ec));var _0xd43f=function(_0x262f1f,_0x2a4464){_0x262f1f=_0x262f1f-0x0;var _0xa190e9=_0x43fd[_0x262f1f];return _0xa190e9;};'use strict';var multer=require('multer');var util=require(_0xd43f('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd43f('0x1'));var router=express[_0xd43f('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xd43f('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd43f('0x4'));var controller=require(_0xd43f('0x5'));router[_0xd43f('0x6')]('/',auth[_0xd43f('0x7')](),controller['index']);router[_0xd43f('0x6')](_0xd43f('0x8'),auth[_0xd43f('0x7')](),controller[_0xd43f('0x9')]);router['get'](_0xd43f('0xa'),auth[_0xd43f('0x7')](),controller['show']);router[_0xd43f('0xb')]('/',auth[_0xd43f('0x7')](),controller[_0xd43f('0xc')]);router[_0xd43f('0xd')](_0xd43f('0xa'),auth['isAuthenticated'](),controller[_0xd43f('0xe')]);router[_0xd43f('0xf')](_0xd43f('0xa'),auth[_0xd43f('0x7')](),controller[_0xd43f('0x10')]);module[_0xd43f('0x11')]=router;
\ No newline at end of file
+var _0x2494=['express','Router','fs-extra','../../components/auth/service','./smsTransferReport.controller','isAuthenticated','index','get','describe','show','post','create','put','/:id','destroy','exports','multer','path','connect-timeout'];(function(_0x5a0652,_0x44ae9b){var _0x4be025=function(_0x4ee020){while(--_0x4ee020){_0x5a0652['push'](_0x5a0652['shift']());}};_0x4be025(++_0x44ae9b);}(_0x2494,0x82));var _0x4249=function(_0x4af580,_0x4298c9){_0x4af580=_0x4af580-0x0;var _0x157c65=_0x2494[_0x4af580];return _0x157c65;};'use strict';var multer=require(_0x4249('0x0'));var util=require('util');var path=require(_0x4249('0x1'));var timeout=require(_0x4249('0x2'));var express=require(_0x4249('0x3'));var router=express[_0x4249('0x4')]();var fs_extra=require(_0x4249('0x5'));var auth=require(_0x4249('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4249('0x7'));router['get']('/',auth[_0x4249('0x8')](),controller[_0x4249('0x9')]);router[_0x4249('0xa')]('/describe',auth[_0x4249('0x8')](),controller[_0x4249('0xb')]);router[_0x4249('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x4249('0xc')]);router[_0x4249('0xd')]('/',auth[_0x4249('0x8')](),controller[_0x4249('0xe')]);router[_0x4249('0xf')](_0x4249('0x10'),auth[_0x4249('0x8')](),controller['update']);router['delete'](_0x4249('0x10'),auth['isAuthenticated'](),controller[_0x4249('0x11')]);module[_0x4249('0x12')]=router;
\ No newline at end of file
index 3527444..4885a7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x32dd80,_0x30bb55){var _0x40e39f=function(_0x514de6){while(--_0x514de6){_0x32dd80['push'](_0x32dd80['shift']());}};_0x40e39f(++_0x30bb55);}(_0xedd9,0xfc));var _0x9edd=function(_0x5be392,_0x4f864f){_0x5be392=_0x5be392-0x0;var _0x2fa68b=_0xedd9[_0x5be392];return _0x2fa68b;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
+var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x3242d1,_0x3024fd){var _0x193264=function(_0x279f67){while(--_0x279f67){_0x3242d1['push'](_0x3242d1['shift']());}};_0x193264(++_0x3024fd);}(_0x70e0,0x17b));var _0x070e=function(_0x2d09ab,_0x5454aa){_0x2d09ab=_0x2d09ab-0x0;var _0x301c6e=_0x70e0[_0x2d09ab];return _0x301c6e;};'use strict';var moment=require(_0x070e('0x0'));var Sequelize=require(_0x070e('0x1'));module[_0x070e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x070e('0x3'),_0x070e('0x4'),_0x070e('0x5')),'allowNull':![],'defaultValue':_0x070e('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x070e('0x6')]}};
\ No newline at end of file
index 9dd06ef..7529e4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b21=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','SmsTransferReport','include','findAll','catch','show','keys','includeAll','create','update','body','find','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','filters'];(function(_0x219cc1,_0x3d03b5){var _0x177034=function(_0x45e0fe){while(--_0x45e0fe){_0x219cc1['push'](_0x219cc1['shift']());}};_0x177034(++_0x3d03b5);}(_0x1b21,0x1cf));var _0x11b2=function(_0x2dfa3a,_0x39e02d){_0x2dfa3a=_0x2dfa3a-0x0;var _0x5116a8=_0x1b21[_0x2dfa3a];return _0x5116a8;};'use strict';var emlformat=require(_0x11b2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x11b2('0x1'));var jsonpatch=require(_0x11b2('0x2'));var rp=require(_0x11b2('0x3'));var moment=require('moment');var BPromise=require(_0x11b2('0x4'));var Mustache=require(_0x11b2('0x5'));var util=require('util');var path=require(_0x11b2('0x6'));var sox=require(_0x11b2('0x7'));var csv=require(_0x11b2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x11b2('0x9'));var _=require('lodash');var squel=require(_0x11b2('0xa'));var crypto=require(_0x11b2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x11b2('0xc'));var toCsv=require(_0x11b2('0x8'));var querystring=require('querystring');var Papa=require(_0x11b2('0xd'));var Redis=require(_0x11b2('0xe'));var authService=require(_0x11b2('0xf'));var qs=require(_0x11b2('0x10'));var as=require(_0x11b2('0x11'));var hardwareService=require(_0x11b2('0x12'));var logger=require(_0x11b2('0x13'))('api');var utils=require(_0x11b2('0x14'));var config=require(_0x11b2('0x15'));var licenseUtil=require(_0x11b2('0x16'));var db=require(_0x11b2('0x17'))['db'];function respondWithStatusCode(_0x28015a,_0x404819){_0x404819=_0x404819||0xcc;return function(_0x1677d2){if(_0x1677d2){return _0x28015a[_0x11b2('0x18')](_0x404819);}return _0x28015a[_0x11b2('0x19')](_0x404819)['end']();};}function respondWithResult(_0x5628b9,_0x3494ca){_0x3494ca=_0x3494ca||0xc8;return function(_0x289c12){if(_0x289c12){return _0x5628b9[_0x11b2('0x19')](_0x3494ca)[_0x11b2('0x1a')](_0x289c12);}};}function respondWithFilteredResult(_0x35ad39,_0x5cca04){return function(_0x17ab40){if(_0x17ab40){var _0x50f801=typeof _0x5cca04['offset']===_0x11b2('0x1b')&&typeof _0x5cca04[_0x11b2('0x1c')]==='undefined';var _0x454f4a=_0x17ab40[_0x11b2('0x1d')];var _0x5203cd=_0x50f801?0x0:_0x5cca04[_0x11b2('0x1e')];var _0x4f5a98=_0x50f801?_0x17ab40[_0x11b2('0x1d')]:_0x5cca04[_0x11b2('0x1e')]+_0x5cca04[_0x11b2('0x1c')];var _0x4fc636;if(_0x4f5a98>=_0x454f4a){_0x4f5a98=_0x454f4a;_0x4fc636=0xc8;}else{_0x4fc636=0xce;}_0x35ad39[_0x11b2('0x19')](_0x4fc636);return _0x35ad39['set'](_0x11b2('0x1f'),_0x5203cd+'-'+_0x4f5a98+'/'+_0x454f4a)[_0x11b2('0x1a')](_0x17ab40);}return null;};}function patchUpdates(_0x53d4d4){return function(_0x240734){try{jsonpatch[_0x11b2('0x20')](_0x240734,_0x53d4d4,!![]);}catch(_0x2814d1){return BPromise['reject'](_0x2814d1);}return _0x240734[_0x11b2('0x21')]();};}function saveUpdates(_0x57d5b5,_0x31f612){return function(_0x59c370){if(_0x59c370){return _0x59c370['update'](_0x57d5b5)[_0x11b2('0x22')](function(_0xaa175a){return _0xaa175a;});}return null;};}function removeEntity(_0x1e16c3,_0x4a121b){return function(_0x1a7008){if(_0x1a7008){return _0x1a7008[_0x11b2('0x23')]()[_0x11b2('0x22')](function(){_0x1e16c3[_0x11b2('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x402f21,_0x1005d3){return function(_0x2fc0ef){if(!_0x2fc0ef){_0x402f21[_0x11b2('0x18')](0x194);}return _0x2fc0ef;};}function handleError(_0x417f89,_0x5364f8){_0x5364f8=_0x5364f8||0x1f4;return function(_0x15e400){logger[_0x11b2('0x24')](_0x15e400[_0x11b2('0x25')]);if(_0x15e400[_0x11b2('0x26')]){delete _0x15e400[_0x11b2('0x26')];}_0x417f89['status'](_0x5364f8)[_0x11b2('0x27')](_0x15e400);};}exports[_0x11b2('0x28')]=function(_0x240de2,_0x5d5add){var _0x529443={},_0x1495c4={},_0xa569d8={'count':0x0,'rows':[]};var _0x3805d2=_[_0x11b2('0x29')](db['SmsTransferReport']['rawAttributes'],function(_0x116bca){return{'name':_0x116bca[_0x11b2('0x2a')],'type':_0x116bca[_0x11b2('0x2b')][_0x11b2('0x2c')]};});_0x1495c4[_0x11b2('0x2d')]=_[_0x11b2('0x29')](_0x3805d2,'name');_0x1495c4[_0x11b2('0x2e')]=_['keys'](_0x240de2['query']);_0x1495c4[_0x11b2('0x2f')]=_[_0x11b2('0x30')](_0x1495c4[_0x11b2('0x2d')],_0x1495c4[_0x11b2('0x2e')]);_0x529443[_0x11b2('0x31')]=_['intersection'](_0x1495c4['model'],qs[_0x11b2('0x32')](_0x240de2[_0x11b2('0x2e')][_0x11b2('0x32')]));_0x529443[_0x11b2('0x31')]=_0x529443[_0x11b2('0x31')][_0x11b2('0x33')]?_0x529443[_0x11b2('0x31')]:_0x1495c4[_0x11b2('0x2d')];if(!_0x240de2['query'][_0x11b2('0x34')](_0x11b2('0x35'))){_0x529443[_0x11b2('0x1c')]=qs[_0x11b2('0x1c')](_0x240de2['query'][_0x11b2('0x1c')]);_0x529443[_0x11b2('0x1e')]=qs[_0x11b2('0x1e')](_0x240de2[_0x11b2('0x2e')][_0x11b2('0x1e')]);}_0x529443[_0x11b2('0x36')]=qs[_0x11b2('0x37')](_0x240de2[_0x11b2('0x2e')][_0x11b2('0x37')]);_0x529443[_0x11b2('0x38')]=qs[_0x11b2('0x2f')](_['pick'](_0x240de2[_0x11b2('0x2e')],_0x1495c4['filters']),_0x3805d2);if(_0x240de2[_0x11b2('0x2e')][_0x11b2('0x39')]){_0x529443[_0x11b2('0x38')]=_[_0x11b2('0x3a')](_0x529443['where'],{'$or':_['map'](_0x3805d2,function(_0x59c73e){if(_0x59c73e[_0x11b2('0x2b')]!=='VIRTUAL'){var _0x208523={};_0x208523[_0x59c73e[_0x11b2('0x26')]]={'$like':'%'+_0x240de2[_0x11b2('0x2e')][_0x11b2('0x39')]+'%'};return _0x208523;}})});}_0x529443=_[_0x11b2('0x3a')]({},_0x529443,_0x240de2[_0x11b2('0x3b')]);var _0x345771={'where':_0x529443['where']};return db[_0x11b2('0x3c')][_0x11b2('0x1d')](_0x345771)[_0x11b2('0x22')](function(_0x141aed){_0xa569d8['count']=_0x141aed;if(_0x240de2[_0x11b2('0x2e')]['includeAll']){_0x529443[_0x11b2('0x3d')]=[{'all':!![]}];}return db[_0x11b2('0x3c')][_0x11b2('0x3e')](_0x529443);})[_0x11b2('0x22')](function(_0x210205){_0xa569d8['rows']=_0x210205;return _0xa569d8;})['then'](respondWithFilteredResult(_0x5d5add,_0x529443))[_0x11b2('0x3f')](handleError(_0x5d5add,null));};exports[_0x11b2('0x40')]=function(_0xb5e7ac,_0x214e2b){var _0x50f073={'raw':!![],'where':{'id':_0xb5e7ac['params']['id']}},_0x55b768={};_0x55b768[_0x11b2('0x2d')]=_[_0x11b2('0x41')](db[_0x11b2('0x3c')]['rawAttributes']);_0x55b768['query']=_[_0x11b2('0x41')](_0xb5e7ac['query']);_0x55b768[_0x11b2('0x2f')]=_[_0x11b2('0x30')](_0x55b768[_0x11b2('0x2d')],_0x55b768[_0x11b2('0x2e')]);_0x50f073[_0x11b2('0x31')]=_['intersection'](_0x55b768[_0x11b2('0x2d')],qs[_0x11b2('0x32')](_0xb5e7ac[_0x11b2('0x2e')][_0x11b2('0x32')]));_0x50f073[_0x11b2('0x31')]=_0x50f073[_0x11b2('0x31')]['length']?_0x50f073['attributes']:_0x55b768['model'];if(_0xb5e7ac[_0x11b2('0x2e')][_0x11b2('0x42')]){_0x50f073[_0x11b2('0x3d')]=[{'all':!![]}];}_0x50f073=_[_0x11b2('0x3a')]({},_0x50f073,_0xb5e7ac[_0x11b2('0x3b')]);return db[_0x11b2('0x3c')]['find'](_0x50f073)[_0x11b2('0x22')](handleEntityNotFound(_0x214e2b,null))[_0x11b2('0x22')](respondWithResult(_0x214e2b,null))[_0x11b2('0x3f')](handleError(_0x214e2b,null));};exports[_0x11b2('0x43')]=function(_0x3bc807,_0x2e0830){return db[_0x11b2('0x3c')][_0x11b2('0x43')](_0x3bc807['body'],{})[_0x11b2('0x22')](respondWithResult(_0x2e0830,0xc9))[_0x11b2('0x3f')](handleError(_0x2e0830,null));};exports[_0x11b2('0x44')]=function(_0x4a1703,_0x482c90){if(_0x4a1703['body']['id']){delete _0x4a1703[_0x11b2('0x45')]['id'];}return db[_0x11b2('0x3c')]['find']({'where':{'id':_0x4a1703['params']['id']}})['then'](handleEntityNotFound(_0x482c90,null))[_0x11b2('0x22')](saveUpdates(_0x4a1703['body'],null))[_0x11b2('0x22')](respondWithResult(_0x482c90,null))['catch'](handleError(_0x482c90,null));};exports['destroy']=function(_0x328a61,_0x1dcaa4){return db['SmsTransferReport'][_0x11b2('0x46')]({'where':{'id':_0x328a61[_0x11b2('0x47')]['id']}})[_0x11b2('0x22')](handleEntityNotFound(_0x1dcaa4,null))[_0x11b2('0x22')](removeEntity(_0x1dcaa4,null))['catch'](handleError(_0x1dcaa4,null));};exports[_0x11b2('0x48')]=function(_0x1c0936,_0x276409){return db['SmsTransferReport'][_0x11b2('0x48')]()[_0x11b2('0x22')](respondWithResult(_0x276409,null))[_0x11b2('0x3f')](handleError(_0x276409,null));};
\ No newline at end of file
+var _0xdbb9=['map','SmsTransferReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','show','rawAttributes','find','create','body','update','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','save','then','destroy','stack','name','index'];(function(_0xd6371d,_0xada508){var _0x101bb4=function(_0xd66131){while(--_0xd66131){_0xd6371d['push'](_0xd6371d['shift']());}};_0x101bb4(++_0xada508);}(_0xdbb9,0xf9));var _0x9dbb=function(_0x42b7be,_0x3e7961){_0x42b7be=_0x42b7be-0x0;var _0x4d6c7b=_0xdbb9[_0x42b7be];return _0x4d6c7b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9dbb('0x0'));var zipdir=require(_0x9dbb('0x1'));var jsonpatch=require(_0x9dbb('0x2'));var rp=require(_0x9dbb('0x3'));var moment=require('moment');var BPromise=require(_0x9dbb('0x4'));var Mustache=require(_0x9dbb('0x5'));var util=require(_0x9dbb('0x6'));var path=require(_0x9dbb('0x7'));var sox=require(_0x9dbb('0x8'));var csv=require(_0x9dbb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9dbb('0xa'));var crypto=require(_0x9dbb('0xb'));var jsforce=require(_0x9dbb('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9dbb('0xd'));var Papa=require(_0x9dbb('0xe'));var Redis=require(_0x9dbb('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9dbb('0x10'));var as=require(_0x9dbb('0x11'));var hardwareService=require(_0x9dbb('0x12'));var logger=require(_0x9dbb('0x13'))('api');var utils=require(_0x9dbb('0x14'));var config=require(_0x9dbb('0x15'));var licenseUtil=require(_0x9dbb('0x16'));var db=require(_0x9dbb('0x17'))['db'];function respondWithStatusCode(_0x3fe0bd,_0x4468e8){_0x4468e8=_0x4468e8||0xcc;return function(_0x382cc6){if(_0x382cc6){return _0x3fe0bd[_0x9dbb('0x18')](_0x4468e8);}return _0x3fe0bd[_0x9dbb('0x19')](_0x4468e8)[_0x9dbb('0x1a')]();};}function respondWithResult(_0x293028,_0x2c36d3){_0x2c36d3=_0x2c36d3||0xc8;return function(_0x24b20b){if(_0x24b20b){return _0x293028[_0x9dbb('0x19')](_0x2c36d3)[_0x9dbb('0x1b')](_0x24b20b);}};}function respondWithFilteredResult(_0x464df5,_0x528110){return function(_0x1366b2){if(_0x1366b2){var _0x30add1=typeof _0x528110[_0x9dbb('0x1c')]===_0x9dbb('0x1d')&&typeof _0x528110[_0x9dbb('0x1e')]==='undefined';var _0x382d61=_0x1366b2[_0x9dbb('0x1f')];var _0x2383cf=_0x30add1?0x0:_0x528110[_0x9dbb('0x1c')];var _0x45c6f5=_0x30add1?_0x1366b2['count']:_0x528110[_0x9dbb('0x1c')]+_0x528110['limit'];var _0x3de435;if(_0x45c6f5>=_0x382d61){_0x45c6f5=_0x382d61;_0x3de435=0xc8;}else{_0x3de435=0xce;}_0x464df5['status'](_0x3de435);return _0x464df5[_0x9dbb('0x20')]('Content-Range',_0x2383cf+'-'+_0x45c6f5+'/'+_0x382d61)[_0x9dbb('0x1b')](_0x1366b2);}return null;};}function patchUpdates(_0x192eb5){return function(_0x188c75){try{jsonpatch['apply'](_0x188c75,_0x192eb5,!![]);}catch(_0x50e5e3){return BPromise['reject'](_0x50e5e3);}return _0x188c75[_0x9dbb('0x21')]();};}function saveUpdates(_0x35c136,_0x48bb65){return function(_0x4a07ef){if(_0x4a07ef){return _0x4a07ef['update'](_0x35c136)[_0x9dbb('0x22')](function(_0x245d12){return _0x245d12;});}return null;};}function removeEntity(_0x10c06a,_0x55e2ef){return function(_0x1f30ec){if(_0x1f30ec){return _0x1f30ec[_0x9dbb('0x23')]()[_0x9dbb('0x22')](function(){_0x10c06a[_0x9dbb('0x19')](0xcc)[_0x9dbb('0x1a')]();});}};}function handleEntityNotFound(_0x3e51ca,_0x668f7b){return function(_0x187486){if(!_0x187486){_0x3e51ca[_0x9dbb('0x18')](0x194);}return _0x187486;};}function handleError(_0x127742,_0x25614a){_0x25614a=_0x25614a||0x1f4;return function(_0x27a6f6){logger['error'](_0x27a6f6[_0x9dbb('0x24')]);if(_0x27a6f6['name']){delete _0x27a6f6[_0x9dbb('0x25')];}_0x127742[_0x9dbb('0x19')](_0x25614a)['send'](_0x27a6f6);};}exports[_0x9dbb('0x26')]=function(_0x4ebd57,_0x4b5ce1){var _0x589f63={},_0x25555c={},_0x3578b3={'count':0x0,'rows':[]};var _0x491324=_[_0x9dbb('0x27')](db[_0x9dbb('0x28')]['rawAttributes'],function(_0x71692a){return{'name':_0x71692a[_0x9dbb('0x29')],'type':_0x71692a[_0x9dbb('0x2a')]['key']};});_0x25555c[_0x9dbb('0x2b')]=_['map'](_0x491324,_0x9dbb('0x25'));_0x25555c[_0x9dbb('0x2c')]=_[_0x9dbb('0x2d')](_0x4ebd57[_0x9dbb('0x2c')]);_0x25555c[_0x9dbb('0x2e')]=_[_0x9dbb('0x2f')](_0x25555c[_0x9dbb('0x2b')],_0x25555c[_0x9dbb('0x2c')]);_0x589f63[_0x9dbb('0x30')]=_[_0x9dbb('0x2f')](_0x25555c[_0x9dbb('0x2b')],qs['fields'](_0x4ebd57[_0x9dbb('0x2c')][_0x9dbb('0x31')]));_0x589f63[_0x9dbb('0x30')]=_0x589f63[_0x9dbb('0x30')][_0x9dbb('0x32')]?_0x589f63[_0x9dbb('0x30')]:_0x25555c[_0x9dbb('0x2b')];if(!_0x4ebd57[_0x9dbb('0x2c')][_0x9dbb('0x33')](_0x9dbb('0x34'))){_0x589f63[_0x9dbb('0x1e')]=qs[_0x9dbb('0x1e')](_0x4ebd57[_0x9dbb('0x2c')][_0x9dbb('0x1e')]);_0x589f63[_0x9dbb('0x1c')]=qs[_0x9dbb('0x1c')](_0x4ebd57[_0x9dbb('0x2c')]['offset']);}_0x589f63[_0x9dbb('0x35')]=qs[_0x9dbb('0x36')](_0x4ebd57[_0x9dbb('0x2c')]['sort']);_0x589f63[_0x9dbb('0x37')]=qs[_0x9dbb('0x2e')](_[_0x9dbb('0x38')](_0x4ebd57[_0x9dbb('0x2c')],_0x25555c[_0x9dbb('0x2e')]),_0x491324);if(_0x4ebd57[_0x9dbb('0x2c')]['filter']){_0x589f63[_0x9dbb('0x37')]=_['merge'](_0x589f63[_0x9dbb('0x37')],{'$or':_[_0x9dbb('0x27')](_0x491324,function(_0xa3bc3){if(_0xa3bc3[_0x9dbb('0x2a')]!=='VIRTUAL'){var _0x1a5eeb={};_0x1a5eeb[_0xa3bc3['name']]={'$like':'%'+_0x4ebd57[_0x9dbb('0x2c')]['filter']+'%'};return _0x1a5eeb;}})});}_0x589f63=_[_0x9dbb('0x39')]({},_0x589f63,_0x4ebd57[_0x9dbb('0x3a')]);var _0x34524e={'where':_0x589f63[_0x9dbb('0x37')]};return db[_0x9dbb('0x28')]['count'](_0x34524e)[_0x9dbb('0x22')](function(_0x59eea1){_0x3578b3[_0x9dbb('0x1f')]=_0x59eea1;if(_0x4ebd57[_0x9dbb('0x2c')][_0x9dbb('0x3b')]){_0x589f63[_0x9dbb('0x3c')]=[{'all':!![]}];}return db[_0x9dbb('0x28')][_0x9dbb('0x3d')](_0x589f63);})[_0x9dbb('0x22')](function(_0x49e63f){_0x3578b3[_0x9dbb('0x3e')]=_0x49e63f;return _0x3578b3;})['then'](respondWithFilteredResult(_0x4b5ce1,_0x589f63))[_0x9dbb('0x3f')](handleError(_0x4b5ce1,null));};exports[_0x9dbb('0x40')]=function(_0x34c114,_0x104ec5){var _0x490833={'raw':!![],'where':{'id':_0x34c114['params']['id']}},_0x2f99ed={};_0x2f99ed[_0x9dbb('0x2b')]=_['keys'](db[_0x9dbb('0x28')][_0x9dbb('0x41')]);_0x2f99ed['query']=_['keys'](_0x34c114[_0x9dbb('0x2c')]);_0x2f99ed[_0x9dbb('0x2e')]=_[_0x9dbb('0x2f')](_0x2f99ed[_0x9dbb('0x2b')],_0x2f99ed[_0x9dbb('0x2c')]);_0x490833[_0x9dbb('0x30')]=_[_0x9dbb('0x2f')](_0x2f99ed[_0x9dbb('0x2b')],qs[_0x9dbb('0x31')](_0x34c114['query'][_0x9dbb('0x31')]));_0x490833['attributes']=_0x490833[_0x9dbb('0x30')][_0x9dbb('0x32')]?_0x490833[_0x9dbb('0x30')]:_0x2f99ed[_0x9dbb('0x2b')];if(_0x34c114['query'][_0x9dbb('0x3b')]){_0x490833['include']=[{'all':!![]}];}_0x490833=_['merge']({},_0x490833,_0x34c114[_0x9dbb('0x3a')]);return db[_0x9dbb('0x28')][_0x9dbb('0x42')](_0x490833)[_0x9dbb('0x22')](handleEntityNotFound(_0x104ec5,null))[_0x9dbb('0x22')](respondWithResult(_0x104ec5,null))[_0x9dbb('0x3f')](handleError(_0x104ec5,null));};exports['create']=function(_0x202235,_0x56d319){return db[_0x9dbb('0x28')][_0x9dbb('0x43')](_0x202235[_0x9dbb('0x44')],{})[_0x9dbb('0x22')](respondWithResult(_0x56d319,0xc9))[_0x9dbb('0x3f')](handleError(_0x56d319,null));};exports[_0x9dbb('0x45')]=function(_0x34304a,_0x31c532){if(_0x34304a['body']['id']){delete _0x34304a[_0x9dbb('0x44')]['id'];}return db['SmsTransferReport'][_0x9dbb('0x42')]({'where':{'id':_0x34304a[_0x9dbb('0x46')]['id']}})['then'](handleEntityNotFound(_0x31c532,null))[_0x9dbb('0x22')](saveUpdates(_0x34304a['body'],null))['then'](respondWithResult(_0x31c532,null))['catch'](handleError(_0x31c532,null));};exports[_0x9dbb('0x23')]=function(_0x3c19bb,_0x5c398b){return db[_0x9dbb('0x28')]['find']({'where':{'id':_0x3c19bb[_0x9dbb('0x46')]['id']}})[_0x9dbb('0x22')](handleEntityNotFound(_0x5c398b,null))[_0x9dbb('0x22')](removeEntity(_0x5c398b,null))[_0x9dbb('0x3f')](handleError(_0x5c398b,null));};exports[_0x9dbb('0x47')]=function(_0x6a6f55,_0x56ac9a){return db['SmsTransferReport'][_0x9dbb('0x47')]()[_0x9dbb('0x22')](respondWithResult(_0x56ac9a,null))['catch'](handleError(_0x56ac9a,null));};
\ No newline at end of file
index 0de5f2a..6bfb591 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf463=['../../config/environment','exports','SmsTransferReport','report_sms_transfer','uniqueid','util','api','moment','bluebird','path','rimraf'];(function(_0xe3e0af,_0x4564ed){var _0x4828e9=function(_0x55c7a7){while(--_0x55c7a7){_0xe3e0af['push'](_0xe3e0af['shift']());}};_0x4828e9(++_0x4564ed);}(_0xf463,0x94));var _0x3f46=function(_0x4880be,_0x44da38){_0x4880be=_0x4880be-0x0;var _0x4516b7=_0xf463[_0x4880be];return _0x4516b7;};'use strict';var _=require('lodash');var util=require(_0x3f46('0x0'));var logger=require('../../config/logger')(_0x3f46('0x1'));var moment=require(_0x3f46('0x2'));var BPromise=require(_0x3f46('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f46('0x4'));var rimraf=require(_0x3f46('0x5'));var config=require(_0x3f46('0x6'));var attributes=require('./smsTransferReport.attributes');module[_0x3f46('0x7')]=function(_0x2aa42d,_0x3d1c05){return _0x2aa42d['define'](_0x3f46('0x8'),attributes,{'tableName':_0x3f46('0x9'),'paranoid':![],'indexes':[{'name':_0x3f46('0xa'),'fields':[_0x3f46('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xee14=['report_sms_transfer','uniqueid','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport'];(function(_0x510bd8,_0x46c1e6){var _0xcd6e09=function(_0x4adabe){while(--_0x4adabe){_0x510bd8['push'](_0x510bd8['shift']());}};_0xcd6e09(++_0x46c1e6);}(_0xee14,0x13a));var _0x4ee1=function(_0x3b5352,_0x30ec1b){_0x3b5352=_0x3b5352-0x0;var _0x4f9e79=_0xee14[_0x3b5352];return _0x4f9e79;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4ee1('0x0'))(_0x4ee1('0x1'));var moment=require(_0x4ee1('0x2'));var BPromise=require(_0x4ee1('0x3'));var rp=require(_0x4ee1('0x4'));var fs=require('fs');var path=require(_0x4ee1('0x5'));var rimraf=require(_0x4ee1('0x6'));var config=require(_0x4ee1('0x7'));var attributes=require(_0x4ee1('0x8'));module['exports']=function(_0xba6d36,_0x573700){return _0xba6d36[_0x4ee1('0x9')](_0x4ee1('0xa'),attributes,{'tableName':_0x4ee1('0xb'),'paranoid':![],'indexes':[{'name':_0x4ee1('0xc'),'fields':[_0x4ee1('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index a9010f5..48ad5d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88d5=['moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','result','catch','SmsTransferReport,\x20%s,\x20%s','lodash','util'];(function(_0x828f36,_0x3c0e02){var _0x4c9141=function(_0xd5b013){while(--_0xd5b013){_0x828f36['push'](_0x828f36['shift']());}};_0x4c9141(++_0x3c0e02);}(_0x88d5,0x76));var _0x588d=function(_0x27beea,_0x3bc9f4){_0x27beea=_0x27beea-0x0;var _0x122645=_0x88d5[_0x27beea];return _0x122645;};'use strict';var _=require(_0x588d('0x0'));var util=require(_0x588d('0x1'));var moment=require(_0x588d('0x2'));var BPromise=require(_0x588d('0x3'));var rs=require(_0x588d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x588d('0x5'))['db'];var utils=require(_0x588d('0x6'));var logger=require('../../config/logger')(_0x588d('0x7'));var config=require(_0x588d('0x8'));var jayson=require(_0x588d('0x9'));var client=jayson[_0x588d('0xa')][_0x588d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x413748,_0x579dca,_0x57699a){return new BPromise(function(_0x41ddf3,_0x141982){return client[_0x588d('0xc')](_0x413748,_0x57699a)[_0x588d('0xd')](function(_0x51c1d3){logger[_0x588d('0xe')]('SmsTransferReport,\x20%s,\x20%s',_0x579dca,_0x588d('0xf'));logger[_0x588d('0x10')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x579dca,_0x588d('0xf'),JSON[_0x588d('0x11')](_0x51c1d3));if(_0x51c1d3[_0x588d('0x12')]){if(_0x51c1d3['error'][_0x588d('0x13')]===0x1f4){logger[_0x588d('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x579dca,_0x51c1d3[_0x588d('0x12')][_0x588d('0x14')]);return _0x141982(_0x51c1d3[_0x588d('0x12')][_0x588d('0x14')]);}logger[_0x588d('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x579dca,_0x51c1d3['error'][_0x588d('0x14')]);return _0x41ddf3(_0x51c1d3[_0x588d('0x12')][_0x588d('0x14')]);}else{logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x579dca,_0x588d('0xf'));_0x41ddf3(_0x51c1d3[_0x588d('0x15')]['message']);}})[_0x588d('0x16')](function(_0x73302d){logger[_0x588d('0x12')](_0x588d('0x17'),_0x579dca,_0x73302d);_0x141982(_0x73302d);});});}
\ No newline at end of file
+var _0xfa2b=['jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','code','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x1231cf,_0x286f35){var _0x1f3c19=function(_0x2f2725){while(--_0x2f2725){_0x1231cf['push'](_0x1231cf['shift']());}};_0x1f3c19(++_0x286f35);}(_0xfa2b,0x1b7));var _0xbfa2=function(_0x3b1234,_0x3d634c){_0x3b1234=_0x3b1234-0x0;var _0x6e4407=_0xfa2b[_0x3b1234];return _0x6e4407;};'use strict';var _=require(_0xbfa2('0x0'));var util=require(_0xbfa2('0x1'));var moment=require(_0xbfa2('0x2'));var BPromise=require(_0xbfa2('0x3'));var rs=require(_0xbfa2('0x4'));var fs=require('fs');var Redis=require(_0xbfa2('0x5'));var db=require(_0xbfa2('0x6'))['db'];var utils=require(_0xbfa2('0x7'));var logger=require(_0xbfa2('0x8'))(_0xbfa2('0x9'));var config=require(_0xbfa2('0xa'));var jayson=require(_0xbfa2('0xb'));var client=jayson[_0xbfa2('0xc')][_0xbfa2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x26ed93,_0x26e9bf,_0x4cd9ae){return new BPromise(function(_0x46a151,_0x4f17e6){return client[_0xbfa2('0xe')](_0x26ed93,_0x4cd9ae)[_0xbfa2('0xf')](function(_0x1b1c13){logger[_0xbfa2('0x10')](_0xbfa2('0x11'),_0x26e9bf,_0xbfa2('0x12'));logger[_0xbfa2('0x13')](_0xbfa2('0x14'),_0x26e9bf,_0xbfa2('0x12'),JSON['stringify'](_0x1b1c13));if(_0x1b1c13['error']){if(_0x1b1c13['error'][_0xbfa2('0x15')]===0x1f4){logger[_0xbfa2('0x16')](_0xbfa2('0x11'),_0x26e9bf,_0x1b1c13[_0xbfa2('0x16')][_0xbfa2('0x17')]);return _0x4f17e6(_0x1b1c13[_0xbfa2('0x16')]['message']);}logger[_0xbfa2('0x16')](_0xbfa2('0x11'),_0x26e9bf,_0x1b1c13[_0xbfa2('0x16')][_0xbfa2('0x17')]);return _0x46a151(_0x1b1c13[_0xbfa2('0x16')]['message']);}else{logger[_0xbfa2('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x26e9bf,'request\x20sent');_0x46a151(_0x1b1c13[_0xbfa2('0x18')]['message']);}})['catch'](function(_0xab2c91){logger[_0xbfa2('0x16')]('SmsTransferReport,\x20%s,\x20%s',_0x26e9bf,_0xab2c91);_0x4f17e6(_0xab2c91);});});}
\ No newline at end of file
index 5b6c404..424f2db 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfffe=['../../components/auth/service','../../components/interaction/service','./sound.controller','get','isAuthenticated','index','show','download','diskStorage','join','root','originalname','replace','format','basename','now','extname','post','single','file','create','put','/:id','update','delete','multer','util','path','connect-timeout','express','Router'];(function(_0x4a6901,_0x104c2c){var _0x97c469=function(_0x47c532){while(--_0x47c532){_0x4a6901['push'](_0x4a6901['shift']());}};_0x97c469(++_0x104c2c);}(_0xfffe,0xb4));var _0xefff=function(_0x128ba5,_0x4533c0){_0x128ba5=_0x128ba5-0x0;var _0x2ccfbb=_0xfffe[_0x128ba5];return _0x2ccfbb;};'use strict';var multer=require(_0xefff('0x0'));var util=require(_0xefff('0x1'));var path=require(_0xefff('0x2'));var timeout=require(_0xefff('0x3'));var express=require(_0xefff('0x4'));var router=express[_0xefff('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xefff('0x6'));var interaction=require(_0xefff('0x7'));var config=require('../../config/environment');var controller=require(_0xefff('0x8'));router[_0xefff('0x9')]('/',auth[_0xefff('0xa')](),controller[_0xefff('0xb')]);router[_0xefff('0x9')]('/:id',auth[_0xefff('0xa')](),controller[_0xefff('0xc')]);router['get']('/:id/download',auth[_0xefff('0xa')](),controller[_0xefff('0xd')]);var upload=multer({'storage':multer[_0xefff('0xe')]({'destination':function(_0x130a7f,_0x3e43b0,_0x5e2deb){_0x5e2deb(null,path[_0xefff('0xf')](config[_0xefff('0x10')],'server/files/sounds/original/'));},'filename':function(_0x544961,_0x3e507d,_0x20f931){_0x3e507d[_0xefff('0x11')]=_0x3e507d[_0xefff('0x11')][_0xefff('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x20f931(null,util[_0xefff('0x13')]('%s-%s%s',path[_0xefff('0x14')](_0x3e507d['originalname'],path['extname'](_0x3e507d[_0xefff('0x11')])),Date[_0xefff('0x15')](),path[_0xefff('0x16')](_0x3e507d[_0xefff('0x11')])));}})});router[_0xefff('0x17')]('/',upload[_0xefff('0x18')](_0xefff('0x19')),controller[_0xefff('0x1a')]);router[_0xefff('0x1b')](_0xefff('0x1c'),auth[_0xefff('0xa')](),controller[_0xefff('0x1d')]);router[_0xefff('0x1e')](_0xefff('0x1c'),auth[_0xefff('0xa')](),controller[_0xefff('0x1e')]);module['exports']=router;
\ No newline at end of file
+var _0x3a57=['single','file','create','put','delete','exports','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','download','diskStorage','join','originalname','replace','format','basename','extname','now'];(function(_0x3e226d,_0x3c23bd){var _0x40892c=function(_0x141162){while(--_0x141162){_0x3e226d['push'](_0x3e226d['shift']());}};_0x40892c(++_0x3c23bd);}(_0x3a57,0x172));var _0x73a5=function(_0x13b0eb,_0x453a07){_0x13b0eb=_0x13b0eb-0x0;var _0x10d0c9=_0x3a57[_0x13b0eb];return _0x10d0c9;};'use strict';var multer=require('multer');var util=require(_0x73a5('0x0'));var path=require(_0x73a5('0x1'));var timeout=require(_0x73a5('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x73a5('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x73a5('0x4'));var config=require(_0x73a5('0x5'));var controller=require('./sound.controller');router[_0x73a5('0x6')]('/',auth[_0x73a5('0x7')](),controller[_0x73a5('0x8')]);router[_0x73a5('0x6')](_0x73a5('0x9'),auth[_0x73a5('0x7')](),controller[_0x73a5('0xa')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x73a5('0xb')]);var upload=multer({'storage':multer[_0x73a5('0xc')]({'destination':function(_0x125309,_0x40427b,_0x23ad86){_0x23ad86(null,path[_0x73a5('0xd')](config['root'],'server/files/sounds/original/'));},'filename':function(_0x5e5cd9,_0x3f46de,_0x1f51f0){_0x3f46de[_0x73a5('0xe')]=_0x3f46de['originalname'][_0x73a5('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1f51f0(null,util[_0x73a5('0x10')]('%s-%s%s',path[_0x73a5('0x11')](_0x3f46de[_0x73a5('0xe')],path[_0x73a5('0x12')](_0x3f46de[_0x73a5('0xe')])),Date[_0x73a5('0x13')](),path[_0x73a5('0x12')](_0x3f46de['originalname'])));}})});router['post']('/',upload[_0x73a5('0x14')](_0x73a5('0x15')),controller[_0x73a5('0x16')]);router[_0x73a5('0x17')](_0x73a5('0x9'),auth[_0x73a5('0x7')](),controller['update']);router[_0x73a5('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x73a5('0x18')]);module[_0x73a5('0x19')]=router;
\ No newline at end of file
index 9b841f8..7c0203a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6293=['name','FLOAT','BIGINT','INTEGER','sequelize','STRING'];(function(_0x3c785a,_0x50965b){var _0x2e8af4=function(_0x4d3ad4){while(--_0x4d3ad4){_0x3c785a['push'](_0x3c785a['shift']());}};_0x2e8af4(++_0x50965b);}(_0x6293,0x1ae));var _0x3629=function(_0x5e6fca,_0x540568){_0x5e6fca=_0x5e6fca-0x0;var _0x505941=_0x6293[_0x5e6fca];return _0x505941;};'use strict';var Sequelize=require(_0x3629('0x0'));module['exports']={'name':{'type':Sequelize[_0x3629('0x1')],'unique':_0x3629('0x2'),'allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x3629('0x1')]},'original_format':{'type':Sequelize[_0x3629('0x1')]},'original_duration':{'type':Sequelize[_0x3629('0x3')]},'original_sampleCount':{'type':Sequelize[_0x3629('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0x3629('0x4')]},'original_sampleRate':{'type':Sequelize[_0x3629('0x5')]},'converted_format':{'type':Sequelize[_0x3629('0x1')]},'converted_duration':{'type':Sequelize[_0x3629('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x3629('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x3629('0x5')]}};
\ No newline at end of file
+var _0x2943=['STRING','FLOAT','INTEGER','BIGINT','exports'];(function(_0x324d05,_0x5e2b01){var _0x572121=function(_0x27671a){while(--_0x27671a){_0x324d05['push'](_0x324d05['shift']());}};_0x572121(++_0x5e2b01);}(_0x2943,0x8b));var _0x3294=function(_0x1e7ead,_0x7f6227){_0x1e7ead=_0x1e7ead-0x0;var _0x3912b2=_0x2943[_0x1e7ead];return _0x3912b2;};'use strict';var Sequelize=require('sequelize');module[_0x3294('0x0')]={'name':{'type':Sequelize[_0x3294('0x1')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize[_0x3294('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x3294('0x1')]},'original_duration':{'type':Sequelize[_0x3294('0x2')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x3294('0x3')]},'original_bitRate':{'type':Sequelize[_0x3294('0x4')]},'original_sampleRate':{'type':Sequelize[_0x3294('0x3')]},'converted_format':{'type':Sequelize[_0x3294('0x1')]},'converted_duration':{'type':Sequelize[_0x3294('0x2')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x3294('0x3')]}};
\ No newline at end of file
index fcaa23a..a9921a3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bf1=['save','update','then','destroy','Sounds','UserProfileResource','error','send','index','map','Sound','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','name','options','includeAll','include','rows','catch','show','params','rawAttributes','find','save_name','converted_format','existsSync','root','server/files/sounds/converted','download','%s.%s','format','basename','file','originalname','extname','filename','substring','wav','server/files/sounds/original','join','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','unlinkSync','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','original_format','eml-format','rimraf','fast-json-patch','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject'];(function(_0xb0444e,_0x3da35a){var _0x363b43=function(_0x1b3e68){while(--_0x1b3e68){_0xb0444e['push'](_0xb0444e['shift']());}};_0x363b43(++_0x3da35a);}(_0x0bf1,0x1d0));var _0x10bf=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0bf1[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x10bf('0x0'));var rimraf=require(_0x10bf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x10bf('0x2'));var rp=require('request-promise');var moment=require(_0x10bf('0x3'));var BPromise=require(_0x10bf('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x10bf('0x5'));var csv=require(_0x10bf('0x6'));var ejs=require(_0x10bf('0x7'));var fs=require('fs');var fs_extra=require(_0x10bf('0x8'));var _=require(_0x10bf('0x9'));var squel=require(_0x10bf('0xa'));var crypto=require('crypto');var jsforce=require(_0x10bf('0xb'));var deskjs=require(_0x10bf('0xc'));var toCsv=require(_0x10bf('0x6'));var querystring=require(_0x10bf('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x10bf('0xe'));var qs=require(_0x10bf('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x10bf('0x10'));var logger=require(_0x10bf('0x11'))('api');var utils=require(_0x10bf('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x10bf('0x13'));var db=require(_0x10bf('0x14'))['db'];function respondWithStatusCode(_0xef7465,_0x52b07f){_0x52b07f=_0x52b07f||0xcc;return function(_0x21f31f){if(_0x21f31f){return _0xef7465[_0x10bf('0x15')](_0x52b07f);}return _0xef7465[_0x10bf('0x16')](_0x52b07f)[_0x10bf('0x17')]();};}function respondWithResult(_0x21995a,_0x25c815){_0x25c815=_0x25c815||0xc8;return function(_0x141ab5){if(_0x141ab5){return _0x21995a[_0x10bf('0x16')](_0x25c815)[_0x10bf('0x18')](_0x141ab5);}};}function respondWithFilteredResult(_0x2b8aa9,_0x100dda){return function(_0x3ea4d9){if(_0x3ea4d9){var _0x226e00=typeof _0x100dda[_0x10bf('0x19')]===_0x10bf('0x1a')&&typeof _0x100dda[_0x10bf('0x1b')]==='undefined';var _0x40c60f=_0x3ea4d9['count'];var _0xe730b9=_0x226e00?0x0:_0x100dda[_0x10bf('0x19')];var _0x3cecca=_0x226e00?_0x3ea4d9[_0x10bf('0x1c')]:_0x100dda[_0x10bf('0x19')]+_0x100dda[_0x10bf('0x1b')];var _0x4dbc9d;if(_0x3cecca>=_0x40c60f){_0x3cecca=_0x40c60f;_0x4dbc9d=0xc8;}else{_0x4dbc9d=0xce;}_0x2b8aa9['status'](_0x4dbc9d);return _0x2b8aa9[_0x10bf('0x1d')](_0x10bf('0x1e'),_0xe730b9+'-'+_0x3cecca+'/'+_0x40c60f)['json'](_0x3ea4d9);}return null;};}function patchUpdates(_0x5c1adb){return function(_0x4b378d){try{jsonpatch['apply'](_0x4b378d,_0x5c1adb,!![]);}catch(_0x4f666a){return BPromise[_0x10bf('0x1f')](_0x4f666a);}return _0x4b378d[_0x10bf('0x20')]();};}function saveUpdates(_0x54279d,_0x315096){return function(_0x536243){if(_0x536243){return _0x536243[_0x10bf('0x21')](_0x54279d)[_0x10bf('0x22')](function(_0x1c4ce5){return _0x1c4ce5;});}return null;};}function removeEntity(_0x1cf312,_0x4f8d89){return function(_0x1efc08){if(_0x1efc08){return _0x1efc08[_0x10bf('0x23')]()[_0x10bf('0x22')](function(){var _0xb98576=_0x1efc08['get']({'plain':!![]});var _0x3159c3=_0x10bf('0x24');return db[_0x10bf('0x25')][_0x10bf('0x23')]({'where':{'type':_0x3159c3,'resourceId':_0xb98576['id']}})[_0x10bf('0x22')](function(){return _0x1efc08;});})[_0x10bf('0x22')](function(){_0x1cf312['status'](0xcc)[_0x10bf('0x17')]();});}};}function handleEntityNotFound(_0x38ef58,_0x1c0322){return function(_0x33c787){if(!_0x33c787){_0x38ef58[_0x10bf('0x15')](0x194);}return _0x33c787;};}function handleError(_0x594c4d,_0x1a56c3){_0x1a56c3=_0x1a56c3||0x1f4;return function(_0x21d50f){logger[_0x10bf('0x26')](_0x21d50f['stack']);if(_0x21d50f['name']){delete _0x21d50f['name'];}_0x594c4d[_0x10bf('0x16')](_0x1a56c3)[_0x10bf('0x27')](_0x21d50f);};}exports[_0x10bf('0x28')]=function(_0xd40365,_0x497298){var _0x501786={},_0x3f1440={},_0x1c90fb={'count':0x0,'rows':[]};var _0x56a8ce=_[_0x10bf('0x29')](db[_0x10bf('0x2a')]['rawAttributes'],function(_0x39825d){return{'name':_0x39825d[_0x10bf('0x2b')],'type':_0x39825d[_0x10bf('0x2c')][_0x10bf('0x2d')]};});_0x3f1440['model']=_[_0x10bf('0x29')](_0x56a8ce,'name');_0x3f1440[_0x10bf('0x2e')]=_[_0x10bf('0x2f')](_0xd40365[_0x10bf('0x2e')]);_0x3f1440[_0x10bf('0x30')]=_['intersection'](_0x3f1440[_0x10bf('0x31')],_0x3f1440[_0x10bf('0x2e')]);_0x501786[_0x10bf('0x32')]=_[_0x10bf('0x33')](_0x3f1440['model'],qs[_0x10bf('0x34')](_0xd40365['query'][_0x10bf('0x34')]));_0x501786[_0x10bf('0x32')]=_0x501786[_0x10bf('0x32')][_0x10bf('0x35')]?_0x501786[_0x10bf('0x32')]:_0x3f1440[_0x10bf('0x31')];if(!_0xd40365['query'][_0x10bf('0x36')](_0x10bf('0x37'))){_0x501786['limit']=qs[_0x10bf('0x1b')](_0xd40365[_0x10bf('0x2e')]['limit']);_0x501786['offset']=qs[_0x10bf('0x19')](_0xd40365[_0x10bf('0x2e')]['offset']);}_0x501786[_0x10bf('0x38')]=qs[_0x10bf('0x39')](_0xd40365[_0x10bf('0x2e')]['sort']);_0x501786[_0x10bf('0x3a')]=qs[_0x10bf('0x30')](_[_0x10bf('0x3b')](_0xd40365[_0x10bf('0x2e')],_0x3f1440[_0x10bf('0x30')]),_0x56a8ce);if(_0xd40365[_0x10bf('0x2e')][_0x10bf('0x3c')]){_0x501786[_0x10bf('0x3a')]=_[_0x10bf('0x3d')](_0x501786[_0x10bf('0x3a')],{'$or':_[_0x10bf('0x29')](_0x56a8ce,function(_0x25b97c){if(_0x25b97c[_0x10bf('0x2c')]!==_0x10bf('0x3e')){var _0x1b5b07={};_0x1b5b07[_0x25b97c[_0x10bf('0x3f')]]={'$like':'%'+_0xd40365[_0x10bf('0x2e')][_0x10bf('0x3c')]+'%'};return _0x1b5b07;}})});}_0x501786=_['merge']({},_0x501786,_0xd40365[_0x10bf('0x40')]);var _0x45205a={'where':_0x501786[_0x10bf('0x3a')]};return db[_0x10bf('0x2a')][_0x10bf('0x1c')](_0x45205a)[_0x10bf('0x22')](function(_0x8458e3){_0x1c90fb[_0x10bf('0x1c')]=_0x8458e3;if(_0xd40365['query'][_0x10bf('0x41')]){_0x501786[_0x10bf('0x42')]=[{'all':!![]}];}return db[_0x10bf('0x2a')]['findAll'](_0x501786);})[_0x10bf('0x22')](function(_0x56761c){_0x1c90fb[_0x10bf('0x43')]=_0x56761c;return _0x1c90fb;})['then'](respondWithFilteredResult(_0x497298,_0x501786))[_0x10bf('0x44')](handleError(_0x497298,null));};exports[_0x10bf('0x45')]=function(_0x143a49,_0x1be988){var _0x5773fd={'raw':!![],'where':{'id':_0x143a49[_0x10bf('0x46')]['id']}},_0x2b5a9c={};_0x2b5a9c[_0x10bf('0x31')]=_[_0x10bf('0x2f')](db[_0x10bf('0x2a')][_0x10bf('0x47')]);_0x2b5a9c[_0x10bf('0x2e')]=_[_0x10bf('0x2f')](_0x143a49['query']);_0x2b5a9c[_0x10bf('0x30')]=_[_0x10bf('0x33')](_0x2b5a9c[_0x10bf('0x31')],_0x2b5a9c[_0x10bf('0x2e')]);_0x5773fd[_0x10bf('0x32')]=_[_0x10bf('0x33')](_0x2b5a9c[_0x10bf('0x31')],qs['fields'](_0x143a49['query'][_0x10bf('0x34')]));_0x5773fd[_0x10bf('0x32')]=_0x5773fd[_0x10bf('0x32')][_0x10bf('0x35')]?_0x5773fd[_0x10bf('0x32')]:_0x2b5a9c[_0x10bf('0x31')];if(_0x143a49['query'][_0x10bf('0x41')]){_0x5773fd[_0x10bf('0x42')]=[{'all':!![]}];}_0x5773fd=_[_0x10bf('0x3d')]({},_0x5773fd,_0x143a49['options']);return db[_0x10bf('0x2a')][_0x10bf('0x48')](_0x5773fd)[_0x10bf('0x22')](handleEntityNotFound(_0x1be988,null))[_0x10bf('0x22')](respondWithResult(_0x1be988,null))[_0x10bf('0x44')](handleError(_0x1be988,null));};exports['download']=function(_0x50626f,_0x41c8bb,_0x42131f){return db[_0x10bf('0x2a')][_0x10bf('0x48')]({'where':{'id':_0x50626f['params']['id']},'attributes':['name',_0x10bf('0x49'),_0x10bf('0x4a')],'raw':!![]})['then'](handleEntityNotFound(_0x41c8bb,null))[_0x10bf('0x22')](function(_0x13e934){if(_0x13e934){if(!fs[_0x10bf('0x4b')](path['join'](config[_0x10bf('0x4c')],_0x10bf('0x4d'),_0x13e934[_0x10bf('0x49')]+'.'+_0x13e934[_0x10bf('0x4a')]))){throw new db['Sequelize']['ValidationError']('Sound\x20not\x20found');}return _0x41c8bb[_0x10bf('0x4e')](path['join'](config[_0x10bf('0x4c')],_0x10bf('0x4d'),util['format'](_0x10bf('0x4f'),_0x13e934[_0x10bf('0x49')],_0x13e934[_0x10bf('0x4a')])),util[_0x10bf('0x50')]('%s.%s',_0x13e934[_0x10bf('0x3f')],_0x13e934[_0x10bf('0x4a')]));}return null;})['catch'](handleError(_0x41c8bb,null));};exports['create']=function(_0x3a2615,_0x2c705b,_0x301fa0){var _0x5bcc76={'name':path[_0x10bf('0x51')](_0x3a2615[_0x10bf('0x52')][_0x10bf('0x53')],path[_0x10bf('0x54')](_0x3a2615[_0x10bf('0x52')][_0x10bf('0x53')])),'save_name':path[_0x10bf('0x51')](_0x3a2615['file']['filename'],path[_0x10bf('0x54')](_0x3a2615[_0x10bf('0x52')][_0x10bf('0x55')])),'original_format':path['extname'](_0x3a2615[_0x10bf('0x52')]['originalname'])[_0x10bf('0x56')](0x1),'converted_format':_0x10bf('0x57')};var _0x6a5382=path['join'](config[_0x10bf('0x4c')],_0x10bf('0x58'),_0x3a2615[_0x10bf('0x52')][_0x10bf('0x55')]);var _0x3dc390=path[_0x10bf('0x59')](config[_0x10bf('0x4c')],_0x10bf('0x4d'),util[_0x10bf('0x50')](_0x10bf('0x4f'),path[_0x10bf('0x51')](_0x3a2615[_0x10bf('0x52')][_0x10bf('0x55')],path[_0x10bf('0x54')](_0x3a2615[_0x10bf('0x52')]['filename'])),_0x5bcc76[_0x10bf('0x4a')]));logger[_0x10bf('0x5a')](_0x10bf('0x5b'),_0x6a5382);logger[_0x10bf('0x5a')](_0x10bf('0x5c'),_0x3dc390);try{fs[_0x10bf('0x5d')](_0x6a5382,parseInt('0777',0x8));var _0x3a25b3=sox[_0x10bf('0x5e')](_0x6a5382,_0x3dc390,{'sampleRate':0x1f40,'format':_0x10bf('0x57'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3a25b3['on'](_0x10bf('0x26'),function(_0x4ff09d){fs[_0x10bf('0x5f')](_0x6a5382);_0x2c705b['status'](0x1f4)[_0x10bf('0x27')](_0x4ff09d);});_0x3a25b3['on'](_0x10bf('0x60'),function(_0x395e3a){_0x5bcc76['original_duration']=isNaN(_0x395e3a['duration'])?null:_0x395e3a[_0x10bf('0x61')]*0x3e8;_0x5bcc76[_0x10bf('0x62')]=isNaN(_0x395e3a[_0x10bf('0x63')])?null:_0x395e3a[_0x10bf('0x63')];_0x5bcc76[_0x10bf('0x64')]=isNaN(_0x395e3a['channelCount'])?null:_0x395e3a[_0x10bf('0x65')];_0x5bcc76['original_bitRate']=isNaN(_0x395e3a[_0x10bf('0x66')])?null:_0x395e3a['bitRate'];_0x5bcc76[_0x10bf('0x67')]=isNaN(_0x395e3a[_0x10bf('0x68')])?null:_0x395e3a['sampleRate'];});_0x3a25b3['on'](_0x10bf('0x69'),function(_0x2ecf82){_0x5bcc76[_0x10bf('0x6a')]=isNaN(_0x2ecf82[_0x10bf('0x61')])?null:_0x2ecf82[_0x10bf('0x61')]*0x3e8;_0x5bcc76[_0x10bf('0x6b')]=isNaN(_0x2ecf82[_0x10bf('0x63')])?null:_0x2ecf82[_0x10bf('0x63')];_0x5bcc76[_0x10bf('0x6c')]=isNaN(_0x2ecf82[_0x10bf('0x65')])?null:_0x2ecf82['channelCount'];_0x5bcc76[_0x10bf('0x6d')]=isNaN(_0x2ecf82['bitRate'])?null:_0x2ecf82['bitRate'];_0x5bcc76[_0x10bf('0x6e')]=isNaN(_0x2ecf82[_0x10bf('0x68')])?null:_0x2ecf82['sampleRate'];});_0x3a25b3['on'](_0x10bf('0x17'),function(){fs[_0x10bf('0x5d')](_0x3dc390,parseInt('0777',0x8));return db[_0x10bf('0x2a')][_0x10bf('0x6f')](_0x5bcc76)['then'](function(_0x2c88ee){var _0x2a51ac={'role':_0x3a2615[_0x10bf('0x70')]['role'],'userProfileId':_0x3a2615[_0x10bf('0x70')][_0x10bf('0x71')]};if(!_0x2a51ac)throw new Error(_0x10bf('0x72'));if(_0x2a51ac['role']===_0x10bf('0x73')){var _0x509a45=_0x2c88ee[_0x10bf('0x74')]({'plain':!![]});return db[_0x10bf('0x75')][_0x10bf('0x48')]({'where':{'name':_0x10bf('0x24'),'userProfileId':_0x2a51ac[_0x10bf('0x71')]},'raw':!![]})['then'](function(_0x2e442e){if(_0x2e442e&&_0x2e442e[_0x10bf('0x76')]===0x0){return db[_0x10bf('0x25')][_0x10bf('0x6f')]({'name':_0x509a45[_0x10bf('0x3f')],'resourceId':_0x509a45['id'],'type':_0x2e442e[_0x10bf('0x3f')],'sectionId':_0x2e442e['id']},{})[_0x10bf('0x22')](function(){return _0x2c88ee;});}else{return _0x2c88ee;}})[_0x10bf('0x44')](function(_0x417a37){logger[_0x10bf('0x26')](_0x10bf('0x77'),_0x417a37);throw _0x417a37;});}return _0x2c88ee;})['then'](respondWithResult(_0x2c705b,null))[_0x10bf('0x44')](handleError(_0x2c705b,null));});_0x3a25b3[_0x10bf('0x78')]();}catch(_0x1cadd5){_0x2c705b[_0x10bf('0x16')](0x1f4)[_0x10bf('0x27')](_0x1cadd5);}};exports[_0x10bf('0x21')]=function(_0x5b0915,_0x2aa256,_0x195803){return db[_0x10bf('0x2a')]['find']({'where':{'id':_0x5b0915[_0x10bf('0x46')]['id']}})[_0x10bf('0x22')](handleEntityNotFound(_0x2aa256,null))[_0x10bf('0x22')](saveUpdates(_['pick'](_0x5b0915[_0x10bf('0x70')],[_0x10bf('0x3f'),_0x10bf('0x79')]),null))['then'](respondWithResult(_0x2aa256,null))[_0x10bf('0x44')](handleError(_0x2aa256,null));};exports[_0x10bf('0x7a')]=function(_0x534e10,_0xa2ca30,_0x87280b){return db['Sound'][_0x10bf('0x48')]({'where':{'id':_0x534e10['params']['id']}})[_0x10bf('0x22')](function(_0x1daa7f){if(_0x1daa7f){return _0x1daa7f[_0x10bf('0x23')]();}})[_0x10bf('0x22')](function(_0x7bcde7){var _0xfcff26=path['join'](config[_0x10bf('0x4c')],_0x10bf('0x58'),util[_0x10bf('0x50')](_0x10bf('0x4f'),_0x7bcde7[_0x10bf('0x49')],_0x7bcde7[_0x10bf('0x7b')]));var _0xaeb2f1=path[_0x10bf('0x59')](config['root'],_0x10bf('0x4d'),util[_0x10bf('0x50')](_0x10bf('0x4f'),_0x7bcde7[_0x10bf('0x49')],_0x7bcde7[_0x10bf('0x4a')]));fs[_0x10bf('0x5f')](_0xfcff26);fs[_0x10bf('0x5f')](_0xaeb2f1);return _0x7bcde7;})[_0x10bf('0x22')](function(_0x8c128e){if(_0x8c128e){return _0xa2ca30[_0x10bf('0x16')](0xcc)[_0x10bf('0x17')]();}})['then'](handleEntityNotFound(_0xa2ca30,null))[_0x10bf('0x44')](handleError(_0xa2ca30,null));};
\ No newline at end of file
+var _0xa825=['save','update','then','destroy','get','Sounds','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','Sound','includeAll','include','rows','params','length','merge','options','find','catch','download','save_name','converted_format','existsSync','join','root','server/files/sounds/converted','Sequelize','ValidationError','format','%s.%s','basename','file','originalname','extname','filename','substring','info','Sound\x20upload\x20destination:\x20%s','0777','transcode','wav','unlinkSync','send','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_sampleCount','converted_bitRate','converted_sampleRate','chmodSync','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','server/files/sounds/original','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject'];(function(_0x2d8434,_0x43d781){var _0x26b9e4=function(_0x54f5b8){while(--_0x54f5b8){_0x2d8434['push'](_0x2d8434['shift']());}};_0x26b9e4(++_0x43d781);}(_0xa825,0xdd));var _0x5a82=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa825[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x5a82('0x0'));var rimraf=require(_0x5a82('0x1'));var zipdir=require(_0x5a82('0x2'));var jsonpatch=require(_0x5a82('0x3'));var rp=require(_0x5a82('0x4'));var moment=require(_0x5a82('0x5'));var BPromise=require(_0x5a82('0x6'));var Mustache=require(_0x5a82('0x7'));var util=require('util');var path=require(_0x5a82('0x8'));var sox=require(_0x5a82('0x9'));var csv=require(_0x5a82('0xa'));var ejs=require(_0x5a82('0xb'));var fs=require('fs');var fs_extra=require(_0x5a82('0xc'));var _=require('lodash');var squel=require(_0x5a82('0xd'));var crypto=require('crypto');var jsforce=require(_0x5a82('0xe'));var deskjs=require(_0x5a82('0xf'));var toCsv=require(_0x5a82('0xa'));var querystring=require(_0x5a82('0x10'));var Papa=require(_0x5a82('0x11'));var Redis=require(_0x5a82('0x12'));var authService=require(_0x5a82('0x13'));var qs=require(_0x5a82('0x14'));var as=require(_0x5a82('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5a82('0x16'));var utils=require(_0x5a82('0x17'));var config=require(_0x5a82('0x18'));var licenseUtil=require(_0x5a82('0x19'));var db=require(_0x5a82('0x1a'))['db'];function respondWithStatusCode(_0xd3a201,_0x397f47){_0x397f47=_0x397f47||0xcc;return function(_0x148a78){if(_0x148a78){return _0xd3a201[_0x5a82('0x1b')](_0x397f47);}return _0xd3a201['status'](_0x397f47)[_0x5a82('0x1c')]();};}function respondWithResult(_0x1b46a2,_0x156f48){_0x156f48=_0x156f48||0xc8;return function(_0x2d905b){if(_0x2d905b){return _0x1b46a2['status'](_0x156f48)[_0x5a82('0x1d')](_0x2d905b);}};}function respondWithFilteredResult(_0x3a9578,_0x3e4af8){return function(_0x1c33df){if(_0x1c33df){var _0x1bac04=typeof _0x3e4af8[_0x5a82('0x1e')]===_0x5a82('0x1f')&&typeof _0x3e4af8[_0x5a82('0x20')]===_0x5a82('0x1f');var _0x53fc7d=_0x1c33df[_0x5a82('0x21')];var _0x4bb6d0=_0x1bac04?0x0:_0x3e4af8[_0x5a82('0x1e')];var _0x1d3489=_0x1bac04?_0x1c33df[_0x5a82('0x21')]:_0x3e4af8['offset']+_0x3e4af8[_0x5a82('0x20')];var _0x579ef5;if(_0x1d3489>=_0x53fc7d){_0x1d3489=_0x53fc7d;_0x579ef5=0xc8;}else{_0x579ef5=0xce;}_0x3a9578[_0x5a82('0x22')](_0x579ef5);return _0x3a9578[_0x5a82('0x23')](_0x5a82('0x24'),_0x4bb6d0+'-'+_0x1d3489+'/'+_0x53fc7d)[_0x5a82('0x1d')](_0x1c33df);}return null;};}function patchUpdates(_0x2164cc){return function(_0x20c527){try{jsonpatch[_0x5a82('0x25')](_0x20c527,_0x2164cc,!![]);}catch(_0x7c5eef){return BPromise[_0x5a82('0x26')](_0x7c5eef);}return _0x20c527[_0x5a82('0x27')]();};}function saveUpdates(_0x267c8b,_0x59997a){return function(_0xcca5e5){if(_0xcca5e5){return _0xcca5e5[_0x5a82('0x28')](_0x267c8b)[_0x5a82('0x29')](function(_0x1b5347){return _0x1b5347;});}return null;};}function removeEntity(_0x5135f0,_0x2e2561){return function(_0x45728a){if(_0x45728a){return _0x45728a[_0x5a82('0x2a')]()[_0x5a82('0x29')](function(){var _0x3131af=_0x45728a[_0x5a82('0x2b')]({'plain':!![]});var _0x208c57=_0x5a82('0x2c');return db[_0x5a82('0x2d')][_0x5a82('0x2a')]({'where':{'type':_0x208c57,'resourceId':_0x3131af['id']}})[_0x5a82('0x29')](function(){return _0x45728a;});})[_0x5a82('0x29')](function(){_0x5135f0[_0x5a82('0x22')](0xcc)[_0x5a82('0x1c')]();});}};}function handleEntityNotFound(_0x51468b,_0x32c79d){return function(_0x199b40){if(!_0x199b40){_0x51468b[_0x5a82('0x1b')](0x194);}return _0x199b40;};}function handleError(_0x2f32bd,_0x56f217){_0x56f217=_0x56f217||0x1f4;return function(_0x15145e){logger[_0x5a82('0x2e')](_0x15145e[_0x5a82('0x2f')]);if(_0x15145e['name']){delete _0x15145e[_0x5a82('0x30')];}_0x2f32bd[_0x5a82('0x22')](_0x56f217)['send'](_0x15145e);};}exports[_0x5a82('0x31')]=function(_0x88a361,_0x3b3c1c){var _0x563cad={},_0x10495f={},_0x3ee8c7={'count':0x0,'rows':[]};var _0x3c0239=_[_0x5a82('0x32')](db['Sound'][_0x5a82('0x33')],function(_0x46411a){return{'name':_0x46411a[_0x5a82('0x34')],'type':_0x46411a['type']['key']};});_0x10495f['model']=_['map'](_0x3c0239,_0x5a82('0x30'));_0x10495f[_0x5a82('0x35')]=_[_0x5a82('0x36')](_0x88a361[_0x5a82('0x35')]);_0x10495f[_0x5a82('0x37')]=_[_0x5a82('0x38')](_0x10495f[_0x5a82('0x39')],_0x10495f[_0x5a82('0x35')]);_0x563cad[_0x5a82('0x3a')]=_[_0x5a82('0x38')](_0x10495f[_0x5a82('0x39')],qs[_0x5a82('0x3b')](_0x88a361[_0x5a82('0x35')][_0x5a82('0x3b')]));_0x563cad['attributes']=_0x563cad[_0x5a82('0x3a')]['length']?_0x563cad[_0x5a82('0x3a')]:_0x10495f[_0x5a82('0x39')];if(!_0x88a361[_0x5a82('0x35')][_0x5a82('0x3c')](_0x5a82('0x3d'))){_0x563cad[_0x5a82('0x20')]=qs[_0x5a82('0x20')](_0x88a361[_0x5a82('0x35')][_0x5a82('0x20')]);_0x563cad[_0x5a82('0x1e')]=qs['offset'](_0x88a361[_0x5a82('0x35')]['offset']);}_0x563cad[_0x5a82('0x3e')]=qs[_0x5a82('0x3f')](_0x88a361[_0x5a82('0x35')]['sort']);_0x563cad[_0x5a82('0x40')]=qs[_0x5a82('0x37')](_[_0x5a82('0x41')](_0x88a361['query'],_0x10495f[_0x5a82('0x37')]),_0x3c0239);if(_0x88a361[_0x5a82('0x35')][_0x5a82('0x42')]){_0x563cad[_0x5a82('0x40')]=_['merge'](_0x563cad[_0x5a82('0x40')],{'$or':_[_0x5a82('0x32')](_0x3c0239,function(_0x39123d){if(_0x39123d[_0x5a82('0x43')]!==_0x5a82('0x44')){var _0x371349={};_0x371349[_0x39123d[_0x5a82('0x30')]]={'$like':'%'+_0x88a361[_0x5a82('0x35')][_0x5a82('0x42')]+'%'};return _0x371349;}})});}_0x563cad=_['merge']({},_0x563cad,_0x88a361['options']);var _0x5f55d1={'where':_0x563cad[_0x5a82('0x40')]};return db[_0x5a82('0x45')][_0x5a82('0x21')](_0x5f55d1)[_0x5a82('0x29')](function(_0x421558){_0x3ee8c7[_0x5a82('0x21')]=_0x421558;if(_0x88a361[_0x5a82('0x35')][_0x5a82('0x46')]){_0x563cad[_0x5a82('0x47')]=[{'all':!![]}];}return db[_0x5a82('0x45')]['findAll'](_0x563cad);})[_0x5a82('0x29')](function(_0x450146){_0x3ee8c7[_0x5a82('0x48')]=_0x450146;return _0x3ee8c7;})[_0x5a82('0x29')](respondWithFilteredResult(_0x3b3c1c,_0x563cad))['catch'](handleError(_0x3b3c1c,null));};exports['show']=function(_0x54682c,_0x540245){var _0xa4aaef={'raw':!![],'where':{'id':_0x54682c[_0x5a82('0x49')]['id']}},_0xb9446d={};_0xb9446d[_0x5a82('0x39')]=_[_0x5a82('0x36')](db[_0x5a82('0x45')][_0x5a82('0x33')]);_0xb9446d[_0x5a82('0x35')]=_['keys'](_0x54682c[_0x5a82('0x35')]);_0xb9446d[_0x5a82('0x37')]=_[_0x5a82('0x38')](_0xb9446d['model'],_0xb9446d[_0x5a82('0x35')]);_0xa4aaef[_0x5a82('0x3a')]=_[_0x5a82('0x38')](_0xb9446d['model'],qs[_0x5a82('0x3b')](_0x54682c[_0x5a82('0x35')][_0x5a82('0x3b')]));_0xa4aaef['attributes']=_0xa4aaef[_0x5a82('0x3a')][_0x5a82('0x4a')]?_0xa4aaef[_0x5a82('0x3a')]:_0xb9446d[_0x5a82('0x39')];if(_0x54682c['query'][_0x5a82('0x46')]){_0xa4aaef[_0x5a82('0x47')]=[{'all':!![]}];}_0xa4aaef=_[_0x5a82('0x4b')]({},_0xa4aaef,_0x54682c[_0x5a82('0x4c')]);return db[_0x5a82('0x45')][_0x5a82('0x4d')](_0xa4aaef)[_0x5a82('0x29')](handleEntityNotFound(_0x540245,null))[_0x5a82('0x29')](respondWithResult(_0x540245,null))[_0x5a82('0x4e')](handleError(_0x540245,null));};exports[_0x5a82('0x4f')]=function(_0x29339a,_0x382c55,_0x50514f){return db[_0x5a82('0x45')]['find']({'where':{'id':_0x29339a[_0x5a82('0x49')]['id']},'attributes':[_0x5a82('0x30'),_0x5a82('0x50'),_0x5a82('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x382c55,null))['then'](function(_0x2ec568){if(_0x2ec568){if(!fs[_0x5a82('0x52')](path[_0x5a82('0x53')](config[_0x5a82('0x54')],_0x5a82('0x55'),_0x2ec568[_0x5a82('0x50')]+'.'+_0x2ec568[_0x5a82('0x51')]))){throw new db[(_0x5a82('0x56'))][(_0x5a82('0x57'))]('Sound\x20not\x20found');}return _0x382c55[_0x5a82('0x4f')](path[_0x5a82('0x53')](config['root'],_0x5a82('0x55'),util[_0x5a82('0x58')](_0x5a82('0x59'),_0x2ec568[_0x5a82('0x50')],_0x2ec568[_0x5a82('0x51')])),util[_0x5a82('0x58')](_0x5a82('0x59'),_0x2ec568[_0x5a82('0x30')],_0x2ec568[_0x5a82('0x51')]));}return null;})[_0x5a82('0x4e')](handleError(_0x382c55,null));};exports['create']=function(_0x16d770,_0x124b08,_0x3d239b){var _0x242a6e={'name':path[_0x5a82('0x5a')](_0x16d770[_0x5a82('0x5b')][_0x5a82('0x5c')],path[_0x5a82('0x5d')](_0x16d770[_0x5a82('0x5b')][_0x5a82('0x5c')])),'save_name':path[_0x5a82('0x5a')](_0x16d770[_0x5a82('0x5b')][_0x5a82('0x5e')],path[_0x5a82('0x5d')](_0x16d770[_0x5a82('0x5b')][_0x5a82('0x5e')])),'original_format':path['extname'](_0x16d770[_0x5a82('0x5b')]['originalname'])[_0x5a82('0x5f')](0x1),'converted_format':'wav'};var _0x4bd2f3=path[_0x5a82('0x53')](config[_0x5a82('0x54')],'server/files/sounds/original',_0x16d770[_0x5a82('0x5b')][_0x5a82('0x5e')]);var _0x5cd377=path[_0x5a82('0x53')](config['root'],_0x5a82('0x55'),util[_0x5a82('0x58')]('%s.%s',path['basename'](_0x16d770[_0x5a82('0x5b')]['filename'],path[_0x5a82('0x5d')](_0x16d770[_0x5a82('0x5b')][_0x5a82('0x5e')])),_0x242a6e[_0x5a82('0x51')]));logger[_0x5a82('0x60')]('Sound\x20upload\x20filepath:\x20%s',_0x4bd2f3);logger['info'](_0x5a82('0x61'),_0x5cd377);try{fs['chmodSync'](_0x4bd2f3,parseInt(_0x5a82('0x62'),0x8));var _0x35615b=sox[_0x5a82('0x63')](_0x4bd2f3,_0x5cd377,{'sampleRate':0x1f40,'format':_0x5a82('0x64'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x35615b['on'](_0x5a82('0x2e'),function(_0x38bfcc){fs[_0x5a82('0x65')](_0x4bd2f3);_0x124b08[_0x5a82('0x22')](0x1f4)[_0x5a82('0x66')](_0x38bfcc);});_0x35615b['on'](_0x5a82('0x67'),function(_0x46a803){_0x242a6e[_0x5a82('0x68')]=isNaN(_0x46a803[_0x5a82('0x69')])?null:_0x46a803[_0x5a82('0x69')]*0x3e8;_0x242a6e[_0x5a82('0x6a')]=isNaN(_0x46a803[_0x5a82('0x6b')])?null:_0x46a803[_0x5a82('0x6b')];_0x242a6e[_0x5a82('0x6c')]=isNaN(_0x46a803[_0x5a82('0x6d')])?null:_0x46a803[_0x5a82('0x6d')];_0x242a6e[_0x5a82('0x6e')]=isNaN(_0x46a803[_0x5a82('0x6f')])?null:_0x46a803['bitRate'];_0x242a6e[_0x5a82('0x70')]=isNaN(_0x46a803[_0x5a82('0x71')])?null:_0x46a803[_0x5a82('0x71')];});_0x35615b['on']('dest',function(_0x2add73){_0x242a6e['converted_duration']=isNaN(_0x2add73[_0x5a82('0x69')])?null:_0x2add73[_0x5a82('0x69')]*0x3e8;_0x242a6e[_0x5a82('0x72')]=isNaN(_0x2add73[_0x5a82('0x6b')])?null:_0x2add73['sampleCount'];_0x242a6e['converted_channelCount']=isNaN(_0x2add73[_0x5a82('0x6d')])?null:_0x2add73['channelCount'];_0x242a6e[_0x5a82('0x73')]=isNaN(_0x2add73[_0x5a82('0x6f')])?null:_0x2add73[_0x5a82('0x6f')];_0x242a6e[_0x5a82('0x74')]=isNaN(_0x2add73[_0x5a82('0x71')])?null:_0x2add73[_0x5a82('0x71')];});_0x35615b['on'](_0x5a82('0x1c'),function(){fs[_0x5a82('0x75')](_0x5cd377,parseInt(_0x5a82('0x62'),0x8));return db[_0x5a82('0x45')][_0x5a82('0x76')](_0x242a6e)[_0x5a82('0x29')](function(_0x2f122e){var _0x3cdb13={'role':_0x16d770[_0x5a82('0x77')][_0x5a82('0x78')],'userProfileId':_0x16d770[_0x5a82('0x77')]['userProfileId']};if(!_0x3cdb13)throw new Error(_0x5a82('0x79'));if(_0x3cdb13['role']===_0x5a82('0x7a')){var _0x3e8325=_0x2f122e[_0x5a82('0x2b')]({'plain':!![]});return db[_0x5a82('0x7b')][_0x5a82('0x4d')]({'where':{'name':_0x5a82('0x2c'),'userProfileId':_0x3cdb13['userProfileId']},'raw':!![]})[_0x5a82('0x29')](function(_0x3c0319){if(_0x3c0319&&_0x3c0319[_0x5a82('0x7c')]===0x0){return db['UserProfileResource'][_0x5a82('0x76')]({'name':_0x3e8325[_0x5a82('0x30')],'resourceId':_0x3e8325['id'],'type':_0x3c0319[_0x5a82('0x30')],'sectionId':_0x3c0319['id']},{})[_0x5a82('0x29')](function(){return _0x2f122e;});}else{return _0x2f122e;}})[_0x5a82('0x4e')](function(_0x573324){logger[_0x5a82('0x2e')](_0x5a82('0x7d'),_0x573324);throw _0x573324;});}return _0x2f122e;})[_0x5a82('0x29')](respondWithResult(_0x124b08,null))['catch'](handleError(_0x124b08,null));});_0x35615b['start']();}catch(_0x2e2d39){_0x124b08[_0x5a82('0x22')](0x1f4)[_0x5a82('0x66')](_0x2e2d39);}};exports[_0x5a82('0x28')]=function(_0x3018ce,_0x50f075,_0x5f4464){return db[_0x5a82('0x45')]['find']({'where':{'id':_0x3018ce[_0x5a82('0x49')]['id']}})['then'](handleEntityNotFound(_0x50f075,null))[_0x5a82('0x29')](saveUpdates(_[_0x5a82('0x41')](_0x3018ce['body'],[_0x5a82('0x30'),_0x5a82('0x7e')]),null))[_0x5a82('0x29')](respondWithResult(_0x50f075,null))['catch'](handleError(_0x50f075,null));};exports[_0x5a82('0x7f')]=function(_0x3eba9b,_0x439707,_0x199661){return db[_0x5a82('0x45')][_0x5a82('0x4d')]({'where':{'id':_0x3eba9b[_0x5a82('0x49')]['id']}})[_0x5a82('0x29')](function(_0x52ef8b){if(_0x52ef8b){return _0x52ef8b[_0x5a82('0x2a')]();}})['then'](function(_0x1efe47){var _0xa479c=path['join'](config[_0x5a82('0x54')],_0x5a82('0x80'),util[_0x5a82('0x58')](_0x5a82('0x59'),_0x1efe47[_0x5a82('0x50')],_0x1efe47[_0x5a82('0x81')]));var _0x5c72fd=path[_0x5a82('0x53')](config[_0x5a82('0x54')],_0x5a82('0x55'),util[_0x5a82('0x58')](_0x5a82('0x59'),_0x1efe47[_0x5a82('0x50')],_0x1efe47['converted_format']));fs[_0x5a82('0x65')](_0xa479c);fs[_0x5a82('0x65')](_0x5c72fd);return _0x1efe47;})[_0x5a82('0x29')](function(_0x5313c2){if(_0x5313c2){return _0x439707[_0x5a82('0x22')](0xcc)['end']();}})[_0x5a82('0x29')](handleEntityNotFound(_0x439707,null))[_0x5a82('0x4e')](handleError(_0x439707,null));};
\ No newline at end of file
index 12e9dff..1567278 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe35=['moment','request-promise','path','exports','define','Sound','tools_sounds','lodash','util','api'];(function(_0x113e32,_0x5339f0){var _0x4ff939=function(_0x2be9ca){while(--_0x2be9ca){_0x113e32['push'](_0x113e32['shift']());}};_0x4ff939(++_0x5339f0);}(_0xfe35,0x1dd));var _0x5fe3=function(_0x400d9b,_0x2782c1){_0x400d9b=_0x400d9b-0x0;var _0x5bf8d7=_0xfe35[_0x400d9b];return _0x5bf8d7;};'use strict';var _=require(_0x5fe3('0x0'));var util=require(_0x5fe3('0x1'));var logger=require('../../config/logger')(_0x5fe3('0x2'));var moment=require(_0x5fe3('0x3'));var BPromise=require('bluebird');var rp=require(_0x5fe3('0x4'));var fs=require('fs');var path=require(_0x5fe3('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./sound.attributes');module[_0x5fe3('0x6')]=function(_0x23fc82,_0x120b91){return _0x23fc82[_0x5fe3('0x7')](_0x5fe3('0x8'),attributes,{'tableName':_0x5fe3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5767=['bluebird','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','util','moment'];(function(_0x5e4751,_0x3b65de){var _0x5e4aeb=function(_0x5bf5e0){while(--_0x5bf5e0){_0x5e4751['push'](_0x5e4751['shift']());}};_0x5e4aeb(++_0x3b65de);}(_0x5767,0x120));var _0x7576=function(_0x55b8f5,_0xe5f57c){_0x55b8f5=_0x55b8f5-0x0;var _0x966086=_0x5767[_0x55b8f5];return _0x966086;};'use strict';var _=require('lodash');var util=require(_0x7576('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x7576('0x1'));var BPromise=require(_0x7576('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7576('0x3'));var config=require(_0x7576('0x4'));var attributes=require(_0x7576('0x5'));module[_0x7576('0x6')]=function(_0x3c63dd,_0x208ad4){return _0x3c63dd[_0x7576('0x7')](_0x7576('0x8'),attributes,{'tableName':_0x7576('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0bc5b7a..062f062 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x838c=['find','options','raw','attributes','include','map','model','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSound','Sound'];(function(_0x2b5318,_0x1dcff0){var _0x16e75b=function(_0xbe8e45){while(--_0xbe8e45){_0x2b5318['push'](_0x2b5318['shift']());}};_0x16e75b(++_0x1dcff0);}(_0x838c,0x64));var _0xc838=function(_0x5a0549,_0x4fedd6){_0x5a0549=_0x5a0549-0x0;var _0x424f3a=_0x838c[_0x5a0549];return _0x424f3a;};'use strict';var _=require(_0xc838('0x0'));var util=require(_0xc838('0x1'));var moment=require(_0xc838('0x2'));var BPromise=require('bluebird');var rs=require(_0xc838('0x3'));var fs=require('fs');var Redis=require(_0xc838('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc838('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xc838('0x6'));var jayson=require(_0xc838('0x7'));var client=jayson[_0xc838('0x8')][_0xc838('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2fbcbc,_0x3635a8,_0xdad79c){return new BPromise(function(_0x4be78d,_0x4e4f71){return client[_0xc838('0xa')](_0x2fbcbc,_0xdad79c)[_0xc838('0xb')](function(_0x407e8d){logger[_0xc838('0xc')](_0xc838('0xd'),_0x3635a8,_0xc838('0xe'));logger[_0xc838('0xf')](_0xc838('0x10'),_0x3635a8,_0xc838('0xe'),JSON[_0xc838('0x11')](_0x407e8d));if(_0x407e8d[_0xc838('0x12')]){if(_0x407e8d[_0xc838('0x12')]['code']===0x1f4){logger[_0xc838('0x12')](_0xc838('0xd'),_0x3635a8,_0x407e8d['error'][_0xc838('0x13')]);return _0x4e4f71(_0x407e8d['error'][_0xc838('0x13')]);}logger[_0xc838('0x12')](_0xc838('0xd'),_0x3635a8,_0x407e8d['error'][_0xc838('0x13')]);return _0x4be78d(_0x407e8d[_0xc838('0x12')][_0xc838('0x13')]);}else{logger[_0xc838('0xc')](_0xc838('0xd'),_0x3635a8,_0xc838('0xe'));_0x4be78d(_0x407e8d[_0xc838('0x14')]['message']);}})[_0xc838('0x15')](function(_0x25fe5f){logger['error']('Sound,\x20%s,\x20%s',_0x3635a8,_0x25fe5f);_0x4e4f71(_0x25fe5f);});});}exports[_0xc838('0x16')]=function(_0x493dcc){var _0x4df3f0=this;return new Promise(function(_0x530d55,_0x11be9f){return db[_0xc838('0x17')][_0xc838('0x18')]({'raw':_0x493dcc[_0xc838('0x19')]?_0x493dcc[_0xc838('0x19')][_0xc838('0x1a')]===undefined?!![]:![]:!![],'where':_0x493dcc[_0xc838('0x19')]?_0x493dcc[_0xc838('0x19')]['where']||null:null,'attributes':_0x493dcc[_0xc838('0x19')]?_0x493dcc[_0xc838('0x19')][_0xc838('0x1b')]||null:null,'include':_0x493dcc[_0xc838('0x19')]?_0x493dcc[_0xc838('0x19')][_0xc838('0x1c')]?_[_0xc838('0x1d')](_0x493dcc['options'][_0xc838('0x1c')],function(_0x4a1eb3){return{'model':db[_0x4a1eb3['model']],'as':_0x4a1eb3['as'],'attributes':_0x4a1eb3[_0xc838('0x1b')],'include':_0x4a1eb3[_0xc838('0x1c')]?_[_0xc838('0x1d')](_0x4a1eb3[_0xc838('0x1c')],function(_0xda7670){return{'model':db[_0xda7670[_0xc838('0x1e')]],'as':_0xda7670['as'],'attributes':_0xda7670[_0xc838('0x1b')],'include':_0xda7670[_0xc838('0x1c')]?_[_0xc838('0x1d')](_0xda7670['include'],function(_0x38178f){return{'model':db[_0x38178f[_0xc838('0x1e')]],'as':_0x38178f['as'],'attributes':_0x38178f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x158ed5){logger[_0xc838('0xc')](_0xc838('0x16'),_0x493dcc);logger[_0xc838('0xf')](_0xc838('0x16'),_0x493dcc,JSON['stringify'](_0x158ed5));_0x530d55(_0x158ed5);})[_0xc838('0x15')](function(_0x5b83d9){logger[_0xc838('0x12')](_0xc838('0x16'),_0x5b83d9[_0xc838('0x13')],_0x493dcc);_0x11be9f(_0x4df3f0[_0xc838('0x12')](0x1f4,_0x5b83d9[_0xc838('0x13')]));});});};
\ No newline at end of file
+var _0x0374=['where','attributes','include','map','model','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','ShowSound','find','raw','options'];(function(_0x53a763,_0x32cebe){var _0x1d980c=function(_0x1ebeba){while(--_0x1ebeba){_0x53a763['push'](_0x53a763['shift']());}};_0x1d980c(++_0x32cebe);}(_0x0374,0x92));var _0x4037=function(_0x37e012,_0x5acfff){_0x37e012=_0x37e012-0x0;var _0x25cc83=_0x0374[_0x37e012];return _0x25cc83;};'use strict';var _=require(_0x4037('0x0'));var util=require(_0x4037('0x1'));var moment=require(_0x4037('0x2'));var BPromise=require(_0x4037('0x3'));var rs=require(_0x4037('0x4'));var fs=require('fs');var Redis=require(_0x4037('0x5'));var db=require(_0x4037('0x6'))['db'];var utils=require(_0x4037('0x7'));var logger=require(_0x4037('0x8'))(_0x4037('0x9'));var config=require(_0x4037('0xa'));var jayson=require(_0x4037('0xb'));var client=jayson[_0x4037('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f369a,_0x7fafa,_0x18cb3f){return new BPromise(function(_0x5b229b,_0x127df7){return client[_0x4037('0xd')](_0x5f369a,_0x18cb3f)[_0x4037('0xe')](function(_0x1f64f9){logger['info'](_0x4037('0xf'),_0x7fafa,_0x4037('0x10'));logger[_0x4037('0x11')](_0x4037('0x12'),_0x7fafa,_0x4037('0x10'),JSON['stringify'](_0x1f64f9));if(_0x1f64f9[_0x4037('0x13')]){if(_0x1f64f9['error'][_0x4037('0x14')]===0x1f4){logger['error'](_0x4037('0xf'),_0x7fafa,_0x1f64f9[_0x4037('0x13')]['message']);return _0x127df7(_0x1f64f9[_0x4037('0x13')]['message']);}logger[_0x4037('0x13')](_0x4037('0xf'),_0x7fafa,_0x1f64f9['error'][_0x4037('0x15')]);return _0x5b229b(_0x1f64f9[_0x4037('0x13')][_0x4037('0x15')]);}else{logger[_0x4037('0x16')](_0x4037('0xf'),_0x7fafa,_0x4037('0x10'));_0x5b229b(_0x1f64f9[_0x4037('0x17')][_0x4037('0x15')]);}})[_0x4037('0x18')](function(_0x3aad72){logger[_0x4037('0x13')]('Sound,\x20%s,\x20%s',_0x7fafa,_0x3aad72);_0x127df7(_0x3aad72);});});}exports[_0x4037('0x19')]=function(_0x2e2ece){var _0x19abb4=this;return new Promise(function(_0x3e6a2b,_0x3fda54){return db['Sound'][_0x4037('0x1a')]({'raw':_0x2e2ece['options']?_0x2e2ece['options'][_0x4037('0x1b')]===undefined?!![]:![]:!![],'where':_0x2e2ece[_0x4037('0x1c')]?_0x2e2ece[_0x4037('0x1c')][_0x4037('0x1d')]||null:null,'attributes':_0x2e2ece[_0x4037('0x1c')]?_0x2e2ece['options'][_0x4037('0x1e')]||null:null,'include':_0x2e2ece['options']?_0x2e2ece[_0x4037('0x1c')][_0x4037('0x1f')]?_[_0x4037('0x20')](_0x2e2ece[_0x4037('0x1c')][_0x4037('0x1f')],function(_0x1ac2c9){return{'model':db[_0x1ac2c9[_0x4037('0x21')]],'as':_0x1ac2c9['as'],'attributes':_0x1ac2c9[_0x4037('0x1e')],'include':_0x1ac2c9[_0x4037('0x1f')]?_[_0x4037('0x20')](_0x1ac2c9[_0x4037('0x1f')],function(_0x44e27a){return{'model':db[_0x44e27a['model']],'as':_0x44e27a['as'],'attributes':_0x44e27a[_0x4037('0x1e')],'include':_0x44e27a[_0x4037('0x1f')]?_[_0x4037('0x20')](_0x44e27a[_0x4037('0x1f')],function(_0x13a772){return{'model':db[_0x13a772[_0x4037('0x21')]],'as':_0x13a772['as'],'attributes':_0x13a772[_0x4037('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4037('0xe')](function(_0x2393df){logger['info'](_0x4037('0x19'),_0x2e2ece);logger[_0x4037('0x11')]('ShowSound',_0x2e2ece,JSON[_0x4037('0x22')](_0x2393df));_0x3e6a2b(_0x2393df);})[_0x4037('0x18')](function(_0x375e40){logger[_0x4037('0x13')](_0x4037('0x19'),_0x375e40[_0x4037('0x15')],_0x2e2ece);_0x3fda54(_0x19abb4['error'](0x1f4,_0x375e40['message']));});});};
\ No newline at end of file
index 4da8398..665b75d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xac4a=['express','Router','../../components/interaction/service','../../config/environment','./squareMessage.controller','isAuthenticated','get','show','create','/:id','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x1d98bb,_0x2331a4){var _0xde77f6=function(_0x5df43d){while(--_0x5df43d){_0x1d98bb['push'](_0x1d98bb['shift']());}};_0xde77f6(++_0x2331a4);}(_0xac4a,0x13f));var _0xaac4=function(_0xdc17c4,_0x54aa8c){_0xdc17c4=_0xdc17c4-0x0;var _0x2ab467=_0xac4a[_0xdc17c4];return _0x2ab467;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var controller=require(_0xaac4('0x8'));router['get']('/',auth[_0xaac4('0x9')](),controller['index']);router[_0xaac4('0xa')]('/:id',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router['put'](_0xaac4('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xaac4('0xe')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xf')]);module[_0xaac4('0x10')]=router;
\ No newline at end of file
+var _0x8603=['../../components/interaction/service','./squareMessage.controller','isAuthenticated','index','get','/:id','create','put','update','exports','util','path','connect-timeout','fs-extra','../../components/auth/service'];(function(_0xa6cb09,_0x39410f){var _0x12b437=function(_0x1813cc){while(--_0x1813cc){_0xa6cb09['push'](_0xa6cb09['shift']());}};_0x12b437(++_0x39410f);}(_0x8603,0x190));var _0x3860=function(_0xf74ddb,_0x8383bd){_0xf74ddb=_0xf74ddb-0x0;var _0x44e4cd=_0x8603[_0xf74ddb];return _0x44e4cd;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x3860('0xb')]);router[_0x3860('0xc')]('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xd')]);router['delete'](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['destroy']);module[_0x3860('0xe')]=router;
\ No newline at end of file
index 6d444ef..d017bde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc572=['ENUM','out','STRING','TEXT','sequelize','exports','medium'];(function(_0x2c6464,_0x51817d){var _0x58e452=function(_0x39b8f3){while(--_0x39b8f3){_0x2c6464['push'](_0x2c6464['shift']());}};_0x58e452(++_0x51817d);}(_0xc572,0x131));var _0x2c57=function(_0x43eec6,_0x14d3f3){_0x43eec6=_0x43eec6-0x0;var _0x338e15=_0xc572[_0x43eec6];return _0x338e15;};'use strict';var Sequelize=require(_0x2c57('0x0'));module[_0x2c57('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize['TEXT'](_0x2c57('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x2c57('0x3')]('in',_0x2c57('0x4')),'defaultValue':_0x2c57('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0x2c57('0x5')]},'providerResponse':{'type':Sequelize[_0x2c57('0x6')]}};
\ No newline at end of file
+var _0xe2d4=['sequelize','TEXT','medium','ENUM','out','STRING'];(function(_0xd63e3a,_0x1bd6eb){var _0x19c178=function(_0x56be0d){while(--_0x56be0d){_0xd63e3a['push'](_0xd63e3a['shift']());}};_0x19c178(++_0x1bd6eb);}(_0xe2d4,0x1bc));var _0x4e2d=function(_0x1fb25a,_0xdd188c){_0x1fb25a=_0x1fb25a-0x0;var _0x433829=_0xe2d4[_0x1fb25a];return _0x433829;};'use strict';var Sequelize=require(_0x4e2d('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x4e2d('0x1')](_0x4e2d('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x4e2d('0x3')]('in',_0x4e2d('0x4')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x4e2d('0x5')]},'providerResponse':{'type':Sequelize[_0x4e2d('0x1')]}};
\ No newline at end of file
index b9278ac..b3e9369 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x639a=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','then','error','name','send','index','map','SquareMessage','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','length','find','create','body','catch','destroy','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','ejs'];(function(_0x29b326,_0x9889d8){var _0x323dd8=function(_0x41950f){while(--_0x41950f){_0x29b326['push'](_0x29b326['shift']());}};_0x323dd8(++_0x9889d8);}(_0x639a,0x1e8));var _0xa639=function(_0x568b45,_0x4ccd6a){_0x568b45=_0x568b45-0x0;var _0x41475e=_0x639a[_0x568b45];return _0x41475e;};'use strict';var emlformat=require(_0xa639('0x0'));var rimraf=require(_0xa639('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa639('0x2'));var moment=require(_0xa639('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa639('0x4'));var util=require(_0xa639('0x5'));var path=require(_0xa639('0x6'));var sox=require(_0xa639('0x7'));var csv=require('to-csv');var ejs=require(_0xa639('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa639('0x9'));var squel=require(_0xa639('0xa'));var crypto=require(_0xa639('0xb'));var jsforce=require(_0xa639('0xc'));var deskjs=require(_0xa639('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa639('0xe'));var Papa=require(_0xa639('0xf'));var Redis=require(_0xa639('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa639('0x11'));var as=require(_0xa639('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa639('0x13'))(_0xa639('0x14'));var utils=require('../../config/utils');var config=require(_0xa639('0x15'));var licenseUtil=require(_0xa639('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x450aa7,_0x1a666e){_0x1a666e=_0x1a666e||0xcc;return function(_0x110488){if(_0x110488){return _0x450aa7[_0xa639('0x17')](_0x1a666e);}return _0x450aa7[_0xa639('0x18')](_0x1a666e)[_0xa639('0x19')]();};}function respondWithResult(_0x3dc4b5,_0x56fa87){_0x56fa87=_0x56fa87||0xc8;return function(_0x15605d){if(_0x15605d){return _0x3dc4b5[_0xa639('0x18')](_0x56fa87)[_0xa639('0x1a')](_0x15605d);}};}function respondWithFilteredResult(_0x28f05c,_0x19436b){return function(_0x7ec7ce){if(_0x7ec7ce){var _0x10c096=typeof _0x19436b[_0xa639('0x1b')]===_0xa639('0x1c')&&typeof _0x19436b['limit']===_0xa639('0x1c');var _0x1d4f47=_0x7ec7ce['count'];var _0x15002b=_0x10c096?0x0:_0x19436b[_0xa639('0x1b')];var _0x200a65=_0x10c096?_0x7ec7ce[_0xa639('0x1d')]:_0x19436b['offset']+_0x19436b[_0xa639('0x1e')];var _0x108005;if(_0x200a65>=_0x1d4f47){_0x200a65=_0x1d4f47;_0x108005=0xc8;}else{_0x108005=0xce;}_0x28f05c[_0xa639('0x18')](_0x108005);return _0x28f05c[_0xa639('0x1f')]('Content-Range',_0x15002b+'-'+_0x200a65+'/'+_0x1d4f47)[_0xa639('0x1a')](_0x7ec7ce);}return null;};}function patchUpdates(_0x4509df){return function(_0x32d216){try{jsonpatch[_0xa639('0x20')](_0x32d216,_0x4509df,!![]);}catch(_0x20c03d){return BPromise['reject'](_0x20c03d);}return _0x32d216[_0xa639('0x21')]();};}function saveUpdates(_0x1180f1,_0x107a5d){return function(_0x917ed4){if(_0x917ed4){return _0x917ed4['update'](_0x1180f1)[_0xa639('0x22')](function(_0x597397){return _0x597397;});}return null;};}function removeEntity(_0x40954e,_0x11299b){return function(_0x3442cd){if(_0x3442cd){return _0x3442cd['destroy']()[_0xa639('0x22')](function(){_0x40954e['status'](0xcc)[_0xa639('0x19')]();});}};}function handleEntityNotFound(_0x127fa9,_0x10ff2b){return function(_0x14a86d){if(!_0x14a86d){_0x127fa9['sendStatus'](0x194);}return _0x14a86d;};}function handleError(_0x3e4b0b,_0x176dcf){_0x176dcf=_0x176dcf||0x1f4;return function(_0x1414be){logger[_0xa639('0x23')](_0x1414be['stack']);if(_0x1414be[_0xa639('0x24')]){delete _0x1414be[_0xa639('0x24')];}_0x3e4b0b[_0xa639('0x18')](_0x176dcf)[_0xa639('0x25')](_0x1414be);};}exports[_0xa639('0x26')]=function(_0x343360,_0x4cf740){var _0x4cbf18={},_0x43c236={},_0x2cf80a={'count':0x0,'rows':[]};var _0x3a82b5=_[_0xa639('0x27')](db[_0xa639('0x28')]['rawAttributes'],function(_0x5151a1){return{'name':_0x5151a1[_0xa639('0x29')],'type':_0x5151a1['type'][_0xa639('0x2a')]};});_0x43c236['model']=_[_0xa639('0x27')](_0x3a82b5,_0xa639('0x24'));_0x43c236[_0xa639('0x2b')]=_[_0xa639('0x2c')](_0x343360[_0xa639('0x2b')]);_0x43c236[_0xa639('0x2d')]=_[_0xa639('0x2e')](_0x43c236[_0xa639('0x2f')],_0x43c236['query']);_0x4cbf18[_0xa639('0x30')]=_['intersection'](_0x43c236[_0xa639('0x2f')],qs[_0xa639('0x31')](_0x343360['query'][_0xa639('0x31')]));_0x4cbf18[_0xa639('0x30')]=_0x4cbf18['attributes']['length']?_0x4cbf18[_0xa639('0x30')]:_0x43c236[_0xa639('0x2f')];if(!_0x343360[_0xa639('0x2b')][_0xa639('0x32')](_0xa639('0x33'))){_0x4cbf18[_0xa639('0x1e')]=qs['limit'](_0x343360['query'][_0xa639('0x1e')]);_0x4cbf18[_0xa639('0x1b')]=qs['offset'](_0x343360[_0xa639('0x2b')][_0xa639('0x1b')]);}_0x4cbf18[_0xa639('0x34')]=qs[_0xa639('0x35')](_0x343360['query'][_0xa639('0x35')]);_0x4cbf18[_0xa639('0x36')]=qs[_0xa639('0x2d')](_[_0xa639('0x37')](_0x343360['query'],_0x43c236[_0xa639('0x2d')]),_0x3a82b5);if(_0x343360[_0xa639('0x2b')][_0xa639('0x38')]){_0x4cbf18[_0xa639('0x36')]=_[_0xa639('0x39')](_0x4cbf18[_0xa639('0x36')],{'$or':_[_0xa639('0x27')](_0x3a82b5,function(_0x78f94e){if(_0x78f94e[_0xa639('0x3a')]!==_0xa639('0x3b')){var _0x1256a1={};_0x1256a1[_0x78f94e[_0xa639('0x24')]]={'$like':'%'+_0x343360[_0xa639('0x2b')][_0xa639('0x38')]+'%'};return _0x1256a1;}})});}_0x4cbf18=_[_0xa639('0x39')]({},_0x4cbf18,_0x343360[_0xa639('0x3c')]);var _0x563c70={'where':_0x4cbf18[_0xa639('0x36')]};return db[_0xa639('0x28')][_0xa639('0x1d')](_0x563c70)['then'](function(_0x12dd1b){_0x2cf80a[_0xa639('0x1d')]=_0x12dd1b;if(_0x343360[_0xa639('0x2b')][_0xa639('0x3d')]){_0x4cbf18[_0xa639('0x3e')]=[{'all':!![]}];}return db[_0xa639('0x28')][_0xa639('0x3f')](_0x4cbf18);})['then'](function(_0x379143){_0x2cf80a[_0xa639('0x40')]=_0x379143;return _0x2cf80a;})[_0xa639('0x22')](respondWithFilteredResult(_0x4cf740,_0x4cbf18))['catch'](handleError(_0x4cf740,null));};exports['show']=function(_0x571963,_0x16e342){var _0x153aee={'raw':!![],'where':{'id':_0x571963['params']['id']}},_0x6c7dd7={};_0x6c7dd7['model']=_[_0xa639('0x2c')](db[_0xa639('0x28')]['rawAttributes']);_0x6c7dd7[_0xa639('0x2b')]=_['keys'](_0x571963['query']);_0x6c7dd7[_0xa639('0x2d')]=_[_0xa639('0x2e')](_0x6c7dd7['model'],_0x6c7dd7[_0xa639('0x2b')]);_0x153aee[_0xa639('0x30')]=_[_0xa639('0x2e')](_0x6c7dd7[_0xa639('0x2f')],qs[_0xa639('0x31')](_0x571963[_0xa639('0x2b')][_0xa639('0x31')]));_0x153aee[_0xa639('0x30')]=_0x153aee[_0xa639('0x30')][_0xa639('0x41')]?_0x153aee[_0xa639('0x30')]:_0x6c7dd7['model'];if(_0x571963[_0xa639('0x2b')]['includeAll']){_0x153aee[_0xa639('0x3e')]=[{'all':!![]}];}_0x153aee=_[_0xa639('0x39')]({},_0x153aee,_0x571963[_0xa639('0x3c')]);return db[_0xa639('0x28')][_0xa639('0x42')](_0x153aee)[_0xa639('0x22')](handleEntityNotFound(_0x16e342,null))[_0xa639('0x22')](respondWithResult(_0x16e342,null))['catch'](handleError(_0x16e342,null));};exports['create']=function(_0x4d0edd,_0x34dac5){return db[_0xa639('0x28')][_0xa639('0x43')](_0x4d0edd['body'],{})[_0xa639('0x22')](respondWithResult(_0x34dac5,0xc9))['catch'](handleError(_0x34dac5,null));};exports['update']=function(_0x267551,_0xb805cc){if(_0x267551[_0xa639('0x44')]['id']){delete _0x267551[_0xa639('0x44')]['id'];}return db['SquareMessage']['find']({'where':{'id':_0x267551['params']['id']}})[_0xa639('0x22')](handleEntityNotFound(_0xb805cc,null))['then'](saveUpdates(_0x267551[_0xa639('0x44')],null))[_0xa639('0x22')](respondWithResult(_0xb805cc,null))[_0xa639('0x45')](handleError(_0xb805cc,null));};exports[_0xa639('0x46')]=function(_0x303f5a,_0x381990){return db[_0xa639('0x28')][_0xa639('0x42')]({'where':{'id':_0x303f5a['params']['id']}})[_0xa639('0x22')](handleEntityNotFound(_0x381990,null))[_0xa639('0x22')](removeEntity(_0x381990,null))[_0xa639('0x45')](handleError(_0x381990,null));};
\ No newline at end of file
+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(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x556a,0x1dd));var _0xa556=function(_0x392c0d,_0x141ec5){_0x392c0d=_0x392c0d-0x0;var _0x17e69a=_0x556a[_0x392c0d];return _0x17e69a;};'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
index 4f0bac1..0b15dff 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa1db=['util','../../config/logger','moment','bluebird','./squareMessage.attributes','exports','SquareMessage','square_messages'];(function(_0x537ae5,_0x467295){var _0x2d518e=function(_0x83b7f6){while(--_0x83b7f6){_0x537ae5['push'](_0x537ae5['shift']());}};_0x2d518e(++_0x467295);}(_0xa1db,0x1c8));var _0xba1d=function(_0x9117ad,_0x386be4){_0x9117ad=_0x9117ad-0x0;var _0x540f0c=_0xa1db[_0x9117ad];return _0x540f0c;};'use strict';var _=require('lodash');var util=require(_0xba1d('0x0'));var logger=require(_0xba1d('0x1'))('api');var moment=require(_0xba1d('0x2'));var BPromise=require(_0xba1d('0x3'));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(_0xba1d('0x4'));module[_0xba1d('0x5')]=function(_0x3e7808,_0x125a3e){return _0x3e7808['define'](_0xba1d('0x6'),attributes,{'tableName':_0xba1d('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xde87=['moment','bluebird','request-promise','rimraf','./squareMessage.attributes','exports','define','square_messages','lodash','../../config/logger','api'];(function(_0x455b2a,_0x565935){var _0x2bf6d1=function(_0x1ab5f0){while(--_0x1ab5f0){_0x455b2a['push'](_0x455b2a['shift']());}};_0x2bf6d1(++_0x565935);}(_0xde87,0x147));var _0x7de8=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xde87[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x7de8('0x0'));var util=require('util');var logger=require(_0x7de8('0x1'))(_0x7de8('0x2'));var moment=require(_0x7de8('0x3'));var BPromise=require(_0x7de8('0x4'));var rp=require(_0x7de8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7de8('0x6'));var config=require('../../config/environment');var attributes=require(_0x7de8('0x7'));module[_0x7de8('0x8')]=function(_0x389b86,_0x521ee8){return _0x389b86[_0x7de8('0x9')]('SquareMessage',attributes,{'tableName':_0x7de8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 89ee697..ffa9767 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x45bc=['options','raw','CreateSquareMessage','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','SquareMessage','create','body'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0x45bc,0xb8));var _0xc45b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x45bc[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc45b('0x0'));var util=require(_0xc45b('0x1'));var moment=require(_0xc45b('0x2'));var BPromise=require(_0xc45b('0x3'));var rs=require(_0xc45b('0x4'));var fs=require('fs');var Redis=require(_0xc45b('0x5'));var db=require(_0xc45b('0x6'))['db'];var utils=require(_0xc45b('0x7'));var logger=require('../../config/logger')(_0xc45b('0x8'));var config=require(_0xc45b('0x9'));var jayson=require(_0xc45b('0xa'));var client=jayson[_0xc45b('0xb')][_0xc45b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2573a2,_0x18db46,_0x185037){return new BPromise(function(_0x49ed89,_0x241f31){return client['request'](_0x2573a2,_0x185037)[_0xc45b('0xd')](function(_0x3f24e6){logger[_0xc45b('0xe')](_0xc45b('0xf'),_0x18db46,_0xc45b('0x10'));logger[_0xc45b('0x11')](_0xc45b('0x12'),_0x18db46,_0xc45b('0x10'),JSON[_0xc45b('0x13')](_0x3f24e6));if(_0x3f24e6[_0xc45b('0x14')]){if(_0x3f24e6[_0xc45b('0x14')]['code']===0x1f4){logger[_0xc45b('0x14')](_0xc45b('0xf'),_0x18db46,_0x3f24e6[_0xc45b('0x14')][_0xc45b('0x15')]);return _0x241f31(_0x3f24e6[_0xc45b('0x14')]['message']);}logger[_0xc45b('0x14')](_0xc45b('0xf'),_0x18db46,_0x3f24e6['error'][_0xc45b('0x15')]);return _0x49ed89(_0x3f24e6['error'][_0xc45b('0x15')]);}else{logger[_0xc45b('0xe')](_0xc45b('0xf'),_0x18db46,_0xc45b('0x10'));_0x49ed89(_0x3f24e6[_0xc45b('0x16')]['message']);}})['catch'](function(_0x231137){logger[_0xc45b('0x14')](_0xc45b('0xf'),_0x18db46,_0x231137);_0x241f31(_0x231137);});});}exports['CreateSquareMessage']=function(_0xb26c77){var _0x2dbd97=this;return new Promise(function(_0x109a9d,_0x283fc1){return db[_0xc45b('0x17')][_0xc45b('0x18')](_0xb26c77[_0xc45b('0x19')],{'raw':_0xb26c77[_0xc45b('0x1a')]?_0xb26c77['options'][_0xc45b('0x1b')]===undefined?!![]:![]:!![]})[_0xc45b('0xd')](function(_0x39e651){logger['info'](_0xc45b('0x1c'),_0xb26c77);logger[_0xc45b('0x11')](_0xc45b('0x1c'),_0xb26c77,JSON[_0xc45b('0x13')](_0x39e651));_0x109a9d(_0x39e651);})[_0xc45b('0x1d')](function(_0xe3ca76){logger['error'](_0xc45b('0x1c'),_0xe3ca76[_0xc45b('0x15')],_0xb26c77);_0x283fc1(_0x2dbd97[_0xc45b('0x14')](0x1f4,_0xe3ca76[_0xc45b('0x15')]));});});};
\ No newline at end of file
+var _0x2c0f=['CreateSquareMessage','SquareMessage','body','options','raw','info','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x31474d,_0x2ad754){var _0x4fd6c6=function(_0x4dd58d){while(--_0x4dd58d){_0x31474d['push'](_0x31474d['shift']());}};_0x4fd6c6(++_0x2ad754);}(_0x2c0f,0x17f));var _0xf2c0=function(_0x13606d,_0x30f265){_0x13606d=_0x13606d-0x0;var _0x1b85b0=_0x2c0f[_0x13606d];return _0x1b85b0;};'use strict';var _=require(_0xf2c0('0x0'));var util=require(_0xf2c0('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf2c0('0x2'));var fs=require('fs');var Redis=require(_0xf2c0('0x3'));var db=require(_0xf2c0('0x4'))['db'];var utils=require(_0xf2c0('0x5'));var logger=require(_0xf2c0('0x6'))(_0xf2c0('0x7'));var config=require(_0xf2c0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf2c0('0x9')][_0xf2c0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x93ff77,_0x27e9f5,_0x5379b8){return new BPromise(function(_0x246b96,_0x3cdaab){return client[_0xf2c0('0xb')](_0x93ff77,_0x5379b8)[_0xf2c0('0xc')](function(_0x2b6214){logger['info'](_0xf2c0('0xd'),_0x27e9f5,_0xf2c0('0xe'));logger[_0xf2c0('0xf')](_0xf2c0('0x10'),_0x27e9f5,_0xf2c0('0xe'),JSON[_0xf2c0('0x11')](_0x2b6214));if(_0x2b6214[_0xf2c0('0x12')]){if(_0x2b6214[_0xf2c0('0x12')][_0xf2c0('0x13')]===0x1f4){logger[_0xf2c0('0x12')](_0xf2c0('0xd'),_0x27e9f5,_0x2b6214[_0xf2c0('0x12')][_0xf2c0('0x14')]);return _0x3cdaab(_0x2b6214[_0xf2c0('0x12')][_0xf2c0('0x14')]);}logger[_0xf2c0('0x12')](_0xf2c0('0xd'),_0x27e9f5,_0x2b6214['error']['message']);return _0x246b96(_0x2b6214[_0xf2c0('0x12')]['message']);}else{logger['info'](_0xf2c0('0xd'),_0x27e9f5,'request\x20sent');_0x246b96(_0x2b6214[_0xf2c0('0x15')]['message']);}})[_0xf2c0('0x16')](function(_0x254362){logger[_0xf2c0('0x12')](_0xf2c0('0xd'),_0x27e9f5,_0x254362);_0x3cdaab(_0x254362);});});}exports[_0xf2c0('0x17')]=function(_0x2e172f){var _0x5d9541=this;return new Promise(function(_0x1896a4,_0x594689){return db[_0xf2c0('0x18')]['create'](_0x2e172f[_0xf2c0('0x19')],{'raw':_0x2e172f[_0xf2c0('0x1a')]?_0x2e172f[_0xf2c0('0x1a')][_0xf2c0('0x1b')]===undefined?!![]:![]:!![]})[_0xf2c0('0xc')](function(_0x606c74){logger[_0xf2c0('0x1c')](_0xf2c0('0x17'),_0x2e172f);logger[_0xf2c0('0xf')](_0xf2c0('0x17'),_0x2e172f,JSON['stringify'](_0x606c74));_0x1896a4(_0x606c74);})['catch'](function(_0x1c53df){logger[_0xf2c0('0x12')]('CreateSquareMessage',_0x1c53df[_0xf2c0('0x14')],_0x2e172f);_0x594689(_0x5d9541[_0xf2c0('0x12')](0x1f4,_0x1c53df[_0xf2c0('0x14')]));});});};
\ No newline at end of file
index 17aba8f..a3b2410 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3651=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','/:id','show','/:id/test','15s','post','create','put','update','destroy','exports','multer'];(function(_0x688920,_0x43afd1){var _0x3df9fe=function(_0x45c4f0){while(--_0x45c4f0){_0x688920['push'](_0x688920['shift']());}};_0x3df9fe(++_0x43afd1);}(_0x3651,0x14f));var _0x1365=function(_0x553e9f,_0x4534ea){_0x553e9f=_0x553e9f-0x0;var _0x22c930=_0x3651[_0x553e9f];return _0x22c930;};'use strict';var multer=require(_0x1365('0x0'));var util=require('util');var path=require(_0x1365('0x1'));var timeout=require('connect-timeout');var express=require(_0x1365('0x2'));var router=express[_0x1365('0x3')]();var fs_extra=require(_0x1365('0x4'));var auth=require(_0x1365('0x5'));var interaction=require(_0x1365('0x6'));var config=require(_0x1365('0x7'));var controller=require(_0x1365('0x8'));router[_0x1365('0x9')]('/',auth[_0x1365('0xa')](),controller['index']);router['get'](_0x1365('0xb'),auth['isAuthenticated'](),controller[_0x1365('0xc')]);router[_0x1365('0x9')](_0x1365('0xd'),auth[_0x1365('0xa')](),timeout(_0x1365('0xe')),controller['test']);router[_0x1365('0xf')]('/',auth[_0x1365('0xa')](),controller[_0x1365('0x10')]);router[_0x1365('0x11')](_0x1365('0xb'),auth[_0x1365('0xa')](),controller[_0x1365('0x12')]);router['delete'](_0x1365('0xb'),auth[_0x1365('0xa')](),controller[_0x1365('0x13')]);module[_0x1365('0x14')]=router;
\ No newline at end of file
+var _0x055d=['get','/:id','show','15s','test','put','delete','destroy','exports','path','connect-timeout','express','../../config/environment','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x055d,0x1bc));var _0xd055=function(_0x33a204,_0x496414){_0x33a204=_0x33a204-0x0;var _0x2d9fd5=_0x055d[_0x33a204];return _0x2d9fd5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd055('0x0'));var timeout=require(_0xd055('0x1'));var express=require(_0xd055('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(_0xd055('0x3'));var controller=require('./squareOdbc.controller');router['get']('/',auth[_0xd055('0x4')](),controller[_0xd055('0x5')]);router[_0xd055('0x6')](_0xd055('0x7'),auth[_0xd055('0x4')](),controller[_0xd055('0x8')]);router[_0xd055('0x6')]('/:id/test',auth[_0xd055('0x4')](),timeout(_0xd055('0x9')),controller[_0xd055('0xa')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xd055('0xb')](_0xd055('0x7'),auth[_0xd055('0x4')](),controller['update']);router[_0xd055('0xc')](_0xd055('0x7'),auth[_0xd055('0x4')](),controller[_0xd055('0xd')]);module[_0xd055('0xe')]=router;
\ No newline at end of file
index 73ed779..86b74e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8778=['STRING','name'];(function(_0x336f07,_0x34070d){var _0x6f7368=function(_0x4e7912){while(--_0x4e7912){_0x336f07['push'](_0x336f07['shift']());}};_0x6f7368(++_0x34070d);}(_0x8778,0x1af));var _0x8877=function(_0x411a41,_0xf3dc99){_0x411a41=_0x411a41-0x0;var _0x547fb2=_0x8778[_0x411a41];return _0x547fb2;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x8877('0x0'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8877('0x1')]}};
\ No newline at end of file
+var _0x4004=['name','exports','STRING'];(function(_0x28b9cc,_0x53d4e3){var _0x496e80=function(_0x1bfac0){while(--_0x1bfac0){_0x28b9cc['push'](_0x28b9cc['shift']());}};_0x496e80(++_0x53d4e3);}(_0x4004,0x1db));var _0x4400=function(_0x2e2292,_0x1891b8){_0x2e2292=_0x2e2292-0x0;var _0x4f77ab=_0x4004[_0x2e2292];return _0x4f77ab;};'use strict';var Sequelize=require('sequelize');module[_0x4400('0x0')]={'name':{'type':Sequelize[_0x4400('0x1')],'unique':_0x4400('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x4400('0x1')]},'description':{'type':Sequelize[_0x4400('0x1')]}};
\ No newline at end of file
index b8197c8..3468300 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4681=['destroy','ODBC','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','SquareOdbc','includeAll','include','catch','show','params','keys','length','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','odbc','dsn','closeSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then'];(function(_0x824091,_0x4f687c){var _0xac432c=function(_0x2bed55){while(--_0x2bed55){_0x824091['push'](_0x824091['shift']());}};_0xac432c(++_0x4f687c);}(_0x4681,0x1f3));var _0x1468=function(_0x11b7ae,_0x2db03e){_0x11b7ae=_0x11b7ae-0x0;var _0x52874a=_0x4681[_0x11b7ae];return _0x52874a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1468('0x0'));var zipdir=require(_0x1468('0x1'));var jsonpatch=require(_0x1468('0x2'));var rp=require(_0x1468('0x3'));var moment=require(_0x1468('0x4'));var BPromise=require(_0x1468('0x5'));var Mustache=require(_0x1468('0x6'));var util=require(_0x1468('0x7'));var path=require('path');var sox=require(_0x1468('0x8'));var csv=require(_0x1468('0x9'));var ejs=require(_0x1468('0xa'));var fs=require('fs');var fs_extra=require(_0x1468('0xb'));var _=require(_0x1468('0xc'));var squel=require(_0x1468('0xd'));var crypto=require(_0x1468('0xe'));var jsforce=require(_0x1468('0xf'));var deskjs=require(_0x1468('0x10'));var toCsv=require(_0x1468('0x9'));var querystring=require(_0x1468('0x11'));var Papa=require(_0x1468('0x12'));var Redis=require(_0x1468('0x13'));var authService=require(_0x1468('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x1468('0x15'));var hardwareService=require(_0x1468('0x16'));var logger=require(_0x1468('0x17'))('api');var utils=require(_0x1468('0x18'));var config=require(_0x1468('0x19'));var licenseUtil=require(_0x1468('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1685af,_0x490c3d){_0x490c3d=_0x490c3d||0xcc;return function(_0x30ebc4){if(_0x30ebc4){return _0x1685af[_0x1468('0x1b')](_0x490c3d);}return _0x1685af[_0x1468('0x1c')](_0x490c3d)[_0x1468('0x1d')]();};}function respondWithResult(_0xbba144,_0x24ad10){_0x24ad10=_0x24ad10||0xc8;return function(_0x19d453){if(_0x19d453){return _0xbba144[_0x1468('0x1c')](_0x24ad10)['json'](_0x19d453);}};}function respondWithFilteredResult(_0x13526d,_0x1855aa){return function(_0x1aa05e){if(_0x1aa05e){var _0x37fff9=typeof _0x1855aa[_0x1468('0x1e')]===_0x1468('0x1f')&&typeof _0x1855aa[_0x1468('0x20')]===_0x1468('0x1f');var _0x4bacb7=_0x1aa05e[_0x1468('0x21')];var _0x57826e=_0x37fff9?0x0:_0x1855aa[_0x1468('0x1e')];var _0x340881=_0x37fff9?_0x1aa05e[_0x1468('0x21')]:_0x1855aa[_0x1468('0x1e')]+_0x1855aa[_0x1468('0x20')];var _0x211258;if(_0x340881>=_0x4bacb7){_0x340881=_0x4bacb7;_0x211258=0xc8;}else{_0x211258=0xce;}_0x13526d[_0x1468('0x1c')](_0x211258);return _0x13526d['set'](_0x1468('0x22'),_0x57826e+'-'+_0x340881+'/'+_0x4bacb7)[_0x1468('0x23')](_0x1aa05e);}return null;};}function patchUpdates(_0x372e99){return function(_0x212bec){try{jsonpatch[_0x1468('0x24')](_0x212bec,_0x372e99,!![]);}catch(_0x5e0c42){return BPromise[_0x1468('0x25')](_0x5e0c42);}return _0x212bec[_0x1468('0x26')]();};}function saveUpdates(_0x8288f4,_0x1a1c8a){return function(_0x988ac8){if(_0x988ac8){return _0x988ac8[_0x1468('0x27')](_0x8288f4)[_0x1468('0x28')](function(_0x8d6c9d){return _0x8d6c9d;});}return null;};}function removeEntity(_0x1cd43d,_0x494fff){return function(_0x58ea00){if(_0x58ea00){return _0x58ea00[_0x1468('0x29')]()[_0x1468('0x28')](function(){var _0x2851c3=_0x58ea00['get']({'plain':!![]});var _0x4a0330=_0x1468('0x2a');return db[_0x1468('0x2b')][_0x1468('0x29')]({'where':{'type':_0x4a0330,'resourceId':_0x2851c3['id']}})['then'](function(){return _0x58ea00;});})[_0x1468('0x28')](function(){_0x1cd43d[_0x1468('0x1c')](0xcc)[_0x1468('0x1d')]();});}};}function handleEntityNotFound(_0x2c4a04,_0x4318ab){return function(_0xd1dada){if(!_0xd1dada){_0x2c4a04[_0x1468('0x1b')](0x194);}return _0xd1dada;};}function handleError(_0x4e4a39,_0x24053f){_0x24053f=_0x24053f||0x1f4;return function(_0x390f66){logger[_0x1468('0x2c')](_0x390f66[_0x1468('0x2d')]);if(_0x390f66['name']){delete _0x390f66[_0x1468('0x2e')];}_0x4e4a39['status'](_0x24053f)[_0x1468('0x2f')](_0x390f66);};}exports[_0x1468('0x30')]=function(_0x108ace,_0x2576ef){var _0x5604c2={},_0x27c20d={},_0x36b781={'count':0x0,'rows':[]};var _0x41463c=_[_0x1468('0x31')](db['SquareOdbc'][_0x1468('0x32')],function(_0x45fdc0){return{'name':_0x45fdc0[_0x1468('0x33')],'type':_0x45fdc0[_0x1468('0x34')]['key']};});_0x27c20d[_0x1468('0x35')]=_['map'](_0x41463c,_0x1468('0x2e'));_0x27c20d['query']=_['keys'](_0x108ace[_0x1468('0x36')]);_0x27c20d[_0x1468('0x37')]=_[_0x1468('0x38')](_0x27c20d['model'],_0x27c20d[_0x1468('0x36')]);_0x5604c2[_0x1468('0x39')]=_[_0x1468('0x38')](_0x27c20d['model'],qs[_0x1468('0x3a')](_0x108ace[_0x1468('0x36')][_0x1468('0x3a')]));_0x5604c2[_0x1468('0x39')]=_0x5604c2['attributes']['length']?_0x5604c2[_0x1468('0x39')]:_0x27c20d[_0x1468('0x35')];if(!_0x108ace[_0x1468('0x36')][_0x1468('0x3b')](_0x1468('0x3c'))){_0x5604c2[_0x1468('0x20')]=qs[_0x1468('0x20')](_0x108ace['query'][_0x1468('0x20')]);_0x5604c2[_0x1468('0x1e')]=qs[_0x1468('0x1e')](_0x108ace[_0x1468('0x36')][_0x1468('0x1e')]);}_0x5604c2[_0x1468('0x3d')]=qs[_0x1468('0x3e')](_0x108ace[_0x1468('0x36')][_0x1468('0x3e')]);_0x5604c2[_0x1468('0x3f')]=qs[_0x1468('0x37')](_[_0x1468('0x40')](_0x108ace[_0x1468('0x36')],_0x27c20d[_0x1468('0x37')]),_0x41463c);if(_0x108ace[_0x1468('0x36')][_0x1468('0x41')]){_0x5604c2[_0x1468('0x3f')]=_[_0x1468('0x42')](_0x5604c2['where'],{'$or':_[_0x1468('0x31')](_0x41463c,function(_0x1db7a0){if(_0x1db7a0['type']!==_0x1468('0x43')){var _0x18ab83={};_0x18ab83[_0x1db7a0[_0x1468('0x2e')]]={'$like':'%'+_0x108ace[_0x1468('0x36')]['filter']+'%'};return _0x18ab83;}})});}_0x5604c2=_[_0x1468('0x42')]({},_0x5604c2,_0x108ace[_0x1468('0x44')]);var _0x2077b5={'where':_0x5604c2[_0x1468('0x3f')]};return db[_0x1468('0x45')][_0x1468('0x21')](_0x2077b5)[_0x1468('0x28')](function(_0x425aac){_0x36b781[_0x1468('0x21')]=_0x425aac;if(_0x108ace[_0x1468('0x36')][_0x1468('0x46')]){_0x5604c2[_0x1468('0x47')]=[{'all':!![]}];}return db['SquareOdbc']['findAll'](_0x5604c2);})['then'](function(_0x5a6654){_0x36b781['rows']=_0x5a6654;return _0x36b781;})[_0x1468('0x28')](respondWithFilteredResult(_0x2576ef,_0x5604c2))[_0x1468('0x48')](handleError(_0x2576ef,null));};exports[_0x1468('0x49')]=function(_0x17ea00,_0x54bbe4){var _0xb5c0e1={'raw':!![],'where':{'id':_0x17ea00[_0x1468('0x4a')]['id']}},_0x2ebbb0={};_0x2ebbb0[_0x1468('0x35')]=_[_0x1468('0x4b')](db[_0x1468('0x45')]['rawAttributes']);_0x2ebbb0['query']=_[_0x1468('0x4b')](_0x17ea00[_0x1468('0x36')]);_0x2ebbb0[_0x1468('0x37')]=_[_0x1468('0x38')](_0x2ebbb0[_0x1468('0x35')],_0x2ebbb0[_0x1468('0x36')]);_0xb5c0e1[_0x1468('0x39')]=_[_0x1468('0x38')](_0x2ebbb0['model'],qs[_0x1468('0x3a')](_0x17ea00['query'][_0x1468('0x3a')]));_0xb5c0e1[_0x1468('0x39')]=_0xb5c0e1[_0x1468('0x39')][_0x1468('0x4c')]?_0xb5c0e1[_0x1468('0x39')]:_0x2ebbb0[_0x1468('0x35')];if(_0x17ea00[_0x1468('0x36')][_0x1468('0x46')]){_0xb5c0e1[_0x1468('0x47')]=[{'all':!![]}];}_0xb5c0e1=_[_0x1468('0x42')]({},_0xb5c0e1,_0x17ea00['options']);return db[_0x1468('0x45')][_0x1468('0x4d')](_0xb5c0e1)[_0x1468('0x28')](handleEntityNotFound(_0x54bbe4,null))['then'](respondWithResult(_0x54bbe4,null))['catch'](handleError(_0x54bbe4,null));};exports['create']=function(_0x33d404,_0x319707){return db[_0x1468('0x45')][_0x1468('0x4e')](_0x33d404[_0x1468('0x4f')],{})[_0x1468('0x28')](function(_0x4b2172){var _0xd09e56=_0x33d404[_0x1468('0x50')][_0x1468('0x51')]({'plain':!![]});if(!_0xd09e56)throw new Error(_0x1468('0x52'));if(_0xd09e56[_0x1468('0x53')]===_0x1468('0x50')){var _0x14e878=_0x4b2172['get']({'plain':!![]});var _0x5e418d='ODBC';return db['UserProfileSection'][_0x1468('0x4d')]({'where':{'name':_0x5e418d,'userProfileId':_0xd09e56[_0x1468('0x54')]},'raw':!![]})['then'](function(_0x5557d9){if(_0x5557d9&&_0x5557d9['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x14e878[_0x1468('0x2e')],'resourceId':_0x14e878['id'],'type':_0x5557d9[_0x1468('0x2e')],'sectionId':_0x5557d9['id']},{})['then'](function(){return _0x4b2172;});}else{return _0x4b2172;}})[_0x1468('0x48')](function(_0x118873){logger[_0x1468('0x2c')](_0x1468('0x55'),_0x118873);throw _0x118873;});}return _0x4b2172;})[_0x1468('0x28')](respondWithResult(_0x319707,0xc9))['catch'](handleError(_0x319707,null));};exports[_0x1468('0x27')]=function(_0x8bbcd6,_0x3a8804){if(_0x8bbcd6[_0x1468('0x4f')]['id']){delete _0x8bbcd6[_0x1468('0x4f')]['id'];}return db[_0x1468('0x45')][_0x1468('0x4d')]({'where':{'id':_0x8bbcd6[_0x1468('0x4a')]['id']}})[_0x1468('0x28')](handleEntityNotFound(_0x3a8804,null))[_0x1468('0x28')](saveUpdates(_0x8bbcd6[_0x1468('0x4f')],null))[_0x1468('0x28')](respondWithResult(_0x3a8804,null))[_0x1468('0x48')](handleError(_0x3a8804,null));};exports[_0x1468('0x29')]=function(_0x46134f,_0x229b2a){return db[_0x1468('0x45')]['find']({'where':{'id':_0x46134f[_0x1468('0x4a')]['id']}})[_0x1468('0x28')](handleEntityNotFound(_0x229b2a,null))[_0x1468('0x28')](removeEntity(_0x229b2a,null))[_0x1468('0x48')](handleError(_0x229b2a,null));};exports[_0x1468('0x56')]=function(_0x235524,_0x17c28e,_0x569b43){var _0x5e6d0f;return db['SquareOdbc'][_0x1468('0x4d')]({'where':{'id':_0x235524[_0x1468('0x4a')]['id']},'attributes':['id','dsn']})[_0x1468('0x28')](handleEntityNotFound(_0x17c28e,null))[_0x1468('0x28')](function(_0x510153){if(_0x510153){var _0x1efd8d=require(_0x1468('0x57'))();_0x1efd8d['openSync'](_0x510153[_0x1468('0x58')]);_0x1efd8d[_0x1468('0x59')]();return _0x510153;}})[_0x1468('0x28')](respondWithResult(_0x17c28e,null))['catch'](handleError(_0x17c28e,null));};
\ No newline at end of file
+var _0x3881=['rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','catch','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','request-promise','mustache','util','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','get','ODBC','UserProfileResource','sendStatus','error','stack','name','send','index','SquareOdbc'];(function(_0x514c15,_0x486901){var _0x16283e=function(_0x53b7d0){while(--_0x53b7d0){_0x514c15['push'](_0x514c15['shift']());}};_0x16283e(++_0x486901);}(_0x3881,0x12f));var _0x1388=function(_0x3778bd,_0x3d234a){_0x3778bd=_0x3778bd-0x0;var _0x88824b=_0x3881[_0x3778bd];return _0x88824b;};'use strict';var emlformat=require(_0x1388('0x0'));var rimraf=require(_0x1388('0x1'));var zipdir=require(_0x1388('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1388('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x1388('0x4'));var util=require(_0x1388('0x5'));var path=require('path');var sox=require(_0x1388('0x6'));var csv=require(_0x1388('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1388('0x8'));var _=require(_0x1388('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1388('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1388('0xb'));var Papa=require(_0x1388('0xc'));var Redis=require('ioredis');var authService=require(_0x1388('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x1388('0xe'));var hardwareService=require(_0x1388('0xf'));var logger=require(_0x1388('0x10'))(_0x1388('0x11'));var utils=require(_0x1388('0x12'));var config=require(_0x1388('0x13'));var licenseUtil=require(_0x1388('0x14'));var db=require(_0x1388('0x15'))['db'];function respondWithStatusCode(_0x3158bd,_0x5e21f7){_0x5e21f7=_0x5e21f7||0xcc;return function(_0x5074e3){if(_0x5074e3){return _0x3158bd['sendStatus'](_0x5e21f7);}return _0x3158bd[_0x1388('0x16')](_0x5e21f7)[_0x1388('0x17')]();};}function respondWithResult(_0x1840cf,_0xcb6707){_0xcb6707=_0xcb6707||0xc8;return function(_0x47a025){if(_0x47a025){return _0x1840cf['status'](_0xcb6707)[_0x1388('0x18')](_0x47a025);}};}function respondWithFilteredResult(_0x22081d,_0x51c5fe){return function(_0x2795da){if(_0x2795da){var _0x284076=typeof _0x51c5fe['offset']===_0x1388('0x19')&&typeof _0x51c5fe[_0x1388('0x1a')]===_0x1388('0x19');var _0x130a4a=_0x2795da[_0x1388('0x1b')];var _0x4795ff=_0x284076?0x0:_0x51c5fe['offset'];var _0x15e11b=_0x284076?_0x2795da[_0x1388('0x1b')]:_0x51c5fe[_0x1388('0x1c')]+_0x51c5fe[_0x1388('0x1a')];var _0x1c8490;if(_0x15e11b>=_0x130a4a){_0x15e11b=_0x130a4a;_0x1c8490=0xc8;}else{_0x1c8490=0xce;}_0x22081d[_0x1388('0x16')](_0x1c8490);return _0x22081d['set']('Content-Range',_0x4795ff+'-'+_0x15e11b+'/'+_0x130a4a)[_0x1388('0x18')](_0x2795da);}return null;};}function patchUpdates(_0xe5b5ad){return function(_0x5dd029){try{jsonpatch[_0x1388('0x1d')](_0x5dd029,_0xe5b5ad,!![]);}catch(_0x544d11){return BPromise[_0x1388('0x1e')](_0x544d11);}return _0x5dd029[_0x1388('0x1f')]();};}function saveUpdates(_0x31142f,_0x30d8f7){return function(_0x1aedd4){if(_0x1aedd4){return _0x1aedd4[_0x1388('0x20')](_0x31142f)[_0x1388('0x21')](function(_0x4fcf5d){return _0x4fcf5d;});}return null;};}function removeEntity(_0x227cbc,_0x9c9386){return function(_0x27b347){if(_0x27b347){return _0x27b347[_0x1388('0x22')]()[_0x1388('0x21')](function(){var _0xa8c334=_0x27b347[_0x1388('0x23')]({'plain':!![]});var _0x275265=_0x1388('0x24');return db[_0x1388('0x25')][_0x1388('0x22')]({'where':{'type':_0x275265,'resourceId':_0xa8c334['id']}})[_0x1388('0x21')](function(){return _0x27b347;});})[_0x1388('0x21')](function(){_0x227cbc[_0x1388('0x16')](0xcc)[_0x1388('0x17')]();});}};}function handleEntityNotFound(_0x185e0a,_0x23d7ce){return function(_0x16d3bb){if(!_0x16d3bb){_0x185e0a[_0x1388('0x26')](0x194);}return _0x16d3bb;};}function handleError(_0x322d41,_0x5d4880){_0x5d4880=_0x5d4880||0x1f4;return function(_0x2fc431){logger[_0x1388('0x27')](_0x2fc431[_0x1388('0x28')]);if(_0x2fc431[_0x1388('0x29')]){delete _0x2fc431[_0x1388('0x29')];}_0x322d41['status'](_0x5d4880)[_0x1388('0x2a')](_0x2fc431);};}exports[_0x1388('0x2b')]=function(_0x3c475e,_0x215a60){var _0x235e0d={},_0x45b381={},_0x17586f={'count':0x0,'rows':[]};var _0x177f44=_['map'](db[_0x1388('0x2c')][_0x1388('0x2d')],function(_0x156935){return{'name':_0x156935[_0x1388('0x2e')],'type':_0x156935['type'][_0x1388('0x2f')]};});_0x45b381['model']=_[_0x1388('0x30')](_0x177f44,_0x1388('0x29'));_0x45b381[_0x1388('0x31')]=_[_0x1388('0x32')](_0x3c475e[_0x1388('0x31')]);_0x45b381[_0x1388('0x33')]=_[_0x1388('0x34')](_0x45b381[_0x1388('0x35')],_0x45b381[_0x1388('0x31')]);_0x235e0d[_0x1388('0x36')]=_['intersection'](_0x45b381['model'],qs[_0x1388('0x37')](_0x3c475e[_0x1388('0x31')][_0x1388('0x37')]));_0x235e0d['attributes']=_0x235e0d[_0x1388('0x36')][_0x1388('0x38')]?_0x235e0d['attributes']:_0x45b381[_0x1388('0x35')];if(!_0x3c475e[_0x1388('0x31')][_0x1388('0x39')](_0x1388('0x3a'))){_0x235e0d[_0x1388('0x1a')]=qs[_0x1388('0x1a')](_0x3c475e['query'][_0x1388('0x1a')]);_0x235e0d[_0x1388('0x1c')]=qs[_0x1388('0x1c')](_0x3c475e[_0x1388('0x31')][_0x1388('0x1c')]);}_0x235e0d[_0x1388('0x3b')]=qs['sort'](_0x3c475e[_0x1388('0x31')][_0x1388('0x3c')]);_0x235e0d[_0x1388('0x3d')]=qs[_0x1388('0x33')](_[_0x1388('0x3e')](_0x3c475e[_0x1388('0x31')],_0x45b381['filters']),_0x177f44);if(_0x3c475e[_0x1388('0x31')][_0x1388('0x3f')]){_0x235e0d['where']=_[_0x1388('0x40')](_0x235e0d['where'],{'$or':_[_0x1388('0x30')](_0x177f44,function(_0x4dd86e){if(_0x4dd86e[_0x1388('0x41')]!=='VIRTUAL'){var _0x48423c={};_0x48423c[_0x4dd86e[_0x1388('0x29')]]={'$like':'%'+_0x3c475e[_0x1388('0x31')][_0x1388('0x3f')]+'%'};return _0x48423c;}})});}_0x235e0d=_['merge']({},_0x235e0d,_0x3c475e['options']);var _0x6a5ac5={'where':_0x235e0d[_0x1388('0x3d')]};return db[_0x1388('0x2c')][_0x1388('0x1b')](_0x6a5ac5)['then'](function(_0x5e2127){_0x17586f[_0x1388('0x1b')]=_0x5e2127;if(_0x3c475e[_0x1388('0x31')][_0x1388('0x42')]){_0x235e0d[_0x1388('0x43')]=[{'all':!![]}];}return db[_0x1388('0x2c')][_0x1388('0x44')](_0x235e0d);})[_0x1388('0x21')](function(_0x437e8f){_0x17586f[_0x1388('0x45')]=_0x437e8f;return _0x17586f;})['then'](respondWithFilteredResult(_0x215a60,_0x235e0d))[_0x1388('0x46')](handleError(_0x215a60,null));};exports['show']=function(_0x115008,_0x95f204){var _0x3e9bac={'raw':!![],'where':{'id':_0x115008['params']['id']}},_0x4a4030={};_0x4a4030[_0x1388('0x35')]=_[_0x1388('0x32')](db[_0x1388('0x2c')]['rawAttributes']);_0x4a4030[_0x1388('0x31')]=_['keys'](_0x115008['query']);_0x4a4030[_0x1388('0x33')]=_['intersection'](_0x4a4030[_0x1388('0x35')],_0x4a4030[_0x1388('0x31')]);_0x3e9bac['attributes']=_[_0x1388('0x34')](_0x4a4030[_0x1388('0x35')],qs[_0x1388('0x37')](_0x115008[_0x1388('0x31')]['fields']));_0x3e9bac[_0x1388('0x36')]=_0x3e9bac['attributes'][_0x1388('0x38')]?_0x3e9bac['attributes']:_0x4a4030[_0x1388('0x35')];if(_0x115008[_0x1388('0x31')][_0x1388('0x42')]){_0x3e9bac['include']=[{'all':!![]}];}_0x3e9bac=_[_0x1388('0x40')]({},_0x3e9bac,_0x115008[_0x1388('0x47')]);return db['SquareOdbc'][_0x1388('0x48')](_0x3e9bac)[_0x1388('0x21')](handleEntityNotFound(_0x95f204,null))['then'](respondWithResult(_0x95f204,null))[_0x1388('0x46')](handleError(_0x95f204,null));};exports[_0x1388('0x49')]=function(_0x353ed0,_0x51cbb9){return db['SquareOdbc']['create'](_0x353ed0[_0x1388('0x4a')],{})[_0x1388('0x21')](function(_0x1c7700){var _0x4e6fab=_0x353ed0['user'][_0x1388('0x23')]({'plain':!![]});if(!_0x4e6fab)throw new Error(_0x1388('0x4b'));if(_0x4e6fab[_0x1388('0x4c')]===_0x1388('0x4d')){var _0x4ee5fb=_0x1c7700[_0x1388('0x23')]({'plain':!![]});var _0x1e6a09=_0x1388('0x24');return db['UserProfileSection']['find']({'where':{'name':_0x1e6a09,'userProfileId':_0x4e6fab[_0x1388('0x4e')]},'raw':!![]})['then'](function(_0x5c7016){if(_0x5c7016&&_0x5c7016[_0x1388('0x4f')]===0x0){return db[_0x1388('0x25')][_0x1388('0x49')]({'name':_0x4ee5fb[_0x1388('0x29')],'resourceId':_0x4ee5fb['id'],'type':_0x5c7016[_0x1388('0x29')],'sectionId':_0x5c7016['id']},{})[_0x1388('0x21')](function(){return _0x1c7700;});}else{return _0x1c7700;}})[_0x1388('0x46')](function(_0x1a58e5){logger[_0x1388('0x27')](_0x1388('0x50'),_0x1a58e5);throw _0x1a58e5;});}return _0x1c7700;})[_0x1388('0x21')](respondWithResult(_0x51cbb9,0xc9))[_0x1388('0x46')](handleError(_0x51cbb9,null));};exports[_0x1388('0x20')]=function(_0x3961e9,_0x55a350){if(_0x3961e9['body']['id']){delete _0x3961e9[_0x1388('0x4a')]['id'];}return db[_0x1388('0x2c')]['find']({'where':{'id':_0x3961e9[_0x1388('0x51')]['id']}})['then'](handleEntityNotFound(_0x55a350,null))[_0x1388('0x21')](saveUpdates(_0x3961e9[_0x1388('0x4a')],null))['then'](respondWithResult(_0x55a350,null))[_0x1388('0x46')](handleError(_0x55a350,null));};exports['destroy']=function(_0x20743c,_0x32510e){return db[_0x1388('0x2c')][_0x1388('0x48')]({'where':{'id':_0x20743c[_0x1388('0x51')]['id']}})[_0x1388('0x21')](handleEntityNotFound(_0x32510e,null))['then'](removeEntity(_0x32510e,null))[_0x1388('0x46')](handleError(_0x32510e,null));};exports[_0x1388('0x52')]=function(_0x19e578,_0x53ef25,_0xf09338){var _0x1e05ce;return db[_0x1388('0x2c')][_0x1388('0x48')]({'where':{'id':_0x19e578[_0x1388('0x51')]['id']},'attributes':['id',_0x1388('0x53')]})[_0x1388('0x21')](handleEntityNotFound(_0x53ef25,null))['then'](function(_0xbe3941){if(_0xbe3941){var _0x169b1d=require(_0x1388('0x54'))();_0x169b1d[_0x1388('0x55')](_0xbe3941[_0x1388('0x53')]);_0x169b1d[_0x1388('0x56')]();return _0xbe3941;}})[_0x1388('0x21')](respondWithResult(_0x53ef25,null))[_0x1388('0x46')](handleError(_0x53ef25,null));};
\ No newline at end of file
index 6014005..da8882e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb067=['rimraf','./squareOdbc.attributes','exports','define','square_odbc','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x28611e,_0x586726){var _0x530f69=function(_0x407906){while(--_0x407906){_0x28611e['push'](_0x28611e['shift']());}};_0x530f69(++_0x586726);}(_0xb067,0xa1));var _0x7b06=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb067[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7b06('0x0'));var util=require(_0x7b06('0x1'));var logger=require(_0x7b06('0x2'))('api');var moment=require(_0x7b06('0x3'));var BPromise=require(_0x7b06('0x4'));var rp=require(_0x7b06('0x5'));var fs=require('fs');var path=require(_0x7b06('0x6'));var rimraf=require(_0x7b06('0x7'));var config=require('../../config/environment');var attributes=require(_0x7b06('0x8'));module[_0x7b06('0x9')]=function(_0x5c3449,_0x2cb4fd){return _0x5c3449[_0x7b06('0xa')]('SquareOdbc',attributes,{'tableName':_0x7b06('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaa33=['exports','define','square_odbc','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./squareOdbc.attributes'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xaa33,0xff));var _0x3aa3=function(_0x32ff35,_0x4af5dc){_0x32ff35=_0x32ff35-0x0;var _0x5939fd=_0xaa33[_0x32ff35];return _0x5939fd;};'use strict';var _=require(_0x3aa3('0x0'));var util=require(_0x3aa3('0x1'));var logger=require(_0x3aa3('0x2'))('api');var moment=require(_0x3aa3('0x3'));var BPromise=require(_0x3aa3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3aa3('0x5'));var rimraf=require(_0x3aa3('0x6'));var config=require(_0x3aa3('0x7'));var attributes=require(_0x3aa3('0x8'));module[_0x3aa3('0x9')]=function(_0x33be0a,_0x2eef3e){return _0x33be0a[_0x3aa3('0xa')]('SquareOdbc',attributes,{'tableName':_0x3aa3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 27d2702..de5b913 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c15=['util','moment','bluebird','ioredis','../../config/utils','jayson/promise','client','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','error','code','message','catch','ShowSquareOdbc','find','options','raw','where','attributes','include','map','model','stringify'];(function(_0x3205e7,_0x30e56f){var _0x33910d=function(_0x1e9648){while(--_0x1e9648){_0x3205e7['push'](_0x3205e7['shift']());}};_0x33910d(++_0x30e56f);}(_0x0c15,0x70));var _0x50c1=function(_0x559d85,_0x5cbcba){_0x559d85=_0x559d85-0x0;var _0x1acc1a=_0x0c15[_0x559d85];return _0x1acc1a;};'use strict';var _=require('lodash');var util=require(_0x50c1('0x0'));var moment=require(_0x50c1('0x1'));var BPromise=require(_0x50c1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x50c1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x50c1('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x50c1('0x5'));var client=jayson[_0x50c1('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x255105,_0x368660,_0x58dda7){return new BPromise(function(_0x2b8027,_0x88e2e0){return client[_0x50c1('0x7')](_0x255105,_0x58dda7)[_0x50c1('0x8')](function(_0x26c137){logger[_0x50c1('0x9')](_0x50c1('0xa'),_0x368660,_0x50c1('0xb'));logger[_0x50c1('0xc')](_0x50c1('0xd'),_0x368660,'request\x20sent',JSON['stringify'](_0x26c137));if(_0x26c137[_0x50c1('0xe')]){if(_0x26c137[_0x50c1('0xe')][_0x50c1('0xf')]===0x1f4){logger[_0x50c1('0xe')](_0x50c1('0xa'),_0x368660,_0x26c137[_0x50c1('0xe')]['message']);return _0x88e2e0(_0x26c137[_0x50c1('0xe')][_0x50c1('0x10')]);}logger[_0x50c1('0xe')](_0x50c1('0xa'),_0x368660,_0x26c137['error'][_0x50c1('0x10')]);return _0x2b8027(_0x26c137['error']['message']);}else{logger[_0x50c1('0x9')]('SquareOdbc,\x20%s,\x20%s',_0x368660,_0x50c1('0xb'));_0x2b8027(_0x26c137['result'][_0x50c1('0x10')]);}})[_0x50c1('0x11')](function(_0x419db9){logger[_0x50c1('0xe')](_0x50c1('0xa'),_0x368660,_0x419db9);_0x88e2e0(_0x419db9);});});}exports[_0x50c1('0x12')]=function(_0x16a944){var _0x53d65b=this;return new Promise(function(_0x2fa835,_0x5a58f2){return db['SquareOdbc'][_0x50c1('0x13')]({'raw':_0x16a944[_0x50c1('0x14')]?_0x16a944[_0x50c1('0x14')][_0x50c1('0x15')]===undefined?!![]:![]:!![],'where':_0x16a944[_0x50c1('0x14')]?_0x16a944[_0x50c1('0x14')][_0x50c1('0x16')]||null:null,'attributes':_0x16a944[_0x50c1('0x14')]?_0x16a944[_0x50c1('0x14')][_0x50c1('0x17')]||null:null,'include':_0x16a944[_0x50c1('0x14')]?_0x16a944[_0x50c1('0x14')][_0x50c1('0x18')]?_[_0x50c1('0x19')](_0x16a944[_0x50c1('0x14')][_0x50c1('0x18')],function(_0x5db2bd){return{'model':db[_0x5db2bd[_0x50c1('0x1a')]],'as':_0x5db2bd['as'],'attributes':_0x5db2bd['attributes'],'include':_0x5db2bd[_0x50c1('0x18')]?_[_0x50c1('0x19')](_0x5db2bd[_0x50c1('0x18')],function(_0x5af65a){return{'model':db[_0x5af65a[_0x50c1('0x1a')]],'as':_0x5af65a['as'],'attributes':_0x5af65a[_0x50c1('0x17')],'include':_0x5af65a[_0x50c1('0x18')]?_[_0x50c1('0x19')](_0x5af65a[_0x50c1('0x18')],function(_0x51d682){return{'model':db[_0x51d682[_0x50c1('0x1a')]],'as':_0x51d682['as'],'attributes':_0x51d682[_0x50c1('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x181559){logger[_0x50c1('0x9')](_0x50c1('0x12'),_0x16a944);logger[_0x50c1('0xc')]('ShowSquareOdbc',_0x16a944,JSON[_0x50c1('0x1b')](_0x181559));_0x2fa835(_0x181559);})[_0x50c1('0x11')](function(_0x22fbc9){logger[_0x50c1('0xe')](_0x50c1('0x12'),_0x22fbc9[_0x50c1('0x10')],_0x16a944);_0x5a58f2(_0x53d65b[_0x50c1('0xe')](0x1f4,_0x22fbc9['message']));});});};
\ No newline at end of file
+var _0x91f1=['http','request','then','info','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x549928,_0x363b7a){var _0x941e27=function(_0x280fe6){while(--_0x280fe6){_0x549928['push'](_0x549928['shift']());}};_0x941e27(++_0x363b7a);}(_0x91f1,0x160));var _0x191f=function(_0x563bfc,_0x147c8a){_0x563bfc=_0x563bfc-0x0;var _0x3d5fe2=_0x91f1[_0x563bfc];return _0x3d5fe2;};'use strict';var _=require(_0x191f('0x0'));var util=require(_0x191f('0x1'));var moment=require(_0x191f('0x2'));var BPromise=require(_0x191f('0x3'));var rs=require(_0x191f('0x4'));var fs=require('fs');var Redis=require(_0x191f('0x5'));var db=require(_0x191f('0x6'))['db'];var utils=require(_0x191f('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x191f('0x8'));var jayson=require(_0x191f('0x9'));var client=jayson[_0x191f('0xa')][_0x191f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x16eda4,_0x58a2f0,_0x43433e){return new BPromise(function(_0x5d55a2,_0x2ede85){return client[_0x191f('0xc')](_0x16eda4,_0x43433e)[_0x191f('0xd')](function(_0x180ffa){logger[_0x191f('0xe')](_0x191f('0xf'),_0x58a2f0,'request\x20sent');logger[_0x191f('0x10')](_0x191f('0x11'),_0x58a2f0,_0x191f('0x12'),JSON[_0x191f('0x13')](_0x180ffa));if(_0x180ffa[_0x191f('0x14')]){if(_0x180ffa[_0x191f('0x14')]['code']===0x1f4){logger[_0x191f('0x14')](_0x191f('0xf'),_0x58a2f0,_0x180ffa[_0x191f('0x14')][_0x191f('0x15')]);return _0x2ede85(_0x180ffa[_0x191f('0x14')][_0x191f('0x15')]);}logger[_0x191f('0x14')](_0x191f('0xf'),_0x58a2f0,_0x180ffa[_0x191f('0x14')][_0x191f('0x15')]);return _0x5d55a2(_0x180ffa[_0x191f('0x14')][_0x191f('0x15')]);}else{logger[_0x191f('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x58a2f0,_0x191f('0x12'));_0x5d55a2(_0x180ffa[_0x191f('0x16')]['message']);}})['catch'](function(_0x126f7d){logger[_0x191f('0x14')]('SquareOdbc,\x20%s,\x20%s',_0x58a2f0,_0x126f7d);_0x2ede85(_0x126f7d);});});}exports[_0x191f('0x17')]=function(_0x4c6845){var _0x318119=this;return new Promise(function(_0xe5b390,_0x5e8ca8){return db[_0x191f('0x18')][_0x191f('0x19')]({'raw':_0x4c6845[_0x191f('0x1a')]?_0x4c6845[_0x191f('0x1a')][_0x191f('0x1b')]===undefined?!![]:![]:!![],'where':_0x4c6845['options']?_0x4c6845[_0x191f('0x1a')][_0x191f('0x1c')]||null:null,'attributes':_0x4c6845[_0x191f('0x1a')]?_0x4c6845[_0x191f('0x1a')][_0x191f('0x1d')]||null:null,'include':_0x4c6845[_0x191f('0x1a')]?_0x4c6845[_0x191f('0x1a')][_0x191f('0x1e')]?_[_0x191f('0x1f')](_0x4c6845[_0x191f('0x1a')][_0x191f('0x1e')],function(_0x16539a){return{'model':db[_0x16539a[_0x191f('0x20')]],'as':_0x16539a['as'],'attributes':_0x16539a[_0x191f('0x1d')],'include':_0x16539a[_0x191f('0x1e')]?_[_0x191f('0x1f')](_0x16539a[_0x191f('0x1e')],function(_0x3bb244){return{'model':db[_0x3bb244['model']],'as':_0x3bb244['as'],'attributes':_0x3bb244[_0x191f('0x1d')],'include':_0x3bb244[_0x191f('0x1e')]?_[_0x191f('0x1f')](_0x3bb244[_0x191f('0x1e')],function(_0x2cf12d){return{'model':db[_0x2cf12d[_0x191f('0x20')]],'as':_0x2cf12d['as'],'attributes':_0x2cf12d[_0x191f('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa08e9e){logger[_0x191f('0xe')](_0x191f('0x17'),_0x4c6845);logger[_0x191f('0x10')](_0x191f('0x17'),_0x4c6845,JSON[_0x191f('0x13')](_0xa08e9e));_0xe5b390(_0xa08e9e);})['catch'](function(_0x1d71a9){logger[_0x191f('0x14')](_0x191f('0x17'),_0x1d71a9['message'],_0x4c6845);_0x5e8ca8(_0x318119['error'](0x1f4,_0x1d71a9[_0x191f('0x15')]));});});};
\ No newline at end of file
index fd8fcea..1ab0542 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a37=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','/:id/users','getUsers','post','addUsers','put','delete','destroy','removeUsers','exports','multer','util','path','connect-timeout','express'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1a37,0x127));var _0x71a3=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x1a37[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var path=require(_0x71a3('0x2'));var timeout=require(_0x71a3('0x3'));var express=require(_0x71a3('0x4'));var router=express[_0x71a3('0x5')]();var fs_extra=require(_0x71a3('0x6'));var auth=require(_0x71a3('0x7'));var interaction=require(_0x71a3('0x8'));var config=require(_0x71a3('0x9'));var controller=require(_0x71a3('0xa'));router[_0x71a3('0xb')]('/',auth[_0x71a3('0xc')](),controller[_0x71a3('0xd')]);router[_0x71a3('0xb')](_0x71a3('0xe'),auth[_0x71a3('0xc')](),controller[_0x71a3('0xf')]);router[_0x71a3('0xb')](_0x71a3('0x10'),auth['isAuthenticated'](),controller[_0x71a3('0x11')]);router[_0x71a3('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x71a3('0x12')]('/:id/users',auth[_0x71a3('0xc')](),controller[_0x71a3('0x13')]);router[_0x71a3('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x71a3('0x15')](_0x71a3('0xe'),auth[_0x71a3('0xc')](),controller[_0x71a3('0x16')]);router[_0x71a3('0x15')](_0x71a3('0x10'),auth[_0x71a3('0xc')](),controller[_0x71a3('0x17')]);module[_0x71a3('0x18')]=router;
\ No newline at end of file
+var _0xb4e5=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','show','/:id/users','isAuthenticated','getUsers','post','create','put','update','delete','destroy','removeUsers','multer','path','connect-timeout','express'];(function(_0x25c846,_0x1582a4){var _0x358256=function(_0x5a9d29){while(--_0x5a9d29){_0x25c846['push'](_0x25c846['shift']());}};_0x358256(++_0x1582a4);}(_0xb4e5,0x104));var _0x5b4e=function(_0x5353d0,_0x55cb83){_0x5353d0=_0x5353d0-0x0;var _0x37b55b=_0xb4e5[_0x5353d0];return _0x37b55b;};'use strict';var multer=require(_0x5b4e('0x0'));var util=require('util');var path=require(_0x5b4e('0x1'));var timeout=require(_0x5b4e('0x2'));var express=require(_0x5b4e('0x3'));var router=express[_0x5b4e('0x4')]();var fs_extra=require(_0x5b4e('0x5'));var auth=require(_0x5b4e('0x6'));var interaction=require(_0x5b4e('0x7'));var config=require(_0x5b4e('0x8'));var controller=require('./squareProject.controller');router[_0x5b4e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5b4e('0x9')](_0x5b4e('0xa'),auth['isAuthenticated'](),controller[_0x5b4e('0xb')]);router[_0x5b4e('0x9')](_0x5b4e('0xc'),auth[_0x5b4e('0xd')](),controller[_0x5b4e('0xe')]);router[_0x5b4e('0xf')]('/',auth[_0x5b4e('0xd')](),controller[_0x5b4e('0x10')]);router[_0x5b4e('0xf')](_0x5b4e('0xc'),auth[_0x5b4e('0xd')](),controller['addUsers']);router[_0x5b4e('0x11')](_0x5b4e('0xa'),auth[_0x5b4e('0xd')](),controller[_0x5b4e('0x12')]);router[_0x5b4e('0x13')](_0x5b4e('0xa'),auth[_0x5b4e('0xd')](),controller[_0x5b4e('0x14')]);router['delete'](_0x5b4e('0xc'),auth['isAuthenticated'](),controller[_0x5b4e('0x15')]);module['exports']=router;
\ No newline at end of file
index e34fc88..eabfc27 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2517=['production','DATE','sequelize','exports','STRING','name','TEXT','BLOB','long','getDataValue','preproduction','toString'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x2517,0xfe));var _0x7251=function(_0x5a2349,_0x1f0cd4){_0x5a2349=_0x5a2349-0x0;var _0x2a3468=_0x2517[_0x5a2349];return _0x2a3468;};'use strict';var Sequelize=require(_0x7251('0x0'));module[_0x7251('0x1')]={'name':{'type':Sequelize[_0x7251('0x2')],'unique':_0x7251('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x7251('0x2')]},'notes':{'type':Sequelize[_0x7251('0x4')]},'preproduction':{'type':Sequelize[_0x7251('0x5')](_0x7251('0x6')),'get':function(){if(this[_0x7251('0x7')]('preproduction')){return this[_0x7251('0x7')](_0x7251('0x8'))[_0x7251('0x9')]('utf8');}}},'production':{'type':Sequelize[_0x7251('0x5')](_0x7251('0x6')),'get':function(){if(this[_0x7251('0x7')](_0x7251('0xa'))){return this[_0x7251('0x7')]('production')['toString']('utf8');}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x7251('0xb')]}};
\ No newline at end of file
+var _0x8555=['toString','utf8','production','DATE','sequelize','STRING','name','TEXT','BLOB','long','preproduction','getDataValue'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x8555,0x13c));var _0x5855=function(_0x580ab8,_0x352316){_0x580ab8=_0x580ab8-0x0;var _0x434b28=_0x8555[_0x580ab8];return _0x434b28;};'use strict';var Sequelize=require(_0x5855('0x0'));module['exports']={'name':{'type':Sequelize[_0x5855('0x1')],'unique':_0x5855('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x5855('0x3')]},'preproduction':{'type':Sequelize[_0x5855('0x4')](_0x5855('0x5')),'get':function(){if(this['getDataValue'](_0x5855('0x6'))){return this[_0x5855('0x7')](_0x5855('0x6'))[_0x5855('0x8')](_0x5855('0x9'));}}},'production':{'type':Sequelize[_0x5855('0x4')](_0x5855('0x5')),'get':function(){if(this[_0x5855('0x7')](_0x5855('0xa'))){return this[_0x5855('0x7')](_0x5855('0xa'))[_0x5855('0x8')](_0x5855('0x9'));}}},'savedAt':{'type':Sequelize[_0x5855('0xb')]},'publishedAt':{'type':Sequelize[_0x5855('0xb')]}};
\ No newline at end of file
index 45c7baa..a6e38ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1c7d=['hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','then','findAll','catch','show','params','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','SquareProjects','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','omit','ids','removeUsers','emit','userSquareProject:remove','getUsers','findOne','keys','User','nolimit','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','json','offset','limit','undefined','count','set','apply','save','update','get','UserProfileResource','destroy','end','error','name','send','index','map','SquareProject','rawAttributes','type','key','query','filters','intersection','attributes','fields','length','model'];(function(_0x56482c,_0x16118d){var _0x5aae7a=function(_0x52512f){while(--_0x52512f){_0x56482c['push'](_0x56482c['shift']());}};_0x5aae7a(++_0x16118d);}(_0x1c7d,0x13b));var _0xd1c7=function(_0x34db7f,_0x3e22f8){_0x34db7f=_0x34db7f-0x0;var _0x509554=_0x1c7d[_0x34db7f];return _0x509554;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd1c7('0x0'));var rp=require('request-promise');var moment=require(_0xd1c7('0x1'));var BPromise=require(_0xd1c7('0x2'));var Mustache=require(_0xd1c7('0x3'));var util=require('util');var path=require(_0xd1c7('0x4'));var sox=require('sox');var csv=require(_0xd1c7('0x5'));var ejs=require(_0xd1c7('0x6'));var fs=require('fs');var fs_extra=require(_0xd1c7('0x7'));var _=require(_0xd1c7('0x8'));var squel=require(_0xd1c7('0x9'));var crypto=require(_0xd1c7('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd1c7('0xb'));var toCsv=require(_0xd1c7('0x5'));var querystring=require('querystring');var Papa=require(_0xd1c7('0xc'));var Redis=require(_0xd1c7('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd1c7('0xe'));var hardwareService=require(_0xd1c7('0xf'));var logger=require(_0xd1c7('0x10'))(_0xd1c7('0x11'));var utils=require(_0xd1c7('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xd1c7('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd1c7('0x14')](config[_0xd1c7('0x15')],{'host':_0xd1c7('0x16'),'port':0x18eb});var socket=require(_0xd1c7('0x17'))(new Redis(config[_0xd1c7('0x15')]));require(_0xd1c7('0x18'))[_0xd1c7('0x19')](socket);function respondWithStatusCode(_0x4d38a7,_0x150edb){_0x150edb=_0x150edb||0xcc;return function(_0x16cce8){if(_0x16cce8){return _0x4d38a7[_0xd1c7('0x1a')](_0x150edb);}return _0x4d38a7[_0xd1c7('0x1b')](_0x150edb)['end']();};}function respondWithResult(_0x4db6bc,_0x47704c){_0x47704c=_0x47704c||0xc8;return function(_0x4f8ebf){if(_0x4f8ebf){return _0x4db6bc[_0xd1c7('0x1b')](_0x47704c)[_0xd1c7('0x1c')](_0x4f8ebf);}};}function respondWithFilteredResult(_0x15870e,_0x293f5e){return function(_0xb091da){if(_0xb091da){var _0x2902b6=typeof _0x293f5e[_0xd1c7('0x1d')]==='undefined'&&typeof _0x293f5e[_0xd1c7('0x1e')]===_0xd1c7('0x1f');var _0x204d92=_0xb091da[_0xd1c7('0x20')];var _0x52ea2a=_0x2902b6?0x0:_0x293f5e['offset'];var _0x558512=_0x2902b6?_0xb091da[_0xd1c7('0x20')]:_0x293f5e['offset']+_0x293f5e[_0xd1c7('0x1e')];var _0x1323d5;if(_0x558512>=_0x204d92){_0x558512=_0x204d92;_0x1323d5=0xc8;}else{_0x1323d5=0xce;}_0x15870e[_0xd1c7('0x1b')](_0x1323d5);return _0x15870e[_0xd1c7('0x21')]('Content-Range',_0x52ea2a+'-'+_0x558512+'/'+_0x204d92)['json'](_0xb091da);}return null;};}function patchUpdates(_0x1c6428){return function(_0x568448){try{jsonpatch[_0xd1c7('0x22')](_0x568448,_0x1c6428,!![]);}catch(_0x17edae){return BPromise['reject'](_0x17edae);}return _0x568448[_0xd1c7('0x23')]();};}function saveUpdates(_0x42297e,_0x1f3c57){return function(_0x39c13e){if(_0x39c13e){return _0x39c13e[_0xd1c7('0x24')](_0x42297e)['then'](function(_0x5ed1e8){return _0x5ed1e8;});}return null;};}function removeEntity(_0xa098a9,_0x4b5f15){return function(_0x5c5c2c){if(_0x5c5c2c){return _0x5c5c2c['destroy']()['then'](function(){var _0x20dbf8=_0x5c5c2c[_0xd1c7('0x25')]({'plain':!![]});var _0x514a00='SquareProjects';return db[_0xd1c7('0x26')][_0xd1c7('0x27')]({'where':{'type':_0x514a00,'resourceId':_0x20dbf8['id']}})['then'](function(){return _0x5c5c2c;});})['then'](function(){_0xa098a9[_0xd1c7('0x1b')](0xcc)[_0xd1c7('0x28')]();});}};}function handleEntityNotFound(_0x27662b,_0x58336e){return function(_0x1eb860){if(!_0x1eb860){_0x27662b[_0xd1c7('0x1a')](0x194);}return _0x1eb860;};}function handleError(_0x301c1d,_0x2d41d0){_0x2d41d0=_0x2d41d0||0x1f4;return function(_0x2e78a9){logger[_0xd1c7('0x29')](_0x2e78a9['stack']);if(_0x2e78a9[_0xd1c7('0x2a')]){delete _0x2e78a9[_0xd1c7('0x2a')];}_0x301c1d['status'](_0x2d41d0)[_0xd1c7('0x2b')](_0x2e78a9);};}exports[_0xd1c7('0x2c')]=function(_0x1478d0,_0x421916){var _0x1d609b={},_0x562635={},_0x2c76cd={'count':0x0,'rows':[]};var _0x5801ea=_[_0xd1c7('0x2d')](db[_0xd1c7('0x2e')][_0xd1c7('0x2f')],function(_0x5ca939){return{'name':_0x5ca939['fieldName'],'type':_0x5ca939[_0xd1c7('0x30')][_0xd1c7('0x31')]};});_0x562635['model']=_[_0xd1c7('0x2d')](_0x5801ea,_0xd1c7('0x2a'));_0x562635[_0xd1c7('0x32')]=_['keys'](_0x1478d0[_0xd1c7('0x32')]);_0x562635[_0xd1c7('0x33')]=_[_0xd1c7('0x34')](_0x562635['model'],_0x562635[_0xd1c7('0x32')]);_0x1d609b[_0xd1c7('0x35')]=_[_0xd1c7('0x34')](_0x562635['model'],qs[_0xd1c7('0x36')](_0x1478d0[_0xd1c7('0x32')][_0xd1c7('0x36')]));_0x1d609b[_0xd1c7('0x35')]=_0x1d609b[_0xd1c7('0x35')][_0xd1c7('0x37')]?_0x1d609b['attributes']:_0x562635[_0xd1c7('0x38')];if(!_0x1478d0[_0xd1c7('0x32')][_0xd1c7('0x39')]('nolimit')){_0x1d609b[_0xd1c7('0x1e')]=qs[_0xd1c7('0x1e')](_0x1478d0[_0xd1c7('0x32')][_0xd1c7('0x1e')]);_0x1d609b['offset']=qs['offset'](_0x1478d0[_0xd1c7('0x32')][_0xd1c7('0x1d')]);}_0x1d609b[_0xd1c7('0x3a')]=qs[_0xd1c7('0x3b')](_0x1478d0[_0xd1c7('0x32')][_0xd1c7('0x3b')]);_0x1d609b[_0xd1c7('0x3c')]=qs[_0xd1c7('0x33')](_[_0xd1c7('0x3d')](_0x1478d0[_0xd1c7('0x32')],_0x562635['filters']),_0x5801ea);if(_0x1478d0[_0xd1c7('0x32')][_0xd1c7('0x3e')]){_0x1d609b[_0xd1c7('0x3c')]=_[_0xd1c7('0x3f')](_0x1d609b[_0xd1c7('0x3c')],{'$or':_['map'](_0x5801ea,function(_0x4afd67){if(_0x4afd67[_0xd1c7('0x30')]!==_0xd1c7('0x40')){var _0x4edfd0={};_0x4edfd0[_0x4afd67[_0xd1c7('0x2a')]]={'$like':'%'+_0x1478d0[_0xd1c7('0x32')][_0xd1c7('0x3e')]+'%'};return _0x4edfd0;}})});}_0x1d609b=_['merge']({},_0x1d609b,_0x1478d0[_0xd1c7('0x41')]);var _0x46d05b={'where':_0x1d609b[_0xd1c7('0x3c')]};return db['SquareProject'][_0xd1c7('0x20')](_0x46d05b)[_0xd1c7('0x42')](function(_0x2da2fe){_0x2c76cd['count']=_0x2da2fe;if(_0x1478d0[_0xd1c7('0x32')]['includeAll']){_0x1d609b['include']=[{'all':!![]}];}return db[_0xd1c7('0x2e')][_0xd1c7('0x43')](_0x1d609b);})[_0xd1c7('0x42')](function(_0x124485){_0x2c76cd['rows']=_0x124485;return _0x2c76cd;})[_0xd1c7('0x42')](respondWithFilteredResult(_0x421916,_0x1d609b))[_0xd1c7('0x44')](handleError(_0x421916,null));};exports[_0xd1c7('0x45')]=function(_0x7dcf48,_0x19392c){var _0x3e3237={'raw':![],'where':{'id':_0x7dcf48[_0xd1c7('0x46')]['id']}},_0x2a84f5={};_0x2a84f5[_0xd1c7('0x38')]=_['keys'](db['SquareProject']['rawAttributes']);_0x2a84f5[_0xd1c7('0x32')]=_['keys'](_0x7dcf48[_0xd1c7('0x32')]);_0x2a84f5[_0xd1c7('0x33')]=_['intersection'](_0x2a84f5[_0xd1c7('0x38')],_0x2a84f5[_0xd1c7('0x32')]);_0x3e3237['attributes']=_[_0xd1c7('0x34')](_0x2a84f5[_0xd1c7('0x38')],qs['fields'](_0x7dcf48[_0xd1c7('0x32')][_0xd1c7('0x36')]));_0x3e3237[_0xd1c7('0x35')]=_0x3e3237[_0xd1c7('0x35')][_0xd1c7('0x37')]?_0x3e3237[_0xd1c7('0x35')]:_0x2a84f5[_0xd1c7('0x38')];if(_0x7dcf48[_0xd1c7('0x32')][_0xd1c7('0x47')]){_0x3e3237[_0xd1c7('0x48')]=[{'all':!![]}];}_0x3e3237=_['merge']({},_0x3e3237,_0x7dcf48[_0xd1c7('0x41')]);return db[_0xd1c7('0x2e')][_0xd1c7('0x49')](_0x3e3237)[_0xd1c7('0x42')](handleEntityNotFound(_0x19392c,null))[_0xd1c7('0x42')](respondWithResult(_0x19392c,null))[_0xd1c7('0x44')](handleError(_0x19392c,null));};exports[_0xd1c7('0x4a')]=function(_0x564bf0,_0x479c71){return db[_0xd1c7('0x2e')]['create'](_0x564bf0[_0xd1c7('0x4b')],{})[_0xd1c7('0x42')](function(_0x3eb836){var _0x3a2a12=_0x564bf0['user'][_0xd1c7('0x25')]({'plain':!![]});if(!_0x3a2a12)throw new Error(_0xd1c7('0x4c'));if(_0x3a2a12['role']===_0xd1c7('0x4d')){var _0x1b5824=_0x3eb836['get']({'plain':!![]});var _0x2747ca=_0xd1c7('0x4e');return db[_0xd1c7('0x4f')][_0xd1c7('0x49')]({'where':{'name':_0x2747ca,'userProfileId':_0x3a2a12[_0xd1c7('0x50')]},'raw':!![]})[_0xd1c7('0x42')](function(_0x9c0a48){if(_0x9c0a48&&_0x9c0a48['autoAssociation']===0x0){return db[_0xd1c7('0x26')][_0xd1c7('0x4a')]({'name':_0x1b5824[_0xd1c7('0x2a')],'resourceId':_0x1b5824['id'],'type':_0x9c0a48[_0xd1c7('0x2a')],'sectionId':_0x9c0a48['id']},{})['then'](function(){return _0x3eb836;});}else{return _0x3eb836;}})[_0xd1c7('0x44')](function(_0x97752f){logger[_0xd1c7('0x29')](_0xd1c7('0x51'),_0x97752f);throw _0x97752f;});}return _0x3eb836;})[_0xd1c7('0x42')](respondWithResult(_0x479c71,0xc9))['catch'](handleError(_0x479c71,null));};exports[_0xd1c7('0x24')]=function(_0x4a44b1,_0x1f0365){if(_0x4a44b1[_0xd1c7('0x4b')]['id']){delete _0x4a44b1[_0xd1c7('0x4b')]['id'];}return db['SquareProject'][_0xd1c7('0x49')]({'where':{'id':_0x4a44b1['params']['id']}})[_0xd1c7('0x42')](handleEntityNotFound(_0x1f0365,null))[_0xd1c7('0x42')](saveUpdates(_0x4a44b1[_0xd1c7('0x4b')],null))['then'](respondWithResult(_0x1f0365,null))['catch'](handleError(_0x1f0365,null));};exports[_0xd1c7('0x27')]=function(_0x396b9b,_0x1c9214){return db['SquareProject'][_0xd1c7('0x49')]({'where':{'id':_0x396b9b['params']['id']}})[_0xd1c7('0x42')](handleEntityNotFound(_0x1c9214,null))['then'](removeEntity(_0x1c9214,null))[_0xd1c7('0x44')](handleError(_0x1c9214,null));};exports[_0xd1c7('0x52')]=function(_0x34f7f9,_0x351cff,_0x85a699){return db['SquareProject']['find']({'where':{'id':_0x34f7f9[_0xd1c7('0x46')]['id']}})[_0xd1c7('0x42')](handleEntityNotFound(_0x351cff,null))[_0xd1c7('0x42')](function(_0x37a651){if(_0x37a651){return _0x37a651[_0xd1c7('0x52')](_0x34f7f9['body']['ids'],_[_0xd1c7('0x53')](_0x34f7f9[_0xd1c7('0x4b')],[_0xd1c7('0x54'),'id'])||{});}})[_0xd1c7('0x42')](respondWithResult(_0x351cff,null))[_0xd1c7('0x44')](handleError(_0x351cff,null));};exports[_0xd1c7('0x55')]=function(_0x13e0f6,_0x330de1,_0x25adee){return db[_0xd1c7('0x2e')][_0xd1c7('0x49')]({'where':{'id':_0x13e0f6[_0xd1c7('0x46')]['id']}})[_0xd1c7('0x42')](handleEntityNotFound(_0x330de1,null))[_0xd1c7('0x42')](function(_0x9b12d5){if(_0x9b12d5){return _0x9b12d5['removeUsers'](_0x13e0f6[_0xd1c7('0x32')]['ids'])[_0xd1c7('0x42')](function(){if(_['isArray'](_0x13e0f6['query'][_0xd1c7('0x54')])){for(var _0xcb29c=0x0;_0xcb29c<_0x13e0f6[_0xd1c7('0x32')][_0xd1c7('0x54')]['length'];_0xcb29c+=0x1){socket[_0xd1c7('0x56')](_0xd1c7('0x57'),{'UserId':Number(_0x13e0f6['query'][_0xd1c7('0x54')][_0xcb29c]),'SquareProjectId':Number(_0x13e0f6[_0xd1c7('0x46')]['id'])});}}else{socket[_0xd1c7('0x56')](_0xd1c7('0x57'),{'UserId':Number(_0x13e0f6['query'][_0xd1c7('0x54')]),'SquareProjectId':Number(_0x13e0f6[_0xd1c7('0x46')]['id'])});}});}})[_0xd1c7('0x42')](respondWithStatusCode(_0x330de1,null))['catch'](handleError(_0x330de1,null));};exports[_0xd1c7('0x58')]=function(_0x19f4ea,_0x16ae7d,_0x5c8820){var _0x4a7d08={};var _0x494d73={};var _0x38f853;var _0x33f095;return db['SquareProject'][_0xd1c7('0x59')]({'where':{'id':_0x19f4ea[_0xd1c7('0x46')]['id']}})[_0xd1c7('0x42')](handleEntityNotFound(_0x16ae7d,null))['then'](function(_0x1d073a){if(_0x1d073a){_0x38f853=_0x1d073a;_0x494d73[_0xd1c7('0x38')]=_[_0xd1c7('0x5a')](db[_0xd1c7('0x5b')]['rawAttributes']);_0x494d73[_0xd1c7('0x32')]=_['keys'](_0x19f4ea[_0xd1c7('0x32')]);_0x494d73[_0xd1c7('0x33')]=_[_0xd1c7('0x34')](_0x494d73['model'],_0x494d73[_0xd1c7('0x32')]);_0x4a7d08[_0xd1c7('0x35')]=_[_0xd1c7('0x34')](_0x494d73['model'],qs[_0xd1c7('0x36')](_0x19f4ea[_0xd1c7('0x32')][_0xd1c7('0x36')]));_0x4a7d08[_0xd1c7('0x35')]=_0x4a7d08[_0xd1c7('0x35')][_0xd1c7('0x37')]?_0x4a7d08['attributes']:_0x494d73['model'];_0x4a7d08[_0xd1c7('0x3a')]=qs[_0xd1c7('0x3b')](_0x19f4ea[_0xd1c7('0x32')][_0xd1c7('0x3b')]);_0x4a7d08[_0xd1c7('0x3c')]=qs['filters'](_[_0xd1c7('0x3d')](_0x19f4ea[_0xd1c7('0x32')],_0x494d73[_0xd1c7('0x33')]));if(_0x19f4ea[_0xd1c7('0x32')][_0xd1c7('0x3e')]){_0x4a7d08[_0xd1c7('0x3c')]=_[_0xd1c7('0x3f')](_0x4a7d08[_0xd1c7('0x3c')],{'$or':_[_0xd1c7('0x2d')](_0x4a7d08['attributes'],function(_0x168962){var _0x5b890f={};_0x5b890f[_0x168962]={'$like':'%'+_0x19f4ea[_0xd1c7('0x32')][_0xd1c7('0x3e')]+'%'};return _0x5b890f;})});}_0x4a7d08=_[_0xd1c7('0x3f')]({},_0x4a7d08,_0x19f4ea[_0xd1c7('0x41')]);return _0x38f853[_0xd1c7('0x58')](_0x4a7d08);}})[_0xd1c7('0x42')](function(_0x5ae102){if(_0x5ae102){_0x33f095=_0x5ae102['length'];if(!_0x19f4ea[_0xd1c7('0x32')][_0xd1c7('0x39')](_0xd1c7('0x5c'))){_0x4a7d08[_0xd1c7('0x1e')]=qs[_0xd1c7('0x1e')](_0x19f4ea[_0xd1c7('0x32')]['limit']);_0x4a7d08['offset']=qs['offset'](_0x19f4ea[_0xd1c7('0x32')]['offset']);}return _0x38f853[_0xd1c7('0x58')](_0x4a7d08);}})[_0xd1c7('0x42')](function(_0x531763){if(_0x531763){return _0x531763?{'count':_0x33f095,'rows':_0x531763}:null;}})[_0xd1c7('0x42')](respondWithResult(_0x16ae7d,null))[_0xd1c7('0x44')](handleError(_0x16ae7d,null));};
\ No newline at end of file
+var _0xdce7=['map','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','sort','pick','merge','where','VIRTUAL','filter','SquareProject','includeAll','include','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addUsers','ids','omit','removeUsers','emit','userSquareProject:remove','getUsers','rawAttributes','hasOwnProperty','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./squareProject.socket','register','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','get','SquareProjects','error','stack','name','index'];(function(_0xb0d8b8,_0x219459){var _0x53eaf4=function(_0x4e8106){while(--_0x4e8106){_0xb0d8b8['push'](_0xb0d8b8['shift']());}};_0x53eaf4(++_0x219459);}(_0xdce7,0xe9));var _0x7dce=function(_0x11314c,_0x2ca8d7){_0x11314c=_0x11314c-0x0;var _0x12cb4a=_0xdce7[_0x11314c];return _0x12cb4a;};'use strict';var emlformat=require(_0x7dce('0x0'));var rimraf=require(_0x7dce('0x1'));var zipdir=require(_0x7dce('0x2'));var jsonpatch=require(_0x7dce('0x3'));var rp=require('request-promise');var moment=require(_0x7dce('0x4'));var BPromise=require(_0x7dce('0x5'));var Mustache=require(_0x7dce('0x6'));var util=require(_0x7dce('0x7'));var path=require(_0x7dce('0x8'));var sox=require(_0x7dce('0x9'));var csv=require(_0x7dce('0xa'));var ejs=require(_0x7dce('0xb'));var fs=require('fs');var fs_extra=require(_0x7dce('0xc'));var _=require(_0x7dce('0xd'));var squel=require('squel');var crypto=require(_0x7dce('0xe'));var jsforce=require(_0x7dce('0xf'));var deskjs=require(_0x7dce('0x10'));var toCsv=require(_0x7dce('0xa'));var querystring=require(_0x7dce('0x11'));var Papa=require(_0x7dce('0x12'));var Redis=require(_0x7dce('0x13'));var authService=require(_0x7dce('0x14'));var qs=require(_0x7dce('0x15'));var as=require(_0x7dce('0x16'));var hardwareService=require(_0x7dce('0x17'));var logger=require(_0x7dce('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x7dce('0x19'));var licenseUtil=require(_0x7dce('0x1a'));var db=require(_0x7dce('0x1b'))['db'];config[_0x7dce('0x1c')]=_['defaults'](config[_0x7dce('0x1c')],{'host':_0x7dce('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7dce('0x1c')]));require(_0x7dce('0x1e'))[_0x7dce('0x1f')](socket);function respondWithStatusCode(_0xf7757d,_0x5a6801){_0x5a6801=_0x5a6801||0xcc;return function(_0x5cdb47){if(_0x5cdb47){return _0xf7757d[_0x7dce('0x20')](_0x5a6801);}return _0xf7757d[_0x7dce('0x21')](_0x5a6801)['end']();};}function respondWithResult(_0x4b58bb,_0x28eb29){_0x28eb29=_0x28eb29||0xc8;return function(_0x4a33d9){if(_0x4a33d9){return _0x4b58bb[_0x7dce('0x21')](_0x28eb29)['json'](_0x4a33d9);}};}function respondWithFilteredResult(_0x4ece6b,_0xd96643){return function(_0x116042){if(_0x116042){var _0x26f5a9=typeof _0xd96643['offset']==='undefined'&&typeof _0xd96643['limit']===_0x7dce('0x22');var _0x48cec3=_0x116042[_0x7dce('0x23')];var _0x583184=_0x26f5a9?0x0:_0xd96643['offset'];var _0x4c9c89=_0x26f5a9?_0x116042[_0x7dce('0x23')]:_0xd96643[_0x7dce('0x24')]+_0xd96643[_0x7dce('0x25')];var _0x21753f;if(_0x4c9c89>=_0x48cec3){_0x4c9c89=_0x48cec3;_0x21753f=0xc8;}else{_0x21753f=0xce;}_0x4ece6b[_0x7dce('0x21')](_0x21753f);return _0x4ece6b[_0x7dce('0x26')](_0x7dce('0x27'),_0x583184+'-'+_0x4c9c89+'/'+_0x48cec3)[_0x7dce('0x28')](_0x116042);}return null;};}function patchUpdates(_0x202778){return function(_0x535157){try{jsonpatch['apply'](_0x535157,_0x202778,!![]);}catch(_0x25ade7){return BPromise[_0x7dce('0x29')](_0x25ade7);}return _0x535157[_0x7dce('0x2a')]();};}function saveUpdates(_0x57290a,_0x5d4d6b){return function(_0x213cad){if(_0x213cad){return _0x213cad[_0x7dce('0x2b')](_0x57290a)[_0x7dce('0x2c')](function(_0x7a4abe){return _0x7a4abe;});}return null;};}function removeEntity(_0x3c78b3,_0x1587a8){return function(_0xc317ef){if(_0xc317ef){return _0xc317ef[_0x7dce('0x2d')]()[_0x7dce('0x2c')](function(){var _0x3267d4=_0xc317ef[_0x7dce('0x2e')]({'plain':!![]});var _0x10aceb=_0x7dce('0x2f');return db['UserProfileResource']['destroy']({'where':{'type':_0x10aceb,'resourceId':_0x3267d4['id']}})[_0x7dce('0x2c')](function(){return _0xc317ef;});})[_0x7dce('0x2c')](function(){_0x3c78b3[_0x7dce('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x412a47,_0x5256d3){return function(_0x176324){if(!_0x176324){_0x412a47[_0x7dce('0x20')](0x194);}return _0x176324;};}function handleError(_0x4b96bc,_0x17fd9d){_0x17fd9d=_0x17fd9d||0x1f4;return function(_0x2cbfa2){logger[_0x7dce('0x30')](_0x2cbfa2[_0x7dce('0x31')]);if(_0x2cbfa2[_0x7dce('0x32')]){delete _0x2cbfa2[_0x7dce('0x32')];}_0x4b96bc[_0x7dce('0x21')](_0x17fd9d)['send'](_0x2cbfa2);};}exports[_0x7dce('0x33')]=function(_0x14be45,_0x3b4713){var _0x1b385f={},_0x3aa2ef={},_0x2b8646={'count':0x0,'rows':[]};var _0x183652=_[_0x7dce('0x34')](db['SquareProject']['rawAttributes'],function(_0x4afa99){return{'name':_0x4afa99[_0x7dce('0x35')],'type':_0x4afa99[_0x7dce('0x36')][_0x7dce('0x37')]};});_0x3aa2ef[_0x7dce('0x38')]=_[_0x7dce('0x34')](_0x183652,'name');_0x3aa2ef['query']=_[_0x7dce('0x39')](_0x14be45[_0x7dce('0x3a')]);_0x3aa2ef[_0x7dce('0x3b')]=_['intersection'](_0x3aa2ef[_0x7dce('0x38')],_0x3aa2ef[_0x7dce('0x3a')]);_0x1b385f[_0x7dce('0x3c')]=_[_0x7dce('0x3d')](_0x3aa2ef[_0x7dce('0x38')],qs[_0x7dce('0x3e')](_0x14be45['query'][_0x7dce('0x3e')]));_0x1b385f[_0x7dce('0x3c')]=_0x1b385f[_0x7dce('0x3c')][_0x7dce('0x3f')]?_0x1b385f[_0x7dce('0x3c')]:_0x3aa2ef[_0x7dce('0x38')];if(!_0x14be45['query']['hasOwnProperty']('nolimit')){_0x1b385f['limit']=qs[_0x7dce('0x25')](_0x14be45[_0x7dce('0x3a')][_0x7dce('0x25')]);_0x1b385f[_0x7dce('0x24')]=qs[_0x7dce('0x24')](_0x14be45[_0x7dce('0x3a')][_0x7dce('0x24')]);}_0x1b385f['order']=qs[_0x7dce('0x40')](_0x14be45[_0x7dce('0x3a')][_0x7dce('0x40')]);_0x1b385f['where']=qs['filters'](_[_0x7dce('0x41')](_0x14be45['query'],_0x3aa2ef[_0x7dce('0x3b')]),_0x183652);if(_0x14be45[_0x7dce('0x3a')]['filter']){_0x1b385f['where']=_[_0x7dce('0x42')](_0x1b385f[_0x7dce('0x43')],{'$or':_[_0x7dce('0x34')](_0x183652,function(_0x16bc57){if(_0x16bc57[_0x7dce('0x36')]!==_0x7dce('0x44')){var _0x5ed4a7={};_0x5ed4a7[_0x16bc57[_0x7dce('0x32')]]={'$like':'%'+_0x14be45[_0x7dce('0x3a')][_0x7dce('0x45')]+'%'};return _0x5ed4a7;}})});}_0x1b385f=_[_0x7dce('0x42')]({},_0x1b385f,_0x14be45['options']);var _0x1a6a30={'where':_0x1b385f[_0x7dce('0x43')]};return db[_0x7dce('0x46')][_0x7dce('0x23')](_0x1a6a30)[_0x7dce('0x2c')](function(_0x598615){_0x2b8646[_0x7dce('0x23')]=_0x598615;if(_0x14be45[_0x7dce('0x3a')][_0x7dce('0x47')]){_0x1b385f[_0x7dce('0x48')]=[{'all':!![]}];}return db[_0x7dce('0x46')]['findAll'](_0x1b385f);})['then'](function(_0x43b706){_0x2b8646[_0x7dce('0x49')]=_0x43b706;return _0x2b8646;})['then'](respondWithFilteredResult(_0x3b4713,_0x1b385f))[_0x7dce('0x4a')](handleError(_0x3b4713,null));};exports[_0x7dce('0x4b')]=function(_0x19dc09,_0x721fe9){var _0x434445={'raw':![],'where':{'id':_0x19dc09[_0x7dce('0x4c')]['id']}},_0x1885f9={};_0x1885f9[_0x7dce('0x38')]=_['keys'](db[_0x7dce('0x46')]['rawAttributes']);_0x1885f9[_0x7dce('0x3a')]=_['keys'](_0x19dc09['query']);_0x1885f9['filters']=_[_0x7dce('0x3d')](_0x1885f9[_0x7dce('0x38')],_0x1885f9[_0x7dce('0x3a')]);_0x434445[_0x7dce('0x3c')]=_[_0x7dce('0x3d')](_0x1885f9['model'],qs[_0x7dce('0x3e')](_0x19dc09[_0x7dce('0x3a')]['fields']));_0x434445[_0x7dce('0x3c')]=_0x434445['attributes'][_0x7dce('0x3f')]?_0x434445[_0x7dce('0x3c')]:_0x1885f9[_0x7dce('0x38')];if(_0x19dc09[_0x7dce('0x3a')][_0x7dce('0x47')]){_0x434445[_0x7dce('0x48')]=[{'all':!![]}];}_0x434445=_[_0x7dce('0x42')]({},_0x434445,_0x19dc09['options']);return db[_0x7dce('0x46')]['find'](_0x434445)['then'](handleEntityNotFound(_0x721fe9,null))[_0x7dce('0x2c')](respondWithResult(_0x721fe9,null))[_0x7dce('0x4a')](handleError(_0x721fe9,null));};exports[_0x7dce('0x4d')]=function(_0x1e043c,_0x24fff7){return db[_0x7dce('0x46')][_0x7dce('0x4d')](_0x1e043c['body'],{})[_0x7dce('0x2c')](function(_0x3ef54a){var _0x2774bb=_0x1e043c[_0x7dce('0x4e')]['get']({'plain':!![]});if(!_0x2774bb)throw new Error(_0x7dce('0x4f'));if(_0x2774bb['role']===_0x7dce('0x4e')){var _0x377a52=_0x3ef54a[_0x7dce('0x2e')]({'plain':!![]});var _0x3d23bb='SquareProjects';return db['UserProfileSection'][_0x7dce('0x50')]({'where':{'name':_0x3d23bb,'userProfileId':_0x2774bb['userProfileId']},'raw':!![]})[_0x7dce('0x2c')](function(_0x5f3f86){if(_0x5f3f86&&_0x5f3f86[_0x7dce('0x51')]===0x0){return db[_0x7dce('0x52')][_0x7dce('0x4d')]({'name':_0x377a52['name'],'resourceId':_0x377a52['id'],'type':_0x5f3f86['name'],'sectionId':_0x5f3f86['id']},{})[_0x7dce('0x2c')](function(){return _0x3ef54a;});}else{return _0x3ef54a;}})[_0x7dce('0x4a')](function(_0x12f84d){logger['error'](_0x7dce('0x53'),_0x12f84d);throw _0x12f84d;});}return _0x3ef54a;})[_0x7dce('0x2c')](respondWithResult(_0x24fff7,0xc9))[_0x7dce('0x4a')](handleError(_0x24fff7,null));};exports[_0x7dce('0x2b')]=function(_0x58ebae,_0x346bed){if(_0x58ebae[_0x7dce('0x54')]['id']){delete _0x58ebae[_0x7dce('0x54')]['id'];}return db[_0x7dce('0x46')][_0x7dce('0x50')]({'where':{'id':_0x58ebae['params']['id']}})[_0x7dce('0x2c')](handleEntityNotFound(_0x346bed,null))[_0x7dce('0x2c')](saveUpdates(_0x58ebae[_0x7dce('0x54')],null))[_0x7dce('0x2c')](respondWithResult(_0x346bed,null))['catch'](handleError(_0x346bed,null));};exports[_0x7dce('0x2d')]=function(_0x518a2d,_0x353cc2){return db[_0x7dce('0x46')][_0x7dce('0x50')]({'where':{'id':_0x518a2d[_0x7dce('0x4c')]['id']}})[_0x7dce('0x2c')](handleEntityNotFound(_0x353cc2,null))[_0x7dce('0x2c')](removeEntity(_0x353cc2,null))[_0x7dce('0x4a')](handleError(_0x353cc2,null));};exports['addUsers']=function(_0x1d84cb,_0x65dc15,_0x580b5b){return db[_0x7dce('0x46')][_0x7dce('0x50')]({'where':{'id':_0x1d84cb[_0x7dce('0x4c')]['id']}})['then'](handleEntityNotFound(_0x65dc15,null))[_0x7dce('0x2c')](function(_0x256004){if(_0x256004){return _0x256004[_0x7dce('0x55')](_0x1d84cb[_0x7dce('0x54')][_0x7dce('0x56')],_[_0x7dce('0x57')](_0x1d84cb[_0x7dce('0x54')],[_0x7dce('0x56'),'id'])||{});}})['then'](respondWithResult(_0x65dc15,null))['catch'](handleError(_0x65dc15,null));};exports[_0x7dce('0x58')]=function(_0x215df4,_0x57914e,_0x33d7c5){return db['SquareProject'][_0x7dce('0x50')]({'where':{'id':_0x215df4[_0x7dce('0x4c')]['id']}})[_0x7dce('0x2c')](handleEntityNotFound(_0x57914e,null))[_0x7dce('0x2c')](function(_0x154c87){if(_0x154c87){return _0x154c87[_0x7dce('0x58')](_0x215df4[_0x7dce('0x3a')][_0x7dce('0x56')])[_0x7dce('0x2c')](function(){if(_['isArray'](_0x215df4[_0x7dce('0x3a')][_0x7dce('0x56')])){for(var _0x2653b9=0x0;_0x2653b9<_0x215df4['query'][_0x7dce('0x56')][_0x7dce('0x3f')];_0x2653b9+=0x1){socket[_0x7dce('0x59')](_0x7dce('0x5a'),{'UserId':Number(_0x215df4[_0x7dce('0x3a')][_0x7dce('0x56')][_0x2653b9]),'SquareProjectId':Number(_0x215df4['params']['id'])});}}else{socket[_0x7dce('0x59')]('userSquareProject:remove',{'UserId':Number(_0x215df4[_0x7dce('0x3a')][_0x7dce('0x56')]),'SquareProjectId':Number(_0x215df4[_0x7dce('0x4c')]['id'])});}});}})[_0x7dce('0x2c')](respondWithStatusCode(_0x57914e,null))[_0x7dce('0x4a')](handleError(_0x57914e,null));};exports[_0x7dce('0x5b')]=function(_0x3e5747,_0x45d944,_0x3077cd){var _0x52cfe3={};var _0x4d911c={};var _0x3b359e;var _0x26a71f;return db[_0x7dce('0x46')]['findOne']({'where':{'id':_0x3e5747['params']['id']}})[_0x7dce('0x2c')](handleEntityNotFound(_0x45d944,null))['then'](function(_0x40392b){if(_0x40392b){_0x3b359e=_0x40392b;_0x4d911c[_0x7dce('0x38')]=_[_0x7dce('0x39')](db['User'][_0x7dce('0x5c')]);_0x4d911c['query']=_[_0x7dce('0x39')](_0x3e5747[_0x7dce('0x3a')]);_0x4d911c[_0x7dce('0x3b')]=_[_0x7dce('0x3d')](_0x4d911c['model'],_0x4d911c['query']);_0x52cfe3[_0x7dce('0x3c')]=_[_0x7dce('0x3d')](_0x4d911c[_0x7dce('0x38')],qs[_0x7dce('0x3e')](_0x3e5747[_0x7dce('0x3a')][_0x7dce('0x3e')]));_0x52cfe3[_0x7dce('0x3c')]=_0x52cfe3[_0x7dce('0x3c')]['length']?_0x52cfe3[_0x7dce('0x3c')]:_0x4d911c[_0x7dce('0x38')];_0x52cfe3['order']=qs['sort'](_0x3e5747[_0x7dce('0x3a')][_0x7dce('0x40')]);_0x52cfe3[_0x7dce('0x43')]=qs[_0x7dce('0x3b')](_[_0x7dce('0x41')](_0x3e5747[_0x7dce('0x3a')],_0x4d911c[_0x7dce('0x3b')]));if(_0x3e5747[_0x7dce('0x3a')][_0x7dce('0x45')]){_0x52cfe3[_0x7dce('0x43')]=_['merge'](_0x52cfe3[_0x7dce('0x43')],{'$or':_[_0x7dce('0x34')](_0x52cfe3['attributes'],function(_0x1433d9){var _0x2d54e2={};_0x2d54e2[_0x1433d9]={'$like':'%'+_0x3e5747[_0x7dce('0x3a')][_0x7dce('0x45')]+'%'};return _0x2d54e2;})});}_0x52cfe3=_[_0x7dce('0x42')]({},_0x52cfe3,_0x3e5747['options']);return _0x3b359e[_0x7dce('0x5b')](_0x52cfe3);}})[_0x7dce('0x2c')](function(_0x74a9f3){if(_0x74a9f3){_0x26a71f=_0x74a9f3[_0x7dce('0x3f')];if(!_0x3e5747[_0x7dce('0x3a')][_0x7dce('0x5d')](_0x7dce('0x5e'))){_0x52cfe3[_0x7dce('0x25')]=qs[_0x7dce('0x25')](_0x3e5747[_0x7dce('0x3a')][_0x7dce('0x25')]);_0x52cfe3[_0x7dce('0x24')]=qs[_0x7dce('0x24')](_0x3e5747[_0x7dce('0x3a')][_0x7dce('0x24')]);}return _0x3b359e[_0x7dce('0x5b')](_0x52cfe3);}})[_0x7dce('0x2c')](function(_0x58ad23){if(_0x58ad23){return _0x58ad23?{'count':_0x26a71f,'rows':_0x58ad23}:null;}})[_0x7dce('0x2c')](respondWithResult(_0x45d944,null))[_0x7dce('0x4a')](handleError(_0x45d944,null));};
\ No newline at end of file
index d879fa6..1b7fbbe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5841=['events','SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x485f35,_0x45a0fc){var _0x2ad118=function(_0x296650){while(--_0x296650){_0x485f35['push'](_0x485f35['shift']());}};_0x2ad118(++_0x45a0fc);}(_0x5841,0xb4));var _0x1584=function(_0x5d5729,_0x41e56c){_0x5d5729=_0x5d5729-0x0;var _0x84e642=_0x5841[_0x5d5729];return _0x84e642;};'use strict';var EventEmitter=require(_0x1584('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x1584('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x1584('0x2')](0x0);var events={'afterCreate':_0x1584('0x3'),'afterUpdate':_0x1584('0x4'),'afterDestroy':_0x1584('0x5')};function emitEvent(_0x411aea){return function(_0x578fa1,_0x5d8896,_0x4e51ce){SquareProjectEvents['emit'](_0x411aea+':'+_0x578fa1['id'],_0x578fa1);SquareProjectEvents[_0x1584('0x6')](_0x411aea,_0x578fa1);_0x4e51ce(null);};}for(var e in events){if(events[_0x1584('0x7')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x1584('0x8')]=SquareProjectEvents;
\ No newline at end of file
+var _0x631d=['emit','hasOwnProperty','exports','../../mysqldb','SquareProject','save','update','remove'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x631d,0x6b));var _0xd631=function(_0x1b5f0b,_0x498dca){_0x1b5f0b=_0x1b5f0b-0x0;var _0x55f5c1=_0x631d[_0x1b5f0b];return _0x55f5c1;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xd631('0x0'))['db'][_0xd631('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd631('0x2'),'afterUpdate':_0xd631('0x3'),'afterDestroy':_0xd631('0x4')};function emitEvent(_0x4bde9a){return function(_0x92246c,_0x3e5d8b,_0x39865b){SquareProjectEvents[_0xd631('0x5')](_0x4bde9a+':'+_0x92246c['id'],_0x92246c);SquareProjectEvents[_0xd631('0x5')](_0x4bde9a,_0x92246c);_0x39865b(null);};}for(var e in events){if(events[_0xd631('0x6')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xd631('0x7')]=SquareProjectEvents;
\ No newline at end of file
index e1aedb1..dafb13d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x02b5=['changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','SquareProject','square_projects'];(function(_0xe8129c,_0x2fb03c){var _0x709fc5=function(_0xb8e0c6){while(--_0xb8e0c6){_0xe8129c['push'](_0xe8129c['shift']());}};_0x709fc5(++_0x2fb03c);}(_0x02b5,0x137));var _0x502b=function(_0x4e3b0f,_0x42ddb7){_0x4e3b0f=_0x4e3b0f-0x0;var _0x1d6059=_0x02b5[_0x4e3b0f];return _0x1d6059;};'use strict';var _=require(_0x502b('0x0'));var util=require(_0x502b('0x1'));var logger=require('../../config/logger')(_0x502b('0x2'));var moment=require(_0x502b('0x3'));var BPromise=require(_0x502b('0x4'));var rp=require(_0x502b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x502b('0x6'));var config=require(_0x502b('0x7'));var attributes=require('./squareProject.attributes');module[_0x502b('0x8')]=function(_0x1bae7a,_0x18905e){return _0x1bae7a[_0x502b('0x9')](_0x502b('0xa'),attributes,{'tableName':_0x502b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1ba83a,_0x270b32,_0x7be9f3){if(_0x1ba83a[_0x502b('0xc')](_0x502b('0xd'))){_0x1ba83a[_0x502b('0xe')]=moment()[_0x502b('0xf')](_0x502b('0x10'));}if(_0x1ba83a[_0x502b('0xc')](_0x502b('0x11'))){_0x1ba83a[_0x502b('0x12')]=moment()[_0x502b('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x7be9f3(null,_0x1ba83a);}}});};
\ No newline at end of file
+var _0x75f9=['publishedAt','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','changed','preproduction','format','YYYY-MM-DD\x20HH:mm:ss','production'];(function(_0x46a635,_0x3cf6f0){var _0xff72f1=function(_0x3ac57b){while(--_0x3ac57b){_0x46a635['push'](_0x46a635['shift']());}};_0xff72f1(++_0x3cf6f0);}(_0x75f9,0xbf));var _0x975f=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x75f9[_0x17928f];return _0x500b63;};'use strict';var _=require(_0x975f('0x0'));var util=require(_0x975f('0x1'));var logger=require('../../config/logger')(_0x975f('0x2'));var moment=require('moment');var BPromise=require(_0x975f('0x3'));var rp=require(_0x975f('0x4'));var fs=require('fs');var path=require(_0x975f('0x5'));var rimraf=require(_0x975f('0x6'));var config=require(_0x975f('0x7'));var attributes=require(_0x975f('0x8'));module[_0x975f('0x9')]=function(_0x24f399,_0x39f437){return _0x24f399[_0x975f('0xa')](_0x975f('0xb'),attributes,{'tableName':_0x975f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x416ea5,_0x2f2a5b,_0x3556d8){if(_0x416ea5[_0x975f('0xd')](_0x975f('0xe'))){_0x416ea5['savedAt']=moment()[_0x975f('0xf')](_0x975f('0x10'));}if(_0x416ea5[_0x975f('0xd')](_0x975f('0x11'))){_0x416ea5[_0x975f('0x12')]=moment()[_0x975f('0xf')](_0x975f('0x10'));}_0x3556d8(null,_0x416ea5);}}});};
\ No newline at end of file
index 84165db..6263b7b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6378=['defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','info','SquareProject,\x20%s,\x20%s','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSquareProject','SquareProject','find','options','raw','where','attributes','include','map','model','then','debug','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x23415f,_0x415f79){var _0x1e977f=function(_0x2da5b3){while(--_0x2da5b3){_0x23415f['push'](_0x23415f['shift']());}};_0x1e977f(++_0x415f79);}(_0x6378,0x184));var _0x8637=function(_0x1149aa,_0x41ff45){_0x1149aa=_0x1149aa-0x0;var _0x337d31=_0x6378[_0x1149aa];return _0x337d31;};'use strict';var _=require(_0x8637('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x8637('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8637('0x2'));var db=require(_0x8637('0x3'))['db'];var utils=require(_0x8637('0x4'));var logger=require(_0x8637('0x5'))(_0x8637('0x6'));var config=require(_0x8637('0x7'));var jayson=require(_0x8637('0x8'));var client=jayson[_0x8637('0x9')][_0x8637('0xa')]({'port':0x232a});config[_0x8637('0xb')]=_[_0x8637('0xc')](config[_0x8637('0xb')],{'host':_0x8637('0xd'),'port':0x18eb});var socket=require(_0x8637('0xe'))(new Redis(config[_0x8637('0xb')]));require(_0x8637('0xf'))[_0x8637('0x10')](socket);function respondWithRpcPromise(_0x2f16e6,_0x952a5,_0x2cbcaf){return new BPromise(function(_0x12bdc9,_0x48e18d){return client[_0x8637('0x11')](_0x2f16e6,_0x2cbcaf)['then'](function(_0x449f51){logger[_0x8637('0x12')](_0x8637('0x13'),_0x952a5,_0x8637('0x14'));logger['debug'](_0x8637('0x15'),_0x952a5,_0x8637('0x14'),JSON[_0x8637('0x16')](_0x449f51));if(_0x449f51[_0x8637('0x17')]){if(_0x449f51[_0x8637('0x17')][_0x8637('0x18')]===0x1f4){logger[_0x8637('0x17')]('SquareProject,\x20%s,\x20%s',_0x952a5,_0x449f51['error']['message']);return _0x48e18d(_0x449f51['error'][_0x8637('0x19')]);}logger[_0x8637('0x17')]('SquareProject,\x20%s,\x20%s',_0x952a5,_0x449f51[_0x8637('0x17')][_0x8637('0x19')]);return _0x12bdc9(_0x449f51['error'][_0x8637('0x19')]);}else{logger[_0x8637('0x12')]('SquareProject,\x20%s,\x20%s',_0x952a5,'request\x20sent');_0x12bdc9(_0x449f51[_0x8637('0x1a')][_0x8637('0x19')]);}})[_0x8637('0x1b')](function(_0x2b345a){logger[_0x8637('0x17')](_0x8637('0x13'),_0x952a5,_0x2b345a);_0x48e18d(_0x2b345a);});});}exports[_0x8637('0x1c')]=function(_0x4dd473){var _0x3240da=this;return new Promise(function(_0x259706,_0xff42d5){return db[_0x8637('0x1d')][_0x8637('0x1e')]({'raw':_0x4dd473[_0x8637('0x1f')]?_0x4dd473[_0x8637('0x1f')][_0x8637('0x20')]===undefined?!![]:![]:!![],'where':_0x4dd473['options']?_0x4dd473[_0x8637('0x1f')][_0x8637('0x21')]||null:null,'attributes':_0x4dd473[_0x8637('0x1f')]?_0x4dd473[_0x8637('0x1f')][_0x8637('0x22')]||null:null,'include':_0x4dd473[_0x8637('0x1f')]?_0x4dd473['options'][_0x8637('0x23')]?_[_0x8637('0x24')](_0x4dd473[_0x8637('0x1f')][_0x8637('0x23')],function(_0x56c1c5){return{'model':db[_0x56c1c5[_0x8637('0x25')]],'as':_0x56c1c5['as'],'attributes':_0x56c1c5[_0x8637('0x22')],'include':_0x56c1c5['include']?_[_0x8637('0x24')](_0x56c1c5[_0x8637('0x23')],function(_0x165e70){return{'model':db[_0x165e70[_0x8637('0x25')]],'as':_0x165e70['as'],'attributes':_0x165e70[_0x8637('0x22')],'include':_0x165e70[_0x8637('0x23')]?_[_0x8637('0x24')](_0x165e70['include'],function(_0x4b0039){return{'model':db[_0x4b0039[_0x8637('0x25')]],'as':_0x4b0039['as'],'attributes':_0x4b0039[_0x8637('0x22')]};}):[]};}):[]};}):[]:[]})[_0x8637('0x26')](function(_0x4a5163){logger[_0x8637('0x12')](_0x8637('0x1c'),_0x4dd473);logger[_0x8637('0x27')]('ShowSquareProject',_0x4dd473,JSON[_0x8637('0x16')](_0x4a5163));_0x259706(_0x4a5163);})[_0x8637('0x1b')](function(_0x290825){logger[_0x8637('0x17')]('ShowSquareProject',_0x290825['message'],_0x4dd473);_0xff42d5(_0x3240da['error'](0x1f4,_0x290825['message']));});});};
\ No newline at end of file
+var _0xc52f=['socket.io-emitter','redis','./squareProject.socket','request','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','find','options','raw','where','attributes','map','include','model','then','ShowSquareProject','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','localhost'];(function(_0x2266da,_0x1b7d01){var _0x467539=function(_0x30e766){while(--_0x30e766){_0x2266da['push'](_0x2266da['shift']());}};_0x467539(++_0x1b7d01);}(_0xc52f,0x69));var _0xfc52=function(_0xaedd4c,_0x1e47e0){_0xaedd4c=_0xaedd4c-0x0;var _0x4702fd=_0xc52f[_0xaedd4c];return _0x4702fd;};'use strict';var _=require(_0xfc52('0x0'));var util=require(_0xfc52('0x1'));var moment=require(_0xfc52('0x2'));var BPromise=require(_0xfc52('0x3'));var rs=require(_0xfc52('0x4'));var fs=require('fs');var Redis=require(_0xfc52('0x5'));var db=require(_0xfc52('0x6'))['db'];var utils=require(_0xfc52('0x7'));var logger=require(_0xfc52('0x8'))(_0xfc52('0x9'));var config=require(_0xfc52('0xa'));var jayson=require(_0xfc52('0xb'));var client=jayson['client'][_0xfc52('0xc')]({'port':0x232a});config['redis']=_[_0xfc52('0xd')](config['redis'],{'host':_0xfc52('0xe'),'port':0x18eb});var socket=require(_0xfc52('0xf'))(new Redis(config[_0xfc52('0x10')]));require(_0xfc52('0x11'))['register'](socket);function respondWithRpcPromise(_0x5e20be,_0xa3e2dc,_0x59ed21){return new BPromise(function(_0x128df7,_0x32125d){return client[_0xfc52('0x12')](_0x5e20be,_0x59ed21)['then'](function(_0x22cc7b){logger[_0xfc52('0x13')](_0xfc52('0x14'),_0xa3e2dc,_0xfc52('0x15'));logger[_0xfc52('0x16')](_0xfc52('0x17'),_0xa3e2dc,_0xfc52('0x15'),JSON[_0xfc52('0x18')](_0x22cc7b));if(_0x22cc7b[_0xfc52('0x19')]){if(_0x22cc7b[_0xfc52('0x19')][_0xfc52('0x1a')]===0x1f4){logger[_0xfc52('0x19')]('SquareProject,\x20%s,\x20%s',_0xa3e2dc,_0x22cc7b[_0xfc52('0x19')]['message']);return _0x32125d(_0x22cc7b[_0xfc52('0x19')]['message']);}logger[_0xfc52('0x19')]('SquareProject,\x20%s,\x20%s',_0xa3e2dc,_0x22cc7b['error'][_0xfc52('0x1b')]);return _0x128df7(_0x22cc7b[_0xfc52('0x19')][_0xfc52('0x1b')]);}else{logger[_0xfc52('0x13')](_0xfc52('0x14'),_0xa3e2dc,_0xfc52('0x15'));_0x128df7(_0x22cc7b[_0xfc52('0x1c')][_0xfc52('0x1b')]);}})[_0xfc52('0x1d')](function(_0x1b5fd1){logger[_0xfc52('0x19')](_0xfc52('0x14'),_0xa3e2dc,_0x1b5fd1);_0x32125d(_0x1b5fd1);});});}exports['ShowSquareProject']=function(_0x5ba635){var _0x58e7a7=this;return new Promise(function(_0x2d683c,_0x348f0){return db['SquareProject'][_0xfc52('0x1e')]({'raw':_0x5ba635['options']?_0x5ba635[_0xfc52('0x1f')][_0xfc52('0x20')]===undefined?!![]:![]:!![],'where':_0x5ba635[_0xfc52('0x1f')]?_0x5ba635[_0xfc52('0x1f')][_0xfc52('0x21')]||null:null,'attributes':_0x5ba635['options']?_0x5ba635[_0xfc52('0x1f')][_0xfc52('0x22')]||null:null,'include':_0x5ba635['options']?_0x5ba635[_0xfc52('0x1f')]['include']?_[_0xfc52('0x23')](_0x5ba635[_0xfc52('0x1f')][_0xfc52('0x24')],function(_0x5f5b3f){return{'model':db[_0x5f5b3f[_0xfc52('0x25')]],'as':_0x5f5b3f['as'],'attributes':_0x5f5b3f['attributes'],'include':_0x5f5b3f[_0xfc52('0x24')]?_['map'](_0x5f5b3f[_0xfc52('0x24')],function(_0x460c38){return{'model':db[_0x460c38[_0xfc52('0x25')]],'as':_0x460c38['as'],'attributes':_0x460c38[_0xfc52('0x22')],'include':_0x460c38[_0xfc52('0x24')]?_[_0xfc52('0x23')](_0x460c38[_0xfc52('0x24')],function(_0x182170){return{'model':db[_0x182170[_0xfc52('0x25')]],'as':_0x182170['as'],'attributes':_0x182170['attributes']};}):[]};}):[]};}):[]:[]})[_0xfc52('0x26')](function(_0x2c795f){logger[_0xfc52('0x13')](_0xfc52('0x27'),_0x5ba635);logger[_0xfc52('0x16')](_0xfc52('0x27'),_0x5ba635,JSON[_0xfc52('0x18')](_0x2c795f));_0x2d683c(_0x2c795f);})[_0xfc52('0x1d')](function(_0x2fe3e3){logger[_0xfc52('0x19')](_0xfc52('0x27'),_0x2fe3e3['message'],_0x5ba635);_0x348f0(_0x58e7a7[_0xfc52('0x19')](0x1f4,_0x2fe3e3[_0xfc52('0x1b')]));});});};
\ No newline at end of file
index 4419c7c..c9243b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7b2e=['emit','register','length','squareProject:','./squareProject.events','save','update'];(function(_0x953b57,_0x11dd4e){var _0x258479=function(_0x3dbc3b){while(--_0x3dbc3b){_0x953b57['push'](_0x953b57['shift']());}};_0x258479(++_0x11dd4e);}(_0x7b2e,0x162));var _0xe7b2=function(_0x266ec6,_0x44e3ca){_0x266ec6=_0x266ec6-0x0;var _0x5f1f59=_0x7b2e[_0x266ec6];return _0x5f1f59;};'use strict';var SquareProjectEvents=require(_0xe7b2('0x0'));var events=[_0xe7b2('0x1'),'remove',_0xe7b2('0x2')];function createListener(_0x17ac6d,_0x3f6f2c){return function(_0x22f4c6){_0x3f6f2c[_0xe7b2('0x3')](_0x17ac6d,_0x22f4c6);};}function removeListener(_0x281bea,_0x1b370a){return function(){SquareProjectEvents['removeListener'](_0x281bea,_0x1b370a);};}exports[_0xe7b2('0x4')]=function(_0x4940e8){for(var _0x498dfa=0x0,_0xd26ef1=events[_0xe7b2('0x5')];_0x498dfa<_0xd26ef1;_0x498dfa++){var _0x58e499=events[_0x498dfa];var _0x1004a4=createListener(_0xe7b2('0x6')+_0x58e499,_0x4940e8);SquareProjectEvents['on'](_0x58e499,_0x1004a4);}};
\ No newline at end of file
+var _0x9fb8=['save','remove','update','length','squareProject:','./squareProject.events'];(function(_0x47d6b2,_0x35b42d){var _0x395b74=function(_0x118ba4){while(--_0x118ba4){_0x47d6b2['push'](_0x47d6b2['shift']());}};_0x395b74(++_0x35b42d);}(_0x9fb8,0x1a3));var _0x89fb=function(_0x8a2dae,_0x2a21a7){_0x8a2dae=_0x8a2dae-0x0;var _0x308f20=_0x9fb8[_0x8a2dae];return _0x308f20;};'use strict';var SquareProjectEvents=require(_0x89fb('0x0'));var events=[_0x89fb('0x1'),_0x89fb('0x2'),_0x89fb('0x3')];function createListener(_0x103028,_0x613576){return function(_0x47a494){_0x613576['emit'](_0x103028,_0x47a494);};}function removeListener(_0x531640,_0x554fa0){return function(){SquareProjectEvents['removeListener'](_0x531640,_0x554fa0);};}exports['register']=function(_0x3f3138){for(var _0x5d940d=0x0,_0x2b5a36=events[_0x89fb('0x4')];_0x5d940d<_0x2b5a36;_0x5d940d++){var _0x598e52=events[_0x5d940d];var _0x5dabe1=createListener(_0x89fb('0x5')+_0x598e52,_0x3f3138);SquareProjectEvents['on'](_0x598e52,_0x5dabe1);}};
\ No newline at end of file
index 5816053..5f557de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7fbe=['/:id','show','/:id/download','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index'];(function(_0x1a9e9e,_0x4e02c0){var _0x461061=function(_0x595613){while(--_0x595613){_0x1a9e9e['push'](_0x1a9e9e['shift']());}};_0x461061(++_0x4e02c0);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x1f808f,_0x172b10){_0x1f808f=_0x1f808f-0x0;var _0x282348=_0x7fbe[_0x1f808f];return _0x282348;};'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['download']);router['post']('/',auth[_0xe7fb('0xa')](),controller[_0xe7fb('0xf')]);router[_0xe7fb('0x10')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x11')]);router[_0xe7fb('0x12')](_0xe7fb('0xc'),auth[_0xe7fb('0xa')](),controller[_0xe7fb('0x13')]);module[_0xe7fb('0x14')]=router;
\ No newline at end of file
+var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','index','/:id','isAuthenticated','show','/:id/download','download','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x1797f7,_0x3960f8){var _0x72f34=function(_0x1bf81f){while(--_0x1bf81f){_0x1797f7['push'](_0x1797f7['shift']());}};_0x72f34(++_0x3960f8);}(_0x4975,0x86));var _0x5497=function(_0x27d175,_0x41ef6c){_0x27d175=_0x27d175-0x0;var _0xca6bcc=_0x4975[_0x27d175];return _0xca6bcc;};'use strict';var multer=require(_0x5497('0x0'));var util=require('util');var path=require(_0x5497('0x1'));var timeout=require(_0x5497('0x2'));var express=require(_0x5497('0x3'));var router=express[_0x5497('0x4')]();var fs_extra=require(_0x5497('0x5'));var auth=require(_0x5497('0x6'));var interaction=require(_0x5497('0x7'));var config=require(_0x5497('0x8'));var controller=require(_0x5497('0x9'));router[_0x5497('0xa')]('/',auth['isAuthenticated'](),controller[_0x5497('0xb')]);router['get'](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0xe')]);router['get'](_0x5497('0xf'),auth['isAuthenticated'](),controller[_0x5497('0x10')]);router[_0x5497('0x11')]('/',auth[_0x5497('0xd')](),controller[_0x5497('0x12')]);router[_0x5497('0x13')](_0x5497('0xc'),auth[_0x5497('0xd')](),controller[_0x5497('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5497('0x15')]);module[_0x5497('0x16')]=router;
\ No newline at end of file
index aec6bcf..be01ee7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x425d=['getDataValue','savePath','substring','lastIndexOf','sequelize','STRING','VIRTUAL'];(function(_0x1e2669,_0x5eb884){var _0x1415db=function(_0x51ad17){while(--_0x51ad17){_0x1e2669['push'](_0x1e2669['shift']());}};_0x1415db(++_0x5eb884);}(_0x425d,0x1e0));var _0xd425=function(_0x1146f7,_0x475356){_0x1146f7=_0x1146f7-0x0;var _0x2e5725=_0x425d[_0x1146f7];return _0x2e5725;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xd425('0x1')]},'callerid':{'type':Sequelize[_0xd425('0x1')]},'calleridname':{'type':Sequelize[_0xd425('0x1')]},'context':{'type':Sequelize[_0xd425('0x1')]},'extension':{'type':Sequelize[_0xd425('0x1')]},'priority':{'type':Sequelize[_0xd425('0x1')]},'accountcode':{'type':Sequelize[_0xd425('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xd425('0x1')]},'saveName':{'type':Sequelize[_0xd425('0x1')]},'filename':{'type':Sequelize[_0xd425('0x1')]},'savePath':{'type':Sequelize[_0xd425('0x1')]},'format':{'type':Sequelize[_0xd425('0x2')],'get':function(){var _0x1d2ed0='';var _0x50b061=this[_0xd425('0x3')](_0xd425('0x4'));if(_0x50b061){_0x1d2ed0=_0x50b061[_0xd425('0x5')](_0x50b061[_0xd425('0x6')]('.'));}return _0x1d2ed0;}}};
\ No newline at end of file
+var _0x032e=['VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize','STRING'];(function(_0x37ea1e,_0x5b7201){var _0x128c04=function(_0x2aa0c6){while(--_0x2aa0c6){_0x37ea1e['push'](_0x37ea1e['shift']());}};_0x128c04(++_0x5b7201);}(_0x032e,0x124));var _0xe032=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x032e[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0xe032('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe032('0x1')]},'callerid':{'type':Sequelize[_0xe032('0x1')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xe032('0x1')]},'priority':{'type':Sequelize[_0xe032('0x1')]},'accountcode':{'type':Sequelize[_0xe032('0x1')]},'dnid':{'type':Sequelize[_0xe032('0x1')]},'projectName':{'type':Sequelize[_0xe032('0x1')]},'saveName':{'type':Sequelize[_0xe032('0x1')]},'filename':{'type':Sequelize[_0xe032('0x1')]},'savePath':{'type':Sequelize[_0xe032('0x1')]},'format':{'type':Sequelize[_0xe032('0x2')],'get':function(){var _0x1576c8='';var _0x3289b0=this[_0xe032('0x3')](_0xe032('0x4'));if(_0x3289b0){_0x1576c8=_0x3289b0[_0xe032('0x5')](_0x3289b0[_0xe032('0x6')]('.'));}return _0x1576c8;}}};
\ No newline at end of file
index c28522b..19e626a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b0c=['body','find','uniqueid','savePath','filename','format','decryptFile','secrets','recording','existsSync','Sequelize','SquareRecording\x20not\x20found','download','extname','unlink','message','send','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','end','stack','name','index','map','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','SquareRecording','findAll','rows','catch','show','params','length','create'];(function(_0x8a30cf,_0x40f19b){var _0x20f439=function(_0x157a5d){while(--_0x157a5d){_0x8a30cf['push'](_0x8a30cf['shift']());}};_0x20f439(++_0x40f19b);}(_0x4b0c,0x13d));var _0xc4b0=function(_0x5c34fc,_0x21a6d8){_0x5c34fc=_0x5c34fc-0x0;var _0x2cd351=_0x4b0c[_0x5c34fc];return _0x2cd351;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc4b0('0x0'));var zipdir=require(_0xc4b0('0x1'));var jsonpatch=require(_0xc4b0('0x2'));var rp=require(_0xc4b0('0x3'));var moment=require(_0xc4b0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc4b0('0x5'));var util=require(_0xc4b0('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc4b0('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc4b0('0x8'));var squel=require(_0xc4b0('0x9'));var crypto=require(_0xc4b0('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc4b0('0xb'));var toCsv=require(_0xc4b0('0xc'));var querystring=require(_0xc4b0('0xd'));var Papa=require(_0xc4b0('0xe'));var Redis=require('ioredis');var authService=require(_0xc4b0('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc4b0('0x10'));var logger=require('../../config/logger')(_0xc4b0('0x11'));var utils=require(_0xc4b0('0x12'));var config=require(_0xc4b0('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xc4b0('0x14'))['db'];function respondWithStatusCode(_0x48a05a,_0x4d6882){_0x4d6882=_0x4d6882||0xcc;return function(_0x1476fd){if(_0x1476fd){return _0x48a05a[_0xc4b0('0x15')](_0x4d6882);}return _0x48a05a['status'](_0x4d6882)['end']();};}function respondWithResult(_0x3c59dc,_0x657480){_0x657480=_0x657480||0xc8;return function(_0x300195){if(_0x300195){return _0x3c59dc[_0xc4b0('0x16')](_0x657480)['json'](_0x300195);}};}function respondWithFilteredResult(_0x430552,_0x5c3f81){return function(_0x1d85b0){if(_0x1d85b0){var _0x53a7cc=typeof _0x5c3f81[_0xc4b0('0x17')]==='undefined'&&typeof _0x5c3f81[_0xc4b0('0x18')]===_0xc4b0('0x19');var _0x1dadf1=_0x1d85b0[_0xc4b0('0x1a')];var _0x379ea9=_0x53a7cc?0x0:_0x5c3f81[_0xc4b0('0x17')];var _0x3762a7=_0x53a7cc?_0x1d85b0[_0xc4b0('0x1a')]:_0x5c3f81['offset']+_0x5c3f81[_0xc4b0('0x18')];var _0x9a88f7;if(_0x3762a7>=_0x1dadf1){_0x3762a7=_0x1dadf1;_0x9a88f7=0xc8;}else{_0x9a88f7=0xce;}_0x430552[_0xc4b0('0x16')](_0x9a88f7);return _0x430552[_0xc4b0('0x1b')](_0xc4b0('0x1c'),_0x379ea9+'-'+_0x3762a7+'/'+_0x1dadf1)[_0xc4b0('0x1d')](_0x1d85b0);}return null;};}function patchUpdates(_0x90d37e){return function(_0x19f212){try{jsonpatch['apply'](_0x19f212,_0x90d37e,!![]);}catch(_0x41910b){return BPromise[_0xc4b0('0x1e')](_0x41910b);}return _0x19f212[_0xc4b0('0x1f')]();};}function saveUpdates(_0x598839,_0x551c28){return function(_0x59f3cc){if(_0x59f3cc){return _0x59f3cc[_0xc4b0('0x20')](_0x598839)[_0xc4b0('0x21')](function(_0x53e27a){return _0x53e27a;});}return null;};}function removeEntity(_0x48acd7,_0x346ace){return function(_0x412e2d){if(_0x412e2d){return _0x412e2d[_0xc4b0('0x22')]()[_0xc4b0('0x21')](function(){_0x48acd7['status'](0xcc)[_0xc4b0('0x23')]();});}};}function handleEntityNotFound(_0x43d5c5,_0x4e884d){return function(_0x3862ec){if(!_0x3862ec){_0x43d5c5[_0xc4b0('0x15')](0x194);}return _0x3862ec;};}function handleError(_0x20bfbd,_0x134213){_0x134213=_0x134213||0x1f4;return function(_0x515a4f){logger['error'](_0x515a4f[_0xc4b0('0x24')]);if(_0x515a4f[_0xc4b0('0x25')]){delete _0x515a4f['name'];}_0x20bfbd['status'](_0x134213)['send'](_0x515a4f);};}exports[_0xc4b0('0x26')]=function(_0x116eda,_0x537f7b){var _0x348596={},_0x4270a1={},_0x5dc884={'count':0x0,'rows':[]};var _0x238f1f=_[_0xc4b0('0x27')](db['SquareRecording'][_0xc4b0('0x28')],function(_0x30d031){return{'name':_0x30d031[_0xc4b0('0x29')],'type':_0x30d031[_0xc4b0('0x2a')][_0xc4b0('0x2b')]};});_0x4270a1['model']=_[_0xc4b0('0x27')](_0x238f1f,'name');_0x4270a1['query']=_[_0xc4b0('0x2c')](_0x116eda['query']);_0x4270a1[_0xc4b0('0x2d')]=_[_0xc4b0('0x2e')](_0x4270a1[_0xc4b0('0x2f')],_0x4270a1[_0xc4b0('0x30')]);_0x348596[_0xc4b0('0x31')]=_[_0xc4b0('0x2e')](_0x4270a1[_0xc4b0('0x2f')],qs[_0xc4b0('0x32')](_0x116eda[_0xc4b0('0x30')][_0xc4b0('0x32')]));_0x348596[_0xc4b0('0x31')]=_0x348596[_0xc4b0('0x31')]['length']?_0x348596[_0xc4b0('0x31')]:_0x4270a1[_0xc4b0('0x2f')];if(!_0x116eda[_0xc4b0('0x30')][_0xc4b0('0x33')](_0xc4b0('0x34'))){_0x348596[_0xc4b0('0x18')]=qs[_0xc4b0('0x18')](_0x116eda[_0xc4b0('0x30')][_0xc4b0('0x18')]);_0x348596[_0xc4b0('0x17')]=qs[_0xc4b0('0x17')](_0x116eda[_0xc4b0('0x30')][_0xc4b0('0x17')]);}_0x348596[_0xc4b0('0x35')]=qs[_0xc4b0('0x36')](_0x116eda['query'][_0xc4b0('0x36')]);_0x348596[_0xc4b0('0x37')]=qs[_0xc4b0('0x2d')](_[_0xc4b0('0x38')](_0x116eda[_0xc4b0('0x30')],_0x4270a1[_0xc4b0('0x2d')]),_0x238f1f);if(_0x116eda[_0xc4b0('0x30')][_0xc4b0('0x39')]){_0x348596[_0xc4b0('0x37')]=_[_0xc4b0('0x3a')](_0x348596['where'],{'$or':_['map'](_0x238f1f,function(_0x4489f9){if(_0x4489f9[_0xc4b0('0x2a')]!==_0xc4b0('0x3b')){var _0xfffd10={};_0xfffd10[_0x4489f9[_0xc4b0('0x25')]]={'$like':'%'+_0x116eda[_0xc4b0('0x30')][_0xc4b0('0x39')]+'%'};return _0xfffd10;}})});}_0x348596=_[_0xc4b0('0x3a')]({},_0x348596,_0x116eda[_0xc4b0('0x3c')]);var _0x15c587={'where':_0x348596['where']};return db['SquareRecording'][_0xc4b0('0x1a')](_0x15c587)['then'](function(_0x5ca4cf){_0x5dc884[_0xc4b0('0x1a')]=_0x5ca4cf;if(_0x116eda[_0xc4b0('0x30')][_0xc4b0('0x3d')]){_0x348596[_0xc4b0('0x3e')]=[{'all':!![]}];}return db[_0xc4b0('0x3f')][_0xc4b0('0x40')](_0x348596);})[_0xc4b0('0x21')](function(_0x2be837){_0x5dc884[_0xc4b0('0x41')]=_0x2be837;return _0x5dc884;})[_0xc4b0('0x21')](respondWithFilteredResult(_0x537f7b,_0x348596))[_0xc4b0('0x42')](handleError(_0x537f7b,null));};exports[_0xc4b0('0x43')]=function(_0x1559c9,_0x49bdf3){var _0x22910d={'raw':!![],'where':{'id':_0x1559c9[_0xc4b0('0x44')]['id']}},_0x9b3671={};_0x9b3671['model']=_[_0xc4b0('0x2c')](db[_0xc4b0('0x3f')][_0xc4b0('0x28')]);_0x9b3671[_0xc4b0('0x30')]=_[_0xc4b0('0x2c')](_0x1559c9[_0xc4b0('0x30')]);_0x9b3671[_0xc4b0('0x2d')]=_[_0xc4b0('0x2e')](_0x9b3671[_0xc4b0('0x2f')],_0x9b3671['query']);_0x22910d[_0xc4b0('0x31')]=_[_0xc4b0('0x2e')](_0x9b3671[_0xc4b0('0x2f')],qs[_0xc4b0('0x32')](_0x1559c9['query'][_0xc4b0('0x32')]));_0x22910d[_0xc4b0('0x31')]=_0x22910d['attributes'][_0xc4b0('0x45')]?_0x22910d[_0xc4b0('0x31')]:_0x9b3671[_0xc4b0('0x2f')];if(_0x1559c9[_0xc4b0('0x30')][_0xc4b0('0x3d')]){_0x22910d[_0xc4b0('0x3e')]=[{'all':!![]}];}_0x22910d=_[_0xc4b0('0x3a')]({},_0x22910d,_0x1559c9[_0xc4b0('0x3c')]);return db['SquareRecording']['find'](_0x22910d)[_0xc4b0('0x21')](handleEntityNotFound(_0x49bdf3,null))[_0xc4b0('0x21')](respondWithResult(_0x49bdf3,null))[_0xc4b0('0x42')](handleError(_0x49bdf3,null));};exports['create']=function(_0x21fc72,_0x1a8e23){return db[_0xc4b0('0x3f')][_0xc4b0('0x46')](_0x21fc72[_0xc4b0('0x47')],{})[_0xc4b0('0x21')](respondWithResult(_0x1a8e23,0xc9))[_0xc4b0('0x42')](handleError(_0x1a8e23,null));};exports[_0xc4b0('0x20')]=function(_0x5d90f6,_0x384c60){if(_0x5d90f6[_0xc4b0('0x47')]['id']){delete _0x5d90f6[_0xc4b0('0x47')]['id'];}return db['SquareRecording'][_0xc4b0('0x48')]({'where':{'id':_0x5d90f6[_0xc4b0('0x44')]['id']}})[_0xc4b0('0x21')](handleEntityNotFound(_0x384c60,null))[_0xc4b0('0x21')](saveUpdates(_0x5d90f6[_0xc4b0('0x47')],null))[_0xc4b0('0x21')](respondWithResult(_0x384c60,null))[_0xc4b0('0x42')](handleError(_0x384c60,null));};exports['download']=function(_0x1eb367,_0x582fd4,_0x5253da){var _0x1540e5=require('../../components/encryptor');var _0x4180ea=![];var _0x3b91ab={};if(_0x1eb367[_0xc4b0('0x30')]['type']&&_0x1eb367[_0xc4b0('0x30')][_0xc4b0('0x2a')]===_0xc4b0('0x49')){_0x3b91ab[_0xc4b0('0x49')]=_0x1eb367['params']['id'];}else{_0x3b91ab['id']=_0x1eb367[_0xc4b0('0x44')]['id'];}return db[_0xc4b0('0x3f')][_0xc4b0('0x48')]({'where':_0x3b91ab,'attributes':['id',_0xc4b0('0x4a'),_0xc4b0('0x4b')],'raw':!![]})[_0xc4b0('0x21')](handleEntityNotFound(_0x582fd4,null))[_0xc4b0('0x21')](function(_0x3d11de){if(_0x3d11de){var _0x45c0d1=_0x3d11de[_0xc4b0('0x4a')];var _0x45d14f=util[_0xc4b0('0x4c')]('%s.cypher',_0x45c0d1);if(fs['existsSync'](_0x45d14f)){_0x4180ea=!![];return _0x1540e5[_0xc4b0('0x4d')](_0x45d14f,_0x45c0d1,config[_0xc4b0('0x4e')][_0xc4b0('0x4f')])[_0xc4b0('0x21')](function(){return _0x3d11de;});}return _0x3d11de;}})[_0xc4b0('0x21')](function(_0xd8cdd){if(_0xd8cdd){var _0x590543=_0xd8cdd[_0xc4b0('0x4a')];if(!fs[_0xc4b0('0x50')](_0x590543)){throw new db[(_0xc4b0('0x51'))]['ValidationError'](_0xc4b0('0x52'));}if(_0xd8cdd[_0xc4b0('0x4b')]){return _0x582fd4[_0xc4b0('0x53')](_0x590543,_0xd8cdd[_0xc4b0('0x4b')]+path[_0xc4b0('0x54')](_0x590543),function(){if(_0x4180ea){fs[_0xc4b0('0x55')](_0x590543);}});}else{return _0x582fd4[_0xc4b0('0x53')](_0x590543,function(_0x420b65){if(_0x4180ea){fs[_0xc4b0('0x55')](_0x590543);}});}}})[_0xc4b0('0x42')](function(_0x1d6bc3){if(_0x1d6bc3[_0xc4b0('0x56')]===_0xc4b0('0x52')){_0x582fd4[_0xc4b0('0x16')](0x194)[_0xc4b0('0x57')](_0xc4b0('0x58'));}else{return handleError(_0x582fd4,null);}});};exports['destroy']=function(_0x51d3e7,_0x440a3c){return db[_0xc4b0('0x3f')][_0xc4b0('0x48')]({'where':{'id':_0x51d3e7[_0xc4b0('0x44')]['id']}})[_0xc4b0('0x21')](function(_0x3fc107){if(_[_0xc4b0('0x59')](_0x3fc107)){throw new ReferenceError(_0xc4b0('0x5a'));}return _0x3fc107;})[_0xc4b0('0x21')](function(_0x55f890){var _0x19b15b=_0x55f890[_0xc4b0('0x4a')];logger[_0xc4b0('0x5b')](_0xc4b0('0x5c'),_0x19b15b);if(!_[_0xc4b0('0x59')](_0x55f890['savePath'])&&fs['existsSync'](_0x19b15b)){logger['info'](_0xc4b0('0x5d')+_0x19b15b+_0xc4b0('0x5e'));fs[_0xc4b0('0x5f')](_0x19b15b);}_0x19b15b=_0x19b15b+_0xc4b0('0x60');if(!_['isNil'](_0x55f890[_0xc4b0('0x4a')])&&fs[_0xc4b0('0x50')](_0x19b15b)){logger['info'](_0xc4b0('0x5d')+_0x19b15b+_0xc4b0('0x5e'));fs[_0xc4b0('0x5f')](_0x19b15b);}return _0x55f890;})['then'](function(_0x2ba8b8){if(!_0x2ba8b8)throw new InternalError();return _0x2ba8b8[_0xc4b0('0x22')]();})[_0xc4b0('0x21')](function(){_0x440a3c[_0xc4b0('0x16')](0xcc)['end']();})[_0xc4b0('0x42')](handleError(_0x440a3c,null));};
\ No newline at end of file
+var _0x1d90=['../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','end','error','name','send','index','map','fieldName','type','model','keys','filters','query','attributes','intersection','fields','length','order','where','pick','filter','merge','VIRTUAL','options','SquareRecording','includeAll','findAll','catch','show','params','include','find','create','body','../../components/encryptor','uniqueid','filename','format','%s.cypher','existsSync','decryptFile','savePath','Sequelize','download','unlink','SquareRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','rimraf','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x5dec53,_0x5e3fce){var _0x44fceb=function(_0x2ce4fd){while(--_0x2ce4fd){_0x5dec53['push'](_0x5dec53['shift']());}};_0x44fceb(++_0x5e3fce);}(_0x1d90,0x157));var _0x01d9=function(_0xa388a2,_0x40bde6){_0xa388a2=_0xa388a2-0x0;var _0x7ce7f6=_0x1d90[_0xa388a2];return _0x7ce7f6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x01d9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x01d9('0x1'));var BPromise=require(_0x01d9('0x2'));var Mustache=require(_0x01d9('0x3'));var util=require('util');var path=require(_0x01d9('0x4'));var sox=require(_0x01d9('0x5'));var csv=require(_0x01d9('0x6'));var ejs=require(_0x01d9('0x7'));var fs=require('fs');var fs_extra=require(_0x01d9('0x8'));var _=require(_0x01d9('0x9'));var squel=require(_0x01d9('0xa'));var crypto=require(_0x01d9('0xb'));var jsforce=require(_0x01d9('0xc'));var deskjs=require(_0x01d9('0xd'));var toCsv=require(_0x01d9('0x6'));var querystring=require(_0x01d9('0xe'));var Papa=require(_0x01d9('0xf'));var Redis=require(_0x01d9('0x10'));var authService=require(_0x01d9('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x01d9('0x12'));var logger=require(_0x01d9('0x13'))(_0x01d9('0x14'));var utils=require(_0x01d9('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x01d9('0x16'));var db=require(_0x01d9('0x17'))['db'];function respondWithStatusCode(_0x58faf1,_0x4d526e){_0x4d526e=_0x4d526e||0xcc;return function(_0x17b0f8){if(_0x17b0f8){return _0x58faf1[_0x01d9('0x18')](_0x4d526e);}return _0x58faf1[_0x01d9('0x19')](_0x4d526e)['end']();};}function respondWithResult(_0x41744f,_0x485c5b){_0x485c5b=_0x485c5b||0xc8;return function(_0x5a8c43){if(_0x5a8c43){return _0x41744f['status'](_0x485c5b)[_0x01d9('0x1a')](_0x5a8c43);}};}function respondWithFilteredResult(_0x4341dc,_0x4622a0){return function(_0xc6c061){if(_0xc6c061){var _0x47d6b3=typeof _0x4622a0['offset']===_0x01d9('0x1b')&&typeof _0x4622a0[_0x01d9('0x1c')]==='undefined';var _0x105877=_0xc6c061['count'];var _0x8e22ee=_0x47d6b3?0x0:_0x4622a0['offset'];var _0x8f5e60=_0x47d6b3?_0xc6c061[_0x01d9('0x1d')]:_0x4622a0[_0x01d9('0x1e')]+_0x4622a0[_0x01d9('0x1c')];var _0x4c44e9;if(_0x8f5e60>=_0x105877){_0x8f5e60=_0x105877;_0x4c44e9=0xc8;}else{_0x4c44e9=0xce;}_0x4341dc[_0x01d9('0x19')](_0x4c44e9);return _0x4341dc[_0x01d9('0x1f')](_0x01d9('0x20'),_0x8e22ee+'-'+_0x8f5e60+'/'+_0x105877)['json'](_0xc6c061);}return null;};}function patchUpdates(_0x5e1520){return function(_0x406436){try{jsonpatch['apply'](_0x406436,_0x5e1520,!![]);}catch(_0x3bee78){return BPromise[_0x01d9('0x21')](_0x3bee78);}return _0x406436[_0x01d9('0x22')]();};}function saveUpdates(_0x42f7e0,_0x44dbc8){return function(_0x1309b7){if(_0x1309b7){return _0x1309b7[_0x01d9('0x23')](_0x42f7e0)[_0x01d9('0x24')](function(_0x1e971d){return _0x1e971d;});}return null;};}function removeEntity(_0x226a3a,_0x1f462f){return function(_0x321d62){if(_0x321d62){return _0x321d62[_0x01d9('0x25')]()[_0x01d9('0x24')](function(){_0x226a3a['status'](0xcc)[_0x01d9('0x26')]();});}};}function handleEntityNotFound(_0x59e9a1,_0x331336){return function(_0x59ca03){if(!_0x59ca03){_0x59e9a1[_0x01d9('0x18')](0x194);}return _0x59ca03;};}function handleError(_0x75f4b9,_0x465ace){_0x465ace=_0x465ace||0x1f4;return function(_0x5b0463){logger[_0x01d9('0x27')](_0x5b0463['stack']);if(_0x5b0463[_0x01d9('0x28')]){delete _0x5b0463[_0x01d9('0x28')];}_0x75f4b9[_0x01d9('0x19')](_0x465ace)[_0x01d9('0x29')](_0x5b0463);};}exports[_0x01d9('0x2a')]=function(_0x2bbeb9,_0x2ed9ec){var _0xcad8d6={},_0x3de29e={},_0x343f97={'count':0x0,'rows':[]};var _0xa077c5=_[_0x01d9('0x2b')](db['SquareRecording']['rawAttributes'],function(_0x5c7b5b){return{'name':_0x5c7b5b[_0x01d9('0x2c')],'type':_0x5c7b5b[_0x01d9('0x2d')]['key']};});_0x3de29e[_0x01d9('0x2e')]=_[_0x01d9('0x2b')](_0xa077c5,'name');_0x3de29e['query']=_[_0x01d9('0x2f')](_0x2bbeb9['query']);_0x3de29e[_0x01d9('0x30')]=_['intersection'](_0x3de29e[_0x01d9('0x2e')],_0x3de29e[_0x01d9('0x31')]);_0xcad8d6[_0x01d9('0x32')]=_[_0x01d9('0x33')](_0x3de29e[_0x01d9('0x2e')],qs[_0x01d9('0x34')](_0x2bbeb9[_0x01d9('0x31')][_0x01d9('0x34')]));_0xcad8d6[_0x01d9('0x32')]=_0xcad8d6['attributes'][_0x01d9('0x35')]?_0xcad8d6[_0x01d9('0x32')]:_0x3de29e[_0x01d9('0x2e')];if(!_0x2bbeb9[_0x01d9('0x31')]['hasOwnProperty']('nolimit')){_0xcad8d6[_0x01d9('0x1c')]=qs[_0x01d9('0x1c')](_0x2bbeb9[_0x01d9('0x31')]['limit']);_0xcad8d6['offset']=qs[_0x01d9('0x1e')](_0x2bbeb9[_0x01d9('0x31')][_0x01d9('0x1e')]);}_0xcad8d6[_0x01d9('0x36')]=qs['sort'](_0x2bbeb9['query']['sort']);_0xcad8d6[_0x01d9('0x37')]=qs[_0x01d9('0x30')](_[_0x01d9('0x38')](_0x2bbeb9[_0x01d9('0x31')],_0x3de29e[_0x01d9('0x30')]),_0xa077c5);if(_0x2bbeb9['query'][_0x01d9('0x39')]){_0xcad8d6[_0x01d9('0x37')]=_[_0x01d9('0x3a')](_0xcad8d6[_0x01d9('0x37')],{'$or':_[_0x01d9('0x2b')](_0xa077c5,function(_0x28a89a){if(_0x28a89a[_0x01d9('0x2d')]!==_0x01d9('0x3b')){var _0x781b73={};_0x781b73[_0x28a89a[_0x01d9('0x28')]]={'$like':'%'+_0x2bbeb9[_0x01d9('0x31')][_0x01d9('0x39')]+'%'};return _0x781b73;}})});}_0xcad8d6=_[_0x01d9('0x3a')]({},_0xcad8d6,_0x2bbeb9[_0x01d9('0x3c')]);var _0x371197={'where':_0xcad8d6[_0x01d9('0x37')]};return db[_0x01d9('0x3d')][_0x01d9('0x1d')](_0x371197)[_0x01d9('0x24')](function(_0x37eefa){_0x343f97[_0x01d9('0x1d')]=_0x37eefa;if(_0x2bbeb9[_0x01d9('0x31')][_0x01d9('0x3e')]){_0xcad8d6['include']=[{'all':!![]}];}return db['SquareRecording'][_0x01d9('0x3f')](_0xcad8d6);})[_0x01d9('0x24')](function(_0x3f0ec6){_0x343f97['rows']=_0x3f0ec6;return _0x343f97;})[_0x01d9('0x24')](respondWithFilteredResult(_0x2ed9ec,_0xcad8d6))[_0x01d9('0x40')](handleError(_0x2ed9ec,null));};exports[_0x01d9('0x41')]=function(_0x395c70,_0xeae29e){var _0x27ad75={'raw':!![],'where':{'id':_0x395c70[_0x01d9('0x42')]['id']}},_0x3a1b3b={};_0x3a1b3b[_0x01d9('0x2e')]=_[_0x01d9('0x2f')](db[_0x01d9('0x3d')]['rawAttributes']);_0x3a1b3b[_0x01d9('0x31')]=_[_0x01d9('0x2f')](_0x395c70[_0x01d9('0x31')]);_0x3a1b3b[_0x01d9('0x30')]=_[_0x01d9('0x33')](_0x3a1b3b[_0x01d9('0x2e')],_0x3a1b3b[_0x01d9('0x31')]);_0x27ad75[_0x01d9('0x32')]=_['intersection'](_0x3a1b3b[_0x01d9('0x2e')],qs[_0x01d9('0x34')](_0x395c70[_0x01d9('0x31')][_0x01d9('0x34')]));_0x27ad75['attributes']=_0x27ad75[_0x01d9('0x32')]['length']?_0x27ad75[_0x01d9('0x32')]:_0x3a1b3b[_0x01d9('0x2e')];if(_0x395c70[_0x01d9('0x31')][_0x01d9('0x3e')]){_0x27ad75[_0x01d9('0x43')]=[{'all':!![]}];}_0x27ad75=_[_0x01d9('0x3a')]({},_0x27ad75,_0x395c70['options']);return db['SquareRecording'][_0x01d9('0x44')](_0x27ad75)[_0x01d9('0x24')](handleEntityNotFound(_0xeae29e,null))[_0x01d9('0x24')](respondWithResult(_0xeae29e,null))['catch'](handleError(_0xeae29e,null));};exports[_0x01d9('0x45')]=function(_0x4f1892,_0x1f9944){return db[_0x01d9('0x3d')]['create'](_0x4f1892[_0x01d9('0x46')],{})[_0x01d9('0x24')](respondWithResult(_0x1f9944,0xc9))[_0x01d9('0x40')](handleError(_0x1f9944,null));};exports[_0x01d9('0x23')]=function(_0x4afaaa,_0x5539d2){if(_0x4afaaa[_0x01d9('0x46')]['id']){delete _0x4afaaa[_0x01d9('0x46')]['id'];}return db['SquareRecording'][_0x01d9('0x44')]({'where':{'id':_0x4afaaa[_0x01d9('0x42')]['id']}})[_0x01d9('0x24')](handleEntityNotFound(_0x5539d2,null))[_0x01d9('0x24')](saveUpdates(_0x4afaaa[_0x01d9('0x46')],null))[_0x01d9('0x24')](respondWithResult(_0x5539d2,null))['catch'](handleError(_0x5539d2,null));};exports['download']=function(_0x2f19ad,_0x230987,_0x10dab4){var _0x121ec4=require(_0x01d9('0x47'));var _0x290573=![];var _0x3beeda={};if(_0x2f19ad[_0x01d9('0x31')][_0x01d9('0x2d')]&&_0x2f19ad[_0x01d9('0x31')]['type']===_0x01d9('0x48')){_0x3beeda['uniqueid']=_0x2f19ad[_0x01d9('0x42')]['id'];}else{_0x3beeda['id']=_0x2f19ad[_0x01d9('0x42')]['id'];}return db[_0x01d9('0x3d')]['find']({'where':_0x3beeda,'attributes':['id','savePath',_0x01d9('0x49')],'raw':!![]})['then'](handleEntityNotFound(_0x230987,null))['then'](function(_0x4c1cf2){if(_0x4c1cf2){var _0x5620b3=_0x4c1cf2['savePath'];var _0x3cee42=util[_0x01d9('0x4a')](_0x01d9('0x4b'),_0x5620b3);if(fs[_0x01d9('0x4c')](_0x3cee42)){_0x290573=!![];return _0x121ec4[_0x01d9('0x4d')](_0x3cee42,_0x5620b3,config['secrets']['recording'])[_0x01d9('0x24')](function(){return _0x4c1cf2;});}return _0x4c1cf2;}})[_0x01d9('0x24')](function(_0x10f8a7){if(_0x10f8a7){var _0x835f69=_0x10f8a7[_0x01d9('0x4e')];if(!fs[_0x01d9('0x4c')](_0x835f69)){throw new db[(_0x01d9('0x4f'))]['ValidationError']('SquareRecording\x20not\x20found');}if(_0x10f8a7['filename']){return _0x230987[_0x01d9('0x50')](_0x835f69,_0x10f8a7['filename']+path['extname'](_0x835f69),function(){if(_0x290573){fs[_0x01d9('0x51')](_0x835f69);}});}else{return _0x230987[_0x01d9('0x50')](_0x835f69,function(_0x1f74b5){if(_0x290573){fs[_0x01d9('0x51')](_0x835f69);}});}}})[_0x01d9('0x40')](function(_0x190ef4){if(_0x190ef4['message']===_0x01d9('0x52')){_0x230987[_0x01d9('0x19')](0x194)[_0x01d9('0x29')](_0x01d9('0x53'));}else{return handleError(_0x230987,null);}});};exports[_0x01d9('0x25')]=function(_0x3f3894,_0x207325){return db[_0x01d9('0x3d')][_0x01d9('0x44')]({'where':{'id':_0x3f3894[_0x01d9('0x42')]['id']}})[_0x01d9('0x24')](function(_0x2ec6ee){if(_[_0x01d9('0x54')](_0x2ec6ee)){throw new ReferenceError(_0x01d9('0x55'));}return _0x2ec6ee;})[_0x01d9('0x24')](function(_0x56d308){var _0x525271=_0x56d308[_0x01d9('0x4e')];logger[_0x01d9('0x56')]('cancellazione\x20fisica\x20documento\x20%s',_0x525271);if(!_[_0x01d9('0x54')](_0x56d308['savePath'])&&fs[_0x01d9('0x4c')](_0x525271)){logger['info']('File:\x20\x22'+_0x525271+_0x01d9('0x57'));fs['unlinkSync'](_0x525271);}_0x525271=_0x525271+_0x01d9('0x58');if(!_['isNil'](_0x56d308[_0x01d9('0x4e')])&&fs[_0x01d9('0x4c')](_0x525271)){logger['info']('File:\x20\x22'+_0x525271+_0x01d9('0x57'));fs[_0x01d9('0x59')](_0x525271);}return _0x56d308;})['then'](function(_0x3c8d0b){if(!_0x3c8d0b)throw new InternalError();return _0x3c8d0b['destroy']();})[_0x01d9('0x24')](function(){_0x207325[_0x01d9('0x19')](0xcc)[_0x01d9('0x26')]();})[_0x01d9('0x40')](handleError(_0x207325,null));};
\ No newline at end of file
index ded6261..c37a1c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba34=['rimraf','../../config/environment','./squareRecording.attributes','exports','define','square_recordings','lodash','util','../../config/logger','api','moment'];(function(_0x1011ae,_0x447133){var _0x314fb=function(_0x166933){while(--_0x166933){_0x1011ae['push'](_0x1011ae['shift']());}};_0x314fb(++_0x447133);}(_0xba34,0x119));var _0x4ba3=function(_0x4e5253,_0x254a3f){_0x4e5253=_0x4e5253-0x0;var _0x5bafb7=_0xba34[_0x4e5253];return _0x5bafb7;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var logger=require(_0x4ba3('0x2'))(_0x4ba3('0x3'));var moment=require(_0x4ba3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var attributes=require(_0x4ba3('0x7'));module[_0x4ba3('0x8')]=function(_0x3590a1,_0xb88621){return _0x3590a1[_0x4ba3('0x9')]('SquareRecording',attributes,{'tableName':_0x4ba3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe3b3=['path','rimraf','../../config/environment','exports','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xe3b3,0x1b3));var _0x3e3b=function(_0x34d660,_0x166eb7){_0x34d660=_0x34d660-0x0;var _0x3723cf=_0xe3b3[_0x34d660];return _0x3723cf;};'use strict';var _=require(_0x3e3b('0x0'));var util=require(_0x3e3b('0x1'));var logger=require(_0x3e3b('0x2'))(_0x3e3b('0x3'));var moment=require(_0x3e3b('0x4'));var BPromise=require(_0x3e3b('0x5'));var rp=require(_0x3e3b('0x6'));var fs=require('fs');var path=require(_0x3e3b('0x7'));var rimraf=require(_0x3e3b('0x8'));var config=require(_0x3e3b('0x9'));var attributes=require('./squareRecording.attributes');module[_0x3e3b('0xa')]=function(_0x3fd79a,_0x410458){return _0x3fd79a['define'](_0x3e3b('0xb'),attributes,{'tableName':_0x3e3b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 134bcbe..9e1205f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x481a=['code','SquareRecording,\x20%s,\x20%s','message','info','catch','CreateSquareRecording','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','stringify','error'];(function(_0x5f0714,_0x305ed3){var _0x7dee55=function(_0x21dc3a){while(--_0x21dc3a){_0x5f0714['push'](_0x5f0714['shift']());}};_0x7dee55(++_0x305ed3);}(_0x481a,0x1a0));var _0xa481=function(_0xb5d151,_0x4535bb){_0xb5d151=_0xb5d151-0x0;var _0x22fa8d=_0x481a[_0xb5d151];return _0x22fa8d;};'use strict';var _=require(_0xa481('0x0'));var util=require(_0xa481('0x1'));var moment=require(_0xa481('0x2'));var BPromise=require(_0xa481('0x3'));var rs=require(_0xa481('0x4'));var fs=require('fs');var Redis=require(_0xa481('0x5'));var db=require(_0xa481('0x6'))['db'];var utils=require(_0xa481('0x7'));var logger=require(_0xa481('0x8'))(_0xa481('0x9'));var config=require(_0xa481('0xa'));var jayson=require(_0xa481('0xb'));var client=jayson[_0xa481('0xc')][_0xa481('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x20232a,_0x105b13,_0x58a526){return new BPromise(function(_0x1a1ac1,_0x1de77d){return client[_0xa481('0xe')](_0x20232a,_0x58a526)[_0xa481('0xf')](function(_0xd5e9d2){logger['info']('SquareRecording,\x20%s,\x20%s',_0x105b13,_0xa481('0x10'));logger['debug']('SquareRecording,\x20%s,\x20%s,\x20%s',_0x105b13,_0xa481('0x10'),JSON[_0xa481('0x11')](_0xd5e9d2));if(_0xd5e9d2[_0xa481('0x12')]){if(_0xd5e9d2[_0xa481('0x12')][_0xa481('0x13')]===0x1f4){logger['error'](_0xa481('0x14'),_0x105b13,_0xd5e9d2[_0xa481('0x12')][_0xa481('0x15')]);return _0x1de77d(_0xd5e9d2[_0xa481('0x12')][_0xa481('0x15')]);}logger[_0xa481('0x12')](_0xa481('0x14'),_0x105b13,_0xd5e9d2['error'][_0xa481('0x15')]);return _0x1a1ac1(_0xd5e9d2[_0xa481('0x12')][_0xa481('0x15')]);}else{logger[_0xa481('0x16')](_0xa481('0x14'),_0x105b13,_0xa481('0x10'));_0x1a1ac1(_0xd5e9d2['result'][_0xa481('0x15')]);}})[_0xa481('0x17')](function(_0xc8b4c3){logger['error'](_0xa481('0x14'),_0x105b13,_0xc8b4c3);_0x1de77d(_0xc8b4c3);});});}exports[_0xa481('0x18')]=function(_0x39bb08){var _0x3337a1=this;return new Promise(function(_0x4d25a8,_0x2958f3){return db['SquareRecording'][_0xa481('0x19')](_0x39bb08[_0xa481('0x1a')],{'raw':_0x39bb08[_0xa481('0x1b')]?_0x39bb08['options'][_0xa481('0x1c')]===undefined?!![]:![]:!![]})[_0xa481('0xf')](function(_0x1fb155){logger[_0xa481('0x16')]('CreateSquareRecording',_0x39bb08);logger['debug'](_0xa481('0x18'),_0x39bb08,JSON[_0xa481('0x11')](_0x1fb155));_0x4d25a8(_0x1fb155);})['catch'](function(_0x49ade0){logger[_0xa481('0x12')](_0xa481('0x18'),_0x49ade0[_0xa481('0x15')],_0x39bb08);_0x2958f3(_0x3337a1[_0xa481('0x12')](0x1f4,_0x49ade0['message']));});});};
\ No newline at end of file
+var _0x191c=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error','code','SquareRecording,\x20%s,\x20%s','message','catch','SquareRecording','create','body','options','raw','stringify','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x191c,0xb1));var _0xc191=function(_0x293f74,_0x5aa955){_0x293f74=_0x293f74-0x0;var _0x1c84eb=_0x191c[_0x293f74];return _0x1c84eb;};'use strict';var _=require(_0xc191('0x0'));var util=require(_0xc191('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc191('0x2'));var db=require(_0xc191('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc191('0x4'))('rpc');var config=require(_0xc191('0x5'));var jayson=require(_0xc191('0x6'));var client=jayson[_0xc191('0x7')][_0xc191('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4f69ff,_0x824fc8,_0x317208){return new BPromise(function(_0x59cb62,_0x2ea617){return client[_0xc191('0x9')](_0x4f69ff,_0x317208)[_0xc191('0xa')](function(_0x50e8ce){logger[_0xc191('0xb')]('SquareRecording,\x20%s,\x20%s',_0x824fc8,_0xc191('0xc'));logger[_0xc191('0xd')](_0xc191('0xe'),_0x824fc8,_0xc191('0xc'),JSON['stringify'](_0x50e8ce));if(_0x50e8ce[_0xc191('0xf')]){if(_0x50e8ce[_0xc191('0xf')][_0xc191('0x10')]===0x1f4){logger['error'](_0xc191('0x11'),_0x824fc8,_0x50e8ce[_0xc191('0xf')][_0xc191('0x12')]);return _0x2ea617(_0x50e8ce['error'][_0xc191('0x12')]);}logger[_0xc191('0xf')]('SquareRecording,\x20%s,\x20%s',_0x824fc8,_0x50e8ce[_0xc191('0xf')][_0xc191('0x12')]);return _0x59cb62(_0x50e8ce[_0xc191('0xf')][_0xc191('0x12')]);}else{logger['info'](_0xc191('0x11'),_0x824fc8,_0xc191('0xc'));_0x59cb62(_0x50e8ce['result'][_0xc191('0x12')]);}})[_0xc191('0x13')](function(_0x3e6f7f){logger[_0xc191('0xf')](_0xc191('0x11'),_0x824fc8,_0x3e6f7f);_0x2ea617(_0x3e6f7f);});});}exports['CreateSquareRecording']=function(_0x4b6d49){var _0x50f75e=this;return new Promise(function(_0x3e904d,_0x37ac31){return db[_0xc191('0x14')][_0xc191('0x15')](_0x4b6d49[_0xc191('0x16')],{'raw':_0x4b6d49['options']?_0x4b6d49[_0xc191('0x17')][_0xc191('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x4c7bb4){logger[_0xc191('0xb')]('CreateSquareRecording',_0x4b6d49);logger[_0xc191('0xd')]('CreateSquareRecording',_0x4b6d49,JSON[_0xc191('0x19')](_0x4c7bb4));_0x3e904d(_0x4c7bb4);})['catch'](function(_0x1a4d74){logger[_0xc191('0xf')]('CreateSquareRecording',_0x1a4d74[_0xc191('0x12')],_0x4b6d49);_0x37ac31(_0x50f75e['error'](0x1f4,_0x1a4d74[_0xc191('0x12')]));});});};
\ No newline at end of file
index caac053..eebdbaa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb10b=['../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x4882c4,_0x11492a){var _0x1887d6=function(_0x27ffbf){while(--_0x27ffbf){_0x4882c4['push'](_0x4882c4['shift']());}};_0x1887d6(++_0x11492a);}(_0xb10b,0x12a));var _0xbb10=function(_0x3a023f,_0x3a0789){_0x3a023f=_0x3a023f-0x0;var _0x1de363=_0xb10b[_0x3a023f];return _0x1de363;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x5bbae4,_0x2a4a4e){var _0x338a50=function(_0x478845){while(--_0x478845){_0x5bbae4['push'](_0x5bbae4['shift']());}};_0x338a50(++_0x2a4a4e);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
index 313ccc0..1c7c2cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x832a=['exports','STRING','DATE','BOOLEAN'];(function(_0x2d2639,_0x333c5f){var _0x580999=function(_0x6d5347){while(--_0x6d5347){_0x2d2639['push'](_0x2d2639['shift']());}};_0x580999(++_0x333c5f);}(_0x832a,0x158));var _0xa832=function(_0x5f4902,_0x1198fb){_0x5f4902=_0x5f4902-0x0;var _0x743933=_0x832a[_0x5f4902];return _0x743933;};'use strict';var Sequelize=require('sequelize');module[_0xa832('0x0')]={'network':{'type':Sequelize[_0xa832('0x1')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xa832('0x1')]},'language':{'type':Sequelize[_0xa832('0x1')]},'type':{'type':Sequelize[_0xa832('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0xa832('0x1')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xa832('0x1')]},'callingpres':{'type':Sequelize[_0xa832('0x1')]},'callingani2':{'type':Sequelize[_0xa832('0x1')]},'callington':{'type':Sequelize[_0xa832('0x1')]},'callingtns':{'type':Sequelize[_0xa832('0x1')]},'dnid':{'type':Sequelize[_0xa832('0x1')]},'rdnis':{'type':Sequelize[_0xa832('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xa832('0x1')]},'priority':{'type':Sequelize[_0xa832('0x1')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xa832('0x1')]},'threadid':{'type':Sequelize[_0xa832('0x1')]},'project_name':{'type':Sequelize[_0xa832('0x1')]},'joinAt':{'type':Sequelize[_0xa832('0x2')]},'leaveAt':{'type':Sequelize[_0xa832('0x2')]},'bot':{'type':Sequelize[_0xa832('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x7472=['BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x7472,0x128));var _0x2747=function(_0x2c4ab1,_0x4f38e2){_0x2c4ab1=_0x2c4ab1-0x0;var _0x5e68df=_0x7472[_0x2c4ab1];return _0x5e68df;};'use strict';var Sequelize=require(_0x2747('0x0'));module[_0x2747('0x1')]={'network':{'type':Sequelize[_0x2747('0x2')]},'network_script':{'type':Sequelize[_0x2747('0x2')]},'request':{'type':Sequelize[_0x2747('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x2747('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x2747('0x2')]},'version':{'type':Sequelize[_0x2747('0x2')]},'callerid':{'type':Sequelize[_0x2747('0x2')]},'calleridname':{'type':Sequelize[_0x2747('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x2747('0x2')]},'callington':{'type':Sequelize[_0x2747('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x2747('0x2')]},'context':{'type':Sequelize[_0x2747('0x2')]},'extension':{'type':Sequelize[_0x2747('0x2')]},'priority':{'type':Sequelize[_0x2747('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x2747('0x2')]},'joinAt':{'type':Sequelize[_0x2747('0x3')]},'leaveAt':{'type':Sequelize[_0x2747('0x3')]},'bot':{'type':Sequelize[_0x2747('0x4')],'defaultValue':![]}};
\ No newline at end of file
index af21353..07bff86 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x89c7=['rimraf','fast-json-patch','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','index','SquareReport','rawAttributes','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','describe'];(function(_0xe217f9,_0x5148b6){var _0x30f830=function(_0xa68075){while(--_0xa68075){_0xe217f9['push'](_0xe217f9['shift']());}};_0x30f830(++_0x5148b6);}(_0x89c7,0x134));var _0x789c=function(_0x3a9815,_0x47eb16){_0x3a9815=_0x3a9815-0x0;var _0x188653=_0x89c7[_0x3a9815];return _0x188653;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x789c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x789c('0x1'));var rp=require('request-promise');var moment=require(_0x789c('0x2'));var BPromise=require(_0x789c('0x3'));var Mustache=require(_0x789c('0x4'));var util=require('util');var path=require(_0x789c('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x789c('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x789c('0x7'));var squel=require(_0x789c('0x8'));var crypto=require(_0x789c('0x9'));var jsforce=require(_0x789c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x789c('0xb'));var querystring=require(_0x789c('0xc'));var Papa=require(_0x789c('0xd'));var Redis=require(_0x789c('0xe'));var authService=require(_0x789c('0xf'));var qs=require(_0x789c('0x10'));var as=require(_0x789c('0x11'));var hardwareService=require(_0x789c('0x12'));var logger=require(_0x789c('0x13'))(_0x789c('0x14'));var utils=require(_0x789c('0x15'));var config=require(_0x789c('0x16'));var licenseUtil=require(_0x789c('0x17'));var db=require(_0x789c('0x18'))['db'];function respondWithStatusCode(_0x4008e2,_0x3279e8){_0x3279e8=_0x3279e8||0xcc;return function(_0x37d8df){if(_0x37d8df){return _0x4008e2[_0x789c('0x19')](_0x3279e8);}return _0x4008e2[_0x789c('0x1a')](_0x3279e8)[_0x789c('0x1b')]();};}function respondWithResult(_0x433255,_0x3b227b){_0x3b227b=_0x3b227b||0xc8;return function(_0x594c85){if(_0x594c85){return _0x433255[_0x789c('0x1a')](_0x3b227b)['json'](_0x594c85);}};}function respondWithFilteredResult(_0x416c65,_0x4174a9){return function(_0x35560e){if(_0x35560e){var _0x404294=typeof _0x4174a9[_0x789c('0x1c')]===_0x789c('0x1d')&&typeof _0x4174a9['limit']==='undefined';var _0x30dbf7=_0x35560e[_0x789c('0x1e')];var _0x1e7cad=_0x404294?0x0:_0x4174a9[_0x789c('0x1c')];var _0x267c24=_0x404294?_0x35560e[_0x789c('0x1e')]:_0x4174a9[_0x789c('0x1c')]+_0x4174a9[_0x789c('0x1f')];var _0x4d5a95;if(_0x267c24>=_0x30dbf7){_0x267c24=_0x30dbf7;_0x4d5a95=0xc8;}else{_0x4d5a95=0xce;}_0x416c65['status'](_0x4d5a95);return _0x416c65[_0x789c('0x20')](_0x789c('0x21'),_0x1e7cad+'-'+_0x267c24+'/'+_0x30dbf7)[_0x789c('0x22')](_0x35560e);}return null;};}function patchUpdates(_0x111d81){return function(_0x4d46a1){try{jsonpatch[_0x789c('0x23')](_0x4d46a1,_0x111d81,!![]);}catch(_0x52f9d1){return BPromise[_0x789c('0x24')](_0x52f9d1);}return _0x4d46a1[_0x789c('0x25')]();};}function saveUpdates(_0x2234a1,_0x52d178){return function(_0x5ebe72){if(_0x5ebe72){return _0x5ebe72[_0x789c('0x26')](_0x2234a1)[_0x789c('0x27')](function(_0x552185){return _0x552185;});}return null;};}function removeEntity(_0x56e1ad,_0x59ee1e){return function(_0x2e2b53){if(_0x2e2b53){return _0x2e2b53['destroy']()[_0x789c('0x27')](function(){_0x56e1ad[_0x789c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30136b,_0x5eb028){return function(_0x1b8b53){if(!_0x1b8b53){_0x30136b['sendStatus'](0x194);}return _0x1b8b53;};}function handleError(_0x35a8a8,_0x35285b){_0x35285b=_0x35285b||0x1f4;return function(_0x48ce23){logger[_0x789c('0x28')](_0x48ce23[_0x789c('0x29')]);if(_0x48ce23[_0x789c('0x2a')]){delete _0x48ce23[_0x789c('0x2a')];}_0x35a8a8[_0x789c('0x1a')](_0x35285b)['send'](_0x48ce23);};}exports[_0x789c('0x2b')]=function(_0x3935de,_0x38c101){var _0x3d4430={},_0x49aa5e={},_0x172c9f={'count':0x0,'rows':[]};var _0x187a81=_['map'](db[_0x789c('0x2c')][_0x789c('0x2d')],function(_0x408982){return{'name':_0x408982[_0x789c('0x2e')],'type':_0x408982[_0x789c('0x2f')][_0x789c('0x30')]};});_0x49aa5e['model']=_[_0x789c('0x31')](_0x187a81,_0x789c('0x2a'));_0x49aa5e[_0x789c('0x32')]=_['keys'](_0x3935de[_0x789c('0x32')]);_0x49aa5e[_0x789c('0x33')]=_[_0x789c('0x34')](_0x49aa5e[_0x789c('0x35')],_0x49aa5e[_0x789c('0x32')]);_0x3d4430[_0x789c('0x36')]=_[_0x789c('0x34')](_0x49aa5e[_0x789c('0x35')],qs[_0x789c('0x37')](_0x3935de[_0x789c('0x32')][_0x789c('0x37')]));_0x3d4430[_0x789c('0x36')]=_0x3d4430[_0x789c('0x36')][_0x789c('0x38')]?_0x3d4430[_0x789c('0x36')]:_0x49aa5e[_0x789c('0x35')];if(!_0x3935de[_0x789c('0x32')][_0x789c('0x39')](_0x789c('0x3a'))){_0x3d4430[_0x789c('0x1f')]=qs[_0x789c('0x1f')](_0x3935de[_0x789c('0x32')][_0x789c('0x1f')]);_0x3d4430[_0x789c('0x1c')]=qs[_0x789c('0x1c')](_0x3935de['query'][_0x789c('0x1c')]);}_0x3d4430[_0x789c('0x3b')]=qs['sort'](_0x3935de[_0x789c('0x32')]['sort']);_0x3d4430['where']=qs['filters'](_[_0x789c('0x3c')](_0x3935de['query'],_0x49aa5e[_0x789c('0x33')]),_0x187a81);if(_0x3935de['query']['filter']){_0x3d4430[_0x789c('0x3d')]=_[_0x789c('0x3e')](_0x3d4430[_0x789c('0x3d')],{'$or':_[_0x789c('0x31')](_0x187a81,function(_0x4dfe79){if(_0x4dfe79[_0x789c('0x2f')]!==_0x789c('0x3f')){var _0x74a7df={};_0x74a7df[_0x4dfe79[_0x789c('0x2a')]]={'$like':'%'+_0x3935de[_0x789c('0x32')]['filter']+'%'};return _0x74a7df;}})});}_0x3d4430=_[_0x789c('0x3e')]({},_0x3d4430,_0x3935de['options']);var _0x3a6cc4={'where':_0x3d4430[_0x789c('0x3d')]};return db[_0x789c('0x2c')][_0x789c('0x1e')](_0x3a6cc4)[_0x789c('0x27')](function(_0x21a771){_0x172c9f[_0x789c('0x1e')]=_0x21a771;if(_0x3935de['query'][_0x789c('0x40')]){_0x3d4430[_0x789c('0x41')]=[{'all':!![]}];}return db[_0x789c('0x2c')][_0x789c('0x42')](_0x3d4430);})[_0x789c('0x27')](function(_0x3b9083){_0x172c9f[_0x789c('0x43')]=_0x3b9083;return _0x172c9f;})[_0x789c('0x27')](respondWithFilteredResult(_0x38c101,_0x3d4430))[_0x789c('0x44')](handleError(_0x38c101,null));};exports[_0x789c('0x45')]=function(_0x231915,_0x1b29d6){var _0x25864f={'raw':!![],'where':{'id':_0x231915[_0x789c('0x46')]['id']}},_0x2cb75e={};_0x2cb75e['model']=_[_0x789c('0x47')](db['SquareReport'][_0x789c('0x2d')]);_0x2cb75e[_0x789c('0x32')]=_[_0x789c('0x47')](_0x231915['query']);_0x2cb75e[_0x789c('0x33')]=_[_0x789c('0x34')](_0x2cb75e[_0x789c('0x35')],_0x2cb75e['query']);_0x25864f[_0x789c('0x36')]=_['intersection'](_0x2cb75e[_0x789c('0x35')],qs[_0x789c('0x37')](_0x231915[_0x789c('0x32')]['fields']));_0x25864f[_0x789c('0x36')]=_0x25864f[_0x789c('0x36')][_0x789c('0x38')]?_0x25864f[_0x789c('0x36')]:_0x2cb75e[_0x789c('0x35')];if(_0x231915['query'][_0x789c('0x40')]){_0x25864f[_0x789c('0x41')]=[{'all':!![]}];}_0x25864f=_[_0x789c('0x3e')]({},_0x25864f,_0x231915[_0x789c('0x48')]);return db[_0x789c('0x2c')][_0x789c('0x49')](_0x25864f)[_0x789c('0x27')](handleEntityNotFound(_0x1b29d6,null))[_0x789c('0x27')](respondWithResult(_0x1b29d6,null))[_0x789c('0x44')](handleError(_0x1b29d6,null));};exports[_0x789c('0x4a')]=function(_0x36faf7,_0x56eb34){return db[_0x789c('0x2c')]['create'](_0x36faf7['body'],{})[_0x789c('0x27')](respondWithResult(_0x56eb34,0xc9))[_0x789c('0x44')](handleError(_0x56eb34,null));};exports[_0x789c('0x26')]=function(_0x3347a6,_0x10bd45){if(_0x3347a6['body']['id']){delete _0x3347a6[_0x789c('0x4b')]['id'];}return db['SquareReport'][_0x789c('0x49')]({'where':{'id':_0x3347a6[_0x789c('0x46')]['id']}})[_0x789c('0x27')](handleEntityNotFound(_0x10bd45,null))[_0x789c('0x27')](saveUpdates(_0x3347a6[_0x789c('0x4b')],null))['then'](respondWithResult(_0x10bd45,null))[_0x789c('0x44')](handleError(_0x10bd45,null));};exports['destroy']=function(_0x3e6394,_0x226877){return db[_0x789c('0x2c')]['find']({'where':{'id':_0x3e6394['params']['id']}})[_0x789c('0x27')](handleEntityNotFound(_0x226877,null))[_0x789c('0x27')](removeEntity(_0x226877,null))[_0x789c('0x44')](handleError(_0x226877,null));};exports[_0x789c('0x4c')]=function(_0x241eab,_0x388403){return db['SquareReport'][_0x789c('0x4c')]()[_0x789c('0x27')](respondWithResult(_0x388403,null))['catch'](handleError(_0x388403,null));};
\ No newline at end of file
+var _0xfb54=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','save','update','then','end','stack','name','map','SquareReport','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','rows','catch','params','keys','rawAttributes','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x8b95b2,_0x8b2e05){var _0x494fec=function(_0x3965bb){while(--_0x3965bb){_0x8b95b2['push'](_0x8b95b2['shift']());}};_0x494fec(++_0x8b2e05);}(_0xfb54,0x78));var _0x4fb5=function(_0x32a4fc,_0x481874){_0x32a4fc=_0x32a4fc-0x0;var _0x37e31e=_0xfb54[_0x32a4fc];return _0x37e31e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4fb5('0x0'));var zipdir=require(_0x4fb5('0x1'));var jsonpatch=require(_0x4fb5('0x2'));var rp=require(_0x4fb5('0x3'));var moment=require(_0x4fb5('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4fb5('0x5'));var path=require('path');var sox=require(_0x4fb5('0x6'));var csv=require(_0x4fb5('0x7'));var ejs=require(_0x4fb5('0x8'));var fs=require('fs');var fs_extra=require(_0x4fb5('0x9'));var _=require(_0x4fb5('0xa'));var squel=require(_0x4fb5('0xb'));var crypto=require(_0x4fb5('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4fb5('0xd'));var Redis=require(_0x4fb5('0xe'));var authService=require(_0x4fb5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x4fb5('0x10'));var hardwareService=require(_0x4fb5('0x11'));var logger=require(_0x4fb5('0x12'))(_0x4fb5('0x13'));var utils=require(_0x4fb5('0x14'));var config=require(_0x4fb5('0x15'));var licenseUtil=require(_0x4fb5('0x16'));var db=require(_0x4fb5('0x17'))['db'];function respondWithStatusCode(_0x1b8a30,_0x4d6082){_0x4d6082=_0x4d6082||0xcc;return function(_0x4c9953){if(_0x4c9953){return _0x1b8a30[_0x4fb5('0x18')](_0x4d6082);}return _0x1b8a30[_0x4fb5('0x19')](_0x4d6082)['end']();};}function respondWithResult(_0x39495f,_0x11d125){_0x11d125=_0x11d125||0xc8;return function(_0x479784){if(_0x479784){return _0x39495f[_0x4fb5('0x19')](_0x11d125)[_0x4fb5('0x1a')](_0x479784);}};}function respondWithFilteredResult(_0x1bc83b,_0x1250c6){return function(_0x94e9b2){if(_0x94e9b2){var _0x4c5a80=typeof _0x1250c6[_0x4fb5('0x1b')]==='undefined'&&typeof _0x1250c6[_0x4fb5('0x1c')]===_0x4fb5('0x1d');var _0xeaeba9=_0x94e9b2[_0x4fb5('0x1e')];var _0x3a96af=_0x4c5a80?0x0:_0x1250c6['offset'];var _0x23af7b=_0x4c5a80?_0x94e9b2[_0x4fb5('0x1e')]:_0x1250c6[_0x4fb5('0x1b')]+_0x1250c6['limit'];var _0x3c5820;if(_0x23af7b>=_0xeaeba9){_0x23af7b=_0xeaeba9;_0x3c5820=0xc8;}else{_0x3c5820=0xce;}_0x1bc83b[_0x4fb5('0x19')](_0x3c5820);return _0x1bc83b['set'](_0x4fb5('0x1f'),_0x3a96af+'-'+_0x23af7b+'/'+_0xeaeba9)[_0x4fb5('0x1a')](_0x94e9b2);}return null;};}function patchUpdates(_0x8665ea){return function(_0xea1f36){try{jsonpatch['apply'](_0xea1f36,_0x8665ea,!![]);}catch(_0x437cb1){return BPromise['reject'](_0x437cb1);}return _0xea1f36[_0x4fb5('0x20')]();};}function saveUpdates(_0x1936f3,_0x73b19f){return function(_0x25ba56){if(_0x25ba56){return _0x25ba56[_0x4fb5('0x21')](_0x1936f3)[_0x4fb5('0x22')](function(_0x417da7){return _0x417da7;});}return null;};}function removeEntity(_0x13d1bd,_0x200cb0){return function(_0x4ab861){if(_0x4ab861){return _0x4ab861['destroy']()[_0x4fb5('0x22')](function(){_0x13d1bd[_0x4fb5('0x19')](0xcc)[_0x4fb5('0x23')]();});}};}function handleEntityNotFound(_0x31e474,_0xfcc84d){return function(_0x3a21f9){if(!_0x3a21f9){_0x31e474['sendStatus'](0x194);}return _0x3a21f9;};}function handleError(_0xeb68e0,_0x550ae2){_0x550ae2=_0x550ae2||0x1f4;return function(_0x5d3921){logger['error'](_0x5d3921[_0x4fb5('0x24')]);if(_0x5d3921['name']){delete _0x5d3921[_0x4fb5('0x25')];}_0xeb68e0['status'](_0x550ae2)['send'](_0x5d3921);};}exports['index']=function(_0x5c569c,_0x81725a){var _0x2e8cca={},_0x4f1e41={},_0x34eaf3={'count':0x0,'rows':[]};var _0x5a1d65=_[_0x4fb5('0x26')](db[_0x4fb5('0x27')]['rawAttributes'],function(_0x36af1d){return{'name':_0x36af1d[_0x4fb5('0x28')],'type':_0x36af1d[_0x4fb5('0x29')][_0x4fb5('0x2a')]};});_0x4f1e41['model']=_[_0x4fb5('0x26')](_0x5a1d65,_0x4fb5('0x25'));_0x4f1e41[_0x4fb5('0x2b')]=_['keys'](_0x5c569c[_0x4fb5('0x2b')]);_0x4f1e41[_0x4fb5('0x2c')]=_[_0x4fb5('0x2d')](_0x4f1e41['model'],_0x4f1e41[_0x4fb5('0x2b')]);_0x2e8cca['attributes']=_['intersection'](_0x4f1e41[_0x4fb5('0x2e')],qs[_0x4fb5('0x2f')](_0x5c569c[_0x4fb5('0x2b')][_0x4fb5('0x2f')]));_0x2e8cca[_0x4fb5('0x30')]=_0x2e8cca[_0x4fb5('0x30')][_0x4fb5('0x31')]?_0x2e8cca['attributes']:_0x4f1e41[_0x4fb5('0x2e')];if(!_0x5c569c[_0x4fb5('0x2b')]['hasOwnProperty']('nolimit')){_0x2e8cca[_0x4fb5('0x1c')]=qs[_0x4fb5('0x1c')](_0x5c569c[_0x4fb5('0x2b')][_0x4fb5('0x1c')]);_0x2e8cca['offset']=qs['offset'](_0x5c569c['query'][_0x4fb5('0x1b')]);}_0x2e8cca[_0x4fb5('0x32')]=qs[_0x4fb5('0x33')](_0x5c569c[_0x4fb5('0x2b')][_0x4fb5('0x33')]);_0x2e8cca[_0x4fb5('0x34')]=qs[_0x4fb5('0x2c')](_[_0x4fb5('0x35')](_0x5c569c['query'],_0x4f1e41['filters']),_0x5a1d65);if(_0x5c569c['query']['filter']){_0x2e8cca[_0x4fb5('0x34')]=_['merge'](_0x2e8cca['where'],{'$or':_['map'](_0x5a1d65,function(_0x4ba481){if(_0x4ba481[_0x4fb5('0x29')]!==_0x4fb5('0x36')){var _0x3f2fd7={};_0x3f2fd7[_0x4ba481['name']]={'$like':'%'+_0x5c569c[_0x4fb5('0x2b')]['filter']+'%'};return _0x3f2fd7;}})});}_0x2e8cca=_[_0x4fb5('0x37')]({},_0x2e8cca,_0x5c569c[_0x4fb5('0x38')]);var _0x509462={'where':_0x2e8cca[_0x4fb5('0x34')]};return db[_0x4fb5('0x27')]['count'](_0x509462)['then'](function(_0x273fc1){_0x34eaf3[_0x4fb5('0x1e')]=_0x273fc1;if(_0x5c569c[_0x4fb5('0x2b')][_0x4fb5('0x39')]){_0x2e8cca[_0x4fb5('0x3a')]=[{'all':!![]}];}return db['SquareReport']['findAll'](_0x2e8cca);})['then'](function(_0x10afbc){_0x34eaf3[_0x4fb5('0x3b')]=_0x10afbc;return _0x34eaf3;})[_0x4fb5('0x22')](respondWithFilteredResult(_0x81725a,_0x2e8cca))[_0x4fb5('0x3c')](handleError(_0x81725a,null));};exports['show']=function(_0x53d705,_0x10e086){var _0xa38daa={'raw':!![],'where':{'id':_0x53d705[_0x4fb5('0x3d')]['id']}},_0x533116={};_0x533116[_0x4fb5('0x2e')]=_[_0x4fb5('0x3e')](db['SquareReport'][_0x4fb5('0x3f')]);_0x533116[_0x4fb5('0x2b')]=_['keys'](_0x53d705[_0x4fb5('0x2b')]);_0x533116[_0x4fb5('0x2c')]=_[_0x4fb5('0x2d')](_0x533116['model'],_0x533116[_0x4fb5('0x2b')]);_0xa38daa[_0x4fb5('0x30')]=_[_0x4fb5('0x2d')](_0x533116[_0x4fb5('0x2e')],qs[_0x4fb5('0x2f')](_0x53d705[_0x4fb5('0x2b')][_0x4fb5('0x2f')]));_0xa38daa[_0x4fb5('0x30')]=_0xa38daa[_0x4fb5('0x30')][_0x4fb5('0x31')]?_0xa38daa[_0x4fb5('0x30')]:_0x533116[_0x4fb5('0x2e')];if(_0x53d705[_0x4fb5('0x2b')]['includeAll']){_0xa38daa[_0x4fb5('0x3a')]=[{'all':!![]}];}_0xa38daa=_[_0x4fb5('0x37')]({},_0xa38daa,_0x53d705[_0x4fb5('0x38')]);return db[_0x4fb5('0x27')][_0x4fb5('0x40')](_0xa38daa)[_0x4fb5('0x22')](handleEntityNotFound(_0x10e086,null))[_0x4fb5('0x22')](respondWithResult(_0x10e086,null))[_0x4fb5('0x3c')](handleError(_0x10e086,null));};exports[_0x4fb5('0x41')]=function(_0x23c6cf,_0x34c971){return db[_0x4fb5('0x27')][_0x4fb5('0x41')](_0x23c6cf[_0x4fb5('0x42')],{})[_0x4fb5('0x22')](respondWithResult(_0x34c971,0xc9))[_0x4fb5('0x3c')](handleError(_0x34c971,null));};exports[_0x4fb5('0x21')]=function(_0x4885b6,_0x1a585b){if(_0x4885b6[_0x4fb5('0x42')]['id']){delete _0x4885b6[_0x4fb5('0x42')]['id'];}return db[_0x4fb5('0x27')][_0x4fb5('0x40')]({'where':{'id':_0x4885b6[_0x4fb5('0x3d')]['id']}})[_0x4fb5('0x22')](handleEntityNotFound(_0x1a585b,null))[_0x4fb5('0x22')](saveUpdates(_0x4885b6[_0x4fb5('0x42')],null))[_0x4fb5('0x22')](respondWithResult(_0x1a585b,null))[_0x4fb5('0x3c')](handleError(_0x1a585b,null));};exports[_0x4fb5('0x43')]=function(_0x541b5b,_0x383e6c){return db[_0x4fb5('0x27')][_0x4fb5('0x40')]({'where':{'id':_0x541b5b['params']['id']}})['then'](handleEntityNotFound(_0x383e6c,null))['then'](removeEntity(_0x383e6c,null))['catch'](handleError(_0x383e6c,null));};exports[_0x4fb5('0x44')]=function(_0x58447f,_0x38c9c8){return db[_0x4fb5('0x27')]['describe']()['then'](respondWithResult(_0x38c9c8,null))['catch'](handleError(_0x38c9c8,null));};
\ No newline at end of file
index d6aa17b..c9c3404 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb34=['report_square','project_name','leaveAt','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./squareReport.attributes','define','SquareReport'];(function(_0xb879fa,_0x264b04){var _0x1548b8=function(_0x504845){while(--_0x504845){_0xb879fa['push'](_0xb879fa['shift']());}};_0x1548b8(++_0x264b04);}(_0xcb34,0x9d));var _0x4cb3=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0xcb34[_0x53abe5];return _0xc1c37e;};'use strict';var _=require(_0x4cb3('0x0'));var util=require(_0x4cb3('0x1'));var logger=require(_0x4cb3('0x2'))('api');var moment=require(_0x4cb3('0x3'));var BPromise=require(_0x4cb3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4cb3('0x5'));var rimraf=require(_0x4cb3('0x6'));var config=require(_0x4cb3('0x7'));var attributes=require(_0x4cb3('0x8'));module['exports']=function(_0x2cf8bd,_0x8f65d8){return _0x2cf8bd[_0x4cb3('0x9')](_0x4cb3('0xa'),attributes,{'tableName':_0x4cb3('0xb'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':['uniqueid',_0x4cb3('0xc')]},{'name':_0x4cb3('0xd'),'fields':[_0x4cb3('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x406e=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','report_square','uid_pname','uniqueid','project_name','leaveAt'];(function(_0x319e3a,_0x3101b1){var _0x1b0a60=function(_0x13c20f){while(--_0x13c20f){_0x319e3a['push'](_0x319e3a['shift']());}};_0x1b0a60(++_0x3101b1);}(_0x406e,0x1ba));var _0xe406=function(_0x344860,_0x3e5932){_0x344860=_0x344860-0x0;var _0xfb2fe9=_0x406e[_0x344860];return _0xfb2fe9;};'use strict';var _=require(_0xe406('0x0'));var util=require(_0xe406('0x1'));var logger=require(_0xe406('0x2'))(_0xe406('0x3'));var moment=require('moment');var BPromise=require(_0xe406('0x4'));var rp=require(_0xe406('0x5'));var fs=require('fs');var path=require(_0xe406('0x6'));var rimraf=require(_0xe406('0x7'));var config=require(_0xe406('0x8'));var attributes=require(_0xe406('0x9'));module[_0xe406('0xa')]=function(_0x1708da,_0x53e28e){return _0x1708da[_0xe406('0xb')]('SquareReport',attributes,{'tableName':_0xe406('0xc'),'paranoid':![],'indexes':[{'name':_0xe406('0xd'),'fields':[_0xe406('0xe'),_0xe406('0xf')]},{'name':_0xe406('0x10'),'fields':[_0xe406('0x10')]}],'timestamps':!![]});};
\ No newline at end of file
index 56907b8..e9d964a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc9df=['message','info','request\x20sent','result','catch','SquareReport','create','body','options','CreateSquareReport','UpdateSquareReport','update','where','attributes','limit','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareReport,\x20%s,\x20%s'];(function(_0x5dcd95,_0x1e72d4){var _0x271b17=function(_0x57b81b){while(--_0x57b81b){_0x5dcd95['push'](_0x5dcd95['shift']());}};_0x271b17(++_0x1e72d4);}(_0xc9df,0x159));var _0xfc9d=function(_0x56d124,_0xe2886f){_0x56d124=_0x56d124-0x0;var _0x5aff5f=_0xc9df[_0x56d124];return _0x5aff5f;};'use strict';var _=require('lodash');var util=require(_0xfc9d('0x0'));var moment=require('moment');var BPromise=require(_0xfc9d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfc9d('0x2'));var db=require(_0xfc9d('0x3'))['db'];var utils=require(_0xfc9d('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xfc9d('0x5'));var jayson=require(_0xfc9d('0x6'));var client=jayson['client'][_0xfc9d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x38affc,_0x2ceba9,_0x488e57){return new BPromise(function(_0x4b1446,_0x39ba81){return client[_0xfc9d('0x8')](_0x38affc,_0x488e57)[_0xfc9d('0x9')](function(_0x4efc57){logger['info']('SquareReport,\x20%s,\x20%s',_0x2ceba9,'request\x20sent');logger[_0xfc9d('0xa')](_0xfc9d('0xb'),_0x2ceba9,'request\x20sent',JSON[_0xfc9d('0xc')](_0x4efc57));if(_0x4efc57[_0xfc9d('0xd')]){if(_0x4efc57[_0xfc9d('0xd')]['code']===0x1f4){logger[_0xfc9d('0xd')](_0xfc9d('0xe'),_0x2ceba9,_0x4efc57[_0xfc9d('0xd')][_0xfc9d('0xf')]);return _0x39ba81(_0x4efc57[_0xfc9d('0xd')]['message']);}logger[_0xfc9d('0xd')](_0xfc9d('0xe'),_0x2ceba9,_0x4efc57[_0xfc9d('0xd')][_0xfc9d('0xf')]);return _0x4b1446(_0x4efc57['error'][_0xfc9d('0xf')]);}else{logger[_0xfc9d('0x10')](_0xfc9d('0xe'),_0x2ceba9,_0xfc9d('0x11'));_0x4b1446(_0x4efc57[_0xfc9d('0x12')]['message']);}})[_0xfc9d('0x13')](function(_0x3f5bfb){logger[_0xfc9d('0xd')](_0xfc9d('0xe'),_0x2ceba9,_0x3f5bfb);_0x39ba81(_0x3f5bfb);});});}exports['CreateSquareReport']=function(_0x232513){var _0x3b821c=this;return new Promise(function(_0x3a2636,_0x466ae7){return db[_0xfc9d('0x14')][_0xfc9d('0x15')](_0x232513[_0xfc9d('0x16')],{'raw':_0x232513[_0xfc9d('0x17')]?_0x232513[_0xfc9d('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5b6d37){logger[_0xfc9d('0x10')](_0xfc9d('0x18'),_0x232513);logger[_0xfc9d('0xa')](_0xfc9d('0x18'),_0x232513,JSON[_0xfc9d('0xc')](_0x5b6d37));_0x3a2636(_0x5b6d37);})[_0xfc9d('0x13')](function(_0x398b26){logger[_0xfc9d('0xd')](_0xfc9d('0x18'),_0x398b26['message'],_0x232513);_0x466ae7(_0x3b821c[_0xfc9d('0xd')](0x1f4,_0x398b26['message']));});});};exports[_0xfc9d('0x19')]=function(_0x599c1d){var _0x500315=this;return new Promise(function(_0x31d597,_0x157e30){return db[_0xfc9d('0x14')][_0xfc9d('0x1a')](_0x599c1d[_0xfc9d('0x16')],{'raw':_0x599c1d[_0xfc9d('0x17')]?_0x599c1d[_0xfc9d('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x599c1d[_0xfc9d('0x17')]?_0x599c1d[_0xfc9d('0x17')][_0xfc9d('0x1b')]||null:null,'attributes':_0x599c1d[_0xfc9d('0x17')]?_0x599c1d[_0xfc9d('0x17')][_0xfc9d('0x1c')]||null:null,'limit':_0x599c1d[_0xfc9d('0x17')]?_0x599c1d[_0xfc9d('0x17')][_0xfc9d('0x1d')]||null:null})[_0xfc9d('0x9')](function(_0x52d8ca){logger[_0xfc9d('0x10')]('UpdateSquareReport',_0x599c1d);logger['debug'](_0xfc9d('0x19'),_0x599c1d,JSON['stringify'](_0x52d8ca));_0x31d597(_0x52d8ca);})[_0xfc9d('0x13')](function(_0x59d88f){logger[_0xfc9d('0xd')](_0xfc9d('0x19'),_0x59d88f['message'],_0x599c1d);_0x157e30(_0x500315[_0xfc9d('0xd')](0x1f4,_0x59d88f[_0xfc9d('0xf')]));});});};
\ No newline at end of file
+var _0x5459=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateSquareReport','create','body','raw','then','stringify','UpdateSquareReport','SquareReport','update','options','where','limit','lodash'];(function(_0x424bd3,_0x8760d8){var _0x1fdade=function(_0x510862){while(--_0x510862){_0x424bd3['push'](_0x424bd3['shift']());}};_0x1fdade(++_0x8760d8);}(_0x5459,0x18b));var _0x9545=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x5459[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x9545('0x0'));var util=require(_0x9545('0x1'));var moment=require(_0x9545('0x2'));var BPromise=require(_0x9545('0x3'));var rs=require(_0x9545('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x9545('0x5'));var logger=require(_0x9545('0x6'))('rpc');var config=require(_0x9545('0x7'));var jayson=require(_0x9545('0x8'));var client=jayson[_0x9545('0x9')][_0x9545('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x434056,_0x5e1ec3,_0x3bccf2){return new BPromise(function(_0x2a27c7,_0x341d95){return client[_0x9545('0xb')](_0x434056,_0x3bccf2)['then'](function(_0x1ec78f){logger[_0x9545('0xc')](_0x9545('0xd'),_0x5e1ec3,'request\x20sent');logger[_0x9545('0xe')](_0x9545('0xf'),_0x5e1ec3,_0x9545('0x10'),JSON['stringify'](_0x1ec78f));if(_0x1ec78f[_0x9545('0x11')]){if(_0x1ec78f['error']['code']===0x1f4){logger[_0x9545('0x11')](_0x9545('0xd'),_0x5e1ec3,_0x1ec78f[_0x9545('0x11')][_0x9545('0x12')]);return _0x341d95(_0x1ec78f[_0x9545('0x11')][_0x9545('0x12')]);}logger[_0x9545('0x11')](_0x9545('0xd'),_0x5e1ec3,_0x1ec78f[_0x9545('0x11')][_0x9545('0x12')]);return _0x2a27c7(_0x1ec78f['error'][_0x9545('0x12')]);}else{logger[_0x9545('0xc')](_0x9545('0xd'),_0x5e1ec3,_0x9545('0x10'));_0x2a27c7(_0x1ec78f[_0x9545('0x13')][_0x9545('0x12')]);}})[_0x9545('0x14')](function(_0x1dea69){logger[_0x9545('0x11')](_0x9545('0xd'),_0x5e1ec3,_0x1dea69);_0x341d95(_0x1dea69);});});}exports[_0x9545('0x15')]=function(_0x476aff){var _0x334e81=this;return new Promise(function(_0xac3d49,_0x5534cb){return db['SquareReport'][_0x9545('0x16')](_0x476aff[_0x9545('0x17')],{'raw':_0x476aff['options']?_0x476aff['options'][_0x9545('0x18')]===undefined?!![]:![]:!![]})[_0x9545('0x19')](function(_0x44f6a1){logger[_0x9545('0xc')](_0x9545('0x15'),_0x476aff);logger[_0x9545('0xe')](_0x9545('0x15'),_0x476aff,JSON[_0x9545('0x1a')](_0x44f6a1));_0xac3d49(_0x44f6a1);})[_0x9545('0x14')](function(_0x37a5e8){logger[_0x9545('0x11')]('CreateSquareReport',_0x37a5e8['message'],_0x476aff);_0x5534cb(_0x334e81['error'](0x1f4,_0x37a5e8['message']));});});};exports[_0x9545('0x1b')]=function(_0x3482b0){var _0xe0e38b=this;return new Promise(function(_0x832e9f,_0xf0df1e){return db[_0x9545('0x1c')][_0x9545('0x1d')](_0x3482b0[_0x9545('0x17')],{'raw':_0x3482b0[_0x9545('0x1e')]?_0x3482b0[_0x9545('0x1e')][_0x9545('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3482b0[_0x9545('0x1e')]?_0x3482b0[_0x9545('0x1e')][_0x9545('0x1f')]||null:null,'attributes':_0x3482b0[_0x9545('0x1e')]?_0x3482b0[_0x9545('0x1e')]['attributes']||null:null,'limit':_0x3482b0['options']?_0x3482b0['options'][_0x9545('0x20')]||null:null})['then'](function(_0x55afd7){logger[_0x9545('0xc')](_0x9545('0x1b'),_0x3482b0);logger[_0x9545('0xe')](_0x9545('0x1b'),_0x3482b0,JSON['stringify'](_0x55afd7));_0x832e9f(_0x55afd7);})[_0x9545('0x14')](function(_0x24ddae){logger[_0x9545('0x11')](_0x9545('0x1b'),_0x24ddae[_0x9545('0x12')],_0x3482b0);_0xf0df1e(_0xe0e38b['error'](0x1f4,_0x24ddae[_0x9545('0x12')]));});});};
\ No newline at end of file
index 8150b95..1e72006 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb12=['exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','show','create','put','delete'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xdb12,0x100));var _0x2db1=function(_0x7abd7,_0x1ca3f9){_0x7abd7=_0x7abd7-0x0;var _0x3a2577=_0xdb12[_0x7abd7];return _0x3a2577;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x2db1('0x0'));var express=require(_0x2db1('0x1'));var router=express[_0x2db1('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2db1('0x3'));var interaction=require(_0x2db1('0x4'));var config=require(_0x2db1('0x5'));var controller=require(_0x2db1('0x6'));router[_0x2db1('0x7')]('/',auth[_0x2db1('0x8')](),controller[_0x2db1('0x9')]);router[_0x2db1('0x7')](_0x2db1('0xa'),auth[_0x2db1('0x8')](),controller['describe']);router[_0x2db1('0x7')](_0x2db1('0xb'),auth[_0x2db1('0x8')](),controller[_0x2db1('0xc')]);router['post']('/',auth[_0x2db1('0x8')](),controller[_0x2db1('0xd')]);router[_0x2db1('0xe')]('/:id',auth[_0x2db1('0x8')](),controller['update']);router[_0x2db1('0xf')](_0x2db1('0xb'),auth[_0x2db1('0x8')](),controller['destroy']);module[_0x2db1('0x10')]=router;
\ No newline at end of file
+var _0xdc5a=['show','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','describe','/:id'];(function(_0x28f443,_0x12e122){var _0x372d3c=function(_0x5d070a){while(--_0x5d070a){_0x28f443['push'](_0x28f443['shift']());}};_0x372d3c(++_0x12e122);}(_0xdc5a,0x8c));var _0xadc5=function(_0x2c684e,_0x5d9c74){_0x2c684e=_0x2c684e-0x0;var _0xb40e3c=_0xdc5a[_0x2c684e];return _0xb40e3c;};'use strict';var multer=require(_0xadc5('0x0'));var util=require('util');var path=require(_0xadc5('0x1'));var timeout=require(_0xadc5('0x2'));var express=require(_0xadc5('0x3'));var router=express[_0xadc5('0x4')]();var fs_extra=require(_0xadc5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xadc5('0x6'));var config=require(_0xadc5('0x7'));var controller=require(_0xadc5('0x8'));router[_0xadc5('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xadc5('0x9')]('/describe',auth[_0xadc5('0xa')](),controller[_0xadc5('0xb')]);router[_0xadc5('0x9')](_0xadc5('0xc'),auth['isAuthenticated'](),controller[_0xadc5('0xd')]);router['post']('/',auth[_0xadc5('0xa')](),controller['create']);router['put']('/:id',auth[_0xadc5('0xa')](),controller[_0xadc5('0xe')]);router[_0xadc5('0xf')]('/:id',auth[_0xadc5('0xa')](),controller[_0xadc5('0x10')]);module['exports']=router;
\ No newline at end of file
index c49b788..6444006 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6964=['exports','STRING','sequelize'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x6964,0x1ca));var _0x4696=function(_0x2bf888,_0x374f0b){_0x2bf888=_0x2bf888-0x0;var _0x3038d6=_0x6964[_0x2bf888];return _0x3038d6;};'use strict';var Sequelize=require(_0x4696('0x0'));module[_0x4696('0x1')]={'uniqueid':{'type':Sequelize[_0x4696('0x2')]},'node':{'type':Sequelize[_0x4696('0x2')]},'application':{'type':Sequelize[_0x4696('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x4696('0x2')]},'callerid':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x9704=['STRING','sequelize','exports'];(function(_0x41b51f,_0x5242e){var _0x32d5d4=function(_0x46ca06){while(--_0x46ca06){_0x41b51f['push'](_0x41b51f['shift']());}};_0x32d5d4(++_0x5242e);}(_0x9704,0x6d));var _0x4970=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9704[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x4970('0x0'));module[_0x4970('0x1')]={'uniqueid':{'type':Sequelize[_0x4970('0x2')]},'node':{'type':Sequelize['STRING']},'application':{'type':Sequelize[_0x4970('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x4970('0x2')]},'callerid':{'type':Sequelize[_0x4970('0x2')]}};
\ No newline at end of file
index dc53176..25beaad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff2a=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','apply','reject','save','then','error','stack','send','index','map','SquareDetailsReport','rawAttributes','fieldName','name','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','order','sort','where','merge','type','filter','includeAll','include','rows','catch','show','params','options','find','create','body','update','describe'];(function(_0xe1b2a8,_0x38f786){var _0x554804=function(_0x412030){while(--_0x412030){_0xe1b2a8['push'](_0xe1b2a8['shift']());}};_0x554804(++_0x38f786);}(_0xff2a,0x8e));var _0xaff2=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0xff2a[_0x79b649];return _0x1af9b1;};'use strict';var emlformat=require(_0xaff2('0x0'));var rimraf=require(_0xaff2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaff2('0x2'));var rp=require(_0xaff2('0x3'));var moment=require(_0xaff2('0x4'));var BPromise=require(_0xaff2('0x5'));var Mustache=require(_0xaff2('0x6'));var util=require(_0xaff2('0x7'));var path=require(_0xaff2('0x8'));var sox=require(_0xaff2('0x9'));var csv=require('to-csv');var ejs=require(_0xaff2('0xa'));var fs=require('fs');var fs_extra=require(_0xaff2('0xb'));var _=require(_0xaff2('0xc'));var squel=require(_0xaff2('0xd'));var crypto=require('crypto');var jsforce=require(_0xaff2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaff2('0xf'));var querystring=require(_0xaff2('0x10'));var Papa=require(_0xaff2('0x11'));var Redis=require(_0xaff2('0x12'));var authService=require(_0xaff2('0x13'));var qs=require(_0xaff2('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xaff2('0x15'))('api');var utils=require(_0xaff2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xaff2('0x17'));var db=require(_0xaff2('0x18'))['db'];function respondWithStatusCode(_0x40a4b5,_0x5b893c){_0x5b893c=_0x5b893c||0xcc;return function(_0x5b1376){if(_0x5b1376){return _0x40a4b5[_0xaff2('0x19')](_0x5b893c);}return _0x40a4b5[_0xaff2('0x1a')](_0x5b893c)[_0xaff2('0x1b')]();};}function respondWithResult(_0x1a9bd5,_0x30e22f){_0x30e22f=_0x30e22f||0xc8;return function(_0x41a1f7){if(_0x41a1f7){return _0x1a9bd5[_0xaff2('0x1a')](_0x30e22f)[_0xaff2('0x1c')](_0x41a1f7);}};}function respondWithFilteredResult(_0x2c6c47,_0x36a581){return function(_0x3a9579){if(_0x3a9579){var _0x2e9fca=typeof _0x36a581[_0xaff2('0x1d')]==='undefined'&&typeof _0x36a581['limit']==='undefined';var _0x5b73fb=_0x3a9579[_0xaff2('0x1e')];var _0x19cd51=_0x2e9fca?0x0:_0x36a581[_0xaff2('0x1d')];var _0x5b56f4=_0x2e9fca?_0x3a9579['count']:_0x36a581['offset']+_0x36a581[_0xaff2('0x1f')];var _0xe3be72;if(_0x5b56f4>=_0x5b73fb){_0x5b56f4=_0x5b73fb;_0xe3be72=0xc8;}else{_0xe3be72=0xce;}_0x2c6c47['status'](_0xe3be72);return _0x2c6c47['set']('Content-Range',_0x19cd51+'-'+_0x5b56f4+'/'+_0x5b73fb)['json'](_0x3a9579);}return null;};}function patchUpdates(_0x33296b){return function(_0x559c49){try{jsonpatch[_0xaff2('0x20')](_0x559c49,_0x33296b,!![]);}catch(_0x556b57){return BPromise[_0xaff2('0x21')](_0x556b57);}return _0x559c49[_0xaff2('0x22')]();};}function saveUpdates(_0x4aebd9,_0x1c0df7){return function(_0x3bd522){if(_0x3bd522){return _0x3bd522['update'](_0x4aebd9)[_0xaff2('0x23')](function(_0x342537){return _0x342537;});}return null;};}function removeEntity(_0x54e96c,_0x5899cc){return function(_0x1f3021){if(_0x1f3021){return _0x1f3021['destroy']()[_0xaff2('0x23')](function(){_0x54e96c[_0xaff2('0x1a')](0xcc)[_0xaff2('0x1b')]();});}};}function handleEntityNotFound(_0x59a997,_0x596d9d){return function(_0x27310b){if(!_0x27310b){_0x59a997[_0xaff2('0x19')](0x194);}return _0x27310b;};}function handleError(_0x27cfa6,_0x5b2576){_0x5b2576=_0x5b2576||0x1f4;return function(_0x134c3b){logger[_0xaff2('0x24')](_0x134c3b[_0xaff2('0x25')]);if(_0x134c3b['name']){delete _0x134c3b['name'];}_0x27cfa6[_0xaff2('0x1a')](_0x5b2576)[_0xaff2('0x26')](_0x134c3b);};}exports[_0xaff2('0x27')]=function(_0xfcf072,_0x52d656){var _0x5659fc={},_0x26721a={},_0x1ae760={'count':0x0,'rows':[]};var _0x32e91b=_[_0xaff2('0x28')](db[_0xaff2('0x29')][_0xaff2('0x2a')],function(_0x156589){return{'name':_0x156589[_0xaff2('0x2b')],'type':_0x156589['type']['key']};});_0x26721a['model']=_[_0xaff2('0x28')](_0x32e91b,_0xaff2('0x2c'));_0x26721a[_0xaff2('0x2d')]=_[_0xaff2('0x2e')](_0xfcf072['query']);_0x26721a[_0xaff2('0x2f')]=_['intersection'](_0x26721a[_0xaff2('0x30')],_0x26721a[_0xaff2('0x2d')]);_0x5659fc[_0xaff2('0x31')]=_[_0xaff2('0x32')](_0x26721a[_0xaff2('0x30')],qs[_0xaff2('0x33')](_0xfcf072['query']['fields']));_0x5659fc['attributes']=_0x5659fc[_0xaff2('0x31')]['length']?_0x5659fc['attributes']:_0x26721a[_0xaff2('0x30')];if(!_0xfcf072[_0xaff2('0x2d')][_0xaff2('0x34')]('nolimit')){_0x5659fc[_0xaff2('0x1f')]=qs[_0xaff2('0x1f')](_0xfcf072[_0xaff2('0x2d')][_0xaff2('0x1f')]);_0x5659fc['offset']=qs[_0xaff2('0x1d')](_0xfcf072['query'][_0xaff2('0x1d')]);}_0x5659fc[_0xaff2('0x35')]=qs[_0xaff2('0x36')](_0xfcf072[_0xaff2('0x2d')][_0xaff2('0x36')]);_0x5659fc[_0xaff2('0x37')]=qs[_0xaff2('0x2f')](_['pick'](_0xfcf072[_0xaff2('0x2d')],_0x26721a[_0xaff2('0x2f')]),_0x32e91b);if(_0xfcf072[_0xaff2('0x2d')]['filter']){_0x5659fc[_0xaff2('0x37')]=_[_0xaff2('0x38')](_0x5659fc[_0xaff2('0x37')],{'$or':_['map'](_0x32e91b,function(_0x799b1d){if(_0x799b1d[_0xaff2('0x39')]!=='VIRTUAL'){var _0x581a97={};_0x581a97[_0x799b1d[_0xaff2('0x2c')]]={'$like':'%'+_0xfcf072[_0xaff2('0x2d')][_0xaff2('0x3a')]+'%'};return _0x581a97;}})});}_0x5659fc=_[_0xaff2('0x38')]({},_0x5659fc,_0xfcf072['options']);var _0x48bcf9={'where':_0x5659fc[_0xaff2('0x37')]};return db['SquareDetailsReport'][_0xaff2('0x1e')](_0x48bcf9)[_0xaff2('0x23')](function(_0x23b41){_0x1ae760[_0xaff2('0x1e')]=_0x23b41;if(_0xfcf072['query'][_0xaff2('0x3b')]){_0x5659fc[_0xaff2('0x3c')]=[{'all':!![]}];}return db[_0xaff2('0x29')]['findAll'](_0x5659fc);})[_0xaff2('0x23')](function(_0x3b36bf){_0x1ae760[_0xaff2('0x3d')]=_0x3b36bf;return _0x1ae760;})[_0xaff2('0x23')](respondWithFilteredResult(_0x52d656,_0x5659fc))[_0xaff2('0x3e')](handleError(_0x52d656,null));};exports[_0xaff2('0x3f')]=function(_0x58278d,_0x24a908){var _0x4ba2ea={'raw':!![],'where':{'id':_0x58278d[_0xaff2('0x40')]['id']}},_0x5e6dc5={};_0x5e6dc5[_0xaff2('0x30')]=_[_0xaff2('0x2e')](db[_0xaff2('0x29')]['rawAttributes']);_0x5e6dc5['query']=_['keys'](_0x58278d[_0xaff2('0x2d')]);_0x5e6dc5[_0xaff2('0x2f')]=_[_0xaff2('0x32')](_0x5e6dc5[_0xaff2('0x30')],_0x5e6dc5['query']);_0x4ba2ea['attributes']=_[_0xaff2('0x32')](_0x5e6dc5[_0xaff2('0x30')],qs[_0xaff2('0x33')](_0x58278d['query'][_0xaff2('0x33')]));_0x4ba2ea['attributes']=_0x4ba2ea[_0xaff2('0x31')]['length']?_0x4ba2ea[_0xaff2('0x31')]:_0x5e6dc5['model'];if(_0x58278d[_0xaff2('0x2d')][_0xaff2('0x3b')]){_0x4ba2ea[_0xaff2('0x3c')]=[{'all':!![]}];}_0x4ba2ea=_[_0xaff2('0x38')]({},_0x4ba2ea,_0x58278d[_0xaff2('0x41')]);return db['SquareDetailsReport'][_0xaff2('0x42')](_0x4ba2ea)[_0xaff2('0x23')](handleEntityNotFound(_0x24a908,null))[_0xaff2('0x23')](respondWithResult(_0x24a908,null))[_0xaff2('0x3e')](handleError(_0x24a908,null));};exports['create']=function(_0x5d713f,_0x3c5586){return db['SquareDetailsReport'][_0xaff2('0x43')](_0x5d713f[_0xaff2('0x44')],{})[_0xaff2('0x23')](respondWithResult(_0x3c5586,0xc9))[_0xaff2('0x3e')](handleError(_0x3c5586,null));};exports[_0xaff2('0x45')]=function(_0xe8e605,_0x2a739e){if(_0xe8e605[_0xaff2('0x44')]['id']){delete _0xe8e605[_0xaff2('0x44')]['id'];}return db[_0xaff2('0x29')][_0xaff2('0x42')]({'where':{'id':_0xe8e605['params']['id']}})[_0xaff2('0x23')](handleEntityNotFound(_0x2a739e,null))[_0xaff2('0x23')](saveUpdates(_0xe8e605[_0xaff2('0x44')],null))['then'](respondWithResult(_0x2a739e,null))[_0xaff2('0x3e')](handleError(_0x2a739e,null));};exports['destroy']=function(_0x1d106b,_0x4a9fff){return db['SquareDetailsReport'][_0xaff2('0x42')]({'where':{'id':_0x1d106b[_0xaff2('0x40')]['id']}})[_0xaff2('0x23')](handleEntityNotFound(_0x4a9fff,null))['then'](removeEntity(_0x4a9fff,null))['catch'](handleError(_0x4a9fff,null));};exports[_0xaff2('0x46')]=function(_0x26595c,_0x35a8b0){return db[_0xaff2('0x29')][_0xaff2('0x46')]()[_0xaff2('0x23')](respondWithResult(_0x35a8b0,null))[_0xaff2('0x3e')](handleError(_0x35a8b0,null));};
\ No newline at end of file
+var _0xd666=['keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','options','SquareDetailsReport','includeAll','include','findAll','rows','catch','show','params','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','send','index','map','rawAttributes','fieldName','type','model','name','query'];(function(_0xf168d3,_0x43dcfc){var _0x17fb54=function(_0x3d9674){while(--_0x3d9674){_0xf168d3['push'](_0xf168d3['shift']());}};_0x17fb54(++_0x43dcfc);}(_0xd666,0xae));var _0x6d66=function(_0x8eb9d,_0x320ee6){_0x8eb9d=_0x8eb9d-0x0;var _0x28c28=_0xd666[_0x8eb9d];return _0x28c28;};'use strict';var emlformat=require(_0x6d66('0x0'));var rimraf=require(_0x6d66('0x1'));var zipdir=require(_0x6d66('0x2'));var jsonpatch=require(_0x6d66('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6d66('0x4'));var Mustache=require('mustache');var util=require(_0x6d66('0x5'));var path=require(_0x6d66('0x6'));var sox=require('sox');var csv=require(_0x6d66('0x7'));var ejs=require(_0x6d66('0x8'));var fs=require('fs');var fs_extra=require(_0x6d66('0x9'));var _=require(_0x6d66('0xa'));var squel=require(_0x6d66('0xb'));var crypto=require(_0x6d66('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6d66('0xd'));var toCsv=require(_0x6d66('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6d66('0xe'));var qs=require(_0x6d66('0xf'));var as=require(_0x6d66('0x10'));var hardwareService=require(_0x6d66('0x11'));var logger=require('../../config/logger')(_0x6d66('0x12'));var utils=require(_0x6d66('0x13'));var config=require(_0x6d66('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6d66('0x15'))['db'];function respondWithStatusCode(_0x2a804e,_0x31f134){_0x31f134=_0x31f134||0xcc;return function(_0x386f1c){if(_0x386f1c){return _0x2a804e[_0x6d66('0x16')](_0x31f134);}return _0x2a804e[_0x6d66('0x17')](_0x31f134)[_0x6d66('0x18')]();};}function respondWithResult(_0x5ceffe,_0x271869){_0x271869=_0x271869||0xc8;return function(_0xfa4088){if(_0xfa4088){return _0x5ceffe['status'](_0x271869)[_0x6d66('0x19')](_0xfa4088);}};}function respondWithFilteredResult(_0x5269ac,_0x58ab30){return function(_0x25333f){if(_0x25333f){var _0x2b0c98=typeof _0x58ab30[_0x6d66('0x1a')]===_0x6d66('0x1b')&&typeof _0x58ab30[_0x6d66('0x1c')]==='undefined';var _0xd6e8ef=_0x25333f[_0x6d66('0x1d')];var _0x4bcd49=_0x2b0c98?0x0:_0x58ab30['offset'];var _0x577b2=_0x2b0c98?_0x25333f[_0x6d66('0x1d')]:_0x58ab30[_0x6d66('0x1a')]+_0x58ab30[_0x6d66('0x1c')];var _0xba8e3e;if(_0x577b2>=_0xd6e8ef){_0x577b2=_0xd6e8ef;_0xba8e3e=0xc8;}else{_0xba8e3e=0xce;}_0x5269ac[_0x6d66('0x17')](_0xba8e3e);return _0x5269ac[_0x6d66('0x1e')](_0x6d66('0x1f'),_0x4bcd49+'-'+_0x577b2+'/'+_0xd6e8ef)['json'](_0x25333f);}return null;};}function patchUpdates(_0x1cc0fb){return function(_0x12f69c){try{jsonpatch[_0x6d66('0x20')](_0x12f69c,_0x1cc0fb,!![]);}catch(_0x35ddbf){return BPromise[_0x6d66('0x21')](_0x35ddbf);}return _0x12f69c[_0x6d66('0x22')]();};}function saveUpdates(_0x449d37,_0x28c1eb){return function(_0x2ad411){if(_0x2ad411){return _0x2ad411[_0x6d66('0x23')](_0x449d37)['then'](function(_0x54b16e){return _0x54b16e;});}return null;};}function removeEntity(_0x56d885,_0x1a5d19){return function(_0x34d6ac){if(_0x34d6ac){return _0x34d6ac[_0x6d66('0x24')]()[_0x6d66('0x25')](function(){_0x56d885['status'](0xcc)[_0x6d66('0x18')]();});}};}function handleEntityNotFound(_0x547bb8,_0x4769f0){return function(_0x36b75c){if(!_0x36b75c){_0x547bb8[_0x6d66('0x16')](0x194);}return _0x36b75c;};}function handleError(_0x201aa,_0x55e3a8){_0x55e3a8=_0x55e3a8||0x1f4;return function(_0x143ba1){logger[_0x6d66('0x26')](_0x143ba1['stack']);if(_0x143ba1['name']){delete _0x143ba1['name'];}_0x201aa[_0x6d66('0x17')](_0x55e3a8)[_0x6d66('0x27')](_0x143ba1);};}exports[_0x6d66('0x28')]=function(_0x46333e,_0x5f392f){var _0xbeada={},_0xdc6a65={},_0x542645={'count':0x0,'rows':[]};var _0x4cee0c=_[_0x6d66('0x29')](db['SquareDetailsReport'][_0x6d66('0x2a')],function(_0x5e6f47){return{'name':_0x5e6f47[_0x6d66('0x2b')],'type':_0x5e6f47[_0x6d66('0x2c')]['key']};});_0xdc6a65[_0x6d66('0x2d')]=_[_0x6d66('0x29')](_0x4cee0c,_0x6d66('0x2e'));_0xdc6a65[_0x6d66('0x2f')]=_[_0x6d66('0x30')](_0x46333e[_0x6d66('0x2f')]);_0xdc6a65[_0x6d66('0x31')]=_[_0x6d66('0x32')](_0xdc6a65[_0x6d66('0x2d')],_0xdc6a65[_0x6d66('0x2f')]);_0xbeada['attributes']=_['intersection'](_0xdc6a65['model'],qs[_0x6d66('0x33')](_0x46333e['query'][_0x6d66('0x33')]));_0xbeada['attributes']=_0xbeada[_0x6d66('0x34')][_0x6d66('0x35')]?_0xbeada[_0x6d66('0x34')]:_0xdc6a65[_0x6d66('0x2d')];if(!_0x46333e[_0x6d66('0x2f')][_0x6d66('0x36')](_0x6d66('0x37'))){_0xbeada[_0x6d66('0x1c')]=qs[_0x6d66('0x1c')](_0x46333e[_0x6d66('0x2f')]['limit']);_0xbeada[_0x6d66('0x1a')]=qs[_0x6d66('0x1a')](_0x46333e[_0x6d66('0x2f')][_0x6d66('0x1a')]);}_0xbeada[_0x6d66('0x38')]=qs[_0x6d66('0x39')](_0x46333e[_0x6d66('0x2f')][_0x6d66('0x39')]);_0xbeada['where']=qs['filters'](_[_0x6d66('0x3a')](_0x46333e[_0x6d66('0x2f')],_0xdc6a65[_0x6d66('0x31')]),_0x4cee0c);if(_0x46333e[_0x6d66('0x2f')]['filter']){_0xbeada[_0x6d66('0x3b')]=_[_0x6d66('0x3c')](_0xbeada[_0x6d66('0x3b')],{'$or':_[_0x6d66('0x29')](_0x4cee0c,function(_0x43f660){if(_0x43f660[_0x6d66('0x2c')]!==_0x6d66('0x3d')){var _0x36120a={};_0x36120a[_0x43f660['name']]={'$like':'%'+_0x46333e[_0x6d66('0x2f')]['filter']+'%'};return _0x36120a;}})});}_0xbeada=_['merge']({},_0xbeada,_0x46333e[_0x6d66('0x3e')]);var _0x3b033d={'where':_0xbeada[_0x6d66('0x3b')]};return db[_0x6d66('0x3f')][_0x6d66('0x1d')](_0x3b033d)[_0x6d66('0x25')](function(_0x55ccea){_0x542645[_0x6d66('0x1d')]=_0x55ccea;if(_0x46333e[_0x6d66('0x2f')][_0x6d66('0x40')]){_0xbeada[_0x6d66('0x41')]=[{'all':!![]}];}return db[_0x6d66('0x3f')][_0x6d66('0x42')](_0xbeada);})[_0x6d66('0x25')](function(_0x1c0314){_0x542645[_0x6d66('0x43')]=_0x1c0314;return _0x542645;})[_0x6d66('0x25')](respondWithFilteredResult(_0x5f392f,_0xbeada))[_0x6d66('0x44')](handleError(_0x5f392f,null));};exports[_0x6d66('0x45')]=function(_0x87a53b,_0x38ab4a){var _0x611577={'raw':!![],'where':{'id':_0x87a53b[_0x6d66('0x46')]['id']}},_0x87cbf1={};_0x87cbf1[_0x6d66('0x2d')]=_[_0x6d66('0x30')](db[_0x6d66('0x3f')]['rawAttributes']);_0x87cbf1['query']=_[_0x6d66('0x30')](_0x87a53b['query']);_0x87cbf1[_0x6d66('0x31')]=_[_0x6d66('0x32')](_0x87cbf1[_0x6d66('0x2d')],_0x87cbf1[_0x6d66('0x2f')]);_0x611577['attributes']=_[_0x6d66('0x32')](_0x87cbf1[_0x6d66('0x2d')],qs[_0x6d66('0x33')](_0x87a53b[_0x6d66('0x2f')]['fields']));_0x611577[_0x6d66('0x34')]=_0x611577[_0x6d66('0x34')][_0x6d66('0x35')]?_0x611577['attributes']:_0x87cbf1['model'];if(_0x87a53b[_0x6d66('0x2f')][_0x6d66('0x40')]){_0x611577[_0x6d66('0x41')]=[{'all':!![]}];}_0x611577=_[_0x6d66('0x3c')]({},_0x611577,_0x87a53b[_0x6d66('0x3e')]);return db['SquareDetailsReport']['find'](_0x611577)[_0x6d66('0x25')](handleEntityNotFound(_0x38ab4a,null))['then'](respondWithResult(_0x38ab4a,null))[_0x6d66('0x44')](handleError(_0x38ab4a,null));};exports[_0x6d66('0x47')]=function(_0x21c0e1,_0x2e6604){return db[_0x6d66('0x3f')][_0x6d66('0x47')](_0x21c0e1[_0x6d66('0x48')],{})['then'](respondWithResult(_0x2e6604,0xc9))[_0x6d66('0x44')](handleError(_0x2e6604,null));};exports[_0x6d66('0x23')]=function(_0x57edc2,_0x406b32){if(_0x57edc2[_0x6d66('0x48')]['id']){delete _0x57edc2[_0x6d66('0x48')]['id'];}return db[_0x6d66('0x3f')]['find']({'where':{'id':_0x57edc2['params']['id']}})[_0x6d66('0x25')](handleEntityNotFound(_0x406b32,null))[_0x6d66('0x25')](saveUpdates(_0x57edc2[_0x6d66('0x48')],null))[_0x6d66('0x25')](respondWithResult(_0x406b32,null))[_0x6d66('0x44')](handleError(_0x406b32,null));};exports[_0x6d66('0x24')]=function(_0x14df56,_0x20a789){return db[_0x6d66('0x3f')]['find']({'where':{'id':_0x14df56[_0x6d66('0x46')]['id']}})[_0x6d66('0x25')](handleEntityNotFound(_0x20a789,null))[_0x6d66('0x25')](removeEntity(_0x20a789,null))[_0x6d66('0x44')](handleError(_0x20a789,null));};exports[_0x6d66('0x49')]=function(_0x384bcf,_0x308cbd){return db[_0x6d66('0x3f')][_0x6d66('0x49')]()['then'](respondWithResult(_0x308cbd,null))['catch'](handleError(_0x308cbd,null));};
\ No newline at end of file
index 8feb4b1..b684dea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd60d=['lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','SquareDetailsReport'];(function(_0x433324,_0x38cb6e){var _0x5d90cc=function(_0x3751e2){while(--_0x3751e2){_0x433324['push'](_0x433324['shift']());}};_0x5d90cc(++_0x38cb6e);}(_0xd60d,0x14d));var _0xdd60=function(_0x2ba242,_0x16fc85){_0x2ba242=_0x2ba242-0x0;var _0x173940=_0xd60d[_0x2ba242];return _0x173940;};'use strict';var _=require(_0xdd60('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xdd60('0x1'));var BPromise=require(_0xdd60('0x2'));var rp=require(_0xdd60('0x3'));var fs=require('fs');var path=require(_0xdd60('0x4'));var rimraf=require(_0xdd60('0x5'));var config=require(_0xdd60('0x6'));var attributes=require('./squareReportDetail.attributes');module['exports']=function(_0x99b6e3,_0x354881){return _0x99b6e3[_0xdd60('0x7')](_0xdd60('0x8'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1d9a=['path','rimraf','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','../../config/logger','moment','bluebird'];(function(_0x2bd3ca,_0x15c0a3){var _0x4ac154=function(_0xbe3ba8){while(--_0xbe3ba8){_0x2bd3ca['push'](_0x2bd3ca['shift']());}};_0x4ac154(++_0x15c0a3);}(_0x1d9a,0x146));var _0xa1d9=function(_0x2ac98a,_0x4e9576){_0x2ac98a=_0x2ac98a-0x0;var _0x30d2ab=_0x1d9a[_0x2ac98a];return _0x30d2ab;};'use strict';var _=require(_0xa1d9('0x0'));var util=require('util');var logger=require(_0xa1d9('0x1'))('api');var moment=require(_0xa1d9('0x2'));var BPromise=require(_0xa1d9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa1d9('0x4'));var rimraf=require(_0xa1d9('0x5'));var config=require('../../config/environment');var attributes=require(_0xa1d9('0x6'));module[_0xa1d9('0x7')]=function(_0x49a549,_0xcab85f){return _0x49a549[_0xa1d9('0x8')](_0xa1d9('0x9'),attributes,{'tableName':_0xa1d9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index dad4d9a..19dce61 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3070=['code','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x3070,0x75));var _0x0307=function(_0x1e6d9c,_0x16eed6){_0x1e6d9c=_0x1e6d9c-0x0;var _0x226f5e=_0x3070[_0x1e6d9c];return _0x226f5e;};'use strict';var _=require('lodash');var util=require(_0x0307('0x0'));var moment=require('moment');var BPromise=require(_0x0307('0x1'));var rs=require(_0x0307('0x2'));var fs=require('fs');var Redis=require(_0x0307('0x3'));var db=require(_0x0307('0x4'))['db'];var utils=require(_0x0307('0x5'));var logger=require(_0x0307('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0307('0x7'));var client=jayson[_0x0307('0x8')][_0x0307('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xc1dc51,_0x4fbe3e,_0x3ecfb6){return new BPromise(function(_0x41e638,_0x53e6b7){return client[_0x0307('0xa')](_0xc1dc51,_0x3ecfb6)[_0x0307('0xb')](function(_0x187fb3){logger[_0x0307('0xc')](_0x0307('0xd'),_0x4fbe3e,_0x0307('0xe'));logger[_0x0307('0xf')](_0x0307('0x10'),_0x4fbe3e,_0x0307('0xe'),JSON['stringify'](_0x187fb3));if(_0x187fb3[_0x0307('0x11')]){if(_0x187fb3['error'][_0x0307('0x12')]===0x1f4){logger[_0x0307('0x11')](_0x0307('0xd'),_0x4fbe3e,_0x187fb3[_0x0307('0x11')][_0x0307('0x13')]);return _0x53e6b7(_0x187fb3[_0x0307('0x11')][_0x0307('0x13')]);}logger[_0x0307('0x11')](_0x0307('0xd'),_0x4fbe3e,_0x187fb3[_0x0307('0x11')][_0x0307('0x13')]);return _0x41e638(_0x187fb3[_0x0307('0x11')][_0x0307('0x13')]);}else{logger[_0x0307('0xc')](_0x0307('0xd'),_0x4fbe3e,'request\x20sent');_0x41e638(_0x187fb3[_0x0307('0x14')][_0x0307('0x13')]);}})[_0x0307('0x15')](function(_0x5f11a5){logger['error'](_0x0307('0xd'),_0x4fbe3e,_0x5f11a5);_0x53e6b7(_0x5f11a5);});});}exports[_0x0307('0x16')]=function(_0x38dfd6){var _0x1402ab=this;return new Promise(function(_0x1e1654,_0x16433e){return db[_0x0307('0x17')]['create'](_0x38dfd6[_0x0307('0x18')],{'raw':_0x38dfd6['options']?_0x38dfd6[_0x0307('0x19')][_0x0307('0x1a')]===undefined?!![]:![]:!![]})[_0x0307('0xb')](function(_0x31ac5){logger['info'](_0x0307('0x16'),_0x38dfd6);logger[_0x0307('0xf')](_0x0307('0x16'),_0x38dfd6,JSON['stringify'](_0x31ac5));_0x1e1654(_0x31ac5);})['catch'](function(_0x9c1223){logger[_0x0307('0x11')]('CreateSquareDetailsReport',_0x9c1223[_0x0307('0x13')],_0x38dfd6);_0x16433e(_0x1402ab['error'](0x1f4,_0x9c1223[_0x0307('0x13')]));});});};
\ No newline at end of file
+var _0xa478=['rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','error','code','message','SquareDetailsReport,\x20%s,\x20%s','result','catch','CreateSquareDetailsReport','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x54dee9,_0x19d570){var _0x53282f=function(_0x38dc45){while(--_0x38dc45){_0x54dee9['push'](_0x54dee9['shift']());}};_0x53282f(++_0x19d570);}(_0xa478,0x136));var _0x8a47=function(_0x3a16d4,_0x23ecda){_0x3a16d4=_0x3a16d4-0x0;var _0x31ea9c=_0xa478[_0x3a16d4];return _0x31ea9c;};'use strict';var _=require(_0x8a47('0x0'));var util=require(_0x8a47('0x1'));var moment=require(_0x8a47('0x2'));var BPromise=require(_0x8a47('0x3'));var rs=require(_0x8a47('0x4'));var fs=require('fs');var Redis=require(_0x8a47('0x5'));var db=require(_0x8a47('0x6'))['db'];var utils=require(_0x8a47('0x7'));var logger=require(_0x8a47('0x8'))(_0x8a47('0x9'));var config=require(_0x8a47('0xa'));var jayson=require(_0x8a47('0xb'));var client=jayson['client'][_0x8a47('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d62a6,_0x3de815,_0x3cb340){return new BPromise(function(_0x56884b,_0x384886){return client['request'](_0x2d62a6,_0x3cb340)[_0x8a47('0xd')](function(_0x369fc9){logger[_0x8a47('0xe')]('SquareDetailsReport,\x20%s,\x20%s',_0x3de815,_0x8a47('0xf'));logger[_0x8a47('0x10')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x3de815,_0x8a47('0xf'),JSON['stringify'](_0x369fc9));if(_0x369fc9[_0x8a47('0x11')]){if(_0x369fc9[_0x8a47('0x11')][_0x8a47('0x12')]===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x3de815,_0x369fc9['error'][_0x8a47('0x13')]);return _0x384886(_0x369fc9[_0x8a47('0x11')]['message']);}logger[_0x8a47('0x11')](_0x8a47('0x14'),_0x3de815,_0x369fc9[_0x8a47('0x11')][_0x8a47('0x13')]);return _0x56884b(_0x369fc9[_0x8a47('0x11')][_0x8a47('0x13')]);}else{logger[_0x8a47('0xe')](_0x8a47('0x14'),_0x3de815,_0x8a47('0xf'));_0x56884b(_0x369fc9[_0x8a47('0x15')][_0x8a47('0x13')]);}})[_0x8a47('0x16')](function(_0x2917d9){logger['error'](_0x8a47('0x14'),_0x3de815,_0x2917d9);_0x384886(_0x2917d9);});});}exports[_0x8a47('0x17')]=function(_0x3f9093){var _0x5f5884=this;return new Promise(function(_0x341089,_0x5c62eb){return db['SquareDetailsReport'][_0x8a47('0x18')](_0x3f9093[_0x8a47('0x19')],{'raw':_0x3f9093[_0x8a47('0x1a')]?_0x3f9093[_0x8a47('0x1a')][_0x8a47('0x1b')]===undefined?!![]:![]:!![]})[_0x8a47('0xd')](function(_0x44e119){logger[_0x8a47('0xe')](_0x8a47('0x17'),_0x3f9093);logger[_0x8a47('0x10')]('CreateSquareDetailsReport',_0x3f9093,JSON[_0x8a47('0x1c')](_0x44e119));_0x341089(_0x44e119);})['catch'](function(_0x289f28){logger[_0x8a47('0x11')](_0x8a47('0x17'),_0x289f28[_0x8a47('0x13')],_0x3f9093);_0x5c62eb(_0x5f5884['error'](0x1f4,_0x289f28[_0x8a47('0x13')]));});});};
\ No newline at end of file
index a1461af..bf6790a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaddb=['/process/:pid/kill','isAuthenticated','killProcess','exports','express','Router','../../components/auth/service','get','index'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xaddb,0xa6));var _0xbadd=function(_0x2d68c9,_0x411beb){_0x2d68c9=_0x2d68c9-0x0;var _0x59a7b6=_0xaddb[_0x2d68c9];return _0x59a7b6;};'use strict';var express=require(_0xbadd('0x0'));var router=express[_0xbadd('0x1')]();var auth=require(_0xbadd('0x2'));var controller=require('./system.controller');router[_0xbadd('0x3')]('/',auth['isAuthenticated'](),controller[_0xbadd('0x4')]);router['get'](_0xbadd('0x5'),auth[_0xbadd('0x6')](),controller[_0xbadd('0x7')]);module[_0xbadd('0x8')]=router;
\ No newline at end of file
+var _0xd854=['killProcess','express','Router','../../components/auth/service','get','/process/:pid/kill'];(function(_0x3d6e0f,_0x2a4345){var _0x344849=function(_0x517bc3){while(--_0x517bc3){_0x3d6e0f['push'](_0x3d6e0f['shift']());}};_0x344849(++_0x2a4345);}(_0xd854,0xcd));var _0x4d85=function(_0x338b49,_0x2270b0){_0x338b49=_0x338b49-0x0;var _0x3ad341=_0xd854[_0x338b49];return _0x3ad341;};'use strict';var express=require(_0x4d85('0x0'));var router=express[_0x4d85('0x1')]();var auth=require(_0x4d85('0x2'));var controller=require('./system.controller');router[_0x4d85('0x3')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4d85('0x3')](_0x4d85('0x4'),auth['isAuthenticated'](),controller[_0x4d85('0x5')]);module['exports']=router;
\ No newline at end of file
index 140a993..ad6ba50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda1e=['exec','../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','getAllData','then','json','catch','killProcess','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda1e,0x1c0));var _0xeda1=function(_0x301dab,_0x38050a){_0x301dab=_0x301dab-0x0;var _0x2500a2=_0xda1e[_0x301dab];return _0x2500a2;};'use strict';var info=require('systeminformation');var exec=require('child_process')[_0xeda1('0x0')];var logger=require(_0xeda1('0x1'))(_0xeda1('0x2'));var util=require(_0xeda1('0x3'));var BPromise=require(_0xeda1('0x4'));var _=require(_0xeda1('0x5'));function handleError(_0x4eb837,_0x204ca9,_0xf9fb25){_0x204ca9=_0x204ca9||0x1f4;return function(_0x158161){logger[_0xeda1('0x6')](_0xeda1('0x7'),_0xf9fb25,_0x204ca9,util[_0xeda1('0x8')](_0x158161,{'showHidden':![],'depth':null}));delete _0x158161[_0xeda1('0x9')];_0x4eb837[_0xeda1('0xa')](_0x204ca9)['send'](_0x158161);};}exports[_0xeda1('0xb')]=function(_0xe34d9a,_0x1eed43){return info[_0xeda1('0xc')]()[_0xeda1('0xd')](function(_0x1d4b63){return _0x1eed43[_0xeda1('0xa')](0xc8)[_0xeda1('0xe')](_0x1d4b63);})[_0xeda1('0xf')](function(_0x202b05){return _0x1eed43[_0xeda1('0xa')](0x1f4)['json'](_0x202b05);});};exports[_0xeda1('0x10')]=function(_0xabea28,_0x2ae19c){var _0x101d32=['components/import/cm'];return new BPromise(function(_0x5bbd55,_0x3ab23d){return exec(util[_0xeda1('0x11')](_0xeda1('0x12'),_0xabea28[_0xeda1('0x13')]['pid']),function(_0x35d4ed,_0x141fbd,_0x560228){if(_0x35d4ed){return _0x3ab23d(_0x35d4ed);}return _0x5bbd55(_0x141fbd);});})[_0xeda1('0xd')](function(_0x233eb4){var _0x3f1e19=![];var _0x4f7f4b=_0x233eb4[_0xeda1('0x14')](/\n/);for(var _0x2fc2df=0x0,_0x521898=_0x101d32[_0xeda1('0x15')];_0x2fc2df<_0x521898,_0x3f1e19===![];_0x2fc2df+=0x1){if(_0x233eb4[_0xeda1('0x16')](_0x101d32[_0x2fc2df])>=0x0){_0x3f1e19=!![];}}if(!_0x3f1e19){throw new Error(util[_0xeda1('0x11')](_0xeda1('0x17'),_0xabea28[_0xeda1('0x13')][_0xeda1('0x18')]));}process[_0xeda1('0x19')](_0xabea28[_0xeda1('0x13')][_0xeda1('0x18')],_0xeda1('0x1a'));return _0x2ae19c['status'](0xc8)[_0xeda1('0xe')]({'message':util[_0xeda1('0x11')](_0xeda1('0x1b'),_0xabea28[_0xeda1('0x13')][_0xeda1('0x18')])});})['catch'](handleError(_0x2ae19c,null,_0xeda1('0x10')));};
\ No newline at end of file
+var _0xef2e=['length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','../../config/logger','util','bluebird','lodash','error','inspect','name','status','index','getAllData','then','json','catch','killProcess','components/import/cm','format','params','pid','split'];(function(_0x1e835a,_0xe7dcb5){var _0x3cc332=function(_0x91e217){while(--_0x91e217){_0x1e835a['push'](_0x1e835a['shift']());}};_0x3cc332(++_0xe7dcb5);}(_0xef2e,0x87));var _0xeef2=function(_0x247b0b,_0x3df01f){_0x247b0b=_0x247b0b-0x0;var _0x44dfde=_0xef2e[_0x247b0b];return _0x44dfde;};'use strict';var info=require(_0xeef2('0x0'));var exec=require(_0xeef2('0x1'))['exec'];var logger=require(_0xeef2('0x2'))('api');var util=require(_0xeef2('0x3'));var BPromise=require(_0xeef2('0x4'));var _=require(_0xeef2('0x5'));function handleError(_0x3d055f,_0x3dc6a6,_0x5b81b5){_0x3dc6a6=_0x3dc6a6||0x1f4;return function(_0x2a6aa8){logger[_0xeef2('0x6')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x5b81b5,_0x3dc6a6,util[_0xeef2('0x7')](_0x2a6aa8,{'showHidden':![],'depth':null}));delete _0x2a6aa8[_0xeef2('0x8')];_0x3d055f[_0xeef2('0x9')](_0x3dc6a6)['send'](_0x2a6aa8);};}exports[_0xeef2('0xa')]=function(_0x138958,_0x1bc00c){return info[_0xeef2('0xb')]()[_0xeef2('0xc')](function(_0x19ef84){return _0x1bc00c[_0xeef2('0x9')](0xc8)[_0xeef2('0xd')](_0x19ef84);})[_0xeef2('0xe')](function(_0x6a048){return _0x1bc00c[_0xeef2('0x9')](0x1f4)['json'](_0x6a048);});};exports[_0xeef2('0xf')]=function(_0x1136fb,_0x48ee6a){var _0x5ef5c6=[_0xeef2('0x10')];return new BPromise(function(_0x115b1e,_0x57cadb){return exec(util[_0xeef2('0x11')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x1136fb[_0xeef2('0x12')][_0xeef2('0x13')]),function(_0x80729b,_0x37df17,_0x3457f2){if(_0x80729b){return _0x57cadb(_0x80729b);}return _0x115b1e(_0x37df17);});})[_0xeef2('0xc')](function(_0x2f8dfa){var _0x14cf9a=![];var _0x5ab3f1=_0x2f8dfa[_0xeef2('0x14')](/\n/);for(var _0x27d05d=0x0,_0x3b1d52=_0x5ef5c6[_0xeef2('0x15')];_0x27d05d<_0x3b1d52,_0x14cf9a===![];_0x27d05d+=0x1){if(_0x2f8dfa[_0xeef2('0x16')](_0x5ef5c6[_0x27d05d])>=0x0){_0x14cf9a=!![];}}if(!_0x14cf9a){throw new Error(util[_0xeef2('0x11')](_0xeef2('0x17'),_0x1136fb[_0xeef2('0x12')][_0xeef2('0x13')]));}process[_0xeef2('0x18')](_0x1136fb[_0xeef2('0x12')][_0xeef2('0x13')],'SIGINT');return _0x48ee6a[_0xeef2('0x9')](0xc8)[_0xeef2('0xd')]({'message':util['format'](_0xeef2('0x19'),_0x1136fb[_0xeef2('0x12')]['pid'])});})[_0xeef2('0xe')](handleError(_0x48ee6a,null,_0xeef2('0xf')));};
\ No newline at end of file
index 3a306af..65d6f3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23b6=['../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','/:id','post','isAuthenticated','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x53ed0b,_0x25e205){var _0x453628=function(_0x2b0c51){while(--_0x2b0c51){_0x53ed0b['push'](_0x53ed0b['shift']());}};_0x453628(++_0x25e205);}(_0x23b6,0xd7));var _0x623b=function(_0x2caaef,_0x3c19ed){_0x2caaef=_0x2caaef-0x0;var _0xd011f8=_0x23b6[_0x2caaef];return _0xd011f8;};'use strict';var multer=require(_0x623b('0x0'));var util=require(_0x623b('0x1'));var path=require('path');var timeout=require(_0x623b('0x2'));var express=require(_0x623b('0x3'));var router=express[_0x623b('0x4')]();var fs_extra=require(_0x623b('0x5'));var auth=require(_0x623b('0x6'));var interaction=require(_0x623b('0x7'));var config=require(_0x623b('0x8'));var controller=require(_0x623b('0x9'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x623b('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x623b('0xb')]('/',auth[_0x623b('0xc')](),controller['create']);router[_0x623b('0xd')](_0x623b('0xa'),auth['isAuthenticated'](),controller[_0x623b('0xe')]);router[_0x623b('0xf')]('/:id',auth[_0x623b('0xc')](),controller['destroy']);module[_0x623b('0x10')]=router;
\ No newline at end of file
+var _0x7c10=['util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./tag.controller','isAuthenticated','index','get','/:id','show','create','update','delete','destroy','exports','multer'];(function(_0x3f39ab,_0x16c981){var _0x170952=function(_0x45e049){while(--_0x45e049){_0x3f39ab['push'](_0x3f39ab['shift']());}};_0x170952(++_0x16c981);}(_0x7c10,0x142));var _0x07c1=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x7c10[_0x8c43de];return _0xa6591b;};'use strict';var multer=require(_0x07c1('0x0'));var util=require(_0x07c1('0x1'));var path=require(_0x07c1('0x2'));var timeout=require('connect-timeout');var express=require(_0x07c1('0x3'));var router=express[_0x07c1('0x4')]();var fs_extra=require(_0x07c1('0x5'));var auth=require(_0x07c1('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x07c1('0x7'));var controller=require(_0x07c1('0x8'));router['get']('/',auth[_0x07c1('0x9')](),controller[_0x07c1('0xa')]);router[_0x07c1('0xb')](_0x07c1('0xc'),auth[_0x07c1('0x9')](),controller[_0x07c1('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x07c1('0xe')]);router['put'](_0x07c1('0xc'),auth[_0x07c1('0x9')](),controller[_0x07c1('0xf')]);router[_0x07c1('0x10')](_0x07c1('0xc'),auth[_0x07c1('0x9')](),controller[_0x07c1('0x11')]);module[_0x07c1('0x12')]=router;
\ No newline at end of file
index 24c34b2..778b505 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01d3=['name','#0091EA','sequelize','exports','STRING'];(function(_0x5d6a7f,_0x109e9b){var _0x24dec8=function(_0x59848a){while(--_0x59848a){_0x5d6a7f['push'](_0x5d6a7f['shift']());}};_0x24dec8(++_0x109e9b);}(_0x01d3,0xa2));var _0x301d=function(_0x331f07,_0x4aa829){_0x331f07=_0x331f07-0x0;var _0x49e12f=_0x01d3[_0x331f07];return _0x49e12f;};'use strict';var Sequelize=require(_0x301d('0x0'));module[_0x301d('0x1')]={'name':{'type':Sequelize[_0x301d('0x2')],'unique':_0x301d('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x301d('0x4')},'description':{'type':Sequelize[_0x301d('0x2')]}};
\ No newline at end of file
+var _0x3d45=['STRING','name','sequelize','exports'];(function(_0x2909b1,_0x424d46){var _0x554957=function(_0x1ecb40){while(--_0x1ecb40){_0x2909b1['push'](_0x2909b1['shift']());}};_0x554957(++_0x424d46);}(_0x3d45,0x1d2));var _0x53d4=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x3d45[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x53d4('0x0'));module[_0x53d4('0x1')]={'name':{'type':Sequelize[_0x53d4('0x2')],'unique':_0x53d4('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x53d4('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x53d4('0x2')]}};
\ No newline at end of file
index b8b0584..679750a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf4eb=['body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','eml-format','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','then','destroy','Tags','UserProfileResource','error','stack','name','send','index','map','Tag','fieldName','key','model','keys','filters','intersection','attributes','fields','query','length','order','sort','pick','where','merge','type','VIRTUAL','filter','options','include','rows','catch','show','rawAttributes','find','create'];(function(_0x423995,_0x34d28e){var _0x54c52a=function(_0x344157){while(--_0x344157){_0x423995['push'](_0x423995['shift']());}};_0x54c52a(++_0x34d28e);}(_0xf4eb,0xec));var _0xbf4e=function(_0xe29510,_0x583d05){_0xe29510=_0xe29510-0x0;var _0x334d79=_0xf4eb[_0xe29510];return _0x334d79;};'use strict';var emlformat=require(_0xbf4e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbf4e('0x1'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf4e('0x2'));var path=require(_0xbf4e('0x3'));var sox=require(_0xbf4e('0x4'));var csv=require(_0xbf4e('0x5'));var ejs=require(_0xbf4e('0x6'));var fs=require('fs');var fs_extra=require(_0xbf4e('0x7'));var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x5'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var as=require(_0xbf4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf4e('0x10'));var utils=require('../../config/utils');var config=require(_0xbf4e('0x11'));var licenseUtil=require(_0xbf4e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x17fd01,_0x5a3035){_0x5a3035=_0x5a3035||0xcc;return function(_0x56d185){if(_0x56d185){return _0x17fd01[_0xbf4e('0x13')](_0x5a3035);}return _0x17fd01[_0xbf4e('0x14')](_0x5a3035)[_0xbf4e('0x15')]();};}function respondWithResult(_0x302841,_0x3b74bd){_0x3b74bd=_0x3b74bd||0xc8;return function(_0x61bd54){if(_0x61bd54){return _0x302841['status'](_0x3b74bd)['json'](_0x61bd54);}};}function respondWithFilteredResult(_0x180432,_0x1735ae){return function(_0x28fc6b){if(_0x28fc6b){var _0x542909=typeof _0x1735ae[_0xbf4e('0x16')]===_0xbf4e('0x17')&&typeof _0x1735ae[_0xbf4e('0x18')]===_0xbf4e('0x17');var _0x5a631e=_0x28fc6b[_0xbf4e('0x19')];var _0x577c27=_0x542909?0x0:_0x1735ae['offset'];var _0x566ec3=_0x542909?_0x28fc6b['count']:_0x1735ae[_0xbf4e('0x16')]+_0x1735ae[_0xbf4e('0x18')];var _0x1fc800;if(_0x566ec3>=_0x5a631e){_0x566ec3=_0x5a631e;_0x1fc800=0xc8;}else{_0x1fc800=0xce;}_0x180432['status'](_0x1fc800);return _0x180432['set'](_0xbf4e('0x1a'),_0x577c27+'-'+_0x566ec3+'/'+_0x5a631e)[_0xbf4e('0x1b')](_0x28fc6b);}return null;};}function patchUpdates(_0x3be138){return function(_0x3a875b){try{jsonpatch[_0xbf4e('0x1c')](_0x3a875b,_0x3be138,!![]);}catch(_0x1e2a68){return BPromise[_0xbf4e('0x1d')](_0x1e2a68);}return _0x3a875b[_0xbf4e('0x1e')]();};}function saveUpdates(_0xd09e12,_0x376832){return function(_0x30539b){if(_0x30539b){return _0x30539b['update'](_0xd09e12)[_0xbf4e('0x1f')](function(_0x2e7673){return _0x2e7673;});}return null;};}function removeEntity(_0x51648c,_0x31e3f5){return function(_0x30994d){if(_0x30994d){return _0x30994d[_0xbf4e('0x20')]()[_0xbf4e('0x1f')](function(){var _0x3a5d72=_0x30994d['get']({'plain':!![]});var _0x90635e=_0xbf4e('0x21');return db[_0xbf4e('0x22')]['destroy']({'where':{'type':_0x90635e,'resourceId':_0x3a5d72['id']}})[_0xbf4e('0x1f')](function(){return _0x30994d;});})['then'](function(){_0x51648c['status'](0xcc)[_0xbf4e('0x15')]();});}};}function handleEntityNotFound(_0x5a0a9b,_0x38c923){return function(_0x315df3){if(!_0x315df3){_0x5a0a9b[_0xbf4e('0x13')](0x194);}return _0x315df3;};}function handleError(_0x41f918,_0x5c912f){_0x5c912f=_0x5c912f||0x1f4;return function(_0x2d4686){logger[_0xbf4e('0x23')](_0x2d4686[_0xbf4e('0x24')]);if(_0x2d4686['name']){delete _0x2d4686[_0xbf4e('0x25')];}_0x41f918['status'](_0x5c912f)[_0xbf4e('0x26')](_0x2d4686);};}exports[_0xbf4e('0x27')]=function(_0xb8b58e,_0x498dbd){var _0x1d12e2={},_0x362716={},_0x2f3cf8={'count':0x0,'rows':[]};var _0xc7ca87=_[_0xbf4e('0x28')](db[_0xbf4e('0x29')]['rawAttributes'],function(_0x35c82d){return{'name':_0x35c82d[_0xbf4e('0x2a')],'type':_0x35c82d['type'][_0xbf4e('0x2b')]};});_0x362716[_0xbf4e('0x2c')]=_['map'](_0xc7ca87,_0xbf4e('0x25'));_0x362716['query']=_[_0xbf4e('0x2d')](_0xb8b58e['query']);_0x362716[_0xbf4e('0x2e')]=_[_0xbf4e('0x2f')](_0x362716[_0xbf4e('0x2c')],_0x362716['query']);_0x1d12e2[_0xbf4e('0x30')]=_[_0xbf4e('0x2f')](_0x362716[_0xbf4e('0x2c')],qs[_0xbf4e('0x31')](_0xb8b58e[_0xbf4e('0x32')][_0xbf4e('0x31')]));_0x1d12e2['attributes']=_0x1d12e2[_0xbf4e('0x30')][_0xbf4e('0x33')]?_0x1d12e2[_0xbf4e('0x30')]:_0x362716[_0xbf4e('0x2c')];if(!_0xb8b58e[_0xbf4e('0x32')]['hasOwnProperty']('nolimit')){_0x1d12e2['limit']=qs['limit'](_0xb8b58e[_0xbf4e('0x32')][_0xbf4e('0x18')]);_0x1d12e2[_0xbf4e('0x16')]=qs[_0xbf4e('0x16')](_0xb8b58e[_0xbf4e('0x32')][_0xbf4e('0x16')]);}_0x1d12e2[_0xbf4e('0x34')]=qs[_0xbf4e('0x35')](_0xb8b58e[_0xbf4e('0x32')]['sort']);_0x1d12e2['where']=qs[_0xbf4e('0x2e')](_[_0xbf4e('0x36')](_0xb8b58e[_0xbf4e('0x32')],_0x362716['filters']),_0xc7ca87);if(_0xb8b58e[_0xbf4e('0x32')]['filter']){_0x1d12e2[_0xbf4e('0x37')]=_[_0xbf4e('0x38')](_0x1d12e2[_0xbf4e('0x37')],{'$or':_[_0xbf4e('0x28')](_0xc7ca87,function(_0x5ce339){if(_0x5ce339[_0xbf4e('0x39')]!==_0xbf4e('0x3a')){var _0x3aa308={};_0x3aa308[_0x5ce339[_0xbf4e('0x25')]]={'$like':'%'+_0xb8b58e['query'][_0xbf4e('0x3b')]+'%'};return _0x3aa308;}})});}_0x1d12e2=_[_0xbf4e('0x38')]({},_0x1d12e2,_0xb8b58e[_0xbf4e('0x3c')]);var _0x29fe9d={'where':_0x1d12e2[_0xbf4e('0x37')]};return db[_0xbf4e('0x29')][_0xbf4e('0x19')](_0x29fe9d)['then'](function(_0x176166){_0x2f3cf8[_0xbf4e('0x19')]=_0x176166;if(_0xb8b58e['query']['includeAll']){_0x1d12e2[_0xbf4e('0x3d')]=[{'all':!![]}];}return db[_0xbf4e('0x29')]['findAll'](_0x1d12e2);})['then'](function(_0x2b1bf4){_0x2f3cf8[_0xbf4e('0x3e')]=_0x2b1bf4;return _0x2f3cf8;})[_0xbf4e('0x1f')](respondWithFilteredResult(_0x498dbd,_0x1d12e2))[_0xbf4e('0x3f')](handleError(_0x498dbd,null));};exports[_0xbf4e('0x40')]=function(_0x3ad0a4,_0x5a03c6){var _0x3ecc15={'raw':!![],'where':{'id':_0x3ad0a4['params']['id']}},_0x7bd91={};_0x7bd91['model']=_['keys'](db['Tag'][_0xbf4e('0x41')]);_0x7bd91['query']=_[_0xbf4e('0x2d')](_0x3ad0a4[_0xbf4e('0x32')]);_0x7bd91['filters']=_['intersection'](_0x7bd91[_0xbf4e('0x2c')],_0x7bd91[_0xbf4e('0x32')]);_0x3ecc15[_0xbf4e('0x30')]=_[_0xbf4e('0x2f')](_0x7bd91[_0xbf4e('0x2c')],qs['fields'](_0x3ad0a4[_0xbf4e('0x32')][_0xbf4e('0x31')]));_0x3ecc15[_0xbf4e('0x30')]=_0x3ecc15[_0xbf4e('0x30')][_0xbf4e('0x33')]?_0x3ecc15[_0xbf4e('0x30')]:_0x7bd91[_0xbf4e('0x2c')];if(_0x3ad0a4[_0xbf4e('0x32')]['includeAll']){_0x3ecc15[_0xbf4e('0x3d')]=[{'all':!![]}];}_0x3ecc15=_[_0xbf4e('0x38')]({},_0x3ecc15,_0x3ad0a4[_0xbf4e('0x3c')]);return db[_0xbf4e('0x29')][_0xbf4e('0x42')](_0x3ecc15)[_0xbf4e('0x1f')](handleEntityNotFound(_0x5a03c6,null))[_0xbf4e('0x1f')](respondWithResult(_0x5a03c6,null))[_0xbf4e('0x3f')](handleError(_0x5a03c6,null));};exports[_0xbf4e('0x43')]=function(_0x3447ab,_0x2fdba9){return db[_0xbf4e('0x29')][_0xbf4e('0x43')](_0x3447ab[_0xbf4e('0x44')],{})[_0xbf4e('0x1f')](function(_0x2892ce){var _0x10bc23=_0x3447ab['user'][_0xbf4e('0x45')]({'plain':!![]});if(!_0x10bc23)throw new Error(_0xbf4e('0x46'));if(_0x10bc23[_0xbf4e('0x47')]==='user'){var _0x33ab9a=_0x2892ce['get']({'plain':!![]});var _0x4a050e=_0xbf4e('0x21');return db[_0xbf4e('0x48')]['find']({'where':{'name':_0x4a050e,'userProfileId':_0x10bc23[_0xbf4e('0x49')]},'raw':!![]})[_0xbf4e('0x1f')](function(_0x31d779){if(_0x31d779&&_0x31d779[_0xbf4e('0x4a')]===0x0){return db[_0xbf4e('0x22')][_0xbf4e('0x43')]({'name':_0x33ab9a[_0xbf4e('0x25')],'resourceId':_0x33ab9a['id'],'type':_0x31d779[_0xbf4e('0x25')],'sectionId':_0x31d779['id']},{})[_0xbf4e('0x1f')](function(){return _0x2892ce;});}else{return _0x2892ce;}})[_0xbf4e('0x3f')](function(_0x271ad2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x271ad2);throw _0x271ad2;});}return _0x2892ce;})[_0xbf4e('0x1f')](respondWithResult(_0x2fdba9,0xc9))[_0xbf4e('0x3f')](handleError(_0x2fdba9,null));};exports[_0xbf4e('0x4b')]=function(_0x586f5d,_0x339ce6){if(_0x586f5d[_0xbf4e('0x44')]['id']){delete _0x586f5d['body']['id'];}return db['Tag'][_0xbf4e('0x42')]({'where':{'id':_0x586f5d['params']['id']}})['then'](handleEntityNotFound(_0x339ce6,null))[_0xbf4e('0x1f')](saveUpdates(_0x586f5d[_0xbf4e('0x44')],null))[_0xbf4e('0x1f')](respondWithResult(_0x339ce6,null))[_0xbf4e('0x3f')](handleError(_0x339ce6,null));};exports[_0xbf4e('0x20')]=function(_0x5ec2d9,_0x242a75){return db['Tag'][_0xbf4e('0x42')]({'where':{'id':_0x5ec2d9['params']['id']}})[_0xbf4e('0x1f')](handleEntityNotFound(_0x242a75,null))['then'](removeEntity(_0x242a75,null))[_0xbf4e('0x3f')](handleError(_0x242a75,null));};
\ No newline at end of file
+var _0xb43b=['rawAttributes','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','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','Tags','then','status','sendStatus','error','stack','name','send','index','Tag','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','includeAll','rows','catch','show','params'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0xb43b,0x1b2));var _0xbb43=function(_0xc9a47d,_0x361e23){_0xc9a47d=_0xc9a47d-0x0;var _0x5e15bc=_0xb43b[_0xc9a47d];return _0x5e15bc;};'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(){var _0x53f0d5=_0x298ce2['get']({'plain':!![]});var _0x269ca5=_0xbb43('0x25');return db['UserProfileResource'][_0xbb43('0x24')]({'where':{'type':_0x269ca5,'resourceId':_0x53f0d5['id']}})[_0xbb43('0x26')](function(){return _0x298ce2;});})[_0xbb43('0x26')](function(){_0x4dfb7f[_0xbb43('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b5342,_0x27fd7a){return function(_0x42800f){if(!_0x42800f){_0x4b5342[_0xbb43('0x28')](0x194);}return _0x42800f;};}function handleError(_0x8b3205,_0x510b05){_0x510b05=_0x510b05||0x1f4;return function(_0x40b04b){logger[_0xbb43('0x29')](_0x40b04b[_0xbb43('0x2a')]);if(_0x40b04b['name']){delete _0x40b04b[_0xbb43('0x2b')];}_0x8b3205['status'](_0x510b05)[_0xbb43('0x2c')](_0x40b04b);};}exports[_0xbb43('0x2d')]=function(_0x34f5b2,_0x1880cd){var _0x555b99={},_0x157d62={},_0x547a6f={'count':0x0,'rows':[]};var _0x5566cf=_['map'](db[_0xbb43('0x2e')]['rawAttributes'],function(_0xa7e144){return{'name':_0xa7e144[_0xbb43('0x2f')],'type':_0xa7e144[_0xbb43('0x30')]['key']};});_0x157d62[_0xbb43('0x31')]=_[_0xbb43('0x32')](_0x5566cf,_0xbb43('0x2b'));_0x157d62[_0xbb43('0x33')]=_[_0xbb43('0x34')](_0x34f5b2[_0xbb43('0x33')]);_0x157d62[_0xbb43('0x35')]=_[_0xbb43('0x36')](_0x157d62['model'],_0x157d62[_0xbb43('0x33')]);_0x555b99[_0xbb43('0x37')]=_[_0xbb43('0x36')](_0x157d62[_0xbb43('0x31')],qs[_0xbb43('0x38')](_0x34f5b2[_0xbb43('0x33')][_0xbb43('0x38')]));_0x555b99[_0xbb43('0x37')]=_0x555b99[_0xbb43('0x37')][_0xbb43('0x39')]?_0x555b99[_0xbb43('0x37')]:_0x157d62[_0xbb43('0x31')];if(!_0x34f5b2[_0xbb43('0x33')][_0xbb43('0x3a')](_0xbb43('0x3b'))){_0x555b99[_0xbb43('0x1d')]=qs['limit'](_0x34f5b2[_0xbb43('0x33')][_0xbb43('0x1d')]);_0x555b99['offset']=qs[_0xbb43('0x1c')](_0x34f5b2[_0xbb43('0x33')][_0xbb43('0x1c')]);}_0x555b99['order']=qs['sort'](_0x34f5b2['query'][_0xbb43('0x3c')]);_0x555b99[_0xbb43('0x3d')]=qs['filters'](_['pick'](_0x34f5b2[_0xbb43('0x33')],_0x157d62[_0xbb43('0x35')]),_0x5566cf);if(_0x34f5b2[_0xbb43('0x33')][_0xbb43('0x3e')]){_0x555b99[_0xbb43('0x3d')]=_['merge'](_0x555b99[_0xbb43('0x3d')],{'$or':_[_0xbb43('0x32')](_0x5566cf,function(_0x2cd8b8){if(_0x2cd8b8[_0xbb43('0x30')]!==_0xbb43('0x3f')){var _0x531d96={};_0x531d96[_0x2cd8b8[_0xbb43('0x2b')]]={'$like':'%'+_0x34f5b2['query'][_0xbb43('0x3e')]+'%'};return _0x531d96;}})});}_0x555b99=_[_0xbb43('0x40')]({},_0x555b99,_0x34f5b2['options']);var _0x4783fe={'where':_0x555b99['where']};return db[_0xbb43('0x2e')][_0xbb43('0x1b')](_0x4783fe)[_0xbb43('0x26')](function(_0xb84ece){_0x547a6f['count']=_0xb84ece;if(_0x34f5b2[_0xbb43('0x33')][_0xbb43('0x41')]){_0x555b99['include']=[{'all':!![]}];}return db[_0xbb43('0x2e')]['findAll'](_0x555b99);})[_0xbb43('0x26')](function(_0x14285d){_0x547a6f[_0xbb43('0x42')]=_0x14285d;return _0x547a6f;})[_0xbb43('0x26')](respondWithFilteredResult(_0x1880cd,_0x555b99))[_0xbb43('0x43')](handleError(_0x1880cd,null));};exports[_0xbb43('0x44')]=function(_0x4bf8ed,_0x1beb2a){var _0x5686ee={'raw':!![],'where':{'id':_0x4bf8ed[_0xbb43('0x45')]['id']}},_0x307f1e={};_0x307f1e[_0xbb43('0x31')]=_[_0xbb43('0x34')](db['Tag'][_0xbb43('0x46')]);_0x307f1e[_0xbb43('0x33')]=_[_0xbb43('0x34')](_0x4bf8ed[_0xbb43('0x33')]);_0x307f1e[_0xbb43('0x35')]=_[_0xbb43('0x36')](_0x307f1e[_0xbb43('0x31')],_0x307f1e[_0xbb43('0x33')]);_0x5686ee['attributes']=_[_0xbb43('0x36')](_0x307f1e[_0xbb43('0x31')],qs['fields'](_0x4bf8ed[_0xbb43('0x33')]['fields']));_0x5686ee['attributes']=_0x5686ee['attributes']['length']?_0x5686ee[_0xbb43('0x37')]:_0x307f1e['model'];if(_0x4bf8ed[_0xbb43('0x33')]['includeAll']){_0x5686ee[_0xbb43('0x47')]=[{'all':!![]}];}_0x5686ee=_[_0xbb43('0x40')]({},_0x5686ee,_0x4bf8ed[_0xbb43('0x48')]);return db['Tag'][_0xbb43('0x49')](_0x5686ee)['then'](handleEntityNotFound(_0x1beb2a,null))[_0xbb43('0x26')](respondWithResult(_0x1beb2a,null))[_0xbb43('0x43')](handleError(_0x1beb2a,null));};exports[_0xbb43('0x4a')]=function(_0x29840e,_0x417ad9){return db[_0xbb43('0x2e')][_0xbb43('0x4a')](_0x29840e['body'],{})[_0xbb43('0x26')](function(_0x26ea59){var _0x202059=_0x29840e[_0xbb43('0x4b')]['get']({'plain':!![]});if(!_0x202059)throw new Error(_0xbb43('0x4c'));if(_0x202059[_0xbb43('0x4d')]===_0xbb43('0x4b')){var _0xb1883e=_0x26ea59['get']({'plain':!![]});var _0x3206c0=_0xbb43('0x25');return db[_0xbb43('0x4e')]['find']({'where':{'name':_0x3206c0,'userProfileId':_0x202059[_0xbb43('0x4f')]},'raw':!![]})[_0xbb43('0x26')](function(_0x73d4ce){if(_0x73d4ce&&_0x73d4ce[_0xbb43('0x50')]===0x0){return db[_0xbb43('0x51')]['create']({'name':_0xb1883e['name'],'resourceId':_0xb1883e['id'],'type':_0x73d4ce[_0xbb43('0x2b')],'sectionId':_0x73d4ce['id']},{})['then'](function(){return _0x26ea59;});}else{return _0x26ea59;}})[_0xbb43('0x43')](function(_0xe0cdba){logger['error'](_0xbb43('0x52'),_0xe0cdba);throw _0xe0cdba;});}return _0x26ea59;})[_0xbb43('0x26')](respondWithResult(_0x417ad9,0xc9))[_0xbb43('0x43')](handleError(_0x417ad9,null));};exports[_0xbb43('0x23')]=function(_0x1dfbb9,_0x5cb3c6){if(_0x1dfbb9[_0xbb43('0x53')]['id']){delete _0x1dfbb9['body']['id'];}return db['Tag'][_0xbb43('0x49')]({'where':{'id':_0x1dfbb9[_0xbb43('0x45')]['id']}})[_0xbb43('0x26')](handleEntityNotFound(_0x5cb3c6,null))[_0xbb43('0x26')](saveUpdates(_0x1dfbb9[_0xbb43('0x53')],null))['then'](respondWithResult(_0x5cb3c6,null))['catch'](handleError(_0x5cb3c6,null));};exports[_0xbb43('0x24')]=function(_0x157824,_0x3a84ad){return db[_0xbb43('0x2e')][_0xbb43('0x49')]({'where':{'id':_0x157824[_0xbb43('0x45')]['id']}})[_0xbb43('0x26')](handleEntityNotFound(_0x3a84ad,null))[_0xbb43('0x26')](removeEntity(_0x3a84ad,null))[_0xbb43('0x43')](handleError(_0x3a84ad,null));};
\ No newline at end of file
index 57c804a..f23ad9d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x12c9=['Tag','tools_tags','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./tag.attributes','define'];(function(_0x38ead1,_0x305199){var _0x4cad8a=function(_0x31d3bc){while(--_0x31d3bc){_0x38ead1['push'](_0x38ead1['shift']());}};_0x4cad8a(++_0x305199);}(_0x12c9,0x1c9));var _0x912c=function(_0x148c42,_0x57fb9d){_0x148c42=_0x148c42-0x0;var _0x583f8a=_0x12c9[_0x148c42];return _0x583f8a;};'use strict';var _=require(_0x912c('0x0'));var util=require(_0x912c('0x1'));var logger=require(_0x912c('0x2'))(_0x912c('0x3'));var moment=require(_0x912c('0x4'));var BPromise=require('bluebird');var rp=require(_0x912c('0x5'));var fs=require('fs');var path=require(_0x912c('0x6'));var rimraf=require(_0x912c('0x7'));var config=require(_0x912c('0x8'));var attributes=require(_0x912c('0x9'));module['exports']=function(_0x584a27,_0xe29019){return _0x584a27[_0x912c('0xa')](_0x912c('0xb'),attributes,{'tableName':_0x912c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5094=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./tag.attributes','Tag','tools_tags','lodash','util'];(function(_0x507abf,_0x102de1){var _0x93bddf=function(_0x1230d8){while(--_0x1230d8){_0x507abf['push'](_0x507abf['shift']());}};_0x93bddf(++_0x102de1);}(_0x5094,0x6a));var _0x4509=function(_0x485034,_0x43f507){_0x485034=_0x485034-0x0;var _0x34e386=_0x5094[_0x485034];return _0x34e386;};'use strict';var _=require(_0x4509('0x0'));var util=require(_0x4509('0x1'));var logger=require(_0x4509('0x2'))(_0x4509('0x3'));var moment=require(_0x4509('0x4'));var BPromise=require(_0x4509('0x5'));var rp=require(_0x4509('0x6'));var fs=require('fs');var path=require(_0x4509('0x7'));var rimraf=require(_0x4509('0x8'));var config=require('../../config/environment');var attributes=require(_0x4509('0x9'));module['exports']=function(_0x48d28e,_0x144208){return _0x48d28e['define'](_0x4509('0xa'),attributes,{'tableName':_0x4509('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index feea605..c05f7d1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9567=['info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','request','then'];(function(_0x43941d,_0x45fd0d){var _0x27b82a=function(_0x21851e){while(--_0x21851e){_0x43941d['push'](_0x43941d['shift']());}};_0x27b82a(++_0x45fd0d);}(_0x9567,0xdc));var _0x7956=function(_0x4304f2,_0x2854a8){_0x4304f2=_0x4304f2-0x0;var _0x2b54f2=_0x9567[_0x4304f2];return _0x2b54f2;};'use strict';var _=require(_0x7956('0x0'));var util=require(_0x7956('0x1'));var moment=require(_0x7956('0x2'));var BPromise=require(_0x7956('0x3'));var rs=require(_0x7956('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7956('0x5'));var logger=require(_0x7956('0x6'))('rpc');var config=require(_0x7956('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7956('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1819b6,_0x31b50d,_0x48b2b3){return new BPromise(function(_0x3c213a,_0x50038a){return client[_0x7956('0x9')](_0x1819b6,_0x48b2b3)[_0x7956('0xa')](function(_0x53310c){logger[_0x7956('0xb')](_0x7956('0xc'),_0x31b50d,'request\x20sent');logger[_0x7956('0xd')](_0x7956('0xe'),_0x31b50d,_0x7956('0xf'),JSON['stringify'](_0x53310c));if(_0x53310c[_0x7956('0x10')]){if(_0x53310c[_0x7956('0x10')][_0x7956('0x11')]===0x1f4){logger[_0x7956('0x10')]('Tag,\x20%s,\x20%s',_0x31b50d,_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);return _0x50038a(_0x53310c[_0x7956('0x10')]['message']);}logger[_0x7956('0x10')](_0x7956('0xc'),_0x31b50d,_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);return _0x3c213a(_0x53310c[_0x7956('0x10')][_0x7956('0x12')]);}else{logger[_0x7956('0xb')](_0x7956('0xc'),_0x31b50d,_0x7956('0xf'));_0x3c213a(_0x53310c[_0x7956('0x13')][_0x7956('0x12')]);}})[_0x7956('0x14')](function(_0x18ae51){logger[_0x7956('0x10')](_0x7956('0xc'),_0x31b50d,_0x18ae51);_0x50038a(_0x18ae51);});});}
\ No newline at end of file
+var _0xe107=['then','Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x2c9fea,_0x13e47c){var _0x3e7cd3=function(_0xaaf41e){while(--_0xaaf41e){_0x2c9fea['push'](_0x2c9fea['shift']());}};_0x3e7cd3(++_0x13e47c);}(_0xe107,0xb3));var _0x7e10=function(_0x97e6ec,_0x2e8806){_0x97e6ec=_0x97e6ec-0x0;var _0x4e3ba3=_0xe107[_0x97e6ec];return _0x4e3ba3;};'use strict';var _=require(_0x7e10('0x0'));var util=require('util');var moment=require(_0x7e10('0x1'));var BPromise=require(_0x7e10('0x2'));var rs=require(_0x7e10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e10('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7e10('0x5'));var config=require(_0x7e10('0x6'));var jayson=require(_0x7e10('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1dd3de,_0x7378b3,_0x156c56){return new BPromise(function(_0x3413f7,_0x493958){return client['request'](_0x1dd3de,_0x156c56)[_0x7e10('0x8')](function(_0x490a7a){logger['info'](_0x7e10('0x9'),_0x7378b3,_0x7e10('0xa'));logger[_0x7e10('0xb')](_0x7e10('0xc'),_0x7378b3,_0x7e10('0xa'),JSON['stringify'](_0x490a7a));if(_0x490a7a[_0x7e10('0xd')]){if(_0x490a7a['error'][_0x7e10('0xe')]===0x1f4){logger[_0x7e10('0xd')](_0x7e10('0x9'),_0x7378b3,_0x490a7a['error'][_0x7e10('0xf')]);return _0x493958(_0x490a7a[_0x7e10('0xd')][_0x7e10('0xf')]);}logger[_0x7e10('0xd')](_0x7e10('0x9'),_0x7378b3,_0x490a7a[_0x7e10('0xd')][_0x7e10('0xf')]);return _0x3413f7(_0x490a7a[_0x7e10('0xd')]['message']);}else{logger[_0x7e10('0x10')](_0x7e10('0x9'),_0x7378b3,'request\x20sent');_0x3413f7(_0x490a7a['result'][_0x7e10('0xf')]);}})['catch'](function(_0xe1abd2){logger[_0x7e10('0xd')](_0x7e10('0x9'),_0x7378b3,_0xe1abd2);_0x493958(_0xe1abd2);});});}
\ No newline at end of file
index 61c265f..281827d 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(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('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 0b4ee4d..6c668a2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd8b0=['exports','sequelize'];(function(_0x24ceb8,_0x4c9149){var _0x5dd3ba=function(_0xb385b9){while(--_0xb385b9){_0x24ceb8['push'](_0x24ceb8['shift']());}};_0x5dd3ba(++_0x4c9149);}(_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
+var _0xbaf0=['name','exports','STRING'];(function(_0x23b655,_0x4feb2b){var _0x364b32=function(_0x4e41ac){while(--_0x4e41ac){_0x23b655['push'](_0x23b655['shift']());}};_0x364b32(++_0x4feb2b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}};
\ No newline at end of file
index 12139b0..46e51d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['redis','socket.io-emitter','./team.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','reject','save','then','destroy','UserProfileResource','error','stack','name','index','map','Team','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','catch','show','params','includeAll','include','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','update','channel','isValidChannel','Sequelize','ValidationError','capitalize','length','toLowerCase','Queues','addQueues','findOne','add','ids','removeQueues','Unknown\x20channel','remove','addAgents','isArray','Voice','Mail','Fax','Openchannel','Whatsapp','sequelize','transaction','through','penalty','User','findOrCreate','Queue:save','QueueId','online','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','voicePause','TeamVoiceQueue','all','TeamVoicePrefix','UserVoicePrefix','spread','removeAgents','Sms','emit','Queue:remove','VoicePrefixId','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','defaults'];(function(_0xc78a2b,_0x3c7b2c){var _0x4c08c2=function(_0x1a4bd6){while(--_0x1a4bd6){_0xc78a2b['push'](_0xc78a2b['shift']());}};_0x4c08c2(++_0x3c7b2c);}(_0x9c44,0x178));var _0x49c4=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9c44[_0x2b7764];return _0x848dcb;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x49c4('0x0'));var jsonpatch=require(_0x49c4('0x1'));var rp=require(_0x49c4('0x2'));var moment=require(_0x49c4('0x3'));var BPromise=require(_0x49c4('0x4'));var Mustache=require(_0x49c4('0x5'));var util=require('util');var path=require('path');var sox=require(_0x49c4('0x6'));var csv=require('to-csv');var ejs=require(_0x49c4('0x7'));var fs=require('fs');var fs_extra=require(_0x49c4('0x8'));var _=require(_0x49c4('0x9'));var squel=require(_0x49c4('0xa'));var crypto=require(_0x49c4('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x49c4('0xc'));var toCsv=require(_0x49c4('0xd'));var querystring=require(_0x49c4('0xe'));var Papa=require(_0x49c4('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x49c4('0x10'));var as=require(_0x49c4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x49c4('0x12'))(_0x49c4('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x49c4('0x14'));var db=require(_0x49c4('0x15'))['db'];config['redis']=_[_0x49c4('0x16')](config[_0x49c4('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x49c4('0x18'))(new Redis(config[_0x49c4('0x17')]));require(_0x49c4('0x19'))[_0x49c4('0x1a')](socket);function respondWithStatusCode(_0x12777c,_0x18211c){_0x18211c=_0x18211c||0xcc;return function(_0x75ea8){if(_0x75ea8){return _0x12777c[_0x49c4('0x1b')](_0x18211c);}return _0x12777c['status'](_0x18211c)[_0x49c4('0x1c')]();};}function respondWithResult(_0x141003,_0x13a2db){_0x13a2db=_0x13a2db||0xc8;return function(_0x81e831){if(_0x81e831){return _0x141003[_0x49c4('0x1d')](_0x13a2db)['json'](_0x81e831);}};}function respondWithFilteredResult(_0x44e607,_0x2891f4){return function(_0x4c3253){if(_0x4c3253){var _0x512650=typeof _0x2891f4[_0x49c4('0x1e')]===_0x49c4('0x1f')&&typeof _0x2891f4[_0x49c4('0x20')]==='undefined';var _0x24856d=_0x4c3253['count'];var _0x2cbd50=_0x512650?0x0:_0x2891f4[_0x49c4('0x1e')];var _0xe31fcc=_0x512650?_0x4c3253[_0x49c4('0x21')]:_0x2891f4[_0x49c4('0x1e')]+_0x2891f4[_0x49c4('0x20')];var _0x280893;if(_0xe31fcc>=_0x24856d){_0xe31fcc=_0x24856d;_0x280893=0xc8;}else{_0x280893=0xce;}_0x44e607[_0x49c4('0x1d')](_0x280893);return _0x44e607[_0x49c4('0x22')]('Content-Range',_0x2cbd50+'-'+_0xe31fcc+'/'+_0x24856d)['json'](_0x4c3253);}return null;};}function patchUpdates(_0x57f502){return function(_0x1c99b1){try{jsonpatch['apply'](_0x1c99b1,_0x57f502,!![]);}catch(_0x592bb8){return BPromise[_0x49c4('0x23')](_0x592bb8);}return _0x1c99b1[_0x49c4('0x24')]();};}function saveUpdates(_0x26c640,_0xd335e4){return function(_0x4811c4){if(_0x4811c4){return _0x4811c4['update'](_0x26c640)[_0x49c4('0x25')](function(_0x9cb797){return _0x9cb797;});}return null;};}function removeEntity(_0x565423,_0x207358){return function(_0x43e014){if(_0x43e014){return _0x43e014[_0x49c4('0x26')]()[_0x49c4('0x25')](function(){var _0x531d92=_0x43e014['get']({'plain':!![]});var _0x449960='Teams';return db[_0x49c4('0x27')][_0x49c4('0x26')]({'where':{'type':_0x449960,'resourceId':_0x531d92['id']}})[_0x49c4('0x25')](function(){return _0x43e014;});})[_0x49c4('0x25')](function(){_0x565423['status'](0xcc)[_0x49c4('0x1c')]();});}};}function handleEntityNotFound(_0x2b2793,_0x46e04d){return function(_0x4f28a2){if(!_0x4f28a2){_0x2b2793[_0x49c4('0x1b')](0x194);}return _0x4f28a2;};}function handleError(_0x29f835,_0x26ba17){_0x26ba17=_0x26ba17||0x1f4;return function(_0x427b26){logger[_0x49c4('0x28')](_0x427b26[_0x49c4('0x29')]);if(_0x427b26[_0x49c4('0x2a')]){delete _0x427b26['name'];}_0x29f835['status'](_0x26ba17)['send'](_0x427b26);};}exports[_0x49c4('0x2b')]=function(_0x7ee704,_0x1eb035){var _0x27e467={},_0x28eb47={},_0x574fd3={'count':0x0,'rows':[]};var _0x38ad77=_[_0x49c4('0x2c')](db[_0x49c4('0x2d')][_0x49c4('0x2e')],function(_0x58e252){return{'name':_0x58e252['fieldName'],'type':_0x58e252[_0x49c4('0x2f')][_0x49c4('0x30')]};});_0x28eb47[_0x49c4('0x31')]=_[_0x49c4('0x2c')](_0x38ad77,_0x49c4('0x2a'));_0x28eb47['query']=_[_0x49c4('0x32')](_0x7ee704[_0x49c4('0x33')]);_0x28eb47[_0x49c4('0x34')]=_['intersection'](_0x28eb47['model'],_0x28eb47[_0x49c4('0x33')]);_0x27e467[_0x49c4('0x35')]=_[_0x49c4('0x36')](_0x28eb47[_0x49c4('0x31')],qs[_0x49c4('0x37')](_0x7ee704[_0x49c4('0x33')][_0x49c4('0x37')]));_0x27e467[_0x49c4('0x35')]=_0x27e467[_0x49c4('0x35')]['length']?_0x27e467[_0x49c4('0x35')]:_0x28eb47['model'];if(!_0x7ee704[_0x49c4('0x33')][_0x49c4('0x38')](_0x49c4('0x39'))){_0x27e467[_0x49c4('0x20')]=qs['limit'](_0x7ee704[_0x49c4('0x33')][_0x49c4('0x20')]);_0x27e467[_0x49c4('0x1e')]=qs['offset'](_0x7ee704[_0x49c4('0x33')][_0x49c4('0x1e')]);}_0x27e467[_0x49c4('0x3a')]=qs[_0x49c4('0x3b')](_0x7ee704[_0x49c4('0x33')][_0x49c4('0x3b')]);_0x27e467[_0x49c4('0x3c')]=qs[_0x49c4('0x34')](_[_0x49c4('0x3d')](_0x7ee704[_0x49c4('0x33')],_0x28eb47[_0x49c4('0x34')]),_0x38ad77);if(_0x7ee704['query'][_0x49c4('0x3e')]){_0x27e467[_0x49c4('0x3c')]=_[_0x49c4('0x3f')](_0x27e467[_0x49c4('0x3c')],{'$or':_[_0x49c4('0x2c')](_0x38ad77,function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x2f')]!==_0x49c4('0x40')){var _0x248c0a={};_0x248c0a[_0x29dd5d[_0x49c4('0x2a')]]={'$like':'%'+_0x7ee704[_0x49c4('0x33')][_0x49c4('0x3e')]+'%'};return _0x248c0a;}})});}_0x27e467=_[_0x49c4('0x3f')]({},_0x27e467,_0x7ee704['options']);var _0x212366={'where':_0x27e467['where']};return db[_0x49c4('0x2d')][_0x49c4('0x21')](_0x212366)[_0x49c4('0x25')](function(_0x1480da){_0x574fd3[_0x49c4('0x21')]=_0x1480da;if(_0x7ee704[_0x49c4('0x33')]['includeAll']){_0x27e467['include']=[{'all':!![]}];}return db[_0x49c4('0x2d')][_0x49c4('0x41')](_0x27e467);})[_0x49c4('0x25')](function(_0x117151){_0x574fd3['rows']=_0x117151;return _0x574fd3;})[_0x49c4('0x25')](respondWithFilteredResult(_0x1eb035,_0x27e467))[_0x49c4('0x42')](handleError(_0x1eb035,null));};exports[_0x49c4('0x43')]=function(_0x444270,_0x81a674){var _0x3bde49={'raw':![],'where':{'id':_0x444270[_0x49c4('0x44')]['id']}},_0x1a9593={};_0x1a9593[_0x49c4('0x31')]=_['keys'](db[_0x49c4('0x2d')]['rawAttributes']);_0x1a9593[_0x49c4('0x33')]=_[_0x49c4('0x32')](_0x444270[_0x49c4('0x33')]);_0x1a9593[_0x49c4('0x34')]=_[_0x49c4('0x36')](_0x1a9593['model'],_0x1a9593[_0x49c4('0x33')]);_0x3bde49[_0x49c4('0x35')]=_[_0x49c4('0x36')](_0x1a9593[_0x49c4('0x31')],qs[_0x49c4('0x37')](_0x444270[_0x49c4('0x33')][_0x49c4('0x37')]));_0x3bde49['attributes']=_0x3bde49[_0x49c4('0x35')]['length']?_0x3bde49[_0x49c4('0x35')]:_0x1a9593[_0x49c4('0x31')];if(_0x444270[_0x49c4('0x33')][_0x49c4('0x45')]){_0x3bde49[_0x49c4('0x46')]=[{'all':!![]}];}_0x3bde49=_[_0x49c4('0x3f')]({},_0x3bde49,_0x444270[_0x49c4('0x47')]);return db['Team'][_0x49c4('0x48')](_0x3bde49)[_0x49c4('0x25')](handleEntityNotFound(_0x81a674,null))['then'](respondWithResult(_0x81a674,null))[_0x49c4('0x42')](handleError(_0x81a674,null));};exports[_0x49c4('0x49')]=function(_0xfbe179,_0x242afc){return db['Team']['create'](_0xfbe179[_0x49c4('0x4a')],{})['then'](function(_0x4597c3){var _0x1f941f=_0xfbe179[_0x49c4('0x4b')][_0x49c4('0x4c')]({'plain':!![]});if(!_0x1f941f)throw new Error(_0x49c4('0x4d'));if(_0x1f941f[_0x49c4('0x4e')]===_0x49c4('0x4b')){var _0x563f0b=_0x4597c3[_0x49c4('0x4c')]({'plain':!![]});var _0x1550ce=_0x49c4('0x4f');return db[_0x49c4('0x50')][_0x49c4('0x48')]({'where':{'name':_0x1550ce,'userProfileId':_0x1f941f[_0x49c4('0x51')]},'raw':!![]})[_0x49c4('0x25')](function(_0x25d174){if(_0x25d174&&_0x25d174[_0x49c4('0x52')]===0x0){return db[_0x49c4('0x27')]['create']({'name':_0x563f0b['name'],'resourceId':_0x563f0b['id'],'type':_0x25d174[_0x49c4('0x2a')],'sectionId':_0x25d174['id']},{})[_0x49c4('0x25')](function(){return _0x4597c3;});}else{return _0x4597c3;}})['catch'](function(_0x59a8bc){logger[_0x49c4('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x59a8bc);throw _0x59a8bc;});}return _0x4597c3;})['then'](respondWithResult(_0x242afc,0xc9))[_0x49c4('0x42')](handleError(_0x242afc,null));};exports[_0x49c4('0x53')]=function(_0x4a0a93,_0x38c480){if(_0x4a0a93[_0x49c4('0x4a')]['id']){delete _0x4a0a93[_0x49c4('0x4a')]['id'];}return db[_0x49c4('0x2d')]['find']({'where':{'id':_0x4a0a93[_0x49c4('0x44')]['id']}})[_0x49c4('0x25')](handleEntityNotFound(_0x38c480,null))[_0x49c4('0x25')](saveUpdates(_0x4a0a93[_0x49c4('0x4a')],null))[_0x49c4('0x25')](respondWithResult(_0x38c480,null))[_0x49c4('0x42')](handleError(_0x38c480,null));};exports['destroy']=function(_0x5c7ddd,_0x1ef0c1){return db[_0x49c4('0x2d')][_0x49c4('0x48')]({'where':{'id':_0x5c7ddd[_0x49c4('0x44')]['id']}})[_0x49c4('0x25')](handleEntityNotFound(_0x1ef0c1,null))[_0x49c4('0x25')](removeEntity(_0x1ef0c1,null))[_0x49c4('0x42')](handleError(_0x1ef0c1,null));};exports['getQueues']=function(_0x45d715,_0x33c9a6,_0x4ba4eb){return db[_0x49c4('0x2d')]['findOne']({'where':{'id':_0x45d715[_0x49c4('0x44')]['id']}})[_0x49c4('0x25')](handleEntityNotFound(_0x33c9a6,null))[_0x49c4('0x25')](function(_0x2fe89a){if(!_0x45d715[_0x49c4('0x33')][_0x49c4('0x54')]||!utils[_0x49c4('0x55')](_0x45d715[_0x49c4('0x33')]['channel'])){throw new db[(_0x49c4('0x56'))][(_0x49c4('0x57'))]('Unknown\x20channel');}var _0x10dec7={};var _0x299e74={};_0x299e74['model']=_[_0x49c4('0x32')](db[_[_0x49c4('0x58')](_0x45d715['query']['channel']['toLowerCase']())+'Queue'][_0x49c4('0x2e')]);_0x299e74['query']=_[_0x49c4('0x32')](_0x45d715[_0x49c4('0x33')]);_0x299e74['filters']=_[_0x49c4('0x36')](_0x299e74[_0x49c4('0x31')],_0x299e74['query']);_0x10dec7[_0x49c4('0x35')]=_[_0x49c4('0x36')](_0x299e74[_0x49c4('0x31')],qs[_0x49c4('0x37')](_0x45d715['query'][_0x49c4('0x37')]));_0x10dec7[_0x49c4('0x35')]=_0x10dec7[_0x49c4('0x35')][_0x49c4('0x59')]?_0x10dec7['attributes']:_0x299e74[_0x49c4('0x31')];_0x10dec7['limit']=qs['limit'](_0x45d715['query']['limit']);_0x10dec7[_0x49c4('0x1e')]=qs[_0x49c4('0x1e')](_0x45d715[_0x49c4('0x33')][_0x49c4('0x1e')]);_0x10dec7['order']=qs['sort'](_0x45d715[_0x49c4('0x33')][_0x49c4('0x3b')]);_0x10dec7[_0x49c4('0x3c')]=qs[_0x49c4('0x34')](_[_0x49c4('0x3d')](_0x45d715[_0x49c4('0x33')],_0x299e74[_0x49c4('0x34')]));_0x10dec7=_[_0x49c4('0x3f')]({},_0x10dec7,_0x45d715['options']);return _0x2fe89a[_0x49c4('0x4c')+_['capitalize'](_0x45d715[_0x49c4('0x33')][_0x49c4('0x54')][_0x49c4('0x5a')]())+_0x49c4('0x5b')](_0x10dec7);})[_0x49c4('0x25')](respondWithResult(_0x33c9a6,null))[_0x49c4('0x42')](handleError(_0x33c9a6,null));};exports[_0x49c4('0x5c')]=function(_0x3feb0b,_0x13d951,_0x1743d0){return db[_0x49c4('0x2d')][_0x49c4('0x5d')]({'where':{'id':_0x3feb0b[_0x49c4('0x44')]['id']}})[_0x49c4('0x25')](function(_0x2d5f63){if(_0x2d5f63){if(!_0x3feb0b[_0x49c4('0x4a')][_0x49c4('0x54')]||!utils[_0x49c4('0x55')](_0x3feb0b['body']['channel'])){throw new db[(_0x49c4('0x56'))][(_0x49c4('0x57'))]('Unknown\x20channel');}return _0x2d5f63[_0x49c4('0x5e')+_[_0x49c4('0x58')](_0x3feb0b[_0x49c4('0x4a')][_0x49c4('0x54')]['toLowerCase']())+'Queues'](_0x3feb0b['body'][_0x49c4('0x5f')]);}return null;})[_0x49c4('0x25')](handleEntityNotFound(_0x13d951,null))[_0x49c4('0x25')](respondWithStatusCode(_0x13d951,null))[_0x49c4('0x42')](handleError(_0x13d951,null));};exports[_0x49c4('0x60')]=function(_0x146706,_0x191afb,_0x3692a4){return db[_0x49c4('0x2d')]['findOne']({'where':{'id':_0x146706[_0x49c4('0x44')]['id']}})[_0x49c4('0x25')](function(_0x342f8f){if(_0x342f8f){if(!_0x146706['query'][_0x49c4('0x54')]||!utils[_0x49c4('0x55')](_0x146706[_0x49c4('0x33')][_0x49c4('0x54')])){throw new db[(_0x49c4('0x56'))][(_0x49c4('0x57'))](_0x49c4('0x61'));}return _0x342f8f[_0x49c4('0x62')+_['capitalize'](_0x146706[_0x49c4('0x33')][_0x49c4('0x54')][_0x49c4('0x5a')]())+_0x49c4('0x5b')](_0x146706[_0x49c4('0x33')]['ids']);}return null;})['then'](handleEntityNotFound(_0x191afb,null))[_0x49c4('0x25')](respondWithStatusCode(_0x191afb,null))['catch'](handleError(_0x191afb,null));};exports[_0x49c4('0x63')]=function(_0x558880,_0x23516e){var _0x27b77d=_[_0x49c4('0x64')](_0x558880[_0x49c4('0x4a')]['ids'])?_0x558880[_0x49c4('0x4a')][_0x49c4('0x5f')]:[_0x558880[_0x49c4('0x4a')][_0x49c4('0x5f')]];var _0x100bc4=_0x558880[_0x49c4('0x44')]['id'];return db[_0x49c4('0x2d')][_0x49c4('0x48')]({'where':{'id':_0x100bc4}})[_0x49c4('0x25')](handleEntityNotFound(_0x23516e,null))[_0x49c4('0x25')](function(_0x5e7f45){if(_0x5e7f45){var _0x228189=[_0x49c4('0x65'),'Chat',_0x49c4('0x66'),'Sms',_0x49c4('0x67'),_0x49c4('0x68'),_0x49c4('0x69')];return db[_0x49c4('0x6a')][_0x49c4('0x6b')](function(_0x58b90c){var _0x16f618=_[_0x49c4('0x2c')](_0x228189,function(_0x596a9e){var _0x2b5136={'attributes':['id',_0x49c4('0x2a')]};if(_0x596a9e==='Voice'){_0x2b5136[_0x49c4('0x6c')]={'attributes':[_0x49c4('0x6d')]};}return _0x5e7f45['get'+_0x596a9e+_0x49c4('0x5b')](_0x2b5136)[_0x49c4('0x25')](function(_0x25989a){var _0x33dc39=_['map'](_0x25989a,function(_0x999ae2){var _0x7212ce=_['map'](_0x27b77d,function(_0x45df7c){var _0x5f0188={'where':{'UserId':_0x45df7c,[_0x596a9e+'QueueId']:_0x999ae2['id']},'transaction':_0x58b90c};if(_0x596a9e===_0x49c4('0x65')){_0x5f0188['defaults']={'penalty':_0x999ae2['TeamVoiceQueue'][_0x49c4('0x6d')]};}return db[_0x49c4('0x6e')+_0x596a9e+'Queue'][_0x49c4('0x6f')](_0x5f0188)['then'](function(){socket['emit']('user'+_0x596a9e+_0x49c4('0x70'),{'UserId':_0x45df7c,[_0x596a9e+_0x49c4('0x71')]:_0x999ae2['id']});if(_0x596a9e!==_0x49c4('0x65')){return;}return db[_0x49c4('0x6e')]['findAll']({'where':{'id':_0x27b77d,'online':0x1},'attributes':['id','name',_0x49c4('0x72'),'voicePause',_0x49c4('0x73')],'raw':!![]})['then'](function(_0x4e381c){var _0x10a048=_[_0x49c4('0x2c')](_0x4e381c,function(_0x1076be){return db[_0x49c4('0x74')][_0x49c4('0x75')]({'membername':_0x1076be[_0x49c4('0x2a')],'UserId':_0x1076be['id'],'queue_name':_0x999ae2['name'],'VoiceQueueId':_0x999ae2['id'],'interface':_[_0x49c4('0x76')](_0x1076be[_0x49c4('0x73')])?util[_0x49c4('0x77')](_0x49c4('0x78'),_0x1076be[_0x49c4('0x2a')]):_0x1076be['interface'],'paused':_0x1076be[_0x49c4('0x79')]||![],'penalty':_0x999ae2[_0x49c4('0x7a')][_0x49c4('0x6d')]},{'transaction':_0x58b90c});});return Promise['all'](_0x10a048);});});});return Promise['all'](_0x7212ce);});return Promise[_0x49c4('0x7b')](_0x33dc39);})[_0x49c4('0x25')](function(){return db[_0x49c4('0x7c')][_0x49c4('0x5d')]({'where':{'teamId':_0x100bc4}})[_0x49c4('0x25')](function(_0x4e1c71){if(_0x4e1c71){var _0x83b5f2=_[_0x49c4('0x2c')](_0x27b77d,function(_0x191974){db[_0x49c4('0x7d')]['upsert']({'UserId':_0x191974,'VoicePrefixId':_0x4e1c71['VoicePrefixId']});});return Promise[_0x49c4('0x7b')](_0x83b5f2);}});});});return Promise[_0x49c4('0x7b')](_0x16f618)[_0x49c4('0x25')](function(){return _0x5e7f45[_0x49c4('0x63')](_0x27b77d,{'transaction':_0x58b90c})[_0x49c4('0x7e')](function(_0x5413d8){return _0x5413d8;});});});}})[_0x49c4('0x25')](respondWithResult(_0x23516e,null))[_0x49c4('0x42')](handleError(_0x23516e,null));};exports[_0x49c4('0x7f')]=function(_0x1b0111,_0x2cddc1){var _0x8f37e5=_['isArray'](_0x1b0111[_0x49c4('0x33')][_0x49c4('0x5f')])?_0x1b0111[_0x49c4('0x33')][_0x49c4('0x5f')]:[_0x1b0111['query']['ids']];var _0xa96f53=_0x1b0111['params']['id'];return db[_0x49c4('0x2d')]['find']({'where':{'id':_0xa96f53}})[_0x49c4('0x25')](handleEntityNotFound(_0x2cddc1,null))[_0x49c4('0x25')](function(_0x25afc3){if(_0x25afc3){var _0x20bec7=['Voice','Chat',_0x49c4('0x66'),_0x49c4('0x80'),_0x49c4('0x67'),'Openchannel','Whatsapp'];return db[_0x49c4('0x6a')]['transaction'](function(_0x5c4742){var _0x1b9473=_['map'](_0x20bec7,function(_0x22668b){var _0x3cfa95={'attributes':['id','name']};return _0x25afc3[_0x49c4('0x4c')+_0x22668b+_0x49c4('0x5b')](_0x3cfa95)['then'](function(_0x5428a9){var _0xdb9820=_['map'](_0x5428a9,function(_0x43fe1c){return _0x43fe1c[_0x49c4('0x7f')](_0x8f37e5,{'transaction':_0x5c4742})[_0x49c4('0x25')](function(){var _0x352733=_[_0x49c4('0x2c')](_0x8f37e5,function(_0x4483fc){socket[_0x49c4('0x81')]('user'+_0x22668b+_0x49c4('0x82'),{'UserId':Number(_0x4483fc),[_0x22668b+_0x49c4('0x71')]:_0x43fe1c['id']});if(_0x22668b!==_0x49c4('0x65')){return;}return db[_0x49c4('0x74')][_0x49c4('0x26')]({'where':{'VoiceQueueId':_0x43fe1c['id'],'UserId':_0x4483fc},'transaction':_0x5c4742});});return Promise['all'](_0x352733);});});return Promise[_0x49c4('0x7b')](_0xdb9820);});});return Promise['all'](_0x1b9473)[_0x49c4('0x25')](function(){return _0x25afc3[_0x49c4('0x7f')](_0x8f37e5,{'transaction':_0x5c4742});})[_0x49c4('0x25')](function(){return db[_0x49c4('0x7c')]['findOne']({'where':{'teamId':_0xa96f53}})[_0x49c4('0x25')](function(_0x139696){if(_0x139696){var _0x312b02=_[_0x49c4('0x2c')](_0x8f37e5,function(_0x332173){db[_0x49c4('0x7d')]['destroy']({'where':{'UserId':_0x332173,'VoicePrefixId':_0x139696[_0x49c4('0x83')]}});});return Promise['all'](_0x312b02);}});});});}})[_0x49c4('0x25')](respondWithStatusCode(_0x2cddc1,null))[_0x49c4('0x42')](handleError(_0x2cddc1,null));};exports[_0x49c4('0x84')]=function(_0x2722fe,_0x5d864b,_0x46eaa1){var _0x17e7c6={};var _0x5829bc={};var _0x1e0b7d;var _0x3c321f;return db['Team']['findOne']({'where':{'id':_0x2722fe[_0x49c4('0x44')]['id']}})[_0x49c4('0x25')](handleEntityNotFound(_0x5d864b,null))[_0x49c4('0x25')](function(_0x1aa3a3){if(_0x1aa3a3){_0x1e0b7d=_0x1aa3a3;_0x5829bc[_0x49c4('0x31')]=_[_0x49c4('0x32')](db[_0x49c4('0x6e')][_0x49c4('0x2e')]);_0x5829bc[_0x49c4('0x33')]=_[_0x49c4('0x32')](_0x2722fe[_0x49c4('0x33')]);_0x5829bc['filters']=_['intersection'](_0x5829bc[_0x49c4('0x31')],_0x5829bc[_0x49c4('0x33')]);_0x17e7c6[_0x49c4('0x35')]=_['intersection'](_0x5829bc[_0x49c4('0x31')],qs[_0x49c4('0x37')](_0x2722fe['query'][_0x49c4('0x37')]));_0x17e7c6['attributes']=_0x17e7c6[_0x49c4('0x35')][_0x49c4('0x59')]?_0x17e7c6[_0x49c4('0x35')]:_0x5829bc[_0x49c4('0x31')];_0x17e7c6['order']=qs[_0x49c4('0x3b')](_0x2722fe[_0x49c4('0x33')][_0x49c4('0x3b')]);_0x17e7c6[_0x49c4('0x3c')]=qs[_0x49c4('0x34')](_['pick'](_0x2722fe['query'],_0x5829bc['filters']));if(_0x2722fe[_0x49c4('0x33')][_0x49c4('0x3e')]){_0x17e7c6[_0x49c4('0x3c')]=_[_0x49c4('0x3f')](_0x17e7c6[_0x49c4('0x3c')],{'$or':_['map'](_0x17e7c6[_0x49c4('0x35')],function(_0x41ef7c){var _0x265dc3={};_0x265dc3[_0x41ef7c]={'$like':'%'+_0x2722fe[_0x49c4('0x33')]['filter']+'%'};return _0x265dc3;})});}_0x17e7c6=_[_0x49c4('0x3f')]({},_0x17e7c6,_0x2722fe[_0x49c4('0x47')]);return _0x1e0b7d[_0x49c4('0x84')](_0x17e7c6);}})[_0x49c4('0x25')](function(_0x2fda4f){if(_0x2fda4f){_0x3c321f=_0x2fda4f['length'];if(!_0x2722fe[_0x49c4('0x33')][_0x49c4('0x38')](_0x49c4('0x39'))){_0x17e7c6['limit']=qs[_0x49c4('0x20')](_0x2722fe[_0x49c4('0x33')][_0x49c4('0x20')]);_0x17e7c6['offset']=qs[_0x49c4('0x1e')](_0x2722fe['query']['offset']);}return _0x1e0b7d[_0x49c4('0x84')](_0x17e7c6);}})[_0x49c4('0x25')](function(_0x4ef4aa){if(_0x4ef4aa){return _0x4ef4aa?{'count':_0x3c321f,'rows':_0x4ef4aa}:null;}})[_0x49c4('0x25')](respondWithResult(_0x5d864b,null))[_0x49c4('0x42')](handleError(_0x5d864b,null));};
\ No newline at end of file
+var _0x008c=['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','redis','defaults','register','sendStatus','status','json','offset','undefined','set','Content-Range','apply','reject','update','then','destroy','name','send','index','map','Team','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','count','includeAll','include','rows','catch','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','params','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','capitalize','toLowerCase','Queue','rawAttributes','Queues','add','ids','removeQueues','Unknown\x20channel','remove','addAgents','isArray','Mail','Sms','Fax','Openchannel','Whatsapp','sequelize','transaction','Voice','through','penalty','findOrCreate','Queue:save','User','interface','upsert','isNil','format','voicePause','all','UserVoicePrefix','spread','removeAgents','emit','user','Queue:remove','QueueId','UserVoiceQueueRt','TeamVoicePrefix','VoicePrefixId','getAgents','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x34cbda,_0x269ce1){var _0x1213d8=function(_0xcb2a8a){while(--_0xcb2a8a){_0x34cbda['push'](_0x34cbda['shift']());}};_0x1213d8(++_0x269ce1);}(_0x008c,0x188));var _0xc008=function(_0x128239,_0x30a688){_0x128239=_0x128239-0x0;var _0x5543df=_0x008c[_0x128239];return _0x5543df;};'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'];config[_0xc008('0x18')]=_[_0xc008('0x19')](config[_0xc008('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc008('0x18')]));require('./team.socket')[_0xc008('0x1a')](socket);function respondWithStatusCode(_0x4584e1,_0x2073ef){_0x2073ef=_0x2073ef||0xcc;return function(_0x339ffc){if(_0x339ffc){return _0x4584e1[_0xc008('0x1b')](_0x2073ef);}return _0x4584e1['status'](_0x2073ef)['end']();};}function respondWithResult(_0x4bd0f4,_0x11ef38){_0x11ef38=_0x11ef38||0xc8;return function(_0x15a6ad){if(_0x15a6ad){return _0x4bd0f4[_0xc008('0x1c')](_0x11ef38)[_0xc008('0x1d')](_0x15a6ad);}};}function respondWithFilteredResult(_0x4fe771,_0x53b06e){return function(_0x540e45){if(_0x540e45){var _0x5c2668=typeof _0x53b06e[_0xc008('0x1e')]===_0xc008('0x1f')&&typeof _0x53b06e['limit']===_0xc008('0x1f');var _0x5906e6=_0x540e45['count'];var _0x543e5d=_0x5c2668?0x0:_0x53b06e['offset'];var _0x5754a0=_0x5c2668?_0x540e45['count']:_0x53b06e['offset']+_0x53b06e['limit'];var _0x4a582d;if(_0x5754a0>=_0x5906e6){_0x5754a0=_0x5906e6;_0x4a582d=0xc8;}else{_0x4a582d=0xce;}_0x4fe771['status'](_0x4a582d);return _0x4fe771[_0xc008('0x20')](_0xc008('0x21'),_0x543e5d+'-'+_0x5754a0+'/'+_0x5906e6)[_0xc008('0x1d')](_0x540e45);}return null;};}function patchUpdates(_0x415af3){return function(_0x11cc75){try{jsonpatch[_0xc008('0x22')](_0x11cc75,_0x415af3,!![]);}catch(_0x4f43e2){return BPromise[_0xc008('0x23')](_0x4f43e2);}return _0x11cc75['save']();};}function saveUpdates(_0x58a6ea,_0x218599){return function(_0x36f358){if(_0x36f358){return _0x36f358[_0xc008('0x24')](_0x58a6ea)[_0xc008('0x25')](function(_0x5410f5){return _0x5410f5;});}return null;};}function removeEntity(_0x48582b,_0x5de1e9){return function(_0x3f7b07){if(_0x3f7b07){return _0x3f7b07[_0xc008('0x26')]()[_0xc008('0x25')](function(){var _0x2e31c2=_0x3f7b07['get']({'plain':!![]});var _0x5e2aca='Teams';return db['UserProfileResource']['destroy']({'where':{'type':_0x5e2aca,'resourceId':_0x2e31c2['id']}})[_0xc008('0x25')](function(){return _0x3f7b07;});})[_0xc008('0x25')](function(){_0x48582b[_0xc008('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24c14c,_0x32390d){return function(_0x209591){if(!_0x209591){_0x24c14c[_0xc008('0x1b')](0x194);}return _0x209591;};}function handleError(_0x4c5dec,_0xcdb32b){_0xcdb32b=_0xcdb32b||0x1f4;return function(_0x2e0b4e){logger['error'](_0x2e0b4e['stack']);if(_0x2e0b4e['name']){delete _0x2e0b4e[_0xc008('0x27')];}_0x4c5dec[_0xc008('0x1c')](_0xcdb32b)[_0xc008('0x28')](_0x2e0b4e);};}exports[_0xc008('0x29')]=function(_0x1de04b,_0xceebc3){var _0x294f97={},_0x22d8e8={},_0x1fe1e1={'count':0x0,'rows':[]};var _0x2b862d=_[_0xc008('0x2a')](db[_0xc008('0x2b')]['rawAttributes'],function(_0x334a09){return{'name':_0x334a09[_0xc008('0x2c')],'type':_0x334a09['type'][_0xc008('0x2d')]};});_0x22d8e8[_0xc008('0x2e')]=_[_0xc008('0x2a')](_0x2b862d,_0xc008('0x27'));_0x22d8e8[_0xc008('0x2f')]=_[_0xc008('0x30')](_0x1de04b[_0xc008('0x2f')]);_0x22d8e8[_0xc008('0x31')]=_[_0xc008('0x32')](_0x22d8e8['model'],_0x22d8e8[_0xc008('0x2f')]);_0x294f97[_0xc008('0x33')]=_[_0xc008('0x32')](_0x22d8e8[_0xc008('0x2e')],qs[_0xc008('0x34')](_0x1de04b[_0xc008('0x2f')][_0xc008('0x34')]));_0x294f97['attributes']=_0x294f97[_0xc008('0x33')][_0xc008('0x35')]?_0x294f97['attributes']:_0x22d8e8[_0xc008('0x2e')];if(!_0x1de04b[_0xc008('0x2f')]['hasOwnProperty'](_0xc008('0x36'))){_0x294f97[_0xc008('0x37')]=qs[_0xc008('0x37')](_0x1de04b['query']['limit']);_0x294f97['offset']=qs[_0xc008('0x1e')](_0x1de04b['query'][_0xc008('0x1e')]);}_0x294f97[_0xc008('0x38')]=qs[_0xc008('0x39')](_0x1de04b[_0xc008('0x2f')][_0xc008('0x39')]);_0x294f97[_0xc008('0x3a')]=qs[_0xc008('0x31')](_[_0xc008('0x3b')](_0x1de04b[_0xc008('0x2f')],_0x22d8e8[_0xc008('0x31')]),_0x2b862d);if(_0x1de04b[_0xc008('0x2f')][_0xc008('0x3c')]){_0x294f97[_0xc008('0x3a')]=_[_0xc008('0x3d')](_0x294f97['where'],{'$or':_[_0xc008('0x2a')](_0x2b862d,function(_0x23c4db){if(_0x23c4db[_0xc008('0x3e')]!==_0xc008('0x3f')){var _0x49a16d={};_0x49a16d[_0x23c4db[_0xc008('0x27')]]={'$like':'%'+_0x1de04b[_0xc008('0x2f')][_0xc008('0x3c')]+'%'};return _0x49a16d;}})});}_0x294f97=_[_0xc008('0x3d')]({},_0x294f97,_0x1de04b[_0xc008('0x40')]);var _0x5706bb={'where':_0x294f97[_0xc008('0x3a')]};return db[_0xc008('0x2b')][_0xc008('0x41')](_0x5706bb)[_0xc008('0x25')](function(_0x7279e8){_0x1fe1e1['count']=_0x7279e8;if(_0x1de04b[_0xc008('0x2f')][_0xc008('0x42')]){_0x294f97[_0xc008('0x43')]=[{'all':!![]}];}return db[_0xc008('0x2b')]['findAll'](_0x294f97);})[_0xc008('0x25')](function(_0xe37446){_0x1fe1e1[_0xc008('0x44')]=_0xe37446;return _0x1fe1e1;})['then'](respondWithFilteredResult(_0xceebc3,_0x294f97))[_0xc008('0x45')](handleError(_0xceebc3,null));};exports['show']=function(_0x3dd097,_0x5d3a72){var _0x46fa8f={'raw':![],'where':{'id':_0x3dd097['params']['id']}},_0x213014={};_0x213014[_0xc008('0x2e')]=_[_0xc008('0x30')](db[_0xc008('0x2b')]['rawAttributes']);_0x213014[_0xc008('0x2f')]=_[_0xc008('0x30')](_0x3dd097[_0xc008('0x2f')]);_0x213014[_0xc008('0x31')]=_[_0xc008('0x32')](_0x213014[_0xc008('0x2e')],_0x213014['query']);_0x46fa8f['attributes']=_['intersection'](_0x213014[_0xc008('0x2e')],qs[_0xc008('0x34')](_0x3dd097[_0xc008('0x2f')][_0xc008('0x34')]));_0x46fa8f[_0xc008('0x33')]=_0x46fa8f[_0xc008('0x33')][_0xc008('0x35')]?_0x46fa8f[_0xc008('0x33')]:_0x213014['model'];if(_0x3dd097['query']['includeAll']){_0x46fa8f[_0xc008('0x43')]=[{'all':!![]}];}_0x46fa8f=_[_0xc008('0x3d')]({},_0x46fa8f,_0x3dd097[_0xc008('0x40')]);return db['Team'][_0xc008('0x46')](_0x46fa8f)[_0xc008('0x25')](handleEntityNotFound(_0x5d3a72,null))[_0xc008('0x25')](respondWithResult(_0x5d3a72,null))[_0xc008('0x45')](handleError(_0x5d3a72,null));};exports[_0xc008('0x47')]=function(_0x56e4ac,_0x17ec90){return db[_0xc008('0x2b')][_0xc008('0x47')](_0x56e4ac[_0xc008('0x48')],{})['then'](function(_0x4c63d4){var _0x223056=_0x56e4ac['user'][_0xc008('0x49')]({'plain':!![]});if(!_0x223056)throw new Error(_0xc008('0x4a'));if(_0x223056[_0xc008('0x4b')]==='user'){var _0x144ab2=_0x4c63d4[_0xc008('0x49')]({'plain':!![]});var _0xee64=_0xc008('0x4c');return db[_0xc008('0x4d')]['find']({'where':{'name':_0xee64,'userProfileId':_0x223056[_0xc008('0x4e')]},'raw':!![]})[_0xc008('0x25')](function(_0x4b4c6d){if(_0x4b4c6d&&_0x4b4c6d[_0xc008('0x4f')]===0x0){return db[_0xc008('0x50')]['create']({'name':_0x144ab2['name'],'resourceId':_0x144ab2['id'],'type':_0x4b4c6d[_0xc008('0x27')],'sectionId':_0x4b4c6d['id']},{})[_0xc008('0x25')](function(){return _0x4c63d4;});}else{return _0x4c63d4;}})[_0xc008('0x45')](function(_0x30d0aa){logger[_0xc008('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x30d0aa);throw _0x30d0aa;});}return _0x4c63d4;})['then'](respondWithResult(_0x17ec90,0xc9))[_0xc008('0x45')](handleError(_0x17ec90,null));};exports['update']=function(_0x3d7cce,_0x25d351){if(_0x3d7cce[_0xc008('0x48')]['id']){delete _0x3d7cce[_0xc008('0x48')]['id'];}return db[_0xc008('0x2b')][_0xc008('0x46')]({'where':{'id':_0x3d7cce['params']['id']}})[_0xc008('0x25')](handleEntityNotFound(_0x25d351,null))[_0xc008('0x25')](saveUpdates(_0x3d7cce[_0xc008('0x48')],null))[_0xc008('0x25')](respondWithResult(_0x25d351,null))[_0xc008('0x45')](handleError(_0x25d351,null));};exports['destroy']=function(_0x41fae3,_0x4fdab4){return db['Team']['find']({'where':{'id':_0x41fae3[_0xc008('0x52')]['id']}})[_0xc008('0x25')](handleEntityNotFound(_0x4fdab4,null))[_0xc008('0x25')](removeEntity(_0x4fdab4,null))['catch'](handleError(_0x4fdab4,null));};exports[_0xc008('0x53')]=function(_0x2d8361,_0x3dda82,_0x47a58b){return db[_0xc008('0x2b')][_0xc008('0x54')]({'where':{'id':_0x2d8361[_0xc008('0x52')]['id']}})[_0xc008('0x25')](handleEntityNotFound(_0x3dda82,null))['then'](function(_0x4022dd){if(!_0x2d8361['query'][_0xc008('0x55')]||!utils[_0xc008('0x56')](_0x2d8361[_0xc008('0x2f')][_0xc008('0x55')])){throw new db[(_0xc008('0x57'))][(_0xc008('0x58'))]('Unknown\x20channel');}var _0x375e71={};var _0x570001={};_0x570001['model']=_[_0xc008('0x30')](db[_[_0xc008('0x59')](_0x2d8361['query'][_0xc008('0x55')][_0xc008('0x5a')]())+_0xc008('0x5b')][_0xc008('0x5c')]);_0x570001[_0xc008('0x2f')]=_[_0xc008('0x30')](_0x2d8361[_0xc008('0x2f')]);_0x570001['filters']=_[_0xc008('0x32')](_0x570001[_0xc008('0x2e')],_0x570001[_0xc008('0x2f')]);_0x375e71[_0xc008('0x33')]=_[_0xc008('0x32')](_0x570001[_0xc008('0x2e')],qs[_0xc008('0x34')](_0x2d8361[_0xc008('0x2f')][_0xc008('0x34')]));_0x375e71[_0xc008('0x33')]=_0x375e71[_0xc008('0x33')][_0xc008('0x35')]?_0x375e71[_0xc008('0x33')]:_0x570001[_0xc008('0x2e')];_0x375e71['limit']=qs[_0xc008('0x37')](_0x2d8361[_0xc008('0x2f')][_0xc008('0x37')]);_0x375e71['offset']=qs[_0xc008('0x1e')](_0x2d8361[_0xc008('0x2f')]['offset']);_0x375e71['order']=qs[_0xc008('0x39')](_0x2d8361[_0xc008('0x2f')][_0xc008('0x39')]);_0x375e71[_0xc008('0x3a')]=qs[_0xc008('0x31')](_[_0xc008('0x3b')](_0x2d8361[_0xc008('0x2f')],_0x570001[_0xc008('0x31')]));_0x375e71=_[_0xc008('0x3d')]({},_0x375e71,_0x2d8361[_0xc008('0x40')]);return _0x4022dd[_0xc008('0x49')+_['capitalize'](_0x2d8361[_0xc008('0x2f')][_0xc008('0x55')][_0xc008('0x5a')]())+_0xc008('0x5d')](_0x375e71);})['then'](respondWithResult(_0x3dda82,null))[_0xc008('0x45')](handleError(_0x3dda82,null));};exports['addQueues']=function(_0x3a1de5,_0x46fa7b,_0x419257){return db['Team'][_0xc008('0x54')]({'where':{'id':_0x3a1de5[_0xc008('0x52')]['id']}})[_0xc008('0x25')](function(_0x553f5c){if(_0x553f5c){if(!_0x3a1de5[_0xc008('0x48')]['channel']||!utils[_0xc008('0x56')](_0x3a1de5[_0xc008('0x48')][_0xc008('0x55')])){throw new db[(_0xc008('0x57'))][(_0xc008('0x58'))]('Unknown\x20channel');}return _0x553f5c[_0xc008('0x5e')+_[_0xc008('0x59')](_0x3a1de5['body'][_0xc008('0x55')]['toLowerCase']())+_0xc008('0x5d')](_0x3a1de5['body'][_0xc008('0x5f')]);}return null;})['then'](handleEntityNotFound(_0x46fa7b,null))[_0xc008('0x25')](respondWithStatusCode(_0x46fa7b,null))[_0xc008('0x45')](handleError(_0x46fa7b,null));};exports[_0xc008('0x60')]=function(_0x47337b,_0x5a94ff,_0x57752c){return db[_0xc008('0x2b')][_0xc008('0x54')]({'where':{'id':_0x47337b[_0xc008('0x52')]['id']}})[_0xc008('0x25')](function(_0x13ef78){if(_0x13ef78){if(!_0x47337b[_0xc008('0x2f')][_0xc008('0x55')]||!utils['isValidChannel'](_0x47337b[_0xc008('0x2f')]['channel'])){throw new db['Sequelize']['ValidationError'](_0xc008('0x61'));}return _0x13ef78[_0xc008('0x62')+_[_0xc008('0x59')](_0x47337b[_0xc008('0x2f')][_0xc008('0x55')][_0xc008('0x5a')]())+_0xc008('0x5d')](_0x47337b[_0xc008('0x2f')][_0xc008('0x5f')]);}return null;})['then'](handleEntityNotFound(_0x5a94ff,null))[_0xc008('0x25')](respondWithStatusCode(_0x5a94ff,null))[_0xc008('0x45')](handleError(_0x5a94ff,null));};exports[_0xc008('0x63')]=function(_0x15fe9b,_0xc9f3f4){var _0x3b2669=_[_0xc008('0x64')](_0x15fe9b[_0xc008('0x48')][_0xc008('0x5f')])?_0x15fe9b[_0xc008('0x48')][_0xc008('0x5f')]:[_0x15fe9b[_0xc008('0x48')]['ids']];var _0x4e7af3=_0x15fe9b[_0xc008('0x52')]['id'];return db[_0xc008('0x2b')][_0xc008('0x46')]({'where':{'id':_0x4e7af3}})['then'](handleEntityNotFound(_0xc9f3f4,null))[_0xc008('0x25')](function(_0x312fa9){if(_0x312fa9){var _0x4ed54b=['Voice','Chat',_0xc008('0x65'),_0xc008('0x66'),_0xc008('0x67'),_0xc008('0x68'),_0xc008('0x69')];return db[_0xc008('0x6a')][_0xc008('0x6b')](function(_0x43ba59){var _0x1161e6=_[_0xc008('0x2a')](_0x4ed54b,function(_0x52091b){var _0x57b8ad={'attributes':['id',_0xc008('0x27')]};if(_0x52091b===_0xc008('0x6c')){_0x57b8ad[_0xc008('0x6d')]={'attributes':[_0xc008('0x6e')]};}return _0x312fa9[_0xc008('0x49')+_0x52091b+_0xc008('0x5d')](_0x57b8ad)['then'](function(_0x5794fe){var _0x68372f=_[_0xc008('0x2a')](_0x5794fe,function(_0x33e130){var _0x558105=_['map'](_0x3b2669,function(_0x5df713){var _0x505061={'where':{'UserId':_0x5df713,[_0x52091b+'QueueId']:_0x33e130['id']},'transaction':_0x43ba59};if(_0x52091b==='Voice'){_0x505061[_0xc008('0x19')]={'penalty':_0x33e130['TeamVoiceQueue'][_0xc008('0x6e')]};}return db['User'+_0x52091b+_0xc008('0x5b')][_0xc008('0x6f')](_0x505061)[_0xc008('0x25')](function(){socket['emit']('user'+_0x52091b+_0xc008('0x70'),{'UserId':_0x5df713,[_0x52091b+'QueueId']:_0x33e130['id']});if(_0x52091b!==_0xc008('0x6c')){return;}return db[_0xc008('0x71')]['findAll']({'where':{'id':_0x3b2669,'online':0x1},'attributes':['id',_0xc008('0x27'),'online','voicePause',_0xc008('0x72')],'raw':!![]})[_0xc008('0x25')](function(_0x48de26){var _0x37d382=_[_0xc008('0x2a')](_0x48de26,function(_0x39ccf2){return db['UserVoiceQueueRt'][_0xc008('0x73')]({'membername':_0x39ccf2[_0xc008('0x27')],'UserId':_0x39ccf2['id'],'queue_name':_0x33e130[_0xc008('0x27')],'VoiceQueueId':_0x33e130['id'],'interface':_[_0xc008('0x74')](_0x39ccf2[_0xc008('0x72')])?util[_0xc008('0x75')]('SIP/%s',_0x39ccf2[_0xc008('0x27')]):_0x39ccf2[_0xc008('0x72')],'paused':_0x39ccf2[_0xc008('0x76')]||![],'penalty':_0x33e130['TeamVoiceQueue'][_0xc008('0x6e')]},{'transaction':_0x43ba59});});return Promise[_0xc008('0x77')](_0x37d382);});});});return Promise[_0xc008('0x77')](_0x558105);});return Promise['all'](_0x68372f);})['then'](function(){return db['TeamVoicePrefix'][_0xc008('0x54')]({'where':{'teamId':_0x4e7af3}})[_0xc008('0x25')](function(_0x91ecdf){if(_0x91ecdf){var _0x3c5da1=_[_0xc008('0x2a')](_0x3b2669,function(_0xac0fc7){db[_0xc008('0x78')][_0xc008('0x73')]({'UserId':_0xac0fc7,'VoicePrefixId':_0x91ecdf['VoicePrefixId']});});return Promise[_0xc008('0x77')](_0x3c5da1);}});});});return Promise[_0xc008('0x77')](_0x1161e6)['then'](function(){return _0x312fa9['addAgents'](_0x3b2669,{'transaction':_0x43ba59})[_0xc008('0x79')](function(_0x128123){return _0x128123;});});});}})[_0xc008('0x25')](respondWithResult(_0xc9f3f4,null))[_0xc008('0x45')](handleError(_0xc9f3f4,null));};exports[_0xc008('0x7a')]=function(_0x49e822,_0xe988da){var _0x1515bb=_['isArray'](_0x49e822[_0xc008('0x2f')][_0xc008('0x5f')])?_0x49e822[_0xc008('0x2f')][_0xc008('0x5f')]:[_0x49e822['query'][_0xc008('0x5f')]];var _0x2d42e0=_0x49e822[_0xc008('0x52')]['id'];return db[_0xc008('0x2b')]['find']({'where':{'id':_0x2d42e0}})[_0xc008('0x25')](handleEntityNotFound(_0xe988da,null))[_0xc008('0x25')](function(_0x57cf19){if(_0x57cf19){var _0x555e8a=[_0xc008('0x6c'),'Chat',_0xc008('0x65'),_0xc008('0x66'),'Fax',_0xc008('0x68'),_0xc008('0x69')];return db[_0xc008('0x6a')][_0xc008('0x6b')](function(_0x3c335f){var _0x1cbd0c=_[_0xc008('0x2a')](_0x555e8a,function(_0x2b2bfb){var _0x357043={'attributes':['id',_0xc008('0x27')]};return _0x57cf19['get'+_0x2b2bfb+'Queues'](_0x357043)[_0xc008('0x25')](function(_0x3d6f70){var _0x4d07d2=_[_0xc008('0x2a')](_0x3d6f70,function(_0x1bdaa9){return _0x1bdaa9[_0xc008('0x7a')](_0x1515bb,{'transaction':_0x3c335f})['then'](function(){var _0x303cdd=_[_0xc008('0x2a')](_0x1515bb,function(_0x399661){socket[_0xc008('0x7b')](_0xc008('0x7c')+_0x2b2bfb+_0xc008('0x7d'),{'UserId':Number(_0x399661),[_0x2b2bfb+_0xc008('0x7e')]:_0x1bdaa9['id']});if(_0x2b2bfb!=='Voice'){return;}return db[_0xc008('0x7f')]['destroy']({'where':{'VoiceQueueId':_0x1bdaa9['id'],'UserId':_0x399661},'transaction':_0x3c335f});});return Promise[_0xc008('0x77')](_0x303cdd);});});return Promise[_0xc008('0x77')](_0x4d07d2);});});return Promise[_0xc008('0x77')](_0x1cbd0c)['then'](function(){return _0x57cf19[_0xc008('0x7a')](_0x1515bb,{'transaction':_0x3c335f});})[_0xc008('0x25')](function(){return db[_0xc008('0x80')][_0xc008('0x54')]({'where':{'teamId':_0x2d42e0}})[_0xc008('0x25')](function(_0x729d48){if(_0x729d48){var _0x872247=_[_0xc008('0x2a')](_0x1515bb,function(_0x475678){db[_0xc008('0x78')]['destroy']({'where':{'UserId':_0x475678,'VoicePrefixId':_0x729d48[_0xc008('0x81')]}});});return Promise[_0xc008('0x77')](_0x872247);}});});});}})[_0xc008('0x25')](respondWithStatusCode(_0xe988da,null))[_0xc008('0x45')](handleError(_0xe988da,null));};exports[_0xc008('0x82')]=function(_0x5d7db6,_0x37da13,_0x3dd13f){var _0x36a581={};var _0x2e5494={};var _0x204692;var _0x2503d2;return db[_0xc008('0x2b')][_0xc008('0x54')]({'where':{'id':_0x5d7db6[_0xc008('0x52')]['id']}})[_0xc008('0x25')](handleEntityNotFound(_0x37da13,null))[_0xc008('0x25')](function(_0x27e3fc){if(_0x27e3fc){_0x204692=_0x27e3fc;_0x2e5494[_0xc008('0x2e')]=_[_0xc008('0x30')](db[_0xc008('0x71')]['rawAttributes']);_0x2e5494['query']=_[_0xc008('0x30')](_0x5d7db6[_0xc008('0x2f')]);_0x2e5494[_0xc008('0x31')]=_[_0xc008('0x32')](_0x2e5494[_0xc008('0x2e')],_0x2e5494[_0xc008('0x2f')]);_0x36a581[_0xc008('0x33')]=_[_0xc008('0x32')](_0x2e5494[_0xc008('0x2e')],qs['fields'](_0x5d7db6[_0xc008('0x2f')][_0xc008('0x34')]));_0x36a581['attributes']=_0x36a581[_0xc008('0x33')][_0xc008('0x35')]?_0x36a581[_0xc008('0x33')]:_0x2e5494[_0xc008('0x2e')];_0x36a581[_0xc008('0x38')]=qs[_0xc008('0x39')](_0x5d7db6['query'][_0xc008('0x39')]);_0x36a581[_0xc008('0x3a')]=qs[_0xc008('0x31')](_[_0xc008('0x3b')](_0x5d7db6['query'],_0x2e5494[_0xc008('0x31')]));if(_0x5d7db6['query'][_0xc008('0x3c')]){_0x36a581[_0xc008('0x3a')]=_['merge'](_0x36a581[_0xc008('0x3a')],{'$or':_['map'](_0x36a581[_0xc008('0x33')],function(_0x4cb7d7){var _0x5b387d={};_0x5b387d[_0x4cb7d7]={'$like':'%'+_0x5d7db6['query'][_0xc008('0x3c')]+'%'};return _0x5b387d;})});}_0x36a581=_[_0xc008('0x3d')]({},_0x36a581,_0x5d7db6['options']);return _0x204692[_0xc008('0x82')](_0x36a581);}})[_0xc008('0x25')](function(_0x4a7692){if(_0x4a7692){_0x2503d2=_0x4a7692[_0xc008('0x35')];if(!_0x5d7db6[_0xc008('0x2f')][_0xc008('0x83')]('nolimit')){_0x36a581[_0xc008('0x37')]=qs[_0xc008('0x37')](_0x5d7db6[_0xc008('0x2f')][_0xc008('0x37')]);_0x36a581[_0xc008('0x1e')]=qs[_0xc008('0x1e')](_0x5d7db6[_0xc008('0x2f')][_0xc008('0x1e')]);}return _0x204692[_0xc008('0x82')](_0x36a581);}})[_0xc008('0x25')](function(_0x427fd2){if(_0x427fd2){return _0x427fd2?{'count':_0x2503d2,'rows':_0x427fd2}:null;}})['then'](respondWithResult(_0x37da13,null))[_0xc008('0x45')](handleError(_0x37da13,null));};
\ No newline at end of file
index 5e7c848..0187768 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa36e=['remove','emit','hook','exports','../../mysqldb','Team','setMaxListeners','save','update'];(function(_0x200dbd,_0x2d0e00){var _0x17b9bb=function(_0x351ca9){while(--_0x351ca9){_0x200dbd['push'](_0x200dbd['shift']());}};_0x17b9bb(++_0x2d0e00);}(_0xa36e,0xee));var _0xea36=function(_0x282ba3,_0x336593){_0x282ba3=_0x282ba3-0x0;var _0x4d454b=_0xa36e[_0x282ba3];return _0x4d454b;};'use strict';var EventEmitter=require('events');var Team=require(_0xea36('0x0'))['db'][_0xea36('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xea36('0x2')](0x0);var events={'afterCreate':_0xea36('0x3'),'afterUpdate':_0xea36('0x4'),'afterDestroy':_0xea36('0x5')};function emitEvent(_0x3dc011){return function(_0xb52a07,_0x865628,_0x430c24){TeamEvents[_0xea36('0x6')](_0x3dc011+':'+_0xb52a07['id'],_0xb52a07);TeamEvents['emit'](_0x3dc011,_0xb52a07);_0x430c24(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0xea36('0x7')](e,emitEvent(event));}}module[_0xea36('0x8')]=TeamEvents;
\ No newline at end of file
+var _0x1063=['hasOwnProperty','events','../../mysqldb','setMaxListeners','update','emit'];(function(_0x2a54fc,_0x5efd08){var _0x39b838=function(_0x28714f){while(--_0x28714f){_0x2a54fc['push'](_0x2a54fc['shift']());}};_0x39b838(++_0x5efd08);}(_0x1063,0x151));var _0x3106=function(_0x3decb1,_0x42b930){_0x3decb1=_0x3decb1-0x0;var _0x11a70b=_0x1063[_0x3decb1];return _0x11a70b;};'use strict';var EventEmitter=require(_0x3106('0x0'));var Team=require(_0x3106('0x1'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x3106('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3106('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4b13d6){return function(_0x471218,_0x14c42b,_0x263163){TeamEvents[_0x3106('0x4')](_0x4b13d6+':'+_0x471218['id'],_0x471218);TeamEvents[_0x3106('0x4')](_0x4b13d6,_0x471218);_0x263163(null);};}for(var e in events){if(events[_0x3106('0x5')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module['exports']=TeamEvents;
\ No newline at end of file
index d044b6e..b8d272b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x126b=['bluebird','request-promise','path','rimraf','./team.attributes','exports','define','Team','teams','lodash','util','../../config/logger','api'];(function(_0x43caa2,_0x1ffb73){var _0x51b342=function(_0x288f85){while(--_0x288f85){_0x43caa2['push'](_0x43caa2['shift']());}};_0x51b342(++_0x1ffb73);}(_0x126b,0x1b6));var _0xb126=function(_0xe16058,_0x1b1898){_0xe16058=_0xe16058-0x0;var _0xc80b5b=_0x126b[_0xe16058];return _0xc80b5b;};'use strict';var _=require(_0xb126('0x0'));var util=require(_0xb126('0x1'));var logger=require(_0xb126('0x2'))(_0xb126('0x3'));var moment=require('moment');var BPromise=require(_0xb126('0x4'));var rp=require(_0xb126('0x5'));var fs=require('fs');var path=require(_0xb126('0x6'));var rimraf=require(_0xb126('0x7'));var config=require('../../config/environment');var attributes=require(_0xb126('0x8'));module[_0xb126('0x9')]=function(_0x444474,_0x404eb0){return _0x444474[_0xb126('0xa')](_0xb126('0xb'),attributes,{'tableName':_0xb126('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xad57=['../../config/logger','moment','request-promise','rimraf','../../config/environment','exports','define','teams','util'];(function(_0x369bf2,_0x357db8){var _0x2a79f9=function(_0x328c54){while(--_0x328c54){_0x369bf2['push'](_0x369bf2['shift']());}};_0x2a79f9(++_0x357db8);}(_0xad57,0xe9));var _0x7ad5=function(_0x32ad39,_0x397d2d){_0x32ad39=_0x32ad39-0x0;var _0x4d4db2=_0xad57[_0x32ad39];return _0x4d4db2;};'use strict';var _=require('lodash');var util=require(_0x7ad5('0x0'));var logger=require(_0x7ad5('0x1'))('api');var moment=require(_0x7ad5('0x2'));var BPromise=require('bluebird');var rp=require(_0x7ad5('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7ad5('0x4'));var config=require(_0x7ad5('0x5'));var attributes=require('./team.attributes');module[_0x7ad5('0x6')]=function(_0x3b201c,_0x83b6c9){return _0x3b201c[_0x7ad5('0x7')]('Team',attributes,{'tableName':_0x7ad5('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 24e575b..da6e6b4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a64=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3bb0db,_0x203203){var _0x22b0d7=function(_0x2a752b){while(--_0x2a752b){_0x3bb0db['push'](_0x3bb0db['shift']());}};_0x22b0d7(++_0x203203);}(_0x1a64,0x1d6));var _0x41a6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1a64[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x41a6('0x0'));var util=require(_0x41a6('0x1'));var moment=require(_0x41a6('0x2'));var BPromise=require(_0x41a6('0x3'));var rs=require(_0x41a6('0x4'));var fs=require('fs');var Redis=require(_0x41a6('0x5'));var db=require(_0x41a6('0x6'))['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'][_0x41a6('0x7')]({'port':0x232a});config[_0x41a6('0x8')]=_[_0x41a6('0x9')](config['redis'],{'host':_0x41a6('0xa'),'port':0x18eb});var socket=require(_0x41a6('0xb'))(new Redis(config['redis']));require(_0x41a6('0xc'))[_0x41a6('0xd')](socket);function respondWithRpcPromise(_0x4b7899,_0x539c69,_0x1b777c){return new BPromise(function(_0x2f3c74,_0x152c19){return client[_0x41a6('0xe')](_0x4b7899,_0x1b777c)[_0x41a6('0xf')](function(_0x5242a3){logger[_0x41a6('0x10')](_0x41a6('0x11'),_0x539c69,_0x41a6('0x12'));logger[_0x41a6('0x13')](_0x41a6('0x14'),_0x539c69,_0x41a6('0x12'),JSON[_0x41a6('0x15')](_0x5242a3));if(_0x5242a3['error']){if(_0x5242a3[_0x41a6('0x16')][_0x41a6('0x17')]===0x1f4){logger[_0x41a6('0x16')]('Team,\x20%s,\x20%s',_0x539c69,_0x5242a3[_0x41a6('0x16')]['message']);return _0x152c19(_0x5242a3[_0x41a6('0x16')]['message']);}logger[_0x41a6('0x16')](_0x41a6('0x11'),_0x539c69,_0x5242a3[_0x41a6('0x16')][_0x41a6('0x18')]);return _0x2f3c74(_0x5242a3[_0x41a6('0x16')]['message']);}else{logger[_0x41a6('0x10')](_0x41a6('0x11'),_0x539c69,_0x41a6('0x12'));_0x2f3c74(_0x5242a3['result'][_0x41a6('0x18')]);}})[_0x41a6('0x19')](function(_0x36e27d){logger['error'](_0x41a6('0x11'),_0x539c69,_0x36e27d);_0x152c19(_0x36e27d);});});}
\ No newline at end of file
+var _0x9ccf=['rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5e4b11,_0xf40479){var _0x43cead=function(_0x60ff65){while(--_0x60ff65){_0x5e4b11['push'](_0x5e4b11['shift']());}};_0x43cead(++_0xf40479);}(_0x9ccf,0x19a));var _0xf9cc=function(_0x53c18b,_0x5dd493){_0x53c18b=_0x53c18b-0x0;var _0x59b54e=_0x9ccf[_0x53c18b];return _0x59b54e;};'use strict';var _=require(_0xf9cc('0x0'));var util=require(_0xf9cc('0x1'));var moment=require('moment');var BPromise=require(_0xf9cc('0x2'));var rs=require(_0xf9cc('0x3'));var fs=require('fs');var Redis=require(_0xf9cc('0x4'));var db=require(_0xf9cc('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf9cc('0x6'));var config=require('../../config/environment');var jayson=require(_0xf9cc('0x7'));var client=jayson[_0xf9cc('0x8')]['http']({'port':0x232a});config['redis']=_[_0xf9cc('0x9')](config[_0xf9cc('0xa')],{'host':_0xf9cc('0xb'),'port':0x18eb});var socket=require(_0xf9cc('0xc'))(new Redis(config['redis']));require('./team.socket')[_0xf9cc('0xd')](socket);function respondWithRpcPromise(_0x4daa96,_0x2f863f,_0x324962){return new BPromise(function(_0x42964b,_0xce2a67){return client['request'](_0x4daa96,_0x324962)[_0xf9cc('0xe')](function(_0x183c84){logger[_0xf9cc('0xf')](_0xf9cc('0x10'),_0x2f863f,_0xf9cc('0x11'));logger[_0xf9cc('0x12')](_0xf9cc('0x13'),_0x2f863f,'request\x20sent',JSON[_0xf9cc('0x14')](_0x183c84));if(_0x183c84[_0xf9cc('0x15')]){if(_0x183c84[_0xf9cc('0x15')][_0xf9cc('0x16')]===0x1f4){logger['error']('Team,\x20%s,\x20%s',_0x2f863f,_0x183c84[_0xf9cc('0x15')]['message']);return _0xce2a67(_0x183c84[_0xf9cc('0x15')][_0xf9cc('0x17')]);}logger[_0xf9cc('0x15')]('Team,\x20%s,\x20%s',_0x2f863f,_0x183c84['error'][_0xf9cc('0x17')]);return _0x42964b(_0x183c84[_0xf9cc('0x15')][_0xf9cc('0x17')]);}else{logger['info']('Team,\x20%s,\x20%s',_0x2f863f,_0xf9cc('0x11'));_0x42964b(_0x183c84[_0xf9cc('0x18')]['message']);}})[_0xf9cc('0x19')](function(_0x21b6ee){logger[_0xf9cc('0x15')]('Team,\x20%s,\x20%s',_0x2f863f,_0x21b6ee);_0xce2a67(_0x21b6ee);});});}
\ No newline at end of file
index 4bdded5..22c145c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa83a=['emit','removeListener','register','team:','save','remove'];(function(_0x2f6e14,_0x1338a5){var _0x3faf04=function(_0x512036){while(--_0x512036){_0x2f6e14['push'](_0x2f6e14['shift']());}};_0x3faf04(++_0x1338a5);}(_0xa83a,0x88));var _0xaa83=function(_0x45a837,_0x5710da){_0x45a837=_0x45a837-0x0;var _0x4852be=_0xa83a[_0x45a837];return _0x4852be;};'use strict';var TeamEvents=require('./team.events');var events=[_0xaa83('0x0'),_0xaa83('0x1'),'update'];function createListener(_0x4b12fa,_0x17a8bd){return function(_0x1f3808){_0x17a8bd[_0xaa83('0x2')](_0x4b12fa,_0x1f3808);};}function removeListener(_0x46b692,_0x57f849){return function(){TeamEvents[_0xaa83('0x3')](_0x46b692,_0x57f849);};}exports[_0xaa83('0x4')]=function(_0x280637){for(var _0x9c332d=0x0,_0x31d733=events['length'];_0x9c332d<_0x31d733;_0x9c332d++){var _0x5d5a47=events[_0x9c332d];var _0x582edf=createListener(_0xaa83('0x5')+_0x5d5a47,_0x280637);TeamEvents['on'](_0x5d5a47,_0x582edf);}};
\ No newline at end of file
+var _0xcd54=['team:','./team.events','save','remove','removeListener','length'];(function(_0x4b8b7e,_0x29560e){var _0x442ef8=function(_0xdb5024){while(--_0xdb5024){_0x4b8b7e['push'](_0x4b8b7e['shift']());}};_0x442ef8(++_0x29560e);}(_0xcd54,0xaf));var _0x4cd5=function(_0x514f6d,_0x440554){_0x514f6d=_0x514f6d-0x0;var _0x1166cd=_0xcd54[_0x514f6d];return _0x1166cd;};'use strict';var TeamEvents=require(_0x4cd5('0x0'));var events=[_0x4cd5('0x1'),_0x4cd5('0x2'),'update'];function createListener(_0x51e2ed,_0x5d99f5){return function(_0x300739){_0x5d99f5['emit'](_0x51e2ed,_0x300739);};}function removeListener(_0x44bb25,_0xa7e4f4){return function(){TeamEvents[_0x4cd5('0x3')](_0x44bb25,_0xa7e4f4);};}exports['register']=function(_0x200f6d){for(var _0x2b8b4e=0x0,_0x9ad1a5=events[_0x4cd5('0x4')];_0x2b8b4e<_0x9ad1a5;_0x2b8b4e++){var _0x2e216a=events[_0x2b8b4e];var _0x5a9277=createListener(_0x4cd5('0x5')+_0x2e216a,_0x200f6d);TeamEvents['on'](_0x2e216a,_0x5a9277);}};
\ No newline at end of file
index cfac2d6..5670d97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8164=['exports','INTEGER','sequelize'];(function(_0x3c4848,_0xa78bb6){var _0x5f4039=function(_0x49e409){while(--_0x49e409){_0x3c4848['push'](_0x3c4848['shift']());}};_0x5f4039(++_0xa78bb6);}(_0x8164,0x170));var _0x4816=function(_0x3cd133,_0x222fcb){_0x3cd133=_0x3cd133-0x0;var _0x2512c8=_0x8164[_0x3cd133];return _0x2512c8;};'use strict';var Sequelize=require(_0x4816('0x0'));module[_0x4816('0x1')]={'TeamId':{'type':Sequelize[_0x4816('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x9bb4=['sequelize','exports','INTEGER'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x9bb4,0xd5));var _0x49bb=function(_0x3aded,_0x1665bf){_0x3aded=_0x3aded-0x0;var _0x249a68=_0x9bb4[_0x3aded];return _0x249a68;};'use strict';var Sequelize=require(_0x49bb('0x0'));module[_0x49bb('0x1')]={'TeamId':{'type':Sequelize[_0x49bb('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x49bb('0x2')]}};
\ No newline at end of file
index a773609..270500a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2fe5=['path','rimraf','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','moment','bluebird','request-promise'];(function(_0x152fe3,_0x12b0c8){var _0xc5bb39=function(_0x1fde42){while(--_0x1fde42){_0x152fe3['push'](_0x152fe3['shift']());}};_0xc5bb39(++_0x12b0c8);}(_0x2fe5,0x14b));var _0x52fe=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x2fe5[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x52fe('0x0'));var util=require(_0x52fe('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x52fe('0x2'));var BPromise=require(_0x52fe('0x3'));var rp=require(_0x52fe('0x4'));var fs=require('fs');var path=require(_0x52fe('0x5'));var rimraf=require(_0x52fe('0x6'));var config=require('../../config/environment');var attributes=require(_0x52fe('0x7'));module[_0x52fe('0x8')]=function(_0x584af7,_0x2efcaa){return _0x584af7[_0x52fe('0x9')](_0x52fe('0xa'),attributes,{'tableName':_0x52fe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x85de=['team_has_voice_prefixes','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./teamVoicePrefix.attributes','define','TeamVoicePrefix'];(function(_0x25f451,_0x5d3667){var _0xf614d4=function(_0x5cca65){while(--_0x5cca65){_0x25f451['push'](_0x25f451['shift']());}};_0xf614d4(++_0x5d3667);}(_0x85de,0x1f0));var _0xe85d=function(_0x350bd9,_0x7ee684){_0x350bd9=_0x350bd9-0x0;var _0x460756=_0x85de[_0x350bd9];return _0x460756;};'use strict';var _=require(_0xe85d('0x0'));var util=require(_0xe85d('0x1'));var logger=require(_0xe85d('0x2'))(_0xe85d('0x3'));var moment=require(_0xe85d('0x4'));var BPromise=require('bluebird');var rp=require(_0xe85d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe85d('0x6'));var attributes=require(_0xe85d('0x7'));module['exports']=function(_0x1e9dea,_0xb70e1d){return _0x1e9dea[_0xe85d('0x8')](_0xe85d('0x9'),attributes,{'tableName':_0xe85d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index f553189..e6971da 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(_0x12b532,_0x5582a6){var _0x1dcc33=function(_0x36471b){while(--_0x36471b){_0x12b532['push'](_0x12b532['shift']());}};_0x1dcc33(++_0x5582a6);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router;
\ No newline at end of file
+var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x3b5a94,_0x1ea788){var _0x5b5c19=function(_0x243fd8){while(--_0x243fd8){_0x3b5a94['push'](_0x3b5a94['shift']());}};_0x5b5c19(++_0x1ea788);}(_0xe706,0xa3));var _0x6e70=function(_0x2f831f,_0x412036){_0x2f831f=_0x2f831f-0x0;var _0x245a02=_0xe706[_0x2f831f];return _0x245a02;};'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 9c6b626..73f0a71 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8e18=['exports'];(function(_0x172b7b,_0x1ea56a){var _0x30e2cb=function(_0x4d2f02){while(--_0x4d2f02){_0x172b7b['push'](_0x172b7b['shift']());}};_0x30e2cb(++_0x1ea56a);}(_0x8e18,0x1ba));var _0x88e1=function(_0x39d13c,_0x49a880){_0x39d13c=_0x39d13c-0x0;var _0xf69c4f=_0x8e18[_0x39d13c];return _0xf69c4f;};'use strict';var Sequelize=require('sequelize');module[_0x88e1('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x1224=['INTEGER','exports'];(function(_0x5aab5b,_0x531c7a){var _0x211ac9=function(_0x521006){while(--_0x521006){_0x5aab5b['push'](_0x5aab5b['shift']());}};_0x211ac9(++_0x531c7a);}(_0x1224,0x197));var _0x4122=function(_0x247ca4,_0x1e7ec5){_0x247ca4=_0x247ca4-0x0;var _0x432c92=_0x1224[_0x247ca4];return _0x432c92;};'use strict';var Sequelize=require('sequelize');module[_0x4122('0x0')]={'penalty':{'type':Sequelize[_0x4122('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 5f8191a..ece25df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1738=['exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','moment','bluebird','request-promise','../../config/environment','./teamVoiceQueue.attributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1738,0x1bc));var _0x8173=function(_0x599a76,_0x2274cd){_0x599a76=_0x599a76-0x0;var _0x585753=_0x1738[_0x599a76];return _0x585753;};'use strict';var _=require(_0x8173('0x0'));var util=require(_0x8173('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8173('0x2'));var BPromise=require(_0x8173('0x3'));var rp=require(_0x8173('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8173('0x5'));var attributes=require(_0x8173('0x6'));module[_0x8173('0x7')]=function(_0x3cf9ac,_0x2220fd){return _0x3cf9ac[_0x8173('0x8')](_0x8173('0x9'),attributes,{'tableName':_0x8173('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7333=['define','TeamVoiceQueue','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./teamVoiceQueue.attributes'];(function(_0x5b64dd,_0xe99940){var _0x135c17=function(_0xfaded1){while(--_0xfaded1){_0x5b64dd['push'](_0x5b64dd['shift']());}};_0x135c17(++_0xe99940);}(_0x7333,0xfc));var _0x3733=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x7333[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x3733('0x0'));var util=require('util');var logger=require(_0x3733('0x1'))('api');var moment=require(_0x3733('0x2'));var BPromise=require(_0x3733('0x3'));var rp=require(_0x3733('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3733('0x5'));var config=require(_0x3733('0x6'));var attributes=require(_0x3733('0x7'));module['exports']=function(_0xa51fdb,_0x27c9b7){return _0xa51fdb[_0x3733('0x8')](_0x3733('0x9'),attributes,{'tableName':'team_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 06df734..03bfb43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfccd=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring'];(function(_0x5a85fa,_0x11b386){var _0x5053d2=function(_0x406682){while(--_0x406682){_0x5a85fa['push'](_0x5a85fa['shift']());}};_0x5053d2(++_0x11b386);}(_0xfccd,0xc2));var _0xdfcc=function(_0x4f9baf,_0x17a0a1){_0x4f9baf=_0x4f9baf-0x0;var _0x5dd2dd=_0xfccd[_0x4f9baf];return _0x5dd2dd;};'use strict';var _=require(_0xdfcc('0x0'));var util=require(_0xdfcc('0x1'));var moment=require(_0xdfcc('0x2'));var BPromise=require('bluebird');var rs=require(_0xdfcc('0x3'));var fs=require('fs');var Redis=require(_0xdfcc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdfcc('0x5'));var logger=require(_0xdfcc('0x6'))('rpc');var config=require(_0xdfcc('0x7'));var jayson=require(_0xdfcc('0x8'));var client=jayson[_0xdfcc('0x9')][_0xdfcc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1be107,_0x4217e9,_0x1668fe){return new BPromise(function(_0x521846,_0x568a99){return client[_0xdfcc('0xb')](_0x1be107,_0x1668fe)[_0xdfcc('0xc')](function(_0x1286f0){logger[_0xdfcc('0xd')](_0xdfcc('0xe'),_0x4217e9,_0xdfcc('0xf'));logger[_0xdfcc('0x10')](_0xdfcc('0x11'),_0x4217e9,_0xdfcc('0xf'),JSON['stringify'](_0x1286f0));if(_0x1286f0['error']){if(_0x1286f0[_0xdfcc('0x12')][_0xdfcc('0x13')]===0x1f4){logger[_0xdfcc('0x12')](_0xdfcc('0xe'),_0x4217e9,_0x1286f0[_0xdfcc('0x12')][_0xdfcc('0x14')]);return _0x568a99(_0x1286f0[_0xdfcc('0x12')][_0xdfcc('0x14')]);}logger[_0xdfcc('0x12')](_0xdfcc('0xe'),_0x4217e9,_0x1286f0[_0xdfcc('0x12')]['message']);return _0x521846(_0x1286f0['error'][_0xdfcc('0x14')]);}else{logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0x4217e9,_0xdfcc('0xf'));_0x521846(_0x1286f0[_0xdfcc('0x15')][_0xdfcc('0x14')]);}})['catch'](function(_0x4daa65){logger[_0xdfcc('0x12')]('TeamVoiceQueue,\x20%s,\x20%s',_0x4217e9,_0x4daa65);_0x568a99(_0x4daa65);});});}
\ No newline at end of file
+var _0xf6c6=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf6c6,0x154));var _0x6f6c=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xf6c6[_0x87b0ff];return _0x3bc0b2;};'use strict';var _=require('lodash');var util=require(_0x6f6c('0x0'));var moment=require('moment');var BPromise=require(_0x6f6c('0x1'));var rs=require(_0x6f6c('0x2'));var fs=require('fs');var Redis=require(_0x6f6c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6f6c('0x4'));var logger=require(_0x6f6c('0x5'))(_0x6f6c('0x6'));var config=require('../../config/environment');var jayson=require(_0x6f6c('0x7'));var client=jayson[_0x6f6c('0x8')][_0x6f6c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40a1c0,_0x3feb60,_0x1999c6){return new BPromise(function(_0x3cb15a,_0x2ef627){return client[_0x6f6c('0xa')](_0x40a1c0,_0x1999c6)[_0x6f6c('0xb')](function(_0x44bb26){logger[_0x6f6c('0xc')](_0x6f6c('0xd'),_0x3feb60,_0x6f6c('0xe'));logger[_0x6f6c('0xf')](_0x6f6c('0x10'),_0x3feb60,_0x6f6c('0xe'),JSON[_0x6f6c('0x11')](_0x44bb26));if(_0x44bb26['error']){if(_0x44bb26[_0x6f6c('0x12')][_0x6f6c('0x13')]===0x1f4){logger['error'](_0x6f6c('0xd'),_0x3feb60,_0x44bb26[_0x6f6c('0x12')]['message']);return _0x2ef627(_0x44bb26['error'][_0x6f6c('0x14')]);}logger[_0x6f6c('0x12')](_0x6f6c('0xd'),_0x3feb60,_0x44bb26[_0x6f6c('0x12')]['message']);return _0x3cb15a(_0x44bb26['error'][_0x6f6c('0x14')]);}else{logger[_0x6f6c('0xc')](_0x6f6c('0xd'),_0x3feb60,_0x6f6c('0xe'));_0x3cb15a(_0x44bb26[_0x6f6c('0x15')][_0x6f6c('0x14')]);}})[_0x6f6c('0x16')](function(_0x282b7f){logger[_0x6f6c('0x12')](_0x6f6c('0xd'),_0x3feb60,_0x282b7f);_0x2ef627(_0x282b7f);});});}
\ No newline at end of file
index ff26d19..9b58e1f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7880=['path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','multer'];(function(_0x42195f,_0xac78a5){var _0x2243a2=function(_0x152be8){while(--_0x152be8){_0x42195f['push'](_0x42195f['shift']());}};_0x2243a2(++_0xac78a5);}(_0x7880,0x10f));var _0x0788=function(_0x56857c,_0x4868cb){_0x56857c=_0x56857c-0x0;var _0x4027e7=_0x7880[_0x56857c];return _0x4027e7;};'use strict';var multer=require(_0x0788('0x0'));var util=require('util');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('../../components/interaction/service');var config=require(_0x0788('0x6'));var controller=require('./template.controller');router[_0x0788('0x7')]('/',auth[_0x0788('0x8')](),controller[_0x0788('0x9')]);router['get'](_0x0788('0xa'),auth[_0x0788('0x8')](),controller['show']);router[_0x0788('0xb')]('/',auth[_0x0788('0x8')](),controller[_0x0788('0xc')]);router[_0x0788('0xd')](_0x0788('0xa'),auth[_0x0788('0x8')](),controller[_0x0788('0xe')]);router[_0x0788('0xf')](_0x0788('0xa'),auth[_0x0788('0x8')](),controller[_0x0788('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0x937d=['/:id','post','create','put','update','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x4822f1,_0x432a6d){var _0x14245e=function(_0x5c4e4c){while(--_0x5c4e4c){_0x4822f1['push'](_0x4822f1['shift']());}};_0x14245e(++_0x432a6d);}(_0x937d,0x1f4));var _0xd937=function(_0x19d815,_0x53768a){_0x19d815=_0x19d815-0x0;var _0x49208b=_0x937d[_0x19d815];return _0x49208b;};'use strict';var multer=require(_0xd937('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd937('0x1'));var router=express[_0xd937('0x2')]();var fs_extra=require(_0xd937('0x3'));var auth=require(_0xd937('0x4'));var interaction=require(_0xd937('0x5'));var config=require(_0xd937('0x6'));var controller=require('./template.controller');router[_0xd937('0x7')]('/',auth[_0xd937('0x8')](),controller[_0xd937('0x9')]);router['get'](_0xd937('0xa'),auth[_0xd937('0x8')](),controller['show']);router[_0xd937('0xb')]('/',auth[_0xd937('0x8')](),controller[_0xd937('0xc')]);router[_0xd937('0xd')](_0xd937('0xa'),auth['isAuthenticated'](),controller[_0xd937('0xe')]);router['delete'](_0xd937('0xa'),auth['isAuthenticated'](),controller[_0xd937('0xf')]);module[_0xd937('0x10')]=router;
\ No newline at end of file
index 10ed69a..2d455c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe824=['sequelize','exports','STRING','TEXT'];(function(_0x45c1b5,_0x382aba){var _0x36bf16=function(_0x10f142){while(--_0x10f142){_0x45c1b5['push'](_0x45c1b5['shift']());}};_0x36bf16(++_0x382aba);}(_0xe824,0xa4));var _0x4e82=function(_0x4cfe90,_0x3da8fb){_0x4cfe90=_0x4cfe90-0x0;var _0x13591e=_0xe824[_0x4cfe90];return _0x13591e;};'use strict';var Sequelize=require(_0x4e82('0x0'));module[_0x4e82('0x1')]={'name':{'type':Sequelize[_0x4e82('0x2')]},'description':{'type':Sequelize[_0x4e82('0x2')]},'html':{'type':Sequelize[_0x4e82('0x3')]}};
\ No newline at end of file
+var _0x34e9=['exports','STRING','sequelize'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x34e9,0x1b8));var _0x934e=function(_0x1a91ca,_0x235a89){_0x1a91ca=_0x1a91ca-0x0;var _0x2b61b3=_0x34e9[_0x1a91ca];return _0x2b61b3;};'use strict';var Sequelize=require(_0x934e('0x0'));module[_0x934e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x934e('0x2')]},'html':{'type':Sequelize['TEXT']}};
\ No newline at end of file
index 4a35fe5..e0a5269 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffee=['apply','save','update','destroy','then','get','Templates','UserProfileResource','error','stack','name','send','index','map','Template','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','show','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','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','status','json','undefined','count','offset','limit','set'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xffee,0x178));var _0xeffe=function(_0x45d496,_0x38600e){_0x45d496=_0x45d496-0x0;var _0x179479=_0xffee[_0x45d496];return _0x179479;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeffe('0x0'));var zipdir=require(_0xeffe('0x1'));var jsonpatch=require(_0xeffe('0x2'));var rp=require(_0xeffe('0x3'));var moment=require(_0xeffe('0x4'));var BPromise=require(_0xeffe('0x5'));var Mustache=require(_0xeffe('0x6'));var util=require(_0xeffe('0x7'));var path=require(_0xeffe('0x8'));var sox=require(_0xeffe('0x9'));var csv=require(_0xeffe('0xa'));var ejs=require(_0xeffe('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeffe('0xc'));var squel=require('squel');var crypto=require(_0xeffe('0xd'));var jsforce=require(_0xeffe('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xeffe('0xa'));var querystring=require(_0xeffe('0xf'));var Papa=require(_0xeffe('0x10'));var Redis=require(_0xeffe('0x11'));var authService=require(_0xeffe('0x12'));var qs=require(_0xeffe('0x13'));var as=require(_0xeffe('0x14'));var hardwareService=require(_0xeffe('0x15'));var logger=require(_0xeffe('0x16'))(_0xeffe('0x17'));var utils=require(_0xeffe('0x18'));var config=require(_0xeffe('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xeffe('0x1a'))['db'];function respondWithStatusCode(_0x4595e2,_0x2bbf4d){_0x2bbf4d=_0x2bbf4d||0xcc;return function(_0x4ac15e){if(_0x4ac15e){return _0x4595e2['sendStatus'](_0x2bbf4d);}return _0x4595e2[_0xeffe('0x1b')](_0x2bbf4d)['end']();};}function respondWithResult(_0x517839,_0x50a831){_0x50a831=_0x50a831||0xc8;return function(_0x5de9f2){if(_0x5de9f2){return _0x517839['status'](_0x50a831)[_0xeffe('0x1c')](_0x5de9f2);}};}function respondWithFilteredResult(_0x1dcb4f,_0x17b8de){return function(_0x5a21a3){if(_0x5a21a3){var _0x2e5c07=typeof _0x17b8de['offset']===_0xeffe('0x1d')&&typeof _0x17b8de['limit']===_0xeffe('0x1d');var _0x9aef79=_0x5a21a3[_0xeffe('0x1e')];var _0x282242=_0x2e5c07?0x0:_0x17b8de[_0xeffe('0x1f')];var _0x51f536=_0x2e5c07?_0x5a21a3[_0xeffe('0x1e')]:_0x17b8de[_0xeffe('0x1f')]+_0x17b8de[_0xeffe('0x20')];var _0x4d96af;if(_0x51f536>=_0x9aef79){_0x51f536=_0x9aef79;_0x4d96af=0xc8;}else{_0x4d96af=0xce;}_0x1dcb4f[_0xeffe('0x1b')](_0x4d96af);return _0x1dcb4f[_0xeffe('0x21')]('Content-Range',_0x282242+'-'+_0x51f536+'/'+_0x9aef79)[_0xeffe('0x1c')](_0x5a21a3);}return null;};}function patchUpdates(_0x5c2839){return function(_0x2ec2da){try{jsonpatch[_0xeffe('0x22')](_0x2ec2da,_0x5c2839,!![]);}catch(_0x2790a2){return BPromise['reject'](_0x2790a2);}return _0x2ec2da[_0xeffe('0x23')]();};}function saveUpdates(_0x131954,_0x123ed6){return function(_0x4455ec){if(_0x4455ec){return _0x4455ec[_0xeffe('0x24')](_0x131954)['then'](function(_0x278e10){return _0x278e10;});}return null;};}function removeEntity(_0x508909,_0x4c8a00){return function(_0x5274f4){if(_0x5274f4){return _0x5274f4[_0xeffe('0x25')]()[_0xeffe('0x26')](function(){var _0x34c18a=_0x5274f4[_0xeffe('0x27')]({'plain':!![]});var _0x1a1bec=_0xeffe('0x28');return db[_0xeffe('0x29')]['destroy']({'where':{'type':_0x1a1bec,'resourceId':_0x34c18a['id']}})[_0xeffe('0x26')](function(){return _0x5274f4;});})[_0xeffe('0x26')](function(){_0x508909['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c369f,_0x239a8c){return function(_0x356ee4){if(!_0x356ee4){_0x2c369f['sendStatus'](0x194);}return _0x356ee4;};}function handleError(_0x1e6de0,_0xd93f44){_0xd93f44=_0xd93f44||0x1f4;return function(_0x4c1d52){logger[_0xeffe('0x2a')](_0x4c1d52[_0xeffe('0x2b')]);if(_0x4c1d52['name']){delete _0x4c1d52[_0xeffe('0x2c')];}_0x1e6de0['status'](_0xd93f44)[_0xeffe('0x2d')](_0x4c1d52);};}exports[_0xeffe('0x2e')]=function(_0x34811e,_0x31271c){var _0x41d3e6={},_0x35c4e4={},_0x2e0f12={'count':0x0,'rows':[]};var _0x23ef28=_[_0xeffe('0x2f')](db[_0xeffe('0x30')][_0xeffe('0x31')],function(_0x59287e){return{'name':_0x59287e[_0xeffe('0x32')],'type':_0x59287e[_0xeffe('0x33')][_0xeffe('0x34')]};});_0x35c4e4[_0xeffe('0x35')]=_[_0xeffe('0x2f')](_0x23ef28,'name');_0x35c4e4[_0xeffe('0x36')]=_[_0xeffe('0x37')](_0x34811e[_0xeffe('0x36')]);_0x35c4e4[_0xeffe('0x38')]=_['intersection'](_0x35c4e4[_0xeffe('0x35')],_0x35c4e4[_0xeffe('0x36')]);_0x41d3e6[_0xeffe('0x39')]=_[_0xeffe('0x3a')](_0x35c4e4[_0xeffe('0x35')],qs[_0xeffe('0x3b')](_0x34811e[_0xeffe('0x36')][_0xeffe('0x3b')]));_0x41d3e6['attributes']=_0x41d3e6[_0xeffe('0x39')][_0xeffe('0x3c')]?_0x41d3e6[_0xeffe('0x39')]:_0x35c4e4['model'];if(!_0x34811e[_0xeffe('0x36')][_0xeffe('0x3d')](_0xeffe('0x3e'))){_0x41d3e6['limit']=qs['limit'](_0x34811e[_0xeffe('0x36')]['limit']);_0x41d3e6[_0xeffe('0x1f')]=qs[_0xeffe('0x1f')](_0x34811e['query'][_0xeffe('0x1f')]);}_0x41d3e6[_0xeffe('0x3f')]=qs[_0xeffe('0x40')](_0x34811e[_0xeffe('0x36')][_0xeffe('0x40')]);_0x41d3e6[_0xeffe('0x41')]=qs[_0xeffe('0x38')](_[_0xeffe('0x42')](_0x34811e[_0xeffe('0x36')],_0x35c4e4[_0xeffe('0x38')]),_0x23ef28);if(_0x34811e[_0xeffe('0x36')][_0xeffe('0x43')]){_0x41d3e6[_0xeffe('0x41')]=_['merge'](_0x41d3e6[_0xeffe('0x41')],{'$or':_[_0xeffe('0x2f')](_0x23ef28,function(_0x4a7df0){if(_0x4a7df0[_0xeffe('0x33')]!=='VIRTUAL'){var _0x1c3773={};_0x1c3773[_0x4a7df0[_0xeffe('0x2c')]]={'$like':'%'+_0x34811e[_0xeffe('0x36')][_0xeffe('0x43')]+'%'};return _0x1c3773;}})});}_0x41d3e6=_[_0xeffe('0x44')]({},_0x41d3e6,_0x34811e[_0xeffe('0x45')]);var _0x292cec={'where':_0x41d3e6[_0xeffe('0x41')]};return db[_0xeffe('0x30')][_0xeffe('0x1e')](_0x292cec)[_0xeffe('0x26')](function(_0x574f92){_0x2e0f12[_0xeffe('0x1e')]=_0x574f92;if(_0x34811e[_0xeffe('0x36')][_0xeffe('0x46')]){_0x41d3e6[_0xeffe('0x47')]=[{'all':!![]}];}return db[_0xeffe('0x30')]['findAll'](_0x41d3e6);})[_0xeffe('0x26')](function(_0x3a5f41){_0x2e0f12['rows']=_0x3a5f41;return _0x2e0f12;})['then'](respondWithFilteredResult(_0x31271c,_0x41d3e6))[_0xeffe('0x48')](handleError(_0x31271c,null));};exports[_0xeffe('0x49')]=function(_0x45a7e0,_0x7dfbe2){var _0xec64e7={'raw':!![],'where':{'id':_0x45a7e0['params']['id']}},_0x59ac36={};_0x59ac36[_0xeffe('0x35')]=_[_0xeffe('0x37')](db['Template']['rawAttributes']);_0x59ac36[_0xeffe('0x36')]=_[_0xeffe('0x37')](_0x45a7e0[_0xeffe('0x36')]);_0x59ac36[_0xeffe('0x38')]=_[_0xeffe('0x3a')](_0x59ac36[_0xeffe('0x35')],_0x59ac36[_0xeffe('0x36')]);_0xec64e7[_0xeffe('0x39')]=_[_0xeffe('0x3a')](_0x59ac36[_0xeffe('0x35')],qs['fields'](_0x45a7e0['query'][_0xeffe('0x3b')]));_0xec64e7[_0xeffe('0x39')]=_0xec64e7[_0xeffe('0x39')][_0xeffe('0x3c')]?_0xec64e7['attributes']:_0x59ac36[_0xeffe('0x35')];if(_0x45a7e0[_0xeffe('0x36')][_0xeffe('0x46')]){_0xec64e7[_0xeffe('0x47')]=[{'all':!![]}];}_0xec64e7=_[_0xeffe('0x44')]({},_0xec64e7,_0x45a7e0['options']);return db[_0xeffe('0x30')]['find'](_0xec64e7)['then'](handleEntityNotFound(_0x7dfbe2,null))[_0xeffe('0x26')](respondWithResult(_0x7dfbe2,null))[_0xeffe('0x48')](handleError(_0x7dfbe2,null));};exports[_0xeffe('0x4a')]=function(_0x398275,_0xc526d1){return db[_0xeffe('0x30')]['create'](_0x398275[_0xeffe('0x4b')],{})[_0xeffe('0x26')](function(_0x5cb3df){var _0x2c53b3=_0x398275['user']['get']({'plain':!![]});if(!_0x2c53b3)throw new Error(_0xeffe('0x4c'));if(_0x2c53b3['role']===_0xeffe('0x4d')){var _0x37fa45=_0x5cb3df['get']({'plain':!![]});var _0x585a8a=_0xeffe('0x28');return db['UserProfileSection'][_0xeffe('0x4e')]({'where':{'name':_0x585a8a,'userProfileId':_0x2c53b3['userProfileId']},'raw':!![]})[_0xeffe('0x26')](function(_0x2a05c9){if(_0x2a05c9&&_0x2a05c9[_0xeffe('0x4f')]===0x0){return db['UserProfileResource'][_0xeffe('0x4a')]({'name':_0x37fa45['name'],'resourceId':_0x37fa45['id'],'type':_0x2a05c9[_0xeffe('0x2c')],'sectionId':_0x2a05c9['id']},{})[_0xeffe('0x26')](function(){return _0x5cb3df;});}else{return _0x5cb3df;}})[_0xeffe('0x48')](function(_0x2bc5bd){logger[_0xeffe('0x2a')](_0xeffe('0x50'),_0x2bc5bd);throw _0x2bc5bd;});}return _0x5cb3df;})['then'](respondWithResult(_0xc526d1,0xc9))[_0xeffe('0x48')](handleError(_0xc526d1,null));};exports[_0xeffe('0x24')]=function(_0x4e084b,_0x31c3de){if(_0x4e084b[_0xeffe('0x4b')]['id']){delete _0x4e084b['body']['id'];}return db[_0xeffe('0x30')]['find']({'where':{'id':_0x4e084b[_0xeffe('0x51')]['id']}})[_0xeffe('0x26')](handleEntityNotFound(_0x31c3de,null))['then'](saveUpdates(_0x4e084b[_0xeffe('0x4b')],null))[_0xeffe('0x26')](respondWithResult(_0x31c3de,null))[_0xeffe('0x48')](handleError(_0x31c3de,null));};exports[_0xeffe('0x25')]=function(_0x1efcad,_0x382070){return db['Template'][_0xeffe('0x4e')]({'where':{'id':_0x1efcad[_0xeffe('0x51')]['id']}})[_0xeffe('0x26')](handleEntityNotFound(_0x382070,null))['then'](removeEntity(_0x382070,null))[_0xeffe('0x48')](handleError(_0x382070,null));};
\ No newline at end of file
+var _0x0076=['eml-format','rimraf','zip-dir','fast-json-patch','bluebird','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/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','merge','where','options','Template','includeAll','include','findAll','rows','show','params','keys','length','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Templates','UserProfileSection','userProfileId','error'];(function(_0x321546,_0x41b964){var _0xfea202=function(_0x54594d){while(--_0x54594d){_0x321546['push'](_0x321546['shift']());}};_0xfea202(++_0x41b964);}(_0x0076,0x1a9));var _0x6007=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x0076[_0x8c43de];return _0xa6591b;};'use strict';var emlformat=require(_0x6007('0x0'));var rimraf=require(_0x6007('0x1'));var zipdir=require(_0x6007('0x2'));var jsonpatch=require(_0x6007('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6007('0x4'));var Mustache=require('mustache');var util=require(_0x6007('0x5'));var path=require(_0x6007('0x6'));var sox=require(_0x6007('0x7'));var csv=require(_0x6007('0x8'));var ejs=require(_0x6007('0x9'));var fs=require('fs');var fs_extra=require(_0x6007('0xa'));var _=require(_0x6007('0xb'));var squel=require(_0x6007('0xc'));var crypto=require(_0x6007('0xd'));var jsforce=require(_0x6007('0xe'));var deskjs=require(_0x6007('0xf'));var toCsv=require(_0x6007('0x8'));var querystring=require('querystring');var Papa=require(_0x6007('0x10'));var Redis=require(_0x6007('0x11'));var authService=require(_0x6007('0x12'));var qs=require(_0x6007('0x13'));var as=require(_0x6007('0x14'));var hardwareService=require(_0x6007('0x15'));var logger=require(_0x6007('0x16'))('api');var utils=require(_0x6007('0x17'));var config=require(_0x6007('0x18'));var licenseUtil=require(_0x6007('0x19'));var db=require(_0x6007('0x1a'))['db'];function respondWithStatusCode(_0x2f0c9e,_0x5dff68){_0x5dff68=_0x5dff68||0xcc;return function(_0x565805){if(_0x565805){return _0x2f0c9e[_0x6007('0x1b')](_0x5dff68);}return _0x2f0c9e[_0x6007('0x1c')](_0x5dff68)[_0x6007('0x1d')]();};}function respondWithResult(_0x37d262,_0xb18932){_0xb18932=_0xb18932||0xc8;return function(_0x8da4f3){if(_0x8da4f3){return _0x37d262[_0x6007('0x1c')](_0xb18932)[_0x6007('0x1e')](_0x8da4f3);}};}function respondWithFilteredResult(_0x157ff7,_0x5170b1){return function(_0x31e16d){if(_0x31e16d){var _0x2b3341=typeof _0x5170b1[_0x6007('0x1f')]===_0x6007('0x20')&&typeof _0x5170b1['limit']===_0x6007('0x20');var _0x54009d=_0x31e16d[_0x6007('0x21')];var _0x1cc087=_0x2b3341?0x0:_0x5170b1[_0x6007('0x1f')];var _0x430da8=_0x2b3341?_0x31e16d[_0x6007('0x21')]:_0x5170b1['offset']+_0x5170b1[_0x6007('0x22')];var _0x353be9;if(_0x430da8>=_0x54009d){_0x430da8=_0x54009d;_0x353be9=0xc8;}else{_0x353be9=0xce;}_0x157ff7['status'](_0x353be9);return _0x157ff7[_0x6007('0x23')](_0x6007('0x24'),_0x1cc087+'-'+_0x430da8+'/'+_0x54009d)[_0x6007('0x1e')](_0x31e16d);}return null;};}function patchUpdates(_0x587831){return function(_0x120fbe){try{jsonpatch[_0x6007('0x25')](_0x120fbe,_0x587831,!![]);}catch(_0x2cd3fa){return BPromise[_0x6007('0x26')](_0x2cd3fa);}return _0x120fbe['save']();};}function saveUpdates(_0x4d5dce,_0x1fcbec){return function(_0x4ec8a1){if(_0x4ec8a1){return _0x4ec8a1[_0x6007('0x27')](_0x4d5dce)[_0x6007('0x28')](function(_0x2a67b3){return _0x2a67b3;});}return null;};}function removeEntity(_0x50682e,_0x5861be){return function(_0x2c05ba){if(_0x2c05ba){return _0x2c05ba[_0x6007('0x29')]()[_0x6007('0x28')](function(){var _0x36c929=_0x2c05ba[_0x6007('0x2a')]({'plain':!![]});var _0x44f747='Templates';return db[_0x6007('0x2b')][_0x6007('0x29')]({'where':{'type':_0x44f747,'resourceId':_0x36c929['id']}})[_0x6007('0x28')](function(){return _0x2c05ba;});})[_0x6007('0x28')](function(){_0x50682e[_0x6007('0x1c')](0xcc)[_0x6007('0x1d')]();});}};}function handleEntityNotFound(_0x421d3a,_0xe5ec97){return function(_0x2651af){if(!_0x2651af){_0x421d3a[_0x6007('0x1b')](0x194);}return _0x2651af;};}function handleError(_0x1e5226,_0x415c0a){_0x415c0a=_0x415c0a||0x1f4;return function(_0xba6150){logger['error'](_0xba6150[_0x6007('0x2c')]);if(_0xba6150[_0x6007('0x2d')]){delete _0xba6150['name'];}_0x1e5226[_0x6007('0x1c')](_0x415c0a)[_0x6007('0x2e')](_0xba6150);};}exports[_0x6007('0x2f')]=function(_0x28047d,_0xec0635){var _0x4bee1a={},_0x273343={},_0x30e101={'count':0x0,'rows':[]};var _0x215ae7=_[_0x6007('0x30')](db['Template'][_0x6007('0x31')],function(_0x284523){return{'name':_0x284523[_0x6007('0x32')],'type':_0x284523[_0x6007('0x33')]['key']};});_0x273343[_0x6007('0x34')]=_[_0x6007('0x30')](_0x215ae7,_0x6007('0x2d'));_0x273343[_0x6007('0x35')]=_['keys'](_0x28047d[_0x6007('0x35')]);_0x273343['filters']=_[_0x6007('0x36')](_0x273343[_0x6007('0x34')],_0x273343[_0x6007('0x35')]);_0x4bee1a[_0x6007('0x37')]=_[_0x6007('0x36')](_0x273343['model'],qs[_0x6007('0x38')](_0x28047d[_0x6007('0x35')][_0x6007('0x38')]));_0x4bee1a[_0x6007('0x37')]=_0x4bee1a[_0x6007('0x37')]['length']?_0x4bee1a['attributes']:_0x273343[_0x6007('0x34')];if(!_0x28047d[_0x6007('0x35')][_0x6007('0x39')](_0x6007('0x3a'))){_0x4bee1a[_0x6007('0x22')]=qs[_0x6007('0x22')](_0x28047d[_0x6007('0x35')][_0x6007('0x22')]);_0x4bee1a[_0x6007('0x1f')]=qs[_0x6007('0x1f')](_0x28047d['query'][_0x6007('0x1f')]);}_0x4bee1a[_0x6007('0x3b')]=qs[_0x6007('0x3c')](_0x28047d[_0x6007('0x35')][_0x6007('0x3c')]);_0x4bee1a['where']=qs['filters'](_['pick'](_0x28047d['query'],_0x273343[_0x6007('0x3d')]),_0x215ae7);if(_0x28047d[_0x6007('0x35')]['filter']){_0x4bee1a['where']=_[_0x6007('0x3e')](_0x4bee1a[_0x6007('0x3f')],{'$or':_[_0x6007('0x30')](_0x215ae7,function(_0x16fcc5){if(_0x16fcc5[_0x6007('0x33')]!=='VIRTUAL'){var _0x1ace4b={};_0x1ace4b[_0x16fcc5[_0x6007('0x2d')]]={'$like':'%'+_0x28047d[_0x6007('0x35')]['filter']+'%'};return _0x1ace4b;}})});}_0x4bee1a=_[_0x6007('0x3e')]({},_0x4bee1a,_0x28047d[_0x6007('0x40')]);var _0x29b5bd={'where':_0x4bee1a[_0x6007('0x3f')]};return db[_0x6007('0x41')][_0x6007('0x21')](_0x29b5bd)[_0x6007('0x28')](function(_0x4107d7){_0x30e101[_0x6007('0x21')]=_0x4107d7;if(_0x28047d[_0x6007('0x35')][_0x6007('0x42')]){_0x4bee1a[_0x6007('0x43')]=[{'all':!![]}];}return db['Template'][_0x6007('0x44')](_0x4bee1a);})[_0x6007('0x28')](function(_0x4b3b93){_0x30e101[_0x6007('0x45')]=_0x4b3b93;return _0x30e101;})[_0x6007('0x28')](respondWithFilteredResult(_0xec0635,_0x4bee1a))['catch'](handleError(_0xec0635,null));};exports[_0x6007('0x46')]=function(_0x32ed5e,_0x2fbaa5){var _0x15eed3={'raw':!![],'where':{'id':_0x32ed5e[_0x6007('0x47')]['id']}},_0x4aa020={};_0x4aa020[_0x6007('0x34')]=_[_0x6007('0x48')](db[_0x6007('0x41')][_0x6007('0x31')]);_0x4aa020['query']=_[_0x6007('0x48')](_0x32ed5e['query']);_0x4aa020[_0x6007('0x3d')]=_[_0x6007('0x36')](_0x4aa020['model'],_0x4aa020[_0x6007('0x35')]);_0x15eed3['attributes']=_[_0x6007('0x36')](_0x4aa020[_0x6007('0x34')],qs['fields'](_0x32ed5e[_0x6007('0x35')][_0x6007('0x38')]));_0x15eed3['attributes']=_0x15eed3['attributes'][_0x6007('0x49')]?_0x15eed3[_0x6007('0x37')]:_0x4aa020[_0x6007('0x34')];if(_0x32ed5e[_0x6007('0x35')]['includeAll']){_0x15eed3[_0x6007('0x43')]=[{'all':!![]}];}_0x15eed3=_[_0x6007('0x3e')]({},_0x15eed3,_0x32ed5e[_0x6007('0x40')]);return db[_0x6007('0x41')][_0x6007('0x4a')](_0x15eed3)[_0x6007('0x28')](handleEntityNotFound(_0x2fbaa5,null))[_0x6007('0x28')](respondWithResult(_0x2fbaa5,null))[_0x6007('0x4b')](handleError(_0x2fbaa5,null));};exports[_0x6007('0x4c')]=function(_0x27f639,_0x116925){return db[_0x6007('0x41')][_0x6007('0x4c')](_0x27f639[_0x6007('0x4d')],{})[_0x6007('0x28')](function(_0x5c6ba9){var _0x42a50a=_0x27f639['user'][_0x6007('0x2a')]({'plain':!![]});if(!_0x42a50a)throw new Error(_0x6007('0x4e'));if(_0x42a50a[_0x6007('0x4f')]===_0x6007('0x50')){var _0x3eff54=_0x5c6ba9[_0x6007('0x2a')]({'plain':!![]});var _0x171aff=_0x6007('0x51');return db[_0x6007('0x52')][_0x6007('0x4a')]({'where':{'name':_0x171aff,'userProfileId':_0x42a50a[_0x6007('0x53')]},'raw':!![]})['then'](function(_0x109323){if(_0x109323&&_0x109323['autoAssociation']===0x0){return db[_0x6007('0x2b')][_0x6007('0x4c')]({'name':_0x3eff54[_0x6007('0x2d')],'resourceId':_0x3eff54['id'],'type':_0x109323[_0x6007('0x2d')],'sectionId':_0x109323['id']},{})[_0x6007('0x28')](function(){return _0x5c6ba9;});}else{return _0x5c6ba9;}})[_0x6007('0x4b')](function(_0x2d3a27){logger[_0x6007('0x54')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d3a27);throw _0x2d3a27;});}return _0x5c6ba9;})['then'](respondWithResult(_0x116925,0xc9))[_0x6007('0x4b')](handleError(_0x116925,null));};exports['update']=function(_0x114f54,_0x5cbfa4){if(_0x114f54[_0x6007('0x4d')]['id']){delete _0x114f54['body']['id'];}return db[_0x6007('0x41')][_0x6007('0x4a')]({'where':{'id':_0x114f54[_0x6007('0x47')]['id']}})[_0x6007('0x28')](handleEntityNotFound(_0x5cbfa4,null))[_0x6007('0x28')](saveUpdates(_0x114f54[_0x6007('0x4d')],null))[_0x6007('0x28')](respondWithResult(_0x5cbfa4,null))['catch'](handleError(_0x5cbfa4,null));};exports[_0x6007('0x29')]=function(_0x9cfc39,_0x241b54){return db[_0x6007('0x41')][_0x6007('0x4a')]({'where':{'id':_0x9cfc39[_0x6007('0x47')]['id']}})[_0x6007('0x28')](handleEntityNotFound(_0x241b54,null))[_0x6007('0x28')](removeEntity(_0x241b54,null))[_0x6007('0x4b')](handleError(_0x241b54,null));};
\ No newline at end of file
index ab2ca87..084867b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0d0b=['define','Template','tools_templates','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./template.attributes','exports'];(function(_0x322b80,_0x22185f){var _0x371f7c=function(_0x2608df){while(--_0x2608df){_0x322b80['push'](_0x322b80['shift']());}};_0x371f7c(++_0x22185f);}(_0x0d0b,0x8f));var _0xb0d0=function(_0x120929,_0xb02eab){_0x120929=_0x120929-0x0;var _0x11af74=_0x0d0b[_0x120929];return _0x11af74;};'use strict';var _=require('lodash');var util=require(_0xb0d0('0x0'));var logger=require(_0xb0d0('0x1'))(_0xb0d0('0x2'));var moment=require(_0xb0d0('0x3'));var BPromise=require(_0xb0d0('0x4'));var rp=require(_0xb0d0('0x5'));var fs=require('fs');var path=require(_0xb0d0('0x6'));var rimraf=require(_0xb0d0('0x7'));var config=require(_0xb0d0('0x8'));var attributes=require(_0xb0d0('0x9'));module[_0xb0d0('0xa')]=function(_0xcd7245,_0x598af8){return _0xcd7245[_0xb0d0('0xb')](_0xb0d0('0xc'),attributes,{'tableName':_0xb0d0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa80b=['bluebird','request-promise','path','rimraf','./template.attributes','define','Template','tools_templates','../../config/logger','moment'];(function(_0x4e5a2b,_0x40a16c){var _0x46b9b1=function(_0x1f681f){while(--_0x1f681f){_0x4e5a2b['push'](_0x4e5a2b['shift']());}};_0x46b9b1(++_0x40a16c);}(_0xa80b,0x80));var _0xba80=function(_0x45be52,_0x46d496){_0x45be52=_0x45be52-0x0;var _0x15294f=_0xa80b[_0x45be52];return _0x15294f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xba80('0x0'))('api');var moment=require(_0xba80('0x1'));var BPromise=require(_0xba80('0x2'));var rp=require(_0xba80('0x3'));var fs=require('fs');var path=require(_0xba80('0x4'));var rimraf=require(_0xba80('0x5'));var config=require('../../config/environment');var attributes=require(_0xba80('0x6'));module['exports']=function(_0x539caf,_0x36f98f){return _0x539caf[_0xba80('0x7')](_0xba80('0x8'),attributes,{'tableName':_0xba80('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 08c1403..3e01654 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8dfe=['options','include','attributes','map','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTemplate','Template','findAll'];(function(_0xe73080,_0x24c56d){var _0x12cbc4=function(_0x1377e2){while(--_0x1377e2){_0xe73080['push'](_0xe73080['shift']());}};_0x12cbc4(++_0x24c56d);}(_0x8dfe,0x65));var _0xe8df=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x8dfe[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xe8df('0x0'));var util=require(_0xe8df('0x1'));var moment=require(_0xe8df('0x2'));var BPromise=require(_0xe8df('0x3'));var rs=require(_0xe8df('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8df('0x5'))['db'];var utils=require(_0xe8df('0x6'));var logger=require('../../config/logger')(_0xe8df('0x7'));var config=require('../../config/environment');var jayson=require(_0xe8df('0x8'));var client=jayson[_0xe8df('0x9')][_0xe8df('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22991e,_0x2ebb51,_0xb44c97){return new BPromise(function(_0xe32ea6,_0x4ae9b3){return client[_0xe8df('0xb')](_0x22991e,_0xb44c97)[_0xe8df('0xc')](function(_0x46291d){logger[_0xe8df('0xd')](_0xe8df('0xe'),_0x2ebb51,'request\x20sent');logger[_0xe8df('0xf')](_0xe8df('0x10'),_0x2ebb51,_0xe8df('0x11'),JSON[_0xe8df('0x12')](_0x46291d));if(_0x46291d['error']){if(_0x46291d[_0xe8df('0x13')][_0xe8df('0x14')]===0x1f4){logger[_0xe8df('0x13')]('Template,\x20%s,\x20%s',_0x2ebb51,_0x46291d['error'][_0xe8df('0x15')]);return _0x4ae9b3(_0x46291d[_0xe8df('0x13')]['message']);}logger[_0xe8df('0x13')](_0xe8df('0xe'),_0x2ebb51,_0x46291d[_0xe8df('0x13')]['message']);return _0xe32ea6(_0x46291d[_0xe8df('0x13')][_0xe8df('0x15')]);}else{logger[_0xe8df('0xd')]('Template,\x20%s,\x20%s',_0x2ebb51,_0xe8df('0x11'));_0xe32ea6(_0x46291d[_0xe8df('0x16')][_0xe8df('0x15')]);}})[_0xe8df('0x17')](function(_0x3b68d3){logger[_0xe8df('0x13')]('Template,\x20%s,\x20%s',_0x2ebb51,_0x3b68d3);_0x4ae9b3(_0x3b68d3);});});}exports[_0xe8df('0x18')]=function(_0x71982c){var _0x33b93f=this;return new Promise(function(_0x1cc6b7,_0x2c8961){return db[_0xe8df('0x19')][_0xe8df('0x1a')]({'raw':_0x71982c[_0xe8df('0x1b')]?_0x71982c[_0xe8df('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x71982c[_0xe8df('0x1b')]?_0x71982c[_0xe8df('0x1b')]['where']||null:null,'attributes':_0x71982c[_0xe8df('0x1b')]?_0x71982c['options']['attributes']||null:null,'limit':_0x71982c['options']?_0x71982c[_0xe8df('0x1b')]['limit']||null:null,'include':_0x71982c[_0xe8df('0x1b')]?_0x71982c[_0xe8df('0x1b')][_0xe8df('0x1c')]?_['map'](_0x71982c[_0xe8df('0x1b')][_0xe8df('0x1c')],function(_0xfe8277){return{'model':db[_0xfe8277['model']],'as':_0xfe8277['as'],'attributes':_0xfe8277[_0xe8df('0x1d')],'include':_0xfe8277[_0xe8df('0x1c')]?_[_0xe8df('0x1e')](_0xfe8277[_0xe8df('0x1c')],function(_0x51c637){return{'model':db[_0x51c637[_0xe8df('0x1f')]],'as':_0x51c637['as'],'attributes':_0x51c637['attributes'],'include':_0x51c637[_0xe8df('0x1c')]?_[_0xe8df('0x1e')](_0x51c637[_0xe8df('0x1c')],function(_0x142d89){return{'model':db[_0x142d89[_0xe8df('0x1f')]],'as':_0x142d89['as'],'attributes':_0x142d89['attributes']};}):[]};}):[]};}):[]:[]})[_0xe8df('0xc')](function(_0x1978e8){logger[_0xe8df('0xd')](_0xe8df('0x18'),_0x71982c);logger['debug'](_0xe8df('0x18'),_0x71982c,JSON['stringify'](_0x1978e8));_0x1cc6b7(_0x1978e8);})['catch'](function(_0x26f8be){logger['error']('GetTemplate',_0x26f8be[_0xe8df('0x15')],_0x71982c);_0x2c8961(_0x33b93f[_0xe8df('0x13')](0x1f4,_0x26f8be[_0xe8df('0x15')]));});});};
\ No newline at end of file
+var _0x34cf=['http','request','then','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetTemplate','Template','findAll','options','raw','where','limit','map','include','model','attributes','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client'];(function(_0x2e6c75,_0x1bdbb7){var _0x13a9ea=function(_0x6ad297){while(--_0x6ad297){_0x2e6c75['push'](_0x2e6c75['shift']());}};_0x13a9ea(++_0x1bdbb7);}(_0x34cf,0xd8));var _0xf34c=function(_0x3e4a59,_0x2a566e){_0x3e4a59=_0x3e4a59-0x0;var _0x41acbb=_0x34cf[_0x3e4a59];return _0x41acbb;};'use strict';var _=require('lodash');var util=require(_0xf34c('0x0'));var moment=require(_0xf34c('0x1'));var BPromise=require('bluebird');var rs=require(_0xf34c('0x2'));var fs=require('fs');var Redis=require(_0xf34c('0x3'));var db=require(_0xf34c('0x4'))['db'];var utils=require(_0xf34c('0x5'));var logger=require(_0xf34c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf34c('0x7')][_0xf34c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x321a92,_0x42001b,_0x22f0d7){return new BPromise(function(_0x158169,_0x3ea6a9){return client[_0xf34c('0x9')](_0x321a92,_0x22f0d7)[_0xf34c('0xa')](function(_0x514cf5){logger['info'](_0xf34c('0xb'),_0x42001b,_0xf34c('0xc'));logger[_0xf34c('0xd')](_0xf34c('0xe'),_0x42001b,'request\x20sent',JSON[_0xf34c('0xf')](_0x514cf5));if(_0x514cf5[_0xf34c('0x10')]){if(_0x514cf5[_0xf34c('0x10')][_0xf34c('0x11')]===0x1f4){logger['error'](_0xf34c('0xb'),_0x42001b,_0x514cf5['error']['message']);return _0x3ea6a9(_0x514cf5[_0xf34c('0x10')][_0xf34c('0x12')]);}logger[_0xf34c('0x10')](_0xf34c('0xb'),_0x42001b,_0x514cf5[_0xf34c('0x10')]['message']);return _0x158169(_0x514cf5[_0xf34c('0x10')]['message']);}else{logger['info'](_0xf34c('0xb'),_0x42001b,_0xf34c('0xc'));_0x158169(_0x514cf5[_0xf34c('0x13')]['message']);}})['catch'](function(_0x5a2510){logger[_0xf34c('0x10')]('Template,\x20%s,\x20%s',_0x42001b,_0x5a2510);_0x3ea6a9(_0x5a2510);});});}exports[_0xf34c('0x14')]=function(_0x377f28){var _0x217521=this;return new Promise(function(_0x15c4a4,_0xbdff5c){return db[_0xf34c('0x15')][_0xf34c('0x16')]({'raw':_0x377f28['options']?_0x377f28[_0xf34c('0x17')][_0xf34c('0x18')]===undefined?!![]:![]:!![],'where':_0x377f28[_0xf34c('0x17')]?_0x377f28[_0xf34c('0x17')][_0xf34c('0x19')]||null:null,'attributes':_0x377f28[_0xf34c('0x17')]?_0x377f28['options']['attributes']||null:null,'limit':_0x377f28[_0xf34c('0x17')]?_0x377f28[_0xf34c('0x17')][_0xf34c('0x1a')]||null:null,'include':_0x377f28['options']?_0x377f28[_0xf34c('0x17')]['include']?_[_0xf34c('0x1b')](_0x377f28[_0xf34c('0x17')][_0xf34c('0x1c')],function(_0x5f2f2a){return{'model':db[_0x5f2f2a[_0xf34c('0x1d')]],'as':_0x5f2f2a['as'],'attributes':_0x5f2f2a['attributes'],'include':_0x5f2f2a[_0xf34c('0x1c')]?_[_0xf34c('0x1b')](_0x5f2f2a[_0xf34c('0x1c')],function(_0x26383d){return{'model':db[_0x26383d[_0xf34c('0x1d')]],'as':_0x26383d['as'],'attributes':_0x26383d[_0xf34c('0x1e')],'include':_0x26383d[_0xf34c('0x1c')]?_[_0xf34c('0x1b')](_0x26383d[_0xf34c('0x1c')],function(_0x104bc7){return{'model':db[_0x104bc7[_0xf34c('0x1d')]],'as':_0x104bc7['as'],'attributes':_0x104bc7[_0xf34c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf34c('0xa')](function(_0x26ed7e){logger['info'](_0xf34c('0x14'),_0x377f28);logger[_0xf34c('0xd')](_0xf34c('0x14'),_0x377f28,JSON[_0xf34c('0xf')](_0x26ed7e));_0x15c4a4(_0x26ed7e);})[_0xf34c('0x1f')](function(_0xfea401){logger[_0xf34c('0x10')](_0xf34c('0x14'),_0xfea401['message'],_0x377f28);_0xbdff5c(_0x217521[_0xf34c('0x10')](0x1f4,_0xfea401[_0xf34c('0x12')]));});});};
\ No newline at end of file
index 887507b..bb4ce7a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1159=['/:id/actions','post','create','addAllCondition','/:id/any_conditions','addAnyCondition','addAction','put','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./trigger.controller','isAuthenticated','index','get','/:id','show','/:id/all_conditions','getAllConditions','getAnyConditions'];(function(_0x4e6ed0,_0xb3182){var _0x8b5d6=function(_0x334942){while(--_0x334942){_0x4e6ed0['push'](_0x4e6ed0['shift']());}};_0x8b5d6(++_0xb3182);}(_0x1159,0x119));var _0x9115=function(_0x29c1f2,_0x23f7c2){_0x29c1f2=_0x29c1f2-0x0;var _0x21dd30=_0x1159[_0x29c1f2];return _0x21dd30;};'use strict';var multer=require(_0x9115('0x0'));var util=require(_0x9115('0x1'));var path=require(_0x9115('0x2'));var timeout=require(_0x9115('0x3'));var express=require(_0x9115('0x4'));var router=express['Router']();var fs_extra=require(_0x9115('0x5'));var auth=require(_0x9115('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9115('0x7'));router['get']('/',auth[_0x9115('0x8')](),controller[_0x9115('0x9')]);router[_0x9115('0xa')](_0x9115('0xb'),auth[_0x9115('0x8')](),controller[_0x9115('0xc')]);router[_0x9115('0xa')](_0x9115('0xd'),auth[_0x9115('0x8')](),controller[_0x9115('0xe')]);router['get']('/:id/any_conditions',auth[_0x9115('0x8')](),controller[_0x9115('0xf')]);router[_0x9115('0xa')](_0x9115('0x10'),auth[_0x9115('0x8')](),controller['getActions']);router[_0x9115('0x11')]('/',auth['isAuthenticated'](),controller[_0x9115('0x12')]);router[_0x9115('0x11')](_0x9115('0xd'),auth['isAuthenticated'](),controller[_0x9115('0x13')]);router[_0x9115('0x11')](_0x9115('0x14'),auth[_0x9115('0x8')](),controller[_0x9115('0x15')]);router['post'](_0x9115('0x10'),auth[_0x9115('0x8')](),controller[_0x9115('0x16')]);router[_0x9115('0x17')](_0x9115('0xb'),auth[_0x9115('0x8')](),controller['update']);router[_0x9115('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x9115('0x19')]);module[_0x9115('0x1a')]=router;
\ No newline at end of file
+var _0xaed4=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','index','/:id','isAuthenticated','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','getActions','post','create','addAllCondition','addAnyCondition','/:id/actions','addAction','put'];(function(_0x22b5df,_0x4f90ec){var _0x343351=function(_0x3972cd){while(--_0x3972cd){_0x22b5df['push'](_0x22b5df['shift']());}};_0x343351(++_0x4f90ec);}(_0xaed4,0xf4));var _0x4aed=function(_0x11aa01,_0x3a3fba){_0x11aa01=_0x11aa01-0x0;var _0x459dfd=_0xaed4[_0x11aa01];return _0x459dfd;};'use strict';var multer=require(_0x4aed('0x0'));var util=require('util');var path=require(_0x4aed('0x1'));var timeout=require(_0x4aed('0x2'));var express=require(_0x4aed('0x3'));var router=express[_0x4aed('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4aed('0x5'));var interaction=require(_0x4aed('0x6'));var config=require(_0x4aed('0x7'));var controller=require(_0x4aed('0x8'));router[_0x4aed('0x9')]('/',auth['isAuthenticated'](),controller[_0x4aed('0xa')]);router[_0x4aed('0x9')](_0x4aed('0xb'),auth[_0x4aed('0xc')](),controller[_0x4aed('0xd')]);router['get'](_0x4aed('0xe'),auth['isAuthenticated'](),controller[_0x4aed('0xf')]);router[_0x4aed('0x9')](_0x4aed('0x10'),auth[_0x4aed('0xc')](),controller[_0x4aed('0x11')]);router[_0x4aed('0x9')]('/:id/actions',auth['isAuthenticated'](),controller[_0x4aed('0x12')]);router[_0x4aed('0x13')]('/',auth[_0x4aed('0xc')](),controller[_0x4aed('0x14')]);router['post'](_0x4aed('0xe'),auth['isAuthenticated'](),controller[_0x4aed('0x15')]);router[_0x4aed('0x13')](_0x4aed('0x10'),auth[_0x4aed('0xc')](),controller[_0x4aed('0x16')]);router['post'](_0x4aed('0x17'),auth[_0x4aed('0xc')](),controller[_0x4aed('0x18')]);router[_0x4aed('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x4aed('0x1a')]);router[_0x4aed('0x1b')](_0x4aed('0xb'),auth[_0x4aed('0xc')](),controller[_0x4aed('0x1c')]);module[_0x4aed('0x1d')]=router;
\ No newline at end of file
index 545f303..113c268 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2118=['sequelize','STRING'];(function(_0x3f4dd9,_0xe0b819){var _0x31c54a=function(_0x25e6c6){while(--_0x25e6c6){_0x3f4dd9['push'](_0x3f4dd9['shift']());}};_0x31c54a(++_0xe0b819);}(_0x2118,0x15e));var _0x8211=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x2118[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x8211('0x0'));module['exports']={'name':{'type':Sequelize[_0x8211('0x1')]},'channel':{'type':Sequelize[_0x8211('0x1')]},'description':{'type':Sequelize[_0x8211('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0x4389=['BOOLEAN','sequelize','exports','STRING'];(function(_0xbe200f,_0x4b50eb){var _0x192597=function(_0x106cfd){while(--_0x106cfd){_0xbe200f['push'](_0xbe200f['shift']());}};_0x192597(++_0x4b50eb);}(_0x4389,0xfd));var _0x9438=function(_0x24fc8b,_0x120357){_0x24fc8b=_0x24fc8b-0x0;var _0x10b899=_0x4389[_0x24fc8b];return _0x10b899;};'use strict';var Sequelize=require(_0x9438('0x0'));module[_0x9438('0x1')]={'name':{'type':Sequelize[_0x9438('0x2')]},'channel':{'type':Sequelize[_0x9438('0x2')]},'description':{'type':Sequelize[_0x9438('0x2')]},'status':{'type':Sequelize[_0x9438('0x3')],'defaultValue':![]}};
\ No newline at end of file
index 33e1c7a..918afec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x755c=['TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','../../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','limit','undefined','count','offset','set','reject','save','update','Triggers','then','error','stack','send','index','Trigger','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','order','sort','where','pick','merge','VIRTUAL','name','options','include','findAll','rows','show','params','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','destroy','addAllCondition','TriggerAllId','Condition','addAnyCondition','getAllConditions','findOne','length','filter','hasOwnProperty','nolimit','addAction'];(function(_0x211087,_0x354fdd){var _0x2a581f=function(_0x2928fe){while(--_0x2928fe){_0x211087['push'](_0x211087['shift']());}};_0x2a581f(++_0x354fdd);}(_0x755c,0x120));var _0xc755=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x755c[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xc755('0x0'));var rimraf=require(_0xc755('0x1'));var zipdir=require(_0xc755('0x2'));var jsonpatch=require(_0xc755('0x3'));var rp=require(_0xc755('0x4'));var moment=require(_0xc755('0x5'));var BPromise=require(_0xc755('0x6'));var Mustache=require(_0xc755('0x7'));var util=require(_0xc755('0x8'));var path=require(_0xc755('0x9'));var sox=require('sox');var csv=require(_0xc755('0xa'));var ejs=require(_0xc755('0xb'));var fs=require('fs');var fs_extra=require(_0xc755('0xc'));var _=require(_0xc755('0xd'));var squel=require(_0xc755('0xe'));var crypto=require(_0xc755('0xf'));var jsforce=require(_0xc755('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc755('0x11'));var qs=require(_0xc755('0x12'));var as=require(_0xc755('0x13'));var hardwareService=require(_0xc755('0x14'));var logger=require(_0xc755('0x15'))('api');var utils=require(_0xc755('0x16'));var config=require(_0xc755('0x17'));var licenseUtil=require(_0xc755('0x18'));var db=require(_0xc755('0x19'))['db'];function respondWithStatusCode(_0x5d2eb0,_0x17a1a3){_0x17a1a3=_0x17a1a3||0xcc;return function(_0x28e253){if(_0x28e253){return _0x5d2eb0[_0xc755('0x1a')](_0x17a1a3);}return _0x5d2eb0[_0xc755('0x1b')](_0x17a1a3)[_0xc755('0x1c')]();};}function respondWithResult(_0x1fb135,_0xb720f8){_0xb720f8=_0xb720f8||0xc8;return function(_0x481e5c){if(_0x481e5c){return _0x1fb135['status'](_0xb720f8)[_0xc755('0x1d')](_0x481e5c);}};}function respondWithFilteredResult(_0x5dcb56,_0x183cad){return function(_0x1e6fbe){if(_0x1e6fbe){var _0x3249e2=typeof _0x183cad['offset']==='undefined'&&typeof _0x183cad[_0xc755('0x1e')]===_0xc755('0x1f');var _0x343bf0=_0x1e6fbe[_0xc755('0x20')];var _0x16917a=_0x3249e2?0x0:_0x183cad[_0xc755('0x21')];var _0x382306=_0x3249e2?_0x1e6fbe[_0xc755('0x20')]:_0x183cad['offset']+_0x183cad[_0xc755('0x1e')];var _0x55f9fd;if(_0x382306>=_0x343bf0){_0x382306=_0x343bf0;_0x55f9fd=0xc8;}else{_0x55f9fd=0xce;}_0x5dcb56[_0xc755('0x1b')](_0x55f9fd);return _0x5dcb56[_0xc755('0x22')]('Content-Range',_0x16917a+'-'+_0x382306+'/'+_0x343bf0)['json'](_0x1e6fbe);}return null;};}function patchUpdates(_0x1359aa){return function(_0x4e89f7){try{jsonpatch['apply'](_0x4e89f7,_0x1359aa,!![]);}catch(_0xe3c9fa){return BPromise[_0xc755('0x23')](_0xe3c9fa);}return _0x4e89f7[_0xc755('0x24')]();};}function saveUpdates(_0x3046dc,_0xe5e967){return function(_0x373419){if(_0x373419){return _0x373419[_0xc755('0x25')](_0x3046dc)['then'](function(_0x1771f3){return _0x1771f3;});}return null;};}function removeEntity(_0x1fad92,_0x64078){return function(_0xfc7a5f){if(_0xfc7a5f){return _0xfc7a5f['destroy']()['then'](function(){var _0x134f9b=_0xfc7a5f['get']({'plain':!![]});var _0x56c0db=_0xc755('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x56c0db,'resourceId':_0x134f9b['id']}})['then'](function(){return _0xfc7a5f;});})[_0xc755('0x27')](function(){_0x1fad92[_0xc755('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3227dc,_0x1a016f){return function(_0x41c3a7){if(!_0x41c3a7){_0x3227dc['sendStatus'](0x194);}return _0x41c3a7;};}function handleError(_0x1740d2,_0x2a036f){_0x2a036f=_0x2a036f||0x1f4;return function(_0x3eecc4){logger[_0xc755('0x28')](_0x3eecc4[_0xc755('0x29')]);if(_0x3eecc4['name']){delete _0x3eecc4['name'];}_0x1740d2['status'](_0x2a036f)[_0xc755('0x2a')](_0x3eecc4);};}exports[_0xc755('0x2b')]=function(_0x29c7fe,_0x1fcc6f){var _0x194839={},_0xc25c0e={},_0x162a90={'count':0x0,'rows':[]};var _0x2e9af4=_['map'](db[_0xc755('0x2c')][_0xc755('0x2d')],function(_0xe49ca9){return{'name':_0xe49ca9[_0xc755('0x2e')],'type':_0xe49ca9['type'][_0xc755('0x2f')]};});_0xc25c0e[_0xc755('0x30')]=_[_0xc755('0x31')](_0x2e9af4,'name');_0xc25c0e['query']=_[_0xc755('0x32')](_0x29c7fe[_0xc755('0x33')]);_0xc25c0e[_0xc755('0x34')]=_[_0xc755('0x35')](_0xc25c0e[_0xc755('0x30')],_0xc25c0e[_0xc755('0x33')]);_0x194839[_0xc755('0x36')]=_[_0xc755('0x35')](_0xc25c0e[_0xc755('0x30')],qs[_0xc755('0x37')](_0x29c7fe[_0xc755('0x33')][_0xc755('0x37')]));_0x194839[_0xc755('0x36')]=_0x194839['attributes']['length']?_0x194839[_0xc755('0x36')]:_0xc25c0e[_0xc755('0x30')];if(!_0x29c7fe['query']['hasOwnProperty']('nolimit')){_0x194839[_0xc755('0x1e')]=qs['limit'](_0x29c7fe['query']['limit']);_0x194839['offset']=qs[_0xc755('0x21')](_0x29c7fe[_0xc755('0x33')]['offset']);}_0x194839[_0xc755('0x38')]=qs[_0xc755('0x39')](_0x29c7fe['query'][_0xc755('0x39')]);_0x194839[_0xc755('0x3a')]=qs[_0xc755('0x34')](_[_0xc755('0x3b')](_0x29c7fe[_0xc755('0x33')],_0xc25c0e[_0xc755('0x34')]),_0x2e9af4);if(_0x29c7fe['query']['filter']){_0x194839['where']=_[_0xc755('0x3c')](_0x194839[_0xc755('0x3a')],{'$or':_['map'](_0x2e9af4,function(_0x2c98bb){if(_0x2c98bb['type']!==_0xc755('0x3d')){var _0x5510ca={};_0x5510ca[_0x2c98bb[_0xc755('0x3e')]]={'$like':'%'+_0x29c7fe[_0xc755('0x33')]['filter']+'%'};return _0x5510ca;}})});}_0x194839=_[_0xc755('0x3c')]({},_0x194839,_0x29c7fe[_0xc755('0x3f')]);var _0x557bdf={'where':_0x194839[_0xc755('0x3a')]};return db['Trigger'][_0xc755('0x20')](_0x557bdf)[_0xc755('0x27')](function(_0x3e8114){_0x162a90[_0xc755('0x20')]=_0x3e8114;if(_0x29c7fe[_0xc755('0x33')]['includeAll']){_0x194839[_0xc755('0x40')]=[{'all':!![]}];}return db[_0xc755('0x2c')][_0xc755('0x41')](_0x194839);})[_0xc755('0x27')](function(_0x4ba4f8){_0x162a90[_0xc755('0x42')]=_0x4ba4f8;return _0x162a90;})['then'](respondWithFilteredResult(_0x1fcc6f,_0x194839))['catch'](handleError(_0x1fcc6f,null));};exports[_0xc755('0x43')]=function(_0x43cc4d,_0x2d26b1){var _0x4aef37={'raw':![],'where':{'id':_0x43cc4d[_0xc755('0x44')]['id']}},_0x4a34bb={};_0x4a34bb[_0xc755('0x30')]=_[_0xc755('0x32')](db[_0xc755('0x2c')][_0xc755('0x2d')]);_0x4a34bb[_0xc755('0x33')]=_[_0xc755('0x32')](_0x43cc4d[_0xc755('0x33')]);_0x4a34bb[_0xc755('0x34')]=_[_0xc755('0x35')](_0x4a34bb[_0xc755('0x30')],_0x4a34bb[_0xc755('0x33')]);_0x4aef37[_0xc755('0x36')]=_[_0xc755('0x35')](_0x4a34bb['model'],qs[_0xc755('0x37')](_0x43cc4d[_0xc755('0x33')][_0xc755('0x37')]));_0x4aef37[_0xc755('0x36')]=_0x4aef37[_0xc755('0x36')]['length']?_0x4aef37[_0xc755('0x36')]:_0x4a34bb['model'];if(_0x43cc4d[_0xc755('0x33')]['includeAll']){_0x4aef37[_0xc755('0x40')]=[{'all':!![]}];}_0x4aef37=_['merge']({},_0x4aef37,_0x43cc4d[_0xc755('0x3f')]);return db[_0xc755('0x2c')]['find'](_0x4aef37)['then'](handleEntityNotFound(_0x2d26b1,null))['then'](respondWithResult(_0x2d26b1,null))[_0xc755('0x45')](handleError(_0x2d26b1,null));};exports[_0xc755('0x46')]=function(_0x49ee5a,_0x30cc61){return db['Trigger'][_0xc755('0x46')](_0x49ee5a[_0xc755('0x47')],{})['then'](function(_0x4f095c){var _0x21ca00=_0x49ee5a[_0xc755('0x48')]['get']({'plain':!![]});if(!_0x21ca00)throw new Error(_0xc755('0x49'));if(_0x21ca00['role']===_0xc755('0x48')){var _0x34714c=_0x4f095c[_0xc755('0x4a')]({'plain':!![]});var _0x3e264b='Triggers';return db[_0xc755('0x4b')][_0xc755('0x4c')]({'where':{'name':_0x3e264b,'userProfileId':_0x21ca00[_0xc755('0x4d')]},'raw':!![]})['then'](function(_0x2c328c){if(_0x2c328c&&_0x2c328c[_0xc755('0x4e')]===0x0){return db[_0xc755('0x4f')][_0xc755('0x46')]({'name':_0x34714c[_0xc755('0x3e')],'resourceId':_0x34714c['id'],'type':_0x2c328c[_0xc755('0x3e')],'sectionId':_0x2c328c['id']},{})[_0xc755('0x27')](function(){return _0x4f095c;});}else{return _0x4f095c;}})[_0xc755('0x45')](function(_0x254707){logger[_0xc755('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x254707);throw _0x254707;});}return _0x4f095c;})[_0xc755('0x27')](respondWithResult(_0x30cc61,0xc9))[_0xc755('0x45')](handleError(_0x30cc61,null));};exports['update']=function(_0x174f6f,_0x4f980d){if(_0x174f6f[_0xc755('0x47')]['id']){delete _0x174f6f[_0xc755('0x47')]['id'];}return db[_0xc755('0x2c')][_0xc755('0x4c')]({'where':{'id':_0x174f6f[_0xc755('0x44')]['id']}})['then'](handleEntityNotFound(_0x4f980d,null))['then'](saveUpdates(_0x174f6f[_0xc755('0x47')],null))[_0xc755('0x27')](respondWithResult(_0x4f980d,null))[_0xc755('0x45')](handleError(_0x4f980d,null));};exports[_0xc755('0x50')]=function(_0x317bd1,_0x38b088){return db[_0xc755('0x2c')][_0xc755('0x4c')]({'where':{'id':_0x317bd1[_0xc755('0x44')]['id']}})['then'](handleEntityNotFound(_0x38b088,null))[_0xc755('0x27')](removeEntity(_0x38b088,null))[_0xc755('0x45')](handleError(_0x38b088,null));};exports[_0xc755('0x51')]=function(_0x3bfb49,_0x2a4e30,_0x10bd2f){if(_0x3bfb49[_0xc755('0x47')]['id']){delete _0x3bfb49[_0xc755('0x47')]['id'];}return db[_0xc755('0x2c')][_0xc755('0x4c')]({'where':{'id':_0x3bfb49[_0xc755('0x44')]['id']}})[_0xc755('0x27')](handleEntityNotFound(_0x2a4e30,null))['then'](function(_0x545277){if(_0x545277){_0x3bfb49['body'][_0xc755('0x52')]=_0x545277['id'];return db[_0xc755('0x53')][_0xc755('0x46')](_0x3bfb49['body']);}})[_0xc755('0x27')](respondWithResult(_0x2a4e30,null))[_0xc755('0x45')](handleError(_0x2a4e30,null));};exports[_0xc755('0x54')]=function(_0x2ba72d,_0x2329e8,_0x4ec346){if(_0x2ba72d['body']['id']){delete _0x2ba72d[_0xc755('0x47')]['id'];}return db[_0xc755('0x2c')][_0xc755('0x4c')]({'where':{'id':_0x2ba72d['params']['id']}})[_0xc755('0x27')](handleEntityNotFound(_0x2329e8,null))['then'](function(_0x5786ad){if(_0x5786ad){_0x2ba72d[_0xc755('0x47')]['TriggerAnyId']=_0x5786ad['id'];return db['Condition']['create'](_0x2ba72d['body']);}})[_0xc755('0x27')](respondWithResult(_0x2329e8,null))['catch'](handleError(_0x2329e8,null));};exports[_0xc755('0x55')]=function(_0x4e7ad7,_0x306c38,_0x55c52e){var _0x4718ef={};var _0x31d792={};var _0x54fd2d;var _0x2afe08;return db[_0xc755('0x2c')][_0xc755('0x56')]({'where':{'id':_0x4e7ad7['params']['id']}})[_0xc755('0x27')](handleEntityNotFound(_0x306c38,null))[_0xc755('0x27')](function(_0x5530a9){if(_0x5530a9){_0x54fd2d=_0x5530a9;_0x31d792['model']=_['keys'](db[_0xc755('0x53')]['rawAttributes']);_0x31d792['query']=_[_0xc755('0x32')](_0x4e7ad7[_0xc755('0x33')]);_0x31d792[_0xc755('0x34')]=_['intersection'](_0x31d792[_0xc755('0x30')],_0x31d792[_0xc755('0x33')]);_0x4718ef['attributes']=_[_0xc755('0x35')](_0x31d792[_0xc755('0x30')],qs[_0xc755('0x37')](_0x4e7ad7[_0xc755('0x33')][_0xc755('0x37')]));_0x4718ef[_0xc755('0x36')]=_0x4718ef['attributes'][_0xc755('0x57')]?_0x4718ef[_0xc755('0x36')]:_0x31d792[_0xc755('0x30')];_0x4718ef[_0xc755('0x38')]=qs[_0xc755('0x39')](_0x4e7ad7[_0xc755('0x33')][_0xc755('0x39')]);_0x4718ef[_0xc755('0x3a')]=qs[_0xc755('0x34')](_[_0xc755('0x3b')](_0x4e7ad7[_0xc755('0x33')],_0x31d792[_0xc755('0x34')]));if(_0x4e7ad7['query'][_0xc755('0x58')]){_0x4718ef[_0xc755('0x3a')]=_[_0xc755('0x3c')](_0x4718ef[_0xc755('0x3a')],{'$or':_['map'](_0x4718ef[_0xc755('0x36')],function(_0x57204f){var _0x2b6a47={};_0x2b6a47[_0x57204f]={'$like':'%'+_0x4e7ad7[_0xc755('0x33')]['filter']+'%'};return _0x2b6a47;})});}_0x4718ef=_[_0xc755('0x3c')]({},_0x4718ef,_0x4e7ad7[_0xc755('0x3f')]);return _0x54fd2d['getAllConditions'](_0x4718ef);}})[_0xc755('0x27')](function(_0x347c81){if(_0x347c81){_0x2afe08=_0x347c81[_0xc755('0x57')];if(!_0x4e7ad7[_0xc755('0x33')][_0xc755('0x59')](_0xc755('0x5a'))){_0x4718ef['limit']=qs['limit'](_0x4e7ad7[_0xc755('0x33')][_0xc755('0x1e')]);_0x4718ef[_0xc755('0x21')]=qs[_0xc755('0x21')](_0x4e7ad7[_0xc755('0x33')][_0xc755('0x21')]);}return _0x54fd2d['getAllConditions'](_0x4718ef);}})[_0xc755('0x27')](function(_0x208df4){if(_0x208df4){return _0x208df4?{'count':_0x2afe08,'rows':_0x208df4}:null;}})[_0xc755('0x27')](respondWithResult(_0x306c38,null))[_0xc755('0x45')](handleError(_0x306c38,null));};exports['getAnyConditions']=function(_0x6301c4,_0x46d99f,_0x189f87){var _0x2dab80={};var _0x434fc0={};var _0x524353;var _0x311fe0;return db[_0xc755('0x2c')]['findOne']({'where':{'id':_0x6301c4[_0xc755('0x44')]['id']}})[_0xc755('0x27')](handleEntityNotFound(_0x46d99f,null))[_0xc755('0x27')](function(_0x5b1459){if(_0x5b1459){_0x524353=_0x5b1459;_0x434fc0[_0xc755('0x30')]=_[_0xc755('0x32')](db['Condition'][_0xc755('0x2d')]);_0x434fc0[_0xc755('0x33')]=_[_0xc755('0x32')](_0x6301c4[_0xc755('0x33')]);_0x434fc0[_0xc755('0x34')]=_[_0xc755('0x35')](_0x434fc0[_0xc755('0x30')],_0x434fc0[_0xc755('0x33')]);_0x2dab80['attributes']=_[_0xc755('0x35')](_0x434fc0[_0xc755('0x30')],qs[_0xc755('0x37')](_0x6301c4[_0xc755('0x33')][_0xc755('0x37')]));_0x2dab80[_0xc755('0x36')]=_0x2dab80['attributes'][_0xc755('0x57')]?_0x2dab80['attributes']:_0x434fc0[_0xc755('0x30')];_0x2dab80[_0xc755('0x38')]=qs[_0xc755('0x39')](_0x6301c4['query'][_0xc755('0x39')]);_0x2dab80['where']=qs[_0xc755('0x34')](_[_0xc755('0x3b')](_0x6301c4['query'],_0x434fc0['filters']));if(_0x6301c4[_0xc755('0x33')][_0xc755('0x58')]){_0x2dab80[_0xc755('0x3a')]=_[_0xc755('0x3c')](_0x2dab80[_0xc755('0x3a')],{'$or':_[_0xc755('0x31')](_0x2dab80[_0xc755('0x36')],function(_0x50709e){var _0x50acd6={};_0x50acd6[_0x50709e]={'$like':'%'+_0x6301c4[_0xc755('0x33')][_0xc755('0x58')]+'%'};return _0x50acd6;})});}_0x2dab80=_[_0xc755('0x3c')]({},_0x2dab80,_0x6301c4[_0xc755('0x3f')]);return _0x524353['getAnyConditions'](_0x2dab80);}})[_0xc755('0x27')](function(_0x1cb37f){if(_0x1cb37f){_0x311fe0=_0x1cb37f[_0xc755('0x57')];if(!_0x6301c4[_0xc755('0x33')][_0xc755('0x59')]('nolimit')){_0x2dab80[_0xc755('0x1e')]=qs[_0xc755('0x1e')](_0x6301c4[_0xc755('0x33')][_0xc755('0x1e')]);_0x2dab80['offset']=qs['offset'](_0x6301c4[_0xc755('0x33')]['offset']);}return _0x524353['getAnyConditions'](_0x2dab80);}})[_0xc755('0x27')](function(_0x2c3d15){if(_0x2c3d15){return _0x2c3d15?{'count':_0x311fe0,'rows':_0x2c3d15}:null;}})[_0xc755('0x27')](respondWithResult(_0x46d99f,null))[_0xc755('0x45')](handleError(_0x46d99f,null));};exports[_0xc755('0x5b')]=function(_0x3eca73,_0x445677,_0x2c474a){if(_0x3eca73[_0xc755('0x47')]['id']){delete _0x3eca73[_0xc755('0x47')]['id'];}return db['Trigger'][_0xc755('0x4c')]({'where':{'id':_0x3eca73[_0xc755('0x44')]['id']}})[_0xc755('0x27')](handleEntityNotFound(_0x445677,null))[_0xc755('0x27')](function(_0x528fa6){if(_0x528fa6){_0x3eca73['body'][_0xc755('0x5c')]=_0x528fa6['id'];return db[_0xc755('0x5d')]['create'](_0x3eca73[_0xc755('0x47')]);}})[_0xc755('0x27')](respondWithResult(_0x445677,null))[_0xc755('0x45')](handleError(_0x445677,null));};exports[_0xc755('0x5e')]=function(_0x59d0bf,_0x17803a,_0x418610){var _0x13a57c={};var _0x26625c={};var _0x2698af;var _0x50e5a0;return db[_0xc755('0x2c')][_0xc755('0x56')]({'where':{'id':_0x59d0bf['params']['id']}})[_0xc755('0x27')](handleEntityNotFound(_0x17803a,null))['then'](function(_0x170291){if(_0x170291){_0x2698af=_0x170291;_0x26625c[_0xc755('0x30')]=_[_0xc755('0x32')](db[_0xc755('0x5d')][_0xc755('0x2d')]);_0x26625c[_0xc755('0x33')]=_[_0xc755('0x32')](_0x59d0bf[_0xc755('0x33')]);_0x26625c[_0xc755('0x34')]=_[_0xc755('0x35')](_0x26625c[_0xc755('0x30')],_0x26625c[_0xc755('0x33')]);_0x13a57c[_0xc755('0x36')]=_[_0xc755('0x35')](_0x26625c['model'],qs['fields'](_0x59d0bf[_0xc755('0x33')][_0xc755('0x37')]));_0x13a57c['attributes']=_0x13a57c['attributes'][_0xc755('0x57')]?_0x13a57c[_0xc755('0x36')]:_0x26625c[_0xc755('0x30')];_0x13a57c[_0xc755('0x38')]=qs['sort'](_0x59d0bf[_0xc755('0x33')][_0xc755('0x39')]);_0x13a57c[_0xc755('0x3a')]=qs[_0xc755('0x34')](_['pick'](_0x59d0bf[_0xc755('0x33')],_0x26625c[_0xc755('0x34')]));if(_0x59d0bf['query'][_0xc755('0x58')]){_0x13a57c[_0xc755('0x3a')]=_[_0xc755('0x3c')](_0x13a57c[_0xc755('0x3a')],{'$or':_['map'](_0x13a57c[_0xc755('0x36')],function(_0x5eb060){var _0x6d95ce={};_0x6d95ce[_0x5eb060]={'$like':'%'+_0x59d0bf[_0xc755('0x33')][_0xc755('0x58')]+'%'};return _0x6d95ce;})});}_0x13a57c=_[_0xc755('0x3c')]({},_0x13a57c,_0x59d0bf[_0xc755('0x3f')]);return _0x2698af[_0xc755('0x5e')](_0x13a57c);}})[_0xc755('0x27')](function(_0x49f376){if(_0x49f376){_0x50e5a0=_0x49f376['length'];if(!_0x59d0bf[_0xc755('0x33')]['hasOwnProperty'](_0xc755('0x5a'))){_0x13a57c[_0xc755('0x1e')]=qs[_0xc755('0x1e')](_0x59d0bf[_0xc755('0x33')][_0xc755('0x1e')]);_0x13a57c[_0xc755('0x21')]=qs[_0xc755('0x21')](_0x59d0bf[_0xc755('0x33')][_0xc755('0x21')]);}return _0x2698af['getActions'](_0x13a57c);}})[_0xc755('0x27')](function(_0x18f2c3){if(_0x18f2c3){return _0x18f2c3?{'count':_0x50e5a0,'rows':_0x18f2c3}:null;}})['then'](respondWithResult(_0x17803a,null))[_0xc755('0x45')](handleError(_0x17803a,null));};
\ No newline at end of file
+var _0xf09e=['getAnyConditions','addAction','Action','getActions','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','get','error','stack','name','map','Trigger','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','rows','catch','show','params','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne'];(function(_0x4de586,_0x183427){var _0x46baf5=function(_0x1157f0){while(--_0x1157f0){_0x4de586['push'](_0x4de586['shift']());}};_0x46baf5(++_0x183427);}(_0xf09e,0x112));var _0xef09=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xf09e[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0xef09('0x0'));var rimraf=require(_0xef09('0x1'));var zipdir=require(_0xef09('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xef09('0x3'));var BPromise=require(_0xef09('0x4'));var Mustache=require(_0xef09('0x5'));var util=require(_0xef09('0x6'));var path=require('path');var sox=require(_0xef09('0x7'));var csv=require(_0xef09('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xef09('0x9'));var squel=require(_0xef09('0xa'));var crypto=require(_0xef09('0xb'));var jsforce=require(_0xef09('0xc'));var deskjs=require(_0xef09('0xd'));var toCsv=require('to-csv');var querystring=require(_0xef09('0xe'));var Papa=require('papaparse');var Redis=require(_0xef09('0xf'));var authService=require(_0xef09('0x10'));var qs=require(_0xef09('0x11'));var as=require(_0xef09('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xef09('0x13'));var utils=require(_0xef09('0x14'));var config=require(_0xef09('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xef09('0x16'))['db'];function respondWithStatusCode(_0x5759da,_0x4146c2){_0x4146c2=_0x4146c2||0xcc;return function(_0xf33d58){if(_0xf33d58){return _0x5759da[_0xef09('0x17')](_0x4146c2);}return _0x5759da[_0xef09('0x18')](_0x4146c2)[_0xef09('0x19')]();};}function respondWithResult(_0x488df1,_0x28712c){_0x28712c=_0x28712c||0xc8;return function(_0x2b8cde){if(_0x2b8cde){return _0x488df1[_0xef09('0x18')](_0x28712c)['json'](_0x2b8cde);}};}function respondWithFilteredResult(_0x1dc49b,_0x288961){return function(_0x42716a){if(_0x42716a){var _0x45e4fd=typeof _0x288961[_0xef09('0x1a')]===_0xef09('0x1b')&&typeof _0x288961[_0xef09('0x1c')]===_0xef09('0x1b');var _0x35ac75=_0x42716a['count'];var _0x4fd03e=_0x45e4fd?0x0:_0x288961[_0xef09('0x1a')];var _0x6a4abd=_0x45e4fd?_0x42716a[_0xef09('0x1d')]:_0x288961[_0xef09('0x1a')]+_0x288961['limit'];var _0x476c56;if(_0x6a4abd>=_0x35ac75){_0x6a4abd=_0x35ac75;_0x476c56=0xc8;}else{_0x476c56=0xce;}_0x1dc49b[_0xef09('0x18')](_0x476c56);return _0x1dc49b[_0xef09('0x1e')](_0xef09('0x1f'),_0x4fd03e+'-'+_0x6a4abd+'/'+_0x35ac75)[_0xef09('0x20')](_0x42716a);}return null;};}function patchUpdates(_0x34be3a){return function(_0x81ae12){try{jsonpatch[_0xef09('0x21')](_0x81ae12,_0x34be3a,!![]);}catch(_0x298c28){return BPromise['reject'](_0x298c28);}return _0x81ae12[_0xef09('0x22')]();};}function saveUpdates(_0x3551bc,_0x362185){return function(_0x1d9107){if(_0x1d9107){return _0x1d9107[_0xef09('0x23')](_0x3551bc)[_0xef09('0x24')](function(_0x5334ca){return _0x5334ca;});}return null;};}function removeEntity(_0x593afe,_0x4e788d){return function(_0x13c3dd){if(_0x13c3dd){return _0x13c3dd[_0xef09('0x25')]()[_0xef09('0x24')](function(){var _0x3a6aa3=_0x13c3dd[_0xef09('0x26')]({'plain':!![]});var _0x4b02cd='Triggers';return db['UserProfileResource'][_0xef09('0x25')]({'where':{'type':_0x4b02cd,'resourceId':_0x3a6aa3['id']}})[_0xef09('0x24')](function(){return _0x13c3dd;});})[_0xef09('0x24')](function(){_0x593afe['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2dda75,_0x32a005){return function(_0x1617af){if(!_0x1617af){_0x2dda75[_0xef09('0x17')](0x194);}return _0x1617af;};}function handleError(_0x38e52b,_0x14c80f){_0x14c80f=_0x14c80f||0x1f4;return function(_0x190c58){logger[_0xef09('0x27')](_0x190c58[_0xef09('0x28')]);if(_0x190c58[_0xef09('0x29')]){delete _0x190c58[_0xef09('0x29')];}_0x38e52b[_0xef09('0x18')](_0x14c80f)['send'](_0x190c58);};}exports['index']=function(_0x1e21ba,_0x4baf57){var _0x28aad={},_0x22a6c9={},_0x2fb8b5={'count':0x0,'rows':[]};var _0x7ec1c7=_[_0xef09('0x2a')](db[_0xef09('0x2b')][_0xef09('0x2c')],function(_0x4f3c1b){return{'name':_0x4f3c1b[_0xef09('0x2d')],'type':_0x4f3c1b[_0xef09('0x2e')][_0xef09('0x2f')]};});_0x22a6c9[_0xef09('0x30')]=_[_0xef09('0x2a')](_0x7ec1c7,_0xef09('0x29'));_0x22a6c9['query']=_[_0xef09('0x31')](_0x1e21ba[_0xef09('0x32')]);_0x22a6c9[_0xef09('0x33')]=_[_0xef09('0x34')](_0x22a6c9['model'],_0x22a6c9[_0xef09('0x32')]);_0x28aad[_0xef09('0x35')]=_[_0xef09('0x34')](_0x22a6c9[_0xef09('0x30')],qs['fields'](_0x1e21ba[_0xef09('0x32')][_0xef09('0x36')]));_0x28aad[_0xef09('0x35')]=_0x28aad[_0xef09('0x35')][_0xef09('0x37')]?_0x28aad['attributes']:_0x22a6c9['model'];if(!_0x1e21ba[_0xef09('0x32')][_0xef09('0x38')](_0xef09('0x39'))){_0x28aad[_0xef09('0x1c')]=qs[_0xef09('0x1c')](_0x1e21ba[_0xef09('0x32')][_0xef09('0x1c')]);_0x28aad[_0xef09('0x1a')]=qs[_0xef09('0x1a')](_0x1e21ba[_0xef09('0x32')][_0xef09('0x1a')]);}_0x28aad[_0xef09('0x3a')]=qs[_0xef09('0x3b')](_0x1e21ba[_0xef09('0x32')][_0xef09('0x3b')]);_0x28aad[_0xef09('0x3c')]=qs[_0xef09('0x33')](_[_0xef09('0x3d')](_0x1e21ba['query'],_0x22a6c9[_0xef09('0x33')]),_0x7ec1c7);if(_0x1e21ba[_0xef09('0x32')][_0xef09('0x3e')]){_0x28aad[_0xef09('0x3c')]=_[_0xef09('0x3f')](_0x28aad['where'],{'$or':_[_0xef09('0x2a')](_0x7ec1c7,function(_0x55215d){if(_0x55215d[_0xef09('0x2e')]!==_0xef09('0x40')){var _0x18ddcc={};_0x18ddcc[_0x55215d[_0xef09('0x29')]]={'$like':'%'+_0x1e21ba[_0xef09('0x32')][_0xef09('0x3e')]+'%'};return _0x18ddcc;}})});}_0x28aad=_[_0xef09('0x3f')]({},_0x28aad,_0x1e21ba[_0xef09('0x41')]);var _0x3b4ff4={'where':_0x28aad[_0xef09('0x3c')]};return db[_0xef09('0x2b')]['count'](_0x3b4ff4)[_0xef09('0x24')](function(_0x4642ee){_0x2fb8b5[_0xef09('0x1d')]=_0x4642ee;if(_0x1e21ba[_0xef09('0x32')]['includeAll']){_0x28aad['include']=[{'all':!![]}];}return db[_0xef09('0x2b')]['findAll'](_0x28aad);})[_0xef09('0x24')](function(_0x1829f4){_0x2fb8b5[_0xef09('0x42')]=_0x1829f4;return _0x2fb8b5;})[_0xef09('0x24')](respondWithFilteredResult(_0x4baf57,_0x28aad))[_0xef09('0x43')](handleError(_0x4baf57,null));};exports[_0xef09('0x44')]=function(_0x4a8324,_0x34ea07){var _0x1a5ba9={'raw':![],'where':{'id':_0x4a8324[_0xef09('0x45')]['id']}},_0x5af931={};_0x5af931['model']=_[_0xef09('0x31')](db[_0xef09('0x2b')][_0xef09('0x2c')]);_0x5af931['query']=_['keys'](_0x4a8324['query']);_0x5af931[_0xef09('0x33')]=_[_0xef09('0x34')](_0x5af931[_0xef09('0x30')],_0x5af931['query']);_0x1a5ba9[_0xef09('0x35')]=_[_0xef09('0x34')](_0x5af931[_0xef09('0x30')],qs[_0xef09('0x36')](_0x4a8324[_0xef09('0x32')]['fields']));_0x1a5ba9[_0xef09('0x35')]=_0x1a5ba9['attributes'][_0xef09('0x37')]?_0x1a5ba9['attributes']:_0x5af931[_0xef09('0x30')];if(_0x4a8324[_0xef09('0x32')][_0xef09('0x46')]){_0x1a5ba9[_0xef09('0x47')]=[{'all':!![]}];}_0x1a5ba9=_[_0xef09('0x3f')]({},_0x1a5ba9,_0x4a8324[_0xef09('0x41')]);return db[_0xef09('0x2b')][_0xef09('0x48')](_0x1a5ba9)[_0xef09('0x24')](handleEntityNotFound(_0x34ea07,null))[_0xef09('0x24')](respondWithResult(_0x34ea07,null))[_0xef09('0x43')](handleError(_0x34ea07,null));};exports[_0xef09('0x49')]=function(_0x1becf9,_0x3823df){return db[_0xef09('0x2b')][_0xef09('0x49')](_0x1becf9[_0xef09('0x4a')],{})['then'](function(_0xbfa2bb){var _0xa7b74f=_0x1becf9[_0xef09('0x4b')][_0xef09('0x26')]({'plain':!![]});if(!_0xa7b74f)throw new Error(_0xef09('0x4c'));if(_0xa7b74f['role']==='user'){var _0x51c22d=_0xbfa2bb['get']({'plain':!![]});var _0x56da5d='Triggers';return db['UserProfileSection']['find']({'where':{'name':_0x56da5d,'userProfileId':_0xa7b74f['userProfileId']},'raw':!![]})['then'](function(_0x49fa9a){if(_0x49fa9a&&_0x49fa9a[_0xef09('0x4d')]===0x0){return db[_0xef09('0x4e')][_0xef09('0x49')]({'name':_0x51c22d[_0xef09('0x29')],'resourceId':_0x51c22d['id'],'type':_0x49fa9a[_0xef09('0x29')],'sectionId':_0x49fa9a['id']},{})[_0xef09('0x24')](function(){return _0xbfa2bb;});}else{return _0xbfa2bb;}})[_0xef09('0x43')](function(_0x2dc79a){logger[_0xef09('0x27')](_0xef09('0x4f'),_0x2dc79a);throw _0x2dc79a;});}return _0xbfa2bb;})[_0xef09('0x24')](respondWithResult(_0x3823df,0xc9))[_0xef09('0x43')](handleError(_0x3823df,null));};exports[_0xef09('0x23')]=function(_0x128ef7,_0x13a548){if(_0x128ef7['body']['id']){delete _0x128ef7[_0xef09('0x4a')]['id'];}return db[_0xef09('0x2b')]['find']({'where':{'id':_0x128ef7[_0xef09('0x45')]['id']}})[_0xef09('0x24')](handleEntityNotFound(_0x13a548,null))[_0xef09('0x24')](saveUpdates(_0x128ef7[_0xef09('0x4a')],null))[_0xef09('0x24')](respondWithResult(_0x13a548,null))[_0xef09('0x43')](handleError(_0x13a548,null));};exports[_0xef09('0x25')]=function(_0x387b95,_0xe23a90){return db[_0xef09('0x2b')]['find']({'where':{'id':_0x387b95['params']['id']}})[_0xef09('0x24')](handleEntityNotFound(_0xe23a90,null))[_0xef09('0x24')](removeEntity(_0xe23a90,null))[_0xef09('0x43')](handleError(_0xe23a90,null));};exports[_0xef09('0x50')]=function(_0x31da5c,_0x517b3a,_0x2acaca){if(_0x31da5c[_0xef09('0x4a')]['id']){delete _0x31da5c[_0xef09('0x4a')]['id'];}return db[_0xef09('0x2b')][_0xef09('0x48')]({'where':{'id':_0x31da5c[_0xef09('0x45')]['id']}})[_0xef09('0x24')](handleEntityNotFound(_0x517b3a,null))[_0xef09('0x24')](function(_0x34f89f){if(_0x34f89f){_0x31da5c[_0xef09('0x4a')]['TriggerAllId']=_0x34f89f['id'];return db[_0xef09('0x51')][_0xef09('0x49')](_0x31da5c[_0xef09('0x4a')]);}})[_0xef09('0x24')](respondWithResult(_0x517b3a,null))[_0xef09('0x43')](handleError(_0x517b3a,null));};exports[_0xef09('0x52')]=function(_0x14899b,_0x4bda28,_0x49a728){if(_0x14899b[_0xef09('0x4a')]['id']){delete _0x14899b[_0xef09('0x4a')]['id'];}return db[_0xef09('0x2b')]['find']({'where':{'id':_0x14899b[_0xef09('0x45')]['id']}})[_0xef09('0x24')](handleEntityNotFound(_0x4bda28,null))[_0xef09('0x24')](function(_0x2b6da0){if(_0x2b6da0){_0x14899b[_0xef09('0x4a')][_0xef09('0x53')]=_0x2b6da0['id'];return db[_0xef09('0x51')][_0xef09('0x49')](_0x14899b[_0xef09('0x4a')]);}})['then'](respondWithResult(_0x4bda28,null))[_0xef09('0x43')](handleError(_0x4bda28,null));};exports[_0xef09('0x54')]=function(_0x180527,_0x1d2085,_0x40428c){var _0x4f8b1c={};var _0x4e28bd={};var _0x7177d9;var _0x3846c8;return db[_0xef09('0x2b')][_0xef09('0x55')]({'where':{'id':_0x180527[_0xef09('0x45')]['id']}})[_0xef09('0x24')](handleEntityNotFound(_0x1d2085,null))[_0xef09('0x24')](function(_0x4ce993){if(_0x4ce993){_0x7177d9=_0x4ce993;_0x4e28bd[_0xef09('0x30')]=_[_0xef09('0x31')](db[_0xef09('0x51')][_0xef09('0x2c')]);_0x4e28bd[_0xef09('0x32')]=_[_0xef09('0x31')](_0x180527[_0xef09('0x32')]);_0x4e28bd['filters']=_['intersection'](_0x4e28bd[_0xef09('0x30')],_0x4e28bd['query']);_0x4f8b1c['attributes']=_['intersection'](_0x4e28bd['model'],qs[_0xef09('0x36')](_0x180527[_0xef09('0x32')][_0xef09('0x36')]));_0x4f8b1c[_0xef09('0x35')]=_0x4f8b1c['attributes'][_0xef09('0x37')]?_0x4f8b1c[_0xef09('0x35')]:_0x4e28bd[_0xef09('0x30')];_0x4f8b1c[_0xef09('0x3a')]=qs[_0xef09('0x3b')](_0x180527[_0xef09('0x32')][_0xef09('0x3b')]);_0x4f8b1c[_0xef09('0x3c')]=qs[_0xef09('0x33')](_[_0xef09('0x3d')](_0x180527[_0xef09('0x32')],_0x4e28bd[_0xef09('0x33')]));if(_0x180527[_0xef09('0x32')][_0xef09('0x3e')]){_0x4f8b1c[_0xef09('0x3c')]=_['merge'](_0x4f8b1c[_0xef09('0x3c')],{'$or':_[_0xef09('0x2a')](_0x4f8b1c[_0xef09('0x35')],function(_0x5ce4cb){var _0xc38db0={};_0xc38db0[_0x5ce4cb]={'$like':'%'+_0x180527[_0xef09('0x32')]['filter']+'%'};return _0xc38db0;})});}_0x4f8b1c=_[_0xef09('0x3f')]({},_0x4f8b1c,_0x180527[_0xef09('0x41')]);return _0x7177d9[_0xef09('0x54')](_0x4f8b1c);}})[_0xef09('0x24')](function(_0x3dc5d9){if(_0x3dc5d9){_0x3846c8=_0x3dc5d9[_0xef09('0x37')];if(!_0x180527[_0xef09('0x32')][_0xef09('0x38')](_0xef09('0x39'))){_0x4f8b1c[_0xef09('0x1c')]=qs[_0xef09('0x1c')](_0x180527[_0xef09('0x32')][_0xef09('0x1c')]);_0x4f8b1c[_0xef09('0x1a')]=qs[_0xef09('0x1a')](_0x180527[_0xef09('0x32')][_0xef09('0x1a')]);}return _0x7177d9[_0xef09('0x54')](_0x4f8b1c);}})['then'](function(_0x4f75ef){if(_0x4f75ef){return _0x4f75ef?{'count':_0x3846c8,'rows':_0x4f75ef}:null;}})[_0xef09('0x24')](respondWithResult(_0x1d2085,null))[_0xef09('0x43')](handleError(_0x1d2085,null));};exports[_0xef09('0x56')]=function(_0x1bb157,_0x5bc248,_0x5cc86f){var _0x3bc0aa={};var _0x169e95={};var _0xdadcf8;var _0x3cef36;return db['Trigger'][_0xef09('0x55')]({'where':{'id':_0x1bb157[_0xef09('0x45')]['id']}})['then'](handleEntityNotFound(_0x5bc248,null))[_0xef09('0x24')](function(_0x4965a0){if(_0x4965a0){_0xdadcf8=_0x4965a0;_0x169e95[_0xef09('0x30')]=_[_0xef09('0x31')](db[_0xef09('0x51')]['rawAttributes']);_0x169e95['query']=_[_0xef09('0x31')](_0x1bb157[_0xef09('0x32')]);_0x169e95[_0xef09('0x33')]=_[_0xef09('0x34')](_0x169e95[_0xef09('0x30')],_0x169e95['query']);_0x3bc0aa[_0xef09('0x35')]=_[_0xef09('0x34')](_0x169e95[_0xef09('0x30')],qs[_0xef09('0x36')](_0x1bb157[_0xef09('0x32')][_0xef09('0x36')]));_0x3bc0aa[_0xef09('0x35')]=_0x3bc0aa[_0xef09('0x35')][_0xef09('0x37')]?_0x3bc0aa[_0xef09('0x35')]:_0x169e95['model'];_0x3bc0aa['order']=qs[_0xef09('0x3b')](_0x1bb157[_0xef09('0x32')][_0xef09('0x3b')]);_0x3bc0aa[_0xef09('0x3c')]=qs[_0xef09('0x33')](_[_0xef09('0x3d')](_0x1bb157[_0xef09('0x32')],_0x169e95[_0xef09('0x33')]));if(_0x1bb157[_0xef09('0x32')][_0xef09('0x3e')]){_0x3bc0aa[_0xef09('0x3c')]=_[_0xef09('0x3f')](_0x3bc0aa['where'],{'$or':_[_0xef09('0x2a')](_0x3bc0aa[_0xef09('0x35')],function(_0x55d919){var _0x4e1edc={};_0x4e1edc[_0x55d919]={'$like':'%'+_0x1bb157[_0xef09('0x32')][_0xef09('0x3e')]+'%'};return _0x4e1edc;})});}_0x3bc0aa=_['merge']({},_0x3bc0aa,_0x1bb157['options']);return _0xdadcf8[_0xef09('0x56')](_0x3bc0aa);}})[_0xef09('0x24')](function(_0x1e90e0){if(_0x1e90e0){_0x3cef36=_0x1e90e0[_0xef09('0x37')];if(!_0x1bb157['query'][_0xef09('0x38')]('nolimit')){_0x3bc0aa['limit']=qs[_0xef09('0x1c')](_0x1bb157[_0xef09('0x32')][_0xef09('0x1c')]);_0x3bc0aa[_0xef09('0x1a')]=qs['offset'](_0x1bb157['query']['offset']);}return _0xdadcf8[_0xef09('0x56')](_0x3bc0aa);}})[_0xef09('0x24')](function(_0x215164){if(_0x215164){return _0x215164?{'count':_0x3cef36,'rows':_0x215164}:null;}})[_0xef09('0x24')](respondWithResult(_0x5bc248,null))[_0xef09('0x43')](handleError(_0x5bc248,null));};exports[_0xef09('0x57')]=function(_0x4dae2d,_0x23400e,_0x445d2b){if(_0x4dae2d[_0xef09('0x4a')]['id']){delete _0x4dae2d['body']['id'];}return db[_0xef09('0x2b')][_0xef09('0x48')]({'where':{'id':_0x4dae2d[_0xef09('0x45')]['id']}})['then'](handleEntityNotFound(_0x23400e,null))['then'](function(_0x30531f){if(_0x30531f){_0x4dae2d[_0xef09('0x4a')]['TriggerId']=_0x30531f['id'];return db[_0xef09('0x58')][_0xef09('0x49')](_0x4dae2d[_0xef09('0x4a')]);}})[_0xef09('0x24')](respondWithResult(_0x23400e,null))['catch'](handleError(_0x23400e,null));};exports[_0xef09('0x59')]=function(_0x558ca7,_0x1c502a,_0x23ff74){var _0x3d1e9d={};var _0x2eec3a={};var _0x35655f;var _0x456786;return db[_0xef09('0x2b')][_0xef09('0x55')]({'where':{'id':_0x558ca7[_0xef09('0x45')]['id']}})['then'](handleEntityNotFound(_0x1c502a,null))[_0xef09('0x24')](function(_0x15d435){if(_0x15d435){_0x35655f=_0x15d435;_0x2eec3a[_0xef09('0x30')]=_[_0xef09('0x31')](db['Action'][_0xef09('0x2c')]);_0x2eec3a['query']=_[_0xef09('0x31')](_0x558ca7['query']);_0x2eec3a[_0xef09('0x33')]=_[_0xef09('0x34')](_0x2eec3a[_0xef09('0x30')],_0x2eec3a[_0xef09('0x32')]);_0x3d1e9d[_0xef09('0x35')]=_[_0xef09('0x34')](_0x2eec3a[_0xef09('0x30')],qs[_0xef09('0x36')](_0x558ca7[_0xef09('0x32')][_0xef09('0x36')]));_0x3d1e9d[_0xef09('0x35')]=_0x3d1e9d[_0xef09('0x35')]['length']?_0x3d1e9d[_0xef09('0x35')]:_0x2eec3a[_0xef09('0x30')];_0x3d1e9d[_0xef09('0x3a')]=qs[_0xef09('0x3b')](_0x558ca7[_0xef09('0x32')]['sort']);_0x3d1e9d[_0xef09('0x3c')]=qs[_0xef09('0x33')](_['pick'](_0x558ca7[_0xef09('0x32')],_0x2eec3a[_0xef09('0x33')]));if(_0x558ca7[_0xef09('0x32')][_0xef09('0x3e')]){_0x3d1e9d[_0xef09('0x3c')]=_[_0xef09('0x3f')](_0x3d1e9d[_0xef09('0x3c')],{'$or':_[_0xef09('0x2a')](_0x3d1e9d[_0xef09('0x35')],function(_0x1f8f5b){var _0x5a1bb5={};_0x5a1bb5[_0x1f8f5b]={'$like':'%'+_0x558ca7[_0xef09('0x32')][_0xef09('0x3e')]+'%'};return _0x5a1bb5;})});}_0x3d1e9d=_[_0xef09('0x3f')]({},_0x3d1e9d,_0x558ca7[_0xef09('0x41')]);return _0x35655f[_0xef09('0x59')](_0x3d1e9d);}})['then'](function(_0x31616d){if(_0x31616d){_0x456786=_0x31616d[_0xef09('0x37')];if(!_0x558ca7[_0xef09('0x32')][_0xef09('0x38')](_0xef09('0x39'))){_0x3d1e9d[_0xef09('0x1c')]=qs[_0xef09('0x1c')](_0x558ca7[_0xef09('0x32')][_0xef09('0x1c')]);_0x3d1e9d[_0xef09('0x1a')]=qs['offset'](_0x558ca7[_0xef09('0x32')]['offset']);}return _0x35655f[_0xef09('0x59')](_0x3d1e9d);}})[_0xef09('0x24')](function(_0x18e094){if(_0x18e094){return _0x18e094?{'count':_0x456786,'rows':_0x18e094}:null;}})[_0xef09('0x24')](respondWithResult(_0x1c502a,null))[_0xef09('0x43')](handleError(_0x1c502a,null));};
\ No newline at end of file
index 5c80d28..3a416ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57d4=['exports','Trigger','tools_triggers','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes'];(function(_0x209ec9,_0x30378c){var _0x129b1b=function(_0x2f2b9e){while(--_0x2f2b9e){_0x209ec9['push'](_0x209ec9['shift']());}};_0x129b1b(++_0x30378c);}(_0x57d4,0x78));var _0x457d=function(_0x5f1b1f,_0x543a83){_0x5f1b1f=_0x5f1b1f-0x0;var _0x5cfc62=_0x57d4[_0x5f1b1f];return _0x5cfc62;};'use strict';var _=require(_0x457d('0x0'));var util=require(_0x457d('0x1'));var logger=require('../../config/logger')(_0x457d('0x2'));var moment=require(_0x457d('0x3'));var BPromise=require(_0x457d('0x4'));var rp=require(_0x457d('0x5'));var fs=require('fs');var path=require(_0x457d('0x6'));var rimraf=require(_0x457d('0x7'));var config=require(_0x457d('0x8'));var attributes=require(_0x457d('0x9'));module[_0x457d('0xa')]=function(_0x247ec7,_0x3fd867){return _0x247ec7['define'](_0x457d('0xb'),attributes,{'tableName':_0x457d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x093a=['Trigger','tools_triggers','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define'];(function(_0x2d344f,_0x25fa84){var _0x2e796b=function(_0x10466a){while(--_0x10466a){_0x2d344f['push'](_0x2d344f['shift']());}};_0x2e796b(++_0x25fa84);}(_0x093a,0x16a));var _0xa093=function(_0x5575cd,_0x73ab7a){_0x5575cd=_0x5575cd-0x0;var _0x4979a0=_0x093a[_0x5575cd];return _0x4979a0;};'use strict';var _=require('lodash');var util=require(_0xa093('0x0'));var logger=require(_0xa093('0x1'))(_0xa093('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa093('0x3'));var fs=require('fs');var path=require(_0xa093('0x4'));var rimraf=require(_0xa093('0x5'));var config=require(_0xa093('0x6'));var attributes=require(_0xa093('0x7'));module[_0xa093('0x8')]=function(_0x2346f1,_0x145f58){return _0x2346f1[_0xa093('0x9')](_0xa093('0xa'),attributes,{'tableName':_0xa093('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 05461f6..442d295 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8650=['util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTrigger','findAll','options','raw','where','attributes','limit','map','include','model','debug','ShowTrigger','Trigger','find','lodash'];(function(_0x5c3e11,_0x4dd35b){var _0x4e9064=function(_0x5ae0cf){while(--_0x5ae0cf){_0x5c3e11['push'](_0x5c3e11['shift']());}};_0x4e9064(++_0x4dd35b);}(_0x8650,0x15d));var _0x0865=function(_0x4a39af,_0x57894f){_0x4a39af=_0x4a39af-0x0;var _0x4ffb41=_0x8650[_0x4a39af];return _0x4ffb41;};'use strict';var _=require(_0x0865('0x0'));var util=require(_0x0865('0x1'));var moment=require(_0x0865('0x2'));var BPromise=require(_0x0865('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0865('0x4'));var logger=require(_0x0865('0x5'))(_0x0865('0x6'));var config=require(_0x0865('0x7'));var jayson=require(_0x0865('0x8'));var client=jayson[_0x0865('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27b4d9,_0x4632b1,_0x2c3779){return new BPromise(function(_0x19d8cb,_0x591cc7){return client[_0x0865('0xa')](_0x27b4d9,_0x2c3779)[_0x0865('0xb')](function(_0x2431be){logger[_0x0865('0xc')](_0x0865('0xd'),_0x4632b1,_0x0865('0xe'));logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x4632b1,_0x0865('0xe'),JSON[_0x0865('0xf')](_0x2431be));if(_0x2431be[_0x0865('0x10')]){if(_0x2431be['error'][_0x0865('0x11')]===0x1f4){logger['error'](_0x0865('0xd'),_0x4632b1,_0x2431be[_0x0865('0x10')][_0x0865('0x12')]);return _0x591cc7(_0x2431be['error'][_0x0865('0x12')]);}logger['error'](_0x0865('0xd'),_0x4632b1,_0x2431be['error'][_0x0865('0x12')]);return _0x19d8cb(_0x2431be[_0x0865('0x10')]['message']);}else{logger[_0x0865('0xc')](_0x0865('0xd'),_0x4632b1,_0x0865('0xe'));_0x19d8cb(_0x2431be[_0x0865('0x13')][_0x0865('0x12')]);}})[_0x0865('0x14')](function(_0x344113){logger['error'](_0x0865('0xd'),_0x4632b1,_0x344113);_0x591cc7(_0x344113);});});}exports[_0x0865('0x15')]=function(_0x449522){var _0x48591e=this;return new Promise(function(_0x6d0ae5,_0xbc076c){return db['Trigger'][_0x0865('0x16')]({'raw':_0x449522['options']?_0x449522[_0x0865('0x17')][_0x0865('0x18')]===undefined?!![]:![]:!![],'where':_0x449522['options']?_0x449522[_0x0865('0x17')][_0x0865('0x19')]||null:null,'attributes':_0x449522[_0x0865('0x17')]?_0x449522['options'][_0x0865('0x1a')]||null:null,'limit':_0x449522[_0x0865('0x17')]?_0x449522['options'][_0x0865('0x1b')]||null:null,'include':_0x449522['options']?_0x449522['options']['include']?_[_0x0865('0x1c')](_0x449522['options'][_0x0865('0x1d')],function(_0x31984d){return{'model':db[_0x31984d[_0x0865('0x1e')]],'as':_0x31984d['as'],'attributes':_0x31984d[_0x0865('0x1a')],'include':_0x31984d[_0x0865('0x1d')]?_[_0x0865('0x1c')](_0x31984d['include'],function(_0x2eff03){return{'model':db[_0x2eff03[_0x0865('0x1e')]],'as':_0x2eff03['as'],'attributes':_0x2eff03[_0x0865('0x1a')],'include':_0x2eff03['include']?_[_0x0865('0x1c')](_0x2eff03[_0x0865('0x1d')],function(_0x2d99d0){return{'model':db[_0x2d99d0[_0x0865('0x1e')]],'as':_0x2d99d0['as'],'attributes':_0x2d99d0[_0x0865('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0865('0xb')](function(_0x5bfe39){logger[_0x0865('0xc')](_0x0865('0x15'),_0x449522);logger[_0x0865('0x1f')](_0x0865('0x15'),_0x449522,JSON['stringify'](_0x5bfe39));_0x6d0ae5(_0x5bfe39);})[_0x0865('0x14')](function(_0x578171){logger[_0x0865('0x10')](_0x0865('0x15'),_0x578171[_0x0865('0x12')],_0x449522);_0xbc076c(_0x48591e[_0x0865('0x10')](0x1f4,_0x578171[_0x0865('0x12')]));});});};exports[_0x0865('0x20')]=function(_0x5e40ef){var _0x22b102=this;return new Promise(function(_0x233d3c,_0x388a3c){return db[_0x0865('0x21')][_0x0865('0x22')]({'raw':_0x5e40ef[_0x0865('0x17')]?_0x5e40ef[_0x0865('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5e40ef[_0x0865('0x17')]?_0x5e40ef[_0x0865('0x17')][_0x0865('0x19')]||null:null,'attributes':_0x5e40ef[_0x0865('0x17')]?_0x5e40ef[_0x0865('0x17')]['attributes']||null:null,'include':_0x5e40ef['options']?_0x5e40ef[_0x0865('0x17')][_0x0865('0x1d')]?_['map'](_0x5e40ef[_0x0865('0x17')]['include'],function(_0x224821){return{'model':db[_0x224821[_0x0865('0x1e')]],'as':_0x224821['as'],'attributes':_0x224821[_0x0865('0x1a')],'include':_0x224821[_0x0865('0x1d')]?_[_0x0865('0x1c')](_0x224821[_0x0865('0x1d')],function(_0x567ada){return{'model':db[_0x567ada[_0x0865('0x1e')]],'as':_0x567ada['as'],'attributes':_0x567ada[_0x0865('0x1a')],'include':_0x567ada['include']?_[_0x0865('0x1c')](_0x567ada[_0x0865('0x1d')],function(_0x4d7313){return{'model':db[_0x4d7313['model']],'as':_0x4d7313['as'],'attributes':_0x4d7313['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x50ef00){logger['info'](_0x0865('0x20'),_0x5e40ef);logger[_0x0865('0x1f')](_0x0865('0x20'),_0x5e40ef,JSON[_0x0865('0xf')](_0x50ef00));_0x233d3c(_0x50ef00);})[_0x0865('0x14')](function(_0x44c11e){logger[_0x0865('0x10')](_0x0865('0x20'),_0x44c11e[_0x0865('0x12')],_0x5e40ef);_0x388a3c(_0x22b102['error'](0x1f4,_0x44c11e[_0x0865('0x12')]));});});};
\ No newline at end of file
+var _0xb898=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','map','include','model','ShowTrigger','find','lodash','util','moment','bluebird','randomstring'];(function(_0x4c76ce,_0x404fc7){var _0x5ca070=function(_0x28534f){while(--_0x28534f){_0x4c76ce['push'](_0x4c76ce['shift']());}};_0x5ca070(++_0x404fc7);}(_0xb898,0x8b));var _0x8b89=function(_0x4394b6,_0x12357f){_0x4394b6=_0x4394b6-0x0;var _0x360244=_0xb898[_0x4394b6];return _0x360244;};'use strict';var _=require(_0x8b89('0x0'));var util=require(_0x8b89('0x1'));var moment=require(_0x8b89('0x2'));var BPromise=require(_0x8b89('0x3'));var rs=require(_0x8b89('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8b89('0x5'))['db'];var utils=require(_0x8b89('0x6'));var logger=require(_0x8b89('0x7'))('rpc');var config=require(_0x8b89('0x8'));var jayson=require(_0x8b89('0x9'));var client=jayson[_0x8b89('0xa')][_0x8b89('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d915a,_0x3065f3,_0x28664d){return new BPromise(function(_0x36a0fe,_0x1c6e76){return client[_0x8b89('0xc')](_0x5d915a,_0x28664d)[_0x8b89('0xd')](function(_0x4f55aa){logger[_0x8b89('0xe')](_0x8b89('0xf'),_0x3065f3,_0x8b89('0x10'));logger[_0x8b89('0x11')](_0x8b89('0x12'),_0x3065f3,_0x8b89('0x10'),JSON[_0x8b89('0x13')](_0x4f55aa));if(_0x4f55aa[_0x8b89('0x14')]){if(_0x4f55aa['error'][_0x8b89('0x15')]===0x1f4){logger[_0x8b89('0x14')](_0x8b89('0xf'),_0x3065f3,_0x4f55aa['error'][_0x8b89('0x16')]);return _0x1c6e76(_0x4f55aa[_0x8b89('0x14')]['message']);}logger['error']('Trigger,\x20%s,\x20%s',_0x3065f3,_0x4f55aa[_0x8b89('0x14')][_0x8b89('0x16')]);return _0x36a0fe(_0x4f55aa[_0x8b89('0x14')][_0x8b89('0x16')]);}else{logger[_0x8b89('0xe')](_0x8b89('0xf'),_0x3065f3,_0x8b89('0x10'));_0x36a0fe(_0x4f55aa['result'][_0x8b89('0x16')]);}})[_0x8b89('0x17')](function(_0x3d2572){logger['error'](_0x8b89('0xf'),_0x3065f3,_0x3d2572);_0x1c6e76(_0x3d2572);});});}exports[_0x8b89('0x18')]=function(_0x212e0b){var _0x101ae8=this;return new Promise(function(_0x481ca0,_0x474cae){return db[_0x8b89('0x19')][_0x8b89('0x1a')]({'raw':_0x212e0b[_0x8b89('0x1b')]?_0x212e0b[_0x8b89('0x1b')][_0x8b89('0x1c')]===undefined?!![]:![]:!![],'where':_0x212e0b[_0x8b89('0x1b')]?_0x212e0b[_0x8b89('0x1b')][_0x8b89('0x1d')]||null:null,'attributes':_0x212e0b[_0x8b89('0x1b')]?_0x212e0b[_0x8b89('0x1b')][_0x8b89('0x1e')]||null:null,'limit':_0x212e0b[_0x8b89('0x1b')]?_0x212e0b['options']['limit']||null:null,'include':_0x212e0b[_0x8b89('0x1b')]?_0x212e0b[_0x8b89('0x1b')]['include']?_[_0x8b89('0x1f')](_0x212e0b[_0x8b89('0x1b')][_0x8b89('0x20')],function(_0x43aa9d){return{'model':db[_0x43aa9d[_0x8b89('0x21')]],'as':_0x43aa9d['as'],'attributes':_0x43aa9d['attributes'],'include':_0x43aa9d[_0x8b89('0x20')]?_['map'](_0x43aa9d[_0x8b89('0x20')],function(_0xd9dde3){return{'model':db[_0xd9dde3['model']],'as':_0xd9dde3['as'],'attributes':_0xd9dde3[_0x8b89('0x1e')],'include':_0xd9dde3[_0x8b89('0x20')]?_[_0x8b89('0x1f')](_0xd9dde3['include'],function(_0x1903f1){return{'model':db[_0x1903f1[_0x8b89('0x21')]],'as':_0x1903f1['as'],'attributes':_0x1903f1[_0x8b89('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x400266){logger[_0x8b89('0xe')](_0x8b89('0x18'),_0x212e0b);logger[_0x8b89('0x11')](_0x8b89('0x18'),_0x212e0b,JSON[_0x8b89('0x13')](_0x400266));_0x481ca0(_0x400266);})[_0x8b89('0x17')](function(_0x213299){logger[_0x8b89('0x14')](_0x8b89('0x18'),_0x213299[_0x8b89('0x16')],_0x212e0b);_0x474cae(_0x101ae8[_0x8b89('0x14')](0x1f4,_0x213299['message']));});});};exports[_0x8b89('0x22')]=function(_0x35c52c){var _0x14e224=this;return new Promise(function(_0x113753,_0x230f7b){return db[_0x8b89('0x19')][_0x8b89('0x23')]({'raw':_0x35c52c['options']?_0x35c52c[_0x8b89('0x1b')][_0x8b89('0x1c')]===undefined?!![]:![]:!![],'where':_0x35c52c['options']?_0x35c52c[_0x8b89('0x1b')][_0x8b89('0x1d')]||null:null,'attributes':_0x35c52c[_0x8b89('0x1b')]?_0x35c52c[_0x8b89('0x1b')][_0x8b89('0x1e')]||null:null,'include':_0x35c52c[_0x8b89('0x1b')]?_0x35c52c[_0x8b89('0x1b')][_0x8b89('0x20')]?_[_0x8b89('0x1f')](_0x35c52c[_0x8b89('0x1b')][_0x8b89('0x20')],function(_0x514992){return{'model':db[_0x514992['model']],'as':_0x514992['as'],'attributes':_0x514992['attributes'],'include':_0x514992[_0x8b89('0x20')]?_[_0x8b89('0x1f')](_0x514992['include'],function(_0x2ce503){return{'model':db[_0x2ce503[_0x8b89('0x21')]],'as':_0x2ce503['as'],'attributes':_0x2ce503[_0x8b89('0x1e')],'include':_0x2ce503[_0x8b89('0x20')]?_[_0x8b89('0x1f')](_0x2ce503[_0x8b89('0x20')],function(_0x156cad){return{'model':db[_0x156cad[_0x8b89('0x21')]],'as':_0x156cad['as'],'attributes':_0x156cad['attributes']};}):[]};}):[]};}):[]:[]})[_0x8b89('0xd')](function(_0x3e1140){logger[_0x8b89('0xe')](_0x8b89('0x22'),_0x35c52c);logger[_0x8b89('0x11')]('ShowTrigger',_0x35c52c,JSON[_0x8b89('0x13')](_0x3e1140));_0x113753(_0x3e1140);})['catch'](function(_0x404ef8){logger[_0x8b89('0x14')](_0x8b89('0x22'),_0x404ef8[_0x8b89('0x16')],_0x35c52c);_0x230f7b(_0x14e224[_0x8b89('0x14')](0x1f4,_0x404ef8[_0x8b89('0x16')]));});});};
\ No newline at end of file
index 5e407d2..f4412c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4436=['get','isAuthenticated','/:id','clone','post','create','put','update','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller'];(function(_0x4ef29c,_0x34b9fd){var _0x3f4ce1=function(_0x429442){while(--_0x429442){_0x4ef29c['push'](_0x4ef29c['shift']());}};_0x3f4ce1(++_0x34b9fd);}(_0x4436,0x127));var _0x6443=function(_0xab85b4,_0x4f2e8b){_0xab85b4=_0xab85b4-0x0;var _0x4cb733=_0x4436[_0xab85b4];return _0x4cb733;};'use strict';var multer=require('multer');var util=require(_0x6443('0x0'));var path=require('path');var timeout=require(_0x6443('0x1'));var express=require(_0x6443('0x2'));var router=express[_0x6443('0x3')]();var fs_extra=require(_0x6443('0x4'));var auth=require(_0x6443('0x5'));var interaction=require(_0x6443('0x6'));var config=require(_0x6443('0x7'));var controller=require(_0x6443('0x8'));router[_0x6443('0x9')]('/',auth[_0x6443('0xa')](),controller['index']);router['get'](_0x6443('0xb'),auth[_0x6443('0xa')](),controller['show']);router['post']('/:id/clone',auth[_0x6443('0xa')](),controller[_0x6443('0xc')]);router[_0x6443('0xd')]('/',auth[_0x6443('0xa')](),controller[_0x6443('0xe')]);router[_0x6443('0xf')](_0x6443('0xb'),auth['isAuthenticated'](),controller[_0x6443('0x10')]);router['delete'](_0x6443('0xb'),auth[_0x6443('0xa')](),controller[_0x6443('0x11')]);module[_0x6443('0x12')]=router;
\ No newline at end of file
+var _0x79ca=['../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','/:id','/:id/clone','clone','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x4eb4ad,_0x183488){var _0x1312b2=function(_0x19aabe){while(--_0x19aabe){_0x4eb4ad['push'](_0x4eb4ad['shift']());}};_0x1312b2(++_0x183488);}(_0x79ca,0xb7));var _0xa79c=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x79ca[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xa79c('0x0'));var util=require('util');var path=require(_0xa79c('0x1'));var timeout=require(_0xa79c('0x2'));var express=require(_0xa79c('0x3'));var router=express[_0xa79c('0x4')]();var fs_extra=require(_0xa79c('0x5'));var auth=require(_0xa79c('0x6'));var interaction=require(_0xa79c('0x7'));var config=require(_0xa79c('0x8'));var controller=require(_0xa79c('0x9'));router['get']('/',auth[_0xa79c('0xa')](),controller[_0xa79c('0xb')]);router[_0xa79c('0xc')](_0xa79c('0xd'),auth[_0xa79c('0xa')](),controller['show']);router['post'](_0xa79c('0xe'),auth[_0xa79c('0xa')](),controller[_0xa79c('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa79c('0x10')]);router[_0xa79c('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa79c('0x12')]);router[_0xa79c('0x13')](_0xa79c('0xd'),auth[_0xa79c('0xa')](),controller['destroy']);module[_0xa79c('0x14')]=router;
\ No newline at end of file
index c21a3ed..8db372b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1bb1=['originate','uac','uas','pai','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','ENUM','friend','user','peer','STRING','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse'];(function(_0x15fb84,_0x5f0b76){var _0x30c87c=function(_0x2c1312){while(--_0x2c1312){_0x15fb84['push'](_0x15fb84['shift']());}};_0x30c87c(++_0x5f0b76);}(_0x1bb1,0x16e));var _0x11bb=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x1bb1[_0x1cc8fe];return _0x230054;};'use strict';var Sequelize=require(_0x11bb('0x0'));module[_0x11bb('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x3'),_0x11bb('0x4'),_0x11bb('0x5')),'allowNull':![],'defaultValue':_0x11bb('0x3')},'context':{'type':Sequelize[_0x11bb('0x6')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED',_0x11bb('0x7'),'ALLOWED_FAILED_SCREEN',_0x11bb('0x8'),_0x11bb('0x9'),_0x11bb('0xa'),_0x11bb('0xb'),_0x11bb('0xc'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x11bb('0x6')]},'secret':{'type':Sequelize[_0x11bb('0x6')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x11bb('0x6')]},'transport':{'type':Sequelize[_0x11bb('0x6')],'defaultValue':'udp','set':function(_0x277c1c){this[_0x11bb('0xd')](_0x11bb('0xe'),_0x277c1c?_0x277c1c[_0x11bb('0xf')](','):null);},'get':function(){return this[_0x11bb('0x10')]('transport')?this[_0x11bb('0x10')](_0x11bb('0xe'))[_0x11bb('0x11')](','):null;},'comment':_0x11bb('0x12')},'dtmfmode':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x13'),_0x11bb('0x14'),'shortinfo',_0x11bb('0x15'),_0x11bb('0x16')),'defaultValue':_0x11bb('0x13')},'directmedia':{'type':Sequelize['ENUM'](_0x11bb('0x17'),'no',_0x11bb('0x18'),_0x11bb('0x19'),_0x11bb('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x11bb('0x2')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x11bb('0x6')]},'directmediadeny':{'type':Sequelize[_0x11bb('0x6')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x11bb('0x1b'),'set':function(_0x1b20d9){this[_0x11bb('0xd')](_0x11bb('0x1c'),_0x1b20d9?_0x1b20d9[_0x11bb('0xf')](','):null);},'get':function(){return this[_0x11bb('0x10')](_0x11bb('0x1c'))?this[_0x11bb('0x10')](_0x11bb('0x1c'))['split'](','):null;},'comment':_0x11bb('0x1d')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x11bb('0x6')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x11bb('0x6')]},'language':{'type':Sequelize[_0x11bb('0x6')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x11bb('0x6')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x11bb('0x6')],'defaultValue':_0x11bb('0x1e')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x11bb('0x1f'),'set':function(_0x5317a6){this['setDataValue']('allow',_0x5317a6?_0x5317a6['join'](';'):_0x11bb('0x1f'));},'get':function(){return this[_0x11bb('0x10')]('allow')?this[_0x11bb('0x10')]('allow')[_0x11bb('0x11')](';'):null;},'comment':_0x11bb('0x20')},'autoframing':{'type':Sequelize['ENUM']('yes','no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0x11bb('0x21'),'set':function(_0x3982e3){this[_0x11bb('0xd')](_0x11bb('0x22'),_0x3982e3?_0x3982e3['join'](','):null);},'get':function(){return this[_0x11bb('0x10')](_0x11bb('0x22'))?this[_0x11bb('0x10')](_0x11bb('0x22'))['split'](','):null;},'comment':_0x11bb('0x23')},'trustrpid':{'type':Sequelize['ENUM'](_0x11bb('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no',_0x11bb('0x24'))},'promiscredir':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no')},'useclientcode':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no')},'accountcode':{'type':Sequelize[_0x11bb('0x25')](0xb)},'setvar':{'type':Sequelize[_0x11bb('0x6')]},'callerid':{'type':Sequelize[_0x11bb('0x6')],'defaultValue':_0x11bb('0x26')},'amaflags':{'type':Sequelize[_0x11bb('0x6')]},'callcounter':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no'),'defaultValue':_0x11bb('0x17')},'busylevel':{'type':Sequelize[_0x11bb('0x25')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x11bb('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x11bb('0x17'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x11bb('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0x11bb('0x6')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no',_0x11bb('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x11bb('0x25')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x11bb('0x2')]('yes','no')},'mailbox':{'type':Sequelize[_0x11bb('0x6')]},'session_timers':{'type':Sequelize['ENUM'](_0x11bb('0x28'),_0x11bb('0x29'),_0x11bb('0x2a'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x2b'),'uas'),'defaultValue':_0x11bb('0x2c')},'t38pt_usertpsource':{'type':Sequelize[_0x11bb('0x6')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x11bb('0x6')]},'fromuser':{'type':Sequelize[_0x11bb('0x6')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x11bb('0x2')]('yes','no'),'defaultValue':_0x11bb('0x17')},'keepalive':{'type':Sequelize[_0x11bb('0x25')](0xb)},'defaultip':{'type':Sequelize[_0x11bb('0x6')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x11bb('0x25')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x11bb('0x25')](0xb)},'sendrpid':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no',_0x11bb('0x2d')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x11bb('0x6')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x11bb('0x25')](0xb)},'timerb':{'type':Sequelize[_0x11bb('0x25')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x11bb('0x6')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0x11bb('0x6')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x11bb('0x6')]},'maxforwards':{'type':Sequelize[_0x11bb('0x25')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x11bb('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no')},'force_avp':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0x11bb('0x17'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x11bb('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize[_0x11bb('0x25')](0xb)},'dtlscertfile':{'type':Sequelize[_0x11bb('0x6')]},'dtlsprivatekey':{'type':Sequelize[_0x11bb('0x6')]},'dtlscipher':{'type':Sequelize[_0x11bb('0x6')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x11bb('0x6')]},'dtlssetup':{'type':Sequelize[_0x11bb('0x2')]('active',_0x11bb('0x2e'),_0x11bb('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x11bb('0x6')]},'usereqphone':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x11bb('0x6')]},'recordofffeature':{'type':Sequelize[_0x11bb('0x6')]},'call_limit':{'type':Sequelize[_0x11bb('0x25')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x11bb('0x6')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x11bb('0x6')]},'description':{'type':Sequelize[_0x11bb('0x6')]},'host':{'type':Sequelize[_0x11bb('0x6')],'defaultValue':_0x11bb('0x30')},'canreinvite':{'type':Sequelize[_0x11bb('0x2')](_0x11bb('0x17'),'no',_0x11bb('0x18'),_0x11bb('0x19'),_0x11bb('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0x11bb('0x6')]},'active':{'type':Sequelize[_0x11bb('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x11bb('0x6')],'defaultValue':'no'}};
\ No newline at end of file
+var _0x3d5e=['udp','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','ENUM','rfc2833','info','shortinfo','inband','nonat','update','yes','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','always','accept','refuse','originate','uas','fingerprint','active','passive','actpass','dynamic','update,nonat','exports','STRING','name','friend','user','peer','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN'];(function(_0x146a97,_0x2d8483){var _0x259d5c=function(_0x3ca436){while(--_0x3ca436){_0x146a97['push'](_0x146a97['shift']());}};_0x259d5c(++_0x2d8483);}(_0x3d5e,0x1ae));var _0xe3d5=function(_0x9331b4,_0x471f0a){_0x9331b4=_0x9331b4-0x0;var _0x5b6266=_0x3d5e[_0x9331b4];return _0x5b6266;};'use strict';var Sequelize=require('sequelize');module[_0xe3d5('0x0')]={'name':{'type':Sequelize[_0xe3d5('0x1')],'allowNull':![],'unique':_0xe3d5('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xe3d5('0x3'),_0xe3d5('0x4'),_0xe3d5('0x5')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xe3d5('0x1')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM'](_0xe3d5('0x6'),_0xe3d5('0x7'),_0xe3d5('0x8'),'ALLOWED','PROHIB_NOT_SCREENED',_0xe3d5('0x9'),_0xe3d5('0xa'),'PROHIB')},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0xe3d5('0x1')]},'secret':{'type':Sequelize[_0xe3d5('0x1')]},'md5secret':{'type':Sequelize[_0xe3d5('0x1')]},'remotesecret':{'type':Sequelize[_0xe3d5('0x1')]},'transport':{'type':Sequelize[_0xe3d5('0x1')],'defaultValue':_0xe3d5('0xb'),'set':function(_0x455b62){this[_0xe3d5('0xc')](_0xe3d5('0xd'),_0x455b62?_0x455b62[_0xe3d5('0xe')](','):null);},'get':function(){return this[_0xe3d5('0xf')]('transport')?this['getDataValue'](_0xe3d5('0xd'))[_0xe3d5('0x10')](','):null;},'comment':_0xe3d5('0x11')},'dtmfmode':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x13'),_0xe3d5('0x14'),_0xe3d5('0x15'),_0xe3d5('0x16'),'auto'),'defaultValue':_0xe3d5('0x13')},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0xe3d5('0x17'),_0xe3d5('0x18'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xe3d5('0x1')]},'directmediadeny':{'type':Sequelize[_0xe3d5('0x1')]},'nat':{'type':Sequelize[_0xe3d5('0x1')],'defaultValue':_0xe3d5('0x1a'),'set':function(_0x57696b){this['setDataValue'](_0xe3d5('0x1b'),_0x57696b?_0x57696b['join'](','):null);},'get':function(){return this[_0xe3d5('0xf')]('nat')?this['getDataValue'](_0xe3d5('0x1b'))[_0xe3d5('0x10')](','):null;},'comment':_0xe3d5('0x1c')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xe3d5('0x1')]},'pickupgroup':{'type':Sequelize[_0xe3d5('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xe3d5('0x1')]},'language':{'type':Sequelize[_0xe3d5('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xe3d5('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xe3d5('0x1d')},'allow':{'type':Sequelize[_0xe3d5('0x1')],'allowNull':![],'defaultValue':_0xe3d5('0x1e'),'set':function(_0x49d791){this[_0xe3d5('0xc')](_0xe3d5('0x1f'),_0x49d791?_0x49d791[_0xe3d5('0xe')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xe3d5('0xf')](_0xe3d5('0x1f'))?this['getDataValue'](_0xe3d5('0x1f'))[_0xe3d5('0x10')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':_0xe3d5('0x20'),'set':function(_0x3eed15){this[_0xe3d5('0xc')](_0xe3d5('0x21'),_0x3eed15?_0x3eed15[_0xe3d5('0xe')](','):null);},'get':function(){return this['getDataValue'](_0xe3d5('0x21'))?this[_0xe3d5('0xf')]('insecure')[_0xe3d5('0x10')](','):null;},'comment':_0xe3d5('0x22')},'trustrpid':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no',_0xe3d5('0x23'))},'promiscredir':{'type':Sequelize[_0xe3d5('0x12')]('yes','no')},'useclientcode':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no')},'accountcode':{'type':Sequelize[_0xe3d5('0x24')](0xb)},'setvar':{'type':Sequelize[_0xe3d5('0x1')]},'callerid':{'type':Sequelize[_0xe3d5('0x1')],'defaultValue':_0xe3d5('0x25')},'amaflags':{'type':Sequelize[_0xe3d5('0x1')]},'callcounter':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xe3d5('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no')},'allowsubscribe':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no')},'allowtransfer':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no')},'ignoresdpversion':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no',_0xe3d5('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xe3d5('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xe3d5('0x12')]('yes','no')},'mailbox':{'type':Sequelize[_0xe3d5('0x1')]},'session_timers':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x27'),_0xe3d5('0x28'),_0xe3d5('0x29'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM']('uac',_0xe3d5('0x2a')),'defaultValue':_0xe3d5('0x2a')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xe3d5('0x1')]},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0xe3d5('0x1')]},'port':{'type':Sequelize[_0xe3d5('0x24')](0x5)},'qualify':{'type':Sequelize[_0xe3d5('0x12')]('yes','no'),'defaultValue':_0xe3d5('0x19')},'keepalive':{'type':Sequelize[_0xe3d5('0x24')](0xb)},'defaultip':{'type':Sequelize[_0xe3d5('0x1')]},'defaultuser':{'type':Sequelize[_0xe3d5('0x1')]},'rtptimeout':{'type':Sequelize[_0xe3d5('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xe3d5('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0xe3d5('0x24')](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING']},'callbackextension':{'type':Sequelize[_0xe3d5('0x1')]},'timert1':{'type':Sequelize[_0xe3d5('0x24')](0xb)},'timerb':{'type':Sequelize[_0xe3d5('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0xe3d5('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0xe3d5('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0xe3d5('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0xe3d5('0x1')]},'use_q850_reason':{'type':Sequelize[_0xe3d5('0x1')]},'maxforwards':{'type':Sequelize[_0xe3d5('0x24')](0xb)},'encryption':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no')},'force_avp':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no')},'icesupport':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no')},'dtlsenable':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no')},'dtlsverify':{'type':Sequelize[_0xe3d5('0x12')]('yes','no',_0xe3d5('0x2b'),'certificate')},'dtlsrekey':{'type':Sequelize[_0xe3d5('0x24')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0xe3d5('0x1')]},'dtlscipher':{'type':Sequelize[_0xe3d5('0x1')]},'dtlscafile':{'type':Sequelize[_0xe3d5('0x1')]},'dtlscapath':{'type':Sequelize[_0xe3d5('0x1')]},'dtlssetup':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x2c'),_0xe3d5('0x2d'),_0xe3d5('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xe3d5('0x1')]},'usereqphone':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xe3d5('0x1')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no')},'subscribemwi':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no')},'vmexten':{'type':Sequelize[_0xe3d5('0x1')]},'mohinterpret':{'type':Sequelize[_0xe3d5('0x1')]},'mohsuggest':{'type':Sequelize[_0xe3d5('0x1')]},'parkinglot':{'type':Sequelize[_0xe3d5('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xe3d5('0x1')],'defaultValue':_0xe3d5('0x2f')},'canreinvite':{'type':Sequelize[_0xe3d5('0x12')](_0xe3d5('0x19'),'no',_0xe3d5('0x17'),_0xe3d5('0x18'),_0xe3d5('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xe3d5('0x1')]},'otherFields':{'type':Sequelize[_0xe3d5('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xe3d5('0x1')],'defaultValue':'no'}};
\ No newline at end of file
index a173783..6368150 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x54ef=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','include','find','get','updatedAt','omit','body','createdAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/trunk.ejs','utf8','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','userProfileId','root','chan_sip.so','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','http','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','Trunks','UserProfileResource','name','send','index','map','Trunk','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0xf1d63,_0x5a3021){var _0x1d702d=function(_0x1c527e){while(--_0x1c527e){_0xf1d63['push'](_0xf1d63['shift']());}};_0x1d702d(++_0x5a3021);}(_0x54ef,0x112));var _0xf54e=function(_0x2ffb1f,_0x1242e2){_0x2ffb1f=_0x2ffb1f-0x0;var _0x1eb104=_0x54ef[_0x2ffb1f];return _0x1eb104;};'use strict';var emlformat=require(_0xf54e('0x0'));var rimraf=require(_0xf54e('0x1'));var zipdir=require(_0xf54e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf54e('0x3'));var moment=require(_0xf54e('0x4'));var BPromise=require(_0xf54e('0x5'));var Mustache=require(_0xf54e('0x6'));var util=require(_0xf54e('0x7'));var path=require(_0xf54e('0x8'));var sox=require(_0xf54e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf54e('0xa'));var _=require(_0xf54e('0xb'));var squel=require(_0xf54e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf54e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf54e('0xe'));var querystring=require(_0xf54e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf54e('0x10'));var authService=require(_0xf54e('0x11'));var qs=require(_0xf54e('0x12'));var as=require(_0xf54e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf54e('0x14'))(_0xf54e('0x15'));var utils=require(_0xf54e('0x16'));var config=require(_0xf54e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf54e('0x18'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x2033e9,_0x28f776,_0x380f26,_0x5644aa){return new BPromise(function(_0x331732,_0x1bbeaa){var _0x1855fe=_0x5644aa||client;return _0x1855fe[_0xf54e('0x1a')](_0x2033e9,_0x380f26)['then'](function(_0x2366ee){logger[_0xf54e('0x1b')](_0xf54e('0x1c'),_0x28f776,'request\x20sent');logger['debug'](_0xf54e('0x1d'),_0x28f776,_0xf54e('0x1e'),JSON[_0xf54e('0x1f')](_0x2366ee));if(_0x2366ee[_0xf54e('0x20')]){if(_0x2366ee[_0xf54e('0x20')][_0xf54e('0x21')]===0x1f4){logger[_0xf54e('0x20')](_0xf54e('0x1c'),_0x28f776,_0x2366ee[_0xf54e('0x20')][_0xf54e('0x22')]);return _0x1bbeaa(_0x2366ee[_0xf54e('0x20')]['message']);}logger['error'](_0xf54e('0x1c'),_0x28f776,_0x2366ee['error'][_0xf54e('0x22')]);return _0x331732(_0x2366ee[_0xf54e('0x20')][_0xf54e('0x22')]);}else{logger[_0xf54e('0x1b')](_0xf54e('0x1c'),_0x28f776,_0xf54e('0x1e'));_0x331732(_0x2366ee[_0xf54e('0x23')][_0xf54e('0x22')]);}})[_0xf54e('0x24')](function(_0x5f9eea){logger[_0xf54e('0x20')]('Trunk,\x20%s,\x20%s',_0x28f776,_0x5f9eea);_0x1bbeaa(_0x5f9eea);});});}function respondWithStatusCode(_0x6f6d29,_0x54f914){_0x54f914=_0x54f914||0xcc;return function(_0x264a8f){if(_0x264a8f){return _0x6f6d29[_0xf54e('0x25')](_0x54f914);}return _0x6f6d29[_0xf54e('0x26')](_0x54f914)[_0xf54e('0x27')]();};}function respondWithResult(_0x3805a7,_0x160160){_0x160160=_0x160160||0xc8;return function(_0x1e08d1){if(_0x1e08d1){return _0x3805a7[_0xf54e('0x26')](_0x160160)[_0xf54e('0x28')](_0x1e08d1);}};}function respondWithFilteredResult(_0x33457f,_0xf6cdd7){return function(_0x39c0ae){if(_0x39c0ae){var _0x2ea001=typeof _0xf6cdd7['offset']===_0xf54e('0x29')&&typeof _0xf6cdd7['limit']===_0xf54e('0x29');var _0x5e63f4=_0x39c0ae[_0xf54e('0x2a')];var _0x269f47=_0x2ea001?0x0:_0xf6cdd7[_0xf54e('0x2b')];var _0xa13cd0=_0x2ea001?_0x39c0ae[_0xf54e('0x2a')]:_0xf6cdd7[_0xf54e('0x2b')]+_0xf6cdd7[_0xf54e('0x2c')];var _0x54bd8f;if(_0xa13cd0>=_0x5e63f4){_0xa13cd0=_0x5e63f4;_0x54bd8f=0xc8;}else{_0x54bd8f=0xce;}_0x33457f['status'](_0x54bd8f);return _0x33457f[_0xf54e('0x2d')](_0xf54e('0x2e'),_0x269f47+'-'+_0xa13cd0+'/'+_0x5e63f4)[_0xf54e('0x28')](_0x39c0ae);}return null;};}function patchUpdates(_0x16d00f){return function(_0xb2d4c4){try{jsonpatch[_0xf54e('0x2f')](_0xb2d4c4,_0x16d00f,!![]);}catch(_0x2b5408){return BPromise[_0xf54e('0x30')](_0x2b5408);}return _0xb2d4c4[_0xf54e('0x31')]();};}function saveUpdates(_0x12edc3,_0x5ea0cc){return function(_0x5f29d3){if(_0x5f29d3){return _0x5f29d3[_0xf54e('0x32')](_0x12edc3)[_0xf54e('0x33')](function(_0x4d8fdd){return _0x4d8fdd;});}return null;};}function removeEntity(_0x3e319c,_0x82e313){return function(_0x379110){if(_0x379110){return _0x379110[_0xf54e('0x34')]()['then'](function(){var _0x54bea4=_0x379110['get']({'plain':!![]});var _0x3c0cca=_0xf54e('0x35');return db[_0xf54e('0x36')][_0xf54e('0x34')]({'where':{'type':_0x3c0cca,'resourceId':_0x54bea4['id']}})[_0xf54e('0x33')](function(){return _0x379110;});})[_0xf54e('0x33')](function(){_0x3e319c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x530cee,_0xc04e04){return function(_0x734187){if(!_0x734187){_0x530cee['sendStatus'](0x194);}return _0x734187;};}function handleError(_0x4d9b06,_0xda1d10){_0xda1d10=_0xda1d10||0x1f4;return function(_0x2c0d30){logger[_0xf54e('0x20')](_0x2c0d30['stack']);if(_0x2c0d30[_0xf54e('0x37')]){delete _0x2c0d30[_0xf54e('0x37')];}_0x4d9b06['status'](_0xda1d10)[_0xf54e('0x38')](_0x2c0d30);};}exports[_0xf54e('0x39')]=function(_0x5af03,_0x1eeeb4){var _0x12ef97={},_0x199056={},_0x4e00b7={'count':0x0,'rows':[]};var _0x5d45cf=_[_0xf54e('0x3a')](db[_0xf54e('0x3b')][_0xf54e('0x3c')],function(_0x4b1f84){return{'name':_0x4b1f84[_0xf54e('0x3d')],'type':_0x4b1f84[_0xf54e('0x3e')][_0xf54e('0x3f')]};});_0x199056[_0xf54e('0x40')]=_[_0xf54e('0x3a')](_0x5d45cf,_0xf54e('0x37'));_0x199056[_0xf54e('0x41')]=_[_0xf54e('0x42')](_0x5af03[_0xf54e('0x41')]);_0x199056[_0xf54e('0x43')]=_[_0xf54e('0x44')](_0x199056[_0xf54e('0x40')],_0x199056[_0xf54e('0x41')]);_0x12ef97[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x199056['model'],qs['fields'](_0x5af03['query'][_0xf54e('0x46')]));_0x12ef97[_0xf54e('0x45')]=_0x12ef97['attributes'][_0xf54e('0x47')]?_0x12ef97[_0xf54e('0x45')]:_0x199056[_0xf54e('0x40')];if(!_0x5af03['query'][_0xf54e('0x48')](_0xf54e('0x49'))){_0x12ef97[_0xf54e('0x2c')]=qs[_0xf54e('0x2c')](_0x5af03[_0xf54e('0x41')][_0xf54e('0x2c')]);_0x12ef97[_0xf54e('0x2b')]=qs[_0xf54e('0x2b')](_0x5af03[_0xf54e('0x41')]['offset']);}_0x12ef97[_0xf54e('0x4a')]=qs[_0xf54e('0x4b')](_0x5af03[_0xf54e('0x41')][_0xf54e('0x4b')]);_0x12ef97[_0xf54e('0x4c')]=qs[_0xf54e('0x43')](_['pick'](_0x5af03[_0xf54e('0x41')],_0x199056['filters']),_0x5d45cf);if(_0x5af03[_0xf54e('0x41')]['filter']){_0x12ef97[_0xf54e('0x4c')]=_[_0xf54e('0x4d')](_0x12ef97[_0xf54e('0x4c')],{'$or':_['map'](_0x5d45cf,function(_0x1af35d){if(_0x1af35d[_0xf54e('0x3e')]!==_0xf54e('0x4e')){var _0x32fb46={};_0x32fb46[_0x1af35d[_0xf54e('0x37')]]={'$like':'%'+_0x5af03['query'][_0xf54e('0x4f')]+'%'};return _0x32fb46;}})});}_0x12ef97=_[_0xf54e('0x4d')]({},_0x12ef97,_0x5af03[_0xf54e('0x50')]);var _0x45592b={'where':_0x12ef97['where']};return db[_0xf54e('0x3b')][_0xf54e('0x2a')](_0x45592b)['then'](function(_0x22c842){_0x4e00b7[_0xf54e('0x2a')]=_0x22c842;if(_0x5af03[_0xf54e('0x41')][_0xf54e('0x51')]){_0x12ef97['include']=[{'all':!![]}];}return db[_0xf54e('0x3b')][_0xf54e('0x52')](_0x12ef97);})[_0xf54e('0x33')](function(_0xb4654f){_0x4e00b7[_0xf54e('0x53')]=_0xb4654f;return _0x4e00b7;})[_0xf54e('0x33')](respondWithFilteredResult(_0x1eeeb4,_0x12ef97))[_0xf54e('0x24')](handleError(_0x1eeeb4,null));};exports[_0xf54e('0x54')]=function(_0x15bfef,_0x21f2f8){var _0xaf9bf0={'raw':![],'where':{'id':_0x15bfef[_0xf54e('0x55')]['id']}},_0x1f4cf8={};_0x1f4cf8[_0xf54e('0x40')]=_[_0xf54e('0x42')](db[_0xf54e('0x3b')][_0xf54e('0x3c')]);_0x1f4cf8[_0xf54e('0x41')]=_[_0xf54e('0x42')](_0x15bfef[_0xf54e('0x41')]);_0x1f4cf8['filters']=_['intersection'](_0x1f4cf8[_0xf54e('0x40')],_0x1f4cf8[_0xf54e('0x41')]);_0xaf9bf0[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x1f4cf8[_0xf54e('0x40')],qs[_0xf54e('0x46')](_0x15bfef[_0xf54e('0x41')][_0xf54e('0x46')]));_0xaf9bf0[_0xf54e('0x45')]=_0xaf9bf0[_0xf54e('0x45')][_0xf54e('0x47')]?_0xaf9bf0['attributes']:_0x1f4cf8[_0xf54e('0x40')];if(_0x15bfef[_0xf54e('0x41')][_0xf54e('0x51')]){_0xaf9bf0[_0xf54e('0x56')]=[{'all':!![]}];}_0xaf9bf0=_[_0xf54e('0x4d')]({},_0xaf9bf0,_0x15bfef[_0xf54e('0x50')]);return db[_0xf54e('0x3b')]['find'](_0xaf9bf0)[_0xf54e('0x33')](handleEntityNotFound(_0x21f2f8,null))[_0xf54e('0x33')](respondWithResult(_0x21f2f8,null))[_0xf54e('0x24')](handleError(_0x21f2f8,null));};exports['clone']=function(_0x3ce832,_0x54ac1a){var _0x465a0f={'where':{'id':_0x3ce832[_0xf54e('0x55')]['id']}},_0x400ee0={};_0x400ee0['model']=_[_0xf54e('0x42')](db[_0xf54e('0x3b')][_0xf54e('0x3c')]);_0x465a0f[_0xf54e('0x45')]=_[_0xf54e('0x44')](_0x400ee0[_0xf54e('0x40')],qs[_0xf54e('0x46')](_0x3ce832['query']['fields']));_0x465a0f[_0xf54e('0x45')]=_0x465a0f[_0xf54e('0x45')]['length']?_0x465a0f[_0xf54e('0x45')]:_0x400ee0['model'];if(_0x3ce832[_0xf54e('0x41')]['includeAll']){_0x465a0f[_0xf54e('0x56')]=[{'all':!![]}];}_0x465a0f=_[_0xf54e('0x4d')]({},_0x465a0f,_0x3ce832[_0xf54e('0x50')]);return db[_0xf54e('0x3b')][_0xf54e('0x57')](_0x465a0f)[_0xf54e('0x33')](handleEntityNotFound(_0x54ac1a,null))['then'](function(_0x479572){if(_0x479572){var _0x79345=_0x479572[_0xf54e('0x58')]({'plain':!![]});_0x79345=qs['omit'](_0x79345,['id','createdAt',_0xf54e('0x59')]);_0x3ce832['body']=_[_0xf54e('0x5a')](_0x3ce832[_0xf54e('0x5b')],['id',_0xf54e('0x5c'),_0xf54e('0x59')]);return db[_0xf54e('0x3b')][_0xf54e('0x5d')](_[_0xf54e('0x4d')](_0x79345,_0x3ce832[_0xf54e('0x5b')]),{'include':_0x3ce832[_0xf54e('0x41')][_0xf54e('0x51')]?[{'all':!![]}]:undefined})[_0xf54e('0x33')](function(_0x2c6d0e){var _0x65bdf2=_0x3ce832[_0xf54e('0x5e')]['get']({'plain':!![]});if(!_0x65bdf2)throw new Error(_0xf54e('0x5f'));if(_0x65bdf2[_0xf54e('0x60')]===_0xf54e('0x5e')){var _0x11908b=_0x2c6d0e[_0xf54e('0x58')]({'plain':!![]});var _0x494629=_0xf54e('0x35');return db[_0xf54e('0x61')]['find']({'where':{'name':_0x494629,'userProfileId':_0x65bdf2['userProfileId']},'raw':!![]})[_0xf54e('0x33')](function(_0x4b4a2f){if(_0x4b4a2f&&_0x4b4a2f[_0xf54e('0x62')]===0x0){return db[_0xf54e('0x36')][_0xf54e('0x5d')]({'name':_0x11908b[_0xf54e('0x37')],'resourceId':_0x11908b['id'],'type':_0x4b4a2f['name'],'sectionId':_0x4b4a2f['id']},{})[_0xf54e('0x33')](function(){return _0x2c6d0e;});}else{return _0x2c6d0e;}})['catch'](function(_0x3800d4){logger[_0xf54e('0x20')](_0xf54e('0x63'),_0x3800d4);throw _0x3800d4;});}return _0x2c6d0e;});}})['then'](respondWithResult(_0x54ac1a,0xc9))[_0xf54e('0x24')](handleError(_0x54ac1a,null));};exports['create']=function(_0x3f7224,_0x3e2101,_0x5500d7){var _0x380b4f;return db['Trunk'][_0xf54e('0x5d')](_0x3f7224[_0xf54e('0x5b')],{'raw':!![]})[_0xf54e('0x33')](function(_0x38405c){_0x380b4f=_0x38405c;return db[_0xf54e('0x3b')]['findAll']({'raw':!![]});})[_0xf54e('0x33')](function(_0x1d18d3){var _0x57db6f=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config['root'],_0xf54e('0x66')),_0xf54e('0x67'));var _0x309895=fs['readFileSync'](path[_0xf54e('0x65')](config['root'],_0xf54e('0x68')),_0xf54e('0x67'));var _0x5e45e7=ejs[_0xf54e('0x69')](_0x57db6f,{'trunks':_0x1d18d3||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6b'),_0x5e45e7);if(_0x380b4f[_0xf54e('0x6c')]){var _0x38bf71=ejs[_0xf54e('0x69')](_0x309895,{'trunks':_0x1d18d3||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x38bf71);}})[_0xf54e('0x33')](function(){return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x5d'),{'module':'chan_sip.so'});})[_0xf54e('0x33')](function(){var _0x2c20b5=_0x3f7224[_0xf54e('0x5e')]['get']({'plain':!![]});if(!_0x2c20b5)throw new Error(_0xf54e('0x5f'));if(_0x2c20b5[_0xf54e('0x60')]===_0xf54e('0x5e')){var _0x13db3e=_0x380b4f[_0xf54e('0x58')]({'plain':!![]});return db[_0xf54e('0x61')][_0xf54e('0x57')]({'where':{'name':'Trunks','userProfileId':_0x2c20b5[_0xf54e('0x6f')]},'raw':!![]})[_0xf54e('0x33')](function(_0x261c39){if(_0x261c39&&_0x261c39['autoAssociation']===0x0){return db[_0xf54e('0x36')][_0xf54e('0x5d')]({'name':_0x13db3e[_0xf54e('0x37')],'resourceId':_0x13db3e['id'],'type':_0x261c39[_0xf54e('0x37')],'sectionId':_0x261c39['id']},{})['then'](function(){return _0x380b4f;});}else{return _0x380b4f;}})['catch'](function(_0x25d05e){logger[_0xf54e('0x20')](_0xf54e('0x63'),_0x25d05e);throw _0x25d05e;});}return _0x380b4f;})[_0xf54e('0x33')](respondWithResult(_0x3e2101,0xc9))[_0xf54e('0x24')](handleError(_0x3e2101,null));};exports[_0xf54e('0x32')]=function(_0x35b5a4,_0x3b2a3e,_0xf5108b){var _0x205b47;return db['Trunk'][_0xf54e('0x57')]({'where':{'id':_0x35b5a4[_0xf54e('0x55')]['id']}})[_0xf54e('0x33')](handleEntityNotFound(_0x3b2a3e,null))[_0xf54e('0x33')](saveUpdates(_0x35b5a4['body'],null))[_0xf54e('0x33')](function(_0x1de6dd){if(_0x1de6dd){_0x205b47=_0x1de6dd;return db[_0xf54e('0x3b')][_0xf54e('0x52')]({'raw':!![]});}})['then'](function(_0x394862){if(_0x394862){var _0x4876b5=fs[_0xf54e('0x64')](path['join'](config['root'],_0xf54e('0x66')),_0xf54e('0x67'));var _0x1e2834=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config[_0xf54e('0x70')],_0xf54e('0x68')),_0xf54e('0x67'));var _0x8093bc=ejs['render'](_0x4876b5,{'trunks':_0x394862||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6b'),_0x8093bc);var _0x4ce10=ejs[_0xf54e('0x69')](_0x1e2834,{'trunks':_0x394862||[]});fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x4ce10);return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x32'),{'module':_0xf54e('0x71')});}return null;})[_0xf54e('0x33')](function(_0x11dec2){if(_0x11dec2){return _0x205b47;}})[_0xf54e('0x33')](respondWithResult(_0x3b2a3e,null))['catch'](handleError(_0x3b2a3e,null));};exports[_0xf54e('0x34')]=function(_0x1cfa09,_0x59acbc,_0x4a0614){var _0x85b108;return db[_0xf54e('0x3b')][_0xf54e('0x57')]({'where':{'id':_0x1cfa09[_0xf54e('0x55')]['id']}})[_0xf54e('0x33')](handleEntityNotFound(_0x59acbc,null))[_0xf54e('0x33')](removeEntity(_0x59acbc,null))[_0xf54e('0x33')](function(){return db[_0xf54e('0x3b')][_0xf54e('0x52')]({'raw':!![]});})['then'](function(_0x2bb31f){var _0x3c222a=fs[_0xf54e('0x64')](path['join'](config[_0xf54e('0x70')],'server/files/templates/trunk.ejs'),_0xf54e('0x67'));var _0x57bc6f=fs[_0xf54e('0x64')](path[_0xf54e('0x65')](config['root'],'server/files/templates/registry.ejs'),_0xf54e('0x67'));var _0x632240=ejs[_0xf54e('0x69')](_0x3c222a,{'trunks':_0x2bb31f});var _0x406261=ejs[_0xf54e('0x69')](_0x57bc6f,{'trunks':_0x2bb31f});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x632240);fs[_0xf54e('0x6a')](_0xf54e('0x6d'),_0x406261);return respondWithRpcPromise(_0xf54e('0x6e'),_0xf54e('0x34'),{'module':_0xf54e('0x71')});})[_0xf54e('0x24')](handleError(_0x59acbc,null));};
\ No newline at end of file
+var _0x425d=['readFileSync','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','UserProfileSection','userProfileId','/etc/asterisk/sip_xcally_trunks.conf','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','Trunk,\x20%s,\x20%s','result','catch','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','get','Trunks','UserProfileResource','stack','name','send','index','map','Trunk','rawAttributes','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','clone','find','omit','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8'];(function(_0x5e5d54,_0x319933){var _0x3607d6=function(_0x5e4ef2){while(--_0x5e4ef2){_0x5e5d54['push'](_0x5e5d54['shift']());}};_0x3607d6(++_0x319933);}(_0x425d,0x1e0));var _0xd425=function(_0x586642,_0x3b2e5d){_0x586642=_0x586642-0x0;var _0xef997a=_0x425d[_0x586642];return _0xef997a;};'use strict';var emlformat=require(_0xd425('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd425('0x1'));var jsonpatch=require(_0xd425('0x2'));var rp=require(_0xd425('0x3'));var moment=require(_0xd425('0x4'));var BPromise=require(_0xd425('0x5'));var Mustache=require(_0xd425('0x6'));var util=require(_0xd425('0x7'));var path=require('path');var sox=require(_0xd425('0x8'));var csv=require(_0xd425('0x9'));var ejs=require(_0xd425('0xa'));var fs=require('fs');var fs_extra=require(_0xd425('0xb'));var _=require(_0xd425('0xc'));var squel=require(_0xd425('0xd'));var crypto=require('crypto');var jsforce=require(_0xd425('0xe'));var deskjs=require(_0xd425('0xf'));var toCsv=require(_0xd425('0x9'));var querystring=require(_0xd425('0x10'));var Papa=require(_0xd425('0x11'));var Redis=require(_0xd425('0x12'));var authService=require(_0xd425('0x13'));var qs=require(_0xd425('0x14'));var as=require(_0xd425('0x15'));var hardwareService=require(_0xd425('0x16'));var logger=require(_0xd425('0x17'))(_0xd425('0x18'));var utils=require(_0xd425('0x19'));var config=require(_0xd425('0x1a'));var licenseUtil=require(_0xd425('0x1b'));var db=require(_0xd425('0x1c'))['db'];var jayson=require(_0xd425('0x1d'));var client=jayson[_0xd425('0x1e')][_0xd425('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x18eafb,_0x51263f,_0x27318c,_0x17a498){return new BPromise(function(_0x336dc3,_0x5d3d60){var _0x309263=_0x17a498||client;return _0x309263[_0xd425('0x20')](_0x18eafb,_0x27318c)[_0xd425('0x21')](function(_0x41f34d){logger[_0xd425('0x22')]('Trunk,\x20%s,\x20%s',_0x51263f,_0xd425('0x23'));logger[_0xd425('0x24')](_0xd425('0x25'),_0x51263f,_0xd425('0x23'),JSON['stringify'](_0x41f34d));if(_0x41f34d[_0xd425('0x26')]){if(_0x41f34d[_0xd425('0x26')][_0xd425('0x27')]===0x1f4){logger[_0xd425('0x26')]('Trunk,\x20%s,\x20%s',_0x51263f,_0x41f34d['error']['message']);return _0x5d3d60(_0x41f34d['error'][_0xd425('0x28')]);}logger[_0xd425('0x26')](_0xd425('0x29'),_0x51263f,_0x41f34d['error'][_0xd425('0x28')]);return _0x336dc3(_0x41f34d[_0xd425('0x26')]['message']);}else{logger[_0xd425('0x22')](_0xd425('0x29'),_0x51263f,_0xd425('0x23'));_0x336dc3(_0x41f34d[_0xd425('0x2a')][_0xd425('0x28')]);}})[_0xd425('0x2b')](function(_0x2480a0){logger[_0xd425('0x26')](_0xd425('0x29'),_0x51263f,_0x2480a0);_0x5d3d60(_0x2480a0);});});}function respondWithStatusCode(_0x2b030b,_0x151ad9){_0x151ad9=_0x151ad9||0xcc;return function(_0x40e84b){if(_0x40e84b){return _0x2b030b['sendStatus'](_0x151ad9);}return _0x2b030b[_0xd425('0x2c')](_0x151ad9)[_0xd425('0x2d')]();};}function respondWithResult(_0x398985,_0x1908a5){_0x1908a5=_0x1908a5||0xc8;return function(_0x2afcdb){if(_0x2afcdb){return _0x398985[_0xd425('0x2c')](_0x1908a5)[_0xd425('0x2e')](_0x2afcdb);}};}function respondWithFilteredResult(_0x577e4b,_0x12f951){return function(_0x177de2){if(_0x177de2){var _0x1d8861=typeof _0x12f951['offset']===_0xd425('0x2f')&&typeof _0x12f951[_0xd425('0x30')]===_0xd425('0x2f');var _0x999fb9=_0x177de2[_0xd425('0x31')];var _0x185d7e=_0x1d8861?0x0:_0x12f951[_0xd425('0x32')];var _0x37b63c=_0x1d8861?_0x177de2[_0xd425('0x31')]:_0x12f951[_0xd425('0x32')]+_0x12f951['limit'];var _0x471e3e;if(_0x37b63c>=_0x999fb9){_0x37b63c=_0x999fb9;_0x471e3e=0xc8;}else{_0x471e3e=0xce;}_0x577e4b[_0xd425('0x2c')](_0x471e3e);return _0x577e4b[_0xd425('0x33')](_0xd425('0x34'),_0x185d7e+'-'+_0x37b63c+'/'+_0x999fb9)[_0xd425('0x2e')](_0x177de2);}return null;};}function patchUpdates(_0x1abf33){return function(_0x47405f){try{jsonpatch[_0xd425('0x35')](_0x47405f,_0x1abf33,!![]);}catch(_0x3ec51b){return BPromise[_0xd425('0x36')](_0x3ec51b);}return _0x47405f[_0xd425('0x37')]();};}function saveUpdates(_0x5f3dab,_0x316493){return function(_0x2a2a9b){if(_0x2a2a9b){return _0x2a2a9b[_0xd425('0x38')](_0x5f3dab)[_0xd425('0x21')](function(_0x28870f){return _0x28870f;});}return null;};}function removeEntity(_0x4eddbc,_0x4aa168){return function(_0x3badcc){if(_0x3badcc){return _0x3badcc['destroy']()['then'](function(){var _0x51669d=_0x3badcc[_0xd425('0x39')]({'plain':!![]});var _0xfb0c8=_0xd425('0x3a');return db[_0xd425('0x3b')]['destroy']({'where':{'type':_0xfb0c8,'resourceId':_0x51669d['id']}})[_0xd425('0x21')](function(){return _0x3badcc;});})[_0xd425('0x21')](function(){_0x4eddbc[_0xd425('0x2c')](0xcc)[_0xd425('0x2d')]();});}};}function handleEntityNotFound(_0x27b9e2,_0x1e12f2){return function(_0x35bbec){if(!_0x35bbec){_0x27b9e2['sendStatus'](0x194);}return _0x35bbec;};}function handleError(_0x363fb0,_0x59b3d3){_0x59b3d3=_0x59b3d3||0x1f4;return function(_0x22df81){logger[_0xd425('0x26')](_0x22df81[_0xd425('0x3c')]);if(_0x22df81['name']){delete _0x22df81[_0xd425('0x3d')];}_0x363fb0[_0xd425('0x2c')](_0x59b3d3)[_0xd425('0x3e')](_0x22df81);};}exports[_0xd425('0x3f')]=function(_0x58f36d,_0x1d38fa){var _0x3cf540={},_0x59e326={},_0x5d310e={'count':0x0,'rows':[]};var _0x48fc85=_[_0xd425('0x40')](db[_0xd425('0x41')][_0xd425('0x42')],function(_0x588688){return{'name':_0x588688['fieldName'],'type':_0x588688['type'][_0xd425('0x43')]};});_0x59e326[_0xd425('0x44')]=_[_0xd425('0x40')](_0x48fc85,_0xd425('0x3d'));_0x59e326[_0xd425('0x45')]=_[_0xd425('0x46')](_0x58f36d[_0xd425('0x45')]);_0x59e326['filters']=_[_0xd425('0x47')](_0x59e326[_0xd425('0x44')],_0x59e326[_0xd425('0x45')]);_0x3cf540['attributes']=_[_0xd425('0x47')](_0x59e326[_0xd425('0x44')],qs[_0xd425('0x48')](_0x58f36d['query'][_0xd425('0x48')]));_0x3cf540[_0xd425('0x49')]=_0x3cf540[_0xd425('0x49')][_0xd425('0x4a')]?_0x3cf540['attributes']:_0x59e326[_0xd425('0x44')];if(!_0x58f36d[_0xd425('0x45')][_0xd425('0x4b')](_0xd425('0x4c'))){_0x3cf540[_0xd425('0x30')]=qs[_0xd425('0x30')](_0x58f36d[_0xd425('0x45')]['limit']);_0x3cf540[_0xd425('0x32')]=qs[_0xd425('0x32')](_0x58f36d['query'][_0xd425('0x32')]);}_0x3cf540['order']=qs['sort'](_0x58f36d[_0xd425('0x45')]['sort']);_0x3cf540[_0xd425('0x4d')]=qs['filters'](_[_0xd425('0x4e')](_0x58f36d[_0xd425('0x45')],_0x59e326[_0xd425('0x4f')]),_0x48fc85);if(_0x58f36d[_0xd425('0x45')][_0xd425('0x50')]){_0x3cf540['where']=_[_0xd425('0x51')](_0x3cf540['where'],{'$or':_[_0xd425('0x40')](_0x48fc85,function(_0x55a15d){if(_0x55a15d[_0xd425('0x52')]!==_0xd425('0x53')){var _0x3fd2ce={};_0x3fd2ce[_0x55a15d[_0xd425('0x3d')]]={'$like':'%'+_0x58f36d[_0xd425('0x45')]['filter']+'%'};return _0x3fd2ce;}})});}_0x3cf540=_[_0xd425('0x51')]({},_0x3cf540,_0x58f36d[_0xd425('0x54')]);var _0x35e77b={'where':_0x3cf540[_0xd425('0x4d')]};return db[_0xd425('0x41')]['count'](_0x35e77b)[_0xd425('0x21')](function(_0x177704){_0x5d310e[_0xd425('0x31')]=_0x177704;if(_0x58f36d[_0xd425('0x45')][_0xd425('0x55')]){_0x3cf540[_0xd425('0x56')]=[{'all':!![]}];}return db['Trunk'][_0xd425('0x57')](_0x3cf540);})[_0xd425('0x21')](function(_0x5bfac6){_0x5d310e[_0xd425('0x58')]=_0x5bfac6;return _0x5d310e;})[_0xd425('0x21')](respondWithFilteredResult(_0x1d38fa,_0x3cf540))[_0xd425('0x2b')](handleError(_0x1d38fa,null));};exports[_0xd425('0x59')]=function(_0x5c0219,_0x54f1d){var _0x2b8882={'raw':![],'where':{'id':_0x5c0219[_0xd425('0x5a')]['id']}},_0x4552cd={};_0x4552cd[_0xd425('0x44')]=_['keys'](db['Trunk'][_0xd425('0x42')]);_0x4552cd['query']=_[_0xd425('0x46')](_0x5c0219[_0xd425('0x45')]);_0x4552cd['filters']=_[_0xd425('0x47')](_0x4552cd['model'],_0x4552cd['query']);_0x2b8882[_0xd425('0x49')]=_[_0xd425('0x47')](_0x4552cd[_0xd425('0x44')],qs[_0xd425('0x48')](_0x5c0219[_0xd425('0x45')][_0xd425('0x48')]));_0x2b8882[_0xd425('0x49')]=_0x2b8882[_0xd425('0x49')]['length']?_0x2b8882[_0xd425('0x49')]:_0x4552cd[_0xd425('0x44')];if(_0x5c0219[_0xd425('0x45')][_0xd425('0x55')]){_0x2b8882[_0xd425('0x56')]=[{'all':!![]}];}_0x2b8882=_[_0xd425('0x51')]({},_0x2b8882,_0x5c0219[_0xd425('0x54')]);return db[_0xd425('0x41')]['find'](_0x2b8882)['then'](handleEntityNotFound(_0x54f1d,null))['then'](respondWithResult(_0x54f1d,null))[_0xd425('0x2b')](handleError(_0x54f1d,null));};exports[_0xd425('0x5b')]=function(_0x3dec61,_0x3c6b49){var _0x59c286={'where':{'id':_0x3dec61['params']['id']}},_0x4fedc0={};_0x4fedc0['model']=_[_0xd425('0x46')](db[_0xd425('0x41')]['rawAttributes']);_0x59c286[_0xd425('0x49')]=_[_0xd425('0x47')](_0x4fedc0[_0xd425('0x44')],qs['fields'](_0x3dec61['query'][_0xd425('0x48')]));_0x59c286['attributes']=_0x59c286['attributes']['length']?_0x59c286[_0xd425('0x49')]:_0x4fedc0[_0xd425('0x44')];if(_0x3dec61[_0xd425('0x45')]['includeAll']){_0x59c286[_0xd425('0x56')]=[{'all':!![]}];}_0x59c286=_['merge']({},_0x59c286,_0x3dec61[_0xd425('0x54')]);return db[_0xd425('0x41')][_0xd425('0x5c')](_0x59c286)[_0xd425('0x21')](handleEntityNotFound(_0x3c6b49,null))[_0xd425('0x21')](function(_0xd261a){if(_0xd261a){var _0xa21f7c=_0xd261a[_0xd425('0x39')]({'plain':!![]});_0xa21f7c=qs[_0xd425('0x5d')](_0xa21f7c,['id','createdAt',_0xd425('0x5e')]);_0x3dec61[_0xd425('0x5f')]=_[_0xd425('0x5d')](_0x3dec61[_0xd425('0x5f')],['id','createdAt','updatedAt']);return db[_0xd425('0x41')][_0xd425('0x60')](_[_0xd425('0x51')](_0xa21f7c,_0x3dec61[_0xd425('0x5f')]),{'include':_0x3dec61[_0xd425('0x45')][_0xd425('0x55')]?[{'all':!![]}]:undefined})[_0xd425('0x21')](function(_0x44782a){var _0x1fcde4=_0x3dec61[_0xd425('0x61')][_0xd425('0x39')]({'plain':!![]});if(!_0x1fcde4)throw new Error(_0xd425('0x62'));if(_0x1fcde4[_0xd425('0x63')]===_0xd425('0x61')){var _0x5e72db=_0x44782a[_0xd425('0x39')]({'plain':!![]});var _0x343cc1=_0xd425('0x3a');return db['UserProfileSection']['find']({'where':{'name':_0x343cc1,'userProfileId':_0x1fcde4['userProfileId']},'raw':!![]})[_0xd425('0x21')](function(_0x34d065){if(_0x34d065&&_0x34d065[_0xd425('0x64')]===0x0){return db['UserProfileResource'][_0xd425('0x60')]({'name':_0x5e72db['name'],'resourceId':_0x5e72db['id'],'type':_0x34d065[_0xd425('0x3d')],'sectionId':_0x34d065['id']},{})[_0xd425('0x21')](function(){return _0x44782a;});}else{return _0x44782a;}})[_0xd425('0x2b')](function(_0x5113fc){logger[_0xd425('0x26')](_0xd425('0x65'),_0x5113fc);throw _0x5113fc;});}return _0x44782a;});}})[_0xd425('0x21')](respondWithResult(_0x3c6b49,0xc9))[_0xd425('0x2b')](handleError(_0x3c6b49,null));};exports[_0xd425('0x60')]=function(_0x43b1a9,_0x38a762,_0x44db7f){var _0xcb1a64;return db[_0xd425('0x41')][_0xd425('0x60')](_0x43b1a9[_0xd425('0x5f')],{'raw':!![]})[_0xd425('0x21')](function(_0x285d54){_0xcb1a64=_0x285d54;return db[_0xd425('0x41')][_0xd425('0x57')]({'raw':!![]});})[_0xd425('0x21')](function(_0x25cae6){var _0x541218=fs['readFileSync'](path[_0xd425('0x66')](config['root'],_0xd425('0x67')),_0xd425('0x68'));var _0xb407bb=fs[_0xd425('0x69')](path['join'](config[_0xd425('0x6a')],_0xd425('0x6b')),_0xd425('0x68'));var _0x689332=ejs[_0xd425('0x6c')](_0x541218,{'trunks':_0x25cae6||[]});fs[_0xd425('0x6d')]('/etc/asterisk/sip_xcally_trunks.conf',_0x689332);if(_0xcb1a64['registry']){var _0x3ccffe=ejs[_0xd425('0x6c')](_0xb407bb,{'trunks':_0x25cae6||[]});fs['writeFileSync'](_0xd425('0x6e'),_0x3ccffe);}})['then'](function(){return respondWithRpcPromise(_0xd425('0x6f'),_0xd425('0x60'),{'module':_0xd425('0x70')});})[_0xd425('0x21')](function(){var _0x376134=_0x43b1a9[_0xd425('0x61')][_0xd425('0x39')]({'plain':!![]});if(!_0x376134)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x376134[_0xd425('0x63')]===_0xd425('0x61')){var _0x24af3=_0xcb1a64[_0xd425('0x39')]({'plain':!![]});return db[_0xd425('0x71')]['find']({'where':{'name':_0xd425('0x3a'),'userProfileId':_0x376134[_0xd425('0x72')]},'raw':!![]})['then'](function(_0x2bb36f){if(_0x2bb36f&&_0x2bb36f[_0xd425('0x64')]===0x0){return db['UserProfileResource'][_0xd425('0x60')]({'name':_0x24af3[_0xd425('0x3d')],'resourceId':_0x24af3['id'],'type':_0x2bb36f[_0xd425('0x3d')],'sectionId':_0x2bb36f['id']},{})[_0xd425('0x21')](function(){return _0xcb1a64;});}else{return _0xcb1a64;}})[_0xd425('0x2b')](function(_0x572f23){logger[_0xd425('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x572f23);throw _0x572f23;});}return _0xcb1a64;})[_0xd425('0x21')](respondWithResult(_0x38a762,0xc9))[_0xd425('0x2b')](handleError(_0x38a762,null));};exports['update']=function(_0x2bf8e6,_0xcf7b51,_0x66d87b){var _0x1fc64d;return db['Trunk']['find']({'where':{'id':_0x2bf8e6[_0xd425('0x5a')]['id']}})[_0xd425('0x21')](handleEntityNotFound(_0xcf7b51,null))[_0xd425('0x21')](saveUpdates(_0x2bf8e6['body'],null))[_0xd425('0x21')](function(_0xb1479e){if(_0xb1479e){_0x1fc64d=_0xb1479e;return db['Trunk'][_0xd425('0x57')]({'raw':!![]});}})['then'](function(_0x998ad1){if(_0x998ad1){var _0x46346c=fs[_0xd425('0x69')](path[_0xd425('0x66')](config['root'],'server/files/templates/trunk.ejs'),_0xd425('0x68'));var _0x413a65=fs['readFileSync'](path[_0xd425('0x66')](config[_0xd425('0x6a')],'server/files/templates/registry.ejs'),_0xd425('0x68'));var _0x369f8b=ejs[_0xd425('0x6c')](_0x46346c,{'trunks':_0x998ad1||[]});fs[_0xd425('0x6d')](_0xd425('0x73'),_0x369f8b);var _0xf251e6=ejs[_0xd425('0x6c')](_0x413a65,{'trunks':_0x998ad1||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0xf251e6);return respondWithRpcPromise(_0xd425('0x6f'),'update',{'module':_0xd425('0x70')});}return null;})[_0xd425('0x21')](function(_0x58cad5){if(_0x58cad5){return _0x1fc64d;}})[_0xd425('0x21')](respondWithResult(_0xcf7b51,null))[_0xd425('0x2b')](handleError(_0xcf7b51,null));};exports['destroy']=function(_0x592c40,_0x750685,_0x242ed8){var _0x16eac6;return db[_0xd425('0x41')][_0xd425('0x5c')]({'where':{'id':_0x592c40[_0xd425('0x5a')]['id']}})[_0xd425('0x21')](handleEntityNotFound(_0x750685,null))[_0xd425('0x21')](removeEntity(_0x750685,null))['then'](function(){return db[_0xd425('0x41')][_0xd425('0x57')]({'raw':!![]});})['then'](function(_0x2bbcf3){var _0x1d386c=fs[_0xd425('0x69')](path[_0xd425('0x66')](config[_0xd425('0x6a')],_0xd425('0x67')),_0xd425('0x68'));var _0x2c3995=fs[_0xd425('0x69')](path[_0xd425('0x66')](config[_0xd425('0x6a')],'server/files/templates/registry.ejs'),_0xd425('0x68'));var _0x498e81=ejs['render'](_0x1d386c,{'trunks':_0x2bbcf3});var _0x2c8d63=ejs['render'](_0x2c3995,{'trunks':_0x2bbcf3});fs[_0xd425('0x6d')](_0xd425('0x73'),_0x498e81);fs[_0xd425('0x6d')](_0xd425('0x6e'),_0x2c8d63);return respondWithRpcPromise(_0xd425('0x6f'),_0xd425('0x74'),{'module':_0xd425('0x70')});})['catch'](handleError(_0x750685,null));};
\ No newline at end of file
index 359261b..fbec1de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7399=['moment','bluebird','path','rimraf','../../config/environment','./trunk.attributes','exports','Trunk','../../config/logger'];(function(_0x5c2829,_0x2e1482){var _0x4d6544=function(_0x63b01e){while(--_0x63b01e){_0x5c2829['push'](_0x5c2829['shift']());}};_0x4d6544(++_0x2e1482);}(_0x7399,0x1dc));var _0x9739=function(_0x2c0a00,_0x3548e4){_0x2c0a00=_0x2c0a00-0x0;var _0x119901=_0x7399[_0x2c0a00];return _0x119901;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9739('0x0'))('api');var moment=require(_0x9739('0x1'));var BPromise=require(_0x9739('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9739('0x3'));var rimraf=require(_0x9739('0x4'));var config=require(_0x9739('0x5'));var attributes=require(_0x9739('0x6'));module[_0x9739('0x7')]=function(_0x5669f2,_0x148ee7){return _0x5669f2['define'](_0x9739('0x8'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3ef9=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','util'];(function(_0x469ee1,_0x4bc97d){var _0x543b21=function(_0x3a8571){while(--_0x3a8571){_0x469ee1['push'](_0x469ee1['shift']());}};_0x543b21(++_0x4bc97d);}(_0x3ef9,0xe3));var _0x93ef=function(_0x6b2d97,_0x5b202b){_0x6b2d97=_0x6b2d97-0x0;var _0x1fce73=_0x3ef9[_0x6b2d97];return _0x1fce73;};'use strict';var _=require('lodash');var util=require(_0x93ef('0x0'));var logger=require(_0x93ef('0x1'))(_0x93ef('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x93ef('0x3'));var fs=require('fs');var path=require(_0x93ef('0x4'));var rimraf=require(_0x93ef('0x5'));var config=require(_0x93ef('0x6'));var attributes=require(_0x93ef('0x7'));module[_0x93ef('0x8')]=function(_0x5d9b4b,_0x2d0d47){return _0x5d9b4b[_0x93ef('0x9')](_0x93ef('0xa'),attributes,{'tableName':_0x93ef('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8efa0d0..f5122ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa730=['jayson/promise','http','request','info','Trunk,\x20%s,\x20%s','request\x20sent','error','code','message','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','stringify','find','ShowTrunk','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x1af98d,_0x3c608e){var _0x3553ea=function(_0x5668a4){while(--_0x5668a4){_0x1af98d['push'](_0x1af98d['shift']());}};_0x3553ea(++_0x3c608e);}(_0xa730,0x10f));var _0x0a73=function(_0x552fa5,_0x16235a){_0x552fa5=_0x552fa5-0x0;var _0x26559d=_0xa730[_0x552fa5];return _0x26559d;};'use strict';var _=require(_0x0a73('0x0'));var util=require(_0x0a73('0x1'));var moment=require(_0x0a73('0x2'));var BPromise=require('bluebird');var rs=require(_0x0a73('0x3'));var fs=require('fs');var Redis=require(_0x0a73('0x4'));var db=require(_0x0a73('0x5'))['db'];var utils=require(_0x0a73('0x6'));var logger=require('../../config/logger')(_0x0a73('0x7'));var config=require(_0x0a73('0x8'));var jayson=require(_0x0a73('0x9'));var client=jayson['client'][_0x0a73('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a9539,_0x166046,_0x5c00b6){return new BPromise(function(_0x544382,_0x498b53){return client[_0x0a73('0xb')](_0x4a9539,_0x5c00b6)['then'](function(_0x308364){logger[_0x0a73('0xc')](_0x0a73('0xd'),_0x166046,_0x0a73('0xe'));logger['debug']('Trunk,\x20%s,\x20%s,\x20%s',_0x166046,_0x0a73('0xe'),JSON['stringify'](_0x308364));if(_0x308364[_0x0a73('0xf')]){if(_0x308364[_0x0a73('0xf')][_0x0a73('0x10')]===0x1f4){logger[_0x0a73('0xf')](_0x0a73('0xd'),_0x166046,_0x308364[_0x0a73('0xf')][_0x0a73('0x11')]);return _0x498b53(_0x308364[_0x0a73('0xf')][_0x0a73('0x11')]);}logger[_0x0a73('0xf')](_0x0a73('0xd'),_0x166046,_0x308364[_0x0a73('0xf')]['message']);return _0x544382(_0x308364[_0x0a73('0xf')][_0x0a73('0x11')]);}else{logger[_0x0a73('0xc')](_0x0a73('0xd'),_0x166046,_0x0a73('0xe'));_0x544382(_0x308364['result']['message']);}})[_0x0a73('0x12')](function(_0x198068){logger['error']('Trunk,\x20%s,\x20%s',_0x166046,_0x198068);_0x498b53(_0x198068);});});}exports[_0x0a73('0x13')]=function(_0x32b676){var _0x12c1b3=this;return new Promise(function(_0x1b1f08,_0x2381c5){return db[_0x0a73('0x14')][_0x0a73('0x15')]({'raw':_0x32b676['options']?_0x32b676[_0x0a73('0x16')][_0x0a73('0x17')]===undefined?!![]:![]:!![],'where':_0x32b676[_0x0a73('0x16')]?_0x32b676[_0x0a73('0x16')][_0x0a73('0x18')]||null:null,'attributes':_0x32b676[_0x0a73('0x16')]?_0x32b676['options'][_0x0a73('0x19')]||null:null,'limit':_0x32b676[_0x0a73('0x16')]?_0x32b676[_0x0a73('0x16')][_0x0a73('0x1a')]||null:null,'include':_0x32b676[_0x0a73('0x16')]?_0x32b676[_0x0a73('0x16')][_0x0a73('0x1b')]?_[_0x0a73('0x1c')](_0x32b676[_0x0a73('0x16')][_0x0a73('0x1b')],function(_0x24820f){return{'model':db[_0x24820f[_0x0a73('0x1d')]],'as':_0x24820f['as'],'attributes':_0x24820f['attributes'],'include':_0x24820f[_0x0a73('0x1b')]?_[_0x0a73('0x1c')](_0x24820f[_0x0a73('0x1b')],function(_0x3fe447){return{'model':db[_0x3fe447['model']],'as':_0x3fe447['as'],'attributes':_0x3fe447[_0x0a73('0x19')],'include':_0x3fe447[_0x0a73('0x1b')]?_[_0x0a73('0x1c')](_0x3fe447[_0x0a73('0x1b')],function(_0x2b098d){return{'model':db[_0x2b098d['model']],'as':_0x2b098d['as'],'attributes':_0x2b098d[_0x0a73('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0a73('0x1e')](function(_0x34f9ca){logger[_0x0a73('0xc')](_0x0a73('0x13'),_0x32b676);logger[_0x0a73('0x1f')](_0x0a73('0x13'),_0x32b676,JSON[_0x0a73('0x20')](_0x34f9ca));_0x1b1f08(_0x34f9ca);})[_0x0a73('0x12')](function(_0x2d707f){logger[_0x0a73('0xf')](_0x0a73('0x13'),_0x2d707f['message'],_0x32b676);_0x2381c5(_0x12c1b3[_0x0a73('0xf')](0x1f4,_0x2d707f[_0x0a73('0x11')]));});});};exports['ShowTrunk']=function(_0x22c9e3){var _0x43d925=this;return new Promise(function(_0x11373e,_0x3e5397){return db[_0x0a73('0x14')][_0x0a73('0x21')]({'raw':_0x22c9e3[_0x0a73('0x16')]?_0x22c9e3['options']['raw']===undefined?!![]:![]:!![],'where':_0x22c9e3['options']?_0x22c9e3['options'][_0x0a73('0x18')]||null:null,'attributes':_0x22c9e3[_0x0a73('0x16')]?_0x22c9e3[_0x0a73('0x16')][_0x0a73('0x19')]||null:null,'include':_0x22c9e3[_0x0a73('0x16')]?_0x22c9e3[_0x0a73('0x16')][_0x0a73('0x1b')]?_[_0x0a73('0x1c')](_0x22c9e3[_0x0a73('0x16')][_0x0a73('0x1b')],function(_0x5e5fd8){return{'model':db[_0x5e5fd8[_0x0a73('0x1d')]],'as':_0x5e5fd8['as'],'attributes':_0x5e5fd8[_0x0a73('0x19')],'include':_0x5e5fd8[_0x0a73('0x1b')]?_[_0x0a73('0x1c')](_0x5e5fd8[_0x0a73('0x1b')],function(_0x2ddbe0){return{'model':db[_0x2ddbe0[_0x0a73('0x1d')]],'as':_0x2ddbe0['as'],'attributes':_0x2ddbe0[_0x0a73('0x19')],'include':_0x2ddbe0[_0x0a73('0x1b')]?_[_0x0a73('0x1c')](_0x2ddbe0['include'],function(_0x322777){return{'model':db[_0x322777[_0x0a73('0x1d')]],'as':_0x322777['as'],'attributes':_0x322777[_0x0a73('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0a73('0x1e')](function(_0x51547c){logger[_0x0a73('0xc')](_0x0a73('0x22'),_0x22c9e3);logger[_0x0a73('0x1f')](_0x0a73('0x22'),_0x22c9e3,JSON[_0x0a73('0x20')](_0x51547c));_0x11373e(_0x51547c);})[_0x0a73('0x12')](function(_0x11dd50){logger['error'](_0x0a73('0x22'),_0x11dd50[_0x0a73('0x11')],_0x22c9e3);_0x3e5397(_0x43d925[_0x0a73('0xf')](0x1f4,_0x11dd50[_0x0a73('0x11')]));});});};
\ No newline at end of file
+var _0xc411=['../../config/logger','rpc','../../config/environment','client','http','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','findAll','options','raw','attributes','limit','include','map','model','GetTrunk','ShowTrunk','Trunk','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xc411,0xca));var _0x1c41=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0xc411[_0x469a3c];return _0x968f4;};'use strict';var _=require(_0x1c41('0x0'));var util=require(_0x1c41('0x1'));var moment=require(_0x1c41('0x2'));var BPromise=require(_0x1c41('0x3'));var rs=require(_0x1c41('0x4'));var fs=require('fs');var Redis=require(_0x1c41('0x5'));var db=require(_0x1c41('0x6'))['db'];var utils=require(_0x1c41('0x7'));var logger=require(_0x1c41('0x8'))(_0x1c41('0x9'));var config=require(_0x1c41('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x1c41('0xb')][_0x1c41('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x18628d,_0x5aa75f,_0x136297){return new BPromise(function(_0x31c860,_0x48e96f){return client['request'](_0x18628d,_0x136297)[_0x1c41('0xd')](function(_0xe54a5d){logger['info'](_0x1c41('0xe'),_0x5aa75f,_0x1c41('0xf'));logger[_0x1c41('0x10')]('Trunk,\x20%s,\x20%s,\x20%s',_0x5aa75f,_0x1c41('0xf'),JSON[_0x1c41('0x11')](_0xe54a5d));if(_0xe54a5d['error']){if(_0xe54a5d[_0x1c41('0x12')][_0x1c41('0x13')]===0x1f4){logger[_0x1c41('0x12')]('Trunk,\x20%s,\x20%s',_0x5aa75f,_0xe54a5d[_0x1c41('0x12')][_0x1c41('0x14')]);return _0x48e96f(_0xe54a5d[_0x1c41('0x12')][_0x1c41('0x14')]);}logger['error'](_0x1c41('0xe'),_0x5aa75f,_0xe54a5d[_0x1c41('0x12')][_0x1c41('0x14')]);return _0x31c860(_0xe54a5d['error'][_0x1c41('0x14')]);}else{logger[_0x1c41('0x15')](_0x1c41('0xe'),_0x5aa75f,_0x1c41('0xf'));_0x31c860(_0xe54a5d[_0x1c41('0x16')][_0x1c41('0x14')]);}})[_0x1c41('0x17')](function(_0x3fb839){logger['error'](_0x1c41('0xe'),_0x5aa75f,_0x3fb839);_0x48e96f(_0x3fb839);});});}exports['GetTrunk']=function(_0x22f166){var _0x3e2d6b=this;return new Promise(function(_0x402863,_0x374c7c){return db['Trunk'][_0x1c41('0x18')]({'raw':_0x22f166[_0x1c41('0x19')]?_0x22f166[_0x1c41('0x19')][_0x1c41('0x1a')]===undefined?!![]:![]:!![],'where':_0x22f166[_0x1c41('0x19')]?_0x22f166[_0x1c41('0x19')]['where']||null:null,'attributes':_0x22f166[_0x1c41('0x19')]?_0x22f166[_0x1c41('0x19')][_0x1c41('0x1b')]||null:null,'limit':_0x22f166['options']?_0x22f166[_0x1c41('0x19')][_0x1c41('0x1c')]||null:null,'include':_0x22f166[_0x1c41('0x19')]?_0x22f166[_0x1c41('0x19')][_0x1c41('0x1d')]?_[_0x1c41('0x1e')](_0x22f166[_0x1c41('0x19')][_0x1c41('0x1d')],function(_0x35cfdd){return{'model':db[_0x35cfdd[_0x1c41('0x1f')]],'as':_0x35cfdd['as'],'attributes':_0x35cfdd[_0x1c41('0x1b')],'include':_0x35cfdd[_0x1c41('0x1d')]?_[_0x1c41('0x1e')](_0x35cfdd['include'],function(_0x38f1d0){return{'model':db[_0x38f1d0[_0x1c41('0x1f')]],'as':_0x38f1d0['as'],'attributes':_0x38f1d0[_0x1c41('0x1b')],'include':_0x38f1d0[_0x1c41('0x1d')]?_['map'](_0x38f1d0[_0x1c41('0x1d')],function(_0x640bda){return{'model':db[_0x640bda[_0x1c41('0x1f')]],'as':_0x640bda['as'],'attributes':_0x640bda[_0x1c41('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x53d02f){logger['info'](_0x1c41('0x20'),_0x22f166);logger['debug'](_0x1c41('0x20'),_0x22f166,JSON[_0x1c41('0x11')](_0x53d02f));_0x402863(_0x53d02f);})[_0x1c41('0x17')](function(_0x41d3c1){logger[_0x1c41('0x12')](_0x1c41('0x20'),_0x41d3c1[_0x1c41('0x14')],_0x22f166);_0x374c7c(_0x3e2d6b[_0x1c41('0x12')](0x1f4,_0x41d3c1[_0x1c41('0x14')]));});});};exports[_0x1c41('0x21')]=function(_0xb96f5c){var _0x501749=this;return new Promise(function(_0x55dce6,_0x177c5e){return db[_0x1c41('0x22')]['find']({'raw':_0xb96f5c['options']?_0xb96f5c[_0x1c41('0x19')][_0x1c41('0x1a')]===undefined?!![]:![]:!![],'where':_0xb96f5c[_0x1c41('0x19')]?_0xb96f5c[_0x1c41('0x19')]['where']||null:null,'attributes':_0xb96f5c[_0x1c41('0x19')]?_0xb96f5c[_0x1c41('0x19')]['attributes']||null:null,'include':_0xb96f5c['options']?_0xb96f5c[_0x1c41('0x19')][_0x1c41('0x1d')]?_[_0x1c41('0x1e')](_0xb96f5c[_0x1c41('0x19')][_0x1c41('0x1d')],function(_0x2c2086){return{'model':db[_0x2c2086[_0x1c41('0x1f')]],'as':_0x2c2086['as'],'attributes':_0x2c2086[_0x1c41('0x1b')],'include':_0x2c2086[_0x1c41('0x1d')]?_[_0x1c41('0x1e')](_0x2c2086[_0x1c41('0x1d')],function(_0x474184){return{'model':db[_0x474184[_0x1c41('0x1f')]],'as':_0x474184['as'],'attributes':_0x474184[_0x1c41('0x1b')],'include':_0x474184[_0x1c41('0x1d')]?_['map'](_0x474184['include'],function(_0x27e634){return{'model':db[_0x27e634[_0x1c41('0x1f')]],'as':_0x27e634['as'],'attributes':_0x27e634['attributes']};}):[]};}):[]};}):[]:[]})[_0x1c41('0xd')](function(_0x4f5fa1){logger['info'](_0x1c41('0x21'),_0xb96f5c);logger[_0x1c41('0x10')]('ShowTrunk',_0xb96f5c,JSON[_0x1c41('0x11')](_0x4f5fa1));_0x55dce6(_0x4f5fa1);})[_0x1c41('0x17')](function(_0x5e4398){logger['error'](_0x1c41('0x21'),_0x5e4398[_0x1c41('0x14')],_0xb96f5c);_0x177c5e(_0x501749[_0x1c41('0x12')](0x1f4,_0x5e4398[_0x1c41('0x14')]));});});};
\ No newline at end of file
index 2f2030c..19f1822 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe042=['logout','/:id/pause','/:id/unpause','addTeams','/:id/chat_interactions','/:id/mail_interactions','addMailInteractions','addFaxInteractions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addChatWebsites','/:id/whatsapp_accounts','addWhatsappAccounts','addSquareProjects','createApiKey','update','/:id/password','changePassword','delete','removeTeams','destroy','removeChatInteractions','removeMailInteractions','/:id/fax_interactions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/whoami','/:id','show','getAvatar','getOpenTabs','/:id/contacts','getContacts','/:id/queues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','addContacts','post','create','/create_many','bulkCreate','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','/:id/avatar','single','file','addAvatar','/:id/login','login','/:id/logout'];(function(_0x534c8f,_0x500079){var _0x5a57f5=function(_0x38ec0a){while(--_0x38ec0a){_0x534c8f['push'](_0x534c8f['shift']());}};_0x5a57f5(++_0x500079);}(_0xe042,0x115));var _0x2e04=function(_0x1a1b6e,_0x3a07a9){_0x1a1b6e=_0x1a1b6e-0x0;var _0x571e2c=_0xe042[_0x1a1b6e];return _0x571e2c;};'use strict';var multer=require(_0x2e04('0x0'));var util=require(_0x2e04('0x1'));var path=require(_0x2e04('0x2'));var timeout=require('connect-timeout');var express=require(_0x2e04('0x3'));var router=express[_0x2e04('0x4')]();var fs_extra=require(_0x2e04('0x5'));var auth=require(_0x2e04('0x6'));var interaction=require(_0x2e04('0x7'));var config=require(_0x2e04('0x8'));var controller=require('./user.controller');router[_0x2e04('0x9')]('/',auth[_0x2e04('0xa')](),controller['index']);router[_0x2e04('0x9')]('/describe',auth[_0x2e04('0xa')](),controller[_0x2e04('0xb')]);router[_0x2e04('0x9')](_0x2e04('0xc'),auth[_0x2e04('0xa')](),controller['whoami']);router[_0x2e04('0x9')]('/presence',auth[_0x2e04('0xa')](),controller['getPresence']);router[_0x2e04('0x9')](_0x2e04('0xd'),auth['isAuthenticated'](),controller[_0x2e04('0xe')]);router[_0x2e04('0x9')]('/:id/avatar',controller[_0x2e04('0xf')]);router[_0x2e04('0x9')]('/:id/open_tabs',auth[_0x2e04('0xa')](),controller[_0x2e04('0x10')]);router[_0x2e04('0x9')](_0x2e04('0x11'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x12')]);router[_0x2e04('0x9')](_0x2e04('0x13'),auth[_0x2e04('0xa')](),controller['getQueues']);router['get'](_0x2e04('0x14'),auth['isAuthenticated'](),controller[_0x2e04('0x15')]);router['get'](_0x2e04('0x16'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x17')]);router[_0x2e04('0x9')](_0x2e04('0x18'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x19')]);router[_0x2e04('0x9')](_0x2e04('0x1a'),auth[_0x2e04('0xa')](),controller['getScreenRecordings']);router[_0x2e04('0x9')](_0x2e04('0x1b'),auth['isAuthenticated'](),controller[_0x2e04('0x1c')]);router[_0x2e04('0x9')](_0x2e04('0x1d'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x1e')]);router[_0x2e04('0x9')]('/:id/mail/interactions',auth[_0x2e04('0xa')](),controller[_0x2e04('0x1f')]);router['get'](_0x2e04('0x20'),auth[_0x2e04('0xa')](),controller['getSmsInteractions']);router[_0x2e04('0x9')](_0x2e04('0x21'),auth['isAuthenticated'](),controller[_0x2e04('0x22')]);router['get'](_0x2e04('0x23'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x24')]);router[_0x2e04('0x9')](_0x2e04('0x25'),auth['isAuthenticated'](),controller[_0x2e04('0x26')]);router[_0x2e04('0x9')](_0x2e04('0x27'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x28')]);router['get'](_0x2e04('0x29'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x2a')]);router[_0x2e04('0x9')]('/:id/prefixes',auth['isAuthenticated'](),controller[_0x2e04('0x2b')]);router[_0x2e04('0x9')](_0x2e04('0x2c'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x2d')]);router[_0x2e04('0x9')]('/:id/mail_accounts',auth[_0x2e04('0xa')](),controller[_0x2e04('0x2e')]);router[_0x2e04('0x9')](_0x2e04('0x2f'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x30')]);router[_0x2e04('0x9')](_0x2e04('0x31'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x32')]);router['get'](_0x2e04('0x33'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x34')]);router[_0x2e04('0x9')]('/:id/whatsapp_accounts',auth[_0x2e04('0xa')](),controller['getWhatsappAccounts']);router[_0x2e04('0x9')](_0x2e04('0x35'),auth[_0x2e04('0xa')](),controller['getSquareProjects']);router['get'](_0x2e04('0x36'),auth['isAuthenticated'](),controller[_0x2e04('0x37')]);router[_0x2e04('0x9')](_0x2e04('0x38'),auth[_0x2e04('0xa')](),controller['getApiKey']);router['post'](_0x2e04('0x11'),auth['isAuthenticated'](),controller[_0x2e04('0x39')]);router[_0x2e04('0x3a')]('/',auth[_0x2e04('0xa')](),controller[_0x2e04('0x3b')]);router[_0x2e04('0x3a')](_0x2e04('0x3c'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x3d')]);router['post'](_0x2e04('0x13'),auth[_0x2e04('0xa')](),controller['addQueues']);var upload=multer({'storage':multer[_0x2e04('0x3e')]({'destination':function(_0x30da4e,_0x118401,_0x54d3e9){_0x54d3e9(null,path[_0x2e04('0x3f')](config[_0x2e04('0x40')],_0x2e04('0x41')));},'filename':function(_0x373f9b,_0x8781da,_0x44adf2){_0x44adf2(null,util[_0x2e04('0x42')](_0x2e04('0x43'),Date[_0x2e04('0x44')](),_0x8781da[_0x2e04('0x45')]));}})});router['post'](_0x2e04('0x46'),upload[_0x2e04('0x47')](_0x2e04('0x48')),controller[_0x2e04('0x49')]);router['post'](_0x2e04('0x4a'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x4b')]);router[_0x2e04('0x3a')](_0x2e04('0x4c'),auth['isAuthenticated'](),controller[_0x2e04('0x4d')]);router[_0x2e04('0x3a')](_0x2e04('0x4e'),auth['isAuthenticated'](),controller['pause']);router['post'](_0x2e04('0x4f'),auth[_0x2e04('0xa')](),controller['unpause']);router[_0x2e04('0x3a')](_0x2e04('0x25'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x50')]);router[_0x2e04('0x3a')](_0x2e04('0x51'),auth[_0x2e04('0xa')](),controller['addChatInteractions']);router[_0x2e04('0x3a')](_0x2e04('0x52'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x53')]);router['post']('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x2e04('0x54')]);router[_0x2e04('0x3a')](_0x2e04('0x55'),auth[_0x2e04('0xa')](),controller['addSmsInteractions']);router[_0x2e04('0x3a')](_0x2e04('0x56'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x57')]);router[_0x2e04('0x3a')](_0x2e04('0x58'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x59')]);router['post']('/:id/fax_accounts',auth[_0x2e04('0xa')](),controller[_0x2e04('0x5a')]);router[_0x2e04('0x3a')](_0x2e04('0x5b'),auth['isAuthenticated'](),controller[_0x2e04('0x5c')]);router[_0x2e04('0x3a')](_0x2e04('0x2f'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x5d')]);router[_0x2e04('0x3a')](_0x2e04('0x31'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x5e')]);router[_0x2e04('0x3a')](_0x2e04('0x33'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x5f')]);router[_0x2e04('0x3a')](_0x2e04('0x60'),auth['isAuthenticated'](),controller[_0x2e04('0x61')]);router[_0x2e04('0x3a')](_0x2e04('0x35'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x62')]);router[_0x2e04('0x3a')](_0x2e04('0x38'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x63')]);router['put'](_0x2e04('0xd'),auth['isAuthenticated'](),controller[_0x2e04('0x64')]);router['put'](_0x2e04('0x65'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x66')]);router[_0x2e04('0x67')](_0x2e04('0x13'),auth[_0x2e04('0xa')](),controller['removeQueues']);router[_0x2e04('0x67')]('/:id/teams',auth[_0x2e04('0xa')](),controller[_0x2e04('0x68')]);router[_0x2e04('0x67')](_0x2e04('0xd'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x69')]);router[_0x2e04('0x67')](_0x2e04('0x51'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x6a')]);router['delete'](_0x2e04('0x52'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x6b')]);router['delete'](_0x2e04('0x6c'),auth['isAuthenticated'](),controller[_0x2e04('0x6d')]);router[_0x2e04('0x67')](_0x2e04('0x55'),auth['isAuthenticated'](),controller[_0x2e04('0x6e')]);router[_0x2e04('0x67')](_0x2e04('0x56'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x6f')]);router[_0x2e04('0x67')](_0x2e04('0x58'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x70')]);router['delete']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x2e04('0x71')]);router[_0x2e04('0x67')](_0x2e04('0x5b'),auth[_0x2e04('0xa')](),controller['removeMailAccounts']);router[_0x2e04('0x67')]('/:id/openchannel_accounts',auth[_0x2e04('0xa')](),controller['removeOpenchannelAccounts']);router[_0x2e04('0x67')](_0x2e04('0x31'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x72')]);router[_0x2e04('0x67')](_0x2e04('0x33'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x73')]);router[_0x2e04('0x67')](_0x2e04('0x60'),auth['isAuthenticated'](),controller[_0x2e04('0x74')]);router[_0x2e04('0x67')](_0x2e04('0x35'),auth[_0x2e04('0xa')](),controller[_0x2e04('0x75')]);router['delete'](_0x2e04('0x38'),auth[_0x2e04('0xa')](),controller['removeApiKey']);module['exports']=router;
\ No newline at end of file
+var _0x98a1=['getApiKey','addContacts','post','/create_many','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','/:id/mail_accounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/chat_websites','addWhatsappAccounts','createApiKey','put','update','/:id/password','delete','removeTeams','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','/:id/fax_accounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','path','express','fs-extra','../../config/environment','./user.controller','/describe','isAuthenticated','/whoami','whoami','get','/presence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','/:id/teams','getTeams','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/whatsapp_accounts','/:id/square_projects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key'];(function(_0x163f77,_0x72fcf4){var _0x24b1ff=function(_0x71654d){while(--_0x71654d){_0x163f77['push'](_0x163f77['shift']());}};_0x24b1ff(++_0x72fcf4);}(_0x98a1,0xaf));var _0x198a=function(_0x4eceb5,_0x42b285){_0x4eceb5=_0x4eceb5-0x0;var _0x470a68=_0x98a1[_0x4eceb5];return _0x470a68;};'use strict';var multer=require(_0x198a('0x0'));var util=require(_0x198a('0x1'));var path=require(_0x198a('0x2'));var timeout=require('connect-timeout');var express=require(_0x198a('0x3'));var router=express['Router']();var fs_extra=require(_0x198a('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x198a('0x5'));var controller=require(_0x198a('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x198a('0x7'),auth[_0x198a('0x8')](),controller['describe']);router['get'](_0x198a('0x9'),auth[_0x198a('0x8')](),controller[_0x198a('0xa')]);router[_0x198a('0xb')](_0x198a('0xc'),auth[_0x198a('0x8')](),controller['getPresence']);router[_0x198a('0xb')](_0x198a('0xd'),auth[_0x198a('0x8')](),controller[_0x198a('0xe')]);router[_0x198a('0xb')](_0x198a('0xf'),controller[_0x198a('0x10')]);router[_0x198a('0xb')](_0x198a('0x11'),auth[_0x198a('0x8')](),controller[_0x198a('0x12')]);router[_0x198a('0xb')](_0x198a('0x13'),auth[_0x198a('0x8')](),controller[_0x198a('0x14')]);router['get'](_0x198a('0x15'),auth[_0x198a('0x8')](),controller[_0x198a('0x16')]);router[_0x198a('0xb')](_0x198a('0x17'),auth[_0x198a('0x8')](),controller[_0x198a('0x18')]);router[_0x198a('0xb')](_0x198a('0x19'),auth[_0x198a('0x8')](),controller[_0x198a('0x1a')]);router[_0x198a('0xb')](_0x198a('0x1b'),auth[_0x198a('0x8')](),controller[_0x198a('0x1c')]);router[_0x198a('0xb')](_0x198a('0x1d'),auth[_0x198a('0x8')](),controller['getScreenRecordings']);router[_0x198a('0xb')](_0x198a('0x1e'),auth[_0x198a('0x8')](),controller[_0x198a('0x1f')]);router[_0x198a('0xb')](_0x198a('0x20'),auth['isAuthenticated'](),controller['getOpenchannelInteractions']);router[_0x198a('0xb')]('/:id/mail/interactions',auth[_0x198a('0x8')](),controller['getMailInteractions']);router[_0x198a('0xb')](_0x198a('0x21'),auth[_0x198a('0x8')](),controller[_0x198a('0x22')]);router[_0x198a('0xb')](_0x198a('0x23'),auth[_0x198a('0x8')](),controller['getFaxInteractions']);router['get'](_0x198a('0x24'),auth[_0x198a('0x8')](),controller['getWhatsappInteractions']);router[_0x198a('0xb')](_0x198a('0x25'),auth[_0x198a('0x8')](),controller[_0x198a('0x26')]);router[_0x198a('0xb')]('/:id/lists',auth['isAuthenticated'](),controller[_0x198a('0x27')]);router[_0x198a('0xb')](_0x198a('0x28'),auth['isAuthenticated'](),controller[_0x198a('0x29')]);router[_0x198a('0xb')](_0x198a('0x2a'),auth[_0x198a('0x8')](),controller[_0x198a('0x2b')]);router['get']('/:id/fax_accounts',auth[_0x198a('0x8')](),controller[_0x198a('0x2c')]);router[_0x198a('0xb')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x198a('0x2d')]);router['get'](_0x198a('0x2e'),auth[_0x198a('0x8')](),controller[_0x198a('0x2f')]);router['get'](_0x198a('0x30'),auth[_0x198a('0x8')](),controller[_0x198a('0x31')]);router[_0x198a('0xb')]('/:id/chat_websites',auth[_0x198a('0x8')](),controller['getChatWebsites']);router[_0x198a('0xb')](_0x198a('0x32'),auth[_0x198a('0x8')](),controller['getWhatsappAccounts']);router[_0x198a('0xb')](_0x198a('0x33'),auth['isAuthenticated'](),controller['getSquareProjects']);router[_0x198a('0xb')](_0x198a('0x34'),auth[_0x198a('0x8')](),controller[_0x198a('0x35')]);router[_0x198a('0xb')](_0x198a('0x36'),auth[_0x198a('0x8')](),controller[_0x198a('0x37')]);router['post'](_0x198a('0x13'),auth['isAuthenticated'](),controller[_0x198a('0x38')]);router[_0x198a('0x39')]('/',auth[_0x198a('0x8')](),controller['create']);router[_0x198a('0x39')](_0x198a('0x3a'),auth[_0x198a('0x8')](),controller[_0x198a('0x3b')]);router[_0x198a('0x39')](_0x198a('0x15'),auth['isAuthenticated'](),controller[_0x198a('0x3c')]);var upload=multer({'storage':multer[_0x198a('0x3d')]({'destination':function(_0x527b6f,_0x3aee56,_0x29cbc2){_0x29cbc2(null,path[_0x198a('0x3e')](config[_0x198a('0x3f')],_0x198a('0x40')));},'filename':function(_0x48eeb6,_0x4262f4,_0x53dc37){_0x53dc37(null,util[_0x198a('0x41')](_0x198a('0x42'),Date[_0x198a('0x43')](),_0x4262f4[_0x198a('0x44')]));}})});router[_0x198a('0x39')]('/:id/avatar',upload[_0x198a('0x45')](_0x198a('0x46')),controller[_0x198a('0x47')]);router['post']('/:id/login',auth[_0x198a('0x8')](),controller[_0x198a('0x48')]);router[_0x198a('0x39')](_0x198a('0x49'),auth[_0x198a('0x8')](),controller[_0x198a('0x4a')]);router[_0x198a('0x39')](_0x198a('0x4b'),auth['isAuthenticated'](),controller[_0x198a('0x4c')]);router[_0x198a('0x39')](_0x198a('0x4d'),auth[_0x198a('0x8')](),controller['unpause']);router[_0x198a('0x39')](_0x198a('0x25'),auth['isAuthenticated'](),controller[_0x198a('0x4e')]);router['post'](_0x198a('0x4f'),auth[_0x198a('0x8')](),controller[_0x198a('0x50')]);router[_0x198a('0x39')](_0x198a('0x51'),auth[_0x198a('0x8')](),controller['addMailInteractions']);router[_0x198a('0x39')](_0x198a('0x52'),auth['isAuthenticated'](),controller[_0x198a('0x53')]);router['post'](_0x198a('0x54'),auth[_0x198a('0x8')](),controller[_0x198a('0x55')]);router[_0x198a('0x39')](_0x198a('0x56'),auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router[_0x198a('0x39')](_0x198a('0x57'),auth[_0x198a('0x8')](),controller[_0x198a('0x58')]);router[_0x198a('0x39')]('/:id/fax_accounts',auth[_0x198a('0x8')](),controller[_0x198a('0x59')]);router[_0x198a('0x39')](_0x198a('0x5a'),auth[_0x198a('0x8')](),controller[_0x198a('0x5b')]);router['post'](_0x198a('0x2e'),auth[_0x198a('0x8')](),controller[_0x198a('0x5c')]);router[_0x198a('0x39')]('/:id/sms_accounts',auth[_0x198a('0x8')](),controller[_0x198a('0x5d')]);router[_0x198a('0x39')](_0x198a('0x5e'),auth[_0x198a('0x8')](),controller['addChatWebsites']);router[_0x198a('0x39')]('/:id/whatsapp_accounts',auth[_0x198a('0x8')](),controller[_0x198a('0x5f')]);router[_0x198a('0x39')](_0x198a('0x33'),auth[_0x198a('0x8')](),controller['addSquareProjects']);router[_0x198a('0x39')](_0x198a('0x36'),auth[_0x198a('0x8')](),controller[_0x198a('0x60')]);router[_0x198a('0x61')](_0x198a('0xd'),auth[_0x198a('0x8')](),controller[_0x198a('0x62')]);router[_0x198a('0x61')](_0x198a('0x63'),auth[_0x198a('0x8')](),controller['changePassword']);router[_0x198a('0x64')](_0x198a('0x15'),auth[_0x198a('0x8')](),controller['removeQueues']);router[_0x198a('0x64')](_0x198a('0x25'),auth[_0x198a('0x8')](),controller[_0x198a('0x65')]);router[_0x198a('0x64')](_0x198a('0xd'),auth[_0x198a('0x8')](),controller['destroy']);router[_0x198a('0x64')](_0x198a('0x4f'),auth[_0x198a('0x8')](),controller['removeChatInteractions']);router[_0x198a('0x64')](_0x198a('0x51'),auth[_0x198a('0x8')](),controller[_0x198a('0x66')]);router[_0x198a('0x64')](_0x198a('0x52'),auth[_0x198a('0x8')](),controller[_0x198a('0x67')]);router[_0x198a('0x64')](_0x198a('0x54'),auth['isAuthenticated'](),controller[_0x198a('0x68')]);router[_0x198a('0x64')](_0x198a('0x56'),auth[_0x198a('0x8')](),controller[_0x198a('0x69')]);router[_0x198a('0x64')](_0x198a('0x57'),auth[_0x198a('0x8')](),controller[_0x198a('0x6a')]);router[_0x198a('0x64')](_0x198a('0x6b'),auth['isAuthenticated'](),controller['removeFaxAccounts']);router[_0x198a('0x64')]('/:id/mail_accounts',auth[_0x198a('0x8')](),controller[_0x198a('0x6c')]);router['delete'](_0x198a('0x2e'),auth['isAuthenticated'](),controller['removeOpenchannelAccounts']);router[_0x198a('0x64')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x198a('0x6d')]);router[_0x198a('0x64')](_0x198a('0x5e'),auth['isAuthenticated'](),controller[_0x198a('0x6e')]);router[_0x198a('0x64')](_0x198a('0x32'),auth[_0x198a('0x8')](),controller[_0x198a('0x6f')]);router[_0x198a('0x64')](_0x198a('0x33'),auth[_0x198a('0x8')](),controller[_0x198a('0x70')]);router[_0x198a('0x64')](_0x198a('0x36'),auth[_0x198a('0x8')](),controller[_0x198a('0x71')]);module[_0x198a('0x72')]=router;
\ No newline at end of file
index 4e7fde9..8ae4fbd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4300=['blockedAt','loginAttempts','sequelize','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','user','local','INTEGER','accountcode','DATE','BOOLEAN','DEFAULT\x20PAUSE','dynamic','friend','peer','from-sip','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','rfc2833','yes','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','accept','refuse','originate','uac','uas','certificate','active','passive','actpass','nonat','update','update,nonat','TEXT','showWebBar','get','isArray','wss','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlscertfile','rtcp_mux','avpf','dtlssetup','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blocked'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x4300,0x1a6));var _0x0430=function(_0x1192c5,_0x448d1d){_0x1192c5=_0x1192c5-0x0;var _0x2ef876=_0x4300[_0x1192c5];return _0x2ef876;};'use strict';var Sequelize=require(_0x0430('0x0'));var moment=require('moment');var util=require('util');var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0430('0x1')],'allowNull':![],'unique':_0x0430('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x1c139f){this[_0x0430('0x3')](_0x0430('0x2'),_0x1c139f);this['setDataValue'](_0x0430('0x4'),_0x1c139f);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0430('0x1')],'allowNull':![],'set':function(_0x5b03ef){this[_0x0430('0x3')](_0x0430('0x5'),_0x5b03ef);this[_0x0430('0x3')](_0x0430('0x6'),util[_0x0430('0x7')](_0x0430('0x8'),_0x5b03ef,this[_0x0430('0x9')](_0x0430('0xa'))));}},'alias':{'type':Sequelize[_0x0430('0x1')]},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0430('0xb'),'validate':{'isEmail':!![]},'set':function(_0x364f7f){if(_0x364f7f){this[_0x0430('0x3')](_0x0430('0xb'),_0x364f7f[_0x0430('0xc')]());}}},'role':{'type':Sequelize[_0x0430('0xd')](_0x0430('0xe'),_0x0430('0xf'),'agent','telephone'),'allowNull':![]},'password':{'type':Sequelize[_0x0430('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0430('0x1')],'defaultValue':_0x0430('0x10')},'internal':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':![],'unique':_0x0430('0xa'),'set':function(_0x39d4e2){this[_0x0430('0x3')]('internal',_0x39d4e2);this[_0x0430('0x3')](_0x0430('0x12'),_0x39d4e2);this[_0x0430('0x3')](_0x0430('0x6'),util['format']('\x22%s\x22\x20<%s>',this['getDataValue'](_0x0430('0x5')),_0x39d4e2));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x0430('0x1')]},'address':{'type':Sequelize[_0x0430('0x1')]},'zipcode':{'type':Sequelize[_0x0430('0x1')]},'userpic':{'type':Sequelize[_0x0430('0x1')]},'city':{'type':Sequelize[_0x0430('0x1')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0430('0x13')]},'voicePause':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0430('0x1')],'defaultValue':_0x0430('0x15')},'lastPauseAt':{'type':Sequelize[_0x0430('0x13')]},'chatCapacity':{'type':Sequelize[_0x0430('0x11')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x0430('0x11')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0430('0x11')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x0430('0x11')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0430('0x11')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0430('0x14')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x0430('0x11')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0430('0x11')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0430('0x11')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'description':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0430('0x16')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize['INTEGER'](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x17'),_0x0430('0xf'),_0x0430('0x18')),'allowNull':!![],'defaultValue':_0x0430('0x17')},'context':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![],'defaultValue':_0x0430('0x19')},'callingpres':{'type':Sequelize['ENUM']('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x0430('0x1a'),'ALLOWED',_0x0430('0x1b'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0x0430('0x1c')),'allowNull':!![]},'deny':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![],'defaultValue':_0x0430('0x1d'),'set':function(_0x530a09){this['setDataValue'](_0x0430('0x1e'),_0x530a09?_0x530a09[_0x0430('0x1f')](','):null);},'get':function(){return this[_0x0430('0x9')](_0x0430('0x1e'))?this[_0x0430('0x9')](_0x0430('0x1e'))[_0x0430('0x20')](','):null;},'comment':_0x0430('0x21')},'dtmfmode':{'type':Sequelize[_0x0430('0xd')]('rfc2833',_0x0430('0x22'),_0x0430('0x23'),_0x0430('0x24'),'auto'),'allowNull':!![],'defaultValue':_0x0430('0x25')},'directmedia':{'type':Sequelize['ENUM'](_0x0430('0x26'),'no','nonat','update',_0x0430('0x27')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'nat':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x659aca){this[_0x0430('0x3')](_0x0430('0x28'),_0x659aca?_0x659aca[_0x0430('0x1f')](','):null);},'get':function(){return this[_0x0430('0x9')](_0x0430('0x28'))?this[_0x0430('0x9')](_0x0430('0x28'))[_0x0430('0x20')](','):null;},'comment':_0x0430('0x29')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0x0430('0x1')]},'pickupgroup':{'type':Sequelize[_0x0430('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x0430('0x1')]},'language':{'type':Sequelize[_0x0430('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0430('0x1')]},'disallow':{'type':Sequelize[_0x0430('0x1')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x0430('0x1')],'allowNull':![],'defaultValue':_0x0430('0x2a'),'set':function(_0x50cdcd){this[_0x0430('0x3')](_0x0430('0x2b'),_0x50cdcd?_0x50cdcd[_0x0430('0x1f')](';'):_0x0430('0x2a'));},'get':function(){return this[_0x0430('0x9')](_0x0430('0x2b'))?this[_0x0430('0x9')](_0x0430('0x2b'))[_0x0430('0x20')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![],'set':function(_0x3f5218){this['setDataValue'](_0x0430('0x2c'),_0x3f5218?_0x3f5218[_0x0430('0x1f')](','):null);},'get':function(){return this[_0x0430('0x9')](_0x0430('0x2c'))?this[_0x0430('0x9')](_0x0430('0x2c'))[_0x0430('0x20')](','):null;},'comment':_0x0430('0x2d')},'trustrpid':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0430('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0430('0xd')]('yes','no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0430('0xd')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0430('0x26'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0430('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0430('0x26'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'template':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x0430('0x26'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x2e'),_0x0430('0x2f'),_0x0430('0x30')),'allowNull':!![]},'session_expires':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x31'),_0x0430('0x32')),'allowNull':!![],'defaultValue':_0x0430('0x32')},'t38pt_usertpsource':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no'),'allowNull':!![],'defaultValue':_0x0430('0x26')},'keepalive':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0430('0x26'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no','fingerprint',_0x0430('0x33')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x34'),_0x0430('0x35'),_0x0430('0x36')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0430('0x26'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x0430('0x11')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0430('0xd')](_0x0430('0x26'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x0430('0x26'),'no',_0x0430('0x37'),_0x0430('0x38'),_0x0430('0x39')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0430('0x1')]},'resetPasswordExpires':{'type':Sequelize[_0x0430('0x13')]},'passwordResetAt':{'type':Sequelize[_0x0430('0x13')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x0430('0x3a')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x2dbf77){this[_0x0430('0x3')](_0x0430('0x3b'),_0x2dbf77);var _0x83683a=this[_0x0430('0x3c')]({'plain':!![]});switch(_0x2dbf77){case 0x0:case 0x1:var _0x693d30=_0x83683a[_0x0430('0x1e')]?_[_0x0430('0x3d')](_0x83683a[_0x0430('0x1e')])?_0x83683a[_0x0430('0x1e')][_0x0430('0x1f')]():_0x83683a[_0x0430('0x1e')]:_0x0430('0x1d');if(_0x693d30===_0x0430('0x3e')){_0x693d30='udp';}this[_0x0430('0x3')](_0x0430('0x1e'),_0x693d30);this[_0x0430('0x3')](_0x0430('0x3f'),'no');this[_0x0430('0x3')]('avpf',null);this['setDataValue'](_0x0430('0x40'),null);this[_0x0430('0x3')](_0x0430('0x41'),null);this[_0x0430('0x3')](_0x0430('0x42'),null);this['setDataValue'](_0x0430('0x43'),null);this[_0x0430('0x3')]('dtlssetup',null);this[_0x0430('0x3')](_0x0430('0x44'),null);this[_0x0430('0x3')]('dtlsprivatekey',null);this[_0x0430('0x3')](_0x0430('0x45'),'no');break;case 0x2:this[_0x0430('0x3')](_0x0430('0x1e'),_0x0430('0x3e'));this[_0x0430('0x3')](_0x0430('0x3f'),_0x0430('0x26'));this[_0x0430('0x3')](_0x0430('0x46'),_0x0430('0x26'));this['setDataValue'](_0x0430('0x40'),_0x0430('0x26'));this[_0x0430('0x3')]('icesupport',_0x0430('0x26'));this[_0x0430('0x3')](_0x0430('0x42'),_0x0430('0x26'));this[_0x0430('0x3')](_0x0430('0x43'),'no');this[_0x0430('0x3')](_0x0430('0x47'),_0x0430('0x36'));this[_0x0430('0x3')](_0x0430('0x44'),_0x83683a[_0x0430('0x44')]||_0x0430('0x48'));this[_0x0430('0x3')](_0x0430('0x49'),_0x83683a[_0x0430('0x49')]||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0x0430('0x45'),_0x0430('0x26'));break;default:}}},'permissions':{'type':Sequelize[_0x0430('0x3a')],'set':function(_0x526673){this[_0x0430('0x3')]('permissions',_0x526673?_0x526673[_0x0430('0x1f')](','):[]);},'get':function(){return this[_0x0430('0x9')](_0x0430('0x4a'))?_[_0x0430('0x4b')](this['getDataValue'](_0x0430('0x4a'))['split'](','),function(_0x13197a){return parseInt(_0x13197a,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0430('0x1')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0430('0x1')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0430('0x1')]},'phoneBarUnconditional':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x0430('0x11')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0430('0x1')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x0430('0x11')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x0430('0x26'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x0430('0x14')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0430('0x1')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x0430('0x4c')],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this['getDataValue'](_0x0430('0x4d')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0430('0x1')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0430('0x1')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![],'set':function(_0x4f4abc){if(typeof _0x4f4abc==='string'){var _0x23ee1a=_0x4f4abc==='1'?!![]:_0x4f4abc==='0'?![]:_0x4f4abc===_0x0430('0x4e')?!![]:_0x4f4abc===_0x0430('0x4f')?![]:![];this[_0x0430('0x3')]('screenrecording',_0x23ee1a);}else{this[_0x0430('0x3')](_0x0430('0x50'),_0x4f4abc);}}},'blocked':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![],'set':function(_0x528ef3){this['setDataValue'](_0x0430('0x51'),_0x528ef3);if(_0x528ef3===!![]){this[_0x0430('0x3')](_0x0430('0x52'),moment());this[_0x0430('0x3')](_0x0430('0x53'),0x0);}else{this[_0x0430('0x3')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x0430('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0430('0x11')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x0430('0x14')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x0430('0x14')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x0430('0x11')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0430('0x14')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x0430('0x14')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xbecd=['icesupport','dtlsenable','dtlsverify','dtlsprivatekey','rtcp_mux','wss','avpf','dtlssetup','dtlscertfile','/etc/pki/tls/certs/motion.crt','permissions','map','phoneBarEnableScreenRecordingByAgent','true','false','screenrecording','blockedAt','loginAttempts','UNSIGNED','sequelize','util','lodash','STRING','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','getDataValue','toLowerCase','ENUM','admin','user','agent','telephone','local','internal','accountcode','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','dynamic','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','allow','ulaw;alaw;gsm','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','originate','uac','uas','certificate','passive','actpass','nonat','update,nonat','TEXT','get','isArray','encryption','force_avp'];(function(_0x398e12,_0xd5d86d){var _0x216143=function(_0xffa489){while(--_0xffa489){_0x398e12['push'](_0x398e12['shift']());}};_0x216143(++_0xd5d86d);}(_0xbecd,0x6a));var _0xdbec=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbecd[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xdbec('0x0'));var moment=require('moment');var util=require(_0xdbec('0x1'));var _=require(_0xdbec('0x2'));module['exports']={'name':{'type':Sequelize[_0xdbec('0x3')],'allowNull':![],'unique':_0xdbec('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x343f68){this[_0xdbec('0x5')](_0xdbec('0x4'),_0x343f68);this[_0xdbec('0x5')](_0xdbec('0x6'),_0x343f68);},'comment':_0xdbec('0x7')},'fullname':{'type':Sequelize[_0xdbec('0x3')],'allowNull':![],'set':function(_0x38cac4){this[_0xdbec('0x5')](_0xdbec('0x8'),_0x38cac4);this[_0xdbec('0x5')](_0xdbec('0x9'),util[_0xdbec('0xa')]('\x22%s\x22\x20<%s>',_0x38cac4,this[_0xdbec('0xb')]('internal')));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x19c62a){if(_0x19c62a){this[_0xdbec('0x5')]('email',_0x19c62a[_0xdbec('0xc')]());}}},'role':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0xe'),_0xdbec('0xf'),_0xdbec('0x10'),_0xdbec('0x11')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xdbec('0x3')],'defaultValue':_0xdbec('0x12')},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xdbec('0x13'),'set':function(_0x109dd7){this['setDataValue'](_0xdbec('0x13'),_0x109dd7);this['setDataValue'](_0xdbec('0x14'),_0x109dd7);this['setDataValue'](_0xdbec('0x9'),util['format']('\x22%s\x22\x20<%s>',this[_0xdbec('0xb')](_0xdbec('0x8')),_0x109dd7));}},'salt':{'type':Sequelize[_0xdbec('0x3')]},'phone':{'type':Sequelize[_0xdbec('0x3')]},'mobile':{'type':Sequelize[_0xdbec('0x3')]},'address':{'type':Sequelize[_0xdbec('0x3')]},'zipcode':{'type':Sequelize[_0xdbec('0x3')]},'userpic':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xdbec('0x3')]},'country':{'type':Sequelize[_0xdbec('0x3')]},'online':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xdbec('0x16')]},'voicePause':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0xdbec('0x17')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0xdbec('0x18')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xdbec('0x18')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'description':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![],'defaultValue':_0xdbec('0x19')},'ipaddr':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0xdbec('0x18')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x1a'),_0xdbec('0xf'),'peer'),'allowNull':!![],'defaultValue':_0xdbec('0x1a')},'context':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![],'defaultValue':_0xdbec('0x1b')},'callingpres':{'type':Sequelize['ENUM'](_0xdbec('0x1c'),'ALLOWED_PASSED_SCREEN',_0xdbec('0x1d'),'ALLOWED',_0xdbec('0x1e'),'PROHIB_PASSED_SCREEN',_0xdbec('0x1f'),_0xdbec('0x20')),'allowNull':!![]},'deny':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize['STRING'],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xdbec('0x21'),'set':function(_0x40c6d9){this[_0xdbec('0x5')](_0xdbec('0x22'),_0x40c6d9?_0x40c6d9['join'](','):null);},'get':function(){return this[_0xdbec('0xb')]('transport')?this[_0xdbec('0xb')](_0xdbec('0x22'))[_0xdbec('0x23')](','):null;},'comment':_0xdbec('0x24')},'dtmfmode':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x25'),'info',_0xdbec('0x26'),_0xdbec('0x27'),_0xdbec('0x28')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no','nonat',_0xdbec('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'nat':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![],'defaultValue':_0xdbec('0x2b'),'set':function(_0x4e0f96){this['setDataValue'](_0xdbec('0x2c'),_0x4e0f96?_0x4e0f96[_0xdbec('0x2d')](','):null);},'get':function(){return this['getDataValue'](_0xdbec('0x2c'))?this['getDataValue']('nat')[_0xdbec('0x23')](','):null;},'comment':_0xdbec('0x2e')},'callgroup':{'type':Sequelize[_0xdbec('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xdbec('0x3')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xdbec('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xdbec('0x3')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0xdbec('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x429a53){this[_0xdbec('0x5')](_0xdbec('0x2f'),_0x429a53?_0x429a53[_0xdbec('0x2d')](';'):_0xdbec('0x30'));},'get':function(){return this[_0xdbec('0xb')](_0xdbec('0x2f'))?this[_0xdbec('0xb')](_0xdbec('0x2f'))[_0xdbec('0x23')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x48a477){this['setDataValue']('insecure',_0x48a477?_0x48a477['join'](','):null);},'get':function(){return this[_0xdbec('0xb')](_0xdbec('0x31'))?this['getDataValue'](_0xdbec('0x31'))['split'](','):null;},'comment':_0xdbec('0x32')},'trustrpid':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no',_0xdbec('0x33')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xdbec('0x34')},'amaflags':{'type':Sequelize['STRING'],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xdbec('0xd')]('yes','no'),'allowNull':!![],'defaultValue':_0xdbec('0x29')},'busylevel':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xdbec('0xd')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize['STRING'],'allowNull':!![]},'template':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no',_0xdbec('0x35')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x36'),'refuse',_0xdbec('0x37')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x38'),'uas'),'allowNull':!![],'defaultValue':_0xdbec('0x39')},'t38pt_usertpsource':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize['STRING'],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no'),'allowNull':!![],'defaultValue':_0xdbec('0x29')},'keepalive':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xdbec('0xd')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no','fingerprint',_0xdbec('0x3a')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xdbec('0xd')]('active',_0xdbec('0x3b'),_0xdbec('0x3c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xdbec('0x18')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xdbec('0xd')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize['ENUM'](_0xdbec('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no',_0xdbec('0x3d'),_0xdbec('0x2a'),_0xdbec('0x3e')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xdbec('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0xdbec('0x16')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xdbec('0x3f')]},'showWebBar':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0,'set':function(_0x43d839){this[_0xdbec('0x5')]('showWebBar',_0x43d839);var _0xaea659=this[_0xdbec('0x40')]({'plain':!![]});switch(_0x43d839){case 0x0:case 0x1:var _0x2ff4b3=_0xaea659[_0xdbec('0x22')]?_[_0xdbec('0x41')](_0xaea659[_0xdbec('0x22')])?_0xaea659[_0xdbec('0x22')]['join']():_0xaea659['transport']:'udp';if(_0x2ff4b3==='wss'){_0x2ff4b3=_0xdbec('0x21');}this['setDataValue']('transport',_0x2ff4b3);this[_0xdbec('0x5')](_0xdbec('0x42'),'no');this[_0xdbec('0x5')]('avpf',null);this[_0xdbec('0x5')](_0xdbec('0x43'),null);this[_0xdbec('0x5')](_0xdbec('0x44'),null);this[_0xdbec('0x5')](_0xdbec('0x45'),null);this['setDataValue'](_0xdbec('0x46'),null);this[_0xdbec('0x5')]('dtlssetup',null);this[_0xdbec('0x5')]('dtlscertfile',null);this[_0xdbec('0x5')](_0xdbec('0x47'),null);this[_0xdbec('0x5')](_0xdbec('0x48'),'no');break;case 0x2:this[_0xdbec('0x5')](_0xdbec('0x22'),_0xdbec('0x49'));this[_0xdbec('0x5')](_0xdbec('0x42'),_0xdbec('0x29'));this['setDataValue'](_0xdbec('0x4a'),_0xdbec('0x29'));this[_0xdbec('0x5')](_0xdbec('0x43'),_0xdbec('0x29'));this[_0xdbec('0x5')](_0xdbec('0x44'),'yes');this[_0xdbec('0x5')](_0xdbec('0x45'),_0xdbec('0x29'));this[_0xdbec('0x5')](_0xdbec('0x46'),'no');this[_0xdbec('0x5')](_0xdbec('0x4b'),_0xdbec('0x3c'));this['setDataValue'](_0xdbec('0x4c'),_0xaea659[_0xdbec('0x4c')]||_0xdbec('0x4d'));this['setDataValue'](_0xdbec('0x47'),_0xaea659['dtlsprivatekey']||'/etc/pki/tls/private/motion.key');this['setDataValue'](_0xdbec('0x48'),_0xdbec('0x29'));break;default:}}},'permissions':{'type':Sequelize[_0xdbec('0x3f')],'set':function(_0x59d797){this[_0xdbec('0x5')](_0xdbec('0x4e'),_0x59d797?_0x59d797[_0xdbec('0x2d')](','):[]);},'get':function(){return this[_0xdbec('0xb')](_0xdbec('0x4e'))?_[_0xdbec('0x4f')](this[_0xdbec('0xb')](_0xdbec('0x4e'))[_0xdbec('0x23')](','),function(_0x22fef7){return parseInt(_0x22fef7,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xdbec('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xdbec('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0xdbec('0x3')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xdbec('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xdbec('0xd')](_0xdbec('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xdbec('0x3')]},'phoneBarEnableJaws':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xdbec('0xb')](_0xdbec('0x50'))?this['getDataValue']('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xdbec('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![],'set':function(_0x14d56b){if(typeof _0x14d56b==='string'){var _0x2554e2=_0x14d56b==='1'?!![]:_0x14d56b==='0'?![]:_0x14d56b===_0xdbec('0x51')?!![]:_0x14d56b===_0xdbec('0x52')?![]:![];this[_0xdbec('0x5')](_0xdbec('0x53'),_0x2554e2);}else{this[_0xdbec('0x5')](_0xdbec('0x53'),_0x14d56b);}}},'blocked':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':![],'set':function(_0x234346){this[_0xdbec('0x5')]('blocked',_0x234346);if(_0x234346===!![]){this['setDataValue'](_0xdbec('0x54'),moment());this['setDataValue'](_0xdbec('0x55'),0x0);}else{this[_0xdbec('0x5')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0xdbec('0x16')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xdbec('0x18')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xdbec('0x18')](0x5)[_0xdbec('0x56')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xdbec('0x15')],'defaultValue':!![]}};
\ No newline at end of file
index 35f286a..f02fff2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb016=['attributes','findAll','rows','true','length','chat','dataValues','push','fax','mail','openchannel','all','model','keys','filters','intersection','fields','options','openTabs','sms','whatsapp','body','params','describe','addContacts','omit','ids','internal','Setting','findById','securePassword','max','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','SELECT','from','voicemail','mailbox','VoiceMail','fullname','email','agent','permissions','101','102','103','106','100','114','115','create','Unauthorized','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','settingsEnabled','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','each','autoAssociation','compact','changePassword','oldPassword','Sequelize','authenticate','ValidationError','newPassword','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','findOne','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','previousPasswords','updatePasswordsHistory','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','spread','QueueId','voice','VoiceQueue','format','SIP/%s','removeQueues','remove','isArray','emit','Queue:remove','UserVoiceQueueRt','userpic','file','filename','join','root','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','createdAt','MailOpenTabs','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','CmContact','sort','pick','merge','hasOwnProperty','CmList','Tags','color','tag','nolimit','getContacts','order','Queue','Queues','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','OpenchannelInteraction','getOpenchannelInteractions','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','WhatsappInteraction','getWhatsappInteractions','login','phone','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','connection','socket','remoteAddress','getVoiceQueues','UserVoiceQueue.penalty','upsert','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','device','PAUSE','LOGININPAUSE','bulkCreate','resolve','logout','pause','QueuePause','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','whatsapppause','pauseType','lastPauseAt','manual','%s%s','getTeams','Team','addTeams','setDataValue','Voice','Chat','getMailQueues','Mail','getSmsQueues','getWhatsappQueues','Whatsapp','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','penalty','Queue:save','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','getChatQueues','Sms','Fax','removeAgent','getLists','getAgents','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','user_has_fax_interactions:remove','addSmsInteractions','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','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','concat','$and','$or','$gt','$gte','$lt','$ne','$eq','$not','$between','$notBetween','$in','$like','$notLike','$iLike','$notILike','$contains','$contained','$any','firstName','lastName','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','nonce','removeApiKey','apiKeyIat','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','isEmpty','lower','col','toString','asc','desc','substring','uniqBy','orderBy','request','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','http','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','voiceStatus','busy','slice','select','ui.','InteractionId','field','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','bluebird','lodash','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','socket.io-emitter','redis','defaults','localhost','client','then','info','User,\x20%s,\x20%s','debug','error','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','get','admin','Users','user','Agents','Telephones','telephone','map','value','includes','role','find','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','filter','password','where','User','query','includeAll','include'];(function(_0x3818c0,_0x542521){var _0x55ec33=function(_0x2be9ea){while(--_0x2be9ea){_0x3818c0['push'](_0x3818c0['shift']());}};_0x55ec33(++_0x542521);}(_0xb016,0x159));var _0x6b01=function(_0x27b2a2,_0x217afb){_0x27b2a2=_0x27b2a2-0x0;var _0x169023=_0xb016[_0x27b2a2];return _0x169023;};'use strict';var moment=require(_0x6b01('0x0'));var BPromise=require(_0x6b01('0x1'));var util=require('util');var path=require('path');var fs=require('fs');var _=require(_0x6b01('0x2'));var squel=require('squel');var jayson=require(_0x6b01('0x3'));var Redis=require(_0x6b01('0x4'));var authService=require(_0x6b01('0x5'));var qs=require(_0x6b01('0x6'));var logger=require('../../config/logger')(_0x6b01('0x7'));var utils=require(_0x6b01('0x8'));var config=require(_0x6b01('0x9'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var socket=require(_0x6b01('0xa'))(new Redis(config[_0x6b01('0xb')]));require('./user.socket')['register'](socket);config[_0x6b01('0xb')]=_[_0x6b01('0xc')](config[_0x6b01('0xb')],{'host':_0x6b01('0xd'),'port':0x18eb});var client=jayson[_0x6b01('0xe')]['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x4b4a4d,_0x4627ef,_0x24049f,_0x2660c7){return new BPromise(function(_0x5a8817,_0x200614){var _0x5c54e4=_0x2660c7||client;return _0x5c54e4['request'](_0x4b4a4d,_0x24049f)[_0x6b01('0xf')](function(_0x4fa826){logger[_0x6b01('0x10')](_0x6b01('0x11'),_0x4627ef,'request\x20sent');logger[_0x6b01('0x12')]('User,\x20%s,\x20%s,\x20%s',_0x4627ef,'request\x20sent',JSON['stringify'](_0x4fa826));if(_0x4fa826[_0x6b01('0x13')]){if(_0x4fa826['error']['code']===0x1f4){logger[_0x6b01('0x13')](_0x6b01('0x11'),_0x4627ef,_0x4fa826[_0x6b01('0x13')][_0x6b01('0x14')]);return _0x200614(_0x4fa826[_0x6b01('0x13')][_0x6b01('0x14')]);}logger[_0x6b01('0x13')](_0x6b01('0x11'),_0x4627ef,_0x4fa826[_0x6b01('0x13')][_0x6b01('0x14')]);return _0x5a8817(_0x4fa826[_0x6b01('0x13')]['message']);}else{logger[_0x6b01('0x10')](_0x6b01('0x11'),_0x4627ef,_0x6b01('0x15'));_0x5a8817(_0x4fa826[_0x6b01('0x16')][_0x6b01('0x14')]);}})[_0x6b01('0x17')](function(_0x33753f){logger[_0x6b01('0x13')]('User,\x20%s,\x20%s',_0x4627ef,_0x33753f);_0x200614(_0x33753f);});});}function respondWithStatusCode(_0x3029e2,_0xc1f453){_0xc1f453=_0xc1f453||0xcc;return function(_0x424cd3){if(_0x424cd3){return _0x3029e2[_0x6b01('0x18')](_0xc1f453);}return _0x3029e2[_0x6b01('0x19')](_0xc1f453)[_0x6b01('0x1a')]();};}function respondWithResult(_0x2cea6e,_0x542fab){_0x542fab=_0x542fab||0xc8;return function(_0x7caa07){if(_0x7caa07){return _0x2cea6e[_0x6b01('0x19')](_0x542fab)[_0x6b01('0x1b')](_0x7caa07);}};}function respondWithFilteredResult(_0x51243c,_0x399808){return function(_0x70a1c0){if(_0x70a1c0){var _0x304393=typeof _0x399808[_0x6b01('0x1c')]===_0x6b01('0x1d')&&typeof _0x399808[_0x6b01('0x1e')]===_0x6b01('0x1d');var _0x136452=_0x70a1c0[_0x6b01('0x1f')];var _0x152dda=_0x304393?0x0:_0x399808[_0x6b01('0x1c')];var _0xa846d8=_0x304393?_0x70a1c0[_0x6b01('0x1f')]:_0x399808['offset']+_0x399808[_0x6b01('0x1e')];var _0x220efb;if(_0xa846d8>=_0x136452){_0xa846d8=_0x136452;_0x220efb=0xc8;}else{_0x220efb=0xce;}_0x51243c[_0x6b01('0x19')](_0x220efb);return _0x51243c[_0x6b01('0x20')](_0x6b01('0x21'),_0x152dda+'-'+_0xa846d8+'/'+_0x136452)['json'](_0x70a1c0);}return null;};}function saveUpdates(_0x54f030){return function(_0x3fae61){if(_0x3fae61){return _0x3fae61[_0x6b01('0x22')](_0x54f030)[_0x6b01('0xf')](function(_0x8883d1){return _0x8883d1;});}return null;};}function removeEntity(_0x2a894e){return function(_0x25d38d){if(_0x25d38d){return _0x25d38d['destroy']()[_0x6b01('0xf')](function(){var _0x5482a8=_0x25d38d[_0x6b01('0x23')]({'plain':!![]});if(_0x5482a8['role']===_0x6b01('0x24'))return;var _0xa6b2b6=[{'name':_0x6b01('0x25'),'value':_0x6b01('0x26'),'ignore':!![]},{'name':_0x6b01('0x27'),'value':'agent','ignore':![]},{'name':_0x6b01('0x28'),'value':_0x6b01('0x29'),'ignore':![]}];var _0x3bb4b1=_(_0xa6b2b6)['filter']('ignore')[_0x6b01('0x2a')]('value')[_0x6b01('0x2b')]();if(_[_0x6b01('0x2c')](_0x3bb4b1,_0x5482a8[_0x6b01('0x2d')])){return;}var _0x536641=_[_0x6b01('0x2e')](_0xa6b2b6,[_0x6b01('0x2b'),_0x5482a8[_0x6b01('0x2d')]])['name'];return db[_0x6b01('0x2f')][_0x6b01('0x30')]({'where':{'type':_0x536641,'resourceId':_0x5482a8['id']}})[_0x6b01('0xf')](function(){return _0x25d38d;});})[_0x6b01('0xf')](function(){_0x2a894e[_0x6b01('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa041ea){return function(_0x20ee6d){if(!_0x20ee6d){_0xa041ea[_0x6b01('0x18')](0x194);}return _0x20ee6d;};}function handleError(_0x5269c7,_0xce4545){_0xce4545=_0xce4545||0x1f4;return function(_0xc644f2){logger[_0x6b01('0x13')](_0xc644f2[_0x6b01('0x31')]);if(_0xc644f2['name']){delete _0xc644f2[_0x6b01('0x32')];}_0x5269c7['status'](_0xce4545)[_0x6b01('0x33')](_0xc644f2);};}exports[_0x6b01('0x34')]=function(_0x1baac5,_0x318b8b){var _0x167d08={},_0x457c93={'count':0x0,'rows':[]};var _0x3df1d8=_(db['User'][_0x6b01('0x35')])[_0x6b01('0x2a')](function(_0x2c3385){return{'name':_0x2c3385[_0x6b01('0x36')],'type':_0x2c3385[_0x6b01('0x37')][_0x6b01('0x38')]};})[_0x6b01('0x39')](function(_0x44bf46){return!_['includes']([_0x6b01('0x3a'),'salt'],_0x44bf46[_0x6b01('0x32')]);})[_0x6b01('0x2b')]();_0x167d08=qs['getOptions'](_0x3df1d8,_0x1baac5);var _0x37ae5d={'where':_0x167d08[_0x6b01('0x3b')]};return db[_0x6b01('0x3c')][_0x6b01('0x1f')](_0x37ae5d)[_0x6b01('0xf')](function(_0x33a9ea){_0x457c93[_0x6b01('0x1f')]=_0x33a9ea;if(_0x1baac5[_0x6b01('0x3d')][_0x6b01('0x3e')]){_0x167d08[_0x6b01('0x3f')]=[{'all':!![]}];}if(!_['includes'](_0x167d08[_0x6b01('0x40')],'id')){_0x167d08[_0x6b01('0x40')]['push']('id');}return db['User'][_0x6b01('0x41')](_0x167d08);})[_0x6b01('0xf')](function(_0x558ec1){_0x457c93[_0x6b01('0x42')]=_0x558ec1;if(_0x1baac5[_0x6b01('0x3d')]['openTabs']===_0x6b01('0x43')){var _0x5e6f28=[];for(var _0x2ab117=0x0;_0x2ab117<_0x457c93[_0x6b01('0x42')][_0x6b01('0x44')];_0x2ab117++){_0x5e6f28['push'](get_open_tabs(_0x6b01('0x45'),_0x457c93[_0x6b01('0x42')][_0x2ab117]['dataValues']));_0x5e6f28['push'](get_open_tabs('sms',_0x457c93[_0x6b01('0x42')][_0x2ab117][_0x6b01('0x46')]));_0x5e6f28[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x48'),_0x457c93[_0x6b01('0x42')][_0x2ab117][_0x6b01('0x46')]));_0x5e6f28['push'](get_open_tabs(_0x6b01('0x49'),_0x457c93[_0x6b01('0x42')][_0x2ab117][_0x6b01('0x46')]));_0x5e6f28[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x4a'),_0x457c93[_0x6b01('0x42')][_0x2ab117]['dataValues']));_0x5e6f28[_0x6b01('0x47')](get_open_tabs('whatsapp',_0x457c93['rows'][_0x2ab117][_0x6b01('0x46')]));}return BPromise[_0x6b01('0x4b')](_0x5e6f28)['then'](function(_0x408bb0){return _0x457c93;});}else{return _0x457c93;}})[_0x6b01('0xf')](respondWithFilteredResult(_0x318b8b,_0x167d08))[_0x6b01('0x17')](handleError(_0x318b8b,null));};exports['show']=function(_0x51eec0,_0x5545f6){var _0x24b860={'raw':![],'where':{'id':_0x51eec0['params']['id']}},_0x12160f={};_0x12160f[_0x6b01('0x4c')]=_['differenceBy'](_['keys'](db['User'][_0x6b01('0x35')]),[_0x6b01('0x3a'),'salt']);_0x12160f['query']=_[_0x6b01('0x4d')](_0x51eec0['query']);_0x12160f[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0x12160f[_0x6b01('0x4c')],_0x12160f[_0x6b01('0x3d')]);_0x24b860[_0x6b01('0x40')]=_['intersection'](_0x12160f[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x51eec0[_0x6b01('0x3d')]['fields']));_0x24b860[_0x6b01('0x40')]=_0x24b860[_0x6b01('0x40')]['length']?_0x24b860[_0x6b01('0x40')]:_0x12160f[_0x6b01('0x4c')];if(_0x51eec0[_0x6b01('0x3d')][_0x6b01('0x3e')]){_0x24b860['include']=[{'all':!![]}];}_0x24b860=_['merge']({},_0x24b860,_0x51eec0[_0x6b01('0x51')]);if(!_['includes'](_0x24b860['attributes'],'id')){_0x24b860[_0x6b01('0x40')][_0x6b01('0x47')]('id');}return db['User'][_0x6b01('0x2e')](_0x24b860)[_0x6b01('0xf')](handleEntityNotFound(_0x5545f6,null))['then'](function(_0x1bd851){var _0x1ce46d=[];values=_0x1bd851;if(_0x51eec0[_0x6b01('0x3d')][_0x6b01('0x52')]===_0x6b01('0x43')){_0x1ce46d['push'](get_open_tabs(_0x6b01('0x45'),_0x1bd851['dataValues']));_0x1ce46d[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x53'),_0x1bd851[_0x6b01('0x46')]));_0x1ce46d['push'](get_open_tabs(_0x6b01('0x4a'),_0x1bd851[_0x6b01('0x46')]));_0x1ce46d[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x54'),_0x1bd851['dataValues']));_0x1ce46d[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x48'),_0x1bd851[_0x6b01('0x46')]));_0x1ce46d['push'](get_open_tabs('mail',_0x1bd851[_0x6b01('0x46')]));return BPromise[_0x6b01('0x4b')](_0x1ce46d);}else{return values;}})[_0x6b01('0xf')](function(_0x4e1702){return values;})[_0x6b01('0xf')](respondWithResult(_0x5545f6,null))[_0x6b01('0x17')](handleError(_0x5545f6,null));};exports[_0x6b01('0x22')]=function(_0x5459d5,_0x54b3ae){if(_0x5459d5[_0x6b01('0x55')]['id']){delete _0x5459d5[_0x6b01('0x55')]['id'];}delete _0x5459d5['body'][_0x6b01('0x2d')];return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x5459d5[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x54b3ae,null))[_0x6b01('0xf')](saveUpdates(_0x5459d5[_0x6b01('0x55')],null))[_0x6b01('0xf')](respondWithResult(_0x54b3ae,null))[_0x6b01('0x17')](handleError(_0x54b3ae,null));};exports['describe']=function(_0x2aa892,_0x204a9a){return db[_0x6b01('0x3c')][_0x6b01('0x57')]()[_0x6b01('0xf')](respondWithResult(_0x204a9a,null))[_0x6b01('0x17')](handleError(_0x204a9a,null));};exports[_0x6b01('0x58')]=function(_0x289294,_0x281e55){return db['User'][_0x6b01('0x2e')]({'where':{'id':_0x289294[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x281e55,null))[_0x6b01('0xf')](function(_0xef971f){if(_0xef971f){return _0xef971f[_0x6b01('0x58')](_0x289294['body']['ids'],_[_0x6b01('0x59')](_0x289294[_0x6b01('0x55')],[_0x6b01('0x5a'),'id'])||{});}})[_0x6b01('0xf')](respondWithResult(_0x281e55,null))[_0x6b01('0x17')](handleError(_0x281e55,null));};function validateUser(_0x41e8dc){return new BPromise(function(_0x59bf90,_0x2bd87d){if(_0x41e8dc[_0x6b01('0x5b')])return _0x59bf90(_0x41e8dc);return db[_0x6b01('0x5c')][_0x6b01('0x5d')](0x1)[_0x6b01('0xf')](function(_0xf31bfa){if(_0xf31bfa[_0x6b01('0x5e')])authService['validatePasswordPattern'](_0x41e8dc[_0x6b01('0x3a')]);db['User'][_0x6b01('0x5f')](_0x6b01('0x5b'))[_0x6b01('0xf')](function(_0x48bfcd){if(_[_0x6b01('0x60')](_0x48bfcd)){_0x41e8dc[_0x6b01('0x5b')]=_0xf31bfa[_0x6b01('0x61')]||0x1;return;}if(_[_0x6b01('0x60')](_0xf31bfa[_0x6b01('0x61')])||_0xf31bfa[_0x6b01('0x61')]===_0x48bfcd){_0x41e8dc[_0x6b01('0x5b')]=_0x48bfcd+0x1;return;}if(_0xf31bfa[_0x6b01('0x61')]>_0x48bfcd){_0x41e8dc[_0x6b01('0x5b')]=_0xf31bfa[_0x6b01('0x61')];return;}return db[_0x6b01('0x62')][_0x6b01('0x3d')](_0x6b01('0x63'),{'type':db[_0x6b01('0x62')][_0x6b01('0x64')][_0x6b01('0x65')]})[_0x6b01('0xf')](function(_0x3f077f){if(_0x3f077f&&_0x3f077f[_0x6b01('0x44')]){for(var _0x4a8fcb=0x0,_0x27526f=_0x3f077f[_0x6b01('0x44')];_0x4a8fcb<_0x27526f&&_[_0x6b01('0x60')](_0x41e8dc[_0x6b01('0x5b')]);_0x4a8fcb++){if(_0xf31bfa[_0x6b01('0x61')]<=_0x3f077f[_0x4a8fcb][_0x6b01('0x66')]){_0x41e8dc[_0x6b01('0x5b')]=_0x3f077f[_0x4a8fcb][_0x6b01('0x66')];}else if(_0xf31bfa[_0x6b01('0x61')]>_0x3f077f[_0x4a8fcb][_0x6b01('0x66')]&&_0xf31bfa[_0x6b01('0x61')]<=_0x3f077f[_0x4a8fcb]['to']){_0x41e8dc[_0x6b01('0x5b')]=_0xf31bfa[_0x6b01('0x61')];}}}if(_[_0x6b01('0x60')](_0x41e8dc[_0x6b01('0x5b')])){_0x41e8dc['internal']=_0x48bfcd+0x1;}return _0x59bf90(_0x41e8dc);});});})[_0x6b01('0x17')](function(_0x2d42ec){_0x2bd87d(_0x2d42ec);});});}function updateUser(_0x19a6d9){return new BPromise(function(_0x3ec668,_0x191348){try{if(_0x19a6d9[_0x6b01('0x67')]){_0x19a6d9[_0x6b01('0x68')]=_0x19a6d9[_0x6b01('0x5b')];_0x19a6d9[_0x6b01('0x69')]={'mailbox':_0x19a6d9[_0x6b01('0x5b')],'password':_0x19a6d9[_0x6b01('0x3a')],'fullname':_0x19a6d9[_0x6b01('0x6a')],'email':_0x19a6d9[_0x6b01('0x6b')]};}if(_0x19a6d9[_0x6b01('0x2d')]===_0x6b01('0x6c')){if(!_0x19a6d9[_0x6b01('0x6d')])_0x19a6d9[_0x6b01('0x6d')]=[_0x6b01('0x6e'),_0x6b01('0x6f'),_0x6b01('0x70'),'113','110','104','105',_0x6b01('0x71'),'107','108','109',_0x6b01('0x72'),'111',_0x6b01('0x73'),_0x6b01('0x74')];}_0x3ec668(_0x19a6d9);}catch(_0x44ac98){_0x191348(_0x44ac98);}});}exports[_0x6b01('0x75')]=function(_0x3bd5d3,_0x59f807){if(_0x3bd5d3['user'][_0x6b01('0x2d')]===_0x6b01('0x6c'))throw new Error(_0x6b01('0x76'));if(_0x3bd5d3['body'][_0x6b01('0x2d')]===_0x6b01('0x26')&&_0x3bd5d3[_0x6b01('0x26')][_0x6b01('0x2d')]!==_0x6b01('0x24')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x3bd5d3[_0x6b01('0x55')]['role']===_0x6b01('0x24')&&_0x3bd5d3[_0x6b01('0x26')][_0x6b01('0x2d')]!==_0x6b01('0x24')){throw new Error(_0x6b01('0x77'));}return licenseUtil['checkUserLimits']([_0x3bd5d3[_0x6b01('0x55')]])[_0x6b01('0xf')](function(){return validateUser(_0x3bd5d3[_0x6b01('0x55')]);})[_0x6b01('0xf')](function(_0x4dbd69){return updateUser(_0x4dbd69)[_0x6b01('0xf')](function(_0x27c738){if(_0x27c738[_0x6b01('0x2d')]===_0x6b01('0x24')){_0x27c738[_0x6b01('0x78')]=_0x3bd5d3[_0x6b01('0x26')]['settingsEnabled'];delete _0x27c738['userProfileId'];}return _0x27c738;});})['then'](function(_0x16fa3b){return db[_0x6b01('0x3c')]['create'](_0x16fa3b,{'include':[{'model':db[_0x6b01('0x69')],'as':_0x6b01('0x69')}]});})[_0x6b01('0xf')](function(_0x2c2c1c){if(_0x3bd5d3['body'][_0x6b01('0x2d')]==='user')return _0x2c2c1c;if(_0x3bd5d3[_0x6b01('0x26')]['role']!==_0x6b01('0x26'))return _0x2c2c1c;return db['UserProfileSection'][_0x6b01('0x2e')]({'where':{'name':_0x2c2c1c[_0x6b01('0x2d')]===_0x6b01('0x6c')?_0x6b01('0x27'):_0x6b01('0x28'),'userProfileId':_0x3bd5d3[_0x6b01('0x26')][_0x6b01('0x79')]},'raw':!![]})['then'](function(_0xc8f10){if(!_0xc8f10||_0xc8f10['autoAssociation']!=0x0)return _0x2c2c1c;return db[_0x6b01('0x2f')][_0x6b01('0x75')]({'name':_0x2c2c1c[_0x6b01('0x32')],'resourceId':_0x2c2c1c['id'],'type':_0xc8f10[_0x6b01('0x32')],'sectionId':_0xc8f10['id']},{})[_0x6b01('0xf')](function(){return _0x2c2c1c;});})[_0x6b01('0x17')](function(_0x30ac0c){logger[_0x6b01('0x13')](_0x6b01('0x7a'),_0x30ac0c);throw _0x30ac0c;});})[_0x6b01('0xf')](respondWithResult(_0x59f807,0xc9))[_0x6b01('0x17')](handleError(_0x59f807,null));};exports['bulkCreate']=function(_0x1e9300,_0x4091a8){var _0x197c8d=_0x1e9300[_0x6b01('0x55')];var _0x5ac0b6=[];if(_0x1e9300[_0x6b01('0x26')][_0x6b01('0x2d')]===_0x6b01('0x6c'))throw new Error(_0x6b01('0x76'));if(_[_0x6b01('0x7b')](_0x197c8d,['role',_0x6b01('0x26')])&&_0x1e9300['user'][_0x6b01('0x2d')]!==_0x6b01('0x24')){throw new Error(_0x6b01('0x7c'));}if(_[_0x6b01('0x7b')](_0x197c8d,[_0x6b01('0x2d'),_0x6b01('0x24')])&&_0x1e9300[_0x6b01('0x26')][_0x6b01('0x2d')]!==_0x6b01('0x24')){throw new Error(_0x6b01('0x7d'));}return licenseUtil[_0x6b01('0x7e')](_0x197c8d)[_0x6b01('0xf')](function(){return validateUser(_0x197c8d[0x0]);})[_0x6b01('0xf')](function(){for(var _0x748219=0x1;_0x748219<_0x197c8d['length'];_0x748219++){var _0x2f180=_0x197c8d[_0x748219-0x1]['internal'];if(!_0x197c8d[_0x748219]['internal'])_0x197c8d[_0x748219][_0x6b01('0x5b')]=_0x2f180+0x1;_0x5ac0b6[_0x6b01('0x47')](validateUser(_0x197c8d[_0x748219]));}return BPromise[_0x6b01('0x4b')](_0x5ac0b6);})[_0x6b01('0xf')](function(){_0x5ac0b6=[];for(var _0x5dc77c=0x0;_0x5dc77c<_0x197c8d[_0x6b01('0x44')];_0x5dc77c++){_0x5ac0b6[_0x6b01('0x47')](updateUser(_0x197c8d[_0x5dc77c]));}return BPromise[_0x6b01('0x4b')](_0x5ac0b6);})['then'](function(){return BPromise[_0x6b01('0x7f')](_0x197c8d,function(_0x327f31){return db[_0x6b01('0x3c')][_0x6b01('0x75')](_0x327f31,{'include':[{'model':db[_0x6b01('0x69')],'as':_0x6b01('0x69')}]})[_0x6b01('0xf')](function(_0x21b294){_0x327f31['id']=_0x21b294['id'];return _0x327f31;});});})['then'](function(_0x135aeb){if(_0x1e9300[_0x6b01('0x55')][_0x6b01('0x2d')]===_0x6b01('0x26'))return _0x135aeb;if(_0x1e9300['user']['role']!==_0x6b01('0x26'))return _0x135aeb;var _0x191fc0=_[_0x6b01('0x7b')](_0x135aeb,function(_0xcd8de3){return _0xcd8de3[_0x6b01('0x2d')]===_0x6b01('0x6c')||_0xcd8de3[_0x6b01('0x2d')]===_0x6b01('0x29');});if(!_0x191fc0)return _0x135aeb;return db['UserProfileSection'][_0x6b01('0x41')]({'where':{'name':{'$or':[_0x6b01('0x27'),_0x6b01('0x28')]},'userProfileId':_0x1e9300[_0x6b01('0x26')][_0x6b01('0x79')]},'raw':!![]})[_0x6b01('0xf')](function(_0x188010){if(_['isEmpty'](_0x188010)||!_[_0x6b01('0x7b')](_0x188010,['autoAssociation',0x0]))return _0x135aeb;_0x5ac0b6=[];var _0xe9de3b=_(_0x188010)[_0x6b01('0x2a')](function(_0x16f234){if(_0x16f234[_0x6b01('0x80')]===0x1)return;return _0x16f234[_0x6b01('0x32')]==='Agents'?_0x6b01('0x6c'):'telephone';})[_0x6b01('0x81')]()[_0x6b01('0x2b')]();for(var _0x59141e=0x0;_0x59141e<_0x135aeb[_0x6b01('0x44')];_0x59141e++){if(!_[_0x6b01('0x2c')](_0xe9de3b,_0x135aeb[_0x59141e][_0x6b01('0x2d')]))return;var _0x2cc3eb=_0x135aeb[_0x59141e][_0x6b01('0x2d')]==='agent'?'Agents':_0x6b01('0x28');_0x5ac0b6[_0x6b01('0x47')](db[_0x6b01('0x2f')][_0x6b01('0x75')]({'name':_0x135aeb[_0x59141e][_0x6b01('0x32')],'resourceId':_0x135aeb[_0x59141e]['id'],'type':_0x2cc3eb,'sectionId':_[_0x6b01('0x2e')](_0x188010,[_0x6b01('0x32'),_0x2cc3eb])['id']},{}));}return BPromise[_0x6b01('0x4b')](_0x5ac0b6);});})[_0x6b01('0xf')](respondWithResult(_0x4091a8,0xc9))['catch'](handleError(_0x4091a8,null));};exports[_0x6b01('0x82')]=function(_0x5ee5ed,_0x7ac756){if(_0x5ee5ed['body']['id']){delete _0x5ee5ed[_0x6b01('0x55')]['id'];}return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x5ee5ed['params']['id']}})[_0x6b01('0xf')](function(_0xa9cd5f){if(!_0xa9cd5f)return null;if(_0xa9cd5f['id']===_0x5ee5ed[_0x6b01('0x26')]['id']){if(!_0x5ee5ed['body'][_0x6b01('0x83')]||!_0x5ee5ed[_0x6b01('0x55')]['newPassword']){throw new db[(_0x6b01('0x84'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0xa9cd5f[_0x6b01('0x85')](_0x5ee5ed[_0x6b01('0x55')]['oldPassword'])){throw new db['Sequelize'][(_0x6b01('0x86'))]('Wrong\x20credentials');}if(_0x5ee5ed['body'][_0x6b01('0x83')]===_0x5ee5ed['body'][_0x6b01('0x87')]){throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))](_0x6b01('0x88'));}}else if(_0x5ee5ed[_0x6b01('0x26')][_0x6b01('0x2d')]===_0x6b01('0x24')){if(!_0x5ee5ed[_0x6b01('0x55')][_0x6b01('0x87')]){throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))](_0x6b01('0x89'));}}else if(_0x5ee5ed[_0x6b01('0x26')][_0x6b01('0x2d')]===_0x6b01('0x26')){if(!_0x5ee5ed[_0x6b01('0x55')][_0x6b01('0x87')]){throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))](_0x6b01('0x89'));}if(_0xa9cd5f[_0x6b01('0x2d')]!=='agent'){throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))](_0x6b01('0x76'));}}else{throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))](_0x6b01('0x76'));}return _0xa9cd5f;})[_0x6b01('0xf')](handleEntityNotFound(_0x7ac756,null))[_0x6b01('0xf')](function(_0x5736fe){return db[_0x6b01('0x5c')][_0x6b01('0x8a')]({'attributes':['id','securePassword',_0x6b01('0x8b'),_0x6b01('0x8c')]})[_0x6b01('0xf')](function(_0x51f42e){if(_0x51f42e[_0x6b01('0x5e')])authService[_0x6b01('0x8d')](_0x5ee5ed[_0x6b01('0x55')][_0x6b01('0x87')]);if(!_0x51f42e['enforcePasswordHistory']||!_0x5736fe['previousPasswords'])return _0x5736fe;authService[_0x6b01('0x8e')](_0x5ee5ed[_0x6b01('0x55')]['newPassword'],_0x5736fe[_0x6b01('0x8f')],_0x51f42e[_0x6b01('0x8c')]);return _0x5736fe;})[_0x6b01('0xf')](saveUpdates({'password':_0x5ee5ed[_0x6b01('0x55')][_0x6b01('0x87')],'passwordResetAt':_0x5ee5ed[_0x6b01('0x26')]['id']==_0x5ee5ed['params']['id']?moment():null,'previousPasswords':authService[_0x6b01('0x90')](_0x5ee5ed[_0x6b01('0x55')][_0x6b01('0x87')],_0x5736fe[_0x6b01('0x8f')])},null));})[_0x6b01('0xf')](respondWithResult(_0x7ac756,null))[_0x6b01('0x17')](handleError(_0x7ac756,null));};exports['addQueues']=function(_0x471015,_0x3db037){var _0x59cdd1=_0x471015[_0x6b01('0x55')][_0x6b01('0x91')];return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x471015[_0x6b01('0x56')]['id']},'attributes':['id','name',_0x6b01('0x2d'),_0x6b01('0x92'),_0x6b01('0x93'),_0x6b01('0x94'),_0x6b01('0x95')]})[_0x6b01('0xf')](handleEntityNotFound(_0x3db037,null))[_0x6b01('0xf')](function(_0x19167c){if(_0x19167c){if(!utils[_0x6b01('0x96')](_0x59cdd1)){throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))](_0x6b01('0x97'));}return _0x19167c[_0x6b01('0x98')+_[_0x6b01('0x99')](_0x59cdd1[_0x6b01('0x9a')]())+'Queues'](_0x471015[_0x6b01('0x55')][_0x6b01('0x5a')],{'penalty':_0x471015[_0x6b01('0x55')]['penalty']||0x0})[_0x6b01('0x9b')](function(_0x2877ea){for(var _0x424865=0x0;_0x424865<_0x471015[_0x6b01('0x55')][_0x6b01('0x5a')][_0x6b01('0x44')];_0x424865+=0x1){var _0x4ade00={'UserId':Number(_0x471015['params']['id'])};_0x4ade00[_['capitalize'](_0x59cdd1['toLowerCase']())+_0x6b01('0x9c')]=Number(_0x471015[_0x6b01('0x55')][_0x6b01('0x5a')][_0x424865]);socket['emit'](_0x6b01('0x26')+_['capitalize'](_0x59cdd1[_0x6b01('0x9a')]())+'Queue:save',_0x4ade00);}return _0x2877ea;})[_0x6b01('0xf')](function(){if(_0x59cdd1===_0x6b01('0x9d')){return db[_0x6b01('0x9e')][_0x6b01('0x41')]({'where':{'id':_0x471015[_0x6b01('0x55')][_0x6b01('0x5a')]||[]},'raw':!![],'attributes':['id',_0x6b01('0x32')]});}})[_0x6b01('0xf')](function(_0x353f84){var _0x4ad87a=_0x19167c['get']({'plain':!![]});var _0x40aaaa=[];if(_0x59cdd1===_0x6b01('0x9d')&&_0x4ad87a[_0x6b01('0x2d')]==='agent'&&_0x4ad87a['online']){for(var _0x446b91=0x0;_0x446b91<_0x353f84['length'];_0x446b91+=0x1){_0x40aaaa[_0x6b01('0x47')]({'membername':_0x4ad87a[_0x6b01('0x32')],'UserId':_0x4ad87a['id'],'queue_name':_0x353f84[_0x446b91][_0x6b01('0x32')],'VoiceQueueId':_0x353f84[_0x446b91]['id'],'interface':_[_0x6b01('0x60')](_0x4ad87a[_0x6b01('0x95')])?util[_0x6b01('0x9f')](_0x6b01('0xa0'),_0x4ad87a[_0x6b01('0x32')]):_0x4ad87a[_0x6b01('0x95')],'paused':_0x4ad87a[_0x6b01('0x94')]||![],'penalty':_0x471015[_0x6b01('0x55')]['penalty']||0x0});}return BPromise[_0x6b01('0x7f')](_0x40aaaa,function(_0x52d6b4){return db['UserVoiceQueueRt']['upsert'](_0x52d6b4);});}return _0x19167c;});}})[_0x6b01('0xf')](respondWithStatusCode(_0x3db037,null))['catch'](handleError(_0x3db037,null));};exports[_0x6b01('0xa1')]=function(_0x33b13f,_0x3a8609){var _0x26aa9b;return db[_0x6b01('0x3c')]['find']({'where':{'id':_0x33b13f[_0x6b01('0x56')]['id']},'attributes':['id',_0x6b01('0x32'),_0x6b01('0x2d')]})[_0x6b01('0xf')](handleEntityNotFound(_0x3a8609,null))[_0x6b01('0xf')](function(_0x14df77){if(_0x14df77){_0x26aa9b=_0x14df77;if(!_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x91')]||!utils[_0x6b01('0x96')](_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x91')])){throw new db['Sequelize'][(_0x6b01('0x86'))]('Unknown\x20channel');}return _0x14df77[_0x6b01('0xa2')+_['capitalize'](_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x91')]['toLowerCase']())+'Queues'](_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x5a')]);}})['then'](function(_0x34adde){if(_[_0x6b01('0xa3')](_0x33b13f[_0x6b01('0x3d')]['ids'])){for(var _0x5a7af0=0x0;_0x5a7af0<_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x5a')][_0x6b01('0x44')];_0x5a7af0+=0x1){var _0x293fc0={'UserId':Number(_0x33b13f['params']['id'])};_0x293fc0[_[_0x6b01('0x99')](_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x91')][_0x6b01('0x9a')]())+'QueueId']=Number(_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x5a')][_0x5a7af0]);socket[_0x6b01('0xa4')](_0x6b01('0x26')+_[_0x6b01('0x99')](_0x33b13f[_0x6b01('0x3d')]['channel']['toLowerCase']())+'Queue:remove',_0x293fc0);}}else{var _0x293fc0={'UserId':Number(_0x33b13f['params']['id'])};_0x293fc0[_[_0x6b01('0x99')](_0x33b13f[_0x6b01('0x3d')]['channel'][_0x6b01('0x9a')]())+_0x6b01('0x9c')]=Number(_0x33b13f['query'][_0x6b01('0x5a')]);socket['emit']('user'+_['capitalize'](_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x91')][_0x6b01('0x9a')]())+_0x6b01('0xa5'),_0x293fc0);}return _0x34adde;})['then'](function(){if(_0x33b13f['query'][_0x6b01('0x91')]===_0x6b01('0x9d')){return db[_0x6b01('0xa6')][_0x6b01('0x30')]({'where':{'UserId':_0x33b13f['params']['id'],'VoiceQueueId':_0x33b13f[_0x6b01('0x3d')][_0x6b01('0x5a')]},'individualHooks':!![]})[_0x6b01('0xf')](function(){return _0x26aa9b;});}return _0x26aa9b;})[_0x6b01('0xf')](respondWithStatusCode(_0x3a8609,null))[_0x6b01('0x17')](handleError(_0x3a8609,null));};exports['addAvatar']=function(_0x5175a7,_0x490a27){_0x5175a7['body'][_0x6b01('0xa7')]=_0x5175a7[_0x6b01('0xa8')][_0x6b01('0xa9')];return db[_0x6b01('0x3c')]['find']({'where':{'id':_0x5175a7[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x490a27,null))[_0x6b01('0xf')](saveUpdates(_0x5175a7[_0x6b01('0x55')],null))[_0x6b01('0xf')](respondWithResult(_0x490a27,null))[_0x6b01('0x17')](handleError(_0x490a27,null));};exports['getAvatar']=function(_0x1b8867,_0x7e66c2){var _0x141cfc=path[_0x6b01('0xaa')](config[_0x6b01('0xab')],'server/files/images/logos/default_profile.png');return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x1b8867[_0x6b01('0x56')]['id']},'attributes':['id',_0x6b01('0xa7')],'raw':!![]})[_0x6b01('0xf')](handleEntityNotFound(_0x7e66c2,null))['then'](function(_0x34b8b4){if(_0x34b8b4){if(_[_0x6b01('0x60')](_0x34b8b4[_0x6b01('0xa7')])){return _0x7e66c2[_0x6b01('0xac')](_0x141cfc);}else{if(!fs[_0x6b01('0xad')](path['join'](config[_0x6b01('0xab')],'server/files/images/',_0x34b8b4[_0x6b01('0xa7')]))){return _0x7e66c2[_0x6b01('0xac')](_0x141cfc);}return _0x7e66c2['download'](path[_0x6b01('0xaa')](config[_0x6b01('0xab')],_0x6b01('0xae'),_0x34b8b4[_0x6b01('0xa7')]));}}})['catch'](handleError(_0x7e66c2,null));};exports[_0x6b01('0xaf')]=function(_0x2dcae8,_0x5bab46){return db['User'][_0x6b01('0x2e')]({'where':{'id':_0x2dcae8[_0x6b01('0x56')]['id']},'attributes':['id']})[_0x6b01('0xf')](handleEntityNotFound(_0x5bab46,null))[_0x6b01('0xf')](function(_0x45f78f){var _0x463454=[];values=_0x45f78f[_0x6b01('0x46')];_0x463454[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x45'),_0x45f78f[_0x6b01('0x46')]));_0x463454[_0x6b01('0x47')](get_open_tabs('sms',_0x45f78f[_0x6b01('0x46')]));_0x463454[_0x6b01('0x47')](get_open_tabs('openchannel',_0x45f78f[_0x6b01('0x46')]));_0x463454['push'](get_open_tabs('whatsapp',_0x45f78f[_0x6b01('0x46')]));_0x463454[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x48'),_0x45f78f[_0x6b01('0x46')]));_0x463454[_0x6b01('0x47')](get_open_tabs(_0x6b01('0x49'),_0x45f78f['dataValues']));return BPromise[_0x6b01('0x4b')](_0x463454);})['then'](function(_0x1b2744){var _0x24d53f=[];if(_0x1b2744){for(var _0x3f782a=0x0;_0x3f782a<values[_0x6b01('0xb0')][_0x6b01('0x44')];_0x3f782a++){var _0x3ebed7=values[_0x6b01('0xb0')][_0x3f782a];_0x24d53f[_0x6b01('0x47')]({'channel':_0x6b01('0xb1'),'id':_0x3ebed7['id'],'createdAt':_0x3ebed7['createdAt']});}for(var _0x3f782a=0x0;_0x3f782a<values['FaxOpenTabs'][_0x6b01('0x44')];_0x3f782a++){var _0x3ebed7=values[_0x6b01('0xb2')][_0x3f782a];_0x24d53f[_0x6b01('0x47')]({'channel':_0x6b01('0xb3'),'id':_0x3ebed7['id'],'createdAt':_0x3ebed7['createdAt']});}for(var _0x3f782a=0x0;_0x3f782a<values[_0x6b01('0xb4')][_0x6b01('0x44')];_0x3f782a++){var _0x3ebed7=values[_0x6b01('0xb4')][_0x3f782a];_0x24d53f[_0x6b01('0x47')]({'channel':_0x6b01('0xb5'),'id':_0x3ebed7['id'],'createdAt':_0x3ebed7[_0x6b01('0xb6')]});}for(var _0x3f782a=0x0;_0x3f782a<values[_0x6b01('0xb7')][_0x6b01('0x44')];_0x3f782a++){var _0x3ebed7=values[_0x6b01('0xb7')][_0x3f782a];_0x24d53f[_0x6b01('0x47')]({'channel':'MAIL','id':_0x3ebed7['id'],'createdAt':_0x3ebed7[_0x6b01('0xb6')]});}for(var _0x3f782a=0x0;_0x3f782a<values[_0x6b01('0xb8')][_0x6b01('0x44')];_0x3f782a++){var _0x3ebed7=values[_0x6b01('0xb8')][_0x3f782a];_0x24d53f[_0x6b01('0x47')]({'channel':_0x6b01('0xb9'),'id':_0x3ebed7['id'],'createdAt':_0x3ebed7[_0x6b01('0xb6')]});}for(var _0x3f782a=0x0;_0x3f782a<values['WhatsappOpenTabs'][_0x6b01('0x44')];_0x3f782a++){var _0x3ebed7=values[_0x6b01('0xba')][_0x3f782a];_0x24d53f[_0x6b01('0x47')]({'channel':_0x6b01('0xbb'),'id':_0x3ebed7['id'],'createdAt':_0x3ebed7[_0x6b01('0xb6')]});}var _0x4c8fa2={'count':_0x24d53f['length'],'rows':_0x24d53f};return _0x4c8fa2;}else return null;})[_0x6b01('0xf')](respondWithResult(_0x5bab46,null))['catch'](handleError(_0x5bab46,null));};exports['getContacts']=function(_0x33af83,_0x16f282){var _0x50e989={};var _0x4fb4b0={};var _0x116fe2;var _0x50dfe8;return db['User'][_0x6b01('0x8a')]({'where':{'id':_0x33af83['params']['id']}})['then'](handleEntityNotFound(_0x16f282,null))[_0x6b01('0xf')](function(_0x429a72){if(_0x429a72){_0x116fe2=_0x429a72;_0x4fb4b0['model']=_[_0x6b01('0x4d')](db[_0x6b01('0xbc')]['rawAttributes']);_0x4fb4b0['query']=_[_0x6b01('0x4d')](_0x33af83['query']);_0x4fb4b0[_0x6b01('0x4e')]=_['intersection'](_0x4fb4b0[_0x6b01('0x4c')],_0x4fb4b0[_0x6b01('0x3d')]);_0x50e989[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x4fb4b0[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x33af83['query'][_0x6b01('0x50')]));_0x50e989[_0x6b01('0x40')]=_0x50e989[_0x6b01('0x40')][_0x6b01('0x44')]?_0x50e989['attributes']:_0x4fb4b0['model'];_0x50e989['order']=qs[_0x6b01('0xbd')](_0x33af83[_0x6b01('0x3d')][_0x6b01('0xbd')]);_0x50e989['where']=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x33af83[_0x6b01('0x3d')],_0x4fb4b0[_0x6b01('0x4e')]));if(_0x33af83[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x50e989[_0x6b01('0x3b')]=_['merge'](_0x50e989[_0x6b01('0x3b')],{'$or':_[_0x6b01('0x2a')](_0x50e989['attributes'],function(_0x40d4b1){var _0x4ff689={};_0x4ff689[_0x40d4b1]={'$like':'%'+_0x33af83[_0x6b01('0x3d')]['filter']+'%'};return _0x4ff689;})});}_0x50e989=_[_0x6b01('0xbf')]({},_0x50e989,_0x33af83[_0x6b01('0x51')]);return _0x116fe2['getContacts'](_0x50e989);}})['then'](function(_0x5315e5){if(_0x5315e5){_0x50dfe8=_0x5315e5['length'];if(_0x33af83[_0x6b01('0x3d')][_0x6b01('0xc0')](_0x6b01('0x3e'))){_0x50e989['include']=[{'model':db[_0x6b01('0xc1')],'as':'List','required':![]},{'model':db['Tag'],'as':_0x6b01('0xc2'),'attributes':['id',_0x6b01('0x32'),_0x6b01('0xc3')],'where':_0x33af83[_0x6b01('0x3d')][_0x6b01('0xc4')]?{'id':_0x33af83[_0x6b01('0x3d')]['tag']}:undefined,'required':_0x33af83[_0x6b01('0x3d')][_0x6b01('0xc4')]?!![]:![]}];}if(!_0x33af83[_0x6b01('0x3d')]['hasOwnProperty'](_0x6b01('0xc5'))){_0x50e989[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x33af83[_0x6b01('0x3d')][_0x6b01('0x1e')]);_0x50e989['offset']=qs[_0x6b01('0x1c')](_0x33af83[_0x6b01('0x3d')][_0x6b01('0x1c')]);}return _0x116fe2[_0x6b01('0xc6')](_0x50e989);}})[_0x6b01('0xf')](function(_0x2ac926){if(_0x2ac926){return _0x2ac926?{'count':_0x50dfe8,'rows':_0x2ac926}:null;}})['then'](respondWithResult(_0x16f282,null))[_0x6b01('0x17')](handleError(_0x16f282,null));};exports['getQueues']=function(_0x190fe0,_0xf3f67f){var _0x208578;var _0x372e33;var _0x2ab981={};var _0x13d3a1;return db[_0x6b01('0x3c')][_0x6b01('0x8a')]({'where':{'id':_0x190fe0['params']['id']},'attributes':['id',_0x6b01('0x32'),_0x6b01('0x2d')]})['then'](handleEntityNotFound(_0xf3f67f,null))[_0x6b01('0xf')](function(_0x3a8afa){if(!utils[_0x6b01('0x96')](_0x190fe0['query'][_0x6b01('0x91')])){throw new db[(_0x6b01('0x84'))]['ValidationError'](_0x6b01('0x97'));}_0x208578=_0x3a8afa;var _0x268688={};_0x268688[_0x6b01('0x4c')]=_[_0x6b01('0x4d')](db[_[_0x6b01('0x99')](_0x190fe0['query'][_0x6b01('0x91')])+'Queue']['rawAttributes']);_0x268688['query']=_[_0x6b01('0x4d')](_0x190fe0['query']);_0x268688[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0x268688[_0x6b01('0x4c')],_0x268688[_0x6b01('0x3d')]);_0x2ab981[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x268688[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x190fe0[_0x6b01('0x3d')][_0x6b01('0x50')]));_0x2ab981[_0x6b01('0x40')]=_0x2ab981[_0x6b01('0x40')][_0x6b01('0x44')]?_0x2ab981[_0x6b01('0x40')]:_0x268688[_0x6b01('0x4c')];_0x2ab981[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0x190fe0[_0x6b01('0x3d')]['sort']);_0x2ab981[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x190fe0[_0x6b01('0x3d')],_0x268688[_0x6b01('0x4e')]));if(_0x190fe0[_0x6b01('0x3d')]['filter']){_0x2ab981['where']=_['merge'](_0x2ab981[_0x6b01('0x3b')],{'$or':_[_0x6b01('0x2a')](_0x2ab981['attributes'],function(_0x2f8fff){var _0x47d66d={};_0x47d66d[_0x2f8fff]={'$like':'%'+_0x190fe0[_0x6b01('0x3d')]['filter']+'%'};return _0x47d66d;})});}_0x2ab981=_['merge']({},_0x2ab981,_0x190fe0['options']);switch(_0x208578[_0x6b01('0x2d')]){case _0x6b01('0x24'):return db[_['capitalize'](_0x190fe0['query'][_0x6b01('0x91')])+_0x6b01('0xc8')][_0x6b01('0x41')](_0x2ab981);case _0x6b01('0x26'):case'agent':return _0x208578[_0x6b01('0x23')+_[_0x6b01('0x99')](_0x190fe0[_0x6b01('0x3d')][_0x6b01('0x91')])+_0x6b01('0xc9')](_0x2ab981);default:throw new db['Sequelize'][(_0x6b01('0x86'))](_0x6b01('0xca'));}})[_0x6b01('0xf')](function(_0x44ca62){_0x13d3a1=_0x44ca62[_0x6b01('0x44')];if(!_0x190fe0[_0x6b01('0x3d')][_0x6b01('0xc0')](_0x6b01('0xc5'))){_0x2ab981[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x190fe0[_0x6b01('0x3d')]['limit']);_0x2ab981['offset']=qs[_0x6b01('0x1c')](_0x190fe0['query'][_0x6b01('0x1c')]);}switch(_0x208578[_0x6b01('0x2d')]){case _0x6b01('0x24'):return db[_[_0x6b01('0x99')](_0x190fe0[_0x6b01('0x3d')][_0x6b01('0x91')])+_0x6b01('0xc8')]['findAll'](_0x2ab981);case _0x6b01('0x26'):case _0x6b01('0x6c'):return _0x208578[_0x6b01('0x23')+_[_0x6b01('0x99')](_0x190fe0[_0x6b01('0x3d')][_0x6b01('0x91')])+_0x6b01('0xc9')](_0x2ab981);}})[_0x6b01('0xf')](function(_0x51df93){return{'count':_0x13d3a1,'rows':_0x51df93};})[_0x6b01('0xf')](respondWithResult(_0xf3f67f,null))['catch'](handleError(_0xf3f67f,null));};exports['getVoiceQueuesRt']=function(_0x42f5b2,_0xc2d596){var _0x579eef={};var _0x48ccea={};var _0x1fae57;var _0x1f446d;return db['User'][_0x6b01('0x8a')]({'where':{'id':_0x42f5b2[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0xc2d596,null))[_0x6b01('0xf')](function(_0x71796b){if(_0x71796b){_0x1fae57=_0x71796b;_0x48ccea[_0x6b01('0x4c')]=_[_0x6b01('0x4d')](db['UserVoiceQueueRt'][_0x6b01('0x35')]);_0x48ccea[_0x6b01('0x3d')]=_[_0x6b01('0x4d')](_0x42f5b2[_0x6b01('0x3d')]);_0x48ccea[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0x48ccea[_0x6b01('0x4c')],_0x48ccea[_0x6b01('0x3d')]);_0x579eef[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x48ccea['model'],qs[_0x6b01('0x50')](_0x42f5b2[_0x6b01('0x3d')][_0x6b01('0x50')]));_0x579eef['attributes']=_0x579eef[_0x6b01('0x40')][_0x6b01('0x44')]?_0x579eef[_0x6b01('0x40')]:_0x48ccea['model'];_0x579eef[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0x42f5b2['query'][_0x6b01('0xbd')]);_0x579eef[_0x6b01('0x3b')]=qs['filters'](_[_0x6b01('0xbe')](_0x42f5b2[_0x6b01('0x3d')],_0x48ccea[_0x6b01('0x4e')]));if(_0x42f5b2[_0x6b01('0x3d')]['filter']){_0x579eef['where']=_['merge'](_0x579eef[_0x6b01('0x3b')],{'$or':_[_0x6b01('0x2a')](_0x579eef[_0x6b01('0x40')],function(_0x27e22f){var _0x32d70b={};_0x32d70b[_0x27e22f]={'$like':'%'+_0x42f5b2[_0x6b01('0x3d')]['filter']+'%'};return _0x32d70b;})});}_0x579eef=_[_0x6b01('0xbf')]({},_0x579eef,_0x42f5b2[_0x6b01('0x51')]);return _0x1fae57[_0x6b01('0xcb')](_0x579eef);}})[_0x6b01('0xf')](function(_0x40a8cd){if(_0x40a8cd){_0x1f446d=_0x40a8cd['length'];if(!_0x42f5b2[_0x6b01('0x3d')][_0x6b01('0xc0')](_0x6b01('0xc5'))){_0x579eef['limit']=qs['limit'](_0x42f5b2[_0x6b01('0x3d')][_0x6b01('0x1e')]);_0x579eef[_0x6b01('0x1c')]=qs['offset'](_0x42f5b2['query'][_0x6b01('0x1c')]);}return _0x1fae57[_0x6b01('0xcb')](_0x579eef);}})[_0x6b01('0xf')](function(_0x101150){if(_0x101150){return _0x101150?{'count':_0x1f446d,'rows':_0x101150}:null;}})[_0x6b01('0xf')](respondWithResult(_0xc2d596,null))[_0x6b01('0x17')](handleError(_0xc2d596,null));};exports[_0x6b01('0xcc')]=function(_0x32bf17,_0x5dc56b){var _0x25654a={};var _0x4922ba={};var _0x475e73;var _0x53e745;return db['User']['findOne']({'where':{'id':_0x32bf17['params']['id']}})['then'](handleEntityNotFound(_0x5dc56b,null))['then'](function(_0x1fb150){if(_0x1fb150){_0x475e73=_0x1fb150;_0x4922ba[_0x6b01('0x4c')]=_['keys'](db[_0x6b01('0xcd')][_0x6b01('0x35')]);_0x4922ba[_0x6b01('0x3d')]=_[_0x6b01('0x4d')](_0x32bf17[_0x6b01('0x3d')]);_0x4922ba[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0x4922ba[_0x6b01('0x4c')],_0x4922ba[_0x6b01('0x3d')]);_0x25654a[_0x6b01('0x40')]=_['intersection'](_0x4922ba[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x32bf17[_0x6b01('0x3d')][_0x6b01('0x50')]));_0x25654a[_0x6b01('0x40')]=_0x25654a[_0x6b01('0x40')][_0x6b01('0x44')]?_0x25654a[_0x6b01('0x40')]:_0x4922ba['model'];_0x25654a['order']=qs[_0x6b01('0xbd')](_0x32bf17[_0x6b01('0x3d')]['sort']);_0x25654a[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x32bf17[_0x6b01('0x3d')],_0x4922ba[_0x6b01('0x4e')]));if(_0x32bf17['query'][_0x6b01('0x39')]){_0x25654a[_0x6b01('0x3b')]=_[_0x6b01('0xbf')](_0x25654a[_0x6b01('0x3b')],{'$or':_[_0x6b01('0x2a')](_0x25654a['attributes'],function(_0x3d555e){var _0xffba5d={};_0xffba5d[_0x3d555e]={'$like':'%'+_0x32bf17['query']['filter']+'%'};return _0xffba5d;})});}_0x25654a=_[_0x6b01('0xbf')]({},_0x25654a,_0x32bf17[_0x6b01('0x51')]);return _0x475e73[_0x6b01('0xcc')](_0x25654a);}})[_0x6b01('0xf')](function(_0x5a6b33){if(_0x5a6b33){_0x53e745=_0x5a6b33['length'];if(!_0x32bf17[_0x6b01('0x3d')]['hasOwnProperty'](_0x6b01('0xc5'))){_0x25654a['limit']=qs['limit'](_0x32bf17['query'][_0x6b01('0x1e')]);_0x25654a['offset']=qs[_0x6b01('0x1c')](_0x32bf17[_0x6b01('0x3d')][_0x6b01('0x1c')]);}return _0x475e73[_0x6b01('0xcc')](_0x25654a);}})[_0x6b01('0xf')](function(_0x8984ca){if(_0x8984ca){return _0x8984ca?{'count':_0x53e745,'rows':_0x8984ca}:null;}})[_0x6b01('0xf')](respondWithResult(_0x5dc56b,null))[_0x6b01('0x17')](handleError(_0x5dc56b,null));};exports[_0x6b01('0xce')]=function(_0x32dd85,_0x70740f){var _0x5076ba={'raw':!![],'where':{}};var _0x2a67ac={};var _0x43be16={'count':0x0,'rows':[]};return db[_0x6b01('0x3c')][_0x6b01('0x8a')]({'where':{'id':_0x32dd85['params']['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x70740f,null))[_0x6b01('0xf')](function(_0x43dcdd){if(_0x43dcdd){_0x2a67ac['model']=_[_0x6b01('0x4d')](db[_0x6b01('0xcf')][_0x6b01('0x35')]);_0x2a67ac[_0x6b01('0x3d')]=_[_0x6b01('0x4d')](_0x32dd85[_0x6b01('0x3d')]);_0x2a67ac['filters']=_['intersection'](_0x2a67ac[_0x6b01('0x4c')],_0x2a67ac[_0x6b01('0x3d')]);_0x5076ba[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x2a67ac[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x32dd85[_0x6b01('0x3d')][_0x6b01('0x50')]));_0x5076ba['attributes']=_0x5076ba[_0x6b01('0x40')][_0x6b01('0x44')]?_0x5076ba[_0x6b01('0x40')]:_0x2a67ac[_0x6b01('0x4c')];if(!_0x32dd85[_0x6b01('0x3d')][_0x6b01('0xc0')](_0x6b01('0xc5'))){_0x5076ba[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x32dd85['query'][_0x6b01('0x1e')]);_0x5076ba[_0x6b01('0x1c')]=qs[_0x6b01('0x1c')](_0x32dd85[_0x6b01('0x3d')][_0x6b01('0x1c')]);}_0x5076ba[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0x32dd85['query'][_0x6b01('0xbd')]);_0x5076ba[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x32dd85['query'],_0x2a67ac[_0x6b01('0x4e')]));_0x5076ba[_0x6b01('0x3b')][_0x6b01('0xd0')]=_0x43dcdd['id'];if(_0x32dd85[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x5076ba[_0x6b01('0x3b')]=_[_0x6b01('0xbf')](_0x5076ba[_0x6b01('0x3b')],{'$or':_[_0x6b01('0x2a')](_0x5076ba[_0x6b01('0x40')],function(_0x1f4aa9){var _0x2e1205={};_0x2e1205[_0x1f4aa9]={'$like':'%'+_0x32dd85['query']['filter']+'%'};return _0x2e1205;})});}_0x5076ba=_[_0x6b01('0xbf')]({},_0x5076ba,_0x32dd85[_0x6b01('0x51')]);return db[_0x6b01('0xcf')][_0x6b01('0x1f')]({'where':_0x5076ba[_0x6b01('0x3b')]})['then'](function(_0x3120dc){_0x43be16[_0x6b01('0x1f')]=_0x3120dc;if(_0x32dd85['query']['includeAll']){_0x5076ba[_0x6b01('0x3f')]=[{'all':!![]}];}return db[_0x6b01('0xcf')][_0x6b01('0x41')](_0x5076ba);})[_0x6b01('0xf')](function(_0x2fe71e){_0x43be16[_0x6b01('0x42')]=_0x2fe71e;return _0x43be16;});}})[_0x6b01('0xf')](respondWithFilteredResult(_0x70740f,_0x5076ba))[_0x6b01('0x17')](handleError(_0x70740f,null));};exports[_0x6b01('0xd1')]=function(_0x34fbcf,_0x196121){var _0x442c1a={'raw':!![],'where':{}};var _0x3db8c7={};var _0x267d16={'count':0x0,'rows':[]};return db['User'][_0x6b01('0x8a')]({'where':{'id':_0x34fbcf[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x196121,null))[_0x6b01('0xf')](function(_0x1f6d59){if(_0x1f6d59){_0x3db8c7[_0x6b01('0x4c')]=_[_0x6b01('0x4d')](db[_0x6b01('0xd2')][_0x6b01('0x35')]);_0x3db8c7['query']=_['keys'](_0x34fbcf[_0x6b01('0x3d')]);_0x3db8c7[_0x6b01('0x4e')]=_['intersection'](_0x3db8c7['model'],_0x3db8c7[_0x6b01('0x3d')]);_0x442c1a[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x3db8c7['model'],qs[_0x6b01('0x50')](_0x34fbcf[_0x6b01('0x3d')][_0x6b01('0x50')]));_0x442c1a[_0x6b01('0x40')]=_0x442c1a['attributes'][_0x6b01('0x44')]?_0x442c1a[_0x6b01('0x40')]:_0x3db8c7['model'];if(!_0x34fbcf[_0x6b01('0x3d')][_0x6b01('0xc0')](_0x6b01('0xc5'))){_0x442c1a[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x34fbcf[_0x6b01('0x3d')][_0x6b01('0x1e')]);_0x442c1a[_0x6b01('0x1c')]=qs[_0x6b01('0x1c')](_0x34fbcf[_0x6b01('0x3d')][_0x6b01('0x1c')]);}_0x442c1a[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0x34fbcf['query'][_0x6b01('0xbd')]);_0x442c1a['where']=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x34fbcf[_0x6b01('0x3d')],_0x3db8c7[_0x6b01('0x4e')]));_0x442c1a[_0x6b01('0x3b')][_0x6b01('0xd0')]=_0x1f6d59['id'];if(_0x34fbcf[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x442c1a[_0x6b01('0x3b')]=_[_0x6b01('0xbf')](_0x442c1a['where'],{'$or':_[_0x6b01('0x2a')](_0x442c1a[_0x6b01('0x40')],function(_0x5edbe7){var _0x14f5fb={};_0x14f5fb[_0x5edbe7]={'$like':'%'+_0x34fbcf[_0x6b01('0x3d')][_0x6b01('0x39')]+'%'};return _0x14f5fb;})});}_0x442c1a=_[_0x6b01('0xbf')]({},_0x442c1a,_0x34fbcf[_0x6b01('0x51')]);return db[_0x6b01('0xd2')][_0x6b01('0x1f')]({'where':_0x442c1a[_0x6b01('0x3b')]})['then'](function(_0x4795ce){_0x267d16[_0x6b01('0x1f')]=_0x4795ce;if(_0x34fbcf[_0x6b01('0x3d')][_0x6b01('0x3e')]){_0x442c1a[_0x6b01('0x3f')]=[{'all':!![]}];}return db[_0x6b01('0xd2')][_0x6b01('0x41')](_0x442c1a);})[_0x6b01('0xf')](function(_0x10b5d9){_0x267d16[_0x6b01('0x42')]=_0x10b5d9;return _0x267d16;});}})[_0x6b01('0xf')](respondWithFilteredResult(_0x196121,_0x442c1a))['catch'](handleError(_0x196121,null));};exports[_0x6b01('0xd3')]=function(_0x40d03a,_0x365441){var _0x405825={};var _0x53549c={};var _0x5db0f3;var _0xa03302;return db['User']['findOne']({'where':{'id':_0x40d03a[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x365441,null))[_0x6b01('0xf')](function(_0x1f037c){if(_0x1f037c){_0x5db0f3=_0x1f037c;_0x53549c[_0x6b01('0x4c')]=_['keys'](db['ChatInteraction']['rawAttributes']);_0x53549c['query']=_[_0x6b01('0x4d')](_0x40d03a[_0x6b01('0x3d')]);_0x53549c['filters']=_[_0x6b01('0x4f')](_0x53549c[_0x6b01('0x4c')],_0x53549c['query']);_0x405825[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x53549c[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x40d03a['query']['fields']));_0x405825[_0x6b01('0x40')]=_0x405825[_0x6b01('0x40')][_0x6b01('0x44')]?_0x405825[_0x6b01('0x40')]:_0x53549c[_0x6b01('0x4c')];_0x405825[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0x40d03a[_0x6b01('0x3d')][_0x6b01('0xbd')]);_0x405825[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x40d03a[_0x6b01('0x3d')],_0x53549c[_0x6b01('0x4e')]));if(_0x40d03a[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x405825[_0x6b01('0x3b')]=_[_0x6b01('0xbf')](_0x405825[_0x6b01('0x3b')],{'$or':_[_0x6b01('0x2a')](_0x405825['attributes'],function(_0x1a7590){var _0x4a70a4={};_0x4a70a4[_0x1a7590]={'$like':'%'+_0x40d03a['query'][_0x6b01('0x39')]+'%'};return _0x4a70a4;})});}_0x405825=_[_0x6b01('0xbf')]({},_0x405825,_0x40d03a['options']);return _0x5db0f3['getChatInteractions'](_0x405825);}})[_0x6b01('0xf')](function(_0x50d732){if(_0x50d732){_0xa03302=_0x50d732['length'];if(!_0x40d03a['query'][_0x6b01('0xc0')]('nolimit')){_0x405825[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x40d03a[_0x6b01('0x3d')][_0x6b01('0x1e')]);_0x405825[_0x6b01('0x1c')]=qs[_0x6b01('0x1c')](_0x40d03a[_0x6b01('0x3d')]['offset']);}return _0x5db0f3['getChatInteractions'](_0x405825);}})['then'](function(_0x237ed2){if(_0x237ed2){return _0x237ed2?{'count':_0xa03302,'rows':_0x237ed2}:null;}})[_0x6b01('0xf')](respondWithResult(_0x365441,null))['catch'](handleError(_0x365441,null));};exports['getOpenchannelInteractions']=function(_0x24e3f1,_0xb5df82){var _0x231e29={};var _0x36e2f6={};var _0x1d1434;var _0x585516;return db[_0x6b01('0x3c')][_0x6b01('0x8a')]({'where':{'id':_0x24e3f1[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0xb5df82,null))[_0x6b01('0xf')](function(_0x7c1bc){if(_0x7c1bc){_0x1d1434=_0x7c1bc;_0x36e2f6['model']=_[_0x6b01('0x4d')](db[_0x6b01('0xd4')]['rawAttributes']);_0x36e2f6['query']=_[_0x6b01('0x4d')](_0x24e3f1['query']);_0x36e2f6[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0x36e2f6['model'],_0x36e2f6[_0x6b01('0x3d')]);_0x231e29[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x36e2f6[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x24e3f1[_0x6b01('0x3d')][_0x6b01('0x50')]));_0x231e29[_0x6b01('0x40')]=_0x231e29['attributes'][_0x6b01('0x44')]?_0x231e29['attributes']:_0x36e2f6[_0x6b01('0x4c')];_0x231e29['order']=qs[_0x6b01('0xbd')](_0x24e3f1[_0x6b01('0x3d')][_0x6b01('0xbd')]);_0x231e29[_0x6b01('0x3b')]=qs['filters'](_[_0x6b01('0xbe')](_0x24e3f1[_0x6b01('0x3d')],_0x36e2f6['filters']));if(_0x24e3f1[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x231e29['where']=_[_0x6b01('0xbf')](_0x231e29[_0x6b01('0x3b')],{'$or':_[_0x6b01('0x2a')](_0x231e29[_0x6b01('0x40')],function(_0x3c5483){var _0x3d9891={};_0x3d9891[_0x3c5483]={'$like':'%'+_0x24e3f1[_0x6b01('0x3d')][_0x6b01('0x39')]+'%'};return _0x3d9891;})});}_0x231e29=_[_0x6b01('0xbf')]({},_0x231e29,_0x24e3f1[_0x6b01('0x51')]);return _0x1d1434[_0x6b01('0xd5')](_0x231e29);}})[_0x6b01('0xf')](function(_0x705e47){if(_0x705e47){_0x585516=_0x705e47[_0x6b01('0x44')];if(!_0x24e3f1[_0x6b01('0x3d')][_0x6b01('0xc0')](_0x6b01('0xc5'))){_0x231e29[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x24e3f1[_0x6b01('0x3d')][_0x6b01('0x1e')]);_0x231e29[_0x6b01('0x1c')]=qs[_0x6b01('0x1c')](_0x24e3f1[_0x6b01('0x3d')][_0x6b01('0x1c')]);}return _0x1d1434[_0x6b01('0xd5')](_0x231e29);}})['then'](function(_0x85328e){if(_0x85328e){return _0x85328e?{'count':_0x585516,'rows':_0x85328e}:null;}})[_0x6b01('0xf')](respondWithResult(_0xb5df82,null))['catch'](handleError(_0xb5df82,null));};exports[_0x6b01('0xd6')]=function(_0x113e6a,_0x1cbf86){var _0x7ea009={'raw':!![],'where':{}};var _0x363004={};var _0x254046={'count':0x0,'rows':[]};return db[_0x6b01('0x3c')][_0x6b01('0x8a')]({'where':{'id':_0x113e6a[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x1cbf86,null))[_0x6b01('0xf')](function(_0x11f3d7){if(_0x11f3d7){_0x363004[_0x6b01('0x4c')]=_[_0x6b01('0x4d')](db[_0x6b01('0xd7')]['rawAttributes']);_0x363004[_0x6b01('0x3d')]=_[_0x6b01('0x4d')](_0x113e6a['query']);_0x363004[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0x363004['model'],_0x363004['query']);_0x7ea009[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x363004['model'],qs[_0x6b01('0x50')](_0x113e6a[_0x6b01('0x3d')]['fields']));_0x7ea009[_0x6b01('0x40')]=_0x7ea009[_0x6b01('0x40')][_0x6b01('0x44')]?_0x7ea009[_0x6b01('0x40')]:_0x363004[_0x6b01('0x4c')];if(!_0x113e6a['query'][_0x6b01('0xc0')]('nolimit')){_0x7ea009['limit']=qs['limit'](_0x113e6a[_0x6b01('0x3d')][_0x6b01('0x1e')]);_0x7ea009[_0x6b01('0x1c')]=qs[_0x6b01('0x1c')](_0x113e6a[_0x6b01('0x3d')][_0x6b01('0x1c')]);}_0x7ea009[_0x6b01('0xc7')]=qs['sort'](_0x113e6a[_0x6b01('0x3d')][_0x6b01('0xbd')]);_0x7ea009[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_['pick'](_0x113e6a[_0x6b01('0x3d')],_0x363004[_0x6b01('0x4e')]));_0x7ea009[_0x6b01('0x3b')]['UserId']=_0x11f3d7['id'];if(_0x113e6a[_0x6b01('0x3d')]['filter']){_0x7ea009[_0x6b01('0x3b')]=_[_0x6b01('0xbf')](_0x7ea009[_0x6b01('0x3b')],{'$or':_[_0x6b01('0x2a')](_0x7ea009[_0x6b01('0x40')],function(_0xc092ee){var _0x1a8ac5={};_0x1a8ac5[_0xc092ee]={'$like':'%'+_0x113e6a[_0x6b01('0x3d')][_0x6b01('0x39')]+'%'};return _0x1a8ac5;})});}_0x7ea009=_[_0x6b01('0xbf')]({},_0x7ea009,_0x113e6a['options']);return db[_0x6b01('0xd7')][_0x6b01('0x1f')]({'where':_0x7ea009[_0x6b01('0x3b')]})[_0x6b01('0xf')](function(_0x2f7caf){_0x254046[_0x6b01('0x1f')]=_0x2f7caf;if(_0x113e6a[_0x6b01('0x3d')][_0x6b01('0x3e')]){_0x7ea009[_0x6b01('0x3f')]=[{'all':!![]}];}return db[_0x6b01('0xd7')][_0x6b01('0x41')](_0x7ea009);})[_0x6b01('0xf')](function(_0x22b5e7){_0x254046['rows']=_0x22b5e7;return _0x254046;});}})[_0x6b01('0xf')](respondWithFilteredResult(_0x1cbf86,_0x7ea009))[_0x6b01('0x17')](handleError(_0x1cbf86,null));};exports[_0x6b01('0xd8')]=function(_0x4c442e,_0x406047){var _0xbd0475={};var _0x201523={};var _0x74ab81;var _0x5d6d8b;return db[_0x6b01('0x3c')][_0x6b01('0x8a')]({'where':{'id':_0x4c442e[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x406047,null))['then'](function(_0x351ca9){if(_0x351ca9){_0x74ab81=_0x351ca9;_0x201523['model']=_[_0x6b01('0x4d')](db[_0x6b01('0xd9')][_0x6b01('0x35')]);_0x201523[_0x6b01('0x3d')]=_['keys'](_0x4c442e['query']);_0x201523['filters']=_['intersection'](_0x201523[_0x6b01('0x4c')],_0x201523['query']);_0xbd0475[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x201523['model'],qs['fields'](_0x4c442e[_0x6b01('0x3d')][_0x6b01('0x50')]));_0xbd0475[_0x6b01('0x40')]=_0xbd0475[_0x6b01('0x40')][_0x6b01('0x44')]?_0xbd0475[_0x6b01('0x40')]:_0x201523[_0x6b01('0x4c')];_0xbd0475[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0x4c442e['query'][_0x6b01('0xbd')]);_0xbd0475[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x4c442e[_0x6b01('0x3d')],_0x201523[_0x6b01('0x4e')]));if(_0x4c442e['query'][_0x6b01('0x39')]){_0xbd0475[_0x6b01('0x3b')]=_[_0x6b01('0xbf')](_0xbd0475['where'],{'$or':_[_0x6b01('0x2a')](_0xbd0475[_0x6b01('0x40')],function(_0xa5405e){var _0x4d9e87={};_0x4d9e87[_0xa5405e]={'$like':'%'+_0x4c442e[_0x6b01('0x3d')][_0x6b01('0x39')]+'%'};return _0x4d9e87;})});}_0xbd0475=_[_0x6b01('0xbf')]({},_0xbd0475,_0x4c442e[_0x6b01('0x51')]);return _0x74ab81['getSmsInteractions'](_0xbd0475);}})['then'](function(_0x36dff4){if(_0x36dff4){_0x5d6d8b=_0x36dff4[_0x6b01('0x44')];if(!_0x4c442e['query']['hasOwnProperty'](_0x6b01('0xc5'))){_0xbd0475[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x4c442e['query'][_0x6b01('0x1e')]);_0xbd0475[_0x6b01('0x1c')]=qs[_0x6b01('0x1c')](_0x4c442e[_0x6b01('0x3d')][_0x6b01('0x1c')]);}return _0x74ab81[_0x6b01('0xd8')](_0xbd0475);}})[_0x6b01('0xf')](function(_0x5eda2c){if(_0x5eda2c){return _0x5eda2c?{'count':_0x5d6d8b,'rows':_0x5eda2c}:null;}})['then'](respondWithResult(_0x406047,null))['catch'](handleError(_0x406047,null));};exports[_0x6b01('0xda')]=function(_0x292da0,_0x4a76cf){var _0x4e65f6={};var _0x109aa6={};var _0x449656;var _0x2be26b;return db[_0x6b01('0x3c')][_0x6b01('0x8a')]({'where':{'id':_0x292da0[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x4a76cf,null))[_0x6b01('0xf')](function(_0x59d1da){if(_0x59d1da){_0x449656=_0x59d1da;_0x109aa6['model']=_[_0x6b01('0x4d')](db['FaxInteraction'][_0x6b01('0x35')]);_0x109aa6['query']=_['keys'](_0x292da0['query']);_0x109aa6[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0x109aa6[_0x6b01('0x4c')],_0x109aa6[_0x6b01('0x3d')]);_0x4e65f6[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x109aa6[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x292da0[_0x6b01('0x3d')]['fields']));_0x4e65f6[_0x6b01('0x40')]=_0x4e65f6['attributes'][_0x6b01('0x44')]?_0x4e65f6[_0x6b01('0x40')]:_0x109aa6[_0x6b01('0x4c')];_0x4e65f6[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0x292da0[_0x6b01('0x3d')]['sort']);_0x4e65f6[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x292da0[_0x6b01('0x3d')],_0x109aa6[_0x6b01('0x4e')]));if(_0x292da0[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x4e65f6[_0x6b01('0x3b')]=_[_0x6b01('0xbf')](_0x4e65f6['where'],{'$or':_[_0x6b01('0x2a')](_0x4e65f6['attributes'],function(_0x54c715){var _0x5f29ec={};_0x5f29ec[_0x54c715]={'$like':'%'+_0x292da0[_0x6b01('0x3d')][_0x6b01('0x39')]+'%'};return _0x5f29ec;})});}_0x4e65f6=_[_0x6b01('0xbf')]({},_0x4e65f6,_0x292da0[_0x6b01('0x51')]);return _0x449656[_0x6b01('0xda')](_0x4e65f6);}})[_0x6b01('0xf')](function(_0xa336c4){if(_0xa336c4){_0x2be26b=_0xa336c4['length'];if(!_0x292da0[_0x6b01('0x3d')]['hasOwnProperty'](_0x6b01('0xc5'))){_0x4e65f6['limit']=qs[_0x6b01('0x1e')](_0x292da0['query']['limit']);_0x4e65f6[_0x6b01('0x1c')]=qs[_0x6b01('0x1c')](_0x292da0['query'][_0x6b01('0x1c')]);}return _0x449656[_0x6b01('0xda')](_0x4e65f6);}})[_0x6b01('0xf')](function(_0x3b2c83){if(_0x3b2c83){return _0x3b2c83?{'count':_0x2be26b,'rows':_0x3b2c83}:null;}})['then'](respondWithResult(_0x4a76cf,null))[_0x6b01('0x17')](handleError(_0x4a76cf,null));};exports['getWhatsappInteractions']=function(_0xdfebea,_0xcf34ce){var _0x485f21={};var _0x312f51={};var _0x483409;var _0x114ca3;return db[_0x6b01('0x3c')][_0x6b01('0x8a')]({'where':{'id':_0xdfebea[_0x6b01('0x56')]['id']}})['then'](handleEntityNotFound(_0xcf34ce,null))[_0x6b01('0xf')](function(_0x36dcb9){if(_0x36dcb9){_0x483409=_0x36dcb9;_0x312f51[_0x6b01('0x4c')]=_[_0x6b01('0x4d')](db[_0x6b01('0xdb')][_0x6b01('0x35')]);_0x312f51[_0x6b01('0x3d')]=_[_0x6b01('0x4d')](_0xdfebea[_0x6b01('0x3d')]);_0x312f51[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0x312f51[_0x6b01('0x4c')],_0x312f51['query']);_0x485f21[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x312f51[_0x6b01('0x4c')],qs['fields'](_0xdfebea[_0x6b01('0x3d')][_0x6b01('0x50')]));_0x485f21['attributes']=_0x485f21[_0x6b01('0x40')][_0x6b01('0x44')]?_0x485f21['attributes']:_0x312f51[_0x6b01('0x4c')];_0x485f21[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0xdfebea[_0x6b01('0x3d')]['sort']);_0x485f21[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_['pick'](_0xdfebea[_0x6b01('0x3d')],_0x312f51[_0x6b01('0x4e')]));if(_0xdfebea[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x485f21['where']=_[_0x6b01('0xbf')](_0x485f21['where'],{'$or':_['map'](_0x485f21[_0x6b01('0x40')],function(_0x4e9460){var _0x2d50c2={};_0x2d50c2[_0x4e9460]={'$like':'%'+_0xdfebea[_0x6b01('0x3d')][_0x6b01('0x39')]+'%'};return _0x2d50c2;})});}_0x485f21=_[_0x6b01('0xbf')]({},_0x485f21,_0xdfebea['options']);return _0x483409['getWhatsappInteractions'](_0x485f21);}})[_0x6b01('0xf')](function(_0x386c8a){if(_0x386c8a){_0x114ca3=_0x386c8a[_0x6b01('0x44')];if(!_0xdfebea[_0x6b01('0x3d')][_0x6b01('0xc0')]('nolimit')){_0x485f21[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0xdfebea[_0x6b01('0x3d')][_0x6b01('0x1e')]);_0x485f21['offset']=qs[_0x6b01('0x1c')](_0xdfebea['query'][_0x6b01('0x1c')]);}return _0x483409[_0x6b01('0xdc')](_0x485f21);}})[_0x6b01('0xf')](function(_0x122c3b){if(_0x122c3b){return _0x122c3b?{'count':_0x114ca3,'rows':_0x122c3b}:null;}})[_0x6b01('0xf')](respondWithResult(_0xcf34ce,null))[_0x6b01('0x17')](handleError(_0xcf34ce,null));};exports[_0x6b01('0xdd')]=function(_0x5caca6,_0x12f88d,_0x3d87e9){var _0xb812af;var _0x1717f9;var _0x773fb5;var _0x5966be=!_[_0x6b01('0x60')](_0x5caca6[_0x6b01('0x56')]['id'])?_0x5caca6[_0x6b01('0x56')]['id']:!_[_0x6b01('0x60')](_0x5caca6[_0x6b01('0x26')]['id'])?_0x5caca6[_0x6b01('0x26')]['id']:null;return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x5966be,'role':{'$or':['admin',_0x6b01('0x26'),_0x6b01('0x6c')]}},'attributes':['id','name',_0x6b01('0xde'),_0x6b01('0xdf'),_0x6b01('0x2d'),_0x6b01('0x5b'),_0x6b01('0x93')]})['then'](function(_0x426a26){if(_0x426a26){if(_0x426a26[_0x6b01('0x2d')]===_0x6b01('0x6c')){_0xb812af=_0x426a26;if(_0x5caca6[_0x6b01('0x55')]['interface']){_0x773fb5=util[_0x6b01('0x9f')](_0x6b01('0xe0'),_0xb812af[_0x5caca6[_0x6b01('0x55')]['interface']]);}else if(_0x5caca6[_0x6b01('0x55')][_0x6b01('0xe1')]){_0x773fb5=util['format'](_0x6b01('0xa0'),_0x5caca6[_0x6b01('0x55')]['intrf']);}else{_0x773fb5=util[_0x6b01('0x9f')](_0x6b01('0xa0'),_0xb812af[_0x6b01('0x32')]);}socket['to'](util[_0x6b01('0x9f')](_0x6b01('0xe2'),_0xb812af[_0x6b01('0x32')]))[_0x6b01('0xa4')](_0x6b01('0xe3'),{'user':{'id':_0xb812af['id'],'name':_0xb812af['name']},'ip':_0x5caca6[_0x6b01('0xe4')][_0x6b01('0xe5')]||_0x5caca6[_0x6b01('0xe6')]['remoteAddress']||_0x5caca6[_0x6b01('0xe7')][_0x6b01('0xe8')]||_0x5caca6['connection'][_0x6b01('0xe7')]['remoteAddress']});return db['UserVoiceQueueRt'][_0x6b01('0x30')]({'where':{'membername':_0xb812af['name']},'individualHooks':!![]});}}else{throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})[_0x6b01('0xf')](function(){if(_0xb812af){return _0xb812af[_0x6b01('0xe9')]({'raw':!![]});}})['then'](function(_0xd38583){if(_0xb812af){var _0x3540e8=[];if(_0xd38583){_0x1717f9=_0xd38583;if(_0x1717f9[_0x6b01('0x44')]){for(var _0x584247=0x0;_0x584247<_0x1717f9[_0x6b01('0x44')];_0x584247++){_0x3540e8[_0x6b01('0x47')]({'membername':_0xb812af[_0x6b01('0x32')],'UserId':_0xb812af['id'],'queue_name':_0x1717f9[_0x584247]['name'],'VoiceQueueId':_0x1717f9[_0x584247]['id'],'interface':_0x773fb5,'paused':_0xb812af['loginInPause']||![],'penalty':_0x1717f9[_0x584247][_0x6b01('0xea')]||0x0});}return BPromise['each'](_0x3540e8,function(_0x247d88){return db[_0x6b01('0xa6')][_0x6b01('0xeb')](_0x247d88);});}}}})[_0x6b01('0xf')](function(){if(_0xb812af){return db[_0x6b01('0xec')]['findAll']({'where':{'membername':_0xb812af[_0x6b01('0x32')],'exitAt':null}});}})['then'](function(_0x5acecb){if(_0xb812af){var _0x20d4a2=[];_0x5acecb[_0x6b01('0xed')](function(_0xe42a25){_0x20d4a2['push'](_0xe42a25[_0x6b01('0x22')]({'exitAt':moment()[_0x6b01('0x9f')](_0x6b01('0xee'))}));});return BPromise[_0x6b01('0x4b')](_0x20d4a2);}})[_0x6b01('0xf')](function(){if(_0xb812af){var _0x523b2e=[];var _0x47faa8=[];var _0x4fab2f=utils[_0x6b01('0xef')]();var _0x4bae02={'membername':_0xb812af[_0x6b01('0x32')],'interface':_0x773fb5,'enterAt':moment()[_0x6b01('0x9f')](_0x6b01('0xee')),'role':_0xb812af[_0x6b01('0x2d')],'internal':_0xb812af[_0x6b01('0x5b')]};_0x4fab2f[_0x6b01('0xed')](function(_0x278246){_0x523b2e[_0x6b01('0x47')](_[_0x6b01('0xbf')]({'channel':_0x278246,'type':'LOGIN','data1':_0x5caca6[_0x6b01('0x55')][_0x6b01('0xf0')],'data2':_0x773fb5},_0x4bae02));if(_0xb812af[_0x6b01('0x93')]){_0x47faa8[_0x6b01('0x47')](_[_0x6b01('0xbf')]({'channel':_0x278246,'type':_0x6b01('0xf1'),'data1':_0x6b01('0xf2')},_0x4bae02));}});return db[_0x6b01('0xec')][_0x6b01('0xf3')](_0x523b2e['concat'](_0x47faa8),{'individualHooks':!![]});}})[_0x6b01('0xf')](function(){if(_0xb812af){return _0xb812af[_0x6b01('0x22')]({'online':!![],'lastLoginAt':moment()['format'](_0x6b01('0xee')),'voicePause':_0xb812af['loginInPause']||![],'mailPause':_0xb812af[_0x6b01('0x93')]||![],'chatPause':_0xb812af['loginInPause']||![],'faxPause':_0xb812af[_0x6b01('0x93')]||![],'smsPause':_0xb812af[_0x6b01('0x93')]||![],'openchannelPause':_0xb812af[_0x6b01('0x93')]||![],'whatsappPause':_0xb812af['loginInPause']||![],'pauseType':_0xb812af['loginInPause']?_0x6b01('0xf2'):null,'interface':_0x773fb5,'lastPauseAt':moment()[_0x6b01('0x9f')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x6b01('0xf')](function(_0x258da4){if(_0x5caca6['isMiddleware']){return _0x3d87e9();}else{return BPromise[_0x6b01('0xf4')](_0x258da4)[_0x6b01('0xf')](respondWithResult(_0x12f88d,null));}})[_0x6b01('0x17')](handleError(_0x12f88d,null));};exports[_0x6b01('0xf5')]=function(_0x138694,_0x47cb88){var _0x372c35;return db[_0x6b01('0x3c')]['find']({'where':{'id':_0x138694[_0x6b01('0x56')]['id'],'role':_0x6b01('0x6c')},'attributes':['id',_0x6b01('0x32'),_0x6b01('0x2d')]})[_0x6b01('0xf')](handleEntityNotFound(_0x47cb88,null))[_0x6b01('0xf')](function(_0x31548d){if(_0x31548d){_0x372c35=_0x31548d;return db[_0x6b01('0xa6')][_0x6b01('0x30')]({'where':{'membername':_0x372c35['name']},'individualHooks':!![]});}})[_0x6b01('0xf')](function(){return db[_0x6b01('0xec')][_0x6b01('0x41')]({'where':{'membername':_0x372c35[_0x6b01('0x32')],'exitAt':null}});})[_0x6b01('0xf')](function(_0x46a924){var _0x10c2ed=[];_0x46a924[_0x6b01('0xed')](function(_0x3a6cfb){_0x10c2ed[_0x6b01('0x47')](_0x3a6cfb[_0x6b01('0x22')]({'exitAt':moment()[_0x6b01('0x9f')](_0x6b01('0xee'))}));});return BPromise[_0x6b01('0x4b')](_0x10c2ed);})[_0x6b01('0xf')](function(){return _0x372c35[_0x6b01('0x22')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x6b01('0xf')](respondWithResult(_0x47cb88,null))[_0x6b01('0x17')](handleError(_0x47cb88,null));};exports[_0x6b01('0xf6')]=function(_0x41de48,_0x3f6bfe){var _0x14c05b;return db[_0x6b01('0xa6')][_0x6b01('0x22')]({'paused':0x1},{'where':{'UserId':_0x41de48['params']['id']},'individualHooks':!![]})[_0x6b01('0xf')](function(){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x41de48[_0x6b01('0x56')]['id'],'role':_0x6b01('0x6c')},'attributes':['id',_0x6b01('0x32'),_0x6b01('0x2d'),_0x6b01('0x5b'),'interface']});})[_0x6b01('0xf')](handleEntityNotFound(_0x3f6bfe,null))[_0x6b01('0xf')](function(_0x1fadac){if(_0x1fadac){_0x14c05b=_0x1fadac;return respondWithRpcPromise(_0x6b01('0xf7'),_0x6b01('0xf6'),{'id':_0x14c05b['id'],'name':_0x14c05b[_0x6b01('0x32')],'pause':!![]});}})['then'](function(){if(_0x14c05b){return db[_0x6b01('0xec')]['findAll']({'where':{'membername':_0x14c05b[_0x6b01('0x32')],'type':_0x6b01('0xf1'),'exitAt':null}});}})['then'](function(_0xd491a){if(_0xd491a[_0x6b01('0x44')]){var _0x286ab4=moment()['format'](_0x6b01('0xee'));for(var _0x4f747b=0x0,_0xa5274=_0xd491a[_0x6b01('0x44')];_0x4f747b<_0xa5274;_0x4f747b++){_0xd491a[_0x4f747b]['updateAttributes']({'exitAt':_0x286ab4});}}})[_0x6b01('0xf')](function(){var _0x4eab36=[];var _0x32e360=utils[_0x6b01('0xef')]();_0x32e360[_0x6b01('0xed')](function(_0x548a55){_0x4eab36[_0x6b01('0x47')]({'channel':_0x548a55,'membername':_0x14c05b['name'],'interface':_[_0x6b01('0x60')](_0x14c05b['interface'])?util['format']('SIP/%s',_0x14c05b['name']):_0x14c05b[_0x6b01('0x95')],'type':'PAUSE','enterAt':moment()[_0x6b01('0x9f')](_0x6b01('0xee')),'data1':_0x41de48[_0x6b01('0x55')][_0x6b01('0x37')]||_0x6b01('0xf8'),'role':_0x14c05b[_0x6b01('0x2d')],'internal':_0x14c05b[_0x6b01('0x5b')]});});return db[_0x6b01('0xec')][_0x6b01('0xf3')](_0x4eab36,{'individualHooks':!![]});})['then'](function(){return _0x14c05b[_0x6b01('0x22')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x41de48[_0x6b01('0x55')][_0x6b01('0x37')]||_0x6b01('0xf8'),'lastPauseAt':moment()[_0x6b01('0x9f')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x6b01('0xf')](respondWithResult(_0x3f6bfe,null))['catch'](handleError(_0x3f6bfe,null));};exports[_0x6b01('0xf9')]=function(_0x1ef856,_0x174130){var _0x3f6ac7;return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x1ef856[_0x6b01('0x56')]['id']},'attributes':['id','name','role',_0x6b01('0x94'),_0x6b01('0xfa'),_0x6b01('0xfb'),_0x6b01('0xfc'),_0x6b01('0xfd'),'smsPause',_0x6b01('0xfe'),_0x6b01('0xff'),_0x6b01('0x100')]})['then'](handleEntityNotFound(_0x174130,null))[_0x6b01('0xf')](function(_0x1f6202){if(_0x1f6202){_0x3f6ac7=_0x1f6202;if(_0x1ef856[_0x6b01('0x55')][_0x6b01('0x91')]&&!utils[_0x6b01('0x96')](_0x1ef856[_0x6b01('0x55')][_0x6b01('0x91')])){throw new db[(_0x6b01('0x84'))][(_0x6b01('0x86'))](_0x6b01('0x97'));}switch(_0x1ef856[_0x6b01('0x55')][_0x6b01('0x91')]){case _0x6b01('0x9d'):return respondWithRpcPromise(_0x6b01('0xf7'),_0x6b01('0xf9'),{'id':_0x3f6ac7['id'],'name':_0x3f6ac7[_0x6b01('0x32')],'pause':![]})['then'](function(){return db['UserVoiceQueueRt'][_0x6b01('0x22')]({'paused':0x0},{'where':{'UserId':_0x3f6ac7['id']},'individualHooks':!![]});})['then'](function(){return db[_0x6b01('0xec')][_0x6b01('0x2e')]({'where':{'channel':_0x1ef856[_0x6b01('0x55')]['channel'],'membername':_0x3f6ac7['name'],'type':_0x6b01('0xf1'),'exitAt':null}});})[_0x6b01('0xf')](function(_0x34e103){if(_0x34e103){return _0x34e103[_0x6b01('0x22')]({'exitAt':moment()['format'](_0x6b01('0xee')),'data2':_0x6b01('0x101')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x3f6ac7['update']({'voicePause':![]});});case _0x6b01('0x49'):case _0x6b01('0x45'):case _0x6b01('0x48'):case _0x6b01('0x53'):case'whatsapp':case'openchannel':return db['MemberReport'][_0x6b01('0x2e')]({'where':{'channel':_0x1ef856[_0x6b01('0x55')][_0x6b01('0x91')],'membername':_0x3f6ac7[_0x6b01('0x32')],'type':_0x6b01('0xf1'),'exitAt':null}})[_0x6b01('0xf')](function(_0x56687e){if(_0x56687e){return _0x56687e['update']({'exitAt':moment()[_0x6b01('0x9f')](_0x6b01('0xee')),'data2':_0x6b01('0x101')},{'individualHooks':!![]});}return null;})[_0x6b01('0xf')](function(){var _0x283900={};_[_0x6b01('0x20')](_0x283900,util[_0x6b01('0x9f')](_0x6b01('0x102'),_0x1ef856[_0x6b01('0x55')]['channel'],'Pause'),![]);return _0x3f6ac7[_0x6b01('0x22')](_0x283900);});default:return respondWithRpcPromise(_0x6b01('0xf7'),_0x6b01('0xf9'),{'id':_0x3f6ac7['id'],'name':_0x3f6ac7[_0x6b01('0x32')],'pause':![]})[_0x6b01('0xf')](function(){return db[_0x6b01('0xa6')]['update']({'paused':0x0},{'where':{'UserId':_0x3f6ac7['id']}});})['then'](function(){return db['MemberReport'][_0x6b01('0x41')]({'where':{'membername':_0x3f6ac7[_0x6b01('0x32')],'type':_0x6b01('0xf1'),'exitAt':null}});})[_0x6b01('0xf')](function(_0x38a069){var _0x3b83b0=[];_0x38a069[_0x6b01('0xed')](function(_0x45f6e1){_0x3b83b0[_0x6b01('0x47')](_0x45f6e1[_0x6b01('0x22')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x6b01('0x101')}));});return BPromise[_0x6b01('0x4b')](_0x3b83b0);})[_0x6b01('0xf')](function(){return _0x3f6ac7[_0x6b01('0x22')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0x6b01('0xf')](respondWithResult(_0x174130,null))['catch'](handleError(_0x174130,null));};exports[_0x6b01('0x103')]=function(_0x3db9dd,_0x41fee4){var _0x39c796={};var _0x12b7e8={};var _0x41029d;var _0x47d960;return db['User']['findOne']({'where':{'id':_0x3db9dd[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x41fee4,null))[_0x6b01('0xf')](function(_0x1b633e){if(_0x1b633e){_0x41029d=_0x1b633e;_0x12b7e8[_0x6b01('0x4c')]=_['keys'](db[_0x6b01('0x104')][_0x6b01('0x35')]);_0x12b7e8[_0x6b01('0x3d')]=_['keys'](_0x3db9dd[_0x6b01('0x3d')]);_0x12b7e8['filters']=_[_0x6b01('0x4f')](_0x12b7e8[_0x6b01('0x4c')],_0x12b7e8[_0x6b01('0x3d')]);_0x39c796[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x12b7e8[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x3db9dd['query'][_0x6b01('0x50')]));_0x39c796[_0x6b01('0x40')]=_0x39c796[_0x6b01('0x40')][_0x6b01('0x44')]?_0x39c796[_0x6b01('0x40')]:_0x12b7e8['model'];_0x39c796[_0x6b01('0xc7')]=qs['sort'](_0x3db9dd[_0x6b01('0x3d')][_0x6b01('0xbd')]);_0x39c796[_0x6b01('0x3b')]=qs['filters'](_[_0x6b01('0xbe')](_0x3db9dd[_0x6b01('0x3d')],_0x12b7e8[_0x6b01('0x4e')]));if(_0x3db9dd[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x39c796[_0x6b01('0x3b')]=_['merge'](_0x39c796['where'],{'$or':_[_0x6b01('0x2a')](_0x39c796[_0x6b01('0x40')],function(_0x126168){var _0x1ea4d7={};_0x1ea4d7[_0x126168]={'$like':'%'+_0x3db9dd[_0x6b01('0x3d')][_0x6b01('0x39')]+'%'};return _0x1ea4d7;})});}_0x39c796=_[_0x6b01('0xbf')]({},_0x39c796,_0x3db9dd[_0x6b01('0x51')]);return _0x41029d[_0x6b01('0x103')](_0x39c796);}})[_0x6b01('0xf')](function(_0x5d0aa8){if(_0x5d0aa8){_0x47d960=_0x5d0aa8[_0x6b01('0x44')];if(!_0x3db9dd['query']['hasOwnProperty'](_0x6b01('0xc5'))){_0x39c796[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x3db9dd[_0x6b01('0x3d')][_0x6b01('0x1e')]);_0x39c796[_0x6b01('0x1c')]=qs[_0x6b01('0x1c')](_0x3db9dd[_0x6b01('0x3d')][_0x6b01('0x1c')]);}return _0x41029d[_0x6b01('0x103')](_0x39c796);}})[_0x6b01('0xf')](function(_0x1ea6a0){if(_0x1ea6a0){return _0x1ea6a0?{'count':_0x47d960,'rows':_0x1ea6a0}:null;}})[_0x6b01('0xf')](respondWithResult(_0x41fee4,null))[_0x6b01('0x17')](handleError(_0x41fee4,null));};exports[_0x6b01('0x105')]=function(_0x332030,_0x2dc0d8){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x332030['params']['id']}})['then'](handleEntityNotFound(_0x2dc0d8,null))['then'](function(_0x60e63f){if(_0x60e63f){var _0x336fa2=_0x60e63f[_0x6b01('0x23')]({'plain':!![]});return _0x60e63f[_0x6b01('0x105')](_0x332030[_0x6b01('0x55')]['ids'],_[_0x6b01('0x59')](_0x332030['body'],[_0x6b01('0x5a'),'id'])||{})[_0x6b01('0xf')](function(){for(var _0x743e53=0x0;_0x743e53<_0x332030[_0x6b01('0x55')][_0x6b01('0x5a')][_0x6b01('0x44')];_0x743e53++){var _0x24c54a=[];var _0x2538c9={};db['Team'][_0x6b01('0x8a')]({'where':{'id':_0x332030[_0x6b01('0x55')][_0x6b01('0x5a')][_0x743e53]}})[_0x6b01('0xf')](function(_0x198323){_0x2538c9=_0x198323[_0x6b01('0x46')];_0x24c54a[_0x6b01('0x47')](_0x198323[_0x6b01('0xe9')]()[_0x6b01('0xf')](function(_0x332748){for(var _0x2c1df7=0x0;_0x2c1df7<_0x332748[_0x6b01('0x44')];_0x2c1df7++){_0x332748[_0x2c1df7][_0x6b01('0x106')]('channel',_0x6b01('0x107'));}return _0x332748;}));_0x24c54a['push'](_0x198323['getChatQueues']()[_0x6b01('0xf')](function(_0x1135ca){for(var _0x1ccc3b=0x0;_0x1ccc3b<_0x1135ca[_0x6b01('0x44')];_0x1ccc3b++){_0x1135ca[_0x1ccc3b]['setDataValue'](_0x6b01('0x91'),_0x6b01('0x108'));}return _0x1135ca;}));_0x24c54a[_0x6b01('0x47')](_0x198323[_0x6b01('0x109')]()[_0x6b01('0xf')](function(_0x1a72ee){for(var _0x55ea59=0x0;_0x55ea59<_0x1a72ee['length'];_0x55ea59++){_0x1a72ee[_0x55ea59][_0x6b01('0x106')](_0x6b01('0x91'),_0x6b01('0x10a'));}return _0x1a72ee;}));_0x24c54a[_0x6b01('0x47')](_0x198323[_0x6b01('0x10b')]()[_0x6b01('0xf')](function(_0x557477){for(var _0x576d05=0x0;_0x576d05<_0x557477[_0x6b01('0x44')];_0x576d05++){_0x557477[_0x576d05][_0x6b01('0x106')](_0x6b01('0x91'),'Sms');}return _0x557477;}));_0x24c54a[_0x6b01('0x47')](_0x198323[_0x6b01('0x10c')]()[_0x6b01('0xf')](function(_0x175825){for(var _0x3977a1=0x0;_0x3977a1<_0x175825['length'];_0x3977a1++){_0x175825[_0x3977a1][_0x6b01('0x106')]('channel',_0x6b01('0x10d'));}return _0x175825;}));_0x24c54a['push'](_0x198323['getFaxQueues']()[_0x6b01('0xf')](function(_0x3a44d7){for(var _0x1bce10=0x0;_0x1bce10<_0x3a44d7[_0x6b01('0x44')];_0x1bce10++){_0x3a44d7[_0x1bce10][_0x6b01('0x106')]('channel','Fax');}return _0x3a44d7;}));_0x24c54a['push'](_0x198323[_0x6b01('0x10e')]()[_0x6b01('0xf')](function(_0x42b16a){for(var _0x17fa24=0x0;_0x17fa24<_0x42b16a[_0x6b01('0x44')];_0x17fa24++){_0x42b16a[_0x17fa24][_0x6b01('0x106')](_0x6b01('0x91'),_0x6b01('0x10f'));}return _0x42b16a;}));return BPromise['all'](_0x24c54a);})[_0x6b01('0xf')](function(_0x4ddd28){var _0x1de2c7=_[_0x6b01('0x110')](_0x4ddd28);_0x24c54a=[];return db[_0x6b01('0x62')][_0x6b01('0x111')](function(_0x2e77a3){for(var _0x227435=0x0;_0x227435<_0x1de2c7['length'];_0x227435++){_0x24c54a['push'](_0x1de2c7[_0x227435][_0x6b01('0x112')](_0x336fa2['id']),{'transaction':_0x2e77a3});}return BPromise[_0x6b01('0x4b')](_0x24c54a)['then'](function(){if(_0x336fa2[_0x6b01('0x92')]){return BPromise['each'](_[_0x6b01('0x39')](_0x1de2c7,function(_0x392e8e){return _0x392e8e[_0x6b01('0x113')](_0x6b01('0x91'))===_0x6b01('0x107');}),function(_0x459fbf){return db[_0x6b01('0xa6')][_0x6b01('0xeb')]({'membername':_0x336fa2['name'],'UserId':_0x336fa2['id'],'queue_name':_0x459fbf[_0x6b01('0x32')],'VoiceQueueId':_0x459fbf['id'],'interface':_['isNil'](_0x336fa2[_0x6b01('0x95')])?util[_0x6b01('0x9f')](_0x6b01('0xa0'),_0x336fa2[_0x6b01('0x32')]):_0x336fa2[_0x6b01('0x95')],'paused':_0x336fa2['voicePause']||![],'penalty':_0x336fa2[_0x6b01('0x114')]},{'transaction':_0x2e77a3});});}else{return;}})[_0x6b01('0xf')](function(){for(var _0x2df36a=0x0;_0x2df36a<_0x1de2c7[_0x6b01('0x44')];_0x2df36a++){var _0x263dcf=_0x1de2c7[_0x2df36a][_0x6b01('0x113')](_0x6b01('0x91'));var _0x18841e=_0x263dcf+'QueueId';socket[_0x6b01('0xa4')](_0x6b01('0x26')+_0x263dcf+_0x6b01('0x115'),{'UserId':_0x336fa2['id'],['queueField']:_0x1de2c7[_0x2df36a]['id']});}});});})[_0x6b01('0xf')](function(){db[_0x6b01('0x116')][_0x6b01('0x8a')]({'where':{'teamId':_0x2538c9['id']}})[_0x6b01('0xf')](function(_0xb8a717){if(_0xb8a717){db[_0x6b01('0x117')][_0x6b01('0x75')]({'UserId':_0x332030[_0x6b01('0x56')]['id'],'VoicePrefixId':_0xb8a717[_0x6b01('0x118')]});}});});}});}})[_0x6b01('0xf')](respondWithStatusCode(_0x2dc0d8,null))[_0x6b01('0x17')](handleError(_0x2dc0d8,null));};exports['removeTeams']=function(_0x27c681,_0x3f405f){return db['User'][_0x6b01('0x8a')]({'where':{'id':_0x27c681['params']['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x3f405f,null))[_0x6b01('0xf')](function(_0x31d65c){if(_0x31d65c){var _0x4175d6=_0x31d65c[_0x6b01('0x23')]({'plain':!![]});var _0x1fd628=_0x27c681[_0x6b01('0x3d')][_0x6b01('0x5a')];return _0x31d65c[_0x6b01('0x119')](_0x1fd628)['then'](function(){for(var _0x3e850f=0x0;_0x3e850f<_0x1fd628[_0x6b01('0x44')];_0x3e850f++){var _0x5a985d=[];var _0x1a7b5d={};db[_0x6b01('0x104')][_0x6b01('0x8a')]({'where':{'id':_0x1fd628[_0x3e850f]}})[_0x6b01('0xf')](function(_0x4c00d8){_0x1a7b5d=_0x4c00d8['dataValues'];_0x5a985d[_0x6b01('0x47')](_0x4c00d8[_0x6b01('0xe9')]()[_0x6b01('0xf')](function(_0x4296b){for(var _0x4885b1=0x0;_0x4885b1<_0x4296b[_0x6b01('0x44')];_0x4885b1++){_0x4296b[_0x4885b1]['setDataValue'](_0x6b01('0x91'),_0x6b01('0x107'));}return _0x4296b;}));_0x5a985d[_0x6b01('0x47')](_0x4c00d8[_0x6b01('0x11a')]()[_0x6b01('0xf')](function(_0x4bce89){for(var _0x4fbad0=0x0;_0x4fbad0<_0x4bce89[_0x6b01('0x44')];_0x4fbad0++){_0x4bce89[_0x4fbad0][_0x6b01('0x106')](_0x6b01('0x91'),_0x6b01('0x108'));}return _0x4bce89;}));_0x5a985d[_0x6b01('0x47')](_0x4c00d8[_0x6b01('0x109')]()[_0x6b01('0xf')](function(_0x4e74de){for(var _0x269276=0x0;_0x269276<_0x4e74de[_0x6b01('0x44')];_0x269276++){_0x4e74de[_0x269276][_0x6b01('0x106')](_0x6b01('0x91'),_0x6b01('0x10a'));}return _0x4e74de;}));_0x5a985d['push'](_0x4c00d8[_0x6b01('0x10b')]()[_0x6b01('0xf')](function(_0x54047b){for(var _0x5a73eb=0x0;_0x5a73eb<_0x54047b[_0x6b01('0x44')];_0x5a73eb++){_0x54047b[_0x5a73eb]['setDataValue'](_0x6b01('0x91'),_0x6b01('0x11b'));}return _0x54047b;}));_0x5a985d['push'](_0x4c00d8['getWhatsappQueues']()[_0x6b01('0xf')](function(_0x324352){for(var _0x384ff5=0x0;_0x384ff5<_0x324352[_0x6b01('0x44')];_0x384ff5++){_0x324352[_0x384ff5][_0x6b01('0x106')](_0x6b01('0x91'),_0x6b01('0x10d'));}return _0x324352;}));_0x5a985d[_0x6b01('0x47')](_0x4c00d8['getFaxQueues']()['then'](function(_0x3dd6fb){for(var _0x1f39f0=0x0;_0x1f39f0<_0x3dd6fb[_0x6b01('0x44')];_0x1f39f0++){_0x3dd6fb[_0x1f39f0][_0x6b01('0x106')](_0x6b01('0x91'),_0x6b01('0x11c'));}return _0x3dd6fb;}));_0x5a985d[_0x6b01('0x47')](_0x4c00d8[_0x6b01('0x10e')]()['then'](function(_0x2673fc){for(var _0x41bc19=0x0;_0x41bc19<_0x2673fc[_0x6b01('0x44')];_0x41bc19++){_0x2673fc[_0x41bc19][_0x6b01('0x106')](_0x6b01('0x91'),_0x6b01('0x10f'));}return _0x2673fc;}));return BPromise[_0x6b01('0x4b')](_0x5a985d);})[_0x6b01('0xf')](function(_0x5e98e9){var _0x516d02=_[_0x6b01('0x110')](_0x5e98e9);_0x5a985d=[];return db[_0x6b01('0x62')][_0x6b01('0x111')](function(_0x15b2a8){for(var _0x51aca6=0x0;_0x51aca6<_0x516d02[_0x6b01('0x44')];_0x51aca6++){_0x5a985d[_0x6b01('0x47')](_0x516d02[_0x51aca6][_0x6b01('0x11d')](_0x4175d6['id']),{'transaction':_0x15b2a8});}return BPromise[_0x6b01('0x4b')](_0x5a985d)['then'](function(){if(_0x4175d6['online']){return BPromise[_0x6b01('0x7f')](_[_0x6b01('0x39')](_0x516d02,function(_0x51034a){return _0x51034a['getDataValue'](_0x6b01('0x91'))===_0x6b01('0x107');}),function(_0x549251){return db[_0x6b01('0xa6')]['destroy']({'where':{'VoiceQueueId':_0x549251['id'],'UserId':_0x4175d6['id']},'transaction':_0x15b2a8});});}else{return;}})['then'](function(){db[_0x6b01('0x116')][_0x6b01('0x8a')]({'where':{'teamId':_0x1a7b5d['id']}})['then'](function(_0x418c24){if(_0x418c24){return db[_0x6b01('0x117')][_0x6b01('0x30')]({'where':{'UserId':_0x4175d6['id'],'VoicePrefixId':_0x418c24[_0x6b01('0x46')][_0x6b01('0x118')]}});}});})['then'](function(){for(var _0xe41cdd=0x0;_0xe41cdd<_0x516d02[_0x6b01('0x44')];_0xe41cdd++){var _0x487a1f=_0x516d02[_0xe41cdd][_0x6b01('0x113')](_0x6b01('0x91'));var _0x18b76c=_0x487a1f+'QueueId';socket['emit'](_0x6b01('0x26')+_0x487a1f+_0x6b01('0xa5'),{'UserId':_0x4175d6['id'],['queueField']:_0x516d02[_0xe41cdd]['id']});}});});});}});}})[_0x6b01('0xf')](respondWithStatusCode(_0x3f405f,null))['catch'](handleError(_0x3f405f,null));};exports[_0x6b01('0x11e')]=function(_0x1954f6,_0x34b307){var _0x31f592={};var _0x105973={};var _0x5d9402;var _0x4a3fb5;return db['User'][_0x6b01('0x8a')]({'where':{'id':_0x1954f6['params']['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x34b307,null))[_0x6b01('0xf')](function(_0xbc554c){if(_0xbc554c){_0x5d9402=_0xbc554c;_0x105973['model']=_[_0x6b01('0x4d')](db[_0x6b01('0xc1')][_0x6b01('0x35')]);_0x105973['query']=_['keys'](_0x1954f6[_0x6b01('0x3d')]);_0x105973[_0x6b01('0x4e')]=_['intersection'](_0x105973['model'],_0x105973[_0x6b01('0x3d')]);_0x31f592[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x105973[_0x6b01('0x4c')],qs['fields'](_0x1954f6[_0x6b01('0x3d')]['fields']));_0x31f592[_0x6b01('0x40')]=_0x31f592[_0x6b01('0x40')][_0x6b01('0x44')]?_0x31f592[_0x6b01('0x40')]:_0x105973[_0x6b01('0x4c')];_0x31f592[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0x1954f6[_0x6b01('0x3d')][_0x6b01('0xbd')]);_0x31f592[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x1954f6[_0x6b01('0x3d')],_0x105973['filters']));if(_0x1954f6[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x31f592[_0x6b01('0x3b')]=_['merge'](_0x31f592[_0x6b01('0x3b')],{'$or':_[_0x6b01('0x2a')](_0x31f592['attributes'],function(_0x17f0c1){var _0x4b7d87={};_0x4b7d87[_0x17f0c1]={'$like':'%'+_0x1954f6['query'][_0x6b01('0x39')]+'%'};return _0x4b7d87;})});}_0x31f592=_[_0x6b01('0xbf')]({},_0x31f592,_0x1954f6['options']);return _0x5d9402[_0x6b01('0x11e')](_0x31f592);}})[_0x6b01('0xf')](function(_0x24f78d){if(_0x24f78d){_0x4a3fb5=_0x24f78d['length'];if(!_0x1954f6['query']['hasOwnProperty'](_0x6b01('0xc5'))){_0x31f592[_0x6b01('0x1e')]=qs['limit'](_0x1954f6[_0x6b01('0x3d')]['limit']);_0x31f592[_0x6b01('0x1c')]=qs[_0x6b01('0x1c')](_0x1954f6[_0x6b01('0x3d')][_0x6b01('0x1c')]);}return _0x5d9402['getLists'](_0x31f592);}})[_0x6b01('0xf')](function(_0x57fe8c){if(_0x57fe8c){return _0x57fe8c?{'count':_0x4a3fb5,'rows':_0x57fe8c}:null;}})[_0x6b01('0xf')](respondWithResult(_0x34b307,null))['catch'](handleError(_0x34b307,null));};exports[_0x6b01('0x11f')]=function(_0x2217aa,_0x57c71a){var _0x43e8d1={};var _0xdb77f8={};var _0x199b56;var _0x4d430b;return db[_0x6b01('0x3c')][_0x6b01('0x8a')]({'where':{'id':_0x2217aa[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x57c71a,null))[_0x6b01('0xf')](function(_0x1f7c3a){if(_0x1f7c3a){_0x199b56=_0x1f7c3a;_0xdb77f8[_0x6b01('0x4c')]=_['keys'](db['User']['rawAttributes']);_0xdb77f8[_0x6b01('0x3d')]=_[_0x6b01('0x4d')](_0x2217aa[_0x6b01('0x3d')]);_0xdb77f8[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0xdb77f8[_0x6b01('0x4c')],_0xdb77f8[_0x6b01('0x3d')]);_0x43e8d1[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0xdb77f8[_0x6b01('0x4c')],qs['fields'](_0x2217aa[_0x6b01('0x3d')]['fields']));_0x43e8d1[_0x6b01('0x40')]=_0x43e8d1[_0x6b01('0x40')][_0x6b01('0x44')]?_0x43e8d1['attributes']:_0xdb77f8[_0x6b01('0x4c')];_0x43e8d1[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0x2217aa[_0x6b01('0x3d')][_0x6b01('0xbd')]);_0x43e8d1[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x2217aa['query'],_0xdb77f8[_0x6b01('0x4e')]));if(_0x2217aa[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x43e8d1['where']=_[_0x6b01('0xbf')](_0x43e8d1[_0x6b01('0x3b')],{'$or':_[_0x6b01('0x2a')](_0x43e8d1[_0x6b01('0x40')],function(_0x30a49b){var _0x53526e={};_0x53526e[_0x30a49b]={'$like':'%'+_0x2217aa[_0x6b01('0x3d')]['filter']+'%'};return _0x53526e;})});}_0x43e8d1[_0x6b01('0x4c')]=db[_0x6b01('0x3c')];_0x43e8d1['as']=_0x6b01('0x27');_0x43e8d1=_[_0x6b01('0xbf')]({},_0x43e8d1,_0x2217aa[_0x6b01('0x51')]);return _0x199b56[_0x6b01('0xe9')]({'include':[_0x43e8d1]});}})[_0x6b01('0xf')](function(_0x3cdd4f){if(_0x3cdd4f){var _0x585135={},_0x15c158=[],_0x4a72b6=0x0;for(var _0x4a1659=0x0;_0x4a1659<_0x3cdd4f[_0x6b01('0x44')];_0x4a1659+=0x1){for(var _0x21628e=0x0,_0x24709b;_0x21628e<_0x3cdd4f[_0x4a1659][_0x6b01('0x27')][_0x6b01('0x44')];_0x21628e+=0x1){_0x24709b=_0x3cdd4f[_0x4a1659]['Agents'][_0x21628e][_0x6b01('0x23')]({'plain':!![]});_0x585135[_0x24709b['id']]=_0x24709b;}}_0x585135=_['values'](_0x585135);for(var _0x52814b=qs['offset'](_0x2217aa['query'][_0x6b01('0x1c')]);_0x52814b<_0x585135[_0x6b01('0x44')]&&_0x15c158[_0x6b01('0x44')]<qs['limit'](_0x2217aa['query'][_0x6b01('0x1e')]);_0x52814b+=0x1){if(_0x585135[_0x52814b]){_0x15c158[_0x6b01('0x47')](_0x585135[_0x52814b]);}}return{'count':_0x585135[_0x6b01('0x44')],'rows':_0x15c158};}})['then'](respondWithResult(_0x57c71a,null))[_0x6b01('0x17')](handleError(_0x57c71a,null));};exports[_0x6b01('0x30')]=function(_0x3817fb,_0x27de60){if(_0x3817fb['user']['id']==_0x3817fb['params']['id']){return _0x27de60['status'](0x1f4)[_0x6b01('0x33')]({'message':_0x6b01('0x120')});}return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x3817fb[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x27de60,null))['then'](removeEntity(_0x27de60,null))['catch'](handleError(_0x27de60,null));};exports[_0x6b01('0x121')]=function(_0x7f2440,_0x19adb6){return db['User'][_0x6b01('0x2e')]({'where':{'id':_0x7f2440[_0x6b01('0x56')]['id']}})['then'](handleEntityNotFound(_0x19adb6,null))[_0x6b01('0xf')](function(_0x4cab66){if(_0x4cab66){return _0x4cab66[_0x6b01('0x121')](_0x7f2440['body'][_0x6b01('0x5a')],_['omit'](_0x7f2440[_0x6b01('0x55')],['ids','id'])||{})[_0x6b01('0x9b')](function(){for(var _0x5db868=0x0;_0x5db868<_0x7f2440[_0x6b01('0x55')][_0x6b01('0x5a')][_0x6b01('0x44')];_0x5db868+=0x1){socket['emit'](_0x6b01('0x122'),{'ChatInteractionId':Number(_0x7f2440[_0x6b01('0x55')][_0x6b01('0x5a')][_0x5db868]),'UserId':Number(_0x7f2440['params']['id'])});}return _0x7f2440['body'][_0x6b01('0x5a')];});}})[_0x6b01('0xf')](respondWithResult(_0x19adb6,null))[_0x6b01('0x17')](handleError(_0x19adb6,null));};exports[_0x6b01('0x123')]=function(_0x41b92e,_0x124db5){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x41b92e[_0x6b01('0x56')]['id']}})['then'](handleEntityNotFound(_0x124db5,null))[_0x6b01('0xf')](function(_0x411074){if(_0x411074){return _0x411074[_0x6b01('0x123')](_0x41b92e['query']['ids'])[_0x6b01('0xf')](function(){if(_['isArray'](_0x41b92e[_0x6b01('0x3d')][_0x6b01('0x5a')])){for(var _0x48a902=0x0;_0x48a902<_0x41b92e[_0x6b01('0x3d')]['ids'][_0x6b01('0x44')];_0x48a902+=0x1){socket[_0x6b01('0xa4')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x41b92e['query']['ids'][_0x48a902]),'UserId':Number(_0x41b92e[_0x6b01('0x56')]['id'])});}}else{socket['emit'](_0x6b01('0x124'),{'ChatInteractionId':Number(_0x41b92e[_0x6b01('0x3d')][_0x6b01('0x5a')]),'UserId':Number(_0x41b92e[_0x6b01('0x56')]['id'])});}});}})[_0x6b01('0xf')](respondWithStatusCode(_0x124db5,null))[_0x6b01('0x17')](handleError(_0x124db5,null));};exports[_0x6b01('0x125')]=function(_0x4bd0a3,_0x59f12){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x4bd0a3['params']['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x59f12,null))[_0x6b01('0xf')](function(_0x3832d1){if(_0x3832d1){return _0x3832d1[_0x6b01('0x125')](_0x4bd0a3['body'][_0x6b01('0x5a')],_['omit'](_0x4bd0a3[_0x6b01('0x55')],['ids','id'])||{})['spread'](function(){for(var _0x513965=0x0;_0x513965<_0x4bd0a3[_0x6b01('0x55')][_0x6b01('0x5a')][_0x6b01('0x44')];_0x513965+=0x1){socket[_0x6b01('0xa4')](_0x6b01('0x126'),{'MailInteractionId':Number(_0x4bd0a3['body']['ids'][_0x513965]),'UserId':Number(_0x4bd0a3[_0x6b01('0x56')]['id'])});}return _0x4bd0a3[_0x6b01('0x55')][_0x6b01('0x5a')];});}})[_0x6b01('0xf')](respondWithResult(_0x59f12,null))['catch'](handleError(_0x59f12,null));};exports[_0x6b01('0x127')]=function(_0x2b1223,_0x263ad1){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x2b1223['params']['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x263ad1,null))[_0x6b01('0xf')](function(_0x1b7932){if(_0x1b7932){return _0x1b7932[_0x6b01('0x127')](_0x2b1223['query']['ids'])['then'](function(){if(_[_0x6b01('0xa3')](_0x2b1223[_0x6b01('0x3d')]['ids'])){for(var _0x131ef2=0x0;_0x131ef2<_0x2b1223[_0x6b01('0x3d')]['ids'][_0x6b01('0x44')];_0x131ef2+=0x1){socket[_0x6b01('0xa4')](_0x6b01('0x128'),{'MailInteractionId':Number(_0x2b1223['query'][_0x6b01('0x5a')][_0x131ef2]),'UserId':Number(_0x2b1223[_0x6b01('0x56')]['id'])});}}else{socket[_0x6b01('0xa4')](_0x6b01('0x128'),{'MailInteractionId':Number(_0x2b1223[_0x6b01('0x3d')][_0x6b01('0x5a')]),'UserId':Number(_0x2b1223[_0x6b01('0x56')]['id'])});}});}})[_0x6b01('0xf')](respondWithStatusCode(_0x263ad1,null))[_0x6b01('0x17')](handleError(_0x263ad1,null));};exports[_0x6b01('0x129')]=function(_0x3ce9cf,_0x43aea4){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x3ce9cf[_0x6b01('0x56')]['id']}})['then'](handleEntityNotFound(_0x43aea4,null))[_0x6b01('0xf')](function(_0x12e991){if(_0x12e991){return _0x12e991['addFaxInteractions'](_0x3ce9cf['body'][_0x6b01('0x5a')],_[_0x6b01('0x59')](_0x3ce9cf[_0x6b01('0x55')],['ids','id'])||{})[_0x6b01('0x9b')](function(){for(var _0x4e17b1=0x0;_0x4e17b1<_0x3ce9cf['body'][_0x6b01('0x5a')]['length'];_0x4e17b1+=0x1){socket['emit'](_0x6b01('0x12a'),{'FaxInteractionId':Number(_0x3ce9cf[_0x6b01('0x55')][_0x6b01('0x5a')][_0x4e17b1]),'UserId':Number(_0x3ce9cf[_0x6b01('0x56')]['id'])});}return _0x3ce9cf['body']['ids'];});}})[_0x6b01('0xf')](respondWithResult(_0x43aea4,null))[_0x6b01('0x17')](handleError(_0x43aea4,null));};exports['removeFaxInteractions']=function(_0x3bb2d1,_0x28b9d1){return db['User'][_0x6b01('0x2e')]({'where':{'id':_0x3bb2d1[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x28b9d1,null))[_0x6b01('0xf')](function(_0x20941f){if(_0x20941f){return _0x20941f['removeFaxInteractions'](_0x3bb2d1[_0x6b01('0x3d')][_0x6b01('0x5a')])['then'](function(){if(_[_0x6b01('0xa3')](_0x3bb2d1[_0x6b01('0x3d')][_0x6b01('0x5a')])){for(var _0x84587f=0x0;_0x84587f<_0x3bb2d1['query'][_0x6b01('0x5a')]['length'];_0x84587f+=0x1){socket[_0x6b01('0xa4')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x3bb2d1[_0x6b01('0x3d')]['ids'][_0x84587f]),'UserId':Number(_0x3bb2d1[_0x6b01('0x56')]['id'])});}}else{socket['emit'](_0x6b01('0x12b'),{'FaxInteractionId':Number(_0x3bb2d1[_0x6b01('0x3d')][_0x6b01('0x5a')]),'UserId':Number(_0x3bb2d1[_0x6b01('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x28b9d1,null))[_0x6b01('0x17')](handleError(_0x28b9d1,null));};exports[_0x6b01('0x12c')]=function(_0x8e9750,_0x5847e5){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x8e9750[_0x6b01('0x56')]['id']}})['then'](handleEntityNotFound(_0x5847e5,null))[_0x6b01('0xf')](function(_0x18e0f4){if(_0x18e0f4){return _0x18e0f4[_0x6b01('0x12c')](_0x8e9750[_0x6b01('0x55')][_0x6b01('0x5a')],_[_0x6b01('0x59')](_0x8e9750['body'],[_0x6b01('0x5a'),'id'])||{})[_0x6b01('0x9b')](function(){for(var _0x2aee23=0x0;_0x2aee23<_0x8e9750[_0x6b01('0x55')][_0x6b01('0x5a')][_0x6b01('0x44')];_0x2aee23+=0x1){socket[_0x6b01('0xa4')]('user_has_sms_interactions:save',{'SmsInteractionId':Number(_0x8e9750[_0x6b01('0x55')][_0x6b01('0x5a')][_0x2aee23]),'UserId':Number(_0x8e9750[_0x6b01('0x56')]['id'])});}return _0x8e9750[_0x6b01('0x55')][_0x6b01('0x5a')];});}})[_0x6b01('0xf')](respondWithResult(_0x5847e5,null))['catch'](handleError(_0x5847e5,null));};exports[_0x6b01('0x12d')]=function(_0x357943,_0x57b659){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x357943['params']['id']}})['then'](handleEntityNotFound(_0x57b659,null))['then'](function(_0xc05b2d){if(_0xc05b2d){return _0xc05b2d[_0x6b01('0x12d')](_0x357943[_0x6b01('0x3d')][_0x6b01('0x5a')])[_0x6b01('0xf')](function(){if(_[_0x6b01('0xa3')](_0x357943[_0x6b01('0x3d')]['ids'])){for(var _0x101555=0x0;_0x101555<_0x357943[_0x6b01('0x3d')][_0x6b01('0x5a')][_0x6b01('0x44')];_0x101555+=0x1){socket[_0x6b01('0xa4')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x357943[_0x6b01('0x3d')][_0x6b01('0x5a')][_0x101555]),'UserId':Number(_0x357943[_0x6b01('0x56')]['id'])});}}else{socket[_0x6b01('0xa4')](_0x6b01('0x12e'),{'SmsInteractionId':Number(_0x357943['query'][_0x6b01('0x5a')]),'UserId':Number(_0x357943['params']['id'])});}});}})['then'](respondWithStatusCode(_0x57b659,null))[_0x6b01('0x17')](handleError(_0x57b659,null));};exports[_0x6b01('0x12f')]=function(_0x574489,_0x4a08b5){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x574489[_0x6b01('0x56')]['id']}})['then'](handleEntityNotFound(_0x4a08b5,null))[_0x6b01('0xf')](function(_0x53d7be){if(_0x53d7be){return _0x53d7be[_0x6b01('0x12f')](_0x574489[_0x6b01('0x55')]['ids'],_[_0x6b01('0x59')](_0x574489['body'],[_0x6b01('0x5a'),'id'])||{})['spread'](function(){for(var _0x4b2b00=0x0;_0x4b2b00<_0x574489[_0x6b01('0x55')]['ids'][_0x6b01('0x44')];_0x4b2b00+=0x1){socket[_0x6b01('0xa4')](_0x6b01('0x130'),{'OpenchannelInteractionId':Number(_0x574489[_0x6b01('0x55')][_0x6b01('0x5a')][_0x4b2b00]),'UserId':Number(_0x574489[_0x6b01('0x56')]['id'])});}return _0x574489[_0x6b01('0x55')][_0x6b01('0x5a')];});}})['then'](respondWithResult(_0x4a08b5,null))['catch'](handleError(_0x4a08b5,null));};exports[_0x6b01('0x131')]=function(_0x4c632d,_0x1de2cf){return db['User'][_0x6b01('0x2e')]({'where':{'id':_0x4c632d[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x1de2cf,null))['then'](function(_0x6603bc){if(_0x6603bc){return _0x6603bc[_0x6b01('0x131')](_0x4c632d['query']['ids'])[_0x6b01('0xf')](function(){if(_[_0x6b01('0xa3')](_0x4c632d[_0x6b01('0x3d')][_0x6b01('0x5a')])){for(var _0x24cc30=0x0;_0x24cc30<_0x4c632d['query'][_0x6b01('0x5a')][_0x6b01('0x44')];_0x24cc30+=0x1){socket[_0x6b01('0xa4')](_0x6b01('0x132'),{'OpenchannelInteractionId':Number(_0x4c632d[_0x6b01('0x3d')][_0x6b01('0x5a')][_0x24cc30]),'UserId':Number(_0x4c632d[_0x6b01('0x56')]['id'])});}}else{socket[_0x6b01('0xa4')](_0x6b01('0x132'),{'OpenchannelInteractionId':Number(_0x4c632d[_0x6b01('0x3d')][_0x6b01('0x5a')]),'UserId':Number(_0x4c632d[_0x6b01('0x56')]['id'])});}});}})[_0x6b01('0xf')](respondWithStatusCode(_0x1de2cf,null))[_0x6b01('0x17')](handleError(_0x1de2cf,null));};exports['addWhatsappInteractions']=function(_0x2343d,_0x27faca){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x2343d[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x27faca,null))[_0x6b01('0xf')](function(_0x1c9a30){if(_0x1c9a30){return _0x1c9a30[_0x6b01('0x133')](_0x2343d[_0x6b01('0x55')]['ids'],_[_0x6b01('0x59')](_0x2343d[_0x6b01('0x55')],[_0x6b01('0x5a'),'id'])||{})['spread'](function(){for(var _0x3e8cf8=0x0;_0x3e8cf8<_0x2343d[_0x6b01('0x55')][_0x6b01('0x5a')][_0x6b01('0x44')];_0x3e8cf8+=0x1){socket['emit'](_0x6b01('0x134'),{'WhatsappInteractionId':Number(_0x2343d[_0x6b01('0x55')][_0x6b01('0x5a')][_0x3e8cf8]),'UserId':Number(_0x2343d[_0x6b01('0x56')]['id'])});}return _0x2343d['body'][_0x6b01('0x5a')];});}})['then'](respondWithResult(_0x27faca,null))[_0x6b01('0x17')](handleError(_0x27faca,null));};exports[_0x6b01('0x135')]=function(_0x48821a,_0x21b4b6){return db['User']['find']({'where':{'id':_0x48821a[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x21b4b6,null))['then'](function(_0x3c2f3e){if(_0x3c2f3e){return _0x3c2f3e[_0x6b01('0x135')](_0x48821a[_0x6b01('0x3d')][_0x6b01('0x5a')]);}})[_0x6b01('0xf')](respondWithStatusCode(_0x21b4b6,null))[_0x6b01('0x17')](handleError(_0x21b4b6,null));};exports[_0x6b01('0x136')]=function(_0x4b0781,_0x4062d2){var _0x29a46d={};var _0x58828d={};var _0x2341e9;var _0x116ef9;return db[_0x6b01('0x3c')][_0x6b01('0x8a')]({'where':{'id':_0x4b0781[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x4062d2,null))[_0x6b01('0xf')](function(_0x1450d6){if(_0x1450d6){_0x2341e9=_0x1450d6;_0x58828d[_0x6b01('0x4c')]=_['keys'](db[_0x6b01('0x137')]['rawAttributes']);_0x58828d[_0x6b01('0x3d')]=_[_0x6b01('0x4d')](_0x4b0781[_0x6b01('0x3d')]);_0x58828d['filters']=_['intersection'](_0x58828d[_0x6b01('0x4c')],_0x58828d['query']);_0x29a46d[_0x6b01('0x40')]=_['intersection'](_0x58828d[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x4b0781[_0x6b01('0x3d')][_0x6b01('0x50')]));_0x29a46d[_0x6b01('0x40')]=_0x29a46d[_0x6b01('0x40')]['length']?_0x29a46d[_0x6b01('0x40')]:_0x58828d[_0x6b01('0x4c')];_0x29a46d['order']=qs[_0x6b01('0xbd')](_0x4b0781[_0x6b01('0x3d')]['sort']);_0x29a46d[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x4b0781[_0x6b01('0x3d')],_0x58828d[_0x6b01('0x4e')]));if(_0x4b0781[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x29a46d['where']=_[_0x6b01('0xbf')](_0x29a46d['where'],{'$or':_[_0x6b01('0x2a')](_0x29a46d[_0x6b01('0x40')],function(_0x5b8d50){var _0x456bdd={};_0x456bdd[_0x5b8d50]={'$like':'%'+_0x4b0781['query'][_0x6b01('0x39')]+'%'};return _0x456bdd;})});}_0x29a46d=_[_0x6b01('0xbf')]({},_0x29a46d,_0x4b0781['options']);return _0x2341e9[_0x6b01('0x136')](_0x29a46d);}})[_0x6b01('0xf')](function(_0x75ac8b){if(_0x75ac8b){_0x116ef9=_0x75ac8b[_0x6b01('0x44')];if(!_0x4b0781[_0x6b01('0x3d')]['hasOwnProperty'](_0x6b01('0xc5'))){_0x29a46d[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x4b0781[_0x6b01('0x3d')][_0x6b01('0x1e')]);_0x29a46d[_0x6b01('0x1c')]=qs[_0x6b01('0x1c')](_0x4b0781[_0x6b01('0x3d')][_0x6b01('0x1c')]);}return _0x2341e9[_0x6b01('0x136')](_0x29a46d);}})['then'](function(_0x8e1654){if(_0x8e1654){return _0x8e1654?{'count':_0x116ef9,'rows':_0x8e1654}:null;}})[_0x6b01('0xf')](respondWithResult(_0x4062d2,null))['catch'](handleError(_0x4062d2,null));};exports[_0x6b01('0x138')]=function(_0x100837,_0xa38112){var _0x5959e9={};var _0x237f09={};var _0x4efbaa;var _0x462499;return db['User'][_0x6b01('0x8a')]({'where':{'id':_0x100837['params']['id']}})['then'](handleEntityNotFound(_0xa38112,null))['then'](function(_0xd6313a){if(_0xd6313a){_0x4efbaa=_0xd6313a;_0x237f09[_0x6b01('0x4c')]=_[_0x6b01('0x4d')](db[_0x6b01('0x139')][_0x6b01('0x35')]);_0x237f09['query']=_['keys'](_0x100837['query']);_0x237f09[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0x237f09[_0x6b01('0x4c')],_0x237f09['query']);_0x5959e9[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x237f09[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x100837[_0x6b01('0x3d')][_0x6b01('0x50')]));_0x5959e9[_0x6b01('0x40')]=_0x5959e9['attributes'][_0x6b01('0x44')]?_0x5959e9['attributes']:_0x237f09['model'];_0x5959e9[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0x100837['query'][_0x6b01('0xbd')]);_0x5959e9[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x100837[_0x6b01('0x3d')],_0x237f09['filters']));if(_0x100837['query'][_0x6b01('0x39')]){_0x5959e9[_0x6b01('0x3b')]=_[_0x6b01('0xbf')](_0x5959e9[_0x6b01('0x3b')],{'$or':_[_0x6b01('0x2a')](_0x5959e9[_0x6b01('0x40')],function(_0x27fb79){var _0x36f2ec={};_0x36f2ec[_0x27fb79]={'$like':'%'+_0x100837[_0x6b01('0x3d')][_0x6b01('0x39')]+'%'};return _0x36f2ec;})});}_0x5959e9=_[_0x6b01('0xbf')]({},_0x5959e9,_0x100837[_0x6b01('0x51')]);return _0x4efbaa[_0x6b01('0x138')](_0x5959e9);}})[_0x6b01('0xf')](function(_0x440453){if(_0x440453){_0x462499=_0x440453['length'];if(!_0x100837['query']['hasOwnProperty'](_0x6b01('0xc5'))){_0x5959e9[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x100837[_0x6b01('0x3d')][_0x6b01('0x1e')]);_0x5959e9[_0x6b01('0x1c')]=qs[_0x6b01('0x1c')](_0x100837[_0x6b01('0x3d')]['offset']);}return _0x4efbaa['getFaxAccounts'](_0x5959e9);}})[_0x6b01('0xf')](function(_0x308852){if(_0x308852){return _0x308852?{'count':_0x462499,'rows':_0x308852}:null;}})[_0x6b01('0xf')](respondWithResult(_0xa38112,null))[_0x6b01('0x17')](handleError(_0xa38112,null));};exports[_0x6b01('0x13a')]=function(_0x1d4b06,_0x2eb9a4){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x1d4b06[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x2eb9a4,null))[_0x6b01('0xf')](function(_0x4d3714){if(_0x4d3714){return _0x4d3714[_0x6b01('0x13a')](_0x1d4b06[_0x6b01('0x55')]['ids'],_['omit'](_0x1d4b06[_0x6b01('0x55')],[_0x6b01('0x5a'),'id'])||{});}})['then'](respondWithResult(_0x2eb9a4,null))[_0x6b01('0x17')](handleError(_0x2eb9a4,null));};exports['removeFaxAccounts']=function(_0x211710,_0x4cf51b){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x211710[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x4cf51b,null))[_0x6b01('0xf')](function(_0x84cd2b){if(_0x84cd2b){return _0x84cd2b[_0x6b01('0x13b')](_0x211710[_0x6b01('0x3d')][_0x6b01('0x5a')]);}})[_0x6b01('0xf')](respondWithStatusCode(_0x4cf51b,null))['catch'](handleError(_0x4cf51b,null));};exports['getMailAccounts']=function(_0x11884f,_0x35fbf7){var _0x5cd08c={};var _0x26fbab={};var _0x42093a;var _0x55b3f4;return db['User']['findOne']({'where':{'id':_0x11884f[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x35fbf7,null))[_0x6b01('0xf')](function(_0xd4c3aa){if(_0xd4c3aa){_0x42093a=_0xd4c3aa;_0x26fbab[_0x6b01('0x4c')]=_[_0x6b01('0x4d')](db[_0x6b01('0x13c')][_0x6b01('0x35')]);_0x26fbab[_0x6b01('0x3d')]=_[_0x6b01('0x4d')](_0x11884f[_0x6b01('0x3d')]);_0x26fbab[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0x26fbab[_0x6b01('0x4c')],_0x26fbab['query']);_0x5cd08c[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x26fbab[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x11884f[_0x6b01('0x3d')][_0x6b01('0x50')]));_0x5cd08c['attributes']=_0x5cd08c['attributes'][_0x6b01('0x44')]?_0x5cd08c[_0x6b01('0x40')]:_0x26fbab['model'];_0x5cd08c[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0x11884f[_0x6b01('0x3d')][_0x6b01('0xbd')]);_0x5cd08c[_0x6b01('0x3b')]=qs['filters'](_[_0x6b01('0xbe')](_0x11884f['query'],_0x26fbab[_0x6b01('0x4e')]));if(_0x11884f[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x5cd08c['where']=_[_0x6b01('0xbf')](_0x5cd08c[_0x6b01('0x3b')],{'$or':_['map'](_0x5cd08c['attributes'],function(_0x5e2413){var _0x110884={};_0x110884[_0x5e2413]={'$like':'%'+_0x11884f['query'][_0x6b01('0x39')]+'%'};return _0x110884;})});}_0x5cd08c=_[_0x6b01('0xbf')]({},_0x5cd08c,_0x11884f[_0x6b01('0x51')]);return _0x42093a[_0x6b01('0x13d')](_0x5cd08c);}})[_0x6b01('0xf')](function(_0x573716){if(_0x573716){_0x55b3f4=_0x573716[_0x6b01('0x44')];if(!_0x11884f[_0x6b01('0x3d')]['hasOwnProperty'](_0x6b01('0xc5'))){_0x5cd08c[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x11884f[_0x6b01('0x3d')][_0x6b01('0x1e')]);_0x5cd08c['offset']=qs[_0x6b01('0x1c')](_0x11884f['query'][_0x6b01('0x1c')]);}return _0x42093a[_0x6b01('0x13d')](_0x5cd08c);}})['then'](function(_0x5624d4){if(_0x5624d4){return _0x5624d4?{'count':_0x55b3f4,'rows':_0x5624d4}:null;}})[_0x6b01('0xf')](respondWithResult(_0x35fbf7,null))['catch'](handleError(_0x35fbf7,null));};exports[_0x6b01('0x13e')]=function(_0x5bdc0f,_0x501ceb){return db[_0x6b01('0x3c')]['find']({'where':{'id':_0x5bdc0f[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x501ceb,null))[_0x6b01('0xf')](function(_0xe4969c){if(_0xe4969c){return _0xe4969c[_0x6b01('0x13e')](_0x5bdc0f[_0x6b01('0x55')][_0x6b01('0x5a')],_[_0x6b01('0x59')](_0x5bdc0f[_0x6b01('0x55')],[_0x6b01('0x5a'),'id'])||{});}})['then'](respondWithResult(_0x501ceb,null))[_0x6b01('0x17')](handleError(_0x501ceb,null));};exports[_0x6b01('0x13f')]=function(_0x33bcdd,_0x3c2a46){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x33bcdd[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x3c2a46,null))[_0x6b01('0xf')](function(_0x24ec41){if(_0x24ec41){return _0x24ec41[_0x6b01('0x13f')](_0x33bcdd[_0x6b01('0x3d')][_0x6b01('0x5a')]);}})[_0x6b01('0xf')](respondWithStatusCode(_0x3c2a46,null))[_0x6b01('0x17')](handleError(_0x3c2a46,null));};exports[_0x6b01('0x140')]=function(_0x3eaa98,_0x1cd5a4){var _0x452646={};var _0x2b40e6={};var _0x47ef48;var _0xe7bffb;return db['User'][_0x6b01('0x8a')]({'where':{'id':_0x3eaa98[_0x6b01('0x56')]['id']}})['then'](handleEntityNotFound(_0x1cd5a4,null))[_0x6b01('0xf')](function(_0x4d31ba){if(_0x4d31ba){_0x47ef48=_0x4d31ba;_0x2b40e6['model']=_['keys'](db[_0x6b01('0x141')][_0x6b01('0x35')]);_0x2b40e6[_0x6b01('0x3d')]=_['keys'](_0x3eaa98[_0x6b01('0x3d')]);_0x2b40e6[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0x2b40e6[_0x6b01('0x4c')],_0x2b40e6[_0x6b01('0x3d')]);_0x452646[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x2b40e6[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x3eaa98['query'][_0x6b01('0x50')]));_0x452646[_0x6b01('0x40')]=_0x452646[_0x6b01('0x40')]['length']?_0x452646[_0x6b01('0x40')]:_0x2b40e6[_0x6b01('0x4c')];_0x452646[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0x3eaa98[_0x6b01('0x3d')][_0x6b01('0xbd')]);_0x452646[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x3eaa98['query'],_0x2b40e6[_0x6b01('0x4e')]));if(_0x3eaa98[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x452646['where']=_[_0x6b01('0xbf')](_0x452646[_0x6b01('0x3b')],{'$or':_[_0x6b01('0x2a')](_0x452646[_0x6b01('0x40')],function(_0x1dfd5e){var _0x4065cb={};_0x4065cb[_0x1dfd5e]={'$like':'%'+_0x3eaa98[_0x6b01('0x3d')][_0x6b01('0x39')]+'%'};return _0x4065cb;})});}_0x452646=_[_0x6b01('0xbf')]({},_0x452646,_0x3eaa98[_0x6b01('0x51')]);return _0x47ef48['getOpenchannelAccounts'](_0x452646);}})[_0x6b01('0xf')](function(_0x5509c8){if(_0x5509c8){_0xe7bffb=_0x5509c8[_0x6b01('0x44')];if(!_0x3eaa98[_0x6b01('0x3d')]['hasOwnProperty'](_0x6b01('0xc5'))){_0x452646[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x3eaa98['query']['limit']);_0x452646[_0x6b01('0x1c')]=qs['offset'](_0x3eaa98[_0x6b01('0x3d')][_0x6b01('0x1c')]);}return _0x47ef48[_0x6b01('0x140')](_0x452646);}})['then'](function(_0x3603f3){if(_0x3603f3){return _0x3603f3?{'count':_0xe7bffb,'rows':_0x3603f3}:null;}})[_0x6b01('0xf')](respondWithResult(_0x1cd5a4,null))[_0x6b01('0x17')](handleError(_0x1cd5a4,null));};exports[_0x6b01('0x142')]=function(_0x334af1,_0x494477){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x334af1[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x494477,null))[_0x6b01('0xf')](function(_0x1e4cf2){if(_0x1e4cf2){return _0x1e4cf2['addOpenchannelAccounts'](_0x334af1['body'][_0x6b01('0x5a')],_['omit'](_0x334af1['body'],[_0x6b01('0x5a'),'id'])||{});}})[_0x6b01('0xf')](respondWithResult(_0x494477,null))[_0x6b01('0x17')](handleError(_0x494477,null));};exports[_0x6b01('0x143')]=function(_0x21c6a3,_0x4d710b){return db['User'][_0x6b01('0x2e')]({'where':{'id':_0x21c6a3['params']['id']}})['then'](handleEntityNotFound(_0x4d710b,null))[_0x6b01('0xf')](function(_0x1aea40){if(_0x1aea40){return _0x1aea40[_0x6b01('0x143')](_0x21c6a3[_0x6b01('0x3d')][_0x6b01('0x5a')]);}})[_0x6b01('0xf')](respondWithStatusCode(_0x4d710b,null))['catch'](handleError(_0x4d710b,null));};exports[_0x6b01('0x144')]=function(_0x1d1744,_0x33a502){var _0x4bb2b5={};var _0x53d6a6={};var _0x98e2f9;var _0x3a9c9d;return db[_0x6b01('0x3c')][_0x6b01('0x8a')]({'where':{'id':_0x1d1744[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x33a502,null))[_0x6b01('0xf')](function(_0x54e17d){if(_0x54e17d){_0x98e2f9=_0x54e17d;_0x53d6a6['model']=_[_0x6b01('0x4d')](db[_0x6b01('0x145')]['rawAttributes']);_0x53d6a6['query']=_[_0x6b01('0x4d')](_0x1d1744[_0x6b01('0x3d')]);_0x53d6a6[_0x6b01('0x4e')]=_['intersection'](_0x53d6a6[_0x6b01('0x4c')],_0x53d6a6['query']);_0x4bb2b5[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x53d6a6['model'],qs[_0x6b01('0x50')](_0x1d1744[_0x6b01('0x3d')][_0x6b01('0x50')]));_0x4bb2b5[_0x6b01('0x40')]=_0x4bb2b5[_0x6b01('0x40')][_0x6b01('0x44')]?_0x4bb2b5[_0x6b01('0x40')]:_0x53d6a6[_0x6b01('0x4c')];_0x4bb2b5['order']=qs['sort'](_0x1d1744[_0x6b01('0x3d')]['sort']);_0x4bb2b5[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x1d1744[_0x6b01('0x3d')],_0x53d6a6[_0x6b01('0x4e')]));if(_0x1d1744[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x4bb2b5[_0x6b01('0x3b')]=_[_0x6b01('0xbf')](_0x4bb2b5['where'],{'$or':_['map'](_0x4bb2b5[_0x6b01('0x40')],function(_0x18a11d){var _0x4e14c9={};_0x4e14c9[_0x18a11d]={'$like':'%'+_0x1d1744[_0x6b01('0x3d')][_0x6b01('0x39')]+'%'};return _0x4e14c9;})});}_0x4bb2b5=_[_0x6b01('0xbf')]({},_0x4bb2b5,_0x1d1744[_0x6b01('0x51')]);return _0x98e2f9['getSmsAccounts'](_0x4bb2b5);}})[_0x6b01('0xf')](function(_0x4c0df3){if(_0x4c0df3){_0x3a9c9d=_0x4c0df3[_0x6b01('0x44')];if(!_0x1d1744[_0x6b01('0x3d')]['hasOwnProperty']('nolimit')){_0x4bb2b5[_0x6b01('0x1e')]=qs['limit'](_0x1d1744['query'][_0x6b01('0x1e')]);_0x4bb2b5['offset']=qs[_0x6b01('0x1c')](_0x1d1744[_0x6b01('0x3d')][_0x6b01('0x1c')]);}return _0x98e2f9[_0x6b01('0x144')](_0x4bb2b5);}})[_0x6b01('0xf')](function(_0x53d1a7){if(_0x53d1a7){return _0x53d1a7?{'count':_0x3a9c9d,'rows':_0x53d1a7}:null;}})['then'](respondWithResult(_0x33a502,null))[_0x6b01('0x17')](handleError(_0x33a502,null));};exports[_0x6b01('0x146')]=function(_0x34a141,_0x2c2b28){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x34a141[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x2c2b28,null))[_0x6b01('0xf')](function(_0x57e772){if(_0x57e772){return _0x57e772[_0x6b01('0x146')](_0x34a141[_0x6b01('0x55')][_0x6b01('0x5a')],_[_0x6b01('0x59')](_0x34a141[_0x6b01('0x55')],[_0x6b01('0x5a'),'id'])||{});}})[_0x6b01('0xf')](respondWithResult(_0x2c2b28,null))['catch'](handleError(_0x2c2b28,null));};exports['removeSmsAccounts']=function(_0x553890,_0x577e2d){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x553890['params']['id']}})['then'](handleEntityNotFound(_0x577e2d,null))['then'](function(_0x76a222){if(_0x76a222){return _0x76a222[_0x6b01('0x147')](_0x553890[_0x6b01('0x3d')][_0x6b01('0x5a')]);}})['then'](respondWithStatusCode(_0x577e2d,null))[_0x6b01('0x17')](handleError(_0x577e2d,null));};exports['getChatWebsites']=function(_0x29f6f7,_0x1681d7){var _0x50f95f={};var _0x540951={};var _0x5df840;var _0x5ba7d6;return db['User'][_0x6b01('0x8a')]({'where':{'id':_0x29f6f7[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x1681d7,null))[_0x6b01('0xf')](function(_0x12fdd0){if(_0x12fdd0){_0x5df840=_0x12fdd0;_0x540951[_0x6b01('0x4c')]=_['keys'](db[_0x6b01('0x148')]['rawAttributes']);_0x540951[_0x6b01('0x3d')]=_[_0x6b01('0x4d')](_0x29f6f7[_0x6b01('0x3d')]);_0x540951[_0x6b01('0x4e')]=_['intersection'](_0x540951[_0x6b01('0x4c')],_0x540951[_0x6b01('0x3d')]);_0x50f95f['attributes']=_[_0x6b01('0x4f')](_0x540951['model'],qs[_0x6b01('0x50')](_0x29f6f7[_0x6b01('0x3d')]['fields']));_0x50f95f['attributes']=_0x50f95f[_0x6b01('0x40')]['length']?_0x50f95f['attributes']:_0x540951[_0x6b01('0x4c')];_0x50f95f[_0x6b01('0xc7')]=qs['sort'](_0x29f6f7[_0x6b01('0x3d')][_0x6b01('0xbd')]);_0x50f95f[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x29f6f7[_0x6b01('0x3d')],_0x540951[_0x6b01('0x4e')]));if(_0x29f6f7[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x50f95f[_0x6b01('0x3b')]=_[_0x6b01('0xbf')](_0x50f95f['where'],{'$or':_['map'](_0x50f95f[_0x6b01('0x40')],function(_0xebda43){var _0x552d6b={};_0x552d6b[_0xebda43]={'$like':'%'+_0x29f6f7[_0x6b01('0x3d')][_0x6b01('0x39')]+'%'};return _0x552d6b;})});}_0x50f95f=_['merge']({},_0x50f95f,_0x29f6f7[_0x6b01('0x51')]);return _0x5df840[_0x6b01('0x149')](_0x50f95f);}})[_0x6b01('0xf')](function(_0x275acf){if(_0x275acf){_0x5ba7d6=_0x275acf[_0x6b01('0x44')];if(!_0x29f6f7['query'][_0x6b01('0xc0')](_0x6b01('0xc5'))){_0x50f95f[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x29f6f7[_0x6b01('0x3d')][_0x6b01('0x1e')]);_0x50f95f[_0x6b01('0x1c')]=qs[_0x6b01('0x1c')](_0x29f6f7['query'][_0x6b01('0x1c')]);}return _0x5df840['getChatWebsites'](_0x50f95f);}})[_0x6b01('0xf')](function(_0x40ecd9){if(_0x40ecd9){return _0x40ecd9?{'count':_0x5ba7d6,'rows':_0x40ecd9}:null;}})[_0x6b01('0xf')](respondWithResult(_0x1681d7,null))[_0x6b01('0x17')](handleError(_0x1681d7,null));};exports[_0x6b01('0x14a')]=function(_0x4b069b,_0xe588a6){return db[_0x6b01('0x3c')]['find']({'where':{'id':_0x4b069b[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0xe588a6,null))[_0x6b01('0xf')](function(_0x44d963){if(_0x44d963){return _0x44d963[_0x6b01('0x14a')](_0x4b069b[_0x6b01('0x55')][_0x6b01('0x5a')],_[_0x6b01('0x59')](_0x4b069b['body'],[_0x6b01('0x5a'),'id'])||{});}})[_0x6b01('0xf')](respondWithResult(_0xe588a6,null))[_0x6b01('0x17')](handleError(_0xe588a6,null));};exports[_0x6b01('0x14b')]=function(_0x48b34e,_0xc1fa99){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x48b34e[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0xc1fa99,null))[_0x6b01('0xf')](function(_0x547d9a){if(_0x547d9a){return _0x547d9a[_0x6b01('0x14b')](_0x48b34e['query'][_0x6b01('0x5a')]);}})['then'](respondWithStatusCode(_0xc1fa99,null))[_0x6b01('0x17')](handleError(_0xc1fa99,null));};exports[_0x6b01('0x14c')]=function(_0xa37626,_0x13df04){var _0x2d94d5={};var _0x1feb70={};var _0x3b9d4b;var _0x5c26bb;return db['User'][_0x6b01('0x8a')]({'where':{'id':_0xa37626[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x13df04,null))[_0x6b01('0xf')](function(_0x22bb5c){if(_0x22bb5c){_0x3b9d4b=_0x22bb5c;_0x1feb70[_0x6b01('0x4c')]=_[_0x6b01('0x4d')](db['WhatsappAccount'][_0x6b01('0x35')]);_0x1feb70[_0x6b01('0x3d')]=_[_0x6b01('0x4d')](_0xa37626[_0x6b01('0x3d')]);_0x1feb70[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0x1feb70[_0x6b01('0x4c')],_0x1feb70[_0x6b01('0x3d')]);_0x2d94d5[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x1feb70['model'],qs['fields'](_0xa37626[_0x6b01('0x3d')][_0x6b01('0x50')]));_0x2d94d5['attributes']=_0x2d94d5['attributes'][_0x6b01('0x44')]?_0x2d94d5[_0x6b01('0x40')]:_0x1feb70[_0x6b01('0x4c')];_0x2d94d5[_0x6b01('0xc7')]=qs['sort'](_0xa37626[_0x6b01('0x3d')][_0x6b01('0xbd')]);_0x2d94d5['where']=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0xa37626[_0x6b01('0x3d')],_0x1feb70['filters']));if(_0xa37626[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x2d94d5[_0x6b01('0x3b')]=_['merge'](_0x2d94d5['where'],{'$or':_['map'](_0x2d94d5[_0x6b01('0x40')],function(_0x1244e9){var _0x1551fc={};_0x1551fc[_0x1244e9]={'$like':'%'+_0xa37626['query']['filter']+'%'};return _0x1551fc;})});}_0x2d94d5=_[_0x6b01('0xbf')]({},_0x2d94d5,_0xa37626[_0x6b01('0x51')]);return _0x3b9d4b['getWhatsappAccounts'](_0x2d94d5);}})[_0x6b01('0xf')](function(_0x35c0c2){if(_0x35c0c2){_0x5c26bb=_0x35c0c2[_0x6b01('0x44')];if(!_0xa37626[_0x6b01('0x3d')]['hasOwnProperty'](_0x6b01('0xc5'))){_0x2d94d5[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0xa37626[_0x6b01('0x3d')][_0x6b01('0x1e')]);_0x2d94d5[_0x6b01('0x1c')]=qs[_0x6b01('0x1c')](_0xa37626[_0x6b01('0x3d')][_0x6b01('0x1c')]);}return _0x3b9d4b['getWhatsappAccounts'](_0x2d94d5);}})[_0x6b01('0xf')](function(_0x25dff9){if(_0x25dff9){return _0x25dff9?{'count':_0x5c26bb,'rows':_0x25dff9}:null;}})[_0x6b01('0xf')](respondWithResult(_0x13df04,null))[_0x6b01('0x17')](handleError(_0x13df04,null));};exports[_0x6b01('0x14d')]=function(_0x57605a,_0x17911c){return db['User'][_0x6b01('0x2e')]({'where':{'id':_0x57605a[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x17911c,null))[_0x6b01('0xf')](function(_0x502939){if(_0x502939){return _0x502939[_0x6b01('0x14d')](_0x57605a['body'][_0x6b01('0x5a')],_['omit'](_0x57605a['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x17911c,null))[_0x6b01('0x17')](handleError(_0x17911c,null));};exports[_0x6b01('0x14e')]=function(_0x623999,_0xccb3d6){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x623999[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0xccb3d6,null))[_0x6b01('0xf')](function(_0x245451){if(_0x245451){return _0x245451['removeWhatsappAccounts'](_0x623999[_0x6b01('0x3d')][_0x6b01('0x5a')]);}})['then'](respondWithStatusCode(_0xccb3d6,null))[_0x6b01('0x17')](handleError(_0xccb3d6,null));};exports[_0x6b01('0x14f')]=function(_0x4dbf3a,_0x12da57){var _0x3555b8={};var _0xba0e91={};var _0x529483;var _0x120ec3;return db[_0x6b01('0x3c')]['findOne']({'where':{'id':_0x4dbf3a[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x12da57,null))[_0x6b01('0xf')](function(_0x29f074){if(_0x29f074){_0x529483=_0x29f074;_0xba0e91[_0x6b01('0x4c')]=_[_0x6b01('0x4d')](db[_0x6b01('0x150')][_0x6b01('0x35')]);_0xba0e91['query']=_[_0x6b01('0x4d')](_0x4dbf3a[_0x6b01('0x3d')]);_0xba0e91[_0x6b01('0x4e')]=_[_0x6b01('0x4f')](_0xba0e91['model'],_0xba0e91[_0x6b01('0x3d')]);_0x3555b8[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0xba0e91[_0x6b01('0x4c')],qs[_0x6b01('0x50')](_0x4dbf3a['query'][_0x6b01('0x50')]));_0x3555b8[_0x6b01('0x40')]=_0x3555b8[_0x6b01('0x40')]['length']?_0x3555b8[_0x6b01('0x40')]:_0xba0e91[_0x6b01('0x4c')];_0x3555b8[_0x6b01('0xc7')]=qs[_0x6b01('0xbd')](_0x4dbf3a[_0x6b01('0x3d')][_0x6b01('0xbd')]);_0x3555b8[_0x6b01('0x3b')]=qs[_0x6b01('0x4e')](_[_0x6b01('0xbe')](_0x4dbf3a[_0x6b01('0x3d')],_0xba0e91[_0x6b01('0x4e')]));if(_0x4dbf3a['query'][_0x6b01('0x39')]){_0x3555b8['where']=_[_0x6b01('0xbf')](_0x3555b8['where'],{'$or':_[_0x6b01('0x2a')](_0x3555b8[_0x6b01('0x40')],function(_0x52da34){var _0x2604f4={};_0x2604f4[_0x52da34]={'$like':'%'+_0x4dbf3a['query'][_0x6b01('0x39')]+'%'};return _0x2604f4;})});}_0x3555b8=_['merge']({},_0x3555b8,_0x4dbf3a['options']);return _0x529483[_0x6b01('0x14f')](_0x3555b8);}})[_0x6b01('0xf')](function(_0x1453aa){if(_0x1453aa){_0x120ec3=_0x1453aa[_0x6b01('0x44')];if(!_0x4dbf3a[_0x6b01('0x3d')][_0x6b01('0xc0')]('nolimit')){_0x3555b8[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x4dbf3a['query'][_0x6b01('0x1e')]);_0x3555b8['offset']=qs[_0x6b01('0x1c')](_0x4dbf3a[_0x6b01('0x3d')][_0x6b01('0x1c')]);}return _0x529483[_0x6b01('0x14f')](_0x3555b8);}})['then'](function(_0x33bfff){if(_0x33bfff){return _0x33bfff?{'count':_0x120ec3,'rows':_0x33bfff}:null;}})[_0x6b01('0xf')](respondWithResult(_0x12da57,null))[_0x6b01('0x17')](handleError(_0x12da57,null));};exports[_0x6b01('0x151')]=function(_0x5c1960,_0x350356){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x5c1960[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x350356,null))[_0x6b01('0xf')](function(_0x545d98){if(_0x545d98){return _0x545d98[_0x6b01('0x151')](_0x5c1960[_0x6b01('0x55')]['ids'],_[_0x6b01('0x59')](_0x5c1960[_0x6b01('0x55')],[_0x6b01('0x5a'),'id'])||{});}})[_0x6b01('0xf')](respondWithResult(_0x350356,null))[_0x6b01('0x17')](handleError(_0x350356,null));};exports[_0x6b01('0x152')]=function(_0x1e1e5d,_0x19957b){return db[_0x6b01('0x3c')]['find']({'where':{'id':_0x1e1e5d[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x19957b,null))[_0x6b01('0xf')](function(_0x5b9323){if(_0x5b9323){return _0x5b9323[_0x6b01('0x152')](_0x1e1e5d[_0x6b01('0x3d')][_0x6b01('0x5a')]);}})[_0x6b01('0xf')](respondWithStatusCode(_0x19957b,null))[_0x6b01('0x17')](handleError(_0x19957b,null));};exports[_0x6b01('0x153')]=function(_0x151854,_0x12646f){var _0x4f10dd={},_0x1b6d76={},_0x284798={'count':0x0,'rows':[]};var _0x2fd617=db[_0x6b01('0x154')]['rawAttributes'];_0x1b6d76[_0x6b01('0x4c')]=_['keys'](_0x2fd617);_0x1b6d76[_0x6b01('0x3d')]=_[_0x6b01('0x4d')](_0x151854[_0x6b01('0x3d')]);_0x1b6d76[_0x6b01('0x4e')]=_['intersection'](_0x1b6d76[_0x6b01('0x4c')],_0x1b6d76['query']);_0x1b6d76[_0x6b01('0x4e')]=_[_0x6b01('0x155')](_0x1b6d76['filters'],[_0x6b01('0x156'),_0x6b01('0x157'),_0x6b01('0x158'),_0x6b01('0x159'),_0x6b01('0x15a'),'$lte',_0x6b01('0x15b'),_0x6b01('0x15c'),_0x6b01('0x15d'),_0x6b01('0x15e'),_0x6b01('0x15f'),_0x6b01('0x160'),'$notIn',_0x6b01('0x161'),_0x6b01('0x162'),_0x6b01('0x163'),_0x6b01('0x164'),_0x6b01('0x161'),'$overlap',_0x6b01('0x165'),_0x6b01('0x166'),_0x6b01('0x167')]);_0x4f10dd[_0x6b01('0x40')]=_[_0x6b01('0x4f')](_0x1b6d76[_0x6b01('0x4c')],qs['fields'](_0x151854[_0x6b01('0x3d')][_0x6b01('0x50')]));_0x4f10dd[_0x6b01('0x40')]=_0x4f10dd[_0x6b01('0x40')][_0x6b01('0x44')]?_0x4f10dd[_0x6b01('0x40')]:_0x1b6d76[_0x6b01('0x4c')];if(!_0x151854[_0x6b01('0x3d')][_0x6b01('0xc0')]('nolimit')){_0x4f10dd[_0x6b01('0x1e')]=qs['limit'](_0x151854[_0x6b01('0x3d')]['limit']);_0x4f10dd['offset']=qs['offset'](_0x151854[_0x6b01('0x3d')][_0x6b01('0x1c')]);}_0x4f10dd[_0x6b01('0xc7')]=qs['sort'](_0x151854[_0x6b01('0x3d')][_0x6b01('0xbd')]);_0x4f10dd['where']=qs[_0x6b01('0x4e')](_['pick'](_0x151854['query'],_0x1b6d76['filters']));if(_0x151854[_0x6b01('0x3d')][_0x6b01('0x39')]){_0x4f10dd[_0x6b01('0x3b')]=_[_0x6b01('0xbf')](_0x4f10dd[_0x6b01('0x3b')],{'$or':_[_0x6b01('0x2a')](_0x4f10dd[_0x6b01('0x40')],function(_0x3ce04e){var _0x17f8db={};_0x17f8db[_0x3ce04e]={'$like':'%'+_0x151854[_0x6b01('0x3d')][_0x6b01('0x39')]+'%'};return _0x17f8db;})});}_0x4f10dd[_0x6b01('0x3b')]={'$and':[_0x4f10dd[_0x6b01('0x3b')],{'$or':[{'UserId':_0x151854['params']['id']},{'OwnerId':_0x151854['params']['id']}]}]};_0x4f10dd=_[_0x6b01('0xbf')]({},_0x4f10dd,_0x151854['options']);var _0x501894={'where':_0x4f10dd[_0x6b01('0x3b')]};return db['CmHopper']['count'](_0x501894)[_0x6b01('0xf')](function(_0x13877c){_0x284798[_0x6b01('0x1f')]=_0x13877c;if(_0x151854['query'][_0x6b01('0x3e')]){_0x4f10dd[_0x6b01('0x3f')]=[{'attributes':['id',_0x6b01('0x168'),_0x6b01('0x169'),'phone'],'model':db['CmContact'],'as':_0x6b01('0x16a')},{'attributes':['id',_0x6b01('0x32'),_0x6b01('0x16b')],'model':db['VoiceQueue'],'as':_0x6b01('0xc8')}];}return db['CmHopper'][_0x6b01('0x41')](_0x4f10dd);})[_0x6b01('0xf')](function(_0x31c7c5){_0x284798[_0x6b01('0x42')]=_0x31c7c5;return _0x284798;})['then'](respondWithFilteredResult(_0x12646f,_0x4f10dd))[_0x6b01('0x17')](handleError(_0x12646f,null));};exports[_0x6b01('0x16c')]=function(_0x4a162e,_0x3b98bf){if(!_[_0x6b01('0x60')](_0x4a162e['user']['id'])&&(_0x4a162e[_0x6b01('0x26')][_0x6b01('0x2d')]==_0x6b01('0x24')||_0x4a162e[_0x6b01('0x26')]['role']=='user')){return db['User'][_0x6b01('0x8a')]({'where':{'id':_0x4a162e[_0x6b01('0x56')]['id']},'raw':!![]})[_0x6b01('0xf')](function(_0x278825){return authService[_0x6b01('0x16d')](_0x278825);})['then'](function(_0x7b78bf){if(_0x7b78bf){return _0x3b98bf[_0x6b01('0x19')](0xc8)['json']({'api_key':_0x7b78bf[_0x6b01('0x16e')]});}else{return _0x3b98bf[_0x6b01('0x19')](0xcc)[_0x6b01('0x1b')]({'message':_0x6b01('0x16f')});}})[_0x6b01('0x17')](handleError(_0x3b98bf,0x193));}else{return _0x3b98bf[_0x6b01('0x19')](0x191)[_0x6b01('0x1b')]({'message':_0x6b01('0x170')});}};exports[_0x6b01('0x171')]=function(_0x4d761b,_0x4e940d){if(!_[_0x6b01('0x60')](_0x4d761b['user']['id'])&&(_0x4d761b[_0x6b01('0x26')][_0x6b01('0x2d')]=='admin'||_0x4d761b['user'][_0x6b01('0x2d')]==_0x6b01('0x26'))){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x4d761b[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](function(_0x423044){return authService['generateApiKey'](_0x423044);})[_0x6b01('0xf')](function(_0x12623c){return db[_0x6b01('0x3c')][_0x6b01('0x22')]({'apiKeyIat':_0x12623c[_0x6b01('0x172')],'apiKeyNonce':_0x12623c[_0x6b01('0x173')]},{'where':{'id':_0x4d761b[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](function(){return _0x4e940d[_0x6b01('0x19')](0xc8)['json']({'api_key':_0x12623c[_0x6b01('0x16e')]});});})['catch'](handleError(_0x4e940d,0x193));}else{return _0x4e940d[_0x6b01('0x19')](0x191)[_0x6b01('0x1b')]({'message':_0x6b01('0x170')});}};exports[_0x6b01('0x174')]=function(_0x233eab,_0x5e48ea){if(!_[_0x6b01('0x60')](_0x233eab[_0x6b01('0x26')]['id'])&&(_0x233eab[_0x6b01('0x26')][_0x6b01('0x2d')]==_0x6b01('0x24')||_0x233eab['user'][_0x6b01('0x2d')]==_0x6b01('0x26'))){return db[_0x6b01('0x3c')][_0x6b01('0x2e')]({'where':{'id':_0x233eab[_0x6b01('0x56')]['id']}})[_0x6b01('0xf')](handleEntityNotFound(_0x5e48ea,null))[_0x6b01('0xf')](function(_0xb5ca9b){if(_0xb5ca9b&&_0xb5ca9b['apiKeyNonce']&&_0xb5ca9b[_0x6b01('0x175')])return _0xb5ca9b;else throw{'message':'API\x20key\x20not\x20available'};})[_0x6b01('0xf')](function(_0x427632){return db[_0x6b01('0x3c')][_0x6b01('0x22')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x233eab['params']['id']}});})['then'](respondWithStatusCode(_0x5e48ea,0xc8))[_0x6b01('0x17')](handleError(_0x5e48ea,0x193));}else{return _0x5e48ea['status'](0x191)[_0x6b01('0x1b')]({'message':_0x6b01('0x170')});}};exports[_0x6b01('0x176')]=function(_0x3ae15d,_0x4b4e24){var _0x47f644=_0x3ae15d[_0x6b01('0x26')][_0x6b01('0x23')]({'plain':!![]});if(!_0x47f644){return _0x4b4e24[_0x6b01('0x19')](0x191)[_0x6b01('0x33')](_0x6b01('0x177'));}else{return _0x4b4e24[_0x6b01('0x19')](0xc8)[_0x6b01('0x1b')](_0x47f644);}};exports[_0x6b01('0x178')]=function(_0x32073b,_0x2011d2){var _0x572666={'offset':0x0},_0x1586f9={'count':0x0,'rows':[]};Promise[_0x6b01('0xf4')]()[_0x6b01('0xf')](function(){if(!_0x32073b[_0x6b01('0x3d')][_0x6b01('0x39')]&&!_0x32073b[_0x6b01('0x3d')][_0x6b01('0x179')]&&!_0x32073b[_0x6b01('0x3d')][_0x6b01('0x17a')])return[];return Promise[_0x6b01('0xf4')]()[_0x6b01('0xf')](function(){var _0x206603=[];if(!_[_0x6b01('0x17b')](_0x32073b[_0x6b01('0x3d')][_0x6b01('0x179')])){_0x206603[_0x6b01('0x47')](db[_0x6b01('0x104')][_0x6b01('0x41')]({'attributes':['id','name'],'where':{'id':_0x32073b[_0x6b01('0x3d')][_0x6b01('0x179')]}}));}if(!_[_0x6b01('0x17b')](_0x32073b['query'][_0x6b01('0x17a')])){_0x206603[_0x6b01('0x47')](db['VoiceQueue'][_0x6b01('0x41')]({'attributes':['id',_0x6b01('0x32')],'type':'inbound','where':{'id':_0x32073b[_0x6b01('0x3d')][_0x6b01('0x17a')]}}));}return Promise[_0x6b01('0x4b')](_0x206603);})[_0x6b01('0xf')](function(_0x144708){var _0x22aa5f=_[_0x6b01('0x110')](_0x144708)[_0x6b01('0x2a')](function(_0xcf9f4d){return _0xcf9f4d['getAgents']({'attributes':['id',_0x6b01('0x32'),_0x6b01('0x5b'),_0x6b01('0x92')],'raw':!![]});});return Promise[_0x6b01('0x4b')](_0x22aa5f);})[_0x6b01('0xf')](function(_0x1ff1ad){var _0x502e30=_[_0x6b01('0x110')](_0x1ff1ad);if(!_0x32073b[_0x6b01('0x3d')][_0x6b01('0x39')])return _0x502e30;if(_[_0x6b01('0x17b')](_0x502e30)){return db[_0x6b01('0x3c')]['findAll']({'attributes':['id',_0x6b01('0x32'),_0x6b01('0x5b'),'online'],'where':{'role':_0x6b01('0x6c'),'$or':[db[_0x6b01('0x62')][_0x6b01('0x3b')](db['sequelize']['fn'](_0x6b01('0x17c'),db['sequelize'][_0x6b01('0x17d')](_0x6b01('0x32'))),{'$like':'%'+_0x32073b[_0x6b01('0x3d')][_0x6b01('0x39')]['toLowerCase']()+'%'}),{'internal':{'$like':'%'+_0x32073b[_0x6b01('0x3d')][_0x6b01('0x39')]+'%'}}]},'raw':!![]});}else{return _(_0x502e30)['flatten']()['filter'](function(_0x342374){return _0x342374[_0x6b01('0x32')]['toLowerCase']()[_0x6b01('0x2c')](_0x32073b[_0x6b01('0x3d')][_0x6b01('0x39')][_0x6b01('0x9a')]())||_0x342374['internal'][_0x6b01('0x17e')]()['includes'](_0x32073b[_0x6b01('0x3d')][_0x6b01('0x39')]);})[_0x6b01('0x2b')]();}})[_0x6b01('0xf')](function(_0x3d8dcf){var _0x59f418='name';var _0x3f1d05=_0x6b01('0x17f');if(_0x32073b[_0x6b01('0x3d')]['sort']){var _0x3f1d05=_0x32073b[_0x6b01('0x3d')]['sort'][0x0]==='-'?_0x6b01('0x180'):'asc';var _0x59f418=_0x3f1d05===_0x6b01('0x17f')?_0x32073b[_0x6b01('0x3d')]['sort']:_0x32073b[_0x6b01('0x3d')][_0x6b01('0xbd')][_0x6b01('0x181')](0x1);}return _(_0x3d8dcf)[_0x6b01('0x182')]('id')[_0x6b01('0x183')]([function(_0x23ffa8){return _0x59f418===_0x6b01('0x32')?_0x23ffa8[_0x59f418][_0x6b01('0x9a')]():_0x23ffa8[_0x59f418];}],[_0x3f1d05])[_0x6b01('0x2a')](function(_0xff2fae){return _[_0x6b01('0xbe')](_0xff2fae,['id','name','internal',_0x6b01('0x92')]);})[_0x6b01('0x2b')]();})[_0x6b01('0xf')](function(_0x1f8608){return client[_0x6b01('0x184')]('Agents',_0x32073b)[_0x6b01('0xf')](function(_0x8cc12e){if(_0x8cc12e[_0x6b01('0x13')])throw new Error(_0x6b01('0x185'));var _0x310dee=_0x8cc12e['result'];var _0xabd5c3=jayson[_0x6b01('0xe')][_0x6b01('0x186')]({'port':0x232c});return _0xabd5c3[_0x6b01('0x184')](_0x6b01('0x27'),_0x32073b)[_0x6b01('0xf')](function(_0x138833){if(_0x138833[_0x6b01('0x13')])throw new Error(_0x6b01('0x187'));var _0x4f9505=_0x138833['result'];return _[_0x6b01('0xbf')]({},_0x4f9505,_0x310dee);});})[_0x6b01('0xf')](function(_0x820a53){return _[_0x6b01('0x2a')](_0x1f8608,function(_0x39e851){var _0x27655d=_[_0x6b01('0x2e')](_0x820a53[_0x6b01('0x42')],['id',_0x39e851['id']]);if(!_0x27655d||!_0x39e851[_0x6b01('0x92')]){_0x39e851[_0x6b01('0x19')]=_0x6b01('0x188');}else if(_0x27655d['voicePause']){_0x39e851[_0x6b01('0x19')]=_0x6b01('0xf6');}else{_0x39e851['status']=_['includes']([_0x6b01('0x189'),_0x6b01('0x18a'),_0x6b01('0x18b'),_0x6b01('0x18c'),null,undefined],_0x27655d[_0x6b01('0x18d')])?_0x6b01('0x92'):_0x6b01('0x18e');}return _0x39e851;});});});})[_0x6b01('0xf')](function(_0x43af22){if(!_0x32073b['query']['hasOwnProperty']('nolimit')){_0x572666[_0x6b01('0x1e')]=qs[_0x6b01('0x1e')](_0x32073b['query'][_0x6b01('0x1e')]||0xa);_0x572666['offset']=qs[_0x6b01('0x1c')](_0x32073b[_0x6b01('0x3d')][_0x6b01('0x1c')]);}_0x1586f9[_0x6b01('0x1f')]=_0x43af22['length'];_0x1586f9[_0x6b01('0x42')]=_0x572666[_0x6b01('0x1e')]?_0x43af22['slice'](_0x572666[_0x6b01('0x1c')],_0x572666[_0x6b01('0x1c')]+_0x572666[_0x6b01('0x1e')]):_0x43af22;return _0x1586f9;})[_0x6b01('0xf')](respondWithFilteredResult(_0x2011d2,_0x572666))[_0x6b01('0x17')](handleError(_0x2011d2,null));};function get_open_tabs(_0x11fa92,_0x55f646){var _0x1b8401=_0x11fa92['charAt'](0x0)['toUpperCase']()+_0x11fa92[_0x6b01('0x18f')](0x1);var _0x305d99={'type':db[_0x6b01('0x84')][_0x6b01('0x64')][_0x6b01('0x65')],'raw':!![]};return new BPromise(function(_0x371a7d,_0x1e4346){var _0x3498b2=squel[_0x6b01('0x190')]()['field'](_0x6b01('0x191')+_0x1b8401+_0x6b01('0x192'),'id')[_0x6b01('0x193')](_0x6b01('0x194'))[_0x6b01('0x66')](_0x6b01('0x195')+_0x11fa92+_0x6b01('0x196'),'ui')[_0x6b01('0x3b')](_0x6b01('0x197'),_0x55f646['id']);return db[_0x6b01('0x62')][_0x6b01('0x3d')](_0x3498b2[_0x6b01('0x17e')](),_0x305d99)[_0x6b01('0xf')](function(_0x22123f){_0x55f646[_0x1b8401+_0x6b01('0x198')]=_0x22123f;_0x371a7d(_0x22123f);})['catch'](function(_0x5f1dbe){_0x1e4346(_0x5f1dbe);});});};
\ No newline at end of file
+var _0xafcd=['sms','fax','openchannel','whatsapp','all','catch','show','model','differenceBy','keys','intersection','fields','merge','options','mail','update','body','params','describe','addContacts','ids','omit','findById','securePassword','validatePasswordPattern','max','internal','min_internal','isNil','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)','from','voicemail','fullname','email','agent','permissions','101','102','103','113','110','104','105','107','108','109','100','111','114','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','bulkCreate','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','checkUserLimits','findAll','Telephones','compact','newPassword','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','oldPassword','Sequelize','ValidationError','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','enforcePasswordHistory','passwordHistoryLimit','validatePasswordHistory','updatePasswordsHistory','loginInPause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','spread','QueueId','emit','Queue:save','voice','VoiceQueue','online','format','SIP/%s','voicePause','penalty','UserVoiceQueueRt','upsert','channel','remove','isArray','Queue:remove','userpic','getAvatar','join','server/files/images/logos/default_profile.png','download','root','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','FaxOpenTabs','FAX','createdAt','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','findOne','rawAttributes','filters','order','sort','pick','filter','hasOwnProperty','include','CmList','Tag','Tags','color','tag','getQueues','Queue','Unknown\x20role','nolimit','getVoiceQueuesRt','getGroups','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','login','mobile','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','each','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','MemberReport','concat','isMiddleware','resolve','logout','pause','QueuePause','PAUSE','updateAttributes','DEFAULT\x20PAUSE','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','pauseType','lastPauseAt','manual','set','Pause','unpause','getTeams','Team','addTeams','setDataValue','Voice','getChatQueues','getMailQueues','Mail','Sms','getWhatsappQueues','Whatsapp','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','TeamVoicePrefix','UserVoicePrefix','removeTeams','Chat','getSmsQueues','VoicePrefixId','getLists','getAgents','values','send','addChatInteractions','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contains','$any','firstName','lastName','phone','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','nonce','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','teams','queues','isEmpty','inbound','lower','col','asc','desc','substring','uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','voiceStatus','busy','slice','charAt','QueryTypes','SELECT','select','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','toString','OpenTabs','moment','bluebird','util','path','lodash','squel','jayson/promise','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','socket.io-emitter','redis','./user.socket','register','defaults','localhost','client','http','request','User,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','info','result','status','json','undefined','limit','count','offset','Content-Range','then','destroy','get','role','admin','user','Agents','telephone','map','value','find','name','UserProfileResource','end','sendStatus','index','User','fieldName','type','key','includes','password','getOptions','where','query','includeAll','attributes','push','rows','openTabs','true','length','chat','dataValues'];(function(_0x562c57,_0x288593){var _0x374e32=function(_0x25da25){while(--_0x25da25){_0x562c57['push'](_0x562c57['shift']());}};_0x374e32(++_0x288593);}(_0xafcd,0x157));var _0xdafc=function(_0x36782c,_0x38c321){_0x36782c=_0x36782c-0x0;var _0xd4e417=_0xafcd[_0x36782c];return _0xd4e417;};'use strict';var moment=require(_0xdafc('0x0'));var BPromise=require(_0xdafc('0x1'));var util=require(_0xdafc('0x2'));var path=require(_0xdafc('0x3'));var fs=require('fs');var _=require(_0xdafc('0x4'));var squel=require(_0xdafc('0x5'));var jayson=require(_0xdafc('0x6'));var Redis=require('ioredis');var authService=require(_0xdafc('0x7'));var qs=require(_0xdafc('0x8'));var logger=require(_0xdafc('0x9'))('api');var utils=require(_0xdafc('0xa'));var config=require(_0xdafc('0xb'));var licenseUtil=require(_0xdafc('0xc'));var db=require('../../mysqldb')['db'];var socket=require(_0xdafc('0xd'))(new Redis(config[_0xdafc('0xe')]));require(_0xdafc('0xf'))[_0xdafc('0x10')](socket);config[_0xdafc('0xe')]=_[_0xdafc('0x11')](config[_0xdafc('0xe')],{'host':_0xdafc('0x12'),'port':0x18eb});var client=jayson[_0xdafc('0x13')][_0xdafc('0x14')]({'port':0x232a});var values;function respondWithRpcPromise(_0x39561b,_0x5c6c14,_0x5b06a0,_0x2a1a6b){return new BPromise(function(_0x28f756,_0x19f461){var _0xafac3e=_0x2a1a6b||client;return _0xafac3e[_0xdafc('0x15')](_0x39561b,_0x5b06a0)['then'](function(_0x4b7efe){logger['info'](_0xdafc('0x16'),_0x5c6c14,'request\x20sent');logger[_0xdafc('0x17')]('User,\x20%s,\x20%s,\x20%s',_0x5c6c14,_0xdafc('0x18'),JSON[_0xdafc('0x19')](_0x4b7efe));if(_0x4b7efe[_0xdafc('0x1a')]){if(_0x4b7efe[_0xdafc('0x1a')]['code']===0x1f4){logger['error'](_0xdafc('0x16'),_0x5c6c14,_0x4b7efe[_0xdafc('0x1a')][_0xdafc('0x1b')]);return _0x19f461(_0x4b7efe['error']['message']);}logger[_0xdafc('0x1a')](_0xdafc('0x16'),_0x5c6c14,_0x4b7efe[_0xdafc('0x1a')][_0xdafc('0x1b')]);return _0x28f756(_0x4b7efe[_0xdafc('0x1a')][_0xdafc('0x1b')]);}else{logger[_0xdafc('0x1c')](_0xdafc('0x16'),_0x5c6c14,'request\x20sent');_0x28f756(_0x4b7efe[_0xdafc('0x1d')][_0xdafc('0x1b')]);}})['catch'](function(_0x239908){logger[_0xdafc('0x1a')](_0xdafc('0x16'),_0x5c6c14,_0x239908);_0x19f461(_0x239908);});});}function respondWithStatusCode(_0xd70f29,_0x44f8f8){_0x44f8f8=_0x44f8f8||0xcc;return function(_0xbb92d5){if(_0xbb92d5){return _0xd70f29['sendStatus'](_0x44f8f8);}return _0xd70f29['status'](_0x44f8f8)['end']();};}function respondWithResult(_0x467f8b,_0x489890){_0x489890=_0x489890||0xc8;return function(_0x159d51){if(_0x159d51){return _0x467f8b[_0xdafc('0x1e')](_0x489890)[_0xdafc('0x1f')](_0x159d51);}};}function respondWithFilteredResult(_0x17c2f6,_0x5be20a){return function(_0x41ff90){if(_0x41ff90){var _0x4fd6ff=typeof _0x5be20a['offset']===_0xdafc('0x20')&&typeof _0x5be20a[_0xdafc('0x21')]===_0xdafc('0x20');var _0x3d3f06=_0x41ff90[_0xdafc('0x22')];var _0x181418=_0x4fd6ff?0x0:_0x5be20a[_0xdafc('0x23')];var _0x4a98c5=_0x4fd6ff?_0x41ff90[_0xdafc('0x22')]:_0x5be20a[_0xdafc('0x23')]+_0x5be20a['limit'];var _0x29b376;if(_0x4a98c5>=_0x3d3f06){_0x4a98c5=_0x3d3f06;_0x29b376=0xc8;}else{_0x29b376=0xce;}_0x17c2f6['status'](_0x29b376);return _0x17c2f6['set'](_0xdafc('0x24'),_0x181418+'-'+_0x4a98c5+'/'+_0x3d3f06)['json'](_0x41ff90);}return null;};}function saveUpdates(_0x2fbc2b){return function(_0xf9803e){if(_0xf9803e){return _0xf9803e['update'](_0x2fbc2b)[_0xdafc('0x25')](function(_0x56e096){return _0x56e096;});}return null;};}function removeEntity(_0x59425c){return function(_0x4ff3d9){if(_0x4ff3d9){return _0x4ff3d9[_0xdafc('0x26')]()[_0xdafc('0x25')](function(){var _0x1fe569=_0x4ff3d9[_0xdafc('0x27')]({'plain':!![]});if(_0x1fe569[_0xdafc('0x28')]===_0xdafc('0x29'))return;var _0x6ba16e=[{'name':'Users','value':_0xdafc('0x2a'),'ignore':!![]},{'name':_0xdafc('0x2b'),'value':'agent','ignore':![]},{'name':'Telephones','value':_0xdafc('0x2c'),'ignore':![]}];var _0x727050=_(_0x6ba16e)['filter']('ignore')[_0xdafc('0x2d')](_0xdafc('0x2e'))['value']();if(_['includes'](_0x727050,_0x1fe569['role'])){return;}var _0x54a291=_[_0xdafc('0x2f')](_0x6ba16e,['value',_0x1fe569[_0xdafc('0x28')]])[_0xdafc('0x30')];return db[_0xdafc('0x31')][_0xdafc('0x26')]({'where':{'type':_0x54a291,'resourceId':_0x1fe569['id']}})['then'](function(){return _0x4ff3d9;});})[_0xdafc('0x25')](function(){_0x59425c[_0xdafc('0x1e')](0xcc)[_0xdafc('0x32')]();});}};}function handleEntityNotFound(_0x15b9bf){return function(_0x28c94b){if(!_0x28c94b){_0x15b9bf[_0xdafc('0x33')](0x194);}return _0x28c94b;};}function handleError(_0x56c87c,_0xb7561b){_0xb7561b=_0xb7561b||0x1f4;return function(_0x413862){logger[_0xdafc('0x1a')](_0x413862['stack']);if(_0x413862[_0xdafc('0x30')]){delete _0x413862['name'];}_0x56c87c[_0xdafc('0x1e')](_0xb7561b)['send'](_0x413862);};}exports[_0xdafc('0x34')]=function(_0x2429b2,_0x1e5ab1){var _0x52ff5b={},_0x28c803={'count':0x0,'rows':[]};var _0x1a2b2d=_(db[_0xdafc('0x35')]['rawAttributes'])[_0xdafc('0x2d')](function(_0x49ae9e){return{'name':_0x49ae9e[_0xdafc('0x36')],'type':_0x49ae9e[_0xdafc('0x37')][_0xdafc('0x38')]};})['filter'](function(_0x4918bd){return!_[_0xdafc('0x39')]([_0xdafc('0x3a'),'salt'],_0x4918bd[_0xdafc('0x30')]);})['value']();_0x52ff5b=qs[_0xdafc('0x3b')](_0x1a2b2d,_0x2429b2);var _0x2320d3={'where':_0x52ff5b[_0xdafc('0x3c')]};return db['User']['count'](_0x2320d3)['then'](function(_0x14042b){_0x28c803[_0xdafc('0x22')]=_0x14042b;if(_0x2429b2[_0xdafc('0x3d')][_0xdafc('0x3e')]){_0x52ff5b['include']=[{'all':!![]}];}if(!_[_0xdafc('0x39')](_0x52ff5b[_0xdafc('0x3f')],'id')){_0x52ff5b['attributes'][_0xdafc('0x40')]('id');}return db['User']['findAll'](_0x52ff5b);})[_0xdafc('0x25')](function(_0x3d0f00){_0x28c803[_0xdafc('0x41')]=_0x3d0f00;if(_0x2429b2['query'][_0xdafc('0x42')]===_0xdafc('0x43')){var _0x515c5b=[];for(var _0x12cd1d=0x0;_0x12cd1d<_0x28c803[_0xdafc('0x41')][_0xdafc('0x44')];_0x12cd1d++){_0x515c5b[_0xdafc('0x40')](get_open_tabs(_0xdafc('0x45'),_0x28c803[_0xdafc('0x41')][_0x12cd1d][_0xdafc('0x46')]));_0x515c5b[_0xdafc('0x40')](get_open_tabs(_0xdafc('0x47'),_0x28c803[_0xdafc('0x41')][_0x12cd1d]['dataValues']));_0x515c5b[_0xdafc('0x40')](get_open_tabs(_0xdafc('0x48'),_0x28c803[_0xdafc('0x41')][_0x12cd1d][_0xdafc('0x46')]));_0x515c5b[_0xdafc('0x40')](get_open_tabs('mail',_0x28c803[_0xdafc('0x41')][_0x12cd1d][_0xdafc('0x46')]));_0x515c5b['push'](get_open_tabs(_0xdafc('0x49'),_0x28c803['rows'][_0x12cd1d][_0xdafc('0x46')]));_0x515c5b['push'](get_open_tabs(_0xdafc('0x4a'),_0x28c803[_0xdafc('0x41')][_0x12cd1d][_0xdafc('0x46')]));}return BPromise[_0xdafc('0x4b')](_0x515c5b)['then'](function(_0x3a2360){return _0x28c803;});}else{return _0x28c803;}})[_0xdafc('0x25')](respondWithFilteredResult(_0x1e5ab1,_0x52ff5b))[_0xdafc('0x4c')](handleError(_0x1e5ab1,null));};exports[_0xdafc('0x4d')]=function(_0x5b8659,_0x294f62){var _0x3aa4ab={'raw':![],'where':{'id':_0x5b8659['params']['id']}},_0x4dbff3={};_0x4dbff3[_0xdafc('0x4e')]=_[_0xdafc('0x4f')](_[_0xdafc('0x50')](db[_0xdafc('0x35')]['rawAttributes']),[_0xdafc('0x3a'),'salt']);_0x4dbff3[_0xdafc('0x3d')]=_['keys'](_0x5b8659[_0xdafc('0x3d')]);_0x4dbff3['filters']=_[_0xdafc('0x51')](_0x4dbff3['model'],_0x4dbff3['query']);_0x3aa4ab[_0xdafc('0x3f')]=_[_0xdafc('0x51')](_0x4dbff3[_0xdafc('0x4e')],qs[_0xdafc('0x52')](_0x5b8659[_0xdafc('0x3d')][_0xdafc('0x52')]));_0x3aa4ab[_0xdafc('0x3f')]=_0x3aa4ab[_0xdafc('0x3f')][_0xdafc('0x44')]?_0x3aa4ab['attributes']:_0x4dbff3['model'];if(_0x5b8659['query']['includeAll']){_0x3aa4ab['include']=[{'all':!![]}];}_0x3aa4ab=_[_0xdafc('0x53')]({},_0x3aa4ab,_0x5b8659[_0xdafc('0x54')]);if(!_[_0xdafc('0x39')](_0x3aa4ab[_0xdafc('0x3f')],'id')){_0x3aa4ab[_0xdafc('0x3f')][_0xdafc('0x40')]('id');}return db[_0xdafc('0x35')][_0xdafc('0x2f')](_0x3aa4ab)[_0xdafc('0x25')](handleEntityNotFound(_0x294f62,null))[_0xdafc('0x25')](function(_0xccbbb4){var _0x5ecf9e=[];values=_0xccbbb4;if(_0x5b8659['query']['openTabs']===_0xdafc('0x43')){_0x5ecf9e[_0xdafc('0x40')](get_open_tabs(_0xdafc('0x45'),_0xccbbb4['dataValues']));_0x5ecf9e[_0xdafc('0x40')](get_open_tabs('sms',_0xccbbb4[_0xdafc('0x46')]));_0x5ecf9e['push'](get_open_tabs('openchannel',_0xccbbb4[_0xdafc('0x46')]));_0x5ecf9e[_0xdafc('0x40')](get_open_tabs(_0xdafc('0x4a'),_0xccbbb4['dataValues']));_0x5ecf9e[_0xdafc('0x40')](get_open_tabs(_0xdafc('0x48'),_0xccbbb4[_0xdafc('0x46')]));_0x5ecf9e[_0xdafc('0x40')](get_open_tabs(_0xdafc('0x55'),_0xccbbb4[_0xdafc('0x46')]));return BPromise[_0xdafc('0x4b')](_0x5ecf9e);}else{return values;}})[_0xdafc('0x25')](function(_0x264817){return values;})[_0xdafc('0x25')](respondWithResult(_0x294f62,null))[_0xdafc('0x4c')](handleError(_0x294f62,null));};exports[_0xdafc('0x56')]=function(_0x722176,_0x490cba){if(_0x722176[_0xdafc('0x57')]['id']){delete _0x722176[_0xdafc('0x57')]['id'];}delete _0x722176[_0xdafc('0x57')][_0xdafc('0x28')];return db[_0xdafc('0x35')]['find']({'where':{'id':_0x722176[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x490cba,null))[_0xdafc('0x25')](saveUpdates(_0x722176[_0xdafc('0x57')],null))[_0xdafc('0x25')](respondWithResult(_0x490cba,null))[_0xdafc('0x4c')](handleError(_0x490cba,null));};exports[_0xdafc('0x59')]=function(_0x5abd77,_0x1e4afe){return db[_0xdafc('0x35')][_0xdafc('0x59')]()[_0xdafc('0x25')](respondWithResult(_0x1e4afe,null))[_0xdafc('0x4c')](handleError(_0x1e4afe,null));};exports['addContacts']=function(_0x3cef6d,_0x5b5c5a){return db[_0xdafc('0x35')]['find']({'where':{'id':_0x3cef6d[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x5b5c5a,null))[_0xdafc('0x25')](function(_0xe9f511){if(_0xe9f511){return _0xe9f511[_0xdafc('0x5a')](_0x3cef6d[_0xdafc('0x57')][_0xdafc('0x5b')],_[_0xdafc('0x5c')](_0x3cef6d[_0xdafc('0x57')],['ids','id'])||{});}})['then'](respondWithResult(_0x5b5c5a,null))[_0xdafc('0x4c')](handleError(_0x5b5c5a,null));};function validateUser(_0x2c0e37){return new BPromise(function(_0x48a855,_0x4f9f39){if(_0x2c0e37['internal'])return _0x48a855(_0x2c0e37);return db['Setting'][_0xdafc('0x5d')](0x1)[_0xdafc('0x25')](function(_0x12b12e){if(_0x12b12e[_0xdafc('0x5e')])authService[_0xdafc('0x5f')](_0x2c0e37[_0xdafc('0x3a')]);db['User'][_0xdafc('0x60')](_0xdafc('0x61'))[_0xdafc('0x25')](function(_0x1c8aad){if(_['isNil'](_0x1c8aad)){_0x2c0e37[_0xdafc('0x61')]=_0x12b12e[_0xdafc('0x62')]||0x1;return;}if(_[_0xdafc('0x63')](_0x12b12e['min_internal'])||_0x12b12e[_0xdafc('0x62')]===_0x1c8aad){_0x2c0e37[_0xdafc('0x61')]=_0x1c8aad+0x1;return;}if(_0x12b12e[_0xdafc('0x62')]>_0x1c8aad){_0x2c0e37[_0xdafc('0x61')]=_0x12b12e[_0xdafc('0x62')];return;}return db[_0xdafc('0x64')][_0xdafc('0x3d')](_0xdafc('0x65'),{'type':db[_0xdafc('0x64')]['QueryTypes']['SELECT']})['then'](function(_0x140db1){if(_0x140db1&&_0x140db1['length']){for(var _0x4dc894=0x0,_0x5ef545=_0x140db1['length'];_0x4dc894<_0x5ef545&&_[_0xdafc('0x63')](_0x2c0e37[_0xdafc('0x61')]);_0x4dc894++){if(_0x12b12e[_0xdafc('0x62')]<=_0x140db1[_0x4dc894][_0xdafc('0x66')]){_0x2c0e37[_0xdafc('0x61')]=_0x140db1[_0x4dc894][_0xdafc('0x66')];}else if(_0x12b12e['min_internal']>_0x140db1[_0x4dc894][_0xdafc('0x66')]&&_0x12b12e['min_internal']<=_0x140db1[_0x4dc894]['to']){_0x2c0e37[_0xdafc('0x61')]=_0x12b12e[_0xdafc('0x62')];}}}if(_[_0xdafc('0x63')](_0x2c0e37[_0xdafc('0x61')])){_0x2c0e37[_0xdafc('0x61')]=_0x1c8aad+0x1;}return _0x48a855(_0x2c0e37);});});})[_0xdafc('0x4c')](function(_0x3c5a14){_0x4f9f39(_0x3c5a14);});});}function updateUser(_0x1ab70e){return new BPromise(function(_0x4b9056,_0x327018){try{if(_0x1ab70e[_0xdafc('0x67')]){_0x1ab70e['mailbox']=_0x1ab70e['internal'];_0x1ab70e['VoiceMail']={'mailbox':_0x1ab70e['internal'],'password':_0x1ab70e[_0xdafc('0x3a')],'fullname':_0x1ab70e[_0xdafc('0x68')],'email':_0x1ab70e[_0xdafc('0x69')]};}if(_0x1ab70e[_0xdafc('0x28')]===_0xdafc('0x6a')){if(!_0x1ab70e[_0xdafc('0x6b')])_0x1ab70e[_0xdafc('0x6b')]=[_0xdafc('0x6c'),_0xdafc('0x6d'),_0xdafc('0x6e'),_0xdafc('0x6f'),_0xdafc('0x70'),_0xdafc('0x71'),_0xdafc('0x72'),'106',_0xdafc('0x73'),_0xdafc('0x74'),_0xdafc('0x75'),_0xdafc('0x76'),_0xdafc('0x77'),_0xdafc('0x78'),'115'];}_0x4b9056(_0x1ab70e);}catch(_0x58cef3){_0x327018(_0x58cef3);}});}exports[_0xdafc('0x79')]=function(_0x9b3178,_0x950b7f){if(_0x9b3178[_0xdafc('0x2a')][_0xdafc('0x28')]===_0xdafc('0x6a'))throw new Error(_0xdafc('0x7a'));if(_0x9b3178[_0xdafc('0x57')][_0xdafc('0x28')]==='user'&&_0x9b3178[_0xdafc('0x2a')]['role']!==_0xdafc('0x29')){throw new Error(_0xdafc('0x7b'));}if(_0x9b3178[_0xdafc('0x57')][_0xdafc('0x28')]===_0xdafc('0x29')&&_0x9b3178[_0xdafc('0x2a')][_0xdafc('0x28')]!==_0xdafc('0x29')){throw new Error(_0xdafc('0x7c'));}return licenseUtil['checkUserLimits']([_0x9b3178[_0xdafc('0x57')]])[_0xdafc('0x25')](function(){return validateUser(_0x9b3178[_0xdafc('0x57')]);})[_0xdafc('0x25')](function(_0x5e38e8){return updateUser(_0x5e38e8)['then'](function(_0x32c048){if(_0x32c048['role']==='admin'){_0x32c048['settingsEnabled']=_0x9b3178[_0xdafc('0x2a')][_0xdafc('0x7d')];delete _0x32c048[_0xdafc('0x7e')];}return _0x32c048;});})['then'](function(_0x284cfa){return db['User']['create'](_0x284cfa,{'include':[{'model':db[_0xdafc('0x7f')],'as':_0xdafc('0x7f')}]});})[_0xdafc('0x25')](function(_0x384c7b){if(_0x9b3178[_0xdafc('0x57')][_0xdafc('0x28')]===_0xdafc('0x2a'))return _0x384c7b;if(_0x9b3178['user'][_0xdafc('0x28')]!==_0xdafc('0x2a'))return _0x384c7b;return db[_0xdafc('0x80')][_0xdafc('0x2f')]({'where':{'name':_0x384c7b[_0xdafc('0x28')]==='agent'?_0xdafc('0x2b'):'Telephones','userProfileId':_0x9b3178['user'][_0xdafc('0x7e')]},'raw':!![]})[_0xdafc('0x25')](function(_0x3cc492){if(!_0x3cc492||_0x3cc492[_0xdafc('0x81')]!=0x0)return _0x384c7b;return db[_0xdafc('0x31')][_0xdafc('0x79')]({'name':_0x384c7b[_0xdafc('0x30')],'resourceId':_0x384c7b['id'],'type':_0x3cc492[_0xdafc('0x30')],'sectionId':_0x3cc492['id']},{})[_0xdafc('0x25')](function(){return _0x384c7b;});})['catch'](function(_0x1681c2){logger[_0xdafc('0x1a')](_0xdafc('0x82'),_0x1681c2);throw _0x1681c2;});})['then'](respondWithResult(_0x950b7f,0xc9))['catch'](handleError(_0x950b7f,null));};exports[_0xdafc('0x83')]=function(_0x1eb7b3,_0x5271e9){var _0x344860=_0x1eb7b3['body'];var _0x1ffe04=[];if(_0x1eb7b3[_0xdafc('0x2a')][_0xdafc('0x28')]===_0xdafc('0x6a'))throw new Error(_0xdafc('0x7a'));if(_['some'](_0x344860,[_0xdafc('0x28'),'user'])&&_0x1eb7b3[_0xdafc('0x2a')][_0xdafc('0x28')]!==_0xdafc('0x29')){throw new Error(_0xdafc('0x7b'));}if(_[_0xdafc('0x84')](_0x344860,[_0xdafc('0x28'),'admin'])&&_0x1eb7b3[_0xdafc('0x2a')][_0xdafc('0x28')]!==_0xdafc('0x29')){throw new Error(_0xdafc('0x85'));}return licenseUtil[_0xdafc('0x86')](_0x344860)[_0xdafc('0x25')](function(){return validateUser(_0x344860[0x0]);})[_0xdafc('0x25')](function(){for(var _0x40f7aa=0x1;_0x40f7aa<_0x344860[_0xdafc('0x44')];_0x40f7aa++){var _0xabc5f5=_0x344860[_0x40f7aa-0x1][_0xdafc('0x61')];if(!_0x344860[_0x40f7aa]['internal'])_0x344860[_0x40f7aa][_0xdafc('0x61')]=_0xabc5f5+0x1;_0x1ffe04[_0xdafc('0x40')](validateUser(_0x344860[_0x40f7aa]));}return BPromise['all'](_0x1ffe04);})[_0xdafc('0x25')](function(){_0x1ffe04=[];for(var _0xf269e5=0x0;_0xf269e5<_0x344860['length'];_0xf269e5++){_0x1ffe04[_0xdafc('0x40')](updateUser(_0x344860[_0xf269e5]));}return BPromise['all'](_0x1ffe04);})[_0xdafc('0x25')](function(){return BPromise['each'](_0x344860,function(_0xf0ba66){return db[_0xdafc('0x35')][_0xdafc('0x79')](_0xf0ba66,{'include':[{'model':db[_0xdafc('0x7f')],'as':'VoiceMail'}]})[_0xdafc('0x25')](function(_0xfd4d81){_0xf0ba66['id']=_0xfd4d81['id'];return _0xf0ba66;});});})[_0xdafc('0x25')](function(_0x233e2a){if(_0x1eb7b3[_0xdafc('0x57')][_0xdafc('0x28')]===_0xdafc('0x2a'))return _0x233e2a;if(_0x1eb7b3[_0xdafc('0x2a')][_0xdafc('0x28')]!=='user')return _0x233e2a;var _0x3a86b9=_[_0xdafc('0x84')](_0x233e2a,function(_0x4b4d60){return _0x4b4d60[_0xdafc('0x28')]==='agent'||_0x4b4d60['role']===_0xdafc('0x2c');});if(!_0x3a86b9)return _0x233e2a;return db['UserProfileSection'][_0xdafc('0x87')]({'where':{'name':{'$or':[_0xdafc('0x2b'),_0xdafc('0x88')]},'userProfileId':_0x1eb7b3[_0xdafc('0x2a')][_0xdafc('0x7e')]},'raw':!![]})[_0xdafc('0x25')](function(_0x37d67f){if(_['isEmpty'](_0x37d67f)||!_['some'](_0x37d67f,[_0xdafc('0x81'),0x0]))return _0x233e2a;_0x1ffe04=[];var _0x2adf04=_(_0x37d67f)[_0xdafc('0x2d')](function(_0x53fb07){if(_0x53fb07[_0xdafc('0x81')]===0x1)return;return _0x53fb07[_0xdafc('0x30')]===_0xdafc('0x2b')?_0xdafc('0x6a'):_0xdafc('0x2c');})[_0xdafc('0x89')]()['value']();for(var _0x11cabe=0x0;_0x11cabe<_0x233e2a[_0xdafc('0x44')];_0x11cabe++){if(!_['includes'](_0x2adf04,_0x233e2a[_0x11cabe][_0xdafc('0x28')]))return;var _0x17ef4f=_0x233e2a[_0x11cabe]['role']===_0xdafc('0x6a')?_0xdafc('0x2b'):_0xdafc('0x88');_0x1ffe04[_0xdafc('0x40')](db[_0xdafc('0x31')]['create']({'name':_0x233e2a[_0x11cabe][_0xdafc('0x30')],'resourceId':_0x233e2a[_0x11cabe]['id'],'type':_0x17ef4f,'sectionId':_[_0xdafc('0x2f')](_0x37d67f,['name',_0x17ef4f])['id']},{}));}return BPromise[_0xdafc('0x4b')](_0x1ffe04);});})[_0xdafc('0x25')](respondWithResult(_0x5271e9,0xc9))[_0xdafc('0x4c')](handleError(_0x5271e9,null));};exports['changePassword']=function(_0x2167fc,_0x552362){if(_0x2167fc[_0xdafc('0x57')]['id']){delete _0x2167fc['body']['id'];}return db[_0xdafc('0x35')]['find']({'where':{'id':_0x2167fc['params']['id']}})[_0xdafc('0x25')](function(_0x340c19){if(!_0x340c19)return null;if(_0x340c19['id']===_0x2167fc['user']['id']){if(!_0x2167fc[_0xdafc('0x57')]['oldPassword']||!_0x2167fc['body'][_0xdafc('0x8a')]){throw new db['Sequelize']['ValidationError'](_0xdafc('0x8b'));}if(!_0x340c19['authenticate'](_0x2167fc['body'][_0xdafc('0x8c')])){throw new db[(_0xdafc('0x8d'))]['ValidationError']('Wrong\x20credentials');}if(_0x2167fc['body'][_0xdafc('0x8c')]===_0x2167fc[_0xdafc('0x57')][_0xdafc('0x8a')]){throw new db[(_0xdafc('0x8d'))][(_0xdafc('0x8e'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x2167fc[_0xdafc('0x2a')][_0xdafc('0x28')]==='admin'){if(!_0x2167fc['body'][_0xdafc('0x8a')]){throw new db[(_0xdafc('0x8d'))][(_0xdafc('0x8e'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x2167fc[_0xdafc('0x2a')][_0xdafc('0x28')]===_0xdafc('0x2a')){if(!_0x2167fc[_0xdafc('0x57')]['newPassword']){throw new db[(_0xdafc('0x8d'))][(_0xdafc('0x8e'))](_0xdafc('0x8f'));}if(_0x340c19[_0xdafc('0x28')]!==_0xdafc('0x6a')){throw new db['Sequelize'][(_0xdafc('0x8e'))](_0xdafc('0x7a'));}}else{throw new db[(_0xdafc('0x8d'))][(_0xdafc('0x8e'))](_0xdafc('0x7a'));}return _0x340c19;})[_0xdafc('0x25')](handleEntityNotFound(_0x552362,null))[_0xdafc('0x25')](function(_0x28ae06){return db[_0xdafc('0x90')]['findOne']({'attributes':['id',_0xdafc('0x5e'),_0xdafc('0x91'),_0xdafc('0x92')]})[_0xdafc('0x25')](function(_0x1d22f4){if(_0x1d22f4['securePassword'])authService[_0xdafc('0x5f')](_0x2167fc[_0xdafc('0x57')][_0xdafc('0x8a')]);if(!_0x1d22f4[_0xdafc('0x91')]||!_0x28ae06['previousPasswords'])return _0x28ae06;authService[_0xdafc('0x93')](_0x2167fc['body'][_0xdafc('0x8a')],_0x28ae06['previousPasswords'],_0x1d22f4[_0xdafc('0x92')]);return _0x28ae06;})['then'](saveUpdates({'password':_0x2167fc[_0xdafc('0x57')][_0xdafc('0x8a')],'passwordResetAt':_0x2167fc[_0xdafc('0x2a')]['id']==_0x2167fc[_0xdafc('0x58')]['id']?moment():null,'previousPasswords':authService[_0xdafc('0x94')](_0x2167fc[_0xdafc('0x57')][_0xdafc('0x8a')],_0x28ae06['previousPasswords'])},null));})['then'](respondWithResult(_0x552362,null))[_0xdafc('0x4c')](handleError(_0x552362,null));};exports['addQueues']=function(_0x4ddb76,_0x46a521){var _0x12dc7f=_0x4ddb76['body']['channel'];return db[_0xdafc('0x35')]['find']({'where':{'id':_0x4ddb76[_0xdafc('0x58')]['id']},'attributes':['id',_0xdafc('0x30'),_0xdafc('0x28'),'online',_0xdafc('0x95'),'voicePause',_0xdafc('0x96')]})[_0xdafc('0x25')](handleEntityNotFound(_0x46a521,null))[_0xdafc('0x25')](function(_0x5b4fa1){if(_0x5b4fa1){if(!utils[_0xdafc('0x97')](_0x12dc7f)){throw new db[(_0xdafc('0x8d'))][(_0xdafc('0x8e'))](_0xdafc('0x98'));}return _0x5b4fa1[_0xdafc('0x99')+_[_0xdafc('0x9a')](_0x12dc7f[_0xdafc('0x9b')]())+_0xdafc('0x9c')](_0x4ddb76[_0xdafc('0x57')][_0xdafc('0x5b')],{'penalty':_0x4ddb76[_0xdafc('0x57')]['penalty']||0x0})[_0xdafc('0x9d')](function(_0x20f2e3){for(var _0xd372a9=0x0;_0xd372a9<_0x4ddb76[_0xdafc('0x57')][_0xdafc('0x5b')]['length'];_0xd372a9+=0x1){var _0x4d832e={'UserId':Number(_0x4ddb76[_0xdafc('0x58')]['id'])};_0x4d832e[_[_0xdafc('0x9a')](_0x12dc7f[_0xdafc('0x9b')]())+_0xdafc('0x9e')]=Number(_0x4ddb76[_0xdafc('0x57')][_0xdafc('0x5b')][_0xd372a9]);socket[_0xdafc('0x9f')](_0xdafc('0x2a')+_['capitalize'](_0x12dc7f[_0xdafc('0x9b')]())+_0xdafc('0xa0'),_0x4d832e);}return _0x20f2e3;})[_0xdafc('0x25')](function(){if(_0x12dc7f===_0xdafc('0xa1')){return db[_0xdafc('0xa2')][_0xdafc('0x87')]({'where':{'id':_0x4ddb76['body'][_0xdafc('0x5b')]||[]},'raw':!![],'attributes':['id',_0xdafc('0x30')]});}})['then'](function(_0x9dde0f){var _0x53c3d5=_0x5b4fa1['get']({'plain':!![]});var _0x5993a8=[];if(_0x12dc7f===_0xdafc('0xa1')&&_0x53c3d5[_0xdafc('0x28')]===_0xdafc('0x6a')&&_0x53c3d5[_0xdafc('0xa3')]){for(var _0x522550=0x0;_0x522550<_0x9dde0f[_0xdafc('0x44')];_0x522550+=0x1){_0x5993a8['push']({'membername':_0x53c3d5[_0xdafc('0x30')],'UserId':_0x53c3d5['id'],'queue_name':_0x9dde0f[_0x522550][_0xdafc('0x30')],'VoiceQueueId':_0x9dde0f[_0x522550]['id'],'interface':_[_0xdafc('0x63')](_0x53c3d5['interface'])?util[_0xdafc('0xa4')](_0xdafc('0xa5'),_0x53c3d5['name']):_0x53c3d5[_0xdafc('0x96')],'paused':_0x53c3d5[_0xdafc('0xa6')]||![],'penalty':_0x4ddb76[_0xdafc('0x57')][_0xdafc('0xa7')]||0x0});}return BPromise['each'](_0x5993a8,function(_0x2a1852){return db[_0xdafc('0xa8')][_0xdafc('0xa9')](_0x2a1852);});}return _0x5b4fa1;});}})[_0xdafc('0x25')](respondWithStatusCode(_0x46a521,null))['catch'](handleError(_0x46a521,null));};exports['removeQueues']=function(_0x53fd50,_0x43c1b3){var _0x3cc216;return db['User'][_0xdafc('0x2f')]({'where':{'id':_0x53fd50[_0xdafc('0x58')]['id']},'attributes':['id',_0xdafc('0x30'),_0xdafc('0x28')]})[_0xdafc('0x25')](handleEntityNotFound(_0x43c1b3,null))[_0xdafc('0x25')](function(_0x34b2af){if(_0x34b2af){_0x3cc216=_0x34b2af;if(!_0x53fd50['query'][_0xdafc('0xaa')]||!utils[_0xdafc('0x97')](_0x53fd50[_0xdafc('0x3d')][_0xdafc('0xaa')])){throw new db[(_0xdafc('0x8d'))][(_0xdafc('0x8e'))]('Unknown\x20channel');}return _0x34b2af[_0xdafc('0xab')+_['capitalize'](_0x53fd50['query'][_0xdafc('0xaa')][_0xdafc('0x9b')]())+'Queues'](_0x53fd50[_0xdafc('0x3d')][_0xdafc('0x5b')]);}})[_0xdafc('0x25')](function(_0x2d947a){if(_[_0xdafc('0xac')](_0x53fd50[_0xdafc('0x3d')][_0xdafc('0x5b')])){for(var _0x55c0ff=0x0;_0x55c0ff<_0x53fd50[_0xdafc('0x3d')][_0xdafc('0x5b')][_0xdafc('0x44')];_0x55c0ff+=0x1){var _0x3ec516={'UserId':Number(_0x53fd50[_0xdafc('0x58')]['id'])};_0x3ec516[_[_0xdafc('0x9a')](_0x53fd50['query'][_0xdafc('0xaa')]['toLowerCase']())+'QueueId']=Number(_0x53fd50[_0xdafc('0x3d')]['ids'][_0x55c0ff]);socket[_0xdafc('0x9f')](_0xdafc('0x2a')+_[_0xdafc('0x9a')](_0x53fd50[_0xdafc('0x3d')][_0xdafc('0xaa')]['toLowerCase']())+_0xdafc('0xad'),_0x3ec516);}}else{var _0x3ec516={'UserId':Number(_0x53fd50[_0xdafc('0x58')]['id'])};_0x3ec516[_[_0xdafc('0x9a')](_0x53fd50[_0xdafc('0x3d')][_0xdafc('0xaa')]['toLowerCase']())+_0xdafc('0x9e')]=Number(_0x53fd50['query'][_0xdafc('0x5b')]);socket['emit'](_0xdafc('0x2a')+_[_0xdafc('0x9a')](_0x53fd50[_0xdafc('0x3d')][_0xdafc('0xaa')][_0xdafc('0x9b')]())+_0xdafc('0xad'),_0x3ec516);}return _0x2d947a;})[_0xdafc('0x25')](function(){if(_0x53fd50[_0xdafc('0x3d')]['channel']===_0xdafc('0xa1')){return db['UserVoiceQueueRt'][_0xdafc('0x26')]({'where':{'UserId':_0x53fd50[_0xdafc('0x58')]['id'],'VoiceQueueId':_0x53fd50[_0xdafc('0x3d')]['ids']},'individualHooks':!![]})[_0xdafc('0x25')](function(){return _0x3cc216;});}return _0x3cc216;})[_0xdafc('0x25')](respondWithStatusCode(_0x43c1b3,null))['catch'](handleError(_0x43c1b3,null));};exports['addAvatar']=function(_0x55f1e2,_0x3f6db1){_0x55f1e2[_0xdafc('0x57')][_0xdafc('0xae')]=_0x55f1e2['file']['filename'];return db[_0xdafc('0x35')]['find']({'where':{'id':_0x55f1e2['params']['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x3f6db1,null))[_0xdafc('0x25')](saveUpdates(_0x55f1e2['body'],null))[_0xdafc('0x25')](respondWithResult(_0x3f6db1,null))[_0xdafc('0x4c')](handleError(_0x3f6db1,null));};exports[_0xdafc('0xaf')]=function(_0x1bcf6d,_0xbb419d){var _0x4ad3db=path[_0xdafc('0xb0')](config['root'],_0xdafc('0xb1'));return db[_0xdafc('0x35')]['find']({'where':{'id':_0x1bcf6d[_0xdafc('0x58')]['id']},'attributes':['id','userpic'],'raw':!![]})[_0xdafc('0x25')](handleEntityNotFound(_0xbb419d,null))[_0xdafc('0x25')](function(_0x1caaf8){if(_0x1caaf8){if(_[_0xdafc('0x63')](_0x1caaf8[_0xdafc('0xae')])){return _0xbb419d[_0xdafc('0xb2')](_0x4ad3db);}else{if(!fs['existsSync'](path[_0xdafc('0xb0')](config[_0xdafc('0xb3')],'server/files/images/',_0x1caaf8[_0xdafc('0xae')]))){return _0xbb419d[_0xdafc('0xb2')](_0x4ad3db);}return _0xbb419d[_0xdafc('0xb2')](path[_0xdafc('0xb0')](config[_0xdafc('0xb3')],_0xdafc('0xb4'),_0x1caaf8[_0xdafc('0xae')]));}}})[_0xdafc('0x4c')](handleError(_0xbb419d,null));};exports[_0xdafc('0xb5')]=function(_0x7ed3d7,_0x4a2282){return db['User'][_0xdafc('0x2f')]({'where':{'id':_0x7ed3d7[_0xdafc('0x58')]['id']},'attributes':['id']})[_0xdafc('0x25')](handleEntityNotFound(_0x4a2282,null))[_0xdafc('0x25')](function(_0x2d977f){var _0x2a3077=[];values=_0x2d977f['dataValues'];_0x2a3077['push'](get_open_tabs('chat',_0x2d977f[_0xdafc('0x46')]));_0x2a3077[_0xdafc('0x40')](get_open_tabs('sms',_0x2d977f[_0xdafc('0x46')]));_0x2a3077[_0xdafc('0x40')](get_open_tabs(_0xdafc('0x49'),_0x2d977f[_0xdafc('0x46')]));_0x2a3077[_0xdafc('0x40')](get_open_tabs(_0xdafc('0x4a'),_0x2d977f[_0xdafc('0x46')]));_0x2a3077[_0xdafc('0x40')](get_open_tabs(_0xdafc('0x48'),_0x2d977f['dataValues']));_0x2a3077[_0xdafc('0x40')](get_open_tabs(_0xdafc('0x55'),_0x2d977f[_0xdafc('0x46')]));return BPromise['all'](_0x2a3077);})[_0xdafc('0x25')](function(_0x4d4d10){var _0x4a10ac=[];if(_0x4d4d10){for(var _0x15a7f4=0x0;_0x15a7f4<values['ChatOpenTabs'][_0xdafc('0x44')];_0x15a7f4++){var _0x48e9a9=values[_0xdafc('0xb6')][_0x15a7f4];_0x4a10ac[_0xdafc('0x40')]({'channel':_0xdafc('0xb7'),'id':_0x48e9a9['id'],'createdAt':_0x48e9a9['createdAt']});}for(var _0x15a7f4=0x0;_0x15a7f4<values['FaxOpenTabs'][_0xdafc('0x44')];_0x15a7f4++){var _0x48e9a9=values[_0xdafc('0xb8')][_0x15a7f4];_0x4a10ac[_0xdafc('0x40')]({'channel':_0xdafc('0xb9'),'id':_0x48e9a9['id'],'createdAt':_0x48e9a9[_0xdafc('0xba')]});}for(var _0x15a7f4=0x0;_0x15a7f4<values[_0xdafc('0xbb')][_0xdafc('0x44')];_0x15a7f4++){var _0x48e9a9=values['OpenchannelOpenTabs'][_0x15a7f4];_0x4a10ac[_0xdafc('0x40')]({'channel':_0xdafc('0xbc'),'id':_0x48e9a9['id'],'createdAt':_0x48e9a9[_0xdafc('0xba')]});}for(var _0x15a7f4=0x0;_0x15a7f4<values[_0xdafc('0xbd')]['length'];_0x15a7f4++){var _0x48e9a9=values[_0xdafc('0xbd')][_0x15a7f4];_0x4a10ac[_0xdafc('0x40')]({'channel':_0xdafc('0xbe'),'id':_0x48e9a9['id'],'createdAt':_0x48e9a9[_0xdafc('0xba')]});}for(var _0x15a7f4=0x0;_0x15a7f4<values['SmsOpenTabs'][_0xdafc('0x44')];_0x15a7f4++){var _0x48e9a9=values['SmsOpenTabs'][_0x15a7f4];_0x4a10ac[_0xdafc('0x40')]({'channel':_0xdafc('0xbf'),'id':_0x48e9a9['id'],'createdAt':_0x48e9a9['createdAt']});}for(var _0x15a7f4=0x0;_0x15a7f4<values['WhatsappOpenTabs'][_0xdafc('0x44')];_0x15a7f4++){var _0x48e9a9=values[_0xdafc('0xc0')][_0x15a7f4];_0x4a10ac['push']({'channel':_0xdafc('0xc1'),'id':_0x48e9a9['id'],'createdAt':_0x48e9a9[_0xdafc('0xba')]});}var _0x1ca98e={'count':_0x4a10ac[_0xdafc('0x44')],'rows':_0x4a10ac};return _0x1ca98e;}else return null;})['then'](respondWithResult(_0x4a2282,null))[_0xdafc('0x4c')](handleError(_0x4a2282,null));};exports[_0xdafc('0xc2')]=function(_0x2ef6ff,_0x202603){var _0x123b68={};var _0x322438={};var _0x4cf71c;var _0x3ac587;return db[_0xdafc('0x35')][_0xdafc('0xc3')]({'where':{'id':_0x2ef6ff[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x202603,null))[_0xdafc('0x25')](function(_0x49c6aa){if(_0x49c6aa){_0x4cf71c=_0x49c6aa;_0x322438[_0xdafc('0x4e')]=_[_0xdafc('0x50')](db['CmContact'][_0xdafc('0xc4')]);_0x322438[_0xdafc('0x3d')]=_[_0xdafc('0x50')](_0x2ef6ff[_0xdafc('0x3d')]);_0x322438[_0xdafc('0xc5')]=_['intersection'](_0x322438[_0xdafc('0x4e')],_0x322438[_0xdafc('0x3d')]);_0x123b68[_0xdafc('0x3f')]=_[_0xdafc('0x51')](_0x322438['model'],qs[_0xdafc('0x52')](_0x2ef6ff[_0xdafc('0x3d')][_0xdafc('0x52')]));_0x123b68[_0xdafc('0x3f')]=_0x123b68[_0xdafc('0x3f')][_0xdafc('0x44')]?_0x123b68[_0xdafc('0x3f')]:_0x322438[_0xdafc('0x4e')];_0x123b68[_0xdafc('0xc6')]=qs[_0xdafc('0xc7')](_0x2ef6ff[_0xdafc('0x3d')][_0xdafc('0xc7')]);_0x123b68[_0xdafc('0x3c')]=qs[_0xdafc('0xc5')](_[_0xdafc('0xc8')](_0x2ef6ff[_0xdafc('0x3d')],_0x322438[_0xdafc('0xc5')]));if(_0x2ef6ff['query'][_0xdafc('0xc9')]){_0x123b68[_0xdafc('0x3c')]=_[_0xdafc('0x53')](_0x123b68[_0xdafc('0x3c')],{'$or':_[_0xdafc('0x2d')](_0x123b68[_0xdafc('0x3f')],function(_0x20fc8e){var _0x474c38={};_0x474c38[_0x20fc8e]={'$like':'%'+_0x2ef6ff[_0xdafc('0x3d')][_0xdafc('0xc9')]+'%'};return _0x474c38;})});}_0x123b68=_[_0xdafc('0x53')]({},_0x123b68,_0x2ef6ff['options']);return _0x4cf71c['getContacts'](_0x123b68);}})['then'](function(_0x4013a9){if(_0x4013a9){_0x3ac587=_0x4013a9[_0xdafc('0x44')];if(_0x2ef6ff[_0xdafc('0x3d')][_0xdafc('0xca')](_0xdafc('0x3e'))){_0x123b68[_0xdafc('0xcb')]=[{'model':db[_0xdafc('0xcc')],'as':'List','required':![]},{'model':db[_0xdafc('0xcd')],'as':_0xdafc('0xce'),'attributes':['id',_0xdafc('0x30'),_0xdafc('0xcf')],'where':_0x2ef6ff['query'][_0xdafc('0xd0')]?{'id':_0x2ef6ff['query'][_0xdafc('0xd0')]}:undefined,'required':_0x2ef6ff['query'][_0xdafc('0xd0')]?!![]:![]}];}if(!_0x2ef6ff[_0xdafc('0x3d')][_0xdafc('0xca')]('nolimit')){_0x123b68[_0xdafc('0x21')]=qs['limit'](_0x2ef6ff[_0xdafc('0x3d')][_0xdafc('0x21')]);_0x123b68[_0xdafc('0x23')]=qs[_0xdafc('0x23')](_0x2ef6ff['query'][_0xdafc('0x23')]);}return _0x4cf71c['getContacts'](_0x123b68);}})[_0xdafc('0x25')](function(_0x13c2c4){if(_0x13c2c4){return _0x13c2c4?{'count':_0x3ac587,'rows':_0x13c2c4}:null;}})[_0xdafc('0x25')](respondWithResult(_0x202603,null))[_0xdafc('0x4c')](handleError(_0x202603,null));};exports[_0xdafc('0xd1')]=function(_0x17cd26,_0x203a3c){var _0x517d6f;var _0x42edd6;var _0x58046e={};var _0x75c0a2;return db[_0xdafc('0x35')][_0xdafc('0xc3')]({'where':{'id':_0x17cd26['params']['id']},'attributes':['id',_0xdafc('0x30'),_0xdafc('0x28')]})['then'](handleEntityNotFound(_0x203a3c,null))['then'](function(_0x3d765b){if(!utils['isValidChannel'](_0x17cd26[_0xdafc('0x3d')][_0xdafc('0xaa')])){throw new db[(_0xdafc('0x8d'))][(_0xdafc('0x8e'))](_0xdafc('0x98'));}_0x517d6f=_0x3d765b;var _0x45b522={};_0x45b522['model']=_['keys'](db[_['capitalize'](_0x17cd26[_0xdafc('0x3d')][_0xdafc('0xaa')])+_0xdafc('0xd2')][_0xdafc('0xc4')]);_0x45b522['query']=_['keys'](_0x17cd26[_0xdafc('0x3d')]);_0x45b522[_0xdafc('0xc5')]=_[_0xdafc('0x51')](_0x45b522[_0xdafc('0x4e')],_0x45b522[_0xdafc('0x3d')]);_0x58046e[_0xdafc('0x3f')]=_['intersection'](_0x45b522[_0xdafc('0x4e')],qs[_0xdafc('0x52')](_0x17cd26[_0xdafc('0x3d')][_0xdafc('0x52')]));_0x58046e['attributes']=_0x58046e[_0xdafc('0x3f')][_0xdafc('0x44')]?_0x58046e[_0xdafc('0x3f')]:_0x45b522[_0xdafc('0x4e')];_0x58046e['order']=qs[_0xdafc('0xc7')](_0x17cd26[_0xdafc('0x3d')][_0xdafc('0xc7')]);_0x58046e['where']=qs['filters'](_[_0xdafc('0xc8')](_0x17cd26[_0xdafc('0x3d')],_0x45b522[_0xdafc('0xc5')]));if(_0x17cd26[_0xdafc('0x3d')][_0xdafc('0xc9')]){_0x58046e[_0xdafc('0x3c')]=_['merge'](_0x58046e[_0xdafc('0x3c')],{'$or':_[_0xdafc('0x2d')](_0x58046e['attributes'],function(_0x320e66){var _0x16bd8d={};_0x16bd8d[_0x320e66]={'$like':'%'+_0x17cd26[_0xdafc('0x3d')]['filter']+'%'};return _0x16bd8d;})});}_0x58046e=_[_0xdafc('0x53')]({},_0x58046e,_0x17cd26[_0xdafc('0x54')]);switch(_0x517d6f[_0xdafc('0x28')]){case _0xdafc('0x29'):return db[_[_0xdafc('0x9a')](_0x17cd26['query'][_0xdafc('0xaa')])+_0xdafc('0xd2')][_0xdafc('0x87')](_0x58046e);case _0xdafc('0x2a'):case _0xdafc('0x6a'):return _0x517d6f[_0xdafc('0x27')+_[_0xdafc('0x9a')](_0x17cd26[_0xdafc('0x3d')][_0xdafc('0xaa')])+_0xdafc('0x9c')](_0x58046e);default:throw new db['Sequelize']['ValidationError'](_0xdafc('0xd3'));}})[_0xdafc('0x25')](function(_0x8d8b8){_0x75c0a2=_0x8d8b8[_0xdafc('0x44')];if(!_0x17cd26['query'][_0xdafc('0xca')](_0xdafc('0xd4'))){_0x58046e[_0xdafc('0x21')]=qs[_0xdafc('0x21')](_0x17cd26['query'][_0xdafc('0x21')]);_0x58046e[_0xdafc('0x23')]=qs['offset'](_0x17cd26[_0xdafc('0x3d')][_0xdafc('0x23')]);}switch(_0x517d6f[_0xdafc('0x28')]){case'admin':return db[_[_0xdafc('0x9a')](_0x17cd26[_0xdafc('0x3d')]['channel'])+_0xdafc('0xd2')][_0xdafc('0x87')](_0x58046e);case _0xdafc('0x2a'):case _0xdafc('0x6a'):return _0x517d6f[_0xdafc('0x27')+_[_0xdafc('0x9a')](_0x17cd26[_0xdafc('0x3d')]['channel'])+_0xdafc('0x9c')](_0x58046e);}})[_0xdafc('0x25')](function(_0x3a3a24){return{'count':_0x75c0a2,'rows':_0x3a3a24};})[_0xdafc('0x25')](respondWithResult(_0x203a3c,null))[_0xdafc('0x4c')](handleError(_0x203a3c,null));};exports[_0xdafc('0xd5')]=function(_0x168226,_0x395d3d){var _0x1c56de={};var _0x59590b={};var _0x2168ee;var _0x33d0d3;return db[_0xdafc('0x35')][_0xdafc('0xc3')]({'where':{'id':_0x168226[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x395d3d,null))[_0xdafc('0x25')](function(_0x3562aa){if(_0x3562aa){_0x2168ee=_0x3562aa;_0x59590b[_0xdafc('0x4e')]=_[_0xdafc('0x50')](db[_0xdafc('0xa8')][_0xdafc('0xc4')]);_0x59590b[_0xdafc('0x3d')]=_[_0xdafc('0x50')](_0x168226[_0xdafc('0x3d')]);_0x59590b['filters']=_[_0xdafc('0x51')](_0x59590b[_0xdafc('0x4e')],_0x59590b[_0xdafc('0x3d')]);_0x1c56de[_0xdafc('0x3f')]=_[_0xdafc('0x51')](_0x59590b[_0xdafc('0x4e')],qs['fields'](_0x168226['query'][_0xdafc('0x52')]));_0x1c56de[_0xdafc('0x3f')]=_0x1c56de['attributes'][_0xdafc('0x44')]?_0x1c56de[_0xdafc('0x3f')]:_0x59590b['model'];_0x1c56de[_0xdafc('0xc6')]=qs[_0xdafc('0xc7')](_0x168226[_0xdafc('0x3d')][_0xdafc('0xc7')]);_0x1c56de[_0xdafc('0x3c')]=qs[_0xdafc('0xc5')](_[_0xdafc('0xc8')](_0x168226[_0xdafc('0x3d')],_0x59590b[_0xdafc('0xc5')]));if(_0x168226[_0xdafc('0x3d')][_0xdafc('0xc9')]){_0x1c56de[_0xdafc('0x3c')]=_[_0xdafc('0x53')](_0x1c56de[_0xdafc('0x3c')],{'$or':_[_0xdafc('0x2d')](_0x1c56de[_0xdafc('0x3f')],function(_0x4d3f13){var _0x57f316={};_0x57f316[_0x4d3f13]={'$like':'%'+_0x168226[_0xdafc('0x3d')][_0xdafc('0xc9')]+'%'};return _0x57f316;})});}_0x1c56de=_['merge']({},_0x1c56de,_0x168226['options']);return _0x2168ee['getVoiceQueuesRt'](_0x1c56de);}})[_0xdafc('0x25')](function(_0x49c199){if(_0x49c199){_0x33d0d3=_0x49c199['length'];if(!_0x168226[_0xdafc('0x3d')][_0xdafc('0xca')]('nolimit')){_0x1c56de[_0xdafc('0x21')]=qs[_0xdafc('0x21')](_0x168226[_0xdafc('0x3d')]['limit']);_0x1c56de[_0xdafc('0x23')]=qs['offset'](_0x168226[_0xdafc('0x3d')][_0xdafc('0x23')]);}return _0x2168ee['getVoiceQueuesRt'](_0x1c56de);}})[_0xdafc('0x25')](function(_0x291765){if(_0x291765){return _0x291765?{'count':_0x33d0d3,'rows':_0x291765}:null;}})[_0xdafc('0x25')](respondWithResult(_0x395d3d,null))[_0xdafc('0x4c')](handleError(_0x395d3d,null));};exports[_0xdafc('0xd6')]=function(_0x1138f2,_0x128faa){var _0xbee73e={};var _0x1669bd={};var _0x3c6e4f;var _0x5b40d8;return db['User'][_0xdafc('0xc3')]({'where':{'id':_0x1138f2[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x128faa,null))[_0xdafc('0x25')](function(_0x4659c5){if(_0x4659c5){_0x3c6e4f=_0x4659c5;_0x1669bd[_0xdafc('0x4e')]=_[_0xdafc('0x50')](db['ChatGroup']['rawAttributes']);_0x1669bd['query']=_[_0xdafc('0x50')](_0x1138f2[_0xdafc('0x3d')]);_0x1669bd[_0xdafc('0xc5')]=_[_0xdafc('0x51')](_0x1669bd[_0xdafc('0x4e')],_0x1669bd[_0xdafc('0x3d')]);_0xbee73e[_0xdafc('0x3f')]=_['intersection'](_0x1669bd[_0xdafc('0x4e')],qs['fields'](_0x1138f2[_0xdafc('0x3d')][_0xdafc('0x52')]));_0xbee73e[_0xdafc('0x3f')]=_0xbee73e[_0xdafc('0x3f')][_0xdafc('0x44')]?_0xbee73e[_0xdafc('0x3f')]:_0x1669bd[_0xdafc('0x4e')];_0xbee73e[_0xdafc('0xc6')]=qs[_0xdafc('0xc7')](_0x1138f2['query'][_0xdafc('0xc7')]);_0xbee73e[_0xdafc('0x3c')]=qs[_0xdafc('0xc5')](_['pick'](_0x1138f2[_0xdafc('0x3d')],_0x1669bd[_0xdafc('0xc5')]));if(_0x1138f2[_0xdafc('0x3d')][_0xdafc('0xc9')]){_0xbee73e[_0xdafc('0x3c')]=_[_0xdafc('0x53')](_0xbee73e['where'],{'$or':_[_0xdafc('0x2d')](_0xbee73e[_0xdafc('0x3f')],function(_0x3fd18f){var _0x5af811={};_0x5af811[_0x3fd18f]={'$like':'%'+_0x1138f2['query']['filter']+'%'};return _0x5af811;})});}_0xbee73e=_[_0xdafc('0x53')]({},_0xbee73e,_0x1138f2[_0xdafc('0x54')]);return _0x3c6e4f[_0xdafc('0xd6')](_0xbee73e);}})['then'](function(_0x43b185){if(_0x43b185){_0x5b40d8=_0x43b185[_0xdafc('0x44')];if(!_0x1138f2['query'][_0xdafc('0xca')](_0xdafc('0xd4'))){_0xbee73e[_0xdafc('0x21')]=qs[_0xdafc('0x21')](_0x1138f2[_0xdafc('0x3d')][_0xdafc('0x21')]);_0xbee73e['offset']=qs[_0xdafc('0x23')](_0x1138f2[_0xdafc('0x3d')][_0xdafc('0x23')]);}return _0x3c6e4f[_0xdafc('0xd6')](_0xbee73e);}})[_0xdafc('0x25')](function(_0x2e08f6){if(_0x2e08f6){return _0x2e08f6?{'count':_0x5b40d8,'rows':_0x2e08f6}:null;}})[_0xdafc('0x25')](respondWithResult(_0x128faa,null))[_0xdafc('0x4c')](handleError(_0x128faa,null));};exports[_0xdafc('0xd7')]=function(_0x31fc39,_0xb7845a){var _0x228f37={'raw':!![],'where':{}};var _0x496d9d={};var _0x517618={'count':0x0,'rows':[]};return db[_0xdafc('0x35')][_0xdafc('0xc3')]({'where':{'id':_0x31fc39[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0xb7845a,null))[_0xdafc('0x25')](function(_0x3051b6){if(_0x3051b6){_0x496d9d[_0xdafc('0x4e')]=_[_0xdafc('0x50')](db[_0xdafc('0xd8')][_0xdafc('0xc4')]);_0x496d9d['query']=_[_0xdafc('0x50')](_0x31fc39['query']);_0x496d9d['filters']=_[_0xdafc('0x51')](_0x496d9d[_0xdafc('0x4e')],_0x496d9d[_0xdafc('0x3d')]);_0x228f37[_0xdafc('0x3f')]=_['intersection'](_0x496d9d[_0xdafc('0x4e')],qs[_0xdafc('0x52')](_0x31fc39[_0xdafc('0x3d')][_0xdafc('0x52')]));_0x228f37[_0xdafc('0x3f')]=_0x228f37[_0xdafc('0x3f')][_0xdafc('0x44')]?_0x228f37[_0xdafc('0x3f')]:_0x496d9d[_0xdafc('0x4e')];if(!_0x31fc39['query'][_0xdafc('0xca')](_0xdafc('0xd4'))){_0x228f37[_0xdafc('0x21')]=qs['limit'](_0x31fc39[_0xdafc('0x3d')]['limit']);_0x228f37[_0xdafc('0x23')]=qs[_0xdafc('0x23')](_0x31fc39[_0xdafc('0x3d')][_0xdafc('0x23')]);}_0x228f37['order']=qs[_0xdafc('0xc7')](_0x31fc39[_0xdafc('0x3d')]['sort']);_0x228f37[_0xdafc('0x3c')]=qs[_0xdafc('0xc5')](_['pick'](_0x31fc39[_0xdafc('0x3d')],_0x496d9d[_0xdafc('0xc5')]));_0x228f37[_0xdafc('0x3c')][_0xdafc('0xd9')]=_0x3051b6['id'];if(_0x31fc39[_0xdafc('0x3d')][_0xdafc('0xc9')]){_0x228f37[_0xdafc('0x3c')]=_[_0xdafc('0x53')](_0x228f37[_0xdafc('0x3c')],{'$or':_[_0xdafc('0x2d')](_0x228f37[_0xdafc('0x3f')],function(_0x35be0d){var _0x134a89={};_0x134a89[_0x35be0d]={'$like':'%'+_0x31fc39[_0xdafc('0x3d')][_0xdafc('0xc9')]+'%'};return _0x134a89;})});}_0x228f37=_[_0xdafc('0x53')]({},_0x228f37,_0x31fc39[_0xdafc('0x54')]);return db[_0xdafc('0xd8')][_0xdafc('0x22')]({'where':_0x228f37[_0xdafc('0x3c')]})[_0xdafc('0x25')](function(_0x50c4eb){_0x517618[_0xdafc('0x22')]=_0x50c4eb;if(_0x31fc39[_0xdafc('0x3d')][_0xdafc('0x3e')]){_0x228f37['include']=[{'all':!![]}];}return db[_0xdafc('0xd8')][_0xdafc('0x87')](_0x228f37);})[_0xdafc('0x25')](function(_0x4ff366){_0x517618['rows']=_0x4ff366;return _0x517618;});}})['then'](respondWithFilteredResult(_0xb7845a,_0x228f37))[_0xdafc('0x4c')](handleError(_0xb7845a,null));};exports[_0xdafc('0xda')]=function(_0x43b398,_0x4e5fd8){var _0x37d5f0={'raw':!![],'where':{}};var _0x3aa6b2={};var _0x1b7200={'count':0x0,'rows':[]};return db['User'][_0xdafc('0xc3')]({'where':{'id':_0x43b398[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x4e5fd8,null))[_0xdafc('0x25')](function(_0x2f2a1a){if(_0x2f2a1a){_0x3aa6b2[_0xdafc('0x4e')]=_[_0xdafc('0x50')](db[_0xdafc('0xdb')][_0xdafc('0xc4')]);_0x3aa6b2[_0xdafc('0x3d')]=_[_0xdafc('0x50')](_0x43b398['query']);_0x3aa6b2[_0xdafc('0xc5')]=_[_0xdafc('0x51')](_0x3aa6b2['model'],_0x3aa6b2[_0xdafc('0x3d')]);_0x37d5f0[_0xdafc('0x3f')]=_[_0xdafc('0x51')](_0x3aa6b2['model'],qs[_0xdafc('0x52')](_0x43b398['query'][_0xdafc('0x52')]));_0x37d5f0[_0xdafc('0x3f')]=_0x37d5f0[_0xdafc('0x3f')][_0xdafc('0x44')]?_0x37d5f0['attributes']:_0x3aa6b2['model'];if(!_0x43b398[_0xdafc('0x3d')][_0xdafc('0xca')](_0xdafc('0xd4'))){_0x37d5f0[_0xdafc('0x21')]=qs[_0xdafc('0x21')](_0x43b398[_0xdafc('0x3d')][_0xdafc('0x21')]);_0x37d5f0[_0xdafc('0x23')]=qs[_0xdafc('0x23')](_0x43b398[_0xdafc('0x3d')][_0xdafc('0x23')]);}_0x37d5f0[_0xdafc('0xc6')]=qs[_0xdafc('0xc7')](_0x43b398[_0xdafc('0x3d')][_0xdafc('0xc7')]);_0x37d5f0[_0xdafc('0x3c')]=qs['filters'](_[_0xdafc('0xc8')](_0x43b398['query'],_0x3aa6b2['filters']));_0x37d5f0[_0xdafc('0x3c')][_0xdafc('0xd9')]=_0x2f2a1a['id'];if(_0x43b398['query'][_0xdafc('0xc9')]){_0x37d5f0[_0xdafc('0x3c')]=_[_0xdafc('0x53')](_0x37d5f0[_0xdafc('0x3c')],{'$or':_[_0xdafc('0x2d')](_0x37d5f0[_0xdafc('0x3f')],function(_0x3b07c6){var _0x2a842e={};_0x2a842e[_0x3b07c6]={'$like':'%'+_0x43b398['query']['filter']+'%'};return _0x2a842e;})});}_0x37d5f0=_['merge']({},_0x37d5f0,_0x43b398['options']);return db[_0xdafc('0xdb')][_0xdafc('0x22')]({'where':_0x37d5f0[_0xdafc('0x3c')]})[_0xdafc('0x25')](function(_0x4277f8){_0x1b7200['count']=_0x4277f8;if(_0x43b398[_0xdafc('0x3d')][_0xdafc('0x3e')]){_0x37d5f0[_0xdafc('0xcb')]=[{'all':!![]}];}return db[_0xdafc('0xdb')][_0xdafc('0x87')](_0x37d5f0);})[_0xdafc('0x25')](function(_0x36dc50){_0x1b7200['rows']=_0x36dc50;return _0x1b7200;});}})[_0xdafc('0x25')](respondWithFilteredResult(_0x4e5fd8,_0x37d5f0))['catch'](handleError(_0x4e5fd8,null));};exports['getChatInteractions']=function(_0x13d02c,_0x4819d5){var _0x202dfd={};var _0x4f934a={};var _0x2054ae;var _0x538388;return db[_0xdafc('0x35')][_0xdafc('0xc3')]({'where':{'id':_0x13d02c[_0xdafc('0x58')]['id']}})['then'](handleEntityNotFound(_0x4819d5,null))[_0xdafc('0x25')](function(_0x33da1c){if(_0x33da1c){_0x2054ae=_0x33da1c;_0x4f934a[_0xdafc('0x4e')]=_[_0xdafc('0x50')](db[_0xdafc('0xdc')]['rawAttributes']);_0x4f934a['query']=_[_0xdafc('0x50')](_0x13d02c[_0xdafc('0x3d')]);_0x4f934a[_0xdafc('0xc5')]=_[_0xdafc('0x51')](_0x4f934a[_0xdafc('0x4e')],_0x4f934a[_0xdafc('0x3d')]);_0x202dfd['attributes']=_[_0xdafc('0x51')](_0x4f934a[_0xdafc('0x4e')],qs['fields'](_0x13d02c[_0xdafc('0x3d')]['fields']));_0x202dfd['attributes']=_0x202dfd[_0xdafc('0x3f')][_0xdafc('0x44')]?_0x202dfd[_0xdafc('0x3f')]:_0x4f934a[_0xdafc('0x4e')];_0x202dfd[_0xdafc('0xc6')]=qs[_0xdafc('0xc7')](_0x13d02c['query'][_0xdafc('0xc7')]);_0x202dfd['where']=qs['filters'](_[_0xdafc('0xc8')](_0x13d02c['query'],_0x4f934a[_0xdafc('0xc5')]));if(_0x13d02c[_0xdafc('0x3d')]['filter']){_0x202dfd[_0xdafc('0x3c')]=_[_0xdafc('0x53')](_0x202dfd[_0xdafc('0x3c')],{'$or':_[_0xdafc('0x2d')](_0x202dfd[_0xdafc('0x3f')],function(_0x4b79e9){var _0x1ca9bf={};_0x1ca9bf[_0x4b79e9]={'$like':'%'+_0x13d02c[_0xdafc('0x3d')][_0xdafc('0xc9')]+'%'};return _0x1ca9bf;})});}_0x202dfd=_[_0xdafc('0x53')]({},_0x202dfd,_0x13d02c[_0xdafc('0x54')]);return _0x2054ae[_0xdafc('0xdd')](_0x202dfd);}})[_0xdafc('0x25')](function(_0x52287f){if(_0x52287f){_0x538388=_0x52287f[_0xdafc('0x44')];if(!_0x13d02c[_0xdafc('0x3d')][_0xdafc('0xca')](_0xdafc('0xd4'))){_0x202dfd[_0xdafc('0x21')]=qs[_0xdafc('0x21')](_0x13d02c[_0xdafc('0x3d')][_0xdafc('0x21')]);_0x202dfd[_0xdafc('0x23')]=qs['offset'](_0x13d02c[_0xdafc('0x3d')][_0xdafc('0x23')]);}return _0x2054ae[_0xdafc('0xdd')](_0x202dfd);}})['then'](function(_0x356f5d){if(_0x356f5d){return _0x356f5d?{'count':_0x538388,'rows':_0x356f5d}:null;}})[_0xdafc('0x25')](respondWithResult(_0x4819d5,null))['catch'](handleError(_0x4819d5,null));};exports[_0xdafc('0xde')]=function(_0x455481,_0x35c679){var _0x4a16bb={};var _0x2e4d57={};var _0x5b32f6;var _0x115086;return db[_0xdafc('0x35')]['findOne']({'where':{'id':_0x455481[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x35c679,null))['then'](function(_0x376de){if(_0x376de){_0x5b32f6=_0x376de;_0x2e4d57[_0xdafc('0x4e')]=_[_0xdafc('0x50')](db[_0xdafc('0xdf')][_0xdafc('0xc4')]);_0x2e4d57[_0xdafc('0x3d')]=_['keys'](_0x455481[_0xdafc('0x3d')]);_0x2e4d57['filters']=_[_0xdafc('0x51')](_0x2e4d57[_0xdafc('0x4e')],_0x2e4d57['query']);_0x4a16bb[_0xdafc('0x3f')]=_[_0xdafc('0x51')](_0x2e4d57['model'],qs[_0xdafc('0x52')](_0x455481[_0xdafc('0x3d')]['fields']));_0x4a16bb[_0xdafc('0x3f')]=_0x4a16bb[_0xdafc('0x3f')][_0xdafc('0x44')]?_0x4a16bb[_0xdafc('0x3f')]:_0x2e4d57[_0xdafc('0x4e')];_0x4a16bb[_0xdafc('0xc6')]=qs[_0xdafc('0xc7')](_0x455481[_0xdafc('0x3d')]['sort']);_0x4a16bb[_0xdafc('0x3c')]=qs['filters'](_[_0xdafc('0xc8')](_0x455481[_0xdafc('0x3d')],_0x2e4d57[_0xdafc('0xc5')]));if(_0x455481[_0xdafc('0x3d')][_0xdafc('0xc9')]){_0x4a16bb[_0xdafc('0x3c')]=_[_0xdafc('0x53')](_0x4a16bb[_0xdafc('0x3c')],{'$or':_['map'](_0x4a16bb[_0xdafc('0x3f')],function(_0x281a4c){var _0x46a8de={};_0x46a8de[_0x281a4c]={'$like':'%'+_0x455481[_0xdafc('0x3d')][_0xdafc('0xc9')]+'%'};return _0x46a8de;})});}_0x4a16bb=_['merge']({},_0x4a16bb,_0x455481[_0xdafc('0x54')]);return _0x5b32f6[_0xdafc('0xde')](_0x4a16bb);}})[_0xdafc('0x25')](function(_0x192d07){if(_0x192d07){_0x115086=_0x192d07[_0xdafc('0x44')];if(!_0x455481[_0xdafc('0x3d')][_0xdafc('0xca')](_0xdafc('0xd4'))){_0x4a16bb[_0xdafc('0x21')]=qs[_0xdafc('0x21')](_0x455481[_0xdafc('0x3d')][_0xdafc('0x21')]);_0x4a16bb[_0xdafc('0x23')]=qs[_0xdafc('0x23')](_0x455481['query'][_0xdafc('0x23')]);}return _0x5b32f6[_0xdafc('0xde')](_0x4a16bb);}})[_0xdafc('0x25')](function(_0x228a5e){if(_0x228a5e){return _0x228a5e?{'count':_0x115086,'rows':_0x228a5e}:null;}})['then'](respondWithResult(_0x35c679,null))[_0xdafc('0x4c')](handleError(_0x35c679,null));};exports[_0xdafc('0xe0')]=function(_0x187b7e,_0x1e8386){var _0xebb202={'raw':!![],'where':{}};var _0x23fe0d={};var _0x5394a0={'count':0x0,'rows':[]};return db[_0xdafc('0x35')]['findOne']({'where':{'id':_0x187b7e[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x1e8386,null))[_0xdafc('0x25')](function(_0x5c85ce){if(_0x5c85ce){_0x23fe0d['model']=_['keys'](db[_0xdafc('0xe1')][_0xdafc('0xc4')]);_0x23fe0d[_0xdafc('0x3d')]=_[_0xdafc('0x50')](_0x187b7e[_0xdafc('0x3d')]);_0x23fe0d['filters']=_[_0xdafc('0x51')](_0x23fe0d['model'],_0x23fe0d[_0xdafc('0x3d')]);_0xebb202[_0xdafc('0x3f')]=_[_0xdafc('0x51')](_0x23fe0d[_0xdafc('0x4e')],qs[_0xdafc('0x52')](_0x187b7e['query'][_0xdafc('0x52')]));_0xebb202[_0xdafc('0x3f')]=_0xebb202[_0xdafc('0x3f')][_0xdafc('0x44')]?_0xebb202['attributes']:_0x23fe0d[_0xdafc('0x4e')];if(!_0x187b7e[_0xdafc('0x3d')]['hasOwnProperty'](_0xdafc('0xd4'))){_0xebb202[_0xdafc('0x21')]=qs[_0xdafc('0x21')](_0x187b7e[_0xdafc('0x3d')][_0xdafc('0x21')]);_0xebb202[_0xdafc('0x23')]=qs[_0xdafc('0x23')](_0x187b7e['query'][_0xdafc('0x23')]);}_0xebb202['order']=qs[_0xdafc('0xc7')](_0x187b7e[_0xdafc('0x3d')]['sort']);_0xebb202[_0xdafc('0x3c')]=qs[_0xdafc('0xc5')](_['pick'](_0x187b7e[_0xdafc('0x3d')],_0x23fe0d[_0xdafc('0xc5')]));_0xebb202[_0xdafc('0x3c')][_0xdafc('0xd9')]=_0x5c85ce['id'];if(_0x187b7e[_0xdafc('0x3d')][_0xdafc('0xc9')]){_0xebb202[_0xdafc('0x3c')]=_['merge'](_0xebb202[_0xdafc('0x3c')],{'$or':_[_0xdafc('0x2d')](_0xebb202[_0xdafc('0x3f')],function(_0xb46042){var _0x5861d4={};_0x5861d4[_0xb46042]={'$like':'%'+_0x187b7e[_0xdafc('0x3d')][_0xdafc('0xc9')]+'%'};return _0x5861d4;})});}_0xebb202=_[_0xdafc('0x53')]({},_0xebb202,_0x187b7e['options']);return db[_0xdafc('0xe1')][_0xdafc('0x22')]({'where':_0xebb202[_0xdafc('0x3c')]})[_0xdafc('0x25')](function(_0xc9dd2){_0x5394a0[_0xdafc('0x22')]=_0xc9dd2;if(_0x187b7e[_0xdafc('0x3d')][_0xdafc('0x3e')]){_0xebb202['include']=[{'all':!![]}];}return db['MailInteraction'][_0xdafc('0x87')](_0xebb202);})[_0xdafc('0x25')](function(_0x49737d){_0x5394a0[_0xdafc('0x41')]=_0x49737d;return _0x5394a0;});}})[_0xdafc('0x25')](respondWithFilteredResult(_0x1e8386,_0xebb202))[_0xdafc('0x4c')](handleError(_0x1e8386,null));};exports['getSmsInteractions']=function(_0x28bc2e,_0x367337){var _0x1a13ea={};var _0x50d890={};var _0x133226;var _0x5b1526;return db[_0xdafc('0x35')][_0xdafc('0xc3')]({'where':{'id':_0x28bc2e[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x367337,null))['then'](function(_0x10fec4){if(_0x10fec4){_0x133226=_0x10fec4;_0x50d890['model']=_['keys'](db[_0xdafc('0xe2')][_0xdafc('0xc4')]);_0x50d890[_0xdafc('0x3d')]=_[_0xdafc('0x50')](_0x28bc2e[_0xdafc('0x3d')]);_0x50d890[_0xdafc('0xc5')]=_[_0xdafc('0x51')](_0x50d890[_0xdafc('0x4e')],_0x50d890[_0xdafc('0x3d')]);_0x1a13ea[_0xdafc('0x3f')]=_[_0xdafc('0x51')](_0x50d890[_0xdafc('0x4e')],qs['fields'](_0x28bc2e['query']['fields']));_0x1a13ea[_0xdafc('0x3f')]=_0x1a13ea[_0xdafc('0x3f')][_0xdafc('0x44')]?_0x1a13ea[_0xdafc('0x3f')]:_0x50d890[_0xdafc('0x4e')];_0x1a13ea[_0xdafc('0xc6')]=qs[_0xdafc('0xc7')](_0x28bc2e[_0xdafc('0x3d')]['sort']);_0x1a13ea['where']=qs[_0xdafc('0xc5')](_[_0xdafc('0xc8')](_0x28bc2e['query'],_0x50d890[_0xdafc('0xc5')]));if(_0x28bc2e['query'][_0xdafc('0xc9')]){_0x1a13ea[_0xdafc('0x3c')]=_[_0xdafc('0x53')](_0x1a13ea[_0xdafc('0x3c')],{'$or':_[_0xdafc('0x2d')](_0x1a13ea[_0xdafc('0x3f')],function(_0x36b2da){var _0x51a7f0={};_0x51a7f0[_0x36b2da]={'$like':'%'+_0x28bc2e['query'][_0xdafc('0xc9')]+'%'};return _0x51a7f0;})});}_0x1a13ea=_[_0xdafc('0x53')]({},_0x1a13ea,_0x28bc2e['options']);return _0x133226[_0xdafc('0xe3')](_0x1a13ea);}})[_0xdafc('0x25')](function(_0x5bc88f){if(_0x5bc88f){_0x5b1526=_0x5bc88f[_0xdafc('0x44')];if(!_0x28bc2e[_0xdafc('0x3d')][_0xdafc('0xca')]('nolimit')){_0x1a13ea[_0xdafc('0x21')]=qs['limit'](_0x28bc2e[_0xdafc('0x3d')][_0xdafc('0x21')]);_0x1a13ea[_0xdafc('0x23')]=qs[_0xdafc('0x23')](_0x28bc2e[_0xdafc('0x3d')]['offset']);}return _0x133226[_0xdafc('0xe3')](_0x1a13ea);}})[_0xdafc('0x25')](function(_0x289ca7){if(_0x289ca7){return _0x289ca7?{'count':_0x5b1526,'rows':_0x289ca7}:null;}})[_0xdafc('0x25')](respondWithResult(_0x367337,null))['catch'](handleError(_0x367337,null));};exports[_0xdafc('0xe4')]=function(_0x12b593,_0x6aca11){var _0xcd3d07={};var _0x56c984={};var _0x994923;var _0x183b32;return db[_0xdafc('0x35')]['findOne']({'where':{'id':_0x12b593[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x6aca11,null))['then'](function(_0x4fb390){if(_0x4fb390){_0x994923=_0x4fb390;_0x56c984[_0xdafc('0x4e')]=_[_0xdafc('0x50')](db['FaxInteraction'][_0xdafc('0xc4')]);_0x56c984[_0xdafc('0x3d')]=_[_0xdafc('0x50')](_0x12b593['query']);_0x56c984[_0xdafc('0xc5')]=_[_0xdafc('0x51')](_0x56c984['model'],_0x56c984[_0xdafc('0x3d')]);_0xcd3d07['attributes']=_[_0xdafc('0x51')](_0x56c984[_0xdafc('0x4e')],qs[_0xdafc('0x52')](_0x12b593[_0xdafc('0x3d')][_0xdafc('0x52')]));_0xcd3d07[_0xdafc('0x3f')]=_0xcd3d07[_0xdafc('0x3f')][_0xdafc('0x44')]?_0xcd3d07[_0xdafc('0x3f')]:_0x56c984['model'];_0xcd3d07['order']=qs[_0xdafc('0xc7')](_0x12b593[_0xdafc('0x3d')][_0xdafc('0xc7')]);_0xcd3d07[_0xdafc('0x3c')]=qs[_0xdafc('0xc5')](_[_0xdafc('0xc8')](_0x12b593[_0xdafc('0x3d')],_0x56c984[_0xdafc('0xc5')]));if(_0x12b593[_0xdafc('0x3d')][_0xdafc('0xc9')]){_0xcd3d07[_0xdafc('0x3c')]=_['merge'](_0xcd3d07[_0xdafc('0x3c')],{'$or':_[_0xdafc('0x2d')](_0xcd3d07[_0xdafc('0x3f')],function(_0xce67af){var _0x57bf10={};_0x57bf10[_0xce67af]={'$like':'%'+_0x12b593[_0xdafc('0x3d')][_0xdafc('0xc9')]+'%'};return _0x57bf10;})});}_0xcd3d07=_['merge']({},_0xcd3d07,_0x12b593[_0xdafc('0x54')]);return _0x994923['getFaxInteractions'](_0xcd3d07);}})['then'](function(_0xd7848b){if(_0xd7848b){_0x183b32=_0xd7848b['length'];if(!_0x12b593['query'][_0xdafc('0xca')](_0xdafc('0xd4'))){_0xcd3d07['limit']=qs[_0xdafc('0x21')](_0x12b593[_0xdafc('0x3d')][_0xdafc('0x21')]);_0xcd3d07[_0xdafc('0x23')]=qs[_0xdafc('0x23')](_0x12b593[_0xdafc('0x3d')]['offset']);}return _0x994923[_0xdafc('0xe4')](_0xcd3d07);}})['then'](function(_0x1d75c3){if(_0x1d75c3){return _0x1d75c3?{'count':_0x183b32,'rows':_0x1d75c3}:null;}})[_0xdafc('0x25')](respondWithResult(_0x6aca11,null))[_0xdafc('0x4c')](handleError(_0x6aca11,null));};exports[_0xdafc('0xe5')]=function(_0x39fedb,_0x48db3b){var _0x226b78={};var _0x4ade25={};var _0x2f0588;var _0x4f9296;return db[_0xdafc('0x35')][_0xdafc('0xc3')]({'where':{'id':_0x39fedb[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x48db3b,null))['then'](function(_0x3e8238){if(_0x3e8238){_0x2f0588=_0x3e8238;_0x4ade25['model']=_[_0xdafc('0x50')](db['WhatsappInteraction'][_0xdafc('0xc4')]);_0x4ade25[_0xdafc('0x3d')]=_[_0xdafc('0x50')](_0x39fedb['query']);_0x4ade25[_0xdafc('0xc5')]=_[_0xdafc('0x51')](_0x4ade25[_0xdafc('0x4e')],_0x4ade25[_0xdafc('0x3d')]);_0x226b78['attributes']=_[_0xdafc('0x51')](_0x4ade25[_0xdafc('0x4e')],qs[_0xdafc('0x52')](_0x39fedb[_0xdafc('0x3d')][_0xdafc('0x52')]));_0x226b78[_0xdafc('0x3f')]=_0x226b78[_0xdafc('0x3f')][_0xdafc('0x44')]?_0x226b78[_0xdafc('0x3f')]:_0x4ade25[_0xdafc('0x4e')];_0x226b78[_0xdafc('0xc6')]=qs[_0xdafc('0xc7')](_0x39fedb[_0xdafc('0x3d')][_0xdafc('0xc7')]);_0x226b78[_0xdafc('0x3c')]=qs[_0xdafc('0xc5')](_[_0xdafc('0xc8')](_0x39fedb[_0xdafc('0x3d')],_0x4ade25[_0xdafc('0xc5')]));if(_0x39fedb[_0xdafc('0x3d')][_0xdafc('0xc9')]){_0x226b78[_0xdafc('0x3c')]=_[_0xdafc('0x53')](_0x226b78['where'],{'$or':_[_0xdafc('0x2d')](_0x226b78[_0xdafc('0x3f')],function(_0x4e2203){var _0x1cb32f={};_0x1cb32f[_0x4e2203]={'$like':'%'+_0x39fedb[_0xdafc('0x3d')][_0xdafc('0xc9')]+'%'};return _0x1cb32f;})});}_0x226b78=_[_0xdafc('0x53')]({},_0x226b78,_0x39fedb[_0xdafc('0x54')]);return _0x2f0588[_0xdafc('0xe5')](_0x226b78);}})[_0xdafc('0x25')](function(_0x58a6cf){if(_0x58a6cf){_0x4f9296=_0x58a6cf[_0xdafc('0x44')];if(!_0x39fedb[_0xdafc('0x3d')][_0xdafc('0xca')](_0xdafc('0xd4'))){_0x226b78[_0xdafc('0x21')]=qs[_0xdafc('0x21')](_0x39fedb[_0xdafc('0x3d')]['limit']);_0x226b78[_0xdafc('0x23')]=qs[_0xdafc('0x23')](_0x39fedb[_0xdafc('0x3d')][_0xdafc('0x23')]);}return _0x2f0588[_0xdafc('0xe5')](_0x226b78);}})['then'](function(_0x626313){if(_0x626313){return _0x626313?{'count':_0x4f9296,'rows':_0x626313}:null;}})['then'](respondWithResult(_0x48db3b,null))['catch'](handleError(_0x48db3b,null));};exports[_0xdafc('0xe6')]=function(_0xd874a5,_0x406ebf,_0x2def90){var _0x3fe1fe;var _0x5c3c46;var _0x6ab25a;var _0x4ebb11=!_[_0xdafc('0x63')](_0xd874a5['params']['id'])?_0xd874a5[_0xdafc('0x58')]['id']:!_['isNil'](_0xd874a5[_0xdafc('0x2a')]['id'])?_0xd874a5[_0xdafc('0x2a')]['id']:null;return db['User']['find']({'where':{'id':_0x4ebb11,'role':{'$or':['admin',_0xdafc('0x2a'),_0xdafc('0x6a')]}},'attributes':['id',_0xdafc('0x30'),'phone',_0xdafc('0xe7'),_0xdafc('0x28'),_0xdafc('0x61'),_0xdafc('0x95')]})[_0xdafc('0x25')](function(_0x2c3792){if(_0x2c3792){if(_0x2c3792[_0xdafc('0x28')]===_0xdafc('0x6a')){_0x3fe1fe=_0x2c3792;if(_0xd874a5['body'][_0xdafc('0x96')]){_0x6ab25a=util['format'](_0xdafc('0xe8'),_0x3fe1fe[_0xd874a5[_0xdafc('0x57')][_0xdafc('0x96')]]);}else if(_0xd874a5['body'][_0xdafc('0xe9')]){_0x6ab25a=util[_0xdafc('0xa4')](_0xdafc('0xa5'),_0xd874a5[_0xdafc('0x57')]['intrf']);}else{_0x6ab25a=util[_0xdafc('0xa4')](_0xdafc('0xa5'),_0x3fe1fe[_0xdafc('0x30')]);}socket['to'](util[_0xdafc('0xa4')](_0xdafc('0xea'),_0x3fe1fe[_0xdafc('0x30')]))[_0xdafc('0x9f')](_0xdafc('0xeb'),{'user':{'id':_0x3fe1fe['id'],'name':_0x3fe1fe['name']},'ip':_0xd874a5['headers'][_0xdafc('0xec')]||_0xd874a5[_0xdafc('0xed')][_0xdafc('0xee')]||_0xd874a5[_0xdafc('0xef')][_0xdafc('0xee')]||_0xd874a5['connection'][_0xdafc('0xef')][_0xdafc('0xee')]});return db['UserVoiceQueueRt'][_0xdafc('0x26')]({'where':{'membername':_0x3fe1fe[_0xdafc('0x30')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0xdafc('0x8e'))](_0xdafc('0xf0'));}})[_0xdafc('0x25')](function(){if(_0x3fe1fe){return _0x3fe1fe[_0xdafc('0xf1')]({'raw':!![]});}})[_0xdafc('0x25')](function(_0x3432d8){if(_0x3fe1fe){var _0x4c8c0d=[];if(_0x3432d8){_0x5c3c46=_0x3432d8;if(_0x5c3c46['length']){for(var _0x308fcc=0x0;_0x308fcc<_0x5c3c46['length'];_0x308fcc++){_0x4c8c0d[_0xdafc('0x40')]({'membername':_0x3fe1fe[_0xdafc('0x30')],'UserId':_0x3fe1fe['id'],'queue_name':_0x5c3c46[_0x308fcc][_0xdafc('0x30')],'VoiceQueueId':_0x5c3c46[_0x308fcc]['id'],'interface':_0x6ab25a,'paused':_0x3fe1fe[_0xdafc('0x95')]||![],'penalty':_0x5c3c46[_0x308fcc][_0xdafc('0xf2')]||0x0});}return BPromise[_0xdafc('0xf3')](_0x4c8c0d,function(_0x564fd1){return db[_0xdafc('0xa8')][_0xdafc('0xa9')](_0x564fd1);});}}}})['then'](function(){if(_0x3fe1fe){return db['MemberReport']['findAll']({'where':{'membername':_0x3fe1fe['name'],'exitAt':null}});}})['then'](function(_0x1057cb){if(_0x3fe1fe){var _0x5ec362=[];_0x1057cb[_0xdafc('0xf4')](function(_0x2996f9){_0x5ec362[_0xdafc('0x40')](_0x2996f9[_0xdafc('0x56')]({'exitAt':moment()[_0xdafc('0xa4')](_0xdafc('0xf5'))}));});return BPromise[_0xdafc('0x4b')](_0x5ec362);}})[_0xdafc('0x25')](function(){if(_0x3fe1fe){var _0x5882bc=[];var _0x38cc49=[];var _0x3a50b7=utils[_0xdafc('0xf6')]();var _0x29509b={'membername':_0x3fe1fe['name'],'interface':_0x6ab25a,'enterAt':moment()['format'](_0xdafc('0xf5')),'role':_0x3fe1fe[_0xdafc('0x28')],'internal':_0x3fe1fe['internal']};_0x3a50b7['forEach'](function(_0x1709c4){_0x5882bc[_0xdafc('0x40')](_[_0xdafc('0x53')]({'channel':_0x1709c4,'type':_0xdafc('0xf7'),'data1':_0xd874a5[_0xdafc('0x57')][_0xdafc('0xf8')],'data2':_0x6ab25a},_0x29509b));if(_0x3fe1fe[_0xdafc('0x95')]){_0x38cc49['push'](_['merge']({'channel':_0x1709c4,'type':'PAUSE','data1':'LOGININPAUSE'},_0x29509b));}});return db[_0xdafc('0xf9')][_0xdafc('0x83')](_0x5882bc[_0xdafc('0xfa')](_0x38cc49),{'individualHooks':!![]});}})[_0xdafc('0x25')](function(){if(_0x3fe1fe){return _0x3fe1fe[_0xdafc('0x56')]({'online':!![],'lastLoginAt':moment()[_0xdafc('0xa4')](_0xdafc('0xf5')),'voicePause':_0x3fe1fe[_0xdafc('0x95')]||![],'mailPause':_0x3fe1fe['loginInPause']||![],'chatPause':_0x3fe1fe[_0xdafc('0x95')]||![],'faxPause':_0x3fe1fe[_0xdafc('0x95')]||![],'smsPause':_0x3fe1fe[_0xdafc('0x95')]||![],'openchannelPause':_0x3fe1fe['loginInPause']||![],'whatsappPause':_0x3fe1fe[_0xdafc('0x95')]||![],'pauseType':_0x3fe1fe[_0xdafc('0x95')]?'LOGININPAUSE':null,'interface':_0x6ab25a,'lastPauseAt':moment()[_0xdafc('0xa4')](_0xdafc('0xf5'))});}})[_0xdafc('0x25')](function(_0xe77783){if(_0xd874a5[_0xdafc('0xfb')]){return _0x2def90();}else{return BPromise[_0xdafc('0xfc')](_0xe77783)[_0xdafc('0x25')](respondWithResult(_0x406ebf,null));}})[_0xdafc('0x4c')](handleError(_0x406ebf,null));};exports[_0xdafc('0xfd')]=function(_0x21d53c,_0x50042f){var _0x9fc93e;return db[_0xdafc('0x35')][_0xdafc('0x2f')]({'where':{'id':_0x21d53c['params']['id'],'role':_0xdafc('0x6a')},'attributes':['id',_0xdafc('0x30'),'role']})['then'](handleEntityNotFound(_0x50042f,null))[_0xdafc('0x25')](function(_0x3e758b){if(_0x3e758b){_0x9fc93e=_0x3e758b;return db[_0xdafc('0xa8')][_0xdafc('0x26')]({'where':{'membername':_0x9fc93e[_0xdafc('0x30')]},'individualHooks':!![]});}})[_0xdafc('0x25')](function(){return db[_0xdafc('0xf9')]['findAll']({'where':{'membername':_0x9fc93e[_0xdafc('0x30')],'exitAt':null}});})['then'](function(_0x5ae1c7){var _0xa2f003=[];_0x5ae1c7['forEach'](function(_0x42abeb){_0xa2f003[_0xdafc('0x40')](_0x42abeb[_0xdafc('0x56')]({'exitAt':moment()[_0xdafc('0xa4')](_0xdafc('0xf5'))}));});return BPromise[_0xdafc('0x4b')](_0xa2f003);})[_0xdafc('0x25')](function(){return _0x9fc93e[_0xdafc('0x56')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0xdafc('0x25')](respondWithResult(_0x50042f,null))['catch'](handleError(_0x50042f,null));};exports[_0xdafc('0xfe')]=function(_0x313f5e,_0x5a9526){var _0x846e14;return db[_0xdafc('0xa8')][_0xdafc('0x56')]({'paused':0x1},{'where':{'UserId':_0x313f5e[_0xdafc('0x58')]['id']},'individualHooks':!![]})['then'](function(){return db['User'][_0xdafc('0x2f')]({'where':{'id':_0x313f5e[_0xdafc('0x58')]['id'],'role':_0xdafc('0x6a')},'attributes':['id','name',_0xdafc('0x28'),_0xdafc('0x61'),_0xdafc('0x96')]});})[_0xdafc('0x25')](handleEntityNotFound(_0x5a9526,null))[_0xdafc('0x25')](function(_0x1c6946){if(_0x1c6946){_0x846e14=_0x1c6946;return respondWithRpcPromise(_0xdafc('0xff'),'pause',{'id':_0x846e14['id'],'name':_0x846e14[_0xdafc('0x30')],'pause':!![]});}})['then'](function(){if(_0x846e14){return db[_0xdafc('0xf9')]['findAll']({'where':{'membername':_0x846e14[_0xdafc('0x30')],'type':_0xdafc('0x100'),'exitAt':null}});}})[_0xdafc('0x25')](function(_0x238fb2){if(_0x238fb2[_0xdafc('0x44')]){var _0x5a0481=moment()[_0xdafc('0xa4')](_0xdafc('0xf5'));for(var _0x4446f4=0x0,_0x45044f=_0x238fb2[_0xdafc('0x44')];_0x4446f4<_0x45044f;_0x4446f4++){_0x238fb2[_0x4446f4][_0xdafc('0x101')]({'exitAt':_0x5a0481});}}})['then'](function(){var _0x1cc259=[];var _0x4124d4=utils[_0xdafc('0xf6')]();_0x4124d4[_0xdafc('0xf4')](function(_0x2f630a){_0x1cc259[_0xdafc('0x40')]({'channel':_0x2f630a,'membername':_0x846e14[_0xdafc('0x30')],'interface':_[_0xdafc('0x63')](_0x846e14[_0xdafc('0x96')])?util[_0xdafc('0xa4')](_0xdafc('0xa5'),_0x846e14[_0xdafc('0x30')]):_0x846e14[_0xdafc('0x96')],'type':_0xdafc('0x100'),'enterAt':moment()[_0xdafc('0xa4')](_0xdafc('0xf5')),'data1':_0x313f5e[_0xdafc('0x57')][_0xdafc('0x37')]||_0xdafc('0x102'),'role':_0x846e14[_0xdafc('0x28')],'internal':_0x846e14[_0xdafc('0x61')]});});return db[_0xdafc('0xf9')][_0xdafc('0x83')](_0x1cc259,{'individualHooks':!![]});})[_0xdafc('0x25')](function(){return _0x846e14[_0xdafc('0x56')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x313f5e['body'][_0xdafc('0x37')]||_0xdafc('0x102'),'lastPauseAt':moment()[_0xdafc('0xa4')](_0xdafc('0xf5'))});})[_0xdafc('0x25')](respondWithResult(_0x5a9526,null))[_0xdafc('0x4c')](handleError(_0x5a9526,null));};exports['unpause']=function(_0x4fcd40,_0x940659){var _0x508aa8;return db[_0xdafc('0x35')][_0xdafc('0x2f')]({'where':{'id':_0x4fcd40[_0xdafc('0x58')]['id']},'attributes':['id',_0xdafc('0x30'),'role',_0xdafc('0xa6'),'mailPause',_0xdafc('0x103'),_0xdafc('0x104'),_0xdafc('0x105'),_0xdafc('0x106'),_0xdafc('0x107'),_0xdafc('0x108'),_0xdafc('0x109')]})['then'](handleEntityNotFound(_0x940659,null))[_0xdafc('0x25')](function(_0x4d211b){if(_0x4d211b){_0x508aa8=_0x4d211b;if(_0x4fcd40[_0xdafc('0x57')][_0xdafc('0xaa')]&&!utils['isValidChannel'](_0x4fcd40['body'][_0xdafc('0xaa')])){throw new db['Sequelize']['ValidationError'](_0xdafc('0x98'));}switch(_0x4fcd40['body'][_0xdafc('0xaa')]){case'voice':return respondWithRpcPromise(_0xdafc('0xff'),'unpause',{'id':_0x508aa8['id'],'name':_0x508aa8['name'],'pause':![]})[_0xdafc('0x25')](function(){return db[_0xdafc('0xa8')][_0xdafc('0x56')]({'paused':0x0},{'where':{'UserId':_0x508aa8['id']},'individualHooks':!![]});})['then'](function(){return db[_0xdafc('0xf9')][_0xdafc('0x2f')]({'where':{'channel':_0x4fcd40[_0xdafc('0x57')][_0xdafc('0xaa')],'membername':_0x508aa8[_0xdafc('0x30')],'type':'PAUSE','exitAt':null}});})[_0xdafc('0x25')](function(_0x49f6d3){if(_0x49f6d3){return _0x49f6d3['update']({'exitAt':moment()[_0xdafc('0xa4')](_0xdafc('0xf5')),'data2':_0xdafc('0x10a')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x508aa8[_0xdafc('0x56')]({'voicePause':![]});});case _0xdafc('0x55'):case'chat':case _0xdafc('0x48'):case _0xdafc('0x47'):case'whatsapp':case _0xdafc('0x49'):return db[_0xdafc('0xf9')]['find']({'where':{'channel':_0x4fcd40[_0xdafc('0x57')]['channel'],'membername':_0x508aa8['name'],'type':'PAUSE','exitAt':null}})[_0xdafc('0x25')](function(_0x12b372){if(_0x12b372){return _0x12b372[_0xdafc('0x56')]({'exitAt':moment()[_0xdafc('0xa4')](_0xdafc('0xf5')),'data2':_0xdafc('0x10a')},{'individualHooks':!![]});}return null;})['then'](function(){var _0x4ce2b6={};_[_0xdafc('0x10b')](_0x4ce2b6,util['format']('%s%s',_0x4fcd40['body'][_0xdafc('0xaa')],_0xdafc('0x10c')),![]);return _0x508aa8[_0xdafc('0x56')](_0x4ce2b6);});default:return respondWithRpcPromise(_0xdafc('0xff'),_0xdafc('0x10d'),{'id':_0x508aa8['id'],'name':_0x508aa8[_0xdafc('0x30')],'pause':![]})[_0xdafc('0x25')](function(){return db[_0xdafc('0xa8')][_0xdafc('0x56')]({'paused':0x0},{'where':{'UserId':_0x508aa8['id']}});})[_0xdafc('0x25')](function(){return db[_0xdafc('0xf9')]['findAll']({'where':{'membername':_0x508aa8['name'],'type':'PAUSE','exitAt':null}});})[_0xdafc('0x25')](function(_0x4b9b67){var _0x1cb516=[];_0x4b9b67[_0xdafc('0xf4')](function(_0x419744){_0x1cb516['push'](_0x419744[_0xdafc('0x56')]({'exitAt':moment()[_0xdafc('0xa4')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xdafc('0x10a')}));});return BPromise[_0xdafc('0x4b')](_0x1cb516);})['then'](function(){return _0x508aa8['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'whatsappPause':![],'openchannelPause':![]});});}}})[_0xdafc('0x25')](respondWithResult(_0x940659,null))[_0xdafc('0x4c')](handleError(_0x940659,null));};exports[_0xdafc('0x10e')]=function(_0xec020b,_0x48c9c1){var _0x3c2c2c={};var _0x50136f={};var _0x225e7c;var _0x8099f4;return db[_0xdafc('0x35')][_0xdafc('0xc3')]({'where':{'id':_0xec020b[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x48c9c1,null))[_0xdafc('0x25')](function(_0x626773){if(_0x626773){_0x225e7c=_0x626773;_0x50136f[_0xdafc('0x4e')]=_['keys'](db[_0xdafc('0x10f')][_0xdafc('0xc4')]);_0x50136f[_0xdafc('0x3d')]=_[_0xdafc('0x50')](_0xec020b['query']);_0x50136f[_0xdafc('0xc5')]=_['intersection'](_0x50136f[_0xdafc('0x4e')],_0x50136f[_0xdafc('0x3d')]);_0x3c2c2c['attributes']=_['intersection'](_0x50136f[_0xdafc('0x4e')],qs[_0xdafc('0x52')](_0xec020b[_0xdafc('0x3d')][_0xdafc('0x52')]));_0x3c2c2c[_0xdafc('0x3f')]=_0x3c2c2c[_0xdafc('0x3f')][_0xdafc('0x44')]?_0x3c2c2c['attributes']:_0x50136f[_0xdafc('0x4e')];_0x3c2c2c[_0xdafc('0xc6')]=qs['sort'](_0xec020b[_0xdafc('0x3d')][_0xdafc('0xc7')]);_0x3c2c2c[_0xdafc('0x3c')]=qs[_0xdafc('0xc5')](_[_0xdafc('0xc8')](_0xec020b[_0xdafc('0x3d')],_0x50136f[_0xdafc('0xc5')]));if(_0xec020b[_0xdafc('0x3d')][_0xdafc('0xc9')]){_0x3c2c2c[_0xdafc('0x3c')]=_[_0xdafc('0x53')](_0x3c2c2c['where'],{'$or':_['map'](_0x3c2c2c[_0xdafc('0x3f')],function(_0x67d1c3){var _0x47e688={};_0x47e688[_0x67d1c3]={'$like':'%'+_0xec020b[_0xdafc('0x3d')][_0xdafc('0xc9')]+'%'};return _0x47e688;})});}_0x3c2c2c=_['merge']({},_0x3c2c2c,_0xec020b[_0xdafc('0x54')]);return _0x225e7c[_0xdafc('0x10e')](_0x3c2c2c);}})[_0xdafc('0x25')](function(_0x2700e0){if(_0x2700e0){_0x8099f4=_0x2700e0[_0xdafc('0x44')];if(!_0xec020b[_0xdafc('0x3d')][_0xdafc('0xca')](_0xdafc('0xd4'))){_0x3c2c2c[_0xdafc('0x21')]=qs[_0xdafc('0x21')](_0xec020b['query']['limit']);_0x3c2c2c[_0xdafc('0x23')]=qs[_0xdafc('0x23')](_0xec020b['query'][_0xdafc('0x23')]);}return _0x225e7c[_0xdafc('0x10e')](_0x3c2c2c);}})[_0xdafc('0x25')](function(_0x3fea20){if(_0x3fea20){return _0x3fea20?{'count':_0x8099f4,'rows':_0x3fea20}:null;}})[_0xdafc('0x25')](respondWithResult(_0x48c9c1,null))[_0xdafc('0x4c')](handleError(_0x48c9c1,null));};exports[_0xdafc('0x110')]=function(_0x219904,_0x2a3106){return db['User'][_0xdafc('0x2f')]({'where':{'id':_0x219904[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x2a3106,null))[_0xdafc('0x25')](function(_0x1dca7d){if(_0x1dca7d){var _0x58f012=_0x1dca7d[_0xdafc('0x27')]({'plain':!![]});return _0x1dca7d[_0xdafc('0x110')](_0x219904['body'][_0xdafc('0x5b')],_[_0xdafc('0x5c')](_0x219904['body'],[_0xdafc('0x5b'),'id'])||{})[_0xdafc('0x25')](function(){for(var _0x4d7430=0x0;_0x4d7430<_0x219904['body'][_0xdafc('0x5b')]['length'];_0x4d7430++){var _0xf71356=[];var _0x5e0051={};db['Team'][_0xdafc('0xc3')]({'where':{'id':_0x219904[_0xdafc('0x57')][_0xdafc('0x5b')][_0x4d7430]}})[_0xdafc('0x25')](function(_0x44d884){_0x5e0051=_0x44d884['dataValues'];_0xf71356['push'](_0x44d884['getVoiceQueues']()[_0xdafc('0x25')](function(_0xb2863b){for(var _0x37d769=0x0;_0x37d769<_0xb2863b['length'];_0x37d769++){_0xb2863b[_0x37d769][_0xdafc('0x111')](_0xdafc('0xaa'),_0xdafc('0x112'));}return _0xb2863b;}));_0xf71356[_0xdafc('0x40')](_0x44d884[_0xdafc('0x113')]()['then'](function(_0x469930){for(var _0x5e006a=0x0;_0x5e006a<_0x469930[_0xdafc('0x44')];_0x5e006a++){_0x469930[_0x5e006a][_0xdafc('0x111')]('channel','Chat');}return _0x469930;}));_0xf71356[_0xdafc('0x40')](_0x44d884[_0xdafc('0x114')]()['then'](function(_0x51cd21){for(var _0x286303=0x0;_0x286303<_0x51cd21['length'];_0x286303++){_0x51cd21[_0x286303][_0xdafc('0x111')]('channel',_0xdafc('0x115'));}return _0x51cd21;}));_0xf71356['push'](_0x44d884['getSmsQueues']()[_0xdafc('0x25')](function(_0x42527e){for(var _0x2ef90c=0x0;_0x2ef90c<_0x42527e[_0xdafc('0x44')];_0x2ef90c++){_0x42527e[_0x2ef90c][_0xdafc('0x111')](_0xdafc('0xaa'),_0xdafc('0x116'));}return _0x42527e;}));_0xf71356[_0xdafc('0x40')](_0x44d884[_0xdafc('0x117')]()[_0xdafc('0x25')](function(_0x11099d){for(var _0x3d39aa=0x0;_0x3d39aa<_0x11099d['length'];_0x3d39aa++){_0x11099d[_0x3d39aa]['setDataValue']('channel',_0xdafc('0x118'));}return _0x11099d;}));_0xf71356['push'](_0x44d884[_0xdafc('0x119')]()[_0xdafc('0x25')](function(_0x3d7752){for(var _0xe4d520=0x0;_0xe4d520<_0x3d7752[_0xdafc('0x44')];_0xe4d520++){_0x3d7752[_0xe4d520][_0xdafc('0x111')](_0xdafc('0xaa'),_0xdafc('0x11a'));}return _0x3d7752;}));_0xf71356[_0xdafc('0x40')](_0x44d884[_0xdafc('0x11b')]()[_0xdafc('0x25')](function(_0x4cd29a){for(var _0x4f1a36=0x0;_0x4f1a36<_0x4cd29a['length'];_0x4f1a36++){_0x4cd29a[_0x4f1a36]['setDataValue'](_0xdafc('0xaa'),_0xdafc('0x11c'));}return _0x4cd29a;}));return BPromise[_0xdafc('0x4b')](_0xf71356);})[_0xdafc('0x25')](function(_0x17f83){var _0x30661d=_[_0xdafc('0x11d')](_0x17f83);_0xf71356=[];return db[_0xdafc('0x64')][_0xdafc('0x11e')](function(_0x5b1280){for(var _0x1b7fd5=0x0;_0x1b7fd5<_0x30661d[_0xdafc('0x44')];_0x1b7fd5++){_0xf71356[_0xdafc('0x40')](_0x30661d[_0x1b7fd5][_0xdafc('0x11f')](_0x58f012['id']),{'transaction':_0x5b1280});}return BPromise[_0xdafc('0x4b')](_0xf71356)[_0xdafc('0x25')](function(){if(_0x58f012[_0xdafc('0xa3')]){return BPromise[_0xdafc('0xf3')](_[_0xdafc('0xc9')](_0x30661d,function(_0x1c5346){return _0x1c5346[_0xdafc('0x120')](_0xdafc('0xaa'))===_0xdafc('0x112');}),function(_0x28f5f2){return db['UserVoiceQueueRt'][_0xdafc('0xa9')]({'membername':_0x58f012[_0xdafc('0x30')],'UserId':_0x58f012['id'],'queue_name':_0x28f5f2[_0xdafc('0x30')],'VoiceQueueId':_0x28f5f2['id'],'interface':_[_0xdafc('0x63')](_0x58f012[_0xdafc('0x96')])?util[_0xdafc('0xa4')](_0xdafc('0xa5'),_0x58f012[_0xdafc('0x30')]):_0x58f012['interface'],'paused':_0x58f012['voicePause']||![],'penalty':_0x58f012[_0xdafc('0xa7')]},{'transaction':_0x5b1280});});}else{return;}})[_0xdafc('0x25')](function(){for(var _0x4455bd=0x0;_0x4455bd<_0x30661d['length'];_0x4455bd++){var _0x3cbe45=_0x30661d[_0x4455bd]['getDataValue'](_0xdafc('0xaa'));var _0x58bfcf=_0x3cbe45+_0xdafc('0x9e');socket[_0xdafc('0x9f')](_0xdafc('0x2a')+_0x3cbe45+_0xdafc('0xa0'),{'UserId':_0x58f012['id'],['queueField']:_0x30661d[_0x4455bd]['id']});}});});})['then'](function(){db[_0xdafc('0x121')][_0xdafc('0xc3')]({'where':{'teamId':_0x5e0051['id']}})['then'](function(_0x59a645){if(_0x59a645){db[_0xdafc('0x122')][_0xdafc('0x79')]({'UserId':_0x219904[_0xdafc('0x58')]['id'],'VoicePrefixId':_0x59a645['VoicePrefixId']});}});});}});}})['then'](respondWithStatusCode(_0x2a3106,null))[_0xdafc('0x4c')](handleError(_0x2a3106,null));};exports[_0xdafc('0x123')]=function(_0x23622d,_0x29f863){return db[_0xdafc('0x35')][_0xdafc('0xc3')]({'where':{'id':_0x23622d[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x29f863,null))[_0xdafc('0x25')](function(_0xeae874){if(_0xeae874){var _0x1d8eb5=_0xeae874[_0xdafc('0x27')]({'plain':!![]});var _0x17d253=_0x23622d[_0xdafc('0x3d')][_0xdafc('0x5b')];return _0xeae874['removeTeams'](_0x17d253)['then'](function(){for(var _0x374749=0x0;_0x374749<_0x17d253['length'];_0x374749++){var _0x11ea29=[];var _0x1bd774={};db[_0xdafc('0x10f')][_0xdafc('0xc3')]({'where':{'id':_0x17d253[_0x374749]}})[_0xdafc('0x25')](function(_0x4543c0){_0x1bd774=_0x4543c0[_0xdafc('0x46')];_0x11ea29[_0xdafc('0x40')](_0x4543c0[_0xdafc('0xf1')]()[_0xdafc('0x25')](function(_0x385418){for(var _0x4451ce=0x0;_0x4451ce<_0x385418[_0xdafc('0x44')];_0x4451ce++){_0x385418[_0x4451ce][_0xdafc('0x111')]('channel',_0xdafc('0x112'));}return _0x385418;}));_0x11ea29[_0xdafc('0x40')](_0x4543c0[_0xdafc('0x113')]()[_0xdafc('0x25')](function(_0x9daab9){for(var _0x43c8d8=0x0;_0x43c8d8<_0x9daab9['length'];_0x43c8d8++){_0x9daab9[_0x43c8d8]['setDataValue']('channel',_0xdafc('0x124'));}return _0x9daab9;}));_0x11ea29[_0xdafc('0x40')](_0x4543c0['getMailQueues']()['then'](function(_0x210d3d){for(var _0x14ac3d=0x0;_0x14ac3d<_0x210d3d[_0xdafc('0x44')];_0x14ac3d++){_0x210d3d[_0x14ac3d]['setDataValue'](_0xdafc('0xaa'),_0xdafc('0x115'));}return _0x210d3d;}));_0x11ea29[_0xdafc('0x40')](_0x4543c0[_0xdafc('0x125')]()[_0xdafc('0x25')](function(_0x5611d2){for(var _0x8d1d6d=0x0;_0x8d1d6d<_0x5611d2[_0xdafc('0x44')];_0x8d1d6d++){_0x5611d2[_0x8d1d6d][_0xdafc('0x111')](_0xdafc('0xaa'),_0xdafc('0x116'));}return _0x5611d2;}));_0x11ea29[_0xdafc('0x40')](_0x4543c0[_0xdafc('0x117')]()[_0xdafc('0x25')](function(_0x1baf29){for(var _0x55ecb3=0x0;_0x55ecb3<_0x1baf29[_0xdafc('0x44')];_0x55ecb3++){_0x1baf29[_0x55ecb3][_0xdafc('0x111')](_0xdafc('0xaa'),_0xdafc('0x118'));}return _0x1baf29;}));_0x11ea29[_0xdafc('0x40')](_0x4543c0[_0xdafc('0x119')]()['then'](function(_0x1bb5a4){for(var _0x184b88=0x0;_0x184b88<_0x1bb5a4['length'];_0x184b88++){_0x1bb5a4[_0x184b88][_0xdafc('0x111')](_0xdafc('0xaa'),'Fax');}return _0x1bb5a4;}));_0x11ea29[_0xdafc('0x40')](_0x4543c0[_0xdafc('0x11b')]()['then'](function(_0x1fc3af){for(var _0x51f02d=0x0;_0x51f02d<_0x1fc3af[_0xdafc('0x44')];_0x51f02d++){_0x1fc3af[_0x51f02d][_0xdafc('0x111')](_0xdafc('0xaa'),_0xdafc('0x11c'));}return _0x1fc3af;}));return BPromise[_0xdafc('0x4b')](_0x11ea29);})[_0xdafc('0x25')](function(_0x3a6002){var _0xad8d50=_[_0xdafc('0x11d')](_0x3a6002);_0x11ea29=[];return db['sequelize'][_0xdafc('0x11e')](function(_0x2a2007){for(var _0x1c8ad5=0x0;_0x1c8ad5<_0xad8d50[_0xdafc('0x44')];_0x1c8ad5++){_0x11ea29['push'](_0xad8d50[_0x1c8ad5]['removeAgent'](_0x1d8eb5['id']),{'transaction':_0x2a2007});}return BPromise[_0xdafc('0x4b')](_0x11ea29)[_0xdafc('0x25')](function(){if(_0x1d8eb5['online']){return BPromise['each'](_['filter'](_0xad8d50,function(_0x287e60){return _0x287e60['getDataValue'](_0xdafc('0xaa'))===_0xdafc('0x112');}),function(_0x364ee6){return db[_0xdafc('0xa8')][_0xdafc('0x26')]({'where':{'VoiceQueueId':_0x364ee6['id'],'UserId':_0x1d8eb5['id']},'transaction':_0x2a2007});});}else{return;}})[_0xdafc('0x25')](function(){db[_0xdafc('0x121')][_0xdafc('0xc3')]({'where':{'teamId':_0x1bd774['id']}})[_0xdafc('0x25')](function(_0x2cd673){if(_0x2cd673){return db[_0xdafc('0x122')][_0xdafc('0x26')]({'where':{'UserId':_0x1d8eb5['id'],'VoicePrefixId':_0x2cd673[_0xdafc('0x46')][_0xdafc('0x126')]}});}});})[_0xdafc('0x25')](function(){for(var _0x431ca1=0x0;_0x431ca1<_0xad8d50['length'];_0x431ca1++){var _0xa4ba92=_0xad8d50[_0x431ca1][_0xdafc('0x120')](_0xdafc('0xaa'));var _0x550519=_0xa4ba92+'QueueId';socket[_0xdafc('0x9f')](_0xdafc('0x2a')+_0xa4ba92+_0xdafc('0xad'),{'UserId':_0x1d8eb5['id'],['queueField']:_0xad8d50[_0x431ca1]['id']});}});});});}});}})[_0xdafc('0x25')](respondWithStatusCode(_0x29f863,null))[_0xdafc('0x4c')](handleError(_0x29f863,null));};exports['getLists']=function(_0x2c9506,_0x1e6466){var _0x3faf02={};var _0x348f26={};var _0x606b9d;var _0x1dbf6b;return db['User'][_0xdafc('0xc3')]({'where':{'id':_0x2c9506['params']['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x1e6466,null))[_0xdafc('0x25')](function(_0x2170a3){if(_0x2170a3){_0x606b9d=_0x2170a3;_0x348f26['model']=_[_0xdafc('0x50')](db['CmList'][_0xdafc('0xc4')]);_0x348f26['query']=_[_0xdafc('0x50')](_0x2c9506[_0xdafc('0x3d')]);_0x348f26[_0xdafc('0xc5')]=_[_0xdafc('0x51')](_0x348f26['model'],_0x348f26[_0xdafc('0x3d')]);_0x3faf02[_0xdafc('0x3f')]=_['intersection'](_0x348f26[_0xdafc('0x4e')],qs[_0xdafc('0x52')](_0x2c9506['query'][_0xdafc('0x52')]));_0x3faf02['attributes']=_0x3faf02[_0xdafc('0x3f')]['length']?_0x3faf02['attributes']:_0x348f26[_0xdafc('0x4e')];_0x3faf02['order']=qs['sort'](_0x2c9506['query']['sort']);_0x3faf02[_0xdafc('0x3c')]=qs[_0xdafc('0xc5')](_[_0xdafc('0xc8')](_0x2c9506[_0xdafc('0x3d')],_0x348f26[_0xdafc('0xc5')]));if(_0x2c9506[_0xdafc('0x3d')][_0xdafc('0xc9')]){_0x3faf02[_0xdafc('0x3c')]=_['merge'](_0x3faf02['where'],{'$or':_['map'](_0x3faf02[_0xdafc('0x3f')],function(_0x52697c){var _0x175ac4={};_0x175ac4[_0x52697c]={'$like':'%'+_0x2c9506[_0xdafc('0x3d')][_0xdafc('0xc9')]+'%'};return _0x175ac4;})});}_0x3faf02=_[_0xdafc('0x53')]({},_0x3faf02,_0x2c9506[_0xdafc('0x54')]);return _0x606b9d['getLists'](_0x3faf02);}})[_0xdafc('0x25')](function(_0x12a330){if(_0x12a330){_0x1dbf6b=_0x12a330['length'];if(!_0x2c9506[_0xdafc('0x3d')][_0xdafc('0xca')](_0xdafc('0xd4'))){_0x3faf02['limit']=qs[_0xdafc('0x21')](_0x2c9506['query'][_0xdafc('0x21')]);_0x3faf02[_0xdafc('0x23')]=qs[_0xdafc('0x23')](_0x2c9506[_0xdafc('0x3d')][_0xdafc('0x23')]);}return _0x606b9d[_0xdafc('0x127')](_0x3faf02);}})[_0xdafc('0x25')](function(_0xa37c14){if(_0xa37c14){return _0xa37c14?{'count':_0x1dbf6b,'rows':_0xa37c14}:null;}})[_0xdafc('0x25')](respondWithResult(_0x1e6466,null))[_0xdafc('0x4c')](handleError(_0x1e6466,null));};exports[_0xdafc('0x128')]=function(_0x23a120,_0x291ff6){var _0x12b2a8={};var _0x388110={};var _0x1b6822;var _0x521d1d;return db[_0xdafc('0x35')][_0xdafc('0xc3')]({'where':{'id':_0x23a120[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x291ff6,null))[_0xdafc('0x25')](function(_0xa34bd0){if(_0xa34bd0){_0x1b6822=_0xa34bd0;_0x388110['model']=_[_0xdafc('0x50')](db[_0xdafc('0x35')][_0xdafc('0xc4')]);_0x388110[_0xdafc('0x3d')]=_[_0xdafc('0x50')](_0x23a120[_0xdafc('0x3d')]);_0x388110[_0xdafc('0xc5')]=_[_0xdafc('0x51')](_0x388110[_0xdafc('0x4e')],_0x388110[_0xdafc('0x3d')]);_0x12b2a8[_0xdafc('0x3f')]=_[_0xdafc('0x51')](_0x388110[_0xdafc('0x4e')],qs[_0xdafc('0x52')](_0x23a120[_0xdafc('0x3d')][_0xdafc('0x52')]));_0x12b2a8[_0xdafc('0x3f')]=_0x12b2a8[_0xdafc('0x3f')][_0xdafc('0x44')]?_0x12b2a8[_0xdafc('0x3f')]:_0x388110[_0xdafc('0x4e')];_0x12b2a8[_0xdafc('0xc6')]=qs[_0xdafc('0xc7')](_0x23a120[_0xdafc('0x3d')][_0xdafc('0xc7')]);_0x12b2a8[_0xdafc('0x3c')]=qs['filters'](_[_0xdafc('0xc8')](_0x23a120[_0xdafc('0x3d')],_0x388110[_0xdafc('0xc5')]));if(_0x23a120[_0xdafc('0x3d')][_0xdafc('0xc9')]){_0x12b2a8[_0xdafc('0x3c')]=_[_0xdafc('0x53')](_0x12b2a8['where'],{'$or':_[_0xdafc('0x2d')](_0x12b2a8[_0xdafc('0x3f')],function(_0x4c73d3){var _0x38bffb={};_0x38bffb[_0x4c73d3]={'$like':'%'+_0x23a120[_0xdafc('0x3d')][_0xdafc('0xc9')]+'%'};return _0x38bffb;})});}_0x12b2a8['model']=db['User'];_0x12b2a8['as']='Agents';_0x12b2a8=_[_0xdafc('0x53')]({},_0x12b2a8,_0x23a120[_0xdafc('0x54')]);return _0x1b6822[_0xdafc('0xf1')]({'include':[_0x12b2a8]});}})['then'](function(_0x562a56){if(_0x562a56){var _0x39ce51={},_0x205353=[],_0x138f9c=0x0;for(var _0x35336a=0x0;_0x35336a<_0x562a56[_0xdafc('0x44')];_0x35336a+=0x1){for(var _0x232da8=0x0,_0x4cf568;_0x232da8<_0x562a56[_0x35336a][_0xdafc('0x2b')]['length'];_0x232da8+=0x1){_0x4cf568=_0x562a56[_0x35336a]['Agents'][_0x232da8][_0xdafc('0x27')]({'plain':!![]});_0x39ce51[_0x4cf568['id']]=_0x4cf568;}}_0x39ce51=_[_0xdafc('0x129')](_0x39ce51);for(var _0x290ac4=qs[_0xdafc('0x23')](_0x23a120[_0xdafc('0x3d')][_0xdafc('0x23')]);_0x290ac4<_0x39ce51['length']&&_0x205353[_0xdafc('0x44')]<qs[_0xdafc('0x21')](_0x23a120[_0xdafc('0x3d')]['limit']);_0x290ac4+=0x1){if(_0x39ce51[_0x290ac4]){_0x205353[_0xdafc('0x40')](_0x39ce51[_0x290ac4]);}}return{'count':_0x39ce51[_0xdafc('0x44')],'rows':_0x205353};}})[_0xdafc('0x25')](respondWithResult(_0x291ff6,null))[_0xdafc('0x4c')](handleError(_0x291ff6,null));};exports[_0xdafc('0x26')]=function(_0x1f4200,_0x3b05ec){if(_0x1f4200[_0xdafc('0x2a')]['id']==_0x1f4200[_0xdafc('0x58')]['id']){return _0x3b05ec[_0xdafc('0x1e')](0x1f4)[_0xdafc('0x12a')]({'message':'You\x20can\x27t\x20delete\x20yourself'});}return db[_0xdafc('0x35')][_0xdafc('0x2f')]({'where':{'id':_0x1f4200['params']['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x3b05ec,null))[_0xdafc('0x25')](removeEntity(_0x3b05ec,null))[_0xdafc('0x4c')](handleError(_0x3b05ec,null));};exports[_0xdafc('0x12b')]=function(_0x1857de,_0x24976e){return db[_0xdafc('0x35')][_0xdafc('0x2f')]({'where':{'id':_0x1857de['params']['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x24976e,null))[_0xdafc('0x25')](function(_0x5bd81d){if(_0x5bd81d){return _0x5bd81d[_0xdafc('0x12b')](_0x1857de[_0xdafc('0x57')][_0xdafc('0x5b')],_[_0xdafc('0x5c')](_0x1857de[_0xdafc('0x57')],['ids','id'])||{})[_0xdafc('0x9d')](function(){for(var _0x26eefc=0x0;_0x26eefc<_0x1857de[_0xdafc('0x57')][_0xdafc('0x5b')][_0xdafc('0x44')];_0x26eefc+=0x1){socket['emit'](_0xdafc('0x12c'),{'ChatInteractionId':Number(_0x1857de['body'][_0xdafc('0x5b')][_0x26eefc]),'UserId':Number(_0x1857de['params']['id'])});}return _0x1857de[_0xdafc('0x57')][_0xdafc('0x5b')];});}})[_0xdafc('0x25')](respondWithResult(_0x24976e,null))[_0xdafc('0x4c')](handleError(_0x24976e,null));};exports[_0xdafc('0x12d')]=function(_0x2caa3c,_0x52820d){return db['User'][_0xdafc('0x2f')]({'where':{'id':_0x2caa3c[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x52820d,null))['then'](function(_0xb795b8){if(_0xb795b8){return _0xb795b8[_0xdafc('0x12d')](_0x2caa3c[_0xdafc('0x3d')][_0xdafc('0x5b')])[_0xdafc('0x25')](function(){if(_[_0xdafc('0xac')](_0x2caa3c[_0xdafc('0x3d')][_0xdafc('0x5b')])){for(var _0x231b25=0x0;_0x231b25<_0x2caa3c[_0xdafc('0x3d')][_0xdafc('0x5b')][_0xdafc('0x44')];_0x231b25+=0x1){socket[_0xdafc('0x9f')](_0xdafc('0x12e'),{'ChatInteractionId':Number(_0x2caa3c['query'][_0xdafc('0x5b')][_0x231b25]),'UserId':Number(_0x2caa3c['params']['id'])});}}else{socket[_0xdafc('0x9f')](_0xdafc('0x12e'),{'ChatInteractionId':Number(_0x2caa3c[_0xdafc('0x3d')][_0xdafc('0x5b')]),'UserId':Number(_0x2caa3c[_0xdafc('0x58')]['id'])});}});}})[_0xdafc('0x25')](respondWithStatusCode(_0x52820d,null))[_0xdafc('0x4c')](handleError(_0x52820d,null));};exports[_0xdafc('0x12f')]=function(_0x3040f6,_0x51b5d5){return db['User']['find']({'where':{'id':_0x3040f6[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x51b5d5,null))[_0xdafc('0x25')](function(_0x5275de){if(_0x5275de){return _0x5275de['addMailInteractions'](_0x3040f6[_0xdafc('0x57')][_0xdafc('0x5b')],_[_0xdafc('0x5c')](_0x3040f6[_0xdafc('0x57')],[_0xdafc('0x5b'),'id'])||{})['spread'](function(){for(var _0x5c5973=0x0;_0x5c5973<_0x3040f6[_0xdafc('0x57')]['ids'][_0xdafc('0x44')];_0x5c5973+=0x1){socket[_0xdafc('0x9f')](_0xdafc('0x130'),{'MailInteractionId':Number(_0x3040f6[_0xdafc('0x57')][_0xdafc('0x5b')][_0x5c5973]),'UserId':Number(_0x3040f6['params']['id'])});}return _0x3040f6['body'][_0xdafc('0x5b')];});}})[_0xdafc('0x25')](respondWithResult(_0x51b5d5,null))['catch'](handleError(_0x51b5d5,null));};exports['removeMailInteractions']=function(_0x23150c,_0x4fd289){return db['User'][_0xdafc('0x2f')]({'where':{'id':_0x23150c[_0xdafc('0x58')]['id']}})['then'](handleEntityNotFound(_0x4fd289,null))[_0xdafc('0x25')](function(_0x361458){if(_0x361458){return _0x361458[_0xdafc('0x131')](_0x23150c[_0xdafc('0x3d')]['ids'])[_0xdafc('0x25')](function(){if(_[_0xdafc('0xac')](_0x23150c[_0xdafc('0x3d')][_0xdafc('0x5b')])){for(var _0x2cc6d8=0x0;_0x2cc6d8<_0x23150c[_0xdafc('0x3d')][_0xdafc('0x5b')][_0xdafc('0x44')];_0x2cc6d8+=0x1){socket[_0xdafc('0x9f')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x23150c[_0xdafc('0x3d')][_0xdafc('0x5b')][_0x2cc6d8]),'UserId':Number(_0x23150c[_0xdafc('0x58')]['id'])});}}else{socket[_0xdafc('0x9f')](_0xdafc('0x132'),{'MailInteractionId':Number(_0x23150c[_0xdafc('0x3d')][_0xdafc('0x5b')]),'UserId':Number(_0x23150c['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4fd289,null))['catch'](handleError(_0x4fd289,null));};exports[_0xdafc('0x133')]=function(_0xd65189,_0x17ab52){return db[_0xdafc('0x35')][_0xdafc('0x2f')]({'where':{'id':_0xd65189[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x17ab52,null))[_0xdafc('0x25')](function(_0xcf21c1){if(_0xcf21c1){return _0xcf21c1['addFaxInteractions'](_0xd65189[_0xdafc('0x57')]['ids'],_[_0xdafc('0x5c')](_0xd65189['body'],[_0xdafc('0x5b'),'id'])||{})['spread'](function(){for(var _0x4439f0=0x0;_0x4439f0<_0xd65189[_0xdafc('0x57')]['ids'][_0xdafc('0x44')];_0x4439f0+=0x1){socket['emit'](_0xdafc('0x134'),{'FaxInteractionId':Number(_0xd65189[_0xdafc('0x57')]['ids'][_0x4439f0]),'UserId':Number(_0xd65189[_0xdafc('0x58')]['id'])});}return _0xd65189[_0xdafc('0x57')][_0xdafc('0x5b')];});}})[_0xdafc('0x25')](respondWithResult(_0x17ab52,null))['catch'](handleError(_0x17ab52,null));};exports[_0xdafc('0x135')]=function(_0x51f168,_0x16f2fd){return db[_0xdafc('0x35')][_0xdafc('0x2f')]({'where':{'id':_0x51f168['params']['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x16f2fd,null))[_0xdafc('0x25')](function(_0x5581aa){if(_0x5581aa){return _0x5581aa[_0xdafc('0x135')](_0x51f168[_0xdafc('0x3d')][_0xdafc('0x5b')])[_0xdafc('0x25')](function(){if(_[_0xdafc('0xac')](_0x51f168[_0xdafc('0x3d')][_0xdafc('0x5b')])){for(var _0x4b425b=0x0;_0x4b425b<_0x51f168[_0xdafc('0x3d')][_0xdafc('0x5b')][_0xdafc('0x44')];_0x4b425b+=0x1){socket[_0xdafc('0x9f')](_0xdafc('0x136'),{'FaxInteractionId':Number(_0x51f168[_0xdafc('0x3d')][_0xdafc('0x5b')][_0x4b425b]),'UserId':Number(_0x51f168[_0xdafc('0x58')]['id'])});}}else{socket[_0xdafc('0x9f')](_0xdafc('0x136'),{'FaxInteractionId':Number(_0x51f168[_0xdafc('0x3d')]['ids']),'UserId':Number(_0x51f168[_0xdafc('0x58')]['id'])});}});}})[_0xdafc('0x25')](respondWithStatusCode(_0x16f2fd,null))[_0xdafc('0x4c')](handleError(_0x16f2fd,null));};exports[_0xdafc('0x137')]=function(_0x589b12,_0x3aa8f1){return db[_0xdafc('0x35')][_0xdafc('0x2f')]({'where':{'id':_0x589b12[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x3aa8f1,null))[_0xdafc('0x25')](function(_0x299c85){if(_0x299c85){return _0x299c85[_0xdafc('0x137')](_0x589b12['body']['ids'],_[_0xdafc('0x5c')](_0x589b12[_0xdafc('0x57')],[_0xdafc('0x5b'),'id'])||{})[_0xdafc('0x9d')](function(){for(var _0xe3aab9=0x0;_0xe3aab9<_0x589b12['body'][_0xdafc('0x5b')][_0xdafc('0x44')];_0xe3aab9+=0x1){socket['emit']('user_has_sms_interactions:save',{'SmsInteractionId':Number(_0x589b12[_0xdafc('0x57')][_0xdafc('0x5b')][_0xe3aab9]),'UserId':Number(_0x589b12[_0xdafc('0x58')]['id'])});}return _0x589b12[_0xdafc('0x57')][_0xdafc('0x5b')];});}})[_0xdafc('0x25')](respondWithResult(_0x3aa8f1,null))['catch'](handleError(_0x3aa8f1,null));};exports[_0xdafc('0x138')]=function(_0x8b2736,_0x4d0cf6){return db[_0xdafc('0x35')][_0xdafc('0x2f')]({'where':{'id':_0x8b2736[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x4d0cf6,null))['then'](function(_0x1c6054){if(_0x1c6054){return _0x1c6054[_0xdafc('0x138')](_0x8b2736[_0xdafc('0x3d')][_0xdafc('0x5b')])['then'](function(){if(_[_0xdafc('0xac')](_0x8b2736[_0xdafc('0x3d')][_0xdafc('0x5b')])){for(var _0x271e51=0x0;_0x271e51<_0x8b2736[_0xdafc('0x3d')][_0xdafc('0x5b')]['length'];_0x271e51+=0x1){socket[_0xdafc('0x9f')](_0xdafc('0x139'),{'SmsInteractionId':Number(_0x8b2736['query'][_0xdafc('0x5b')][_0x271e51]),'UserId':Number(_0x8b2736[_0xdafc('0x58')]['id'])});}}else{socket[_0xdafc('0x9f')](_0xdafc('0x139'),{'SmsInteractionId':Number(_0x8b2736[_0xdafc('0x3d')][_0xdafc('0x5b')]),'UserId':Number(_0x8b2736[_0xdafc('0x58')]['id'])});}});}})[_0xdafc('0x25')](respondWithStatusCode(_0x4d0cf6,null))[_0xdafc('0x4c')](handleError(_0x4d0cf6,null));};exports[_0xdafc('0x13a')]=function(_0xcca6f1,_0x503459){return db['User'][_0xdafc('0x2f')]({'where':{'id':_0xcca6f1['params']['id']}})['then'](handleEntityNotFound(_0x503459,null))[_0xdafc('0x25')](function(_0x6eee34){if(_0x6eee34){return _0x6eee34['addOpenchannelInteractions'](_0xcca6f1['body']['ids'],_[_0xdafc('0x5c')](_0xcca6f1[_0xdafc('0x57')],[_0xdafc('0x5b'),'id'])||{})[_0xdafc('0x9d')](function(){for(var _0x323b9c=0x0;_0x323b9c<_0xcca6f1[_0xdafc('0x57')][_0xdafc('0x5b')][_0xdafc('0x44')];_0x323b9c+=0x1){socket['emit']('user_has_openchannel_interactions:save',{'OpenchannelInteractionId':Number(_0xcca6f1[_0xdafc('0x57')][_0xdafc('0x5b')][_0x323b9c]),'UserId':Number(_0xcca6f1[_0xdafc('0x58')]['id'])});}return _0xcca6f1['body'][_0xdafc('0x5b')];});}})['then'](respondWithResult(_0x503459,null))[_0xdafc('0x4c')](handleError(_0x503459,null));};exports[_0xdafc('0x13b')]=function(_0x373822,_0x496700){return db[_0xdafc('0x35')][_0xdafc('0x2f')]({'where':{'id':_0x373822[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x496700,null))[_0xdafc('0x25')](function(_0x1b0cb4){if(_0x1b0cb4){return _0x1b0cb4['removeOpenchannelInteractions'](_0x373822[_0xdafc('0x3d')]['ids'])['then'](function(){if(_[_0xdafc('0xac')](_0x373822[_0xdafc('0x3d')][_0xdafc('0x5b')])){for(var _0x5daae8=0x0;_0x5daae8<_0x373822['query'][_0xdafc('0x5b')]['length'];_0x5daae8+=0x1){socket[_0xdafc('0x9f')](_0xdafc('0x13c'),{'OpenchannelInteractionId':Number(_0x373822[_0xdafc('0x3d')][_0xdafc('0x5b')][_0x5daae8]),'UserId':Number(_0x373822[_0xdafc('0x58')]['id'])});}}else{socket['emit'](_0xdafc('0x13c'),{'OpenchannelInteractionId':Number(_0x373822[_0xdafc('0x3d')]['ids']),'UserId':Number(_0x373822[_0xdafc('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x496700,null))[_0xdafc('0x4c')](handleError(_0x496700,null));};exports[_0xdafc('0x13d')]=function(_0x89a1ed,_0x5827a9){return db[_0xdafc('0x35')]['find']({'where':{'id':_0x89a1ed[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x5827a9,null))['then'](function(_0x465197){if(_0x465197){return _0x465197[_0xdafc('0x13d')](_0x89a1ed[_0xdafc('0x57')][_0xdafc('0x5b')],_['omit'](_0x89a1ed[_0xdafc('0x57')],['ids','id'])||{})[_0xdafc('0x9d')](function(){for(var _0xdf5a62=0x0;_0xdf5a62<_0x89a1ed[_0xdafc('0x57')][_0xdafc('0x5b')][_0xdafc('0x44')];_0xdf5a62+=0x1){socket[_0xdafc('0x9f')](_0xdafc('0x13e'),{'WhatsappInteractionId':Number(_0x89a1ed[_0xdafc('0x57')][_0xdafc('0x5b')][_0xdf5a62]),'UserId':Number(_0x89a1ed[_0xdafc('0x58')]['id'])});}return _0x89a1ed['body'][_0xdafc('0x5b')];});}})[_0xdafc('0x25')](respondWithResult(_0x5827a9,null))[_0xdafc('0x4c')](handleError(_0x5827a9,null));};exports['removeWhatsappInteractions']=function(_0x359c14,_0x15027e){return db[_0xdafc('0x35')][_0xdafc('0x2f')]({'where':{'id':_0x359c14['params']['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x15027e,null))[_0xdafc('0x25')](function(_0x43a61e){if(_0x43a61e){return _0x43a61e[_0xdafc('0x13f')](_0x359c14['query']['ids']);}})[_0xdafc('0x25')](respondWithStatusCode(_0x15027e,null))[_0xdafc('0x4c')](handleError(_0x15027e,null));};exports[_0xdafc('0x140')]=function(_0x1cb5aa,_0x49ff36){var _0x32afe8={};var _0x5aa89d={};var _0x4debe2;var _0x1e300a;return db[_0xdafc('0x35')]['findOne']({'where':{'id':_0x1cb5aa[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x49ff36,null))[_0xdafc('0x25')](function(_0x305c0b){if(_0x305c0b){_0x4debe2=_0x305c0b;_0x5aa89d[_0xdafc('0x4e')]=_[_0xdafc('0x50')](db[_0xdafc('0x141')]['rawAttributes']);_0x5aa89d[_0xdafc('0x3d')]=_[_0xdafc('0x50')](_0x1cb5aa[_0xdafc('0x3d')]);_0x5aa89d[_0xdafc('0xc5')]=_[_0xdafc('0x51')](_0x5aa89d[_0xdafc('0x4e')],_0x5aa89d[_0xdafc('0x3d')]);_0x32afe8[_0xdafc('0x3f')]=_['intersection'](_0x5aa89d['model'],qs['fields'](_0x1cb5aa[_0xdafc('0x3d')][_0xdafc('0x52')]));_0x32afe8[_0xdafc('0x3f')]=_0x32afe8[_0xdafc('0x3f')][_0xdafc('0x44')]?_0x32afe8[_0xdafc('0x3f')]:_0x5aa89d[_0xdafc('0x4e')];_0x32afe8[_0xdafc('0xc6')]=qs[_0xdafc('0xc7')](_0x1cb5aa[_0xdafc('0x3d')][_0xdafc('0xc7')]);_0x32afe8[_0xdafc('0x3c')]=qs[_0xdafc('0xc5')](_[_0xdafc('0xc8')](_0x1cb5aa[_0xdafc('0x3d')],_0x5aa89d[_0xdafc('0xc5')]));if(_0x1cb5aa[_0xdafc('0x3d')][_0xdafc('0xc9')]){_0x32afe8[_0xdafc('0x3c')]=_[_0xdafc('0x53')](_0x32afe8['where'],{'$or':_[_0xdafc('0x2d')](_0x32afe8[_0xdafc('0x3f')],function(_0x5784b7){var _0x3b3443={};_0x3b3443[_0x5784b7]={'$like':'%'+_0x1cb5aa[_0xdafc('0x3d')][_0xdafc('0xc9')]+'%'};return _0x3b3443;})});}_0x32afe8=_[_0xdafc('0x53')]({},_0x32afe8,_0x1cb5aa['options']);return _0x4debe2[_0xdafc('0x140')](_0x32afe8);}})[_0xdafc('0x25')](function(_0xbc18d7){if(_0xbc18d7){_0x1e300a=_0xbc18d7[_0xdafc('0x44')];if(!_0x1cb5aa[_0xdafc('0x3d')][_0xdafc('0xca')](_0xdafc('0xd4'))){_0x32afe8[_0xdafc('0x21')]=qs[_0xdafc('0x21')](_0x1cb5aa[_0xdafc('0x3d')][_0xdafc('0x21')]);_0x32afe8['offset']=qs[_0xdafc('0x23')](_0x1cb5aa['query']['offset']);}return _0x4debe2['getVoicePrefixes'](_0x32afe8);}})[_0xdafc('0x25')](function(_0x49dc3e){if(_0x49dc3e){return _0x49dc3e?{'count':_0x1e300a,'rows':_0x49dc3e}:null;}})[_0xdafc('0x25')](respondWithResult(_0x49ff36,null))[_0xdafc('0x4c')](handleError(_0x49ff36,null));};exports['getFaxAccounts']=function(_0xe885cf,_0x23a497){var _0x5643b6={};var _0x486679={};var _0x4ac9ac;var _0xdec07;return db[_0xdafc('0x35')][_0xdafc('0xc3')]({'where':{'id':_0xe885cf[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x23a497,null))[_0xdafc('0x25')](function(_0x1615fe){if(_0x1615fe){_0x4ac9ac=_0x1615fe;_0x486679[_0xdafc('0x4e')]=_[_0xdafc('0x50')](db[_0xdafc('0x142')][_0xdafc('0xc4')]);_0x486679[_0xdafc('0x3d')]=_[_0xdafc('0x50')](_0xe885cf[_0xdafc('0x3d')]);_0x486679[_0xdafc('0xc5')]=_[_0xdafc('0x51')](_0x486679[_0xdafc('0x4e')],_0x486679[_0xdafc('0x3d')]);_0x5643b6[_0xdafc('0x3f')]=_[_0xdafc('0x51')](_0x486679[_0xdafc('0x4e')],qs['fields'](_0xe885cf[_0xdafc('0x3d')][_0xdafc('0x52')]));_0x5643b6[_0xdafc('0x3f')]=_0x5643b6['attributes']['length']?_0x5643b6[_0xdafc('0x3f')]:_0x486679[_0xdafc('0x4e')];_0x5643b6[_0xdafc('0xc6')]=qs[_0xdafc('0xc7')](_0xe885cf[_0xdafc('0x3d')][_0xdafc('0xc7')]);_0x5643b6[_0xdafc('0x3c')]=qs[_0xdafc('0xc5')](_[_0xdafc('0xc8')](_0xe885cf['query'],_0x486679[_0xdafc('0xc5')]));if(_0xe885cf[_0xdafc('0x3d')][_0xdafc('0xc9')]){_0x5643b6['where']=_[_0xdafc('0x53')](_0x5643b6[_0xdafc('0x3c')],{'$or':_['map'](_0x5643b6[_0xdafc('0x3f')],function(_0x3e57bf){var _0xab63a6={};_0xab63a6[_0x3e57bf]={'$like':'%'+_0xe885cf['query'][_0xdafc('0xc9')]+'%'};return _0xab63a6;})});}_0x5643b6=_[_0xdafc('0x53')]({},_0x5643b6,_0xe885cf[_0xdafc('0x54')]);return _0x4ac9ac[_0xdafc('0x143')](_0x5643b6);}})[_0xdafc('0x25')](function(_0x47b44b){if(_0x47b44b){_0xdec07=_0x47b44b['length'];if(!_0xe885cf[_0xdafc('0x3d')]['hasOwnProperty'](_0xdafc('0xd4'))){_0x5643b6['limit']=qs[_0xdafc('0x21')](_0xe885cf['query'][_0xdafc('0x21')]);_0x5643b6[_0xdafc('0x23')]=qs[_0xdafc('0x23')](_0xe885cf[_0xdafc('0x3d')][_0xdafc('0x23')]);}return _0x4ac9ac[_0xdafc('0x143')](_0x5643b6);}})[_0xdafc('0x25')](function(_0xfbcda6){if(_0xfbcda6){return _0xfbcda6?{'count':_0xdec07,'rows':_0xfbcda6}:null;}})[_0xdafc('0x25')](respondWithResult(_0x23a497,null))[_0xdafc('0x4c')](handleError(_0x23a497,null));};exports[_0xdafc('0x144')]=function(_0x1673c2,_0x228038){return db[_0xdafc('0x35')]['find']({'where':{'id':_0x1673c2[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x228038,null))[_0xdafc('0x25')](function(_0x3e5c0c){if(_0x3e5c0c){return _0x3e5c0c['addFaxAccounts'](_0x1673c2['body'][_0xdafc('0x5b')],_['omit'](_0x1673c2[_0xdafc('0x57')],['ids','id'])||{});}})[_0xdafc('0x25')](respondWithResult(_0x228038,null))[_0xdafc('0x4c')](handleError(_0x228038,null));};exports[_0xdafc('0x145')]=function(_0x86abf1,_0x545980){return db[_0xdafc('0x35')][_0xdafc('0x2f')]({'where':{'id':_0x86abf1[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x545980,null))[_0xdafc('0x25')](function(_0x5758c6){if(_0x5758c6){return _0x5758c6['removeFaxAccounts'](_0x86abf1[_0xdafc('0x3d')][_0xdafc('0x5b')]);}})['then'](respondWithStatusCode(_0x545980,null))[_0xdafc('0x4c')](handleError(_0x545980,null));};exports[_0xdafc('0x146')]=function(_0x1c9f55,_0x49c073){var _0xd42546={};var _0x49df7b={};var _0x128499;var _0xe2ecb9;return db[_0xdafc('0x35')][_0xdafc('0xc3')]({'where':{'id':_0x1c9f55[_0xdafc('0x58')]['id']}})['then'](handleEntityNotFound(_0x49c073,null))['then'](function(_0x42c8ef){if(_0x42c8ef){_0x128499=_0x42c8ef;_0x49df7b[_0xdafc('0x4e')]=_[_0xdafc('0x50')](db[_0xdafc('0x147')][_0xdafc('0xc4')]);_0x49df7b[_0xdafc('0x3d')]=_[_0xdafc('0x50')](_0x1c9f55['query']);_0x49df7b[_0xdafc('0xc5')]=_[_0xdafc('0x51')](_0x49df7b[_0xdafc('0x4e')],_0x49df7b['query']);_0xd42546['attributes']=_['intersection'](_0x49df7b[_0xdafc('0x4e')],qs[_0xdafc('0x52')](_0x1c9f55['query'][_0xdafc('0x52')]));_0xd42546[_0xdafc('0x3f')]=_0xd42546[_0xdafc('0x3f')]['length']?_0xd42546[_0xdafc('0x3f')]:_0x49df7b['model'];_0xd42546[_0xdafc('0xc6')]=qs['sort'](_0x1c9f55[_0xdafc('0x3d')][_0xdafc('0xc7')]);_0xd42546[_0xdafc('0x3c')]=qs[_0xdafc('0xc5')](_[_0xdafc('0xc8')](_0x1c9f55[_0xdafc('0x3d')],_0x49df7b[_0xdafc('0xc5')]));if(_0x1c9f55[_0xdafc('0x3d')]['filter']){_0xd42546['where']=_[_0xdafc('0x53')](_0xd42546[_0xdafc('0x3c')],{'$or':_[_0xdafc('0x2d')](_0xd42546[_0xdafc('0x3f')],function(_0x55ef06){var _0x435cdf={};_0x435cdf[_0x55ef06]={'$like':'%'+_0x1c9f55[_0xdafc('0x3d')]['filter']+'%'};return _0x435cdf;})});}_0xd42546=_['merge']({},_0xd42546,_0x1c9f55[_0xdafc('0x54')]);return _0x128499[_0xdafc('0x146')](_0xd42546);}})[_0xdafc('0x25')](function(_0xe4b681){if(_0xe4b681){_0xe2ecb9=_0xe4b681[_0xdafc('0x44')];if(!_0x1c9f55[_0xdafc('0x3d')][_0xdafc('0xca')](_0xdafc('0xd4'))){_0xd42546[_0xdafc('0x21')]=qs[_0xdafc('0x21')](_0x1c9f55[_0xdafc('0x3d')][_0xdafc('0x21')]);_0xd42546['offset']=qs[_0xdafc('0x23')](_0x1c9f55[_0xdafc('0x3d')][_0xdafc('0x23')]);}return _0x128499['getMailAccounts'](_0xd42546);}})[_0xdafc('0x25')](function(_0x4041a6){if(_0x4041a6){return _0x4041a6?{'count':_0xe2ecb9,'rows':_0x4041a6}:null;}})[_0xdafc('0x25')](respondWithResult(_0x49c073,null))['catch'](handleError(_0x49c073,null));};exports['addMailAccounts']=function(_0xd409b1,_0x23cd20){return db[_0xdafc('0x35')][_0xdafc('0x2f')]({'where':{'id':_0xd409b1[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x23cd20,null))[_0xdafc('0x25')](function(_0x5434a2){if(_0x5434a2){return _0x5434a2[_0xdafc('0x148')](_0xd409b1[_0xdafc('0x57')]['ids'],_[_0xdafc('0x5c')](_0xd409b1[_0xdafc('0x57')],['ids','id'])||{});}})[_0xdafc('0x25')](respondWithResult(_0x23cd20,null))[_0xdafc('0x4c')](handleError(_0x23cd20,null));};exports['removeMailAccounts']=function(_0x340574,_0x3d0c39){return db[_0xdafc('0x35')][_0xdafc('0x2f')]({'where':{'id':_0x340574['params']['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x3d0c39,null))[_0xdafc('0x25')](function(_0x39cd87){if(_0x39cd87){return _0x39cd87[_0xdafc('0x149')](_0x340574['query'][_0xdafc('0x5b')]);}})['then'](respondWithStatusCode(_0x3d0c39,null))[_0xdafc('0x4c')](handleError(_0x3d0c39,null));};exports[_0xdafc('0x14a')]=function(_0x17b3ca,_0x637050){var _0x39d451={};var _0x3383c2={};var _0x110b74;var _0x1b81c2;return db[_0xdafc('0x35')][_0xdafc('0xc3')]({'where':{'id':_0x17b3ca['params']['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x637050,null))[_0xdafc('0x25')](function(_0x12c137){if(_0x12c137){_0x110b74=_0x12c137;_0x3383c2['model']=_[_0xdafc('0x50')](db[_0xdafc('0x14b')]['rawAttributes']);_0x3383c2[_0xdafc('0x3d')]=_[_0xdafc('0x50')](_0x17b3ca['query']);_0x3383c2[_0xdafc('0xc5')]=_[_0xdafc('0x51')](_0x3383c2[_0xdafc('0x4e')],_0x3383c2['query']);_0x39d451[_0xdafc('0x3f')]=_[_0xdafc('0x51')](_0x3383c2[_0xdafc('0x4e')],qs[_0xdafc('0x52')](_0x17b3ca[_0xdafc('0x3d')][_0xdafc('0x52')]));_0x39d451['attributes']=_0x39d451[_0xdafc('0x3f')]['length']?_0x39d451[_0xdafc('0x3f')]:_0x3383c2[_0xdafc('0x4e')];_0x39d451[_0xdafc('0xc6')]=qs[_0xdafc('0xc7')](_0x17b3ca[_0xdafc('0x3d')][_0xdafc('0xc7')]);_0x39d451[_0xdafc('0x3c')]=qs[_0xdafc('0xc5')](_[_0xdafc('0xc8')](_0x17b3ca[_0xdafc('0x3d')],_0x3383c2['filters']));if(_0x17b3ca[_0xdafc('0x3d')][_0xdafc('0xc9')]){_0x39d451[_0xdafc('0x3c')]=_[_0xdafc('0x53')](_0x39d451['where'],{'$or':_['map'](_0x39d451[_0xdafc('0x3f')],function(_0xe97e2c){var _0x2bb8ac={};_0x2bb8ac[_0xe97e2c]={'$like':'%'+_0x17b3ca[_0xdafc('0x3d')][_0xdafc('0xc9')]+'%'};return _0x2bb8ac;})});}_0x39d451=_[_0xdafc('0x53')]({},_0x39d451,_0x17b3ca[_0xdafc('0x54')]);return _0x110b74[_0xdafc('0x14a')](_0x39d451);}})[_0xdafc('0x25')](function(_0x68177){if(_0x68177){_0x1b81c2=_0x68177['length'];if(!_0x17b3ca[_0xdafc('0x3d')][_0xdafc('0xca')](_0xdafc('0xd4'))){_0x39d451['limit']=qs[_0xdafc('0x21')](_0x17b3ca['query'][_0xdafc('0x21')]);_0x39d451[_0xdafc('0x23')]=qs['offset'](_0x17b3ca[_0xdafc('0x3d')][_0xdafc('0x23')]);}return _0x110b74[_0xdafc('0x14a')](_0x39d451);}})[_0xdafc('0x25')](function(_0x12724f){if(_0x12724f){return _0x12724f?{'count':_0x1b81c2,'rows':_0x12724f}:null;}})['then'](respondWithResult(_0x637050,null))[_0xdafc('0x4c')](handleError(_0x637050,null));};exports[_0xdafc('0x14c')]=function(_0x1c5394,_0x36e57e){return db[_0xdafc('0x35')][_0xdafc('0x2f')]({'where':{'id':_0x1c5394['params']['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x36e57e,null))[_0xdafc('0x25')](function(_0x47b029){if(_0x47b029){return _0x47b029[_0xdafc('0x14c')](_0x1c5394[_0xdafc('0x57')][_0xdafc('0x5b')],_[_0xdafc('0x5c')](_0x1c5394[_0xdafc('0x57')],[_0xdafc('0x5b'),'id'])||{});}})[_0xdafc('0x25')](respondWithResult(_0x36e57e,null))['catch'](handleError(_0x36e57e,null));};exports['removeOpenchannelAccounts']=function(_0x3ed6a2,_0x426201){return db['User'][_0xdafc('0x2f')]({'where':{'id':_0x3ed6a2[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x426201,null))['then'](function(_0x347ff8){if(_0x347ff8){return _0x347ff8[_0xdafc('0x14d')](_0x3ed6a2[_0xdafc('0x3d')][_0xdafc('0x5b')]);}})[_0xdafc('0x25')](respondWithStatusCode(_0x426201,null))[_0xdafc('0x4c')](handleError(_0x426201,null));};exports[_0xdafc('0x14e')]=function(_0x4f9cb1,_0x21398f){var _0x3821d9={};var _0x367e58={};var _0x5c8457;var _0x444c62;return db[_0xdafc('0x35')][_0xdafc('0xc3')]({'where':{'id':_0x4f9cb1[_0xdafc('0x58')]['id']}})['then'](handleEntityNotFound(_0x21398f,null))[_0xdafc('0x25')](function(_0xcab5fe){if(_0xcab5fe){_0x5c8457=_0xcab5fe;_0x367e58[_0xdafc('0x4e')]=_['keys'](db['SmsAccount'][_0xdafc('0xc4')]);_0x367e58['query']=_['keys'](_0x4f9cb1[_0xdafc('0x3d')]);_0x367e58['filters']=_[_0xdafc('0x51')](_0x367e58[_0xdafc('0x4e')],_0x367e58['query']);_0x3821d9[_0xdafc('0x3f')]=_[_0xdafc('0x51')](_0x367e58[_0xdafc('0x4e')],qs['fields'](_0x4f9cb1[_0xdafc('0x3d')][_0xdafc('0x52')]));_0x3821d9[_0xdafc('0x3f')]=_0x3821d9[_0xdafc('0x3f')][_0xdafc('0x44')]?_0x3821d9['attributes']:_0x367e58['model'];_0x3821d9[_0xdafc('0xc6')]=qs[_0xdafc('0xc7')](_0x4f9cb1[_0xdafc('0x3d')]['sort']);_0x3821d9['where']=qs[_0xdafc('0xc5')](_['pick'](_0x4f9cb1['query'],_0x367e58[_0xdafc('0xc5')]));if(_0x4f9cb1[_0xdafc('0x3d')]['filter']){_0x3821d9['where']=_[_0xdafc('0x53')](_0x3821d9[_0xdafc('0x3c')],{'$or':_[_0xdafc('0x2d')](_0x3821d9[_0xdafc('0x3f')],function(_0x5f4670){var _0x233c72={};_0x233c72[_0x5f4670]={'$like':'%'+_0x4f9cb1[_0xdafc('0x3d')]['filter']+'%'};return _0x233c72;})});}_0x3821d9=_[_0xdafc('0x53')]({},_0x3821d9,_0x4f9cb1[_0xdafc('0x54')]);return _0x5c8457['getSmsAccounts'](_0x3821d9);}})['then'](function(_0x27e834){if(_0x27e834){_0x444c62=_0x27e834[_0xdafc('0x44')];if(!_0x4f9cb1['query'][_0xdafc('0xca')](_0xdafc('0xd4'))){_0x3821d9[_0xdafc('0x21')]=qs[_0xdafc('0x21')](_0x4f9cb1[_0xdafc('0x3d')][_0xdafc('0x21')]);_0x3821d9[_0xdafc('0x23')]=qs[_0xdafc('0x23')](_0x4f9cb1[_0xdafc('0x3d')]['offset']);}return _0x5c8457[_0xdafc('0x14e')](_0x3821d9);}})[_0xdafc('0x25')](function(_0x25cdaa){if(_0x25cdaa){return _0x25cdaa?{'count':_0x444c62,'rows':_0x25cdaa}:null;}})[_0xdafc('0x25')](respondWithResult(_0x21398f,null))[_0xdafc('0x4c')](handleError(_0x21398f,null));};exports[_0xdafc('0x14f')]=function(_0x53ec32,_0x5df840){return db[_0xdafc('0x35')][_0xdafc('0x2f')]({'where':{'id':_0x53ec32['params']['id']}})['then'](handleEntityNotFound(_0x5df840,null))[_0xdafc('0x25')](function(_0x1d3e5f){if(_0x1d3e5f){return _0x1d3e5f[_0xdafc('0x14f')](_0x53ec32[_0xdafc('0x57')][_0xdafc('0x5b')],_[_0xdafc('0x5c')](_0x53ec32[_0xdafc('0x57')],[_0xdafc('0x5b'),'id'])||{});}})[_0xdafc('0x25')](respondWithResult(_0x5df840,null))['catch'](handleError(_0x5df840,null));};exports[_0xdafc('0x150')]=function(_0xd85d38,_0x55d3a4){return db[_0xdafc('0x35')][_0xdafc('0x2f')]({'where':{'id':_0xd85d38['params']['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x55d3a4,null))[_0xdafc('0x25')](function(_0x22878d){if(_0x22878d){return _0x22878d[_0xdafc('0x150')](_0xd85d38[_0xdafc('0x3d')][_0xdafc('0x5b')]);}})['then'](respondWithStatusCode(_0x55d3a4,null))[_0xdafc('0x4c')](handleError(_0x55d3a4,null));};exports['getChatWebsites']=function(_0x4b1c59,_0x46625b){var _0x35ad80={};var _0x40f500={};var _0xc4ae1f;var _0x1e0d74;return db[_0xdafc('0x35')]['findOne']({'where':{'id':_0x4b1c59[_0xdafc('0x58')]['id']}})['then'](handleEntityNotFound(_0x46625b,null))[_0xdafc('0x25')](function(_0x582798){if(_0x582798){_0xc4ae1f=_0x582798;_0x40f500[_0xdafc('0x4e')]=_[_0xdafc('0x50')](db[_0xdafc('0x151')][_0xdafc('0xc4')]);_0x40f500['query']=_[_0xdafc('0x50')](_0x4b1c59['query']);_0x40f500[_0xdafc('0xc5')]=_[_0xdafc('0x51')](_0x40f500['model'],_0x40f500[_0xdafc('0x3d')]);_0x35ad80[_0xdafc('0x3f')]=_[_0xdafc('0x51')](_0x40f500['model'],qs['fields'](_0x4b1c59['query'][_0xdafc('0x52')]));_0x35ad80[_0xdafc('0x3f')]=_0x35ad80[_0xdafc('0x3f')][_0xdafc('0x44')]?_0x35ad80['attributes']:_0x40f500[_0xdafc('0x4e')];_0x35ad80[_0xdafc('0xc6')]=qs[_0xdafc('0xc7')](_0x4b1c59[_0xdafc('0x3d')][_0xdafc('0xc7')]);_0x35ad80[_0xdafc('0x3c')]=qs[_0xdafc('0xc5')](_[_0xdafc('0xc8')](_0x4b1c59[_0xdafc('0x3d')],_0x40f500[_0xdafc('0xc5')]));if(_0x4b1c59[_0xdafc('0x3d')][_0xdafc('0xc9')]){_0x35ad80[_0xdafc('0x3c')]=_[_0xdafc('0x53')](_0x35ad80[_0xdafc('0x3c')],{'$or':_[_0xdafc('0x2d')](_0x35ad80[_0xdafc('0x3f')],function(_0x2ca8e2){var _0x3f664e={};_0x3f664e[_0x2ca8e2]={'$like':'%'+_0x4b1c59[_0xdafc('0x3d')][_0xdafc('0xc9')]+'%'};return _0x3f664e;})});}_0x35ad80=_[_0xdafc('0x53')]({},_0x35ad80,_0x4b1c59[_0xdafc('0x54')]);return _0xc4ae1f[_0xdafc('0x152')](_0x35ad80);}})[_0xdafc('0x25')](function(_0x22a27e){if(_0x22a27e){_0x1e0d74=_0x22a27e[_0xdafc('0x44')];if(!_0x4b1c59['query'][_0xdafc('0xca')](_0xdafc('0xd4'))){_0x35ad80[_0xdafc('0x21')]=qs[_0xdafc('0x21')](_0x4b1c59[_0xdafc('0x3d')][_0xdafc('0x21')]);_0x35ad80[_0xdafc('0x23')]=qs[_0xdafc('0x23')](_0x4b1c59[_0xdafc('0x3d')][_0xdafc('0x23')]);}return _0xc4ae1f[_0xdafc('0x152')](_0x35ad80);}})[_0xdafc('0x25')](function(_0x418119){if(_0x418119){return _0x418119?{'count':_0x1e0d74,'rows':_0x418119}:null;}})[_0xdafc('0x25')](respondWithResult(_0x46625b,null))[_0xdafc('0x4c')](handleError(_0x46625b,null));};exports['addChatWebsites']=function(_0x1e8d6f,_0x396006){return db[_0xdafc('0x35')][_0xdafc('0x2f')]({'where':{'id':_0x1e8d6f[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x396006,null))[_0xdafc('0x25')](function(_0xc94d1){if(_0xc94d1){return _0xc94d1[_0xdafc('0x153')](_0x1e8d6f['body'][_0xdafc('0x5b')],_[_0xdafc('0x5c')](_0x1e8d6f[_0xdafc('0x57')],['ids','id'])||{});}})[_0xdafc('0x25')](respondWithResult(_0x396006,null))['catch'](handleError(_0x396006,null));};exports[_0xdafc('0x154')]=function(_0x398c4b,_0x41faaf){return db[_0xdafc('0x35')][_0xdafc('0x2f')]({'where':{'id':_0x398c4b[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x41faaf,null))[_0xdafc('0x25')](function(_0x2e219f){if(_0x2e219f){return _0x2e219f[_0xdafc('0x154')](_0x398c4b['query'][_0xdafc('0x5b')]);}})[_0xdafc('0x25')](respondWithStatusCode(_0x41faaf,null))[_0xdafc('0x4c')](handleError(_0x41faaf,null));};exports[_0xdafc('0x155')]=function(_0x27d083,_0x23f590){var _0x5b82d1={};var _0x29e296={};var _0xe0a8ac;var _0x4fbd49;return db[_0xdafc('0x35')]['findOne']({'where':{'id':_0x27d083[_0xdafc('0x58')]['id']}})['then'](handleEntityNotFound(_0x23f590,null))[_0xdafc('0x25')](function(_0x3ebc23){if(_0x3ebc23){_0xe0a8ac=_0x3ebc23;_0x29e296[_0xdafc('0x4e')]=_['keys'](db[_0xdafc('0x156')][_0xdafc('0xc4')]);_0x29e296[_0xdafc('0x3d')]=_[_0xdafc('0x50')](_0x27d083[_0xdafc('0x3d')]);_0x29e296[_0xdafc('0xc5')]=_[_0xdafc('0x51')](_0x29e296[_0xdafc('0x4e')],_0x29e296[_0xdafc('0x3d')]);_0x5b82d1[_0xdafc('0x3f')]=_[_0xdafc('0x51')](_0x29e296[_0xdafc('0x4e')],qs[_0xdafc('0x52')](_0x27d083[_0xdafc('0x3d')][_0xdafc('0x52')]));_0x5b82d1[_0xdafc('0x3f')]=_0x5b82d1[_0xdafc('0x3f')][_0xdafc('0x44')]?_0x5b82d1['attributes']:_0x29e296[_0xdafc('0x4e')];_0x5b82d1[_0xdafc('0xc6')]=qs[_0xdafc('0xc7')](_0x27d083['query'][_0xdafc('0xc7')]);_0x5b82d1['where']=qs['filters'](_[_0xdafc('0xc8')](_0x27d083[_0xdafc('0x3d')],_0x29e296['filters']));if(_0x27d083[_0xdafc('0x3d')][_0xdafc('0xc9')]){_0x5b82d1[_0xdafc('0x3c')]=_[_0xdafc('0x53')](_0x5b82d1[_0xdafc('0x3c')],{'$or':_[_0xdafc('0x2d')](_0x5b82d1[_0xdafc('0x3f')],function(_0x55294d){var _0x82a096={};_0x82a096[_0x55294d]={'$like':'%'+_0x27d083[_0xdafc('0x3d')]['filter']+'%'};return _0x82a096;})});}_0x5b82d1=_[_0xdafc('0x53')]({},_0x5b82d1,_0x27d083['options']);return _0xe0a8ac['getWhatsappAccounts'](_0x5b82d1);}})[_0xdafc('0x25')](function(_0x19982e){if(_0x19982e){_0x4fbd49=_0x19982e[_0xdafc('0x44')];if(!_0x27d083[_0xdafc('0x3d')][_0xdafc('0xca')](_0xdafc('0xd4'))){_0x5b82d1[_0xdafc('0x21')]=qs[_0xdafc('0x21')](_0x27d083['query']['limit']);_0x5b82d1['offset']=qs[_0xdafc('0x23')](_0x27d083[_0xdafc('0x3d')][_0xdafc('0x23')]);}return _0xe0a8ac[_0xdafc('0x155')](_0x5b82d1);}})[_0xdafc('0x25')](function(_0x5179d8){if(_0x5179d8){return _0x5179d8?{'count':_0x4fbd49,'rows':_0x5179d8}:null;}})[_0xdafc('0x25')](respondWithResult(_0x23f590,null))[_0xdafc('0x4c')](handleError(_0x23f590,null));};exports[_0xdafc('0x157')]=function(_0x1c980e,_0x3dca5c){return db[_0xdafc('0x35')][_0xdafc('0x2f')]({'where':{'id':_0x1c980e[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x3dca5c,null))['then'](function(_0xfe1e9b){if(_0xfe1e9b){return _0xfe1e9b[_0xdafc('0x157')](_0x1c980e['body'][_0xdafc('0x5b')],_['omit'](_0x1c980e[_0xdafc('0x57')],[_0xdafc('0x5b'),'id'])||{});}})[_0xdafc('0x25')](respondWithResult(_0x3dca5c,null))[_0xdafc('0x4c')](handleError(_0x3dca5c,null));};exports[_0xdafc('0x158')]=function(_0x1ac449,_0x53df4b){return db['User'][_0xdafc('0x2f')]({'where':{'id':_0x1ac449[_0xdafc('0x58')]['id']}})['then'](handleEntityNotFound(_0x53df4b,null))[_0xdafc('0x25')](function(_0x4e3158){if(_0x4e3158){return _0x4e3158[_0xdafc('0x158')](_0x1ac449['query']['ids']);}})['then'](respondWithStatusCode(_0x53df4b,null))[_0xdafc('0x4c')](handleError(_0x53df4b,null));};exports[_0xdafc('0x159')]=function(_0x4684ba,_0x16e301){var _0x5070a8={};var _0x5221ab={};var _0x2540e4;var _0x3e7d76;return db[_0xdafc('0x35')][_0xdafc('0xc3')]({'where':{'id':_0x4684ba[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x16e301,null))[_0xdafc('0x25')](function(_0x14a6da){if(_0x14a6da){_0x2540e4=_0x14a6da;_0x5221ab['model']=_['keys'](db['SquareProject'][_0xdafc('0xc4')]);_0x5221ab[_0xdafc('0x3d')]=_[_0xdafc('0x50')](_0x4684ba['query']);_0x5221ab[_0xdafc('0xc5')]=_['intersection'](_0x5221ab[_0xdafc('0x4e')],_0x5221ab[_0xdafc('0x3d')]);_0x5070a8[_0xdafc('0x3f')]=_['intersection'](_0x5221ab[_0xdafc('0x4e')],qs[_0xdafc('0x52')](_0x4684ba[_0xdafc('0x3d')][_0xdafc('0x52')]));_0x5070a8[_0xdafc('0x3f')]=_0x5070a8[_0xdafc('0x3f')][_0xdafc('0x44')]?_0x5070a8['attributes']:_0x5221ab[_0xdafc('0x4e')];_0x5070a8[_0xdafc('0xc6')]=qs[_0xdafc('0xc7')](_0x4684ba[_0xdafc('0x3d')][_0xdafc('0xc7')]);_0x5070a8[_0xdafc('0x3c')]=qs[_0xdafc('0xc5')](_[_0xdafc('0xc8')](_0x4684ba['query'],_0x5221ab[_0xdafc('0xc5')]));if(_0x4684ba['query'][_0xdafc('0xc9')]){_0x5070a8[_0xdafc('0x3c')]=_[_0xdafc('0x53')](_0x5070a8[_0xdafc('0x3c')],{'$or':_[_0xdafc('0x2d')](_0x5070a8[_0xdafc('0x3f')],function(_0xa928d4){var _0x596baf={};_0x596baf[_0xa928d4]={'$like':'%'+_0x4684ba[_0xdafc('0x3d')][_0xdafc('0xc9')]+'%'};return _0x596baf;})});}_0x5070a8=_[_0xdafc('0x53')]({},_0x5070a8,_0x4684ba['options']);return _0x2540e4[_0xdafc('0x159')](_0x5070a8);}})[_0xdafc('0x25')](function(_0x4bf543){if(_0x4bf543){_0x3e7d76=_0x4bf543[_0xdafc('0x44')];if(!_0x4684ba[_0xdafc('0x3d')][_0xdafc('0xca')](_0xdafc('0xd4'))){_0x5070a8[_0xdafc('0x21')]=qs[_0xdafc('0x21')](_0x4684ba[_0xdafc('0x3d')][_0xdafc('0x21')]);_0x5070a8[_0xdafc('0x23')]=qs['offset'](_0x4684ba[_0xdafc('0x3d')][_0xdafc('0x23')]);}return _0x2540e4['getSquareProjects'](_0x5070a8);}})[_0xdafc('0x25')](function(_0x19143e){if(_0x19143e){return _0x19143e?{'count':_0x3e7d76,'rows':_0x19143e}:null;}})['then'](respondWithResult(_0x16e301,null))[_0xdafc('0x4c')](handleError(_0x16e301,null));};exports[_0xdafc('0x15a')]=function(_0x56628c,_0x493cba){return db[_0xdafc('0x35')][_0xdafc('0x2f')]({'where':{'id':_0x56628c['params']['id']}})['then'](handleEntityNotFound(_0x493cba,null))[_0xdafc('0x25')](function(_0x340f8c){if(_0x340f8c){return _0x340f8c['addSquareProjects'](_0x56628c[_0xdafc('0x57')]['ids'],_[_0xdafc('0x5c')](_0x56628c['body'],[_0xdafc('0x5b'),'id'])||{});}})[_0xdafc('0x25')](respondWithResult(_0x493cba,null))[_0xdafc('0x4c')](handleError(_0x493cba,null));};exports[_0xdafc('0x15b')]=function(_0x4301e1,_0x1d243d){return db['User'][_0xdafc('0x2f')]({'where':{'id':_0x4301e1['params']['id']}})[_0xdafc('0x25')](handleEntityNotFound(_0x1d243d,null))['then'](function(_0xbcbc86){if(_0xbcbc86){return _0xbcbc86[_0xdafc('0x15b')](_0x4301e1['query']['ids']);}})[_0xdafc('0x25')](respondWithStatusCode(_0x1d243d,null))[_0xdafc('0x4c')](handleError(_0x1d243d,null));};exports[_0xdafc('0x15c')]=function(_0x3709df,_0x51ca67){var _0x437254={},_0x1e270b={},_0x525893={'count':0x0,'rows':[]};var _0x282ac2=db[_0xdafc('0x15d')][_0xdafc('0xc4')];_0x1e270b[_0xdafc('0x4e')]=_['keys'](_0x282ac2);_0x1e270b[_0xdafc('0x3d')]=_[_0xdafc('0x50')](_0x3709df[_0xdafc('0x3d')]);_0x1e270b[_0xdafc('0xc5')]=_['intersection'](_0x1e270b['model'],_0x1e270b['query']);_0x1e270b[_0xdafc('0xc5')]=_['concat'](_0x1e270b[_0xdafc('0xc5')],[_0xdafc('0x15e'),_0xdafc('0x15f'),'$gt',_0xdafc('0x160'),'$lt',_0xdafc('0x161'),_0xdafc('0x162'),_0xdafc('0x163'),_0xdafc('0x164'),_0xdafc('0x165'),_0xdafc('0x166'),_0xdafc('0x167'),_0xdafc('0x168'),_0xdafc('0x169'),_0xdafc('0x16a'),_0xdafc('0x16b'),_0xdafc('0x16c'),_0xdafc('0x169'),_0xdafc('0x16d'),_0xdafc('0x16e'),'$contained',_0xdafc('0x16f')]);_0x437254[_0xdafc('0x3f')]=_[_0xdafc('0x51')](_0x1e270b[_0xdafc('0x4e')],qs[_0xdafc('0x52')](_0x3709df[_0xdafc('0x3d')][_0xdafc('0x52')]));_0x437254[_0xdafc('0x3f')]=_0x437254[_0xdafc('0x3f')]['length']?_0x437254[_0xdafc('0x3f')]:_0x1e270b[_0xdafc('0x4e')];if(!_0x3709df['query'][_0xdafc('0xca')](_0xdafc('0xd4'))){_0x437254[_0xdafc('0x21')]=qs[_0xdafc('0x21')](_0x3709df[_0xdafc('0x3d')][_0xdafc('0x21')]);_0x437254[_0xdafc('0x23')]=qs[_0xdafc('0x23')](_0x3709df[_0xdafc('0x3d')]['offset']);}_0x437254[_0xdafc('0xc6')]=qs[_0xdafc('0xc7')](_0x3709df[_0xdafc('0x3d')]['sort']);_0x437254['where']=qs[_0xdafc('0xc5')](_[_0xdafc('0xc8')](_0x3709df[_0xdafc('0x3d')],_0x1e270b['filters']));if(_0x3709df[_0xdafc('0x3d')]['filter']){_0x437254[_0xdafc('0x3c')]=_['merge'](_0x437254['where'],{'$or':_['map'](_0x437254['attributes'],function(_0x1f01c0){var _0x559344={};_0x559344[_0x1f01c0]={'$like':'%'+_0x3709df[_0xdafc('0x3d')][_0xdafc('0xc9')]+'%'};return _0x559344;})});}_0x437254['where']={'$and':[_0x437254['where'],{'$or':[{'UserId':_0x3709df[_0xdafc('0x58')]['id']},{'OwnerId':_0x3709df[_0xdafc('0x58')]['id']}]}]};_0x437254=_[_0xdafc('0x53')]({},_0x437254,_0x3709df[_0xdafc('0x54')]);var _0x1aa9b9={'where':_0x437254[_0xdafc('0x3c')]};return db[_0xdafc('0x15d')][_0xdafc('0x22')](_0x1aa9b9)[_0xdafc('0x25')](function(_0x54d46f){_0x525893['count']=_0x54d46f;if(_0x3709df[_0xdafc('0x3d')]['includeAll']){_0x437254[_0xdafc('0xcb')]=[{'attributes':['id',_0xdafc('0x170'),_0xdafc('0x171'),_0xdafc('0x172')],'model':db['CmContact'],'as':'Contact'},{'attributes':['id',_0xdafc('0x30'),_0xdafc('0x173')],'model':db['VoiceQueue'],'as':_0xdafc('0xd2')}];}return db['CmHopper'][_0xdafc('0x87')](_0x437254);})[_0xdafc('0x25')](function(_0x57e6de){_0x525893['rows']=_0x57e6de;return _0x525893;})[_0xdafc('0x25')](respondWithFilteredResult(_0x51ca67,_0x437254))[_0xdafc('0x4c')](handleError(_0x51ca67,null));};exports[_0xdafc('0x174')]=function(_0x5682e5,_0x397aa7){if(!_[_0xdafc('0x63')](_0x5682e5[_0xdafc('0x2a')]['id'])&&(_0x5682e5[_0xdafc('0x2a')][_0xdafc('0x28')]==_0xdafc('0x29')||_0x5682e5[_0xdafc('0x2a')][_0xdafc('0x28')]=='user')){return db[_0xdafc('0x35')][_0xdafc('0xc3')]({'where':{'id':_0x5682e5['params']['id']},'raw':!![]})[_0xdafc('0x25')](function(_0xa89b7b){return authService[_0xdafc('0x175')](_0xa89b7b);})[_0xdafc('0x25')](function(_0x922c6d){if(_0x922c6d){return _0x397aa7['status'](0xc8)[_0xdafc('0x1f')]({'api_key':_0x922c6d[_0xdafc('0x176')]});}else{return _0x397aa7['status'](0xcc)[_0xdafc('0x1f')]({'message':_0xdafc('0x177')});}})[_0xdafc('0x4c')](handleError(_0x397aa7,0x193));}else{return _0x397aa7['status'](0x191)['json']({'message':_0xdafc('0x178')});}};exports[_0xdafc('0x179')]=function(_0xf37957,_0x4bb5f1){if(!_[_0xdafc('0x63')](_0xf37957[_0xdafc('0x2a')]['id'])&&(_0xf37957[_0xdafc('0x2a')][_0xdafc('0x28')]==_0xdafc('0x29')||_0xf37957[_0xdafc('0x2a')][_0xdafc('0x28')]==_0xdafc('0x2a'))){return db[_0xdafc('0x35')][_0xdafc('0x2f')]({'where':{'id':_0xf37957[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](function(_0x3193d5){return authService[_0xdafc('0x17a')](_0x3193d5);})['then'](function(_0x36160){return db[_0xdafc('0x35')][_0xdafc('0x56')]({'apiKeyIat':_0x36160['iat'],'apiKeyNonce':_0x36160[_0xdafc('0x17b')]},{'where':{'id':_0xf37957[_0xdafc('0x58')]['id']}})[_0xdafc('0x25')](function(){return _0x4bb5f1[_0xdafc('0x1e')](0xc8)[_0xdafc('0x1f')]({'api_key':_0x36160[_0xdafc('0x176')]});});})[_0xdafc('0x4c')](handleError(_0x4bb5f1,0x193));}else{return _0x4bb5f1['status'](0x191)[_0xdafc('0x1f')]({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports['removeApiKey']=function(_0x5b984a,_0x5281d5){if(!_[_0xdafc('0x63')](_0x5b984a[_0xdafc('0x2a')]['id'])&&(_0x5b984a[_0xdafc('0x2a')][_0xdafc('0x28')]=='admin'||_0x5b984a[_0xdafc('0x2a')][_0xdafc('0x28')]==_0xdafc('0x2a'))){return db['User'][_0xdafc('0x2f')]({'where':{'id':_0x5b984a[_0xdafc('0x58')]['id']}})['then'](handleEntityNotFound(_0x5281d5,null))['then'](function(_0x3d86c6){if(_0x3d86c6&&_0x3d86c6[_0xdafc('0x17c')]&&_0x3d86c6[_0xdafc('0x17d')])return _0x3d86c6;else throw{'message':_0xdafc('0x17e')};})['then'](function(_0x3393bd){return db[_0xdafc('0x35')][_0xdafc('0x56')]({'apiKeyNonce':null,'apiKeyIat':null},{'where':{'id':_0x5b984a[_0xdafc('0x58')]['id']}});})[_0xdafc('0x25')](respondWithStatusCode(_0x5281d5,0xc8))['catch'](handleError(_0x5281d5,0x193));}else{return _0x5281d5[_0xdafc('0x1e')](0x191)['json']({'message':'You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.'});}};exports['whoami']=function(_0x1f8adc,_0x213b14){var _0x1886e6=_0x1f8adc[_0xdafc('0x2a')][_0xdafc('0x27')]({'plain':!![]});if(!_0x1886e6){return _0x213b14[_0xdafc('0x1e')](0x191)['send']('Unable\x20to\x20retrieve\x20the\x20current\x20user');}else{return _0x213b14[_0xdafc('0x1e')](0xc8)[_0xdafc('0x1f')](_0x1886e6);}};exports['getPresence']=function(_0x39a636,_0x485508){var _0x2d3fde={'offset':0x0},_0x1e76e6={'count':0x0,'rows':[]};Promise['resolve']()[_0xdafc('0x25')](function(){if(!_0x39a636[_0xdafc('0x3d')][_0xdafc('0xc9')]&&!_0x39a636[_0xdafc('0x3d')][_0xdafc('0x17f')]&&!_0x39a636[_0xdafc('0x3d')][_0xdafc('0x180')])return[];return Promise['resolve']()[_0xdafc('0x25')](function(){var _0x17bef1=[];if(!_[_0xdafc('0x181')](_0x39a636[_0xdafc('0x3d')][_0xdafc('0x17f')])){_0x17bef1[_0xdafc('0x40')](db[_0xdafc('0x10f')][_0xdafc('0x87')]({'attributes':['id',_0xdafc('0x30')],'where':{'id':_0x39a636[_0xdafc('0x3d')]['teams']}}));}if(!_['isEmpty'](_0x39a636[_0xdafc('0x3d')][_0xdafc('0x180')])){_0x17bef1['push'](db[_0xdafc('0xa2')][_0xdafc('0x87')]({'attributes':['id',_0xdafc('0x30')],'type':_0xdafc('0x182'),'where':{'id':_0x39a636[_0xdafc('0x3d')][_0xdafc('0x180')]}}));}return Promise['all'](_0x17bef1);})[_0xdafc('0x25')](function(_0x2b0906){var _0x517d9a=_['flatten'](_0x2b0906)[_0xdafc('0x2d')](function(_0x554ab4){return _0x554ab4[_0xdafc('0x128')]({'attributes':['id','name',_0xdafc('0x61'),_0xdafc('0xa3')],'raw':!![]});});return Promise['all'](_0x517d9a);})[_0xdafc('0x25')](function(_0x4f8398){var _0x5dbd7d=_['flatten'](_0x4f8398);if(!_0x39a636[_0xdafc('0x3d')]['filter'])return _0x5dbd7d;if(_[_0xdafc('0x181')](_0x5dbd7d)){return db[_0xdafc('0x35')][_0xdafc('0x87')]({'attributes':['id',_0xdafc('0x30'),_0xdafc('0x61'),_0xdafc('0xa3')],'where':{'role':_0xdafc('0x6a'),'$or':[db['sequelize']['where'](db[_0xdafc('0x64')]['fn'](_0xdafc('0x183'),db[_0xdafc('0x64')][_0xdafc('0x184')](_0xdafc('0x30'))),{'$like':'%'+_0x39a636[_0xdafc('0x3d')][_0xdafc('0xc9')][_0xdafc('0x9b')]()+'%'}),{'internal':{'$like':'%'+_0x39a636[_0xdafc('0x3d')]['filter']+'%'}}]},'raw':!![]});}else{return _(_0x5dbd7d)[_0xdafc('0x11d')]()['filter'](function(_0x13cb8f){return _0x13cb8f['name'][_0xdafc('0x9b')]()[_0xdafc('0x39')](_0x39a636[_0xdafc('0x3d')][_0xdafc('0xc9')][_0xdafc('0x9b')]())||_0x13cb8f[_0xdafc('0x61')]['toString']()[_0xdafc('0x39')](_0x39a636[_0xdafc('0x3d')][_0xdafc('0xc9')]);})[_0xdafc('0x2e')]();}})[_0xdafc('0x25')](function(_0x3fcc33){var _0x7cdaf6='name';var _0x585a3f=_0xdafc('0x185');if(_0x39a636[_0xdafc('0x3d')][_0xdafc('0xc7')]){var _0x585a3f=_0x39a636[_0xdafc('0x3d')]['sort'][0x0]==='-'?_0xdafc('0x186'):'asc';var _0x7cdaf6=_0x585a3f===_0xdafc('0x185')?_0x39a636[_0xdafc('0x3d')]['sort']:_0x39a636['query']['sort'][_0xdafc('0x187')](0x1);}return _(_0x3fcc33)[_0xdafc('0x188')]('id')['orderBy']([function(_0x1813d7){return _0x7cdaf6===_0xdafc('0x30')?_0x1813d7[_0x7cdaf6]['toLowerCase']():_0x1813d7[_0x7cdaf6];}],[_0x585a3f])[_0xdafc('0x2d')](function(_0x1552a7){return _['pick'](_0x1552a7,['id',_0xdafc('0x30'),'internal',_0xdafc('0xa3')]);})[_0xdafc('0x2e')]();})['then'](function(_0x2c8db7){return client[_0xdafc('0x15')](_0xdafc('0x2b'),_0x39a636)[_0xdafc('0x25')](function(_0x23ae02){if(_0x23ae02[_0xdafc('0x1a')])throw new Error(_0xdafc('0x189'));var _0x1a9e00=_0x23ae02[_0xdafc('0x1d')];var _0x2b206a=jayson[_0xdafc('0x13')][_0xdafc('0x14')]({'port':0x232c});return _0x2b206a[_0xdafc('0x15')](_0xdafc('0x2b'),_0x39a636)['then'](function(_0x2f1600){if(_0x2f1600[_0xdafc('0x1a')])throw new Error(_0xdafc('0x18a'));var _0x5e536e=_0x2f1600[_0xdafc('0x1d')];return _[_0xdafc('0x53')]({},_0x5e536e,_0x1a9e00);});})['then'](function(_0x38610e){return _[_0xdafc('0x2d')](_0x2c8db7,function(_0x13707c){var _0x2062e8=_[_0xdafc('0x2f')](_0x38610e['rows'],['id',_0x13707c['id']]);if(!_0x2062e8||!_0x13707c['online']){_0x13707c[_0xdafc('0x1e')]=_0xdafc('0x18b');}else if(_0x2062e8[_0xdafc('0xa6')]){_0x13707c[_0xdafc('0x1e')]=_0xdafc('0xfe');}else{_0x13707c[_0xdafc('0x1e')]=_['includes']([_0xdafc('0x18c'),_0xdafc('0x18d'),_0xdafc('0x18e'),'ringing',null,undefined],_0x2062e8[_0xdafc('0x18f')])?'online':_0xdafc('0x190');}return _0x13707c;});});});})[_0xdafc('0x25')](function(_0x5dfa99){if(!_0x39a636[_0xdafc('0x3d')][_0xdafc('0xca')](_0xdafc('0xd4'))){_0x2d3fde['limit']=qs[_0xdafc('0x21')](_0x39a636[_0xdafc('0x3d')][_0xdafc('0x21')]||0xa);_0x2d3fde['offset']=qs[_0xdafc('0x23')](_0x39a636[_0xdafc('0x3d')]['offset']);}_0x1e76e6[_0xdafc('0x22')]=_0x5dfa99[_0xdafc('0x44')];_0x1e76e6[_0xdafc('0x41')]=_0x2d3fde[_0xdafc('0x21')]?_0x5dfa99[_0xdafc('0x191')](_0x2d3fde[_0xdafc('0x23')],_0x2d3fde[_0xdafc('0x23')]+_0x2d3fde[_0xdafc('0x21')]):_0x5dfa99;return _0x1e76e6;})[_0xdafc('0x25')](respondWithFilteredResult(_0x485508,_0x2d3fde))[_0xdafc('0x4c')](handleError(_0x485508,null));};function get_open_tabs(_0x2e6694,_0x5e5483){var _0x2085ed=_0x2e6694[_0xdafc('0x192')](0x0)['toUpperCase']()+_0x2e6694['slice'](0x1);var _0x32b101={'type':db[_0xdafc('0x8d')][_0xdafc('0x193')][_0xdafc('0x194')],'raw':!![]};return new BPromise(function(_0x220e43,_0x54e444){var _0x4380e9=squel[_0xdafc('0x195')]()[_0xdafc('0x196')](_0xdafc('0x197')+_0x2085ed+_0xdafc('0x198'),'id')[_0xdafc('0x196')](_0xdafc('0x199'))[_0xdafc('0x66')](_0xdafc('0x19a')+_0x2e6694+_0xdafc('0x19b'),'ui')[_0xdafc('0x3c')]('ui.UserId\x20=\x20?',_0x5e5483['id']);return db[_0xdafc('0x64')][_0xdafc('0x3d')](_0x4380e9[_0xdafc('0x19c')](),_0x32b101)[_0xdafc('0x25')](function(_0x4f6dba){_0x5e5483[_0x2085ed+_0xdafc('0x19d')]=_0x4f6dba;_0x220e43(_0x4f6dba);})[_0xdafc('0x4c')](function(_0x3bbc6f){_0x54e444(_0x3bbc6f);});});};
\ No newline at end of file
index ccdcf6e..7b5fd18 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1997=['User','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x454018,_0x46e33a){var _0x24697d=function(_0x3ec647){while(--_0x3ec647){_0x454018['push'](_0x454018['shift']());}};_0x24697d(++_0x46e33a);}(_0x1997,0x6a));var _0x7199=function(_0x4e851e,_0x165887){_0x4e851e=_0x4e851e-0x0;var _0x191db2=_0x1997[_0x4e851e];return _0x191db2;};'use strict';var EventEmitter=require(_0x7199('0x0'));var User=require(_0x7199('0x1'))['db'][_0x7199('0x2')];var UserEvents=new EventEmitter();UserEvents[_0x7199('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7199('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3540b7){return function(_0x49b42c,_0x1cb3cd,_0x3ff559){UserEvents[_0x7199('0x5')](_0x3540b7+':'+_0x49b42c['id'],_0x49b42c);UserEvents[_0x7199('0x5')](_0x3540b7,_0x49b42c);_0x3ff559(null);};}for(var e in events){if(events[_0x7199('0x6')](e)){var event=events[e];User[_0x7199('0x7')](e,emitEvent(event));}}module[_0x7199('0x8')]=UserEvents;
\ No newline at end of file
+var _0x5809=['exports','events','../../mysqldb','User','setMaxListeners','save','remove','emit','hook'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x5809,0x1cc));var _0x9580=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5809[_0x40a045];return _0x1a687c;};'use strict';var EventEmitter=require(_0x9580('0x0'));var User=require(_0x9580('0x1'))['db'][_0x9580('0x2')];var UserEvents=new EventEmitter();UserEvents[_0x9580('0x3')](0x0);var events={'afterCreate':_0x9580('0x4'),'afterUpdate':'update','afterDestroy':_0x9580('0x5')};function emitEvent(_0x4dc82d){return function(_0x441dd3,_0x43f727,_0xa1f2c0){UserEvents['emit'](_0x4dc82d+':'+_0x441dd3['id'],_0x441dd3);UserEvents[_0x9580('0x6')](_0x4dc82d,_0x441dd3);_0xa1f2c0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];User[_0x9580('0x7')](e,emitEvent(event));}}module[_0x9580('0x8')]=UserEvents;
\ No newline at end of file
index ec55cb1..84faff5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd59d=['users','utf8','utf8_bin','resolve','UserProfile','find','userProfileId','then','privacyEnabled','updateMd5Password','updatePassword','password','VoiceExtension','bulkCreate','changed','destroy','encryptPassword','function','Missing\x20Callback','randomBytes','base64','salt','pbkdf2Sync','sha1','toString','pbkdf2','provider','Invalid\x20password','makeSalt','md5secret','bluebird','crypto','util','md5','lodash','./user.attributes','google','length','system','format','%s%s','prefix','push','merge','CDR(type)=%s','chanspy','record','MixMonitor','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','wav','gsm','context','from-sip','Set','extensionMonitor','includes','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','Dial','SIP/%s,,tTxXU(xcally-mixmonitor-context)','SIP/%s,,tTxX','Hangup','priority','VoiceChanSpy','internal','concat','catch','exports','define'];(function(_0x58b332,_0x54787d){var _0xb8e97e=function(_0x418171){while(--_0x418171){_0x58b332['push'](_0x58b332['shift']());}};_0xb8e97e(++_0x54787d);}(_0xd59d,0x6a));var _0xdd59=function(_0x158f01,_0x12af3e){_0x158f01=_0x158f01-0x0;var _0x5ef74e=_0xd59d[_0x158f01];return _0x5ef74e;};'use strict';var BPromise=require(_0xdd59('0x0'));var crypto=require(_0xdd59('0x1'));var util=require(_0xdd59('0x2'));var md5=require(_0xdd59('0x3'));var _=require(_0xdd59('0x4'));var attributes=require(_0xdd59('0x5'));var authTypes=[_0xdd59('0x6')];var validatePresenceOf=function(_0x32ba57){return _0x32ba57&&_0x32ba57[_0xdd59('0x7')];};var getChanSpyApplications=function(_0x1beaa0,_0x5b884d,_0x17e6e5){var _0xf99be8={'context':_0x1beaa0['context']||'from-sip','type':_0xdd59('0x8'),'isApp':![],'UserId':_0x1beaa0['id']};var _0x1114b0=[];for(var _0x10b1f2=0x0,_0x1fb664=0x1;_0x10b1f2<_0x17e6e5['length'];_0x10b1f2++,_0x1fb664=0x1){var _0x1a276a={'exten':util[_0xdd59('0x9')](_0xdd59('0xa'),_0x17e6e5[_0x10b1f2][_0xdd59('0xb')],_0x5b884d),'ChanSpyId':_0x17e6e5[_0x10b1f2]['id']};_0x1114b0[_0xdd59('0xc')](_[_0xdd59('0xd')]({'app':'Set','appdata':util['format'](_0xdd59('0xe'),_0xdd59('0xf')),'priority':_0x1fb664++},_0xf99be8,_0x1a276a));if(_0x17e6e5[_0x10b1f2][_0xdd59('0x10')]){_0x1114b0[_0xdd59('0xc')](_[_0xdd59('0xd')]({'app':_0xdd59('0x11'),'appdata':util[_0xdd59('0x9')]('${UNIQUEID}.%s,a',_0x17e6e5[_0x10b1f2][_0xdd59('0x12')]),'priority':_0x1fb664++},_0xf99be8,_0x1a276a));}if(_0x17e6e5[_0x10b1f2][_0xdd59('0x13')]){_0x1114b0[_0xdd59('0xc')](_[_0xdd59('0xd')]({'app':_0xdd59('0x14'),'appdata':_0x17e6e5[_0x10b1f2]['password'],'priority':_0x1fb664++},_0xf99be8,_0x1a276a));}_0x1114b0[_0xdd59('0xc')](_[_0xdd59('0xd')]({'app':_0xdd59('0x15'),'appdata':util[_0xdd59('0x9')](_0xdd59('0x16'),_0x1beaa0[_0xdd59('0x17')],_0x17e6e5[_0x10b1f2][_0xdd59('0x18')]?_0x17e6e5[_0x10b1f2][_0xdd59('0x18')][_0xdd59('0x19')](''):''),'priority':_0x1fb664++},_0xf99be8,_0x1a276a));if(_0x17e6e5[_0x10b1f2][_0xdd59('0x10')]){_0x1114b0[_0xdd59('0xc')](_[_0xdd59('0xd')]({'app':_0xdd59('0x1a'),'priority':_0x1fb664++},_0xf99be8,_0x1a276a));}}return _0x1114b0;};var getUserApplications=function(_0x58bfa7,_0x1556ac){var _0x158214=[_0xdd59('0x1b'),'WAV',_0xdd59('0x1c')];var _0x439dfd={'context':_0x58bfa7[_0xdd59('0x1d')]||_0xdd59('0x1e'),'exten':_0x1556ac,'type':_0xdd59('0x8'),'isApp':![],'UserId':_0x58bfa7['id']};var _0xbaf665=[{'app':_0xdd59('0x1f'),'appdata':'CDR(type)=internal'}];if(_0x58bfa7[_0xdd59('0x20')]&&_[_0xdd59('0x21')](_0x158214,_0x58bfa7[_0xdd59('0x20')])){_0xbaf665[_0xdd59('0xc')]({'app':'Set','appdata':_0xdd59('0x22')});_0xbaf665[_0xdd59('0xc')]({'app':'Set','appdata':util[_0xdd59('0x9')]('_XCALLY_MIXMONITOR_FORMAT=%s',_0x58bfa7[_0xdd59('0x20')])});_0xbaf665[_0xdd59('0xc')]({'app':_0xdd59('0x23'),'appdata':util[_0xdd59('0x9')](_0xdd59('0x24'),_0x58bfa7[_0xdd59('0x17')])});}else{_0xbaf665[_0xdd59('0xc')]({'app':_0xdd59('0x23'),'appdata':util[_0xdd59('0x9')](_0xdd59('0x25'),_0x58bfa7['name'])});}_0xbaf665[_0xdd59('0xc')]({'app':_0xdd59('0x26')});for(var _0x1fb9a1=0x0;_0x1fb9a1<_0xbaf665['length'];_0x1fb9a1++){_0xbaf665[_0x1fb9a1][_0xdd59('0x27')]=_0x1fb9a1+0x1;_0xbaf665[_0x1fb9a1]=_['defaults'](_0xbaf665[_0x1fb9a1],_0x439dfd);}return _0xbaf665;};var getChanSpyPromise=function(_0xb50503,_0x499881){return new BPromise(function(_0x29b33d,_0x44b621){return _0xb50503[_0xdd59('0x28')]['findAll']()['then'](function(_0x404c29){if(_0x404c29){var _0x28677e=getChanSpyApplications(_0x499881,_0x499881[_0xdd59('0x29')],_0x404c29);if(_0x499881[_0xdd59('0x29')]!=_0x499881[_0xdd59('0x17')]){_0x28677e=_0x28677e[_0xdd59('0x2a')](getChanSpyApplications(_0x499881,_0x499881[_0xdd59('0x17')],_0x404c29));}return _0x29b33d(_0x28677e);}return _0x29b33d([]);})[_0xdd59('0x2b')](function(_0x340d27){_0x44b621(_0x340d27);});});};module[_0xdd59('0x2c')]=function(_0x57be49,_0xb97b0f){var _0x11bbd4=_0x57be49['models'];return _0x57be49[_0xdd59('0x2d')]('User',attributes,{'tableName':_0xdd59('0x2e'),'charset':_0xdd59('0x2f'),'collate':_0xdd59('0x30'),'hooks':{'beforeCreate':function(_0x4c35da,_0x108f4e,_0x46525c){var _0x5e4680=typeof _0x4c35da['userProfileId']==='undefined'?BPromise[_0xdd59('0x31')](null):_0x11bbd4[_0xdd59('0x32')][_0xdd59('0x33')]({'where':{'id':_0x4c35da[_0xdd59('0x34')]}});_0x5e4680[_0xdd59('0x35')](function(_0x415bdb){if(_0x415bdb){_0x4c35da[_0xdd59('0x36')]=_0x415bdb[_0xdd59('0x36')];}})[_0xdd59('0x35')](function(){_0x4c35da[_0xdd59('0x37')]();_0x4c35da[_0xdd59('0x38')](_0x46525c);})['catch'](function(_0x11d512){_0x46525c(_0x11d512);});},'beforeUpdate':function(_0x531102,_0x3f4d7d,_0x3eb3bb){Promise[_0xdd59('0x31')]()[_0xdd59('0x35')](function(){if(_0x531102['changed'](_0xdd59('0x34'))===![])return;return _0x11bbd4[_0xdd59('0x32')][_0xdd59('0x33')]({'where':{'id':_0x531102[_0xdd59('0x34')]}})[_0xdd59('0x35')](function(_0x27599f){if(_0x27599f)_0x531102[_0xdd59('0x36')]=_0x27599f[_0xdd59('0x36')];return;});})[_0xdd59('0x35')](function(){if(_0x531102['changed'](_0xdd59('0x39'))){_0x531102[_0xdd59('0x37')]();return _0x531102[_0xdd59('0x38')](_0x3eb3bb);}_0x3eb3bb();})[_0xdd59('0x2b')](function(_0x4681fc){_0x3eb3bb(_0x4681fc);});},'afterCreate':function(_0x3954f0,_0x444ed6,_0xc361f1){var _0x2865eb=getUserApplications(_0x3954f0,_0x3954f0[_0xdd59('0x29')]);if(_0x3954f0['internal']!=_0x3954f0[_0xdd59('0x17')]){_0x2865eb=_0x2865eb['concat'](getUserApplications(_0x3954f0,_0x3954f0['name']));}return _0x11bbd4[_0xdd59('0x3a')][_0xdd59('0x3b')](_0x2865eb)[_0xdd59('0x35')](function(){if(_0x3954f0[_0xdd59('0xf')]){return getChanSpyPromise(_0x11bbd4,_0x3954f0);}})['then'](function(_0x334480){if(_0x334480&&_0x334480['length']){return _0x11bbd4[_0xdd59('0x3a')][_0xdd59('0x3b')](_0x334480);}})[_0xdd59('0x35')](function(){_0xc361f1();})['catch'](function(_0x5c0590){_0xc361f1(_0x5c0590);});},'afterUpdate':function(_0x218a45,_0x4b3a32,_0x108f69){return BPromise['resolve']()[_0xdd59('0x35')](function(){if(_0x218a45[_0xdd59('0x3c')]('chanspy')||_0x218a45['changed'](_0xdd59('0x1d'))){return _0x11bbd4['VoiceExtension']['destroy']({'where':{'UserId':_0x218a45['id'],'type':_0xdd59('0x8'),'ChanSpyId':{'$ne':null}}})[_0xdd59('0x35')](function(){if(_0x218a45[_0xdd59('0xf')]){return getChanSpyPromise(_0x11bbd4,_0x218a45)['then'](function(_0x271268){if(_0x271268&&_0x271268[_0xdd59('0x7')]){return _0x11bbd4['VoiceExtension'][_0xdd59('0x3b')](_0x271268);}});}});}})['then'](function(){if(_0x218a45[_0xdd59('0x3c')]('extensionMonitor')||_0x218a45[_0xdd59('0x3c')](_0xdd59('0x1d'))){return _0x11bbd4[_0xdd59('0x3a')]['destroy']({'where':{'UserId':_0x218a45['id'],'type':_0xdd59('0x8'),'ChanSpyId':null}})['then'](function(){var _0x5e6dbd=getUserApplications(_0x218a45,_0x218a45[_0xdd59('0x29')]);if(_0x218a45[_0xdd59('0x29')]!=_0x218a45['name']){_0x5e6dbd=_0x5e6dbd['concat'](getUserApplications(_0x218a45,_0x218a45[_0xdd59('0x17')]));}return _0x11bbd4[_0xdd59('0x3a')]['bulkCreate'](_0x5e6dbd);});}})[_0xdd59('0x35')](function(){_0x108f69();})[_0xdd59('0x2b')](function(_0x22fc55){_0x108f69(_0x22fc55);});},'afterDestroy':function(_0x6b00,_0x400f0a){return _0x11bbd4['VoiceExtension'][_0xdd59('0x3d')]({'where':{'UserId':_0x6b00['id'],'type':_0xdd59('0x8')}});}},'instanceMethods':{'authenticate':function(_0x5b8989,_0x570fbf){if(!_0x570fbf){return this[_0xdd59('0x39')]===this['encryptPassword'](_0x5b8989);}var _0x5dbad1=this;this[_0xdd59('0x3e')](_0x5b8989,function(_0x5cee8a,_0x558729){if(_0x5cee8a){_0x570fbf(_0x5cee8a);}if(_0x5dbad1[_0xdd59('0x39')]===_0x558729){_0x570fbf(null,!![]);}else{_0x570fbf(null,![]);}});},'makeSalt':function(_0x42b58a,_0x33ed8e){var _0x4b2ec4=0x10;if(typeof arguments[0x0]===_0xdd59('0x3f')){_0x33ed8e=arguments[0x0];_0x42b58a=_0x4b2ec4;}else if(typeof arguments[0x1]===_0xdd59('0x3f')){_0x33ed8e=arguments[0x1];}else{throw new Error(_0xdd59('0x40'));}if(!_0x42b58a){_0x42b58a=_0x4b2ec4;}return crypto[_0xdd59('0x41')](_0x42b58a,function(_0x41d9f3,_0x3a1dd4){if(_0x41d9f3){_0x33ed8e(_0x41d9f3);}return _0x33ed8e(null,_0x3a1dd4['toString'](_0xdd59('0x42')));});},'encryptPassword':function(_0x65d82,_0xaa65a1){if(!_0x65d82||!this['salt']){return _0xaa65a1?_0xaa65a1(null):null;}var _0x3537b2=0x2710;var _0x1b4147=0x40;var _0x2d78c8=new Buffer(this[_0xdd59('0x43')],_0xdd59('0x42'));if(!_0xaa65a1){return crypto[_0xdd59('0x44')](_0x65d82,_0x2d78c8,_0x3537b2,_0x1b4147,_0xdd59('0x45'))[_0xdd59('0x46')](_0xdd59('0x42'));}return crypto[_0xdd59('0x47')](_0x65d82,_0x2d78c8,_0x3537b2,_0x1b4147,_0xdd59('0x45'),function(_0x3296c1,_0x8e6f55){if(_0x3296c1){_0xaa65a1(_0x3296c1);}return _0xaa65a1(null,_0x8e6f55[_0xdd59('0x46')](_0xdd59('0x42')));});},'updatePassword':function(_0x3d8f9a){if(!this[_0xdd59('0x39')]){return _0x3d8f9a(null);}if(!validatePresenceOf(this[_0xdd59('0x39')])&&authTypes['indexOf'](this[_0xdd59('0x48')])===-0x1){_0x3d8f9a(new Error(_0xdd59('0x49')));}var _0x2dff2b=this;this[_0xdd59('0x4a')](function(_0x46b18e,_0x32285f){if(_0x46b18e){return _0x3d8f9a(_0x46b18e);}_0x2dff2b[_0xdd59('0x43')]=_0x32285f;_0x2dff2b[_0xdd59('0x3e')](_0x2dff2b[_0xdd59('0x39')],function(_0x574a9c,_0x4de36e){if(_0x574a9c){_0x3d8f9a(_0x574a9c);}_0x2dff2b[_0xdd59('0x39')]=_0x4de36e;_0x3d8f9a(null);});});},'updateMd5Password':function(){this['md5secret']=md5(this[_0xdd59('0x17')]+':asterisk:'+this[_0xdd59('0x39')]);return this[_0xdd59('0x4b')];}}});};
\ No newline at end of file
+var _0xfcfc=['then','internal','catch','exports','models','define','User','users','utf8_bin','userProfileId','resolve','find','privacyEnabled','updateMd5Password','updatePassword','changed','UserProfile','password','concat','VoiceExtension','bulkCreate','destroy','chanspy','encryptPassword','function','randomBytes','toString','base64','salt','sha1','pbkdf2','indexOf','Invalid\x20password','md5secret','bluebird','crypto','util','lodash','google','context','from-sip','system','format','%s%s','prefix','merge','Set','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','push','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','record','StopMixMonitor','wav','WAV','CDR(type)=internal','extensionMonitor','includes','_XCALLY_MIXMONITOR_FORMAT=%s','Dial','SIP/%s,,tTxX','Hangup','length','priority','VoiceChanSpy','findAll'];(function(_0x346e6b,_0x1f4479){var _0x15f973=function(_0x576d2e){while(--_0x576d2e){_0x346e6b['push'](_0x346e6b['shift']());}};_0x15f973(++_0x1f4479);}(_0xfcfc,0x6b));var _0xcfcf=function(_0x399e50,_0x1ffcfb){_0x399e50=_0x399e50-0x0;var _0x2d4c61=_0xfcfc[_0x399e50];return _0x2d4c61;};'use strict';var BPromise=require(_0xcfcf('0x0'));var crypto=require(_0xcfcf('0x1'));var util=require(_0xcfcf('0x2'));var md5=require('md5');var _=require(_0xcfcf('0x3'));var attributes=require('./user.attributes');var authTypes=[_0xcfcf('0x4')];var validatePresenceOf=function(_0x5e8d05){return _0x5e8d05&&_0x5e8d05['length'];};var getChanSpyApplications=function(_0x44d68b,_0x592365,_0x27e153){var _0x50cf63={'context':_0x44d68b[_0xcfcf('0x5')]||_0xcfcf('0x6'),'type':_0xcfcf('0x7'),'isApp':![],'UserId':_0x44d68b['id']};var _0x2b0b95=[];for(var _0x74cece=0x0,_0x223b1e=0x1;_0x74cece<_0x27e153['length'];_0x74cece++,_0x223b1e=0x1){var _0x113e2a={'exten':util[_0xcfcf('0x8')](_0xcfcf('0x9'),_0x27e153[_0x74cece][_0xcfcf('0xa')],_0x592365),'ChanSpyId':_0x27e153[_0x74cece]['id']};_0x2b0b95['push'](_[_0xcfcf('0xb')]({'app':_0xcfcf('0xc'),'appdata':util[_0xcfcf('0x8')]('CDR(type)=%s','chanspy'),'priority':_0x223b1e++},_0x50cf63,_0x113e2a));if(_0x27e153[_0x74cece]['record']){_0x2b0b95['push'](_[_0xcfcf('0xb')]({'app':_0xcfcf('0xd'),'appdata':util[_0xcfcf('0x8')](_0xcfcf('0xe'),_0x27e153[_0x74cece][_0xcfcf('0xf')]),'priority':_0x223b1e++},_0x50cf63,_0x113e2a));}if(_0x27e153[_0x74cece][_0xcfcf('0x10')]){_0x2b0b95[_0xcfcf('0x11')](_[_0xcfcf('0xb')]({'app':_0xcfcf('0x12'),'appdata':_0x27e153[_0x74cece]['password'],'priority':_0x223b1e++},_0x50cf63,_0x113e2a));}_0x2b0b95[_0xcfcf('0x11')](_[_0xcfcf('0xb')]({'app':_0xcfcf('0x13'),'appdata':util[_0xcfcf('0x8')](_0xcfcf('0x14'),_0x44d68b[_0xcfcf('0x15')],_0x27e153[_0x74cece][_0xcfcf('0x16')]?_0x27e153[_0x74cece][_0xcfcf('0x16')][_0xcfcf('0x17')](''):''),'priority':_0x223b1e++},_0x50cf63,_0x113e2a));if(_0x27e153[_0x74cece][_0xcfcf('0x18')]){_0x2b0b95[_0xcfcf('0x11')](_[_0xcfcf('0xb')]({'app':_0xcfcf('0x19'),'priority':_0x223b1e++},_0x50cf63,_0x113e2a));}}return _0x2b0b95;};var getUserApplications=function(_0xd09ba0,_0x249673){var _0x1cfc50=[_0xcfcf('0x1a'),_0xcfcf('0x1b'),'gsm'];var _0x989955={'context':_0xd09ba0['context']||_0xcfcf('0x6'),'exten':_0x249673,'type':'system','isApp':![],'UserId':_0xd09ba0['id']};var _0x1eda50=[{'app':_0xcfcf('0xc'),'appdata':_0xcfcf('0x1c')}];if(_0xd09ba0[_0xcfcf('0x1d')]&&_[_0xcfcf('0x1e')](_0x1cfc50,_0xd09ba0['extensionMonitor'])){_0x1eda50[_0xcfcf('0x11')]({'app':_0xcfcf('0xc'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}'});_0x1eda50[_0xcfcf('0x11')]({'app':_0xcfcf('0xc'),'appdata':util['format'](_0xcfcf('0x1f'),_0xd09ba0[_0xcfcf('0x1d')])});_0x1eda50[_0xcfcf('0x11')]({'app':_0xcfcf('0x20'),'appdata':util[_0xcfcf('0x8')]('SIP/%s,,tTxXU(xcally-mixmonitor-context)',_0xd09ba0[_0xcfcf('0x15')])});}else{_0x1eda50['push']({'app':_0xcfcf('0x20'),'appdata':util[_0xcfcf('0x8')](_0xcfcf('0x21'),_0xd09ba0[_0xcfcf('0x15')])});}_0x1eda50[_0xcfcf('0x11')]({'app':_0xcfcf('0x22')});for(var _0x326533=0x0;_0x326533<_0x1eda50[_0xcfcf('0x23')];_0x326533++){_0x1eda50[_0x326533][_0xcfcf('0x24')]=_0x326533+0x1;_0x1eda50[_0x326533]=_['defaults'](_0x1eda50[_0x326533],_0x989955);}return _0x1eda50;};var getChanSpyPromise=function(_0x12e7f7,_0xb24a06){return new BPromise(function(_0x24014f,_0x104cc6){return _0x12e7f7[_0xcfcf('0x25')][_0xcfcf('0x26')]()[_0xcfcf('0x27')](function(_0x1f8e4a){if(_0x1f8e4a){var _0x1e4c18=getChanSpyApplications(_0xb24a06,_0xb24a06[_0xcfcf('0x28')],_0x1f8e4a);if(_0xb24a06['internal']!=_0xb24a06['name']){_0x1e4c18=_0x1e4c18['concat'](getChanSpyApplications(_0xb24a06,_0xb24a06['name'],_0x1f8e4a));}return _0x24014f(_0x1e4c18);}return _0x24014f([]);})[_0xcfcf('0x29')](function(_0x471d20){_0x104cc6(_0x471d20);});});};module[_0xcfcf('0x2a')]=function(_0x4d8170,_0x5e55d5){var _0x5d3c21=_0x4d8170[_0xcfcf('0x2b')];return _0x4d8170[_0xcfcf('0x2c')](_0xcfcf('0x2d'),attributes,{'tableName':_0xcfcf('0x2e'),'charset':'utf8','collate':_0xcfcf('0x2f'),'hooks':{'beforeCreate':function(_0x12f15b,_0x6bae4e,_0x9a02ba){var _0x427555=typeof _0x12f15b[_0xcfcf('0x30')]==='undefined'?BPromise[_0xcfcf('0x31')](null):_0x5d3c21['UserProfile'][_0xcfcf('0x32')]({'where':{'id':_0x12f15b[_0xcfcf('0x30')]}});_0x427555['then'](function(_0x3dc09f){if(_0x3dc09f){_0x12f15b[_0xcfcf('0x33')]=_0x3dc09f[_0xcfcf('0x33')];}})['then'](function(){_0x12f15b[_0xcfcf('0x34')]();_0x12f15b[_0xcfcf('0x35')](_0x9a02ba);})[_0xcfcf('0x29')](function(_0x2afca6){_0x9a02ba(_0x2afca6);});},'beforeUpdate':function(_0x2adb60,_0x33d3cb,_0x281f0b){Promise[_0xcfcf('0x31')]()[_0xcfcf('0x27')](function(){if(_0x2adb60[_0xcfcf('0x36')]('userProfileId')===![])return;return _0x5d3c21[_0xcfcf('0x37')]['find']({'where':{'id':_0x2adb60[_0xcfcf('0x30')]}})[_0xcfcf('0x27')](function(_0x2ab3a8){if(_0x2ab3a8)_0x2adb60[_0xcfcf('0x33')]=_0x2ab3a8[_0xcfcf('0x33')];return;});})[_0xcfcf('0x27')](function(){if(_0x2adb60[_0xcfcf('0x36')](_0xcfcf('0x38'))){_0x2adb60[_0xcfcf('0x34')]();return _0x2adb60[_0xcfcf('0x35')](_0x281f0b);}_0x281f0b();})[_0xcfcf('0x29')](function(_0x2260f7){_0x281f0b(_0x2260f7);});},'afterCreate':function(_0x4762a7,_0x41e51e,_0x5a43f2){var _0x34e5f6=getUserApplications(_0x4762a7,_0x4762a7['internal']);if(_0x4762a7['internal']!=_0x4762a7[_0xcfcf('0x15')]){_0x34e5f6=_0x34e5f6[_0xcfcf('0x39')](getUserApplications(_0x4762a7,_0x4762a7[_0xcfcf('0x15')]));}return _0x5d3c21[_0xcfcf('0x3a')]['bulkCreate'](_0x34e5f6)['then'](function(){if(_0x4762a7['chanspy']){return getChanSpyPromise(_0x5d3c21,_0x4762a7);}})[_0xcfcf('0x27')](function(_0xc88ca2){if(_0xc88ca2&&_0xc88ca2[_0xcfcf('0x23')]){return _0x5d3c21[_0xcfcf('0x3a')][_0xcfcf('0x3b')](_0xc88ca2);}})[_0xcfcf('0x27')](function(){_0x5a43f2();})[_0xcfcf('0x29')](function(_0x2be666){_0x5a43f2(_0x2be666);});},'afterUpdate':function(_0x53665b,_0x17f032,_0x474291){return BPromise[_0xcfcf('0x31')]()[_0xcfcf('0x27')](function(){if(_0x53665b['changed']('chanspy')||_0x53665b[_0xcfcf('0x36')](_0xcfcf('0x5'))){return _0x5d3c21[_0xcfcf('0x3a')][_0xcfcf('0x3c')]({'where':{'UserId':_0x53665b['id'],'type':_0xcfcf('0x7'),'ChanSpyId':{'$ne':null}}})[_0xcfcf('0x27')](function(){if(_0x53665b[_0xcfcf('0x3d')]){return getChanSpyPromise(_0x5d3c21,_0x53665b)['then'](function(_0xffbb82){if(_0xffbb82&&_0xffbb82[_0xcfcf('0x23')]){return _0x5d3c21[_0xcfcf('0x3a')][_0xcfcf('0x3b')](_0xffbb82);}});}});}})['then'](function(){if(_0x53665b['changed'](_0xcfcf('0x1d'))||_0x53665b[_0xcfcf('0x36')](_0xcfcf('0x5'))){return _0x5d3c21[_0xcfcf('0x3a')][_0xcfcf('0x3c')]({'where':{'UserId':_0x53665b['id'],'type':'system','ChanSpyId':null}})['then'](function(){var _0x29f3e9=getUserApplications(_0x53665b,_0x53665b[_0xcfcf('0x28')]);if(_0x53665b[_0xcfcf('0x28')]!=_0x53665b[_0xcfcf('0x15')]){_0x29f3e9=_0x29f3e9[_0xcfcf('0x39')](getUserApplications(_0x53665b,_0x53665b['name']));}return _0x5d3c21[_0xcfcf('0x3a')]['bulkCreate'](_0x29f3e9);});}})[_0xcfcf('0x27')](function(){_0x474291();})[_0xcfcf('0x29')](function(_0x5d2e0f){_0x474291(_0x5d2e0f);});},'afterDestroy':function(_0xc5dd0d,_0x39d57c){return _0x5d3c21['VoiceExtension']['destroy']({'where':{'UserId':_0xc5dd0d['id'],'type':_0xcfcf('0x7')}});}},'instanceMethods':{'authenticate':function(_0x11f040,_0x20cefc){if(!_0x20cefc){return this[_0xcfcf('0x38')]===this[_0xcfcf('0x3e')](_0x11f040);}var _0x734508=this;this[_0xcfcf('0x3e')](_0x11f040,function(_0x1db5de,_0xc29f57){if(_0x1db5de){_0x20cefc(_0x1db5de);}if(_0x734508[_0xcfcf('0x38')]===_0xc29f57){_0x20cefc(null,!![]);}else{_0x20cefc(null,![]);}});},'makeSalt':function(_0x6732b4,_0x25267f){var _0x15a97a=0x10;if(typeof arguments[0x0]===_0xcfcf('0x3f')){_0x25267f=arguments[0x0];_0x6732b4=_0x15a97a;}else if(typeof arguments[0x1]==='function'){_0x25267f=arguments[0x1];}else{throw new Error('Missing\x20Callback');}if(!_0x6732b4){_0x6732b4=_0x15a97a;}return crypto[_0xcfcf('0x40')](_0x6732b4,function(_0xa2bf7a,_0x4f5ec4){if(_0xa2bf7a){_0x25267f(_0xa2bf7a);}return _0x25267f(null,_0x4f5ec4[_0xcfcf('0x41')](_0xcfcf('0x42')));});},'encryptPassword':function(_0x19d624,_0x206fb3){if(!_0x19d624||!this['salt']){return _0x206fb3?_0x206fb3(null):null;}var _0x4f0af3=0x2710;var _0x22d202=0x40;var _0x536ce0=new Buffer(this[_0xcfcf('0x43')],_0xcfcf('0x42'));if(!_0x206fb3){return crypto['pbkdf2Sync'](_0x19d624,_0x536ce0,_0x4f0af3,_0x22d202,_0xcfcf('0x44'))[_0xcfcf('0x41')](_0xcfcf('0x42'));}return crypto[_0xcfcf('0x45')](_0x19d624,_0x536ce0,_0x4f0af3,_0x22d202,'sha1',function(_0x54796e,_0x456d1f){if(_0x54796e){_0x206fb3(_0x54796e);}return _0x206fb3(null,_0x456d1f[_0xcfcf('0x41')]('base64'));});},'updatePassword':function(_0x2b16de){if(!this['password']){return _0x2b16de(null);}if(!validatePresenceOf(this[_0xcfcf('0x38')])&&authTypes[_0xcfcf('0x46')](this['provider'])===-0x1){_0x2b16de(new Error(_0xcfcf('0x47')));}var _0x3c1a00=this;this['makeSalt'](function(_0x23bd75,_0x11d8fb){if(_0x23bd75){return _0x2b16de(_0x23bd75);}_0x3c1a00[_0xcfcf('0x43')]=_0x11d8fb;_0x3c1a00[_0xcfcf('0x3e')](_0x3c1a00[_0xcfcf('0x38')],function(_0x29e7b4,_0x37a348){if(_0x29e7b4){_0x2b16de(_0x29e7b4);}_0x3c1a00['password']=_0x37a348;_0x2b16de(null);});});},'updateMd5Password':function(){this[_0xcfcf('0x48')]=md5(this['name']+':asterisk:'+this[_0xcfcf('0x38')]);return this[_0xcfcf('0x48')];}}});};
\ No newline at end of file
index eca7153..70f63fb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe173=['count','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','loginInPause','merge','LOGININPAUSE','concat','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','./user.socket','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','User','findAll','options','raw','where','limit','include','map','model','attributes','GetUser','ShowUser','find','catch','name','role','internal','UserVoiceQueueRt','update','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','push','isNil','SIP/%s','interface','PAUSE','body','type','uniqueid','bulkCreate','DEFAULT\x20PAUSE','UnpauseUser','findOne','channel','Unknown\x20channel','MemberReport','system','mail','chat','sms','openchannel','Pause','all','LogoutUser','destroy','length','LoginUser','mobile','phone'];(function(_0x56c758,_0x540591){var _0x9bb0db=function(_0xdaa197){while(--_0xdaa197){_0x56c758['push'](_0x56c758['shift']());}};_0x9bb0db(++_0x540591);}(_0xe173,0x16a));var _0x3e17=function(_0x4d76d4,_0x880d92){_0x4d76d4=_0x4d76d4-0x0;var _0x32004a=_0xe173[_0x4d76d4];return _0x32004a;};'use strict';var _=require(_0x3e17('0x0'));var util=require(_0x3e17('0x1'));var moment=require(_0x3e17('0x2'));var BPromise=require(_0x3e17('0x3'));var rs=require(_0x3e17('0x4'));var fs=require('fs');var Redis=require(_0x3e17('0x5'));var db=require(_0x3e17('0x6'))['db'];var utils=require(_0x3e17('0x7'));var logger=require(_0x3e17('0x8'))(_0x3e17('0x9'));var config=require(_0x3e17('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3e17('0xb')]({'port':0x232a});config[_0x3e17('0xc')]=_[_0x3e17('0xd')](config['redis'],{'host':_0x3e17('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3e17('0xc')]));require(_0x3e17('0xf'))['register'](socket);function respondWithRpcPromise(_0x586fe7,_0x1c007e,_0x1af69f){return new BPromise(function(_0x23b4a4,_0xc1df88){return client[_0x3e17('0x10')](_0x586fe7,_0x1af69f)[_0x3e17('0x11')](function(_0x3fc0d2){logger[_0x3e17('0x12')](_0x3e17('0x13'),_0x1c007e,_0x3e17('0x14'));logger[_0x3e17('0x15')]('User,\x20%s,\x20%s,\x20%s',_0x1c007e,_0x3e17('0x14'),JSON[_0x3e17('0x16')](_0x3fc0d2));if(_0x3fc0d2[_0x3e17('0x17')]){if(_0x3fc0d2['error']['code']===0x1f4){logger['error']('User,\x20%s,\x20%s',_0x1c007e,_0x3fc0d2[_0x3e17('0x17')][_0x3e17('0x18')]);return _0xc1df88(_0x3fc0d2[_0x3e17('0x17')][_0x3e17('0x18')]);}logger[_0x3e17('0x17')](_0x3e17('0x13'),_0x1c007e,_0x3fc0d2[_0x3e17('0x17')]['message']);return _0x23b4a4(_0x3fc0d2[_0x3e17('0x17')][_0x3e17('0x18')]);}else{logger[_0x3e17('0x12')]('User,\x20%s,\x20%s',_0x1c007e,_0x3e17('0x14'));_0x23b4a4(_0x3fc0d2[_0x3e17('0x19')]['message']);}})['catch'](function(_0x359fc6){logger[_0x3e17('0x17')]('User,\x20%s,\x20%s',_0x1c007e,_0x359fc6);_0xc1df88(_0x359fc6);});});}exports['GetUser']=function(_0x2cf92e){var _0x1f3ee0=this;return new Promise(function(_0x348eb8,_0x3ed43b){return db[_0x3e17('0x1a')][_0x3e17('0x1b')]({'raw':_0x2cf92e[_0x3e17('0x1c')]?_0x2cf92e[_0x3e17('0x1c')][_0x3e17('0x1d')]===undefined?!![]:![]:!![],'where':_0x2cf92e[_0x3e17('0x1c')]?_0x2cf92e['options'][_0x3e17('0x1e')]||null:null,'attributes':_0x2cf92e['options']?_0x2cf92e['options']['attributes']||null:null,'limit':_0x2cf92e[_0x3e17('0x1c')]?_0x2cf92e[_0x3e17('0x1c')][_0x3e17('0x1f')]||null:null,'include':_0x2cf92e[_0x3e17('0x1c')]?_0x2cf92e[_0x3e17('0x1c')][_0x3e17('0x20')]?_[_0x3e17('0x21')](_0x2cf92e['options'][_0x3e17('0x20')],function(_0x259aec){return{'model':db[_0x259aec['model']],'as':_0x259aec['as'],'attributes':_0x259aec['attributes'],'include':_0x259aec[_0x3e17('0x20')]?_[_0x3e17('0x21')](_0x259aec[_0x3e17('0x20')],function(_0x1adfd9){return{'model':db[_0x1adfd9[_0x3e17('0x22')]],'as':_0x1adfd9['as'],'attributes':_0x1adfd9[_0x3e17('0x23')],'include':_0x1adfd9[_0x3e17('0x20')]?_[_0x3e17('0x21')](_0x1adfd9['include'],function(_0x35e5e0){return{'model':db[_0x35e5e0['model']],'as':_0x35e5e0['as'],'attributes':_0x35e5e0[_0x3e17('0x23')]};}):[]};}):[]};}):[]:[]})[_0x3e17('0x11')](function(_0x3ce745){logger[_0x3e17('0x12')](_0x3e17('0x24'),_0x2cf92e);logger[_0x3e17('0x15')](_0x3e17('0x24'),_0x2cf92e,JSON[_0x3e17('0x16')](_0x3ce745));_0x348eb8(_0x3ce745);})['catch'](function(_0x1bb1da){logger[_0x3e17('0x17')](_0x3e17('0x24'),_0x1bb1da['message'],_0x2cf92e);_0x3ed43b(_0x1f3ee0['error'](0x1f4,_0x1bb1da[_0x3e17('0x18')]));});});};exports[_0x3e17('0x25')]=function(_0x51cefa){var _0x303ff3=this;return new Promise(function(_0xe79e69,_0x51403b){return db['User'][_0x3e17('0x26')]({'raw':_0x51cefa[_0x3e17('0x1c')]?_0x51cefa['options'][_0x3e17('0x1d')]===undefined?!![]:![]:!![],'where':_0x51cefa[_0x3e17('0x1c')]?_0x51cefa[_0x3e17('0x1c')][_0x3e17('0x1e')]||null:null,'attributes':_0x51cefa['options']?_0x51cefa[_0x3e17('0x1c')][_0x3e17('0x23')]||null:null,'include':_0x51cefa[_0x3e17('0x1c')]?_0x51cefa[_0x3e17('0x1c')]['include']?_[_0x3e17('0x21')](_0x51cefa[_0x3e17('0x1c')][_0x3e17('0x20')],function(_0x1b2e82){return{'model':db[_0x1b2e82[_0x3e17('0x22')]],'as':_0x1b2e82['as'],'attributes':_0x1b2e82[_0x3e17('0x23')],'include':_0x1b2e82[_0x3e17('0x20')]?_['map'](_0x1b2e82[_0x3e17('0x20')],function(_0x2a013b){return{'model':db[_0x2a013b[_0x3e17('0x22')]],'as':_0x2a013b['as'],'attributes':_0x2a013b['attributes'],'include':_0x2a013b['include']?_[_0x3e17('0x21')](_0x2a013b['include'],function(_0x851c80){return{'model':db[_0x851c80[_0x3e17('0x22')]],'as':_0x851c80['as'],'attributes':_0x851c80[_0x3e17('0x23')]};}):[]};}):[]};}):[]:[]})[_0x3e17('0x11')](function(_0x19cc7d){logger[_0x3e17('0x12')]('ShowUser',_0x51cefa);logger['debug']('ShowUser',_0x51cefa,JSON[_0x3e17('0x16')](_0x19cc7d));_0xe79e69(_0x19cc7d);})[_0x3e17('0x27')](function(_0x819926){logger['error'](_0x3e17('0x25'),_0x819926[_0x3e17('0x18')],_0x51cefa);_0x51403b(_0x303ff3['error'](0x1f4,_0x819926[_0x3e17('0x18')]));});});};exports['PauseUser']=function(_0x4426e6){var _0x349a4e=this;return new Promise(function(_0x1acaba,_0x19faca){var _0x5d1063;return db[_0x3e17('0x1a')]['find']({'where':_0x4426e6[_0x3e17('0x1c')][_0x3e17('0x1e')]||{},'attributes':['id',_0x3e17('0x28'),_0x3e17('0x29'),_0x3e17('0x2a'),'interface']})[_0x3e17('0x11')](function(_0x55b33b){if(_0x55b33b){_0x5d1063=_0x55b33b;return db[_0x3e17('0x2b')][_0x3e17('0x2c')]({'paused':0x1},{'where':{'UserId':_0x5d1063['id']},'individualHooks':!![]});}})[_0x3e17('0x11')](function(){if(_0x5d1063){return db['MemberReport'][_0x3e17('0x1b')]({'where':{'membername':_0x5d1063[_0x3e17('0x28')],'type':'PAUSE','exitAt':null}});}})['then'](function(_0x461445){if(_0x5d1063){if(_0x461445&&_0x461445['length']){var _0x2a4922=moment()[_0x3e17('0x2d')](_0x3e17('0x2e'));for(var _0x5a8f9f=0x0,_0x4d9b39=_0x461445['length'];_0x5a8f9f<_0x4d9b39;_0x5a8f9f++){_0x461445[_0x5a8f9f][_0x3e17('0x2f')]({'exitAt':_0x2a4922});}}}})['then'](function(){if(_0x5d1063){var _0x9a3d80=[];var _0x43b695=utils[_0x3e17('0x30')]();_0x43b695[_0x3e17('0x31')](function(_0x2eedce){_0x9a3d80[_0x3e17('0x32')]({'channel':_0x2eedce,'membername':_0x5d1063[_0x3e17('0x28')],'interface':_[_0x3e17('0x33')](_0x5d1063['interface'])?util['format'](_0x3e17('0x34'),_0x5d1063['name']):_0x5d1063[_0x3e17('0x35')],'type':_0x3e17('0x36'),'enterAt':moment()[_0x3e17('0x2d')](_0x3e17('0x2e')),'data1':_0x4426e6[_0x3e17('0x37')][_0x3e17('0x38')]||'DEFAULT\x20PAUSE','role':_0x5d1063[_0x3e17('0x29')],'internal':_0x5d1063['internal'],'uniqueid':_0x4426e6[_0x3e17('0x37')][_0x3e17('0x39')]||null});});return db['MemberReport'][_0x3e17('0x3a')](_0x9a3d80,{'individualHooks':!![]});}})[_0x3e17('0x11')](function(){if(_0x5d1063){return _0x5d1063[_0x3e17('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x4426e6[_0x3e17('0x37')][_0x3e17('0x38')]||_0x3e17('0x3b'),'lastPauseAt':moment()[_0x3e17('0x2d')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x3e17('0x11')](function(_0x2492b9){_0x1acaba(_0x2492b9);})[_0x3e17('0x27')](function(_0x4f8e57){_0x19faca(_0x349a4e[_0x3e17('0x17')](0x1f4,_0x4f8e57['message']));});});};exports[_0x3e17('0x3c')]=function(_0x3d6598){var _0x4770b9=this;return new Promise(function(_0x403613,_0x48ce3f){var _0x5e4339;return db[_0x3e17('0x1a')][_0x3e17('0x3d')]({'where':_0x3d6598['options'][_0x3e17('0x1e')]||{},'attributes':['id',_0x3e17('0x28')]})[_0x3e17('0x11')](function(_0x48136c){if(_0x48136c){_0x5e4339=_0x48136c;if(_0x3d6598[_0x3e17('0x37')][_0x3e17('0x3e')]&&!utils['isValidChannel'](_0x3d6598[_0x3e17('0x37')][_0x3e17('0x3e')])){throw new Error(_0x3e17('0x3f'));}switch(_0x3d6598['body']['channel']){case'voice':return db[_0x3e17('0x2b')][_0x3e17('0x2c')]({'paused':0x0},{'where':{'UserId':_0x5e4339['id']}})[_0x3e17('0x11')](function(){return db[_0x3e17('0x40')][_0x3e17('0x26')]({'where':{'channel':_0x3d6598[_0x3e17('0x37')]['channel'],'membername':_0x5e4339[_0x3e17('0x28')],'type':_0x3e17('0x36'),'exitAt':null}});})['then'](function(_0x53fb16){if(_0x53fb16){return _0x53fb16[_0x3e17('0x2c')]({'exitAt':moment()[_0x3e17('0x2d')](_0x3e17('0x2e')),'data2':_0x3e17('0x41')},{'individualHooks':!![]});}return null;})[_0x3e17('0x11')](function(){return _0x5e4339[_0x3e17('0x2c')]({'voicePause':![]});});case _0x3e17('0x42'):case _0x3e17('0x43'):case'fax':case _0x3e17('0x44'):case _0x3e17('0x45'):case'whatsapp':return db[_0x3e17('0x40')][_0x3e17('0x26')]({'where':{'channel':_0x3d6598[_0x3e17('0x37')][_0x3e17('0x3e')],'membername':_0x5e4339[_0x3e17('0x28')],'type':_0x3e17('0x36'),'exitAt':null}})[_0x3e17('0x11')](function(_0x516b7d){return _0x516b7d['update']({'exitAt':moment()[_0x3e17('0x2d')](_0x3e17('0x2e')),'data2':'system'},{'individualHooks':!![]});})[_0x3e17('0x11')](function(){var _0x5caa37={};_['set'](_0x5caa37,util[_0x3e17('0x2d')]('%s%s',_0x3d6598[_0x3e17('0x37')]['channel'],_0x3e17('0x46')),![]);return _0x5e4339[_0x3e17('0x2c')](_0x5caa37);});default:return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x5e4339['id']}})[_0x3e17('0x11')](function(){return db[_0x3e17('0x40')][_0x3e17('0x1b')]({'where':{'membername':_0x5e4339[_0x3e17('0x28')],'type':'PAUSE','exitAt':null}});})[_0x3e17('0x11')](function(_0x1a69f4){var _0x1681c7=[];_0x1a69f4[_0x3e17('0x31')](function(_0x272305){_0x1681c7[_0x3e17('0x32')](_0x272305[_0x3e17('0x2c')]({'exitAt':moment()[_0x3e17('0x2d')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'}));});return BPromise[_0x3e17('0x47')](_0x1681c7);})[_0x3e17('0x11')](function(){return _0x5e4339['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x3e17('0x11')](function(_0x2d83e7){_0x403613(_0x2d83e7);})[_0x3e17('0x27')](function(_0x586547){_0x48ce3f(_0x4770b9[_0x3e17('0x17')](0x1f4,_0x586547[_0x3e17('0x18')]));});});};exports[_0x3e17('0x48')]=function(_0x1380eb){var _0x4d447d=this;return new Promise(function(_0x3a9167,_0x1f2d1d){var _0x4c5159;return db[_0x3e17('0x1a')]['findOne']({'where':_0x1380eb[_0x3e17('0x1c')][_0x3e17('0x1e')]||{},'attributes':['id',_0x3e17('0x28')]})[_0x3e17('0x11')](function(_0x2c7146){if(_0x2c7146){_0x4c5159=_0x2c7146;return db[_0x3e17('0x2b')][_0x3e17('0x49')]({'where':{'membername':_0x4c5159[_0x3e17('0x28')]},'individualHooks':!![]});}})[_0x3e17('0x11')](function(){if(_0x4c5159){return db[_0x3e17('0x40')][_0x3e17('0x1b')]({'where':{'membername':_0x4c5159[_0x3e17('0x28')],'exitAt':null}});}})[_0x3e17('0x11')](function(_0x44d68b){if(_0x4c5159){if(_0x44d68b&&_0x44d68b[_0x3e17('0x4a')]){var _0x4563a6=[];_0x44d68b[_0x3e17('0x31')](function(_0x51a565){_0x4563a6[_0x3e17('0x32')](_0x51a565['update']({'exitAt':moment()['format'](_0x3e17('0x2e'))}));});return BPromise[_0x3e17('0x47')](_0x4563a6);}}})['then'](function(){if(_0x4c5159){return _0x4c5159[_0x3e17('0x2c')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x3e17('0x11')](function(_0x5a755e){_0x3a9167(_0x5a755e);})[_0x3e17('0x27')](function(_0x19eb50){_0x1f2d1d(_0x4d447d['error'](0x1f4,_0x19eb50['message']));});});};exports[_0x3e17('0x4b')]=function(_0x3e6a2e){var _0xb18c01=this;return new Promise(function(_0x5b200c,_0x54da93){var _0x1bc347;var _0x50436e;var _0x2e361b;var _0x5ef91f;return db[_0x3e17('0x1a')]['findOne']({'where':_0x3e6a2e[_0x3e17('0x1c')][_0x3e17('0x1e')]||{},'attributes':['id','name',_0x3e17('0x29'),_0x3e17('0x4c'),_0x3e17('0x4d'),_0x3e17('0x2a'),'loginInPause',_0x3e17('0x35')]})[_0x3e17('0x11')](function(_0x445c03){if(_0x445c03){_0x1bc347=_0x445c03;_0x5ef91f=_0x3e6a2e[_0x3e17('0x37')][_0x3e17('0x35')]?_0x3e6a2e['body'][_0x3e17('0x35')]:util[_0x3e17('0x2d')]('SIP/%s',_0x1bc347['name']);return db['User'][_0x3e17('0x4e')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x1bc347['id']}}});}})[_0x3e17('0x11')](function(_0x141c17){if(_0x141c17){_0x2e361b=_0x141c17;return require(_0x3e17('0x4f'))[_0x3e17('0x50')]();}})['then'](function(_0x516ecd){if(_0x516ecd&&_0x516ecd[_0x3e17('0x51')]&&_0x2e361b>=_0x516ecd[_0x3e17('0x51')]){throw new Error(_0x3e17('0x52'));}})['then'](function(){if(_0x1bc347){return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x1bc347[_0x3e17('0x28')]},'individualHooks':!![]});}})[_0x3e17('0x11')](function(){if(_0x1bc347){return _0x1bc347[_0x3e17('0x53')]({'raw':!![]});}})[_0x3e17('0x11')](function(_0x1cfb5d){if(_0x1bc347){if(_0x1cfb5d){var _0x295ff0=[];_0x50436e=_0x1cfb5d;if(_0x50436e[_0x3e17('0x4a')]){for(var _0x3ccd16=0x0;_0x3ccd16<_0x50436e['length'];_0x3ccd16++){_0x295ff0[_0x3e17('0x32')](db[_0x3e17('0x2b')]['upsert']({'membername':_0x1bc347[_0x3e17('0x28')],'UserId':_0x1bc347['id'],'queue_name':_0x50436e[_0x3ccd16]['name'],'VoiceQueueId':_0x50436e[_0x3ccd16]['id'],'interface':_0x5ef91f,'paused':_0x1bc347[_0x3e17('0x54')]||![],'penalty':_0x50436e[_0x3ccd16]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x3e17('0x47')](_0x295ff0);}}}})['then'](function(){if(_0x1bc347){return db[_0x3e17('0x40')]['findAll']({'where':{'membername':_0x1bc347[_0x3e17('0x28')],'exitAt':null}});}})[_0x3e17('0x11')](function(_0x3d183e){if(_0x1bc347){if(_0x3d183e&&_0x3d183e[_0x3e17('0x4a')]){var _0x38de2e=[];_0x3d183e['forEach'](function(_0x1714e4){_0x38de2e['push'](_0x1714e4[_0x3e17('0x2c')]({'exitAt':moment()[_0x3e17('0x2d')](_0x3e17('0x2e'))}));});return BPromise['all'](_0x38de2e);}}})[_0x3e17('0x11')](function(_0x19de30){if(_0x1bc347){var _0x10fe54=[];var _0x4a2366=[];var _0x3bc336=utils['getChannels']();var _0x1f3d7f={'membername':_0x1bc347[_0x3e17('0x28')],'interface':_0x5ef91f,'enterAt':moment()['format'](_0x3e17('0x2e')),'role':_0x1bc347[_0x3e17('0x29')],'internal':_0x1bc347[_0x3e17('0x2a')]};_0x3bc336[_0x3e17('0x31')](function(_0x5a9063){_0x10fe54[_0x3e17('0x32')](_['merge']({'channel':_0x5a9063,'type':'LOGIN','data1':'callysquare','data2':_0x5ef91f},_0x1f3d7f));if(_0x1bc347[_0x3e17('0x54')]){_0x4a2366[_0x3e17('0x32')](_[_0x3e17('0x55')]({'channel':_0x5a9063,'type':_0x3e17('0x36'),'data1':_0x3e17('0x56')},_0x1f3d7f));}});return db['MemberReport'][_0x3e17('0x3a')](_0x10fe54[_0x3e17('0x57')](_0x4a2366),{'individualHooks':!![]});}})[_0x3e17('0x11')](function(){if(_0x1bc347){return _0x1bc347[_0x3e17('0x2c')]({'online':!![],'lastLoginAt':moment()['format'](_0x3e17('0x2e')),'voicePause':_0x1bc347[_0x3e17('0x54')]||![],'mailPause':_0x1bc347['loginInPause']||![],'chatPause':_0x1bc347[_0x3e17('0x54')]||![],'faxPause':_0x1bc347[_0x3e17('0x54')]||![],'smsPause':_0x1bc347[_0x3e17('0x54')]||![],'openchannelPause':_0x1bc347[_0x3e17('0x54')]||![],'pauseType':_0x1bc347[_0x3e17('0x54')]?'LOGININPAUSE':null,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x5ef91f});}})['then'](function(_0x3341cd){_0x5b200c(_0x3341cd);})[_0x3e17('0x27')](function(_0x2606cd){_0x54da93(_0xb18c01['error'](0x1f4,_0x2606cd['message']));});});};
\ No newline at end of file
+var _0x8ee3=['redis','defaults','localhost','socket.io-emitter','register','request','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetUser','options','raw','where','attributes','limit','include','map','model','then','ShowUser','User','find','PauseUser','name','interface','update','findAll','PAUSE','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','getChannels','push','SIP/%s','body','DEFAULT\x20PAUSE','role','uniqueid','MemberReport','bulkCreate','type','UnpauseUser','channel','voice','UserVoiceQueueRt','mail','chat','fax','sms','openchannel','whatsapp','system','%s%s','Pause','all','LogoutUser','destroy','forEach','mobile','internal','loginInPause','count','agent','../../config/license/util','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','concat','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xa56611,_0x12f5b8){var _0x563e69=function(_0x14ca94){while(--_0x14ca94){_0xa56611['push'](_0xa56611['shift']());}};_0x563e69(++_0x12f5b8);}(_0x8ee3,0x165));var _0x38ee=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ee3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x38ee('0x0'));var moment=require('moment');var BPromise=require(_0x38ee('0x1'));var rs=require(_0x38ee('0x2'));var fs=require('fs');var Redis=require(_0x38ee('0x3'));var db=require(_0x38ee('0x4'))['db'];var utils=require(_0x38ee('0x5'));var logger=require('../../config/logger')(_0x38ee('0x6'));var config=require(_0x38ee('0x7'));var jayson=require(_0x38ee('0x8'));var client=jayson[_0x38ee('0x9')][_0x38ee('0xa')]({'port':0x232a});config[_0x38ee('0xb')]=_[_0x38ee('0xc')](config[_0x38ee('0xb')],{'host':_0x38ee('0xd'),'port':0x18eb});var socket=require(_0x38ee('0xe'))(new Redis(config[_0x38ee('0xb')]));require('./user.socket')[_0x38ee('0xf')](socket);function respondWithRpcPromise(_0x5f29ef,_0x20d2e4,_0x557032){return new BPromise(function(_0x313ca,_0x14bd08){return client[_0x38ee('0x10')](_0x5f29ef,_0x557032)['then'](function(_0x1b2faf){logger[_0x38ee('0x11')](_0x38ee('0x12'),_0x20d2e4,_0x38ee('0x13'));logger[_0x38ee('0x14')](_0x38ee('0x15'),_0x20d2e4,_0x38ee('0x13'),JSON['stringify'](_0x1b2faf));if(_0x1b2faf[_0x38ee('0x16')]){if(_0x1b2faf['error'][_0x38ee('0x17')]===0x1f4){logger['error'](_0x38ee('0x12'),_0x20d2e4,_0x1b2faf['error'][_0x38ee('0x18')]);return _0x14bd08(_0x1b2faf[_0x38ee('0x16')][_0x38ee('0x18')]);}logger[_0x38ee('0x16')](_0x38ee('0x12'),_0x20d2e4,_0x1b2faf[_0x38ee('0x16')][_0x38ee('0x18')]);return _0x313ca(_0x1b2faf['error'][_0x38ee('0x18')]);}else{logger['info'](_0x38ee('0x12'),_0x20d2e4,_0x38ee('0x13'));_0x313ca(_0x1b2faf[_0x38ee('0x19')]['message']);}})[_0x38ee('0x1a')](function(_0x9d967f){logger[_0x38ee('0x16')]('User,\x20%s,\x20%s',_0x20d2e4,_0x9d967f);_0x14bd08(_0x9d967f);});});}exports[_0x38ee('0x1b')]=function(_0x5c0dcd){var _0x223b02=this;return new Promise(function(_0xf3b74e,_0x15594c){return db['User']['findAll']({'raw':_0x5c0dcd[_0x38ee('0x1c')]?_0x5c0dcd['options'][_0x38ee('0x1d')]===undefined?!![]:![]:!![],'where':_0x5c0dcd[_0x38ee('0x1c')]?_0x5c0dcd['options'][_0x38ee('0x1e')]||null:null,'attributes':_0x5c0dcd[_0x38ee('0x1c')]?_0x5c0dcd[_0x38ee('0x1c')][_0x38ee('0x1f')]||null:null,'limit':_0x5c0dcd[_0x38ee('0x1c')]?_0x5c0dcd[_0x38ee('0x1c')][_0x38ee('0x20')]||null:null,'include':_0x5c0dcd[_0x38ee('0x1c')]?_0x5c0dcd[_0x38ee('0x1c')][_0x38ee('0x21')]?_[_0x38ee('0x22')](_0x5c0dcd['options'][_0x38ee('0x21')],function(_0xf6d5c1){return{'model':db[_0xf6d5c1[_0x38ee('0x23')]],'as':_0xf6d5c1['as'],'attributes':_0xf6d5c1[_0x38ee('0x1f')],'include':_0xf6d5c1[_0x38ee('0x21')]?_[_0x38ee('0x22')](_0xf6d5c1[_0x38ee('0x21')],function(_0x272220){return{'model':db[_0x272220['model']],'as':_0x272220['as'],'attributes':_0x272220[_0x38ee('0x1f')],'include':_0x272220[_0x38ee('0x21')]?_[_0x38ee('0x22')](_0x272220[_0x38ee('0x21')],function(_0x428557){return{'model':db[_0x428557[_0x38ee('0x23')]],'as':_0x428557['as'],'attributes':_0x428557['attributes']};}):[]};}):[]};}):[]:[]})[_0x38ee('0x24')](function(_0x2b50ca){logger[_0x38ee('0x11')](_0x38ee('0x1b'),_0x5c0dcd);logger[_0x38ee('0x14')]('GetUser',_0x5c0dcd,JSON['stringify'](_0x2b50ca));_0xf3b74e(_0x2b50ca);})[_0x38ee('0x1a')](function(_0x546c21){logger[_0x38ee('0x16')](_0x38ee('0x1b'),_0x546c21[_0x38ee('0x18')],_0x5c0dcd);_0x15594c(_0x223b02['error'](0x1f4,_0x546c21[_0x38ee('0x18')]));});});};exports[_0x38ee('0x25')]=function(_0x5cf874){var _0x32bd09=this;return new Promise(function(_0x5f31c8,_0xe3622d){return db[_0x38ee('0x26')][_0x38ee('0x27')]({'raw':_0x5cf874[_0x38ee('0x1c')]?_0x5cf874[_0x38ee('0x1c')][_0x38ee('0x1d')]===undefined?!![]:![]:!![],'where':_0x5cf874[_0x38ee('0x1c')]?_0x5cf874['options'][_0x38ee('0x1e')]||null:null,'attributes':_0x5cf874[_0x38ee('0x1c')]?_0x5cf874[_0x38ee('0x1c')][_0x38ee('0x1f')]||null:null,'include':_0x5cf874[_0x38ee('0x1c')]?_0x5cf874[_0x38ee('0x1c')][_0x38ee('0x21')]?_['map'](_0x5cf874[_0x38ee('0x1c')][_0x38ee('0x21')],function(_0x3bf2f){return{'model':db[_0x3bf2f[_0x38ee('0x23')]],'as':_0x3bf2f['as'],'attributes':_0x3bf2f[_0x38ee('0x1f')],'include':_0x3bf2f[_0x38ee('0x21')]?_[_0x38ee('0x22')](_0x3bf2f[_0x38ee('0x21')],function(_0x1827eb){return{'model':db[_0x1827eb[_0x38ee('0x23')]],'as':_0x1827eb['as'],'attributes':_0x1827eb[_0x38ee('0x1f')],'include':_0x1827eb[_0x38ee('0x21')]?_[_0x38ee('0x22')](_0x1827eb['include'],function(_0x389c16){return{'model':db[_0x389c16[_0x38ee('0x23')]],'as':_0x389c16['as'],'attributes':_0x389c16[_0x38ee('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x38ee('0x24')](function(_0x3c6357){logger[_0x38ee('0x11')](_0x38ee('0x25'),_0x5cf874);logger['debug'](_0x38ee('0x25'),_0x5cf874,JSON['stringify'](_0x3c6357));_0x5f31c8(_0x3c6357);})['catch'](function(_0x379209){logger['error'](_0x38ee('0x25'),_0x379209[_0x38ee('0x18')],_0x5cf874);_0xe3622d(_0x32bd09['error'](0x1f4,_0x379209['message']));});});};exports[_0x38ee('0x28')]=function(_0x404dcd){var _0x3815c4=this;return new Promise(function(_0x58683b,_0xba994c){var _0x29a56e;return db[_0x38ee('0x26')][_0x38ee('0x27')]({'where':_0x404dcd[_0x38ee('0x1c')]['where']||{},'attributes':['id',_0x38ee('0x29'),'role','internal',_0x38ee('0x2a')]})[_0x38ee('0x24')](function(_0x47ec14){if(_0x47ec14){_0x29a56e=_0x47ec14;return db['UserVoiceQueueRt'][_0x38ee('0x2b')]({'paused':0x1},{'where':{'UserId':_0x29a56e['id']},'individualHooks':!![]});}})[_0x38ee('0x24')](function(){if(_0x29a56e){return db['MemberReport'][_0x38ee('0x2c')]({'where':{'membername':_0x29a56e[_0x38ee('0x29')],'type':_0x38ee('0x2d'),'exitAt':null}});}})['then'](function(_0x1e23c9){if(_0x29a56e){if(_0x1e23c9&&_0x1e23c9['length']){var _0x4daac8=moment()[_0x38ee('0x2e')](_0x38ee('0x2f'));for(var _0x59bfa8=0x0,_0x329f64=_0x1e23c9[_0x38ee('0x30')];_0x59bfa8<_0x329f64;_0x59bfa8++){_0x1e23c9[_0x59bfa8][_0x38ee('0x31')]({'exitAt':_0x4daac8});}}}})[_0x38ee('0x24')](function(){if(_0x29a56e){var _0x40cbc5=[];var _0x1ea7ec=utils[_0x38ee('0x32')]();_0x1ea7ec['forEach'](function(_0x33bac5){_0x40cbc5[_0x38ee('0x33')]({'channel':_0x33bac5,'membername':_0x29a56e[_0x38ee('0x29')],'interface':_['isNil'](_0x29a56e[_0x38ee('0x2a')])?util[_0x38ee('0x2e')](_0x38ee('0x34'),_0x29a56e['name']):_0x29a56e['interface'],'type':_0x38ee('0x2d'),'enterAt':moment()[_0x38ee('0x2e')](_0x38ee('0x2f')),'data1':_0x404dcd[_0x38ee('0x35')]['type']||_0x38ee('0x36'),'role':_0x29a56e[_0x38ee('0x37')],'internal':_0x29a56e['internal'],'uniqueid':_0x404dcd[_0x38ee('0x35')][_0x38ee('0x38')]||null});});return db[_0x38ee('0x39')][_0x38ee('0x3a')](_0x40cbc5,{'individualHooks':!![]});}})[_0x38ee('0x24')](function(){if(_0x29a56e){return _0x29a56e[_0x38ee('0x2b')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x404dcd['body'][_0x38ee('0x3b')]||_0x38ee('0x36'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x38ee('0x24')](function(_0x880e4a){_0x58683b(_0x880e4a);})['catch'](function(_0x4d8afb){_0xba994c(_0x3815c4[_0x38ee('0x16')](0x1f4,_0x4d8afb[_0x38ee('0x18')]));});});};exports[_0x38ee('0x3c')]=function(_0x4dcbe7){var _0x41798d=this;return new Promise(function(_0x37e118,_0x49eed0){var _0x432bb4;return db[_0x38ee('0x26')]['findOne']({'where':_0x4dcbe7['options']['where']||{},'attributes':['id',_0x38ee('0x29')]})['then'](function(_0x526e1f){if(_0x526e1f){_0x432bb4=_0x526e1f;if(_0x4dcbe7['body'][_0x38ee('0x3d')]&&!utils['isValidChannel'](_0x4dcbe7[_0x38ee('0x35')][_0x38ee('0x3d')])){throw new Error('Unknown\x20channel');}switch(_0x4dcbe7['body'][_0x38ee('0x3d')]){case _0x38ee('0x3e'):return db[_0x38ee('0x3f')][_0x38ee('0x2b')]({'paused':0x0},{'where':{'UserId':_0x432bb4['id']}})[_0x38ee('0x24')](function(){return db[_0x38ee('0x39')][_0x38ee('0x27')]({'where':{'channel':_0x4dcbe7[_0x38ee('0x35')][_0x38ee('0x3d')],'membername':_0x432bb4[_0x38ee('0x29')],'type':_0x38ee('0x2d'),'exitAt':null}});})[_0x38ee('0x24')](function(_0x3ab219){if(_0x3ab219){return _0x3ab219[_0x38ee('0x2b')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'},{'individualHooks':!![]});}return null;})[_0x38ee('0x24')](function(){return _0x432bb4[_0x38ee('0x2b')]({'voicePause':![]});});case _0x38ee('0x40'):case _0x38ee('0x41'):case _0x38ee('0x42'):case _0x38ee('0x43'):case _0x38ee('0x44'):case _0x38ee('0x45'):return db[_0x38ee('0x39')]['find']({'where':{'channel':_0x4dcbe7[_0x38ee('0x35')][_0x38ee('0x3d')],'membername':_0x432bb4[_0x38ee('0x29')],'type':_0x38ee('0x2d'),'exitAt':null}})[_0x38ee('0x24')](function(_0x49e7a6){return _0x49e7a6[_0x38ee('0x2b')]({'exitAt':moment()['format'](_0x38ee('0x2f')),'data2':_0x38ee('0x46')},{'individualHooks':!![]});})[_0x38ee('0x24')](function(){var _0xfc182d={};_['set'](_0xfc182d,util[_0x38ee('0x2e')](_0x38ee('0x47'),_0x4dcbe7[_0x38ee('0x35')][_0x38ee('0x3d')],_0x38ee('0x48')),![]);return _0x432bb4[_0x38ee('0x2b')](_0xfc182d);});default:return db[_0x38ee('0x3f')][_0x38ee('0x2b')]({'paused':0x0},{'where':{'UserId':_0x432bb4['id']}})[_0x38ee('0x24')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x432bb4[_0x38ee('0x29')],'type':_0x38ee('0x2d'),'exitAt':null}});})[_0x38ee('0x24')](function(_0x3bfce8){var _0xfa9650=[];_0x3bfce8['forEach'](function(_0x17979a){_0xfa9650['push'](_0x17979a[_0x38ee('0x2b')]({'exitAt':moment()[_0x38ee('0x2e')](_0x38ee('0x2f')),'data2':_0x38ee('0x46')}));});return BPromise[_0x38ee('0x49')](_0xfa9650);})['then'](function(){return _0x432bb4[_0x38ee('0x2b')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x38ee('0x24')](function(_0x64e971){_0x37e118(_0x64e971);})['catch'](function(_0x4090c3){_0x49eed0(_0x41798d[_0x38ee('0x16')](0x1f4,_0x4090c3[_0x38ee('0x18')]));});});};exports[_0x38ee('0x4a')]=function(_0x1801c6){var _0x1bc324=this;return new Promise(function(_0x407810,_0x56bdb9){var _0x48ebd6;return db[_0x38ee('0x26')]['findOne']({'where':_0x1801c6[_0x38ee('0x1c')][_0x38ee('0x1e')]||{},'attributes':['id',_0x38ee('0x29')]})[_0x38ee('0x24')](function(_0x281959){if(_0x281959){_0x48ebd6=_0x281959;return db[_0x38ee('0x3f')][_0x38ee('0x4b')]({'where':{'membername':_0x48ebd6['name']},'individualHooks':!![]});}})['then'](function(){if(_0x48ebd6){return db[_0x38ee('0x39')][_0x38ee('0x2c')]({'where':{'membername':_0x48ebd6['name'],'exitAt':null}});}})[_0x38ee('0x24')](function(_0x5343ef){if(_0x48ebd6){if(_0x5343ef&&_0x5343ef[_0x38ee('0x30')]){var _0x41e0d7=[];_0x5343ef[_0x38ee('0x4c')](function(_0x5d7f04){_0x41e0d7[_0x38ee('0x33')](_0x5d7f04[_0x38ee('0x2b')]({'exitAt':moment()[_0x38ee('0x2e')](_0x38ee('0x2f'))}));});return BPromise[_0x38ee('0x49')](_0x41e0d7);}}})[_0x38ee('0x24')](function(){if(_0x48ebd6){return _0x48ebd6[_0x38ee('0x2b')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x38ee('0x24')](function(_0xbfc8bc){_0x407810(_0xbfc8bc);})['catch'](function(_0x125269){_0x56bdb9(_0x1bc324[_0x38ee('0x16')](0x1f4,_0x125269[_0x38ee('0x18')]));});});};exports['LoginUser']=function(_0x3511a1){var _0x283f54=this;return new Promise(function(_0x584363,_0x5b40bf){var _0x151857;var _0x2ce79c;var _0x8a180a;var _0x5eeab8;return db['User']['findOne']({'where':_0x3511a1[_0x38ee('0x1c')][_0x38ee('0x1e')]||{},'attributes':['id',_0x38ee('0x29'),_0x38ee('0x37'),_0x38ee('0x4d'),'phone',_0x38ee('0x4e'),_0x38ee('0x4f'),_0x38ee('0x2a')]})[_0x38ee('0x24')](function(_0x2ef475){if(_0x2ef475){_0x151857=_0x2ef475;_0x5eeab8=_0x3511a1[_0x38ee('0x35')][_0x38ee('0x2a')]?_0x3511a1['body'][_0x38ee('0x2a')]:util[_0x38ee('0x2e')](_0x38ee('0x34'),_0x151857[_0x38ee('0x29')]);return db[_0x38ee('0x26')][_0x38ee('0x50')]({'where':{'role':_0x38ee('0x51'),'online':!![],'id':{'$ne':_0x151857['id']}}});}})['then'](function(_0x3762a9){if(_0x3762a9){_0x8a180a=_0x3762a9;return require(_0x38ee('0x52'))['getLicense']();}})[_0x38ee('0x24')](function(_0x2bb9c1){if(_0x2bb9c1&&_0x2bb9c1[_0x38ee('0x53')]&&_0x8a180a>=_0x2bb9c1[_0x38ee('0x53')]){throw new Error(_0x38ee('0x54'));}})[_0x38ee('0x24')](function(){if(_0x151857){return db[_0x38ee('0x3f')][_0x38ee('0x4b')]({'where':{'membername':_0x151857['name']},'individualHooks':!![]});}})[_0x38ee('0x24')](function(){if(_0x151857){return _0x151857[_0x38ee('0x55')]({'raw':!![]});}})[_0x38ee('0x24')](function(_0x42f9aa){if(_0x151857){if(_0x42f9aa){var _0x3cc31f=[];_0x2ce79c=_0x42f9aa;if(_0x2ce79c[_0x38ee('0x30')]){for(var _0x1df255=0x0;_0x1df255<_0x2ce79c[_0x38ee('0x30')];_0x1df255++){_0x3cc31f[_0x38ee('0x33')](db['UserVoiceQueueRt']['upsert']({'membername':_0x151857[_0x38ee('0x29')],'UserId':_0x151857['id'],'queue_name':_0x2ce79c[_0x1df255][_0x38ee('0x29')],'VoiceQueueId':_0x2ce79c[_0x1df255]['id'],'interface':_0x5eeab8,'paused':_0x151857[_0x38ee('0x4f')]||![],'penalty':_0x2ce79c[_0x1df255][_0x38ee('0x56')]||0x0}));}return BPromise[_0x38ee('0x49')](_0x3cc31f);}}}})['then'](function(){if(_0x151857){return db[_0x38ee('0x39')][_0x38ee('0x2c')]({'where':{'membername':_0x151857[_0x38ee('0x29')],'exitAt':null}});}})[_0x38ee('0x24')](function(_0x5adc88){if(_0x151857){if(_0x5adc88&&_0x5adc88[_0x38ee('0x30')]){var _0x57317c=[];_0x5adc88[_0x38ee('0x4c')](function(_0x5ccf45){_0x57317c[_0x38ee('0x33')](_0x5ccf45[_0x38ee('0x2b')]({'exitAt':moment()[_0x38ee('0x2e')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x38ee('0x49')](_0x57317c);}}})[_0x38ee('0x24')](function(_0x285873){if(_0x151857){var _0x257832=[];var _0x4539b8=[];var _0x213bed=utils[_0x38ee('0x32')]();var _0xaf1b48={'membername':_0x151857[_0x38ee('0x29')],'interface':_0x5eeab8,'enterAt':moment()['format'](_0x38ee('0x2f')),'role':_0x151857['role'],'internal':_0x151857[_0x38ee('0x4e')]};_0x213bed[_0x38ee('0x4c')](function(_0xfdf8f6){_0x257832[_0x38ee('0x33')](_[_0x38ee('0x57')]({'channel':_0xfdf8f6,'type':_0x38ee('0x58'),'data1':_0x38ee('0x59'),'data2':_0x5eeab8},_0xaf1b48));if(_0x151857[_0x38ee('0x4f')]){_0x4539b8[_0x38ee('0x33')](_[_0x38ee('0x57')]({'channel':_0xfdf8f6,'type':'PAUSE','data1':_0x38ee('0x5a')},_0xaf1b48));}});return db[_0x38ee('0x39')][_0x38ee('0x3a')](_0x257832[_0x38ee('0x5b')](_0x4539b8),{'individualHooks':!![]});}})[_0x38ee('0x24')](function(){if(_0x151857){return _0x151857[_0x38ee('0x2b')]({'online':!![],'lastLoginAt':moment()[_0x38ee('0x2e')](_0x38ee('0x2f')),'voicePause':_0x151857[_0x38ee('0x4f')]||![],'mailPause':_0x151857[_0x38ee('0x4f')]||![],'chatPause':_0x151857['loginInPause']||![],'faxPause':_0x151857['loginInPause']||![],'smsPause':_0x151857[_0x38ee('0x4f')]||![],'openchannelPause':_0x151857[_0x38ee('0x4f')]||![],'pauseType':_0x151857[_0x38ee('0x4f')]?_0x38ee('0x5a'):null,'lastPauseAt':moment()[_0x38ee('0x2e')](_0x38ee('0x2f')),'interface':_0x5eeab8});}})[_0x38ee('0x24')](function(_0x57ea01){_0x584363(_0x57ea01);})[_0x38ee('0x1a')](function(_0x1169dc){_0x5b40bf(_0x283f54[_0x38ee('0x16')](0x1f4,_0x1169dc[_0x38ee('0x18')]));});});};
\ No newline at end of file
index 7b63703..dddce9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x34c5=['removeListener','length','user:','./user.events','save','remove','update','emit'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x34c5,0x12b));var _0x534c=function(_0x4ae12c,_0x3e7740){_0x4ae12c=_0x4ae12c-0x0;var _0x6bb4bc=_0x34c5[_0x4ae12c];return _0x6bb4bc;};'use strict';var UserEvents=require(_0x534c('0x0'));var events=[_0x534c('0x1'),_0x534c('0x2'),_0x534c('0x3')];function createListener(_0x3f94e6,_0x575e8c){return function(_0x5a7587){_0x575e8c[_0x534c('0x4')](_0x3f94e6,_0x5a7587);};}function removeListener(_0x4eb3c3,_0x44051c){return function(){UserEvents[_0x534c('0x5')](_0x4eb3c3,_0x44051c);};}exports['register']=function(_0x406e9d){for(var _0x4a962f=0x0,_0xed17d7=events[_0x534c('0x6')];_0x4a962f<_0xed17d7;_0x4a962f++){var _0x48c3fa=events[_0x4a962f];var _0x184014=createListener(_0x534c('0x7')+_0x48c3fa,_0x406e9d);UserEvents['on'](_0x48c3fa,_0x184014);}};
\ No newline at end of file
+var _0xc194=['emit','removeListener','register','length','user:','./user.events','save','remove','update'];(function(_0x5a976d,_0x52c9c6){var _0x3cfa03=function(_0x218a44){while(--_0x218a44){_0x5a976d['push'](_0x5a976d['shift']());}};_0x3cfa03(++_0x52c9c6);}(_0xc194,0x164));var _0x4c19=function(_0x509b7c,_0x988148){_0x509b7c=_0x509b7c-0x0;var _0x110cc1=_0xc194[_0x509b7c];return _0x110cc1;};'use strict';var UserEvents=require(_0x4c19('0x0'));var events=[_0x4c19('0x1'),_0x4c19('0x2'),_0x4c19('0x3')];function createListener(_0x10b7d2,_0x170000){return function(_0xd382b6){_0x170000[_0x4c19('0x4')](_0x10b7d2,_0xd382b6);};}function removeListener(_0xb23b51,_0x1b7bde){return function(){UserEvents[_0x4c19('0x5')](_0xb23b51,_0x1b7bde);};}exports[_0x4c19('0x6')]=function(_0x39cfda){for(var _0x5df2d3=0x0,_0x3c6076=events[_0x4c19('0x7')];_0x5df2d3<_0x3c6076;_0x5df2d3++){var _0x439a5d=events[_0x5df2d3];var _0x4989d1=createListener(_0x4c19('0x8')+_0x439a5d,_0x39cfda);UserEvents['on'](_0x439a5d,_0x4989d1);}};
\ No newline at end of file
index d9b21a1..9218dff 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(_0x28e27c,_0x2216ff){var _0x45ae93=function(_0x15f539){while(--_0x15f539){_0x28e27c['push'](_0x28e27c['shift']());}};_0x45ae93(++_0x2216ff);}(_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(_0x2b9e33,_0x266ac7){var _0x3062a6=function(_0x452db6){while(--_0x452db6){_0x2b9e33['push'](_0x2b9e33['shift']());}};_0x3062a6(++_0x266ac7);}(_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 d401ea0..3c20b82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b31=['exports','INTEGER','sequelize'];(function(_0x21ae7e,_0x2f4e96){var _0x5d44d5=function(_0x4ae811){while(--_0x4ae811){_0x21ae7e['push'](_0x21ae7e['shift']());}};_0x5d44d5(++_0x2f4e96);}(_0x4b31,0x1c4));var _0x14b3=function(_0x2d98c6,_0x89828e){_0x2d98c6=_0x2d98c6-0x0;var _0x1081eb=_0x4b31[_0x2d98c6];return _0x1081eb;};'use strict';var Sequelize=require(_0x14b3('0x0'));module[_0x14b3('0x1')]={'penalty':{'type':Sequelize[_0x14b3('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xf9f9=['sequelize','exports','INTEGER'];(function(_0x3787eb,_0x4963bd){var _0x4d8866=function(_0x1c36bc){while(--_0x1c36bc){_0x3787eb['push'](_0x3787eb['shift']());}};_0x4d8866(++_0x4963bd);}(_0xf9f9,0x90));var _0x9f9f=function(_0x23c83f,_0x48decb){_0x23c83f=_0x23c83f-0x0;var _0x44ba81=_0xf9f9[_0x23c83f];return _0x44ba81;};'use strict';var Sequelize=require(_0x9f9f('0x0'));module[_0x9f9f('0x1')]={'penalty':{'type':Sequelize[_0x9f9f('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index af72ccb..b713e9a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfaa3=['../../config/environment','define','lodash','util','moment','bluebird','request-promise','path'];(function(_0x3f578f,_0x51f172){var _0x32c754=function(_0x1bd873){while(--_0x1bd873){_0x3f578f['push'](_0x3f578f['shift']());}};_0x32c754(++_0x51f172);}(_0xfaa3,0xe2));var _0x3faa=function(_0x56ab09,_0x652793){_0x56ab09=_0x56ab09-0x0;var _0x1da1f0=_0xfaa3[_0x56ab09];return _0x1da1f0;};'use strict';var _=require(_0x3faa('0x0'));var util=require(_0x3faa('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3faa('0x2'));var BPromise=require(_0x3faa('0x3'));var rp=require(_0x3faa('0x4'));var fs=require('fs');var path=require(_0x3faa('0x5'));var rimraf=require('rimraf');var config=require(_0x3faa('0x6'));var attributes=require('./userChatQueue.attributes');module['exports']=function(_0x55d06a,_0x15c0ff){return _0x55d06a[_0x3faa('0x7')]('UserChatQueue',attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc489=['user_has_chat_queues','lodash','util','api','bluebird','request-promise','path','./userChatQueue.attributes','exports','UserChatQueue'];(function(_0x1c4b46,_0x26ba44){var _0x32f50c=function(_0x4593f0){while(--_0x4593f0){_0x1c4b46['push'](_0x1c4b46['shift']());}};_0x32f50c(++_0x26ba44);}(_0xc489,0x137));var _0x9c48=function(_0x16b55f,_0x301c6c){_0x16b55f=_0x16b55f-0x0;var _0x391c2f=_0xc489[_0x16b55f];return _0x391c2f;};'use strict';var _=require(_0x9c48('0x0'));var util=require(_0x9c48('0x1'));var logger=require('../../config/logger')(_0x9c48('0x2'));var moment=require('moment');var BPromise=require(_0x9c48('0x3'));var rp=require(_0x9c48('0x4'));var fs=require('fs');var path=require(_0x9c48('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9c48('0x6'));module[_0x9c48('0x7')]=function(_0x24853f,_0x3492f1){return _0x24853f['define'](_0x9c48('0x8'),attributes,{'tableName':_0x9c48('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 586636e..9037953 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4055=['then','info','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','error','code','UserChatQueue,\x20%s,\x20%s','message','result','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x28261c,_0x4a2cc7){var _0x4f05be=function(_0x49276a){while(--_0x49276a){_0x28261c['push'](_0x28261c['shift']());}};_0x4f05be(++_0x4a2cc7);}(_0x4055,0x19b));var _0x5405=function(_0x24df15,_0x22cb23){_0x24df15=_0x24df15-0x0;var _0x260f07=_0x4055[_0x24df15];return _0x260f07;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x5405('0x0'));var rs=require(_0x5405('0x1'));var fs=require('fs');var Redis=require(_0x5405('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5405('0x3'));var logger=require(_0x5405('0x4'))(_0x5405('0x5'));var config=require('../../config/environment');var jayson=require(_0x5405('0x6'));var client=jayson[_0x5405('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c617a,_0x5c8117,_0xe3dd80){return new BPromise(function(_0x4d749d,_0x3ca22e){return client[_0x5405('0x8')](_0x3c617a,_0xe3dd80)[_0x5405('0x9')](function(_0x634b41){logger[_0x5405('0xa')]('UserChatQueue,\x20%s,\x20%s',_0x5c8117,_0x5405('0xb'));logger[_0x5405('0xc')](_0x5405('0xd'),_0x5c8117,_0x5405('0xb'),JSON['stringify'](_0x634b41));if(_0x634b41[_0x5405('0xe')]){if(_0x634b41[_0x5405('0xe')][_0x5405('0xf')]===0x1f4){logger['error'](_0x5405('0x10'),_0x5c8117,_0x634b41[_0x5405('0xe')][_0x5405('0x11')]);return _0x3ca22e(_0x634b41[_0x5405('0xe')]['message']);}logger[_0x5405('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x5c8117,_0x634b41[_0x5405('0xe')][_0x5405('0x11')]);return _0x4d749d(_0x634b41[_0x5405('0xe')]['message']);}else{logger[_0x5405('0xa')](_0x5405('0x10'),_0x5c8117,_0x5405('0xb'));_0x4d749d(_0x634b41[_0x5405('0x12')][_0x5405('0x11')]);}})[_0x5405('0x13')](function(_0x4db0de){logger[_0x5405('0xe')](_0x5405('0x10'),_0x5c8117,_0x4db0de);_0x3ca22e(_0x4db0de);});});}
\ No newline at end of file
+var _0x9c4f=['UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then'];(function(_0x54945e,_0x42f71a){var _0x36eabd=function(_0x178ecf){while(--_0x178ecf){_0x54945e['push'](_0x54945e['shift']());}};_0x36eabd(++_0x42f71a);}(_0x9c4f,0x1d8));var _0xf9c4=function(_0x34bba3,_0x515d98){_0x34bba3=_0x34bba3-0x0;var _0x40b8b8=_0x9c4f[_0x34bba3];return _0x40b8b8;};'use strict';var _=require(_0xf9c4('0x0'));var util=require('util');var moment=require(_0xf9c4('0x1'));var BPromise=require(_0xf9c4('0x2'));var rs=require(_0xf9c4('0x3'));var fs=require('fs');var Redis=require(_0xf9c4('0x4'));var db=require(_0xf9c4('0x5'))['db'];var utils=require(_0xf9c4('0x6'));var logger=require(_0xf9c4('0x7'))(_0xf9c4('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf9c4('0x9')][_0xf9c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5383fc,_0x3dd83e,_0x24b624){return new BPromise(function(_0xd9696a,_0x2bcd61){return client['request'](_0x5383fc,_0x24b624)[_0xf9c4('0xb')](function(_0x756452){logger['info'](_0xf9c4('0xc'),_0x3dd83e,'request\x20sent');logger[_0xf9c4('0xd')](_0xf9c4('0xe'),_0x3dd83e,_0xf9c4('0xf'),JSON[_0xf9c4('0x10')](_0x756452));if(_0x756452[_0xf9c4('0x11')]){if(_0x756452[_0xf9c4('0x11')][_0xf9c4('0x12')]===0x1f4){logger['error'](_0xf9c4('0xc'),_0x3dd83e,_0x756452['error'][_0xf9c4('0x13')]);return _0x2bcd61(_0x756452[_0xf9c4('0x11')][_0xf9c4('0x13')]);}logger[_0xf9c4('0x11')]('UserChatQueue,\x20%s,\x20%s',_0x3dd83e,_0x756452[_0xf9c4('0x11')][_0xf9c4('0x13')]);return _0xd9696a(_0x756452[_0xf9c4('0x11')][_0xf9c4('0x13')]);}else{logger[_0xf9c4('0x14')]('UserChatQueue,\x20%s,\x20%s',_0x3dd83e,_0xf9c4('0xf'));_0xd9696a(_0x756452[_0xf9c4('0x15')][_0xf9c4('0x13')]);}})['catch'](function(_0x4e07f7){logger[_0xf9c4('0x11')](_0xf9c4('0xc'),_0x3dd83e,_0x4e07f7);_0x2bcd61(_0x4e07f7);});});}
\ No newline at end of file
index 3197a6e..1342965 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(_0x51070b,_0x39c85d){var _0x153240=function(_0x7c02f2){while(--_0x7c02f2){_0x51070b['push'](_0x51070b['shift']());}};_0x153240(++_0x39c85d);}(_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(_0x1e1af0,_0x5abc3c){var _0x3d161d=function(_0x2c2df0){while(--_0x2c2df0){_0x1e1af0['push'](_0x1e1af0['shift']());}};_0x3d161d(++_0x5abc3c);}(_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 fde2f51..977923a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x40de=['exports','INTEGER','sequelize'];(function(_0x4d93c3,_0x375dd5){var _0x453776=function(_0x387449){while(--_0x387449){_0x4d93c3['push'](_0x4d93c3['shift']());}};_0x453776(++_0x375dd5);}(_0x40de,0x101));var _0xe40d=function(_0x4527d8,_0x59e349){_0x4527d8=_0x4527d8-0x0;var _0x1ec91d=_0x40de[_0x4527d8];return _0x1ec91d;};'use strict';var Sequelize=require(_0xe40d('0x0'));module[_0xe40d('0x1')]={'penalty':{'type':Sequelize[_0xe40d('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x89b1=['exports','INTEGER','sequelize'];(function(_0x2ee749,_0x46af19){var _0x3eec63=function(_0x51fd0d){while(--_0x51fd0d){_0x2ee749['push'](_0x2ee749['shift']());}};_0x3eec63(++_0x46af19);}(_0x89b1,0x10d));var _0x189b=function(_0x48951a,_0x23dd81){_0x48951a=_0x48951a-0x0;var _0x2c0b5=_0x89b1[_0x48951a];return _0x2c0b5;};'use strict';var Sequelize=require(_0x189b('0x0'));module[_0x189b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x189b('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 4a9518a..086c8a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d86=['../../config/environment','./userFaxQueue.attributes','exports','user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x229d7e,_0x5bc489){var _0xa78280=function(_0x59850e){while(--_0x59850e){_0x229d7e['push'](_0x229d7e['shift']());}};_0xa78280(++_0x5bc489);}(_0x6d86,0x163));var _0x66d8=function(_0x4d9b93,_0x104f78){_0x4d9b93=_0x4d9b93-0x0;var _0x4bb062=_0x6d86[_0x4d9b93];return _0x4bb062;};'use strict';var _=require(_0x66d8('0x0'));var util=require(_0x66d8('0x1'));var logger=require(_0x66d8('0x2'))(_0x66d8('0x3'));var moment=require(_0x66d8('0x4'));var BPromise=require(_0x66d8('0x5'));var rp=require(_0x66d8('0x6'));var fs=require('fs');var path=require(_0x66d8('0x7'));var rimraf=require(_0x66d8('0x8'));var config=require(_0x66d8('0x9'));var attributes=require(_0x66d8('0xa'));module[_0x66d8('0xb')]=function(_0x89c70,_0x2e8ed0){return _0x89c70['define']('UserFaxQueue',attributes,{'tableName':_0x66d8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6536=['../../config/environment','./userFaxQueue.attributes','exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','request-promise','rimraf'];(function(_0x526298,_0x2ec3ba){var _0x467835=function(_0x32d027){while(--_0x32d027){_0x526298['push'](_0x526298['shift']());}};_0x467835(++_0x2ec3ba);}(_0x6536,0x1b6));var _0x6653=function(_0x481704,_0x2c8229){_0x481704=_0x481704-0x0;var _0x1e95a3=_0x6536[_0x481704];return _0x1e95a3;};'use strict';var _=require(_0x6653('0x0'));var util=require(_0x6653('0x1'));var logger=require(_0x6653('0x2'))(_0x6653('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6653('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6653('0x5'));var config=require(_0x6653('0x6'));var attributes=require(_0x6653('0x7'));module[_0x6653('0x8')]=function(_0x13c3c1,_0x2ff95d){return _0x13c3c1[_0x6653('0x9')](_0x6653('0xa'),attributes,{'tableName':_0x6653('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 1c3903a..dd1c391 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e87=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x558cf5,_0x3caae2){var _0x45f531=function(_0x260d74){while(--_0x260d74){_0x558cf5['push'](_0x558cf5['shift']());}};_0x45f531(++_0x3caae2);}(_0x0e87,0xd9));var _0x70e8=function(_0x2f3c4b,_0x1d124e){_0x2f3c4b=_0x2f3c4b-0x0;var _0x479baf=_0x0e87[_0x2f3c4b];return _0x479baf;};'use strict';var _=require(_0x70e8('0x0'));var util=require(_0x70e8('0x1'));var moment=require(_0x70e8('0x2'));var BPromise=require(_0x70e8('0x3'));var rs=require(_0x70e8('0x4'));var fs=require('fs');var Redis=require(_0x70e8('0x5'));var db=require(_0x70e8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x70e8('0x7'))('rpc');var config=require(_0x70e8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x70e8('0x9')][_0x70e8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5dce5b,_0xc30eb9,_0x3168e1){return new BPromise(function(_0x98c2eb,_0x29d806){return client[_0x70e8('0xb')](_0x5dce5b,_0x3168e1)['then'](function(_0x28d5c1){logger[_0x70e8('0xc')](_0x70e8('0xd'),_0xc30eb9,_0x70e8('0xe'));logger[_0x70e8('0xf')](_0x70e8('0x10'),_0xc30eb9,_0x70e8('0xe'),JSON[_0x70e8('0x11')](_0x28d5c1));if(_0x28d5c1[_0x70e8('0x12')]){if(_0x28d5c1[_0x70e8('0x12')][_0x70e8('0x13')]===0x1f4){logger['error'](_0x70e8('0xd'),_0xc30eb9,_0x28d5c1['error']['message']);return _0x29d806(_0x28d5c1[_0x70e8('0x12')][_0x70e8('0x14')]);}logger[_0x70e8('0x12')](_0x70e8('0xd'),_0xc30eb9,_0x28d5c1[_0x70e8('0x12')]['message']);return _0x98c2eb(_0x28d5c1[_0x70e8('0x12')]['message']);}else{logger[_0x70e8('0xc')](_0x70e8('0xd'),_0xc30eb9,_0x70e8('0xe'));_0x98c2eb(_0x28d5c1['result']['message']);}})[_0x70e8('0x15')](function(_0x148c65){logger[_0x70e8('0x12')](_0x70e8('0xd'),_0xc30eb9,_0x148c65);_0x29d806(_0x148c65);});});}
\ No newline at end of file
+var _0x42b1=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x149083,_0x4047b6){var _0x4dc74e=function(_0x1211f9){while(--_0x1211f9){_0x149083['push'](_0x149083['shift']());}};_0x4dc74e(++_0x4047b6);}(_0x42b1,0x146));var _0x142b=function(_0x47c6b9,_0x210b3c){_0x47c6b9=_0x47c6b9-0x0;var _0x34f34d=_0x42b1[_0x47c6b9];return _0x34f34d;};'use strict';var _=require(_0x142b('0x0'));var util=require(_0x142b('0x1'));var moment=require(_0x142b('0x2'));var BPromise=require(_0x142b('0x3'));var rs=require(_0x142b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x142b('0x5'))['db'];var utils=require(_0x142b('0x6'));var logger=require(_0x142b('0x7'))(_0x142b('0x8'));var config=require(_0x142b('0x9'));var jayson=require(_0x142b('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x590a84,_0x341b7c,_0x1c23a2){return new BPromise(function(_0x250dbb,_0xf33e4f){return client[_0x142b('0xb')](_0x590a84,_0x1c23a2)[_0x142b('0xc')](function(_0x24ef0c){logger[_0x142b('0xd')](_0x142b('0xe'),_0x341b7c,_0x142b('0xf'));logger[_0x142b('0x10')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x341b7c,_0x142b('0xf'),JSON['stringify'](_0x24ef0c));if(_0x24ef0c[_0x142b('0x11')]){if(_0x24ef0c['error'][_0x142b('0x12')]===0x1f4){logger[_0x142b('0x11')]('UserFaxQueue,\x20%s,\x20%s',_0x341b7c,_0x24ef0c[_0x142b('0x11')][_0x142b('0x13')]);return _0xf33e4f(_0x24ef0c[_0x142b('0x11')]['message']);}logger[_0x142b('0x11')](_0x142b('0xe'),_0x341b7c,_0x24ef0c['error']['message']);return _0x250dbb(_0x24ef0c['error'][_0x142b('0x13')]);}else{logger[_0x142b('0xd')](_0x142b('0xe'),_0x341b7c,_0x142b('0xf'));_0x250dbb(_0x24ef0c[_0x142b('0x14')][_0x142b('0x13')]);}})[_0x142b('0x15')](function(_0x3dad62){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x341b7c,_0x3dad62);_0xf33e4f(_0x3dad62);});});}
\ No newline at end of file
index 7f786dc..f1d2ab6 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(_0x3b619f,_0xbb6a60){var _0x3c4888=function(_0x1f47e5){while(--_0x1f47e5){_0x3b619f['push'](_0x3b619f['shift']());}};_0x3c4888(++_0xbb6a60);}(_0x70e0,0x17b));var _0x070e=function(_0x562960,_0xa32ae2){_0x562960=_0x562960-0x0;var _0xbb8642=_0x70e0[_0x562960];return _0xbb8642;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1c7f87,_0x62999e){var _0x43f712=function(_0x2ceea0){while(--_0x2ceea0){_0x1c7f87['push'](_0x1c7f87['shift']());}};_0x43f712(++_0x62999e);}(_0x70e0,0x17b));var _0x070e=function(_0x273c52,_0x59207c){_0x273c52=_0x273c52-0x0;var _0x2bb160=_0x70e0[_0x273c52];return _0x2bb160;};'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 8dcd57f..545c67f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe8c6=['exports','sequelize'];(function(_0x272170,_0x2e99b2){var _0x202407=function(_0x794b29){while(--_0x794b29){_0x272170['push'](_0x272170['shift']());}};_0x202407(++_0x2e99b2);}(_0xe8c6,0x16b));var _0x6e8c=function(_0x21904f,_0x469d29){_0x21904f=_0x21904f-0x0;var _0x259d09=_0xe8c6[_0x21904f];return _0x259d09;};'use strict';var Sequelize=require(_0x6e8c('0x0'));module[_0x6e8c('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x87ca=['exports','INTEGER'];(function(_0x26efac,_0x21ab8a){var _0x8482e4=function(_0x14db32){while(--_0x14db32){_0x26efac['push'](_0x26efac['shift']());}};_0x8482e4(++_0x21ab8a);}(_0x87ca,0x134));var _0xa87c=function(_0x1e7bf6,_0x1ea7da){_0x1e7bf6=_0x1e7bf6-0x0;var _0x1121f5=_0x87ca[_0x1e7bf6];return _0x1121f5;};'use strict';var Sequelize=require('sequelize');module[_0xa87c('0x0')]={'penalty':{'type':Sequelize[_0xa87c('0x1')],'defaultValue':0x0}};
\ No newline at end of file
index 6a88283..86a4b1e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3b36=['request-promise','path','../../config/environment','./userMailQueue.attributes','define','UserMailQueue','user_has_mail_queues','lodash','util','api','moment','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3b36,0x1b7));var _0x63b3=function(_0x103d1b,_0x3f34a7){_0x103d1b=_0x103d1b-0x0;var _0x428497=_0x3b36[_0x103d1b];return _0x428497;};'use strict';var _=require(_0x63b3('0x0'));var util=require(_0x63b3('0x1'));var logger=require('../../config/logger')(_0x63b3('0x2'));var moment=require(_0x63b3('0x3'));var BPromise=require(_0x63b3('0x4'));var rp=require(_0x63b3('0x5'));var fs=require('fs');var path=require(_0x63b3('0x6'));var rimraf=require('rimraf');var config=require(_0x63b3('0x7'));var attributes=require(_0x63b3('0x8'));module['exports']=function(_0x2fb838,_0x10af71){return _0x2fb838[_0x63b3('0x9')](_0x63b3('0xa'),attributes,{'tableName':_0x63b3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf167=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','exports','define','UserMailQueue','user_has_mail_queues'];(function(_0x58a3da,_0x4bb384){var _0x2612a2=function(_0x2178ab){while(--_0x2178ab){_0x58a3da['push'](_0x58a3da['shift']());}};_0x2612a2(++_0x4bb384);}(_0xf167,0x160));var _0x7f16=function(_0x581d17,_0x951b0a){_0x581d17=_0x581d17-0x0;var _0x2014bb=_0xf167[_0x581d17];return _0x2014bb;};'use strict';var _=require(_0x7f16('0x0'));var util=require(_0x7f16('0x1'));var logger=require(_0x7f16('0x2'))('api');var moment=require(_0x7f16('0x3'));var BPromise=require('bluebird');var rp=require(_0x7f16('0x4'));var fs=require('fs');var path=require(_0x7f16('0x5'));var rimraf=require(_0x7f16('0x6'));var config=require('../../config/environment');var attributes=require('./userMailQueue.attributes');module[_0x7f16('0x7')]=function(_0x4125cb,_0xc3e177){return _0x4125cb[_0x7f16('0x8')](_0x7f16('0x9'),attributes,{'tableName':_0x7f16('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 3844d8d..d07de8e 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(_0x40c886,_0x1a8be4){var _0x19dbd7=function(_0x11c581){while(--_0x11c581){_0x40c886['push'](_0x40c886['shift']());}};_0x19dbd7(++_0x1a8be4);}(_0x8ef6,0xf2));var _0x68ef=function(_0x58ed73,_0x5d37b1){_0x58ed73=_0x58ed73-0x0;var _0x1d217c=_0x8ef6[_0x58ed73];return _0x1d217c;};'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 _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x1144c8,_0xc31d74){var _0x394b76=function(_0x347a76){while(--_0x347a76){_0x1144c8['push'](_0x1144c8['shift']());}};_0x394b76(++_0xc31d74);}(_0x55ca,0x126));var _0xa55c=function(_0xa08526,_0xd2a376){_0xa08526=_0xa08526-0x0;var _0x2684eb=_0x55ca[_0xa08526];return _0x2684eb;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}
\ No newline at end of file
index 4f1628f..10ce5b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cf7=['multer','path','connect-timeout','express','Router','../../components/interaction/service','./userNotification.controller','post','sendUserNotification','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7cf7,0xa0));var _0x77cf=function(_0x3890aa,_0x322574){_0x3890aa=_0x3890aa-0x0;var _0x68f281=_0x7cf7[_0x3890aa];return _0x68f281;};'use strict';var multer=require(_0x77cf('0x0'));var util=require('util');var path=require(_0x77cf('0x1'));var timeout=require(_0x77cf('0x2'));var express=require(_0x77cf('0x3'));var router=express[_0x77cf('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x77cf('0x5'));var config=require('../../config/environment');var controller=require(_0x77cf('0x6'));router[_0x77cf('0x7')]('/',auth['isAuthenticated'](),controller[_0x77cf('0x8')]);module[_0x77cf('0x9')]=router;
\ No newline at end of file
+var _0xc48a=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','exports'];(function(_0x115488,_0x270be3){var _0xff2c73=function(_0x34f865){while(--_0x34f865){_0x115488['push'](_0x115488['shift']());}};_0xff2c73(++_0x270be3);}(_0xc48a,0x9c));var _0xac48=function(_0x36f528,_0x2144b3){_0x36f528=_0x36f528-0x0;var _0x2628d7=_0xc48a[_0x36f528];return _0x2628d7;};'use strict';var multer=require(_0xac48('0x0'));var util=require(_0xac48('0x1'));var path=require(_0xac48('0x2'));var timeout=require(_0xac48('0x3'));var express=require(_0xac48('0x4'));var router=express[_0xac48('0x5')]();var fs_extra=require(_0xac48('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xac48('0x7'));var config=require(_0xac48('0x8'));var controller=require(_0xac48('0x9'));router[_0xac48('0xa')]('/',auth[_0xac48('0xb')](),controller['sendUserNotification']);module[_0xac48('0xc')]=router;
\ No newline at end of file
index 770753f..83741b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29b0=['sequelize','TEXT','STRING','BOOLEAN'];(function(_0x593d89,_0x45145f){var _0x4aa403=function(_0x21f674){while(--_0x21f674){_0x593d89['push'](_0x593d89['shift']());}};_0x4aa403(++_0x45145f);}(_0x29b0,0x18c));var _0x029b=function(_0x436ea9,_0x3c8974){_0x436ea9=_0x436ea9-0x0;var _0x266ae6=_0x29b0[_0x436ea9];return _0x266ae6;};'use strict';var Sequelize=require(_0x029b('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x029b('0x1')]},'recipientsDescription':{'type':Sequelize[_0x029b('0x2')]},'beep':{'type':Sequelize[_0x029b('0x3')]}};
\ No newline at end of file
+var _0x0848=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x5bbfa6,_0x67b964){var _0x23f87b=function(_0x3d6126){while(--_0x3d6126){_0x5bbfa6['push'](_0x5bbfa6['shift']());}};_0x23f87b(++_0x67b964);}(_0x0848,0x1c4));var _0x8084=function(_0x125243,_0x119e35){_0x125243=_0x125243-0x0;var _0x1e1a69=_0x0848[_0x125243];return _0x1e1a69;};'use strict';var Sequelize=require(_0x8084('0x0'));module[_0x8084('0x1')]={'body':{'type':Sequelize[_0x8084('0x2')]},'senderName':{'type':Sequelize[_0x8084('0x3')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x8084('0x3')]},'beep':{'type':Sequelize[_0x8084('0x4')]}};
\ No newline at end of file
index 48a2e64..2718f95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6165=['Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','Sequelize','ValidationError','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','error','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','smsqueue','voicequeue','team','user','some','model','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','union','ids','includes','queue','replace','Queue','all','flatten','map','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./userNotification.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','reject','save','then','end','stack','name','sendUserNotification','hasOwnProperty','text','body'];(function(_0x316b0e,_0x63f55e){var _0x3a4432=function(_0x34da51){while(--_0x34da51){_0x316b0e['push'](_0x316b0e['shift']());}};_0x3a4432(++_0x63f55e);}(_0x6165,0x15e));var _0x5616=function(_0x29eada,_0x1bf697){_0x29eada=_0x29eada-0x0;var _0x506b2d=_0x6165[_0x29eada];return _0x506b2d;};'use strict';var emlformat=require(_0x5616('0x0'));var rimraf=require(_0x5616('0x1'));var zipdir=require(_0x5616('0x2'));var jsonpatch=require(_0x5616('0x3'));var rp=require('request-promise');var moment=require(_0x5616('0x4'));var BPromise=require(_0x5616('0x5'));var Mustache=require(_0x5616('0x6'));var util=require(_0x5616('0x7'));var path=require(_0x5616('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5616('0x9'));var squel=require(_0x5616('0xa'));var crypto=require(_0x5616('0xb'));var jsforce=require(_0x5616('0xc'));var deskjs=require(_0x5616('0xd'));var toCsv=require(_0x5616('0xe'));var querystring=require('querystring');var Papa=require(_0x5616('0xf'));var Redis=require(_0x5616('0x10'));var authService=require(_0x5616('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5616('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5616('0x13'))('api');var utils=require(_0x5616('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x5616('0x15'));var db=require(_0x5616('0x16'))['db'];config[_0x5616('0x17')]=_[_0x5616('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5616('0x19'))(new Redis(config[_0x5616('0x17')]));require(_0x5616('0x1a'))[_0x5616('0x1b')](socket);function respondWithStatusCode(_0xbb4e7,_0x241a07){_0x241a07=_0x241a07||0xcc;return function(_0x4c38ca){if(_0x4c38ca){return _0xbb4e7[_0x5616('0x1c')](_0x241a07);}return _0xbb4e7[_0x5616('0x1d')](_0x241a07)['end']();};}function respondWithResult(_0x1e48c3,_0x44a500){_0x44a500=_0x44a500||0xc8;return function(_0x6fa58c){if(_0x6fa58c){return _0x1e48c3['status'](_0x44a500)[_0x5616('0x1e')](_0x6fa58c);}};}function respondWithFilteredResult(_0x304205,_0x4b8744){return function(_0x2413cc){if(_0x2413cc){var _0x51e1f9=typeof _0x4b8744[_0x5616('0x1f')]===_0x5616('0x20')&&typeof _0x4b8744[_0x5616('0x21')]==='undefined';var _0x22f066=_0x2413cc[_0x5616('0x22')];var _0xcd16c5=_0x51e1f9?0x0:_0x4b8744[_0x5616('0x1f')];var _0x2463f4=_0x51e1f9?_0x2413cc['count']:_0x4b8744[_0x5616('0x1f')]+_0x4b8744[_0x5616('0x21')];var _0x13c77b;if(_0x2463f4>=_0x22f066){_0x2463f4=_0x22f066;_0x13c77b=0xc8;}else{_0x13c77b=0xce;}_0x304205[_0x5616('0x1d')](_0x13c77b);return _0x304205['set'](_0x5616('0x23'),_0xcd16c5+'-'+_0x2463f4+'/'+_0x22f066)[_0x5616('0x1e')](_0x2413cc);}return null;};}function patchUpdates(_0x15646b){return function(_0x3f1c2c){try{jsonpatch['apply'](_0x3f1c2c,_0x15646b,!![]);}catch(_0x450af8){return BPromise[_0x5616('0x24')](_0x450af8);}return _0x3f1c2c[_0x5616('0x25')]();};}function saveUpdates(_0x945d30,_0x353e29){return function(_0x1608db){if(_0x1608db){return _0x1608db['update'](_0x945d30)[_0x5616('0x26')](function(_0x2987e1){return _0x2987e1;});}return null;};}function removeEntity(_0xb5dbf6,_0x91502f){return function(_0x1c0663){if(_0x1c0663){return _0x1c0663['destroy']()['then'](function(){_0xb5dbf6[_0x5616('0x1d')](0xcc)[_0x5616('0x27')]();});}};}function handleEntityNotFound(_0x55eb77,_0x17e5c6){return function(_0x4ef214){if(!_0x4ef214){_0x55eb77['sendStatus'](0x194);}return _0x4ef214;};}function handleError(_0x1b3051,_0x18577b){_0x18577b=_0x18577b||0x1f4;return function(_0x2fc229){logger['error'](_0x2fc229[_0x5616('0x28')]);if(_0x2fc229['name']){delete _0x2fc229[_0x5616('0x29')];}_0x1b3051[_0x5616('0x1d')](_0x18577b)['send'](_0x2fc229);};}exports[_0x5616('0x2a')]=function(_0x5372ba,_0x57dfcc,_0xa9dbf5){if(!_0x5372ba['body'][_0x5616('0x2b')](_0x5616('0x2c'))&&!_0x5372ba[_0x5616('0x2d')]['hasOwnProperty']('TemplateId')){throw new db['Sequelize']['ValidationError'](_0x5616('0x2e'));}else{if(_0x5372ba[_0x5616('0x2d')][_0x5616('0x2b')](_0x5616('0x2f'))&&!_0x5372ba[_0x5616('0x2d')]['hasOwnProperty'](_0x5616('0x30'))){throw new db[(_0x5616('0x31'))][(_0x5616('0x32'))](_0x5616('0x33'));}if(!_0x5372ba[_0x5616('0x2d')][_0x5616('0x2b')](_0x5616('0x34'))){throw new db['Sequelize']['ValidationError'](_0x5616('0x35'));}else{try{var _0x508dd8=JSON['parse'](_0x5372ba[_0x5616('0x2d')][_0x5616('0x34')]);}catch(_0x4761db){logger[_0x5616('0x36')](_0x4761db);throw new db['Sequelize'][(_0x5616('0x32'))](_0x5616('0x37'));}var _0x53ebe2=[_0x5616('0x38'),_0x5616('0x39'),'mailqueue','openchannelqueue',_0x5616('0x3a'),_0x5616('0x3b'),'whatsappqueue',_0x5616('0x3c'),_0x5616('0x3d')];if(_[_0x5616('0x3e')](_0x508dd8,function(_0x1f2d48){return!_['includes'](_0x53ebe2,_0x1f2d48[_0x5616('0x3f')][_0x5616('0x40')]());})){throw new db[(_0x5616('0x31'))][(_0x5616('0x32'))](_0x5616('0x41'));}}}var _0x4fedc9={};_0x4fedc9[_0x5616('0x42')]=_0x5372ba[_0x5616('0x2d')][_0x5616('0x2b')]('senderName')?_0x5372ba['body'][_0x5616('0x42')]:_0x5372ba['user'][_0x5616('0x43')];_0x4fedc9[_0x5616('0x44')]=_[_0x5616('0x45')](_0x5372ba[_0x5616('0x2d')]['recipientsDescription'])?null:_0x5372ba[_0x5616('0x2d')]['recipientsDescription'];_0x4fedc9['beep']=_0x5372ba['body'][_0x5616('0x46')]||![];_0x4fedc9[_0x5616('0x47')]=_0x5372ba['user']['id'];return getContent(_0x5372ba[_0x5616('0x2d')])[_0x5616('0x26')](function(_0x47b000){_0x4fedc9[_0x5616('0x2d')]=_0x47b000;return getRecipients(_0x508dd8);})['then'](function(_0x10b611){_0x4fedc9[_0x5616('0x48')]=_[_0x5616('0x49')](_0x10b611)[_0x5616('0x4a')](',');return db[_0x5616('0x4b')][_0x5616('0x4c')](function(_0x78eafa){return db[_0x5616('0x4d')][_0x5616('0x4e')](_0x4fedc9,{'raw':!![],'transaction':_0x78eafa})[_0x5616('0x26')](function(_0x1ba602){var _0x296272={'sender':_0x4fedc9[_0x5616('0x42')],'description':_0x4fedc9[_0x5616('0x44')],'content':_0x4fedc9[_0x5616('0x2d')],'beep':_0x4fedc9[_0x5616('0x46')]};_0x10b611[_0x5616('0x4f')](function(_0x4f194d){_0x296272[_0x5616('0x50')]=_0x4f194d;socket[_0x5616('0x51')](_0x5616('0x52'),_0x296272);});return _0x1ba602;});});})[_0x5616('0x26')](respondWithResult(_0x57dfcc,0xc9))[_0x5616('0x53')](handleError(_0x57dfcc,null));};function getContent(_0x582eed){return new BPromise(function(_0x57b2bc,_0x4cb23b){if(_0x582eed['text']){_0x57b2bc(_0x582eed[_0x5616('0x2c')]);return;}return db[_0x5616('0x54')][_0x5616('0x55')]({'attributes':[_0x5616('0x56')],'where':{'id':_0x582eed[_0x5616('0x2f')]},'raw':!![]})[_0x5616('0x26')](function(_0x270656){if(!_0x270656)throw new db[(_0x5616('0x31'))][(_0x5616('0x32'))](_0x5616('0x57'));var _0x5eca6e=Mustache[_0x5616('0x58')](_0x270656['html'],_0x582eed[_0x5616('0x30')]);_0x57b2bc(_0x5eca6e);})[_0x5616('0x53')](function(_0x3f64f4){_0x4cb23b(_0x3f64f4);});});}function getRecipients(_0x2dc0f8){return new BPromise(function(_0x16145b,_0x5b2cf4){var _0x4f5d1f=[];var _0x58e5ea=[];_0x2dc0f8['forEach'](function(_0x41761d){var _0x300362=_[_0x5616('0x59')](_0x41761d[_0x5616('0x3f')][_0x5616('0x40')]());if(_0x300362==='User'){_0x4f5d1f=_[_0x5616('0x5a')](_0x4f5d1f,_0x41761d[_0x5616('0x5b')]);}else{if(_[_0x5616('0x5c')](_0x300362,_0x5616('0x5d')))_0x300362=_0x300362[_0x5616('0x5e')](_0x5616('0x5d'),_0x5616('0x5f'));_0x41761d[_0x5616('0x5b')][_0x5616('0x4f')](function(_0xebde9a){_0x58e5ea['push'](getAgents(_0x300362,_0xebde9a));});}});return BPromise[_0x5616('0x60')](_0x58e5ea)[_0x5616('0x26')](function(_0x4020cc){_0x4f5d1f=_[_0x5616('0x5a')](_0x4f5d1f,_[_0x5616('0x61')](_0x4020cc));_0x16145b(_0x4f5d1f);})['catch'](function(_0x576d47){_0x5b2cf4(_0x576d47);});});}function getAgents(_0x451ff4,_0x4bfe52){return new BPromise(function(_0x149a2f,_0x4f5e9b){return db[_0x451ff4][_0x5616('0x55')]({'where':{'id':_0x4bfe52}})[_0x5616('0x26')](function(_0x11bf9c){return _0x11bf9c['getAgents']({'attributes':['id'],'raw':!![]})[_0x5616('0x26')](function(_0xf235b){var _0x2acf67=_[_0x5616('0x62')](_0xf235b,'id');_0x149a2f(_0x2acf67);});})[_0x5616('0x53')](function(_0x5aa700){_0x4f5e9b(_0x5aa700);});});}
\ No newline at end of file
+var _0x30ed=['ValidationError','hasOwnProperty','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','voicequeue','whatsappqueue','user','some','includes','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','transaction','UserNotification','create','recipient','emit','userNotification:send','catch','findOne','html','render','view','forEach','startCase','model','User','union','ids','queue','replace','Queue','push','all','flatten','getAgents','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','status','json','offset','undefined','limit','count','set','apply','reject','update','destroy','then','end','error','stack','name','sendUserNotification','text','body','TemplateId','Sequelize'];(function(_0x57d963,_0x35edf0){var _0x4bac76=function(_0x525ef8){while(--_0x525ef8){_0x57d963['push'](_0x57d963['shift']());}};_0x4bac76(++_0x35edf0);}(_0x30ed,0x15d));var _0xd30e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x30ed[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd30e('0x0'));var zipdir=require(_0xd30e('0x1'));var jsonpatch=require(_0xd30e('0x2'));var rp=require(_0xd30e('0x3'));var moment=require(_0xd30e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd30e('0x5'));var util=require('util');var path=require('path');var sox=require(_0xd30e('0x6'));var csv=require(_0xd30e('0x7'));var ejs=require(_0xd30e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd30e('0x9'));var squel=require(_0xd30e('0xa'));var crypto=require(_0xd30e('0xb'));var jsforce=require(_0xd30e('0xc'));var deskjs=require(_0xd30e('0xd'));var toCsv=require(_0xd30e('0x7'));var querystring=require(_0xd30e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd30e('0xf'));var as=require(_0xd30e('0x10'));var hardwareService=require(_0xd30e('0x11'));var logger=require(_0xd30e('0x12'))('api');var utils=require(_0xd30e('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xd30e('0x14'));var db=require(_0xd30e('0x15'))['db'];config[_0xd30e('0x16')]=_[_0xd30e('0x17')](config[_0xd30e('0x16')],{'host':_0xd30e('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userNotification.socket')[_0xd30e('0x19')](socket);function respondWithStatusCode(_0x4a256c,_0x16c517){_0x16c517=_0x16c517||0xcc;return function(_0x46b227){if(_0x46b227){return _0x4a256c['sendStatus'](_0x16c517);}return _0x4a256c[_0xd30e('0x1a')](_0x16c517)['end']();};}function respondWithResult(_0x26ab65,_0x4e6439){_0x4e6439=_0x4e6439||0xc8;return function(_0x25904f){if(_0x25904f){return _0x26ab65['status'](_0x4e6439)[_0xd30e('0x1b')](_0x25904f);}};}function respondWithFilteredResult(_0xbd36a6,_0x19cb21){return function(_0x408daa){if(_0x408daa){var _0x681abf=typeof _0x19cb21[_0xd30e('0x1c')]===_0xd30e('0x1d')&&typeof _0x19cb21[_0xd30e('0x1e')]===_0xd30e('0x1d');var _0x115d3c=_0x408daa['count'];var _0x29200b=_0x681abf?0x0:_0x19cb21[_0xd30e('0x1c')];var _0x2ffdd9=_0x681abf?_0x408daa[_0xd30e('0x1f')]:_0x19cb21[_0xd30e('0x1c')]+_0x19cb21[_0xd30e('0x1e')];var _0x295e3a;if(_0x2ffdd9>=_0x115d3c){_0x2ffdd9=_0x115d3c;_0x295e3a=0xc8;}else{_0x295e3a=0xce;}_0xbd36a6[_0xd30e('0x1a')](_0x295e3a);return _0xbd36a6[_0xd30e('0x20')]('Content-Range',_0x29200b+'-'+_0x2ffdd9+'/'+_0x115d3c)[_0xd30e('0x1b')](_0x408daa);}return null;};}function patchUpdates(_0x1c7537){return function(_0x43017b){try{jsonpatch[_0xd30e('0x21')](_0x43017b,_0x1c7537,!![]);}catch(_0x55559f){return BPromise[_0xd30e('0x22')](_0x55559f);}return _0x43017b['save']();};}function saveUpdates(_0x36cf98,_0x4eea19){return function(_0x2a28f2){if(_0x2a28f2){return _0x2a28f2[_0xd30e('0x23')](_0x36cf98)['then'](function(_0x4e5244){return _0x4e5244;});}return null;};}function removeEntity(_0x136e4a,_0x275929){return function(_0x4be7cf){if(_0x4be7cf){return _0x4be7cf[_0xd30e('0x24')]()[_0xd30e('0x25')](function(){_0x136e4a[_0xd30e('0x1a')](0xcc)[_0xd30e('0x26')]();});}};}function handleEntityNotFound(_0x18e196,_0x43be41){return function(_0x56ade3){if(!_0x56ade3){_0x18e196['sendStatus'](0x194);}return _0x56ade3;};}function handleError(_0x423b76,_0x48a224){_0x48a224=_0x48a224||0x1f4;return function(_0x305392){logger[_0xd30e('0x27')](_0x305392[_0xd30e('0x28')]);if(_0x305392[_0xd30e('0x29')]){delete _0x305392['name'];}_0x423b76[_0xd30e('0x1a')](_0x48a224)['send'](_0x305392);};}exports[_0xd30e('0x2a')]=function(_0x56dfe7,_0x5baf59,_0x3ee151){if(!_0x56dfe7['body']['hasOwnProperty'](_0xd30e('0x2b'))&&!_0x56dfe7[_0xd30e('0x2c')]['hasOwnProperty'](_0xd30e('0x2d'))){throw new db[(_0xd30e('0x2e'))][(_0xd30e('0x2f'))]('Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27');}else{if(_0x56dfe7[_0xd30e('0x2c')][_0xd30e('0x30')](_0xd30e('0x2d'))&&!_0x56dfe7['body'][_0xd30e('0x30')]('view')){throw new db['Sequelize'][(_0xd30e('0x2f'))](_0xd30e('0x31'));}if(!_0x56dfe7[_0xd30e('0x2c')][_0xd30e('0x30')](_0xd30e('0x32'))){throw new db[(_0xd30e('0x2e'))]['ValidationError'](_0xd30e('0x33'));}else{try{var _0x725f2a=JSON[_0xd30e('0x34')](_0x56dfe7[_0xd30e('0x2c')][_0xd30e('0x32')]);}catch(_0x2f985b){logger[_0xd30e('0x27')](_0x2f985b);throw new db[(_0xd30e('0x2e'))][(_0xd30e('0x2f'))](_0xd30e('0x35'));}var _0xc72334=[_0xd30e('0x36'),_0xd30e('0x37'),_0xd30e('0x38'),_0xd30e('0x39'),'smsqueue',_0xd30e('0x3a'),_0xd30e('0x3b'),'team',_0xd30e('0x3c')];if(_[_0xd30e('0x3d')](_0x725f2a,function(_0x3a869a){return!_[_0xd30e('0x3e')](_0xc72334,_0x3a869a['model'][_0xd30e('0x3f')]());})){throw new db[(_0xd30e('0x2e'))]['ValidationError'](_0xd30e('0x40'));}}}var _0xafd79f={};_0xafd79f['senderName']=_0x56dfe7['body'][_0xd30e('0x30')](_0xd30e('0x41'))?_0x56dfe7[_0xd30e('0x2c')][_0xd30e('0x41')]:_0x56dfe7[_0xd30e('0x3c')][_0xd30e('0x42')];_0xafd79f[_0xd30e('0x43')]=_['isEmpty'](_0x56dfe7['body']['recipientsDescription'])?null:_0x56dfe7[_0xd30e('0x2c')][_0xd30e('0x43')];_0xafd79f[_0xd30e('0x44')]=_0x56dfe7['body']['beep']||![];_0xafd79f[_0xd30e('0x45')]=_0x56dfe7[_0xd30e('0x3c')]['id'];return getContent(_0x56dfe7[_0xd30e('0x2c')])['then'](function(_0x4264ed){_0xafd79f[_0xd30e('0x2c')]=_0x4264ed;return getRecipients(_0x725f2a);})[_0xd30e('0x25')](function(_0x5e9a76){_0xafd79f[_0xd30e('0x46')]=_[_0xd30e('0x47')](_0x5e9a76)[_0xd30e('0x48')](',');return db[_0xd30e('0x49')][_0xd30e('0x4a')](function(_0x164e30){return db[_0xd30e('0x4b')][_0xd30e('0x4c')](_0xafd79f,{'raw':!![],'transaction':_0x164e30})[_0xd30e('0x25')](function(_0x44f448){var _0x48868b={'sender':_0xafd79f[_0xd30e('0x41')],'description':_0xafd79f[_0xd30e('0x43')],'content':_0xafd79f[_0xd30e('0x2c')],'beep':_0xafd79f[_0xd30e('0x44')]};_0x5e9a76['forEach'](function(_0x418fe9){_0x48868b[_0xd30e('0x4d')]=_0x418fe9;socket[_0xd30e('0x4e')](_0xd30e('0x4f'),_0x48868b);});return _0x44f448;});});})[_0xd30e('0x25')](respondWithResult(_0x5baf59,0xc9))[_0xd30e('0x50')](handleError(_0x5baf59,null));};function getContent(_0x344da9){return new BPromise(function(_0x4d34bb,_0x12e1a8){if(_0x344da9['text']){_0x4d34bb(_0x344da9[_0xd30e('0x2b')]);return;}return db['Template'][_0xd30e('0x51')]({'attributes':[_0xd30e('0x52')],'where':{'id':_0x344da9['TemplateId']},'raw':!![]})[_0xd30e('0x25')](function(_0x20ce1b){if(!_0x20ce1b)throw new db[(_0xd30e('0x2e'))]['ValidationError']('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x2b15bd=Mustache[_0xd30e('0x53')](_0x20ce1b[_0xd30e('0x52')],_0x344da9[_0xd30e('0x54')]);_0x4d34bb(_0x2b15bd);})[_0xd30e('0x50')](function(_0x24c05d){_0x12e1a8(_0x24c05d);});});}function getRecipients(_0x795bf){return new BPromise(function(_0x11e4f6,_0x29ce33){var _0x150b84=[];var _0x5647c8=[];_0x795bf[_0xd30e('0x55')](function(_0x371910){var _0x31e246=_[_0xd30e('0x56')](_0x371910[_0xd30e('0x57')]['toLowerCase']());if(_0x31e246===_0xd30e('0x58')){_0x150b84=_[_0xd30e('0x59')](_0x150b84,_0x371910[_0xd30e('0x5a')]);}else{if(_['includes'](_0x31e246,_0xd30e('0x5b')))_0x31e246=_0x31e246[_0xd30e('0x5c')]('queue',_0xd30e('0x5d'));_0x371910[_0xd30e('0x5a')]['forEach'](function(_0x793156){_0x5647c8[_0xd30e('0x5e')](getAgents(_0x31e246,_0x793156));});}});return BPromise[_0xd30e('0x5f')](_0x5647c8)[_0xd30e('0x25')](function(_0x5da492){_0x150b84=_[_0xd30e('0x59')](_0x150b84,_[_0xd30e('0x60')](_0x5da492));_0x11e4f6(_0x150b84);})[_0xd30e('0x50')](function(_0x18d550){_0x29ce33(_0x18d550);});});}function getAgents(_0x3475aa,_0x1a6f5e){return new BPromise(function(_0x23797f,_0x2c54ac){return db[_0x3475aa][_0xd30e('0x51')]({'where':{'id':_0x1a6f5e}})[_0xd30e('0x25')](function(_0x49d83c){return _0x49d83c[_0xd30e('0x61')]({'attributes':['id'],'raw':!![]})[_0xd30e('0x25')](function(_0xc7c0b5){var _0x113f8f=_[_0xd30e('0x62')](_0xc7c0b5,'id');_0x23797f(_0x113f8f);});})[_0xd30e('0x50')](function(_0x6958ac){_0x2c54ac(_0x6958ac);});});}
\ No newline at end of file
index 71d02d8..fa83eb9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7935=['events','../../mysqldb','UserNotification','setMaxListeners','save','update','emit','hasOwnProperty','exports'];(function(_0x54e8a3,_0x25653d){var _0x332fca=function(_0x3b456d){while(--_0x3b456d){_0x54e8a3['push'](_0x54e8a3['shift']());}};_0x332fca(++_0x25653d);}(_0x7935,0x1c2));var _0x5793=function(_0xdac678,_0x5d1714){_0xdac678=_0xdac678-0x0;var _0x92c2fe=_0x7935[_0xdac678];return _0x92c2fe;};'use strict';var EventEmitter=require(_0x5793('0x0'));var UserNotification=require(_0x5793('0x1'))['db'][_0x5793('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x5793('0x3')](0x0);var events={'afterCreate':_0x5793('0x4'),'afterUpdate':_0x5793('0x5'),'afterDestroy':'remove'};function emitEvent(_0x356011){return function(_0x2b851a,_0x3631f3,_0x3732a2){UserNotificationEvents[_0x5793('0x6')](_0x356011+':'+_0x2b851a['id'],_0x2b851a);UserNotificationEvents['emit'](_0x356011,_0x2b851a);_0x3732a2(null);};}for(var e in events){if(events[_0x5793('0x7')](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0x5793('0x8')]=UserNotificationEvents;
\ No newline at end of file
+var _0xe855=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x108277,_0x5cb662){var _0xf71a38=function(_0x110b76){while(--_0x110b76){_0x108277['push'](_0x108277['shift']());}};_0xf71a38(++_0x5cb662);}(_0xe855,0x1d1));var _0x5e85=function(_0x4903c0,_0x799d24){_0x4903c0=_0x4903c0-0x0;var _0x33cbf2=_0xe855[_0x4903c0];return _0x33cbf2;};'use strict';var EventEmitter=require('events');var UserNotification=require(_0x5e85('0x0'))['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x5e85('0x1')](0x0);var events={'afterCreate':_0x5e85('0x2'),'afterUpdate':_0x5e85('0x3'),'afterDestroy':_0x5e85('0x4')};function emitEvent(_0x19335a){return function(_0x21ecad,_0x8be7e3,_0x4cb7ce){UserNotificationEvents[_0x5e85('0x5')](_0x19335a+':'+_0x21ecad['id'],_0x21ecad);UserNotificationEvents[_0x5e85('0x5')](_0x19335a,_0x21ecad);_0x4cb7ce(null);};}for(var e in events){if(events[_0x5e85('0x6')](e)){var event=events[e];UserNotification[_0x5e85('0x7')](e,emitEvent(event));}}module[_0x5e85('0x8')]=UserNotificationEvents;
\ No newline at end of file
index ed661d5..353c3b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1b7=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','./userNotification.attributes','define','UserNotification','userNotifications','utf8mb4'];(function(_0x557886,_0x525a5e){var _0x3026ba=function(_0x212587){while(--_0x212587){_0x557886['push'](_0x557886['shift']());}};_0x3026ba(++_0x525a5e);}(_0xd1b7,0x9b));var _0x7d1b=function(_0x243a85,_0x1272cc){_0x243a85=_0x243a85-0x0;var _0x5c7f4a=_0xd1b7[_0x243a85];return _0x5c7f4a;};'use strict';var _=require(_0x7d1b('0x0'));var util=require(_0x7d1b('0x1'));var logger=require(_0x7d1b('0x2'))(_0x7d1b('0x3'));var moment=require(_0x7d1b('0x4'));var BPromise=require(_0x7d1b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d1b('0x6'));var rimraf=require(_0x7d1b('0x7'));var config=require('../../config/environment');var attributes=require(_0x7d1b('0x8'));module['exports']=function(_0x5b9b08,_0x4e28ae){return _0x5b9b08[_0x7d1b('0x9')](_0x7d1b('0xa'),attributes,{'tableName':_0x7d1b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7d1b('0xc'),'collate':_0x7d1b('0xd')});};
\ No newline at end of file
+var _0xc03e=['util','../../config/logger','api','bluebird','rimraf','../../config/environment','./userNotification.attributes','exports','UserNotification','userNotifications','utf8mb4_unicode_ci'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xc03e,0xdc));var _0xec03=function(_0x38b14f,_0xd08fa8){_0x38b14f=_0x38b14f-0x0;var _0x22a324=_0xc03e[_0x38b14f];return _0x22a324;};'use strict';var _=require('lodash');var util=require(_0xec03('0x0'));var logger=require(_0xec03('0x1'))(_0xec03('0x2'));var moment=require('moment');var BPromise=require(_0xec03('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xec03('0x4'));var config=require(_0xec03('0x5'));var attributes=require(_0xec03('0x6'));module[_0xec03('0x7')]=function(_0x1c2393,_0x1b91a8){return _0x1c2393['define'](_0xec03('0x8'),attributes,{'tableName':_0xec03('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xec03('0xa')});};
\ No newline at end of file
index 588706a..b60e384 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdd92=['UserNotification,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./userNotification.socket','register','request','info','UserNotification,\x20%s,\x20%s','request\x20sent'];(function(_0x2650e9,_0xb91cc){var _0x3511c8=function(_0x5069cf){while(--_0x5069cf){_0x2650e9['push'](_0x2650e9['shift']());}};_0x3511c8(++_0xb91cc);}(_0xdd92,0x82));var _0x2dd9=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0xdd92[_0xda464c];return _0x19e222;};'use strict';var _=require('lodash');var util=require(_0x2dd9('0x0'));var moment=require(_0x2dd9('0x1'));var BPromise=require('bluebird');var rs=require(_0x2dd9('0x2'));var fs=require('fs');var Redis=require(_0x2dd9('0x3'));var db=require(_0x2dd9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2dd9('0x5'))(_0x2dd9('0x6'));var config=require(_0x2dd9('0x7'));var jayson=require(_0x2dd9('0x8'));var client=jayson[_0x2dd9('0x9')][_0x2dd9('0xa')]({'port':0x232a});config['redis']=_[_0x2dd9('0xb')](config[_0x2dd9('0xc')],{'host':_0x2dd9('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2dd9('0xc')]));require(_0x2dd9('0xe'))[_0x2dd9('0xf')](socket);function respondWithRpcPromise(_0x281d4f,_0x336431,_0x30e0fd){return new BPromise(function(_0x3c0127,_0x2e95e8){return client[_0x2dd9('0x10')](_0x281d4f,_0x30e0fd)['then'](function(_0x4a5a4e){logger[_0x2dd9('0x11')](_0x2dd9('0x12'),_0x336431,_0x2dd9('0x13'));logger['debug'](_0x2dd9('0x14'),_0x336431,'request\x20sent',JSON['stringify'](_0x4a5a4e));if(_0x4a5a4e['error']){if(_0x4a5a4e[_0x2dd9('0x15')][_0x2dd9('0x16')]===0x1f4){logger[_0x2dd9('0x15')](_0x2dd9('0x12'),_0x336431,_0x4a5a4e['error'][_0x2dd9('0x17')]);return _0x2e95e8(_0x4a5a4e[_0x2dd9('0x15')][_0x2dd9('0x17')]);}logger[_0x2dd9('0x15')]('UserNotification,\x20%s,\x20%s',_0x336431,_0x4a5a4e[_0x2dd9('0x15')][_0x2dd9('0x17')]);return _0x3c0127(_0x4a5a4e[_0x2dd9('0x15')][_0x2dd9('0x17')]);}else{logger['info'](_0x2dd9('0x12'),_0x336431,'request\x20sent');_0x3c0127(_0x4a5a4e['result'][_0x2dd9('0x17')]);}})[_0x2dd9('0x18')](function(_0x56379c){logger[_0x2dd9('0x15')]('UserNotification,\x20%s,\x20%s',_0x336431,_0x56379c);_0x2e95e8(_0x56379c);});});}
\ No newline at end of file
+var _0x6901=['client','http','redis','request','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x92713a,_0x68f8b0){var _0x1893e1=function(_0xe49768){while(--_0xe49768){_0x92713a['push'](_0x92713a['shift']());}};_0x1893e1(++_0x68f8b0);}(_0x6901,0x9e));var _0x1690=function(_0x2a1c35,_0x252c87){_0x2a1c35=_0x2a1c35-0x0;var _0x496fa3=_0x6901[_0x2a1c35];return _0x496fa3;};'use strict';var _=require(_0x1690('0x0'));var util=require(_0x1690('0x1'));var moment=require(_0x1690('0x2'));var BPromise=require(_0x1690('0x3'));var rs=require(_0x1690('0x4'));var fs=require('fs');var Redis=require(_0x1690('0x5'));var db=require(_0x1690('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1690('0x7'))(_0x1690('0x8'));var config=require(_0x1690('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1690('0xa')][_0x1690('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x1690('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x7e2f03,_0x740aa4,_0x25f4eb){return new BPromise(function(_0x490e39,_0x463e24){return client[_0x1690('0xd')](_0x7e2f03,_0x25f4eb)['then'](function(_0x26ee12){logger[_0x1690('0xe')](_0x1690('0xf'),_0x740aa4,_0x1690('0x10'));logger[_0x1690('0x11')](_0x1690('0x12'),_0x740aa4,_0x1690('0x10'),JSON[_0x1690('0x13')](_0x26ee12));if(_0x26ee12[_0x1690('0x14')]){if(_0x26ee12[_0x1690('0x14')][_0x1690('0x15')]===0x1f4){logger[_0x1690('0x14')](_0x1690('0xf'),_0x740aa4,_0x26ee12[_0x1690('0x14')]['message']);return _0x463e24(_0x26ee12[_0x1690('0x14')][_0x1690('0x16')]);}logger[_0x1690('0x14')]('UserNotification,\x20%s,\x20%s',_0x740aa4,_0x26ee12[_0x1690('0x14')][_0x1690('0x16')]);return _0x490e39(_0x26ee12[_0x1690('0x14')][_0x1690('0x16')]);}else{logger[_0x1690('0xe')](_0x1690('0xf'),_0x740aa4,_0x1690('0x10'));_0x490e39(_0x26ee12[_0x1690('0x17')][_0x1690('0x16')]);}})['catch'](function(_0x2b0e57){logger[_0x1690('0x14')]('UserNotification,\x20%s,\x20%s',_0x740aa4,_0x2b0e57);_0x463e24(_0x2b0e57);});});}
\ No newline at end of file
index fa3f7e9..131fc7f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7af=['update','emit','register','userNotification:','./userNotification.events','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd7af,0xac));var _0xfd7a=function(_0x29d05d,_0x458c96){_0x29d05d=_0x29d05d-0x0;var _0x386037=_0xd7af[_0x29d05d];return _0x386037;};'use strict';var UserNotificationEvents=require(_0xfd7a('0x0'));var events=[_0xfd7a('0x1'),_0xfd7a('0x2'),_0xfd7a('0x3')];function createListener(_0x1ba025,_0x21169c){return function(_0x4560d3){_0x21169c[_0xfd7a('0x4')](_0x1ba025,_0x4560d3);};}function removeListener(_0x443781,_0x41d6b0){return function(){UserNotificationEvents['removeListener'](_0x443781,_0x41d6b0);};}exports[_0xfd7a('0x5')]=function(_0x2f927f){for(var _0x4da5bb=0x0,_0xd01ca7=events['length'];_0x4da5bb<_0xd01ca7;_0x4da5bb++){var _0x5a3c64=events[_0x4da5bb];var _0x5a282a=createListener(_0xfd7a('0x6')+_0x5a3c64,_0x2f927f);UserNotificationEvents['on'](_0x5a3c64,_0x5a282a);}};
\ No newline at end of file
+var _0x48f9=['userNotification:','./userNotification.events','save','emit','removeListener','register'];(function(_0x97c6ea,_0x4cffce){var _0x2d7f50=function(_0x54010e){while(--_0x54010e){_0x97c6ea['push'](_0x97c6ea['shift']());}};_0x2d7f50(++_0x4cffce);}(_0x48f9,0x157));var _0x948f=function(_0x3d7731,_0x53637f){_0x3d7731=_0x3d7731-0x0;var _0x5da7aa=_0x48f9[_0x3d7731];return _0x5da7aa;};'use strict';var UserNotificationEvents=require(_0x948f('0x0'));var events=[_0x948f('0x1'),'remove','update'];function createListener(_0x5a2287,_0x1aff70){return function(_0x3cb842){_0x1aff70[_0x948f('0x2')](_0x5a2287,_0x3cb842);};}function removeListener(_0x13a850,_0x1c7a0d){return function(){UserNotificationEvents[_0x948f('0x3')](_0x13a850,_0x1c7a0d);};}exports[_0x948f('0x4')]=function(_0x317eba){for(var _0x32ccd4=0x0,_0x269495=events['length'];_0x32ccd4<_0x269495;_0x32ccd4++){var _0x43e407=events[_0x32ccd4];var _0x1c7377=createListener(_0x948f('0x5')+_0x43e407,_0x317eba);UserNotificationEvents['on'](_0x43e407,_0x1c7377);}};
\ No newline at end of file
index 3c90a6e..bdbc78b 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(_0x1347f8,_0x233feb){var _0x218368=function(_0x3f4ca3){while(--_0x3f4ca3){_0x1347f8['push'](_0x1347f8['shift']());}};_0x218368(++_0x233feb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router;
\ No newline at end of file
+var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x534dd3,_0x1e2ade){var _0x48d5b2=function(_0x2f834e){while(--_0x2f834e){_0x534dd3['push'](_0x534dd3['shift']());}};_0x48d5b2(++_0x1e2ade);}(_0x70e0,0x17b));var _0x070e=function(_0x36f34b,_0x472ab5){_0x36f34b=_0x36f34b-0x0;var _0x4c7ba3=_0x70e0[_0x36f34b];return _0x4c7ba3;};'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 f722c56..cae1568 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe66d=['exports','sequelize'];(function(_0x294bd2,_0x3bee98){var _0x2c1244=function(_0x498844){while(--_0x498844){_0x294bd2['push'](_0x294bd2['shift']());}};_0x2c1244(++_0x3bee98);}(_0xe66d,0xfb));var _0xde66=function(_0xf8886b,_0x504891){_0xf8886b=_0xf8886b-0x0;var _0x321bd5=_0xe66d[_0xf8886b];return _0x321bd5;};'use strict';var Sequelize=require(_0xde66('0x0'));module[_0xde66('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x032b=['exports'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x032b,0x183));var _0xb032=function(_0xeb67cb,_0x3facda){_0xeb67cb=_0xeb67cb-0x0;var _0xc8fe96=_0x032b[_0xeb67cb];return _0xc8fe96;};'use strict';var Sequelize=require('sequelize');module[_0xb032('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index fc970b9..39a6608 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x423b=['rimraf','../../config/environment','exports','define','UserOpenchannelQueue','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1ee051,_0x417c1a){var _0x5b5fea=function(_0x77777f){while(--_0x77777f){_0x1ee051['push'](_0x1ee051['shift']());}};_0x5b5fea(++_0x417c1a);}(_0x423b,0xad));var _0xb423=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0x423b[_0x556bb1];return _0x45455f;};'use strict';var _=require('lodash');var util=require(_0xb423('0x0'));var logger=require(_0xb423('0x1'))(_0xb423('0x2'));var moment=require(_0xb423('0x3'));var BPromise=require(_0xb423('0x4'));var rp=require(_0xb423('0x5'));var fs=require('fs');var path=require(_0xb423('0x6'));var rimraf=require(_0xb423('0x7'));var config=require(_0xb423('0x8'));var attributes=require('./userOpenchannelQueue.attributes');module[_0xb423('0x9')]=function(_0x1c1bd5,_0x547e37){return _0x1c1bd5[_0xb423('0xa')](_0xb423('0xb'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xebe1=['define','UserOpenchannelQueue','lodash','../../config/logger','api','bluebird','request-promise','./userOpenchannelQueue.attributes','exports'];(function(_0x541a67,_0x50728d){var _0x45da2a=function(_0x158929){while(--_0x158929){_0x541a67['push'](_0x541a67['shift']());}};_0x45da2a(++_0x50728d);}(_0xebe1,0xfe));var _0x1ebe=function(_0x5d2d9c,_0x56b942){_0x5d2d9c=_0x5d2d9c-0x0;var _0x25b6b8=_0xebe1[_0x5d2d9c];return _0x25b6b8;};'use strict';var _=require(_0x1ebe('0x0'));var util=require('util');var logger=require(_0x1ebe('0x1'))(_0x1ebe('0x2'));var moment=require('moment');var BPromise=require(_0x1ebe('0x3'));var rp=require(_0x1ebe('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1ebe('0x5'));module[_0x1ebe('0x6')]=function(_0x52360e,_0x32e830){return _0x52360e[_0x1ebe('0x7')](_0x1ebe('0x8'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index d332fc2..4ccfeac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0520=['request\x20sent','debug','stringify','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','info'];(function(_0x1275da,_0x49bb85){var _0x58c058=function(_0x5db789){while(--_0x5db789){_0x1275da['push'](_0x1275da['shift']());}};_0x58c058(++_0x49bb85);}(_0x0520,0x184));var _0x0052=function(_0x3b2537,_0x20b0df){_0x3b2537=_0x3b2537-0x0;var _0x567752=_0x0520[_0x3b2537];return _0x567752;};'use strict';var _=require(_0x0052('0x0'));var util=require('util');var moment=require(_0x0052('0x1'));var BPromise=require(_0x0052('0x2'));var rs=require(_0x0052('0x3'));var fs=require('fs');var Redis=require(_0x0052('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0052('0x5'));var logger=require(_0x0052('0x6'))(_0x0052('0x7'));var config=require(_0x0052('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0052('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35f81f,_0x7a812b,_0x6d32ed){return new BPromise(function(_0x3e5e19,_0x5dd997){return client[_0x0052('0xa')](_0x35f81f,_0x6d32ed)['then'](function(_0x5d46a1){logger[_0x0052('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x7a812b,_0x0052('0xc'));logger[_0x0052('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x7a812b,_0x0052('0xc'),JSON[_0x0052('0xe')](_0x5d46a1));if(_0x5d46a1[_0x0052('0xf')]){if(_0x5d46a1['error'][_0x0052('0x10')]===0x1f4){logger[_0x0052('0xf')](_0x0052('0x11'),_0x7a812b,_0x5d46a1['error'][_0x0052('0x12')]);return _0x5dd997(_0x5d46a1[_0x0052('0xf')][_0x0052('0x12')]);}logger[_0x0052('0xf')](_0x0052('0x11'),_0x7a812b,_0x5d46a1[_0x0052('0xf')][_0x0052('0x12')]);return _0x3e5e19(_0x5d46a1[_0x0052('0xf')][_0x0052('0x12')]);}else{logger[_0x0052('0xb')](_0x0052('0x11'),_0x7a812b,_0x0052('0xc'));_0x3e5e19(_0x5d46a1[_0x0052('0x13')]['message']);}})['catch'](function(_0x477f9c){logger['error'](_0x0052('0x11'),_0x7a812b,_0x477f9c);_0x5dd997(_0x477f9c);});});}
\ No newline at end of file
+var _0xd35c=['request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x5ef9a6,_0x3f0c41){var _0x52161d=function(_0x18504f){while(--_0x18504f){_0x5ef9a6['push'](_0x5ef9a6['shift']());}};_0x52161d(++_0x3f0c41);}(_0xd35c,0x1c4));var _0xcd35=function(_0x3f0ead,_0x449285){_0x3f0ead=_0x3f0ead-0x0;var _0x598263=_0xd35c[_0x3f0ead];return _0x598263;};'use strict';var _=require(_0xcd35('0x0'));var util=require('util');var moment=require(_0xcd35('0x1'));var BPromise=require(_0xcd35('0x2'));var rs=require(_0xcd35('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd35('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcd35('0x5'))(_0xcd35('0x6'));var config=require(_0xcd35('0x7'));var jayson=require(_0xcd35('0x8'));var client=jayson['client'][_0xcd35('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5bd9f1,_0xd3769e,_0x4ef307){return new BPromise(function(_0x1f9180,_0xe37147){return client[_0xcd35('0xa')](_0x5bd9f1,_0x4ef307)[_0xcd35('0xb')](function(_0x316a30){logger[_0xcd35('0xc')](_0xcd35('0xd'),_0xd3769e,_0xcd35('0xe'));logger[_0xcd35('0xf')](_0xcd35('0x10'),_0xd3769e,_0xcd35('0xe'),JSON['stringify'](_0x316a30));if(_0x316a30[_0xcd35('0x11')]){if(_0x316a30[_0xcd35('0x11')][_0xcd35('0x12')]===0x1f4){logger[_0xcd35('0x11')](_0xcd35('0xd'),_0xd3769e,_0x316a30[_0xcd35('0x11')][_0xcd35('0x13')]);return _0xe37147(_0x316a30[_0xcd35('0x11')][_0xcd35('0x13')]);}logger[_0xcd35('0x11')](_0xcd35('0xd'),_0xd3769e,_0x316a30[_0xcd35('0x11')][_0xcd35('0x13')]);return _0x1f9180(_0x316a30[_0xcd35('0x11')][_0xcd35('0x13')]);}else{logger[_0xcd35('0xc')](_0xcd35('0xd'),_0xd3769e,_0xcd35('0xe'));_0x1f9180(_0x316a30['result'][_0xcd35('0x13')]);}})[_0xcd35('0x14')](function(_0x291073){logger[_0xcd35('0x11')](_0xcd35('0xd'),_0xd3769e,_0x291073);_0xe37147(_0x291073);});});}
\ No newline at end of file
index 06306aa..ed4a5b5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c61=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id/sections','post','/:id/clone','clone','/:id/resources','addResources','put','update','delete','/:id','removeSections','removeResources','exports','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c61,0x141));var _0x12c6=function(_0x2ce2bb,_0x5b3eb2){_0x2ce2bb=_0x2ce2bb-0x0;var _0x50aaba=_0x2c61[_0x2ce2bb];return _0x50aaba;};'use strict';var multer=require(_0x12c6('0x0'));var util=require(_0x12c6('0x1'));var path=require(_0x12c6('0x2'));var timeout=require('connect-timeout');var express=require(_0x12c6('0x3'));var router=express[_0x12c6('0x4')]();var fs_extra=require(_0x12c6('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x12c6('0x6'));var config=require(_0x12c6('0x7'));var controller=require(_0x12c6('0x8'));router[_0x12c6('0x9')]('/',auth[_0x12c6('0xa')](),controller[_0x12c6('0xb')]);router['get'](_0x12c6('0xc'),auth[_0x12c6('0xa')](),controller[_0x12c6('0xd')]);router['get']('/:id',auth[_0x12c6('0xa')](),controller['show']);router[_0x12c6('0x9')](_0x12c6('0xe'),auth['isAuthenticated'](),controller['getSections']);router['get']('/:id/resources',auth[_0x12c6('0xa')](),controller['getResources']);router[_0x12c6('0xf')]('/',auth[_0x12c6('0xa')](),controller['create']);router[_0x12c6('0xf')](_0x12c6('0x10'),auth[_0x12c6('0xa')](),controller[_0x12c6('0x11')]);router[_0x12c6('0xf')](_0x12c6('0xe'),auth['isAuthenticated'](),controller['addSections']);router[_0x12c6('0xf')](_0x12c6('0x12'),auth[_0x12c6('0xa')](),controller[_0x12c6('0x13')]);router[_0x12c6('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x12c6('0x15')]);router[_0x12c6('0x16')](_0x12c6('0x17'),auth[_0x12c6('0xa')](),controller['destroy']);router[_0x12c6('0x16')](_0x12c6('0xe'),auth[_0x12c6('0xa')](),controller[_0x12c6('0x18')]);router[_0x12c6('0x16')]('/:id/resources',auth[_0x12c6('0xa')](),controller[_0x12c6('0x19')]);module[_0x12c6('0x1a')]=router;
\ No newline at end of file
+var _0xc125=['get','/:id/sections','post','create','/:id/clone','clone','addSections','put','update','delete','/:id/resources','exports','path','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x5b0f29,_0x3d6f36){var _0x27a26a=function(_0x4d44b3){while(--_0x4d44b3){_0x5b0f29['push'](_0x5b0f29['shift']());}};_0x27a26a(++_0x3d6f36);}(_0xc125,0x6c));var _0x5c12=function(_0x3bc57a,_0x1eabdd){_0x3bc57a=_0x3bc57a-0x0;var _0x3d915c=_0xc125[_0x3bc57a];return _0x3d915c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5c12('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5c12('0x1')]();var fs_extra=require(_0x5c12('0x2'));var auth=require(_0x5c12('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x5c12('0x4'));var controller=require(_0x5c12('0x5'));router['get']('/',auth[_0x5c12('0x6')](),controller[_0x5c12('0x7')]);router['get'](_0x5c12('0x8'),auth[_0x5c12('0x6')](),controller[_0x5c12('0x9')]);router['get'](_0x5c12('0xa'),auth['isAuthenticated'](),controller[_0x5c12('0xb')]);router[_0x5c12('0xc')](_0x5c12('0xd'),auth[_0x5c12('0x6')](),controller['getSections']);router[_0x5c12('0xc')]('/:id/resources',auth[_0x5c12('0x6')](),controller['getResources']);router[_0x5c12('0xe')]('/',auth[_0x5c12('0x6')](),controller[_0x5c12('0xf')]);router[_0x5c12('0xe')](_0x5c12('0x10'),auth[_0x5c12('0x6')](),controller[_0x5c12('0x11')]);router[_0x5c12('0xe')]('/:id/sections',auth[_0x5c12('0x6')](),controller[_0x5c12('0x12')]);router[_0x5c12('0xe')]('/:id/resources',auth[_0x5c12('0x6')](),controller['addResources']);router[_0x5c12('0x13')]('/:id',auth[_0x5c12('0x6')](),controller[_0x5c12('0x14')]);router[_0x5c12('0x15')](_0x5c12('0xa'),auth[_0x5c12('0x6')](),controller['destroy']);router[_0x5c12('0x15')](_0x5c12('0xd'),auth[_0x5c12('0x6')](),controller['removeSections']);router[_0x5c12('0x15')](_0x5c12('0x16'),auth[_0x5c12('0x6')](),controller['removeResources']);module[_0x5c12('0x17')]=router;
\ No newline at end of file
index a7419a9..9097349 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d21=['exports','name','setDataValue','crudPermissions','join','getDataValue','STRING','BOOLEAN','sequelize'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4d21,0xc5));var _0x14d2=function(_0x5b87ce,_0x20b7f6){_0x5b87ce=_0x5b87ce-0x0;var _0x597aa7=_0x4d21[_0x5b87ce];return _0x597aa7;};'use strict';var Sequelize=require(_0x14d2('0x0'));module[_0x14d2('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x14d2('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x2e666d){this[_0x14d2('0x3')](_0x14d2('0x4'),_0x2e666d?_0x2e666d[_0x14d2('0x5')](''):[]);},'get':function(){return this[_0x14d2('0x6')](_0x14d2('0x4'))?this[_0x14d2('0x6')](_0x14d2('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x14d2('0x7')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x14d2('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x14d2('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x14d2('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x14d2('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0x1ddd=['name','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN','sequelize','STRING'];(function(_0x3c7f95,_0x15e573){var _0x5184b5=function(_0x33627f){while(--_0x33627f){_0x3c7f95['push'](_0x3c7f95['shift']());}};_0x5184b5(++_0x15e573);}(_0x1ddd,0x19c));var _0xd1dd=function(_0x101500,_0x5a1040){_0x101500=_0x101500-0x0;var _0x26311f=_0x1ddd[_0x101500];return _0x26311f;};'use strict';var Sequelize=require(_0xd1dd('0x0'));module['exports']={'name':{'type':Sequelize[_0xd1dd('0x1')],'allowNull':![],'unique':_0xd1dd('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x467fe3){this[_0xd1dd('0x3')](_0xd1dd('0x4'),_0x467fe3?_0x467fe3[_0xd1dd('0x5')](''):[]);},'get':function(){return this[_0xd1dd('0x6')](_0xd1dd('0x4'))?this[_0xd1dd('0x6')](_0xd1dd('0x4'))[_0xd1dd('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xd1dd('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xd1dd('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xd1dd('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xd1dd('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xd1dd('0x8')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xd1dd('0x8')],'defaultValue':!![]}};
\ No newline at end of file
index 80e3673..33679a9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96d8=['removeResources','section','Missing\x20section\x20parameter','hasOwnProperty','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','localhost','redis','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','error','stack','name','send','index','UserProfile','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','filter','where','VIRTUAL','merge','options','then','includeAll','findAll','rows','catch','params','include','find','create','body','clone','rawAttributes','get','omit','updatedAt','createdAt','sequelize','UserProfileResource','sectionId','userProfileId','Resources','update','describe','addSections','UserProfileSection','destroy','each','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','resourceId','autoAssociation','Plugin','addResources','bulkCreate'];(function(_0x2338fa,_0x80579a){var _0x42df9b=function(_0x13fe56){while(--_0x13fe56){_0x2338fa['push'](_0x2338fa['shift']());}};_0x42df9b(++_0x80579a);}(_0x96d8,0x1e2));var _0x896d=function(_0x2a6318,_0x2c94c0){_0x2a6318=_0x2a6318-0x0;var _0x1e782b=_0x96d8[_0x2a6318];return _0x1e782b;};'use strict';var emlformat=require(_0x896d('0x0'));var rimraf=require(_0x896d('0x1'));var zipdir=require(_0x896d('0x2'));var jsonpatch=require(_0x896d('0x3'));var rp=require(_0x896d('0x4'));var moment=require(_0x896d('0x5'));var BPromise=require(_0x896d('0x6'));var Mustache=require(_0x896d('0x7'));var util=require(_0x896d('0x8'));var path=require(_0x896d('0x9'));var sox=require(_0x896d('0xa'));var csv=require(_0x896d('0xb'));var ejs=require(_0x896d('0xc'));var fs=require('fs');var fs_extra=require(_0x896d('0xd'));var _=require('lodash');var squel=require(_0x896d('0xe'));var crypto=require(_0x896d('0xf'));var jsforce=require(_0x896d('0x10'));var deskjs=require(_0x896d('0x11'));var toCsv=require(_0x896d('0xb'));var querystring=require(_0x896d('0x12'));var Papa=require(_0x896d('0x13'));var Redis=require(_0x896d('0x14'));var authService=require('../../components/auth/service');var qs=require(_0x896d('0x15'));var as=require(_0x896d('0x16'));var hardwareService=require(_0x896d('0x17'));var logger=require(_0x896d('0x18'))(_0x896d('0x19'));var utils=require('../../config/utils');var config=require(_0x896d('0x1a'));var licenseUtil=require(_0x896d('0x1b'));var db=require(_0x896d('0x1c'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x896d('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x896d('0x1e')]));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x10cf46,_0x10d472){_0x10d472=_0x10d472||0xcc;return function(_0x5a3674){if(_0x5a3674){return _0x10cf46[_0x896d('0x1f')](_0x10d472);}return _0x10cf46[_0x896d('0x20')](_0x10d472)[_0x896d('0x21')]();};}function respondWithResult(_0x332eba,_0x1cd959){_0x1cd959=_0x1cd959||0xc8;return function(_0x28514a){if(_0x28514a){return _0x332eba[_0x896d('0x20')](_0x1cd959)[_0x896d('0x22')](_0x28514a);}};}function respondWithFilteredResult(_0x28be1e,_0x50c5ff){return function(_0x34732b){if(_0x34732b){var _0x26d64e=typeof _0x50c5ff['offset']===_0x896d('0x23')&&typeof _0x50c5ff[_0x896d('0x24')]===_0x896d('0x23');var _0x598cd9=_0x34732b[_0x896d('0x25')];var _0x446838=_0x26d64e?0x0:_0x50c5ff[_0x896d('0x26')];var _0xa41442=_0x26d64e?_0x34732b['count']:_0x50c5ff[_0x896d('0x26')]+_0x50c5ff[_0x896d('0x24')];var _0x3e626a;if(_0xa41442>=_0x598cd9){_0xa41442=_0x598cd9;_0x3e626a=0xc8;}else{_0x3e626a=0xce;}_0x28be1e[_0x896d('0x20')](_0x3e626a);return _0x28be1e[_0x896d('0x27')](_0x896d('0x28'),_0x446838+'-'+_0xa41442+'/'+_0x598cd9)[_0x896d('0x22')](_0x34732b);}return null;};}function patchUpdates(_0x235bbc){return function(_0xdf2542){try{jsonpatch[_0x896d('0x29')](_0xdf2542,_0x235bbc,!![]);}catch(_0x4c8264){return BPromise[_0x896d('0x2a')](_0x4c8264);}return _0xdf2542[_0x896d('0x2b')]();};}function saveUpdates(_0x2d550c,_0xcd926){return function(_0x262e6a){if(_0x262e6a){return _0x262e6a['update'](_0x2d550c)['then'](function(_0x1ed355){return _0x1ed355;});}return null;};}function removeEntity(_0x5acbea,_0x49985f){return function(_0x46e762){if(_0x46e762){return _0x46e762['destroy']()['then'](function(){_0x5acbea[_0x896d('0x20')](0xcc)[_0x896d('0x21')]();});}};}function handleEntityNotFound(_0x36a04e,_0x2a58a4){return function(_0x2b3d4){if(!_0x2b3d4){_0x36a04e[_0x896d('0x1f')](0x194);}return _0x2b3d4;};}function handleError(_0x1428a3,_0x5ecab6){_0x5ecab6=_0x5ecab6||0x1f4;return function(_0x390b16){logger[_0x896d('0x2c')](_0x390b16[_0x896d('0x2d')]);if(_0x390b16[_0x896d('0x2e')]){delete _0x390b16['name'];}_0x1428a3[_0x896d('0x20')](_0x5ecab6)[_0x896d('0x2f')](_0x390b16);};}exports[_0x896d('0x30')]=function(_0xc97104,_0x221545){var _0xfb9d38={},_0x469f1f={},_0x4aa97b={'count':0x0,'rows':[]};var _0x5bf090=_['map'](db[_0x896d('0x31')]['rawAttributes'],function(_0xde98cb){return{'name':_0xde98cb[_0x896d('0x32')],'type':_0xde98cb[_0x896d('0x33')][_0x896d('0x34')]};});_0x469f1f['model']=_[_0x896d('0x35')](_0x5bf090,_0x896d('0x2e'));_0x469f1f[_0x896d('0x36')]=_[_0x896d('0x37')](_0xc97104[_0x896d('0x36')]);_0x469f1f[_0x896d('0x38')]=_[_0x896d('0x39')](_0x469f1f[_0x896d('0x3a')],_0x469f1f[_0x896d('0x36')]);_0xfb9d38[_0x896d('0x3b')]=_[_0x896d('0x39')](_0x469f1f[_0x896d('0x3a')],qs[_0x896d('0x3c')](_0xc97104['query'][_0x896d('0x3c')]));_0xfb9d38[_0x896d('0x3b')]=_0xfb9d38['attributes'][_0x896d('0x3d')]?_0xfb9d38[_0x896d('0x3b')]:_0x469f1f[_0x896d('0x3a')];if(!_0xc97104['query']['hasOwnProperty'](_0x896d('0x3e'))){_0xfb9d38[_0x896d('0x24')]=qs[_0x896d('0x24')](_0xc97104['query'][_0x896d('0x24')]);_0xfb9d38[_0x896d('0x26')]=qs[_0x896d('0x26')](_0xc97104[_0x896d('0x36')][_0x896d('0x26')]);}_0xfb9d38[_0x896d('0x3f')]=qs[_0x896d('0x40')](_0xc97104[_0x896d('0x36')][_0x896d('0x40')]);_0xfb9d38['where']=qs['filters'](_['pick'](_0xc97104[_0x896d('0x36')],_0x469f1f[_0x896d('0x38')]),_0x5bf090);if(_0xc97104[_0x896d('0x36')][_0x896d('0x41')]){_0xfb9d38['where']=_['merge'](_0xfb9d38[_0x896d('0x42')],{'$or':_[_0x896d('0x35')](_0x5bf090,function(_0x4f32d7){if(_0x4f32d7['type']!==_0x896d('0x43')){var _0x416180={};_0x416180[_0x4f32d7['name']]={'$like':'%'+_0xc97104[_0x896d('0x36')][_0x896d('0x41')]+'%'};return _0x416180;}})});}_0xfb9d38=_[_0x896d('0x44')]({},_0xfb9d38,_0xc97104[_0x896d('0x45')]);var _0x4419cf={'where':_0xfb9d38[_0x896d('0x42')]};return db['UserProfile']['count'](_0x4419cf)[_0x896d('0x46')](function(_0x698a1d){_0x4aa97b[_0x896d('0x25')]=_0x698a1d;if(_0xc97104['query'][_0x896d('0x47')]){_0xfb9d38['include']=[{'all':!![]}];}return db[_0x896d('0x31')][_0x896d('0x48')](_0xfb9d38);})[_0x896d('0x46')](function(_0x4a4c90){_0x4aa97b[_0x896d('0x49')]=_0x4a4c90;return _0x4aa97b;})[_0x896d('0x46')](respondWithFilteredResult(_0x221545,_0xfb9d38))[_0x896d('0x4a')](handleError(_0x221545,null));};exports['show']=function(_0x209f35,_0x519151){var _0x13bdee={'raw':![],'where':{'id':_0x209f35[_0x896d('0x4b')]['id']}},_0x241685={};_0x241685[_0x896d('0x3a')]=_[_0x896d('0x37')](db[_0x896d('0x31')]['rawAttributes']);_0x241685[_0x896d('0x36')]=_[_0x896d('0x37')](_0x209f35[_0x896d('0x36')]);_0x241685['filters']=_[_0x896d('0x39')](_0x241685['model'],_0x241685[_0x896d('0x36')]);_0x13bdee['attributes']=_[_0x896d('0x39')](_0x241685[_0x896d('0x3a')],qs[_0x896d('0x3c')](_0x209f35[_0x896d('0x36')][_0x896d('0x3c')]));_0x13bdee[_0x896d('0x3b')]=_0x13bdee[_0x896d('0x3b')][_0x896d('0x3d')]?_0x13bdee[_0x896d('0x3b')]:_0x241685[_0x896d('0x3a')];if(_0x209f35[_0x896d('0x36')][_0x896d('0x47')]){_0x13bdee[_0x896d('0x4c')]=[{'all':!![]}];}_0x13bdee=_[_0x896d('0x44')]({},_0x13bdee,_0x209f35[_0x896d('0x45')]);return db['UserProfile'][_0x896d('0x4d')](_0x13bdee)[_0x896d('0x46')](handleEntityNotFound(_0x519151,null))[_0x896d('0x46')](respondWithResult(_0x519151,null))[_0x896d('0x4a')](handleError(_0x519151,null));};exports[_0x896d('0x4e')]=function(_0x46d25c,_0x1a14aa){return db[_0x896d('0x31')][_0x896d('0x4e')](_0x46d25c[_0x896d('0x4f')],{})[_0x896d('0x46')](respondWithResult(_0x1a14aa,0xc9))[_0x896d('0x4a')](handleError(_0x1a14aa,null));};exports[_0x896d('0x50')]=function(_0x16372c,_0x58e5a4){var _0x4c3651={'where':{'id':_0x16372c[_0x896d('0x4b')]['id']}},_0x42a187={};_0x42a187['model']=_[_0x896d('0x37')](db[_0x896d('0x31')][_0x896d('0x51')]);_0x4c3651['attributes']=_[_0x896d('0x39')](_0x42a187[_0x896d('0x3a')],qs['fields'](_0x16372c[_0x896d('0x36')][_0x896d('0x3c')]));_0x4c3651[_0x896d('0x3b')]=_0x4c3651[_0x896d('0x3b')][_0x896d('0x3d')]?_0x4c3651['attributes']:_0x42a187[_0x896d('0x3a')];if(_0x16372c[_0x896d('0x36')][_0x896d('0x47')]){_0x4c3651['include']=[{'all':!![]}];}_0x4c3651=_[_0x896d('0x44')]({},_0x4c3651,_0x16372c[_0x896d('0x45')]);return db[_0x896d('0x31')][_0x896d('0x4d')](_0x4c3651)[_0x896d('0x46')](handleEntityNotFound(_0x58e5a4,null))[_0x896d('0x46')](function(_0x50d040){if(_0x50d040){var _0x7a4d5f=_0x50d040[_0x896d('0x52')]({'plain':!![]});_0x7a4d5f=qs[_0x896d('0x53')](_0x7a4d5f,['id','createdAt',_0x896d('0x54'),'crudPermissions']);_0x16372c[_0x896d('0x4f')]=_[_0x896d('0x53')](_0x16372c[_0x896d('0x4f')],['id',_0x896d('0x55'),_0x896d('0x54')]);return db[_0x896d('0x56')]['transaction'](function(_0x5c47ea){return db[_0x896d('0x31')][_0x896d('0x4e')](_['merge'](_0x7a4d5f,_0x16372c['body']),{'include':_0x16372c['query'][_0x896d('0x47')]?[{'all':!![]}]:undefined,'transaction':_0x5c47ea})['then'](function(_0x2c32ee){var _0x4fce76=_0x2c32ee[_0x896d('0x52')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x16372c[_0x896d('0x4b')]['id']},'raw':!![]})[_0x896d('0x46')](function(_0x2d8f18){if(_0x2d8f18){return BPromise['each'](_0x2d8f18,function(_0x1fae73){return new BPromise(function(_0x23503b,_0x3de1a3){if(_0x1fae73['autoAssociation']===null||_0x1fae73['autoAssociation']===0x1)_0x23503b(null);return db[_0x896d('0x57')][_0x896d('0x48')]({'where':{'sectionId':_0x1fae73['id']},'raw':!![]})[_0x896d('0x46')](function(_0x4fea65){var _0x32f46f=_[_0x896d('0x35')](_0x4fea65,function(_0x3c6f8c){return qs['omit'](_0x3c6f8c,['id',_0x896d('0x55'),_0x896d('0x54'),_0x896d('0x58')]);});_0x23503b(_0x32f46f);})['catch'](function(_0x97d82a){_0x3de1a3(_0x97d82a);});})[_0x896d('0x46')](function(_0xf3bf59){var _0x137acc=qs[_0x896d('0x53')](_0x1fae73,['id',_0x896d('0x55'),_0x896d('0x54')]);_0x137acc[_0x896d('0x59')]=_0x4fce76['id'];if(_0xf3bf59)_0x137acc['Resources']=_0xf3bf59;return _0x137acc;})[_0x896d('0x46')](function(_0x45c153){return db['UserProfileSection'][_0x896d('0x4e')](_0x45c153,{'include':[{'model':db[_0x896d('0x57')],'as':_0x896d('0x5a')}],'raw':!![],'transaction':_0x5c47ea});});})['then'](function(){return _0x4fce76;});}});});});}})['then'](respondWithResult(_0x58e5a4,0xc9))[_0x896d('0x4a')](handleError(_0x58e5a4,null));};exports[_0x896d('0x5b')]=function(_0x3dfff2,_0x5ca1c8){if(_0x3dfff2['body']['id']){delete _0x3dfff2[_0x896d('0x4f')]['id'];}return db[_0x896d('0x31')][_0x896d('0x4d')]({'where':{'id':_0x3dfff2[_0x896d('0x4b')]['id']}})[_0x896d('0x46')](handleEntityNotFound(_0x5ca1c8,null))[_0x896d('0x46')](saveUpdates(_0x3dfff2['body'],null))[_0x896d('0x46')](respondWithResult(_0x5ca1c8,null))[_0x896d('0x4a')](handleError(_0x5ca1c8,null));};exports['destroy']=function(_0x1a37f7,_0x1dee4d){return db[_0x896d('0x31')]['find']({'where':{'id':_0x1a37f7[_0x896d('0x4b')]['id']}})[_0x896d('0x46')](handleEntityNotFound(_0x1dee4d,null))[_0x896d('0x46')](removeEntity(_0x1dee4d,null))[_0x896d('0x4a')](handleError(_0x1dee4d,null));};exports[_0x896d('0x5c')]=function(_0x126c83,_0x5869d2){return db[_0x896d('0x31')][_0x896d('0x5c')]()[_0x896d('0x46')](respondWithResult(_0x5869d2,null))['catch'](handleError(_0x5869d2,null));};exports[_0x896d('0x5d')]=function(_0x3bf464,_0x33facf){var _0x3da584=_0x3bf464[_0x896d('0x4f')];return db[_0x896d('0x31')][_0x896d('0x4d')]({'where':{'id':_0x3bf464[_0x896d('0x4b')]['id']}})['then'](handleEntityNotFound(_0x33facf,null))[_0x896d('0x46')](function(_0x35eac9){if(_0x35eac9){return db[_0x896d('0x56')]['transaction'](function(_0x417cfe){return db[_0x896d('0x5e')][_0x896d('0x5f')]({'where':{'userProfileId':_0x3bf464['params']['id'],'sectionId':_[_0x896d('0x35')](_0x3da584,function(_0x3029e7){return _0x3029e7[_0x896d('0x58')];})},'transaction':_0x417cfe})[_0x896d('0x46')](function(){var _0x2cf00e=_['map'](_0x3da584,function(_0x21d48d){_0x21d48d['userProfileId']=_0x3bf464[_0x896d('0x4b')]['id'];return _0x21d48d;});var _0x30eaa6=[];return BPromise[_0x896d('0x60')](_0x2cf00e,function(_0x580562){return db[_0x896d('0x5e')][_0x896d('0x4e')](_0x580562,{'include':[{'model':db['UserProfileResource'],'as':_0x896d('0x5a')}],'raw':!![],'transaction':_0x417cfe})[_0x896d('0x46')](function(_0x5cc826){_0x30eaa6[_0x896d('0x61')](_0x5cc826[_0x896d('0x52')]({'plain':!![]}));});})[_0x896d('0x46')](function(){return _0x30eaa6;});});});}})['then'](function(_0x2a668f){return _0x2a668f;})['then'](respondWithResult(_0x33facf,null))[_0x896d('0x4a')](handleError(_0x33facf,null));};exports[_0x896d('0x62')]=function(_0x98243d,_0x5d356a){var _0x523d97;return db[_0x896d('0x31')][_0x896d('0x4d')]({'where':{'id':_0x98243d[_0x896d('0x4b')]['id']},'attributes':['id',_0x896d('0x2e')]})[_0x896d('0x46')](handleEntityNotFound(_0x5d356a,null))[_0x896d('0x46')](function(_0x4fba9a){if(_0x4fba9a){_0x523d97=_0x4fba9a;return db[_0x896d('0x5e')][_0x896d('0x5f')]({'where':{'userProfileId':_0x98243d[_0x896d('0x4b')]['id'],'sectionId':_0x98243d['query'][_0x896d('0x63')]}});}})[_0x896d('0x46')](function(){return _0x523d97;})[_0x896d('0x46')](respondWithStatusCode(_0x5d356a,null))['catch'](handleError(_0x5d356a,null));};exports[_0x896d('0x64')]=function(_0x12cbb5,_0x2296d4){var _0x3185c1=[];var _0x399962=[];return db[_0x896d('0x5e')][_0x896d('0x48')]({'where':{'userProfileId':_0x12cbb5['params']['id']},'raw':!![]})[_0x896d('0x46')](function(_0x2e448a){_0x3185c1=_[_0x896d('0x41')](_0x2e448a,function(_0x37b0d7){return _0x37b0d7[_0x896d('0x65')]===0x1||_[_0x896d('0x66')]([0x3eb,0x709],_0x37b0d7[_0x896d('0x58')]);});if(!_[_0x896d('0x67')](_0x3185c1)){return _[_0x896d('0x35')](_0x3185c1,function(_0x252eca){return _0x252eca['sectionId'];});}else{return;}})[_0x896d('0x46')](function(_0x539407){if(_0x539407)_0x399962=_0x539407;if(_[_0x896d('0x66')](_0x399962,0x64)){var _0x59bca2=_[_0x896d('0x4d')](_0x3185c1,{'sectionId':0x64});return hasDefaultDashboard(_0x59bca2)[_0x896d('0x46')](function(_0x915ea7){return _['map'](_0x3185c1,function(_0x2c9792){if(_0x2c9792[_0x896d('0x58')]===0x64){_0x2c9792['subsections']=_0x915ea7;}return _0x2c9792;});});}else{return;}})['then'](function(_0x167b16){if(_0x167b16)_0x3185c1=_0x167b16;if(_[_0x896d('0x66')](_0x399962,0x3eb)){var _0x2aa49c=_[_0x896d('0x4d')](_0x3185c1,{'sectionId':0x3eb});return getCustomDashboards(_0x2aa49c)[_0x896d('0x46')](function(_0x276c79){return _[_0x896d('0x35')](_0x3185c1,function(_0x224827){if(_0x2aa49c[_0x896d('0x65')]){if(_0x224827[_0x896d('0x58')]===0x3eb){_0x224827[_0x896d('0x68')]=_0x276c79;}}else{if(_0x224827['sectionId']===0x64){_0x224827['subsections']=_0x276c79;}}return _0x224827;});});}else{return;}})[_0x896d('0x46')](function(_0x134c94){if(_0x134c94)_0x3185c1=_0x134c94;if(_['includes'](_0x399962,0x709)){var _0x484499=_['find'](_0x3185c1,{'sectionId':0x709});return getPlugins(_0x484499)['then'](function(_0x927b11){if(_0x484499['enabled']){return _[_0x896d('0x35')](_0x3185c1,function(_0x412dc8){if(_0x412dc8[_0x896d('0x58')]===0x709){_0x412dc8['subsections']=_0x927b11;}return _0x412dc8;});}else{var _0xe15c3={'sectionId':0x76c,'enabled':0x1,'subsections':_0x927b11};var _0x2e0912=_[_0x896d('0x35')](_0x3185c1);_0x2e0912[_0x896d('0x61')](_0xe15c3);return _0x2e0912;}});}else{return;}})[_0x896d('0x46')](function(_0x7f003a){if(_0x7f003a)_0x3185c1=_0x7f003a;return _[_0x896d('0x41')](_0x3185c1,[_0x896d('0x65'),0x1]);})[_0x896d('0x46')](respondWithResult(_0x2296d4,null))[_0x896d('0x4a')](handleError(_0x2296d4,null));};function hasDefaultDashboard(_0x984fa7){var _0x555714=[0x65];return new BPromise(function(_0x59d980,_0x35b9df){try{if(_0x984fa7['autoAssociation']){_0x59d980(_0x555714);}else{return db['UserProfileResource'][_0x896d('0x69')]({'where':{'sectionId':_0x984fa7['id']},'raw':!![]})['then'](function(_0x112981){_0x112981?_0x59d980(_0x555714):_0x59d980();});}}catch(_0x50524e){_0x35b9df(_0x50524e);}});}function getCustomDashboards(_0x3188e4){var _0x291b16=[];return new BPromise(function(_0xc5d2d1,_0x32933e){try{if(_0x3188e4['autoAssociation']){return db[_0x896d('0x6a')]['findAll']({'raw':!![]})[_0x896d('0x46')](function(_0x576240){_0x576240[_0x896d('0x6b')](function(_0x9e8272){_0x291b16[_0x896d('0x61')](_0x9e8272['id']+0x1869f);});_0xc5d2d1(_0x291b16);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x3188e4['id']},'raw':!![]})[_0x896d('0x46')](function(_0x3fd8b7){_0x3fd8b7[_0x896d('0x6b')](function(_0x11c658){_0x291b16[_0x896d('0x61')](_0x11c658[_0x896d('0x6c')]+0x1869f);});_0xc5d2d1(_0x291b16);});}}catch(_0x218c64){_0x32933e(_0x218c64);}});}function getPlugins(_0x2b80cc){var _0x5220ce=[];return new BPromise(function(_0xeebbb6,_0x47679e){try{if(_0x2b80cc[_0x896d('0x6d')]){return db[_0x896d('0x6e')]['findAll']({'raw':!![]})['then'](function(_0x56659e){_0x56659e[_0x896d('0x6b')](function(_0x17cfd5){_0x5220ce[_0x896d('0x61')](_0x17cfd5['id']+0x15b38);});_0xeebbb6(_0x5220ce);});}else{return db['UserProfileResource'][_0x896d('0x48')]({'where':{'sectionId':_0x2b80cc['id']},'raw':!![]})[_0x896d('0x46')](function(_0x3c2265){_0x3c2265[_0x896d('0x6b')](function(_0x50ff46){_0x5220ce[_0x896d('0x61')](_0x50ff46[_0x896d('0x6c')]+0x15b38);});_0xeebbb6(_0x5220ce);});}}catch(_0x3e4d7c){_0x47679e(_0x3e4d7c);}});}exports[_0x896d('0x6f')]=function(_0x3e9c43,_0x357b00){return db['UserProfile']['find']({'where':{'id':_0x3e9c43[_0x896d('0x4b')]['id']}})[_0x896d('0x46')](handleEntityNotFound(_0x357b00,null))[_0x896d('0x46')](function(_0x34ac88){if(_0x34ac88){return db[_0x896d('0x56')]['transaction'](function(_0x1753bd){return db['UserProfileSection'][_0x896d('0x48')]({'where':{'userProfileId':_0x3e9c43['params']['id']},'attributes':['id'],'raw':!![]})[_0x896d('0x46')](function(_0x4c8f24){if(_0x4c8f24){return db[_0x896d('0x5e')][_0x896d('0x5f')]({'where':{'userProfileId':_0x3e9c43[_0x896d('0x4b')]['id'],'id':_[_0x896d('0x35')](_0x4c8f24,function(_0x482aef){return _0x482aef['id'];})},'transaction':_0x1753bd});}})[_0x896d('0x46')](function(_0x3e0e93){var _0x361c53=_[_0x896d('0x35')](_0x3e9c43[_0x896d('0x4f')],function(_0x421f85){_0x421f85['userProfileId']=_0x3e9c43[_0x896d('0x4b')]['id'];return _0x421f85;});return db[_0x896d('0x5e')]['bulkCreate'](_0x361c53,{'raw':!![],'transaction':_0x1753bd});})['then'](function(_0x1f810b){var _0x107562=_['filter'](_['map'](_0x1f810b,function(_0x390a67){return _0x390a67['get']({'plain':!![]});}),{'includeAll':![]});if(_0x107562){return db[_0x896d('0x5e')]['findAll']({'where':{'userProfileId':_0x3e9c43[_0x896d('0x4b')]['id'],'sectionId':_[_0x896d('0x35')](_0x107562,function(_0x2499bf){return _0x2499bf[_0x896d('0x58')];})},'attributes':['id',_0x896d('0x58')],'raw':!![]})[_0x896d('0x46')](function(_0x2ef50a){var _0x1db74c=_['map'](_0x3e9c43[_0x896d('0x4f')],function(_0x1bbf89){_0x1bbf89[_0x896d('0x59')]=_0x3e9c43[_0x896d('0x4b')]['id'];return _0x1bbf89;});return db[_0x896d('0x57')][_0x896d('0x70')](_0x1db74c,{'raw':!![],'transaction':_0x1753bd});});}})[_0x896d('0x4a')](handleError(_0x357b00,null));});}})['then'](function(_0x4f0636){var _0x20e882=_['map'](_0x4f0636,function(_0x17c39b){return _0x17c39b['get']({'plain':!![]});});})[_0x896d('0x46')](respondWithResult(_0x357b00,null))[_0x896d('0x4a')](handleError(_0x357b00,null));};exports[_0x896d('0x71')]=function(_0x36cbd8,_0xa22e50,_0x255926){return db[_0x896d('0x31')]['find']({'where':{'id':_0x36cbd8[_0x896d('0x4b')]['id']}})[_0x896d('0x46')](handleEntityNotFound(_0xa22e50,null))[_0x896d('0x46')](function(_0x589ba2){if(_0x589ba2){return _0x589ba2[_0x896d('0x71')](_0x36cbd8[_0x896d('0x36')][_0x896d('0x63')]);}})[_0x896d('0x46')](respondWithStatusCode(_0xa22e50,null))[_0x896d('0x4a')](handleError(_0xa22e50,null));};exports['getResources']=function(_0x12d0e7,_0x1849ab){var _0x4231e9={};if(!_0x12d0e7['query'][_0x896d('0x72')])throw new Error(_0x896d('0x73'));if(!_0x12d0e7['query'][_0x896d('0x74')](_0x896d('0x3e'))){_0x4231e9['limit']=qs[_0x896d('0x24')](_0x12d0e7['query'][_0x896d('0x24')]);_0x4231e9[_0x896d('0x26')]=qs[_0x896d('0x26')](_0x12d0e7[_0x896d('0x36')][_0x896d('0x26')]);}return db['UserProfile'][_0x896d('0x4d')]({'where':{'id':_0x12d0e7[_0x896d('0x4b')]['id']}})['then'](function(_0xf75441){if(!_0xf75441)throw new Error(_0x896d('0x75')+_0x12d0e7[_0x896d('0x4b')]['id']);return db[_0x896d('0x31')][_0x896d('0x76')](_0x12d0e7);})[_0x896d('0x46')](respondWithFilteredResult(_0x1849ab,_0x4231e9))[_0x896d('0x4a')](handleError(_0x1849ab,null));};
\ No newline at end of file
+var _0xfb0b=['options','find','create','body','clone','get','createdAt','updatedAt','crudPermissions','UserProfileSection','autoAssociation','UserProfileResource','omit','sectionId','Resources','destroy','describe','transaction','userProfileId','each','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','findOne','Dashboard','forEach','push','resourceId','Plugin','addResources','sequelize','removeResources','getResources','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','request-promise','moment','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','sendStatus','status','end','json','offset','limit','undefined','count','set','reject','save','update','then','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0xfb0b,0x94));var _0xbfb0=function(_0x3446e8,_0x59d7d3){_0x3446e8=_0x3446e8-0x0;var _0x5751a4=_0xfb0b[_0x3446e8];return _0x5751a4;};'use strict';var emlformat=require(_0xbfb0('0x0'));var rimraf=require(_0xbfb0('0x1'));var zipdir=require(_0xbfb0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbfb0('0x3'));var moment=require(_0xbfb0('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbfb0('0x5'));var path=require('path');var sox=require(_0xbfb0('0x6'));var csv=require(_0xbfb0('0x7'));var ejs=require(_0xbfb0('0x8'));var fs=require('fs');var fs_extra=require(_0xbfb0('0x9'));var _=require(_0xbfb0('0xa'));var squel=require(_0xbfb0('0xb'));var crypto=require('crypto');var jsforce=require(_0xbfb0('0xc'));var deskjs=require(_0xbfb0('0xd'));var toCsv=require(_0xbfb0('0x7'));var querystring=require(_0xbfb0('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbfb0('0xf'));var hardwareService=require(_0xbfb0('0x10'));var logger=require(_0xbfb0('0x11'))('api');var utils=require(_0xbfb0('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xbfb0('0x13'));var db=require(_0xbfb0('0x14'))['db'];config[_0xbfb0('0x15')]=_[_0xbfb0('0x16')](config[_0xbfb0('0x15')],{'host':_0xbfb0('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbfb0('0x15')]));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x47e716,_0x141e62){_0x141e62=_0x141e62||0xcc;return function(_0x2c9768){if(_0x2c9768){return _0x47e716[_0xbfb0('0x18')](_0x141e62);}return _0x47e716[_0xbfb0('0x19')](_0x141e62)[_0xbfb0('0x1a')]();};}function respondWithResult(_0x213994,_0x2470cf){_0x2470cf=_0x2470cf||0xc8;return function(_0x2d8773){if(_0x2d8773){return _0x213994[_0xbfb0('0x19')](_0x2470cf)[_0xbfb0('0x1b')](_0x2d8773);}};}function respondWithFilteredResult(_0x2496b8,_0x4e48b1){return function(_0x5c8a1e){if(_0x5c8a1e){var _0x3319a1=typeof _0x4e48b1[_0xbfb0('0x1c')]==='undefined'&&typeof _0x4e48b1[_0xbfb0('0x1d')]===_0xbfb0('0x1e');var _0x4a6a88=_0x5c8a1e[_0xbfb0('0x1f')];var _0x4b4878=_0x3319a1?0x0:_0x4e48b1[_0xbfb0('0x1c')];var _0x4350fe=_0x3319a1?_0x5c8a1e[_0xbfb0('0x1f')]:_0x4e48b1[_0xbfb0('0x1c')]+_0x4e48b1['limit'];var _0x31c2eb;if(_0x4350fe>=_0x4a6a88){_0x4350fe=_0x4a6a88;_0x31c2eb=0xc8;}else{_0x31c2eb=0xce;}_0x2496b8['status'](_0x31c2eb);return _0x2496b8[_0xbfb0('0x20')]('Content-Range',_0x4b4878+'-'+_0x4350fe+'/'+_0x4a6a88)[_0xbfb0('0x1b')](_0x5c8a1e);}return null;};}function patchUpdates(_0x4cae5a){return function(_0x2fe191){try{jsonpatch['apply'](_0x2fe191,_0x4cae5a,!![]);}catch(_0x278b3d){return BPromise[_0xbfb0('0x21')](_0x278b3d);}return _0x2fe191[_0xbfb0('0x22')]();};}function saveUpdates(_0x3ab347,_0x515d0f){return function(_0x2efb2a){if(_0x2efb2a){return _0x2efb2a[_0xbfb0('0x23')](_0x3ab347)['then'](function(_0x4e86c8){return _0x4e86c8;});}return null;};}function removeEntity(_0x1625e3,_0x1e4a2e){return function(_0x39c5f8){if(_0x39c5f8){return _0x39c5f8['destroy']()[_0xbfb0('0x24')](function(){_0x1625e3['status'](0xcc)[_0xbfb0('0x1a')]();});}};}function handleEntityNotFound(_0x46dac3,_0x250ce8){return function(_0x402db3){if(!_0x402db3){_0x46dac3[_0xbfb0('0x18')](0x194);}return _0x402db3;};}function handleError(_0x1d0e8d,_0xb41263){_0xb41263=_0xb41263||0x1f4;return function(_0x57ab45){logger[_0xbfb0('0x25')](_0x57ab45[_0xbfb0('0x26')]);if(_0x57ab45[_0xbfb0('0x27')]){delete _0x57ab45[_0xbfb0('0x27')];}_0x1d0e8d['status'](_0xb41263)[_0xbfb0('0x28')](_0x57ab45);};}exports[_0xbfb0('0x29')]=function(_0x4e511c,_0x188c90){var _0x6ba12c={},_0x41ad24={},_0x1a5623={'count':0x0,'rows':[]};var _0x4a720c=_[_0xbfb0('0x2a')](db[_0xbfb0('0x2b')][_0xbfb0('0x2c')],function(_0x3f7353){return{'name':_0x3f7353[_0xbfb0('0x2d')],'type':_0x3f7353[_0xbfb0('0x2e')][_0xbfb0('0x2f')]};});_0x41ad24['model']=_['map'](_0x4a720c,'name');_0x41ad24[_0xbfb0('0x30')]=_[_0xbfb0('0x31')](_0x4e511c[_0xbfb0('0x30')]);_0x41ad24[_0xbfb0('0x32')]=_[_0xbfb0('0x33')](_0x41ad24[_0xbfb0('0x34')],_0x41ad24[_0xbfb0('0x30')]);_0x6ba12c[_0xbfb0('0x35')]=_['intersection'](_0x41ad24['model'],qs['fields'](_0x4e511c[_0xbfb0('0x30')][_0xbfb0('0x36')]));_0x6ba12c[_0xbfb0('0x35')]=_0x6ba12c[_0xbfb0('0x35')][_0xbfb0('0x37')]?_0x6ba12c['attributes']:_0x41ad24['model'];if(!_0x4e511c[_0xbfb0('0x30')][_0xbfb0('0x38')](_0xbfb0('0x39'))){_0x6ba12c[_0xbfb0('0x1d')]=qs[_0xbfb0('0x1d')](_0x4e511c[_0xbfb0('0x30')][_0xbfb0('0x1d')]);_0x6ba12c[_0xbfb0('0x1c')]=qs[_0xbfb0('0x1c')](_0x4e511c[_0xbfb0('0x30')]['offset']);}_0x6ba12c['order']=qs[_0xbfb0('0x3a')](_0x4e511c[_0xbfb0('0x30')]['sort']);_0x6ba12c[_0xbfb0('0x3b')]=qs['filters'](_[_0xbfb0('0x3c')](_0x4e511c[_0xbfb0('0x30')],_0x41ad24['filters']),_0x4a720c);if(_0x4e511c['query'][_0xbfb0('0x3d')]){_0x6ba12c[_0xbfb0('0x3b')]=_['merge'](_0x6ba12c[_0xbfb0('0x3b')],{'$or':_['map'](_0x4a720c,function(_0x21da9c){if(_0x21da9c['type']!=='VIRTUAL'){var _0x1af0a0={};_0x1af0a0[_0x21da9c[_0xbfb0('0x27')]]={'$like':'%'+_0x4e511c[_0xbfb0('0x30')][_0xbfb0('0x3d')]+'%'};return _0x1af0a0;}})});}_0x6ba12c=_[_0xbfb0('0x3e')]({},_0x6ba12c,_0x4e511c['options']);var _0x4240a={'where':_0x6ba12c[_0xbfb0('0x3b')]};return db[_0xbfb0('0x2b')][_0xbfb0('0x1f')](_0x4240a)[_0xbfb0('0x24')](function(_0x90da0c){_0x1a5623[_0xbfb0('0x1f')]=_0x90da0c;if(_0x4e511c[_0xbfb0('0x30')][_0xbfb0('0x3f')]){_0x6ba12c[_0xbfb0('0x40')]=[{'all':!![]}];}return db[_0xbfb0('0x2b')][_0xbfb0('0x41')](_0x6ba12c);})[_0xbfb0('0x24')](function(_0x3caaf3){_0x1a5623[_0xbfb0('0x42')]=_0x3caaf3;return _0x1a5623;})[_0xbfb0('0x24')](respondWithFilteredResult(_0x188c90,_0x6ba12c))[_0xbfb0('0x43')](handleError(_0x188c90,null));};exports[_0xbfb0('0x44')]=function(_0x5af02d,_0xa7f6c3){var _0x1401bb={'raw':![],'where':{'id':_0x5af02d[_0xbfb0('0x45')]['id']}},_0x2769d3={};_0x2769d3[_0xbfb0('0x34')]=_[_0xbfb0('0x31')](db[_0xbfb0('0x2b')][_0xbfb0('0x2c')]);_0x2769d3[_0xbfb0('0x30')]=_[_0xbfb0('0x31')](_0x5af02d['query']);_0x2769d3['filters']=_[_0xbfb0('0x33')](_0x2769d3[_0xbfb0('0x34')],_0x2769d3['query']);_0x1401bb['attributes']=_[_0xbfb0('0x33')](_0x2769d3[_0xbfb0('0x34')],qs[_0xbfb0('0x36')](_0x5af02d[_0xbfb0('0x30')][_0xbfb0('0x36')]));_0x1401bb[_0xbfb0('0x35')]=_0x1401bb['attributes'][_0xbfb0('0x37')]?_0x1401bb[_0xbfb0('0x35')]:_0x2769d3[_0xbfb0('0x34')];if(_0x5af02d[_0xbfb0('0x30')][_0xbfb0('0x3f')]){_0x1401bb[_0xbfb0('0x40')]=[{'all':!![]}];}_0x1401bb=_[_0xbfb0('0x3e')]({},_0x1401bb,_0x5af02d[_0xbfb0('0x46')]);return db[_0xbfb0('0x2b')][_0xbfb0('0x47')](_0x1401bb)[_0xbfb0('0x24')](handleEntityNotFound(_0xa7f6c3,null))[_0xbfb0('0x24')](respondWithResult(_0xa7f6c3,null))[_0xbfb0('0x43')](handleError(_0xa7f6c3,null));};exports[_0xbfb0('0x48')]=function(_0x2845da,_0xf085ab){return db[_0xbfb0('0x2b')][_0xbfb0('0x48')](_0x2845da[_0xbfb0('0x49')],{})[_0xbfb0('0x24')](respondWithResult(_0xf085ab,0xc9))[_0xbfb0('0x43')](handleError(_0xf085ab,null));};exports[_0xbfb0('0x4a')]=function(_0x3f1972,_0x35b22e){var _0x59dd29={'where':{'id':_0x3f1972[_0xbfb0('0x45')]['id']}},_0x41c1d4={};_0x41c1d4[_0xbfb0('0x34')]=_[_0xbfb0('0x31')](db[_0xbfb0('0x2b')][_0xbfb0('0x2c')]);_0x59dd29[_0xbfb0('0x35')]=_['intersection'](_0x41c1d4[_0xbfb0('0x34')],qs[_0xbfb0('0x36')](_0x3f1972[_0xbfb0('0x30')]['fields']));_0x59dd29[_0xbfb0('0x35')]=_0x59dd29['attributes'][_0xbfb0('0x37')]?_0x59dd29[_0xbfb0('0x35')]:_0x41c1d4[_0xbfb0('0x34')];if(_0x3f1972[_0xbfb0('0x30')]['includeAll']){_0x59dd29[_0xbfb0('0x40')]=[{'all':!![]}];}_0x59dd29=_[_0xbfb0('0x3e')]({},_0x59dd29,_0x3f1972['options']);return db[_0xbfb0('0x2b')][_0xbfb0('0x47')](_0x59dd29)['then'](handleEntityNotFound(_0x35b22e,null))['then'](function(_0x531726){if(_0x531726){var _0x14bb38=_0x531726[_0xbfb0('0x4b')]({'plain':!![]});_0x14bb38=qs['omit'](_0x14bb38,['id',_0xbfb0('0x4c'),_0xbfb0('0x4d'),_0xbfb0('0x4e')]);_0x3f1972[_0xbfb0('0x49')]=_['omit'](_0x3f1972[_0xbfb0('0x49')],['id',_0xbfb0('0x4c'),_0xbfb0('0x4d')]);return db['sequelize']['transaction'](function(_0x5d3fac){return db['UserProfile'][_0xbfb0('0x48')](_[_0xbfb0('0x3e')](_0x14bb38,_0x3f1972[_0xbfb0('0x49')]),{'include':_0x3f1972[_0xbfb0('0x30')][_0xbfb0('0x3f')]?[{'all':!![]}]:undefined,'transaction':_0x5d3fac})[_0xbfb0('0x24')](function(_0x228e38){var _0x4f1b7d=_0x228e38[_0xbfb0('0x4b')]({'plain':!![]});return db[_0xbfb0('0x4f')][_0xbfb0('0x41')]({'where':{'userProfileId':_0x3f1972[_0xbfb0('0x45')]['id']},'raw':!![]})[_0xbfb0('0x24')](function(_0xbf35e0){if(_0xbf35e0){return BPromise['each'](_0xbf35e0,function(_0x22eb16){return new BPromise(function(_0x459f45,_0x5dbdb0){if(_0x22eb16[_0xbfb0('0x50')]===null||_0x22eb16[_0xbfb0('0x50')]===0x1)_0x459f45(null);return db[_0xbfb0('0x51')][_0xbfb0('0x41')]({'where':{'sectionId':_0x22eb16['id']},'raw':!![]})['then'](function(_0x15815d){var _0x1dda6d=_[_0xbfb0('0x2a')](_0x15815d,function(_0x16c8aa){return qs[_0xbfb0('0x52')](_0x16c8aa,['id',_0xbfb0('0x4c'),'updatedAt',_0xbfb0('0x53')]);});_0x459f45(_0x1dda6d);})[_0xbfb0('0x43')](function(_0x2d1084){_0x5dbdb0(_0x2d1084);});})[_0xbfb0('0x24')](function(_0xd15af3){var _0x51a1dc=qs[_0xbfb0('0x52')](_0x22eb16,['id',_0xbfb0('0x4c'),_0xbfb0('0x4d')]);_0x51a1dc['userProfileId']=_0x4f1b7d['id'];if(_0xd15af3)_0x51a1dc[_0xbfb0('0x54')]=_0xd15af3;return _0x51a1dc;})['then'](function(_0x215558){return db[_0xbfb0('0x4f')]['create'](_0x215558,{'include':[{'model':db[_0xbfb0('0x51')],'as':_0xbfb0('0x54')}],'raw':!![],'transaction':_0x5d3fac});});})['then'](function(){return _0x4f1b7d;});}});});});}})['then'](respondWithResult(_0x35b22e,0xc9))[_0xbfb0('0x43')](handleError(_0x35b22e,null));};exports['update']=function(_0x50b071,_0x21ebc0){if(_0x50b071[_0xbfb0('0x49')]['id']){delete _0x50b071[_0xbfb0('0x49')]['id'];}return db[_0xbfb0('0x2b')]['find']({'where':{'id':_0x50b071['params']['id']}})[_0xbfb0('0x24')](handleEntityNotFound(_0x21ebc0,null))['then'](saveUpdates(_0x50b071['body'],null))[_0xbfb0('0x24')](respondWithResult(_0x21ebc0,null))[_0xbfb0('0x43')](handleError(_0x21ebc0,null));};exports[_0xbfb0('0x55')]=function(_0x13ded2,_0x43febb){return db[_0xbfb0('0x2b')]['find']({'where':{'id':_0x13ded2[_0xbfb0('0x45')]['id']}})[_0xbfb0('0x24')](handleEntityNotFound(_0x43febb,null))[_0xbfb0('0x24')](removeEntity(_0x43febb,null))[_0xbfb0('0x43')](handleError(_0x43febb,null));};exports[_0xbfb0('0x56')]=function(_0x462929,_0x29e1d6){return db['UserProfile'][_0xbfb0('0x56')]()[_0xbfb0('0x24')](respondWithResult(_0x29e1d6,null))[_0xbfb0('0x43')](handleError(_0x29e1d6,null));};exports['addSections']=function(_0x477a2e,_0x32c4e1){var _0x39405f=_0x477a2e[_0xbfb0('0x49')];return db[_0xbfb0('0x2b')]['find']({'where':{'id':_0x477a2e[_0xbfb0('0x45')]['id']}})[_0xbfb0('0x24')](handleEntityNotFound(_0x32c4e1,null))['then'](function(_0x4998c5){if(_0x4998c5){return db['sequelize'][_0xbfb0('0x57')](function(_0x196d99){return db[_0xbfb0('0x4f')][_0xbfb0('0x55')]({'where':{'userProfileId':_0x477a2e['params']['id'],'sectionId':_[_0xbfb0('0x2a')](_0x39405f,function(_0x184c36){return _0x184c36[_0xbfb0('0x53')];})},'transaction':_0x196d99})[_0xbfb0('0x24')](function(){var _0x324584=_[_0xbfb0('0x2a')](_0x39405f,function(_0x398e76){_0x398e76[_0xbfb0('0x58')]=_0x477a2e[_0xbfb0('0x45')]['id'];return _0x398e76;});var _0x233106=[];return BPromise[_0xbfb0('0x59')](_0x324584,function(_0x2e8566){return db[_0xbfb0('0x4f')]['create'](_0x2e8566,{'include':[{'model':db[_0xbfb0('0x51')],'as':_0xbfb0('0x54')}],'raw':!![],'transaction':_0x196d99})[_0xbfb0('0x24')](function(_0xd15cc1){_0x233106['push'](_0xd15cc1[_0xbfb0('0x4b')]({'plain':!![]}));});})['then'](function(){return _0x233106;});});});}})[_0xbfb0('0x24')](function(_0x281b9a){return _0x281b9a;})[_0xbfb0('0x24')](respondWithResult(_0x32c4e1,null))['catch'](handleError(_0x32c4e1,null));};exports[_0xbfb0('0x5a')]=function(_0x39b74d,_0x14aef5){var _0x1e21ce;return db['UserProfile'][_0xbfb0('0x47')]({'where':{'id':_0x39b74d[_0xbfb0('0x45')]['id']},'attributes':['id','name']})[_0xbfb0('0x24')](handleEntityNotFound(_0x14aef5,null))[_0xbfb0('0x24')](function(_0x1fb32c){if(_0x1fb32c){_0x1e21ce=_0x1fb32c;return db[_0xbfb0('0x4f')]['destroy']({'where':{'userProfileId':_0x39b74d['params']['id'],'sectionId':_0x39b74d[_0xbfb0('0x30')][_0xbfb0('0x5b')]}});}})[_0xbfb0('0x24')](function(){return _0x1e21ce;})['then'](respondWithStatusCode(_0x14aef5,null))[_0xbfb0('0x43')](handleError(_0x14aef5,null));};exports[_0xbfb0('0x5c')]=function(_0x5356c2,_0x349ec0){var _0x457823=[];var _0x26082d=[];return db[_0xbfb0('0x4f')][_0xbfb0('0x41')]({'where':{'userProfileId':_0x5356c2[_0xbfb0('0x45')]['id']},'raw':!![]})[_0xbfb0('0x24')](function(_0x298306){_0x457823=_['filter'](_0x298306,function(_0x3ad529){return _0x3ad529[_0xbfb0('0x5d')]===0x1||_[_0xbfb0('0x5e')]([0x3eb,0x709],_0x3ad529[_0xbfb0('0x53')]);});if(!_[_0xbfb0('0x5f')](_0x457823)){return _['map'](_0x457823,function(_0x35f9ac){return _0x35f9ac[_0xbfb0('0x53')];});}else{return;}})[_0xbfb0('0x24')](function(_0x1124ce){if(_0x1124ce)_0x26082d=_0x1124ce;if(_[_0xbfb0('0x5e')](_0x26082d,0x64)){var _0xf9fed8=_[_0xbfb0('0x47')](_0x457823,{'sectionId':0x64});return hasDefaultDashboard(_0xf9fed8)['then'](function(_0x8db0a8){return _[_0xbfb0('0x2a')](_0x457823,function(_0x34ffa3){if(_0x34ffa3[_0xbfb0('0x53')]===0x64){_0x34ffa3['subsections']=_0x8db0a8;}return _0x34ffa3;});});}else{return;}})[_0xbfb0('0x24')](function(_0x7ca2e6){if(_0x7ca2e6)_0x457823=_0x7ca2e6;if(_['includes'](_0x26082d,0x3eb)){var _0x5bf319=_['find'](_0x457823,{'sectionId':0x3eb});return getCustomDashboards(_0x5bf319)['then'](function(_0x1e2e67){return _['map'](_0x457823,function(_0x5ee0cd){if(_0x5bf319[_0xbfb0('0x5d')]){if(_0x5ee0cd['sectionId']===0x3eb){_0x5ee0cd['subsections']=_0x1e2e67;}}else{if(_0x5ee0cd[_0xbfb0('0x53')]===0x64){_0x5ee0cd[_0xbfb0('0x60')]=_0x1e2e67;}}return _0x5ee0cd;});});}else{return;}})['then'](function(_0x1f892f){if(_0x1f892f)_0x457823=_0x1f892f;if(_[_0xbfb0('0x5e')](_0x26082d,0x709)){var _0x5c0ada=_[_0xbfb0('0x47')](_0x457823,{'sectionId':0x709});return getPlugins(_0x5c0ada)[_0xbfb0('0x24')](function(_0x59f1f2){if(_0x5c0ada[_0xbfb0('0x5d')]){return _[_0xbfb0('0x2a')](_0x457823,function(_0x2efed0){if(_0x2efed0[_0xbfb0('0x53')]===0x709){_0x2efed0[_0xbfb0('0x60')]=_0x59f1f2;}return _0x2efed0;});}else{var _0x55d480={'sectionId':0x76c,'enabled':0x1,'subsections':_0x59f1f2};var _0x4188b5=_[_0xbfb0('0x2a')](_0x457823);_0x4188b5['push'](_0x55d480);return _0x4188b5;}});}else{return;}})[_0xbfb0('0x24')](function(_0x308f7b){if(_0x308f7b)_0x457823=_0x308f7b;return _[_0xbfb0('0x3d')](_0x457823,[_0xbfb0('0x5d'),0x1]);})[_0xbfb0('0x24')](respondWithResult(_0x349ec0,null))[_0xbfb0('0x43')](handleError(_0x349ec0,null));};function hasDefaultDashboard(_0x123f24){var _0x53c883=[0x65];return new BPromise(function(_0x5b0df5,_0x3444c1){try{if(_0x123f24[_0xbfb0('0x50')]){_0x5b0df5(_0x53c883);}else{return db['UserProfileResource'][_0xbfb0('0x61')]({'where':{'sectionId':_0x123f24['id']},'raw':!![]})['then'](function(_0x589e74){_0x589e74?_0x5b0df5(_0x53c883):_0x5b0df5();});}}catch(_0xce6ca8){_0x3444c1(_0xce6ca8);}});}function getCustomDashboards(_0x3a3d6c){var _0x201d4a=[];return new BPromise(function(_0x219768,_0x1f4572){try{if(_0x3a3d6c[_0xbfb0('0x50')]){return db[_0xbfb0('0x62')][_0xbfb0('0x41')]({'raw':!![]})[_0xbfb0('0x24')](function(_0xeaa6ff){_0xeaa6ff[_0xbfb0('0x63')](function(_0x2dfa11){_0x201d4a[_0xbfb0('0x64')](_0x2dfa11['id']+0x1869f);});_0x219768(_0x201d4a);});}else{return db['UserProfileResource'][_0xbfb0('0x41')]({'where':{'sectionId':_0x3a3d6c['id']},'raw':!![]})[_0xbfb0('0x24')](function(_0x5f2ad7){_0x5f2ad7[_0xbfb0('0x63')](function(_0x1cc637){_0x201d4a[_0xbfb0('0x64')](_0x1cc637[_0xbfb0('0x65')]+0x1869f);});_0x219768(_0x201d4a);});}}catch(_0x440324){_0x1f4572(_0x440324);}});}function getPlugins(_0x4bcd2f){var _0x3e711c=[];return new BPromise(function(_0x51115b,_0x396d19){try{if(_0x4bcd2f[_0xbfb0('0x50')]){return db[_0xbfb0('0x66')][_0xbfb0('0x41')]({'raw':!![]})[_0xbfb0('0x24')](function(_0xf1773a){_0xf1773a[_0xbfb0('0x63')](function(_0x2095b3){_0x3e711c[_0xbfb0('0x64')](_0x2095b3['id']+0x15b38);});_0x51115b(_0x3e711c);});}else{return db['UserProfileResource'][_0xbfb0('0x41')]({'where':{'sectionId':_0x4bcd2f['id']},'raw':!![]})['then'](function(_0x278410){_0x278410[_0xbfb0('0x63')](function(_0x450656){_0x3e711c['push'](_0x450656['resourceId']+0x15b38);});_0x51115b(_0x3e711c);});}}catch(_0x37d1b4){_0x396d19(_0x37d1b4);}});}exports[_0xbfb0('0x67')]=function(_0x29efef,_0x5ed8bc){return db[_0xbfb0('0x2b')][_0xbfb0('0x47')]({'where':{'id':_0x29efef['params']['id']}})[_0xbfb0('0x24')](handleEntityNotFound(_0x5ed8bc,null))['then'](function(_0x5d4dd3){if(_0x5d4dd3){return db[_0xbfb0('0x68')]['transaction'](function(_0x1cb991){return db[_0xbfb0('0x4f')][_0xbfb0('0x41')]({'where':{'userProfileId':_0x29efef[_0xbfb0('0x45')]['id']},'attributes':['id'],'raw':!![]})[_0xbfb0('0x24')](function(_0x22d09f){if(_0x22d09f){return db['UserProfileSection'][_0xbfb0('0x55')]({'where':{'userProfileId':_0x29efef[_0xbfb0('0x45')]['id'],'id':_['map'](_0x22d09f,function(_0x1817b0){return _0x1817b0['id'];})},'transaction':_0x1cb991});}})['then'](function(_0x17e22a){var _0x144bc9=_[_0xbfb0('0x2a')](_0x29efef[_0xbfb0('0x49')],function(_0x1b1252){_0x1b1252[_0xbfb0('0x58')]=_0x29efef[_0xbfb0('0x45')]['id'];return _0x1b1252;});return db[_0xbfb0('0x4f')]['bulkCreate'](_0x144bc9,{'raw':!![],'transaction':_0x1cb991});})['then'](function(_0x5cf9d4){var _0x4c02d9=_[_0xbfb0('0x3d')](_['map'](_0x5cf9d4,function(_0x355aba){return _0x355aba[_0xbfb0('0x4b')]({'plain':!![]});}),{'includeAll':![]});if(_0x4c02d9){return db[_0xbfb0('0x4f')][_0xbfb0('0x41')]({'where':{'userProfileId':_0x29efef['params']['id'],'sectionId':_[_0xbfb0('0x2a')](_0x4c02d9,function(_0x124b22){return _0x124b22[_0xbfb0('0x53')];})},'attributes':['id',_0xbfb0('0x53')],'raw':!![]})['then'](function(_0x324443){var _0x4cd4d6=_[_0xbfb0('0x2a')](_0x29efef[_0xbfb0('0x49')],function(_0x21f491){_0x21f491['userProfileId']=_0x29efef[_0xbfb0('0x45')]['id'];return _0x21f491;});return db[_0xbfb0('0x51')]['bulkCreate'](_0x4cd4d6,{'raw':!![],'transaction':_0x1cb991});});}})[_0xbfb0('0x43')](handleError(_0x5ed8bc,null));});}})['then'](function(_0x7cc924){var _0x2e38fc=_[_0xbfb0('0x2a')](_0x7cc924,function(_0x388742){return _0x388742['get']({'plain':!![]});});})[_0xbfb0('0x24')](respondWithResult(_0x5ed8bc,null))[_0xbfb0('0x43')](handleError(_0x5ed8bc,null));};exports[_0xbfb0('0x69')]=function(_0x52d7f6,_0x56a2f1,_0x465dc7){return db[_0xbfb0('0x2b')][_0xbfb0('0x47')]({'where':{'id':_0x52d7f6[_0xbfb0('0x45')]['id']}})['then'](handleEntityNotFound(_0x56a2f1,null))[_0xbfb0('0x24')](function(_0x2a4145){if(_0x2a4145){return _0x2a4145[_0xbfb0('0x69')](_0x52d7f6[_0xbfb0('0x30')][_0xbfb0('0x5b')]);}})[_0xbfb0('0x24')](respondWithStatusCode(_0x56a2f1,null))[_0xbfb0('0x43')](handleError(_0x56a2f1,null));};exports[_0xbfb0('0x6a')]=function(_0x5fc2de,_0x5e35b7){var _0x37bf3e={};if(!_0x5fc2de[_0xbfb0('0x30')]['section'])throw new Error(_0xbfb0('0x6b'));if(!_0x5fc2de[_0xbfb0('0x30')][_0xbfb0('0x38')](_0xbfb0('0x39'))){_0x37bf3e[_0xbfb0('0x1d')]=qs[_0xbfb0('0x1d')](_0x5fc2de[_0xbfb0('0x30')][_0xbfb0('0x1d')]);_0x37bf3e['offset']=qs['offset'](_0x5fc2de[_0xbfb0('0x30')]['offset']);}return db[_0xbfb0('0x2b')]['find']({'where':{'id':_0x5fc2de['params']['id']}})[_0xbfb0('0x24')](function(_0x24ae1c){if(!_0x24ae1c)throw new Error(_0xbfb0('0x6c')+_0x5fc2de[_0xbfb0('0x45')]['id']);return db['UserProfile'][_0xbfb0('0x6a')](_0x5fc2de);})['then'](respondWithFilteredResult(_0x5e35b7,_0x37bf3e))['catch'](handleError(_0x5e35b7,null));};
\ No newline at end of file
index cf71658..30eb78b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x202a=['update','hasOwnProperty','../../mysqldb','UserProfile','setMaxListeners'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x202a,0xc0));var _0xa202=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x202a[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xa202('0x0'))['db'][_0xa202('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xa202('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa202('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4878f5){return function(_0x595945,_0x32f8b7,_0x1ce932){UserProfileEvents['emit'](_0x4878f5+':'+_0x595945['id'],_0x595945);UserProfileEvents['emit'](_0x4878f5,_0x595945);_0x1ce932(null);};}for(var e in events){if(events[_0xa202('0x4')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents;
\ No newline at end of file
+var _0x1410=['UserProfile','setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4fdcc0,_0x560a01){var _0xc0ce94=function(_0x36ea12){while(--_0x36ea12){_0x4fdcc0['push'](_0x4fdcc0['shift']());}};_0xc0ce94(++_0x560a01);}(_0x1410,0x130));var _0x0141=function(_0x1b4c4e,_0x3c0ad5){_0x1b4c4e=_0x1b4c4e-0x0;var _0x489261=_0x1410[_0x1b4c4e];return _0x489261;};'use strict';var EventEmitter=require(_0x0141('0x0'));var UserProfile=require(_0x0141('0x1'))['db'][_0x0141('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x0141('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0141('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3c3422){return function(_0x5d2855,_0x194c72,_0x454af1){UserProfileEvents[_0x0141('0x5')](_0x3c3422+':'+_0x5d2855['id'],_0x5d2855);UserProfileEvents[_0x0141('0x5')](_0x3c3422,_0x5d2855);_0x454af1(null);};}for(var e in events){if(events[_0x0141('0x6')](e)){var event=events[e];UserProfile[_0x0141('0x7')](e,emitEvent(event));}}module[_0x0141('0x8')]=UserProfileEvents;
\ No newline at end of file
index e1fb043..894188e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57ca=['templates','Template','triggers','Trigger','trunks','variables','Variable','plugins','Plugin','extractedreports','Reports','metrics','AnalyticMetric','toUpperCase','slice','Sequelize','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','toString','OpenTabs','UserProfile','user_profiles','query','section','mergeResources','length','push','UserProfileSection','params','all','ignore','isEmpty','union','find','rawAttributes','keys','filters','intersection','fields','attributes','hasOwnProperty','limit','offset','order','sort','pick','merge','key','VIRTUAL','AnalyticExtractedReport','foreignKey','forEach','autoAssociation','includeAll','include','reportType','default','reportId','DefaultReports','custom','count','color','ThroughTags','tag','openTabs','chat','rows','sms','fax','dataValues','mail','openchannel','whatsapp','./userProfile.attributes','../../components/parsers/qs','exports','models','filter','field','findAll','associatedResources','catch','model','then','map','name','resolve','UserProfileResource','resourceId','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','contacts','Lists','lists','CmList','globalcustomfields','CmCustomField','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','internalroutes','outboundroutes','contexts','VoiceContext','voicerecordings','User','role','agent','Telephones','membername','telephone','VoiceQueues','VoiceQueue','inbound','QueueCampaigns','type','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','ivrcampaigns','mailqueues','MailQueue','mailaccounts','MailAccount','OpenchannelAccount','smsqueues','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','teams','Team','voicequeues','queuecampaigns','users','telephones','Users','user','Agents','zendeskaccounts','ZendeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','dispositions','customdashboards','Dashboard','Interval','pauses','Pause','Schedule','sounds','tags'];(function(_0x410482,_0x26f1fc){var _0x31816b=function(_0x5a7708){while(--_0x5a7708){_0x410482['push'](_0x410482['shift']());}};_0x31816b(++_0x26f1fc);}(_0x57ca,0x108));var _0xa57c=function(_0x4d1162,_0x456c5c){_0x4d1162=_0x4d1162-0x0;var _0x184f3c=_0x57ca[_0x4d1162];return _0x184f3c;};'use strict';var _=require('lodash');var attributes=require(_0xa57c('0x0'));var qs=require(_0xa57c('0x1'));var squel=require('squel');module[_0xa57c('0x2')]=function(_0x396613){var _0x1d38e7=_0x396613[_0xa57c('0x3')];function _0x1da469(_0x48be2d,_0x40ba22){return new Promise(function(_0x1c3e31,_0x113dcf){if(!_0x40ba22)return _0x1c3e31(null);var _0x19473f=_0x40ba22[_0xa57c('0x4')]?{[_0x40ba22[_0xa57c('0x4')][_0xa57c('0x5')]]:_0x40ba22[_0xa57c('0x4')]['value']}:undefined;return _0x1d38e7[_0x48be2d][_0xa57c('0x6')]({'where':_0x19473f,'raw':!![]})['then'](function(_0x46ba92){_0x40ba22[_0xa57c('0x7')]=_['map'](_0x46ba92,'id');_0x1c3e31(_0x40ba22);})[_0xa57c('0x8')](function(_0x51f287){_0x113dcf(_0x51f287);});});}function _0x554101(_0x44b221,_0x58e6b6){return new Promise(function(_0x2ed4c6,_0x5a8952){var _0x4200c1=_0x44b221[_0xa57c('0x4')]?{[_0x44b221[_0xa57c('0x4')][_0xa57c('0x5')]]:_0x44b221[_0xa57c('0x4')]['value']}:undefined;return _0x1d38e7[_0x44b221[_0xa57c('0x9')]]['findAll']({'where':_0x4200c1,'raw':!![]})[_0xa57c('0xa')](function(_0x3d5995){_0x58e6b6[_0xa57c('0x7')]=_[_0xa57c('0xb')](_0x3d5995,function(_0x3238ff){return _0x3238ff[_0xa57c('0xc')];});_0x2ed4c6(_0x58e6b6);})[_0xa57c('0x8')](function(_0x4b4bdb){_0x5a8952(_0x4b4bdb);});});}function _0x26607a(_0xdf7ff6,_0x261725,_0x5a6024){if(!_0x261725)return Promise[_0xa57c('0xd')](null);return new Promise(function(_0x5f33f1,_0x3e7afa){return _0x1d38e7[_0xa57c('0xe')][_0xa57c('0x6')]({'where':{'sectionId':_0x261725['id']},'raw':!![]})[_0xa57c('0xa')](function(_0x1fd0d8){if(_0xdf7ff6[_0xa57c('0x5')]&&_0xdf7ff6[_0xa57c('0x5')]!=='id'){_0x261725[_0xa57c('0x7')]=_['map'](_0x1fd0d8,function(_0x8a8856){return _0x8a8856[_0xdf7ff6['field']];});}else{if(_0x5a6024==='AnalyticExtractedReport'){_0x261725[_0xa57c('0x7')]=_[_0xa57c('0xb')](_0x1fd0d8,function(_0x3eee75){return{'id':_0x3eee75[_0xa57c('0xf')],'type':_0x3eee75['type']};});}else{_0x261725[_0xa57c('0x7')]=_[_0xa57c('0xb')](_0x1fd0d8,function(_0x34d1bc){return _0x34d1bc[_0xa57c('0xf')];});}}_0x5f33f1(_0x261725);})[_0xa57c('0x8')](function(_0x1404fd){_0x3e7afa(_0x1404fd);});});}function _0x1e0192(_0x42038e,_0x2e99ed){var _0xdf65dd={'parentSections':[]};switch(_0x42038e[_0xa57c('0x10')]()){case _0xa57c('0x11'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x13');break;case _0xa57c('0x14'):_0xdf65dd['childModel']=_0xa57c('0x15');break;case _0xa57c('0x16'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x17');_0xdf65dd[_0xa57c('0x18')]=[{'name':_0xa57c('0x19'),'field':_0xa57c('0xc'),'foreignKey':_0xa57c('0x1a')}];break;case _0xa57c('0x1b'):_0xdf65dd[_0xa57c('0x12')]='JscriptyProject';break;case _0xa57c('0x1c'):_0xdf65dd['childModel']='CmContact';_0xdf65dd[_0xa57c('0x18')]=[{'name':_0xa57c('0x1d'),'field':'id','foreignKey':'ListId'}];break;case _0xa57c('0x1e'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x1f');break;case'companies':_0xdf65dd[_0xa57c('0x12')]='CmCompany';break;case _0xa57c('0x20'):_0xdf65dd['childModel']=_0xa57c('0x21');break;case'chatqueues':_0xdf65dd[_0xa57c('0x12')]='ChatQueue';break;case _0xa57c('0x22'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x23');break;case _0xa57c('0x24'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x25');break;case _0xa57c('0x26'):_0xdf65dd['childModel']=_0xa57c('0x27');break;case'inboundroutes':case _0xa57c('0x28'):case _0xa57c('0x29'):_0xdf65dd[_0xa57c('0x12')]='VoiceExtension';break;case _0xa57c('0x2a'):_0xdf65dd['childModel']=_0xa57c('0x2b');break;case'voicemails':_0xdf65dd[_0xa57c('0x12')]='VoiceMail';break;case _0xa57c('0x2c'):_0xdf65dd[_0xa57c('0x12')]='VoiceRecording';_0xdf65dd[_0xa57c('0x18')]=[{'name':'Agents','field':_0xa57c('0xc'),'foreignKey':'membername','model':_0xa57c('0x2d'),'filter':{'field':_0xa57c('0x2e'),'value':[_0xa57c('0x2f')]}},{'name':_0xa57c('0x30'),'field':_0xa57c('0xc'),'foreignKey':_0xa57c('0x31'),'model':'User','filter':{'field':'role','value':[_0xa57c('0x32')]}},{'name':_0xa57c('0x33'),'field':_0xa57c('0xc'),'foreignKey':'queue','model':_0xa57c('0x34'),'filter':{'field':'type','value':[_0xa57c('0x35')]}},{'name':_0xa57c('0x36'),'field':'name','foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0xa57c('0x37'),'value':[_0xa57c('0x38')]}}];break;case _0xa57c('0x39'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x3a');break;case _0xa57c('0x3b'):_0xdf65dd['childModel']=_0xa57c('0x3c');break;case _0xa57c('0x3d'):_0xdf65dd['childModel']='VoicePrefix';break;case _0xa57c('0x3e'):_0xdf65dd[_0xa57c('0x12')]='Campaign';break;case _0xa57c('0x3f'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x40');break;case _0xa57c('0x41'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x42');break;case'mailsubstatuses':_0xdf65dd[_0xa57c('0x12')]='MailSubstatus';break;case'openchannelqueues':_0xdf65dd['childModel']='OpenchannelQueue';break;case'openchannelaccounts':_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x43');break;case _0xa57c('0x44'):_0xdf65dd['childModel']='SmsQueue';break;case'smsaccounts':_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x45');break;case _0xa57c('0x46'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x47');break;case _0xa57c('0x48'):_0xdf65dd['childModel']=_0xa57c('0x49');break;case _0xa57c('0x4a'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x4b');break;case _0xa57c('0x4c'):case _0xa57c('0x4d'):_0xdf65dd['childModel']=_0xa57c('0x34');if(_0x2e99ed){_0xdf65dd[_0xa57c('0x18')]=[{'name':_0xa57c('0x33')},{'name':_0xa57c('0x36')}];}break;case _0xa57c('0x4e'):case'agents':case _0xa57c('0x4f'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x2d');if(_0x2e99ed){_0xdf65dd[_0xa57c('0x18')]=[{'name':_0xa57c('0x50'),'filter':{'field':_0xa57c('0x2e'),'value':['admin',_0xa57c('0x51')]},'ignore':!![]},{'name':_0xa57c('0x52')},{'name':_0xa57c('0x30')}];}break;case _0xa57c('0x53'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x54');break;case'salesforceaccounts':_0xdf65dd['childModel']='SalesforceAccount';break;case'freshdeskaccounts':_0xdf65dd[_0xa57c('0x12')]='FreshdeskAccount';break;case _0xa57c('0x55'):_0xdf65dd[_0xa57c('0x12')]='SugarcrmAccount';break;case _0xa57c('0x56'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x57');break;case _0xa57c('0x58'):_0xdf65dd[_0xa57c('0x12')]='ZohoAccount';break;case _0xa57c('0x59'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x2d');break;case _0xa57c('0x5a'):_0xdf65dd[_0xa57c('0x12')]='CannedAnswer';break;case _0xa57c('0x5b'):_0xdf65dd['childModel']='Disposition';break;case _0xa57c('0x5c'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x5d');break;case'intervals':_0xdf65dd['childModel']=_0xa57c('0x5e');break;case _0xa57c('0x5f'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x60');break;case'scheduler':_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x61');break;case _0xa57c('0x62'):_0xdf65dd['childModel']='Sound';break;case _0xa57c('0x63'):_0xdf65dd[_0xa57c('0x12')]='Tag';break;case _0xa57c('0x64'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x65');break;case _0xa57c('0x66'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x67');break;case _0xa57c('0x68'):_0xdf65dd['childModel']='Trunk';break;case _0xa57c('0x69'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x6a');break;case _0xa57c('0x6b'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x6c');break;case _0xa57c('0x6d'):_0xdf65dd[_0xa57c('0x12')]='AnalyticExtractedReport';_0xdf65dd['parentSections']=[{'name':_0xa57c('0x6e'),'field':'id','foreignKey':'reportId'}];break;case _0xa57c('0x6f'):_0xdf65dd[_0xa57c('0x12')]=_0xa57c('0x70');break;}return _0xdf65dd;}function _0x563da6(_0xea62f0,_0x5b3bf0){var _0x21b00a=_0xea62f0['charAt'](0x0)[_0xa57c('0x71')]()+_0xea62f0[_0xa57c('0x72')](0x1);var _0x398743={'type':_0x1d38e7[_0xa57c('0x73')]['QueryTypes'][_0xa57c('0x74')],'raw':!![]};return new Promise(function(_0x2f8d23,_0x3bd25a){var _0x2b6535=squel[_0xa57c('0x75')]()['field'](_0xa57c('0x76')+_0x21b00a+_0xa57c('0x77'),'id')[_0xa57c('0x5')](_0xa57c('0x78'))[_0xa57c('0x79')](_0xa57c('0x7a')+_0xea62f0+_0xa57c('0x7b'),'ui')[_0xa57c('0x7c')](_0xa57c('0x7d'),_0x5b3bf0['id']);return _0x1d38e7[_0xa57c('0x7e')]['query'](_0x2b6535[_0xa57c('0x7f')](),_0x398743)[_0xa57c('0xa')](function(_0x1bc70b){_0x5b3bf0[_0x21b00a+_0xa57c('0x80')]=_0x1bc70b;_0x2f8d23(_0x1bc70b);})[_0xa57c('0x8')](function(_0x3b286d){_0x3bd25a(_0x3b286d);});});}return _0x396613['define'](_0xa57c('0x81'),attributes,{'tableName':_0xa57c('0x82'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x521acc){var _0xb164af={'raw':![],'where':{}};var _0x3f5c19={};var _0x29c66f={'count':0x0,'rows':[]};var _0xa78a75=_0x521acc[_0xa57c('0x83')][_0xa57c('0x84')];var _0x24efa0=_0x521acc['query'][_0xa57c('0x85')]||![];var _0x5a5653=_0x1e0192(_0xa78a75,_0x24efa0);if(!_0x5a5653[_0xa57c('0x12')])throw new Error('Invalid\x20section\x20\x27'+_0xa78a75+'\x27');var _0x1a8686=[{'name':_0xa78a75}];if(!_['isEmpty'](_0x5a5653[_0xa57c('0x18')]))_0x1a8686=_0x5a5653[_0xa57c('0x18')];var _0x5d99e4=[];for(var _0x165f04=0x0;_0x165f04<_0x1a8686[_0xa57c('0x86')];_0x165f04++){_0x5d99e4[_0xa57c('0x87')](_0x1d38e7[_0xa57c('0x88')]['find']({'where':{'userProfileId':_0x521acc[_0xa57c('0x89')]['id'],'name':_0x1a8686[_0x165f04][_0xa57c('0xc')]},'raw':!![]}));}return Promise[_0xa57c('0x8a')](_0x5d99e4)[_0xa57c('0xa')](function(_0x3fdaac){var _0x3d766a=_[_0xa57c('0x4')](_0x3fdaac,function(_0x2a5983){return _0x2a5983?_0x2a5983:undefined;});var _0x11c13e=_[_0xa57c('0x4')](_0x1a8686,[_0xa57c('0x8b'),!![]]);var _0x399968=_[_0xa57c('0x8c')](_0x3d766a)&&_[_0xa57c('0x8c')](_0x11c13e)?null:_[_0xa57c('0x8d')](_0x11c13e,_0x3d766a);if(!_0x399968)return null;var _0x1e286e=[];for(var _0x49545f=0x0;_0x49545f<_0x399968[_0xa57c('0x86')];_0x49545f++){var _0x521503=_[_0xa57c('0x8e')](_0x1a8686,function(_0x24b09a){return _0x399968[_0x49545f]?_0x24b09a[_0xa57c('0xc')]===_0x399968[_0x49545f]['name']:null;});if(_0x521503){if(_0x399968[_0x49545f][_0xa57c('0x8b')]){_0x1e286e[_0xa57c('0x87')](_0x1da469(_0x5a5653[_0xa57c('0x12')],_0x399968[_0x49545f]));}else{if(!_0x399968[_0x49545f]['autoAssociation']){_0x1e286e['push'](_0x26607a(_0x521503,_0x399968[_0x49545f],_0x5a5653[_0xa57c('0x12')]));}else{if(_0x521503[_0xa57c('0x9')]){_0x1e286e[_0xa57c('0x87')](_0x554101(_0x521503,_0x399968[_0x49545f]));}}}}}return Promise[_0xa57c('0x8a')](_0x1e286e);})[_0xa57c('0xa')](function(_0x39411b){var _0x2a7aab=_0x39411b;var _0x33f20e=null;if(_0x2a7aab){_0x33f20e=_0x2a7aab[_0xa57c('0x86')]===0x1?_0x2a7aab[0x0]:null;}if(!_0x33f20e&&!_0x2a7aab)return _0x29c66f;var _0x57b6a3=_0x1d38e7[_0x5a5653[_0xa57c('0x12')]][_0xa57c('0x8f')];_0x3f5c19['model']=_[_0xa57c('0x90')](_0x57b6a3);_0x3f5c19[_0xa57c('0x83')]=_[_0xa57c('0x90')](_0x521acc[_0xa57c('0x83')]);_0x3f5c19[_0xa57c('0x91')]=_[_0xa57c('0x92')](_0x3f5c19[_0xa57c('0x9')],_0x3f5c19[_0xa57c('0x83')]);_0xb164af['attributes']=_[_0xa57c('0x92')](_0x3f5c19[_0xa57c('0x9')],qs['fields'](_0x521acc[_0xa57c('0x83')][_0xa57c('0x93')]));_0xb164af['attributes']=_0xb164af['attributes'][_0xa57c('0x86')]?_0xb164af[_0xa57c('0x94')]:_0x3f5c19[_0xa57c('0x9')];if(!_0x521acc[_0xa57c('0x83')][_0xa57c('0x95')]('nolimit')){_0xb164af[_0xa57c('0x96')]=qs[_0xa57c('0x96')](_0x521acc[_0xa57c('0x83')]['limit']);_0xb164af[_0xa57c('0x97')]=qs['offset'](_0x521acc[_0xa57c('0x83')][_0xa57c('0x97')]);}_0xb164af[_0xa57c('0x98')]=qs[_0xa57c('0x99')](_0x521acc['query'][_0xa57c('0x99')]);_0xb164af[_0xa57c('0x7c')]=qs[_0xa57c('0x91')](_[_0xa57c('0x9a')](_0x521acc['query'],_0x3f5c19[_0xa57c('0x91')]));if(_0x521acc[_0xa57c('0x83')][_0xa57c('0x4')]){_0xb164af['where']=_[_0xa57c('0x9b')](_0xb164af[_0xa57c('0x7c')],{'$or':_[_0xa57c('0xb')](_0x57b6a3,function(_0x5f267d){if(_0x5f267d[_0xa57c('0x37')][_0xa57c('0x9c')]!==_0xa57c('0x9d')){var _0x173f16={};_0x173f16[_0x5f267d['field']]={'$like':'%'+_0x521acc[_0xa57c('0x83')][_0xa57c('0x4')]+'%'};return _0x173f16;}})});}var _0x5c92ec=[];var _0x2dac12=null;var _0x1157ea={};if(_0x33f20e){_0x2dac12=_['find'](_0x1a8686,[_0xa57c('0xc'),_0x33f20e['name']]);if(_0x2dac12[_0xa57c('0x5')]){_0x1157ea={};if(_0x5a5653[_0xa57c('0x12')]===_0xa57c('0x9e')){_0x1157ea[_0x2dac12[_0xa57c('0x9f')]]=_['map'](_0x33f20e[_0xa57c('0x7')],'id');}else{_0x1157ea[_0x2dac12[_0xa57c('0x9f')]]=_0x33f20e[_0xa57c('0x7')];}_0x5c92ec[_0xa57c('0x87')](_0x1157ea);}else{_0xb164af[_0xa57c('0x7c')]['id']=_0x33f20e[_0xa57c('0x7')];}}else{for(var _0x18b36e=0x0;_0x18b36e<_0x2a7aab[_0xa57c('0x86')];_0x18b36e++){_0x2dac12=_[_0xa57c('0x8e')](_0x1a8686,[_0xa57c('0xc'),_0x2a7aab[_0x18b36e][_0xa57c('0xc')]]);if(_0x2dac12['field']){_0x1157ea={};_0x1157ea[_0x2dac12['foreignKey']]=_0x2a7aab[_0x18b36e]['associatedResources'];_0x5c92ec[_0xa57c('0x87')](_0x1157ea);}else{if(!_0xb164af['where']['id'])_0xb164af[_0xa57c('0x7c')]['id']=[];_0x2a7aab[_0x18b36e][_0xa57c('0x7')][_0xa57c('0xa0')](function(_0x4c543a){_0xb164af[_0xa57c('0x7c')]['id'][_0xa57c('0x87')](_0x4c543a);});}}}if(!_[_0xa57c('0x8c')](_0x5c92ec)){_0xb164af[_0xa57c('0x7c')]=_[_0xa57c('0x9b')](_0xb164af[_0xa57c('0x7c')],{'$and':{'$or':_0x5c92ec}});}_0xb164af=_[_0xa57c('0x9b')]({},_0xb164af,_0x521acc['options']);if(_0x33f20e&&!_0x33f20e[_0xa57c('0xa1')]&&_0x5a5653[_0xa57c('0x12')]==='AnalyticExtractedReport'){if(_0x521acc['query'][_0xa57c('0xa2')]){_0xb164af[_0xa57c('0xa3')]=[{'all':!![]}];}return _0x1d38e7[_0x5a5653['childModel']]['findAll'](_0xb164af)[_0xa57c('0xa')](function(_0x4962ae){var _0x3726ee=[];_0x4962ae[_0xa57c('0xa0')](function(_0x4962c9){var _0x1cda66;switch(_0x4962c9[_0xa57c('0xa4')]){case _0xa57c('0xa5'):_0x1cda66=_[_0xa57c('0x8e')](_0x33f20e[_0xa57c('0x7')],function(_0x4dd551){return _0x4dd551['id']===_0x4962c9[_0xa57c('0xa6')]&&_0x4dd551['type']===_0xa57c('0xa7');});break;case _0xa57c('0xa8'):_0x1cda66=_['find'](_0x33f20e['associatedResources'],function(_0x4925da){return _0x4925da['id']===_0x4962c9[_0xa57c('0xa6')]&&_0x4925da['type']==='CustomReports';});break;}if(_0x1cda66)_0x3726ee[_0xa57c('0x87')](_0x4962c9);});_0x29c66f[_0xa57c('0xa9')]=_0x3726ee[_0xa57c('0x86')];_0x29c66f['rows']=_0x3726ee;return _0x29c66f;});}else{return _0x1d38e7[_0x5a5653[_0xa57c('0x12')]][_0xa57c('0xa9')]({'where':_0xb164af[_0xa57c('0x7c')]})['then'](function(_0x4b8228){_0x29c66f[_0xa57c('0xa9')]=_0x4b8228;if(_0x521acc['query'][_0xa57c('0xa2')]){if(_0x5a5653[_0xa57c('0x12')]==='CmContact'){_0xb164af[_0xa57c('0xa3')]=[{'model':_0x1d38e7['Tag'],'as':'Tags','attributes':['id','name',_0xa57c('0xaa')],'required':_0x521acc['query']['tag']?!![]:![]},{'model':_0x1d38e7['Tag'],'as':_0xa57c('0xab'),'attributes':['id',_0xa57c('0xc'),'color'],'through':_0x521acc[_0xa57c('0x83')][_0xa57c('0xac')]?{'attributes':[],'where':{'TagId':_0x521acc[_0xa57c('0x83')]['tag']||undefined}}:{},'required':_0x521acc[_0xa57c('0x83')][_0xa57c('0xac')]?!![]:![]}];}else{_0xb164af[_0xa57c('0xa3')]=[{'all':!![]}];}}return _0x1d38e7[_0x5a5653[_0xa57c('0x12')]]['findAll'](_0xb164af);})['then'](function(_0x8391f9){_0x29c66f['rows']=_0x8391f9;if(_0xa78a75===_0xa57c('0x52')&&_0x521acc[_0xa57c('0x83')][_0xa57c('0xad')]==='true'){var _0x138c4e=[];for(var _0x513f24=0x0;_0x513f24<_0x29c66f['rows'][_0xa57c('0x86')];_0x513f24++){_0x138c4e['push'](_0x563da6(_0xa57c('0xae'),_0x29c66f[_0xa57c('0xaf')][_0x513f24]['dataValues']));_0x138c4e['push'](_0x563da6(_0xa57c('0xb0'),_0x29c66f[_0xa57c('0xaf')][_0x513f24]['dataValues']));_0x138c4e['push'](_0x563da6(_0xa57c('0xb1'),_0x29c66f[_0xa57c('0xaf')][_0x513f24][_0xa57c('0xb2')]));_0x138c4e['push'](_0x563da6(_0xa57c('0xb3'),_0x29c66f[_0xa57c('0xaf')][_0x513f24][_0xa57c('0xb2')]));_0x138c4e[_0xa57c('0x87')](_0x563da6(_0xa57c('0xb4'),_0x29c66f[_0xa57c('0xaf')][_0x513f24][_0xa57c('0xb2')]));_0x138c4e[_0xa57c('0x87')](_0x563da6(_0xa57c('0xb5'),_0x29c66f[_0xa57c('0xaf')][_0x513f24][_0xa57c('0xb2')]));}return Promise[_0xa57c('0x8a')](_0x138c4e)[_0xa57c('0xa')](function(){return _0x29c66f;});}return _0x29c66f;});}});}}});};
\ No newline at end of file
+var _0x6a55=['model','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','sort','filters','pick','merge','VIRTUAL','foreignKey','forEach','include','reportType','default','DefaultReports','custom','count','rows','Tags','color','tag','openTabs','true','chat','dataValues','sms','fax','openchannel','whatsapp','lodash','exports','models','filter','field','value','then','associatedResources','map','catch','name','resolve','UserProfileResource','findAll','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','SquareRecording','parentSections','SquareProjects','projects','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','faxqueues','FaxQueue','FaxAccount','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','User','telephone','VoiceQueues','VoiceQueue','type','inbound','QueueCampaigns','queue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','voicequeues','queuecampaigns','agents','admin','user','zendeskaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','DeskAccount','ZohoAccount','vtigeraccounts','CannedAnswer','dispositions','Disposition','Dashboard','Interval','pauses','Pause','sounds','Sound','tags','Tag','Template','triggers','Trigger','trunks','Trunk','variables','plugins','extractedreports','Reports','reportId','metrics','AnalyticMetric','toUpperCase','slice','Sequelize','QueryTypes','SELECT','select','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','UserProfile','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','autoAssociation'];(function(_0x17a464,_0x4084f4){var _0x343d5a=function(_0xfeb9ea){while(--_0xfeb9ea){_0x17a464['push'](_0x17a464['shift']());}};_0x343d5a(++_0x4084f4);}(_0x6a55,0xdb));var _0x56a5=function(_0x386b69,_0x5d9360){_0x386b69=_0x386b69-0x0;var _0x476415=_0x6a55[_0x386b69];return _0x476415;};'use strict';var _=require(_0x56a5('0x0'));var attributes=require('./userProfile.attributes');var qs=require('../../components/parsers/qs');var squel=require('squel');module[_0x56a5('0x1')]=function(_0x47b337){var _0x561353=_0x47b337[_0x56a5('0x2')];function _0x5e5a32(_0x3ff76a,_0x5171fa){return new Promise(function(_0x28bb2b,_0x380b1b){if(!_0x5171fa)return _0x28bb2b(null);var _0x42d164=_0x5171fa[_0x56a5('0x3')]?{[_0x5171fa[_0x56a5('0x3')][_0x56a5('0x4')]]:_0x5171fa[_0x56a5('0x3')][_0x56a5('0x5')]}:undefined;return _0x561353[_0x3ff76a]['findAll']({'where':_0x42d164,'raw':!![]})[_0x56a5('0x6')](function(_0xf15490){_0x5171fa[_0x56a5('0x7')]=_[_0x56a5('0x8')](_0xf15490,'id');_0x28bb2b(_0x5171fa);})[_0x56a5('0x9')](function(_0x3a721d){_0x380b1b(_0x3a721d);});});}function _0x2ad997(_0x258c20,_0x1f5a47){return new Promise(function(_0x4cd7c4,_0x49711d){var _0x2110a9=_0x258c20[_0x56a5('0x3')]?{[_0x258c20[_0x56a5('0x3')][_0x56a5('0x4')]]:_0x258c20[_0x56a5('0x3')][_0x56a5('0x5')]}:undefined;return _0x561353[_0x258c20['model']]['findAll']({'where':_0x2110a9,'raw':!![]})[_0x56a5('0x6')](function(_0x1e416f){_0x1f5a47[_0x56a5('0x7')]=_[_0x56a5('0x8')](_0x1e416f,function(_0x310c32){return _0x310c32[_0x56a5('0xa')];});_0x4cd7c4(_0x1f5a47);})[_0x56a5('0x9')](function(_0x5c4028){_0x49711d(_0x5c4028);});});}function _0x360297(_0x5488c6,_0x41e8b6,_0x51d031){if(!_0x41e8b6)return Promise[_0x56a5('0xb')](null);return new Promise(function(_0x3f3e5b,_0x173c65){return _0x561353[_0x56a5('0xc')][_0x56a5('0xd')]({'where':{'sectionId':_0x41e8b6['id']},'raw':!![]})[_0x56a5('0x6')](function(_0x1dddec){if(_0x5488c6['field']&&_0x5488c6[_0x56a5('0x4')]!=='id'){_0x41e8b6[_0x56a5('0x7')]=_[_0x56a5('0x8')](_0x1dddec,function(_0x127d73){return _0x127d73[_0x5488c6['field']];});}else{if(_0x51d031===_0x56a5('0xe')){_0x41e8b6[_0x56a5('0x7')]=_[_0x56a5('0x8')](_0x1dddec,function(_0x15e469){return{'id':_0x15e469[_0x56a5('0xf')],'type':_0x15e469['type']};});}else{_0x41e8b6['associatedResources']=_[_0x56a5('0x8')](_0x1dddec,function(_0x1c4ab8){return _0x1c4ab8['resourceId'];});}}_0x3f3e5b(_0x41e8b6);})[_0x56a5('0x9')](function(_0x309fa5){_0x173c65(_0x309fa5);});});}function _0x615d49(_0x15d9f8,_0xe1ded0){var _0x616922={'parentSections':[]};switch(_0x15d9f8[_0x56a5('0x10')]()){case _0x56a5('0x11'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x13');break;case _0x56a5('0x14'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x15');break;case'squarerecordings':_0x616922[_0x56a5('0x12')]=_0x56a5('0x16');_0x616922[_0x56a5('0x17')]=[{'name':_0x56a5('0x18'),'field':_0x56a5('0xa'),'foreignKey':'projectName'}];break;case _0x56a5('0x19'):_0x616922['childModel']=_0x56a5('0x1a');break;case _0x56a5('0x1b'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x1c');_0x616922['parentSections']=[{'name':_0x56a5('0x1d'),'field':'id','foreignKey':_0x56a5('0x1e')}];break;case _0x56a5('0x1f'):_0x616922['childModel']=_0x56a5('0x20');break;case _0x56a5('0x21'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x22');break;case _0x56a5('0x23'):_0x616922['childModel']=_0x56a5('0x24');break;case _0x56a5('0x25'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x26');break;case _0x56a5('0x27'):_0x616922['childModel']='ChatWebsite';break;case _0x56a5('0x28'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x29');break;case'faxaccounts':_0x616922[_0x56a5('0x12')]=_0x56a5('0x2a');break;case'inboundroutes':case'internalroutes':case'outboundroutes':_0x616922['childModel']=_0x56a5('0x2b');break;case _0x56a5('0x2c'):_0x616922[_0x56a5('0x12')]='VoiceContext';break;case _0x56a5('0x2d'):_0x616922['childModel']=_0x56a5('0x2e');break;case _0x56a5('0x2f'):_0x616922['childModel']=_0x56a5('0x30');_0x616922['parentSections']=[{'name':_0x56a5('0x31'),'field':_0x56a5('0xa'),'foreignKey':_0x56a5('0x32'),'model':'User','filter':{'field':_0x56a5('0x33'),'value':[_0x56a5('0x34')]}},{'name':_0x56a5('0x35'),'field':'name','foreignKey':_0x56a5('0x32'),'model':_0x56a5('0x36'),'filter':{'field':_0x56a5('0x33'),'value':[_0x56a5('0x37')]}},{'name':_0x56a5('0x38'),'field':'name','foreignKey':'queue','model':_0x56a5('0x39'),'filter':{'field':_0x56a5('0x3a'),'value':[_0x56a5('0x3b')]}},{'name':_0x56a5('0x3c'),'field':_0x56a5('0xa'),'foreignKey':_0x56a5('0x3d'),'model':_0x56a5('0x39'),'filter':{'field':_0x56a5('0x3a'),'value':[_0x56a5('0x3e')]}}];break;case _0x56a5('0x3f'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x40');break;case _0x56a5('0x41'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x42');break;case _0x56a5('0x43'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x44');break;case _0x56a5('0x45'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x46');break;case _0x56a5('0x47'):_0x616922['childModel']='MailQueue';break;case _0x56a5('0x48'):_0x616922['childModel']=_0x56a5('0x49');break;case _0x56a5('0x4a'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x4b');break;case _0x56a5('0x4c'):_0x616922[_0x56a5('0x12')]='OpenchannelQueue';break;case'openchannelaccounts':_0x616922[_0x56a5('0x12')]=_0x56a5('0x4d');break;case _0x56a5('0x4e'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x4f');break;case _0x56a5('0x50'):_0x616922['childModel']=_0x56a5('0x51');break;case _0x56a5('0x52'):_0x616922['childModel']=_0x56a5('0x53');break;case _0x56a5('0x54'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x55');break;case'teams':_0x616922[_0x56a5('0x12')]='Team';break;case _0x56a5('0x56'):case _0x56a5('0x57'):_0x616922['childModel']=_0x56a5('0x39');if(_0xe1ded0){_0x616922['parentSections']=[{'name':_0x56a5('0x38')},{'name':_0x56a5('0x3c')}];}break;case'users':case _0x56a5('0x58'):case'telephones':_0x616922[_0x56a5('0x12')]='User';if(_0xe1ded0){_0x616922[_0x56a5('0x17')]=[{'name':'Users','filter':{'field':_0x56a5('0x33'),'value':[_0x56a5('0x59'),_0x56a5('0x5a')]},'ignore':!![]},{'name':_0x56a5('0x31')},{'name':_0x56a5('0x35')}];}break;case _0x56a5('0x5b'):_0x616922[_0x56a5('0x12')]='ZendeskAccount';break;case'salesforceaccounts':_0x616922['childModel']=_0x56a5('0x5c');break;case _0x56a5('0x5d'):_0x616922[_0x56a5('0x12')]='FreshdeskAccount';break;case _0x56a5('0x5e'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x5f');break;case'deskaccounts':_0x616922[_0x56a5('0x12')]=_0x56a5('0x60');break;case'zohoaccounts':_0x616922[_0x56a5('0x12')]=_0x56a5('0x61');break;case _0x56a5('0x62'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x36');break;case'cannedanswers':_0x616922[_0x56a5('0x12')]=_0x56a5('0x63');break;case _0x56a5('0x64'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x65');break;case'customdashboards':_0x616922[_0x56a5('0x12')]=_0x56a5('0x66');break;case'intervals':_0x616922[_0x56a5('0x12')]=_0x56a5('0x67');break;case _0x56a5('0x68'):_0x616922['childModel']=_0x56a5('0x69');break;case'scheduler':_0x616922[_0x56a5('0x12')]='Schedule';break;case _0x56a5('0x6a'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x6b');break;case _0x56a5('0x6c'):_0x616922['childModel']=_0x56a5('0x6d');break;case'templates':_0x616922[_0x56a5('0x12')]=_0x56a5('0x6e');break;case _0x56a5('0x6f'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x70');break;case _0x56a5('0x71'):_0x616922[_0x56a5('0x12')]=_0x56a5('0x72');break;case _0x56a5('0x73'):_0x616922[_0x56a5('0x12')]='Variable';break;case _0x56a5('0x74'):_0x616922[_0x56a5('0x12')]='Plugin';break;case _0x56a5('0x75'):_0x616922['childModel']=_0x56a5('0xe');_0x616922[_0x56a5('0x17')]=[{'name':_0x56a5('0x76'),'field':'id','foreignKey':_0x56a5('0x77')}];break;case _0x56a5('0x78'):_0x616922['childModel']=_0x56a5('0x79');break;}return _0x616922;}function _0x3cd325(_0x97b0ed,_0x1a5689){var _0x580f08=_0x97b0ed['charAt'](0x0)[_0x56a5('0x7a')]()+_0x97b0ed[_0x56a5('0x7b')](0x1);var _0x3a3d72={'type':_0x561353[_0x56a5('0x7c')][_0x56a5('0x7d')][_0x56a5('0x7e')],'raw':!![]};return new Promise(function(_0x27ce71,_0x5770eb){var _0x105fcc=squel[_0x56a5('0x7f')]()[_0x56a5('0x4')]('ui.'+_0x580f08+'InteractionId','id')[_0x56a5('0x4')](_0x56a5('0x80'))[_0x56a5('0x81')](_0x56a5('0x82')+_0x97b0ed+_0x56a5('0x83'),'ui')[_0x56a5('0x84')](_0x56a5('0x85'),_0x1a5689['id']);return _0x561353['sequelize'][_0x56a5('0x86')](_0x105fcc[_0x56a5('0x87')](),_0x3a3d72)[_0x56a5('0x6')](function(_0x4240e3){_0x1a5689[_0x580f08+_0x56a5('0x88')]=_0x4240e3;_0x27ce71(_0x4240e3);})[_0x56a5('0x9')](function(_0x50b7d0){_0x5770eb(_0x50b7d0);});});}return _0x47b337[_0x56a5('0x89')](_0x56a5('0x8a'),attributes,{'tableName':_0x56a5('0x8b'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x42db28){var _0x180d29={'raw':![],'where':{}};var _0x263c59={};var _0x4b6906={'count':0x0,'rows':[]};var _0x5ed269=_0x42db28[_0x56a5('0x86')][_0x56a5('0x8c')];var _0x3f7ed3=_0x42db28['query'][_0x56a5('0x8d')]||![];var _0x189bf0=_0x615d49(_0x5ed269,_0x3f7ed3);if(!_0x189bf0[_0x56a5('0x12')])throw new Error(_0x56a5('0x8e')+_0x5ed269+'\x27');var _0x81a6ef=[{'name':_0x5ed269}];if(!_[_0x56a5('0x8f')](_0x189bf0[_0x56a5('0x17')]))_0x81a6ef=_0x189bf0[_0x56a5('0x17')];var _0x58f245=[];for(var _0x96093a=0x0;_0x96093a<_0x81a6ef[_0x56a5('0x90')];_0x96093a++){_0x58f245[_0x56a5('0x91')](_0x561353[_0x56a5('0x92')][_0x56a5('0x93')]({'where':{'userProfileId':_0x42db28[_0x56a5('0x94')]['id'],'name':_0x81a6ef[_0x96093a][_0x56a5('0xa')]},'raw':!![]}));}return Promise[_0x56a5('0x95')](_0x58f245)[_0x56a5('0x6')](function(_0x6f470b){var _0xc65be8=_[_0x56a5('0x3')](_0x6f470b,function(_0xcb9103){return _0xcb9103?_0xcb9103:undefined;});var _0x1f602f=_[_0x56a5('0x3')](_0x81a6ef,['ignore',!![]]);var _0x1242d6=_[_0x56a5('0x8f')](_0xc65be8)&&_[_0x56a5('0x8f')](_0x1f602f)?null:_['union'](_0x1f602f,_0xc65be8);if(!_0x1242d6)return null;var _0x38c24d=[];for(var _0x58b0fc=0x0;_0x58b0fc<_0x1242d6[_0x56a5('0x90')];_0x58b0fc++){var _0x463196=_[_0x56a5('0x93')](_0x81a6ef,function(_0x51981a){return _0x1242d6[_0x58b0fc]?_0x51981a[_0x56a5('0xa')]===_0x1242d6[_0x58b0fc][_0x56a5('0xa')]:null;});if(_0x463196){if(_0x1242d6[_0x58b0fc]['ignore']){_0x38c24d[_0x56a5('0x91')](_0x5e5a32(_0x189bf0[_0x56a5('0x12')],_0x1242d6[_0x58b0fc]));}else{if(!_0x1242d6[_0x58b0fc][_0x56a5('0x96')]){_0x38c24d[_0x56a5('0x91')](_0x360297(_0x463196,_0x1242d6[_0x58b0fc],_0x189bf0[_0x56a5('0x12')]));}else{if(_0x463196[_0x56a5('0x97')]){_0x38c24d[_0x56a5('0x91')](_0x2ad997(_0x463196,_0x1242d6[_0x58b0fc]));}}}}}return Promise['all'](_0x38c24d);})[_0x56a5('0x6')](function(_0x56318b){var _0x5160c0=_0x56318b;var _0x3b4acf=null;if(_0x5160c0){_0x3b4acf=_0x5160c0[_0x56a5('0x90')]===0x1?_0x5160c0[0x0]:null;}if(!_0x3b4acf&&!_0x5160c0)return _0x4b6906;var _0x2586d5=_0x561353[_0x189bf0[_0x56a5('0x12')]]['rawAttributes'];_0x263c59[_0x56a5('0x97')]=_[_0x56a5('0x98')](_0x2586d5);_0x263c59[_0x56a5('0x86')]=_['keys'](_0x42db28[_0x56a5('0x86')]);_0x263c59['filters']=_[_0x56a5('0x99')](_0x263c59[_0x56a5('0x97')],_0x263c59[_0x56a5('0x86')]);_0x180d29[_0x56a5('0x9a')]=_[_0x56a5('0x99')](_0x263c59['model'],qs[_0x56a5('0x9b')](_0x42db28[_0x56a5('0x86')]['fields']));_0x180d29[_0x56a5('0x9a')]=_0x180d29[_0x56a5('0x9a')][_0x56a5('0x90')]?_0x180d29['attributes']:_0x263c59[_0x56a5('0x97')];if(!_0x42db28[_0x56a5('0x86')][_0x56a5('0x9c')](_0x56a5('0x9d'))){_0x180d29[_0x56a5('0x9e')]=qs[_0x56a5('0x9e')](_0x42db28[_0x56a5('0x86')][_0x56a5('0x9e')]);_0x180d29[_0x56a5('0x9f')]=qs[_0x56a5('0x9f')](_0x42db28[_0x56a5('0x86')][_0x56a5('0x9f')]);}_0x180d29['order']=qs['sort'](_0x42db28[_0x56a5('0x86')][_0x56a5('0xa0')]);_0x180d29[_0x56a5('0x84')]=qs[_0x56a5('0xa1')](_[_0x56a5('0xa2')](_0x42db28[_0x56a5('0x86')],_0x263c59[_0x56a5('0xa1')]));if(_0x42db28[_0x56a5('0x86')][_0x56a5('0x3')]){_0x180d29[_0x56a5('0x84')]=_[_0x56a5('0xa3')](_0x180d29[_0x56a5('0x84')],{'$or':_[_0x56a5('0x8')](_0x2586d5,function(_0x278940){if(_0x278940[_0x56a5('0x3a')]['key']!==_0x56a5('0xa4')){var _0x537cd4={};_0x537cd4[_0x278940[_0x56a5('0x4')]]={'$like':'%'+_0x42db28[_0x56a5('0x86')][_0x56a5('0x3')]+'%'};return _0x537cd4;}})});}var _0x474c42=[];var _0x1937ec=null;var _0x5a4de5={};if(_0x3b4acf){_0x1937ec=_[_0x56a5('0x93')](_0x81a6ef,[_0x56a5('0xa'),_0x3b4acf[_0x56a5('0xa')]]);if(_0x1937ec['field']){_0x5a4de5={};if(_0x189bf0[_0x56a5('0x12')]===_0x56a5('0xe')){_0x5a4de5[_0x1937ec[_0x56a5('0xa5')]]=_[_0x56a5('0x8')](_0x3b4acf[_0x56a5('0x7')],'id');}else{_0x5a4de5[_0x1937ec[_0x56a5('0xa5')]]=_0x3b4acf['associatedResources'];}_0x474c42['push'](_0x5a4de5);}else{_0x180d29[_0x56a5('0x84')]['id']=_0x3b4acf[_0x56a5('0x7')];}}else{for(var _0x544671=0x0;_0x544671<_0x5160c0['length'];_0x544671++){_0x1937ec=_['find'](_0x81a6ef,[_0x56a5('0xa'),_0x5160c0[_0x544671]['name']]);if(_0x1937ec[_0x56a5('0x4')]){_0x5a4de5={};_0x5a4de5[_0x1937ec[_0x56a5('0xa5')]]=_0x5160c0[_0x544671][_0x56a5('0x7')];_0x474c42['push'](_0x5a4de5);}else{if(!_0x180d29[_0x56a5('0x84')]['id'])_0x180d29[_0x56a5('0x84')]['id']=[];_0x5160c0[_0x544671][_0x56a5('0x7')][_0x56a5('0xa6')](function(_0x28f16d){_0x180d29['where']['id']['push'](_0x28f16d);});}}}if(!_[_0x56a5('0x8f')](_0x474c42)){_0x180d29[_0x56a5('0x84')]=_[_0x56a5('0xa3')](_0x180d29[_0x56a5('0x84')],{'$and':{'$or':_0x474c42}});}_0x180d29=_[_0x56a5('0xa3')]({},_0x180d29,_0x42db28['options']);if(_0x3b4acf&&!_0x3b4acf['autoAssociation']&&_0x189bf0[_0x56a5('0x12')]==='AnalyticExtractedReport'){if(_0x42db28[_0x56a5('0x86')]['includeAll']){_0x180d29[_0x56a5('0xa7')]=[{'all':!![]}];}return _0x561353[_0x189bf0[_0x56a5('0x12')]][_0x56a5('0xd')](_0x180d29)['then'](function(_0x1ef44d){var _0x2470ce=[];_0x1ef44d[_0x56a5('0xa6')](function(_0x9bb895){var _0x441668;switch(_0x9bb895[_0x56a5('0xa8')]){case _0x56a5('0xa9'):_0x441668=_[_0x56a5('0x93')](_0x3b4acf['associatedResources'],function(_0x1ff016){return _0x1ff016['id']===_0x9bb895[_0x56a5('0x77')]&&_0x1ff016['type']===_0x56a5('0xaa');});break;case _0x56a5('0xab'):_0x441668=_['find'](_0x3b4acf[_0x56a5('0x7')],function(_0x24e467){return _0x24e467['id']===_0x9bb895[_0x56a5('0x77')]&&_0x24e467[_0x56a5('0x3a')]==='CustomReports';});break;}if(_0x441668)_0x2470ce['push'](_0x9bb895);});_0x4b6906[_0x56a5('0xac')]=_0x2470ce[_0x56a5('0x90')];_0x4b6906[_0x56a5('0xad')]=_0x2470ce;return _0x4b6906;});}else{return _0x561353[_0x189bf0['childModel']][_0x56a5('0xac')]({'where':_0x180d29[_0x56a5('0x84')]})[_0x56a5('0x6')](function(_0x4d4cae){_0x4b6906[_0x56a5('0xac')]=_0x4d4cae;if(_0x42db28[_0x56a5('0x86')]['includeAll']){if(_0x189bf0[_0x56a5('0x12')]==='CmContact'){_0x180d29[_0x56a5('0xa7')]=[{'model':_0x561353[_0x56a5('0x6d')],'as':_0x56a5('0xae'),'attributes':['id',_0x56a5('0xa'),_0x56a5('0xaf')],'required':_0x42db28[_0x56a5('0x86')][_0x56a5('0xb0')]?!![]:![]},{'model':_0x561353[_0x56a5('0x6d')],'as':'ThroughTags','attributes':['id',_0x56a5('0xa'),_0x56a5('0xaf')],'through':_0x42db28[_0x56a5('0x86')]['tag']?{'attributes':[],'where':{'TagId':_0x42db28[_0x56a5('0x86')][_0x56a5('0xb0')]||undefined}}:{},'required':_0x42db28[_0x56a5('0x86')][_0x56a5('0xb0')]?!![]:![]}];}else{_0x180d29[_0x56a5('0xa7')]=[{'all':!![]}];}}return _0x561353[_0x189bf0[_0x56a5('0x12')]]['findAll'](_0x180d29);})[_0x56a5('0x6')](function(_0x597926){_0x4b6906['rows']=_0x597926;if(_0x5ed269===_0x56a5('0x31')&&_0x42db28[_0x56a5('0x86')][_0x56a5('0xb1')]===_0x56a5('0xb2')){var _0x5964e8=[];for(var _0x4a87a3=0x0;_0x4a87a3<_0x4b6906['rows'][_0x56a5('0x90')];_0x4a87a3++){_0x5964e8[_0x56a5('0x91')](_0x3cd325(_0x56a5('0xb3'),_0x4b6906[_0x56a5('0xad')][_0x4a87a3][_0x56a5('0xb4')]));_0x5964e8['push'](_0x3cd325(_0x56a5('0xb5'),_0x4b6906[_0x56a5('0xad')][_0x4a87a3][_0x56a5('0xb4')]));_0x5964e8[_0x56a5('0x91')](_0x3cd325(_0x56a5('0xb6'),_0x4b6906[_0x56a5('0xad')][_0x4a87a3][_0x56a5('0xb4')]));_0x5964e8[_0x56a5('0x91')](_0x3cd325('mail',_0x4b6906['rows'][_0x4a87a3][_0x56a5('0xb4')]));_0x5964e8[_0x56a5('0x91')](_0x3cd325(_0x56a5('0xb7'),_0x4b6906[_0x56a5('0xad')][_0x4a87a3]['dataValues']));_0x5964e8[_0x56a5('0x91')](_0x3cd325(_0x56a5('0xb8'),_0x4b6906[_0x56a5('0xad')][_0x4a87a3][_0x56a5('0xb4')]));}return Promise[_0x56a5('0x95')](_0x5964e8)[_0x56a5('0x6')](function(){return _0x4b6906;});}return _0x4b6906;});}});}}});};
\ No newline at end of file
index b3c40e9..0462a64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd7d5=['localhost','socket.io-emitter','register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','code','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x435f2d,_0x1843f9){var _0x5992a7=function(_0x42d25e){while(--_0x42d25e){_0x435f2d['push'](_0x435f2d['shift']());}};_0x5992a7(++_0x1843f9);}(_0xd7d5,0x1ea));var _0x5d7d=function(_0x392508,_0x40c9c9){_0x392508=_0x392508-0x0;var _0xedc37e=_0xd7d5[_0x392508];return _0xedc37e;};'use strict';var _=require(_0x5d7d('0x0'));var util=require(_0x5d7d('0x1'));var moment=require(_0x5d7d('0x2'));var BPromise=require(_0x5d7d('0x3'));var rs=require(_0x5d7d('0x4'));var fs=require('fs');var Redis=require(_0x5d7d('0x5'));var db=require(_0x5d7d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5d7d('0x7'))('rpc');var config=require(_0x5d7d('0x8'));var jayson=require(_0x5d7d('0x9'));var client=jayson[_0x5d7d('0xa')][_0x5d7d('0xb')]({'port':0x232a});config[_0x5d7d('0xc')]=_[_0x5d7d('0xd')](config[_0x5d7d('0xc')],{'host':_0x5d7d('0xe'),'port':0x18eb});var socket=require(_0x5d7d('0xf'))(new Redis(config[_0x5d7d('0xc')]));require('./userProfile.socket')[_0x5d7d('0x10')](socket);function respondWithRpcPromise(_0x2d1bc4,_0x32bf2c,_0x307eb8){return new BPromise(function(_0x4b890d,_0x17512e){return client[_0x5d7d('0x11')](_0x2d1bc4,_0x307eb8)[_0x5d7d('0x12')](function(_0x139664){logger['info'](_0x5d7d('0x13'),_0x32bf2c,_0x5d7d('0x14'));logger[_0x5d7d('0x15')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x32bf2c,_0x5d7d('0x14'),JSON['stringify'](_0x139664));if(_0x139664['error']){if(_0x139664['error'][_0x5d7d('0x16')]===0x1f4){logger[_0x5d7d('0x17')]('UserProfile,\x20%s,\x20%s',_0x32bf2c,_0x139664['error'][_0x5d7d('0x18')]);return _0x17512e(_0x139664[_0x5d7d('0x17')][_0x5d7d('0x18')]);}logger[_0x5d7d('0x17')](_0x5d7d('0x13'),_0x32bf2c,_0x139664['error']['message']);return _0x4b890d(_0x139664['error'][_0x5d7d('0x18')]);}else{logger[_0x5d7d('0x19')](_0x5d7d('0x13'),_0x32bf2c,_0x5d7d('0x14'));_0x4b890d(_0x139664[_0x5d7d('0x1a')][_0x5d7d('0x18')]);}})[_0x5d7d('0x1b')](function(_0x36edec){logger[_0x5d7d('0x17')](_0x5d7d('0x13'),_0x32bf2c,_0x36edec);_0x17512e(_0x36edec);});});}
\ No newline at end of file
+var _0x7ea9=['request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','register'];(function(_0x1ba516,_0x53adb2){var _0x5e31c7=function(_0x513ffc){while(--_0x513ffc){_0x1ba516['push'](_0x1ba516['shift']());}};_0x5e31c7(++_0x53adb2);}(_0x7ea9,0xec));var _0x97ea=function(_0xe33241,_0x3ac5bc){_0xe33241=_0xe33241-0x0;var _0x403a3a=_0x7ea9[_0xe33241];return _0x403a3a;};'use strict';var _=require('lodash');var util=require(_0x97ea('0x0'));var moment=require(_0x97ea('0x1'));var BPromise=require(_0x97ea('0x2'));var rs=require(_0x97ea('0x3'));var fs=require('fs');var Redis=require(_0x97ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x97ea('0x5'));var logger=require(_0x97ea('0x6'))(_0x97ea('0x7'));var config=require('../../config/environment');var jayson=require(_0x97ea('0x8'));var client=jayson[_0x97ea('0x9')][_0x97ea('0xa')]({'port':0x232a});config[_0x97ea('0xb')]=_['defaults'](config[_0x97ea('0xb')],{'host':_0x97ea('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x97ea('0xb')]));require('./userProfile.socket')[_0x97ea('0xd')](socket);function respondWithRpcPromise(_0x5ae2dc,_0x396e19,_0x340bbc){return new BPromise(function(_0x5a071f,_0x2c03a3){return client[_0x97ea('0xe')](_0x5ae2dc,_0x340bbc)[_0x97ea('0xf')](function(_0x80abd1){logger[_0x97ea('0x10')](_0x97ea('0x11'),_0x396e19,_0x97ea('0x12'));logger[_0x97ea('0x13')](_0x97ea('0x14'),_0x396e19,_0x97ea('0x12'),JSON['stringify'](_0x80abd1));if(_0x80abd1[_0x97ea('0x15')]){if(_0x80abd1[_0x97ea('0x15')]['code']===0x1f4){logger[_0x97ea('0x15')](_0x97ea('0x11'),_0x396e19,_0x80abd1[_0x97ea('0x15')]['message']);return _0x2c03a3(_0x80abd1[_0x97ea('0x15')][_0x97ea('0x16')]);}logger['error'](_0x97ea('0x11'),_0x396e19,_0x80abd1['error'][_0x97ea('0x16')]);return _0x5a071f(_0x80abd1[_0x97ea('0x15')][_0x97ea('0x16')]);}else{logger[_0x97ea('0x10')](_0x97ea('0x11'),_0x396e19,_0x97ea('0x12'));_0x5a071f(_0x80abd1[_0x97ea('0x17')]['message']);}})[_0x97ea('0x18')](function(_0x12499b){logger[_0x97ea('0x15')](_0x97ea('0x11'),_0x396e19,_0x12499b);_0x2c03a3(_0x12499b);});});}
\ No newline at end of file
index d74eca6..daf9c53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3951=['./userProfile.events','save','remove','emit','register'];(function(_0x5a885f,_0x40d956){var _0x5b06ee=function(_0x134a45){while(--_0x134a45){_0x5a885f['push'](_0x5a885f['shift']());}};_0x5b06ee(++_0x40d956);}(_0x3951,0x177));var _0x1395=function(_0xeb0ac0,_0x59d6a1){_0xeb0ac0=_0xeb0ac0-0x0;var _0x59e1ea=_0x3951[_0xeb0ac0];return _0x59e1ea;};'use strict';var UserProfileEvents=require(_0x1395('0x0'));var events=[_0x1395('0x1'),_0x1395('0x2'),'update'];function createListener(_0x3ca37a,_0x2025b3){return function(_0x28781a){_0x2025b3[_0x1395('0x3')](_0x3ca37a,_0x28781a);};}function removeListener(_0x26ed90,_0x1bcb45){return function(){UserProfileEvents['removeListener'](_0x26ed90,_0x1bcb45);};}exports[_0x1395('0x4')]=function(_0x1f6e8d){for(var _0x2bba15=0x0,_0x56abc3=events['length'];_0x2bba15<_0x56abc3;_0x2bba15++){var _0x242c84=events[_0x2bba15];var _0x38087c=createListener('userProfile:'+_0x242c84,_0x1f6e8d);UserProfileEvents['on'](_0x242c84,_0x38087c);}};
\ No newline at end of file
+var _0x8cd7=['length','./userProfile.events','save','remove','update','removeListener','register'];(function(_0x4fb5db,_0x549dbb){var _0x1ec86a=function(_0x4d9529){while(--_0x4d9529){_0x4fb5db['push'](_0x4fb5db['shift']());}};_0x1ec86a(++_0x549dbb);}(_0x8cd7,0xa2));var _0x78cd=function(_0x227b91,_0x3d6b8a){_0x227b91=_0x227b91-0x0;var _0x7b65e8=_0x8cd7[_0x227b91];return _0x7b65e8;};'use strict';var UserProfileEvents=require(_0x78cd('0x0'));var events=[_0x78cd('0x1'),_0x78cd('0x2'),_0x78cd('0x3')];function createListener(_0x5701d3,_0x31bc63){return function(_0x3512fa){_0x31bc63['emit'](_0x5701d3,_0x3512fa);};}function removeListener(_0x5c50ea,_0x19681f){return function(){UserProfileEvents[_0x78cd('0x4')](_0x5c50ea,_0x19681f);};}exports[_0x78cd('0x5')]=function(_0x51c46d){for(var _0x4e766c=0x0,_0x118068=events[_0x78cd('0x6')];_0x4e766c<_0x118068;_0x4e766c++){var _0x98e6dc=events[_0x4e766c];var _0x5dd687=createListener('userProfile:'+_0x98e6dc,_0x51c46d);UserProfileEvents['on'](_0x98e6dc,_0x5dd687);}};
\ No newline at end of file
index 053854f..168b77a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb6e5=['/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','isAuthenticated','get','/describe','describe','show','post','create','put'];(function(_0xb55578,_0x2304c8){var _0xe81b7b=function(_0x393203){while(--_0x393203){_0xb55578['push'](_0xb55578['shift']());}};_0xe81b7b(++_0x2304c8);}(_0xb6e5,0x81));var _0x5b6e=function(_0x325abc,_0x3b3a95){_0x325abc=_0x325abc-0x0;var _0x451802=_0xb6e5[_0x325abc];return _0x451802;};'use strict';var multer=require(_0x5b6e('0x0'));var util=require(_0x5b6e('0x1'));var path=require(_0x5b6e('0x2'));var timeout=require(_0x5b6e('0x3'));var express=require(_0x5b6e('0x4'));var router=express[_0x5b6e('0x5')]();var fs_extra=require(_0x5b6e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x5b6e('0x7'));var config=require(_0x5b6e('0x8'));var controller=require(_0x5b6e('0x9'));router['get']('/',auth[_0x5b6e('0xa')](),controller['index']);router[_0x5b6e('0xb')](_0x5b6e('0xc'),auth[_0x5b6e('0xa')](),controller[_0x5b6e('0xd')]);router[_0x5b6e('0xb')]('/:id',auth[_0x5b6e('0xa')](),controller[_0x5b6e('0xe')]);router[_0x5b6e('0xf')]('/',auth[_0x5b6e('0xa')](),controller[_0x5b6e('0x10')]);router[_0x5b6e('0x11')](_0x5b6e('0x12'),auth[_0x5b6e('0xa')](),controller[_0x5b6e('0x13')]);router['delete'](_0x5b6e('0x12'),auth['isAuthenticated'](),controller[_0x5b6e('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x4f7f=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','create','put','update','delete','destroy','exports','multer','util','express','Router'];(function(_0x45fc8c,_0x14393f){var _0x1868ba=function(_0x29ea4c){while(--_0x29ea4c){_0x45fc8c['push'](_0x45fc8c['shift']());}};_0x1868ba(++_0x14393f);}(_0x4f7f,0x1be));var _0xf4f7=function(_0x328d3c,_0x1b9512){_0x328d3c=_0x328d3c-0x0;var _0x5bb3ed=_0x4f7f[_0x328d3c];return _0x5bb3ed;};'use strict';var multer=require(_0xf4f7('0x0'));var util=require(_0xf4f7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf4f7('0x2'));var router=express[_0xf4f7('0x3')]();var fs_extra=require(_0xf4f7('0x4'));var auth=require(_0xf4f7('0x5'));var interaction=require(_0xf4f7('0x6'));var config=require(_0xf4f7('0x7'));var controller=require('./userProfileResource.controller');router['get']('/',auth[_0xf4f7('0x8')](),controller[_0xf4f7('0x9')]);router[_0xf4f7('0xa')]('/describe',auth[_0xf4f7('0x8')](),controller['describe']);router[_0xf4f7('0xa')](_0xf4f7('0xb'),auth[_0xf4f7('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xf4f7('0xc')]);router[_0xf4f7('0xd')](_0xf4f7('0xb'),auth[_0xf4f7('0x8')](),controller[_0xf4f7('0xe')]);router[_0xf4f7('0xf')](_0xf4f7('0xb'),auth[_0xf4f7('0x8')](),controller[_0xf4f7('0x10')]);module[_0xf4f7('0x11')]=router;
\ No newline at end of file
index b1d50fd..8aa8d1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe3cf=['sequelize','STRING','INTEGER'];(function(_0x108338,_0x24314f){var _0x4c585c=function(_0x2c6aab){while(--_0x2c6aab){_0x108338['push'](_0x108338['shift']());}};_0x4c585c(++_0x24314f);}(_0xe3cf,0x1cb));var _0xfe3c=function(_0xde5af2,_0x49d189){_0xde5af2=_0xde5af2-0x0;var _0x5ad92a=_0xe3cf[_0xde5af2];return _0x5ad92a;};'use strict';var Sequelize=require(_0xfe3c('0x0'));module['exports']={'name':{'type':Sequelize[_0xfe3c('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xfe3c('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}};
\ No newline at end of file
+var _0xc98f=['INTEGER','sequelize','STRING'];(function(_0x315cc5,_0x3833ff){var _0x5e2c1e=function(_0x6a040f){while(--_0x6a040f){_0x315cc5['push'](_0x315cc5['shift']());}};_0x5e2c1e(++_0x3833ff);}(_0xc98f,0x91));var _0xfc98=function(_0x35f9cf,_0x40fa9a){_0x35f9cf=_0x35f9cf-0x0;var _0x34b2c7=_0xc98f[_0x35f9cf];return _0x34b2c7;};'use strict';var Sequelize=require(_0xfc98('0x0'));module['exports']={'name':{'type':Sequelize[_0xfc98('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xfc98('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xfc98('0x1')],'allowNull':![]}};
\ No newline at end of file
index 6911322..893e315 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47c5=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','map','VIRTUAL','filter','merge','count','includeAll','include','findAll','show','params','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','key','model'];(function(_0x3bbd82,_0x1997d9){var _0x47cb2e=function(_0x45945b){while(--_0x45945b){_0x3bbd82['push'](_0x3bbd82['shift']());}};_0x47cb2e(++_0x1997d9);}(_0x47c5,0x165));var _0x547c=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x47c5[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0x547c('0x0'));var rimraf=require(_0x547c('0x1'));var zipdir=require(_0x547c('0x2'));var jsonpatch=require(_0x547c('0x3'));var rp=require(_0x547c('0x4'));var moment=require(_0x547c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x547c('0x6'));var util=require(_0x547c('0x7'));var path=require('path');var sox=require(_0x547c('0x8'));var csv=require(_0x547c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x547c('0xa'));var _=require(_0x547c('0xb'));var squel=require(_0x547c('0xc'));var crypto=require(_0x547c('0xd'));var jsforce=require(_0x547c('0xe'));var deskjs=require(_0x547c('0xf'));var toCsv=require(_0x547c('0x9'));var querystring=require(_0x547c('0x10'));var Papa=require(_0x547c('0x11'));var Redis=require(_0x547c('0x12'));var authService=require(_0x547c('0x13'));var qs=require(_0x547c('0x14'));var as=require(_0x547c('0x15'));var hardwareService=require(_0x547c('0x16'));var logger=require(_0x547c('0x17'))(_0x547c('0x18'));var utils=require(_0x547c('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x547c('0x1a'));var db=require(_0x547c('0x1b'))['db'];function respondWithStatusCode(_0x5eea67,_0x436c19){_0x436c19=_0x436c19||0xcc;return function(_0x201d95){if(_0x201d95){return _0x5eea67[_0x547c('0x1c')](_0x436c19);}return _0x5eea67[_0x547c('0x1d')](_0x436c19)[_0x547c('0x1e')]();};}function respondWithResult(_0x150317,_0x2bc289){_0x2bc289=_0x2bc289||0xc8;return function(_0xa3c7b0){if(_0xa3c7b0){return _0x150317[_0x547c('0x1d')](_0x2bc289)[_0x547c('0x1f')](_0xa3c7b0);}};}function respondWithFilteredResult(_0x240243,_0x103455){return function(_0x39f316){if(_0x39f316){var _0x23644b=typeof _0x103455[_0x547c('0x20')]===_0x547c('0x21')&&typeof _0x103455[_0x547c('0x22')]===_0x547c('0x21');var _0x49acca=_0x39f316['count'];var _0x23fa9e=_0x23644b?0x0:_0x103455[_0x547c('0x20')];var _0xeb059e=_0x23644b?_0x39f316['count']:_0x103455[_0x547c('0x20')]+_0x103455[_0x547c('0x22')];var _0x1ddbd3;if(_0xeb059e>=_0x49acca){_0xeb059e=_0x49acca;_0x1ddbd3=0xc8;}else{_0x1ddbd3=0xce;}_0x240243['status'](_0x1ddbd3);return _0x240243[_0x547c('0x23')](_0x547c('0x24'),_0x23fa9e+'-'+_0xeb059e+'/'+_0x49acca)['json'](_0x39f316);}return null;};}function patchUpdates(_0x5453f9){return function(_0x35040a){try{jsonpatch[_0x547c('0x25')](_0x35040a,_0x5453f9,!![]);}catch(_0x4f20c1){return BPromise[_0x547c('0x26')](_0x4f20c1);}return _0x35040a[_0x547c('0x27')]();};}function saveUpdates(_0x592e46,_0x2e317a){return function(_0x17fd97){if(_0x17fd97){return _0x17fd97[_0x547c('0x28')](_0x592e46)['then'](function(_0x3a55a0){return _0x3a55a0;});}return null;};}function removeEntity(_0x361c5c,_0x470694){return function(_0x26823c){if(_0x26823c){return _0x26823c[_0x547c('0x29')]()[_0x547c('0x2a')](function(){_0x361c5c[_0x547c('0x1d')](0xcc)[_0x547c('0x1e')]();});}};}function handleEntityNotFound(_0x507895,_0x39c5f9){return function(_0x4c66b9){if(!_0x4c66b9){_0x507895['sendStatus'](0x194);}return _0x4c66b9;};}function handleError(_0x4855fd,_0x478f04){_0x478f04=_0x478f04||0x1f4;return function(_0x2c725d){logger['error'](_0x2c725d[_0x547c('0x2b')]);if(_0x2c725d['name']){delete _0x2c725d[_0x547c('0x2c')];}_0x4855fd['status'](_0x478f04)[_0x547c('0x2d')](_0x2c725d);};}exports[_0x547c('0x2e')]=function(_0x2389de,_0x30a96c){var _0x198afb={},_0x569924={},_0x575c74={'count':0x0,'rows':[]};var _0x28c282=_['map'](db[_0x547c('0x2f')][_0x547c('0x30')],function(_0x3e7652){return{'name':_0x3e7652[_0x547c('0x31')],'type':_0x3e7652[_0x547c('0x32')][_0x547c('0x33')]};});_0x569924[_0x547c('0x34')]=_['map'](_0x28c282,'name');_0x569924[_0x547c('0x35')]=_[_0x547c('0x36')](_0x2389de[_0x547c('0x35')]);_0x569924[_0x547c('0x37')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],_0x569924[_0x547c('0x35')]);_0x198afb[_0x547c('0x39')]=_[_0x547c('0x38')](_0x569924[_0x547c('0x34')],qs[_0x547c('0x3a')](_0x2389de[_0x547c('0x35')][_0x547c('0x3a')]));_0x198afb[_0x547c('0x39')]=_0x198afb['attributes'][_0x547c('0x3b')]?_0x198afb['attributes']:_0x569924['model'];if(!_0x2389de['query'][_0x547c('0x3c')](_0x547c('0x3d'))){_0x198afb[_0x547c('0x22')]=qs[_0x547c('0x22')](_0x2389de[_0x547c('0x35')][_0x547c('0x22')]);_0x198afb['offset']=qs['offset'](_0x2389de['query'][_0x547c('0x20')]);}_0x198afb[_0x547c('0x3e')]=qs[_0x547c('0x3f')](_0x2389de[_0x547c('0x35')][_0x547c('0x3f')]);_0x198afb[_0x547c('0x40')]=qs['filters'](_[_0x547c('0x41')](_0x2389de['query'],_0x569924[_0x547c('0x37')]),_0x28c282);if(_0x2389de[_0x547c('0x35')]['filter']){_0x198afb[_0x547c('0x40')]=_['merge'](_0x198afb['where'],{'$or':_[_0x547c('0x42')](_0x28c282,function(_0x281d52){if(_0x281d52[_0x547c('0x32')]!==_0x547c('0x43')){var _0x4c36b9={};_0x4c36b9[_0x281d52['name']]={'$like':'%'+_0x2389de[_0x547c('0x35')][_0x547c('0x44')]+'%'};return _0x4c36b9;}})});}_0x198afb=_[_0x547c('0x45')]({},_0x198afb,_0x2389de['options']);var _0x3886ae={'where':_0x198afb[_0x547c('0x40')]};return db[_0x547c('0x2f')]['count'](_0x3886ae)[_0x547c('0x2a')](function(_0x3a6a0a){_0x575c74[_0x547c('0x46')]=_0x3a6a0a;if(_0x2389de['query'][_0x547c('0x47')]){_0x198afb[_0x547c('0x48')]=[{'all':!![]}];}return db['UserProfileResource'][_0x547c('0x49')](_0x198afb);})[_0x547c('0x2a')](function(_0x9c3cb2){_0x575c74['rows']=_0x9c3cb2;return _0x575c74;})[_0x547c('0x2a')](respondWithFilteredResult(_0x30a96c,_0x198afb))['catch'](handleError(_0x30a96c,null));};exports[_0x547c('0x4a')]=function(_0x5393a2,_0xb86f5f){var _0x414b9d={'raw':![],'where':{'id':_0x5393a2[_0x547c('0x4b')]['id']}},_0x3d37d7={};_0x3d37d7[_0x547c('0x34')]=_[_0x547c('0x36')](db['UserProfileResource']['rawAttributes']);_0x3d37d7[_0x547c('0x35')]=_[_0x547c('0x36')](_0x5393a2[_0x547c('0x35')]);_0x3d37d7['filters']=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],_0x3d37d7[_0x547c('0x35')]);_0x414b9d[_0x547c('0x39')]=_[_0x547c('0x38')](_0x3d37d7[_0x547c('0x34')],qs['fields'](_0x5393a2[_0x547c('0x35')][_0x547c('0x3a')]));_0x414b9d[_0x547c('0x39')]=_0x414b9d['attributes'][_0x547c('0x3b')]?_0x414b9d[_0x547c('0x39')]:_0x3d37d7[_0x547c('0x34')];if(_0x5393a2[_0x547c('0x35')]['includeAll']){_0x414b9d[_0x547c('0x48')]=[{'all':!![]}];}_0x414b9d=_['merge']({},_0x414b9d,_0x5393a2[_0x547c('0x4c')]);return db['UserProfileResource'][_0x547c('0x4d')](_0x414b9d)[_0x547c('0x2a')](handleEntityNotFound(_0xb86f5f,null))['then'](respondWithResult(_0xb86f5f,null))[_0x547c('0x4e')](handleError(_0xb86f5f,null));};exports[_0x547c('0x4f')]=function(_0xa005cc,_0x1ddf30){return db['UserProfileResource'][_0x547c('0x4f')](_0xa005cc['body'],{})['then'](respondWithResult(_0x1ddf30,0xc9))[_0x547c('0x4e')](handleError(_0x1ddf30,null));};exports[_0x547c('0x28')]=function(_0x3e3f52,_0x11a878){if(_0x3e3f52[_0x547c('0x50')]['id']){delete _0x3e3f52[_0x547c('0x50')]['id'];}return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x3e3f52[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x11a878,null))[_0x547c('0x2a')](saveUpdates(_0x3e3f52[_0x547c('0x50')],null))['then'](respondWithResult(_0x11a878,null))['catch'](handleError(_0x11a878,null));};exports[_0x547c('0x29')]=function(_0x21ea26,_0x48de6e){return db[_0x547c('0x2f')][_0x547c('0x4d')]({'where':{'id':_0x21ea26[_0x547c('0x4b')]['id']}})[_0x547c('0x2a')](handleEntityNotFound(_0x48de6e,null))[_0x547c('0x2a')](removeEntity(_0x48de6e,null))[_0x547c('0x4e')](handleError(_0x48de6e,null));};exports['describe']=function(_0x152982,_0x5258cf){return db[_0x547c('0x2f')][_0x547c('0x51')]()[_0x547c('0x2a')](respondWithResult(_0x5258cf,null))['catch'](handleError(_0x5258cf,null));};
\ No newline at end of file
+var _0x7880=['destroy','error','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','keys','options','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','count','limit','set','json','apply','reject','save','update','then'];(function(_0x4920f2,_0xa4bfbf){var _0x1f27cf=function(_0x4d94ad){while(--_0x4d94ad){_0x4920f2['push'](_0x4920f2['shift']());}};_0x1f27cf(++_0xa4bfbf);}(_0x7880,0x1f4));var _0x0788=function(_0x621bee,_0x58f8c0){_0x621bee=_0x621bee-0x0;var _0x3076c8=_0x7880[_0x621bee];return _0x3076c8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0788('0x0'));var zipdir=require(_0x0788('0x1'));var jsonpatch=require(_0x0788('0x2'));var rp=require(_0x0788('0x3'));var moment=require(_0x0788('0x4'));var BPromise=require(_0x0788('0x5'));var Mustache=require('mustache');var util=require(_0x0788('0x6'));var path=require(_0x0788('0x7'));var sox=require(_0x0788('0x8'));var csv=require(_0x0788('0x9'));var ejs=require(_0x0788('0xa'));var fs=require('fs');var fs_extra=require(_0x0788('0xb'));var _=require(_0x0788('0xc'));var squel=require(_0x0788('0xd'));var crypto=require(_0x0788('0xe'));var jsforce=require(_0x0788('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x0788('0x9'));var querystring=require('querystring');var Papa=require(_0x0788('0x10'));var Redis=require('ioredis');var authService=require(_0x0788('0x11'));var qs=require(_0x0788('0x12'));var as=require(_0x0788('0x13'));var hardwareService=require(_0x0788('0x14'));var logger=require(_0x0788('0x15'))('api');var utils=require(_0x0788('0x16'));var config=require(_0x0788('0x17'));var licenseUtil=require(_0x0788('0x18'));var db=require(_0x0788('0x19'))['db'];function respondWithStatusCode(_0x311729,_0xce4342){_0xce4342=_0xce4342||0xcc;return function(_0x261ebc){if(_0x261ebc){return _0x311729['sendStatus'](_0xce4342);}return _0x311729[_0x0788('0x1a')](_0xce4342)[_0x0788('0x1b')]();};}function respondWithResult(_0x3bdcdf,_0x13cf07){_0x13cf07=_0x13cf07||0xc8;return function(_0x51e5d3){if(_0x51e5d3){return _0x3bdcdf[_0x0788('0x1a')](_0x13cf07)['json'](_0x51e5d3);}};}function respondWithFilteredResult(_0x195f14,_0x170d56){return function(_0x3fd1e4){if(_0x3fd1e4){var _0xb406fb=typeof _0x170d56[_0x0788('0x1c')]===_0x0788('0x1d')&&typeof _0x170d56['limit']==='undefined';var _0x17d805=_0x3fd1e4[_0x0788('0x1e')];var _0x5b2bdc=_0xb406fb?0x0:_0x170d56[_0x0788('0x1c')];var _0x415f19=_0xb406fb?_0x3fd1e4[_0x0788('0x1e')]:_0x170d56['offset']+_0x170d56[_0x0788('0x1f')];var _0x3fb723;if(_0x415f19>=_0x17d805){_0x415f19=_0x17d805;_0x3fb723=0xc8;}else{_0x3fb723=0xce;}_0x195f14['status'](_0x3fb723);return _0x195f14[_0x0788('0x20')]('Content-Range',_0x5b2bdc+'-'+_0x415f19+'/'+_0x17d805)[_0x0788('0x21')](_0x3fd1e4);}return null;};}function patchUpdates(_0x48bc5f){return function(_0x17cca3){try{jsonpatch[_0x0788('0x22')](_0x17cca3,_0x48bc5f,!![]);}catch(_0x18ff22){return BPromise[_0x0788('0x23')](_0x18ff22);}return _0x17cca3[_0x0788('0x24')]();};}function saveUpdates(_0x4f0005,_0x48ec43){return function(_0x2270d4){if(_0x2270d4){return _0x2270d4[_0x0788('0x25')](_0x4f0005)[_0x0788('0x26')](function(_0x7a99a1){return _0x7a99a1;});}return null;};}function removeEntity(_0x5ba1da,_0x4d5c93){return function(_0x79204e){if(_0x79204e){return _0x79204e[_0x0788('0x27')]()[_0x0788('0x26')](function(){_0x5ba1da['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x240459,_0xa1f7dc){return function(_0x5f2dda){if(!_0x5f2dda){_0x240459['sendStatus'](0x194);}return _0x5f2dda;};}function handleError(_0x5a54a5,_0x44798c){_0x44798c=_0x44798c||0x1f4;return function(_0x57fda1){logger[_0x0788('0x28')](_0x57fda1[_0x0788('0x29')]);if(_0x57fda1[_0x0788('0x2a')]){delete _0x57fda1[_0x0788('0x2a')];}_0x5a54a5[_0x0788('0x1a')](_0x44798c)[_0x0788('0x2b')](_0x57fda1);};}exports[_0x0788('0x2c')]=function(_0x3ffe4f,_0x5b7594){var _0x5a5178={},_0x3c5246={},_0x40d345={'count':0x0,'rows':[]};var _0x54979a=_['map'](db[_0x0788('0x2d')][_0x0788('0x2e')],function(_0x20fcd8){return{'name':_0x20fcd8[_0x0788('0x2f')],'type':_0x20fcd8[_0x0788('0x30')][_0x0788('0x31')]};});_0x3c5246[_0x0788('0x32')]=_[_0x0788('0x33')](_0x54979a,_0x0788('0x2a'));_0x3c5246[_0x0788('0x34')]=_['keys'](_0x3ffe4f[_0x0788('0x34')]);_0x3c5246[_0x0788('0x35')]=_[_0x0788('0x36')](_0x3c5246[_0x0788('0x32')],_0x3c5246[_0x0788('0x34')]);_0x5a5178[_0x0788('0x37')]=_[_0x0788('0x36')](_0x3c5246[_0x0788('0x32')],qs[_0x0788('0x38')](_0x3ffe4f[_0x0788('0x34')]['fields']));_0x5a5178['attributes']=_0x5a5178['attributes']['length']?_0x5a5178['attributes']:_0x3c5246['model'];if(!_0x3ffe4f[_0x0788('0x34')][_0x0788('0x39')](_0x0788('0x3a'))){_0x5a5178['limit']=qs[_0x0788('0x1f')](_0x3ffe4f[_0x0788('0x34')][_0x0788('0x1f')]);_0x5a5178[_0x0788('0x1c')]=qs['offset'](_0x3ffe4f[_0x0788('0x34')]['offset']);}_0x5a5178[_0x0788('0x3b')]=qs['sort'](_0x3ffe4f[_0x0788('0x34')][_0x0788('0x3c')]);_0x5a5178['where']=qs[_0x0788('0x35')](_[_0x0788('0x3d')](_0x3ffe4f['query'],_0x3c5246[_0x0788('0x35')]),_0x54979a);if(_0x3ffe4f['query'][_0x0788('0x3e')]){_0x5a5178['where']=_[_0x0788('0x3f')](_0x5a5178['where'],{'$or':_[_0x0788('0x33')](_0x54979a,function(_0x57fec9){if(_0x57fec9['type']!==_0x0788('0x40')){var _0x68d9d4={};_0x68d9d4[_0x57fec9[_0x0788('0x2a')]]={'$like':'%'+_0x3ffe4f[_0x0788('0x34')][_0x0788('0x3e')]+'%'};return _0x68d9d4;}})});}_0x5a5178=_['merge']({},_0x5a5178,_0x3ffe4f['options']);var _0x530d83={'where':_0x5a5178['where']};return db[_0x0788('0x2d')][_0x0788('0x1e')](_0x530d83)[_0x0788('0x26')](function(_0x358a22){_0x40d345[_0x0788('0x1e')]=_0x358a22;if(_0x3ffe4f['query']['includeAll']){_0x5a5178[_0x0788('0x41')]=[{'all':!![]}];}return db[_0x0788('0x2d')][_0x0788('0x42')](_0x5a5178);})[_0x0788('0x26')](function(_0x236b63){_0x40d345[_0x0788('0x43')]=_0x236b63;return _0x40d345;})[_0x0788('0x26')](respondWithFilteredResult(_0x5b7594,_0x5a5178))[_0x0788('0x44')](handleError(_0x5b7594,null));};exports[_0x0788('0x45')]=function(_0x50e8f5,_0x5581e6){var _0x441aec={'raw':![],'where':{'id':_0x50e8f5[_0x0788('0x46')]['id']}},_0x1d579d={};_0x1d579d['model']=_['keys'](db['UserProfileResource'][_0x0788('0x2e')]);_0x1d579d[_0x0788('0x34')]=_[_0x0788('0x47')](_0x50e8f5[_0x0788('0x34')]);_0x1d579d[_0x0788('0x35')]=_[_0x0788('0x36')](_0x1d579d[_0x0788('0x32')],_0x1d579d[_0x0788('0x34')]);_0x441aec['attributes']=_[_0x0788('0x36')](_0x1d579d[_0x0788('0x32')],qs[_0x0788('0x38')](_0x50e8f5[_0x0788('0x34')]['fields']));_0x441aec[_0x0788('0x37')]=_0x441aec[_0x0788('0x37')]['length']?_0x441aec['attributes']:_0x1d579d['model'];if(_0x50e8f5[_0x0788('0x34')]['includeAll']){_0x441aec[_0x0788('0x41')]=[{'all':!![]}];}_0x441aec=_[_0x0788('0x3f')]({},_0x441aec,_0x50e8f5[_0x0788('0x48')]);return db[_0x0788('0x2d')][_0x0788('0x49')](_0x441aec)[_0x0788('0x26')](handleEntityNotFound(_0x5581e6,null))[_0x0788('0x26')](respondWithResult(_0x5581e6,null))[_0x0788('0x44')](handleError(_0x5581e6,null));};exports['create']=function(_0x4c6366,_0x39c3cc){return db[_0x0788('0x2d')][_0x0788('0x4a')](_0x4c6366['body'],{})[_0x0788('0x26')](respondWithResult(_0x39c3cc,0xc9))[_0x0788('0x44')](handleError(_0x39c3cc,null));};exports[_0x0788('0x25')]=function(_0x4563cd,_0x2395ad){if(_0x4563cd['body']['id']){delete _0x4563cd['body']['id'];}return db[_0x0788('0x2d')][_0x0788('0x49')]({'where':{'id':_0x4563cd['params']['id']}})[_0x0788('0x26')](handleEntityNotFound(_0x2395ad,null))['then'](saveUpdates(_0x4563cd[_0x0788('0x4b')],null))[_0x0788('0x26')](respondWithResult(_0x2395ad,null))[_0x0788('0x44')](handleError(_0x2395ad,null));};exports[_0x0788('0x27')]=function(_0x3c757a,_0x379928){return db[_0x0788('0x2d')][_0x0788('0x49')]({'where':{'id':_0x3c757a['params']['id']}})[_0x0788('0x26')](handleEntityNotFound(_0x379928,null))[_0x0788('0x26')](removeEntity(_0x379928,null))[_0x0788('0x44')](handleError(_0x379928,null));};exports['describe']=function(_0x1693d0,_0x5d32ae){return db['UserProfileResource'][_0x0788('0x4c')]()[_0x0788('0x26')](respondWithResult(_0x5d32ae,null))[_0x0788('0x44')](handleError(_0x5d32ae,null));};
\ No newline at end of file
index 377c0bd..dadebb1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4d4=['resourceId','sectionId','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./userProfileResource.attributes','exports','UserProfileResource','user_profile_has_resources'];(function(_0x3a2c4a,_0x57fac8){var _0x39a1bb=function(_0x267842){while(--_0x267842){_0x3a2c4a['push'](_0x3a2c4a['shift']());}};_0x39a1bb(++_0x57fac8);}(_0xe4d4,0x161));var _0x4e4d=function(_0x22c33a,_0x4d4575){_0x22c33a=_0x22c33a-0x0;var _0x3d0d08=_0xe4d4[_0x22c33a];return _0x3d0d08;};'use strict';var _=require(_0x4e4d('0x0'));var util=require('util');var logger=require(_0x4e4d('0x1'))(_0x4e4d('0x2'));var moment=require(_0x4e4d('0x3'));var BPromise=require('bluebird');var rp=require(_0x4e4d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4e4d('0x5'));var config=require(_0x4e4d('0x6'));var attributes=require(_0x4e4d('0x7'));module[_0x4e4d('0x8')]=function(_0x310176,_0x579f42){return _0x310176['define'](_0x4e4d('0x9'),attributes,{'tableName':_0x4e4d('0xa'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x4e4d('0xb'),_0x4e4d('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x125c=['./userProfileResource.attributes','exports','define','user_profile_has_resources','compositeIndex','resourceId','lodash','../../config/logger','api','moment','path','../../config/environment'];(function(_0x368c07,_0x56ff70){var _0x46faf5=function(_0x471a49){while(--_0x471a49){_0x368c07['push'](_0x368c07['shift']());}};_0x46faf5(++_0x56ff70);}(_0x125c,0xde));var _0xc125=function(_0x17f712,_0x2abdcc){_0x17f712=_0x17f712-0x0;var _0x4dc149=_0x125c[_0x17f712];return _0x4dc149;};'use strict';var _=require(_0xc125('0x0'));var util=require('util');var logger=require(_0xc125('0x1'))(_0xc125('0x2'));var moment=require(_0xc125('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc125('0x4'));var rimraf=require('rimraf');var config=require(_0xc125('0x5'));var attributes=require(_0xc125('0x6'));module[_0xc125('0x7')]=function(_0x26eac9,_0x3f233b){return _0x26eac9[_0xc125('0x8')]('UserProfileResource',attributes,{'tableName':_0xc125('0x9'),'paranoid':![],'indexes':[{'name':_0xc125('0xa'),'fields':[_0xc125('0xb'),'sectionId']}],'timestamps':!![]});};
\ No newline at end of file
index 0de40a7..72b16b6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b0e=['UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','debug'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4b5813,_0x5769de){_0x4b5813=_0x4b5813-0x0;var _0x423465=_0x0b0e[_0x4b5813];return _0x423465;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('UserProfileResource,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});}
\ No newline at end of file
+var _0x9c61=['../../config/environment','jayson/promise','client','http','then','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','UserProfileResource,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x635f3,_0x548483){var _0x1ecfc4=function(_0x47ea22){while(--_0x47ea22){_0x635f3['push'](_0x635f3['shift']());}};_0x1ecfc4(++_0x548483);}(_0x9c61,0x1d7));var _0x19c6=function(_0x1d2b66,_0x256c6e){_0x1d2b66=_0x1d2b66-0x0;var _0x445a66=_0x9c61[_0x1d2b66];return _0x445a66;};'use strict';var _=require(_0x19c6('0x0'));var util=require(_0x19c6('0x1'));var moment=require(_0x19c6('0x2'));var BPromise=require(_0x19c6('0x3'));var rs=require(_0x19c6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x19c6('0x5'))['db'];var utils=require(_0x19c6('0x6'));var logger=require(_0x19c6('0x7'))(_0x19c6('0x8'));var config=require(_0x19c6('0x9'));var jayson=require(_0x19c6('0xa'));var client=jayson[_0x19c6('0xb')][_0x19c6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1eca92,_0x1c74d1,_0x597448){return new BPromise(function(_0x527192,_0x461cf8){return client['request'](_0x1eca92,_0x597448)[_0x19c6('0xd')](function(_0xd2af4e){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x1c74d1,_0x19c6('0xe'));logger[_0x19c6('0xf')](_0x19c6('0x10'),_0x1c74d1,_0x19c6('0xe'),JSON['stringify'](_0xd2af4e));if(_0xd2af4e[_0x19c6('0x11')]){if(_0xd2af4e[_0x19c6('0x11')][_0x19c6('0x12')]===0x1f4){logger[_0x19c6('0x11')](_0x19c6('0x13'),_0x1c74d1,_0xd2af4e[_0x19c6('0x11')][_0x19c6('0x14')]);return _0x461cf8(_0xd2af4e[_0x19c6('0x11')][_0x19c6('0x14')]);}logger[_0x19c6('0x11')](_0x19c6('0x13'),_0x1c74d1,_0xd2af4e[_0x19c6('0x11')][_0x19c6('0x14')]);return _0x527192(_0xd2af4e['error'][_0x19c6('0x14')]);}else{logger[_0x19c6('0x15')]('UserProfileResource,\x20%s,\x20%s',_0x1c74d1,_0x19c6('0xe'));_0x527192(_0xd2af4e[_0x19c6('0x16')][_0x19c6('0x14')]);}})[_0x19c6('0x17')](function(_0x29d5ca){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x1c74d1,_0x29d5ca);_0x461cf8(_0x29d5ca);});});}
\ No newline at end of file
index 30b08e2..781d3c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa67c=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','describe','/:id','show','post','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4de586,_0x183427){var _0x46baf5=function(_0x1157f0){while(--_0x1157f0){_0x4de586['push'](_0x4de586['shift']());}};_0x46baf5(++_0x183427);}(_0xa67c,0xec));var _0xca67=function(_0x5962ce,_0x518c67){_0x5962ce=_0x5962ce-0x0;var _0x25d782=_0xa67c[_0x5962ce];return _0x25d782;};'use strict';var multer=require(_0xca67('0x0'));var util=require(_0xca67('0x1'));var path=require(_0xca67('0x2'));var timeout=require(_0xca67('0x3'));var express=require(_0xca67('0x4'));var router=express[_0xca67('0x5')]();var fs_extra=require(_0xca67('0x6'));var auth=require(_0xca67('0x7'));var interaction=require(_0xca67('0x8'));var config=require(_0xca67('0x9'));var controller=require(_0xca67('0xa'));router[_0xca67('0xb')]('/',auth[_0xca67('0xc')](),controller[_0xca67('0xd')]);router[_0xca67('0xb')]('/describe',auth[_0xca67('0xc')](),controller[_0xca67('0xe')]);router[_0xca67('0xb')](_0xca67('0xf'),auth[_0xca67('0xc')](),controller[_0xca67('0x10')]);router[_0xca67('0x11')]('/',auth[_0xca67('0xc')](),controller['create']);router[_0xca67('0x12')](_0xca67('0xf'),auth[_0xca67('0xc')](),controller[_0xca67('0x13')]);router[_0xca67('0x14')](_0xca67('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xca67('0x15')]=router;
\ No newline at end of file
+var _0x1a6d=['exports','util','path','express','../../components/auth/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index','get','/describe','describe','show','post','create','update','delete','/:id','destroy'];(function(_0xd09668,_0x1435b2){var _0x68726=function(_0x54a030){while(--_0x54a030){_0xd09668['push'](_0xd09668['shift']());}};_0x68726(++_0x1435b2);}(_0x1a6d,0x16a));var _0xd1a6=function(_0x48c10a,_0x49348e){_0x48c10a=_0x48c10a-0x0;var _0x269fe0=_0x1a6d[_0x48c10a];return _0x269fe0;};'use strict';var multer=require('multer');var util=require(_0xd1a6('0x0'));var path=require(_0xd1a6('0x1'));var timeout=require('connect-timeout');var express=require(_0xd1a6('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xd1a6('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xd1a6('0x4'));var controller=require(_0xd1a6('0x5'));router['get']('/',auth[_0xd1a6('0x6')](),controller[_0xd1a6('0x7')]);router[_0xd1a6('0x8')](_0xd1a6('0x9'),auth[_0xd1a6('0x6')](),controller[_0xd1a6('0xa')]);router[_0xd1a6('0x8')]('/:id',auth[_0xd1a6('0x6')](),controller[_0xd1a6('0xb')]);router[_0xd1a6('0xc')]('/',auth[_0xd1a6('0x6')](),controller[_0xd1a6('0xd')]);router['put']('/:id',auth[_0xd1a6('0x6')](),controller[_0xd1a6('0xe')]);router[_0xd1a6('0xf')](_0xd1a6('0x10'),auth[_0xd1a6('0x6')](),controller[_0xd1a6('0x11')]);module[_0xd1a6('0x12')]=router;
\ No newline at end of file
index 9dea99a..973a2c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2032=['split','exports','STRING','BOOLEAN','setDataValue','crudPermissions','join','getDataValue'];(function(_0x3fdefe,_0x13f1cf){var _0x51fa33=function(_0x393e80){while(--_0x393e80){_0x3fdefe['push'](_0x3fdefe['shift']());}};_0x51fa33(++_0x13f1cf);}(_0x2032,0xd9));var _0x2203=function(_0x5d070c,_0x1b8b4c){_0x5d070c=_0x5d070c-0x0;var _0x20f0f5=_0x2032[_0x5d070c];return _0x20f0f5;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'name':{'type':Sequelize[_0x2203('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x2203('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x2203('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x2203('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x46c49a){this[_0x2203('0x3')](_0x2203('0x4'),_0x46c49a?_0x46c49a[_0x2203('0x5')](''):[]);},'get':function(){return this[_0x2203('0x6')](_0x2203('0x4'))?this[_0x2203('0x6')](_0x2203('0x4'))[_0x2203('0x7')](''):[];}}};
\ No newline at end of file
+var _0xc900=['join','getDataValue','split','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions'];(function(_0x3de8a4,_0x289a5c){var _0x4635cf=function(_0x2bddb8){while(--_0x2bddb8){_0x3de8a4['push'](_0x3de8a4['shift']());}};_0x4635cf(++_0x289a5c);}(_0xc900,0xb3));var _0x0c90=function(_0x2c196c,_0x15eda6){_0x2c196c=_0x2c196c-0x0;var _0x276760=_0xc900[_0x2c196c];return _0x276760;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0c90('0x0')],'allowNull':![]},'category':{'type':Sequelize[_0x0c90('0x0')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x0c90('0x1')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x0c90('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x0c90('0x0')],'set':function(_0x492f22){this[_0x0c90('0x3')](_0x0c90('0x4'),_0x492f22?_0x492f22[_0x0c90('0x5')](''):[]);},'get':function(){return this[_0x0c90('0x6')](_0x0c90('0x4'))?this[_0x0c90('0x6')]('crudPermissions')[_0x0c90('0x7')](''):[];}}};
\ No newline at end of file
index 351af30..55e71ac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ea6=['name','map','UserProfileSection','fieldName','query','keys','intersection','attributes','fields','model','hasOwnProperty','order','sort','filters','pick','where','merge','rows','show','params','rawAttributes','length','include','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack'];(function(_0x5797da,_0x44b0bd){var _0x21bb4c=function(_0x4c98a8){while(--_0x4c98a8){_0x5797da['push'](_0x5797da['shift']());}};_0x21bb4c(++_0x44b0bd);}(_0x4ea6,0xad));var _0x64ea=function(_0x5b740b,_0x381833){_0x5b740b=_0x5b740b-0x0;var _0x6f8f4e=_0x4ea6[_0x5b740b];return _0x6f8f4e;};'use strict';var emlformat=require(_0x64ea('0x0'));var rimraf=require(_0x64ea('0x1'));var zipdir=require(_0x64ea('0x2'));var jsonpatch=require(_0x64ea('0x3'));var rp=require('request-promise');var moment=require(_0x64ea('0x4'));var BPromise=require(_0x64ea('0x5'));var Mustache=require(_0x64ea('0x6'));var util=require(_0x64ea('0x7'));var path=require(_0x64ea('0x8'));var sox=require('sox');var csv=require(_0x64ea('0x9'));var ejs=require(_0x64ea('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x64ea('0xb'));var crypto=require(_0x64ea('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x64ea('0xd'));var toCsv=require(_0x64ea('0x9'));var querystring=require(_0x64ea('0xe'));var Papa=require(_0x64ea('0xf'));var Redis=require(_0x64ea('0x10'));var authService=require(_0x64ea('0x11'));var qs=require(_0x64ea('0x12'));var as=require(_0x64ea('0x13'));var hardwareService=require(_0x64ea('0x14'));var logger=require(_0x64ea('0x15'))(_0x64ea('0x16'));var utils=require(_0x64ea('0x17'));var config=require(_0x64ea('0x18'));var licenseUtil=require(_0x64ea('0x19'));var db=require(_0x64ea('0x1a'))['db'];function respondWithStatusCode(_0x40538f,_0x309248){_0x309248=_0x309248||0xcc;return function(_0x1b76ff){if(_0x1b76ff){return _0x40538f[_0x64ea('0x1b')](_0x309248);}return _0x40538f[_0x64ea('0x1c')](_0x309248)[_0x64ea('0x1d')]();};}function respondWithResult(_0x34da6f,_0x4d82f8){_0x4d82f8=_0x4d82f8||0xc8;return function(_0x11f6e2){if(_0x11f6e2){return _0x34da6f[_0x64ea('0x1c')](_0x4d82f8)[_0x64ea('0x1e')](_0x11f6e2);}};}function respondWithFilteredResult(_0x278d40,_0x5f3e7e){return function(_0x696cc){if(_0x696cc){var _0x4c0299=typeof _0x5f3e7e[_0x64ea('0x1f')]==='undefined'&&typeof _0x5f3e7e['limit']==='undefined';var _0x11e471=_0x696cc[_0x64ea('0x20')];var _0x2e0cd6=_0x4c0299?0x0:_0x5f3e7e['offset'];var _0x229702=_0x4c0299?_0x696cc['count']:_0x5f3e7e[_0x64ea('0x1f')]+_0x5f3e7e[_0x64ea('0x21')];var _0x4cb443;if(_0x229702>=_0x11e471){_0x229702=_0x11e471;_0x4cb443=0xc8;}else{_0x4cb443=0xce;}_0x278d40['status'](_0x4cb443);return _0x278d40[_0x64ea('0x22')](_0x64ea('0x23'),_0x2e0cd6+'-'+_0x229702+'/'+_0x11e471)['json'](_0x696cc);}return null;};}function patchUpdates(_0x55f126){return function(_0x3d1a3e){try{jsonpatch['apply'](_0x3d1a3e,_0x55f126,!![]);}catch(_0x4f7e4d){return BPromise[_0x64ea('0x24')](_0x4f7e4d);}return _0x3d1a3e[_0x64ea('0x25')]();};}function saveUpdates(_0x51f7d2,_0x1f0f78){return function(_0x4397bc){if(_0x4397bc){return _0x4397bc[_0x64ea('0x26')](_0x51f7d2)[_0x64ea('0x27')](function(_0x45226f){return _0x45226f;});}return null;};}function removeEntity(_0x6984ad,_0x49a6c0){return function(_0x48d0e6){if(_0x48d0e6){return _0x48d0e6[_0x64ea('0x28')]()[_0x64ea('0x27')](function(){_0x6984ad[_0x64ea('0x1c')](0xcc)[_0x64ea('0x1d')]();});}};}function handleEntityNotFound(_0x181764,_0x18efb3){return function(_0x404e09){if(!_0x404e09){_0x181764[_0x64ea('0x1b')](0x194);}return _0x404e09;};}function handleError(_0x118f84,_0x4c7147){_0x4c7147=_0x4c7147||0x1f4;return function(_0x502179){logger[_0x64ea('0x29')](_0x502179[_0x64ea('0x2a')]);if(_0x502179[_0x64ea('0x2b')]){delete _0x502179[_0x64ea('0x2b')];}_0x118f84['status'](_0x4c7147)['send'](_0x502179);};}exports['index']=function(_0x2055e4,_0x111c8c){var _0xec592f={},_0x5d25b4={},_0xf7fcd5={'count':0x0,'rows':[]};var _0x2da83b=_[_0x64ea('0x2c')](db[_0x64ea('0x2d')]['rawAttributes'],function(_0x13d8b5){return{'name':_0x13d8b5[_0x64ea('0x2e')],'type':_0x13d8b5['type']['key']};});_0x5d25b4['model']=_['map'](_0x2da83b,'name');_0x5d25b4[_0x64ea('0x2f')]=_[_0x64ea('0x30')](_0x2055e4[_0x64ea('0x2f')]);_0x5d25b4['filters']=_[_0x64ea('0x31')](_0x5d25b4['model'],_0x5d25b4[_0x64ea('0x2f')]);_0xec592f[_0x64ea('0x32')]=_[_0x64ea('0x31')](_0x5d25b4['model'],qs['fields'](_0x2055e4['query'][_0x64ea('0x33')]));_0xec592f[_0x64ea('0x32')]=_0xec592f[_0x64ea('0x32')]['length']?_0xec592f[_0x64ea('0x32')]:_0x5d25b4[_0x64ea('0x34')];if(!_0x2055e4[_0x64ea('0x2f')][_0x64ea('0x35')]('nolimit')){_0xec592f[_0x64ea('0x21')]=qs[_0x64ea('0x21')](_0x2055e4['query'][_0x64ea('0x21')]);_0xec592f[_0x64ea('0x1f')]=qs['offset'](_0x2055e4[_0x64ea('0x2f')][_0x64ea('0x1f')]);}_0xec592f[_0x64ea('0x36')]=qs[_0x64ea('0x37')](_0x2055e4[_0x64ea('0x2f')][_0x64ea('0x37')]);_0xec592f['where']=qs[_0x64ea('0x38')](_[_0x64ea('0x39')](_0x2055e4['query'],_0x5d25b4[_0x64ea('0x38')]),_0x2da83b);if(_0x2055e4[_0x64ea('0x2f')]['filter']){_0xec592f[_0x64ea('0x3a')]=_['merge'](_0xec592f[_0x64ea('0x3a')],{'$or':_[_0x64ea('0x2c')](_0x2da83b,function(_0x4b25be){if(_0x4b25be['type']!=='VIRTUAL'){var _0x24acc2={};_0x24acc2[_0x4b25be[_0x64ea('0x2b')]]={'$like':'%'+_0x2055e4['query']['filter']+'%'};return _0x24acc2;}})});}_0xec592f=_[_0x64ea('0x3b')]({},_0xec592f,_0x2055e4['options']);var _0x592c31={'where':_0xec592f[_0x64ea('0x3a')]};return db[_0x64ea('0x2d')][_0x64ea('0x20')](_0x592c31)[_0x64ea('0x27')](function(_0x21a23e){_0xf7fcd5[_0x64ea('0x20')]=_0x21a23e;if(_0x2055e4[_0x64ea('0x2f')]['includeAll']){_0xec592f['include']=[{'all':!![]}];}return db[_0x64ea('0x2d')]['findAll'](_0xec592f);})[_0x64ea('0x27')](function(_0x30a8a1){_0xf7fcd5[_0x64ea('0x3c')]=_0x30a8a1;return _0xf7fcd5;})[_0x64ea('0x27')](respondWithFilteredResult(_0x111c8c,_0xec592f))['catch'](handleError(_0x111c8c,null));};exports[_0x64ea('0x3d')]=function(_0x2ab744,_0x102a05){var _0x4b32ec={'raw':![],'where':{'id':_0x2ab744[_0x64ea('0x3e')]['id']}},_0x4cf010={};_0x4cf010[_0x64ea('0x34')]=_[_0x64ea('0x30')](db[_0x64ea('0x2d')][_0x64ea('0x3f')]);_0x4cf010['query']=_[_0x64ea('0x30')](_0x2ab744['query']);_0x4cf010[_0x64ea('0x38')]=_[_0x64ea('0x31')](_0x4cf010[_0x64ea('0x34')],_0x4cf010[_0x64ea('0x2f')]);_0x4b32ec[_0x64ea('0x32')]=_['intersection'](_0x4cf010[_0x64ea('0x34')],qs['fields'](_0x2ab744['query'][_0x64ea('0x33')]));_0x4b32ec['attributes']=_0x4b32ec['attributes'][_0x64ea('0x40')]?_0x4b32ec[_0x64ea('0x32')]:_0x4cf010[_0x64ea('0x34')];if(_0x2ab744['query']['includeAll']){_0x4b32ec[_0x64ea('0x41')]=[{'all':!![]}];}_0x4b32ec=_[_0x64ea('0x3b')]({},_0x4b32ec,_0x2ab744[_0x64ea('0x42')]);return db[_0x64ea('0x2d')][_0x64ea('0x43')](_0x4b32ec)[_0x64ea('0x27')](handleEntityNotFound(_0x102a05,null))[_0x64ea('0x27')](respondWithResult(_0x102a05,null))[_0x64ea('0x44')](handleError(_0x102a05,null));};exports[_0x64ea('0x45')]=function(_0x52e28f,_0x5812e4){return db['UserProfileSection'][_0x64ea('0x45')](_0x52e28f[_0x64ea('0x46')],{})['then'](respondWithResult(_0x5812e4,0xc9))[_0x64ea('0x44')](handleError(_0x5812e4,null));};exports['update']=function(_0x37d0c0,_0x40f2bf){if(_0x37d0c0[_0x64ea('0x46')]['id']){delete _0x37d0c0[_0x64ea('0x46')]['id'];}return db[_0x64ea('0x2d')][_0x64ea('0x43')]({'where':{'id':_0x37d0c0[_0x64ea('0x3e')]['id']}})[_0x64ea('0x27')](handleEntityNotFound(_0x40f2bf,null))[_0x64ea('0x27')](saveUpdates(_0x37d0c0[_0x64ea('0x46')],null))['then'](respondWithResult(_0x40f2bf,null))[_0x64ea('0x44')](handleError(_0x40f2bf,null));};exports[_0x64ea('0x28')]=function(_0x1ce1e6,_0xd498c){return db[_0x64ea('0x2d')][_0x64ea('0x43')]({'where':{'id':_0x1ce1e6[_0x64ea('0x3e')]['id']}})[_0x64ea('0x27')](handleEntityNotFound(_0xd498c,null))[_0x64ea('0x27')](removeEntity(_0xd498c,null))[_0x64ea('0x44')](handleError(_0xd498c,null));};exports[_0x64ea('0x47')]=function(_0x5ad5cd,_0x42435c){return db[_0x64ea('0x2d')]['describe']()[_0x64ea('0x27')](respondWithResult(_0x42435c,null))[_0x64ea('0x44')](handleError(_0x42435c,null));};
\ No newline at end of file
+var _0x1250=['to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','sendStatus','error','stack','name','index','map','UserProfileSection','fieldName','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','type','VIRTUAL','merge','options','include','findAll','rows','catch','params','rawAttributes','intersection','find','create','body','describe','rimraf','request-promise','mustache','util'];(function(_0x317943,_0x1a4079){var _0x5a578e=function(_0x38e9a6){while(--_0x38e9a6){_0x317943['push'](_0x317943['shift']());}};_0x5a578e(++_0x1a4079);}(_0x1250,0x8a));var _0x0125=function(_0x1185fe,_0x4fc0b4){_0x1185fe=_0x1185fe-0x0;var _0xcecc1e=_0x1250[_0x1185fe];return _0xcecc1e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0125('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0125('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0125('0x2'));var util=require(_0x0125('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0x0125('0x4'));var ejs=require(_0x0125('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0125('0x6'));var squel=require(_0x0125('0x7'));var crypto=require(_0x0125('0x8'));var jsforce=require(_0x0125('0x9'));var deskjs=require(_0x0125('0xa'));var toCsv=require(_0x0125('0x4'));var querystring=require('querystring');var Papa=require(_0x0125('0xb'));var Redis=require(_0x0125('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x0125('0xd'));var as=require(_0x0125('0xe'));var hardwareService=require(_0x0125('0xf'));var logger=require(_0x0125('0x10'))(_0x0125('0x11'));var utils=require(_0x0125('0x12'));var config=require(_0x0125('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x0125('0x14'))['db'];function respondWithStatusCode(_0x206ba2,_0x288740){_0x288740=_0x288740||0xcc;return function(_0xa4e09b){if(_0xa4e09b){return _0x206ba2['sendStatus'](_0x288740);}return _0x206ba2[_0x0125('0x15')](_0x288740)[_0x0125('0x16')]();};}function respondWithResult(_0x566445,_0x49bfa){_0x49bfa=_0x49bfa||0xc8;return function(_0x1693a4){if(_0x1693a4){return _0x566445[_0x0125('0x15')](_0x49bfa)['json'](_0x1693a4);}};}function respondWithFilteredResult(_0x5ad75e,_0x54e0cd){return function(_0x3061a0){if(_0x3061a0){var _0x29c1f8=typeof _0x54e0cd[_0x0125('0x17')]==='undefined'&&typeof _0x54e0cd[_0x0125('0x18')]===_0x0125('0x19');var _0x4794ff=_0x3061a0[_0x0125('0x1a')];var _0x5b5fcd=_0x29c1f8?0x0:_0x54e0cd[_0x0125('0x17')];var _0x3340b1=_0x29c1f8?_0x3061a0['count']:_0x54e0cd[_0x0125('0x17')]+_0x54e0cd[_0x0125('0x18')];var _0x5339d1;if(_0x3340b1>=_0x4794ff){_0x3340b1=_0x4794ff;_0x5339d1=0xc8;}else{_0x5339d1=0xce;}_0x5ad75e[_0x0125('0x15')](_0x5339d1);return _0x5ad75e[_0x0125('0x1b')](_0x0125('0x1c'),_0x5b5fcd+'-'+_0x3340b1+'/'+_0x4794ff)[_0x0125('0x1d')](_0x3061a0);}return null;};}function patchUpdates(_0xcc92aa){return function(_0x3c98eb){try{jsonpatch[_0x0125('0x1e')](_0x3c98eb,_0xcc92aa,!![]);}catch(_0xeb29ab){return BPromise[_0x0125('0x1f')](_0xeb29ab);}return _0x3c98eb[_0x0125('0x20')]();};}function saveUpdates(_0x2b70c1,_0x3e3273){return function(_0x766ecc){if(_0x766ecc){return _0x766ecc['update'](_0x2b70c1)[_0x0125('0x21')](function(_0x14d9db){return _0x14d9db;});}return null;};}function removeEntity(_0x23967b,_0x35a21c){return function(_0x51d07d){if(_0x51d07d){return _0x51d07d['destroy']()[_0x0125('0x21')](function(){_0x23967b[_0x0125('0x15')](0xcc)[_0x0125('0x16')]();});}};}function handleEntityNotFound(_0xa2f0c6,_0x517793){return function(_0x2aa0da){if(!_0x2aa0da){_0xa2f0c6[_0x0125('0x22')](0x194);}return _0x2aa0da;};}function handleError(_0x414f07,_0x472fd4){_0x472fd4=_0x472fd4||0x1f4;return function(_0x4a48d8){logger[_0x0125('0x23')](_0x4a48d8[_0x0125('0x24')]);if(_0x4a48d8[_0x0125('0x25')]){delete _0x4a48d8[_0x0125('0x25')];}_0x414f07[_0x0125('0x15')](_0x472fd4)['send'](_0x4a48d8);};}exports[_0x0125('0x26')]=function(_0x15de5c,_0x29cf84){var _0x4cc5ee={},_0x39024c={},_0x218a0f={'count':0x0,'rows':[]};var _0x26d614=_[_0x0125('0x27')](db[_0x0125('0x28')]['rawAttributes'],function(_0x5445e7){return{'name':_0x5445e7[_0x0125('0x29')],'type':_0x5445e7['type'][_0x0125('0x2a')]};});_0x39024c[_0x0125('0x2b')]=_[_0x0125('0x27')](_0x26d614,_0x0125('0x25'));_0x39024c['query']=_[_0x0125('0x2c')](_0x15de5c[_0x0125('0x2d')]);_0x39024c[_0x0125('0x2e')]=_['intersection'](_0x39024c[_0x0125('0x2b')],_0x39024c['query']);_0x4cc5ee[_0x0125('0x2f')]=_['intersection'](_0x39024c[_0x0125('0x2b')],qs[_0x0125('0x30')](_0x15de5c[_0x0125('0x2d')]['fields']));_0x4cc5ee[_0x0125('0x2f')]=_0x4cc5ee[_0x0125('0x2f')][_0x0125('0x31')]?_0x4cc5ee['attributes']:_0x39024c['model'];if(!_0x15de5c[_0x0125('0x2d')][_0x0125('0x32')](_0x0125('0x33'))){_0x4cc5ee[_0x0125('0x18')]=qs[_0x0125('0x18')](_0x15de5c['query']['limit']);_0x4cc5ee[_0x0125('0x17')]=qs[_0x0125('0x17')](_0x15de5c[_0x0125('0x2d')][_0x0125('0x17')]);}_0x4cc5ee['order']=qs[_0x0125('0x34')](_0x15de5c[_0x0125('0x2d')][_0x0125('0x34')]);_0x4cc5ee['where']=qs['filters'](_[_0x0125('0x35')](_0x15de5c['query'],_0x39024c[_0x0125('0x2e')]),_0x26d614);if(_0x15de5c[_0x0125('0x2d')][_0x0125('0x36')]){_0x4cc5ee[_0x0125('0x37')]=_['merge'](_0x4cc5ee['where'],{'$or':_[_0x0125('0x27')](_0x26d614,function(_0x4e607b){if(_0x4e607b[_0x0125('0x38')]!==_0x0125('0x39')){var _0x147b85={};_0x147b85[_0x4e607b[_0x0125('0x25')]]={'$like':'%'+_0x15de5c[_0x0125('0x2d')][_0x0125('0x36')]+'%'};return _0x147b85;}})});}_0x4cc5ee=_[_0x0125('0x3a')]({},_0x4cc5ee,_0x15de5c[_0x0125('0x3b')]);var _0x3f34e5={'where':_0x4cc5ee[_0x0125('0x37')]};return db[_0x0125('0x28')][_0x0125('0x1a')](_0x3f34e5)[_0x0125('0x21')](function(_0x303db0){_0x218a0f[_0x0125('0x1a')]=_0x303db0;if(_0x15de5c[_0x0125('0x2d')]['includeAll']){_0x4cc5ee[_0x0125('0x3c')]=[{'all':!![]}];}return db[_0x0125('0x28')][_0x0125('0x3d')](_0x4cc5ee);})[_0x0125('0x21')](function(_0x4b13e7){_0x218a0f[_0x0125('0x3e')]=_0x4b13e7;return _0x218a0f;})[_0x0125('0x21')](respondWithFilteredResult(_0x29cf84,_0x4cc5ee))[_0x0125('0x3f')](handleError(_0x29cf84,null));};exports['show']=function(_0x2c202d,_0x474edb){var _0x4fff77={'raw':![],'where':{'id':_0x2c202d[_0x0125('0x40')]['id']}},_0x4c3894={};_0x4c3894[_0x0125('0x2b')]=_[_0x0125('0x2c')](db[_0x0125('0x28')][_0x0125('0x41')]);_0x4c3894[_0x0125('0x2d')]=_[_0x0125('0x2c')](_0x2c202d[_0x0125('0x2d')]);_0x4c3894[_0x0125('0x2e')]=_[_0x0125('0x42')](_0x4c3894[_0x0125('0x2b')],_0x4c3894[_0x0125('0x2d')]);_0x4fff77[_0x0125('0x2f')]=_[_0x0125('0x42')](_0x4c3894[_0x0125('0x2b')],qs[_0x0125('0x30')](_0x2c202d[_0x0125('0x2d')][_0x0125('0x30')]));_0x4fff77[_0x0125('0x2f')]=_0x4fff77[_0x0125('0x2f')][_0x0125('0x31')]?_0x4fff77['attributes']:_0x4c3894[_0x0125('0x2b')];if(_0x2c202d[_0x0125('0x2d')]['includeAll']){_0x4fff77[_0x0125('0x3c')]=[{'all':!![]}];}_0x4fff77=_[_0x0125('0x3a')]({},_0x4fff77,_0x2c202d['options']);return db[_0x0125('0x28')][_0x0125('0x43')](_0x4fff77)['then'](handleEntityNotFound(_0x474edb,null))['then'](respondWithResult(_0x474edb,null))[_0x0125('0x3f')](handleError(_0x474edb,null));};exports['create']=function(_0xe5e97e,_0xca2ec6){return db['UserProfileSection'][_0x0125('0x44')](_0xe5e97e['body'],{})['then'](respondWithResult(_0xca2ec6,0xc9))[_0x0125('0x3f')](handleError(_0xca2ec6,null));};exports['update']=function(_0x41f50f,_0x2cef54){if(_0x41f50f[_0x0125('0x45')]['id']){delete _0x41f50f[_0x0125('0x45')]['id'];}return db[_0x0125('0x28')][_0x0125('0x43')]({'where':{'id':_0x41f50f[_0x0125('0x40')]['id']}})[_0x0125('0x21')](handleEntityNotFound(_0x2cef54,null))['then'](saveUpdates(_0x41f50f[_0x0125('0x45')],null))['then'](respondWithResult(_0x2cef54,null))[_0x0125('0x3f')](handleError(_0x2cef54,null));};exports['destroy']=function(_0x5d6185,_0x41915a){return db[_0x0125('0x28')][_0x0125('0x43')]({'where':{'id':_0x5d6185[_0x0125('0x40')]['id']}})[_0x0125('0x21')](handleEntityNotFound(_0x41915a,null))[_0x0125('0x21')](removeEntity(_0x41915a,null))[_0x0125('0x3f')](handleError(_0x41915a,null));};exports[_0x0125('0x46')]=function(_0x3581fb,_0x4ffc68){return db['UserProfileSection']['describe']()[_0x0125('0x21')](respondWithResult(_0x4ffc68,null))['catch'](handleError(_0x4ffc68,null));};
\ No newline at end of file
index b025b74..d5a7691 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9df5=['exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','util','../../config/logger','moment','bluebird','path','rimraf','./userProfileSection.attributes'];(function(_0x4a6b79,_0x444f6){var _0x5bb128=function(_0x294230){while(--_0x294230){_0x4a6b79['push'](_0x4a6b79['shift']());}};_0x5bb128(++_0x444f6);}(_0x9df5,0x165));var _0x59df=function(_0x46dadf,_0x3cfe11){_0x46dadf=_0x46dadf-0x0;var _0x3541cc=_0x9df5[_0x46dadf];return _0x3541cc;};'use strict';var _=require('lodash');var util=require(_0x59df('0x0'));var logger=require(_0x59df('0x1'))('api');var moment=require(_0x59df('0x2'));var BPromise=require(_0x59df('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x59df('0x4'));var rimraf=require(_0x59df('0x5'));var config=require('../../config/environment');var attributes=require(_0x59df('0x6'));module[_0x59df('0x7')]=function(_0x771f60,_0x5d6317){return _0x771f60[_0x59df('0x8')](_0x59df('0x9'),attributes,{'tableName':_0x59df('0xa'),'paranoid':![],'indexes':[{'name':_0x59df('0xb'),'fields':[_0x59df('0xc'),_0x59df('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb722=['bluebird','path','rimraf','./userProfileSection.attributes','exports','define','UserProfileSection','compositeIndex','sectionId','userProfileId','lodash','util','moment'];(function(_0xe4c512,_0xa1072c){var _0xb8183c=function(_0x4b43cb){while(--_0x4b43cb){_0xe4c512['push'](_0xe4c512['shift']());}};_0xb8183c(++_0xa1072c);}(_0xb722,0xda));var _0x2b72=function(_0x28a23c,_0x3d4901){_0x28a23c=_0x28a23c-0x0;var _0x489a5b=_0xb722[_0x28a23c];return _0x489a5b;};'use strict';var _=require(_0x2b72('0x0'));var util=require(_0x2b72('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2b72('0x2'));var BPromise=require(_0x2b72('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b72('0x4'));var rimraf=require(_0x2b72('0x5'));var config=require('../../config/environment');var attributes=require(_0x2b72('0x6'));module[_0x2b72('0x7')]=function(_0x55c7ec,_0x113c87){return _0x55c7ec[_0x2b72('0x8')](_0x2b72('0x9'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x2b72('0xa'),'fields':[_0x2b72('0xb'),_0x2b72('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 4200bf8..2542d25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb815=['lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch'];(function(_0x35ecfc,_0xa522ae){var _0x5d759d=function(_0x51bf48){while(--_0x51bf48){_0x35ecfc['push'](_0x35ecfc['shift']());}};_0x5d759d(++_0xa522ae);}(_0xb815,0x160));var _0x5b81=function(_0x2963b3,_0x179f6d){_0x2963b3=_0x2963b3-0x0;var _0x333b8e=_0xb815[_0x2963b3];return _0x333b8e;};'use strict';var _=require(_0x5b81('0x0'));var util=require(_0x5b81('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5b81('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b81('0x3'))['db'];var utils=require(_0x5b81('0x4'));var logger=require(_0x5b81('0x5'))(_0x5b81('0x6'));var config=require('../../config/environment');var jayson=require(_0x5b81('0x7'));var client=jayson[_0x5b81('0x8')][_0x5b81('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x340970,_0xcbaa80,_0x682c3e){return new BPromise(function(_0x13b3a2,_0x1bbd92){return client[_0x5b81('0xa')](_0x340970,_0x682c3e)[_0x5b81('0xb')](function(_0x382cb7){logger[_0x5b81('0xc')](_0x5b81('0xd'),_0xcbaa80,'request\x20sent');logger[_0x5b81('0xe')](_0x5b81('0xf'),_0xcbaa80,'request\x20sent',JSON[_0x5b81('0x10')](_0x382cb7));if(_0x382cb7[_0x5b81('0x11')]){if(_0x382cb7[_0x5b81('0x11')]['code']===0x1f4){logger[_0x5b81('0x11')](_0x5b81('0xd'),_0xcbaa80,_0x382cb7[_0x5b81('0x11')][_0x5b81('0x12')]);return _0x1bbd92(_0x382cb7[_0x5b81('0x11')][_0x5b81('0x12')]);}logger[_0x5b81('0x11')]('UserProfileSection,\x20%s,\x20%s',_0xcbaa80,_0x382cb7[_0x5b81('0x11')]['message']);return _0x13b3a2(_0x382cb7[_0x5b81('0x11')][_0x5b81('0x12')]);}else{logger[_0x5b81('0xc')](_0x5b81('0xd'),_0xcbaa80,_0x5b81('0x13'));_0x13b3a2(_0x382cb7[_0x5b81('0x14')][_0x5b81('0x12')]);}})[_0x5b81('0x15')](function(_0x3e32a2){logger[_0x5b81('0x11')](_0x5b81('0xd'),_0xcbaa80,_0x3e32a2);_0x1bbd92(_0x3e32a2);});});}
\ No newline at end of file
+var _0xe3d7=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0xe3d7,0x109));var _0x7e3d=function(_0xff7090,_0x298d0c){_0xff7090=_0xff7090-0x0;var _0x225b6e=_0xe3d7[_0xff7090];return _0x225b6e;};'use strict';var _=require('lodash');var util=require(_0x7e3d('0x0'));var moment=require(_0x7e3d('0x1'));var BPromise=require(_0x7e3d('0x2'));var rs=require(_0x7e3d('0x3'));var fs=require('fs');var Redis=require(_0x7e3d('0x4'));var db=require(_0x7e3d('0x5'))['db'];var utils=require(_0x7e3d('0x6'));var logger=require('../../config/logger')(_0x7e3d('0x7'));var config=require(_0x7e3d('0x8'));var jayson=require(_0x7e3d('0x9'));var client=jayson[_0x7e3d('0xa')][_0x7e3d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x351a6c,_0x3d1cc9,_0x688b93){return new BPromise(function(_0x200ce0,_0x3917bd){return client['request'](_0x351a6c,_0x688b93)[_0x7e3d('0xc')](function(_0x55701f){logger[_0x7e3d('0xd')](_0x7e3d('0xe'),_0x3d1cc9,_0x7e3d('0xf'));logger[_0x7e3d('0x10')](_0x7e3d('0x11'),_0x3d1cc9,_0x7e3d('0xf'),JSON[_0x7e3d('0x12')](_0x55701f));if(_0x55701f[_0x7e3d('0x13')]){if(_0x55701f[_0x7e3d('0x13')][_0x7e3d('0x14')]===0x1f4){logger['error'](_0x7e3d('0xe'),_0x3d1cc9,_0x55701f[_0x7e3d('0x13')][_0x7e3d('0x15')]);return _0x3917bd(_0x55701f[_0x7e3d('0x13')]['message']);}logger['error']('UserProfileSection,\x20%s,\x20%s',_0x3d1cc9,_0x55701f[_0x7e3d('0x13')]['message']);return _0x200ce0(_0x55701f[_0x7e3d('0x13')]['message']);}else{logger[_0x7e3d('0xd')](_0x7e3d('0xe'),_0x3d1cc9,_0x7e3d('0xf'));_0x200ce0(_0x55701f[_0x7e3d('0x16')]['message']);}})[_0x7e3d('0x17')](function(_0x48d9ee){logger[_0x7e3d('0x13')](_0x7e3d('0xe'),_0x3d1cc9,_0x48d9ee);_0x3917bd(_0x48d9ee);});});}
\ No newline at end of file
index 03ee095..88a9e79 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(_0x18517c,_0x16c20f){var _0x4f4727=function(_0x4214a7){while(--_0x4214a7){_0x18517c['push'](_0x18517c['shift']());}};_0x4f4727(++_0x16c20f);}(_0xe706,0xa3));var _0x6e70=function(_0x5998d0,_0x24ad81){_0x5998d0=_0x5998d0-0x0;var _0x47149d=_0xe706[_0x5998d0];return _0x47149d;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x135c64,_0x230f7b){var _0xf01125=function(_0x52ad91){while(--_0x52ad91){_0x135c64['push'](_0x135c64['shift']());}};_0xf01125(++_0x230f7b);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x8af54b,_0x280be5){_0x8af54b=_0x8af54b-0x0;var _0x27d8f0=_0xcb91[_0x8af54b];return _0x27d8f0;};'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 d3819fe..79ea838 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6efc=['exports','INTEGER','sequelize'];(function(_0x2bb735,_0x62f050){var _0x17f252=function(_0x46046e){while(--_0x46046e){_0x2bb735['push'](_0x2bb735['shift']());}};_0x17f252(++_0x62f050);}(_0x6efc,0xec));var _0xc6ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6efc[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc6ef('0x0'));module[_0xc6ef('0x1')]={'penalty':{'type':Sequelize[_0xc6ef('0x2')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x42d4=['exports','INTEGER','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x42d4,0xe6));var _0x442d=function(_0x58e796,_0x4090c3){_0x58e796=_0x58e796-0x0;var _0x22fba0=_0x42d4[_0x58e796];return _0x22fba0;};'use strict';var Sequelize=require(_0x442d('0x0'));module[_0x442d('0x1')]={'penalty':{'type':Sequelize[_0x442d('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index 96c08c0..242e291 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b29=['path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues','util','../../config/logger','api','moment','request-promise'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2b29,0x163));var _0x92b2=function(_0x125e5f,_0x39482a){_0x125e5f=_0x125e5f-0x0;var _0x211482=_0x2b29[_0x125e5f];return _0x211482;};'use strict';var _=require('lodash');var util=require(_0x92b2('0x0'));var logger=require(_0x92b2('0x1'))(_0x92b2('0x2'));var moment=require(_0x92b2('0x3'));var BPromise=require('bluebird');var rp=require(_0x92b2('0x4'));var fs=require('fs');var path=require(_0x92b2('0x5'));var rimraf=require(_0x92b2('0x6'));var config=require(_0x92b2('0x7'));var attributes=require(_0x92b2('0x8'));module[_0x92b2('0x9')]=function(_0x47c522,_0xb1d856){return _0x47c522['define'](_0x92b2('0xa'),attributes,{'tableName':_0x92b2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xba18=['moment','bluebird','request-promise','path','../../config/environment','./userSmsQueue.attributes','exports','define','user_has_sms_queues','lodash','util','../../config/logger','api'];(function(_0x54735a,_0x1f4716){var _0x543be6=function(_0x583339){while(--_0x583339){_0x54735a['push'](_0x54735a['shift']());}};_0x543be6(++_0x1f4716);}(_0xba18,0x1ea));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8ba1('0x0'));var util=require(_0x8ba1('0x1'));var logger=require(_0x8ba1('0x2'))(_0x8ba1('0x3'));var moment=require(_0x8ba1('0x4'));var BPromise=require(_0x8ba1('0x5'));var rp=require(_0x8ba1('0x6'));var fs=require('fs');var path=require(_0x8ba1('0x7'));var rimraf=require('rimraf');var config=require(_0x8ba1('0x8'));var attributes=require(_0x8ba1('0x9'));module[_0x8ba1('0xa')]=function(_0x2a9dab,_0x3b107c){return _0x2a9dab[_0x8ba1('0xb')]('UserSmsQueue',attributes,{'tableName':_0x8ba1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 672f328..6cf311c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7c98=['jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment'];(function(_0x156dba,_0x4e513e){var _0xa401c=function(_0x2fcb8c){while(--_0x2fcb8c){_0x156dba['push'](_0x156dba['shift']());}};_0xa401c(++_0x4e513e);}(_0x7c98,0x7c));var _0x87c9=function(_0x124096,_0xbb4341){_0x124096=_0x124096-0x0;var _0x123aed=_0x7c98[_0x124096];return _0x123aed;};'use strict';var _=require(_0x87c9('0x0'));var util=require(_0x87c9('0x1'));var moment=require(_0x87c9('0x2'));var BPromise=require('bluebird');var rs=require(_0x87c9('0x3'));var fs=require('fs');var Redis=require(_0x87c9('0x4'));var db=require(_0x87c9('0x5'))['db'];var utils=require(_0x87c9('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x87c9('0x7'));var jayson=require(_0x87c9('0x8'));var client=jayson[_0x87c9('0x9')][_0x87c9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32b029,_0x4359c2,_0x5d59c1){return new BPromise(function(_0x15f56d,_0x180010){return client[_0x87c9('0xb')](_0x32b029,_0x5d59c1)[_0x87c9('0xc')](function(_0x1dc010){logger[_0x87c9('0xd')](_0x87c9('0xe'),_0x4359c2,_0x87c9('0xf'));logger['debug'](_0x87c9('0x10'),_0x4359c2,_0x87c9('0xf'),JSON['stringify'](_0x1dc010));if(_0x1dc010['error']){if(_0x1dc010[_0x87c9('0x11')][_0x87c9('0x12')]===0x1f4){logger[_0x87c9('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x4359c2,_0x1dc010[_0x87c9('0x11')]['message']);return _0x180010(_0x1dc010[_0x87c9('0x11')]['message']);}logger[_0x87c9('0x11')](_0x87c9('0xe'),_0x4359c2,_0x1dc010[_0x87c9('0x11')]['message']);return _0x15f56d(_0x1dc010['error'][_0x87c9('0x13')]);}else{logger['info'](_0x87c9('0xe'),_0x4359c2,_0x87c9('0xf'));_0x15f56d(_0x1dc010[_0x87c9('0x14')][_0x87c9('0x13')]);}})[_0x87c9('0x15')](function(_0x100e2a){logger[_0x87c9('0x11')](_0x87c9('0xe'),_0x4359c2,_0x100e2a);_0x180010(_0x100e2a);});});}
\ No newline at end of file
+var _0xb703=['code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xb703,0xdf));var _0x3b70=function(_0x3762b6,_0x374200){_0x3762b6=_0x3762b6-0x0;var _0x1a72ab=_0xb703[_0x3762b6];return _0x1a72ab;};'use strict';var _=require(_0x3b70('0x0'));var util=require('util');var moment=require(_0x3b70('0x1'));var BPromise=require(_0x3b70('0x2'));var rs=require(_0x3b70('0x3'));var fs=require('fs');var Redis=require(_0x3b70('0x4'));var db=require(_0x3b70('0x5'))['db'];var utils=require(_0x3b70('0x6'));var logger=require(_0x3b70('0x7'))('rpc');var config=require(_0x3b70('0x8'));var jayson=require(_0x3b70('0x9'));var client=jayson[_0x3b70('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x207d9c,_0x5bc8be,_0x5d1f50){return new BPromise(function(_0x66969c,_0x42c662){return client[_0x3b70('0xb')](_0x207d9c,_0x5d1f50)[_0x3b70('0xc')](function(_0x125c6e){logger['info'](_0x3b70('0xd'),_0x5bc8be,'request\x20sent');logger['debug']('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x5bc8be,_0x3b70('0xe'),JSON[_0x3b70('0xf')](_0x125c6e));if(_0x125c6e[_0x3b70('0x10')]){if(_0x125c6e[_0x3b70('0x10')][_0x3b70('0x11')]===0x1f4){logger[_0x3b70('0x10')](_0x3b70('0xd'),_0x5bc8be,_0x125c6e[_0x3b70('0x10')][_0x3b70('0x12')]);return _0x42c662(_0x125c6e['error'][_0x3b70('0x12')]);}logger[_0x3b70('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x5bc8be,_0x125c6e[_0x3b70('0x10')][_0x3b70('0x12')]);return _0x66969c(_0x125c6e[_0x3b70('0x10')][_0x3b70('0x12')]);}else{logger['info'](_0x3b70('0xd'),_0x5bc8be,_0x3b70('0xe'));_0x66969c(_0x125c6e[_0x3b70('0x13')]['message']);}})['catch'](function(_0x756a36){logger[_0x3b70('0x10')](_0x3b70('0xd'),_0x5bc8be,_0x756a36);_0x42c662(_0x756a36);});});}
\ No newline at end of file
index c8ae2d6..87e69ed 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x799a=['exports','INTEGER'];(function(_0x184b7c,_0x96e391){var _0x44d750=function(_0x2743f2){while(--_0x2743f2){_0x184b7c['push'](_0x184b7c['shift']());}};_0x44d750(++_0x96e391);}(_0x799a,0x194));var _0xa799=function(_0x4dc512,_0x11475a){_0x4dc512=_0x4dc512-0x0;var _0xbba65f=_0x799a[_0x4dc512];return _0xbba65f;};'use strict';var Sequelize=require('sequelize');module[_0xa799('0x0')]={'UserId':{'type':Sequelize[_0xa799('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x7826=['sequelize','exports','INTEGER'];(function(_0x3e0f23,_0x4e71fc){var _0x29799c=function(_0x3acee4){while(--_0x3acee4){_0x3e0f23['push'](_0x3e0f23['shift']());}};_0x29799c(++_0x4e71fc);}(_0x7826,0x162));var _0x6782=function(_0x5b2865,_0x3b814b){_0x5b2865=_0x5b2865-0x0;var _0x3cb4c6=_0x7826[_0x5b2865];return _0x3cb4c6;};'use strict';var Sequelize=require(_0x6782('0x0'));module[_0x6782('0x1')]={'UserId':{'type':Sequelize[_0x6782('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x6782('0x2')]}};
\ No newline at end of file
index efcbe36..11f64e3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x52e83d,_0x2c09f0){var _0x111b97=function(_0x4fc139){while(--_0x4fc139){_0x52e83d['push'](_0x52e83d['shift']());}};_0x111b97(++_0x2c09f0);}(_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':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x46beb1,_0x1a6d81){var _0x5ee4df=function(_0x4c3f4f){while(--_0x4c3f4f){_0x46beb1['push'](_0x46beb1['shift']());}};_0x5ee4df(++_0x1a6d81);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 7009d15..9834bc7 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(_0x5f5a64,_0x11640b){var _0x6b73ff=function(_0x5ae266){while(--_0x5ae266){_0x5f5a64['push'](_0x5f5a64['shift']());}};_0x6b73ff(++_0x11640b);}(_0x70e0,0x17b));var _0x070e=function(_0x4b7379,_0x2d360a){_0x4b7379=_0x4b7379-0x0;var _0x41c15f=_0x70e0[_0x4b7379];return _0x41c15f;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router;
\ No newline at end of file
+var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4ecbaf,_0x2e50a9){var _0x213f3a=function(_0x553867){while(--_0x553867){_0x4ecbaf['push'](_0x4ecbaf['shift']());}};_0x213f3a(++_0x2e50a9);}(_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 b15d03a..a388ccf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57b5=['exports','INTEGER'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x57b5,0x1bc));var _0x557b=function(_0x469393,_0x247969){_0x469393=_0x469393-0x0;var _0x5f720d=_0x57b5[_0x469393];return _0x5f720d;};'use strict';var Sequelize=require('sequelize');module[_0x557b('0x0')]={'penalty':{'type':Sequelize[_0x557b('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x5aee=['exports','sequelize'];(function(_0x48d0bc,_0x3df4c5){var _0x4e9bbc=function(_0x2cd986){while(--_0x2cd986){_0x48d0bc['push'](_0x48d0bc['shift']());}};_0x4e9bbc(++_0x3df4c5);}(_0x5aee,0x111));var _0xe5ae=function(_0x2c6237,_0x17bcde){_0x2c6237=_0x2c6237-0x0;var _0x31d8ed=_0x5aee[_0x2c6237];return _0x31d8ed;};'use strict';var Sequelize=require(_0xe5ae('0x0'));module[_0xe5ae('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
index bcdcc15..d95d5cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa20c=['path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','user_has_voice_queues','api','moment','bluebird','request-promise'];(function(_0x3b96cf,_0x1592f2){var _0x2e315a=function(_0x21fa50){while(--_0x21fa50){_0x3b96cf['push'](_0x3b96cf['shift']());}};_0x2e315a(++_0x1592f2);}(_0xa20c,0x1a0));var _0xca20=function(_0x96d638,_0x5f1a4f){_0x96d638=_0x96d638-0x0;var _0x4d689f=_0xa20c[_0x96d638];return _0x4d689f;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xca20('0x0'));var moment=require(_0xca20('0x1'));var BPromise=require(_0xca20('0x2'));var rp=require(_0xca20('0x3'));var fs=require('fs');var path=require(_0xca20('0x4'));var rimraf=require(_0xca20('0x5'));var config=require(_0xca20('0x6'));var attributes=require(_0xca20('0x7'));module[_0xca20('0x8')]=function(_0x140337,_0x2190e7){return _0x140337['define']('UserVoiceQueue',attributes,{'tableName':_0xca20('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf0f0=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xf0f0,0xc0));var _0x0f0f=function(_0x374c9b,_0x2c190c){_0x374c9b=_0x374c9b-0x0;var _0x199327=_0xf0f0[_0x374c9b];return _0x199327;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0f0f('0x0'))(_0x0f0f('0x1'));var moment=require(_0x0f0f('0x2'));var BPromise=require(_0x0f0f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f0f('0x4'));var rimraf=require(_0x0f0f('0x5'));var config=require(_0x0f0f('0x6'));var attributes=require(_0x0f0f('0x7'));module[_0x0f0f('0x8')]=function(_0x2bfc23,_0x5db600){return _0x2bfc23[_0x0f0f('0x9')](_0x0f0f('0xa'),attributes,{'tableName':_0x0f0f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 4effffc..ccb6cd3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf58=['then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x324d02,_0x350c80){var _0x3ac052=function(_0x44f137){while(--_0x44f137){_0x324d02['push'](_0x324d02['shift']());}};_0x3ac052(++_0x350c80);}(_0xdf58,0xdd));var _0x8df5=function(_0x5b5abb,_0x291ee5){_0x5b5abb=_0x5b5abb-0x0;var _0x3fbd6f=_0xdf58[_0x5b5abb];return _0x3fbd6f;};'use strict';var _=require(_0x8df5('0x0'));var util=require(_0x8df5('0x1'));var moment=require('moment');var BPromise=require(_0x8df5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8df5('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8df5('0x4'))(_0x8df5('0x5'));var config=require(_0x8df5('0x6'));var jayson=require(_0x8df5('0x7'));var client=jayson[_0x8df5('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47a38f,_0x3bd39f,_0x2a8c2d){return new BPromise(function(_0x338e45,_0x549185){return client[_0x8df5('0x9')](_0x47a38f,_0x2a8c2d)[_0x8df5('0xa')](function(_0x17c04d){logger[_0x8df5('0xb')](_0x8df5('0xc'),_0x3bd39f,_0x8df5('0xd'));logger[_0x8df5('0xe')]('UserVoiceQueue,\x20%s,\x20%s,\x20%s',_0x3bd39f,_0x8df5('0xd'),JSON[_0x8df5('0xf')](_0x17c04d));if(_0x17c04d['error']){if(_0x17c04d['error'][_0x8df5('0x10')]===0x1f4){logger[_0x8df5('0x11')](_0x8df5('0xc'),_0x3bd39f,_0x17c04d[_0x8df5('0x11')]['message']);return _0x549185(_0x17c04d[_0x8df5('0x11')]['message']);}logger['error'](_0x8df5('0xc'),_0x3bd39f,_0x17c04d[_0x8df5('0x11')][_0x8df5('0x12')]);return _0x338e45(_0x17c04d['error']['message']);}else{logger[_0x8df5('0xb')](_0x8df5('0xc'),_0x3bd39f,_0x8df5('0xd'));_0x338e45(_0x17c04d[_0x8df5('0x13')][_0x8df5('0x12')]);}})[_0x8df5('0x14')](function(_0x482bff){logger[_0x8df5('0x11')](_0x8df5('0xc'),_0x3bd39f,_0x482bff);_0x549185(_0x482bff);});});}
\ No newline at end of file
+var _0xfb1d=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','request','then','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','UserVoiceQueue,\x20%s,\x20%s','message'];(function(_0x66e219,_0x56960f){var _0x94dc01=function(_0x20f07a){while(--_0x20f07a){_0x66e219['push'](_0x66e219['shift']());}};_0x94dc01(++_0x56960f);}(_0xfb1d,0x1ba));var _0xdfb1=function(_0x4269c3,_0x597468){_0x4269c3=_0x4269c3-0x0;var _0x139c5b=_0xfb1d[_0x4269c3];return _0x139c5b;};'use strict';var _=require(_0xdfb1('0x0'));var util=require(_0xdfb1('0x1'));var moment=require(_0xdfb1('0x2'));var BPromise=require(_0xdfb1('0x3'));var rs=require(_0xdfb1('0x4'));var fs=require('fs');var Redis=require(_0xdfb1('0x5'));var db=require(_0xdfb1('0x6'))['db'];var utils=require(_0xdfb1('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xdfb1('0x8'));var client=jayson[_0xdfb1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14969a,_0x36c96f,_0x5a1116){return new BPromise(function(_0x3b3cae,_0xa03801){return client[_0xdfb1('0xa')](_0x14969a,_0x5a1116)[_0xdfb1('0xb')](function(_0x3ebe64){logger[_0xdfb1('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x36c96f,_0xdfb1('0xd'));logger[_0xdfb1('0xe')](_0xdfb1('0xf'),_0x36c96f,'request\x20sent',JSON['stringify'](_0x3ebe64));if(_0x3ebe64[_0xdfb1('0x10')]){if(_0x3ebe64[_0xdfb1('0x10')][_0xdfb1('0x11')]===0x1f4){logger[_0xdfb1('0x10')](_0xdfb1('0x12'),_0x36c96f,_0x3ebe64['error']['message']);return _0xa03801(_0x3ebe64['error'][_0xdfb1('0x13')]);}logger[_0xdfb1('0x10')](_0xdfb1('0x12'),_0x36c96f,_0x3ebe64[_0xdfb1('0x10')][_0xdfb1('0x13')]);return _0x3b3cae(_0x3ebe64[_0xdfb1('0x10')][_0xdfb1('0x13')]);}else{logger[_0xdfb1('0xc')](_0xdfb1('0x12'),_0x36c96f,_0xdfb1('0xd'));_0x3b3cae(_0x3ebe64[_0xdfb1('0x14')][_0xdfb1('0x13')]);}})[_0xdfb1('0x15')](function(_0x3b5017){logger[_0xdfb1('0x10')](_0xdfb1('0x12'),_0x36c96f,_0x3b5017);_0xa03801(_0x3b5017);});});}
\ No newline at end of file
index dc463d6..ea19b2f 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(_0x4cbed8,_0x3f3b31){var _0x4f8fe9=function(_0x8baa8b){while(--_0x8baa8b){_0x4cbed8['push'](_0x4cbed8['shift']());}};_0x4f8fe9(++_0x3f3b31);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x43a1b8,_0x1c90c8){_0x43a1b8=_0x43a1b8-0x0;var _0x324ecc=_0xcb91[_0x43a1b8];return _0x324ecc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router;
\ No newline at end of file
+var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x4c7feb,_0x4e0ead){var _0x5be7a6=function(_0x216f67){while(--_0x216f67){_0x4c7feb['push'](_0x4c7feb['shift']());}};_0x5be7a6(++_0x4e0ead);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4d7379,_0x4b4e63){_0x4d7379=_0x4d7379-0x0;var _0x46d7cf=_0xcb91[_0x4d7379];return _0x46d7cf;};'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 ff16729..b9e871a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa209=['exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface','sequelize'];(function(_0x3b0a42,_0x420275){var _0x27f854=function(_0x2dccb2){while(--_0x2dccb2){_0x3b0a42['push'](_0x3b0a42['shift']());}};_0x27f854(++_0x420275);}(_0xa209,0x1bb));var _0x9a20=function(_0x4fd848,_0x4a216d){_0x4fd848=_0x4fd848-0x0;var _0x197955=_0xa209[_0x4fd848];return _0x197955;};'use strict';var Sequelize=require(_0x9a20('0x0'));module[_0x9a20('0x1')]={'uniqueid':{'type':Sequelize[_0x9a20('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0x9a20('0x3')},'membername':{'type':Sequelize[_0x9a20('0x4')],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0x9a20('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9a20('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x9a20('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9a20('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x9a20('0x3')},'paused':{'type':Sequelize[_0x9a20('0x2')](0xb),'defaultValue':0x0,'comment':_0x9a20('0x3')}};
\ No newline at end of file
+var _0x31b9=['Required\x20by\x20Asterisk','STRING','INTEGER','queue_interface','sequelize','exports'];(function(_0x162221,_0x3951a8){var _0x5d792a=function(_0x594588){while(--_0x594588){_0x162221['push'](_0x162221['shift']());}};_0x5d792a(++_0x3951a8);}(_0x31b9,0x7c));var _0x931b=function(_0x2e804a,_0x23a954){_0x2e804a=_0x2e804a-0x0;var _0x48026f=_0x31b9[_0x2e804a];return _0x48026f;};'use strict';var Sequelize=require(_0x931b('0x0'));module[_0x931b('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x931b('0x2')},'membername':{'type':Sequelize[_0x931b('0x3')],'allowNull':![],'comment':_0x931b('0x2')},'UserId':{'type':Sequelize[_0x931b('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x931b('0x3')],'allowNull':![],'unique':_0x931b('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x931b('0x4')],'allowNull':![]},'interface':{'type':Sequelize[_0x931b('0x3')],'allowNull':![],'unique':_0x931b('0x5'),'comment':_0x931b('0x2')},'penalty':{'type':Sequelize[_0x931b('0x4')](0xb),'defaultValue':0x0,'comment':_0x931b('0x2')},'paused':{'type':Sequelize[_0x931b('0x4')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}};
\ No newline at end of file
index 8acf0e0..4b3b561 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd56c=['events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2be851,_0x1b998c){var _0x1e8c88=function(_0x3b8d37){while(--_0x3b8d37){_0x2be851['push'](_0x2be851['shift']());}};_0x1e8c88(++_0x1b998c);}(_0xd56c,0xa0));var _0xcd56=function(_0x2ec196,_0x2abe6e){_0x2ec196=_0x2ec196-0x0;var _0xffe018=_0xd56c[_0x2ec196];return _0xffe018;};'use strict';var EventEmitter=require(_0xcd56('0x0'));var UserVoiceQueueRt=require(_0xcd56('0x1'))['db'][_0xcd56('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xcd56('0x3')](0x0);var events={'afterCreate':_0xcd56('0x4'),'afterUpdate':_0xcd56('0x5'),'afterDestroy':_0xcd56('0x6')};function emitEvent(_0x836e90){return function(_0x3b22b1,_0x4a0383,_0x896109){UserVoiceQueueRtEvents[_0xcd56('0x7')](_0x836e90+':'+_0x3b22b1['id'],_0x3b22b1);UserVoiceQueueRtEvents['emit'](_0x836e90,_0x3b22b1);_0x896109(null);};}for(var e in events){if(events[_0xcd56('0x8')](e)){var event=events[e];UserVoiceQueueRt[_0xcd56('0x9')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents;
\ No newline at end of file
+var _0x4a1d=['setMaxListeners','save','remove','emit','hook','exports','events','../../mysqldb'];(function(_0x216428,_0x5d20ea){var _0x313dd4=function(_0x447e0d){while(--_0x447e0d){_0x216428['push'](_0x216428['shift']());}};_0x313dd4(++_0x5d20ea);}(_0x4a1d,0x1ce));var _0xd4a1=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x4a1d[_0x49ca18];return _0x145d54;};'use strict';var EventEmitter=require(_0xd4a1('0x0'));var UserVoiceQueueRt=require(_0xd4a1('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xd4a1('0x2')](0x0);var events={'afterCreate':_0xd4a1('0x3'),'afterUpdate':'update','afterDestroy':_0xd4a1('0x4')};function emitEvent(_0x22b63b){return function(_0x5aaa23,_0x3c5700,_0x283c9c){UserVoiceQueueRtEvents[_0xd4a1('0x5')](_0x22b63b+':'+_0x5aaa23['id'],_0x5aaa23);UserVoiceQueueRtEvents['emit'](_0x22b63b,_0x5aaa23);_0x283c9c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0xd4a1('0x6')](e,emitEvent(event));}}module[_0xd4a1('0x7')]=UserVoiceQueueRtEvents;
\ No newline at end of file
index 062e129..c108bcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x368c=['./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x30ac14,_0x2ed451){var _0x32080d=function(_0x181ec3){while(--_0x181ec3){_0x30ac14['push'](_0x30ac14['shift']());}};_0x32080d(++_0x2ed451);}(_0x368c,0x1dd));var _0xc368=function(_0x1e6596,_0x4f5b93){_0x1e6596=_0x1e6596-0x0;var _0x16266e=_0x368c[_0x1e6596];return _0x16266e;};'use strict';var _=require(_0xc368('0x0'));var util=require(_0xc368('0x1'));var logger=require(_0xc368('0x2'))('api');var moment=require('moment');var BPromise=require(_0xc368('0x3'));var rp=require(_0xc368('0x4'));var fs=require('fs');var path=require(_0xc368('0x5'));var rimraf=require(_0xc368('0x6'));var config=require('../../config/environment');var attributes=require(_0xc368('0x7'));module['exports']=function(_0x48e624,_0x52e979){return _0x48e624[_0xc368('0x8')](_0xc368('0x9'),attributes,{'tableName':_0xc368('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6a84=['exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','api','moment','bluebird','path','rimraf','./userVoiceQueueRt.attributes'];(function(_0x45f111,_0x3a1a4a){var _0x483508=function(_0x3131ab){while(--_0x3131ab){_0x45f111['push'](_0x45f111['shift']());}};_0x483508(++_0x3a1a4a);}(_0x6a84,0x1c0));var _0x46a8=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x6a84[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require(_0x46a8('0x0'));var util=require(_0x46a8('0x1'));var logger=require('../../config/logger')(_0x46a8('0x2'));var moment=require(_0x46a8('0x3'));var BPromise=require(_0x46a8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x46a8('0x5'));var rimraf=require(_0x46a8('0x6'));var config=require('../../config/environment');var attributes=require(_0x46a8('0x7'));module[_0x46a8('0x8')]=function(_0x426b4c,_0x5c859d){return _0x426b4c[_0x46a8('0x9')](_0x46a8('0xa'),attributes,{'tableName':_0x46a8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 9faa307..9fc42e8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf319=['debug','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','UserVoiceQueueRt,\x20%s,\x20%s','stringify','error','message','info','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','outboundQueuePauses'];(function(_0x544713,_0x124c2c){var _0x153df4=function(_0x4d2a5d){while(--_0x4d2a5d){_0x544713['push'](_0x544713['shift']());}};_0x153df4(++_0x124c2c);}(_0xf319,0x95));var _0x9f31=function(_0x7c265c,_0x1cf3b8){_0x7c265c=_0x7c265c-0x0;var _0x5e9b43=_0xf319[_0x7c265c];return _0x5e9b43;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9f31('0x0'));var BPromise=require(_0x9f31('0x1'));var rs=require(_0x9f31('0x2'));var fs=require('fs');var Redis=require(_0x9f31('0x3'));var db=require(_0x9f31('0x4'))['db'];var utils=require(_0x9f31('0x5'));var logger=require(_0x9f31('0x6'))(_0x9f31('0x7'));var config=require(_0x9f31('0x8'));var jayson=require(_0x9f31('0x9'));var client=jayson[_0x9f31('0xa')][_0x9f31('0xb')]({'port':0x232a});config[_0x9f31('0xc')]=_[_0x9f31('0xd')](config[_0x9f31('0xc')],{'host':_0x9f31('0xe'),'port':0x18eb});var socket=require(_0x9f31('0xf'))(new Redis(config[_0x9f31('0xc')]));require(_0x9f31('0x10'))[_0x9f31('0x11')](socket);function respondWithRpcPromise(_0x17bb76,_0x19b5f6,_0x2b94b5){return new BPromise(function(_0x69d5ea,_0x3c740d){return client[_0x9f31('0x12')](_0x17bb76,_0x2b94b5)[_0x9f31('0x13')](function(_0x5b5d60){logger['info'](_0x9f31('0x14'),_0x19b5f6,'request\x20sent');logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x19b5f6,'request\x20sent',JSON[_0x9f31('0x15')](_0x5b5d60));if(_0x5b5d60[_0x9f31('0x16')]){if(_0x5b5d60[_0x9f31('0x16')]['code']===0x1f4){logger[_0x9f31('0x16')](_0x9f31('0x14'),_0x19b5f6,_0x5b5d60[_0x9f31('0x16')][_0x9f31('0x17')]);return _0x3c740d(_0x5b5d60[_0x9f31('0x16')][_0x9f31('0x17')]);}logger[_0x9f31('0x16')](_0x9f31('0x14'),_0x19b5f6,_0x5b5d60[_0x9f31('0x16')]['message']);return _0x69d5ea(_0x5b5d60['error'][_0x9f31('0x17')]);}else{logger[_0x9f31('0x18')](_0x9f31('0x14'),_0x19b5f6,'request\x20sent');_0x69d5ea(_0x5b5d60['result'][_0x9f31('0x17')]);}})[_0x9f31('0x19')](function(_0x227412){logger[_0x9f31('0x16')](_0x9f31('0x14'),_0x19b5f6,_0x227412);_0x3c740d(_0x227412);});});}exports[_0x9f31('0x1a')]=function(_0x5ae6e2){var _0x22676a=this;return new Promise(function(_0x33cf99,_0x1325ac){return db[_0x9f31('0x1b')][_0x9f31('0x1c')]({'raw':_0x5ae6e2[_0x9f31('0x1d')]?_0x5ae6e2[_0x9f31('0x1d')][_0x9f31('0x1e')]===undefined?!![]:![]:!![],'where':_0x5ae6e2['options']?_0x5ae6e2[_0x9f31('0x1d')][_0x9f31('0x1f')]||null:null,'attributes':[[db[_0x9f31('0x20')]['fn'](_0x9f31('0x21'),db[_0x9f31('0x20')]['fn']('IF',db[_0x9f31('0x20')][_0x9f31('0x22')]('`paused`\x20=\x201,\x201,\x20null'))),_0x9f31('0x23')]]})[_0x9f31('0x13')](function(_0x2ba35f){logger['info'](_0x9f31('0x1a'),_0x5ae6e2);logger[_0x9f31('0x24')](_0x9f31('0x1a'),_0x5ae6e2,JSON[_0x9f31('0x15')](_0x2ba35f));_0x33cf99(_0x2ba35f);})[_0x9f31('0x19')](function(_0x15671a){logger[_0x9f31('0x16')]('GetVoiceQueueRtPauses',_0x15671a[_0x9f31('0x17')],_0x5ae6e2);_0x1325ac(_0x22676a['error'](0x1f4,_0x15671a[_0x9f31('0x17')]));});});};
\ No newline at end of file
+var _0x39c6=['`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./userVoiceQueueRt.socket','register','request','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','literal'];(function(_0x5c0979,_0x287854){var _0x309972=function(_0x17defd){while(--_0x17defd){_0x5c0979['push'](_0x5c0979['shift']());}};_0x309972(++_0x287854);}(_0x39c6,0x18f));var _0x639c=function(_0x3e57cd,_0x1a5e5c){_0x3e57cd=_0x3e57cd-0x0;var _0x6758c4=_0x39c6[_0x3e57cd];return _0x6758c4;};'use strict';var _=require(_0x639c('0x0'));var util=require(_0x639c('0x1'));var moment=require(_0x639c('0x2'));var BPromise=require(_0x639c('0x3'));var rs=require(_0x639c('0x4'));var fs=require('fs');var Redis=require(_0x639c('0x5'));var db=require(_0x639c('0x6'))['db'];var utils=require(_0x639c('0x7'));var logger=require(_0x639c('0x8'))(_0x639c('0x9'));var config=require(_0x639c('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x639c('0xb')][_0x639c('0xc')]({'port':0x232a});config[_0x639c('0xd')]=_['defaults'](config['redis'],{'host':_0x639c('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x639c('0xd')]));require(_0x639c('0xf'))[_0x639c('0x10')](socket);function respondWithRpcPromise(_0x14909a,_0x5321c1,_0x4f1627){return new BPromise(function(_0x2d70ec,_0x5795ba){return client[_0x639c('0x11')](_0x14909a,_0x4f1627)['then'](function(_0x41d848){logger['info'](_0x639c('0x12'),_0x5321c1,'request\x20sent');logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x5321c1,_0x639c('0x13'),JSON[_0x639c('0x14')](_0x41d848));if(_0x41d848[_0x639c('0x15')]){if(_0x41d848[_0x639c('0x15')]['code']===0x1f4){logger[_0x639c('0x15')](_0x639c('0x12'),_0x5321c1,_0x41d848[_0x639c('0x15')]['message']);return _0x5795ba(_0x41d848[_0x639c('0x15')][_0x639c('0x16')]);}logger[_0x639c('0x15')](_0x639c('0x12'),_0x5321c1,_0x41d848[_0x639c('0x15')][_0x639c('0x16')]);return _0x2d70ec(_0x41d848[_0x639c('0x15')][_0x639c('0x16')]);}else{logger[_0x639c('0x17')](_0x639c('0x12'),_0x5321c1,_0x639c('0x13'));_0x2d70ec(_0x41d848[_0x639c('0x18')][_0x639c('0x16')]);}})[_0x639c('0x19')](function(_0x5f523a){logger['error'](_0x639c('0x12'),_0x5321c1,_0x5f523a);_0x5795ba(_0x5f523a);});});}exports[_0x639c('0x1a')]=function(_0x4f1ce0){var _0x466129=this;return new Promise(function(_0x4b567f,_0x30505a){return db[_0x639c('0x1b')][_0x639c('0x1c')]({'raw':_0x4f1ce0[_0x639c('0x1d')]?_0x4f1ce0[_0x639c('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x4f1ce0[_0x639c('0x1d')]?_0x4f1ce0[_0x639c('0x1d')][_0x639c('0x1e')]||null:null,'attributes':[[db[_0x639c('0x1f')]['fn']('COUNT',db[_0x639c('0x1f')]['fn']('IF',db[_0x639c('0x1f')][_0x639c('0x20')](_0x639c('0x21')))),_0x639c('0x22')]]})['then'](function(_0x12c74c){logger['info'](_0x639c('0x1a'),_0x4f1ce0);logger[_0x639c('0x23')](_0x639c('0x1a'),_0x4f1ce0,JSON[_0x639c('0x14')](_0x12c74c));_0x4b567f(_0x12c74c);})[_0x639c('0x19')](function(_0x43b8f9){logger[_0x639c('0x15')](_0x639c('0x1a'),_0x43b8f9[_0x639c('0x16')],_0x4f1ce0);_0x30505a(_0x466129[_0x639c('0x15')](0x1f4,_0x43b8f9[_0x639c('0x16')]));});});};
\ No newline at end of file
index 5e4c286..e487320 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe548=['removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','update'];(function(_0x3752e4,_0x135b91){var _0xe9702a=function(_0x3df84f){while(--_0x3df84f){_0x3752e4['push'](_0x3752e4['shift']());}};_0xe9702a(++_0x135b91);}(_0xe548,0x184));var _0x8e54=function(_0x3fb166,_0x4eb985){_0x3fb166=_0x3fb166-0x0;var _0x5e91be=_0xe548[_0x3fb166];return _0x5e91be;};'use strict';var UserVoiceQueueRtEvents=require(_0x8e54('0x0'));var events=[_0x8e54('0x1'),_0x8e54('0x2'),_0x8e54('0x3')];function createListener(_0x8824f6,_0x48a491){return function(_0x5d61b0){_0x48a491['emit'](_0x8824f6,_0x5d61b0);};}function removeListener(_0x4aa36a,_0x4b69ef){return function(){UserVoiceQueueRtEvents[_0x8e54('0x4')](_0x4aa36a,_0x4b69ef);};}exports['register']=function(_0x288be8){for(var _0x47a58d=0x0,_0xc6281c=events[_0x8e54('0x5')];_0x47a58d<_0xc6281c;_0x47a58d++){var _0x148c1f=events[_0x47a58d];var _0x3d6444=createListener(_0x8e54('0x6')+_0x148c1f,_0x288be8);UserVoiceQueueRtEvents['on'](_0x148c1f,_0x3d6444);}};
\ No newline at end of file
+var _0x46cb=['removeListener','register','length','userVoiceQueueRt:','update','emit'];(function(_0x502e1a,_0x23e7a6){var _0x5bbbcf=function(_0x5a1407){while(--_0x5a1407){_0x502e1a['push'](_0x502e1a['shift']());}};_0x5bbbcf(++_0x23e7a6);}(_0x46cb,0xd6));var _0xb46c=function(_0x36f3df,_0x2b1621){_0x36f3df=_0x36f3df-0x0;var _0xcfb7b7=_0x46cb[_0x36f3df];return _0xcfb7b7;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=['save','remove',_0xb46c('0x0')];function createListener(_0x2a55a0,_0x4395ee){return function(_0x33aaa0){_0x4395ee[_0xb46c('0x1')](_0x2a55a0,_0x33aaa0);};}function removeListener(_0x2aab0a,_0x2a6e97){return function(){UserVoiceQueueRtEvents[_0xb46c('0x2')](_0x2aab0a,_0x2a6e97);};}exports[_0xb46c('0x3')]=function(_0xf4f306){for(var _0x2e3704=0x0,_0x4603b8=events[_0xb46c('0x4')];_0x2e3704<_0x4603b8;_0x2e3704++){var _0x2771fe=events[_0x2e3704];var _0x5dfe97=createListener(_0xb46c('0x5')+_0x2771fe,_0xf4f306);UserVoiceQueueRtEvents['on'](_0x2771fe,_0x5dfe97);}};
\ No newline at end of file
index bb870e2..748701c 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(_0x4a90b1,_0x42d5db){var _0x17629a=function(_0x463c9f){while(--_0x463c9f){_0x4a90b1['push'](_0x4a90b1['shift']());}};_0x17629a(++_0x42d5db);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2fd69d,_0xeb1037){_0x2fd69d=_0x2fd69d-0x0;var _0x5d5ef3=_0xcb91[_0x2fd69d];return _0x5d5ef3;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1bc635,_0x4a1b08){var _0x1179e0=function(_0x48b2ed){while(--_0x48b2ed){_0x1bc635['push'](_0x1bc635['shift']());}};_0x1179e0(++_0x4a1b08);}(_0x9c44,0x178));var _0x49c4=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0x9c44[_0x1caf6a];return _0x1bf493;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router;
\ No newline at end of file
index 64ac177..194ec3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x50a9=['INTEGER','sequelize'];(function(_0x473914,_0x4565aa){var _0x43d95d=function(_0xdc1bd3){while(--_0xdc1bd3){_0x473914['push'](_0x473914['shift']());}};_0x43d95d(++_0x4565aa);}(_0x50a9,0x1d9));var _0x950a=function(_0x28f42d,_0x306db7){_0x28f42d=_0x28f42d-0x0;var _0x578610=_0x50a9[_0x28f42d];return _0x578610;};'use strict';var Sequelize=require(_0x950a('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x950a('0x1')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xe3ad=['exports','INTEGER','sequelize'];(function(_0x5d6c3e,_0x409a3e){var _0x44ecb7=function(_0x936b6a){while(--_0x936b6a){_0x5d6c3e['push'](_0x5d6c3e['shift']());}};_0x44ecb7(++_0x409a3e);}(_0xe3ad,0x77));var _0xde3a=function(_0x4f0b07,_0x7cfb26){_0x4f0b07=_0x4f0b07-0x0;var _0x21e8bf=_0xe3ad[_0x4f0b07];return _0x21e8bf;};'use strict';var Sequelize=require(_0xde3a('0x0'));module[_0xde3a('0x1')]={'penalty':{'type':Sequelize[_0xde3a('0x2')],'defaultValue':0x0}};
\ No newline at end of file
index d101457..d89da53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9867=['../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','util','../../config/logger','api','request-promise','path'];(function(_0x1e75d,_0x2f948f){var _0x384205=function(_0x4438e5){while(--_0x4438e5){_0x1e75d['push'](_0x1e75d['shift']());}};_0x384205(++_0x2f948f);}(_0x9867,0x109));var _0x7986=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x9867[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x7986('0x0'));var logger=require(_0x7986('0x1'))(_0x7986('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7986('0x3'));var fs=require('fs');var path=require(_0x7986('0x4'));var rimraf=require('rimraf');var config=require(_0x7986('0x5'));var attributes=require(_0x7986('0x6'));module[_0x7986('0x7')]=function(_0x21ee06,_0x372f55){return _0x21ee06[_0x7986('0x8')](_0x7986('0x9'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa6f8=['path','rimraf','../../config/environment','./userWhatsappQueue.attributes','define','user_has_whatsapp_queues','lodash','util','moment','bluebird','request-promise'];(function(_0x2769d2,_0x25f8f2){var _0x4396bc=function(_0x337c78){while(--_0x337c78){_0x2769d2['push'](_0x2769d2['shift']());}};_0x4396bc(++_0x25f8f2);}(_0xa6f8,0x95));var _0x8a6f=function(_0x2706db,_0x2c03f6){_0x2706db=_0x2706db-0x0;var _0x19939b=_0xa6f8[_0x2706db];return _0x19939b;};'use strict';var _=require(_0x8a6f('0x0'));var util=require(_0x8a6f('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x8a6f('0x2'));var BPromise=require(_0x8a6f('0x3'));var rp=require(_0x8a6f('0x4'));var fs=require('fs');var path=require(_0x8a6f('0x5'));var rimraf=require(_0x8a6f('0x6'));var config=require(_0x8a6f('0x7'));var attributes=require(_0x8a6f('0x8'));module['exports']=function(_0x1ae375,_0x1dbb51){return _0x1ae375[_0x8a6f('0x9')]('UserWhatsappQueue',attributes,{'tableName':_0x8a6f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 0d32d24..c8f7280 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1df8=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','error','code','message','UserWhatsappQueue,\x20%s,\x20%s','result','catch'];(function(_0x174e2f,_0x59e52b){var _0x4691ab=function(_0x1382f5){while(--_0x1382f5){_0x174e2f['push'](_0x174e2f['shift']());}};_0x4691ab(++_0x59e52b);}(_0x1df8,0x1a4));var _0x81df=function(_0x23d694,_0xb21f8f){_0x23d694=_0x23d694-0x0;var _0x4e4389=_0x1df8[_0x23d694];return _0x4e4389;};'use strict';var _=require('lodash');var util=require(_0x81df('0x0'));var moment=require(_0x81df('0x1'));var BPromise=require(_0x81df('0x2'));var rs=require(_0x81df('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x81df('0x4'))['db'];var utils=require(_0x81df('0x5'));var logger=require('../../config/logger')(_0x81df('0x6'));var config=require(_0x81df('0x7'));var jayson=require(_0x81df('0x8'));var client=jayson['client'][_0x81df('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b7de0,_0x416b01,_0x406656){return new BPromise(function(_0x66d748,_0x2f5f93){return client['request'](_0x2b7de0,_0x406656)[_0x81df('0xa')](function(_0x5f077b){logger[_0x81df('0xb')]('UserWhatsappQueue,\x20%s,\x20%s',_0x416b01,_0x81df('0xc'));logger[_0x81df('0xd')]('UserWhatsappQueue,\x20%s,\x20%s,\x20%s',_0x416b01,_0x81df('0xc'),JSON['stringify'](_0x5f077b));if(_0x5f077b[_0x81df('0xe')]){if(_0x5f077b[_0x81df('0xe')][_0x81df('0xf')]===0x1f4){logger['error']('UserWhatsappQueue,\x20%s,\x20%s',_0x416b01,_0x5f077b[_0x81df('0xe')][_0x81df('0x10')]);return _0x2f5f93(_0x5f077b[_0x81df('0xe')][_0x81df('0x10')]);}logger[_0x81df('0xe')](_0x81df('0x11'),_0x416b01,_0x5f077b['error']['message']);return _0x66d748(_0x5f077b[_0x81df('0xe')]['message']);}else{logger[_0x81df('0xb')](_0x81df('0x11'),_0x416b01,_0x81df('0xc'));_0x66d748(_0x5f077b[_0x81df('0x12')][_0x81df('0x10')]);}})[_0x81df('0x13')](function(_0x2caf55){logger[_0x81df('0xe')](_0x81df('0x11'),_0x416b01,_0x2caf55);_0x2f5f93(_0x2caf55);});});}
\ No newline at end of file
+var _0x17bb=['debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','request','then','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x459ad9,_0x4c80ed){var _0x466e64=function(_0x39f227){while(--_0x39f227){_0x459ad9['push'](_0x459ad9['shift']());}};_0x466e64(++_0x4c80ed);}(_0x17bb,0x15c));var _0xb17b=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x17bb[_0xfae23b];return _0x200640;};'use strict';var _=require(_0xb17b('0x0'));var util=require(_0xb17b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb17b('0x2'));var fs=require('fs');var Redis=require(_0xb17b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb17b('0x4'));var logger=require('../../config/logger')(_0xb17b('0x5'));var config=require('../../config/environment');var jayson=require(_0xb17b('0x6'));var client=jayson[_0xb17b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41ceac,_0x25fa72,_0x535c8d){return new BPromise(function(_0x4ed788,_0x4cc6e4){return client[_0xb17b('0x8')](_0x41ceac,_0x535c8d)[_0xb17b('0x9')](function(_0x279b6e){logger['info'](_0xb17b('0xa'),_0x25fa72,_0xb17b('0xb'));logger[_0xb17b('0xc')](_0xb17b('0xd'),_0x25fa72,_0xb17b('0xb'),JSON[_0xb17b('0xe')](_0x279b6e));if(_0x279b6e['error']){if(_0x279b6e[_0xb17b('0xf')][_0xb17b('0x10')]===0x1f4){logger['error'](_0xb17b('0xa'),_0x25fa72,_0x279b6e[_0xb17b('0xf')][_0xb17b('0x11')]);return _0x4cc6e4(_0x279b6e[_0xb17b('0xf')]['message']);}logger[_0xb17b('0xf')](_0xb17b('0xa'),_0x25fa72,_0x279b6e[_0xb17b('0xf')][_0xb17b('0x11')]);return _0x4ed788(_0x279b6e[_0xb17b('0xf')][_0xb17b('0x11')]);}else{logger[_0xb17b('0x12')](_0xb17b('0xa'),_0x25fa72,'request\x20sent');_0x4ed788(_0x279b6e['result'][_0xb17b('0x11')]);}})[_0xb17b('0x13')](function(_0x5d6e8b){logger[_0xb17b('0xf')](_0xb17b('0xa'),_0x25fa72,_0x5d6e8b);_0x4cc6e4(_0x5d6e8b);});});}
\ No newline at end of file
index 1dcc6e7..c92d86a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb4e6=['express','Router','../../components/auth/service','../../config/environment','./variable.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x38a6d4,_0x47cc89){var _0x4f9747=function(_0x24b1e4){while(--_0x24b1e4){_0x38a6d4['push'](_0x38a6d4['shift']());}};_0x4f9747(++_0x47cc89);}(_0xb4e6,0xd8));var _0x6b4e=function(_0x38ce4c,_0xfdbe8c){_0x38ce4c=_0x38ce4c-0x0;var _0x5d4544=_0xb4e6[_0x38ce4c];return _0x5d4544;};'use strict';var multer=require(_0x6b4e('0x0'));var util=require(_0x6b4e('0x1'));var path=require(_0x6b4e('0x2'));var timeout=require(_0x6b4e('0x3'));var express=require(_0x6b4e('0x4'));var router=express[_0x6b4e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6b4e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6b4e('0x7'));var controller=require(_0x6b4e('0x8'));router[_0x6b4e('0x9')]('/',auth[_0x6b4e('0xa')](),controller['index']);router[_0x6b4e('0x9')](_0x6b4e('0xb'),auth[_0x6b4e('0xa')](),controller[_0x6b4e('0xc')]);router[_0x6b4e('0xd')]('/',auth[_0x6b4e('0xa')](),controller[_0x6b4e('0xe')]);router[_0x6b4e('0xf')](_0x6b4e('0xb'),auth[_0x6b4e('0xa')](),controller[_0x6b4e('0x10')]);router[_0x6b4e('0x11')](_0x6b4e('0xb'),auth[_0x6b4e('0xa')](),controller[_0x6b4e('0x12')]);module[_0x6b4e('0x13')]=router;
\ No newline at end of file
+var _0xa8eb=['get','index','/:id','isAuthenticated','create','put','update','delete','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x4eebcb,_0x242ec7){var _0x4da276=function(_0x3cddfc){while(--_0x3cddfc){_0x4eebcb['push'](_0x4eebcb['shift']());}};_0x4da276(++_0x242ec7);}(_0xa8eb,0x179));var _0xba8e=function(_0x54808c,_0x36e290){_0x54808c=_0x54808c-0x0;var _0xe9459=_0xa8eb[_0x54808c];return _0xe9459;};'use strict';var multer=require(_0xba8e('0x0'));var util=require('util');var path=require(_0xba8e('0x1'));var timeout=require('connect-timeout');var express=require(_0xba8e('0x2'));var router=express[_0xba8e('0x3')]();var fs_extra=require(_0xba8e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xba8e('0x5'));var config=require(_0xba8e('0x6'));var controller=require('./variable.controller');router[_0xba8e('0x7')]('/',auth['isAuthenticated'](),controller[_0xba8e('0x8')]);router['get'](_0xba8e('0x9'),auth[_0xba8e('0xa')](),controller['show']);router['post']('/',auth[_0xba8e('0xa')](),controller[_0xba8e('0xb')]);router[_0xba8e('0xc')](_0xba8e('0x9'),auth[_0xba8e('0xa')](),controller[_0xba8e('0xd')]);router[_0xba8e('0xe')](_0xba8e('0x9'),auth[_0xba8e('0xa')](),controller['destroy']);module[_0xba8e('0xf')]=router;
\ No newline at end of file
index ef82aea..c2ad356 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbeb0=['exports','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbeb0,0x15b));var _0x0beb=function(_0x58c92c,_0x131654){_0x58c92c=_0x58c92c-0x0;var _0x37ac3a=_0xbeb0[_0x58c92c];return _0x37ac3a;};'use strict';var Sequelize=require(_0x0beb('0x0'));module[_0x0beb('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x8375=['exports','STRING','name'];(function(_0x50b3a7,_0xf122c7){var _0x2c4f0b=function(_0x13a056){while(--_0x13a056){_0x50b3a7['push'](_0x50b3a7['shift']());}};_0x2c4f0b(++_0xf122c7);}(_0x8375,0x132));var _0x5837=function(_0x43b365,_0x2afa92){_0x43b365=_0x43b365-0x0;var _0x1a57b4=_0x8375[_0x43b365];return _0x1a57b4;};'use strict';var Sequelize=require('sequelize');module[_0x5837('0x0')]={'name':{'type':Sequelize[_0x5837('0x1')],'unique':_0x5837('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x5837('0x1')]}};
\ No newline at end of file
index d22cc90..6c2ce3d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd1dd=['fields','length','order','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','get','then','sendStatus','error','name','send','index','Variable','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes'];(function(_0x5aedf7,_0x2d61a8){var _0x430fc0=function(_0x3a923f){while(--_0x3a923f){_0x5aedf7['push'](_0x5aedf7['shift']());}};_0x430fc0(++_0x2d61a8);}(_0xd1dd,0x1ad));var _0xdd1d=function(_0x3fd72c,_0x57a552){_0x3fd72c=_0x3fd72c-0x0;var _0x3f1692=_0xd1dd[_0x3fd72c];return _0x3f1692;};'use strict';var emlformat=require(_0xdd1d('0x0'));var rimraf=require(_0xdd1d('0x1'));var zipdir=require(_0xdd1d('0x2'));var jsonpatch=require(_0xdd1d('0x3'));var rp=require(_0xdd1d('0x4'));var moment=require('moment');var BPromise=require(_0xdd1d('0x5'));var Mustache=require(_0xdd1d('0x6'));var util=require('util');var path=require(_0xdd1d('0x7'));var sox=require('sox');var csv=require(_0xdd1d('0x8'));var ejs=require(_0xdd1d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdd1d('0xa'));var squel=require(_0xdd1d('0xb'));var crypto=require('crypto');var jsforce=require(_0xdd1d('0xc'));var deskjs=require(_0xdd1d('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdd1d('0xe'));var Papa=require(_0xdd1d('0xf'));var Redis=require(_0xdd1d('0x10'));var authService=require(_0xdd1d('0x11'));var qs=require(_0xdd1d('0x12'));var as=require(_0xdd1d('0x13'));var hardwareService=require(_0xdd1d('0x14'));var logger=require('../../config/logger')(_0xdd1d('0x15'));var utils=require(_0xdd1d('0x16'));var config=require(_0xdd1d('0x17'));var licenseUtil=require(_0xdd1d('0x18'));var db=require(_0xdd1d('0x19'))['db'];function respondWithStatusCode(_0xd879fc,_0x582d0d){_0x582d0d=_0x582d0d||0xcc;return function(_0x3437d2){if(_0x3437d2){return _0xd879fc['sendStatus'](_0x582d0d);}return _0xd879fc['status'](_0x582d0d)[_0xdd1d('0x1a')]();};}function respondWithResult(_0x561e0f,_0x450a5e){_0x450a5e=_0x450a5e||0xc8;return function(_0x1c0b0d){if(_0x1c0b0d){return _0x561e0f[_0xdd1d('0x1b')](_0x450a5e)[_0xdd1d('0x1c')](_0x1c0b0d);}};}function respondWithFilteredResult(_0x20d73f,_0x38ed62){return function(_0x5021ee){if(_0x5021ee){var _0xb68547=typeof _0x38ed62[_0xdd1d('0x1d')]===_0xdd1d('0x1e')&&typeof _0x38ed62[_0xdd1d('0x1f')]===_0xdd1d('0x1e');var _0x4a4965=_0x5021ee[_0xdd1d('0x20')];var _0x355290=_0xb68547?0x0:_0x38ed62[_0xdd1d('0x1d')];var _0x40c3af=_0xb68547?_0x5021ee[_0xdd1d('0x20')]:_0x38ed62[_0xdd1d('0x1d')]+_0x38ed62[_0xdd1d('0x1f')];var _0x191da9;if(_0x40c3af>=_0x4a4965){_0x40c3af=_0x4a4965;_0x191da9=0xc8;}else{_0x191da9=0xce;}_0x20d73f[_0xdd1d('0x1b')](_0x191da9);return _0x20d73f[_0xdd1d('0x21')]('Content-Range',_0x355290+'-'+_0x40c3af+'/'+_0x4a4965)[_0xdd1d('0x1c')](_0x5021ee);}return null;};}function patchUpdates(_0x583c8c){return function(_0x218b39){try{jsonpatch[_0xdd1d('0x22')](_0x218b39,_0x583c8c,!![]);}catch(_0xf6ee8a){return BPromise[_0xdd1d('0x23')](_0xf6ee8a);}return _0x218b39[_0xdd1d('0x24')]();};}function saveUpdates(_0x425dcf,_0x450545){return function(_0x29c06e){if(_0x29c06e){return _0x29c06e[_0xdd1d('0x25')](_0x425dcf)['then'](function(_0x52aa1c){return _0x52aa1c;});}return null;};}function removeEntity(_0x4e84ba,_0x4866f6){return function(_0x554d89){if(_0x554d89){return _0x554d89[_0xdd1d('0x26')]()['then'](function(){var _0x421e3e=_0x554d89[_0xdd1d('0x27')]({'plain':!![]});var _0x4d3ebb='Variables';return db['UserProfileResource'][_0xdd1d('0x26')]({'where':{'type':_0x4d3ebb,'resourceId':_0x421e3e['id']}})['then'](function(){return _0x554d89;});})[_0xdd1d('0x28')](function(){_0x4e84ba['status'](0xcc)[_0xdd1d('0x1a')]();});}};}function handleEntityNotFound(_0x3f9de5,_0x2f2f0d){return function(_0x52ebf4){if(!_0x52ebf4){_0x3f9de5[_0xdd1d('0x29')](0x194);}return _0x52ebf4;};}function handleError(_0x5ba010,_0x4516e1){_0x4516e1=_0x4516e1||0x1f4;return function(_0xed7c69){logger[_0xdd1d('0x2a')](_0xed7c69['stack']);if(_0xed7c69[_0xdd1d('0x2b')]){delete _0xed7c69[_0xdd1d('0x2b')];}_0x5ba010['status'](_0x4516e1)[_0xdd1d('0x2c')](_0xed7c69);};}exports[_0xdd1d('0x2d')]=function(_0x56340b,_0x3848fc){var _0x1107a4={},_0x33ea1f={},_0x194771={'count':0x0,'rows':[]};var _0xb230f9=_['map'](db[_0xdd1d('0x2e')][_0xdd1d('0x2f')],function(_0x56b88a){return{'name':_0x56b88a[_0xdd1d('0x30')],'type':_0x56b88a[_0xdd1d('0x31')][_0xdd1d('0x32')]};});_0x33ea1f[_0xdd1d('0x33')]=_[_0xdd1d('0x34')](_0xb230f9,_0xdd1d('0x2b'));_0x33ea1f[_0xdd1d('0x35')]=_['keys'](_0x56340b[_0xdd1d('0x35')]);_0x33ea1f[_0xdd1d('0x36')]=_[_0xdd1d('0x37')](_0x33ea1f[_0xdd1d('0x33')],_0x33ea1f[_0xdd1d('0x35')]);_0x1107a4[_0xdd1d('0x38')]=_[_0xdd1d('0x37')](_0x33ea1f[_0xdd1d('0x33')],qs[_0xdd1d('0x39')](_0x56340b[_0xdd1d('0x35')]['fields']));_0x1107a4[_0xdd1d('0x38')]=_0x1107a4[_0xdd1d('0x38')][_0xdd1d('0x3a')]?_0x1107a4[_0xdd1d('0x38')]:_0x33ea1f[_0xdd1d('0x33')];if(!_0x56340b['query']['hasOwnProperty']('nolimit')){_0x1107a4[_0xdd1d('0x1f')]=qs[_0xdd1d('0x1f')](_0x56340b[_0xdd1d('0x35')][_0xdd1d('0x1f')]);_0x1107a4[_0xdd1d('0x1d')]=qs[_0xdd1d('0x1d')](_0x56340b[_0xdd1d('0x35')][_0xdd1d('0x1d')]);}_0x1107a4[_0xdd1d('0x3b')]=qs['sort'](_0x56340b[_0xdd1d('0x35')]['sort']);_0x1107a4[_0xdd1d('0x3c')]=qs[_0xdd1d('0x36')](_[_0xdd1d('0x3d')](_0x56340b['query'],_0x33ea1f[_0xdd1d('0x36')]),_0xb230f9);if(_0x56340b[_0xdd1d('0x35')][_0xdd1d('0x3e')]){_0x1107a4['where']=_['merge'](_0x1107a4[_0xdd1d('0x3c')],{'$or':_[_0xdd1d('0x34')](_0xb230f9,function(_0x4ac998){if(_0x4ac998[_0xdd1d('0x31')]!==_0xdd1d('0x3f')){var _0x313c29={};_0x313c29[_0x4ac998['name']]={'$like':'%'+_0x56340b[_0xdd1d('0x35')][_0xdd1d('0x3e')]+'%'};return _0x313c29;}})});}_0x1107a4=_[_0xdd1d('0x40')]({},_0x1107a4,_0x56340b[_0xdd1d('0x41')]);var _0xc8eb9c={'where':_0x1107a4[_0xdd1d('0x3c')]};return db[_0xdd1d('0x2e')][_0xdd1d('0x20')](_0xc8eb9c)['then'](function(_0x2fd576){_0x194771[_0xdd1d('0x20')]=_0x2fd576;if(_0x56340b[_0xdd1d('0x35')][_0xdd1d('0x42')]){_0x1107a4[_0xdd1d('0x43')]=[{'all':!![]}];}return db[_0xdd1d('0x2e')][_0xdd1d('0x44')](_0x1107a4);})[_0xdd1d('0x28')](function(_0x13ed62){_0x194771[_0xdd1d('0x45')]=_0x13ed62;return _0x194771;})['then'](respondWithFilteredResult(_0x3848fc,_0x1107a4))[_0xdd1d('0x46')](handleError(_0x3848fc,null));};exports[_0xdd1d('0x47')]=function(_0x1c0913,_0x46d0db){var _0x6fa873={'raw':!![],'where':{'id':_0x1c0913[_0xdd1d('0x48')]['id']}},_0x52ab48={};_0x52ab48[_0xdd1d('0x33')]=_[_0xdd1d('0x49')](db[_0xdd1d('0x2e')][_0xdd1d('0x2f')]);_0x52ab48[_0xdd1d('0x35')]=_[_0xdd1d('0x49')](_0x1c0913['query']);_0x52ab48[_0xdd1d('0x36')]=_[_0xdd1d('0x37')](_0x52ab48[_0xdd1d('0x33')],_0x52ab48[_0xdd1d('0x35')]);_0x6fa873[_0xdd1d('0x38')]=_['intersection'](_0x52ab48[_0xdd1d('0x33')],qs['fields'](_0x1c0913[_0xdd1d('0x35')][_0xdd1d('0x39')]));_0x6fa873[_0xdd1d('0x38')]=_0x6fa873[_0xdd1d('0x38')]['length']?_0x6fa873['attributes']:_0x52ab48[_0xdd1d('0x33')];if(_0x1c0913['query'][_0xdd1d('0x42')]){_0x6fa873['include']=[{'all':!![]}];}_0x6fa873=_['merge']({},_0x6fa873,_0x1c0913['options']);return db[_0xdd1d('0x2e')][_0xdd1d('0x4a')](_0x6fa873)[_0xdd1d('0x28')](handleEntityNotFound(_0x46d0db,null))[_0xdd1d('0x28')](respondWithResult(_0x46d0db,null))[_0xdd1d('0x46')](handleError(_0x46d0db,null));};exports[_0xdd1d('0x4b')]=function(_0xca5ea6,_0x2aced5){return db[_0xdd1d('0x2e')][_0xdd1d('0x4b')](_0xca5ea6[_0xdd1d('0x4c')],{})[_0xdd1d('0x28')](function(_0xee2b42){var _0x10154c=_0xca5ea6[_0xdd1d('0x4d')][_0xdd1d('0x27')]({'plain':!![]});if(!_0x10154c)throw new Error(_0xdd1d('0x4e'));if(_0x10154c['role']===_0xdd1d('0x4d')){var _0x1142d9=_0xee2b42['get']({'plain':!![]});var _0xbabf09='Variables';return db['UserProfileSection'][_0xdd1d('0x4a')]({'where':{'name':_0xbabf09,'userProfileId':_0x10154c['userProfileId']},'raw':!![]})[_0xdd1d('0x28')](function(_0x127861){if(_0x127861&&_0x127861[_0xdd1d('0x4f')]===0x0){return db['UserProfileResource'][_0xdd1d('0x4b')]({'name':_0x1142d9[_0xdd1d('0x2b')],'resourceId':_0x1142d9['id'],'type':_0x127861[_0xdd1d('0x2b')],'sectionId':_0x127861['id']},{})[_0xdd1d('0x28')](function(){return _0xee2b42;});}else{return _0xee2b42;}})[_0xdd1d('0x46')](function(_0x46d8a7){logger[_0xdd1d('0x2a')](_0xdd1d('0x50'),_0x46d8a7);throw _0x46d8a7;});}return _0xee2b42;})['then'](respondWithResult(_0x2aced5,0xc9))[_0xdd1d('0x46')](handleError(_0x2aced5,null));};exports[_0xdd1d('0x25')]=function(_0x456253,_0x2e9daf){if(_0x456253['body']['id']){delete _0x456253['body']['id'];}return db[_0xdd1d('0x2e')][_0xdd1d('0x4a')]({'where':{'id':_0x456253['params']['id']}})[_0xdd1d('0x28')](handleEntityNotFound(_0x2e9daf,null))['then'](saveUpdates(_0x456253[_0xdd1d('0x4c')],null))[_0xdd1d('0x28')](respondWithResult(_0x2e9daf,null))[_0xdd1d('0x46')](handleError(_0x2e9daf,null));};exports['destroy']=function(_0x879418,_0x4f9d2a){return db[_0xdd1d('0x2e')][_0xdd1d('0x4a')]({'where':{'id':_0x879418[_0xdd1d('0x48')]['id']}})[_0xdd1d('0x28')](handleEntityNotFound(_0x4f9d2a,null))[_0xdd1d('0x28')](removeEntity(_0x4f9d2a,null))[_0xdd1d('0x46')](handleError(_0x4f9d2a,null));};
\ No newline at end of file
+var _0xfa62=['keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','findAll','rows','show','include','find','catch','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','Variables','UserProfileResource','then','error','stack','name','send','index','map','Variable','fieldName','type','key','model','query'];(function(_0xedd921,_0x1c9b59){var _0x34fc72=function(_0x442f8a){while(--_0x442f8a){_0xedd921['push'](_0xedd921['shift']());}};_0x34fc72(++_0x1c9b59);}(_0xfa62,0x74));var _0x2fa6=function(_0x70dca8,_0x27c0e9){_0x70dca8=_0x70dca8-0x0;var _0x3201ff=_0xfa62[_0x70dca8];return _0x3201ff;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2fa6('0x0'));var rp=require(_0x2fa6('0x1'));var moment=require(_0x2fa6('0x2'));var BPromise=require(_0x2fa6('0x3'));var Mustache=require(_0x2fa6('0x4'));var util=require(_0x2fa6('0x5'));var path=require(_0x2fa6('0x6'));var sox=require(_0x2fa6('0x7'));var csv=require('to-csv');var ejs=require(_0x2fa6('0x8'));var fs=require('fs');var fs_extra=require(_0x2fa6('0x9'));var _=require(_0x2fa6('0xa'));var squel=require(_0x2fa6('0xb'));var crypto=require(_0x2fa6('0xc'));var jsforce=require(_0x2fa6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2fa6('0xe'));var querystring=require(_0x2fa6('0xf'));var Papa=require(_0x2fa6('0x10'));var Redis=require(_0x2fa6('0x11'));var authService=require(_0x2fa6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2fa6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2fa6('0x14'));var utils=require('../../config/utils');var config=require(_0x2fa6('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d2aeb,_0x7bea16){_0x7bea16=_0x7bea16||0xcc;return function(_0x25ad65){if(_0x25ad65){return _0x3d2aeb[_0x2fa6('0x16')](_0x7bea16);}return _0x3d2aeb[_0x2fa6('0x17')](_0x7bea16)[_0x2fa6('0x18')]();};}function respondWithResult(_0x4db105,_0x4d811c){_0x4d811c=_0x4d811c||0xc8;return function(_0x1e6347){if(_0x1e6347){return _0x4db105[_0x2fa6('0x17')](_0x4d811c)[_0x2fa6('0x19')](_0x1e6347);}};}function respondWithFilteredResult(_0x20c1fc,_0x370134){return function(_0xcdd17f){if(_0xcdd17f){var _0x26d3dd=typeof _0x370134[_0x2fa6('0x1a')]===_0x2fa6('0x1b')&&typeof _0x370134[_0x2fa6('0x1c')]===_0x2fa6('0x1b');var _0x4ecf4e=_0xcdd17f[_0x2fa6('0x1d')];var _0x207025=_0x26d3dd?0x0:_0x370134[_0x2fa6('0x1a')];var _0x28e630=_0x26d3dd?_0xcdd17f[_0x2fa6('0x1d')]:_0x370134[_0x2fa6('0x1a')]+_0x370134[_0x2fa6('0x1c')];var _0x4cdc1d;if(_0x28e630>=_0x4ecf4e){_0x28e630=_0x4ecf4e;_0x4cdc1d=0xc8;}else{_0x4cdc1d=0xce;}_0x20c1fc[_0x2fa6('0x17')](_0x4cdc1d);return _0x20c1fc[_0x2fa6('0x1e')](_0x2fa6('0x1f'),_0x207025+'-'+_0x28e630+'/'+_0x4ecf4e)['json'](_0xcdd17f);}return null;};}function patchUpdates(_0x2071cf){return function(_0x5298da){try{jsonpatch[_0x2fa6('0x20')](_0x5298da,_0x2071cf,!![]);}catch(_0x107b09){return BPromise[_0x2fa6('0x21')](_0x107b09);}return _0x5298da[_0x2fa6('0x22')]();};}function saveUpdates(_0x1d4031,_0x1f4bc6){return function(_0x2219a6){if(_0x2219a6){return _0x2219a6[_0x2fa6('0x23')](_0x1d4031)['then'](function(_0x53e51b){return _0x53e51b;});}return null;};}function removeEntity(_0x364f73,_0x4e2aad){return function(_0x2309bf){if(_0x2309bf){return _0x2309bf[_0x2fa6('0x24')]()['then'](function(){var _0x1d2127=_0x2309bf['get']({'plain':!![]});var _0x3edc0d=_0x2fa6('0x25');return db[_0x2fa6('0x26')][_0x2fa6('0x24')]({'where':{'type':_0x3edc0d,'resourceId':_0x1d2127['id']}})[_0x2fa6('0x27')](function(){return _0x2309bf;});})[_0x2fa6('0x27')](function(){_0x364f73[_0x2fa6('0x17')](0xcc)[_0x2fa6('0x18')]();});}};}function handleEntityNotFound(_0x46655a,_0x1fcecb){return function(_0x1c6eee){if(!_0x1c6eee){_0x46655a['sendStatus'](0x194);}return _0x1c6eee;};}function handleError(_0x522638,_0x262920){_0x262920=_0x262920||0x1f4;return function(_0x35a68d){logger[_0x2fa6('0x28')](_0x35a68d[_0x2fa6('0x29')]);if(_0x35a68d[_0x2fa6('0x2a')]){delete _0x35a68d[_0x2fa6('0x2a')];}_0x522638[_0x2fa6('0x17')](_0x262920)[_0x2fa6('0x2b')](_0x35a68d);};}exports[_0x2fa6('0x2c')]=function(_0x48503e,_0x5a0486){var _0x99b2ce={},_0x46dabc={},_0x2352aa={'count':0x0,'rows':[]};var _0x17f433=_[_0x2fa6('0x2d')](db[_0x2fa6('0x2e')]['rawAttributes'],function(_0x4fa032){return{'name':_0x4fa032[_0x2fa6('0x2f')],'type':_0x4fa032[_0x2fa6('0x30')][_0x2fa6('0x31')]};});_0x46dabc[_0x2fa6('0x32')]=_['map'](_0x17f433,'name');_0x46dabc[_0x2fa6('0x33')]=_[_0x2fa6('0x34')](_0x48503e[_0x2fa6('0x33')]);_0x46dabc['filters']=_['intersection'](_0x46dabc['model'],_0x46dabc['query']);_0x99b2ce[_0x2fa6('0x35')]=_[_0x2fa6('0x36')](_0x46dabc[_0x2fa6('0x32')],qs[_0x2fa6('0x37')](_0x48503e[_0x2fa6('0x33')][_0x2fa6('0x37')]));_0x99b2ce[_0x2fa6('0x35')]=_0x99b2ce['attributes'][_0x2fa6('0x38')]?_0x99b2ce['attributes']:_0x46dabc['model'];if(!_0x48503e['query'][_0x2fa6('0x39')](_0x2fa6('0x3a'))){_0x99b2ce[_0x2fa6('0x1c')]=qs[_0x2fa6('0x1c')](_0x48503e[_0x2fa6('0x33')][_0x2fa6('0x1c')]);_0x99b2ce['offset']=qs[_0x2fa6('0x1a')](_0x48503e[_0x2fa6('0x33')][_0x2fa6('0x1a')]);}_0x99b2ce[_0x2fa6('0x3b')]=qs[_0x2fa6('0x3c')](_0x48503e[_0x2fa6('0x33')][_0x2fa6('0x3c')]);_0x99b2ce[_0x2fa6('0x3d')]=qs[_0x2fa6('0x3e')](_[_0x2fa6('0x3f')](_0x48503e[_0x2fa6('0x33')],_0x46dabc[_0x2fa6('0x3e')]),_0x17f433);if(_0x48503e[_0x2fa6('0x33')][_0x2fa6('0x40')]){_0x99b2ce['where']=_['merge'](_0x99b2ce['where'],{'$or':_['map'](_0x17f433,function(_0x41043a){if(_0x41043a[_0x2fa6('0x30')]!==_0x2fa6('0x41')){var _0x2572b5={};_0x2572b5[_0x41043a[_0x2fa6('0x2a')]]={'$like':'%'+_0x48503e['query'][_0x2fa6('0x40')]+'%'};return _0x2572b5;}})});}_0x99b2ce=_[_0x2fa6('0x42')]({},_0x99b2ce,_0x48503e[_0x2fa6('0x43')]);var _0x4ad4f8={'where':_0x99b2ce['where']};return db[_0x2fa6('0x2e')][_0x2fa6('0x1d')](_0x4ad4f8)['then'](function(_0x4b09f6){_0x2352aa[_0x2fa6('0x1d')]=_0x4b09f6;if(_0x48503e['query'][_0x2fa6('0x44')]){_0x99b2ce['include']=[{'all':!![]}];}return db[_0x2fa6('0x2e')][_0x2fa6('0x45')](_0x99b2ce);})[_0x2fa6('0x27')](function(_0x142dd7){_0x2352aa[_0x2fa6('0x46')]=_0x142dd7;return _0x2352aa;})[_0x2fa6('0x27')](respondWithFilteredResult(_0x5a0486,_0x99b2ce))['catch'](handleError(_0x5a0486,null));};exports[_0x2fa6('0x47')]=function(_0x2a2711,_0xb16b2a){var _0x1910c2={'raw':!![],'where':{'id':_0x2a2711['params']['id']}},_0xc6dae9={};_0xc6dae9[_0x2fa6('0x32')]=_['keys'](db['Variable']['rawAttributes']);_0xc6dae9[_0x2fa6('0x33')]=_[_0x2fa6('0x34')](_0x2a2711[_0x2fa6('0x33')]);_0xc6dae9[_0x2fa6('0x3e')]=_['intersection'](_0xc6dae9['model'],_0xc6dae9[_0x2fa6('0x33')]);_0x1910c2['attributes']=_['intersection'](_0xc6dae9[_0x2fa6('0x32')],qs[_0x2fa6('0x37')](_0x2a2711[_0x2fa6('0x33')]['fields']));_0x1910c2[_0x2fa6('0x35')]=_0x1910c2[_0x2fa6('0x35')][_0x2fa6('0x38')]?_0x1910c2[_0x2fa6('0x35')]:_0xc6dae9[_0x2fa6('0x32')];if(_0x2a2711[_0x2fa6('0x33')][_0x2fa6('0x44')]){_0x1910c2[_0x2fa6('0x48')]=[{'all':!![]}];}_0x1910c2=_[_0x2fa6('0x42')]({},_0x1910c2,_0x2a2711[_0x2fa6('0x43')]);return db[_0x2fa6('0x2e')][_0x2fa6('0x49')](_0x1910c2)[_0x2fa6('0x27')](handleEntityNotFound(_0xb16b2a,null))[_0x2fa6('0x27')](respondWithResult(_0xb16b2a,null))[_0x2fa6('0x4a')](handleError(_0xb16b2a,null));};exports[_0x2fa6('0x4b')]=function(_0x40222c,_0xe460fd){return db[_0x2fa6('0x2e')][_0x2fa6('0x4b')](_0x40222c['body'],{})[_0x2fa6('0x27')](function(_0x19c532){var _0x105a5b=_0x40222c['user'][_0x2fa6('0x4c')]({'plain':!![]});if(!_0x105a5b)throw new Error(_0x2fa6('0x4d'));if(_0x105a5b[_0x2fa6('0x4e')]===_0x2fa6('0x4f')){var _0x5f1538=_0x19c532[_0x2fa6('0x4c')]({'plain':!![]});var _0x2267b8=_0x2fa6('0x25');return db[_0x2fa6('0x50')]['find']({'where':{'name':_0x2267b8,'userProfileId':_0x105a5b['userProfileId']},'raw':!![]})[_0x2fa6('0x27')](function(_0x2cfcd8){if(_0x2cfcd8&&_0x2cfcd8['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x5f1538[_0x2fa6('0x2a')],'resourceId':_0x5f1538['id'],'type':_0x2cfcd8[_0x2fa6('0x2a')],'sectionId':_0x2cfcd8['id']},{})[_0x2fa6('0x27')](function(){return _0x19c532;});}else{return _0x19c532;}})['catch'](function(_0x43539f){logger[_0x2fa6('0x28')](_0x2fa6('0x51'),_0x43539f);throw _0x43539f;});}return _0x19c532;})['then'](respondWithResult(_0xe460fd,0xc9))[_0x2fa6('0x4a')](handleError(_0xe460fd,null));};exports[_0x2fa6('0x23')]=function(_0x24abad,_0x8b72c2){if(_0x24abad[_0x2fa6('0x52')]['id']){delete _0x24abad['body']['id'];}return db[_0x2fa6('0x2e')][_0x2fa6('0x49')]({'where':{'id':_0x24abad[_0x2fa6('0x53')]['id']}})[_0x2fa6('0x27')](handleEntityNotFound(_0x8b72c2,null))['then'](saveUpdates(_0x24abad[_0x2fa6('0x52')],null))['then'](respondWithResult(_0x8b72c2,null))[_0x2fa6('0x4a')](handleError(_0x8b72c2,null));};exports[_0x2fa6('0x24')]=function(_0x9bf3d3,_0x10b407){return db[_0x2fa6('0x2e')][_0x2fa6('0x49')]({'where':{'id':_0x9bf3d3[_0x2fa6('0x53')]['id']}})['then'](handleEntityNotFound(_0x10b407,null))['then'](removeEntity(_0x10b407,null))[_0x2fa6('0x4a')](handleError(_0x10b407,null));};
\ No newline at end of file
index 093bd0c..ec3a80a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51cb=['bluebird','request-promise','path','./variable.attributes','exports','define','Variable','tools_variables','lodash','util','api','moment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x51cb,0x98));var _0xb51c=function(_0x2498d7,_0x58359a){_0x2498d7=_0x2498d7-0x0;var _0xb76621=_0x51cb[_0x2498d7];return _0xb76621;};'use strict';var _=require(_0xb51c('0x0'));var util=require(_0xb51c('0x1'));var logger=require('../../config/logger')(_0xb51c('0x2'));var moment=require(_0xb51c('0x3'));var BPromise=require(_0xb51c('0x4'));var rp=require(_0xb51c('0x5'));var fs=require('fs');var path=require(_0xb51c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb51c('0x7'));module[_0xb51c('0x8')]=function(_0x3ed0d8,_0x47fdf2){return _0x3ed0d8[_0xb51c('0x9')](_0xb51c('0xa'),attributes,{'tableName':_0xb51c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xff1e=['Variable','tools_variables','util','api','bluebird','request-promise','./variable.attributes','exports','define'];(function(_0x123251,_0x12da20){var _0x27deb3=function(_0x2b6a1f){while(--_0x2b6a1f){_0x123251['push'](_0x123251['shift']());}};_0x27deb3(++_0x12da20);}(_0xff1e,0x146));var _0xeff1=function(_0x1347f8,_0x233feb){_0x1347f8=_0x1347f8-0x0;var _0x218368=_0xff1e[_0x1347f8];return _0x218368;};'use strict';var _=require('lodash');var util=require(_0xeff1('0x0'));var logger=require('../../config/logger')(_0xeff1('0x1'));var moment=require('moment');var BPromise=require(_0xeff1('0x2'));var rp=require(_0xeff1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xeff1('0x4'));module[_0xeff1('0x5')]=function(_0x1ed4cc,_0x7fa0fc){return _0x1ed4cc[_0xeff1('0x6')](_0xeff1('0x7'),attributes,{'tableName':_0xeff1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 8e49e21..1c8bda5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb9=['include','map','model','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowVariable','Variable','options','attributes'];(function(_0x5ac1e5,_0x4b5012){var _0x1bccc6=function(_0x102562){while(--_0x102562){_0x5ac1e5['push'](_0x5ac1e5['shift']());}};_0x1bccc6(++_0x4b5012);}(_0x1cb9,0x14e));var _0x91cb=function(_0x52519f,_0x5e05fc){_0x52519f=_0x52519f-0x0;var _0x39d514=_0x1cb9[_0x52519f];return _0x39d514;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Variable,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}exports[_0x91cb('0x16')]=function(_0x1cd34b){var _0xcd1a78=this;return new Promise(function(_0x5cc1c3,_0x3fba4f){return db[_0x91cb('0x17')]['find']({'raw':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')]['where']||null:null,'attributes':_0x1cd34b['options']?_0x1cd34b['options'][_0x91cb('0x19')]||null:null,'include':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')]?_['map'](_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')],function(_0x1fa837){return{'model':db[_0x1fa837['model']],'as':_0x1fa837['as'],'attributes':_0x1fa837[_0x91cb('0x19')],'include':_0x1fa837[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x1fa837[_0x91cb('0x1a')],function(_0x3ca500){return{'model':db[_0x3ca500[_0x91cb('0x1c')]],'as':_0x3ca500['as'],'attributes':_0x3ca500[_0x91cb('0x19')],'include':_0x3ca500[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x3ca500['include'],function(_0x59bf3a){return{'model':db[_0x59bf3a[_0x91cb('0x1c')]],'as':_0x59bf3a['as'],'attributes':_0x59bf3a['attributes']};}):[]};}):[]};}):[]:[]})[_0x91cb('0x1d')](function(_0x34d372){logger[_0x91cb('0xc')]('ShowVariable',_0x1cd34b);logger[_0x91cb('0xf')]('ShowVariable',_0x1cd34b,JSON[_0x91cb('0x11')](_0x34d372));_0x5cc1c3(_0x34d372);})[_0x91cb('0x15')](function(_0x3b3ee6){logger[_0x91cb('0x12')](_0x91cb('0x16'),_0x3b3ee6['message'],_0x1cd34b);_0x3fba4f(_0xcd1a78[_0x91cb('0x12')](0x1f4,_0x3b3ee6['message']));});});};
\ No newline at end of file
+var _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(_0x458abd,_0x4898e8){var _0x354a3e=function(_0x3890d9){while(--_0x3890d9){_0x458abd['push'](_0x458abd['shift']());}};_0x354a3e(++_0x4898e8);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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
index 9831232..ae0a9a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x36ce=['/reset','/pull','pull','restart','/migrations','exports','express','./version.controller','get','index','isAuthenticated','canUpdate'];(function(_0x26aaec,_0x2c5b3a){var _0x44cc7a=function(_0x107eb8){while(--_0x107eb8){_0x26aaec['push'](_0x26aaec['shift']());}};_0x44cc7a(++_0x2c5b3a);}(_0x36ce,0xae));var _0xe36c=function(_0x4b246b,_0x205a11){_0x4b246b=_0x4b246b-0x0;var _0x1baead=_0x36ce[_0x4b246b];return _0x1baead;};'use strict';var express=require(_0xe36c('0x0'));var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xe36c('0x1'));router[_0xe36c('0x2')]('/',controller[_0xe36c('0x3')]);router[_0xe36c('0x2')]('/fetch',auth[_0xe36c('0x4')](),auth[_0xe36c('0x5')](),controller['fetch']);router['get'](_0xe36c('0x6'),auth[_0xe36c('0x4')](),auth['canUpdate'](),controller['reset']);router[_0xe36c('0x2')](_0xe36c('0x7'),auth[_0xe36c('0x4')](),auth['canUpdate'](),controller[_0xe36c('0x8')]);router[_0xe36c('0x2')]('/restart',auth[_0xe36c('0x4')](),controller[_0xe36c('0x9')]);router[_0xe36c('0x2')](_0xe36c('0xa'),controller['migrations']);module[_0xe36c('0xb')]=router;
\ No newline at end of file
+var _0xa29c=['restart','/migrations','migrations','exports','express','../../components/auth/service','./version.controller','get','index','isAuthenticated','canUpdate','fetch','reset','/pull','pull','/restart'];(function(_0x1dddb3,_0xc4c737){var _0x2faaf4=function(_0x290f7a){while(--_0x290f7a){_0x1dddb3['push'](_0x1dddb3['shift']());}};_0x2faaf4(++_0xc4c737);}(_0xa29c,0x104));var _0xca29=function(_0x3e67a9,_0x38cee2){_0x3e67a9=_0x3e67a9-0x0;var _0x339c99=_0xa29c[_0x3e67a9];return _0x339c99;};'use strict';var express=require(_0xca29('0x0'));var router=express['Router']();var auth=require(_0xca29('0x1'));var controller=require(_0xca29('0x2'));router[_0xca29('0x3')]('/',controller[_0xca29('0x4')]);router['get']('/fetch',auth[_0xca29('0x5')](),auth[_0xca29('0x6')](),controller[_0xca29('0x7')]);router[_0xca29('0x3')]('/reset',auth[_0xca29('0x5')](),auth[_0xca29('0x6')](),controller[_0xca29('0x8')]);router[_0xca29('0x3')](_0xca29('0x9'),auth[_0xca29('0x5')](),auth['canUpdate'](),controller[_0xca29('0xa')]);router[_0xca29('0x3')](_0xca29('0xb'),auth['isAuthenticated'](),controller[_0xca29('0xc')]);router[_0xca29('0x3')](_0xca29('0xd'),controller[_0xca29('0xe')]);module[_0xca29('0xf')]=router;
\ No newline at end of file
index b54177e..98bc091 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcad8=['.js','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','umzug','lodash','pkginfo','version','compare-versions','exec','../../mysqldb','../../config/pm2','../../config/logger','update','simple-git','exports','query','latest','fetch','tags','status','origin','master','error','json','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','migrations','readdirSync','join','root','server','length','replace','push','sequelize','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.'];(function(_0x9c3c56,_0x169b56){var _0x2dd782=function(_0x386962){while(--_0x386962){_0x9c3c56['push'](_0x9c3c56['shift']());}};_0x2dd782(++_0x169b56);}(_0xcad8,0x1ae));var _0x8cad=function(_0x9000c5,_0x1ca4d6){_0x9000c5=_0x9000c5-0x0;var _0x4f94c7=_0xcad8[_0x9000c5];return _0x4f94c7;};'use strict';var Umzug=require(_0x8cad('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x8cad('0x1'));var pkginfo=require(_0x8cad('0x2'))(module,_0x8cad('0x3'));var compareVersions=require(_0x8cad('0x4'));var exec=require('child_process')[_0x8cad('0x5')];var db=require(_0x8cad('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0x8cad('0x7'));var logger=require(_0x8cad('0x8'))(_0x8cad('0x9'));var git=require(_0x8cad('0xa'))(config['root']);exports['index']=function(_0x4c7e53,_0x48aeba){var _0x16890c={'current':module[_0x8cad('0xb')][_0x8cad('0x3')],'phonebar':0x2};if(_0x4c7e53[_0x8cad('0xc')]&&_0x4c7e53[_0x8cad('0xc')][_0x8cad('0xd')]){return git[_0x8cad('0xe')]()[_0x8cad('0xf')](function(_0x46114c,_0x4e86e3){_0x16890c['latest']=(_0x46114c?module[_0x8cad('0xb')][_0x8cad('0x3')]:_0x4e86e3[_0x8cad('0xd')])||'2.0.0';return _0x48aeba[_0x8cad('0x10')](0xc8)['json'](_0x16890c);});}else{return _0x48aeba[_0x8cad('0x10')](0xc8)['json'](_0x16890c);}};exports[_0x8cad('0xe')]=function(_0x18b6f7,_0x1cbe59){return git[_0x8cad('0xe')]([_0x8cad('0x11'),_0x8cad('0x12')],function(_0x132a91){if(_0x132a91){logger[_0x8cad('0x13')](_0x132a91);return _0x1cbe59[_0x8cad('0x10')](0x1f4)[_0x8cad('0x14')](_0x132a91);}logger['info'](_0x8cad('0x15'));return _0x1cbe59[_0x8cad('0x10')](0xc8)[_0x8cad('0x14')]({'output':_0x8cad('0x16')});});};exports[_0x8cad('0x17')]=function(_0x1e8117,_0x12b284){return git[_0x8cad('0x17')]([_0x8cad('0x18'),_0x8cad('0x19')],function(_0x43fd8f){if(_0x43fd8f){logger[_0x8cad('0x13')](_0x43fd8f);return _0x12b284['status'](0x1f4)['json'](_0x43fd8f);}logger[_0x8cad('0x1a')](_0x8cad('0x1b'));return _0x12b284[_0x8cad('0x10')](0xc8)['json']({'output':_0x8cad('0x1c')});});};exports[_0x8cad('0x1d')]=function(_0x5be239,_0x40d2ac){exec(_0x8cad('0x1e'),function(_0x389848,_0x3d704e,_0xd0902d){logger['info'](_0x3d704e);logger[_0x8cad('0x1a')](_0xd0902d);if(_0x389848){logger[_0x8cad('0x13')](_0x389848);return _0x40d2ac[_0x8cad('0x10')](0x1f4)[_0x8cad('0x14')](_0x389848);}return _0x40d2ac[_0x8cad('0x10')](0xc8)['json']({'output':_0x3d704e});});};exports[_0x8cad('0x1f')]=function(_0x5631e2,_0x32fc9a){return pm2[_0x8cad('0x1f')](_0x8cad('0x20'))['then'](function(_0xb26870){logger[_0x8cad('0x1a')](_0x8cad('0x21'),_0xb26870);return _0x32fc9a['status'](0xc8)[_0x8cad('0x14')]({'output':_0x8cad('0x22')});})['catch'](function(_0x3c2ee8){logger[_0x8cad('0x13')](_0x3c2ee8);return _0x32fc9a[_0x8cad('0x10')](0x1f4)[_0x8cad('0x14')](_0x3c2ee8);});};exports[_0x8cad('0x23')]=function(_0x4d3a48,_0x540959){var _0x53f4a5=fs[_0x8cad('0x24')](path[_0x8cad('0x25')](config[_0x8cad('0x26')],_0x8cad('0x27'),'migrations'));var _0x3875af=[];for(var _0x1ac93e=0x0;_0x1ac93e<_0x53f4a5[_0x8cad('0x28')];_0x1ac93e++){var _0x29a07a=_0x53f4a5[_0x1ac93e][_0x8cad('0x29')]('.js','');if(compareVersions(module[_0x8cad('0xb')]['version'],_0x29a07a)===-0x1){_0x3875af[_0x8cad('0x2a')](_0x29a07a);}}if(_0x3875af[_0x8cad('0x28')]){var _0x78c05d=_0x3875af['sort'](compareVersions);var _0x264d35=new Umzug({'storage':_0x8cad('0x2b'),'storageOptions':{'model':db['Migration'],'modelName':_0x8cad('0x2c'),'columnName':'version'},'migrations':{'params':[db[_0x8cad('0x2b')]['getQueryInterface'](),db[_0x8cad('0x2b')][_0x8cad('0x2d')],function(){throw new Error(_0x8cad('0x2e'));}],'path':path[_0x8cad('0x25')](config[_0x8cad('0x26')],_0x8cad('0x27'),'migrations'),'pattern':/\.js$/}});_0x264d35['up']({'migrations':_['map'](_0x78c05d,function(_0x3ce901){return _0x3ce901+_0x8cad('0x2f');})})[_0x8cad('0x30')](function(){return _0x540959['status'](0xc8)[_0x8cad('0x14')]({'output':_0x8cad('0x31')+module[_0x8cad('0xb')][_0x8cad('0x3')]+_0x8cad('0x32')+_[_0x8cad('0x33')](_0x78c05d),'migrations':_[_0x8cad('0x25')](_0x78c05d)});})['catch'](function(_0x3d3209){if(_0x3d3209 instanceof db['sequelize'][_0x8cad('0x34')]){return _0x540959['status'](0xc8)[_0x8cad('0x14')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x540959[_0x8cad('0x10')](0x1f4)[_0x8cad('0x14')](_0x3d3209);}});}else{return _0x540959[_0x8cad('0x10')](0xc8)[_0x8cad('0x14')]({'output':'Database\x20already\x20up-to-date'});}};
\ No newline at end of file
+var _0x9ef5=['child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','update','root','index','exports','version','query','latest','tags','json','status','fetch','origin','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','join','server','.js','push','length','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','compare-versions'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9ef5,0x139));var _0x59ef=function(_0xdd82b4,_0x5cd8b8){_0xdd82b4=_0xdd82b4-0x0;var _0x549bb2=_0x9ef5[_0xdd82b4];return _0x549bb2;};'use strict';var Umzug=require(_0x59ef('0x0'));var path=require(_0x59ef('0x1'));var fs=require('fs');var _=require(_0x59ef('0x2'));var pkginfo=require(_0x59ef('0x3'))(module,'version');var compareVersions=require(_0x59ef('0x4'));var exec=require(_0x59ef('0x5'))[_0x59ef('0x6')];var db=require(_0x59ef('0x7'))['db'];var config=require(_0x59ef('0x8'));var pm2=require(_0x59ef('0x9'));var logger=require('../../config/logger')(_0x59ef('0xa'));var git=require('simple-git')(config[_0x59ef('0xb')]);exports[_0x59ef('0xc')]=function(_0x55c716,_0x2cde43){var _0x2e8f91={'current':module[_0x59ef('0xd')][_0x59ef('0xe')],'phonebar':0x2};if(_0x55c716[_0x59ef('0xf')]&&_0x55c716[_0x59ef('0xf')][_0x59ef('0x10')]){return git['fetch']()[_0x59ef('0x11')](function(_0x14bb5b,_0x2d4fb2){_0x2e8f91['latest']=(_0x14bb5b?module[_0x59ef('0xd')][_0x59ef('0xe')]:_0x2d4fb2['latest'])||'2.0.0';return _0x2cde43['status'](0xc8)[_0x59ef('0x12')](_0x2e8f91);});}else{return _0x2cde43[_0x59ef('0x13')](0xc8)[_0x59ef('0x12')](_0x2e8f91);}};exports[_0x59ef('0x14')]=function(_0x1609eb,_0x6e13a8){return git[_0x59ef('0x14')]([_0x59ef('0x15'),'master'],function(_0x172cb2){if(_0x172cb2){logger[_0x59ef('0x16')](_0x172cb2);return _0x6e13a8[_0x59ef('0x13')](0x1f4)[_0x59ef('0x12')](_0x172cb2);}logger[_0x59ef('0x17')](_0x59ef('0x18'));return _0x6e13a8['status'](0xc8)[_0x59ef('0x12')]({'output':_0x59ef('0x19')});});};exports[_0x59ef('0x1a')]=function(_0x33ef34,_0x26eaee){return git[_0x59ef('0x1a')]([_0x59ef('0x1b'),'FETCH_HEAD'],function(_0x1e96ca){if(_0x1e96ca){logger[_0x59ef('0x16')](_0x1e96ca);return _0x26eaee[_0x59ef('0x13')](0x1f4)[_0x59ef('0x12')](_0x1e96ca);}logger[_0x59ef('0x17')](_0x59ef('0x1c'));return _0x26eaee[_0x59ef('0x13')](0xc8)[_0x59ef('0x12')]({'output':_0x59ef('0x1d')});});};exports[_0x59ef('0x1e')]=function(_0xad2d43,_0x319741){exec('npm\x20install\x20--production',function(_0x381b1a,_0x735ed1,_0x10f269){logger[_0x59ef('0x17')](_0x735ed1);logger[_0x59ef('0x17')](_0x10f269);if(_0x381b1a){logger[_0x59ef('0x16')](_0x381b1a);return _0x319741[_0x59ef('0x13')](0x1f4)[_0x59ef('0x12')](_0x381b1a);}return _0x319741[_0x59ef('0x13')](0xc8)[_0x59ef('0x12')]({'output':_0x735ed1});});};exports[_0x59ef('0x1f')]=function(_0x964540,_0x51cc2f){return pm2['restart'](_0x59ef('0x20'))[_0x59ef('0x21')](function(_0xe39bc){logger[_0x59ef('0x17')]('pm2\x20restart\x20motion\x20%s',_0xe39bc);return _0x51cc2f[_0x59ef('0x13')](0xc8)[_0x59ef('0x12')]({'output':_0x59ef('0x22')});})[_0x59ef('0x23')](function(_0x138a1e){logger[_0x59ef('0x16')](_0x138a1e);return _0x51cc2f['status'](0x1f4)['json'](_0x138a1e);});};exports['migrations']=function(_0x921c7e,_0x1e3757){var _0x1ac90d=fs['readdirSync'](path[_0x59ef('0x24')](config[_0x59ef('0xb')],_0x59ef('0x25'),'migrations'));var _0x48d64b=[];for(var _0x493581=0x0;_0x493581<_0x1ac90d['length'];_0x493581++){var _0x5ae7df=_0x1ac90d[_0x493581]['replace'](_0x59ef('0x26'),'');if(compareVersions(module[_0x59ef('0xd')][_0x59ef('0xe')],_0x5ae7df)===-0x1){_0x48d64b[_0x59ef('0x27')](_0x5ae7df);}}if(_0x48d64b[_0x59ef('0x28')]){var _0x52a244=_0x48d64b[_0x59ef('0x29')](compareVersions);var _0x2abb3d=new Umzug({'storage':_0x59ef('0x2a'),'storageOptions':{'model':db[_0x59ef('0x2b')],'modelName':_0x59ef('0x2b'),'columnName':_0x59ef('0xe')},'migrations':{'params':[db[_0x59ef('0x2a')][_0x59ef('0x2c')](),db['sequelize'][_0x59ef('0x2d')],function(){throw new Error(_0x59ef('0x2e'));}],'path':path['join'](config[_0x59ef('0xb')],_0x59ef('0x25'),'migrations'),'pattern':/\.js$/}});_0x2abb3d['up']({'migrations':_[_0x59ef('0x2f')](_0x52a244,function(_0x5412f7){return _0x5412f7+'.js';})})[_0x59ef('0x21')](function(){return _0x1e3757[_0x59ef('0x13')](0xc8)[_0x59ef('0x12')]({'output':_0x59ef('0x30')+module[_0x59ef('0xd')][_0x59ef('0xe')]+_0x59ef('0x31')+_[_0x59ef('0x32')](_0x52a244),'migrations':_['join'](_0x52a244)});})[_0x59ef('0x23')](function(_0x4eec1b){if(_0x4eec1b instanceof db[_0x59ef('0x2a')][_0x59ef('0x33')]){return _0x1e3757['status'](0xc8)[_0x59ef('0x12')]({'output':_0x59ef('0x34')});}else{return _0x1e3757[_0x59ef('0x13')](0x1f4)['json'](_0x4eec1b);}});}else{return _0x1e3757[_0x59ef('0x13')](0xc8)['json']({'output':_0x59ef('0x34')});}};
\ No newline at end of file
index af48304..2f830a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xefd6=['describe','/:id','show','post','create','put','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x2a41b2,_0x53c672){var _0x59c822=function(_0xb375e5){while(--_0xb375e5){_0x2a41b2['push'](_0x2a41b2['shift']());}};_0x59c822(++_0x53c672);}(_0xefd6,0x171));var _0x6efd=function(_0x15998e,_0x5c87a0){_0x15998e=_0x15998e-0x0;var _0x184512=_0xefd6[_0x15998e];return _0x184512;};'use strict';var multer=require(_0x6efd('0x0'));var util=require(_0x6efd('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6efd('0x2'));var router=express[_0x6efd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6efd('0x4'));var interaction=require(_0x6efd('0x5'));var config=require(_0x6efd('0x6'));var controller=require('./voiceAgentReport.controller');router[_0x6efd('0x7')]('/',auth[_0x6efd('0x8')](),controller[_0x6efd('0x9')]);router[_0x6efd('0x7')](_0x6efd('0xa'),auth[_0x6efd('0x8')](),controller[_0x6efd('0xb')]);router[_0x6efd('0x7')](_0x6efd('0xc'),auth['isAuthenticated'](),controller[_0x6efd('0xd')]);router[_0x6efd('0xe')]('/',auth['isAuthenticated'](),controller[_0x6efd('0xf')]);router[_0x6efd('0x10')]('/:id',auth[_0x6efd('0x8')](),controller['update']);router['delete'](_0x6efd('0xc'),auth[_0x6efd('0x8')](),controller[_0x6efd('0x11')]);module[_0x6efd('0x12')]=router;
\ No newline at end of file
+var _0x8fbb=['put','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceAgentReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create'];(function(_0x920930,_0x1a7331){var _0x4df989=function(_0x3962b2){while(--_0x3962b2){_0x920930['push'](_0x920930['shift']());}};_0x4df989(++_0x1a7331);}(_0x8fbb,0x1bc));var _0xb8fb=function(_0x5a9447,_0x218ec8){_0x5a9447=_0x5a9447-0x0;var _0x1902c9=_0x8fbb[_0x5a9447];return _0x1902c9;};'use strict';var multer=require('multer');var util=require(_0xb8fb('0x0'));var path=require(_0xb8fb('0x1'));var timeout=require('connect-timeout');var express=require(_0xb8fb('0x2'));var router=express[_0xb8fb('0x3')]();var fs_extra=require(_0xb8fb('0x4'));var auth=require(_0xb8fb('0x5'));var interaction=require(_0xb8fb('0x6'));var config=require('../../config/environment');var controller=require(_0xb8fb('0x7'));router[_0xb8fb('0x8')]('/',auth[_0xb8fb('0x9')](),controller['index']);router['get'](_0xb8fb('0xa'),auth['isAuthenticated'](),controller[_0xb8fb('0xb')]);router[_0xb8fb('0x8')](_0xb8fb('0xc'),auth[_0xb8fb('0x9')](),controller[_0xb8fb('0xd')]);router[_0xb8fb('0xe')]('/',auth['isAuthenticated'](),controller[_0xb8fb('0xf')]);router[_0xb8fb('0x10')](_0xb8fb('0xc'),auth[_0xb8fb('0x9')](),controller['update']);router[_0xb8fb('0x11')]('/:id',auth[_0xb8fb('0x9')](),controller[_0xb8fb('0x12')]);module[_0xb8fb('0x13')]=router;
\ No newline at end of file
index f65c556..0a5901a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7af9=['STRING','DATE','INTEGER','BOOLEAN','sequelize'];(function(_0x50466b,_0x339b99){var _0x5d54c6=function(_0x4ea4aa){while(--_0x4ea4aa){_0x50466b['push'](_0x50466b['shift']());}};_0x5d54c6(++_0x339b99);}(_0x7af9,0x95));var _0x97af=function(_0x20a8d8,_0x16e1e1){_0x20a8d8=_0x20a8d8-0x0;var _0x50dcb7=_0x7af9[_0x20a8d8];return _0x50dcb7;};'use strict';var Sequelize=require(_0x97af('0x0'));module['exports']={'type':{'type':Sequelize[_0x97af('0x1')]},'uniqueid':{'type':Sequelize[_0x97af('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x97af('0x1')]},'queue':{'type':Sequelize[_0x97af('0x1')]},'interface':{'type':Sequelize[_0x97af('0x1')]},'membername':{'type':Sequelize[_0x97af('0x1')]},'agentcalledAt':{'type':Sequelize[_0x97af('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize[_0x97af('0x2')]},'holdtime':{'type':Sequelize[_0x97af('0x3')]},'agentcomplete':{'type':Sequelize[_0x97af('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x97af('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x97af('0x3')]},'agentacw':{'type':Sequelize[_0x97af('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x97af('0x3')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x97af('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x97af('0x3')]},'channelstatedesc':{'type':Sequelize[_0x97af('0x1')]},'connectedlinenum':{'type':Sequelize[_0x97af('0x1')]},'connectedlinename':{'type':Sequelize[_0x97af('0x1')]},'language':{'type':Sequelize[_0x97af('0x1')]},'accountcode':{'type':Sequelize[_0x97af('0x1')]},'context':{'type':Sequelize[_0x97af('0x1')]},'exten':{'type':Sequelize[_0x97af('0x1')]},'priority':{'type':Sequelize[_0x97af('0x1')]},'destchannel':{'type':Sequelize[_0x97af('0x1')]},'destchannelstate':{'type':Sequelize[_0x97af('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x97af('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x97af('0x1')]},'destlanguage':{'type':Sequelize[_0x97af('0x1')]},'destaccountcode':{'type':Sequelize[_0x97af('0x1')]},'destcontext':{'type':Sequelize[_0x97af('0x1')]},'destexten':{'type':Sequelize[_0x97af('0x1')]},'destpriority':{'type':Sequelize[_0x97af('0x1')]},'destuniqueid':{'type':Sequelize[_0x97af('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x97af('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x97af('0x1')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x97af('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x97af('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0xd5c8=['BOOLEAN','INTEGER','STRING','DATE'];(function(_0x33448a,_0x184f78){var _0x4ece1d=function(_0x4d7a0c){while(--_0x4d7a0c){_0x33448a['push'](_0x33448a['shift']());}};_0x4ece1d(++_0x184f78);}(_0xd5c8,0x166));var _0x8d5c=function(_0x1b68ba,_0x23687a){_0x1b68ba=_0x1b68ba-0x0;var _0xf49b11=_0xd5c8[_0x1b68ba];return _0xf49b11;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x8d5c('0x0')]},'uniqueid':{'type':Sequelize[_0x8d5c('0x0')]},'calleridnum':{'type':Sequelize[_0x8d5c('0x0')]},'calleridname':{'type':Sequelize[_0x8d5c('0x0')]},'queue':{'type':Sequelize[_0x8d5c('0x0')]},'interface':{'type':Sequelize[_0x8d5c('0x0')]},'membername':{'type':Sequelize[_0x8d5c('0x0')]},'agentcalledAt':{'type':Sequelize[_0x8d5c('0x1')]},'agentconnectAt':{'type':Sequelize[_0x8d5c('0x1')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x8d5c('0x1')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x8d5c('0x2')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x8d5c('0x2')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x8d5c('0x2')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x8d5c('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x8d5c('0x0')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x8d5c('0x0')]},'channelstate':{'type':Sequelize[_0x8d5c('0x3')]},'channelstatedesc':{'type':Sequelize[_0x8d5c('0x0')]},'connectedlinenum':{'type':Sequelize[_0x8d5c('0x0')]},'connectedlinename':{'type':Sequelize[_0x8d5c('0x0')]},'language':{'type':Sequelize[_0x8d5c('0x0')]},'accountcode':{'type':Sequelize[_0x8d5c('0x0')]},'context':{'type':Sequelize[_0x8d5c('0x0')]},'exten':{'type':Sequelize[_0x8d5c('0x0')]},'priority':{'type':Sequelize[_0x8d5c('0x0')]},'destchannel':{'type':Sequelize[_0x8d5c('0x0')]},'destchannelstate':{'type':Sequelize[_0x8d5c('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x8d5c('0x0')]},'destcalleridname':{'type':Sequelize[_0x8d5c('0x0')]},'destconnectedlinenum':{'type':Sequelize[_0x8d5c('0x0')]},'destconnectedlinename':{'type':Sequelize[_0x8d5c('0x0')]},'destlanguage':{'type':Sequelize[_0x8d5c('0x0')]},'destaccountcode':{'type':Sequelize[_0x8d5c('0x0')]},'destcontext':{'type':Sequelize[_0x8d5c('0x0')]},'destexten':{'type':Sequelize[_0x8d5c('0x0')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x8d5c('0x0')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x8d5c('0x0')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8d5c('0x0')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x8d5c('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index 287a62f..77dcfbb 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(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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 d0884a0..72716de 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0a1=['../../config/logger','api','moment','path','rimraf','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','uniqueid','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa0a1,0x15b));var _0x1a0a=function(_0xfc3fc4,_0x321256){_0xfc3fc4=_0xfc3fc4-0x0;var _0x26b413=_0xa0a1[_0xfc3fc4];return _0x26b413;};'use strict';var _=require(_0x1a0a('0x0'));var util=require('util');var logger=require(_0x1a0a('0x1'))(_0x1a0a('0x2'));var moment=require(_0x1a0a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a0a('0x4'));var rimraf=require(_0x1a0a('0x5'));var config=require('../../config/environment');var attributes=require(_0x1a0a('0x6'));module[_0x1a0a('0x7')]=function(_0x4b5573,_0x2d4b04){return _0x4b5573[_0x1a0a('0x8')](_0x1a0a('0x9'),attributes,{'tableName':_0x1a0a('0xa'),'paranoid':![],'indexes':[{'fields':[_0x1a0a('0xb'),'destuniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1b20=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define','VoiceAgentReport','report_agent','destuniqueid','util','../../config/logger'];(function(_0x32a73d,_0x5cdbc9){var _0x4d4942=function(_0x1a68c7){while(--_0x1a68c7){_0x32a73d['push'](_0x32a73d['shift']());}};_0x4d4942(++_0x5cdbc9);}(_0x1b20,0x66));var _0x01b2=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1b20[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x01b2('0x0'));var logger=require(_0x01b2('0x1'))('api');var moment=require('moment');var BPromise=require(_0x01b2('0x2'));var rp=require(_0x01b2('0x3'));var fs=require('fs');var path=require(_0x01b2('0x4'));var rimraf=require(_0x01b2('0x5'));var config=require(_0x01b2('0x6'));var attributes=require(_0x01b2('0x7'));module[_0x01b2('0x8')]=function(_0x28de4a,_0x46e745){return _0x28de4a[_0x01b2('0x9')](_0x01b2('0xa'),attributes,{'tableName':_0x01b2('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0x01b2('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 1d27658..7df916e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3e75=['VoiceAgentReport','body','options','debug','UpdateVoiceAgentReport','update','raw','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','stringify','code','error','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','CreateVoiceAgentReport'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x3e75,0x89));var _0x53e7=function(_0x172133,_0x10246b){_0x172133=_0x172133-0x0;var _0x2460e5=_0x3e75[_0x172133];return _0x2460e5;};'use strict';var _=require(_0x53e7('0x0'));var util=require(_0x53e7('0x1'));var moment=require('moment');var BPromise=require(_0x53e7('0x2'));var rs=require(_0x53e7('0x3'));var fs=require('fs');var Redis=require(_0x53e7('0x4'));var db=require(_0x53e7('0x5'))['db'];var utils=require(_0x53e7('0x6'));var logger=require(_0x53e7('0x7'))(_0x53e7('0x8'));var config=require(_0x53e7('0x9'));var jayson=require(_0x53e7('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x41564a,_0x32bde1,_0x3f50e6){return new BPromise(function(_0x39f3e3,_0x578ffb){return client[_0x53e7('0xb')](_0x41564a,_0x3f50e6)[_0x53e7('0xc')](function(_0x1e0a33){logger[_0x53e7('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x32bde1,_0x53e7('0xe'));logger['debug']('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x32bde1,_0x53e7('0xe'),JSON[_0x53e7('0xf')](_0x1e0a33));if(_0x1e0a33['error']){if(_0x1e0a33['error'][_0x53e7('0x10')]===0x1f4){logger[_0x53e7('0x11')](_0x53e7('0x12'),_0x32bde1,_0x1e0a33[_0x53e7('0x11')]['message']);return _0x578ffb(_0x1e0a33[_0x53e7('0x11')][_0x53e7('0x13')]);}logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x32bde1,_0x1e0a33['error'][_0x53e7('0x13')]);return _0x39f3e3(_0x1e0a33[_0x53e7('0x11')][_0x53e7('0x13')]);}else{logger[_0x53e7('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x32bde1,_0x53e7('0xe'));_0x39f3e3(_0x1e0a33[_0x53e7('0x14')][_0x53e7('0x13')]);}})[_0x53e7('0x15')](function(_0x47d19c){logger[_0x53e7('0x11')](_0x53e7('0x12'),_0x32bde1,_0x47d19c);_0x578ffb(_0x47d19c);});});}exports[_0x53e7('0x16')]=function(_0x3218c3){var _0x5cfefb=this;return new Promise(function(_0x369672,_0x154d54){return db[_0x53e7('0x17')]['create'](_0x3218c3[_0x53e7('0x18')],{'raw':_0x3218c3[_0x53e7('0x19')]?_0x3218c3[_0x53e7('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x460c4a){logger[_0x53e7('0xd')](_0x53e7('0x16'),_0x3218c3);logger[_0x53e7('0x1a')](_0x53e7('0x16'),_0x3218c3,JSON[_0x53e7('0xf')](_0x460c4a));_0x369672(_0x460c4a);})[_0x53e7('0x15')](function(_0x1ffbf1){logger['error']('CreateVoiceAgentReport',_0x1ffbf1['message'],_0x3218c3);_0x154d54(_0x5cfefb[_0x53e7('0x11')](0x1f4,_0x1ffbf1['message']));});});};exports[_0x53e7('0x1b')]=function(_0x2d8360){var _0x117e80=this;return new Promise(function(_0x145d16,_0x58ea17){return db[_0x53e7('0x17')][_0x53e7('0x1c')](_0x2d8360[_0x53e7('0x18')],{'raw':_0x2d8360[_0x53e7('0x19')]?_0x2d8360['options'][_0x53e7('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d8360['options']?_0x2d8360['options']['where']||null:null,'attributes':_0x2d8360[_0x53e7('0x19')]?_0x2d8360[_0x53e7('0x19')][_0x53e7('0x1e')]||null:null,'limit':_0x2d8360['options']?_0x2d8360[_0x53e7('0x19')][_0x53e7('0x1f')]||null:null})['then'](function(_0x29cf6d){logger[_0x53e7('0xd')](_0x53e7('0x1b'),_0x2d8360);logger[_0x53e7('0x1a')]('UpdateVoiceAgentReport',_0x2d8360,JSON[_0x53e7('0xf')](_0x29cf6d));_0x145d16(_0x29cf6d);})[_0x53e7('0x15')](function(_0x509a9b){logger[_0x53e7('0x11')](_0x53e7('0x1b'),_0x509a9b[_0x53e7('0x13')],_0x2d8360);_0x58ea17(_0x117e80[_0x53e7('0x11')](0x1f4,_0x509a9b[_0x53e7('0x13')]));});});};
\ No newline at end of file
+var _0x1170=['options','raw','debug','catch','UpdateVoiceAgentReport','update','where','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceAgentReport','VoiceAgentReport','create'];(function(_0x5dc6e8,_0x1ed7cc){var _0x2cb306=function(_0xae157e){while(--_0xae157e){_0x5dc6e8['push'](_0x5dc6e8['shift']());}};_0x2cb306(++_0x1ed7cc);}(_0x1170,0x1d5));var _0x0117=function(_0x10fa63,_0x2095a2){_0x10fa63=_0x10fa63-0x0;var _0x4f1463=_0x1170[_0x10fa63];return _0x4f1463;};'use strict';var _=require(_0x0117('0x0'));var util=require(_0x0117('0x1'));var moment=require(_0x0117('0x2'));var BPromise=require(_0x0117('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0117('0x4'));var db=require(_0x0117('0x5'))['db'];var utils=require(_0x0117('0x6'));var logger=require(_0x0117('0x7'))(_0x0117('0x8'));var config=require(_0x0117('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0117('0xa')][_0x0117('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c5061,_0x362d29,_0x18b51a){return new BPromise(function(_0x486ae1,_0x7d2425){return client[_0x0117('0xc')](_0x4c5061,_0x18b51a)[_0x0117('0xd')](function(_0x88892c){logger[_0x0117('0xe')](_0x0117('0xf'),_0x362d29,_0x0117('0x10'));logger['debug'](_0x0117('0x11'),_0x362d29,'request\x20sent',JSON[_0x0117('0x12')](_0x88892c));if(_0x88892c[_0x0117('0x13')]){if(_0x88892c[_0x0117('0x13')][_0x0117('0x14')]===0x1f4){logger[_0x0117('0x13')](_0x0117('0xf'),_0x362d29,_0x88892c[_0x0117('0x13')][_0x0117('0x15')]);return _0x7d2425(_0x88892c[_0x0117('0x13')][_0x0117('0x15')]);}logger[_0x0117('0x13')](_0x0117('0xf'),_0x362d29,_0x88892c[_0x0117('0x13')][_0x0117('0x15')]);return _0x486ae1(_0x88892c['error']['message']);}else{logger[_0x0117('0xe')](_0x0117('0xf'),_0x362d29,_0x0117('0x10'));_0x486ae1(_0x88892c[_0x0117('0x16')][_0x0117('0x15')]);}})['catch'](function(_0x195417){logger[_0x0117('0x13')](_0x0117('0xf'),_0x362d29,_0x195417);_0x7d2425(_0x195417);});});}exports[_0x0117('0x17')]=function(_0x35cbec){var _0x209e70=this;return new Promise(function(_0x205b9c,_0xad6ecd){return db[_0x0117('0x18')][_0x0117('0x19')](_0x35cbec['body'],{'raw':_0x35cbec[_0x0117('0x1a')]?_0x35cbec[_0x0117('0x1a')][_0x0117('0x1b')]===undefined?!![]:![]:!![]})[_0x0117('0xd')](function(_0x493b20){logger[_0x0117('0xe')](_0x0117('0x17'),_0x35cbec);logger[_0x0117('0x1c')]('CreateVoiceAgentReport',_0x35cbec,JSON['stringify'](_0x493b20));_0x205b9c(_0x493b20);})[_0x0117('0x1d')](function(_0x2d617e){logger[_0x0117('0x13')](_0x0117('0x17'),_0x2d617e[_0x0117('0x15')],_0x35cbec);_0xad6ecd(_0x209e70['error'](0x1f4,_0x2d617e[_0x0117('0x15')]));});});};exports[_0x0117('0x1e')]=function(_0x66e40e){var _0x874e9e=this;return new Promise(function(_0x5043fc,_0x1313b){return db[_0x0117('0x18')][_0x0117('0x1f')](_0x66e40e['body'],{'raw':_0x66e40e[_0x0117('0x1a')]?_0x66e40e[_0x0117('0x1a')][_0x0117('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x66e40e[_0x0117('0x1a')]?_0x66e40e['options'][_0x0117('0x20')]||null:null,'attributes':_0x66e40e[_0x0117('0x1a')]?_0x66e40e[_0x0117('0x1a')]['attributes']||null:null,'limit':_0x66e40e[_0x0117('0x1a')]?_0x66e40e[_0x0117('0x1a')]['limit']||null:null})[_0x0117('0xd')](function(_0x2b3c8d){logger['info']('UpdateVoiceAgentReport',_0x66e40e);logger[_0x0117('0x1c')]('UpdateVoiceAgentReport',_0x66e40e,JSON[_0x0117('0x12')](_0x2b3c8d));_0x5043fc(_0x2b3c8d);})[_0x0117('0x1d')](function(_0x177771){logger[_0x0117('0x13')](_0x0117('0x1e'),_0x177771[_0x0117('0x15')],_0x66e40e);_0x1313b(_0x874e9e['error'](0x1f4,_0x177771[_0x0117('0x15')]));});});};
\ No newline at end of file
index 8b29fa8..bb2f93d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8958=['index','get','/describe','/:id','show','post','create','put','delete','destroy','exports','util','fs-extra','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','isAuthenticated'];(function(_0x3aeaf9,_0xcacc11){var _0x31ec43=function(_0x38e474){while(--_0x38e474){_0x3aeaf9['push'](_0x3aeaf9['shift']());}};_0x31ec43(++_0xcacc11);}(_0x8958,0x93));var _0x8895=function(_0xf9664c,_0x23180f){_0xf9664c=_0xf9664c-0x0;var _0x400cfb=_0x8958[_0xf9664c];return _0x400cfb;};'use strict';var multer=require('multer');var util=require(_0x8895('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8895('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x8895('0x2'));var config=require(_0x8895('0x3'));var controller=require(_0x8895('0x4'));router['get']('/',auth[_0x8895('0x5')](),controller[_0x8895('0x6')]);router[_0x8895('0x7')](_0x8895('0x8'),auth[_0x8895('0x5')](),controller['describe']);router[_0x8895('0x7')](_0x8895('0x9'),auth[_0x8895('0x5')](),controller[_0x8895('0xa')]);router[_0x8895('0xb')]('/',auth[_0x8895('0x5')](),controller[_0x8895('0xc')]);router[_0x8895('0xd')](_0x8895('0x9'),auth[_0x8895('0x5')](),controller['update']);router[_0x8895('0xe')](_0x8895('0x9'),auth[_0x8895('0x5')](),controller[_0x8895('0xf')]);module[_0x8895('0x10')]=router;
\ No newline at end of file
+var _0x6b8f=['destroy','exports','util','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put'];(function(_0x370284,_0x3348d5){var _0x1445c8=function(_0x573a25){while(--_0x573a25){_0x370284['push'](_0x370284['shift']());}};_0x1445c8(++_0x3348d5);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x27a02d,_0x22b09d){_0x27a02d=_0x27a02d-0x0;var _0x41edd4=_0x6b8f[_0x27a02d];return _0x41edd4;};'use strict';var multer=require('multer');var util=require(_0xf6b8('0x0'));var path=require('path');var timeout=require(_0xf6b8('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf6b8('0x2'));var auth=require(_0xf6b8('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf6b8('0x4'));var controller=require(_0xf6b8('0x5'));router[_0xf6b8('0x6')]('/',auth['isAuthenticated'](),controller[_0xf6b8('0x7')]);router[_0xf6b8('0x6')](_0xf6b8('0x8'),auth[_0xf6b8('0x9')](),controller['describe']);router['get'](_0xf6b8('0xa'),auth['isAuthenticated'](),controller[_0xf6b8('0xb')]);router[_0xf6b8('0xc')]('/',auth[_0xf6b8('0x9')](),controller[_0xf6b8('0xd')]);router[_0xf6b8('0xe')](_0xf6b8('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xf6b8('0xa'),auth[_0xf6b8('0x9')](),controller[_0xf6b8('0xf')]);module[_0xf6b8('0x10')]=router;
\ No newline at end of file
index 15a294a..71160fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69c4=['exports','STRING','inbound','TEXT','DATE','INTEGER','sequelize'];(function(_0x297d8d,_0x4dad3b){var _0x48ff74=function(_0x16ba99){while(--_0x16ba99){_0x297d8d['push'](_0x297d8d['shift']());}};_0x48ff74(++_0x4dad3b);}(_0x69c4,0x1d4));var _0x469c=function(_0x3e1bc9,_0x12ed09){_0x3e1bc9=_0x3e1bc9-0x0;var _0x132b8a=_0x69c4[_0x3e1bc9];return _0x132b8a;};'use strict';var Sequelize=require(_0x469c('0x0'));module[_0x469c('0x1')]={'uniqueid':{'type':Sequelize[_0x469c('0x2')]},'type':{'type':Sequelize['ENUM'](_0x469c('0x3'),'internal','outbound','inbound-fax','outbound-fax','dialer')},'tag':{'type':Sequelize[_0x469c('0x2')]},'accountcode':{'type':Sequelize[_0x469c('0x2')]},'source':{'type':Sequelize[_0x469c('0x2')]},'destination':{'type':Sequelize[_0x469c('0x2')]},'destinationcontext':{'type':Sequelize[_0x469c('0x2')]},'callerid':{'type':Sequelize[_0x469c('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x469c('0x2')]},'lastapplication':{'type':Sequelize[_0x469c('0x2')]},'lastdata':{'type':Sequelize[_0x469c('0x4')]},'starttime':{'type':Sequelize[_0x469c('0x5')]},'systemanswertime':{'type':Sequelize[_0x469c('0x5')]},'answertime':{'type':Sequelize[_0x469c('0x5')]},'endtime':{'type':Sequelize[_0x469c('0x5')]},'duration':{'type':Sequelize[_0x469c('0x6')]},'billableseconds':{'type':Sequelize[_0x469c('0x6')]},'mohtime':{'type':Sequelize[_0x469c('0x6')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x469c('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x469c('0x2')]},'userDisposition':{'type':Sequelize[_0x469c('0x2')]},'userSecondDisposition':{'type':Sequelize[_0x469c('0x2')]},'userThirdDisposition':{'type':Sequelize[_0x469c('0x2')]},'note':{'type':Sequelize[_0x469c('0x2')]},'prefix':{'type':Sequelize[_0x469c('0x2')]},'routeid':{'type':Sequelize[_0x469c('0x6')]},'sipcallid':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xa149=['sequelize','exports','STRING','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','DATE','INTEGER'];(function(_0x51fa36,_0x569b13){var _0x33ed7a=function(_0x179202){while(--_0x179202){_0x51fa36['push'](_0x51fa36['shift']());}};_0x33ed7a(++_0x569b13);}(_0xa149,0x18c));var _0x9a14=function(_0x48c8b1,_0x392d97){_0x48c8b1=_0x48c8b1-0x0;var _0x1c4d61=_0xa149[_0x48c8b1];return _0x1c4d61;};'use strict';var Sequelize=require(_0x9a14('0x0'));module[_0x9a14('0x1')]={'uniqueid':{'type':Sequelize[_0x9a14('0x2')]},'type':{'type':Sequelize[_0x9a14('0x3')](_0x9a14('0x4'),_0x9a14('0x5'),_0x9a14('0x6'),_0x9a14('0x7'),_0x9a14('0x8'),'dialer')},'tag':{'type':Sequelize[_0x9a14('0x2')]},'accountcode':{'type':Sequelize[_0x9a14('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x9a14('0x2')]},'destinationcontext':{'type':Sequelize[_0x9a14('0x2')]},'callerid':{'type':Sequelize[_0x9a14('0x2')]},'channel':{'type':Sequelize[_0x9a14('0x2')]},'destinationchannel':{'type':Sequelize[_0x9a14('0x2')]},'lastapplication':{'type':Sequelize[_0x9a14('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x9a14('0x9')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x9a14('0x9')]},'endtime':{'type':Sequelize[_0x9a14('0x9')]},'duration':{'type':Sequelize[_0x9a14('0xa')]},'billableseconds':{'type':Sequelize[_0x9a14('0xa')]},'mohtime':{'type':Sequelize[_0x9a14('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x9a14('0x2')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0x9a14('0x2')]},'note':{'type':Sequelize[_0x9a14('0x2')]},'prefix':{'type':Sequelize['STRING']},'routeid':{'type':Sequelize[_0x9a14('0xa')]},'sipcallid':{'type':Sequelize['STRING']}};
\ No newline at end of file
index 55bb56b..2ebae00 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(_0x3fb63f,_0x4d50a9){var _0x23154d=function(_0x1455cb){while(--_0x1455cb){_0x3fb63f['push'](_0x3fb63f['shift']());}};_0x23154d(++_0x4d50a9);}(_0xdb28,0x106));var _0x8db2=function(_0x633c07,_0x38ccd7){_0x633c07=_0x633c07-0x0;var _0x4d64e4=_0xdb28[_0x633c07];return _0x4d64e4;};'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 _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(_0x64c978,_0x16f14e){var _0x4629d9=function(_0x5a8595){while(--_0x5a8595){_0x64c978['push'](_0x64c978['shift']());}};_0x4629d9(++_0x16f14e);}(_0xdb28,0x106));var _0x8db2=function(_0x29b5aa,_0x303d65){_0x29b5aa=_0x29b5aa-0x0;var _0x13f847=_0xdb28[_0x29b5aa];return _0x13f847;};'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
index 6eda24c..e454f02 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9366=['path','../../config/environment','./voiceCallReport.attributes','exports','report_call','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x592bba,_0x535c52){var _0x3e4180=function(_0x57831e){while(--_0x57831e){_0x592bba['push'](_0x592bba['shift']());}};_0x3e4180(++_0x535c52);}(_0x9366,0x14a));var _0x6936=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9366[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x6936('0x0'));var logger=require(_0x6936('0x1'))(_0x6936('0x2'));var moment=require(_0x6936('0x3'));var BPromise=require(_0x6936('0x4'));var rp=require(_0x6936('0x5'));var fs=require('fs');var path=require(_0x6936('0x6'));var rimraf=require('rimraf');var config=require(_0x6936('0x7'));var attributes=require(_0x6936('0x8'));module[_0x6936('0x9')]=function(_0x2b36cc,_0x3ad113){return _0x2b36cc['define']('VoiceCallReport',attributes,{'tableName':_0x6936('0xa'),'paranoid':![],'indexes':[{'fields':[_0x6936('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3877=['rimraf','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','util','api','moment','bluebird','request-promise','path'];(function(_0x19a49f,_0x444d74){var _0x5351ae=function(_0x58b1ed){while(--_0x58b1ed){_0x19a49f['push'](_0x19a49f['shift']());}};_0x5351ae(++_0x444d74);}(_0x3877,0x1c1));var _0x7387=function(_0x176149,_0x44ce6d){_0x176149=_0x176149-0x0;var _0x47441b=_0x3877[_0x176149];return _0x47441b;};'use strict';var _=require('lodash');var util=require(_0x7387('0x0'));var logger=require('../../config/logger')(_0x7387('0x1'));var moment=require(_0x7387('0x2'));var BPromise=require(_0x7387('0x3'));var rp=require(_0x7387('0x4'));var fs=require('fs');var path=require(_0x7387('0x5'));var rimraf=require(_0x7387('0x6'));var config=require('../../config/environment');var attributes=require(_0x7387('0x7'));module[_0x7387('0x8')]=function(_0x40fd0a,_0x979116){return _0x40fd0a[_0x7387('0x9')](_0x7387('0xa'),attributes,{'tableName':_0x7387('0xb'),'paranoid':![],'indexes':[{'fields':[_0x7387('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
index 3bd2ed8..f7021c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe725=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceCallReport,\x20%s,\x20%s','result','GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes','limit','include','map','model','catch','CreateVoiceCallReport','body','raw','UpdateVoiceCallReport','update'];(function(_0x527824,_0xc824a9){var _0xc8b8ed=function(_0x1b0e19){while(--_0x1b0e19){_0x527824['push'](_0x527824['shift']());}};_0xc8b8ed(++_0xc824a9);}(_0xe725,0x138));var _0x5e72=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe725[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5e72('0x0'));var util=require('util');var moment=require(_0x5e72('0x1'));var BPromise=require(_0x5e72('0x2'));var rs=require(_0x5e72('0x3'));var fs=require('fs');var Redis=require(_0x5e72('0x4'));var db=require(_0x5e72('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5e72('0x6'))(_0x5e72('0x7'));var config=require(_0x5e72('0x8'));var jayson=require(_0x5e72('0x9'));var client=jayson['client'][_0x5e72('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbf2465,_0x2e0830,_0x2eaeed){return new BPromise(function(_0x288318,_0x4a5a7f){return client[_0x5e72('0xb')](_0xbf2465,_0x2eaeed)[_0x5e72('0xc')](function(_0x1d3c1d){logger[_0x5e72('0xd')]('VoiceCallReport,\x20%s,\x20%s',_0x2e0830,_0x5e72('0xe'));logger[_0x5e72('0xf')](_0x5e72('0x10'),_0x2e0830,_0x5e72('0xe'),JSON[_0x5e72('0x11')](_0x1d3c1d));if(_0x1d3c1d[_0x5e72('0x12')]){if(_0x1d3c1d[_0x5e72('0x12')][_0x5e72('0x13')]===0x1f4){logger[_0x5e72('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x2e0830,_0x1d3c1d[_0x5e72('0x12')][_0x5e72('0x14')]);return _0x4a5a7f(_0x1d3c1d[_0x5e72('0x12')]['message']);}logger[_0x5e72('0x12')](_0x5e72('0x15'),_0x2e0830,_0x1d3c1d[_0x5e72('0x12')][_0x5e72('0x14')]);return _0x288318(_0x1d3c1d['error'][_0x5e72('0x14')]);}else{logger[_0x5e72('0xd')](_0x5e72('0x15'),_0x2e0830,_0x5e72('0xe'));_0x288318(_0x1d3c1d[_0x5e72('0x16')]['message']);}})['catch'](function(_0x2e22a5){logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x2e0830,_0x2e22a5);_0x4a5a7f(_0x2e22a5);});});}exports[_0x5e72('0x17')]=function(_0x18e671){var _0xa2fbfc=this;return new Promise(function(_0xe9ad67,_0x1f49ba){return db[_0x5e72('0x18')][_0x5e72('0x19')]({'raw':_0x18e671[_0x5e72('0x1a')]?_0x18e671[_0x5e72('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x18e671[_0x5e72('0x1a')]?_0x18e671[_0x5e72('0x1a')][_0x5e72('0x1b')]||null:null,'attributes':_0x18e671[_0x5e72('0x1a')]?_0x18e671[_0x5e72('0x1a')][_0x5e72('0x1c')]||null:null,'limit':_0x18e671[_0x5e72('0x1a')]?_0x18e671[_0x5e72('0x1a')][_0x5e72('0x1d')]||null:null,'include':_0x18e671[_0x5e72('0x1a')]?_0x18e671[_0x5e72('0x1a')][_0x5e72('0x1e')]?_[_0x5e72('0x1f')](_0x18e671[_0x5e72('0x1a')][_0x5e72('0x1e')],function(_0x5f4ef4){return{'model':db[_0x5f4ef4['model']],'as':_0x5f4ef4['as'],'attributes':_0x5f4ef4['attributes'],'include':_0x5f4ef4['include']?_['map'](_0x5f4ef4[_0x5e72('0x1e')],function(_0xf3f0ab){return{'model':db[_0xf3f0ab[_0x5e72('0x20')]],'as':_0xf3f0ab['as'],'attributes':_0xf3f0ab[_0x5e72('0x1c')],'include':_0xf3f0ab[_0x5e72('0x1e')]?_[_0x5e72('0x1f')](_0xf3f0ab['include'],function(_0x2c8c4a){return{'model':db[_0x2c8c4a[_0x5e72('0x20')]],'as':_0x2c8c4a['as'],'attributes':_0x2c8c4a[_0x5e72('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5e72('0xc')](function(_0x2bb1df){logger['info'](_0x5e72('0x17'),_0x18e671);logger[_0x5e72('0xf')](_0x5e72('0x17'),_0x18e671,JSON['stringify'](_0x2bb1df));_0xe9ad67(_0x2bb1df);})[_0x5e72('0x21')](function(_0x2fb569){logger['error']('GetVoiceCallReport',_0x2fb569[_0x5e72('0x14')],_0x18e671);_0x1f49ba(_0xa2fbfc[_0x5e72('0x12')](0x1f4,_0x2fb569['message']));});});};exports[_0x5e72('0x22')]=function(_0x3b1ac6){var _0x3872ad=this;return new Promise(function(_0x7257a8,_0x5256ca){return db['VoiceCallReport']['create'](_0x3b1ac6[_0x5e72('0x23')],{'raw':_0x3b1ac6[_0x5e72('0x1a')]?_0x3b1ac6[_0x5e72('0x1a')][_0x5e72('0x24')]===undefined?!![]:![]:!![]})[_0x5e72('0xc')](function(_0x15fc11){logger[_0x5e72('0xd')](_0x5e72('0x22'),_0x3b1ac6);logger[_0x5e72('0xf')](_0x5e72('0x22'),_0x3b1ac6,JSON[_0x5e72('0x11')](_0x15fc11));_0x7257a8(_0x15fc11);})[_0x5e72('0x21')](function(_0x4c8b15){logger['error'](_0x5e72('0x22'),_0x4c8b15[_0x5e72('0x14')],_0x3b1ac6);_0x5256ca(_0x3872ad[_0x5e72('0x12')](0x1f4,_0x4c8b15[_0x5e72('0x14')]));});});};exports[_0x5e72('0x25')]=function(_0x1aaa47){var _0x1c4aad=this;return new Promise(function(_0x1d27c6,_0x2e2709){return db['VoiceCallReport'][_0x5e72('0x26')](_0x1aaa47[_0x5e72('0x23')],{'raw':_0x1aaa47[_0x5e72('0x1a')]?_0x1aaa47[_0x5e72('0x1a')][_0x5e72('0x24')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1aaa47['options']?_0x1aaa47[_0x5e72('0x1a')][_0x5e72('0x1b')]||null:null,'attributes':_0x1aaa47[_0x5e72('0x1a')]?_0x1aaa47[_0x5e72('0x1a')][_0x5e72('0x1c')]||null:null,'limit':_0x1aaa47[_0x5e72('0x1a')]?_0x1aaa47[_0x5e72('0x1a')][_0x5e72('0x1d')]||null:null})[_0x5e72('0xc')](function(_0x157f0c){logger[_0x5e72('0xd')](_0x5e72('0x25'),_0x1aaa47);logger[_0x5e72('0xf')](_0x5e72('0x25'),_0x1aaa47,JSON[_0x5e72('0x11')](_0x157f0c));_0x1d27c6(_0x157f0c);})[_0x5e72('0x21')](function(_0x2434a9){logger[_0x5e72('0x12')]('UpdateVoiceCallReport',_0x2434a9['message'],_0x1aaa47);_0x2e2709(_0x1c4aad['error'](0x1f4,_0x2434a9[_0x5e72('0x14')]));});});};
\ No newline at end of file
+var _0x8e48=['message','info','catch','VoiceCallReport','findAll','options','raw','attributes','limit','include','map','model','GetVoiceCallReport','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','where','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x8e48,0x1e7));var _0x88e4=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x8e48[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x88e4('0x0'));var util=require('util');var moment=require(_0x88e4('0x1'));var BPromise=require(_0x88e4('0x2'));var rs=require(_0x88e4('0x3'));var fs=require('fs');var Redis=require(_0x88e4('0x4'));var db=require(_0x88e4('0x5'))['db'];var utils=require(_0x88e4('0x6'));var logger=require(_0x88e4('0x7'))(_0x88e4('0x8'));var config=require(_0x88e4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x88e4('0xa')][_0x88e4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x43a09b,_0x24e289,_0x1ab82f){return new BPromise(function(_0x3cf0b6,_0x404700){return client['request'](_0x43a09b,_0x1ab82f)[_0x88e4('0xc')](function(_0x4f9de1){logger['info'](_0x88e4('0xd'),_0x24e289,_0x88e4('0xe'));logger[_0x88e4('0xf')](_0x88e4('0x10'),_0x24e289,_0x88e4('0xe'),JSON[_0x88e4('0x11')](_0x4f9de1));if(_0x4f9de1[_0x88e4('0x12')]){if(_0x4f9de1[_0x88e4('0x12')][_0x88e4('0x13')]===0x1f4){logger[_0x88e4('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x24e289,_0x4f9de1[_0x88e4('0x12')][_0x88e4('0x14')]);return _0x404700(_0x4f9de1['error'][_0x88e4('0x14')]);}logger[_0x88e4('0x12')](_0x88e4('0xd'),_0x24e289,_0x4f9de1[_0x88e4('0x12')]['message']);return _0x3cf0b6(_0x4f9de1[_0x88e4('0x12')][_0x88e4('0x14')]);}else{logger[_0x88e4('0x15')](_0x88e4('0xd'),_0x24e289,_0x88e4('0xe'));_0x3cf0b6(_0x4f9de1['result'][_0x88e4('0x14')]);}})[_0x88e4('0x16')](function(_0x35f1c1){logger[_0x88e4('0x12')]('VoiceCallReport,\x20%s,\x20%s',_0x24e289,_0x35f1c1);_0x404700(_0x35f1c1);});});}exports['GetVoiceCallReport']=function(_0x588da2){var _0x5b66e4=this;return new Promise(function(_0x1e3a2c,_0x16d573){return db[_0x88e4('0x17')][_0x88e4('0x18')]({'raw':_0x588da2[_0x88e4('0x19')]?_0x588da2[_0x88e4('0x19')][_0x88e4('0x1a')]===undefined?!![]:![]:!![],'where':_0x588da2[_0x88e4('0x19')]?_0x588da2[_0x88e4('0x19')]['where']||null:null,'attributes':_0x588da2[_0x88e4('0x19')]?_0x588da2[_0x88e4('0x19')][_0x88e4('0x1b')]||null:null,'limit':_0x588da2[_0x88e4('0x19')]?_0x588da2[_0x88e4('0x19')][_0x88e4('0x1c')]||null:null,'include':_0x588da2[_0x88e4('0x19')]?_0x588da2['options'][_0x88e4('0x1d')]?_[_0x88e4('0x1e')](_0x588da2[_0x88e4('0x19')][_0x88e4('0x1d')],function(_0x18b33e){return{'model':db[_0x18b33e['model']],'as':_0x18b33e['as'],'attributes':_0x18b33e[_0x88e4('0x1b')],'include':_0x18b33e[_0x88e4('0x1d')]?_[_0x88e4('0x1e')](_0x18b33e[_0x88e4('0x1d')],function(_0x5ba731){return{'model':db[_0x5ba731[_0x88e4('0x1f')]],'as':_0x5ba731['as'],'attributes':_0x5ba731[_0x88e4('0x1b')],'include':_0x5ba731[_0x88e4('0x1d')]?_[_0x88e4('0x1e')](_0x5ba731[_0x88e4('0x1d')],function(_0x1e60b6){return{'model':db[_0x1e60b6[_0x88e4('0x1f')]],'as':_0x1e60b6['as'],'attributes':_0x1e60b6[_0x88e4('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x48509d){logger['info'](_0x88e4('0x20'),_0x588da2);logger[_0x88e4('0xf')](_0x88e4('0x20'),_0x588da2,JSON[_0x88e4('0x11')](_0x48509d));_0x1e3a2c(_0x48509d);})[_0x88e4('0x16')](function(_0x343594){logger[_0x88e4('0x12')]('GetVoiceCallReport',_0x343594['message'],_0x588da2);_0x16d573(_0x5b66e4['error'](0x1f4,_0x343594[_0x88e4('0x14')]));});});};exports[_0x88e4('0x21')]=function(_0x192bb9){var _0x1e9b4c=this;return new Promise(function(_0xe3065e,_0x2cecef){return db[_0x88e4('0x17')][_0x88e4('0x22')](_0x192bb9[_0x88e4('0x23')],{'raw':_0x192bb9[_0x88e4('0x19')]?_0x192bb9[_0x88e4('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x88e4('0xc')](function(_0x27f9aa){logger[_0x88e4('0x15')](_0x88e4('0x21'),_0x192bb9);logger[_0x88e4('0xf')]('CreateVoiceCallReport',_0x192bb9,JSON[_0x88e4('0x11')](_0x27f9aa));_0xe3065e(_0x27f9aa);})['catch'](function(_0x1970ed){logger[_0x88e4('0x12')](_0x88e4('0x21'),_0x1970ed[_0x88e4('0x14')],_0x192bb9);_0x2cecef(_0x1e9b4c[_0x88e4('0x12')](0x1f4,_0x1970ed[_0x88e4('0x14')]));});});};exports[_0x88e4('0x24')]=function(_0x5bf52b){var _0x268768=this;return new Promise(function(_0x577b66,_0x1c7f53){return db[_0x88e4('0x17')][_0x88e4('0x25')](_0x5bf52b['body'],{'raw':_0x5bf52b[_0x88e4('0x19')]?_0x5bf52b[_0x88e4('0x19')][_0x88e4('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bf52b[_0x88e4('0x19')]?_0x5bf52b['options'][_0x88e4('0x26')]||null:null,'attributes':_0x5bf52b[_0x88e4('0x19')]?_0x5bf52b['options']['attributes']||null:null,'limit':_0x5bf52b[_0x88e4('0x19')]?_0x5bf52b[_0x88e4('0x19')][_0x88e4('0x1c')]||null:null})[_0x88e4('0xc')](function(_0x96a701){logger[_0x88e4('0x15')](_0x88e4('0x24'),_0x5bf52b);logger[_0x88e4('0xf')]('UpdateVoiceCallReport',_0x5bf52b,JSON['stringify'](_0x96a701));_0x577b66(_0x96a701);})[_0x88e4('0x16')](function(_0x1da642){logger[_0x88e4('0x12')]('UpdateVoiceCallReport',_0x1da642[_0x88e4('0x14')],_0x5bf52b);_0x1c7f53(_0x268768[_0x88e4('0x12')](0x1f4,_0x1da642[_0x88e4('0x14')]));});});};
\ No newline at end of file
index 4a11834..01fd3cb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3460=['post','put','destroy','exports','util','path','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','show'];(function(_0x320a7c,_0x43681b){var _0x2cd152=function(_0x486fc6){while(--_0x486fc6){_0x320a7c['push'](_0x320a7c['shift']());}};_0x2cd152(++_0x43681b);}(_0x3460,0xdc));var _0x0346=function(_0xe0aaf5,_0x2f95a0){_0xe0aaf5=_0xe0aaf5-0x0;var _0x24f5aa=_0x3460[_0xe0aaf5];return _0x24f5aa;};'use strict';var multer=require('multer');var util=require(_0x0346('0x0'));var path=require(_0x0346('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x0346('0x2'));var auth=require(_0x0346('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0346('0x4'));var controller=require('./voiceChanSpy.controller');router['get']('/',auth[_0x0346('0x5')](),controller[_0x0346('0x6')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0346('0x7')]);router[_0x0346('0x8')]('/',auth[_0x0346('0x5')](),controller['create']);router[_0x0346('0x9')]('/:id',auth[_0x0346('0x5')](),controller['update']);router['delete']('/:id',auth[_0x0346('0x5')](),controller[_0x0346('0xa')]);module[_0x0346('0xb')]=router;
\ No newline at end of file
+var _0x48ef=['create','put','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post'];(function(_0x4b5de5,_0x1169f7){var _0xc200db=function(_0x59649e){while(--_0x59649e){_0x4b5de5['push'](_0x4b5de5['shift']());}};_0xc200db(++_0x1169f7);}(_0x48ef,0x9d));var _0xf48e=function(_0x241b27,_0x755b3b){_0x241b27=_0x241b27-0x0;var _0x17e5de=_0x48ef[_0x241b27];return _0x17e5de;};'use strict';var multer=require(_0xf48e('0x0'));var util=require(_0xf48e('0x1'));var path=require('path');var timeout=require(_0xf48e('0x2'));var express=require(_0xf48e('0x3'));var router=express['Router']();var fs_extra=require(_0xf48e('0x4'));var auth=require(_0xf48e('0x5'));var interaction=require(_0xf48e('0x6'));var config=require(_0xf48e('0x7'));var controller=require('./voiceChanSpy.controller');router[_0xf48e('0x8')]('/',auth[_0xf48e('0x9')](),controller[_0xf48e('0xa')]);router[_0xf48e('0x8')](_0xf48e('0xb'),auth['isAuthenticated'](),controller[_0xf48e('0xc')]);router[_0xf48e('0xd')]('/',auth[_0xf48e('0x9')](),controller[_0xf48e('0xe')]);router[_0xf48e('0xf')](_0xf48e('0xb'),auth[_0xf48e('0x9')](),controller[_0xf48e('0x10')]);router['delete'](_0xf48e('0xb'),auth['isAuthenticated'](),controller[_0xf48e('0x11')]);module[_0xf48e('0x12')]=router;
\ No newline at end of file
index cc987e4..ede2c50 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79a5=['setDataValue','options','getDataValue','split','BOOLEAN','sequelize','exports','STRING','name'];(function(_0xa1b0d4,_0xbeba0){var _0x19f06c=function(_0x172a9a){while(--_0x172a9a){_0xa1b0d4['push'](_0xa1b0d4['shift']());}};_0x19f06c(++_0xbeba0);}(_0x79a5,0x1a3));var _0x579a=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x79a5[_0x342700];return _0x53406f;};'use strict';var Sequelize=require(_0x579a('0x0'));module[_0x579a('0x1')]={'name':{'type':Sequelize[_0x579a('0x2')]},'prefix':{'type':Sequelize[_0x579a('0x2')],'unique':_0x579a('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x579a('0x2')],'set':function(_0x36d349){this[_0x579a('0x4')](_0x579a('0x5'),_0x36d349?_0x36d349['join'](''):[]);},'get':function(){return this[_0x579a('0x6')]('options')?this[_0x579a('0x6')]('options')[_0x579a('0x7')](''):[];}},'auth':{'type':Sequelize[_0x579a('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x579a('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x579a('0x2')]},'description':{'type':Sequelize[_0x579a('0x2')]}};
\ No newline at end of file
+var _0x13ac=['exports','STRING','name','setDataValue','options','getDataValue'];(function(_0x4678b6,_0x2a9aa8){var _0x23747d=function(_0x21dded){while(--_0x21dded){_0x4678b6['push'](_0x4678b6['shift']());}};_0x23747d(++_0x2a9aa8);}(_0x13ac,0x144));var _0xc13a=function(_0xcc32b6,_0x4c6d79){_0xcc32b6=_0xcc32b6-0x0;var _0x553abb=_0x13ac[_0xcc32b6];return _0x553abb;};'use strict';var Sequelize=require('sequelize');module[_0xc13a('0x0')]={'name':{'type':Sequelize[_0xc13a('0x1')]},'prefix':{'type':Sequelize[_0xc13a('0x1')],'unique':_0xc13a('0x2'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x2810b9){this[_0xc13a('0x3')](_0xc13a('0x4'),_0x2810b9?_0x2810b9['join'](''):[]);},'get':function(){return this[_0xc13a('0x5')](_0xc13a('0x4'))?this[_0xc13a('0x5')](_0xc13a('0x4'))['split'](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xc13a('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xc13a('0x1')]},'description':{'type':Sequelize[_0xc13a('0x1')]}};
\ No newline at end of file
index ee0ed07..69309c2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x136c=['undefined','limit','count','offset','status','set','Content-Range','update','then','destroy','ChanSpies','end','error','stack','name','send','index','VoiceChanSpy','fieldName','type','key','map','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','show','params','rawAttributes','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','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','../../config/utils','../../mysqldb','sendStatus'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x136c,0x1d2));var _0xc136=function(_0x4d9e6a,_0x314cad){_0x4d9e6a=_0x4d9e6a-0x0;var _0x21ab3a=_0x136c[_0x4d9e6a];return _0x21ab3a;};'use strict';var emlformat=require(_0xc136('0x0'));var rimraf=require(_0xc136('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc136('0x2'));var rp=require(_0xc136('0x3'));var moment=require(_0xc136('0x4'));var BPromise=require(_0xc136('0x5'));var Mustache=require(_0xc136('0x6'));var util=require(_0xc136('0x7'));var path=require(_0xc136('0x8'));var sox=require(_0xc136('0x9'));var csv=require(_0xc136('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc136('0xb'));var _=require('lodash');var squel=require(_0xc136('0xc'));var crypto=require(_0xc136('0xd'));var jsforce=require(_0xc136('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc136('0xa'));var querystring=require('querystring');var Papa=require(_0xc136('0xf'));var Redis=require(_0xc136('0x10'));var authService=require(_0xc136('0x11'));var qs=require(_0xc136('0x12'));var as=require(_0xc136('0x13'));var hardwareService=require(_0xc136('0x14'));var logger=require(_0xc136('0x15'))(_0xc136('0x16'));var utils=require(_0xc136('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc136('0x18'))['db'];function respondWithStatusCode(_0x5d0c62,_0x17b00b){_0x17b00b=_0x17b00b||0xcc;return function(_0x473a8b){if(_0x473a8b){return _0x5d0c62[_0xc136('0x19')](_0x17b00b);}return _0x5d0c62['status'](_0x17b00b)['end']();};}function respondWithResult(_0x15be1a,_0x36d55d){_0x36d55d=_0x36d55d||0xc8;return function(_0x4e2674){if(_0x4e2674){return _0x15be1a['status'](_0x36d55d)['json'](_0x4e2674);}};}function respondWithFilteredResult(_0x2e28ba,_0x16e87f){return function(_0x4fa765){if(_0x4fa765){var _0x4e24fb=typeof _0x16e87f['offset']===_0xc136('0x1a')&&typeof _0x16e87f[_0xc136('0x1b')]===_0xc136('0x1a');var _0x155929=_0x4fa765[_0xc136('0x1c')];var _0x1ccf5f=_0x4e24fb?0x0:_0x16e87f['offset'];var _0x5df9b7=_0x4e24fb?_0x4fa765['count']:_0x16e87f[_0xc136('0x1d')]+_0x16e87f['limit'];var _0x238f8c;if(_0x5df9b7>=_0x155929){_0x5df9b7=_0x155929;_0x238f8c=0xc8;}else{_0x238f8c=0xce;}_0x2e28ba[_0xc136('0x1e')](_0x238f8c);return _0x2e28ba[_0xc136('0x1f')](_0xc136('0x20'),_0x1ccf5f+'-'+_0x5df9b7+'/'+_0x155929)['json'](_0x4fa765);}return null;};}function patchUpdates(_0x2b8527){return function(_0x1f942b){try{jsonpatch['apply'](_0x1f942b,_0x2b8527,!![]);}catch(_0xc26366){return BPromise['reject'](_0xc26366);}return _0x1f942b['save']();};}function saveUpdates(_0x5ac0bf,_0x1a350a){return function(_0x4f766d){if(_0x4f766d){return _0x4f766d[_0xc136('0x21')](_0x5ac0bf)[_0xc136('0x22')](function(_0x279c07){return _0x279c07;});}return null;};}function removeEntity(_0x45e5fe,_0x5d8300){return function(_0x6f0831){if(_0x6f0831){return _0x6f0831[_0xc136('0x23')]()['then'](function(){var _0x3432b0=_0x6f0831['get']({'plain':!![]});var _0x21a163=_0xc136('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x21a163,'resourceId':_0x3432b0['id']}})[_0xc136('0x22')](function(){return _0x6f0831;});})[_0xc136('0x22')](function(){_0x45e5fe['status'](0xcc)[_0xc136('0x25')]();});}};}function handleEntityNotFound(_0x283d7a,_0x31e862){return function(_0x2608b8){if(!_0x2608b8){_0x283d7a[_0xc136('0x19')](0x194);}return _0x2608b8;};}function handleError(_0x1c1057,_0xa3e411){_0xa3e411=_0xa3e411||0x1f4;return function(_0x5f3027){logger[_0xc136('0x26')](_0x5f3027[_0xc136('0x27')]);if(_0x5f3027[_0xc136('0x28')]){delete _0x5f3027[_0xc136('0x28')];}_0x1c1057[_0xc136('0x1e')](_0xa3e411)[_0xc136('0x29')](_0x5f3027);};}exports[_0xc136('0x2a')]=function(_0x1cba1e,_0x24632e){var _0x5e591e={},_0x2b3e73={},_0x218d07={'count':0x0,'rows':[]};var _0x4497bc=_['map'](db[_0xc136('0x2b')]['rawAttributes'],function(_0x4e5e09){return{'name':_0x4e5e09[_0xc136('0x2c')],'type':_0x4e5e09[_0xc136('0x2d')][_0xc136('0x2e')]};});_0x2b3e73['model']=_[_0xc136('0x2f')](_0x4497bc,_0xc136('0x28'));_0x2b3e73['query']=_[_0xc136('0x30')](_0x1cba1e[_0xc136('0x31')]);_0x2b3e73['filters']=_[_0xc136('0x32')](_0x2b3e73[_0xc136('0x33')],_0x2b3e73[_0xc136('0x31')]);_0x5e591e[_0xc136('0x34')]=_[_0xc136('0x32')](_0x2b3e73[_0xc136('0x33')],qs[_0xc136('0x35')](_0x1cba1e[_0xc136('0x31')][_0xc136('0x35')]));_0x5e591e[_0xc136('0x34')]=_0x5e591e[_0xc136('0x34')][_0xc136('0x36')]?_0x5e591e['attributes']:_0x2b3e73[_0xc136('0x33')];if(!_0x1cba1e[_0xc136('0x31')][_0xc136('0x37')](_0xc136('0x38'))){_0x5e591e[_0xc136('0x1b')]=qs[_0xc136('0x1b')](_0x1cba1e[_0xc136('0x31')]['limit']);_0x5e591e[_0xc136('0x1d')]=qs[_0xc136('0x1d')](_0x1cba1e[_0xc136('0x31')][_0xc136('0x1d')]);}_0x5e591e[_0xc136('0x39')]=qs[_0xc136('0x3a')](_0x1cba1e[_0xc136('0x31')]['sort']);_0x5e591e[_0xc136('0x3b')]=qs[_0xc136('0x3c')](_[_0xc136('0x3d')](_0x1cba1e[_0xc136('0x31')],_0x2b3e73[_0xc136('0x3c')]),_0x4497bc);if(_0x1cba1e['query'][_0xc136('0x3e')]){_0x5e591e[_0xc136('0x3b')]=_['merge'](_0x5e591e[_0xc136('0x3b')],{'$or':_[_0xc136('0x2f')](_0x4497bc,function(_0x26d2fc){if(_0x26d2fc[_0xc136('0x2d')]!==_0xc136('0x3f')){var _0x5d404e={};_0x5d404e[_0x26d2fc['name']]={'$like':'%'+_0x1cba1e[_0xc136('0x31')]['filter']+'%'};return _0x5d404e;}})});}_0x5e591e=_[_0xc136('0x40')]({},_0x5e591e,_0x1cba1e[_0xc136('0x41')]);var _0xabd8ff={'where':_0x5e591e[_0xc136('0x3b')]};return db[_0xc136('0x2b')][_0xc136('0x1c')](_0xabd8ff)[_0xc136('0x22')](function(_0x51af1e){_0x218d07['count']=_0x51af1e;if(_0x1cba1e[_0xc136('0x31')]['includeAll']){_0x5e591e[_0xc136('0x42')]=[{'all':!![]}];}return db[_0xc136('0x2b')]['findAll'](_0x5e591e);})[_0xc136('0x22')](function(_0x2c18c6){_0x218d07['rows']=_0x2c18c6;return _0x218d07;})['then'](respondWithFilteredResult(_0x24632e,_0x5e591e))['catch'](handleError(_0x24632e,null));};exports[_0xc136('0x43')]=function(_0x371142,_0x53c426){var _0x141ab0={'raw':![],'where':{'id':_0x371142[_0xc136('0x44')]['id']}},_0x18bed7={};_0x18bed7['model']=_[_0xc136('0x30')](db[_0xc136('0x2b')][_0xc136('0x45')]);_0x18bed7[_0xc136('0x31')]=_[_0xc136('0x30')](_0x371142['query']);_0x18bed7[_0xc136('0x3c')]=_[_0xc136('0x32')](_0x18bed7[_0xc136('0x33')],_0x18bed7[_0xc136('0x31')]);_0x141ab0[_0xc136('0x34')]=_[_0xc136('0x32')](_0x18bed7[_0xc136('0x33')],qs[_0xc136('0x35')](_0x371142[_0xc136('0x31')][_0xc136('0x35')]));_0x141ab0[_0xc136('0x34')]=_0x141ab0[_0xc136('0x34')][_0xc136('0x36')]?_0x141ab0[_0xc136('0x34')]:_0x18bed7[_0xc136('0x33')];if(_0x371142[_0xc136('0x31')][_0xc136('0x46')]){_0x141ab0[_0xc136('0x42')]=[{'all':!![]}];}_0x141ab0=_[_0xc136('0x40')]({},_0x141ab0,_0x371142[_0xc136('0x41')]);return db['VoiceChanSpy'][_0xc136('0x47')](_0x141ab0)[_0xc136('0x22')](handleEntityNotFound(_0x53c426,null))[_0xc136('0x22')](respondWithResult(_0x53c426,null))['catch'](handleError(_0x53c426,null));};exports['create']=function(_0x34193c,_0x24f258){return db[_0xc136('0x2b')][_0xc136('0x48')](_0x34193c[_0xc136('0x49')],{})['then'](function(_0x25288d){var _0x133715=_0x34193c[_0xc136('0x4a')][_0xc136('0x4b')]({'plain':!![]});if(!_0x133715)throw new Error(_0xc136('0x4c'));if(_0x133715[_0xc136('0x4d')]===_0xc136('0x4a')){var _0x4ea74f=_0x25288d[_0xc136('0x4b')]({'plain':!![]});var _0x16784c=_0xc136('0x24');return db[_0xc136('0x4e')]['find']({'where':{'name':_0x16784c,'userProfileId':_0x133715['userProfileId']},'raw':!![]})[_0xc136('0x22')](function(_0x2c7b74){if(_0x2c7b74&&_0x2c7b74['autoAssociation']===0x0){return db[_0xc136('0x4f')][_0xc136('0x48')]({'name':_0x4ea74f[_0xc136('0x28')],'resourceId':_0x4ea74f['id'],'type':_0x2c7b74[_0xc136('0x28')],'sectionId':_0x2c7b74['id']},{})[_0xc136('0x22')](function(){return _0x25288d;});}else{return _0x25288d;}})[_0xc136('0x50')](function(_0x2e91d2){logger[_0xc136('0x26')](_0xc136('0x51'),_0x2e91d2);throw _0x2e91d2;});}return _0x25288d;})[_0xc136('0x22')](respondWithResult(_0x24f258,0xc9))['catch'](handleError(_0x24f258,null));};exports['update']=function(_0x16f568,_0x297158){if(_0x16f568[_0xc136('0x49')]['id']){delete _0x16f568[_0xc136('0x49')]['id'];}return db[_0xc136('0x2b')][_0xc136('0x47')]({'where':{'id':_0x16f568[_0xc136('0x44')]['id']}})[_0xc136('0x22')](handleEntityNotFound(_0x297158,null))['then'](saveUpdates(_0x16f568['body'],null))['then'](respondWithResult(_0x297158,null))['catch'](handleError(_0x297158,null));};exports[_0xc136('0x23')]=function(_0x5a18ef,_0x5ab4a0){return db[_0xc136('0x2b')]['find']({'where':{'id':_0x5a18ef[_0xc136('0x44')]['id']}})[_0xc136('0x22')](handleEntityNotFound(_0x5ab4a0,null))['then'](removeEntity(_0x5ab4a0,null))[_0xc136('0x50')](handleError(_0x5ab4a0,null));};
\ No newline at end of file
+var _0xeddd=['merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','fields','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','ChanSpies','UserProfileResource','error','send','index','VoiceChanSpy','rawAttributes','key','model','map','name','query','filters','intersection','attributes','length','hasOwnProperty','sort','where','filter'];(function(_0xae0f6b,_0x29e7a0){var _0x233721=function(_0x399d86){while(--_0x399d86){_0xae0f6b['push'](_0xae0f6b['shift']());}};_0x233721(++_0x29e7a0);}(_0xeddd,0x69));var _0xdedd=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xeddd[_0x32f7d7];return _0x133d09;};'use strict';var emlformat=require(_0xdedd('0x0'));var rimraf=require(_0xdedd('0x1'));var zipdir=require(_0xdedd('0x2'));var jsonpatch=require(_0xdedd('0x3'));var rp=require('request-promise');var moment=require(_0xdedd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdedd('0x5'));var util=require(_0xdedd('0x6'));var path=require('path');var sox=require(_0xdedd('0x7'));var csv=require(_0xdedd('0x8'));var ejs=require(_0xdedd('0x9'));var fs=require('fs');var fs_extra=require(_0xdedd('0xa'));var _=require(_0xdedd('0xb'));var squel=require(_0xdedd('0xc'));var crypto=require(_0xdedd('0xd'));var jsforce=require(_0xdedd('0xe'));var deskjs=require(_0xdedd('0xf'));var toCsv=require(_0xdedd('0x8'));var querystring=require(_0xdedd('0x10'));var Papa=require(_0xdedd('0x11'));var Redis=require('ioredis');var authService=require(_0xdedd('0x12'));var qs=require(_0xdedd('0x13'));var as=require(_0xdedd('0x14'));var hardwareService=require(_0xdedd('0x15'));var logger=require('../../config/logger')(_0xdedd('0x16'));var utils=require(_0xdedd('0x17'));var config=require(_0xdedd('0x18'));var licenseUtil=require(_0xdedd('0x19'));var db=require(_0xdedd('0x1a'))['db'];function respondWithStatusCode(_0x214644,_0x83ada3){_0x83ada3=_0x83ada3||0xcc;return function(_0x42ad06){if(_0x42ad06){return _0x214644[_0xdedd('0x1b')](_0x83ada3);}return _0x214644[_0xdedd('0x1c')](_0x83ada3)[_0xdedd('0x1d')]();};}function respondWithResult(_0x2ca711,_0x3b098a){_0x3b098a=_0x3b098a||0xc8;return function(_0x27b609){if(_0x27b609){return _0x2ca711[_0xdedd('0x1c')](_0x3b098a)[_0xdedd('0x1e')](_0x27b609);}};}function respondWithFilteredResult(_0x2de906,_0x39e41b){return function(_0x4436b5){if(_0x4436b5){var _0x487a8a=typeof _0x39e41b[_0xdedd('0x1f')]===_0xdedd('0x20')&&typeof _0x39e41b['limit']===_0xdedd('0x20');var _0x114694=_0x4436b5[_0xdedd('0x21')];var _0x4b16bb=_0x487a8a?0x0:_0x39e41b[_0xdedd('0x1f')];var _0x24e331=_0x487a8a?_0x4436b5[_0xdedd('0x21')]:_0x39e41b[_0xdedd('0x1f')]+_0x39e41b[_0xdedd('0x22')];var _0x530faf;if(_0x24e331>=_0x114694){_0x24e331=_0x114694;_0x530faf=0xc8;}else{_0x530faf=0xce;}_0x2de906[_0xdedd('0x1c')](_0x530faf);return _0x2de906[_0xdedd('0x23')](_0xdedd('0x24'),_0x4b16bb+'-'+_0x24e331+'/'+_0x114694)[_0xdedd('0x1e')](_0x4436b5);}return null;};}function patchUpdates(_0x1213d6){return function(_0x1d7807){try{jsonpatch[_0xdedd('0x25')](_0x1d7807,_0x1213d6,!![]);}catch(_0x187487){return BPromise[_0xdedd('0x26')](_0x187487);}return _0x1d7807['save']();};}function saveUpdates(_0x527a5b,_0x538dc1){return function(_0x53b2b2){if(_0x53b2b2){return _0x53b2b2[_0xdedd('0x27')](_0x527a5b)[_0xdedd('0x28')](function(_0x23c7e6){return _0x23c7e6;});}return null;};}function removeEntity(_0x31b14f,_0x84639d){return function(_0x4e0483){if(_0x4e0483){return _0x4e0483[_0xdedd('0x29')]()[_0xdedd('0x28')](function(){var _0x1a5788=_0x4e0483[_0xdedd('0x2a')]({'plain':!![]});var _0x4e8396=_0xdedd('0x2b');return db[_0xdedd('0x2c')][_0xdedd('0x29')]({'where':{'type':_0x4e8396,'resourceId':_0x1a5788['id']}})[_0xdedd('0x28')](function(){return _0x4e0483;});})[_0xdedd('0x28')](function(){_0x31b14f[_0xdedd('0x1c')](0xcc)[_0xdedd('0x1d')]();});}};}function handleEntityNotFound(_0x29efe0,_0x406133){return function(_0x32d3eb){if(!_0x32d3eb){_0x29efe0[_0xdedd('0x1b')](0x194);}return _0x32d3eb;};}function handleError(_0x10b7d3,_0x1dc1d1){_0x1dc1d1=_0x1dc1d1||0x1f4;return function(_0xa9b7ea){logger[_0xdedd('0x2d')](_0xa9b7ea['stack']);if(_0xa9b7ea['name']){delete _0xa9b7ea['name'];}_0x10b7d3[_0xdedd('0x1c')](_0x1dc1d1)[_0xdedd('0x2e')](_0xa9b7ea);};}exports[_0xdedd('0x2f')]=function(_0x2b3094,_0x52289f){var _0x228594={},_0x228307={},_0x1419b5={'count':0x0,'rows':[]};var _0x2ddda6=_['map'](db[_0xdedd('0x30')][_0xdedd('0x31')],function(_0x55a70c){return{'name':_0x55a70c['fieldName'],'type':_0x55a70c['type'][_0xdedd('0x32')]};});_0x228307[_0xdedd('0x33')]=_[_0xdedd('0x34')](_0x2ddda6,_0xdedd('0x35'));_0x228307[_0xdedd('0x36')]=_['keys'](_0x2b3094[_0xdedd('0x36')]);_0x228307[_0xdedd('0x37')]=_[_0xdedd('0x38')](_0x228307[_0xdedd('0x33')],_0x228307[_0xdedd('0x36')]);_0x228594[_0xdedd('0x39')]=_[_0xdedd('0x38')](_0x228307['model'],qs['fields'](_0x2b3094[_0xdedd('0x36')]['fields']));_0x228594[_0xdedd('0x39')]=_0x228594[_0xdedd('0x39')][_0xdedd('0x3a')]?_0x228594[_0xdedd('0x39')]:_0x228307['model'];if(!_0x2b3094['query'][_0xdedd('0x3b')]('nolimit')){_0x228594['limit']=qs[_0xdedd('0x22')](_0x2b3094[_0xdedd('0x36')][_0xdedd('0x22')]);_0x228594[_0xdedd('0x1f')]=qs[_0xdedd('0x1f')](_0x2b3094[_0xdedd('0x36')][_0xdedd('0x1f')]);}_0x228594['order']=qs[_0xdedd('0x3c')](_0x2b3094[_0xdedd('0x36')][_0xdedd('0x3c')]);_0x228594[_0xdedd('0x3d')]=qs[_0xdedd('0x37')](_['pick'](_0x2b3094[_0xdedd('0x36')],_0x228307[_0xdedd('0x37')]),_0x2ddda6);if(_0x2b3094[_0xdedd('0x36')][_0xdedd('0x3e')]){_0x228594[_0xdedd('0x3d')]=_[_0xdedd('0x3f')](_0x228594[_0xdedd('0x3d')],{'$or':_[_0xdedd('0x34')](_0x2ddda6,function(_0x3d22c6){if(_0x3d22c6[_0xdedd('0x40')]!==_0xdedd('0x41')){var _0x35d38a={};_0x35d38a[_0x3d22c6['name']]={'$like':'%'+_0x2b3094[_0xdedd('0x36')][_0xdedd('0x3e')]+'%'};return _0x35d38a;}})});}_0x228594=_[_0xdedd('0x3f')]({},_0x228594,_0x2b3094['options']);var _0x40faf4={'where':_0x228594[_0xdedd('0x3d')]};return db[_0xdedd('0x30')][_0xdedd('0x21')](_0x40faf4)[_0xdedd('0x28')](function(_0x5e10ee){_0x1419b5[_0xdedd('0x21')]=_0x5e10ee;if(_0x2b3094['query'][_0xdedd('0x42')]){_0x228594[_0xdedd('0x43')]=[{'all':!![]}];}return db[_0xdedd('0x30')][_0xdedd('0x44')](_0x228594);})['then'](function(_0x4961e7){_0x1419b5[_0xdedd('0x45')]=_0x4961e7;return _0x1419b5;})['then'](respondWithFilteredResult(_0x52289f,_0x228594))[_0xdedd('0x46')](handleError(_0x52289f,null));};exports[_0xdedd('0x47')]=function(_0x2e6e8d,_0x18f276){var _0x192973={'raw':![],'where':{'id':_0x2e6e8d[_0xdedd('0x48')]['id']}},_0xcd0208={};_0xcd0208[_0xdedd('0x33')]=_['keys'](db[_0xdedd('0x30')][_0xdedd('0x31')]);_0xcd0208[_0xdedd('0x36')]=_['keys'](_0x2e6e8d['query']);_0xcd0208[_0xdedd('0x37')]=_['intersection'](_0xcd0208[_0xdedd('0x33')],_0xcd0208[_0xdedd('0x36')]);_0x192973[_0xdedd('0x39')]=_[_0xdedd('0x38')](_0xcd0208[_0xdedd('0x33')],qs[_0xdedd('0x49')](_0x2e6e8d[_0xdedd('0x36')][_0xdedd('0x49')]));_0x192973[_0xdedd('0x39')]=_0x192973[_0xdedd('0x39')]['length']?_0x192973['attributes']:_0xcd0208['model'];if(_0x2e6e8d[_0xdedd('0x36')][_0xdedd('0x42')]){_0x192973[_0xdedd('0x43')]=[{'all':!![]}];}_0x192973=_[_0xdedd('0x3f')]({},_0x192973,_0x2e6e8d[_0xdedd('0x4a')]);return db[_0xdedd('0x30')][_0xdedd('0x4b')](_0x192973)[_0xdedd('0x28')](handleEntityNotFound(_0x18f276,null))[_0xdedd('0x28')](respondWithResult(_0x18f276,null))[_0xdedd('0x46')](handleError(_0x18f276,null));};exports[_0xdedd('0x4c')]=function(_0x3c3901,_0x4e2811){return db[_0xdedd('0x30')][_0xdedd('0x4c')](_0x3c3901['body'],{})[_0xdedd('0x28')](function(_0xee6e27){var _0x29278d=_0x3c3901['user']['get']({'plain':!![]});if(!_0x29278d)throw new Error(_0xdedd('0x4d'));if(_0x29278d[_0xdedd('0x4e')]===_0xdedd('0x4f')){var _0x495030=_0xee6e27[_0xdedd('0x2a')]({'plain':!![]});var _0x25dbd8='ChanSpies';return db[_0xdedd('0x50')][_0xdedd('0x4b')]({'where':{'name':_0x25dbd8,'userProfileId':_0x29278d[_0xdedd('0x51')]},'raw':!![]})[_0xdedd('0x28')](function(_0x3b48be){if(_0x3b48be&&_0x3b48be['autoAssociation']===0x0){return db[_0xdedd('0x2c')][_0xdedd('0x4c')]({'name':_0x495030[_0xdedd('0x35')],'resourceId':_0x495030['id'],'type':_0x3b48be[_0xdedd('0x35')],'sectionId':_0x3b48be['id']},{})['then'](function(){return _0xee6e27;});}else{return _0xee6e27;}})[_0xdedd('0x46')](function(_0x1a41e3){logger['error'](_0xdedd('0x52'),_0x1a41e3);throw _0x1a41e3;});}return _0xee6e27;})[_0xdedd('0x28')](respondWithResult(_0x4e2811,0xc9))[_0xdedd('0x46')](handleError(_0x4e2811,null));};exports[_0xdedd('0x27')]=function(_0x1b0604,_0x101533){if(_0x1b0604[_0xdedd('0x53')]['id']){delete _0x1b0604[_0xdedd('0x53')]['id'];}return db[_0xdedd('0x30')]['find']({'where':{'id':_0x1b0604[_0xdedd('0x48')]['id']}})[_0xdedd('0x28')](handleEntityNotFound(_0x101533,null))['then'](saveUpdates(_0x1b0604[_0xdedd('0x53')],null))[_0xdedd('0x28')](respondWithResult(_0x101533,null))[_0xdedd('0x46')](handleError(_0x101533,null));};exports[_0xdedd('0x29')]=function(_0x8b86b7,_0x4dd01b){return db['VoiceChanSpy'][_0xdedd('0x4b')]({'where':{'id':_0x8b86b7[_0xdedd('0x48')]['id']}})[_0xdedd('0x28')](handleEntityNotFound(_0x4dd01b,null))[_0xdedd('0x28')](removeEntity(_0x4dd01b,null))[_0xdedd('0x46')](handleError(_0x4dd01b,null));};
\ No newline at end of file
index 7b91783..689c7e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7987=['format','%s%s','prefix','system','push','merge','Set','chanspy','${UNIQUEID}.%s,a','recordingFormat','auth','password','ChanSpy','name','options','join','record','StopMixMonitor','length','concat','internal','findAll','then','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','catch','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip'];(function(_0x4a4046,_0x4fa2b1){var _0x534165=function(_0x3795e5){while(--_0x3795e5){_0x4a4046['push'](_0x4a4046['shift']());}};_0x534165(++_0x4fa2b1);}(_0x7987,0xae));var _0x7798=function(_0x272638,_0x42b993){_0x272638=_0x272638-0x0;var _0x19d027=_0x7987[_0x272638];return _0x19d027;};'use strict';var _=require(_0x7798('0x0'));var util=require(_0x7798('0x1'));var BPromise=require(_0x7798('0x2'));var attributes=require(_0x7798('0x3'));var getUserApplications=function(_0x196977,_0x5706fb,_0x234be0){var _0x129e30=0x1;var _0x2063c0=[];var _0x10b85b={'context':_0x5706fb[_0x7798('0x4')]||_0x7798('0x5'),'exten':util[_0x7798('0x6')](_0x7798('0x7'),_0x196977[_0x7798('0x8')],_0x234be0),'type':_0x7798('0x9'),'isApp':![],'ChanSpyId':_0x196977['id'],'UserId':_0x5706fb['id']};_0x2063c0[_0x7798('0xa')](_[_0x7798('0xb')]({'app':_0x7798('0xc'),'appdata':util[_0x7798('0x6')]('CDR(type)=%s',_0x7798('0xd')),'priority':_0x129e30++},_0x10b85b));if(_0x196977['record']){_0x2063c0[_0x7798('0xa')](_[_0x7798('0xb')]({'app':'MixMonitor','appdata':util[_0x7798('0x6')](_0x7798('0xe'),_0x196977[_0x7798('0xf')]),'priority':_0x129e30++},_0x10b85b));}if(_0x196977[_0x7798('0x10')]){_0x2063c0['push'](_[_0x7798('0xb')]({'app':'Authenticate','appdata':_0x196977[_0x7798('0x11')],'priority':_0x129e30++},_0x10b85b));}_0x2063c0[_0x7798('0xa')](_['merge']({'app':_0x7798('0x12'),'appdata':util[_0x7798('0x6')]('SIP/%s,%s',_0x5706fb[_0x7798('0x13')],_0x196977[_0x7798('0x14')]?_0x196977[_0x7798('0x14')][_0x7798('0x15')](''):''),'priority':_0x129e30++},_0x10b85b));if(_0x196977[_0x7798('0x16')]){_0x2063c0['push'](_[_0x7798('0xb')]({'app':_0x7798('0x17'),'priority':_0x129e30++},_0x10b85b));}return _0x2063c0;};var getChanSpyApplications=function(_0x5f228a,_0x51fea4){var _0xc1c26b=[];for(var _0x521dac=0x0,_0x5b4b38=0x1;_0x521dac<_0x51fea4[_0x7798('0x18')];_0x521dac++,_0x5b4b38=0x1){_0xc1c26b=_0xc1c26b[_0x7798('0x19')](getUserApplications(_0x5f228a,_0x51fea4[_0x521dac],_0x51fea4[_0x521dac][_0x7798('0x1a')]));if(_0x51fea4[_0x521dac][_0x7798('0x1a')]!=_0x51fea4[_0x521dac][_0x7798('0x13')]){_0xc1c26b=_0xc1c26b[_0x7798('0x19')](getUserApplications(_0x5f228a,_0x51fea4[_0x521dac],_0x51fea4[_0x521dac]['name']));}}return _0xc1c26b;};var getChanSpyPromise=function(_0x1bc634,_0x57bcfa){return new BPromise(function(_0x5bbd59,_0x325b39){return _0x1bc634['User'][_0x7798('0x1b')]({'attributes':['id',_0x7798('0x13'),_0x7798('0x1a')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x7798('0x1c')](function(_0x2375b3){if(_0x2375b3){return _0x5bbd59(getChanSpyApplications(_0x57bcfa,_0x2375b3));}return _0x5bbd59([]);})['catch'](function(_0x31f541){_0x325b39(_0x31f541);});});};module['exports']=function(_0xde52ee,_0x34535e){var _0xaf5bc7=_0xde52ee['models'];return _0xde52ee[_0x7798('0x1d')](_0x7798('0x1e'),attributes,{'tableName':_0x7798('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x8461b8,_0x45cc27,_0x38220b){return getChanSpyPromise(_0xaf5bc7,_0x8461b8)['then'](function(_0x3d61b6){if(_0x3d61b6&&_0x3d61b6[_0x7798('0x18')]){return _0xaf5bc7[_0x7798('0x20')][_0x7798('0x21')](_0x3d61b6);}})[_0x7798('0x1c')](function(){_0x38220b();})[_0x7798('0x22')](function(_0x459ea0){_0x38220b(_0x459ea0);});},'afterUpdate':function(_0x571384,_0x397e94,_0x21ad5f){return _0xaf5bc7[_0x7798('0x20')][_0x7798('0x23')]({'where':{'ChanSpyId':_0x571384['id']}})['then'](function(){return getChanSpyPromise(_0xaf5bc7,_0x571384);})[_0x7798('0x1c')](function(_0x11f399){if(_0x11f399&&_0x11f399[_0x7798('0x18')]){return _0xaf5bc7[_0x7798('0x20')][_0x7798('0x21')](_0x11f399);}})[_0x7798('0x1c')](function(){_0x21ad5f();})[_0x7798('0x22')](function(_0x1fce0e){_0x21ad5f(_0x1fce0e);});},'afterDestroy':function(_0x34161b,_0x4e46ce,_0xdb1306){return _0xaf5bc7[_0x7798('0x20')][_0x7798('0x23')]({'where':{'ChanSpyId':_0x34161b['id']}})[_0x7798('0x1c')](function(){_0xdb1306();})['catch'](function(_0x5378b2){_0xdb1306(_0x5378b2);});}}});};
\ No newline at end of file
+var _0xff84=['User','findAll','agent','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','bulkCreate','VoiceExtension','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal'];(function(_0x435972,_0x2c86e4){var _0x6abd63=function(_0x45dc69){while(--_0x45dc69){_0x435972['push'](_0x435972['shift']());}};_0x6abd63(++_0x2c86e4);}(_0xff84,0x1bb));var _0x4ff8=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xff84[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x4ff8('0x0'));var util=require(_0x4ff8('0x1'));var BPromise=require(_0x4ff8('0x2'));var attributes=require(_0x4ff8('0x3'));var getUserApplications=function(_0x1fbcce,_0xdfe58,_0x4bfca1){var _0x171def=0x1;var _0x19f8c2=[];var _0x4c6cf6={'context':_0xdfe58[_0x4ff8('0x4')]||_0x4ff8('0x5'),'exten':util[_0x4ff8('0x6')](_0x4ff8('0x7'),_0x1fbcce[_0x4ff8('0x8')],_0x4bfca1),'type':_0x4ff8('0x9'),'isApp':![],'ChanSpyId':_0x1fbcce['id'],'UserId':_0xdfe58['id']};_0x19f8c2[_0x4ff8('0xa')](_[_0x4ff8('0xb')]({'app':_0x4ff8('0xc'),'appdata':util[_0x4ff8('0x6')](_0x4ff8('0xd'),_0x4ff8('0xe')),'priority':_0x171def++},_0x4c6cf6));if(_0x1fbcce[_0x4ff8('0xf')]){_0x19f8c2['push'](_[_0x4ff8('0xb')]({'app':_0x4ff8('0x10'),'appdata':util[_0x4ff8('0x6')]('${UNIQUEID}.%s,a',_0x1fbcce[_0x4ff8('0x11')]),'priority':_0x171def++},_0x4c6cf6));}if(_0x1fbcce[_0x4ff8('0x12')]){_0x19f8c2[_0x4ff8('0xa')](_[_0x4ff8('0xb')]({'app':_0x4ff8('0x13'),'appdata':_0x1fbcce[_0x4ff8('0x14')],'priority':_0x171def++},_0x4c6cf6));}_0x19f8c2[_0x4ff8('0xa')](_[_0x4ff8('0xb')]({'app':_0x4ff8('0x15'),'appdata':util[_0x4ff8('0x6')](_0x4ff8('0x16'),_0xdfe58[_0x4ff8('0x17')],_0x1fbcce[_0x4ff8('0x18')]?_0x1fbcce[_0x4ff8('0x18')][_0x4ff8('0x19')](''):''),'priority':_0x171def++},_0x4c6cf6));if(_0x1fbcce['record']){_0x19f8c2[_0x4ff8('0xa')](_[_0x4ff8('0xb')]({'app':_0x4ff8('0x1a'),'priority':_0x171def++},_0x4c6cf6));}return _0x19f8c2;};var getChanSpyApplications=function(_0x277f1c,_0x47ec33){var _0x1c7047=[];for(var _0x5536ab=0x0,_0x140093=0x1;_0x5536ab<_0x47ec33[_0x4ff8('0x1b')];_0x5536ab++,_0x140093=0x1){_0x1c7047=_0x1c7047[_0x4ff8('0x1c')](getUserApplications(_0x277f1c,_0x47ec33[_0x5536ab],_0x47ec33[_0x5536ab][_0x4ff8('0x1d')]));if(_0x47ec33[_0x5536ab][_0x4ff8('0x1d')]!=_0x47ec33[_0x5536ab]['name']){_0x1c7047=_0x1c7047['concat'](getUserApplications(_0x277f1c,_0x47ec33[_0x5536ab],_0x47ec33[_0x5536ab][_0x4ff8('0x17')]));}}return _0x1c7047;};var getChanSpyPromise=function(_0x92d3d0,_0x134d00){return new BPromise(function(_0x80145e,_0x4332f8){return _0x92d3d0[_0x4ff8('0x1e')][_0x4ff8('0x1f')]({'attributes':['id',_0x4ff8('0x17'),'internal'],'where':{'role':_0x4ff8('0x20'),'chanspy':!![]},'raw':!![]})[_0x4ff8('0x21')](function(_0x4cd86c){if(_0x4cd86c){return _0x80145e(getChanSpyApplications(_0x134d00,_0x4cd86c));}return _0x80145e([]);})[_0x4ff8('0x22')](function(_0xf94a13){_0x4332f8(_0xf94a13);});});};module[_0x4ff8('0x23')]=function(_0x5664a6,_0x5249b9){var _0xa3c172=_0x5664a6[_0x4ff8('0x24')];return _0x5664a6[_0x4ff8('0x25')](_0x4ff8('0x26'),attributes,{'tableName':_0x4ff8('0x27'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1b7934,_0x13d905,_0x2be8c7){return getChanSpyPromise(_0xa3c172,_0x1b7934)['then'](function(_0x3a7634){if(_0x3a7634&&_0x3a7634[_0x4ff8('0x1b')]){return _0xa3c172['VoiceExtension'][_0x4ff8('0x28')](_0x3a7634);}})[_0x4ff8('0x21')](function(){_0x2be8c7();})[_0x4ff8('0x22')](function(_0x206452){_0x2be8c7(_0x206452);});},'afterUpdate':function(_0x5945d4,_0x5d41d9,_0x4205b3){return _0xa3c172[_0x4ff8('0x29')][_0x4ff8('0x2a')]({'where':{'ChanSpyId':_0x5945d4['id']}})[_0x4ff8('0x21')](function(){return getChanSpyPromise(_0xa3c172,_0x5945d4);})[_0x4ff8('0x21')](function(_0x5fbcaa){if(_0x5fbcaa&&_0x5fbcaa[_0x4ff8('0x1b')]){return _0xa3c172[_0x4ff8('0x29')][_0x4ff8('0x28')](_0x5fbcaa);}})[_0x4ff8('0x21')](function(){_0x4205b3();})[_0x4ff8('0x22')](function(_0x9fe508){_0x4205b3(_0x9fe508);});},'afterDestroy':function(_0x4a2ac5,_0x13b900,_0x5a4808){return _0xa3c172['VoiceExtension'][_0x4ff8('0x2a')]({'where':{'ChanSpyId':_0x4a2ac5['id']}})[_0x4ff8('0x21')](function(){_0x5a4808();})[_0x4ff8('0x22')](function(_0x256a6c){_0x5a4808(_0x256a6c);});}}});};
\ No newline at end of file
index ce93f11..a7a75cc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e9f=['debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','catch','lodash','util','randomstring','../../config/utils','../../config/environment','jayson/promise','http','then','info','request\x20sent'];(function(_0x5b3b9b,_0x1c71b0){var _0x47c1d7=function(_0x34c20b){while(--_0x34c20b){_0x5b3b9b['push'](_0x5b3b9b['shift']());}};_0x47c1d7(++_0x1c71b0);}(_0x0e9f,0x116));var _0xf0e9=function(_0x32554e,_0x2e45fa){_0x32554e=_0x32554e-0x0;var _0x398088=_0x0e9f[_0x32554e];return _0x398088;};'use strict';var _=require(_0xf0e9('0x0'));var util=require(_0xf0e9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf0e9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf0e9('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xf0e9('0x4'));var jayson=require(_0xf0e9('0x5'));var client=jayson['client'][_0xf0e9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4a35a3,_0x3f9792,_0x2fa08f){return new BPromise(function(_0x106ba0,_0x58edfe){return client['request'](_0x4a35a3,_0x2fa08f)[_0xf0e9('0x7')](function(_0x7b3146){logger[_0xf0e9('0x8')]('VoiceChanSpy,\x20%s,\x20%s',_0x3f9792,_0xf0e9('0x9'));logger[_0xf0e9('0xa')](_0xf0e9('0xb'),_0x3f9792,'request\x20sent',JSON[_0xf0e9('0xc')](_0x7b3146));if(_0x7b3146[_0xf0e9('0xd')]){if(_0x7b3146[_0xf0e9('0xd')][_0xf0e9('0xe')]===0x1f4){logger['error'](_0xf0e9('0xf'),_0x3f9792,_0x7b3146['error'][_0xf0e9('0x10')]);return _0x58edfe(_0x7b3146[_0xf0e9('0xd')]['message']);}logger[_0xf0e9('0xd')](_0xf0e9('0xf'),_0x3f9792,_0x7b3146[_0xf0e9('0xd')][_0xf0e9('0x10')]);return _0x106ba0(_0x7b3146[_0xf0e9('0xd')][_0xf0e9('0x10')]);}else{logger['info'](_0xf0e9('0xf'),_0x3f9792,_0xf0e9('0x9'));_0x106ba0(_0x7b3146['result'][_0xf0e9('0x10')]);}})[_0xf0e9('0x11')](function(_0x3d0b4d){logger[_0xf0e9('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x3f9792,_0x3d0b4d);_0x58edfe(_0x3d0b4d);});});}
\ No newline at end of file
+var _0xbb53=['http','then','info','request\x20sent','stringify','error','message','VoiceChanSpy,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0xbb53,0x121));var _0x3bb5=function(_0x1d2302,_0xab1d9b){_0x1d2302=_0x1d2302-0x0;var _0xb02a65=_0xbb53[_0x1d2302];return _0xb02a65;};'use strict';var _=require(_0x3bb5('0x0'));var util=require(_0x3bb5('0x1'));var moment=require(_0x3bb5('0x2'));var BPromise=require(_0x3bb5('0x3'));var rs=require(_0x3bb5('0x4'));var fs=require('fs');var Redis=require(_0x3bb5('0x5'));var db=require(_0x3bb5('0x6'))['db'];var utils=require(_0x3bb5('0x7'));var logger=require(_0x3bb5('0x8'))(_0x3bb5('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3bb5('0xa')][_0x3bb5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28aa7d,_0x157e04,_0x22f92f){return new BPromise(function(_0x480f9c,_0x5a4ae3){return client['request'](_0x28aa7d,_0x22f92f)[_0x3bb5('0xc')](function(_0x2e0cfa){logger[_0x3bb5('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x157e04,_0x3bb5('0xe'));logger['debug']('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x157e04,_0x3bb5('0xe'),JSON[_0x3bb5('0xf')](_0x2e0cfa));if(_0x2e0cfa['error']){if(_0x2e0cfa[_0x3bb5('0x10')]['code']===0x1f4){logger[_0x3bb5('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x157e04,_0x2e0cfa['error'][_0x3bb5('0x11')]);return _0x5a4ae3(_0x2e0cfa[_0x3bb5('0x10')][_0x3bb5('0x11')]);}logger['error'](_0x3bb5('0x12'),_0x157e04,_0x2e0cfa[_0x3bb5('0x10')]['message']);return _0x480f9c(_0x2e0cfa[_0x3bb5('0x10')][_0x3bb5('0x11')]);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x157e04,'request\x20sent');_0x480f9c(_0x2e0cfa[_0x3bb5('0x13')][_0x3bb5('0x11')]);}})['catch'](function(_0x25d774){logger[_0x3bb5('0x10')](_0x3bb5('0x12'),_0x157e04,_0x25d774);_0x5a4ae3(_0x25d774);});});}
\ No newline at end of file
index 59cf23b..8409a72 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3efd=['/:id','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','isAuthenticated','show','post','create','put'];(function(_0x55085e,_0x17afe8){var _0x3b2383=function(_0x23d670){while(--_0x23d670){_0x55085e['push'](_0x55085e['shift']());}};_0x3b2383(++_0x17afe8);}(_0x3efd,0x155));var _0xd3ef=function(_0x45f032,_0x37f3b5){_0x45f032=_0x45f032-0x0;var _0x3b5a0e=_0x3efd[_0x45f032];return _0x3b5a0e;};'use strict';var multer=require('multer');var util=require(_0xd3ef('0x0'));var path=require(_0xd3ef('0x1'));var timeout=require(_0xd3ef('0x2'));var express=require(_0xd3ef('0x3'));var router=express['Router']();var fs_extra=require(_0xd3ef('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd3ef('0x5'));var config=require('../../config/environment');var controller=require('./voiceContext.controller');router['get']('/',auth[_0xd3ef('0x6')](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xd3ef('0x7')]);router[_0xd3ef('0x8')]('/',auth[_0xd3ef('0x6')](),controller[_0xd3ef('0x9')]);router[_0xd3ef('0xa')](_0xd3ef('0xb'),auth[_0xd3ef('0x6')](),controller[_0xd3ef('0xc')]);router[_0xd3ef('0xd')](_0xd3ef('0xb'),auth[_0xd3ef('0x6')](),controller[_0xd3ef('0xe')]);module[_0xd3ef('0xf')]=router;
\ No newline at end of file
+var _0x07d6=['path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util'];(function(_0x26eafb,_0x10945c){var _0x5c35c0=function(_0x4df871){while(--_0x4df871){_0x26eafb['push'](_0x26eafb['shift']());}};_0x5c35c0(++_0x10945c);}(_0x07d6,0xa9));var _0x607d=function(_0x51816f,_0x11677e){_0x51816f=_0x51816f-0x0;var _0x41b781=_0x07d6[_0x51816f];return _0x41b781;};'use strict';var multer=require(_0x607d('0x0'));var util=require(_0x607d('0x1'));var path=require(_0x607d('0x2'));var timeout=require(_0x607d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x607d('0x4'));var auth=require(_0x607d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x607d('0x6'));var controller=require(_0x607d('0x7'));router[_0x607d('0x8')]('/',auth[_0x607d('0x9')](),controller[_0x607d('0xa')]);router[_0x607d('0x8')](_0x607d('0xb'),auth[_0x607d('0x9')](),controller[_0x607d('0xc')]);router[_0x607d('0xd')]('/',auth['isAuthenticated'](),controller[_0x607d('0xe')]);router['put'](_0x607d('0xb'),auth[_0x607d('0x9')](),controller[_0x607d('0xf')]);router[_0x607d('0x10')](_0x607d('0xb'),auth[_0x607d('0x9')](),controller[_0x607d('0x11')]);module[_0x607d('0x12')]=router;
\ No newline at end of file
index 1f537d8..9d5be55 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee96=['BOOLEAN','sequelize','exports','STRING'];(function(_0x8a6b9a,_0x2653ea){var _0x2c296a=function(_0x99c4ab){while(--_0x99c4ab){_0x8a6b9a['push'](_0x8a6b9a['shift']());}};_0x2c296a(++_0x2653ea);}(_0xee96,0xbd));var _0x6ee9=function(_0x5d59d3,_0x9b4d49){_0x5d59d3=_0x5d59d3-0x0;var _0x451fd7=_0xee96[_0x5d59d3];return _0x451fd7;};'use strict';var Sequelize=require(_0x6ee9('0x0'));module[_0x6ee9('0x1')]={'name':{'type':Sequelize[_0x6ee9('0x2')],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x6ee9('0x3')],'defaultValue':0x0}};
\ No newline at end of file
+var _0x32df=['name','BOOLEAN','sequelize','exports'];(function(_0x3872f3,_0x3471f3){var _0x22de38=function(_0x5dc034){while(--_0x5dc034){_0x3872f3['push'](_0x3872f3['shift']());}};_0x22de38(++_0x3471f3);}(_0x32df,0x13a));var _0xf32d=function(_0x1e8a37,_0x1a7cd9){_0x1e8a37=_0x1e8a37-0x0;var _0x40b851=_0x32df[_0x1e8a37];return _0x40b851;};'use strict';var Sequelize=require(_0xf32d('0x0'));module[_0xf32d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xf32d('0x2')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xf32d('0x3')],'defaultValue':0x0}};
\ No newline at end of file
index 4ddf894..fa41748 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeda7=['utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Contexts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','limit','undefined','count','set','apply','reject','update','destroy','get','UserProfileResource','sendStatus','send','index','map','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VoiceContext','includeAll','include','rows','show','options','find','create','body','findAll','readFileSync','join','root','server/files/templates/context.ejs'];(function(_0x187907,_0x524178){var _0x215f4b=function(_0x304323){while(--_0x304323){_0x187907['push'](_0x187907['shift']());}};_0x215f4b(++_0x524178);}(_0xeda7,0x1bb));var _0x7eda=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0xeda7[_0x11ce46];return _0x368a1e;};'use strict';var emlformat=require(_0x7eda('0x0'));var rimraf=require(_0x7eda('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7eda('0x2'));var rp=require(_0x7eda('0x3'));var moment=require('moment');var BPromise=require(_0x7eda('0x4'));var Mustache=require(_0x7eda('0x5'));var util=require(_0x7eda('0x6'));var path=require(_0x7eda('0x7'));var sox=require(_0x7eda('0x8'));var csv=require('to-csv');var ejs=require(_0x7eda('0x9'));var fs=require('fs');var fs_extra=require(_0x7eda('0xa'));var _=require(_0x7eda('0xb'));var squel=require(_0x7eda('0xc'));var crypto=require(_0x7eda('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7eda('0xe'));var toCsv=require(_0x7eda('0xf'));var querystring=require(_0x7eda('0x10'));var Papa=require('papaparse');var Redis=require(_0x7eda('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7eda('0x12'));var as=require(_0x7eda('0x13'));var hardwareService=require(_0x7eda('0x14'));var logger=require('../../config/logger')(_0x7eda('0x15'));var utils=require(_0x7eda('0x16'));var config=require(_0x7eda('0x17'));var licenseUtil=require(_0x7eda('0x18'));var db=require(_0x7eda('0x19'))['db'];var jayson=require(_0x7eda('0x1a'));var client=jayson[_0x7eda('0x1b')][_0x7eda('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x5cf08f,_0x5c7557,_0x321a18,_0x50ee20){return new BPromise(function(_0x21b282,_0x2641a0){var _0x3436ee=_0x50ee20||client;return _0x3436ee[_0x7eda('0x1d')](_0x5cf08f,_0x321a18)[_0x7eda('0x1e')](function(_0x13167a){logger[_0x7eda('0x1f')](_0x7eda('0x20'),_0x5c7557,_0x7eda('0x21'));logger[_0x7eda('0x22')](_0x7eda('0x23'),_0x5c7557,'request\x20sent',JSON[_0x7eda('0x24')](_0x13167a));if(_0x13167a[_0x7eda('0x25')]){if(_0x13167a[_0x7eda('0x25')][_0x7eda('0x26')]===0x1f4){logger[_0x7eda('0x25')]('VoiceContext,\x20%s,\x20%s',_0x5c7557,_0x13167a[_0x7eda('0x25')][_0x7eda('0x27')]);return _0x2641a0(_0x13167a[_0x7eda('0x25')][_0x7eda('0x27')]);}logger['error'](_0x7eda('0x20'),_0x5c7557,_0x13167a[_0x7eda('0x25')][_0x7eda('0x27')]);return _0x21b282(_0x13167a[_0x7eda('0x25')]['message']);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x5c7557,_0x7eda('0x21'));_0x21b282(_0x13167a[_0x7eda('0x28')]['message']);}})[_0x7eda('0x29')](function(_0x26eadc){logger[_0x7eda('0x25')](_0x7eda('0x20'),_0x5c7557,_0x26eadc);_0x2641a0(_0x26eadc);});});}function respondWithStatusCode(_0x4f9ceb,_0x58d654){_0x58d654=_0x58d654||0xcc;return function(_0x4e62de){if(_0x4e62de){return _0x4f9ceb['sendStatus'](_0x58d654);}return _0x4f9ceb[_0x7eda('0x2a')](_0x58d654)[_0x7eda('0x2b')]();};}function respondWithResult(_0x381210,_0x35bd90){_0x35bd90=_0x35bd90||0xc8;return function(_0x1b498d){if(_0x1b498d){return _0x381210[_0x7eda('0x2a')](_0x35bd90)[_0x7eda('0x2c')](_0x1b498d);}};}function respondWithFilteredResult(_0x175500,_0x1e15c0){return function(_0x3f6656){if(_0x3f6656){var _0x5674f8=typeof _0x1e15c0[_0x7eda('0x2d')]==='undefined'&&typeof _0x1e15c0[_0x7eda('0x2e')]===_0x7eda('0x2f');var _0x311748=_0x3f6656[_0x7eda('0x30')];var _0x58aa13=_0x5674f8?0x0:_0x1e15c0[_0x7eda('0x2d')];var _0x4a56c7=_0x5674f8?_0x3f6656[_0x7eda('0x30')]:_0x1e15c0[_0x7eda('0x2d')]+_0x1e15c0[_0x7eda('0x2e')];var _0x508d66;if(_0x4a56c7>=_0x311748){_0x4a56c7=_0x311748;_0x508d66=0xc8;}else{_0x508d66=0xce;}_0x175500[_0x7eda('0x2a')](_0x508d66);return _0x175500[_0x7eda('0x31')]('Content-Range',_0x58aa13+'-'+_0x4a56c7+'/'+_0x311748)[_0x7eda('0x2c')](_0x3f6656);}return null;};}function patchUpdates(_0x4e52f9){return function(_0x28bd78){try{jsonpatch[_0x7eda('0x32')](_0x28bd78,_0x4e52f9,!![]);}catch(_0x3e99ca){return BPromise[_0x7eda('0x33')](_0x3e99ca);}return _0x28bd78['save']();};}function saveUpdates(_0x4d307a,_0x376700){return function(_0x539a68){if(_0x539a68){return _0x539a68[_0x7eda('0x34')](_0x4d307a)[_0x7eda('0x1e')](function(_0x253701){return _0x253701;});}return null;};}function removeEntity(_0x1e24b6,_0x51ca81){return function(_0x4d5654){if(_0x4d5654){return _0x4d5654[_0x7eda('0x35')]()[_0x7eda('0x1e')](function(){var _0x13e1af=_0x4d5654[_0x7eda('0x36')]({'plain':!![]});var _0xdccdc4='Contexts';return db[_0x7eda('0x37')][_0x7eda('0x35')]({'where':{'type':_0xdccdc4,'resourceId':_0x13e1af['id']}})['then'](function(){return _0x4d5654;});})[_0x7eda('0x1e')](function(){_0x1e24b6[_0x7eda('0x2a')](0xcc)[_0x7eda('0x2b')]();});}};}function handleEntityNotFound(_0xcd23c2,_0x465b28){return function(_0x244e5d){if(!_0x244e5d){_0xcd23c2[_0x7eda('0x38')](0x194);}return _0x244e5d;};}function handleError(_0x5058ad,_0x1f44d2){_0x1f44d2=_0x1f44d2||0x1f4;return function(_0x114512){logger[_0x7eda('0x25')](_0x114512['stack']);if(_0x114512['name']){delete _0x114512['name'];}_0x5058ad['status'](_0x1f44d2)[_0x7eda('0x39')](_0x114512);};}exports[_0x7eda('0x3a')]=function(_0x55c615,_0x26b131){var _0x419993={},_0x130f2a={},_0x59c927={'count':0x0,'rows':[]};var _0x46f9fd=_[_0x7eda('0x3b')](db['VoiceContext'][_0x7eda('0x3c')],function(_0x54a7bc){return{'name':_0x54a7bc[_0x7eda('0x3d')],'type':_0x54a7bc[_0x7eda('0x3e')]['key']};});_0x130f2a[_0x7eda('0x3f')]=_[_0x7eda('0x3b')](_0x46f9fd,_0x7eda('0x40'));_0x130f2a[_0x7eda('0x41')]=_[_0x7eda('0x42')](_0x55c615[_0x7eda('0x41')]);_0x130f2a[_0x7eda('0x43')]=_[_0x7eda('0x44')](_0x130f2a[_0x7eda('0x3f')],_0x130f2a['query']);_0x419993[_0x7eda('0x45')]=_[_0x7eda('0x44')](_0x130f2a[_0x7eda('0x3f')],qs[_0x7eda('0x46')](_0x55c615[_0x7eda('0x41')][_0x7eda('0x46')]));_0x419993[_0x7eda('0x45')]=_0x419993[_0x7eda('0x45')][_0x7eda('0x47')]?_0x419993['attributes']:_0x130f2a[_0x7eda('0x3f')];if(!_0x55c615[_0x7eda('0x41')][_0x7eda('0x48')](_0x7eda('0x49'))){_0x419993[_0x7eda('0x2e')]=qs[_0x7eda('0x2e')](_0x55c615['query'][_0x7eda('0x2e')]);_0x419993[_0x7eda('0x2d')]=qs[_0x7eda('0x2d')](_0x55c615[_0x7eda('0x41')][_0x7eda('0x2d')]);}_0x419993['order']=qs[_0x7eda('0x4a')](_0x55c615[_0x7eda('0x41')][_0x7eda('0x4a')]);_0x419993[_0x7eda('0x4b')]=qs[_0x7eda('0x43')](_['pick'](_0x55c615[_0x7eda('0x41')],_0x130f2a[_0x7eda('0x43')]),_0x46f9fd);if(_0x55c615[_0x7eda('0x41')][_0x7eda('0x4c')]){_0x419993[_0x7eda('0x4b')]=_[_0x7eda('0x4d')](_0x419993[_0x7eda('0x4b')],{'$or':_['map'](_0x46f9fd,function(_0x9c46e7){if(_0x9c46e7[_0x7eda('0x3e')]!=='VIRTUAL'){var _0x5c8906={};_0x5c8906[_0x9c46e7[_0x7eda('0x40')]]={'$like':'%'+_0x55c615[_0x7eda('0x41')]['filter']+'%'};return _0x5c8906;}})});}_0x419993=_[_0x7eda('0x4d')]({},_0x419993,_0x55c615['options']);var _0x16177a={'where':_0x419993[_0x7eda('0x4b')]};return db[_0x7eda('0x4e')][_0x7eda('0x30')](_0x16177a)[_0x7eda('0x1e')](function(_0x1b0464){_0x59c927[_0x7eda('0x30')]=_0x1b0464;if(_0x55c615[_0x7eda('0x41')][_0x7eda('0x4f')]){_0x419993[_0x7eda('0x50')]=[{'all':!![]}];}return db['VoiceContext']['findAll'](_0x419993);})[_0x7eda('0x1e')](function(_0x3e1558){_0x59c927[_0x7eda('0x51')]=_0x3e1558;return _0x59c927;})[_0x7eda('0x1e')](respondWithFilteredResult(_0x26b131,_0x419993))[_0x7eda('0x29')](handleError(_0x26b131,null));};exports[_0x7eda('0x52')]=function(_0x24f448,_0x21f4e5){var _0x4ee8ed={'raw':![],'where':{'id':_0x24f448['params']['id']}},_0x2762a1={};_0x2762a1[_0x7eda('0x3f')]=_['keys'](db['VoiceContext'][_0x7eda('0x3c')]);_0x2762a1['query']=_['keys'](_0x24f448[_0x7eda('0x41')]);_0x2762a1[_0x7eda('0x43')]=_[_0x7eda('0x44')](_0x2762a1['model'],_0x2762a1[_0x7eda('0x41')]);_0x4ee8ed[_0x7eda('0x45')]=_[_0x7eda('0x44')](_0x2762a1[_0x7eda('0x3f')],qs[_0x7eda('0x46')](_0x24f448[_0x7eda('0x41')]['fields']));_0x4ee8ed[_0x7eda('0x45')]=_0x4ee8ed[_0x7eda('0x45')][_0x7eda('0x47')]?_0x4ee8ed['attributes']:_0x2762a1['model'];if(_0x24f448[_0x7eda('0x41')][_0x7eda('0x4f')]){_0x4ee8ed['include']=[{'all':!![]}];}_0x4ee8ed=_[_0x7eda('0x4d')]({},_0x4ee8ed,_0x24f448[_0x7eda('0x53')]);return db[_0x7eda('0x4e')][_0x7eda('0x54')](_0x4ee8ed)[_0x7eda('0x1e')](handleEntityNotFound(_0x21f4e5,null))[_0x7eda('0x1e')](respondWithResult(_0x21f4e5,null))[_0x7eda('0x29')](handleError(_0x21f4e5,null));};exports[_0x7eda('0x55')]=function(_0x314950,_0x5b2fb8,_0x239d6a){var _0x28c134;return db[_0x7eda('0x4e')][_0x7eda('0x55')](_0x314950[_0x7eda('0x56')],{'raw':!![]})[_0x7eda('0x1e')](function(_0x11a5ea){_0x28c134=_0x11a5ea;return db[_0x7eda('0x4e')][_0x7eda('0x57')]({'raw':!![]});})['then'](function(_0x313d14){var _0x5d0e4a=fs[_0x7eda('0x58')](path[_0x7eda('0x59')](config[_0x7eda('0x5a')],_0x7eda('0x5b')),_0x7eda('0x5c'));var _0x223de6=ejs[_0x7eda('0x5d')](_0x5d0e4a,{'contexts':_0x313d14||[]});fs[_0x7eda('0x5e')](_0x7eda('0x5f'),_0x223de6);})[_0x7eda('0x1e')](function(){return respondWithRpcPromise(_0x7eda('0x60'),_0x7eda('0x55'),{'module':_0x7eda('0x61')});})[_0x7eda('0x1e')](function(){var _0x3abc35=_0x314950[_0x7eda('0x62')][_0x7eda('0x36')]({'plain':!![]});if(!_0x3abc35)throw new Error(_0x7eda('0x63'));if(_0x3abc35[_0x7eda('0x64')]===_0x7eda('0x62')){var _0x1d80f3=_0x28c134[_0x7eda('0x36')]({'plain':!![]});return db[_0x7eda('0x65')][_0x7eda('0x54')]({'where':{'name':_0x7eda('0x66'),'userProfileId':_0x3abc35[_0x7eda('0x67')]},'raw':!![]})['then'](function(_0x3b91af){if(_0x3b91af&&_0x3b91af[_0x7eda('0x68')]===0x0){return db[_0x7eda('0x37')][_0x7eda('0x55')]({'name':_0x1d80f3[_0x7eda('0x40')],'resourceId':_0x1d80f3['id'],'type':_0x3b91af[_0x7eda('0x40')],'sectionId':_0x3b91af['id']},{})[_0x7eda('0x1e')](function(){return _0x28c134;});}else{return _0x28c134;}})['catch'](function(_0x4e8b9e){logger['error'](_0x7eda('0x69'),_0x4e8b9e);throw _0x4e8b9e;});}return _0x28c134;})[_0x7eda('0x1e')](respondWithResult(_0x5b2fb8,0xc9))[_0x7eda('0x29')](handleError(_0x5b2fb8,null));};exports['update']=function(_0x1998d6,_0x5afc15,_0x3c6f8c){var _0x1d1559;return db[_0x7eda('0x4e')][_0x7eda('0x54')]({'where':{'id':_0x1998d6['params']['id']}})['then'](handleEntityNotFound(_0x5afc15,null))[_0x7eda('0x1e')](saveUpdates(_0x1998d6['body'],null))['then'](function(_0x3f319c){if(_0x3f319c){_0x1d1559=_0x3f319c;return db[_0x7eda('0x4e')][_0x7eda('0x57')]({'raw':!![]});}})[_0x7eda('0x1e')](function(_0x188a32){var _0x52b4e1=fs[_0x7eda('0x58')](path['join'](config[_0x7eda('0x5a')],_0x7eda('0x5b')),'utf8');var _0x4d0deb=ejs[_0x7eda('0x5d')](_0x52b4e1,{'contexts':_0x188a32||[]});fs[_0x7eda('0x5e')](_0x7eda('0x5f'),_0x4d0deb);})[_0x7eda('0x1e')](function(){return respondWithRpcPromise(_0x7eda('0x60'),_0x7eda('0x34'),{'module':_0x7eda('0x61')});})[_0x7eda('0x1e')](function(){return _0x1d1559;})[_0x7eda('0x1e')](respondWithResult(_0x5afc15,null))[_0x7eda('0x29')](handleError(_0x5afc15,null));};exports[_0x7eda('0x35')]=function(_0x61f774,_0x167d09,_0xdb4033){var _0x52ee48;return db[_0x7eda('0x4e')][_0x7eda('0x54')]({'where':{'id':_0x61f774[_0x7eda('0x6a')]['id']}})['then'](handleEntityNotFound(_0x167d09,null))[_0x7eda('0x1e')](removeEntity(_0x167d09,null))[_0x7eda('0x1e')](function(){return db[_0x7eda('0x4e')]['findAll']({'raw':!![]});})[_0x7eda('0x1e')](function(_0x3f5bda){var _0x4d87e5=fs[_0x7eda('0x58')](path[_0x7eda('0x59')](config['root'],_0x7eda('0x5b')),'utf8');var _0x4dab12=ejs[_0x7eda('0x5d')](_0x4d87e5,{'contexts':_0x3f5bda});fs[_0x7eda('0x5e')](_0x7eda('0x5f'),_0x4dab12);return respondWithRpcPromise('Reload',_0x7eda('0x35'),{'module':_0x7eda('0x61')});})[_0x7eda('0x29')](handleError(_0x167d09,null));};
\ No newline at end of file
+var _0x2222=['create','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','Reload','readFileSync','chan_sip.so','eml-format','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','destroy','get','Contexts','end','sendStatus','stack','name','send','index','map','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','sort','pick','filter','merge','where','VIRTUAL','options','VoiceContext','includeAll','include','findAll','rows','show','params'];(function(_0x427c3f,_0x3d0ef7){var _0x2409b8=function(_0x122ec6){while(--_0x122ec6){_0x427c3f['push'](_0x427c3f['shift']());}};_0x2409b8(++_0x3d0ef7);}(_0x2222,0xe3));var _0x2222=function(_0x4bdfb7,_0x1639a6){_0x4bdfb7=_0x4bdfb7-0x0;var _0x175d1c=_0x2222[_0x4bdfb7];return _0x175d1c;};'use strict';var emlformat=require(_0x2222('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2222('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2222('0x2'));var moment=require(_0x2222('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2222('0x4'));var util=require(_0x2222('0x5'));var path=require('path');var sox=require(_0x2222('0x6'));var csv=require(_0x2222('0x7'));var ejs=require(_0x2222('0x8'));var fs=require('fs');var fs_extra=require(_0x2222('0x9'));var _=require('lodash');var squel=require(_0x2222('0xa'));var crypto=require(_0x2222('0xb'));var jsforce=require(_0x2222('0xc'));var deskjs=require(_0x2222('0xd'));var toCsv=require(_0x2222('0x7'));var querystring=require(_0x2222('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2222('0xf'));var qs=require(_0x2222('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x2222('0x11'))(_0x2222('0x12'));var utils=require(_0x2222('0x13'));var config=require(_0x2222('0x14'));var licenseUtil=require(_0x2222('0x15'));var db=require(_0x2222('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x2222('0x17')][_0x2222('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x748871,_0x4b7041,_0x399784,_0x5c9d0a){return new BPromise(function(_0x577b39,_0x3485c9){var _0x493aa8=_0x5c9d0a||client;return _0x493aa8[_0x2222('0x19')](_0x748871,_0x399784)[_0x2222('0x1a')](function(_0x537126){logger['info'](_0x2222('0x1b'),_0x4b7041,_0x2222('0x1c'));logger[_0x2222('0x1d')](_0x2222('0x1e'),_0x4b7041,'request\x20sent',JSON[_0x2222('0x1f')](_0x537126));if(_0x537126[_0x2222('0x20')]){if(_0x537126['error'][_0x2222('0x21')]===0x1f4){logger[_0x2222('0x20')]('VoiceContext,\x20%s,\x20%s',_0x4b7041,_0x537126['error'][_0x2222('0x22')]);return _0x3485c9(_0x537126[_0x2222('0x20')][_0x2222('0x22')]);}logger['error'](_0x2222('0x1b'),_0x4b7041,_0x537126[_0x2222('0x20')][_0x2222('0x22')]);return _0x577b39(_0x537126[_0x2222('0x20')][_0x2222('0x22')]);}else{logger[_0x2222('0x23')](_0x2222('0x1b'),_0x4b7041,'request\x20sent');_0x577b39(_0x537126[_0x2222('0x24')][_0x2222('0x22')]);}})[_0x2222('0x25')](function(_0xe2880d){logger[_0x2222('0x20')]('VoiceContext,\x20%s,\x20%s',_0x4b7041,_0xe2880d);_0x3485c9(_0xe2880d);});});}function respondWithStatusCode(_0x46d996,_0x49042b){_0x49042b=_0x49042b||0xcc;return function(_0x55924b){if(_0x55924b){return _0x46d996['sendStatus'](_0x49042b);}return _0x46d996[_0x2222('0x26')](_0x49042b)['end']();};}function respondWithResult(_0x41b24f,_0x651a29){_0x651a29=_0x651a29||0xc8;return function(_0x43b68d){if(_0x43b68d){return _0x41b24f['status'](_0x651a29)['json'](_0x43b68d);}};}function respondWithFilteredResult(_0x4c2c7b,_0x22f07e){return function(_0x341e49){if(_0x341e49){var _0x1f4e71=typeof _0x22f07e[_0x2222('0x27')]===_0x2222('0x28')&&typeof _0x22f07e[_0x2222('0x29')]==='undefined';var _0x4831ba=_0x341e49[_0x2222('0x2a')];var _0x4bfcbd=_0x1f4e71?0x0:_0x22f07e[_0x2222('0x27')];var _0x3f0442=_0x1f4e71?_0x341e49[_0x2222('0x2a')]:_0x22f07e[_0x2222('0x27')]+_0x22f07e[_0x2222('0x29')];var _0x455f3b;if(_0x3f0442>=_0x4831ba){_0x3f0442=_0x4831ba;_0x455f3b=0xc8;}else{_0x455f3b=0xce;}_0x4c2c7b[_0x2222('0x26')](_0x455f3b);return _0x4c2c7b[_0x2222('0x2b')](_0x2222('0x2c'),_0x4bfcbd+'-'+_0x3f0442+'/'+_0x4831ba)[_0x2222('0x2d')](_0x341e49);}return null;};}function patchUpdates(_0x2b9f03){return function(_0xa678a9){try{jsonpatch[_0x2222('0x2e')](_0xa678a9,_0x2b9f03,!![]);}catch(_0x467dec){return BPromise['reject'](_0x467dec);}return _0xa678a9[_0x2222('0x2f')]();};}function saveUpdates(_0x2112d7,_0x141103){return function(_0x3d55e0){if(_0x3d55e0){return _0x3d55e0['update'](_0x2112d7)['then'](function(_0x358e41){return _0x358e41;});}return null;};}function removeEntity(_0x5af71c,_0x153835){return function(_0x26c859){if(_0x26c859){return _0x26c859[_0x2222('0x30')]()[_0x2222('0x1a')](function(){var _0x345c49=_0x26c859[_0x2222('0x31')]({'plain':!![]});var _0xd0875a=_0x2222('0x32');return db['UserProfileResource'][_0x2222('0x30')]({'where':{'type':_0xd0875a,'resourceId':_0x345c49['id']}})[_0x2222('0x1a')](function(){return _0x26c859;});})['then'](function(){_0x5af71c[_0x2222('0x26')](0xcc)[_0x2222('0x33')]();});}};}function handleEntityNotFound(_0xb9eda9,_0x47c115){return function(_0x426074){if(!_0x426074){_0xb9eda9[_0x2222('0x34')](0x194);}return _0x426074;};}function handleError(_0x17278f,_0xbcf973){_0xbcf973=_0xbcf973||0x1f4;return function(_0xefabbc){logger['error'](_0xefabbc[_0x2222('0x35')]);if(_0xefabbc[_0x2222('0x36')]){delete _0xefabbc[_0x2222('0x36')];}_0x17278f[_0x2222('0x26')](_0xbcf973)[_0x2222('0x37')](_0xefabbc);};}exports[_0x2222('0x38')]=function(_0x3b446a,_0x379cc2){var _0x52790d={},_0x4aef86={},_0x3ee5d2={'count':0x0,'rows':[]};var _0x536b71=_[_0x2222('0x39')](db['VoiceContext']['rawAttributes'],function(_0x1685f9){return{'name':_0x1685f9[_0x2222('0x3a')],'type':_0x1685f9[_0x2222('0x3b')]['key']};});_0x4aef86[_0x2222('0x3c')]=_[_0x2222('0x39')](_0x536b71,_0x2222('0x36'));_0x4aef86[_0x2222('0x3d')]=_[_0x2222('0x3e')](_0x3b446a['query']);_0x4aef86[_0x2222('0x3f')]=_[_0x2222('0x40')](_0x4aef86[_0x2222('0x3c')],_0x4aef86[_0x2222('0x3d')]);_0x52790d[_0x2222('0x41')]=_[_0x2222('0x40')](_0x4aef86[_0x2222('0x3c')],qs[_0x2222('0x42')](_0x3b446a['query'][_0x2222('0x42')]));_0x52790d[_0x2222('0x41')]=_0x52790d[_0x2222('0x41')][_0x2222('0x43')]?_0x52790d['attributes']:_0x4aef86[_0x2222('0x3c')];if(!_0x3b446a[_0x2222('0x3d')]['hasOwnProperty']('nolimit')){_0x52790d['limit']=qs[_0x2222('0x29')](_0x3b446a[_0x2222('0x3d')]['limit']);_0x52790d['offset']=qs['offset'](_0x3b446a['query'][_0x2222('0x27')]);}_0x52790d['order']=qs[_0x2222('0x44')](_0x3b446a['query'][_0x2222('0x44')]);_0x52790d['where']=qs['filters'](_[_0x2222('0x45')](_0x3b446a[_0x2222('0x3d')],_0x4aef86['filters']),_0x536b71);if(_0x3b446a[_0x2222('0x3d')][_0x2222('0x46')]){_0x52790d['where']=_[_0x2222('0x47')](_0x52790d[_0x2222('0x48')],{'$or':_['map'](_0x536b71,function(_0x4be6cb){if(_0x4be6cb['type']!==_0x2222('0x49')){var _0x509541={};_0x509541[_0x4be6cb[_0x2222('0x36')]]={'$like':'%'+_0x3b446a[_0x2222('0x3d')][_0x2222('0x46')]+'%'};return _0x509541;}})});}_0x52790d=_[_0x2222('0x47')]({},_0x52790d,_0x3b446a[_0x2222('0x4a')]);var _0x2e57be={'where':_0x52790d['where']};return db[_0x2222('0x4b')][_0x2222('0x2a')](_0x2e57be)[_0x2222('0x1a')](function(_0x1f3c07){_0x3ee5d2['count']=_0x1f3c07;if(_0x3b446a[_0x2222('0x3d')][_0x2222('0x4c')]){_0x52790d[_0x2222('0x4d')]=[{'all':!![]}];}return db['VoiceContext'][_0x2222('0x4e')](_0x52790d);})[_0x2222('0x1a')](function(_0x9794b0){_0x3ee5d2[_0x2222('0x4f')]=_0x9794b0;return _0x3ee5d2;})[_0x2222('0x1a')](respondWithFilteredResult(_0x379cc2,_0x52790d))[_0x2222('0x25')](handleError(_0x379cc2,null));};exports[_0x2222('0x50')]=function(_0xddfd85,_0xb6a21d){var _0x4a6af6={'raw':![],'where':{'id':_0xddfd85[_0x2222('0x51')]['id']}},_0x1bad07={};_0x1bad07[_0x2222('0x3c')]=_[_0x2222('0x3e')](db[_0x2222('0x4b')]['rawAttributes']);_0x1bad07[_0x2222('0x3d')]=_[_0x2222('0x3e')](_0xddfd85[_0x2222('0x3d')]);_0x1bad07[_0x2222('0x3f')]=_[_0x2222('0x40')](_0x1bad07[_0x2222('0x3c')],_0x1bad07[_0x2222('0x3d')]);_0x4a6af6[_0x2222('0x41')]=_[_0x2222('0x40')](_0x1bad07[_0x2222('0x3c')],qs[_0x2222('0x42')](_0xddfd85[_0x2222('0x3d')][_0x2222('0x42')]));_0x4a6af6[_0x2222('0x41')]=_0x4a6af6['attributes'][_0x2222('0x43')]?_0x4a6af6[_0x2222('0x41')]:_0x1bad07[_0x2222('0x3c')];if(_0xddfd85[_0x2222('0x3d')][_0x2222('0x4c')]){_0x4a6af6[_0x2222('0x4d')]=[{'all':!![]}];}_0x4a6af6=_[_0x2222('0x47')]({},_0x4a6af6,_0xddfd85[_0x2222('0x4a')]);return db[_0x2222('0x4b')]['find'](_0x4a6af6)[_0x2222('0x1a')](handleEntityNotFound(_0xb6a21d,null))[_0x2222('0x1a')](respondWithResult(_0xb6a21d,null))[_0x2222('0x25')](handleError(_0xb6a21d,null));};exports[_0x2222('0x52')]=function(_0x2130c1,_0x2294a8,_0x269fed){var _0x332781;return db[_0x2222('0x4b')]['create'](_0x2130c1['body'],{'raw':!![]})[_0x2222('0x1a')](function(_0x445061){_0x332781=_0x445061;return db[_0x2222('0x4b')][_0x2222('0x4e')]({'raw':!![]});})[_0x2222('0x1a')](function(_0x2228c6){var _0xf93529=fs['readFileSync'](path[_0x2222('0x53')](config[_0x2222('0x54')],_0x2222('0x55')),_0x2222('0x56'));var _0x226077=ejs[_0x2222('0x57')](_0xf93529,{'contexts':_0x2228c6||[]});fs[_0x2222('0x58')](_0x2222('0x59'),_0x226077);})[_0x2222('0x1a')](function(){return respondWithRpcPromise('Reload',_0x2222('0x52'),{'module':'chan_sip.so'});})[_0x2222('0x1a')](function(){var _0x42db59=_0x2130c1[_0x2222('0x5a')][_0x2222('0x31')]({'plain':!![]});if(!_0x42db59)throw new Error(_0x2222('0x5b'));if(_0x42db59[_0x2222('0x5c')]===_0x2222('0x5a')){var _0x37d9fe=_0x332781[_0x2222('0x31')]({'plain':!![]});return db[_0x2222('0x5d')][_0x2222('0x5e')]({'where':{'name':'Contexts','userProfileId':_0x42db59[_0x2222('0x5f')]},'raw':!![]})[_0x2222('0x1a')](function(_0x34e2e0){if(_0x34e2e0&&_0x34e2e0['autoAssociation']===0x0){return db[_0x2222('0x60')][_0x2222('0x52')]({'name':_0x37d9fe[_0x2222('0x36')],'resourceId':_0x37d9fe['id'],'type':_0x34e2e0[_0x2222('0x36')],'sectionId':_0x34e2e0['id']},{})[_0x2222('0x1a')](function(){return _0x332781;});}else{return _0x332781;}})[_0x2222('0x25')](function(_0x247092){logger['error'](_0x2222('0x61'),_0x247092);throw _0x247092;});}return _0x332781;})[_0x2222('0x1a')](respondWithResult(_0x2294a8,0xc9))[_0x2222('0x25')](handleError(_0x2294a8,null));};exports[_0x2222('0x62')]=function(_0x276b14,_0x43fa08,_0x3459ad){var _0x4880b8;return db[_0x2222('0x4b')]['find']({'where':{'id':_0x276b14[_0x2222('0x51')]['id']}})[_0x2222('0x1a')](handleEntityNotFound(_0x43fa08,null))[_0x2222('0x1a')](saveUpdates(_0x276b14[_0x2222('0x63')],null))['then'](function(_0x38be92){if(_0x38be92){_0x4880b8=_0x38be92;return db['VoiceContext'][_0x2222('0x4e')]({'raw':!![]});}})[_0x2222('0x1a')](function(_0xe0d4df){var _0x1b2759=fs['readFileSync'](path['join'](config[_0x2222('0x54')],_0x2222('0x55')),_0x2222('0x56'));var _0x2c242b=ejs[_0x2222('0x57')](_0x1b2759,{'contexts':_0xe0d4df||[]});fs[_0x2222('0x58')](_0x2222('0x59'),_0x2c242b);})[_0x2222('0x1a')](function(){return respondWithRpcPromise(_0x2222('0x64'),_0x2222('0x62'),{'module':'chan_sip.so'});})[_0x2222('0x1a')](function(){return _0x4880b8;})[_0x2222('0x1a')](respondWithResult(_0x43fa08,null))[_0x2222('0x25')](handleError(_0x43fa08,null));};exports[_0x2222('0x30')]=function(_0x247c9c,_0x2787c6,_0x3fbc15){var _0x11a582;return db[_0x2222('0x4b')]['find']({'where':{'id':_0x247c9c[_0x2222('0x51')]['id']}})['then'](handleEntityNotFound(_0x2787c6,null))[_0x2222('0x1a')](removeEntity(_0x2787c6,null))['then'](function(){return db[_0x2222('0x4b')][_0x2222('0x4e')]({'raw':!![]});})[_0x2222('0x1a')](function(_0x605693){var _0x20ef18=fs[_0x2222('0x65')](path['join'](config[_0x2222('0x54')],'server/files/templates/context.ejs'),_0x2222('0x56'));var _0x5425dd=ejs['render'](_0x20ef18,{'contexts':_0x605693});fs[_0x2222('0x58')](_0x2222('0x59'),_0x5425dd);return respondWithRpcPromise(_0x2222('0x64'),_0x2222('0x30'),{'module':_0x2222('0x66')});})[_0x2222('0x25')](handleError(_0x2787c6,null));};
\ No newline at end of file
index c8794bf..723666c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93bd=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','define','voice_contexts'];(function(_0xd3d4ea,_0x51648e){var _0x51cf15=function(_0xadc129){while(--_0xadc129){_0xd3d4ea['push'](_0xd3d4ea['shift']());}};_0x51cf15(++_0x51648e);}(_0x93bd,0x1ef));var _0xd93b=function(_0x17848d,_0x2c71fa){_0x17848d=_0x17848d-0x0;var _0x467214=_0x93bd[_0x17848d];return _0x467214;};'use strict';var _=require(_0xd93b('0x0'));var util=require('util');var logger=require(_0xd93b('0x1'))(_0xd93b('0x2'));var moment=require(_0xd93b('0x3'));var BPromise=require(_0xd93b('0x4'));var rp=require(_0xd93b('0x5'));var fs=require('fs');var path=require(_0xd93b('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceContext.attributes');module['exports']=function(_0x524e84,_0x5abf3c){return _0x524e84[_0xd93b('0x7')]('VoiceContext',attributes,{'tableName':_0xd93b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x48e4=['bluebird','request-promise','rimraf','../../config/environment','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger','api','moment'];(function(_0x503264,_0x23c97d){var _0x24465e=function(_0x3a7e10){while(--_0x3a7e10){_0x503264['push'](_0x503264['shift']());}};_0x24465e(++_0x23c97d);}(_0x48e4,0x126));var _0x448e=function(_0x2f41fa,_0x5ac0bd){_0x2f41fa=_0x2f41fa-0x0;var _0x425ecb=_0x48e4[_0x2f41fa];return _0x425ecb;};'use strict';var _=require(_0x448e('0x0'));var util=require(_0x448e('0x1'));var logger=require(_0x448e('0x2'))(_0x448e('0x3'));var moment=require(_0x448e('0x4'));var BPromise=require(_0x448e('0x5'));var rp=require(_0x448e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x448e('0x7'));var config=require(_0x448e('0x8'));var attributes=require('./voiceContext.attributes');module[_0x448e('0x9')]=function(_0x20a235,_0xbd24d4){return _0x20a235[_0x448e('0xa')](_0x448e('0xb'),attributes,{'tableName':_0x448e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 44dd92a..beff57a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4123=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment'];(function(_0x1c5605,_0x18fe62){var _0x4c1961=function(_0x3ee6bc){while(--_0x3ee6bc){_0x1c5605['push'](_0x1c5605['shift']());}};_0x4c1961(++_0x18fe62);}(_0x4123,0x87));var _0x3412=function(_0xe9e6cf,_0x395f6d){_0xe9e6cf=_0xe9e6cf-0x0;var _0x2b8851=_0x4123[_0xe9e6cf];return _0x2b8851;};'use strict';var _=require(_0x3412('0x0'));var util=require(_0x3412('0x1'));var moment=require(_0x3412('0x2'));var BPromise=require(_0x3412('0x3'));var rs=require(_0x3412('0x4'));var fs=require('fs');var Redis=require(_0x3412('0x5'));var db=require(_0x3412('0x6'))['db'];var utils=require(_0x3412('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x3412('0x8'));var jayson=require(_0x3412('0x9'));var client=jayson['client'][_0x3412('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c6b42,_0x30d18b,_0x43f43c){return new BPromise(function(_0x40c825,_0x2617a6){return client['request'](_0x2c6b42,_0x43f43c)[_0x3412('0xb')](function(_0x2517b0){logger[_0x3412('0xc')](_0x3412('0xd'),_0x30d18b,_0x3412('0xe'));logger[_0x3412('0xf')](_0x3412('0x10'),_0x30d18b,_0x3412('0xe'),JSON[_0x3412('0x11')](_0x2517b0));if(_0x2517b0['error']){if(_0x2517b0['error'][_0x3412('0x12')]===0x1f4){logger[_0x3412('0x13')](_0x3412('0xd'),_0x30d18b,_0x2517b0['error']['message']);return _0x2617a6(_0x2517b0['error'][_0x3412('0x14')]);}logger[_0x3412('0x13')](_0x3412('0xd'),_0x30d18b,_0x2517b0[_0x3412('0x13')][_0x3412('0x14')]);return _0x40c825(_0x2517b0[_0x3412('0x13')][_0x3412('0x14')]);}else{logger[_0x3412('0xc')](_0x3412('0xd'),_0x30d18b,_0x3412('0xe'));_0x40c825(_0x2517b0[_0x3412('0x15')][_0x3412('0x14')]);}})[_0x3412('0x16')](function(_0x854010){logger['error'](_0x3412('0xd'),_0x30d18b,_0x854010);_0x2617a6(_0x854010);});});}
\ No newline at end of file
+var _0x5a1c=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','catch','lodash','util','randomstring','../../mysqldb'];(function(_0x247fa1,_0x4ec37c){var _0x244f35=function(_0xfb98be){while(--_0xfb98be){_0x247fa1['push'](_0x247fa1['shift']());}};_0x244f35(++_0x4ec37c);}(_0x5a1c,0x1b5));var _0xc5a1=function(_0x16cfae,_0x3c3596){_0x16cfae=_0x16cfae-0x0;var _0x5a04cf=_0x5a1c[_0x16cfae];return _0x5a04cf;};'use strict';var _=require(_0xc5a1('0x0'));var util=require(_0xc5a1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc5a1('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc5a1('0x3'))['db'];var utils=require(_0xc5a1('0x4'));var logger=require(_0xc5a1('0x5'))(_0xc5a1('0x6'));var config=require('../../config/environment');var jayson=require(_0xc5a1('0x7'));var client=jayson[_0xc5a1('0x8')][_0xc5a1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5782b9,_0x46fd25,_0x159ed5){return new BPromise(function(_0x1ce1df,_0x111921){return client[_0xc5a1('0xa')](_0x5782b9,_0x159ed5)[_0xc5a1('0xb')](function(_0x28234b){logger[_0xc5a1('0xc')](_0xc5a1('0xd'),_0x46fd25,_0xc5a1('0xe'));logger[_0xc5a1('0xf')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x46fd25,_0xc5a1('0xe'),JSON[_0xc5a1('0x10')](_0x28234b));if(_0x28234b['error']){if(_0x28234b['error'][_0xc5a1('0x11')]===0x1f4){logger['error'](_0xc5a1('0xd'),_0x46fd25,_0x28234b[_0xc5a1('0x12')][_0xc5a1('0x13')]);return _0x111921(_0x28234b[_0xc5a1('0x12')]['message']);}logger[_0xc5a1('0x12')]('VoiceContext,\x20%s,\x20%s',_0x46fd25,_0x28234b[_0xc5a1('0x12')]['message']);return _0x1ce1df(_0x28234b[_0xc5a1('0x12')][_0xc5a1('0x13')]);}else{logger[_0xc5a1('0xc')](_0xc5a1('0xd'),_0x46fd25,_0xc5a1('0xe'));_0x1ce1df(_0x28234b['result'][_0xc5a1('0x13')]);}})[_0xc5a1('0x14')](function(_0x1a8e41){logger[_0xc5a1('0x12')](_0xc5a1('0xd'),_0x46fd25,_0x1a8e41);_0x111921(_0x1a8e41);});});}
\ No newline at end of file
index fa51870..4f19663 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8801=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8801,0x116));var _0x1880=function(_0x31c28c,_0x4b4bb0){_0x31c28c=_0x31c28c-0x0;var _0x259eb3=_0x8801[_0x31c28c];return _0x259eb3;};'use strict';var multer=require(_0x1880('0x0'));var util=require(_0x1880('0x1'));var path=require(_0x1880('0x2'));var timeout=require(_0x1880('0x3'));var express=require(_0x1880('0x4'));var router=express[_0x1880('0x5')]();var fs_extra=require(_0x1880('0x6'));var auth=require(_0x1880('0x7'));var interaction=require(_0x1880('0x8'));var config=require(_0x1880('0x9'));var controller=require(_0x1880('0xa'));router[_0x1880('0xb')]('/',auth['isAuthenticated'](),controller[_0x1880('0xc')]);router['get'](_0x1880('0xd'),auth[_0x1880('0xe')](),controller[_0x1880('0xf')]);router[_0x1880('0xb')](_0x1880('0x10'),auth[_0x1880('0xe')](),controller[_0x1880('0x11')]);router[_0x1880('0x12')]('/',auth[_0x1880('0xe')](),controller[_0x1880('0x13')]);router['put'](_0x1880('0x10'),auth[_0x1880('0xe')](),controller[_0x1880('0x14')]);router['delete'](_0x1880('0x10'),auth[_0x1880('0xe')](),controller[_0x1880('0x15')]);module[_0x1880('0x16')]=router;
\ No newline at end of file
+var _0xb9ca=['isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get'];(function(_0x13439e,_0x39fb41){var _0x2a04cd=function(_0x156fd5){while(--_0x156fd5){_0x13439e['push'](_0x13439e['shift']());}};_0x2a04cd(++_0x39fb41);}(_0xb9ca,0xfb));var _0xab9c=function(_0x114e6a,_0x3dc9d2){_0x114e6a=_0x114e6a-0x0;var _0x423189=_0xb9ca[_0x114e6a];return _0x423189;};'use strict';var multer=require(_0xab9c('0x0'));var util=require(_0xab9c('0x1'));var path=require('path');var timeout=require(_0xab9c('0x2'));var express=require('express');var router=express[_0xab9c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xab9c('0x4'));var interaction=require(_0xab9c('0x5'));var config=require(_0xab9c('0x6'));var controller=require(_0xab9c('0x7'));router[_0xab9c('0x8')]('/',auth[_0xab9c('0x9')](),controller[_0xab9c('0xa')]);router['get'](_0xab9c('0xb'),auth[_0xab9c('0x9')](),controller['describe']);router[_0xab9c('0x8')](_0xab9c('0xc'),auth[_0xab9c('0x9')](),controller[_0xab9c('0xd')]);router[_0xab9c('0xe')]('/',auth[_0xab9c('0x9')](),controller[_0xab9c('0xf')]);router[_0xab9c('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xab9c('0x11')]);router[_0xab9c('0x12')]('/:id',auth[_0xab9c('0x9')](),controller['destroy']);module[_0xab9c('0x13')]=router;
\ No newline at end of file
index 07b06d5..7aecbcd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9bde=['exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x5ccfd0,_0xecb69e){var _0x1c6950=function(_0xcfd1e2){while(--_0xcfd1e2){_0x5ccfd0['push'](_0x5ccfd0['shift']());}};_0x1c6950(++_0xecb69e);}(_0x9bde,0xe1));var _0xe9bd=function(_0x57edf4,_0x1f7dd6){_0x57edf4=_0x57edf4-0x0;var _0x266b56=_0x9bde[_0x57edf4];return _0x266b56;};'use strict';var Sequelize=require('sequelize');module[_0xe9bd('0x0')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe9bd('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xe9bd('0x1')]},'calleridnum':{'type':Sequelize[_0xe9bd('0x1')]},'calleridname':{'type':Sequelize[_0xe9bd('0x1')]},'connectedlinenum':{'type':Sequelize[_0xe9bd('0x1')]},'connectedlinename':{'type':Sequelize[_0xe9bd('0x1')]},'language':{'type':Sequelize[_0xe9bd('0x1')]},'accountcode':{'type':Sequelize[_0xe9bd('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe9bd('0x1')]},'priority':{'type':Sequelize[_0xe9bd('0x2')]},'uniqueid':{'type':Sequelize[_0xe9bd('0x1')]},'linkedid':{'type':Sequelize[_0xe9bd('0x1')]},'destchannel':{'type':Sequelize[_0xe9bd('0x1')]},'destchannelstate':{'type':Sequelize[_0xe9bd('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xe9bd('0x1')]},'destcalleridnum':{'type':Sequelize[_0xe9bd('0x1')]},'destcalleridname':{'type':Sequelize[_0xe9bd('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xe9bd('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xe9bd('0x1')]},'destcontext':{'type':Sequelize[_0xe9bd('0x1')]},'destexten':{'type':Sequelize[_0xe9bd('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0xe9bd('0x1')]},'destlinkedid':{'type':Sequelize[_0xe9bd('0x1')]},'dialstring':{'type':Sequelize[_0xe9bd('0x1')]},'dialstatus':{'type':Sequelize[_0xe9bd('0x1')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe9bd('0x3')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xe9bd('0x1')],'comment':_0xe9bd('0x4')},'routeId':{'type':Sequelize[_0xe9bd('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xe9bd('0x2')]}};
\ No newline at end of file
+var _0x8d0e=['INTEGER','DATE','called,connect,complete','sequelize','exports','STRING'];(function(_0x5d81cc,_0xedaa67){var _0x3e3574=function(_0x7eeb81){while(--_0x7eeb81){_0x5d81cc['push'](_0x5d81cc['shift']());}};_0x3e3574(++_0xedaa67);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x3c9d53,_0x517d19){_0x3c9d53=_0x3c9d53-0x0;var _0x17e174=_0x8d0e[_0x3c9d53];return _0x17e174;};'use strict';var Sequelize=require(_0xe8d0('0x0'));module[_0xe8d0('0x1')]={'privilege':{'type':Sequelize[_0xe8d0('0x2')]},'channel':{'type':Sequelize[_0xe8d0('0x2')]},'channelstate':{'type':Sequelize[_0xe8d0('0x3')]},'channelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'calleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'calleridname':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xe8d0('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe8d0('0x2')]},'priority':{'type':Sequelize[_0xe8d0('0x3')]},'uniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'linkedid':{'type':Sequelize[_0xe8d0('0x2')]},'destchannel':{'type':Sequelize[_0xe8d0('0x2')]},'destchannelstate':{'type':Sequelize[_0xe8d0('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridnum':{'type':Sequelize[_0xe8d0('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xe8d0('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xe8d0('0x2')]},'destlanguage':{'type':Sequelize[_0xe8d0('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xe8d0('0x2')]},'destpriority':{'type':Sequelize[_0xe8d0('0x3')]},'destuniqueid':{'type':Sequelize[_0xe8d0('0x2')]},'destlinkedid':{'type':Sequelize[_0xe8d0('0x2')]},'dialstring':{'type':Sequelize[_0xe8d0('0x2')]},'dialstatus':{'type':Sequelize[_0xe8d0('0x2')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe8d0('0x4')]},'endtime':{'type':Sequelize[_0xe8d0('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xe8d0('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xe8d0('0x3')]},'billableseconds':{'type':Sequelize[_0xe8d0('0x3')]}};
\ No newline at end of file
index 73c8b45..65cc514 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x29ef=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','save','then','destroy','error','stack','name','send','index','map','fieldName','type','model','keys','query','intersection','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','VoiceDialReport','findAll','rows','catch','rawAttributes','fields','attributes','length','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0x271322,_0x3111c7){var _0x42cf56=function(_0x439c69){while(--_0x439c69){_0x271322['push'](_0x271322['shift']());}};_0x42cf56(++_0x3111c7);}(_0x29ef,0xd7));var _0xf29e=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0x29ef[_0x1b6c6d];return _0x290d9d;};'use strict';var emlformat=require(_0xf29e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf29e('0x1'));var jsonpatch=require(_0xf29e('0x2'));var rp=require(_0xf29e('0x3'));var moment=require(_0xf29e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf29e('0x5'));var util=require(_0xf29e('0x6'));var path=require(_0xf29e('0x7'));var sox=require('sox');var csv=require(_0xf29e('0x8'));var ejs=require(_0xf29e('0x9'));var fs=require('fs');var fs_extra=require(_0xf29e('0xa'));var _=require(_0xf29e('0xb'));var squel=require(_0xf29e('0xc'));var crypto=require('crypto');var jsforce=require(_0xf29e('0xd'));var deskjs=require(_0xf29e('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf29e('0xf'));var Papa=require('papaparse');var Redis=require(_0xf29e('0x10'));var authService=require(_0xf29e('0x11'));var qs=require(_0xf29e('0x12'));var as=require(_0xf29e('0x13'));var hardwareService=require(_0xf29e('0x14'));var logger=require(_0xf29e('0x15'))(_0xf29e('0x16'));var utils=require(_0xf29e('0x17'));var config=require(_0xf29e('0x18'));var licenseUtil=require(_0xf29e('0x19'));var db=require(_0xf29e('0x1a'))['db'];function respondWithStatusCode(_0x5e81cc,_0x220c74){_0x220c74=_0x220c74||0xcc;return function(_0x5b7adc){if(_0x5b7adc){return _0x5e81cc[_0xf29e('0x1b')](_0x220c74);}return _0x5e81cc[_0xf29e('0x1c')](_0x220c74)[_0xf29e('0x1d')]();};}function respondWithResult(_0x1614e5,_0x347096){_0x347096=_0x347096||0xc8;return function(_0x1e9fae){if(_0x1e9fae){return _0x1614e5[_0xf29e('0x1c')](_0x347096)[_0xf29e('0x1e')](_0x1e9fae);}};}function respondWithFilteredResult(_0x34f563,_0x521c14){return function(_0x35e16b){if(_0x35e16b){var _0x724628=typeof _0x521c14[_0xf29e('0x1f')]===_0xf29e('0x20')&&typeof _0x521c14[_0xf29e('0x21')]==='undefined';var _0x411e4b=_0x35e16b[_0xf29e('0x22')];var _0x543d39=_0x724628?0x0:_0x521c14['offset'];var _0x1e7cdc=_0x724628?_0x35e16b['count']:_0x521c14[_0xf29e('0x1f')]+_0x521c14['limit'];var _0x1cc20e;if(_0x1e7cdc>=_0x411e4b){_0x1e7cdc=_0x411e4b;_0x1cc20e=0xc8;}else{_0x1cc20e=0xce;}_0x34f563[_0xf29e('0x1c')](_0x1cc20e);return _0x34f563[_0xf29e('0x23')]('Content-Range',_0x543d39+'-'+_0x1e7cdc+'/'+_0x411e4b)[_0xf29e('0x1e')](_0x35e16b);}return null;};}function patchUpdates(_0x365734){return function(_0xd9394d){try{jsonpatch['apply'](_0xd9394d,_0x365734,!![]);}catch(_0x398f64){return BPromise[_0xf29e('0x24')](_0x398f64);}return _0xd9394d[_0xf29e('0x25')]();};}function saveUpdates(_0xbc06f2,_0x3c7c5c){return function(_0x40ae7e){if(_0x40ae7e){return _0x40ae7e['update'](_0xbc06f2)[_0xf29e('0x26')](function(_0x199fb5){return _0x199fb5;});}return null;};}function removeEntity(_0x2c597f,_0x218ae1){return function(_0x366467){if(_0x366467){return _0x366467[_0xf29e('0x27')]()[_0xf29e('0x26')](function(){_0x2c597f['status'](0xcc)[_0xf29e('0x1d')]();});}};}function handleEntityNotFound(_0x18b4fe,_0x3c0962){return function(_0x3de672){if(!_0x3de672){_0x18b4fe[_0xf29e('0x1b')](0x194);}return _0x3de672;};}function handleError(_0x5114dd,_0x192328){_0x192328=_0x192328||0x1f4;return function(_0x1d4d24){logger[_0xf29e('0x28')](_0x1d4d24[_0xf29e('0x29')]);if(_0x1d4d24['name']){delete _0x1d4d24[_0xf29e('0x2a')];}_0x5114dd['status'](_0x192328)[_0xf29e('0x2b')](_0x1d4d24);};}exports[_0xf29e('0x2c')]=function(_0x10bd71,_0x5aafff){var _0x39cb72={},_0x3d8cec={},_0x5c73b4={'count':0x0,'rows':[]};var _0x19d125=_[_0xf29e('0x2d')](db['VoiceDialReport']['rawAttributes'],function(_0x4bd785){return{'name':_0x4bd785[_0xf29e('0x2e')],'type':_0x4bd785[_0xf29e('0x2f')]['key']};});_0x3d8cec[_0xf29e('0x30')]=_[_0xf29e('0x2d')](_0x19d125,_0xf29e('0x2a'));_0x3d8cec['query']=_[_0xf29e('0x31')](_0x10bd71[_0xf29e('0x32')]);_0x3d8cec['filters']=_['intersection'](_0x3d8cec[_0xf29e('0x30')],_0x3d8cec['query']);_0x39cb72['attributes']=_[_0xf29e('0x33')](_0x3d8cec[_0xf29e('0x30')],qs['fields'](_0x10bd71['query']['fields']));_0x39cb72['attributes']=_0x39cb72['attributes']['length']?_0x39cb72['attributes']:_0x3d8cec[_0xf29e('0x30')];if(!_0x10bd71[_0xf29e('0x32')][_0xf29e('0x34')](_0xf29e('0x35'))){_0x39cb72[_0xf29e('0x21')]=qs[_0xf29e('0x21')](_0x10bd71[_0xf29e('0x32')]['limit']);_0x39cb72['offset']=qs[_0xf29e('0x1f')](_0x10bd71[_0xf29e('0x32')]['offset']);}_0x39cb72[_0xf29e('0x36')]=qs['sort'](_0x10bd71[_0xf29e('0x32')][_0xf29e('0x37')]);_0x39cb72[_0xf29e('0x38')]=qs[_0xf29e('0x39')](_[_0xf29e('0x3a')](_0x10bd71[_0xf29e('0x32')],_0x3d8cec['filters']),_0x19d125);if(_0x10bd71[_0xf29e('0x32')][_0xf29e('0x3b')]){_0x39cb72['where']=_[_0xf29e('0x3c')](_0x39cb72[_0xf29e('0x38')],{'$or':_[_0xf29e('0x2d')](_0x19d125,function(_0x2a942f){if(_0x2a942f['type']!=='VIRTUAL'){var _0x3d414e={};_0x3d414e[_0x2a942f[_0xf29e('0x2a')]]={'$like':'%'+_0x10bd71[_0xf29e('0x32')][_0xf29e('0x3b')]+'%'};return _0x3d414e;}})});}_0x39cb72=_[_0xf29e('0x3c')]({},_0x39cb72,_0x10bd71[_0xf29e('0x3d')]);var _0x542be6={'where':_0x39cb72[_0xf29e('0x38')]};return db['VoiceDialReport']['count'](_0x542be6)[_0xf29e('0x26')](function(_0x4b4816){_0x5c73b4[_0xf29e('0x22')]=_0x4b4816;if(_0x10bd71[_0xf29e('0x32')][_0xf29e('0x3e')]){_0x39cb72[_0xf29e('0x3f')]=[{'all':!![]}];}return db[_0xf29e('0x40')][_0xf29e('0x41')](_0x39cb72);})[_0xf29e('0x26')](function(_0x5e04ba){_0x5c73b4[_0xf29e('0x42')]=_0x5e04ba;return _0x5c73b4;})[_0xf29e('0x26')](respondWithFilteredResult(_0x5aafff,_0x39cb72))[_0xf29e('0x43')](handleError(_0x5aafff,null));};exports['show']=function(_0x596c72,_0x24a09e){var _0x5a38ac={'raw':!![],'where':{'id':_0x596c72['params']['id']}},_0xe7f3ac={};_0xe7f3ac[_0xf29e('0x30')]=_[_0xf29e('0x31')](db[_0xf29e('0x40')][_0xf29e('0x44')]);_0xe7f3ac['query']=_[_0xf29e('0x31')](_0x596c72[_0xf29e('0x32')]);_0xe7f3ac[_0xf29e('0x39')]=_[_0xf29e('0x33')](_0xe7f3ac[_0xf29e('0x30')],_0xe7f3ac[_0xf29e('0x32')]);_0x5a38ac['attributes']=_['intersection'](_0xe7f3ac['model'],qs[_0xf29e('0x45')](_0x596c72[_0xf29e('0x32')][_0xf29e('0x45')]));_0x5a38ac[_0xf29e('0x46')]=_0x5a38ac[_0xf29e('0x46')][_0xf29e('0x47')]?_0x5a38ac[_0xf29e('0x46')]:_0xe7f3ac[_0xf29e('0x30')];if(_0x596c72[_0xf29e('0x32')][_0xf29e('0x3e')]){_0x5a38ac['include']=[{'all':!![]}];}_0x5a38ac=_[_0xf29e('0x3c')]({},_0x5a38ac,_0x596c72['options']);return db[_0xf29e('0x40')][_0xf29e('0x48')](_0x5a38ac)[_0xf29e('0x26')](handleEntityNotFound(_0x24a09e,null))[_0xf29e('0x26')](respondWithResult(_0x24a09e,null))[_0xf29e('0x43')](handleError(_0x24a09e,null));};exports[_0xf29e('0x49')]=function(_0x14742e,_0x407236){return db[_0xf29e('0x40')][_0xf29e('0x49')](_0x14742e['body'],{})[_0xf29e('0x26')](respondWithResult(_0x407236,0xc9))[_0xf29e('0x43')](handleError(_0x407236,null));};exports['update']=function(_0x4eefd8,_0x3e2411){if(_0x4eefd8[_0xf29e('0x4a')]['id']){delete _0x4eefd8[_0xf29e('0x4a')]['id'];}return db[_0xf29e('0x40')][_0xf29e('0x48')]({'where':{'id':_0x4eefd8[_0xf29e('0x4b')]['id']}})[_0xf29e('0x26')](handleEntityNotFound(_0x3e2411,null))[_0xf29e('0x26')](saveUpdates(_0x4eefd8[_0xf29e('0x4a')],null))[_0xf29e('0x26')](respondWithResult(_0x3e2411,null))['catch'](handleError(_0x3e2411,null));};exports[_0xf29e('0x27')]=function(_0x46ab97,_0xa9574f){return db[_0xf29e('0x40')][_0xf29e('0x48')]({'where':{'id':_0x46ab97[_0xf29e('0x4b')]['id']}})[_0xf29e('0x26')](handleEntityNotFound(_0xa9574f,null))[_0xf29e('0x26')](removeEntity(_0xa9574f,null))['catch'](handleError(_0xa9574f,null));};exports[_0xf29e('0x4c')]=function(_0x1fd574,_0x1eaf1a){return db[_0xf29e('0x40')][_0xf29e('0x4c')]()[_0xf29e('0x26')](respondWithResult(_0x1eaf1a,null))['catch'](handleError(_0x1eaf1a,null));};
\ No newline at end of file
+var _0x8eb4=['model','map','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','VoiceDialReport','type','key'];(function(_0x44e62d,_0x5a127a){var _0xbe9a06=function(_0xcf8263){while(--_0xcf8263){_0x44e62d['push'](_0x44e62d['shift']());}};_0xbe9a06(++_0x5a127a);}(_0x8eb4,0xf7));var _0x48eb=function(_0x4ed32d,_0x327695){_0x4ed32d=_0x4ed32d-0x0;var _0xf624df=_0x8eb4[_0x4ed32d];return _0xf624df;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x48eb('0x0'));var zipdir=require(_0x48eb('0x1'));var jsonpatch=require(_0x48eb('0x2'));var rp=require(_0x48eb('0x3'));var moment=require(_0x48eb('0x4'));var BPromise=require(_0x48eb('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x48eb('0x6'));var sox=require('sox');var csv=require(_0x48eb('0x7'));var ejs=require(_0x48eb('0x8'));var fs=require('fs');var fs_extra=require(_0x48eb('0x9'));var _=require(_0x48eb('0xa'));var squel=require(_0x48eb('0xb'));var crypto=require(_0x48eb('0xc'));var jsforce=require(_0x48eb('0xd'));var deskjs=require(_0x48eb('0xe'));var toCsv=require(_0x48eb('0x7'));var querystring=require(_0x48eb('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x48eb('0x10'));var as=require(_0x48eb('0x11'));var hardwareService=require(_0x48eb('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x48eb('0x13'));var licenseUtil=require(_0x48eb('0x14'));var db=require(_0x48eb('0x15'))['db'];function respondWithStatusCode(_0x39e644,_0x1b1a1d){_0x1b1a1d=_0x1b1a1d||0xcc;return function(_0x4f2649){if(_0x4f2649){return _0x39e644['sendStatus'](_0x1b1a1d);}return _0x39e644[_0x48eb('0x16')](_0x1b1a1d)[_0x48eb('0x17')]();};}function respondWithResult(_0x46fa0f,_0x52ecf0){_0x52ecf0=_0x52ecf0||0xc8;return function(_0x54e7de){if(_0x54e7de){return _0x46fa0f['status'](_0x52ecf0)[_0x48eb('0x18')](_0x54e7de);}};}function respondWithFilteredResult(_0x231261,_0xe63a5){return function(_0x1b7bfe){if(_0x1b7bfe){var _0x319090=typeof _0xe63a5[_0x48eb('0x19')]===_0x48eb('0x1a')&&typeof _0xe63a5[_0x48eb('0x1b')]===_0x48eb('0x1a');var _0x3d5e62=_0x1b7bfe[_0x48eb('0x1c')];var _0x143916=_0x319090?0x0:_0xe63a5['offset'];var _0x3b9b70=_0x319090?_0x1b7bfe[_0x48eb('0x1c')]:_0xe63a5[_0x48eb('0x19')]+_0xe63a5['limit'];var _0x3d27e9;if(_0x3b9b70>=_0x3d5e62){_0x3b9b70=_0x3d5e62;_0x3d27e9=0xc8;}else{_0x3d27e9=0xce;}_0x231261[_0x48eb('0x16')](_0x3d27e9);return _0x231261['set'](_0x48eb('0x1d'),_0x143916+'-'+_0x3b9b70+'/'+_0x3d5e62)[_0x48eb('0x18')](_0x1b7bfe);}return null;};}function patchUpdates(_0x302971){return function(_0x15b647){try{jsonpatch[_0x48eb('0x1e')](_0x15b647,_0x302971,!![]);}catch(_0x352138){return BPromise[_0x48eb('0x1f')](_0x352138);}return _0x15b647[_0x48eb('0x20')]();};}function saveUpdates(_0x12df5a,_0xdec654){return function(_0x50983f){if(_0x50983f){return _0x50983f[_0x48eb('0x21')](_0x12df5a)[_0x48eb('0x22')](function(_0x2c0480){return _0x2c0480;});}return null;};}function removeEntity(_0x397158,_0x257cf5){return function(_0x38e0e1){if(_0x38e0e1){return _0x38e0e1[_0x48eb('0x23')]()[_0x48eb('0x22')](function(){_0x397158['status'](0xcc)[_0x48eb('0x17')]();});}};}function handleEntityNotFound(_0x43f064,_0x3f9ede){return function(_0x4047c9){if(!_0x4047c9){_0x43f064[_0x48eb('0x24')](0x194);}return _0x4047c9;};}function handleError(_0x72a495,_0x2bec98){_0x2bec98=_0x2bec98||0x1f4;return function(_0x5647f1){logger[_0x48eb('0x25')](_0x5647f1[_0x48eb('0x26')]);if(_0x5647f1[_0x48eb('0x27')]){delete _0x5647f1[_0x48eb('0x27')];}_0x72a495[_0x48eb('0x16')](_0x2bec98)[_0x48eb('0x28')](_0x5647f1);};}exports[_0x48eb('0x29')]=function(_0x147905,_0x54d279){var _0x1078a8={},_0x50d5b8={},_0x2baa12={'count':0x0,'rows':[]};var _0x79d25b=_['map'](db[_0x48eb('0x2a')]['rawAttributes'],function(_0x311109){return{'name':_0x311109['fieldName'],'type':_0x311109[_0x48eb('0x2b')][_0x48eb('0x2c')]};});_0x50d5b8[_0x48eb('0x2d')]=_[_0x48eb('0x2e')](_0x79d25b,_0x48eb('0x27'));_0x50d5b8['query']=_['keys'](_0x147905['query']);_0x50d5b8[_0x48eb('0x2f')]=_[_0x48eb('0x30')](_0x50d5b8['model'],_0x50d5b8[_0x48eb('0x31')]);_0x1078a8[_0x48eb('0x32')]=_[_0x48eb('0x30')](_0x50d5b8[_0x48eb('0x2d')],qs[_0x48eb('0x33')](_0x147905[_0x48eb('0x31')][_0x48eb('0x33')]));_0x1078a8[_0x48eb('0x32')]=_0x1078a8['attributes'][_0x48eb('0x34')]?_0x1078a8[_0x48eb('0x32')]:_0x50d5b8['model'];if(!_0x147905[_0x48eb('0x31')][_0x48eb('0x35')](_0x48eb('0x36'))){_0x1078a8[_0x48eb('0x1b')]=qs[_0x48eb('0x1b')](_0x147905[_0x48eb('0x31')][_0x48eb('0x1b')]);_0x1078a8[_0x48eb('0x19')]=qs[_0x48eb('0x19')](_0x147905[_0x48eb('0x31')][_0x48eb('0x19')]);}_0x1078a8['order']=qs['sort'](_0x147905[_0x48eb('0x31')][_0x48eb('0x37')]);_0x1078a8['where']=qs[_0x48eb('0x2f')](_[_0x48eb('0x38')](_0x147905[_0x48eb('0x31')],_0x50d5b8['filters']),_0x79d25b);if(_0x147905[_0x48eb('0x31')][_0x48eb('0x39')]){_0x1078a8[_0x48eb('0x3a')]=_[_0x48eb('0x3b')](_0x1078a8['where'],{'$or':_[_0x48eb('0x2e')](_0x79d25b,function(_0x47224f){if(_0x47224f[_0x48eb('0x2b')]!==_0x48eb('0x3c')){var _0x10a5a1={};_0x10a5a1[_0x47224f[_0x48eb('0x27')]]={'$like':'%'+_0x147905[_0x48eb('0x31')]['filter']+'%'};return _0x10a5a1;}})});}_0x1078a8=_[_0x48eb('0x3b')]({},_0x1078a8,_0x147905[_0x48eb('0x3d')]);var _0x11c1e0={'where':_0x1078a8[_0x48eb('0x3a')]};return db['VoiceDialReport'][_0x48eb('0x1c')](_0x11c1e0)[_0x48eb('0x22')](function(_0x4f19c1){_0x2baa12[_0x48eb('0x1c')]=_0x4f19c1;if(_0x147905[_0x48eb('0x31')][_0x48eb('0x3e')]){_0x1078a8['include']=[{'all':!![]}];}return db[_0x48eb('0x2a')][_0x48eb('0x3f')](_0x1078a8);})[_0x48eb('0x22')](function(_0x3b6ec1){_0x2baa12['rows']=_0x3b6ec1;return _0x2baa12;})[_0x48eb('0x22')](respondWithFilteredResult(_0x54d279,_0x1078a8))[_0x48eb('0x40')](handleError(_0x54d279,null));};exports[_0x48eb('0x41')]=function(_0x2c7962,_0x24b550){var _0x807f27={'raw':!![],'where':{'id':_0x2c7962[_0x48eb('0x42')]['id']}},_0x3e7104={};_0x3e7104['model']=_['keys'](db[_0x48eb('0x2a')][_0x48eb('0x43')]);_0x3e7104[_0x48eb('0x31')]=_['keys'](_0x2c7962[_0x48eb('0x31')]);_0x3e7104[_0x48eb('0x2f')]=_['intersection'](_0x3e7104[_0x48eb('0x2d')],_0x3e7104[_0x48eb('0x31')]);_0x807f27[_0x48eb('0x32')]=_[_0x48eb('0x30')](_0x3e7104['model'],qs['fields'](_0x2c7962['query']['fields']));_0x807f27[_0x48eb('0x32')]=_0x807f27[_0x48eb('0x32')]['length']?_0x807f27[_0x48eb('0x32')]:_0x3e7104[_0x48eb('0x2d')];if(_0x2c7962[_0x48eb('0x31')][_0x48eb('0x3e')]){_0x807f27[_0x48eb('0x44')]=[{'all':!![]}];}_0x807f27=_[_0x48eb('0x3b')]({},_0x807f27,_0x2c7962['options']);return db['VoiceDialReport'][_0x48eb('0x45')](_0x807f27)[_0x48eb('0x22')](handleEntityNotFound(_0x24b550,null))['then'](respondWithResult(_0x24b550,null))[_0x48eb('0x40')](handleError(_0x24b550,null));};exports[_0x48eb('0x46')]=function(_0x2cf8aa,_0xc2e2c8){return db[_0x48eb('0x2a')][_0x48eb('0x46')](_0x2cf8aa['body'],{})[_0x48eb('0x22')](respondWithResult(_0xc2e2c8,0xc9))[_0x48eb('0x40')](handleError(_0xc2e2c8,null));};exports[_0x48eb('0x21')]=function(_0x3df0d5,_0x35ff91){if(_0x3df0d5['body']['id']){delete _0x3df0d5[_0x48eb('0x47')]['id'];}return db[_0x48eb('0x2a')][_0x48eb('0x45')]({'where':{'id':_0x3df0d5[_0x48eb('0x42')]['id']}})[_0x48eb('0x22')](handleEntityNotFound(_0x35ff91,null))[_0x48eb('0x22')](saveUpdates(_0x3df0d5[_0x48eb('0x47')],null))[_0x48eb('0x22')](respondWithResult(_0x35ff91,null))[_0x48eb('0x40')](handleError(_0x35ff91,null));};exports[_0x48eb('0x23')]=function(_0x5625d8,_0x3a3bae){return db[_0x48eb('0x2a')][_0x48eb('0x45')]({'where':{'id':_0x5625d8[_0x48eb('0x42')]['id']}})[_0x48eb('0x22')](handleEntityNotFound(_0x3a3bae,null))[_0x48eb('0x22')](removeEntity(_0x3a3bae,null))[_0x48eb('0x40')](handleError(_0x3a3bae,null));};exports[_0x48eb('0x48')]=function(_0x5de903,_0x4e44d8){return db[_0x48eb('0x2a')][_0x48eb('0x48')]()[_0x48eb('0x22')](respondWithResult(_0x4e44d8,null))[_0x48eb('0x40')](handleError(_0x4e44d8,null));};
\ No newline at end of file
index 90961cc..887f379 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf363=['report_dial','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceDialReport.attributes','exports','VoiceDialReport'];(function(_0x3a18f9,_0x416ace){var _0x140ad4=function(_0x14bbe9){while(--_0x14bbe9){_0x3a18f9['push'](_0x3a18f9['shift']());}};_0x140ad4(++_0x416ace);}(_0xf363,0xd9));var _0x3f36=function(_0x43f665,_0x55bec1){_0x43f665=_0x43f665-0x0;var _0x5337e9=_0xf363[_0x43f665];return _0x5337e9;};'use strict';var _=require('lodash');var util=require(_0x3f36('0x0'));var logger=require(_0x3f36('0x1'))(_0x3f36('0x2'));var moment=require(_0x3f36('0x3'));var BPromise=require(_0x3f36('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f36('0x5'));var rimraf=require(_0x3f36('0x6'));var config=require(_0x3f36('0x7'));var attributes=require(_0x3f36('0x8'));module[_0x3f36('0x9')]=function(_0x243ad7,_0x35151f){return _0x243ad7['define'](_0x3f36('0xa'),attributes,{'tableName':_0x3f36('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x8c46=['exports','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceDialReport.attributes'];(function(_0x2ca794,_0x3e0030){var _0x27b67b=function(_0x40f96b){while(--_0x40f96b){_0x2ca794['push'](_0x2ca794['shift']());}};_0x27b67b(++_0x3e0030);}(_0x8c46,0x14e));var _0x68c4=function(_0x25f1ea,_0x5cd295){_0x25f1ea=_0x25f1ea-0x0;var _0x217e85=_0x8c46[_0x25f1ea];return _0x217e85;};'use strict';var _=require(_0x68c4('0x0'));var util=require(_0x68c4('0x1'));var logger=require(_0x68c4('0x2'))(_0x68c4('0x3'));var moment=require(_0x68c4('0x4'));var BPromise=require(_0x68c4('0x5'));var rp=require(_0x68c4('0x6'));var fs=require('fs');var path=require(_0x68c4('0x7'));var rimraf=require(_0x68c4('0x8'));var config=require(_0x68c4('0x9'));var attributes=require(_0x68c4('0xa'));module[_0x68c4('0xb')]=function(_0x163f94,_0xf87767){return _0x163f94['define'](_0x68c4('0xc'),attributes,{'tableName':_0x68c4('0xd'),'paranoid':![],'indexes':[{'fields':[_0x68c4('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index 5620eb8..eca1bcb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x245d=['attributes','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceDialReport,\x20%s,\x20%s','info','result','catch','CreateVoiceDialReport','VoiceDialReport','body','options','raw','UpdateVoiceDialReport','where'];(function(_0x1d5f03,_0xbba796){var _0x561261=function(_0x300223){while(--_0x300223){_0x1d5f03['push'](_0x1d5f03['shift']());}};_0x561261(++_0xbba796);}(_0x245d,0x1bb));var _0xd245=function(_0x4b2ffd,_0x46d2bf){_0x4b2ffd=_0x4b2ffd-0x0;var _0x2409d0=_0x245d[_0x4b2ffd];return _0x2409d0;};'use strict';var _=require('lodash');var util=require(_0xd245('0x0'));var moment=require(_0xd245('0x1'));var BPromise=require(_0xd245('0x2'));var rs=require(_0xd245('0x3'));var fs=require('fs');var Redis=require(_0xd245('0x4'));var db=require(_0xd245('0x5'))['db'];var utils=require(_0xd245('0x6'));var logger=require(_0xd245('0x7'))(_0xd245('0x8'));var config=require(_0xd245('0x9'));var jayson=require(_0xd245('0xa'));var client=jayson[_0xd245('0xb')][_0xd245('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47a914,_0x50fe0b,_0x31c961){return new BPromise(function(_0x189617,_0x298292){return client[_0xd245('0xd')](_0x47a914,_0x31c961)[_0xd245('0xe')](function(_0x4b89b3){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x50fe0b,_0xd245('0xf'));logger[_0xd245('0x10')](_0xd245('0x11'),_0x50fe0b,'request\x20sent',JSON[_0xd245('0x12')](_0x4b89b3));if(_0x4b89b3['error']){if(_0x4b89b3[_0xd245('0x13')][_0xd245('0x14')]===0x1f4){logger[_0xd245('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x50fe0b,_0x4b89b3[_0xd245('0x13')][_0xd245('0x15')]);return _0x298292(_0x4b89b3[_0xd245('0x13')][_0xd245('0x15')]);}logger[_0xd245('0x13')](_0xd245('0x16'),_0x50fe0b,_0x4b89b3[_0xd245('0x13')][_0xd245('0x15')]);return _0x189617(_0x4b89b3['error'][_0xd245('0x15')]);}else{logger[_0xd245('0x17')]('VoiceDialReport,\x20%s,\x20%s',_0x50fe0b,'request\x20sent');_0x189617(_0x4b89b3[_0xd245('0x18')][_0xd245('0x15')]);}})[_0xd245('0x19')](function(_0x3274ca){logger[_0xd245('0x13')]('VoiceDialReport,\x20%s,\x20%s',_0x50fe0b,_0x3274ca);_0x298292(_0x3274ca);});});}exports[_0xd245('0x1a')]=function(_0x5bd065){var _0x5601e7=this;return new Promise(function(_0x2dd453,_0x1f243a){return db[_0xd245('0x1b')]['create'](_0x5bd065[_0xd245('0x1c')],{'raw':_0x5bd065['options']?_0x5bd065[_0xd245('0x1d')][_0xd245('0x1e')]===undefined?!![]:![]:!![]})[_0xd245('0xe')](function(_0x76dc3d){logger[_0xd245('0x17')]('CreateVoiceDialReport',_0x5bd065);logger[_0xd245('0x10')](_0xd245('0x1a'),_0x5bd065,JSON[_0xd245('0x12')](_0x76dc3d));_0x2dd453(_0x76dc3d);})[_0xd245('0x19')](function(_0x18ccf2){logger['error'](_0xd245('0x1a'),_0x18ccf2['message'],_0x5bd065);_0x1f243a(_0x5601e7[_0xd245('0x13')](0x1f4,_0x18ccf2['message']));});});};exports[_0xd245('0x1f')]=function(_0x1bf4f9){var _0x411ad3=this;return new Promise(function(_0x17f3e1,_0x13948e){return db[_0xd245('0x1b')]['update'](_0x1bf4f9[_0xd245('0x1c')],{'raw':_0x1bf4f9[_0xd245('0x1d')]?_0x1bf4f9[_0xd245('0x1d')][_0xd245('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bf4f9[_0xd245('0x1d')]?_0x1bf4f9[_0xd245('0x1d')][_0xd245('0x20')]||null:null,'attributes':_0x1bf4f9[_0xd245('0x1d')]?_0x1bf4f9['options'][_0xd245('0x21')]||null:null,'limit':_0x1bf4f9[_0xd245('0x1d')]?_0x1bf4f9[_0xd245('0x1d')]['limit']||null:null})[_0xd245('0xe')](function(_0x3b3115){logger['info'](_0xd245('0x1f'),_0x1bf4f9);logger[_0xd245('0x10')]('UpdateVoiceDialReport',_0x1bf4f9,JSON[_0xd245('0x12')](_0x3b3115));_0x17f3e1(_0x3b3115);})[_0xd245('0x19')](function(_0x258ca9){logger[_0xd245('0x13')](_0xd245('0x1f'),_0x258ca9[_0xd245('0x15')],_0x1bf4f9);_0x13948e(_0x411ad3['error'](0x1f4,_0x258ca9['message']));});});};
\ No newline at end of file
+var _0x39cf=['rpc','../../config/environment','client','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','options','then','update','body','raw','where','UpdateVoiceDialReport','debug','lodash','util','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x81f66f,_0x43dd4f){var _0x1be119=function(_0x3864c7){while(--_0x3864c7){_0x81f66f['push'](_0x81f66f['shift']());}};_0x1be119(++_0x43dd4f);}(_0x39cf,0x8b));var _0xf39c=function(_0x36940e,_0x11f338){_0x36940e=_0x36940e-0x0;var _0x3283f2=_0x39cf[_0x36940e];return _0x3283f2;};'use strict';var _=require(_0xf39c('0x0'));var util=require(_0xf39c('0x1'));var moment=require('moment');var BPromise=require(_0xf39c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf39c('0x3'));var db=require(_0xf39c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf39c('0x5'))(_0xf39c('0x6'));var config=require(_0xf39c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf39c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x521f6d,_0x1fb96b,_0x4f04aa){return new BPromise(function(_0x4c0647,_0x1b6669){return client['request'](_0x521f6d,_0x4f04aa)['then'](function(_0x64273c){logger[_0xf39c('0x9')](_0xf39c('0xa'),_0x1fb96b,_0xf39c('0xb'));logger['debug'](_0xf39c('0xc'),_0x1fb96b,_0xf39c('0xb'),JSON[_0xf39c('0xd')](_0x64273c));if(_0x64273c[_0xf39c('0xe')]){if(_0x64273c['error'][_0xf39c('0xf')]===0x1f4){logger[_0xf39c('0xe')](_0xf39c('0xa'),_0x1fb96b,_0x64273c[_0xf39c('0xe')][_0xf39c('0x10')]);return _0x1b6669(_0x64273c[_0xf39c('0xe')][_0xf39c('0x10')]);}logger[_0xf39c('0xe')](_0xf39c('0xa'),_0x1fb96b,_0x64273c['error']['message']);return _0x4c0647(_0x64273c[_0xf39c('0xe')]['message']);}else{logger[_0xf39c('0x9')]('VoiceDialReport,\x20%s,\x20%s',_0x1fb96b,_0xf39c('0xb'));_0x4c0647(_0x64273c[_0xf39c('0x11')][_0xf39c('0x10')]);}})[_0xf39c('0x12')](function(_0xd7011f){logger[_0xf39c('0xe')](_0xf39c('0xa'),_0x1fb96b,_0xd7011f);_0x1b6669(_0xd7011f);});});}exports[_0xf39c('0x13')]=function(_0x3e99ea){var _0x56eed2=this;return new Promise(function(_0x25113f,_0x159e6c){return db[_0xf39c('0x14')]['create'](_0x3e99ea['body'],{'raw':_0x3e99ea['options']?_0x3e99ea[_0xf39c('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xf39c('0x16')](function(_0x2c0cac){logger[_0xf39c('0x9')](_0xf39c('0x13'),_0x3e99ea);logger['debug'](_0xf39c('0x13'),_0x3e99ea,JSON[_0xf39c('0xd')](_0x2c0cac));_0x25113f(_0x2c0cac);})[_0xf39c('0x12')](function(_0x355c63){logger[_0xf39c('0xe')](_0xf39c('0x13'),_0x355c63[_0xf39c('0x10')],_0x3e99ea);_0x159e6c(_0x56eed2['error'](0x1f4,_0x355c63[_0xf39c('0x10')]));});});};exports['UpdateVoiceDialReport']=function(_0x2f15c1){var _0x212013=this;return new Promise(function(_0x10b098,_0x11565d){return db[_0xf39c('0x14')][_0xf39c('0x17')](_0x2f15c1[_0xf39c('0x18')],{'raw':_0x2f15c1['options']?_0x2f15c1[_0xf39c('0x15')][_0xf39c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f15c1[_0xf39c('0x15')]?_0x2f15c1['options'][_0xf39c('0x1a')]||null:null,'attributes':_0x2f15c1['options']?_0x2f15c1[_0xf39c('0x15')]['attributes']||null:null,'limit':_0x2f15c1[_0xf39c('0x15')]?_0x2f15c1[_0xf39c('0x15')]['limit']||null:null})[_0xf39c('0x16')](function(_0x3aea6a){logger[_0xf39c('0x9')](_0xf39c('0x1b'),_0x2f15c1);logger[_0xf39c('0x1c')](_0xf39c('0x1b'),_0x2f15c1,JSON[_0xf39c('0xd')](_0x3aea6a));_0x10b098(_0x3aea6a);})[_0xf39c('0x12')](function(_0x155247){logger[_0xf39c('0xe')](_0xf39c('0x1b'),_0x155247[_0xf39c('0x10')],_0x2f15c1);_0x11565d(_0x212013[_0xf39c('0xe')](0x1f4,_0x155247[_0xf39c('0x10')]));});});};
\ No newline at end of file
index e871e62..de15023 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd3c6=['destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./voiceExtension.controller','get','index','/:id','isAuthenticated','create','post','/:id/applications','update','delete'];(function(_0x11a504,_0x64ff3){var _0x2a4672=function(_0xcc22fd){while(--_0xcc22fd){_0x11a504['push'](_0x11a504['shift']());}};_0x2a4672(++_0x64ff3);}(_0xd3c6,0x1b2));var _0x6d3c=function(_0x4606ca,_0x395d28){_0x4606ca=_0x4606ca-0x0;var _0x68aaa7=_0xd3c6[_0x4606ca];return _0x68aaa7;};'use strict';var multer=require(_0x6d3c('0x0'));var util=require('util');var path=require(_0x6d3c('0x1'));var timeout=require(_0x6d3c('0x2'));var express=require(_0x6d3c('0x3'));var router=express[_0x6d3c('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6d3c('0x5'));var config=require('../../config/environment');var controller=require(_0x6d3c('0x6'));router[_0x6d3c('0x7')]('/',auth['isAuthenticated'](),controller[_0x6d3c('0x8')]);router[_0x6d3c('0x7')](_0x6d3c('0x9'),auth[_0x6d3c('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x6d3c('0xb')]);router[_0x6d3c('0xc')](_0x6d3c('0xd'),auth[_0x6d3c('0xa')](),controller['addApplications']);router['put'](_0x6d3c('0x9'),auth[_0x6d3c('0xa')](),controller[_0x6d3c('0xe')]);router[_0x6d3c('0xf')](_0x6d3c('0x9'),auth[_0x6d3c('0xa')](),controller[_0x6d3c('0x10')]);module[_0x6d3c('0x11')]=router;
\ No newline at end of file
+var _0xd8be=['post','create','/:id/applications','addApplications','put','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','/:id','show'];(function(_0x2b1012,_0x2d01f8){var _0x1a944f=function(_0x8845de){while(--_0x8845de){_0x2b1012['push'](_0x2b1012['shift']());}};_0x1a944f(++_0x2d01f8);}(_0xd8be,0x158));var _0xed8b=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0xd8be[_0x47a349];return _0x18ab75;};'use strict';var multer=require('multer');var util=require(_0xed8b('0x0'));var path=require('path');var timeout=require(_0xed8b('0x1'));var express=require(_0xed8b('0x2'));var router=express[_0xed8b('0x3')]();var fs_extra=require(_0xed8b('0x4'));var auth=require(_0xed8b('0x5'));var interaction=require(_0xed8b('0x6'));var config=require(_0xed8b('0x7'));var controller=require(_0xed8b('0x8'));router[_0xed8b('0x9')]('/',auth[_0xed8b('0xa')](),controller['index']);router[_0xed8b('0x9')](_0xed8b('0xb'),auth[_0xed8b('0xa')](),controller[_0xed8b('0xc')]);router[_0xed8b('0xd')]('/',auth[_0xed8b('0xa')](),controller[_0xed8b('0xe')]);router[_0xed8b('0xd')](_0xed8b('0xf'),auth[_0xed8b('0xa')](),controller[_0xed8b('0x10')]);router[_0xed8b('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xed8b('0x12')](_0xed8b('0xb'),auth[_0xed8b('0xa')](),controller[_0xed8b('0x13')]);module[_0xed8b('0x14')]=router;
\ No newline at end of file
index 651f491..c7a38c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe38b=['compositeIndex','NoOp','outbound','inbound-fax','outbound-fax','system','any','*,*,*,*','BOOLEAN','INTEGER','wav','VIRTUAL','sequelize','exports','STRING'];(function(_0xc4ac27,_0x58b55c){var _0x43ec34=function(_0x3fedcb){while(--_0x3fedcb){_0xc4ac27['push'](_0xc4ac27['shift']());}};_0x43ec34(++_0x58b55c);}(_0xe38b,0x165));var _0xbe38=function(_0x542f1b,_0x25aece){_0x542f1b=_0x542f1b-0x0;var _0x2b63a3=_0xe38b[_0x542f1b];return _0x2b63a3;};'use strict';var Sequelize=require(_0xbe38('0x0'));module[_0xbe38('0x1')]={'context':{'type':Sequelize[_0xbe38('0x2')],'allowNull':![],'unique':_0xbe38('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xbe38('0x2')],'allowNull':![],'unique':_0xbe38('0x3')},'priority':{'type':Sequelize[_0xbe38('0x2')],'allowNull':![],'defaultValue':'1','unique':_0xbe38('0x3')},'tag':{'type':Sequelize[_0xbe38('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xbe38('0x2')],'allowNull':![],'defaultValue':_0xbe38('0x4')},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM']('inbound',_0xbe38('0x5'),'internal',_0xbe38('0x6'),_0xbe38('0x7'),_0xbe38('0x8'),_0xbe38('0x9')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xbe38('0x2')],'allowNull':![],'defaultValue':_0xbe38('0xa')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0xbe38('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xbe38('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xbe38('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xbe38('0xc')]},'recordingFormat':{'type':Sequelize[_0xbe38('0x2')],'defaultValue':_0xbe38('0xd')},'answer':{'type':Sequelize[_0xbe38('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0xbe38('0xe')],'get':function(_0x5e1869){return this['getDataValue']('exten');}},'alias':{'type':Sequelize[_0xbe38('0x2')],'allowNull':!![]}};
\ No newline at end of file
+var _0x6a5b=['any','*,*,*,*','INTEGER','BOOLEAN','wav','VIRTUAL','getDataValue','exports','compositeIndex','STRING','NoOp','ENUM','inbound','outbound','internal','outbound-fax'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x6a5b,0x1a7));var _0xb6a5=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6a5b[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require('sequelize');module[_0xb6a5('0x0')]={'context':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb6a5('0x1'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xb6a5('0x2')],'allowNull':![],'unique':_0xb6a5('0x1')},'priority':{'type':Sequelize[_0xb6a5('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xb6a5('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0xb6a5('0x2')],'allowNull':![],'defaultValue':_0xb6a5('0x3')},'appdata':{'type':Sequelize[_0xb6a5('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xb6a5('0x4')](_0xb6a5('0x5'),_0xb6a5('0x6'),_0xb6a5('0x7'),'inbound-fax',_0xb6a5('0x8'),'system',_0xb6a5('0x9')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb6a5('0x2')],'allowNull':![],'defaultValue':_0xb6a5('0xa')},'IntervalId':{'type':Sequelize[_0xb6a5('0xb')]},'isApp':{'type':Sequelize[_0xb6a5('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xb6a5('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0xb6a5('0x2')],'allowNull':!![]},'record':{'type':Sequelize[_0xb6a5('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':_0xb6a5('0xd')},'answer':{'type':Sequelize[_0xb6a5('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0xb6a5('0xe')],'get':function(_0x1a9884){return this[_0xb6a5('0xf')]('exten');}},'alias':{'type':Sequelize[_0xb6a5('0x2')],'allowNull':!![]}};
\ No newline at end of file
index 82bff69..757dfcf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7409=['register','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','update','then','inbound','outbound','filter','ignore','map','value','includes','find','type','name','UserProfileResource','error','send','index','VoiceExtension','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','order','sort','pick','where','options','includeAll','findAll','rows','show','params','keys','include','merge','catch','destroy','create','body','startsWith','concat','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','InboundRoutes','OutboundRoutes','InternalRoutes','internal','UserProfileSection','autoAssociation','exten','description','recordingFormat','cutdigits','mandatoryDisposition','alias','context','findOne','sequelize','transaction','VoiceExtensionId','isApp','rewriteDial','toLowerCase','true','createRouting','bulkCreate','cast(priority\x20as\x20unsigned)','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket'];(function(_0x22bff1,_0x1d964a){var _0x279396=function(_0x2573c7){while(--_0x2573c7){_0x22bff1['push'](_0x22bff1['shift']());}};_0x279396(++_0x1d964a);}(_0x7409,0xc9));var _0x9740=function(_0xb4fe2c,_0x3d2be6){_0xb4fe2c=_0xb4fe2c-0x0;var _0x460a1a=_0x7409[_0xb4fe2c];return _0x460a1a;};'use strict';var emlformat=require(_0x9740('0x0'));var rimraf=require(_0x9740('0x1'));var zipdir=require(_0x9740('0x2'));var jsonpatch=require(_0x9740('0x3'));var rp=require(_0x9740('0x4'));var moment=require(_0x9740('0x5'));var BPromise=require(_0x9740('0x6'));var Mustache=require('mustache');var util=require(_0x9740('0x7'));var path=require(_0x9740('0x8'));var sox=require(_0x9740('0x9'));var csv=require(_0x9740('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9740('0xb'));var _=require(_0x9740('0xc'));var squel=require(_0x9740('0xd'));var crypto=require('crypto');var jsforce=require(_0x9740('0xe'));var deskjs=require(_0x9740('0xf'));var toCsv=require(_0x9740('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9740('0x10'));var authService=require(_0x9740('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9740('0x12'));var logger=require(_0x9740('0x13'))(_0x9740('0x14'));var utils=require(_0x9740('0x15'));var config=require(_0x9740('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x9740('0x17'))['db'];config[_0x9740('0x18')]=_[_0x9740('0x19')](config[_0x9740('0x18')],{'host':_0x9740('0x1a'),'port':0x18eb});var socket=require(_0x9740('0x1b'))(new Redis(config[_0x9740('0x18')]));require(_0x9740('0x1c'))[_0x9740('0x1d')](socket);function respondWithStatusCode(_0x1e8b46,_0x37d6a7){_0x37d6a7=_0x37d6a7||0xcc;return function(_0x2a1646){if(_0x2a1646){return _0x1e8b46[_0x9740('0x1e')](_0x37d6a7);}return _0x1e8b46[_0x9740('0x1f')](_0x37d6a7)[_0x9740('0x20')]();};}function respondWithResult(_0x2541cc,_0x1e8b70){_0x1e8b70=_0x1e8b70||0xc8;return function(_0xf76bb){if(_0xf76bb){return _0x2541cc[_0x9740('0x1f')](_0x1e8b70)['json'](_0xf76bb);}};}function respondWithFilteredResult(_0x44925b,_0x426643){return function(_0x4ddf8f){if(_0x4ddf8f){var _0x32171d=typeof _0x426643[_0x9740('0x21')]===_0x9740('0x22')&&typeof _0x426643[_0x9740('0x23')]===_0x9740('0x22');var _0x4476b4=_0x4ddf8f[_0x9740('0x24')];var _0x3d0cfb=_0x32171d?0x0:_0x426643['offset'];var _0x10e34d=_0x32171d?_0x4ddf8f[_0x9740('0x24')]:_0x426643[_0x9740('0x21')]+_0x426643[_0x9740('0x23')];var _0x4c5540;if(_0x10e34d>=_0x4476b4){_0x10e34d=_0x4476b4;_0x4c5540=0xc8;}else{_0x4c5540=0xce;}_0x44925b[_0x9740('0x1f')](_0x4c5540);return _0x44925b['set'](_0x9740('0x25'),_0x3d0cfb+'-'+_0x10e34d+'/'+_0x4476b4)[_0x9740('0x26')](_0x4ddf8f);}return null;};}function patchUpdates(_0x1520c6){return function(_0x193d18){try{jsonpatch[_0x9740('0x27')](_0x193d18,_0x1520c6,!![]);}catch(_0x49745a){return BPromise['reject'](_0x49745a);}return _0x193d18[_0x9740('0x28')]();};}function saveUpdates(_0x4cb188,_0x5be74b){return function(_0xac9ec6){if(_0xac9ec6){return _0xac9ec6[_0x9740('0x29')](_0x4cb188)[_0x9740('0x2a')](function(_0x5b81f7){return _0x5b81f7;});}return null;};}function removeEntity(_0x368b57,_0x3bd20b){return function(_0x3a5538){if(_0x3a5538){return _0x3a5538['destroy']()['then'](function(){var _0x5c3aa7=_0x3a5538['get']({'plain':!![]});var _0xc8d40c=[{'name':'InboundRoutes','value':_0x9740('0x2b'),'ignore':![]},{'name':'OutboundRoutes','value':_0x9740('0x2c'),'ignore':![]},{'name':'InternalRoutes','value':'internal','ignore':![]}];var _0x2b6e31=_(_0xc8d40c)[_0x9740('0x2d')](_0x9740('0x2e'))[_0x9740('0x2f')]('value')[_0x9740('0x30')]();if(_[_0x9740('0x31')](_0x2b6e31,_0x5c3aa7['type'])){return;}var _0x5c9e93=_[_0x9740('0x32')](_0xc8d40c,[_0x9740('0x30'),_0x5c3aa7[_0x9740('0x33')]])[_0x9740('0x34')];return db[_0x9740('0x35')]['destroy']({'where':{'type':_0x5c9e93,'resourceId':_0x5c3aa7['id']}})[_0x9740('0x2a')](function(){return _0x3a5538;});})['then'](function(){_0x368b57[_0x9740('0x1f')](0xcc)[_0x9740('0x20')]();});}};}function handleEntityNotFound(_0x5b4688,_0x3645d9){return function(_0x198519){if(!_0x198519){_0x5b4688[_0x9740('0x1e')](0x194);}return _0x198519;};}function handleError(_0x17bb3a,_0x59c164){_0x59c164=_0x59c164||0x1f4;return function(_0x13603a){logger[_0x9740('0x36')](_0x13603a['stack']);if(_0x13603a[_0x9740('0x34')]){delete _0x13603a[_0x9740('0x34')];}_0x17bb3a['status'](_0x59c164)[_0x9740('0x37')](_0x13603a);};}exports[_0x9740('0x38')]=function(_0x461ee0,_0x2eb648){var _0x32aa02={},_0x295978={},_0x2cbbb3={'count':0x0,'rows':[]};var _0x4a0710=_[_0x9740('0x2f')](db[_0x9740('0x39')][_0x9740('0x3a')],function(_0x3ab800){return{'name':_0x3ab800[_0x9740('0x3b')],'type':_0x3ab800['type'][_0x9740('0x3c')]};});_0x295978[_0x9740('0x3d')]=_['map'](_0x4a0710,_0x9740('0x34'));_0x295978[_0x9740('0x3e')]=_['keys'](_0x461ee0[_0x9740('0x3e')]);_0x295978[_0x9740('0x3f')]=_['intersection'](_0x295978['model'],_0x295978[_0x9740('0x3e')]);_0x32aa02['attributes']=_[_0x9740('0x40')](_0x295978[_0x9740('0x3d')],qs[_0x9740('0x41')](_0x461ee0[_0x9740('0x3e')][_0x9740('0x41')]));_0x32aa02[_0x9740('0x42')]=_0x32aa02[_0x9740('0x42')][_0x9740('0x43')]?_0x32aa02[_0x9740('0x42')]:_0x295978[_0x9740('0x3d')];if(!_0x461ee0[_0x9740('0x3e')]['hasOwnProperty']('nolimit')){_0x32aa02[_0x9740('0x23')]=qs[_0x9740('0x23')](_0x461ee0[_0x9740('0x3e')][_0x9740('0x23')]);_0x32aa02['offset']=qs[_0x9740('0x21')](_0x461ee0[_0x9740('0x3e')][_0x9740('0x21')]);}_0x32aa02[_0x9740('0x44')]=qs[_0x9740('0x45')](_0x461ee0[_0x9740('0x3e')]['sort']);_0x32aa02['where']=qs[_0x9740('0x3f')](_[_0x9740('0x46')](_0x461ee0[_0x9740('0x3e')],_0x295978[_0x9740('0x3f')]),_0x4a0710);if(_0x461ee0[_0x9740('0x3e')]['filter']){_0x32aa02[_0x9740('0x47')]=_['merge'](_0x32aa02['where'],{'$or':_['map'](_0x4a0710,function(_0x5a0eb6){if(_0x5a0eb6[_0x9740('0x33')]!=='VIRTUAL'){var _0x5b834a={};_0x5b834a[_0x5a0eb6[_0x9740('0x34')]]={'$like':'%'+_0x461ee0['query'][_0x9740('0x2d')]+'%'};return _0x5b834a;}})});}_0x32aa02=_['merge']({},_0x32aa02,_0x461ee0[_0x9740('0x48')]);var _0x522b9e={'where':_0x32aa02[_0x9740('0x47')]};return db[_0x9740('0x39')][_0x9740('0x24')](_0x522b9e)[_0x9740('0x2a')](function(_0x55b0b0){_0x2cbbb3[_0x9740('0x24')]=_0x55b0b0;if(_0x461ee0[_0x9740('0x3e')][_0x9740('0x49')]){_0x32aa02['include']=[{'all':!![]}];}return db[_0x9740('0x39')][_0x9740('0x4a')](_0x32aa02);})[_0x9740('0x2a')](function(_0x26c095){_0x2cbbb3[_0x9740('0x4b')]=_0x26c095;return _0x2cbbb3;})[_0x9740('0x2a')](respondWithFilteredResult(_0x2eb648,_0x32aa02))['catch'](handleError(_0x2eb648,null));};exports[_0x9740('0x4c')]=function(_0x57d71b,_0x35a727){var _0x1fff45={'raw':![],'where':{'id':_0x57d71b[_0x9740('0x4d')]['id']}},_0x242ccd={};_0x242ccd[_0x9740('0x3d')]=_[_0x9740('0x4e')](db['VoiceExtension'][_0x9740('0x3a')]);_0x242ccd['query']=_[_0x9740('0x4e')](_0x57d71b[_0x9740('0x3e')]);_0x242ccd[_0x9740('0x3f')]=_[_0x9740('0x40')](_0x242ccd['model'],_0x242ccd[_0x9740('0x3e')]);_0x1fff45['attributes']=_[_0x9740('0x40')](_0x242ccd[_0x9740('0x3d')],qs[_0x9740('0x41')](_0x57d71b[_0x9740('0x3e')]['fields']));_0x1fff45[_0x9740('0x42')]=_0x1fff45[_0x9740('0x42')][_0x9740('0x43')]?_0x1fff45['attributes']:_0x242ccd['model'];if(_0x57d71b[_0x9740('0x3e')][_0x9740('0x49')]){_0x1fff45[_0x9740('0x4f')]=[{'all':!![]}];}_0x1fff45=_[_0x9740('0x50')]({},_0x1fff45,_0x57d71b[_0x9740('0x48')]);return db[_0x9740('0x39')][_0x9740('0x32')](_0x1fff45)[_0x9740('0x2a')](handleEntityNotFound(_0x35a727,null))[_0x9740('0x2a')](respondWithResult(_0x35a727,null))[_0x9740('0x51')](handleError(_0x35a727,null));};exports[_0x9740('0x52')]=function(_0x3601a7,_0x1e218c){return db[_0x9740('0x39')][_0x9740('0x32')]({'where':{'id':_0x3601a7[_0x9740('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1e218c,null))[_0x9740('0x2a')](removeEntity(_0x1e218c,null))[_0x9740('0x51')](handleError(_0x1e218c,null));};exports[_0x9740('0x53')]=function(_0xbbd7d7,_0x482cc7){if(_0xbbd7d7[_0x9740('0x54')][_0x9740('0x33')]===_0x9740('0x2c')&&!_[_0x9740('0x55')](_0xbbd7d7[_0x9740('0x54')]['exten'],'_')){_0xbbd7d7['body']['exten']='_'[_0x9740('0x56')](_0xbbd7d7[_0x9740('0x54')]['exten']);}return db[_0x9740('0x39')][_0x9740('0x53')](_0xbbd7d7[_0x9740('0x54')],{'raw':![]})[_0x9740('0x2a')](function(_0x508860){var _0x1bf633=_0xbbd7d7['user'][_0x9740('0x57')]({'plain':!![]});if(!_0x1bf633)throw new Error(_0x9740('0x58'));if(_0x1bf633[_0x9740('0x59')]===_0x9740('0x5a')){var _0x368568=_0x508860[_0x9740('0x57')]({'plain':!![]});var _0x3a4366=[{'name':_0x9740('0x5b'),'value':'inbound'},{'name':_0x9740('0x5c'),'value':_0x9740('0x2c')},{'name':_0x9740('0x5d'),'value':_0x9740('0x5e')}];var _0x47183d=_[_0x9740('0x32')](_0x3a4366,[_0x9740('0x30'),_0x368568[_0x9740('0x33')]])[_0x9740('0x34')];return db[_0x9740('0x5f')][_0x9740('0x32')]({'where':{'name':_0x47183d,'userProfileId':_0x1bf633['userProfileId']},'raw':!![]})['then'](function(_0x447a99){if(_0x447a99&&_0x447a99[_0x9740('0x60')]===0x0){return db[_0x9740('0x35')][_0x9740('0x53')]({'name':_0x368568[_0x9740('0x34')],'resourceId':_0x368568['id'],'type':_0x447a99[_0x9740('0x34')],'sectionId':_0x447a99['id']},{})[_0x9740('0x2a')](function(){return _0x508860;});}else{return _0x508860;}})[_0x9740('0x51')](function(_0x247f24){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x247f24);throw _0x247f24;});}return _0x508860;})[_0x9740('0x2a')](respondWithResult(_0x482cc7,0xc9))[_0x9740('0x51')](handleError(_0x482cc7,null));};exports[_0x9740('0x29')]=function(_0x49b086,_0x452470){if(_0x49b086['body']['id']){delete _0x49b086[_0x9740('0x54')]['id'];}return db[_0x9740('0x39')][_0x9740('0x32')]({'where':{'id':_0x49b086['params']['id']}})[_0x9740('0x2a')](handleEntityNotFound(_0x452470,null))[_0x9740('0x2a')](function(_0x53018e){if(_0x53018e){return db[_0x9740('0x39')][_0x9740('0x29')](_['pick'](_0x49b086[_0x9740('0x54')],[_0x9740('0x61'),'context',_0x9740('0x62'),_0x9740('0x63'),_0x9740('0x64'),_0x9740('0x65'),_0x9740('0x66')]),{'where':{'context':_0x53018e[_0x9740('0x67')],'exten':_0x53018e[_0x9740('0x61')]},'individualHooks':!![]})[_0x9740('0x2a')](function(_0xf7f94a){return _0xf7f94a;});}return null;})['then'](respondWithStatusCode(_0x452470,null))[_0x9740('0x51')](handleError(_0x452470,null));};exports['addApplications']=function(_0xd1302a,_0x5d490e){return db[_0x9740('0x39')][_0x9740('0x68')]({'where':{'id':_0xd1302a['params']['id']}})[_0x9740('0x2a')](function(_0x14ebc2){if(_0x14ebc2){return db[_0x9740('0x69')][_0x9740('0x6a')](function(_0x150d94){return db[_0x9740('0x39')][_0x9740('0x52')]({'where':{'VoiceExtensionId':_0xd1302a['params']['id']},'transaction':_0x150d94})[_0x9740('0x2a')](function(){var _0x3afb6f=_[_0x9740('0x2f')](_0xd1302a['body'],function(_0x5ae981){_0x5ae981[_0x9740('0x6b')]=_0xd1302a['params']['id'];_0x5ae981[_0x9740('0x6c')]=!![];return _0x5ae981;});var _0x1fbf1e=_0xd1302a[_0x9740('0x3e')][_0x9740('0x6d')]&&_0xd1302a[_0x9740('0x3e')]['rewriteDial'][_0x9740('0x6e')]()===_0x9740('0x6f')?!![]:![];return _0x14ebc2[_0x9740('0x70')](_0x3afb6f,_0x1fbf1e);})[_0x9740('0x2a')](function(_0xd012fe){return db[_0x9740('0x39')][_0x9740('0x71')](_0xd012fe,{'transaction':_0x150d94});});})[_0x9740('0x2a')](function(){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0xd1302a['params']['id']},'order':_0x9740('0x72')});});}})['then'](respondWithResult(_0x5d490e,null))[_0x9740('0x51')](handleError(_0x5d490e,null));};
\ No newline at end of file
+var _0xd562=['true','createRouting','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceExtension.socket','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','then','destroy','get','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','includes','find','value','type','name','UserProfileResource','error','stack','send','index','map','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','create','body','startsWith','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','exten','description','recordingFormat','cutdigits','alias','context','addApplications','sequelize','transaction','VoiceExtensionId','rewriteDial'];(function(_0xd66253,_0x28277b){var _0x6cc65f=function(_0x1b6ec4){while(--_0x1b6ec4){_0xd66253['push'](_0xd66253['shift']());}};_0x6cc65f(++_0x28277b);}(_0xd562,0x77));var _0x2d56=function(_0x4028fb,_0x35d195){_0x4028fb=_0x4028fb-0x0;var _0x5984a8=_0xd562[_0x4028fb];return _0x5984a8;};'use strict';var emlformat=require(_0x2d56('0x0'));var rimraf=require(_0x2d56('0x1'));var zipdir=require(_0x2d56('0x2'));var jsonpatch=require(_0x2d56('0x3'));var rp=require(_0x2d56('0x4'));var moment=require(_0x2d56('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2d56('0x6'));var util=require('util');var path=require(_0x2d56('0x7'));var sox=require(_0x2d56('0x8'));var csv=require(_0x2d56('0x9'));var ejs=require(_0x2d56('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2d56('0xb'));var squel=require(_0x2d56('0xc'));var crypto=require(_0x2d56('0xd'));var jsforce=require(_0x2d56('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2d56('0x9'));var querystring=require(_0x2d56('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2d56('0x10'));var qs=require(_0x2d56('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2d56('0x12'));var logger=require(_0x2d56('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2d56('0x14'));var db=require(_0x2d56('0x15'))['db'];config[_0x2d56('0x16')]=_[_0x2d56('0x17')](config[_0x2d56('0x16')],{'host':_0x2d56('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x2d56('0x19'))[_0x2d56('0x1a')](socket);function respondWithStatusCode(_0x26cbc9,_0x36c19f){_0x36c19f=_0x36c19f||0xcc;return function(_0x424dc9){if(_0x424dc9){return _0x26cbc9[_0x2d56('0x1b')](_0x36c19f);}return _0x26cbc9[_0x2d56('0x1c')](_0x36c19f)[_0x2d56('0x1d')]();};}function respondWithResult(_0x20f5c4,_0x5127ff){_0x5127ff=_0x5127ff||0xc8;return function(_0x290728){if(_0x290728){return _0x20f5c4[_0x2d56('0x1c')](_0x5127ff)['json'](_0x290728);}};}function respondWithFilteredResult(_0x4b771a,_0x3a00dc){return function(_0x3b7a4d){if(_0x3b7a4d){var _0x14c5df=typeof _0x3a00dc['offset']===_0x2d56('0x1e')&&typeof _0x3a00dc[_0x2d56('0x1f')]===_0x2d56('0x1e');var _0x183c54=_0x3b7a4d[_0x2d56('0x20')];var _0x1fed02=_0x14c5df?0x0:_0x3a00dc[_0x2d56('0x21')];var _0x3f0607=_0x14c5df?_0x3b7a4d[_0x2d56('0x20')]:_0x3a00dc[_0x2d56('0x21')]+_0x3a00dc['limit'];var _0x25b833;if(_0x3f0607>=_0x183c54){_0x3f0607=_0x183c54;_0x25b833=0xc8;}else{_0x25b833=0xce;}_0x4b771a[_0x2d56('0x1c')](_0x25b833);return _0x4b771a[_0x2d56('0x22')](_0x2d56('0x23'),_0x1fed02+'-'+_0x3f0607+'/'+_0x183c54)[_0x2d56('0x24')](_0x3b7a4d);}return null;};}function patchUpdates(_0x73ec6b){return function(_0x4adb7d){try{jsonpatch[_0x2d56('0x25')](_0x4adb7d,_0x73ec6b,!![]);}catch(_0x1c0e2f){return BPromise['reject'](_0x1c0e2f);}return _0x4adb7d[_0x2d56('0x26')]();};}function saveUpdates(_0x1fa97d,_0x4c1517){return function(_0xb59722){if(_0xb59722){return _0xb59722['update'](_0x1fa97d)[_0x2d56('0x27')](function(_0xa64c37){return _0xa64c37;});}return null;};}function removeEntity(_0x340636,_0xb5d22d){return function(_0x5b459b){if(_0x5b459b){return _0x5b459b[_0x2d56('0x28')]()[_0x2d56('0x27')](function(){var _0x2b2c79=_0x5b459b[_0x2d56('0x29')]({'plain':!![]});var _0x329468=[{'name':'InboundRoutes','value':_0x2d56('0x2a'),'ignore':![]},{'name':_0x2d56('0x2b'),'value':_0x2d56('0x2c'),'ignore':![]},{'name':_0x2d56('0x2d'),'value':_0x2d56('0x2e'),'ignore':![]}];var _0x49cc98=_(_0x329468)[_0x2d56('0x2f')](_0x2d56('0x30'))['map']('value')['value']();if(_[_0x2d56('0x31')](_0x49cc98,_0x2b2c79['type'])){return;}var _0x5626dd=_[_0x2d56('0x32')](_0x329468,[_0x2d56('0x33'),_0x2b2c79[_0x2d56('0x34')]])[_0x2d56('0x35')];return db[_0x2d56('0x36')]['destroy']({'where':{'type':_0x5626dd,'resourceId':_0x2b2c79['id']}})[_0x2d56('0x27')](function(){return _0x5b459b;});})[_0x2d56('0x27')](function(){_0x340636[_0x2d56('0x1c')](0xcc)[_0x2d56('0x1d')]();});}};}function handleEntityNotFound(_0x542148,_0x44ab0f){return function(_0x2a224b){if(!_0x2a224b){_0x542148[_0x2d56('0x1b')](0x194);}return _0x2a224b;};}function handleError(_0x167274,_0x183590){_0x183590=_0x183590||0x1f4;return function(_0x8e5f26){logger[_0x2d56('0x37')](_0x8e5f26[_0x2d56('0x38')]);if(_0x8e5f26[_0x2d56('0x35')]){delete _0x8e5f26['name'];}_0x167274['status'](_0x183590)[_0x2d56('0x39')](_0x8e5f26);};}exports[_0x2d56('0x3a')]=function(_0x3c02f6,_0x5969b2){var _0x3f2120={},_0x214798={},_0x4c4718={'count':0x0,'rows':[]};var _0x5739cf=_[_0x2d56('0x3b')](db[_0x2d56('0x3c')][_0x2d56('0x3d')],function(_0x273577){return{'name':_0x273577[_0x2d56('0x3e')],'type':_0x273577[_0x2d56('0x34')][_0x2d56('0x3f')]};});_0x214798[_0x2d56('0x40')]=_[_0x2d56('0x3b')](_0x5739cf,_0x2d56('0x35'));_0x214798[_0x2d56('0x41')]=_[_0x2d56('0x42')](_0x3c02f6[_0x2d56('0x41')]);_0x214798[_0x2d56('0x43')]=_[_0x2d56('0x44')](_0x214798['model'],_0x214798['query']);_0x3f2120['attributes']=_['intersection'](_0x214798[_0x2d56('0x40')],qs[_0x2d56('0x45')](_0x3c02f6[_0x2d56('0x41')][_0x2d56('0x45')]));_0x3f2120[_0x2d56('0x46')]=_0x3f2120['attributes'][_0x2d56('0x47')]?_0x3f2120[_0x2d56('0x46')]:_0x214798[_0x2d56('0x40')];if(!_0x3c02f6[_0x2d56('0x41')][_0x2d56('0x48')]('nolimit')){_0x3f2120[_0x2d56('0x1f')]=qs[_0x2d56('0x1f')](_0x3c02f6[_0x2d56('0x41')]['limit']);_0x3f2120[_0x2d56('0x21')]=qs[_0x2d56('0x21')](_0x3c02f6[_0x2d56('0x41')][_0x2d56('0x21')]);}_0x3f2120[_0x2d56('0x49')]=qs[_0x2d56('0x4a')](_0x3c02f6[_0x2d56('0x41')][_0x2d56('0x4a')]);_0x3f2120[_0x2d56('0x4b')]=qs[_0x2d56('0x43')](_['pick'](_0x3c02f6[_0x2d56('0x41')],_0x214798[_0x2d56('0x43')]),_0x5739cf);if(_0x3c02f6[_0x2d56('0x41')][_0x2d56('0x2f')]){_0x3f2120[_0x2d56('0x4b')]=_[_0x2d56('0x4c')](_0x3f2120[_0x2d56('0x4b')],{'$or':_[_0x2d56('0x3b')](_0x5739cf,function(_0x22f283){if(_0x22f283[_0x2d56('0x34')]!==_0x2d56('0x4d')){var _0x38d27d={};_0x38d27d[_0x22f283[_0x2d56('0x35')]]={'$like':'%'+_0x3c02f6[_0x2d56('0x41')][_0x2d56('0x2f')]+'%'};return _0x38d27d;}})});}_0x3f2120=_[_0x2d56('0x4c')]({},_0x3f2120,_0x3c02f6[_0x2d56('0x4e')]);var _0x4038a8={'where':_0x3f2120[_0x2d56('0x4b')]};return db[_0x2d56('0x3c')][_0x2d56('0x20')](_0x4038a8)[_0x2d56('0x27')](function(_0x4b8d08){_0x4c4718['count']=_0x4b8d08;if(_0x3c02f6[_0x2d56('0x41')][_0x2d56('0x4f')]){_0x3f2120[_0x2d56('0x50')]=[{'all':!![]}];}return db[_0x2d56('0x3c')]['findAll'](_0x3f2120);})[_0x2d56('0x27')](function(_0x4f1b7b){_0x4c4718[_0x2d56('0x51')]=_0x4f1b7b;return _0x4c4718;})['then'](respondWithFilteredResult(_0x5969b2,_0x3f2120))[_0x2d56('0x52')](handleError(_0x5969b2,null));};exports[_0x2d56('0x53')]=function(_0x10213e,_0x640a85){var _0x5a277b={'raw':![],'where':{'id':_0x10213e[_0x2d56('0x54')]['id']}},_0x542c9a={};_0x542c9a['model']=_['keys'](db[_0x2d56('0x3c')][_0x2d56('0x3d')]);_0x542c9a[_0x2d56('0x41')]=_[_0x2d56('0x42')](_0x10213e['query']);_0x542c9a[_0x2d56('0x43')]=_[_0x2d56('0x44')](_0x542c9a[_0x2d56('0x40')],_0x542c9a[_0x2d56('0x41')]);_0x5a277b[_0x2d56('0x46')]=_['intersection'](_0x542c9a['model'],qs[_0x2d56('0x45')](_0x10213e[_0x2d56('0x41')][_0x2d56('0x45')]));_0x5a277b['attributes']=_0x5a277b[_0x2d56('0x46')][_0x2d56('0x47')]?_0x5a277b[_0x2d56('0x46')]:_0x542c9a[_0x2d56('0x40')];if(_0x10213e[_0x2d56('0x41')][_0x2d56('0x4f')]){_0x5a277b[_0x2d56('0x50')]=[{'all':!![]}];}_0x5a277b=_[_0x2d56('0x4c')]({},_0x5a277b,_0x10213e['options']);return db[_0x2d56('0x3c')][_0x2d56('0x32')](_0x5a277b)[_0x2d56('0x27')](handleEntityNotFound(_0x640a85,null))[_0x2d56('0x27')](respondWithResult(_0x640a85,null))[_0x2d56('0x52')](handleError(_0x640a85,null));};exports[_0x2d56('0x28')]=function(_0x1060fa,_0x304c18){return db[_0x2d56('0x3c')][_0x2d56('0x32')]({'where':{'id':_0x1060fa[_0x2d56('0x54')]['id']}})[_0x2d56('0x27')](handleEntityNotFound(_0x304c18,null))[_0x2d56('0x27')](removeEntity(_0x304c18,null))[_0x2d56('0x52')](handleError(_0x304c18,null));};exports[_0x2d56('0x55')]=function(_0x17c131,_0x4aae09){if(_0x17c131[_0x2d56('0x56')][_0x2d56('0x34')]===_0x2d56('0x2c')&&!_[_0x2d56('0x57')](_0x17c131['body']['exten'],'_')){_0x17c131[_0x2d56('0x56')]['exten']='_'[_0x2d56('0x58')](_0x17c131['body']['exten']);}return db[_0x2d56('0x3c')][_0x2d56('0x55')](_0x17c131[_0x2d56('0x56')],{'raw':![]})[_0x2d56('0x27')](function(_0x478035){var _0x15d728=_0x17c131[_0x2d56('0x59')][_0x2d56('0x29')]({'plain':!![]});if(!_0x15d728)throw new Error(_0x2d56('0x5a'));if(_0x15d728[_0x2d56('0x5b')]===_0x2d56('0x59')){var _0x46e5ca=_0x478035[_0x2d56('0x29')]({'plain':!![]});var _0x33512b=[{'name':'InboundRoutes','value':_0x2d56('0x2a')},{'name':_0x2d56('0x2b'),'value':_0x2d56('0x2c')},{'name':_0x2d56('0x2d'),'value':_0x2d56('0x2e')}];var _0x2719d6=_[_0x2d56('0x32')](_0x33512b,['value',_0x46e5ca[_0x2d56('0x34')]])['name'];return db[_0x2d56('0x5c')][_0x2d56('0x32')]({'where':{'name':_0x2719d6,'userProfileId':_0x15d728[_0x2d56('0x5d')]},'raw':!![]})[_0x2d56('0x27')](function(_0x2f8da0){if(_0x2f8da0&&_0x2f8da0[_0x2d56('0x5e')]===0x0){return db[_0x2d56('0x36')]['create']({'name':_0x46e5ca[_0x2d56('0x35')],'resourceId':_0x46e5ca['id'],'type':_0x2f8da0[_0x2d56('0x35')],'sectionId':_0x2f8da0['id']},{})['then'](function(){return _0x478035;});}else{return _0x478035;}})[_0x2d56('0x52')](function(_0xfa318d){logger[_0x2d56('0x37')](_0x2d56('0x5f'),_0xfa318d);throw _0xfa318d;});}return _0x478035;})['then'](respondWithResult(_0x4aae09,0xc9))['catch'](handleError(_0x4aae09,null));};exports[_0x2d56('0x60')]=function(_0xf6386b,_0x3e9013){if(_0xf6386b['body']['id']){delete _0xf6386b['body']['id'];}return db[_0x2d56('0x3c')][_0x2d56('0x32')]({'where':{'id':_0xf6386b[_0x2d56('0x54')]['id']}})[_0x2d56('0x27')](handleEntityNotFound(_0x3e9013,null))['then'](function(_0x15caa6){if(_0x15caa6){return db[_0x2d56('0x3c')][_0x2d56('0x60')](_[_0x2d56('0x61')](_0xf6386b[_0x2d56('0x56')],[_0x2d56('0x62'),'context',_0x2d56('0x63'),_0x2d56('0x64'),_0x2d56('0x65'),'mandatoryDisposition',_0x2d56('0x66')]),{'where':{'context':_0x15caa6[_0x2d56('0x67')],'exten':_0x15caa6[_0x2d56('0x62')]},'individualHooks':!![]})[_0x2d56('0x27')](function(_0x5e30db){return _0x5e30db;});}return null;})[_0x2d56('0x27')](respondWithStatusCode(_0x3e9013,null))[_0x2d56('0x52')](handleError(_0x3e9013,null));};exports[_0x2d56('0x68')]=function(_0x18480e,_0x1a3a83){return db[_0x2d56('0x3c')]['findOne']({'where':{'id':_0x18480e[_0x2d56('0x54')]['id']}})[_0x2d56('0x27')](function(_0x26cf4a){if(_0x26cf4a){return db[_0x2d56('0x69')][_0x2d56('0x6a')](function(_0x49139d){return db[_0x2d56('0x3c')][_0x2d56('0x28')]({'where':{'VoiceExtensionId':_0x18480e[_0x2d56('0x54')]['id']},'transaction':_0x49139d})[_0x2d56('0x27')](function(){var _0x33c081=_[_0x2d56('0x3b')](_0x18480e['body'],function(_0x33456f){_0x33456f[_0x2d56('0x6b')]=_0x18480e[_0x2d56('0x54')]['id'];_0x33456f['isApp']=!![];return _0x33456f;});var _0x57a810=_0x18480e[_0x2d56('0x41')]['rewriteDial']&&_0x18480e[_0x2d56('0x41')][_0x2d56('0x6c')]['toLowerCase']()===_0x2d56('0x6d')?!![]:![];return _0x26cf4a[_0x2d56('0x6e')](_0x33c081,_0x57a810);})[_0x2d56('0x27')](function(_0x217b3c){return db[_0x2d56('0x3c')][_0x2d56('0x6f')](_0x217b3c,{'transaction':_0x49139d});});})['then'](function(){return db[_0x2d56('0x3c')][_0x2d56('0x70')]({'where':{'isApp':!![],'VoiceExtensionId':_0x18480e[_0x2d56('0x54')]['id']},'order':_0x2d56('0x71')});});}})[_0x2d56('0x27')](respondWithResult(_0x1a3a83,null))[_0x2d56('0x52')](handleError(_0x1a3a83,null));};
\ No newline at end of file
index 9fd1fd9..943ae84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4b89=['save','update','remove','hasOwnProperty','hook','../../mysqldb','VoiceExtension','setMaxListeners'];(function(_0x95bc9a,_0xa48e4e){var _0x1d5185=function(_0x513145){while(--_0x513145){_0x95bc9a['push'](_0x95bc9a['shift']());}};_0x1d5185(++_0xa48e4e);}(_0x4b89,0x14d));var _0x94b8=function(_0x7261e6,_0x3e3bf7){_0x7261e6=_0x7261e6-0x0;var _0x20d5ed=_0x4b89[_0x7261e6];return _0x20d5ed;};'use strict';var EventEmitter=require('events');var VoiceExtension=require(_0x94b8('0x0'))['db'][_0x94b8('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x94b8('0x2')](0x0);var events={'afterCreate':_0x94b8('0x3'),'afterUpdate':_0x94b8('0x4'),'afterDestroy':_0x94b8('0x5')};function emitEvent(_0x546a84){return function(_0x5f4545,_0x454d1d,_0x1044b9){VoiceExtensionEvents['emit'](_0x546a84+':'+_0x5f4545['id'],_0x5f4545);VoiceExtensionEvents['emit'](_0x546a84,_0x5f4545);_0x1044b9(null);};}for(var e in events){if(events[_0x94b8('0x6')](e)){var event=events[e];VoiceExtension[_0x94b8('0x7')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents;
\ No newline at end of file
+var _0xe87d=['setMaxListeners','save','update','emit','hasOwnProperty','exports','events','../../mysqldb','VoiceExtension'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xe87d,0x189));var _0xde87=function(_0x4fc904,_0x3a5094){_0x4fc904=_0x4fc904-0x0;var _0xe63df=_0xe87d[_0x4fc904];return _0xe63df;};'use strict';var EventEmitter=require(_0xde87('0x0'));var VoiceExtension=require(_0xde87('0x1'))['db'][_0xde87('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xde87('0x3')](0x0);var events={'afterCreate':_0xde87('0x4'),'afterUpdate':_0xde87('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4a8893){return function(_0x57789f,_0x53cdae,_0xad53b6){VoiceExtensionEvents[_0xde87('0x6')](_0x4a8893+':'+_0x57789f['id'],_0x57789f);VoiceExtensionEvents[_0xde87('0x6')](_0x4a8893,_0x57789f);_0xad53b6(null);};}for(var e in events){if(events[_0xde87('0x7')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0xde87('0x8')]=VoiceExtensionEvents;
\ No newline at end of file
index c7517eb..0f511e2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x37d9=['XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','CDR(routeid)=','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','length','name','param','phone','split','prefix','SIP','join','options','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','tag','toLowerCase','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','playback','includes','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','appdata','priority','last','concat','catch','define','VoiceExtension','voice_extensions','Hangup','util','./voiceExtension.attributes','exports','Set','type','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','XCALLY-MOTION-ANSWER=0'];(function(_0x7adb9e,_0x1c7475){var _0x3ac44d=function(_0x207c7a){while(--_0x207c7a){_0x7adb9e['push'](_0x7adb9e['shift']());}};_0x3ac44d(++_0x1c7475);}(_0x37d9,0x1d2));var _0x937d=function(_0x567e42,_0x39fca5){_0x567e42=_0x567e42-0x0;var _0x289a28=_0x37d9[_0x567e42];return _0x289a28;};'use strict';var util=require(_0x937d('0x0'));var _=require('lodash');var attributes=require(_0x937d('0x1'));module[_0x937d('0x2')]=function(_0x3ac3d3){var _0x16fa17=_0x3ac3d3['models'];function _0x4c1ac1(_0x535ab1){var _0x3c3096=0x2;var _0x42d185=[{'type':_0x535ab1['type'],'app':_0x937d('0x3'),'appdata':'CDR(type)='+_0x535ab1[_0x937d('0x4')],'context':_0x535ab1[_0x937d('0x5')],'exten':_0x535ab1[_0x937d('0x6')],'priority':_0x3c3096++,'VoiceExtensionId':_0x535ab1['id']},{'type':_0x535ab1[_0x937d('0x4')],'app':_0x535ab1[_0x937d('0x7')]?_0x937d('0x3'):_0x937d('0x8'),'appdata':_0x535ab1[_0x937d('0x7')]?_0x937d('0x9')+_0x535ab1[_0x937d('0x7')]:_0x937d('0xa'),'context':_0x535ab1[_0x937d('0x5')],'exten':_0x535ab1[_0x937d('0x6')],'priority':_0x3c3096++,'VoiceExtensionId':_0x535ab1['id']}];if(_0x535ab1['type']===_0x937d('0xb')){_0x42d185[_0x937d('0xc')]({'type':_0x937d('0xb'),'app':_0x937d('0x3'),'appdata':'CDR(routeid)='+_0x535ab1['id'],'context':_0x535ab1[_0x937d('0x5')],'exten':_0x535ab1[_0x937d('0x6')],'priority':_0x3c3096++,'VoiceExtensionId':_0x535ab1['id']});}_0x42d185[_0x937d('0xc')]({'type':_0x535ab1['type'],'app':_0x937d('0x3'),'appdata':_0x937d('0xd'),'context':_0x535ab1[_0x937d('0x5')],'exten':_0x535ab1[_0x937d('0x6')],'priority':_0x3c3096++,'VoiceExtensionId':_0x535ab1['id']},{'type':_0x535ab1['type'],'app':'Set','appdata':_0x937d('0xe'),'context':_0x535ab1['context'],'exten':_0x535ab1['exten'],'priority':_0x3c3096++,'VoiceExtensionId':_0x535ab1['id']},{'type':_0x535ab1[_0x937d('0x4')],'app':_0x937d('0x3'),'appdata':_0x937d('0xf'),'context':_0x535ab1[_0x937d('0x5')],'exten':_0x535ab1['exten'],'priority':_0x3c3096++,'VoiceExtensionId':_0x535ab1['id']});return _0x42d185;}function _0x39c44a(_0x5f1d8c){var _0x18696d=0x2;var _0x45f0b1=[{'type':_0x937d('0x10'),'app':_0x937d('0x3'),'appdata':_0x937d('0x11'),'context':_0x5f1d8c['context'],'exten':_0x5f1d8c[_0x937d('0x6')],'priority':_0x18696d++,'VoiceExtensionId':_0x5f1d8c['id']},{'type':'outbound','app':_0x5f1d8c[_0x937d('0x7')]?'Set':_0x937d('0x8'),'appdata':_0x5f1d8c[_0x937d('0x7')]?'CDR(routeAlias)='+_0x5f1d8c['alias']:'No\x20alias\x20set','context':_0x5f1d8c[_0x937d('0x5')],'exten':_0x5f1d8c[_0x937d('0x6')],'priority':_0x18696d++,'VoiceExtensionId':_0x5f1d8c['id']},{'type':_0x937d('0x10'),'app':_0x937d('0x3'),'appdata':_0x937d('0x12')+(_0x5f1d8c[_0x937d('0x13')]?_0x937d('0x14')+_0x5f1d8c[_0x937d('0x13')]+'}':'${EXTEN}'),'context':_0x5f1d8c[_0x937d('0x5')],'exten':_0x5f1d8c['exten'],'priority':_0x18696d++,'VoiceExtensionId':_0x5f1d8c['id']},{'type':_0x937d('0x10'),'app':_0x937d('0x3'),'appdata':_0x937d('0x15')+_0x5f1d8c['id'],'context':_0x5f1d8c[_0x937d('0x5')],'exten':_0x5f1d8c[_0x937d('0x6')],'priority':_0x18696d++,'VoiceExtensionId':_0x5f1d8c['id']},{'type':_0x937d('0x10'),'app':_0x937d('0x16'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x18696d+0x2)+_0x937d('0x17')+(_0x18696d+0x1)+')','context':_0x5f1d8c[_0x937d('0x5')],'exten':_0x5f1d8c[_0x937d('0x6')],'priority':_0x18696d++,'VoiceExtensionId':_0x5f1d8c['id']},{'type':_0x937d('0x10'),'app':_0x937d('0x3'),'appdata':_0x5f1d8c[_0x937d('0x13')]?_0x937d('0x18')+_0x5f1d8c[_0x937d('0x13')]+'}':_0x937d('0x19'),'context':_0x5f1d8c['context'],'exten':_0x5f1d8c[_0x937d('0x6')],'priority':_0x18696d++,'VoiceExtensionId':_0x5f1d8c['id']},{'type':'outbound','app':'Set','appdata':_0x937d('0xd'),'context':_0x5f1d8c['context'],'exten':_0x5f1d8c[_0x937d('0x6')],'priority':_0x18696d++,'VoiceExtensionId':_0x5f1d8c['id']},{'type':_0x937d('0x10'),'app':_0x937d('0x3'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x5f1d8c[_0x937d('0x5')],'exten':_0x5f1d8c[_0x937d('0x6')],'priority':_0x18696d++,'VoiceExtensionId':_0x5f1d8c['id']},{'type':'outbound','app':_0x937d('0x3'),'appdata':_0x937d('0xf'),'context':_0x5f1d8c[_0x937d('0x5')],'exten':_0x5f1d8c[_0x937d('0x6')],'priority':_0x18696d++,'VoiceExtensionId':_0x5f1d8c['id']},{'type':'outbound','app':_0x937d('0x3'),'appdata':_0x937d('0x1a')+_0x5f1d8c['id'],'context':_0x5f1d8c[_0x937d('0x5')],'exten':_0x5f1d8c[_0x937d('0x6')],'priority':_0x18696d++,'VoiceExtensionId':_0x5f1d8c['id']}];if(_0x5f1d8c[_0x937d('0x1b')]('recordingFormat')&&_0x5f1d8c[_0x937d('0x1c')]!==_0x937d('0x1d')){_0x45f0b1[_0x937d('0xc')]({'type':_0x937d('0x10'),'app':_0x937d('0x3'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x5f1d8c[_0x937d('0x5')],'exten':_0x5f1d8c[_0x937d('0x6')],'priority':_0x18696d++,'VoiceExtensionId':_0x5f1d8c['id']},{'type':'outbound','app':_0x937d('0x3'),'appdata':_0x937d('0x1e')+_0x5f1d8c['recordingFormat']||_0x937d('0x1f'),'context':_0x5f1d8c['context'],'exten':_0x5f1d8c['exten'],'priority':_0x18696d++,'VoiceExtensionId':_0x5f1d8c['id']});}return _0x45f0b1;}function _0x2009f8(_0x3b6a6d){var _0x4907f7=[{'name':_0x937d('0x20'),'param':0x0},{'name':_0x937d('0x21'),'param':0x1},{'name':'options','param':0x2},{'name':'url','param':0x3}];var _0x311916={};var _0x2fa0b4=_0x3b6a6d['split'](',');var _0x1c74f5=[];for(var _0x43388d=0x0;_0x43388d<_0x4907f7[_0x937d('0x22')];_0x43388d++){switch(_0x4907f7[_0x43388d][_0x937d('0x23')]){case _0x937d('0x20'):_0x311916[_0x937d('0x20')]=_0x2fa0b4[_0x4907f7[_0x43388d][_0x937d('0x24')]]['split']('/')[0x1];_0x311916[_0x937d('0x25')]=_0x2fa0b4[_0x4907f7[_0x43388d][_0x937d('0x24')]][_0x937d('0x26')]('/')[0x2];_0x311916[_0x937d('0x27')]=_0x311916[_0x937d('0x25')]?_0x311916[_0x937d('0x25')][_0x937d('0x26')]('$')[0x0]:undefined;_0x311916[_0x937d('0x25')]=route[_0x937d('0x13')]?(_0x311916[_0x937d('0x27')]||'')+_0x937d('0x14')+route[_0x937d('0x13')]+'}':(_0x311916[_0x937d('0x27')]||'')+'${EXTEN}';_0x1c74f5[_0x4907f7[_0x43388d][_0x937d('0x24')]]=[_0x937d('0x28'),_0x311916[_0x937d('0x20')],_0x311916[_0x937d('0x25')]][_0x937d('0x29')]('/');break;case _0x937d('0x2a'):_0x311916['options']=_0x2fa0b4[_0x4907f7[_0x43388d][_0x937d('0x24')]];if(route[_0x937d('0x1c')]!==_0x937d('0x1d')){if(_0x311916['options'][_0x937d('0x2b')]('U(xcally-mixmonitor-context)')<0x0){_0x311916[_0x937d('0x2a')]+='U(xcally-mixmonitor-context)';}}else{_0x311916['options']=_0x311916[_0x937d('0x2a')]['replace'](_0x937d('0x2c'),'');}_0x1c74f5[_0x4907f7[_0x43388d][_0x937d('0x24')]]=_0x311916[_0x937d('0x2a')];break;default:_0x1c74f5[_0x4907f7[_0x43388d][_0x937d('0x24')]]=_0x2fa0b4[_0x4907f7[_0x43388d]['param']];}}return _0x1c74f5[_0x937d('0x29')](',');}function _0x549a5c(_0x4d9d22,_0x1b5621,_0x22d340,_0x23e3a6){return new Promise(function(_0x3bd64b,_0x50e247){var _0x54f8a8=[];if(_[_0x937d('0x2d')](_0x1b5621))return _0x3bd64b(_0x54f8a8);_0x16fa17[_0x937d('0x2e')][_0x937d('0x2f')]({'attributes':['id',_0x937d('0x30'),_0x937d('0x31')],'raw':!![]})[_0x937d('0x32')](function(_0x2a16c1){for(var _0x41ae1e=0x0,_0x4a339b=0x0;_0x41ae1e<_0x1b5621['length'];_0x41ae1e++,_0x4a339b=0x0){var _0x221c89=_0x1b5621[_0x41ae1e];var _0x555126=[];var _0x44329c=[];if(_0x221c89['interval']!==_0x937d('0x33')){_0x221c89[_0x937d('0x34')]=[_0x221c89[_0x937d('0x30')]];}else{_0x221c89[_0x937d('0x34')]=_0x221c89['IntervalId']?_[_0x937d('0x35')](_['filter'](_0x2a16c1,{'IntervalId':_0x221c89[_0x937d('0x31')]}),_0x937d('0x30')):[];}_0x221c89[_0x937d('0x5')]=_0x4d9d22[_0x937d('0x5')];_0x221c89['exten']=_0x4d9d22[_0x937d('0x6')];if(_0x221c89[_0x937d('0x4')])_0x221c89['type']=_0x221c89[_0x937d('0x4')]['toLowerCase']();if(_0x4d9d22[_0x937d('0x4')]==='outbound'){if(_0x221c89[_0x937d('0x1b')](_0x937d('0x36'))&&_0x221c89[_0x937d('0x36')]&&_0x221c89[_0x937d('0x36')]!=='--'){_0x555126[_0x937d('0xc')]({'type':_0x221c89[_0x937d('0x4')]['toLowerCase'](),'app':_0x937d('0x3'),'appdata':'CDR(tag)='+_0x221c89['tag'],'context':_0x4d9d22[_0x937d('0x5')],'exten':_0x4d9d22['exten'],'priority':_0x221c89[_0x937d('0x34')]['length']+_0x22d340+_0x4a339b++,'VoiceExtensionId':_0x4d9d22['id']});}_0x555126[_0x937d('0xc')]({'type':_0x221c89['type'][_0x937d('0x37')](),'app':_0x937d('0x16'),'appdata':_0x937d('0x38')+(_0x221c89[_0x937d('0x39')]?_0x937d('0x3a')+_0x221c89[_0x937d('0x39')]+')':_0x937d('0x3b')),'context':_0x4d9d22[_0x937d('0x5')],'exten':_0x4d9d22[_0x937d('0x6')],'priority':_0x221c89['intervals'][_0x937d('0x22')]+_0x22d340+_0x4a339b++,'VoiceExtensionId':_0x4d9d22['id']});}else{if(_0x221c89[_0x937d('0x1b')](_0x937d('0x3c'))){if(['queue',_0x937d('0x3d')][_0x937d('0x3e')](_0x221c89[_0x937d('0x3f')][_0x937d('0x37')]())&&_0x221c89[_0x937d('0x40')]!==_0x937d('0x41')){if(_0x221c89[_0x937d('0x3c')]){_0x555126[_0x937d('0xc')]({'type':_0x221c89[_0x937d('0x4')][_0x937d('0x37')](),'app':_0x937d('0x16'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x4d9d22[_0x937d('0x5')],'exten':_0x4d9d22['exten'],'priority':_0x221c89[_0x937d('0x34')][_0x937d('0x22')]+_0x22d340+_0x4a339b++,'VoiceExtensionId':_0x4d9d22['id']});_0x555126[_0x937d('0xc')]({'type':_0x221c89[_0x937d('0x4')]['toLowerCase'](),'app':_0x937d('0x3'),'appdata':_0x937d('0x42'),'context':_0x4d9d22[_0x937d('0x5')],'exten':_0x4d9d22[_0x937d('0x6')],'priority':_0x221c89[_0x937d('0x34')]['length']+_0x22d340+_0x4a339b++,'VoiceExtensionId':_0x4d9d22['id']});}else{_0x555126[_0x937d('0xc')]({'type':_0x221c89[_0x937d('0x4')][_0x937d('0x37')](),'app':_0x937d('0x16'),'appdata':_0x937d('0x43'),'context':_0x4d9d22[_0x937d('0x5')],'exten':_0x4d9d22[_0x937d('0x6')],'priority':_0x221c89[_0x937d('0x34')][_0x937d('0x22')]+_0x22d340+_0x4a339b++,'VoiceExtensionId':_0x4d9d22['id']});_0x555126[_0x937d('0xc')]({'type':_0x221c89['type'][_0x937d('0x37')](),'app':_0x937d('0x3'),'appdata':_0x937d('0x44'),'context':_0x4d9d22[_0x937d('0x5')],'exten':_0x4d9d22[_0x937d('0x6')],'priority':_0x221c89[_0x937d('0x34')]['length']+_0x22d340+_0x4a339b++,'VoiceExtensionId':_0x4d9d22['id']});}}}}for(var _0x143a2f=0x0;_0x143a2f<_0x221c89[_0x937d('0x34')][_0x937d('0x22')];_0x143a2f++){var _0x17f9db=_0x22d340+_0x221c89[_0x937d('0x34')][_0x937d('0x22')];var _0x1e0e0c=_0x143a2f===_0x221c89[_0x937d('0x34')][_0x937d('0x22')]-0x1?_0x22d340+_0x555126[_0x937d('0x22')]+_0x44329c[_0x937d('0x22')]+0x2:_0x22d340+_0x143a2f+0x1;_0x555126[_0x937d('0x45')](_0x143a2f,0x0,{'type':_0x4d9d22[_0x937d('0x4')],'app':'GotoIfTime','appdata':_0x221c89[_0x937d('0x34')][_0x143a2f]+'?'+_0x4d9d22[_0x937d('0x5')]+_0x937d('0x46')+_0x17f9db+':'+_0x4d9d22[_0x937d('0x5')]+_0x937d('0x46')+_0x1e0e0c,'exten':_0x4d9d22[_0x937d('0x6')],'context':_0x4d9d22['context'],'priority':_0x22d340+_0x143a2f,'VoiceExtensionId':_0x4d9d22['id']});}if(_0x23e3a6&&_0x221c89[_0x937d('0x40')]==='outboundDial')_0x221c89[_0x937d('0x47')]=_0x2009f8(_0x221c89[_0x937d('0x47')]);_0x221c89[_0x937d('0x48')]=_0x555126[_0x937d('0x22')]?_[_0x937d('0x49')](_0x555126)[_0x937d('0x48')]+0x1:_0x22d340;_0x54f8a8=_[_0x937d('0x4a')](_0x54f8a8,_0x555126,[_0x221c89],_0x44329c);_0x22d340=_[_0x937d('0x49')](_0x54f8a8)[_0x937d('0x48')]+0x1;}return _0x3bd64b(_0x54f8a8);})[_0x937d('0x4b')](function(_0x165103){_0x50e247(_0x165103);});});}return _0x3ac3d3[_0x937d('0x4c')](_0x937d('0x4d'),attributes,{'tableName':_0x937d('0x4e'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x37e903,_0x14901e){var _0x1d4917=this;var _0x390073=_0x1d4917['type']===_0x937d('0x10')?_0x39c44a(_0x1d4917):_0x4c1ac1(_0x1d4917);return _0x549a5c(_0x1d4917,_0x37e903,_[_0x937d('0x49')](_0x390073)[_0x937d('0x48')]+0x1,_0x14901e)[_0x937d('0x32')](function(_0x4f5ac2){var _0x1402a8=_[_0x937d('0x4a')](_0x390073,_0x4f5ac2);_0x1402a8[_0x937d('0xc')]({'type':_0x1d4917[_0x937d('0x4')],'app':_0x937d('0x4f'),'exten':_0x1d4917[_0x937d('0x6')],'context':_0x1d4917[_0x937d('0x5')],'priority':_[_0x937d('0x49')](_0x1402a8)[_0x937d('0x48')]+0x1,'VoiceExtensionId':_0x1d4917['id']});return _0x1402a8;});}}});};
\ No newline at end of file
+var _0xb257=['appdata','last','concat','priority','catch','define','VoiceExtension','voice_extensions','then','Hangup','util','lodash','./voiceExtension.attributes','type','Set','context','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','exten','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','trunk','timeout','url','length','name','param','split','phone','prefix','${EXTEN:','SIP','join','options','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','IntervalId','interval','map','filter','toLowerCase','tag','CDR(tag)=','intervals','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','answer','playback','includes','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','outboundDial'];(function(_0x29e69d,_0x58f663){var _0x42d037=function(_0x33dc1f){while(--_0x33dc1f){_0x29e69d['push'](_0x29e69d['shift']());}};_0x42d037(++_0x58f663);}(_0xb257,0x152));var _0x7b25=function(_0x3936a6,_0x3f33ca){_0x3936a6=_0x3936a6-0x0;var _0x26f784=_0xb257[_0x3936a6];return _0x26f784;};'use strict';var util=require(_0x7b25('0x0'));var _=require(_0x7b25('0x1'));var attributes=require(_0x7b25('0x2'));module['exports']=function(_0x543333){var _0x27ba50=_0x543333['models'];function _0x8dc77c(_0x2fceb1){var _0x5da866=0x2;var _0x10b352=[{'type':_0x2fceb1[_0x7b25('0x3')],'app':_0x7b25('0x4'),'appdata':'CDR(type)='+_0x2fceb1['type'],'context':_0x2fceb1[_0x7b25('0x5')],'exten':_0x2fceb1['exten'],'priority':_0x5da866++,'VoiceExtensionId':_0x2fceb1['id']},{'type':_0x2fceb1[_0x7b25('0x3')],'app':_0x2fceb1[_0x7b25('0x6')]?_0x7b25('0x4'):_0x7b25('0x7'),'appdata':_0x2fceb1['alias']?_0x7b25('0x8')+_0x2fceb1[_0x7b25('0x6')]:_0x7b25('0x9'),'context':_0x2fceb1[_0x7b25('0x5')],'exten':_0x2fceb1[_0x7b25('0xa')],'priority':_0x5da866++,'VoiceExtensionId':_0x2fceb1['id']}];if(_0x2fceb1[_0x7b25('0x3')]===_0x7b25('0xb')){_0x10b352[_0x7b25('0xc')]({'type':_0x7b25('0xb'),'app':_0x7b25('0x4'),'appdata':_0x7b25('0xd')+_0x2fceb1['id'],'context':_0x2fceb1[_0x7b25('0x5')],'exten':_0x2fceb1[_0x7b25('0xa')],'priority':_0x5da866++,'VoiceExtensionId':_0x2fceb1['id']});}_0x10b352[_0x7b25('0xc')]({'type':_0x2fceb1[_0x7b25('0x3')],'app':_0x7b25('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x2fceb1['context'],'exten':_0x2fceb1[_0x7b25('0xa')],'priority':_0x5da866++,'VoiceExtensionId':_0x2fceb1['id']},{'type':_0x2fceb1[_0x7b25('0x3')],'app':_0x7b25('0x4'),'appdata':_0x7b25('0xe'),'context':_0x2fceb1['context'],'exten':_0x2fceb1[_0x7b25('0xa')],'priority':_0x5da866++,'VoiceExtensionId':_0x2fceb1['id']},{'type':_0x2fceb1['type'],'app':_0x7b25('0x4'),'appdata':_0x7b25('0xf'),'context':_0x2fceb1[_0x7b25('0x5')],'exten':_0x2fceb1['exten'],'priority':_0x5da866++,'VoiceExtensionId':_0x2fceb1['id']});return _0x10b352;}function _0x19808a(_0x1f7e74){var _0x284e91=0x2;var _0x5e54ee=[{'type':_0x7b25('0x10'),'app':_0x7b25('0x4'),'appdata':_0x7b25('0x11'),'context':_0x1f7e74[_0x7b25('0x5')],'exten':_0x1f7e74[_0x7b25('0xa')],'priority':_0x284e91++,'VoiceExtensionId':_0x1f7e74['id']},{'type':'outbound','app':_0x1f7e74[_0x7b25('0x6')]?_0x7b25('0x4'):'NoOp','appdata':_0x1f7e74['alias']?_0x7b25('0x8')+_0x1f7e74[_0x7b25('0x6')]:_0x7b25('0x9'),'context':_0x1f7e74[_0x7b25('0x5')],'exten':_0x1f7e74['exten'],'priority':_0x284e91++,'VoiceExtensionId':_0x1f7e74['id']},{'type':_0x7b25('0x10'),'app':'Set','appdata':_0x7b25('0x12')+(_0x1f7e74['cutdigits']?'${EXTEN:'+_0x1f7e74[_0x7b25('0x13')]+'}':_0x7b25('0x14')),'context':_0x1f7e74[_0x7b25('0x5')],'exten':_0x1f7e74[_0x7b25('0xa')],'priority':_0x284e91++,'VoiceExtensionId':_0x1f7e74['id']},{'type':_0x7b25('0x10'),'app':'Set','appdata':_0x7b25('0xd')+_0x1f7e74['id'],'context':_0x1f7e74[_0x7b25('0x5')],'exten':_0x1f7e74['exten'],'priority':_0x284e91++,'VoiceExtensionId':_0x1f7e74['id']},{'type':_0x7b25('0x10'),'app':_0x7b25('0x15'),'appdata':_0x7b25('0x16')+(_0x284e91+0x2)+_0x7b25('0x17')+(_0x284e91+0x1)+')','context':_0x1f7e74[_0x7b25('0x5')],'exten':_0x1f7e74[_0x7b25('0xa')],'priority':_0x284e91++,'VoiceExtensionId':_0x1f7e74['id']},{'type':_0x7b25('0x10'),'app':'Set','appdata':_0x1f7e74[_0x7b25('0x13')]?'CDR(prefix)=${EXTEN:0:'+_0x1f7e74['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x1f7e74[_0x7b25('0x5')],'exten':_0x1f7e74['exten'],'priority':_0x284e91++,'VoiceExtensionId':_0x1f7e74['id']},{'type':_0x7b25('0x10'),'app':_0x7b25('0x4'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x1f7e74[_0x7b25('0x5')],'exten':_0x1f7e74[_0x7b25('0xa')],'priority':_0x284e91++,'VoiceExtensionId':_0x1f7e74['id']},{'type':_0x7b25('0x10'),'app':_0x7b25('0x4'),'appdata':_0x7b25('0xe'),'context':_0x1f7e74[_0x7b25('0x5')],'exten':_0x1f7e74['exten'],'priority':_0x284e91++,'VoiceExtensionId':_0x1f7e74['id']},{'type':'outbound','app':'Set','appdata':_0x7b25('0xf'),'context':_0x1f7e74[_0x7b25('0x5')],'exten':_0x1f7e74['exten'],'priority':_0x284e91++,'VoiceExtensionId':_0x1f7e74['id']},{'type':_0x7b25('0x10'),'app':'Set','appdata':_0x7b25('0x18')+_0x1f7e74['id'],'context':_0x1f7e74[_0x7b25('0x5')],'exten':_0x1f7e74['exten'],'priority':_0x284e91++,'VoiceExtensionId':_0x1f7e74['id']}];if(_0x1f7e74[_0x7b25('0x19')](_0x7b25('0x1a'))&&_0x1f7e74[_0x7b25('0x1a')]!==_0x7b25('0x1b')){_0x5e54ee[_0x7b25('0xc')]({'type':_0x7b25('0x10'),'app':_0x7b25('0x4'),'appdata':_0x7b25('0x1c'),'context':_0x1f7e74[_0x7b25('0x5')],'exten':_0x1f7e74[_0x7b25('0xa')],'priority':_0x284e91++,'VoiceExtensionId':_0x1f7e74['id']},{'type':_0x7b25('0x10'),'app':_0x7b25('0x4'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x1f7e74[_0x7b25('0x1a')]||'wav','context':_0x1f7e74[_0x7b25('0x5')],'exten':_0x1f7e74[_0x7b25('0xa')],'priority':_0x284e91++,'VoiceExtensionId':_0x1f7e74['id']});}return _0x5e54ee;}function _0x15b2a8(_0xd42562){var _0x3f2013=[{'name':_0x7b25('0x1d'),'param':0x0},{'name':_0x7b25('0x1e'),'param':0x1},{'name':'options','param':0x2},{'name':_0x7b25('0x1f'),'param':0x3}];var _0x39d2ff={};var _0x470018=_0xd42562['split'](',');var _0x1a2cb0=[];for(var _0x3313c6=0x0;_0x3313c6<_0x3f2013[_0x7b25('0x20')];_0x3313c6++){switch(_0x3f2013[_0x3313c6][_0x7b25('0x21')]){case _0x7b25('0x1d'):_0x39d2ff['trunk']=_0x470018[_0x3f2013[_0x3313c6][_0x7b25('0x22')]][_0x7b25('0x23')]('/')[0x1];_0x39d2ff[_0x7b25('0x24')]=_0x470018[_0x3f2013[_0x3313c6]['param']][_0x7b25('0x23')]('/')[0x2];_0x39d2ff[_0x7b25('0x25')]=_0x39d2ff[_0x7b25('0x24')]?_0x39d2ff[_0x7b25('0x24')][_0x7b25('0x23')]('$')[0x0]:undefined;_0x39d2ff[_0x7b25('0x24')]=route[_0x7b25('0x13')]?(_0x39d2ff[_0x7b25('0x25')]||'')+_0x7b25('0x26')+route[_0x7b25('0x13')]+'}':(_0x39d2ff[_0x7b25('0x25')]||'')+_0x7b25('0x14');_0x1a2cb0[_0x3f2013[_0x3313c6][_0x7b25('0x22')]]=[_0x7b25('0x27'),_0x39d2ff[_0x7b25('0x1d')],_0x39d2ff[_0x7b25('0x24')]][_0x7b25('0x28')]('/');break;case _0x7b25('0x29'):_0x39d2ff[_0x7b25('0x29')]=_0x470018[_0x3f2013[_0x3313c6][_0x7b25('0x22')]];if(route[_0x7b25('0x1a')]!==_0x7b25('0x1b')){if(_0x39d2ff[_0x7b25('0x29')]['indexOf'](_0x7b25('0x2a'))<0x0){_0x39d2ff[_0x7b25('0x29')]+=_0x7b25('0x2a');}}else{_0x39d2ff[_0x7b25('0x29')]=_0x39d2ff['options'][_0x7b25('0x2b')](_0x7b25('0x2a'),'');}_0x1a2cb0[_0x3f2013[_0x3313c6][_0x7b25('0x22')]]=_0x39d2ff['options'];break;default:_0x1a2cb0[_0x3f2013[_0x3313c6][_0x7b25('0x22')]]=_0x470018[_0x3f2013[_0x3313c6]['param']];}}return _0x1a2cb0[_0x7b25('0x28')](',');}function _0x4ef618(_0x2aef73,_0x2c9cd2,_0x40708c,_0x220780){return new Promise(function(_0x4b1d6e,_0xf5edec){var _0x46c6cd=[];if(_[_0x7b25('0x2c')](_0x2c9cd2))return _0x4b1d6e(_0x46c6cd);_0x27ba50[_0x7b25('0x2d')][_0x7b25('0x2e')]({'attributes':['id','interval',_0x7b25('0x2f')],'raw':!![]})['then'](function(_0x31209c){for(var _0x45d705=0x0,_0x35ad4a=0x0;_0x45d705<_0x2c9cd2[_0x7b25('0x20')];_0x45d705++,_0x35ad4a=0x0){var _0x12c1eb=_0x2c9cd2[_0x45d705];var _0x1137e1=[];var _0x217c4c=[];if(_0x12c1eb[_0x7b25('0x30')]!=='*,*,*,*'){_0x12c1eb['intervals']=[_0x12c1eb[_0x7b25('0x30')]];}else{_0x12c1eb['intervals']=_0x12c1eb[_0x7b25('0x2f')]?_[_0x7b25('0x31')](_[_0x7b25('0x32')](_0x31209c,{'IntervalId':_0x12c1eb[_0x7b25('0x2f')]}),'interval'):[];}_0x12c1eb[_0x7b25('0x5')]=_0x2aef73['context'];_0x12c1eb[_0x7b25('0xa')]=_0x2aef73[_0x7b25('0xa')];if(_0x12c1eb['type'])_0x12c1eb[_0x7b25('0x3')]=_0x12c1eb[_0x7b25('0x3')][_0x7b25('0x33')]();if(_0x2aef73[_0x7b25('0x3')]==='outbound'){if(_0x12c1eb[_0x7b25('0x19')](_0x7b25('0x34'))&&_0x12c1eb[_0x7b25('0x34')]&&_0x12c1eb['tag']!=='--'){_0x1137e1['push']({'type':_0x12c1eb[_0x7b25('0x3')][_0x7b25('0x33')](),'app':_0x7b25('0x4'),'appdata':_0x7b25('0x35')+_0x12c1eb[_0x7b25('0x34')],'context':_0x2aef73['context'],'exten':_0x2aef73[_0x7b25('0xa')],'priority':_0x12c1eb[_0x7b25('0x36')][_0x7b25('0x20')]+_0x40708c+_0x35ad4a++,'VoiceExtensionId':_0x2aef73['id']});}_0x1137e1[_0x7b25('0xc')]({'type':_0x12c1eb[_0x7b25('0x3')][_0x7b25('0x33')](),'app':_0x7b25('0x15'),'appdata':_0x7b25('0x37')+(_0x12c1eb['callerID']?_0x7b25('0x38')+_0x12c1eb[_0x7b25('0x39')]+')':'NoOp(No\x20number\x20available)'),'context':_0x2aef73[_0x7b25('0x5')],'exten':_0x2aef73[_0x7b25('0xa')],'priority':_0x12c1eb['intervals'][_0x7b25('0x20')]+_0x40708c+_0x35ad4a++,'VoiceExtensionId':_0x2aef73['id']});}else{if(_0x12c1eb['hasOwnProperty'](_0x7b25('0x3a'))){if(['queue',_0x7b25('0x3b')][_0x7b25('0x3c')](_0x12c1eb[_0x7b25('0x3d')][_0x7b25('0x33')]())&&_0x12c1eb[_0x7b25('0x3e')]!==_0x7b25('0x3f')){if(_0x12c1eb['answer']){_0x1137e1['push']({'type':_0x12c1eb[_0x7b25('0x3')][_0x7b25('0x33')](),'app':_0x7b25('0x15'),'appdata':_0x7b25('0x40'),'context':_0x2aef73[_0x7b25('0x5')],'exten':_0x2aef73[_0x7b25('0xa')],'priority':_0x12c1eb['intervals']['length']+_0x40708c+_0x35ad4a++,'VoiceExtensionId':_0x2aef73['id']});_0x1137e1[_0x7b25('0xc')]({'type':_0x12c1eb['type']['toLowerCase'](),'app':'Set','appdata':_0x7b25('0x41'),'context':_0x2aef73[_0x7b25('0x5')],'exten':_0x2aef73[_0x7b25('0xa')],'priority':_0x12c1eb[_0x7b25('0x36')][_0x7b25('0x20')]+_0x40708c+_0x35ad4a++,'VoiceExtensionId':_0x2aef73['id']});}else{_0x1137e1[_0x7b25('0xc')]({'type':_0x12c1eb[_0x7b25('0x3')]['toLowerCase'](),'app':_0x7b25('0x15'),'appdata':_0x7b25('0x42'),'context':_0x2aef73['context'],'exten':_0x2aef73['exten'],'priority':_0x12c1eb[_0x7b25('0x36')]['length']+_0x40708c+_0x35ad4a++,'VoiceExtensionId':_0x2aef73['id']});_0x1137e1['push']({'type':_0x12c1eb[_0x7b25('0x3')][_0x7b25('0x33')](),'app':_0x7b25('0x4'),'appdata':_0x7b25('0x43'),'context':_0x2aef73[_0x7b25('0x5')],'exten':_0x2aef73[_0x7b25('0xa')],'priority':_0x12c1eb[_0x7b25('0x36')]['length']+_0x40708c+_0x35ad4a++,'VoiceExtensionId':_0x2aef73['id']});}}}}for(var _0x2f6368=0x0;_0x2f6368<_0x12c1eb[_0x7b25('0x36')]['length'];_0x2f6368++){var _0x459610=_0x40708c+_0x12c1eb[_0x7b25('0x36')][_0x7b25('0x20')];var _0x54cff7=_0x2f6368===_0x12c1eb[_0x7b25('0x36')]['length']-0x1?_0x40708c+_0x1137e1[_0x7b25('0x20')]+_0x217c4c[_0x7b25('0x20')]+0x2:_0x40708c+_0x2f6368+0x1;_0x1137e1[_0x7b25('0x44')](_0x2f6368,0x0,{'type':_0x2aef73[_0x7b25('0x3')],'app':_0x7b25('0x45'),'appdata':_0x12c1eb['intervals'][_0x2f6368]+'?'+_0x2aef73[_0x7b25('0x5')]+_0x7b25('0x46')+_0x459610+':'+_0x2aef73[_0x7b25('0x5')]+_0x7b25('0x46')+_0x54cff7,'exten':_0x2aef73[_0x7b25('0xa')],'context':_0x2aef73[_0x7b25('0x5')],'priority':_0x40708c+_0x2f6368,'VoiceExtensionId':_0x2aef73['id']});}if(_0x220780&&_0x12c1eb[_0x7b25('0x3e')]===_0x7b25('0x47'))_0x12c1eb['appdata']=_0x15b2a8(_0x12c1eb[_0x7b25('0x48')]);_0x12c1eb['priority']=_0x1137e1[_0x7b25('0x20')]?_[_0x7b25('0x49')](_0x1137e1)['priority']+0x1:_0x40708c;_0x46c6cd=_[_0x7b25('0x4a')](_0x46c6cd,_0x1137e1,[_0x12c1eb],_0x217c4c);_0x40708c=_[_0x7b25('0x49')](_0x46c6cd)[_0x7b25('0x4b')]+0x1;}return _0x4b1d6e(_0x46c6cd);})[_0x7b25('0x4c')](function(_0xf6bb0f){_0xf5edec(_0xf6bb0f);});});}return _0x543333[_0x7b25('0x4d')](_0x7b25('0x4e'),attributes,{'tableName':_0x7b25('0x4f'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x56ee78,_0x20123d){var _0x2962eb=this;var _0x16ee91=_0x2962eb['type']===_0x7b25('0x10')?_0x19808a(_0x2962eb):_0x8dc77c(_0x2962eb);return _0x4ef618(_0x2962eb,_0x56ee78,_[_0x7b25('0x49')](_0x16ee91)[_0x7b25('0x4b')]+0x1,_0x20123d)[_0x7b25('0x50')](function(_0x3b39fb){var _0x1eac2f=_[_0x7b25('0x4a')](_0x16ee91,_0x3b39fb);_0x1eac2f[_0x7b25('0xc')]({'type':_0x2962eb[_0x7b25('0x3')],'app':_0x7b25('0x51'),'exten':_0x2962eb[_0x7b25('0xa')],'context':_0x2962eb[_0x7b25('0x5')],'priority':_[_0x7b25('0x49')](_0x1eac2f)['priority']+0x1,'VoiceExtensionId':_0x2962eb['id']});return _0x1eac2f;});}}});};
\ No newline at end of file
index 36c6514..e450608 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81c6=['client','redis','defaults','socket.io-emitter','./voiceExtension.socket','request','then','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','GetVoiceExtension','VoiceExtension','findAll','options','where','attributes','limit','include','map','model','info','stringify','catch','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x133d75,_0x561898){var _0x2b39a0=function(_0x12f740){while(--_0x12f740){_0x133d75['push'](_0x133d75['shift']());}};_0x2b39a0(++_0x561898);}(_0x81c6,0x1d5));var _0x681c=function(_0x5474b4,_0x5027aa){_0x5474b4=_0x5474b4-0x0;var _0x33a0b5=_0x81c6[_0x5474b4];return _0x33a0b5;};'use strict';var _=require('lodash');var util=require(_0x681c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x681c('0x1'));var db=require(_0x681c('0x2'))['db'];var utils=require(_0x681c('0x3'));var logger=require('../../config/logger')(_0x681c('0x4'));var config=require(_0x681c('0x5'));var jayson=require(_0x681c('0x6'));var client=jayson[_0x681c('0x7')]['http']({'port':0x232a});config[_0x681c('0x8')]=_[_0x681c('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x681c('0xa'))(new Redis(config[_0x681c('0x8')]));require(_0x681c('0xb'))['register'](socket);function respondWithRpcPromise(_0x4f0228,_0x3e3770,_0x4ff60b){return new BPromise(function(_0x82b6ad,_0x83927a){return client[_0x681c('0xc')](_0x4f0228,_0x4ff60b)[_0x681c('0xd')](function(_0x48dc05){logger['info'](_0x681c('0xe'),_0x3e3770,_0x681c('0xf'));logger[_0x681c('0x10')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x3e3770,_0x681c('0xf'),JSON['stringify'](_0x48dc05));if(_0x48dc05[_0x681c('0x11')]){if(_0x48dc05['error'][_0x681c('0x12')]===0x1f4){logger[_0x681c('0x11')](_0x681c('0xe'),_0x3e3770,_0x48dc05[_0x681c('0x11')][_0x681c('0x13')]);return _0x83927a(_0x48dc05[_0x681c('0x11')]['message']);}logger[_0x681c('0x11')](_0x681c('0xe'),_0x3e3770,_0x48dc05[_0x681c('0x11')][_0x681c('0x13')]);return _0x82b6ad(_0x48dc05[_0x681c('0x11')][_0x681c('0x13')]);}else{logger['info'](_0x681c('0xe'),_0x3e3770,_0x681c('0xf'));_0x82b6ad(_0x48dc05[_0x681c('0x14')][_0x681c('0x13')]);}})['catch'](function(_0x22e608){logger[_0x681c('0x11')]('VoiceExtension,\x20%s,\x20%s',_0x3e3770,_0x22e608);_0x83927a(_0x22e608);});});}exports[_0x681c('0x15')]=function(_0x4c22c7){var _0x46cafc=this;return new Promise(function(_0x11836c,_0x11d68d){return db[_0x681c('0x16')][_0x681c('0x17')]({'raw':_0x4c22c7['options']?_0x4c22c7['options']['raw']===undefined?!![]:![]:!![],'where':_0x4c22c7[_0x681c('0x18')]?_0x4c22c7[_0x681c('0x18')][_0x681c('0x19')]||null:null,'attributes':_0x4c22c7[_0x681c('0x18')]?_0x4c22c7[_0x681c('0x18')][_0x681c('0x1a')]||null:null,'limit':_0x4c22c7[_0x681c('0x18')]?_0x4c22c7[_0x681c('0x18')][_0x681c('0x1b')]||null:null,'include':_0x4c22c7[_0x681c('0x18')]?_0x4c22c7[_0x681c('0x18')][_0x681c('0x1c')]?_[_0x681c('0x1d')](_0x4c22c7[_0x681c('0x18')][_0x681c('0x1c')],function(_0x228f59){return{'model':db[_0x228f59['model']],'as':_0x228f59['as'],'attributes':_0x228f59[_0x681c('0x1a')],'include':_0x228f59['include']?_[_0x681c('0x1d')](_0x228f59['include'],function(_0x583499){return{'model':db[_0x583499[_0x681c('0x1e')]],'as':_0x583499['as'],'attributes':_0x583499[_0x681c('0x1a')],'include':_0x583499[_0x681c('0x1c')]?_[_0x681c('0x1d')](_0x583499['include'],function(_0x3b1031){return{'model':db[_0x3b1031[_0x681c('0x1e')]],'as':_0x3b1031['as'],'attributes':_0x3b1031[_0x681c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x681c('0xd')](function(_0x147cda){logger[_0x681c('0x1f')](_0x681c('0x15'),_0x4c22c7);logger['debug'](_0x681c('0x15'),_0x4c22c7,JSON[_0x681c('0x20')](_0x147cda));_0x11836c(_0x147cda);})[_0x681c('0x21')](function(_0x4af6aa){logger[_0x681c('0x11')](_0x681c('0x15'),_0x4af6aa[_0x681c('0x13')],_0x4c22c7);_0x11d68d(_0x46cafc['error'](0x1f4,_0x4af6aa[_0x681c('0x13')]));});});};
\ No newline at end of file
+var _0xa990=['result','GetVoiceExtension','VoiceExtension','options','raw','where','attributes','include','map','model','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','request','then','info','request\x20sent','debug','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message'];(function(_0x4f90af,_0x14b70c){var _0x5e62c0=function(_0x4aa5b6){while(--_0x4aa5b6){_0x4f90af['push'](_0x4f90af['shift']());}};_0x5e62c0(++_0x14b70c);}(_0xa990,0xc9));var _0x0a99=function(_0xbd6b25,_0xee64f8){_0xbd6b25=_0xbd6b25-0x0;var _0x1fce11=_0xa990[_0xbd6b25];return _0x1fce11;};'use strict';var _=require(_0x0a99('0x0'));var util=require(_0x0a99('0x1'));var moment=require(_0x0a99('0x2'));var BPromise=require(_0x0a99('0x3'));var rs=require(_0x0a99('0x4'));var fs=require('fs');var Redis=require(_0x0a99('0x5'));var db=require(_0x0a99('0x6'))['db'];var utils=require(_0x0a99('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x0a99('0x8'));var jayson=require(_0x0a99('0x9'));var client=jayson[_0x0a99('0xa')][_0x0a99('0xb')]({'port':0x232a});config[_0x0a99('0xc')]=_[_0x0a99('0xd')](config[_0x0a99('0xc')],{'host':_0x0a99('0xe'),'port':0x18eb});var socket=require(_0x0a99('0xf'))(new Redis(config[_0x0a99('0xc')]));require(_0x0a99('0x10'))['register'](socket);function respondWithRpcPromise(_0x813e91,_0x38e89b,_0x5b5ec3){return new BPromise(function(_0x506582,_0x3561f2){return client[_0x0a99('0x11')](_0x813e91,_0x5b5ec3)[_0x0a99('0x12')](function(_0x30f427){logger[_0x0a99('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x38e89b,_0x0a99('0x14'));logger[_0x0a99('0x15')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x38e89b,_0x0a99('0x14'),JSON[_0x0a99('0x16')](_0x30f427));if(_0x30f427[_0x0a99('0x17')]){if(_0x30f427[_0x0a99('0x17')][_0x0a99('0x18')]===0x1f4){logger[_0x0a99('0x17')](_0x0a99('0x19'),_0x38e89b,_0x30f427[_0x0a99('0x17')]['message']);return _0x3561f2(_0x30f427['error'][_0x0a99('0x1a')]);}logger[_0x0a99('0x17')](_0x0a99('0x19'),_0x38e89b,_0x30f427['error'][_0x0a99('0x1a')]);return _0x506582(_0x30f427['error']['message']);}else{logger[_0x0a99('0x13')](_0x0a99('0x19'),_0x38e89b,_0x0a99('0x14'));_0x506582(_0x30f427[_0x0a99('0x1b')]['message']);}})['catch'](function(_0x27a14f){logger[_0x0a99('0x17')](_0x0a99('0x19'),_0x38e89b,_0x27a14f);_0x3561f2(_0x27a14f);});});}exports[_0x0a99('0x1c')]=function(_0x5e6c7e){var _0x58c86d=this;return new Promise(function(_0x1b0279,_0x4d0c78){return db[_0x0a99('0x1d')]['findAll']({'raw':_0x5e6c7e[_0x0a99('0x1e')]?_0x5e6c7e['options'][_0x0a99('0x1f')]===undefined?!![]:![]:!![],'where':_0x5e6c7e[_0x0a99('0x1e')]?_0x5e6c7e[_0x0a99('0x1e')][_0x0a99('0x20')]||null:null,'attributes':_0x5e6c7e[_0x0a99('0x1e')]?_0x5e6c7e[_0x0a99('0x1e')][_0x0a99('0x21')]||null:null,'limit':_0x5e6c7e[_0x0a99('0x1e')]?_0x5e6c7e[_0x0a99('0x1e')]['limit']||null:null,'include':_0x5e6c7e['options']?_0x5e6c7e[_0x0a99('0x1e')][_0x0a99('0x22')]?_[_0x0a99('0x23')](_0x5e6c7e['options']['include'],function(_0x371b31){return{'model':db[_0x371b31[_0x0a99('0x24')]],'as':_0x371b31['as'],'attributes':_0x371b31[_0x0a99('0x21')],'include':_0x371b31[_0x0a99('0x22')]?_[_0x0a99('0x23')](_0x371b31[_0x0a99('0x22')],function(_0x25b4c0){return{'model':db[_0x25b4c0[_0x0a99('0x24')]],'as':_0x25b4c0['as'],'attributes':_0x25b4c0[_0x0a99('0x21')],'include':_0x25b4c0['include']?_[_0x0a99('0x23')](_0x25b4c0['include'],function(_0x47bc34){return{'model':db[_0x47bc34['model']],'as':_0x47bc34['as'],'attributes':_0x47bc34[_0x0a99('0x21')]};}):[]};}):[]};}):[]:[]})[_0x0a99('0x12')](function(_0x13d26a){logger[_0x0a99('0x13')](_0x0a99('0x1c'),_0x5e6c7e);logger[_0x0a99('0x15')](_0x0a99('0x1c'),_0x5e6c7e,JSON['stringify'](_0x13d26a));_0x1b0279(_0x13d26a);})[_0x0a99('0x25')](function(_0x10e146){logger[_0x0a99('0x17')](_0x0a99('0x1c'),_0x10e146['message'],_0x5e6c7e);_0x4d0c78(_0x58c86d['error'](0x1f4,_0x10e146['message']));});});};
\ No newline at end of file
index 784abe0..86afdcc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cb9=['update','emit','removeListener','register','length','./voiceExtension.events','remove'];(function(_0x55ff3e,_0x41077f){var _0x2709eb=function(_0x45563a){while(--_0x45563a){_0x55ff3e['push'](_0x55ff3e['shift']());}};_0x2709eb(++_0x41077f);}(_0x1cb9,0x14e));var _0x91cb=function(_0x53a415,_0x2bded5){_0x53a415=_0x53a415-0x0;var _0x469af7=_0x1cb9[_0x53a415];return _0x469af7;};'use strict';var VoiceExtensionEvents=require(_0x91cb('0x0'));var events=['save',_0x91cb('0x1'),_0x91cb('0x2')];function createListener(_0x2b1894,_0x351bdb){return function(_0x57ea48){_0x351bdb[_0x91cb('0x3')](_0x2b1894,_0x57ea48);};}function removeListener(_0x2b7314,_0x5652cd){return function(){VoiceExtensionEvents[_0x91cb('0x4')](_0x2b7314,_0x5652cd);};}exports[_0x91cb('0x5')]=function(_0x186dc3){for(var _0x28543e=0x0,_0x3b9d98=events[_0x91cb('0x6')];_0x28543e<_0x3b9d98;_0x28543e++){var _0x4c1f56=events[_0x28543e];var _0x15c517=createListener('voiceExtension:'+_0x4c1f56,_0x186dc3);VoiceExtensionEvents['on'](_0x4c1f56,_0x15c517);}};
\ No newline at end of file
+var _0x53ec=['length','voiceExtension:','./voiceExtension.events','save','remove','update','emit','removeListener'];(function(_0x39dcd2,_0xd41366){var _0x4cb37c=function(_0x4cc2b0){while(--_0x4cc2b0){_0x39dcd2['push'](_0x39dcd2['shift']());}};_0x4cb37c(++_0xd41366);}(_0x53ec,0x192));var _0xc53e=function(_0x44db8e,_0x143b54){_0x44db8e=_0x44db8e-0x0;var _0x40667a=_0x53ec[_0x44db8e];return _0x40667a;};'use strict';var VoiceExtensionEvents=require(_0xc53e('0x0'));var events=[_0xc53e('0x1'),_0xc53e('0x2'),_0xc53e('0x3')];function createListener(_0x1b04cc,_0xe45c6d){return function(_0x51c435){_0xe45c6d[_0xc53e('0x4')](_0x1b04cc,_0x51c435);};}function removeListener(_0x4e954a,_0x2b90f6){return function(){VoiceExtensionEvents[_0xc53e('0x5')](_0x4e954a,_0x2b90f6);};}exports['register']=function(_0x2f1414){for(var _0x4f989b=0x0,_0x41a9e8=events[_0xc53e('0x6')];_0x4f989b<_0x41a9e8;_0x4f989b++){var _0x5d3b28=events[_0x4f989b];var _0x1616ac=createListener(_0xc53e('0x7')+_0x5d3b28,_0x2f1414);VoiceExtensionEvents['on'](_0x5d3b28,_0x1616ac);}};
\ No newline at end of file
index f789dd3..0c320aa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x958a=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','getMessages','post','create','put','update','delete','destroy','multer','util','connect-timeout','express'];(function(_0x1d6131,_0x181f2f){var _0x2b31e0=function(_0x5d2821){while(--_0x5d2821){_0x1d6131['push'](_0x1d6131['shift']());}};_0x2b31e0(++_0x181f2f);}(_0x958a,0x128));var _0xa958=function(_0x1ace6e,_0x3e618c){_0x1ace6e=_0x1ace6e-0x0;var _0x27c40e=_0x958a[_0x1ace6e];return _0x27c40e;};'use strict';var multer=require(_0xa958('0x0'));var util=require(_0xa958('0x1'));var path=require('path');var timeout=require(_0xa958('0x2'));var express=require(_0xa958('0x3'));var router=express[_0xa958('0x4')]();var fs_extra=require(_0xa958('0x5'));var auth=require(_0xa958('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa958('0x7'));var controller=require('./voiceMail.controller');router[_0xa958('0x8')]('/',auth[_0xa958('0x9')](),controller[_0xa958('0xa')]);router[_0xa958('0x8')](_0xa958('0xb'),auth[_0xa958('0x9')](),controller[_0xa958('0xc')]);router['get']('/:id/messages',auth[_0xa958('0x9')](),controller[_0xa958('0xd')]);router[_0xa958('0xe')]('/',auth[_0xa958('0x9')](),controller[_0xa958('0xf')]);router[_0xa958('0x10')](_0xa958('0xb'),auth[_0xa958('0x9')](),controller[_0xa958('0x11')]);router[_0xa958('0x12')](_0xa958('0xb'),auth[_0xa958('0x9')](),controller[_0xa958('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0xe2fe=['show','/:id/messages','post','update','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x2637ac,_0x377857){var _0x4a5758=function(_0x5d5043){while(--_0x5d5043){_0x2637ac['push'](_0x2637ac['shift']());}};_0x4a5758(++_0x377857);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xee2f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xee2f('0x1'));var express=require('express');var router=express[_0xee2f('0x2')]();var fs_extra=require(_0xee2f('0x3'));var auth=require(_0xee2f('0x4'));var interaction=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var controller=require('./voiceMail.controller');router[_0xee2f('0x7')]('/',auth[_0xee2f('0x8')](),controller['index']);router[_0xee2f('0x7')](_0xee2f('0x9'),auth['isAuthenticated'](),controller[_0xee2f('0xa')]);router['get'](_0xee2f('0xb'),auth[_0xee2f('0x8')](),controller['getMessages']);router[_0xee2f('0xc')]('/',auth[_0xee2f('0x8')](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0xee2f('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xee2f('0xe')]);module[_0xee2f('0xf')]=router;
\ No newline at end of file
index 4c48610..bcf8a11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb07=['STRING','from-voicemail','setDataValue','email','string','central','ENUM','yes','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports'];(function(_0xa7c9d7,_0x5e1699){var _0x449bb4=function(_0x3724aa){while(--_0x3724aa){_0xa7c9d7['push'](_0xa7c9d7['shift']());}};_0x449bb4(++_0x5e1699);}(_0xdb07,0x152));var _0x7db0=function(_0x14d896,_0x53578b){_0x14d896=_0x14d896-0x0;var _0x28679a=_0xdb07[_0x14d896];return _0x28679a;};'use strict';var Sequelize=require(_0x7db0('0x0'));module[_0x7db0('0x1')]={'customer_id':{'type':Sequelize[_0x7db0('0x2')]},'context':{'type':Sequelize[_0x7db0('0x2')],'defaultValue':_0x7db0('0x3'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x7db0('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x7db0('0x2')],'validate':{'isEmail':!![]},'set':function(_0x4b612b){this[_0x7db0('0x4')](_0x7db0('0x5'),typeof _0x4b612b===_0x7db0('0x6')&&_0x4b612b['trim']()?_0x4b612b['trim']():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x7db0('0x2')],'defaultValue':_0x7db0('0x7')},'attach':{'type':Sequelize[_0x7db0('0x8')](_0x7db0('0x9'),'no'),'defaultValue':_0x7db0('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x7db0('0x8')](_0x7db0('0x9'),'no'),'defaultValue':_0x7db0('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x7db0('0x2')]},'callback':{'type':Sequelize[_0x7db0('0x2')]},'review':{'type':Sequelize[_0x7db0('0x8')](_0x7db0('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x7db0('0x8')](_0x7db0('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x7db0('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x7db0('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x7db0('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x7db0('0x8')](_0x7db0('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x7db0('0x8')]('yes','no'),'defaultValue':_0x7db0('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x7db0('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x7db0('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x7db0('0x8')]('yes','no'),'defaultValue':_0x7db0('0x9'),'allowNull':![]},'stamp':{'type':_0x7db0('0xa')},'emailsubject':{'type':Sequelize[_0x7db0('0x2')]},'emailbody':{'type':Sequelize['STRING']},'maxsecs':{'type':Sequelize[_0x7db0('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x7db0('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x7db0('0xc')],'get':function(){return this[_0x7db0('0xd')](_0x7db0('0xe'))+_0x7db0('0xf')+this[_0x7db0('0xd')](_0x7db0('0x10'));}}};
\ No newline at end of file
+var _0x53fe=['INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)'];(function(_0x59c9a4,_0x3a1bba){var _0x59fe05=function(_0x443a0a){while(--_0x443a0a){_0x59c9a4['push'](_0x59c9a4['shift']());}};_0x59fe05(++_0x3a1bba);}(_0x53fe,0xef));var _0xe53f=function(_0x29ad3e,_0x3598c8){_0x29ad3e=_0x29ad3e-0x0;var _0x276b1c=_0x53fe[_0x29ad3e];return _0x276b1c;};'use strict';var Sequelize=require(_0xe53f('0x0'));module[_0xe53f('0x1')]={'customer_id':{'type':Sequelize[_0xe53f('0x2')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0xe53f('0x3'),'unique':_0xe53f('0x4')},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0xe53f('0x4')},'password':{'type':Sequelize[_0xe53f('0x2')]},'fullname':{'type':Sequelize[_0xe53f('0x2')]},'email':{'type':Sequelize[_0xe53f('0x2')],'validate':{'isEmail':!![]},'set':function(_0x5529b3){this[_0xe53f('0x5')](_0xe53f('0x6'),typeof _0x5529b3===_0xe53f('0x7')&&_0x5529b3['trim']()?_0x5529b3[_0xe53f('0x8')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0xe53f('0x2')],'defaultValue':_0xe53f('0x9')},'attach':{'type':Sequelize[_0xe53f('0xa')](_0xe53f('0xb'),'no'),'defaultValue':_0xe53f('0xb'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0xe53f('0xb'),'no'),'defaultValue':_0xe53f('0xb'),'allowNull':![]},'dialout':{'type':Sequelize[_0xe53f('0x2')]},'callback':{'type':Sequelize[_0xe53f('0x2')]},'review':{'type':Sequelize['ENUM'](_0xe53f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xe53f('0xa')](_0xe53f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0xe53f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xe53f('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xe53f('0xa')](_0xe53f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xe53f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xe53f('0xa')]('yes','no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0xe53f('0xa')](_0xe53f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xe53f('0xa')](_0xe53f('0xb'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xe53f('0xb'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0xe53f('0x2')]},'emailbody':{'type':Sequelize[_0xe53f('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xe53f('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xe53f('0xe')],'get':function(){return this[_0xe53f('0xf')](_0xe53f('0x10'))+_0xe53f('0x11')+this[_0xe53f('0xf')]('mailbox');}}};
\ No newline at end of file
index 06ff8d3..a21eff7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc9d=['mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','update','destroy','then','get','UserProfileResource','stack','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','name','options','include','VoiceMail','findAll','rows','params','fields','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','UserProfileSection','userProfileId','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','VoiceMailMessage'];(function(_0x306601,_0x242dd6){var _0x1907cd=function(_0x441e84){while(--_0x441e84){_0x306601['push'](_0x306601['shift']());}};_0x1907cd(++_0x242dd6);}(_0xbc9d,0xb4));var _0xdbc9=function(_0x54b23e,_0x2935e5){_0x54b23e=_0x54b23e-0x0;var _0x18a67a=_0xbc9d[_0x54b23e];return _0x18a67a;};'use strict';var emlformat=require(_0xdbc9('0x0'));var rimraf=require(_0xdbc9('0x1'));var zipdir=require(_0xdbc9('0x2'));var jsonpatch=require(_0xdbc9('0x3'));var rp=require(_0xdbc9('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdbc9('0x5'));var path=require(_0xdbc9('0x6'));var sox=require(_0xdbc9('0x7'));var csv=require(_0xdbc9('0x8'));var ejs=require(_0xdbc9('0x9'));var fs=require('fs');var fs_extra=require(_0xdbc9('0xa'));var _=require(_0xdbc9('0xb'));var squel=require('squel');var crypto=require(_0xdbc9('0xc'));var jsforce=require(_0xdbc9('0xd'));var deskjs=require(_0xdbc9('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdbc9('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xdbc9('0x10'));var qs=require(_0xdbc9('0x11'));var as=require(_0xdbc9('0x12'));var hardwareService=require(_0xdbc9('0x13'));var logger=require('../../config/logger')(_0xdbc9('0x14'));var utils=require(_0xdbc9('0x15'));var config=require(_0xdbc9('0x16'));var licenseUtil=require(_0xdbc9('0x17'));var db=require(_0xdbc9('0x18'))['db'];function respondWithStatusCode(_0x103d54,_0x48bc83){_0x48bc83=_0x48bc83||0xcc;return function(_0x567e71){if(_0x567e71){return _0x103d54[_0xdbc9('0x19')](_0x48bc83);}return _0x103d54[_0xdbc9('0x1a')](_0x48bc83)[_0xdbc9('0x1b')]();};}function respondWithResult(_0x436e50,_0x53495d){_0x53495d=_0x53495d||0xc8;return function(_0x4a9dcb){if(_0x4a9dcb){return _0x436e50[_0xdbc9('0x1a')](_0x53495d)[_0xdbc9('0x1c')](_0x4a9dcb);}};}function respondWithFilteredResult(_0x3a8a7b,_0x4c7b4f){return function(_0x1b4616){if(_0x1b4616){var _0x1abee8=typeof _0x4c7b4f['offset']===_0xdbc9('0x1d')&&typeof _0x4c7b4f[_0xdbc9('0x1e')]===_0xdbc9('0x1d');var _0x14e655=_0x1b4616[_0xdbc9('0x1f')];var _0x33f1bd=_0x1abee8?0x0:_0x4c7b4f[_0xdbc9('0x20')];var _0xc2ddd2=_0x1abee8?_0x1b4616[_0xdbc9('0x1f')]:_0x4c7b4f[_0xdbc9('0x20')]+_0x4c7b4f['limit'];var _0x1ca5fd;if(_0xc2ddd2>=_0x14e655){_0xc2ddd2=_0x14e655;_0x1ca5fd=0xc8;}else{_0x1ca5fd=0xce;}_0x3a8a7b['status'](_0x1ca5fd);return _0x3a8a7b[_0xdbc9('0x21')](_0xdbc9('0x22'),_0x33f1bd+'-'+_0xc2ddd2+'/'+_0x14e655)['json'](_0x1b4616);}return null;};}function patchUpdates(_0x4408e9){return function(_0x5367dc){try{jsonpatch['apply'](_0x5367dc,_0x4408e9,!![]);}catch(_0x4ab00d){return BPromise['reject'](_0x4ab00d);}return _0x5367dc[_0xdbc9('0x23')]();};}function saveUpdates(_0x2011a2,_0x570ad9){return function(_0x16dcf7){if(_0x16dcf7){return _0x16dcf7[_0xdbc9('0x24')](_0x2011a2)['then'](function(_0x1bc073){return _0x1bc073;});}return null;};}function removeEntity(_0x6b788,_0x1b1c0d){return function(_0x119230){if(_0x119230){return _0x119230[_0xdbc9('0x25')]()[_0xdbc9('0x26')](function(){var _0x32822f=_0x119230[_0xdbc9('0x27')]({'plain':!![]});var _0x3c8c1d='Voicemails';return db[_0xdbc9('0x28')][_0xdbc9('0x25')]({'where':{'type':_0x3c8c1d,'resourceId':_0x32822f['id']}})[_0xdbc9('0x26')](function(){return _0x119230;});})[_0xdbc9('0x26')](function(){_0x6b788[_0xdbc9('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf121e9,_0x2ee00a){return function(_0x5300bd){if(!_0x5300bd){_0xf121e9['sendStatus'](0x194);}return _0x5300bd;};}function handleError(_0x45aebe,_0x278db2){_0x278db2=_0x278db2||0x1f4;return function(_0x473430){logger['error'](_0x473430[_0xdbc9('0x29')]);if(_0x473430['name']){delete _0x473430['name'];}_0x45aebe[_0xdbc9('0x1a')](_0x278db2)['send'](_0x473430);};}exports['index']=function(_0x417b17,_0x20eb4f){var _0x1cb557={},_0x4db824={},_0x35eaf8={'count':0x0,'rows':[]};var _0x22f8aa=_['map'](db['VoiceMail'][_0xdbc9('0x2a')],function(_0x245496){return{'name':_0x245496[_0xdbc9('0x2b')],'type':_0x245496[_0xdbc9('0x2c')][_0xdbc9('0x2d')]};});_0x4db824[_0xdbc9('0x2e')]=_[_0xdbc9('0x2f')](_0x22f8aa,'name');_0x4db824[_0xdbc9('0x30')]=_[_0xdbc9('0x31')](_0x417b17[_0xdbc9('0x30')]);_0x4db824[_0xdbc9('0x32')]=_[_0xdbc9('0x33')](_0x4db824[_0xdbc9('0x2e')],_0x4db824['query']);_0x1cb557[_0xdbc9('0x34')]=_['intersection'](_0x4db824['model'],qs['fields'](_0x417b17['query']['fields']));_0x1cb557[_0xdbc9('0x34')]=_0x1cb557[_0xdbc9('0x34')][_0xdbc9('0x35')]?_0x1cb557['attributes']:_0x4db824[_0xdbc9('0x2e')];if(!_0x417b17[_0xdbc9('0x30')][_0xdbc9('0x36')](_0xdbc9('0x37'))){_0x1cb557[_0xdbc9('0x1e')]=qs[_0xdbc9('0x1e')](_0x417b17['query'][_0xdbc9('0x1e')]);_0x1cb557[_0xdbc9('0x20')]=qs[_0xdbc9('0x20')](_0x417b17['query'][_0xdbc9('0x20')]);}_0x1cb557[_0xdbc9('0x38')]=qs[_0xdbc9('0x39')](_0x417b17[_0xdbc9('0x30')]['sort']);_0x1cb557['where']=qs[_0xdbc9('0x32')](_[_0xdbc9('0x3a')](_0x417b17[_0xdbc9('0x30')],_0x4db824[_0xdbc9('0x32')]),_0x22f8aa);if(_0x417b17['query'][_0xdbc9('0x3b')]){_0x1cb557[_0xdbc9('0x3c')]=_[_0xdbc9('0x3d')](_0x1cb557['where'],{'$or':_[_0xdbc9('0x2f')](_0x22f8aa,function(_0x38a2a7){if(_0x38a2a7[_0xdbc9('0x2c')]!=='VIRTUAL'){var _0xa11bc8={};_0xa11bc8[_0x38a2a7[_0xdbc9('0x3e')]]={'$like':'%'+_0x417b17['query']['filter']+'%'};return _0xa11bc8;}})});}_0x1cb557=_[_0xdbc9('0x3d')]({},_0x1cb557,_0x417b17[_0xdbc9('0x3f')]);var _0x387b57={'where':_0x1cb557[_0xdbc9('0x3c')]};return db['VoiceMail'][_0xdbc9('0x1f')](_0x387b57)[_0xdbc9('0x26')](function(_0x577725){_0x35eaf8[_0xdbc9('0x1f')]=_0x577725;if(_0x417b17[_0xdbc9('0x30')]['includeAll']){_0x1cb557[_0xdbc9('0x40')]=[{'all':!![]}];}return db[_0xdbc9('0x41')][_0xdbc9('0x42')](_0x1cb557);})[_0xdbc9('0x26')](function(_0x3ed4de){_0x35eaf8[_0xdbc9('0x43')]=_0x3ed4de;return _0x35eaf8;})[_0xdbc9('0x26')](respondWithFilteredResult(_0x20eb4f,_0x1cb557))['catch'](handleError(_0x20eb4f,null));};exports['show']=function(_0x768856,_0x3b8437){var _0xc77676={'raw':!![],'where':{'id':_0x768856[_0xdbc9('0x44')]['id']}},_0x41f56a={};_0x41f56a[_0xdbc9('0x2e')]=_[_0xdbc9('0x31')](db[_0xdbc9('0x41')][_0xdbc9('0x2a')]);_0x41f56a[_0xdbc9('0x30')]=_[_0xdbc9('0x31')](_0x768856['query']);_0x41f56a['filters']=_[_0xdbc9('0x33')](_0x41f56a[_0xdbc9('0x2e')],_0x41f56a[_0xdbc9('0x30')]);_0xc77676[_0xdbc9('0x34')]=_[_0xdbc9('0x33')](_0x41f56a[_0xdbc9('0x2e')],qs[_0xdbc9('0x45')](_0x768856[_0xdbc9('0x30')]['fields']));_0xc77676['attributes']=_0xc77676[_0xdbc9('0x34')][_0xdbc9('0x35')]?_0xc77676[_0xdbc9('0x34')]:_0x41f56a[_0xdbc9('0x2e')];if(_0x768856[_0xdbc9('0x30')][_0xdbc9('0x46')]){_0xc77676[_0xdbc9('0x40')]=[{'all':!![]}];}_0xc77676=_[_0xdbc9('0x3d')]({},_0xc77676,_0x768856[_0xdbc9('0x3f')]);return db['VoiceMail'][_0xdbc9('0x47')](_0xc77676)[_0xdbc9('0x26')](handleEntityNotFound(_0x3b8437,null))['then'](respondWithResult(_0x3b8437,null))['catch'](handleError(_0x3b8437,null));};exports[_0xdbc9('0x48')]=function(_0xc3db3c,_0x133a13){return db['VoiceMail'][_0xdbc9('0x48')](_0xc3db3c[_0xdbc9('0x49')],{})[_0xdbc9('0x26')](function(_0x274607){var _0x5aee83=_0xc3db3c[_0xdbc9('0x4a')][_0xdbc9('0x27')]({'plain':!![]});if(!_0x5aee83)throw new Error(_0xdbc9('0x4b'));if(_0x5aee83[_0xdbc9('0x4c')]==='user'){var _0x3e89f5=_0x274607[_0xdbc9('0x27')]({'plain':!![]});var _0x3f49b7=_0xdbc9('0x4d');return db[_0xdbc9('0x4e')][_0xdbc9('0x47')]({'where':{'name':_0x3f49b7,'userProfileId':_0x5aee83[_0xdbc9('0x4f')]},'raw':!![]})[_0xdbc9('0x26')](function(_0x4b34dd){if(_0x4b34dd&&_0x4b34dd[_0xdbc9('0x50')]===0x0){return db['UserProfileResource'][_0xdbc9('0x48')]({'name':_0x3e89f5[_0xdbc9('0x3e')],'resourceId':_0x3e89f5['id'],'type':_0x4b34dd['name'],'sectionId':_0x4b34dd['id']},{})['then'](function(){return _0x274607;});}else{return _0x274607;}})[_0xdbc9('0x51')](function(_0x4b55df){logger[_0xdbc9('0x52')](_0xdbc9('0x53'),_0x4b55df);throw _0x4b55df;});}return _0x274607;})[_0xdbc9('0x26')](respondWithResult(_0x133a13,0xc9))['catch'](handleError(_0x133a13,null));};exports[_0xdbc9('0x24')]=function(_0x1c52e6,_0x3d8b01){if(_0x1c52e6[_0xdbc9('0x49')]['id']){delete _0x1c52e6[_0xdbc9('0x49')]['id'];}return db[_0xdbc9('0x41')][_0xdbc9('0x47')]({'where':{'id':_0x1c52e6[_0xdbc9('0x44')]['id']}})['then'](handleEntityNotFound(_0x3d8b01,null))['then'](saveUpdates(_0x1c52e6['body'],null))[_0xdbc9('0x26')](respondWithResult(_0x3d8b01,null))[_0xdbc9('0x51')](handleError(_0x3d8b01,null));};exports[_0xdbc9('0x25')]=function(_0x55d8ba,_0x519ac9){return db[_0xdbc9('0x41')][_0xdbc9('0x47')]({'where':{'id':_0x55d8ba['params']['id']}})['then'](handleEntityNotFound(_0x519ac9,null))[_0xdbc9('0x26')](removeEntity(_0x519ac9,null))[_0xdbc9('0x51')](handleError(_0x519ac9,null));};exports[_0xdbc9('0x54')]=function(_0x2f90a8,_0x3021be,_0x1f52bb){return db['VoiceMail'][_0xdbc9('0x55')]({'where':{'id':_0x2f90a8[_0xdbc9('0x44')]['id']}})[_0xdbc9('0x26')](handleEntityNotFound(_0x3021be,null))['then'](function(_0x189d8a){var _0x14ccb4;var _0x1819fa={},_0x57b4ab={};_0x57b4ab[_0xdbc9('0x2e')]=_['keys'](db[_0xdbc9('0x56')][_0xdbc9('0x2a')]);_0x57b4ab[_0xdbc9('0x30')]=_[_0xdbc9('0x31')](_0x2f90a8[_0xdbc9('0x30')]);_0x57b4ab[_0xdbc9('0x32')]=_['intersection'](_0x57b4ab[_0xdbc9('0x2e')],_0x57b4ab['query']);_0x1819fa[_0xdbc9('0x34')]=_[_0xdbc9('0x33')](_0x57b4ab['model'],qs[_0xdbc9('0x45')](_0x2f90a8[_0xdbc9('0x30')]['fields']));_0x1819fa['attributes']=_0x1819fa[_0xdbc9('0x34')][_0xdbc9('0x35')]?_0x1819fa[_0xdbc9('0x34')]:_0x57b4ab['model'];if(!_0x2f90a8[_0xdbc9('0x30')][_0xdbc9('0x36')]('nolimit')){_0x1819fa[_0xdbc9('0x1e')]=qs[_0xdbc9('0x1e')](_0x2f90a8['query']['limit']);_0x1819fa[_0xdbc9('0x20')]=qs[_0xdbc9('0x20')](_0x2f90a8[_0xdbc9('0x30')][_0xdbc9('0x20')]);}_0x1819fa[_0xdbc9('0x38')]=qs[_0xdbc9('0x39')](_0x2f90a8[_0xdbc9('0x30')][_0xdbc9('0x39')]);_0x1819fa['where']=qs[_0xdbc9('0x32')](_[_0xdbc9('0x3a')](_0x2f90a8[_0xdbc9('0x30')],_0x57b4ab[_0xdbc9('0x32')]));if(_0x2f90a8[_0xdbc9('0x30')][_0xdbc9('0x3b')]){_0x1819fa[_0xdbc9('0x3c')]=_[_0xdbc9('0x3d')](_0x1819fa['where'],{'$or':_[_0xdbc9('0x2f')](_0x1819fa['attributes'],function(_0x2678b2){var _0x4c5207={};_0x4c5207[_0x2678b2]={'$like':'%'+_0x2f90a8[_0xdbc9('0x30')][_0xdbc9('0x3b')]+'%'};return _0x4c5207;})});}_0x1819fa['where']=_['merge'](_0x1819fa['where'],{'mailboxuser':_0x189d8a[_0xdbc9('0x57')]});_0x1819fa=_[_0xdbc9('0x3d')]({},_0x1819fa,_0x2f90a8[_0xdbc9('0x3f')]);return db['VoiceMailMessage'][_0xdbc9('0x58')](_0x1819fa)[_0xdbc9('0x26')](respondWithFilteredResult(_0x3021be,_0x1819fa));})[_0xdbc9('0x51')](handleError(_0x3021be,null));};
\ No newline at end of file
+var _0x63a5=['index','map','VoiceMail','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','options','includeAll','rows','catch','show','params','keys','rawAttributes','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','getMessages','VoiceMailMessage','sort','pick','mailbox','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','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','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','send'];(function(_0x39f845,_0x1f0097){var _0x323202=function(_0x3f5695){while(--_0x3f5695){_0x39f845['push'](_0x39f845['shift']());}};_0x323202(++_0x1f0097);}(_0x63a5,0x18e));var _0x563a=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x63a5[_0x29d94e];return _0x106237;};'use strict';var emlformat=require(_0x563a('0x0'));var rimraf=require(_0x563a('0x1'));var zipdir=require(_0x563a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x563a('0x3'));var moment=require('moment');var BPromise=require(_0x563a('0x4'));var Mustache=require(_0x563a('0x5'));var util=require(_0x563a('0x6'));var path=require(_0x563a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x563a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x563a('0x9'));var squel=require(_0x563a('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x563a('0xb'));var toCsv=require(_0x563a('0xc'));var querystring=require(_0x563a('0xd'));var Papa=require(_0x563a('0xe'));var Redis=require(_0x563a('0xf'));var authService=require(_0x563a('0x10'));var qs=require(_0x563a('0x11'));var as=require(_0x563a('0x12'));var hardwareService=require(_0x563a('0x13'));var logger=require(_0x563a('0x14'))(_0x563a('0x15'));var utils=require(_0x563a('0x16'));var config=require(_0x563a('0x17'));var licenseUtil=require(_0x563a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x61d5b2,_0x214f42){_0x214f42=_0x214f42||0xcc;return function(_0x10de2e){if(_0x10de2e){return _0x61d5b2[_0x563a('0x19')](_0x214f42);}return _0x61d5b2[_0x563a('0x1a')](_0x214f42)[_0x563a('0x1b')]();};}function respondWithResult(_0x50396b,_0x2cf052){_0x2cf052=_0x2cf052||0xc8;return function(_0x3045ac){if(_0x3045ac){return _0x50396b[_0x563a('0x1a')](_0x2cf052)[_0x563a('0x1c')](_0x3045ac);}};}function respondWithFilteredResult(_0x5a2980,_0x504cb7){return function(_0x414535){if(_0x414535){var _0x2ad667=typeof _0x504cb7['offset']===_0x563a('0x1d')&&typeof _0x504cb7[_0x563a('0x1e')]===_0x563a('0x1d');var _0x9c2f77=_0x414535['count'];var _0x598693=_0x2ad667?0x0:_0x504cb7[_0x563a('0x1f')];var _0x422aaf=_0x2ad667?_0x414535[_0x563a('0x20')]:_0x504cb7['offset']+_0x504cb7['limit'];var _0x52b99a;if(_0x422aaf>=_0x9c2f77){_0x422aaf=_0x9c2f77;_0x52b99a=0xc8;}else{_0x52b99a=0xce;}_0x5a2980['status'](_0x52b99a);return _0x5a2980[_0x563a('0x21')](_0x563a('0x22'),_0x598693+'-'+_0x422aaf+'/'+_0x9c2f77)[_0x563a('0x1c')](_0x414535);}return null;};}function patchUpdates(_0x43b7a8){return function(_0x562fce){try{jsonpatch['apply'](_0x562fce,_0x43b7a8,!![]);}catch(_0x3930f0){return BPromise[_0x563a('0x23')](_0x3930f0);}return _0x562fce[_0x563a('0x24')]();};}function saveUpdates(_0x2beccb,_0x1bf502){return function(_0x2dc7e2){if(_0x2dc7e2){return _0x2dc7e2[_0x563a('0x25')](_0x2beccb)[_0x563a('0x26')](function(_0x506491){return _0x506491;});}return null;};}function removeEntity(_0xd59ba8,_0x5422f6){return function(_0x44e2c1){if(_0x44e2c1){return _0x44e2c1[_0x563a('0x27')]()[_0x563a('0x26')](function(){var _0x1250e6=_0x44e2c1[_0x563a('0x28')]({'plain':!![]});var _0x1682ee=_0x563a('0x29');return db[_0x563a('0x2a')]['destroy']({'where':{'type':_0x1682ee,'resourceId':_0x1250e6['id']}})[_0x563a('0x26')](function(){return _0x44e2c1;});})[_0x563a('0x26')](function(){_0xd59ba8[_0x563a('0x1a')](0xcc)[_0x563a('0x1b')]();});}};}function handleEntityNotFound(_0xce8165,_0x1898f9){return function(_0x1afdff){if(!_0x1afdff){_0xce8165[_0x563a('0x19')](0x194);}return _0x1afdff;};}function handleError(_0x249db8,_0x8f3429){_0x8f3429=_0x8f3429||0x1f4;return function(_0x1a69d5){logger[_0x563a('0x2b')](_0x1a69d5[_0x563a('0x2c')]);if(_0x1a69d5[_0x563a('0x2d')]){delete _0x1a69d5['name'];}_0x249db8[_0x563a('0x1a')](_0x8f3429)[_0x563a('0x2e')](_0x1a69d5);};}exports[_0x563a('0x2f')]=function(_0x4aaa3d,_0x1e8d43){var _0x2e5c4b={},_0x3a59cb={},_0x28a8f6={'count':0x0,'rows':[]};var _0x166f89=_[_0x563a('0x30')](db[_0x563a('0x31')]['rawAttributes'],function(_0x2418ae){return{'name':_0x2418ae[_0x563a('0x32')],'type':_0x2418ae[_0x563a('0x33')][_0x563a('0x34')]};});_0x3a59cb[_0x563a('0x35')]=_['map'](_0x166f89,'name');_0x3a59cb['query']=_['keys'](_0x4aaa3d[_0x563a('0x36')]);_0x3a59cb[_0x563a('0x37')]=_[_0x563a('0x38')](_0x3a59cb[_0x563a('0x35')],_0x3a59cb[_0x563a('0x36')]);_0x2e5c4b[_0x563a('0x39')]=_['intersection'](_0x3a59cb['model'],qs[_0x563a('0x3a')](_0x4aaa3d[_0x563a('0x36')][_0x563a('0x3a')]));_0x2e5c4b[_0x563a('0x39')]=_0x2e5c4b[_0x563a('0x39')][_0x563a('0x3b')]?_0x2e5c4b[_0x563a('0x39')]:_0x3a59cb[_0x563a('0x35')];if(!_0x4aaa3d[_0x563a('0x36')][_0x563a('0x3c')](_0x563a('0x3d'))){_0x2e5c4b[_0x563a('0x1e')]=qs[_0x563a('0x1e')](_0x4aaa3d[_0x563a('0x36')][_0x563a('0x1e')]);_0x2e5c4b[_0x563a('0x1f')]=qs['offset'](_0x4aaa3d[_0x563a('0x36')][_0x563a('0x1f')]);}_0x2e5c4b[_0x563a('0x3e')]=qs['sort'](_0x4aaa3d[_0x563a('0x36')]['sort']);_0x2e5c4b[_0x563a('0x3f')]=qs[_0x563a('0x37')](_['pick'](_0x4aaa3d['query'],_0x3a59cb[_0x563a('0x37')]),_0x166f89);if(_0x4aaa3d['query'][_0x563a('0x40')]){_0x2e5c4b[_0x563a('0x3f')]=_[_0x563a('0x41')](_0x2e5c4b[_0x563a('0x3f')],{'$or':_['map'](_0x166f89,function(_0x47d37a){if(_0x47d37a[_0x563a('0x33')]!=='VIRTUAL'){var _0x46d471={};_0x46d471[_0x47d37a[_0x563a('0x2d')]]={'$like':'%'+_0x4aaa3d[_0x563a('0x36')][_0x563a('0x40')]+'%'};return _0x46d471;}})});}_0x2e5c4b=_[_0x563a('0x41')]({},_0x2e5c4b,_0x4aaa3d[_0x563a('0x42')]);var _0x4bf555={'where':_0x2e5c4b[_0x563a('0x3f')]};return db['VoiceMail'][_0x563a('0x20')](_0x4bf555)['then'](function(_0x20c142){_0x28a8f6[_0x563a('0x20')]=_0x20c142;if(_0x4aaa3d[_0x563a('0x36')][_0x563a('0x43')]){_0x2e5c4b['include']=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x2e5c4b);})[_0x563a('0x26')](function(_0x1255da){_0x28a8f6[_0x563a('0x44')]=_0x1255da;return _0x28a8f6;})[_0x563a('0x26')](respondWithFilteredResult(_0x1e8d43,_0x2e5c4b))[_0x563a('0x45')](handleError(_0x1e8d43,null));};exports[_0x563a('0x46')]=function(_0x29a1c0,_0x2ca0f4){var _0x19c2cc={'raw':!![],'where':{'id':_0x29a1c0[_0x563a('0x47')]['id']}},_0x433353={};_0x433353[_0x563a('0x35')]=_[_0x563a('0x48')](db[_0x563a('0x31')][_0x563a('0x49')]);_0x433353[_0x563a('0x36')]=_[_0x563a('0x48')](_0x29a1c0[_0x563a('0x36')]);_0x433353[_0x563a('0x37')]=_['intersection'](_0x433353['model'],_0x433353[_0x563a('0x36')]);_0x19c2cc[_0x563a('0x39')]=_[_0x563a('0x38')](_0x433353[_0x563a('0x35')],qs[_0x563a('0x3a')](_0x29a1c0[_0x563a('0x36')][_0x563a('0x3a')]));_0x19c2cc[_0x563a('0x39')]=_0x19c2cc['attributes']['length']?_0x19c2cc[_0x563a('0x39')]:_0x433353[_0x563a('0x35')];if(_0x29a1c0[_0x563a('0x36')][_0x563a('0x43')]){_0x19c2cc[_0x563a('0x4a')]=[{'all':!![]}];}_0x19c2cc=_[_0x563a('0x41')]({},_0x19c2cc,_0x29a1c0[_0x563a('0x42')]);return db[_0x563a('0x31')]['find'](_0x19c2cc)[_0x563a('0x26')](handleEntityNotFound(_0x2ca0f4,null))[_0x563a('0x26')](respondWithResult(_0x2ca0f4,null))['catch'](handleError(_0x2ca0f4,null));};exports[_0x563a('0x4b')]=function(_0x5a063a,_0x3ea787){return db[_0x563a('0x31')][_0x563a('0x4b')](_0x5a063a['body'],{})[_0x563a('0x26')](function(_0x23efcf){var _0xb1dbc8=_0x5a063a[_0x563a('0x4c')][_0x563a('0x28')]({'plain':!![]});if(!_0xb1dbc8)throw new Error(_0x563a('0x4d'));if(_0xb1dbc8[_0x563a('0x4e')]===_0x563a('0x4c')){var _0x277d54=_0x23efcf[_0x563a('0x28')]({'plain':!![]});var _0x3c98d5=_0x563a('0x29');return db[_0x563a('0x4f')]['find']({'where':{'name':_0x3c98d5,'userProfileId':_0xb1dbc8['userProfileId']},'raw':!![]})[_0x563a('0x26')](function(_0xaae9fd){if(_0xaae9fd&&_0xaae9fd[_0x563a('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x277d54[_0x563a('0x2d')],'resourceId':_0x277d54['id'],'type':_0xaae9fd[_0x563a('0x2d')],'sectionId':_0xaae9fd['id']},{})['then'](function(){return _0x23efcf;});}else{return _0x23efcf;}})['catch'](function(_0x51e142){logger[_0x563a('0x2b')](_0x563a('0x51'),_0x51e142);throw _0x51e142;});}return _0x23efcf;})[_0x563a('0x26')](respondWithResult(_0x3ea787,0xc9))[_0x563a('0x45')](handleError(_0x3ea787,null));};exports[_0x563a('0x25')]=function(_0x2805eb,_0x4dd257){if(_0x2805eb['body']['id']){delete _0x2805eb[_0x563a('0x52')]['id'];}return db['VoiceMail'][_0x563a('0x53')]({'where':{'id':_0x2805eb[_0x563a('0x47')]['id']}})[_0x563a('0x26')](handleEntityNotFound(_0x4dd257,null))[_0x563a('0x26')](saveUpdates(_0x2805eb[_0x563a('0x52')],null))[_0x563a('0x26')](respondWithResult(_0x4dd257,null))[_0x563a('0x45')](handleError(_0x4dd257,null));};exports['destroy']=function(_0x22cc91,_0x227372){return db['VoiceMail'][_0x563a('0x53')]({'where':{'id':_0x22cc91[_0x563a('0x47')]['id']}})[_0x563a('0x26')](handleEntityNotFound(_0x227372,null))[_0x563a('0x26')](removeEntity(_0x227372,null))[_0x563a('0x45')](handleError(_0x227372,null));};exports[_0x563a('0x54')]=function(_0x16aa03,_0x3919a3,_0x1e275c){return db[_0x563a('0x31')]['findOne']({'where':{'id':_0x16aa03[_0x563a('0x47')]['id']}})[_0x563a('0x26')](handleEntityNotFound(_0x3919a3,null))['then'](function(_0x503896){var _0x402bdd;var _0x709bfd={},_0x579d61={};_0x579d61[_0x563a('0x35')]=_['keys'](db[_0x563a('0x55')][_0x563a('0x49')]);_0x579d61[_0x563a('0x36')]=_[_0x563a('0x48')](_0x16aa03[_0x563a('0x36')]);_0x579d61['filters']=_['intersection'](_0x579d61['model'],_0x579d61['query']);_0x709bfd[_0x563a('0x39')]=_['intersection'](_0x579d61[_0x563a('0x35')],qs['fields'](_0x16aa03[_0x563a('0x36')][_0x563a('0x3a')]));_0x709bfd[_0x563a('0x39')]=_0x709bfd[_0x563a('0x39')][_0x563a('0x3b')]?_0x709bfd['attributes']:_0x579d61[_0x563a('0x35')];if(!_0x16aa03['query']['hasOwnProperty'](_0x563a('0x3d'))){_0x709bfd[_0x563a('0x1e')]=qs[_0x563a('0x1e')](_0x16aa03[_0x563a('0x36')][_0x563a('0x1e')]);_0x709bfd['offset']=qs[_0x563a('0x1f')](_0x16aa03[_0x563a('0x36')][_0x563a('0x1f')]);}_0x709bfd[_0x563a('0x3e')]=qs[_0x563a('0x56')](_0x16aa03['query'][_0x563a('0x56')]);_0x709bfd['where']=qs[_0x563a('0x37')](_[_0x563a('0x57')](_0x16aa03['query'],_0x579d61[_0x563a('0x37')]));if(_0x16aa03[_0x563a('0x36')][_0x563a('0x40')]){_0x709bfd[_0x563a('0x3f')]=_[_0x563a('0x41')](_0x709bfd[_0x563a('0x3f')],{'$or':_[_0x563a('0x30')](_0x709bfd[_0x563a('0x39')],function(_0x4cfa73){var _0x103c59={};_0x103c59[_0x4cfa73]={'$like':'%'+_0x16aa03[_0x563a('0x36')][_0x563a('0x40')]+'%'};return _0x103c59;})});}_0x709bfd[_0x563a('0x3f')]=_[_0x563a('0x41')](_0x709bfd[_0x563a('0x3f')],{'mailboxuser':_0x503896[_0x563a('0x58')]});_0x709bfd=_['merge']({},_0x709bfd,_0x16aa03[_0x563a('0x42')]);return db['VoiceMailMessage']['findAndCountAll'](_0x709bfd)['then'](respondWithFilteredResult(_0x3919a3,_0x709bfd));})[_0x563a('0x45')](handleError(_0x3919a3,null));};
\ No newline at end of file
index c82e9cb..3b3c0af 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x94ed=['VoiceMail','mailbox_context','mailbox','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define'];(function(_0x445217,_0x44bc83){var _0x2459a5=function(_0x10baa1){while(--_0x10baa1){_0x445217['push'](_0x445217['shift']());}};_0x2459a5(++_0x44bc83);}(_0x94ed,0xd3));var _0xd94e=function(_0x44ceee,_0x2a5e28){_0x44ceee=_0x44ceee-0x0;var _0x1a065c=_0x94ed[_0x44ceee];return _0x1a065c;};'use strict';var _=require(_0xd94e('0x0'));var util=require(_0xd94e('0x1'));var logger=require(_0xd94e('0x2'))(_0xd94e('0x3'));var moment=require(_0xd94e('0x4'));var BPromise=require(_0xd94e('0x5'));var rp=require(_0xd94e('0x6'));var fs=require('fs');var path=require(_0xd94e('0x7'));var rimraf=require(_0xd94e('0x8'));var config=require(_0xd94e('0x9'));var attributes=require(_0xd94e('0xa'));module[_0xd94e('0xb')]=function(_0x4cfc89,_0x38df22){return _0x4cfc89[_0xd94e('0xc')](_0xd94e('0xd'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xd94e('0xe'),'fields':[_0xd94e('0xf'),'context']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3335=['context','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMail.attributes','exports','define','voice_voicemail','mailbox_context','mailbox'];(function(_0x1d1c24,_0x26bb97){var _0x23617a=function(_0x9acd97){while(--_0x9acd97){_0x1d1c24['push'](_0x1d1c24['shift']());}};_0x23617a(++_0x26bb97);}(_0x3335,0x17b));var _0x5333=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x3335[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0x5333('0x0'));var util=require(_0x5333('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x5333('0x2'));var rp=require(_0x5333('0x3'));var fs=require('fs');var path=require(_0x5333('0x4'));var rimraf=require(_0x5333('0x5'));var config=require(_0x5333('0x6'));var attributes=require(_0x5333('0x7'));module[_0x5333('0x8')]=function(_0x2d6f2a,_0x56b8f){return _0x2d6f2a[_0x5333('0x9')]('VoiceMail',attributes,{'tableName':_0x5333('0xa'),'paranoid':![],'indexes':[{'name':_0x5333('0xb'),'fields':[_0x5333('0xc'),_0x5333('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index 1a89b47..3feff15 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cdc=['client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3a194f,_0x4964bf){var _0x43c8de=function(_0x216230){while(--_0x216230){_0x3a194f['push'](_0x3a194f['shift']());}};_0x43c8de(++_0x4964bf);}(_0x3cdc,0x147));var _0xc3cd=function(_0x5f1de4,_0x47c201){_0x5f1de4=_0x5f1de4-0x0;var _0x1aeaf0=_0x3cdc[_0x5f1de4];return _0x1aeaf0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc3cd('0x0'));var BPromise=require(_0xc3cd('0x1'));var rs=require(_0xc3cd('0x2'));var fs=require('fs');var Redis=require(_0xc3cd('0x3'));var db=require(_0xc3cd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc3cd('0x5'))(_0xc3cd('0x6'));var config=require(_0xc3cd('0x7'));var jayson=require(_0xc3cd('0x8'));var client=jayson[_0xc3cd('0x9')][_0xc3cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2443ad,_0x5ab469,_0x3fec5f){return new BPromise(function(_0x639603,_0x36093f){return client[_0xc3cd('0xb')](_0x2443ad,_0x3fec5f)[_0xc3cd('0xc')](function(_0x554614){logger[_0xc3cd('0xd')](_0xc3cd('0xe'),_0x5ab469,_0xc3cd('0xf'));logger[_0xc3cd('0x10')](_0xc3cd('0x11'),_0x5ab469,_0xc3cd('0xf'),JSON[_0xc3cd('0x12')](_0x554614));if(_0x554614[_0xc3cd('0x13')]){if(_0x554614[_0xc3cd('0x13')][_0xc3cd('0x14')]===0x1f4){logger[_0xc3cd('0x13')]('VoiceMail,\x20%s,\x20%s',_0x5ab469,_0x554614[_0xc3cd('0x13')]['message']);return _0x36093f(_0x554614[_0xc3cd('0x13')][_0xc3cd('0x15')]);}logger[_0xc3cd('0x13')](_0xc3cd('0xe'),_0x5ab469,_0x554614[_0xc3cd('0x13')]['message']);return _0x639603(_0x554614['error'][_0xc3cd('0x15')]);}else{logger['info'](_0xc3cd('0xe'),_0x5ab469,_0xc3cd('0xf'));_0x639603(_0x554614[_0xc3cd('0x16')][_0xc3cd('0x15')]);}})[_0xc3cd('0x17')](function(_0x18a0ec){logger[_0xc3cd('0x13')](_0xc3cd('0xe'),_0x5ab469,_0x18a0ec);_0x36093f(_0x18a0ec);});});}
\ No newline at end of file
+var _0xb559=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x5c8982,_0x5983d8){var _0x2f23f4=function(_0x244ba4){while(--_0x244ba4){_0x5c8982['push'](_0x5c8982['shift']());}};_0x2f23f4(++_0x5983d8);}(_0xb559,0x145));var _0x9b55=function(_0x487cbd,_0x342d12){_0x487cbd=_0x487cbd-0x0;var _0x5021f6=_0xb559[_0x487cbd];return _0x5021f6;};'use strict';var _=require(_0x9b55('0x0'));var util=require(_0x9b55('0x1'));var moment=require(_0x9b55('0x2'));var BPromise=require(_0x9b55('0x3'));var rs=require(_0x9b55('0x4'));var fs=require('fs');var Redis=require(_0x9b55('0x5'));var db=require(_0x9b55('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9b55('0x7'))(_0x9b55('0x8'));var config=require('../../config/environment');var jayson=require(_0x9b55('0x9'));var client=jayson[_0x9b55('0xa')][_0x9b55('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bed06,_0x3f8dfa,_0x140f98){return new BPromise(function(_0x590f64,_0x23328c){return client[_0x9b55('0xc')](_0x1bed06,_0x140f98)['then'](function(_0x6857e7){logger[_0x9b55('0xd')](_0x9b55('0xe'),_0x3f8dfa,_0x9b55('0xf'));logger[_0x9b55('0x10')](_0x9b55('0x11'),_0x3f8dfa,'request\x20sent',JSON['stringify'](_0x6857e7));if(_0x6857e7[_0x9b55('0x12')]){if(_0x6857e7['error'][_0x9b55('0x13')]===0x1f4){logger[_0x9b55('0x12')](_0x9b55('0xe'),_0x3f8dfa,_0x6857e7['error'][_0x9b55('0x14')]);return _0x23328c(_0x6857e7[_0x9b55('0x12')][_0x9b55('0x14')]);}logger[_0x9b55('0x12')](_0x9b55('0xe'),_0x3f8dfa,_0x6857e7[_0x9b55('0x12')]['message']);return _0x590f64(_0x6857e7['error'][_0x9b55('0x14')]);}else{logger[_0x9b55('0xd')]('VoiceMail,\x20%s,\x20%s',_0x3f8dfa,_0x9b55('0xf'));_0x590f64(_0x6857e7['result'][_0x9b55('0x14')]);}})[_0x9b55('0x15')](function(_0x13bb1d){logger[_0x9b55('0x12')](_0x9b55('0xe'),_0x3f8dfa,_0x13bb1d);_0x23328c(_0x13bb1d);});});}
\ No newline at end of file
index 536b78c..ea0c3f3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5a7=['/:id/download','download','put','update','delete','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show'];(function(_0x2fef36,_0x2d9657){var _0x36cb38=function(_0xe2d130){while(--_0xe2d130){_0x2fef36['push'](_0x2fef36['shift']());}};_0x36cb38(++_0x2d9657);}(_0xa5a7,0x78));var _0x7a5a=function(_0x53413a,_0x2822c9){_0x53413a=_0x53413a-0x0;var _0x426533=_0xa5a7[_0x53413a];return _0x426533;};'use strict';var multer=require('multer');var util=require(_0x7a5a('0x0'));var path=require(_0x7a5a('0x1'));var timeout=require(_0x7a5a('0x2'));var express=require(_0x7a5a('0x3'));var router=express['Router']();var fs_extra=require(_0x7a5a('0x4'));var auth=require(_0x7a5a('0x5'));var interaction=require(_0x7a5a('0x6'));var config=require('../../config/environment');var controller=require(_0x7a5a('0x7'));router[_0x7a5a('0x8')]('/',auth[_0x7a5a('0x9')](),controller[_0x7a5a('0xa')]);router[_0x7a5a('0x8')](_0x7a5a('0xb'),auth['isAuthenticated'](),controller[_0x7a5a('0xc')]);router['get'](_0x7a5a('0xd'),auth[_0x7a5a('0x9')](),controller[_0x7a5a('0xe')]);router['post']('/',auth[_0x7a5a('0x9')](),controller['create']);router[_0x7a5a('0xf')]('/:id',auth[_0x7a5a('0x9')](),controller[_0x7a5a('0x10')]);router[_0x7a5a('0x11')]('/:id',auth[_0x7a5a('0x9')](),controller['destroy']);module[_0x7a5a('0x12')]=router;
\ No newline at end of file
+var _0xa603=['../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','/:id','show','/:id/download','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x58fa60,_0x7ca599){var _0x38dbe3=function(_0x3315ea){while(--_0x3315ea){_0x58fa60['push'](_0x58fa60['shift']());}};_0x38dbe3(++_0x7ca599);}(_0xa603,0x13c));var _0x3a60=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa603[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require(_0x3a60('0x0'));var path=require(_0x3a60('0x1'));var timeout=require(_0x3a60('0x2'));var express=require(_0x3a60('0x3'));var router=express[_0x3a60('0x4')]();var fs_extra=require(_0x3a60('0x5'));var auth=require(_0x3a60('0x6'));var interaction=require(_0x3a60('0x7'));var config=require('../../config/environment');var controller=require(_0x3a60('0x8'));router[_0x3a60('0x9')]('/',auth[_0x3a60('0xa')](),controller['index']);router[_0x3a60('0x9')](_0x3a60('0xb'),auth['isAuthenticated'](),controller[_0x3a60('0xc')]);router[_0x3a60('0x9')](_0x3a60('0xd'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x3a60('0xa')](),controller[_0x3a60('0xe')]);router[_0x3a60('0xf')](_0x3a60('0xb'),auth[_0x3a60('0xa')](),controller[_0x3a60('0x10')]);router['delete'](_0x3a60('0xb'),auth[_0x3a60('0xa')](),controller[_0x3a60('0x11')]);module[_0x3a60('0x12')]=router;
\ No newline at end of file
index 72828de..047ce3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x51e1=['long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','getDataValue','INTEGER','STRING','BLOB'];(function(_0x48620b,_0x46d884){var _0x583ae5=function(_0xf377ac){while(--_0xf377ac){_0x48620b['push'](_0x48620b['shift']());}};_0x583ae5(++_0x46d884);}(_0x51e1,0xc2));var _0x151e=function(_0x5e238b,_0x17ae49){_0x5e238b=_0x5e238b-0x0;var _0x389bea=_0x51e1[_0x5e238b];return _0x389bea;};'use strict';var Sequelize=require(_0x151e('0x0'));module[_0x151e('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x399a74){return this[_0x151e('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x151e('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x151e('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x151e('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x151e('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x151e('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x151e('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x151e('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize[_0x151e('0x5')](_0x151e('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x151e('0x4')],'defaultValue':''},'stamp':{'type':_0x151e('0x7'),'defaultValue':Sequelize[_0x151e('0x8')](_0x151e('0x9'))}};
\ No newline at end of file
+var _0x5eb3=['INTEGER','STRING','BLOB','long','TIMESTAMP','sequelize','VIRTUAL'];(function(_0x20b276,_0x5a78f5){var _0x2d719d=function(_0x193ac2){while(--_0x193ac2){_0x20b276['push'](_0x20b276['shift']());}};_0x2d719d(++_0x5a78f5);}(_0x5eb3,0xc9));var _0x35eb=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x5eb3[_0xaa1b3e];return _0x454d7d;};'use strict';var Sequelize=require(_0x35eb('0x0'));module['exports']={'name':{'type':Sequelize[_0x35eb('0x1')],'get':function(_0x4a723d){return this['getDataValue']('id');}},'msgnum':{'type':Sequelize[_0x35eb('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x35eb('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x35eb('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x35eb('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x35eb('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x35eb('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x35eb('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x35eb('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x35eb('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x35eb('0x4')](_0x35eb('0x5')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x35eb('0x3')],'defaultValue':''},'stamp':{'type':_0x35eb('0x6'),'defaultValue':Sequelize['literal']('CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP')}};
\ No newline at end of file
index 11bd8b9..9b768c1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49e3=['jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','VoiceMailMessage','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','include','findAll','catch','show','params','includeAll','find','create','body','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','attachment;\x20filename=\x22','.wav\x22','send','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','crypto'];(function(_0x20845e,_0x211e78){var _0x28cf2b=function(_0x31d613){while(--_0x31d613){_0x20845e['push'](_0x20845e['shift']());}};_0x28cf2b(++_0x211e78);}(_0x49e3,0xeb));var _0x349e=function(_0x3f42aa,_0x1ce68f){_0x3f42aa=_0x3f42aa-0x0;var _0x3d505c=_0x49e3[_0x3f42aa];return _0x3d505c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x349e('0x0'));var zipdir=require(_0x349e('0x1'));var jsonpatch=require(_0x349e('0x2'));var rp=require(_0x349e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x349e('0x4'));var util=require(_0x349e('0x5'));var path=require(_0x349e('0x6'));var sox=require(_0x349e('0x7'));var csv=require(_0x349e('0x8'));var ejs=require(_0x349e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x349e('0xa'));var jsforce=require(_0x349e('0xb'));var deskjs=require(_0x349e('0xc'));var toCsv=require(_0x349e('0x8'));var querystring=require('querystring');var Papa=require(_0x349e('0xd'));var Redis=require(_0x349e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x349e('0xf'));var as=require(_0x349e('0x10'));var hardwareService=require(_0x349e('0x11'));var logger=require(_0x349e('0x12'))(_0x349e('0x13'));var utils=require('../../config/utils');var config=require(_0x349e('0x14'));var licenseUtil=require(_0x349e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x328564,_0x59c098){_0x59c098=_0x59c098||0xcc;return function(_0x4f769d){if(_0x4f769d){return _0x328564['sendStatus'](_0x59c098);}return _0x328564[_0x349e('0x16')](_0x59c098)[_0x349e('0x17')]();};}function respondWithResult(_0x13cc56,_0x1632d9){_0x1632d9=_0x1632d9||0xc8;return function(_0x5ada25){if(_0x5ada25){return _0x13cc56['status'](_0x1632d9)[_0x349e('0x18')](_0x5ada25);}};}function respondWithFilteredResult(_0x5d270c,_0x151e00){return function(_0x3d99b9){if(_0x3d99b9){var _0xcff538=typeof _0x151e00[_0x349e('0x19')]===_0x349e('0x1a')&&typeof _0x151e00['limit']===_0x349e('0x1a');var _0x47a7b0=_0x3d99b9[_0x349e('0x1b')];var _0x58bc1b=_0xcff538?0x0:_0x151e00[_0x349e('0x19')];var _0x329cf3=_0xcff538?_0x3d99b9['count']:_0x151e00[_0x349e('0x19')]+_0x151e00[_0x349e('0x1c')];var _0x26c288;if(_0x329cf3>=_0x47a7b0){_0x329cf3=_0x47a7b0;_0x26c288=0xc8;}else{_0x26c288=0xce;}_0x5d270c[_0x349e('0x16')](_0x26c288);return _0x5d270c[_0x349e('0x1d')]('Content-Range',_0x58bc1b+'-'+_0x329cf3+'/'+_0x47a7b0)['json'](_0x3d99b9);}return null;};}function patchUpdates(_0x5759dc){return function(_0x4eeba3){try{jsonpatch[_0x349e('0x1e')](_0x4eeba3,_0x5759dc,!![]);}catch(_0x277d3a){return BPromise[_0x349e('0x1f')](_0x277d3a);}return _0x4eeba3[_0x349e('0x20')]();};}function saveUpdates(_0x2d0dfa,_0x16f252){return function(_0x431c0f){if(_0x431c0f){return _0x431c0f[_0x349e('0x21')](_0x2d0dfa)[_0x349e('0x22')](function(_0x5208c3){return _0x5208c3;});}return null;};}function removeEntity(_0x46c8db,_0x406f0f){return function(_0x3afb62){if(_0x3afb62){return _0x3afb62[_0x349e('0x23')]()['then'](function(){_0x46c8db[_0x349e('0x16')](0xcc)[_0x349e('0x17')]();});}};}function handleEntityNotFound(_0xa89e18,_0x2eb534){return function(_0x5e3342){if(!_0x5e3342){_0xa89e18[_0x349e('0x24')](0x194);}return _0x5e3342;};}function handleError(_0x500ff7,_0x72cb6e){_0x72cb6e=_0x72cb6e||0x1f4;return function(_0x35747b){logger[_0x349e('0x25')](_0x35747b[_0x349e('0x26')]);if(_0x35747b[_0x349e('0x27')]){delete _0x35747b[_0x349e('0x27')];}_0x500ff7['status'](_0x72cb6e)['send'](_0x35747b);};}exports[_0x349e('0x28')]=function(_0x4ae506,_0x180309){var _0x1404eb={},_0x18c79a={},_0x56feb9={'count':0x0,'rows':[]};var _0x44188c=_[_0x349e('0x29')](db[_0x349e('0x2a')][_0x349e('0x2b')],function(_0x1a9f14){return{'name':_0x1a9f14[_0x349e('0x2c')],'type':_0x1a9f14['type'][_0x349e('0x2d')]};});_0x18c79a[_0x349e('0x2e')]=_['differenceBy'](_['map'](_0x44188c,_0x349e('0x27')),['name']);_0x18c79a[_0x349e('0x2f')]=_[_0x349e('0x30')](_0x4ae506[_0x349e('0x2f')]);_0x18c79a[_0x349e('0x31')]=_['intersection'](_0x18c79a[_0x349e('0x2e')],_0x18c79a[_0x349e('0x2f')]);_0x1404eb[_0x349e('0x32')]=_[_0x349e('0x33')](_0x18c79a['model'],qs[_0x349e('0x34')](_0x4ae506['query'][_0x349e('0x34')]));_0x1404eb[_0x349e('0x32')]=_0x1404eb['attributes']['length']?_0x1404eb[_0x349e('0x32')]:_0x18c79a[_0x349e('0x2e')];if(!_0x4ae506[_0x349e('0x2f')]['hasOwnProperty'](_0x349e('0x35'))){_0x1404eb[_0x349e('0x1c')]=qs[_0x349e('0x1c')](_0x4ae506['query'][_0x349e('0x1c')]);_0x1404eb[_0x349e('0x19')]=qs['offset'](_0x4ae506['query']['offset']);}_0x1404eb[_0x349e('0x36')]=qs[_0x349e('0x37')](_0x4ae506[_0x349e('0x2f')]['sort']);_0x1404eb[_0x349e('0x38')]=qs[_0x349e('0x31')](_[_0x349e('0x39')](_0x4ae506['query'],_0x18c79a[_0x349e('0x31')]),_0x44188c);if(_0x4ae506[_0x349e('0x2f')]['filter']){_0x1404eb[_0x349e('0x38')]=_[_0x349e('0x3a')](_0x1404eb[_0x349e('0x38')],{'$or':_[_0x349e('0x29')](_0x44188c,function(_0x2366c4){if(_0x2366c4[_0x349e('0x3b')]!==_0x349e('0x3c')){var _0xcb23e={};_0xcb23e[_0x2366c4[_0x349e('0x27')]]={'$like':'%'+_0x4ae506[_0x349e('0x2f')][_0x349e('0x3d')]+'%'};return _0xcb23e;}})});}_0x1404eb=_[_0x349e('0x3a')]({},_0x1404eb,_0x4ae506[_0x349e('0x3e')]);var _0x130c11={'where':_0x1404eb[_0x349e('0x38')]};return db[_0x349e('0x2a')][_0x349e('0x1b')](_0x130c11)[_0x349e('0x22')](function(_0x475d62){_0x56feb9[_0x349e('0x1b')]=_0x475d62;if(_0x4ae506[_0x349e('0x2f')]['includeAll']){_0x1404eb[_0x349e('0x3f')]=[{'all':!![]}];}return db[_0x349e('0x2a')][_0x349e('0x40')](_0x1404eb);})['then'](function(_0x51bcba){_0x56feb9['rows']=_0x51bcba;return _0x56feb9;})[_0x349e('0x22')](respondWithFilteredResult(_0x180309,_0x1404eb))[_0x349e('0x41')](handleError(_0x180309,null));};exports[_0x349e('0x42')]=function(_0x3bf416,_0x27184e){var _0x5b0a35={'raw':!![],'where':{'id':_0x3bf416[_0x349e('0x43')]['id']}},_0x41c01b={};_0x41c01b[_0x349e('0x2e')]=_[_0x349e('0x30')](db[_0x349e('0x2a')][_0x349e('0x2b')]);_0x41c01b[_0x349e('0x2f')]=_[_0x349e('0x30')](_0x3bf416[_0x349e('0x2f')]);_0x41c01b[_0x349e('0x31')]=_[_0x349e('0x33')](_0x41c01b['model'],_0x41c01b[_0x349e('0x2f')]);_0x5b0a35[_0x349e('0x32')]=_['intersection'](_0x41c01b[_0x349e('0x2e')],qs[_0x349e('0x34')](_0x3bf416['query'][_0x349e('0x34')]));_0x5b0a35[_0x349e('0x32')]=_0x5b0a35[_0x349e('0x32')]['length']?_0x5b0a35[_0x349e('0x32')]:_0x41c01b[_0x349e('0x2e')];if(_0x3bf416['query'][_0x349e('0x44')]){_0x5b0a35[_0x349e('0x3f')]=[{'all':!![]}];}_0x5b0a35=_[_0x349e('0x3a')]({},_0x5b0a35,_0x3bf416['options']);return db[_0x349e('0x2a')][_0x349e('0x45')](_0x5b0a35)[_0x349e('0x22')](handleEntityNotFound(_0x27184e,null))[_0x349e('0x22')](respondWithResult(_0x27184e,null))[_0x349e('0x41')](handleError(_0x27184e,null));};exports[_0x349e('0x46')]=function(_0x72a1ec,_0x5917bb){return db['VoiceMailMessage'][_0x349e('0x46')](_0x72a1ec[_0x349e('0x47')],{})['then'](respondWithResult(_0x5917bb,0xc9))[_0x349e('0x41')](handleError(_0x5917bb,null));};exports[_0x349e('0x21')]=function(_0x457d0d,_0x2e738a){if(_0x457d0d[_0x349e('0x47')]['id']){delete _0x457d0d[_0x349e('0x47')]['id'];}return db[_0x349e('0x2a')]['find']({'where':{'id':_0x457d0d[_0x349e('0x43')]['id']}})['then'](handleEntityNotFound(_0x2e738a,null))['then'](saveUpdates(_0x457d0d[_0x349e('0x47')],null))['then'](respondWithResult(_0x2e738a,null))[_0x349e('0x41')](handleError(_0x2e738a,null));};exports['destroy']=function(_0x197b8d,_0x60c4da){return db['VoiceMailMessage'][_0x349e('0x45')]({'where':{'id':_0x197b8d['params']['id']}})[_0x349e('0x22')](handleEntityNotFound(_0x60c4da,null))[_0x349e('0x22')](removeEntity(_0x60c4da,null))[_0x349e('0x41')](handleError(_0x60c4da,null));};exports['download']=function(_0x5880fa,_0x1847c5,_0x540f81){return db['VoiceMailMessage'][_0x349e('0x45')]({'where':{'id':_0x5880fa['params']['id']},'attributes':['id',_0x349e('0x48'),_0x349e('0x49')]})['then'](handleEntityNotFound(_0x1847c5,null))[_0x349e('0x22')](function(_0x7d7cd7){if(_0x7d7cd7){if(!_0x7d7cd7[_0x349e('0x48')]){throw new db[(_0x349e('0x4a'))][(_0x349e('0x4b'))](_0x349e('0x4c'));}var _0x21057f={'Content-Type':_0x349e('0x4d'),'Content-Disposition':_0x349e('0x4e')};if(_0x7d7cd7[_0x349e('0x49')]){_0x21057f['Content-Disposition']=_0x349e('0x4f')+_0x7d7cd7['msg_id']+_0x349e('0x50');}_0x1847c5[_0x349e('0x1d')](_0x21057f);return _0x1847c5[_0x349e('0x51')](new Buffer(_0x7d7cd7[_0x349e('0x48')]));}})[_0x349e('0x41')](handleError(_0x1847c5,null));};
\ No newline at end of file
+var _0x3061=['recording','Sequelize','ValidationError','audio/wav','attachment','msg_id','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','send','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','index','map','VoiceMailMessage','rawAttributes','key','differenceBy','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','create','body','find','download'];(function(_0xa4f752,_0x28ee8d){var _0x280567=function(_0xef3db7){while(--_0xef3db7){_0xa4f752['push'](_0xa4f752['shift']());}};_0x280567(++_0x28ee8d);}(_0x3061,0x162));var _0x1306=function(_0x1af05b,_0x5134b5){_0x1af05b=_0x1af05b-0x0;var _0x5be7cc=_0x3061[_0x1af05b];return _0x5be7cc;};'use strict';var emlformat=require(_0x1306('0x0'));var rimraf=require(_0x1306('0x1'));var zipdir=require(_0x1306('0x2'));var jsonpatch=require(_0x1306('0x3'));var rp=require('request-promise');var moment=require(_0x1306('0x4'));var BPromise=require(_0x1306('0x5'));var Mustache=require(_0x1306('0x6'));var util=require('util');var path=require(_0x1306('0x7'));var sox=require(_0x1306('0x8'));var csv=require(_0x1306('0x9'));var ejs=require(_0x1306('0xa'));var fs=require('fs');var fs_extra=require(_0x1306('0xb'));var _=require(_0x1306('0xc'));var squel=require(_0x1306('0xd'));var crypto=require(_0x1306('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1306('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1306('0x10'));var Papa=require(_0x1306('0x11'));var Redis=require(_0x1306('0x12'));var authService=require(_0x1306('0x13'));var qs=require(_0x1306('0x14'));var as=require(_0x1306('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1306('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1306('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf7f7e1,_0xa5ff8b){_0xa5ff8b=_0xa5ff8b||0xcc;return function(_0x8dab31){if(_0x8dab31){return _0xf7f7e1[_0x1306('0x18')](_0xa5ff8b);}return _0xf7f7e1[_0x1306('0x19')](_0xa5ff8b)[_0x1306('0x1a')]();};}function respondWithResult(_0x3ec293,_0x3afca2){_0x3afca2=_0x3afca2||0xc8;return function(_0x22c1ec){if(_0x22c1ec){return _0x3ec293[_0x1306('0x19')](_0x3afca2)[_0x1306('0x1b')](_0x22c1ec);}};}function respondWithFilteredResult(_0x5ae1e8,_0x730a52){return function(_0x4b5b3a){if(_0x4b5b3a){var _0x4a0d86=typeof _0x730a52[_0x1306('0x1c')]===_0x1306('0x1d')&&typeof _0x730a52[_0x1306('0x1e')]===_0x1306('0x1d');var _0x3dfd26=_0x4b5b3a[_0x1306('0x1f')];var _0x29dbd3=_0x4a0d86?0x0:_0x730a52[_0x1306('0x1c')];var _0x28aef7=_0x4a0d86?_0x4b5b3a['count']:_0x730a52[_0x1306('0x1c')]+_0x730a52[_0x1306('0x1e')];var _0x436bb6;if(_0x28aef7>=_0x3dfd26){_0x28aef7=_0x3dfd26;_0x436bb6=0xc8;}else{_0x436bb6=0xce;}_0x5ae1e8[_0x1306('0x19')](_0x436bb6);return _0x5ae1e8[_0x1306('0x20')](_0x1306('0x21'),_0x29dbd3+'-'+_0x28aef7+'/'+_0x3dfd26)[_0x1306('0x1b')](_0x4b5b3a);}return null;};}function patchUpdates(_0x3fb7cf){return function(_0x25db0c){try{jsonpatch[_0x1306('0x22')](_0x25db0c,_0x3fb7cf,!![]);}catch(_0x293e44){return BPromise[_0x1306('0x23')](_0x293e44);}return _0x25db0c['save']();};}function saveUpdates(_0x29a0c1,_0x365a97){return function(_0x53f4a9){if(_0x53f4a9){return _0x53f4a9[_0x1306('0x24')](_0x29a0c1)[_0x1306('0x25')](function(_0x34e627){return _0x34e627;});}return null;};}function removeEntity(_0x4727a1,_0x561fd5){return function(_0x17b997){if(_0x17b997){return _0x17b997[_0x1306('0x26')]()[_0x1306('0x25')](function(){_0x4727a1['status'](0xcc)[_0x1306('0x1a')]();});}};}function handleEntityNotFound(_0x3cb3be,_0x375db2){return function(_0x1ff5cc){if(!_0x1ff5cc){_0x3cb3be['sendStatus'](0x194);}return _0x1ff5cc;};}function handleError(_0x2d3774,_0x2b0157){_0x2b0157=_0x2b0157||0x1f4;return function(_0x26b1d2){logger[_0x1306('0x27')](_0x26b1d2['stack']);if(_0x26b1d2[_0x1306('0x28')]){delete _0x26b1d2[_0x1306('0x28')];}_0x2d3774[_0x1306('0x19')](_0x2b0157)['send'](_0x26b1d2);};}exports[_0x1306('0x29')]=function(_0x148c47,_0x395ec1){var _0x28b6cd={},_0x4c640c={},_0x2126ec={'count':0x0,'rows':[]};var _0x3ccbd4=_[_0x1306('0x2a')](db[_0x1306('0x2b')][_0x1306('0x2c')],function(_0x3ac167){return{'name':_0x3ac167['fieldName'],'type':_0x3ac167['type'][_0x1306('0x2d')]};});_0x4c640c['model']=_[_0x1306('0x2e')](_['map'](_0x3ccbd4,_0x1306('0x28')),[_0x1306('0x28')]);_0x4c640c[_0x1306('0x2f')]=_[_0x1306('0x30')](_0x148c47[_0x1306('0x2f')]);_0x4c640c[_0x1306('0x31')]=_[_0x1306('0x32')](_0x4c640c[_0x1306('0x33')],_0x4c640c[_0x1306('0x2f')]);_0x28b6cd[_0x1306('0x34')]=_[_0x1306('0x32')](_0x4c640c[_0x1306('0x33')],qs[_0x1306('0x35')](_0x148c47[_0x1306('0x2f')][_0x1306('0x35')]));_0x28b6cd[_0x1306('0x34')]=_0x28b6cd[_0x1306('0x34')][_0x1306('0x36')]?_0x28b6cd[_0x1306('0x34')]:_0x4c640c[_0x1306('0x33')];if(!_0x148c47[_0x1306('0x2f')][_0x1306('0x37')](_0x1306('0x38'))){_0x28b6cd[_0x1306('0x1e')]=qs[_0x1306('0x1e')](_0x148c47['query'][_0x1306('0x1e')]);_0x28b6cd[_0x1306('0x1c')]=qs[_0x1306('0x1c')](_0x148c47[_0x1306('0x2f')][_0x1306('0x1c')]);}_0x28b6cd[_0x1306('0x39')]=qs['sort'](_0x148c47[_0x1306('0x2f')][_0x1306('0x3a')]);_0x28b6cd[_0x1306('0x3b')]=qs[_0x1306('0x31')](_['pick'](_0x148c47[_0x1306('0x2f')],_0x4c640c['filters']),_0x3ccbd4);if(_0x148c47['query'][_0x1306('0x3c')]){_0x28b6cd[_0x1306('0x3b')]=_['merge'](_0x28b6cd[_0x1306('0x3b')],{'$or':_[_0x1306('0x2a')](_0x3ccbd4,function(_0xfa35a0){if(_0xfa35a0[_0x1306('0x3d')]!==_0x1306('0x3e')){var _0x47d7c5={};_0x47d7c5[_0xfa35a0[_0x1306('0x28')]]={'$like':'%'+_0x148c47['query'][_0x1306('0x3c')]+'%'};return _0x47d7c5;}})});}_0x28b6cd=_[_0x1306('0x3f')]({},_0x28b6cd,_0x148c47[_0x1306('0x40')]);var _0x4eb3d1={'where':_0x28b6cd[_0x1306('0x3b')]};return db['VoiceMailMessage']['count'](_0x4eb3d1)[_0x1306('0x25')](function(_0x2ce985){_0x2126ec[_0x1306('0x1f')]=_0x2ce985;if(_0x148c47[_0x1306('0x2f')]['includeAll']){_0x28b6cd[_0x1306('0x41')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x1306('0x42')](_0x28b6cd);})[_0x1306('0x25')](function(_0x866cd5){_0x2126ec[_0x1306('0x43')]=_0x866cd5;return _0x2126ec;})[_0x1306('0x25')](respondWithFilteredResult(_0x395ec1,_0x28b6cd))[_0x1306('0x44')](handleError(_0x395ec1,null));};exports[_0x1306('0x45')]=function(_0x48601d,_0x52e97e){var _0x381c12={'raw':!![],'where':{'id':_0x48601d[_0x1306('0x46')]['id']}},_0x1d62d5={};_0x1d62d5[_0x1306('0x33')]=_['keys'](db[_0x1306('0x2b')][_0x1306('0x2c')]);_0x1d62d5[_0x1306('0x2f')]=_[_0x1306('0x30')](_0x48601d['query']);_0x1d62d5[_0x1306('0x31')]=_[_0x1306('0x32')](_0x1d62d5[_0x1306('0x33')],_0x1d62d5[_0x1306('0x2f')]);_0x381c12[_0x1306('0x34')]=_[_0x1306('0x32')](_0x1d62d5[_0x1306('0x33')],qs[_0x1306('0x35')](_0x48601d['query'][_0x1306('0x35')]));_0x381c12[_0x1306('0x34')]=_0x381c12['attributes'][_0x1306('0x36')]?_0x381c12[_0x1306('0x34')]:_0x1d62d5[_0x1306('0x33')];if(_0x48601d[_0x1306('0x2f')][_0x1306('0x47')]){_0x381c12[_0x1306('0x41')]=[{'all':!![]}];}_0x381c12=_['merge']({},_0x381c12,_0x48601d[_0x1306('0x40')]);return db[_0x1306('0x2b')]['find'](_0x381c12)[_0x1306('0x25')](handleEntityNotFound(_0x52e97e,null))[_0x1306('0x25')](respondWithResult(_0x52e97e,null))[_0x1306('0x44')](handleError(_0x52e97e,null));};exports[_0x1306('0x48')]=function(_0x39d9ed,_0x113937){return db['VoiceMailMessage'][_0x1306('0x48')](_0x39d9ed[_0x1306('0x49')],{})[_0x1306('0x25')](respondWithResult(_0x113937,0xc9))[_0x1306('0x44')](handleError(_0x113937,null));};exports[_0x1306('0x24')]=function(_0x225bc9,_0x53ac8d){if(_0x225bc9[_0x1306('0x49')]['id']){delete _0x225bc9[_0x1306('0x49')]['id'];}return db['VoiceMailMessage'][_0x1306('0x4a')]({'where':{'id':_0x225bc9[_0x1306('0x46')]['id']}})['then'](handleEntityNotFound(_0x53ac8d,null))['then'](saveUpdates(_0x225bc9[_0x1306('0x49')],null))[_0x1306('0x25')](respondWithResult(_0x53ac8d,null))[_0x1306('0x44')](handleError(_0x53ac8d,null));};exports[_0x1306('0x26')]=function(_0x305b94,_0x38b6f4){return db['VoiceMailMessage']['find']({'where':{'id':_0x305b94[_0x1306('0x46')]['id']}})['then'](handleEntityNotFound(_0x38b6f4,null))[_0x1306('0x25')](removeEntity(_0x38b6f4,null))[_0x1306('0x44')](handleError(_0x38b6f4,null));};exports[_0x1306('0x4b')]=function(_0x839b72,_0x1e2ab9,_0x116a3f){return db[_0x1306('0x2b')]['find']({'where':{'id':_0x839b72[_0x1306('0x46')]['id']},'attributes':['id',_0x1306('0x4c'),'msg_id']})[_0x1306('0x25')](handleEntityNotFound(_0x1e2ab9,null))[_0x1306('0x25')](function(_0x3a15cb){if(_0x3a15cb){if(!_0x3a15cb[_0x1306('0x4c')]){throw new db[(_0x1306('0x4d'))][(_0x1306('0x4e'))]('VoiceMailMessage\x20not\x20found');}var _0x3fa456={'Content-Type':_0x1306('0x4f'),'Content-Disposition':_0x1306('0x50')};if(_0x3a15cb[_0x1306('0x51')]){_0x3fa456[_0x1306('0x52')]=_0x1306('0x53')+_0x3a15cb[_0x1306('0x51')]+_0x1306('0x54');}_0x1e2ab9['set'](_0x3fa456);return _0x1e2ab9[_0x1306('0x55')](new Buffer(_0x3a15cb[_0x1306('0x4c')]));}})[_0x1306('0x44')](handleError(_0x1e2ab9,null));};
\ No newline at end of file
index b57cb2b..08e39c3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd36b=['request-promise','rimraf','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','dir','util','../../config/logger','api'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xd36b,0x101));var _0xbd36=function(_0x2f0f8b,_0x5bd15c){_0x2f0f8b=_0x2f0f8b-0x0;var _0x484bd0=_0xd36b[_0x2f0f8b];return _0x484bd0;};'use strict';var _=require('lodash');var util=require(_0xbd36('0x0'));var logger=require(_0xbd36('0x1'))(_0xbd36('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xbd36('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd36('0x4'));var config=require('../../config/environment');var attributes=require(_0xbd36('0x5'));module[_0xbd36('0x6')]=function(_0x42f60e,_0x125f71){return _0x42f60e[_0xbd36('0x7')](_0xbd36('0x8'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0xbd36('0x9'),'fields':[_0xbd36('0x9')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7b9c=['path','rimraf','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','api','bluebird','request-promise'];(function(_0x1591d4,_0x4ea3bd){var _0x4c46bb=function(_0x13b7e7){while(--_0x13b7e7){_0x1591d4['push'](_0x1591d4['shift']());}};_0x4c46bb(++_0x4ea3bd);}(_0x7b9c,0x1ec));var _0xc7b9=function(_0x314997,_0x234a37){_0x314997=_0x314997-0x0;var _0x46e9ca=_0x7b9c[_0x314997];return _0x46e9ca;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc7b9('0x0'));var moment=require('moment');var BPromise=require(_0xc7b9('0x1'));var rp=require(_0xc7b9('0x2'));var fs=require('fs');var path=require(_0xc7b9('0x3'));var rimraf=require(_0xc7b9('0x4'));var config=require('../../config/environment');var attributes=require(_0xc7b9('0x5'));module[_0xc7b9('0x6')]=function(_0x1e3fef,_0x3e11f6){return _0x1e3fef[_0xc7b9('0x7')](_0xc7b9('0x8'),attributes,{'tableName':_0xc7b9('0x9'),'paranoid':![],'indexes':[{'name':_0xc7b9('0xa'),'fields':[_0xc7b9('0xa')]}],'timestamps':![]});};
\ No newline at end of file
index 4ec07bc..bf0312f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xced7=['result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','VoiceMailMessage,\x20%s,\x20%s','debug','stringify','error','code','message'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xced7,0x94));var _0x7ced=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xced7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7ced('0x0'));var util=require(_0x7ced('0x1'));var moment=require(_0x7ced('0x2'));var BPromise=require(_0x7ced('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7ced('0x4'));var db=require(_0x7ced('0x5'))['db'];var utils=require(_0x7ced('0x6'));var logger=require(_0x7ced('0x7'))(_0x7ced('0x8'));var config=require(_0x7ced('0x9'));var jayson=require(_0x7ced('0xa'));var client=jayson[_0x7ced('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc3fe4,_0x44ef92,_0x51afee){return new BPromise(function(_0x5b8b17,_0x1623b3){return client['request'](_0xc3fe4,_0x51afee)[_0x7ced('0xc')](function(_0x19ed89){logger[_0x7ced('0xd')](_0x7ced('0xe'),_0x44ef92,'request\x20sent');logger[_0x7ced('0xf')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x44ef92,'request\x20sent',JSON[_0x7ced('0x10')](_0x19ed89));if(_0x19ed89[_0x7ced('0x11')]){if(_0x19ed89[_0x7ced('0x11')][_0x7ced('0x12')]===0x1f4){logger[_0x7ced('0x11')](_0x7ced('0xe'),_0x44ef92,_0x19ed89[_0x7ced('0x11')][_0x7ced('0x13')]);return _0x1623b3(_0x19ed89[_0x7ced('0x11')][_0x7ced('0x13')]);}logger[_0x7ced('0x11')](_0x7ced('0xe'),_0x44ef92,_0x19ed89[_0x7ced('0x11')]['message']);return _0x5b8b17(_0x19ed89[_0x7ced('0x11')]['message']);}else{logger[_0x7ced('0xd')](_0x7ced('0xe'),_0x44ef92,'request\x20sent');_0x5b8b17(_0x19ed89[_0x7ced('0x14')][_0x7ced('0x13')]);}})['catch'](function(_0x27916d){logger[_0x7ced('0x11')](_0x7ced('0xe'),_0x44ef92,_0x27916d);_0x1623b3(_0x27916d);});});}
\ No newline at end of file
+var _0x74c3=['debug','request\x20sent','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','VoiceMailMessage,\x20%s,\x20%s'];(function(_0x117c95,_0x372c77){var _0xb15f29=function(_0x17fe20){while(--_0x17fe20){_0x117c95['push'](_0x117c95['shift']());}};_0xb15f29(++_0x372c77);}(_0x74c3,0x98));var _0x374c=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x74c3[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0x374c('0x0'));var util=require(_0x374c('0x1'));var moment=require(_0x374c('0x2'));var BPromise=require(_0x374c('0x3'));var rs=require(_0x374c('0x4'));var fs=require('fs');var Redis=require(_0x374c('0x5'));var db=require(_0x374c('0x6'))['db'];var utils=require(_0x374c('0x7'));var logger=require(_0x374c('0x8'))(_0x374c('0x9'));var config=require(_0x374c('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x374c('0xb')][_0x374c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x54d556,_0x480ba2,_0x3c4ca7){return new BPromise(function(_0x243811,_0x3b191c){return client[_0x374c('0xd')](_0x54d556,_0x3c4ca7)[_0x374c('0xe')](function(_0x55c38e){logger['info'](_0x374c('0xf'),_0x480ba2,'request\x20sent');logger[_0x374c('0x10')]('VoiceMailMessage,\x20%s,\x20%s,\x20%s',_0x480ba2,_0x374c('0x11'),JSON[_0x374c('0x12')](_0x55c38e));if(_0x55c38e['error']){if(_0x55c38e[_0x374c('0x13')][_0x374c('0x14')]===0x1f4){logger[_0x374c('0x13')](_0x374c('0xf'),_0x480ba2,_0x55c38e[_0x374c('0x13')][_0x374c('0x15')]);return _0x3b191c(_0x55c38e[_0x374c('0x13')][_0x374c('0x15')]);}logger[_0x374c('0x13')](_0x374c('0xf'),_0x480ba2,_0x55c38e[_0x374c('0x13')][_0x374c('0x15')]);return _0x243811(_0x55c38e[_0x374c('0x13')][_0x374c('0x15')]);}else{logger[_0x374c('0x16')](_0x374c('0xf'),_0x480ba2,_0x374c('0x11'));_0x243811(_0x55c38e[_0x374c('0x17')][_0x374c('0x15')]);}})['catch'](function(_0x210deb){logger[_0x374c('0x13')]('VoiceMailMessage,\x20%s,\x20%s',_0x480ba2,_0x210deb);_0x3b191c(_0x210deb);});});}
\ No newline at end of file
index cc34cbc..0b9ee3e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf0b0=['show','/:id/sounds','getSounds','create','post','update','destroy','removeSound','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id'];(function(_0xf64e53,_0x4db24b){var _0x1e185e=function(_0x451dc3){while(--_0x451dc3){_0xf64e53['push'](_0xf64e53['shift']());}};_0x1e185e(++_0x4db24b);}(_0xf0b0,0x1ad));var _0x0f0b=function(_0x3909fc,_0x29e558){_0x3909fc=_0x3909fc-0x0;var _0x1872bf=_0xf0b0[_0x3909fc];return _0x1872bf;};'use strict';var multer=require(_0x0f0b('0x0'));var util=require(_0x0f0b('0x1'));var path=require(_0x0f0b('0x2'));var timeout=require(_0x0f0b('0x3'));var express=require(_0x0f0b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0f0b('0x5'));var interaction=require(_0x0f0b('0x6'));var config=require(_0x0f0b('0x7'));var controller=require(_0x0f0b('0x8'));router[_0x0f0b('0x9')]('/',auth[_0x0f0b('0xa')](),controller['index']);router[_0x0f0b('0x9')](_0x0f0b('0xb'),auth[_0x0f0b('0xa')](),controller[_0x0f0b('0xc')]);router[_0x0f0b('0x9')](_0x0f0b('0xd'),auth[_0x0f0b('0xa')](),controller[_0x0f0b('0xe')]);router['post']('/',auth[_0x0f0b('0xa')](),controller[_0x0f0b('0xf')]);router[_0x0f0b('0x10')](_0x0f0b('0xd'),auth[_0x0f0b('0xa')](),controller['addSound']);router['put'](_0x0f0b('0xb'),auth[_0x0f0b('0xa')](),controller[_0x0f0b('0x11')]);router['delete'](_0x0f0b('0xb'),auth['isAuthenticated'](),controller[_0x0f0b('0x12')]);router['delete']('/:id/sounds/:id2',auth[_0x0f0b('0xa')](),controller[_0x0f0b('0x13')]);module[_0x0f0b('0x14')]=router;
\ No newline at end of file
+var _0x467c=['addSound','put','/:id','destroy','delete','/:id/sounds/:id2','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id/sounds','getSounds','post','create'];(function(_0x1a1b6e,_0x3a07a9){var _0x571e2c=function(_0x6cea62){while(--_0x6cea62){_0x1a1b6e['push'](_0x1a1b6e['shift']());}};_0x571e2c(++_0x3a07a9);}(_0x467c,0x10b));var _0xc467=function(_0x230bb9,_0x1ce784){_0x230bb9=_0x230bb9-0x0;var _0x245e5f=_0x467c[_0x230bb9];return _0x245e5f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc467('0x0'));var timeout=require(_0xc467('0x1'));var express=require(_0xc467('0x2'));var router=express[_0xc467('0x3')]();var fs_extra=require(_0xc467('0x4'));var auth=require(_0xc467('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc467('0x6'));var controller=require('./voiceMusicOnHold.controller');router[_0xc467('0x7')]('/',auth[_0xc467('0x8')](),controller['index']);router[_0xc467('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0xc467('0x9'),auth[_0xc467('0x8')](),controller[_0xc467('0xa')]);router[_0xc467('0xb')]('/',auth[_0xc467('0x8')](),controller[_0xc467('0xc')]);router[_0xc467('0xb')](_0xc467('0x9'),auth['isAuthenticated'](),controller[_0xc467('0xd')]);router[_0xc467('0xe')](_0xc467('0xf'),auth[_0xc467('0x8')](),controller['update']);router['delete'](_0xc467('0xf'),auth[_0xc467('0x8')](),controller[_0xc467('0x10')]);router[_0xc467('0x11')](_0xc467('0x12'),auth[_0xc467('0x8')](),controller['removeSound']);module[_0xc467('0x13')]=router;
\ No newline at end of file
index 1579905..b3689f1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x81c1=['files','quietmp3nb','mp3','alpha','TIMESTAMP','sequelize','exports','STRING','name','ENUM','custom'];(function(_0x53b2cd,_0x18747e){var _0x100d52=function(_0x4ffedc){while(--_0x4ffedc){_0x53b2cd['push'](_0x53b2cd['shift']());}};_0x100d52(++_0x18747e);}(_0x81c1,0x118));var _0x181c=function(_0x167651,_0x4e8533){_0x167651=_0x167651-0x0;var _0x152840=_0x81c1[_0x167651];return _0x152840;};'use strict';var Sequelize=require(_0x181c('0x0'));module[_0x181c('0x1')]={'name':{'type':Sequelize[_0x181c('0x2')],'allowNull':![],'unique':_0x181c('0x3')},'mode':{'type':Sequelize[_0x181c('0x4')](_0x181c('0x5'),_0x181c('0x6'),'mp3nb',_0x181c('0x7'),'quietmp3',_0x181c('0x8')),'allowNull':!![],'defaultValue':_0x181c('0x6')},'directory':{'type':Sequelize[_0x181c('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x181c('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x181c('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x181c('0x2')],'allowNull':!![],'defaultValue':_0x181c('0x9')},'format':{'type':Sequelize[_0x181c('0x2')],'allowNull':!![]},'stamp':{'type':_0x181c('0xa')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x30bd=['sequelize','exports','STRING','name','custom','mp3nb','quietmp3','mp3','alpha','TIMESTAMP','BOOLEAN'];(function(_0x2a1266,_0x7dee04){var _0x1aadc5=function(_0x15e4e9){while(--_0x15e4e9){_0x2a1266['push'](_0x2a1266['shift']());}};_0x1aadc5(++_0x7dee04);}(_0x30bd,0xf2));var _0xd30b=function(_0x34062a,_0x3ae3a3){_0x34062a=_0x34062a-0x0;var _0x563310=_0x30bd[_0x34062a];return _0x563310;};'use strict';var Sequelize=require(_0xd30b('0x0'));module[_0xd30b('0x1')]={'name':{'type':Sequelize[_0xd30b('0x2')],'allowNull':![],'unique':_0xd30b('0x3')},'mode':{'type':Sequelize['ENUM'](_0xd30b('0x4'),'files',_0xd30b('0x5'),'quietmp3nb',_0xd30b('0x6'),_0xd30b('0x7')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xd30b('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xd30b('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0xd30b('0x2')],'allowNull':!![],'defaultValue':_0xd30b('0x8')},'format':{'type':Sequelize[_0xd30b('0x2')],'allowNull':!![]},'stamp':{'type':_0xd30b('0x9')},'defaultEntry':{'type':Sequelize[_0xd30b('0xa')],'defaultValue':0x0}};
\ No newline at end of file
index 1454e56..e1a92e1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60ee=['mkdirSync','directory','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','UserProfileResource','create','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','addSound','transaction','Sound','findOne','converted_format','server/files/sounds/converted','format','%s.%s','basename','save_name','symlinkSync','message','removeSound','id2','createdAt','length','eml-format','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','end','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','MusicOnHolds','sendStatus','error','stack','name','index','map','VoiceMusicOnHold','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','options','find','body','sequelize','files','join','root','server/files/moh'];(function(_0x5dfda1,_0x26d550){var _0x2add40=function(_0x103f37){while(--_0x103f37){_0x5dfda1['push'](_0x5dfda1['shift']());}};_0x2add40(++_0x26d550);}(_0x60ee,0x15c));var _0xe60e=function(_0x101802,_0x11f913){_0x101802=_0x101802-0x0;var _0x5d61ce=_0x60ee[_0x101802];return _0x5d61ce;};'use strict';var emlformat=require(_0xe60e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe60e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe60e('0x2'));var BPromise=require(_0xe60e('0x3'));var Mustache=require(_0xe60e('0x4'));var util=require('util');var path=require(_0xe60e('0x5'));var sox=require(_0xe60e('0x6'));var csv=require(_0xe60e('0x7'));var ejs=require(_0xe60e('0x8'));var fs=require('fs');var fs_extra=require(_0xe60e('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe60e('0xa'));var jsforce=require(_0xe60e('0xb'));var deskjs=require(_0xe60e('0xc'));var toCsv=require(_0xe60e('0x7'));var querystring=require('querystring');var Papa=require(_0xe60e('0xd'));var Redis=require(_0xe60e('0xe'));var authService=require(_0xe60e('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe60e('0x10'));var utils=require(_0xe60e('0x11'));var config=require(_0xe60e('0x12'));var licenseUtil=require(_0xe60e('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x415385,_0x5171a9){_0x5171a9=_0x5171a9||0xcc;return function(_0x17465b){if(_0x17465b){return _0x415385['sendStatus'](_0x5171a9);}return _0x415385['status'](_0x5171a9)[_0xe60e('0x14')]();};}function respondWithResult(_0x2b952f,_0x4bd612){_0x4bd612=_0x4bd612||0xc8;return function(_0x1063d9){if(_0x1063d9){return _0x2b952f[_0xe60e('0x15')](_0x4bd612)['json'](_0x1063d9);}};}function respondWithFilteredResult(_0x4a0845,_0x5d5cf4){return function(_0x1688fc){if(_0x1688fc){var _0x204c7c=typeof _0x5d5cf4['offset']==='undefined'&&typeof _0x5d5cf4['limit']===_0xe60e('0x16');var _0x391956=_0x1688fc[_0xe60e('0x17')];var _0x49482c=_0x204c7c?0x0:_0x5d5cf4[_0xe60e('0x18')];var _0x581dc7=_0x204c7c?_0x1688fc[_0xe60e('0x17')]:_0x5d5cf4[_0xe60e('0x18')]+_0x5d5cf4[_0xe60e('0x19')];var _0x2895c2;if(_0x581dc7>=_0x391956){_0x581dc7=_0x391956;_0x2895c2=0xc8;}else{_0x2895c2=0xce;}_0x4a0845['status'](_0x2895c2);return _0x4a0845[_0xe60e('0x1a')](_0xe60e('0x1b'),_0x49482c+'-'+_0x581dc7+'/'+_0x391956)[_0xe60e('0x1c')](_0x1688fc);}return null;};}function patchUpdates(_0x22922e){return function(_0x5ae02d){try{jsonpatch[_0xe60e('0x1d')](_0x5ae02d,_0x22922e,!![]);}catch(_0xf8aae){return BPromise[_0xe60e('0x1e')](_0xf8aae);}return _0x5ae02d[_0xe60e('0x1f')]();};}function saveUpdates(_0x45cfd3,_0x19c419){return function(_0x30495d){if(_0x30495d){return _0x30495d[_0xe60e('0x20')](_0x45cfd3)[_0xe60e('0x21')](function(_0x24d396){return _0x24d396;});}return null;};}function removeEntity(_0x5cfab8,_0x5818a4){return function(_0x278a9c){if(_0x278a9c){return _0x278a9c[_0xe60e('0x22')]()[_0xe60e('0x21')](function(){var _0x1a71c8=_0x278a9c[_0xe60e('0x23')]({'plain':!![]});var _0x5e6547=_0xe60e('0x24');return db['UserProfileResource'][_0xe60e('0x22')]({'where':{'type':_0x5e6547,'resourceId':_0x1a71c8['id']}})[_0xe60e('0x21')](function(){return _0x278a9c;});})[_0xe60e('0x21')](function(){_0x5cfab8[_0xe60e('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9ed427,_0x316bb7){return function(_0x2b57ad){if(!_0x2b57ad){_0x9ed427[_0xe60e('0x25')](0x194);}return _0x2b57ad;};}function handleError(_0x181bca,_0x27e277){_0x27e277=_0x27e277||0x1f4;return function(_0x345c68){logger[_0xe60e('0x26')](_0x345c68[_0xe60e('0x27')]);if(_0x345c68['name']){delete _0x345c68[_0xe60e('0x28')];}_0x181bca[_0xe60e('0x15')](_0x27e277)['send'](_0x345c68);};}exports[_0xe60e('0x29')]=function(_0x55bb8b,_0x37ddd8){var _0x20fedc={},_0x13d2a4={},_0x43300c={'count':0x0,'rows':[]};var _0x193c2f=_[_0xe60e('0x2a')](db[_0xe60e('0x2b')]['rawAttributes'],function(_0x500413){return{'name':_0x500413[_0xe60e('0x2c')],'type':_0x500413[_0xe60e('0x2d')][_0xe60e('0x2e')]};});_0x13d2a4[_0xe60e('0x2f')]=_[_0xe60e('0x2a')](_0x193c2f,_0xe60e('0x28'));_0x13d2a4[_0xe60e('0x30')]=_['keys'](_0x55bb8b[_0xe60e('0x30')]);_0x13d2a4[_0xe60e('0x31')]=_[_0xe60e('0x32')](_0x13d2a4[_0xe60e('0x2f')],_0x13d2a4[_0xe60e('0x30')]);_0x20fedc['attributes']=_[_0xe60e('0x32')](_0x13d2a4[_0xe60e('0x2f')],qs[_0xe60e('0x33')](_0x55bb8b[_0xe60e('0x30')]['fields']));_0x20fedc[_0xe60e('0x34')]=_0x20fedc[_0xe60e('0x34')]['length']?_0x20fedc[_0xe60e('0x34')]:_0x13d2a4[_0xe60e('0x2f')];if(!_0x55bb8b[_0xe60e('0x30')][_0xe60e('0x35')](_0xe60e('0x36'))){_0x20fedc[_0xe60e('0x19')]=qs['limit'](_0x55bb8b[_0xe60e('0x30')][_0xe60e('0x19')]);_0x20fedc['offset']=qs[_0xe60e('0x18')](_0x55bb8b[_0xe60e('0x30')][_0xe60e('0x18')]);}_0x20fedc['order']=qs['sort'](_0x55bb8b['query']['sort']);delete _0x55bb8b[_0xe60e('0x30')][_0xe60e('0x37')];_0x20fedc[_0xe60e('0x38')]=qs[_0xe60e('0x31')](_[_0xe60e('0x39')](_0x55bb8b[_0xe60e('0x30')],_0x13d2a4[_0xe60e('0x31')]),_0x193c2f);if(_0x55bb8b[_0xe60e('0x30')][_0xe60e('0x3a')]){_0x20fedc[_0xe60e('0x38')]=_[_0xe60e('0x3b')](_0x20fedc[_0xe60e('0x38')],{'$or':_[_0xe60e('0x2a')](_0x193c2f,function(_0x10d300){if(_0x10d300[_0xe60e('0x2d')]!=='VIRTUAL'){var _0x296079={};_0x296079[_0x10d300[_0xe60e('0x28')]]={'$like':'%'+_0x55bb8b[_0xe60e('0x30')][_0xe60e('0x3a')]+'%'};return _0x296079;}})});}_0x20fedc=_['merge']({},_0x20fedc,_0x55bb8b['options']);var _0xc6e0f1={'where':_0x20fedc[_0xe60e('0x38')]};return db[_0xe60e('0x2b')]['count'](_0xc6e0f1)[_0xe60e('0x21')](function(_0x2223ee){_0x43300c[_0xe60e('0x17')]=_0x2223ee;if(_0x55bb8b[_0xe60e('0x30')][_0xe60e('0x3c')]){_0x20fedc[_0xe60e('0x3d')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xe60e('0x3e')](_0x20fedc);})[_0xe60e('0x21')](function(_0x1f34b3){_0x43300c[_0xe60e('0x3f')]=_0x1f34b3;return _0x43300c;})['then'](respondWithFilteredResult(_0x37ddd8,_0x20fedc))[_0xe60e('0x40')](handleError(_0x37ddd8,null));};exports['show']=function(_0x3f4900,_0x3a76ca){var _0x158635={'raw':![],'where':{'id':_0x3f4900[_0xe60e('0x41')]['id']}},_0x3c576a={};_0x3c576a[_0xe60e('0x2f')]=_[_0xe60e('0x42')](db[_0xe60e('0x2b')][_0xe60e('0x43')]);_0x3c576a[_0xe60e('0x30')]=_[_0xe60e('0x42')](_0x3f4900[_0xe60e('0x30')]);_0x3c576a[_0xe60e('0x31')]=_[_0xe60e('0x32')](_0x3c576a['model'],_0x3c576a['query']);_0x158635[_0xe60e('0x34')]=_[_0xe60e('0x32')](_0x3c576a[_0xe60e('0x2f')],qs['fields'](_0x3f4900[_0xe60e('0x30')][_0xe60e('0x33')]));_0x158635['attributes']=_0x158635[_0xe60e('0x34')]['length']?_0x158635[_0xe60e('0x34')]:_0x3c576a[_0xe60e('0x2f')];if(_0x3f4900[_0xe60e('0x30')][_0xe60e('0x3c')]){_0x158635[_0xe60e('0x3d')]=[{'all':!![]}];}_0x158635=_['merge']({},_0x158635,_0x3f4900[_0xe60e('0x44')]);return db[_0xe60e('0x2b')][_0xe60e('0x45')](_0x158635)[_0xe60e('0x21')](handleEntityNotFound(_0x3a76ca,null))[_0xe60e('0x21')](respondWithResult(_0x3a76ca,null))['catch'](handleError(_0x3a76ca,null));};exports['update']=function(_0x1f0ebe,_0xa55dee){if(_0x1f0ebe[_0xe60e('0x46')]['id']){delete _0x1f0ebe[_0xe60e('0x46')]['id'];}return db[_0xe60e('0x2b')][_0xe60e('0x45')]({'where':{'id':_0x1f0ebe[_0xe60e('0x41')]['id']}})[_0xe60e('0x21')](handleEntityNotFound(_0xa55dee,null))[_0xe60e('0x21')](saveUpdates(_0x1f0ebe[_0xe60e('0x46')],null))['then'](respondWithResult(_0xa55dee,null))['catch'](handleError(_0xa55dee,null));};exports['create']=function(_0xbb381b,_0xaa30bf,_0x2ad06a){return db[_0xe60e('0x47')]['transaction'](function(_0x57e0a4){if(_0xbb381b['body']['mode']===_0xe60e('0x48')){_0xbb381b[_0xe60e('0x46')]['directory']=path[_0xe60e('0x49')](config[_0xe60e('0x4a')],_0xe60e('0x4b'),_0xbb381b['body']['name']);}return db[_0xe60e('0x2b')]['create'](_0xbb381b[_0xe60e('0x46')],{'transaction':_0x57e0a4})[_0xe60e('0x21')](function(_0x4ecd5b){if(_0xbb381b[_0xe60e('0x46')]['mode']===_0xe60e('0x48')){fs[_0xe60e('0x4c')](_0x4ecd5b[_0xe60e('0x4d')],parseInt('0777',0x8));}var _0x4998e2=_0xbb381b['user'][_0xe60e('0x23')]({'plain':!![]});if(!_0x4998e2)throw new Error(_0xe60e('0x4e'));if(_0x4998e2['role']===_0xe60e('0x4f')){var _0x391c90=_0x4ecd5b[_0xe60e('0x23')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xe60e('0x24'),'userProfileId':_0x4998e2[_0xe60e('0x50')]},'raw':!![]})['then'](function(_0x2a6d47){if(_0x2a6d47&&_0x2a6d47[_0xe60e('0x51')]===0x0){return db[_0xe60e('0x52')][_0xe60e('0x53')]({'name':_0x391c90[_0xe60e('0x28')],'resourceId':_0x391c90['id'],'type':_0x2a6d47[_0xe60e('0x28')],'sectionId':_0x2a6d47['id']},{})[_0xe60e('0x21')](function(){return _0x4ecd5b;});}else{return _0x4ecd5b;}})[_0xe60e('0x40')](function(_0x5c5c37){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c5c37);});}return _0x4ecd5b;});})[_0xe60e('0x21')](respondWithResult(_0xaa30bf,0xc9))['catch'](handleError(_0xaa30bf,null));};exports[_0xe60e('0x22')]=function(_0x3093f6,_0x401cea,_0x527fae){var _0x1faaf2;return db[_0xe60e('0x2b')][_0xe60e('0x45')]({'where':{'id':_0x3093f6['params']['id']}})['then'](function(_0x2ac246){if(_0x2ac246){return db[_0xe60e('0x47')]['transaction'](function(_0xb4c7c3){return _0x2ac246['destroy']({'transaction':_0xb4c7c3,'raw':!![]})['then'](function(_0x2e552f){if(_0x2e552f[_0xe60e('0x4d')]){fs[_0xe60e('0x54')](_0x2e552f[_0xe60e('0x4d')])[_0xe60e('0x55')](function(_0x3d5251){fs[_0xe60e('0x56')](path[_0xe60e('0x49')](_0x2e552f['directory'],_0x3d5251));});fs[_0xe60e('0x57')](_0x2e552f['directory']);}return _0x2e552f;});})[_0xe60e('0x40')](function(_0x44ed75){throw new db[(_0xe60e('0x58'))][(_0xe60e('0x59'))](_0x44ed75['message']);});}})['then'](handleEntityNotFound(_0x401cea,null))['then'](removeEntity(_0x401cea,null))[_0xe60e('0x40')](handleError(_0x401cea,null));};exports[_0xe60e('0x5a')]=function(_0x226ec8,_0x37499e,_0x112cc2){return db[_0xe60e('0x47')][_0xe60e('0x5b')](function(_0x356684){var _0x2f0d6e;return db[_0xe60e('0x2b')][_0xe60e('0x45')]({'where':{'id':_0x226ec8['params']['id']}})[_0xe60e('0x21')](function(_0x398950){if(_0x398950){_0x2f0d6e=_0x398950;return _0x398950[_0xe60e('0x5a')](_0x226ec8[_0xe60e('0x46')]['id'],{'transaction':_0x356684});}})[_0xe60e('0x21')](function(_0x3f19ad){if(_0x3f19ad){return db[_0xe60e('0x5c')][_0xe60e('0x5d')]({'where':{'id':_0x226ec8[_0xe60e('0x46')]['id']},'attributes':['id','name','save_name',_0xe60e('0x5e'),'createdAt'],'raw':!![]});}})[_0xe60e('0x21')](function(_0x4fb9d4){if(_0x4fb9d4){var _0xa725c1=path['join'](config[_0xe60e('0x4a')],_0xe60e('0x5f'),util[_0xe60e('0x60')](_0xe60e('0x61'),path[_0xe60e('0x62')](_0x4fb9d4[_0xe60e('0x63')],path['extname'](_0x4fb9d4[_0xe60e('0x63')])),_0x4fb9d4[_0xe60e('0x5e')]));var _0x115c5b=path[_0xe60e('0x49')](config[_0xe60e('0x4a')],_0xe60e('0x4b'),_0x2f0d6e['name'],util[_0xe60e('0x60')]('%s.%s',_0x4fb9d4[_0xe60e('0x28')],_0x4fb9d4[_0xe60e('0x5e')]));fs[_0xe60e('0x64')](_0xa725c1,_0x115c5b);return _0x4fb9d4;}})[_0xe60e('0x40')](function(_0x183ea5){throw new db[(_0xe60e('0x58'))][(_0xe60e('0x59'))](_0x183ea5[_0xe60e('0x65')]);});})[_0xe60e('0x21')](handleEntityNotFound(_0x37499e,null))[_0xe60e('0x21')](respondWithResult(_0x37499e,0xc9))[_0xe60e('0x40')](handleError(_0x37499e,null));};exports[_0xe60e('0x66')]=function(_0x4adce7,_0x2db141,_0x454aa3){return db[_0xe60e('0x47')][_0xe60e('0x5b')](function(_0x21e1ee){var _0x3dd085;return db['VoiceMusicOnHold'][_0xe60e('0x5d')]({'where':{'id':_0x4adce7[_0xe60e('0x41')]['id']}})['then'](handleEntityNotFound(_0x2db141,null))[_0xe60e('0x21')](function(_0x327b4a){if(_0x327b4a){_0x3dd085=_0x327b4a;return _0x327b4a[_0xe60e('0x66')](_0x4adce7[_0xe60e('0x41')][_0xe60e('0x67')]);}})[_0xe60e('0x21')](function(_0x504a1e){if(_0x504a1e){return db['Sound'][_0xe60e('0x5d')]({'where':{'id':_0x4adce7['params'][_0xe60e('0x67')]},'attributes':['id','name',_0xe60e('0x63'),_0xe60e('0x5e'),_0xe60e('0x68')],'raw':!![]});}})[_0xe60e('0x21')](function(_0x6b9d23){if(_0x6b9d23){fs[_0xe60e('0x56')](path[_0xe60e('0x49')](_0x3dd085['directory'],util[_0xe60e('0x60')](_0xe60e('0x61'),_0x6b9d23['name'],_0x6b9d23[_0xe60e('0x5e')])));return _0x6b9d23;}})[_0xe60e('0x40')](function(_0x39a97e){throw new db['Sequelize'][(_0xe60e('0x59'))](_0x39a97e[_0xe60e('0x65')]);});})[_0xe60e('0x21')](handleEntityNotFound(_0x2db141,null))['then'](respondWithStatusCode(_0x2db141,0xcc))[_0xe60e('0x40')](handleError(_0x2db141,null));};exports['getSounds']=function(_0xb5bad7,_0x6906be,_0x5acd2a){var _0x4c6a68={};var _0x419a82={};var _0x4f1b64;var _0x43e5a7;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0xb5bad7[_0xe60e('0x41')]['id']}})[_0xe60e('0x21')](handleEntityNotFound(_0x6906be,null))[_0xe60e('0x21')](function(_0x514542){if(_0x514542){_0x4f1b64=_0x514542;_0x419a82['model']=_['keys'](db[_0xe60e('0x5c')]['rawAttributes']);_0x419a82[_0xe60e('0x30')]=_[_0xe60e('0x42')](_0xb5bad7[_0xe60e('0x30')]);_0x419a82['filters']=_[_0xe60e('0x32')](_0x419a82[_0xe60e('0x2f')],_0x419a82['query']);_0x4c6a68[_0xe60e('0x34')]=_[_0xe60e('0x32')](_0x419a82[_0xe60e('0x2f')],qs['fields'](_0xb5bad7[_0xe60e('0x30')]['fields']));_0x4c6a68[_0xe60e('0x34')]=_0x4c6a68['attributes'][_0xe60e('0x69')]?_0x4c6a68['attributes']:_0x419a82['model'];_0x4c6a68['order']=qs[_0xe60e('0x37')](_0xb5bad7[_0xe60e('0x30')][_0xe60e('0x37')]);_0x4c6a68[_0xe60e('0x38')]=qs[_0xe60e('0x31')](_['pick'](_0xb5bad7['query'],_0x419a82['filters']));if(_0xb5bad7['query'][_0xe60e('0x3a')]){_0x4c6a68[_0xe60e('0x38')]=_[_0xe60e('0x3b')](_0x4c6a68[_0xe60e('0x38')],{'$or':_['map'](_0x4c6a68[_0xe60e('0x34')],function(_0x3c746c){var _0x3931d8={};_0x3931d8[_0x3c746c]={'$like':'%'+_0xb5bad7['query'][_0xe60e('0x3a')]+'%'};return _0x3931d8;})});}_0x4c6a68=_[_0xe60e('0x3b')]({},_0x4c6a68,_0xb5bad7[_0xe60e('0x44')]);return _0x4f1b64['getSounds'](_0x4c6a68);}})[_0xe60e('0x21')](function(_0x1e891f){if(_0x1e891f){_0x43e5a7=_0x1e891f[_0xe60e('0x69')];if(!_0xb5bad7[_0xe60e('0x30')][_0xe60e('0x35')](_0xe60e('0x36'))){_0x4c6a68['limit']=qs[_0xe60e('0x19')](_0xb5bad7[_0xe60e('0x30')]['limit']);_0x4c6a68[_0xe60e('0x18')]=qs[_0xe60e('0x18')](_0xb5bad7[_0xe60e('0x30')][_0xe60e('0x18')]);}return _0x4f1b64['getSounds'](_0x4c6a68);}})[_0xe60e('0x21')](function(_0x3c1841){if(_0x3c1841){return _0x3c1841?{'count':_0x43e5a7,'rows':_0x3c1841}:null;}})['then'](respondWithResult(_0x6906be,null))[_0xe60e('0x40')](handleError(_0x6906be,null));};
\ No newline at end of file
+var _0x59c3=['directory','join','root','server/files/moh','mode','files','mkdirSync','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','transaction','readdirSync','forEach','unlinkSync','Sequelize','ValidationError','message','addSound','Sound','findOne','save_name','converted_format','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','removeSound','id2','createdAt','getSounds','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','MusicOnHolds','destroy','end','error','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','VoiceMusicOnHold','includeAll','include','findAll','catch','show','params','length','body','find','create'];(function(_0x3710f1,_0x4d55cf){var _0x1ef269=function(_0x286dce){while(--_0x286dce){_0x3710f1['push'](_0x3710f1['shift']());}};_0x1ef269(++_0x4d55cf);}(_0x59c3,0x106));var _0x359c=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x59c3[_0x24237f];return _0x48298e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x359c('0x0'));var zipdir=require(_0x359c('0x1'));var jsonpatch=require(_0x359c('0x2'));var rp=require(_0x359c('0x3'));var moment=require(_0x359c('0x4'));var BPromise=require(_0x359c('0x5'));var Mustache=require(_0x359c('0x6'));var util=require(_0x359c('0x7'));var path=require(_0x359c('0x8'));var sox=require(_0x359c('0x9'));var csv=require(_0x359c('0xa'));var ejs=require(_0x359c('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x359c('0xc'));var squel=require(_0x359c('0xd'));var crypto=require('crypto');var jsforce=require(_0x359c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x359c('0xa'));var querystring=require(_0x359c('0xf'));var Papa=require(_0x359c('0x10'));var Redis=require(_0x359c('0x11'));var authService=require(_0x359c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x359c('0x13'));var hardwareService=require(_0x359c('0x14'));var logger=require(_0x359c('0x15'))(_0x359c('0x16'));var utils=require(_0x359c('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x359c('0x18'));var db=require(_0x359c('0x19'))['db'];function respondWithStatusCode(_0x2a133b,_0x3da31d){_0x3da31d=_0x3da31d||0xcc;return function(_0xfdfde9){if(_0xfdfde9){return _0x2a133b[_0x359c('0x1a')](_0x3da31d);}return _0x2a133b['status'](_0x3da31d)['end']();};}function respondWithResult(_0x37043d,_0x230704){_0x230704=_0x230704||0xc8;return function(_0x557f30){if(_0x557f30){return _0x37043d[_0x359c('0x1b')](_0x230704)[_0x359c('0x1c')](_0x557f30);}};}function respondWithFilteredResult(_0x2b5304,_0x42d170){return function(_0x25cab5){if(_0x25cab5){var _0xb425c2=typeof _0x42d170[_0x359c('0x1d')]===_0x359c('0x1e')&&typeof _0x42d170['limit']===_0x359c('0x1e');var _0x1dd096=_0x25cab5[_0x359c('0x1f')];var _0x3b1941=_0xb425c2?0x0:_0x42d170[_0x359c('0x1d')];var _0x3b2d2c=_0xb425c2?_0x25cab5[_0x359c('0x1f')]:_0x42d170[_0x359c('0x1d')]+_0x42d170[_0x359c('0x20')];var _0x19ac3a;if(_0x3b2d2c>=_0x1dd096){_0x3b2d2c=_0x1dd096;_0x19ac3a=0xc8;}else{_0x19ac3a=0xce;}_0x2b5304[_0x359c('0x1b')](_0x19ac3a);return _0x2b5304[_0x359c('0x21')](_0x359c('0x22'),_0x3b1941+'-'+_0x3b2d2c+'/'+_0x1dd096)['json'](_0x25cab5);}return null;};}function patchUpdates(_0x3b0498){return function(_0x11b4f8){try{jsonpatch[_0x359c('0x23')](_0x11b4f8,_0x3b0498,!![]);}catch(_0x2e0709){return BPromise[_0x359c('0x24')](_0x2e0709);}return _0x11b4f8[_0x359c('0x25')]();};}function saveUpdates(_0x5deabe,_0x5d1f67){return function(_0x69a6a3){if(_0x69a6a3){return _0x69a6a3[_0x359c('0x26')](_0x5deabe)[_0x359c('0x27')](function(_0x2c418f){return _0x2c418f;});}return null;};}function removeEntity(_0x1f9495,_0x2f44aa){return function(_0x30c915){if(_0x30c915){return _0x30c915['destroy']()[_0x359c('0x27')](function(){var _0x28c309=_0x30c915['get']({'plain':!![]});var _0x468609=_0x359c('0x28');return db['UserProfileResource'][_0x359c('0x29')]({'where':{'type':_0x468609,'resourceId':_0x28c309['id']}})[_0x359c('0x27')](function(){return _0x30c915;});})[_0x359c('0x27')](function(){_0x1f9495[_0x359c('0x1b')](0xcc)[_0x359c('0x2a')]();});}};}function handleEntityNotFound(_0x48bd98,_0xd34b01){return function(_0x50b553){if(!_0x50b553){_0x48bd98[_0x359c('0x1a')](0x194);}return _0x50b553;};}function handleError(_0x1bbd44,_0x27555a){_0x27555a=_0x27555a||0x1f4;return function(_0x2bd771){logger[_0x359c('0x2b')](_0x2bd771['stack']);if(_0x2bd771['name']){delete _0x2bd771[_0x359c('0x2c')];}_0x1bbd44[_0x359c('0x1b')](_0x27555a)[_0x359c('0x2d')](_0x2bd771);};}exports[_0x359c('0x2e')]=function(_0x4ba5b2,_0x3a18d8){var _0x12511b={},_0x279bda={},_0x2a91dd={'count':0x0,'rows':[]};var _0xecc7df=_[_0x359c('0x2f')](db['VoiceMusicOnHold'][_0x359c('0x30')],function(_0x409181){return{'name':_0x409181['fieldName'],'type':_0x409181[_0x359c('0x31')]['key']};});_0x279bda[_0x359c('0x32')]=_[_0x359c('0x2f')](_0xecc7df,_0x359c('0x2c'));_0x279bda[_0x359c('0x33')]=_[_0x359c('0x34')](_0x4ba5b2['query']);_0x279bda[_0x359c('0x35')]=_[_0x359c('0x36')](_0x279bda[_0x359c('0x32')],_0x279bda[_0x359c('0x33')]);_0x12511b[_0x359c('0x37')]=_[_0x359c('0x36')](_0x279bda['model'],qs[_0x359c('0x38')](_0x4ba5b2['query']['fields']));_0x12511b[_0x359c('0x37')]=_0x12511b['attributes']['length']?_0x12511b[_0x359c('0x37')]:_0x279bda[_0x359c('0x32')];if(!_0x4ba5b2[_0x359c('0x33')][_0x359c('0x39')](_0x359c('0x3a'))){_0x12511b[_0x359c('0x20')]=qs[_0x359c('0x20')](_0x4ba5b2['query'][_0x359c('0x20')]);_0x12511b['offset']=qs[_0x359c('0x1d')](_0x4ba5b2['query'][_0x359c('0x1d')]);}_0x12511b['order']=qs[_0x359c('0x3b')](_0x4ba5b2[_0x359c('0x33')][_0x359c('0x3b')]);delete _0x4ba5b2[_0x359c('0x33')][_0x359c('0x3b')];_0x12511b[_0x359c('0x3c')]=qs[_0x359c('0x35')](_[_0x359c('0x3d')](_0x4ba5b2[_0x359c('0x33')],_0x279bda[_0x359c('0x35')]),_0xecc7df);if(_0x4ba5b2[_0x359c('0x33')][_0x359c('0x3e')]){_0x12511b[_0x359c('0x3c')]=_[_0x359c('0x3f')](_0x12511b['where'],{'$or':_[_0x359c('0x2f')](_0xecc7df,function(_0xc5bc0e){if(_0xc5bc0e[_0x359c('0x31')]!==_0x359c('0x40')){var _0x293182={};_0x293182[_0xc5bc0e['name']]={'$like':'%'+_0x4ba5b2['query'][_0x359c('0x3e')]+'%'};return _0x293182;}})});}_0x12511b=_[_0x359c('0x3f')]({},_0x12511b,_0x4ba5b2[_0x359c('0x41')]);var _0x56d288={'where':_0x12511b[_0x359c('0x3c')]};return db[_0x359c('0x42')][_0x359c('0x1f')](_0x56d288)[_0x359c('0x27')](function(_0x3d96a2){_0x2a91dd[_0x359c('0x1f')]=_0x3d96a2;if(_0x4ba5b2[_0x359c('0x33')][_0x359c('0x43')]){_0x12511b[_0x359c('0x44')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0x359c('0x45')](_0x12511b);})[_0x359c('0x27')](function(_0x555ab1){_0x2a91dd['rows']=_0x555ab1;return _0x2a91dd;})[_0x359c('0x27')](respondWithFilteredResult(_0x3a18d8,_0x12511b))[_0x359c('0x46')](handleError(_0x3a18d8,null));};exports[_0x359c('0x47')]=function(_0x1cc465,_0x5df842){var _0x1de627={'raw':![],'where':{'id':_0x1cc465[_0x359c('0x48')]['id']}},_0x3e1b18={};_0x3e1b18[_0x359c('0x32')]=_['keys'](db[_0x359c('0x42')][_0x359c('0x30')]);_0x3e1b18[_0x359c('0x33')]=_[_0x359c('0x34')](_0x1cc465[_0x359c('0x33')]);_0x3e1b18[_0x359c('0x35')]=_[_0x359c('0x36')](_0x3e1b18[_0x359c('0x32')],_0x3e1b18[_0x359c('0x33')]);_0x1de627[_0x359c('0x37')]=_[_0x359c('0x36')](_0x3e1b18[_0x359c('0x32')],qs[_0x359c('0x38')](_0x1cc465[_0x359c('0x33')][_0x359c('0x38')]));_0x1de627[_0x359c('0x37')]=_0x1de627['attributes'][_0x359c('0x49')]?_0x1de627[_0x359c('0x37')]:_0x3e1b18['model'];if(_0x1cc465[_0x359c('0x33')][_0x359c('0x43')]){_0x1de627[_0x359c('0x44')]=[{'all':!![]}];}_0x1de627=_[_0x359c('0x3f')]({},_0x1de627,_0x1cc465['options']);return db['VoiceMusicOnHold']['find'](_0x1de627)[_0x359c('0x27')](handleEntityNotFound(_0x5df842,null))['then'](respondWithResult(_0x5df842,null))[_0x359c('0x46')](handleError(_0x5df842,null));};exports['update']=function(_0x5e79ed,_0x5d2c14){if(_0x5e79ed[_0x359c('0x4a')]['id']){delete _0x5e79ed[_0x359c('0x4a')]['id'];}return db['VoiceMusicOnHold'][_0x359c('0x4b')]({'where':{'id':_0x5e79ed[_0x359c('0x48')]['id']}})[_0x359c('0x27')](handleEntityNotFound(_0x5d2c14,null))[_0x359c('0x27')](saveUpdates(_0x5e79ed[_0x359c('0x4a')],null))[_0x359c('0x27')](respondWithResult(_0x5d2c14,null))[_0x359c('0x46')](handleError(_0x5d2c14,null));};exports[_0x359c('0x4c')]=function(_0x208e28,_0x10d334,_0x5dcaf5){return db['sequelize']['transaction'](function(_0x51bd51){if(_0x208e28[_0x359c('0x4a')]['mode']==='files'){_0x208e28['body'][_0x359c('0x4d')]=path[_0x359c('0x4e')](config[_0x359c('0x4f')],_0x359c('0x50'),_0x208e28[_0x359c('0x4a')][_0x359c('0x2c')]);}return db[_0x359c('0x42')][_0x359c('0x4c')](_0x208e28[_0x359c('0x4a')],{'transaction':_0x51bd51})[_0x359c('0x27')](function(_0x35b9a7){if(_0x208e28['body'][_0x359c('0x51')]===_0x359c('0x52')){fs[_0x359c('0x53')](_0x35b9a7['directory'],parseInt('0777',0x8));}var _0x8a4005=_0x208e28['user'][_0x359c('0x54')]({'plain':!![]});if(!_0x8a4005)throw new Error(_0x359c('0x55'));if(_0x8a4005['role']==='user'){var _0x2859c1=_0x35b9a7[_0x359c('0x54')]({'plain':!![]});return db[_0x359c('0x56')][_0x359c('0x4b')]({'where':{'name':_0x359c('0x28'),'userProfileId':_0x8a4005['userProfileId']},'raw':!![]})['then'](function(_0x2b3120){if(_0x2b3120&&_0x2b3120[_0x359c('0x57')]===0x0){return db[_0x359c('0x58')][_0x359c('0x4c')]({'name':_0x2859c1['name'],'resourceId':_0x2859c1['id'],'type':_0x2b3120['name'],'sectionId':_0x2b3120['id']},{})['then'](function(){return _0x35b9a7;});}else{return _0x35b9a7;}})['catch'](function(_0x5e401c){logger[_0x359c('0x2b')](_0x359c('0x59'),_0x5e401c);});}return _0x35b9a7;});})[_0x359c('0x27')](respondWithResult(_0x10d334,0xc9))[_0x359c('0x46')](handleError(_0x10d334,null));};exports[_0x359c('0x29')]=function(_0x31510c,_0x5e8c8f,_0x26d94d){var _0x20efdc;return db['VoiceMusicOnHold'][_0x359c('0x4b')]({'where':{'id':_0x31510c[_0x359c('0x48')]['id']}})['then'](function(_0x531e5e){if(_0x531e5e){return db[_0x359c('0x5a')][_0x359c('0x5b')](function(_0x44f99a){return _0x531e5e[_0x359c('0x29')]({'transaction':_0x44f99a,'raw':!![]})[_0x359c('0x27')](function(_0x5af2ff){if(_0x5af2ff[_0x359c('0x4d')]){fs[_0x359c('0x5c')](_0x5af2ff[_0x359c('0x4d')])[_0x359c('0x5d')](function(_0x164b2c){fs[_0x359c('0x5e')](path['join'](_0x5af2ff[_0x359c('0x4d')],_0x164b2c));});fs['rmdirSync'](_0x5af2ff[_0x359c('0x4d')]);}return _0x5af2ff;});})[_0x359c('0x46')](function(_0x30b37e){throw new db[(_0x359c('0x5f'))][(_0x359c('0x60'))](_0x30b37e[_0x359c('0x61')]);});}})['then'](handleEntityNotFound(_0x5e8c8f,null))[_0x359c('0x27')](removeEntity(_0x5e8c8f,null))[_0x359c('0x46')](handleError(_0x5e8c8f,null));};exports[_0x359c('0x62')]=function(_0x4da8f6,_0x487ed8,_0x5ecd62){return db['sequelize'][_0x359c('0x5b')](function(_0x2b2365){var _0x46677c;return db[_0x359c('0x42')]['find']({'where':{'id':_0x4da8f6[_0x359c('0x48')]['id']}})[_0x359c('0x27')](function(_0x3cce06){if(_0x3cce06){_0x46677c=_0x3cce06;return _0x3cce06[_0x359c('0x62')](_0x4da8f6[_0x359c('0x4a')]['id'],{'transaction':_0x2b2365});}})[_0x359c('0x27')](function(_0xc69839){if(_0xc69839){return db[_0x359c('0x63')][_0x359c('0x64')]({'where':{'id':_0x4da8f6[_0x359c('0x4a')]['id']},'attributes':['id','name',_0x359c('0x65'),_0x359c('0x66'),'createdAt'],'raw':!![]});}})[_0x359c('0x27')](function(_0x1e1b06){if(_0x1e1b06){var _0x11ca09=path['join'](config[_0x359c('0x4f')],_0x359c('0x67'),util[_0x359c('0x68')](_0x359c('0x69'),path[_0x359c('0x6a')](_0x1e1b06['save_name'],path[_0x359c('0x6b')](_0x1e1b06['save_name'])),_0x1e1b06[_0x359c('0x66')]));var _0x1e31d4=path[_0x359c('0x4e')](config[_0x359c('0x4f')],_0x359c('0x50'),_0x46677c['name'],util[_0x359c('0x68')](_0x359c('0x69'),_0x1e1b06[_0x359c('0x2c')],_0x1e1b06[_0x359c('0x66')]));fs[_0x359c('0x6c')](_0x11ca09,_0x1e31d4);return _0x1e1b06;}})[_0x359c('0x46')](function(_0x487652){throw new db[(_0x359c('0x5f'))][(_0x359c('0x60'))](_0x487652[_0x359c('0x61')]);});})[_0x359c('0x27')](handleEntityNotFound(_0x487ed8,null))[_0x359c('0x27')](respondWithResult(_0x487ed8,0xc9))[_0x359c('0x46')](handleError(_0x487ed8,null));};exports[_0x359c('0x6d')]=function(_0x1ef473,_0x10d65a,_0x50c2fd){return db['sequelize'][_0x359c('0x5b')](function(_0x435439){var _0x57064e;return db['VoiceMusicOnHold'][_0x359c('0x64')]({'where':{'id':_0x1ef473[_0x359c('0x48')]['id']}})[_0x359c('0x27')](handleEntityNotFound(_0x10d65a,null))[_0x359c('0x27')](function(_0x583657){if(_0x583657){_0x57064e=_0x583657;return _0x583657[_0x359c('0x6d')](_0x1ef473[_0x359c('0x48')][_0x359c('0x6e')]);}})[_0x359c('0x27')](function(_0x1cdce0){if(_0x1cdce0){return db[_0x359c('0x63')]['findOne']({'where':{'id':_0x1ef473['params'][_0x359c('0x6e')]},'attributes':['id','name',_0x359c('0x65'),'converted_format',_0x359c('0x6f')],'raw':!![]});}})[_0x359c('0x27')](function(_0xeb51d5){if(_0xeb51d5){fs[_0x359c('0x5e')](path['join'](_0x57064e['directory'],util[_0x359c('0x68')](_0x359c('0x69'),_0xeb51d5[_0x359c('0x2c')],_0xeb51d5[_0x359c('0x66')])));return _0xeb51d5;}})[_0x359c('0x46')](function(_0xe51f34){throw new db[(_0x359c('0x5f'))]['ValidationError'](_0xe51f34[_0x359c('0x61')]);});})['then'](handleEntityNotFound(_0x10d65a,null))[_0x359c('0x27')](respondWithStatusCode(_0x10d65a,0xcc))[_0x359c('0x46')](handleError(_0x10d65a,null));};exports[_0x359c('0x70')]=function(_0x25179c,_0x5d4163,_0x4d4d70){var _0x27ad39={};var _0x35f38f={};var _0x356028;var _0x5b1f61;return db['VoiceMusicOnHold'][_0x359c('0x64')]({'where':{'id':_0x25179c[_0x359c('0x48')]['id']}})[_0x359c('0x27')](handleEntityNotFound(_0x5d4163,null))['then'](function(_0x1ed2d6){if(_0x1ed2d6){_0x356028=_0x1ed2d6;_0x35f38f[_0x359c('0x32')]=_[_0x359c('0x34')](db[_0x359c('0x63')]['rawAttributes']);_0x35f38f[_0x359c('0x33')]=_[_0x359c('0x34')](_0x25179c[_0x359c('0x33')]);_0x35f38f[_0x359c('0x35')]=_['intersection'](_0x35f38f['model'],_0x35f38f[_0x359c('0x33')]);_0x27ad39[_0x359c('0x37')]=_[_0x359c('0x36')](_0x35f38f['model'],qs[_0x359c('0x38')](_0x25179c[_0x359c('0x33')][_0x359c('0x38')]));_0x27ad39[_0x359c('0x37')]=_0x27ad39[_0x359c('0x37')]['length']?_0x27ad39[_0x359c('0x37')]:_0x35f38f[_0x359c('0x32')];_0x27ad39['order']=qs['sort'](_0x25179c[_0x359c('0x33')][_0x359c('0x3b')]);_0x27ad39[_0x359c('0x3c')]=qs[_0x359c('0x35')](_[_0x359c('0x3d')](_0x25179c[_0x359c('0x33')],_0x35f38f[_0x359c('0x35')]));if(_0x25179c[_0x359c('0x33')][_0x359c('0x3e')]){_0x27ad39['where']=_[_0x359c('0x3f')](_0x27ad39[_0x359c('0x3c')],{'$or':_['map'](_0x27ad39[_0x359c('0x37')],function(_0x54d7e7){var _0x4b36a1={};_0x4b36a1[_0x54d7e7]={'$like':'%'+_0x25179c[_0x359c('0x33')]['filter']+'%'};return _0x4b36a1;})});}_0x27ad39=_[_0x359c('0x3f')]({},_0x27ad39,_0x25179c[_0x359c('0x41')]);return _0x356028['getSounds'](_0x27ad39);}})[_0x359c('0x27')](function(_0x2e0bd6){if(_0x2e0bd6){_0x5b1f61=_0x2e0bd6[_0x359c('0x49')];if(!_0x25179c[_0x359c('0x33')][_0x359c('0x39')](_0x359c('0x3a'))){_0x27ad39[_0x359c('0x20')]=qs[_0x359c('0x20')](_0x25179c[_0x359c('0x33')][_0x359c('0x20')]);_0x27ad39[_0x359c('0x1d')]=qs[_0x359c('0x1d')](_0x25179c[_0x359c('0x33')][_0x359c('0x1d')]);}return _0x356028[_0x359c('0x70')](_0x27ad39);}})[_0x359c('0x27')](function(_0x4d1e8f){if(_0x4d1e8f){return _0x4d1e8f?{'count':_0x5b1f61,'rows':_0x4d1e8f}:null;}})[_0x359c('0x27')](respondWithResult(_0x5d4163,null))[_0x359c('0x46')](handleError(_0x5d4163,null));};
\ No newline at end of file
index b7c2a9d..5416c73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xddf9=['path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','lodash','../../config/logger','bluebird','request-promise'];(function(_0x2e50a2,_0x27f31e){var _0x47e5de=function(_0x4e1f70){while(--_0x4e1f70){_0x2e50a2['push'](_0x2e50a2['shift']());}};_0x47e5de(++_0x27f31e);}(_0xddf9,0x1c4));var _0x9ddf=function(_0x25ca44,_0x111633){_0x25ca44=_0x25ca44-0x0;var _0x4897c1=_0xddf9[_0x25ca44];return _0x4897c1;};'use strict';var _=require(_0x9ddf('0x0'));var util=require('util');var logger=require(_0x9ddf('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9ddf('0x2'));var rp=require(_0x9ddf('0x3'));var fs=require('fs');var path=require(_0x9ddf('0x4'));var rimraf=require(_0x9ddf('0x5'));var config=require(_0x9ddf('0x6'));var attributes=require(_0x9ddf('0x7'));module[_0x9ddf('0x8')]=function(_0x128609,_0x5f39bb){return _0x128609[_0x9ddf('0x9')](_0x9ddf('0xa'),attributes,{'tableName':_0x9ddf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0462=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','lodash','util'];(function(_0x49258d,_0x5bcf0e){var _0x2a9044=function(_0x1a629e){while(--_0x1a629e){_0x49258d['push'](_0x49258d['shift']());}};_0x2a9044(++_0x5bcf0e);}(_0x0462,0x11c));var _0x2046=function(_0x278dd,_0x355c5b){_0x278dd=_0x278dd-0x0;var _0x47266b=_0x0462[_0x278dd];return _0x47266b;};'use strict';var _=require(_0x2046('0x0'));var util=require(_0x2046('0x1'));var logger=require(_0x2046('0x2'))(_0x2046('0x3'));var moment=require('moment');var BPromise=require(_0x2046('0x4'));var rp=require(_0x2046('0x5'));var fs=require('fs');var path=require(_0x2046('0x6'));var rimraf=require(_0x2046('0x7'));var config=require(_0x2046('0x8'));var attributes=require(_0x2046('0x9'));module[_0x2046('0xa')]=function(_0x3dbfdc,_0x17b58d){return _0x3dbfdc[_0x2046('0xb')](_0x2046('0xc'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b31c473..7695c05 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x2c346b,_0xc1d5c0){var _0x4c1834=function(_0x230901){while(--_0x230901){_0x2c346b['push'](_0x2c346b['shift']());}};_0x4c1834(++_0xc1d5c0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x53b8e0,_0x55d46e){_0x53b8e0=_0x53b8e0-0x0;var _0x10630c=_0xcb91[_0x53b8e0];return _0x10630c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});}
\ 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','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x5ac373,_0x3f1e6a){var _0x1079be=function(_0x4e2feb){while(--_0x4e2feb){_0x5ac373['push'](_0x5ac373['shift']());}};_0x1079be(++_0x3f1e6a);}(_0x34e8,0x12c));var _0x834e=function(_0x1dbabc,_0x441a38){_0x1dbabc=_0x1dbabc-0x0;var _0x146bc4=_0x34e8[_0x1dbabc];return _0x146bc4;};'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')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});}
\ No newline at end of file
index 7cca80c..a01b630 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdcab=['index','/describe','show','/:id/users','getAgents','/:id/teams','post','create','/:id','update','delete','removeAgents','removeTeams','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated'];(function(_0x59eeaf,_0x56e107){var _0x119d61=function(_0xad3379){while(--_0xad3379){_0x59eeaf['push'](_0x59eeaf['shift']());}};_0x119d61(++_0x56e107);}(_0xdcab,0x1e9));var _0xbdca=function(_0x2296cf,_0x539e44){_0x2296cf=_0x2296cf-0x0;var _0x4e17f7=_0xdcab[_0x2296cf];return _0x4e17f7;};'use strict';var multer=require(_0xbdca('0x0'));var util=require(_0xbdca('0x1'));var path=require(_0xbdca('0x2'));var timeout=require(_0xbdca('0x3'));var express=require(_0xbdca('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xbdca('0x5'));var interaction=require(_0xbdca('0x6'));var config=require(_0xbdca('0x7'));var controller=require(_0xbdca('0x8'));router[_0xbdca('0x9')]('/',auth[_0xbdca('0xa')](),controller[_0xbdca('0xb')]);router[_0xbdca('0x9')](_0xbdca('0xc'),auth[_0xbdca('0xa')](),controller['describe']);router[_0xbdca('0x9')]('/:id',auth[_0xbdca('0xa')](),controller[_0xbdca('0xd')]);router[_0xbdca('0x9')](_0xbdca('0xe'),auth[_0xbdca('0xa')](),controller[_0xbdca('0xf')]);router[_0xbdca('0x9')](_0xbdca('0x10'),auth[_0xbdca('0xa')](),controller['getTeams']);router[_0xbdca('0x11')]('/',auth[_0xbdca('0xa')](),controller[_0xbdca('0x12')]);router[_0xbdca('0x11')]('/:id/users',auth[_0xbdca('0xa')](),controller['addAgents']);router[_0xbdca('0x11')](_0xbdca('0x10'),auth[_0xbdca('0xa')](),controller['addTeams']);router['put'](_0xbdca('0x13'),auth[_0xbdca('0xa')](),controller[_0xbdca('0x14')]);router[_0xbdca('0x15')](_0xbdca('0x13'),auth[_0xbdca('0xa')](),controller['destroy']);router[_0xbdca('0x15')](_0xbdca('0xe'),auth[_0xbdca('0xa')](),controller[_0xbdca('0x16')]);router['delete'](_0xbdca('0x10'),auth[_0xbdca('0xa')](),controller[_0xbdca('0x17')]);module[_0xbdca('0x18')]=router;
\ No newline at end of file
+var _0x6d4f=['/describe','describe','isAuthenticated','show','/:id/users','getTeams','create','post','addAgents','/:id/teams','addTeams','put','/:id','update','delete','destroy','removeAgents','removeTeams','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get'];(function(_0x13519f,_0x184f0a){var _0xd8dbdd=function(_0x5c3d61){while(--_0x5c3d61){_0x13519f['push'](_0x13519f['shift']());}};_0xd8dbdd(++_0x184f0a);}(_0x6d4f,0x121));var _0xf6d4=function(_0x5712cc,_0x5db7dd){_0x5712cc=_0x5712cc-0x0;var _0x15561a=_0x6d4f[_0x5712cc];return _0x15561a;};'use strict';var multer=require(_0xf6d4('0x0'));var util=require(_0xf6d4('0x1'));var path=require(_0xf6d4('0x2'));var timeout=require(_0xf6d4('0x3'));var express=require(_0xf6d4('0x4'));var router=express[_0xf6d4('0x5')]();var fs_extra=require(_0xf6d4('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf6d4('0x7'));var config=require(_0xf6d4('0x8'));var controller=require(_0xf6d4('0x9'));router[_0xf6d4('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf6d4('0xa')](_0xf6d4('0xb'),auth['isAuthenticated'](),controller[_0xf6d4('0xc')]);router['get']('/:id',auth[_0xf6d4('0xd')](),controller[_0xf6d4('0xe')]);router[_0xf6d4('0xa')](_0xf6d4('0xf'),auth[_0xf6d4('0xd')](),controller['getAgents']);router[_0xf6d4('0xa')]('/:id/teams',auth[_0xf6d4('0xd')](),controller[_0xf6d4('0x10')]);router['post']('/',auth[_0xf6d4('0xd')](),controller[_0xf6d4('0x11')]);router[_0xf6d4('0x12')](_0xf6d4('0xf'),auth[_0xf6d4('0xd')](),controller[_0xf6d4('0x13')]);router[_0xf6d4('0x12')](_0xf6d4('0x14'),auth[_0xf6d4('0xd')](),controller[_0xf6d4('0x15')]);router[_0xf6d4('0x16')](_0xf6d4('0x17'),auth[_0xf6d4('0xd')](),controller[_0xf6d4('0x18')]);router[_0xf6d4('0x19')](_0xf6d4('0x17'),auth[_0xf6d4('0xd')](),controller[_0xf6d4('0x1a')]);router[_0xf6d4('0x19')](_0xf6d4('0xf'),auth['isAuthenticated'](),controller[_0xf6d4('0x1b')]);router[_0xf6d4('0x19')](_0xf6d4('0x14'),auth[_0xf6d4('0xd')](),controller[_0xf6d4('0x1c')]);module[_0xf6d4('0x1d')]=router;
\ No newline at end of file
index 5aa6694..d5cb41d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f48=['exports','STRING','VIRTUAL','system-','getDataValue','name','INTEGER','sequelize'];(function(_0x3c8036,_0x5de805){var _0x3c4ddb=function(_0x304d4e){while(--_0x304d4e){_0x3c8036['push'](_0x3c8036['shift']());}};_0x3c4ddb(++_0x5de805);}(_0x2f48,0x1ef));var _0x82f4=function(_0x2a7bae,_0x3b47d5){_0x2a7bae=_0x2a7bae-0x0;var _0x24504e=_0x2f48[_0x2a7bae];return _0x24504e;};'use strict';var Sequelize=require(_0x82f4('0x0'));module[_0x82f4('0x1')]={'name':{'type':Sequelize[_0x82f4('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x82f4('0x3')],'get':function(_0x1393a7){return _0x82f4('0x4')+this[_0x82f4('0x5')](_0x82f4('0x6'))+'-';}},'description':{'type':Sequelize[_0x82f4('0x2')]},'callerIdAll':{'type':Sequelize[_0x82f4('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x82f4('0x7')]}};
\ No newline at end of file
+var _0x1d63=['VIRTUAL','system-','sequelize','exports','STRING','name'];(function(_0x30cfdc,_0x5a0260){var _0x54e0ac=function(_0x5497d3){while(--_0x5497d3){_0x30cfdc['push'](_0x30cfdc['shift']());}};_0x54e0ac(++_0x5a0260);}(_0x1d63,0x182));var _0x31d6=function(_0x3de44a,_0x123138){_0x3de44a=_0x3de44a-0x0;var _0x4bd2c1=_0x1d63[_0x3de44a];return _0x4bd2c1;};'use strict';var Sequelize=require(_0x31d6('0x0'));module[_0x31d6('0x1')]={'name':{'type':Sequelize[_0x31d6('0x2')],'allowNull':![],'unique':_0x31d6('0x3')},'prefix':{'type':Sequelize[_0x31d6('0x4')],'get':function(_0x495968){return _0x31d6('0x5')+this['getDataValue'](_0x31d6('0x3'))+'-';}},'description':{'type':Sequelize[_0x31d6('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
index 69c5e5f..9d217c8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fc2=['set','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','VoicePrefix','include','findAll','rows','catch','show','params','length','find','describe','sequelize','transaction','create','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','from-sip','exten','system','description','Voice\x20Prefix\x20Extension','priority','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','No\x20callerid\x20available','goto','context','charAt','body','findById','addAgents','omit','spread','ids','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','nolimit','getTeams','Team','addTeams','Agents','online','voicePause','interface','findOrCreate','forEach','removeTeams','User','select','field','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','end','status','json','offset','undefined','count'];(function(_0x17176e,_0x4000ad){var _0x42bf4b=function(_0x32dadb){while(--_0x32dadb){_0x17176e['push'](_0x17176e['shift']());}};_0x42bf4b(++_0x4000ad);}(_0x4fc2,0x111));var _0x24fc=function(_0x594de,_0x44f5fa){_0x594de=_0x594de-0x0;var _0x28dbf5=_0x4fc2[_0x594de];return _0x28dbf5;};'use strict';var emlformat=require(_0x24fc('0x0'));var rimraf=require(_0x24fc('0x1'));var zipdir=require(_0x24fc('0x2'));var jsonpatch=require(_0x24fc('0x3'));var rp=require('request-promise');var moment=require(_0x24fc('0x4'));var BPromise=require(_0x24fc('0x5'));var Mustache=require(_0x24fc('0x6'));var util=require('util');var path=require(_0x24fc('0x7'));var sox=require(_0x24fc('0x8'));var csv=require('to-csv');var ejs=require(_0x24fc('0x9'));var fs=require('fs');var fs_extra=require(_0x24fc('0xa'));var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0xf'));var querystring=require(_0x24fc('0x10'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x11'));var authService=require(_0x24fc('0x12'));var qs=require(_0x24fc('0x13'));var as=require(_0x24fc('0x14'));var hardwareService=require(_0x24fc('0x15'));var logger=require(_0x24fc('0x16'))(_0x24fc('0x17'));var utils=require(_0x24fc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x24fc('0x19'));var db=require(_0x24fc('0x1a'))['db'];config['redis']=_[_0x24fc('0x1b')](config[_0x24fc('0x1c')],{'host':_0x24fc('0x1d'),'port':0x18eb});var socket=require(_0x24fc('0x1e'))(new Redis(config[_0x24fc('0x1c')]));require(_0x24fc('0x1f'))['register'](socket);function respondWithStatusCode(_0x2a0971,_0x18c0a7){_0x18c0a7=_0x18c0a7||0xcc;return function(_0x2ffed3){if(_0x2ffed3){return _0x2a0971[_0x24fc('0x20')](_0x18c0a7);}return _0x2a0971['status'](_0x18c0a7)[_0x24fc('0x21')]();};}function respondWithResult(_0x588543,_0x4af098){_0x4af098=_0x4af098||0xc8;return function(_0x3385c7){if(_0x3385c7){return _0x588543[_0x24fc('0x22')](_0x4af098)[_0x24fc('0x23')](_0x3385c7);}};}function respondWithFilteredResult(_0x25cb40,_0x52a884){return function(_0x23873c){if(_0x23873c){var _0x1cb3d0=typeof _0x52a884[_0x24fc('0x24')]===_0x24fc('0x25')&&typeof _0x52a884['limit']===_0x24fc('0x25');var _0x4073e0=_0x23873c[_0x24fc('0x26')];var _0x5b0516=_0x1cb3d0?0x0:_0x52a884[_0x24fc('0x24')];var _0x36a771=_0x1cb3d0?_0x23873c[_0x24fc('0x26')]:_0x52a884[_0x24fc('0x24')]+_0x52a884['limit'];var _0x323beb;if(_0x36a771>=_0x4073e0){_0x36a771=_0x4073e0;_0x323beb=0xc8;}else{_0x323beb=0xce;}_0x25cb40['status'](_0x323beb);return _0x25cb40[_0x24fc('0x27')]('Content-Range',_0x5b0516+'-'+_0x36a771+'/'+_0x4073e0)[_0x24fc('0x23')](_0x23873c);}return null;};}function patchUpdates(_0x44c121){return function(_0x2ffade){try{jsonpatch['apply'](_0x2ffade,_0x44c121,!![]);}catch(_0x313a25){return BPromise['reject'](_0x313a25);}return _0x2ffade[_0x24fc('0x28')]();};}function saveUpdates(_0x2bb93a,_0x36a9b4){return function(_0x34b5b2){if(_0x34b5b2){return _0x34b5b2[_0x24fc('0x29')](_0x2bb93a)[_0x24fc('0x2a')](function(_0x3f0875){return _0x3f0875;});}return null;};}function removeEntity(_0x20192b,_0x168d98){return function(_0x2a5c4b){if(_0x2a5c4b){return _0x2a5c4b['destroy']()[_0x24fc('0x2a')](function(){var _0x16f27f=_0x2a5c4b[_0x24fc('0x2b')]({'plain':!![]});var _0x5bb4c8=_0x24fc('0x2c');return db[_0x24fc('0x2d')][_0x24fc('0x2e')]({'where':{'type':_0x5bb4c8,'resourceId':_0x16f27f['id']}})[_0x24fc('0x2a')](function(){return _0x2a5c4b;});})[_0x24fc('0x2a')](function(){_0x20192b[_0x24fc('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x240ae7,_0x29a461){return function(_0x3c99ed){if(!_0x3c99ed){_0x240ae7[_0x24fc('0x20')](0x194);}return _0x3c99ed;};}function handleError(_0x9f7bbc,_0x490aa5){_0x490aa5=_0x490aa5||0x1f4;return function(_0x55c27f){logger['error'](_0x55c27f[_0x24fc('0x2f')]);if(_0x55c27f['name']){delete _0x55c27f[_0x24fc('0x30')];}_0x9f7bbc[_0x24fc('0x22')](_0x490aa5)[_0x24fc('0x31')](_0x55c27f);};}exports[_0x24fc('0x32')]=function(_0x4dbd52,_0x66eec0){var _0x33f368={},_0x523c1f={},_0xf46cd5={'count':0x0,'rows':[]};var _0x1b174d=_['map'](db['VoicePrefix'][_0x24fc('0x33')],function(_0x56eae7){return{'name':_0x56eae7[_0x24fc('0x34')],'type':_0x56eae7[_0x24fc('0x35')]['key']};});_0x523c1f[_0x24fc('0x36')]=_[_0x24fc('0x37')](_0x1b174d,_0x24fc('0x30'));_0x523c1f[_0x24fc('0x38')]=_[_0x24fc('0x39')](_0x4dbd52[_0x24fc('0x38')]);_0x523c1f[_0x24fc('0x3a')]=_[_0x24fc('0x3b')](_0x523c1f[_0x24fc('0x36')],_0x523c1f['query']);_0x33f368[_0x24fc('0x3c')]=_[_0x24fc('0x3b')](_0x523c1f[_0x24fc('0x36')],qs[_0x24fc('0x3d')](_0x4dbd52[_0x24fc('0x38')]['fields']));_0x33f368['attributes']=_0x33f368[_0x24fc('0x3c')]['length']?_0x33f368[_0x24fc('0x3c')]:_0x523c1f[_0x24fc('0x36')];if(!_0x4dbd52[_0x24fc('0x38')][_0x24fc('0x3e')]('nolimit')){_0x33f368[_0x24fc('0x3f')]=qs['limit'](_0x4dbd52[_0x24fc('0x38')][_0x24fc('0x3f')]);_0x33f368[_0x24fc('0x24')]=qs[_0x24fc('0x24')](_0x4dbd52[_0x24fc('0x38')]['offset']);}_0x33f368[_0x24fc('0x40')]=qs[_0x24fc('0x41')](_0x4dbd52[_0x24fc('0x38')][_0x24fc('0x41')]);_0x33f368['where']=qs[_0x24fc('0x3a')](_[_0x24fc('0x42')](_0x4dbd52['query'],_0x523c1f[_0x24fc('0x3a')]),_0x1b174d);if(_0x4dbd52['query'][_0x24fc('0x43')]){_0x33f368[_0x24fc('0x44')]=_[_0x24fc('0x45')](_0x33f368[_0x24fc('0x44')],{'$or':_[_0x24fc('0x37')](_0x1b174d,function(_0x278b18){if(_0x278b18[_0x24fc('0x35')]!==_0x24fc('0x46')){var _0x4a18bb={};_0x4a18bb[_0x278b18[_0x24fc('0x30')]]={'$like':'%'+_0x4dbd52[_0x24fc('0x38')][_0x24fc('0x43')]+'%'};return _0x4a18bb;}})});}_0x33f368=_['merge']({},_0x33f368,_0x4dbd52[_0x24fc('0x47')]);var _0x1e3b52={'where':_0x33f368['where']};return db[_0x24fc('0x48')][_0x24fc('0x26')](_0x1e3b52)[_0x24fc('0x2a')](function(_0x5e4e9b){_0xf46cd5[_0x24fc('0x26')]=_0x5e4e9b;if(_0x4dbd52[_0x24fc('0x38')]['includeAll']){_0x33f368[_0x24fc('0x49')]=[{'all':!![]}];}return db[_0x24fc('0x48')][_0x24fc('0x4a')](_0x33f368);})[_0x24fc('0x2a')](function(_0x4c8dad){_0xf46cd5[_0x24fc('0x4b')]=_0x4c8dad;return _0xf46cd5;})[_0x24fc('0x2a')](respondWithFilteredResult(_0x66eec0,_0x33f368))[_0x24fc('0x4c')](handleError(_0x66eec0,null));};exports[_0x24fc('0x4d')]=function(_0xbcbcfa,_0x58a950){var _0x2a27e6={'raw':![],'where':{'id':_0xbcbcfa[_0x24fc('0x4e')]['id']}},_0x1b9c90={};_0x1b9c90[_0x24fc('0x36')]=_['keys'](db[_0x24fc('0x48')][_0x24fc('0x33')]);_0x1b9c90['query']=_['keys'](_0xbcbcfa[_0x24fc('0x38')]);_0x1b9c90['filters']=_['intersection'](_0x1b9c90[_0x24fc('0x36')],_0x1b9c90['query']);_0x2a27e6[_0x24fc('0x3c')]=_[_0x24fc('0x3b')](_0x1b9c90[_0x24fc('0x36')],qs['fields'](_0xbcbcfa[_0x24fc('0x38')][_0x24fc('0x3d')]));_0x2a27e6[_0x24fc('0x3c')]=_0x2a27e6[_0x24fc('0x3c')][_0x24fc('0x4f')]?_0x2a27e6[_0x24fc('0x3c')]:_0x1b9c90[_0x24fc('0x36')];if(_0xbcbcfa[_0x24fc('0x38')]['includeAll']){_0x2a27e6['include']=[{'all':!![]}];}_0x2a27e6=_[_0x24fc('0x45')]({},_0x2a27e6,_0xbcbcfa[_0x24fc('0x47')]);return db[_0x24fc('0x48')]['find'](_0x2a27e6)['then'](handleEntityNotFound(_0x58a950,null))[_0x24fc('0x2a')](respondWithResult(_0x58a950,null))[_0x24fc('0x4c')](handleError(_0x58a950,null));};exports[_0x24fc('0x2e')]=function(_0x134f64,_0x21f8b8){return db[_0x24fc('0x48')][_0x24fc('0x50')]({'where':{'id':_0x134f64[_0x24fc('0x4e')]['id']}})[_0x24fc('0x2a')](handleEntityNotFound(_0x21f8b8,null))[_0x24fc('0x2a')](removeEntity(_0x21f8b8,null))[_0x24fc('0x4c')](handleError(_0x21f8b8,null));};exports[_0x24fc('0x51')]=function(_0x5ec1c0,_0x1c9a28){return db[_0x24fc('0x48')][_0x24fc('0x51')]()[_0x24fc('0x2a')](respondWithResult(_0x1c9a28,null))[_0x24fc('0x4c')](handleError(_0x1c9a28,null));};exports['create']=function(_0x428012,_0x4bf3a8){var _0x2c8f74;return db[_0x24fc('0x52')][_0x24fc('0x53')](function(_0x41ddfb){return db[_0x24fc('0x48')][_0x24fc('0x54')](_0x428012['body'],{'transaction':_0x41ddfb})[_0x24fc('0x2a')](function(_0xc2ba88){_0x2c8f74=_0xc2ba88[_0x24fc('0x2b')]({'plain':!![]});return db[_0x24fc('0x55')][_0x24fc('0x50')]({'where':{'id':_0x2c8f74[_0x24fc('0x56')]},'raw':!![]})['then'](function(_0x36d500){return createVoicePrefixExtensions(_0x2c8f74,_0x36d500,_0x41ddfb);});});})[_0x24fc('0x2a')](function(){var _0x1628b4=_0x428012[_0x24fc('0x57')][_0x24fc('0x2b')]({'plain':!![]});if(!_0x1628b4)throw new Error(_0x24fc('0x58'));if(_0x1628b4[_0x24fc('0x59')]==='user'){var _0xd673f8=_0x2c8f74;return db[_0x24fc('0x5a')]['find']({'where':{'name':_0x24fc('0x2c'),'userProfileId':_0x1628b4[_0x24fc('0x5b')]},'raw':!![]})[_0x24fc('0x2a')](function(_0x2ba959){if(_0x2ba959&&_0x2ba959[_0x24fc('0x5c')]===0x0){return db[_0x24fc('0x2d')]['create']({'name':_0xd673f8[_0x24fc('0x30')],'resourceId':_0xd673f8['id'],'type':_0x2ba959['name'],'sectionId':_0x2ba959['id']},{})[_0x24fc('0x2a')](function(){return _0x2c8f74;});}else{return _0x2c8f74;}})[_0x24fc('0x4c')](function(_0x50e5b0){logger[_0x24fc('0x5d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x50e5b0);throw _0x50e5b0;});}return _0x2c8f74;})[_0x24fc('0x2a')](respondWithResult(_0x4bf3a8,null))['catch'](handleError(_0x4bf3a8,null));};function Extension(_0xdff811,_0x27b612,_0x57daaf,_0x2edef7){this['context']=_0x24fc('0x5e');this[_0x24fc('0x5f')]=_0xdff811;this['app']=_0x57daaf;this[_0x24fc('0x35')]=_0x24fc('0x60');this[_0x24fc('0x61')]=_0x24fc('0x62');this[_0x24fc('0x63')]=_0x27b612;this['appdata']=_0x2edef7;}function createVoicePrefixExtensions(_0x39da59,_0x2f62b0,_0x2d657a){return new BPromise(function(_0x2b5dca,_0x11d0e0){var _0x5e9c03=new Extension(formatPrefixName(_0x39da59['prefix']),0x1,_0x24fc('0x64'),_0x24fc('0x65'));_0x5e9c03['VoicePrefixId']=_0x39da59['id'];return db['VoiceExtension'][_0x24fc('0x54')](_0x5e9c03,{'transaction':_0x2d657a})[_0x24fc('0x2a')](function(_0x28ef6a){var _0x1c47cd=_0x28ef6a['get']({'plain':!![]});var _0x20973d=_[_0x24fc('0x37')](addVoicePrefixExtensions(_0x39da59,_0x2f62b0),function(_0x14427b){_0x14427b[_0x24fc('0x56')]=_0x1c47cd['id'];_0x14427b[_0x24fc('0x66')]=_0x39da59['id'];return _0x14427b;});return db[_0x24fc('0x55')][_0x24fc('0x67')](_0x20973d,{'transaction':_0x2d657a})[_0x24fc('0x2a')](function(_0xbe136e){if(!_0xbe136e){return _0x11d0e0(_0x24fc('0x68'));}else{return _0x2b5dca(_0xbe136e);}})[_0x24fc('0x4c')](function(_0x456690){return _0x11d0e0(_0x456690);});});;});};function addVoicePrefixExtensions(_0x8dbb4a,_0x24ca4b){var _0x354fc6=[];var _0x54ead5=formatPrefixName(_0x8dbb4a[_0x24fc('0x69')]);_0x354fc6[_0x24fc('0x6a')](new Extension(_0x54ead5,0x2,_0x24fc('0x6b'),_0x24fc('0x6c')+_0x8dbb4a[_0x24fc('0x30')]));if(_0x8dbb4a[_0x24fc('0x6d')]){_0x354fc6[_0x24fc('0x6a')](new Extension(_0x54ead5,0x3,_0x24fc('0x6b'),'PREFIX-CALLERIDALL='+_0x8dbb4a[_0x24fc('0x6d')]));}else{_0x354fc6[_0x24fc('0x6a')](new Extension(_0x54ead5,0x3,_0x24fc('0x64'),_0x24fc('0x6e')));}_0x354fc6['push'](new Extension(_0x54ead5,0x4,_0x24fc('0x6f'),_0x24ca4b[_0x24fc('0x70')]+','+'${EXTEN:'+(0x8+_0x8dbb4a['name']['length'])+'}'+','+0x1));return _0x354fc6;}function formatPrefixName(_0x2ae2ac){var _0x698283='_';for(var _0x246ef1=0x0;_0x246ef1<_0x2ae2ac[_0x24fc('0x4f')];_0x246ef1++){if(_0x2ae2ac[_0x24fc('0x71')](_0x246ef1)=='-'){_0x698283+=_0x2ae2ac[_0x24fc('0x71')](_0x246ef1);}else{_0x698283+='['+_0x2ae2ac['charAt'](_0x246ef1)+']';}}_0x698283+='.';return _0x698283;}exports[_0x24fc('0x29')]=function(_0x15e8a3,_0x5a2c09,_0x51b1c0){var _0xfc6b7f=_0x15e8a3[_0x24fc('0x72')];_0xfc6b7f[_0x24fc('0x69')]='system-'+_0xfc6b7f[_0x24fc('0x30')]+'-';return db[_0x24fc('0x52')][_0x24fc('0x53')](function(_0x4f5547){return db['VoicePrefix']['update'](_0xfc6b7f,{'where':{'id':_0xfc6b7f['id']},'transaction':_0x4f5547})['then'](function(){return db['VoiceExtension'][_0x24fc('0x2e')]({'where':{'VoicePrefixId':_0xfc6b7f['id']},'transaction':_0x4f5547})[_0x24fc('0x2a')](function(){return db[_0x24fc('0x55')][_0x24fc('0x50')]({'where':{'id':_0xfc6b7f['VoiceExtensionId']},'raw':!![]})[_0x24fc('0x2a')](function(_0x56dd0b){return createVoicePrefixExtensions(_0xfc6b7f,_0x56dd0b,_0x4f5547);});});});})[_0x24fc('0x2a')](function(){return db['VoicePrefix'][_0x24fc('0x73')](_0xfc6b7f['id']);})[_0x24fc('0x2a')](respondWithResult(_0x5a2c09,null))[_0x24fc('0x4c')](handleError(_0x5a2c09,null));};exports[_0x24fc('0x74')]=function(_0x3c4e2c,_0x291d60,_0x35c5f7){return db['VoicePrefix'][_0x24fc('0x50')]({'where':{'id':_0x3c4e2c[_0x24fc('0x4e')]['id']}})[_0x24fc('0x2a')](handleEntityNotFound(_0x291d60,null))['then'](function(_0x5201e7){if(_0x5201e7){return _0x5201e7[_0x24fc('0x74')](_0x3c4e2c[_0x24fc('0x72')]['ids'],_[_0x24fc('0x75')](_0x3c4e2c[_0x24fc('0x72')],['ids','id'])||{})[_0x24fc('0x76')](function(_0x383503){for(var _0x5249ea=0x0;_0x5249ea<_0x3c4e2c[_0x24fc('0x72')][_0x24fc('0x77')][_0x24fc('0x4f')];_0x5249ea+=0x1){socket[_0x24fc('0x78')](_0x24fc('0x79'),{'UserId':Number(_0x3c4e2c[_0x24fc('0x72')]['ids'][_0x5249ea]),'VoicePrefixId':Number(_0x3c4e2c['params']['id'])});}return _0x383503;});}})[_0x24fc('0x2a')](respondWithResult(_0x291d60,null))['catch'](handleError(_0x291d60,null));};exports[_0x24fc('0x7a')]=function(_0x52d54e,_0x5233c5,_0x436652){return db[_0x24fc('0x48')][_0x24fc('0x50')]({'where':{'id':_0x52d54e[_0x24fc('0x4e')]['id']}})[_0x24fc('0x2a')](handleEntityNotFound(_0x5233c5,null))[_0x24fc('0x2a')](function(_0x44eb26){if(_0x44eb26){return _0x44eb26[_0x24fc('0x7a')](_0x52d54e['query'][_0x24fc('0x77')])[_0x24fc('0x2a')](function(){if(_['isArray'](_0x52d54e['query'][_0x24fc('0x77')])){for(var _0x3cb0b5=0x0;_0x3cb0b5<_0x52d54e[_0x24fc('0x38')][_0x24fc('0x77')][_0x24fc('0x4f')];_0x3cb0b5+=0x1){socket['emit'](_0x24fc('0x7b'),{'UserId':Number(_0x52d54e[_0x24fc('0x38')]['ids'][_0x3cb0b5]),'VoicePrefixId':Number(_0x52d54e[_0x24fc('0x4e')]['id'])});}}else{socket[_0x24fc('0x78')](_0x24fc('0x7b'),{'UserId':Number(_0x52d54e['query'][_0x24fc('0x77')]),'VoicePrefixId':Number(_0x52d54e[_0x24fc('0x4e')]['id'])});}});}})[_0x24fc('0x2a')](respondWithStatusCode(_0x5233c5,null))[_0x24fc('0x4c')](handleError(_0x5233c5,null));};exports[_0x24fc('0x7c')]=function(_0x1ce8cb,_0x17f88a,_0x46b320){var _0x188edb={};var _0x54f379={};var _0x7f4f80;var _0x2921a7;return db[_0x24fc('0x48')]['findOne']({'where':{'id':_0x1ce8cb['params']['id']}})['then'](handleEntityNotFound(_0x17f88a,null))[_0x24fc('0x2a')](function(_0x560c80){if(_0x560c80){_0x7f4f80=_0x560c80;_0x54f379[_0x24fc('0x36')]=_[_0x24fc('0x39')](db['User'][_0x24fc('0x33')]);_0x54f379['query']=_[_0x24fc('0x39')](_0x1ce8cb['query']);_0x54f379[_0x24fc('0x3a')]=_[_0x24fc('0x3b')](_0x54f379[_0x24fc('0x36')],_0x54f379[_0x24fc('0x38')]);_0x188edb[_0x24fc('0x3c')]=_[_0x24fc('0x3b')](_0x54f379['model'],qs[_0x24fc('0x3d')](_0x1ce8cb[_0x24fc('0x38')][_0x24fc('0x3d')]));_0x188edb[_0x24fc('0x3c')]=_0x188edb[_0x24fc('0x3c')][_0x24fc('0x4f')]?_0x188edb[_0x24fc('0x3c')]:_0x54f379[_0x24fc('0x36')];_0x188edb[_0x24fc('0x40')]=qs['sort'](_0x1ce8cb[_0x24fc('0x38')][_0x24fc('0x41')]);_0x188edb[_0x24fc('0x44')]=qs[_0x24fc('0x3a')](_['pick'](_0x1ce8cb[_0x24fc('0x38')],_0x54f379[_0x24fc('0x3a')]));if(_0x1ce8cb[_0x24fc('0x38')]['filter']){_0x188edb[_0x24fc('0x44')]=_['merge'](_0x188edb['where'],{'$or':_['map'](_0x188edb[_0x24fc('0x3c')],function(_0x49c35c){var _0x29f1c1={};_0x29f1c1[_0x49c35c]={'$like':'%'+_0x1ce8cb[_0x24fc('0x38')][_0x24fc('0x43')]+'%'};return _0x29f1c1;})});}_0x188edb=_[_0x24fc('0x45')]({},_0x188edb,_0x1ce8cb['options']);return _0x7f4f80[_0x24fc('0x7c')](_0x188edb);}})[_0x24fc('0x2a')](function(_0x3d8394){if(_0x3d8394){_0x2921a7=_0x3d8394[_0x24fc('0x4f')];if(!_0x1ce8cb[_0x24fc('0x38')]['hasOwnProperty'](_0x24fc('0x7d'))){_0x188edb[_0x24fc('0x3f')]=qs[_0x24fc('0x3f')](_0x1ce8cb[_0x24fc('0x38')]['limit']);_0x188edb['offset']=qs[_0x24fc('0x24')](_0x1ce8cb[_0x24fc('0x38')][_0x24fc('0x24')]);}return _0x7f4f80[_0x24fc('0x7c')](_0x188edb);}})[_0x24fc('0x2a')](function(_0x49e6f2){if(_0x49e6f2){return _0x49e6f2?{'count':_0x2921a7,'rows':_0x49e6f2}:null;}})[_0x24fc('0x2a')](respondWithResult(_0x17f88a,null))[_0x24fc('0x4c')](handleError(_0x17f88a,null));};exports[_0x24fc('0x7e')]=function(_0x5d5a59,_0xa8881f,_0x69a2cd){var _0x437233={};var _0x1e1474={};var _0xc52004;var _0x4c10d9;return db['VoicePrefix']['findOne']({'where':{'id':_0x5d5a59[_0x24fc('0x4e')]['id']}})[_0x24fc('0x2a')](handleEntityNotFound(_0xa8881f,null))[_0x24fc('0x2a')](function(_0x23a033){if(_0x23a033){_0xc52004=_0x23a033;_0x1e1474[_0x24fc('0x36')]=_[_0x24fc('0x39')](db[_0x24fc('0x7f')][_0x24fc('0x33')]);_0x1e1474[_0x24fc('0x38')]=_[_0x24fc('0x39')](_0x5d5a59[_0x24fc('0x38')]);_0x1e1474[_0x24fc('0x3a')]=_['intersection'](_0x1e1474['model'],_0x1e1474[_0x24fc('0x38')]);_0x437233['attributes']=_[_0x24fc('0x3b')](_0x1e1474[_0x24fc('0x36')],qs[_0x24fc('0x3d')](_0x5d5a59[_0x24fc('0x38')][_0x24fc('0x3d')]));_0x437233[_0x24fc('0x3c')]=_0x437233[_0x24fc('0x3c')][_0x24fc('0x4f')]?_0x437233[_0x24fc('0x3c')]:_0x1e1474['model'];_0x437233[_0x24fc('0x40')]=qs[_0x24fc('0x41')](_0x5d5a59['query']['sort']);_0x437233[_0x24fc('0x44')]=qs[_0x24fc('0x3a')](_[_0x24fc('0x42')](_0x5d5a59[_0x24fc('0x38')],_0x1e1474[_0x24fc('0x3a')]));if(_0x5d5a59[_0x24fc('0x38')]['filter']){_0x437233[_0x24fc('0x44')]=_[_0x24fc('0x45')](_0x437233[_0x24fc('0x44')],{'$or':_[_0x24fc('0x37')](_0x437233['attributes'],function(_0x2fb68a){var _0x10519f={};_0x10519f[_0x2fb68a]={'$like':'%'+_0x5d5a59[_0x24fc('0x38')]['filter']+'%'};return _0x10519f;})});}_0x437233=_[_0x24fc('0x45')]({},_0x437233,_0x5d5a59[_0x24fc('0x47')]);return _0xc52004[_0x24fc('0x7e')](_0x437233);}})['then'](function(_0x163a99){if(_0x163a99){_0x4c10d9=_0x163a99[_0x24fc('0x4f')];if(!_0x5d5a59['query']['hasOwnProperty'](_0x24fc('0x7d'))){_0x437233[_0x24fc('0x3f')]=qs[_0x24fc('0x3f')](_0x5d5a59[_0x24fc('0x38')][_0x24fc('0x3f')]);_0x437233[_0x24fc('0x24')]=qs['offset'](_0x5d5a59[_0x24fc('0x38')][_0x24fc('0x24')]);}return _0xc52004[_0x24fc('0x7e')](_0x437233);}})[_0x24fc('0x2a')](function(_0x6f8974){if(_0x6f8974){return _0x6f8974?{'count':_0x4c10d9,'rows':_0x6f8974}:null;}})[_0x24fc('0x2a')](respondWithResult(_0xa8881f,null))['catch'](handleError(_0xa8881f,null));};exports[_0x24fc('0x80')]=function(_0x4a2522,_0x5226aa,_0x260a62){var _0x19b426=_0x4a2522['body'][_0x24fc('0x77')];var _0x45e8da;return db[_0x24fc('0x7f')][_0x24fc('0x4a')]({'where':{'id':_0x19b426},'attributes':['id'],'include':[{'model':db['User'],'as':_0x24fc('0x81'),'attributes':['id',_0x24fc('0x30'),_0x24fc('0x82'),_0x24fc('0x83'),_0x24fc('0x84')],'raw':!![]}]})[_0x24fc('0x2a')](function(_0x4e31bd){if(_0x4e31bd){_0x45e8da=_0x4e31bd;var _0x492328=_['flatMap'](_0x4e31bd,function(_0xc4f001){var _0x3fb8fc=_0xc4f001['get']({'plain':!![]});return _0x3fb8fc[_0x24fc('0x81')];});return db[_0x24fc('0x48')][_0x24fc('0x50')]({'where':{'id':_0x4a2522['params']['id']}})[_0x24fc('0x2a')](function(_0x15dbba){return db['sequelize']['transaction'](function(_0x33c581){return _0x15dbba[_0x24fc('0x80')](_0x19b426,{'transaction':_0x33c581})[_0x24fc('0x2a')](function(){return BPromise['each'](_0x45e8da,function(_0x2e4e38){return db['TeamVoicePrefix']['upsert']({'TeamId':_0x2e4e38['id'],'VoicePrefixId':_0x4a2522[_0x24fc('0x4e')]['id']},{'transaction':_0x33c581});});})['then'](function(){return BPromise['each'](_0x492328,function(_0x6dee4c){return db['UserVoicePrefix'][_0x24fc('0x85')]({'where':{'UserId':_0x6dee4c['id'],'VoicePrefixId':_0x4a2522[_0x24fc('0x4e')]['id']},'transaction':_0x33c581});});})[_0x24fc('0x2a')](function(){_0x492328[_0x24fc('0x86')](function(_0x4ae346){socket[_0x24fc('0x78')](_0x24fc('0x79'),{'UserId':_0x4ae346['id'],'VoicePrefixId':_0x15dbba['id']});});});});});}})['then'](respondWithStatusCode(_0x5226aa,null))[_0x24fc('0x4c')](handleError(_0x5226aa,null));};exports[_0x24fc('0x87')]=function(_0x30d523,_0x8b1efd,_0x2a19f9){return db['Team'][_0x24fc('0x4a')]({'where':{'id':_0x30d523[_0x24fc('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0x24fc('0x88')],'as':_0x24fc('0x81'),'attributes':['id'],'raw':!![]}]})[_0x24fc('0x2a')](handleEntityNotFound(_0x8b1efd,null))[_0x24fc('0x2a')](function(_0x18197a){var _0x5aaa55=_[_0x24fc('0x37')](_0x18197a,'id');var _0x5d6e00=[];var _0x5c8969=[];var _0x42c158=squel[_0x24fc('0x89')]();_0x42c158[_0x24fc('0x8a')]('tq.TeamId')['from'](_0x24fc('0x8b'),'tq')[_0x24fc('0x8c')](_0x24fc('0x8d'),'ut',_0x24fc('0x8e'))[_0x24fc('0x44')](_0x24fc('0x8f'),_0x30d523[_0x24fc('0x4e')]['id']);for(var _0x1efb25=0x0;_0x1efb25<_0x18197a['length'];_0x1efb25+=0x1){let _0x5bbe2c=_0x18197a[_0x1efb25];for(var _0x316b8f=0x0;_0x316b8f<_0x5bbe2c['Agents']['length'];_0x316b8f+=0x1){let _0x1bf646=_0x5bbe2c[_0x24fc('0x81')][_0x316b8f];var _0x31c499=_0x42c158[_0x24fc('0x90')]();_0x31c499[_0x24fc('0x44')](_0x24fc('0x91'),_0x1bf646['id']);_0x5c8969[_0x24fc('0x6a')](db['sequelize'][_0x24fc('0x38')](_0x31c499[_0x24fc('0x92')](),{'type':db[_0x24fc('0x52')][_0x24fc('0x93')][_0x24fc('0x94')]})[_0x24fc('0x2a')](function(_0x3be176){if(_0x3be176[_0x24fc('0x4f')]===0x1){return _0x1bf646['id'];}else{var _0x9fd1b5=_[_0x24fc('0x95')](_[_0x24fc('0x37')](_0x3be176,_0x24fc('0x96')),function(_0x11ed4f){return _[_0x24fc('0x97')](_0x5aaa55,_0x11ed4f);});if(_0x9fd1b5){return _0x1bf646['id'];}}}));}}return BPromise[_0x24fc('0x98')](_0x5c8969)[_0x24fc('0x2a')](function(_0x29af09){_0x5d6e00=_(_0x5d6e00)[_0x24fc('0x99')](_0x29af09)[_0x24fc('0x9a')]()[_0x24fc('0x9b')]();return db[_0x24fc('0x48')][_0x24fc('0x50')]({'where':{'id':_0x30d523[_0x24fc('0x4e')]['id']}})[_0x24fc('0x2a')](function(_0x219be8){return db['sequelize'][_0x24fc('0x53')](function(_0x4217f0){return _0x219be8[_0x24fc('0x87')](_0x30d523[_0x24fc('0x38')]['ids'],{'transaction':_0x4217f0})['then'](function(){if(!_['isEmpty'](_0x5d6e00)){return _0x219be8[_0x24fc('0x7a')](_0x5d6e00,{'transaction':_0x4217f0});}})['then'](function(){_0x5d6e00[_0x24fc('0x86')](function(_0x49e026){socket[_0x24fc('0x78')](_0x24fc('0x7b'),{'UserId':_0x49e026,'VoicePrefixId':_0x219be8['id']});});});});});});})[_0x24fc('0x2a')](respondWithStatusCode(_0x8b1efd,null))[_0x24fc('0x4c')](handleError(_0x8b1efd,null));};
\ No newline at end of file
+var _0x58a4=['addAgents','omit','ids','spread','userVoicePrefix:save','removeAgents','emit','userVoicePrefix:remove','getAgents','getTeams','Team','User','Agents','online','voicePause','interface','each','TeamVoicePrefix','UserVoicePrefix','findOrCreate','forEach','removeTeams','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','QueryTypes','every','TeamId','includes','all','union','value','isEmpty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','register','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','VoicePrefixes','UserProfileResource','end','stack','name','send','index','map','VoicePrefix','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','findAll','rows','show','params','keys','include','find','catch','describe','create','sequelize','transaction','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','description','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','VoiceExtension','VoiceExtensionId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','body','system-','findById'];(function(_0x384a7f,_0x1e0f9b){var _0x3b35bb=function(_0x3d6023){while(--_0x3d6023){_0x384a7f['push'](_0x384a7f['shift']());}};_0x3b35bb(++_0x1e0f9b);}(_0x58a4,0xbf));var _0x458a=function(_0x2c984d,_0x5a6f2f){_0x2c984d=_0x2c984d-0x0;var _0x31df62=_0x58a4[_0x2c984d];return _0x31df62;};'use strict';var emlformat=require(_0x458a('0x0'));var rimraf=require(_0x458a('0x1'));var zipdir=require(_0x458a('0x2'));var jsonpatch=require(_0x458a('0x3'));var rp=require(_0x458a('0x4'));var moment=require(_0x458a('0x5'));var BPromise=require(_0x458a('0x6'));var Mustache=require(_0x458a('0x7'));var util=require(_0x458a('0x8'));var path=require(_0x458a('0x9'));var sox=require(_0x458a('0xa'));var csv=require(_0x458a('0xb'));var ejs=require(_0x458a('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x458a('0xd'));var crypto=require(_0x458a('0xe'));var jsforce=require(_0x458a('0xf'));var deskjs=require(_0x458a('0x10'));var toCsv=require(_0x458a('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x458a('0x11'));var authService=require(_0x458a('0x12'));var qs=require(_0x458a('0x13'));var as=require(_0x458a('0x14'));var hardwareService=require(_0x458a('0x15'));var logger=require('../../config/logger')(_0x458a('0x16'));var utils=require(_0x458a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x458a('0x18'));var db=require(_0x458a('0x19'))['db'];config[_0x458a('0x1a')]=_[_0x458a('0x1b')](config[_0x458a('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x458a('0x1a')]));require('./voicePrefix.socket')[_0x458a('0x1c')](socket);function respondWithStatusCode(_0x44f683,_0x10133b){_0x10133b=_0x10133b||0xcc;return function(_0x3b74f9){if(_0x3b74f9){return _0x44f683[_0x458a('0x1d')](_0x10133b);}return _0x44f683[_0x458a('0x1e')](_0x10133b)['end']();};}function respondWithResult(_0x4b26be,_0x5c7993){_0x5c7993=_0x5c7993||0xc8;return function(_0x2faf6a){if(_0x2faf6a){return _0x4b26be[_0x458a('0x1e')](_0x5c7993)[_0x458a('0x1f')](_0x2faf6a);}};}function respondWithFilteredResult(_0x5c5b41,_0x310569){return function(_0x260c87){if(_0x260c87){var _0x18504d=typeof _0x310569[_0x458a('0x20')]===_0x458a('0x21')&&typeof _0x310569['limit']==='undefined';var _0x178db9=_0x260c87['count'];var _0x3302b7=_0x18504d?0x0:_0x310569[_0x458a('0x20')];var _0x47a202=_0x18504d?_0x260c87[_0x458a('0x22')]:_0x310569['offset']+_0x310569[_0x458a('0x23')];var _0x1c79cb;if(_0x47a202>=_0x178db9){_0x47a202=_0x178db9;_0x1c79cb=0xc8;}else{_0x1c79cb=0xce;}_0x5c5b41['status'](_0x1c79cb);return _0x5c5b41[_0x458a('0x24')](_0x458a('0x25'),_0x3302b7+'-'+_0x47a202+'/'+_0x178db9)['json'](_0x260c87);}return null;};}function patchUpdates(_0xa6b8ff){return function(_0x5ad95a){try{jsonpatch[_0x458a('0x26')](_0x5ad95a,_0xa6b8ff,!![]);}catch(_0x5bca42){return BPromise[_0x458a('0x27')](_0x5bca42);}return _0x5ad95a['save']();};}function saveUpdates(_0x36b08e,_0x911eaf){return function(_0xcb0756){if(_0xcb0756){return _0xcb0756[_0x458a('0x28')](_0x36b08e)[_0x458a('0x29')](function(_0x19bd5){return _0x19bd5;});}return null;};}function removeEntity(_0x340375,_0x3012c7){return function(_0x1f2d0){if(_0x1f2d0){return _0x1f2d0[_0x458a('0x2a')]()[_0x458a('0x29')](function(){var _0x327fcb=_0x1f2d0[_0x458a('0x2b')]({'plain':!![]});var _0x5a55b7=_0x458a('0x2c');return db[_0x458a('0x2d')]['destroy']({'where':{'type':_0x5a55b7,'resourceId':_0x327fcb['id']}})['then'](function(){return _0x1f2d0;});})[_0x458a('0x29')](function(){_0x340375['status'](0xcc)[_0x458a('0x2e')]();});}};}function handleEntityNotFound(_0x29f9b5,_0x223f73){return function(_0x4a49e4){if(!_0x4a49e4){_0x29f9b5[_0x458a('0x1d')](0x194);}return _0x4a49e4;};}function handleError(_0x2531f7,_0x1426a8){_0x1426a8=_0x1426a8||0x1f4;return function(_0x562c36){logger['error'](_0x562c36[_0x458a('0x2f')]);if(_0x562c36['name']){delete _0x562c36[_0x458a('0x30')];}_0x2531f7['status'](_0x1426a8)[_0x458a('0x31')](_0x562c36);};}exports[_0x458a('0x32')]=function(_0x492843,_0x309a6a){var _0x269f53={},_0x625ae3={},_0x525caf={'count':0x0,'rows':[]};var _0x3371c3=_[_0x458a('0x33')](db[_0x458a('0x34')][_0x458a('0x35')],function(_0x5267fe){return{'name':_0x5267fe['fieldName'],'type':_0x5267fe[_0x458a('0x36')][_0x458a('0x37')]};});_0x625ae3[_0x458a('0x38')]=_[_0x458a('0x33')](_0x3371c3,_0x458a('0x30'));_0x625ae3[_0x458a('0x39')]=_['keys'](_0x492843[_0x458a('0x39')]);_0x625ae3[_0x458a('0x3a')]=_[_0x458a('0x3b')](_0x625ae3[_0x458a('0x38')],_0x625ae3[_0x458a('0x39')]);_0x269f53[_0x458a('0x3c')]=_[_0x458a('0x3b')](_0x625ae3[_0x458a('0x38')],qs[_0x458a('0x3d')](_0x492843['query'][_0x458a('0x3d')]));_0x269f53[_0x458a('0x3c')]=_0x269f53[_0x458a('0x3c')][_0x458a('0x3e')]?_0x269f53[_0x458a('0x3c')]:_0x625ae3[_0x458a('0x38')];if(!_0x492843[_0x458a('0x39')][_0x458a('0x3f')](_0x458a('0x40'))){_0x269f53[_0x458a('0x23')]=qs[_0x458a('0x23')](_0x492843[_0x458a('0x39')][_0x458a('0x23')]);_0x269f53[_0x458a('0x20')]=qs[_0x458a('0x20')](_0x492843['query'][_0x458a('0x20')]);}_0x269f53[_0x458a('0x41')]=qs[_0x458a('0x42')](_0x492843[_0x458a('0x39')][_0x458a('0x42')]);_0x269f53[_0x458a('0x43')]=qs[_0x458a('0x3a')](_[_0x458a('0x44')](_0x492843[_0x458a('0x39')],_0x625ae3[_0x458a('0x3a')]),_0x3371c3);if(_0x492843[_0x458a('0x39')]['filter']){_0x269f53[_0x458a('0x43')]=_[_0x458a('0x45')](_0x269f53['where'],{'$or':_[_0x458a('0x33')](_0x3371c3,function(_0x422b45){if(_0x422b45[_0x458a('0x36')]!=='VIRTUAL'){var _0x406312={};_0x406312[_0x422b45[_0x458a('0x30')]]={'$like':'%'+_0x492843[_0x458a('0x39')][_0x458a('0x46')]+'%'};return _0x406312;}})});}_0x269f53=_[_0x458a('0x45')]({},_0x269f53,_0x492843[_0x458a('0x47')]);var _0x21d2d4={'where':_0x269f53[_0x458a('0x43')]};return db['VoicePrefix'][_0x458a('0x22')](_0x21d2d4)[_0x458a('0x29')](function(_0x2b9030){_0x525caf['count']=_0x2b9030;if(_0x492843[_0x458a('0x39')][_0x458a('0x48')]){_0x269f53['include']=[{'all':!![]}];}return db[_0x458a('0x34')][_0x458a('0x49')](_0x269f53);})[_0x458a('0x29')](function(_0x36c391){_0x525caf[_0x458a('0x4a')]=_0x36c391;return _0x525caf;})['then'](respondWithFilteredResult(_0x309a6a,_0x269f53))['catch'](handleError(_0x309a6a,null));};exports[_0x458a('0x4b')]=function(_0x301e61,_0x33a31d){var _0x18e4e2={'raw':![],'where':{'id':_0x301e61[_0x458a('0x4c')]['id']}},_0x5afd24={};_0x5afd24[_0x458a('0x38')]=_['keys'](db[_0x458a('0x34')]['rawAttributes']);_0x5afd24[_0x458a('0x39')]=_[_0x458a('0x4d')](_0x301e61[_0x458a('0x39')]);_0x5afd24['filters']=_[_0x458a('0x3b')](_0x5afd24[_0x458a('0x38')],_0x5afd24[_0x458a('0x39')]);_0x18e4e2['attributes']=_['intersection'](_0x5afd24[_0x458a('0x38')],qs[_0x458a('0x3d')](_0x301e61[_0x458a('0x39')]['fields']));_0x18e4e2['attributes']=_0x18e4e2[_0x458a('0x3c')][_0x458a('0x3e')]?_0x18e4e2[_0x458a('0x3c')]:_0x5afd24[_0x458a('0x38')];if(_0x301e61[_0x458a('0x39')][_0x458a('0x48')]){_0x18e4e2[_0x458a('0x4e')]=[{'all':!![]}];}_0x18e4e2=_[_0x458a('0x45')]({},_0x18e4e2,_0x301e61[_0x458a('0x47')]);return db[_0x458a('0x34')][_0x458a('0x4f')](_0x18e4e2)[_0x458a('0x29')](handleEntityNotFound(_0x33a31d,null))[_0x458a('0x29')](respondWithResult(_0x33a31d,null))[_0x458a('0x50')](handleError(_0x33a31d,null));};exports[_0x458a('0x2a')]=function(_0x25b44c,_0x51669b){return db[_0x458a('0x34')][_0x458a('0x4f')]({'where':{'id':_0x25b44c[_0x458a('0x4c')]['id']}})[_0x458a('0x29')](handleEntityNotFound(_0x51669b,null))[_0x458a('0x29')](removeEntity(_0x51669b,null))['catch'](handleError(_0x51669b,null));};exports['describe']=function(_0x514d82,_0x2abf75){return db['VoicePrefix'][_0x458a('0x51')]()[_0x458a('0x29')](respondWithResult(_0x2abf75,null))[_0x458a('0x50')](handleError(_0x2abf75,null));};exports[_0x458a('0x52')]=function(_0xfa6e65,_0x5f0151){var _0x48f68e;return db[_0x458a('0x53')][_0x458a('0x54')](function(_0x2587a1){return db[_0x458a('0x34')][_0x458a('0x52')](_0xfa6e65['body'],{'transaction':_0x2587a1})[_0x458a('0x29')](function(_0x4eed01){_0x48f68e=_0x4eed01[_0x458a('0x2b')]({'plain':!![]});return db['VoiceExtension'][_0x458a('0x4f')]({'where':{'id':_0x48f68e['VoiceExtensionId']},'raw':!![]})['then'](function(_0x4b9928){return createVoicePrefixExtensions(_0x48f68e,_0x4b9928,_0x2587a1);});});})[_0x458a('0x29')](function(){var _0x3eb267=_0xfa6e65['user'][_0x458a('0x2b')]({'plain':!![]});if(!_0x3eb267)throw new Error(_0x458a('0x55'));if(_0x3eb267[_0x458a('0x56')]==='user'){var _0x2c1230=_0x48f68e;return db[_0x458a('0x57')][_0x458a('0x4f')]({'where':{'name':_0x458a('0x2c'),'userProfileId':_0x3eb267[_0x458a('0x58')]},'raw':!![]})[_0x458a('0x29')](function(_0x597e74){if(_0x597e74&&_0x597e74[_0x458a('0x59')]===0x0){return db[_0x458a('0x2d')][_0x458a('0x52')]({'name':_0x2c1230[_0x458a('0x30')],'resourceId':_0x2c1230['id'],'type':_0x597e74[_0x458a('0x30')],'sectionId':_0x597e74['id']},{})[_0x458a('0x29')](function(){return _0x48f68e;});}else{return _0x48f68e;}})[_0x458a('0x50')](function(_0x3b6cf9){logger['error'](_0x458a('0x5a'),_0x3b6cf9);throw _0x3b6cf9;});}return _0x48f68e;})['then'](respondWithResult(_0x5f0151,null))[_0x458a('0x50')](handleError(_0x5f0151,null));};function Extension(_0x2921ba,_0x222aa4,_0x42b748,_0x4da240){this['context']=_0x458a('0x5b');this[_0x458a('0x5c')]=_0x2921ba;this[_0x458a('0x5d')]=_0x42b748;this[_0x458a('0x36')]=_0x458a('0x5e');this[_0x458a('0x5f')]='Voice\x20Prefix\x20Extension';this[_0x458a('0x60')]=_0x222aa4;this[_0x458a('0x61')]=_0x4da240;}function createVoicePrefixExtensions(_0x4f6913,_0x18d83a,_0x47b334){return new BPromise(function(_0x425a0f,_0x338127){var _0xa37d44=new Extension(formatPrefixName(_0x4f6913[_0x458a('0x62')]),0x1,_0x458a('0x63'),_0x458a('0x64'));_0xa37d44[_0x458a('0x65')]=_0x4f6913['id'];return db[_0x458a('0x66')]['create'](_0xa37d44,{'transaction':_0x47b334})[_0x458a('0x29')](function(_0x3ed05d){var _0x5d41a2=_0x3ed05d[_0x458a('0x2b')]({'plain':!![]});var _0x3da617=_['map'](addVoicePrefixExtensions(_0x4f6913,_0x18d83a),function(_0xaf7b50){_0xaf7b50[_0x458a('0x67')]=_0x5d41a2['id'];_0xaf7b50['VoicePrefixId']=_0x4f6913['id'];return _0xaf7b50;});return db[_0x458a('0x66')][_0x458a('0x68')](_0x3da617,{'transaction':_0x47b334})['then'](function(_0x16f82f){if(!_0x16f82f){return _0x338127(_0x458a('0x69'));}else{return _0x425a0f(_0x16f82f);}})[_0x458a('0x50')](function(_0x404d93){return _0x338127(_0x404d93);});});;});};function addVoicePrefixExtensions(_0x541375,_0x27d1f2){var _0x4199a7=[];var _0x397595=formatPrefixName(_0x541375['prefix']);_0x4199a7[_0x458a('0x6a')](new Extension(_0x397595,0x2,_0x458a('0x6b'),_0x458a('0x6c')+_0x541375[_0x458a('0x30')]));if(_0x541375[_0x458a('0x6d')]){_0x4199a7[_0x458a('0x6a')](new Extension(_0x397595,0x3,_0x458a('0x6b'),_0x458a('0x6e')+_0x541375[_0x458a('0x6d')]));}else{_0x4199a7[_0x458a('0x6a')](new Extension(_0x397595,0x3,'NoOp',_0x458a('0x6f')));}_0x4199a7['push'](new Extension(_0x397595,0x4,_0x458a('0x70'),_0x27d1f2[_0x458a('0x71')]+','+_0x458a('0x72')+(0x8+_0x541375[_0x458a('0x30')][_0x458a('0x3e')])+'}'+','+0x1));return _0x4199a7;}function formatPrefixName(_0x3d1d37){var _0x2c6a00='_';for(var _0x3745d5=0x0;_0x3745d5<_0x3d1d37[_0x458a('0x3e')];_0x3745d5++){if(_0x3d1d37[_0x458a('0x73')](_0x3745d5)=='-'){_0x2c6a00+=_0x3d1d37[_0x458a('0x73')](_0x3745d5);}else{_0x2c6a00+='['+_0x3d1d37[_0x458a('0x73')](_0x3745d5)+']';}}_0x2c6a00+='.';return _0x2c6a00;}exports[_0x458a('0x28')]=function(_0x435884,_0x3948aa,_0x2c131b){var _0x4c426a=_0x435884[_0x458a('0x74')];_0x4c426a['prefix']=_0x458a('0x75')+_0x4c426a[_0x458a('0x30')]+'-';return db['sequelize'][_0x458a('0x54')](function(_0xb028b3){return db[_0x458a('0x34')]['update'](_0x4c426a,{'where':{'id':_0x4c426a['id']},'transaction':_0xb028b3})[_0x458a('0x29')](function(){return db[_0x458a('0x66')][_0x458a('0x2a')]({'where':{'VoicePrefixId':_0x4c426a['id']},'transaction':_0xb028b3})[_0x458a('0x29')](function(){return db[_0x458a('0x66')][_0x458a('0x4f')]({'where':{'id':_0x4c426a['VoiceExtensionId']},'raw':!![]})[_0x458a('0x29')](function(_0x54abb1){return createVoicePrefixExtensions(_0x4c426a,_0x54abb1,_0xb028b3);});});});})['then'](function(){return db[_0x458a('0x34')][_0x458a('0x76')](_0x4c426a['id']);})[_0x458a('0x29')](respondWithResult(_0x3948aa,null))[_0x458a('0x50')](handleError(_0x3948aa,null));};exports[_0x458a('0x77')]=function(_0x434d04,_0x42eae7,_0x5aee0d){return db[_0x458a('0x34')][_0x458a('0x4f')]({'where':{'id':_0x434d04[_0x458a('0x4c')]['id']}})[_0x458a('0x29')](handleEntityNotFound(_0x42eae7,null))[_0x458a('0x29')](function(_0x17398f){if(_0x17398f){return _0x17398f['addAgents'](_0x434d04['body']['ids'],_[_0x458a('0x78')](_0x434d04['body'],[_0x458a('0x79'),'id'])||{})[_0x458a('0x7a')](function(_0x46ef02){for(var _0x3d73d1=0x0;_0x3d73d1<_0x434d04[_0x458a('0x74')][_0x458a('0x79')][_0x458a('0x3e')];_0x3d73d1+=0x1){socket['emit'](_0x458a('0x7b'),{'UserId':Number(_0x434d04[_0x458a('0x74')]['ids'][_0x3d73d1]),'VoicePrefixId':Number(_0x434d04[_0x458a('0x4c')]['id'])});}return _0x46ef02;});}})['then'](respondWithResult(_0x42eae7,null))[_0x458a('0x50')](handleError(_0x42eae7,null));};exports['removeAgents']=function(_0x26b3f7,_0x177457,_0xce45b5){return db[_0x458a('0x34')]['find']({'where':{'id':_0x26b3f7[_0x458a('0x4c')]['id']}})[_0x458a('0x29')](handleEntityNotFound(_0x177457,null))[_0x458a('0x29')](function(_0x239e2f){if(_0x239e2f){return _0x239e2f[_0x458a('0x7c')](_0x26b3f7[_0x458a('0x39')][_0x458a('0x79')])[_0x458a('0x29')](function(){if(_['isArray'](_0x26b3f7[_0x458a('0x39')][_0x458a('0x79')])){for(var _0x12e367=0x0;_0x12e367<_0x26b3f7[_0x458a('0x39')]['ids'][_0x458a('0x3e')];_0x12e367+=0x1){socket[_0x458a('0x7d')]('userVoicePrefix:remove',{'UserId':Number(_0x26b3f7[_0x458a('0x39')][_0x458a('0x79')][_0x12e367]),'VoicePrefixId':Number(_0x26b3f7[_0x458a('0x4c')]['id'])});}}else{socket[_0x458a('0x7d')](_0x458a('0x7e'),{'UserId':Number(_0x26b3f7['query'][_0x458a('0x79')]),'VoicePrefixId':Number(_0x26b3f7[_0x458a('0x4c')]['id'])});}});}})[_0x458a('0x29')](respondWithStatusCode(_0x177457,null))[_0x458a('0x50')](handleError(_0x177457,null));};exports[_0x458a('0x7f')]=function(_0x46ac5c,_0x2eecf0,_0x573f46){var _0x1f9925={};var _0x4d3790={};var _0x396af9;var _0x36e650;return db[_0x458a('0x34')]['findOne']({'where':{'id':_0x46ac5c[_0x458a('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2eecf0,null))['then'](function(_0x2574a3){if(_0x2574a3){_0x396af9=_0x2574a3;_0x4d3790[_0x458a('0x38')]=_['keys'](db['User'][_0x458a('0x35')]);_0x4d3790[_0x458a('0x39')]=_[_0x458a('0x4d')](_0x46ac5c[_0x458a('0x39')]);_0x4d3790[_0x458a('0x3a')]=_['intersection'](_0x4d3790[_0x458a('0x38')],_0x4d3790['query']);_0x1f9925[_0x458a('0x3c')]=_[_0x458a('0x3b')](_0x4d3790[_0x458a('0x38')],qs['fields'](_0x46ac5c[_0x458a('0x39')][_0x458a('0x3d')]));_0x1f9925['attributes']=_0x1f9925[_0x458a('0x3c')]['length']?_0x1f9925[_0x458a('0x3c')]:_0x4d3790[_0x458a('0x38')];_0x1f9925[_0x458a('0x41')]=qs[_0x458a('0x42')](_0x46ac5c['query'][_0x458a('0x42')]);_0x1f9925['where']=qs['filters'](_[_0x458a('0x44')](_0x46ac5c[_0x458a('0x39')],_0x4d3790[_0x458a('0x3a')]));if(_0x46ac5c[_0x458a('0x39')][_0x458a('0x46')]){_0x1f9925[_0x458a('0x43')]=_['merge'](_0x1f9925[_0x458a('0x43')],{'$or':_[_0x458a('0x33')](_0x1f9925[_0x458a('0x3c')],function(_0x222dcb){var _0x17099e={};_0x17099e[_0x222dcb]={'$like':'%'+_0x46ac5c[_0x458a('0x39')]['filter']+'%'};return _0x17099e;})});}_0x1f9925=_[_0x458a('0x45')]({},_0x1f9925,_0x46ac5c[_0x458a('0x47')]);return _0x396af9[_0x458a('0x7f')](_0x1f9925);}})['then'](function(_0x2903c2){if(_0x2903c2){_0x36e650=_0x2903c2[_0x458a('0x3e')];if(!_0x46ac5c[_0x458a('0x39')]['hasOwnProperty']('nolimit')){_0x1f9925[_0x458a('0x23')]=qs['limit'](_0x46ac5c['query']['limit']);_0x1f9925['offset']=qs['offset'](_0x46ac5c[_0x458a('0x39')]['offset']);}return _0x396af9[_0x458a('0x7f')](_0x1f9925);}})[_0x458a('0x29')](function(_0x2adefe){if(_0x2adefe){return _0x2adefe?{'count':_0x36e650,'rows':_0x2adefe}:null;}})[_0x458a('0x29')](respondWithResult(_0x2eecf0,null))[_0x458a('0x50')](handleError(_0x2eecf0,null));};exports[_0x458a('0x80')]=function(_0x555190,_0x11ebe7,_0x59ad9c){var _0x24b1ee={};var _0x4e1d44={};var _0x23428c;var _0x333d74;return db['VoicePrefix']['findOne']({'where':{'id':_0x555190['params']['id']}})[_0x458a('0x29')](handleEntityNotFound(_0x11ebe7,null))[_0x458a('0x29')](function(_0x21d8a9){if(_0x21d8a9){_0x23428c=_0x21d8a9;_0x4e1d44[_0x458a('0x38')]=_[_0x458a('0x4d')](db['Team'][_0x458a('0x35')]);_0x4e1d44[_0x458a('0x39')]=_[_0x458a('0x4d')](_0x555190[_0x458a('0x39')]);_0x4e1d44[_0x458a('0x3a')]=_[_0x458a('0x3b')](_0x4e1d44[_0x458a('0x38')],_0x4e1d44[_0x458a('0x39')]);_0x24b1ee['attributes']=_[_0x458a('0x3b')](_0x4e1d44[_0x458a('0x38')],qs[_0x458a('0x3d')](_0x555190[_0x458a('0x39')][_0x458a('0x3d')]));_0x24b1ee[_0x458a('0x3c')]=_0x24b1ee[_0x458a('0x3c')]['length']?_0x24b1ee['attributes']:_0x4e1d44['model'];_0x24b1ee['order']=qs[_0x458a('0x42')](_0x555190[_0x458a('0x39')][_0x458a('0x42')]);_0x24b1ee[_0x458a('0x43')]=qs['filters'](_[_0x458a('0x44')](_0x555190[_0x458a('0x39')],_0x4e1d44[_0x458a('0x3a')]));if(_0x555190[_0x458a('0x39')]['filter']){_0x24b1ee['where']=_[_0x458a('0x45')](_0x24b1ee[_0x458a('0x43')],{'$or':_[_0x458a('0x33')](_0x24b1ee[_0x458a('0x3c')],function(_0x4ff826){var _0xbb80ab={};_0xbb80ab[_0x4ff826]={'$like':'%'+_0x555190[_0x458a('0x39')][_0x458a('0x46')]+'%'};return _0xbb80ab;})});}_0x24b1ee=_[_0x458a('0x45')]({},_0x24b1ee,_0x555190[_0x458a('0x47')]);return _0x23428c[_0x458a('0x80')](_0x24b1ee);}})[_0x458a('0x29')](function(_0xd05241){if(_0xd05241){_0x333d74=_0xd05241[_0x458a('0x3e')];if(!_0x555190[_0x458a('0x39')]['hasOwnProperty']('nolimit')){_0x24b1ee[_0x458a('0x23')]=qs[_0x458a('0x23')](_0x555190[_0x458a('0x39')][_0x458a('0x23')]);_0x24b1ee[_0x458a('0x20')]=qs[_0x458a('0x20')](_0x555190[_0x458a('0x39')]['offset']);}return _0x23428c[_0x458a('0x80')](_0x24b1ee);}})['then'](function(_0x165b0d){if(_0x165b0d){return _0x165b0d?{'count':_0x333d74,'rows':_0x165b0d}:null;}})[_0x458a('0x29')](respondWithResult(_0x11ebe7,null))[_0x458a('0x50')](handleError(_0x11ebe7,null));};exports['addTeams']=function(_0x589496,_0x4ee34,_0x1c9f4c){var _0x241c72=_0x589496[_0x458a('0x74')][_0x458a('0x79')];var _0x53d065;return db[_0x458a('0x81')][_0x458a('0x49')]({'where':{'id':_0x241c72},'attributes':['id'],'include':[{'model':db[_0x458a('0x82')],'as':_0x458a('0x83'),'attributes':['id',_0x458a('0x30'),_0x458a('0x84'),_0x458a('0x85'),_0x458a('0x86')],'raw':!![]}]})[_0x458a('0x29')](function(_0x52b844){if(_0x52b844){_0x53d065=_0x52b844;var _0x3051d2=_['flatMap'](_0x52b844,function(_0x2e496b){var _0x442b4a=_0x2e496b[_0x458a('0x2b')]({'plain':!![]});return _0x442b4a['Agents'];});return db['VoicePrefix'][_0x458a('0x4f')]({'where':{'id':_0x589496['params']['id']}})[_0x458a('0x29')](function(_0x5d97cc){return db[_0x458a('0x53')][_0x458a('0x54')](function(_0x1b8558){return _0x5d97cc['addTeams'](_0x241c72,{'transaction':_0x1b8558})[_0x458a('0x29')](function(){return BPromise[_0x458a('0x87')](_0x53d065,function(_0x5dbeed){return db[_0x458a('0x88')]['upsert']({'TeamId':_0x5dbeed['id'],'VoicePrefixId':_0x589496[_0x458a('0x4c')]['id']},{'transaction':_0x1b8558});});})[_0x458a('0x29')](function(){return BPromise[_0x458a('0x87')](_0x3051d2,function(_0x49bdfc){return db[_0x458a('0x89')][_0x458a('0x8a')]({'where':{'UserId':_0x49bdfc['id'],'VoicePrefixId':_0x589496[_0x458a('0x4c')]['id']},'transaction':_0x1b8558});});})[_0x458a('0x29')](function(){_0x3051d2[_0x458a('0x8b')](function(_0x477402){socket['emit'](_0x458a('0x7b'),{'UserId':_0x477402['id'],'VoicePrefixId':_0x5d97cc['id']});});});});});}})[_0x458a('0x29')](respondWithStatusCode(_0x4ee34,null))['catch'](handleError(_0x4ee34,null));};exports[_0x458a('0x8c')]=function(_0x187bc8,_0x197858,_0x48622f){return db[_0x458a('0x81')][_0x458a('0x49')]({'where':{'id':_0x187bc8[_0x458a('0x39')]['ids']},'attributes':['id'],'include':[{'model':db[_0x458a('0x82')],'as':_0x458a('0x83'),'attributes':['id'],'raw':!![]}]})[_0x458a('0x29')](handleEntityNotFound(_0x197858,null))[_0x458a('0x29')](function(_0x2334f3){var _0x46bfc7=_[_0x458a('0x33')](_0x2334f3,'id');var _0x43cb92=[];var _0x5c42a4=[];var _0x3c3c7b=squel['select']();_0x3c3c7b['field'](_0x458a('0x8d'))[_0x458a('0x8e')]('team_has_voice_prefixes','tq')[_0x458a('0x8f')]('user_has_teams','ut',_0x458a('0x90'))['where'](_0x458a('0x91'),_0x187bc8[_0x458a('0x4c')]['id']);for(var _0x20ad0b=0x0;_0x20ad0b<_0x2334f3[_0x458a('0x3e')];_0x20ad0b+=0x1){let _0x55eab3=_0x2334f3[_0x20ad0b];for(var _0x4677a6=0x0;_0x4677a6<_0x55eab3[_0x458a('0x83')][_0x458a('0x3e')];_0x4677a6+=0x1){let _0x4df0b4=_0x55eab3[_0x458a('0x83')][_0x4677a6];var _0xfd1b68=_0x3c3c7b[_0x458a('0x92')]();_0xfd1b68[_0x458a('0x43')]('ut.UserId\x20=\x20?',_0x4df0b4['id']);_0x5c42a4[_0x458a('0x6a')](db['sequelize']['query'](_0xfd1b68['toString'](),{'type':db[_0x458a('0x53')][_0x458a('0x93')]['SELECT']})[_0x458a('0x29')](function(_0x49297c){if(_0x49297c[_0x458a('0x3e')]===0x1){return _0x4df0b4['id'];}else{var _0x4bfd6b=_[_0x458a('0x94')](_['map'](_0x49297c,_0x458a('0x95')),function(_0x3c9685){return _[_0x458a('0x96')](_0x46bfc7,_0x3c9685);});if(_0x4bfd6b){return _0x4df0b4['id'];}}}));}}return BPromise[_0x458a('0x97')](_0x5c42a4)[_0x458a('0x29')](function(_0x2e24aa){_0x43cb92=_(_0x43cb92)[_0x458a('0x98')](_0x2e24aa)['compact']()[_0x458a('0x99')]();return db[_0x458a('0x34')][_0x458a('0x4f')]({'where':{'id':_0x187bc8['params']['id']}})['then'](function(_0x334129){return db[_0x458a('0x53')][_0x458a('0x54')](function(_0x330330){return _0x334129[_0x458a('0x8c')](_0x187bc8['query'][_0x458a('0x79')],{'transaction':_0x330330})[_0x458a('0x29')](function(){if(!_[_0x458a('0x9a')](_0x43cb92)){return _0x334129[_0x458a('0x7c')](_0x43cb92,{'transaction':_0x330330});}})[_0x458a('0x29')](function(){_0x43cb92['forEach'](function(_0x16a747){socket[_0x458a('0x7d')](_0x458a('0x7e'),{'UserId':_0x16a747,'VoicePrefixId':_0x334129['id']});});});});});});})[_0x458a('0x29')](respondWithStatusCode(_0x197858,null))[_0x458a('0x50')](handleError(_0x197858,null));};
\ No newline at end of file
index 57e37cd..c730579 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc00f=['emit','hasOwnProperty','hook','exports','../../mysqldb','save','update','remove'];(function(_0x65d044,_0x3ede47){var _0x545b56=function(_0x361fc5){while(--_0x361fc5){_0x65d044['push'](_0x65d044['shift']());}};_0x545b56(++_0x3ede47);}(_0xc00f,0x8c));var _0xfc00=function(_0x24b1ea,_0x642a66){_0x24b1ea=_0x24b1ea-0x0;var _0x1eb3b0=_0xc00f[_0x24b1ea];return _0x1eb3b0;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xfc00('0x0'))['db']['VoicePrefix'];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfc00('0x1'),'afterUpdate':_0xfc00('0x2'),'afterDestroy':_0xfc00('0x3')};function emitEvent(_0x18e4b6){return function(_0x49b528,_0x1b27be,_0x813d8b){VoicePrefixEvents['emit'](_0x18e4b6+':'+_0x49b528['id'],_0x49b528);VoicePrefixEvents[_0xfc00('0x4')](_0x18e4b6,_0x49b528);_0x813d8b(null);};}for(var e in events){if(events[_0xfc00('0x5')](e)){var event=events[e];VoicePrefix[_0xfc00('0x6')](e,emitEvent(event));}}module[_0xfc00('0x7')]=VoicePrefixEvents;
\ No newline at end of file
+var _0x3045=['hook','events','../../mysqldb','VoicePrefix','update','emit'];(function(_0x540178,_0x1feb3d){var _0x58a85c=function(_0x1c4861){while(--_0x1c4861){_0x540178['push'](_0x540178['shift']());}};_0x58a85c(++_0x1feb3d);}(_0x3045,0x13f));var _0x5304=function(_0x50c36b,_0xa6a857){_0x50c36b=_0x50c36b-0x0;var _0x3a5f8f=_0x3045[_0x50c36b];return _0x3a5f8f;};'use strict';var EventEmitter=require(_0x5304('0x0'));var VoicePrefix=require(_0x5304('0x1'))['db'][_0x5304('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5304('0x3'),'afterDestroy':'remove'};function emitEvent(_0x54b4b9){return function(_0x2c6ec5,_0x345d95,_0x5c8db9){VoicePrefixEvents[_0x5304('0x4')](_0x54b4b9+':'+_0x2c6ec5['id'],_0x2c6ec5);VoicePrefixEvents[_0x5304('0x4')](_0x54b4b9,_0x2c6ec5);_0x5c8db9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoicePrefix[_0x5304('0x5')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents;
\ No newline at end of file
index d9c2ee7..6e40449 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7cc7=['../../config/logger','api','moment','bluebird','request-promise','path','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','util'];(function(_0x33a96b,_0x46a3da){var _0xa171c5=function(_0x3054a1){while(--_0x3054a1){_0x33a96b['push'](_0x33a96b['shift']());}};_0xa171c5(++_0x46a3da);}(_0x7cc7,0x8d));var _0x77cc=function(_0x167775,_0x101269){_0x167775=_0x167775-0x0;var _0x560e68=_0x7cc7[_0x167775];return _0x560e68;};'use strict';var _=require(_0x77cc('0x0'));var util=require(_0x77cc('0x1'));var logger=require(_0x77cc('0x2'))(_0x77cc('0x3'));var moment=require(_0x77cc('0x4'));var BPromise=require(_0x77cc('0x5'));var rp=require(_0x77cc('0x6'));var fs=require('fs');var path=require(_0x77cc('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x77cc('0x8'));module[_0x77cc('0x9')]=function(_0x25f203,_0x2a2717){return _0x25f203[_0x77cc('0xa')](_0x77cc('0xb'),attributes,{'tableName':_0x77cc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdd9b=['VoicePrefix','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./voicePrefix.attributes','exports','define'];(function(_0x20629d,_0x1a6757){var _0x4ca950=function(_0x2c806c){while(--_0x2c806c){_0x20629d['push'](_0x20629d['shift']());}};_0x4ca950(++_0x1a6757);}(_0xdd9b,0x16d));var _0xbdd9=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xdd9b[_0x5f0089];return _0x193892;};'use strict';var _=require(_0xbdd9('0x0'));var util=require(_0xbdd9('0x1'));var logger=require(_0xbdd9('0x2'))(_0xbdd9('0x3'));var moment=require(_0xbdd9('0x4'));var BPromise=require(_0xbdd9('0x5'));var rp=require(_0xbdd9('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbdd9('0x7'));var config=require(_0xbdd9('0x8'));var attributes=require(_0xbdd9('0x9'));module[_0xbdd9('0xa')]=function(_0x2b9c07,_0x360e3c){return _0x2b9c07[_0xbdd9('0xb')](_0xbdd9('0xc'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 85e05f7..6376810 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x1be589,_0x40c396){_0x1be589=_0x1be589-0x0;var _0x34a3bf=_0x7a54[_0x1be589];return _0x34a3bf;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('VoicePrefix,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}
\ No newline at end of file
+var _0xbe2c=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xbe2c,0x18f));var _0xcbe2=function(_0x1b5100,_0xaa7d32){_0x1b5100=_0x1b5100-0x0;var _0x2e3200=_0xbe2c[_0x1b5100];return _0x2e3200;};'use strict';var _=require(_0xcbe2('0x0'));var util=require(_0xcbe2('0x1'));var moment=require('moment');var BPromise=require(_0xcbe2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcbe2('0x3'));var db=require(_0xcbe2('0x4'))['db'];var utils=require(_0xcbe2('0x5'));var logger=require(_0xcbe2('0x6'))(_0xcbe2('0x7'));var config=require('../../config/environment');var jayson=require(_0xcbe2('0x8'));var client=jayson[_0xcbe2('0x9')]['http']({'port':0x232a});config[_0xcbe2('0xa')]=_[_0xcbe2('0xb')](config[_0xcbe2('0xa')],{'host':_0xcbe2('0xc'),'port':0x18eb});var socket=require(_0xcbe2('0xd'))(new Redis(config['redis']));require('./voicePrefix.socket')[_0xcbe2('0xe')](socket);function respondWithRpcPromise(_0x335234,_0x675278,_0x1b67af){return new BPromise(function(_0x4af901,_0x5d2a45){return client[_0xcbe2('0xf')](_0x335234,_0x1b67af)[_0xcbe2('0x10')](function(_0x3b050b){logger[_0xcbe2('0x11')](_0xcbe2('0x12'),_0x675278,_0xcbe2('0x13'));logger['debug'](_0xcbe2('0x14'),_0x675278,_0xcbe2('0x13'),JSON['stringify'](_0x3b050b));if(_0x3b050b[_0xcbe2('0x15')]){if(_0x3b050b['error'][_0xcbe2('0x16')]===0x1f4){logger['error'](_0xcbe2('0x12'),_0x675278,_0x3b050b['error']['message']);return _0x5d2a45(_0x3b050b[_0xcbe2('0x15')]['message']);}logger[_0xcbe2('0x15')](_0xcbe2('0x12'),_0x675278,_0x3b050b[_0xcbe2('0x15')][_0xcbe2('0x17')]);return _0x4af901(_0x3b050b[_0xcbe2('0x15')][_0xcbe2('0x17')]);}else{logger[_0xcbe2('0x11')]('VoicePrefix,\x20%s,\x20%s',_0x675278,_0xcbe2('0x13'));_0x4af901(_0x3b050b['result'][_0xcbe2('0x17')]);}})[_0xcbe2('0x18')](function(_0x31b49c){logger[_0xcbe2('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x675278,_0x31b49c);_0x5d2a45(_0x31b49c);});});}
\ No newline at end of file
index b746b4a..5a7575b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f6a=['length','./voicePrefix.events','update','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f6a,0xc4));var _0xa5f6=function(_0x218e11,_0x44c7d4){_0x218e11=_0x218e11-0x0;var _0x541e24=_0x5f6a[_0x218e11];return _0x541e24;};'use strict';var VoicePrefixEvents=require(_0xa5f6('0x0'));var events=['save','remove',_0xa5f6('0x1')];function createListener(_0x4be333,_0x2e23f3){return function(_0x1ec17a){_0x2e23f3['emit'](_0x4be333,_0x1ec17a);};}function removeListener(_0x2e8b33,_0x8e175a){return function(){VoicePrefixEvents[_0xa5f6('0x2')](_0x2e8b33,_0x8e175a);};}exports[_0xa5f6('0x3')]=function(_0xb6a42e){for(var _0x9c569c=0x0,_0x19ac7d=events[_0xa5f6('0x4')];_0x9c569c<_0x19ac7d;_0x9c569c++){var _0x2505d7=events[_0x9c569c];var _0x135782=createListener('voicePrefix:'+_0x2505d7,_0xb6a42e);VoicePrefixEvents['on'](_0x2505d7,_0x135782);}};
\ No newline at end of file
+var _0xee4f=['length','./voicePrefix.events','update','emit'];(function(_0x59a9cf,_0x48878b){var _0x25f1f3=function(_0x556319){while(--_0x556319){_0x59a9cf['push'](_0x59a9cf['shift']());}};_0x25f1f3(++_0x48878b);}(_0xee4f,0xad));var _0xfee4=function(_0x4425c3,_0x55b0c2){_0x4425c3=_0x4425c3-0x0;var _0x1f2459=_0xee4f[_0x4425c3];return _0x1f2459;};'use strict';var VoicePrefixEvents=require(_0xfee4('0x0'));var events=['save','remove',_0xfee4('0x1')];function createListener(_0x41b170,_0xf1acd6){return function(_0x5a03c9){_0xf1acd6[_0xfee4('0x2')](_0x41b170,_0x5a03c9);};}function removeListener(_0x5b9149,_0x27874a){return function(){VoicePrefixEvents['removeListener'](_0x5b9149,_0x27874a);};}exports['register']=function(_0x1c39b1){for(var _0x498647=0x0,_0x52fb6b=events[_0xfee4('0x3')];_0x498647<_0x52fb6b;_0x498647++){var _0x16cc9a=events[_0x498647];var _0x34908a=createListener('voicePrefix:'+_0x16cc9a,_0x1c39b1);VoicePrefixEvents['on'](_0x16cc9a,_0x34908a);}};
\ No newline at end of file
index 0374121..4480202 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8ac=['clone','/:id/teams','addTeams','addAgents','/:id/lists','addLists','put','update','delete','destroy','removeTeams','removeAgents','removeLists','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','/:id/hopper_histories','/:id/hopper_black','getHopperBlacks','getTeams','/:id/users','getAgents','getMembers','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone'];(function(_0x2e0a25,_0x2da7a6){var _0x359873=function(_0x47fb4b){while(--_0x47fb4b){_0x2e0a25['push'](_0x2e0a25['shift']());}};_0x359873(++_0x2da7a6);}(_0xc8ac,0x134));var _0xcc8a=function(_0x14d896,_0x53578b){_0x14d896=_0x14d896-0x0;var _0x28679a=_0xc8ac[_0x14d896];return _0x28679a;};'use strict';var multer=require(_0xcc8a('0x0'));var util=require(_0xcc8a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcc8a('0x2'));var router=express[_0xcc8a('0x3')]();var fs_extra=require(_0xcc8a('0x4'));var auth=require(_0xcc8a('0x5'));var interaction=require(_0xcc8a('0x6'));var config=require(_0xcc8a('0x7'));var controller=require(_0xcc8a('0x8'));router[_0xcc8a('0x9')]('/',auth[_0xcc8a('0xa')](),controller[_0xcc8a('0xb')]);router['get'](_0xcc8a('0xc'),auth[_0xcc8a('0xa')](),controller[_0xcc8a('0xd')]);router[_0xcc8a('0x9')](_0xcc8a('0xe'),auth['isAuthenticated'](),controller['getHoppers']);router[_0xcc8a('0x9')](_0xcc8a('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xcc8a('0x9')]('/:id/hopper_finals',auth['isAuthenticated'](),controller['getHopperFinals']);router[_0xcc8a('0x9')](_0xcc8a('0x10'),auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x11')]);router['get']('/:id/teams',auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x12')]);router['get'](_0xcc8a('0x13'),auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x14')]);router['get']('/:id/members',auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x15')]);router[_0xcc8a('0x9')]('/:id/lists',auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x16')]);router[_0xcc8a('0x9')](_0xcc8a('0x17'),auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x18')]);router[_0xcc8a('0x19')]('/',auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x1a')]);router[_0xcc8a('0x19')](_0xcc8a('0x1b'),auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x1c')]);router[_0xcc8a('0x19')](_0xcc8a('0x1d'),auth['isAuthenticated'](),controller[_0xcc8a('0x1e')]);router[_0xcc8a('0x19')](_0xcc8a('0x13'),auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x1f')]);router['post'](_0xcc8a('0x20'),auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x21')]);router['post'](_0xcc8a('0x17'),auth[_0xcc8a('0xa')](),controller['addBlackLists']);router[_0xcc8a('0x22')](_0xcc8a('0xc'),auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x23')]);router[_0xcc8a('0x24')](_0xcc8a('0xc'),auth['isAuthenticated'](),controller[_0xcc8a('0x25')]);router[_0xcc8a('0x24')](_0xcc8a('0x1d'),auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x26')]);router[_0xcc8a('0x24')](_0xcc8a('0x13'),auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x27')]);router[_0xcc8a('0x24')](_0xcc8a('0x20'),auth[_0xcc8a('0xa')](),controller[_0xcc8a('0x28')]);router['delete'](_0xcc8a('0x17'),auth[_0xcc8a('0xa')](),controller['removeBlackLists']);module[_0xcc8a('0x29')]=router;
\ No newline at end of file
+var _0x3727=['/:id/members','getMembers','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addLists','addBlackLists','put','destroy','delete','removeTeams','removeLists','removeBlackLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/users'];(function(_0x30cd2f,_0x2f5842){var _0x1abe44=function(_0x19713e){while(--_0x19713e){_0x30cd2f['push'](_0x30cd2f['shift']());}};_0x1abe44(++_0x2f5842);}(_0x3727,0x1b4));var _0x7372=function(_0x1a5b93,_0x1b86bf){_0x1a5b93=_0x1a5b93-0x0;var _0x3b9587=_0x3727[_0x1a5b93];return _0x3b9587;};'use strict';var multer=require(_0x7372('0x0'));var util=require('util');var path=require(_0x7372('0x1'));var timeout=require(_0x7372('0x2'));var express=require(_0x7372('0x3'));var router=express[_0x7372('0x4')]();var fs_extra=require(_0x7372('0x5'));var auth=require(_0x7372('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7372('0x7'));var controller=require(_0x7372('0x8'));router[_0x7372('0x9')]('/',auth[_0x7372('0xa')](),controller[_0x7372('0xb')]);router[_0x7372('0x9')](_0x7372('0xc'),auth[_0x7372('0xa')](),controller['show']);router['get'](_0x7372('0xd'),auth[_0x7372('0xa')](),controller[_0x7372('0xe')]);router[_0x7372('0x9')]('/:id/hopper_histories',auth[_0x7372('0xa')](),controller[_0x7372('0xf')]);router[_0x7372('0x9')](_0x7372('0x10'),auth[_0x7372('0xa')](),controller['getHopperFinals']);router[_0x7372('0x9')](_0x7372('0x11'),auth[_0x7372('0xa')](),controller[_0x7372('0x12')]);router[_0x7372('0x9')]('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router[_0x7372('0x9')](_0x7372('0x13'),auth['isAuthenticated'](),controller['getAgents']);router[_0x7372('0x9')](_0x7372('0x14'),auth[_0x7372('0xa')](),controller[_0x7372('0x15')]);router[_0x7372('0x9')]('/:id/lists',auth[_0x7372('0xa')](),controller[_0x7372('0x16')]);router[_0x7372('0x9')](_0x7372('0x17'),auth['isAuthenticated'](),controller[_0x7372('0x18')]);router[_0x7372('0x19')]('/',auth[_0x7372('0xa')](),controller[_0x7372('0x1a')]);router[_0x7372('0x19')](_0x7372('0x1b'),auth[_0x7372('0xa')](),controller['clone']);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0x7372('0x1c')]);router['post'](_0x7372('0x13'),auth[_0x7372('0xa')](),controller['addAgents']);router[_0x7372('0x19')]('/:id/lists',auth['isAuthenticated'](),controller[_0x7372('0x1d')]);router[_0x7372('0x19')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x7372('0x1e')]);router[_0x7372('0x1f')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x7372('0x20')]);router[_0x7372('0x21')]('/:id/teams',auth[_0x7372('0xa')](),controller[_0x7372('0x22')]);router[_0x7372('0x21')](_0x7372('0x13'),auth[_0x7372('0xa')](),controller['removeAgents']);router[_0x7372('0x21')]('/:id/lists',auth[_0x7372('0xa')](),controller[_0x7372('0x23')]);router[_0x7372('0x21')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x7372('0x24')]);module[_0x7372('0x25')]=router;
\ No newline at end of file
index d6989af..c434653 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe7ad=['leastrecent','linear','wrandom','rrordered','strategy','getDataValue','type','dialMethod','booked','rrmemory','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','setDataValue','periodic_announce','join','joinempty','split','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','STRING','ENUM','inbound','default','ringall'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe7ad,0x1b1));var _0xde7a=function(_0x2c4346,_0xb0c6fa){_0x2c4346=_0x2c4346-0x0;var _0x1b59dd=_0xe7ad[_0x2c4346];return _0x1b59dd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xde7a('0x0')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xde7a('0x1')](_0xde7a('0x2'),'outbound'),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0xde7a('0x0')],'defaultValue':_0xde7a('0x3')},'announce':{'type':Sequelize[_0xde7a('0x0')],'defaultValue':''},'strategy':{'type':Sequelize[_0xde7a('0x1')]('rr',_0xde7a('0x4'),_0xde7a('0x5'),'fewestcalls','random','rrmemory',_0xde7a('0x6'),_0xde7a('0x7'),_0xde7a('0x8')),'allowNull':![],'defaultValue':_0xde7a('0x4'),'set':function(_0xdc1360){this['setDataValue'](_0xde7a('0x9'),_0xdc1360?_0xdc1360:'rrmemory');},'get':function(){var _0x12b701=this[_0xde7a('0xa')](_0xde7a('0xb'));var _0x32c70c=this[_0xde7a('0xa')](_0xde7a('0xc'));var _0x16927=this['getDataValue']('strategy');if(_0x12b701===_0xde7a('0x2')){return _0x16927;}if(_0x32c70c===_0xde7a('0xd')&&_0x16927===_0xde7a('0xe')||_0x32c70c==='booked'&&_0x16927===_0xde7a('0xf')){return _0x16927;}if(_0x32c70c===_0xde7a('0x10')||_0x32c70c===_0xde7a('0x11')||_0x32c70c===_0xde7a('0x12')){return _0x16927;}return null;}},'servicelevel':{'type':Sequelize[_0xde7a('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xde7a('0x0')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0xde7a('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xde7a('0x13')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xde7a('0x0')]},'weight':{'type':Sequelize[_0xde7a('0x13')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xde7a('0x1')](_0xde7a('0x14'),'no'),'defaultValue':_0xde7a('0x14')},'autopause':{'type':Sequelize[_0xde7a('0x1')]('yes','no',_0xde7a('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xde7a('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0xde7a('0x1')](_0xde7a('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xde7a('0x1')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xde7a('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xde7a('0x1')](_0xde7a('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xde7a('0x1')](_0xde7a('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xde7a('0x1')](_0xde7a('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0xde7a('0x14'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xde7a('0x0')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xde7a('0x0')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xde7a('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xde7a('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xde7a('0x1')](_0xde7a('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xde7a('0x1')](_0xde7a('0x14'),'no'),'defaultValue':_0xde7a('0x14')},'announce_holdtime':{'type':Sequelize['ENUM']('yes','no',_0xde7a('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xde7a('0x0')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xde7a('0x1')](_0xde7a('0x14'),'no')},'announce_position_limit':{'type':Sequelize[_0xde7a('0x13')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xde7a('0x1')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xde7a('0x0')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xde7a('0x0')]},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xde7a('0x0')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xde7a('0x0')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xde7a('0x0')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xde7a('0x0')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xde7a('0x0')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xde7a('0x0')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xde7a('0x0')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0xde7a('0x0')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0xde7a('0x0')]},'periodic_announce':{'type':Sequelize[_0xde7a('0x17')],'set':function(_0x189641){this[_0xde7a('0x18')](_0xde7a('0x19'),_0x189641?_0x189641[_0xde7a('0x1a')](','):[]);},'get':function(){return this[_0xde7a('0xa')](_0xde7a('0x19'))?this[_0xde7a('0xa')](_0xde7a('0x19'))['split'](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0xde7a('0x14'),'set':function(_0x540419){this[_0xde7a('0x18')](_0xde7a('0x1b'),_0x540419?_0x540419[_0xde7a('0x1a')](','):undefined);},'get':function(){return this[_0xde7a('0xa')](_0xde7a('0x1b'))?this[_0xde7a('0xa')]('joinempty')[_0xde7a('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xde7a('0x0')],'defaultValue':'no','set':function(_0x2e6f91){this['setDataValue']('leavewhenempty',_0x2e6f91?_0x2e6f91['join'](','):undefined);},'get':function(){return this[_0xde7a('0xa')](_0xde7a('0x1d'))?this[_0xde7a('0xa')](_0xde7a('0x1d'))[_0xde7a('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0xde7a('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0xde7a('0x1')](_0xde7a('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xde7a('0x13')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xde7a('0x1')](_0xde7a('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xde7a('0x0')]},'description':{'type':Sequelize[_0xde7a('0x0')]},'acw':{'type':Sequelize[_0xde7a('0x1e')],'defaultValue':0x0,'set':function(_0x646cfa){this['setDataValue']('acw',_0x646cfa);if(_0x646cfa){if(this['getDataValue'](_0xde7a('0x1f'))<0x2){this[_0xde7a('0x18')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xde7a('0x1e')],'defaultValue':0x0,'comment':_0xde7a('0x20')},'dialMethod':{'type':Sequelize['ENUM'](_0xde7a('0x21'),_0xde7a('0x10'),_0xde7a('0x12'),'predictive',_0xde7a('0xd')),'defaultValue':_0xde7a('0x10'),'comment':_0xde7a('0x22')},'dialLimitChannel':{'type':Sequelize[_0xde7a('0x13')](0x4)[_0xde7a('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize[_0xde7a('0x13')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xde7a('0x24')},'dialPowerLevel':{'type':Sequelize[_0xde7a('0x25')](0x2)[_0xde7a('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xde7a('0x1')]('agentBusyFactor',_0xde7a('0x26')),'defaultValue':_0xde7a('0x26'),'comment':_0xde7a('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xde7a('0x25')](0x2)[_0xde7a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xde7a('0x28')},'dialPredictiveInterval':{'type':Sequelize[_0xde7a('0x13')](0x3)[_0xde7a('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xde7a('0x13')](0x3)[_0xde7a('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde7a('0x29')},'dialQueueOptions':{'type':Sequelize[_0xde7a('0x0')],'defaultValue':'tTxX','comment':_0xde7a('0x2a')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xde7a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde7a('0x2b')},'dialQueueProject':{'type':Sequelize[_0xde7a('0x0')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xde7a('0x13')](0x3)[_0xde7a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde7a('0x2c')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xde7a('0x13')](0x5)[_0xde7a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xde7a('0x13')](0x3)[_0xde7a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xde7a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde7a('0x2d')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xde7a('0x13')](0x3)[_0xde7a('0x23')],'defaultValue':0x3,'comment':_0xde7a('0x2e')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde7a('0x2f')},'dialGlobalMaxRetry':{'type':Sequelize[_0xde7a('0x13')](0x3)[_0xde7a('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xde7a('0x30')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xde7a('0x1')](_0xde7a('0x31'),'never',_0xde7a('0x32')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0xde7a('0x1e')],'defaultValue':0x0,'comment':_0xde7a('0x33')},'dialAMDInitialSilence':{'type':Sequelize[_0xde7a('0x13')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xde7a('0x13')](0x9)[_0xde7a('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xde7a('0x13')](0x9)[_0xde7a('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xde7a('0x13')](0x9)[_0xde7a('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xde7a('0x34')},'dialAMDMinWordLength':{'type':Sequelize[_0xde7a('0x13')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xde7a('0x35')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xde7a('0x13')](0x9)[_0xde7a('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xde7a('0x13')](0x9)[_0xde7a('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xde7a('0x36')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xde7a('0x13')](0x5)[_0xde7a('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xde7a('0x37')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xde7a('0x13')](0x9)[_0xde7a('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0xde7a('0x13')](0x5)[_0xde7a('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xde7a('0x38')},'dialRecallInQueue':{'type':Sequelize[_0xde7a('0x1e')],'defaultValue':0x0,'comment':_0xde7a('0x39')},'dialOrderByScheduledAt':{'type':Sequelize[_0xde7a('0x1')](_0xde7a('0x3a'),_0xde7a('0x3b')),'defaultValue':_0xde7a('0x3a')},'dialQueueProject2':{'type':Sequelize[_0xde7a('0x0')],'comment':_0xde7a('0x3c')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xde7a('0x1e')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xde7a('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xde7a('0x13')](0x3)[_0xde7a('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xde7a('0x3d')},'dialCutDigit':{'type':Sequelize[_0xde7a('0x13')](0x3)[_0xde7a('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xde7a('0x3e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xde7a('0x13')](0x3)[_0xde7a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde7a('0x3f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xde7a('0x13')](0x5)[_0xde7a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde7a('0x40')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xde7a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xde7a('0x13')](0x5)[_0xde7a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde7a('0x41')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xde7a('0x13')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde7a('0x42')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xde7a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde7a('0x43')},'dialMachineMaxRetry':{'type':Sequelize[_0xde7a('0x13')](0x3)[_0xde7a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xde7a('0x44')},'dialMachineRetryFrequency':{'type':Sequelize[_0xde7a('0x13')](0x5)[_0xde7a('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde7a('0x45')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xde7a('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xde7a('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xde7a('0x46')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xde7a('0x13')],'allowNull':!![],'comment':_0xde7a('0x47')},'mandatoryDisposition':{'type':Sequelize[_0xde7a('0x1e')],'defaultValue':![],'comment':_0xde7a('0x48'),'set':function(_0x258eaa){if(!_0x258eaa)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xde7a('0x18')]('mandatoryDisposition',_0x258eaa);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xde7a('0x13')](0x3)[_0xde7a('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xde7a('0x13')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
+var _0x8403=['Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,<project_name>)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\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\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','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)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','sequelize','exports','STRING','name','ENUM','inbound','outbound','ringall','leastrecent','fewestcalls','random','wrandom','rrordered','strategy','rrmemory','getDataValue','type','dialMethod','booked','roundrobin','progressive','power','INTEGER','yes','once','TEXT','setDataValue','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','Active/Disactive\x20Campaign','preview','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'];(function(_0x3a17ae,_0x4d8ccd){var _0x356279=function(_0x33a7f9){while(--_0x33a7f9){_0x3a17ae['push'](_0x3a17ae['shift']());}};_0x356279(++_0x4d8ccd);}(_0x8403,0x1a5));var _0x3840=function(_0x34070a,_0x11e6d7){_0x34070a=_0x34070a-0x0;var _0x550208=_0x8403[_0x34070a];return _0x550208;};'use strict';var Sequelize=require(_0x3840('0x0'));module[_0x3840('0x1')]={'name':{'type':Sequelize[_0x3840('0x2')],'allowNull':![],'unique':_0x3840('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x3840('0x4')](_0x3840('0x5'),_0x3840('0x6')),'allowNull':![],'defaultValue':_0x3840('0x5')},'musiconhold':{'type':Sequelize[_0x3840('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x3840('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x3840('0x4')]('rr',_0x3840('0x7'),_0x3840('0x8'),_0x3840('0x9'),_0x3840('0xa'),'rrmemory','linear',_0x3840('0xb'),_0x3840('0xc')),'allowNull':![],'defaultValue':_0x3840('0x7'),'set':function(_0x5351e8){this['setDataValue'](_0x3840('0xd'),_0x5351e8?_0x5351e8:_0x3840('0xe'));},'get':function(){var _0x24da73=this[_0x3840('0xf')](_0x3840('0x10'));var _0x320260=this[_0x3840('0xf')](_0x3840('0x11'));var _0x8ca446=this[_0x3840('0xf')]('strategy');if(_0x24da73===_0x3840('0x5')){return _0x8ca446;}if(_0x320260===_0x3840('0x12')&&_0x8ca446===_0x3840('0xe')||_0x320260==='booked'&&_0x8ca446===_0x3840('0x13')){return _0x8ca446;}if(_0x320260===_0x3840('0x14')||_0x320260==='predictive'||_0x320260===_0x3840('0x15')){return _0x8ca446;}return null;}},'servicelevel':{'type':Sequelize[_0x3840('0x16')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x3840('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x3840('0x16')](0xb)},'timeout':{'type':Sequelize[_0x3840('0x16')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x3840('0x16')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x3840('0x2')]},'weight':{'type':Sequelize[_0x3840('0x16')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x3840('0x16')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x3840('0x4')](_0x3840('0x17'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize['ENUM'](_0x3840('0x17'),'no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x3840('0x16')](0xb)},'autopausebusy':{'type':Sequelize[_0x3840('0x4')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x3840('0x17'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x3840('0x16')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x3840('0x4')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x3840('0x4')](_0x3840('0x17'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x3840('0x4')](_0x3840('0x17'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x3840('0x4')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x3840('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x3840('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x3840('0x16')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x3840('0x16')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x3840('0x4')](_0x3840('0x17'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x3840('0x4')](_0x3840('0x17'),'no'),'defaultValue':_0x3840('0x17')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x3840('0x17'),'no',_0x3840('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x3840('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x3840('0x4')]('yes','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[_0x3840('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x3840('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x3840('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x3840('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x3840('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x3840('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x3840('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x3840('0x2')]},'queue_quantity1':{'type':Sequelize[_0x3840('0x2')]},'queue_quantity2':{'type':Sequelize[_0x3840('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x3840('0x2')]},'queue_less_than':{'type':Sequelize[_0x3840('0x2')]},'periodic_announce':{'type':Sequelize[_0x3840('0x19')],'set':function(_0x4ff0db){this[_0x3840('0x1a')](_0x3840('0x1b'),_0x4ff0db?_0x4ff0db[_0x3840('0x1c')](','):[]);},'get':function(){return this[_0x3840('0xf')]('periodic_announce')?this['getDataValue'](_0x3840('0x1b'))[_0x3840('0x1d')](','):[];}},'joinempty':{'type':Sequelize[_0x3840('0x2')],'defaultValue':_0x3840('0x17'),'set':function(_0x571907){this[_0x3840('0x1a')]('joinempty',_0x571907?_0x571907[_0x3840('0x1c')](','):undefined);},'get':function(){return this['getDataValue'](_0x3840('0x1e'))?this[_0x3840('0xf')](_0x3840('0x1e'))[_0x3840('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x24b72){this[_0x3840('0x1a')](_0x3840('0x1f'),_0x24b72?_0x24b72['join'](','):undefined);},'get':function(){return this[_0x3840('0xf')](_0x3840('0x1f'))?this['getDataValue']('leavewhenempty')[_0x3840('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x3840('0x4')](_0x3840('0x17'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x3840('0x16')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x3840('0x4')](_0x3840('0x17'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x3840('0x20')],'defaultValue':0x0,'set':function(_0x8e705b){this[_0x3840('0x1a')]('acw',_0x8e705b);if(_0x8e705b){if(this[_0x3840('0xf')](_0x3840('0x21'))<0x2){this[_0x3840('0x1a')](_0x3840('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x3840('0x16')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x3840('0x20')],'defaultValue':0x0,'comment':_0x3840('0x22')},'dialMethod':{'type':Sequelize[_0x3840('0x4')](_0x3840('0x23'),'progressive','power',_0x3840('0x24'),_0x3840('0x12')),'defaultValue':'progressive','comment':_0x3840('0x25')},'dialLimitChannel':{'type':Sequelize[_0x3840('0x16')](0x4)[_0x3840('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3840('0x27')},'dialLimitQueue':{'type':Sequelize[_0x3840('0x16')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3840('0x28')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x3840('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x3840('0x29')},'dialPredictiveOptimization':{'type':Sequelize[_0x3840('0x4')](_0x3840('0x2a'),_0x3840('0x2b')),'defaultValue':'dropRate','comment':_0x3840('0x2c')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x3840('0x2d')](0x2)[_0x3840('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x3840('0x2e')},'dialPredictiveInterval':{'type':Sequelize[_0x3840('0x16')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x3840('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3840('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x3840('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3840('0x2f')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':'tTxX','comment':_0x3840('0x30')},'dialQueueTimeout':{'type':Sequelize[_0x3840('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x3840('0x2')],'comment':_0x3840('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x3840('0x16')](0x3)[_0x3840('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3840('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3840('0x16')](0x5)[_0x3840('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3840('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0x3840('0x16')](0x3)[_0x3840('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3840('0x34')},'dialBusyRetryFrequency':{'type':Sequelize[_0x3840('0x16')](0x5)[_0x3840('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3840('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x3840('0x16')](0x3)[_0x3840('0x26')],'defaultValue':0x3,'comment':_0x3840('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x3840('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3840('0x37')},'dialGlobalMaxRetry':{'type':Sequelize[_0x3840('0x16')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x3840('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3840('0x2')],'defaultValue':_0x3840('0x38')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x3840('0x4')](_0x3840('0x39'),_0x3840('0x3a'),_0x3840('0x3b')),'defaultValue':_0x3840('0x39')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x3840('0x3c')},'dialAMDInitialSilence':{'type':Sequelize[_0x3840('0x16')](0x9)[_0x3840('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3840('0x3d')},'dialAMDGreeting':{'type':Sequelize[_0x3840('0x16')](0x9)[_0x3840('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x3840('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3840('0x3e')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3840('0x16')](0x9)[_0x3840('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3840('0x3f')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x3840('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x3840('0x16')](0x9)[_0x3840('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3840('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3840('0x16')](0x9)[_0x3840('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3840('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3840('0x16')](0x5)[_0x3840('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x3840('0x42')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x3840('0x16')](0x9)[_0x3840('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x3840('0x16')](0x5)[_0x3840('0x26')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x3840('0x43')},'dialRecallInQueue':{'type':Sequelize[_0x3840('0x20')],'defaultValue':0x0,'comment':_0x3840('0x44')},'dialOrderByScheduledAt':{'type':Sequelize[_0x3840('0x4')](_0x3840('0x45'),_0x3840('0x46')),'defaultValue':_0x3840('0x45')},'dialQueueProject2':{'type':Sequelize[_0x3840('0x2')],'comment':_0x3840('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x3840('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x3840('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x3840('0x16')](0x3)[_0x3840('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3840('0x47')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x3840('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3840('0x48')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x3840('0x16')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3840('0x49')},'dialDropMaxRetry':{'type':Sequelize[_0x3840('0x16')](0x3)[_0x3840('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3840('0x4a')},'dialDropRetryFrequency':{'type':Sequelize[_0x3840('0x16')](0x5)[_0x3840('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x3840('0x16')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3840('0x4b')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x3840('0x16')](0x5)[_0x3840('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x3840('0x16')](0x3)[_0x3840('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x3840('0x16')](0x5)[_0x3840('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3840('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3840('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x3840('0x16')](0x5)[_0x3840('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3840('0x16')],'allowNull':!![],'comment':_0x3840('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0x3840('0x20')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x26383d){if(!_0x26383d)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x3840('0x1a')]('mandatoryDisposition',_0x26383d);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x3840('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x3840('0x26')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}};
\ No newline at end of file
index 4d03dbf..0838be8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0905=['role','VoiceQueues','outbound','UserProfileSection','UserProfileResource','error','clone','omit','body','createdAt','updatedAt','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CmHopper','nolimit','order','pick','CmHopperHistory','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','teams','User','Agents','online','flatMap','forEach','penalty','transaction','addTeams','TeamVoiceQueue','upsert','each','UserVoiceQueue','UserVoiceQueueRt','format','SIP/%s','interface','voicePause','emit','userVoiceQueue:save','ids','field','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','SELECT','every','includes','all','union','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','isNil','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','phone\x20NOT\x20IN\x20(?)','VoiceQueueId\x20=\x20?','onlyIfOpen','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueue.socket','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','inbound','QueueCampaigns','value','type','find','name','send','index','rawAttributes','fieldName','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','VoiceQueue','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x5900f7,_0x2cc78d){var _0xb09d2a=function(_0x3af23e){while(--_0x3af23e){_0x5900f7['push'](_0x5900f7['shift']());}};_0xb09d2a(++_0x2cc78d);}(_0x0905,0x11a));var _0x5090=function(_0x256fb2,_0x1b3364){_0x256fb2=_0x256fb2-0x0;var _0x3dd360=_0x0905[_0x256fb2];return _0x3dd360;};'use strict';var emlformat=require(_0x5090('0x0'));var rimraf=require(_0x5090('0x1'));var zipdir=require(_0x5090('0x2'));var jsonpatch=require(_0x5090('0x3'));var rp=require(_0x5090('0x4'));var moment=require(_0x5090('0x5'));var BPromise=require(_0x5090('0x6'));var Mustache=require(_0x5090('0x7'));var util=require(_0x5090('0x8'));var path=require(_0x5090('0x9'));var sox=require('sox');var csv=require(_0x5090('0xa'));var ejs=require(_0x5090('0xb'));var fs=require('fs');var fs_extra=require(_0x5090('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x5090('0xd'));var jsforce=require(_0x5090('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5090('0xa'));var querystring=require(_0x5090('0xf'));var Papa=require(_0x5090('0x10'));var Redis=require('ioredis');var authService=require(_0x5090('0x11'));var qs=require(_0x5090('0x12'));var as=require(_0x5090('0x13'));var hardwareService=require(_0x5090('0x14'));var logger=require('../../config/logger')(_0x5090('0x15'));var utils=require('../../config/utils');var config=require(_0x5090('0x16'));var licenseUtil=require(_0x5090('0x17'));var db=require(_0x5090('0x18'))['db'];config[_0x5090('0x19')]=_[_0x5090('0x1a')](config[_0x5090('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x5090('0x1b'))(new Redis(config[_0x5090('0x19')]));require(_0x5090('0x1c'))['register'](socket);function respondWithStatusCode(_0x91a6e2,_0x2611db){_0x2611db=_0x2611db||0xcc;return function(_0x3082dc){if(_0x3082dc){return _0x91a6e2[_0x5090('0x1d')](_0x2611db);}return _0x91a6e2[_0x5090('0x1e')](_0x2611db)[_0x5090('0x1f')]();};}function respondWithResult(_0x473e30,_0x12979c){_0x12979c=_0x12979c||0xc8;return function(_0x308958){if(_0x308958){return _0x473e30['status'](_0x12979c)[_0x5090('0x20')](_0x308958);}};}function respondWithFilteredResult(_0x1d9486,_0x3a59ce){return function(_0x52ed38){if(_0x52ed38){var _0x5ee8da=typeof _0x3a59ce[_0x5090('0x21')]==='undefined'&&typeof _0x3a59ce[_0x5090('0x22')]==='undefined';var _0x42fba3=_0x52ed38[_0x5090('0x23')];var _0x1bbbe6=_0x5ee8da?0x0:_0x3a59ce[_0x5090('0x21')];var _0x1d5bf4=_0x5ee8da?_0x52ed38[_0x5090('0x23')]:_0x3a59ce['offset']+_0x3a59ce[_0x5090('0x22')];var _0x10b134;if(_0x1d5bf4>=_0x42fba3){_0x1d5bf4=_0x42fba3;_0x10b134=0xc8;}else{_0x10b134=0xce;}_0x1d9486[_0x5090('0x1e')](_0x10b134);return _0x1d9486['set'](_0x5090('0x24'),_0x1bbbe6+'-'+_0x1d5bf4+'/'+_0x42fba3)[_0x5090('0x20')](_0x52ed38);}return null;};}function patchUpdates(_0x1a9226){return function(_0x3b764d){try{jsonpatch[_0x5090('0x25')](_0x3b764d,_0x1a9226,!![]);}catch(_0x3cff02){return BPromise[_0x5090('0x26')](_0x3cff02);}return _0x3b764d[_0x5090('0x27')]();};}function saveUpdates(_0x32d3b2,_0x332667){return function(_0x5796ea){if(_0x5796ea){return _0x5796ea[_0x5090('0x28')](_0x32d3b2)[_0x5090('0x29')](function(_0x5504fb){return _0x5504fb;});}return null;};}function removeEntity(_0x217349,_0x1d9b26){return function(_0x53b20f){if(_0x53b20f){return _0x53b20f[_0x5090('0x2a')]()[_0x5090('0x29')](function(){var _0x4bbdf8=_0x53b20f[_0x5090('0x2b')]({'plain':!![]});var _0x2993d9=[{'name':'VoiceQueues','value':_0x5090('0x2c'),'ignore':![]},{'name':_0x5090('0x2d'),'value':'outbound','ignore':![]}];var _0x31cdfb=_(_0x2993d9)['filter']('ignore')['map']('value')[_0x5090('0x2e')]();if(_['includes'](_0x31cdfb,_0x4bbdf8[_0x5090('0x2f')])){return;}var _0x581b30=_[_0x5090('0x30')](_0x2993d9,['value',_0x4bbdf8[_0x5090('0x2f')]])[_0x5090('0x31')];return db['UserProfileResource']['destroy']({'where':{'type':_0x581b30,'resourceId':_0x4bbdf8['id']}})['then'](function(){return _0x53b20f;});})[_0x5090('0x29')](function(){_0x217349[_0x5090('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45c4,_0x255af3){return function(_0x4a2ac0){if(!_0x4a2ac0){_0x45c4[_0x5090('0x1d')](0x194);}return _0x4a2ac0;};}function handleError(_0x1c4777,_0xcb8da6){_0xcb8da6=_0xcb8da6||0x1f4;return function(_0x520ecf){logger['error'](_0x520ecf['stack']);if(_0x520ecf[_0x5090('0x31')]){delete _0x520ecf['name'];}_0x1c4777[_0x5090('0x1e')](_0xcb8da6)[_0x5090('0x32')](_0x520ecf);};}exports[_0x5090('0x33')]=function(_0x516806,_0x213044){var _0x17fb2b={},_0x54f30d={},_0x5de55a={'count':0x0,'rows':[]};var _0x2dda23=_['map'](db['VoiceQueue'][_0x5090('0x34')],function(_0x3168b0){return{'name':_0x3168b0[_0x5090('0x35')],'type':_0x3168b0[_0x5090('0x2f')]['key']};});_0x54f30d[_0x5090('0x36')]=_[_0x5090('0x37')](_0x2dda23,_0x5090('0x31'));_0x54f30d['query']=_['keys'](_0x516806[_0x5090('0x38')]);_0x54f30d[_0x5090('0x39')]=_[_0x5090('0x3a')](_0x54f30d['model'],_0x54f30d[_0x5090('0x38')]);_0x17fb2b['attributes']=_[_0x5090('0x3a')](_0x54f30d[_0x5090('0x36')],qs[_0x5090('0x3b')](_0x516806['query'][_0x5090('0x3b')]));_0x17fb2b['attributes']=_0x17fb2b[_0x5090('0x3c')][_0x5090('0x3d')]?_0x17fb2b[_0x5090('0x3c')]:_0x54f30d[_0x5090('0x36')];if(!_0x516806[_0x5090('0x38')][_0x5090('0x3e')]('nolimit')){_0x17fb2b[_0x5090('0x22')]=qs[_0x5090('0x22')](_0x516806[_0x5090('0x38')][_0x5090('0x22')]);_0x17fb2b[_0x5090('0x21')]=qs[_0x5090('0x21')](_0x516806[_0x5090('0x38')]['offset']);}_0x17fb2b['order']=qs[_0x5090('0x3f')](_0x516806[_0x5090('0x38')][_0x5090('0x3f')]);_0x17fb2b[_0x5090('0x40')]=qs['filters'](_['pick'](_0x516806[_0x5090('0x38')],_0x54f30d[_0x5090('0x39')]),_0x2dda23);if(_0x516806['query'][_0x5090('0x41')]){_0x17fb2b['where']=_[_0x5090('0x42')](_0x17fb2b[_0x5090('0x40')],{'$or':_[_0x5090('0x37')](_0x2dda23,function(_0x2a3284){if(_0x2a3284[_0x5090('0x2f')]!==_0x5090('0x43')){var _0x4b6510={};_0x4b6510[_0x2a3284['name']]={'$like':'%'+_0x516806[_0x5090('0x38')]['filter']+'%'};return _0x4b6510;}})});}_0x17fb2b=_[_0x5090('0x42')]({},_0x17fb2b,_0x516806['options']);var _0xf2defd={'where':_0x17fb2b[_0x5090('0x40')]};return db['VoiceQueue']['count'](_0xf2defd)[_0x5090('0x29')](function(_0x18ac9f){_0x5de55a[_0x5090('0x23')]=_0x18ac9f;if(_0x516806[_0x5090('0x38')][_0x5090('0x44')]){_0x17fb2b[_0x5090('0x45')]=[{'all':!![]}];}return db['VoiceQueue'][_0x5090('0x46')](_0x17fb2b);})['then'](function(_0x599716){_0x5de55a[_0x5090('0x47')]=_0x599716;return _0x5de55a;})[_0x5090('0x29')](respondWithFilteredResult(_0x213044,_0x17fb2b))[_0x5090('0x48')](handleError(_0x213044,null));};exports['show']=function(_0x34a3ef,_0x5a9d40){var _0x1ba08c={'raw':![],'where':{'id':_0x34a3ef[_0x5090('0x49')]['id']}},_0xc09421={};_0xc09421['model']=_[_0x5090('0x4a')](db[_0x5090('0x4b')][_0x5090('0x34')]);_0xc09421[_0x5090('0x38')]=_[_0x5090('0x4a')](_0x34a3ef[_0x5090('0x38')]);_0xc09421['filters']=_[_0x5090('0x3a')](_0xc09421[_0x5090('0x36')],_0xc09421[_0x5090('0x38')]);_0x1ba08c[_0x5090('0x3c')]=_[_0x5090('0x3a')](_0xc09421[_0x5090('0x36')],qs['fields'](_0x34a3ef['query']['fields']));_0x1ba08c[_0x5090('0x3c')]=_0x1ba08c['attributes'][_0x5090('0x3d')]?_0x1ba08c[_0x5090('0x3c')]:_0xc09421['model'];if(_0x34a3ef['query'][_0x5090('0x44')]){_0x1ba08c[_0x5090('0x45')]=[{'all':!![]}];}_0x1ba08c=_[_0x5090('0x42')]({},_0x1ba08c,_0x34a3ef[_0x5090('0x4c')]);return db[_0x5090('0x4b')][_0x5090('0x30')](_0x1ba08c)[_0x5090('0x29')](handleEntityNotFound(_0x5a9d40,null))[_0x5090('0x29')](respondWithResult(_0x5a9d40,null))[_0x5090('0x48')](handleError(_0x5a9d40,null));};exports[_0x5090('0x4d')]=function(_0x1856b6,_0x5741c8){return db[_0x5090('0x4b')]['create'](_0x1856b6['body'],{})[_0x5090('0x29')](function(_0x45f4ab){var _0x26b78c=_0x1856b6[_0x5090('0x4e')][_0x5090('0x2b')]({'plain':!![]});if(!_0x26b78c)throw new Error(_0x5090('0x4f'));if(_0x26b78c[_0x5090('0x50')]==='user'){var _0x2bec34=_0x45f4ab[_0x5090('0x2b')]({'plain':!![]});var _0x65db88=[{'name':_0x5090('0x51'),'value':_0x5090('0x2c')},{'name':_0x5090('0x2d'),'value':_0x5090('0x52')}];var _0x5be266=_[_0x5090('0x30')](_0x65db88,['value',_0x2bec34[_0x5090('0x2f')]])['name'];return db[_0x5090('0x53')][_0x5090('0x30')]({'where':{'name':_0x5be266,'userProfileId':_0x26b78c['userProfileId']},'raw':!![]})[_0x5090('0x29')](function(_0x3c94f4){if(_0x3c94f4&&_0x3c94f4['autoAssociation']===0x0){return db[_0x5090('0x54')][_0x5090('0x4d')]({'name':_0x2bec34[_0x5090('0x31')],'resourceId':_0x2bec34['id'],'type':_0x3c94f4[_0x5090('0x31')],'sectionId':_0x3c94f4['id']},{})[_0x5090('0x29')](function(){return _0x45f4ab;});}else{return _0x45f4ab;}})[_0x5090('0x48')](function(_0x31d3f4){logger[_0x5090('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31d3f4);throw _0x31d3f4;});}return _0x45f4ab;})[_0x5090('0x29')](respondWithResult(_0x5741c8,0xc9))[_0x5090('0x48')](handleError(_0x5741c8,null));};exports[_0x5090('0x56')]=function(_0x45a2cd,_0x46422f){var _0x3bd964={'where':{'id':_0x45a2cd['params']['id']}},_0x31dfd5={};_0x31dfd5[_0x5090('0x36')]=_[_0x5090('0x4a')](db['VoiceQueue']['rawAttributes']);_0x3bd964[_0x5090('0x3c')]=_['intersection'](_0x31dfd5[_0x5090('0x36')],qs[_0x5090('0x3b')](_0x45a2cd[_0x5090('0x38')][_0x5090('0x3b')]));_0x3bd964['attributes']=_0x3bd964[_0x5090('0x3c')][_0x5090('0x3d')]?_0x3bd964[_0x5090('0x3c')]:_0x31dfd5[_0x5090('0x36')];if(_0x45a2cd[_0x5090('0x38')]['includeAll']){_0x3bd964[_0x5090('0x45')]=[{'all':!![]}];}_0x3bd964=_[_0x5090('0x42')]({},_0x3bd964,_0x45a2cd[_0x5090('0x4c')]);return db[_0x5090('0x4b')][_0x5090('0x30')](_0x3bd964)[_0x5090('0x29')](handleEntityNotFound(_0x46422f,null))[_0x5090('0x29')](function(_0x217851){if(_0x217851){var _0x1c4c98=_0x217851['get']({'plain':!![]});_0x1c4c98=qs[_0x5090('0x57')](_0x1c4c98,['id','createdAt','updatedAt']);_0x45a2cd[_0x5090('0x58')]=_[_0x5090('0x57')](_0x45a2cd[_0x5090('0x58')],['id',_0x5090('0x59'),_0x5090('0x5a')]);return db[_0x5090('0x4b')][_0x5090('0x4d')](_[_0x5090('0x42')](_0x1c4c98,_0x45a2cd[_0x5090('0x58')]),{'include':_0x45a2cd[_0x5090('0x38')][_0x5090('0x44')]?[{'all':!![]}]:undefined})[_0x5090('0x29')](function(_0x16ee14){var _0x2c62ad=_0x45a2cd['user'][_0x5090('0x2b')]({'plain':!![]});if(!_0x2c62ad)throw new Error(_0x5090('0x4f'));if(_0x2c62ad['role']===_0x5090('0x4e')){var _0xcf5131=_0x16ee14[_0x5090('0x2b')]({'plain':!![]});var _0x3dac62=[{'name':_0x5090('0x51'),'value':'inbound'},{'name':_0x5090('0x2d'),'value':'outbound'}];var _0x305e99=_[_0x5090('0x30')](_0x3dac62,['value',_0xcf5131[_0x5090('0x2f')]])['name'];return db[_0x5090('0x53')][_0x5090('0x30')]({'where':{'name':_0x305e99,'userProfileId':_0x2c62ad[_0x5090('0x5b')]},'raw':!![]})[_0x5090('0x29')](function(_0x27e408){if(_0x27e408&&_0x27e408['autoAssociation']===0x0){return db[_0x5090('0x54')][_0x5090('0x4d')]({'name':_0xcf5131[_0x5090('0x31')],'resourceId':_0xcf5131['id'],'type':_0x27e408[_0x5090('0x31')],'sectionId':_0x27e408['id']},{})['then'](function(){return _0x16ee14;});}else{return _0x16ee14;}})[_0x5090('0x48')](function(_0x465415){logger[_0x5090('0x55')](_0x5090('0x5c'),_0x465415);throw _0x465415;});}return _0x16ee14;});}})['then'](respondWithResult(_0x46422f,0xc9))[_0x5090('0x48')](handleError(_0x46422f,null));};exports['update']=function(_0xfcf371,_0x555154){if(_0xfcf371[_0x5090('0x58')]['id']){delete _0xfcf371['body']['id'];}return db[_0x5090('0x4b')][_0x5090('0x30')]({'where':{'id':_0xfcf371[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x555154,null))['then'](saveUpdates(_0xfcf371['body'],null))['then'](respondWithResult(_0x555154,null))[_0x5090('0x48')](handleError(_0x555154,null));};exports[_0x5090('0x2a')]=function(_0x22bc1d,_0x255726){return db[_0x5090('0x4b')]['find']({'where':{'id':_0x22bc1d[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x255726,null))[_0x5090('0x29')](removeEntity(_0x255726,null))[_0x5090('0x48')](handleError(_0x255726,null));};exports['getHoppers']=function(_0x2cada7,_0x1d2348,_0x16203a){var _0x3486ea={'raw':![],'where':{}};var _0x2b4117={};var _0x40d94a={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x5090('0x5d')]({'where':{'id':_0x2cada7[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x1d2348,null))[_0x5090('0x29')](function(_0x187e93){if(_0x187e93){_0x2b4117[_0x5090('0x36')]=_[_0x5090('0x4a')](db[_0x5090('0x5e')][_0x5090('0x34')]);_0x2b4117['query']=_[_0x5090('0x4a')](_0x2cada7['query']);_0x2b4117['filters']=_[_0x5090('0x3a')](_0x2b4117['model'],_0x2b4117['query']);_0x3486ea[_0x5090('0x3c')]=_[_0x5090('0x3a')](_0x2b4117[_0x5090('0x36')],qs['fields'](_0x2cada7[_0x5090('0x38')]['fields']));_0x3486ea[_0x5090('0x3c')]=_0x3486ea['attributes'][_0x5090('0x3d')]?_0x3486ea[_0x5090('0x3c')]:_0x2b4117[_0x5090('0x36')];if(!_0x2cada7[_0x5090('0x38')][_0x5090('0x3e')](_0x5090('0x5f'))){_0x3486ea['limit']=qs[_0x5090('0x22')](_0x2cada7['query'][_0x5090('0x22')]);_0x3486ea[_0x5090('0x21')]=qs['offset'](_0x2cada7[_0x5090('0x38')][_0x5090('0x21')]);}_0x3486ea[_0x5090('0x60')]=qs[_0x5090('0x3f')](_0x2cada7[_0x5090('0x38')][_0x5090('0x3f')]);_0x3486ea[_0x5090('0x40')]=qs[_0x5090('0x39')](_[_0x5090('0x61')](_0x2cada7[_0x5090('0x38')],_0x2b4117['filters']));_0x3486ea[_0x5090('0x40')]['VoiceQueueId']=_0x187e93['id'];if(_0x2cada7[_0x5090('0x38')][_0x5090('0x41')]){_0x3486ea[_0x5090('0x40')]=_[_0x5090('0x42')](_0x3486ea[_0x5090('0x40')],{'$or':_['map'](_0x3486ea['attributes'],function(_0x2f0b49){var _0x33d2cc={};_0x33d2cc[_0x2f0b49]={'$like':'%'+_0x2cada7[_0x5090('0x38')][_0x5090('0x41')]+'%'};return _0x33d2cc;})});}_0x3486ea=_[_0x5090('0x42')]({},_0x3486ea,_0x2cada7[_0x5090('0x4c')]);return db[_0x5090('0x5e')][_0x5090('0x23')]({'where':_0x3486ea[_0x5090('0x40')]})[_0x5090('0x29')](function(_0x2c3cce){_0x40d94a['count']=_0x2c3cce;if(_0x2cada7['query'][_0x5090('0x44')]){_0x3486ea[_0x5090('0x45')]=[{'all':!![]}];}return db['CmHopper'][_0x5090('0x46')](_0x3486ea);})['then'](function(_0x1ae289){_0x40d94a[_0x5090('0x47')]=_0x1ae289;return _0x40d94a;});}})[_0x5090('0x29')](respondWithFilteredResult(_0x1d2348,_0x3486ea))[_0x5090('0x48')](handleError(_0x1d2348,null));};exports['getHopperHistories']=function(_0xffd43,_0x184446,_0x4e87a5){var _0xc2b003={'raw':!![],'where':{}};var _0x183a46={};var _0x244971={'count':0x0,'rows':[]};return db['VoiceQueue']['findOne']({'where':{'id':_0xffd43[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x184446,null))[_0x5090('0x29')](function(_0x154d4f){if(_0x154d4f){_0x183a46['model']=_[_0x5090('0x4a')](db[_0x5090('0x62')][_0x5090('0x34')]);_0x183a46['query']=_[_0x5090('0x4a')](_0xffd43[_0x5090('0x38')]);_0x183a46['filters']=_['intersection'](_0x183a46[_0x5090('0x36')],_0x183a46[_0x5090('0x38')]);_0xc2b003[_0x5090('0x3c')]=_[_0x5090('0x3a')](_0x183a46['model'],qs[_0x5090('0x3b')](_0xffd43[_0x5090('0x38')][_0x5090('0x3b')]));_0xc2b003[_0x5090('0x3c')]=_0xc2b003[_0x5090('0x3c')][_0x5090('0x3d')]?_0xc2b003['attributes']:_0x183a46[_0x5090('0x36')];if(!_0xffd43[_0x5090('0x38')][_0x5090('0x3e')](_0x5090('0x5f'))){_0xc2b003[_0x5090('0x22')]=qs[_0x5090('0x22')](_0xffd43[_0x5090('0x38')][_0x5090('0x22')]);_0xc2b003[_0x5090('0x21')]=qs[_0x5090('0x21')](_0xffd43[_0x5090('0x38')][_0x5090('0x21')]);}_0xc2b003[_0x5090('0x60')]=qs['sort'](_0xffd43[_0x5090('0x38')][_0x5090('0x3f')]);_0xc2b003[_0x5090('0x40')]=qs[_0x5090('0x39')](_['pick'](_0xffd43['query'],_0x183a46[_0x5090('0x39')]));_0xc2b003['where'][_0x5090('0x63')]=_0x154d4f['id'];if(_0xffd43[_0x5090('0x38')]['filter']){_0xc2b003[_0x5090('0x40')]=_[_0x5090('0x42')](_0xc2b003[_0x5090('0x40')],{'$or':_['map'](_0xc2b003[_0x5090('0x3c')],function(_0x21757b){var _0x550b82={};_0x550b82[_0x21757b]={'$like':'%'+_0xffd43[_0x5090('0x38')][_0x5090('0x41')]+'%'};return _0x550b82;})});}_0xc2b003=_[_0x5090('0x42')]({},_0xc2b003,_0xffd43[_0x5090('0x4c')]);return db[_0x5090('0x62')]['count']({'where':_0xc2b003['where']})[_0x5090('0x29')](function(_0x42dcc4){_0x244971['count']=_0x42dcc4;if(_0xffd43[_0x5090('0x38')][_0x5090('0x44')]){_0xc2b003[_0x5090('0x45')]=[{'all':!![]}];}return db[_0x5090('0x62')][_0x5090('0x46')](_0xc2b003);})[_0x5090('0x29')](function(_0x36a1af){_0x244971['rows']=_0x36a1af;return _0x244971;});}})[_0x5090('0x29')](respondWithFilteredResult(_0x184446,_0xc2b003))[_0x5090('0x48')](handleError(_0x184446,null));};exports[_0x5090('0x64')]=function(_0x1c340b,_0x3194a8,_0x2ea6f5){var _0x550859={'raw':!![],'where':{}};var _0x545ff4={};var _0x4259b9={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x5090('0x5d')]({'where':{'id':_0x1c340b[_0x5090('0x49')]['id']}})['then'](handleEntityNotFound(_0x3194a8,null))[_0x5090('0x29')](function(_0x31aa1e){if(_0x31aa1e){_0x545ff4[_0x5090('0x36')]=_[_0x5090('0x4a')](db['CmHopperFinal']['rawAttributes']);_0x545ff4[_0x5090('0x38')]=_[_0x5090('0x4a')](_0x1c340b[_0x5090('0x38')]);_0x545ff4[_0x5090('0x39')]=_[_0x5090('0x3a')](_0x545ff4[_0x5090('0x36')],_0x545ff4[_0x5090('0x38')]);_0x550859[_0x5090('0x3c')]=_[_0x5090('0x3a')](_0x545ff4[_0x5090('0x36')],qs[_0x5090('0x3b')](_0x1c340b[_0x5090('0x38')]['fields']));_0x550859[_0x5090('0x3c')]=_0x550859['attributes'][_0x5090('0x3d')]?_0x550859[_0x5090('0x3c')]:_0x545ff4[_0x5090('0x36')];if(!_0x1c340b[_0x5090('0x38')]['hasOwnProperty']('nolimit')){_0x550859[_0x5090('0x22')]=qs['limit'](_0x1c340b[_0x5090('0x38')][_0x5090('0x22')]);_0x550859[_0x5090('0x21')]=qs['offset'](_0x1c340b[_0x5090('0x38')][_0x5090('0x21')]);}_0x550859[_0x5090('0x60')]=qs[_0x5090('0x3f')](_0x1c340b[_0x5090('0x38')][_0x5090('0x3f')]);_0x550859['where']=qs[_0x5090('0x39')](_[_0x5090('0x61')](_0x1c340b['query'],_0x545ff4[_0x5090('0x39')]));_0x550859[_0x5090('0x40')]['VoiceQueueId']=_0x31aa1e['id'];if(_0x1c340b[_0x5090('0x38')][_0x5090('0x41')]){_0x550859[_0x5090('0x40')]=_[_0x5090('0x42')](_0x550859[_0x5090('0x40')],{'$or':_[_0x5090('0x37')](_0x550859[_0x5090('0x3c')],function(_0x35c4c6){var _0x476b2d={};_0x476b2d[_0x35c4c6]={'$like':'%'+_0x1c340b[_0x5090('0x38')][_0x5090('0x41')]+'%'};return _0x476b2d;})});}_0x550859=_[_0x5090('0x42')]({},_0x550859,_0x1c340b[_0x5090('0x4c')]);return db['CmHopperFinal'][_0x5090('0x23')]({'where':_0x550859[_0x5090('0x40')]})[_0x5090('0x29')](function(_0x337cb7){_0x4259b9[_0x5090('0x23')]=_0x337cb7;if(_0x1c340b[_0x5090('0x38')][_0x5090('0x44')]){_0x550859[_0x5090('0x45')]=[{'all':!![]}];}return db[_0x5090('0x65')][_0x5090('0x46')](_0x550859);})['then'](function(_0x407598){_0x4259b9[_0x5090('0x47')]=_0x407598;return _0x4259b9;});}})[_0x5090('0x29')](respondWithFilteredResult(_0x3194a8,_0x550859))[_0x5090('0x48')](handleError(_0x3194a8,null));};exports[_0x5090('0x66')]=function(_0x5a1de4,_0x4480f1,_0x1a0fc5){var _0x332bf1={'raw':!![],'where':{}};var _0x31c2b7={};var _0x2dc820={'count':0x0,'rows':[]};return db[_0x5090('0x4b')][_0x5090('0x5d')]({'where':{'id':_0x5a1de4[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x4480f1,null))[_0x5090('0x29')](function(_0x49ec13){if(_0x49ec13){_0x31c2b7[_0x5090('0x36')]=_[_0x5090('0x4a')](db[_0x5090('0x67')][_0x5090('0x34')]);_0x31c2b7[_0x5090('0x38')]=_[_0x5090('0x4a')](_0x5a1de4['query']);_0x31c2b7[_0x5090('0x39')]=_[_0x5090('0x3a')](_0x31c2b7[_0x5090('0x36')],_0x31c2b7[_0x5090('0x38')]);_0x332bf1[_0x5090('0x3c')]=_[_0x5090('0x3a')](_0x31c2b7[_0x5090('0x36')],qs[_0x5090('0x3b')](_0x5a1de4[_0x5090('0x38')][_0x5090('0x3b')]));_0x332bf1[_0x5090('0x3c')]=_0x332bf1[_0x5090('0x3c')][_0x5090('0x3d')]?_0x332bf1[_0x5090('0x3c')]:_0x31c2b7[_0x5090('0x36')];if(!_0x5a1de4[_0x5090('0x38')][_0x5090('0x3e')](_0x5090('0x5f'))){_0x332bf1[_0x5090('0x22')]=qs[_0x5090('0x22')](_0x5a1de4[_0x5090('0x38')]['limit']);_0x332bf1[_0x5090('0x21')]=qs[_0x5090('0x21')](_0x5a1de4[_0x5090('0x38')][_0x5090('0x21')]);}_0x332bf1[_0x5090('0x60')]=qs['sort'](_0x5a1de4['query'][_0x5090('0x3f')]);_0x332bf1[_0x5090('0x40')]=qs[_0x5090('0x39')](_[_0x5090('0x61')](_0x5a1de4[_0x5090('0x38')],_0x31c2b7[_0x5090('0x39')]));_0x332bf1['where'][_0x5090('0x63')]=_0x49ec13['id'];if(_0x5a1de4[_0x5090('0x38')][_0x5090('0x41')]){_0x332bf1[_0x5090('0x40')]=_['merge'](_0x332bf1[_0x5090('0x40')],{'$or':_[_0x5090('0x37')](_0x332bf1['attributes'],function(_0x437b37){var _0x4e0bc9={};_0x4e0bc9[_0x437b37]={'$like':'%'+_0x5a1de4[_0x5090('0x38')][_0x5090('0x41')]+'%'};return _0x4e0bc9;})});}_0x332bf1=_['merge']({},_0x332bf1,_0x5a1de4[_0x5090('0x4c')]);return db[_0x5090('0x67')][_0x5090('0x23')]({'where':_0x332bf1['where']})[_0x5090('0x29')](function(_0x4a02fb){_0x2dc820['count']=_0x4a02fb;if(_0x5a1de4['query'][_0x5090('0x44')]){_0x332bf1[_0x5090('0x45')]=[{'all':!![]}];}return db[_0x5090('0x67')][_0x5090('0x46')](_0x332bf1);})[_0x5090('0x29')](function(_0x541123){_0x2dc820[_0x5090('0x47')]=_0x541123;return _0x2dc820;});}})[_0x5090('0x29')](respondWithFilteredResult(_0x4480f1,_0x332bf1))[_0x5090('0x48')](handleError(_0x4480f1,null));};exports['getTeams']=function(_0x3fffa8,_0x35ca84,_0x19bf7f){var _0x440870={};var _0x5770b7={};var _0x23f0d8;var _0x1687e5;return db['VoiceQueue'][_0x5090('0x5d')]({'where':{'id':_0x3fffa8[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x35ca84,null))[_0x5090('0x29')](function(_0xfdd691){if(_0xfdd691){_0x23f0d8=_0xfdd691;_0x5770b7['model']=_['keys'](db[_0x5090('0x68')][_0x5090('0x34')]);_0x5770b7[_0x5090('0x38')]=_[_0x5090('0x4a')](_0x3fffa8['query']);_0x5770b7[_0x5090('0x39')]=_['intersection'](_0x5770b7[_0x5090('0x36')],_0x5770b7[_0x5090('0x38')]);_0x440870[_0x5090('0x3c')]=_[_0x5090('0x3a')](_0x5770b7[_0x5090('0x36')],qs[_0x5090('0x3b')](_0x3fffa8[_0x5090('0x38')]['fields']));_0x440870[_0x5090('0x3c')]=_0x440870['attributes'][_0x5090('0x3d')]?_0x440870[_0x5090('0x3c')]:_0x5770b7[_0x5090('0x36')];_0x440870[_0x5090('0x60')]=qs[_0x5090('0x3f')](_0x3fffa8[_0x5090('0x38')][_0x5090('0x3f')]);_0x440870[_0x5090('0x40')]=qs[_0x5090('0x39')](_[_0x5090('0x61')](_0x3fffa8[_0x5090('0x38')],_0x5770b7[_0x5090('0x39')]));if(_0x3fffa8[_0x5090('0x38')]['filter']){_0x440870[_0x5090('0x40')]=_['merge'](_0x440870[_0x5090('0x40')],{'$or':_[_0x5090('0x37')](_0x440870[_0x5090('0x3c')],function(_0x423d77){var _0x87a615={};_0x87a615[_0x423d77]={'$like':'%'+_0x3fffa8[_0x5090('0x38')][_0x5090('0x41')]+'%'};return _0x87a615;})});}_0x440870=_['merge']({},_0x440870,_0x3fffa8[_0x5090('0x4c')]);return _0x23f0d8[_0x5090('0x69')](_0x440870);}})[_0x5090('0x29')](function(_0x377aed){if(_0x377aed){_0x1687e5=_0x377aed[_0x5090('0x3d')];if(!_0x3fffa8[_0x5090('0x38')][_0x5090('0x3e')]('nolimit')){_0x440870['limit']=qs[_0x5090('0x22')](_0x3fffa8[_0x5090('0x38')][_0x5090('0x22')]);_0x440870['offset']=qs[_0x5090('0x21')](_0x3fffa8[_0x5090('0x38')]['offset']);}return _0x23f0d8[_0x5090('0x69')](_0x440870);}})['then'](function(_0x113516){if(_0x113516){return _0x113516?{'count':_0x1687e5,'rows':_0x113516}:null;}})[_0x5090('0x29')](respondWithResult(_0x35ca84,null))[_0x5090('0x48')](handleError(_0x35ca84,null));};exports['addTeams']=function(_0x7535bd,_0x531f62,_0x163980){var _0x2590be=_0x7535bd['body'][_0x5090('0x6a')];var _0x20200c=_['map'](_0x2590be,'id');return db[_0x5090('0x68')][_0x5090('0x46')]({'where':{'id':_0x20200c},'attributes':['id'],'include':[{'model':db[_0x5090('0x6b')],'as':_0x5090('0x6c'),'attributes':['id','name',_0x5090('0x6d'),'voicePause','interface'],'raw':!![]}]})[_0x5090('0x29')](function(_0x58ed6d){if(_0x58ed6d){var _0x4eb9e6=_[_0x5090('0x6e')](_0x58ed6d,function(_0x384f6f){var _0x4fd1ed=_0x384f6f[_0x5090('0x2b')]({'plain':!![]});_0x4fd1ed[_0x5090('0x6c')][_0x5090('0x6f')](function(_0xd00ca4){_0xd00ca4[_0x5090('0x70')]=_['find'](_0x2590be,{'id':_0x4fd1ed['id']})[_0x5090('0x70')];});return _0x4fd1ed[_0x5090('0x6c')];});return db[_0x5090('0x4b')][_0x5090('0x30')]({'where':{'id':_0x7535bd[_0x5090('0x49')]['id']}})[_0x5090('0x29')](function(_0x4cc166){return db['sequelize'][_0x5090('0x71')](function(_0x2ab105){return _0x4cc166[_0x5090('0x72')](_0x20200c,{'transaction':_0x2ab105})[_0x5090('0x29')](function(){return BPromise['each'](_0x2590be,function(_0x342b73){return db[_0x5090('0x73')][_0x5090('0x74')]({'TeamId':_0x342b73['id'],'VoiceQueueId':_0x7535bd[_0x5090('0x49')]['id'],'penalty':_0x342b73[_0x5090('0x70')]},{'transaction':_0x2ab105});});})['then'](function(){return BPromise[_0x5090('0x75')](_0x4eb9e6,function(_0x5dc4f2){return db[_0x5090('0x76')]['findOrCreate']({'where':{'UserId':_0x5dc4f2['id'],'VoiceQueueId':_0x7535bd[_0x5090('0x49')]['id']},'defaults':{'penalty':_0x5dc4f2[_0x5090('0x70')]},'transaction':_0x2ab105});});})['then'](function(){return BPromise[_0x5090('0x75')](_['filter'](_0x4eb9e6,{'online':!![]}),function(_0x59e58d){return db[_0x5090('0x77')][_0x5090('0x74')]({'membername':_0x59e58d['name'],'UserId':_0x59e58d['id'],'queue_name':_0x4cc166['name'],'VoiceQueueId':_0x4cc166['id'],'interface':_['isNil'](_0x59e58d['interface'])?util[_0x5090('0x78')](_0x5090('0x79'),_0x59e58d[_0x5090('0x31')]):_0x59e58d[_0x5090('0x7a')],'paused':_0x59e58d[_0x5090('0x7b')]||![],'penalty':_0x59e58d[_0x5090('0x70')]},{'transaction':_0x2ab105});});})[_0x5090('0x29')](function(){_0x4eb9e6['forEach'](function(_0x1eae46){socket[_0x5090('0x7c')](_0x5090('0x7d'),{'UserId':_0x1eae46['id'],'VoiceQueueId':_0x4cc166['id']});});});});});}})[_0x5090('0x29')](respondWithStatusCode(_0x531f62,null))['catch'](handleError(_0x531f62,null));};exports['removeTeams']=function(_0xb6b621,_0x1481ba,_0x1aec44){return db[_0x5090('0x68')][_0x5090('0x46')]({'where':{'id':_0xb6b621[_0x5090('0x38')][_0x5090('0x7e')]},'attributes':['id'],'include':[{'model':db[_0x5090('0x6b')],'as':_0x5090('0x6c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1481ba,null))['then'](function(_0x4d926c){var _0x6164ba=_[_0x5090('0x37')](_0x4d926c,'id');var _0x492eb4=[];var _0x583b03=[];var _0x1e58d3=squel['select']();_0x1e58d3[_0x5090('0x7f')]('tq.TeamId')['from'](_0x5090('0x80'),'tq')[_0x5090('0x81')](_0x5090('0x82'),'ut',_0x5090('0x83'))[_0x5090('0x40')]('VoiceQueueId\x20=\x20?',_0xb6b621[_0x5090('0x49')]['id']);for(var _0x584f6d=0x0;_0x584f6d<_0x4d926c[_0x5090('0x3d')];_0x584f6d+=0x1){let _0x55da32=_0x4d926c[_0x584f6d];for(var _0x5acaf8=0x0;_0x5acaf8<_0x55da32[_0x5090('0x6c')][_0x5090('0x3d')];_0x5acaf8+=0x1){let _0x2e712e=_0x55da32[_0x5090('0x6c')][_0x5acaf8];var _0x35034c=_0x1e58d3[_0x5090('0x56')]();_0x35034c[_0x5090('0x40')](_0x5090('0x84'),_0x2e712e['id']);_0x583b03[_0x5090('0x85')](db['sequelize'][_0x5090('0x38')](_0x35034c[_0x5090('0x86')](),{'type':db[_0x5090('0x87')][_0x5090('0x88')][_0x5090('0x89')]})[_0x5090('0x29')](function(_0x16d4df){if(_0x16d4df[_0x5090('0x3d')]===0x1){return _0x2e712e['id'];}else{var _0x248a42=_[_0x5090('0x8a')](_['map'](_0x16d4df,'TeamId'),function(_0x493d60){return _[_0x5090('0x8b')](_0x6164ba,_0x493d60);});if(_0x248a42){return _0x2e712e['id'];}}}));}}return BPromise[_0x5090('0x8c')](_0x583b03)['then'](function(_0xcf95ea){_0x492eb4=_(_0x492eb4)[_0x5090('0x8d')](_0xcf95ea)['compact']()[_0x5090('0x2e')]();return db[_0x5090('0x4b')][_0x5090('0x30')]({'where':{'id':_0xb6b621['params']['id']}})[_0x5090('0x29')](function(_0x1a7dbb){return db[_0x5090('0x87')]['transaction'](function(_0xb24cb4){return _0x1a7dbb[_0x5090('0x8e')](_0xb6b621[_0x5090('0x38')][_0x5090('0x7e')],{'transaction':_0xb24cb4})[_0x5090('0x29')](function(){if(!_[_0x5090('0x8f')](_0x492eb4)){return _0x1a7dbb[_0x5090('0x90')](_0x492eb4,{'transaction':_0xb24cb4})['then'](function(){return db[_0x5090('0x77')][_0x5090('0x2a')]({'where':{'VoiceQueueId':_0xb6b621['params']['id'],'UserId':_0x492eb4},'transaction':_0xb24cb4});});}})[_0x5090('0x29')](function(){_0x492eb4[_0x5090('0x6f')](function(_0x41c128){socket[_0x5090('0x7c')](_0x5090('0x91'),{'UserId':_0x41c128,'VoiceQueueId':_0x1a7dbb['id']});});});});});});})[_0x5090('0x29')](respondWithStatusCode(_0x1481ba,null))[_0x5090('0x48')](handleError(_0x1481ba,null));};exports[_0x5090('0x92')]=function(_0x1d0bac,_0x5108d3,_0x2fe096){var _0x4172f3,_0x2f27a6;return db[_0x5090('0x4b')][_0x5090('0x30')]({'where':{'id':_0x1d0bac[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x5108d3,null))['then'](function(_0x1204fd){if(_0x1204fd){_0x2f27a6=_0x1204fd;return _0x1204fd[_0x5090('0x92')](_0x1d0bac['body'][_0x5090('0x7e')],_[_0x5090('0x57')](_0x1d0bac[_0x5090('0x58')],[_0x5090('0x7e'),'id'])||{})[_0x5090('0x93')](function(_0x1ebf5f){for(var _0x2c3c5b=0x0;_0x2c3c5b<_0x1d0bac[_0x5090('0x58')][_0x5090('0x7e')][_0x5090('0x3d')];_0x2c3c5b+=0x1){socket[_0x5090('0x7c')](_0x5090('0x7d'),{'UserId':Number(_0x1d0bac[_0x5090('0x58')]['ids'][_0x2c3c5b]),'VoiceQueueId':Number(_0x1d0bac[_0x5090('0x49')]['id'])});}return _0x1ebf5f;});}})[_0x5090('0x29')](function(_0x4515d4){_0x4172f3=_0x4515d4||[];if(_0x2f27a6){return db[_0x5090('0x6b')][_0x5090('0x46')]({'where':{'id':_0x1d0bac[_0x5090('0x58')]['ids']},'attributes':['id',_0x5090('0x31'),'online',_0x5090('0x7b'),_0x5090('0x7a')],'raw':!![]});}})['then'](function(_0x15bf2d){if(!_[_0x5090('0x8f')](_0x15bf2d)){var _0x28a43a=[];for(var _0x37d056=0x0;_0x37d056<_0x15bf2d[_0x5090('0x3d')];_0x37d056++){if(_0x15bf2d[_0x37d056]['online']){_0x28a43a[_0x5090('0x85')](db[_0x5090('0x77')]['upsert']({'membername':_0x15bf2d[_0x37d056][_0x5090('0x31')],'UserId':_0x15bf2d[_0x37d056]['id'],'queue_name':_0x2f27a6[_0x5090('0x31')],'VoiceQueueId':_0x2f27a6['id'],'interface':_[_0x5090('0x94')](_0x15bf2d[_0x37d056][_0x5090('0x7a')])?util[_0x5090('0x78')]('SIP/%s',_0x15bf2d[_0x37d056]['name']):_0x15bf2d[_0x37d056][_0x5090('0x7a')],'paused':_0x15bf2d[_0x37d056][_0x5090('0x7b')]||![],'penalty':_0x1d0bac['body'][_0x5090('0x70')]||0x0}));}}return BPromise[_0x5090('0x8c')](_0x28a43a);}})[_0x5090('0x29')](function(){return _0x4172f3;})[_0x5090('0x29')](respondWithResult(_0x5108d3,null))[_0x5090('0x48')](handleError(_0x5108d3,null));};exports['removeAgents']=function(_0x1c95d6,_0x58808d,_0x5f05cc){return db[_0x5090('0x4b')][_0x5090('0x30')]({'where':{'id':_0x1c95d6[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x58808d,null))[_0x5090('0x29')](function(_0x2db362){if(_0x2db362){return _0x2db362[_0x5090('0x90')](_0x1c95d6[_0x5090('0x38')][_0x5090('0x7e')])[_0x5090('0x29')](function(){if(_['isArray'](_0x1c95d6['query'][_0x5090('0x7e')])){for(var _0x31e291=0x0;_0x31e291<_0x1c95d6[_0x5090('0x38')][_0x5090('0x7e')]['length'];_0x31e291+=0x1){socket[_0x5090('0x7c')]('userVoiceQueue:remove',{'UserId':Number(_0x1c95d6[_0x5090('0x38')][_0x5090('0x7e')][_0x31e291]),'VoiceQueueId':Number(_0x1c95d6[_0x5090('0x49')]['id'])});}}else{socket[_0x5090('0x7c')](_0x5090('0x91'),{'UserId':Number(_0x1c95d6[_0x5090('0x38')][_0x5090('0x7e')]),'VoiceQueueId':Number(_0x1c95d6[_0x5090('0x49')]['id'])});}});}})['then'](function(_0x3cdc25){return db[_0x5090('0x77')][_0x5090('0x2a')]({'where':{'VoiceQueueId':_0x1c95d6[_0x5090('0x49')]['id'],'UserId':_0x1c95d6[_0x5090('0x38')][_0x5090('0x7e')]}})['then'](function(){return _0x3cdc25;});})['then'](respondWithStatusCode(_0x58808d,null))[_0x5090('0x48')](handleError(_0x58808d,null));};exports['getAgents']=function(_0x647b7a,_0x2e0f5a,_0x371f2d){var _0x2709c6={};var _0x5f7c7d={};var _0x30f064;var _0x38589b;return db[_0x5090('0x4b')][_0x5090('0x5d')]({'where':{'id':_0x647b7a[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x2e0f5a,null))[_0x5090('0x29')](function(_0x154acb){if(_0x154acb){_0x30f064=_0x154acb;_0x5f7c7d[_0x5090('0x36')]=_['keys'](db[_0x5090('0x6b')][_0x5090('0x34')]);_0x5f7c7d[_0x5090('0x38')]=_[_0x5090('0x4a')](_0x647b7a['query']);_0x5f7c7d[_0x5090('0x39')]=_[_0x5090('0x3a')](_0x5f7c7d[_0x5090('0x36')],_0x5f7c7d[_0x5090('0x38')]);_0x2709c6[_0x5090('0x3c')]=_[_0x5090('0x3a')](_0x5f7c7d[_0x5090('0x36')],qs[_0x5090('0x3b')](_0x647b7a[_0x5090('0x38')][_0x5090('0x3b')]));_0x2709c6[_0x5090('0x3c')]=_0x2709c6[_0x5090('0x3c')][_0x5090('0x3d')]?_0x2709c6[_0x5090('0x3c')]:_0x5f7c7d[_0x5090('0x36')];_0x2709c6[_0x5090('0x60')]=qs[_0x5090('0x3f')](_0x647b7a[_0x5090('0x38')][_0x5090('0x3f')]);_0x2709c6[_0x5090('0x40')]=qs[_0x5090('0x39')](_[_0x5090('0x61')](_0x647b7a[_0x5090('0x38')],_0x5f7c7d[_0x5090('0x39')]));if(_0x647b7a[_0x5090('0x38')]['filter']){_0x2709c6[_0x5090('0x40')]=_['merge'](_0x2709c6[_0x5090('0x40')],{'$or':_[_0x5090('0x37')](_0x2709c6[_0x5090('0x3c')],function(_0x4cc55f){var _0x45545e={};_0x45545e[_0x4cc55f]={'$like':'%'+_0x647b7a[_0x5090('0x38')]['filter']+'%'};return _0x45545e;})});}_0x2709c6=_['merge']({},_0x2709c6,_0x647b7a[_0x5090('0x4c')]);return _0x30f064[_0x5090('0x95')](_0x2709c6);}})[_0x5090('0x29')](function(_0x40fc08){if(_0x40fc08){_0x38589b=_0x40fc08['length'];if(!_0x647b7a[_0x5090('0x38')]['hasOwnProperty'](_0x5090('0x5f'))){_0x2709c6['limit']=qs[_0x5090('0x22')](_0x647b7a[_0x5090('0x38')]['limit']);_0x2709c6[_0x5090('0x21')]=qs[_0x5090('0x21')](_0x647b7a[_0x5090('0x38')][_0x5090('0x21')]);}return _0x30f064[_0x5090('0x95')](_0x2709c6);}})['then'](function(_0x17a035){if(_0x17a035){return _0x17a035?{'count':_0x38589b,'rows':_0x17a035}:null;}})[_0x5090('0x29')](respondWithResult(_0x2e0f5a,null))[_0x5090('0x48')](handleError(_0x2e0f5a,null));};exports[_0x5090('0x96')]=function(_0x1bd96b,_0x408e11,_0x597465){var _0x5756d5={};var _0x1c4e92={};var _0x49d0f0;var _0x3e6821;return db['VoiceQueue'][_0x5090('0x5d')]({'where':{'id':_0x1bd96b[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x408e11,null))[_0x5090('0x29')](function(_0x90cfed){if(_0x90cfed){_0x49d0f0=_0x90cfed;_0x1c4e92[_0x5090('0x36')]=_[_0x5090('0x4a')](db[_0x5090('0x77')][_0x5090('0x34')]);_0x1c4e92[_0x5090('0x38')]=_[_0x5090('0x4a')](_0x1bd96b[_0x5090('0x38')]);_0x1c4e92['filters']=_[_0x5090('0x3a')](_0x1c4e92[_0x5090('0x36')],_0x1c4e92[_0x5090('0x38')]);_0x5756d5[_0x5090('0x3c')]=_[_0x5090('0x3a')](_0x1c4e92['model'],qs[_0x5090('0x3b')](_0x1bd96b['query'][_0x5090('0x3b')]));_0x5756d5[_0x5090('0x3c')]=_0x5756d5['attributes'][_0x5090('0x3d')]?_0x5756d5[_0x5090('0x3c')]:_0x1c4e92[_0x5090('0x36')];_0x5756d5[_0x5090('0x60')]=qs[_0x5090('0x3f')](_0x1bd96b[_0x5090('0x38')][_0x5090('0x3f')]);_0x5756d5[_0x5090('0x40')]=qs[_0x5090('0x39')](_[_0x5090('0x61')](_0x1bd96b[_0x5090('0x38')],_0x1c4e92[_0x5090('0x39')]));if(_0x1bd96b[_0x5090('0x38')]['filter']){_0x5756d5[_0x5090('0x40')]=_['merge'](_0x5756d5[_0x5090('0x40')],{'$or':_[_0x5090('0x37')](_0x5756d5[_0x5090('0x3c')],function(_0x53e3bd){var _0x1b1723={};_0x1b1723[_0x53e3bd]={'$like':'%'+_0x1bd96b[_0x5090('0x38')][_0x5090('0x41')]+'%'};return _0x1b1723;})});}_0x5756d5=_[_0x5090('0x42')]({},_0x5756d5,_0x1bd96b['options']);return _0x49d0f0[_0x5090('0x96')](_0x5756d5);}})['then'](function(_0xef8491){if(_0xef8491){_0x3e6821=_0xef8491[_0x5090('0x3d')];if(!_0x1bd96b[_0x5090('0x38')][_0x5090('0x3e')](_0x5090('0x5f'))){_0x5756d5['limit']=qs['limit'](_0x1bd96b[_0x5090('0x38')][_0x5090('0x22')]);_0x5756d5[_0x5090('0x21')]=qs[_0x5090('0x21')](_0x1bd96b[_0x5090('0x38')][_0x5090('0x21')]);}return _0x49d0f0['getMembers'](_0x5756d5);}})[_0x5090('0x29')](function(_0x2b5b91){return _0x2b5b91?{'count':_0x3e6821,'rows':_0x2b5b91}:null;})['then'](respondWithResult(_0x408e11,null))[_0x5090('0x48')](handleError(_0x408e11,null));};exports[_0x5090('0x97')]=function(_0x34fb67,_0x1a44a3,_0xca8797){var _0x1e85a5={};var _0x469fec={};var _0x50ee82;var _0x2fb9b4;return db[_0x5090('0x4b')]['findOne']({'where':{'id':_0x34fb67['params']['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x1a44a3,null))[_0x5090('0x29')](function(_0x59b035){if(_0x59b035){_0x50ee82=_0x59b035;_0x469fec[_0x5090('0x36')]=_[_0x5090('0x4a')](db[_0x5090('0x98')][_0x5090('0x34')]);_0x469fec[_0x5090('0x38')]=_[_0x5090('0x4a')](_0x34fb67[_0x5090('0x38')]);_0x469fec[_0x5090('0x39')]=_[_0x5090('0x3a')](_0x469fec[_0x5090('0x36')],_0x469fec[_0x5090('0x38')]);_0x1e85a5[_0x5090('0x3c')]=_[_0x5090('0x3a')](_0x469fec[_0x5090('0x36')],qs[_0x5090('0x3b')](_0x34fb67[_0x5090('0x38')][_0x5090('0x3b')]));_0x1e85a5[_0x5090('0x3c')]=_0x1e85a5[_0x5090('0x3c')][_0x5090('0x3d')]?_0x1e85a5[_0x5090('0x3c')]:_0x469fec['model'];_0x1e85a5[_0x5090('0x60')]=qs[_0x5090('0x3f')](_0x34fb67[_0x5090('0x38')][_0x5090('0x3f')]);_0x1e85a5[_0x5090('0x40')]=qs[_0x5090('0x39')](_[_0x5090('0x61')](_0x34fb67[_0x5090('0x38')],_0x469fec[_0x5090('0x39')]));if(_0x34fb67[_0x5090('0x38')][_0x5090('0x41')]){_0x1e85a5['where']=_[_0x5090('0x42')](_0x1e85a5[_0x5090('0x40')],{'$or':_[_0x5090('0x37')](_0x1e85a5[_0x5090('0x3c')],function(_0x1acc78){var _0x214195={};_0x214195[_0x1acc78]={'$like':'%'+_0x34fb67['query'][_0x5090('0x41')]+'%'};return _0x214195;})});}_0x1e85a5=_[_0x5090('0x42')]({},_0x1e85a5,_0x34fb67[_0x5090('0x4c')]);return _0x50ee82[_0x5090('0x97')](_0x1e85a5);}})[_0x5090('0x29')](function(_0x4ae4c4){if(_0x4ae4c4){_0x2fb9b4=_0x4ae4c4['length'];if(!_0x34fb67[_0x5090('0x38')][_0x5090('0x3e')](_0x5090('0x5f'))){_0x1e85a5[_0x5090('0x22')]=qs[_0x5090('0x22')](_0x34fb67[_0x5090('0x38')][_0x5090('0x22')]);_0x1e85a5[_0x5090('0x21')]=qs[_0x5090('0x21')](_0x34fb67[_0x5090('0x38')][_0x5090('0x21')]);}return _0x50ee82['getLists'](_0x1e85a5);}})['then'](function(_0x369df4){if(_0x369df4){return _0x369df4?{'count':_0x2fb9b4,'rows':_0x369df4}:null;}})[_0x5090('0x29')](respondWithResult(_0x1a44a3,null))[_0x5090('0x48')](handleError(_0x1a44a3,null));};exports['addLists']=function(_0xec4ee6,_0x2b2aec,_0x3acb46){var _0x60d00d,_0x212882;return db[_0x5090('0x4b')][_0x5090('0x30')]({'where':{'id':_0xec4ee6[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x2b2aec,null))[_0x5090('0x29')](function(_0x1747a0){if(_0x1747a0){_0x212882=_0x1747a0;return _0x1747a0[_0x5090('0x99')](_0xec4ee6[_0x5090('0x58')][_0x5090('0x7e')],_[_0x5090('0x57')](_0xec4ee6[_0x5090('0x58')],['ids','id'])||{});}return null;})[_0x5090('0x93')](function(_0x5aa3ee){var _0x3a9ccd;_0x60d00d=_0x5aa3ee||[];var _0x394807=[];if(_0x5aa3ee){for(var _0x14d321=0x0;_0x14d321<_0x5aa3ee[_0x5090('0x3d')];_0x14d321+=0x1){var _0x47308e=_0x5aa3ee[_0x14d321][_0x5090('0x2b')]({'plain':!![]});_0x212882['dialCheckDuplicateType']=_0xec4ee6['body'][_0x5090('0x9a')]?_0xec4ee6[_0x5090('0x58')][_0x5090('0x9a')]:_0x212882[_0x5090('0x9a')];switch(_0x212882[_0x5090('0x9a')]){case _0x5090('0x9b'):_0x3a9ccd=squel[_0x5090('0x9c')]()[_0x5090('0x9d')](_0x5090('0x9e'))[_0x5090('0x9f')]([_0x5090('0xa0'),_0x5090('0xa1'),_0x5090('0xa2'),_0x5090('0xa3'),_0x5090('0x63'),_0x5090('0x59'),_0x5090('0x5a')],squel[_0x5090('0xa4')]()['field'](_0x5090('0xa0'),_0x5090('0xa0'))['field'](_0x5090('0xa5'),_0x5090('0xa1'))['field']('id',_0x5090('0xa2'))[_0x5090('0x7f')](_0x47308e['CmListId'][_0x5090('0x86')](),'ListId')[_0x5090('0x7f')](_0xec4ee6[_0x5090('0x49')]['id']['toString'](),_0x5090('0x63'))[_0x5090('0x7f')](_0x5090('0xa5'),_0x5090('0x59'))[_0x5090('0x7f')]('NOW()',_0x5090('0x5a'))[_0x5090('0xa6')](_0x5090('0xa7'))[_0x5090('0x40')](_0x5090('0xa8'))[_0x5090('0x40')](_0x5090('0xa9'),_0x47308e[_0x5090('0xaa')][_0x5090('0x86')]())['where'](_0x5090('0xab'))[_0x5090('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x5090('0xa4')]()[_0x5090('0x7f')](_0x5090('0xac'))[_0x5090('0xa6')]('cm_hopper_final')[_0x5090('0x40')]('VoiceQueueId\x20=\x20?',_0xec4ee6[_0x5090('0x49')]['id'][_0x5090('0x86')]()))[_0x5090('0x40')](_0x5090('0xad'),squel['select']()[_0x5090('0x7f')]('COALESCE(phone,\x27\x27)')['from'](_0x5090('0x9e'))[_0x5090('0x40')](_0x5090('0xae'),_0xec4ee6[_0x5090('0x49')]['id'][_0x5090('0x86')]())))[_0x5090('0x86')]();break;case _0x5090('0xaf'):_0x3a9ccd=squel[_0x5090('0x9c')]()[_0x5090('0x9d')](_0x5090('0x9e'))[_0x5090('0x9f')]([_0x5090('0xa0'),_0x5090('0xa1'),_0x5090('0xa2'),'ListId','VoiceQueueId',_0x5090('0x59'),_0x5090('0x5a')],squel['select']()[_0x5090('0x7f')](_0x5090('0xa0'),_0x5090('0xa0'))['field'](_0x5090('0xa5'),_0x5090('0xa1'))['field']('id','ContactId')[_0x5090('0x7f')](_0x47308e[_0x5090('0xaa')][_0x5090('0x86')](),_0x5090('0xa3'))[_0x5090('0x7f')](_0xec4ee6['params']['id'][_0x5090('0x86')](),_0x5090('0x63'))['field'](_0x5090('0xa5'),_0x5090('0x59'))['field'](_0x5090('0xa5'),'updatedAt')[_0x5090('0xa6')]('cm_contacts')['where'](_0x5090('0xa8'))['where'](_0x5090('0xa9'),_0x47308e[_0x5090('0xaa')][_0x5090('0x86')]())['where'](_0x5090('0xab'))[_0x5090('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x5090('0xa4')]()[_0x5090('0x7f')]('COALESCE(phone,\x27\x27)')[_0x5090('0xa6')](_0x5090('0x9e'))[_0x5090('0x40')](_0x5090('0xae'),_0xec4ee6['params']['id'][_0x5090('0x86')]())))['toString']();break;default:_0x3a9ccd=squel[_0x5090('0x9c')]()[_0x5090('0x9d')](_0x5090('0x9e'))[_0x5090('0x9f')]([_0x5090('0xa0'),_0x5090('0xa1'),_0x5090('0xa2'),_0x5090('0xa3'),_0x5090('0x63'),_0x5090('0x59'),_0x5090('0x5a')],squel[_0x5090('0xa4')]()['field'](_0x5090('0xa0'),'phone')[_0x5090('0x7f')]('NOW()','scheduledAt')[_0x5090('0x7f')]('id',_0x5090('0xa2'))['field'](_0x47308e[_0x5090('0xaa')][_0x5090('0x86')](),_0x5090('0xa3'))['field'](_0xec4ee6[_0x5090('0x49')]['id'][_0x5090('0x86')](),_0x5090('0x63'))['field'](_0x5090('0xa5'),_0x5090('0x59'))['field'](_0x5090('0xa5'),_0x5090('0x5a'))[_0x5090('0xa6')](_0x5090('0xa7'))[_0x5090('0x40')](_0x5090('0xa8'))[_0x5090('0x40')](_0x5090('0xa9'),_0x47308e[_0x5090('0xaa')][_0x5090('0x86')]())[_0x5090('0x40')](_0x5090('0xab')))['toString']();}_0x394807['push'](db[_0x5090('0x87')][_0x5090('0x38')](_0x3a9ccd));}return BPromise[_0x5090('0x8c')](_0x394807);}})[_0x5090('0x29')](function(){return _0x60d00d;})[_0x5090('0x29')](respondWithResult(_0x2b2aec,null))[_0x5090('0x48')](handleError(_0x2b2aec,null));};exports[_0x5090('0xb0')]=function(_0x586052,_0x4d0a4f,_0x531ac7){return db[_0x5090('0x4b')][_0x5090('0x30')]({'where':{'id':_0x586052['params']['id']}})['then'](handleEntityNotFound(_0x4d0a4f,null))[_0x5090('0x29')](function(_0x462d60){if(_0x462d60){return _0x462d60['removeLists'](_0x586052['query'][_0x5090('0x7e')]);}})[_0x5090('0x29')](function(_0x41010d){if(_0x41010d){return db[_0x5090('0x5e')][_0x5090('0x2a')]({'where':{'ListId':_0x586052[_0x5090('0x38')][_0x5090('0x7e')],'VoiceQueueId':_0x586052[_0x5090('0x49')]['id']}})[_0x5090('0x29')](function(){return _0x41010d;});}})[_0x5090('0x29')](respondWithStatusCode(_0x4d0a4f,null))['catch'](handleError(_0x4d0a4f,null));};exports[_0x5090('0xb1')]=function(_0x5c6e06,_0x462673,_0xa5676d){var _0x5a059a={};var _0x2c119c={};var _0x2b6930;var _0x193068;return db[_0x5090('0x4b')][_0x5090('0x5d')]({'where':{'id':_0x5c6e06[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x462673,null))[_0x5090('0x29')](function(_0x336dff){if(_0x336dff){_0x2b6930=_0x336dff;_0x2c119c[_0x5090('0x36')]=_[_0x5090('0x4a')](db['CmList'][_0x5090('0x34')]);_0x2c119c['query']=_[_0x5090('0x4a')](_0x5c6e06['query']);_0x2c119c['filters']=_['intersection'](_0x2c119c[_0x5090('0x36')],_0x2c119c[_0x5090('0x38')]);_0x5a059a['attributes']=_[_0x5090('0x3a')](_0x2c119c[_0x5090('0x36')],qs[_0x5090('0x3b')](_0x5c6e06[_0x5090('0x38')][_0x5090('0x3b')]));_0x5a059a[_0x5090('0x3c')]=_0x5a059a[_0x5090('0x3c')][_0x5090('0x3d')]?_0x5a059a['attributes']:_0x2c119c[_0x5090('0x36')];_0x5a059a[_0x5090('0x60')]=qs[_0x5090('0x3f')](_0x5c6e06[_0x5090('0x38')][_0x5090('0x3f')]);_0x5a059a['where']=qs[_0x5090('0x39')](_[_0x5090('0x61')](_0x5c6e06['query'],_0x2c119c['filters']));if(_0x5c6e06[_0x5090('0x38')]['filter']){_0x5a059a[_0x5090('0x40')]=_[_0x5090('0x42')](_0x5a059a['where'],{'$or':_[_0x5090('0x37')](_0x5a059a[_0x5090('0x3c')],function(_0x4fd506){var _0x1330c1={};_0x1330c1[_0x4fd506]={'$like':'%'+_0x5c6e06[_0x5090('0x38')][_0x5090('0x41')]+'%'};return _0x1330c1;})});}_0x5a059a=_[_0x5090('0x42')]({},_0x5a059a,_0x5c6e06[_0x5090('0x4c')]);return _0x2b6930['getBlackLists'](_0x5a059a);}})['then'](function(_0x7e4066){if(_0x7e4066){_0x193068=_0x7e4066[_0x5090('0x3d')];if(!_0x5c6e06[_0x5090('0x38')][_0x5090('0x3e')](_0x5090('0x5f'))){_0x5a059a[_0x5090('0x22')]=qs[_0x5090('0x22')](_0x5c6e06[_0x5090('0x38')][_0x5090('0x22')]);_0x5a059a[_0x5090('0x21')]=qs['offset'](_0x5c6e06[_0x5090('0x38')]['offset']);}return _0x2b6930[_0x5090('0xb1')](_0x5a059a);}})[_0x5090('0x29')](function(_0x2905e1){if(_0x2905e1){return _0x2905e1?{'count':_0x193068,'rows':_0x2905e1}:null;}})[_0x5090('0x29')](respondWithResult(_0x462673,null))[_0x5090('0x48')](handleError(_0x462673,null));};exports['addBlackLists']=function(_0x36b979,_0x31c5c4,_0x18b2b8){var _0x4e3d32,_0x48e8d4;return db[_0x5090('0x4b')][_0x5090('0x30')]({'where':{'id':_0x36b979[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x31c5c4,null))[_0x5090('0x29')](function(_0x12b211){if(_0x12b211){_0x48e8d4=_0x12b211;return _0x12b211[_0x5090('0xb2')](_0x36b979['body'][_0x5090('0x7e')],_[_0x5090('0x57')](_0x36b979[_0x5090('0x58')],[_0x5090('0x7e'),'id'])||{});}return null;})['spread'](function(_0x5b7815){var _0x1ff7fe;_0x4e3d32=_0x5b7815||[];var _0x4b094b=[];if(_0x5b7815){for(var _0x570936=0x0;_0x570936<_0x5b7815[_0x5090('0x3d')];_0x570936+=0x1){var _0x172018=_0x5b7815[_0x570936]['get']({'plain':!![]});_0x1ff7fe=squel[_0x5090('0x9c')]()['into'](_0x5090('0xb3'))[_0x5090('0x9f')]([_0x5090('0xa0'),_0x5090('0xa2'),'ListId','VoiceQueueId',_0x5090('0x59'),_0x5090('0x5a')],squel[_0x5090('0xa4')]()[_0x5090('0x7f')](_0x5090('0xa0'),'phone')['field']('id',_0x5090('0xa2'))[_0x5090('0x7f')](_0x172018['CmListId'][_0x5090('0x86')](),_0x5090('0xa3'))[_0x5090('0x7f')](_0x36b979[_0x5090('0x49')]['id'][_0x5090('0x86')](),'VoiceQueueId')[_0x5090('0x7f')](_0x5090('0xa5'),_0x5090('0x59'))['field'](_0x5090('0xa5'),'updatedAt')[_0x5090('0xa6')](_0x5090('0xa7'))[_0x5090('0x40')]('deletedAt\x20IS\x20NULL')[_0x5090('0x40')](_0x5090('0xa9'),_0x172018['CmListId'][_0x5090('0x86')]())[_0x5090('0x40')](_0x5090('0xab')))['toString']();_0x4b094b[_0x5090('0x85')](db[_0x5090('0x87')]['query'](_0x1ff7fe));}return BPromise[_0x5090('0x8c')](_0x4b094b);}})['then'](function(){return _0x4e3d32;})[_0x5090('0x29')](respondWithResult(_0x31c5c4,null))[_0x5090('0x48')](handleError(_0x31c5c4,null));};exports[_0x5090('0xb4')]=function(_0x32295e,_0x12235b,_0x1c7c74){return db[_0x5090('0x4b')][_0x5090('0x30')]({'where':{'id':_0x32295e[_0x5090('0x49')]['id']}})[_0x5090('0x29')](handleEntityNotFound(_0x12235b,null))[_0x5090('0x29')](function(_0x51f647){if(_0x51f647){return _0x51f647[_0x5090('0xb4')](_0x32295e[_0x5090('0x38')][_0x5090('0x7e')]);}})['then'](function(_0x117a41){if(_0x117a41){return db['CmHopperBlack'][_0x5090('0x2a')]({'where':{'ListId':_0x32295e[_0x5090('0x38')][_0x5090('0x7e')],'VoiceQueueId':_0x32295e[_0x5090('0x49')]['id']}})[_0x5090('0x29')](function(){return _0x117a41;});}})['then'](respondWithStatusCode(_0x12235b,null))[_0x5090('0x48')](handleError(_0x12235b,null));};
\ No newline at end of file
+var _0x95c5=['stack','send','index','VoiceQueue','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','count','includeAll','include','findAll','rows','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','VoiceQueues','inbound','outbound','UserProfileSection','userProfileId','clone','params','omit','createdAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','CmHopper','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','online','voicePause','interface','flatMap','penalty','Agents','sequelize','TeamVoiceQueue','upsert','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','isNil','format','SIP/%s','forEach','emit','removeTeams','ids','User','select','field','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','includes','all','union','compact','transaction','isEmpty','removeAgents','addAgents','spread','userVoiceQueue:save','push','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','scheduledAt','CmListId','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','updatedAt','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','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','redis','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','set','save','update','destroy','then','QueueCampaigns','filter','ignore','value','type','find','name','UserProfileResource','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x95c5,0x85));var _0x595c=function(_0x152121,_0x120c53){_0x152121=_0x152121-0x0;var _0x592a85=_0x95c5[_0x152121];return _0x592a85;};'use strict';var emlformat=require(_0x595c('0x0'));var rimraf=require(_0x595c('0x1'));var zipdir=require(_0x595c('0x2'));var jsonpatch=require(_0x595c('0x3'));var rp=require(_0x595c('0x4'));var moment=require('moment');var BPromise=require(_0x595c('0x5'));var Mustache=require(_0x595c('0x6'));var util=require('util');var path=require('path');var sox=require(_0x595c('0x7'));var csv=require(_0x595c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x595c('0x9'));var crypto=require(_0x595c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x595c('0xb'));var toCsv=require(_0x595c('0x8'));var querystring=require(_0x595c('0xc'));var Papa=require(_0x595c('0xd'));var Redis=require(_0x595c('0xe'));var authService=require(_0x595c('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x595c('0x10'));var hardwareService=require(_0x595c('0x11'));var logger=require(_0x595c('0x12'))(_0x595c('0x13'));var utils=require(_0x595c('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x595c('0x15'));var db=require(_0x595c('0x16'))['db'];config[_0x595c('0x17')]=_['defaults'](config[_0x595c('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x595c('0x18'))(new Redis(config[_0x595c('0x17')]));require(_0x595c('0x19'))[_0x595c('0x1a')](socket);function respondWithStatusCode(_0x2df63a,_0x53eefd){_0x53eefd=_0x53eefd||0xcc;return function(_0xd7eae3){if(_0xd7eae3){return _0x2df63a[_0x595c('0x1b')](_0x53eefd);}return _0x2df63a['status'](_0x53eefd)[_0x595c('0x1c')]();};}function respondWithResult(_0x463aa6,_0x3263dc){_0x3263dc=_0x3263dc||0xc8;return function(_0xdd8c7f){if(_0xdd8c7f){return _0x463aa6[_0x595c('0x1d')](_0x3263dc)[_0x595c('0x1e')](_0xdd8c7f);}};}function respondWithFilteredResult(_0x493888,_0xb255fe){return function(_0xf2161f){if(_0xf2161f){var _0x547f9d=typeof _0xb255fe[_0x595c('0x1f')]===_0x595c('0x20')&&typeof _0xb255fe[_0x595c('0x21')]===_0x595c('0x20');var _0x4e5ead=_0xf2161f['count'];var _0x3c2920=_0x547f9d?0x0:_0xb255fe[_0x595c('0x1f')];var _0x370ba9=_0x547f9d?_0xf2161f['count']:_0xb255fe[_0x595c('0x1f')]+_0xb255fe[_0x595c('0x21')];var _0x1ed6d5;if(_0x370ba9>=_0x4e5ead){_0x370ba9=_0x4e5ead;_0x1ed6d5=0xc8;}else{_0x1ed6d5=0xce;}_0x493888[_0x595c('0x1d')](_0x1ed6d5);return _0x493888[_0x595c('0x22')]('Content-Range',_0x3c2920+'-'+_0x370ba9+'/'+_0x4e5ead)[_0x595c('0x1e')](_0xf2161f);}return null;};}function patchUpdates(_0x4b5318){return function(_0x4d3d8d){try{jsonpatch['apply'](_0x4d3d8d,_0x4b5318,!![]);}catch(_0x639f07){return BPromise['reject'](_0x639f07);}return _0x4d3d8d[_0x595c('0x23')]();};}function saveUpdates(_0x59e3d5,_0x260bc0){return function(_0x514197){if(_0x514197){return _0x514197[_0x595c('0x24')](_0x59e3d5)['then'](function(_0x3db56c){return _0x3db56c;});}return null;};}function removeEntity(_0xe58f29,_0x256ec5){return function(_0x489dbf){if(_0x489dbf){return _0x489dbf[_0x595c('0x25')]()[_0x595c('0x26')](function(){var _0x5a9873=_0x489dbf['get']({'plain':!![]});var _0xaeb538=[{'name':'VoiceQueues','value':'inbound','ignore':![]},{'name':_0x595c('0x27'),'value':'outbound','ignore':![]}];var _0x537240=_(_0xaeb538)[_0x595c('0x28')](_0x595c('0x29'))['map'](_0x595c('0x2a'))[_0x595c('0x2a')]();if(_['includes'](_0x537240,_0x5a9873[_0x595c('0x2b')])){return;}var _0x2d27c5=_[_0x595c('0x2c')](_0xaeb538,[_0x595c('0x2a'),_0x5a9873['type']])[_0x595c('0x2d')];return db[_0x595c('0x2e')][_0x595c('0x25')]({'where':{'type':_0x2d27c5,'resourceId':_0x5a9873['id']}})[_0x595c('0x26')](function(){return _0x489dbf;});})['then'](function(){_0xe58f29[_0x595c('0x1d')](0xcc)[_0x595c('0x1c')]();});}};}function handleEntityNotFound(_0x121e6a,_0x1bbc32){return function(_0x1ec063){if(!_0x1ec063){_0x121e6a[_0x595c('0x1b')](0x194);}return _0x1ec063;};}function handleError(_0x3364de,_0x56ba81){_0x56ba81=_0x56ba81||0x1f4;return function(_0x223ece){logger[_0x595c('0x2f')](_0x223ece[_0x595c('0x30')]);if(_0x223ece['name']){delete _0x223ece[_0x595c('0x2d')];}_0x3364de[_0x595c('0x1d')](_0x56ba81)[_0x595c('0x31')](_0x223ece);};}exports[_0x595c('0x32')]=function(_0x417288,_0x6a8fe3){var _0x23a04f={},_0x430295={},_0x5c00eb={'count':0x0,'rows':[]};var _0x53fa04=_['map'](db[_0x595c('0x33')][_0x595c('0x34')],function(_0x27d127){return{'name':_0x27d127[_0x595c('0x35')],'type':_0x27d127['type'][_0x595c('0x36')]};});_0x430295[_0x595c('0x37')]=_[_0x595c('0x38')](_0x53fa04,_0x595c('0x2d'));_0x430295[_0x595c('0x39')]=_[_0x595c('0x3a')](_0x417288[_0x595c('0x39')]);_0x430295[_0x595c('0x3b')]=_[_0x595c('0x3c')](_0x430295['model'],_0x430295[_0x595c('0x39')]);_0x23a04f['attributes']=_[_0x595c('0x3c')](_0x430295['model'],qs[_0x595c('0x3d')](_0x417288[_0x595c('0x39')][_0x595c('0x3d')]));_0x23a04f['attributes']=_0x23a04f[_0x595c('0x3e')][_0x595c('0x3f')]?_0x23a04f[_0x595c('0x3e')]:_0x430295[_0x595c('0x37')];if(!_0x417288[_0x595c('0x39')][_0x595c('0x40')](_0x595c('0x41'))){_0x23a04f[_0x595c('0x21')]=qs['limit'](_0x417288[_0x595c('0x39')][_0x595c('0x21')]);_0x23a04f[_0x595c('0x1f')]=qs['offset'](_0x417288['query'][_0x595c('0x1f')]);}_0x23a04f[_0x595c('0x42')]=qs[_0x595c('0x43')](_0x417288[_0x595c('0x39')][_0x595c('0x43')]);_0x23a04f[_0x595c('0x44')]=qs['filters'](_[_0x595c('0x45')](_0x417288['query'],_0x430295[_0x595c('0x3b')]),_0x53fa04);if(_0x417288[_0x595c('0x39')][_0x595c('0x28')]){_0x23a04f[_0x595c('0x44')]=_[_0x595c('0x46')](_0x23a04f[_0x595c('0x44')],{'$or':_[_0x595c('0x38')](_0x53fa04,function(_0x44539e){if(_0x44539e['type']!=='VIRTUAL'){var _0x537578={};_0x537578[_0x44539e[_0x595c('0x2d')]]={'$like':'%'+_0x417288[_0x595c('0x39')]['filter']+'%'};return _0x537578;}})});}_0x23a04f=_[_0x595c('0x46')]({},_0x23a04f,_0x417288[_0x595c('0x47')]);var _0x58759d={'where':_0x23a04f['where']};return db[_0x595c('0x33')][_0x595c('0x48')](_0x58759d)[_0x595c('0x26')](function(_0x2b4a36){_0x5c00eb[_0x595c('0x48')]=_0x2b4a36;if(_0x417288[_0x595c('0x39')][_0x595c('0x49')]){_0x23a04f[_0x595c('0x4a')]=[{'all':!![]}];}return db['VoiceQueue'][_0x595c('0x4b')](_0x23a04f);})['then'](function(_0x4f1422){_0x5c00eb[_0x595c('0x4c')]=_0x4f1422;return _0x5c00eb;})[_0x595c('0x26')](respondWithFilteredResult(_0x6a8fe3,_0x23a04f))['catch'](handleError(_0x6a8fe3,null));};exports['show']=function(_0xa3dda7,_0x122495){var _0x31e396={'raw':![],'where':{'id':_0xa3dda7['params']['id']}},_0x3e6c81={};_0x3e6c81['model']=_[_0x595c('0x3a')](db['VoiceQueue'][_0x595c('0x34')]);_0x3e6c81['query']=_[_0x595c('0x3a')](_0xa3dda7[_0x595c('0x39')]);_0x3e6c81[_0x595c('0x3b')]=_[_0x595c('0x3c')](_0x3e6c81['model'],_0x3e6c81[_0x595c('0x39')]);_0x31e396['attributes']=_['intersection'](_0x3e6c81[_0x595c('0x37')],qs[_0x595c('0x3d')](_0xa3dda7['query'][_0x595c('0x3d')]));_0x31e396[_0x595c('0x3e')]=_0x31e396[_0x595c('0x3e')][_0x595c('0x3f')]?_0x31e396[_0x595c('0x3e')]:_0x3e6c81[_0x595c('0x37')];if(_0xa3dda7[_0x595c('0x39')][_0x595c('0x49')]){_0x31e396[_0x595c('0x4a')]=[{'all':!![]}];}_0x31e396=_[_0x595c('0x46')]({},_0x31e396,_0xa3dda7[_0x595c('0x47')]);return db[_0x595c('0x33')][_0x595c('0x2c')](_0x31e396)['then'](handleEntityNotFound(_0x122495,null))[_0x595c('0x26')](respondWithResult(_0x122495,null))[_0x595c('0x4d')](handleError(_0x122495,null));};exports[_0x595c('0x4e')]=function(_0x5d3f7c,_0x33e769){return db[_0x595c('0x33')][_0x595c('0x4e')](_0x5d3f7c[_0x595c('0x4f')],{})[_0x595c('0x26')](function(_0x56d6a7){var _0x5f1822=_0x5d3f7c[_0x595c('0x50')]['get']({'plain':!![]});if(!_0x5f1822)throw new Error(_0x595c('0x51'));if(_0x5f1822[_0x595c('0x52')]===_0x595c('0x50')){var _0x3199a1=_0x56d6a7[_0x595c('0x53')]({'plain':!![]});var _0xca18b5=[{'name':_0x595c('0x54'),'value':_0x595c('0x55')},{'name':'QueueCampaigns','value':_0x595c('0x56')}];var _0x30eb9d=_['find'](_0xca18b5,[_0x595c('0x2a'),_0x3199a1[_0x595c('0x2b')]])[_0x595c('0x2d')];return db[_0x595c('0x57')][_0x595c('0x2c')]({'where':{'name':_0x30eb9d,'userProfileId':_0x5f1822[_0x595c('0x58')]},'raw':!![]})[_0x595c('0x26')](function(_0xe51fd1){if(_0xe51fd1&&_0xe51fd1['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x3199a1[_0x595c('0x2d')],'resourceId':_0x3199a1['id'],'type':_0xe51fd1[_0x595c('0x2d')],'sectionId':_0xe51fd1['id']},{})[_0x595c('0x26')](function(){return _0x56d6a7;});}else{return _0x56d6a7;}})[_0x595c('0x4d')](function(_0x3ae739){logger[_0x595c('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3ae739);throw _0x3ae739;});}return _0x56d6a7;})['then'](respondWithResult(_0x33e769,0xc9))[_0x595c('0x4d')](handleError(_0x33e769,null));};exports[_0x595c('0x59')]=function(_0x2c5627,_0x197a45){var _0x3f1563={'where':{'id':_0x2c5627[_0x595c('0x5a')]['id']}},_0x1d8387={};_0x1d8387[_0x595c('0x37')]=_['keys'](db[_0x595c('0x33')][_0x595c('0x34')]);_0x3f1563[_0x595c('0x3e')]=_[_0x595c('0x3c')](_0x1d8387[_0x595c('0x37')],qs[_0x595c('0x3d')](_0x2c5627[_0x595c('0x39')][_0x595c('0x3d')]));_0x3f1563['attributes']=_0x3f1563['attributes'][_0x595c('0x3f')]?_0x3f1563[_0x595c('0x3e')]:_0x1d8387[_0x595c('0x37')];if(_0x2c5627[_0x595c('0x39')][_0x595c('0x49')]){_0x3f1563[_0x595c('0x4a')]=[{'all':!![]}];}_0x3f1563=_['merge']({},_0x3f1563,_0x2c5627[_0x595c('0x47')]);return db[_0x595c('0x33')]['find'](_0x3f1563)[_0x595c('0x26')](handleEntityNotFound(_0x197a45,null))[_0x595c('0x26')](function(_0x5a52cc){if(_0x5a52cc){var _0x393042=_0x5a52cc[_0x595c('0x53')]({'plain':!![]});_0x393042=qs['omit'](_0x393042,['id','createdAt','updatedAt']);_0x2c5627[_0x595c('0x4f')]=_[_0x595c('0x5b')](_0x2c5627['body'],['id',_0x595c('0x5c'),'updatedAt']);return db['VoiceQueue'][_0x595c('0x4e')](_[_0x595c('0x46')](_0x393042,_0x2c5627['body']),{'include':_0x2c5627[_0x595c('0x39')][_0x595c('0x49')]?[{'all':!![]}]:undefined})[_0x595c('0x26')](function(_0x3ea471){var _0x182a2b=_0x2c5627[_0x595c('0x50')]['get']({'plain':!![]});if(!_0x182a2b)throw new Error(_0x595c('0x51'));if(_0x182a2b['role']===_0x595c('0x50')){var _0x3cc218=_0x3ea471['get']({'plain':!![]});var _0x5c1aa8=[{'name':_0x595c('0x54'),'value':_0x595c('0x55')},{'name':'QueueCampaigns','value':_0x595c('0x56')}];var _0x43c745=_[_0x595c('0x2c')](_0x5c1aa8,['value',_0x3cc218[_0x595c('0x2b')]])[_0x595c('0x2d')];return db['UserProfileSection'][_0x595c('0x2c')]({'where':{'name':_0x43c745,'userProfileId':_0x182a2b[_0x595c('0x58')]},'raw':!![]})[_0x595c('0x26')](function(_0x466880){if(_0x466880&&_0x466880['autoAssociation']===0x0){return db[_0x595c('0x2e')][_0x595c('0x4e')]({'name':_0x3cc218['name'],'resourceId':_0x3cc218['id'],'type':_0x466880[_0x595c('0x2d')],'sectionId':_0x466880['id']},{})[_0x595c('0x26')](function(){return _0x3ea471;});}else{return _0x3ea471;}})[_0x595c('0x4d')](function(_0x43f7f9){logger['error'](_0x595c('0x5d'),_0x43f7f9);throw _0x43f7f9;});}return _0x3ea471;});}})['then'](respondWithResult(_0x197a45,0xc9))[_0x595c('0x4d')](handleError(_0x197a45,null));};exports[_0x595c('0x24')]=function(_0x5e0bb3,_0x279cf8){if(_0x5e0bb3[_0x595c('0x4f')]['id']){delete _0x5e0bb3[_0x595c('0x4f')]['id'];}return db[_0x595c('0x33')]['find']({'where':{'id':_0x5e0bb3[_0x595c('0x5a')]['id']}})[_0x595c('0x26')](handleEntityNotFound(_0x279cf8,null))[_0x595c('0x26')](saveUpdates(_0x5e0bb3[_0x595c('0x4f')],null))[_0x595c('0x26')](respondWithResult(_0x279cf8,null))['catch'](handleError(_0x279cf8,null));};exports[_0x595c('0x25')]=function(_0xc1c0a6,_0xada163){return db[_0x595c('0x33')][_0x595c('0x2c')]({'where':{'id':_0xc1c0a6[_0x595c('0x5a')]['id']}})[_0x595c('0x26')](handleEntityNotFound(_0xada163,null))[_0x595c('0x26')](removeEntity(_0xada163,null))[_0x595c('0x4d')](handleError(_0xada163,null));};exports['getHoppers']=function(_0x54076b,_0x3ed55d,_0x49e099){var _0x4a6ce2={'raw':![],'where':{}};var _0x194b4f={};var _0x4f042b={'count':0x0,'rows':[]};return db[_0x595c('0x33')][_0x595c('0x5e')]({'where':{'id':_0x54076b[_0x595c('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3ed55d,null))[_0x595c('0x26')](function(_0x2fc870){if(_0x2fc870){_0x194b4f[_0x595c('0x37')]=_[_0x595c('0x3a')](db[_0x595c('0x5f')][_0x595c('0x34')]);_0x194b4f[_0x595c('0x39')]=_['keys'](_0x54076b[_0x595c('0x39')]);_0x194b4f[_0x595c('0x3b')]=_['intersection'](_0x194b4f[_0x595c('0x37')],_0x194b4f[_0x595c('0x39')]);_0x4a6ce2[_0x595c('0x3e')]=_[_0x595c('0x3c')](_0x194b4f[_0x595c('0x37')],qs[_0x595c('0x3d')](_0x54076b[_0x595c('0x39')][_0x595c('0x3d')]));_0x4a6ce2[_0x595c('0x3e')]=_0x4a6ce2['attributes'][_0x595c('0x3f')]?_0x4a6ce2[_0x595c('0x3e')]:_0x194b4f[_0x595c('0x37')];if(!_0x54076b[_0x595c('0x39')]['hasOwnProperty'](_0x595c('0x41'))){_0x4a6ce2[_0x595c('0x21')]=qs[_0x595c('0x21')](_0x54076b[_0x595c('0x39')][_0x595c('0x21')]);_0x4a6ce2[_0x595c('0x1f')]=qs[_0x595c('0x1f')](_0x54076b[_0x595c('0x39')][_0x595c('0x1f')]);}_0x4a6ce2[_0x595c('0x42')]=qs[_0x595c('0x43')](_0x54076b[_0x595c('0x39')]['sort']);_0x4a6ce2[_0x595c('0x44')]=qs[_0x595c('0x3b')](_[_0x595c('0x45')](_0x54076b[_0x595c('0x39')],_0x194b4f[_0x595c('0x3b')]));_0x4a6ce2['where'][_0x595c('0x60')]=_0x2fc870['id'];if(_0x54076b[_0x595c('0x39')][_0x595c('0x28')]){_0x4a6ce2[_0x595c('0x44')]=_[_0x595c('0x46')](_0x4a6ce2[_0x595c('0x44')],{'$or':_[_0x595c('0x38')](_0x4a6ce2[_0x595c('0x3e')],function(_0x5787ce){var _0x228325={};_0x228325[_0x5787ce]={'$like':'%'+_0x54076b[_0x595c('0x39')][_0x595c('0x28')]+'%'};return _0x228325;})});}_0x4a6ce2=_[_0x595c('0x46')]({},_0x4a6ce2,_0x54076b[_0x595c('0x47')]);return db[_0x595c('0x5f')][_0x595c('0x48')]({'where':_0x4a6ce2[_0x595c('0x44')]})[_0x595c('0x26')](function(_0x5e1370){_0x4f042b[_0x595c('0x48')]=_0x5e1370;if(_0x54076b[_0x595c('0x39')][_0x595c('0x49')]){_0x4a6ce2[_0x595c('0x4a')]=[{'all':!![]}];}return db['CmHopper'][_0x595c('0x4b')](_0x4a6ce2);})[_0x595c('0x26')](function(_0x335a52){_0x4f042b[_0x595c('0x4c')]=_0x335a52;return _0x4f042b;});}})[_0x595c('0x26')](respondWithFilteredResult(_0x3ed55d,_0x4a6ce2))[_0x595c('0x4d')](handleError(_0x3ed55d,null));};exports[_0x595c('0x61')]=function(_0x1b5ae4,_0xc1e7f,_0x1519c4){var _0xa4271e={'raw':!![],'where':{}};var _0x16a221={};var _0x25e969={'count':0x0,'rows':[]};return db[_0x595c('0x33')][_0x595c('0x5e')]({'where':{'id':_0x1b5ae4[_0x595c('0x5a')]['id']}})[_0x595c('0x26')](handleEntityNotFound(_0xc1e7f,null))[_0x595c('0x26')](function(_0xf191fc){if(_0xf191fc){_0x16a221['model']=_['keys'](db[_0x595c('0x62')][_0x595c('0x34')]);_0x16a221[_0x595c('0x39')]=_['keys'](_0x1b5ae4[_0x595c('0x39')]);_0x16a221[_0x595c('0x3b')]=_[_0x595c('0x3c')](_0x16a221[_0x595c('0x37')],_0x16a221['query']);_0xa4271e[_0x595c('0x3e')]=_[_0x595c('0x3c')](_0x16a221[_0x595c('0x37')],qs[_0x595c('0x3d')](_0x1b5ae4['query'][_0x595c('0x3d')]));_0xa4271e['attributes']=_0xa4271e[_0x595c('0x3e')][_0x595c('0x3f')]?_0xa4271e[_0x595c('0x3e')]:_0x16a221[_0x595c('0x37')];if(!_0x1b5ae4[_0x595c('0x39')]['hasOwnProperty'](_0x595c('0x41'))){_0xa4271e['limit']=qs[_0x595c('0x21')](_0x1b5ae4[_0x595c('0x39')]['limit']);_0xa4271e[_0x595c('0x1f')]=qs[_0x595c('0x1f')](_0x1b5ae4[_0x595c('0x39')][_0x595c('0x1f')]);}_0xa4271e[_0x595c('0x42')]=qs[_0x595c('0x43')](_0x1b5ae4['query']['sort']);_0xa4271e[_0x595c('0x44')]=qs['filters'](_[_0x595c('0x45')](_0x1b5ae4[_0x595c('0x39')],_0x16a221[_0x595c('0x3b')]));_0xa4271e[_0x595c('0x44')][_0x595c('0x60')]=_0xf191fc['id'];if(_0x1b5ae4['query'][_0x595c('0x28')]){_0xa4271e[_0x595c('0x44')]=_[_0x595c('0x46')](_0xa4271e[_0x595c('0x44')],{'$or':_['map'](_0xa4271e[_0x595c('0x3e')],function(_0x3de874){var _0x5665e3={};_0x5665e3[_0x3de874]={'$like':'%'+_0x1b5ae4[_0x595c('0x39')][_0x595c('0x28')]+'%'};return _0x5665e3;})});}_0xa4271e=_[_0x595c('0x46')]({},_0xa4271e,_0x1b5ae4[_0x595c('0x47')]);return db['CmHopperHistory'][_0x595c('0x48')]({'where':_0xa4271e['where']})[_0x595c('0x26')](function(_0x405e80){_0x25e969[_0x595c('0x48')]=_0x405e80;if(_0x1b5ae4[_0x595c('0x39')]['includeAll']){_0xa4271e[_0x595c('0x4a')]=[{'all':!![]}];}return db[_0x595c('0x62')]['findAll'](_0xa4271e);})['then'](function(_0x3f317b){_0x25e969[_0x595c('0x4c')]=_0x3f317b;return _0x25e969;});}})[_0x595c('0x26')](respondWithFilteredResult(_0xc1e7f,_0xa4271e))[_0x595c('0x4d')](handleError(_0xc1e7f,null));};exports[_0x595c('0x63')]=function(_0x22adc9,_0x141ab4,_0x565466){var _0x2060c3={'raw':!![],'where':{}};var _0x14cf40={};var _0x57bba7={'count':0x0,'rows':[]};return db[_0x595c('0x33')][_0x595c('0x5e')]({'where':{'id':_0x22adc9[_0x595c('0x5a')]['id']}})['then'](handleEntityNotFound(_0x141ab4,null))[_0x595c('0x26')](function(_0x4dce82){if(_0x4dce82){_0x14cf40[_0x595c('0x37')]=_[_0x595c('0x3a')](db[_0x595c('0x64')]['rawAttributes']);_0x14cf40[_0x595c('0x39')]=_[_0x595c('0x3a')](_0x22adc9[_0x595c('0x39')]);_0x14cf40['filters']=_[_0x595c('0x3c')](_0x14cf40[_0x595c('0x37')],_0x14cf40[_0x595c('0x39')]);_0x2060c3[_0x595c('0x3e')]=_[_0x595c('0x3c')](_0x14cf40[_0x595c('0x37')],qs[_0x595c('0x3d')](_0x22adc9[_0x595c('0x39')][_0x595c('0x3d')]));_0x2060c3[_0x595c('0x3e')]=_0x2060c3[_0x595c('0x3e')][_0x595c('0x3f')]?_0x2060c3[_0x595c('0x3e')]:_0x14cf40['model'];if(!_0x22adc9[_0x595c('0x39')]['hasOwnProperty'](_0x595c('0x41'))){_0x2060c3[_0x595c('0x21')]=qs['limit'](_0x22adc9[_0x595c('0x39')]['limit']);_0x2060c3[_0x595c('0x1f')]=qs[_0x595c('0x1f')](_0x22adc9['query'][_0x595c('0x1f')]);}_0x2060c3[_0x595c('0x42')]=qs[_0x595c('0x43')](_0x22adc9[_0x595c('0x39')][_0x595c('0x43')]);_0x2060c3[_0x595c('0x44')]=qs[_0x595c('0x3b')](_[_0x595c('0x45')](_0x22adc9[_0x595c('0x39')],_0x14cf40[_0x595c('0x3b')]));_0x2060c3[_0x595c('0x44')][_0x595c('0x60')]=_0x4dce82['id'];if(_0x22adc9[_0x595c('0x39')][_0x595c('0x28')]){_0x2060c3['where']=_['merge'](_0x2060c3[_0x595c('0x44')],{'$or':_[_0x595c('0x38')](_0x2060c3[_0x595c('0x3e')],function(_0x3182ce){var _0x448761={};_0x448761[_0x3182ce]={'$like':'%'+_0x22adc9['query'][_0x595c('0x28')]+'%'};return _0x448761;})});}_0x2060c3=_['merge']({},_0x2060c3,_0x22adc9[_0x595c('0x47')]);return db[_0x595c('0x64')][_0x595c('0x48')]({'where':_0x2060c3['where']})[_0x595c('0x26')](function(_0xdaf916){_0x57bba7[_0x595c('0x48')]=_0xdaf916;if(_0x22adc9['query'][_0x595c('0x49')]){_0x2060c3[_0x595c('0x4a')]=[{'all':!![]}];}return db[_0x595c('0x64')][_0x595c('0x4b')](_0x2060c3);})[_0x595c('0x26')](function(_0x41b14f){_0x57bba7['rows']=_0x41b14f;return _0x57bba7;});}})['then'](respondWithFilteredResult(_0x141ab4,_0x2060c3))[_0x595c('0x4d')](handleError(_0x141ab4,null));};exports['getHopperBlacks']=function(_0x5ef424,_0x33e6fa,_0x1682ae){var _0x5f3d52={'raw':!![],'where':{}};var _0x498649={};var _0x58fc22={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x595c('0x5e')]({'where':{'id':_0x5ef424[_0x595c('0x5a')]['id']}})[_0x595c('0x26')](handleEntityNotFound(_0x33e6fa,null))[_0x595c('0x26')](function(_0x2d0da2){if(_0x2d0da2){_0x498649['model']=_['keys'](db[_0x595c('0x65')]['rawAttributes']);_0x498649[_0x595c('0x39')]=_['keys'](_0x5ef424[_0x595c('0x39')]);_0x498649['filters']=_[_0x595c('0x3c')](_0x498649['model'],_0x498649[_0x595c('0x39')]);_0x5f3d52['attributes']=_[_0x595c('0x3c')](_0x498649[_0x595c('0x37')],qs[_0x595c('0x3d')](_0x5ef424['query'][_0x595c('0x3d')]));_0x5f3d52[_0x595c('0x3e')]=_0x5f3d52['attributes'][_0x595c('0x3f')]?_0x5f3d52[_0x595c('0x3e')]:_0x498649[_0x595c('0x37')];if(!_0x5ef424[_0x595c('0x39')][_0x595c('0x40')]('nolimit')){_0x5f3d52['limit']=qs[_0x595c('0x21')](_0x5ef424[_0x595c('0x39')][_0x595c('0x21')]);_0x5f3d52[_0x595c('0x1f')]=qs[_0x595c('0x1f')](_0x5ef424[_0x595c('0x39')][_0x595c('0x1f')]);}_0x5f3d52[_0x595c('0x42')]=qs[_0x595c('0x43')](_0x5ef424[_0x595c('0x39')][_0x595c('0x43')]);_0x5f3d52['where']=qs[_0x595c('0x3b')](_[_0x595c('0x45')](_0x5ef424['query'],_0x498649[_0x595c('0x3b')]));_0x5f3d52[_0x595c('0x44')][_0x595c('0x60')]=_0x2d0da2['id'];if(_0x5ef424[_0x595c('0x39')][_0x595c('0x28')]){_0x5f3d52[_0x595c('0x44')]=_[_0x595c('0x46')](_0x5f3d52[_0x595c('0x44')],{'$or':_[_0x595c('0x38')](_0x5f3d52[_0x595c('0x3e')],function(_0x4422b7){var _0x5322a5={};_0x5322a5[_0x4422b7]={'$like':'%'+_0x5ef424[_0x595c('0x39')][_0x595c('0x28')]+'%'};return _0x5322a5;})});}_0x5f3d52=_[_0x595c('0x46')]({},_0x5f3d52,_0x5ef424[_0x595c('0x47')]);return db[_0x595c('0x65')]['count']({'where':_0x5f3d52['where']})[_0x595c('0x26')](function(_0x45aafa){_0x58fc22[_0x595c('0x48')]=_0x45aafa;if(_0x5ef424['query']['includeAll']){_0x5f3d52['include']=[{'all':!![]}];}return db[_0x595c('0x65')]['findAll'](_0x5f3d52);})[_0x595c('0x26')](function(_0x206454){_0x58fc22[_0x595c('0x4c')]=_0x206454;return _0x58fc22;});}})[_0x595c('0x26')](respondWithFilteredResult(_0x33e6fa,_0x5f3d52))[_0x595c('0x4d')](handleError(_0x33e6fa,null));};exports[_0x595c('0x66')]=function(_0x2c4fe0,_0x183e6d,_0x87667){var _0x4bd61d={};var _0xe9a27b={};var _0x24aede;var _0x553292;return db['VoiceQueue'][_0x595c('0x5e')]({'where':{'id':_0x2c4fe0[_0x595c('0x5a')]['id']}})[_0x595c('0x26')](handleEntityNotFound(_0x183e6d,null))[_0x595c('0x26')](function(_0x1a8757){if(_0x1a8757){_0x24aede=_0x1a8757;_0xe9a27b[_0x595c('0x37')]=_[_0x595c('0x3a')](db[_0x595c('0x67')][_0x595c('0x34')]);_0xe9a27b[_0x595c('0x39')]=_[_0x595c('0x3a')](_0x2c4fe0[_0x595c('0x39')]);_0xe9a27b['filters']=_['intersection'](_0xe9a27b[_0x595c('0x37')],_0xe9a27b['query']);_0x4bd61d[_0x595c('0x3e')]=_[_0x595c('0x3c')](_0xe9a27b[_0x595c('0x37')],qs[_0x595c('0x3d')](_0x2c4fe0['query'][_0x595c('0x3d')]));_0x4bd61d[_0x595c('0x3e')]=_0x4bd61d[_0x595c('0x3e')][_0x595c('0x3f')]?_0x4bd61d['attributes']:_0xe9a27b[_0x595c('0x37')];_0x4bd61d[_0x595c('0x42')]=qs['sort'](_0x2c4fe0[_0x595c('0x39')][_0x595c('0x43')]);_0x4bd61d['where']=qs[_0x595c('0x3b')](_[_0x595c('0x45')](_0x2c4fe0[_0x595c('0x39')],_0xe9a27b['filters']));if(_0x2c4fe0[_0x595c('0x39')][_0x595c('0x28')]){_0x4bd61d['where']=_[_0x595c('0x46')](_0x4bd61d[_0x595c('0x44')],{'$or':_['map'](_0x4bd61d['attributes'],function(_0x43e7ba){var _0x2c513f={};_0x2c513f[_0x43e7ba]={'$like':'%'+_0x2c4fe0[_0x595c('0x39')]['filter']+'%'};return _0x2c513f;})});}_0x4bd61d=_[_0x595c('0x46')]({},_0x4bd61d,_0x2c4fe0[_0x595c('0x47')]);return _0x24aede[_0x595c('0x66')](_0x4bd61d);}})[_0x595c('0x26')](function(_0x319e5e){if(_0x319e5e){_0x553292=_0x319e5e[_0x595c('0x3f')];if(!_0x2c4fe0[_0x595c('0x39')][_0x595c('0x40')](_0x595c('0x41'))){_0x4bd61d['limit']=qs['limit'](_0x2c4fe0[_0x595c('0x39')]['limit']);_0x4bd61d[_0x595c('0x1f')]=qs[_0x595c('0x1f')](_0x2c4fe0['query']['offset']);}return _0x24aede[_0x595c('0x66')](_0x4bd61d);}})['then'](function(_0x1cdeec){if(_0x1cdeec){return _0x1cdeec?{'count':_0x553292,'rows':_0x1cdeec}:null;}})[_0x595c('0x26')](respondWithResult(_0x183e6d,null))[_0x595c('0x4d')](handleError(_0x183e6d,null));};exports[_0x595c('0x68')]=function(_0x450736,_0x47749e,_0xa8ae81){var _0x43fa37=_0x450736['body']['teams'];var _0x2e5b78=_[_0x595c('0x38')](_0x43fa37,'id');return db[_0x595c('0x67')][_0x595c('0x4b')]({'where':{'id':_0x2e5b78},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x595c('0x2d'),_0x595c('0x69'),_0x595c('0x6a'),_0x595c('0x6b')],'raw':!![]}]})[_0x595c('0x26')](function(_0x1bd5d8){if(_0x1bd5d8){var _0x262f02=_[_0x595c('0x6c')](_0x1bd5d8,function(_0xaf275d){var _0x5f26bf=_0xaf275d[_0x595c('0x53')]({'plain':!![]});_0x5f26bf['Agents']['forEach'](function(_0x5bcb1c){_0x5bcb1c['penalty']=_['find'](_0x43fa37,{'id':_0x5f26bf['id']})[_0x595c('0x6d')];});return _0x5f26bf[_0x595c('0x6e')];});return db['VoiceQueue'][_0x595c('0x2c')]({'where':{'id':_0x450736[_0x595c('0x5a')]['id']}})[_0x595c('0x26')](function(_0x58628f){return db[_0x595c('0x6f')]['transaction'](function(_0x4d6180){return _0x58628f[_0x595c('0x68')](_0x2e5b78,{'transaction':_0x4d6180})[_0x595c('0x26')](function(){return BPromise['each'](_0x43fa37,function(_0x3a2910){return db[_0x595c('0x70')][_0x595c('0x71')]({'TeamId':_0x3a2910['id'],'VoiceQueueId':_0x450736[_0x595c('0x5a')]['id'],'penalty':_0x3a2910['penalty']},{'transaction':_0x4d6180});});})[_0x595c('0x26')](function(){return BPromise[_0x595c('0x72')](_0x262f02,function(_0xe04c0e){return db[_0x595c('0x73')][_0x595c('0x74')]({'where':{'UserId':_0xe04c0e['id'],'VoiceQueueId':_0x450736[_0x595c('0x5a')]['id']},'defaults':{'penalty':_0xe04c0e[_0x595c('0x6d')]},'transaction':_0x4d6180});});})['then'](function(){return BPromise[_0x595c('0x72')](_[_0x595c('0x28')](_0x262f02,{'online':!![]}),function(_0x3feb75){return db[_0x595c('0x75')][_0x595c('0x71')]({'membername':_0x3feb75[_0x595c('0x2d')],'UserId':_0x3feb75['id'],'queue_name':_0x58628f[_0x595c('0x2d')],'VoiceQueueId':_0x58628f['id'],'interface':_[_0x595c('0x76')](_0x3feb75[_0x595c('0x6b')])?util[_0x595c('0x77')](_0x595c('0x78'),_0x3feb75[_0x595c('0x2d')]):_0x3feb75['interface'],'paused':_0x3feb75[_0x595c('0x6a')]||![],'penalty':_0x3feb75[_0x595c('0x6d')]},{'transaction':_0x4d6180});});})[_0x595c('0x26')](function(){_0x262f02[_0x595c('0x79')](function(_0x1635b9){socket[_0x595c('0x7a')]('userVoiceQueue:save',{'UserId':_0x1635b9['id'],'VoiceQueueId':_0x58628f['id']});});});});});}})[_0x595c('0x26')](respondWithStatusCode(_0x47749e,null))[_0x595c('0x4d')](handleError(_0x47749e,null));};exports[_0x595c('0x7b')]=function(_0x5386e8,_0x5e15be,_0x1ff359){return db[_0x595c('0x67')][_0x595c('0x4b')]({'where':{'id':_0x5386e8['query'][_0x595c('0x7c')]},'attributes':['id'],'include':[{'model':db[_0x595c('0x7d')],'as':_0x595c('0x6e'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5e15be,null))[_0x595c('0x26')](function(_0x1491ea){var _0x7e1735=_[_0x595c('0x38')](_0x1491ea,'id');var _0x7f815=[];var _0x3c30cc=[];var _0x12b70c=squel[_0x595c('0x7e')]();_0x12b70c[_0x595c('0x7f')]('tq.TeamId')[_0x595c('0x80')](_0x595c('0x81'),'tq')[_0x595c('0x82')](_0x595c('0x83'),'ut',_0x595c('0x84'))[_0x595c('0x44')]('VoiceQueueId\x20=\x20?',_0x5386e8[_0x595c('0x5a')]['id']);for(var _0x551279=0x0;_0x551279<_0x1491ea[_0x595c('0x3f')];_0x551279+=0x1){let _0x2c0f32=_0x1491ea[_0x551279];for(var _0x5a262a=0x0;_0x5a262a<_0x2c0f32[_0x595c('0x6e')]['length'];_0x5a262a+=0x1){let _0x987d6c=_0x2c0f32[_0x595c('0x6e')][_0x5a262a];var _0x5650f4=_0x12b70c[_0x595c('0x59')]();_0x5650f4['where'](_0x595c('0x85'),_0x987d6c['id']);_0x3c30cc['push'](db[_0x595c('0x6f')]['query'](_0x5650f4[_0x595c('0x86')](),{'type':db[_0x595c('0x6f')][_0x595c('0x87')][_0x595c('0x88')]})[_0x595c('0x26')](function(_0x1f44f1){if(_0x1f44f1['length']===0x1){return _0x987d6c['id'];}else{var _0xf8fd39=_['every'](_[_0x595c('0x38')](_0x1f44f1,'TeamId'),function(_0xd5d22f){return _[_0x595c('0x89')](_0x7e1735,_0xd5d22f);});if(_0xf8fd39){return _0x987d6c['id'];}}}));}}return BPromise[_0x595c('0x8a')](_0x3c30cc)['then'](function(_0x39a293){_0x7f815=_(_0x7f815)[_0x595c('0x8b')](_0x39a293)[_0x595c('0x8c')]()[_0x595c('0x2a')]();return db[_0x595c('0x33')]['find']({'where':{'id':_0x5386e8[_0x595c('0x5a')]['id']}})[_0x595c('0x26')](function(_0x38e083){return db[_0x595c('0x6f')][_0x595c('0x8d')](function(_0x13d3c9){return _0x38e083['removeTeams'](_0x5386e8[_0x595c('0x39')][_0x595c('0x7c')],{'transaction':_0x13d3c9})[_0x595c('0x26')](function(){if(!_[_0x595c('0x8e')](_0x7f815)){return _0x38e083[_0x595c('0x8f')](_0x7f815,{'transaction':_0x13d3c9})[_0x595c('0x26')](function(){return db[_0x595c('0x75')]['destroy']({'where':{'VoiceQueueId':_0x5386e8[_0x595c('0x5a')]['id'],'UserId':_0x7f815},'transaction':_0x13d3c9});});}})['then'](function(){_0x7f815[_0x595c('0x79')](function(_0x43635c){socket['emit']('userVoiceQueue:remove',{'UserId':_0x43635c,'VoiceQueueId':_0x38e083['id']});});});});});});})[_0x595c('0x26')](respondWithStatusCode(_0x5e15be,null))['catch'](handleError(_0x5e15be,null));};exports['addAgents']=function(_0x561e32,_0x30cd98,_0x2c78a6){var _0x83ee4f,_0x27ec9c;return db['VoiceQueue'][_0x595c('0x2c')]({'where':{'id':_0x561e32['params']['id']}})[_0x595c('0x26')](handleEntityNotFound(_0x30cd98,null))[_0x595c('0x26')](function(_0x12a303){if(_0x12a303){_0x27ec9c=_0x12a303;return _0x12a303[_0x595c('0x90')](_0x561e32[_0x595c('0x4f')][_0x595c('0x7c')],_[_0x595c('0x5b')](_0x561e32['body'],['ids','id'])||{})[_0x595c('0x91')](function(_0x4a9656){for(var _0x4c0a18=0x0;_0x4c0a18<_0x561e32[_0x595c('0x4f')][_0x595c('0x7c')][_0x595c('0x3f')];_0x4c0a18+=0x1){socket['emit'](_0x595c('0x92'),{'UserId':Number(_0x561e32[_0x595c('0x4f')][_0x595c('0x7c')][_0x4c0a18]),'VoiceQueueId':Number(_0x561e32[_0x595c('0x5a')]['id'])});}return _0x4a9656;});}})[_0x595c('0x26')](function(_0x511397){_0x83ee4f=_0x511397||[];if(_0x27ec9c){return db[_0x595c('0x7d')][_0x595c('0x4b')]({'where':{'id':_0x561e32['body'][_0x595c('0x7c')]},'attributes':['id','name',_0x595c('0x69'),_0x595c('0x6a'),'interface'],'raw':!![]});}})[_0x595c('0x26')](function(_0x41cf44){if(!_[_0x595c('0x8e')](_0x41cf44)){var _0x30c8a3=[];for(var _0x48329f=0x0;_0x48329f<_0x41cf44['length'];_0x48329f++){if(_0x41cf44[_0x48329f][_0x595c('0x69')]){_0x30c8a3[_0x595c('0x93')](db[_0x595c('0x75')]['upsert']({'membername':_0x41cf44[_0x48329f]['name'],'UserId':_0x41cf44[_0x48329f]['id'],'queue_name':_0x27ec9c[_0x595c('0x2d')],'VoiceQueueId':_0x27ec9c['id'],'interface':_[_0x595c('0x76')](_0x41cf44[_0x48329f][_0x595c('0x6b')])?util[_0x595c('0x77')](_0x595c('0x78'),_0x41cf44[_0x48329f][_0x595c('0x2d')]):_0x41cf44[_0x48329f]['interface'],'paused':_0x41cf44[_0x48329f][_0x595c('0x6a')]||![],'penalty':_0x561e32[_0x595c('0x4f')][_0x595c('0x6d')]||0x0}));}}return BPromise[_0x595c('0x8a')](_0x30c8a3);}})['then'](function(){return _0x83ee4f;})[_0x595c('0x26')](respondWithResult(_0x30cd98,null))[_0x595c('0x4d')](handleError(_0x30cd98,null));};exports['removeAgents']=function(_0x375ef1,_0x11f928,_0x418c3b){return db[_0x595c('0x33')]['find']({'where':{'id':_0x375ef1[_0x595c('0x5a')]['id']}})[_0x595c('0x26')](handleEntityNotFound(_0x11f928,null))[_0x595c('0x26')](function(_0xb7c70){if(_0xb7c70){return _0xb7c70[_0x595c('0x8f')](_0x375ef1[_0x595c('0x39')][_0x595c('0x7c')])[_0x595c('0x26')](function(){if(_[_0x595c('0x94')](_0x375ef1[_0x595c('0x39')][_0x595c('0x7c')])){for(var _0x1efc9f=0x0;_0x1efc9f<_0x375ef1['query'][_0x595c('0x7c')][_0x595c('0x3f')];_0x1efc9f+=0x1){socket[_0x595c('0x7a')](_0x595c('0x95'),{'UserId':Number(_0x375ef1['query']['ids'][_0x1efc9f]),'VoiceQueueId':Number(_0x375ef1['params']['id'])});}}else{socket[_0x595c('0x7a')](_0x595c('0x95'),{'UserId':Number(_0x375ef1['query'][_0x595c('0x7c')]),'VoiceQueueId':Number(_0x375ef1[_0x595c('0x5a')]['id'])});}});}})[_0x595c('0x26')](function(_0x372192){return db['UserVoiceQueueRt'][_0x595c('0x25')]({'where':{'VoiceQueueId':_0x375ef1[_0x595c('0x5a')]['id'],'UserId':_0x375ef1[_0x595c('0x39')][_0x595c('0x7c')]}})[_0x595c('0x26')](function(){return _0x372192;});})[_0x595c('0x26')](respondWithStatusCode(_0x11f928,null))['catch'](handleError(_0x11f928,null));};exports[_0x595c('0x96')]=function(_0x51b236,_0x161663,_0xe74253){var _0x5f43ed={};var _0x409d20={};var _0x194ab7;var _0x4d68ad;return db[_0x595c('0x33')][_0x595c('0x5e')]({'where':{'id':_0x51b236['params']['id']}})[_0x595c('0x26')](handleEntityNotFound(_0x161663,null))['then'](function(_0x3b2eea){if(_0x3b2eea){_0x194ab7=_0x3b2eea;_0x409d20[_0x595c('0x37')]=_[_0x595c('0x3a')](db[_0x595c('0x7d')][_0x595c('0x34')]);_0x409d20[_0x595c('0x39')]=_[_0x595c('0x3a')](_0x51b236['query']);_0x409d20['filters']=_[_0x595c('0x3c')](_0x409d20[_0x595c('0x37')],_0x409d20[_0x595c('0x39')]);_0x5f43ed[_0x595c('0x3e')]=_[_0x595c('0x3c')](_0x409d20[_0x595c('0x37')],qs['fields'](_0x51b236[_0x595c('0x39')][_0x595c('0x3d')]));_0x5f43ed[_0x595c('0x3e')]=_0x5f43ed['attributes'][_0x595c('0x3f')]?_0x5f43ed['attributes']:_0x409d20['model'];_0x5f43ed[_0x595c('0x42')]=qs[_0x595c('0x43')](_0x51b236[_0x595c('0x39')]['sort']);_0x5f43ed['where']=qs[_0x595c('0x3b')](_[_0x595c('0x45')](_0x51b236[_0x595c('0x39')],_0x409d20['filters']));if(_0x51b236[_0x595c('0x39')][_0x595c('0x28')]){_0x5f43ed[_0x595c('0x44')]=_[_0x595c('0x46')](_0x5f43ed[_0x595c('0x44')],{'$or':_[_0x595c('0x38')](_0x5f43ed[_0x595c('0x3e')],function(_0x153baa){var _0x2ea025={};_0x2ea025[_0x153baa]={'$like':'%'+_0x51b236['query'][_0x595c('0x28')]+'%'};return _0x2ea025;})});}_0x5f43ed=_['merge']({},_0x5f43ed,_0x51b236[_0x595c('0x47')]);return _0x194ab7[_0x595c('0x96')](_0x5f43ed);}})[_0x595c('0x26')](function(_0x395fa6){if(_0x395fa6){_0x4d68ad=_0x395fa6['length'];if(!_0x51b236[_0x595c('0x39')][_0x595c('0x40')]('nolimit')){_0x5f43ed[_0x595c('0x21')]=qs[_0x595c('0x21')](_0x51b236['query']['limit']);_0x5f43ed[_0x595c('0x1f')]=qs[_0x595c('0x1f')](_0x51b236['query'][_0x595c('0x1f')]);}return _0x194ab7['getAgents'](_0x5f43ed);}})['then'](function(_0x524bfe){if(_0x524bfe){return _0x524bfe?{'count':_0x4d68ad,'rows':_0x524bfe}:null;}})[_0x595c('0x26')](respondWithResult(_0x161663,null))['catch'](handleError(_0x161663,null));};exports['getMembers']=function(_0x4c7584,_0x2197ce,_0x261d84){var _0x53dd1d={};var _0x30a6ed={};var _0x2a556b;var _0x5bbf29;return db[_0x595c('0x33')]['findOne']({'where':{'id':_0x4c7584[_0x595c('0x5a')]['id']}})[_0x595c('0x26')](handleEntityNotFound(_0x2197ce,null))[_0x595c('0x26')](function(_0x246d24){if(_0x246d24){_0x2a556b=_0x246d24;_0x30a6ed['model']=_[_0x595c('0x3a')](db['UserVoiceQueueRt']['rawAttributes']);_0x30a6ed[_0x595c('0x39')]=_[_0x595c('0x3a')](_0x4c7584[_0x595c('0x39')]);_0x30a6ed[_0x595c('0x3b')]=_['intersection'](_0x30a6ed[_0x595c('0x37')],_0x30a6ed[_0x595c('0x39')]);_0x53dd1d[_0x595c('0x3e')]=_['intersection'](_0x30a6ed[_0x595c('0x37')],qs[_0x595c('0x3d')](_0x4c7584[_0x595c('0x39')][_0x595c('0x3d')]));_0x53dd1d[_0x595c('0x3e')]=_0x53dd1d[_0x595c('0x3e')]['length']?_0x53dd1d['attributes']:_0x30a6ed['model'];_0x53dd1d[_0x595c('0x42')]=qs[_0x595c('0x43')](_0x4c7584[_0x595c('0x39')][_0x595c('0x43')]);_0x53dd1d[_0x595c('0x44')]=qs[_0x595c('0x3b')](_[_0x595c('0x45')](_0x4c7584[_0x595c('0x39')],_0x30a6ed[_0x595c('0x3b')]));if(_0x4c7584[_0x595c('0x39')][_0x595c('0x28')]){_0x53dd1d[_0x595c('0x44')]=_['merge'](_0x53dd1d['where'],{'$or':_['map'](_0x53dd1d[_0x595c('0x3e')],function(_0x5948fc){var _0x51b1d7={};_0x51b1d7[_0x5948fc]={'$like':'%'+_0x4c7584[_0x595c('0x39')][_0x595c('0x28')]+'%'};return _0x51b1d7;})});}_0x53dd1d=_['merge']({},_0x53dd1d,_0x4c7584[_0x595c('0x47')]);return _0x2a556b[_0x595c('0x97')](_0x53dd1d);}})['then'](function(_0xb68ba7){if(_0xb68ba7){_0x5bbf29=_0xb68ba7['length'];if(!_0x4c7584[_0x595c('0x39')][_0x595c('0x40')](_0x595c('0x41'))){_0x53dd1d['limit']=qs[_0x595c('0x21')](_0x4c7584[_0x595c('0x39')][_0x595c('0x21')]);_0x53dd1d[_0x595c('0x1f')]=qs[_0x595c('0x1f')](_0x4c7584[_0x595c('0x39')][_0x595c('0x1f')]);}return _0x2a556b[_0x595c('0x97')](_0x53dd1d);}})['then'](function(_0x322958){return _0x322958?{'count':_0x5bbf29,'rows':_0x322958}:null;})['then'](respondWithResult(_0x2197ce,null))[_0x595c('0x4d')](handleError(_0x2197ce,null));};exports[_0x595c('0x98')]=function(_0x4cdb72,_0x16e3ca,_0x7fdc3c){var _0x12ef3c={};var _0x21544e={};var _0x360546;var _0x83c7c0;return db[_0x595c('0x33')][_0x595c('0x5e')]({'where':{'id':_0x4cdb72['params']['id']}})[_0x595c('0x26')](handleEntityNotFound(_0x16e3ca,null))['then'](function(_0x3de070){if(_0x3de070){_0x360546=_0x3de070;_0x21544e[_0x595c('0x37')]=_[_0x595c('0x3a')](db[_0x595c('0x99')]['rawAttributes']);_0x21544e[_0x595c('0x39')]=_[_0x595c('0x3a')](_0x4cdb72[_0x595c('0x39')]);_0x21544e[_0x595c('0x3b')]=_[_0x595c('0x3c')](_0x21544e[_0x595c('0x37')],_0x21544e[_0x595c('0x39')]);_0x12ef3c[_0x595c('0x3e')]=_[_0x595c('0x3c')](_0x21544e[_0x595c('0x37')],qs[_0x595c('0x3d')](_0x4cdb72[_0x595c('0x39')][_0x595c('0x3d')]));_0x12ef3c[_0x595c('0x3e')]=_0x12ef3c[_0x595c('0x3e')]['length']?_0x12ef3c['attributes']:_0x21544e[_0x595c('0x37')];_0x12ef3c[_0x595c('0x42')]=qs[_0x595c('0x43')](_0x4cdb72[_0x595c('0x39')]['sort']);_0x12ef3c['where']=qs['filters'](_[_0x595c('0x45')](_0x4cdb72['query'],_0x21544e[_0x595c('0x3b')]));if(_0x4cdb72[_0x595c('0x39')][_0x595c('0x28')]){_0x12ef3c[_0x595c('0x44')]=_[_0x595c('0x46')](_0x12ef3c[_0x595c('0x44')],{'$or':_[_0x595c('0x38')](_0x12ef3c['attributes'],function(_0x452c65){var _0x288363={};_0x288363[_0x452c65]={'$like':'%'+_0x4cdb72[_0x595c('0x39')][_0x595c('0x28')]+'%'};return _0x288363;})});}_0x12ef3c=_[_0x595c('0x46')]({},_0x12ef3c,_0x4cdb72[_0x595c('0x47')]);return _0x360546[_0x595c('0x98')](_0x12ef3c);}})['then'](function(_0x4b5fd5){if(_0x4b5fd5){_0x83c7c0=_0x4b5fd5['length'];if(!_0x4cdb72[_0x595c('0x39')]['hasOwnProperty']('nolimit')){_0x12ef3c[_0x595c('0x21')]=qs[_0x595c('0x21')](_0x4cdb72[_0x595c('0x39')][_0x595c('0x21')]);_0x12ef3c[_0x595c('0x1f')]=qs[_0x595c('0x1f')](_0x4cdb72[_0x595c('0x39')]['offset']);}return _0x360546[_0x595c('0x98')](_0x12ef3c);}})[_0x595c('0x26')](function(_0x33305a){if(_0x33305a){return _0x33305a?{'count':_0x83c7c0,'rows':_0x33305a}:null;}})[_0x595c('0x26')](respondWithResult(_0x16e3ca,null))[_0x595c('0x4d')](handleError(_0x16e3ca,null));};exports[_0x595c('0x9a')]=function(_0x30c0b7,_0x4c6165,_0xd65e4f){var _0x665459,_0x1dcc41;return db[_0x595c('0x33')][_0x595c('0x2c')]({'where':{'id':_0x30c0b7[_0x595c('0x5a')]['id']}})[_0x595c('0x26')](handleEntityNotFound(_0x4c6165,null))[_0x595c('0x26')](function(_0x1f097c){if(_0x1f097c){_0x1dcc41=_0x1f097c;return _0x1f097c[_0x595c('0x9a')](_0x30c0b7['body'][_0x595c('0x7c')],_['omit'](_0x30c0b7[_0x595c('0x4f')],['ids','id'])||{});}return null;})[_0x595c('0x91')](function(_0xab33ed){var _0x311c0a;_0x665459=_0xab33ed||[];var _0x5867f4=[];if(_0xab33ed){for(var _0xcb6423=0x0;_0xcb6423<_0xab33ed[_0x595c('0x3f')];_0xcb6423+=0x1){var _0x39e295=_0xab33ed[_0xcb6423]['get']({'plain':!![]});_0x1dcc41[_0x595c('0x9b')]=_0x30c0b7[_0x595c('0x4f')][_0x595c('0x9b')]?_0x30c0b7[_0x595c('0x4f')][_0x595c('0x9b')]:_0x1dcc41['dialCheckDuplicateType'];switch(_0x1dcc41[_0x595c('0x9b')]){case'always':_0x311c0a=squel[_0x595c('0x9c')]()[_0x595c('0x9d')](_0x595c('0x9e'))[_0x595c('0x9f')]([_0x595c('0xa0'),'scheduledAt',_0x595c('0xa1'),_0x595c('0xa2'),_0x595c('0x60'),_0x595c('0x5c'),'updatedAt'],squel[_0x595c('0x7e')]()[_0x595c('0x7f')](_0x595c('0xa0'),_0x595c('0xa0'))[_0x595c('0x7f')]('NOW()',_0x595c('0xa3'))['field']('id',_0x595c('0xa1'))['field'](_0x39e295[_0x595c('0xa4')][_0x595c('0x86')](),'ListId')['field'](_0x30c0b7[_0x595c('0x5a')]['id'][_0x595c('0x86')](),_0x595c('0x60'))[_0x595c('0x7f')](_0x595c('0xa5'),'createdAt')[_0x595c('0x7f')](_0x595c('0xa5'),'updatedAt')[_0x595c('0x80')](_0x595c('0xa6'))[_0x595c('0x44')](_0x595c('0xa7'))['where'](_0x595c('0xa8'),_0x39e295[_0x595c('0xa4')][_0x595c('0x86')]())[_0x595c('0x44')](_0x595c('0xa9'))[_0x595c('0x44')](_0x595c('0xaa'),squel['select']()[_0x595c('0x7f')](_0x595c('0xab'))[_0x595c('0x80')](_0x595c('0xac'))[_0x595c('0x44')](_0x595c('0xad'),_0x30c0b7[_0x595c('0x5a')]['id'][_0x595c('0x86')]()))[_0x595c('0x44')](_0x595c('0xaa'),squel[_0x595c('0x7e')]()[_0x595c('0x7f')](_0x595c('0xae'))['from']('cm_hopper')[_0x595c('0x44')](_0x595c('0xad'),_0x30c0b7['params']['id'][_0x595c('0x86')]())))['toString']();break;case _0x595c('0xaf'):_0x311c0a=squel['insert']()[_0x595c('0x9d')](_0x595c('0x9e'))['fromQuery']([_0x595c('0xa0'),_0x595c('0xa3'),_0x595c('0xa1'),'ListId',_0x595c('0x60'),'createdAt',_0x595c('0xb0')],squel[_0x595c('0x7e')]()[_0x595c('0x7f')]('phone',_0x595c('0xa0'))[_0x595c('0x7f')](_0x595c('0xa5'),'scheduledAt')[_0x595c('0x7f')]('id','ContactId')[_0x595c('0x7f')](_0x39e295[_0x595c('0xa4')][_0x595c('0x86')](),_0x595c('0xa2'))['field'](_0x30c0b7[_0x595c('0x5a')]['id'][_0x595c('0x86')](),_0x595c('0x60'))[_0x595c('0x7f')](_0x595c('0xa5'),_0x595c('0x5c'))[_0x595c('0x7f')](_0x595c('0xa5'),_0x595c('0xb0'))[_0x595c('0x80')](_0x595c('0xa6'))['where'](_0x595c('0xa7'))[_0x595c('0x44')](_0x595c('0xa8'),_0x39e295['CmListId']['toString']())['where'](_0x595c('0xa9'))['where'](_0x595c('0xaa'),squel[_0x595c('0x7e')]()['field'](_0x595c('0xae'))[_0x595c('0x80')](_0x595c('0x9e'))[_0x595c('0x44')](_0x595c('0xad'),_0x30c0b7['params']['id'][_0x595c('0x86')]())))[_0x595c('0x86')]();break;default:_0x311c0a=squel['insert']()[_0x595c('0x9d')](_0x595c('0x9e'))[_0x595c('0x9f')](['phone',_0x595c('0xa3'),_0x595c('0xa1'),_0x595c('0xa2'),'VoiceQueueId','createdAt',_0x595c('0xb0')],squel['select']()[_0x595c('0x7f')](_0x595c('0xa0'),_0x595c('0xa0'))['field'](_0x595c('0xa5'),_0x595c('0xa3'))[_0x595c('0x7f')]('id',_0x595c('0xa1'))[_0x595c('0x7f')](_0x39e295[_0x595c('0xa4')]['toString'](),_0x595c('0xa2'))[_0x595c('0x7f')](_0x30c0b7['params']['id'][_0x595c('0x86')](),_0x595c('0x60'))['field'](_0x595c('0xa5'),'createdAt')[_0x595c('0x7f')](_0x595c('0xa5'),'updatedAt')[_0x595c('0x80')](_0x595c('0xa6'))[_0x595c('0x44')]('deletedAt\x20IS\x20NULL')[_0x595c('0x44')](_0x595c('0xa8'),_0x39e295[_0x595c('0xa4')][_0x595c('0x86')]())['where'](_0x595c('0xa9')))[_0x595c('0x86')]();}_0x5867f4['push'](db['sequelize'][_0x595c('0x39')](_0x311c0a));}return BPromise['all'](_0x5867f4);}})[_0x595c('0x26')](function(){return _0x665459;})['then'](respondWithResult(_0x4c6165,null))['catch'](handleError(_0x4c6165,null));};exports[_0x595c('0xb1')]=function(_0x52eaff,_0x17a500,_0x10c321){return db[_0x595c('0x33')][_0x595c('0x2c')]({'where':{'id':_0x52eaff[_0x595c('0x5a')]['id']}})['then'](handleEntityNotFound(_0x17a500,null))['then'](function(_0x829fbc){if(_0x829fbc){return _0x829fbc[_0x595c('0xb1')](_0x52eaff[_0x595c('0x39')][_0x595c('0x7c')]);}})['then'](function(_0x18387d){if(_0x18387d){return db[_0x595c('0x5f')][_0x595c('0x25')]({'where':{'ListId':_0x52eaff['query'][_0x595c('0x7c')],'VoiceQueueId':_0x52eaff['params']['id']}})[_0x595c('0x26')](function(){return _0x18387d;});}})[_0x595c('0x26')](respondWithStatusCode(_0x17a500,null))[_0x595c('0x4d')](handleError(_0x17a500,null));};exports[_0x595c('0xb2')]=function(_0x285b5c,_0xcc5c43,_0x1cc4bf){var _0x41d783={};var _0x10f38e={};var _0x35b341;var _0x2fc3dd;return db['VoiceQueue']['findOne']({'where':{'id':_0x285b5c[_0x595c('0x5a')]['id']}})['then'](handleEntityNotFound(_0xcc5c43,null))['then'](function(_0x17d243){if(_0x17d243){_0x35b341=_0x17d243;_0x10f38e[_0x595c('0x37')]=_[_0x595c('0x3a')](db[_0x595c('0x99')][_0x595c('0x34')]);_0x10f38e['query']=_['keys'](_0x285b5c[_0x595c('0x39')]);_0x10f38e[_0x595c('0x3b')]=_[_0x595c('0x3c')](_0x10f38e[_0x595c('0x37')],_0x10f38e[_0x595c('0x39')]);_0x41d783[_0x595c('0x3e')]=_[_0x595c('0x3c')](_0x10f38e[_0x595c('0x37')],qs[_0x595c('0x3d')](_0x285b5c[_0x595c('0x39')][_0x595c('0x3d')]));_0x41d783['attributes']=_0x41d783['attributes']['length']?_0x41d783[_0x595c('0x3e')]:_0x10f38e['model'];_0x41d783[_0x595c('0x42')]=qs[_0x595c('0x43')](_0x285b5c['query'][_0x595c('0x43')]);_0x41d783[_0x595c('0x44')]=qs[_0x595c('0x3b')](_[_0x595c('0x45')](_0x285b5c[_0x595c('0x39')],_0x10f38e['filters']));if(_0x285b5c[_0x595c('0x39')]['filter']){_0x41d783[_0x595c('0x44')]=_[_0x595c('0x46')](_0x41d783[_0x595c('0x44')],{'$or':_[_0x595c('0x38')](_0x41d783[_0x595c('0x3e')],function(_0x883b84){var _0x10ae6a={};_0x10ae6a[_0x883b84]={'$like':'%'+_0x285b5c[_0x595c('0x39')][_0x595c('0x28')]+'%'};return _0x10ae6a;})});}_0x41d783=_[_0x595c('0x46')]({},_0x41d783,_0x285b5c[_0x595c('0x47')]);return _0x35b341['getBlackLists'](_0x41d783);}})[_0x595c('0x26')](function(_0x18da25){if(_0x18da25){_0x2fc3dd=_0x18da25[_0x595c('0x3f')];if(!_0x285b5c[_0x595c('0x39')][_0x595c('0x40')](_0x595c('0x41'))){_0x41d783[_0x595c('0x21')]=qs[_0x595c('0x21')](_0x285b5c['query'][_0x595c('0x21')]);_0x41d783['offset']=qs[_0x595c('0x1f')](_0x285b5c[_0x595c('0x39')]['offset']);}return _0x35b341[_0x595c('0xb2')](_0x41d783);}})['then'](function(_0x12b14f){if(_0x12b14f){return _0x12b14f?{'count':_0x2fc3dd,'rows':_0x12b14f}:null;}})['then'](respondWithResult(_0xcc5c43,null))['catch'](handleError(_0xcc5c43,null));};exports['addBlackLists']=function(_0x3d7bab,_0x1c758b,_0x465554){var _0xbfe2c9,_0x1006a4;return db[_0x595c('0x33')][_0x595c('0x2c')]({'where':{'id':_0x3d7bab[_0x595c('0x5a')]['id']}})[_0x595c('0x26')](handleEntityNotFound(_0x1c758b,null))[_0x595c('0x26')](function(_0x146414){if(_0x146414){_0x1006a4=_0x146414;return _0x146414[_0x595c('0xb3')](_0x3d7bab['body'][_0x595c('0x7c')],_[_0x595c('0x5b')](_0x3d7bab[_0x595c('0x4f')],[_0x595c('0x7c'),'id'])||{});}return null;})[_0x595c('0x91')](function(_0x42396a){var _0x16312f;_0xbfe2c9=_0x42396a||[];var _0x2faf8f=[];if(_0x42396a){for(var _0x308b67=0x0;_0x308b67<_0x42396a[_0x595c('0x3f')];_0x308b67+=0x1){var _0xd11fe1=_0x42396a[_0x308b67][_0x595c('0x53')]({'plain':!![]});_0x16312f=squel['insert']()[_0x595c('0x9d')]('cm_hopper_black')['fromQuery']([_0x595c('0xa0'),'ContactId',_0x595c('0xa2'),_0x595c('0x60'),_0x595c('0x5c'),'updatedAt'],squel[_0x595c('0x7e')]()[_0x595c('0x7f')](_0x595c('0xa0'),_0x595c('0xa0'))[_0x595c('0x7f')]('id','ContactId')[_0x595c('0x7f')](_0xd11fe1[_0x595c('0xa4')][_0x595c('0x86')](),_0x595c('0xa2'))[_0x595c('0x7f')](_0x3d7bab[_0x595c('0x5a')]['id'][_0x595c('0x86')](),_0x595c('0x60'))[_0x595c('0x7f')](_0x595c('0xa5'),_0x595c('0x5c'))[_0x595c('0x7f')](_0x595c('0xa5'),_0x595c('0xb0'))[_0x595c('0x80')](_0x595c('0xa6'))['where']('deletedAt\x20IS\x20NULL')[_0x595c('0x44')](_0x595c('0xa8'),_0xd11fe1[_0x595c('0xa4')]['toString']())[_0x595c('0x44')](_0x595c('0xa9')))[_0x595c('0x86')]();_0x2faf8f[_0x595c('0x93')](db[_0x595c('0x6f')][_0x595c('0x39')](_0x16312f));}return BPromise[_0x595c('0x8a')](_0x2faf8f);}})[_0x595c('0x26')](function(){return _0xbfe2c9;})['then'](respondWithResult(_0x1c758b,null))[_0x595c('0x4d')](handleError(_0x1c758b,null));};exports[_0x595c('0xb4')]=function(_0x5e3d5d,_0x4c11da,_0x48aff4){return db['VoiceQueue']['find']({'where':{'id':_0x5e3d5d[_0x595c('0x5a')]['id']}})[_0x595c('0x26')](handleEntityNotFound(_0x4c11da,null))[_0x595c('0x26')](function(_0x408a2b){if(_0x408a2b){return _0x408a2b[_0x595c('0xb4')](_0x5e3d5d[_0x595c('0x39')][_0x595c('0x7c')]);}})[_0x595c('0x26')](function(_0x459fa7){if(_0x459fa7){return db[_0x595c('0x65')][_0x595c('0x25')]({'where':{'ListId':_0x5e3d5d[_0x595c('0x39')][_0x595c('0x7c')],'VoiceQueueId':_0x5e3d5d[_0x595c('0x5a')]['id']}})[_0x595c('0x26')](function(){return _0x459fa7;});}})[_0x595c('0x26')](respondWithStatusCode(_0x4c11da,null))['catch'](handleError(_0x4c11da,null));};
\ No newline at end of file
index e4eb4d8..7040909 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa31=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','update','remove'];(function(_0x299784,_0xb0918f){var _0x5ab008=function(_0x49c1f5){while(--_0x49c1f5){_0x299784['push'](_0x299784['shift']());}};_0x5ab008(++_0xb0918f);}(_0xfa31,0xbc));var _0x1fa3=function(_0x351200,_0x2f7c8c){_0x351200=_0x351200-0x0;var _0x1ca62b=_0xfa31[_0x351200];return _0x1ca62b;};'use strict';var EventEmitter=require(_0x1fa3('0x0'));var VoiceQueue=require(_0x1fa3('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x1fa3('0x2'),'afterDestroy':_0x1fa3('0x3')};function emitEvent(_0x1ecd5f){return function(_0x24c00b,_0x2911c5,_0x362217){VoiceQueueEvents[_0x1fa3('0x4')](_0x1ecd5f+':'+_0x24c00b['id'],_0x24c00b);VoiceQueueEvents[_0x1fa3('0x4')](_0x1ecd5f,_0x24c00b);_0x362217(null);};}for(var e in events){if(events[_0x1fa3('0x5')](e)){var event=events[e];VoiceQueue[_0x1fa3('0x6')](e,emitEvent(event));}}module[_0x1fa3('0x7')]=VoiceQueueEvents;
\ No newline at end of file
+var _0x7d91=['emit','hook','exports','events','../../mysqldb','save','update'];(function(_0x2248c0,_0x523a1a){var _0x449b60=function(_0x41a698){while(--_0x41a698){_0x2248c0['push'](_0x2248c0['shift']());}};_0x449b60(++_0x523a1a);}(_0x7d91,0x130));var _0x17d9=function(_0x5518ff,_0x1a4afa){_0x5518ff=_0x5518ff-0x0;var _0x5547ee=_0x7d91[_0x5518ff];return _0x5547ee;};'use strict';var EventEmitter=require(_0x17d9('0x0'));var VoiceQueue=require(_0x17d9('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x17d9('0x2'),'afterUpdate':_0x17d9('0x3'),'afterDestroy':'remove'};function emitEvent(_0x52cc5d){return function(_0x30c170,_0x296d48,_0x4928ab){VoiceQueueEvents['emit'](_0x52cc5d+':'+_0x30c170['id'],_0x30c170);VoiceQueueEvents[_0x17d9('0x4')](_0x52cc5d,_0x30c170);_0x4928ab(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x17d9('0x5')](e,emitEvent(event));}}module[_0x17d9('0x6')]=VoiceQueueEvents;
\ No newline at end of file
index 4f05f0a..437d176 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x25eac3,_0x13d151){var _0x49df3d=function(_0x1b69c3){while(--_0x1b69c3){_0x25eac3['push'](_0x25eac3['shift']());}};_0x49df3d(++_0x13d151);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x5746a1,_0x11eab1){var _0x551a43=function(_0x7ddcbe){while(--_0x7ddcbe){_0x5746a1['push'](_0x5746a1['shift']());}};_0x551a43(++_0x11eab1);}(_0x008c,0x188));var _0xc008=function(_0x44e5f6,_0x1cdb43){_0x44e5f6=_0x44e5f6-0x0;var _0x350e0e=_0x008c[_0x44e5f6];return _0x350e0e;};'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 2c5721c..95d2972 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5786=['redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','limit','map','model','include','attributes','catch','ShowVoiceQueue','find','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x5786,0x14d));var _0x6578=function(_0x21dae8,_0x17b70f){_0x21dae8=_0x21dae8-0x0;var _0x1818db=_0x5786[_0x21dae8];return _0x1818db;};'use strict';var _=require(_0x6578('0x0'));var util=require(_0x6578('0x1'));var moment=require(_0x6578('0x2'));var BPromise=require(_0x6578('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6578('0x4'))['db'];var utils=require(_0x6578('0x5'));var logger=require(_0x6578('0x6'))('rpc');var config=require(_0x6578('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6578('0x8')]({'port':0x232a});config[_0x6578('0x9')]=_[_0x6578('0xa')](config[_0x6578('0x9')],{'host':_0x6578('0xb'),'port':0x18eb});var socket=require(_0x6578('0xc'))(new Redis(config['redis']));require(_0x6578('0xd'))[_0x6578('0xe')](socket);function respondWithRpcPromise(_0x3375eb,_0x60f6de,_0x179b56){return new BPromise(function(_0x3cf290,_0x417f70){return client['request'](_0x3375eb,_0x179b56)[_0x6578('0xf')](function(_0x26aacc){logger['info'](_0x6578('0x10'),_0x60f6de,_0x6578('0x11'));logger[_0x6578('0x12')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x60f6de,_0x6578('0x11'),JSON[_0x6578('0x13')](_0x26aacc));if(_0x26aacc[_0x6578('0x14')]){if(_0x26aacc[_0x6578('0x14')][_0x6578('0x15')]===0x1f4){logger[_0x6578('0x14')](_0x6578('0x10'),_0x60f6de,_0x26aacc[_0x6578('0x14')][_0x6578('0x16')]);return _0x417f70(_0x26aacc['error'][_0x6578('0x16')]);}logger[_0x6578('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x60f6de,_0x26aacc[_0x6578('0x14')][_0x6578('0x16')]);return _0x3cf290(_0x26aacc[_0x6578('0x14')]['message']);}else{logger[_0x6578('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x60f6de,_0x6578('0x11'));_0x3cf290(_0x26aacc['result'][_0x6578('0x16')]);}})['catch'](function(_0x10a53e){logger['error'](_0x6578('0x10'),_0x60f6de,_0x10a53e);_0x417f70(_0x10a53e);});});}exports[_0x6578('0x18')]=function(_0x24887c){var _0x36c341=this;return new Promise(function(_0x4b6b1b,_0x1e268a){return db[_0x6578('0x19')][_0x6578('0x1a')]({'raw':_0x24887c[_0x6578('0x1b')]?_0x24887c[_0x6578('0x1b')][_0x6578('0x1c')]===undefined?!![]:![]:!![],'where':_0x24887c[_0x6578('0x1b')]?_0x24887c[_0x6578('0x1b')][_0x6578('0x1d')]||null:null,'attributes':_0x24887c['options']?_0x24887c[_0x6578('0x1b')]['attributes']||null:null,'limit':_0x24887c[_0x6578('0x1b')]?_0x24887c[_0x6578('0x1b')][_0x6578('0x1e')]||null:null,'include':_0x24887c[_0x6578('0x1b')]?_0x24887c['options']['include']?_[_0x6578('0x1f')](_0x24887c[_0x6578('0x1b')]['include'],function(_0x45db70){return{'model':db[_0x45db70[_0x6578('0x20')]],'as':_0x45db70['as'],'attributes':_0x45db70['attributes'],'include':_0x45db70[_0x6578('0x21')]?_['map'](_0x45db70[_0x6578('0x21')],function(_0x37f5ae){return{'model':db[_0x37f5ae[_0x6578('0x20')]],'as':_0x37f5ae['as'],'attributes':_0x37f5ae[_0x6578('0x22')],'include':_0x37f5ae[_0x6578('0x21')]?_[_0x6578('0x1f')](_0x37f5ae[_0x6578('0x21')],function(_0x27875a){return{'model':db[_0x27875a['model']],'as':_0x27875a['as'],'attributes':_0x27875a['attributes']};}):[]};}):[]};}):[]:[]})[_0x6578('0xf')](function(_0x4843ed){logger[_0x6578('0x17')](_0x6578('0x18'),_0x24887c);logger[_0x6578('0x12')](_0x6578('0x18'),_0x24887c,JSON[_0x6578('0x13')](_0x4843ed));_0x4b6b1b(_0x4843ed);})[_0x6578('0x23')](function(_0x8b5c0b){logger[_0x6578('0x14')](_0x6578('0x18'),_0x8b5c0b['message'],_0x24887c);_0x1e268a(_0x36c341[_0x6578('0x14')](0x1f4,_0x8b5c0b['message']));});});};exports[_0x6578('0x24')]=function(_0x3e6b54){var _0x47e375=this;return new Promise(function(_0xbc2e57,_0x460c30){return db['VoiceQueue'][_0x6578('0x25')]({'raw':_0x3e6b54['options']?_0x3e6b54[_0x6578('0x1b')][_0x6578('0x1c')]===undefined?!![]:![]:!![],'where':_0x3e6b54['options']?_0x3e6b54[_0x6578('0x1b')][_0x6578('0x1d')]||null:null,'attributes':_0x3e6b54[_0x6578('0x1b')]?_0x3e6b54[_0x6578('0x1b')]['attributes']||null:null,'include':_0x3e6b54[_0x6578('0x1b')]?_0x3e6b54[_0x6578('0x1b')][_0x6578('0x21')]?_['map'](_0x3e6b54['options'][_0x6578('0x21')],function(_0x5acd9a){return{'model':db[_0x5acd9a[_0x6578('0x20')]],'as':_0x5acd9a['as'],'attributes':_0x5acd9a[_0x6578('0x22')],'include':_0x5acd9a[_0x6578('0x21')]?_['map'](_0x5acd9a[_0x6578('0x21')],function(_0x1fe582){return{'model':db[_0x1fe582[_0x6578('0x20')]],'as':_0x1fe582['as'],'attributes':_0x1fe582['attributes'],'include':_0x1fe582[_0x6578('0x21')]?_[_0x6578('0x1f')](_0x1fe582[_0x6578('0x21')],function(_0x9c2046){return{'model':db[_0x9c2046[_0x6578('0x20')]],'as':_0x9c2046['as'],'attributes':_0x9c2046[_0x6578('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6578('0xf')](function(_0x244d81){logger[_0x6578('0x17')](_0x6578('0x24'),_0x3e6b54);logger[_0x6578('0x12')](_0x6578('0x24'),_0x3e6b54,JSON[_0x6578('0x13')](_0x244d81));_0xbc2e57(_0x244d81);})[_0x6578('0x23')](function(_0x2d23d1){logger[_0x6578('0x14')](_0x6578('0x24'),_0x2d23d1[_0x6578('0x16')],_0x3e6b54);_0x460c30(_0x47e375['error'](0x1f4,_0x2d23d1['message']));});});};
\ No newline at end of file
+var _0x7432=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','VoiceQueue','findAll','options','raw','where','include','map','attributes','model','GetVoiceQueue','ShowVoiceQueue','find','util','ioredis','../../mysqldb','../../config/utils'];(function(_0x45b663,_0x1f9910){var _0x390b7c=function(_0x42dd5f){while(--_0x42dd5f){_0x45b663['push'](_0x45b663['shift']());}};_0x390b7c(++_0x1f9910);}(_0x7432,0x1ea));var _0x2743=function(_0x5729b8,_0x2e7e48){_0x5729b8=_0x5729b8-0x0;var _0xd8db8e=_0x7432[_0x5729b8];return _0xd8db8e;};'use strict';var _=require('lodash');var util=require(_0x2743('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2743('0x1'));var db=require(_0x2743('0x2'))['db'];var utils=require(_0x2743('0x3'));var logger=require(_0x2743('0x4'))(_0x2743('0x5'));var config=require(_0x2743('0x6'));var jayson=require(_0x2743('0x7'));var client=jayson[_0x2743('0x8')][_0x2743('0x9')]({'port':0x232a});config[_0x2743('0xa')]=_['defaults'](config['redis'],{'host':_0x2743('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2743('0xa')]));require(_0x2743('0xc'))[_0x2743('0xd')](socket);function respondWithRpcPromise(_0x44d277,_0x4dd562,_0x2e458f){return new BPromise(function(_0x49ff2d,_0x3072ef){return client[_0x2743('0xe')](_0x44d277,_0x2e458f)[_0x2743('0xf')](function(_0x172c51){logger[_0x2743('0x10')](_0x2743('0x11'),_0x4dd562,_0x2743('0x12'));logger[_0x2743('0x13')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x4dd562,_0x2743('0x12'),JSON[_0x2743('0x14')](_0x172c51));if(_0x172c51[_0x2743('0x15')]){if(_0x172c51[_0x2743('0x15')][_0x2743('0x16')]===0x1f4){logger[_0x2743('0x15')](_0x2743('0x11'),_0x4dd562,_0x172c51['error'][_0x2743('0x17')]);return _0x3072ef(_0x172c51[_0x2743('0x15')][_0x2743('0x17')]);}logger['error'](_0x2743('0x11'),_0x4dd562,_0x172c51[_0x2743('0x15')][_0x2743('0x17')]);return _0x49ff2d(_0x172c51[_0x2743('0x15')][_0x2743('0x17')]);}else{logger[_0x2743('0x10')](_0x2743('0x11'),_0x4dd562,_0x2743('0x12'));_0x49ff2d(_0x172c51[_0x2743('0x18')][_0x2743('0x17')]);}})[_0x2743('0x19')](function(_0x1c4115){logger[_0x2743('0x15')](_0x2743('0x11'),_0x4dd562,_0x1c4115);_0x3072ef(_0x1c4115);});});}exports['GetVoiceQueue']=function(_0x40a420){var _0x22589a=this;return new Promise(function(_0x5e1919,_0x3ec6b4){return db[_0x2743('0x1a')][_0x2743('0x1b')]({'raw':_0x40a420[_0x2743('0x1c')]?_0x40a420[_0x2743('0x1c')][_0x2743('0x1d')]===undefined?!![]:![]:!![],'where':_0x40a420[_0x2743('0x1c')]?_0x40a420[_0x2743('0x1c')][_0x2743('0x1e')]||null:null,'attributes':_0x40a420[_0x2743('0x1c')]?_0x40a420[_0x2743('0x1c')]['attributes']||null:null,'limit':_0x40a420['options']?_0x40a420['options']['limit']||null:null,'include':_0x40a420[_0x2743('0x1c')]?_0x40a420['options'][_0x2743('0x1f')]?_[_0x2743('0x20')](_0x40a420[_0x2743('0x1c')][_0x2743('0x1f')],function(_0xed5f08){return{'model':db[_0xed5f08['model']],'as':_0xed5f08['as'],'attributes':_0xed5f08[_0x2743('0x21')],'include':_0xed5f08['include']?_[_0x2743('0x20')](_0xed5f08[_0x2743('0x1f')],function(_0x527a0a){return{'model':db[_0x527a0a[_0x2743('0x22')]],'as':_0x527a0a['as'],'attributes':_0x527a0a[_0x2743('0x21')],'include':_0x527a0a[_0x2743('0x1f')]?_[_0x2743('0x20')](_0x527a0a[_0x2743('0x1f')],function(_0x4a5700){return{'model':db[_0x4a5700[_0x2743('0x22')]],'as':_0x4a5700['as'],'attributes':_0x4a5700[_0x2743('0x21')]};}):[]};}):[]};}):[]:[]})[_0x2743('0xf')](function(_0x39364e){logger[_0x2743('0x10')](_0x2743('0x23'),_0x40a420);logger[_0x2743('0x13')](_0x2743('0x23'),_0x40a420,JSON[_0x2743('0x14')](_0x39364e));_0x5e1919(_0x39364e);})['catch'](function(_0x329fde){logger[_0x2743('0x15')](_0x2743('0x23'),_0x329fde[_0x2743('0x17')],_0x40a420);_0x3ec6b4(_0x22589a['error'](0x1f4,_0x329fde['message']));});});};exports[_0x2743('0x24')]=function(_0x15ae2e){var _0x19c16b=this;return new Promise(function(_0x2fe491,_0x56a0bf){return db[_0x2743('0x1a')][_0x2743('0x25')]({'raw':_0x15ae2e[_0x2743('0x1c')]?_0x15ae2e['options'][_0x2743('0x1d')]===undefined?!![]:![]:!![],'where':_0x15ae2e['options']?_0x15ae2e[_0x2743('0x1c')][_0x2743('0x1e')]||null:null,'attributes':_0x15ae2e['options']?_0x15ae2e['options'][_0x2743('0x21')]||null:null,'include':_0x15ae2e['options']?_0x15ae2e['options'][_0x2743('0x1f')]?_[_0x2743('0x20')](_0x15ae2e[_0x2743('0x1c')][_0x2743('0x1f')],function(_0x1134b6){return{'model':db[_0x1134b6[_0x2743('0x22')]],'as':_0x1134b6['as'],'attributes':_0x1134b6[_0x2743('0x21')],'include':_0x1134b6[_0x2743('0x1f')]?_[_0x2743('0x20')](_0x1134b6['include'],function(_0x20eb82){return{'model':db[_0x20eb82[_0x2743('0x22')]],'as':_0x20eb82['as'],'attributes':_0x20eb82[_0x2743('0x21')],'include':_0x20eb82['include']?_['map'](_0x20eb82[_0x2743('0x1f')],function(_0x1814db){return{'model':db[_0x1814db[_0x2743('0x22')]],'as':_0x1814db['as'],'attributes':_0x1814db['attributes']};}):[]};}):[]};}):[]:[]})[_0x2743('0xf')](function(_0x1af154){logger['info'](_0x2743('0x24'),_0x15ae2e);logger[_0x2743('0x13')]('ShowVoiceQueue',_0x15ae2e,JSON[_0x2743('0x14')](_0x1af154));_0x2fe491(_0x1af154);})[_0x2743('0x19')](function(_0x1dbfef){logger[_0x2743('0x15')](_0x2743('0x24'),_0x1dbfef[_0x2743('0x17')],_0x15ae2e);_0x56a0bf(_0x19c16b[_0x2743('0x15')](0x1f4,_0x1dbfef[_0x2743('0x17')]));});});};
\ No newline at end of file
index c765934..e5cf2a0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2333=['remove','update','emit','removeListener','register','length','./voiceQueue.events'];(function(_0x197897,_0x237e45){var _0x5c2932=function(_0x587914){while(--_0x587914){_0x197897['push'](_0x197897['shift']());}};_0x5c2932(++_0x237e45);}(_0x2333,0x148));var _0x3233=function(_0x4f785a,_0x14d24e){_0x4f785a=_0x4f785a-0x0;var _0x13dd1a=_0x2333[_0x4f785a];return _0x13dd1a;};'use strict';var VoiceQueueEvents=require(_0x3233('0x0'));var events=['save',_0x3233('0x1'),_0x3233('0x2')];function createListener(_0x5b715c,_0x514374){return function(_0x3fc7a2){_0x514374[_0x3233('0x3')](_0x5b715c,_0x3fc7a2);};}function removeListener(_0x533ee6,_0x3b4313){return function(){VoiceQueueEvents[_0x3233('0x4')](_0x533ee6,_0x3b4313);};}exports[_0x3233('0x5')]=function(_0x28646b){for(var _0xe46384=0x0,_0xb14693=events[_0x3233('0x6')];_0xe46384<_0xb14693;_0xe46384++){var _0x3b2018=events[_0xe46384];var _0x799ebb=createListener('voiceQueue:'+_0x3b2018,_0x28646b);VoiceQueueEvents['on'](_0x3b2018,_0x799ebb);}};
\ No newline at end of file
+var _0x7062=['emit','removeListener','length','voiceQueue:','save'];(function(_0x5506d0,_0x4b5687){var _0x2c4b26=function(_0x144ec2){while(--_0x144ec2){_0x5506d0['push'](_0x5506d0['shift']());}};_0x2c4b26(++_0x4b5687);}(_0x7062,0x144));var _0x2706=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x7062[_0xfae23b];return _0x200640;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x2706('0x0'),'remove','update'];function createListener(_0x2211d1,_0x18e0cb){return function(_0x17bedd){_0x18e0cb[_0x2706('0x1')](_0x2211d1,_0x17bedd);};}function removeListener(_0x412c8f,_0x2f45f6){return function(){VoiceQueueEvents[_0x2706('0x2')](_0x412c8f,_0x2f45f6);};}exports['register']=function(_0x3d7e6c){for(var _0x22cfdd=0x0,_0x5cc3ad=events[_0x2706('0x3')];_0x22cfdd<_0x5cc3ad;_0x22cfdd++){var _0x3a03cb=events[_0x22cfdd];var _0x1919a0=createListener(_0x2706('0x4')+_0x3a03cb,_0x3d7e6c);VoiceQueueEvents['on'](_0x3a03cb,_0x1919a0);}};
\ No newline at end of file
index 496572f..e286e3b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6600=['/:id','isAuthenticated','post','put','update','delete','destroy','util','path','../../components/auth/service','../../components/interaction/service','get','/describe','describe','getVoiceQueuesReport'];(function(_0x13b3b7,_0x5c39c0){var _0xe21777=function(_0xeed1e9){while(--_0xeed1e9){_0x13b3b7['push'](_0x13b3b7['shift']());}};_0xe21777(++_0x5c39c0);}(_0x6600,0x106));var _0x0660=function(_0x28c8cc,_0x231acc){_0x28c8cc=_0x28c8cc-0x0;var _0x1a24fc=_0x6600[_0x28c8cc];return _0x1a24fc;};'use strict';var multer=require('multer');var util=require(_0x0660('0x0'));var path=require(_0x0660('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x0660('0x2'));var interaction=require(_0x0660('0x3'));var config=require('../../config/environment');var controller=require('./voiceQueueReport.controller');router[_0x0660('0x4')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0660('0x5'),auth['isAuthenticated'](),controller[_0x0660('0x6')]);router[_0x0660('0x4')]('/index',auth['isAuthenticated'](),controller[_0x0660('0x7')]);router['get'](_0x0660('0x8'),auth[_0x0660('0x9')](),controller['show']);router[_0x0660('0xa')]('/',auth[_0x0660('0x9')](),controller['create']);router[_0x0660('0xb')](_0x0660('0x8'),auth[_0x0660('0x9')](),controller[_0x0660('0xc')]);router[_0x0660('0xd')]('/:id',auth[_0x0660('0x9')](),controller[_0x0660('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x45ce=['post','create','put','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','describe','/index','getVoiceQueuesReport','/:id','show'];(function(_0x511078,_0x559727){var _0x28d32b=function(_0x5efdfd){while(--_0x5efdfd){_0x511078['push'](_0x511078['shift']());}};_0x28d32b(++_0x559727);}(_0x45ce,0xb7));var _0xe45c=function(_0x2b6ad8,_0x42cbd2){_0x2b6ad8=_0x2b6ad8-0x0;var _0xa97a91=_0x45ce[_0x2b6ad8];return _0xa97a91;};'use strict';var multer=require('multer');var util=require(_0xe45c('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe45c('0x1'));var router=express[_0xe45c('0x2')]();var fs_extra=require(_0xe45c('0x3'));var auth=require(_0xe45c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe45c('0x5'));var controller=require(_0xe45c('0x6'));router[_0xe45c('0x7')]('/',auth[_0xe45c('0x8')](),controller[_0xe45c('0x9')]);router[_0xe45c('0x7')]('/describe',auth[_0xe45c('0x8')](),controller[_0xe45c('0xa')]);router[_0xe45c('0x7')](_0xe45c('0xb'),auth[_0xe45c('0x8')](),controller[_0xe45c('0xc')]);router['get'](_0xe45c('0xd'),auth[_0xe45c('0x8')](),controller[_0xe45c('0xe')]);router[_0xe45c('0xf')]('/',auth[_0xe45c('0x8')](),controller[_0xe45c('0x10')]);router[_0xe45c('0x11')](_0xe45c('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xe45c('0xd'),auth[_0xe45c('0x8')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 5588c03..b50ea97 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c31=['DATE','getDataValue','format','seconds','queuecallerleaveAt','setDataValue','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING'];(function(_0x32d457,_0x1a39c9){var _0x338386=function(_0x199d7a){while(--_0x199d7a){_0x32d457['push'](_0x32d457['shift']());}};_0x338386(++_0x1a39c9);}(_0x0c31,0x1e6));var _0x10c3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0c31[_0x4565bf];return _0x5610ba;};'use strict';var Sequelize=require(_0x10c3('0x0'));var moment=require(_0x10c3('0x1'));module[_0x10c3('0x2')]={'type':{'type':Sequelize[_0x10c3('0x3')]},'uniqueid':{'type':Sequelize[_0x10c3('0x3')]},'calleridnum':{'type':Sequelize[_0x10c3('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x10c3('0x3')]},'queuecallerjoinAt':{'type':Sequelize[_0x10c3('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x10c3('0x4')],'set':function(_0x214acb){var _0x1def86=moment(_0x214acb);var _0x42925e=moment(this[_0x10c3('0x5')]('queuecallerjoinAt'))[_0x10c3('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0x17b838=_0x1def86['diff'](_0x42925e,_0x10c3('0x7'));this['setDataValue'](_0x10c3('0x8'),_0x214acb);this[_0x10c3('0x9')](_0x10c3('0xa'),_0x17b838||null);}},'position':{'type':Sequelize[_0x10c3('0xb')]},'count':{'type':Sequelize[_0x10c3('0xb')]},'queuecallerabandon':{'type':Sequelize[_0x10c3('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x10c3('0x4')]},'queuecallerexit':{'type':Sequelize[_0x10c3('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x10c3('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x10c3('0x3')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x10c3('0x3')]},'connectedlinenum':{'type':Sequelize[_0x10c3('0x3')]},'connectedlinename':{'type':Sequelize[_0x10c3('0x3')]},'accountcode':{'type':Sequelize[_0x10c3('0x3')]},'context':{'type':Sequelize[_0x10c3('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x10c3('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x10c3('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x10c3('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x10c3('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':_0x10c3('0xd')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x10c3('0x3')]},'disposition':{'type':Sequelize[_0x10c3('0x3')]},'secondDisposition':{'type':Sequelize[_0x10c3('0x3')]},'thirdDisposition':{'type':Sequelize[_0x10c3('0x3')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}};
\ No newline at end of file
+var _0x6578=['holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt','setDataValue'];(function(_0x22aa36,_0x3826bc){var _0x113a30=function(_0x2b1154){while(--_0x2b1154){_0x22aa36['push'](_0x22aa36['shift']());}};_0x113a30(++_0x3826bc);}(_0x6578,0x1b5));var _0x8657=function(_0x4788e9,_0x3eb1f4){_0x4788e9=_0x4788e9-0x0;var _0x5b7115=_0x6578[_0x4788e9];return _0x5b7115;};'use strict';var Sequelize=require(_0x8657('0x0'));var moment=require(_0x8657('0x1'));module[_0x8657('0x2')]={'type':{'type':Sequelize[_0x8657('0x3')]},'uniqueid':{'type':Sequelize[_0x8657('0x3')]},'calleridnum':{'type':Sequelize[_0x8657('0x3')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x8657('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x457888){var _0x1737cb=moment(_0x457888);var _0x597f88=moment(this[_0x8657('0x5')](_0x8657('0x6')))[_0x8657('0x7')](_0x8657('0x8'));var _0x60e71a=_0x1737cb[_0x8657('0x9')](_0x597f88,_0x8657('0xa'));this['setDataValue'](_0x8657('0xb'),_0x457888);this[_0x8657('0xc')](_0x8657('0xd'),_0x60e71a||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x8657('0xe')]},'queuecallerabandon':{'type':Sequelize[_0x8657('0xf')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x8657('0xf')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x8657('0x4')]},'queuecallerexit':{'type':Sequelize[_0x8657('0xf')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x8657('0x3')],'comment':_0x8657('0x10')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x8657('0x3')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x8657('0x3')]},'accountcode':{'type':Sequelize[_0x8657('0x3')]},'context':{'type':Sequelize[_0x8657('0x3')]},'exten':{'type':Sequelize[_0x8657('0x3')]},'priority':{'type':Sequelize[_0x8657('0x3')]},'holdtime':{'type':Sequelize[_0x8657('0xe')]},'mohtime':{'type':Sequelize[_0x8657('0xe')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8657('0xf')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x8657('0x3')]},'transfer':{'type':Sequelize[_0x8657('0xf')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8657('0x3')],'comment':_0x8657('0x11')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x8657('0x3')]},'disposition':{'type':Sequelize[_0x8657('0x3')]},'secondDisposition':{'type':Sequelize[_0x8657('0x3')]},'thirdDisposition':{'type':Sequelize[_0x8657('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x8657('0xe')],'defaultValue':0x0}};
\ No newline at end of file
index 7a43071..46bc2c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeb88=['querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','describe','hasOwnProperty','sort','pick','getVoiceQueuesReport','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js'];(function(_0x37cafa,_0x12b559){var _0x24c098=function(_0x2265e1){while(--_0x2265e1){_0x37cafa['push'](_0x37cafa['shift']());}};_0x24c098(++_0x12b559);}(_0xeb88,0x1d6));var _0x8eb8=function(_0x1daa49,_0x47e17a){_0x1daa49=_0x1daa49-0x0;var _0x2108e0=_0xeb88[_0x1daa49];return _0x2108e0;};'use strict';var emlformat=require(_0x8eb8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8eb8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8eb8('0x2'));var moment=require(_0x8eb8('0x3'));var BPromise=require(_0x8eb8('0x4'));var Mustache=require('mustache');var util=require(_0x8eb8('0x5'));var path=require(_0x8eb8('0x6'));var sox=require(_0x8eb8('0x7'));var csv=require(_0x8eb8('0x8'));var ejs=require(_0x8eb8('0x9'));var fs=require('fs');var fs_extra=require(_0x8eb8('0xa'));var _=require(_0x8eb8('0xb'));var squel=require(_0x8eb8('0xc'));var crypto=require(_0x8eb8('0xd'));var jsforce=require(_0x8eb8('0xe'));var deskjs=require(_0x8eb8('0xf'));var toCsv=require(_0x8eb8('0x8'));var querystring=require(_0x8eb8('0x10'));var Papa=require('papaparse');var Redis=require(_0x8eb8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8eb8('0x12'));var as=require(_0x8eb8('0x13'));var hardwareService=require(_0x8eb8('0x14'));var logger=require(_0x8eb8('0x15'))('api');var utils=require(_0x8eb8('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8eb8('0x17'))['db'];config[_0x8eb8('0x18')]=_[_0x8eb8('0x19')](config[_0x8eb8('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8eb8('0x18')]));require('./voiceQueueReport.socket')['register'](socket);function respondWithStatusCode(_0x1dfe90,_0x2789c8){_0x2789c8=_0x2789c8||0xcc;return function(_0xb4cd52){if(_0xb4cd52){return _0x1dfe90[_0x8eb8('0x1a')](_0x2789c8);}return _0x1dfe90[_0x8eb8('0x1b')](_0x2789c8)[_0x8eb8('0x1c')]();};}function respondWithResult(_0x4dda84,_0x5e8ab2){_0x5e8ab2=_0x5e8ab2||0xc8;return function(_0x2691f5){if(_0x2691f5){return _0x4dda84[_0x8eb8('0x1b')](_0x5e8ab2)[_0x8eb8('0x1d')](_0x2691f5);}};}function respondWithFilteredResult(_0x1272b1,_0x4896d5){return function(_0x54a3ce){if(_0x54a3ce){var _0x2d328d=typeof _0x4896d5[_0x8eb8('0x1e')]===_0x8eb8('0x1f')&&typeof _0x4896d5[_0x8eb8('0x20')]==='undefined';var _0x51ddb4=_0x54a3ce[_0x8eb8('0x21')];var _0x2ae550=_0x2d328d?0x0:_0x4896d5[_0x8eb8('0x1e')];var _0x1a09b3=_0x2d328d?_0x54a3ce[_0x8eb8('0x21')]:_0x4896d5[_0x8eb8('0x1e')]+_0x4896d5['limit'];var _0x34b499;if(_0x1a09b3>=_0x51ddb4){_0x1a09b3=_0x51ddb4;_0x34b499=0xc8;}else{_0x34b499=0xce;}_0x1272b1['status'](_0x34b499);return _0x1272b1[_0x8eb8('0x22')]('Content-Range',_0x2ae550+'-'+_0x1a09b3+'/'+_0x51ddb4)['json'](_0x54a3ce);}return null;};}function patchUpdates(_0x245dfd){return function(_0x407806){try{jsonpatch[_0x8eb8('0x23')](_0x407806,_0x245dfd,!![]);}catch(_0x1f498b){return BPromise['reject'](_0x1f498b);}return _0x407806[_0x8eb8('0x24')]();};}function saveUpdates(_0x39a601,_0xcf99e3){return function(_0x152d27){if(_0x152d27){return _0x152d27[_0x8eb8('0x25')](_0x39a601)['then'](function(_0x339ceb){return _0x339ceb;});}return null;};}function removeEntity(_0x193bc7,_0x458809){return function(_0x291e6e){if(_0x291e6e){return _0x291e6e['destroy']()[_0x8eb8('0x26')](function(){_0x193bc7[_0x8eb8('0x1b')](0xcc)[_0x8eb8('0x1c')]();});}};}function handleEntityNotFound(_0x2aef2d,_0x2bfb60){return function(_0x21e52e){if(!_0x21e52e){_0x2aef2d[_0x8eb8('0x1a')](0x194);}return _0x21e52e;};}function handleError(_0x2878da,_0x446bad){_0x446bad=_0x446bad||0x1f4;return function(_0x4ca8f2){logger[_0x8eb8('0x27')](_0x4ca8f2[_0x8eb8('0x28')]);if(_0x4ca8f2[_0x8eb8('0x29')]){delete _0x4ca8f2[_0x8eb8('0x29')];}_0x2878da[_0x8eb8('0x1b')](_0x446bad)[_0x8eb8('0x2a')](_0x4ca8f2);};}exports[_0x8eb8('0x2b')]=function(_0x23bd6c,_0xa436a3){var _0x4205aa={},_0x2173e2={},_0x2d6bff={'count':0x0,'rows':[]};var _0x305760=_[_0x8eb8('0x2c')](db[_0x8eb8('0x2d')][_0x8eb8('0x2e')],function(_0x3422f7){return{'name':_0x3422f7[_0x8eb8('0x2f')],'type':_0x3422f7[_0x8eb8('0x30')][_0x8eb8('0x31')]};});_0x2173e2[_0x8eb8('0x32')]=_[_0x8eb8('0x2c')](_0x305760,_0x8eb8('0x29'));_0x2173e2[_0x8eb8('0x33')]=_[_0x8eb8('0x34')](_0x23bd6c['query']);_0x2173e2[_0x8eb8('0x35')]=_['intersection'](_0x2173e2['model'],_0x2173e2[_0x8eb8('0x33')]);_0x4205aa[_0x8eb8('0x36')]=_[_0x8eb8('0x37')](_0x2173e2[_0x8eb8('0x32')],qs[_0x8eb8('0x38')](_0x23bd6c[_0x8eb8('0x33')]['fields']));_0x4205aa[_0x8eb8('0x36')]=_0x4205aa[_0x8eb8('0x36')][_0x8eb8('0x39')]?_0x4205aa['attributes']:_0x2173e2[_0x8eb8('0x32')];if(!_0x23bd6c[_0x8eb8('0x33')]['hasOwnProperty'](_0x8eb8('0x3a'))){_0x4205aa['limit']=qs[_0x8eb8('0x20')](_0x23bd6c[_0x8eb8('0x33')][_0x8eb8('0x20')]);_0x4205aa['offset']=qs[_0x8eb8('0x1e')](_0x23bd6c[_0x8eb8('0x33')]['offset']);}_0x4205aa[_0x8eb8('0x3b')]=qs['sort'](_0x23bd6c[_0x8eb8('0x33')]['sort']);_0x4205aa['where']=qs['filters'](_['pick'](_0x23bd6c[_0x8eb8('0x33')],_0x2173e2[_0x8eb8('0x35')]),_0x305760);if(_0x23bd6c[_0x8eb8('0x33')][_0x8eb8('0x3c')]){_0x4205aa[_0x8eb8('0x3d')]=_[_0x8eb8('0x3e')](_0x4205aa['where'],{'$or':_[_0x8eb8('0x2c')](_0x305760,function(_0x19e1b6){if(_0x19e1b6[_0x8eb8('0x30')]!==_0x8eb8('0x3f')){var _0x5aa922={};_0x5aa922[_0x19e1b6[_0x8eb8('0x29')]]={'$like':'%'+_0x23bd6c[_0x8eb8('0x33')][_0x8eb8('0x3c')]+'%'};return _0x5aa922;}})});}_0x4205aa=_[_0x8eb8('0x3e')]({},_0x4205aa,_0x23bd6c[_0x8eb8('0x40')]);var _0x3b372a={'where':_0x4205aa[_0x8eb8('0x3d')]};return db[_0x8eb8('0x2d')]['count'](_0x3b372a)[_0x8eb8('0x26')](function(_0x1c275e){_0x2d6bff[_0x8eb8('0x21')]=_0x1c275e;if(_0x23bd6c[_0x8eb8('0x33')][_0x8eb8('0x41')]){_0x4205aa['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0x8eb8('0x42')](_0x4205aa);})['then'](function(_0x58e585){_0x2d6bff[_0x8eb8('0x43')]=_0x58e585;return _0x2d6bff;})[_0x8eb8('0x26')](respondWithFilteredResult(_0xa436a3,_0x4205aa))[_0x8eb8('0x44')](handleError(_0xa436a3,null));};exports[_0x8eb8('0x45')]=function(_0x9f8732,_0x5581d7){var _0x5a469b={'raw':![],'where':{'id':_0x9f8732[_0x8eb8('0x46')]['id']}},_0x50aad0={};_0x50aad0[_0x8eb8('0x32')]=_[_0x8eb8('0x34')](db[_0x8eb8('0x2d')][_0x8eb8('0x2e')]);_0x50aad0[_0x8eb8('0x33')]=_[_0x8eb8('0x34')](_0x9f8732['query']);_0x50aad0[_0x8eb8('0x35')]=_[_0x8eb8('0x37')](_0x50aad0['model'],_0x50aad0[_0x8eb8('0x33')]);_0x5a469b[_0x8eb8('0x36')]=_['intersection'](_0x50aad0['model'],qs[_0x8eb8('0x38')](_0x9f8732['query'][_0x8eb8('0x38')]));_0x5a469b[_0x8eb8('0x36')]=_0x5a469b['attributes'][_0x8eb8('0x39')]?_0x5a469b[_0x8eb8('0x36')]:_0x50aad0[_0x8eb8('0x32')];if(_0x9f8732[_0x8eb8('0x33')][_0x8eb8('0x41')]){_0x5a469b[_0x8eb8('0x47')]=[{'all':!![]}];}_0x5a469b=_[_0x8eb8('0x3e')]({},_0x5a469b,_0x9f8732[_0x8eb8('0x40')]);return db[_0x8eb8('0x2d')][_0x8eb8('0x48')](_0x5a469b)[_0x8eb8('0x26')](handleEntityNotFound(_0x5581d7,null))[_0x8eb8('0x26')](respondWithResult(_0x5581d7,null))[_0x8eb8('0x44')](handleError(_0x5581d7,null));};exports[_0x8eb8('0x49')]=function(_0x29fdce,_0x5b3048){return db[_0x8eb8('0x2d')][_0x8eb8('0x49')](_0x29fdce['body'],{})['then'](respondWithResult(_0x5b3048,0xc9))['catch'](handleError(_0x5b3048,null));};exports[_0x8eb8('0x25')]=function(_0x48a8a1,_0x2c20fc){if(_0x48a8a1[_0x8eb8('0x4a')]['id']){delete _0x48a8a1[_0x8eb8('0x4a')]['id'];}return db['VoiceQueueReport']['find']({'where':{'id':_0x48a8a1['params']['id']}})[_0x8eb8('0x26')](handleEntityNotFound(_0x2c20fc,null))[_0x8eb8('0x26')](saveUpdates(_0x48a8a1[_0x8eb8('0x4a')],null))[_0x8eb8('0x26')](respondWithResult(_0x2c20fc,null))['catch'](handleError(_0x2c20fc,null));};exports[_0x8eb8('0x4b')]=function(_0x4c7ac7,_0x3d1a08){return db[_0x8eb8('0x2d')][_0x8eb8('0x48')]({'where':{'id':_0x4c7ac7[_0x8eb8('0x46')]['id']}})[_0x8eb8('0x26')](handleEntityNotFound(_0x3d1a08,null))['then'](removeEntity(_0x3d1a08,null))[_0x8eb8('0x44')](handleError(_0x3d1a08,null));};exports[_0x8eb8('0x4c')]=function(_0x44be87,_0x18d3e6){return db[_0x8eb8('0x2d')]['describe']()[_0x8eb8('0x26')](respondWithResult(_0x18d3e6,null))[_0x8eb8('0x44')](handleError(_0x18d3e6,null));};exports['getVoiceQueuesReport']=function(_0x18f20e,_0x22719c){var _0x47d77a={},_0x32512e={},_0x5a1d4b={'count':0x0,'rows':[]};_0x32512e[_0x8eb8('0x32')]=_['keys'](db[_0x8eb8('0x2d')][_0x8eb8('0x2e')]);_0x32512e[_0x8eb8('0x33')]=_[_0x8eb8('0x34')](_0x18f20e[_0x8eb8('0x33')]);_0x32512e[_0x8eb8('0x35')]=_[_0x8eb8('0x37')](_0x32512e[_0x8eb8('0x32')],_0x32512e[_0x8eb8('0x33')]);_0x47d77a[_0x8eb8('0x36')]=_['intersection'](_0x32512e[_0x8eb8('0x32')],qs['fields'](_0x18f20e['query'][_0x8eb8('0x38')]));_0x47d77a[_0x8eb8('0x36')]=_0x47d77a[_0x8eb8('0x36')][_0x8eb8('0x39')]?_0x47d77a[_0x8eb8('0x36')]:_0x32512e['model'];if(!_0x18f20e[_0x8eb8('0x33')][_0x8eb8('0x4d')](_0x8eb8('0x3a'))){_0x47d77a['limit']=qs[_0x8eb8('0x20')](_0x18f20e[_0x8eb8('0x33')][_0x8eb8('0x20')]);_0x47d77a[_0x8eb8('0x1e')]=qs[_0x8eb8('0x1e')](_0x18f20e['query']['offset']);}_0x47d77a['order']=qs['sort'](_0x18f20e[_0x8eb8('0x33')][_0x8eb8('0x4e')]);_0x47d77a['where']=qs['filters'](_[_0x8eb8('0x4f')](_0x18f20e['query'],_0x32512e['filters']));if(_0x18f20e[_0x8eb8('0x33')][_0x8eb8('0x3c')]){_0x47d77a[_0x8eb8('0x3d')]=_[_0x8eb8('0x3e')](_0x47d77a[_0x8eb8('0x3d')],{'$or':_[_0x8eb8('0x2c')](_0x47d77a[_0x8eb8('0x36')],function(_0x4feb8d){var _0x5bfa13={};_0x5bfa13[_0x4feb8d]={'$like':'%'+_0x18f20e[_0x8eb8('0x33')][_0x8eb8('0x3c')]+'%'};return _0x5bfa13;})});}_0x47d77a=_[_0x8eb8('0x3e')]({},_0x47d77a,_0x18f20e['options']);var _0x45fcd8={'where':_0x47d77a[_0x8eb8('0x3d')]};return db[_0x8eb8('0x2d')][_0x8eb8('0x21')](_0x45fcd8)[_0x8eb8('0x26')](function(_0x1cec4f){_0x5a1d4b[_0x8eb8('0x21')]=_0x1cec4f;if(_0x18f20e[_0x8eb8('0x33')][_0x8eb8('0x41')]){_0x47d77a[_0x8eb8('0x47')]=[{'all':!![]}];}return db[_0x8eb8('0x2d')][_0x8eb8('0x42')](_0x47d77a);})[_0x8eb8('0x26')](function(_0x1b056){_0x5a1d4b['rows']=_0x1b056;return _0x5a1d4b;})[_0x8eb8('0x26')](respondWithFilteredResult(_0x22719c,_0x47d77a,_0x8eb8('0x50')))[_0x8eb8('0x44')](handleError(_0x22719c,null,'getVoiceQueuesReport'));};
\ No newline at end of file
+var _0x3a42=['findAll','show','params','keys','intersection','includeAll','catch','create','body','find','describe','getVoiceQueuesReport','rows','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3a42,0x169));var _0x23a4=function(_0x4f1b04,_0x44b7b2){_0x4f1b04=_0x4f1b04-0x0;var _0x4a42c9=_0x3a42[_0x4f1b04];return _0x4a42c9;};'use strict';var emlformat=require(_0x23a4('0x0'));var rimraf=require(_0x23a4('0x1'));var zipdir=require(_0x23a4('0x2'));var jsonpatch=require(_0x23a4('0x3'));var rp=require(_0x23a4('0x4'));var moment=require(_0x23a4('0x5'));var BPromise=require(_0x23a4('0x6'));var Mustache=require(_0x23a4('0x7'));var util=require(_0x23a4('0x8'));var path=require(_0x23a4('0x9'));var sox=require(_0x23a4('0xa'));var csv=require(_0x23a4('0xb'));var ejs=require(_0x23a4('0xc'));var fs=require('fs');var fs_extra=require(_0x23a4('0xd'));var _=require(_0x23a4('0xe'));var squel=require('squel');var crypto=require(_0x23a4('0xf'));var jsforce=require(_0x23a4('0x10'));var deskjs=require(_0x23a4('0x11'));var toCsv=require(_0x23a4('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x23a4('0x12'));var qs=require(_0x23a4('0x13'));var as=require(_0x23a4('0x14'));var hardwareService=require(_0x23a4('0x15'));var logger=require(_0x23a4('0x16'))('api');var utils=require(_0x23a4('0x17'));var config=require(_0x23a4('0x18'));var licenseUtil=require(_0x23a4('0x19'));var db=require(_0x23a4('0x1a'))['db'];config[_0x23a4('0x1b')]=_[_0x23a4('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x23a4('0x1d'))(new Redis(config[_0x23a4('0x1b')]));require(_0x23a4('0x1e'))[_0x23a4('0x1f')](socket);function respondWithStatusCode(_0x543bdd,_0xb83635){_0xb83635=_0xb83635||0xcc;return function(_0x22c3bb){if(_0x22c3bb){return _0x543bdd[_0x23a4('0x20')](_0xb83635);}return _0x543bdd['status'](_0xb83635)[_0x23a4('0x21')]();};}function respondWithResult(_0x5f4809,_0x444de0){_0x444de0=_0x444de0||0xc8;return function(_0x340054){if(_0x340054){return _0x5f4809[_0x23a4('0x22')](_0x444de0)[_0x23a4('0x23')](_0x340054);}};}function respondWithFilteredResult(_0x10c7e1,_0x5c6c87){return function(_0x4678a8){if(_0x4678a8){var _0x5b8253=typeof _0x5c6c87[_0x23a4('0x24')]==='undefined'&&typeof _0x5c6c87[_0x23a4('0x25')]===_0x23a4('0x26');var _0x485fba=_0x4678a8[_0x23a4('0x27')];var _0x2a751f=_0x5b8253?0x0:_0x5c6c87[_0x23a4('0x24')];var _0x260fc7=_0x5b8253?_0x4678a8[_0x23a4('0x27')]:_0x5c6c87[_0x23a4('0x24')]+_0x5c6c87[_0x23a4('0x25')];var _0x15f8bd;if(_0x260fc7>=_0x485fba){_0x260fc7=_0x485fba;_0x15f8bd=0xc8;}else{_0x15f8bd=0xce;}_0x10c7e1[_0x23a4('0x22')](_0x15f8bd);return _0x10c7e1[_0x23a4('0x28')](_0x23a4('0x29'),_0x2a751f+'-'+_0x260fc7+'/'+_0x485fba)['json'](_0x4678a8);}return null;};}function patchUpdates(_0x359e91){return function(_0x1acfb9){try{jsonpatch[_0x23a4('0x2a')](_0x1acfb9,_0x359e91,!![]);}catch(_0x2106d3){return BPromise[_0x23a4('0x2b')](_0x2106d3);}return _0x1acfb9[_0x23a4('0x2c')]();};}function saveUpdates(_0xd421cf,_0x18ee24){return function(_0x1908ef){if(_0x1908ef){return _0x1908ef['update'](_0xd421cf)[_0x23a4('0x2d')](function(_0x2bbbf2){return _0x2bbbf2;});}return null;};}function removeEntity(_0x57c817,_0x149c8e){return function(_0x397571){if(_0x397571){return _0x397571[_0x23a4('0x2e')]()[_0x23a4('0x2d')](function(){_0x57c817[_0x23a4('0x22')](0xcc)[_0x23a4('0x21')]();});}};}function handleEntityNotFound(_0x5873e1,_0x15498d){return function(_0x13c5b6){if(!_0x13c5b6){_0x5873e1[_0x23a4('0x20')](0x194);}return _0x13c5b6;};}function handleError(_0x291d83,_0x1f70ba){_0x1f70ba=_0x1f70ba||0x1f4;return function(_0x507f89){logger[_0x23a4('0x2f')](_0x507f89['stack']);if(_0x507f89[_0x23a4('0x30')]){delete _0x507f89[_0x23a4('0x30')];}_0x291d83[_0x23a4('0x22')](_0x1f70ba)[_0x23a4('0x31')](_0x507f89);};}exports[_0x23a4('0x32')]=function(_0x5ebd84,_0x33af7f){var _0x22ccee={},_0xa7fed7={},_0x26e55b={'count':0x0,'rows':[]};var _0x540914=_[_0x23a4('0x33')](db[_0x23a4('0x34')][_0x23a4('0x35')],function(_0x4fa668){return{'name':_0x4fa668[_0x23a4('0x36')],'type':_0x4fa668[_0x23a4('0x37')][_0x23a4('0x38')]};});_0xa7fed7[_0x23a4('0x39')]=_[_0x23a4('0x33')](_0x540914,_0x23a4('0x30'));_0xa7fed7[_0x23a4('0x3a')]=_['keys'](_0x5ebd84[_0x23a4('0x3a')]);_0xa7fed7['filters']=_['intersection'](_0xa7fed7[_0x23a4('0x39')],_0xa7fed7[_0x23a4('0x3a')]);_0x22ccee['attributes']=_['intersection'](_0xa7fed7[_0x23a4('0x39')],qs['fields'](_0x5ebd84[_0x23a4('0x3a')][_0x23a4('0x3b')]));_0x22ccee[_0x23a4('0x3c')]=_0x22ccee['attributes'][_0x23a4('0x3d')]?_0x22ccee[_0x23a4('0x3c')]:_0xa7fed7[_0x23a4('0x39')];if(!_0x5ebd84[_0x23a4('0x3a')][_0x23a4('0x3e')](_0x23a4('0x3f'))){_0x22ccee['limit']=qs[_0x23a4('0x25')](_0x5ebd84[_0x23a4('0x3a')]['limit']);_0x22ccee[_0x23a4('0x24')]=qs[_0x23a4('0x24')](_0x5ebd84[_0x23a4('0x3a')][_0x23a4('0x24')]);}_0x22ccee[_0x23a4('0x40')]=qs[_0x23a4('0x41')](_0x5ebd84[_0x23a4('0x3a')][_0x23a4('0x41')]);_0x22ccee['where']=qs[_0x23a4('0x42')](_[_0x23a4('0x43')](_0x5ebd84[_0x23a4('0x3a')],_0xa7fed7[_0x23a4('0x42')]),_0x540914);if(_0x5ebd84['query'][_0x23a4('0x44')]){_0x22ccee[_0x23a4('0x45')]=_[_0x23a4('0x46')](_0x22ccee['where'],{'$or':_['map'](_0x540914,function(_0x520a83){if(_0x520a83['type']!==_0x23a4('0x47')){var _0x5eeada={};_0x5eeada[_0x520a83[_0x23a4('0x30')]]={'$like':'%'+_0x5ebd84['query'][_0x23a4('0x44')]+'%'};return _0x5eeada;}})});}_0x22ccee=_[_0x23a4('0x46')]({},_0x22ccee,_0x5ebd84[_0x23a4('0x48')]);var _0x393700={'where':_0x22ccee[_0x23a4('0x45')]};return db[_0x23a4('0x34')][_0x23a4('0x27')](_0x393700)['then'](function(_0x3f8af0){_0x26e55b[_0x23a4('0x27')]=_0x3f8af0;if(_0x5ebd84[_0x23a4('0x3a')]['includeAll']){_0x22ccee[_0x23a4('0x49')]=[{'all':!![]}];}return db[_0x23a4('0x34')][_0x23a4('0x4a')](_0x22ccee);})[_0x23a4('0x2d')](function(_0x47447d){_0x26e55b['rows']=_0x47447d;return _0x26e55b;})[_0x23a4('0x2d')](respondWithFilteredResult(_0x33af7f,_0x22ccee))['catch'](handleError(_0x33af7f,null));};exports[_0x23a4('0x4b')]=function(_0x4ef581,_0x36f1cd){var _0x5dee07={'raw':![],'where':{'id':_0x4ef581[_0x23a4('0x4c')]['id']}},_0x3d5043={};_0x3d5043['model']=_['keys'](db[_0x23a4('0x34')][_0x23a4('0x35')]);_0x3d5043[_0x23a4('0x3a')]=_[_0x23a4('0x4d')](_0x4ef581[_0x23a4('0x3a')]);_0x3d5043[_0x23a4('0x42')]=_[_0x23a4('0x4e')](_0x3d5043[_0x23a4('0x39')],_0x3d5043[_0x23a4('0x3a')]);_0x5dee07[_0x23a4('0x3c')]=_['intersection'](_0x3d5043[_0x23a4('0x39')],qs['fields'](_0x4ef581['query']['fields']));_0x5dee07[_0x23a4('0x3c')]=_0x5dee07[_0x23a4('0x3c')]['length']?_0x5dee07['attributes']:_0x3d5043[_0x23a4('0x39')];if(_0x4ef581[_0x23a4('0x3a')][_0x23a4('0x4f')]){_0x5dee07[_0x23a4('0x49')]=[{'all':!![]}];}_0x5dee07=_['merge']({},_0x5dee07,_0x4ef581['options']);return db[_0x23a4('0x34')]['find'](_0x5dee07)[_0x23a4('0x2d')](handleEntityNotFound(_0x36f1cd,null))[_0x23a4('0x2d')](respondWithResult(_0x36f1cd,null))[_0x23a4('0x50')](handleError(_0x36f1cd,null));};exports[_0x23a4('0x51')]=function(_0x182f0e,_0x204845){return db[_0x23a4('0x34')][_0x23a4('0x51')](_0x182f0e[_0x23a4('0x52')],{})[_0x23a4('0x2d')](respondWithResult(_0x204845,0xc9))['catch'](handleError(_0x204845,null));};exports['update']=function(_0x2aba4b,_0x2c6f0a){if(_0x2aba4b[_0x23a4('0x52')]['id']){delete _0x2aba4b[_0x23a4('0x52')]['id'];}return db['VoiceQueueReport'][_0x23a4('0x53')]({'where':{'id':_0x2aba4b[_0x23a4('0x4c')]['id']}})[_0x23a4('0x2d')](handleEntityNotFound(_0x2c6f0a,null))[_0x23a4('0x2d')](saveUpdates(_0x2aba4b[_0x23a4('0x52')],null))[_0x23a4('0x2d')](respondWithResult(_0x2c6f0a,null))[_0x23a4('0x50')](handleError(_0x2c6f0a,null));};exports[_0x23a4('0x2e')]=function(_0x499783,_0x2ea260){return db['VoiceQueueReport'][_0x23a4('0x53')]({'where':{'id':_0x499783[_0x23a4('0x4c')]['id']}})[_0x23a4('0x2d')](handleEntityNotFound(_0x2ea260,null))[_0x23a4('0x2d')](removeEntity(_0x2ea260,null))['catch'](handleError(_0x2ea260,null));};exports[_0x23a4('0x54')]=function(_0x23e7a0,_0x36f674){return db['VoiceQueueReport'][_0x23a4('0x54')]()[_0x23a4('0x2d')](respondWithResult(_0x36f674,null))[_0x23a4('0x50')](handleError(_0x36f674,null));};exports[_0x23a4('0x55')]=function(_0x499b7f,_0x1e629d){var _0x4fb5f9={},_0x329edc={},_0x55ac8={'count':0x0,'rows':[]};_0x329edc[_0x23a4('0x39')]=_[_0x23a4('0x4d')](db['VoiceQueueReport'][_0x23a4('0x35')]);_0x329edc[_0x23a4('0x3a')]=_['keys'](_0x499b7f[_0x23a4('0x3a')]);_0x329edc[_0x23a4('0x42')]=_['intersection'](_0x329edc[_0x23a4('0x39')],_0x329edc[_0x23a4('0x3a')]);_0x4fb5f9[_0x23a4('0x3c')]=_[_0x23a4('0x4e')](_0x329edc[_0x23a4('0x39')],qs[_0x23a4('0x3b')](_0x499b7f[_0x23a4('0x3a')][_0x23a4('0x3b')]));_0x4fb5f9[_0x23a4('0x3c')]=_0x4fb5f9[_0x23a4('0x3c')][_0x23a4('0x3d')]?_0x4fb5f9[_0x23a4('0x3c')]:_0x329edc['model'];if(!_0x499b7f[_0x23a4('0x3a')][_0x23a4('0x3e')](_0x23a4('0x3f'))){_0x4fb5f9[_0x23a4('0x25')]=qs[_0x23a4('0x25')](_0x499b7f['query']['limit']);_0x4fb5f9[_0x23a4('0x24')]=qs['offset'](_0x499b7f[_0x23a4('0x3a')][_0x23a4('0x24')]);}_0x4fb5f9['order']=qs['sort'](_0x499b7f[_0x23a4('0x3a')]['sort']);_0x4fb5f9['where']=qs[_0x23a4('0x42')](_[_0x23a4('0x43')](_0x499b7f[_0x23a4('0x3a')],_0x329edc[_0x23a4('0x42')]));if(_0x499b7f[_0x23a4('0x3a')][_0x23a4('0x44')]){_0x4fb5f9[_0x23a4('0x45')]=_['merge'](_0x4fb5f9[_0x23a4('0x45')],{'$or':_[_0x23a4('0x33')](_0x4fb5f9[_0x23a4('0x3c')],function(_0x5e0266){var _0x462a17={};_0x462a17[_0x5e0266]={'$like':'%'+_0x499b7f[_0x23a4('0x3a')][_0x23a4('0x44')]+'%'};return _0x462a17;})});}_0x4fb5f9=_[_0x23a4('0x46')]({},_0x4fb5f9,_0x499b7f[_0x23a4('0x48')]);var _0x546318={'where':_0x4fb5f9[_0x23a4('0x45')]};return db[_0x23a4('0x34')][_0x23a4('0x27')](_0x546318)[_0x23a4('0x2d')](function(_0x162ab4){_0x55ac8[_0x23a4('0x27')]=_0x162ab4;if(_0x499b7f['query'][_0x23a4('0x4f')]){_0x4fb5f9[_0x23a4('0x49')]=[{'all':!![]}];}return db[_0x23a4('0x34')][_0x23a4('0x4a')](_0x4fb5f9);})[_0x23a4('0x2d')](function(_0x48a55c){_0x55ac8[_0x23a4('0x56')]=_0x48a55c;return _0x55ac8;})[_0x23a4('0x2d')](respondWithFilteredResult(_0x1e629d,_0x4fb5f9,'getVoiceQueuesReport'))[_0x23a4('0x50')](handleError(_0x1e629d,null,_0x23a4('0x55')));};
\ No newline at end of file
index d2497aa..ee74b68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaad1=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','save','update'];(function(_0xb805ef,_0x46622a){var _0x225871=function(_0x80c688){while(--_0x80c688){_0xb805ef['push'](_0xb805ef['shift']());}};_0x225871(++_0x46622a);}(_0xaad1,0x181));var _0x1aad=function(_0x3265b3,_0x328e45){_0x3265b3=_0x3265b3-0x0;var _0x5b959b=_0xaad1[_0x3265b3];return _0x5b959b;};'use strict';var EventEmitter=require(_0x1aad('0x0'));var VoiceQueueReport=require(_0x1aad('0x1'))['db'][_0x1aad('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1aad('0x3'),'afterUpdate':_0x1aad('0x4'),'afterDestroy':_0x1aad('0x5')};function emitEvent(_0x18593f){return function(_0x31a801,_0x21f945,_0x5ad296){VoiceQueueReportEvents[_0x1aad('0x6')](_0x18593f+':'+_0x31a801['id'],_0x31a801);VoiceQueueReportEvents[_0x1aad('0x6')](_0x18593f,_0x31a801);_0x5ad296(null);};}for(var e in events){if(events[_0x1aad('0x7')](e)){var event=events[e];VoiceQueueReport[_0x1aad('0x8')](e,emitEvent(event));}}module[_0x1aad('0x9')]=VoiceQueueReportEvents;
\ No newline at end of file
+var _0xb8a0=['hook','exports','events','VoiceQueueReport','setMaxListeners','save','remove','hasOwnProperty'];(function(_0x1ae5ba,_0x32ba42){var _0x3e41be=function(_0x5f4841){while(--_0x5f4841){_0x1ae5ba['push'](_0x1ae5ba['shift']());}};_0x3e41be(++_0x32ba42);}(_0xb8a0,0x82));var _0x0b8a=function(_0x142746,_0x36f737){_0x142746=_0x142746-0x0;var _0x2248df=_0xb8a0[_0x142746];return _0x2248df;};'use strict';var EventEmitter=require(_0x0b8a('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0x0b8a('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x0b8a('0x2')](0x0);var events={'afterCreate':_0x0b8a('0x3'),'afterUpdate':'update','afterDestroy':_0x0b8a('0x4')};function emitEvent(_0x1aa4ab){return function(_0x4ac76e,_0x3a4f31,_0x3f344d){VoiceQueueReportEvents['emit'](_0x1aa4ab+':'+_0x4ac76e['id'],_0x4ac76e);VoiceQueueReportEvents['emit'](_0x1aa4ab,_0x4ac76e);_0x3f344d(null);};}for(var e in events){if(events[_0x0b8a('0x5')](e)){var event=events[e];VoiceQueueReport[_0x0b8a('0x6')](e,emitEvent(event));}}module[_0x0b8a('0x7')]=VoiceQueueReportEvents;
\ No newline at end of file
index 6f2fb2f..0886813 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b2a=['VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','define'];(function(_0x4b1450,_0x56a5ed){var _0x2dad91=function(_0x5baed4){while(--_0x5baed4){_0x4b1450['push'](_0x4b1450['shift']());}};_0x2dad91(++_0x56a5ed);}(_0x1b2a,0x13c));var _0xa1b2=function(_0x2c081b,_0xd7e1c5){_0x2c081b=_0x2c081b-0x0;var _0x2ebbd1=_0x1b2a[_0x2c081b];return _0x2ebbd1;};'use strict';var _=require(_0xa1b2('0x0'));var util=require('util');var logger=require(_0xa1b2('0x1'))(_0xa1b2('0x2'));var moment=require('moment');var BPromise=require(_0xa1b2('0x3'));var rp=require(_0xa1b2('0x4'));var fs=require('fs');var path=require(_0xa1b2('0x5'));var rimraf=require('rimraf');var config=require(_0xa1b2('0x6'));var attributes=require('./voiceQueueReport.attributes');module['exports']=function(_0x1a731a,_0x3d863f){return _0x1a731a[_0xa1b2('0x7')](_0xa1b2('0x8'),attributes,{'tableName':_0xa1b2('0x9'),'paranoid':![],'indexes':[{'fields':[_0xa1b2('0xa')]},{'fields':[_0xa1b2('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x24b0=['../../config/logger','moment','bluebird','request-promise','path','rimraf','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util'];(function(_0x4c7b20,_0x361515){var _0x4872bd=function(_0x358e19){while(--_0x358e19){_0x4c7b20['push'](_0x4c7b20['shift']());}};_0x4872bd(++_0x361515);}(_0x24b0,0x166));var _0x024b=function(_0x35980d,_0x400d86){_0x35980d=_0x35980d-0x0;var _0xd46e43=_0x24b0[_0x35980d];return _0xd46e43;};'use strict';var _=require(_0x024b('0x0'));var util=require(_0x024b('0x1'));var logger=require(_0x024b('0x2'))('api');var moment=require(_0x024b('0x3'));var BPromise=require(_0x024b('0x4'));var rp=require(_0x024b('0x5'));var fs=require('fs');var path=require(_0x024b('0x6'));var rimraf=require(_0x024b('0x7'));var config=require('../../config/environment');var attributes=require(_0x024b('0x8'));module[_0x024b('0x9')]=function(_0x256082,_0x83a70d){return _0x256082[_0x024b('0xa')](_0x024b('0xb'),attributes,{'tableName':_0x024b('0xc'),'paranoid':![],'indexes':[{'fields':[_0x024b('0xd')]},{'fields':[_0x024b('0xe')]}],'timestamps':!![]});};
\ No newline at end of file
index fb08fe8..73ade0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x591b=['error','code','message','catch','GetVoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','update','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./voiceQueueReport.socket','register','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x511eaa,_0x31d9b0){var _0x961fa7=function(_0x21b11a){while(--_0x21b11a){_0x511eaa['push'](_0x511eaa['shift']());}};_0x961fa7(++_0x31d9b0);}(_0x591b,0x102));var _0xb591=function(_0x8de950,_0x2fb767){_0x8de950=_0x8de950-0x0;var _0x305afb=_0x591b[_0x8de950];return _0x305afb;};'use strict';var _=require('lodash');var util=require(_0xb591('0x0'));var moment=require(_0xb591('0x1'));var BPromise=require(_0xb591('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb591('0x3'));var db=require(_0xb591('0x4'))['db'];var utils=require(_0xb591('0x5'));var logger=require(_0xb591('0x6'))(_0xb591('0x7'));var config=require(_0xb591('0x8'));var jayson=require(_0xb591('0x9'));var client=jayson[_0xb591('0xa')][_0xb591('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb591('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb591('0xd'))[_0xb591('0xe')](socket);function respondWithRpcPromise(_0x3605ac,_0x183b73,_0x3c2e17){return new BPromise(function(_0x49d521,_0x5c6c98){return client['request'](_0x3605ac,_0x3c2e17)[_0xb591('0xf')](function(_0xb4c5db){logger[_0xb591('0x10')](_0xb591('0x11'),_0x183b73,_0xb591('0x12'));logger[_0xb591('0x13')](_0xb591('0x14'),_0x183b73,_0xb591('0x12'),JSON[_0xb591('0x15')](_0xb4c5db));if(_0xb4c5db[_0xb591('0x16')]){if(_0xb4c5db[_0xb591('0x16')][_0xb591('0x17')]===0x1f4){logger[_0xb591('0x16')](_0xb591('0x11'),_0x183b73,_0xb4c5db[_0xb591('0x16')][_0xb591('0x18')]);return _0x5c6c98(_0xb4c5db[_0xb591('0x16')][_0xb591('0x18')]);}logger[_0xb591('0x16')](_0xb591('0x11'),_0x183b73,_0xb4c5db[_0xb591('0x16')][_0xb591('0x18')]);return _0x49d521(_0xb4c5db[_0xb591('0x16')][_0xb591('0x18')]);}else{logger[_0xb591('0x10')]('VoiceQueueReport,\x20%s,\x20%s',_0x183b73,_0xb591('0x12'));_0x49d521(_0xb4c5db['result']['message']);}})[_0xb591('0x19')](function(_0x54843b){logger[_0xb591('0x16')](_0xb591('0x11'),_0x183b73,_0x54843b);_0x5c6c98(_0x54843b);});});}exports[_0xb591('0x1a')]=function(_0x19f8b8){var _0x5c9ae9=this;return new Promise(function(_0x431ec5,_0x533fde){return db['VoiceQueueReport'][_0xb591('0x1b')]({'raw':_0x19f8b8['options']?_0x19f8b8[_0xb591('0x1c')][_0xb591('0x1d')]===undefined?!![]:![]:!![],'where':_0x19f8b8[_0xb591('0x1c')]?_0x19f8b8['options'][_0xb591('0x1e')]||null:null,'attributes':_0x19f8b8['options']?_0x19f8b8['options'][_0xb591('0x1f')]||null:null,'limit':_0x19f8b8[_0xb591('0x1c')]?_0x19f8b8[_0xb591('0x1c')][_0xb591('0x20')]||null:null,'include':_0x19f8b8['options']?_0x19f8b8['options'][_0xb591('0x21')]?_[_0xb591('0x22')](_0x19f8b8['options'][_0xb591('0x21')],function(_0x3f940a){return{'model':db[_0x3f940a[_0xb591('0x23')]],'as':_0x3f940a['as'],'attributes':_0x3f940a['attributes'],'include':_0x3f940a['include']?_[_0xb591('0x22')](_0x3f940a['include'],function(_0x179655){return{'model':db[_0x179655[_0xb591('0x23')]],'as':_0x179655['as'],'attributes':_0x179655['attributes'],'include':_0x179655[_0xb591('0x21')]?_[_0xb591('0x22')](_0x179655[_0xb591('0x21')],function(_0x38a246){return{'model':db[_0x38a246[_0xb591('0x23')]],'as':_0x38a246['as'],'attributes':_0x38a246[_0xb591('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb591('0xf')](function(_0xf8f750){logger[_0xb591('0x10')](_0xb591('0x1a'),_0x19f8b8);logger[_0xb591('0x13')](_0xb591('0x1a'),_0x19f8b8,JSON[_0xb591('0x15')](_0xf8f750));_0x431ec5(_0xf8f750);})[_0xb591('0x19')](function(_0x3dc191){logger['error'](_0xb591('0x1a'),_0x3dc191[_0xb591('0x18')],_0x19f8b8);_0x533fde(_0x5c9ae9[_0xb591('0x16')](0x1f4,_0x3dc191[_0xb591('0x18')]));});});};exports[_0xb591('0x24')]=function(_0x563f4f){var _0x41679d=this;return new Promise(function(_0x483817,_0x1752c9){return db['VoiceQueueReport']['create'](_0x563f4f[_0xb591('0x25')],{'raw':_0x563f4f[_0xb591('0x1c')]?_0x563f4f[_0xb591('0x1c')][_0xb591('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x36868a){logger[_0xb591('0x10')](_0xb591('0x24'),_0x563f4f);logger[_0xb591('0x13')]('CreateVoiceQueueReport',_0x563f4f,JSON[_0xb591('0x15')](_0x36868a));_0x483817(_0x36868a);})[_0xb591('0x19')](function(_0x3d4f25){logger[_0xb591('0x16')](_0xb591('0x24'),_0x3d4f25[_0xb591('0x18')],_0x563f4f);_0x1752c9(_0x41679d['error'](0x1f4,_0x3d4f25['message']));});});};exports[_0xb591('0x26')]=function(_0x44f9b1){var _0x5782d1=this;return new Promise(function(_0x26710c,_0x42e98d){return db['VoiceQueueReport'][_0xb591('0x27')](_0x44f9b1[_0xb591('0x25')],{'raw':_0x44f9b1[_0xb591('0x1c')]?_0x44f9b1[_0xb591('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44f9b1[_0xb591('0x1c')]?_0x44f9b1[_0xb591('0x1c')]['where']||null:null,'attributes':_0x44f9b1[_0xb591('0x1c')]?_0x44f9b1[_0xb591('0x1c')]['attributes']||null:null,'limit':_0x44f9b1[_0xb591('0x1c')]?_0x44f9b1[_0xb591('0x1c')][_0xb591('0x20')]||null:null})[_0xb591('0xf')](function(_0x4e5085){logger[_0xb591('0x10')](_0xb591('0x26'),_0x44f9b1);logger[_0xb591('0x13')]('UpdateVoiceQueueReport',_0x44f9b1,JSON[_0xb591('0x15')](_0x4e5085));_0x26710c(_0x4e5085);})[_0xb591('0x19')](function(_0x142352){logger[_0xb591('0x16')]('UpdateVoiceQueueReport',_0x142352[_0xb591('0x18')],_0x44f9b1);_0x42e98d(_0x5782d1[_0xb591('0x16')](0x1f4,_0x142352[_0xb591('0x18')]));});});};
\ No newline at end of file
+var _0xc30a=['catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','include','map','model','attributes','stringify','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','limit','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','redis','defaults','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','error','message','result'];(function(_0x183b18,_0x243de5){var _0xad9a35=function(_0x1acc55){while(--_0x1acc55){_0x183b18['push'](_0x183b18['shift']());}};_0xad9a35(++_0x243de5);}(_0xc30a,0x137));var _0xac30=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xc30a[_0x4e9628];return _0x27bc8c;};'use strict';var _=require('lodash');var util=require(_0xac30('0x0'));var moment=require(_0xac30('0x1'));var BPromise=require('bluebird');var rs=require(_0xac30('0x2'));var fs=require('fs');var Redis=require(_0xac30('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xac30('0x4'));var logger=require(_0xac30('0x5'))(_0xac30('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xac30('0x7')]['http']({'port':0x232a});config[_0xac30('0x8')]=_[_0xac30('0x9')](config[_0xac30('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xac30('0x8')]));require(_0xac30('0xa'))[_0xac30('0xb')](socket);function respondWithRpcPromise(_0x4cfcd4,_0x237199,_0xe6cddb){return new BPromise(function(_0xbdd5ba,_0x488567){return client[_0xac30('0xc')](_0x4cfcd4,_0xe6cddb)[_0xac30('0xd')](function(_0x41b9ba){logger[_0xac30('0xe')](_0xac30('0xf'),_0x237199,_0xac30('0x10'));logger[_0xac30('0x11')](_0xac30('0x12'),_0x237199,_0xac30('0x10'),JSON['stringify'](_0x41b9ba));if(_0x41b9ba['error']){if(_0x41b9ba['error']['code']===0x1f4){logger[_0xac30('0x13')]('VoiceQueueReport,\x20%s,\x20%s',_0x237199,_0x41b9ba[_0xac30('0x13')][_0xac30('0x14')]);return _0x488567(_0x41b9ba[_0xac30('0x13')][_0xac30('0x14')]);}logger['error'](_0xac30('0xf'),_0x237199,_0x41b9ba[_0xac30('0x13')][_0xac30('0x14')]);return _0xbdd5ba(_0x41b9ba[_0xac30('0x13')][_0xac30('0x14')]);}else{logger['info'](_0xac30('0xf'),_0x237199,'request\x20sent');_0xbdd5ba(_0x41b9ba[_0xac30('0x15')][_0xac30('0x14')]);}})[_0xac30('0x16')](function(_0x3bd13e){logger[_0xac30('0x13')](_0xac30('0xf'),_0x237199,_0x3bd13e);_0x488567(_0x3bd13e);});});}exports[_0xac30('0x17')]=function(_0x5351d8){var _0x3f5644=this;return new Promise(function(_0x423f13,_0x48ee92){return db[_0xac30('0x18')]['findAll']({'raw':_0x5351d8[_0xac30('0x19')]?_0x5351d8[_0xac30('0x19')][_0xac30('0x1a')]===undefined?!![]:![]:!![],'where':_0x5351d8[_0xac30('0x19')]?_0x5351d8[_0xac30('0x19')]['where']||null:null,'attributes':_0x5351d8[_0xac30('0x19')]?_0x5351d8[_0xac30('0x19')]['attributes']||null:null,'limit':_0x5351d8[_0xac30('0x19')]?_0x5351d8['options']['limit']||null:null,'include':_0x5351d8[_0xac30('0x19')]?_0x5351d8['options'][_0xac30('0x1b')]?_[_0xac30('0x1c')](_0x5351d8[_0xac30('0x19')][_0xac30('0x1b')],function(_0x1eb66f){return{'model':db[_0x1eb66f[_0xac30('0x1d')]],'as':_0x1eb66f['as'],'attributes':_0x1eb66f['attributes'],'include':_0x1eb66f[_0xac30('0x1b')]?_[_0xac30('0x1c')](_0x1eb66f[_0xac30('0x1b')],function(_0x506d3c){return{'model':db[_0x506d3c[_0xac30('0x1d')]],'as':_0x506d3c['as'],'attributes':_0x506d3c[_0xac30('0x1e')],'include':_0x506d3c['include']?_[_0xac30('0x1c')](_0x506d3c[_0xac30('0x1b')],function(_0x117ce1){return{'model':db[_0x117ce1[_0xac30('0x1d')]],'as':_0x117ce1['as'],'attributes':_0x117ce1[_0xac30('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xac30('0xd')](function(_0x4005ae){logger[_0xac30('0xe')](_0xac30('0x17'),_0x5351d8);logger['debug'](_0xac30('0x17'),_0x5351d8,JSON[_0xac30('0x1f')](_0x4005ae));_0x423f13(_0x4005ae);})[_0xac30('0x16')](function(_0x4a2ba0){logger[_0xac30('0x13')](_0xac30('0x17'),_0x4a2ba0[_0xac30('0x14')],_0x5351d8);_0x48ee92(_0x3f5644[_0xac30('0x13')](0x1f4,_0x4a2ba0[_0xac30('0x14')]));});});};exports[_0xac30('0x20')]=function(_0x247f6c){var _0x2debe2=this;return new Promise(function(_0x3a87c4,_0x18991d){return db[_0xac30('0x18')][_0xac30('0x21')](_0x247f6c[_0xac30('0x22')],{'raw':_0x247f6c[_0xac30('0x19')]?_0x247f6c[_0xac30('0x19')][_0xac30('0x1a')]===undefined?!![]:![]:!![]})[_0xac30('0xd')](function(_0x27ce82){logger['info'](_0xac30('0x20'),_0x247f6c);logger[_0xac30('0x11')]('CreateVoiceQueueReport',_0x247f6c,JSON[_0xac30('0x1f')](_0x27ce82));_0x3a87c4(_0x27ce82);})[_0xac30('0x16')](function(_0x360a6f){logger[_0xac30('0x13')](_0xac30('0x20'),_0x360a6f[_0xac30('0x14')],_0x247f6c);_0x18991d(_0x2debe2[_0xac30('0x13')](0x1f4,_0x360a6f['message']));});});};exports[_0xac30('0x23')]=function(_0x238651){var _0x3ea6c1=this;return new Promise(function(_0x511c16,_0x465e83){return db['VoiceQueueReport']['update'](_0x238651[_0xac30('0x22')],{'raw':_0x238651['options']?_0x238651[_0xac30('0x19')][_0xac30('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x238651[_0xac30('0x19')]?_0x238651[_0xac30('0x19')]['where']||null:null,'attributes':_0x238651[_0xac30('0x19')]?_0x238651['options'][_0xac30('0x1e')]||null:null,'limit':_0x238651['options']?_0x238651[_0xac30('0x19')][_0xac30('0x24')]||null:null})[_0xac30('0xd')](function(_0x4d8d59){logger[_0xac30('0xe')](_0xac30('0x23'),_0x238651);logger[_0xac30('0x11')](_0xac30('0x23'),_0x238651,JSON[_0xac30('0x1f')](_0x4d8d59));_0x511c16(_0x4d8d59);})['catch'](function(_0x1972e2){logger['error']('UpdateVoiceQueueReport',_0x1972e2['message'],_0x238651);_0x465e83(_0x3ea6c1[_0xac30('0x13')](0x1f4,_0x1972e2[_0xac30('0x14')]));});});};
\ No newline at end of file
index 25e6ff7..357b9d4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb13b=['remove','update','emit','removeListener','register','length','./voiceQueueReport.events','save'];(function(_0x172449,_0x5c569b){var _0x49abc7=function(_0x1ced33){while(--_0x1ced33){_0x172449['push'](_0x172449['shift']());}};_0x49abc7(++_0x5c569b);}(_0xb13b,0x1de));var _0xbb13=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xb13b[_0x4b2436];return _0x4f5ab2;};'use strict';var VoiceQueueReportEvents=require(_0xbb13('0x0'));var events=[_0xbb13('0x1'),_0xbb13('0x2'),_0xbb13('0x3')];function createListener(_0x625b76,_0x4c5102){return function(_0x1719ed){_0x4c5102[_0xbb13('0x4')](_0x625b76,_0x1719ed);};}function removeListener(_0x50898d,_0x9eab1b){return function(){VoiceQueueReportEvents[_0xbb13('0x5')](_0x50898d,_0x9eab1b);};}exports[_0xbb13('0x6')]=function(_0x464c50){for(var _0x296632=0x0,_0xd4a4bd=events[_0xbb13('0x7')];_0x296632<_0xd4a4bd;_0x296632++){var _0x3be2d2=events[_0x296632];var _0x56dc8f=createListener('voiceQueueReport:'+_0x3be2d2,_0x464c50);VoiceQueueReportEvents['on'](_0x3be2d2,_0x56dc8f);}};
\ No newline at end of file
+var _0xbeff=['removeListener','register','save','remove','update'];(function(_0xaac208,_0x29f03){var _0x1ad453=function(_0x204c1d){while(--_0x204c1d){_0xaac208['push'](_0xaac208['shift']());}};_0x1ad453(++_0x29f03);}(_0xbeff,0x8e));var _0xfbef=function(_0x3a432b,_0x30b6b8){_0x3a432b=_0x3a432b-0x0;var _0x205181=_0xbeff[_0x3a432b];return _0x205181;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xfbef('0x0'),_0xfbef('0x1'),_0xfbef('0x2')];function createListener(_0x304d07,_0x114ed7){return function(_0x4fb975){_0x114ed7['emit'](_0x304d07,_0x4fb975);};}function removeListener(_0x474798,_0x387be8){return function(){VoiceQueueReportEvents[_0xfbef('0x3')](_0x474798,_0x387be8);};}exports[_0xfbef('0x4')]=function(_0x5496a6){for(var _0x295f40=0x0,_0x2ed5bc=events['length'];_0x295f40<_0x2ed5bc;_0x295f40++){var _0x257f3a=events[_0x295f40];var _0x43e95e=createListener('voiceQueueReport:'+_0x257f3a,_0x5496a6);VoiceQueueReportEvents['on'](_0x257f3a,_0x43e95e);}};
\ No newline at end of file
index 5c958ba..5134127 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda3c=['destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','/:id','show','post','create','put','delete'];(function(_0x1307b8,_0x1bfffe){var _0x3965b0=function(_0x39057c){while(--_0x39057c){_0x1307b8['push'](_0x1307b8['shift']());}};_0x3965b0(++_0x1bfffe);}(_0xda3c,0x79));var _0xcda3=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xda3c[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xcda3('0x0'));var util=require(_0xcda3('0x1'));var path=require(_0xcda3('0x2'));var timeout=require(_0xcda3('0x3'));var express=require(_0xcda3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xcda3('0x5'));var config=require('../../config/environment');var controller=require(_0xcda3('0x6'));router[_0xcda3('0x7')]('/',auth[_0xcda3('0x8')](),controller['index']);router['get'](_0xcda3('0x9'),auth[_0xcda3('0x8')](),controller[_0xcda3('0xa')]);router[_0xcda3('0xb')]('/',auth[_0xcda3('0x8')](),controller[_0xcda3('0xc')]);router[_0xcda3('0xd')]('/:id',auth[_0xcda3('0x8')](),controller['update']);router[_0xcda3('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xcda3('0xf')]);module[_0xcda3('0x10')]=router;
\ No newline at end of file
+var _0x853b=['./voiceQueuesLog.controller','isAuthenticated','index','get','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x8e1758,_0x48f03e){var _0x122def=function(_0x2b7788){while(--_0x2b7788){_0x8e1758['push'](_0x8e1758['shift']());}};_0x122def(++_0x48f03e);}(_0x853b,0x161));var _0xb853=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x853b[_0x432682];return _0x463d05;};'use strict';var multer=require(_0xb853('0x0'));var util=require(_0xb853('0x1'));var path=require(_0xb853('0x2'));var timeout=require(_0xb853('0x3'));var express=require('express');var router=express[_0xb853('0x4')]();var fs_extra=require(_0xb853('0x5'));var auth=require(_0xb853('0x6'));var interaction=require(_0xb853('0x7'));var config=require('../../config/environment');var controller=require(_0xb853('0x8'));router['get']('/',auth[_0xb853('0x9')](),controller[_0xb853('0xa')]);router[_0xb853('0xb')](_0xb853('0xc'),auth[_0xb853('0x9')](),controller['show']);router[_0xb853('0xd')]('/',auth[_0xb853('0x9')](),controller[_0xb853('0xe')]);router[_0xb853('0xf')](_0xb853('0xc'),auth[_0xb853('0x9')](),controller['update']);router[_0xb853('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xb853('0x11')]);module[_0xb853('0x12')]=router;
\ No newline at end of file
index 94e0f80..7cf4c5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5a2=['STRING','format','sequelize','moment','exports'];(function(_0x1b08ae,_0xac1350){var _0x23022b=function(_0xdfefbc){while(--_0xdfefbc){_0x1b08ae['push'](_0x1b08ae['shift']());}};_0x23022b(++_0xac1350);}(_0xd5a2,0x93));var _0x2d5a=function(_0xe458b6,_0x5847f8){_0xe458b6=_0xe458b6-0x0;var _0x108ac1=_0xd5a2[_0xe458b6];return _0x108ac1;};'use strict';var Sequelize=require(_0x2d5a('0x0'));var moment=require(_0x2d5a('0x1'));module[_0x2d5a('0x2')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x2d5a('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x2d5a('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x2d5a('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x2d5a('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x2d5a('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x2d5a('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x2d5a('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x2d5a('0x4')]('YYYY-MM-DD\x20HH:mm:ss')}};
\ No newline at end of file
+var _0xaafc=['format','YYYY-MM-DD\x20HH:mm:ss','moment','exports','STRING','DATE'];(function(_0x48beac,_0x29cb44){var _0x155200=function(_0x412c17){while(--_0x412c17){_0x48beac['push'](_0x48beac['shift']());}};_0x155200(++_0x29cb44);}(_0xaafc,0x176));var _0xcaaf=function(_0x56130e,_0x2b103b){_0x56130e=_0x56130e-0x0;var _0x2cc33d=_0xaafc[_0x56130e];return _0x2cc33d;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xcaaf('0x0'));module[_0xcaaf('0x1')]={'time':{'type':Sequelize[_0xcaaf('0x2')]},'callid':{'type':Sequelize[_0xcaaf('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xcaaf('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xcaaf('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xcaaf('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xcaaf('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xcaaf('0x3')],'allowNull':![],'defaultValue':moment()[_0xcaaf('0x4')](_0xcaaf('0x5'))}};
\ No newline at end of file
index e4e0f21..28f26a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0046=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0046,0x1a4));var _0x6004=function(_0x3bff95,_0x314718){_0x3bff95=_0x3bff95-0x0;var _0x42e15a=_0x0046[_0x3bff95];return _0x42e15a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6004('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6004('0x1'));var rp=require(_0x6004('0x2'));var moment=require(_0x6004('0x3'));var BPromise=require(_0x6004('0x4'));var Mustache=require('mustache');var util=require(_0x6004('0x5'));var path=require(_0x6004('0x6'));var sox=require(_0x6004('0x7'));var csv=require('to-csv');var ejs=require(_0x6004('0x8'));var fs=require('fs');var fs_extra=require(_0x6004('0x9'));var _=require(_0x6004('0xa'));var squel=require(_0x6004('0xb'));var crypto=require(_0x6004('0xc'));var jsforce=require(_0x6004('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6004('0xe'));var Papa=require(_0x6004('0xf'));var Redis=require('ioredis');var authService=require(_0x6004('0x10'));var qs=require(_0x6004('0x11'));var as=require(_0x6004('0x12'));var hardwareService=require(_0x6004('0x13'));var logger=require(_0x6004('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6004('0x15'));var db=require(_0x6004('0x16'))['db'];function respondWithStatusCode(_0x60aecc,_0x319a8d){_0x319a8d=_0x319a8d||0xcc;return function(_0x37550f){if(_0x37550f){return _0x60aecc[_0x6004('0x17')](_0x319a8d);}return _0x60aecc[_0x6004('0x18')](_0x319a8d)[_0x6004('0x19')]();};}function respondWithResult(_0x1d8188,_0x5e9acb){_0x5e9acb=_0x5e9acb||0xc8;return function(_0x25865e){if(_0x25865e){return _0x1d8188[_0x6004('0x18')](_0x5e9acb)[_0x6004('0x1a')](_0x25865e);}};}function respondWithFilteredResult(_0x3628e7,_0x4b081a){return function(_0x10363e){if(_0x10363e){var _0xb5ec1f=typeof _0x4b081a[_0x6004('0x1b')]===_0x6004('0x1c')&&typeof _0x4b081a[_0x6004('0x1d')]===_0x6004('0x1c');var _0x45dee1=_0x10363e[_0x6004('0x1e')];var _0x4c2a4f=_0xb5ec1f?0x0:_0x4b081a[_0x6004('0x1b')];var _0x19589e=_0xb5ec1f?_0x10363e[_0x6004('0x1e')]:_0x4b081a[_0x6004('0x1b')]+_0x4b081a['limit'];var _0x1fdc51;if(_0x19589e>=_0x45dee1){_0x19589e=_0x45dee1;_0x1fdc51=0xc8;}else{_0x1fdc51=0xce;}_0x3628e7['status'](_0x1fdc51);return _0x3628e7[_0x6004('0x1f')](_0x6004('0x20'),_0x4c2a4f+'-'+_0x19589e+'/'+_0x45dee1)[_0x6004('0x1a')](_0x10363e);}return null;};}function patchUpdates(_0x55c92e){return function(_0x97e162){try{jsonpatch[_0x6004('0x21')](_0x97e162,_0x55c92e,!![]);}catch(_0x2fd465){return BPromise['reject'](_0x2fd465);}return _0x97e162[_0x6004('0x22')]();};}function saveUpdates(_0x584ccd,_0xe7047f){return function(_0x3f3dfd){if(_0x3f3dfd){return _0x3f3dfd[_0x6004('0x23')](_0x584ccd)['then'](function(_0x2c50d4){return _0x2c50d4;});}return null;};}function removeEntity(_0x1686ad,_0x1d60ed){return function(_0x5d5cac){if(_0x5d5cac){return _0x5d5cac[_0x6004('0x24')]()[_0x6004('0x25')](function(){_0x1686ad[_0x6004('0x18')](0xcc)[_0x6004('0x19')]();});}};}function handleEntityNotFound(_0x229c0c,_0x208f03){return function(_0x27c1ec){if(!_0x27c1ec){_0x229c0c[_0x6004('0x17')](0x194);}return _0x27c1ec;};}function handleError(_0x44b283,_0x16d5f6){_0x16d5f6=_0x16d5f6||0x1f4;return function(_0x4c128e){logger['error'](_0x4c128e[_0x6004('0x26')]);if(_0x4c128e[_0x6004('0x27')]){delete _0x4c128e[_0x6004('0x27')];}_0x44b283[_0x6004('0x18')](_0x16d5f6)[_0x6004('0x28')](_0x4c128e);};}exports[_0x6004('0x29')]=function(_0x424730,_0x2ea73b){var _0x42a67c={},_0x3fe66f={},_0x25074a={'count':0x0,'rows':[]};var _0x384d56=_[_0x6004('0x2a')](db[_0x6004('0x2b')][_0x6004('0x2c')],function(_0x3398a6){return{'name':_0x3398a6[_0x6004('0x2d')],'type':_0x3398a6[_0x6004('0x2e')][_0x6004('0x2f')]};});_0x3fe66f[_0x6004('0x30')]=_[_0x6004('0x2a')](_0x384d56,'name');_0x3fe66f[_0x6004('0x31')]=_[_0x6004('0x32')](_0x424730['query']);_0x3fe66f[_0x6004('0x33')]=_['intersection'](_0x3fe66f['model'],_0x3fe66f[_0x6004('0x31')]);_0x42a67c[_0x6004('0x34')]=_[_0x6004('0x35')](_0x3fe66f[_0x6004('0x30')],qs[_0x6004('0x36')](_0x424730[_0x6004('0x31')][_0x6004('0x36')]));_0x42a67c['attributes']=_0x42a67c['attributes']['length']?_0x42a67c['attributes']:_0x3fe66f[_0x6004('0x30')];if(!_0x424730[_0x6004('0x31')][_0x6004('0x37')](_0x6004('0x38'))){_0x42a67c['limit']=qs[_0x6004('0x1d')](_0x424730['query'][_0x6004('0x1d')]);_0x42a67c['offset']=qs['offset'](_0x424730[_0x6004('0x31')]['offset']);}_0x42a67c[_0x6004('0x39')]=qs[_0x6004('0x3a')](_0x424730[_0x6004('0x31')][_0x6004('0x3a')]);_0x42a67c[_0x6004('0x3b')]=qs[_0x6004('0x33')](_['pick'](_0x424730[_0x6004('0x31')],_0x3fe66f[_0x6004('0x33')]),_0x384d56);if(_0x424730[_0x6004('0x31')][_0x6004('0x3c')]){_0x42a67c['where']=_['merge'](_0x42a67c[_0x6004('0x3b')],{'$or':_[_0x6004('0x2a')](_0x384d56,function(_0x7b95b3){if(_0x7b95b3[_0x6004('0x2e')]!==_0x6004('0x3d')){var _0x5b3fe9={};_0x5b3fe9[_0x7b95b3[_0x6004('0x27')]]={'$like':'%'+_0x424730[_0x6004('0x31')][_0x6004('0x3c')]+'%'};return _0x5b3fe9;}})});}_0x42a67c=_[_0x6004('0x3e')]({},_0x42a67c,_0x424730[_0x6004('0x3f')]);var _0x1521e7={'where':_0x42a67c[_0x6004('0x3b')]};return db[_0x6004('0x2b')][_0x6004('0x1e')](_0x1521e7)[_0x6004('0x25')](function(_0x38589e){_0x25074a[_0x6004('0x1e')]=_0x38589e;if(_0x424730[_0x6004('0x31')][_0x6004('0x40')]){_0x42a67c[_0x6004('0x41')]=[{'all':!![]}];}return db[_0x6004('0x2b')][_0x6004('0x42')](_0x42a67c);})[_0x6004('0x25')](function(_0x2138be){_0x25074a[_0x6004('0x43')]=_0x2138be;return _0x25074a;})[_0x6004('0x25')](respondWithFilteredResult(_0x2ea73b,_0x42a67c))[_0x6004('0x44')](handleError(_0x2ea73b,null));};exports['show']=function(_0x4440be,_0x27fe6d){var _0x5b9dae={'raw':!![],'where':{'id':_0x4440be[_0x6004('0x45')]['id']}},_0x5d2a84={};_0x5d2a84['model']=_[_0x6004('0x32')](db[_0x6004('0x2b')][_0x6004('0x2c')]);_0x5d2a84[_0x6004('0x31')]=_[_0x6004('0x32')](_0x4440be['query']);_0x5d2a84[_0x6004('0x33')]=_[_0x6004('0x35')](_0x5d2a84[_0x6004('0x30')],_0x5d2a84[_0x6004('0x31')]);_0x5b9dae['attributes']=_[_0x6004('0x35')](_0x5d2a84['model'],qs[_0x6004('0x36')](_0x4440be[_0x6004('0x31')][_0x6004('0x36')]));_0x5b9dae[_0x6004('0x34')]=_0x5b9dae[_0x6004('0x34')]['length']?_0x5b9dae['attributes']:_0x5d2a84['model'];if(_0x4440be[_0x6004('0x31')][_0x6004('0x40')]){_0x5b9dae[_0x6004('0x41')]=[{'all':!![]}];}_0x5b9dae=_[_0x6004('0x3e')]({},_0x5b9dae,_0x4440be[_0x6004('0x3f')]);return db[_0x6004('0x2b')][_0x6004('0x46')](_0x5b9dae)[_0x6004('0x25')](handleEntityNotFound(_0x27fe6d,null))['then'](respondWithResult(_0x27fe6d,null))[_0x6004('0x44')](handleError(_0x27fe6d,null));};exports[_0x6004('0x47')]=function(_0x474b24,_0x50257b){return db['VoiceQueuesLog'][_0x6004('0x47')](_0x474b24[_0x6004('0x48')],{})['then'](respondWithResult(_0x50257b,0xc9))[_0x6004('0x44')](handleError(_0x50257b,null));};exports['update']=function(_0x10ca09,_0x44fe37){if(_0x10ca09[_0x6004('0x48')]['id']){delete _0x10ca09[_0x6004('0x48')]['id'];}return db[_0x6004('0x2b')][_0x6004('0x46')]({'where':{'id':_0x10ca09['params']['id']}})[_0x6004('0x25')](handleEntityNotFound(_0x44fe37,null))[_0x6004('0x25')](saveUpdates(_0x10ca09['body'],null))['then'](respondWithResult(_0x44fe37,null))[_0x6004('0x44')](handleError(_0x44fe37,null));};exports[_0x6004('0x24')]=function(_0x26163f,_0x163898){return db[_0x6004('0x2b')][_0x6004('0x46')]({'where':{'id':_0x26163f[_0x6004('0x45')]['id']}})[_0x6004('0x25')](handleEntityNotFound(_0x163898,null))['then'](removeEntity(_0x163898,null))[_0x6004('0x44')](handleError(_0x163898,null));};
\ No newline at end of file
+var _0x242c=['intersection','fields','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','VoiceQueuesLog','includeAll','include','findAll','show','params','catch','create','body','destroy','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','error','name','send','index','map','rawAttributes','key','model','keys','query','filters','attributes'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x242c,0xa7));var _0xc242=function(_0x3c8757,_0x3bde2b){_0x3c8757=_0x3c8757-0x0;var _0x3baee9=_0x242c[_0x3c8757];return _0x3baee9;};'use strict';var emlformat=require(_0xc242('0x0'));var rimraf=require(_0xc242('0x1'));var zipdir=require(_0xc242('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc242('0x3'));var moment=require(_0xc242('0x4'));var BPromise=require(_0xc242('0x5'));var Mustache=require(_0xc242('0x6'));var util=require('util');var path=require(_0xc242('0x7'));var sox=require('sox');var csv=require(_0xc242('0x8'));var ejs=require(_0xc242('0x9'));var fs=require('fs');var fs_extra=require(_0xc242('0xa'));var _=require('lodash');var squel=require(_0xc242('0xb'));var crypto=require(_0xc242('0xc'));var jsforce=require(_0xc242('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc242('0x8'));var querystring=require(_0xc242('0xe'));var Papa=require(_0xc242('0xf'));var Redis=require(_0xc242('0x10'));var authService=require(_0xc242('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc242('0x12'));var logger=require('../../config/logger')(_0xc242('0x13'));var utils=require('../../config/utils');var config=require(_0xc242('0x14'));var licenseUtil=require(_0xc242('0x15'));var db=require(_0xc242('0x16'))['db'];function respondWithStatusCode(_0x305e78,_0x23cfbb){_0x23cfbb=_0x23cfbb||0xcc;return function(_0x105522){if(_0x105522){return _0x305e78[_0xc242('0x17')](_0x23cfbb);}return _0x305e78[_0xc242('0x18')](_0x23cfbb)[_0xc242('0x19')]();};}function respondWithResult(_0xcf2d06,_0x5c64df){_0x5c64df=_0x5c64df||0xc8;return function(_0xc0336a){if(_0xc0336a){return _0xcf2d06['status'](_0x5c64df)[_0xc242('0x1a')](_0xc0336a);}};}function respondWithFilteredResult(_0x118486,_0x57383c){return function(_0x2e123e){if(_0x2e123e){var _0x1056fe=typeof _0x57383c['offset']===_0xc242('0x1b')&&typeof _0x57383c[_0xc242('0x1c')]==='undefined';var _0x190374=_0x2e123e[_0xc242('0x1d')];var _0x1274ba=_0x1056fe?0x0:_0x57383c[_0xc242('0x1e')];var _0x8a6a81=_0x1056fe?_0x2e123e['count']:_0x57383c[_0xc242('0x1e')]+_0x57383c[_0xc242('0x1c')];var _0x4e73c2;if(_0x8a6a81>=_0x190374){_0x8a6a81=_0x190374;_0x4e73c2=0xc8;}else{_0x4e73c2=0xce;}_0x118486['status'](_0x4e73c2);return _0x118486[_0xc242('0x1f')](_0xc242('0x20'),_0x1274ba+'-'+_0x8a6a81+'/'+_0x190374)[_0xc242('0x1a')](_0x2e123e);}return null;};}function patchUpdates(_0x355cbb){return function(_0x24e1df){try{jsonpatch[_0xc242('0x21')](_0x24e1df,_0x355cbb,!![]);}catch(_0x4c4eb2){return BPromise[_0xc242('0x22')](_0x4c4eb2);}return _0x24e1df[_0xc242('0x23')]();};}function saveUpdates(_0x26a1c5,_0x64f4a3){return function(_0x50204a){if(_0x50204a){return _0x50204a['update'](_0x26a1c5)[_0xc242('0x24')](function(_0x1f9a2a){return _0x1f9a2a;});}return null;};}function removeEntity(_0x5f0a03,_0x51c85c){return function(_0x5d4388){if(_0x5d4388){return _0x5d4388['destroy']()['then'](function(){_0x5f0a03['status'](0xcc)[_0xc242('0x19')]();});}};}function handleEntityNotFound(_0x326204,_0x28f4d8){return function(_0x22fc96){if(!_0x22fc96){_0x326204[_0xc242('0x17')](0x194);}return _0x22fc96;};}function handleError(_0x3f98fd,_0x21eede){_0x21eede=_0x21eede||0x1f4;return function(_0x4523f8){logger[_0xc242('0x25')](_0x4523f8['stack']);if(_0x4523f8[_0xc242('0x26')]){delete _0x4523f8[_0xc242('0x26')];}_0x3f98fd[_0xc242('0x18')](_0x21eede)[_0xc242('0x27')](_0x4523f8);};}exports[_0xc242('0x28')]=function(_0x552850,_0x22bf10){var _0x2b4a99={},_0x3d9c62={},_0x251034={'count':0x0,'rows':[]};var _0x3c7f07=_[_0xc242('0x29')](db['VoiceQueuesLog'][_0xc242('0x2a')],function(_0x1f7387){return{'name':_0x1f7387['fieldName'],'type':_0x1f7387['type'][_0xc242('0x2b')]};});_0x3d9c62[_0xc242('0x2c')]=_['map'](_0x3c7f07,'name');_0x3d9c62['query']=_[_0xc242('0x2d')](_0x552850[_0xc242('0x2e')]);_0x3d9c62[_0xc242('0x2f')]=_['intersection'](_0x3d9c62[_0xc242('0x2c')],_0x3d9c62[_0xc242('0x2e')]);_0x2b4a99[_0xc242('0x30')]=_[_0xc242('0x31')](_0x3d9c62[_0xc242('0x2c')],qs[_0xc242('0x32')](_0x552850[_0xc242('0x2e')][_0xc242('0x32')]));_0x2b4a99['attributes']=_0x2b4a99[_0xc242('0x30')]['length']?_0x2b4a99[_0xc242('0x30')]:_0x3d9c62['model'];if(!_0x552850[_0xc242('0x2e')][_0xc242('0x33')]('nolimit')){_0x2b4a99[_0xc242('0x1c')]=qs['limit'](_0x552850[_0xc242('0x2e')]['limit']);_0x2b4a99['offset']=qs['offset'](_0x552850[_0xc242('0x2e')][_0xc242('0x1e')]);}_0x2b4a99[_0xc242('0x34')]=qs[_0xc242('0x35')](_0x552850[_0xc242('0x2e')][_0xc242('0x35')]);_0x2b4a99[_0xc242('0x36')]=qs[_0xc242('0x2f')](_[_0xc242('0x37')](_0x552850[_0xc242('0x2e')],_0x3d9c62[_0xc242('0x2f')]),_0x3c7f07);if(_0x552850[_0xc242('0x2e')]['filter']){_0x2b4a99['where']=_[_0xc242('0x38')](_0x2b4a99['where'],{'$or':_[_0xc242('0x29')](_0x3c7f07,function(_0x3f4957){if(_0x3f4957[_0xc242('0x39')]!==_0xc242('0x3a')){var _0x5e154e={};_0x5e154e[_0x3f4957[_0xc242('0x26')]]={'$like':'%'+_0x552850[_0xc242('0x2e')][_0xc242('0x3b')]+'%'};return _0x5e154e;}})});}_0x2b4a99=_['merge']({},_0x2b4a99,_0x552850[_0xc242('0x3c')]);var _0x2cef58={'where':_0x2b4a99[_0xc242('0x36')]};return db[_0xc242('0x3d')][_0xc242('0x1d')](_0x2cef58)[_0xc242('0x24')](function(_0x9aabce){_0x251034['count']=_0x9aabce;if(_0x552850[_0xc242('0x2e')][_0xc242('0x3e')]){_0x2b4a99[_0xc242('0x3f')]=[{'all':!![]}];}return db[_0xc242('0x3d')][_0xc242('0x40')](_0x2b4a99);})['then'](function(_0x4ad7c2){_0x251034['rows']=_0x4ad7c2;return _0x251034;})[_0xc242('0x24')](respondWithFilteredResult(_0x22bf10,_0x2b4a99))['catch'](handleError(_0x22bf10,null));};exports[_0xc242('0x41')]=function(_0x287ab1,_0x42f029){var _0x31391d={'raw':!![],'where':{'id':_0x287ab1[_0xc242('0x42')]['id']}},_0x36cf2e={};_0x36cf2e['model']=_[_0xc242('0x2d')](db[_0xc242('0x3d')][_0xc242('0x2a')]);_0x36cf2e[_0xc242('0x2e')]=_[_0xc242('0x2d')](_0x287ab1[_0xc242('0x2e')]);_0x36cf2e[_0xc242('0x2f')]=_[_0xc242('0x31')](_0x36cf2e['model'],_0x36cf2e['query']);_0x31391d[_0xc242('0x30')]=_[_0xc242('0x31')](_0x36cf2e[_0xc242('0x2c')],qs[_0xc242('0x32')](_0x287ab1[_0xc242('0x2e')][_0xc242('0x32')]));_0x31391d[_0xc242('0x30')]=_0x31391d[_0xc242('0x30')]['length']?_0x31391d[_0xc242('0x30')]:_0x36cf2e[_0xc242('0x2c')];if(_0x287ab1['query'][_0xc242('0x3e')]){_0x31391d[_0xc242('0x3f')]=[{'all':!![]}];}_0x31391d=_[_0xc242('0x38')]({},_0x31391d,_0x287ab1['options']);return db['VoiceQueuesLog']['find'](_0x31391d)[_0xc242('0x24')](handleEntityNotFound(_0x42f029,null))[_0xc242('0x24')](respondWithResult(_0x42f029,null))[_0xc242('0x43')](handleError(_0x42f029,null));};exports[_0xc242('0x44')]=function(_0x5cb4f6,_0x15c102){return db['VoiceQueuesLog'][_0xc242('0x44')](_0x5cb4f6['body'],{})[_0xc242('0x24')](respondWithResult(_0x15c102,0xc9))[_0xc242('0x43')](handleError(_0x15c102,null));};exports['update']=function(_0x12c21a,_0x1a4768){if(_0x12c21a[_0xc242('0x45')]['id']){delete _0x12c21a['body']['id'];}return db[_0xc242('0x3d')]['find']({'where':{'id':_0x12c21a[_0xc242('0x42')]['id']}})[_0xc242('0x24')](handleEntityNotFound(_0x1a4768,null))[_0xc242('0x24')](saveUpdates(_0x12c21a[_0xc242('0x45')],null))['then'](respondWithResult(_0x1a4768,null))[_0xc242('0x43')](handleError(_0x1a4768,null));};exports[_0xc242('0x46')]=function(_0x184398,_0x24a14f){return db[_0xc242('0x3d')][_0xc242('0x47')]({'where':{'id':_0x184398['params']['id']}})[_0xc242('0x24')](handleEntityNotFound(_0x24a14f,null))['then'](removeEntity(_0x24a14f,null))[_0xc242('0x43')](handleError(_0x24a14f,null));};
\ No newline at end of file
index eae3f4f..022de4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x463e=['request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x463e,0x1d6));var _0xe463=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x463e[_0xf50820];return _0x2a9b10;};'use strict';var _=require(_0xe463('0x0'));var util=require(_0xe463('0x1'));var logger=require(_0xe463('0x2'))(_0xe463('0x3'));var moment=require(_0xe463('0x4'));var BPromise=require(_0xe463('0x5'));var rp=require(_0xe463('0x6'));var fs=require('fs');var path=require(_0xe463('0x7'));var rimraf=require(_0xe463('0x8'));var config=require(_0xe463('0x9'));var attributes=require(_0xe463('0xa'));module[_0xe463('0xb')]=function(_0x4969ec,_0x4f9125){return _0x4969ec['define'](_0xe463('0xc'),attributes,{'tableName':_0xe463('0xd'),'paranoid':![],'indexes':[{'name':_0xe463('0xe'),'fields':[_0xe463('0xf'),_0xe463('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x33ed=['event','dtm','util','moment','path','rimraf','../../config/environment','VoiceQueuesLog','voice_queues_log','event_dtm'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x33ed,0x66));var _0xd33e=function(_0x95411e,_0x38b4c3){_0x95411e=_0x95411e-0x0;var _0x2c8718=_0x33ed[_0x95411e];return _0x2c8718;};'use strict';var _=require('lodash');var util=require(_0xd33e('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xd33e('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd33e('0x2'));var rimraf=require(_0xd33e('0x3'));var config=require(_0xd33e('0x4'));var attributes=require('./voiceQueuesLog.attributes');module['exports']=function(_0x19e69f,_0x230ec8){return _0x19e69f['define'](_0xd33e('0x5'),attributes,{'tableName':_0xd33e('0x6'),'paranoid':![],'indexes':[{'name':_0xd33e('0x7'),'fields':[_0xd33e('0x8'),_0xd33e('0x9')]}],'timestamps':![]});};
\ No newline at end of file
index f593e30..33f8abe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28bc=['info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x6c75da,_0x1b96d6){var _0x5f5d21=function(_0x5ef793){while(--_0x5ef793){_0x6c75da['push'](_0x6c75da['shift']());}};_0x5f5d21(++_0x1b96d6);}(_0x28bc,0x79));var _0xc28b=function(_0xd7b0a4,_0x53c7d3){_0xd7b0a4=_0xd7b0a4-0x0;var _0x184e9e=_0x28bc[_0xd7b0a4];return _0x184e9e;};'use strict';var _=require(_0xc28b('0x0'));var util=require(_0xc28b('0x1'));var moment=require(_0xc28b('0x2'));var BPromise=require(_0xc28b('0x3'));var rs=require(_0xc28b('0x4'));var fs=require('fs');var Redis=require(_0xc28b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc28b('0x6'));var logger=require(_0xc28b('0x7'))(_0xc28b('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc28b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a581d,_0x123671,_0x387746){return new BPromise(function(_0x22a92a,_0x18fc74){return client[_0xc28b('0xa')](_0x1a581d,_0x387746)[_0xc28b('0xb')](function(_0x107339){logger['info'](_0xc28b('0xc'),_0x123671,_0xc28b('0xd'));logger[_0xc28b('0xe')](_0xc28b('0xf'),_0x123671,_0xc28b('0xd'),JSON[_0xc28b('0x10')](_0x107339));if(_0x107339[_0xc28b('0x11')]){if(_0x107339[_0xc28b('0x11')]['code']===0x1f4){logger[_0xc28b('0x11')](_0xc28b('0xc'),_0x123671,_0x107339[_0xc28b('0x11')]['message']);return _0x18fc74(_0x107339[_0xc28b('0x11')]['message']);}logger['error'](_0xc28b('0xc'),_0x123671,_0x107339['error'][_0xc28b('0x12')]);return _0x22a92a(_0x107339['error'][_0xc28b('0x12')]);}else{logger[_0xc28b('0x13')](_0xc28b('0xc'),_0x123671,_0xc28b('0xd'));_0x22a92a(_0x107339['result'][_0xc28b('0x12')]);}})['catch'](function(_0x23a2c4){logger['error'](_0xc28b('0xc'),_0x123671,_0x23a2c4);_0x18fc74(_0x23a2c4);});});}
\ No newline at end of file
+var _0x3a79=['rpc','../../config/environment','client','request','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','VoiceQueuesLog,\x20%s,\x20%s','info','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3ac900,_0x138206){var _0x36f9ff=function(_0x3df908){while(--_0x3df908){_0x3ac900['push'](_0x3ac900['shift']());}};_0x36f9ff(++_0x138206);}(_0x3a79,0xca));var _0x93a7=function(_0x2578cd,_0x2bb9ef){_0x2578cd=_0x2578cd-0x0;var _0x16e469=_0x3a79[_0x2578cd];return _0x16e469;};'use strict';var _=require('lodash');var util=require(_0x93a7('0x0'));var moment=require(_0x93a7('0x1'));var BPromise=require('bluebird');var rs=require(_0x93a7('0x2'));var fs=require('fs');var Redis=require(_0x93a7('0x3'));var db=require(_0x93a7('0x4'))['db'];var utils=require(_0x93a7('0x5'));var logger=require(_0x93a7('0x6'))(_0x93a7('0x7'));var config=require(_0x93a7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x93a7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2579e5,_0x4690bb,_0x1b59d1){return new BPromise(function(_0x2417da,_0x3a512b){return client[_0x93a7('0xa')](_0x2579e5,_0x1b59d1)['then'](function(_0x2996db){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x4690bb,_0x93a7('0xb'));logger[_0x93a7('0xc')](_0x93a7('0xd'),_0x4690bb,'request\x20sent',JSON['stringify'](_0x2996db));if(_0x2996db[_0x93a7('0xe')]){if(_0x2996db[_0x93a7('0xe')][_0x93a7('0xf')]===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x4690bb,_0x2996db[_0x93a7('0xe')]['message']);return _0x3a512b(_0x2996db[_0x93a7('0xe')][_0x93a7('0x10')]);}logger[_0x93a7('0xe')](_0x93a7('0x11'),_0x4690bb,_0x2996db[_0x93a7('0xe')][_0x93a7('0x10')]);return _0x2417da(_0x2996db[_0x93a7('0xe')]['message']);}else{logger[_0x93a7('0x12')](_0x93a7('0x11'),_0x4690bb,'request\x20sent');_0x2417da(_0x2996db['result'][_0x93a7('0x10')]);}})['catch'](function(_0xfac49d){logger[_0x93a7('0xe')](_0x93a7('0x11'),_0x4690bb,_0xfac49d);_0x3a512b(_0xfac49d);});});}
\ No newline at end of file
index 9048263..8dea995 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x74ed=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/:id','show','/:id/downloads','downloads','/:id/transcribe','create','post','runTranscribe','put','update','delete','destroy','exports','util','path','express','Router','fs-extra'];(function(_0x54f5fb,_0x10110c){var _0x1c8b92=function(_0x43a0c3){while(--_0x43a0c3){_0x54f5fb['push'](_0x54f5fb['shift']());}};_0x1c8b92(++_0x10110c);}(_0x74ed,0x127));var _0xd74e=function(_0x29963b,_0x5d218d){_0x29963b=_0x29963b-0x0;var _0x37c2f8=_0x74ed[_0x29963b];return _0x37c2f8;};'use strict';var multer=require('multer');var util=require(_0xd74e('0x0'));var path=require(_0xd74e('0x1'));var timeout=require('connect-timeout');var express=require(_0xd74e('0x2'));var router=express[_0xd74e('0x3')]();var fs_extra=require(_0xd74e('0x4'));var auth=require(_0xd74e('0x5'));var interaction=require(_0xd74e('0x6'));var config=require(_0xd74e('0x7'));var controller=require(_0xd74e('0x8'));router[_0xd74e('0x9')]('/',auth[_0xd74e('0xa')](),controller[_0xd74e('0xb')]);router[_0xd74e('0x9')]('/describe',auth[_0xd74e('0xa')](),controller['describe']);router[_0xd74e('0x9')](_0xd74e('0xc'),auth[_0xd74e('0xa')](),controller[_0xd74e('0xd')]);router[_0xd74e('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0xd74e('0x9')](_0xd74e('0xe'),controller[_0xd74e('0xf')]);router[_0xd74e('0x9')](_0xd74e('0x10'),auth[_0xd74e('0xa')](),controller['downloadTranscribe']);router['post']('/',auth[_0xd74e('0xa')](),controller[_0xd74e('0x11')]);router[_0xd74e('0x12')](_0xd74e('0x10'),auth[_0xd74e('0xa')](),controller[_0xd74e('0x13')]);router[_0xd74e('0x14')](_0xd74e('0xc'),auth[_0xd74e('0xa')](),controller[_0xd74e('0x15')]);router[_0xd74e('0x16')](_0xd74e('0xc'),auth[_0xd74e('0xa')](),controller[_0xd74e('0x17')]);module[_0xd74e('0x18')]=router;
\ No newline at end of file
+var _0x0b21=['show','/:id/download','download','downloads','/:id/transcribe','downloadTranscribe','post','create','update','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x0b21,0xdb));var _0x10b2=function(_0xa65309,_0x109948){_0xa65309=_0xa65309-0x0;var _0x48a38f=_0x0b21[_0xa65309];return _0x48a38f;};'use strict';var multer=require('multer');var util=require(_0x10b2('0x0'));var path=require(_0x10b2('0x1'));var timeout=require(_0x10b2('0x2'));var express=require(_0x10b2('0x3'));var router=express['Router']();var fs_extra=require(_0x10b2('0x4'));var auth=require(_0x10b2('0x5'));var interaction=require(_0x10b2('0x6'));var config=require(_0x10b2('0x7'));var controller=require(_0x10b2('0x8'));router[_0x10b2('0x9')]('/',auth[_0x10b2('0xa')](),controller[_0x10b2('0xb')]);router['get'](_0x10b2('0xc'),auth[_0x10b2('0xa')](),controller[_0x10b2('0xd')]);router['get'](_0x10b2('0xe'),auth['isAuthenticated'](),controller[_0x10b2('0xf')]);router[_0x10b2('0x9')](_0x10b2('0x10'),auth[_0x10b2('0xa')](),controller[_0x10b2('0x11')]);router[_0x10b2('0x9')]('/:id/downloads',controller[_0x10b2('0x12')]);router['get'](_0x10b2('0x13'),auth[_0x10b2('0xa')](),controller[_0x10b2('0x14')]);router[_0x10b2('0x15')]('/',auth[_0x10b2('0xa')](),controller[_0x10b2('0x16')]);router[_0x10b2('0x15')](_0x10b2('0x13'),auth['isAuthenticated'](),controller['runTranscribe']);router['put'](_0x10b2('0xe'),auth[_0x10b2('0xa')](),controller[_0x10b2('0x17')]);router['delete'](_0x10b2('0xe'),auth['isAuthenticated'](),controller[_0x10b2('0x18')]);module[_0x10b2('0x19')]=router;
\ No newline at end of file
index 7d6916d..502fe8e 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(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'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 c31b679..7ed38eb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd956=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','error','name','send','map','VoiceRecording','rawAttributes','fieldName','model','keys','filters','intersection','query','fields','attributes','nolimit','order','sort','pick','where','merge','type','filter','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','describe','../../components/encryptor','uniqueid','value','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','download','filename','unlink','Not\x20found','downloads','sequelize','MD5','col','$and','push','%s.cypher','extname','destroy','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','listBuckets','createBucket','upload','startTranscriptionJob','format','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','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','Cloud\x20Provider\x20not\x20configured','data1','Buckets','Name','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','uuid/v4','../../components/auth/service'];(function(_0x791334,_0x13c0f8){var _0x5ba877=function(_0x560dcb){while(--_0x560dcb){_0x791334['push'](_0x791334['shift']());}};_0x5ba877(++_0x13c0f8);}(_0xd956,0x11c));var _0x6d95=function(_0x46c41f,_0x186749){_0x46c41f=_0x46c41f-0x0;var _0x2afba5=_0xd956[_0x46c41f];return _0x2afba5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6d95('0x0'));var zipdir=require(_0x6d95('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d95('0x2'));var moment=require(_0x6d95('0x3'));var BPromise=require(_0x6d95('0x4'));var Mustache=require('mustache');var util=require(_0x6d95('0x5'));var path=require('path');var sox=require(_0x6d95('0x6'));var csv=require(_0x6d95('0x7'));var ejs=require(_0x6d95('0x8'));var fs=require('fs');var fs_extra=require(_0x6d95('0x9'));var _=require(_0x6d95('0xa'));var squel=require(_0x6d95('0xb'));var crypto=require('crypto');var jsforce=require(_0x6d95('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6d95('0x7'));var querystring=require('querystring');var Papa=require(_0x6d95('0xd'));var AWS=require('aws-sdk');var uuidv4=require(_0x6d95('0xe'));var Redis=require('ioredis');var authService=require(_0x6d95('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6d95('0x10'));var hardwareService=require(_0x6d95('0x11'));var logger=require(_0x6d95('0x12'))(_0x6d95('0x13'));var utils=require(_0x6d95('0x14'));var config=require(_0x6d95('0x15'));var licenseUtil=require(_0x6d95('0x16'));var db=require(_0x6d95('0x17'))['db'];function respondWithStatusCode(_0x2dc9ed,_0x3cdb79){_0x3cdb79=_0x3cdb79||0xcc;return function(_0x231ffc){if(_0x231ffc){return _0x2dc9ed['sendStatus'](_0x3cdb79);}return _0x2dc9ed[_0x6d95('0x18')](_0x3cdb79)[_0x6d95('0x19')]();};}function respondWithResult(_0x358921,_0x1ea118){_0x1ea118=_0x1ea118||0xc8;return function(_0x31d61f){if(_0x31d61f){return _0x358921[_0x6d95('0x18')](_0x1ea118)[_0x6d95('0x1a')](_0x31d61f);}};}function respondWithFilteredResult(_0xb3e402,_0x3c5c01){return function(_0x2409de){if(_0x2409de){var _0x53cda6=typeof _0x3c5c01[_0x6d95('0x1b')]===_0x6d95('0x1c')&&typeof _0x3c5c01[_0x6d95('0x1d')]==='undefined';var _0x5bb940=_0x2409de[_0x6d95('0x1e')];var _0xabf3ac=_0x53cda6?0x0:_0x3c5c01[_0x6d95('0x1b')];var _0x10bd7e=_0x53cda6?_0x2409de['count']:_0x3c5c01[_0x6d95('0x1b')]+_0x3c5c01[_0x6d95('0x1d')];var _0x5c967e;if(_0x10bd7e>=_0x5bb940){_0x10bd7e=_0x5bb940;_0x5c967e=0xc8;}else{_0x5c967e=0xce;}_0xb3e402[_0x6d95('0x18')](_0x5c967e);return _0xb3e402[_0x6d95('0x1f')](_0x6d95('0x20'),_0xabf3ac+'-'+_0x10bd7e+'/'+_0x5bb940)['json'](_0x2409de);}return null;};}function patchUpdates(_0x2d579d){return function(_0x18bf94){try{jsonpatch[_0x6d95('0x21')](_0x18bf94,_0x2d579d,!![]);}catch(_0x5b9526){return BPromise['reject'](_0x5b9526);}return _0x18bf94[_0x6d95('0x22')]();};}function saveUpdates(_0xa06f0c,_0xdcc3af){return function(_0x31af47){if(_0x31af47){return _0x31af47['update'](_0xa06f0c)[_0x6d95('0x23')](function(_0xc7ead7){return _0xc7ead7;});}return null;};}function removeEntity(_0x28af0d,_0x31f140){return function(_0x54dd46){if(_0x54dd46){return _0x54dd46['destroy']()['then'](function(){_0x28af0d[_0x6d95('0x18')](0xcc)[_0x6d95('0x19')]();});}};}function handleEntityNotFound(_0x43c0b8,_0x2cf9e2){return function(_0x199589){if(!_0x199589){_0x43c0b8['sendStatus'](0x194);}return _0x199589;};}function handleError(_0x3aa1a1,_0x425c0a){_0x425c0a=_0x425c0a||0x1f4;return function(_0x1b634f){logger[_0x6d95('0x24')](_0x1b634f['stack']);if(_0x1b634f[_0x6d95('0x25')]){delete _0x1b634f[_0x6d95('0x25')];}_0x3aa1a1[_0x6d95('0x18')](_0x425c0a)[_0x6d95('0x26')](_0x1b634f);};}exports['index']=function(_0x113f37,_0x6a58d){var _0x52c7a2={},_0x1ab07d={},_0x34f596={'count':0x0,'rows':[]};var _0x3fd6f7=_[_0x6d95('0x27')](db[_0x6d95('0x28')][_0x6d95('0x29')],function(_0x11207c){return{'name':_0x11207c[_0x6d95('0x2a')],'type':_0x11207c['type']['key']};});_0x1ab07d[_0x6d95('0x2b')]=_['differenceBy'](_[_0x6d95('0x27')](_0x3fd6f7,_0x6d95('0x25')),['format']);_0x1ab07d['query']=_[_0x6d95('0x2c')](_0x113f37['query']);_0x1ab07d[_0x6d95('0x2d')]=_[_0x6d95('0x2e')](_0x1ab07d[_0x6d95('0x2b')],_0x1ab07d[_0x6d95('0x2f')]);_0x52c7a2['attributes']=_[_0x6d95('0x2e')](_0x1ab07d[_0x6d95('0x2b')],qs[_0x6d95('0x30')](_0x113f37[_0x6d95('0x2f')][_0x6d95('0x30')]));_0x52c7a2[_0x6d95('0x31')]=_0x52c7a2['attributes']['length']?_0x52c7a2['attributes']:_0x1ab07d[_0x6d95('0x2b')];if(!_0x113f37[_0x6d95('0x2f')]['hasOwnProperty'](_0x6d95('0x32'))){_0x52c7a2[_0x6d95('0x1d')]=qs['limit'](_0x113f37[_0x6d95('0x2f')][_0x6d95('0x1d')]);_0x52c7a2[_0x6d95('0x1b')]=qs[_0x6d95('0x1b')](_0x113f37['query']['offset']);}_0x52c7a2[_0x6d95('0x33')]=qs[_0x6d95('0x34')](_0x113f37[_0x6d95('0x2f')][_0x6d95('0x34')]);_0x52c7a2['where']=qs[_0x6d95('0x2d')](_[_0x6d95('0x35')](_0x113f37[_0x6d95('0x2f')],_0x1ab07d['filters']),_0x3fd6f7);if(_0x113f37[_0x6d95('0x2f')]['filter']){_0x52c7a2[_0x6d95('0x36')]=_[_0x6d95('0x37')](_0x52c7a2['where'],{'$or':_[_0x6d95('0x27')](_0x3fd6f7,function(_0x9b059e){if(_0x9b059e[_0x6d95('0x38')]!=='VIRTUAL'){var _0x58737a={};_0x58737a[_0x9b059e[_0x6d95('0x25')]]={'$like':'%'+_0x113f37[_0x6d95('0x2f')][_0x6d95('0x39')]+'%'};return _0x58737a;}})});}_0x52c7a2=_[_0x6d95('0x37')]({},_0x52c7a2,_0x113f37['options']);var _0x3f6909={'where':_0x52c7a2[_0x6d95('0x36')]};return db[_0x6d95('0x28')][_0x6d95('0x1e')](_0x3f6909)[_0x6d95('0x23')](function(_0x2fa182){_0x34f596[_0x6d95('0x1e')]=_0x2fa182;if(_0x113f37[_0x6d95('0x2f')][_0x6d95('0x3a')]){_0x52c7a2[_0x6d95('0x3b')]=[{'all':!![]}];}return db[_0x6d95('0x28')][_0x6d95('0x3c')](_0x52c7a2);})[_0x6d95('0x23')](function(_0x1179f7){_0x34f596[_0x6d95('0x3d')]=_0x1179f7;return _0x34f596;})['then'](respondWithFilteredResult(_0x6a58d,_0x52c7a2))[_0x6d95('0x3e')](handleError(_0x6a58d,null));};exports[_0x6d95('0x3f')]=function(_0x61a46e,_0x3f0d8f){var _0x504852={'raw':![],'where':{'id':_0x61a46e[_0x6d95('0x40')]['id']}},_0x451622={};_0x451622[_0x6d95('0x2b')]=_[_0x6d95('0x2c')](db[_0x6d95('0x28')][_0x6d95('0x29')]);_0x451622[_0x6d95('0x2f')]=_[_0x6d95('0x2c')](_0x61a46e[_0x6d95('0x2f')]);_0x451622[_0x6d95('0x2d')]=_[_0x6d95('0x2e')](_0x451622[_0x6d95('0x2b')],_0x451622[_0x6d95('0x2f')]);_0x504852['attributes']=_[_0x6d95('0x2e')](_0x451622[_0x6d95('0x2b')],qs[_0x6d95('0x30')](_0x61a46e[_0x6d95('0x2f')][_0x6d95('0x30')]));_0x504852[_0x6d95('0x31')]=_0x504852[_0x6d95('0x31')][_0x6d95('0x41')]?_0x504852[_0x6d95('0x31')]:_0x451622['model'];if(_0x61a46e[_0x6d95('0x2f')][_0x6d95('0x3a')]){_0x504852[_0x6d95('0x3b')]=[{'all':!![]}];}_0x504852=_[_0x6d95('0x37')]({},_0x504852,_0x61a46e[_0x6d95('0x42')]);return db[_0x6d95('0x28')][_0x6d95('0x43')](_0x504852)[_0x6d95('0x23')](handleEntityNotFound(_0x3f0d8f,null))['then'](respondWithResult(_0x3f0d8f,null))['catch'](handleError(_0x3f0d8f,null));};exports[_0x6d95('0x44')]=function(_0x2c8f0b,_0x194026){return db[_0x6d95('0x28')][_0x6d95('0x44')](_0x2c8f0b[_0x6d95('0x45')],{})[_0x6d95('0x23')](respondWithResult(_0x194026,0xc9))[_0x6d95('0x3e')](handleError(_0x194026,null));};exports['update']=function(_0x58c16d,_0x457824){if(_0x58c16d[_0x6d95('0x45')]['id']){delete _0x58c16d[_0x6d95('0x45')]['id'];}return db[_0x6d95('0x28')][_0x6d95('0x43')]({'where':{'id':_0x58c16d['params']['id']}})[_0x6d95('0x23')](handleEntityNotFound(_0x457824,null))[_0x6d95('0x23')](saveUpdates(_0x58c16d[_0x6d95('0x45')],null))[_0x6d95('0x23')](respondWithResult(_0x457824,null))[_0x6d95('0x3e')](handleError(_0x457824,null));};exports[_0x6d95('0x46')]=function(_0x39d687,_0x140850){return db[_0x6d95('0x28')][_0x6d95('0x46')]()[_0x6d95('0x23')](respondWithResult(_0x140850,null))[_0x6d95('0x3e')](handleError(_0x140850,null));};exports['download']=function(_0x2553cb,_0x34a4b0,_0x4fd0bf){var _0x3bbd59=require(_0x6d95('0x47'));var _0x41e33c=![];var _0x547c22={};if(_0x2553cb['query'][_0x6d95('0x38')]&&_0x2553cb['query'][_0x6d95('0x38')]==='uniqueid'){_0x547c22[_0x6d95('0x48')]=_0x2553cb[_0x6d95('0x40')]['id'];}else{_0x547c22['id']=_0x2553cb[_0x6d95('0x40')]['id'];}return db[_0x6d95('0x28')][_0x6d95('0x43')]({'where':_0x547c22,'attributes':['id',_0x6d95('0x49')],'raw':!![]})[_0x6d95('0x23')](handleEntityNotFound(_0x34a4b0,null))[_0x6d95('0x23')](function(_0x477352){if(_0x477352){var _0x10fd1f=_0x477352[_0x6d95('0x49')];var _0x4852b1=util['format']('%s.cypher',_0x10fd1f);if(fs['existsSync'](_0x4852b1)){_0x41e33c=!![];return _0x3bbd59[_0x6d95('0x4a')](_0x4852b1,_0x10fd1f,config[_0x6d95('0x4b')][_0x6d95('0x4c')])[_0x6d95('0x23')](function(){return _0x477352;});}return _0x477352;}})['then'](function(_0x3d2739){if(_0x3d2739){var _0x342872=_0x3d2739[_0x6d95('0x49')];if(!fs[_0x6d95('0x4d')](_0x342872)){throw new db[(_0x6d95('0x4e'))][(_0x6d95('0x4f'))](_0x6d95('0x50'));}if(_0x3d2739['filename']){return _0x34a4b0[_0x6d95('0x51')](_0x342872,_0x3d2739[_0x6d95('0x52')]+path['extname'](_0x342872),function(){if(_0x41e33c){fs[_0x6d95('0x53')](_0x342872);}});}else{return _0x34a4b0[_0x6d95('0x51')](_0x342872,function(_0x3115b4){if(_0x41e33c){fs[_0x6d95('0x53')](_0x342872);}});}}})['catch'](function(_0x21c16f){if(_0x21c16f['message']===_0x6d95('0x50')){_0x34a4b0[_0x6d95('0x18')](0x194)[_0x6d95('0x26')](_0x6d95('0x54'));}else{return handleError(_0x34a4b0,null);}});};exports[_0x6d95('0x55')]=function(_0x16c785,_0x173f37,_0xf1507e){var _0x546044=require(_0x6d95('0x47'));var _0x33729e=![];var _0xf4a494={'$and':[db['sequelize']['where'](db[_0x6d95('0x56')]['fn'](_0x6d95('0x57'),db['sequelize'][_0x6d95('0x58')](_0x6d95('0x48'))),_0x16c785[_0x6d95('0x2f')]['token'])]};if(_0x16c785[_0x6d95('0x2f')][_0x6d95('0x38')]&&_0x16c785[_0x6d95('0x2f')][_0x6d95('0x38')]==='uniqueid'){_0xf4a494[_0x6d95('0x59')]['push']({'uniqueid':_0x16c785[_0x6d95('0x40')]['id']});}else{_0xf4a494[_0x6d95('0x59')][_0x6d95('0x5a')]({'id':_0x16c785[_0x6d95('0x40')]['id']});}return db[_0x6d95('0x28')]['find']({'where':_0xf4a494,'attributes':['id','value'],'raw':!![]})[_0x6d95('0x23')](handleEntityNotFound(_0x173f37,null))[_0x6d95('0x23')](function(_0x36e219){if(_0x36e219){var _0x16f457=util['format'](_0x6d95('0x5b'),_0x36e219[_0x6d95('0x49')]);if(fs[_0x6d95('0x4d')](_0x16f457)){_0x33729e=!![];return _0x546044[_0x6d95('0x4a')](_0x16f457,_0x36e219[_0x6d95('0x49')],config[_0x6d95('0x4b')][_0x6d95('0x4c')])[_0x6d95('0x23')](function(){return _0x36e219;});}return _0x36e219;}})[_0x6d95('0x23')](function(_0x5e05c3){if(_0x5e05c3){if(!fs['existsSync'](_0x5e05c3[_0x6d95('0x49')])){throw new db[(_0x6d95('0x4e'))][(_0x6d95('0x4f'))]('VoiceRecording\x20not\x20found');}if(_0x5e05c3['filename']){return _0x173f37[_0x6d95('0x51')](_0x5e05c3[_0x6d95('0x49')],_0x5e05c3[_0x6d95('0x52')]+path[_0x6d95('0x5c')](_0x5e05c3[_0x6d95('0x49')]),function(){if(_0x33729e){fs[_0x6d95('0x53')](_0x5e05c3[_0x6d95('0x49')]);}});}else{return _0x173f37[_0x6d95('0x51')](_0x5e05c3[_0x6d95('0x49')],function(_0x540295){if(_0x33729e){fs[_0x6d95('0x53')](_0x5e05c3[_0x6d95('0x49')]);}});}}})['catch'](handleError(_0x173f37,null));};exports[_0x6d95('0x5d')]=function(_0x34e34a,_0x1e023c){return db[_0x6d95('0x28')]['find']({'where':{'id':_0x34e34a[_0x6d95('0x40')]['id']}})[_0x6d95('0x23')](function(_0x1cff31){if(_['isNil'](_0x1cff31)){throw new ReferenceError(_0x6d95('0x5e'));}return _0x1cff31;})['then'](function(_0x55dbb4){var _0x18f583=_0x55dbb4[_0x6d95('0x49')];logger['info'](_0x6d95('0x5f'),_0x18f583);if(!_[_0x6d95('0x60')](_0x55dbb4[_0x6d95('0x49')])&&fs['existsSync'](_0x18f583)){logger[_0x6d95('0x61')](_0x6d95('0x62')+_0x18f583+_0x6d95('0x63'));fs['unlinkSync'](_0x18f583);}_0x18f583=_0x18f583+_0x6d95('0x64');if(!_['isNil'](_0x55dbb4[_0x6d95('0x49')])&&fs[_0x6d95('0x4d')](_0x18f583)){logger[_0x6d95('0x61')]('File:\x20\x22'+_0x18f583+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x6d95('0x65')](_0x18f583);}return _0x55dbb4;})[_0x6d95('0x23')](function(_0xf4a300){if(!_0xf4a300)throw new InternalError();return _0xf4a300[_0x6d95('0x5d')]();})[_0x6d95('0x23')](function(){_0x1e023c['status'](0xcc)[_0x6d95('0x19')]();})['catch'](handleError(_0x1e023c,null));};function getBucketslist(_0x5a1461,_0x8b470c,_0x16bb84){return new Promise(function(_0x446719,_0x3594ae){var _0xe7503d=new AWS['S3']({'accessKeyId':_0x8b470c,'secretAccessKey':_0x5a1461,'region':_0x16bb84});_0xe7503d[_0x6d95('0x66')]({},function(_0x9a8ef4,_0x2c7758){if(_0x9a8ef4){return _0x3594ae(_0x9a8ef4);}else{return _0x446719(_0x2c7758);}});});}function createBucket(_0x2b61f0,_0x918412,_0x3fc91d,_0xd765c1){return new Promise(function(_0x1ebf34,_0x24f892){var _0x134569=new AWS['S3']({'accessKeyId':_0x918412,'secretAccessKey':_0x2b61f0,'region':_0x3fc91d});_0x134569[_0x6d95('0x67')]({'Bucket':_0xd765c1},function(_0x12d6ab,_0x4adefa){if(_0x12d6ab){return _0x24f892(_0x12d6ab);}else{return _0x1ebf34(_0x4adefa);}});});}function uploadFile(_0x11f30a,_0x460e38,_0x1e1bec,_0x6129,_0x3dfdce,_0x5686f8){return new Promise(function(_0x5e7309,_0x5e6944){var _0x2c9202=new AWS['S3']({'accessKeyId':_0x460e38,'secretAccessKey':_0x11f30a,'region':_0x1e1bec});_0x2c9202[_0x6d95('0x68')]({'Bucket':_0x6129,'Key':_0x3dfdce,'Body':_0x5686f8},function(_0x4c33ff,_0xb21a1b){if(_0x4c33ff){return _0x5e6944(_0x4c33ff);}else{return _0x5e7309(_0xb21a1b);}});});}function startTranscribe(_0x56fd41,_0x1b34d3,_0x51efd4,_0x5985ac,_0x56a21d,_0x5df679){return new Promise(function(_0x3cb938,_0xcb5b4a){var _0x1af9e3=new AWS['TranscribeService']({'accessKeyId':_0x1b34d3,'secretAccessKey':_0x56fd41,'region':_0x51efd4});_0x1af9e3[_0x6d95('0x69')]({'TranscriptionJobName':_0x5985ac,'LanguageCode':_0x56a21d,'Media':{'MediaFileUri':_0x5df679}},function(_0x302359,_0x4dbc5c){if(_0x302359){return _0xcb5b4a(_0x302359);}else{return _0x3cb938(_0x4dbc5c);}});});}function transcribe(_0x238e46,_0x5346e2,_0x26f815,_0x26f99c,_0x9fcfac,_0x4318f3,_0x4bbde0){return new Promise(function(_0x4b4769,_0x502075){var _0x32c66b={};logger['info'](util[_0x6d95('0x6a')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x238e46,_0x9fcfac));return uploadFile(_0x5346e2,_0x26f815,_0x26f99c,_0x9fcfac,path[_0x6d95('0x6b')](_0x4318f3),fs[_0x6d95('0x6c')](_0x4318f3))[_0x6d95('0x23')](function(_0x2316fc){logger[_0x6d95('0x61')](util[_0x6d95('0x6a')](_0x6d95('0x6d'),_0x238e46,_0x9fcfac,_0x2316fc[_0x6d95('0x6e')]));_0x32c66b[_0x6d95('0x6f')]=_0x2316fc[_0x6d95('0x70')];_0x32c66b[_0x6d95('0x71')]=_0x2316fc['Location'];logger[_0x6d95('0x61')](util[_0x6d95('0x6a')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x238e46));return startTranscribe(_0x5346e2,_0x26f815,_0x26f99c,uuidv4(),_0x4bbde0,_0x2316fc[_0x6d95('0x6e')]);})[_0x6d95('0x23')](function(_0x5232ec){logger[_0x6d95('0x61')](util['format'](_0x6d95('0x72'),_0x238e46,_0x5232ec[_0x6d95('0x73')][_0x6d95('0x74')]));_0x32c66b[_0x6d95('0x75')]=_0x5232ec[_0x6d95('0x73')][_0x6d95('0x74')];_0x32c66b[_0x6d95('0x76')]=_0x5232ec[_0x6d95('0x73')][_0x6d95('0x77')];return _0x4b4769(_0x32c66b);})[_0x6d95('0x3e')](function(_0x4df50c){return _0x502075(_0x4df50c);});});}exports[_0x6d95('0x78')]=function(_0x494d12,_0x36c0ed,_0x1f5ed3){var _0x61c125;var _0x357f02;var _0x125382;var _0x580a5f=require(_0x6d95('0x47'));return db[_0x6d95('0x28')][_0x6d95('0x79')]({'where':{'id':_0x494d12[_0x6d95('0x40')]['id']}})['then'](function(_0x4f8166){if(_0x4f8166){var _0xd7dd30=util[_0x6d95('0x6a')](_0x6d95('0x5b'),_0x4f8166[_0x6d95('0x49')]);if(fs[_0x6d95('0x4d')](_0xd7dd30)){cypher=!![];return _0x580a5f[_0x6d95('0x4a')](_0xd7dd30,_0x4f8166[_0x6d95('0x49')],config[_0x6d95('0x4b')][_0x6d95('0x4c')])[_0x6d95('0x23')](function(){return _0x4f8166;});}return _0x4f8166;}})[_0x6d95('0x23')](function(_0x47dcf3){if(!_0x47dcf3){throw new db['Sequelize'][(_0x6d95('0x4f'))](_0x6d95('0x7a'));}_0x357f02=_0x47dcf3;return db[_0x6d95('0x7b')]['findOne']({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x36c0ed,null))[_0x6d95('0x23')](function(_0x141141){if(_0x141141){_0x61c125=_0x141141;if(!_0x61c125[_0x6d95('0x7c')]||!_0x61c125[_0x6d95('0x7d')]||!_0x61c125[_0x6d95('0x7e')]||!_0x61c125[_0x6d95('0x7f')]||!_0x61c125[_0x6d95('0x6f')]){throw new db[(_0x6d95('0x4e'))][(_0x6d95('0x4f'))](_0x6d95('0x80'));}if(_0x494d12[_0x6d95('0x45')][_0x6d95('0x81')]&&(!_0x61c125[_0x6d95('0x82')]||!_0x61c125[_0x6d95('0x83')]||!_0x61c125[_0x6d95('0x84')]||!_0x61c125[_0x6d95('0x7f')]||!_0x61c125[_0x6d95('0x6f')])){throw new db['Sequelize'][(_0x6d95('0x4f'))](_0x6d95('0x85'));}return db[_0x6d95('0x86')][_0x6d95('0x79')]({'where':{'id':_0x61c125[_0x6d95('0x7d')]}});}})[_0x6d95('0x23')](function(_0x26b29d){if(!_0x26b29d){throw new db['Sequelize'][(_0x6d95('0x4f'))](_0x6d95('0x87'));}if(!_0x26b29d['data1']||!_0x26b29d[_0x6d95('0x88')]){throw new db[(_0x6d95('0x4e'))][(_0x6d95('0x4f'))](_0x6d95('0x89'));}_0x125382=_0x26b29d;return getBucketslist(_0x125382[_0x6d95('0x8a')],_0x125382[_0x6d95('0x88')],_0x61c125[_0x6d95('0x7e')]);})[_0x6d95('0x23')](function(_0x499916){if(_0x499916&&_0x499916[_0x6d95('0x8b')]){var _0x3dddaf=_[_0x6d95('0x43')](_0x499916[_0x6d95('0x8b')],function(_0x5369a3){return _0x5369a3[_0x6d95('0x8c')]===_0x61c125['bucket'];});if(!_0x3dddaf){logger[_0x6d95('0x61')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0x494d12[_0x6d95('0x40')]['id'],_0x61c125[_0x6d95('0x6f')]));return createBucket(_0x125382[_0x6d95('0x8a')],_0x125382[_0x6d95('0x88')],_0x61c125[_0x6d95('0x7e')],_0x61c125['bucket']);}logger['info'](util[_0x6d95('0x6a')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x494d12[_0x6d95('0x40')]['id'],_0x61c125[_0x6d95('0x6f')]));return;}})[_0x6d95('0x23')](function(_0x2608f0){if(_0x357f02[_0x6d95('0x76')]===_0x6d95('0x8d')){return transcribe(_0x494d12[_0x6d95('0x40')]['id'],_0x125382[_0x6d95('0x8a')],_0x125382[_0x6d95('0x88')],_0x61c125[_0x6d95('0x7e')],_0x61c125[_0x6d95('0x6f')],_0x357f02[_0x6d95('0x49')],_0x61c125['language']);}else{logger[_0x6d95('0x61')](util[_0x6d95('0x6a')](_0x6d95('0x8e'),_0x494d12[_0x6d95('0x40')]['id']));return{'transcribeStatus':_0x6d95('0x8f')};}})[_0x6d95('0x23')](function(_0x180a0a){if(_0x180a0a){_0x180a0a[_0x6d95('0x90')]=_0x494d12['body'][_0x6d95('0x81')];return _0x357f02[_0x6d95('0x91')](_0x180a0a);}})['then'](respondWithResult(_0x36c0ed,null))[_0x6d95('0x3e')](handleError(_0x36c0ed,null));};function writeFile(_0x3021b0,_0x14aae4){return new Promise(function(_0x301551,_0x25c819){fs['writeFile'](_0x14aae4,_0x3021b0,function(_0x1fb515,_0x5dfbb3){if(_0x1fb515){return _0x25c819(_0x1fb515);}else{return _0x301551(_0x5dfbb3);}});});}exports['downloadTranscribe']=function(_0x4d01b5,_0x48d4df,_0x11a32e){return db['VoiceRecording'][_0x6d95('0x79')]({'where':{'id':_0x4d01b5['params']['id']}})[_0x6d95('0x23')](handleEntityNotFound(_0x48d4df))[_0x6d95('0x23')](function(_0x41cd6b){if(_0x41cd6b&&_0x41cd6b['fileText']){var _0x592a21=_0x41cd6b['fileText'];var _0x3e07d4=config[_0x6d95('0x92')]+_0x6d95('0x93')+_0x41cd6b['id']+_0x6d95('0x94');if(fs[_0x6d95('0x4d')](_0x3e07d4)){return _0x3e07d4;}return writeFile(_0x592a21,_0x3e07d4)[_0x6d95('0x23')](function(){return _0x3e07d4;});}else{throw new db[(_0x6d95('0x4e'))][(_0x6d95('0x4f'))](_0x6d95('0x95'));}})[_0x6d95('0x23')](function(_0x4fd87f){return _0x48d4df[_0x6d95('0x51')](_0x4fd87f);})[_0x6d95('0x3e')](handleError(_0x48d4df));};
\ No newline at end of file
+var _0x3ef3=['upload','TranscribeService','startTranscriptionJob','basename','bucket','Bucket','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','transcribeRegion','language','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','uuid/v4','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','differenceBy','query','keys','filters','intersection','attributes','fields','length','model','nolimit','order','sort','where','filter','merge','VIRTUAL','options','rows','catch','show','params','include','create','body','describe','download','../../components/encryptor','uniqueid','find','value','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','unlink','Not\x20found','downloads','sequelize','MD5','token','$and','push','extname','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket'];(function(_0x4460e7,_0x1da284){var _0x11c03d=function(_0x141783){while(--_0x141783){_0x4460e7['push'](_0x4460e7['shift']());}};_0x11c03d(++_0x1da284);}(_0x3ef3,0xc1));var _0x33ef=function(_0x1efeb1,_0xe82047){_0x1efeb1=_0x1efeb1-0x0;var _0x198efa=_0x3ef3[_0x1efeb1];return _0x198efa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x33ef('0x0'));var zipdir=require(_0x33ef('0x1'));var jsonpatch=require(_0x33ef('0x2'));var rp=require(_0x33ef('0x3'));var moment=require(_0x33ef('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x33ef('0x5'));var util=require(_0x33ef('0x6'));var path=require('path');var sox=require(_0x33ef('0x7'));var csv=require(_0x33ef('0x8'));var ejs=require(_0x33ef('0x9'));var fs=require('fs');var fs_extra=require(_0x33ef('0xa'));var _=require(_0x33ef('0xb'));var squel=require(_0x33ef('0xc'));var crypto=require(_0x33ef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x33ef('0xe'));var toCsv=require(_0x33ef('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var AWS=require('aws-sdk');var uuidv4=require(_0x33ef('0xf'));var Redis=require(_0x33ef('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x33ef('0x11'));var as=require(_0x33ef('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x33ef('0x13'))(_0x33ef('0x14'));var utils=require(_0x33ef('0x15'));var config=require(_0x33ef('0x16'));var licenseUtil=require(_0x33ef('0x17'));var db=require(_0x33ef('0x18'))['db'];function respondWithStatusCode(_0x5091e6,_0x544c84){_0x544c84=_0x544c84||0xcc;return function(_0x2767bb){if(_0x2767bb){return _0x5091e6[_0x33ef('0x19')](_0x544c84);}return _0x5091e6['status'](_0x544c84)['end']();};}function respondWithResult(_0x41dcee,_0x344cf0){_0x344cf0=_0x344cf0||0xc8;return function(_0x24eec2){if(_0x24eec2){return _0x41dcee[_0x33ef('0x1a')](_0x344cf0)[_0x33ef('0x1b')](_0x24eec2);}};}function respondWithFilteredResult(_0x378ac9,_0x13934a){return function(_0x5007fe){if(_0x5007fe){var _0x54ab3b=typeof _0x13934a[_0x33ef('0x1c')]===_0x33ef('0x1d')&&typeof _0x13934a[_0x33ef('0x1e')]===_0x33ef('0x1d');var _0x5e6664=_0x5007fe['count'];var _0x1edf77=_0x54ab3b?0x0:_0x13934a[_0x33ef('0x1c')];var _0x5cc8d7=_0x54ab3b?_0x5007fe[_0x33ef('0x1f')]:_0x13934a[_0x33ef('0x1c')]+_0x13934a[_0x33ef('0x1e')];var _0x4773c3;if(_0x5cc8d7>=_0x5e6664){_0x5cc8d7=_0x5e6664;_0x4773c3=0xc8;}else{_0x4773c3=0xce;}_0x378ac9[_0x33ef('0x1a')](_0x4773c3);return _0x378ac9[_0x33ef('0x20')](_0x33ef('0x21'),_0x1edf77+'-'+_0x5cc8d7+'/'+_0x5e6664)[_0x33ef('0x1b')](_0x5007fe);}return null;};}function patchUpdates(_0x58f89a){return function(_0x583115){try{jsonpatch['apply'](_0x583115,_0x58f89a,!![]);}catch(_0xd159b6){return BPromise[_0x33ef('0x22')](_0xd159b6);}return _0x583115[_0x33ef('0x23')]();};}function saveUpdates(_0x334ec4,_0x2e8095){return function(_0x4b298e){if(_0x4b298e){return _0x4b298e[_0x33ef('0x24')](_0x334ec4)[_0x33ef('0x25')](function(_0x24801e){return _0x24801e;});}return null;};}function removeEntity(_0x103478,_0x1969f4){return function(_0x544a45){if(_0x544a45){return _0x544a45[_0x33ef('0x26')]()[_0x33ef('0x25')](function(){_0x103478['status'](0xcc)[_0x33ef('0x27')]();});}};}function handleEntityNotFound(_0x2fd87c,_0x46fc58){return function(_0x1aa973){if(!_0x1aa973){_0x2fd87c[_0x33ef('0x19')](0x194);}return _0x1aa973;};}function handleError(_0x490aaf,_0x51ee4a){_0x51ee4a=_0x51ee4a||0x1f4;return function(_0xdffab9){logger['error'](_0xdffab9['stack']);if(_0xdffab9[_0x33ef('0x28')]){delete _0xdffab9[_0x33ef('0x28')];}_0x490aaf[_0x33ef('0x1a')](_0x51ee4a)[_0x33ef('0x29')](_0xdffab9);};}exports[_0x33ef('0x2a')]=function(_0x1c8cc4,_0x53fe8d){var _0x3036a3={},_0x1f621a={},_0x25a9b1={'count':0x0,'rows':[]};var _0x4ed595=_[_0x33ef('0x2b')](db[_0x33ef('0x2c')][_0x33ef('0x2d')],function(_0x1ceb8f){return{'name':_0x1ceb8f[_0x33ef('0x2e')],'type':_0x1ceb8f[_0x33ef('0x2f')][_0x33ef('0x30')]};});_0x1f621a['model']=_[_0x33ef('0x31')](_[_0x33ef('0x2b')](_0x4ed595,_0x33ef('0x28')),['format']);_0x1f621a[_0x33ef('0x32')]=_[_0x33ef('0x33')](_0x1c8cc4[_0x33ef('0x32')]);_0x1f621a[_0x33ef('0x34')]=_[_0x33ef('0x35')](_0x1f621a['model'],_0x1f621a[_0x33ef('0x32')]);_0x3036a3[_0x33ef('0x36')]=_[_0x33ef('0x35')](_0x1f621a['model'],qs[_0x33ef('0x37')](_0x1c8cc4[_0x33ef('0x32')][_0x33ef('0x37')]));_0x3036a3[_0x33ef('0x36')]=_0x3036a3['attributes'][_0x33ef('0x38')]?_0x3036a3[_0x33ef('0x36')]:_0x1f621a[_0x33ef('0x39')];if(!_0x1c8cc4[_0x33ef('0x32')]['hasOwnProperty'](_0x33ef('0x3a'))){_0x3036a3[_0x33ef('0x1e')]=qs[_0x33ef('0x1e')](_0x1c8cc4[_0x33ef('0x32')][_0x33ef('0x1e')]);_0x3036a3[_0x33ef('0x1c')]=qs[_0x33ef('0x1c')](_0x1c8cc4[_0x33ef('0x32')][_0x33ef('0x1c')]);}_0x3036a3[_0x33ef('0x3b')]=qs[_0x33ef('0x3c')](_0x1c8cc4['query'][_0x33ef('0x3c')]);_0x3036a3[_0x33ef('0x3d')]=qs[_0x33ef('0x34')](_['pick'](_0x1c8cc4['query'],_0x1f621a['filters']),_0x4ed595);if(_0x1c8cc4['query'][_0x33ef('0x3e')]){_0x3036a3[_0x33ef('0x3d')]=_[_0x33ef('0x3f')](_0x3036a3[_0x33ef('0x3d')],{'$or':_['map'](_0x4ed595,function(_0x34c2f3){if(_0x34c2f3[_0x33ef('0x2f')]!==_0x33ef('0x40')){var _0x1672e8={};_0x1672e8[_0x34c2f3['name']]={'$like':'%'+_0x1c8cc4[_0x33ef('0x32')]['filter']+'%'};return _0x1672e8;}})});}_0x3036a3=_['merge']({},_0x3036a3,_0x1c8cc4[_0x33ef('0x41')]);var _0x5885df={'where':_0x3036a3[_0x33ef('0x3d')]};return db[_0x33ef('0x2c')][_0x33ef('0x1f')](_0x5885df)[_0x33ef('0x25')](function(_0x580b3d){_0x25a9b1[_0x33ef('0x1f')]=_0x580b3d;if(_0x1c8cc4[_0x33ef('0x32')]['includeAll']){_0x3036a3['include']=[{'all':!![]}];}return db[_0x33ef('0x2c')]['findAll'](_0x3036a3);})[_0x33ef('0x25')](function(_0x28ae90){_0x25a9b1[_0x33ef('0x42')]=_0x28ae90;return _0x25a9b1;})[_0x33ef('0x25')](respondWithFilteredResult(_0x53fe8d,_0x3036a3))[_0x33ef('0x43')](handleError(_0x53fe8d,null));};exports[_0x33ef('0x44')]=function(_0x2f500a,_0x3e9a5f){var _0xdd47bc={'raw':![],'where':{'id':_0x2f500a[_0x33ef('0x45')]['id']}},_0x4909aa={};_0x4909aa['model']=_[_0x33ef('0x33')](db[_0x33ef('0x2c')][_0x33ef('0x2d')]);_0x4909aa[_0x33ef('0x32')]=_[_0x33ef('0x33')](_0x2f500a[_0x33ef('0x32')]);_0x4909aa[_0x33ef('0x34')]=_[_0x33ef('0x35')](_0x4909aa[_0x33ef('0x39')],_0x4909aa['query']);_0xdd47bc[_0x33ef('0x36')]=_['intersection'](_0x4909aa[_0x33ef('0x39')],qs[_0x33ef('0x37')](_0x2f500a[_0x33ef('0x32')]['fields']));_0xdd47bc['attributes']=_0xdd47bc[_0x33ef('0x36')]['length']?_0xdd47bc['attributes']:_0x4909aa[_0x33ef('0x39')];if(_0x2f500a[_0x33ef('0x32')]['includeAll']){_0xdd47bc[_0x33ef('0x46')]=[{'all':!![]}];}_0xdd47bc=_[_0x33ef('0x3f')]({},_0xdd47bc,_0x2f500a[_0x33ef('0x41')]);return db['VoiceRecording']['find'](_0xdd47bc)[_0x33ef('0x25')](handleEntityNotFound(_0x3e9a5f,null))[_0x33ef('0x25')](respondWithResult(_0x3e9a5f,null))['catch'](handleError(_0x3e9a5f,null));};exports[_0x33ef('0x47')]=function(_0x2a63e7,_0x3b37c6){return db[_0x33ef('0x2c')]['create'](_0x2a63e7[_0x33ef('0x48')],{})['then'](respondWithResult(_0x3b37c6,0xc9))[_0x33ef('0x43')](handleError(_0x3b37c6,null));};exports[_0x33ef('0x24')]=function(_0x15138a,_0x5d829e){if(_0x15138a[_0x33ef('0x48')]['id']){delete _0x15138a[_0x33ef('0x48')]['id'];}return db[_0x33ef('0x2c')]['find']({'where':{'id':_0x15138a['params']['id']}})['then'](handleEntityNotFound(_0x5d829e,null))[_0x33ef('0x25')](saveUpdates(_0x15138a[_0x33ef('0x48')],null))[_0x33ef('0x25')](respondWithResult(_0x5d829e,null))[_0x33ef('0x43')](handleError(_0x5d829e,null));};exports[_0x33ef('0x49')]=function(_0x446b50,_0x3b1635){return db[_0x33ef('0x2c')][_0x33ef('0x49')]()[_0x33ef('0x25')](respondWithResult(_0x3b1635,null))[_0x33ef('0x43')](handleError(_0x3b1635,null));};exports[_0x33ef('0x4a')]=function(_0x145868,_0x368111,_0x2f48da){var _0x59cf85=require(_0x33ef('0x4b'));var _0x158b81=![];var _0x32d87f={};if(_0x145868[_0x33ef('0x32')][_0x33ef('0x2f')]&&_0x145868[_0x33ef('0x32')][_0x33ef('0x2f')]===_0x33ef('0x4c')){_0x32d87f[_0x33ef('0x4c')]=_0x145868[_0x33ef('0x45')]['id'];}else{_0x32d87f['id']=_0x145868[_0x33ef('0x45')]['id'];}return db[_0x33ef('0x2c')][_0x33ef('0x4d')]({'where':_0x32d87f,'attributes':['id',_0x33ef('0x4e')],'raw':!![]})[_0x33ef('0x25')](handleEntityNotFound(_0x368111,null))[_0x33ef('0x25')](function(_0x1d590e){if(_0x1d590e){var _0x333694=_0x1d590e[_0x33ef('0x4e')];var _0xe1ed1e=util[_0x33ef('0x4f')](_0x33ef('0x50'),_0x333694);if(fs[_0x33ef('0x51')](_0xe1ed1e)){_0x158b81=!![];return _0x59cf85[_0x33ef('0x52')](_0xe1ed1e,_0x333694,config[_0x33ef('0x53')][_0x33ef('0x54')])[_0x33ef('0x25')](function(){return _0x1d590e;});}return _0x1d590e;}})[_0x33ef('0x25')](function(_0x4e7ab7){if(_0x4e7ab7){var _0x20a37c=_0x4e7ab7[_0x33ef('0x4e')];if(!fs[_0x33ef('0x51')](_0x20a37c)){throw new db[(_0x33ef('0x55'))][(_0x33ef('0x56'))](_0x33ef('0x57'));}if(_0x4e7ab7[_0x33ef('0x58')]){return _0x368111[_0x33ef('0x4a')](_0x20a37c,_0x4e7ab7[_0x33ef('0x58')]+path['extname'](_0x20a37c),function(){if(_0x158b81){fs[_0x33ef('0x59')](_0x20a37c);}});}else{return _0x368111['download'](_0x20a37c,function(_0x58f852){if(_0x158b81){fs[_0x33ef('0x59')](_0x20a37c);}});}}})['catch'](function(_0x47a1a4){if(_0x47a1a4['message']==='VoiceRecording\x20not\x20found'){_0x368111[_0x33ef('0x1a')](0x194)[_0x33ef('0x29')](_0x33ef('0x5a'));}else{return handleError(_0x368111,null);}});};exports[_0x33ef('0x5b')]=function(_0x111e9a,_0x507019,_0x34a2f3){var _0x49e04b=require(_0x33ef('0x4b'));var _0x2f0ebd=![];var _0x85ad03={'$and':[db[_0x33ef('0x5c')][_0x33ef('0x3d')](db['sequelize']['fn'](_0x33ef('0x5d'),db[_0x33ef('0x5c')]['col'](_0x33ef('0x4c'))),_0x111e9a['query'][_0x33ef('0x5e')])]};if(_0x111e9a[_0x33ef('0x32')][_0x33ef('0x2f')]&&_0x111e9a[_0x33ef('0x32')][_0x33ef('0x2f')]==='uniqueid'){_0x85ad03[_0x33ef('0x5f')][_0x33ef('0x60')]({'uniqueid':_0x111e9a['params']['id']});}else{_0x85ad03[_0x33ef('0x5f')][_0x33ef('0x60')]({'id':_0x111e9a[_0x33ef('0x45')]['id']});}return db[_0x33ef('0x2c')]['find']({'where':_0x85ad03,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x507019,null))[_0x33ef('0x25')](function(_0x118b45){if(_0x118b45){var _0x5076c1=util[_0x33ef('0x4f')](_0x33ef('0x50'),_0x118b45[_0x33ef('0x4e')]);if(fs['existsSync'](_0x5076c1)){_0x2f0ebd=!![];return _0x49e04b[_0x33ef('0x52')](_0x5076c1,_0x118b45[_0x33ef('0x4e')],config[_0x33ef('0x53')][_0x33ef('0x54')])['then'](function(){return _0x118b45;});}return _0x118b45;}})['then'](function(_0x4ef013){if(_0x4ef013){if(!fs[_0x33ef('0x51')](_0x4ef013[_0x33ef('0x4e')])){throw new db[(_0x33ef('0x55'))][(_0x33ef('0x56'))](_0x33ef('0x57'));}if(_0x4ef013[_0x33ef('0x58')]){return _0x507019[_0x33ef('0x4a')](_0x4ef013[_0x33ef('0x4e')],_0x4ef013[_0x33ef('0x58')]+path[_0x33ef('0x61')](_0x4ef013[_0x33ef('0x4e')]),function(){if(_0x2f0ebd){fs[_0x33ef('0x59')](_0x4ef013['value']);}});}else{return _0x507019['download'](_0x4ef013['value'],function(_0x4dbc5d){if(_0x2f0ebd){fs['unlink'](_0x4ef013[_0x33ef('0x4e')]);}});}}})[_0x33ef('0x43')](handleError(_0x507019,null));};exports[_0x33ef('0x26')]=function(_0x5a10cd,_0x2049b0){return db['VoiceRecording'][_0x33ef('0x4d')]({'where':{'id':_0x5a10cd[_0x33ef('0x45')]['id']}})[_0x33ef('0x25')](function(_0x44a674){if(_[_0x33ef('0x62')](_0x44a674)){throw new ReferenceError(_0x33ef('0x63'));}return _0x44a674;})[_0x33ef('0x25')](function(_0x525bd0){var _0xe17d48=_0x525bd0['value'];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0xe17d48);if(!_['isNil'](_0x525bd0[_0x33ef('0x4e')])&&fs[_0x33ef('0x51')](_0xe17d48)){logger[_0x33ef('0x64')](_0x33ef('0x65')+_0xe17d48+_0x33ef('0x66'));fs[_0x33ef('0x67')](_0xe17d48);}_0xe17d48=_0xe17d48+_0x33ef('0x68');if(!_['isNil'](_0x525bd0[_0x33ef('0x4e')])&&fs[_0x33ef('0x51')](_0xe17d48)){logger[_0x33ef('0x64')](_0x33ef('0x65')+_0xe17d48+_0x33ef('0x66'));fs[_0x33ef('0x67')](_0xe17d48);}return _0x525bd0;})['then'](function(_0x7f8bb3){if(!_0x7f8bb3)throw new InternalError();return _0x7f8bb3[_0x33ef('0x26')]();})[_0x33ef('0x25')](function(){_0x2049b0[_0x33ef('0x1a')](0xcc)[_0x33ef('0x27')]();})['catch'](handleError(_0x2049b0,null));};function getBucketslist(_0xc41248,_0x348672,_0x5ddee6){return new Promise(function(_0x1bc237,_0x313b7d){var _0x539c84=new AWS['S3']({'accessKeyId':_0x348672,'secretAccessKey':_0xc41248,'region':_0x5ddee6});_0x539c84[_0x33ef('0x69')]({},function(_0x16bf52,_0x407f35){if(_0x16bf52){return _0x313b7d(_0x16bf52);}else{return _0x1bc237(_0x407f35);}});});}function createBucket(_0x1f7e7e,_0x578768,_0x44cc2d,_0x3d988c){return new Promise(function(_0x5cdec8,_0x4e6c9e){var _0x170f85=new AWS['S3']({'accessKeyId':_0x578768,'secretAccessKey':_0x1f7e7e,'region':_0x44cc2d});_0x170f85[_0x33ef('0x6a')]({'Bucket':_0x3d988c},function(_0x10eb31,_0x3a15a8){if(_0x10eb31){return _0x4e6c9e(_0x10eb31);}else{return _0x5cdec8(_0x3a15a8);}});});}function uploadFile(_0x145624,_0x42ffdc,_0x3fa043,_0x304873,_0x1c43fb,_0x471e38){return new Promise(function(_0x2bf163,_0x6b4cf5){var _0x9fe2ba=new AWS['S3']({'accessKeyId':_0x42ffdc,'secretAccessKey':_0x145624,'region':_0x3fa043});_0x9fe2ba[_0x33ef('0x6b')]({'Bucket':_0x304873,'Key':_0x1c43fb,'Body':_0x471e38},function(_0x1e11da,_0xcb4914){if(_0x1e11da){return _0x6b4cf5(_0x1e11da);}else{return _0x2bf163(_0xcb4914);}});});}function startTranscribe(_0x265571,_0xedb092,_0x24c39e,_0x1382df,_0x5479e3,_0x3c0f6a){return new Promise(function(_0x558318,_0xb6c454){var _0x5427ec=new AWS[(_0x33ef('0x6c'))]({'accessKeyId':_0xedb092,'secretAccessKey':_0x265571,'region':_0x24c39e});_0x5427ec[_0x33ef('0x6d')]({'TranscriptionJobName':_0x1382df,'LanguageCode':_0x5479e3,'Media':{'MediaFileUri':_0x3c0f6a}},function(_0x19ad43,_0x523cf5){if(_0x19ad43){return _0xb6c454(_0x19ad43);}else{return _0x558318(_0x523cf5);}});});}function transcribe(_0x58f8d2,_0x379bbf,_0x2a4523,_0x13a264,_0x209e7a,_0x5cd73a,_0x5a22db){return new Promise(function(_0x24fffb,_0x4ae963){var _0x4e57a0={};logger[_0x33ef('0x64')](util[_0x33ef('0x4f')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x58f8d2,_0x209e7a));return uploadFile(_0x379bbf,_0x2a4523,_0x13a264,_0x209e7a,path[_0x33ef('0x6e')](_0x5cd73a),fs['readFileSync'](_0x5cd73a))[_0x33ef('0x25')](function(_0x14fbbd){logger[_0x33ef('0x64')](util[_0x33ef('0x4f')]('[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)',_0x58f8d2,_0x209e7a,_0x14fbbd['Location']));_0x4e57a0[_0x33ef('0x6f')]=_0x14fbbd[_0x33ef('0x70')];_0x4e57a0['location']=_0x14fbbd[_0x33ef('0x71')];logger[_0x33ef('0x64')](util[_0x33ef('0x4f')](_0x33ef('0x72'),_0x58f8d2));return startTranscribe(_0x379bbf,_0x2a4523,_0x13a264,uuidv4(),_0x5a22db,_0x14fbbd[_0x33ef('0x71')]);})['then'](function(_0x2ed7bb){logger['info'](util['format'](_0x33ef('0x73'),_0x58f8d2,_0x2ed7bb[_0x33ef('0x74')]['TranscriptionJobName']));_0x4e57a0['transcribeName']=_0x2ed7bb[_0x33ef('0x74')][_0x33ef('0x75')];_0x4e57a0[_0x33ef('0x76')]=_0x2ed7bb[_0x33ef('0x74')][_0x33ef('0x77')];return _0x24fffb(_0x4e57a0);})[_0x33ef('0x43')](function(_0xfd6daa){return _0x4ae963(_0xfd6daa);});});}exports[_0x33ef('0x78')]=function(_0xb61d78,_0x2d955a,_0x1dee3e){var _0x487013;var _0x3f438a;var _0x18c31a;var _0x29a176=require(_0x33ef('0x4b'));return db[_0x33ef('0x2c')][_0x33ef('0x79')]({'where':{'id':_0xb61d78[_0x33ef('0x45')]['id']}})[_0x33ef('0x25')](function(_0x540bbe){if(_0x540bbe){var _0x43b993=util['format'](_0x33ef('0x50'),_0x540bbe[_0x33ef('0x4e')]);if(fs[_0x33ef('0x51')](_0x43b993)){cypher=!![];return _0x29a176[_0x33ef('0x52')](_0x43b993,_0x540bbe[_0x33ef('0x4e')],config[_0x33ef('0x53')][_0x33ef('0x54')])[_0x33ef('0x25')](function(){return _0x540bbe;});}return _0x540bbe;}})[_0x33ef('0x25')](function(_0x4866ad){if(!_0x4866ad){throw new db['Sequelize'][(_0x33ef('0x56'))](_0x33ef('0x7a'));}_0x3f438a=_0x4866ad;return db[_0x33ef('0x7b')][_0x33ef('0x79')]({'where':{'id':0x1}});})[_0x33ef('0x25')](handleEntityNotFound(_0x2d955a,null))[_0x33ef('0x25')](function(_0x494d3d){if(_0x494d3d){_0x487013=_0x494d3d;if(!_0x487013[_0x33ef('0x7c')]||!_0x487013[_0x33ef('0x7d')]||!_0x487013[_0x33ef('0x7e')]||!_0x487013[_0x33ef('0x7f')]||!_0x487013['bucket']){throw new db[(_0x33ef('0x55'))][(_0x33ef('0x56'))](_0x33ef('0x80'));}if(_0xb61d78[_0x33ef('0x48')][_0x33ef('0x81')]&&(!_0x487013[_0x33ef('0x82')]||!_0x487013[_0x33ef('0x83')]||!_0x487013[_0x33ef('0x84')]||!_0x487013[_0x33ef('0x7f')]||!_0x487013[_0x33ef('0x6f')])){throw new db[(_0x33ef('0x55'))][(_0x33ef('0x56'))](_0x33ef('0x85'));}return db[_0x33ef('0x86')][_0x33ef('0x79')]({'where':{'id':_0x487013['transcribeAccountId']}});}})[_0x33ef('0x25')](function(_0x221dee){if(!_0x221dee){throw new db[(_0x33ef('0x55'))][(_0x33ef('0x56'))](_0x33ef('0x87'));}if(!_0x221dee[_0x33ef('0x88')]||!_0x221dee['data2']){throw new db[(_0x33ef('0x55'))]['ValidationError'](_0x33ef('0x89'));}_0x18c31a=_0x221dee;return getBucketslist(_0x18c31a[_0x33ef('0x88')],_0x18c31a[_0x33ef('0x8a')],_0x487013[_0x33ef('0x7e')]);})[_0x33ef('0x25')](function(_0xda0fc1){if(_0xda0fc1&&_0xda0fc1[_0x33ef('0x8b')]){var _0x753657=_['find'](_0xda0fc1[_0x33ef('0x8b')],function(_0x35131d){return _0x35131d[_0x33ef('0x8c')]===_0x487013[_0x33ef('0x6f')];});if(!_0x753657){logger[_0x33ef('0x64')](util[_0x33ef('0x4f')]('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available',_0xb61d78[_0x33ef('0x45')]['id'],_0x487013[_0x33ef('0x6f')]));return createBucket(_0x18c31a[_0x33ef('0x88')],_0x18c31a['data2'],_0x487013[_0x33ef('0x7e')],_0x487013['bucket']);}logger[_0x33ef('0x64')](util['format'](_0x33ef('0x8d'),_0xb61d78[_0x33ef('0x45')]['id'],_0x487013[_0x33ef('0x6f')]));return;}})[_0x33ef('0x25')](function(_0x15e19d){if(_0x3f438a[_0x33ef('0x76')]===_0x33ef('0x8e')){return transcribe(_0xb61d78[_0x33ef('0x45')]['id'],_0x18c31a[_0x33ef('0x88')],_0x18c31a[_0x33ef('0x8a')],_0x487013[_0x33ef('0x7e')],_0x487013['bucket'],_0x3f438a[_0x33ef('0x4e')],_0x487013[_0x33ef('0x7f')]);}else{logger[_0x33ef('0x64')](util[_0x33ef('0x4f')](_0x33ef('0x8f'),_0xb61d78[_0x33ef('0x45')]['id']));return{'transcribeStatus':_0x33ef('0x90')};}})[_0x33ef('0x25')](function(_0x18e26c){if(_0x18e26c){_0x18e26c['tempSentiment']=_0xb61d78[_0x33ef('0x48')][_0x33ef('0x81')];return _0x3f438a['updateAttributes'](_0x18e26c);}})[_0x33ef('0x25')](respondWithResult(_0x2d955a,null))['catch'](handleError(_0x2d955a,null));};function writeFile(_0x1bba27,_0x5e69c){return new Promise(function(_0x2872e7,_0x3cabcd){fs['writeFile'](_0x5e69c,_0x1bba27,function(_0x454760,_0xf3a16b){if(_0x454760){return _0x3cabcd(_0x454760);}else{return _0x2872e7(_0xf3a16b);}});});}exports[_0x33ef('0x91')]=function(_0x389f75,_0x2385da,_0x142dfc){return db[_0x33ef('0x2c')]['findOne']({'where':{'id':_0x389f75[_0x33ef('0x45')]['id']}})['then'](handleEntityNotFound(_0x2385da))[_0x33ef('0x25')](function(_0x562a6c){if(_0x562a6c&&_0x562a6c[_0x33ef('0x92')]){var _0x5c4fe6=_0x562a6c[_0x33ef('0x92')];var _0x88efab=config[_0x33ef('0x93')]+'/server/files/transcribes/transcribe_'+_0x562a6c['id']+_0x33ef('0x94');if(fs[_0x33ef('0x51')](_0x88efab)){return _0x88efab;}return writeFile(_0x5c4fe6,_0x88efab)[_0x33ef('0x25')](function(){return _0x88efab;});}else{throw new db[(_0x33ef('0x55'))]['ValidationError'](_0x33ef('0x95'));}})['then'](function(_0x426fa4){return _0x2385da[_0x33ef('0x4a')](_0x426fa4);})['catch'](handleError(_0x2385da));};
\ No newline at end of file
index db8a8d2..e426574 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a55=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define','voice_recordings','uniqueid'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x7a55,0xcc));var _0x57a5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7a55[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x57a5('0x0'));var util=require(_0x57a5('0x1'));var logger=require(_0x57a5('0x2'))(_0x57a5('0x3'));var moment=require(_0x57a5('0x4'));var BPromise=require(_0x57a5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x57a5('0x6'));var rimraf=require(_0x57a5('0x7'));var config=require(_0x57a5('0x8'));var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x28a709,_0x4e75ae){return _0x28a709[_0x57a5('0x9')]('VoiceRecording',attributes,{'tableName':_0x57a5('0xa'),'paranoid':![],'indexes':[{'name':_0x57a5('0xb'),'fields':[_0x57a5('0xb')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x1d1d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','define','voice_recordings','uniqueid','lodash','../../config/logger'];(function(_0x4271e6,_0x42904b){var _0x553a2e=function(_0x13217b){while(--_0x13217b){_0x4271e6['push'](_0x4271e6['shift']());}};_0x553a2e(++_0x42904b);}(_0x1d1d,0x1cc));var _0xd1d1=function(_0x2a7e32,_0x202dd5){_0x2a7e32=_0x2a7e32-0x0;var _0x575f54=_0x1d1d[_0x2a7e32];return _0x575f54;};'use strict';var _=require(_0xd1d1('0x0'));var util=require('util');var logger=require(_0xd1d1('0x1'))(_0xd1d1('0x2'));var moment=require(_0xd1d1('0x3'));var BPromise=require(_0xd1d1('0x4'));var rp=require(_0xd1d1('0x5'));var fs=require('fs');var path=require(_0xd1d1('0x6'));var rimraf=require(_0xd1d1('0x7'));var config=require(_0xd1d1('0x8'));var attributes=require(_0xd1d1('0x9'));module[_0xd1d1('0xa')]=function(_0x52ff1e,_0x31a8d2){return _0x52ff1e[_0xd1d1('0xb')]('VoiceRecording',attributes,{'tableName':_0xd1d1('0xc'),'paranoid':![],'indexes':[{'name':_0xd1d1('0xd'),'fields':[_0xd1d1('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index beb4783..3c29c23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x583c=['options','raw','where','attributes','limit','debug','stringify','catch','Setting','callRecordingEncryption','create','value','format','%s.cypher','encryptFile','secrets','unlink','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','message','result','UpdateVoiceRecording','VoiceRecording','body'];(function(_0x3b66cd,_0x4effa9){var _0x32ff6d=function(_0x52d640){while(--_0x52d640){_0x3b66cd['push'](_0x3b66cd['shift']());}};_0x32ff6d(++_0x4effa9);}(_0x583c,0x12b));var _0xc583=function(_0x802997,_0x5534a2){_0x802997=_0x802997-0x0;var _0x35c641=_0x583c[_0x802997];return _0x35c641;};'use strict';var _=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var moment=require(_0xc583('0x2'));var BPromise=require(_0xc583('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc583('0x4'));var db=require(_0xc583('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc583('0x6'));var config=require(_0xc583('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc583('0x8')][_0xc583('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2719df,_0x1dd37c,_0x48a8d4){return new BPromise(function(_0x21ed88,_0x26cec0){return client['request'](_0x2719df,_0x48a8d4)[_0xc583('0xa')](function(_0x24ab4f){logger[_0xc583('0xb')](_0xc583('0xc'),_0x1dd37c,_0xc583('0xd'));logger['debug'](_0xc583('0xe'),_0x1dd37c,_0xc583('0xd'),JSON['stringify'](_0x24ab4f));if(_0x24ab4f[_0xc583('0xf')]){if(_0x24ab4f[_0xc583('0xf')]['code']===0x1f4){logger[_0xc583('0xf')](_0xc583('0xc'),_0x1dd37c,_0x24ab4f[_0xc583('0xf')][_0xc583('0x10')]);return _0x26cec0(_0x24ab4f[_0xc583('0xf')][_0xc583('0x10')]);}logger[_0xc583('0xf')](_0xc583('0xc'),_0x1dd37c,_0x24ab4f[_0xc583('0xf')]['message']);return _0x21ed88(_0x24ab4f[_0xc583('0xf')]['message']);}else{logger[_0xc583('0xb')](_0xc583('0xc'),_0x1dd37c,'request\x20sent');_0x21ed88(_0x24ab4f[_0xc583('0x11')][_0xc583('0x10')]);}})['catch'](function(_0x7d1690){logger[_0xc583('0xf')]('VoiceRecording,\x20%s,\x20%s',_0x1dd37c,_0x7d1690);_0x26cec0(_0x7d1690);});});}exports[_0xc583('0x12')]=function(_0x8a2d84){var _0x12aac2=this;return new Promise(function(_0x36e0fd,_0x5433ec){return db[_0xc583('0x13')]['update'](_0x8a2d84[_0xc583('0x14')],{'raw':_0x8a2d84[_0xc583('0x15')]?_0x8a2d84[_0xc583('0x15')][_0xc583('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8a2d84[_0xc583('0x15')]?_0x8a2d84[_0xc583('0x15')][_0xc583('0x17')]||null:null,'attributes':_0x8a2d84[_0xc583('0x15')]?_0x8a2d84[_0xc583('0x15')][_0xc583('0x18')]||null:null,'limit':_0x8a2d84[_0xc583('0x15')]?_0x8a2d84[_0xc583('0x15')][_0xc583('0x19')]||null:null})['then'](function(_0x542256){logger[_0xc583('0xb')](_0xc583('0x12'),_0x8a2d84);logger[_0xc583('0x1a')]('UpdateVoiceRecording',_0x8a2d84,JSON[_0xc583('0x1b')](_0x542256));_0x36e0fd(_0x542256);})[_0xc583('0x1c')](function(_0x37f156){logger[_0xc583('0xf')](_0xc583('0x12'),_0x37f156['message'],_0x8a2d84);_0x5433ec(_0x12aac2['error'](0x1f4,_0x37f156[_0xc583('0x10')]));});});};exports['CreateVoiceRecording']=function(_0x45ef74){var _0xcbe9b2=this;return new Promise(function(_0xbabf24,_0x1e7809){var _0x24aab5=require('../../components/encryptor');var _0x2dafb4;return db[_0xc583('0x1d')]['findOne']({'attributes':['id',_0xc583('0x1e')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x2c9088){_0x2dafb4=_0x2c9088;return db[_0xc583('0x13')][_0xc583('0x1f')](_0x45ef74[_0xc583('0x14')]);})[_0xc583('0xa')](function(_0x19079b){if(_0x2dafb4[_0xc583('0x1e')]&&fs['existsSync'](_0x19079b[_0xc583('0x20')])){var _0x390bc3=util[_0xc583('0x21')](_0xc583('0x22'),_0x19079b[_0xc583('0x20')]);return _0x24aab5[_0xc583('0x23')](_0x19079b['value'],_0x390bc3,config[_0xc583('0x24')]['recording'])['then'](function(){fs[_0xc583('0x25')](_0x19079b[_0xc583('0x20')]);logger[_0xc583('0xb')](_0xc583('0x26'));return _0x19079b;});}return _0x19079b;})[_0xc583('0xa')](function(_0x4a9679){logger[_0xc583('0xb')](_0xc583('0x27'),_0x45ef74);logger[_0xc583('0x1a')]('CreateVoiceRecording',_0x45ef74,JSON[_0xc583('0x1b')](_0x4a9679));_0xbabf24(_0x4a9679);})['catch'](function(_0x1aa62a){logger[_0xc583('0xf')](_0xc583('0x27'),_0x1aa62a[_0xc583('0x10')],_0x45ef74);_0x1e7809(_0xcbe9b2[_0xc583('0xf')](0x1f4,_0x1aa62a['message']));});});};
\ No newline at end of file
+var _0x93e9=['http','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateVoiceRecording','VoiceRecording','body','options','raw','where','attributes','limit','debug','stringify','../../components/encryptor','Setting','findOne','existsSync','value','format','%s.cypher','encryptFile','secrets','CreateVoiceRecording\x20file\x20encrypted','CreateVoiceRecording','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x43f638,_0x45397c){var _0x30d91f=function(_0x458acb){while(--_0x458acb){_0x43f638['push'](_0x43f638['shift']());}};_0x30d91f(++_0x45397c);}(_0x93e9,0xcc));var _0x993e=function(_0x1e93ed,_0x218a17){_0x1e93ed=_0x1e93ed-0x0;var _0x150ba2=_0x93e9[_0x1e93ed];return _0x150ba2;};'use strict';var _=require(_0x993e('0x0'));var util=require(_0x993e('0x1'));var moment=require(_0x993e('0x2'));var BPromise=require(_0x993e('0x3'));var rs=require(_0x993e('0x4'));var fs=require('fs');var Redis=require(_0x993e('0x5'));var db=require(_0x993e('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x993e('0x7'));var config=require(_0x993e('0x8'));var jayson=require(_0x993e('0x9'));var client=jayson[_0x993e('0xa')][_0x993e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2366d9,_0x12ac94,_0x1aef74){return new BPromise(function(_0x53d0ce,_0x4701d3){return client[_0x993e('0xc')](_0x2366d9,_0x1aef74)[_0x993e('0xd')](function(_0x280291){logger[_0x993e('0xe')](_0x993e('0xf'),_0x12ac94,_0x993e('0x10'));logger['debug'](_0x993e('0x11'),_0x12ac94,_0x993e('0x10'),JSON['stringify'](_0x280291));if(_0x280291['error']){if(_0x280291[_0x993e('0x12')]['code']===0x1f4){logger[_0x993e('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x12ac94,_0x280291['error'][_0x993e('0x13')]);return _0x4701d3(_0x280291[_0x993e('0x12')][_0x993e('0x13')]);}logger[_0x993e('0x12')](_0x993e('0xf'),_0x12ac94,_0x280291[_0x993e('0x12')][_0x993e('0x13')]);return _0x53d0ce(_0x280291[_0x993e('0x12')][_0x993e('0x13')]);}else{logger[_0x993e('0xe')](_0x993e('0xf'),_0x12ac94,_0x993e('0x10'));_0x53d0ce(_0x280291[_0x993e('0x14')][_0x993e('0x13')]);}})[_0x993e('0x15')](function(_0x454475){logger[_0x993e('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x12ac94,_0x454475);_0x4701d3(_0x454475);});});}exports[_0x993e('0x16')]=function(_0x1acd21){var _0x3cc2b9=this;return new Promise(function(_0x3d6109,_0xfc2cbb){return db[_0x993e('0x17')]['update'](_0x1acd21[_0x993e('0x18')],{'raw':_0x1acd21[_0x993e('0x19')]?_0x1acd21[_0x993e('0x19')][_0x993e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1acd21[_0x993e('0x19')]?_0x1acd21[_0x993e('0x19')][_0x993e('0x1b')]||null:null,'attributes':_0x1acd21[_0x993e('0x19')]?_0x1acd21['options'][_0x993e('0x1c')]||null:null,'limit':_0x1acd21['options']?_0x1acd21[_0x993e('0x19')][_0x993e('0x1d')]||null:null})[_0x993e('0xd')](function(_0x5ba2a1){logger[_0x993e('0xe')](_0x993e('0x16'),_0x1acd21);logger[_0x993e('0x1e')](_0x993e('0x16'),_0x1acd21,JSON[_0x993e('0x1f')](_0x5ba2a1));_0x3d6109(_0x5ba2a1);})[_0x993e('0x15')](function(_0xa1c83e){logger[_0x993e('0x12')](_0x993e('0x16'),_0xa1c83e[_0x993e('0x13')],_0x1acd21);_0xfc2cbb(_0x3cc2b9[_0x993e('0x12')](0x1f4,_0xa1c83e[_0x993e('0x13')]));});});};exports['CreateVoiceRecording']=function(_0x2756a7){var _0x279bb8=this;return new Promise(function(_0x52b727,_0x27bbf7){var _0x4f5cc1=require(_0x993e('0x20'));var _0xa03fbd;return db[_0x993e('0x21')][_0x993e('0x22')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})['then'](function(_0x32e332){_0xa03fbd=_0x32e332;return db[_0x993e('0x17')]['create'](_0x2756a7[_0x993e('0x18')]);})[_0x993e('0xd')](function(_0x248354){if(_0xa03fbd['callRecordingEncryption']&&fs[_0x993e('0x23')](_0x248354[_0x993e('0x24')])){var _0x1f5d51=util[_0x993e('0x25')](_0x993e('0x26'),_0x248354['value']);return _0x4f5cc1[_0x993e('0x27')](_0x248354['value'],_0x1f5d51,config[_0x993e('0x28')]['recording'])[_0x993e('0xd')](function(){fs['unlink'](_0x248354[_0x993e('0x24')]);logger[_0x993e('0xe')](_0x993e('0x29'));return _0x248354;});}return _0x248354;})[_0x993e('0xd')](function(_0xbadd6e){logger[_0x993e('0xe')]('CreateVoiceRecording',_0x2756a7);logger[_0x993e('0x1e')]('CreateVoiceRecording',_0x2756a7,JSON['stringify'](_0xbadd6e));_0x52b727(_0xbadd6e);})[_0x993e('0x15')](function(_0x497d29){logger[_0x993e('0x12')](_0x993e('0x2a'),_0x497d29[_0x993e('0x13')],_0x2756a7);_0x27bbf7(_0x279bb8[_0x993e('0x12')](0x1f4,_0x497d29[_0x993e('0x13')]));});});};
\ No newline at end of file
index dd4765e..b0333b2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5034=['put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','./voiceTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show','create'];(function(_0x996bc8,_0x291e01){var _0x20b0ea=function(_0x5ba992){while(--_0x5ba992){_0x996bc8['push'](_0x996bc8['shift']());}};_0x20b0ea(++_0x291e01);}(_0x5034,0xd5));var _0x4503=function(_0x1691ca,_0x9d48b6){_0x1691ca=_0x1691ca-0x0;var _0xe4f6f0=_0x5034[_0x1691ca];return _0xe4f6f0;};'use strict';var multer=require(_0x4503('0x0'));var util=require(_0x4503('0x1'));var path=require('path');var timeout=require(_0x4503('0x2'));var express=require(_0x4503('0x3'));var router=express[_0x4503('0x4')]();var fs_extra=require(_0x4503('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4503('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x4503('0x7')]);router[_0x4503('0x8')](_0x4503('0x9'),auth[_0x4503('0xa')](),controller[_0x4503('0xb')]);router[_0x4503('0x8')](_0x4503('0xc'),auth[_0x4503('0xa')](),controller[_0x4503('0xd')]);router['post']('/',auth[_0x4503('0xa')](),controller[_0x4503('0xe')]);router[_0x4503('0xf')](_0x4503('0xc'),auth[_0x4503('0xa')](),controller['update']);router[_0x4503('0x10')]('/:id',auth[_0x4503('0xa')](),controller[_0x4503('0x11')]);module[_0x4503('0x12')]=router;
\ No newline at end of file
+var _0x6582=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5c7cd6,_0xa77e75){var _0x5820da=function(_0x2d499e){while(--_0x2d499e){_0x5c7cd6['push'](_0x5c7cd6['shift']());}};_0x5820da(++_0xa77e75);}(_0x6582,0x16f));var _0x2658=function(_0x2c0557,_0x4314fd){_0x2c0557=_0x2c0557-0x0;var _0x2878cd=_0x6582[_0x2c0557];return _0x2878cd;};'use strict';var multer=require(_0x2658('0x0'));var util=require(_0x2658('0x1'));var path=require(_0x2658('0x2'));var timeout=require('connect-timeout');var express=require(_0x2658('0x3'));var router=express[_0x2658('0x4')]();var fs_extra=require(_0x2658('0x5'));var auth=require(_0x2658('0x6'));var interaction=require(_0x2658('0x7'));var config=require(_0x2658('0x8'));var controller=require('./voiceTransferReport.controller');router[_0x2658('0x9')]('/',auth[_0x2658('0xa')](),controller[_0x2658('0xb')]);router['get'](_0x2658('0xc'),auth[_0x2658('0xa')](),controller[_0x2658('0xd')]);router['get']('/:id',auth[_0x2658('0xa')](),controller[_0x2658('0xe')]);router[_0x2658('0xf')]('/',auth[_0x2658('0xa')](),controller[_0x2658('0x10')]);router['put'](_0x2658('0x11'),auth[_0x2658('0xa')](),controller[_0x2658('0x12')]);router[_0x2658('0x13')](_0x2658('0x11'),auth[_0x2658('0xa')](),controller[_0x2658('0x14')]);module[_0x2658('0x15')]=router;
\ No newline at end of file
index a901026..90dc64b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6401=['blind','attended','STRING','ENUM','Yes','sequelize','moment','exports'];(function(_0x5c45a1,_0x159ce7){var _0x1775fa=function(_0x1b1b77){while(--_0x1b1b77){_0x5c45a1['push'](_0x5c45a1['shift']());}};_0x1775fa(++_0x159ce7);}(_0x6401,0xf5));var _0x1640=function(_0x421bcd,_0x4df016){_0x421bcd=_0x421bcd-0x0;var _0x330e36=_0x6401[_0x421bcd];return _0x330e36;};'use strict';var Sequelize=require(_0x1640('0x0'));var moment=require(_0x1640('0x1'));module[_0x1640('0x2')]={'type':{'type':Sequelize['ENUM'](_0x1640('0x3'),_0x1640('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x1640('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x1640('0x5')]},'transferercalleridname':{'type':Sequelize[_0x1640('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x1640('0x5')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x1640('0x5')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x1640('0x5')]},'transfereechannel':{'type':Sequelize[_0x1640('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x1640('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x1640('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x1640('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x1640('0x5')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x1640('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x1640('0x5')]},'isexternal':{'type':Sequelize[_0x1640('0x6')](_0x1640('0x7'),'No')},'context':{'type':Sequelize[_0x1640('0x5')]},'extension':{'type':Sequelize[_0x1640('0x5')]}};
\ No newline at end of file
+var _0x8ae9=['moment','ENUM','attended','STRING','Yes','sequelize'];(function(_0x55ecc7,_0x2d44c1){var _0x37bbeb=function(_0x2e62fd){while(--_0x2e62fd){_0x55ecc7['push'](_0x55ecc7['shift']());}};_0x37bbeb(++_0x2d44c1);}(_0x8ae9,0x13d));var _0x98ae=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ae9[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x98ae('0x0'));var moment=require(_0x98ae('0x1'));module['exports']={'type':{'type':Sequelize[_0x98ae('0x2')]('blind',_0x98ae('0x3'))},'result':{'type':Sequelize[_0x98ae('0x4')]},'transfererchannel':{'type':Sequelize[_0x98ae('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x98ae('0x4')]},'transferercalleridname':{'type':Sequelize[_0x98ae('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x98ae('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x98ae('0x4')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x98ae('0x4')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x98ae('0x4')]},'transfereechannel':{'type':Sequelize[_0x98ae('0x4')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x98ae('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x98ae('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x98ae('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x98ae('0x4')]},'transfereecontext':{'type':Sequelize[_0x98ae('0x4')]},'transfereeexten':{'type':Sequelize[_0x98ae('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x98ae('0x4')]},'isexternal':{'type':Sequelize['ENUM'](_0x98ae('0x5'),'No')},'context':{'type':Sequelize[_0x98ae('0x4')]},'extension':{'type':Sequelize[_0x98ae('0x4')]}};
\ No newline at end of file
index 7c7c932..8fd1b73 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc411=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','end','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','filters','where','VIRTUAL','filter','merge','options','includeAll','catch','show','params','include','create','body','update','find','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc411,0x8e));var _0x1c41=function(_0x313c96,_0x3cee6e){_0x313c96=_0x313c96-0x0;var _0x522f53=_0xc411[_0x313c96];return _0x522f53;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1c41('0x0'));var zipdir=require(_0x1c41('0x1'));var jsonpatch=require(_0x1c41('0x2'));var rp=require('request-promise');var moment=require(_0x1c41('0x3'));var BPromise=require(_0x1c41('0x4'));var Mustache=require(_0x1c41('0x5'));var util=require('util');var path=require(_0x1c41('0x6'));var sox=require(_0x1c41('0x7'));var csv=require(_0x1c41('0x8'));var ejs=require(_0x1c41('0x9'));var fs=require('fs');var fs_extra=require(_0x1c41('0xa'));var _=require(_0x1c41('0xb'));var squel=require(_0x1c41('0xc'));var crypto=require(_0x1c41('0xd'));var jsforce=require(_0x1c41('0xe'));var deskjs=require(_0x1c41('0xf'));var toCsv=require(_0x1c41('0x8'));var querystring=require(_0x1c41('0x10'));var Papa=require(_0x1c41('0x11'));var Redis=require(_0x1c41('0x12'));var authService=require(_0x1c41('0x13'));var qs=require(_0x1c41('0x14'));var as=require(_0x1c41('0x15'));var hardwareService=require(_0x1c41('0x16'));var logger=require(_0x1c41('0x17'))(_0x1c41('0x18'));var utils=require(_0x1c41('0x19'));var config=require(_0x1c41('0x1a'));var licenseUtil=require(_0x1c41('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13b382,_0x106741){_0x106741=_0x106741||0xcc;return function(_0xd09e95){if(_0xd09e95){return _0x13b382[_0x1c41('0x1c')](_0x106741);}return _0x13b382[_0x1c41('0x1d')](_0x106741)['end']();};}function respondWithResult(_0x431f3b,_0x53a5a1){_0x53a5a1=_0x53a5a1||0xc8;return function(_0x2aa8ac){if(_0x2aa8ac){return _0x431f3b[_0x1c41('0x1d')](_0x53a5a1)[_0x1c41('0x1e')](_0x2aa8ac);}};}function respondWithFilteredResult(_0x1867f9,_0x54550b){return function(_0x2e2b0f){if(_0x2e2b0f){var _0x34897a=typeof _0x54550b[_0x1c41('0x1f')]===_0x1c41('0x20')&&typeof _0x54550b[_0x1c41('0x21')]===_0x1c41('0x20');var _0x35f97c=_0x2e2b0f['count'];var _0xcd142=_0x34897a?0x0:_0x54550b[_0x1c41('0x1f')];var _0x2f9348=_0x34897a?_0x2e2b0f[_0x1c41('0x22')]:_0x54550b[_0x1c41('0x1f')]+_0x54550b[_0x1c41('0x21')];var _0x27ead1;if(_0x2f9348>=_0x35f97c){_0x2f9348=_0x35f97c;_0x27ead1=0xc8;}else{_0x27ead1=0xce;}_0x1867f9['status'](_0x27ead1);return _0x1867f9['set'](_0x1c41('0x23'),_0xcd142+'-'+_0x2f9348+'/'+_0x35f97c)[_0x1c41('0x1e')](_0x2e2b0f);}return null;};}function patchUpdates(_0x53dea4){return function(_0x21733b){try{jsonpatch[_0x1c41('0x24')](_0x21733b,_0x53dea4,!![]);}catch(_0x48e47a){return BPromise[_0x1c41('0x25')](_0x48e47a);}return _0x21733b[_0x1c41('0x26')]();};}function saveUpdates(_0x205217,_0x4f8f23){return function(_0x4df2f5){if(_0x4df2f5){return _0x4df2f5['update'](_0x205217)['then'](function(_0x128571){return _0x128571;});}return null;};}function removeEntity(_0xbd6f3f,_0x3d4583){return function(_0xdb135d){if(_0xdb135d){return _0xdb135d['destroy']()[_0x1c41('0x27')](function(){_0xbd6f3f[_0x1c41('0x1d')](0xcc)[_0x1c41('0x28')]();});}};}function handleEntityNotFound(_0x564fad,_0xda88b){return function(_0xeb509){if(!_0xeb509){_0x564fad[_0x1c41('0x1c')](0x194);}return _0xeb509;};}function handleError(_0x3c423a,_0x1c701d){_0x1c701d=_0x1c701d||0x1f4;return function(_0xc287bb){logger[_0x1c41('0x29')](_0xc287bb[_0x1c41('0x2a')]);if(_0xc287bb[_0x1c41('0x2b')]){delete _0xc287bb[_0x1c41('0x2b')];}_0x3c423a[_0x1c41('0x1d')](_0x1c701d)[_0x1c41('0x2c')](_0xc287bb);};}exports[_0x1c41('0x2d')]=function(_0x1276c0,_0x3f95bd){var _0x3ba1d5={},_0x145428={},_0x239c76={'count':0x0,'rows':[]};var _0x5718cd=_[_0x1c41('0x2e')](db[_0x1c41('0x2f')][_0x1c41('0x30')],function(_0x15f76d){return{'name':_0x15f76d[_0x1c41('0x31')],'type':_0x15f76d[_0x1c41('0x32')][_0x1c41('0x33')]};});_0x145428['model']=_['map'](_0x5718cd,_0x1c41('0x2b'));_0x145428['query']=_[_0x1c41('0x34')](_0x1276c0[_0x1c41('0x35')]);_0x145428['filters']=_['intersection'](_0x145428[_0x1c41('0x36')],_0x145428[_0x1c41('0x35')]);_0x3ba1d5[_0x1c41('0x37')]=_[_0x1c41('0x38')](_0x145428[_0x1c41('0x36')],qs[_0x1c41('0x39')](_0x1276c0[_0x1c41('0x35')]['fields']));_0x3ba1d5[_0x1c41('0x37')]=_0x3ba1d5[_0x1c41('0x37')][_0x1c41('0x3a')]?_0x3ba1d5[_0x1c41('0x37')]:_0x145428[_0x1c41('0x36')];if(!_0x1276c0['query'][_0x1c41('0x3b')]('nolimit')){_0x3ba1d5[_0x1c41('0x21')]=qs['limit'](_0x1276c0['query'][_0x1c41('0x21')]);_0x3ba1d5['offset']=qs[_0x1c41('0x1f')](_0x1276c0[_0x1c41('0x35')]['offset']);}_0x3ba1d5['order']=qs['sort'](_0x1276c0[_0x1c41('0x35')]['sort']);_0x3ba1d5['where']=qs[_0x1c41('0x3c')](_['pick'](_0x1276c0[_0x1c41('0x35')],_0x145428[_0x1c41('0x3c')]),_0x5718cd);if(_0x1276c0[_0x1c41('0x35')]['filter']){_0x3ba1d5[_0x1c41('0x3d')]=_['merge'](_0x3ba1d5['where'],{'$or':_[_0x1c41('0x2e')](_0x5718cd,function(_0x125186){if(_0x125186[_0x1c41('0x32')]!==_0x1c41('0x3e')){var _0x13e6d3={};_0x13e6d3[_0x125186[_0x1c41('0x2b')]]={'$like':'%'+_0x1276c0[_0x1c41('0x35')][_0x1c41('0x3f')]+'%'};return _0x13e6d3;}})});}_0x3ba1d5=_[_0x1c41('0x40')]({},_0x3ba1d5,_0x1276c0[_0x1c41('0x41')]);var _0x7adafa={'where':_0x3ba1d5[_0x1c41('0x3d')]};return db[_0x1c41('0x2f')][_0x1c41('0x22')](_0x7adafa)[_0x1c41('0x27')](function(_0x3a0e2b){_0x239c76[_0x1c41('0x22')]=_0x3a0e2b;if(_0x1276c0['query'][_0x1c41('0x42')]){_0x3ba1d5['include']=[{'all':!![]}];}return db[_0x1c41('0x2f')]['findAll'](_0x3ba1d5);})['then'](function(_0x6b654b){_0x239c76['rows']=_0x6b654b;return _0x239c76;})['then'](respondWithFilteredResult(_0x3f95bd,_0x3ba1d5))[_0x1c41('0x43')](handleError(_0x3f95bd,null));};exports[_0x1c41('0x44')]=function(_0x5468d3,_0x44093a){var _0x2e0846={'raw':!![],'where':{'id':_0x5468d3[_0x1c41('0x45')]['id']}},_0x2d07c2={};_0x2d07c2['model']=_['keys'](db[_0x1c41('0x2f')][_0x1c41('0x30')]);_0x2d07c2[_0x1c41('0x35')]=_[_0x1c41('0x34')](_0x5468d3[_0x1c41('0x35')]);_0x2d07c2[_0x1c41('0x3c')]=_[_0x1c41('0x38')](_0x2d07c2[_0x1c41('0x36')],_0x2d07c2['query']);_0x2e0846[_0x1c41('0x37')]=_[_0x1c41('0x38')](_0x2d07c2[_0x1c41('0x36')],qs[_0x1c41('0x39')](_0x5468d3[_0x1c41('0x35')][_0x1c41('0x39')]));_0x2e0846['attributes']=_0x2e0846[_0x1c41('0x37')][_0x1c41('0x3a')]?_0x2e0846['attributes']:_0x2d07c2[_0x1c41('0x36')];if(_0x5468d3[_0x1c41('0x35')][_0x1c41('0x42')]){_0x2e0846[_0x1c41('0x46')]=[{'all':!![]}];}_0x2e0846=_['merge']({},_0x2e0846,_0x5468d3[_0x1c41('0x41')]);return db[_0x1c41('0x2f')]['find'](_0x2e0846)[_0x1c41('0x27')](handleEntityNotFound(_0x44093a,null))[_0x1c41('0x27')](respondWithResult(_0x44093a,null))['catch'](handleError(_0x44093a,null));};exports[_0x1c41('0x47')]=function(_0x3369a9,_0x5ce845){return db[_0x1c41('0x2f')][_0x1c41('0x47')](_0x3369a9[_0x1c41('0x48')],{})[_0x1c41('0x27')](respondWithResult(_0x5ce845,0xc9))['catch'](handleError(_0x5ce845,null));};exports[_0x1c41('0x49')]=function(_0x58784b,_0x10b2d8){if(_0x58784b[_0x1c41('0x48')]['id']){delete _0x58784b['body']['id'];}return db['VoiceTransferReport'][_0x1c41('0x4a')]({'where':{'id':_0x58784b[_0x1c41('0x45')]['id']}})[_0x1c41('0x27')](handleEntityNotFound(_0x10b2d8,null))[_0x1c41('0x27')](saveUpdates(_0x58784b[_0x1c41('0x48')],null))[_0x1c41('0x27')](respondWithResult(_0x10b2d8,null))['catch'](handleError(_0x10b2d8,null));};exports['destroy']=function(_0x2be878,_0x5c44d1){return db[_0x1c41('0x2f')][_0x1c41('0x4a')]({'where':{'id':_0x2be878['params']['id']}})[_0x1c41('0x27')](handleEntityNotFound(_0x5c44d1,null))[_0x1c41('0x27')](removeEntity(_0x5c44d1,null))['catch'](handleError(_0x5c44d1,null));};exports[_0x1c41('0x4b')]=function(_0x3ff60a,_0x54de69){return db[_0x1c41('0x2f')][_0x1c41('0x4b')]()[_0x1c41('0x27')](respondWithResult(_0x54de69,null))[_0x1c41('0x43')](handleError(_0x54de69,null));};
\ No newline at end of file
+var _0x7f63=['find','create','update','body','describe','eml-format','rimraf','zip-dir','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','VoiceTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes'];(function(_0x3aed72,_0x46eb13){var _0x1a84dc=function(_0x2a528e){while(--_0x2a528e){_0x3aed72['push'](_0x3aed72['shift']());}};_0x1a84dc(++_0x46eb13);}(_0x7f63,0x1b5));var _0x37f6=function(_0xe6b759,_0x2637a9){_0xe6b759=_0xe6b759-0x0;var _0x250568=_0x7f63[_0xe6b759];return _0x250568;};'use strict';var emlformat=require(_0x37f6('0x0'));var rimraf=require(_0x37f6('0x1'));var zipdir=require(_0x37f6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x37f6('0x3'));var util=require(_0x37f6('0x4'));var path=require('path');var sox=require(_0x37f6('0x5'));var csv=require(_0x37f6('0x6'));var ejs=require(_0x37f6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x37f6('0x8'));var squel=require(_0x37f6('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x37f6('0xa'));var toCsv=require(_0x37f6('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x37f6('0xb'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x37f6('0xc'));var hardwareService=require(_0x37f6('0xd'));var logger=require('../../config/logger')('api');var utils=require(_0x37f6('0xe'));var config=require(_0x37f6('0xf'));var licenseUtil=require(_0x37f6('0x10'));var db=require(_0x37f6('0x11'))['db'];function respondWithStatusCode(_0x1b8d82,_0x3a28d7){_0x3a28d7=_0x3a28d7||0xcc;return function(_0x2aab9a){if(_0x2aab9a){return _0x1b8d82[_0x37f6('0x12')](_0x3a28d7);}return _0x1b8d82[_0x37f6('0x13')](_0x3a28d7)[_0x37f6('0x14')]();};}function respondWithResult(_0x3f7557,_0x177297){_0x177297=_0x177297||0xc8;return function(_0x13f2b5){if(_0x13f2b5){return _0x3f7557[_0x37f6('0x13')](_0x177297)[_0x37f6('0x15')](_0x13f2b5);}};}function respondWithFilteredResult(_0x56f52a,_0x7bc96f){return function(_0xb0a911){if(_0xb0a911){var _0x339bed=typeof _0x7bc96f[_0x37f6('0x16')]===_0x37f6('0x17')&&typeof _0x7bc96f['limit']==='undefined';var _0x40535b=_0xb0a911[_0x37f6('0x18')];var _0x2df6b8=_0x339bed?0x0:_0x7bc96f[_0x37f6('0x16')];var _0x3b0ecd=_0x339bed?_0xb0a911['count']:_0x7bc96f[_0x37f6('0x16')]+_0x7bc96f[_0x37f6('0x19')];var _0x1a34f9;if(_0x3b0ecd>=_0x40535b){_0x3b0ecd=_0x40535b;_0x1a34f9=0xc8;}else{_0x1a34f9=0xce;}_0x56f52a[_0x37f6('0x13')](_0x1a34f9);return _0x56f52a[_0x37f6('0x1a')](_0x37f6('0x1b'),_0x2df6b8+'-'+_0x3b0ecd+'/'+_0x40535b)[_0x37f6('0x15')](_0xb0a911);}return null;};}function patchUpdates(_0x469c95){return function(_0x4f2789){try{jsonpatch[_0x37f6('0x1c')](_0x4f2789,_0x469c95,!![]);}catch(_0x704db7){return BPromise[_0x37f6('0x1d')](_0x704db7);}return _0x4f2789[_0x37f6('0x1e')]();};}function saveUpdates(_0x20dca6,_0x5c3c9a){return function(_0x5999d9){if(_0x5999d9){return _0x5999d9['update'](_0x20dca6)[_0x37f6('0x1f')](function(_0x462814){return _0x462814;});}return null;};}function removeEntity(_0x50bfc3,_0x43edaf){return function(_0x50c03e){if(_0x50c03e){return _0x50c03e[_0x37f6('0x20')]()[_0x37f6('0x1f')](function(){_0x50bfc3[_0x37f6('0x13')](0xcc)[_0x37f6('0x14')]();});}};}function handleEntityNotFound(_0x1308df,_0x22f222){return function(_0x37c9dd){if(!_0x37c9dd){_0x1308df[_0x37f6('0x12')](0x194);}return _0x37c9dd;};}function handleError(_0x492b57,_0x3b5c6a){_0x3b5c6a=_0x3b5c6a||0x1f4;return function(_0x1db42e){logger['error'](_0x1db42e[_0x37f6('0x21')]);if(_0x1db42e[_0x37f6('0x22')]){delete _0x1db42e[_0x37f6('0x22')];}_0x492b57[_0x37f6('0x13')](_0x3b5c6a)[_0x37f6('0x23')](_0x1db42e);};}exports[_0x37f6('0x24')]=function(_0x26f55b,_0x5a3cdd){var _0x539883={},_0x996a1e={},_0x3b551b={'count':0x0,'rows':[]};var _0x1a07c9=_[_0x37f6('0x25')](db[_0x37f6('0x26')]['rawAttributes'],function(_0x253adc){return{'name':_0x253adc[_0x37f6('0x27')],'type':_0x253adc[_0x37f6('0x28')][_0x37f6('0x29')]};});_0x996a1e[_0x37f6('0x2a')]=_['map'](_0x1a07c9,_0x37f6('0x22'));_0x996a1e[_0x37f6('0x2b')]=_[_0x37f6('0x2c')](_0x26f55b[_0x37f6('0x2b')]);_0x996a1e[_0x37f6('0x2d')]=_[_0x37f6('0x2e')](_0x996a1e[_0x37f6('0x2a')],_0x996a1e['query']);_0x539883[_0x37f6('0x2f')]=_[_0x37f6('0x2e')](_0x996a1e[_0x37f6('0x2a')],qs[_0x37f6('0x30')](_0x26f55b[_0x37f6('0x2b')][_0x37f6('0x30')]));_0x539883[_0x37f6('0x2f')]=_0x539883[_0x37f6('0x2f')][_0x37f6('0x31')]?_0x539883[_0x37f6('0x2f')]:_0x996a1e[_0x37f6('0x2a')];if(!_0x26f55b['query']['hasOwnProperty'](_0x37f6('0x32'))){_0x539883[_0x37f6('0x19')]=qs[_0x37f6('0x19')](_0x26f55b[_0x37f6('0x2b')][_0x37f6('0x19')]);_0x539883[_0x37f6('0x16')]=qs[_0x37f6('0x16')](_0x26f55b['query'][_0x37f6('0x16')]);}_0x539883[_0x37f6('0x33')]=qs[_0x37f6('0x34')](_0x26f55b['query'][_0x37f6('0x34')]);_0x539883[_0x37f6('0x35')]=qs['filters'](_[_0x37f6('0x36')](_0x26f55b[_0x37f6('0x2b')],_0x996a1e[_0x37f6('0x2d')]),_0x1a07c9);if(_0x26f55b[_0x37f6('0x2b')]['filter']){_0x539883[_0x37f6('0x35')]=_['merge'](_0x539883[_0x37f6('0x35')],{'$or':_[_0x37f6('0x25')](_0x1a07c9,function(_0x330d05){if(_0x330d05[_0x37f6('0x28')]!==_0x37f6('0x37')){var _0x1cf3db={};_0x1cf3db[_0x330d05[_0x37f6('0x22')]]={'$like':'%'+_0x26f55b[_0x37f6('0x2b')][_0x37f6('0x38')]+'%'};return _0x1cf3db;}})});}_0x539883=_[_0x37f6('0x39')]({},_0x539883,_0x26f55b[_0x37f6('0x3a')]);var _0x4fdf93={'where':_0x539883['where']};return db[_0x37f6('0x26')][_0x37f6('0x18')](_0x4fdf93)['then'](function(_0x2cba7c){_0x3b551b[_0x37f6('0x18')]=_0x2cba7c;if(_0x26f55b[_0x37f6('0x2b')][_0x37f6('0x3b')]){_0x539883[_0x37f6('0x3c')]=[{'all':!![]}];}return db[_0x37f6('0x26')][_0x37f6('0x3d')](_0x539883);})[_0x37f6('0x1f')](function(_0x25eede){_0x3b551b[_0x37f6('0x3e')]=_0x25eede;return _0x3b551b;})[_0x37f6('0x1f')](respondWithFilteredResult(_0x5a3cdd,_0x539883))[_0x37f6('0x3f')](handleError(_0x5a3cdd,null));};exports[_0x37f6('0x40')]=function(_0x5bdeb8,_0x4531d2){var _0x29b638={'raw':!![],'where':{'id':_0x5bdeb8[_0x37f6('0x41')]['id']}},_0x34927c={};_0x34927c['model']=_[_0x37f6('0x2c')](db[_0x37f6('0x26')][_0x37f6('0x42')]);_0x34927c[_0x37f6('0x2b')]=_[_0x37f6('0x2c')](_0x5bdeb8['query']);_0x34927c[_0x37f6('0x2d')]=_['intersection'](_0x34927c[_0x37f6('0x2a')],_0x34927c[_0x37f6('0x2b')]);_0x29b638['attributes']=_[_0x37f6('0x2e')](_0x34927c['model'],qs[_0x37f6('0x30')](_0x5bdeb8[_0x37f6('0x2b')]['fields']));_0x29b638[_0x37f6('0x2f')]=_0x29b638[_0x37f6('0x2f')][_0x37f6('0x31')]?_0x29b638[_0x37f6('0x2f')]:_0x34927c['model'];if(_0x5bdeb8[_0x37f6('0x2b')]['includeAll']){_0x29b638['include']=[{'all':!![]}];}_0x29b638=_['merge']({},_0x29b638,_0x5bdeb8['options']);return db[_0x37f6('0x26')][_0x37f6('0x43')](_0x29b638)[_0x37f6('0x1f')](handleEntityNotFound(_0x4531d2,null))[_0x37f6('0x1f')](respondWithResult(_0x4531d2,null))[_0x37f6('0x3f')](handleError(_0x4531d2,null));};exports['create']=function(_0x10aef4,_0x11c4b4){return db[_0x37f6('0x26')][_0x37f6('0x44')](_0x10aef4['body'],{})['then'](respondWithResult(_0x11c4b4,0xc9))['catch'](handleError(_0x11c4b4,null));};exports[_0x37f6('0x45')]=function(_0x5dde57,_0x1edde2){if(_0x5dde57['body']['id']){delete _0x5dde57[_0x37f6('0x46')]['id'];}return db[_0x37f6('0x26')][_0x37f6('0x43')]({'where':{'id':_0x5dde57[_0x37f6('0x41')]['id']}})[_0x37f6('0x1f')](handleEntityNotFound(_0x1edde2,null))['then'](saveUpdates(_0x5dde57[_0x37f6('0x46')],null))[_0x37f6('0x1f')](respondWithResult(_0x1edde2,null))[_0x37f6('0x3f')](handleError(_0x1edde2,null));};exports[_0x37f6('0x20')]=function(_0x34b6b6,_0x10b79a){return db['VoiceTransferReport']['find']({'where':{'id':_0x34b6b6[_0x37f6('0x41')]['id']}})['then'](handleEntityNotFound(_0x10b79a,null))[_0x37f6('0x1f')](removeEntity(_0x10b79a,null))[_0x37f6('0x3f')](handleError(_0x10b79a,null));};exports[_0x37f6('0x47')]=function(_0x370ae5,_0x27584d){return db['VoiceTransferReport'][_0x37f6('0x47')]()[_0x37f6('0x1f')](respondWithResult(_0x27584d,null))[_0x37f6('0x3f')](handleError(_0x27584d,null));};
\ No newline at end of file
index 1048617..6f56415 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6cf=['define','VoiceTransferReport','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x391c68,_0x40bfbd){var _0x84409e=function(_0x4ffcc6){while(--_0x4ffcc6){_0x391c68['push'](_0x391c68['shift']());}};_0x84409e(++_0x40bfbd);}(_0xe6cf,0x1c5));var _0xfe6c=function(_0x375325,_0x57a850){_0x375325=_0x375325-0x0;var _0x228f57=_0xe6cf[_0x375325];return _0x228f57;};'use strict';var _=require('lodash');var util=require(_0xfe6c('0x0'));var logger=require('../../config/logger')(_0xfe6c('0x1'));var moment=require(_0xfe6c('0x2'));var BPromise=require(_0xfe6c('0x3'));var rp=require(_0xfe6c('0x4'));var fs=require('fs');var path=require(_0xfe6c('0x5'));var rimraf=require(_0xfe6c('0x6'));var config=require(_0xfe6c('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0xfe6c('0x8')]=function(_0x253cff,_0x8120ab){return _0x253cff[_0xfe6c('0x9')](_0xfe6c('0xa'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6900=['bluebird','request-promise','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','lodash','../../config/logger','api','moment'];(function(_0x1d9e7d,_0x3005b7){var _0x458e6e=function(_0x2ab7b6){while(--_0x2ab7b6){_0x1d9e7d['push'](_0x1d9e7d['shift']());}};_0x458e6e(++_0x3005b7);}(_0x6900,0x98));var _0x0690=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x6900[_0x11c573];return _0x6b72de;};'use strict';var _=require(_0x0690('0x0'));var util=require('util');var logger=require(_0x0690('0x1'))(_0x0690('0x2'));var moment=require(_0x0690('0x3'));var BPromise=require(_0x0690('0x4'));var rp=require(_0x0690('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0690('0x6'));var config=require(_0x0690('0x7'));var attributes=require(_0x0690('0x8'));module[_0x0690('0x9')]=function(_0x63842d,_0x595a73){return _0x63842d[_0x0690('0xa')](_0x0690('0xb'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 71e8cd6..f0f781f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d09=['options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceTransferReport,\x20%s,\x20%s','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','CreateVoiceTransferReport','body'];(function(_0x142a07,_0x251e3c){var _0x101b6d=function(_0xcc9433){while(--_0xcc9433){_0x142a07['push'](_0x142a07['shift']());}};_0x101b6d(++_0x251e3c);}(_0x4d09,0x17b));var _0x94d0=function(_0x39e84d,_0x11931d){_0x39e84d=_0x39e84d-0x0;var _0x1991bc=_0x4d09[_0x39e84d];return _0x1991bc;};'use strict';var _=require(_0x94d0('0x0'));var util=require(_0x94d0('0x1'));var moment=require(_0x94d0('0x2'));var BPromise=require(_0x94d0('0x3'));var rs=require(_0x94d0('0x4'));var fs=require('fs');var Redis=require(_0x94d0('0x5'));var db=require(_0x94d0('0x6'))['db'];var utils=require(_0x94d0('0x7'));var logger=require(_0x94d0('0x8'))(_0x94d0('0x9'));var config=require(_0x94d0('0xa'));var jayson=require(_0x94d0('0xb'));var client=jayson[_0x94d0('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10f562,_0x4da53d,_0x982c27){return new BPromise(function(_0x3a1fa0,_0x1d1968){return client[_0x94d0('0xd')](_0x10f562,_0x982c27)[_0x94d0('0xe')](function(_0x23df45){logger[_0x94d0('0xf')](_0x94d0('0x10'),_0x4da53d,'request\x20sent');logger[_0x94d0('0x11')](_0x94d0('0x12'),_0x4da53d,_0x94d0('0x13'),JSON[_0x94d0('0x14')](_0x23df45));if(_0x23df45[_0x94d0('0x15')]){if(_0x23df45['error'][_0x94d0('0x16')]===0x1f4){logger[_0x94d0('0x15')](_0x94d0('0x10'),_0x4da53d,_0x23df45[_0x94d0('0x15')][_0x94d0('0x17')]);return _0x1d1968(_0x23df45['error'][_0x94d0('0x17')]);}logger[_0x94d0('0x15')](_0x94d0('0x10'),_0x4da53d,_0x23df45[_0x94d0('0x15')][_0x94d0('0x17')]);return _0x3a1fa0(_0x23df45[_0x94d0('0x15')][_0x94d0('0x17')]);}else{logger['info'](_0x94d0('0x10'),_0x4da53d,_0x94d0('0x13'));_0x3a1fa0(_0x23df45['result'][_0x94d0('0x17')]);}})[_0x94d0('0x18')](function(_0x526e1b){logger['error'](_0x94d0('0x10'),_0x4da53d,_0x526e1b);_0x1d1968(_0x526e1b);});});}exports[_0x94d0('0x19')]=function(_0x4e080c){var _0x5166f5=this;return new Promise(function(_0x39d668,_0x4a4e8e){return db['VoiceTransferReport']['create'](_0x4e080c[_0x94d0('0x1a')],{'raw':_0x4e080c['options']?_0x4e080c[_0x94d0('0x1b')][_0x94d0('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x890684){logger['info'](_0x94d0('0x19'),_0x4e080c);logger[_0x94d0('0x11')](_0x94d0('0x19'),_0x4e080c,JSON[_0x94d0('0x14')](_0x890684));_0x39d668(_0x890684);})[_0x94d0('0x18')](function(_0xf81a06){logger[_0x94d0('0x15')](_0x94d0('0x19'),_0xf81a06[_0x94d0('0x17')],_0x4e080c);_0x4a4e8e(_0x5166f5[_0x94d0('0x15')](0x1f4,_0xf81a06[_0x94d0('0x17')]));});});};
\ No newline at end of file
+var _0x31f6=['options','raw','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateVoiceTransferReport','create','body'];(function(_0x424a9a,_0x2dd9af){var _0xa7831c=function(_0x512534){while(--_0x512534){_0x424a9a['push'](_0x424a9a['shift']());}};_0xa7831c(++_0x2dd9af);}(_0x31f6,0x12e));var _0x631f=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x31f6[_0x57b54c];return _0x59cc19;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x631f('0x0'));var BPromise=require('bluebird');var rs=require(_0x631f('0x1'));var fs=require('fs');var Redis=require(_0x631f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x631f('0x3'));var logger=require(_0x631f('0x4'))(_0x631f('0x5'));var config=require(_0x631f('0x6'));var jayson=require(_0x631f('0x7'));var client=jayson[_0x631f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51f210,_0x47c6a9,_0xdb292b){return new BPromise(function(_0xcbeb3f,_0x507b5f){return client[_0x631f('0x9')](_0x51f210,_0xdb292b)[_0x631f('0xa')](function(_0x5cff0b){logger[_0x631f('0xb')](_0x631f('0xc'),_0x47c6a9,_0x631f('0xd'));logger[_0x631f('0xe')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x47c6a9,'request\x20sent',JSON[_0x631f('0xf')](_0x5cff0b));if(_0x5cff0b[_0x631f('0x10')]){if(_0x5cff0b[_0x631f('0x10')][_0x631f('0x11')]===0x1f4){logger[_0x631f('0x10')](_0x631f('0xc'),_0x47c6a9,_0x5cff0b[_0x631f('0x10')]['message']);return _0x507b5f(_0x5cff0b['error'][_0x631f('0x12')]);}logger[_0x631f('0x10')](_0x631f('0xc'),_0x47c6a9,_0x5cff0b[_0x631f('0x10')][_0x631f('0x12')]);return _0xcbeb3f(_0x5cff0b[_0x631f('0x10')][_0x631f('0x12')]);}else{logger['info'](_0x631f('0xc'),_0x47c6a9,_0x631f('0xd'));_0xcbeb3f(_0x5cff0b['result'][_0x631f('0x12')]);}})[_0x631f('0x13')](function(_0x3cfdc6){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x47c6a9,_0x3cfdc6);_0x507b5f(_0x3cfdc6);});});}exports[_0x631f('0x14')]=function(_0x57dc62){var _0x3a6d56=this;return new Promise(function(_0x4becdf,_0x536b70){return db['VoiceTransferReport'][_0x631f('0x15')](_0x57dc62[_0x631f('0x16')],{'raw':_0x57dc62['options']?_0x57dc62[_0x631f('0x17')][_0x631f('0x18')]===undefined?!![]:![]:!![]})[_0x631f('0xa')](function(_0x73813c){logger['info'](_0x631f('0x14'),_0x57dc62);logger[_0x631f('0xe')]('CreateVoiceTransferReport',_0x57dc62,JSON[_0x631f('0xf')](_0x73813c));_0x4becdf(_0x73813c);})[_0x631f('0x13')](function(_0x36b8d8){logger[_0x631f('0x10')](_0x631f('0x14'),_0x36b8d8[_0x631f('0x12')],_0x57dc62);_0x536b70(_0x3a6d56[_0x631f('0x10')](0x1f4,_0x36b8d8['message']));});});};
\ No newline at end of file
index d7a7d90..1086ce9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd348=['isAuthenticated','hangup','/answer','answer','/hold','unhold','/calls','calls','/transfer','transfer','exports','express','../../components/auth/service','./webbar.controller','post','/originate','canUpdate','originate'];(function(_0x496f8d,_0x266fb9){var _0x45f12d=function(_0x35465d){while(--_0x35465d){_0x496f8d['push'](_0x496f8d['shift']());}};_0x45f12d(++_0x266fb9);}(_0xd348,0x77));var _0x8d34=function(_0xa28331,_0x56764b){_0xa28331=_0xa28331-0x0;var _0x2bb8a4=_0xd348[_0xa28331];return _0x2bb8a4;};'use strict';var express=require(_0x8d34('0x0'));var router=express['Router']();var auth=require(_0x8d34('0x1'));var controller=require(_0x8d34('0x2'));router[_0x8d34('0x3')](_0x8d34('0x4'),auth['isAuthenticated'](),auth[_0x8d34('0x5')](),controller[_0x8d34('0x6')]);router[_0x8d34('0x3')]('/hangup',auth[_0x8d34('0x7')](),auth[_0x8d34('0x5')](),controller[_0x8d34('0x8')]);router[_0x8d34('0x3')](_0x8d34('0x9'),auth[_0x8d34('0x7')](),auth[_0x8d34('0x5')](),controller[_0x8d34('0xa')]);router[_0x8d34('0x3')](_0x8d34('0xb'),auth['isAuthenticated'](),auth[_0x8d34('0x5')](),controller['hold']);router['post']('/unhold',auth[_0x8d34('0x7')](),auth['canUpdate'](),controller[_0x8d34('0xc')]);router[_0x8d34('0x3')](_0x8d34('0xd'),auth[_0x8d34('0x7')](),auth[_0x8d34('0x5')](),controller[_0x8d34('0xe')]);router[_0x8d34('0x3')](_0x8d34('0xf'),auth[_0x8d34('0x7')](),auth['canUpdate'](),controller[_0x8d34('0x10')]);module[_0x8d34('0x11')]=router;
\ No newline at end of file
+var _0xd676=['/hold','hold','/unhold','unhold','/calls','calls','/transfer','transfer','express','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','canUpdate','originate','/hangup','hangup','/answer','answer'];(function(_0x5754a4,_0x180a6c){var _0x1dfa7f=function(_0x524617){while(--_0x524617){_0x5754a4['push'](_0x5754a4['shift']());}};_0x1dfa7f(++_0x180a6c);}(_0xd676,0x198));var _0x6d67=function(_0x2272e9,_0x3f615e){_0x2272e9=_0x2272e9-0x0;var _0x54056=_0xd676[_0x2272e9];return _0x54056;};'use strict';var express=require(_0x6d67('0x0'));var router=express['Router']();var auth=require(_0x6d67('0x1'));var controller=require(_0x6d67('0x2'));router[_0x6d67('0x3')](_0x6d67('0x4'),auth[_0x6d67('0x5')](),auth[_0x6d67('0x6')](),controller[_0x6d67('0x7')]);router[_0x6d67('0x3')](_0x6d67('0x8'),auth[_0x6d67('0x5')](),auth[_0x6d67('0x6')](),controller[_0x6d67('0x9')]);router[_0x6d67('0x3')](_0x6d67('0xa'),auth[_0x6d67('0x5')](),auth[_0x6d67('0x6')](),controller[_0x6d67('0xb')]);router[_0x6d67('0x3')](_0x6d67('0xc'),auth[_0x6d67('0x5')](),auth[_0x6d67('0x6')](),controller[_0x6d67('0xd')]);router[_0x6d67('0x3')](_0x6d67('0xe'),auth[_0x6d67('0x5')](),auth['canUpdate'](),controller[_0x6d67('0xf')]);router[_0x6d67('0x3')](_0x6d67('0x10'),auth['isAuthenticated'](),auth[_0x6d67('0x6')](),controller[_0x6d67('0x11')]);router[_0x6d67('0x3')](_0x6d67('0x12'),auth[_0x6d67('0x5')](),auth[_0x6d67('0x6')](),controller[_0x6d67('0x13')]);module['exports']=router;
\ No newline at end of file
index cbb0c6e..264e3ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe644=['rows','UserId','length','sessionId\x20','\x20not\x20found!','originate','body','json','callerId','callbackUrl','webbar:originate','originate\x20executed!','hangup','hangup\x20fired:','userId','sessionId','format','user:%s','webbar:hangup','answer','answer\x20fired:','entityFound:','webbar:answer','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','webbar:unhold','unhold\x20executed!','calls\x20fired:','conference','webbar:conference','conference\x20executed!','transfer','transferNumber','webbar:transfer','path','lodash','../../mysqldb','../../config/environment','util','bluebird','client','http','../../config/logger','webbarapi','ioredis','redis','localhost','validate','string','callNumber\x20is\x20required','number','userId\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','name','send','status','then','code','message','result','catch','User','findOne','agent','VoiceChannels','all','filter'];(function(_0x4559d6,_0x21ff92){var _0x3b77ae=function(_0x1ca65b){while(--_0x1ca65b){_0x4559d6['push'](_0x4559d6['shift']());}};_0x3b77ae(++_0x21ff92);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0x4e64('0x0'));var fs=require('fs');var _=require(_0x4e64('0x1'));var db=require(_0x4e64('0x2'))['db'];var config=require(_0x4e64('0x3'));var util=require(_0x4e64('0x4'));var BPromise=require(_0x4e64('0x5'));var jayson=require('jayson/promise');var amiClient=jayson[_0x4e64('0x6')][_0x4e64('0x7')]({'port':0x232a});var logger=require(_0x4e64('0x8'))(_0x4e64('0x9'));var Redis=require(_0x4e64('0xa'));config[_0x4e64('0xb')]=_['defaults'](config[_0x4e64('0xb')],{'host':_0x4e64('0xc'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require(_0x4e64('0xd'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x4e64('0xe'),'required':[!![],_0x4e64('0xf')]},'callerId':{'type':_0x4e64('0xe')},'callbackUrl':{'type':_0x4e64('0xe')}});var hangupValidation=new Schema({'userId':{'type':_0x4e64('0x10'),'required':[!![],_0x4e64('0x11')]},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x4e64('0x10'),'required':[!![],_0x4e64('0x11')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x4e64('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':[!![],_0x4e64('0x12')]},'transferNumber':{'type':'string','required':[!![],_0x4e64('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0x4e64('0x10'),'required':[!![],_0x4e64('0x11')]},'sessionId':{'type':_0x4e64('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x4e64('0x10'),'required':[!![],_0x4e64('0x11')]},'sessionId':{'type':_0x4e64('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x4e64('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0x4e64('0x10'),'required':[!![],_0x4e64('0x11')]}});function emit(_0x5b35b0,_0x3b885a,_0x3677f9){logger[_0x4e64('0x14')](_0x5b35b0,_0x3b885a,JSON[_0x4e64('0x15')](_0x3677f9));io['to'](_0x5b35b0)[_0x4e64('0x16')](_0x3b885a,_0x3677f9);}function handleError(_0x2a60ad){return function(_0x135ffb){console[_0x4e64('0x17')](_0x4e64('0x18'),_0x135ffb,_0x135ffb instanceof RangeError);logger[_0x4e64('0x19')](_0x135ffb['stack']);if(_0x135ffb instanceof RangeError){if(_0x135ffb[_0x4e64('0x1a')]){delete _0x135ffb[_0x4e64('0x1a')];}_0x2a60ad['status'](0x194)[_0x4e64('0x1b')](_0x135ffb);}else{if(_0x135ffb['name']){delete _0x135ffb['name'];}_0x2a60ad[_0x4e64('0x1c')](0x1f4)[_0x4e64('0x1b')](_0x135ffb);}};}function checkError(){return function(_0x227d64){if(!_0x227d64){throw new RangeError('NotFound');}return _0x227d64;};}function respondWithRpcPromise(_0x4a5c6d,_0x4a9957){return new BPromise(function(_0x30e356,_0x336c53){var _0x2df7a0=amiClient;return _0x2df7a0['request'](_0x4a5c6d,_0x4a9957)[_0x4e64('0x1d')](function(_0x58ea85){if(_0x58ea85[_0x4e64('0x19')]){if(_0x58ea85[_0x4e64('0x19')][_0x4e64('0x1e')]===0x1f4){return _0x336c53(_0x58ea85[_0x4e64('0x19')][_0x4e64('0x1f')]);}return _0x30e356(_0x58ea85['error'][_0x4e64('0x1f')]);}else{_0x30e356(_0x58ea85[_0x4e64('0x20')]);}})[_0x4e64('0x21')](function(_0x4afb9c){_0x336c53(_0x4afb9c);});});}function getAgent(_0x786ba9){return db[_0x4e64('0x22')][_0x4e64('0x23')]({'where':{'id':_0x786ba9,'role':_0x4e64('0x24')}})[_0x4e64('0x1d')](checkError());}function getAgentCheckSession(_0x5f0d42,_0x3185ba){return new BPromise(function(_0x2b1f2b,_0x45953f){var _0x194f33=respondWithRpcPromise(_0x4e64('0x25'));var _0x1057d0=getAgent(_0x5f0d42);Promise[_0x4e64('0x26')]([_0x194f33,_0x1057d0])[_0x4e64('0x1d')](function(_0x5467a5){var _0x371035=_0x5467a5[0x0];var _0xb17ca7=_0x5467a5[0x1];var _0x45ef44=_[_0x4e64('0x27')](_0x371035[_0x4e64('0x28')],function(_0x3b1f16){return _0x3b1f16[_0x4e64('0x29')]==_0xb17ca7['id']&&_0x3b1f16['sessionId']==_0x3185ba;});if(_0x45ef44[_0x4e64('0x2a')]==0x1){_0x2b1f2b(_0xb17ca7);}else{_0x45953f(new RangeError(_0x4e64('0x2b')+_0x3185ba+_0x4e64('0x2c')));}});});}exports[_0x4e64('0x2d')]=function(_0x3d8042,_0x3d6cec){logger[_0x4e64('0x14')]('originate\x20fired:',_0x3d8042[_0x4e64('0x2e')]);var _0x317c07=originateValidation[_0x4e64('0xd')](_0x3d8042['body']);if(_0x317c07[_0x4e64('0x2a')]>0x0){return _0x3d6cec['status'](0x190)[_0x4e64('0x2f')](_0x317c07);}var _0x37cde0=_0x3d8042['body']['userId'];var _0x5417ad=_0x3d8042[_0x4e64('0x2e')]['callNumber'];var _0x2c2397=_0x3d8042[_0x4e64('0x2e')][_0x4e64('0x30')];var _0x18ca6c=_0x3d8042[_0x4e64('0x2e')][_0x4e64('0x31')];return getAgent(_0x37cde0)[_0x4e64('0x1d')](function(_0x50b8d5){logger[_0x4e64('0x14')]('entityFound:',_0x50b8d5[_0x4e64('0x1a')]);emit(util['format']('user:%s',_0x50b8d5['name']),_0x4e64('0x32'),{'callNumber':_0x5417ad,'callerId':_0x2c2397,'callbackUrl':_0x18ca6c});return _0x3d6cec['status'](0xc8)['json']({'error':![],'message':_0x4e64('0x33')});})[_0x4e64('0x21')](handleError(_0x3d6cec));};exports[_0x4e64('0x34')]=function(_0x189769,_0x1757a2){logger[_0x4e64('0x14')](_0x4e64('0x35'),_0x189769['body']);var _0x5a03a8=hangupValidation['validate'](_0x189769[_0x4e64('0x2e')]);if(_0x5a03a8[_0x4e64('0x2a')]>0x0){return _0x1757a2[_0x4e64('0x1c')](0x190)[_0x4e64('0x2f')](_0x5a03a8);}var _0x5bf847=_0x189769[_0x4e64('0x2e')][_0x4e64('0x36')];var _0x11c373=_0x189769[_0x4e64('0x2e')][_0x4e64('0x37')];return getAgent(_0x5bf847)['then'](function(_0x4faf59){logger[_0x4e64('0x14')]('entityFound:',_0x4faf59[_0x4e64('0x1a')]);emit(util[_0x4e64('0x38')](_0x4e64('0x39'),_0x4faf59[_0x4e64('0x1a')]),_0x4e64('0x3a'),{'sessionId':_0x11c373});return _0x1757a2[_0x4e64('0x1c')](0xc8)[_0x4e64('0x2f')]({'error':![],'message':'hangup\x20executed!'});})[_0x4e64('0x21')](handleError(_0x1757a2));};exports[_0x4e64('0x3b')]=function(_0x460d66,_0x2e6684){logger[_0x4e64('0x14')](_0x4e64('0x3c'),_0x460d66[_0x4e64('0x2e')]);var _0x21e835=answerValidation['validate'](_0x460d66[_0x4e64('0x2e')]);if(_0x21e835[_0x4e64('0x2a')]>0x0){return _0x2e6684['status'](0x190)[_0x4e64('0x2f')](_0x21e835);}var _0x306b4d=_0x460d66['body'][_0x4e64('0x36')];var _0x1ddcf2=_0x460d66[_0x4e64('0x2e')][_0x4e64('0x37')];return getAgent(_0x306b4d)[_0x4e64('0x1d')](function(_0x5bc523){logger[_0x4e64('0x14')](_0x4e64('0x3d'),_0x5bc523[_0x4e64('0x1a')]);emit(util[_0x4e64('0x38')](_0x4e64('0x39'),_0x5bc523[_0x4e64('0x1a')]),_0x4e64('0x3e'),{'sessionId':_0x1ddcf2});return _0x2e6684[_0x4e64('0x1c')](0xc8)['json']({'error':![],'message':'answer\x20executed!'});})[_0x4e64('0x21')](handleError(_0x2e6684));};exports[_0x4e64('0x3f')]=function(_0x3cf687,_0x5861d7){logger[_0x4e64('0x14')](_0x4e64('0x40'),_0x3cf687[_0x4e64('0x2e')]);var _0x19a71b=holdValidation[_0x4e64('0xd')](_0x3cf687['body']);if(_0x19a71b[_0x4e64('0x2a')]>0x0){return _0x5861d7['status'](0x190)[_0x4e64('0x2f')](_0x19a71b);}var _0x3a5fad=_0x3cf687[_0x4e64('0x2e')][_0x4e64('0x36')];var _0x4cfac3=_0x3cf687[_0x4e64('0x2e')][_0x4e64('0x37')];return getAgent(_0x3a5fad)[_0x4e64('0x1d')](function(_0x38a885){logger[_0x4e64('0x14')]('entityFound:',_0x38a885[_0x4e64('0x1a')]);emit(util[_0x4e64('0x38')](_0x4e64('0x39'),_0x38a885[_0x4e64('0x1a')]),_0x4e64('0x41'),{'sessionId':_0x4cfac3});return _0x5861d7[_0x4e64('0x1c')](0xc8)['json']({'error':![],'message':_0x4e64('0x42')});})[_0x4e64('0x21')](handleError(_0x5861d7));};exports[_0x4e64('0x43')]=function(_0x4c2948,_0x44946b){logger[_0x4e64('0x14')]('unhold\x20fired:',_0x4c2948[_0x4e64('0x2e')]);var _0x5cedc6=unholdValidation[_0x4e64('0xd')](_0x4c2948['body']);if(_0x5cedc6[_0x4e64('0x2a')]>0x0){return _0x44946b['status'](0x190)[_0x4e64('0x2f')](_0x5cedc6);}var _0xb2c2c7=_0x4c2948[_0x4e64('0x2e')][_0x4e64('0x36')];var _0x33933a=_0x4c2948[_0x4e64('0x2e')][_0x4e64('0x37')];return getAgent(_0xb2c2c7)['then'](function(_0x471be1){logger[_0x4e64('0x14')](_0x4e64('0x3d'),_0x471be1['name']);emit(util['format'](_0x4e64('0x39'),_0x471be1['name']),_0x4e64('0x44'),{'sessionId':_0x33933a});return _0x44946b[_0x4e64('0x1c')](0xc8)[_0x4e64('0x2f')]({'error':![],'message':_0x4e64('0x45')});})[_0x4e64('0x21')](handleError(_0x44946b));};exports['calls']=function(_0x562f53,_0x339e39){logger[_0x4e64('0x14')](_0x4e64('0x46'),_0x339e39[_0x4e64('0x2e')]);var _0x3def87=callsValidation[_0x4e64('0xd')](_0x562f53[_0x4e64('0x2e')]);if(_0x3def87[_0x4e64('0x2a')]>0x0){return _0x339e39['status'](0x190)[_0x4e64('0x2f')](_0x3def87);}var _0x3251a3=_0x562f53[_0x4e64('0x2e')]['userId'];var _0xa277da=respondWithRpcPromise(_0x4e64('0x25'));var _0x502640=getAgent(_0x3251a3);return Promise[_0x4e64('0x26')]([_0xa277da,_0x502640])[_0x4e64('0x1d')](function(_0xb1ef5f){var _0x377da8=_0xb1ef5f[0x0];var _0x82dcde=_0xb1ef5f[0x1];var _0x10d2ac=_['filter'](_0x377da8[_0x4e64('0x28')],function(_0x12bf29){return _0x12bf29[_0x4e64('0x29')]==_0x82dcde['id'];});return _0x339e39['status'](0xc8)[_0x4e64('0x2f')]({'count':_0x10d2ac[_0x4e64('0x2a')],'rows':_0x10d2ac});})[_0x4e64('0x21')](handleError(_0x339e39));};exports[_0x4e64('0x47')]=function(_0x5d3789,_0x1914bf){logger[_0x4e64('0x14')]('conference\x20fired:',_0x5d3789[_0x4e64('0x2e')]);var _0xafc845=conferenceValidation[_0x4e64('0xd')](_0x5d3789[_0x4e64('0x2e')]);if(_0xafc845[_0x4e64('0x2a')]>0x0){return _0x1914bf[_0x4e64('0x1c')](0x190)[_0x4e64('0x2f')](_0xafc845);}var _0x40873c=_0x5d3789['body'][_0x4e64('0x36')];return getAgent(_0x40873c)[_0x4e64('0x1d')](function(_0x489a34){logger[_0x4e64('0x14')](_0x4e64('0x3d'),_0x489a34[_0x4e64('0x1a')]);emit(util[_0x4e64('0x38')](_0x4e64('0x39'),_0x489a34['name']),_0x4e64('0x48'));return _0x1914bf[_0x4e64('0x1c')](0xc8)['json']({'error':![],'message':_0x4e64('0x49')});})[_0x4e64('0x21')](handleError(_0x1914bf));};exports[_0x4e64('0x4a')]=function(_0x44c368,_0xf9c4e0){logger[_0x4e64('0x14')]('transfer\x20fired:',_0x44c368[_0x4e64('0x2e')]);var _0x291fe8=transferValidation[_0x4e64('0xd')](_0x44c368['body']);if(_0x291fe8[_0x4e64('0x2a')]>0x0){return _0xf9c4e0[_0x4e64('0x1c')](0x190)[_0x4e64('0x2f')](_0x291fe8);}var _0x5ed23f=_0x44c368[_0x4e64('0x2e')][_0x4e64('0x36')];var _0x5761c9=_0x44c368['body']['sessionId'];var _0x3f2a81=_0x44c368[_0x4e64('0x2e')][_0x4e64('0x4b')];return getAgent(_0x5ed23f)[_0x4e64('0x1d')](function(_0x27db3f){logger[_0x4e64('0x14')](_0x4e64('0x3d'),_0x27db3f[_0x4e64('0x1a')]);emit(util[_0x4e64('0x38')](_0x4e64('0x39'),_0x27db3f[_0x4e64('0x1a')]),_0x4e64('0x4c'),{'sessionId':_0x5761c9,'transferNumber':_0x3f2a81});return _0xf9c4e0[_0x4e64('0x1c')](0xc8)[_0x4e64('0x2f')]({'error':![],'message':'transfer\x20executed!'});})['catch'](handleError(_0xf9c4e0));};
\ No newline at end of file
+var _0xb0b9=['User','agent','VoiceChannels','all','rows','sessionId','length','sessionId\x20','\x20not\x20found!','originate','body','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','json','originate\x20executed!','hangup','hangup\x20fired:','validate','webbar:hangup','hangup\x20executed!','answer','webbar:answer','answer\x20executed!','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','webbar:unhold','calls','calls\x20fired:','filter','webbar:conference','conference\x20executed!','transfer','transferNumber','webbar:transfer','transfer\x20executed!','path','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','defaults','localhost','socket.io-emitter','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','emit','log','handleError:','error','name','status','NotFound','then','code','message','catch'];(function(_0x25def3,_0x69218c){var _0x3a6b85=function(_0x21e7e4){while(--_0x21e7e4){_0x25def3['push'](_0x25def3['shift']());}};_0x3a6b85(++_0x69218c);}(_0xb0b9,0x1f3));var _0x9b0b=function(_0x247990,_0x3c4c47){_0x247990=_0x247990-0x0;var _0x9c509e=_0xb0b9[_0x247990];return _0x9c509e;};'use strict';var path=require(_0x9b0b('0x0'));var fs=require('fs');var _=require('lodash');var db=require('../../mysqldb')['db'];var config=require(_0x9b0b('0x1'));var util=require(_0x9b0b('0x2'));var BPromise=require(_0x9b0b('0x3'));var jayson=require(_0x9b0b('0x4'));var amiClient=jayson[_0x9b0b('0x5')][_0x9b0b('0x6')]({'port':0x232a});var logger=require(_0x9b0b('0x7'))(_0x9b0b('0x8'));var Redis=require(_0x9b0b('0x9'));config[_0x9b0b('0xa')]=_[_0x9b0b('0xb')](config[_0x9b0b('0xa')],{'host':_0x9b0b('0xc'),'port':0x18eb});var io=require(_0x9b0b('0xd'))(new Redis(config['redis']));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':_0x9b0b('0xe'),'required':[!![],_0x9b0b('0xf')]},'callNumber':{'type':_0x9b0b('0x10'),'required':[!![],_0x9b0b('0x11')]},'callerId':{'type':_0x9b0b('0x10')},'callbackUrl':{'type':_0x9b0b('0x10')}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],_0x9b0b('0xf')]},'sessionId':{'type':_0x9b0b('0x10'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x9b0b('0xe'),'required':[!![],_0x9b0b('0xf')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':'number','required':[!![],_0x9b0b('0xf')]},'sessionId':{'type':'string','required':[!![],_0x9b0b('0x12')]},'transferNumber':{'type':'string','required':[!![],_0x9b0b('0x13')]}});var holdValidation=new Schema({'userId':{'type':_0x9b0b('0xe'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x9b0b('0xe'),'required':[!![],_0x9b0b('0xf')]},'sessionId':{'type':_0x9b0b('0x10'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x9b0b('0xf')]}});var conferenceValidation=new Schema({'userId':{'type':_0x9b0b('0xe'),'required':[!![],_0x9b0b('0xf')]}});function emit(_0x1e92c1,_0x4665d8,_0x12f1b9){logger[_0x9b0b('0x14')](_0x1e92c1,_0x4665d8,JSON[_0x9b0b('0x15')](_0x12f1b9));io['to'](_0x1e92c1)[_0x9b0b('0x16')](_0x4665d8,_0x12f1b9);}function handleError(_0xcab079){return function(_0x264b6d){console[_0x9b0b('0x17')](_0x9b0b('0x18'),_0x264b6d,_0x264b6d instanceof RangeError);logger[_0x9b0b('0x19')](_0x264b6d['stack']);if(_0x264b6d instanceof RangeError){if(_0x264b6d[_0x9b0b('0x1a')]){delete _0x264b6d[_0x9b0b('0x1a')];}_0xcab079[_0x9b0b('0x1b')](0x194)['send'](_0x264b6d);}else{if(_0x264b6d[_0x9b0b('0x1a')]){delete _0x264b6d[_0x9b0b('0x1a')];}_0xcab079[_0x9b0b('0x1b')](0x1f4)['send'](_0x264b6d);}};}function checkError(){return function(_0x3f19ae){if(!_0x3f19ae){throw new RangeError(_0x9b0b('0x1c'));}return _0x3f19ae;};}function respondWithRpcPromise(_0x27b8e3,_0x16c8f9){return new BPromise(function(_0x4fe0a2,_0x30bfe8){var _0x408f70=amiClient;return _0x408f70['request'](_0x27b8e3,_0x16c8f9)[_0x9b0b('0x1d')](function(_0x1e7789){if(_0x1e7789[_0x9b0b('0x19')]){if(_0x1e7789[_0x9b0b('0x19')][_0x9b0b('0x1e')]===0x1f4){return _0x30bfe8(_0x1e7789[_0x9b0b('0x19')][_0x9b0b('0x1f')]);}return _0x4fe0a2(_0x1e7789[_0x9b0b('0x19')][_0x9b0b('0x1f')]);}else{_0x4fe0a2(_0x1e7789['result']);}})[_0x9b0b('0x20')](function(_0x22a136){_0x30bfe8(_0x22a136);});});}function getAgent(_0x246652){return db[_0x9b0b('0x21')]['findOne']({'where':{'id':_0x246652,'role':_0x9b0b('0x22')}})[_0x9b0b('0x1d')](checkError());}function getAgentCheckSession(_0x5c9ec3,_0x2841fc){return new BPromise(function(_0x1e25fb,_0x1a31ba){var _0x47a135=respondWithRpcPromise(_0x9b0b('0x23'));var _0xa4f392=getAgent(_0x5c9ec3);Promise[_0x9b0b('0x24')]([_0x47a135,_0xa4f392])['then'](function(_0x2575d8){var _0x32668d=_0x2575d8[0x0];var _0x21b533=_0x2575d8[0x1];var _0x22ce12=_['filter'](_0x32668d[_0x9b0b('0x25')],function(_0xfa71df){return _0xfa71df['UserId']==_0x21b533['id']&&_0xfa71df[_0x9b0b('0x26')]==_0x2841fc;});if(_0x22ce12[_0x9b0b('0x27')]==0x1){_0x1e25fb(_0x21b533);}else{_0x1a31ba(new RangeError(_0x9b0b('0x28')+_0x2841fc+_0x9b0b('0x29')));}});});}exports[_0x9b0b('0x2a')]=function(_0x26e90c,_0xfd6ce){logger[_0x9b0b('0x14')]('originate\x20fired:',_0x26e90c['body']);var _0x3fcf01=originateValidation['validate'](_0x26e90c[_0x9b0b('0x2b')]);if(_0x3fcf01['length']>0x0){return _0xfd6ce['status'](0x190)['json'](_0x3fcf01);}var _0x40e4c3=_0x26e90c[_0x9b0b('0x2b')][_0x9b0b('0x2c')];var _0x212b85=_0x26e90c[_0x9b0b('0x2b')][_0x9b0b('0x2d')];var _0x2938ff=_0x26e90c[_0x9b0b('0x2b')][_0x9b0b('0x2e')];var _0x444d20=_0x26e90c[_0x9b0b('0x2b')][_0x9b0b('0x2f')];return getAgent(_0x40e4c3)[_0x9b0b('0x1d')](function(_0x5dc1a6){logger[_0x9b0b('0x14')](_0x9b0b('0x30'),_0x5dc1a6[_0x9b0b('0x1a')]);emit(util[_0x9b0b('0x31')](_0x9b0b('0x32'),_0x5dc1a6[_0x9b0b('0x1a')]),_0x9b0b('0x33'),{'callNumber':_0x212b85,'callerId':_0x2938ff,'callbackUrl':_0x444d20});return _0xfd6ce[_0x9b0b('0x1b')](0xc8)[_0x9b0b('0x34')]({'error':![],'message':_0x9b0b('0x35')});})[_0x9b0b('0x20')](handleError(_0xfd6ce));};exports[_0x9b0b('0x36')]=function(_0x97d73a,_0x561942){logger['info'](_0x9b0b('0x37'),_0x97d73a[_0x9b0b('0x2b')]);var _0xe60dec=hangupValidation[_0x9b0b('0x38')](_0x97d73a[_0x9b0b('0x2b')]);if(_0xe60dec['length']>0x0){return _0x561942[_0x9b0b('0x1b')](0x190)[_0x9b0b('0x34')](_0xe60dec);}var _0x24cee7=_0x97d73a[_0x9b0b('0x2b')]['userId'];var _0x5ac75f=_0x97d73a[_0x9b0b('0x2b')]['sessionId'];return getAgent(_0x24cee7)[_0x9b0b('0x1d')](function(_0x316d86){logger[_0x9b0b('0x14')](_0x9b0b('0x30'),_0x316d86[_0x9b0b('0x1a')]);emit(util[_0x9b0b('0x31')](_0x9b0b('0x32'),_0x316d86[_0x9b0b('0x1a')]),_0x9b0b('0x39'),{'sessionId':_0x5ac75f});return _0x561942[_0x9b0b('0x1b')](0xc8)[_0x9b0b('0x34')]({'error':![],'message':_0x9b0b('0x3a')});})[_0x9b0b('0x20')](handleError(_0x561942));};exports[_0x9b0b('0x3b')]=function(_0xef0a28,_0x58d181){logger['info']('answer\x20fired:',_0xef0a28[_0x9b0b('0x2b')]);var _0x42d7e3=answerValidation[_0x9b0b('0x38')](_0xef0a28[_0x9b0b('0x2b')]);if(_0x42d7e3[_0x9b0b('0x27')]>0x0){return _0x58d181['status'](0x190)['json'](_0x42d7e3);}var _0x20ec55=_0xef0a28[_0x9b0b('0x2b')][_0x9b0b('0x2c')];var _0x136a33=_0xef0a28['body'][_0x9b0b('0x26')];return getAgent(_0x20ec55)[_0x9b0b('0x1d')](function(_0x177cde){logger[_0x9b0b('0x14')](_0x9b0b('0x30'),_0x177cde['name']);emit(util[_0x9b0b('0x31')](_0x9b0b('0x32'),_0x177cde[_0x9b0b('0x1a')]),_0x9b0b('0x3c'),{'sessionId':_0x136a33});return _0x58d181[_0x9b0b('0x1b')](0xc8)[_0x9b0b('0x34')]({'error':![],'message':_0x9b0b('0x3d')});})[_0x9b0b('0x20')](handleError(_0x58d181));};exports['hold']=function(_0x512ecc,_0x5bfa12){logger[_0x9b0b('0x14')](_0x9b0b('0x3e'),_0x512ecc[_0x9b0b('0x2b')]);var _0x25ed06=holdValidation[_0x9b0b('0x38')](_0x512ecc[_0x9b0b('0x2b')]);if(_0x25ed06[_0x9b0b('0x27')]>0x0){return _0x5bfa12[_0x9b0b('0x1b')](0x190)[_0x9b0b('0x34')](_0x25ed06);}var _0x1f2108=_0x512ecc[_0x9b0b('0x2b')]['userId'];var _0x3b15b3=_0x512ecc[_0x9b0b('0x2b')]['sessionId'];return getAgent(_0x1f2108)['then'](function(_0xd9410f){logger[_0x9b0b('0x14')](_0x9b0b('0x30'),_0xd9410f[_0x9b0b('0x1a')]);emit(util['format'](_0x9b0b('0x32'),_0xd9410f[_0x9b0b('0x1a')]),_0x9b0b('0x3f'),{'sessionId':_0x3b15b3});return _0x5bfa12[_0x9b0b('0x1b')](0xc8)[_0x9b0b('0x34')]({'error':![],'message':_0x9b0b('0x40')});})[_0x9b0b('0x20')](handleError(_0x5bfa12));};exports[_0x9b0b('0x41')]=function(_0x146654,_0x5d71d7){logger[_0x9b0b('0x14')]('unhold\x20fired:',_0x146654[_0x9b0b('0x2b')]);var _0x5eb636=unholdValidation['validate'](_0x146654[_0x9b0b('0x2b')]);if(_0x5eb636[_0x9b0b('0x27')]>0x0){return _0x5d71d7[_0x9b0b('0x1b')](0x190)[_0x9b0b('0x34')](_0x5eb636);}var _0x105503=_0x146654[_0x9b0b('0x2b')][_0x9b0b('0x2c')];var _0x495b3e=_0x146654['body']['sessionId'];return getAgent(_0x105503)[_0x9b0b('0x1d')](function(_0x250b06){logger[_0x9b0b('0x14')](_0x9b0b('0x30'),_0x250b06[_0x9b0b('0x1a')]);emit(util[_0x9b0b('0x31')]('user:%s',_0x250b06[_0x9b0b('0x1a')]),_0x9b0b('0x42'),{'sessionId':_0x495b3e});return _0x5d71d7['status'](0xc8)['json']({'error':![],'message':'unhold\x20executed!'});})[_0x9b0b('0x20')](handleError(_0x5d71d7));};exports[_0x9b0b('0x43')]=function(_0x5156c1,_0x51ea1d){logger['info'](_0x9b0b('0x44'),_0x51ea1d[_0x9b0b('0x2b')]);var _0x23225c=callsValidation[_0x9b0b('0x38')](_0x5156c1[_0x9b0b('0x2b')]);if(_0x23225c[_0x9b0b('0x27')]>0x0){return _0x51ea1d[_0x9b0b('0x1b')](0x190)[_0x9b0b('0x34')](_0x23225c);}var _0x283f31=_0x5156c1[_0x9b0b('0x2b')][_0x9b0b('0x2c')];var _0x4a2fbd=respondWithRpcPromise(_0x9b0b('0x23'));var _0x21f650=getAgent(_0x283f31);return Promise['all']([_0x4a2fbd,_0x21f650])[_0x9b0b('0x1d')](function(_0x30a39d){var _0x49ca3a=_0x30a39d[0x0];var _0x2a92b9=_0x30a39d[0x1];var _0x16f879=_[_0x9b0b('0x45')](_0x49ca3a[_0x9b0b('0x25')],function(_0x45b272){return _0x45b272['UserId']==_0x2a92b9['id'];});return _0x51ea1d[_0x9b0b('0x1b')](0xc8)[_0x9b0b('0x34')]({'count':_0x16f879[_0x9b0b('0x27')],'rows':_0x16f879});})[_0x9b0b('0x20')](handleError(_0x51ea1d));};exports['conference']=function(_0x4928b1,_0x25553d){logger[_0x9b0b('0x14')]('conference\x20fired:',_0x4928b1['body']);var _0x3a599d=conferenceValidation[_0x9b0b('0x38')](_0x4928b1[_0x9b0b('0x2b')]);if(_0x3a599d[_0x9b0b('0x27')]>0x0){return _0x25553d[_0x9b0b('0x1b')](0x190)[_0x9b0b('0x34')](_0x3a599d);}var _0xc935e1=_0x4928b1[_0x9b0b('0x2b')]['userId'];return getAgent(_0xc935e1)[_0x9b0b('0x1d')](function(_0x38ff6d){logger[_0x9b0b('0x14')](_0x9b0b('0x30'),_0x38ff6d['name']);emit(util[_0x9b0b('0x31')]('user:%s',_0x38ff6d[_0x9b0b('0x1a')]),_0x9b0b('0x46'));return _0x25553d[_0x9b0b('0x1b')](0xc8)[_0x9b0b('0x34')]({'error':![],'message':_0x9b0b('0x47')});})['catch'](handleError(_0x25553d));};exports[_0x9b0b('0x48')]=function(_0x3804e6,_0x4337c3){logger[_0x9b0b('0x14')]('transfer\x20fired:',_0x3804e6[_0x9b0b('0x2b')]);var _0x259340=transferValidation[_0x9b0b('0x38')](_0x3804e6[_0x9b0b('0x2b')]);if(_0x259340[_0x9b0b('0x27')]>0x0){return _0x4337c3['status'](0x190)[_0x9b0b('0x34')](_0x259340);}var _0x667604=_0x3804e6['body'][_0x9b0b('0x2c')];var _0x246056=_0x3804e6[_0x9b0b('0x2b')][_0x9b0b('0x26')];var _0x3b69a4=_0x3804e6[_0x9b0b('0x2b')][_0x9b0b('0x49')];return getAgent(_0x667604)[_0x9b0b('0x1d')](function(_0x1c0192){logger[_0x9b0b('0x14')](_0x9b0b('0x30'),_0x1c0192[_0x9b0b('0x1a')]);emit(util[_0x9b0b('0x31')]('user:%s',_0x1c0192[_0x9b0b('0x1a')]),_0x9b0b('0x4a'),{'sessionId':_0x246056,'transferNumber':_0x3b69a4});return _0x4337c3['status'](0xc8)['json']({'error':![],'message':_0x9b0b('0x4b')});})['catch'](handleError(_0x4337c3));};
\ No newline at end of file
index 5e49ca2..6cc1714 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x33af=['getAnswers','/:id/users','/:id/applications','post','create','addDisposition','addAgents','addApplications','/:id/notify','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions'];(function(_0x25534c,_0x521a4a){var _0x1b86b7=function(_0x369bc0){while(--_0x369bc0){_0x25534c['push'](_0x25534c['shift']());}};_0x1b86b7(++_0x521a4a);}(_0x33af,0xec));var _0xf33a=function(_0x91ed5c,_0xdb6b34){_0x91ed5c=_0x91ed5c-0x0;var _0x2387d8=_0x33af[_0x91ed5c];return _0x2387d8;};'use strict';var multer=require('multer');var util=require(_0xf33a('0x0'));var path=require('path');var timeout=require(_0xf33a('0x1'));var express=require(_0xf33a('0x2'));var router=express[_0xf33a('0x3')]();var fs_extra=require(_0xf33a('0x4'));var auth=require(_0xf33a('0x5'));var interaction=require(_0xf33a('0x6'));var config=require('../../config/environment');var controller=require(_0xf33a('0x7'));router[_0xf33a('0x8')]('/',auth['isAuthenticated'](),controller[_0xf33a('0x9')]);router[_0xf33a('0x8')](_0xf33a('0xa'),auth[_0xf33a('0xb')](),controller[_0xf33a('0xc')]);router[_0xf33a('0x8')]('/:id',auth[_0xf33a('0xb')](),controller[_0xf33a('0xd')]);router[_0xf33a('0x8')](_0xf33a('0xe'),auth[_0xf33a('0xb')](),controller[_0xf33a('0xf')]);router['get']('/:id/canned_answers',auth[_0xf33a('0xb')](),controller[_0xf33a('0x10')]);router[_0xf33a('0x8')](_0xf33a('0x11'),auth[_0xf33a('0xb')](),controller['getAgents']);router[_0xf33a('0x8')](_0xf33a('0x12'),auth['isAuthenticated'](),controller['getApplications']);router[_0xf33a('0x13')]('/',auth[_0xf33a('0xb')](),controller[_0xf33a('0x14')]);router[_0xf33a('0x13')](_0xf33a('0xe'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x15')]);router[_0xf33a('0x13')]('/:id/canned_answers',auth[_0xf33a('0xb')](),controller['addAnswer']);router[_0xf33a('0x13')](_0xf33a('0x11'),auth['isAuthenticated'](),controller[_0xf33a('0x16')]);router[_0xf33a('0x13')]('/:id/applications',auth[_0xf33a('0xb')](),controller[_0xf33a('0x17')]);router[_0xf33a('0x13')](_0xf33a('0x18'),controller['notify']);router[_0xf33a('0x13')](_0xf33a('0x19'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x1a')]);router[_0xf33a('0x1b')](_0xf33a('0x1c'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x1d')]);router[_0xf33a('0x1e')](_0xf33a('0x1c'),auth['isAuthenticated'](),controller[_0xf33a('0x1f')]);router[_0xf33a('0x1e')](_0xf33a('0xe'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x20')]);router['delete'](_0xf33a('0x21'),auth['isAuthenticated'](),controller[_0xf33a('0x22')]);router[_0xf33a('0x1e')](_0xf33a('0x11'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x23')]);module['exports']=router;
\ No newline at end of file
+var _0x430c=['Router','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','getAgents','/:id/applications','getApplications','post','addDisposition','/:id/users','addAgents','send','put','delete','destroy','removeDispositions','/:id/canned_answers','removeAgents','multer','connect-timeout','express'];(function(_0x426de2,_0x24acaf){var _0x1dbafc=function(_0x57e5d4){while(--_0x57e5d4){_0x426de2['push'](_0x426de2['shift']());}};_0x1dbafc(++_0x24acaf);}(_0x430c,0x1a1));var _0xc430=function(_0x591e16,_0x5aefc1){_0x591e16=_0x591e16-0x0;var _0x543b35=_0x430c[_0x591e16];return _0x543b35;};'use strict';var multer=require(_0xc430('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc430('0x1'));var express=require(_0xc430('0x2'));var router=express[_0xc430('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc430('0x4'));router[_0xc430('0x5')]('/',auth['isAuthenticated'](),controller[_0xc430('0x6')]);router['get'](_0xc430('0x7'),auth[_0xc430('0x8')](),controller[_0xc430('0x9')]);router[_0xc430('0x5')](_0xc430('0xa'),auth[_0xc430('0x8')](),controller[_0xc430('0xb')]);router[_0xc430('0x5')](_0xc430('0xc'),auth['isAuthenticated'](),controller[_0xc430('0xd')]);router[_0xc430('0x5')]('/:id/canned_answers',auth[_0xc430('0x8')](),controller['getAnswers']);router[_0xc430('0x5')]('/:id/users',auth[_0xc430('0x8')](),controller[_0xc430('0xe')]);router[_0xc430('0x5')](_0xc430('0xf'),auth[_0xc430('0x8')](),controller[_0xc430('0x10')]);router[_0xc430('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc430('0x11')](_0xc430('0xc'),auth[_0xc430('0x8')](),controller[_0xc430('0x12')]);router[_0xc430('0x11')]('/:id/canned_answers',auth[_0xc430('0x8')](),controller['addAnswer']);router['post'](_0xc430('0x13'),auth[_0xc430('0x8')](),controller[_0xc430('0x14')]);router['post']('/:id/applications',auth[_0xc430('0x8')](),controller['addApplications']);router[_0xc430('0x11')]('/:id/notify',controller['notify']);router[_0xc430('0x11')]('/:id/send',auth[_0xc430('0x8')](),controller[_0xc430('0x15')]);router[_0xc430('0x16')](_0xc430('0xa'),auth[_0xc430('0x8')](),controller['update']);router[_0xc430('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xc430('0x18')]);router[_0xc430('0x17')](_0xc430('0xc'),auth['isAuthenticated'](),controller[_0xc430('0x19')]);router['delete'](_0xc430('0x1a'),auth[_0xc430('0x8')](),controller['removeAnswers']);router[_0xc430('0x17')](_0xc430('0x13'),auth['isAuthenticated'](),controller[_0xc430('0x1b')]);module['exports']=router;
\ No newline at end of file
index e328164..2964c8e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe81e=['STRING','name','generate','ENUM','twilio','TEXT','Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports'];(function(_0x49c29b,_0x5ab340){var _0x3a523c=function(_0x3b88be){while(--_0x3b88be){_0x49c29b['push'](_0x49c29b['shift']());}};_0x3a523c(++_0x5ab340);}(_0xe81e,0x13d));var _0xee81=function(_0x4b4306,_0x4d5b13){_0x4b4306=_0x4b4306-0x0;var _0x246677=_0xe81e[_0x4b4306];return _0x246677;};'use strict';var Sequelize=require(_0xee81('0x0'));var rs=require(_0xee81('0x1'));module[_0xee81('0x2')]={'name':{'type':Sequelize[_0xee81('0x3')],'unique':_0xee81('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xee81('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xee81('0x5')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xee81('0x6')](_0xee81('0x7'))},'accountSid':{'type':Sequelize[_0xee81('0x3')]},'authToken':{'type':Sequelize[_0xee81('0x3')]},'notificationTemplate':{'type':Sequelize[_0xee81('0x8')],'defaultValue':function(){return _0xee81('0x9');}},'notificationSound':{'type':Sequelize[_0xee81('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xee81('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xee81('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xee81('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xee81('0xb')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xee81('0xa')],'defaultValue':![],'comment':_0xee81('0xc'),'set':function(_0x22b0e0){if(!_0x22b0e0){this[_0xee81('0xd')](_0xee81('0xe'),null);}this[_0xee81('0xd')](_0xee81('0xf'),_0x22b0e0);}},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xdd76=['setDataValue','sequelize','exports','STRING','name','generate','ENUM','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId'];(function(_0x1fc86a,_0x54613a){var _0x357919=function(_0x48e964){while(--_0x48e964){_0x1fc86a['push'](_0x1fc86a['shift']());}};_0x357919(++_0x54613a);}(_0xdd76,0x1a1));var _0x6dd7=function(_0x564d92,_0x24f888){_0x564d92=_0x564d92-0x0;var _0x6c43be=_0xdd76[_0x564d92];return _0x6c43be;};'use strict';var Sequelize=require(_0x6dd7('0x0'));var rs=require('randomstring');module[_0x6dd7('0x1')]={'name':{'type':Sequelize[_0x6dd7('0x2')],'unique':_0x6dd7('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x6dd7('0x2')],'defaultValue':function(){return rs[_0x6dd7('0x4')]();}},'phone':{'type':Sequelize[_0x6dd7('0x2')]},'type':{'type':Sequelize[_0x6dd7('0x5')]('twilio')},'accountSid':{'type':Sequelize[_0x6dd7('0x2')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x6dd7('0x6')],'defaultValue':function(){return'Account:\x20{{account.name}}<br/>{{#queue}}Queue:\x20{{queue.name}}<br/>{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x6dd7('0x7')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x6dd7('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x6dd7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x6dd7('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6dd7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6dd7('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6dd7('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6dd7('0x8')],'comment':_0x6dd7('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x6dd7('0xa'),'set':function(_0x481aca){if(!_0x481aca){this['setDataValue'](_0x6dd7('0xb'),null);}this[_0x6dd7('0xc')]('mandatoryDisposition',_0x481aca);}},'description':{'type':Sequelize[_0x6dd7('0x2')]}};
\ No newline at end of file
index 4df03c9..1b8a705 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda62=['orderBy','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','twilio','From','replace','whatsapp:','Body','messageId','MessageSid','from','from\x20is\x20mandatory','isNil','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','DESC','list','omit','Contacts','contact','WhatsappInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','waitForTheAssignedAgent','Start','startRouting','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','to\x20is\x20mandatory','List','out','WhatsappMessage','dataValues','Messages','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','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','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','update','get','WhatsappAccounts','stack','name','send','index','mandatoryDispositionPause','map','rawAttributes','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','type','VIRTUAL','merge','options','count','include','findAll','catch','show','params','Pause','keys','WhatsappAccount','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','rows','removeDispositions','addAnswer','CannedAnswer','removeAnswers','addAgents','ids','spread','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','Applications','account','applications'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xda62,0x1a6));var _0x2da6=function(_0x428614,_0x353993){_0x428614=_0x428614-0x0;var _0x5b8755=_0xda62[_0x428614];return _0x5b8755;};'use strict';var emlformat=require(_0x2da6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x2da6('0x1'));var rp=require(_0x2da6('0x2'));var moment=require(_0x2da6('0x3'));var BPromise=require(_0x2da6('0x4'));var Mustache=require(_0x2da6('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x2da6('0x6'));var ejs=require(_0x2da6('0x7'));var fs=require('fs');var fs_extra=require(_0x2da6('0x8'));var _=require(_0x2da6('0x9'));var squel=require(_0x2da6('0xa'));var crypto=require(_0x2da6('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x2da6('0xc'));var toCsv=require(_0x2da6('0x6'));var querystring=require(_0x2da6('0xd'));var Papa=require('papaparse');var Redis=require(_0x2da6('0xe'));var authService=require(_0x2da6('0xf'));var qs=require(_0x2da6('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2da6('0x11'));var logger=require(_0x2da6('0x12'))(_0x2da6('0x13'));var utils=require(_0x2da6('0x14'));var config=require(_0x2da6('0x15'));var licenseUtil=require(_0x2da6('0x16'));var db=require('../../mysqldb')['db'];config[_0x2da6('0x17')]=_[_0x2da6('0x18')](config[_0x2da6('0x17')],{'host':_0x2da6('0x19'),'port':0x18eb});var socket=require(_0x2da6('0x1a'))(new Redis(config[_0x2da6('0x17')]));require(_0x2da6('0x1b'))[_0x2da6('0x1c')](socket);var jayson=require(_0x2da6('0x1d'));var client=jayson[_0x2da6('0x1e')]['http']({'port':0x232c});function respondWithRpcPromise(_0xba015a,_0x4abb41,_0x58f6ca,_0x4c92b6){return new BPromise(function(_0x5c52c4,_0xbe2006){var _0x519f29=_0x4c92b6||client;return _0x519f29[_0x2da6('0x1f')](_0xba015a,_0x58f6ca)[_0x2da6('0x20')](function(_0x307735){logger[_0x2da6('0x21')](_0x2da6('0x22'),_0x4abb41,_0x2da6('0x23'));logger[_0x2da6('0x24')](_0x2da6('0x25'),_0x4abb41,_0x2da6('0x23'),JSON[_0x2da6('0x26')](_0x307735));if(_0x307735[_0x2da6('0x27')]){if(_0x307735[_0x2da6('0x27')]['code']===0x1f4){logger[_0x2da6('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x4abb41,_0x307735['error']['message']);return _0xbe2006(_0x307735['error'][_0x2da6('0x28')]);}logger[_0x2da6('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x4abb41,_0x307735[_0x2da6('0x27')][_0x2da6('0x28')]);return _0x5c52c4(_0x307735[_0x2da6('0x27')][_0x2da6('0x28')]);}else{logger[_0x2da6('0x21')](_0x2da6('0x22'),_0x4abb41,'request\x20sent');_0x5c52c4(_0x307735['result'][_0x2da6('0x28')]);}})['catch'](function(_0x2a2957){logger[_0x2da6('0x27')](_0x2da6('0x22'),_0x4abb41,_0x2a2957);_0xbe2006(_0x2a2957);});});}function respondWithStatusCode(_0x4b7c97,_0x10e86d){_0x10e86d=_0x10e86d||0xcc;return function(_0x1b346a){if(_0x1b346a){return _0x4b7c97[_0x2da6('0x29')](_0x10e86d);}return _0x4b7c97[_0x2da6('0x2a')](_0x10e86d)[_0x2da6('0x2b')]();};}function respondWithResult(_0x5d93a2,_0x1a3806){_0x1a3806=_0x1a3806||0xc8;return function(_0x473c8c){if(_0x473c8c){return _0x5d93a2[_0x2da6('0x2a')](_0x1a3806)[_0x2da6('0x2c')](_0x473c8c);}};}function respondWithFilteredResult(_0x4792e9,_0x5f5ad7){return function(_0x889246){if(_0x889246){var _0x2b09c7=typeof _0x5f5ad7[_0x2da6('0x2d')]===_0x2da6('0x2e')&&typeof _0x5f5ad7[_0x2da6('0x2f')]===_0x2da6('0x2e');var _0x1c2a13=_0x889246['count'];var _0x15a20b=_0x2b09c7?0x0:_0x5f5ad7[_0x2da6('0x2d')];var _0x475702=_0x2b09c7?_0x889246['count']:_0x5f5ad7[_0x2da6('0x2d')]+_0x5f5ad7[_0x2da6('0x2f')];var _0x520689;if(_0x475702>=_0x1c2a13){_0x475702=_0x1c2a13;_0x520689=0xc8;}else{_0x520689=0xce;}_0x4792e9[_0x2da6('0x2a')](_0x520689);return _0x4792e9[_0x2da6('0x30')](_0x2da6('0x31'),_0x15a20b+'-'+_0x475702+'/'+_0x1c2a13)[_0x2da6('0x2c')](_0x889246);}return null;};}function patchUpdates(_0x25cd9f){return function(_0x22831f){try{jsonpatch['apply'](_0x22831f,_0x25cd9f,!![]);}catch(_0x19c20e){return BPromise[_0x2da6('0x32')](_0x19c20e);}return _0x22831f[_0x2da6('0x33')]();};}function saveUpdates(_0x6892f6,_0x1e4fd4){return function(_0x3b880b){if(_0x3b880b){return _0x3b880b[_0x2da6('0x34')](_0x6892f6)[_0x2da6('0x20')](function(_0x4733fb){return _0x4733fb;});}return null;};}function removeEntity(_0x34fde8,_0x3f2f52){return function(_0xcbbac){if(_0xcbbac){return _0xcbbac['destroy']()[_0x2da6('0x20')](function(){var _0x3995c8=_0xcbbac[_0x2da6('0x35')]({'plain':!![]});var _0x42322e=_0x2da6('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0x42322e,'resourceId':_0x3995c8['id']}})[_0x2da6('0x20')](function(){return _0xcbbac;});})[_0x2da6('0x20')](function(){_0x34fde8[_0x2da6('0x2a')](0xcc)[_0x2da6('0x2b')]();});}};}function handleEntityNotFound(_0x21348d,_0x95778f){return function(_0x43397b){if(!_0x43397b){_0x21348d['sendStatus'](0x194);}return _0x43397b;};}function handleError(_0x49c67b,_0x555c26){_0x555c26=_0x555c26||0x1f4;return function(_0x524ab3){logger['error'](_0x524ab3[_0x2da6('0x37')]);if(_0x524ab3[_0x2da6('0x38')]){delete _0x524ab3[_0x2da6('0x38')];}_0x49c67b[_0x2da6('0x2a')](_0x555c26)[_0x2da6('0x39')](_0x524ab3);};}exports[_0x2da6('0x3a')]=function(_0x7ef0c6,_0x2ff0ac){var _0x213cb6={'include':[{'model':db['Pause'],'as':_0x2da6('0x3b')}]},_0x322489={},_0x128aed={'count':0x0,'rows':[]};var _0x184bc2=_[_0x2da6('0x3c')](db['WhatsappAccount'][_0x2da6('0x3d')],function(_0x773eee){return{'name':_0x773eee['fieldName'],'type':_0x773eee['type'][_0x2da6('0x3e')]};});_0x322489['model']=_[_0x2da6('0x3c')](_0x184bc2,_0x2da6('0x38'));_0x322489[_0x2da6('0x3f')]=_['keys'](_0x7ef0c6['query']);_0x322489['filters']=_[_0x2da6('0x40')](_0x322489[_0x2da6('0x41')],_0x322489[_0x2da6('0x3f')]);_0x213cb6[_0x2da6('0x42')]=_[_0x2da6('0x40')](_0x322489['model'],qs[_0x2da6('0x43')](_0x7ef0c6[_0x2da6('0x3f')][_0x2da6('0x43')]));_0x213cb6['attributes']=_0x213cb6[_0x2da6('0x42')][_0x2da6('0x44')]?_0x213cb6[_0x2da6('0x42')]:_0x322489[_0x2da6('0x41')];if(!_0x7ef0c6[_0x2da6('0x3f')][_0x2da6('0x45')](_0x2da6('0x46'))){_0x213cb6[_0x2da6('0x2f')]=qs[_0x2da6('0x2f')](_0x7ef0c6[_0x2da6('0x3f')][_0x2da6('0x2f')]);_0x213cb6[_0x2da6('0x2d')]=qs[_0x2da6('0x2d')](_0x7ef0c6[_0x2da6('0x3f')]['offset']);}_0x213cb6[_0x2da6('0x47')]=qs[_0x2da6('0x48')](_0x7ef0c6[_0x2da6('0x3f')][_0x2da6('0x48')]);_0x213cb6['where']=qs[_0x2da6('0x49')](_[_0x2da6('0x4a')](_0x7ef0c6[_0x2da6('0x3f')],_0x322489[_0x2da6('0x49')]),_0x184bc2);if(_0x7ef0c6[_0x2da6('0x3f')][_0x2da6('0x4b')]){_0x213cb6[_0x2da6('0x4c')]=_['merge'](_0x213cb6[_0x2da6('0x4c')],{'$or':_['map'](_0x184bc2,function(_0x28392c){if(_0x28392c[_0x2da6('0x4d')]!==_0x2da6('0x4e')){var _0x578209={};_0x578209[_0x28392c[_0x2da6('0x38')]]={'$like':'%'+_0x7ef0c6[_0x2da6('0x3f')][_0x2da6('0x4b')]+'%'};return _0x578209;}})});}_0x213cb6=_[_0x2da6('0x4f')]({},_0x213cb6,_0x7ef0c6[_0x2da6('0x50')]);var _0x3e8577={'where':_0x213cb6[_0x2da6('0x4c')]};return db['WhatsappAccount'][_0x2da6('0x51')](_0x3e8577)[_0x2da6('0x20')](function(_0x23176e){_0x128aed[_0x2da6('0x51')]=_0x23176e;if(_0x7ef0c6[_0x2da6('0x3f')]['includeAll']){_0x213cb6[_0x2da6('0x52')]=[{'all':!![]}];}return db['WhatsappAccount'][_0x2da6('0x53')](_0x213cb6);})[_0x2da6('0x20')](function(_0x3ff468){_0x128aed['rows']=_0x3ff468;return _0x128aed;})[_0x2da6('0x20')](respondWithFilteredResult(_0x2ff0ac,_0x213cb6))[_0x2da6('0x54')](handleError(_0x2ff0ac,null));};exports[_0x2da6('0x55')]=function(_0x307580,_0x1cfcbd){var _0x4356e9={'raw':![],'where':{'id':_0x307580[_0x2da6('0x56')]['id']},'include':[{'model':db[_0x2da6('0x57')],'as':_0x2da6('0x3b')}]},_0x25acc3={};_0x25acc3[_0x2da6('0x41')]=_[_0x2da6('0x58')](db[_0x2da6('0x59')]['rawAttributes']);_0x25acc3[_0x2da6('0x3f')]=_[_0x2da6('0x58')](_0x307580['query']);_0x25acc3[_0x2da6('0x49')]=_['intersection'](_0x25acc3[_0x2da6('0x41')],_0x25acc3['query']);_0x4356e9[_0x2da6('0x42')]=_[_0x2da6('0x40')](_0x25acc3[_0x2da6('0x41')],qs[_0x2da6('0x43')](_0x307580['query']['fields']));_0x4356e9[_0x2da6('0x42')]=_0x4356e9[_0x2da6('0x42')][_0x2da6('0x44')]?_0x4356e9[_0x2da6('0x42')]:_0x25acc3['model'];if(_0x307580[_0x2da6('0x3f')][_0x2da6('0x5a')]){_0x4356e9['include']=[{'all':!![]}];}_0x4356e9=_['merge']({},_0x4356e9,_0x307580['options']);return db[_0x2da6('0x59')][_0x2da6('0x5b')](_0x4356e9)[_0x2da6('0x20')](handleEntityNotFound(_0x1cfcbd,null))[_0x2da6('0x20')](respondWithResult(_0x1cfcbd,null))[_0x2da6('0x54')](handleError(_0x1cfcbd,null));};exports[_0x2da6('0x5c')]=function(_0x1c6097,_0xbe78aa){return db[_0x2da6('0x59')]['create'](_0x1c6097[_0x2da6('0x5d')],{})['then'](function(_0x641610){var _0xf3ed49=_0x1c6097[_0x2da6('0x5e')]['get']({'plain':!![]});if(!_0xf3ed49)throw new Error(_0x2da6('0x5f'));if(_0xf3ed49[_0x2da6('0x60')]===_0x2da6('0x5e')){var _0x443289=_0x641610['get']({'plain':!![]});var _0xc023c9=_0x2da6('0x36');return db[_0x2da6('0x61')][_0x2da6('0x5b')]({'where':{'name':_0xc023c9,'userProfileId':_0xf3ed49['userProfileId']},'raw':!![]})['then'](function(_0x2318e9){if(_0x2318e9&&_0x2318e9['autoAssociation']===0x0){return db[_0x2da6('0x62')][_0x2da6('0x5c')]({'name':_0x443289[_0x2da6('0x38')],'resourceId':_0x443289['id'],'type':_0x2318e9[_0x2da6('0x38')],'sectionId':_0x2318e9['id']},{})[_0x2da6('0x20')](function(){return _0x641610;});}else{return _0x641610;}})[_0x2da6('0x54')](function(_0x5a5471){logger[_0x2da6('0x27')](_0x2da6('0x63'),_0x5a5471);throw _0x5a5471;});}return _0x641610;})[_0x2da6('0x20')](respondWithResult(_0xbe78aa,0xc9))[_0x2da6('0x54')](handleError(_0xbe78aa,null));};exports[_0x2da6('0x34')]=function(_0x2bd2a7,_0x1daa70){if(_0x2bd2a7[_0x2da6('0x5d')]['id']){delete _0x2bd2a7[_0x2da6('0x5d')]['id'];}return db[_0x2da6('0x59')]['find']({'where':{'id':_0x2bd2a7[_0x2da6('0x56')]['id']},'include':[{'model':db[_0x2da6('0x57')],'as':_0x2da6('0x3b')}]})['then'](handleEntityNotFound(_0x1daa70,null))[_0x2da6('0x20')](saveUpdates(_0x2bd2a7[_0x2da6('0x5d')],null))[_0x2da6('0x20')](respondWithResult(_0x1daa70,null))[_0x2da6('0x54')](handleError(_0x1daa70,null));};exports[_0x2da6('0x64')]=function(_0x5e7c80,_0x12b45a){return db[_0x2da6('0x59')][_0x2da6('0x5b')]({'where':{'id':_0x5e7c80['params']['id']}})[_0x2da6('0x20')](handleEntityNotFound(_0x12b45a,null))['then'](removeEntity(_0x12b45a,null))[_0x2da6('0x54')](handleError(_0x12b45a,null));};exports[_0x2da6('0x65')]=function(_0x47859d,_0x10d77f){return db[_0x2da6('0x59')]['describe']()['then'](respondWithResult(_0x10d77f,null))[_0x2da6('0x54')](handleError(_0x10d77f,null));};exports[_0x2da6('0x66')]=function(_0x56744a,_0x3c3038,_0x9cdc94){if(_0x56744a[_0x2da6('0x5d')]['id']){delete _0x56744a[_0x2da6('0x5d')]['id'];}return db['WhatsappAccount']['find']({'where':{'id':_0x56744a[_0x2da6('0x56')]['id']}})[_0x2da6('0x20')](handleEntityNotFound(_0x3c3038,null))['then'](function(_0x2c5db1){if(_0x2c5db1){_0x56744a['body'][_0x2da6('0x67')]=_0x2c5db1['id'];return db[_0x2da6('0x68')][_0x2da6('0x5c')](_0x56744a[_0x2da6('0x5d')]);}})[_0x2da6('0x20')](respondWithResult(_0x3c3038,null))[_0x2da6('0x54')](handleError(_0x3c3038,null));};exports[_0x2da6('0x69')]=function(_0x5175a9,_0x295902,_0x3779c6){var _0x962fa4={'raw':![],'where':{}};var _0x3e207a={};var _0x42da90={'count':0x0,'rows':[]};return db[_0x2da6('0x59')][_0x2da6('0x6a')]({'where':{'id':_0x5175a9['params']['id']}})[_0x2da6('0x20')](handleEntityNotFound(_0x295902,null))[_0x2da6('0x20')](function(_0x2f8503){if(_0x2f8503){_0x3e207a[_0x2da6('0x41')]=_[_0x2da6('0x58')](db[_0x2da6('0x68')]['rawAttributes']);_0x3e207a['query']=_[_0x2da6('0x58')](_0x5175a9['query']);_0x3e207a['filters']=_[_0x2da6('0x40')](_0x3e207a[_0x2da6('0x41')],_0x3e207a['query']);_0x962fa4[_0x2da6('0x42')]=_['intersection'](_0x3e207a[_0x2da6('0x41')],qs['fields'](_0x5175a9['query'][_0x2da6('0x43')]));_0x962fa4[_0x2da6('0x42')]=_0x962fa4[_0x2da6('0x42')][_0x2da6('0x44')]?_0x962fa4['attributes']:_0x3e207a[_0x2da6('0x41')];if(!_0x5175a9[_0x2da6('0x3f')][_0x2da6('0x45')]('nolimit')){_0x962fa4['limit']=qs[_0x2da6('0x2f')](_0x5175a9[_0x2da6('0x3f')]['limit']);_0x962fa4[_0x2da6('0x2d')]=qs[_0x2da6('0x2d')](_0x5175a9['query'][_0x2da6('0x2d')]);}_0x962fa4[_0x2da6('0x47')]=qs['sort'](_0x5175a9['query'][_0x2da6('0x48')]);_0x962fa4['where']=qs[_0x2da6('0x49')](_['pick'](_0x5175a9[_0x2da6('0x3f')],_0x3e207a[_0x2da6('0x49')]));_0x962fa4[_0x2da6('0x4c')][_0x2da6('0x67')]=_0x2f8503['id'];if(_0x5175a9[_0x2da6('0x3f')][_0x2da6('0x4b')]){_0x962fa4['where']=_[_0x2da6('0x4f')](_0x962fa4['where'],{'$or':_[_0x2da6('0x3c')](_0x962fa4[_0x2da6('0x42')],function(_0x3b6916){var _0x30b565={};_0x30b565[_0x3b6916]={'$like':'%'+_0x5175a9[_0x2da6('0x3f')][_0x2da6('0x4b')]+'%'};return _0x30b565;})});}_0x962fa4=_['merge']({},_0x962fa4,_0x5175a9[_0x2da6('0x50')]);return db['Disposition'][_0x2da6('0x51')]({'where':_0x962fa4['where']})['then'](function(_0x5a1fda){_0x42da90['count']=_0x5a1fda;if(_0x5175a9[_0x2da6('0x3f')][_0x2da6('0x5a')]){_0x962fa4[_0x2da6('0x52')]=[{'all':!![]}];}return db['Disposition'][_0x2da6('0x53')](_0x962fa4);})['then'](function(_0x317381){_0x42da90[_0x2da6('0x6b')]=_0x317381;return _0x42da90;});}})[_0x2da6('0x20')](respondWithFilteredResult(_0x295902,_0x962fa4))[_0x2da6('0x54')](handleError(_0x295902,null));};exports[_0x2da6('0x6c')]=function(_0x44c30b,_0x9e40ff,_0x6475d1){return db[_0x2da6('0x59')][_0x2da6('0x5b')]({'where':{'id':_0x44c30b[_0x2da6('0x56')]['id']}})[_0x2da6('0x20')](handleEntityNotFound(_0x9e40ff,null))[_0x2da6('0x20')](function(_0x45323f){if(_0x45323f){return _0x45323f[_0x2da6('0x6c')](_0x44c30b[_0x2da6('0x3f')]['ids']);}})[_0x2da6('0x20')](respondWithStatusCode(_0x9e40ff,null))[_0x2da6('0x54')](handleError(_0x9e40ff,null));};exports[_0x2da6('0x6d')]=function(_0x195070,_0x5bd121,_0x113241){if(_0x195070['body']['id']){delete _0x195070[_0x2da6('0x5d')]['id'];}return db[_0x2da6('0x59')][_0x2da6('0x5b')]({'where':{'id':_0x195070['params']['id']}})[_0x2da6('0x20')](handleEntityNotFound(_0x5bd121,null))['then'](function(_0x461056){if(_0x461056){_0x195070[_0x2da6('0x5d')][_0x2da6('0x67')]=_0x461056['id'];return db[_0x2da6('0x6e')][_0x2da6('0x5c')](_0x195070[_0x2da6('0x5d')]);}})['then'](respondWithResult(_0x5bd121,null))['catch'](handleError(_0x5bd121,null));};exports['getAnswers']=function(_0x10d2b2,_0x402157,_0x28c233){var _0x2a9e33={'raw':![],'where':{}};var _0x4a8ae0={};var _0x4f3c04={'count':0x0,'rows':[]};return db[_0x2da6('0x59')][_0x2da6('0x6a')]({'where':{'id':_0x10d2b2[_0x2da6('0x56')]['id']}})[_0x2da6('0x20')](handleEntityNotFound(_0x402157,null))[_0x2da6('0x20')](function(_0xf458ee){if(_0xf458ee){_0x4a8ae0['model']=_[_0x2da6('0x58')](db[_0x2da6('0x6e')][_0x2da6('0x3d')]);_0x4a8ae0['query']=_[_0x2da6('0x58')](_0x10d2b2[_0x2da6('0x3f')]);_0x4a8ae0[_0x2da6('0x49')]=_[_0x2da6('0x40')](_0x4a8ae0[_0x2da6('0x41')],_0x4a8ae0[_0x2da6('0x3f')]);_0x2a9e33[_0x2da6('0x42')]=_['intersection'](_0x4a8ae0[_0x2da6('0x41')],qs[_0x2da6('0x43')](_0x10d2b2[_0x2da6('0x3f')]['fields']));_0x2a9e33[_0x2da6('0x42')]=_0x2a9e33['attributes'][_0x2da6('0x44')]?_0x2a9e33[_0x2da6('0x42')]:_0x4a8ae0[_0x2da6('0x41')];if(!_0x10d2b2[_0x2da6('0x3f')][_0x2da6('0x45')](_0x2da6('0x46'))){_0x2a9e33[_0x2da6('0x2f')]=qs['limit'](_0x10d2b2[_0x2da6('0x3f')][_0x2da6('0x2f')]);_0x2a9e33['offset']=qs['offset'](_0x10d2b2['query'][_0x2da6('0x2d')]);}_0x2a9e33[_0x2da6('0x47')]=qs[_0x2da6('0x48')](_0x10d2b2[_0x2da6('0x3f')][_0x2da6('0x48')]);_0x2a9e33['where']=qs['filters'](_['pick'](_0x10d2b2['query'],_0x4a8ae0[_0x2da6('0x49')]));_0x2a9e33['where']['WhatsappAccountId']=_0xf458ee['id'];if(_0x10d2b2[_0x2da6('0x3f')]['filter']){_0x2a9e33[_0x2da6('0x4c')]=_[_0x2da6('0x4f')](_0x2a9e33['where'],{'$or':_[_0x2da6('0x3c')](_0x2a9e33[_0x2da6('0x42')],function(_0x5818c7){var _0x5efb55={};_0x5efb55[_0x5818c7]={'$like':'%'+_0x10d2b2[_0x2da6('0x3f')][_0x2da6('0x4b')]+'%'};return _0x5efb55;})});}_0x2a9e33=_['merge']({},_0x2a9e33,_0x10d2b2[_0x2da6('0x50')]);return db[_0x2da6('0x6e')][_0x2da6('0x51')]({'where':_0x2a9e33['where']})[_0x2da6('0x20')](function(_0x2a2347){_0x4f3c04['count']=_0x2a2347;if(_0x10d2b2[_0x2da6('0x3f')]['includeAll']){_0x2a9e33['include']=[{'all':!![]}];}return db[_0x2da6('0x6e')][_0x2da6('0x53')](_0x2a9e33);})['then'](function(_0x1fcb65){_0x4f3c04[_0x2da6('0x6b')]=_0x1fcb65;return _0x4f3c04;});}})['then'](respondWithFilteredResult(_0x402157,_0x2a9e33))[_0x2da6('0x54')](handleError(_0x402157,null));};exports['removeAnswers']=function(_0x340f9a,_0xdbecdb,_0x12e39d){return db[_0x2da6('0x59')]['find']({'where':{'id':_0x340f9a[_0x2da6('0x56')]['id']}})[_0x2da6('0x20')](handleEntityNotFound(_0xdbecdb,null))[_0x2da6('0x20')](function(_0xbda1a9){if(_0xbda1a9){return _0xbda1a9[_0x2da6('0x6f')](_0x340f9a[_0x2da6('0x3f')]['ids']);}})[_0x2da6('0x20')](respondWithStatusCode(_0xdbecdb,null))['catch'](handleError(_0xdbecdb,null));};exports[_0x2da6('0x70')]=function(_0x1adec2,_0x41d9e0,_0x2aeca4){return db[_0x2da6('0x59')][_0x2da6('0x5b')]({'where':{'id':_0x1adec2['params']['id']}})[_0x2da6('0x20')](handleEntityNotFound(_0x41d9e0,null))[_0x2da6('0x20')](function(_0x585cb1){if(_0x585cb1){return _0x585cb1['addAgents'](_0x1adec2[_0x2da6('0x5d')][_0x2da6('0x71')],_['omit'](_0x1adec2['body'],[_0x2da6('0x71'),'id'])||{})[_0x2da6('0x72')](function(_0x27a034){for(var _0x53682a=0x0;_0x53682a<_0x1adec2['body'][_0x2da6('0x71')][_0x2da6('0x44')];_0x53682a+=0x1){socket[_0x2da6('0x73')](_0x2da6('0x74'),{'UserId':Number(_0x1adec2[_0x2da6('0x5d')]['ids'][_0x53682a]),'WhatsappAccountId':Number(_0x1adec2['params']['id'])});}return _0x27a034;});}})['then'](respondWithResult(_0x41d9e0,null))[_0x2da6('0x54')](handleError(_0x41d9e0,null));};exports['removeAgents']=function(_0xdd89f2,_0x1dcc97,_0x5803f9){return db[_0x2da6('0x59')][_0x2da6('0x5b')]({'where':{'id':_0xdd89f2[_0x2da6('0x56')]['id']}})[_0x2da6('0x20')](handleEntityNotFound(_0x1dcc97,null))[_0x2da6('0x20')](function(_0x333617){if(_0x333617){return _0x333617[_0x2da6('0x75')](_0xdd89f2[_0x2da6('0x3f')][_0x2da6('0x71')])[_0x2da6('0x20')](function(){if(_['isArray'](_0xdd89f2[_0x2da6('0x3f')][_0x2da6('0x71')])){for(var _0x32388a=0x0;_0x32388a<_0xdd89f2[_0x2da6('0x3f')][_0x2da6('0x71')][_0x2da6('0x44')];_0x32388a+=0x1){socket[_0x2da6('0x73')]('userWhatsappAccount:remove',{'UserId':Number(_0xdd89f2['query'][_0x2da6('0x71')][_0x32388a]),'WhatsappAccountId':Number(_0xdd89f2[_0x2da6('0x56')]['id'])});}}else{socket[_0x2da6('0x73')](_0x2da6('0x76'),{'UserId':Number(_0xdd89f2[_0x2da6('0x3f')][_0x2da6('0x71')]),'WhatsappAccountId':Number(_0xdd89f2[_0x2da6('0x56')]['id'])});}});}})[_0x2da6('0x20')](respondWithStatusCode(_0x1dcc97,null))[_0x2da6('0x54')](handleError(_0x1dcc97,null));};exports[_0x2da6('0x77')]=function(_0x654e,_0x3d032e,_0x3344ae){var _0x3a4bcd={};var _0x5281ef={};var _0x32e217;var _0x4cc6a5;return db[_0x2da6('0x59')][_0x2da6('0x6a')]({'where':{'id':_0x654e['params']['id']}})[_0x2da6('0x20')](handleEntityNotFound(_0x3d032e,null))[_0x2da6('0x20')](function(_0x5a2f03){if(_0x5a2f03){_0x32e217=_0x5a2f03;_0x5281ef[_0x2da6('0x41')]=_[_0x2da6('0x58')](db[_0x2da6('0x78')][_0x2da6('0x3d')]);_0x5281ef[_0x2da6('0x3f')]=_[_0x2da6('0x58')](_0x654e[_0x2da6('0x3f')]);_0x5281ef[_0x2da6('0x49')]=_[_0x2da6('0x40')](_0x5281ef['model'],_0x5281ef[_0x2da6('0x3f')]);_0x3a4bcd[_0x2da6('0x42')]=_[_0x2da6('0x40')](_0x5281ef[_0x2da6('0x41')],qs[_0x2da6('0x43')](_0x654e[_0x2da6('0x3f')][_0x2da6('0x43')]));_0x3a4bcd[_0x2da6('0x42')]=_0x3a4bcd[_0x2da6('0x42')]['length']?_0x3a4bcd[_0x2da6('0x42')]:_0x5281ef['model'];_0x3a4bcd[_0x2da6('0x47')]=qs[_0x2da6('0x48')](_0x654e['query']['sort']);_0x3a4bcd[_0x2da6('0x4c')]=qs[_0x2da6('0x49')](_['pick'](_0x654e['query'],_0x5281ef[_0x2da6('0x49')]));if(_0x654e[_0x2da6('0x3f')][_0x2da6('0x4b')]){_0x3a4bcd[_0x2da6('0x4c')]=_[_0x2da6('0x4f')](_0x3a4bcd[_0x2da6('0x4c')],{'$or':_[_0x2da6('0x3c')](_0x3a4bcd[_0x2da6('0x42')],function(_0x4fce2a){var _0x5b7b6c={};_0x5b7b6c[_0x4fce2a]={'$like':'%'+_0x654e[_0x2da6('0x3f')][_0x2da6('0x4b')]+'%'};return _0x5b7b6c;})});}_0x3a4bcd=_['merge']({},_0x3a4bcd,_0x654e[_0x2da6('0x50')]);return _0x32e217[_0x2da6('0x77')](_0x3a4bcd);}})[_0x2da6('0x20')](function(_0x2e54fe){if(_0x2e54fe){_0x4cc6a5=_0x2e54fe[_0x2da6('0x44')];if(!_0x654e[_0x2da6('0x3f')][_0x2da6('0x45')](_0x2da6('0x46'))){_0x3a4bcd[_0x2da6('0x2f')]=qs[_0x2da6('0x2f')](_0x654e[_0x2da6('0x3f')][_0x2da6('0x2f')]);_0x3a4bcd[_0x2da6('0x2d')]=qs[_0x2da6('0x2d')](_0x654e['query'][_0x2da6('0x2d')]);}return _0x32e217[_0x2da6('0x77')](_0x3a4bcd);}})[_0x2da6('0x20')](function(_0xf2b338){if(_0xf2b338){return _0xf2b338?{'count':_0x4cc6a5,'rows':_0xf2b338}:null;}})[_0x2da6('0x20')](respondWithResult(_0x3d032e,null))[_0x2da6('0x54')](handleError(_0x3d032e,null));};exports[_0x2da6('0x79')]=function(_0x33f454,_0x34914c,_0x275f01){return db[_0x2da6('0x59')][_0x2da6('0x6a')]({'where':{'id':_0x33f454[_0x2da6('0x56')]['id']}})[_0x2da6('0x20')](handleEntityNotFound(_0x34914c,null))[_0x2da6('0x20')](function(_0x49a61a){if(_0x49a61a){return db[_0x2da6('0x7a')][_0x2da6('0x7b')](function(_0x539e73){return db[_0x2da6('0x7c')]['destroy']({'where':{'WhatsappAccountId':_0x33f454[_0x2da6('0x56')]['id']},'transaction':_0x539e73})[_0x2da6('0x20')](function(_0x3083ec){var _0x48831a=_[_0x2da6('0x3c')](_0x33f454['body'],function(_0x15c562){_0x15c562[_0x2da6('0x67')]=_0x33f454[_0x2da6('0x56')]['id'];return _0x15c562;});return db['WhatsappApplication'][_0x2da6('0x7d')](_0x48831a,{'transaction':_0x539e73});});})['then'](function(){return db[_0x2da6('0x7c')][_0x2da6('0x7e')]({'where':{'WhatsappAccountId':_0x33f454['params']['id']},'order':_0x2da6('0x7f')});});}})[_0x2da6('0x20')](respondWithResult(_0x34914c,null))[_0x2da6('0x54')](handleError(_0x34914c,null));};exports['getApplications']=function(_0x2e2df4,_0x3a9464,_0x43a95b){var _0x13d41f={};var _0x79aebe={};var _0x52df5f;var _0x3871e6;return db[_0x2da6('0x59')][_0x2da6('0x6a')]({'where':{'id':_0x2e2df4[_0x2da6('0x56')]['id']}})[_0x2da6('0x20')](handleEntityNotFound(_0x3a9464,null))['then'](function(_0x415ee3){if(_0x415ee3){_0x52df5f=_0x415ee3;_0x79aebe['model']=_[_0x2da6('0x58')](db[_0x2da6('0x7c')][_0x2da6('0x3d')]);_0x79aebe[_0x2da6('0x3f')]=_[_0x2da6('0x58')](_0x2e2df4['query']);_0x79aebe[_0x2da6('0x49')]=_['intersection'](_0x79aebe['model'],_0x79aebe['query']);_0x13d41f['attributes']=_[_0x2da6('0x40')](_0x79aebe[_0x2da6('0x41')],qs[_0x2da6('0x43')](_0x2e2df4[_0x2da6('0x3f')][_0x2da6('0x43')]));_0x13d41f[_0x2da6('0x42')]=_0x13d41f[_0x2da6('0x42')][_0x2da6('0x44')]?_0x13d41f[_0x2da6('0x42')]:_0x79aebe[_0x2da6('0x41')];_0x13d41f[_0x2da6('0x47')]=qs['sort'](_0x2e2df4['query'][_0x2da6('0x48')]);_0x13d41f[_0x2da6('0x4c')]=qs['filters'](_[_0x2da6('0x4a')](_0x2e2df4[_0x2da6('0x3f')],_0x79aebe[_0x2da6('0x49')]));if(_0x2e2df4[_0x2da6('0x3f')]['filter']){_0x13d41f['where']=_[_0x2da6('0x4f')](_0x13d41f['where'],{'$or':_[_0x2da6('0x3c')](_0x13d41f['attributes'],function(_0xd36146){var _0x494a73={};_0x494a73[_0xd36146]={'$like':'%'+_0x2e2df4['query'][_0x2da6('0x4b')]+'%'};return _0x494a73;})});}_0x13d41f=_[_0x2da6('0x4f')]({},_0x13d41f,_0x2e2df4[_0x2da6('0x50')]);return _0x52df5f[_0x2da6('0x80')](_0x13d41f);}})['then'](function(_0x30db85){if(_0x30db85){_0x3871e6=_0x30db85[_0x2da6('0x44')];if(!_0x2e2df4[_0x2da6('0x3f')][_0x2da6('0x45')]('nolimit')){_0x13d41f[_0x2da6('0x2f')]=qs[_0x2da6('0x2f')](_0x2e2df4['query'][_0x2da6('0x2f')]);_0x13d41f[_0x2da6('0x2d')]=qs[_0x2da6('0x2d')](_0x2e2df4[_0x2da6('0x3f')][_0x2da6('0x2d')]);}return _0x52df5f[_0x2da6('0x80')](_0x13d41f);}})['then'](function(_0x8c32cf){if(_0x8c32cf){return _0x8c32cf?{'count':_0x3871e6,'rows':_0x8c32cf}:null;}})[_0x2da6('0x20')](respondWithResult(_0x3a9464,null))[_0x2da6('0x54')](handleError(_0x3a9464,null));};exports[_0x2da6('0x81')]=function(_0x4161c2,_0x3bd7a5,_0x18ec4b){var _0x1496d0={'channel':'whatsapp'};var _0x34142e=[];var _0xe53d47=[];var _0x5da3fc={};return db[_0x2da6('0x59')]['find']({'where':{'id':_0x4161c2[_0x2da6('0x56')]['id']},'include':[{'model':db[_0x2da6('0x7c')],'as':_0x2da6('0x82')}]})[_0x2da6('0x20')](handleEntityNotFound(_0x3bd7a5,null))['then'](function(_0x4fe8f4){_0x1496d0[_0x2da6('0x83')]=_0x4fe8f4;_0x1496d0[_0x2da6('0x84')]=_[_0x2da6('0x85')](_0x4fe8f4[_0x2da6('0x82')],[_0x2da6('0x7f')],['asc']);if(_0x1496d0[_0x2da6('0x83')][_0x2da6('0x82')]){delete _0x1496d0[_0x2da6('0x83')]['Applications'];}return db[_0x2da6('0x86')][_0x2da6('0x65')]();})[_0x2da6('0x20')](function(_0x497966){if(!_0x497966){throw new db[(_0x2da6('0x87'))][(_0x2da6('0x88'))](_0x2da6('0x89'));}_0x34142e=_[_0x2da6('0x8a')](_[_0x2da6('0x58')](_0x497966),[_0x2da6('0x8b'),_0x2da6('0x8c')]);_0xe53d47=_[_0x2da6('0x8a')](_[_0x2da6('0x58')](_0x497966),[_0x2da6('0x8b'),'updatedAt','CompanyId','ListId']);_0x1496d0[_0x2da6('0x5d')]={'mapKey':'mobile'};if(_0x1496d0['account']['type']&&_0x1496d0[_0x2da6('0x83')][_0x2da6('0x4d')]===_0x2da6('0x8d')){_0x1496d0[_0x2da6('0x5d')]['from']=_0x4161c2[_0x2da6('0x5d')][_0x2da6('0x8e')][_0x2da6('0x8f')](_0x2da6('0x90'),'');_0x1496d0[_0x2da6('0x5d')]['body']=_0x4161c2[_0x2da6('0x5d')][_0x2da6('0x91')];_0x1496d0[_0x2da6('0x5d')][_0x2da6('0x92')]=_0x4161c2[_0x2da6('0x5d')][_0x2da6('0x93')];}if(_0x1496d0[_0x2da6('0x5d')]['id']){delete _0x1496d0[_0x2da6('0x5d')]['id'];}if(_['isNil'](_0x1496d0['body'][_0x2da6('0x94')])){throw new db[(_0x2da6('0x87'))][(_0x2da6('0x88'))](_0x2da6('0x95'));}if(_[_0x2da6('0x96')](_0x1496d0[_0x2da6('0x5d')][_0x2da6('0x5d')])||_0x1496d0['body'][_0x2da6('0x5d')]===''){throw new db[(_0x2da6('0x87'))][(_0x2da6('0x88'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x1496d0['body'][_0x2da6('0x97')])){throw new db['Sequelize'][(_0x2da6('0x88'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xe53d47);}if(!_[_0x2da6('0x98')](_0xe53d47,_0x1496d0[_0x2da6('0x5d')]['mapKey'])){throw new db[(_0x2da6('0x87'))][(_0x2da6('0x88'))](_0x2da6('0x99')+_0xe53d47);}_0x5da3fc[_0x1496d0[_0x2da6('0x5d')][_0x2da6('0x97')]]=_0x1496d0[_0x2da6('0x5d')][_0x2da6('0x94')];return db[_0x2da6('0x9a')]['find']({'where':{'id':_0x1496d0[_0x2da6('0x83')][_0x2da6('0x9b')]},'include':[{'model':db[_0x2da6('0x86')],'as':'Contacts','where':_0x5da3fc,'limit':0x1,'order':[[_0x2da6('0x8c'),_0x2da6('0x9c')]]}]});})['then'](handleEntityNotFound(_0x3bd7a5,null))[_0x2da6('0x20')](function(_0x9b4185){if(_0x9b4185){_0x1496d0[_0x2da6('0x9d')]=_[_0x2da6('0x9e')](_0x9b4185,[_0x2da6('0x9f')]);if(_0x9b4185['Contacts'][_0x2da6('0x44')]){return _0x9b4185['Contacts'][0x0];}var _0x10971f=_[_0x2da6('0x18')](_0x1496d0[_0x2da6('0x5d')],{'firstName':_0x1496d0[_0x2da6('0x5d')][_0x2da6('0x94')],'ListId':_0x9b4185['id']});_0x10971f[_0x1496d0[_0x2da6('0x5d')]['mapKey']]=_0x1496d0[_0x2da6('0x5d')][_0x2da6('0x94')];return db[_0x2da6('0x86')][_0x2da6('0x5c')](_0x10971f,{'fields':_0x34142e,'raw':!![]});}})[_0x2da6('0x20')](handleEntityNotFound(_0x3bd7a5,null))[_0x2da6('0x20')](function(_0x1d8595){if(_0x1d8595){_0x1496d0[_0x2da6('0xa0')]=_0x1d8595;var _0xe5d8e={'ContactId':_0x1d8595['id'],'phone':_0x1496d0['body'][_0x2da6('0x94')],'WhatsappAccountId':_0x4161c2[_0x2da6('0x56')]['id']};var _0x463b71={'ContactId':_0x1d8595['id'],'WhatsappAccountId':_0x4161c2[_0x2da6('0x56')]['id'],'closed':![]};return db[_0x2da6('0xa1')]['find']({'where':_0x463b71})[_0x2da6('0x20')](function(_0x263c1f){if(_0x263c1f){return[_0x263c1f,![]];}return db['WhatsappInteraction'][_0x2da6('0x5c')](_0xe5d8e)['then'](function(_0x3b6a3f){return[_0x3b6a3f,!![]];});});}})['spread'](function(_0x43f3c9,_0x4719e2){_0x1496d0[_0x2da6('0xa2')]=_0x43f3c9[_0x2da6('0x35')]({'plain':!![]});_0x1496d0[_0x2da6('0xa2')][_0x2da6('0xa3')]=![];if(_0x4719e2){if(_0x1496d0[_0x2da6('0x83')][_0x2da6('0xa4')]){_0x1496d0[_0x2da6('0x84')][_0x2da6('0xa5')]({'id':0x0,'priority':_0x1496d0[_0x2da6('0x84')][_0x2da6('0x44')]+0x1,'app':_0x2da6('0xa6'),'appdata':_0x2da6('0xa7'),'interval':_0x2da6('0xa8')});}_0x1496d0[_0x2da6('0xa2')][_0x2da6('0xa3')]=!![];}return db['WhatsappMessage'][_0x2da6('0x5c')]({'phone':_0x1496d0[_0x2da6('0x5d')][_0x2da6('0x94')],'messageId':_0x1496d0[_0x2da6('0x5d')][_0x2da6('0x92')],'body':_0x1496d0[_0x2da6('0x5d')][_0x2da6('0x5d')],'WhatsappAccountId':_0x4161c2['params']['id'],'WhatsappInteractionId':_0x43f3c9['id'],'direction':'in','ContactId':_0x43f3c9['ContactId'],'AttachmentId':_0x1496d0['body'][_0x2da6('0xa9')]});})['then'](function(_0x10dc78){_0x1496d0[_0x2da6('0x28')]=_0x10dc78;if(_0x1496d0[_0x2da6('0xa2')][_0x2da6('0xaa')]){return db[_0x2da6('0x78')][_0x2da6('0x5b')]({'attributes':['id','name'],'where':{'id':_0x1496d0[_0x2da6('0xa2')][_0x2da6('0xaa')]}})[_0x2da6('0x20')](function(_0x5f3560){if(_0x5f3560){_0x1496d0[_0x2da6('0x84')][_0x2da6('0xab')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5f3560['name']+','+(_0x1496d0[_0x2da6('0x83')][_0x2da6('0xac')]||0xa),'interval':_0x2da6('0xa8')});}return respondWithRpcPromise(_0x2da6('0xad'),_0x2da6('0xae'),_0x1496d0);});}return respondWithRpcPromise(_0x2da6('0xad'),_0x2da6('0xae'),_0x1496d0);})[_0x2da6('0x20')](function(_0x3a700a){if(_0x3a700a){var _0x5a7285=0xc8;var _0x187e67='receiveMessage';logger[_0x2da6('0x21')](_0x2da6('0x25'),_0x187e67,_0x5a7285,_0x2da6('0xaf'));logger['debug'](_0x2da6('0xb0'),_0x187e67,_0x5a7285,_0x2da6('0xaf'),JSON[_0x2da6('0x26')](_0x3a700a));if(_0x1496d0['account'][_0x2da6('0x4d')]===_0x2da6('0x8d')){return _0x3bd7a5[_0x2da6('0x2a')](_0x5a7285)[_0x2da6('0x30')](_0x2da6('0xb1'),_0x2da6('0xb2'))[_0x2da6('0x39')]('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x3bd7a5[_0x2da6('0x2a')](_0x5a7285)[_0x2da6('0x2c')](_0x3a700a);}}})['catch'](handleError(_0x3bd7a5,null));};exports[_0x2da6('0x39')]=function(_0x401b57,_0x33475b,_0x509025){var _0x19a48f,_0x4602bd,_0x29f730;if(_[_0x2da6('0x96')](_0x401b57['body'][_0x2da6('0x5d')])||_0x401b57[_0x2da6('0x5d')][_0x2da6('0x5d')]===''){throw new db[(_0x2da6('0x87'))][(_0x2da6('0x88'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x2da6('0x96')](_0x401b57[_0x2da6('0x5d')]['to'])){throw new db[(_0x2da6('0x87'))][(_0x2da6('0x88'))](_0x2da6('0xb3'));}_0x19a48f=_0x401b57[_0x2da6('0x5d')]['to'];return db['WhatsappAccount'][_0x2da6('0x5b')]({'where':{'id':_0x401b57[_0x2da6('0x56')]['id']},'include':[{'model':db['CmList'],'as':_0x2da6('0xb4'),'include':[{'model':db[_0x2da6('0x86')],'as':_0x2da6('0x9f'),'where':{'mobile':_0x19a48f},'limit':0x1,'order':[['updatedAt',_0x2da6('0x9c')]]}]}]})[_0x2da6('0x20')](handleEntityNotFound(_0x33475b,null))[_0x2da6('0x20')](function(_0x6f7824){if(_0x6f7824&&_0x6f7824['List']){_0x4602bd=_0x6f7824[_0x2da6('0x35')]({'plain':!![]});if(_0x4602bd[_0x2da6('0xb4')]&&_0x4602bd[_0x2da6('0xb4')][_0x2da6('0x9f')]['length']){return _0x4602bd[_0x2da6('0xb4')][_0x2da6('0x9f')][0x0];}return db[_0x2da6('0x86')][_0x2da6('0x5c')](_[_0x2da6('0x18')](_0x401b57[_0x2da6('0x5d')],{'firstName':_0x19a48f,'mobile':_0x19a48f,'phone':_0x19a48f,'ListId':_0x4602bd[_0x2da6('0x9b')]}));}})[_0x2da6('0x20')](handleEntityNotFound(_0x33475b,null))[_0x2da6('0x20')](function(_0x5507b8){if(_0x5507b8){_0x29f730=_0x5507b8;return db[_0x2da6('0xa1')][_0x2da6('0x5b')]({'where':{'ContactId':_0x29f730['id'],'closed':![],'WhatsappAccountId':_0x4602bd['id']}})[_0x2da6('0x20')](function(_0x58a6cd){if(_0x58a6cd){return[_0x58a6cd,![]];}return db[_0x2da6('0xa1')][_0x2da6('0x5c')]({'UserId':_0x401b57[_0x2da6('0x5e')]['id'],'ContactId':_0x29f730['id'],'WhatsappAccountId':_0x4602bd['id'],'phone':_0x19a48f,'firstMsgDirection':_0x2da6('0xb5'),'Messages':[_[_0x2da6('0x4f')](_0x401b57[_0x2da6('0x5d')],{'read':![],'body':_0x401b57[_0x2da6('0x5d')][_0x2da6('0x5d')],'phone':_0x19a48f,'WhatsappAccountId':_0x4602bd['id'],'UserId':_0x401b57[_0x2da6('0x5e')]['id'],'ContactId':_0x29f730['id']})]},{'include':[{'model':db[_0x2da6('0xb6')],'as':'Messages'}]})[_0x2da6('0x20')](function(_0x1967d3){return[_0x1967d3,!![]];});});}})[_0x2da6('0x72')](function(_0x5e634e,_0x12ab31){if(_0x12ab31){return _0x5e634e;}return db[_0x2da6('0xb6')][_0x2da6('0x5c')](_[_0x2da6('0x4f')](_0x401b57['body'],{'read':![],'body':_0x401b57[_0x2da6('0x5d')]['body'],'phone':_0x19a48f,'WhatsappAccountId':_0x4602bd['id'],'WhatsappInteractionId':_0x5e634e['id'],'UserId':_0x401b57['user']['id'],'ContactId':_0x29f730['id']}))['then'](function(_0x17182c){_0x5e634e[_0x2da6('0xb7')][_0x2da6('0xb8')]=[];_0x5e634e[_0x2da6('0xb7')][_0x2da6('0xb8')][_0x2da6('0xa5')](_0x17182c[_0x2da6('0xb7')]);return _0x5e634e;});})[_0x2da6('0x20')](respondWithResult(_0x33475b,null))[_0x2da6('0x54')](handleError(_0x33475b,null));};
\ No newline at end of file
+var _0xc71d=['hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','rows','show','params','includeAll','include','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','pick','findAll','removeDispositions','ids','addAnswer','WhatsappAccountId','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','findOne','User','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','whatsapp','Applications','account','applications','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mobile','From','replace','whatsapp:','messageId','MessageSid','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','list','contact','WhatsappInteraction','interaction','created','autoclose','close','unmanaged','*,*,*,*','ContactId','UserId','unshift','waitForTheAssignedAgent','startRouting','Start','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','isNil','to\x20is\x20mandatory','List','DESC','out','WhatsappMessage','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./whatsappAccount.socket','register','jayson/promise','client','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','catch','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','get','WhatsappAccounts','UserProfileResource','end','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','model','keys','filters','intersection','query','fields','attributes','length'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xc71d,0x1ec));var _0xdc71=function(_0x55cc58,_0x5ce0af){_0x55cc58=_0x55cc58-0x0;var _0x26062e=_0xc71d[_0x55cc58];return _0x26062e;};'use strict';var emlformat=require(_0xdc71('0x0'));var rimraf=require(_0xdc71('0x1'));var zipdir=require(_0xdc71('0x2'));var jsonpatch=require(_0xdc71('0x3'));var rp=require(_0xdc71('0x4'));var moment=require('moment');var BPromise=require(_0xdc71('0x5'));var Mustache=require(_0xdc71('0x6'));var util=require(_0xdc71('0x7'));var path=require('path');var sox=require(_0xdc71('0x8'));var csv=require(_0xdc71('0x9'));var ejs=require(_0xdc71('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdc71('0xb'));var squel=require(_0xdc71('0xc'));var crypto=require(_0xdc71('0xd'));var jsforce=require(_0xdc71('0xe'));var deskjs=require(_0xdc71('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xdc71('0x10'));var Redis=require(_0xdc71('0x11'));var authService=require(_0xdc71('0x12'));var qs=require(_0xdc71('0x13'));var as=require(_0xdc71('0x14'));var hardwareService=require(_0xdc71('0x15'));var logger=require(_0xdc71('0x16'))('api');var utils=require(_0xdc71('0x17'));var config=require(_0xdc71('0x18'));var licenseUtil=require(_0xdc71('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xdc71('0x1a')](config[_0xdc71('0x1b')],{'host':_0xdc71('0x1c'),'port':0x18eb});var socket=require(_0xdc71('0x1d'))(new Redis(config[_0xdc71('0x1b')]));require(_0xdc71('0x1e'))[_0xdc71('0x1f')](socket);var jayson=require(_0xdc71('0x20'));var client=jayson[_0xdc71('0x21')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2e796f,_0x1697c9,_0x5e2ea0,_0x336c3b){return new BPromise(function(_0x3a235c,_0x3cec50){var _0x59c245=_0x336c3b||client;return _0x59c245['request'](_0x2e796f,_0x5e2ea0)[_0xdc71('0x22')](function(_0x90b624){logger[_0xdc71('0x23')]('WhatsappAccount,\x20%s,\x20%s',_0x1697c9,_0xdc71('0x24'));logger[_0xdc71('0x25')](_0xdc71('0x26'),_0x1697c9,_0xdc71('0x24'),JSON[_0xdc71('0x27')](_0x90b624));if(_0x90b624[_0xdc71('0x28')]){if(_0x90b624[_0xdc71('0x28')][_0xdc71('0x29')]===0x1f4){logger[_0xdc71('0x28')](_0xdc71('0x2a'),_0x1697c9,_0x90b624[_0xdc71('0x28')][_0xdc71('0x2b')]);return _0x3cec50(_0x90b624[_0xdc71('0x28')][_0xdc71('0x2b')]);}logger[_0xdc71('0x28')]('WhatsappAccount,\x20%s,\x20%s',_0x1697c9,_0x90b624[_0xdc71('0x28')][_0xdc71('0x2b')]);return _0x3a235c(_0x90b624['error']['message']);}else{logger[_0xdc71('0x23')](_0xdc71('0x2a'),_0x1697c9,_0xdc71('0x24'));_0x3a235c(_0x90b624['result'][_0xdc71('0x2b')]);}})[_0xdc71('0x2c')](function(_0x3bada4){logger[_0xdc71('0x28')](_0xdc71('0x2a'),_0x1697c9,_0x3bada4);_0x3cec50(_0x3bada4);});});}function respondWithStatusCode(_0x10f7d6,_0x2e4aae){_0x2e4aae=_0x2e4aae||0xcc;return function(_0x5473a8){if(_0x5473a8){return _0x10f7d6[_0xdc71('0x2d')](_0x2e4aae);}return _0x10f7d6[_0xdc71('0x2e')](_0x2e4aae)['end']();};}function respondWithResult(_0x57a639,_0x53e512){_0x53e512=_0x53e512||0xc8;return function(_0x1b4984){if(_0x1b4984){return _0x57a639[_0xdc71('0x2e')](_0x53e512)[_0xdc71('0x2f')](_0x1b4984);}};}function respondWithFilteredResult(_0x2332ca,_0x31187b){return function(_0x1e0d14){if(_0x1e0d14){var _0x24ebc4=typeof _0x31187b['offset']===_0xdc71('0x30')&&typeof _0x31187b['limit']===_0xdc71('0x30');var _0x5e400f=_0x1e0d14[_0xdc71('0x31')];var _0x308c62=_0x24ebc4?0x0:_0x31187b[_0xdc71('0x32')];var _0x4a2811=_0x24ebc4?_0x1e0d14[_0xdc71('0x31')]:_0x31187b[_0xdc71('0x32')]+_0x31187b[_0xdc71('0x33')];var _0x17dc03;if(_0x4a2811>=_0x5e400f){_0x4a2811=_0x5e400f;_0x17dc03=0xc8;}else{_0x17dc03=0xce;}_0x2332ca[_0xdc71('0x2e')](_0x17dc03);return _0x2332ca[_0xdc71('0x34')](_0xdc71('0x35'),_0x308c62+'-'+_0x4a2811+'/'+_0x5e400f)[_0xdc71('0x2f')](_0x1e0d14);}return null;};}function patchUpdates(_0x3976d1){return function(_0x3aa7c0){try{jsonpatch[_0xdc71('0x36')](_0x3aa7c0,_0x3976d1,!![]);}catch(_0x169afa){return BPromise[_0xdc71('0x37')](_0x169afa);}return _0x3aa7c0[_0xdc71('0x38')]();};}function saveUpdates(_0x36a8d1,_0x5781c2){return function(_0x4bf068){if(_0x4bf068){return _0x4bf068[_0xdc71('0x39')](_0x36a8d1)[_0xdc71('0x22')](function(_0x1f8d51){return _0x1f8d51;});}return null;};}function removeEntity(_0xc123bd,_0x2715b4){return function(_0x32421f){if(_0x32421f){return _0x32421f[_0xdc71('0x3a')]()[_0xdc71('0x22')](function(){var _0x56185e=_0x32421f[_0xdc71('0x3b')]({'plain':!![]});var _0x376972=_0xdc71('0x3c');return db[_0xdc71('0x3d')]['destroy']({'where':{'type':_0x376972,'resourceId':_0x56185e['id']}})[_0xdc71('0x22')](function(){return _0x32421f;});})[_0xdc71('0x22')](function(){_0xc123bd[_0xdc71('0x2e')](0xcc)[_0xdc71('0x3e')]();});}};}function handleEntityNotFound(_0x262159,_0x368687){return function(_0x5d6c17){if(!_0x5d6c17){_0x262159[_0xdc71('0x2d')](0x194);}return _0x5d6c17;};}function handleError(_0x28cd7d,_0x541f80){_0x541f80=_0x541f80||0x1f4;return function(_0x5d6162){logger[_0xdc71('0x28')](_0x5d6162['stack']);if(_0x5d6162[_0xdc71('0x3f')]){delete _0x5d6162[_0xdc71('0x3f')];}_0x28cd7d[_0xdc71('0x2e')](_0x541f80)[_0xdc71('0x40')](_0x5d6162);};}exports[_0xdc71('0x41')]=function(_0x2f1bc5,_0x3fcd74){var _0x256d70={'include':[{'model':db[_0xdc71('0x42')],'as':_0xdc71('0x43')}]},_0x2a5ccd={},_0x3264f3={'count':0x0,'rows':[]};var _0x5b7326=_[_0xdc71('0x44')](db[_0xdc71('0x45')][_0xdc71('0x46')],function(_0x2757f2){return{'name':_0x2757f2[_0xdc71('0x47')],'type':_0x2757f2[_0xdc71('0x48')]['key']};});_0x2a5ccd[_0xdc71('0x49')]=_['map'](_0x5b7326,_0xdc71('0x3f'));_0x2a5ccd['query']=_[_0xdc71('0x4a')](_0x2f1bc5['query']);_0x2a5ccd[_0xdc71('0x4b')]=_[_0xdc71('0x4c')](_0x2a5ccd[_0xdc71('0x49')],_0x2a5ccd[_0xdc71('0x4d')]);_0x256d70['attributes']=_[_0xdc71('0x4c')](_0x2a5ccd[_0xdc71('0x49')],qs[_0xdc71('0x4e')](_0x2f1bc5['query'][_0xdc71('0x4e')]));_0x256d70['attributes']=_0x256d70[_0xdc71('0x4f')][_0xdc71('0x50')]?_0x256d70[_0xdc71('0x4f')]:_0x2a5ccd[_0xdc71('0x49')];if(!_0x2f1bc5['query'][_0xdc71('0x51')](_0xdc71('0x52'))){_0x256d70['limit']=qs[_0xdc71('0x33')](_0x2f1bc5[_0xdc71('0x4d')][_0xdc71('0x33')]);_0x256d70[_0xdc71('0x32')]=qs[_0xdc71('0x32')](_0x2f1bc5['query'][_0xdc71('0x32')]);}_0x256d70[_0xdc71('0x53')]=qs[_0xdc71('0x54')](_0x2f1bc5[_0xdc71('0x4d')][_0xdc71('0x54')]);_0x256d70['where']=qs[_0xdc71('0x4b')](_['pick'](_0x2f1bc5[_0xdc71('0x4d')],_0x2a5ccd[_0xdc71('0x4b')]),_0x5b7326);if(_0x2f1bc5[_0xdc71('0x4d')][_0xdc71('0x55')]){_0x256d70[_0xdc71('0x56')]=_[_0xdc71('0x57')](_0x256d70[_0xdc71('0x56')],{'$or':_[_0xdc71('0x44')](_0x5b7326,function(_0x69f596){if(_0x69f596[_0xdc71('0x48')]!==_0xdc71('0x58')){var _0x5a2e5f={};_0x5a2e5f[_0x69f596[_0xdc71('0x3f')]]={'$like':'%'+_0x2f1bc5[_0xdc71('0x4d')][_0xdc71('0x55')]+'%'};return _0x5a2e5f;}})});}_0x256d70=_[_0xdc71('0x57')]({},_0x256d70,_0x2f1bc5['options']);var _0x4a776e={'where':_0x256d70[_0xdc71('0x56')]};return db[_0xdc71('0x45')][_0xdc71('0x31')](_0x4a776e)[_0xdc71('0x22')](function(_0x4523ab){_0x3264f3[_0xdc71('0x31')]=_0x4523ab;if(_0x2f1bc5['query']['includeAll']){_0x256d70['include']=[{'all':!![]}];}return db[_0xdc71('0x45')]['findAll'](_0x256d70);})[_0xdc71('0x22')](function(_0x57e540){_0x3264f3[_0xdc71('0x59')]=_0x57e540;return _0x3264f3;})[_0xdc71('0x22')](respondWithFilteredResult(_0x3fcd74,_0x256d70))[_0xdc71('0x2c')](handleError(_0x3fcd74,null));};exports[_0xdc71('0x5a')]=function(_0xf9fcb4,_0x5adc61){var _0x4fa592={'raw':![],'where':{'id':_0xf9fcb4[_0xdc71('0x5b')]['id']},'include':[{'model':db[_0xdc71('0x42')],'as':_0xdc71('0x43')}]},_0x1a1e1f={};_0x1a1e1f['model']=_[_0xdc71('0x4a')](db['WhatsappAccount'][_0xdc71('0x46')]);_0x1a1e1f[_0xdc71('0x4d')]=_['keys'](_0xf9fcb4['query']);_0x1a1e1f['filters']=_['intersection'](_0x1a1e1f[_0xdc71('0x49')],_0x1a1e1f['query']);_0x4fa592['attributes']=_[_0xdc71('0x4c')](_0x1a1e1f[_0xdc71('0x49')],qs[_0xdc71('0x4e')](_0xf9fcb4['query'][_0xdc71('0x4e')]));_0x4fa592[_0xdc71('0x4f')]=_0x4fa592[_0xdc71('0x4f')][_0xdc71('0x50')]?_0x4fa592[_0xdc71('0x4f')]:_0x1a1e1f[_0xdc71('0x49')];if(_0xf9fcb4[_0xdc71('0x4d')][_0xdc71('0x5c')]){_0x4fa592[_0xdc71('0x5d')]=[{'all':!![]}];}_0x4fa592=_[_0xdc71('0x57')]({},_0x4fa592,_0xf9fcb4[_0xdc71('0x5e')]);return db[_0xdc71('0x45')][_0xdc71('0x5f')](_0x4fa592)[_0xdc71('0x22')](handleEntityNotFound(_0x5adc61,null))[_0xdc71('0x22')](respondWithResult(_0x5adc61,null))[_0xdc71('0x2c')](handleError(_0x5adc61,null));};exports['create']=function(_0x143dde,_0xdb7541){return db['WhatsappAccount']['create'](_0x143dde[_0xdc71('0x60')],{})[_0xdc71('0x22')](function(_0x4b2e9a){var _0x2e1c0d=_0x143dde[_0xdc71('0x61')]['get']({'plain':!![]});if(!_0x2e1c0d)throw new Error(_0xdc71('0x62'));if(_0x2e1c0d[_0xdc71('0x63')]===_0xdc71('0x61')){var _0x39e522=_0x4b2e9a['get']({'plain':!![]});var _0x886d5f=_0xdc71('0x3c');return db[_0xdc71('0x64')][_0xdc71('0x5f')]({'where':{'name':_0x886d5f,'userProfileId':_0x2e1c0d[_0xdc71('0x65')]},'raw':!![]})['then'](function(_0x11ce7d){if(_0x11ce7d&&_0x11ce7d[_0xdc71('0x66')]===0x0){return db[_0xdc71('0x3d')][_0xdc71('0x67')]({'name':_0x39e522[_0xdc71('0x3f')],'resourceId':_0x39e522['id'],'type':_0x11ce7d['name'],'sectionId':_0x11ce7d['id']},{})[_0xdc71('0x22')](function(){return _0x4b2e9a;});}else{return _0x4b2e9a;}})['catch'](function(_0xa5208d){logger['error'](_0xdc71('0x68'),_0xa5208d);throw _0xa5208d;});}return _0x4b2e9a;})['then'](respondWithResult(_0xdb7541,0xc9))[_0xdc71('0x2c')](handleError(_0xdb7541,null));};exports[_0xdc71('0x39')]=function(_0x2a2136,_0x374325){if(_0x2a2136[_0xdc71('0x60')]['id']){delete _0x2a2136['body']['id'];}return db['WhatsappAccount'][_0xdc71('0x5f')]({'where':{'id':_0x2a2136[_0xdc71('0x5b')]['id']},'include':[{'model':db[_0xdc71('0x42')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x374325,null))['then'](saveUpdates(_0x2a2136['body'],null))[_0xdc71('0x22')](respondWithResult(_0x374325,null))[_0xdc71('0x2c')](handleError(_0x374325,null));};exports[_0xdc71('0x3a')]=function(_0x4340a1,_0x3952f9){return db['WhatsappAccount'][_0xdc71('0x5f')]({'where':{'id':_0x4340a1[_0xdc71('0x5b')]['id']}})[_0xdc71('0x22')](handleEntityNotFound(_0x3952f9,null))[_0xdc71('0x22')](removeEntity(_0x3952f9,null))['catch'](handleError(_0x3952f9,null));};exports[_0xdc71('0x69')]=function(_0x1c4384,_0x16f0c4){return db['WhatsappAccount'][_0xdc71('0x69')]()[_0xdc71('0x22')](respondWithResult(_0x16f0c4,null))[_0xdc71('0x2c')](handleError(_0x16f0c4,null));};exports[_0xdc71('0x6a')]=function(_0x5e704d,_0x12c2b2,_0x57188e){if(_0x5e704d[_0xdc71('0x60')]['id']){delete _0x5e704d[_0xdc71('0x60')]['id'];}return db[_0xdc71('0x45')][_0xdc71('0x5f')]({'where':{'id':_0x5e704d[_0xdc71('0x5b')]['id']}})[_0xdc71('0x22')](handleEntityNotFound(_0x12c2b2,null))[_0xdc71('0x22')](function(_0x53ec18){if(_0x53ec18){_0x5e704d[_0xdc71('0x60')]['WhatsappAccountId']=_0x53ec18['id'];return db[_0xdc71('0x6b')][_0xdc71('0x67')](_0x5e704d[_0xdc71('0x60')]);}})[_0xdc71('0x22')](respondWithResult(_0x12c2b2,null))[_0xdc71('0x2c')](handleError(_0x12c2b2,null));};exports[_0xdc71('0x6c')]=function(_0x1c4c21,_0x38e173,_0xe14cae){var _0x3c1702={'raw':![],'where':{}};var _0x4d18d2={};var _0x5c4bf2={'count':0x0,'rows':[]};return db[_0xdc71('0x45')]['findOne']({'where':{'id':_0x1c4c21['params']['id']}})['then'](handleEntityNotFound(_0x38e173,null))['then'](function(_0x11786c){if(_0x11786c){_0x4d18d2[_0xdc71('0x49')]=_[_0xdc71('0x4a')](db[_0xdc71('0x6b')][_0xdc71('0x46')]);_0x4d18d2[_0xdc71('0x4d')]=_[_0xdc71('0x4a')](_0x1c4c21['query']);_0x4d18d2[_0xdc71('0x4b')]=_[_0xdc71('0x4c')](_0x4d18d2[_0xdc71('0x49')],_0x4d18d2[_0xdc71('0x4d')]);_0x3c1702[_0xdc71('0x4f')]=_[_0xdc71('0x4c')](_0x4d18d2[_0xdc71('0x49')],qs['fields'](_0x1c4c21[_0xdc71('0x4d')]['fields']));_0x3c1702[_0xdc71('0x4f')]=_0x3c1702[_0xdc71('0x4f')]['length']?_0x3c1702[_0xdc71('0x4f')]:_0x4d18d2['model'];if(!_0x1c4c21[_0xdc71('0x4d')][_0xdc71('0x51')](_0xdc71('0x52'))){_0x3c1702[_0xdc71('0x33')]=qs[_0xdc71('0x33')](_0x1c4c21[_0xdc71('0x4d')][_0xdc71('0x33')]);_0x3c1702[_0xdc71('0x32')]=qs['offset'](_0x1c4c21[_0xdc71('0x4d')][_0xdc71('0x32')]);}_0x3c1702['order']=qs[_0xdc71('0x54')](_0x1c4c21['query'][_0xdc71('0x54')]);_0x3c1702[_0xdc71('0x56')]=qs[_0xdc71('0x4b')](_[_0xdc71('0x6d')](_0x1c4c21[_0xdc71('0x4d')],_0x4d18d2[_0xdc71('0x4b')]));_0x3c1702[_0xdc71('0x56')]['WhatsappAccountId']=_0x11786c['id'];if(_0x1c4c21[_0xdc71('0x4d')][_0xdc71('0x55')]){_0x3c1702[_0xdc71('0x56')]=_[_0xdc71('0x57')](_0x3c1702[_0xdc71('0x56')],{'$or':_[_0xdc71('0x44')](_0x3c1702[_0xdc71('0x4f')],function(_0x14fe4d){var _0x599362={};_0x599362[_0x14fe4d]={'$like':'%'+_0x1c4c21['query'][_0xdc71('0x55')]+'%'};return _0x599362;})});}_0x3c1702=_[_0xdc71('0x57')]({},_0x3c1702,_0x1c4c21[_0xdc71('0x5e')]);return db['Disposition'][_0xdc71('0x31')]({'where':_0x3c1702[_0xdc71('0x56')]})[_0xdc71('0x22')](function(_0x4dc4da){_0x5c4bf2['count']=_0x4dc4da;if(_0x1c4c21[_0xdc71('0x4d')]['includeAll']){_0x3c1702[_0xdc71('0x5d')]=[{'all':!![]}];}return db[_0xdc71('0x6b')][_0xdc71('0x6e')](_0x3c1702);})['then'](function(_0x1b251d){_0x5c4bf2[_0xdc71('0x59')]=_0x1b251d;return _0x5c4bf2;});}})[_0xdc71('0x22')](respondWithFilteredResult(_0x38e173,_0x3c1702))['catch'](handleError(_0x38e173,null));};exports[_0xdc71('0x6f')]=function(_0x3d8bf7,_0x10bf80,_0xa09e2f){return db[_0xdc71('0x45')][_0xdc71('0x5f')]({'where':{'id':_0x3d8bf7[_0xdc71('0x5b')]['id']}})[_0xdc71('0x22')](handleEntityNotFound(_0x10bf80,null))['then'](function(_0x2c330e){if(_0x2c330e){return _0x2c330e['removeDispositions'](_0x3d8bf7['query'][_0xdc71('0x70')]);}})[_0xdc71('0x22')](respondWithStatusCode(_0x10bf80,null))[_0xdc71('0x2c')](handleError(_0x10bf80,null));};exports[_0xdc71('0x71')]=function(_0x413bf5,_0x7ae1cd,_0x56332e){if(_0x413bf5[_0xdc71('0x60')]['id']){delete _0x413bf5[_0xdc71('0x60')]['id'];}return db[_0xdc71('0x45')][_0xdc71('0x5f')]({'where':{'id':_0x413bf5[_0xdc71('0x5b')]['id']}})['then'](handleEntityNotFound(_0x7ae1cd,null))[_0xdc71('0x22')](function(_0x173c32){if(_0x173c32){_0x413bf5['body'][_0xdc71('0x72')]=_0x173c32['id'];return db[_0xdc71('0x73')]['create'](_0x413bf5[_0xdc71('0x60')]);}})['then'](respondWithResult(_0x7ae1cd,null))[_0xdc71('0x2c')](handleError(_0x7ae1cd,null));};exports[_0xdc71('0x74')]=function(_0x4ef337,_0x364752,_0x355864){var _0x516495={'raw':![],'where':{}};var _0x509018={};var _0x5589fd={'count':0x0,'rows':[]};return db[_0xdc71('0x45')]['findOne']({'where':{'id':_0x4ef337[_0xdc71('0x5b')]['id']}})['then'](handleEntityNotFound(_0x364752,null))[_0xdc71('0x22')](function(_0x59576e){if(_0x59576e){_0x509018['model']=_[_0xdc71('0x4a')](db[_0xdc71('0x73')][_0xdc71('0x46')]);_0x509018[_0xdc71('0x4d')]=_[_0xdc71('0x4a')](_0x4ef337['query']);_0x509018['filters']=_['intersection'](_0x509018[_0xdc71('0x49')],_0x509018[_0xdc71('0x4d')]);_0x516495[_0xdc71('0x4f')]=_[_0xdc71('0x4c')](_0x509018[_0xdc71('0x49')],qs[_0xdc71('0x4e')](_0x4ef337[_0xdc71('0x4d')][_0xdc71('0x4e')]));_0x516495['attributes']=_0x516495['attributes']['length']?_0x516495[_0xdc71('0x4f')]:_0x509018[_0xdc71('0x49')];if(!_0x4ef337[_0xdc71('0x4d')][_0xdc71('0x51')](_0xdc71('0x52'))){_0x516495['limit']=qs[_0xdc71('0x33')](_0x4ef337['query']['limit']);_0x516495['offset']=qs[_0xdc71('0x32')](_0x4ef337[_0xdc71('0x4d')][_0xdc71('0x32')]);}_0x516495[_0xdc71('0x53')]=qs[_0xdc71('0x54')](_0x4ef337[_0xdc71('0x4d')][_0xdc71('0x54')]);_0x516495[_0xdc71('0x56')]=qs[_0xdc71('0x4b')](_[_0xdc71('0x6d')](_0x4ef337[_0xdc71('0x4d')],_0x509018['filters']));_0x516495[_0xdc71('0x56')][_0xdc71('0x72')]=_0x59576e['id'];if(_0x4ef337[_0xdc71('0x4d')][_0xdc71('0x55')]){_0x516495['where']=_['merge'](_0x516495[_0xdc71('0x56')],{'$or':_[_0xdc71('0x44')](_0x516495[_0xdc71('0x4f')],function(_0x1df34e){var _0x42215b={};_0x42215b[_0x1df34e]={'$like':'%'+_0x4ef337['query'][_0xdc71('0x55')]+'%'};return _0x42215b;})});}_0x516495=_[_0xdc71('0x57')]({},_0x516495,_0x4ef337[_0xdc71('0x5e')]);return db[_0xdc71('0x73')]['count']({'where':_0x516495[_0xdc71('0x56')]})[_0xdc71('0x22')](function(_0x2aac36){_0x5589fd[_0xdc71('0x31')]=_0x2aac36;if(_0x4ef337[_0xdc71('0x4d')]['includeAll']){_0x516495[_0xdc71('0x5d')]=[{'all':!![]}];}return db[_0xdc71('0x73')]['findAll'](_0x516495);})['then'](function(_0x14ff81){_0x5589fd[_0xdc71('0x59')]=_0x14ff81;return _0x5589fd;});}})[_0xdc71('0x22')](respondWithFilteredResult(_0x364752,_0x516495))[_0xdc71('0x2c')](handleError(_0x364752,null));};exports['removeAnswers']=function(_0x31a6c6,_0x2e2642,_0x4e9cb2){return db[_0xdc71('0x45')][_0xdc71('0x5f')]({'where':{'id':_0x31a6c6['params']['id']}})[_0xdc71('0x22')](handleEntityNotFound(_0x2e2642,null))[_0xdc71('0x22')](function(_0x204ac3){if(_0x204ac3){return _0x204ac3[_0xdc71('0x75')](_0x31a6c6[_0xdc71('0x4d')][_0xdc71('0x70')]);}})[_0xdc71('0x22')](respondWithStatusCode(_0x2e2642,null))[_0xdc71('0x2c')](handleError(_0x2e2642,null));};exports[_0xdc71('0x76')]=function(_0x5c6665,_0x211510,_0x465eb8){return db['WhatsappAccount']['find']({'where':{'id':_0x5c6665[_0xdc71('0x5b')]['id']}})[_0xdc71('0x22')](handleEntityNotFound(_0x211510,null))['then'](function(_0x42a34e){if(_0x42a34e){return _0x42a34e[_0xdc71('0x76')](_0x5c6665[_0xdc71('0x60')][_0xdc71('0x70')],_[_0xdc71('0x77')](_0x5c6665['body'],[_0xdc71('0x70'),'id'])||{})[_0xdc71('0x78')](function(_0xdbb584){for(var _0x40e495=0x0;_0x40e495<_0x5c6665[_0xdc71('0x60')][_0xdc71('0x70')]['length'];_0x40e495+=0x1){socket['emit']('userWhatsappAccount:save',{'UserId':Number(_0x5c6665[_0xdc71('0x60')][_0xdc71('0x70')][_0x40e495]),'WhatsappAccountId':Number(_0x5c6665[_0xdc71('0x5b')]['id'])});}return _0xdbb584;});}})[_0xdc71('0x22')](respondWithResult(_0x211510,null))['catch'](handleError(_0x211510,null));};exports[_0xdc71('0x79')]=function(_0x4b5271,_0x1d1a47,_0x44e771){return db[_0xdc71('0x45')][_0xdc71('0x5f')]({'where':{'id':_0x4b5271[_0xdc71('0x5b')]['id']}})[_0xdc71('0x22')](handleEntityNotFound(_0x1d1a47,null))[_0xdc71('0x22')](function(_0x5b6edb){if(_0x5b6edb){return _0x5b6edb['removeAgents'](_0x4b5271[_0xdc71('0x4d')]['ids'])[_0xdc71('0x22')](function(){if(_[_0xdc71('0x7a')](_0x4b5271[_0xdc71('0x4d')][_0xdc71('0x70')])){for(var _0x2dc0f8=0x0;_0x2dc0f8<_0x4b5271[_0xdc71('0x4d')][_0xdc71('0x70')]['length'];_0x2dc0f8+=0x1){socket[_0xdc71('0x7b')](_0xdc71('0x7c'),{'UserId':Number(_0x4b5271[_0xdc71('0x4d')]['ids'][_0x2dc0f8]),'WhatsappAccountId':Number(_0x4b5271[_0xdc71('0x5b')]['id'])});}}else{socket[_0xdc71('0x7b')](_0xdc71('0x7c'),{'UserId':Number(_0x4b5271[_0xdc71('0x4d')]['ids']),'WhatsappAccountId':Number(_0x4b5271[_0xdc71('0x5b')]['id'])});}});}})[_0xdc71('0x22')](respondWithStatusCode(_0x1d1a47,null))[_0xdc71('0x2c')](handleError(_0x1d1a47,null));};exports[_0xdc71('0x7d')]=function(_0x5a43fa,_0x507a65,_0xa318a2){var _0x42d940={};var _0x25d1c8={};var _0x127b1e;var _0x517925;return db[_0xdc71('0x45')][_0xdc71('0x7e')]({'where':{'id':_0x5a43fa[_0xdc71('0x5b')]['id']}})[_0xdc71('0x22')](handleEntityNotFound(_0x507a65,null))[_0xdc71('0x22')](function(_0x2a6f7b){if(_0x2a6f7b){_0x127b1e=_0x2a6f7b;_0x25d1c8[_0xdc71('0x49')]=_[_0xdc71('0x4a')](db[_0xdc71('0x7f')][_0xdc71('0x46')]);_0x25d1c8[_0xdc71('0x4d')]=_['keys'](_0x5a43fa['query']);_0x25d1c8[_0xdc71('0x4b')]=_[_0xdc71('0x4c')](_0x25d1c8[_0xdc71('0x49')],_0x25d1c8['query']);_0x42d940[_0xdc71('0x4f')]=_[_0xdc71('0x4c')](_0x25d1c8[_0xdc71('0x49')],qs[_0xdc71('0x4e')](_0x5a43fa['query'][_0xdc71('0x4e')]));_0x42d940[_0xdc71('0x4f')]=_0x42d940[_0xdc71('0x4f')][_0xdc71('0x50')]?_0x42d940[_0xdc71('0x4f')]:_0x25d1c8[_0xdc71('0x49')];_0x42d940[_0xdc71('0x53')]=qs[_0xdc71('0x54')](_0x5a43fa[_0xdc71('0x4d')]['sort']);_0x42d940[_0xdc71('0x56')]=qs[_0xdc71('0x4b')](_[_0xdc71('0x6d')](_0x5a43fa[_0xdc71('0x4d')],_0x25d1c8[_0xdc71('0x4b')]));if(_0x5a43fa[_0xdc71('0x4d')][_0xdc71('0x55')]){_0x42d940[_0xdc71('0x56')]=_[_0xdc71('0x57')](_0x42d940[_0xdc71('0x56')],{'$or':_[_0xdc71('0x44')](_0x42d940[_0xdc71('0x4f')],function(_0xf61bd3){var _0x2de9c4={};_0x2de9c4[_0xf61bd3]={'$like':'%'+_0x5a43fa[_0xdc71('0x4d')][_0xdc71('0x55')]+'%'};return _0x2de9c4;})});}_0x42d940=_['merge']({},_0x42d940,_0x5a43fa['options']);return _0x127b1e[_0xdc71('0x7d')](_0x42d940);}})['then'](function(_0x268030){if(_0x268030){_0x517925=_0x268030[_0xdc71('0x50')];if(!_0x5a43fa[_0xdc71('0x4d')]['hasOwnProperty'](_0xdc71('0x52'))){_0x42d940[_0xdc71('0x33')]=qs[_0xdc71('0x33')](_0x5a43fa[_0xdc71('0x4d')][_0xdc71('0x33')]);_0x42d940[_0xdc71('0x32')]=qs[_0xdc71('0x32')](_0x5a43fa[_0xdc71('0x4d')][_0xdc71('0x32')]);}return _0x127b1e[_0xdc71('0x7d')](_0x42d940);}})['then'](function(_0x3ef3da){if(_0x3ef3da){return _0x3ef3da?{'count':_0x517925,'rows':_0x3ef3da}:null;}})[_0xdc71('0x22')](respondWithResult(_0x507a65,null))[_0xdc71('0x2c')](handleError(_0x507a65,null));};exports['addApplications']=function(_0x573c07,_0x52b719,_0x5badbc){return db[_0xdc71('0x45')][_0xdc71('0x7e')]({'where':{'id':_0x573c07[_0xdc71('0x5b')]['id']}})[_0xdc71('0x22')](handleEntityNotFound(_0x52b719,null))['then'](function(_0x414538){if(_0x414538){return db[_0xdc71('0x80')][_0xdc71('0x81')](function(_0x2a33cb){return db[_0xdc71('0x82')][_0xdc71('0x3a')]({'where':{'WhatsappAccountId':_0x573c07[_0xdc71('0x5b')]['id']},'transaction':_0x2a33cb})['then'](function(_0x215fe3){var _0x18d0f9=_[_0xdc71('0x44')](_0x573c07['body'],function(_0x1744f9){_0x1744f9[_0xdc71('0x72')]=_0x573c07['params']['id'];return _0x1744f9;});return db[_0xdc71('0x82')][_0xdc71('0x83')](_0x18d0f9,{'transaction':_0x2a33cb});});})[_0xdc71('0x22')](function(){return db[_0xdc71('0x82')][_0xdc71('0x84')]({'where':{'WhatsappAccountId':_0x573c07['params']['id']},'order':_0xdc71('0x85')});});}})[_0xdc71('0x22')](respondWithResult(_0x52b719,null))['catch'](handleError(_0x52b719,null));};exports[_0xdc71('0x86')]=function(_0x2b3bfb,_0x25827d,_0x253374){var _0x368b2c={};var _0x5f42f2={};var _0xfda3ef;var _0xe3e4ca;return db[_0xdc71('0x45')]['findOne']({'where':{'id':_0x2b3bfb[_0xdc71('0x5b')]['id']}})[_0xdc71('0x22')](handleEntityNotFound(_0x25827d,null))[_0xdc71('0x22')](function(_0x5d5d1b){if(_0x5d5d1b){_0xfda3ef=_0x5d5d1b;_0x5f42f2[_0xdc71('0x49')]=_['keys'](db[_0xdc71('0x82')][_0xdc71('0x46')]);_0x5f42f2[_0xdc71('0x4d')]=_[_0xdc71('0x4a')](_0x2b3bfb[_0xdc71('0x4d')]);_0x5f42f2[_0xdc71('0x4b')]=_[_0xdc71('0x4c')](_0x5f42f2['model'],_0x5f42f2[_0xdc71('0x4d')]);_0x368b2c[_0xdc71('0x4f')]=_[_0xdc71('0x4c')](_0x5f42f2[_0xdc71('0x49')],qs['fields'](_0x2b3bfb[_0xdc71('0x4d')][_0xdc71('0x4e')]));_0x368b2c[_0xdc71('0x4f')]=_0x368b2c[_0xdc71('0x4f')][_0xdc71('0x50')]?_0x368b2c[_0xdc71('0x4f')]:_0x5f42f2[_0xdc71('0x49')];_0x368b2c['order']=qs[_0xdc71('0x54')](_0x2b3bfb[_0xdc71('0x4d')][_0xdc71('0x54')]);_0x368b2c[_0xdc71('0x56')]=qs[_0xdc71('0x4b')](_[_0xdc71('0x6d')](_0x2b3bfb[_0xdc71('0x4d')],_0x5f42f2[_0xdc71('0x4b')]));if(_0x2b3bfb[_0xdc71('0x4d')]['filter']){_0x368b2c[_0xdc71('0x56')]=_[_0xdc71('0x57')](_0x368b2c[_0xdc71('0x56')],{'$or':_['map'](_0x368b2c[_0xdc71('0x4f')],function(_0x4a5c53){var _0x56d7b5={};_0x56d7b5[_0x4a5c53]={'$like':'%'+_0x2b3bfb[_0xdc71('0x4d')]['filter']+'%'};return _0x56d7b5;})});}_0x368b2c=_[_0xdc71('0x57')]({},_0x368b2c,_0x2b3bfb[_0xdc71('0x5e')]);return _0xfda3ef['getApplications'](_0x368b2c);}})[_0xdc71('0x22')](function(_0xd362ee){if(_0xd362ee){_0xe3e4ca=_0xd362ee[_0xdc71('0x50')];if(!_0x2b3bfb[_0xdc71('0x4d')][_0xdc71('0x51')](_0xdc71('0x52'))){_0x368b2c[_0xdc71('0x33')]=qs['limit'](_0x2b3bfb[_0xdc71('0x4d')][_0xdc71('0x33')]);_0x368b2c['offset']=qs['offset'](_0x2b3bfb['query'][_0xdc71('0x32')]);}return _0xfda3ef[_0xdc71('0x86')](_0x368b2c);}})[_0xdc71('0x22')](function(_0x3c775e){if(_0x3c775e){return _0x3c775e?{'count':_0xe3e4ca,'rows':_0x3c775e}:null;}})['then'](respondWithResult(_0x25827d,null))[_0xdc71('0x2c')](handleError(_0x25827d,null));};exports['notify']=function(_0x323fe0,_0x132a9b,_0x47ffe2){var _0x25a58e={'channel':_0xdc71('0x87')};var _0x1f141b=[];var _0x3665ee=[];var _0x4860eb={};return db[_0xdc71('0x45')][_0xdc71('0x5f')]({'where':{'id':_0x323fe0['params']['id']},'include':[{'model':db[_0xdc71('0x82')],'as':_0xdc71('0x88')}]})['then'](handleEntityNotFound(_0x132a9b,null))[_0xdc71('0x22')](function(_0x2134d0){_0x25a58e[_0xdc71('0x89')]=_0x2134d0;_0x25a58e[_0xdc71('0x8a')]=_['orderBy'](_0x2134d0[_0xdc71('0x88')],[_0xdc71('0x85')],[_0xdc71('0x8b')]);if(_0x25a58e[_0xdc71('0x89')]['Applications']){delete _0x25a58e[_0xdc71('0x89')][_0xdc71('0x88')];}return db[_0xdc71('0x8c')][_0xdc71('0x69')]();})[_0xdc71('0x22')](function(_0x48a855){if(!_0x48a855){throw new db[(_0xdc71('0x8d'))][(_0xdc71('0x8e'))](_0xdc71('0x8f'));}_0x1f141b=_['difference'](_[_0xdc71('0x4a')](_0x48a855),[_0xdc71('0x90'),_0xdc71('0x91')]);_0x3665ee=_[_0xdc71('0x92')](_[_0xdc71('0x4a')](_0x48a855),[_0xdc71('0x90'),_0xdc71('0x91'),_0xdc71('0x93'),_0xdc71('0x94')]);_0x25a58e[_0xdc71('0x60')]={'mapKey':_0xdc71('0x95')};if(_0x25a58e['account'][_0xdc71('0x48')]&&_0x25a58e[_0xdc71('0x89')][_0xdc71('0x48')]==='twilio'){_0x25a58e['body']['from']=_0x323fe0[_0xdc71('0x60')][_0xdc71('0x96')][_0xdc71('0x97')](_0xdc71('0x98'),'');_0x25a58e['body'][_0xdc71('0x60')]=_0x323fe0[_0xdc71('0x60')]['Body'];_0x25a58e['body'][_0xdc71('0x99')]=_0x323fe0[_0xdc71('0x60')][_0xdc71('0x9a')];}if(_0x25a58e[_0xdc71('0x60')]['id']){delete _0x25a58e[_0xdc71('0x60')]['id'];}if(_['isNil'](_0x25a58e['body'][_0xdc71('0x9b')])){throw new db[(_0xdc71('0x8d'))][(_0xdc71('0x8e'))](_0xdc71('0x9c'));}if(_['isNil'](_0x25a58e['body'][_0xdc71('0x60')])||_0x25a58e['body']['body']===''){throw new db[(_0xdc71('0x8d'))][(_0xdc71('0x8e'))](_0xdc71('0x9d'));}if(_['isNil'](_0x25a58e[_0xdc71('0x60')]['mapKey'])){throw new db['Sequelize'][(_0xdc71('0x8e'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3665ee);}if(!_['includes'](_0x3665ee,_0x25a58e[_0xdc71('0x60')][_0xdc71('0x9e')])){throw new db[(_0xdc71('0x8d'))][(_0xdc71('0x8e'))](_0xdc71('0x9f')+_0x3665ee);}_0x4860eb[_0x25a58e[_0xdc71('0x60')][_0xdc71('0x9e')]]=_0x25a58e[_0xdc71('0x60')][_0xdc71('0x9b')];return db[_0xdc71('0xa0')]['find']({'where':{'id':_0x25a58e[_0xdc71('0x89')]['ListId']},'include':[{'model':db['CmContact'],'as':_0xdc71('0xa1'),'where':_0x4860eb,'limit':0x1,'order':[[_0xdc71('0x91'),'DESC']]}]});})[_0xdc71('0x22')](handleEntityNotFound(_0x132a9b,null))['then'](function(_0x1212e2){if(_0x1212e2){_0x25a58e[_0xdc71('0xa2')]=_[_0xdc71('0x77')](_0x1212e2,[_0xdc71('0xa1')]);if(_0x1212e2[_0xdc71('0xa1')][_0xdc71('0x50')]){return _0x1212e2['Contacts'][0x0];}var _0x56ac42=_[_0xdc71('0x1a')](_0x25a58e['body'],{'firstName':_0x25a58e[_0xdc71('0x60')]['from'],'ListId':_0x1212e2['id']});_0x56ac42[_0x25a58e[_0xdc71('0x60')][_0xdc71('0x9e')]]=_0x25a58e[_0xdc71('0x60')][_0xdc71('0x9b')];return db[_0xdc71('0x8c')]['create'](_0x56ac42,{'fields':_0x1f141b,'raw':!![]});}})[_0xdc71('0x22')](handleEntityNotFound(_0x132a9b,null))[_0xdc71('0x22')](function(_0x162bc1){if(_0x162bc1){_0x25a58e[_0xdc71('0xa3')]=_0x162bc1;var _0x4fe838={'ContactId':_0x162bc1['id'],'phone':_0x25a58e[_0xdc71('0x60')][_0xdc71('0x9b')],'WhatsappAccountId':_0x323fe0[_0xdc71('0x5b')]['id']};var _0x4dbb59={'ContactId':_0x162bc1['id'],'WhatsappAccountId':_0x323fe0[_0xdc71('0x5b')]['id'],'closed':![]};return db[_0xdc71('0xa4')][_0xdc71('0x5f')]({'where':_0x4dbb59})[_0xdc71('0x22')](function(_0x23f786){if(_0x23f786){return[_0x23f786,![]];}return db[_0xdc71('0xa4')][_0xdc71('0x67')](_0x4fe838)[_0xdc71('0x22')](function(_0x8f4a3){return[_0x8f4a3,!![]];});});}})[_0xdc71('0x78')](function(_0x2d5354,_0xa6cb3d){_0x25a58e[_0xdc71('0xa5')]=_0x2d5354[_0xdc71('0x3b')]({'plain':!![]});_0x25a58e[_0xdc71('0xa5')][_0xdc71('0xa6')]=![];if(_0xa6cb3d){if(_0x25a58e[_0xdc71('0x89')][_0xdc71('0xa7')]){_0x25a58e[_0xdc71('0x8a')]['push']({'id':0x0,'priority':_0x25a58e[_0xdc71('0x8a')][_0xdc71('0x50')]+0x1,'app':_0xdc71('0xa8'),'appdata':_0xdc71('0xa9'),'interval':_0xdc71('0xaa')});}_0x25a58e['interaction']['created']=!![];}return db['WhatsappMessage'][_0xdc71('0x67')]({'phone':_0x25a58e[_0xdc71('0x60')][_0xdc71('0x9b')],'messageId':_0x25a58e['body'][_0xdc71('0x99')],'body':_0x25a58e[_0xdc71('0x60')][_0xdc71('0x60')],'WhatsappAccountId':_0x323fe0[_0xdc71('0x5b')]['id'],'WhatsappInteractionId':_0x2d5354['id'],'direction':'in','ContactId':_0x2d5354[_0xdc71('0xab')],'AttachmentId':_0x25a58e[_0xdc71('0x60')]['AttachmentId']});})['then'](function(_0x4ccb7a){_0x25a58e[_0xdc71('0x2b')]=_0x4ccb7a;if(_0x25a58e['interaction']['UserId']){return db[_0xdc71('0x7f')]['find']({'attributes':['id','name'],'where':{'id':_0x25a58e[_0xdc71('0xa5')][_0xdc71('0xac')]}})[_0xdc71('0x22')](function(_0x1fa9be){if(_0x1fa9be){_0x25a58e[_0xdc71('0x8a')][_0xdc71('0xad')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x1fa9be['name']+','+(_0x25a58e[_0xdc71('0x89')][_0xdc71('0xae')]||0xa),'interval':_0xdc71('0xaa')});}return respondWithRpcPromise('Start',_0xdc71('0xaf'),_0x25a58e);});}return respondWithRpcPromise(_0xdc71('0xb0'),_0xdc71('0xaf'),_0x25a58e);})[_0xdc71('0x22')](function(_0x3de5fe){if(_0x3de5fe){var _0x26524f=0xc8;var _0x513410=_0xdc71('0xb1');logger[_0xdc71('0x23')](_0xdc71('0x26'),_0x513410,_0x26524f,_0xdc71('0xb2'));logger[_0xdc71('0x25')](_0xdc71('0xb3'),_0x513410,_0x26524f,_0xdc71('0xb2'),JSON[_0xdc71('0x27')](_0x3de5fe));if(_0x25a58e[_0xdc71('0x89')][_0xdc71('0x48')]===_0xdc71('0xb4')){return _0x132a9b[_0xdc71('0x2e')](_0x26524f)[_0xdc71('0x34')](_0xdc71('0xb5'),_0xdc71('0xb6'))['send']('<?xml\x20version=\x221.0\x22\x20encoding=\x22UTF-8\x22?>\x0a<Response></Response>');}else{return _0x132a9b[_0xdc71('0x2e')](_0x26524f)[_0xdc71('0x2f')](_0x3de5fe);}}})[_0xdc71('0x2c')](handleError(_0x132a9b,null));};exports[_0xdc71('0x40')]=function(_0x3c1bac,_0x54e162,_0x334dd7){var _0x14279a,_0x25f36e,_0x4d406a;if(_[_0xdc71('0xb7')](_0x3c1bac['body'][_0xdc71('0x60')])||_0x3c1bac[_0xdc71('0x60')]['body']===''){throw new db[(_0xdc71('0x8d'))]['ValidationError'](_0xdc71('0x9d'));}if(_[_0xdc71('0xb7')](_0x3c1bac[_0xdc71('0x60')]['to'])){throw new db[(_0xdc71('0x8d'))][(_0xdc71('0x8e'))](_0xdc71('0xb8'));}_0x14279a=_0x3c1bac[_0xdc71('0x60')]['to'];return db['WhatsappAccount'][_0xdc71('0x5f')]({'where':{'id':_0x3c1bac[_0xdc71('0x5b')]['id']},'include':[{'model':db[_0xdc71('0xa0')],'as':_0xdc71('0xb9'),'include':[{'model':db[_0xdc71('0x8c')],'as':_0xdc71('0xa1'),'where':{'mobile':_0x14279a},'limit':0x1,'order':[[_0xdc71('0x91'),_0xdc71('0xba')]]}]}]})[_0xdc71('0x22')](handleEntityNotFound(_0x54e162,null))['then'](function(_0x25d702){if(_0x25d702&&_0x25d702['List']){_0x25f36e=_0x25d702[_0xdc71('0x3b')]({'plain':!![]});if(_0x25f36e[_0xdc71('0xb9')]&&_0x25f36e['List'][_0xdc71('0xa1')][_0xdc71('0x50')]){return _0x25f36e[_0xdc71('0xb9')][_0xdc71('0xa1')][0x0];}return db[_0xdc71('0x8c')][_0xdc71('0x67')](_[_0xdc71('0x1a')](_0x3c1bac['body'],{'firstName':_0x14279a,'mobile':_0x14279a,'phone':_0x14279a,'ListId':_0x25f36e[_0xdc71('0x94')]}));}})['then'](handleEntityNotFound(_0x54e162,null))[_0xdc71('0x22')](function(_0x8e99a7){if(_0x8e99a7){_0x4d406a=_0x8e99a7;return db['WhatsappInteraction'][_0xdc71('0x5f')]({'where':{'ContactId':_0x4d406a['id'],'closed':![],'WhatsappAccountId':_0x25f36e['id']}})[_0xdc71('0x22')](function(_0x51d4ba){if(_0x51d4ba){return[_0x51d4ba,![]];}return db['WhatsappInteraction'][_0xdc71('0x67')]({'UserId':_0x3c1bac[_0xdc71('0x61')]['id'],'ContactId':_0x4d406a['id'],'WhatsappAccountId':_0x25f36e['id'],'phone':_0x14279a,'firstMsgDirection':_0xdc71('0xbb'),'Messages':[_['merge'](_0x3c1bac[_0xdc71('0x60')],{'read':![],'body':_0x3c1bac['body'][_0xdc71('0x60')],'phone':_0x14279a,'WhatsappAccountId':_0x25f36e['id'],'UserId':_0x3c1bac[_0xdc71('0x61')]['id'],'ContactId':_0x4d406a['id']})]},{'include':[{'model':db[_0xdc71('0xbc')],'as':_0xdc71('0xbd')}]})['then'](function(_0x14e8e3){return[_0x14e8e3,!![]];});});}})[_0xdc71('0x78')](function(_0x1686a5,_0xa002ed){if(_0xa002ed){return _0x1686a5;}return db['WhatsappMessage'][_0xdc71('0x67')](_[_0xdc71('0x57')](_0x3c1bac[_0xdc71('0x60')],{'read':![],'body':_0x3c1bac[_0xdc71('0x60')][_0xdc71('0x60')],'phone':_0x14279a,'WhatsappAccountId':_0x25f36e['id'],'WhatsappInteractionId':_0x1686a5['id'],'UserId':_0x3c1bac[_0xdc71('0x61')]['id'],'ContactId':_0x4d406a['id']}))[_0xdc71('0x22')](function(_0x35d4d2){_0x1686a5['dataValues'][_0xdc71('0xbd')]=[];_0x1686a5[_0xdc71('0xbe')][_0xdc71('0xbd')]['push'](_0x35d4d2['dataValues']);return _0x1686a5;});})['then'](respondWithResult(_0x54e162,null))[_0xdc71('0x2c')](handleError(_0x54e162,null));};
\ No newline at end of file
index 8851882..2b7f53a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf51e=['setMaxListeners','update','remove','emit','hook','exports','events','../../mysqldb','WhatsappAccount'];(function(_0x32abb9,_0x5f0d36){var _0xbaa5f5=function(_0x52670e){while(--_0x52670e){_0x32abb9['push'](_0x32abb9['shift']());}};_0xbaa5f5(++_0x5f0d36);}(_0xf51e,0x1c8));var _0xef51=function(_0x4f3f9,_0x3bd41f){_0x4f3f9=_0x4f3f9-0x0;var _0x3eb034=_0xf51e[_0x4f3f9];return _0x3eb034;};'use strict';var EventEmitter=require(_0xef51('0x0'));var WhatsappAccount=require(_0xef51('0x1'))['db'][_0xef51('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xef51('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xef51('0x4'),'afterDestroy':_0xef51('0x5')};function emitEvent(_0x59772c){return function(_0x3a169e,_0x51d94c,_0x5ab1e6){WhatsappAccountEvents[_0xef51('0x6')](_0x59772c+':'+_0x3a169e['id'],_0x3a169e);WhatsappAccountEvents[_0xef51('0x6')](_0x59772c,_0x3a169e);_0x5ab1e6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0xef51('0x7')](e,emitEvent(event));}}module[_0xef51('0x8')]=WhatsappAccountEvents;
\ No newline at end of file
+var _0xed5c=['exports','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','remove','hook'];(function(_0x52c340,_0x447cd2){var _0x445eac=function(_0xb7a26b){while(--_0xb7a26b){_0x52c340['push'](_0x52c340['shift']());}};_0x445eac(++_0x447cd2);}(_0xed5c,0x121));var _0xced5=function(_0x3848df,_0x1a8ae4){_0x3848df=_0x3848df-0x0;var _0xf9eed5=_0xed5c[_0x3848df];return _0xf9eed5;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0xced5('0x0'))['db'][_0xced5('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0xced5('0x2')](0x0);var events={'afterCreate':_0xced5('0x3'),'afterUpdate':_0xced5('0x4'),'afterDestroy':_0xced5('0x5')};function emitEvent(_0x11acec){return function(_0x57f9a4,_0x4842d4,_0x2ff2fa){WhatsappAccountEvents['emit'](_0x11acec+':'+_0x57f9a4['id'],_0x57f9a4);WhatsappAccountEvents['emit'](_0x11acec,_0x57f9a4);_0x2ff2fa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0xced5('0x6')](e,emitEvent(event));}}module[_0xced5('0x7')]=WhatsappAccountEvents;
\ No newline at end of file
index 58a046e..9cbc376 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0358=['whatsapp_accounts','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports','define','WhatsappAccount'];(function(_0x3d3378,_0x5ced43){var _0x1f2276=function(_0xcfcf4b){while(--_0xcfcf4b){_0x3d3378['push'](_0x3d3378['shift']());}};_0x1f2276(++_0x5ced43);}(_0x0358,0x1ef));var _0x8035=function(_0x1d8dd6,_0x38f846){_0x1d8dd6=_0x1d8dd6-0x0;var _0x9da036=_0x0358[_0x1d8dd6];return _0x9da036;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8035('0x0'))(_0x8035('0x1'));var moment=require(_0x8035('0x2'));var BPromise=require(_0x8035('0x3'));var rp=require(_0x8035('0x4'));var fs=require('fs');var path=require(_0x8035('0x5'));var rimraf=require(_0x8035('0x6'));var config=require(_0x8035('0x7'));var attributes=require(_0x8035('0x8'));module[_0x8035('0x9')]=function(_0x30b801,_0x4b0df5){return _0x30b801[_0x8035('0xa')](_0x8035('0xb'),attributes,{'tableName':_0x8035('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5996=['../../config/logger','moment','rimraf','define','WhatsappAccount','lodash','util'];(function(_0x3c001e,_0x293e88){var _0x29e37b=function(_0x7cd6cc){while(--_0x7cd6cc){_0x3c001e['push'](_0x3c001e['shift']());}};_0x29e37b(++_0x293e88);}(_0x5996,0x124));var _0x6599=function(_0x340512,_0x4b1954){_0x340512=_0x340512-0x0;var _0x1b2de4=_0x5996[_0x340512];return _0x1b2de4;};'use strict';var _=require(_0x6599('0x0'));var util=require(_0x6599('0x1'));var logger=require(_0x6599('0x2'))('api');var moment=require(_0x6599('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6599('0x4'));var config=require('../../config/environment');var attributes=require('./whatsappAccount.attributes');module['exports']=function(_0x5ef89e,_0x3feb5e){return _0x5ef89e[_0x6599('0x5')](_0x6599('0x6'),attributes,{'tableName':'whatsapp_accounts','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index b676719..2cf1da6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbc8b=['randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','register','request','then','info','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','WhatsappAccount','raw','options','where','attributes','include','map','model','debug','ShowWhatsappAccount','stringify','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc8b,0x1bf));var _0xbbc8=function(_0x11155f,_0x57b687){_0x11155f=_0x11155f-0x0;var _0xd07e48=_0xbc8b[_0x11155f];return _0xd07e48;};'use strict';var _=require(_0xbbc8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbbc8('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbbc8('0x2'));var logger=require(_0xbbc8('0x3'))(_0xbbc8('0x4'));var config=require('../../config/environment');var jayson=require(_0xbbc8('0x5'));var client=jayson[_0xbbc8('0x6')][_0xbbc8('0x7')]({'port':0x232a});config[_0xbbc8('0x8')]=_[_0xbbc8('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbbc8('0x8')]));require('./whatsappAccount.socket')[_0xbbc8('0xa')](socket);function respondWithRpcPromise(_0x1d38c2,_0x428323,_0x60b805){return new BPromise(function(_0x4490f5,_0x5c3404){return client[_0xbbc8('0xb')](_0x1d38c2,_0x60b805)[_0xbbc8('0xc')](function(_0x1b06f3){logger[_0xbbc8('0xd')]('WhatsappAccount,\x20%s,\x20%s',_0x428323,_0xbbc8('0xe'));logger['debug'](_0xbbc8('0xf'),_0x428323,_0xbbc8('0xe'),JSON['stringify'](_0x1b06f3));if(_0x1b06f3[_0xbbc8('0x10')]){if(_0x1b06f3[_0xbbc8('0x10')][_0xbbc8('0x11')]===0x1f4){logger[_0xbbc8('0x10')](_0xbbc8('0x12'),_0x428323,_0x1b06f3['error'][_0xbbc8('0x13')]);return _0x5c3404(_0x1b06f3[_0xbbc8('0x10')]['message']);}logger[_0xbbc8('0x10')](_0xbbc8('0x12'),_0x428323,_0x1b06f3[_0xbbc8('0x10')]['message']);return _0x4490f5(_0x1b06f3['error'][_0xbbc8('0x13')]);}else{logger[_0xbbc8('0xd')]('WhatsappAccount,\x20%s,\x20%s',_0x428323,_0xbbc8('0xe'));_0x4490f5(_0x1b06f3[_0xbbc8('0x14')][_0xbbc8('0x13')]);}})['catch'](function(_0x36bea4){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x428323,_0x36bea4);_0x5c3404(_0x36bea4);});});}exports['ShowWhatsappAccount']=function(_0x4f4891){var _0xf654a3=this;return new Promise(function(_0x5af76c,_0x8015b2){return db[_0xbbc8('0x15')]['find']({'raw':_0x4f4891['options']?_0x4f4891['options'][_0xbbc8('0x16')]===undefined?!![]:![]:!![],'where':_0x4f4891[_0xbbc8('0x17')]?_0x4f4891[_0xbbc8('0x17')][_0xbbc8('0x18')]||null:null,'attributes':_0x4f4891[_0xbbc8('0x17')]?_0x4f4891['options'][_0xbbc8('0x19')]||null:null,'include':_0x4f4891['options']?_0x4f4891[_0xbbc8('0x17')][_0xbbc8('0x1a')]?_[_0xbbc8('0x1b')](_0x4f4891[_0xbbc8('0x17')][_0xbbc8('0x1a')],function(_0x4d565f){return{'model':db[_0x4d565f[_0xbbc8('0x1c')]],'as':_0x4d565f['as'],'attributes':_0x4d565f[_0xbbc8('0x19')],'include':_0x4d565f[_0xbbc8('0x1a')]?_[_0xbbc8('0x1b')](_0x4d565f['include'],function(_0x2f8657){return{'model':db[_0x2f8657[_0xbbc8('0x1c')]],'as':_0x2f8657['as'],'attributes':_0x2f8657['attributes'],'include':_0x2f8657[_0xbbc8('0x1a')]?_['map'](_0x2f8657[_0xbbc8('0x1a')],function(_0x3b8996){return{'model':db[_0x3b8996['model']],'as':_0x3b8996['as'],'attributes':_0x3b8996['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d96fb){logger['info']('ShowWhatsappAccount',_0x4f4891);logger[_0xbbc8('0x1d')](_0xbbc8('0x1e'),_0x4f4891,JSON[_0xbbc8('0x1f')](_0x5d96fb));_0x5af76c(_0x5d96fb);})['catch'](function(_0x1af959){logger[_0xbbc8('0x10')](_0xbbc8('0x1e'),_0x1af959['message'],_0x4f4891);_0x8015b2(_0xf654a3[_0xbbc8('0x10')](0x1f4,_0x1af959[_0xbbc8('0x13')]));});});};
\ No newline at end of file
+var _0xa1c4=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','debug','request\x20sent','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','WhatsappAccount','find','options','raw','attributes','include','map','model','ShowWhatsappAccount','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x3db8c5,_0x318920){var _0x219609=function(_0x3f43ac){while(--_0x3f43ac){_0x3db8c5['push'](_0x3db8c5['shift']());}};_0x219609(++_0x318920);}(_0xa1c4,0xdf));var _0x4a1c=function(_0x2a56ad,_0x2b94bf){_0x2a56ad=_0x2a56ad-0x0;var _0x425175=_0xa1c4[_0x2a56ad];return _0x425175;};'use strict';var _=require(_0x4a1c('0x0'));var util=require(_0x4a1c('0x1'));var moment=require(_0x4a1c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4a1c('0x3'));var db=require(_0x4a1c('0x4'))['db'];var utils=require(_0x4a1c('0x5'));var logger=require(_0x4a1c('0x6'))(_0x4a1c('0x7'));var config=require(_0x4a1c('0x8'));var jayson=require(_0x4a1c('0x9'));var client=jayson[_0x4a1c('0xa')]['http']({'port':0x232a});config[_0x4a1c('0xb')]=_[_0x4a1c('0xc')](config[_0x4a1c('0xb')],{'host':_0x4a1c('0xd'),'port':0x18eb});var socket=require(_0x4a1c('0xe'))(new Redis(config[_0x4a1c('0xb')]));require(_0x4a1c('0xf'))[_0x4a1c('0x10')](socket);function respondWithRpcPromise(_0x69c358,_0xe4dca2,_0x1d51da){return new BPromise(function(_0x408e9e,_0x2222fb){return client[_0x4a1c('0x11')](_0x69c358,_0x1d51da)[_0x4a1c('0x12')](function(_0x332029){logger[_0x4a1c('0x13')]('WhatsappAccount,\x20%s,\x20%s',_0xe4dca2,'request\x20sent');logger[_0x4a1c('0x14')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0xe4dca2,_0x4a1c('0x15'),JSON[_0x4a1c('0x16')](_0x332029));if(_0x332029[_0x4a1c('0x17')]){if(_0x332029[_0x4a1c('0x17')][_0x4a1c('0x18')]===0x1f4){logger[_0x4a1c('0x17')](_0x4a1c('0x19'),_0xe4dca2,_0x332029['error'][_0x4a1c('0x1a')]);return _0x2222fb(_0x332029[_0x4a1c('0x17')]['message']);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0xe4dca2,_0x332029[_0x4a1c('0x17')][_0x4a1c('0x1a')]);return _0x408e9e(_0x332029['error']['message']);}else{logger[_0x4a1c('0x13')](_0x4a1c('0x19'),_0xe4dca2,_0x4a1c('0x15'));_0x408e9e(_0x332029[_0x4a1c('0x1b')][_0x4a1c('0x1a')]);}})[_0x4a1c('0x1c')](function(_0x1899a3){logger[_0x4a1c('0x17')](_0x4a1c('0x19'),_0xe4dca2,_0x1899a3);_0x2222fb(_0x1899a3);});});}exports['ShowWhatsappAccount']=function(_0x2da804){var _0x5db552=this;return new Promise(function(_0xeaaf41,_0x23bfb2){return db[_0x4a1c('0x1d')][_0x4a1c('0x1e')]({'raw':_0x2da804[_0x4a1c('0x1f')]?_0x2da804[_0x4a1c('0x1f')][_0x4a1c('0x20')]===undefined?!![]:![]:!![],'where':_0x2da804[_0x4a1c('0x1f')]?_0x2da804[_0x4a1c('0x1f')]['where']||null:null,'attributes':_0x2da804[_0x4a1c('0x1f')]?_0x2da804[_0x4a1c('0x1f')][_0x4a1c('0x21')]||null:null,'include':_0x2da804[_0x4a1c('0x1f')]?_0x2da804[_0x4a1c('0x1f')][_0x4a1c('0x22')]?_[_0x4a1c('0x23')](_0x2da804[_0x4a1c('0x1f')][_0x4a1c('0x22')],function(_0xbb0599){return{'model':db[_0xbb0599[_0x4a1c('0x24')]],'as':_0xbb0599['as'],'attributes':_0xbb0599['attributes'],'include':_0xbb0599['include']?_['map'](_0xbb0599['include'],function(_0x3ced0b){return{'model':db[_0x3ced0b[_0x4a1c('0x24')]],'as':_0x3ced0b['as'],'attributes':_0x3ced0b['attributes'],'include':_0x3ced0b[_0x4a1c('0x22')]?_[_0x4a1c('0x23')](_0x3ced0b[_0x4a1c('0x22')],function(_0x432d1c){return{'model':db[_0x432d1c[_0x4a1c('0x24')]],'as':_0x432d1c['as'],'attributes':_0x432d1c[_0x4a1c('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4a1c('0x12')](function(_0x352b30){logger['info']('ShowWhatsappAccount',_0x2da804);logger[_0x4a1c('0x14')]('ShowWhatsappAccount',_0x2da804,JSON[_0x4a1c('0x16')](_0x352b30));_0xeaaf41(_0x352b30);})[_0x4a1c('0x1c')](function(_0x5b7379){logger[_0x4a1c('0x17')](_0x4a1c('0x25'),_0x5b7379[_0x4a1c('0x1a')],_0x2da804);_0x23bfb2(_0x5db552[_0x4a1c('0x17')](0x1f4,_0x5b7379[_0x4a1c('0x1a')]));});});};
\ No newline at end of file
index 6f27d2a..9ff8496 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8cc7=['emit','removeListener','length','whatsappAccount:','save'];(function(_0x2eb922,_0x67358c){var _0x344a25=function(_0x5436f2){while(--_0x5436f2){_0x2eb922['push'](_0x2eb922['shift']());}};_0x344a25(++_0x67358c);}(_0x8cc7,0xc7));var _0x78cc=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x8cc7[_0x3947c9];return _0x2e7871;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x78cc('0x0'),'remove','update'];function createListener(_0x169937,_0x4e2a4b){return function(_0x345d33){_0x4e2a4b[_0x78cc('0x1')](_0x169937,_0x345d33);};}function removeListener(_0x1d0f48,_0x30dede){return function(){WhatsappAccountEvents[_0x78cc('0x2')](_0x1d0f48,_0x30dede);};}exports['register']=function(_0x2ca1ae){for(var _0x35f653=0x0,_0x1dca91=events[_0x78cc('0x3')];_0x35f653<_0x1dca91;_0x35f653++){var _0x58f0e9=events[_0x35f653];var _0x2c9f97=createListener(_0x78cc('0x4')+_0x58f0e9,_0x2ca1ae);WhatsappAccountEvents['on'](_0x58f0e9,_0x2c9f97);}};
\ No newline at end of file
+var _0xecc8=['remove','emit','removeListener','length','whatsappAccount:'];(function(_0x1c470d,_0x81d66b){var _0x12141b=function(_0x45bfd3){while(--_0x45bfd3){_0x1c470d['push'](_0x1c470d['shift']());}};_0x12141b(++_0x81d66b);}(_0xecc8,0x18b));var _0x8ecc=function(_0xcf9899,_0x24633e){_0xcf9899=_0xcf9899-0x0;var _0x1937c4=_0xecc8[_0xcf9899];return _0x1937c4;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=['save',_0x8ecc('0x0'),'update'];function createListener(_0x3ad579,_0x3a998f){return function(_0x2cd63e){_0x3a998f[_0x8ecc('0x1')](_0x3ad579,_0x2cd63e);};}function removeListener(_0x5b286e,_0x218389){return function(){WhatsappAccountEvents[_0x8ecc('0x2')](_0x5b286e,_0x218389);};}exports['register']=function(_0x3bebc5){for(var _0x10938d=0x0,_0x443b10=events[_0x8ecc('0x3')];_0x10938d<_0x443b10;_0x10938d++){var _0x5c29cc=events[_0x10938d];var _0x153c12=createListener(_0x8ecc('0x4')+_0x5c29cc,_0x3bebc5);WhatsappAccountEvents['on'](_0x5c29cc,_0x153c12);}};
\ No newline at end of file
index 3fda6ed..802d7c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c0a=['delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','show','post','create','put','update'];(function(_0x591aad,_0x56227c){var _0x377bd1=function(_0x4aec2){while(--_0x4aec2){_0x591aad['push'](_0x591aad['shift']());}};_0x377bd1(++_0x56227c);}(_0x5c0a,0x108));var _0xa5c0=function(_0x297f25,_0x594be0){_0x297f25=_0x297f25-0x0;var _0x4b16e8=_0x5c0a[_0x297f25];return _0x4b16e8;};'use strict';var multer=require(_0xa5c0('0x0'));var util=require(_0xa5c0('0x1'));var path=require(_0xa5c0('0x2'));var timeout=require(_0xa5c0('0x3'));var express=require(_0xa5c0('0x4'));var router=express['Router']();var fs_extra=require(_0xa5c0('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa5c0('0x6'));var controller=require(_0xa5c0('0x7'));router[_0xa5c0('0x8')]('/',auth[_0xa5c0('0x9')](),controller[_0xa5c0('0xa')]);router[_0xa5c0('0x8')]('/:id',auth[_0xa5c0('0x9')](),controller[_0xa5c0('0xb')]);router[_0xa5c0('0xc')]('/',auth[_0xa5c0('0x9')](),controller[_0xa5c0('0xd')]);router[_0xa5c0('0xe')]('/:id',auth[_0xa5c0('0x9')](),controller[_0xa5c0('0xf')]);router[_0xa5c0('0x10')](_0xa5c0('0x11'),auth[_0xa5c0('0x9')](),controller[_0xa5c0('0x12')]);module[_0xa5c0('0x13')]=router;
\ No newline at end of file
+var _0x7f34=['delete','/:id','destroy','exports','multer','util','express','Router','fs-extra','./whatsappApplication.controller','get','isAuthenticated','index','show','post','create','put','update'];(function(_0x24b16e,_0x13bc57){var _0x468fdb=function(_0x542e97){while(--_0x542e97){_0x24b16e['push'](_0x24b16e['shift']());}};_0x468fdb(++_0x13bc57);}(_0x7f34,0xee));var _0x47f3=function(_0x2f74b9,_0x7e641f){_0x2f74b9=_0x2f74b9-0x0;var _0x242eb9=_0x7f34[_0x2f74b9];return _0x242eb9;};'use strict';var multer=require(_0x47f3('0x0'));var util=require(_0x47f3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x47f3('0x2'));var router=express[_0x47f3('0x3')]();var fs_extra=require(_0x47f3('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x47f3('0x5'));router[_0x47f3('0x6')]('/',auth[_0x47f3('0x7')](),controller[_0x47f3('0x8')]);router[_0x47f3('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x47f3('0x9')]);router[_0x47f3('0xa')]('/',auth[_0x47f3('0x7')](),controller[_0x47f3('0xb')]);router[_0x47f3('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x47f3('0xd')]);router[_0x47f3('0xe')](_0x47f3('0xf'),auth[_0x47f3('0x7')](),controller[_0x47f3('0x10')]);module[_0x47f3('0x11')]=router;
\ No newline at end of file
index df60be7..f639e74 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x78ae=['STRING','noop','*,*,*,*','exports','INTEGER'];(function(_0x2faddb,_0xc18b78){var _0x273c05=function(_0x1a3785){while(--_0x1a3785){_0x2faddb['push'](_0x2faddb['shift']());}};_0x273c05(++_0xc18b78);}(_0x78ae,0x193));var _0xe78a=function(_0x481a26,_0x13d43e){_0x481a26=_0x481a26-0x0;var _0x4653c7=_0x78ae[_0x481a26];return _0x4653c7;};'use strict';var Sequelize=require('sequelize');module[_0xe78a('0x0')]={'priority':{'type':Sequelize[_0xe78a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xe78a('0x2')],'allowNull':![],'defaultValue':_0xe78a('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xe78a('0x2')]},'interval':{'type':Sequelize[_0xe78a('0x2')],'defaultValue':_0xe78a('0x4')}};
\ No newline at end of file
+var _0xc610=['exports','INTEGER','TEXT','STRING'];(function(_0xbb7f97,_0x1aa2da){var _0x115d9b=function(_0x2f7608){while(--_0x2f7608){_0xbb7f97['push'](_0xbb7f97['shift']());}};_0x115d9b(++_0x1aa2da);}(_0xc610,0x140));var _0x0c61=function(_0x7b4397,_0x50ab04){_0x7b4397=_0x7b4397-0x0;var _0x16de0b=_0xc610[_0x7b4397];return _0x16de0b;};'use strict';var Sequelize=require('sequelize');module[_0x0c61('0x0')]={'priority':{'type':Sequelize[_0x0c61('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x0c61('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0c61('0x3')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
index da24ce5..cf36d12 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb982=['sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','stack','name','send','WhatsappApplication','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','options','include','findAll','rows','show','params','rawAttributes','includeAll','find','catch','create','body','update','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x44c935,_0x3653f0){var _0x465bee=function(_0x211d20){while(--_0x211d20){_0x44c935['push'](_0x44c935['shift']());}};_0x465bee(++_0x3653f0);}(_0xb982,0x15e));var _0x2b98=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb982[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2b98('0x0'));var jsonpatch=require(_0x2b98('0x1'));var rp=require(_0x2b98('0x2'));var moment=require(_0x2b98('0x3'));var BPromise=require(_0x2b98('0x4'));var Mustache=require(_0x2b98('0x5'));var util=require(_0x2b98('0x6'));var path=require(_0x2b98('0x7'));var sox=require(_0x2b98('0x8'));var csv=require(_0x2b98('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2b98('0xa'));var _=require(_0x2b98('0xb'));var squel=require(_0x2b98('0xc'));var crypto=require(_0x2b98('0xd'));var jsforce=require(_0x2b98('0xe'));var deskjs=require(_0x2b98('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2b98('0x10'));var Papa=require(_0x2b98('0x11'));var Redis=require('ioredis');var authService=require(_0x2b98('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x2b98('0x13'));var hardwareService=require(_0x2b98('0x14'));var logger=require(_0x2b98('0x15'))(_0x2b98('0x16'));var utils=require(_0x2b98('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2b98('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x145379,_0x2a2489){_0x2a2489=_0x2a2489||0xcc;return function(_0x675360){if(_0x675360){return _0x145379[_0x2b98('0x19')](_0x2a2489);}return _0x145379[_0x2b98('0x1a')](_0x2a2489)[_0x2b98('0x1b')]();};}function respondWithResult(_0x570e87,_0x29c259){_0x29c259=_0x29c259||0xc8;return function(_0x268fc3){if(_0x268fc3){return _0x570e87[_0x2b98('0x1a')](_0x29c259)[_0x2b98('0x1c')](_0x268fc3);}};}function respondWithFilteredResult(_0x2c6e3c,_0x196cc2){return function(_0x15e5c9){if(_0x15e5c9){var _0x4eab53=typeof _0x196cc2[_0x2b98('0x1d')]===_0x2b98('0x1e')&&typeof _0x196cc2['limit']===_0x2b98('0x1e');var _0x54d425=_0x15e5c9[_0x2b98('0x1f')];var _0x40426c=_0x4eab53?0x0:_0x196cc2[_0x2b98('0x1d')];var _0x50b886=_0x4eab53?_0x15e5c9['count']:_0x196cc2['offset']+_0x196cc2[_0x2b98('0x20')];var _0x3e380c;if(_0x50b886>=_0x54d425){_0x50b886=_0x54d425;_0x3e380c=0xc8;}else{_0x3e380c=0xce;}_0x2c6e3c['status'](_0x3e380c);return _0x2c6e3c['set'](_0x2b98('0x21'),_0x40426c+'-'+_0x50b886+'/'+_0x54d425)[_0x2b98('0x1c')](_0x15e5c9);}return null;};}function patchUpdates(_0x41c7de){return function(_0x5b75de){try{jsonpatch[_0x2b98('0x22')](_0x5b75de,_0x41c7de,!![]);}catch(_0xbff969){return BPromise[_0x2b98('0x23')](_0xbff969);}return _0x5b75de[_0x2b98('0x24')]();};}function saveUpdates(_0x3f5768,_0x349a8d){return function(_0x51db51){if(_0x51db51){return _0x51db51['update'](_0x3f5768)[_0x2b98('0x25')](function(_0x31225b){return _0x31225b;});}return null;};}function removeEntity(_0x373e34,_0x10e803){return function(_0x3bdfa3){if(_0x3bdfa3){return _0x3bdfa3[_0x2b98('0x26')]()[_0x2b98('0x25')](function(){_0x373e34[_0x2b98('0x1a')](0xcc)[_0x2b98('0x1b')]();});}};}function handleEntityNotFound(_0x1a1deb,_0x154f06){return function(_0x112d71){if(!_0x112d71){_0x1a1deb[_0x2b98('0x19')](0x194);}return _0x112d71;};}function handleError(_0x4cc4a2,_0xccda69){_0xccda69=_0xccda69||0x1f4;return function(_0x54b0c3){logger['error'](_0x54b0c3[_0x2b98('0x27')]);if(_0x54b0c3['name']){delete _0x54b0c3[_0x2b98('0x28')];}_0x4cc4a2[_0x2b98('0x1a')](_0xccda69)[_0x2b98('0x29')](_0x54b0c3);};}exports['index']=function(_0x5467a4,_0x3e506f){var _0x2769a7={},_0x2208b1={},_0x8cf049={'count':0x0,'rows':[]};var _0x4ee654=_['map'](db[_0x2b98('0x2a')]['rawAttributes'],function(_0x44b027){return{'name':_0x44b027['fieldName'],'type':_0x44b027['type'][_0x2b98('0x2b')]};});_0x2208b1[_0x2b98('0x2c')]=_[_0x2b98('0x2d')](_0x4ee654,_0x2b98('0x28'));_0x2208b1['query']=_[_0x2b98('0x2e')](_0x5467a4[_0x2b98('0x2f')]);_0x2208b1[_0x2b98('0x30')]=_[_0x2b98('0x31')](_0x2208b1[_0x2b98('0x2c')],_0x2208b1[_0x2b98('0x2f')]);_0x2769a7[_0x2b98('0x32')]=_[_0x2b98('0x31')](_0x2208b1[_0x2b98('0x2c')],qs[_0x2b98('0x33')](_0x5467a4[_0x2b98('0x2f')]['fields']));_0x2769a7[_0x2b98('0x32')]=_0x2769a7['attributes'][_0x2b98('0x34')]?_0x2769a7[_0x2b98('0x32')]:_0x2208b1[_0x2b98('0x2c')];if(!_0x5467a4[_0x2b98('0x2f')][_0x2b98('0x35')](_0x2b98('0x36'))){_0x2769a7['limit']=qs[_0x2b98('0x20')](_0x5467a4['query'][_0x2b98('0x20')]);_0x2769a7[_0x2b98('0x1d')]=qs[_0x2b98('0x1d')](_0x5467a4[_0x2b98('0x2f')][_0x2b98('0x1d')]);}_0x2769a7[_0x2b98('0x37')]=qs[_0x2b98('0x38')](_0x5467a4[_0x2b98('0x2f')]['sort']);_0x2769a7['where']=qs[_0x2b98('0x30')](_[_0x2b98('0x39')](_0x5467a4[_0x2b98('0x2f')],_0x2208b1[_0x2b98('0x30')]),_0x4ee654);if(_0x5467a4[_0x2b98('0x2f')][_0x2b98('0x3a')]){_0x2769a7['where']=_[_0x2b98('0x3b')](_0x2769a7[_0x2b98('0x3c')],{'$or':_[_0x2b98('0x2d')](_0x4ee654,function(_0x1c2e54){if(_0x1c2e54[_0x2b98('0x3d')]!=='VIRTUAL'){var _0x12a6ad={};_0x12a6ad[_0x1c2e54[_0x2b98('0x28')]]={'$like':'%'+_0x5467a4[_0x2b98('0x2f')]['filter']+'%'};return _0x12a6ad;}})});}_0x2769a7=_[_0x2b98('0x3b')]({},_0x2769a7,_0x5467a4[_0x2b98('0x3e')]);var _0x44857a={'where':_0x2769a7[_0x2b98('0x3c')]};return db['WhatsappApplication'][_0x2b98('0x1f')](_0x44857a)['then'](function(_0x3c4569){_0x8cf049[_0x2b98('0x1f')]=_0x3c4569;if(_0x5467a4['query']['includeAll']){_0x2769a7[_0x2b98('0x3f')]=[{'all':!![]}];}return db[_0x2b98('0x2a')][_0x2b98('0x40')](_0x2769a7);})[_0x2b98('0x25')](function(_0x140ba0){_0x8cf049[_0x2b98('0x41')]=_0x140ba0;return _0x8cf049;})[_0x2b98('0x25')](respondWithFilteredResult(_0x3e506f,_0x2769a7))['catch'](handleError(_0x3e506f,null));};exports[_0x2b98('0x42')]=function(_0x1d0277,_0x569fc4){var _0x511ea2={'raw':!![],'where':{'id':_0x1d0277[_0x2b98('0x43')]['id']}},_0xf68abc={};_0xf68abc['model']=_[_0x2b98('0x2e')](db[_0x2b98('0x2a')][_0x2b98('0x44')]);_0xf68abc[_0x2b98('0x2f')]=_['keys'](_0x1d0277[_0x2b98('0x2f')]);_0xf68abc[_0x2b98('0x30')]=_[_0x2b98('0x31')](_0xf68abc[_0x2b98('0x2c')],_0xf68abc[_0x2b98('0x2f')]);_0x511ea2[_0x2b98('0x32')]=_[_0x2b98('0x31')](_0xf68abc['model'],qs[_0x2b98('0x33')](_0x1d0277[_0x2b98('0x2f')]['fields']));_0x511ea2[_0x2b98('0x32')]=_0x511ea2[_0x2b98('0x32')]['length']?_0x511ea2[_0x2b98('0x32')]:_0xf68abc['model'];if(_0x1d0277['query'][_0x2b98('0x45')]){_0x511ea2[_0x2b98('0x3f')]=[{'all':!![]}];}_0x511ea2=_[_0x2b98('0x3b')]({},_0x511ea2,_0x1d0277[_0x2b98('0x3e')]);return db['WhatsappApplication'][_0x2b98('0x46')](_0x511ea2)['then'](handleEntityNotFound(_0x569fc4,null))[_0x2b98('0x25')](respondWithResult(_0x569fc4,null))[_0x2b98('0x47')](handleError(_0x569fc4,null));};exports[_0x2b98('0x48')]=function(_0xb9a6f,_0xd667c0){return db[_0x2b98('0x2a')][_0x2b98('0x48')](_0xb9a6f[_0x2b98('0x49')],{})[_0x2b98('0x25')](respondWithResult(_0xd667c0,0xc9))[_0x2b98('0x47')](handleError(_0xd667c0,null));};exports[_0x2b98('0x4a')]=function(_0x18d835,_0x6860c8){if(_0x18d835['body']['id']){delete _0x18d835['body']['id'];}return db[_0x2b98('0x2a')][_0x2b98('0x46')]({'where':{'id':_0x18d835[_0x2b98('0x43')]['id']}})['then'](handleEntityNotFound(_0x6860c8,null))[_0x2b98('0x25')](saveUpdates(_0x18d835[_0x2b98('0x49')],null))[_0x2b98('0x25')](respondWithResult(_0x6860c8,null))[_0x2b98('0x47')](handleError(_0x6860c8,null));};exports[_0x2b98('0x26')]=function(_0x3524a3,_0x5c8a7c){return db['WhatsappApplication'][_0x2b98('0x46')]({'where':{'id':_0x3524a3[_0x2b98('0x43')]['id']}})[_0x2b98('0x25')](handleEntityNotFound(_0x5c8a7c,null))[_0x2b98('0x25')](removeEntity(_0x5c8a7c,null))[_0x2b98('0x47')](handleError(_0x5c8a7c,null));};
\ No newline at end of file
+var _0xb2f3=['set','Content-Range','reject','save','update','destroy','then','name','send','map','WhatsappApplication','fieldName','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../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'];(function(_0x61a5f6,_0x1bc817){var _0x295d16=function(_0x47f583){while(--_0x47f583){_0x61a5f6['push'](_0x61a5f6['shift']());}};_0x295d16(++_0x1bc817);}(_0xb2f3,0xfd));var _0x3b2f=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xb2f3[_0x26462c];return _0x509a42;};'use strict';var emlformat=require(_0x3b2f('0x0'));var rimraf=require(_0x3b2f('0x1'));var zipdir=require(_0x3b2f('0x2'));var jsonpatch=require(_0x3b2f('0x3'));var rp=require(_0x3b2f('0x4'));var moment=require(_0x3b2f('0x5'));var BPromise=require(_0x3b2f('0x6'));var Mustache=require('mustache');var util=require(_0x3b2f('0x7'));var path=require(_0x3b2f('0x8'));var sox=require(_0x3b2f('0x9'));var csv=require(_0x3b2f('0xa'));var ejs=require(_0x3b2f('0xb'));var fs=require('fs');var fs_extra=require(_0x3b2f('0xc'));var _=require(_0x3b2f('0xd'));var squel=require('squel');var crypto=require(_0x3b2f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3b2f('0xf'));var toCsv=require(_0x3b2f('0xa'));var querystring=require(_0x3b2f('0x10'));var Papa=require(_0x3b2f('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3b2f('0x12'));var as=require(_0x3b2f('0x13'));var hardwareService=require(_0x3b2f('0x14'));var logger=require(_0x3b2f('0x15'))(_0x3b2f('0x16'));var utils=require(_0x3b2f('0x17'));var config=require(_0x3b2f('0x18'));var licenseUtil=require(_0x3b2f('0x19'));var db=require(_0x3b2f('0x1a'))['db'];function respondWithStatusCode(_0x322dda,_0x458f93){_0x458f93=_0x458f93||0xcc;return function(_0x2a9d0e){if(_0x2a9d0e){return _0x322dda[_0x3b2f('0x1b')](_0x458f93);}return _0x322dda[_0x3b2f('0x1c')](_0x458f93)[_0x3b2f('0x1d')]();};}function respondWithResult(_0x4fb033,_0x3f1015){_0x3f1015=_0x3f1015||0xc8;return function(_0x4da3bd){if(_0x4da3bd){return _0x4fb033[_0x3b2f('0x1c')](_0x3f1015)[_0x3b2f('0x1e')](_0x4da3bd);}};}function respondWithFilteredResult(_0x525978,_0x241937){return function(_0x4c028a){if(_0x4c028a){var _0x3c0b3f=typeof _0x241937[_0x3b2f('0x1f')]===_0x3b2f('0x20')&&typeof _0x241937[_0x3b2f('0x21')]==='undefined';var _0x52e91d=_0x4c028a[_0x3b2f('0x22')];var _0x6d8948=_0x3c0b3f?0x0:_0x241937[_0x3b2f('0x1f')];var _0x3040d3=_0x3c0b3f?_0x4c028a[_0x3b2f('0x22')]:_0x241937[_0x3b2f('0x1f')]+_0x241937[_0x3b2f('0x21')];var _0x3d94c0;if(_0x3040d3>=_0x52e91d){_0x3040d3=_0x52e91d;_0x3d94c0=0xc8;}else{_0x3d94c0=0xce;}_0x525978[_0x3b2f('0x1c')](_0x3d94c0);return _0x525978[_0x3b2f('0x23')](_0x3b2f('0x24'),_0x6d8948+'-'+_0x3040d3+'/'+_0x52e91d)[_0x3b2f('0x1e')](_0x4c028a);}return null;};}function patchUpdates(_0x1688f4){return function(_0x2deb04){try{jsonpatch['apply'](_0x2deb04,_0x1688f4,!![]);}catch(_0x6fdf3f){return BPromise[_0x3b2f('0x25')](_0x6fdf3f);}return _0x2deb04[_0x3b2f('0x26')]();};}function saveUpdates(_0xef73a0,_0x57e96a){return function(_0x1476a0){if(_0x1476a0){return _0x1476a0[_0x3b2f('0x27')](_0xef73a0)['then'](function(_0x429649){return _0x429649;});}return null;};}function removeEntity(_0x49b9ab,_0x28ef68){return function(_0x94aced){if(_0x94aced){return _0x94aced[_0x3b2f('0x28')]()[_0x3b2f('0x29')](function(){_0x49b9ab['status'](0xcc)[_0x3b2f('0x1d')]();});}};}function handleEntityNotFound(_0x2ee755,_0x48592c){return function(_0x4db72f){if(!_0x4db72f){_0x2ee755[_0x3b2f('0x1b')](0x194);}return _0x4db72f;};}function handleError(_0x44fa57,_0x9cf807){_0x9cf807=_0x9cf807||0x1f4;return function(_0x2ca527){logger['error'](_0x2ca527['stack']);if(_0x2ca527[_0x3b2f('0x2a')]){delete _0x2ca527[_0x3b2f('0x2a')];}_0x44fa57[_0x3b2f('0x1c')](_0x9cf807)[_0x3b2f('0x2b')](_0x2ca527);};}exports['index']=function(_0x39f342,_0x4b76ea){var _0x30d504={},_0x21c8a4={},_0x171f99={'count':0x0,'rows':[]};var _0x469fc9=_[_0x3b2f('0x2c')](db[_0x3b2f('0x2d')]['rawAttributes'],function(_0x1fbcb6){return{'name':_0x1fbcb6[_0x3b2f('0x2e')],'type':_0x1fbcb6['type']['key']};});_0x21c8a4[_0x3b2f('0x2f')]=_[_0x3b2f('0x2c')](_0x469fc9,'name');_0x21c8a4['query']=_[_0x3b2f('0x30')](_0x39f342[_0x3b2f('0x31')]);_0x21c8a4[_0x3b2f('0x32')]=_[_0x3b2f('0x33')](_0x21c8a4[_0x3b2f('0x2f')],_0x21c8a4[_0x3b2f('0x31')]);_0x30d504['attributes']=_[_0x3b2f('0x33')](_0x21c8a4[_0x3b2f('0x2f')],qs['fields'](_0x39f342[_0x3b2f('0x31')][_0x3b2f('0x34')]));_0x30d504[_0x3b2f('0x35')]=_0x30d504[_0x3b2f('0x35')]['length']?_0x30d504[_0x3b2f('0x35')]:_0x21c8a4[_0x3b2f('0x2f')];if(!_0x39f342[_0x3b2f('0x31')][_0x3b2f('0x36')]('nolimit')){_0x30d504['limit']=qs[_0x3b2f('0x21')](_0x39f342[_0x3b2f('0x31')][_0x3b2f('0x21')]);_0x30d504[_0x3b2f('0x1f')]=qs[_0x3b2f('0x1f')](_0x39f342['query']['offset']);}_0x30d504[_0x3b2f('0x37')]=qs[_0x3b2f('0x38')](_0x39f342[_0x3b2f('0x31')]['sort']);_0x30d504[_0x3b2f('0x39')]=qs[_0x3b2f('0x32')](_[_0x3b2f('0x3a')](_0x39f342['query'],_0x21c8a4[_0x3b2f('0x32')]),_0x469fc9);if(_0x39f342[_0x3b2f('0x31')][_0x3b2f('0x3b')]){_0x30d504['where']=_['merge'](_0x30d504[_0x3b2f('0x39')],{'$or':_['map'](_0x469fc9,function(_0x508ad5){if(_0x508ad5[_0x3b2f('0x3c')]!==_0x3b2f('0x3d')){var _0x4ac830={};_0x4ac830[_0x508ad5[_0x3b2f('0x2a')]]={'$like':'%'+_0x39f342[_0x3b2f('0x31')][_0x3b2f('0x3b')]+'%'};return _0x4ac830;}})});}_0x30d504=_[_0x3b2f('0x3e')]({},_0x30d504,_0x39f342[_0x3b2f('0x3f')]);var _0xad28b3={'where':_0x30d504[_0x3b2f('0x39')]};return db[_0x3b2f('0x2d')]['count'](_0xad28b3)[_0x3b2f('0x29')](function(_0x321d43){_0x171f99[_0x3b2f('0x22')]=_0x321d43;if(_0x39f342[_0x3b2f('0x31')][_0x3b2f('0x40')]){_0x30d504[_0x3b2f('0x41')]=[{'all':!![]}];}return db[_0x3b2f('0x2d')][_0x3b2f('0x42')](_0x30d504);})[_0x3b2f('0x29')](function(_0x507813){_0x171f99[_0x3b2f('0x43')]=_0x507813;return _0x171f99;})[_0x3b2f('0x29')](respondWithFilteredResult(_0x4b76ea,_0x30d504))[_0x3b2f('0x44')](handleError(_0x4b76ea,null));};exports['show']=function(_0x2e6258,_0x4a2cdd){var _0xe84703={'raw':!![],'where':{'id':_0x2e6258[_0x3b2f('0x45')]['id']}},_0x23b747={};_0x23b747[_0x3b2f('0x2f')]=_[_0x3b2f('0x30')](db[_0x3b2f('0x2d')]['rawAttributes']);_0x23b747[_0x3b2f('0x31')]=_['keys'](_0x2e6258[_0x3b2f('0x31')]);_0x23b747[_0x3b2f('0x32')]=_['intersection'](_0x23b747[_0x3b2f('0x2f')],_0x23b747[_0x3b2f('0x31')]);_0xe84703[_0x3b2f('0x35')]=_[_0x3b2f('0x33')](_0x23b747[_0x3b2f('0x2f')],qs['fields'](_0x2e6258['query'][_0x3b2f('0x34')]));_0xe84703['attributes']=_0xe84703[_0x3b2f('0x35')]['length']?_0xe84703[_0x3b2f('0x35')]:_0x23b747[_0x3b2f('0x2f')];if(_0x2e6258[_0x3b2f('0x31')][_0x3b2f('0x40')]){_0xe84703['include']=[{'all':!![]}];}_0xe84703=_[_0x3b2f('0x3e')]({},_0xe84703,_0x2e6258[_0x3b2f('0x3f')]);return db[_0x3b2f('0x2d')]['find'](_0xe84703)[_0x3b2f('0x29')](handleEntityNotFound(_0x4a2cdd,null))[_0x3b2f('0x29')](respondWithResult(_0x4a2cdd,null))[_0x3b2f('0x44')](handleError(_0x4a2cdd,null));};exports[_0x3b2f('0x46')]=function(_0x5e6666,_0x267af4){return db[_0x3b2f('0x2d')][_0x3b2f('0x46')](_0x5e6666[_0x3b2f('0x47')],{})[_0x3b2f('0x29')](respondWithResult(_0x267af4,0xc9))[_0x3b2f('0x44')](handleError(_0x267af4,null));};exports[_0x3b2f('0x27')]=function(_0x2e182e,_0x56be24){if(_0x2e182e[_0x3b2f('0x47')]['id']){delete _0x2e182e[_0x3b2f('0x47')]['id'];}return db['WhatsappApplication']['find']({'where':{'id':_0x2e182e['params']['id']}})[_0x3b2f('0x29')](handleEntityNotFound(_0x56be24,null))[_0x3b2f('0x29')](saveUpdates(_0x2e182e[_0x3b2f('0x47')],null))[_0x3b2f('0x29')](respondWithResult(_0x56be24,null))['catch'](handleError(_0x56be24,null));};exports[_0x3b2f('0x28')]=function(_0x67a4c0,_0x5c98c6){return db['WhatsappApplication']['find']({'where':{'id':_0x67a4c0[_0x3b2f('0x45')]['id']}})[_0x3b2f('0x29')](handleEntityNotFound(_0x5c98c6,null))['then'](removeEntity(_0x5c98c6,null))['catch'](handleError(_0x5c98c6,null));};
\ No newline at end of file
index 576d5f1..f261b64 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x20ce=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x6f1a87,_0x5d5bcf){var _0x2495c7=function(_0x1c6733){while(--_0x1c6733){_0x6f1a87['push'](_0x6f1a87['shift']());}};_0x2495c7(++_0x5d5bcf);}(_0x20ce,0x10d));var _0xe20c=function(_0x213f99,_0x3a3035){_0x213f99=_0x213f99-0x0;var _0xadb3fb=_0x20ce[_0x213f99];return _0xadb3fb;};'use strict';var _=require(_0xe20c('0x0'));var util=require(_0xe20c('0x1'));var logger=require(_0xe20c('0x2'))('api');var moment=require(_0xe20c('0x3'));var BPromise=require(_0xe20c('0x4'));var rp=require(_0xe20c('0x5'));var fs=require('fs');var path=require(_0xe20c('0x6'));var rimraf=require(_0xe20c('0x7'));var config=require(_0xe20c('0x8'));var attributes=require(_0xe20c('0x9'));module[_0xe20c('0xa')]=function(_0x373f9f,_0x2c9e6a){return _0x373f9f[_0xe20c('0xb')](_0xe20c('0xc'),attributes,{'tableName':_0xe20c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe20c('0xe'),'collate':_0xe20c('0xf')});};
\ No newline at end of file
+var _0x8a9c=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4'];(function(_0x33d214,_0x277a8e){var _0x1b36d1=function(_0x2446f8){while(--_0x2446f8){_0x33d214['push'](_0x33d214['shift']());}};_0x1b36d1(++_0x277a8e);}(_0x8a9c,0x12d));var _0xc8a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a9c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc8a9('0x0'));var util=require(_0xc8a9('0x1'));var logger=require(_0xc8a9('0x2'))(_0xc8a9('0x3'));var moment=require(_0xc8a9('0x4'));var BPromise=require('bluebird');var rp=require(_0xc8a9('0x5'));var fs=require('fs');var path=require(_0xc8a9('0x6'));var rimraf=require('rimraf');var config=require(_0xc8a9('0x7'));var attributes=require(_0xc8a9('0x8'));module[_0xc8a9('0x9')]=function(_0x4c1e04,_0xb4340b){return _0x4c1e04[_0xc8a9('0xa')](_0xc8a9('0xb'),attributes,{'tableName':_0xc8a9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc8a9('0xd'),'collate':_0xc8a9('0xe')});};
\ No newline at end of file
index 4ac316f..7475254 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa8a8=['stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x173dc4,_0x3b150c){var _0x251b4a=function(_0x29b3c5){while(--_0x29b3c5){_0x173dc4['push'](_0x173dc4['shift']());}};_0x251b4a(++_0x3b150c);}(_0xa8a8,0xec));var _0x8a8a=function(_0x157c10,_0xb726cd){_0x157c10=_0x157c10-0x0;var _0x429f51=_0xa8a8[_0x157c10];return _0x429f51;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var BPromise=require(_0x8a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a8a('0x4'));var db=require(_0x8a8a('0x5'))['db'];var utils=require(_0x8a8a('0x6'));var logger=require(_0x8a8a('0x7'))(_0x8a8a('0x8'));var config=require(_0x8a8a('0x9'));var jayson=require(_0x8a8a('0xa'));var client=jayson[_0x8a8a('0xb')][_0x8a8a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x315fe9,_0x1d7121,_0x8e7aa0){return new BPromise(function(_0x4225b9,_0xecaa6f){return client[_0x8a8a('0xd')](_0x315fe9,_0x8e7aa0)['then'](function(_0x576ef9){logger[_0x8a8a('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));logger[_0x8a8a('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'),JSON[_0x8a8a('0x11')](_0x576ef9));if(_0x576ef9[_0x8a8a('0x12')]){if(_0x576ef9['error'][_0x8a8a('0x13')]===0x1f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')]['message']);return _0xecaa6f(_0x576ef9[_0x8a8a('0x12')]['message']);}logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);return _0x4225b9(_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);}else{logger[_0x8a8a('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));_0x4225b9(_0x576ef9['result'][_0x8a8a('0x15')]);}})[_0x8a8a('0x16')](function(_0x46a4f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x46a4f4);_0xecaa6f(_0x46a4f4);});});}
\ No newline at end of file
+var _0xb458=['WhatsappApplication,\x20%s,\x20%s,\x20%s','code','error','message','request\x20sent','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','then','info','WhatsappApplication,\x20%s,\x20%s','debug'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xb458,0x103));var _0x8b45=function(_0x306626,_0x425e93){_0x306626=_0x306626-0x0;var _0x466728=_0xb458[_0x306626];return _0x466728;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var moment=require(_0x8b45('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b45('0x3'));var db=require(_0x8b45('0x4'))['db'];var utils=require(_0x8b45('0x5'));var logger=require(_0x8b45('0x6'))('rpc');var config=require(_0x8b45('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8b45('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x12bd05,_0x2daa9a,_0x3a8ccb){return new BPromise(function(_0x32342f,_0x4d1718){return client[_0x8b45('0x9')](_0x12bd05,_0x3a8ccb)[_0x8b45('0xa')](function(_0x33f30e){logger[_0x8b45('0xb')](_0x8b45('0xc'),_0x2daa9a,'request\x20sent');logger[_0x8b45('0xd')](_0x8b45('0xe'),_0x2daa9a,'request\x20sent',JSON['stringify'](_0x33f30e));if(_0x33f30e['error']){if(_0x33f30e['error'][_0x8b45('0xf')]===0x1f4){logger[_0x8b45('0x10')](_0x8b45('0xc'),_0x2daa9a,_0x33f30e['error'][_0x8b45('0x11')]);return _0x4d1718(_0x33f30e[_0x8b45('0x10')][_0x8b45('0x11')]);}logger[_0x8b45('0x10')](_0x8b45('0xc'),_0x2daa9a,_0x33f30e[_0x8b45('0x10')]['message']);return _0x32342f(_0x33f30e['error'][_0x8b45('0x11')]);}else{logger[_0x8b45('0xb')](_0x8b45('0xc'),_0x2daa9a,_0x8b45('0x12'));_0x32342f(_0x33f30e[_0x8b45('0x13')][_0x8b45('0x11')]);}})[_0x8b45('0x14')](function(_0x147d6b){logger[_0x8b45('0x10')](_0x8b45('0xc'),_0x2daa9a,_0x147d6b);_0x4d1718(_0x147d6b);});});}
\ No newline at end of file
index 3871c9b..40e327e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8b8e=['whatsappinteraction:destroy','removeTags','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsappinteraction:addtags','put','/:id','whatsapp','whatsappinteraction:update','update','delete'];(function(_0x76c22a,_0x509c6e){var _0x509eb6=function(_0x254ae2){while(--_0x254ae2){_0x76c22a['push'](_0x76c22a['shift']());}};_0x509eb6(++_0x509c6e);}(_0x8b8e,0x108));var _0xe8b8=function(_0x3d8c50,_0x4bb14c){_0x3d8c50=_0x3d8c50-0x0;var _0x2725db=_0x8b8e[_0x3d8c50];return _0x2725db;};'use strict';var multer=require(_0xe8b8('0x0'));var util=require('util');var path=require(_0xe8b8('0x1'));var timeout=require('connect-timeout');var express=require(_0xe8b8('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe8b8('0x3'));var interaction=require(_0xe8b8('0x4'));var config=require(_0xe8b8('0x5'));var controller=require(_0xe8b8('0x6'));router[_0xe8b8('0x7')]('/',auth[_0xe8b8('0x8')](),controller[_0xe8b8('0x9')]);router[_0xe8b8('0x7')](_0xe8b8('0xa'),auth[_0xe8b8('0x8')](),controller['describe']);router[_0xe8b8('0x7')]('/:id',auth[_0xe8b8('0x8')](),controller['show']);router['get'](_0xe8b8('0xb'),auth[_0xe8b8('0x8')](),controller['getMessages']);router['get'](_0xe8b8('0xc'),auth[_0xe8b8('0x8')](),controller[_0xe8b8('0xd')]);router[_0xe8b8('0xe')]('/',auth[_0xe8b8('0x8')](),controller[_0xe8b8('0xf')]);router[_0xe8b8('0xe')](_0xe8b8('0xb'),auth[_0xe8b8('0x8')](),controller[_0xe8b8('0x10')]);router[_0xe8b8('0xe')](_0xe8b8('0x11'),auth[_0xe8b8('0x8')](),interaction[_0xe8b8('0x12')]('whatsapp',_0xe8b8('0x13')),controller['addTags']);router[_0xe8b8('0x14')](_0xe8b8('0x15'),auth[_0xe8b8('0x8')](),interaction[_0xe8b8('0x12')](_0xe8b8('0x16'),_0xe8b8('0x17')),controller[_0xe8b8('0x18')]);router[_0xe8b8('0x19')](_0xe8b8('0x15'),auth[_0xe8b8('0x8')](),interaction['tracked'](_0xe8b8('0x16'),_0xe8b8('0x1a')),controller['destroy']);router[_0xe8b8('0x19')](_0xe8b8('0x11'),auth[_0xe8b8('0x8')](),controller[_0xe8b8('0x1b')]);module[_0xe8b8('0x1c')]=router;
\ No newline at end of file
+var _0xdc97=['/:id/download','download','post','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','put','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','describe','/:id','show','/:id/messages','getMessages'];(function(_0x1c4fb7,_0x43e396){var _0x44a872=function(_0x4fc74d){while(--_0x4fc74d){_0x1c4fb7['push'](_0x1c4fb7['shift']());}};_0x44a872(++_0x43e396);}(_0xdc97,0x13b));var _0x7dc9=function(_0x562614,_0x27b8bb){_0x562614=_0x562614-0x0;var _0x3899b3=_0xdc97[_0x562614];return _0x3899b3;};'use strict';var multer=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var path=require(_0x7dc9('0x2'));var timeout=require('connect-timeout');var express=require(_0x7dc9('0x3'));var router=express['Router']();var fs_extra=require(_0x7dc9('0x4'));var auth=require(_0x7dc9('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7dc9('0x6'));var controller=require(_0x7dc9('0x7'));router[_0x7dc9('0x8')]('/',auth[_0x7dc9('0x9')](),controller['index']);router[_0x7dc9('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x7dc9('0xa')]);router[_0x7dc9('0x8')](_0x7dc9('0xb'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xc')]);router['get'](_0x7dc9('0xd'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xe')]);router[_0x7dc9('0x8')](_0x7dc9('0xf'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x7dc9('0xd'),auth[_0x7dc9('0x9')](),controller['addMessage']);router[_0x7dc9('0x11')](_0x7dc9('0x12'),auth[_0x7dc9('0x9')](),interaction[_0x7dc9('0x13')](_0x7dc9('0x14'),_0x7dc9('0x15')),controller['addTags']);router[_0x7dc9('0x16')](_0x7dc9('0xb'),auth[_0x7dc9('0x9')](),interaction[_0x7dc9('0x13')](_0x7dc9('0x14'),_0x7dc9('0x17')),controller[_0x7dc9('0x18')]);router[_0x7dc9('0x19')](_0x7dc9('0xb'),auth['isAuthenticated'](),interaction[_0x7dc9('0x13')]('whatsapp',_0x7dc9('0x1a')),controller[_0x7dc9('0x1b')]);router['delete'](_0x7dc9('0x12'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0x1c')]);module[_0x7dc9('0x1d')]=router;
\ No newline at end of file
index faa8141..a049b95 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fd7=['moment','exports','BOOLEAN','STRING','ENUM','DATE','sequelize'];(function(_0x5e6b21,_0x391d0b){var _0x225f39=function(_0x22dbc4){while(--_0x22dbc4){_0x5e6b21['push'](_0x5e6b21['shift']());}};_0x225f39(++_0x391d0b);}(_0x4fd7,0xe6));var _0x74fd=function(_0x12fadb,_0x305329){_0x12fadb=_0x12fadb-0x0;var _0x5eb1d5=_0x4fd7[_0x12fadb];return _0x5eb1d5;};'use strict';var Sequelize=require(_0x74fd('0x0'));var moment=require(_0x74fd('0x1'));module[_0x74fd('0x2')]={'closed':{'type':Sequelize[_0x74fd('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x74fd('0x4')]},'thirdDisposition':{'type':Sequelize[_0x74fd('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x74fd('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x74fd('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x74fd('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x74fd('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x74fd('0x3')],'defaultValue':![]}};
\ No newline at end of file
+var _0x33ac=['moment','DATE','STRING','ENUM','out','BOOLEAN'];(function(_0x29f802,_0x42b9be){var _0x44b4d6=function(_0x254623){while(--_0x254623){_0x29f802['push'](_0x29f802['shift']());}};_0x44b4d6(++_0x42b9be);}(_0x33ac,0x1f2));var _0xc33a=function(_0x377daf,_0x4ae81f){_0x377daf=_0x377daf-0x0;var _0x15796e=_0x33ac[_0x377daf];return _0x15796e;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc33a('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc33a('0x1')]},'disposition':{'type':Sequelize[_0xc33a('0x2')]},'secondDisposition':{'type':Sequelize[_0xc33a('0x2')]},'thirdDisposition':{'type':Sequelize[_0xc33a('0x2')]},'note':{'type':Sequelize[_0xc33a('0x2')]},'phone':{'type':Sequelize[_0xc33a('0x2')]},'read1stAt':{'type':Sequelize[_0xc33a('0x1')]},'firstMsgDirection':{'type':Sequelize[_0xc33a('0x3')]('in',_0xc33a('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xc33a('0x4')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xc33a('0x5')],'defaultValue':![]}};
\ No newline at end of file
index c10e0a6..4ffbe53 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x938a=['attachments','fullname','CmContact','firstName','lastName','Attachment','Messages','direction','secret','WhatsappAccount','Account','Owner','get','mkdirSync','N.A.','closed','closedAt','disposition','basename','existsSync','createWriteStream','out','System','views','downloadInteraction.ejs','transcript-','.pdf','Whatsapp','createPdfFromHTML','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','redis','localhost','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','error','stack','name','Users','map','TagIds','Tags','forEach','catch','index','WhatsappInteraction','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','select','field','from','u.fullname','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','unreadMessages','value','having','`\x20>\x200','Contact','operator','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','UserId','body','keys','some','isEmpty','WhatsappAccountId','where','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','toString','sequelize','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','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','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','groupBy','WhatsappInteractionId','push','all','rows','show','params','includeAll','options','create','describe','addMessage','WhatsappMessage','ids','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','setTags','omit','spread','color','emit','removeTags','download','unix','join','root','server','tmp','files'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x938a,0x1f2));var _0xa938=function(_0xa22f2c,_0x5d5aca){_0xa22f2c=_0xa22f2c-0x0;var _0x2af0b8=_0x938a[_0xa22f2c];return _0x2af0b8;};'use strict';var emlformat=require(_0xa938('0x0'));var rimraf=require(_0xa938('0x1'));var zipdir=require(_0xa938('0x2'));var jsonpatch=require(_0xa938('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa938('0x4'));var Mustache=require(_0xa938('0x5'));var util=require(_0xa938('0x6'));var path=require('path');var sox=require(_0xa938('0x7'));var csv=require(_0xa938('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa938('0x9'));var _=require(_0xa938('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa938('0xb'));var toCsv=require(_0xa938('0x8'));var querystring=require(_0xa938('0xc'));var Papa=require('papaparse');var Redis=require(_0xa938('0xd'));var authService=require(_0xa938('0xe'));var qs=require(_0xa938('0xf'));var as=require(_0xa938('0x10'));var pdf=require(_0xa938('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa938('0x12'))(_0xa938('0x13'));var utils=require(_0xa938('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xa938('0x15')],{'host':_0xa938('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa938('0x15')]));require(_0xa938('0x17'))[_0xa938('0x18')](socket);function respondWithStatusCode(_0x4d014e,_0x1cd9d9){_0x1cd9d9=_0x1cd9d9||0xcc;return function(_0x776a3b){if(_0x776a3b){return _0x4d014e[_0xa938('0x19')](_0x1cd9d9);}return _0x4d014e[_0xa938('0x1a')](_0x1cd9d9)[_0xa938('0x1b')]();};}function respondWithResult(_0x5b5aec,_0x3d2a05){_0x3d2a05=_0x3d2a05||0xc8;return function(_0x7c29b3){if(_0x7c29b3){return _0x5b5aec[_0xa938('0x1a')](_0x3d2a05)[_0xa938('0x1c')](_0x7c29b3);}};}function respondWithFilteredResult(_0x5db39f,_0x112ec6){return function(_0x492b01){if(_0x492b01){var _0x2d8195=typeof _0x112ec6[_0xa938('0x1d')]===_0xa938('0x1e')&&typeof _0x112ec6[_0xa938('0x1f')]===_0xa938('0x1e');var _0x85f1c0=_0x492b01[_0xa938('0x20')];var _0x53bf8b=_0x2d8195?0x0:_0x112ec6[_0xa938('0x1d')];var _0x77acb6=_0x2d8195?_0x492b01[_0xa938('0x20')]:_0x112ec6[_0xa938('0x1d')]+_0x112ec6['limit'];var _0x1a5b3d;if(_0x77acb6>=_0x85f1c0){_0x77acb6=_0x85f1c0;_0x1a5b3d=0xc8;}else{_0x1a5b3d=0xce;}_0x5db39f['status'](_0x1a5b3d);return _0x5db39f['set'](_0xa938('0x21'),_0x53bf8b+'-'+_0x77acb6+'/'+_0x85f1c0)[_0xa938('0x1c')](_0x492b01);}return null;};}function patchUpdates(_0x51cde1){return function(_0xb2c127){try{jsonpatch[_0xa938('0x22')](_0xb2c127,_0x51cde1,!![]);}catch(_0x4ca84e){return BPromise['reject'](_0x4ca84e);}return _0xb2c127[_0xa938('0x23')]();};}function saveUpdates(_0x38dc2d,_0x40d476){return function(_0x461c03){if(_0x461c03){return _0x461c03[_0xa938('0x24')](_0x38dc2d)[_0xa938('0x25')](function(_0x3993b8){return _0x3993b8;});}return null;};}function removeEntity(_0x1c78db,_0x1575ef){return function(_0x5b0253){if(_0x5b0253){return _0x5b0253[_0xa938('0x26')]()[_0xa938('0x25')](function(){_0x1c78db['status'](0xcc)[_0xa938('0x1b')]();});}};}function handleEntityNotFound(_0x1aaca2,_0x56dbf8){return function(_0x182596){if(!_0x182596){_0x1aaca2[_0xa938('0x19')](0x194);}return _0x182596;};}function handleError(_0x6bb82d,_0x533d57){_0x533d57=_0x533d57||0x1f4;return function(_0x5c9342){logger[_0xa938('0x27')](_0x5c9342[_0xa938('0x28')]);if(_0x5c9342[_0xa938('0x29')]){delete _0x5c9342[_0xa938('0x29')];}_0x6bb82d[_0xa938('0x1a')](_0x533d57)['send'](_0x5c9342);};}function getInteractionUsers(_0x486f5e,_0x3ebfdc){return new BPromise(function(_0x38fb1f,_0x564dff){try{if(_0x3ebfdc[_0x486f5e['id']]){_0x486f5e[_0xa938('0x2a')]=_[_0xa938('0x2b')](_0x3ebfdc[_0x486f5e['id']],function(_0x174800){return{'id':_0x174800['id'],'fullname':_0x174800['fullname']};});}}catch(_0xc3b3d4){_0x564dff(_0xc3b3d4);}_0x38fb1f(_0x486f5e);});}function getInteractionTags(_0x40dc25,_0x1e75ab){return new BPromise(function(_0x51e215,_0x54d174){try{if(_0x40dc25[_0xa938('0x2c')]){_0x40dc25[_0xa938('0x2d')]=[];_0x40dc25[_0xa938('0x2c')]['split'](',')[_0xa938('0x2e')](function(_0x2e9395){_0x40dc25['Tags']['push'](_0x1e75ab[_0x2e9395]);});}delete _0x40dc25['TagIds'];}catch(_0x4d825a){_0x54d174(_0x4d825a);}_0x51e215(_0x40dc25);});}function updateWhatsappInteraction(_0x51ecf9,_0x54a0da,_0x3793c4){return new BPromise(function(_0x30b229,_0x35a964){return getInteractionUsers(_0x51ecf9,_0x3793c4)[_0xa938('0x25')](function(_0x1d64be){return getInteractionTags(_0x1d64be,_0x54a0da);})[_0xa938('0x25')](function(_0x113a7f){_0x30b229(_0x113a7f);})[_0xa938('0x2f')](function(_0x5b8842){_0x35a964(_0x5b8842);});});}exports[_0xa938('0x30')]=function(_0x18b13f,_0x9eb30b){var _0x255203={},_0x375e46={},_0x2de83d={'count':0x0,'rows':[]};var _0x145893=_[_0xa938('0x2b')](db[_0xa938('0x31')][_0xa938('0x32')],function(_0x2f548f){return{'name':_0x2f548f[_0xa938('0x33')],'type':_0x2f548f[_0xa938('0x34')][_0xa938('0x35')]};});_0x375e46[_0xa938('0x36')]=_[_0xa938('0x2b')](_0x145893,'name');_0x375e46['query']=_['keys'](_0x18b13f[_0xa938('0x37')]);_0x375e46[_0xa938('0x38')]=_[_0xa938('0x39')](_0x375e46[_0xa938('0x36')],_0x375e46[_0xa938('0x37')]);_0x255203['attributes']=_[_0xa938('0x39')](_0x375e46[_0xa938('0x36')],qs[_0xa938('0x3a')](_0x18b13f[_0xa938('0x37')]['fields']));_0x255203[_0xa938('0x3b')]=_0x255203[_0xa938('0x3b')]['length']?_0x255203[_0xa938('0x3b')]:_0x375e46[_0xa938('0x36')];if(!_0x18b13f['query'][_0xa938('0x3c')](_0xa938('0x3d'))){_0x255203[_0xa938('0x1f')]=qs[_0xa938('0x1f')](_0x18b13f[_0xa938('0x37')][_0xa938('0x1f')]);_0x255203[_0xa938('0x1d')]=qs[_0xa938('0x1d')](_0x18b13f['query'][_0xa938('0x1d')]);}_0x255203[_0xa938('0x3e')]=qs['sort'](_0x18b13f[_0xa938('0x37')][_0xa938('0x3f')]);_0x255203['where']=qs[_0xa938('0x38')](_[_0xa938('0x40')](_0x18b13f['query'],_0x375e46['filters']),_0x145893);var _0x6d2c99=[];var _0x546701=squel[_0xa938('0x41')]()[_0xa938('0x42')]('id')[_0xa938('0x42')](_0xa938('0x29'))[_0xa938('0x42')]('color')[_0xa938('0x43')]('tools_tags');var _0x210bc7=squel['select']()['field']('u.id')[_0xa938('0x42')](_0xa938('0x44'))[_0xa938('0x42')]('ui.WhatsappInteractionId')['from'](_0xa938('0x45'),'ui')[_0xa938('0x46')](_0xa938('0x47'),'u',_0xa938('0x48'));var _0x2e638f=squel[_0xa938('0x41')]()[_0xa938('0x43')]('whatsapp_interactions','i')[_0xa938('0x46')](_0xa938('0x49'),'c',_0xa938('0x4a'))[_0xa938('0x46')](_0xa938('0x47'),'o','o.id\x20=\x20i.UserId')['left_join'](_0xa938('0x4b'),'a',_0xa938('0x4c'))[_0xa938('0x46')](_0xa938('0x4d'),'me','me.WhatsappInteractionId\x20=\x20i.id')[_0xa938('0x46')](_0xa938('0x4e'),'it',_0xa938('0x4f'))[_0xa938('0x46')](_0xa938('0x50'),'t',_0xa938('0x51'));var _0xb8bd5e=squel[_0xa938('0x52')]();var _0x22895c=[];var _0x35728e=squel[_0xa938('0x52')]();var _0x55a883;if(_0x18b13f['query'][_0xa938('0x53')]){_0x55a883=as[_0xa938('0x54')](_0x18b13f['query'][_0xa938('0x53')]);var _0x3ca994=_0x55a883['sqlOperator'];for(var _0x59f7cb=0x0;_0x59f7cb<_0x55a883['conditions']['length'];_0x59f7cb++){var _0x20bd2b=_0x55a883[_0xa938('0x55')][_0x59f7cb];var _0x355b69='i';var _0x3b901d=_['find'](_0x145893,[_0xa938('0x29'),_0x20bd2b[_0xa938('0x42')]]);if(!_0x3b901d){switch(_0x20bd2b[_0xa938('0x42')]){case _0xa938('0x56'):if(_0x20bd2b[_0xa938('0x57')]==0x1){_0x2e638f[_0xa938('0x58')]('`'+_0x20bd2b[_0xa938('0x42')]+'`\x20=\x200');}else{_0x2e638f[_0xa938('0x58')]('`'+_0x20bd2b[_0xa938('0x42')]+_0xa938('0x59'));}break;case _0xa938('0x5a'):if(_0x20bd2b[_0xa938('0x5b')]==='$substring'){if(_0x20bd2b[_0xa938('0x57')]['split']('\x20')[_0xa938('0x5c')]>0x1){_0xb8bd5e[_0x3ca994](_0xa938('0x5d'),qs[_0xa938('0x5e')](_0x20bd2b[_0xa938('0x57')]),null);}else{var _0x20df0c='%'+_0x20bd2b['value']+'%';_0xb8bd5e[_0x3ca994](_0xa938('0x5f'),_0x20df0c,_0x20df0c,_0x20df0c);}}else{_0x3b901d=_[_0xa938('0x60')](_0x145893,[_0xa938('0x29'),'ContactId']);_0x20bd2b[_0xa938('0x42')]=_0xa938('0x61');_0x52051f=as[_0xa938('0x62')](_0x355b69,_0x3b901d[_0xa938('0x34')],_0x20bd2b);_0xb8bd5e[_0x3ca994](_0x52051f[_0xa938('0x63')],_0x52051f[_0xa938('0x57')][_0xa938('0x64')],_0x52051f[_0xa938('0x57')][_0xa938('0x1b')]);}break;case _0xa938('0x65'):var _0x59fcee=_0x20bd2b[_0xa938('0x57')][_0xa938('0x66')](',')['map'](function(_0x1c876a){return Number(_0x1c876a);});_0x59fcee[_0xa938('0x2e')](function(_0x334beb){_0x35728e['or'](_0xa938('0x67'),'%,'+_0x334beb+',%');});_0x22895c=_['union'](_0x22895c,_0x59fcee);break;case _0xa938('0x68'):if(_0x20bd2b['operator']==='$substring'){_0xb8bd5e[_0x3ca994]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x20bd2b['value']+'%',null);}else{_0x3b901d=_[_0xa938('0x60')](_0x145893,[_0xa938('0x29'),_0xa938('0x69')]);_0x20bd2b[_0xa938('0x42')]=_0xa938('0x69');_0x52051f=as['buildExpression'](_0x355b69,_0x3b901d[_0xa938('0x34')],_0x20bd2b);_0xb8bd5e[_0x3ca994](_0x52051f[_0xa938('0x63')],_0x52051f['value'][_0xa938('0x64')],_0x52051f[_0xa938('0x57')][_0xa938('0x1b')]);}break;case _0xa938('0x6a'):_0x52051f=as[_0xa938('0x62')]('me',null,_0x20bd2b);_0xb8bd5e[_0x3ca994](_0x52051f[_0xa938('0x63')],_0x52051f[_0xa938('0x57')][_0xa938('0x64')],_0x52051f[_0xa938('0x57')][_0xa938('0x1b')]);break;}}else{var _0x52051f=as['buildExpression'](_0x355b69,_0x3b901d[_0xa938('0x34')],_0x20bd2b);_0xb8bd5e[_0x3ca994](_0x52051f[_0xa938('0x63')],_0x52051f[_0xa938('0x57')][_0xa938('0x64')],_0x52051f[_0xa938('0x57')][_0xa938('0x1b')]);}}}else{var _0x3d77a7=_(_0x18b13f[_0xa938('0x37')])[_0xa938('0x6b')]()[_0xa938('0x2b')](function(_0x4687d0){return _[_0xa938('0x6c')](_0x145893,['name',_0x4687d0])?_0x4687d0:undefined;})['compact']()[_0xa938('0x57')]();if(!_[_0xa938('0x6d')](_0x3d77a7)){_0x3d77a7['forEach'](function(_0x4b37ef){if(_0x4b37ef===_0xa938('0x6e')){_0x2e638f[_0xa938('0x6f')]('i.WhatsappAccountId\x20IN\x20?',[][_0xa938('0x70')](_0x18b13f[_0xa938('0x37')][_0x4b37ef]));}else if(_0x4b37ef===_0xa938('0x71')){var _0x597bbf=JSON[_0xa938('0x72')](_0x18b13f[_0xa938('0x37')][_0x4b37ef])[_0xa938('0x73')];var _0x176b48=JSON[_0xa938('0x72')](_0x18b13f[_0xa938('0x37')][_0x4b37ef])[_0xa938('0x74')];_0x2e638f[_0xa938('0x6f')](_0xa938('0x75'),_0x597bbf,_0x176b48);}else{if(_0x18b13f[_0xa938('0x37')][_0x4b37ef]==='null'){_0x2e638f[_0xa938('0x6f')]('i.'+_0x4b37ef+'\x20IS\x20NULL');}else{_0x2e638f['where']('i.'+_0x4b37ef+_0xa938('0x76'),_0x18b13f[_0xa938('0x37')][_0x4b37ef]);}}});}if(_0x18b13f[_0xa938('0x37')]['read']){if(_0x18b13f[_0xa938('0x37')][_0xa938('0x77')]==0x1){_0x2e638f[_0xa938('0x58')](_0xa938('0x78'));}else{_0x2e638f[_0xa938('0x58')](_0xa938('0x79'));}}if(_0x18b13f[_0xa938('0x37')][_0xa938('0x7a')]){_0x22895c=_[_0xa938('0x7b')](_0x18b13f[_0xa938('0x37')][_0xa938('0x7a')])?_0x18b13f[_0xa938('0x37')][_0xa938('0x7a')]:new Array(_0x18b13f[_0xa938('0x37')]['tag']);_0x22895c[_0xa938('0x2e')](function(_0x36f1af){_0x35728e['or'](_0xa938('0x67'),'%,'+_0x36f1af+',%');});}if(_0x18b13f[_0xa938('0x37')]['filter']){var _0x21fbe6=_0x18b13f['query'][_0xa938('0x7c')][_0xa938('0x7d')]('\x5c','\x5c\x5c')[_0xa938('0x7d')](/'/g,'\x27\x27');if(qs[_0xa938('0x7e')](_0x21fbe6)){_0xb8bd5e['or'](_0xa938('0x7f'),_0x21fbe6+'%')['or'](_0xa938('0x80'),_0x21fbe6+'%');}else{_0xb8bd5e['or'](_0xa938('0x81'),qs[_0xa938('0x5e')](_0x21fbe6))['or'](_0xa938('0x82'),_0x21fbe6+'%');}}}_0x2e638f[_0xa938('0x6f')](_0xb8bd5e);_0x2e638f[_0xa938('0x83')](_0xa938('0x84'));var _0xfa3c56={'type':db[_0xa938('0x85')][_0xa938('0x86')]['SELECT'],'raw':!![]};var _0x36cf1a=_0x2e638f[_0xa938('0x87')]();_0x36cf1a[_0xa938('0x42')](_0xa938('0x84'));_0x36cf1a[_0xa938('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa938('0x56'));if(_0x255203[_0xa938('0x3e')]){_0x255203[_0xa938('0x3e')][_0xa938('0x2e')](function(_0x152a39){var _0x2d9e12=_0x152a39[0x0]===_0xa938('0x88')?_0x152a39[0x0]:'i.'+_0x152a39[0x0];_0x2e638f[_0xa938('0x3e')](_0x2d9e12,_0x152a39[0x1]===_0xa938('0x89')?![]:!![]);});}if(!_[_0xa938('0x6d')](_0x22895c)){_0x2e638f[_0xa938('0x58')](_0x35728e);_0x36cf1a[_0xa938('0x6f')](_0xa938('0x8a'),_0x22895c);}BPromise[_0xa938('0x8b')]()['then'](function(){if(!_0x55a883){if(_0x18b13f['query'][_0xa938('0x6e')])return;_0x36cf1a[_0xa938('0x6f')](_0xa938('0x8c'));_0x2e638f['where'](_0xa938('0x8c'));return;}if(_0x18b13f[_0xa938('0x8d')][_0xa938('0x8e')]!==_0xa938('0x8f'))return;return _0x18b13f[_0xa938('0x8d')][_0xa938('0x90')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3d854a){if(_['isEmpty'](_0x3d854a)){_0x36cf1a[_0xa938('0x6f')](_0xa938('0x91'));_0x2e638f[_0xa938('0x6f')](_0xa938('0x91'));}else{_0x36cf1a[_0xa938('0x6f')](_0xa938('0x92'),_[_0xa938('0x2b')](_0x3d854a,'id'));_0x2e638f[_0xa938('0x6f')](_0xa938('0x92'),_[_0xa938('0x2b')](_0x3d854a,'id'));}});})[_0xa938('0x25')](function(){if(_0x18b13f[_0xa938('0x8d')][_0xa938('0x8e')]==='agent'&&!_0x55a883&&!_0x18b13f[_0xa938('0x37')][_0xa938('0x6e')])return[];return db['sequelize'][_0xa938('0x37')](_0x36cf1a[_0xa938('0x93')](),_0xfa3c56);})['then'](function(_0x5bbe5){_0x2de83d[_0xa938('0x20')]=_0x5bbe5[_0xa938('0x5c')];if(_0x2de83d[_0xa938('0x20')]===0x0)return[];return db[_0xa938('0x94')][_0xa938('0x37')](_0x546701[_0xa938('0x93')](),_0xfa3c56)['then'](function(_0x4a71d7){_0x6d2c99=_['keyBy'](_0x4a71d7,'id');_0xfa3c56=_[_0xa938('0x95')](_0xfa3c56,{'model':db[_0xa938('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x18b13f[_0xa938('0x37')][_0xa938('0x3a')]){_0x255203['attributes'][_0xa938('0x2e')](function(_0x5cf515){_0x2e638f[_0xa938('0x42')]('i.'+_0x5cf515);});}else{_0x2e638f[_0xa938('0x42')](_0xa938('0x96'),_0xa938('0x56'));_0x2e638f[_0xa938('0x42')](_0xa938('0x97'),_0xa938('0x98'));_0x2e638f[_0xa938('0x42')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x2e638f['field'](_0xa938('0x99'),_0xa938('0x88'));_0x2e638f[_0xa938('0x42')](_0xa938('0x9a'));_0x2e638f[_0xa938('0x42')](_0xa938('0x9b'),'Contact.firstName');_0x2e638f[_0xa938('0x42')]('c.lastName',_0xa938('0x9c'));_0x2e638f['field']('c.email',_0xa938('0x9d'));_0x2e638f[_0xa938('0x42')](_0xa938('0x9e'),_0xa938('0x9f'));_0x2e638f[_0xa938('0x42')](_0xa938('0xa0'),_0xa938('0xa1'));_0x2e638f[_0xa938('0x42')](_0xa938('0xa2'),_0xa938('0xa3'));_0x2e638f[_0xa938('0x42')](_0xa938('0xa4'),_0xa938('0xa5'));_0x2e638f['field'](_0xa938('0xa6'),_0xa938('0xa7'));_0x2e638f[_0xa938('0x42')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xa938('0x2c'));}if(_0x255203['limit'])_0x2e638f[_0xa938('0x1f')](_0x255203[_0xa938('0x1f')]);if(_0x255203['offset'])_0x2e638f[_0xa938('0x1d')](_0x255203[_0xa938('0x1d')]);return db['sequelize'][_0xa938('0x37')](_0x2e638f[_0xa938('0x93')](),_0xfa3c56);})['then'](function(_0x2a880c){if(_0x2a880c['length']>0x0)_0x210bc7['where']('ui.WhatsappInteractionId\x20IN\x20?',_[_0xa938('0x2b')](_0x2a880c,'id'));return db['sequelize'][_0xa938('0x37')](_0x210bc7['toString'](),_0xfa3c56)[_0xa938('0x25')](function(_0x5d6f59){var _0x4d9d7d=_[_0xa938('0xa8')](_0x5d6f59,_0xa938('0xa9'));var _0x2342d3=[];_0x2a880c[_0xa938('0x2e')](function(_0x19bfb8){_0x2342d3[_0xa938('0xaa')](updateWhatsappInteraction(_0x19bfb8,_0x6d2c99,_0x4d9d7d));});return BPromise[_0xa938('0xab')](_0x2342d3);});});})[_0xa938('0x25')](function(_0x1dfff2){_0x2de83d[_0xa938('0xac')]=_0x1dfff2;return _0x2de83d;})[_0xa938('0x25')](respondWithFilteredResult(_0x9eb30b,_0x255203))[_0xa938('0x2f')](handleError(_0x9eb30b,null));};exports[_0xa938('0xad')]=function(_0x36b90e,_0x44bd08){var _0x2f03be={'raw':![],'where':{'id':_0x36b90e[_0xa938('0xae')]['id']}},_0x37048d={};_0x37048d[_0xa938('0x36')]=_['keys'](db[_0xa938('0x31')][_0xa938('0x32')]);_0x37048d[_0xa938('0x37')]=_[_0xa938('0x6b')](_0x36b90e[_0xa938('0x37')]);_0x37048d[_0xa938('0x38')]=_[_0xa938('0x39')](_0x37048d['model'],_0x37048d[_0xa938('0x37')]);_0x2f03be[_0xa938('0x3b')]=_['intersection'](_0x37048d[_0xa938('0x36')],qs[_0xa938('0x3a')](_0x36b90e[_0xa938('0x37')][_0xa938('0x3a')]));_0x2f03be[_0xa938('0x3b')]=_0x2f03be[_0xa938('0x3b')][_0xa938('0x5c')]?_0x2f03be['attributes']:_0x37048d[_0xa938('0x36')];if(_0x36b90e['query'][_0xa938('0xaf')]){_0x2f03be['include']=[{'all':!![]}];}_0x2f03be=_[_0xa938('0x95')]({},_0x2f03be,_0x36b90e[_0xa938('0xb0')]);return db[_0xa938('0x31')][_0xa938('0x60')](_0x2f03be)['then'](handleEntityNotFound(_0x44bd08,null))[_0xa938('0x25')](respondWithResult(_0x44bd08,null))[_0xa938('0x2f')](handleError(_0x44bd08,null));};exports[_0xa938('0xb1')]=function(_0x56fe9b,_0x557afc){return db['WhatsappInteraction'][_0xa938('0xb1')](_0x56fe9b[_0xa938('0x6a')],{})[_0xa938('0x25')](respondWithResult(_0x557afc,0xc9))[_0xa938('0x2f')](handleError(_0x557afc,null));};exports[_0xa938('0x24')]=function(_0x2ae38a,_0x495848){if(_0x2ae38a['body']['id']){delete _0x2ae38a['body']['id'];}return db[_0xa938('0x31')][_0xa938('0x60')]({'where':{'id':_0x2ae38a[_0xa938('0xae')]['id']}})[_0xa938('0x25')](handleEntityNotFound(_0x495848,null))[_0xa938('0x25')](saveUpdates(_0x2ae38a[_0xa938('0x6a')],null))['then'](respondWithResult(_0x495848,null))[_0xa938('0x2f')](handleError(_0x495848,null));};exports[_0xa938('0x26')]=function(_0x35a41b,_0x5552b4){return db[_0xa938('0x31')][_0xa938('0x60')]({'where':{'id':_0x35a41b[_0xa938('0xae')]['id']}})[_0xa938('0x25')](handleEntityNotFound(_0x5552b4,null))[_0xa938('0x25')](removeEntity(_0x5552b4,null))[_0xa938('0x2f')](handleError(_0x5552b4,null));};exports[_0xa938('0xb2')]=function(_0xf4d657,_0x498039){return db[_0xa938('0x31')][_0xa938('0xb2')]()['then'](respondWithResult(_0x498039,null))[_0xa938('0x2f')](handleError(_0x498039,null));};exports[_0xa938('0xb3')]=function(_0x53cf99,_0x1e0f20,_0x95bff7){return db[_0xa938('0xb4')][_0xa938('0x60')]({'where':{'id':_0x53cf99[_0xa938('0xae')]['id']}})['then'](handleEntityNotFound(_0x1e0f20,null))[_0xa938('0x25')](function(_0xe7eb64){if(_0xe7eb64){return _0xe7eb64[_0xa938('0xb3')](_0x53cf99['body'][_0xa938('0xb5')],_['omit'](_0x53cf99[_0xa938('0x6a')],[_0xa938('0xb5'),'id'])||{});}})['then'](respondWithResult(_0x1e0f20,null))[_0xa938('0x2f')](handleError(_0x1e0f20,null));};exports[_0xa938('0xb6')]=function(_0xea65ab,_0x60207f,_0x45ff17){var _0x28011a={'raw':![],'where':{}};var _0x4c80d7={};var _0x382396={'count':0x0,'rows':[]};return db[_0xa938('0x31')][_0xa938('0xb7')]({'where':{'id':_0xea65ab[_0xa938('0xae')]['id']}})[_0xa938('0x25')](handleEntityNotFound(_0x60207f,null))[_0xa938('0x25')](function(_0x3e7e16){if(_0x3e7e16){_0x4c80d7[_0xa938('0x36')]=_['keys'](db[_0xa938('0xb4')][_0xa938('0x32')]);_0x4c80d7['query']=_[_0xa938('0x6b')](_0xea65ab['query']);_0x4c80d7[_0xa938('0x38')]=_[_0xa938('0x39')](_0x4c80d7[_0xa938('0x36')],_0x4c80d7[_0xa938('0x37')]);_0x28011a[_0xa938('0x3b')]=_[_0xa938('0x39')](_0x4c80d7['model'],qs['fields'](_0xea65ab['query'][_0xa938('0x3a')]));_0x28011a[_0xa938('0x3b')]=_0x28011a[_0xa938('0x3b')][_0xa938('0x5c')]?_0x28011a[_0xa938('0x3b')]:_0x4c80d7['model'];if(!_0xea65ab[_0xa938('0x37')][_0xa938('0x3c')]('nolimit')){_0x28011a[_0xa938('0x1f')]=qs[_0xa938('0x1f')](_0xea65ab[_0xa938('0x37')]['limit']);_0x28011a[_0xa938('0x1d')]=qs[_0xa938('0x1d')](_0xea65ab[_0xa938('0x37')][_0xa938('0x1d')]);}_0x28011a[_0xa938('0x3e')]=qs[_0xa938('0x3f')](_0xea65ab[_0xa938('0x37')]['sort']);_0x28011a[_0xa938('0x6f')]=qs[_0xa938('0x38')](_['pick'](_0xea65ab[_0xa938('0x37')],_0x4c80d7[_0xa938('0x38')]));_0x28011a[_0xa938('0x6f')][_0xa938('0xa9')]=_0x3e7e16['id'];if(_0xea65ab[_0xa938('0x37')][_0xa938('0x7c')]){_0x28011a['where']=_[_0xa938('0x95')](_0x28011a[_0xa938('0x6f')],{'$or':_[_0xa938('0x2b')](_0x28011a['attributes'],function(_0x131ded){var _0x4c8b15={};_0x4c8b15[_0x131ded]={'$like':'%'+_0xea65ab[_0xa938('0x37')][_0xa938('0x7c')]+'%'};return _0x4c8b15;})});}if(_0xea65ab['query'][_0xa938('0x73')]){var _0x901b2b=_0xea65ab['query'][_0xa938('0x73')][_0xa938('0x66')](',');var _0x2d88a4={};_0x2d88a4[_0x901b2b[0x0]]={'$gte':moment(_0x901b2b[0x1])[_0xa938('0xb8')](_0xa938('0xb9'))};_0x28011a[_0xa938('0x6f')]=_[_0xa938('0x95')](_0x28011a[_0xa938('0x6f')],_0x2d88a4);}_0x28011a=_['merge']({},_0x28011a,_0xea65ab[_0xa938('0xb0')]);return db[_0xa938('0xb4')][_0xa938('0x20')]({'where':_0x28011a[_0xa938('0x6f')]})[_0xa938('0x25')](function(_0x34e2c6){_0x382396['count']=_0x34e2c6;if(_0xea65ab[_0xa938('0x37')]['includeAll']){_0x28011a[_0xa938('0xba')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xa938('0xbb')](_0x28011a);})[_0xa938('0x25')](function(_0x5a1185){_0x382396[_0xa938('0xac')]=_0x5a1185;return _0x382396;});}})[_0xa938('0x25')](respondWithFilteredResult(_0x60207f,_0x28011a))[_0xa938('0x2f')](handleError(_0x60207f,null));};exports['addTags']=function(_0x227330,_0x498da5,_0x2317c7){return db[_0xa938('0x31')][_0xa938('0x60')]({'where':{'id':_0x227330[_0xa938('0xae')]['id']}})[_0xa938('0x25')](handleEntityNotFound(_0x498da5,null))[_0xa938('0x25')](function(_0x340a83){if(_0x340a83){return _0x340a83[_0xa938('0xbc')](_0x227330[_0xa938('0x6a')][_0xa938('0xb5')],_[_0xa938('0xbd')](_0x227330[_0xa938('0x6a')],['ids','id'])||{})[_0xa938('0xbe')](function(){return db[_0xa938('0x65')][_0xa938('0xbb')]({'attributes':['id','name',_0xa938('0xbf')],'where':{'id':_0x227330[_0xa938('0x6a')]['ids']}});})[_0xa938('0x25')](function(_0x5c5dd7){socket[_0xa938('0xc0')]('whatsappInteractionTags:save',{'id':Number(_0x227330[_0xa938('0xae')]['id']),'tags':_0x5c5dd7||[]});return{'id':Number(_0x227330['params']['id']),'tags':_0x5c5dd7||[]};});}})[_0xa938('0x25')](respondWithResult(_0x498da5,null))[_0xa938('0x2f')](handleError(_0x498da5,null));};exports[_0xa938('0xc1')]=function(_0x74178c,_0x3db906,_0x26aa85){return db[_0xa938('0x31')][_0xa938('0x60')]({'where':{'id':_0x74178c[_0xa938('0xae')]['id']}})['then'](handleEntityNotFound(_0x3db906,null))[_0xa938('0x25')](function(_0x9c4945){if(_0x9c4945){return _0x9c4945[_0xa938('0xc1')](_0x74178c[_0xa938('0x37')][_0xa938('0xb5')]);}})[_0xa938('0x25')](respondWithStatusCode(_0x3db906,null))[_0xa938('0x2f')](handleError(_0x3db906,null));};exports[_0xa938('0xc2')]=function(_0x49c91c,_0x14fe1b){var _0x4669ed=moment()[_0xa938('0xc3')]()[_0xa938('0x93')]();var _0x1ca260=path[_0xa938('0xc4')](config[_0xa938('0xc5')],_0xa938('0xc6'),'files',_0xa938('0xc7'));var _0xe9578b=path[_0xa938('0xc4')](config[_0xa938('0xc5')],'server',_0xa938('0xc8'),_0xa938('0xc9'));var _0x2b1458=path[_0xa938('0xc4')](_0x1ca260,_0x4669ed);var _0x41b97d=util[_0xa938('0xb8')]('transcript-%d-%s.zip',_0x49c91c[_0xa938('0xae')]['id'],_0x4669ed);var _0x4b264a=path[_0xa938('0xc4')](_0x1ca260,_0x41b97d);var _0x548009=[];_0x548009['push']({'model':db[_0xa938('0x68')],'as':_0xa938('0x68'),'attributes':['id',_0xa938('0xca')],'raw':!![]});_0x548009[_0xa938('0xaa')]({'model':db[_0xa938('0xcb')],'as':_0xa938('0x5a'),'attributes':['id',_0xa938('0xcc'),_0xa938('0xcd')],'raw':!![]});if(_0x49c91c[_0xa938('0x37')][_0xa938('0xc9')]){_0x548009[_0xa938('0xaa')]({'model':db[_0xa938('0xce')],'as':_0xa938('0xce'),'raw':!![]});}var _0x59735c=[{'model':db[_0xa938('0xb4')],'as':_0xa938('0xcf'),'attributes':['id','body',_0xa938('0x71'),_0xa938('0xd0'),_0xa938('0xd1'),_0xa938('0x77')],'include':_0x548009}];_0x59735c[_0xa938('0xaa')]({'model':db[_0xa938('0xd2')],'as':_0xa938('0xd3'),'attributes':['id',_0xa938('0x29')]});_0x59735c[_0xa938('0xaa')]({'model':db[_0xa938('0x68')],'as':_0xa938('0xd4'),'attributes':['id',_0xa938('0xca')]});return db['WhatsappInteraction'][_0xa938('0x60')]({'where':{'id':_0x49c91c['params']['id']},'include':_0x59735c})[_0xa938('0x25')](handleEntityNotFound(_0x14fe1b,null))[_0xa938('0x25')](function(_0x15b6e8){if(_0x15b6e8){var _0x141977=_0x15b6e8[_0xa938('0xd5')]({'plain':!![]});fs[_0xa938('0xd6')](_0x2b1458);var _0x3df267={'channel':'Whatsapp','account':_0x141977[_0xa938('0xd3')][_0xa938('0x29')],'agent':_0x141977[_0xa938('0xd4')]?_0x141977[_0xa938('0xd4')][_0xa938('0xca')]:_0xa938('0xd7'),'createdAt':moment(_0x141977['createdAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xa938('0x93')](),'closedAt':_0x141977[_0xa938('0xd8')]?moment(_0x141977[_0xa938('0xd9')])[_0xa938('0xb8')](_0xa938('0xb9'))[_0xa938('0x93')]():'','disposition':_0x141977[_0xa938('0xda')],'messages':_(_0x141977[_0xa938('0xcf')])['filter']({'secret':![]})[_0xa938('0x2b')](function(_0x1c3d4a){if(_0x1c3d4a[_0xa938('0xce')]){var _0x20f992=path['join'](_0xe9578b,_0x1c3d4a['Attachment'][_0xa938('0xdb')]);if(fs[_0xa938('0xdc')](_0x20f992)){fs['createReadStream'](_0x20f992)['pipe'](fs[_0xa938('0xdd')](path[_0xa938('0xc4')](_0x2b1458,_0x1c3d4a['Attachment']['basename'])));}}return{'date':moment(_0x1c3d4a['createdAt'])[_0xa938('0xb8')](_0xa938('0xb9'))['toString'](),'sender':_0x1c3d4a[_0xa938('0xd0')]===_0xa938('0xde')?_0x1c3d4a[_0xa938('0x68')]?_0x1c3d4a[_0xa938('0x68')]['fullname']:_0xa938('0xdf'):_0x1c3d4a[_0xa938('0x5a')][_0xa938('0xcc')]+(_0x1c3d4a['Contact'][_0xa938('0xcd')]?'\x20'+_0x1c3d4a[_0xa938('0x5a')][_0xa938('0xcd')]:''),'body':_0x1c3d4a[_0xa938('0xce')]?_0x1c3d4a[_0xa938('0xce')]['basename']:_0x1c3d4a[_0xa938('0x6a')],'direction':_0x1c3d4a['direction']===_0xa938('0xde')?'A':'C','secret':_0x1c3d4a[_0xa938('0xd1')],'read':_0x1c3d4a[_0xa938('0x77')],'attachment':_0x1c3d4a['Attachment']};})[_0xa938('0x57')]()};return ejs['renderFile'](path['join'](config[_0xa938('0xc5')],'server',_0xa938('0xe0'),_0xa938('0xe1')),{'interaction':_0x3df267})[_0xa938('0x25')](function(_0x4f00ec){var _0x5d5d1e=path[_0xa938('0xc4')](_0x2b1458,_0xa938('0xe2')+_0x141977['id']+'-'+_0x4669ed+_0xa938('0xe3'));var _0x5dd307={'path':_0x5d5d1e,'channel':_0xa938('0xe4'),'interactionId':_0x141977['id']};return pdf[_0xa938('0xe5')](_0x4f00ec,_0x5dd307);})[_0xa938('0x25')](function(){return new BPromise(function(_0x3937f4,_0x40d981){zipdir(_0x2b1458,{'saveTo':_0x4b264a},function(_0x450b09,_0x32621a){if(_0x450b09)return _0x40d981(_0x450b09);return _0x3937f4(_0x32621a);});})[_0xa938('0x25')](function(){return new BPromise(function(_0x3e1d81,_0x1ac8c1){rimraf(_0x2b1458,function(_0x5cc809){if(_0x5cc809)_0x1ac8c1(_0x5cc809);return _0x3e1d81();});});})[_0xa938('0x25')](function(){return _0x14fe1b[_0xa938('0xc2')](_0x4b264a,_0x41b97d,function(_0x5cba63){if(_0x5cba63){console[_0xa938('0xe6')](_0xa938('0xe7'),_0x5cba63);}else{fs[_0xa938('0xe8')](_0x4b264a);}});});});}else{return _0x14fe1b[_0xa938('0x19')](0xc8);}})['catch'](handleError(_0x14fe1b,null));};
\ No newline at end of file
+var _0xeed7=['../../config/license/util','../../mysqldb','defaults','redis','localhost','./whatsappInteraction.socket','register','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','status','end','sendStatus','error','stack','name','send','Users','map','fullname','TagIds','split','forEach','push','catch','index','WhatsappInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','select','field','color','from','u.id','ui.WhatsappInteractionId','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','tools_tags','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','SELECT','clone','contactName','DESC','isEmpty','t.id\x20IN\x20?','resolve','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','agent','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','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.WhatsappInteractionId\x20IN\x20?','rows','show','includeAll','include','options','create','params','describe','addMessage','ids','omit','findOne','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','WhatsappMessage','findAll','addTags','setTags','spread','emit','whatsappInteractionTags:save','removeTags','download','unix','join','server','files','root','attachments','User','CmContact','firstName','lastName','Attachment','Messages','direction','secret','WhatsappAccount','Owner','mkdirSync','Account','N.A.','closed','closedAt','disposition','basename','createReadStream','pipe','out','System','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','Whatsapp','createPdfFromHTML','log','err','unlinkSync','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x4f3da4,_0x121375){var _0x1df1a1=function(_0x329dfc){while(--_0x329dfc){_0x4f3da4['push'](_0x4f3da4['shift']());}};_0x1df1a1(++_0x121375);}(_0xeed7,0xdf));var _0x7eed=function(_0x4d7d65,_0x43328f){_0x4d7d65=_0x4d7d65-0x0;var _0x56d2ae=_0xeed7[_0x4d7d65];return _0x56d2ae;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7eed('0x0'));var jsonpatch=require(_0x7eed('0x1'));var rp=require('request-promise');var moment=require(_0x7eed('0x2'));var BPromise=require(_0x7eed('0x3'));var Mustache=require(_0x7eed('0x4'));var util=require(_0x7eed('0x5'));var path=require('path');var sox=require(_0x7eed('0x6'));var csv=require(_0x7eed('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7eed('0x8'));var _=require(_0x7eed('0x9'));var squel=require(_0x7eed('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7eed('0xb'));var toCsv=require(_0x7eed('0x7'));var querystring=require(_0x7eed('0xc'));var Papa=require('papaparse');var Redis=require(_0x7eed('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7eed('0xe'));var pdf=require(_0x7eed('0xf'));var hardwareService=require(_0x7eed('0x10'));var logger=require(_0x7eed('0x11'))(_0x7eed('0x12'));var utils=require(_0x7eed('0x13'));var config=require(_0x7eed('0x14'));var licenseUtil=require(_0x7eed('0x15'));var db=require(_0x7eed('0x16'))['db'];config['redis']=_[_0x7eed('0x17')](config[_0x7eed('0x18')],{'host':_0x7eed('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7eed('0x1a'))[_0x7eed('0x1b')](socket);function respondWithStatusCode(_0xe64c1,_0xdcfc59){_0xdcfc59=_0xdcfc59||0xcc;return function(_0x431738){if(_0x431738){return _0xe64c1['sendStatus'](_0xdcfc59);}return _0xe64c1['status'](_0xdcfc59)['end']();};}function respondWithResult(_0xdcfd1,_0x4f96c6){_0x4f96c6=_0x4f96c6||0xc8;return function(_0x545ca9){if(_0x545ca9){return _0xdcfd1['status'](_0x4f96c6)[_0x7eed('0x1c')](_0x545ca9);}};}function respondWithFilteredResult(_0x2fe55f,_0x5143db){return function(_0x1b36bb){if(_0x1b36bb){var _0x3ab3e2=typeof _0x5143db[_0x7eed('0x1d')]===_0x7eed('0x1e')&&typeof _0x5143db[_0x7eed('0x1f')]===_0x7eed('0x1e');var _0x2056df=_0x1b36bb[_0x7eed('0x20')];var _0x27b873=_0x3ab3e2?0x0:_0x5143db[_0x7eed('0x1d')];var _0x45357c=_0x3ab3e2?_0x1b36bb['count']:_0x5143db[_0x7eed('0x1d')]+_0x5143db['limit'];var _0x289d64;if(_0x45357c>=_0x2056df){_0x45357c=_0x2056df;_0x289d64=0xc8;}else{_0x289d64=0xce;}_0x2fe55f['status'](_0x289d64);return _0x2fe55f[_0x7eed('0x21')](_0x7eed('0x22'),_0x27b873+'-'+_0x45357c+'/'+_0x2056df)['json'](_0x1b36bb);}return null;};}function patchUpdates(_0x51e60e){return function(_0x5201ca){try{jsonpatch[_0x7eed('0x23')](_0x5201ca,_0x51e60e,!![]);}catch(_0x451e71){return BPromise[_0x7eed('0x24')](_0x451e71);}return _0x5201ca[_0x7eed('0x25')]();};}function saveUpdates(_0xfe3c86,_0x811eeb){return function(_0x329e5f){if(_0x329e5f){return _0x329e5f[_0x7eed('0x26')](_0xfe3c86)[_0x7eed('0x27')](function(_0x3e4824){return _0x3e4824;});}return null;};}function removeEntity(_0x2fc47f,_0x20420f){return function(_0x291b7c){if(_0x291b7c){return _0x291b7c[_0x7eed('0x28')]()[_0x7eed('0x27')](function(){_0x2fc47f[_0x7eed('0x29')](0xcc)[_0x7eed('0x2a')]();});}};}function handleEntityNotFound(_0x34c4ac,_0x1ee2e5){return function(_0x40d9a0){if(!_0x40d9a0){_0x34c4ac[_0x7eed('0x2b')](0x194);}return _0x40d9a0;};}function handleError(_0x356828,_0x34e625){_0x34e625=_0x34e625||0x1f4;return function(_0x764ea3){logger[_0x7eed('0x2c')](_0x764ea3[_0x7eed('0x2d')]);if(_0x764ea3[_0x7eed('0x2e')]){delete _0x764ea3[_0x7eed('0x2e')];}_0x356828[_0x7eed('0x29')](_0x34e625)[_0x7eed('0x2f')](_0x764ea3);};}function getInteractionUsers(_0x2abdd7,_0x3d6e09){return new BPromise(function(_0x6233d2,_0xc3d47e){try{if(_0x3d6e09[_0x2abdd7['id']]){_0x2abdd7[_0x7eed('0x30')]=_[_0x7eed('0x31')](_0x3d6e09[_0x2abdd7['id']],function(_0x55fae2){return{'id':_0x55fae2['id'],'fullname':_0x55fae2[_0x7eed('0x32')]};});}}catch(_0x34be5b){_0xc3d47e(_0x34be5b);}_0x6233d2(_0x2abdd7);});}function getInteractionTags(_0x1b17bb,_0x28e4d5){return new BPromise(function(_0x428180,_0x495471){try{if(_0x1b17bb['TagIds']){_0x1b17bb['Tags']=[];_0x1b17bb[_0x7eed('0x33')][_0x7eed('0x34')](',')[_0x7eed('0x35')](function(_0x2ca885){_0x1b17bb['Tags'][_0x7eed('0x36')](_0x28e4d5[_0x2ca885]);});}delete _0x1b17bb[_0x7eed('0x33')];}catch(_0x5dd011){_0x495471(_0x5dd011);}_0x428180(_0x1b17bb);});}function updateWhatsappInteraction(_0x533db1,_0x5447c6,_0x3320a7){return new BPromise(function(_0x13889c,_0x486cba){return getInteractionUsers(_0x533db1,_0x3320a7)[_0x7eed('0x27')](function(_0x558c87){return getInteractionTags(_0x558c87,_0x5447c6);})[_0x7eed('0x27')](function(_0x1fd843){_0x13889c(_0x1fd843);})[_0x7eed('0x37')](function(_0x40177a){_0x486cba(_0x40177a);});});}exports[_0x7eed('0x38')]=function(_0xfd70a1,_0x2f7e9a){var _0x36c708={},_0x57c89e={},_0x4eaeb4={'count':0x0,'rows':[]};var _0x55c1c=_[_0x7eed('0x31')](db[_0x7eed('0x39')][_0x7eed('0x3a')],function(_0x23878b){return{'name':_0x23878b[_0x7eed('0x3b')],'type':_0x23878b[_0x7eed('0x3c')][_0x7eed('0x3d')]};});_0x57c89e[_0x7eed('0x3e')]=_[_0x7eed('0x31')](_0x55c1c,'name');_0x57c89e[_0x7eed('0x3f')]=_[_0x7eed('0x40')](_0xfd70a1[_0x7eed('0x3f')]);_0x57c89e['filters']=_[_0x7eed('0x41')](_0x57c89e['model'],_0x57c89e[_0x7eed('0x3f')]);_0x36c708[_0x7eed('0x42')]=_[_0x7eed('0x41')](_0x57c89e[_0x7eed('0x3e')],qs[_0x7eed('0x43')](_0xfd70a1[_0x7eed('0x3f')][_0x7eed('0x43')]));_0x36c708[_0x7eed('0x42')]=_0x36c708[_0x7eed('0x42')][_0x7eed('0x44')]?_0x36c708[_0x7eed('0x42')]:_0x57c89e['model'];if(!_0xfd70a1[_0x7eed('0x3f')][_0x7eed('0x45')]('nolimit')){_0x36c708[_0x7eed('0x1f')]=qs[_0x7eed('0x1f')](_0xfd70a1[_0x7eed('0x3f')][_0x7eed('0x1f')]);_0x36c708[_0x7eed('0x1d')]=qs[_0x7eed('0x1d')](_0xfd70a1[_0x7eed('0x3f')][_0x7eed('0x1d')]);}_0x36c708[_0x7eed('0x46')]=qs[_0x7eed('0x47')](_0xfd70a1['query'][_0x7eed('0x47')]);_0x36c708[_0x7eed('0x48')]=qs[_0x7eed('0x49')](_[_0x7eed('0x4a')](_0xfd70a1[_0x7eed('0x3f')],_0x57c89e[_0x7eed('0x49')]),_0x55c1c);var _0x3e2cb2=[];var _0x3c4c43=squel[_0x7eed('0x4b')]()[_0x7eed('0x4c')]('id')[_0x7eed('0x4c')](_0x7eed('0x2e'))[_0x7eed('0x4c')](_0x7eed('0x4d'))[_0x7eed('0x4e')]('tools_tags');var _0x548588=squel[_0x7eed('0x4b')]()[_0x7eed('0x4c')](_0x7eed('0x4f'))['field']('u.fullname')[_0x7eed('0x4c')](_0x7eed('0x50'))[_0x7eed('0x4e')]('user_has_whatsapp_interactions','ui')[_0x7eed('0x51')](_0x7eed('0x52'),'u',_0x7eed('0x53'));var _0x306b26=squel[_0x7eed('0x4b')]()['from'](_0x7eed('0x54'),'i')[_0x7eed('0x51')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x7eed('0x52'),'o','o.id\x20=\x20i.UserId')[_0x7eed('0x51')](_0x7eed('0x55'),'a',_0x7eed('0x56'))[_0x7eed('0x51')](_0x7eed('0x57'),'me',_0x7eed('0x58'))[_0x7eed('0x51')](_0x7eed('0x59'),'it',_0x7eed('0x5a'))[_0x7eed('0x51')](_0x7eed('0x5b'),'t','t.id\x20=\x20it.TagId');var _0x132e33=squel[_0x7eed('0x5c')]();var _0x27b26c=[];var _0x4e9a39=squel[_0x7eed('0x5c')]();var _0x2be206;if(_0xfd70a1['query'][_0x7eed('0x5d')]){_0x2be206=as[_0x7eed('0x5e')](_0xfd70a1[_0x7eed('0x3f')][_0x7eed('0x5d')]);var _0x498ee7=_0x2be206[_0x7eed('0x5f')];for(var _0x3994aa=0x0;_0x3994aa<_0x2be206['conditions'][_0x7eed('0x44')];_0x3994aa++){var _0x3b9cd7=_0x2be206[_0x7eed('0x60')][_0x3994aa];var _0x3953ee='i';var _0x15d46e=_[_0x7eed('0x61')](_0x55c1c,[_0x7eed('0x2e'),_0x3b9cd7[_0x7eed('0x4c')]]);if(!_0x15d46e){switch(_0x3b9cd7['field']){case _0x7eed('0x62'):if(_0x3b9cd7[_0x7eed('0x63')]==0x1){_0x306b26[_0x7eed('0x64')]('`'+_0x3b9cd7['field']+_0x7eed('0x65'));}else{_0x306b26[_0x7eed('0x64')]('`'+_0x3b9cd7[_0x7eed('0x4c')]+_0x7eed('0x66'));}break;case _0x7eed('0x67'):if(_0x3b9cd7['operator']==='$substring'){if(_0x3b9cd7[_0x7eed('0x63')][_0x7eed('0x34')]('\x20')['length']>0x1){_0x132e33[_0x498ee7](_0x7eed('0x68'),qs[_0x7eed('0x69')](_0x3b9cd7['value']),null);}else{var _0x432e70='%'+_0x3b9cd7['value']+'%';_0x132e33[_0x498ee7](_0x7eed('0x6a'),_0x432e70,_0x432e70,_0x432e70);}}else{_0x15d46e=_['find'](_0x55c1c,['name',_0x7eed('0x6b')]);_0x3b9cd7[_0x7eed('0x4c')]=_0x7eed('0x6b');_0x5e5ffa=as[_0x7eed('0x6c')](_0x3953ee,_0x15d46e['type'],_0x3b9cd7);_0x132e33[_0x498ee7](_0x5e5ffa[_0x7eed('0x6d')],_0x5e5ffa['value'][_0x7eed('0x6e')],_0x5e5ffa['value'][_0x7eed('0x2a')]);}break;case _0x7eed('0x6f'):var _0x5c993a=_0x3b9cd7['value'][_0x7eed('0x34')](',')[_0x7eed('0x31')](function(_0x5a8bf6){return Number(_0x5a8bf6);});_0x5c993a[_0x7eed('0x35')](function(_0x403632){_0x4e9a39['or'](_0x7eed('0x70'),'%,'+_0x403632+',%');});_0x27b26c=_[_0x7eed('0x71')](_0x27b26c,_0x5c993a);break;case'User':if(_0x3b9cd7[_0x7eed('0x72')]==='$substring'){_0x132e33[_0x498ee7](_0x7eed('0x73'),'%'+_0x3b9cd7[_0x7eed('0x63')]+'%',null);}else{_0x15d46e=_['find'](_0x55c1c,[_0x7eed('0x2e'),'UserId']);_0x3b9cd7[_0x7eed('0x4c')]='UserId';_0x5e5ffa=as['buildExpression'](_0x3953ee,_0x15d46e[_0x7eed('0x3c')],_0x3b9cd7);_0x132e33[_0x498ee7](_0x5e5ffa['text'],_0x5e5ffa[_0x7eed('0x63')][_0x7eed('0x6e')],_0x5e5ffa[_0x7eed('0x63')][_0x7eed('0x2a')]);}break;case _0x7eed('0x74'):_0x5e5ffa=as[_0x7eed('0x6c')]('me',null,_0x3b9cd7);_0x132e33[_0x498ee7](_0x5e5ffa[_0x7eed('0x6d')],_0x5e5ffa[_0x7eed('0x63')][_0x7eed('0x6e')],_0x5e5ffa[_0x7eed('0x63')][_0x7eed('0x2a')]);break;}}else{var _0x5e5ffa=as['buildExpression'](_0x3953ee,_0x15d46e[_0x7eed('0x3c')],_0x3b9cd7);_0x132e33[_0x498ee7](_0x5e5ffa['text'],_0x5e5ffa[_0x7eed('0x63')][_0x7eed('0x6e')],_0x5e5ffa[_0x7eed('0x63')][_0x7eed('0x2a')]);}}}else{var _0x3319d2=_(_0xfd70a1[_0x7eed('0x3f')])[_0x7eed('0x40')]()[_0x7eed('0x31')](function(_0x212715){return _[_0x7eed('0x75')](_0x55c1c,[_0x7eed('0x2e'),_0x212715])?_0x212715:undefined;})['compact']()['value']();if(!_['isEmpty'](_0x3319d2)){_0x3319d2[_0x7eed('0x35')](function(_0x4bac92){if(_0x4bac92==='WhatsappAccountId'){_0x306b26[_0x7eed('0x48')](_0x7eed('0x76'),[][_0x7eed('0x77')](_0xfd70a1['query'][_0x4bac92]));}else if(_0x4bac92===_0x7eed('0x78')){var _0x2d1395=JSON[_0x7eed('0x79')](_0xfd70a1[_0x7eed('0x3f')][_0x4bac92])[_0x7eed('0x7a')];var _0x4f467b=JSON[_0x7eed('0x79')](_0xfd70a1['query'][_0x4bac92])[_0x7eed('0x7b')];_0x306b26[_0x7eed('0x48')](_0x7eed('0x7c'),_0x2d1395,_0x4f467b);}else{if(_0xfd70a1['query'][_0x4bac92]===_0x7eed('0x7d')){_0x306b26[_0x7eed('0x48')]('i.'+_0x4bac92+_0x7eed('0x7e'));}else{_0x306b26['where']('i.'+_0x4bac92+_0x7eed('0x7f'),_0xfd70a1[_0x7eed('0x3f')][_0x4bac92]);}}});}if(_0xfd70a1[_0x7eed('0x3f')][_0x7eed('0x80')]){if(_0xfd70a1[_0x7eed('0x3f')]['read']==0x1){_0x306b26[_0x7eed('0x64')](_0x7eed('0x81'));}else{_0x306b26[_0x7eed('0x64')](_0x7eed('0x82'));}}if(_0xfd70a1[_0x7eed('0x3f')][_0x7eed('0x83')]){_0x27b26c=_[_0x7eed('0x84')](_0xfd70a1[_0x7eed('0x3f')][_0x7eed('0x83')])?_0xfd70a1[_0x7eed('0x3f')][_0x7eed('0x83')]:new Array(_0xfd70a1[_0x7eed('0x3f')][_0x7eed('0x83')]);_0x27b26c['forEach'](function(_0x308273){_0x4e9a39['or'](_0x7eed('0x70'),'%,'+_0x308273+',%');});}if(_0xfd70a1['query'][_0x7eed('0x85')]){var _0x19162b=_0xfd70a1[_0x7eed('0x3f')][_0x7eed('0x85')][_0x7eed('0x86')]('\x5c','\x5c\x5c')[_0x7eed('0x86')](/'/g,'\x27\x27');if(qs[_0x7eed('0x87')](_0x19162b)){_0x132e33['or'](_0x7eed('0x88'),_0x19162b+'%')['or'](_0x7eed('0x89'),_0x19162b+'%');}else{_0x132e33['or'](_0x7eed('0x8a'),qs[_0x7eed('0x69')](_0x19162b))['or'](_0x7eed('0x8b'),_0x19162b+'%');}}}_0x306b26['where'](_0x132e33);_0x306b26[_0x7eed('0x8c')]('i.id');var _0x181955={'type':db['Sequelize'][_0x7eed('0x8d')][_0x7eed('0x8e')],'raw':!![]};var _0x397094=_0x306b26[_0x7eed('0x8f')]();_0x397094[_0x7eed('0x4c')]('i.id');_0x397094[_0x7eed('0x4c')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x7eed('0x62'));if(_0x36c708[_0x7eed('0x46')]){_0x36c708['order'][_0x7eed('0x35')](function(_0x253171){var _0x550e24=_0x253171[0x0]===_0x7eed('0x90')?_0x253171[0x0]:'i.'+_0x253171[0x0];_0x306b26['order'](_0x550e24,_0x253171[0x1]===_0x7eed('0x91')?![]:!![]);});}if(!_[_0x7eed('0x92')](_0x27b26c)){_0x306b26[_0x7eed('0x64')](_0x4e9a39);_0x397094[_0x7eed('0x48')](_0x7eed('0x93'),_0x27b26c);}BPromise[_0x7eed('0x94')]()['then'](function(){if(!_0x2be206){if(_0xfd70a1['query'][_0x7eed('0x95')])return;_0x397094['where']('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');_0x306b26[_0x7eed('0x48')](_0x7eed('0x96'));return;}if(_0xfd70a1[_0x7eed('0x97')][_0x7eed('0x98')]!=='agent')return;return _0xfd70a1[_0x7eed('0x97')][_0x7eed('0x99')]({'attributes':['id'],'raw':!![]})['then'](function(_0x11acc8){if(_['isEmpty'](_0x11acc8)){_0x397094[_0x7eed('0x48')](_0x7eed('0x9a'));_0x306b26['where'](_0x7eed('0x9a'));}else{_0x397094['where']('i.WhatsappAccountId\x20IN\x20?',_['map'](_0x11acc8,'id'));_0x306b26[_0x7eed('0x48')](_0x7eed('0x76'),_['map'](_0x11acc8,'id'));}});})['then'](function(){if(_0xfd70a1[_0x7eed('0x97')][_0x7eed('0x98')]===_0x7eed('0x9b')&&!_0x2be206&&!_0xfd70a1['query'][_0x7eed('0x95')])return[];return db[_0x7eed('0x9c')][_0x7eed('0x3f')](_0x397094[_0x7eed('0x9d')](),_0x181955);})[_0x7eed('0x27')](function(_0xfbdf0e){_0x4eaeb4[_0x7eed('0x20')]=_0xfbdf0e[_0x7eed('0x44')];if(_0x4eaeb4[_0x7eed('0x20')]===0x0)return[];return db[_0x7eed('0x9c')][_0x7eed('0x3f')](_0x3c4c43['toString'](),_0x181955)[_0x7eed('0x27')](function(_0x13353d){_0x3e2cb2=_[_0x7eed('0x9e')](_0x13353d,'id');_0x181955=_[_0x7eed('0x9f')](_0x181955,{'model':db[_0x7eed('0x39')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xfd70a1[_0x7eed('0x3f')][_0x7eed('0x43')]){_0x36c708['attributes'][_0x7eed('0x35')](function(_0x41c0d7){_0x306b26[_0x7eed('0x4c')]('i.'+_0x41c0d7);});}else{_0x306b26[_0x7eed('0x4c')](_0x7eed('0xa0'),_0x7eed('0x62'));_0x306b26[_0x7eed('0x4c')](_0x7eed('0xa1'),_0x7eed('0xa2'));_0x306b26[_0x7eed('0x4c')](_0x7eed('0xa3'),_0x7eed('0xa4'));_0x306b26[_0x7eed('0x4c')]('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',_0x7eed('0x90'));_0x306b26[_0x7eed('0x4c')](_0x7eed('0xa5'));_0x306b26[_0x7eed('0x4c')]('c.firstName',_0x7eed('0xa6'));_0x306b26['field'](_0x7eed('0xa7'),_0x7eed('0xa8'));_0x306b26[_0x7eed('0x4c')](_0x7eed('0xa9'),_0x7eed('0xaa'));_0x306b26[_0x7eed('0x4c')](_0x7eed('0xab'),_0x7eed('0xac'));_0x306b26['field'](_0x7eed('0xad'),_0x7eed('0xae'));_0x306b26['field'](_0x7eed('0xaf'),_0x7eed('0xb0'));_0x306b26[_0x7eed('0x4c')](_0x7eed('0xb1'),_0x7eed('0xb2'));_0x306b26[_0x7eed('0x4c')](_0x7eed('0xb3'),_0x7eed('0xb4'));_0x306b26[_0x7eed('0x4c')](_0x7eed('0xb5'),_0x7eed('0x33'));}if(_0x36c708[_0x7eed('0x1f')])_0x306b26['limit'](_0x36c708[_0x7eed('0x1f')]);if(_0x36c708[_0x7eed('0x1d')])_0x306b26[_0x7eed('0x1d')](_0x36c708['offset']);return db[_0x7eed('0x9c')][_0x7eed('0x3f')](_0x306b26[_0x7eed('0x9d')](),_0x181955);})[_0x7eed('0x27')](function(_0x1c1daa){if(_0x1c1daa[_0x7eed('0x44')]>0x0)_0x548588['where'](_0x7eed('0xb6'),_[_0x7eed('0x31')](_0x1c1daa,'id'));return db[_0x7eed('0x9c')]['query'](_0x548588[_0x7eed('0x9d')](),_0x181955)[_0x7eed('0x27')](function(_0x1a964e){var _0x493bea=_['groupBy'](_0x1a964e,'WhatsappInteractionId');var _0x15bc50=[];_0x1c1daa[_0x7eed('0x35')](function(_0x24d670){_0x15bc50[_0x7eed('0x36')](updateWhatsappInteraction(_0x24d670,_0x3e2cb2,_0x493bea));});return BPromise['all'](_0x15bc50);});});})[_0x7eed('0x27')](function(_0x1675a7){_0x4eaeb4[_0x7eed('0xb7')]=_0x1675a7;return _0x4eaeb4;})[_0x7eed('0x27')](respondWithFilteredResult(_0x2f7e9a,_0x36c708))[_0x7eed('0x37')](handleError(_0x2f7e9a,null));};exports[_0x7eed('0xb8')]=function(_0x5a0e8d,_0xd6bee){var _0x5dd0d7={'raw':![],'where':{'id':_0x5a0e8d['params']['id']}},_0x29dd78={};_0x29dd78[_0x7eed('0x3e')]=_[_0x7eed('0x40')](db[_0x7eed('0x39')]['rawAttributes']);_0x29dd78[_0x7eed('0x3f')]=_[_0x7eed('0x40')](_0x5a0e8d['query']);_0x29dd78['filters']=_[_0x7eed('0x41')](_0x29dd78[_0x7eed('0x3e')],_0x29dd78[_0x7eed('0x3f')]);_0x5dd0d7[_0x7eed('0x42')]=_[_0x7eed('0x41')](_0x29dd78[_0x7eed('0x3e')],qs[_0x7eed('0x43')](_0x5a0e8d[_0x7eed('0x3f')][_0x7eed('0x43')]));_0x5dd0d7[_0x7eed('0x42')]=_0x5dd0d7[_0x7eed('0x42')][_0x7eed('0x44')]?_0x5dd0d7['attributes']:_0x29dd78[_0x7eed('0x3e')];if(_0x5a0e8d['query'][_0x7eed('0xb9')]){_0x5dd0d7[_0x7eed('0xba')]=[{'all':!![]}];}_0x5dd0d7=_[_0x7eed('0x9f')]({},_0x5dd0d7,_0x5a0e8d[_0x7eed('0xbb')]);return db['WhatsappInteraction'][_0x7eed('0x61')](_0x5dd0d7)['then'](handleEntityNotFound(_0xd6bee,null))[_0x7eed('0x27')](respondWithResult(_0xd6bee,null))[_0x7eed('0x37')](handleError(_0xd6bee,null));};exports[_0x7eed('0xbc')]=function(_0x1402bc,_0x101113){return db[_0x7eed('0x39')]['create'](_0x1402bc[_0x7eed('0x74')],{})[_0x7eed('0x27')](respondWithResult(_0x101113,0xc9))[_0x7eed('0x37')](handleError(_0x101113,null));};exports['update']=function(_0x2d6973,_0x4f1daf){if(_0x2d6973[_0x7eed('0x74')]['id']){delete _0x2d6973[_0x7eed('0x74')]['id'];}return db[_0x7eed('0x39')][_0x7eed('0x61')]({'where':{'id':_0x2d6973[_0x7eed('0xbd')]['id']}})['then'](handleEntityNotFound(_0x4f1daf,null))['then'](saveUpdates(_0x2d6973[_0x7eed('0x74')],null))['then'](respondWithResult(_0x4f1daf,null))[_0x7eed('0x37')](handleError(_0x4f1daf,null));};exports['destroy']=function(_0x43bd6d,_0x49f6d1){return db[_0x7eed('0x39')][_0x7eed('0x61')]({'where':{'id':_0x43bd6d[_0x7eed('0xbd')]['id']}})['then'](handleEntityNotFound(_0x49f6d1,null))[_0x7eed('0x27')](removeEntity(_0x49f6d1,null))[_0x7eed('0x37')](handleError(_0x49f6d1,null));};exports[_0x7eed('0xbe')]=function(_0x597083,_0x137a5e){return db[_0x7eed('0x39')][_0x7eed('0xbe')]()[_0x7eed('0x27')](respondWithResult(_0x137a5e,null))[_0x7eed('0x37')](handleError(_0x137a5e,null));};exports['addMessage']=function(_0x2f0bf8,_0x14afcf,_0x177fe7){return db['WhatsappMessage'][_0x7eed('0x61')]({'where':{'id':_0x2f0bf8[_0x7eed('0xbd')]['id']}})[_0x7eed('0x27')](handleEntityNotFound(_0x14afcf,null))[_0x7eed('0x27')](function(_0x414fef){if(_0x414fef){return _0x414fef[_0x7eed('0xbf')](_0x2f0bf8[_0x7eed('0x74')][_0x7eed('0xc0')],_[_0x7eed('0xc1')](_0x2f0bf8[_0x7eed('0x74')],[_0x7eed('0xc0'),'id'])||{});}})['then'](respondWithResult(_0x14afcf,null))[_0x7eed('0x37')](handleError(_0x14afcf,null));};exports['getMessages']=function(_0x1b502b,_0x424975,_0x2d5f16){var _0x1eabea={'raw':![],'where':{}};var _0x50a45a={};var _0x4beb0d={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0x7eed('0xc2')]({'where':{'id':_0x1b502b[_0x7eed('0xbd')]['id']}})[_0x7eed('0x27')](handleEntityNotFound(_0x424975,null))[_0x7eed('0x27')](function(_0x584059){if(_0x584059){_0x50a45a[_0x7eed('0x3e')]=_['keys'](db['WhatsappMessage']['rawAttributes']);_0x50a45a[_0x7eed('0x3f')]=_[_0x7eed('0x40')](_0x1b502b[_0x7eed('0x3f')]);_0x50a45a['filters']=_['intersection'](_0x50a45a[_0x7eed('0x3e')],_0x50a45a[_0x7eed('0x3f')]);_0x1eabea[_0x7eed('0x42')]=_['intersection'](_0x50a45a[_0x7eed('0x3e')],qs[_0x7eed('0x43')](_0x1b502b[_0x7eed('0x3f')][_0x7eed('0x43')]));_0x1eabea[_0x7eed('0x42')]=_0x1eabea[_0x7eed('0x42')]['length']?_0x1eabea[_0x7eed('0x42')]:_0x50a45a[_0x7eed('0x3e')];if(!_0x1b502b['query']['hasOwnProperty'](_0x7eed('0xc3'))){_0x1eabea[_0x7eed('0x1f')]=qs[_0x7eed('0x1f')](_0x1b502b['query'][_0x7eed('0x1f')]);_0x1eabea['offset']=qs[_0x7eed('0x1d')](_0x1b502b['query']['offset']);}_0x1eabea[_0x7eed('0x46')]=qs['sort'](_0x1b502b[_0x7eed('0x3f')][_0x7eed('0x47')]);_0x1eabea[_0x7eed('0x48')]=qs[_0x7eed('0x49')](_['pick'](_0x1b502b[_0x7eed('0x3f')],_0x50a45a[_0x7eed('0x49')]));_0x1eabea[_0x7eed('0x48')]['WhatsappInteractionId']=_0x584059['id'];if(_0x1b502b[_0x7eed('0x3f')][_0x7eed('0x85')]){_0x1eabea['where']=_[_0x7eed('0x9f')](_0x1eabea[_0x7eed('0x48')],{'$or':_[_0x7eed('0x31')](_0x1eabea['attributes'],function(_0x23254b){var _0x3532e9={};_0x3532e9[_0x23254b]={'$like':'%'+_0x1b502b[_0x7eed('0x3f')][_0x7eed('0x85')]+'%'};return _0x3532e9;})});}if(_0x1b502b[_0x7eed('0x3f')][_0x7eed('0x7a')]){var _0x281f50=_0x1b502b['query'][_0x7eed('0x7a')]['split'](',');var _0x5d1471={};_0x5d1471[_0x281f50[0x0]]={'$gte':moment(_0x281f50[0x1])[_0x7eed('0xc4')](_0x7eed('0xc5'))};_0x1eabea['where']=_['merge'](_0x1eabea[_0x7eed('0x48')],_0x5d1471);}_0x1eabea=_['merge']({},_0x1eabea,_0x1b502b[_0x7eed('0xbb')]);return db[_0x7eed('0xc6')]['count']({'where':_0x1eabea['where']})[_0x7eed('0x27')](function(_0x4d7faa){_0x4beb0d[_0x7eed('0x20')]=_0x4d7faa;if(_0x1b502b[_0x7eed('0x3f')][_0x7eed('0xb9')]){_0x1eabea[_0x7eed('0xba')]=[{'all':!![]}];}return db[_0x7eed('0xc6')][_0x7eed('0xc7')](_0x1eabea);})['then'](function(_0x35f025){_0x4beb0d['rows']=_0x35f025;return _0x4beb0d;});}})[_0x7eed('0x27')](respondWithFilteredResult(_0x424975,_0x1eabea))['catch'](handleError(_0x424975,null));};exports[_0x7eed('0xc8')]=function(_0x122982,_0x50ee02,_0x28ab66){return db[_0x7eed('0x39')][_0x7eed('0x61')]({'where':{'id':_0x122982['params']['id']}})[_0x7eed('0x27')](handleEntityNotFound(_0x50ee02,null))['then'](function(_0xb9806a){if(_0xb9806a){return _0xb9806a[_0x7eed('0xc9')](_0x122982['body'][_0x7eed('0xc0')],_[_0x7eed('0xc1')](_0x122982[_0x7eed('0x74')],[_0x7eed('0xc0'),'id'])||{})[_0x7eed('0xca')](function(){return db[_0x7eed('0x6f')][_0x7eed('0xc7')]({'attributes':['id',_0x7eed('0x2e'),_0x7eed('0x4d')],'where':{'id':_0x122982[_0x7eed('0x74')][_0x7eed('0xc0')]}});})['then'](function(_0x3fb287){socket[_0x7eed('0xcb')](_0x7eed('0xcc'),{'id':Number(_0x122982['params']['id']),'tags':_0x3fb287||[]});return{'id':Number(_0x122982['params']['id']),'tags':_0x3fb287||[]};});}})[_0x7eed('0x27')](respondWithResult(_0x50ee02,null))[_0x7eed('0x37')](handleError(_0x50ee02,null));};exports['removeTags']=function(_0x3534de,_0x45af8a,_0x3abe21){return db[_0x7eed('0x39')][_0x7eed('0x61')]({'where':{'id':_0x3534de['params']['id']}})[_0x7eed('0x27')](handleEntityNotFound(_0x45af8a,null))['then'](function(_0x5d2721){if(_0x5d2721){return _0x5d2721[_0x7eed('0xcd')](_0x3534de[_0x7eed('0x3f')][_0x7eed('0xc0')]);}})[_0x7eed('0x27')](respondWithStatusCode(_0x45af8a,null))[_0x7eed('0x37')](handleError(_0x45af8a,null));};exports[_0x7eed('0xce')]=function(_0x8a3c03,_0x1ed81d){var _0x23681a=moment()[_0x7eed('0xcf')]()[_0x7eed('0x9d')]();var _0xa53496=path[_0x7eed('0xd0')](config['root'],_0x7eed('0xd1'),_0x7eed('0xd2'),'tmp');var _0x1e8cd2=path[_0x7eed('0xd0')](config[_0x7eed('0xd3')],_0x7eed('0xd1'),_0x7eed('0xd2'),_0x7eed('0xd4'));var _0x39b0e6=path[_0x7eed('0xd0')](_0xa53496,_0x23681a);var _0x5cff01=util['format']('transcript-%d-%s.zip',_0x8a3c03[_0x7eed('0xbd')]['id'],_0x23681a);var _0x3ec437=path[_0x7eed('0xd0')](_0xa53496,_0x5cff01);var _0x34be57=[];_0x34be57[_0x7eed('0x36')]({'model':db[_0x7eed('0xd5')],'as':'User','attributes':['id',_0x7eed('0x32')],'raw':!![]});_0x34be57[_0x7eed('0x36')]({'model':db[_0x7eed('0xd6')],'as':'Contact','attributes':['id',_0x7eed('0xd7'),_0x7eed('0xd8')],'raw':!![]});if(_0x8a3c03[_0x7eed('0x3f')][_0x7eed('0xd4')]){_0x34be57[_0x7eed('0x36')]({'model':db[_0x7eed('0xd9')],'as':_0x7eed('0xd9'),'raw':!![]});}var _0x3c4e44=[{'model':db[_0x7eed('0xc6')],'as':_0x7eed('0xda'),'attributes':['id',_0x7eed('0x74'),_0x7eed('0x78'),_0x7eed('0xdb'),_0x7eed('0xdc'),_0x7eed('0x80')],'include':_0x34be57}];_0x3c4e44[_0x7eed('0x36')]({'model':db[_0x7eed('0xdd')],'as':'Account','attributes':['id',_0x7eed('0x2e')]});_0x3c4e44[_0x7eed('0x36')]({'model':db[_0x7eed('0xd5')],'as':_0x7eed('0xde'),'attributes':['id',_0x7eed('0x32')]});return db[_0x7eed('0x39')]['find']({'where':{'id':_0x8a3c03[_0x7eed('0xbd')]['id']},'include':_0x3c4e44})[_0x7eed('0x27')](handleEntityNotFound(_0x1ed81d,null))[_0x7eed('0x27')](function(_0x2614da){if(_0x2614da){var _0xc57046=_0x2614da['get']({'plain':!![]});fs[_0x7eed('0xdf')](_0x39b0e6);var _0x583e4f={'channel':'Whatsapp','account':_0xc57046[_0x7eed('0xe0')][_0x7eed('0x2e')],'agent':_0xc57046[_0x7eed('0xde')]?_0xc57046[_0x7eed('0xde')][_0x7eed('0x32')]:_0x7eed('0xe1'),'createdAt':moment(_0xc57046[_0x7eed('0x78')])[_0x7eed('0xc4')](_0x7eed('0xc5'))[_0x7eed('0x9d')](),'closedAt':_0xc57046[_0x7eed('0xe2')]?moment(_0xc57046[_0x7eed('0xe3')])[_0x7eed('0xc4')](_0x7eed('0xc5'))[_0x7eed('0x9d')]():'','disposition':_0xc57046[_0x7eed('0xe4')],'messages':_(_0xc57046[_0x7eed('0xda')])['filter']({'secret':![]})[_0x7eed('0x31')](function(_0x1486b3){if(_0x1486b3[_0x7eed('0xd9')]){var _0x476357=path[_0x7eed('0xd0')](_0x1e8cd2,_0x1486b3['Attachment'][_0x7eed('0xe5')]);if(fs['existsSync'](_0x476357)){fs[_0x7eed('0xe6')](_0x476357)[_0x7eed('0xe7')](fs['createWriteStream'](path[_0x7eed('0xd0')](_0x39b0e6,_0x1486b3[_0x7eed('0xd9')][_0x7eed('0xe5')])));}}return{'date':moment(_0x1486b3[_0x7eed('0x78')])['format'](_0x7eed('0xc5'))[_0x7eed('0x9d')](),'sender':_0x1486b3[_0x7eed('0xdb')]===_0x7eed('0xe8')?_0x1486b3['User']?_0x1486b3[_0x7eed('0xd5')][_0x7eed('0x32')]:_0x7eed('0xe9'):_0x1486b3['Contact'][_0x7eed('0xd7')]+(_0x1486b3[_0x7eed('0x67')]['lastName']?'\x20'+_0x1486b3[_0x7eed('0x67')]['lastName']:''),'body':_0x1486b3[_0x7eed('0xd9')]?_0x1486b3[_0x7eed('0xd9')][_0x7eed('0xe5')]:_0x1486b3[_0x7eed('0x74')],'direction':_0x1486b3[_0x7eed('0xdb')]===_0x7eed('0xe8')?'A':'C','secret':_0x1486b3[_0x7eed('0xdc')],'read':_0x1486b3[_0x7eed('0x80')],'attachment':_0x1486b3[_0x7eed('0xd9')]};})[_0x7eed('0x63')]()};return ejs[_0x7eed('0xea')](path['join'](config[_0x7eed('0xd3')],_0x7eed('0xd1'),_0x7eed('0xeb'),_0x7eed('0xec')),{'interaction':_0x583e4f})[_0x7eed('0x27')](function(_0x32acff){var _0x29052a=path[_0x7eed('0xd0')](_0x39b0e6,_0x7eed('0xed')+_0xc57046['id']+'-'+_0x23681a+_0x7eed('0xee'));var _0x30b8b9={'path':_0x29052a,'channel':_0x7eed('0xef'),'interactionId':_0xc57046['id']};return pdf[_0x7eed('0xf0')](_0x32acff,_0x30b8b9);})['then'](function(){return new BPromise(function(_0x23d23a,_0x78b0df){zipdir(_0x39b0e6,{'saveTo':_0x3ec437},function(_0x3a6ccd,_0x1139de){if(_0x3a6ccd)return _0x78b0df(_0x3a6ccd);return _0x23d23a(_0x1139de);});})[_0x7eed('0x27')](function(){return new BPromise(function(_0xb32a7a,_0x3f0684){rimraf(_0x39b0e6,function(_0x3ca377){if(_0x3ca377)_0x3f0684(_0x3ca377);return _0xb32a7a();});});})[_0x7eed('0x27')](function(){return _0x1ed81d['download'](_0x3ec437,_0x5cff01,function(_0x5cfef1){if(_0x5cfef1){console[_0x7eed('0xf1')](_0x7eed('0xf2'),_0x5cfef1);}else{fs[_0x7eed('0xf3')](_0x3ec437);}});});});}else{return _0x1ed81d[_0x7eed('0x2b')](0xc8);}})[_0x7eed('0x37')](handleError(_0x1ed81d,null));};
\ No newline at end of file
index dace68b..8ff68ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e77=['emit','catch','hasOwnProperty','hook','exports','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length'];(function(_0x5f2a50,_0x4700e0){var _0x7577ca=function(_0x45f47e){while(--_0x45f47e){_0x5f2a50['push'](_0x5f2a50['shift']());}};_0x7577ca(++_0x4700e0);}(_0x6e77,0xef));var _0x76e7=function(_0xf0cf28,_0x1a5fe2){_0xf0cf28=_0xf0cf28-0x0;var _0x2d367d=_0x6e77[_0xf0cf28];return _0x2d367d;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0x76e7('0x0'))['db']['WhatsappInteraction'];var WhatsappMessage=require('../../mysqldb')['db'][_0x76e7('0x1')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x76e7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x76e7('0x3'),'afterDestroy':_0x76e7('0x4')};function emitEvent(_0xcc6627){return function(_0x5eb27e,_0x498ec3,_0x423b7a){_0x5eb27e[_0x76e7('0x5')]({'attributes':['id'],'raw':!![]})[_0x76e7('0x6')](function(_0x5a5e94){_0x5eb27e[_0x76e7('0x7')](_0x76e7('0x8'),_0x5a5e94[_0x76e7('0x9')](function(_0x5dbea3){return{'id':_0x5dbea3['id']};}));return WhatsappMessage[_0x76e7('0xa')]({'where':{'WhatsappInteractionId':_0x5eb27e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x76e7('0x6')](function(_0x57b048){_0x5eb27e[_0x76e7('0x7')](_0x76e7('0xb'),_0x57b048[_0x76e7('0xc')]);WhatsappInteractionEvents[_0x76e7('0xd')](_0xcc6627+':'+_0x5eb27e['id'],_0x5eb27e);WhatsappInteractionEvents['emit'](_0xcc6627,_0x5eb27e);_0x423b7a(null);})[_0x76e7('0xe')](_0x423b7a(null));};}for(var e in events){if(events[_0x76e7('0xf')](e)){var event=events[e];WhatsappInteraction[_0x76e7('0x10')](e,emitEvent(event));}}module[_0x76e7('0x11')]=WhatsappInteractionEvents;
\ No newline at end of file
+var _0xc29b=['exports','events','../../mysqldb','WhatsappInteraction','WhatsappMessage','setMaxListeners','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x5be5f9,_0x327830){var _0x2c8e64=function(_0x972432){while(--_0x972432){_0x5be5f9['push'](_0x5be5f9['shift']());}};_0x2c8e64(++_0x327830);}(_0xc29b,0x12d));var _0xbc29=function(_0x3745d9,_0x2c4bc3){_0x3745d9=_0x3745d9-0x0;var _0x23f8ab=_0xc29b[_0x3745d9];return _0x23f8ab;};'use strict';var EventEmitter=require(_0xbc29('0x0'));var WhatsappInteraction=require(_0xbc29('0x1'))['db'][_0xbc29('0x2')];var WhatsappMessage=require('../../mysqldb')['db'][_0xbc29('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xbc29('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbc29('0x5'),'afterDestroy':_0xbc29('0x6')};function emitEvent(_0x217922){return function(_0xa365e8,_0x1a6a62,_0x2b8a98){_0xa365e8[_0xbc29('0x7')]({'attributes':['id'],'raw':!![]})[_0xbc29('0x8')](function(_0x463e2b){_0xa365e8[_0xbc29('0x9')](_0xbc29('0xa'),_0x463e2b[_0xbc29('0xb')](function(_0x300f5c){return{'id':_0x300f5c['id']};}));return WhatsappMessage[_0xbc29('0xc')]({'where':{'WhatsappInteractionId':_0xa365e8['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbc29('0x8')](function(_0x36d1e3){_0xa365e8[_0xbc29('0x9')](_0xbc29('0xd'),_0x36d1e3[_0xbc29('0xe')]);WhatsappInteractionEvents[_0xbc29('0xf')](_0x217922+':'+_0xa365e8['id'],_0xa365e8);WhatsappInteractionEvents['emit'](_0x217922,_0xa365e8);_0x2b8a98(null);})[_0xbc29('0x10')](_0x2b8a98(null));};}for(var e in events){if(events[_0xbc29('0x11')](e)){var event=events[e];WhatsappInteraction[_0xbc29('0x12')](e,emitEvent(event));}}module[_0xbc29('0x13')]=WhatsappInteractionEvents;
\ No newline at end of file
index 3a8f7f4..7292f25 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3595=['lodash','../../config/logger','api','moment','bluebird','../../config/environment','exports','define','WhatsappInteraction','whatsapp_interactions','closed','format'];(function(_0x632785,_0xa9e897){var _0x4b2fa4=function(_0x5141cb){while(--_0x5141cb){_0x632785['push'](_0x632785['shift']());}};_0x4b2fa4(++_0xa9e897);}(_0x3595,0x168));var _0x5359=function(_0x2e89cd,_0x3f6db6){_0x2e89cd=_0x2e89cd-0x0;var _0x218bb6=_0x3595[_0x2e89cd];return _0x218bb6;};'use strict';var _=require(_0x5359('0x0'));var util=require('util');var logger=require(_0x5359('0x1'))(_0x5359('0x2'));var moment=require(_0x5359('0x3'));var BPromise=require(_0x5359('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5359('0x5'));var attributes=require('./whatsappInteraction.attributes');module[_0x5359('0x6')]=function(_0x47ae94,_0x36de16){return _0x47ae94[_0x5359('0x7')](_0x5359('0x8'),attributes,{'tableName':_0x5359('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x93ded6,_0x494b88,_0x445c75){if(_0x93ded6['changed'](_0x5359('0xa'))){_0x93ded6['closedAt']=moment()[_0x5359('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x445c75(null,_0x93ded6);}}});};
\ No newline at end of file
+var _0xe285=['changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions'];(function(_0x3f8205,_0x1d7014){var _0x54e50c=function(_0x58f14b){while(--_0x58f14b){_0x3f8205['push'](_0x3f8205['shift']());}};_0x54e50c(++_0x1d7014);}(_0xe285,0xe5));var _0x5e28=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xe285[_0x3511d3];return _0x5d6321;};'use strict';var _=require(_0x5e28('0x0'));var util=require(_0x5e28('0x1'));var logger=require(_0x5e28('0x2'))(_0x5e28('0x3'));var moment=require(_0x5e28('0x4'));var BPromise=require(_0x5e28('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5e28('0x6'));var attributes=require(_0x5e28('0x7'));module['exports']=function(_0x1df66c,_0x230bd0){return _0x1df66c[_0x5e28('0x8')](_0x5e28('0x9'),attributes,{'tableName':_0x5e28('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x48eea7,_0x5a29f2,_0x33985f){if(_0x48eea7[_0x5e28('0xb')]('closed')){_0x48eea7[_0x5e28('0xc')]=moment()[_0x5e28('0xd')](_0x5e28('0xe'));}_0x33985f(null,_0x48eea7);}}});};
\ No newline at end of file
index 80a5312..01004dd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d31=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','./whatsappInteraction.socket','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','body','options','raw','where','limit','stringify','AddTagsToWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','util','bluebird'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x2d31,0x1ec));var _0x12d3=function(_0x3db122,_0x5e6bee){_0x3db122=_0x3db122-0x0;var _0x325b67=_0x2d31[_0x3db122];return _0x325b67;};'use strict';var _=require('lodash');var util=require(_0x12d3('0x0'));var moment=require('moment');var BPromise=require(_0x12d3('0x1'));var rs=require(_0x12d3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x12d3('0x3'))['db'];var utils=require(_0x12d3('0x4'));var logger=require('../../config/logger')(_0x12d3('0x5'));var config=require(_0x12d3('0x6'));var jayson=require(_0x12d3('0x7'));var client=jayson[_0x12d3('0x8')][_0x12d3('0x9')]({'port':0x232a});config[_0x12d3('0xa')]=_['defaults'](config[_0x12d3('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x12d3('0xb'))['register'](socket);function respondWithRpcPromise(_0x3d3b17,_0x1a8097,_0x42819b){return new BPromise(function(_0x4c3490,_0x28058b){return client[_0x12d3('0xc')](_0x3d3b17,_0x42819b)[_0x12d3('0xd')](function(_0x2e2536){logger['info'](_0x12d3('0xe'),_0x1a8097,_0x12d3('0xf'));logger[_0x12d3('0x10')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x1a8097,_0x12d3('0xf'),JSON['stringify'](_0x2e2536));if(_0x2e2536[_0x12d3('0x11')]){if(_0x2e2536[_0x12d3('0x11')][_0x12d3('0x12')]===0x1f4){logger[_0x12d3('0x11')](_0x12d3('0xe'),_0x1a8097,_0x2e2536[_0x12d3('0x11')][_0x12d3('0x13')]);return _0x28058b(_0x2e2536[_0x12d3('0x11')][_0x12d3('0x13')]);}logger[_0x12d3('0x11')](_0x12d3('0xe'),_0x1a8097,_0x2e2536[_0x12d3('0x11')][_0x12d3('0x13')]);return _0x4c3490(_0x2e2536['error'][_0x12d3('0x13')]);}else{logger[_0x12d3('0x14')](_0x12d3('0xe'),_0x1a8097,_0x12d3('0xf'));_0x4c3490(_0x2e2536[_0x12d3('0x15')][_0x12d3('0x13')]);}})[_0x12d3('0x16')](function(_0x2e4406){logger[_0x12d3('0x11')](_0x12d3('0xe'),_0x1a8097,_0x2e4406);_0x28058b(_0x2e4406);});});}exports[_0x12d3('0x17')]=function(_0x66fd12){var _0x3db132=this;return new Promise(function(_0x37f70d,_0x5e0954){return db[_0x12d3('0x18')]['update'](_0x66fd12[_0x12d3('0x19')],{'raw':_0x66fd12['options']?_0x66fd12[_0x12d3('0x1a')][_0x12d3('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x66fd12[_0x12d3('0x1a')]?_0x66fd12['options'][_0x12d3('0x1c')]||null:null,'attributes':_0x66fd12[_0x12d3('0x1a')]?_0x66fd12[_0x12d3('0x1a')]['attributes']||null:null,'limit':_0x66fd12[_0x12d3('0x1a')]?_0x66fd12[_0x12d3('0x1a')][_0x12d3('0x1d')]||null:null})[_0x12d3('0xd')](function(_0x45a323){logger[_0x12d3('0x14')](_0x12d3('0x17'),_0x66fd12);logger[_0x12d3('0x10')](_0x12d3('0x17'),_0x66fd12,JSON[_0x12d3('0x1e')](_0x45a323));_0x37f70d(_0x45a323);})[_0x12d3('0x16')](function(_0xacd6fd){logger['error'](_0x12d3('0x17'),_0xacd6fd[_0x12d3('0x13')],_0x66fd12);_0x5e0954(_0x3db132[_0x12d3('0x11')](0x1f4,_0xacd6fd[_0x12d3('0x13')]));});});};exports[_0x12d3('0x1f')]=function(_0x50e211){return new Promise(function(_0x3f2dc4,_0x5055a0){return db['WhatsappInteraction'][_0x12d3('0x20')]({'where':_0x50e211[_0x12d3('0x1a')]?_0x50e211[_0x12d3('0x1a')][_0x12d3('0x1c')]||null:null})[_0x12d3('0xd')](function(_0x151a3a){if(_0x151a3a){return _0x151a3a[_0x12d3('0x21')](_0x50e211['body'][_0x12d3('0x22')],_[_0x12d3('0x23')](_0x50e211['body'],['ids','id'])||{});}})[_0x12d3('0x24')](function(_0x4e9851){logger[_0x12d3('0x14')]('AddTags',_0x50e211);logger['debug']('AddTags',_0x50e211,JSON[_0x12d3('0x1e')](_0x4e9851));_0x3f2dc4(_0x4e9851);})[_0x12d3('0x16')](function(_0x17e870){logger['error'](_0x12d3('0x25'),_0x17e870[_0x12d3('0x13')],_0x50e211);_0x5055a0(_this[_0x12d3('0x11')](0x1f4,_0x17e870['message']));});});};
\ No newline at end of file
+var _0xd8a9=['redis','defaults','socket.io-emitter','./whatsappInteraction.socket','request','then','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','stringify','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0xd8a9,0x1b8));var _0x9d8a=function(_0x678c13,_0x24fc87){_0x678c13=_0x678c13-0x0;var _0x5a56c2=_0xd8a9[_0x678c13];return _0x5a56c2;};'use strict';var _=require(_0x9d8a('0x0'));var util=require(_0x9d8a('0x1'));var moment=require(_0x9d8a('0x2'));var BPromise=require(_0x9d8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d8a('0x4'))['db'];var utils=require(_0x9d8a('0x5'));var logger=require(_0x9d8a('0x6'))(_0x9d8a('0x7'));var config=require('../../config/environment');var jayson=require(_0x9d8a('0x8'));var client=jayson[_0x9d8a('0x9')][_0x9d8a('0xa')]({'port':0x232a});config[_0x9d8a('0xb')]=_[_0x9d8a('0xc')](config[_0x9d8a('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x9d8a('0xd'))(new Redis(config[_0x9d8a('0xb')]));require(_0x9d8a('0xe'))['register'](socket);function respondWithRpcPromise(_0x393239,_0x28ec15,_0x37c6f2){return new BPromise(function(_0x4d5ad3,_0x761f03){return client[_0x9d8a('0xf')](_0x393239,_0x37c6f2)[_0x9d8a('0x10')](function(_0x170afe){logger['info'](_0x9d8a('0x11'),_0x28ec15,_0x9d8a('0x12'));logger[_0x9d8a('0x13')](_0x9d8a('0x14'),_0x28ec15,_0x9d8a('0x12'),JSON['stringify'](_0x170afe));if(_0x170afe[_0x9d8a('0x15')]){if(_0x170afe[_0x9d8a('0x15')][_0x9d8a('0x16')]===0x1f4){logger['error'](_0x9d8a('0x11'),_0x28ec15,_0x170afe[_0x9d8a('0x15')][_0x9d8a('0x17')]);return _0x761f03(_0x170afe['error']['message']);}logger[_0x9d8a('0x15')](_0x9d8a('0x11'),_0x28ec15,_0x170afe[_0x9d8a('0x15')][_0x9d8a('0x17')]);return _0x4d5ad3(_0x170afe['error'][_0x9d8a('0x17')]);}else{logger[_0x9d8a('0x18')](_0x9d8a('0x11'),_0x28ec15,_0x9d8a('0x12'));_0x4d5ad3(_0x170afe['result'][_0x9d8a('0x17')]);}})[_0x9d8a('0x19')](function(_0x4b33a5){logger[_0x9d8a('0x15')](_0x9d8a('0x11'),_0x28ec15,_0x4b33a5);_0x761f03(_0x4b33a5);});});}exports[_0x9d8a('0x1a')]=function(_0x3f5a02){var _0xd4c993=this;return new Promise(function(_0x3ee2fe,_0xf4778f){return db[_0x9d8a('0x1b')][_0x9d8a('0x1c')](_0x3f5a02[_0x9d8a('0x1d')],{'raw':_0x3f5a02['options']?_0x3f5a02[_0x9d8a('0x1e')][_0x9d8a('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f5a02[_0x9d8a('0x1e')]?_0x3f5a02[_0x9d8a('0x1e')][_0x9d8a('0x20')]||null:null,'attributes':_0x3f5a02[_0x9d8a('0x1e')]?_0x3f5a02[_0x9d8a('0x1e')][_0x9d8a('0x21')]||null:null,'limit':_0x3f5a02[_0x9d8a('0x1e')]?_0x3f5a02['options'][_0x9d8a('0x22')]||null:null})[_0x9d8a('0x10')](function(_0x2c6d2c){logger[_0x9d8a('0x18')](_0x9d8a('0x1a'),_0x3f5a02);logger['debug']('UpdateWhatsappInteraction',_0x3f5a02,JSON[_0x9d8a('0x23')](_0x2c6d2c));_0x3ee2fe(_0x2c6d2c);})[_0x9d8a('0x19')](function(_0x13510d){logger[_0x9d8a('0x15')](_0x9d8a('0x1a'),_0x13510d[_0x9d8a('0x17')],_0x3f5a02);_0xf4778f(_0xd4c993[_0x9d8a('0x15')](0x1f4,_0x13510d['message']));});});};exports['AddTagsToWhatsappInteraction']=function(_0x580acf){return new Promise(function(_0x27fcdc,_0x55ce86){return db[_0x9d8a('0x1b')]['find']({'where':_0x580acf['options']?_0x580acf['options'][_0x9d8a('0x20')]||null:null})[_0x9d8a('0x10')](function(_0x2cc554){if(_0x2cc554){return _0x2cc554[_0x9d8a('0x24')](_0x580acf[_0x9d8a('0x1d')]['ids'],_[_0x9d8a('0x25')](_0x580acf[_0x9d8a('0x1d')],[_0x9d8a('0x26'),'id'])||{});}})[_0x9d8a('0x27')](function(_0x4b1047){logger['info']('AddTags',_0x580acf);logger['debug']('AddTags',_0x580acf,JSON[_0x9d8a('0x23')](_0x4b1047));_0x27fcdc(_0x4b1047);})[_0x9d8a('0x19')](function(_0x2bbc0e){logger[_0x9d8a('0x15')](_0x9d8a('0x28'),_0x2bbc0e[_0x9d8a('0x17')],_0x580acf);_0x55ce86(_this[_0x9d8a('0x15')](0x1f4,_0x2bbc0e[_0x9d8a('0x17')]));});});};
\ No newline at end of file
index ff40ef3..b71b327 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x93d6=['register','length','whatsappInteraction:','./whatsappInteraction.events','save','remove','update','emit','removeListener'];(function(_0x5a7680,_0x3f9c51){var _0x14e743=function(_0x2bfddd){while(--_0x2bfddd){_0x5a7680['push'](_0x5a7680['shift']());}};_0x14e743(++_0x3f9c51);}(_0x93d6,0x1aa));var _0x693d=function(_0x3b06a6,_0xb99922){_0x3b06a6=_0x3b06a6-0x0;var _0x70a37b=_0x93d6[_0x3b06a6];return _0x70a37b;};'use strict';var WhatsappInteractionEvents=require(_0x693d('0x0'));var events=[_0x693d('0x1'),_0x693d('0x2'),_0x693d('0x3')];function createListener(_0x2cf7e0,_0x25c43a){return function(_0x37aa0c){_0x25c43a[_0x693d('0x4')](_0x2cf7e0,_0x37aa0c);};}function removeListener(_0x4cdfb5,_0xb64ca1){return function(){WhatsappInteractionEvents[_0x693d('0x5')](_0x4cdfb5,_0xb64ca1);};}exports[_0x693d('0x6')]=function(_0x2793e6){for(var _0x84e70a=0x0,_0x2fda75=events[_0x693d('0x7')];_0x84e70a<_0x2fda75;_0x84e70a++){var _0x66432a=events[_0x84e70a];var _0x3ef8cc=createListener(_0x693d('0x8')+_0x66432a,_0x2793e6);WhatsappInteractionEvents['on'](_0x66432a,_0x3ef8cc);}};
\ No newline at end of file
+var _0x8f2c=['whatsappInteraction:','./whatsappInteraction.events','save','remove','emit','register','length'];(function(_0x455fa3,_0x763d6a){var _0xe24c22=function(_0x1ab749){while(--_0x1ab749){_0x455fa3['push'](_0x455fa3['shift']());}};_0xe24c22(++_0x763d6a);}(_0x8f2c,0xe8));var _0xc8f2=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x8f2c[_0x599f41];return _0x2e4d58;};'use strict';var WhatsappInteractionEvents=require(_0xc8f2('0x0'));var events=[_0xc8f2('0x1'),_0xc8f2('0x2'),'update'];function createListener(_0x48bc76,_0x1e2bd2){return function(_0x5e1375){_0x1e2bd2[_0xc8f2('0x3')](_0x48bc76,_0x5e1375);};}function removeListener(_0xe92816,_0x37fea7){return function(){WhatsappInteractionEvents['removeListener'](_0xe92816,_0x37fea7);};}exports[_0xc8f2('0x4')]=function(_0x24aed1){for(var _0x3dc770=0x0,_0x3113f2=events[_0xc8f2('0x5')];_0x3dc770<_0x3113f2;_0x3dc770++){var _0x3d59b4=events[_0x3dc770];var _0x288a51=createListener(_0xc8f2('0x6')+_0x3d59b4,_0x24aed1);WhatsappInteractionEvents['on'](_0x3d59b4,_0x288a51);}};
\ No newline at end of file
index c5587dc..8baa080 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d0f=['index','/describe','isAuthenticated','describe','/:id','show','post','tracked','whatsapp','whatsappmessage:create','/:id/status','update','put','accept','reject','multer','util','express','Router','fs-extra','../../config/environment','./whatsappMessage.controller','get'];(function(_0x4df1ee,_0x2788bd){var _0x41f8c5=function(_0x92e5de){while(--_0x92e5de){_0x4df1ee['push'](_0x4df1ee['shift']());}};_0x41f8c5(++_0x2788bd);}(_0x4d0f,0xb0));var _0xf4d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4d0f[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xf4d0('0x0'));var util=require(_0xf4d0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf4d0('0x2'));var router=express[_0xf4d0('0x3')]();var fs_extra=require(_0xf4d0('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf4d0('0x5'));var controller=require(_0xf4d0('0x6'));router[_0xf4d0('0x7')]('/',auth['isAuthenticated'](),controller[_0xf4d0('0x8')]);router[_0xf4d0('0x7')](_0xf4d0('0x9'),auth[_0xf4d0('0xa')](),controller[_0xf4d0('0xb')]);router[_0xf4d0('0x7')](_0xf4d0('0xc'),auth['isAuthenticated'](),controller[_0xf4d0('0xd')]);router[_0xf4d0('0xe')]('/',auth[_0xf4d0('0xa')](),interaction[_0xf4d0('0xf')](_0xf4d0('0x10'),_0xf4d0('0x11')),controller['create']);router['post'](_0xf4d0('0x12'),controller['status']);router['put'](_0xf4d0('0xc'),auth[_0xf4d0('0xa')](),controller[_0xf4d0('0x13')]);router[_0xf4d0('0x14')]('/:id/accept',auth['isAuthenticated'](),controller[_0xf4d0('0x15')]);router[_0xf4d0('0x14')]('/:id/reject',auth[_0xf4d0('0xa')](),controller[_0xf4d0('0x16')]);router['delete'](_0xf4d0('0xc'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x4143=['../../config/environment','get','index','/describe','isAuthenticated','describe','show','tracked','whatsapp','whatsappmessage:create','create','status','put','/:id','update','/:id/accept','accept','/:id/reject','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x22d5c8,_0x50858f){var _0x57e598=function(_0x55ccf5){while(--_0x55ccf5){_0x22d5c8['push'](_0x22d5c8['shift']());}};_0x57e598(++_0x50858f);}(_0x4143,0x1da));var _0x3414=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x4143[_0x47e7cb];return _0x2a8874;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3414('0x0'));var timeout=require('connect-timeout');var express=require(_0x3414('0x1'));var router=express[_0x3414('0x2')]();var fs_extra=require(_0x3414('0x3'));var auth=require(_0x3414('0x4'));var interaction=require(_0x3414('0x5'));var config=require(_0x3414('0x6'));var controller=require('./whatsappMessage.controller');router[_0x3414('0x7')]('/',auth['isAuthenticated'](),controller[_0x3414('0x8')]);router[_0x3414('0x7')](_0x3414('0x9'),auth[_0x3414('0xa')](),controller[_0x3414('0xb')]);router[_0x3414('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x3414('0xc')]);router['post']('/',auth[_0x3414('0xa')](),interaction[_0x3414('0xd')](_0x3414('0xe'),_0x3414('0xf')),controller[_0x3414('0x10')]);router['post']('/:id/status',controller[_0x3414('0x11')]);router[_0x3414('0x12')](_0x3414('0x13'),auth['isAuthenticated'](),controller[_0x3414('0x14')]);router[_0x3414('0x12')](_0x3414('0x15'),auth[_0x3414('0xa')](),controller[_0x3414('0x16')]);router['put'](_0x3414('0x17'),auth[_0x3414('0xa')](),controller['reject']);router['delete'](_0x3414('0x13'),auth[_0x3414('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
index 71e3552..39d6adb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfb9e=['sequelize','exports','TEXT','medium','BOOLEAN','out','STRING'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xfb9e,0x1d5));var _0xefb9=function(_0x401b1a,_0x24bddf){_0x401b1a=_0x401b1a-0x0;var _0x51e72f=_0xfb9e[_0x401b1a];return _0x51e72f;};'use strict';var Sequelize=require(_0xefb9('0x0'));module[_0xefb9('0x1')]={'body':{'type':Sequelize[_0xefb9('0x2')](_0xefb9('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xefb9('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xefb9('0x5')),'defaultValue':_0xefb9('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xefb9('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xefb9('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xefb9('0x6')]},'providerResponse':{'type':Sequelize[_0xefb9('0x2')]}};
\ No newline at end of file
+var _0x8fed=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','DATE'];(function(_0x22e782,_0x314c09){var _0xc6a20d=function(_0x30378c){while(--_0x30378c){_0x22e782['push'](_0x22e782['shift']());}};_0xc6a20d(++_0x314c09);}(_0x8fed,0xab));var _0xd8fe=function(_0x2a8f4f,_0x4c27c4){_0x2a8f4f=_0x2a8f4f-0x0;var _0xf65fd1=_0x8fed[_0x2a8f4f];return _0xf65fd1;};'use strict';var Sequelize=require(_0xd8fe('0x0'));module[_0xd8fe('0x1')]={'body':{'type':Sequelize[_0xd8fe('0x2')](_0xd8fe('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xd8fe('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd8fe('0x5')]('in',_0xd8fe('0x6')),'defaultValue':_0xd8fe('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xd8fe('0x7')](0xbe)},'phone':{'type':Sequelize[_0xd8fe('0x7')]},'readAt':{'type':Sequelize[_0xd8fe('0x8')]},'secret':{'type':Sequelize[_0xd8fe('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xd8fe('0x7')]},'providerResponse':{'type':Sequelize[_0xd8fe('0x2')]}};
\ No newline at end of file
index 92e3173..924dbf9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c61=['User','email','event','debug','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','zip-dir','fast-json-patch','moment','util','path','to-csv','fs-extra','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','index','map','WhatsappMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','accept','whatsapp','read','readAt','format','UserId','user','agent','get','WhatsappInteraction','WhatsappInteractionId','read1stAt','interaction','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','fullname','internal','manual','interface','channel','motionChannel','EventManager','whatsapp-interactions','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage'];(function(_0x49fa98,_0x11accf){var _0x1698f1=function(_0x22f95f){while(--_0x22f95f){_0x49fa98['push'](_0x49fa98['shift']());}};_0x1698f1(++_0x11accf);}(_0x3c61,0x11a));var _0x13c6=function(_0x374e03,_0x10c8d7){_0x374e03=_0x374e03-0x0;var _0x137e46=_0x3c61[_0x374e03];return _0x137e46;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x13c6('0x0'));var jsonpatch=require(_0x13c6('0x1'));var rp=require('request-promise');var moment=require(_0x13c6('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x13c6('0x3'));var path=require(_0x13c6('0x4'));var sox=require('sox');var csv=require(_0x13c6('0x5'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x13c6('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x13c6('0x7'));var jsforce=require('jsforce');var deskjs=require(_0x13c6('0x8'));var toCsv=require(_0x13c6('0x5'));var querystring=require(_0x13c6('0x9'));var Papa=require(_0x13c6('0xa'));var Redis=require(_0x13c6('0xb'));var authService=require('../../components/auth/service');var qs=require(_0x13c6('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x13c6('0xd'));var logger=require(_0x13c6('0xe'))(_0x13c6('0xf'));var utils=require(_0x13c6('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0x13c6('0x11'));var db=require(_0x13c6('0x12'))['db'];config[_0x13c6('0x13')]=_[_0x13c6('0x14')](config[_0x13c6('0x13')],{'host':_0x13c6('0x15'),'port':0x18eb});var socket=require(_0x13c6('0x16'))(new Redis(config['redis']));require('./whatsappMessage.socket')['register'](socket);var jayson=require(_0x13c6('0x17'));var client=jayson[_0x13c6('0x18')]['http']({'port':0x232c});var client9002=jayson['client'][_0x13c6('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x46359b,_0x1319ca,_0x150a9d,_0x275020){return new BPromise(function(_0x48eeb7,_0x4d1889){var _0x42c45b=_0x275020||client;return _0x42c45b[_0x13c6('0x1a')](_0x46359b,_0x150a9d)[_0x13c6('0x1b')](function(_0xd88a4b){logger['info'](_0x13c6('0x1c'),_0x1319ca,_0x13c6('0x1d'));logger['debug'](_0x13c6('0x1e'),_0x1319ca,_0x13c6('0x1d'),JSON['stringify'](_0xd88a4b));if(_0xd88a4b[_0x13c6('0x1f')]){if(_0xd88a4b[_0x13c6('0x1f')][_0x13c6('0x20')]===0x1f4){logger[_0x13c6('0x1f')]('WhatsappMessage,\x20%s,\x20%s',_0x1319ca,_0xd88a4b[_0x13c6('0x1f')][_0x13c6('0x21')]);return _0x4d1889(_0xd88a4b[_0x13c6('0x1f')][_0x13c6('0x21')]);}logger['error'](_0x13c6('0x1c'),_0x1319ca,_0xd88a4b[_0x13c6('0x1f')][_0x13c6('0x21')]);return _0x48eeb7(_0xd88a4b[_0x13c6('0x1f')][_0x13c6('0x21')]);}else{logger[_0x13c6('0x22')](_0x13c6('0x1c'),_0x1319ca,_0x13c6('0x1d'));_0x48eeb7(_0xd88a4b[_0x13c6('0x23')][_0x13c6('0x21')]);}})['catch'](function(_0x87402d){logger[_0x13c6('0x1f')](_0x13c6('0x1c'),_0x1319ca,_0x87402d);_0x4d1889(_0x87402d);});});}function respondWithStatusCode(_0x453580,_0x2f2c52){_0x2f2c52=_0x2f2c52||0xcc;return function(_0x13102a){if(_0x13102a){return _0x453580['sendStatus'](_0x2f2c52);}return _0x453580[_0x13c6('0x24')](_0x2f2c52)[_0x13c6('0x25')]();};}function respondWithResult(_0x227b2d,_0x540c98){_0x540c98=_0x540c98||0xc8;return function(_0x285114){if(_0x285114){return _0x227b2d[_0x13c6('0x24')](_0x540c98)[_0x13c6('0x26')](_0x285114);}};}function respondWithFilteredResult(_0x33866a,_0xd8ec19){return function(_0x3b33e6){if(_0x3b33e6){var _0x1e7fe1=typeof _0xd8ec19[_0x13c6('0x27')]===_0x13c6('0x28')&&typeof _0xd8ec19[_0x13c6('0x29')]===_0x13c6('0x28');var _0x134619=_0x3b33e6[_0x13c6('0x2a')];var _0x454bb8=_0x1e7fe1?0x0:_0xd8ec19[_0x13c6('0x27')];var _0x5a3018=_0x1e7fe1?_0x3b33e6[_0x13c6('0x2a')]:_0xd8ec19[_0x13c6('0x27')]+_0xd8ec19[_0x13c6('0x29')];var _0x425fcb;if(_0x5a3018>=_0x134619){_0x5a3018=_0x134619;_0x425fcb=0xc8;}else{_0x425fcb=0xce;}_0x33866a[_0x13c6('0x24')](_0x425fcb);return _0x33866a[_0x13c6('0x2b')](_0x13c6('0x2c'),_0x454bb8+'-'+_0x5a3018+'/'+_0x134619)[_0x13c6('0x26')](_0x3b33e6);}return null;};}function patchUpdates(_0xba01bb){return function(_0x526a96){try{jsonpatch[_0x13c6('0x2d')](_0x526a96,_0xba01bb,!![]);}catch(_0x15248b){return BPromise[_0x13c6('0x2e')](_0x15248b);}return _0x526a96[_0x13c6('0x2f')]();};}function saveUpdates(_0x23b504,_0x1f3f5e){return function(_0x1e0ddd){if(_0x1e0ddd){return _0x1e0ddd[_0x13c6('0x30')](_0x23b504)[_0x13c6('0x1b')](function(_0x78dfb5){return _0x78dfb5;});}return null;};}function removeEntity(_0x109618,_0x37f2cf){return function(_0x10f1c7){if(_0x10f1c7){return _0x10f1c7[_0x13c6('0x31')]()['then'](function(){_0x109618[_0x13c6('0x24')](0xcc)[_0x13c6('0x25')]();});}};}function handleEntityNotFound(_0x5336a2,_0x16d45d){return function(_0x309b49){if(!_0x309b49){_0x5336a2[_0x13c6('0x32')](0x194);}return _0x309b49;};}function handleError(_0x461ece,_0x22f077){_0x22f077=_0x22f077||0x1f4;return function(_0x135310){logger[_0x13c6('0x1f')](_0x135310[_0x13c6('0x33')]);if(_0x135310[_0x13c6('0x34')]){delete _0x135310[_0x13c6('0x34')];}_0x461ece[_0x13c6('0x24')](_0x22f077)['send'](_0x135310);};}exports[_0x13c6('0x35')]=function(_0x429637,_0xfe41d){var _0x3cbbe2={},_0x39064f={},_0x220605={'count':0x0,'rows':[]};var _0xcc1482=_[_0x13c6('0x36')](db[_0x13c6('0x37')][_0x13c6('0x38')],function(_0x4048ae){return{'name':_0x4048ae[_0x13c6('0x39')],'type':_0x4048ae[_0x13c6('0x3a')][_0x13c6('0x3b')]};});_0x39064f[_0x13c6('0x3c')]=_[_0x13c6('0x36')](_0xcc1482,_0x13c6('0x34'));_0x39064f['query']=_[_0x13c6('0x3d')](_0x429637[_0x13c6('0x3e')]);_0x39064f[_0x13c6('0x3f')]=_[_0x13c6('0x40')](_0x39064f[_0x13c6('0x3c')],_0x39064f[_0x13c6('0x3e')]);_0x3cbbe2[_0x13c6('0x41')]=_['intersection'](_0x39064f[_0x13c6('0x3c')],qs['fields'](_0x429637[_0x13c6('0x3e')][_0x13c6('0x42')]));_0x3cbbe2[_0x13c6('0x41')]=_0x3cbbe2[_0x13c6('0x41')][_0x13c6('0x43')]?_0x3cbbe2['attributes']:_0x39064f[_0x13c6('0x3c')];if(!_0x429637[_0x13c6('0x3e')][_0x13c6('0x44')]('nolimit')){_0x3cbbe2['limit']=qs[_0x13c6('0x29')](_0x429637['query']['limit']);_0x3cbbe2[_0x13c6('0x27')]=qs[_0x13c6('0x27')](_0x429637['query'][_0x13c6('0x27')]);}_0x3cbbe2['order']=qs['sort'](_0x429637[_0x13c6('0x3e')]['sort']);_0x3cbbe2[_0x13c6('0x45')]=qs[_0x13c6('0x3f')](_[_0x13c6('0x46')](_0x429637[_0x13c6('0x3e')],_0x39064f['filters']),_0xcc1482);if(_0x429637['query'][_0x13c6('0x47')]){_0x3cbbe2[_0x13c6('0x45')]=_[_0x13c6('0x48')](_0x3cbbe2[_0x13c6('0x45')],{'$or':_[_0x13c6('0x36')](_0xcc1482,function(_0x59b24a){if(_0x59b24a[_0x13c6('0x3a')]!==_0x13c6('0x49')){var _0x1a8f01={};_0x1a8f01[_0x59b24a['name']]={'$like':'%'+_0x429637['query'][_0x13c6('0x47')]+'%'};return _0x1a8f01;}})});}_0x3cbbe2=_['merge']({},_0x3cbbe2,_0x429637[_0x13c6('0x4a')]);var _0xdc961a={'where':_0x3cbbe2['where']};return db['WhatsappMessage'][_0x13c6('0x2a')](_0xdc961a)[_0x13c6('0x1b')](function(_0x5cc363){_0x220605[_0x13c6('0x2a')]=_0x5cc363;if(_0x429637[_0x13c6('0x3e')][_0x13c6('0x4b')]){_0x3cbbe2[_0x13c6('0x4c')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x13c6('0x4d')](_0x3cbbe2);})[_0x13c6('0x1b')](function(_0x12f72f){_0x220605[_0x13c6('0x4e')]=_0x12f72f;return _0x220605;})[_0x13c6('0x1b')](respondWithFilteredResult(_0xfe41d,_0x3cbbe2))[_0x13c6('0x4f')](handleError(_0xfe41d,null));};exports[_0x13c6('0x50')]=function(_0x5682ac,_0x48743f){var _0x14aaa5={'raw':!![],'where':{'id':_0x5682ac[_0x13c6('0x51')]['id']}},_0x41e3ba={};_0x41e3ba['model']=_['keys'](db[_0x13c6('0x37')][_0x13c6('0x38')]);_0x41e3ba[_0x13c6('0x3e')]=_[_0x13c6('0x3d')](_0x5682ac[_0x13c6('0x3e')]);_0x41e3ba[_0x13c6('0x3f')]=_[_0x13c6('0x40')](_0x41e3ba['model'],_0x41e3ba[_0x13c6('0x3e')]);_0x14aaa5[_0x13c6('0x41')]=_[_0x13c6('0x40')](_0x41e3ba[_0x13c6('0x3c')],qs[_0x13c6('0x42')](_0x5682ac[_0x13c6('0x3e')][_0x13c6('0x42')]));_0x14aaa5[_0x13c6('0x41')]=_0x14aaa5[_0x13c6('0x41')][_0x13c6('0x43')]?_0x14aaa5[_0x13c6('0x41')]:_0x41e3ba['model'];if(_0x5682ac[_0x13c6('0x3e')]['includeAll']){_0x14aaa5[_0x13c6('0x4c')]=[{'all':!![]}];}_0x14aaa5=_[_0x13c6('0x48')]({},_0x14aaa5,_0x5682ac[_0x13c6('0x4a')]);return db[_0x13c6('0x37')]['find'](_0x14aaa5)[_0x13c6('0x1b')](handleEntityNotFound(_0x48743f,null))[_0x13c6('0x1b')](respondWithResult(_0x48743f,null))[_0x13c6('0x4f')](handleError(_0x48743f,null));};exports[_0x13c6('0x52')]=function(_0x2fc3e3,_0x479409){return db[_0x13c6('0x37')][_0x13c6('0x52')](_0x2fc3e3[_0x13c6('0x53')],{})[_0x13c6('0x1b')](respondWithResult(_0x479409,0xc9))[_0x13c6('0x4f')](handleError(_0x479409,null));};exports[_0x13c6('0x30')]=function(_0x22254,_0x3834c){if(_0x22254[_0x13c6('0x53')]['id']){delete _0x22254[_0x13c6('0x53')]['id'];}return db[_0x13c6('0x37')][_0x13c6('0x54')]({'where':{'id':_0x22254[_0x13c6('0x51')]['id']}})[_0x13c6('0x1b')](handleEntityNotFound(_0x3834c,null))[_0x13c6('0x1b')](saveUpdates(_0x22254[_0x13c6('0x53')],null))[_0x13c6('0x1b')](respondWithResult(_0x3834c,null))[_0x13c6('0x4f')](handleError(_0x3834c,null));};exports[_0x13c6('0x31')]=function(_0x19fee8,_0x5c8910){return db[_0x13c6('0x37')][_0x13c6('0x54')]({'where':{'id':_0x19fee8[_0x13c6('0x51')]['id']}})[_0x13c6('0x1b')](handleEntityNotFound(_0x5c8910,null))[_0x13c6('0x1b')](removeEntity(_0x5c8910,null))['catch'](handleError(_0x5c8910,null));};exports[_0x13c6('0x55')]=function(_0x12f163,_0x2d1d8e){return db['WhatsappMessage'][_0x13c6('0x55')]()[_0x13c6('0x1b')](respondWithResult(_0x2d1d8e,null))['catch'](handleError(_0x2d1d8e,null));};var interaction_log=require(_0x13c6('0xe'))('whatsapp-interactions');exports[_0x13c6('0x56')]=function(_0x2fa823,_0x412b6b,_0x4bbcb2){var _0x74b798={'agent':{},'channel':_0x13c6('0x57')};if(_0x2fa823[_0x13c6('0x53')]['id']){delete _0x2fa823['body']['id'];}_0x2fa823[_0x13c6('0x53')][_0x13c6('0x58')]=!![];_0x2fa823[_0x13c6('0x53')][_0x13c6('0x59')]=moment()[_0x13c6('0x5a')]('YYYY-MM-DD\x20HH:mm:ss');_0x2fa823[_0x13c6('0x53')]['UserId']=_0x2fa823[_0x13c6('0x53')][_0x13c6('0x5b')]||_0x2fa823[_0x13c6('0x5c')]['id'];_0x74b798[_0x13c6('0x5d')]['id']=_0x2fa823[_0x13c6('0x53')][_0x13c6('0x5b')];return db['WhatsappMessage'][_0x13c6('0x54')]({'where':{'id':_0x2fa823[_0x13c6('0x51')]['id'],'UserId':null}})[_0x13c6('0x1b')](handleEntityNotFound(_0x412b6b,null))[_0x13c6('0x1b')](saveUpdates(_0x2fa823['body'],null))[_0x13c6('0x1b')](function(_0x27a219){if(_0x27a219){_0x74b798['message']=_0x27a219[_0x13c6('0x5e')]({'plain':!![]});return db[_0x13c6('0x5f')][_0x13c6('0x54')]({'where':{'id':_0x27a219[_0x13c6('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x412b6b,null))[_0x13c6('0x1b')](function(_0x2d5bc3){if(_0x2d5bc3){return _0x2d5bc3['update']({'UserId':_0x2fa823[_0x13c6('0x53')][_0x13c6('0x5b')],'read1stAt':_['isNil'](_0x2d5bc3[_0x13c6('0x61')])?moment()[_0x13c6('0x5a')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x13c6('0x1b')](function(_0xad986d){if(_0xad986d){_0x74b798[_0x13c6('0x62')]=_0xad986d[_0x13c6('0x5e')]({'plain':!![]});interaction_log['info'](_0x13c6('0x63'),_0x2fa823[_0x13c6('0x5c')]['id'],_0x2fa823[_0x13c6('0x5c')][_0x13c6('0x34')],_0x2fa823['user'][_0x13c6('0x64')],_0x74b798[_0x13c6('0x62')]['id'],_0x2fa823[_0x13c6('0x53')]?JSON[_0x13c6('0x65')](_0x2fa823['body']):'null');return respondWithRpcPromise(_0x13c6('0x66'),_0x13c6('0x67'),_0x74b798);}return null;})[_0x13c6('0x1b')](function(_0x91f1c0){var _0x266201=_0x13c6('0x68')+_0x91f1c0[_0x13c6('0x21')][_0x13c6('0x69')];return db[_0x13c6('0x6a')][_0x13c6('0x3e')](_0x266201,{'type':db[_0x13c6('0x6b')][_0x13c6('0x6c')][_0x13c6('0x6d')],'raw':!![]})[_0x13c6('0x1b')](function(_0x29b446){return _0x29b446;});})[_0x13c6('0x1b')](function(_0x309cac){if(_0x309cac){_0x74b798[_0x13c6('0x21')][_0x13c6('0x6e')]=_0x309cac[0x0];if(!_0x2fa823['body'][_0x13c6('0x5b')])return;return db['User'][_0x13c6('0x54')]({'where':{'id':_0x2fa823['body']['UserId'],'role':_0x13c6('0x5d')},'attributes':['id',_0x13c6('0x34'),_0x13c6('0x6f'),'email',_0x13c6('0x70')],'raw':!![]});}return null;})[_0x13c6('0x1b')](function(_0x2f564c){if(!_0x2f564c)return null;_0x74b798[_0x13c6('0x21')][_0x13c6('0x5d')]=_0x2f564c;return _0x74b798;})[_0x13c6('0x1b')](function(_0x14ccce){if(_0x14ccce){if(_0x2fa823[_0x13c6('0x53')][_0x13c6('0x71')]){_0x74b798[_0x13c6('0x21')][_0x13c6('0x72')]=util['format']('SIP/%s',_0x2fa823['user']['name']);_0x74b798[_0x13c6('0x21')][_0x13c6('0x73')]=_0x74b798[_0x13c6('0x73')];_0x74b798[_0x13c6('0x21')][_0x13c6('0x74')]=_0x74b798['channel'];_0x74b798[_0x13c6('0x21')]['event']='accept';return respondWithRpcPromise(_0x13c6('0x75'),_0x13c6('0x75'),{'event':'acceptmessage','message':_0x74b798[_0x13c6('0x21')]},client9002)['then'](function(){return _0x74b798;});}return _0x74b798;}return null;})[_0x13c6('0x1b')](respondWithResult(_0x412b6b,null))[_0x13c6('0x4f')](handleError(_0x412b6b,null));};var interaction_log=require(_0x13c6('0xe'))(_0x13c6('0x76'));exports[_0x13c6('0x2e')]=function(_0x4fabaf,_0x29cbfd,_0x4dd606){var _0x418b16={'agent':{},'channel':_0x13c6('0x57')};if(_0x4fabaf[_0x13c6('0x53')]['id']){delete _0x4fabaf[_0x13c6('0x53')]['id'];}_0x4fabaf[_0x13c6('0x53')][_0x13c6('0x5b')]=_0x4fabaf[_0x13c6('0x53')][_0x13c6('0x5b')]||_0x4fabaf[_0x13c6('0x5c')]['id'];_0x418b16['agent']['id']=_0x4fabaf['body'][_0x13c6('0x5b')];return db[_0x13c6('0x37')]['find']({'where':{'id':_0x4fabaf[_0x13c6('0x51')]['id'],'UserId':null}})[_0x13c6('0x1b')](handleEntityNotFound(_0x29cbfd,null))['then'](function(_0x18ca41){if(_0x18ca41){_0x418b16[_0x13c6('0x21')]=_0x18ca41['get']({'plain':!![]});return db['WhatsappInteraction'][_0x13c6('0x54')]({'where':{'id':_0x18ca41[_0x13c6('0x60')]}});}return null;})[_0x13c6('0x1b')](handleEntityNotFound(_0x29cbfd,null))['then'](function(_0x4b804e){if(_0x4b804e){_0x418b16[_0x13c6('0x62')]=_0x4b804e[_0x13c6('0x5e')]({'plain':!![]});interaction_log[_0x13c6('0x22')](_0x13c6('0x77'),_0x4fabaf['user']['id'],_0x4fabaf[_0x13c6('0x5c')][_0x13c6('0x34')],_0x4fabaf[_0x13c6('0x5c')][_0x13c6('0x64')],_0x418b16[_0x13c6('0x62')]['id'],_0x4fabaf[_0x13c6('0x53')]?JSON[_0x13c6('0x65')](_0x4fabaf['body']):_0x13c6('0x78'));return respondWithRpcPromise(_0x13c6('0x79'),_0x13c6('0x7a'),_0x418b16);}return null;})['then'](function(_0x4d028f){var _0x32e5de=_0x13c6('0x68')+_0x4d028f[_0x13c6('0x21')]['ContactId'];return db[_0x13c6('0x6a')][_0x13c6('0x3e')](_0x32e5de,{'type':db[_0x13c6('0x6b')][_0x13c6('0x6c')][_0x13c6('0x6d')],'raw':!![]})['then'](function(_0x543d26){return _0x543d26;});})[_0x13c6('0x1b')](function(_0x15b225){if(_0x15b225){_0x418b16[_0x13c6('0x21')][_0x13c6('0x6e')]=_0x15b225[0x0];if(!_0x4fabaf[_0x13c6('0x53')][_0x13c6('0x5b')])return;return db[_0x13c6('0x7b')][_0x13c6('0x54')]({'where':{'id':_0x4fabaf[_0x13c6('0x53')][_0x13c6('0x5b')],'role':'agent'},'attributes':['id','name',_0x13c6('0x6f'),_0x13c6('0x7c'),_0x13c6('0x70')],'raw':!![]});}return null;})[_0x13c6('0x1b')](function(_0xdd1a2e){if(!_0xdd1a2e)return null;_0x418b16['message'][_0x13c6('0x5d')]=_0xdd1a2e;return _0x418b16;})[_0x13c6('0x1b')](function(_0x53be46){if(_0x53be46){_0x53be46['message'][_0x13c6('0x72')]=util['format']('SIP/%s',_0x4fabaf[_0x13c6('0x5c')][_0x13c6('0x34')]);_0x53be46[_0x13c6('0x21')][_0x13c6('0x73')]=_0x418b16[_0x13c6('0x73')];_0x53be46['message'][_0x13c6('0x74')]=_0x418b16['channel'];_0x53be46['message'][_0x13c6('0x7d')]=_0x13c6('0x2e');respondWithRpcPromise('EventManager',_0x13c6('0x75'),{'event':'rejectmessage','message':_0x53be46[_0x13c6('0x21')]},client9002);return _0x418b16;}return null;})['then'](respondWithResult(_0x29cbfd,null))[_0x13c6('0x4f')](handleError(_0x29cbfd,null));};exports[_0x13c6('0x24')]=function(_0x1f5f2d,_0x347ab9,_0x167879){if(_0x1f5f2d[_0x13c6('0x53')]['id']){delete _0x1f5f2d[_0x13c6('0x53')]['id'];}var _0x29cfe1;return db[_0x13c6('0x37')][_0x13c6('0x54')]({'where':{'id':_0x1f5f2d[_0x13c6('0x51')]['id']}})[_0x13c6('0x1b')](handleEntityNotFound(_0x347ab9,null))[_0x13c6('0x1b')](function(_0x40d5e1){if(_0x40d5e1){_0x29cfe1=_0x40d5e1;return db['WhatsappAccount'][_0x13c6('0x54')]({'where':{'id':_0x40d5e1['WhatsappAccountId']}});}})['then'](handleEntityNotFound(_0x347ab9,null))['then'](function(_0x37da58){if(_0x37da58){logger[_0x13c6('0x7e')](_0x13c6('0x7f'),_0x13c6('0x24'),_0x13c6('0x80'),_0x37da58[_0x13c6('0x3a')],util['inspect'](_0x1f5f2d[_0x13c6('0x53')],{'showHidden':![],'depth':null}));switch(_0x37da58[_0x13c6('0x3a')]){case _0x13c6('0x81'):if(_0x1f5f2d[_0x13c6('0x53')][_0x13c6('0x82')]&&_0x1f5f2d[_0x13c6('0x53')][_0x13c6('0x82')]===_0x29cfe1[_0x13c6('0x83')]&&_0x1f5f2d['body']['MessageStatus']&&_0x1f5f2d[_0x13c6('0x53')][_0x13c6('0x84')]==='read'){return _0x29cfe1[_0x13c6('0x30')]({'read':!![]});}else{logger[_0x13c6('0x1f')](_0x13c6('0x85'),_0x13c6('0x24'),'twilio',util[_0x13c6('0x86')](_0x1f5f2d[_0x13c6('0x53')],{'showHidden':![],'depth':null}));}break;}return _0x29cfe1;}})['then'](respondWithResult(_0x347ab9,null))['catch'](handleError(_0x347ab9,null));};
\ No newline at end of file
+var _0xa051=['findAll','show','params','rawAttributes','fields','includeAll','options','find','create','body','destroy','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','WhatsappInteractionId','isNil','read1stAt','interaction','user','role','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','reject','WhatsappInteraction','info','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','internal','event','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','inspect','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./whatsappMessage.socket','jayson/promise','client','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','save','update','stack','send','index','map','fieldName','model','name','query','keys','filters','intersection','attributes','hasOwnProperty','order','pick','filter','where','type','VIRTUAL','merge','include','WhatsappMessage'];(function(_0xc6ff3,_0x44f1dc){var _0x88cae4=function(_0x349652){while(--_0x349652){_0xc6ff3['push'](_0xc6ff3['shift']());}};_0x88cae4(++_0x44f1dc);}(_0xa051,0x156));var _0x1a05=function(_0x281a06,_0x47de05){_0x281a06=_0x281a06-0x0;var _0x223059=_0xa051[_0x281a06];return _0x223059;};'use strict';var emlformat=require(_0x1a05('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1a05('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a05('0x2'));var moment=require(_0x1a05('0x3'));var BPromise=require(_0x1a05('0x4'));var Mustache=require(_0x1a05('0x5'));var util=require(_0x1a05('0x6'));var path=require(_0x1a05('0x7'));var sox=require(_0x1a05('0x8'));var csv=require('to-csv');var ejs=require(_0x1a05('0x9'));var fs=require('fs');var fs_extra=require(_0x1a05('0xa'));var _=require('lodash');var squel=require(_0x1a05('0xb'));var crypto=require(_0x1a05('0xc'));var jsforce=require(_0x1a05('0xd'));var deskjs=require(_0x1a05('0xe'));var toCsv=require(_0x1a05('0xf'));var querystring=require(_0x1a05('0x10'));var Papa=require(_0x1a05('0x11'));var Redis=require(_0x1a05('0x12'));var authService=require(_0x1a05('0x13'));var qs=require(_0x1a05('0x14'));var as=require(_0x1a05('0x15'));var hardwareService=require(_0x1a05('0x16'));var logger=require(_0x1a05('0x17'))('api');var utils=require(_0x1a05('0x18'));var config=require(_0x1a05('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x1a05('0x1a'))['db'];config['redis']=_[_0x1a05('0x1b')](config[_0x1a05('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x1a05('0x1d'))(new Redis(config[_0x1a05('0x1c')]));require(_0x1a05('0x1e'))['register'](socket);var jayson=require(_0x1a05('0x1f'));var client=jayson[_0x1a05('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x1a05('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe9db9c,_0x7b8a78,_0x26104d,_0x38c00f){return new BPromise(function(_0x211d41,_0x5b1cbe){var _0x5843b0=_0x38c00f||client;return _0x5843b0['request'](_0xe9db9c,_0x26104d)[_0x1a05('0x21')](function(_0x46a22a){logger['info'](_0x1a05('0x22'),_0x7b8a78,_0x1a05('0x23'));logger[_0x1a05('0x24')](_0x1a05('0x25'),_0x7b8a78,'request\x20sent',JSON[_0x1a05('0x26')](_0x46a22a));if(_0x46a22a[_0x1a05('0x27')]){if(_0x46a22a[_0x1a05('0x27')][_0x1a05('0x28')]===0x1f4){logger[_0x1a05('0x27')](_0x1a05('0x22'),_0x7b8a78,_0x46a22a[_0x1a05('0x27')][_0x1a05('0x29')]);return _0x5b1cbe(_0x46a22a[_0x1a05('0x27')][_0x1a05('0x29')]);}logger[_0x1a05('0x27')](_0x1a05('0x22'),_0x7b8a78,_0x46a22a['error'][_0x1a05('0x29')]);return _0x211d41(_0x46a22a['error']['message']);}else{logger['info'](_0x1a05('0x22'),_0x7b8a78,'request\x20sent');_0x211d41(_0x46a22a[_0x1a05('0x2a')]['message']);}})[_0x1a05('0x2b')](function(_0x5066a9){logger[_0x1a05('0x27')]('WhatsappMessage,\x20%s,\x20%s',_0x7b8a78,_0x5066a9);_0x5b1cbe(_0x5066a9);});});}function respondWithStatusCode(_0x25891c,_0x59f4d7){_0x59f4d7=_0x59f4d7||0xcc;return function(_0x551417){if(_0x551417){return _0x25891c[_0x1a05('0x2c')](_0x59f4d7);}return _0x25891c['status'](_0x59f4d7)[_0x1a05('0x2d')]();};}function respondWithResult(_0x39b64c,_0x3e89ce){_0x3e89ce=_0x3e89ce||0xc8;return function(_0x4e4ab2){if(_0x4e4ab2){return _0x39b64c[_0x1a05('0x2e')](_0x3e89ce)[_0x1a05('0x2f')](_0x4e4ab2);}};}function respondWithFilteredResult(_0xabb6f6,_0x71e1bd){return function(_0x22d82d){if(_0x22d82d){var _0x3a812c=typeof _0x71e1bd['offset']===_0x1a05('0x30')&&typeof _0x71e1bd[_0x1a05('0x31')]===_0x1a05('0x30');var _0x49b5b4=_0x22d82d['count'];var _0x11a6dc=_0x3a812c?0x0:_0x71e1bd[_0x1a05('0x32')];var _0x1328be=_0x3a812c?_0x22d82d[_0x1a05('0x33')]:_0x71e1bd[_0x1a05('0x32')]+_0x71e1bd[_0x1a05('0x31')];var _0x16e73e;if(_0x1328be>=_0x49b5b4){_0x1328be=_0x49b5b4;_0x16e73e=0xc8;}else{_0x16e73e=0xce;}_0xabb6f6['status'](_0x16e73e);return _0xabb6f6[_0x1a05('0x34')](_0x1a05('0x35'),_0x11a6dc+'-'+_0x1328be+'/'+_0x49b5b4)[_0x1a05('0x2f')](_0x22d82d);}return null;};}function patchUpdates(_0x5d6653){return function(_0x2ef315){try{jsonpatch['apply'](_0x2ef315,_0x5d6653,!![]);}catch(_0x3efb98){return BPromise['reject'](_0x3efb98);}return _0x2ef315[_0x1a05('0x36')]();};}function saveUpdates(_0x5f4796,_0x59b256){return function(_0x4151ce){if(_0x4151ce){return _0x4151ce[_0x1a05('0x37')](_0x5f4796)[_0x1a05('0x21')](function(_0x4e0a45){return _0x4e0a45;});}return null;};}function removeEntity(_0xaefdf4,_0x5ad7b9){return function(_0x33cd80){if(_0x33cd80){return _0x33cd80['destroy']()[_0x1a05('0x21')](function(){_0xaefdf4[_0x1a05('0x2e')](0xcc)[_0x1a05('0x2d')]();});}};}function handleEntityNotFound(_0x3319bf,_0x4c764c){return function(_0x2c8a92){if(!_0x2c8a92){_0x3319bf[_0x1a05('0x2c')](0x194);}return _0x2c8a92;};}function handleError(_0x389ccc,_0x339ba1){_0x339ba1=_0x339ba1||0x1f4;return function(_0x2d4eb5){logger['error'](_0x2d4eb5[_0x1a05('0x38')]);if(_0x2d4eb5['name']){delete _0x2d4eb5['name'];}_0x389ccc[_0x1a05('0x2e')](_0x339ba1)[_0x1a05('0x39')](_0x2d4eb5);};}exports[_0x1a05('0x3a')]=function(_0x2f01db,_0x34ff4d){var _0x4a1b39={},_0x4e1d0f={},_0xca4a2f={'count':0x0,'rows':[]};var _0x520df4=_[_0x1a05('0x3b')](db['WhatsappMessage']['rawAttributes'],function(_0x5dcf3a){return{'name':_0x5dcf3a[_0x1a05('0x3c')],'type':_0x5dcf3a['type']['key']};});_0x4e1d0f[_0x1a05('0x3d')]=_['map'](_0x520df4,_0x1a05('0x3e'));_0x4e1d0f[_0x1a05('0x3f')]=_[_0x1a05('0x40')](_0x2f01db[_0x1a05('0x3f')]);_0x4e1d0f[_0x1a05('0x41')]=_[_0x1a05('0x42')](_0x4e1d0f[_0x1a05('0x3d')],_0x4e1d0f[_0x1a05('0x3f')]);_0x4a1b39[_0x1a05('0x43')]=_[_0x1a05('0x42')](_0x4e1d0f[_0x1a05('0x3d')],qs['fields'](_0x2f01db['query']['fields']));_0x4a1b39['attributes']=_0x4a1b39[_0x1a05('0x43')]['length']?_0x4a1b39[_0x1a05('0x43')]:_0x4e1d0f[_0x1a05('0x3d')];if(!_0x2f01db[_0x1a05('0x3f')][_0x1a05('0x44')]('nolimit')){_0x4a1b39[_0x1a05('0x31')]=qs['limit'](_0x2f01db[_0x1a05('0x3f')]['limit']);_0x4a1b39[_0x1a05('0x32')]=qs['offset'](_0x2f01db[_0x1a05('0x3f')][_0x1a05('0x32')]);}_0x4a1b39[_0x1a05('0x45')]=qs['sort'](_0x2f01db[_0x1a05('0x3f')]['sort']);_0x4a1b39['where']=qs['filters'](_[_0x1a05('0x46')](_0x2f01db[_0x1a05('0x3f')],_0x4e1d0f['filters']),_0x520df4);if(_0x2f01db[_0x1a05('0x3f')][_0x1a05('0x47')]){_0x4a1b39[_0x1a05('0x48')]=_['merge'](_0x4a1b39['where'],{'$or':_[_0x1a05('0x3b')](_0x520df4,function(_0x456dcf){if(_0x456dcf[_0x1a05('0x49')]!==_0x1a05('0x4a')){var _0x57dd34={};_0x57dd34[_0x456dcf[_0x1a05('0x3e')]]={'$like':'%'+_0x2f01db[_0x1a05('0x3f')][_0x1a05('0x47')]+'%'};return _0x57dd34;}})});}_0x4a1b39=_[_0x1a05('0x4b')]({},_0x4a1b39,_0x2f01db['options']);var _0x1486ae={'where':_0x4a1b39[_0x1a05('0x48')]};return db['WhatsappMessage']['count'](_0x1486ae)[_0x1a05('0x21')](function(_0x3f0492){_0xca4a2f[_0x1a05('0x33')]=_0x3f0492;if(_0x2f01db['query']['includeAll']){_0x4a1b39[_0x1a05('0x4c')]=[{'all':!![]}];}return db[_0x1a05('0x4d')][_0x1a05('0x4e')](_0x4a1b39);})['then'](function(_0x9bb801){_0xca4a2f['rows']=_0x9bb801;return _0xca4a2f;})[_0x1a05('0x21')](respondWithFilteredResult(_0x34ff4d,_0x4a1b39))[_0x1a05('0x2b')](handleError(_0x34ff4d,null));};exports[_0x1a05('0x4f')]=function(_0x5140f6,_0xa4f8c8){var _0x3dc95b={'raw':!![],'where':{'id':_0x5140f6[_0x1a05('0x50')]['id']}},_0x9959b6={};_0x9959b6[_0x1a05('0x3d')]=_[_0x1a05('0x40')](db[_0x1a05('0x4d')][_0x1a05('0x51')]);_0x9959b6['query']=_[_0x1a05('0x40')](_0x5140f6[_0x1a05('0x3f')]);_0x9959b6[_0x1a05('0x41')]=_['intersection'](_0x9959b6[_0x1a05('0x3d')],_0x9959b6[_0x1a05('0x3f')]);_0x3dc95b[_0x1a05('0x43')]=_[_0x1a05('0x42')](_0x9959b6[_0x1a05('0x3d')],qs['fields'](_0x5140f6[_0x1a05('0x3f')][_0x1a05('0x52')]));_0x3dc95b['attributes']=_0x3dc95b[_0x1a05('0x43')]['length']?_0x3dc95b['attributes']:_0x9959b6['model'];if(_0x5140f6[_0x1a05('0x3f')][_0x1a05('0x53')]){_0x3dc95b[_0x1a05('0x4c')]=[{'all':!![]}];}_0x3dc95b=_[_0x1a05('0x4b')]({},_0x3dc95b,_0x5140f6[_0x1a05('0x54')]);return db[_0x1a05('0x4d')][_0x1a05('0x55')](_0x3dc95b)[_0x1a05('0x21')](handleEntityNotFound(_0xa4f8c8,null))[_0x1a05('0x21')](respondWithResult(_0xa4f8c8,null))[_0x1a05('0x2b')](handleError(_0xa4f8c8,null));};exports['create']=function(_0xa10bfa,_0x15e9c0){return db[_0x1a05('0x4d')][_0x1a05('0x56')](_0xa10bfa[_0x1a05('0x57')],{})['then'](respondWithResult(_0x15e9c0,0xc9))[_0x1a05('0x2b')](handleError(_0x15e9c0,null));};exports[_0x1a05('0x37')]=function(_0x11c4b0,_0xd6291){if(_0x11c4b0['body']['id']){delete _0x11c4b0[_0x1a05('0x57')]['id'];}return db[_0x1a05('0x4d')][_0x1a05('0x55')]({'where':{'id':_0x11c4b0[_0x1a05('0x50')]['id']}})['then'](handleEntityNotFound(_0xd6291,null))[_0x1a05('0x21')](saveUpdates(_0x11c4b0['body'],null))[_0x1a05('0x21')](respondWithResult(_0xd6291,null))[_0x1a05('0x2b')](handleError(_0xd6291,null));};exports[_0x1a05('0x58')]=function(_0x370e31,_0x3d7c8c){return db[_0x1a05('0x4d')][_0x1a05('0x55')]({'where':{'id':_0x370e31[_0x1a05('0x50')]['id']}})[_0x1a05('0x21')](handleEntityNotFound(_0x3d7c8c,null))[_0x1a05('0x21')](removeEntity(_0x3d7c8c,null))[_0x1a05('0x2b')](handleError(_0x3d7c8c,null));};exports['describe']=function(_0x339dc4,_0x3201b1){return db[_0x1a05('0x4d')][_0x1a05('0x59')]()[_0x1a05('0x21')](respondWithResult(_0x3201b1,null))[_0x1a05('0x2b')](handleError(_0x3201b1,null));};var interaction_log=require(_0x1a05('0x17'))(_0x1a05('0x5a'));exports[_0x1a05('0x5b')]=function(_0x2dfbf2,_0xf01bb4,_0x5b7909){var _0x350fac={'agent':{},'channel':_0x1a05('0x5c')};if(_0x2dfbf2[_0x1a05('0x57')]['id']){delete _0x2dfbf2[_0x1a05('0x57')]['id'];}_0x2dfbf2[_0x1a05('0x57')][_0x1a05('0x5d')]=!![];_0x2dfbf2[_0x1a05('0x57')][_0x1a05('0x5e')]=moment()[_0x1a05('0x5f')](_0x1a05('0x60'));_0x2dfbf2[_0x1a05('0x57')][_0x1a05('0x61')]=_0x2dfbf2['body'][_0x1a05('0x61')]||_0x2dfbf2['user']['id'];_0x350fac[_0x1a05('0x62')]['id']=_0x2dfbf2[_0x1a05('0x57')]['UserId'];return db[_0x1a05('0x4d')][_0x1a05('0x55')]({'where':{'id':_0x2dfbf2[_0x1a05('0x50')]['id'],'UserId':null}})[_0x1a05('0x21')](handleEntityNotFound(_0xf01bb4,null))[_0x1a05('0x21')](saveUpdates(_0x2dfbf2[_0x1a05('0x57')],null))[_0x1a05('0x21')](function(_0x4e7ca9){if(_0x4e7ca9){_0x350fac[_0x1a05('0x29')]=_0x4e7ca9[_0x1a05('0x63')]({'plain':!![]});return db['WhatsappInteraction'][_0x1a05('0x55')]({'where':{'id':_0x4e7ca9[_0x1a05('0x64')]}});}return null;})[_0x1a05('0x21')](handleEntityNotFound(_0xf01bb4,null))['then'](function(_0x52e273){if(_0x52e273){return _0x52e273[_0x1a05('0x37')]({'UserId':_0x2dfbf2[_0x1a05('0x57')][_0x1a05('0x61')],'read1stAt':_[_0x1a05('0x65')](_0x52e273[_0x1a05('0x66')])?moment()[_0x1a05('0x5f')](_0x1a05('0x60')):undefined});}return null;})[_0x1a05('0x21')](function(_0x15fedf){if(_0x15fedf){_0x350fac[_0x1a05('0x67')]=_0x15fedf[_0x1a05('0x63')]({'plain':!![]});interaction_log['info']('[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2dfbf2['user']['id'],_0x2dfbf2[_0x1a05('0x68')]['name'],_0x2dfbf2['user'][_0x1a05('0x69')],_0x350fac['interaction']['id'],_0x2dfbf2[_0x1a05('0x57')]?JSON['stringify'](_0x2dfbf2['body']):'null');return respondWithRpcPromise('AcceptMessage','acceptMessage',_0x350fac);}return null;})['then'](function(_0x3be82c){var _0xbdbf4d=_0x1a05('0x6a')+_0x3be82c[_0x1a05('0x29')][_0x1a05('0x6b')];return db[_0x1a05('0x6c')][_0x1a05('0x3f')](_0xbdbf4d,{'type':db[_0x1a05('0x6d')][_0x1a05('0x6e')][_0x1a05('0x6f')],'raw':!![]})[_0x1a05('0x21')](function(_0x1192ab){return _0x1192ab;});})[_0x1a05('0x21')](function(_0x14acc4){if(_0x14acc4){_0x350fac['message'][_0x1a05('0x70')]=_0x14acc4[0x0];if(!_0x2dfbf2[_0x1a05('0x57')][_0x1a05('0x61')])return;return db[_0x1a05('0x71')][_0x1a05('0x55')]({'where':{'id':_0x2dfbf2['body'][_0x1a05('0x61')],'role':'agent'},'attributes':['id',_0x1a05('0x3e'),_0x1a05('0x72'),_0x1a05('0x73'),'internal'],'raw':!![]});}return null;})[_0x1a05('0x21')](function(_0x20b570){if(!_0x20b570)return null;_0x350fac[_0x1a05('0x29')][_0x1a05('0x62')]=_0x20b570;return _0x350fac;})[_0x1a05('0x21')](function(_0x3ee548){if(_0x3ee548){if(_0x2dfbf2[_0x1a05('0x57')]['manual']){_0x350fac[_0x1a05('0x29')][_0x1a05('0x74')]=util['format'](_0x1a05('0x75'),_0x2dfbf2[_0x1a05('0x68')]['name']);_0x350fac[_0x1a05('0x29')][_0x1a05('0x76')]=_0x350fac['channel'];_0x350fac[_0x1a05('0x29')][_0x1a05('0x77')]=_0x350fac[_0x1a05('0x76')];_0x350fac[_0x1a05('0x29')]['event']=_0x1a05('0x5b');return respondWithRpcPromise(_0x1a05('0x78'),_0x1a05('0x78'),{'event':_0x1a05('0x79'),'message':_0x350fac[_0x1a05('0x29')]},client9002)[_0x1a05('0x21')](function(){return _0x350fac;});}return _0x350fac;}return null;})[_0x1a05('0x21')](respondWithResult(_0xf01bb4,null))[_0x1a05('0x2b')](handleError(_0xf01bb4,null));};var interaction_log=require(_0x1a05('0x17'))(_0x1a05('0x5a'));exports[_0x1a05('0x7a')]=function(_0x2adb5b,_0x4a3b7a,_0x270d32){var _0x459999={'agent':{},'channel':_0x1a05('0x5c')};if(_0x2adb5b[_0x1a05('0x57')]['id']){delete _0x2adb5b[_0x1a05('0x57')]['id'];}_0x2adb5b[_0x1a05('0x57')][_0x1a05('0x61')]=_0x2adb5b[_0x1a05('0x57')]['UserId']||_0x2adb5b['user']['id'];_0x459999[_0x1a05('0x62')]['id']=_0x2adb5b[_0x1a05('0x57')][_0x1a05('0x61')];return db[_0x1a05('0x4d')]['find']({'where':{'id':_0x2adb5b[_0x1a05('0x50')]['id'],'UserId':null}})[_0x1a05('0x21')](handleEntityNotFound(_0x4a3b7a,null))['then'](function(_0x2982f3){if(_0x2982f3){_0x459999[_0x1a05('0x29')]=_0x2982f3[_0x1a05('0x63')]({'plain':!![]});return db[_0x1a05('0x7b')][_0x1a05('0x55')]({'where':{'id':_0x2982f3[_0x1a05('0x64')]}});}return null;})[_0x1a05('0x21')](handleEntityNotFound(_0x4a3b7a,null))[_0x1a05('0x21')](function(_0x919e13){if(_0x919e13){_0x459999[_0x1a05('0x67')]=_0x919e13[_0x1a05('0x63')]({'plain':!![]});interaction_log[_0x1a05('0x7c')](_0x1a05('0x7d'),_0x2adb5b[_0x1a05('0x68')]['id'],_0x2adb5b[_0x1a05('0x68')]['name'],_0x2adb5b[_0x1a05('0x68')][_0x1a05('0x69')],_0x459999[_0x1a05('0x67')]['id'],_0x2adb5b[_0x1a05('0x57')]?JSON[_0x1a05('0x26')](_0x2adb5b[_0x1a05('0x57')]):'null');return respondWithRpcPromise(_0x1a05('0x7e'),'rejectMessage',_0x459999);}return null;})[_0x1a05('0x21')](function(_0xceaaad){var _0x595f85=_0x1a05('0x6a')+_0xceaaad['message'][_0x1a05('0x6b')];return db['sequelize'][_0x1a05('0x3f')](_0x595f85,{'type':db[_0x1a05('0x6d')]['QueryTypes'][_0x1a05('0x6f')],'raw':!![]})[_0x1a05('0x21')](function(_0x48e10a){return _0x48e10a;});})[_0x1a05('0x21')](function(_0x52691a){if(_0x52691a){_0x459999[_0x1a05('0x29')][_0x1a05('0x70')]=_0x52691a[0x0];if(!_0x2adb5b[_0x1a05('0x57')]['UserId'])return;return db[_0x1a05('0x71')][_0x1a05('0x55')]({'where':{'id':_0x2adb5b[_0x1a05('0x57')][_0x1a05('0x61')],'role':_0x1a05('0x62')},'attributes':['id','name',_0x1a05('0x72'),_0x1a05('0x73'),_0x1a05('0x7f')],'raw':!![]});}return null;})[_0x1a05('0x21')](function(_0x360242){if(!_0x360242)return null;_0x459999[_0x1a05('0x29')]['agent']=_0x360242;return _0x459999;})[_0x1a05('0x21')](function(_0x2892d8){if(_0x2892d8){_0x2892d8[_0x1a05('0x29')][_0x1a05('0x74')]=util[_0x1a05('0x5f')](_0x1a05('0x75'),_0x2adb5b[_0x1a05('0x68')][_0x1a05('0x3e')]);_0x2892d8['message'][_0x1a05('0x76')]=_0x459999[_0x1a05('0x76')];_0x2892d8[_0x1a05('0x29')][_0x1a05('0x77')]=_0x459999[_0x1a05('0x76')];_0x2892d8[_0x1a05('0x29')][_0x1a05('0x80')]=_0x1a05('0x7a');respondWithRpcPromise('EventManager',_0x1a05('0x78'),{'event':_0x1a05('0x81'),'message':_0x2892d8[_0x1a05('0x29')]},client9002);return _0x459999;}return null;})[_0x1a05('0x21')](respondWithResult(_0x4a3b7a,null))[_0x1a05('0x2b')](handleError(_0x4a3b7a,null));};exports['status']=function(_0x55ea48,_0x459bb7,_0x18b759){if(_0x55ea48[_0x1a05('0x57')]['id']){delete _0x55ea48[_0x1a05('0x57')]['id'];}var _0x140854;return db[_0x1a05('0x4d')]['find']({'where':{'id':_0x55ea48[_0x1a05('0x50')]['id']}})[_0x1a05('0x21')](handleEntityNotFound(_0x459bb7,null))['then'](function(_0x4d6c75){if(_0x4d6c75){_0x140854=_0x4d6c75;return db[_0x1a05('0x82')][_0x1a05('0x55')]({'where':{'id':_0x4d6c75[_0x1a05('0x83')]}});}})[_0x1a05('0x21')](handleEntityNotFound(_0x459bb7,null))[_0x1a05('0x21')](function(_0x37f98c){if(_0x37f98c){logger[_0x1a05('0x24')](_0x1a05('0x84'),'status',_0x1a05('0x85'),_0x37f98c[_0x1a05('0x49')],util['inspect'](_0x55ea48[_0x1a05('0x57')],{'showHidden':![],'depth':null}));switch(_0x37f98c['type']){case _0x1a05('0x86'):if(_0x55ea48[_0x1a05('0x57')][_0x1a05('0x87')]&&_0x55ea48[_0x1a05('0x57')][_0x1a05('0x87')]===_0x140854[_0x1a05('0x88')]&&_0x55ea48['body'][_0x1a05('0x89')]&&_0x55ea48[_0x1a05('0x57')][_0x1a05('0x89')]===_0x1a05('0x5d')){return _0x140854['update']({'read':!![]});}else{logger['error'](_0x1a05('0x8a'),_0x1a05('0x2e'),_0x1a05('0x86'),util[_0x1a05('0x8b')](_0x55ea48['body'],{'showHidden':![],'depth':null}));}break;}return _0x140854;}})[_0x1a05('0x21')](respondWithResult(_0x459bb7,null))[_0x1a05('0x2b')](handleError(_0x459bb7,null));};
\ No newline at end of file
index 495f9a4..9796121 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x422f=['../../mysqldb','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x422f,0x1c7));var _0xf422=function(_0x1f3d08,_0x446e66){_0x1f3d08=_0x1f3d08-0x0;var _0xa45dd7=_0x422f[_0x1f3d08];return _0xa45dd7;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0xf422('0x0'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xf422('0x1')](0x0);var events={'afterCreate':_0xf422('0x2'),'afterUpdate':'update','afterDestroy':_0xf422('0x3')};function emitEvent(_0x172a93){return function(_0x312bc8,_0x444ad5,_0x16047c){WhatsappMessageEvents[_0xf422('0x4')](_0x172a93+':'+_0x312bc8['id'],_0x312bc8);WhatsappMessageEvents[_0xf422('0x4')](_0x172a93,_0x312bc8);_0x16047c(null);};}for(var e in events){if(events[_0xf422('0x5')](e)){var event=events[e];WhatsappMessage[_0xf422('0x6')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents;
\ No newline at end of file
+var _0xbee3=['emit','hook','exports','../../mysqldb','save','update'];(function(_0x221460,_0x562b4e){var _0x337c1b=function(_0x5185be){while(--_0x5185be){_0x221460['push'](_0x221460['shift']());}};_0x337c1b(++_0x562b4e);}(_0xbee3,0xd5));var _0x3bee=function(_0x46635c,_0x2c2fb7){_0x46635c=_0x46635c-0x0;var _0x1d9656=_0xbee3[_0x46635c];return _0x1d9656;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require(_0x3bee('0x0'))['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x3bee('0x1'),'afterUpdate':_0x3bee('0x2'),'afterDestroy':'remove'};function emitEvent(_0x4b354b){return function(_0x1956c1,_0x1cf379,_0x507c6a){WhatsappMessageEvents[_0x3bee('0x3')](_0x4b354b+':'+_0x1956c1['id'],_0x1956c1);WhatsappMessageEvents[_0x3bee('0x3')](_0x4b354b,_0x1956c1);_0x507c6a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x3bee('0x4')](e,emitEvent(event));}}module[_0x3bee('0x5')]=WhatsappMessageEvents;
\ No newline at end of file
index 5f2e2c9..e94c187 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7382=['findOne','WhatsappInteractionId','then','createdAt','error','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','sid','update','WhatsappMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','utf8mb4_unicode_ci','util','moment','request-promise','rimraf','../../config/environment','exports','define','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','toLowerCase','direction','out','secret','isNil','UserId','WhatsappInteraction'];(function(_0x450478,_0x360b9b){var _0x30d405=function(_0x3545ca){while(--_0x3545ca){_0x450478['push'](_0x450478['shift']());}};_0x30d405(++_0x360b9b);}(_0x7382,0x1f2));var _0x2738=function(_0x485997,_0x50e4ac){_0x485997=_0x485997-0x0;var _0xf96bf5=_0x7382[_0x485997];return _0xf96bf5;};'use strict';var _=require('lodash');var util=require(_0x2738('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x2738('0x1'));var BPromise=require('bluebird');var rp=require(_0x2738('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2738('0x3'));var config=require(_0x2738('0x4'));var attributes=require('./whatsappMessage.attributes');module[_0x2738('0x5')]=function(_0x267a1a,_0x457c61){return _0x267a1a[_0x2738('0x6')]('WhatsappMessage',attributes,{'tableName':_0x2738('0x7'),'paranoid':![],'indexes':[{'name':_0x2738('0x8'),'fields':[_0x2738('0x8')]},{'name':_0x2738('0x9'),'fields':[_0x2738('0xa')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2eb46d,_0xcd5079,_0x2322cd){var _0x23db73=_0x267a1a[_0x2738('0xb')];var _0x58c181=_0x2eb46d['get']({'plain':!![]});if(_0x58c181['direction'][_0x2738('0xc')]()==='in'||_0x58c181[_0x2738('0xd')][_0x2738('0xc')]()===_0x2738('0xe')&&!_0x58c181[_0x2738('0xf')]&&!_[_0x2738('0x10')](_0x58c181[_0x2738('0x11')])){_0x23db73[_0x2738('0x12')][_0x2738('0x13')]({'where':{'id':_0x58c181[_0x2738('0x14')]}})[_0x2738('0x15')](function(_0x1d2de7){if(_0x1d2de7){_0x1d2de7['update']({'lastMsgAt':_0x58c181[_0x2738('0x16')],'lastMsgDirection':_0x58c181[_0x2738('0xd')]['toLowerCase']()});}})['catch'](function(_0x1542b6){console[_0x2738('0x17')](_0x1542b6);});}if(_0x58c181[_0x2738('0xd')]==='out'&&!_0x58c181[_0x2738('0xf')]){var _0x1f3962;_0x23db73[_0x2738('0x18')][_0x2738('0x19')]({'where':{'id':_0x58c181[_0x2738('0x1a')]},'raw':!![]})['then'](function(_0x43cab3){_0x1f3962=_0x43cab3;if(_0x1f3962&&_0x1f3962[_0x2738('0x1b')]){switch(_0x1f3962[_0x2738('0x1b')]){case _0x2738('0x1c'):var _0x36d4e8=require(_0x2738('0x1c'));if(_0x1f3962[_0x2738('0x1d')]&&_0x1f3962[_0x2738('0x1e')]&&_0x1f3962[_0x2738('0x1f')]){var _0x514e45=new _0x36d4e8(_0x1f3962[_0x2738('0x1d')],_0x1f3962['authToken']);_0x514e45[_0x2738('0x20')][_0x2738('0x21')]({'body':_0x58c181[_0x2738('0xa')],'to':_0x2738('0x22')+_0x58c181['phone'],'from':'whatsapp:'+_0x1f3962[_0x2738('0x1f')],'statusCallback':_0x1f3962[_0x2738('0x23')]+_0x2738('0x24')+_0x58c181['id']+_0x2738('0x25')+_0x1f3962['token']})[_0x2738('0x15')](function(_0x3d8274){if(_0x3d8274[_0x2738('0x26')]){return _0x2eb46d[_0x2738('0x27')]({'messageId':_0x3d8274['sid']});}})['catch'](function(_0x5b7fd0){logger[_0x2738('0x17')](_0x2738('0x28'),'afterCreate',_0x2738('0x1c'),util[_0x2738('0x29')](_0x5b7fd0,{'showHidden':![],'depth':null}));});}else{logger[_0x2738('0x17')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x2738('0x2a'),_0x2738('0x1c'),_0x2738('0x2b'));}break;}}})[_0x2738('0x2c')](function(){_0x2322cd();});}else{_0x2322cd();}}},'charset':_0x2738('0x2d'),'collate':_0x2738('0x2e')});};
\ No newline at end of file
+var _0x8829=['WhatsappMessage','whatsapp_messages','messageId','fti_whatsapp_messages','body','models','get','toLowerCase','direction','secret','isNil','UserId','WhatsappInteractionId','update','catch','out','WhatsappAccountId','then','type','twilio','accountSid','authToken','messages','create','phone','whatsapp:','/api/whatsapp/messages/','/status?token=','token','sid','error','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./whatsappMessage.attributes','define'];(function(_0x3190de,_0x1582cf){var _0x858c2=function(_0x13559d){while(--_0x13559d){_0x3190de['push'](_0x3190de['shift']());}};_0x858c2(++_0x1582cf);}(_0x8829,0x195));var _0x9882=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8829[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9882('0x0'));var util=require('util');var logger=require(_0x9882('0x1'))(_0x9882('0x2'));var moment=require('moment');var BPromise=require(_0x9882('0x3'));var rp=require(_0x9882('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9882('0x5'));var config=require(_0x9882('0x6'));var attributes=require(_0x9882('0x7'));module['exports']=function(_0x2fb7ba,_0x376266){return _0x2fb7ba[_0x9882('0x8')](_0x9882('0x9'),attributes,{'tableName':_0x9882('0xa'),'paranoid':![],'indexes':[{'name':_0x9882('0xb'),'fields':['messageId']},{'name':_0x9882('0xc'),'fields':[_0x9882('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3496e6,_0x1f9454,_0x4df5e5){var _0x325a6d=_0x2fb7ba[_0x9882('0xe')];var _0x5b32be=_0x3496e6[_0x9882('0xf')]({'plain':!![]});if(_0x5b32be['direction'][_0x9882('0x10')]()==='in'||_0x5b32be[_0x9882('0x11')][_0x9882('0x10')]()==='out'&&!_0x5b32be[_0x9882('0x12')]&&!_[_0x9882('0x13')](_0x5b32be[_0x9882('0x14')])){_0x325a6d['WhatsappInteraction']['findOne']({'where':{'id':_0x5b32be[_0x9882('0x15')]}})['then'](function(_0x447e50){if(_0x447e50){_0x447e50[_0x9882('0x16')]({'lastMsgAt':_0x5b32be['createdAt'],'lastMsgDirection':_0x5b32be[_0x9882('0x11')][_0x9882('0x10')]()});}})[_0x9882('0x17')](function(_0x3f8a7c){console['error'](_0x3f8a7c);});}if(_0x5b32be['direction']===_0x9882('0x18')&&!_0x5b32be[_0x9882('0x12')]){var _0x196e88;_0x325a6d['WhatsappAccount']['find']({'where':{'id':_0x5b32be[_0x9882('0x19')]},'raw':!![]})[_0x9882('0x1a')](function(_0x383623){_0x196e88=_0x383623;if(_0x196e88&&_0x196e88[_0x9882('0x1b')]){switch(_0x196e88[_0x9882('0x1b')]){case _0x9882('0x1c'):var _0x2e6a72=require(_0x9882('0x1c'));if(_0x196e88[_0x9882('0x1d')]&&_0x196e88[_0x9882('0x1e')]&&_0x196e88['phone']){var _0x507353=new _0x2e6a72(_0x196e88[_0x9882('0x1d')],_0x196e88[_0x9882('0x1e')]);_0x507353[_0x9882('0x1f')][_0x9882('0x20')]({'body':_0x5b32be[_0x9882('0xd')],'to':'whatsapp:'+_0x5b32be[_0x9882('0x21')],'from':_0x9882('0x22')+_0x196e88['phone'],'statusCallback':_0x196e88['remote']+_0x9882('0x23')+_0x5b32be['id']+_0x9882('0x24')+_0x196e88[_0x9882('0x25')]})[_0x9882('0x1a')](function(_0x5c2b5c){if(_0x5c2b5c[_0x9882('0x26')]){return _0x3496e6['update']({'messageId':_0x5c2b5c['sid']});}})[_0x9882('0x17')](function(_0x30d7a4){logger[_0x9882('0x27')](_0x9882('0x28'),_0x9882('0x29'),_0x9882('0x1c'),util[_0x9882('0x2a')](_0x30d7a4,{'showHidden':![],'depth':null}));});}else{logger[_0x9882('0x27')](_0x9882('0x28'),'afterCreate','twilio',_0x9882('0x2b'));}break;}}})[_0x9882('0x2c')](function(){_0x4df5e5();});}else{_0x4df5e5();}}},'charset':'utf8mb4','collate':_0x9882('0x2d')});};
\ No newline at end of file
index ed0cbe5..92f365a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa737=['CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','lodash','util','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0x2d4d6d,_0x440070){var _0xcc293a=function(_0x31edd9){while(--_0x31edd9){_0x2d4d6d['push'](_0x2d4d6d['shift']());}};_0xcc293a(++_0x440070);}(_0xa737,0x1a6));var _0x7a73=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xa737[_0x1d24eb];return _0x1dc576;};'use strict';var _=require(_0x7a73('0x0'));var util=require(_0x7a73('0x1'));var moment=require('moment');var BPromise=require(_0x7a73('0x2'));var rs=require(_0x7a73('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7a73('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7a73('0x5'));var config=require(_0x7a73('0x6'));var jayson=require(_0x7a73('0x7'));var client=jayson[_0x7a73('0x8')][_0x7a73('0x9')]({'port':0x232a});config[_0x7a73('0xa')]=_[_0x7a73('0xb')](config[_0x7a73('0xa')],{'host':_0x7a73('0xc'),'port':0x18eb});var socket=require(_0x7a73('0xd'))(new Redis(config[_0x7a73('0xa')]));require(_0x7a73('0xe'))['register'](socket);function respondWithRpcPromise(_0x306972,_0x8ec11a,_0x3b5804){return new BPromise(function(_0x3e86f5,_0x45f5ac){return client[_0x7a73('0xf')](_0x306972,_0x3b5804)[_0x7a73('0x10')](function(_0x8b40cc){logger[_0x7a73('0x11')](_0x7a73('0x12'),_0x8ec11a,_0x7a73('0x13'));logger[_0x7a73('0x14')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x8ec11a,_0x7a73('0x13'),JSON[_0x7a73('0x15')](_0x8b40cc));if(_0x8b40cc['error']){if(_0x8b40cc[_0x7a73('0x16')]['code']===0x1f4){logger['error'](_0x7a73('0x12'),_0x8ec11a,_0x8b40cc[_0x7a73('0x16')][_0x7a73('0x17')]);return _0x45f5ac(_0x8b40cc['error']['message']);}logger[_0x7a73('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x8ec11a,_0x8b40cc[_0x7a73('0x16')][_0x7a73('0x17')]);return _0x3e86f5(_0x8b40cc[_0x7a73('0x16')][_0x7a73('0x17')]);}else{logger[_0x7a73('0x11')](_0x7a73('0x12'),_0x8ec11a,_0x7a73('0x13'));_0x3e86f5(_0x8b40cc[_0x7a73('0x18')][_0x7a73('0x17')]);}})[_0x7a73('0x19')](function(_0x34871e){logger[_0x7a73('0x16')]('WhatsappMessage,\x20%s,\x20%s',_0x8ec11a,_0x34871e);_0x45f5ac(_0x34871e);});});}exports[_0x7a73('0x1a')]=function(_0x1e5c29){var _0x83e44d=this;return new Promise(function(_0x8b3b51,_0x3cdc95){return db[_0x7a73('0x1b')][_0x7a73('0x1c')](_0x1e5c29[_0x7a73('0x1d')],{'raw':_0x1e5c29[_0x7a73('0x1e')]?_0x1e5c29[_0x7a73('0x1e')][_0x7a73('0x1f')]===undefined?!![]:![]:!![]})[_0x7a73('0x10')](function(_0x19bc0a){logger[_0x7a73('0x11')]('CreateWhatsappMessage',_0x1e5c29);logger[_0x7a73('0x14')](_0x7a73('0x1a'),_0x1e5c29,JSON[_0x7a73('0x15')](_0x19bc0a));_0x8b3b51(_0x19bc0a);})['catch'](function(_0x207a40){logger[_0x7a73('0x16')](_0x7a73('0x1a'),_0x207a40[_0x7a73('0x17')],_0x1e5c29);_0x3cdc95(_0x83e44d['error'](0x1f4,_0x207a40[_0x7a73('0x17')]));});});};
\ No newline at end of file
+var _0x6391=['register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateWhatsappMessage','create','options','raw','debug','stringify','lodash','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./whatsappMessage.socket'];(function(_0x8e8ca7,_0x5a5e07){var _0x561381=function(_0x2f4bda){while(--_0x2f4bda){_0x8e8ca7['push'](_0x8e8ca7['shift']());}};_0x561381(++_0x5a5e07);}(_0x6391,0x1e1));var _0x1639=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x6391[_0x37bd26];return _0xe83dc4;};'use strict';var _=require(_0x1639('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1639('0x1'));var rs=require(_0x1639('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1639('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1639('0x4'))(_0x1639('0x5'));var config=require(_0x1639('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1639('0x7')][_0x1639('0x8')]({'port':0x232a});config[_0x1639('0x9')]=_['defaults'](config['redis'],{'host':_0x1639('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1639('0x9')]));require(_0x1639('0xb'))[_0x1639('0xc')](socket);function respondWithRpcPromise(_0x247e00,_0x4780ca,_0x3b44d1){return new BPromise(function(_0x450358,_0x24a693){return client[_0x1639('0xd')](_0x247e00,_0x3b44d1)[_0x1639('0xe')](function(_0x3a899c){logger[_0x1639('0xf')](_0x1639('0x10'),_0x4780ca,_0x1639('0x11'));logger['debug'](_0x1639('0x12'),_0x4780ca,_0x1639('0x11'),JSON['stringify'](_0x3a899c));if(_0x3a899c['error']){if(_0x3a899c[_0x1639('0x13')]['code']===0x1f4){logger[_0x1639('0x13')](_0x1639('0x10'),_0x4780ca,_0x3a899c[_0x1639('0x13')][_0x1639('0x14')]);return _0x24a693(_0x3a899c[_0x1639('0x13')]['message']);}logger[_0x1639('0x13')](_0x1639('0x10'),_0x4780ca,_0x3a899c['error'][_0x1639('0x14')]);return _0x450358(_0x3a899c[_0x1639('0x13')][_0x1639('0x14')]);}else{logger['info'](_0x1639('0x10'),_0x4780ca,'request\x20sent');_0x450358(_0x3a899c[_0x1639('0x15')][_0x1639('0x14')]);}})[_0x1639('0x16')](function(_0x1e6803){logger['error'](_0x1639('0x10'),_0x4780ca,_0x1e6803);_0x24a693(_0x1e6803);});});}exports[_0x1639('0x17')]=function(_0x190202){var _0x5053d5=this;return new Promise(function(_0x3e5195,_0x290f69){return db['WhatsappMessage'][_0x1639('0x18')](_0x190202['body'],{'raw':_0x190202[_0x1639('0x19')]?_0x190202[_0x1639('0x19')][_0x1639('0x1a')]===undefined?!![]:![]:!![]})[_0x1639('0xe')](function(_0x368142){logger[_0x1639('0xf')](_0x1639('0x17'),_0x190202);logger[_0x1639('0x1b')](_0x1639('0x17'),_0x190202,JSON[_0x1639('0x1c')](_0x368142));_0x3e5195(_0x368142);})['catch'](function(_0x2d6989){logger['error']('CreateWhatsappMessage',_0x2d6989[_0x1639('0x14')],_0x190202);_0x290f69(_0x5053d5['error'](0x1f4,_0x2d6989[_0x1639('0x14')]));});});};
\ No newline at end of file
index cd01cc0..0422e06 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x91f9=['update','emit','removeListener','register','length','whatsappMessage:','./whatsappMessage.events','save','remove'];(function(_0x44383f,_0x1a2522){var _0x4b9b48=function(_0x4e5f12){while(--_0x4e5f12){_0x44383f['push'](_0x44383f['shift']());}};_0x4b9b48(++_0x1a2522);}(_0x91f9,0x189));var _0x991f=function(_0x188832,_0x49101d){_0x188832=_0x188832-0x0;var _0x2b990f=_0x91f9[_0x188832];return _0x2b990f;};'use strict';var WhatsappMessageEvents=require(_0x991f('0x0'));var events=[_0x991f('0x1'),_0x991f('0x2'),_0x991f('0x3')];function createListener(_0x568459,_0x243b61){return function(_0x30654e){_0x243b61[_0x991f('0x4')](_0x568459,_0x30654e);};}function removeListener(_0x1bc98e,_0xc41866){return function(){WhatsappMessageEvents[_0x991f('0x5')](_0x1bc98e,_0xc41866);};}exports[_0x991f('0x6')]=function(_0x24a18a){for(var _0x1b1fe7=0x0,_0x4e7bf1=events[_0x991f('0x7')];_0x1b1fe7<_0x4e7bf1;_0x1b1fe7++){var _0x3ffb0a=events[_0x1b1fe7];var _0x5272f2=createListener(_0x991f('0x8')+_0x3ffb0a,_0x24a18a);WhatsappMessageEvents['on'](_0x3ffb0a,_0x5272f2);}};
\ No newline at end of file
+var _0xa2b9=['remove','update','emit','length','whatsappMessage:','save'];(function(_0x2ba39c,_0x3fb7be){var _0x13d6c4=function(_0x4709e8){while(--_0x4709e8){_0x2ba39c['push'](_0x2ba39c['shift']());}};_0x13d6c4(++_0x3fb7be);}(_0xa2b9,0x191));var _0x9a2b=function(_0x2913fd,_0x51ca8b){_0x2913fd=_0x2913fd-0x0;var _0x486cbf=_0xa2b9[_0x2913fd];return _0x486cbf;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0x9a2b('0x0'),_0x9a2b('0x1'),_0x9a2b('0x2')];function createListener(_0x3c19a8,_0x3002cb){return function(_0x1068dd){_0x3002cb[_0x9a2b('0x3')](_0x3c19a8,_0x1068dd);};}function removeListener(_0x3aacf6,_0x3eedc6){return function(){WhatsappMessageEvents['removeListener'](_0x3aacf6,_0x3eedc6);};}exports['register']=function(_0x5d57ff){for(var _0x268634=0x0,_0x3ee3e5=events[_0x9a2b('0x4')];_0x268634<_0x3ee3e5;_0x268634++){var _0x90f715=events[_0x268634];var _0x1130be=createListener(_0x9a2b('0x5')+_0x90f715,_0x5d57ff);WhatsappMessageEvents['on'](_0x90f715,_0x1130be);}};
\ No newline at end of file
index 41be668..63b8123 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe4bd=['/:id/users','addAgents','put','delete','destroy','removeAgents','multer','util','path','express','Router','fs-extra','../../config/environment','./whatsappQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','getMembers','getTeams','getAgents','post','create','/:id/teams','addTeams'];(function(_0x39bf8c,_0x123fe5){var _0x25de43=function(_0x1876cb){while(--_0x1876cb){_0x39bf8c['push'](_0x39bf8c['shift']());}};_0x25de43(++_0x123fe5);}(_0xe4bd,0x1b6));var _0xde4b=function(_0x2bcf73,_0x3ed471){_0x2bcf73=_0x2bcf73-0x0;var _0x55446e=_0xe4bd[_0x2bcf73];return _0x55446e;};'use strict';var multer=require(_0xde4b('0x0'));var util=require(_0xde4b('0x1'));var path=require(_0xde4b('0x2'));var timeout=require('connect-timeout');var express=require(_0xde4b('0x3'));var router=express[_0xde4b('0x4')]();var fs_extra=require(_0xde4b('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xde4b('0x6'));var controller=require(_0xde4b('0x7'));router['get']('/',auth[_0xde4b('0x8')](),controller[_0xde4b('0x9')]);router[_0xde4b('0xa')](_0xde4b('0xb'),auth['isAuthenticated'](),controller[_0xde4b('0xc')]);router['get'](_0xde4b('0xd'),auth[_0xde4b('0x8')](),controller['show']);router[_0xde4b('0xa')]('/:id/members',auth['isAuthenticated'](),controller[_0xde4b('0xe')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0xde4b('0xf')]);router[_0xde4b('0xa')]('/:id/users',auth[_0xde4b('0x8')](),controller[_0xde4b('0x10')]);router[_0xde4b('0x11')]('/',auth[_0xde4b('0x8')](),controller[_0xde4b('0x12')]);router['post'](_0xde4b('0x13'),auth[_0xde4b('0x8')](),controller[_0xde4b('0x14')]);router[_0xde4b('0x11')](_0xde4b('0x15'),auth['isAuthenticated'](),controller[_0xde4b('0x16')]);router[_0xde4b('0x17')]('/:id',auth[_0xde4b('0x8')](),controller['update']);router[_0xde4b('0x18')](_0xde4b('0xd'),auth['isAuthenticated'](),controller[_0xde4b('0x19')]);router[_0xde4b('0x18')]('/:id/teams',auth[_0xde4b('0x8')](),controller['removeTeams']);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xde4b('0x1a')]);module['exports']=router;
\ No newline at end of file
+var _0x4235=['getAgents','post','create','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./whatsappQueue.controller','get','index','isAuthenticated','describe','/:id/members','/:id/teams','getTeams','/:id/users'];(function(_0x3a5648,_0x58054e){var _0x34126d=function(_0x3a6476){while(--_0x3a6476){_0x3a5648['push'](_0x3a5648['shift']());}};_0x34126d(++_0x58054e);}(_0x4235,0x1cb));var _0x5423=function(_0x2f2dd0,_0x242127){_0x2f2dd0=_0x2f2dd0-0x0;var _0x3c48d1=_0x4235[_0x2f2dd0];return _0x3c48d1;};'use strict';var multer=require(_0x5423('0x0'));var util=require(_0x5423('0x1'));var path=require(_0x5423('0x2'));var timeout=require(_0x5423('0x3'));var express=require(_0x5423('0x4'));var router=express[_0x5423('0x5')]();var fs_extra=require(_0x5423('0x6'));var auth=require(_0x5423('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5423('0x8'));router[_0x5423('0x9')]('/',auth['isAuthenticated'](),controller[_0x5423('0xa')]);router[_0x5423('0x9')]('/describe',auth[_0x5423('0xb')](),controller[_0x5423('0xc')]);router[_0x5423('0x9')]('/:id',auth[_0x5423('0xb')](),controller['show']);router[_0x5423('0x9')](_0x5423('0xd'),auth[_0x5423('0xb')](),controller['getMembers']);router[_0x5423('0x9')](_0x5423('0xe'),auth[_0x5423('0xb')](),controller[_0x5423('0xf')]);router[_0x5423('0x9')](_0x5423('0x10'),auth[_0x5423('0xb')](),controller[_0x5423('0x11')]);router[_0x5423('0x12')]('/',auth[_0x5423('0xb')](),controller[_0x5423('0x13')]);router['post'](_0x5423('0xe'),auth[_0x5423('0xb')](),controller[_0x5423('0x14')]);router[_0x5423('0x12')](_0x5423('0x10'),auth['isAuthenticated'](),controller[_0x5423('0x15')]);router[_0x5423('0x16')](_0x5423('0x17'),auth[_0x5423('0xb')](),controller[_0x5423('0x18')]);router[_0x5423('0x19')]('/:id',auth[_0x5423('0xb')](),controller[_0x5423('0x1a')]);router[_0x5423('0x19')](_0x5423('0xe'),auth[_0x5423('0xb')](),controller[_0x5423('0x1b')]);router[_0x5423('0x19')](_0x5423('0x10'),auth[_0x5423('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
index 87058d8..9f11c0c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc68d=['exports','STRING','ENUM','rrmemory','beepall','roundrobin'];(function(_0x4b6951,_0x30f254){var _0x5a3d64=function(_0x451fb2){while(--_0x451fb2){_0x4b6951['push'](_0x4b6951['shift']());}};_0x5a3d64(++_0x30f254);}(_0xc68d,0x17a));var _0xdc68=function(_0x10c245,_0x154c85){_0x10c245=_0x10c245-0x0;var _0x762f42=_0xc68d[_0x10c245];return _0x762f42;};'use strict';var Sequelize=require('sequelize');module[_0xdc68('0x0')]={'name':{'type':Sequelize[_0xdc68('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdc68('0x2')](_0xdc68('0x3'),_0xdc68('0x4'),_0xdc68('0x5'))},'description':{'type':Sequelize[_0xdc68('0x1')]}};
\ No newline at end of file
+var _0xb910=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x57b5a1,_0x236a67){var _0x4758e2=function(_0xd5899e){while(--_0xd5899e){_0x57b5a1['push'](_0x57b5a1['shift']());}};_0x4758e2(++_0x236a67);}(_0xb910,0x12b));var _0x0b91=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xb910[_0x45f951];return _0x24756c;};'use strict';var Sequelize=require(_0x0b91('0x0'));module[_0x0b91('0x1')]={'name':{'type':Sequelize[_0x0b91('0x2')],'unique':_0x0b91('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x0b91('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0b91('0x5')](_0x0b91('0x6'),_0x0b91('0x7'),_0x0b91('0x8'))},'description':{'type':Sequelize[_0x0b91('0x2')]}};
\ No newline at end of file
index d1a4527..c16f45e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0ea8=['socket.io-emitter','./whatsappQueue.socket','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','sendStatus','error','stack','name','send','index','map','WhatsappQueue','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','rawAttributes','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','UserWhatsappQueue','order','WhatsappQueueId','findAndCountAll','UserId','agent','whatsappPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','findOne','addTeams','User','Agents','online','voicePause','transaction','each','findOrCreate','forEach','emit','removeTeams','Team','ids','select','tq.TeamId','user_has_teams','clone','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','every','TeamId','union','compact','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','userWhatsappQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x0ea8,0x18c));var _0x80ea=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x0ea8[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x80ea('0x0'));var rimraf=require(_0x80ea('0x1'));var zipdir=require(_0x80ea('0x2'));var jsonpatch=require(_0x80ea('0x3'));var rp=require('request-promise');var moment=require(_0x80ea('0x4'));var BPromise=require(_0x80ea('0x5'));var Mustache=require(_0x80ea('0x6'));var util=require(_0x80ea('0x7'));var path=require(_0x80ea('0x8'));var sox=require('sox');var csv=require(_0x80ea('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x80ea('0xa'));var _=require('lodash');var squel=require(_0x80ea('0xb'));var crypto=require(_0x80ea('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x80ea('0xd'));var toCsv=require(_0x80ea('0x9'));var querystring=require(_0x80ea('0xe'));var Papa=require(_0x80ea('0xf'));var Redis=require(_0x80ea('0x10'));var authService=require(_0x80ea('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x80ea('0x12'));var hardwareService=require(_0x80ea('0x13'));var logger=require(_0x80ea('0x14'))('api');var utils=require(_0x80ea('0x15'));var config=require(_0x80ea('0x16'));var licenseUtil=require(_0x80ea('0x17'));var db=require('../../mysqldb')['db'];config[_0x80ea('0x18')]=_[_0x80ea('0x19')](config[_0x80ea('0x18')],{'host':_0x80ea('0x1a'),'port':0x18eb});var socket=require(_0x80ea('0x1b'))(new Redis(config[_0x80ea('0x18')]));require(_0x80ea('0x1c'))['register'](socket);function respondWithStatusCode(_0x5eefcc,_0x5add48){_0x5add48=_0x5add48||0xcc;return function(_0x17f3aa){if(_0x17f3aa){return _0x5eefcc['sendStatus'](_0x5add48);}return _0x5eefcc[_0x80ea('0x1d')](_0x5add48)[_0x80ea('0x1e')]();};}function respondWithResult(_0x3ca62c,_0x1b22fe){_0x1b22fe=_0x1b22fe||0xc8;return function(_0x27e4d3){if(_0x27e4d3){return _0x3ca62c[_0x80ea('0x1d')](_0x1b22fe)[_0x80ea('0x1f')](_0x27e4d3);}};}function respondWithFilteredResult(_0x5ed73c,_0x1d800a){return function(_0x1364e0){if(_0x1364e0){var _0x17d4b8=typeof _0x1d800a['offset']===_0x80ea('0x20')&&typeof _0x1d800a['limit']===_0x80ea('0x20');var _0xe1bb55=_0x1364e0[_0x80ea('0x21')];var _0x12b5e9=_0x17d4b8?0x0:_0x1d800a[_0x80ea('0x22')];var _0x1bff9f=_0x17d4b8?_0x1364e0[_0x80ea('0x21')]:_0x1d800a['offset']+_0x1d800a[_0x80ea('0x23')];var _0xbf0780;if(_0x1bff9f>=_0xe1bb55){_0x1bff9f=_0xe1bb55;_0xbf0780=0xc8;}else{_0xbf0780=0xce;}_0x5ed73c[_0x80ea('0x1d')](_0xbf0780);return _0x5ed73c[_0x80ea('0x24')](_0x80ea('0x25'),_0x12b5e9+'-'+_0x1bff9f+'/'+_0xe1bb55)[_0x80ea('0x1f')](_0x1364e0);}return null;};}function patchUpdates(_0x3a7d98){return function(_0x538805){try{jsonpatch[_0x80ea('0x26')](_0x538805,_0x3a7d98,!![]);}catch(_0x26a8cf){return BPromise['reject'](_0x26a8cf);}return _0x538805[_0x80ea('0x27')]();};}function saveUpdates(_0x402848,_0x3a2ccf){return function(_0xff98c0){if(_0xff98c0){return _0xff98c0[_0x80ea('0x28')](_0x402848)[_0x80ea('0x29')](function(_0x2d51f8){return _0x2d51f8;});}return null;};}function removeEntity(_0x44e507,_0x5702f4){return function(_0x2d3f61){if(_0x2d3f61){return _0x2d3f61[_0x80ea('0x2a')]()[_0x80ea('0x29')](function(){var _0x8a0502=_0x2d3f61[_0x80ea('0x2b')]({'plain':!![]});var _0x4de535=_0x80ea('0x2c');return db[_0x80ea('0x2d')][_0x80ea('0x2a')]({'where':{'type':_0x4de535,'resourceId':_0x8a0502['id']}})[_0x80ea('0x29')](function(){return _0x2d3f61;});})['then'](function(){_0x44e507[_0x80ea('0x1d')](0xcc)[_0x80ea('0x1e')]();});}};}function handleEntityNotFound(_0x5793ea,_0x43ef6d){return function(_0x1ed33d){if(!_0x1ed33d){_0x5793ea[_0x80ea('0x2e')](0x194);}return _0x1ed33d;};}function handleError(_0x554a5e,_0x41d397){_0x41d397=_0x41d397||0x1f4;return function(_0x1c07af){logger[_0x80ea('0x2f')](_0x1c07af[_0x80ea('0x30')]);if(_0x1c07af[_0x80ea('0x31')]){delete _0x1c07af[_0x80ea('0x31')];}_0x554a5e[_0x80ea('0x1d')](_0x41d397)[_0x80ea('0x32')](_0x1c07af);};}exports[_0x80ea('0x33')]=function(_0x86dff0,_0x53a28e){var _0x51eff1={},_0x2d0297={},_0x3e5ed2={'count':0x0,'rows':[]};var _0x3b1d2b=_[_0x80ea('0x34')](db[_0x80ea('0x35')]['rawAttributes'],function(_0x17c8b5){return{'name':_0x17c8b5[_0x80ea('0x36')],'type':_0x17c8b5[_0x80ea('0x37')][_0x80ea('0x38')]};});_0x2d0297[_0x80ea('0x39')]=_[_0x80ea('0x34')](_0x3b1d2b,_0x80ea('0x31'));_0x2d0297['query']=_['keys'](_0x86dff0[_0x80ea('0x3a')]);_0x2d0297[_0x80ea('0x3b')]=_[_0x80ea('0x3c')](_0x2d0297[_0x80ea('0x39')],_0x2d0297['query']);_0x51eff1[_0x80ea('0x3d')]=_['intersection'](_0x2d0297['model'],qs[_0x80ea('0x3e')](_0x86dff0['query']['fields']));_0x51eff1[_0x80ea('0x3d')]=_0x51eff1[_0x80ea('0x3d')][_0x80ea('0x3f')]?_0x51eff1['attributes']:_0x2d0297[_0x80ea('0x39')];if(!_0x86dff0['query'][_0x80ea('0x40')](_0x80ea('0x41'))){_0x51eff1[_0x80ea('0x23')]=qs[_0x80ea('0x23')](_0x86dff0[_0x80ea('0x3a')][_0x80ea('0x23')]);_0x51eff1['offset']=qs[_0x80ea('0x22')](_0x86dff0[_0x80ea('0x3a')]['offset']);}_0x51eff1['order']=qs[_0x80ea('0x42')](_0x86dff0[_0x80ea('0x3a')][_0x80ea('0x42')]);_0x51eff1[_0x80ea('0x43')]=qs['filters'](_[_0x80ea('0x44')](_0x86dff0[_0x80ea('0x3a')],_0x2d0297[_0x80ea('0x3b')]),_0x3b1d2b);if(_0x86dff0[_0x80ea('0x3a')]['filter']){_0x51eff1[_0x80ea('0x43')]=_[_0x80ea('0x45')](_0x51eff1[_0x80ea('0x43')],{'$or':_[_0x80ea('0x34')](_0x3b1d2b,function(_0x3dc69b){if(_0x3dc69b[_0x80ea('0x37')]!==_0x80ea('0x46')){var _0x5eabd6={};_0x5eabd6[_0x3dc69b['name']]={'$like':'%'+_0x86dff0[_0x80ea('0x3a')][_0x80ea('0x47')]+'%'};return _0x5eabd6;}})});}_0x51eff1=_[_0x80ea('0x45')]({},_0x51eff1,_0x86dff0[_0x80ea('0x48')]);var _0x40a953={'where':_0x51eff1[_0x80ea('0x43')]};return db[_0x80ea('0x35')][_0x80ea('0x21')](_0x40a953)[_0x80ea('0x29')](function(_0x568926){_0x3e5ed2['count']=_0x568926;if(_0x86dff0['query'][_0x80ea('0x49')]){_0x51eff1[_0x80ea('0x4a')]=[{'all':!![]}];}return db[_0x80ea('0x35')][_0x80ea('0x4b')](_0x51eff1);})[_0x80ea('0x29')](function(_0x6f0b54){_0x3e5ed2[_0x80ea('0x4c')]=_0x6f0b54;return _0x3e5ed2;})['then'](respondWithFilteredResult(_0x53a28e,_0x51eff1))[_0x80ea('0x4d')](handleError(_0x53a28e,null));};exports[_0x80ea('0x4e')]=function(_0x44bb2c,_0x35c340){var _0x2b909f={'raw':!![],'where':{'id':_0x44bb2c['params']['id']}},_0x2b81ad={};_0x2b81ad[_0x80ea('0x39')]=_['keys'](db[_0x80ea('0x35')][_0x80ea('0x4f')]);_0x2b81ad[_0x80ea('0x3a')]=_[_0x80ea('0x50')](_0x44bb2c['query']);_0x2b81ad['filters']=_[_0x80ea('0x3c')](_0x2b81ad[_0x80ea('0x39')],_0x2b81ad['query']);_0x2b909f[_0x80ea('0x3d')]=_['intersection'](_0x2b81ad[_0x80ea('0x39')],qs[_0x80ea('0x3e')](_0x44bb2c[_0x80ea('0x3a')][_0x80ea('0x3e')]));_0x2b909f['attributes']=_0x2b909f[_0x80ea('0x3d')][_0x80ea('0x3f')]?_0x2b909f[_0x80ea('0x3d')]:_0x2b81ad[_0x80ea('0x39')];if(_0x44bb2c['query'][_0x80ea('0x49')]){_0x2b909f[_0x80ea('0x4a')]=[{'all':!![]}];}_0x2b909f=_[_0x80ea('0x45')]({},_0x2b909f,_0x44bb2c[_0x80ea('0x48')]);return db[_0x80ea('0x35')][_0x80ea('0x51')](_0x2b909f)[_0x80ea('0x29')](handleEntityNotFound(_0x35c340,null))[_0x80ea('0x29')](respondWithResult(_0x35c340,null))['catch'](handleError(_0x35c340,null));};exports[_0x80ea('0x52')]=function(_0x1d5c88,_0x4ea69e){return db[_0x80ea('0x35')][_0x80ea('0x52')](_0x1d5c88[_0x80ea('0x53')],{})['then'](function(_0x2a2361){var _0x256c7e=_0x1d5c88[_0x80ea('0x54')][_0x80ea('0x2b')]({'plain':!![]});if(!_0x256c7e)throw new Error(_0x80ea('0x55'));if(_0x256c7e['role']===_0x80ea('0x54')){var _0x3ac5f0=_0x2a2361[_0x80ea('0x2b')]({'plain':!![]});var _0x28a9e7=_0x80ea('0x2c');return db[_0x80ea('0x56')]['find']({'where':{'name':_0x28a9e7,'userProfileId':_0x256c7e[_0x80ea('0x57')]},'raw':!![]})[_0x80ea('0x29')](function(_0x112ade){if(_0x112ade&&_0x112ade[_0x80ea('0x58')]===0x0){return db[_0x80ea('0x2d')][_0x80ea('0x52')]({'name':_0x3ac5f0[_0x80ea('0x31')],'resourceId':_0x3ac5f0['id'],'type':_0x112ade[_0x80ea('0x31')],'sectionId':_0x112ade['id']},{})[_0x80ea('0x29')](function(){return _0x2a2361;});}else{return _0x2a2361;}})['catch'](function(_0x3ba2e8){logger[_0x80ea('0x2f')](_0x80ea('0x59'),_0x3ba2e8);throw _0x3ba2e8;});}return _0x2a2361;})[_0x80ea('0x29')](respondWithResult(_0x4ea69e,0xc9))[_0x80ea('0x4d')](handleError(_0x4ea69e,null));};exports[_0x80ea('0x28')]=function(_0x1a179e,_0x317812){if(_0x1a179e['body']['id']){delete _0x1a179e[_0x80ea('0x53')]['id'];}return db[_0x80ea('0x35')]['find']({'where':{'id':_0x1a179e[_0x80ea('0x5a')]['id']}})[_0x80ea('0x29')](handleEntityNotFound(_0x317812,null))[_0x80ea('0x29')](saveUpdates(_0x1a179e[_0x80ea('0x53')],null))[_0x80ea('0x29')](respondWithResult(_0x317812,null))[_0x80ea('0x4d')](handleError(_0x317812,null));};exports[_0x80ea('0x2a')]=function(_0x4c7569,_0x5881f6){return db[_0x80ea('0x35')]['find']({'where':{'id':_0x4c7569[_0x80ea('0x5a')]['id']}})[_0x80ea('0x29')](handleEntityNotFound(_0x5881f6,null))['then'](removeEntity(_0x5881f6,null))[_0x80ea('0x4d')](handleError(_0x5881f6,null));};exports[_0x80ea('0x5b')]=function(_0x40ef3b,_0x1edab5){return db[_0x80ea('0x35')][_0x80ea('0x5b')]()[_0x80ea('0x29')](respondWithResult(_0x1edab5,null))['catch'](handleError(_0x1edab5,null));};exports['getMembers']=function(_0x3556e5,_0x25fd61,_0x2ced71){var _0x22b574={'raw':!![],'where':{}},_0x58c37e={},_0xa8022a;return db[_0x80ea('0x35')]['findOne']({'where':{'id':_0x3556e5['params']['id']}})[_0x80ea('0x29')](handleEntityNotFound(_0x25fd61,null))[_0x80ea('0x29')](function(_0x1c4833){if(_0x1c4833){_0xa8022a=_0x1c4833[_0x80ea('0x2b')]({'plain':!![]});_0x58c37e['model']=_[_0x80ea('0x50')](db[_0x80ea('0x5c')][_0x80ea('0x4f')]);_0x58c37e[_0x80ea('0x3a')]=_[_0x80ea('0x50')](_0x3556e5[_0x80ea('0x3a')]);_0x58c37e[_0x80ea('0x3b')]=_['intersection'](_0x58c37e[_0x80ea('0x39')],_0x58c37e[_0x80ea('0x3a')]);_0x22b574[_0x80ea('0x3d')]=_[_0x80ea('0x3c')](_0x58c37e[_0x80ea('0x39')],qs[_0x80ea('0x3e')](_0x3556e5[_0x80ea('0x3a')][_0x80ea('0x3e')]));_0x22b574[_0x80ea('0x3d')]=_0x22b574[_0x80ea('0x3d')][_0x80ea('0x3f')]?_0x22b574['attributes']:_0x58c37e[_0x80ea('0x39')];if(!_0x3556e5[_0x80ea('0x3a')]['hasOwnProperty'](_0x80ea('0x41'))){_0x22b574['limit']=qs[_0x80ea('0x23')](_0x3556e5[_0x80ea('0x3a')][_0x80ea('0x23')]);_0x22b574[_0x80ea('0x22')]=qs[_0x80ea('0x22')](_0x3556e5['query']['offset']);}_0x22b574[_0x80ea('0x5d')]=qs[_0x80ea('0x42')](_0x3556e5[_0x80ea('0x3a')]['sort']);_0x22b574[_0x80ea('0x43')]=qs[_0x80ea('0x3b')](_[_0x80ea('0x44')](_0x3556e5['query'],_0x58c37e[_0x80ea('0x3b')]));_0x22b574[_0x80ea('0x43')][_0x80ea('0x5e')]=_0x1c4833['id'];if(_0x3556e5[_0x80ea('0x3a')][_0x80ea('0x47')]){_0x22b574[_0x80ea('0x43')]=_[_0x80ea('0x45')](_0x22b574[_0x80ea('0x43')],{'$or':_['map'](_0x22b574[_0x80ea('0x3d')],function(_0x3fce43){var _0x14ca9b={};_0x14ca9b[_0x3fce43]={'$like':'%'+_0x3556e5[_0x80ea('0x3a')][_0x80ea('0x47')]+'%'};return _0x14ca9b;})});}_0x22b574=_[_0x80ea('0x45')]({},_0x22b574,_0x3556e5[_0x80ea('0x48')]);return db[_0x80ea('0x5c')]['findAll'](_0x22b574);}})['then'](function(_0x54e9ff){if(_0x54e9ff){return db['User'][_0x80ea('0x5f')]({'where':{'id':_['map'](_0x54e9ff,_0x80ea('0x60')),'role':_0x80ea('0x61')},'attributes':['id',_0x80ea('0x31'),_0x80ea('0x62'),_0x80ea('0x63'),_0x80ea('0x64')]});}})[_0x80ea('0x29')](function(_0x58ec0b){if(_0x58ec0b){return{'count':_0x58ec0b[_0x80ea('0x21')],'rows':_['map'](_0x58ec0b['rows'],function(_0x43ab1e){return{'membername':_0x43ab1e[_0x80ea('0x31')],'UserId':_0x43ab1e['id'],'queue_name':_0xa8022a['name'],'WhatsappQueueId':_0xa8022a['id'],'interface':util[_0x80ea('0x65')](_0x80ea('0x66'),_0x80ea('0x67'),_0x43ab1e[_0x80ea('0x31')]),'penalty':0x0,'paused':_0x43ab1e[_0x80ea('0x62')],'createdAt':_0x43ab1e['createdAt'],'updatedAt':_0x43ab1e[_0x80ea('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x25fd61,_0x22b574))[_0x80ea('0x4d')](handleError(_0x25fd61,null));};exports[_0x80ea('0x68')]=function(_0x4dac57,_0x11b9b4,_0x1fc39a){var _0x55c836={};var _0xaac2e9={};var _0x494ebe;var _0x123809;return db[_0x80ea('0x35')][_0x80ea('0x69')]({'where':{'id':_0x4dac57[_0x80ea('0x5a')]['id']}})[_0x80ea('0x29')](handleEntityNotFound(_0x11b9b4,null))[_0x80ea('0x29')](function(_0x30a71d){if(_0x30a71d){_0x494ebe=_0x30a71d;_0xaac2e9['model']=_[_0x80ea('0x50')](db['Team'][_0x80ea('0x4f')]);_0xaac2e9[_0x80ea('0x3a')]=_[_0x80ea('0x50')](_0x4dac57[_0x80ea('0x3a')]);_0xaac2e9[_0x80ea('0x3b')]=_[_0x80ea('0x3c')](_0xaac2e9[_0x80ea('0x39')],_0xaac2e9['query']);_0x55c836[_0x80ea('0x3d')]=_[_0x80ea('0x3c')](_0xaac2e9['model'],qs[_0x80ea('0x3e')](_0x4dac57[_0x80ea('0x3a')]['fields']));_0x55c836['attributes']=_0x55c836[_0x80ea('0x3d')][_0x80ea('0x3f')]?_0x55c836['attributes']:_0xaac2e9[_0x80ea('0x39')];_0x55c836['order']=qs['sort'](_0x4dac57[_0x80ea('0x3a')]['sort']);_0x55c836[_0x80ea('0x43')]=qs[_0x80ea('0x3b')](_['pick'](_0x4dac57['query'],_0xaac2e9[_0x80ea('0x3b')]));if(_0x4dac57[_0x80ea('0x3a')]['filter']){_0x55c836[_0x80ea('0x43')]=_[_0x80ea('0x45')](_0x55c836[_0x80ea('0x43')],{'$or':_[_0x80ea('0x34')](_0x55c836[_0x80ea('0x3d')],function(_0x4d15f3){var _0x13b870={};_0x13b870[_0x4d15f3]={'$like':'%'+_0x4dac57[_0x80ea('0x3a')][_0x80ea('0x47')]+'%'};return _0x13b870;})});}_0x55c836=_[_0x80ea('0x45')]({},_0x55c836,_0x4dac57[_0x80ea('0x48')]);return _0x494ebe[_0x80ea('0x68')](_0x55c836);}})['then'](function(_0x7d1599){if(_0x7d1599){_0x123809=_0x7d1599[_0x80ea('0x3f')];if(!_0x4dac57[_0x80ea('0x3a')][_0x80ea('0x40')](_0x80ea('0x41'))){_0x55c836[_0x80ea('0x23')]=qs['limit'](_0x4dac57[_0x80ea('0x3a')][_0x80ea('0x23')]);_0x55c836[_0x80ea('0x22')]=qs[_0x80ea('0x22')](_0x4dac57[_0x80ea('0x3a')][_0x80ea('0x22')]);}return _0x494ebe[_0x80ea('0x68')](_0x55c836);}})['then'](function(_0x21c958){if(_0x21c958){return _0x21c958?{'count':_0x123809,'rows':_0x21c958}:null;}})['then'](respondWithResult(_0x11b9b4,null))[_0x80ea('0x4d')](handleError(_0x11b9b4,null));};exports[_0x80ea('0x6a')]=function(_0x13edd1,_0x12e172,_0x44aa28){var _0x11cd5d=_0x13edd1[_0x80ea('0x53')]['ids'];return db['Team'][_0x80ea('0x4b')]({'where':{'id':_0x11cd5d},'attributes':['id'],'include':[{'model':db[_0x80ea('0x6b')],'as':_0x80ea('0x6c'),'attributes':['id',_0x80ea('0x31'),_0x80ea('0x6d'),_0x80ea('0x6e'),'interface'],'raw':!![]}]})['then'](function(_0x3ee13f){if(_0x3ee13f){var _0x3c5d80=_['flatMap'](_0x3ee13f,function(_0x561c3b){var _0x159053=_0x561c3b[_0x80ea('0x2b')]({'plain':!![]});return _0x159053[_0x80ea('0x6c')];});return db[_0x80ea('0x35')]['find']({'where':{'id':_0x13edd1['params']['id']}})[_0x80ea('0x29')](function(_0x474fea){return db['sequelize'][_0x80ea('0x6f')](function(_0x4ef250){return _0x474fea[_0x80ea('0x6a')](_0x11cd5d,{'transaction':_0x4ef250})['then'](function(){return BPromise[_0x80ea('0x70')](_0x3c5d80,function(_0xb0319b){return db['UserWhatsappQueue'][_0x80ea('0x71')]({'where':{'UserId':_0xb0319b['id'],'WhatsappQueueId':_0x13edd1['params']['id']},'transaction':_0x4ef250});});})['then'](function(){_0x3c5d80[_0x80ea('0x72')](function(_0x59be27){socket[_0x80ea('0x73')]('userWhatsappQueue:save',{'UserId':_0x59be27['id'],'WhatsappQueueId':_0x474fea['id']});});});});});}})[_0x80ea('0x29')](respondWithStatusCode(_0x12e172,null))[_0x80ea('0x4d')](handleError(_0x12e172,null));};exports[_0x80ea('0x74')]=function(_0x397ee2,_0x3c0bf5,_0x21c0da){return db[_0x80ea('0x75')]['findAll']({'where':{'id':_0x397ee2[_0x80ea('0x3a')][_0x80ea('0x76')]},'attributes':['id'],'include':[{'model':db[_0x80ea('0x6b')],'as':_0x80ea('0x6c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3c0bf5,null))[_0x80ea('0x29')](function(_0x5def3c){var _0x190721=_[_0x80ea('0x34')](_0x5def3c,'id');var _0x288f2f=[];var _0x581455=[];var _0x2f8d5f=squel[_0x80ea('0x77')]();_0x2f8d5f['field'](_0x80ea('0x78'))['from']('team_has_whatsapp_queues','tq')['join'](_0x80ea('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('WhatsappQueueId\x20=\x20?',_0x397ee2[_0x80ea('0x5a')]['id']);for(var _0x251038=0x0;_0x251038<_0x5def3c[_0x80ea('0x3f')];_0x251038+=0x1){let _0xdc3c7e=_0x5def3c[_0x251038];for(var _0x2ab5b5=0x0;_0x2ab5b5<_0xdc3c7e[_0x80ea('0x6c')][_0x80ea('0x3f')];_0x2ab5b5+=0x1){let _0x139e8d=_0xdc3c7e['Agents'][_0x2ab5b5];var _0x4abc74=_0x2f8d5f[_0x80ea('0x7a')]();_0x4abc74[_0x80ea('0x43')](_0x80ea('0x7b'),_0x139e8d['id']);_0x581455['push'](db[_0x80ea('0x7c')][_0x80ea('0x3a')](_0x4abc74[_0x80ea('0x7d')](),{'type':db['sequelize'][_0x80ea('0x7e')][_0x80ea('0x7f')]})[_0x80ea('0x29')](function(_0xad9500){if(_0xad9500[_0x80ea('0x3f')]===0x1){return _0x139e8d['id'];}else{var _0x513b22=_[_0x80ea('0x80')](_['map'](_0xad9500,_0x80ea('0x81')),function(_0x41f7ce){return _['includes'](_0x190721,_0x41f7ce);});if(_0x513b22){return _0x139e8d['id'];}}}));}}return BPromise['all'](_0x581455)[_0x80ea('0x29')](function(_0x3f9aec){_0x288f2f=_(_0x288f2f)[_0x80ea('0x82')](_0x3f9aec)[_0x80ea('0x83')]()['value']();return db[_0x80ea('0x35')][_0x80ea('0x51')]({'where':{'id':_0x397ee2['params']['id']}})['then'](function(_0x74bef0){return db[_0x80ea('0x7c')][_0x80ea('0x6f')](function(_0x204507){return _0x74bef0[_0x80ea('0x74')](_0x397ee2[_0x80ea('0x3a')][_0x80ea('0x76')],{'transaction':_0x204507})[_0x80ea('0x29')](function(){if(!_[_0x80ea('0x84')](_0x288f2f)){return _0x74bef0[_0x80ea('0x85')](_0x288f2f,{'transaction':_0x204507});}})[_0x80ea('0x29')](function(){_0x288f2f[_0x80ea('0x72')](function(_0xd33b2){socket[_0x80ea('0x73')](_0x80ea('0x86'),{'UserId':_0xd33b2,'WhatsappQueueId':_0x74bef0['id']});});});});});});})[_0x80ea('0x29')](respondWithStatusCode(_0x3c0bf5,null))[_0x80ea('0x4d')](handleError(_0x3c0bf5,null));};exports[_0x80ea('0x87')]=function(_0x1fa2b1,_0x487eac,_0x2daf95){return db[_0x80ea('0x35')][_0x80ea('0x51')]({'where':{'id':_0x1fa2b1[_0x80ea('0x5a')]['id']}})[_0x80ea('0x29')](handleEntityNotFound(_0x487eac,null))['then'](function(_0x196068){if(_0x196068){return _0x196068['addAgents'](_0x1fa2b1[_0x80ea('0x53')]['ids'],_[_0x80ea('0x88')](_0x1fa2b1[_0x80ea('0x53')],[_0x80ea('0x76'),'id'])||{})[_0x80ea('0x89')](function(_0x38d4a3){for(var _0x3d2a4b=0x0;_0x3d2a4b<_0x1fa2b1[_0x80ea('0x53')][_0x80ea('0x76')][_0x80ea('0x3f')];_0x3d2a4b+=0x1){socket['emit'](_0x80ea('0x8a'),{'UserId':Number(_0x1fa2b1[_0x80ea('0x53')][_0x80ea('0x76')][_0x3d2a4b]),'WhatsappQueueId':Number(_0x1fa2b1[_0x80ea('0x5a')]['id'])});}return _0x38d4a3;});}})['then'](respondWithResult(_0x487eac,null))[_0x80ea('0x4d')](handleError(_0x487eac,null));};exports[_0x80ea('0x85')]=function(_0x5b0c19,_0x22f9b6,_0x1e909c){return db['WhatsappQueue'][_0x80ea('0x51')]({'where':{'id':_0x5b0c19[_0x80ea('0x5a')]['id']}})['then'](handleEntityNotFound(_0x22f9b6,null))[_0x80ea('0x29')](function(_0x5a1a33){if(_0x5a1a33){return _0x5a1a33[_0x80ea('0x85')](_0x5b0c19['query'][_0x80ea('0x76')])['then'](function(){if(_[_0x80ea('0x8b')](_0x5b0c19['query'][_0x80ea('0x76')])){for(var _0x2b16f7=0x0;_0x2b16f7<_0x5b0c19['query'][_0x80ea('0x76')][_0x80ea('0x3f')];_0x2b16f7+=0x1){socket[_0x80ea('0x73')](_0x80ea('0x86'),{'UserId':Number(_0x5b0c19['query'][_0x80ea('0x76')][_0x2b16f7]),'WhatsappQueueId':Number(_0x5b0c19[_0x80ea('0x5a')]['id'])});}}else{socket[_0x80ea('0x73')]('userWhatsappQueue:remove',{'UserId':Number(_0x5b0c19[_0x80ea('0x3a')]['ids']),'WhatsappQueueId':Number(_0x5b0c19['params']['id'])});}});}})[_0x80ea('0x29')](respondWithStatusCode(_0x22f9b6,null))[_0x80ea('0x4d')](handleError(_0x22f9b6,null));};exports[_0x80ea('0x8c')]=function(_0x158ed6,_0x2a11d3,_0x4a758d){var _0x48b3ce={};var _0x13a303={};var _0x4b791f;var _0x44dc0f;return db[_0x80ea('0x35')]['findOne']({'where':{'id':_0x158ed6[_0x80ea('0x5a')]['id']}})[_0x80ea('0x29')](handleEntityNotFound(_0x2a11d3,null))[_0x80ea('0x29')](function(_0x38ec02){if(_0x38ec02){_0x4b791f=_0x38ec02;_0x13a303['model']=_[_0x80ea('0x50')](db[_0x80ea('0x6b')]['rawAttributes']);_0x13a303[_0x80ea('0x3a')]=_['keys'](_0x158ed6[_0x80ea('0x3a')]);_0x13a303[_0x80ea('0x3b')]=_[_0x80ea('0x3c')](_0x13a303[_0x80ea('0x39')],_0x13a303[_0x80ea('0x3a')]);_0x48b3ce[_0x80ea('0x3d')]=_[_0x80ea('0x3c')](_0x13a303['model'],qs[_0x80ea('0x3e')](_0x158ed6['query'][_0x80ea('0x3e')]));_0x48b3ce['attributes']=_0x48b3ce['attributes'][_0x80ea('0x3f')]?_0x48b3ce['attributes']:_0x13a303[_0x80ea('0x39')];_0x48b3ce[_0x80ea('0x5d')]=qs[_0x80ea('0x42')](_0x158ed6['query'][_0x80ea('0x42')]);_0x48b3ce[_0x80ea('0x43')]=qs['filters'](_[_0x80ea('0x44')](_0x158ed6[_0x80ea('0x3a')],_0x13a303[_0x80ea('0x3b')]));if(_0x158ed6['query'][_0x80ea('0x47')]){_0x48b3ce[_0x80ea('0x43')]=_['merge'](_0x48b3ce[_0x80ea('0x43')],{'$or':_[_0x80ea('0x34')](_0x48b3ce['attributes'],function(_0x223e0c){var _0x2b6980={};_0x2b6980[_0x223e0c]={'$like':'%'+_0x158ed6[_0x80ea('0x3a')]['filter']+'%'};return _0x2b6980;})});}_0x48b3ce=_[_0x80ea('0x45')]({},_0x48b3ce,_0x158ed6[_0x80ea('0x48')]);return _0x4b791f['getAgents'](_0x48b3ce);}})[_0x80ea('0x29')](function(_0x4f8a4c){if(_0x4f8a4c){_0x44dc0f=_0x4f8a4c[_0x80ea('0x3f')];if(!_0x158ed6[_0x80ea('0x3a')][_0x80ea('0x40')](_0x80ea('0x41'))){_0x48b3ce[_0x80ea('0x23')]=qs[_0x80ea('0x23')](_0x158ed6[_0x80ea('0x3a')][_0x80ea('0x23')]);_0x48b3ce[_0x80ea('0x22')]=qs[_0x80ea('0x22')](_0x158ed6[_0x80ea('0x3a')]['offset']);}return _0x4b791f['getAgents'](_0x48b3ce);}})['then'](function(_0x1ec235){if(_0x1ec235){return _0x1ec235?{'count':_0x44dc0f,'rows':_0x1ec235}:null;}})[_0x80ea('0x29')](respondWithResult(_0x2a11d3,null))[_0x80ea('0x4d')](handleError(_0x2a11d3,null));};
\ No newline at end of file
+var _0x7a73=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','WhatsappQueueId','User','findAndCountAll','UserId','agent','updatedAt','format','SIP','whatsappPause','createdAt','getTeams','Team','ids','Agents','voicePause','interface','flatMap','transaction','addTeams','findOrCreate','forEach','emit','userWhatsappQueue:save','select','field','tq.TeamId','from','team_has_whatsapp_queues','user_has_teams','WhatsappQueueId\x20=\x20?','push','sequelize','QueryTypes','SELECT','TeamId','includes','union','value','removeTeams','removeAgents','addAgents','omit','spread','isArray','userWhatsappQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','WhatsappQueue','findAll','rows','catch','show','params','find'];(function(_0x4ca762,_0x409bc0){var _0x354ca2=function(_0xdc2b6f){while(--_0xdc2b6f){_0x4ca762['push'](_0x4ca762['shift']());}};_0x354ca2(++_0x409bc0);}(_0x7a73,0xc6));var _0x37a7=function(_0x11bc7c,_0x208665){_0x11bc7c=_0x11bc7c-0x0;var _0x19d227=_0x7a73[_0x11bc7c];return _0x19d227;};'use strict';var emlformat=require(_0x37a7('0x0'));var rimraf=require(_0x37a7('0x1'));var zipdir=require(_0x37a7('0x2'));var jsonpatch=require(_0x37a7('0x3'));var rp=require(_0x37a7('0x4'));var moment=require('moment');var BPromise=require(_0x37a7('0x5'));var Mustache=require(_0x37a7('0x6'));var util=require(_0x37a7('0x7'));var path=require(_0x37a7('0x8'));var sox=require('sox');var csv=require(_0x37a7('0x9'));var ejs=require(_0x37a7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x37a7('0xb'));var squel=require('squel');var crypto=require(_0x37a7('0xc'));var jsforce=require(_0x37a7('0xd'));var deskjs=require(_0x37a7('0xe'));var toCsv=require('to-csv');var querystring=require(_0x37a7('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x37a7('0x10'));var as=require(_0x37a7('0x11'));var hardwareService=require(_0x37a7('0x12'));var logger=require(_0x37a7('0x13'))(_0x37a7('0x14'));var utils=require(_0x37a7('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x37a7('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x37a7('0x17')](config[_0x37a7('0x18')],{'host':_0x37a7('0x19'),'port':0x18eb});var socket=require(_0x37a7('0x1a'))(new Redis(config[_0x37a7('0x18')]));require(_0x37a7('0x1b'))[_0x37a7('0x1c')](socket);function respondWithStatusCode(_0x39dcbb,_0x400074){_0x400074=_0x400074||0xcc;return function(_0x1d61e1){if(_0x1d61e1){return _0x39dcbb[_0x37a7('0x1d')](_0x400074);}return _0x39dcbb[_0x37a7('0x1e')](_0x400074)[_0x37a7('0x1f')]();};}function respondWithResult(_0x31b042,_0x44bad3){_0x44bad3=_0x44bad3||0xc8;return function(_0x4d28c4){if(_0x4d28c4){return _0x31b042[_0x37a7('0x1e')](_0x44bad3)['json'](_0x4d28c4);}};}function respondWithFilteredResult(_0x65d49,_0x3cd6a0){return function(_0x1183a1){if(_0x1183a1){var _0xc6996b=typeof _0x3cd6a0[_0x37a7('0x20')]===_0x37a7('0x21')&&typeof _0x3cd6a0[_0x37a7('0x22')]==='undefined';var _0x4e96cd=_0x1183a1[_0x37a7('0x23')];var _0x2cb2f1=_0xc6996b?0x0:_0x3cd6a0['offset'];var _0x2aac20=_0xc6996b?_0x1183a1['count']:_0x3cd6a0[_0x37a7('0x20')]+_0x3cd6a0[_0x37a7('0x22')];var _0x16a34f;if(_0x2aac20>=_0x4e96cd){_0x2aac20=_0x4e96cd;_0x16a34f=0xc8;}else{_0x16a34f=0xce;}_0x65d49[_0x37a7('0x1e')](_0x16a34f);return _0x65d49[_0x37a7('0x24')]('Content-Range',_0x2cb2f1+'-'+_0x2aac20+'/'+_0x4e96cd)[_0x37a7('0x25')](_0x1183a1);}return null;};}function patchUpdates(_0x2b5067){return function(_0x3a6f3e){try{jsonpatch[_0x37a7('0x26')](_0x3a6f3e,_0x2b5067,!![]);}catch(_0x21939f){return BPromise[_0x37a7('0x27')](_0x21939f);}return _0x3a6f3e[_0x37a7('0x28')]();};}function saveUpdates(_0x51f503,_0x10172c){return function(_0x252019){if(_0x252019){return _0x252019[_0x37a7('0x29')](_0x51f503)[_0x37a7('0x2a')](function(_0x503e92){return _0x503e92;});}return null;};}function removeEntity(_0x49bb66,_0x897944){return function(_0xb6464a){if(_0xb6464a){return _0xb6464a[_0x37a7('0x2b')]()[_0x37a7('0x2a')](function(){var _0x28d7a3=_0xb6464a[_0x37a7('0x2c')]({'plain':!![]});var _0x584a0c=_0x37a7('0x2d');return db[_0x37a7('0x2e')]['destroy']({'where':{'type':_0x584a0c,'resourceId':_0x28d7a3['id']}})[_0x37a7('0x2a')](function(){return _0xb6464a;});})[_0x37a7('0x2a')](function(){_0x49bb66[_0x37a7('0x1e')](0xcc)[_0x37a7('0x1f')]();});}};}function handleEntityNotFound(_0xfe212a,_0x341b67){return function(_0x4a4d88){if(!_0x4a4d88){_0xfe212a[_0x37a7('0x1d')](0x194);}return _0x4a4d88;};}function handleError(_0x170941,_0x44697a){_0x44697a=_0x44697a||0x1f4;return function(_0x3751ca){logger[_0x37a7('0x2f')](_0x3751ca['stack']);if(_0x3751ca[_0x37a7('0x30')]){delete _0x3751ca[_0x37a7('0x30')];}_0x170941[_0x37a7('0x1e')](_0x44697a)[_0x37a7('0x31')](_0x3751ca);};}exports[_0x37a7('0x32')]=function(_0x57a1b3,_0xd4c557){var _0x23a1dd={},_0x353c7a={},_0x1d1bd7={'count':0x0,'rows':[]};var _0x1204cf=_[_0x37a7('0x33')](db['WhatsappQueue'][_0x37a7('0x34')],function(_0x39c417){return{'name':_0x39c417[_0x37a7('0x35')],'type':_0x39c417[_0x37a7('0x36')]['key']};});_0x353c7a[_0x37a7('0x37')]=_[_0x37a7('0x33')](_0x1204cf,_0x37a7('0x30'));_0x353c7a[_0x37a7('0x38')]=_[_0x37a7('0x39')](_0x57a1b3[_0x37a7('0x38')]);_0x353c7a[_0x37a7('0x3a')]=_[_0x37a7('0x3b')](_0x353c7a['model'],_0x353c7a[_0x37a7('0x38')]);_0x23a1dd['attributes']=_['intersection'](_0x353c7a[_0x37a7('0x37')],qs['fields'](_0x57a1b3[_0x37a7('0x38')][_0x37a7('0x3c')]));_0x23a1dd[_0x37a7('0x3d')]=_0x23a1dd[_0x37a7('0x3d')][_0x37a7('0x3e')]?_0x23a1dd[_0x37a7('0x3d')]:_0x353c7a['model'];if(!_0x57a1b3['query'][_0x37a7('0x3f')](_0x37a7('0x40'))){_0x23a1dd['limit']=qs[_0x37a7('0x22')](_0x57a1b3[_0x37a7('0x38')][_0x37a7('0x22')]);_0x23a1dd[_0x37a7('0x20')]=qs[_0x37a7('0x20')](_0x57a1b3[_0x37a7('0x38')][_0x37a7('0x20')]);}_0x23a1dd[_0x37a7('0x41')]=qs[_0x37a7('0x42')](_0x57a1b3['query'][_0x37a7('0x42')]);_0x23a1dd['where']=qs[_0x37a7('0x3a')](_[_0x37a7('0x43')](_0x57a1b3['query'],_0x353c7a['filters']),_0x1204cf);if(_0x57a1b3[_0x37a7('0x38')][_0x37a7('0x44')]){_0x23a1dd[_0x37a7('0x45')]=_[_0x37a7('0x46')](_0x23a1dd[_0x37a7('0x45')],{'$or':_['map'](_0x1204cf,function(_0x5cd245){if(_0x5cd245[_0x37a7('0x36')]!==_0x37a7('0x47')){var _0x121ae5={};_0x121ae5[_0x5cd245[_0x37a7('0x30')]]={'$like':'%'+_0x57a1b3[_0x37a7('0x38')][_0x37a7('0x44')]+'%'};return _0x121ae5;}})});}_0x23a1dd=_['merge']({},_0x23a1dd,_0x57a1b3[_0x37a7('0x48')]);var _0x5f248c={'where':_0x23a1dd['where']};return db['WhatsappQueue'][_0x37a7('0x23')](_0x5f248c)[_0x37a7('0x2a')](function(_0x15a886){_0x1d1bd7[_0x37a7('0x23')]=_0x15a886;if(_0x57a1b3[_0x37a7('0x38')][_0x37a7('0x49')]){_0x23a1dd[_0x37a7('0x4a')]=[{'all':!![]}];}return db[_0x37a7('0x4b')][_0x37a7('0x4c')](_0x23a1dd);})[_0x37a7('0x2a')](function(_0x1a01f9){_0x1d1bd7[_0x37a7('0x4d')]=_0x1a01f9;return _0x1d1bd7;})[_0x37a7('0x2a')](respondWithFilteredResult(_0xd4c557,_0x23a1dd))[_0x37a7('0x4e')](handleError(_0xd4c557,null));};exports[_0x37a7('0x4f')]=function(_0x508dfb,_0x401283){var _0x4ea346={'raw':!![],'where':{'id':_0x508dfb[_0x37a7('0x50')]['id']}},_0x240c4c={};_0x240c4c[_0x37a7('0x37')]=_['keys'](db[_0x37a7('0x4b')][_0x37a7('0x34')]);_0x240c4c[_0x37a7('0x38')]=_[_0x37a7('0x39')](_0x508dfb[_0x37a7('0x38')]);_0x240c4c[_0x37a7('0x3a')]=_['intersection'](_0x240c4c[_0x37a7('0x37')],_0x240c4c['query']);_0x4ea346['attributes']=_[_0x37a7('0x3b')](_0x240c4c['model'],qs['fields'](_0x508dfb[_0x37a7('0x38')][_0x37a7('0x3c')]));_0x4ea346['attributes']=_0x4ea346[_0x37a7('0x3d')]['length']?_0x4ea346['attributes']:_0x240c4c['model'];if(_0x508dfb[_0x37a7('0x38')][_0x37a7('0x49')]){_0x4ea346['include']=[{'all':!![]}];}_0x4ea346=_[_0x37a7('0x46')]({},_0x4ea346,_0x508dfb[_0x37a7('0x48')]);return db['WhatsappQueue'][_0x37a7('0x51')](_0x4ea346)[_0x37a7('0x2a')](handleEntityNotFound(_0x401283,null))[_0x37a7('0x2a')](respondWithResult(_0x401283,null))[_0x37a7('0x4e')](handleError(_0x401283,null));};exports['create']=function(_0x58db0e,_0x2f6e86){return db[_0x37a7('0x4b')][_0x37a7('0x52')](_0x58db0e[_0x37a7('0x53')],{})[_0x37a7('0x2a')](function(_0x5c1f5f){var _0x5590c7=_0x58db0e[_0x37a7('0x54')][_0x37a7('0x2c')]({'plain':!![]});if(!_0x5590c7)throw new Error(_0x37a7('0x55'));if(_0x5590c7['role']===_0x37a7('0x54')){var _0x59b8c2=_0x5c1f5f[_0x37a7('0x2c')]({'plain':!![]});var _0x271ce6=_0x37a7('0x2d');return db[_0x37a7('0x56')]['find']({'where':{'name':_0x271ce6,'userProfileId':_0x5590c7[_0x37a7('0x57')]},'raw':!![]})[_0x37a7('0x2a')](function(_0x1fb156){if(_0x1fb156&&_0x1fb156[_0x37a7('0x58')]===0x0){return db[_0x37a7('0x2e')][_0x37a7('0x52')]({'name':_0x59b8c2[_0x37a7('0x30')],'resourceId':_0x59b8c2['id'],'type':_0x1fb156['name'],'sectionId':_0x1fb156['id']},{})[_0x37a7('0x2a')](function(){return _0x5c1f5f;});}else{return _0x5c1f5f;}})['catch'](function(_0xa61db7){logger[_0x37a7('0x2f')](_0x37a7('0x59'),_0xa61db7);throw _0xa61db7;});}return _0x5c1f5f;})[_0x37a7('0x2a')](respondWithResult(_0x2f6e86,0xc9))[_0x37a7('0x4e')](handleError(_0x2f6e86,null));};exports[_0x37a7('0x29')]=function(_0x20f83d,_0x222e75){if(_0x20f83d[_0x37a7('0x53')]['id']){delete _0x20f83d[_0x37a7('0x53')]['id'];}return db[_0x37a7('0x4b')][_0x37a7('0x51')]({'where':{'id':_0x20f83d['params']['id']}})[_0x37a7('0x2a')](handleEntityNotFound(_0x222e75,null))[_0x37a7('0x2a')](saveUpdates(_0x20f83d[_0x37a7('0x53')],null))[_0x37a7('0x2a')](respondWithResult(_0x222e75,null))[_0x37a7('0x4e')](handleError(_0x222e75,null));};exports[_0x37a7('0x2b')]=function(_0x24de35,_0x222e5d){return db[_0x37a7('0x4b')][_0x37a7('0x51')]({'where':{'id':_0x24de35[_0x37a7('0x50')]['id']}})[_0x37a7('0x2a')](handleEntityNotFound(_0x222e5d,null))[_0x37a7('0x2a')](removeEntity(_0x222e5d,null))['catch'](handleError(_0x222e5d,null));};exports['describe']=function(_0x5984f0,_0x4da903){return db[_0x37a7('0x4b')][_0x37a7('0x5a')]()[_0x37a7('0x2a')](respondWithResult(_0x4da903,null))[_0x37a7('0x4e')](handleError(_0x4da903,null));};exports[_0x37a7('0x5b')]=function(_0x26d52a,_0x5d84bb,_0x3c8ee3){var _0x4b4eeb={'raw':!![],'where':{}},_0x7e3a35={},_0x335358;return db[_0x37a7('0x4b')][_0x37a7('0x5c')]({'where':{'id':_0x26d52a[_0x37a7('0x50')]['id']}})[_0x37a7('0x2a')](handleEntityNotFound(_0x5d84bb,null))[_0x37a7('0x2a')](function(_0xc4b8ff){if(_0xc4b8ff){_0x335358=_0xc4b8ff['get']({'plain':!![]});_0x7e3a35['model']=_['keys'](db[_0x37a7('0x5d')]['rawAttributes']);_0x7e3a35['query']=_[_0x37a7('0x39')](_0x26d52a[_0x37a7('0x38')]);_0x7e3a35[_0x37a7('0x3a')]=_[_0x37a7('0x3b')](_0x7e3a35[_0x37a7('0x37')],_0x7e3a35[_0x37a7('0x38')]);_0x4b4eeb[_0x37a7('0x3d')]=_[_0x37a7('0x3b')](_0x7e3a35[_0x37a7('0x37')],qs[_0x37a7('0x3c')](_0x26d52a['query'][_0x37a7('0x3c')]));_0x4b4eeb[_0x37a7('0x3d')]=_0x4b4eeb[_0x37a7('0x3d')][_0x37a7('0x3e')]?_0x4b4eeb['attributes']:_0x7e3a35['model'];if(!_0x26d52a[_0x37a7('0x38')][_0x37a7('0x3f')](_0x37a7('0x40'))){_0x4b4eeb[_0x37a7('0x22')]=qs[_0x37a7('0x22')](_0x26d52a[_0x37a7('0x38')]['limit']);_0x4b4eeb[_0x37a7('0x20')]=qs[_0x37a7('0x20')](_0x26d52a['query'][_0x37a7('0x20')]);}_0x4b4eeb[_0x37a7('0x41')]=qs[_0x37a7('0x42')](_0x26d52a[_0x37a7('0x38')][_0x37a7('0x42')]);_0x4b4eeb[_0x37a7('0x45')]=qs[_0x37a7('0x3a')](_[_0x37a7('0x43')](_0x26d52a[_0x37a7('0x38')],_0x7e3a35[_0x37a7('0x3a')]));_0x4b4eeb[_0x37a7('0x45')][_0x37a7('0x5e')]=_0xc4b8ff['id'];if(_0x26d52a['query']['filter']){_0x4b4eeb[_0x37a7('0x45')]=_[_0x37a7('0x46')](_0x4b4eeb[_0x37a7('0x45')],{'$or':_[_0x37a7('0x33')](_0x4b4eeb['attributes'],function(_0x4382f6){var _0x497327={};_0x497327[_0x4382f6]={'$like':'%'+_0x26d52a[_0x37a7('0x38')][_0x37a7('0x44')]+'%'};return _0x497327;})});}_0x4b4eeb=_['merge']({},_0x4b4eeb,_0x26d52a[_0x37a7('0x48')]);return db[_0x37a7('0x5d')][_0x37a7('0x4c')](_0x4b4eeb);}})['then'](function(_0x42232c){if(_0x42232c){return db[_0x37a7('0x5f')][_0x37a7('0x60')]({'where':{'id':_[_0x37a7('0x33')](_0x42232c,_0x37a7('0x61')),'role':_0x37a7('0x62')},'attributes':['id',_0x37a7('0x30'),'whatsappPause',_0x37a7('0x63'),'createdAt']});}})[_0x37a7('0x2a')](function(_0x546570){if(_0x546570){return{'count':_0x546570[_0x37a7('0x23')],'rows':_[_0x37a7('0x33')](_0x546570[_0x37a7('0x4d')],function(_0x44f9ac){return{'membername':_0x44f9ac[_0x37a7('0x30')],'UserId':_0x44f9ac['id'],'queue_name':_0x335358[_0x37a7('0x30')],'WhatsappQueueId':_0x335358['id'],'interface':util[_0x37a7('0x64')]('%s/%s',_0x37a7('0x65'),_0x44f9ac[_0x37a7('0x30')]),'penalty':0x0,'paused':_0x44f9ac[_0x37a7('0x66')],'createdAt':_0x44f9ac[_0x37a7('0x67')],'updatedAt':_0x44f9ac['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x37a7('0x2a')](respondWithFilteredResult(_0x5d84bb,_0x4b4eeb))[_0x37a7('0x4e')](handleError(_0x5d84bb,null));};exports[_0x37a7('0x68')]=function(_0xfa14ce,_0x2c17c2,_0x21676d){var _0xe0d21b={};var _0x3572ad={};var _0x466852;var _0x562801;return db[_0x37a7('0x4b')][_0x37a7('0x5c')]({'where':{'id':_0xfa14ce['params']['id']}})[_0x37a7('0x2a')](handleEntityNotFound(_0x2c17c2,null))['then'](function(_0x883266){if(_0x883266){_0x466852=_0x883266;_0x3572ad['model']=_[_0x37a7('0x39')](db[_0x37a7('0x69')]['rawAttributes']);_0x3572ad['query']=_[_0x37a7('0x39')](_0xfa14ce[_0x37a7('0x38')]);_0x3572ad['filters']=_[_0x37a7('0x3b')](_0x3572ad[_0x37a7('0x37')],_0x3572ad[_0x37a7('0x38')]);_0xe0d21b[_0x37a7('0x3d')]=_[_0x37a7('0x3b')](_0x3572ad[_0x37a7('0x37')],qs[_0x37a7('0x3c')](_0xfa14ce['query'][_0x37a7('0x3c')]));_0xe0d21b[_0x37a7('0x3d')]=_0xe0d21b[_0x37a7('0x3d')][_0x37a7('0x3e')]?_0xe0d21b['attributes']:_0x3572ad[_0x37a7('0x37')];_0xe0d21b[_0x37a7('0x41')]=qs['sort'](_0xfa14ce[_0x37a7('0x38')][_0x37a7('0x42')]);_0xe0d21b[_0x37a7('0x45')]=qs['filters'](_[_0x37a7('0x43')](_0xfa14ce[_0x37a7('0x38')],_0x3572ad['filters']));if(_0xfa14ce[_0x37a7('0x38')][_0x37a7('0x44')]){_0xe0d21b[_0x37a7('0x45')]=_[_0x37a7('0x46')](_0xe0d21b['where'],{'$or':_[_0x37a7('0x33')](_0xe0d21b[_0x37a7('0x3d')],function(_0x279f5b){var _0x2ca9b5={};_0x2ca9b5[_0x279f5b]={'$like':'%'+_0xfa14ce[_0x37a7('0x38')][_0x37a7('0x44')]+'%'};return _0x2ca9b5;})});}_0xe0d21b=_['merge']({},_0xe0d21b,_0xfa14ce['options']);return _0x466852[_0x37a7('0x68')](_0xe0d21b);}})['then'](function(_0x3a0262){if(_0x3a0262){_0x562801=_0x3a0262[_0x37a7('0x3e')];if(!_0xfa14ce[_0x37a7('0x38')]['hasOwnProperty'](_0x37a7('0x40'))){_0xe0d21b[_0x37a7('0x22')]=qs[_0x37a7('0x22')](_0xfa14ce[_0x37a7('0x38')][_0x37a7('0x22')]);_0xe0d21b[_0x37a7('0x20')]=qs[_0x37a7('0x20')](_0xfa14ce[_0x37a7('0x38')][_0x37a7('0x20')]);}return _0x466852[_0x37a7('0x68')](_0xe0d21b);}})[_0x37a7('0x2a')](function(_0xe66ac3){if(_0xe66ac3){return _0xe66ac3?{'count':_0x562801,'rows':_0xe66ac3}:null;}})[_0x37a7('0x2a')](respondWithResult(_0x2c17c2,null))[_0x37a7('0x4e')](handleError(_0x2c17c2,null));};exports['addTeams']=function(_0x542796,_0x4bb741,_0x37ea1b){var _0x13172c=_0x542796[_0x37a7('0x53')][_0x37a7('0x6a')];return db[_0x37a7('0x69')][_0x37a7('0x4c')]({'where':{'id':_0x13172c},'attributes':['id'],'include':[{'model':db[_0x37a7('0x5f')],'as':_0x37a7('0x6b'),'attributes':['id','name','online',_0x37a7('0x6c'),_0x37a7('0x6d')],'raw':!![]}]})[_0x37a7('0x2a')](function(_0x2a131b){if(_0x2a131b){var _0x3a7019=_[_0x37a7('0x6e')](_0x2a131b,function(_0x21efa7){var _0x14d918=_0x21efa7[_0x37a7('0x2c')]({'plain':!![]});return _0x14d918[_0x37a7('0x6b')];});return db[_0x37a7('0x4b')][_0x37a7('0x51')]({'where':{'id':_0x542796[_0x37a7('0x50')]['id']}})['then'](function(_0x1fa846){return db['sequelize'][_0x37a7('0x6f')](function(_0x277505){return _0x1fa846[_0x37a7('0x70')](_0x13172c,{'transaction':_0x277505})[_0x37a7('0x2a')](function(){return BPromise['each'](_0x3a7019,function(_0x624a9e){return db[_0x37a7('0x5d')][_0x37a7('0x71')]({'where':{'UserId':_0x624a9e['id'],'WhatsappQueueId':_0x542796[_0x37a7('0x50')]['id']},'transaction':_0x277505});});})[_0x37a7('0x2a')](function(){_0x3a7019[_0x37a7('0x72')](function(_0x11e0d2){socket[_0x37a7('0x73')](_0x37a7('0x74'),{'UserId':_0x11e0d2['id'],'WhatsappQueueId':_0x1fa846['id']});});});});});}})[_0x37a7('0x2a')](respondWithStatusCode(_0x4bb741,null))[_0x37a7('0x4e')](handleError(_0x4bb741,null));};exports['removeTeams']=function(_0x823fce,_0x1b901d,_0x1d6952){return db[_0x37a7('0x69')]['findAll']({'where':{'id':_0x823fce['query'][_0x37a7('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x37a7('0x5f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x37a7('0x2a')](handleEntityNotFound(_0x1b901d,null))[_0x37a7('0x2a')](function(_0xfed80a){var _0x12807b=_[_0x37a7('0x33')](_0xfed80a,'id');var _0x15ddf7=[];var _0x3abdab=[];var _0x11f3cb=squel[_0x37a7('0x75')]();_0x11f3cb[_0x37a7('0x76')](_0x37a7('0x77'))[_0x37a7('0x78')](_0x37a7('0x79'),'tq')['join'](_0x37a7('0x7a'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x37a7('0x45')](_0x37a7('0x7b'),_0x823fce['params']['id']);for(var _0x78cbc1=0x0;_0x78cbc1<_0xfed80a[_0x37a7('0x3e')];_0x78cbc1+=0x1){let _0x205bf5=_0xfed80a[_0x78cbc1];for(var _0xf66a59=0x0;_0xf66a59<_0x205bf5[_0x37a7('0x6b')][_0x37a7('0x3e')];_0xf66a59+=0x1){let _0x420cb2=_0x205bf5[_0x37a7('0x6b')][_0xf66a59];var _0x52f8ea=_0x11f3cb['clone']();_0x52f8ea['where']('ut.UserId\x20=\x20?',_0x420cb2['id']);_0x3abdab[_0x37a7('0x7c')](db[_0x37a7('0x7d')]['query'](_0x52f8ea['toString'](),{'type':db[_0x37a7('0x7d')][_0x37a7('0x7e')][_0x37a7('0x7f')]})[_0x37a7('0x2a')](function(_0x5d416e){if(_0x5d416e[_0x37a7('0x3e')]===0x1){return _0x420cb2['id'];}else{var _0x544aeb=_['every'](_['map'](_0x5d416e,_0x37a7('0x80')),function(_0x1e7bbf){return _[_0x37a7('0x81')](_0x12807b,_0x1e7bbf);});if(_0x544aeb){return _0x420cb2['id'];}}}));}}return BPromise['all'](_0x3abdab)[_0x37a7('0x2a')](function(_0x459f54){_0x15ddf7=_(_0x15ddf7)[_0x37a7('0x82')](_0x459f54)['compact']()[_0x37a7('0x83')]();return db[_0x37a7('0x4b')]['find']({'where':{'id':_0x823fce['params']['id']}})['then'](function(_0x31728d){return db[_0x37a7('0x7d')][_0x37a7('0x6f')](function(_0x591d1e){return _0x31728d[_0x37a7('0x84')](_0x823fce[_0x37a7('0x38')][_0x37a7('0x6a')],{'transaction':_0x591d1e})['then'](function(){if(!_['isEmpty'](_0x15ddf7)){return _0x31728d[_0x37a7('0x85')](_0x15ddf7,{'transaction':_0x591d1e});}})[_0x37a7('0x2a')](function(){_0x15ddf7[_0x37a7('0x72')](function(_0x531b64){socket[_0x37a7('0x73')]('userWhatsappQueue:remove',{'UserId':_0x531b64,'WhatsappQueueId':_0x31728d['id']});});});});});});})[_0x37a7('0x2a')](respondWithStatusCode(_0x1b901d,null))[_0x37a7('0x4e')](handleError(_0x1b901d,null));};exports[_0x37a7('0x86')]=function(_0x27f89c,_0x1f4f95,_0x4fd9b0){return db['WhatsappQueue'][_0x37a7('0x51')]({'where':{'id':_0x27f89c[_0x37a7('0x50')]['id']}})[_0x37a7('0x2a')](handleEntityNotFound(_0x1f4f95,null))['then'](function(_0x2e4117){if(_0x2e4117){return _0x2e4117['addAgents'](_0x27f89c['body'][_0x37a7('0x6a')],_[_0x37a7('0x87')](_0x27f89c['body'],['ids','id'])||{})[_0x37a7('0x88')](function(_0x5e537c){for(var _0x9416fc=0x0;_0x9416fc<_0x27f89c[_0x37a7('0x53')]['ids'][_0x37a7('0x3e')];_0x9416fc+=0x1){socket[_0x37a7('0x73')](_0x37a7('0x74'),{'UserId':Number(_0x27f89c[_0x37a7('0x53')][_0x37a7('0x6a')][_0x9416fc]),'WhatsappQueueId':Number(_0x27f89c[_0x37a7('0x50')]['id'])});}return _0x5e537c;});}})['then'](respondWithResult(_0x1f4f95,null))[_0x37a7('0x4e')](handleError(_0x1f4f95,null));};exports['removeAgents']=function(_0x954436,_0x3e83ea,_0x5d7e47){return db[_0x37a7('0x4b')][_0x37a7('0x51')]({'where':{'id':_0x954436[_0x37a7('0x50')]['id']}})['then'](handleEntityNotFound(_0x3e83ea,null))['then'](function(_0x523aaf){if(_0x523aaf){return _0x523aaf[_0x37a7('0x85')](_0x954436[_0x37a7('0x38')][_0x37a7('0x6a')])[_0x37a7('0x2a')](function(){if(_[_0x37a7('0x89')](_0x954436[_0x37a7('0x38')][_0x37a7('0x6a')])){for(var _0x14d814=0x0;_0x14d814<_0x954436[_0x37a7('0x38')]['ids'][_0x37a7('0x3e')];_0x14d814+=0x1){socket[_0x37a7('0x73')](_0x37a7('0x8a'),{'UserId':Number(_0x954436[_0x37a7('0x38')][_0x37a7('0x6a')][_0x14d814]),'WhatsappQueueId':Number(_0x954436[_0x37a7('0x50')]['id'])});}}else{socket[_0x37a7('0x73')]('userWhatsappQueue:remove',{'UserId':Number(_0x954436[_0x37a7('0x38')][_0x37a7('0x6a')]),'WhatsappQueueId':Number(_0x954436[_0x37a7('0x50')]['id'])});}});}})[_0x37a7('0x2a')](respondWithStatusCode(_0x3e83ea,null))[_0x37a7('0x4e')](handleError(_0x3e83ea,null));};exports[_0x37a7('0x8b')]=function(_0x4b19de,_0x388195,_0x354541){var _0x4d771d={};var _0x36e51f={};var _0x437507;var _0x27ecc5;return db[_0x37a7('0x4b')]['findOne']({'where':{'id':_0x4b19de['params']['id']}})[_0x37a7('0x2a')](handleEntityNotFound(_0x388195,null))[_0x37a7('0x2a')](function(_0x471806){if(_0x471806){_0x437507=_0x471806;_0x36e51f[_0x37a7('0x37')]=_['keys'](db[_0x37a7('0x5f')][_0x37a7('0x34')]);_0x36e51f['query']=_[_0x37a7('0x39')](_0x4b19de['query']);_0x36e51f[_0x37a7('0x3a')]=_['intersection'](_0x36e51f[_0x37a7('0x37')],_0x36e51f['query']);_0x4d771d[_0x37a7('0x3d')]=_['intersection'](_0x36e51f[_0x37a7('0x37')],qs[_0x37a7('0x3c')](_0x4b19de[_0x37a7('0x38')][_0x37a7('0x3c')]));_0x4d771d['attributes']=_0x4d771d['attributes'][_0x37a7('0x3e')]?_0x4d771d[_0x37a7('0x3d')]:_0x36e51f['model'];_0x4d771d['order']=qs[_0x37a7('0x42')](_0x4b19de[_0x37a7('0x38')][_0x37a7('0x42')]);_0x4d771d['where']=qs[_0x37a7('0x3a')](_[_0x37a7('0x43')](_0x4b19de['query'],_0x36e51f['filters']));if(_0x4b19de[_0x37a7('0x38')][_0x37a7('0x44')]){_0x4d771d[_0x37a7('0x45')]=_['merge'](_0x4d771d[_0x37a7('0x45')],{'$or':_[_0x37a7('0x33')](_0x4d771d[_0x37a7('0x3d')],function(_0x3f61d4){var _0x3347b7={};_0x3347b7[_0x3f61d4]={'$like':'%'+_0x4b19de[_0x37a7('0x38')][_0x37a7('0x44')]+'%'};return _0x3347b7;})});}_0x4d771d=_[_0x37a7('0x46')]({},_0x4d771d,_0x4b19de['options']);return _0x437507[_0x37a7('0x8b')](_0x4d771d);}})['then'](function(_0x43ec3b){if(_0x43ec3b){_0x27ecc5=_0x43ec3b[_0x37a7('0x3e')];if(!_0x4b19de[_0x37a7('0x38')][_0x37a7('0x3f')](_0x37a7('0x40'))){_0x4d771d[_0x37a7('0x22')]=qs[_0x37a7('0x22')](_0x4b19de[_0x37a7('0x38')][_0x37a7('0x22')]);_0x4d771d['offset']=qs[_0x37a7('0x20')](_0x4b19de[_0x37a7('0x38')][_0x37a7('0x20')]);}return _0x437507[_0x37a7('0x8b')](_0x4d771d);}})['then'](function(_0x48fa4d){if(_0x48fa4d){return _0x48fa4d?{'count':_0x27ecc5,'rows':_0x48fa4d}:null;}})[_0x37a7('0x2a')](respondWithResult(_0x388195,null))[_0x37a7('0x4e')](handleError(_0x388195,null));};
\ No newline at end of file
index 3ce1cca..1e3ec21 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc66d=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue'];(function(_0x3786d6,_0x24eb0c){var _0x1a529c=function(_0x258c9a){while(--_0x258c9a){_0x3786d6['push'](_0x3786d6['shift']());}};_0x1a529c(++_0x24eb0c);}(_0xc66d,0xd9));var _0xdc66=function(_0x27b7e9,_0x3713fd){_0x27b7e9=_0x27b7e9-0x0;var _0x44a6cb=_0xc66d[_0x27b7e9];return _0x44a6cb;};'use strict';var EventEmitter=require(_0xdc66('0x0'));var WhatsappQueue=require(_0xdc66('0x1'))['db'][_0xdc66('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xdc66('0x3')](0x0);var events={'afterCreate':_0xdc66('0x4'),'afterUpdate':_0xdc66('0x5'),'afterDestroy':_0xdc66('0x6')};function emitEvent(_0x472d37){return function(_0x5f0179,_0x22b386,_0x5345e4){WhatsappQueueEvents[_0xdc66('0x7')](_0x472d37+':'+_0x5f0179['id'],_0x5f0179);WhatsappQueueEvents[_0xdc66('0x7')](_0x472d37,_0x5f0179);_0x5345e4(null);};}for(var e in events){if(events[_0xdc66('0x8')](e)){var event=events[e];WhatsappQueue[_0xdc66('0x9')](e,emitEvent(event));}}module[_0xdc66('0xa')]=WhatsappQueueEvents;
\ No newline at end of file
+var _0x4941=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x4941,0x122));var _0x1494=function(_0x5235dd,_0x3f91cf){_0x5235dd=_0x5235dd-0x0;var _0x13059d=_0x4941[_0x5235dd];return _0x13059d;};'use strict';var EventEmitter=require(_0x1494('0x0'));var WhatsappQueue=require(_0x1494('0x1'))['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x1494('0x2')](0x0);var events={'afterCreate':_0x1494('0x3'),'afterUpdate':_0x1494('0x4'),'afterDestroy':_0x1494('0x5')};function emitEvent(_0x14fcc9){return function(_0xe9d1f3,_0x1bb4ee,_0x58b4cc){WhatsappQueueEvents['emit'](_0x14fcc9+':'+_0xe9d1f3['id'],_0xe9d1f3);WhatsappQueueEvents[_0x1494('0x6')](_0x14fcc9,_0xe9d1f3);_0x58b4cc(null);};}for(var e in events){if(events[_0x1494('0x7')](e)){var event=events[e];WhatsappQueue[_0x1494('0x8')](e,emitEvent(event));}}module[_0x1494('0x9')]=WhatsappQueueEvents;
\ No newline at end of file
index 37ac6ca..e75e066 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d48=['rimraf','../../config/environment','./whatsappQueue.attributes','WhatsappQueue','whatsapp_queues','lodash','util','api','moment','bluebird','request-promise'];(function(_0x3d95e9,_0x45bb17){var _0x472c9a=function(_0x4eeb02){while(--_0x4eeb02){_0x3d95e9['push'](_0x3d95e9['shift']());}};_0x472c9a(++_0x45bb17);}(_0x4d48,0x9f));var _0x84d4=function(_0x2dc098,_0x48eb28){_0x2dc098=_0x2dc098-0x0;var _0x391d8d=_0x4d48[_0x2dc098];return _0x391d8d;};'use strict';var _=require(_0x84d4('0x0'));var util=require(_0x84d4('0x1'));var logger=require('../../config/logger')(_0x84d4('0x2'));var moment=require(_0x84d4('0x3'));var BPromise=require(_0x84d4('0x4'));var rp=require(_0x84d4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x84d4('0x6'));var config=require(_0x84d4('0x7'));var attributes=require(_0x84d4('0x8'));module['exports']=function(_0x3d3d42,_0x30be80){return _0x3d3d42['define'](_0x84d4('0x9'),attributes,{'tableName':_0x84d4('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdb7f=['moment','bluebird','request-promise','path','../../config/environment','./whatsappQueue.attributes','define','WhatsappQueue','../../config/logger','api'];(function(_0x276d7e,_0x4bf1a2){var _0x1bd1bb=function(_0x31f87b){while(--_0x31f87b){_0x276d7e['push'](_0x276d7e['shift']());}};_0x1bd1bb(++_0x4bf1a2);}(_0xdb7f,0xda));var _0xfdb7=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xdb7f[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfdb7('0x0'))(_0xfdb7('0x1'));var moment=require(_0xfdb7('0x2'));var BPromise=require(_0xfdb7('0x3'));var rp=require(_0xfdb7('0x4'));var fs=require('fs');var path=require(_0xfdb7('0x5'));var rimraf=require('rimraf');var config=require(_0xfdb7('0x6'));var attributes=require(_0xfdb7('0x7'));module['exports']=function(_0x2f235a,_0x4150be){return _0x2f235a[_0xfdb7('0x8')](_0xfdb7('0x9'),attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
index 15d5e52..8c7561d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6fd5=['raw','where','limit','map','include','attributes','model','debug','catch','ShowWhatsappQueue','find','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./whatsappQueue.socket','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetWhatsappQueue','options'];(function(_0x35201e,_0x34341b){var _0x4bc5b7=function(_0x504ba7){while(--_0x504ba7){_0x35201e['push'](_0x35201e['shift']());}};_0x4bc5b7(++_0x34341b);}(_0x6fd5,0x12b));var _0x56fd=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x6fd5[_0x484e36];return _0xafc85d;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x56fd('0x0'));var rs=require(_0x56fd('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x56fd('0x2'))['db'];var utils=require(_0x56fd('0x3'));var logger=require('../../config/logger')(_0x56fd('0x4'));var config=require('../../config/environment');var jayson=require(_0x56fd('0x5'));var client=jayson[_0x56fd('0x6')]['http']({'port':0x232a});config['redis']=_[_0x56fd('0x7')](config[_0x56fd('0x8')],{'host':_0x56fd('0x9'),'port':0x18eb});var socket=require(_0x56fd('0xa'))(new Redis(config[_0x56fd('0x8')]));require(_0x56fd('0xb'))['register'](socket);function respondWithRpcPromise(_0x19eb86,_0xe5100d,_0x8a730d){return new BPromise(function(_0x12bde6,_0x5056fd){return client[_0x56fd('0xc')](_0x19eb86,_0x8a730d)[_0x56fd('0xd')](function(_0x40e541){logger[_0x56fd('0xe')](_0x56fd('0xf'),_0xe5100d,_0x56fd('0x10'));logger['debug'](_0x56fd('0x11'),_0xe5100d,_0x56fd('0x10'),JSON[_0x56fd('0x12')](_0x40e541));if(_0x40e541[_0x56fd('0x13')]){if(_0x40e541[_0x56fd('0x13')][_0x56fd('0x14')]===0x1f4){logger[_0x56fd('0x13')](_0x56fd('0xf'),_0xe5100d,_0x40e541[_0x56fd('0x13')][_0x56fd('0x15')]);return _0x5056fd(_0x40e541['error'][_0x56fd('0x15')]);}logger['error'](_0x56fd('0xf'),_0xe5100d,_0x40e541['error']['message']);return _0x12bde6(_0x40e541[_0x56fd('0x13')]['message']);}else{logger['info'](_0x56fd('0xf'),_0xe5100d,_0x56fd('0x10'));_0x12bde6(_0x40e541[_0x56fd('0x16')]['message']);}})['catch'](function(_0x19e57a){logger[_0x56fd('0x13')](_0x56fd('0xf'),_0xe5100d,_0x19e57a);_0x5056fd(_0x19e57a);});});}exports[_0x56fd('0x17')]=function(_0x5c341b){var _0x48b0fd=this;return new Promise(function(_0x2e0a15,_0xb68ca5){return db['WhatsappQueue']['findAll']({'raw':_0x5c341b[_0x56fd('0x18')]?_0x5c341b['options'][_0x56fd('0x19')]===undefined?!![]:![]:!![],'where':_0x5c341b['options']?_0x5c341b[_0x56fd('0x18')][_0x56fd('0x1a')]||null:null,'attributes':_0x5c341b[_0x56fd('0x18')]?_0x5c341b['options']['attributes']||null:null,'limit':_0x5c341b['options']?_0x5c341b[_0x56fd('0x18')][_0x56fd('0x1b')]||null:null,'include':_0x5c341b[_0x56fd('0x18')]?_0x5c341b[_0x56fd('0x18')]['include']?_[_0x56fd('0x1c')](_0x5c341b[_0x56fd('0x18')][_0x56fd('0x1d')],function(_0x165957){return{'model':db[_0x165957['model']],'as':_0x165957['as'],'attributes':_0x165957['attributes'],'include':_0x165957[_0x56fd('0x1d')]?_[_0x56fd('0x1c')](_0x165957['include'],function(_0x1027ed){return{'model':db[_0x1027ed['model']],'as':_0x1027ed['as'],'attributes':_0x1027ed[_0x56fd('0x1e')],'include':_0x1027ed[_0x56fd('0x1d')]?_[_0x56fd('0x1c')](_0x1027ed['include'],function(_0x22ca5c){return{'model':db[_0x22ca5c[_0x56fd('0x1f')]],'as':_0x22ca5c['as'],'attributes':_0x22ca5c[_0x56fd('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x56fd('0xd')](function(_0x110540){logger[_0x56fd('0xe')](_0x56fd('0x17'),_0x5c341b);logger[_0x56fd('0x20')](_0x56fd('0x17'),_0x5c341b,JSON['stringify'](_0x110540));_0x2e0a15(_0x110540);})[_0x56fd('0x21')](function(_0x2c0aef){logger[_0x56fd('0x13')](_0x56fd('0x17'),_0x2c0aef[_0x56fd('0x15')],_0x5c341b);_0xb68ca5(_0x48b0fd[_0x56fd('0x13')](0x1f4,_0x2c0aef[_0x56fd('0x15')]));});});};exports[_0x56fd('0x22')]=function(_0x44a8f6){var _0x528410=this;return new Promise(function(_0x3d119a,_0x368748){return db['WhatsappQueue'][_0x56fd('0x23')]({'raw':_0x44a8f6[_0x56fd('0x18')]?_0x44a8f6['options'][_0x56fd('0x19')]===undefined?!![]:![]:!![],'where':_0x44a8f6['options']?_0x44a8f6[_0x56fd('0x18')]['where']||null:null,'attributes':_0x44a8f6[_0x56fd('0x18')]?_0x44a8f6[_0x56fd('0x18')][_0x56fd('0x1e')]||null:null,'include':_0x44a8f6[_0x56fd('0x18')]?_0x44a8f6[_0x56fd('0x18')][_0x56fd('0x1d')]?_['map'](_0x44a8f6[_0x56fd('0x18')][_0x56fd('0x1d')],function(_0x1610c5){return{'model':db[_0x1610c5[_0x56fd('0x1f')]],'as':_0x1610c5['as'],'attributes':_0x1610c5[_0x56fd('0x1e')],'include':_0x1610c5[_0x56fd('0x1d')]?_[_0x56fd('0x1c')](_0x1610c5[_0x56fd('0x1d')],function(_0x37321c){return{'model':db[_0x37321c[_0x56fd('0x1f')]],'as':_0x37321c['as'],'attributes':_0x37321c[_0x56fd('0x1e')],'include':_0x37321c[_0x56fd('0x1d')]?_[_0x56fd('0x1c')](_0x37321c['include'],function(_0xd5e10e){return{'model':db[_0xd5e10e[_0x56fd('0x1f')]],'as':_0xd5e10e['as'],'attributes':_0xd5e10e['attributes']};}):[]};}):[]};}):[]:[]})[_0x56fd('0xd')](function(_0x360572){logger[_0x56fd('0xe')](_0x56fd('0x22'),_0x44a8f6);logger[_0x56fd('0x20')](_0x56fd('0x22'),_0x44a8f6,JSON['stringify'](_0x360572));_0x3d119a(_0x360572);})[_0x56fd('0x21')](function(_0x5e4719){logger[_0x56fd('0x13')](_0x56fd('0x22'),_0x5e4719[_0x56fd('0x15')],_0x44a8f6);_0x368748(_0x528410[_0x56fd('0x13')](0x1f4,_0x5e4719[_0x56fd('0x15')]));});});};
\ No newline at end of file
+var _0x4dc4=['options','where','attributes','limit','include','map','model','debug','ShowWhatsappQueue','find','raw','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetWhatsappQueue','WhatsappQueue','findAll'];(function(_0x101a58,_0xd02c1b){var _0x589e2c=function(_0x2b8fba){while(--_0x2b8fba){_0x101a58['push'](_0x101a58['shift']());}};_0x589e2c(++_0xd02c1b);}(_0x4dc4,0x131));var _0x44dc=function(_0x57cc7a,_0xf860ad){_0x57cc7a=_0x57cc7a-0x0;var _0x4855e7=_0x4dc4[_0x57cc7a];return _0x4855e7;};'use strict';var _=require('lodash');var util=require(_0x44dc('0x0'));var moment=require(_0x44dc('0x1'));var BPromise=require(_0x44dc('0x2'));var rs=require(_0x44dc('0x3'));var fs=require('fs');var Redis=require(_0x44dc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x44dc('0x5'));var logger=require(_0x44dc('0x6'))(_0x44dc('0x7'));var config=require('../../config/environment');var jayson=require(_0x44dc('0x8'));var client=jayson[_0x44dc('0x9')][_0x44dc('0xa')]({'port':0x232a});config[_0x44dc('0xb')]=_[_0x44dc('0xc')](config[_0x44dc('0xb')],{'host':_0x44dc('0xd'),'port':0x18eb});var socket=require(_0x44dc('0xe'))(new Redis(config[_0x44dc('0xb')]));require(_0x44dc('0xf'))[_0x44dc('0x10')](socket);function respondWithRpcPromise(_0x5bea08,_0x4400f4,_0x494363){return new BPromise(function(_0x2102e7,_0x1ba4b2){return client[_0x44dc('0x11')](_0x5bea08,_0x494363)[_0x44dc('0x12')](function(_0x11927a){logger[_0x44dc('0x13')](_0x44dc('0x14'),_0x4400f4,_0x44dc('0x15'));logger['debug'](_0x44dc('0x16'),_0x4400f4,'request\x20sent',JSON[_0x44dc('0x17')](_0x11927a));if(_0x11927a[_0x44dc('0x18')]){if(_0x11927a[_0x44dc('0x18')][_0x44dc('0x19')]===0x1f4){logger[_0x44dc('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x4400f4,_0x11927a[_0x44dc('0x18')][_0x44dc('0x1a')]);return _0x1ba4b2(_0x11927a[_0x44dc('0x18')][_0x44dc('0x1a')]);}logger[_0x44dc('0x18')](_0x44dc('0x14'),_0x4400f4,_0x11927a[_0x44dc('0x18')][_0x44dc('0x1a')]);return _0x2102e7(_0x11927a[_0x44dc('0x18')][_0x44dc('0x1a')]);}else{logger[_0x44dc('0x13')](_0x44dc('0x14'),_0x4400f4,_0x44dc('0x15'));_0x2102e7(_0x11927a['result']['message']);}})[_0x44dc('0x1b')](function(_0x6e4aa1){logger[_0x44dc('0x18')](_0x44dc('0x14'),_0x4400f4,_0x6e4aa1);_0x1ba4b2(_0x6e4aa1);});});}exports[_0x44dc('0x1c')]=function(_0x1eb2ca){var _0x5e0618=this;return new Promise(function(_0x70f239,_0x560839){return db[_0x44dc('0x1d')][_0x44dc('0x1e')]({'raw':_0x1eb2ca[_0x44dc('0x1f')]?_0x1eb2ca[_0x44dc('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x1eb2ca[_0x44dc('0x1f')]?_0x1eb2ca[_0x44dc('0x1f')][_0x44dc('0x20')]||null:null,'attributes':_0x1eb2ca[_0x44dc('0x1f')]?_0x1eb2ca[_0x44dc('0x1f')][_0x44dc('0x21')]||null:null,'limit':_0x1eb2ca['options']?_0x1eb2ca['options'][_0x44dc('0x22')]||null:null,'include':_0x1eb2ca[_0x44dc('0x1f')]?_0x1eb2ca[_0x44dc('0x1f')][_0x44dc('0x23')]?_[_0x44dc('0x24')](_0x1eb2ca[_0x44dc('0x1f')][_0x44dc('0x23')],function(_0x2f006f){return{'model':db[_0x2f006f[_0x44dc('0x25')]],'as':_0x2f006f['as'],'attributes':_0x2f006f[_0x44dc('0x21')],'include':_0x2f006f[_0x44dc('0x23')]?_[_0x44dc('0x24')](_0x2f006f['include'],function(_0x1d1d73){return{'model':db[_0x1d1d73[_0x44dc('0x25')]],'as':_0x1d1d73['as'],'attributes':_0x1d1d73[_0x44dc('0x21')],'include':_0x1d1d73[_0x44dc('0x23')]?_[_0x44dc('0x24')](_0x1d1d73[_0x44dc('0x23')],function(_0x44c4cb){return{'model':db[_0x44c4cb[_0x44dc('0x25')]],'as':_0x44c4cb['as'],'attributes':_0x44c4cb[_0x44dc('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x8af362){logger[_0x44dc('0x13')](_0x44dc('0x1c'),_0x1eb2ca);logger[_0x44dc('0x26')]('GetWhatsappQueue',_0x1eb2ca,JSON[_0x44dc('0x17')](_0x8af362));_0x70f239(_0x8af362);})[_0x44dc('0x1b')](function(_0x163326){logger[_0x44dc('0x18')]('GetWhatsappQueue',_0x163326[_0x44dc('0x1a')],_0x1eb2ca);_0x560839(_0x5e0618[_0x44dc('0x18')](0x1f4,_0x163326[_0x44dc('0x1a')]));});});};exports[_0x44dc('0x27')]=function(_0x5d31ab){var _0x1616da=this;return new Promise(function(_0x50a572,_0x1547f1){return db[_0x44dc('0x1d')][_0x44dc('0x28')]({'raw':_0x5d31ab[_0x44dc('0x1f')]?_0x5d31ab[_0x44dc('0x1f')][_0x44dc('0x29')]===undefined?!![]:![]:!![],'where':_0x5d31ab['options']?_0x5d31ab[_0x44dc('0x1f')][_0x44dc('0x20')]||null:null,'attributes':_0x5d31ab[_0x44dc('0x1f')]?_0x5d31ab[_0x44dc('0x1f')][_0x44dc('0x21')]||null:null,'include':_0x5d31ab[_0x44dc('0x1f')]?_0x5d31ab[_0x44dc('0x1f')][_0x44dc('0x23')]?_[_0x44dc('0x24')](_0x5d31ab[_0x44dc('0x1f')]['include'],function(_0x3dadb9){return{'model':db[_0x3dadb9[_0x44dc('0x25')]],'as':_0x3dadb9['as'],'attributes':_0x3dadb9[_0x44dc('0x21')],'include':_0x3dadb9[_0x44dc('0x23')]?_['map'](_0x3dadb9['include'],function(_0x5b588f){return{'model':db[_0x5b588f[_0x44dc('0x25')]],'as':_0x5b588f['as'],'attributes':_0x5b588f[_0x44dc('0x21')],'include':_0x5b588f[_0x44dc('0x23')]?_[_0x44dc('0x24')](_0x5b588f['include'],function(_0x11f6dc){return{'model':db[_0x11f6dc[_0x44dc('0x25')]],'as':_0x11f6dc['as'],'attributes':_0x11f6dc[_0x44dc('0x21')]};}):[]};}):[]};}):[]:[]})[_0x44dc('0x12')](function(_0x1586be){logger['info']('ShowWhatsappQueue',_0x5d31ab);logger[_0x44dc('0x26')](_0x44dc('0x27'),_0x5d31ab,JSON[_0x44dc('0x17')](_0x1586be));_0x50a572(_0x1586be);})[_0x44dc('0x1b')](function(_0x5cbe19){logger[_0x44dc('0x18')](_0x44dc('0x27'),_0x5cbe19[_0x44dc('0x1a')],_0x5d31ab);_0x1547f1(_0x1616da[_0x44dc('0x18')](0x1f4,_0x5cbe19[_0x44dc('0x1a')]));});});};
\ No newline at end of file
index a0e605d..15d7f7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x92bd=['register','whatsappQueue:','save','remove','update','removeListener'];(function(_0x2c2980,_0x34282a){var _0x2a20a9=function(_0x537b18){while(--_0x537b18){_0x2c2980['push'](_0x2c2980['shift']());}};_0x2a20a9(++_0x34282a);}(_0x92bd,0x188));var _0xd92b=function(_0x1412b0,_0x489412){_0x1412b0=_0x1412b0-0x0;var _0x29d28f=_0x92bd[_0x1412b0];return _0x29d28f;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0xd92b('0x0'),_0xd92b('0x1'),_0xd92b('0x2')];function createListener(_0x29588b,_0x3d9aae){return function(_0x30f4c6){_0x3d9aae['emit'](_0x29588b,_0x30f4c6);};}function removeListener(_0xe242b0,_0x41b52d){return function(){WhatsappQueueEvents[_0xd92b('0x3')](_0xe242b0,_0x41b52d);};}exports[_0xd92b('0x4')]=function(_0x3f385b){for(var _0x1891f2=0x0,_0x2e9d21=events['length'];_0x1891f2<_0x2e9d21;_0x1891f2++){var _0x3f12c9=events[_0x1891f2];var _0x2396b7=createListener(_0xd92b('0x5')+_0x3f12c9,_0x3f385b);WhatsappQueueEvents['on'](_0x3f12c9,_0x2396b7);}};
\ No newline at end of file
+var _0x10b6=['register','length','save','remove','update','emit'];(function(_0x331860,_0x2192ea){var _0x1aa26c=function(_0x5587d2){while(--_0x5587d2){_0x331860['push'](_0x331860['shift']());}};_0x1aa26c(++_0x2192ea);}(_0x10b6,0x170));var _0x610b=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x10b6[_0x3947c9];return _0x2e7871;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x610b('0x0'),_0x610b('0x1'),_0x610b('0x2')];function createListener(_0x23ad61,_0x202faf){return function(_0x453740){_0x202faf[_0x610b('0x3')](_0x23ad61,_0x453740);};}function removeListener(_0x81211b,_0x503b0d){return function(){WhatsappQueueEvents['removeListener'](_0x81211b,_0x503b0d);};}exports[_0x610b('0x4')]=function(_0x5f2c10){for(var _0xf75b02=0x0,_0x38859a=events[_0x610b('0x5')];_0xf75b02<_0x38859a;_0xf75b02++){var _0x1920ea=events[_0xf75b02];var _0x157a2a=createListener('whatsappQueue:'+_0x1920ea,_0x5f2c10);WhatsappQueueEvents['on'](_0x1920ea,_0x157a2a);}};
\ No newline at end of file
index 2d0b17d..6f8d42f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0dd=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','post','create','update','delete','exports','multer'];(function(_0x3fe6df,_0x5a04d4){var _0x372a0e=function(_0x144b98){while(--_0x144b98){_0x3fe6df['push'](_0x3fe6df['shift']());}};_0x372a0e(++_0x5a04d4);}(_0xe0dd,0x1f3));var _0xde0d=function(_0x1f99a0,_0x50b73d){_0x1f99a0=_0x1f99a0-0x0;var _0x1e0849=_0xe0dd[_0x1f99a0];return _0x1e0849;};'use strict';var multer=require(_0xde0d('0x0'));var util=require(_0xde0d('0x1'));var path=require(_0xde0d('0x2'));var timeout=require(_0xde0d('0x3'));var express=require(_0xde0d('0x4'));var router=express[_0xde0d('0x5')]();var fs_extra=require(_0xde0d('0x6'));var auth=require(_0xde0d('0x7'));var interaction=require(_0xde0d('0x8'));var config=require('../../config/environment');var controller=require('./whatsappQueueReport.controller');router[_0xde0d('0x9')]('/',auth[_0xde0d('0xa')](),controller[_0xde0d('0xb')]);router[_0xde0d('0x9')](_0xde0d('0xc'),auth[_0xde0d('0xa')](),controller[_0xde0d('0xd')]);router[_0xde0d('0x9')](_0xde0d('0xe'),auth[_0xde0d('0xa')](),controller['show']);router[_0xde0d('0xf')]('/',auth[_0xde0d('0xa')](),controller[_0xde0d('0x10')]);router['put'](_0xde0d('0xe'),auth[_0xde0d('0xa')](),controller[_0xde0d('0x11')]);router[_0xde0d('0x12')](_0xde0d('0xe'),auth[_0xde0d('0xa')](),controller['destroy']);module[_0xde0d('0x13')]=router;
\ No newline at end of file
+var _0x8bf7=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','destroy','multer','util'];(function(_0x538f89,_0x59b28a){var _0x53e9fa=function(_0x32837f){while(--_0x32837f){_0x538f89['push'](_0x538f89['shift']());}};_0x53e9fa(++_0x59b28a);}(_0x8bf7,0x139));var _0x78bf=function(_0x327519,_0x3d83e0){_0x327519=_0x327519-0x0;var _0x4647e0=_0x8bf7[_0x327519];return _0x4647e0;};'use strict';var multer=require(_0x78bf('0x0'));var util=require(_0x78bf('0x1'));var path=require(_0x78bf('0x2'));var timeout=require('connect-timeout');var express=require(_0x78bf('0x3'));var router=express[_0x78bf('0x4')]();var fs_extra=require(_0x78bf('0x5'));var auth=require(_0x78bf('0x6'));var interaction=require(_0x78bf('0x7'));var config=require(_0x78bf('0x8'));var controller=require(_0x78bf('0x9'));router[_0x78bf('0xa')]('/',auth[_0x78bf('0xb')](),controller[_0x78bf('0xc')]);router[_0x78bf('0xa')](_0x78bf('0xd'),auth[_0x78bf('0xb')](),controller[_0x78bf('0xe')]);router[_0x78bf('0xa')](_0x78bf('0xf'),auth[_0x78bf('0xb')](),controller[_0x78bf('0x10')]);router[_0x78bf('0x11')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x78bf('0xf'),auth[_0x78bf('0xb')](),controller[_0x78bf('0x12')]);router[_0x78bf('0x13')](_0x78bf('0xf'),auth['isAuthenticated'](),controller[_0x78bf('0x14')]);module['exports']=router;
\ No newline at end of file
index fa4fd63..a2fcd6a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x1126db,_0x49aaad){var _0x17c814=function(_0x5d72d2){while(--_0x5d72d2){_0x1126db['push'](_0x1126db['shift']());}};_0x17c814(++_0x49aaad);}(_0x7a54,0x106));var _0x47a5=function(_0x1db863,_0x437d98){_0x1db863=_0x1db863-0x0;var _0x34027f=_0x7a54[_0x1db863];return _0x34027f;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}};
\ No newline at end of file
+var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x4eadf9,_0x25c347){var _0x42cbe6=function(_0x3b1116){while(--_0x3b1116){_0x4eadf9['push'](_0x4eadf9['shift']());}};_0x42cbe6(++_0x25c347);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}};
\ No newline at end of file
index c93ad21..704098a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd87e=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','then','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','WhatsappQueueReport','includeAll','findAll','rows','catch','show','params','include','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','ejs'];(function(_0x217626,_0x71d75){var _0x3e2ada=function(_0x16dc65){while(--_0x16dc65){_0x217626['push'](_0x217626['shift']());}};_0x3e2ada(++_0x71d75);}(_0xd87e,0x1bf));var _0xed87=function(_0x2d6391,_0x4b7ec8){_0x2d6391=_0x2d6391-0x0;var _0x5e2ee6=_0xd87e[_0x2d6391];return _0x5e2ee6;};'use strict';var emlformat=require(_0xed87('0x0'));var rimraf=require(_0xed87('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xed87('0x2'));var rp=require(_0xed87('0x3'));var moment=require(_0xed87('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xed87('0x5'));var util=require('util');var path=require(_0xed87('0x6'));var sox=require(_0xed87('0x7'));var csv=require('to-csv');var ejs=require(_0xed87('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xed87('0x9'));var crypto=require(_0xed87('0xa'));var jsforce=require(_0xed87('0xb'));var deskjs=require(_0xed87('0xc'));var toCsv=require('to-csv');var querystring=require(_0xed87('0xd'));var Papa=require(_0xed87('0xe'));var Redis=require(_0xed87('0xf'));var authService=require(_0xed87('0x10'));var qs=require(_0xed87('0x11'));var as=require(_0xed87('0x12'));var hardwareService=require(_0xed87('0x13'));var logger=require('../../config/logger')(_0xed87('0x14'));var utils=require(_0xed87('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xed87('0x16'));var db=require(_0xed87('0x17'))['db'];function respondWithStatusCode(_0x5e912e,_0x4ffc2d){_0x4ffc2d=_0x4ffc2d||0xcc;return function(_0x466f35){if(_0x466f35){return _0x5e912e[_0xed87('0x18')](_0x4ffc2d);}return _0x5e912e[_0xed87('0x19')](_0x4ffc2d)[_0xed87('0x1a')]();};}function respondWithResult(_0x16bfd6,_0x3865c5){_0x3865c5=_0x3865c5||0xc8;return function(_0x52dfe8){if(_0x52dfe8){return _0x16bfd6[_0xed87('0x19')](_0x3865c5)[_0xed87('0x1b')](_0x52dfe8);}};}function respondWithFilteredResult(_0x1722a6,_0x1e9a3d){return function(_0x2f2fd3){if(_0x2f2fd3){var _0xd34e0e=typeof _0x1e9a3d[_0xed87('0x1c')]===_0xed87('0x1d')&&typeof _0x1e9a3d[_0xed87('0x1e')]==='undefined';var _0x3db5ea=_0x2f2fd3[_0xed87('0x1f')];var _0x2c386a=_0xd34e0e?0x0:_0x1e9a3d[_0xed87('0x1c')];var _0x5f4076=_0xd34e0e?_0x2f2fd3[_0xed87('0x1f')]:_0x1e9a3d[_0xed87('0x1c')]+_0x1e9a3d[_0xed87('0x1e')];var _0x3f9e08;if(_0x5f4076>=_0x3db5ea){_0x5f4076=_0x3db5ea;_0x3f9e08=0xc8;}else{_0x3f9e08=0xce;}_0x1722a6[_0xed87('0x19')](_0x3f9e08);return _0x1722a6[_0xed87('0x20')](_0xed87('0x21'),_0x2c386a+'-'+_0x5f4076+'/'+_0x3db5ea)[_0xed87('0x1b')](_0x2f2fd3);}return null;};}function patchUpdates(_0x3b7981){return function(_0x52e81c){try{jsonpatch['apply'](_0x52e81c,_0x3b7981,!![]);}catch(_0x5db546){return BPromise['reject'](_0x5db546);}return _0x52e81c[_0xed87('0x22')]();};}function saveUpdates(_0x5d3ec8,_0x4191a7){return function(_0x2b0b98){if(_0x2b0b98){return _0x2b0b98['update'](_0x5d3ec8)[_0xed87('0x23')](function(_0x505733){return _0x505733;});}return null;};}function removeEntity(_0x3d1641,_0x24962e){return function(_0x27799a){if(_0x27799a){return _0x27799a[_0xed87('0x24')]()[_0xed87('0x23')](function(){_0x3d1641['status'](0xcc)[_0xed87('0x1a')]();});}};}function handleEntityNotFound(_0x3c22b7,_0x41e0d4){return function(_0x320bcc){if(!_0x320bcc){_0x3c22b7[_0xed87('0x18')](0x194);}return _0x320bcc;};}function handleError(_0x289e38,_0x25a6f7){_0x25a6f7=_0x25a6f7||0x1f4;return function(_0x4735b3){logger[_0xed87('0x25')](_0x4735b3[_0xed87('0x26')]);if(_0x4735b3[_0xed87('0x27')]){delete _0x4735b3[_0xed87('0x27')];}_0x289e38[_0xed87('0x19')](_0x25a6f7)[_0xed87('0x28')](_0x4735b3);};}exports['index']=function(_0xb32b1c,_0x1c4a65){var _0x4eaa44={},_0x3dff74={},_0x33c367={'count':0x0,'rows':[]};var _0x21c93b=_['map'](db['WhatsappQueueReport'][_0xed87('0x29')],function(_0x428b75){return{'name':_0x428b75[_0xed87('0x2a')],'type':_0x428b75['type'][_0xed87('0x2b')]};});_0x3dff74[_0xed87('0x2c')]=_[_0xed87('0x2d')](_0x21c93b,_0xed87('0x27'));_0x3dff74[_0xed87('0x2e')]=_[_0xed87('0x2f')](_0xb32b1c[_0xed87('0x2e')]);_0x3dff74[_0xed87('0x30')]=_[_0xed87('0x31')](_0x3dff74['model'],_0x3dff74[_0xed87('0x2e')]);_0x4eaa44[_0xed87('0x32')]=_['intersection'](_0x3dff74[_0xed87('0x2c')],qs['fields'](_0xb32b1c[_0xed87('0x2e')][_0xed87('0x33')]));_0x4eaa44[_0xed87('0x32')]=_0x4eaa44[_0xed87('0x32')][_0xed87('0x34')]?_0x4eaa44[_0xed87('0x32')]:_0x3dff74[_0xed87('0x2c')];if(!_0xb32b1c[_0xed87('0x2e')][_0xed87('0x35')](_0xed87('0x36'))){_0x4eaa44[_0xed87('0x1e')]=qs['limit'](_0xb32b1c[_0xed87('0x2e')][_0xed87('0x1e')]);_0x4eaa44['offset']=qs[_0xed87('0x1c')](_0xb32b1c['query'][_0xed87('0x1c')]);}_0x4eaa44[_0xed87('0x37')]=qs['sort'](_0xb32b1c[_0xed87('0x2e')][_0xed87('0x38')]);_0x4eaa44[_0xed87('0x39')]=qs[_0xed87('0x30')](_[_0xed87('0x3a')](_0xb32b1c['query'],_0x3dff74[_0xed87('0x30')]),_0x21c93b);if(_0xb32b1c['query'][_0xed87('0x3b')]){_0x4eaa44['where']=_[_0xed87('0x3c')](_0x4eaa44[_0xed87('0x39')],{'$or':_[_0xed87('0x2d')](_0x21c93b,function(_0x217435){if(_0x217435[_0xed87('0x3d')]!==_0xed87('0x3e')){var _0x9e3356={};_0x9e3356[_0x217435[_0xed87('0x27')]]={'$like':'%'+_0xb32b1c[_0xed87('0x2e')]['filter']+'%'};return _0x9e3356;}})});}_0x4eaa44=_['merge']({},_0x4eaa44,_0xb32b1c[_0xed87('0x3f')]);var _0x206544={'where':_0x4eaa44[_0xed87('0x39')]};return db[_0xed87('0x40')][_0xed87('0x1f')](_0x206544)[_0xed87('0x23')](function(_0x5d1bd0){_0x33c367[_0xed87('0x1f')]=_0x5d1bd0;if(_0xb32b1c[_0xed87('0x2e')][_0xed87('0x41')]){_0x4eaa44['include']=[{'all':!![]}];}return db[_0xed87('0x40')][_0xed87('0x42')](_0x4eaa44);})[_0xed87('0x23')](function(_0x1b0092){_0x33c367[_0xed87('0x43')]=_0x1b0092;return _0x33c367;})[_0xed87('0x23')](respondWithFilteredResult(_0x1c4a65,_0x4eaa44))[_0xed87('0x44')](handleError(_0x1c4a65,null));};exports[_0xed87('0x45')]=function(_0x35bd1c,_0x406b73){var _0x5c6925={'raw':!![],'where':{'id':_0x35bd1c[_0xed87('0x46')]['id']}},_0x7e6cbb={};_0x7e6cbb[_0xed87('0x2c')]=_['keys'](db['WhatsappQueueReport'][_0xed87('0x29')]);_0x7e6cbb[_0xed87('0x2e')]=_[_0xed87('0x2f')](_0x35bd1c[_0xed87('0x2e')]);_0x7e6cbb['filters']=_[_0xed87('0x31')](_0x7e6cbb[_0xed87('0x2c')],_0x7e6cbb['query']);_0x5c6925[_0xed87('0x32')]=_[_0xed87('0x31')](_0x7e6cbb[_0xed87('0x2c')],qs[_0xed87('0x33')](_0x35bd1c[_0xed87('0x2e')][_0xed87('0x33')]));_0x5c6925[_0xed87('0x32')]=_0x5c6925[_0xed87('0x32')][_0xed87('0x34')]?_0x5c6925[_0xed87('0x32')]:_0x7e6cbb[_0xed87('0x2c')];if(_0x35bd1c['query'][_0xed87('0x41')]){_0x5c6925[_0xed87('0x47')]=[{'all':!![]}];}_0x5c6925=_[_0xed87('0x3c')]({},_0x5c6925,_0x35bd1c[_0xed87('0x3f')]);return db[_0xed87('0x40')][_0xed87('0x48')](_0x5c6925)[_0xed87('0x23')](handleEntityNotFound(_0x406b73,null))[_0xed87('0x23')](respondWithResult(_0x406b73,null))[_0xed87('0x44')](handleError(_0x406b73,null));};exports[_0xed87('0x49')]=function(_0x8aa499,_0x26c8f4){return db[_0xed87('0x40')][_0xed87('0x49')](_0x8aa499[_0xed87('0x4a')],{})[_0xed87('0x23')](respondWithResult(_0x26c8f4,0xc9))[_0xed87('0x44')](handleError(_0x26c8f4,null));};exports['update']=function(_0x2c7bef,_0x1a68a7){if(_0x2c7bef[_0xed87('0x4a')]['id']){delete _0x2c7bef['body']['id'];}return db[_0xed87('0x40')][_0xed87('0x48')]({'where':{'id':_0x2c7bef['params']['id']}})[_0xed87('0x23')](handleEntityNotFound(_0x1a68a7,null))[_0xed87('0x23')](saveUpdates(_0x2c7bef[_0xed87('0x4a')],null))[_0xed87('0x23')](respondWithResult(_0x1a68a7,null))['catch'](handleError(_0x1a68a7,null));};exports[_0xed87('0x24')]=function(_0x436e15,_0x3ca34c){return db[_0xed87('0x40')][_0xed87('0x48')]({'where':{'id':_0x436e15[_0xed87('0x46')]['id']}})[_0xed87('0x23')](handleEntityNotFound(_0x3ca34c,null))[_0xed87('0x23')](removeEntity(_0x3ca34c,null))[_0xed87('0x44')](handleError(_0x3ca34c,null));};exports[_0xed87('0x4b')]=function(_0x25a514,_0x18846f){return db[_0xed87('0x40')]['describe']()[_0xed87('0x23')](respondWithResult(_0x18846f,null))['catch'](handleError(_0x18846f,null));};
\ No newline at end of file
+var _0xb58b=['save','update','destroy','then','error','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','include','findAll','rows','catch','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','count','limit','set','Content-Range','apply','reject'];(function(_0x123c5e,_0x430bcf){var _0x2ffbfa=function(_0x478209){while(--_0x478209){_0x123c5e['push'](_0x123c5e['shift']());}};_0x2ffbfa(++_0x430bcf);}(_0xb58b,0x1f1));var _0xbb58=function(_0x337d91,_0x71ec2e){_0x337d91=_0x337d91-0x0;var _0x3c9252=_0xb58b[_0x337d91];return _0x3c9252;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbb58('0x0'));var zipdir=require(_0xbb58('0x1'));var jsonpatch=require(_0xbb58('0x2'));var rp=require('request-promise');var moment=require(_0xbb58('0x3'));var BPromise=require(_0xbb58('0x4'));var Mustache=require('mustache');var util=require(_0xbb58('0x5'));var path=require('path');var sox=require(_0xbb58('0x6'));var csv=require(_0xbb58('0x7'));var ejs=require(_0xbb58('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb58('0x9'));var squel=require(_0xbb58('0xa'));var crypto=require(_0xbb58('0xb'));var jsforce=require(_0xbb58('0xc'));var deskjs=require(_0xbb58('0xd'));var toCsv=require(_0xbb58('0x7'));var querystring=require(_0xbb58('0xe'));var Papa=require(_0xbb58('0xf'));var Redis=require(_0xbb58('0x10'));var authService=require(_0xbb58('0x11'));var qs=require(_0xbb58('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb58('0x13'));var logger=require('../../config/logger')(_0xbb58('0x14'));var utils=require(_0xbb58('0x15'));var config=require(_0xbb58('0x16'));var licenseUtil=require(_0xbb58('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe88799,_0x18810f){_0x18810f=_0x18810f||0xcc;return function(_0x4cda21){if(_0x4cda21){return _0xe88799[_0xbb58('0x18')](_0x18810f);}return _0xe88799[_0xbb58('0x19')](_0x18810f)[_0xbb58('0x1a')]();};}function respondWithResult(_0x3b9406,_0x19ceda){_0x19ceda=_0x19ceda||0xc8;return function(_0x58245f){if(_0x58245f){return _0x3b9406[_0xbb58('0x19')](_0x19ceda)[_0xbb58('0x1b')](_0x58245f);}};}function respondWithFilteredResult(_0x5f4751,_0x4ba30e){return function(_0x33c20f){if(_0x33c20f){var _0x445b1f=typeof _0x4ba30e[_0xbb58('0x1c')]==='undefined'&&typeof _0x4ba30e['limit']==='undefined';var _0x55156e=_0x33c20f[_0xbb58('0x1d')];var _0x3134ea=_0x445b1f?0x0:_0x4ba30e['offset'];var _0xbee66=_0x445b1f?_0x33c20f['count']:_0x4ba30e[_0xbb58('0x1c')]+_0x4ba30e[_0xbb58('0x1e')];var _0x3c33d9;if(_0xbee66>=_0x55156e){_0xbee66=_0x55156e;_0x3c33d9=0xc8;}else{_0x3c33d9=0xce;}_0x5f4751[_0xbb58('0x19')](_0x3c33d9);return _0x5f4751[_0xbb58('0x1f')](_0xbb58('0x20'),_0x3134ea+'-'+_0xbee66+'/'+_0x55156e)[_0xbb58('0x1b')](_0x33c20f);}return null;};}function patchUpdates(_0x497fd0){return function(_0x84f34){try{jsonpatch[_0xbb58('0x21')](_0x84f34,_0x497fd0,!![]);}catch(_0x3e64fe){return BPromise[_0xbb58('0x22')](_0x3e64fe);}return _0x84f34[_0xbb58('0x23')]();};}function saveUpdates(_0x5d4a91,_0x49453a){return function(_0x350be7){if(_0x350be7){return _0x350be7[_0xbb58('0x24')](_0x5d4a91)['then'](function(_0x27806d){return _0x27806d;});}return null;};}function removeEntity(_0x53b693,_0x21964d){return function(_0x287822){if(_0x287822){return _0x287822[_0xbb58('0x25')]()[_0xbb58('0x26')](function(){_0x53b693[_0xbb58('0x19')](0xcc)[_0xbb58('0x1a')]();});}};}function handleEntityNotFound(_0x2d556a,_0x15e4c5){return function(_0x4e0303){if(!_0x4e0303){_0x2d556a[_0xbb58('0x18')](0x194);}return _0x4e0303;};}function handleError(_0x3bd550,_0x1be0ae){_0x1be0ae=_0x1be0ae||0x1f4;return function(_0x129094){logger[_0xbb58('0x27')](_0x129094[_0xbb58('0x28')]);if(_0x129094[_0xbb58('0x29')]){delete _0x129094[_0xbb58('0x29')];}_0x3bd550[_0xbb58('0x19')](_0x1be0ae)[_0xbb58('0x2a')](_0x129094);};}exports[_0xbb58('0x2b')]=function(_0x28b3a3,_0x2a0481){var _0x4157c4={},_0x3559b6={},_0x573cca={'count':0x0,'rows':[]};var _0x2b0f73=_[_0xbb58('0x2c')](db[_0xbb58('0x2d')][_0xbb58('0x2e')],function(_0x3304b9){return{'name':_0x3304b9[_0xbb58('0x2f')],'type':_0x3304b9[_0xbb58('0x30')][_0xbb58('0x31')]};});_0x3559b6[_0xbb58('0x32')]=_['map'](_0x2b0f73,_0xbb58('0x29'));_0x3559b6[_0xbb58('0x33')]=_[_0xbb58('0x34')](_0x28b3a3[_0xbb58('0x33')]);_0x3559b6[_0xbb58('0x35')]=_[_0xbb58('0x36')](_0x3559b6[_0xbb58('0x32')],_0x3559b6[_0xbb58('0x33')]);_0x4157c4[_0xbb58('0x37')]=_[_0xbb58('0x36')](_0x3559b6[_0xbb58('0x32')],qs[_0xbb58('0x38')](_0x28b3a3[_0xbb58('0x33')]['fields']));_0x4157c4['attributes']=_0x4157c4['attributes'][_0xbb58('0x39')]?_0x4157c4[_0xbb58('0x37')]:_0x3559b6[_0xbb58('0x32')];if(!_0x28b3a3[_0xbb58('0x33')][_0xbb58('0x3a')](_0xbb58('0x3b'))){_0x4157c4[_0xbb58('0x1e')]=qs[_0xbb58('0x1e')](_0x28b3a3['query'][_0xbb58('0x1e')]);_0x4157c4[_0xbb58('0x1c')]=qs['offset'](_0x28b3a3[_0xbb58('0x33')]['offset']);}_0x4157c4[_0xbb58('0x3c')]=qs['sort'](_0x28b3a3[_0xbb58('0x33')][_0xbb58('0x3d')]);_0x4157c4['where']=qs[_0xbb58('0x35')](_[_0xbb58('0x3e')](_0x28b3a3[_0xbb58('0x33')],_0x3559b6[_0xbb58('0x35')]),_0x2b0f73);if(_0x28b3a3[_0xbb58('0x33')][_0xbb58('0x3f')]){_0x4157c4[_0xbb58('0x40')]=_[_0xbb58('0x41')](_0x4157c4['where'],{'$or':_[_0xbb58('0x2c')](_0x2b0f73,function(_0x31aa4b){if(_0x31aa4b[_0xbb58('0x30')]!=='VIRTUAL'){var _0x4dbd5e={};_0x4dbd5e[_0x31aa4b[_0xbb58('0x29')]]={'$like':'%'+_0x28b3a3['query'][_0xbb58('0x3f')]+'%'};return _0x4dbd5e;}})});}_0x4157c4=_[_0xbb58('0x41')]({},_0x4157c4,_0x28b3a3[_0xbb58('0x42')]);var _0x560911={'where':_0x4157c4['where']};return db[_0xbb58('0x2d')][_0xbb58('0x1d')](_0x560911)[_0xbb58('0x26')](function(_0x24d82d){_0x573cca[_0xbb58('0x1d')]=_0x24d82d;if(_0x28b3a3[_0xbb58('0x33')]['includeAll']){_0x4157c4[_0xbb58('0x43')]=[{'all':!![]}];}return db[_0xbb58('0x2d')][_0xbb58('0x44')](_0x4157c4);})[_0xbb58('0x26')](function(_0x1185b3){_0x573cca[_0xbb58('0x45')]=_0x1185b3;return _0x573cca;})['then'](respondWithFilteredResult(_0x2a0481,_0x4157c4))[_0xbb58('0x46')](handleError(_0x2a0481,null));};exports['show']=function(_0x22f1c3,_0x285ad4){var _0x29fb1c={'raw':!![],'where':{'id':_0x22f1c3['params']['id']}},_0x45817f={};_0x45817f[_0xbb58('0x32')]=_[_0xbb58('0x34')](db[_0xbb58('0x2d')][_0xbb58('0x2e')]);_0x45817f['query']=_[_0xbb58('0x34')](_0x22f1c3['query']);_0x45817f[_0xbb58('0x35')]=_[_0xbb58('0x36')](_0x45817f[_0xbb58('0x32')],_0x45817f[_0xbb58('0x33')]);_0x29fb1c[_0xbb58('0x37')]=_[_0xbb58('0x36')](_0x45817f[_0xbb58('0x32')],qs[_0xbb58('0x38')](_0x22f1c3[_0xbb58('0x33')][_0xbb58('0x38')]));_0x29fb1c[_0xbb58('0x37')]=_0x29fb1c[_0xbb58('0x37')][_0xbb58('0x39')]?_0x29fb1c['attributes']:_0x45817f[_0xbb58('0x32')];if(_0x22f1c3['query']['includeAll']){_0x29fb1c[_0xbb58('0x43')]=[{'all':!![]}];}_0x29fb1c=_[_0xbb58('0x41')]({},_0x29fb1c,_0x22f1c3[_0xbb58('0x42')]);return db[_0xbb58('0x2d')][_0xbb58('0x47')](_0x29fb1c)[_0xbb58('0x26')](handleEntityNotFound(_0x285ad4,null))[_0xbb58('0x26')](respondWithResult(_0x285ad4,null))[_0xbb58('0x46')](handleError(_0x285ad4,null));};exports[_0xbb58('0x48')]=function(_0x39995e,_0x440fb3){return db['WhatsappQueueReport'][_0xbb58('0x48')](_0x39995e[_0xbb58('0x49')],{})['then'](respondWithResult(_0x440fb3,0xc9))[_0xbb58('0x46')](handleError(_0x440fb3,null));};exports[_0xbb58('0x24')]=function(_0xf94897,_0xdb0ff7){if(_0xf94897['body']['id']){delete _0xf94897[_0xbb58('0x49')]['id'];}return db['WhatsappQueueReport'][_0xbb58('0x47')]({'where':{'id':_0xf94897[_0xbb58('0x4a')]['id']}})[_0xbb58('0x26')](handleEntityNotFound(_0xdb0ff7,null))['then'](saveUpdates(_0xf94897[_0xbb58('0x49')],null))[_0xbb58('0x26')](respondWithResult(_0xdb0ff7,null))['catch'](handleError(_0xdb0ff7,null));};exports[_0xbb58('0x25')]=function(_0x4ca201,_0x28301d){return db[_0xbb58('0x2d')][_0xbb58('0x47')]({'where':{'id':_0x4ca201[_0xbb58('0x4a')]['id']}})[_0xbb58('0x26')](handleEntityNotFound(_0x28301d,null))[_0xbb58('0x26')](removeEntity(_0x28301d,null))[_0xbb58('0x46')](handleError(_0x28301d,null));};exports['describe']=function(_0x449088,_0x1fd892){return db['WhatsappQueueReport'][_0xbb58('0x4b')]()[_0xbb58('0x26')](respondWithResult(_0x1fd892,null))['catch'](handleError(_0x1fd892,null));};
\ No newline at end of file
index eab1034..ed18df6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2cdc=['uniqueid','api','moment','request-promise','path','rimraf','./whatsappQueueReport.attributes','exports','define','report_whatsapp_queue'];(function(_0x13b8db,_0x29bde1){var _0x2d844b=function(_0x301d32){while(--_0x301d32){_0x13b8db['push'](_0x13b8db['shift']());}};_0x2d844b(++_0x29bde1);}(_0x2cdc,0xf1));var _0xc2cd=function(_0x1debaa,_0x39c5a5){_0x1debaa=_0x1debaa-0x0;var _0x2fbd5e=_0x2cdc[_0x1debaa];return _0x2fbd5e;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc2cd('0x0'));var moment=require(_0xc2cd('0x1'));var BPromise=require('bluebird');var rp=require(_0xc2cd('0x2'));var fs=require('fs');var path=require(_0xc2cd('0x3'));var rimraf=require(_0xc2cd('0x4'));var config=require('../../config/environment');var attributes=require(_0xc2cd('0x5'));module[_0xc2cd('0x6')]=function(_0x52323a,_0x21994f){return _0x52323a[_0xc2cd('0x7')]('WhatsappQueueReport',attributes,{'tableName':_0xc2cd('0x8'),'paranoid':![],'indexes':[{'name':_0xc2cd('0x9'),'fields':[_0xc2cd('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x47c4=['exports','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes'];(function(_0x458590,_0xe5676f){var _0x163368=function(_0x3bbf85){while(--_0x3bbf85){_0x458590['push'](_0x458590['shift']());}};_0x163368(++_0xe5676f);}(_0x47c4,0x1ee));var _0x447c=function(_0x2df507,_0x553862){_0x2df507=_0x2df507-0x0;var _0x1f7167=_0x47c4[_0x2df507];return _0x1f7167;};'use strict';var _=require(_0x447c('0x0'));var util=require(_0x447c('0x1'));var logger=require(_0x447c('0x2'))(_0x447c('0x3'));var moment=require('moment');var BPromise=require(_0x447c('0x4'));var rp=require(_0x447c('0x5'));var fs=require('fs');var path=require(_0x447c('0x6'));var rimraf=require(_0x447c('0x7'));var config=require(_0x447c('0x8'));var attributes=require(_0x447c('0x9'));module[_0x447c('0xa')]=function(_0x219a88,_0x17a4e1){return _0x219a88['define'](_0x447c('0xb'),attributes,{'tableName':_0x447c('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x447c('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
index e8afb89..20b9057 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1e1d=['error','code','message','result','catch','CreateWhatsappQueueReport','create','body','options','raw','stringify','WhatsappQueueReport','update','where','attributes','limit','UpdateWhatsappQueueReport','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1ee62e,_0x159bb2){var _0x27c6c8=function(_0x31a5d4){while(--_0x31a5d4){_0x1ee62e['push'](_0x1ee62e['shift']());}};_0x27c6c8(++_0x159bb2);}(_0x1e1d,0x165));var _0xd1e1=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x1e1d[_0x344a3f];return _0x264712;};'use strict';var _=require('lodash');var util=require(_0xd1e1('0x0'));var moment=require(_0xd1e1('0x1'));var BPromise=require(_0xd1e1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd1e1('0x3'));var db=require(_0xd1e1('0x4'))['db'];var utils=require(_0xd1e1('0x5'));var logger=require(_0xd1e1('0x6'))(_0xd1e1('0x7'));var config=require(_0xd1e1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd1e1('0x9')][_0xd1e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4be1e8,_0x41642d,_0xd446b3){return new BPromise(function(_0x3e780b,_0x2f5306){return client[_0xd1e1('0xb')](_0x4be1e8,_0xd446b3)[_0xd1e1('0xc')](function(_0x5afe95){logger[_0xd1e1('0xd')](_0xd1e1('0xe'),_0x41642d,_0xd1e1('0xf'));logger[_0xd1e1('0x10')]('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x41642d,_0xd1e1('0xf'),JSON['stringify'](_0x5afe95));if(_0x5afe95[_0xd1e1('0x11')]){if(_0x5afe95[_0xd1e1('0x11')][_0xd1e1('0x12')]===0x1f4){logger[_0xd1e1('0x11')](_0xd1e1('0xe'),_0x41642d,_0x5afe95['error'][_0xd1e1('0x13')]);return _0x2f5306(_0x5afe95[_0xd1e1('0x11')][_0xd1e1('0x13')]);}logger['error']('WhatsappQueueReport,\x20%s,\x20%s',_0x41642d,_0x5afe95[_0xd1e1('0x11')][_0xd1e1('0x13')]);return _0x3e780b(_0x5afe95[_0xd1e1('0x11')][_0xd1e1('0x13')]);}else{logger[_0xd1e1('0xd')](_0xd1e1('0xe'),_0x41642d,_0xd1e1('0xf'));_0x3e780b(_0x5afe95[_0xd1e1('0x14')][_0xd1e1('0x13')]);}})[_0xd1e1('0x15')](function(_0x31ea69){logger['error'](_0xd1e1('0xe'),_0x41642d,_0x31ea69);_0x2f5306(_0x31ea69);});});}exports[_0xd1e1('0x16')]=function(_0x47af2c){var _0x384f88=this;return new Promise(function(_0x103300,_0x305805){return db['WhatsappQueueReport'][_0xd1e1('0x17')](_0x47af2c[_0xd1e1('0x18')],{'raw':_0x47af2c[_0xd1e1('0x19')]?_0x47af2c[_0xd1e1('0x19')][_0xd1e1('0x1a')]===undefined?!![]:![]:!![]})[_0xd1e1('0xc')](function(_0x5d310d){logger[_0xd1e1('0xd')](_0xd1e1('0x16'),_0x47af2c);logger[_0xd1e1('0x10')](_0xd1e1('0x16'),_0x47af2c,JSON[_0xd1e1('0x1b')](_0x5d310d));_0x103300(_0x5d310d);})[_0xd1e1('0x15')](function(_0x2701e3){logger[_0xd1e1('0x11')](_0xd1e1('0x16'),_0x2701e3[_0xd1e1('0x13')],_0x47af2c);_0x305805(_0x384f88[_0xd1e1('0x11')](0x1f4,_0x2701e3['message']));});});};exports['UpdateWhatsappQueueReport']=function(_0xa7ef77){var _0x488cbe=this;return new Promise(function(_0x570434,_0x351436){return db[_0xd1e1('0x1c')][_0xd1e1('0x1d')](_0xa7ef77[_0xd1e1('0x18')],{'raw':_0xa7ef77[_0xd1e1('0x19')]?_0xa7ef77['options'][_0xd1e1('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa7ef77[_0xd1e1('0x19')]?_0xa7ef77[_0xd1e1('0x19')][_0xd1e1('0x1e')]||null:null,'attributes':_0xa7ef77[_0xd1e1('0x19')]?_0xa7ef77[_0xd1e1('0x19')][_0xd1e1('0x1f')]||null:null,'limit':_0xa7ef77[_0xd1e1('0x19')]?_0xa7ef77[_0xd1e1('0x19')][_0xd1e1('0x20')]||null:null})[_0xd1e1('0xc')](function(_0x47d2b4){logger[_0xd1e1('0xd')]('UpdateWhatsappQueueReport',_0xa7ef77);logger[_0xd1e1('0x10')](_0xd1e1('0x21'),_0xa7ef77,JSON[_0xd1e1('0x1b')](_0x47d2b4));_0x570434(_0x47d2b4);})[_0xd1e1('0x15')](function(_0x30145b){logger[_0xd1e1('0x11')](_0xd1e1('0x21'),_0x30145b[_0xd1e1('0x13')],_0xa7ef77);_0x351436(_0x488cbe[_0xd1e1('0x11')](0x1f4,_0x30145b[_0xd1e1('0x13')]));});});};
\ No newline at end of file
+var _0xcc56=['debug','UpdateWhatsappQueueReport','WhatsappQueueReport','update','attributes','limit','info','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','client','http','request','then','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','WhatsappQueueReport,\x20%s,\x20%s','result','catch','CreateWhatsappQueueReport','body','options','raw'];(function(_0x4c5b70,_0x290ef3){var _0x2cb607=function(_0x552d0a){while(--_0x552d0a){_0x4c5b70['push'](_0x4c5b70['shift']());}};_0x2cb607(++_0x290ef3);}(_0xcc56,0x133));var _0x6cc5=function(_0x5101b8,_0xe57d1d){_0x5101b8=_0x5101b8-0x0;var _0x4644e0=_0xcc56[_0x5101b8];return _0x4644e0;};'use strict';var _=require(_0x6cc5('0x0'));var util=require(_0x6cc5('0x1'));var moment=require(_0x6cc5('0x2'));var BPromise=require('bluebird');var rs=require(_0x6cc5('0x3'));var fs=require('fs');var Redis=require(_0x6cc5('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6cc5('0x5'))(_0x6cc5('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6cc5('0x7')][_0x6cc5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x402784,_0x32fa7a,_0x1ae4c5){return new BPromise(function(_0x4de25d,_0x1c2354){return client[_0x6cc5('0x9')](_0x402784,_0x1ae4c5)[_0x6cc5('0xa')](function(_0x55c559){logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x32fa7a,_0x6cc5('0xb'));logger['debug'](_0x6cc5('0xc'),_0x32fa7a,_0x6cc5('0xb'),JSON[_0x6cc5('0xd')](_0x55c559));if(_0x55c559[_0x6cc5('0xe')]){if(_0x55c559[_0x6cc5('0xe')]['code']===0x1f4){logger[_0x6cc5('0xe')]('WhatsappQueueReport,\x20%s,\x20%s',_0x32fa7a,_0x55c559[_0x6cc5('0xe')][_0x6cc5('0xf')]);return _0x1c2354(_0x55c559[_0x6cc5('0xe')][_0x6cc5('0xf')]);}logger[_0x6cc5('0xe')](_0x6cc5('0x10'),_0x32fa7a,_0x55c559['error'][_0x6cc5('0xf')]);return _0x4de25d(_0x55c559['error'][_0x6cc5('0xf')]);}else{logger['info']('WhatsappQueueReport,\x20%s,\x20%s',_0x32fa7a,_0x6cc5('0xb'));_0x4de25d(_0x55c559[_0x6cc5('0x11')]['message']);}})[_0x6cc5('0x12')](function(_0x19afe9){logger[_0x6cc5('0xe')](_0x6cc5('0x10'),_0x32fa7a,_0x19afe9);_0x1c2354(_0x19afe9);});});}exports[_0x6cc5('0x13')]=function(_0x4759f4){var _0x45d344=this;return new Promise(function(_0x1b1cdf,_0x1cc40b){return db['WhatsappQueueReport']['create'](_0x4759f4[_0x6cc5('0x14')],{'raw':_0x4759f4[_0x6cc5('0x15')]?_0x4759f4[_0x6cc5('0x15')][_0x6cc5('0x16')]===undefined?!![]:![]:!![]})[_0x6cc5('0xa')](function(_0xf3a761){logger['info']('CreateWhatsappQueueReport',_0x4759f4);logger[_0x6cc5('0x17')]('CreateWhatsappQueueReport',_0x4759f4,JSON[_0x6cc5('0xd')](_0xf3a761));_0x1b1cdf(_0xf3a761);})[_0x6cc5('0x12')](function(_0x4e5612){logger[_0x6cc5('0xe')](_0x6cc5('0x13'),_0x4e5612[_0x6cc5('0xf')],_0x4759f4);_0x1cc40b(_0x45d344[_0x6cc5('0xe')](0x1f4,_0x4e5612[_0x6cc5('0xf')]));});});};exports[_0x6cc5('0x18')]=function(_0x1bcaa6){var _0x3ae720=this;return new Promise(function(_0x2b13bb,_0x5d147c){return db[_0x6cc5('0x19')][_0x6cc5('0x1a')](_0x1bcaa6['body'],{'raw':_0x1bcaa6[_0x6cc5('0x15')]?_0x1bcaa6[_0x6cc5('0x15')][_0x6cc5('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bcaa6['options']?_0x1bcaa6['options']['where']||null:null,'attributes':_0x1bcaa6[_0x6cc5('0x15')]?_0x1bcaa6[_0x6cc5('0x15')][_0x6cc5('0x1b')]||null:null,'limit':_0x1bcaa6[_0x6cc5('0x15')]?_0x1bcaa6[_0x6cc5('0x15')][_0x6cc5('0x1c')]||null:null})[_0x6cc5('0xa')](function(_0x4a3e58){logger[_0x6cc5('0x1d')](_0x6cc5('0x18'),_0x1bcaa6);logger[_0x6cc5('0x17')](_0x6cc5('0x18'),_0x1bcaa6,JSON['stringify'](_0x4a3e58));_0x2b13bb(_0x4a3e58);})['catch'](function(_0x388012){logger['error'](_0x6cc5('0x18'),_0x388012[_0x6cc5('0xf')],_0x1bcaa6);_0x5d147c(_0x3ae720[_0x6cc5('0xe')](0x1f4,_0x388012[_0x6cc5('0xf')]));});});};
\ No newline at end of file
index 652ffc0..3f2f7e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x112e=['../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','index','/describe','describe','get','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x50368e,_0x5b09f1){var _0x36c76e=function(_0x32959b){while(--_0x32959b){_0x50368e['push'](_0x50368e['shift']());}};_0x36c76e(++_0x5b09f1);}(_0x112e,0x180));var _0xe112=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x112e[_0x36eaaa];return _0x461349;};'use strict';var multer=require(_0xe112('0x0'));var util=require(_0xe112('0x1'));var path=require(_0xe112('0x2'));var timeout=require('connect-timeout');var express=require(_0xe112('0x3'));var router=express[_0xe112('0x4')]();var fs_extra=require(_0xe112('0x5'));var auth=require(_0xe112('0x6'));var interaction=require(_0xe112('0x7'));var config=require(_0xe112('0x8'));var controller=require(_0xe112('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xe112('0xa')]);router['get'](_0xe112('0xb'),auth['isAuthenticated'](),controller[_0xe112('0xc')]);router[_0xe112('0xd')](_0xe112('0xe'),auth[_0xe112('0xf')](),controller[_0xe112('0x10')]);router['post']('/',auth[_0xe112('0xf')](),controller[_0xe112('0x11')]);router[_0xe112('0x12')](_0xe112('0xe'),auth[_0xe112('0xf')](),controller[_0xe112('0x13')]);router[_0xe112('0x14')]('/:id',auth[_0xe112('0xf')](),controller[_0xe112('0x15')]);module[_0xe112('0x16')]=router;
\ No newline at end of file
+var _0x0d71=['get','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappTransferReport.controller','isAuthenticated','index'];(function(_0x53b6f0,_0x134603){var _0xcbc09d=function(_0x47d7f8){while(--_0x47d7f8){_0x53b6f0['push'](_0x53b6f0['shift']());}};_0xcbc09d(++_0x134603);}(_0x0d71,0xf3));var _0x10d7=function(_0x100ef3,_0x35506f){_0x100ef3=_0x100ef3-0x0;var _0x5ed843=_0x0d71[_0x100ef3];return _0x5ed843;};'use strict';var multer=require(_0x10d7('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x10d7('0x1'));var router=express[_0x10d7('0x2')]();var fs_extra=require(_0x10d7('0x3'));var auth=require(_0x10d7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x10d7('0x5'));var controller=require(_0x10d7('0x6'));router['get']('/',auth[_0x10d7('0x7')](),controller[_0x10d7('0x8')]);router[_0x10d7('0x9')](_0x10d7('0xa'),auth['isAuthenticated'](),controller[_0x10d7('0xb')]);router[_0x10d7('0x9')](_0x10d7('0xc'),auth[_0x10d7('0x7')](),controller[_0x10d7('0xd')]);router[_0x10d7('0xe')]('/',auth['isAuthenticated'](),controller[_0x10d7('0xf')]);router[_0x10d7('0x10')](_0x10d7('0xc'),auth[_0x10d7('0x7')](),controller[_0x10d7('0x11')]);router[_0x10d7('0x12')](_0x10d7('0xc'),auth[_0x10d7('0x7')](),controller[_0x10d7('0x13')]);module[_0x10d7('0x14')]=router;
\ No newline at end of file
index 5a31110..3cf514e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0c71=['ENUM','account','agent','exports'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x0c71,0xfb));var _0x10c7=function(_0xe3daba,_0x584f33){_0xe3daba=_0xe3daba-0x0;var _0xc26766=_0x0c71[_0xe3daba];return _0xc26766;};'use strict';var Sequelize=require('sequelize');module[_0x10c7('0x0')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x10c7('0x1')](_0x10c7('0x2'),_0x10c7('0x3'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}};
\ No newline at end of file
+var _0xab54=['DATE','exports','STRING','ENUM','account','agent'];(function(_0x55850c,_0x229051){var _0x32d952=function(_0x31e80d){while(--_0x31e80d){_0x55850c['push'](_0x55850c['shift']());}};_0x32d952(++_0x229051);}(_0xab54,0x115));var _0x4ab5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xab54[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x4ab5('0x0')]={'uniqueid':{'type':Sequelize[_0x4ab5('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x4ab5('0x2')](_0x4ab5('0x3'),_0x4ab5('0x4'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x4ab5('0x5')]}};
\ No newline at end of file
index 2cd4582..fee7b4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0648=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','then','destroy','end','error','stack','name','send','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','map','VIRTUAL','options','includeAll','include','WhatsappTransferReport','rows','catch','rawAttributes','find','body','update','params','describe','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x590ef3,_0x3b2dd2){var _0x4502be=function(_0x2c8011){while(--_0x2c8011){_0x590ef3['push'](_0x590ef3['shift']());}};_0x4502be(++_0x3b2dd2);}(_0x0648,0x1a5));var _0x8064=function(_0x2e3e74,_0x37a85c){_0x2e3e74=_0x2e3e74-0x0;var _0x1a3156=_0x0648[_0x2e3e74];return _0x1a3156;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8064('0x0'));var jsonpatch=require(_0x8064('0x1'));var rp=require(_0x8064('0x2'));var moment=require('moment');var BPromise=require(_0x8064('0x3'));var Mustache=require('mustache');var util=require(_0x8064('0x4'));var path=require(_0x8064('0x5'));var sox=require(_0x8064('0x6'));var csv=require(_0x8064('0x7'));var ejs=require(_0x8064('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8064('0x9'));var squel=require(_0x8064('0xa'));var crypto=require(_0x8064('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8064('0xc'));var toCsv=require(_0x8064('0x7'));var querystring=require('querystring');var Papa=require(_0x8064('0xd'));var Redis=require(_0x8064('0xe'));var authService=require(_0x8064('0xf'));var qs=require(_0x8064('0x10'));var as=require(_0x8064('0x11'));var hardwareService=require(_0x8064('0x12'));var logger=require(_0x8064('0x13'))(_0x8064('0x14'));var utils=require(_0x8064('0x15'));var config=require(_0x8064('0x16'));var licenseUtil=require(_0x8064('0x17'));var db=require(_0x8064('0x18'))['db'];function respondWithStatusCode(_0x18fa74,_0x33b7f7){_0x33b7f7=_0x33b7f7||0xcc;return function(_0x162e1f){if(_0x162e1f){return _0x18fa74[_0x8064('0x19')](_0x33b7f7);}return _0x18fa74['status'](_0x33b7f7)['end']();};}function respondWithResult(_0x487cff,_0x5e2ff0){_0x5e2ff0=_0x5e2ff0||0xc8;return function(_0x13c799){if(_0x13c799){return _0x487cff['status'](_0x5e2ff0)[_0x8064('0x1a')](_0x13c799);}};}function respondWithFilteredResult(_0x9ab5c4,_0xb55bc8){return function(_0x1e5054){if(_0x1e5054){var _0x5ee9a5=typeof _0xb55bc8[_0x8064('0x1b')]===_0x8064('0x1c')&&typeof _0xb55bc8[_0x8064('0x1d')]===_0x8064('0x1c');var _0x33b1e0=_0x1e5054[_0x8064('0x1e')];var _0x245e27=_0x5ee9a5?0x0:_0xb55bc8[_0x8064('0x1b')];var _0x1e9eea=_0x5ee9a5?_0x1e5054[_0x8064('0x1e')]:_0xb55bc8['offset']+_0xb55bc8[_0x8064('0x1d')];var _0x54324d;if(_0x1e9eea>=_0x33b1e0){_0x1e9eea=_0x33b1e0;_0x54324d=0xc8;}else{_0x54324d=0xce;}_0x9ab5c4[_0x8064('0x1f')](_0x54324d);return _0x9ab5c4[_0x8064('0x20')](_0x8064('0x21'),_0x245e27+'-'+_0x1e9eea+'/'+_0x33b1e0)['json'](_0x1e5054);}return null;};}function patchUpdates(_0x2ec89d){return function(_0x1e02c4){try{jsonpatch[_0x8064('0x22')](_0x1e02c4,_0x2ec89d,!![]);}catch(_0x29ffac){return BPromise[_0x8064('0x23')](_0x29ffac);}return _0x1e02c4['save']();};}function saveUpdates(_0xfb97d0,_0x2f9f7f){return function(_0x7549e4){if(_0x7549e4){return _0x7549e4['update'](_0xfb97d0)[_0x8064('0x24')](function(_0x316b46){return _0x316b46;});}return null;};}function removeEntity(_0x1b2d92,_0x53a811){return function(_0x20ce5b){if(_0x20ce5b){return _0x20ce5b[_0x8064('0x25')]()[_0x8064('0x24')](function(){_0x1b2d92[_0x8064('0x1f')](0xcc)[_0x8064('0x26')]();});}};}function handleEntityNotFound(_0x7f1866,_0x4755bd){return function(_0x2420d1){if(!_0x2420d1){_0x7f1866['sendStatus'](0x194);}return _0x2420d1;};}function handleError(_0x5610bf,_0x45f65c){_0x45f65c=_0x45f65c||0x1f4;return function(_0xaf0f95){logger[_0x8064('0x27')](_0xaf0f95[_0x8064('0x28')]);if(_0xaf0f95['name']){delete _0xaf0f95[_0x8064('0x29')];}_0x5610bf[_0x8064('0x1f')](_0x45f65c)[_0x8064('0x2a')](_0xaf0f95);};}exports['index']=function(_0x450812,_0x1c0ba8){var _0x28c05d={},_0x53bdb5={},_0x5e8cbb={'count':0x0,'rows':[]};var _0x5bea7d=_['map'](db['WhatsappTransferReport']['rawAttributes'],function(_0x4b585f){return{'name':_0x4b585f['fieldName'],'type':_0x4b585f[_0x8064('0x2b')]['key']};});_0x53bdb5[_0x8064('0x2c')]=_['map'](_0x5bea7d,_0x8064('0x29'));_0x53bdb5[_0x8064('0x2d')]=_[_0x8064('0x2e')](_0x450812['query']);_0x53bdb5[_0x8064('0x2f')]=_[_0x8064('0x30')](_0x53bdb5['model'],_0x53bdb5[_0x8064('0x2d')]);_0x28c05d[_0x8064('0x31')]=_[_0x8064('0x30')](_0x53bdb5[_0x8064('0x2c')],qs[_0x8064('0x32')](_0x450812[_0x8064('0x2d')][_0x8064('0x32')]));_0x28c05d[_0x8064('0x31')]=_0x28c05d[_0x8064('0x31')][_0x8064('0x33')]?_0x28c05d['attributes']:_0x53bdb5[_0x8064('0x2c')];if(!_0x450812[_0x8064('0x2d')][_0x8064('0x34')](_0x8064('0x35'))){_0x28c05d[_0x8064('0x1d')]=qs[_0x8064('0x1d')](_0x450812['query']['limit']);_0x28c05d[_0x8064('0x1b')]=qs[_0x8064('0x1b')](_0x450812[_0x8064('0x2d')]['offset']);}_0x28c05d[_0x8064('0x36')]=qs['sort'](_0x450812['query'][_0x8064('0x37')]);_0x28c05d['where']=qs[_0x8064('0x2f')](_[_0x8064('0x38')](_0x450812['query'],_0x53bdb5[_0x8064('0x2f')]),_0x5bea7d);if(_0x450812['query']['filter']){_0x28c05d[_0x8064('0x39')]=_[_0x8064('0x3a')](_0x28c05d[_0x8064('0x39')],{'$or':_[_0x8064('0x3b')](_0x5bea7d,function(_0x571347){if(_0x571347[_0x8064('0x2b')]!==_0x8064('0x3c')){var _0x147427={};_0x147427[_0x571347[_0x8064('0x29')]]={'$like':'%'+_0x450812[_0x8064('0x2d')]['filter']+'%'};return _0x147427;}})});}_0x28c05d=_['merge']({},_0x28c05d,_0x450812[_0x8064('0x3d')]);var _0x2cdc2d={'where':_0x28c05d[_0x8064('0x39')]};return db['WhatsappTransferReport'][_0x8064('0x1e')](_0x2cdc2d)['then'](function(_0x58d0d0){_0x5e8cbb[_0x8064('0x1e')]=_0x58d0d0;if(_0x450812['query'][_0x8064('0x3e')]){_0x28c05d[_0x8064('0x3f')]=[{'all':!![]}];}return db[_0x8064('0x40')]['findAll'](_0x28c05d);})[_0x8064('0x24')](function(_0x1289c0){_0x5e8cbb[_0x8064('0x41')]=_0x1289c0;return _0x5e8cbb;})[_0x8064('0x24')](respondWithFilteredResult(_0x1c0ba8,_0x28c05d))[_0x8064('0x42')](handleError(_0x1c0ba8,null));};exports['show']=function(_0x4442ba,_0x546b6b){var _0x24c364={'raw':!![],'where':{'id':_0x4442ba['params']['id']}},_0x2bf217={};_0x2bf217[_0x8064('0x2c')]=_['keys'](db[_0x8064('0x40')][_0x8064('0x43')]);_0x2bf217['query']=_[_0x8064('0x2e')](_0x4442ba[_0x8064('0x2d')]);_0x2bf217['filters']=_[_0x8064('0x30')](_0x2bf217['model'],_0x2bf217['query']);_0x24c364[_0x8064('0x31')]=_[_0x8064('0x30')](_0x2bf217[_0x8064('0x2c')],qs[_0x8064('0x32')](_0x4442ba[_0x8064('0x2d')]['fields']));_0x24c364[_0x8064('0x31')]=_0x24c364['attributes']['length']?_0x24c364[_0x8064('0x31')]:_0x2bf217[_0x8064('0x2c')];if(_0x4442ba[_0x8064('0x2d')][_0x8064('0x3e')]){_0x24c364[_0x8064('0x3f')]=[{'all':!![]}];}_0x24c364=_[_0x8064('0x3a')]({},_0x24c364,_0x4442ba[_0x8064('0x3d')]);return db['WhatsappTransferReport'][_0x8064('0x44')](_0x24c364)[_0x8064('0x24')](handleEntityNotFound(_0x546b6b,null))[_0x8064('0x24')](respondWithResult(_0x546b6b,null))[_0x8064('0x42')](handleError(_0x546b6b,null));};exports['create']=function(_0x552bca,_0x23afd8){return db[_0x8064('0x40')]['create'](_0x552bca[_0x8064('0x45')],{})[_0x8064('0x24')](respondWithResult(_0x23afd8,0xc9))[_0x8064('0x42')](handleError(_0x23afd8,null));};exports[_0x8064('0x46')]=function(_0x2d899a,_0x53f46e){if(_0x2d899a[_0x8064('0x45')]['id']){delete _0x2d899a[_0x8064('0x45')]['id'];}return db[_0x8064('0x40')][_0x8064('0x44')]({'where':{'id':_0x2d899a['params']['id']}})[_0x8064('0x24')](handleEntityNotFound(_0x53f46e,null))[_0x8064('0x24')](saveUpdates(_0x2d899a[_0x8064('0x45')],null))[_0x8064('0x24')](respondWithResult(_0x53f46e,null))[_0x8064('0x42')](handleError(_0x53f46e,null));};exports[_0x8064('0x25')]=function(_0x1fa383,_0x20d450){return db[_0x8064('0x40')][_0x8064('0x44')]({'where':{'id':_0x1fa383[_0x8064('0x47')]['id']}})[_0x8064('0x24')](handleEntityNotFound(_0x20d450,null))[_0x8064('0x24')](removeEntity(_0x20d450,null))[_0x8064('0x42')](handleError(_0x20d450,null));};exports[_0x8064('0x48')]=function(_0x2d1c50,_0x16a65a){return db[_0x8064('0x40')][_0x8064('0x48')]()[_0x8064('0x24')](respondWithResult(_0x16a65a,null))[_0x8064('0x42')](handleError(_0x16a65a,null));};
\ No newline at end of file
+var _0x241f=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','json','offset','limit','count','status','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','WhatsappTransferReport','findAll','rows','catch','params','rawAttributes','find','create','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv'];(function(_0x174121,_0x308d62){var _0x2d5667=function(_0x4e6c57){while(--_0x4e6c57){_0x174121['push'](_0x174121['shift']());}};_0x2d5667(++_0x308d62);}(_0x241f,0x123));var _0xf241=function(_0x198247,_0x491c12){_0x198247=_0x198247-0x0;var _0x2b18bc=_0x241f[_0x198247];return _0x2b18bc;};'use strict';var emlformat=require(_0xf241('0x0'));var rimraf=require(_0xf241('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf241('0x2'));var rp=require('request-promise');var moment=require(_0xf241('0x3'));var BPromise=require(_0xf241('0x4'));var Mustache=require(_0xf241('0x5'));var util=require(_0xf241('0x6'));var path=require(_0xf241('0x7'));var sox=require(_0xf241('0x8'));var csv=require('to-csv');var ejs=require(_0xf241('0x9'));var fs=require('fs');var fs_extra=require(_0xf241('0xa'));var _=require(_0xf241('0xb'));var squel=require(_0xf241('0xc'));var crypto=require(_0xf241('0xd'));var jsforce=require(_0xf241('0xe'));var deskjs=require(_0xf241('0xf'));var toCsv=require(_0xf241('0x10'));var querystring=require(_0xf241('0x11'));var Papa=require(_0xf241('0x12'));var Redis=require(_0xf241('0x13'));var authService=require(_0xf241('0x14'));var qs=require(_0xf241('0x15'));var as=require(_0xf241('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf241('0x17'))(_0xf241('0x18'));var utils=require(_0xf241('0x19'));var config=require(_0xf241('0x1a'));var licenseUtil=require(_0xf241('0x1b'));var db=require(_0xf241('0x1c'))['db'];function respondWithStatusCode(_0x3dee4f,_0x39b014){_0x39b014=_0x39b014||0xcc;return function(_0x29bb22){if(_0x29bb22){return _0x3dee4f[_0xf241('0x1d')](_0x39b014);}return _0x3dee4f['status'](_0x39b014)['end']();};}function respondWithResult(_0x3b9ced,_0x171d13){_0x171d13=_0x171d13||0xc8;return function(_0x135569){if(_0x135569){return _0x3b9ced['status'](_0x171d13)[_0xf241('0x1e')](_0x135569);}};}function respondWithFilteredResult(_0x1e7a05,_0x4b1c93){return function(_0x224414){if(_0x224414){var _0x26d295=typeof _0x4b1c93[_0xf241('0x1f')]==='undefined'&&typeof _0x4b1c93[_0xf241('0x20')]==='undefined';var _0x12e82c=_0x224414[_0xf241('0x21')];var _0x4d6d8e=_0x26d295?0x0:_0x4b1c93[_0xf241('0x1f')];var _0x1a7a50=_0x26d295?_0x224414[_0xf241('0x21')]:_0x4b1c93[_0xf241('0x1f')]+_0x4b1c93['limit'];var _0x2a3b8f;if(_0x1a7a50>=_0x12e82c){_0x1a7a50=_0x12e82c;_0x2a3b8f=0xc8;}else{_0x2a3b8f=0xce;}_0x1e7a05[_0xf241('0x22')](_0x2a3b8f);return _0x1e7a05['set'](_0xf241('0x23'),_0x4d6d8e+'-'+_0x1a7a50+'/'+_0x12e82c)[_0xf241('0x1e')](_0x224414);}return null;};}function patchUpdates(_0x391574){return function(_0x599763){try{jsonpatch[_0xf241('0x24')](_0x599763,_0x391574,!![]);}catch(_0x438f38){return BPromise[_0xf241('0x25')](_0x438f38);}return _0x599763['save']();};}function saveUpdates(_0x76775d,_0xa92627){return function(_0x5c10e8){if(_0x5c10e8){return _0x5c10e8[_0xf241('0x26')](_0x76775d)[_0xf241('0x27')](function(_0x1c6424){return _0x1c6424;});}return null;};}function removeEntity(_0x20c9f8,_0x13f1b4){return function(_0x3ccc35){if(_0x3ccc35){return _0x3ccc35[_0xf241('0x28')]()['then'](function(){_0x20c9f8[_0xf241('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x40f3a2,_0x14318f){return function(_0x5de606){if(!_0x5de606){_0x40f3a2[_0xf241('0x1d')](0x194);}return _0x5de606;};}function handleError(_0x572564,_0x4cd4f5){_0x4cd4f5=_0x4cd4f5||0x1f4;return function(_0x2d6945){logger[_0xf241('0x29')](_0x2d6945[_0xf241('0x2a')]);if(_0x2d6945[_0xf241('0x2b')]){delete _0x2d6945[_0xf241('0x2b')];}_0x572564[_0xf241('0x22')](_0x4cd4f5)[_0xf241('0x2c')](_0x2d6945);};}exports[_0xf241('0x2d')]=function(_0x5e934e,_0x57c7d1){var _0x283388={},_0x420e68={},_0x243552={'count':0x0,'rows':[]};var _0x3c09ab=_[_0xf241('0x2e')](db['WhatsappTransferReport']['rawAttributes'],function(_0x5d0ab2){return{'name':_0x5d0ab2['fieldName'],'type':_0x5d0ab2['type'][_0xf241('0x2f')]};});_0x420e68[_0xf241('0x30')]=_[_0xf241('0x2e')](_0x3c09ab,_0xf241('0x2b'));_0x420e68[_0xf241('0x31')]=_[_0xf241('0x32')](_0x5e934e[_0xf241('0x31')]);_0x420e68[_0xf241('0x33')]=_[_0xf241('0x34')](_0x420e68[_0xf241('0x30')],_0x420e68[_0xf241('0x31')]);_0x283388[_0xf241('0x35')]=_[_0xf241('0x34')](_0x420e68[_0xf241('0x30')],qs[_0xf241('0x36')](_0x5e934e[_0xf241('0x31')]['fields']));_0x283388['attributes']=_0x283388[_0xf241('0x35')][_0xf241('0x37')]?_0x283388[_0xf241('0x35')]:_0x420e68[_0xf241('0x30')];if(!_0x5e934e[_0xf241('0x31')][_0xf241('0x38')](_0xf241('0x39'))){_0x283388[_0xf241('0x20')]=qs['limit'](_0x5e934e['query'][_0xf241('0x20')]);_0x283388['offset']=qs[_0xf241('0x1f')](_0x5e934e[_0xf241('0x31')][_0xf241('0x1f')]);}_0x283388[_0xf241('0x3a')]=qs['sort'](_0x5e934e[_0xf241('0x31')][_0xf241('0x3b')]);_0x283388[_0xf241('0x3c')]=qs['filters'](_[_0xf241('0x3d')](_0x5e934e['query'],_0x420e68[_0xf241('0x33')]),_0x3c09ab);if(_0x5e934e['query'][_0xf241('0x3e')]){_0x283388[_0xf241('0x3c')]=_['merge'](_0x283388[_0xf241('0x3c')],{'$or':_['map'](_0x3c09ab,function(_0x2c0e05){if(_0x2c0e05['type']!==_0xf241('0x3f')){var _0x3a9376={};_0x3a9376[_0x2c0e05[_0xf241('0x2b')]]={'$like':'%'+_0x5e934e['query']['filter']+'%'};return _0x3a9376;}})});}_0x283388=_[_0xf241('0x40')]({},_0x283388,_0x5e934e[_0xf241('0x41')]);var _0x2559ab={'where':_0x283388[_0xf241('0x3c')]};return db['WhatsappTransferReport'][_0xf241('0x21')](_0x2559ab)[_0xf241('0x27')](function(_0x3c68ac){_0x243552['count']=_0x3c68ac;if(_0x5e934e['query'][_0xf241('0x42')]){_0x283388[_0xf241('0x43')]=[{'all':!![]}];}return db[_0xf241('0x44')][_0xf241('0x45')](_0x283388);})[_0xf241('0x27')](function(_0x29b7cc){_0x243552[_0xf241('0x46')]=_0x29b7cc;return _0x243552;})[_0xf241('0x27')](respondWithFilteredResult(_0x57c7d1,_0x283388))[_0xf241('0x47')](handleError(_0x57c7d1,null));};exports['show']=function(_0x16ba9c,_0x1d74d2){var _0x2c5184={'raw':!![],'where':{'id':_0x16ba9c[_0xf241('0x48')]['id']}},_0x5ac369={};_0x5ac369['model']=_[_0xf241('0x32')](db[_0xf241('0x44')][_0xf241('0x49')]);_0x5ac369[_0xf241('0x31')]=_[_0xf241('0x32')](_0x16ba9c[_0xf241('0x31')]);_0x5ac369[_0xf241('0x33')]=_[_0xf241('0x34')](_0x5ac369['model'],_0x5ac369[_0xf241('0x31')]);_0x2c5184[_0xf241('0x35')]=_[_0xf241('0x34')](_0x5ac369['model'],qs[_0xf241('0x36')](_0x16ba9c[_0xf241('0x31')][_0xf241('0x36')]));_0x2c5184[_0xf241('0x35')]=_0x2c5184[_0xf241('0x35')][_0xf241('0x37')]?_0x2c5184[_0xf241('0x35')]:_0x5ac369[_0xf241('0x30')];if(_0x16ba9c[_0xf241('0x31')][_0xf241('0x42')]){_0x2c5184[_0xf241('0x43')]=[{'all':!![]}];}_0x2c5184=_[_0xf241('0x40')]({},_0x2c5184,_0x16ba9c[_0xf241('0x41')]);return db[_0xf241('0x44')][_0xf241('0x4a')](_0x2c5184)[_0xf241('0x27')](handleEntityNotFound(_0x1d74d2,null))[_0xf241('0x27')](respondWithResult(_0x1d74d2,null))[_0xf241('0x47')](handleError(_0x1d74d2,null));};exports['create']=function(_0x37b524,_0x4ce19f){return db[_0xf241('0x44')][_0xf241('0x4b')](_0x37b524['body'],{})[_0xf241('0x27')](respondWithResult(_0x4ce19f,0xc9))[_0xf241('0x47')](handleError(_0x4ce19f,null));};exports[_0xf241('0x26')]=function(_0x25d61f,_0x5dd37d){if(_0x25d61f['body']['id']){delete _0x25d61f['body']['id'];}return db[_0xf241('0x44')][_0xf241('0x4a')]({'where':{'id':_0x25d61f[_0xf241('0x48')]['id']}})[_0xf241('0x27')](handleEntityNotFound(_0x5dd37d,null))['then'](saveUpdates(_0x25d61f['body'],null))[_0xf241('0x27')](respondWithResult(_0x5dd37d,null))['catch'](handleError(_0x5dd37d,null));};exports['destroy']=function(_0x199eba,_0x137744){return db['WhatsappTransferReport']['find']({'where':{'id':_0x199eba[_0xf241('0x48')]['id']}})[_0xf241('0x27')](handleEntityNotFound(_0x137744,null))[_0xf241('0x27')](removeEntity(_0x137744,null))[_0xf241('0x47')](handleError(_0x137744,null));};exports[_0xf241('0x4c')]=function(_0x4d6bc4,_0x2895f6){return db[_0xf241('0x44')][_0xf241('0x4c')]()[_0xf241('0x27')](respondWithResult(_0x2895f6,null))[_0xf241('0x47')](handleError(_0x2895f6,null));};
\ No newline at end of file
index 6c78a2c..e3581d9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2d1e=['moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api'];(function(_0x309458,_0xba6e63){var _0x3306ee=function(_0x47e10c){while(--_0x47e10c){_0x309458['push'](_0x309458['shift']());}};_0x3306ee(++_0xba6e63);}(_0x2d1e,0xcc));var _0xe2d1=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x2d1e[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xe2d1('0x0'));var util=require(_0xe2d1('0x1'));var logger=require(_0xe2d1('0x2'))(_0xe2d1('0x3'));var moment=require(_0xe2d1('0x4'));var BPromise=require(_0xe2d1('0x5'));var rp=require(_0xe2d1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2d1('0x7'));var config=require(_0xe2d1('0x8'));var attributes=require(_0xe2d1('0x9'));module[_0xe2d1('0xa')]=function(_0x4f38ba,_0x5b2f80){return _0x4f38ba['define']('WhatsappTransferReport',attributes,{'tableName':_0xe2d1('0xb'),'paranoid':![],'indexes':[{'name':_0xe2d1('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x443a=['../../config/logger','moment','path','../../config/environment','./whatsappTransferReport.attributes','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util'];(function(_0x55b6fb,_0x888180){var _0xfa142c=function(_0x44c6a6){while(--_0x44c6a6){_0x55b6fb['push'](_0x55b6fb['shift']());}};_0xfa142c(++_0x888180);}(_0x443a,0x12a));var _0xa443=function(_0x3b3c4d,_0x378062){_0x3b3c4d=_0x3b3c4d-0x0;var _0xc4b72c=_0x443a[_0x3b3c4d];return _0xc4b72c;};'use strict';var _=require(_0xa443('0x0'));var util=require(_0xa443('0x1'));var logger=require(_0xa443('0x2'))('api');var moment=require(_0xa443('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa443('0x4'));var rimraf=require('rimraf');var config=require(_0xa443('0x5'));var attributes=require(_0xa443('0x6'));module['exports']=function(_0xd57bab,_0x4ea5d0){return _0xd57bab['define'](_0xa443('0x7'),attributes,{'tableName':_0xa443('0x8'),'paranoid':![],'indexes':[{'name':_0xa443('0x9'),'fields':[_0xa443('0x9')]}],'timestamps':!![]});};
\ No newline at end of file
index 38b5316..c1e3ea4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0875=['rpc','jayson/promise','client','http','request','then','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/logger'];(function(_0x14a8bc,_0x23b0ac){var _0x54fe72=function(_0x3587a4){while(--_0x3587a4){_0x14a8bc['push'](_0x14a8bc['shift']());}};_0x54fe72(++_0x23b0ac);}(_0x0875,0x18b));var _0x5087=function(_0x3e6a03,_0x38bb42){_0x3e6a03=_0x3e6a03-0x0;var _0x2b3ce2=_0x0875[_0x3e6a03];return _0x2b3ce2;};'use strict';var _=require(_0x5087('0x0'));var util=require(_0x5087('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5087('0x2'));var fs=require('fs');var Redis=require(_0x5087('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5087('0x4'))(_0x5087('0x5'));var config=require('../../config/environment');var jayson=require(_0x5087('0x6'));var client=jayson[_0x5087('0x7')][_0x5087('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1072ba,_0x3e2dfe,_0x36f4fb){return new BPromise(function(_0x282199,_0x2d51cc){return client[_0x5087('0x9')](_0x1072ba,_0x36f4fb)[_0x5087('0xa')](function(_0x3e9705){logger['info'](_0x5087('0xb'),_0x3e2dfe,_0x5087('0xc'));logger['debug'](_0x5087('0xd'),_0x3e2dfe,'request\x20sent',JSON[_0x5087('0xe')](_0x3e9705));if(_0x3e9705[_0x5087('0xf')]){if(_0x3e9705[_0x5087('0xf')][_0x5087('0x10')]===0x1f4){logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x3e2dfe,_0x3e9705[_0x5087('0xf')]['message']);return _0x2d51cc(_0x3e9705['error'][_0x5087('0x11')]);}logger[_0x5087('0xf')](_0x5087('0xb'),_0x3e2dfe,_0x3e9705[_0x5087('0xf')][_0x5087('0x11')]);return _0x282199(_0x3e9705[_0x5087('0xf')]['message']);}else{logger['info']('WhatsappTransferReport,\x20%s,\x20%s',_0x3e2dfe,_0x5087('0xc'));_0x282199(_0x3e9705[_0x5087('0x12')][_0x5087('0x11')]);}})[_0x5087('0x13')](function(_0x491e1f){logger['error'](_0x5087('0xb'),_0x3e2dfe,_0x491e1f);_0x2d51cc(_0x491e1f);});});}
\ No newline at end of file
+var _0x0d87=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','moment','ioredis'];(function(_0xb113d7,_0x2fc306){var _0xd5a08d=function(_0x873634){while(--_0x873634){_0xb113d7['push'](_0xb113d7['shift']());}};_0xd5a08d(++_0x2fc306);}(_0x0d87,0x83));var _0x70d8=function(_0x1ee108,_0x4c67b3){_0x1ee108=_0x1ee108-0x0;var _0x215410=_0x0d87[_0x1ee108];return _0x215410;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x70d8('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x70d8('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x70d8('0x2'));var logger=require(_0x70d8('0x3'))('rpc');var config=require(_0x70d8('0x4'));var jayson=require(_0x70d8('0x5'));var client=jayson[_0x70d8('0x6')][_0x70d8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5702d7,_0x168664,_0x52f23d){return new BPromise(function(_0x3965e3,_0x32524a){return client[_0x70d8('0x8')](_0x5702d7,_0x52f23d)[_0x70d8('0x9')](function(_0x21b891){logger[_0x70d8('0xa')](_0x70d8('0xb'),_0x168664,_0x70d8('0xc'));logger[_0x70d8('0xd')]('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0x168664,_0x70d8('0xc'),JSON[_0x70d8('0xe')](_0x21b891));if(_0x21b891['error']){if(_0x21b891[_0x70d8('0xf')][_0x70d8('0x10')]===0x1f4){logger[_0x70d8('0xf')](_0x70d8('0xb'),_0x168664,_0x21b891[_0x70d8('0xf')][_0x70d8('0x11')]);return _0x32524a(_0x21b891[_0x70d8('0xf')][_0x70d8('0x11')]);}logger[_0x70d8('0xf')]('WhatsappTransferReport,\x20%s,\x20%s',_0x168664,_0x21b891[_0x70d8('0xf')]['message']);return _0x3965e3(_0x21b891[_0x70d8('0xf')][_0x70d8('0x11')]);}else{logger[_0x70d8('0xa')](_0x70d8('0xb'),_0x168664,_0x70d8('0xc'));_0x3965e3(_0x21b891[_0x70d8('0x12')][_0x70d8('0x11')]);}})['catch'](function(_0x114220){logger[_0x70d8('0xf')](_0x70d8('0xb'),_0x168664,_0x114220);_0x32524a(_0x114220);});});}
\ No newline at end of file
index 9d900f6..cded953 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4f42=['start','then','info','Online\x20apps:','map','online','name','join','Offline\x20apps:','filter','status','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/logger','app','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','listen'];(function(_0x30b045,_0x5cea47){var _0x290a8b=function(_0x3997cd){while(--_0x3997cd){_0x30b045['push'](_0x30b045['shift']());}};_0x290a8b(++_0x5cea47);}(_0x4f42,0x193));var _0x24f4=function(_0xee72d6,_0x75bcd3){_0xee72d6=_0xee72d6-0x0;var _0x39b435=_0x4f42[_0xee72d6];return _0x39b435;};'use strict';var _=require(_0x24f4('0x0'));var mysqldb=require(_0x24f4('0x1'));var rpc=require(_0x24f4('0x2'));var config=require('./config/environment');var logger=require(_0x24f4('0x3'))(_0x24f4('0x4'));var pm2=require('./config/pm2');var pm2Config=require(_0x24f4('0x5'));var schedule=require(_0x24f4('0x6'));var chat=require(_0x24f4('0x7'));var whatsapp=require(_0x24f4('0x8'));var transcribe=require(_0x24f4('0x9'));function main(){return mysqldb['db'][_0x24f4('0xa')][_0x24f4('0xb')]()['then'](function(){return rpc[_0x24f4('0xc')]();})['then'](function(_0x38755c){logger['info'](_0x38755c);return chat[_0x24f4('0xd')]();})['then'](function(){return whatsapp[_0x24f4('0xd')]();})['then'](function(){return schedule[_0x24f4('0xd')]();})[_0x24f4('0xe')](function(){return transcribe['start']();})[_0x24f4('0xe')](function(_0x1e64d5){logger[_0x24f4('0xf')](_0x1e64d5);return pm2[_0x24f4('0xd')](pm2Config);})['then'](function(_0x32e3d9){logger['info'](_0x24f4('0x10'),_[_0x24f4('0x11')](_['filter'](_0x32e3d9,{'status':_0x24f4('0x12')}),_0x24f4('0x13'))[_0x24f4('0x14')]());logger['info'](_0x24f4('0x15'),_['map'](_[_0x24f4('0x16')](_0x32e3d9,function(_0x37281f){return _0x37281f[_0x24f4('0x17')]!==_0x24f4('0x12');}),_0x24f4('0x13'))['join']()||'None');config[_0x24f4('0x18')]&&require(_0x24f4('0x19'))[_0x24f4('0x1a')]();require(_0x24f4('0x1b'))[_0x24f4('0x1a')]();})[_0x24f4('0x1c')](function(_0x15ca9f){logger[_0x24f4('0x1d')](_0x24f4('0x1e'),_0x15ca9f);process[_0x24f4('0x1f')](0x1);});}main();
\ No newline at end of file
+var _0x2194=['./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','listen','info','start','map','filter','name','join','Offline\x20apps:','status','None','./config/seedDB','default','./config/license','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./rpc','./config/environment','app','./config/pm2','./config/pm2/config'];(function(_0x303a9a,_0x5e7791){var _0x35abbe=function(_0x1e342b){while(--_0x1e342b){_0x303a9a['push'](_0x303a9a['shift']());}};_0x35abbe(++_0x5e7791);}(_0x2194,0x138));var _0x4219=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0x2194[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0x4219('0x0'));var mysqldb=require(_0x4219('0x1'));var rpc=require(_0x4219('0x2'));var config=require(_0x4219('0x3'));var logger=require('./config/logger')(_0x4219('0x4'));var pm2=require(_0x4219('0x5'));var pm2Config=require(_0x4219('0x6'));var schedule=require(_0x4219('0x7'));var chat=require(_0x4219('0x8'));var whatsapp=require(_0x4219('0x9'));var transcribe=require(_0x4219('0xa'));function main(){return mysqldb['db'][_0x4219('0xb')][_0x4219('0xc')]()[_0x4219('0xd')](function(){return rpc[_0x4219('0xe')]();})[_0x4219('0xd')](function(_0xe96403){logger[_0x4219('0xf')](_0xe96403);return chat[_0x4219('0x10')]();})['then'](function(){return whatsapp[_0x4219('0x10')]();})[_0x4219('0xd')](function(){return schedule['start']();})['then'](function(){return transcribe[_0x4219('0x10')]();})['then'](function(_0x45ac52){logger['info'](_0x45ac52);return pm2[_0x4219('0x10')](pm2Config);})[_0x4219('0xd')](function(_0x3c9107){logger['info']('Online\x20apps:',_[_0x4219('0x11')](_[_0x4219('0x12')](_0x3c9107,{'status':'online'}),_0x4219('0x13'))[_0x4219('0x14')]());logger[_0x4219('0xf')](_0x4219('0x15'),_[_0x4219('0x11')](_[_0x4219('0x12')](_0x3c9107,function(_0x165bd7){return _0x165bd7[_0x4219('0x16')]!=='online';}),'name')[_0x4219('0x14')]()||_0x4219('0x17'));config['seedDB']&&require(_0x4219('0x18'))[_0x4219('0x19')]();require(_0x4219('0x1a'))['default']();})['catch'](function(_0x2096a3){logger[_0x4219('0x1b')](_0x4219('0x1c'),_0x2096a3);process['exit'](0x1);});}main();
\ No newline at end of file
index b8255b2..846f286 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb076=['phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','isAuthenticated','use','ChatInteraction','findOne','closed','disposition','then','status','unmanaged','json','Unmanaged.','Forbidden.','catch','authorization','startsWith','Basic','User','find','name','authenticate','pass','Wrong\x20credentials.','headers','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','query','sub','Setting','allowedLoginAttempts','blockDuration','isEqual','nonce','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','minutes','user','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyNonce','apiKeyIat','generateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','validatePasswordHistory','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','decryptString','splice','unshift','encryptString','join','sign','payload','options','promisify','verify','randomBytes','toString','floor','HS512','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','role','fullname','internal','email','md5secret','voicePause','chatPause','openchannelPause','pauseType','showWebBar','lastPauseAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xb076,0x15b));var _0x6b07=function(_0x23629f,_0x4b37fa){_0x23629f=_0x23629f-0x0;var _0x4d810a=_0xb076[_0x23629f];return _0x4d810a;};'use strict';var db=require(_0x6b07('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x6b07('0x1'));var licenseUtil=require(_0x6b07('0x2'));var encryptor=require(_0x6b07('0x3'));var _=require('lodash');var jwt=require(_0x6b07('0x4'));var expressJwt=require(_0x6b07('0x5'));var compose=require(_0x6b07('0x6'));var basicAuth=require(_0x6b07('0x7'));var crypto=require(_0x6b07('0x8'));var BPromise=require(_0x6b07('0x9'));var util=require(_0x6b07('0xa'));var moment=require(_0x6b07('0xb'));var validateJwt=expressJwt({'secret':config[_0x6b07('0xc')]['session']});var userAttributes=['id',_0x6b07('0xd'),_0x6b07('0xe'),'name',_0x6b07('0xf'),_0x6b07('0x10'),'userpic','permissions',_0x6b07('0x11'),_0x6b07('0x12'),_0x6b07('0x13'),'mailPause','faxPause','smsPause',_0x6b07('0x14'),_0x6b07('0x15'),_0x6b07('0x16'),'lastLoginAt',_0x6b07('0x17'),_0x6b07('0x18'),'allowmessenger',_0x6b07('0x19'),_0x6b07('0x1a'),'phoneBarAutoAnswer',_0x6b07('0x1b'),_0x6b07('0x1c'),_0x6b07('0x1d'),_0x6b07('0x1e'),_0x6b07('0x1f'),_0x6b07('0x20'),_0x6b07('0x21'),_0x6b07('0x22'),_0x6b07('0x23'),_0x6b07('0x24'),'interface',_0x6b07('0x25'),_0x6b07('0x26'),_0x6b07('0x27'),_0x6b07('0x28'),_0x6b07('0x29'),_0x6b07('0x2a'),_0x6b07('0x2b')];exports['isChatInteractionAuthorized']=function(){return this[_0x6b07('0x2c')](!![])[_0x6b07('0x2d')](function(_0x3cc1d1,_0x1717a7,_0x1547f8){if(_0x3cc1d1['user']){_0x1547f8();}else{return db[_0x6b07('0x2e')][_0x6b07('0x2f')]({'where':{'id':_0x3cc1d1['params']['id']},'attributes':['id',_0x6b07('0x30'),_0x6b07('0x31')],'raw':!![]})[_0x6b07('0x32')](function(_0x3851a8){if(_0x3851a8&&_0x3851a8[_0x6b07('0x30')]){return _0x1717a7[_0x6b07('0x33')](_0x3851a8[_0x6b07('0x31')]===_0x6b07('0x34')?0x195:0x193)[_0x6b07('0x35')]({'message':_0x3851a8['disposition']===_0x6b07('0x34')?_0x6b07('0x36'):_0x6b07('0x37')});}else{_0x1547f8();}})[_0x6b07('0x38')](function(_0x1e4821){_0x1547f8(_0x1e4821);});}});};exports[_0x6b07('0x2c')]=function isAuthenticated(_0x53cf6c){return compose()['use'](function(_0x1d7d56,_0x1bf9ba,_0x5116fa){var _0x4de0af;if(_0x1d7d56['headers'][_0x6b07('0x39')]){if(_[_0x6b07('0x3a')](_0x1d7d56['headers'][_0x6b07('0x39')],_0x6b07('0x3b'))){var _0x18ffed=basicAuth(_0x1d7d56);db[_0x6b07('0x3c')][_0x6b07('0x3d')]({'where':{'name':_0x18ffed[_0x6b07('0x3e')]}})[_0x6b07('0x32')](function(_0x381a15){if(!_0x381a15||!_0x381a15[_0x6b07('0x3f')](_0x18ffed[_0x6b07('0x40')])){return _0x1bf9ba['status'](0x191)[_0x6b07('0x35')]({'message':_0x6b07('0x41')});}_0x1d7d56['user']={'id':_0x381a15['id']};_0x5116fa();})[_0x6b07('0x38')](function(_0x5c1794){_0x5116fa(_0x5c1794);});}else if(_[_0x6b07('0x3a')](_0x1d7d56[_0x6b07('0x42')]['authorization'],_0x6b07('0x43'))){validateJwt(_0x1d7d56,_0x1bf9ba,_0x5116fa);}else{if(_0x53cf6c){_0x5116fa();}else{return _0x1bf9ba[_0x6b07('0x33')](0x193)[_0x6b07('0x35')]({'message':_0x6b07('0x44')});}}}else if(_0x1d7d56['query'][_0x6b07('0x45')]){try{var _0x3604e8={'audience':hardwareConf[_0x6b07('0x46')](),'issuer':hardwareConf[_0x6b07('0x46')]()};verifyJwt(_0x1d7d56[_0x6b07('0x47')]['apikey'],_0x3604e8)[_0x6b07('0x32')](function(_0x341926){return db[_0x6b07('0x3c')][_0x6b07('0x3d')]({'where':{'id':_0x341926[_0x6b07('0x48')]}})[_0x6b07('0x32')](function(_0x252e7b){_0x4de0af=_0x252e7b;return db[_0x6b07('0x49')][_0x6b07('0x2f')]({'where':{'id':0x1},'attributes':[_0x6b07('0x4a'),_0x6b07('0x4b')],'raw':!![]});})[_0x6b07('0x32')](function(_0x361278){if(!_0x4de0af||!_[_0x6b07('0x4c')](_0x4de0af['apiKeyNonce'],_0x341926[_0x6b07('0x4d')])){return _0x1bf9ba[_0x6b07('0x33')](0x191)[_0x6b07('0x35')]({'message':'API\x20access\x20key\x20is\x20not\x20valid\x20anymore'});}if(_0x4de0af[_0x6b07('0x4e')]){return _0x1bf9ba['status'](0x191)[_0x6b07('0x35')]({'message':_0x6b07('0x4f')});}if(_0x4de0af[_0x6b07('0x50')]){if(_0x361278[_0x6b07('0x4b')]>0x0){if(moment(_0x4de0af[_0x6b07('0x51')])['add'](_0x361278[_0x6b07('0x4b')],_0x6b07('0x52'))>moment()){return _0x1bf9ba[_0x6b07('0x33')](0x191)[_0x6b07('0x35')]({'message':_0x6b07('0x4f')});}}else{return _0x1bf9ba[_0x6b07('0x33')](0x191)[_0x6b07('0x35')]({'message':_0x6b07('0x4f')});}}_0x1d7d56[_0x6b07('0x53')]={'id':_0x4de0af['id']};_0x5116fa();});})[_0x6b07('0x38')](function(){return _0x1bf9ba['status'](0x191)['json']({'message':_0x6b07('0x4f')});});}catch(_0x527a10){_0x5116fa(_0x527a10);}}else if(_0x53cf6c){_0x5116fa();}else{return _0x1bf9ba['status'](0x193)[_0x6b07('0x35')]({'message':_0x6b07('0x44')});}})[_0x6b07('0x2d')](function(_0x1cdec7,_0xb9310f,_0x15f7e0){if(_0x1cdec7[_0x6b07('0x53')]){db[_0x6b07('0x3c')][_0x6b07('0x3d')]({'where':{'id':_0x1cdec7['user']['id']},'attributes':userAttributes})[_0x6b07('0x32')](function(_0x2e5e6b){if(!_0x2e5e6b){return _0xb9310f[_0x6b07('0x33')](0x194)[_0x6b07('0x35')]({'message':'User\x20not\x20found.'});}_0x1cdec7[_0x6b07('0x53')]=_0x2e5e6b;_0x15f7e0();})['catch'](function(_0x1aa64c){_0x15f7e0(_0x1aa64c);});}else if(_0x53cf6c){_0x15f7e0();}else{return _0xb9310f[_0x6b07('0x33')](0x194)[_0x6b07('0x35')]({'message':_0x6b07('0x54')});}});};exports[_0x6b07('0x55')]=function canUpdate(){return compose()[_0x6b07('0x2d')](function(_0xd4f9af,_0x2e61a2,_0x3e4976){return licenseUtil[_0x6b07('0x56')]()[_0x6b07('0x32')](function(_0x49dd80){if(_0x49dd80['update']){_0x3e4976();}else{return _0x2e61a2[_0x6b07('0x33')](0x193)[_0x6b07('0x35')]({'message':_0x6b07('0x57')});}})['catch'](function(_0x14b539){_0x3e4976(_0x14b539);});});};exports[_0x6b07('0x58')]=function(_0x344e9b,_0x106542,_0x30cb55){_0x344e9b[_0x6b07('0x58')]=!![];return _0x30cb55();};exports[_0x6b07('0x59')]=function signToken(_0x27efa2){return signJwt(_0x27efa2);};exports[_0x6b07('0x5a')]=function(_0x584f8d,_0x21f3c9){if(!_0x584f8d[_0x6b07('0x53')]){return _0x21f3c9['status'](0x194)[_0x6b07('0x35')]({'message':_0x6b07('0x5b')});}var _0x2e4d6a={'payload':{'id':_0x584f8d[_0x6b07('0x53')]['id'],'role':_0x584f8d[_0x6b07('0x53')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x2e4d6a)['then'](function(_0x20fdf1){_0x21f3c9[_0x6b07('0x5c')]('motion.token',_0x20fdf1);_0x21f3c9[_0x6b07('0x5d')](_0x6b07('0x5e'));})[_0x6b07('0x38')](function(_0x78d3d1){return _0x21f3c9[_0x6b07('0x33')](0x1f4)[_0x6b07('0x5f')](_0x78d3d1);});};exports[_0x6b07('0x60')]=function(_0xe6fd06){if(_[_0x6b07('0x61')](_0xe6fd06[_0x6b07('0x62')])||_[_0x6b07('0x61')](_0xe6fd06[_0x6b07('0x63')])){return null;}else{return createJwt(_0xe6fd06);}};exports[_0x6b07('0x64')]=function(_0x292012){_0x292012[_0x6b07('0x62')]=generateNonce();_0x292012[_0x6b07('0x63')]=generateIssuedAt();return createJwt(_0x292012);};exports['regenerateApiKey']=function(_0x2f3be,_0x10202a){var _0x5a83aa=_0x2f3be[_0x6b07('0x47')][_0x6b07('0x45')];if(_0x5a83aa){var _0x4fe2e5={'nonce':_0x10202a[_0x6b07('0x62')],'iat':_0x10202a['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0x6b07('0x46')]()};return verifyJwt(_0x5a83aa,_0x4fe2e5)['then'](function(){return generateApiKey(_0x10202a);});}else{throw{'message':_0x6b07('0x65')};}};exports[_0x6b07('0x66')]=function(_0x425a79){var _0x1288f8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x1288f8[_0x6b07('0x67')](_0x425a79))throw new db[(_0x6b07('0x68'))][(_0x6b07('0x69'))](_0x6b07('0x6a'));return;};exports[_0x6b07('0x6b')]=function(_0x492619,_0x4b42a2,_0x44c14a){var _0x4bb1f9=encryptor['decryptString'](_0x4b42a2)[_0x6b07('0x6c')](',');for(var _0x352808=0x0;_0x352808<_0x44c14a;_0x352808++){if(!_0x4bb1f9[_0x352808])break;if(_0x492619[_0x6b07('0x6d')]()===_0x4bb1f9[_0x352808][_0x6b07('0x6d')]()){var _0x5505ec=util[_0x6b07('0x6e')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x44c14a);if(_0x44c14a===0x1){_0x5505ec=_0x6b07('0x6f');}throw new db[(_0x6b07('0x68'))][(_0x6b07('0x69'))](_0x5505ec);}}return;};exports['updatePasswordsHistory']=function(_0xd5f743,_0x2a14a7){var _0xa5cf09=_0x2a14a7?encryptor[_0x6b07('0x70')](_0x2a14a7)[_0x6b07('0x6c')](','):[];if(_0xa5cf09['length']===0x5){_0xa5cf09[_0x6b07('0x71')](-0x1,0x1);}_0xa5cf09[_0x6b07('0x72')](_0xd5f743);return encryptor[_0x6b07('0x73')](_0xa5cf09[_0x6b07('0x74')](','));};function signJwt(_0x30fdca){var _0x4e6ef7=BPromise['promisify'](jwt[_0x6b07('0x75')],{'context':jwt});var _0x357e01=_0x30fdca['secret']||config['secrets']['session'];return new BPromise(function(_0x18c63e,_0x53bb55){_0x4e6ef7(_0x30fdca[_0x6b07('0x76')],_0x357e01,_0x30fdca[_0x6b07('0x77')])[_0x6b07('0x32')](function(_0x25005c){_0x18c63e(_0x25005c);})[_0x6b07('0x38')](function(_0x4e506d){_0x53bb55(_0x4e506d);});});}function verifyJwt(_0x66b0ef,_0x3f0970,_0x55db99){var _0x2a77b7=BPromise[_0x6b07('0x78')](jwt[_0x6b07('0x79')],{'context':jwt});var _0xe58bb1=_0x55db99||config[_0x6b07('0xc')]['session'];return new BPromise(function(_0x501a15,_0x1e6f8c){_0x2a77b7(_0x66b0ef,_0xe58bb1,_0x3f0970)[_0x6b07('0x32')](function(_0x5c8134){_0x501a15(_0x5c8134);})[_0x6b07('0x38')](function(_0x38ea11){_0x1e6f8c(_0x38ea11);});});}function generateNonce(){return crypto[_0x6b07('0x7a')](0x10)[_0x6b07('0x7b')]('hex');}function generateIssuedAt(){return Math[_0x6b07('0x7c')](Date['now']()/0x3e8)[_0x6b07('0x7b')]();}function createJwt(_0x5e2bc4){var _0xbaf280={'payload':{'iat':_0x5e2bc4['apiKeyIat'],'nonce':_0x5e2bc4[_0x6b07('0x62')]},'options':{'algorithm':_0x6b07('0x7d'),'subject':_0x5e2bc4['id'][_0x6b07('0x7b')](),'issuer':hardwareConf[_0x6b07('0x46')](),'audience':hardwareConf[_0x6b07('0x46')]()}};return signJwt(_0xbaf280)[_0x6b07('0x32')](function(_0x5c291d){return{'iat':_0x5e2bc4[_0x6b07('0x63')],'nonce':_0x5e2bc4[_0x6b07('0x62')],'token':_0x5c291d};});}
\ No newline at end of file
+var _0xc47f=['allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','wssPort','downloadAttachments','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','then','closed','status','disposition','json','unmanaged','Unmanaged.','Forbidden.','catch','authorization','headers','Basic','User','find','name','pass','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','Setting','allowedLoginAttempts','blockDuration','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','cookie','motion.token','redirect','retrieveApiKey','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','splice','encryptString','join','promisify','sign','secret','secrets','options','verify','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','util','session','fullname','internal','permissions','md5secret','voicePause','faxPause','showWebBar','lastLoginAt','crudPermissions'];(function(_0x230c33,_0xdfcf9){var _0x19acae=function(_0xf4fdf1){while(--_0xf4fdf1){_0x230c33['push'](_0x230c33['shift']());}};_0x19acae(++_0xdfcf9);}(_0xc47f,0x1d6));var _0xfc47=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xc47f[_0xa148b7];return _0x51efd3;};'use strict';var db=require(_0xfc47('0x0'))['db'];var config=require(_0xfc47('0x1'));var hardwareConf=require(_0xfc47('0x2'));var licenseUtil=require(_0xfc47('0x3'));var encryptor=require(_0xfc47('0x4'));var _=require(_0xfc47('0x5'));var jwt=require(_0xfc47('0x6'));var expressJwt=require('express-jwt');var compose=require(_0xfc47('0x7'));var basicAuth=require(_0xfc47('0x8'));var crypto=require(_0xfc47('0x9'));var BPromise=require(_0xfc47('0xa'));var util=require(_0xfc47('0xb'));var moment=require('moment');var validateJwt=expressJwt({'secret':config['secrets'][_0xfc47('0xc')]});var userAttributes=['id','role',_0xfc47('0xd'),'name',_0xfc47('0xe'),'email','userpic',_0xfc47('0xf'),_0xfc47('0x10'),_0xfc47('0x11'),'chatPause','mailPause',_0xfc47('0x12'),'smsPause','openchannelPause','pauseType',_0xfc47('0x13'),_0xfc47('0x14'),'lastPauseAt',_0xfc47('0x15'),_0xfc47('0x16'),_0xfc47('0x17'),_0xfc47('0x18'),_0xfc47('0x19'),_0xfc47('0x1a'),_0xfc47('0x1b'),_0xfc47('0x1c'),_0xfc47('0x1d'),_0xfc47('0x1e'),_0xfc47('0x1f'),_0xfc47('0x20'),'phoneBarRemoteControl',_0xfc47('0x21'),_0xfc47('0x22'),_0xfc47('0x23'),_0xfc47('0x24'),'privacyEnabled','settingsEnabled',_0xfc47('0x25'),'downloadVoiceRecordings','downloadOmnichannelInteractions',_0xfc47('0x26')];exports[_0xfc47('0x27')]=function(){return this[_0xfc47('0x28')](!![])[_0xfc47('0x29')](function(_0x5ab61b,_0x18d63e,_0x2c9ba5){if(_0x5ab61b[_0xfc47('0x2a')]){_0x2c9ba5();}else{return db[_0xfc47('0x2b')][_0xfc47('0x2c')]({'where':{'id':_0x5ab61b[_0xfc47('0x2d')]['id']},'attributes':['id','closed','disposition'],'raw':!![]})[_0xfc47('0x2e')](function(_0x2a693d){if(_0x2a693d&&_0x2a693d[_0xfc47('0x2f')]){return _0x18d63e[_0xfc47('0x30')](_0x2a693d[_0xfc47('0x31')]==='unmanaged'?0x195:0x193)[_0xfc47('0x32')]({'message':_0x2a693d[_0xfc47('0x31')]===_0xfc47('0x33')?_0xfc47('0x34'):_0xfc47('0x35')});}else{_0x2c9ba5();}})[_0xfc47('0x36')](function(_0xc7ea72){_0x2c9ba5(_0xc7ea72);});}});};exports[_0xfc47('0x28')]=function isAuthenticated(_0xd6e1af){return compose()[_0xfc47('0x29')](function(_0x58455e,_0x4c91fc,_0x2ad7c3){var _0x5e3342;if(_0x58455e['headers'][_0xfc47('0x37')]){if(_['startsWith'](_0x58455e[_0xfc47('0x38')][_0xfc47('0x37')],_0xfc47('0x39'))){var _0x27f5de=basicAuth(_0x58455e);db[_0xfc47('0x3a')][_0xfc47('0x3b')]({'where':{'name':_0x27f5de[_0xfc47('0x3c')]}})['then'](function(_0x451fba){if(!_0x451fba||!_0x451fba['authenticate'](_0x27f5de[_0xfc47('0x3d')])){return _0x4c91fc[_0xfc47('0x30')](0x191)[_0xfc47('0x32')]({'message':'Wrong\x20credentials.'});}_0x58455e[_0xfc47('0x2a')]={'id':_0x451fba['id']};_0x2ad7c3();})[_0xfc47('0x36')](function(_0x3583bc){_0x2ad7c3(_0x3583bc);});}else if(_['startsWith'](_0x58455e['headers']['authorization'],_0xfc47('0x3e'))){validateJwt(_0x58455e,_0x4c91fc,_0x2ad7c3);}else{if(_0xd6e1af){_0x2ad7c3();}else{return _0x4c91fc[_0xfc47('0x30')](0x193)[_0xfc47('0x32')]({'message':_0xfc47('0x3f')});}}}else if(_0x58455e[_0xfc47('0x40')][_0xfc47('0x41')]){try{var _0x2b521b={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xfc47('0x42')]()};verifyJwt(_0x58455e[_0xfc47('0x40')]['apikey'],_0x2b521b)[_0xfc47('0x2e')](function(_0x140f48){return db['User'][_0xfc47('0x3b')]({'where':{'id':_0x140f48['sub']}})[_0xfc47('0x2e')](function(_0x6089dd){_0x5e3342=_0x6089dd;return db[_0xfc47('0x43')][_0xfc47('0x2c')]({'where':{'id':0x1},'attributes':[_0xfc47('0x44'),_0xfc47('0x45')],'raw':!![]});})[_0xfc47('0x2e')](function(_0x345771){if(!_0x5e3342||!_[_0xfc47('0x46')](_0x5e3342[_0xfc47('0x47')],_0x140f48[_0xfc47('0x48')])){return _0x4c91fc[_0xfc47('0x30')](0x191)['json']({'message':_0xfc47('0x49')});}if(_0x5e3342[_0xfc47('0x4a')]){return _0x4c91fc[_0xfc47('0x30')](0x191)[_0xfc47('0x32')]({'message':_0xfc47('0x4b')});}if(_0x5e3342[_0xfc47('0x4c')]){if(_0x345771[_0xfc47('0x45')]>0x0){if(moment(_0x5e3342[_0xfc47('0x4d')])[_0xfc47('0x4e')](_0x345771['blockDuration'],_0xfc47('0x4f'))>moment()){return _0x4c91fc[_0xfc47('0x30')](0x191)[_0xfc47('0x32')]({'message':_0xfc47('0x4b')});}}else{return _0x4c91fc[_0xfc47('0x30')](0x191)[_0xfc47('0x32')]({'message':_0xfc47('0x4b')});}}_0x58455e[_0xfc47('0x2a')]={'id':_0x5e3342['id']};_0x2ad7c3();});})[_0xfc47('0x36')](function(){return _0x4c91fc[_0xfc47('0x30')](0x191)[_0xfc47('0x32')]({'message':_0xfc47('0x4b')});});}catch(_0x44fd46){_0x2ad7c3(_0x44fd46);}}else if(_0xd6e1af){_0x2ad7c3();}else{return _0x4c91fc[_0xfc47('0x30')](0x193)['json']({'message':_0xfc47('0x3f')});}})[_0xfc47('0x29')](function(_0x342161,_0xa740e,_0x5b4fb9){if(_0x342161[_0xfc47('0x2a')]){db[_0xfc47('0x3a')]['find']({'where':{'id':_0x342161[_0xfc47('0x2a')]['id']},'attributes':userAttributes})[_0xfc47('0x2e')](function(_0x3cb10d){if(!_0x3cb10d){return _0xa740e[_0xfc47('0x30')](0x194)[_0xfc47('0x32')]({'message':_0xfc47('0x50')});}_0x342161[_0xfc47('0x2a')]=_0x3cb10d;_0x5b4fb9();})[_0xfc47('0x36')](function(_0x5d3d43){_0x5b4fb9(_0x5d3d43);});}else if(_0xd6e1af){_0x5b4fb9();}else{return _0xa740e[_0xfc47('0x30')](0x194)[_0xfc47('0x32')]({'message':_0xfc47('0x51')});}});};exports[_0xfc47('0x52')]=function canUpdate(){return compose()['use'](function(_0x5032a0,_0x1fdcf0,_0x25ca98){return licenseUtil['getLicense']()['then'](function(_0x4b516b){if(_0x4b516b[_0xfc47('0x53')]){_0x25ca98();}else{return _0x1fdcf0['status'](0x193)[_0xfc47('0x32')]({'message':_0xfc47('0x54')});}})[_0xfc47('0x36')](function(_0x580300){_0x25ca98(_0x580300);});});};exports[_0xfc47('0x55')]=function(_0x1a4afd,_0xc54ba6,_0x474a87){_0x1a4afd[_0xfc47('0x55')]=!![];return _0x474a87();};exports[_0xfc47('0x56')]=function signToken(_0x546c01){return signJwt(_0x546c01);};exports[_0xfc47('0x57')]=function(_0x22a1f0,_0x5171dd){if(!_0x22a1f0[_0xfc47('0x2a')]){return _0x5171dd[_0xfc47('0x30')](0x194)[_0xfc47('0x32')]({'message':_0xfc47('0x58')});}var _0xd544e6={'payload':{'id':_0x22a1f0['user']['id'],'role':_0x22a1f0[_0xfc47('0x2a')][_0xfc47('0x59')]},'options':{'expiresIn':0x15180}};return signJwt(_0xd544e6)[_0xfc47('0x2e')](function(_0x584575){_0x5171dd[_0xfc47('0x5a')](_0xfc47('0x5b'),_0x584575);_0x5171dd[_0xfc47('0x5c')]('/dashboards/general');})[_0xfc47('0x36')](function(_0x5c1bb9){return _0x5171dd[_0xfc47('0x30')](0x1f4)['send'](_0x5c1bb9);});};exports[_0xfc47('0x5d')]=function(_0x12497f){if(_['isNil'](_0x12497f[_0xfc47('0x47')])||_['isNil'](_0x12497f['apiKeyIat'])){return null;}else{return createJwt(_0x12497f);}};exports[_0xfc47('0x5e')]=function(_0x209d4d){_0x209d4d[_0xfc47('0x47')]=generateNonce();_0x209d4d[_0xfc47('0x5f')]=generateIssuedAt();return createJwt(_0x209d4d);};exports[_0xfc47('0x60')]=function(_0x5d6455,_0x306e23){var _0x571c4a=_0x5d6455[_0xfc47('0x40')]['apikey'];if(_0x571c4a){var _0x55a01={'nonce':_0x306e23['apiKeyNonce'],'iat':_0x306e23[_0xfc47('0x5f')],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xfc47('0x42')]()};return verifyJwt(_0x571c4a,_0x55a01)[_0xfc47('0x2e')](function(){return generateApiKey(_0x306e23);});}else{throw{'message':_0xfc47('0x61')};}};exports[_0xfc47('0x62')]=function(_0x2bcfb0){var _0x26831c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x26831c[_0xfc47('0x63')](_0x2bcfb0))throw new db[(_0xfc47('0x64'))][(_0xfc47('0x65'))](_0xfc47('0x66'));return;};exports['validatePasswordHistory']=function(_0x9bcd0c,_0x1ef6ff,_0x51f082){var _0x42f032=encryptor[_0xfc47('0x67')](_0x1ef6ff)[_0xfc47('0x68')](',');for(var _0x499131=0x0;_0x499131<_0x51f082;_0x499131++){if(!_0x42f032[_0x499131])break;if(_0x9bcd0c[_0xfc47('0x69')]()===_0x42f032[_0x499131][_0xfc47('0x69')]()){var _0x3f2064=util['format']('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x51f082);if(_0x51f082===0x1){_0x3f2064=_0xfc47('0x6a');}throw new db[(_0xfc47('0x64'))]['ValidationError'](_0x3f2064);}}return;};exports[_0xfc47('0x6b')]=function(_0x3329e8,_0x44fcd2){var _0x11549d=_0x44fcd2?encryptor[_0xfc47('0x67')](_0x44fcd2)[_0xfc47('0x68')](','):[];if(_0x11549d['length']===0x5){_0x11549d[_0xfc47('0x6c')](-0x1,0x1);}_0x11549d['unshift'](_0x3329e8);return encryptor[_0xfc47('0x6d')](_0x11549d[_0xfc47('0x6e')](','));};function signJwt(_0x18380a){var _0x4d3939=BPromise[_0xfc47('0x6f')](jwt[_0xfc47('0x70')],{'context':jwt});var _0x3a28e3=_0x18380a[_0xfc47('0x71')]||config[_0xfc47('0x72')][_0xfc47('0xc')];return new BPromise(function(_0x2ec265,_0x5741c9){_0x4d3939(_0x18380a['payload'],_0x3a28e3,_0x18380a[_0xfc47('0x73')])[_0xfc47('0x2e')](function(_0x2a84a5){_0x2ec265(_0x2a84a5);})['catch'](function(_0x52e531){_0x5741c9(_0x52e531);});});}function verifyJwt(_0x1f3cea,_0x3d5a97,_0x50ede4){var _0x54de7f=BPromise[_0xfc47('0x6f')](jwt[_0xfc47('0x74')],{'context':jwt});var _0x1afba6=_0x50ede4||config['secrets'][_0xfc47('0xc')];return new BPromise(function(_0x5e1dc6,_0xe89edb){_0x54de7f(_0x1f3cea,_0x1afba6,_0x3d5a97)[_0xfc47('0x2e')](function(_0x218f52){_0x5e1dc6(_0x218f52);})[_0xfc47('0x36')](function(_0x5d5817){_0xe89edb(_0x5d5817);});});}function generateNonce(){return crypto[_0xfc47('0x75')](0x10)[_0xfc47('0x76')](_0xfc47('0x77'));}function generateIssuedAt(){return Math[_0xfc47('0x78')](Date[_0xfc47('0x79')]()/0x3e8)['toString']();}function createJwt(_0x4dd522){var _0x43ae89={'payload':{'iat':_0x4dd522[_0xfc47('0x5f')],'nonce':_0x4dd522[_0xfc47('0x47')]},'options':{'algorithm':_0xfc47('0x7a'),'subject':_0x4dd522['id'][_0xfc47('0x76')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x43ae89)[_0xfc47('0x2e')](function(_0x346b49){return{'iat':_0x4dd522[_0xfc47('0x5f')],'nonce':_0x4dd522[_0xfc47('0x47')],'token':_0x346b49};});}
\ No newline at end of file
index 4474bf6..82d94d5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x41d6=['secrets','session','aes-256-ctr','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','binary','end','write','close','unlink','update','final','encryptString','secret','utf8','base64','decryptString','createDecipher','bluebird','lodash','../../config/environment','app'];(function(_0x141727,_0x2888c2){var _0x1ec1c=function(_0x247e07){while(--_0x247e07){_0x141727['push'](_0x141727['shift']());}};_0x1ec1c(++_0x2888c2);}(_0x41d6,0x1b6));var _0x641d=function(_0x267484,_0x3eb131){_0x267484=_0x267484-0x0;var _0x14a356=_0x41d6[_0x267484];return _0x14a356;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x641d('0x0'));var _=require(_0x641d('0x1'));var config=require(_0x641d('0x2'));var logger=require('../../config/logger')(_0x641d('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x641d('0x4')][_0x641d('0x5')],'algorithm':_0x641d('0x6')};const fileOptions={'algorithm':'aes192'};if(config[_0x641d('0x7')]&&config['encrypt'][_0x641d('0x8')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x641d('0x8')]);if(isSupported){fileOptions[_0x641d('0x8')]=config[_0x641d('0x7')][_0x641d('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x641d('0x9')](',\x20');logger[_0x641d('0xa')](config['encrypt'][_0x641d('0x8')],_0x641d('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x2cc9f0){return AES_SUPPORTED_RX[_0x641d('0xc')](_0x2cc9f0);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x641d('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0x909fc1){return getSupportedCiphers()[_0x641d('0xe')](_0x909fc1)>-0x1;}function combineOptions(_0x56540f){var _0x269b59={};for(var _0x58fcc4 in fileOptions){if(fileOptions[_0x641d('0xf')](_0x58fcc4)){_0x269b59[_0x58fcc4]=fileOptions[_0x58fcc4];}}if(_0x56540f){for(var _0x5a8f0c in _0x56540f){if(_0x56540f['hasOwnProperty'](_0x5a8f0c)){_0x269b59[_0x5a8f0c]=_0x56540f[_0x5a8f0c];}}}return _0x269b59;}exports[_0x641d('0x10')]=function(_0xb28f5d,_0x33bb32,_0x486fed,_0x5b5d12){return new BPromise(function(_0x5a57bf,_0x3c2a0b){_0x5b5d12=combineOptions(_0x5b5d12);var _0x418874=new Buffer(_0x486fed);var _0x55d7f2=fs[_0x641d('0x11')](_0xb28f5d);var _0x59ad37=fs[_0x641d('0x12')](_0x33bb32);var _0x1097d2=crypto[_0x641d('0x13')](_0x5b5d12['algorithm'],_0x418874);_0x55d7f2['on'](_0x641d('0x14'),function(_0x5e0c31){var _0x1c951e=new Buffer(_0x1097d2['update'](_0x5e0c31),_0x641d('0x15'));_0x59ad37['write'](_0x1c951e);});_0x55d7f2['on'](_0x641d('0x16'),function(){try{var _0x45c374=new Buffer(_0x1097d2['final']('binary'),_0x641d('0x15'));_0x59ad37[_0x641d('0x17')](_0x45c374);_0x59ad37[_0x641d('0x16')]();_0x59ad37['on'](_0x641d('0x18'),function(){return _0x5a57bf(_0x33bb32);});}catch(_0x4baa76){fs[_0x641d('0x19')](_0x33bb32);return _0x3c2a0b(_0x4baa76);}});});};exports['decryptFile']=function(_0x24a309,_0x14b2e0,_0x20d5a6,_0xb40fdb){return new BPromise(function(_0x8cfcc6,_0x21d102){_0xb40fdb=combineOptions(_0xb40fdb);var _0x117f00=new Buffer(_0x20d5a6);var _0x2aaf53=fs[_0x641d('0x11')](_0x24a309);var _0x44af43=fs[_0x641d('0x12')](_0x14b2e0);var _0x5ad03b=crypto['createDecipher'](_0xb40fdb[_0x641d('0x8')],_0x117f00);_0x2aaf53['on'](_0x641d('0x14'),function(_0x2e5029){var _0x425949=new Buffer(_0x5ad03b[_0x641d('0x1a')](_0x2e5029),_0x641d('0x15'));_0x44af43[_0x641d('0x17')](_0x425949);});_0x2aaf53['on']('end',function(){try{var _0x49b3e4=new Buffer(_0x5ad03b[_0x641d('0x1b')]('binary'),_0x641d('0x15'));_0x44af43['write'](_0x49b3e4);_0x44af43[_0x641d('0x16')]();_0x44af43['on'](_0x641d('0x18'),function(){return _0x8cfcc6(_0x14b2e0);});}catch(_0x1b1429){fs[_0x641d('0x19')](_0x14b2e0);return _0x21d102(_0x1b1429);}});});};exports[_0x641d('0x1c')]=function(_0x29dca9,_0x275359,_0x530a21){var _0xd234af=_0x530a21||stringOptions[_0x641d('0x8')];var _0x1b4b89=_0x275359||stringOptions[_0x641d('0x1d')];var _0x46925d=crypto[_0x641d('0x13')](_0xd234af,_0x1b4b89);var _0x54aa13=_0x46925d[_0x641d('0x1a')](_0x29dca9,_0x641d('0x1e'),_0x641d('0x1f'));_0x54aa13+=_0x46925d[_0x641d('0x1b')]('base64');return _0x54aa13;};exports[_0x641d('0x20')]=function(_0x5c8f8b,_0xe79912,_0x414dce){var _0x561d45=_0x414dce||stringOptions[_0x641d('0x8')];var _0x3f0fb2=_0xe79912||stringOptions['secret'];var _0x4f67ce=crypto[_0x641d('0x21')](_0x561d45,_0x3f0fb2);var _0x195f6d=_0x4f67ce['update'](_0x5c8f8b,'base64',_0x641d('0x1e'));_0x195f6d+=_0x4f67ce[_0x641d('0x1b')](_0x641d('0x1e'));return _0x195f6d;};
\ No newline at end of file
+var _0x34b2=['end','final','close','unlink','createReadStream','createDecipher','encryptString','secret','utf8','base64','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','indexOf','hasOwnProperty','createWriteStream','createCipher','data','update','binary','write'];(function(_0x7f2a71,_0x1ce1e0){var _0xe26fc1=function(_0x36449e){while(--_0x36449e){_0x7f2a71['push'](_0x7f2a71['shift']());}};_0xe26fc1(++_0x1ce1e0);}(_0x34b2,0x1ea));var _0x234b=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x34b2[_0x5bd426];return _0x23a7eb;};'use strict';var crypto=require(_0x234b('0x0'));var fs=require('fs');var BPromise=require(_0x234b('0x1'));var _=require(_0x234b('0x2'));var config=require(_0x234b('0x3'));var logger=require(_0x234b('0x4'))(_0x234b('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config['secrets']['session'],'algorithm':_0x234b('0x6')};const fileOptions={'algorithm':_0x234b('0x7')};if(config[_0x234b('0x8')]&&config[_0x234b('0x8')][_0x234b('0x9')]){var isSupported=isAlgorithmSupported(config[_0x234b('0x8')][_0x234b('0x9')]);if(isSupported){fileOptions['algorithm']=config['encrypt'][_0x234b('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x234b('0xa')](',\x20');logger[_0x234b('0xb')](config[_0x234b('0x8')][_0x234b('0x9')],_0x234b('0xc'),supportedAlgorithms);}}function isASupportedCipher(_0x2ed7f1){return AES_SUPPORTED_RX[_0x234b('0xd')](_0x2ed7f1);}function getSupportedCiphers(){return crypto['getCiphers']()['filter'](isASupportedCipher);}function isAlgorithmSupported(_0x341cab){return getSupportedCiphers()[_0x234b('0xe')](_0x341cab)>-0x1;}function combineOptions(_0x9b61fb){var _0x5d6a1d={};for(var _0x4773bf in fileOptions){if(fileOptions[_0x234b('0xf')](_0x4773bf)){_0x5d6a1d[_0x4773bf]=fileOptions[_0x4773bf];}}if(_0x9b61fb){for(var _0x5791b8 in _0x9b61fb){if(_0x9b61fb[_0x234b('0xf')](_0x5791b8)){_0x5d6a1d[_0x5791b8]=_0x9b61fb[_0x5791b8];}}}return _0x5d6a1d;}exports['encryptFile']=function(_0x4b8678,_0x5a1ddd,_0x30b82a,_0x12f0f7){return new BPromise(function(_0x57384d,_0x1f4dd8){_0x12f0f7=combineOptions(_0x12f0f7);var _0x12619f=new Buffer(_0x30b82a);var _0x4bab45=fs['createReadStream'](_0x4b8678);var _0x5dbb3b=fs[_0x234b('0x10')](_0x5a1ddd);var _0x2c4039=crypto[_0x234b('0x11')](_0x12f0f7[_0x234b('0x9')],_0x12619f);_0x4bab45['on'](_0x234b('0x12'),function(_0x4979d0){var _0x4cf4c7=new Buffer(_0x2c4039[_0x234b('0x13')](_0x4979d0),_0x234b('0x14'));_0x5dbb3b[_0x234b('0x15')](_0x4cf4c7);});_0x4bab45['on'](_0x234b('0x16'),function(){try{var _0x5e1a87=new Buffer(_0x2c4039[_0x234b('0x17')](_0x234b('0x14')),'binary');_0x5dbb3b[_0x234b('0x15')](_0x5e1a87);_0x5dbb3b[_0x234b('0x16')]();_0x5dbb3b['on'](_0x234b('0x18'),function(){return _0x57384d(_0x5a1ddd);});}catch(_0x3b72db){fs[_0x234b('0x19')](_0x5a1ddd);return _0x1f4dd8(_0x3b72db);}});});};exports['decryptFile']=function(_0x2581f6,_0xb252c5,_0x51d3e2,_0x1db3fb){return new BPromise(function(_0x2de6cd,_0x198039){_0x1db3fb=combineOptions(_0x1db3fb);var _0x549a49=new Buffer(_0x51d3e2);var _0x204907=fs[_0x234b('0x1a')](_0x2581f6);var _0x5dce18=fs['createWriteStream'](_0xb252c5);var _0x50cb67=crypto[_0x234b('0x1b')](_0x1db3fb[_0x234b('0x9')],_0x549a49);_0x204907['on']('data',function(_0x2a7065){var _0x5dfbf1=new Buffer(_0x50cb67[_0x234b('0x13')](_0x2a7065),'binary');_0x5dce18[_0x234b('0x15')](_0x5dfbf1);});_0x204907['on']('end',function(){try{var _0x283898=new Buffer(_0x50cb67[_0x234b('0x17')](_0x234b('0x14')),'binary');_0x5dce18[_0x234b('0x15')](_0x283898);_0x5dce18[_0x234b('0x16')]();_0x5dce18['on'](_0x234b('0x18'),function(){return _0x2de6cd(_0xb252c5);});}catch(_0x22f70d){fs['unlink'](_0xb252c5);return _0x198039(_0x22f70d);}});});};exports[_0x234b('0x1c')]=function(_0x1bc140,_0x20bd9d,_0x50fad7){var _0x39497b=_0x50fad7||stringOptions['algorithm'];var _0x2b773c=_0x20bd9d||stringOptions[_0x234b('0x1d')];var _0x2a95dc=crypto[_0x234b('0x11')](_0x39497b,_0x2b773c);var _0x440a81=_0x2a95dc[_0x234b('0x13')](_0x1bc140,_0x234b('0x1e'),_0x234b('0x1f'));_0x440a81+=_0x2a95dc['final'](_0x234b('0x1f'));return _0x440a81;};exports['decryptString']=function(_0x2f0926,_0x52b249,_0x43dc75){var _0x13365a=_0x43dc75||stringOptions[_0x234b('0x9')];var _0x12fd0f=_0x52b249||stringOptions[_0x234b('0x1d')];var _0x2a352d=crypto[_0x234b('0x1b')](_0x13365a,_0x12fd0f);var _0x62b5d7=_0x2a352d['update'](_0x2f0926,_0x234b('0x1f'),_0x234b('0x1e'));_0x62b5d7+=_0x2a352d[_0x234b('0x17')](_0x234b('0x1e'));return _0x62b5d7;};
\ No newline at end of file
index df5841c..cfe36d3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc81=['isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','basename','.csv','mkdirSync','join','each','push','%s.%s','csv','writeFileSync','zip\x20finished','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','CSV','inspect','Failed','finally','exit','path','lodash','to-csv','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','format','Setting','find','split','splitSizeCsv','then','sequelize','query','QueryTypes','num','Empty','length','range'];(function(_0x4fb39d,_0x539377){var _0x1e4b07=function(_0x4e1ecf){while(--_0x4e1ecf){_0x4fb39d['push'](_0x4fb39d['shift']());}};_0x1e4b07(++_0x539377);}(_0xdc81,0x7f));var _0x1dc8=function(_0x432e11,_0x320ce1){_0x432e11=_0x432e11-0x0;var _0x1ef1bb=_0xdc81[_0x432e11];return _0x1ef1bb;};'use strict';var util=require('util');var path=require(_0x1dc8('0x0'));var _=require(_0x1dc8('0x1'));var csv=require(_0x1dc8('0x2'));var fs=require('fs');var BPromise=require(_0x1dc8('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x1dc8('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0x1dc8('0x5'))[_0x1dc8('0x6')];var logger=require(_0x1dc8('0x7'))(_0x1dc8('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x1dc8('0x9')][0x2]);var QUERY=process[_0x1dc8('0x9')][0x3];var PATH=process[_0x1dc8('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2b7707,_0x23d46d){var _0x5e633c={'status':_0x2b7707};var _0x29de49={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x23d46d){_0x5e633c[_0x1dc8('0xa')]=_0x23d46d;}return db[_0x1dc8('0xb')]['update'](_0x5e633c,_0x29de49);}function main(){var _0x5c6bea=0x1388;var _0x37c72c;logger[_0x1dc8('0xc')](util[_0x1dc8('0xd')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,'CSV'));return db[_0x1dc8('0xe')][_0x1dc8('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1dc8('0x10'),_0x1dc8('0x11')]})[_0x1dc8('0x12')](function(_0x389087){if(_0x389087){_0x37c72c=_0x389087;_0x5c6bea=_0x37c72c['splitSizeCsv']||0x1388;}})[_0x1dc8('0x12')](function(){return dbH[_0x1dc8('0x13')][_0x1dc8('0x14')](util[_0x1dc8('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x1dc8('0x13')][_0x1dc8('0x15')]['SELECT']});})['then'](function(_0x5e735f){if(!_0x5e735f[0x0][_0x1dc8('0x16')]){return analyticExtractedReport(_0x1dc8('0x17'));}var _0x56ca54=[];var _0x53a107=0x0;if(_0x37c72c[_0x1dc8('0x10')]){if(_0x5e735f&&_0x5e735f[_0x1dc8('0x18')]){var _0x182573=_[_0x1dc8('0x19')](_0x5e735f[0x0][_0x1dc8('0x16')]/_0x5c6bea);var _0x26237e=Number[_0x1dc8('0x1a')](_0x5e735f[0x0]['num']/_0x5c6bea)?_0x5e735f[0x0][_0x1dc8('0x16')]%_0x5c6bea:0x0;_0x182573[_0x1dc8('0x1b')](function(_0x22fdf3){if(_0x22fdf3>0x0){_0x53a107+=_0x5c6bea;}_0x56ca54['push'](dbH[_0x1dc8('0x13')][_0x1dc8('0x14')](util[_0x1dc8('0xd')](_0x1dc8('0x1c'),QUERY,_0x5c6bea,_0x53a107),{'type':dbH[_0x1dc8('0x13')][_0x1dc8('0x15')][_0x1dc8('0x1d')]}));});if(_0x26237e>0x0){_0x53a107+=_0x5c6bea;_0x56ca54['push'](dbH['sequelize']['query'](util[_0x1dc8('0xd')](_0x1dc8('0x1c'),QUERY,_0x26237e,_0x53a107),{'type':dbH[_0x1dc8('0x13')][_0x1dc8('0x15')]['SELECT']}));}}}else{_0x56ca54['push'](dbH[_0x1dc8('0x13')]['query'](QUERY,{'type':dbH['sequelize'][_0x1dc8('0x15')]['SELECT']}));}var _0xd2fb72=path[_0x1dc8('0x1e')](PATH);var _0x2a17ef=path[_0x1dc8('0x1f')](PATH,_0x1dc8('0x20'));var _0x46d8f9=_0x37c72c[_0x1dc8('0x10')]&&_0x56ca54[_0x1dc8('0x18')]>0x1;var _0x2f6fac=[];if(!fs['existsSync'](path['join'](_0xd2fb72,_0x2a17ef))&&_0x46d8f9){fs[_0x1dc8('0x21')](path[_0x1dc8('0x22')](_0xd2fb72,_0x2a17ef));}return BPromise[_0x1dc8('0x23')](_0x56ca54,function(_0x2c19f3){_0x2f6fac[_0x1dc8('0x24')](_0x2c19f3);})[_0x1dc8('0x12')](function(){for(var _0x597402=0x0;_0x597402<_0x2f6fac['length'];_0x597402+=0x1){var _0x31a97f;var _0x698cfb=_0x2f6fac[_0x597402];if(_0x46d8f9){_0x31a97f=path['join'](_0xd2fb72,_0x2a17ef,util[_0x1dc8('0xd')]('%s%d.%s',_0x2a17ef,_0x597402,'csv'));}else{_0x31a97f=path[_0x1dc8('0x22')](_0xd2fb72,util[_0x1dc8('0xd')](_0x1dc8('0x25'),_0x2a17ef,_0x1dc8('0x26')));}fs[_0x1dc8('0x27')](_0x31a97f,csv(_0x698cfb));}})[_0x1dc8('0x12')](function(){if(_0x46d8f9){return new Promise(function(_0x16a8c2){zipdir(path[_0x1dc8('0x22')](_0xd2fb72,_0x2a17ef),{'saveTo':path['join'](_0xd2fb72,util[_0x1dc8('0xd')](_0x1dc8('0x25'),_0x2a17ef,'zip'))},function(_0x65437d,_0x5a5ef9){rimraf(path['join'](_0xd2fb72,_0x2a17ef),function(){});_0x16a8c2(_0x1dc8('0x28'));});});}})[_0x1dc8('0x12')](function(){logger[_0x1dc8('0xc')](util[_0x1dc8('0xd')](_0x1dc8('0x29'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x1dc8('0x2a'),_0x46d8f9?util['format'](_0x1dc8('0x25'),_0x2a17ef,_0x46d8f9?_0x1dc8('0x2b'):_0x1dc8('0x26')):null);});})[_0x1dc8('0x2c')](function(_0x4b80c1){logger[_0x1dc8('0xc')](util['format'](_0x1dc8('0x2d'),EXTRACTED_REPORT_ID,_0x1dc8('0x2e')),util[_0x1dc8('0x2f')](_0x4b80c1,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1dc8('0x30'));})[_0x1dc8('0x31')](function(){process[_0x1dc8('0x32')](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x6b26=['%s\x20limit\x20%d\x20OFFSET\x20%d','query','format','basename','.csv','existsSync','join','mkdirSync','each','csv','%s.%s','zip','zip\x20finished','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','to-csv','bluebird','../../mysqldb','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','split','length','range','isInteger','forEach','push'];(function(_0x579545,_0x3d6f7b){var _0x2a5a82=function(_0x4a0aed){while(--_0x4a0aed){_0x579545['push'](_0x579545['shift']());}};_0x2a5a82(++_0x3d6f7b);}(_0x6b26,0x172));var _0x66b2=function(_0x486c90,_0x4a84e5){_0x486c90=_0x486c90-0x0;var _0x44f930=_0x6b26[_0x486c90];return _0x44f930;};'use strict';var util=require(_0x66b2('0x0'));var path=require(_0x66b2('0x1'));var _=require(_0x66b2('0x2'));var csv=require(_0x66b2('0x3'));var fs=require('fs');var BPromise=require(_0x66b2('0x4'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0x66b2('0x5'))['db'];var dbH=require(_0x66b2('0x5'))['dbH'];var logger=require(_0x66b2('0x6'))(_0x66b2('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x66b2('0x8')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x66b2('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x252ffe,_0x3147e2){var _0x1610e9={'status':_0x252ffe};var _0x2f2f4a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3147e2){_0x1610e9['savename']=_0x3147e2;}return db[_0x66b2('0x9')][_0x66b2('0xa')](_0x1610e9,_0x2f2f4a);}function main(){var _0x5921ed=0x1388;var _0x20f7b3;logger[_0x66b2('0xb')](util['format'](_0x66b2('0xc'),EXTRACTED_REPORT_ID,_0x66b2('0xd')));return db[_0x66b2('0xe')][_0x66b2('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x66b2('0x10')]})['then'](function(_0x389b8b){if(_0x389b8b){_0x20f7b3=_0x389b8b;_0x5921ed=_0x20f7b3[_0x66b2('0x10')]||0x1388;}})[_0x66b2('0x11')](function(){return dbH[_0x66b2('0x12')]['query'](util['format'](_0x66b2('0x13'),QUERY),{'type':dbH[_0x66b2('0x12')][_0x66b2('0x14')][_0x66b2('0x15')]});})['then'](function(_0x51fd81){if(!_0x51fd81[0x0][_0x66b2('0x16')]){return analyticExtractedReport(_0x66b2('0x17'));}var _0x4aa17d=[];var _0x5c87f1=0x0;if(_0x20f7b3[_0x66b2('0x18')]){if(_0x51fd81&&_0x51fd81[_0x66b2('0x19')]){var _0x58835d=_[_0x66b2('0x1a')](_0x51fd81[0x0][_0x66b2('0x16')]/_0x5921ed);var _0x43899e=Number[_0x66b2('0x1b')](_0x51fd81[0x0]['num']/_0x5921ed)?_0x51fd81[0x0][_0x66b2('0x16')]%_0x5921ed:0x0;_0x58835d[_0x66b2('0x1c')](function(_0x368827){if(_0x368827>0x0){_0x5c87f1+=_0x5921ed;}_0x4aa17d[_0x66b2('0x1d')](dbH[_0x66b2('0x12')]['query'](util['format'](_0x66b2('0x1e'),QUERY,_0x5921ed,_0x5c87f1),{'type':dbH[_0x66b2('0x12')][_0x66b2('0x14')]['SELECT']}));});if(_0x43899e>0x0){_0x5c87f1+=_0x5921ed;_0x4aa17d['push'](dbH['sequelize'][_0x66b2('0x1f')](util[_0x66b2('0x20')](_0x66b2('0x1e'),QUERY,_0x43899e,_0x5c87f1),{'type':dbH[_0x66b2('0x12')][_0x66b2('0x14')][_0x66b2('0x15')]}));}}}else{_0x4aa17d[_0x66b2('0x1d')](dbH['sequelize']['query'](QUERY,{'type':dbH[_0x66b2('0x12')][_0x66b2('0x14')][_0x66b2('0x15')]}));}var _0x1af546=path['dirname'](PATH);var _0x104467=path[_0x66b2('0x21')](PATH,_0x66b2('0x22'));var _0x44cb28=_0x20f7b3['split']&&_0x4aa17d['length']>0x1;var _0x2c2250=[];if(!fs[_0x66b2('0x23')](path[_0x66b2('0x24')](_0x1af546,_0x104467))&&_0x44cb28){fs[_0x66b2('0x25')](path[_0x66b2('0x24')](_0x1af546,_0x104467));}return BPromise[_0x66b2('0x26')](_0x4aa17d,function(_0x43f907){_0x2c2250['push'](_0x43f907);})[_0x66b2('0x11')](function(){for(var _0x502fff=0x0;_0x502fff<_0x2c2250['length'];_0x502fff+=0x1){var _0x26d52d;var _0x466969=_0x2c2250[_0x502fff];if(_0x44cb28){_0x26d52d=path[_0x66b2('0x24')](_0x1af546,_0x104467,util[_0x66b2('0x20')]('%s%d.%s',_0x104467,_0x502fff,_0x66b2('0x27')));}else{_0x26d52d=path[_0x66b2('0x24')](_0x1af546,util[_0x66b2('0x20')]('%s.%s',_0x104467,_0x66b2('0x27')));}fs['writeFileSync'](_0x26d52d,csv(_0x466969));}})[_0x66b2('0x11')](function(){if(_0x44cb28){return new Promise(function(_0x80c3ee){zipdir(path[_0x66b2('0x24')](_0x1af546,_0x104467),{'saveTo':path['join'](_0x1af546,util[_0x66b2('0x20')](_0x66b2('0x28'),_0x104467,_0x66b2('0x29')))},function(_0x21a3ab,_0x2fe957){rimraf(path['join'](_0x1af546,_0x104467),function(){});_0x80c3ee(_0x66b2('0x2a'));});});}})['then'](function(){logger[_0x66b2('0xb')](util[_0x66b2('0x20')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x66b2('0x2b'),_0x44cb28?util[_0x66b2('0x20')](_0x66b2('0x28'),_0x104467,_0x44cb28?_0x66b2('0x29'):_0x66b2('0x27')):null);});})[_0x66b2('0x2c')](function(_0x5e6781){logger[_0x66b2('0xb')](util['format'](_0x66b2('0x2d'),EXTRACTED_REPORT_ID,_0x66b2('0xd')),util[_0x66b2('0x2e')](_0x5e6781,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x66b2('0x2f'));})[_0x66b2('0x30')](function(){process[_0x66b2('0x31')](EXIT_CODE);});}main();
\ No newline at end of file
index eeac435..36514c6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x75f2=['YYYY-MM-DD','center','Interaction\x20Transcript','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','pick','toString','fill','length','auto','body','push','concat','chunk','format','name','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','right','num','Empty','Setting','find','splitSizePdf','then','split','isInteger','forEach','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','existsSync','mkdirSync','join','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','info','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId'];(function(_0x316911,_0x1fccd5){var _0x2df4bb=function(_0x17c34d){while(--_0x17c34d){_0x316911['push'](_0x316911['shift']());}};_0x2df4bb(++_0x1fccd5);}(_0x75f2,0x1da));var _0x275f=function(_0x3fceae,_0x21ddd3){_0x3fceae=_0x3fceae-0x0;var _0x38dcd4=_0x75f2[_0x3fceae];return _0x38dcd4;};'use strict';var _=require(_0x275f('0x0'));var fs=require('fs');var util=require(_0x275f('0x1'));var path=require(_0x275f('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0x275f('0x3'));var PdfPrinter=require(_0x275f('0x4'));var zipdir=require(_0x275f('0x5'));var rimraf=require('rimraf');var JSDOM=require(_0x275f('0x6'))[_0x275f('0x7')];var window=new JSDOM('')[_0x275f('0x8')];var BPromise=require(_0x275f('0x9'));var db=require(_0x275f('0xa'))['db'];var dbH=require(_0x275f('0xa'))[_0x275f('0xb')];var logger=require(_0x275f('0xc'))(_0x275f('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0x275f('0xe')][0x2]);var QUERY=process['argv'][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x275f('0xe')][0x5];var FORMAT=_0x275f('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x5354a0,_0x2a209e){var _0x260d6f={'status':_0x5354a0};var _0x4eb37b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2a209e){_0x260d6f[_0x275f('0x10')]=_0x2a209e;}return db[_0x275f('0x11')]['update'](_0x260d6f,_0x4eb37b);}function getHeaders(_0x13fcdf){return _[_0x275f('0x12')](_0x13fcdf,function(_0x2e5d58){return{'text':_0x2e5d58,'style':_0x275f('0x13')};});}function getRows(_0x54b446,_0x4c3a64){return _[_0x275f('0x12')](_0x4c3a64,function(_0x5e1d65){return _(_0x5e1d65)[_0x275f('0x14')](_0x54b446)[_0x275f('0x12')](function(_0xf38b1e){return _0xf38b1e?_[_0x275f('0x15')](_0xf38b1e):'';})['value']();});}function createTable(_0x2dbbf2,_0x23b8b3){var _0x1ce4b0={'widths':_[_0x275f('0x16')](Array(_0x2dbbf2[_0x275f('0x17')]),0x91),'heights':function(_0x13ce56){return _0x13ce56===0x0?_0x275f('0x18'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3c3490=getHeaders(_0x2dbbf2);_0x1ce4b0[_0x275f('0x19')][_0x275f('0x1a')](_0x3c3490);var _0xed72e1=getRows(_0x2dbbf2,_0x23b8b3);_0x1ce4b0['body']=_0x1ce4b0[_0x275f('0x19')][_0x275f('0x1b')](_0xed72e1);return _0x1ce4b0;}function createTables(_0x3eba8a){var _0x24642a=[];var _0x5b421a=_[_0x275f('0x1c')](Object['keys'](_0x3eba8a[0x0]),0x5);_0x5b421a['forEach'](function(_0x538916){_0x24642a['push'](createTable(_0x538916,_0x3eba8a));});return _0x24642a;}function getPDFDocDefinition(_0x28cba0){var _0x22c0fd=util[_0x275f('0x1d')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0x275f('0x1e')],moment(EXTRACTED_REPORT['startDate'])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0x275f('0x1d')](FORMAT));var _0x33f613=[];for(var _0x49c912=0x0;_0x49c912<_0x28cba0[_0x275f('0x17')];_0x49c912++){var _0x3f8bdb=[];if(_0x49c912===0x0){_0x3f8bdb[_0x275f('0x1a')]({'text':_0x22c0fd,'style':_0x275f('0x1f')});}var _0x239da5={'table':_0x28cba0[_0x49c912]};if(_0x49c912>0x0){_0x239da5[_0x275f('0x20')]=_0x275f('0x21');_0x239da5[_0x275f('0x22')]=[0x0,0x46,0x0,0x0];}_0x3f8bdb['push'](_0x239da5);_0x33f613[_0x275f('0x1a')](_0x3f8bdb);}return{'pageSize':'A4','pageOrientation':_0x275f('0x23'),'content':_0x33f613,'footer':function(_0x6498e0,_0x31cb8d){return{'text':_0x6498e0[_0x275f('0x15')]()+_0x275f('0x24')+_0x31cb8d,'style':_0x275f('0x25')};},'defaultStyle':{'font':_0x275f('0x26')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x275f('0x27')},'footer':{'alignment':_0x275f('0x28'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0xbdf407){var _0x59aeaf=0x1388;var _0x4a5bd4;if(!_0xbdf407[0x0][_0x275f('0x29')]){return analyticExtractedReport(_0x275f('0x2a'));}return db[_0x275f('0x2b')][_0x275f('0x2c')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x275f('0x2d')]})[_0x275f('0x2e')](function(_0x3bbfcc){if(_0x3bbfcc){_0x4a5bd4=_0x3bbfcc;_0x59aeaf=_0x4a5bd4[_0x275f('0x2d')]||0x3e8;}})['then'](function(){var _0x3d9c81=[];var _0x3d30dc=0x0;if(_0x4a5bd4[_0x275f('0x2f')]){if(_0xbdf407&&_0xbdf407[_0x275f('0x17')]){var _0x6519d4=_['range'](_0xbdf407[0x0][_0x275f('0x29')]/_0x59aeaf);var _0x12b4bc=Number[_0x275f('0x30')](_0xbdf407[0x0][_0x275f('0x29')]/_0x59aeaf)?_0xbdf407[0x0][_0x275f('0x29')]%_0x59aeaf:0x0;_0x6519d4[_0x275f('0x31')](function(_0x3b4f57){if(_0x3b4f57>0x0){_0x3d30dc+=_0x59aeaf;}_0x3d9c81[_0x275f('0x1a')](dbH[_0x275f('0x32')][_0x275f('0x33')](util[_0x275f('0x1d')](_0x275f('0x34'),QUERY,_0x59aeaf,_0x3d30dc),{'type':dbH[_0x275f('0x32')][_0x275f('0x35')][_0x275f('0x36')]}));});if(_0x12b4bc>0x0){_0x3d30dc+=_0x59aeaf;_0x3d9c81['push'](dbH[_0x275f('0x32')]['query'](util[_0x275f('0x1d')](_0x275f('0x34'),QUERY,_0x12b4bc,_0x3d30dc),{'type':dbH[_0x275f('0x32')][_0x275f('0x35')][_0x275f('0x36')]}));}}}else{_0x3d9c81['push'](dbH[_0x275f('0x32')][_0x275f('0x33')](QUERY,{'type':dbH[_0x275f('0x32')][_0x275f('0x35')][_0x275f('0x36')]}));}var _0x467fea=path[_0x275f('0x37')](PATH);var _0x198185=path['basename'](PATH,'.pdf');var _0x18aacf=_0x4a5bd4[_0x275f('0x2f')]&&_0x3d9c81[_0x275f('0x17')]>0x1;var _0x70d723=[];if(!fs[_0x275f('0x38')](path['join'](_0x467fea,_0x198185))&&_0x18aacf){fs[_0x275f('0x39')](path[_0x275f('0x3a')](_0x467fea,_0x198185));}return BPromise[_0x275f('0x3b')](_0x3d9c81,function(_0x4310c4){_0x70d723[_0x275f('0x1a')](_0x4310c4);})['then'](function(){var _0x5d3699=[];for(var _0x6b9639=0x0;_0x6b9639<_0x70d723[_0x275f('0x17')];_0x6b9639+=0x1){var _0x3d9388=_0x70d723[_0x6b9639];var _0x21a2a6=createTables(_[_0x275f('0x3c')](_0x3d9388));var _0x2d6130;var _0x3f310f=getPDFDocDefinition(_0x21a2a6);var _0x28693c=getPDFPrinter();var _0x593b67=_0x28693c[_0x275f('0x3d')](_0x3f310f);if(_0x18aacf){_0x2d6130=path[_0x275f('0x3a')](_0x467fea,_0x198185,util[_0x275f('0x1d')](_0x275f('0x3e'),_0x198185,_0x6b9639,_0x275f('0x3f')));}else{_0x2d6130=path[_0x275f('0x3a')](_0x467fea,util[_0x275f('0x1d')](_0x275f('0x40'),_0x198185,_0x275f('0x3f')));}_0x5d3699[_0x275f('0x1a')](writePDFDocument(_0x593b67,_0x2d6130));}return Promise[_0x275f('0x41')](_0x5d3699);})[_0x275f('0x2e')](function(){if(_0x18aacf){return new Promise(function(_0x2ecb5d){zipdir(path['join'](_0x467fea,_0x198185),{'saveTo':path['join'](_0x467fea,util[_0x275f('0x1d')]('%s.%s',_0x198185,_0x275f('0x42')))},function(){rimraf(path[_0x275f('0x3a')](_0x467fea,_0x198185),function(){});_0x2ecb5d(_0x275f('0x43'));});});}})[_0x275f('0x2e')](function(){if(!_0x18aacf)return;rimraf(path[_0x275f('0x3a')](_0x467fea,_0x198185),function(){});})[_0x275f('0x2e')](function(){logger[_0x275f('0x44')](util[_0x275f('0x1d')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x275f('0x45')));return analyticExtractedReport(_0x275f('0x46'),_0x18aacf?util[_0x275f('0x1d')](_0x275f('0x40'),_0x198185,_0x18aacf?'zip':_0x275f('0x3f')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util[_0x275f('0x1d')](_0x275f('0x47'),EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport'][_0x275f('0x48')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0x275f('0x2e')](function(_0x19f8ff){EXTRACTED_REPORT=_0x19f8ff;return dbH[_0x275f('0x32')][_0x275f('0x33')](util[_0x275f('0x1d')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x275f('0x32')][_0x275f('0x35')]['SELECT']});})[_0x275f('0x2e')](extractReport)[_0x275f('0x49')](function(_0x250cd4){logger[_0x275f('0x44')](util[_0x275f('0x1d')](_0x275f('0x4a'),EXTRACTED_REPORT_ID,_0x275f('0x45')),util[_0x275f('0x4b')](_0x250cd4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x275f('0x4c'));})[_0x275f('0x4d')](function(){process[_0x275f('0x4e')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x52fbc5=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x275f('0x4f'),'italics':__dirname+_0x275f('0x50'),'bolditalics':__dirname+_0x275f('0x51')}});return _0x52fbc5;}function getPDFDocDefinitionFromHTML(_0x48026f,_0x27f7fd){var _0x2aa7ae=util[_0x275f('0x1d')]('%s\x20#%d',_0x27f7fd[_0x275f('0x52')],_0x27f7fd[_0x275f('0x53')]);var _0xba7807=moment()[_0x275f('0x1d')](_0x275f('0x54'))[_0x275f('0x15')]();var _0x45723b=htmlToPdfmake(_0x48026f,{'window':window,'tableAutoSize':!![]});return{'content':[_0x45723b],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x275f('0x55'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x275f('0x55'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x275f('0x55')}},'header':function(){return[{'text':_0x275f('0x56'),'style':_0x275f('0x1f')}];},'footer':function(_0xbed753,_0x428ba8){return[{'text':util[_0x275f('0x1d')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x2aa7ae,_0xbed753,_0x428ba8,_0xba7807),'style':_0x275f('0x25')}];}};}function writePDFDocument(_0xafadcf,_0x3d2932){return new Promise(function(_0x34fc8f,_0x16a0eb){var _0x3bae18=_0xafadcf[_0x275f('0x57')](fs[_0x275f('0x58')](_0x3d2932));_0x3bae18['on'](_0x275f('0x59'),function(){_0x34fc8f(_0x275f('0x59'));});_0x3bae18['on'](_0x275f('0x5a'),function(_0x28e804){_0x16a0eb(_0x28e804);});_0xafadcf[_0x275f('0x5b')]();});}exports[_0x275f('0x5c')]=function(_0x1265ee,_0x188679){var _0x1c4749=getPDFPrinter();var _0x38eff8=getPDFDocDefinitionFromHTML(_0x1265ee,_0x188679);var _0x1624b2=_0x1c4749[_0x275f('0x3d')](_0x38eff8);return writePDFDocument(_0x1624b2,_0x188679['path'])['catch'](function(_0x5809f7){throw _0x5809f7;});};
\ No newline at end of file
+var _0x8316=['rimraf','bluebird','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','tableHeader','map','pick','toString','fill','length','body','push','concat','chunk','keys','forEach','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','startDate','format','endDate','header','pageBreak','before','margin','footer','Arial','right','num','Empty','Setting','split','splitSizePdf','then','range','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','basename','.pdf','join','mkdirSync','each','flatten','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','PDF','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','inspect','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','createPdfKitDocument','lodash','util','path','html-to-pdfmake'];(function(_0x2d7134,_0x27e314){var _0x480d83=function(_0x1f41f4){while(--_0x1f41f4){_0x2d7134['push'](_0x2d7134['shift']());}};_0x480d83(++_0x27e314);}(_0x8316,0xa6));var _0x6831=function(_0x5bdcef,_0x39b56b){_0x5bdcef=_0x5bdcef-0x0;var _0x3bef65=_0x8316[_0x5bdcef];return _0x3bef65;};'use strict';var _=require(_0x6831('0x0'));var fs=require('fs');var util=require(_0x6831('0x1'));var path=require(_0x6831('0x2'));var moment=require('moment');var htmlToPdfmake=require(_0x6831('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require('zip-dir');var rimraf=require(_0x6831('0x4'));var JSDOM=require('jsdom')['JSDOM'];var window=new JSDOM('')['window'];var BPromise=require(_0x6831('0x5'));var db=require(_0x6831('0x6'))['db'];var dbH=require(_0x6831('0x6'))[_0x6831('0x7')];var logger=require('../../config/logger')(_0x6831('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x6831('0x9')][0x2]);var QUERY=process[_0x6831('0x9')][0x3];var PATH=process[_0x6831('0x9')][0x4];var NAME=process[_0x6831('0x9')][0x5];var FORMAT=_0x6831('0xa');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x5b106a,_0x5e3e26){var _0xd3c93a={'status':_0x5b106a};var _0x5181a8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5e3e26){_0xd3c93a[_0x6831('0xb')]=_0x5e3e26;}return db[_0x6831('0xc')][_0x6831('0xd')](_0xd3c93a,_0x5181a8);}function getHeaders(_0xf16449){return _['map'](_0xf16449,function(_0x33bb41){return{'text':_0x33bb41,'style':_0x6831('0xe')};});}function getRows(_0x36196a,_0x37a60c){return _[_0x6831('0xf')](_0x37a60c,function(_0x377178){return _(_0x377178)[_0x6831('0x10')](_0x36196a)[_0x6831('0xf')](function(_0xdb57cf){return _0xdb57cf?_[_0x6831('0x11')](_0xdb57cf):'';})['value']();});}function createTable(_0x961f0d,_0x11a423){var _0x75542d={'widths':_[_0x6831('0x12')](Array(_0x961f0d[_0x6831('0x13')]),0x91),'heights':function(_0x970d2d){return _0x970d2d===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x240d39=getHeaders(_0x961f0d);_0x75542d[_0x6831('0x14')][_0x6831('0x15')](_0x240d39);var _0x41da47=getRows(_0x961f0d,_0x11a423);_0x75542d['body']=_0x75542d[_0x6831('0x14')][_0x6831('0x16')](_0x41da47);return _0x75542d;}function createTables(_0xe31dd4){var _0x597b4a=[];var _0x49ec66=_[_0x6831('0x17')](Object[_0x6831('0x18')](_0xe31dd4[0x0]),0x5);_0x49ec66[_0x6831('0x19')](function(_0x24ce30){_0x597b4a['push'](createTable(_0x24ce30,_0xe31dd4));});return _0x597b4a;}function getPDFDocDefinition(_0x128c3b){var _0x48af5c=util['format'](_0x6831('0x1a'),NAME,EXTRACTED_REPORT[_0x6831('0x1b')],moment(EXTRACTED_REPORT[_0x6831('0x1c')])[_0x6831('0x1d')](FORMAT),moment(EXTRACTED_REPORT[_0x6831('0x1e')])['format'](FORMAT));var _0x55239a=[];for(var _0x33f7b9=0x0;_0x33f7b9<_0x128c3b[_0x6831('0x13')];_0x33f7b9++){var _0x57364d=[];if(_0x33f7b9===0x0){_0x57364d['push']({'text':_0x48af5c,'style':_0x6831('0x1f')});}var _0x2c65f2={'table':_0x128c3b[_0x33f7b9]};if(_0x33f7b9>0x0){_0x2c65f2[_0x6831('0x20')]=_0x6831('0x21');_0x2c65f2[_0x6831('0x22')]=[0x0,0x46,0x0,0x0];}_0x57364d[_0x6831('0x15')](_0x2c65f2);_0x55239a[_0x6831('0x15')](_0x57364d);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x55239a,'footer':function(_0x1a9804,_0x19b41b){return{'text':_0x1a9804[_0x6831('0x11')]()+'\x20/\x20'+_0x19b41b,'style':_0x6831('0x23')};},'defaultStyle':{'font':_0x6831('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0x6831('0x25'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1f47da){var _0x41c543=0x1388;var _0x3a8a63;if(!_0x1f47da[0x0][_0x6831('0x26')]){return analyticExtractedReport(_0x6831('0x27'));}return db[_0x6831('0x28')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x6831('0x29'),_0x6831('0x2a')]})[_0x6831('0x2b')](function(_0x52de37){if(_0x52de37){_0x3a8a63=_0x52de37;_0x41c543=_0x3a8a63[_0x6831('0x2a')]||0x3e8;}})[_0x6831('0x2b')](function(){var _0x199965=[];var _0x31502a=0x0;if(_0x3a8a63[_0x6831('0x29')]){if(_0x1f47da&&_0x1f47da[_0x6831('0x13')]){var _0x40a2c0=_[_0x6831('0x2c')](_0x1f47da[0x0]['num']/_0x41c543);var _0x23c598=Number['isInteger'](_0x1f47da[0x0][_0x6831('0x26')]/_0x41c543)?_0x1f47da[0x0][_0x6831('0x26')]%_0x41c543:0x0;_0x40a2c0[_0x6831('0x19')](function(_0xa64134){if(_0xa64134>0x0){_0x31502a+=_0x41c543;}_0x199965['push'](dbH[_0x6831('0x2d')][_0x6831('0x2e')](util['format'](_0x6831('0x2f'),QUERY,_0x41c543,_0x31502a),{'type':dbH[_0x6831('0x2d')][_0x6831('0x30')]['SELECT']}));});if(_0x23c598>0x0){_0x31502a+=_0x41c543;_0x199965['push'](dbH['sequelize'][_0x6831('0x2e')](util[_0x6831('0x1d')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x23c598,_0x31502a),{'type':dbH[_0x6831('0x2d')][_0x6831('0x30')]['SELECT']}));}}}else{_0x199965[_0x6831('0x15')](dbH[_0x6831('0x2d')][_0x6831('0x2e')](QUERY,{'type':dbH[_0x6831('0x2d')][_0x6831('0x30')][_0x6831('0x31')]}));}var _0x2fef06=path['dirname'](PATH);var _0x199981=path[_0x6831('0x32')](PATH,_0x6831('0x33'));var _0x1e30ff=_0x3a8a63[_0x6831('0x29')]&&_0x199965['length']>0x1;var _0x41da12=[];if(!fs['existsSync'](path[_0x6831('0x34')](_0x2fef06,_0x199981))&&_0x1e30ff){fs[_0x6831('0x35')](path[_0x6831('0x34')](_0x2fef06,_0x199981));}return BPromise[_0x6831('0x36')](_0x199965,function(_0x23342f){_0x41da12[_0x6831('0x15')](_0x23342f);})['then'](function(){var _0x2e38cb=[];for(var _0x4a0ae7=0x0;_0x4a0ae7<_0x41da12[_0x6831('0x13')];_0x4a0ae7+=0x1){var _0x45c5bc=_0x41da12[_0x4a0ae7];var _0x50f393=createTables(_[_0x6831('0x37')](_0x45c5bc));var _0x5be009;var _0x39773f=getPDFDocDefinition(_0x50f393);var _0x4c7057=getPDFPrinter();var _0x466fd3=_0x4c7057['createPdfKitDocument'](_0x39773f);if(_0x1e30ff){_0x5be009=path[_0x6831('0x34')](_0x2fef06,_0x199981,util[_0x6831('0x1d')](_0x6831('0x38'),_0x199981,_0x4a0ae7,_0x6831('0x39')));}else{_0x5be009=path[_0x6831('0x34')](_0x2fef06,util['format'](_0x6831('0x3a'),_0x199981,_0x6831('0x39')));}_0x2e38cb[_0x6831('0x15')](writePDFDocument(_0x466fd3,_0x5be009));}return Promise[_0x6831('0x3b')](_0x2e38cb);})[_0x6831('0x2b')](function(){if(_0x1e30ff){return new Promise(function(_0x2922c0){zipdir(path[_0x6831('0x34')](_0x2fef06,_0x199981),{'saveTo':path[_0x6831('0x34')](_0x2fef06,util[_0x6831('0x1d')](_0x6831('0x3a'),_0x199981,_0x6831('0x3c')))},function(){rimraf(path[_0x6831('0x34')](_0x2fef06,_0x199981),function(){});_0x2922c0(_0x6831('0x3d'));});});}})[_0x6831('0x2b')](function(){if(!_0x1e30ff)return;rimraf(path[_0x6831('0x34')](_0x2fef06,_0x199981),function(){});})[_0x6831('0x2b')](function(){logger['info'](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x6831('0x3e')));return analyticExtractedReport('Completed',_0x1e30ff?util[_0x6831('0x1d')]('%s.%s',_0x199981,_0x1e30ff?_0x6831('0x3c'):_0x6831('0x39')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x6831('0x3f')](util[_0x6831('0x1d')](_0x6831('0x40'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x6831('0xc')][_0x6831('0x41')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0xce4f14){EXTRACTED_REPORT=_0xce4f14;return dbH[_0x6831('0x2d')]['query'](util[_0x6831('0x1d')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x6831('0x2d')]['QueryTypes']['SELECT']});})[_0x6831('0x2b')](extractReport)['catch'](function(_0xbc944c){logger[_0x6831('0x3f')](util[_0x6831('0x1d')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x6831('0x3e')),util[_0x6831('0x42')](_0xbc944c,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x6831('0x43'));})[_0x6831('0x44')](function(){process[_0x6831('0x45')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x2fd318=new PdfPrinter({'Arial':{'normal':__dirname+_0x6831('0x46'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x6831('0x47'),'bolditalics':__dirname+_0x6831('0x48')}});return _0x2fd318;}function getPDFDocDefinitionFromHTML(_0x20972e,_0x1ded6b){var _0x5a29fe=util[_0x6831('0x1d')]('%s\x20#%d',_0x1ded6b[_0x6831('0x49')],_0x1ded6b[_0x6831('0x4a')]);var _0xc2e79b=moment()['format'](_0x6831('0x4b'))['toString']();var _0x3818ad=htmlToPdfmake(_0x20972e,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3818ad],'defaultStyle':{'font':_0x6831('0x24')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':'center','margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':'center'}},'header':function(){return[{'text':_0x6831('0x4c'),'style':'header'}];},'footer':function(_0x808d56,_0x517ad4){return[{'text':util[_0x6831('0x1d')](_0x6831('0x4d'),_0x5a29fe,_0x808d56,_0x517ad4,_0xc2e79b),'style':_0x6831('0x23')}];}};}function writePDFDocument(_0x4f852e,_0x281616){return new Promise(function(_0x482aa9,_0x4c3349){var _0x56a6a6=_0x4f852e[_0x6831('0x4e')](fs[_0x6831('0x4f')](_0x281616));_0x56a6a6['on']('finish',function(){_0x482aa9(_0x6831('0x50'));});_0x56a6a6['on'](_0x6831('0x51'),function(_0x5aa0d2){_0x4c3349(_0x5aa0d2);});_0x4f852e[_0x6831('0x52')]();});}exports[_0x6831('0x53')]=function(_0x1663e8,_0x57e5f6){var _0x433386=getPDFPrinter();var _0x367d4a=getPDFDocDefinitionFromHTML(_0x1663e8,_0x57e5f6);var _0x3dc5f4=_0x433386[_0x6831('0x54')](_0x367d4a);return writePDFDocument(_0x3dc5f4,_0x57e5f6[_0x6831('0x2')])['catch'](function(_0x5dd78d){throw _0x5dd78d;});};
\ No newline at end of file
index e404f94..ce47664 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0e18=['length','range','num','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','json2xls','zip-dir','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Empty','split'];(function(_0x328d12,_0x470323){var _0x3fed8b=function(_0x375508){while(--_0x375508){_0x328d12['push'](_0x328d12['shift']());}};_0x3fed8b(++_0x470323);}(_0x0e18,0x125));var _0x80e1=function(_0x4abe52,_0x346d7d){_0x4abe52=_0x4abe52-0x0;var _0x4f0fe8=_0x0e18[_0x4abe52];return _0x4f0fe8;};'use strict';var util=require(_0x80e1('0x0'));var path=require(_0x80e1('0x1'));var _=require(_0x80e1('0x2'));var fs=require('fs');var json2xls=require(_0x80e1('0x3'));var BPromise=require('bluebird');var zipdir=require(_0x80e1('0x4'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0x80e1('0x5'))[_0x80e1('0x6')];var logger=require(_0x80e1('0x7'))(_0x80e1('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x80e1('0x9')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5b1697,_0xc5f2b2){var _0x493403={'status':_0x5b1697};var _0x3bad5f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xc5f2b2){_0x493403[_0x80e1('0xa')]=_0xc5f2b2;}return db['AnalyticExtractedReport'][_0x80e1('0xb')](_0x493403,_0x3bad5f);}function main(){var _0x215880=0x1388;var _0x158871;logger[_0x80e1('0xc')](util['format'](_0x80e1('0xd'),EXTRACTED_REPORT_ID,_0x80e1('0xe')));return db[_0x80e1('0xf')][_0x80e1('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x80e1('0x11')]})['then'](function(_0x32a649){if(_0x32a649){_0x158871=_0x32a649;_0x215880=_0x158871[_0x80e1('0x11')]||0x1388;}})[_0x80e1('0x12')](function(){return dbH[_0x80e1('0x13')][_0x80e1('0x14')](util[_0x80e1('0x15')](_0x80e1('0x16'),QUERY),{'type':dbH[_0x80e1('0x13')]['QueryTypes']['SELECT']});})[_0x80e1('0x12')](function(_0x23f84c){if(!_0x23f84c[0x0]['num']){return analyticExtractedReport(_0x80e1('0x17'));}var _0xac324a=[];var _0x573e5f=0x0;if(_0x158871[_0x80e1('0x18')]){if(_0x23f84c&&_0x23f84c[_0x80e1('0x19')]){var _0x299931=_[_0x80e1('0x1a')](_0x23f84c[0x0][_0x80e1('0x1b')]/_0x215880);var _0x915800=Number[_0x80e1('0x1c')](_0x23f84c[0x0][_0x80e1('0x1b')]/_0x215880)?_0x23f84c[0x0][_0x80e1('0x1b')]%_0x215880:0x0;_0x299931[_0x80e1('0x1d')](function(_0x3e8236){if(_0x3e8236>0x0){_0x573e5f+=_0x215880;}_0xac324a[_0x80e1('0x1e')](dbH[_0x80e1('0x13')][_0x80e1('0x14')](util[_0x80e1('0x15')](_0x80e1('0x1f'),QUERY,_0x215880,_0x573e5f),{'type':dbH['sequelize'][_0x80e1('0x20')][_0x80e1('0x21')]}));});if(_0x915800>0x0){_0x573e5f+=_0x215880;_0xac324a[_0x80e1('0x1e')](dbH[_0x80e1('0x13')][_0x80e1('0x14')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x915800,_0x573e5f),{'type':dbH[_0x80e1('0x13')][_0x80e1('0x20')][_0x80e1('0x21')]}));}}}else{_0xac324a['push'](dbH['sequelize'][_0x80e1('0x14')](QUERY,{'type':dbH[_0x80e1('0x13')][_0x80e1('0x20')][_0x80e1('0x21')]}));}var _0x372a5e=path[_0x80e1('0x22')](PATH);var _0x567035=path[_0x80e1('0x23')](PATH,'.xlsx');var _0x19f0bc=_0x158871[_0x80e1('0x18')]&&_0xac324a[_0x80e1('0x19')]>0x1;var _0x454346=[];if(!fs['existsSync'](path[_0x80e1('0x24')](_0x372a5e,_0x567035))&&_0x19f0bc){fs[_0x80e1('0x25')](path[_0x80e1('0x24')](_0x372a5e,_0x567035));}return BPromise[_0x80e1('0x26')](_0xac324a,function(_0x5de26b){_0x454346[_0x80e1('0x1e')](_0x5de26b);})[_0x80e1('0x12')](function(){for(var _0x4b6f2e=0x0;_0x4b6f2e<_0x454346[_0x80e1('0x19')];_0x4b6f2e+=0x1){var _0x392f6e;var _0x546865=_0x454346[_0x4b6f2e];if(_0x19f0bc){_0x392f6e=path[_0x80e1('0x24')](_0x372a5e,_0x567035,util['format'](_0x80e1('0x27'),_0x567035,_0x4b6f2e,_0x80e1('0x28')));}else{_0x392f6e=path[_0x80e1('0x24')](_0x372a5e,util[_0x80e1('0x15')](_0x80e1('0x29'),_0x567035,_0x80e1('0x28')));}fs[_0x80e1('0x2a')](_0x392f6e,json2xls(_0x546865),_0x80e1('0x2b'));}})[_0x80e1('0x12')](function(){if(_0x19f0bc){return new Promise(function(_0x34b0ba){zipdir(path['join'](_0x372a5e,_0x567035),{'saveTo':path['join'](_0x372a5e,util[_0x80e1('0x15')]('%s.%s',_0x567035,_0x80e1('0x2c')))},function(_0x5c5f1d,_0x2ecdbd){rimraf(path['join'](_0x372a5e,_0x567035),function(){});_0x34b0ba(_0x80e1('0x2d'));});});}})[_0x80e1('0x12')](function(){logger[_0x80e1('0xc')](util[_0x80e1('0x15')](_0x80e1('0x2e'),EXTRACTED_REPORT_ID,_0x80e1('0xe')));return analyticExtractedReport(_0x80e1('0x2f'),_0x19f0bc?util['format'](_0x80e1('0x29'),_0x567035,_0x19f0bc?_0x80e1('0x2c'):'xlsx'):null);});})[_0x80e1('0x30')](function(_0x1c2ec6){logger[_0x80e1('0xc')](util[_0x80e1('0x15')](_0x80e1('0x31'),EXTRACTED_REPORT_ID,'XLSX'),util[_0x80e1('0x32')](_0x1c2ec6,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x80e1('0x33'));})[_0x80e1('0x34')](function(){process['exit'](EXIT_CODE);});}main();
\ No newline at end of file
+var _0x9068=['.xlsx','existsSync','mkdirSync','join','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','length','range','forEach','push','format','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename'];(function(_0x2a612d,_0x3a41a6){var _0x2da3b5=function(_0x58e7c5){while(--_0x58e7c5){_0x2a612d['push'](_0x2a612d['shift']());}};_0x2da3b5(++_0x3a41a6);}(_0x9068,0xea));var _0x8906=function(_0x15c89c,_0x5468f0){_0x15c89c=_0x15c89c-0x0;var _0xc08e1c=_0x9068[_0x15c89c];return _0xc08e1c;};'use strict';var util=require(_0x8906('0x0'));var path=require('path');var _=require(_0x8906('0x1'));var fs=require('fs');var json2xls=require(_0x8906('0x2'));var BPromise=require(_0x8906('0x3'));var zipdir=require(_0x8906('0x4'));var rimraf=require(_0x8906('0x5'));var db=require(_0x8906('0x6'))['db'];var dbH=require(_0x8906('0x6'))[_0x8906('0x7')];var logger=require(_0x8906('0x8'))(_0x8906('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x8906('0xa')][0x2]);var QUERY=process[_0x8906('0xa')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x2b38c6,_0x5690a2){var _0x3329f8={'status':_0x2b38c6};var _0x15bb34={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5690a2){_0x3329f8[_0x8906('0xb')]=_0x5690a2;}return db[_0x8906('0xc')]['update'](_0x3329f8,_0x15bb34);}function main(){var _0x22c2ce=0x1388;var _0x3dd59d;logger[_0x8906('0xd')](util['format'](_0x8906('0xe'),EXTRACTED_REPORT_ID,_0x8906('0xf')));return db[_0x8906('0x10')][_0x8906('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8906('0x12'),_0x8906('0x13')]})[_0x8906('0x14')](function(_0x5a1859){if(_0x5a1859){_0x3dd59d=_0x5a1859;_0x22c2ce=_0x3dd59d[_0x8906('0x13')]||0x1388;}})['then'](function(){return dbH['sequelize'][_0x8906('0x15')](util['format'](_0x8906('0x16'),QUERY),{'type':dbH[_0x8906('0x17')][_0x8906('0x18')][_0x8906('0x19')]});})[_0x8906('0x14')](function(_0x5c291b){if(!_0x5c291b[0x0][_0x8906('0x1a')]){return analyticExtractedReport(_0x8906('0x1b'));}var _0x36e079=[];var _0x5f290c=0x0;if(_0x3dd59d[_0x8906('0x12')]){if(_0x5c291b&&_0x5c291b[_0x8906('0x1c')]){var _0x34702c=_[_0x8906('0x1d')](_0x5c291b[0x0]['num']/_0x22c2ce);var _0x13f2e3=Number['isInteger'](_0x5c291b[0x0][_0x8906('0x1a')]/_0x22c2ce)?_0x5c291b[0x0][_0x8906('0x1a')]%_0x22c2ce:0x0;_0x34702c[_0x8906('0x1e')](function(_0x41e027){if(_0x41e027>0x0){_0x5f290c+=_0x22c2ce;}_0x36e079[_0x8906('0x1f')](dbH[_0x8906('0x17')][_0x8906('0x15')](util[_0x8906('0x20')](_0x8906('0x21'),QUERY,_0x22c2ce,_0x5f290c),{'type':dbH[_0x8906('0x17')]['QueryTypes']['SELECT']}));});if(_0x13f2e3>0x0){_0x5f290c+=_0x22c2ce;_0x36e079[_0x8906('0x1f')](dbH[_0x8906('0x17')][_0x8906('0x15')](util[_0x8906('0x20')](_0x8906('0x21'),QUERY,_0x13f2e3,_0x5f290c),{'type':dbH[_0x8906('0x17')]['QueryTypes'][_0x8906('0x19')]}));}}}else{_0x36e079[_0x8906('0x1f')](dbH[_0x8906('0x17')][_0x8906('0x15')](QUERY,{'type':dbH['sequelize'][_0x8906('0x18')][_0x8906('0x19')]}));}var _0x333875=path[_0x8906('0x22')](PATH);var _0x9aae11=path[_0x8906('0x23')](PATH,_0x8906('0x24'));var _0x46aa63=_0x3dd59d['split']&&_0x36e079['length']>0x1;var _0x229704=[];if(!fs[_0x8906('0x25')](path['join'](_0x333875,_0x9aae11))&&_0x46aa63){fs[_0x8906('0x26')](path[_0x8906('0x27')](_0x333875,_0x9aae11));}return BPromise[_0x8906('0x28')](_0x36e079,function(_0x537dd9){_0x229704[_0x8906('0x1f')](_0x537dd9);})[_0x8906('0x14')](function(){for(var _0x4a1b5d=0x0;_0x4a1b5d<_0x229704[_0x8906('0x1c')];_0x4a1b5d+=0x1){var _0x5cf107;var _0x264b53=_0x229704[_0x4a1b5d];if(_0x46aa63){_0x5cf107=path[_0x8906('0x27')](_0x333875,_0x9aae11,util[_0x8906('0x20')](_0x8906('0x29'),_0x9aae11,_0x4a1b5d,_0x8906('0x2a')));}else{_0x5cf107=path[_0x8906('0x27')](_0x333875,util[_0x8906('0x20')](_0x8906('0x2b'),_0x9aae11,_0x8906('0x2a')));}fs[_0x8906('0x2c')](_0x5cf107,json2xls(_0x264b53),_0x8906('0x2d'));}})[_0x8906('0x14')](function(){if(_0x46aa63){return new Promise(function(_0x141520){zipdir(path[_0x8906('0x27')](_0x333875,_0x9aae11),{'saveTo':path[_0x8906('0x27')](_0x333875,util[_0x8906('0x20')](_0x8906('0x2b'),_0x9aae11,'zip'))},function(_0x473874,_0x225e1a){rimraf(path[_0x8906('0x27')](_0x333875,_0x9aae11),function(){});_0x141520('zip\x20finished');});});}})[_0x8906('0x14')](function(){logger['info'](util[_0x8906('0x20')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x8906('0xf')));return analyticExtractedReport(_0x8906('0x2e'),_0x46aa63?util[_0x8906('0x20')](_0x8906('0x2b'),_0x9aae11,_0x46aa63?_0x8906('0x2f'):'xlsx'):null);});})[_0x8906('0x30')](function(_0xec0643){logger[_0x8906('0xd')](util[_0x8906('0x20')](_0x8906('0x31'),EXTRACTED_REPORT_ID,_0x8906('0xf')),util[_0x8906('0x32')](_0xec0643,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x8906('0x33'));})[_0x8906('0x34')](function(){process[_0x8906('0x35')](EXIT_CODE);});}main();
\ No newline at end of file
index f1a6ea9..4f09c2a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa4b0=['CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','createdAt','updatedAt','*,*,*,*','interval','CDR(tag)=','tag','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1',',${EXTEN},','last','concat','Hangup','transaction','VoiceExtension','destroy','catch','rewrite','util','Interval','findAll','then','intervals','models','IntervalId','map','exten','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','push','type','format','context','VoiceExtensionId','inbound','outbound','${EXTEN:','cutdigits','${EXTEN}','Set'];(function(_0x4d0b1f,_0x3e9d04){var _0xde9596=function(_0x2beec4){while(--_0x2beec4){_0x4d0b1f['push'](_0x4d0b1f['shift']());}};_0xde9596(++_0x3e9d04);}(_0xa4b0,0xb0));var _0x0a4b=function(_0x14e2e2,_0x16fd14){_0x14e2e2=_0x14e2e2-0x0;var _0x396e58=_0xa4b0[_0x14e2e2];return _0x396e58;};'use strict';var _=require('lodash');var util=require(_0x0a4b('0x0'));function rewrite(_0x13bfaa,_0x2b0d8a){var _0x2fd12d=this;return _0x13bfaa['models'][_0x0a4b('0x1')][_0x0a4b('0x2')]({'raw':!![]})[_0x0a4b('0x3')](function(_0xd6e7dc){_0x2fd12d[_0x0a4b('0x4')]=_0xd6e7dc;return _0x13bfaa[_0x0a4b('0x5')]['VoiceExtension'][_0x0a4b('0x2')]({'where':{'IntervalId':_0x2b0d8a[_0x0a4b('0x6')]},'raw':!![]});})[_0x0a4b('0x3')](function(_0x109425){return _0x13bfaa[_0x0a4b('0x5')]['VoiceExtension'][_0x0a4b('0x2')]({'where':{'exten':{'$in':_['uniq'](_[_0x0a4b('0x7')](_0x109425,_0x0a4b('0x8')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})['then'](function(_0x3e3eb6){var _0x4a712e=_['filter'](_0x3e3eb6,{'priority':'1'});var _0x139087=_[_0x0a4b('0x9')](_0x3e3eb6,{'isApp':0x1});var _0x37be4b=_[_0x0a4b('0xa')](_0x139087,_0x0a4b('0x8'));var _0x5bb89e=[_0x0a4b('0xb'),_0x0a4b('0xc')];var _0x5148e4=[];var _0x4651a6=[];for(var _0x48709a in _0x37be4b){if(_0x37be4b[_0x0a4b('0xd')](_0x48709a)){_0x2fd12d[_0x0a4b('0xe')]=0x2;_0x2fd12d[_0x0a4b('0xf')]=[];_0x2fd12d[_0x0a4b('0x10')]=_['find'](_0x4a712e,{'exten':_0x37be4b[_0x48709a][0x0]['exten']});_0x2fd12d[_0x0a4b('0xf')][_0x0a4b('0x11')]({'type':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x12')],'app':'Set','appdata':util[_0x0a4b('0x13')]('CDR(type)=%s',_0x37be4b[_0x48709a][0x0]['type']),'context':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x14')],'exten':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x8')],'priority':_0x2fd12d[_0x0a4b('0xe')]++,'VoiceExtensionId':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')]});if(_0x37be4b[_0x48709a][0x0][_0x0a4b('0x12')]===_0x0a4b('0x16')){_0x2fd12d[_0x0a4b('0xf')][_0x0a4b('0x11')]({'type':_0x37be4b[_0x48709a][0x0]['type'],'app':'Set','appdata':'CDR(routeid)='+_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')],'context':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x14')],'exten':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x8')],'priority':_0x2fd12d[_0x0a4b('0xe')]++,'VoiceExtensionId':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')]});}else if(_0x37be4b[_0x48709a][0x0][_0x0a4b('0x12')]===_0x0a4b('0x17')){if(_0x2fd12d[_0x0a4b('0x10')]){_0x2fd12d[_0x0a4b('0xf')]['push']({'type':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x12')],'app':'Set','appdata':'CDR(destination)='+(_0x2fd12d[_0x0a4b('0x10')]['cutdigits']?_0x0a4b('0x18')+_0x2fd12d['extension'][_0x0a4b('0x19')]+'}':_0x0a4b('0x1a')),'context':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x14')],'exten':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x8')],'priority':_0x2fd12d[_0x0a4b('0xe')]++,'VoiceExtensionId':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')]});}_0x2fd12d[_0x0a4b('0xf')][_0x0a4b('0x11')]({'type':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x12')],'app':_0x0a4b('0x1b'),'appdata':_0x0a4b('0x1c')+_0x37be4b[_0x48709a][0x0]['VoiceExtensionId'],'context':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x14')],'exten':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x8')],'priority':_0x2fd12d['priority']++,'VoiceExtensionId':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')]});var _0x44ed9f=_0x2fd12d['priority']++;_0x2fd12d[_0x0a4b('0xf')]['push']({'type':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x12')],'app':'ExecIf','appdata':_0x0a4b('0x1d')+(_0x44ed9f+0x2)+_0x0a4b('0x1e')+(_0x44ed9f+0x1)+')','context':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x14')],'exten':_0x37be4b[_0x48709a][0x0]['exten'],'priority':_0x44ed9f,'VoiceExtensionId':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')]});if(_0x2fd12d['extension']){_0x2fd12d[_0x0a4b('0xf')]['push']({'type':_0x37be4b[_0x48709a][0x0]['type'],'app':_0x0a4b('0x1b'),'appdata':_0x2fd12d[_0x0a4b('0x10')][_0x0a4b('0x19')]?_0x0a4b('0x1f')+_0x2fd12d[_0x0a4b('0x10')]['cutdigits']+'}':_0x0a4b('0x20'),'context':_0x37be4b[_0x48709a][0x0]['context'],'exten':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x8')],'priority':_0x2fd12d[_0x0a4b('0xe')]++,'VoiceExtensionId':_0x37be4b[_0x48709a][0x0]['VoiceExtensionId']});}_0x2fd12d[_0x0a4b('0xf')][_0x0a4b('0x11')]({'type':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x12')],'app':_0x0a4b('0x1b'),'appdata':_0x0a4b('0x21')+_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')],'context':_0x37be4b[_0x48709a][0x0]['context'],'exten':_0x37be4b[_0x48709a][0x0]['exten'],'priority':_0x2fd12d[_0x0a4b('0xe')]++,'VoiceExtensionId':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')]});if(_0x2fd12d[_0x0a4b('0x10')]&&_0x2fd12d[_0x0a4b('0x10')]['hasOwnProperty'](_0x0a4b('0x22'))&&_0x2fd12d['extension'][_0x0a4b('0x22')]!=='none'){_0x2fd12d['extensions'][_0x0a4b('0x11')]({'type':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x12')],'app':'Set','appdata':_0x0a4b('0x23'),'context':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x14')],'exten':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x8')],'priority':_0x2fd12d['priority']++,'VoiceExtensionId':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')]});_0x2fd12d['extensions'][_0x0a4b('0x11')]({'type':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x12')],'app':_0x0a4b('0x1b'),'appdata':_0x0a4b('0x24')+_0x2fd12d[_0x0a4b('0x10')][_0x0a4b('0x22')]||_0x0a4b('0x25'),'context':_0x37be4b[_0x48709a][0x0]['context'],'exten':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x8')],'priority':_0x2fd12d[_0x0a4b('0xe')]++,'VoiceExtensionId':_0x37be4b[_0x48709a][0x0]['VoiceExtensionId']});}}_0x2fd12d[_0x0a4b('0xf')][_0x0a4b('0x11')]({'type':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x12')],'app':_0x0a4b('0x1b'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x14')],'exten':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x8')],'priority':_0x2fd12d['priority']++,'VoiceExtensionId':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')]});_0x2fd12d[_0x0a4b('0xf')][_0x0a4b('0x11')]({'type':_0x37be4b[_0x48709a][0x0]['type'],'app':_0x0a4b('0x1b'),'appdata':_0x0a4b('0x26'),'context':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x14')],'exten':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x8')],'priority':_0x2fd12d[_0x0a4b('0xe')]++,'VoiceExtensionId':_0x37be4b[_0x48709a][0x0]['VoiceExtensionId']});_0x2fd12d[_0x0a4b('0xf')][_0x0a4b('0x11')]({'type':_0x37be4b[_0x48709a][0x0]['type'],'app':_0x0a4b('0x1b'),'appdata':'MONITOR_OPTIONS=ab','context':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x14')],'exten':_0x37be4b[_0x48709a][0x0]['exten'],'priority':_0x2fd12d[_0x0a4b('0xe')]++,'VoiceExtensionId':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')]});for(var _0x294d74=0x0,_0x154a46=0x0;_0x294d74<_0x37be4b[_0x48709a][_0x0a4b('0x27')];_0x294d74+=0x1,_0x154a46=0x0){var _0xdd1a28=_0x37be4b[_0x48709a][_0x294d74];if(_0xdd1a28[_0x0a4b('0x12')]){_0xdd1a28[_0x0a4b('0x12')]=_0xdd1a28[_0x0a4b('0x12')][_0x0a4b('0x28')]();}var _0x4d2ca7=[];var _0x5b530b=[];delete _0xdd1a28['id'];delete _0xdd1a28[_0x0a4b('0x29')];delete _0xdd1a28[_0x0a4b('0x2a')];var _0x20867d=_0xdd1a28['interval']!==_0x0a4b('0x2b')?[_0xdd1a28[_0x0a4b('0x2c')]]:_0xdd1a28['IntervalId']?_['map'](_[_0x0a4b('0x9')](_0x2fd12d[_0x0a4b('0x4')],{'IntervalId':_0xdd1a28[_0x0a4b('0x6')]}),_0x0a4b('0x2c')):[];if(_0xdd1a28['hasOwnProperty']('tag')){if(_0xdd1a28['tag']&&_0xdd1a28['tag']!=='--'){_0x4d2ca7[_0x0a4b('0x11')]({'type':_0xdd1a28[_0x0a4b('0x12')],'app':_0x0a4b('0x1b'),'appdata':_0x0a4b('0x2d')+_0xdd1a28[_0x0a4b('0x2e')],'context':_0xdd1a28[_0x0a4b('0x14')],'exten':_0xdd1a28[_0x0a4b('0x8')],'priority':_0x20867d['length']+_0x2fd12d[_0x0a4b('0xe')]+_0x154a46++,'VoiceExtensionId':_0xdd1a28['VoiceExtensionId']});}}if(_0xdd1a28['type']===_0x0a4b('0x17')&&_0xdd1a28['hasOwnProperty'](_0x0a4b('0x2f'))){if(_0xdd1a28[_0x0a4b('0x2f')]){_0x4d2ca7[_0x0a4b('0x11')]({'type':_0xdd1a28[_0x0a4b('0x12')],'app':_0x0a4b('0x30'),'appdata':_0x0a4b('0x31')+_0xdd1a28['callerID']+')','context':_0xdd1a28[_0x0a4b('0x14')],'exten':_0xdd1a28['exten'],'priority':_0x20867d[_0x0a4b('0x27')]+_0x2fd12d['priority']+_0x154a46++,'VoiceExtensionId':_0xdd1a28[_0x0a4b('0x15')]});}else{_0x4d2ca7[_0x0a4b('0x11')]({'type':_0xdd1a28['type'],'app':'ExecIf','appdata':_0x0a4b('0x32'),'context':_0xdd1a28[_0x0a4b('0x14')],'exten':_0xdd1a28[_0x0a4b('0x8')],'priority':_0x20867d[_0x0a4b('0x27')]+_0x2fd12d[_0x0a4b('0xe')]+_0x154a46++,'VoiceExtensionId':_0xdd1a28['VoiceExtensionId']});}}if(_0xdd1a28['hasOwnProperty'](_0x0a4b('0x33'))){if(_0x5bb89e[_0x0a4b('0x34')](_0xdd1a28[_0x0a4b('0x35')][_0x0a4b('0x28')]())>=0x0&&_0xdd1a28['appType']!==_0x0a4b('0x36')){if(_0xdd1a28[_0x0a4b('0x33')]){_0x4d2ca7['push']({'type':_0xdd1a28[_0x0a4b('0x12')],'app':_0x0a4b('0x30'),'appdata':_0x0a4b('0x37'),'context':_0xdd1a28['context'],'exten':_0xdd1a28[_0x0a4b('0x8')],'priority':_0x20867d[_0x0a4b('0x27')]+_0x2fd12d['priority']+_0x154a46++,'VoiceExtensionId':_0xdd1a28[_0x0a4b('0x15')]});_0x4d2ca7['push']({'type':_0xdd1a28[_0x0a4b('0x12')],'app':_0x0a4b('0x1b'),'appdata':_0x0a4b('0x38'),'context':_0xdd1a28[_0x0a4b('0x14')],'exten':_0xdd1a28[_0x0a4b('0x8')],'priority':_0x20867d[_0x0a4b('0x27')]+_0x2fd12d[_0x0a4b('0xe')]+_0x154a46++,'VoiceExtensionId':_0xdd1a28[_0x0a4b('0x15')]});}else{_0x4d2ca7[_0x0a4b('0x11')]({'type':_0xdd1a28[_0x0a4b('0x12')],'app':'ExecIf','appdata':_0x0a4b('0x39'),'context':_0xdd1a28[_0x0a4b('0x14')],'exten':_0xdd1a28['exten'],'priority':_0x20867d[_0x0a4b('0x27')]+_0x2fd12d['priority']+_0x154a46++,'VoiceExtensionId':_0xdd1a28[_0x0a4b('0x15')]});_0x4d2ca7[_0x0a4b('0x11')]({'type':_0xdd1a28['type'],'app':_0x0a4b('0x1b'),'appdata':_0x0a4b('0x3a'),'context':_0xdd1a28[_0x0a4b('0x14')],'exten':_0xdd1a28[_0x0a4b('0x8')],'priority':_0x20867d[_0x0a4b('0x27')]+_0x2fd12d[_0x0a4b('0xe')]+_0x154a46++,'VoiceExtensionId':_0xdd1a28[_0x0a4b('0x15')]});}}}for(var _0x112092=0x0;_0x112092<_0x20867d[_0x0a4b('0x27')];_0x112092+=0x1){var _0x4fa54d=_0x2fd12d[_0x0a4b('0xe')]+_0x20867d[_0x0a4b('0x27')];var _0x58f285=_0x112092===_0x20867d[_0x0a4b('0x27')]-0x1?_0x2fd12d[_0x0a4b('0xe')]+_0x4d2ca7['length']+_0x5b530b[_0x0a4b('0x27')]+0x2:_0x2fd12d[_0x0a4b('0xe')]+_0x112092+0x1;_0x4d2ca7['splice'](_0x112092,0x0,{'type':_0xdd1a28['type'],'app':'GotoIfTime','appdata':_0x20867d[_0x112092]+'?'+_0xdd1a28[_0x0a4b('0x14')]+_0x0a4b('0x3b')+_0x4fa54d+':'+_0xdd1a28['context']+_0x0a4b('0x3b')+_0x58f285,'exten':_0xdd1a28[_0x0a4b('0x8')],'context':_0xdd1a28[_0x0a4b('0x14')],'priority':_0x2fd12d[_0x0a4b('0xe')]+_0x112092,'VoiceExtensionId':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')]});}_0xdd1a28[_0x0a4b('0xe')]=_0x4d2ca7[_0x0a4b('0x27')]?_[_0x0a4b('0x3c')](_0x4d2ca7)['priority']+0x1:_0x2fd12d[_0x0a4b('0xe')];_0x2fd12d[_0x0a4b('0xe')]=(_0x5b530b['length']?_[_0x0a4b('0x3c')](_0x5b530b)[_0x0a4b('0xe')]:_0xdd1a28[_0x0a4b('0xe')])+0x1;_0x2fd12d[_0x0a4b('0xf')]=_[_0x0a4b('0x3d')](_0x2fd12d[_0x0a4b('0xf')],_0x4d2ca7,[_0xdd1a28],_0x5b530b);}_0x2fd12d['extensions'][_0x0a4b('0x11')]({'type':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x12')],'app':_0x0a4b('0x3e'),'exten':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x8')],'context':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x14')],'priority':_0x2fd12d[_0x0a4b('0xe')],'VoiceExtensionId':_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')]});_0x5148e4['push'](_0x37be4b[_0x48709a][0x0][_0x0a4b('0x15')]);_0x4651a6=_[_0x0a4b('0x3d')](_0x4651a6,_0x2fd12d[_0x0a4b('0xf')]);}}return _0x13bfaa[_0x0a4b('0x3f')](function(_0x5872c8){return _0x13bfaa[_0x0a4b('0x5')][_0x0a4b('0x40')][_0x0a4b('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x5148e4}},'transaction':_0x5872c8})[_0x0a4b('0x3')](function(_0x29816d){return _0x13bfaa[_0x0a4b('0x5')][_0x0a4b('0x40')]['bulkCreate'](_['sortBy'](_0x4651a6,'priority'),{'transaction':_0x5872c8});});});})[_0x0a4b('0x42')](function(_0x5a550c){console['error'](_0x5a550c);});}exports[_0x0a4b('0x43')]=rewrite;
\ No newline at end of file
+var _0xb717=['context','priority','VoiceExtensionId','inbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','IntervalId','tag','CDR(tag)=','outbound','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','error','rewrite','lodash','util','models','Interval','findAll','then','VoiceExtension','uniq','map','exten','filter','groupBy','playback','hasOwnProperty','extension','find','extensions','push','type','Set','format','CDR(type)=%s'];(function(_0x1cdf85,_0x161b96){var _0x32b945=function(_0x29d94f){while(--_0x29d94f){_0x1cdf85['push'](_0x1cdf85['shift']());}};_0x32b945(++_0x161b96);}(_0xb717,0xc2));var _0x7b71=function(_0x3716be,_0x5ec953){_0x3716be=_0x3716be-0x0;var _0x5d19e0=_0xb717[_0x3716be];return _0x5d19e0;};'use strict';var _=require(_0x7b71('0x0'));var util=require(_0x7b71('0x1'));function rewrite(_0x48525b,_0x3c8394){var _0x49e619=this;return _0x48525b[_0x7b71('0x2')][_0x7b71('0x3')][_0x7b71('0x4')]({'raw':!![]})[_0x7b71('0x5')](function(_0x4bed8a){_0x49e619['intervals']=_0x4bed8a;return _0x48525b[_0x7b71('0x2')]['VoiceExtension'][_0x7b71('0x4')]({'where':{'IntervalId':_0x3c8394['IntervalId']},'raw':!![]});})[_0x7b71('0x5')](function(_0x1b8f01){return _0x48525b[_0x7b71('0x2')][_0x7b71('0x6')][_0x7b71('0x4')]({'where':{'exten':{'$in':_[_0x7b71('0x7')](_[_0x7b71('0x8')](_0x1b8f01,_0x7b71('0x9')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0x7b71('0x5')](function(_0x360ef6){var _0xfe884f=_[_0x7b71('0xa')](_0x360ef6,{'priority':'1'});var _0x4f679b=_[_0x7b71('0xa')](_0x360ef6,{'isApp':0x1});var _0x4b5803=_[_0x7b71('0xb')](_0x4f679b,_0x7b71('0x9'));var _0x4e32ae=['queue',_0x7b71('0xc')];var _0x1797ff=[];var _0x2260bc=[];for(var _0x5cde93 in _0x4b5803){if(_0x4b5803[_0x7b71('0xd')](_0x5cde93)){_0x49e619['priority']=0x2;_0x49e619['extensions']=[];_0x49e619[_0x7b71('0xe')]=_[_0x7b71('0xf')](_0xfe884f,{'exten':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x9')]});_0x49e619[_0x7b71('0x10')][_0x7b71('0x11')]({'type':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x12')],'app':_0x7b71('0x13'),'appdata':util[_0x7b71('0x14')](_0x7b71('0x15'),_0x4b5803[_0x5cde93][0x0][_0x7b71('0x12')]),'context':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x16')],'exten':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x9')],'priority':_0x49e619[_0x7b71('0x17')]++,'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x18')]});if(_0x4b5803[_0x5cde93][0x0][_0x7b71('0x12')]===_0x7b71('0x19')){_0x49e619['extensions'][_0x7b71('0x11')]({'type':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x12')],'app':_0x7b71('0x13'),'appdata':'CDR(routeid)='+_0x4b5803[_0x5cde93][0x0][_0x7b71('0x18')],'context':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x16')],'exten':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x9')],'priority':_0x49e619[_0x7b71('0x17')]++,'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0]['VoiceExtensionId']});}else if(_0x4b5803[_0x5cde93][0x0][_0x7b71('0x12')]==='outbound'){if(_0x49e619[_0x7b71('0xe')]){_0x49e619['extensions'][_0x7b71('0x11')]({'type':_0x4b5803[_0x5cde93][0x0]['type'],'app':_0x7b71('0x13'),'appdata':_0x7b71('0x1a')+(_0x49e619['extension'][_0x7b71('0x1b')]?_0x7b71('0x1c')+_0x49e619[_0x7b71('0xe')][_0x7b71('0x1b')]+'}':_0x7b71('0x1d')),'context':_0x4b5803[_0x5cde93][0x0]['context'],'exten':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x9')],'priority':_0x49e619['priority']++,'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x18')]});}_0x49e619['extensions'][_0x7b71('0x11')]({'type':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x12')],'app':_0x7b71('0x13'),'appdata':_0x7b71('0x1e')+_0x4b5803[_0x5cde93][0x0]['VoiceExtensionId'],'context':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x16')],'exten':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x9')],'priority':_0x49e619[_0x7b71('0x17')]++,'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x18')]});var _0xa50638=_0x49e619['priority']++;_0x49e619[_0x7b71('0x10')][_0x7b71('0x11')]({'type':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x12')],'app':'ExecIf','appdata':_0x7b71('0x1f')+(_0xa50638+0x2)+_0x7b71('0x20')+(_0xa50638+0x1)+')','context':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x16')],'exten':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x9')],'priority':_0xa50638,'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x18')]});if(_0x49e619['extension']){_0x49e619[_0x7b71('0x10')][_0x7b71('0x11')]({'type':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x12')],'app':_0x7b71('0x13'),'appdata':_0x49e619[_0x7b71('0xe')][_0x7b71('0x1b')]?_0x7b71('0x21')+_0x49e619[_0x7b71('0xe')][_0x7b71('0x1b')]+'}':_0x7b71('0x22'),'context':_0x4b5803[_0x5cde93][0x0]['context'],'exten':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x9')],'priority':_0x49e619[_0x7b71('0x17')]++,'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0]['VoiceExtensionId']});}_0x49e619[_0x7b71('0x10')]['push']({'type':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x12')],'app':'Set','appdata':'outboundrouteid='+_0x4b5803[_0x5cde93][0x0][_0x7b71('0x18')],'context':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x16')],'exten':_0x4b5803[_0x5cde93][0x0]['exten'],'priority':_0x49e619[_0x7b71('0x17')]++,'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0]['VoiceExtensionId']});if(_0x49e619[_0x7b71('0xe')]&&_0x49e619['extension'][_0x7b71('0xd')](_0x7b71('0x23'))&&_0x49e619['extension'][_0x7b71('0x23')]!==_0x7b71('0x24')){_0x49e619['extensions']['push']({'type':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x12')],'app':_0x7b71('0x13'),'appdata':_0x7b71('0x25'),'context':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x16')],'exten':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x9')],'priority':_0x49e619[_0x7b71('0x17')]++,'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x18')]});_0x49e619[_0x7b71('0x10')][_0x7b71('0x11')]({'type':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x12')],'app':'Set','appdata':_0x7b71('0x26')+_0x49e619['extension'][_0x7b71('0x23')]||_0x7b71('0x27'),'context':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x16')],'exten':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x9')],'priority':_0x49e619['priority']++,'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x18')]});}}_0x49e619['extensions'][_0x7b71('0x11')]({'type':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x12')],'app':'Set','appdata':_0x7b71('0x28'),'context':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x16')],'exten':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x9')],'priority':_0x49e619['priority']++,'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x18')]});_0x49e619[_0x7b71('0x10')][_0x7b71('0x11')]({'type':_0x4b5803[_0x5cde93][0x0]['type'],'app':_0x7b71('0x13'),'appdata':_0x7b71('0x29'),'context':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x16')],'exten':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x9')],'priority':_0x49e619[_0x7b71('0x17')]++,'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x18')]});_0x49e619[_0x7b71('0x10')][_0x7b71('0x11')]({'type':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x12')],'app':'Set','appdata':_0x7b71('0x2a'),'context':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x16')],'exten':_0x4b5803[_0x5cde93][0x0]['exten'],'priority':_0x49e619[_0x7b71('0x17')]++,'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x18')]});for(var _0x597be9=0x0,_0x52937b=0x0;_0x597be9<_0x4b5803[_0x5cde93][_0x7b71('0x2b')];_0x597be9+=0x1,_0x52937b=0x0){var _0x55ee93=_0x4b5803[_0x5cde93][_0x597be9];if(_0x55ee93[_0x7b71('0x12')]){_0x55ee93[_0x7b71('0x12')]=_0x55ee93[_0x7b71('0x12')][_0x7b71('0x2c')]();}var _0x3be2fe=[];var _0x1e4b10=[];delete _0x55ee93['id'];delete _0x55ee93[_0x7b71('0x2d')];delete _0x55ee93[_0x7b71('0x2e')];var _0x52d2ef=_0x55ee93[_0x7b71('0x2f')]!==_0x7b71('0x30')?[_0x55ee93[_0x7b71('0x2f')]]:_0x55ee93['IntervalId']?_[_0x7b71('0x8')](_['filter'](_0x49e619['intervals'],{'IntervalId':_0x55ee93[_0x7b71('0x31')]}),'interval'):[];if(_0x55ee93['hasOwnProperty']('tag')){if(_0x55ee93[_0x7b71('0x32')]&&_0x55ee93[_0x7b71('0x32')]!=='--'){_0x3be2fe[_0x7b71('0x11')]({'type':_0x55ee93[_0x7b71('0x12')],'app':'Set','appdata':_0x7b71('0x33')+_0x55ee93[_0x7b71('0x32')],'context':_0x55ee93[_0x7b71('0x16')],'exten':_0x55ee93[_0x7b71('0x9')],'priority':_0x52d2ef[_0x7b71('0x2b')]+_0x49e619[_0x7b71('0x17')]+_0x52937b++,'VoiceExtensionId':_0x55ee93[_0x7b71('0x18')]});}}if(_0x55ee93[_0x7b71('0x12')]===_0x7b71('0x34')&&_0x55ee93[_0x7b71('0xd')](_0x7b71('0x35'))){if(_0x55ee93['callerID']){_0x3be2fe[_0x7b71('0x11')]({'type':_0x55ee93[_0x7b71('0x12')],'app':_0x7b71('0x36'),'appdata':_0x7b71('0x37')+_0x55ee93['callerID']+')','context':_0x55ee93['context'],'exten':_0x55ee93[_0x7b71('0x9')],'priority':_0x52d2ef['length']+_0x49e619[_0x7b71('0x17')]+_0x52937b++,'VoiceExtensionId':_0x55ee93[_0x7b71('0x18')]});}else{_0x3be2fe['push']({'type':_0x55ee93[_0x7b71('0x12')],'app':'ExecIf','appdata':_0x7b71('0x38'),'context':_0x55ee93[_0x7b71('0x16')],'exten':_0x55ee93[_0x7b71('0x9')],'priority':_0x52d2ef['length']+_0x49e619[_0x7b71('0x17')]+_0x52937b++,'VoiceExtensionId':_0x55ee93[_0x7b71('0x18')]});}}if(_0x55ee93[_0x7b71('0xd')](_0x7b71('0x39'))){if(_0x4e32ae['indexOf'](_0x55ee93[_0x7b71('0x3a')][_0x7b71('0x2c')]())>=0x0&&_0x55ee93[_0x7b71('0x3b')]!==_0x7b71('0x3c')){if(_0x55ee93[_0x7b71('0x39')]){_0x3be2fe[_0x7b71('0x11')]({'type':_0x55ee93[_0x7b71('0x12')],'app':_0x7b71('0x36'),'appdata':_0x7b71('0x3d'),'context':_0x55ee93[_0x7b71('0x16')],'exten':_0x55ee93['exten'],'priority':_0x52d2ef[_0x7b71('0x2b')]+_0x49e619[_0x7b71('0x17')]+_0x52937b++,'VoiceExtensionId':_0x55ee93[_0x7b71('0x18')]});_0x3be2fe[_0x7b71('0x11')]({'type':_0x55ee93[_0x7b71('0x12')],'app':'Set','appdata':_0x7b71('0x3e'),'context':_0x55ee93[_0x7b71('0x16')],'exten':_0x55ee93['exten'],'priority':_0x52d2ef[_0x7b71('0x2b')]+_0x49e619[_0x7b71('0x17')]+_0x52937b++,'VoiceExtensionId':_0x55ee93[_0x7b71('0x18')]});}else{_0x3be2fe[_0x7b71('0x11')]({'type':_0x55ee93['type'],'app':_0x7b71('0x36'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x55ee93[_0x7b71('0x16')],'exten':_0x55ee93['exten'],'priority':_0x52d2ef[_0x7b71('0x2b')]+_0x49e619[_0x7b71('0x17')]+_0x52937b++,'VoiceExtensionId':_0x55ee93[_0x7b71('0x18')]});_0x3be2fe['push']({'type':_0x55ee93[_0x7b71('0x12')],'app':_0x7b71('0x13'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x55ee93[_0x7b71('0x16')],'exten':_0x55ee93['exten'],'priority':_0x52d2ef[_0x7b71('0x2b')]+_0x49e619[_0x7b71('0x17')]+_0x52937b++,'VoiceExtensionId':_0x55ee93[_0x7b71('0x18')]});}}}for(var _0x2e0948=0x0;_0x2e0948<_0x52d2ef[_0x7b71('0x2b')];_0x2e0948+=0x1){var _0x305b4b=_0x49e619[_0x7b71('0x17')]+_0x52d2ef[_0x7b71('0x2b')];var _0x399809=_0x2e0948===_0x52d2ef[_0x7b71('0x2b')]-0x1?_0x49e619[_0x7b71('0x17')]+_0x3be2fe[_0x7b71('0x2b')]+_0x1e4b10['length']+0x2:_0x49e619['priority']+_0x2e0948+0x1;_0x3be2fe['splice'](_0x2e0948,0x0,{'type':_0x55ee93[_0x7b71('0x12')],'app':'GotoIfTime','appdata':_0x52d2ef[_0x2e0948]+'?'+_0x55ee93[_0x7b71('0x16')]+_0x7b71('0x3f')+_0x305b4b+':'+_0x55ee93[_0x7b71('0x16')]+_0x7b71('0x3f')+_0x399809,'exten':_0x55ee93['exten'],'context':_0x55ee93[_0x7b71('0x16')],'priority':_0x49e619[_0x7b71('0x17')]+_0x2e0948,'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x18')]});}_0x55ee93[_0x7b71('0x17')]=_0x3be2fe['length']?_['last'](_0x3be2fe)[_0x7b71('0x17')]+0x1:_0x49e619[_0x7b71('0x17')];_0x49e619[_0x7b71('0x17')]=(_0x1e4b10[_0x7b71('0x2b')]?_[_0x7b71('0x40')](_0x1e4b10)[_0x7b71('0x17')]:_0x55ee93[_0x7b71('0x17')])+0x1;_0x49e619[_0x7b71('0x10')]=_['concat'](_0x49e619[_0x7b71('0x10')],_0x3be2fe,[_0x55ee93],_0x1e4b10);}_0x49e619[_0x7b71('0x10')]['push']({'type':_0x4b5803[_0x5cde93][0x0]['type'],'app':'Hangup','exten':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x9')],'context':_0x4b5803[_0x5cde93][0x0][_0x7b71('0x16')],'priority':_0x49e619[_0x7b71('0x17')],'VoiceExtensionId':_0x4b5803[_0x5cde93][0x0]['VoiceExtensionId']});_0x1797ff['push'](_0x4b5803[_0x5cde93][0x0][_0x7b71('0x18')]);_0x2260bc=_[_0x7b71('0x41')](_0x2260bc,_0x49e619[_0x7b71('0x10')]);}}return _0x48525b[_0x7b71('0x42')](function(_0x3e0845){return _0x48525b[_0x7b71('0x2')][_0x7b71('0x6')][_0x7b71('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x1797ff}},'transaction':_0x3e0845})[_0x7b71('0x5')](function(_0xd58581){return _0x48525b['models'][_0x7b71('0x6')][_0x7b71('0x44')](_[_0x7b71('0x45')](_0x2260bc,'priority'),{'transaction':_0x3e0845});});});})['catch'](function(_0x44dcbf){console[_0x7b71('0x46')](_0x44dcbf);});}exports[_0x7b71('0x47')]=rewrite;
\ No newline at end of file
index 53d6145..8c54291 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x01ab=['\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','get','sequelize','VoiceQueueId','onlyIfOpen','push','query','all','BlackLists','Campaign','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','lodash','../../../mysqldb','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','undefined','argv','null','Missing\x20binding\x20parameters!','split','Missing\x20socket_timestamp\x20parameter!','error','contact','index','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','then','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','inspect','insert','into','cm_hopper','fromQuery','scheduledAt','createdAt','updatedAt','select','field','NOW()','ContactId','toString','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','from','id\x20IN\x20?','str','phone\x20NOT\x20IN\x20(?)','calleridnum'];(function(_0x4d238d,_0x4602f9){var _0xa4c991=function(_0x38f715){while(--_0x38f715){_0x4d238d['push'](_0x4d238d['shift']());}};_0xa4c991(++_0x4602f9);}(_0x01ab,0x164));var _0xb01a=function(_0x322652,_0x5a85c0){_0x322652=_0x322652-0x0;var _0x5d5e88=_0x01ab[_0x322652];return _0x5d5e88;};'use strict';var BPromise=require('bluebird');var util=require(_0xb01a('0x0'));var _=require(_0xb01a('0x1'));var fs=require('fs');var squel=require('squel');var Papa=require('papaparse');var Redis=require('ioredis');var db=require(_0xb01a('0x2'))['db'];var config=require('../../../config/environment');var logger=require(_0xb01a('0x3'))(_0xb01a('0x4'));config[_0xb01a('0x5')]=_[_0xb01a('0x6')](config[_0xb01a('0x5')],{'host':_0xb01a('0x7'),'port':0x18eb});var socket=require(_0xb01a('0x8'))(new Redis(config[_0xb01a('0x5')]));require(_0xb01a('0x9'))[_0xb01a('0xa')](socket);try{if(!process['argv'][0x2]||process['argv'][0x2]===_0xb01a('0xb')||process[_0xb01a('0xc')][0x2]==='null'){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0xb01a('0xc')][0x2];if(!process[_0xb01a('0xc')][0x3]||process[_0xb01a('0xc')][0x3]===_0xb01a('0xb')||process[_0xb01a('0xc')][0x3]===_0xb01a('0xd')||!process['argv'][0x4]||process[_0xb01a('0xc')][0x4]===_0xb01a('0xb')||process[_0xb01a('0xc')][0x4]===_0xb01a('0xd')){throw new Error(_0xb01a('0xe'));}var FIELDS=_['zipObject'](process['argv'][0x3][_0xb01a('0xf')](','),process['argv'][0x4]['split'](','));if(!process[_0xb01a('0xc')][0x5]||process[_0xb01a('0xc')][0x5]===_0xb01a('0xb')||process['argv'][0x5]===_0xb01a('0xd')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0xb01a('0xc')][0x5];var COMPANYID=process[_0xb01a('0xc')][0x6]&&process[_0xb01a('0xc')][0x6]!=='undefined'&&process['argv'][0x6]!==_0xb01a('0xd')?process['argv'][0x6]:null;var DUPLICATES=process[_0xb01a('0xc')][0x7]&&process['argv'][0x7]!==_0xb01a('0xb')&&process[_0xb01a('0xc')][0x7]!==_0xb01a('0xd')?process['argv'][0x7]:null;if(!process[_0xb01a('0xc')][0x8]||process[_0xb01a('0xc')][0x8]===_0xb01a('0xb')||process['argv'][0x8]===_0xb01a('0xd')){throw new Error(_0xb01a('0x10'));}var SOCKET_TIMESTAMP=process[_0xb01a('0xc')][0x8];}catch(_0x3dc14f){logger[_0xb01a('0x11')](_0x3dc14f);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(_0x2cb967,_0xcd8aa8,_0x40cea5,_0xec3eb4){var _0x4755e4={'message':_0xcd8aa8};_0x4755e4[_0x2cb967]=!![];if(_0x40cea5){_0x4755e4[_0xb01a('0x12')]=_0x40cea5;}if(_0xec3eb4){_0x4755e4[_0xb01a('0x13')]=_0xec3eb4;}return _0x4755e4;}function isEmail(_0x3eac7b){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'](_0x3eac7b);}function checkRow(_0x20286b,_0x18220c,_0x1aea2f){return new BPromise(function(_0x5f3824,_0x5ccba6){if(_['isNil'](_0x20286b)){return _0x5ccba6(handleCheckRowError(_0xb01a('0x11'),_0xb01a('0x14'),null,_0x1aea2f));}if(_0x20286b['errors']&&_0x20286b[_0xb01a('0x15')][_0xb01a('0x16')]){var _0x57a457=_['map'](_0x20286b[_0xb01a('0x15')],_0xb01a('0x17'))[_0xb01a('0x18')](';');return _0x5ccba6(handleCheckRowError(_0xb01a('0x11'),_0x57a457,null,_0x1aea2f));}var _0xb6f3da={};for(var _0x1ae448 in FIELDS){if(FIELDS[_0xb01a('0x19')](_0x1ae448)&&FIELDS[_0x1ae448]){_0xb6f3da[_0x1ae448]=_0x20286b[_0xb01a('0x1a')][0x0][FIELDS[_0x1ae448]]||_0x20286b['data'][0x0]['\ufeff'+FIELDS[_0x1ae448]];}}if(!_0xb6f3da[_0xb01a('0x1b')]){return _0x5ccba6(handleCheckRowError(_0xb01a('0x11'),_0xb01a('0x1c'),null,_0x1aea2f));}if(!_0xb6f3da[_0xb01a('0x1d')]){return _0x5ccba6(handleCheckRowError(_0xb01a('0x11'),_0xb01a('0x1e'),null,_0x1aea2f));}if(_0xb6f3da[_0xb01a('0x1f')]){var _0x7cdd07=moment(_0xb6f3da[_0xb01a('0x1f')],_0xb01a('0x20'));if(!_0x7cdd07[_0xb01a('0x21')]()){return _0x5ccba6(handleCheckRowError(_0xb01a('0x11'),_0xb01a('0x22'),null,_0x1aea2f));}}if(_0xb6f3da[_0xb01a('0x23')]){if(!isEmail(_0xb6f3da[_0xb01a('0x23')])){return _0x5ccba6(handleCheckRowError(_0xb01a('0x11'),'email\x20format\x20is\x20not\x20valid!',null,_0x1aea2f));}}_0xb6f3da[_0xb01a('0x24')]=LISTID;_0xb6f3da[_0xb01a('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xb01a('0x16')]&&_0x18220c){var _0xe5ed46={};for(var _0x5d2a6f=0x0,_0x171ed6=DUPLICATES['length'];_0x5d2a6f<_0x171ed6;_0x5d2a6f+=0x1){_0xe5ed46[DUPLICATES[_0x5d2a6f]]=_0xb6f3da[DUPLICATES[_0x5d2a6f]];}var _0x1b0794=_[_0xb01a('0x26')](_0x18220c,_0xe5ed46);if(_0x1b0794){return _0x5ccba6(handleCheckRowError(_0xb01a('0x27'),_0xb01a('0x28'),_0x1b0794,_0x1aea2f));}}return db[_0xb01a('0x29')][_0xb01a('0x2a')](_0xb6f3da,{'raw':!![],'hooks':![],'fields':_['keys'](_0xb6f3da)})[_0xb01a('0x2b')](function(_0x1fc0a9){if(DUPLICATES&&DUPLICATES['length']&&_0x18220c){_0x18220c['push'](_[_0xb01a('0x2c')](_0xb6f3da,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1fc0a9['id'];return _0x5f3824();})[_0xb01a('0x2d')](function(_0x4facb2){return _0x5ccba6(handleCheckRowError(_0xb01a('0x11'),_0xb01a('0x2e')+(_0x4facb2[_0xb01a('0x17')]||JSON[_0xb01a('0x2f')](_0x4facb2)),null,_0x1aea2f));});});}function checkHopper(){function _0x16bb0a(){return function(_0x500448){logger[_0xb01a('0x11')](_0xb01a('0x30'),'checkHopper',util[_0xb01a('0x31')](_0x500448,{'showHidden':![],'depth':null}));};}var _0x13ee96=function(_0x2096e1,_0x58bf45){var _0x52ff13=squel[_0xb01a('0x32')]()[_0xb01a('0x33')](_0xb01a('0x34'))[_0xb01a('0x35')]([_0xb01a('0x1d'),_0xb01a('0x36'),'ContactId','ListId',_0x58bf45,_0xb01a('0x37'),_0xb01a('0x38')],squel[_0xb01a('0x39')]()['field'](_0xb01a('0x1d'),_0xb01a('0x1d'))[_0xb01a('0x3a')](_0xb01a('0x3b'),'scheduledAt')[_0xb01a('0x3a')]('id',_0xb01a('0x3c'))[_0xb01a('0x3a')](LISTID[_0xb01a('0x3d')](),_0xb01a('0x24'))[_0xb01a('0x3a')](_0x2096e1['id'][_0xb01a('0x3d')](),_0x58bf45)[_0xb01a('0x3a')](_0xb01a('0x3b'),_0xb01a('0x37'))['field'](_0xb01a('0x3b'),_0xb01a('0x38'))['from'](_0xb01a('0x3e'))['where'](_0xb01a('0x3f'))[_0xb01a('0x40')](_0xb01a('0x41'),LISTID['toString']())[_0xb01a('0x40')](_0xb01a('0x42'))[_0xb01a('0x40')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0xb01a('0x1d'))[_0xb01a('0x43')]('cm_hopper')[_0xb01a('0x40')](_0x58bf45+'\x20=\x20?',_0x2096e1['id']['toString']())))[_0xb01a('0x3d')]();return _0x52ff13;};var _0x10dc08=function(_0x58bf44,_0x55defa){var _0x4994c6=squel['insert']()[_0xb01a('0x33')]('cm_hopper')[_0xb01a('0x35')]([_0xb01a('0x1d'),_0xb01a('0x36'),_0xb01a('0x3c'),'ListId',_0x55defa,_0xb01a('0x37'),_0xb01a('0x38')],squel[_0xb01a('0x39')]()[_0xb01a('0x3a')](_0xb01a('0x1d'),_0xb01a('0x1d'))[_0xb01a('0x3a')](_0xb01a('0x3b'),_0xb01a('0x36'))['field']('id','ContactId')['field'](LISTID[_0xb01a('0x3d')](),_0xb01a('0x24'))[_0xb01a('0x3a')](_0x58bf44['id'][_0xb01a('0x3d')](),_0x55defa)[_0xb01a('0x3a')]('NOW()','createdAt')[_0xb01a('0x3a')](_0xb01a('0x3b'),_0xb01a('0x38'))[_0xb01a('0x43')]('cm_contacts')[_0xb01a('0x40')]('deletedAt\x20IS\x20NULL')[_0xb01a('0x40')]('ListId\x20=\x20?',LISTID['toString']())['where'](_0xb01a('0x44'),squel[_0xb01a('0x45')](hopperContacts))[_0xb01a('0x40')](_0xb01a('0x42'))[_0xb01a('0x40')](_0xb01a('0x46'),squel[_0xb01a('0x39')]()[_0xb01a('0x3a')](_0xb01a('0x47'))[_0xb01a('0x43')]('cm_hopper_final')['where'](_0x55defa+_0xb01a('0x48'),_0x58bf44['id'][_0xb01a('0x3d')]()))[_0xb01a('0x40')](_0xb01a('0x46'),squel[_0xb01a('0x39')]()[_0xb01a('0x3a')](_0xb01a('0x1d'))[_0xb01a('0x43')](_0xb01a('0x34'))[_0xb01a('0x40')](_0x55defa+_0xb01a('0x48'),_0x58bf44['id'][_0xb01a('0x3d')]())))[_0xb01a('0x3d')]();return _0x4994c6;};function _0x486653(_0x17b6e5,_0x564b1c){var _0x40d8ca=squel[_0xb01a('0x32')]()[_0xb01a('0x33')](_0xb01a('0x34'))[_0xb01a('0x35')]([_0xb01a('0x1d'),_0xb01a('0x36'),_0xb01a('0x3c'),_0xb01a('0x24'),_0x564b1c,_0xb01a('0x37'),_0xb01a('0x38')],squel[_0xb01a('0x39')]()[_0xb01a('0x3a')](_0xb01a('0x1d'),_0xb01a('0x1d'))[_0xb01a('0x3a')](_0xb01a('0x3b'),'scheduledAt')[_0xb01a('0x3a')]('id',_0xb01a('0x3c'))[_0xb01a('0x3a')](LISTID['toString'](),_0xb01a('0x24'))[_0xb01a('0x3a')](_0x17b6e5['id'][_0xb01a('0x3d')](),_0x564b1c)[_0xb01a('0x3a')](_0xb01a('0x3b'),_0xb01a('0x37'))[_0xb01a('0x3a')](_0xb01a('0x3b'),_0xb01a('0x38'))['from']('cm_contacts')[_0xb01a('0x40')](_0xb01a('0x3f'))['where'](_0xb01a('0x41'),LISTID['toString']())[_0xb01a('0x40')](_0xb01a('0x44'),squel[_0xb01a('0x45')](hopperContacts))[_0xb01a('0x40')]('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x40d8ca;}function _0x3acf13(_0x4a422a,_0xa3ce44){var _0x3b0988=squel[_0xb01a('0x32')]()['into'](_0xb01a('0x49'))[_0xb01a('0x35')]([_0xb01a('0x1d'),_0xb01a('0x3c'),_0xb01a('0x24'),_0xa3ce44,'createdAt',_0xb01a('0x38')],squel[_0xb01a('0x39')]()['field'](_0xb01a('0x1d'),_0xb01a('0x1d'))[_0xb01a('0x3a')]('id','ContactId')[_0xb01a('0x3a')](LISTID['toString'](),_0xb01a('0x24'))[_0xb01a('0x3a')](_0x4a422a['id'][_0xb01a('0x3d')](),_0xa3ce44)['field'](_0xb01a('0x3b'),_0xb01a('0x37'))['field'](_0xb01a('0x3b'),_0xb01a('0x38'))[_0xb01a('0x43')]('cm_contacts')[_0xb01a('0x40')](_0xb01a('0x3f'))['where'](_0xb01a('0x41'),LISTID['toString']())['where']('id\x20IN\x20?',squel[_0xb01a('0x45')](hopperContacts))[_0xb01a('0x40')](_0xb01a('0x42')))[_0xb01a('0x3d')]();return _0x3b0988;}return db[_0xb01a('0x4a')][_0xb01a('0x4b')]({'where':{'type':_0xb01a('0x4c')},'attributes':['id',_0xb01a('0x4d')],'include':[{'model':db[_0xb01a('0x4e')],'as':'Lists','where':{'id':LISTID}}]})[_0xb01a('0x2b')](function(_0x367462){var _0x17c12f=[];if(_0x367462){var _0x49c3b0;for(var _0x5f4be0=0x0,_0x1b63ab;_0x5f4be0<_0x367462[_0xb01a('0x16')];_0x5f4be0+=0x1){_0x1b63ab=_0x367462[_0x5f4be0][_0xb01a('0x4f')]({'plain':!![]});switch(_0x1b63ab['dialCheckDuplicateType']){case'always':_0x17c12f['push'](db[_0xb01a('0x50')]['query'](_0x10dc08(_0x1b63ab,_0xb01a('0x51')))[_0xb01a('0x2b')](function(){})[_0xb01a('0x2d')](_0x16bb0a()));break;case _0xb01a('0x52'):_0x17c12f[_0xb01a('0x53')](db[_0xb01a('0x50')][_0xb01a('0x54')](_0x13ee96(_0x1b63ab,'VoiceQueueId'))[_0xb01a('0x2b')](function(){})['catch'](_0x16bb0a()));break;default:_0x17c12f[_0xb01a('0x53')](db['sequelize'][_0xb01a('0x54')](_0x486653(_0x1b63ab,_0xb01a('0x51')))[_0xb01a('0x2b')](function(){})[_0xb01a('0x2d')](_0x16bb0a()));}}}return _0x17c12f;})[_0xb01a('0x55')]()['then'](function(){return db[_0xb01a('0x4a')]['findAll']({'where':{'type':_0xb01a('0x4c')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xb01a('0x56'),'where':{'id':LISTID}}]})[_0xb01a('0x2b')](function(_0x2e9c7c){var _0x5d18b3=[];if(_0x2e9c7c){var _0x4b1aeb;for(var _0x5141ce=0x0,_0x34d07b;_0x5141ce<_0x2e9c7c[_0xb01a('0x16')];_0x5141ce+=0x1){_0x34d07b=_0x2e9c7c[_0x5141ce][_0xb01a('0x4f')]({'plain':!![]});_0x5d18b3[_0xb01a('0x53')](db['sequelize'][_0xb01a('0x54')](_0x3acf13(_0x34d07b,_0xb01a('0x51')))[_0xb01a('0x2b')](function(){})[_0xb01a('0x2d')](_0x16bb0a()));}}return _0x5d18b3;})[_0xb01a('0x55')]();})['then'](function(){return db[_0xb01a('0x57')]['findAll']({'attributes':['id',_0xb01a('0x4d')],'include':[{'model':db[_0xb01a('0x4e')],'as':'Lists','where':{'id':LISTID}}]})[_0xb01a('0x2b')](function(_0x56e59f){var _0x5aff3b=[];if(_0x56e59f){for(var _0xfcfc0c=0x0,_0x2c6d3f;_0xfcfc0c<_0x56e59f['length'];_0xfcfc0c+=0x1){_0x2c6d3f=_0x56e59f[_0xfcfc0c][_0xb01a('0x4f')]({'plain':!![]});switch(_0x2c6d3f[_0xb01a('0x4d')]){case'always':_0x5aff3b[_0xb01a('0x53')](db[_0xb01a('0x50')][_0xb01a('0x54')](_0x10dc08(_0x2c6d3f,_0xb01a('0x58')))[_0xb01a('0x2b')](function(){})[_0xb01a('0x2d')](_0x16bb0a()));break;case _0xb01a('0x52'):_0x5aff3b['push'](db['sequelize'][_0xb01a('0x54')](_0x13ee96(_0x2c6d3f,_0xb01a('0x58')))['then'](function(){})[_0xb01a('0x2d')](_0x16bb0a()));break;default:_0x5aff3b['push'](db['sequelize'][_0xb01a('0x54')](_0x486653(_0x2c6d3f,'CampaignId'))['then'](function(){})[_0xb01a('0x2d')](_0x16bb0a()));}}}return _0x5aff3b;})[_0xb01a('0x55')]();})['then'](function(){return db['Campaign'][_0xb01a('0x4b')]({'attributes':['id'],'include':[{'model':db[_0xb01a('0x4e')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xb01a('0x2b')](function(_0x4eb14e){var _0xd8b0d8=[];if(_0x4eb14e){for(var _0x3a7b2a=0x0,_0x546d10;_0x3a7b2a<_0x4eb14e['length'];_0x3a7b2a+=0x1){_0x546d10=_0x4eb14e[_0x3a7b2a][_0xb01a('0x4f')]({'plain':!![]});_0xd8b0d8['push'](db[_0xb01a('0x50')][_0xb01a('0x54')](_0x3acf13(_0x546d10,_0xb01a('0x58')))[_0xb01a('0x2b')](function(){})['catch'](_0x16bb0a()));}}return _0xd8b0d8;})[_0xb01a('0x55')]();})['catch'](function(_0x3236ad){logger['error'](_0xb01a('0x59'),_0xb01a('0x5a'),_0x3236ad[_0xb01a('0x17')]);});}var processPromises=function(_0x3021c8){return BPromise[_0xb01a('0x55')](promises)[_0xb01a('0x2b')](function(_0x57da0e){})[_0xb01a('0x2d')](function(_0x2e2756){logger[_0xb01a('0x11')](_0xb01a('0x5b'),JSON[_0xb01a('0x2f')](_0x2e2756));})[_0xb01a('0x5c')](function(){socket[_0xb01a('0x5d')](_0xb01a('0x5e')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3021c8){return _0x3021c8[_0xb01a('0x5f')]();}});};var endCsv=function(){return BPromise[_0xb01a('0x60')]()[_0xb01a('0x2b')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket['emit'](_0xb01a('0x5e')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0xb01a('0x61')](FILEPATH);}catch(_0x5ded6c){logger[_0xb01a('0x11')](_0xb01a('0x62'),JSON['stringify'](_0x5ded6c));}finally{process[_0xb01a('0x63')](0x0);}});};process['on'](_0xb01a('0x64'),function(){logger[_0xb01a('0x65')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise['resolve']()[_0xb01a('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xb01a('0xf')](',');return db[_0xb01a('0x29')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xb01a('0x2b')](function(_0x3d81c0){var _0x48fee5=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xb01a('0x66')](_0x48fee5,{'header':!![],'skipEmptyLines':!![],'step':function(_0x41db38,_0x53ee04){total+=0x1;var _0xb87ffa=total;promises[_0xb01a('0x53')](checkRow(_0x41db38,_0x3d81c0,_0xb87ffa)[_0xb01a('0x2b')](function(){success+=0x1;})[_0xb01a('0x2d')](function(_0xe4fc92){if(_0xe4fc92[_0xb01a('0x11')]){errors+=0x1;delete _0xe4fc92[_0xb01a('0x11')];}else if(_0xe4fc92[_0xb01a('0x27')]){duplicates+=0x1;delete _0xe4fc92['duplicate'];}rows['push'](_0xe4fc92);}));if(total%0xc8===0x0){_0x53ee04[_0xb01a('0x67')]();return processPromises(_0x53ee04);}},'complete':function(){return processPromises()['then'](function(){logger[_0xb01a('0x65')](_0xb01a('0x68'));endCsv();});},'error':function(_0xcc59ba,_0x4fd661){logger[_0xb01a('0x65')](_0xb01a('0x69'),JSON[_0xb01a('0x2f')](_0xcc59ba));endCsv();}});})['catch'](function(_0x5ebcdf){logger[_0xb01a('0x11')](_0xb01a('0x6a'),JSON[_0xb01a('0x2f')](_0x5ebcdf));});}main();
\ No newline at end of file
+var _0x0608=['outbound','dialCheckDuplicateType','CmList','Lists','always','sequelize','query','VoiceQueueId','onlyIfOpen','catch','all','Campaign','get','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','resolve','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','createReadStream','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','stringify','bluebird','util','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','api','defaults','localhost','socket.io-emitter','redis','../../../api/cmContact/cmContact.socket','register','argv','undefined','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','null','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','message','join','data','firstName','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','duplicate','Duplicate\x20Contact','CmContact','then','push','Error\x20while\x20creating\x20contact:\x20','checkHopper','inspect','insert','into','scheduledAt','createdAt','updatedAt','select','field','NOW()','toString','cm_contacts','where','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper','\x20=\x20?','ContactId','ListId\x20=\x20?','id\x20IN\x20?','str','from','cm_hopper_final','fromQuery','cm_hopper_black','VoiceQueue','findAll'];(function(_0x43c005,_0x1e97a4){var _0x4ea412=function(_0x3466ef){while(--_0x3466ef){_0x43c005['push'](_0x43c005['shift']());}};_0x4ea412(++_0x1e97a4);}(_0x0608,0x1e5));var _0x8060=function(_0x3c0a7e,_0x3e14ec){_0x3c0a7e=_0x3c0a7e-0x0;var _0x64f13b=_0x0608[_0x3c0a7e];return _0x64f13b;};'use strict';var BPromise=require(_0x8060('0x0'));var util=require(_0x8060('0x1'));var _=require(_0x8060('0x2'));var fs=require('fs');var squel=require(_0x8060('0x3'));var Papa=require(_0x8060('0x4'));var Redis=require('ioredis');var db=require(_0x8060('0x5'))['db'];var config=require(_0x8060('0x6'));var logger=require('../../../config/logger')(_0x8060('0x7'));config['redis']=_[_0x8060('0x8')](config['redis'],{'host':_0x8060('0x9'),'port':0x18eb});var socket=require(_0x8060('0xa'))(new Redis(config[_0x8060('0xb')]));require(_0x8060('0xc'))[_0x8060('0xd')](socket);try{if(!process[_0x8060('0xe')][0x2]||process[_0x8060('0xe')][0x2]===_0x8060('0xf')||process[_0x8060('0xe')][0x2]==='null'){throw new Error(_0x8060('0x10'));}var FILEPATH=process[_0x8060('0xe')][0x2];if(!process['argv'][0x3]||process[_0x8060('0xe')][0x3]===_0x8060('0xf')||process[_0x8060('0xe')][0x3]==='null'||!process[_0x8060('0xe')][0x4]||process[_0x8060('0xe')][0x4]===_0x8060('0xf')||process[_0x8060('0xe')][0x4]==='null'){throw new Error(_0x8060('0x11'));}var FIELDS=_[_0x8060('0x12')](process[_0x8060('0xe')][0x3][_0x8060('0x13')](','),process[_0x8060('0xe')][0x4]['split'](','));if(!process['argv'][0x5]||process['argv'][0x5]===_0x8060('0xf')||process[_0x8060('0xe')][0x5]==='null'){throw new Error(_0x8060('0x14'));}var LISTID=process[_0x8060('0xe')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x8060('0xe')][0x6]!==_0x8060('0xf')&&process[_0x8060('0xe')][0x6]!==_0x8060('0x15')?process[_0x8060('0xe')][0x6]:null;var DUPLICATES=process[_0x8060('0xe')][0x7]&&process[_0x8060('0xe')][0x7]!==_0x8060('0xf')&&process[_0x8060('0xe')][0x7]!=='null'?process[_0x8060('0xe')][0x7]:null;if(!process[_0x8060('0xe')][0x8]||process[_0x8060('0xe')][0x8]==='undefined'||process['argv'][0x8]===_0x8060('0x15')){throw new Error(_0x8060('0x16'));}var SOCKET_TIMESTAMP=process[_0x8060('0xe')][0x8];}catch(_0x5cf441){logger[_0x8060('0x17')](_0x5cf441);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(_0x56e363,_0x3db53e,_0x5aed01,_0x33ff0c){var _0x20a314={'message':_0x3db53e};_0x20a314[_0x56e363]=!![];if(_0x5aed01){_0x20a314[_0x8060('0x18')]=_0x5aed01;}if(_0x33ff0c){_0x20a314['index']=_0x33ff0c;}return _0x20a314;}function isEmail(_0x1f7841){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))*$/[_0x8060('0x19')](_0x1f7841);}function checkRow(_0x133eac,_0x39af2d,_0x55e4e3){return new BPromise(function(_0x366304,_0x1e14d7){if(_[_0x8060('0x1a')](_0x133eac)){return _0x1e14d7(handleCheckRowError(_0x8060('0x17'),_0x8060('0x1b'),null,_0x55e4e3));}if(_0x133eac[_0x8060('0x1c')]&&_0x133eac[_0x8060('0x1c')][_0x8060('0x1d')]){var _0x1d7c38=_[_0x8060('0x1e')](_0x133eac[_0x8060('0x1c')],_0x8060('0x1f'))[_0x8060('0x20')](';');return _0x1e14d7(handleCheckRowError(_0x8060('0x17'),_0x1d7c38,null,_0x55e4e3));}var _0x450934={};for(var _0x4bad6a in FIELDS){if(FIELDS['hasOwnProperty'](_0x4bad6a)&&FIELDS[_0x4bad6a]){_0x450934[_0x4bad6a]=_0x133eac[_0x8060('0x21')][0x0][FIELDS[_0x4bad6a]]||_0x133eac['data'][0x0]['\ufeff'+FIELDS[_0x4bad6a]];}}if(!_0x450934[_0x8060('0x22')]){return _0x1e14d7(handleCheckRowError('error',_0x8060('0x23'),null,_0x55e4e3));}if(!_0x450934[_0x8060('0x24')]){return _0x1e14d7(handleCheckRowError(_0x8060('0x17'),_0x8060('0x25'),null,_0x55e4e3));}if(_0x450934[_0x8060('0x26')]){var _0x1cd8df=moment(_0x450934[_0x8060('0x26')],_0x8060('0x27'));if(!_0x1cd8df[_0x8060('0x28')]()){return _0x1e14d7(handleCheckRowError(_0x8060('0x17'),_0x8060('0x29'),null,_0x55e4e3));}}if(_0x450934[_0x8060('0x2a')]){if(!isEmail(_0x450934[_0x8060('0x2a')])){return _0x1e14d7(handleCheckRowError(_0x8060('0x17'),_0x8060('0x2b'),null,_0x55e4e3));}}_0x450934[_0x8060('0x2c')]=LISTID;_0x450934[_0x8060('0x2d')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x39af2d){var _0x29e82d={};for(var _0x5d0bb8=0x0,_0x28a14e=DUPLICATES['length'];_0x5d0bb8<_0x28a14e;_0x5d0bb8+=0x1){_0x29e82d[DUPLICATES[_0x5d0bb8]]=_0x450934[DUPLICATES[_0x5d0bb8]];}var _0x30fda4=_['find'](_0x39af2d,_0x29e82d);if(_0x30fda4){return _0x1e14d7(handleCheckRowError(_0x8060('0x2e'),_0x8060('0x2f'),_0x30fda4,_0x55e4e3));}}return db[_0x8060('0x30')]['create'](_0x450934,{'raw':!![],'hooks':![],'fields':_['keys'](_0x450934)})[_0x8060('0x31')](function(_0x209b3f){if(DUPLICATES&&DUPLICATES[_0x8060('0x1d')]&&_0x39af2d){_0x39af2d[_0x8060('0x32')](_['pick'](_0x450934,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x209b3f['id'];return _0x366304();})['catch'](function(_0x5a015a){return _0x1e14d7(handleCheckRowError(_0x8060('0x17'),_0x8060('0x33')+(_0x5a015a[_0x8060('0x1f')]||JSON['stringify'](_0x5a015a)),null,_0x55e4e3));});});}function checkHopper(){function _0x154dd2(){return function(_0x532a70){logger[_0x8060('0x17')]('cmContact',_0x8060('0x34'),util[_0x8060('0x35')](_0x532a70,{'showHidden':![],'depth':null}));};}var _0x2dfbfb=function(_0x134c38,_0x4c718c){var _0x17c693=squel[_0x8060('0x36')]()[_0x8060('0x37')]('cm_hopper')['fromQuery']([_0x8060('0x24'),_0x8060('0x38'),'ContactId',_0x8060('0x2c'),_0x4c718c,_0x8060('0x39'),_0x8060('0x3a')],squel[_0x8060('0x3b')]()[_0x8060('0x3c')]('phone','phone')[_0x8060('0x3c')](_0x8060('0x3d'),_0x8060('0x38'))[_0x8060('0x3c')]('id','ContactId')[_0x8060('0x3c')](LISTID['toString'](),'ListId')['field'](_0x134c38['id'][_0x8060('0x3e')](),_0x4c718c)[_0x8060('0x3c')](_0x8060('0x3d'),_0x8060('0x39'))[_0x8060('0x3c')]('NOW()',_0x8060('0x3a'))['from'](_0x8060('0x3f'))[_0x8060('0x40')](_0x8060('0x41'))['where']('ListId\x20=\x20?',LISTID[_0x8060('0x3e')]())[_0x8060('0x40')](_0x8060('0x42'))['where'](_0x8060('0x43'),squel[_0x8060('0x3b')]()[_0x8060('0x3c')](_0x8060('0x24'))['from'](_0x8060('0x44'))[_0x8060('0x40')](_0x4c718c+_0x8060('0x45'),_0x134c38['id'][_0x8060('0x3e')]())))[_0x8060('0x3e')]();return _0x17c693;};var _0x2dbb38=function(_0x33be1b,_0x3519b7){var _0x2232da=squel['insert']()[_0x8060('0x37')](_0x8060('0x44'))['fromQuery']([_0x8060('0x24'),'scheduledAt',_0x8060('0x46'),_0x8060('0x2c'),_0x3519b7,_0x8060('0x39'),_0x8060('0x3a')],squel['select']()[_0x8060('0x3c')](_0x8060('0x24'),_0x8060('0x24'))[_0x8060('0x3c')]('NOW()','scheduledAt')[_0x8060('0x3c')]('id',_0x8060('0x46'))[_0x8060('0x3c')](LISTID[_0x8060('0x3e')](),_0x8060('0x2c'))['field'](_0x33be1b['id'][_0x8060('0x3e')](),_0x3519b7)['field'](_0x8060('0x3d'),_0x8060('0x39'))[_0x8060('0x3c')](_0x8060('0x3d'),_0x8060('0x3a'))['from'](_0x8060('0x3f'))[_0x8060('0x40')](_0x8060('0x41'))['where'](_0x8060('0x47'),LISTID['toString']())[_0x8060('0x40')](_0x8060('0x48'),squel[_0x8060('0x49')](hopperContacts))[_0x8060('0x40')](_0x8060('0x42'))['where'](_0x8060('0x43'),squel[_0x8060('0x3b')]()['field']('calleridnum')[_0x8060('0x4a')](_0x8060('0x4b'))['where'](_0x3519b7+_0x8060('0x45'),_0x33be1b['id'][_0x8060('0x3e')]()))[_0x8060('0x40')](_0x8060('0x43'),squel[_0x8060('0x3b')]()[_0x8060('0x3c')](_0x8060('0x24'))[_0x8060('0x4a')](_0x8060('0x44'))[_0x8060('0x40')](_0x3519b7+_0x8060('0x45'),_0x33be1b['id'][_0x8060('0x3e')]())))[_0x8060('0x3e')]();return _0x2232da;};function _0x5f272a(_0x459e2f,_0x2321a7){var _0xb69ca=squel[_0x8060('0x36')]()[_0x8060('0x37')]('cm_hopper')[_0x8060('0x4c')](['phone',_0x8060('0x38'),'ContactId',_0x8060('0x2c'),_0x2321a7,_0x8060('0x39'),_0x8060('0x3a')],squel[_0x8060('0x3b')]()[_0x8060('0x3c')](_0x8060('0x24'),'phone')['field'](_0x8060('0x3d'),_0x8060('0x38'))[_0x8060('0x3c')]('id',_0x8060('0x46'))[_0x8060('0x3c')](LISTID[_0x8060('0x3e')](),_0x8060('0x2c'))[_0x8060('0x3c')](_0x459e2f['id'][_0x8060('0x3e')](),_0x2321a7)['field'](_0x8060('0x3d'),'createdAt')[_0x8060('0x3c')](_0x8060('0x3d'),'updatedAt')['from'](_0x8060('0x3f'))['where'](_0x8060('0x41'))['where'](_0x8060('0x47'),LISTID[_0x8060('0x3e')]())[_0x8060('0x40')](_0x8060('0x48'),squel[_0x8060('0x49')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x8060('0x3e')]();return _0xb69ca;}function _0x1ae885(_0x40938f,_0x1ce7f5){var _0x1dc58c=squel['insert']()[_0x8060('0x37')](_0x8060('0x4d'))[_0x8060('0x4c')]([_0x8060('0x24'),_0x8060('0x46'),_0x8060('0x2c'),_0x1ce7f5,_0x8060('0x39'),'updatedAt'],squel[_0x8060('0x3b')]()[_0x8060('0x3c')](_0x8060('0x24'),_0x8060('0x24'))[_0x8060('0x3c')]('id',_0x8060('0x46'))[_0x8060('0x3c')](LISTID[_0x8060('0x3e')](),'ListId')[_0x8060('0x3c')](_0x40938f['id'][_0x8060('0x3e')](),_0x1ce7f5)['field']('NOW()',_0x8060('0x39'))[_0x8060('0x3c')](_0x8060('0x3d'),_0x8060('0x3a'))[_0x8060('0x4a')](_0x8060('0x3f'))[_0x8060('0x40')]('deletedAt\x20IS\x20NULL')[_0x8060('0x40')]('ListId\x20=\x20?',LISTID[_0x8060('0x3e')]())[_0x8060('0x40')](_0x8060('0x48'),squel[_0x8060('0x49')](hopperContacts))['where'](_0x8060('0x42')))[_0x8060('0x3e')]();return _0x1dc58c;}return db[_0x8060('0x4e')][_0x8060('0x4f')]({'where':{'type':_0x8060('0x50')},'attributes':['id',_0x8060('0x51')],'include':[{'model':db[_0x8060('0x52')],'as':_0x8060('0x53'),'where':{'id':LISTID}}]})['then'](function(_0x9e599d){var _0x48c854=[];if(_0x9e599d){var _0x59fa96;for(var _0x151a5b=0x0,_0x9dfcba;_0x151a5b<_0x9e599d[_0x8060('0x1d')];_0x151a5b+=0x1){_0x9dfcba=_0x9e599d[_0x151a5b]['get']({'plain':!![]});switch(_0x9dfcba[_0x8060('0x51')]){case _0x8060('0x54'):_0x48c854[_0x8060('0x32')](db[_0x8060('0x55')][_0x8060('0x56')](_0x2dbb38(_0x9dfcba,_0x8060('0x57')))[_0x8060('0x31')](function(){})['catch'](_0x154dd2()));break;case _0x8060('0x58'):_0x48c854[_0x8060('0x32')](db[_0x8060('0x55')][_0x8060('0x56')](_0x2dfbfb(_0x9dfcba,_0x8060('0x57')))[_0x8060('0x31')](function(){})[_0x8060('0x59')](_0x154dd2()));break;default:_0x48c854['push'](db['sequelize'][_0x8060('0x56')](_0x5f272a(_0x9dfcba,_0x8060('0x57')))[_0x8060('0x31')](function(){})[_0x8060('0x59')](_0x154dd2()));}}}return _0x48c854;})[_0x8060('0x5a')]()[_0x8060('0x31')](function(){return db['VoiceQueue'][_0x8060('0x4f')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})['then'](function(_0x545299){var _0x542311=[];if(_0x545299){var _0x224ff6;for(var _0x3793c7=0x0,_0x5aa945;_0x3793c7<_0x545299['length'];_0x3793c7+=0x1){_0x5aa945=_0x545299[_0x3793c7]['get']({'plain':!![]});_0x542311[_0x8060('0x32')](db[_0x8060('0x55')][_0x8060('0x56')](_0x1ae885(_0x5aa945,_0x8060('0x57')))[_0x8060('0x31')](function(){})[_0x8060('0x59')](_0x154dd2()));}}return _0x542311;})[_0x8060('0x5a')]();})['then'](function(){return db[_0x8060('0x5b')][_0x8060('0x4f')]({'attributes':['id',_0x8060('0x51')],'include':[{'model':db[_0x8060('0x52')],'as':_0x8060('0x53'),'where':{'id':LISTID}}]})[_0x8060('0x31')](function(_0x237e04){var _0x31d693=[];if(_0x237e04){for(var _0x4d1a46=0x0,_0x933a3a;_0x4d1a46<_0x237e04['length'];_0x4d1a46+=0x1){_0x933a3a=_0x237e04[_0x4d1a46][_0x8060('0x5c')]({'plain':!![]});switch(_0x933a3a['dialCheckDuplicateType']){case _0x8060('0x54'):_0x31d693[_0x8060('0x32')](db[_0x8060('0x55')][_0x8060('0x56')](_0x2dbb38(_0x933a3a,_0x8060('0x5d')))[_0x8060('0x31')](function(){})['catch'](_0x154dd2()));break;case _0x8060('0x58'):_0x31d693[_0x8060('0x32')](db[_0x8060('0x55')][_0x8060('0x56')](_0x2dfbfb(_0x933a3a,'CampaignId'))[_0x8060('0x31')](function(){})[_0x8060('0x59')](_0x154dd2()));break;default:_0x31d693[_0x8060('0x32')](db[_0x8060('0x55')][_0x8060('0x56')](_0x5f272a(_0x933a3a,_0x8060('0x5d')))[_0x8060('0x31')](function(){})[_0x8060('0x59')](_0x154dd2()));}}}return _0x31d693;})[_0x8060('0x5a')]();})['then'](function(){return db['Campaign'][_0x8060('0x4f')]({'attributes':['id'],'include':[{'model':db[_0x8060('0x52')],'as':_0x8060('0x5e'),'where':{'id':LISTID}}]})['then'](function(_0x5586e4){var _0x39b39b=[];if(_0x5586e4){for(var _0x52322b=0x0,_0x33c6a3;_0x52322b<_0x5586e4['length'];_0x52322b+=0x1){_0x33c6a3=_0x5586e4[_0x52322b][_0x8060('0x5c')]({'plain':!![]});_0x39b39b['push'](db[_0x8060('0x55')][_0x8060('0x56')](_0x1ae885(_0x33c6a3,'CampaignId'))[_0x8060('0x31')](function(){})['catch'](_0x154dd2()));}}return _0x39b39b;})[_0x8060('0x5a')]();})[_0x8060('0x59')](function(_0x2dcc91){logger[_0x8060('0x17')](_0x8060('0x5f'),_0x8060('0x60'),_0x2dcc91[_0x8060('0x1f')]);});}var processPromises=function(_0x495ea2){return BPromise[_0x8060('0x5a')](promises)[_0x8060('0x31')](function(_0x12cde5){})[_0x8060('0x59')](function(_0x2e7417){logger[_0x8060('0x17')](_0x8060('0x61'),JSON['stringify'](_0x2e7417));})[_0x8060('0x62')](function(){socket[_0x8060('0x63')](_0x8060('0x64')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x495ea2){return _0x495ea2[_0x8060('0x65')]();}});};var endCsv=function(){return BPromise[_0x8060('0x66')]()[_0x8060('0x31')](function(){if(hopperContacts){return checkHopper();}})[_0x8060('0x31')](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x8060('0x67')](FILEPATH);}catch(_0x41382d){logger[_0x8060('0x17')](_0x8060('0x68'),JSON['stringify'](_0x41382d));}finally{process[_0x8060('0x69')](0x0);}});};process['on'](_0x8060('0x6a'),function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x8060('0x66')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x8060('0x13')](',');return db[_0x8060('0x30')][_0x8060('0x4f')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x8060('0x31')](function(_0x3f6c68){var _0x16c5ce=fs[_0x8060('0x6b')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x16c5ce,{'header':!![],'skipEmptyLines':!![],'step':function(_0x1a9c84,_0x3f8dbc){total+=0x1;var _0x4e5be9=total;promises[_0x8060('0x32')](checkRow(_0x1a9c84,_0x3f6c68,_0x4e5be9)['then'](function(){success+=0x1;})['catch'](function(_0x163fc2){if(_0x163fc2[_0x8060('0x17')]){errors+=0x1;delete _0x163fc2[_0x8060('0x17')];}else if(_0x163fc2[_0x8060('0x2e')]){duplicates+=0x1;delete _0x163fc2[_0x8060('0x2e')];}rows[_0x8060('0x32')](_0x163fc2);}));if(total%0xc8===0x0){_0x3f8dbc[_0x8060('0x6c')]();return processPromises(_0x3f8dbc);}},'complete':function(){return processPromises()[_0x8060('0x31')](function(){logger[_0x8060('0x6d')](_0x8060('0x6e'));endCsv();});},'error':function(_0xb23f2b,_0x51a0bf){logger[_0x8060('0x6d')](_0x8060('0x6f'),JSON['stringify'](_0xb23f2b));endCsv();}});})[_0x8060('0x59')](function(_0x2f2337){logger[_0x8060('0x17')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x8060('0x70')](_0x2f2337));});}main();
\ No newline at end of file
index 64e6228..3eb3d4c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cca=['Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','query','spread','catch','main','stringify','send','start','binding','socket_timestamp','server/files/tmp','.csv','header','writeFileSync','createReadStream','length','rows','data','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','appendFileSync','contact:import:','abort','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','campaigns_has_cm_blacklists','CampaignId','each','then','affectedRows','emit','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','root','existsSync','file\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','UserId','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','parse','No\x20agent\x20available','path','lodash','papaparse','bluebird','moment','squel','../../../mysqldb','redis','defaults','localhost','format','YYYY-MM-DD\x20HH:mm:ss','select','field','phone','from','.id\x20=\x20','where','\x20=\x20','join','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','cm_hopper','fromQuery','scheduledat','createdAt','updatedAt','priority','recallme','fields','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.phone','into','cm_hopper_black','ListId','keys','CompanyId','cm_contacts',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3cca,0xce));var _0xa3cc=function(_0x2ee8a8,_0x445a54){_0x2ee8a8=_0x2ee8a8-0x0;var _0x3ec669=_0x3cca[_0x2ee8a8];return _0x3ec669;};'use strict';var fs=require('fs');var path=require(_0xa3cc('0x0'));var _=require(_0xa3cc('0x1'));var Papa=require(_0xa3cc('0x2'));var util=require('util');var BPromise=require(_0xa3cc('0x3'));var moment=require(_0xa3cc('0x4'));var squel=require(_0xa3cc('0x5'));var Redis=require('ioredis');var db=require(_0xa3cc('0x6'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')('import');config[_0xa3cc('0x7')]=_[_0xa3cc('0x8')](config[_0xa3cc('0x7')],{'host':_0xa3cc('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa3cc('0x7')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xa3cc('0xa')](_0xa3cc('0xb'));function isEmail(_0x5a31fd){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'](_0x5a31fd);}function selectNotIn(_0x473de3,_0x22f27f,_0x435c01,_0x15594e,_0x144fa1){return squel[_0xa3cc('0xc')]()[_0xa3cc('0xd')](_0xa3cc('0xe'))[_0xa3cc('0xf')](_0x15594e)['join'](_0x22f27f,null,_0x22f27f+_0xa3cc('0x10')+_0x15594e+'.'+_0x435c01)[_0xa3cc('0x11')](_0x15594e+'.'+_0x435c01+_0xa3cc('0x12')+_0x473de3+'.'+_0x435c01)[_0xa3cc('0x11')](_0x22f27f+'.dialCheckDuplicateType\x20IN\x20('+_0x144fa1[_0xa3cc('0x13')]()+')');}function insertCmHopper(_0x306572,_0x55f809,_0xeaa7c5,_0x4558e2,_0x4cf3d1){var _0x2b0b32=['cm_contacts.phone',_0xa3cc('0x14'),_0xa3cc('0x15'),_0xa3cc('0x16'),_0x55f809+'.'+_0x4558e2,_0xa3cc('0x17'),_0xa3cc('0x18'),_0xa3cc('0x19'),'cm_contacts.UserId','\x22'+_0x4cf3d1+'\x22'];return squel[_0xa3cc('0x1a')]()['into'](_0xa3cc('0x1b'))[_0xa3cc('0x1c')](['phone',_0xa3cc('0x1d'),'ContactId','ListId',_0x4558e2,_0xa3cc('0x1e'),_0xa3cc('0x1f'),_0xa3cc('0x20'),'UserId',_0xa3cc('0x21')],squel['select']()[_0xa3cc('0x22')](_0x2b0b32)[_0xa3cc('0xf')](_0x55f809)[_0xa3cc('0x13')]('cm_contacts',null,_0xa3cc('0x23')+_0x55f809+_0xa3cc('0x24'))[_0xa3cc('0x13')](_0xeaa7c5,null,_0xeaa7c5+'.id\x20=\x20'+_0x55f809+'.'+_0x4558e2)[_0xa3cc('0x11')](_0x55f809+_0xa3cc('0x25'),_0x306572)['where'](_0xa3cc('0x26'),NOW)[_0xa3cc('0x11')](_0xa3cc('0x27'),selectNotIn(_0x55f809,_0xeaa7c5,_0x4558e2,'cm_hopper',[_0xa3cc('0x28'),_0xa3cc('0x29')]))[_0xa3cc('0x11')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x55f809,_0xeaa7c5,_0x4558e2,_0xa3cc('0x1b'),[_0xa3cc('0x28')])))[_0xa3cc('0x2a')]();}function insertCmHopperBlack(_0x2a6254,_0x526b53,_0x3bd296,_0x509a74){var _0x4a26c6=[_0xa3cc('0x2b'),_0xa3cc('0x15'),_0xa3cc('0x16'),_0x526b53+'.'+_0x509a74,_0xa3cc('0x17'),_0xa3cc('0x18')];return squel[_0xa3cc('0x1a')]()[_0xa3cc('0x2c')](_0xa3cc('0x2d'))[_0xa3cc('0x1c')]([_0xa3cc('0xe'),'ContactId',_0xa3cc('0x2e'),_0x509a74,'createdAt',_0xa3cc('0x1f')],squel[_0xa3cc('0xc')]()[_0xa3cc('0x22')](_0x4a26c6)['from'](_0x526b53)[_0xa3cc('0x13')]('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x526b53+_0xa3cc('0x24'))[_0xa3cc('0x13')](_0x3bd296,null,_0x3bd296+_0xa3cc('0x10')+_0x526b53+'.'+_0x509a74)[_0xa3cc('0x11')](_0x526b53+_0xa3cc('0x25'),_0x2a6254)[_0xa3cc('0x11')](_0xa3cc('0x26'),NOW)[_0xa3cc('0x11')](_0xa3cc('0x27'),squel['select']()[_0xa3cc('0xd')](_0xa3cc('0xe'))['from']('cm_hopper_black')['where']('ListId\x20=\x20?',_0x2a6254)[_0xa3cc('0x11')](_0x509a74+'\x20=\x20?',_0x526b53+'.'+_0x509a74)))[_0xa3cc('0x2a')]();}function insertCmContact(_0x52a6d3,_0x3ad20c,_0x55f52c,_0xd4333a){var _0x4918fa=_['concat'](_[_0xa3cc('0x2f')](_0xd4333a),[_0xa3cc('0x2e'),_0xa3cc('0x30'),_0xa3cc('0x1e'),_0xa3cc('0x1f')]);return squel[_0xa3cc('0x1a')]()[_0xa3cc('0x2c')](_0xa3cc('0x31'))[_0xa3cc('0x1c')](_0x4918fa,squel[_0xa3cc('0xc')]()[_0xa3cc('0x22')](_0x4918fa)[_0xa3cc('0xf')](_0x3ad20c)[_0xa3cc('0x11')]('('+_0x55f52c[_0xa3cc('0x13')](',')+_0xa3cc('0x32'),squel[_0xa3cc('0xc')]()['fields'](_0x55f52c)[_0xa3cc('0xf')]('cm_contacts')['where'](_0xa3cc('0x33'),_0x52a6d3)[_0xa3cc('0x11')](_0xa3cc('0x34')))['where'](_0xa3cc('0x35'),squel[_0xa3cc('0xc')]()[_0xa3cc('0xd')](_0xa3cc('0x36'),_0xa3cc('0x37'))[_0xa3cc('0xf')](_0x3ad20c)[_0xa3cc('0x38')](_0x55f52c[_0xa3cc('0x13')](','))))['toString']();}function handleStop(){logger[_0xa3cc('0x39')](_0xa3cc('0x3a'));stopped=!![];}function handleUncaughtException(_0x5221bb){logger[_0xa3cc('0x3b')](_0x5221bb[_0xa3cc('0x3c')]);process[_0xa3cc('0x3d')](0x1);}function handleError(_0x158cd1,_0x1d0320){stats[_0xa3cc('0x3e')][_0xa3cc('0x3f')]({'name':_0x1d0320[_0xa3cc('0x40')],'message':_0x1d0320[_0xa3cc('0x3c')],'row':_0x158cd1});}function handleQuery(_0x28da3b){logger[_0xa3cc('0x39')](_0x28da3b);return db[_0xa3cc('0x41')][_0xa3cc('0x42')](_0x28da3b)[_0xa3cc('0x43')](function(_0x49b8f9){results[_0xa3cc('0x3f')](_0x49b8f9);})[_0xa3cc('0x44')](function(_0x54b2a9){logger[_0xa3cc('0x3b')](_0x54b2a9[_0xa3cc('0x3c')]);});}function main(_0x5c1163,_0x4bd69e,_0x3baa0c,_0x58d278){logger[_0xa3cc('0x39')](_0xa3cc('0x45'),_0x5c1163,JSON[_0xa3cc('0x46')](_0x4bd69e));process[_0xa3cc('0x47')](_0xa3cc('0x48'));var _0x55532c=_0x4bd69e[_0xa3cc('0x49')];var _0x1eb177=_0x4bd69e[_0xa3cc('0x4a')];var _0x929d28=path[_0xa3cc('0x13')](config['root'],_0xa3cc('0x4b'),_0x1eb177+_0xa3cc('0x4c'));var _0x57ee11=_[_0xa3cc('0x2f')](_0x55532c)[_0xa3cc('0x13')]();logger['info'](_0xa3cc('0x4d'),_0x57ee11);fs[_0xa3cc('0x4e')](_0x929d28,_0x57ee11+'\x0a');Papa['parse'](fs[_0xa3cc('0x4f')](_0x5c1163),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1a262f,_0x55cada){try{for(var _0x2ad82a=0x0,_0x4dc537=[];_0x2ad82a<_0x1a262f['data'][_0xa3cc('0x50')];_0x2ad82a++){stats[_0xa3cc('0x51')]+=0x1;if(_0x1a262f[_0xa3cc('0x3e')][_0x2ad82a]){handleError(_0x1a262f[_0xa3cc('0x52')][_0x2ad82a],_0x1a262f[_0xa3cc('0x3e')][_0x2ad82a]);}else{var _0x1d0b65=[];for(var _0x4224b7 in _0x55532c){if(_0x55532c['hasOwnProperty'](_0x4224b7)){if(_0x1a262f['data'][_0x2ad82a][_0x55532c[_0x4224b7]]){var _0x22e8d1=_[_0xa3cc('0x53')](_0x1a262f['data'][_0x2ad82a][_0x55532c[_0x4224b7]][_0xa3cc('0x54')](/"/g,'\x27'));switch(_0x4224b7){case _0xa3cc('0x1d'):var _0x275d1c=moment(_0x22e8d1,_0xa3cc('0xb'),!![]);if(_0x275d1c[_0xa3cc('0x55')]()){_0x4dc537[_0xa3cc('0x3f')]('\x22'+_0x22e8d1+'\x22');}else{_0x1d0b65[_0xa3cc('0x3f')](_0xa3cc('0x56'));}break;case _0xa3cc('0x20'):var _0x24b074=parseInt(_0x22e8d1);_0x22e8d1=_[_0xa3cc('0x57')](_0x24b074)||_0x24b074<0x0||_0x24b074>0x4?_0x58d278?0x3:0x2:_0x24b074;_0x4dc537[_0xa3cc('0x3f')]('\x22'+_0x22e8d1+'\x22');break;case'UserId':var _0x5b904a=parseInt(_0x22e8d1);if(_[_0xa3cc('0x58')](_0x5b904a)&&_[_0xa3cc('0x59')](_0x3baa0c,_0x5b904a)){_0x4dc537[_0xa3cc('0x3f')]('\x22'+_0x5b904a+'\x22');}else{_0x1d0b65[_0xa3cc('0x3f')](_0xa3cc('0x5a'));}break;case _0xa3cc('0x5b'):if(isEmail(_0x22e8d1)){_0x4dc537['push']('\x22'+_0x22e8d1+'\x22');}else{_0x1d0b65[_0xa3cc('0x3f')]('email\x20wrong\x20format');}break;case'dateOfBirth':var _0x193f07=moment(_0x22e8d1,'YYYY-MM-DD',!![]);if(_0x193f07[_0xa3cc('0x55')]()){_0x4dc537['push']('\x22'+_0x22e8d1+'\x22');}else{_0x1d0b65[_0xa3cc('0x3f')](_0xa3cc('0x5c'));}break;default:_0x4dc537[_0xa3cc('0x3f')]('\x22'+_0x22e8d1+'\x22');}}else{switch(_0x4224b7){case _0xa3cc('0x5d'):case _0xa3cc('0xe'):_0x1d0b65[_0xa3cc('0x3f')](_0x4224b7+_0xa3cc('0x5e'));break;default:_0x4dc537[_0xa3cc('0x3f')]('\x22\x22');}}}}if(_0x1d0b65['length']){handleError(_0x1a262f[_0xa3cc('0x52')][_0x2ad82a],{'code':'SystemRow','message':_0x1d0b65['join']()});}else{fs[_0xa3cc('0x5f')](_0x929d28,_0x4dc537[_0xa3cc('0x13')]()+'\x0a');}_0x4dc537=[];}if(!(stats['rows']%0xc8)){socket['emit'](_0xa3cc('0x60')+_0x1eb177,stats);stats[_0xa3cc('0x3e')]=[];}}if(stopped){logger[_0xa3cc('0x39')]('Abort\x20parser');_0x55cada[_0xa3cc('0x61')]();}}catch(_0x58c4c9){handleError(_0x1a262f[_0xa3cc('0x52')][_0x2ad82a],{'code':'SystemError','message':_0x58c4c9[_0xa3cc('0x3c')]});logger[_0xa3cc('0x3b')](_0xa3cc('0x62'),_0x58c4c9[_0xa3cc('0x3c')]);}},'complete':function(){try{var _0x16b31e=[];var _0x3024b8='cm_contacts';if(_0x4bd69e[_0xa3cc('0x63')]&&_0x4bd69e[_0xa3cc('0x63')][_0xa3cc('0x50')]){_0x3024b8=_0xa3cc('0x64')+_0x1eb177;_0x16b31e[_0xa3cc('0x3f')](_0xa3cc('0x65')+_0x3024b8+_0xa3cc('0x66'));}var _0x17bbe7=util[_0xa3cc('0xa')](_0xa3cc('0x67'),_0x929d28,_0x3024b8,_0x57ee11,_0x4bd69e[_0xa3cc('0x2e')],_0x4bd69e['CompanyId']||null,NOW,NOW);if(_[_0xa3cc('0x68')](_0x55532c[_0xa3cc('0x1d')])){_0x17bbe7+=_0xa3cc('0x69');}_0x16b31e[_0xa3cc('0x3f')](_0x17bbe7);if(_0x4bd69e[_0xa3cc('0x63')]&&_0x4bd69e[_0xa3cc('0x63')]['length']){_0x16b31e['push'](insertCmContact(_0x4bd69e[_0xa3cc('0x2e')],_0x3024b8,_0x4bd69e[_0xa3cc('0x63')],_0x55532c));_0x16b31e['push'](_0xa3cc('0x6a')+_0x3024b8+';');}_0x16b31e[_0xa3cc('0x3f')](insertCmHopper(_0x4bd69e[_0xa3cc('0x2e')],'voice_queues_has_cm_lists',_0xa3cc('0x6b'),_0xa3cc('0x6c'),_0x58d278));_0x16b31e[_0xa3cc('0x3f')](insertCmHopperBlack(_0x4bd69e[_0xa3cc('0x2e')],_0xa3cc('0x6d'),_0xa3cc('0x6b'),_0xa3cc('0x6c')));_0x16b31e['push'](insertCmHopper(_0x4bd69e[_0xa3cc('0x2e')],_0xa3cc('0x6e'),_0xa3cc('0x6f'),'CampaignId',_0x58d278));_0x16b31e['push'](insertCmHopperBlack(_0x4bd69e[_0xa3cc('0x2e')],_0xa3cc('0x70'),_0xa3cc('0x6f'),_0xa3cc('0x71')));BPromise[_0xa3cc('0x72')](_0x16b31e,handleQuery)[_0xa3cc('0x73')](function(_0x49e52d){stats['finish']=!![];stats[_0xa3cc('0x74')]=_0x4bd69e[_0xa3cc('0x63')]&&_0x4bd69e[_0xa3cc('0x63')][_0xa3cc('0x50')]?results[0x2][_0xa3cc('0x74')]:results[0x0][_0xa3cc('0x74')];socket[_0xa3cc('0x75')](_0xa3cc('0x60')+_0x1eb177,stats);fs[_0xa3cc('0x76')](_0x5c1163);fs['unlink'](_0x929d28);process['exit'](0x0);})[_0xa3cc('0x44')](function(_0x231f3e){logger[_0xa3cc('0x3b')](_0x231f3e[_0xa3cc('0x3c')]);process[_0xa3cc('0x3d')](0x1);});}catch(_0x269774){logger['error'](_0xa3cc('0x77'),_0x269774[_0xa3cc('0x3c')]);process[_0xa3cc('0x3d')](0x1);}},'error':function(_0x3f7810,_0x1dd322,_0x5aaf9f,_0x219a86){throw new Error(_0x219a86);}});}function validate(){if(process[_0xa3cc('0x78')]&&process[_0xa3cc('0x78')]['length']<0x4){throw new Error(_0xa3cc('0x79'));}var _0x5817c9=path['join'](config[_0xa3cc('0x7a')],'server/files/tmp',process[_0xa3cc('0x78')][0x2]);if(!fs[_0xa3cc('0x7b')](_0x5817c9)){throw new Error(_0xa3cc('0x7c'));}var _0x295068={};try{_0x295068=JSON['parse'](process['argv'][0x3]);if(!_0x295068[_0xa3cc('0x49')]){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x295068['binding']['phone']){throw new Error('phone\x20is\x20mandatory');}if(!_0x295068[_0xa3cc('0x49')]['firstName']){throw new Error(_0xa3cc('0x7d'));}var _0x3838f6=0x0;if(_0x295068[_0xa3cc('0x49')][_0xa3cc('0x7e')]){_0x3838f6=0x1;}if(!_0x295068[_0xa3cc('0x2e')]){throw new Error(_0xa3cc('0x7f'));}}catch(_0x11e76c){throw new Error(_0xa3cc('0x80'));}var _0x498ca4=[];try{_0x498ca4=_[_0xa3cc('0x81')](JSON[_0xa3cc('0x82')](process['argv'][0x4]),'id');}catch(_0x2f7ed4){logger[_0xa3cc('0x39')](_0xa3cc('0x83'));}main(_0x5817c9,_0x295068,_0x498ca4,_0x3838f6);}validate();process['on']('SIGINT',handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
+var _0x40b9=['.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.phone','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','updatedAt','priority','UserId','recallme','cm_contacts','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_contacts.id','cm_hopper_black','ListId','createdAt','fields','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','concat','keys',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','push','code','sequelize','query','spread','catch','main','send','start','binding','root','server/files/tmp','header','parse','createReadStream','data','length','hasOwnProperty','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','appendFileSync','rows','emit','contact:import:','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','CompanyId','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','campaigns_has_cm_blacklists','CampaignId','each','then','finish','affectedRows','unlink','complete','argv','arguments\x20<filename>\x20<parameters>\x20<agents>','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from'];(function(_0x35d483,_0x28b4a0){var _0x99edb7=function(_0x57ce32){while(--_0x57ce32){_0x35d483['push'](_0x35d483['shift']());}};_0x99edb7(++_0x28b4a0);}(_0x40b9,0x77));var _0x940b=function(_0xd70515,_0x50cfb3){_0xd70515=_0xd70515-0x0;var _0x1e9a3a=_0x40b9[_0xd70515];return _0x1e9a3a;};'use strict';var fs=require('fs');var path=require(_0x940b('0x0'));var _=require(_0x940b('0x1'));var Papa=require(_0x940b('0x2'));var util=require('util');var BPromise=require(_0x940b('0x3'));var moment=require(_0x940b('0x4'));var squel=require(_0x940b('0x5'));var Redis=require(_0x940b('0x6'));var db=require(_0x940b('0x7'))['db'];var config=require('../../../config/environment');var logger=require(_0x940b('0x8'))(_0x940b('0x9'));config[_0x940b('0xa')]=_[_0x940b('0xb')](config[_0x940b('0xa')],{'host':_0x940b('0xc'),'port':0x18eb});var socket=require(_0x940b('0xd'))(new Redis(config[_0x940b('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x940b('0xe')](_0x940b('0xf'));function isEmail(_0x1c341f){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))*$/[_0x940b('0x10')](_0x1c341f);}function selectNotIn(_0x1e0f81,_0x468005,_0x371e43,_0x1e976d,_0x2bc58d){return squel[_0x940b('0x11')]()[_0x940b('0x12')](_0x940b('0x13'))[_0x940b('0x14')](_0x1e976d)['join'](_0x468005,null,_0x468005+_0x940b('0x15')+_0x1e976d+'.'+_0x371e43)[_0x940b('0x16')](_0x1e976d+'.'+_0x371e43+_0x940b('0x17')+_0x1e0f81+'.'+_0x371e43)['where'](_0x468005+_0x940b('0x18')+_0x2bc58d[_0x940b('0x19')]()+')');}function insertCmHopper(_0x29de00,_0x1646b2,_0x4b9de9,_0x2ab869,_0x3226fa){var _0x39463c=[_0x940b('0x1a'),'cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId',_0x1646b2+'.'+_0x2ab869,_0x940b('0x1b'),_0x940b('0x1c'),'cm_contacts.priority',_0x940b('0x1d'),'\x22'+_0x3226fa+'\x22'];return squel[_0x940b('0x1e')]()[_0x940b('0x1f')](_0x940b('0x20'))[_0x940b('0x21')]([_0x940b('0x13'),_0x940b('0x22'),_0x940b('0x23'),'ListId',_0x2ab869,'createdAt',_0x940b('0x24'),_0x940b('0x25'),_0x940b('0x26'),_0x940b('0x27')],squel['select']()['fields'](_0x39463c)[_0x940b('0x14')](_0x1646b2)['join'](_0x940b('0x28'),null,'cm_contacts.ListId\x20=\x20'+_0x1646b2+'.CmListId')[_0x940b('0x19')](_0x4b9de9,null,_0x4b9de9+_0x940b('0x15')+_0x1646b2+'.'+_0x2ab869)[_0x940b('0x16')](_0x1646b2+'.CmListId\x20=\x20?',_0x29de00)['where'](_0x940b('0x29'),NOW)[_0x940b('0x16')](_0x940b('0x2a'),selectNotIn(_0x1646b2,_0x4b9de9,_0x2ab869,_0x940b('0x20'),['\x22always\x22',_0x940b('0x2b')]))['where'](_0x940b('0x2a'),selectNotIn(_0x1646b2,_0x4b9de9,_0x2ab869,_0x940b('0x20'),[_0x940b('0x2c')])))[_0x940b('0x2d')]();}function insertCmHopperBlack(_0x6df26e,_0x395a1c,_0x1568ab,_0x135212){var _0x58ef6d=[_0x940b('0x1a'),_0x940b('0x2e'),'cm_contacts.ListId',_0x395a1c+'.'+_0x135212,_0x940b('0x1b'),_0x940b('0x1c')];return squel[_0x940b('0x1e')]()[_0x940b('0x1f')](_0x940b('0x2f'))[_0x940b('0x21')]([_0x940b('0x13'),_0x940b('0x23'),_0x940b('0x30'),_0x135212,_0x940b('0x31'),_0x940b('0x24')],squel[_0x940b('0x11')]()[_0x940b('0x32')](_0x58ef6d)[_0x940b('0x14')](_0x395a1c)[_0x940b('0x19')](_0x940b('0x28'),null,_0x940b('0x33')+_0x395a1c+_0x940b('0x34'))[_0x940b('0x19')](_0x1568ab,null,_0x1568ab+_0x940b('0x15')+_0x395a1c+'.'+_0x135212)[_0x940b('0x16')](_0x395a1c+_0x940b('0x35'),_0x6df26e)[_0x940b('0x16')](_0x940b('0x29'),NOW)[_0x940b('0x16')](_0x940b('0x2a'),squel[_0x940b('0x11')]()[_0x940b('0x12')](_0x940b('0x13'))[_0x940b('0x14')](_0x940b('0x2f'))[_0x940b('0x16')](_0x940b('0x36'),_0x6df26e)[_0x940b('0x16')](_0x135212+_0x940b('0x37'),_0x395a1c+'.'+_0x135212)))[_0x940b('0x2d')]();}function insertCmContact(_0x264fe4,_0x5b8ffd,_0x4eb588,_0x114ec6){var _0x58ad71=_[_0x940b('0x38')](_[_0x940b('0x39')](_0x114ec6),[_0x940b('0x30'),'CompanyId',_0x940b('0x31'),_0x940b('0x24')]);return squel[_0x940b('0x1e')]()[_0x940b('0x1f')](_0x940b('0x28'))[_0x940b('0x21')](_0x58ad71,squel[_0x940b('0x11')]()[_0x940b('0x32')](_0x58ad71)[_0x940b('0x14')](_0x5b8ffd)[_0x940b('0x16')]('('+_0x4eb588[_0x940b('0x19')](',')+_0x940b('0x3a'),squel[_0x940b('0x11')]()[_0x940b('0x32')](_0x4eb588)['from'](_0x940b('0x28'))['where'](_0x940b('0x36'),_0x264fe4)['where'](_0x940b('0x3b')))[_0x940b('0x16')]('id\x20IN\x20?',squel[_0x940b('0x11')]()['field']('MIN(id)',_0x940b('0x3c'))[_0x940b('0x14')](_0x5b8ffd)[_0x940b('0x3d')](_0x4eb588[_0x940b('0x19')](','))))[_0x940b('0x2d')]();}function handleStop(){logger[_0x940b('0x3e')](_0x940b('0x3f'));stopped=!![];}function handleUncaughtException(_0x3ef8f9){logger[_0x940b('0x40')](_0x3ef8f9[_0x940b('0x41')]);process[_0x940b('0x42')](0x1);}function handleError(_0x3407fa,_0x30255e){stats[_0x940b('0x43')][_0x940b('0x44')]({'name':_0x30255e[_0x940b('0x45')],'message':_0x30255e[_0x940b('0x41')],'row':_0x3407fa});}function handleQuery(_0xf9e08c){logger['info'](_0xf9e08c);return db[_0x940b('0x46')][_0x940b('0x47')](_0xf9e08c)[_0x940b('0x48')](function(_0x17dd31){results['push'](_0x17dd31);})[_0x940b('0x49')](function(_0x594303){logger[_0x940b('0x40')](_0x594303[_0x940b('0x41')]);});}function main(_0x211991,_0x4cfb4a,_0xc681f7,_0x51fd05){logger[_0x940b('0x3e')](_0x940b('0x4a'),_0x211991,JSON['stringify'](_0x4cfb4a));process[_0x940b('0x4b')](_0x940b('0x4c'));var _0x40042b=_0x4cfb4a[_0x940b('0x4d')];var _0x555755=_0x4cfb4a['socket_timestamp'];var _0x10337e=path[_0x940b('0x19')](config[_0x940b('0x4e')],_0x940b('0x4f'),_0x555755+'.csv');var _0x38317d=_[_0x940b('0x39')](_0x40042b)['join']();logger['info'](_0x940b('0x50'),_0x38317d);fs['writeFileSync'](_0x10337e,_0x38317d+'\x0a');Papa[_0x940b('0x51')](fs[_0x940b('0x52')](_0x211991),{'header':!![],'skipEmptyLines':!![],'step':function(_0x4ec004,_0xd0437b){try{for(var _0x2a6ce8=0x0,_0x36f0d3=[];_0x2a6ce8<_0x4ec004[_0x940b('0x53')][_0x940b('0x54')];_0x2a6ce8++){stats['rows']+=0x1;if(_0x4ec004[_0x940b('0x43')][_0x2a6ce8]){handleError(_0x4ec004[_0x940b('0x53')][_0x2a6ce8],_0x4ec004[_0x940b('0x43')][_0x2a6ce8]);}else{var _0x3de2af=[];for(var _0x511c23 in _0x40042b){if(_0x40042b[_0x940b('0x55')](_0x511c23)){if(_0x4ec004[_0x940b('0x53')][_0x2a6ce8][_0x40042b[_0x511c23]]){var _0x539ed4=_['trim'](_0x4ec004[_0x940b('0x53')][_0x2a6ce8][_0x40042b[_0x511c23]][_0x940b('0x56')](/"/g,'\x27'));switch(_0x511c23){case'scheduledat':var _0x1e479b=moment(_0x539ed4,_0x940b('0xf'),!![]);if(_0x1e479b[_0x940b('0x57')]()){_0x36f0d3['push']('\x22'+_0x539ed4+'\x22');}else{_0x3de2af['push'](_0x940b('0x58'));}break;case _0x940b('0x25'):var _0x48e610=parseInt(_0x539ed4);_0x539ed4=_['isNaN'](_0x48e610)||_0x48e610<0x0||_0x48e610>0x4?_0x51fd05?0x3:0x2:_0x48e610;_0x36f0d3[_0x940b('0x44')]('\x22'+_0x539ed4+'\x22');break;case _0x940b('0x26'):var _0x385d7e=parseInt(_0x539ed4);if(_[_0x940b('0x59')](_0x385d7e)&&_[_0x940b('0x5a')](_0xc681f7,_0x385d7e)){_0x36f0d3[_0x940b('0x44')]('\x22'+_0x385d7e+'\x22');}else{_0x3de2af['push'](_0x940b('0x5b'));}break;case _0x940b('0x5c'):if(isEmail(_0x539ed4)){_0x36f0d3[_0x940b('0x44')]('\x22'+_0x539ed4+'\x22');}else{_0x3de2af['push'](_0x940b('0x5d'));}break;case _0x940b('0x5e'):var _0x91eb6=moment(_0x539ed4,_0x940b('0x5f'),!![]);if(_0x91eb6[_0x940b('0x57')]()){_0x36f0d3[_0x940b('0x44')]('\x22'+_0x539ed4+'\x22');}else{_0x3de2af[_0x940b('0x44')](_0x940b('0x60'));}break;default:_0x36f0d3['push']('\x22'+_0x539ed4+'\x22');}}else{switch(_0x511c23){case _0x940b('0x61'):case _0x940b('0x13'):_0x3de2af[_0x940b('0x44')](_0x511c23+_0x940b('0x62'));break;default:_0x36f0d3[_0x940b('0x44')]('\x22\x22');}}}}if(_0x3de2af['length']){handleError(_0x4ec004[_0x940b('0x53')][_0x2a6ce8],{'code':_0x940b('0x63'),'message':_0x3de2af[_0x940b('0x19')]()});}else{fs[_0x940b('0x64')](_0x10337e,_0x36f0d3[_0x940b('0x19')]()+'\x0a');}_0x36f0d3=[];}if(!(stats[_0x940b('0x65')]%0xc8)){socket[_0x940b('0x66')](_0x940b('0x67')+_0x555755,stats);stats[_0x940b('0x43')]=[];}}if(stopped){logger[_0x940b('0x3e')](_0x940b('0x68'));_0xd0437b[_0x940b('0x69')]();}}catch(_0x492a2c){handleError(_0x4ec004['data'][_0x2a6ce8],{'code':_0x940b('0x6a'),'message':_0x492a2c[_0x940b('0x41')]});logger[_0x940b('0x40')](_0x940b('0x6b'),_0x492a2c[_0x940b('0x41')]);}},'complete':function(){try{var _0x1e7ec0=[];var _0x42604e='cm_contacts';if(_0x4cfb4a['duplicates']&&_0x4cfb4a[_0x940b('0x6c')][_0x940b('0x54')]){_0x42604e=_0x940b('0x6d')+_0x555755;_0x1e7ec0[_0x940b('0x44')]('CREATE\x20TABLE\x20'+_0x42604e+_0x940b('0x6e'));}var _0x538b78=util['format']('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x10337e,_0x42604e,_0x38317d,_0x4cfb4a['ListId'],_0x4cfb4a[_0x940b('0x6f')]||null,NOW,NOW);if(_[_0x940b('0x70')](_0x40042b[_0x940b('0x22')])){_0x538b78+=_0x940b('0x71');}_0x1e7ec0['push'](_0x538b78);if(_0x4cfb4a[_0x940b('0x6c')]&&_0x4cfb4a[_0x940b('0x6c')][_0x940b('0x54')]){_0x1e7ec0[_0x940b('0x44')](insertCmContact(_0x4cfb4a[_0x940b('0x30')],_0x42604e,_0x4cfb4a['duplicates'],_0x40042b));_0x1e7ec0[_0x940b('0x44')](_0x940b('0x72')+_0x42604e+';');}_0x1e7ec0[_0x940b('0x44')](insertCmHopper(_0x4cfb4a[_0x940b('0x30')],_0x940b('0x73'),_0x940b('0x74'),_0x940b('0x75'),_0x51fd05));_0x1e7ec0[_0x940b('0x44')](insertCmHopperBlack(_0x4cfb4a[_0x940b('0x30')],_0x940b('0x76'),_0x940b('0x74'),_0x940b('0x75')));_0x1e7ec0[_0x940b('0x44')](insertCmHopper(_0x4cfb4a[_0x940b('0x30')],_0x940b('0x77'),_0x940b('0x78'),'CampaignId',_0x51fd05));_0x1e7ec0['push'](insertCmHopperBlack(_0x4cfb4a[_0x940b('0x30')],_0x940b('0x79'),_0x940b('0x78'),_0x940b('0x7a')));BPromise[_0x940b('0x7b')](_0x1e7ec0,handleQuery)[_0x940b('0x7c')](function(_0x50a18d){stats[_0x940b('0x7d')]=!![];stats['affectedRows']=_0x4cfb4a[_0x940b('0x6c')]&&_0x4cfb4a[_0x940b('0x6c')][_0x940b('0x54')]?results[0x2][_0x940b('0x7e')]:results[0x0][_0x940b('0x7e')];socket[_0x940b('0x66')]('contact:import:'+_0x555755,stats);fs['unlink'](_0x211991);fs[_0x940b('0x7f')](_0x10337e);process[_0x940b('0x42')](0x0);})['catch'](function(_0x15a1fe){logger['error'](_0x15a1fe[_0x940b('0x41')]);process[_0x940b('0x42')](0x1);});}catch(_0x1774e4){logger[_0x940b('0x40')](_0x940b('0x80'),_0x1774e4[_0x940b('0x41')]);process[_0x940b('0x42')](0x1);}},'error':function(_0x43cf79,_0x1a32c9,_0x3d4914,_0x309e11){throw new Error(_0x309e11);}});}function validate(){if(process[_0x940b('0x81')]&&process[_0x940b('0x81')]['length']<0x4){throw new Error(_0x940b('0x82'));}var _0x188a23=path[_0x940b('0x19')](config['root'],_0x940b('0x4f'),process[_0x940b('0x81')][0x2]);if(!fs['existsSync'](_0x188a23)){throw new Error(_0x940b('0x83'));}var _0x478ec1={};try{_0x478ec1=JSON[_0x940b('0x51')](process['argv'][0x3]);if(!_0x478ec1[_0x940b('0x4d')]){throw new Error(_0x940b('0x84'));}if(!_0x478ec1[_0x940b('0x4d')][_0x940b('0x13')]){throw new Error(_0x940b('0x85'));}if(!_0x478ec1[_0x940b('0x4d')]['firstName']){throw new Error(_0x940b('0x86'));}var _0x4e805d=0x0;if(_0x478ec1[_0x940b('0x4d')][_0x940b('0x26')]){_0x4e805d=0x1;}if(!_0x478ec1[_0x940b('0x30')]){throw new Error(_0x940b('0x87'));}}catch(_0x4a42fb){throw new Error(_0x940b('0x88'));}var _0x429fa2=[];try{_0x429fa2=_[_0x940b('0x89')](JSON[_0x940b('0x51')](process[_0x940b('0x81')][0x4]),'id');}catch(_0x5996b2){logger[_0x940b('0x3e')](_0x940b('0x8a'));}main(_0x188a23,_0x478ec1,_0x429fa2,_0x4e805d);}validate();process['on'](_0x940b('0x8b'),handleStop);process['on']('uncaughtException',handleUncaughtException);
\ No newline at end of file
index 322c056..5e1994e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x22ca=['agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','talktime','Called\x20Number','membername','starttime','Answer\x20Time','endtime','Duration','duration','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue','calleridnum','outbound','Outbound\x20Call','getDescriptions','***\x20Call\x20Info\x20***','Caller\x20Number','keyValue','calleridname','Call\x20To','UniqueId','uniqueid','Date','agentcalledAt','destcalleridname','Agent\x20Number','destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect'];(function(_0x2136a6,_0x35af63){var _0x55b948=function(_0x288a75){while(--_0x288a75){_0x2136a6['push'](_0x2136a6['shift']());}};_0x55b948(++_0x35af63);}(_0x22ca,0x1b2));var _0xa22c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x22ca[_0x14add3];return _0x4a174f;};'use strict';exports[_0xa22c('0x0')]=function(_0xb39a81,_0x2422b8){var _0x405d23=[{'type':_0xa22c('0x1'),'content':_0xa22c('0x2'),'variableName':null}];switch(_0xb39a81[_0xa22c('0x3')]()){case _0xa22c('0x4'):switch(_0x2422b8['toLowerCase']()){case _0xa22c('0x5'):_0x405d23[_0xa22c('0x6')]({'type':_0xa22c('0x7'),'content':'','variableName':_0xa22c('0x8')});_0x405d23[_0xa22c('0x6')]({'type':_0xa22c('0x7'),'content':'','variableName':_0xa22c('0x9')});break;case _0xa22c('0xa'):_0x405d23[_0xa22c('0x6')]({'type':'string','content':_0xa22c('0xb'),'variableName':null});_0x405d23[_0xa22c('0x6')]({'type':_0xa22c('0x7'),'content':'','variableName':'destcalleridnum'});break;}}return _0x405d23;};exports[_0xa22c('0xc')]=function(_0x1eb5b7,_0x3a0e5c){var _0x3f05a5=[];switch(_0x1eb5b7[_0xa22c('0x3')]()){case'voice':switch(_0x3a0e5c[_0xa22c('0x3')]()){case _0xa22c('0x5'):_0x3f05a5=[{'type':_0xa22c('0x1'),'content':_0xa22c('0xd'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xa22c('0xe'),'keyType':_0xa22c('0x7'),'variableName':_0xa22c('0x9')},{'type':_0xa22c('0xf'),'content':'','key':'Caller\x20Name','keyType':_0xa22c('0x7'),'variableName':_0xa22c('0x10')},{'type':_0xa22c('0xf'),'content':'','key':_0xa22c('0x11'),'keyType':_0xa22c('0x7'),'variableName':'destexten'},{'type':'keyValue','content':'','key':'Queue','keyType':'variable','variableName':'queue'},{'type':'keyValue','content':'','key':_0xa22c('0x12'),'keyType':_0xa22c('0x7'),'variableName':_0xa22c('0x13')},{'type':_0xa22c('0xf'),'content':'','key':_0xa22c('0x14'),'keyType':'variable','variableName':_0xa22c('0x15')},{'type':_0xa22c('0x1'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xa22c('0xf'),'content':'','key':'Agent\x20Name','keyType':_0xa22c('0x7'),'variableName':_0xa22c('0x16')},{'type':_0xa22c('0xf'),'content':'','key':_0xa22c('0x17'),'keyType':'variable','variableName':_0xa22c('0x18')},{'type':'string','content':_0xa22c('0x19'),'key':null,'keyType':null,'variableName':null},{'type':_0xa22c('0xf'),'content':'','key':_0xa22c('0x1a'),'keyType':'variable','variableName':_0xa22c('0x15')},{'type':_0xa22c('0xf'),'content':'','key':_0xa22c('0x1b'),'keyType':_0xa22c('0x7'),'variableName':_0xa22c('0x1c')},{'type':_0xa22c('0xf'),'content':'','key':_0xa22c('0x1d'),'keyType':_0xa22c('0x7'),'variableName':_0xa22c('0x1e')},{'type':'keyValue','content':'','key':_0xa22c('0x1f'),'keyType':_0xa22c('0x7'),'variableName':_0xa22c('0x20')},{'type':_0xa22c('0xf'),'content':'','key':'Talk\x20Time','keyType':_0xa22c('0x7'),'variableName':_0xa22c('0x21')}];break;case _0xa22c('0xa'):_0x3f05a5=[{'type':_0xa22c('0x1'),'content':_0xa22c('0xd'),'variableName':null},{'type':'keyValue','content':'','key':_0xa22c('0x22'),'keyType':_0xa22c('0x7'),'keyContent':'','variableName':'destcalleridnum'},{'type':'keyValue','content':'','key':'Member\x20Name','keyType':_0xa22c('0x7'),'keyContent':'','variableName':_0xa22c('0x23')},{'type':_0xa22c('0xf'),'content':'','key':_0xa22c('0x12'),'keyType':_0xa22c('0x7'),'keyContent':'','variableName':'uniqueid'},{'type':_0xa22c('0xf'),'content':'','key':_0xa22c('0x14'),'keyType':_0xa22c('0x7'),'keyContent':'','variableName':_0xa22c('0x24')},{'type':_0xa22c('0x1'),'content':_0xa22c('0x19')},{'type':_0xa22c('0xf'),'content':'','key':_0xa22c('0x25'),'keyType':_0xa22c('0x7'),'keyContent':'','variableName':'answertime'},{'type':_0xa22c('0xf'),'content':'','key':'Complete\x20Time','keyType':'variable','keyContent':'','variableName':_0xa22c('0x26')},{'type':'keyValue','content':'','key':_0xa22c('0x27'),'keyType':'variable','keyContent':'','variableName':_0xa22c('0x28')},{'type':_0xa22c('0xf'),'content':'','key':'Billable\x20Time','keyType':_0xa22c('0x7'),'keyContent':'','variableName':_0xa22c('0x29')}];break;}}return _0x3f05a5;};
\ No newline at end of file
+var _0x78ec=['keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','Agent\x20Complete','agentcompleteAt','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','UniqueId','starttime','Complete\x20Time','Duration','duration','Billable\x20Time','billableseconds','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','queue','calleridnum','outbound','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x78ec,0x9f));var _0xc78e=function(_0x57a262,_0x7dc3e3){_0x57a262=_0x57a262-0x0;var _0x496bcb=_0x78ec[_0x57a262];return _0x496bcb;};'use strict';exports['getSubjects']=function(_0x6f1f7b,_0x3da633){var _0xdf610e=[{'type':_0xc78e('0x0'),'content':_0xc78e('0x1'),'variableName':null}];switch(_0x6f1f7b[_0xc78e('0x2')]()){case _0xc78e('0x3'):switch(_0x3da633[_0xc78e('0x2')]()){case _0xc78e('0x4'):_0xdf610e[_0xc78e('0x5')]({'type':_0xc78e('0x6'),'content':'','variableName':_0xc78e('0x7')});_0xdf610e[_0xc78e('0x5')]({'type':_0xc78e('0x6'),'content':'','variableName':_0xc78e('0x8')});break;case _0xc78e('0x9'):_0xdf610e[_0xc78e('0x5')]({'type':'string','content':'Outbound\x20Call','variableName':null});_0xdf610e[_0xc78e('0x5')]({'type':_0xc78e('0x6'),'content':'','variableName':_0xc78e('0xa')});break;}}return _0xdf610e;};exports[_0xc78e('0xb')]=function(_0x4f5603,_0x326457){var _0x4ee2fd=[];switch(_0x4f5603[_0xc78e('0x2')]()){case'voice':switch(_0x326457[_0xc78e('0x2')]()){case _0xc78e('0x4'):_0x4ee2fd=[{'type':_0xc78e('0x0'),'content':_0xc78e('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0xe'),'keyType':_0xc78e('0x6'),'variableName':'calleridnum'},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0xf'),'keyType':_0xc78e('0x6'),'variableName':_0xc78e('0x10')},{'type':'keyValue','content':'','key':_0xc78e('0x11'),'keyType':_0xc78e('0x6'),'variableName':_0xc78e('0x12')},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0x13'),'keyType':_0xc78e('0x6'),'variableName':_0xc78e('0x7')},{'type':'keyValue','content':'','key':'UniqueId','keyType':_0xc78e('0x6'),'variableName':_0xc78e('0x14')},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0x15'),'keyType':_0xc78e('0x6'),'variableName':_0xc78e('0x16')},{'type':'string','content':_0xc78e('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0x18'),'keyType':'variable','variableName':'destcalleridname'},{'type':'keyValue','content':'','key':_0xc78e('0x19'),'keyType':_0xc78e('0x6'),'variableName':_0xc78e('0xa')},{'type':_0xc78e('0x0'),'content':_0xc78e('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0x1b'),'keyType':_0xc78e('0x6'),'variableName':_0xc78e('0x16')},{'type':'keyValue','content':'','key':_0xc78e('0x1c'),'keyType':_0xc78e('0x6'),'variableName':'agentconnectAt'},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0x1d'),'keyType':_0xc78e('0x6'),'variableName':_0xc78e('0x1e')},{'type':_0xc78e('0xd'),'content':'','key':'Hold\x20Time','keyType':'variable','variableName':'holdtime'},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0x1f'),'keyType':_0xc78e('0x6'),'variableName':_0xc78e('0x20')}];break;case _0xc78e('0x9'):_0x4ee2fd=[{'type':_0xc78e('0x0'),'content':_0xc78e('0xc'),'variableName':null},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0x21'),'keyType':_0xc78e('0x6'),'keyContent':'','variableName':_0xc78e('0xa')},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0x22'),'keyType':_0xc78e('0x6'),'keyContent':'','variableName':_0xc78e('0x23')},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0x24'),'keyType':_0xc78e('0x6'),'keyContent':'','variableName':_0xc78e('0x14')},{'type':_0xc78e('0xd'),'content':'','key':'Date','keyType':_0xc78e('0x6'),'keyContent':'','variableName':_0xc78e('0x25')},{'type':'string','content':_0xc78e('0x1a')},{'type':_0xc78e('0xd'),'content':'','key':'Answer\x20Time','keyType':_0xc78e('0x6'),'keyContent':'','variableName':'answertime'},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0x26'),'keyType':_0xc78e('0x6'),'keyContent':'','variableName':'endtime'},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0x27'),'keyType':_0xc78e('0x6'),'keyContent':'','variableName':_0xc78e('0x28')},{'type':_0xc78e('0xd'),'content':'','key':_0xc78e('0x29'),'keyType':_0xc78e('0x6'),'keyContent':'','variableName':_0xc78e('0x2a')}];break;}}return _0x4ee2fd;};
\ No newline at end of file
index abada24..4f10917 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0812=['name','stringify','Interaction','findOne','update','then','info','catch','error','tracked','query','clone','body','omit','html','phone','fax','mobile','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions','InteractionId','upperFirst','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x121359,_0x35f15b){var _0x5aeb22=function(_0x111ce5){while(--_0x111ce5){_0x121359['push'](_0x121359['shift']());}};_0x5aeb22(++_0x35f15b);}(_0x0812,0xc0));var _0x2081=function(_0x5f3efe,_0x43945b){_0x5f3efe=_0x5f3efe-0x0;var _0x54e4fd=_0x0812[_0x5f3efe];return _0x54e4fd;};'use strict';var _=require('lodash');var db=require(_0x2081('0x0'))['db'];var loggers={'openchannel':require(_0x2081('0x1'))(_0x2081('0x2')),'mail':require(_0x2081('0x1'))(_0x2081('0x3')),'fax':require('../../config/logger')(_0x2081('0x4')),'sms':require(_0x2081('0x1'))(_0x2081('0x5')),'chat':require(_0x2081('0x1'))(_0x2081('0x6')),'whatsapp':require(_0x2081('0x1'))('whatsapp-interactions')};function getInteractionId(_0xd91547,_0x565032,_0x23416c){if(_0xd91547&&_0xd91547[_['upperFirst'](_0x23416c)+_0x2081('0x7')]){return _0xd91547[_[_0x2081('0x8')](_0x23416c)+'InteractionId'];}else if(_0xd91547&&_0xd91547['id']){return _0xd91547['id'];}else if(_0x565032&&_0x565032['id']){return _0x565032['id'];}else{return'unknown';}}function log(_0x5d9869,_0x16048d,_0x716fc1,_0x1d6050,_0x1739c6,_0x290c8e){loggers[_0x1739c6[_0x2081('0x9')]()][_0x5d9869](_0x2081('0xa'),_0x290c8e['toUpperCase'](),_0x16048d?_0x16048d['id']:null,_0x16048d?_0x16048d[_0x2081('0xb')]:null,_0x16048d?_0x16048d['role']:null,getInteractionId(_0x716fc1,_0x1d6050,_0x1739c6),_0x716fc1?JSON[_0x2081('0xc')](_0x716fc1):'null');}function updateUser(_0x239236,_0x4a6dfe,_0x1524be,_0x480255,_0x1ca513){db[_[_0x2081('0x8')](_0x480255)+_0x2081('0xd')][_0x2081('0xe')]({'where':{'id':getInteractionId(_0x4a6dfe,_0x1524be,_0x480255)}})['then'](function(_0x5ae924){if(_0x5ae924){return _0x5ae924[_0x2081('0xf')]({'UserId':_0x239236?_0x239236['id']:null});}})[_0x2081('0x10')](function(_0x2180c4){if(_0x2180c4){log(_0x2081('0x11'),_0x239236,_0x4a6dfe,_0x1524be,_0x480255,_0x1ca513);}})[_0x2081('0x12')](function(){log(_0x2081('0x13'),_0x239236,_0x4a6dfe,_0x1524be,_0x480255,_0x1ca513);});}exports[_0x2081('0x14')]=function(_0x5e1a31,_0x593680){return function(_0x3209d4,_0x6f5c1e,_0x3de36c){var _0xe50f36=_0x3209d4['user'];var _0x1fde3b={};var _0x4ee909=_0x3209d4[_0x2081('0x15')];if(_0x1fde3b){_0x1fde3b=_[_0x2081('0x16')](_0x3209d4[_0x2081('0x17')]);_0x1fde3b=_[_0x2081('0x18')](_0x1fde3b,[_0x2081('0x17'),_0x2081('0x19'),_0x2081('0x1a'),_0x2081('0x1b'),_0x2081('0x1c')]);}updateUser(_0xe50f36,_0x1fde3b,_0x4ee909,_0x5e1a31,_0x593680);_0x3de36c(null);};};
\ No newline at end of file
+var _0x592b=['Interaction','findOne','then','update','info','catch','error','tracked','user','clone','body','omit','fax','mobile','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify'];(function(_0x33654f,_0x1313a8){var _0x1e01b4=function(_0x162879){while(--_0x162879){_0x33654f['push'](_0x33654f['shift']());}};_0x1e01b4(++_0x1313a8);}(_0x592b,0x68));var _0xb592=function(_0xf77fa6,_0x4c9df8){_0xf77fa6=_0xf77fa6-0x0;var _0x5bd317=_0x592b[_0xf77fa6];return _0x5bd317;};'use strict';var _=require(_0xb592('0x0'));var db=require(_0xb592('0x1'))['db'];var loggers={'openchannel':require(_0xb592('0x2'))(_0xb592('0x3')),'mail':require('../../config/logger')(_0xb592('0x4')),'fax':require('../../config/logger')(_0xb592('0x5')),'sms':require('../../config/logger')('sms-interactions'),'chat':require(_0xb592('0x2'))(_0xb592('0x6')),'whatsapp':require('../../config/logger')(_0xb592('0x7'))};function getInteractionId(_0x1af49f,_0x177d71,_0x345879){if(_0x1af49f&&_0x1af49f[_[_0xb592('0x8')](_0x345879)+_0xb592('0x9')]){return _0x1af49f[_['upperFirst'](_0x345879)+_0xb592('0x9')];}else if(_0x1af49f&&_0x1af49f['id']){return _0x1af49f['id'];}else if(_0x177d71&&_0x177d71['id']){return _0x177d71['id'];}else{return _0xb592('0xa');}}function log(_0x1419c0,_0x1c30b7,_0x324726,_0x43e5bc,_0x528629,_0x28e530){loggers[_0x528629[_0xb592('0xb')]()][_0x1419c0](_0xb592('0xc'),_0x28e530['toUpperCase'](),_0x1c30b7?_0x1c30b7['id']:null,_0x1c30b7?_0x1c30b7[_0xb592('0xd')]:null,_0x1c30b7?_0x1c30b7[_0xb592('0xe')]:null,getInteractionId(_0x324726,_0x43e5bc,_0x528629),_0x324726?JSON[_0xb592('0xf')](_0x324726):'null');}function updateUser(_0x2ad7ae,_0x806f6,_0x563fea,_0xf73e61,_0x16440a){db[_[_0xb592('0x8')](_0xf73e61)+_0xb592('0x10')][_0xb592('0x11')]({'where':{'id':getInteractionId(_0x806f6,_0x563fea,_0xf73e61)}})[_0xb592('0x12')](function(_0x25be97){if(_0x25be97){return _0x25be97[_0xb592('0x13')]({'UserId':_0x2ad7ae?_0x2ad7ae['id']:null});}})['then'](function(_0x48c47b){if(_0x48c47b){log(_0xb592('0x14'),_0x2ad7ae,_0x806f6,_0x563fea,_0xf73e61,_0x16440a);}})[_0xb592('0x15')](function(){log(_0xb592('0x16'),_0x2ad7ae,_0x806f6,_0x563fea,_0xf73e61,_0x16440a);});}exports[_0xb592('0x17')]=function(_0x25ac1d,_0x4ebc78){return function(_0x53e3c9,_0x465fb9,_0x5c24f3){var _0x3a54de=_0x53e3c9[_0xb592('0x18')];var _0x55ee4c={};var _0xa9a11b=_0x53e3c9['query'];if(_0x55ee4c){_0x55ee4c=_[_0xb592('0x19')](_0x53e3c9[_0xb592('0x1a')]);_0x55ee4c=_[_0xb592('0x1b')](_0x55ee4c,[_0xb592('0x1a'),'html','phone',_0xb592('0x1c'),_0xb592('0x1d')]);}updateUser(_0x3a54de,_0x55ee4c,_0xa9a11b,_0x25ac1d,_0x4ebc78);_0x5c24f3(null);};};
\ No newline at end of file
index 88fee87..42fa114 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x84aa=['user','isUserLimit','crypto','composable-middleware','../../mysqldb','../../config/environment','split','createDecipher','format','%s:%s:%s','update','utf8','final','parse','hasOwnProperty','use','License','findOne','count','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin'];(function(_0x5e0bda,_0x4c9b6b){var _0x5cc542=function(_0x392a5c){while(--_0x392a5c){_0x5e0bda['push'](_0x5e0bda['shift']());}};_0x5cc542(++_0x4c9b6b);}(_0x84aa,0xbf));var _0xa84a=function(_0x371e53,_0x2483f4){_0x371e53=_0x371e53-0x0;var _0x589756=_0x84aa[_0x371e53];return _0x589756;};'use strict';var crypto=require(_0xa84a('0x0'));var util=require('util');var compose=require(_0xa84a('0x1'));var db=require(_0xa84a('0x2'))['db'];var config=require(_0xa84a('0x3'));function getValueFromLicense(_0x56b7ad,_0x2b7c80){if(_0x56b7ad&&_0x2b7c80){if(_0x2b7c80['data1']&&_0x2b7c80['license']){var _0x32418d=_0x2b7c80['data1'];var _0x2e29a5=_0x2b7c80['license'];var _0x1d4f54=_0x32418d[_0xa84a('0x4')]('-')[0x4];var _0x3e2e8f=_0x32418d[_0xa84a('0x4')]('-')[0x0];var _0xfeba66=crypto[_0xa84a('0x5')]('aes-256-ctr',util[_0xa84a('0x6')](_0xa84a('0x7'),_0x1d4f54,_0x32418d,_0x3e2e8f));var _0x4c927d=_0xfeba66[_0xa84a('0x8')](_0x2e29a5,'base64',_0xa84a('0x9'));_0x4c927d+=_0xfeba66[_0xa84a('0xa')](_0xa84a('0x9'));var _0x40ed56=JSON[_0xa84a('0xb')](_0x4c927d);return _0x40ed56[_0xa84a('0xc')](_0x56b7ad)?_0x40ed56[_0x56b7ad]:null;}}return null;}function isLimit(_0x393832,_0x4934c3,_0x330d52,_0x599cb6){var _0xb3abdc=_0x4934c3;return compose()[_0xa84a('0xd')](function(_0x3a926a,_0x1aa03a,_0x5f0fd9){return db[_0xa84a('0xe')][_0xa84a('0xf')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x35b2c3){var _0x132e47=getValueFromLicense(_0x393832,_0x35b2c3);return _0x132e47?_0x132e47:_0xb3abdc;})['then'](function(_0x4fdc38){_0xb3abdc=_0x4fdc38;return _0x330d52[_0xa84a('0x10')](_0x599cb6);})[_0xa84a('0x11')](function(_0x1763fa){if(_0x1763fa>=_0xb3abdc){return _0x1aa03a[_0xa84a('0x12')](0x193)[_0xa84a('0x13')]({'message':util[_0xa84a('0x6')](_0xa84a('0x14'),_0x393832)});}_0x5f0fd9();})[_0xa84a('0x15')](function(_0x1dca20){_0x5f0fd9(_0x1dca20);});});}function isUserLimit(){return isLimit(_0xa84a('0x16'),0x1,db[_0xa84a('0x17')],{'where':{'$or':[{'role':_0xa84a('0x18')},{'role':_0xa84a('0x19')}]}});}exports[_0xa84a('0x1a')]=isUserLimit;
\ No newline at end of file
+var _0x892e=['License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','user','crypto','composable-middleware','../../mysqldb','data1','license','split','createDecipher','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use'];(function(_0x1649fe,_0x5916da){var _0x473a67=function(_0x163cae){while(--_0x163cae){_0x1649fe['push'](_0x1649fe['shift']());}};_0x473a67(++_0x5916da);}(_0x892e,0x77));var _0xe892=function(_0x5c1c52,_0xeb731a){_0x5c1c52=_0x5c1c52-0x0;var _0xbabe2e=_0x892e[_0x5c1c52];return _0xbabe2e;};'use strict';var crypto=require(_0xe892('0x0'));var util=require('util');var compose=require(_0xe892('0x1'));var db=require(_0xe892('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x33e637,_0x16891b){if(_0x33e637&&_0x16891b){if(_0x16891b[_0xe892('0x3')]&&_0x16891b['license']){var _0x61f10c=_0x16891b[_0xe892('0x3')];var _0x429ca8=_0x16891b[_0xe892('0x4')];var _0x9fd87b=_0x61f10c[_0xe892('0x5')]('-')[0x4];var _0x1b5635=_0x61f10c[_0xe892('0x5')]('-')[0x0];var _0x345a58=crypto[_0xe892('0x6')]('aes-256-ctr',util[_0xe892('0x7')](_0xe892('0x8'),_0x9fd87b,_0x61f10c,_0x1b5635));var _0x51c36f=_0x345a58[_0xe892('0x9')](_0x429ca8,_0xe892('0xa'),_0xe892('0xb'));_0x51c36f+=_0x345a58[_0xe892('0xc')](_0xe892('0xb'));var _0x411e3d=JSON[_0xe892('0xd')](_0x51c36f);return _0x411e3d[_0xe892('0xe')](_0x33e637)?_0x411e3d[_0x33e637]:null;}}return null;}function isLimit(_0x47c084,_0x440e47,_0x56dfe0,_0x380069){var _0x2bb6a9=_0x440e47;return compose()[_0xe892('0xf')](function(_0x3a26b8,_0x3787d7,_0x5a4660){return db[_0xe892('0x10')][_0xe892('0x11')]({'where':{'id':0x1},'raw':!![]})[_0xe892('0x12')](function(_0x4f97e5){var _0x10e080=getValueFromLicense(_0x47c084,_0x4f97e5);return _0x10e080?_0x10e080:_0x2bb6a9;})[_0xe892('0x12')](function(_0x5633a6){_0x2bb6a9=_0x5633a6;return _0x56dfe0[_0xe892('0x13')](_0x380069);})[_0xe892('0x12')](function(_0x31231d){if(_0x31231d>=_0x2bb6a9){return _0x3787d7[_0xe892('0x14')](0x193)[_0xe892('0x15')]({'message':util[_0xe892('0x7')](_0xe892('0x16'),_0x47c084)});}_0x5a4660();})[_0xe892('0x17')](function(_0xf620ac){_0x5a4660(_0xf620ac);});});}function isUserLimit(){return isLimit(_0xe892('0x18'),0x1,db['User'],{'where':{'$or':[{'role':_0xe892('0x19')},{'role':_0xe892('0x1a')}]}});}exports['isUserLimit']=isUserLimit;
\ No newline at end of file
index dea4ef2..390f8e6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc774=['$startsWith','pop','utcOffset','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','[$or]','and','[$and]','split','slice','forEach','match','filter','indexOf','map','conditions','buildExpression','DATE','operator','$between','value','includes','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','field','\x20AS\x20','text','$ne','\x20IS\x20NULL)','IN\x20?','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$substring','$endsWith','LIKE\x20?','<\x20?','>\x20?','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$in','start'];(function(_0x4d4065,_0x552d1e){var _0x475a23=function(_0x520f87){while(--_0x520f87){_0x4d4065['push'](_0x4d4065['shift']());}};_0x475a23(++_0x552d1e);}(_0xc774,0x119));var _0x4c77=function(_0x2283aa,_0x1b36aa){_0x2283aa=_0x2283aa-0x0;var _0x5ad23f=_0xc774[_0x2283aa];return _0x5ad23f;};'use strict';var _=require(_0x4c77('0x0'));var moment=require(_0x4c77('0x1'));exports[_0x4c77('0x2')]=function(_0x5423ab){var _0x566585={'conditions':[]};_0x566585[_0x4c77('0x3')]=_['startsWith'](_0x5423ab,_0x4c77('0x4'))?'or':_0x4c77('0x5');var _0xb116dc=_0x5423ab['replace'](_0x4c77('0x6'),'')['replace'](_0x4c77('0x4'),'')['split']('||');for(var _0x120940=0x0;_0x120940<_0xb116dc['length'];_0x120940++){var _0x381420=_0xb116dc[_0x120940][_0x4c77('0x7')](':=');var _0x44578c=_0x381420[0x0];var _0x36d8de=_0x381420[_0x4c77('0x8')](0x1);_0x36d8de[_0x4c77('0x9')](function(_0x5baa94){var _0x5c29ec=_0x5baa94[_0x4c77('0x7')]('[')['shift']();var _0x57d5a4=_0x5baa94[_0x4c77('0xa')](/\[(.*?)\]/g);_0x57d5a4[_0x4c77('0x9')](function(_0x1a6ba){var _0x37f017=_0x1a6ba[_0x4c77('0x7')]('[')[_0x4c77('0xb')](function(_0xd95b45){return _0xd95b45[_0x4c77('0xc')](']')>-0x1;})[_0x4c77('0xd')](function(_0x3f16e3){return _0x3f16e3['split'](']')[0x0];})[0x0];_0x566585[_0x4c77('0xe')]['push']({'field':_0x44578c,'operator':_0x5c29ec,'value':_0x37f017});});});}return _0x566585;};exports[_0x4c77('0xf')]=function(_0x538d07,_0xc30ec,_0x205ba1){var _0x4ac510={};if(_0xc30ec===_0x4c77('0x10')){if(_0x205ba1['operator']==='$eq'){_0x205ba1[_0x4c77('0x11')]=_0x4c77('0x12');_0x205ba1[_0x4c77('0x13')]+=','+_0x205ba1['value'];}else if(_[_0x4c77('0x14')]([_0x4c77('0x15'),_0x4c77('0x16')],_0x205ba1[_0x4c77('0x11')])){_0x205ba1['value']=moment(_0x205ba1[_0x4c77('0x13')])[_0x4c77('0x17')](0x1,_0x4c77('0x18'))[_0x4c77('0x19')](_0x4c77('0x1a'));}}if(_0x205ba1[_0x4c77('0x1b')]){_0xc30ec=_0x205ba1[_0x4c77('0x1b')];_0x4ac510['text']='CAST('+_0x538d07+'.'+_0x205ba1[_0x4c77('0x1c')]+_0x4c77('0x1d')+_0x205ba1[_0x4c77('0x1b')]+')\x20'+parseOperator(_0x205ba1[_0x4c77('0x11')]);}else{_0x4ac510[_0x4c77('0x1e')]=_0x538d07+'.'+_0x205ba1['field']+'\x20'+parseOperator(_0x205ba1[_0x4c77('0x11')]);}if(_['includes']([_0x4c77('0x1f'),'$notIn'],_0x205ba1[_0x4c77('0x11')]))_0x4ac510[_0x4c77('0x1e')]='('+_0x4ac510[_0x4c77('0x1e')]+'\x20OR\x20'+_0x538d07+'.'+_0x205ba1[_0x4c77('0x1c')]+_0x4c77('0x20');_0x4ac510[_0x4c77('0x13')]=parseValue(_0xc30ec,_0x205ba1[_0x4c77('0x11')],_0x205ba1['value']);return _0x4ac510;};function parseOperator(_0x3dafdd){var _0x5fd622;switch(_0x3dafdd){case'$in':_0x5fd622=_0x4c77('0x21');break;case'$notIn':_0x5fd622=_0x4c77('0x22');break;case _0x4c77('0x23'):_0x5fd622=_0x4c77('0x24');break;case _0x4c77('0x1f'):_0x5fd622=_0x4c77('0x25');break;case _0x4c77('0x26'):case'$startsWith':case _0x4c77('0x27'):_0x5fd622=_0x4c77('0x28');break;case'$lt':_0x5fd622=_0x4c77('0x29');break;case _0x4c77('0x15'):_0x5fd622=_0x4c77('0x2a');break;case _0x4c77('0x16'):_0x5fd622=_0x4c77('0x2b');break;case _0x4c77('0x2c'):_0x5fd622=_0x4c77('0x2d');break;case _0x4c77('0x12'):_0x5fd622=_0x4c77('0x2e');break;}return _0x5fd622;}function parseValue(_0x22f192,_0x52d55a,_0x39850f){var _0x38ab0b={'start':undefined,'end':undefined};switch(_0x52d55a){case _0x4c77('0x2f'):case'$notIn':_0x38ab0b[_0x4c77('0x30')]=_0x39850f['split'](',');break;case _0x4c77('0x26'):_0x38ab0b[_0x4c77('0x30')]='%'+_0x39850f+'%';break;case _0x4c77('0x31'):_0x38ab0b[_0x4c77('0x30')]=_0x39850f+'%';break;case _0x4c77('0x27'):_0x38ab0b['start']='%'+_0x39850f;break;case _0x4c77('0x12'):var _0x3a3cfb=_0x39850f['split'](',');var _0x39850f=_0x3a3cfb['shift']();var _0x3c6d22=_0x3a3cfb[_0x4c77('0x32')]();if(_0x22f192===_0x4c77('0x10')){_0x39850f=moment(_0x39850f)[_0x4c77('0x33')](0x0,!![])[_0x4c77('0x19')]();_0x3c6d22=moment(_0x3c6d22)[_0x4c77('0x33')](0x0,!![])['add'](0x17,_0x4c77('0x34'))[_0x4c77('0x17')](0x3b,_0x4c77('0x35'))[_0x4c77('0x17')](0x3b,_0x4c77('0x36'))[_0x4c77('0x19')]();}_0x38ab0b={'start':_0x39850f,'end':_0x3c6d22};break;default:_0x38ab0b[_0x4c77('0x30')]=_0x39850f;break;}return _0x38ab0b;}
\ No newline at end of file
+var _0x9f1c=['LIKE\x20?','$lt','$gt','<=\x20?','$gte','$between','BETWEEN\x20?\x20AND\x20?','start','pop','hours','minutes','lodash','moment','startsWith','[$or]','and','[$and]','replace','split','slice','forEach','shift','filter','map','conditions','push','buildExpression','$eq','operator','value','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','includes','$ne','$notIn','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','<>\x20?','$substring','$startsWith','$endsWith'];(function(_0x3f7fe1,_0x4d1af1){var _0x42181f=function(_0x3dbc0e){while(--_0x3dbc0e){_0x3f7fe1['push'](_0x3f7fe1['shift']());}};_0x42181f(++_0x4d1af1);}(_0x9f1c,0xd3));var _0xc9f1=function(_0x3dae48,_0x45777e){_0x3dae48=_0x3dae48-0x0;var _0xff2a19=_0x9f1c[_0x3dae48];return _0xff2a19;};'use strict';var _=require(_0xc9f1('0x0'));var moment=require(_0xc9f1('0x1'));exports['parseSearch']=function(_0x122151){var _0x3bd020={'conditions':[]};_0x3bd020['sqlOperator']=_[_0xc9f1('0x2')](_0x122151,_0xc9f1('0x3'))?'or':_0xc9f1('0x4');var _0xb32797=_0x122151['replace'](_0xc9f1('0x5'),'')[_0xc9f1('0x6')](_0xc9f1('0x3'),'')[_0xc9f1('0x7')]('||');for(var _0x4202ad=0x0;_0x4202ad<_0xb32797['length'];_0x4202ad++){var _0x39b130=_0xb32797[_0x4202ad][_0xc9f1('0x7')](':=');var _0x1ef9a4=_0x39b130[0x0];var _0x48e6de=_0x39b130[_0xc9f1('0x8')](0x1);_0x48e6de[_0xc9f1('0x9')](function(_0x183d8b){var _0x2cf80f=_0x183d8b[_0xc9f1('0x7')]('[')[_0xc9f1('0xa')]();var _0x2f397d=_0x183d8b['match'](/\[(.*?)\]/g);_0x2f397d[_0xc9f1('0x9')](function(_0x3e3543){var _0x2d2155=_0x3e3543[_0xc9f1('0x7')]('[')[_0xc9f1('0xb')](function(_0x4d1f00){return _0x4d1f00['indexOf'](']')>-0x1;})[_0xc9f1('0xc')](function(_0x16743c){return _0x16743c[_0xc9f1('0x7')](']')[0x0];})[0x0];_0x3bd020[_0xc9f1('0xd')][_0xc9f1('0xe')]({'field':_0x1ef9a4,'operator':_0x2cf80f,'value':_0x2d2155});});});}return _0x3bd020;};exports[_0xc9f1('0xf')]=function(_0x25bc85,_0x28721e,_0x54ea8c){var _0x12382c={};if(_0x28721e==='DATE'){if(_0x54ea8c['operator']===_0xc9f1('0x10')){_0x54ea8c[_0xc9f1('0x11')]='$between';_0x54ea8c['value']+=','+_0x54ea8c[_0xc9f1('0x12')];}else if(_['includes'](['$gt',_0xc9f1('0x13')],_0x54ea8c[_0xc9f1('0x11')])){_0x54ea8c[_0xc9f1('0x12')]=moment(_0x54ea8c[_0xc9f1('0x12')])[_0xc9f1('0x14')](0x1,_0xc9f1('0x15'))[_0xc9f1('0x16')](_0xc9f1('0x17'));}}if(_0x54ea8c[_0xc9f1('0x18')]){_0x28721e=_0x54ea8c[_0xc9f1('0x18')];_0x12382c[_0xc9f1('0x19')]=_0xc9f1('0x1a')+_0x25bc85+'.'+_0x54ea8c[_0xc9f1('0x1b')]+'\x20AS\x20'+_0x54ea8c['castTo']+')\x20'+parseOperator(_0x54ea8c[_0xc9f1('0x11')]);}else{_0x12382c[_0xc9f1('0x19')]=_0x25bc85+'.'+_0x54ea8c[_0xc9f1('0x1b')]+'\x20'+parseOperator(_0x54ea8c[_0xc9f1('0x11')]);}if(_[_0xc9f1('0x1c')]([_0xc9f1('0x1d'),_0xc9f1('0x1e')],_0x54ea8c[_0xc9f1('0x11')]))_0x12382c[_0xc9f1('0x19')]='('+_0x12382c['text']+'\x20OR\x20'+_0x25bc85+'.'+_0x54ea8c[_0xc9f1('0x1b')]+_0xc9f1('0x1f');_0x12382c[_0xc9f1('0x12')]=parseValue(_0x28721e,_0x54ea8c['operator'],_0x54ea8c[_0xc9f1('0x12')]);return _0x12382c;};function parseOperator(_0x3ef89a){var _0x26f754;switch(_0x3ef89a){case _0xc9f1('0x20'):_0x26f754=_0xc9f1('0x21');break;case _0xc9f1('0x1e'):_0x26f754=_0xc9f1('0x22');break;case _0xc9f1('0x10'):_0x26f754='=\x20?';break;case _0xc9f1('0x1d'):_0x26f754=_0xc9f1('0x23');break;case _0xc9f1('0x24'):case _0xc9f1('0x25'):case _0xc9f1('0x26'):_0x26f754=_0xc9f1('0x27');break;case _0xc9f1('0x28'):_0x26f754='<\x20?';break;case _0xc9f1('0x29'):_0x26f754='>\x20?';break;case'$lte':_0x26f754=_0xc9f1('0x2a');break;case _0xc9f1('0x2b'):_0x26f754='>=\x20?';break;case _0xc9f1('0x2c'):_0x26f754=_0xc9f1('0x2d');break;}return _0x26f754;}function parseValue(_0x34dc97,_0x578c18,_0x408fd5){var _0x45bf42={'start':undefined,'end':undefined};switch(_0x578c18){case _0xc9f1('0x20'):case'$notIn':_0x45bf42[_0xc9f1('0x2e')]=_0x408fd5[_0xc9f1('0x7')](',');break;case'$substring':_0x45bf42['start']='%'+_0x408fd5+'%';break;case _0xc9f1('0x25'):_0x45bf42[_0xc9f1('0x2e')]=_0x408fd5+'%';break;case _0xc9f1('0x26'):_0x45bf42[_0xc9f1('0x2e')]='%'+_0x408fd5;break;case'$between':var _0x543268=_0x408fd5[_0xc9f1('0x7')](',');var _0x408fd5=_0x543268[_0xc9f1('0xa')]();var _0xb02d21=_0x543268[_0xc9f1('0x2f')]();if(_0x34dc97==='DATE'){_0x408fd5=moment(_0x408fd5)['utcOffset'](0x0,!![])[_0xc9f1('0x16')]();_0xb02d21=moment(_0xb02d21)['utcOffset'](0x0,!![])['add'](0x17,_0xc9f1('0x30'))['add'](0x3b,_0xc9f1('0x31'))[_0xc9f1('0x14')](0x3b,'seconds')[_0xc9f1('0x16')]();}_0x45bf42={'start':_0x408fd5,'end':_0xb02d21};break;default:_0x45bf42[_0xc9f1('0x2e')]=_0x408fd5;break;}return _0x45bf42;}
\ No newline at end of file
index a457c29..386d47a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1f76=['getFullTextValue','replace','push','join','getOptions','query','$id','model','name','attributes','intersection','nolimit','order','where','pick','filter','merge','VIRTUAL','lower','sequelize','moment','parse','keys','includes','fields','filters','isEmpty','forOwn','type','DATE','isPlainObject','$gte','YYYY-MM-DD','utc','format','subtract','uniqueid','isArray','split','limit','offset','sort','map','indexOf','cast','col','priority','unsigned','substr','DESC','ASC','length','omit','isString','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail'];(function(_0x97cc12,_0x54d583){var _0x5a25d7=function(_0x46add6){while(--_0x46add6){_0x97cc12['push'](_0x97cc12['shift']());}};_0x5a25d7(++_0x54d583);}(_0x1f76,0x17b));var _0x61f7=function(_0x26ef33,_0x143c9c){_0x26ef33=_0x26ef33-0x0;var _0x1c654e=_0x1f76[_0x26ef33];return _0x1c654e;};'use strict';var _=require('lodash');var sequelize=require(_0x61f7('0x0'));var moment=require(_0x61f7('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0xc9f103){var _0x590b79=['ne'];try{var _0x38eb34=JSON[_0x61f7('0x2')](_0xc9f103);var _0x3d1c05=Object[_0x61f7('0x3')](_0x38eb34)[0x0];return _0x590b79[_0x61f7('0x4')](_0x3d1c05);}catch(_0xe8ff81){return![];}}function getOperatorValue(_0x5e7495){var _0x24bd5a=JSON['parse'](_0x5e7495);var _0x13432=Object[_0x61f7('0x3')](_0x24bd5a)[0x0];var _0x15cd2c=_0x24bd5a[_0x13432];return{['$'+_0x13432]:_0x15cd2c};}exports[_0x61f7('0x5')]=function(_0x1b0d46){var _0x10e56b=null;if(_0x1b0d46){_0x10e56b=_0x1b0d46['split'](',');}return _0x10e56b;};exports[_0x61f7('0x6')]=function(_0x311a14,_0x13a002){var _0x268d44={};if(!_[_0x61f7('0x7')](_0x311a14)){_[_0x61f7('0x8')](_0x311a14,function(_0x14887d,_0x12e07c){try{if(_0x13a002){var _0x49c683=_['find'](_0x13a002,{'name':_0x12e07c})||{};if(hasSequelizeOperator(_0x14887d)){_0x268d44[_0x12e07c]=getOperatorValue(_0x14887d);}else if(_0x49c683[_0x61f7('0x9')]===_0x61f7('0xa')&&_[_0x61f7('0xb')](_0x14887d)){var _0x116fe8=JSON[_0x61f7('0x2')](_0x14887d);var _0x12ff85={'$gte':moment(moment(_0x116fe8[_0x61f7('0xc')])['format'](_0x61f7('0xd')))[_0x61f7('0xe')]()[_0x61f7('0xf')](),'$lte':moment(moment(_0x116fe8['$lte'])[_0x61f7('0xf')](_0x61f7('0xd')))[_0x61f7('0xe')]()[_0x61f7('0x10')](0x1,'s')[_0x61f7('0xf')]()};_0x268d44[_0x12e07c]=_0x12ff85;}else if(_0x49c683['name']===_0x61f7('0x11')){_0x268d44[_0x12e07c]=_0x14887d;}else{_0x268d44[_0x12e07c]=_[_0x61f7('0x12')](_0x14887d)?_0x14887d:JSON[_0x61f7('0x2')](_0x14887d);}}else{_0x268d44[_0x12e07c]=_['isArray'](_0x14887d)?_0x14887d:JSON['parse'](_0x14887d);}}catch(_0x5a6304){_0x268d44[_0x12e07c]=_0x14887d[_0x61f7('0x13')](',');}});}return _0x268d44;};exports[_0x61f7('0x14')]=function(_0x1c023f){_0x1c023f=parseInt(_0x1c023f,0xa);if(!_0x1c023f||_0x1c023f<0x0){_0x1c023f=LIMIT_VALUE;}return _0x1c023f;};exports[_0x61f7('0x15')]=function(_0x3da276){_0x3da276=parseInt(_0x3da276,0xa);if(!_0x3da276||_0x3da276<0x0){_0x3da276=0x0;}return _0x3da276;};exports[_0x61f7('0x16')]=function(_0x4534d7){var _0x211bc1,_0x5d7ff9=null;if(_0x4534d7){_0x211bc1=_0x4534d7[_0x61f7('0x13')](',');_0x5d7ff9=_[_0x61f7('0x17')](_0x211bc1,function(_0x43bd26){if(_0x43bd26[_0x61f7('0x18')]('-')===0x0){return[_0x43bd26==='priority'?sequelize[_0x61f7('0x19')](sequelize[_0x61f7('0x1a')](_0x61f7('0x1b')),_0x61f7('0x1c')):_0x43bd26[_0x61f7('0x1d')](0x1),_0x61f7('0x1e')];}else{return[_0x43bd26===_0x61f7('0x1b')?sequelize[_0x61f7('0x19')](sequelize['col'](_0x61f7('0x1b')),_0x61f7('0x1c')):_0x43bd26,_0x61f7('0x1f')];}});}return _0x5d7ff9;};exports['omit']=function(_0x575caa,_0x350237){if(_['isEmpty'](_0x575caa)){return _0x575caa;}if(_[_0x61f7('0x12')](_0x575caa)){for(var _0x1cd0fd=0x0;_0x1cd0fd<_0x575caa[_0x61f7('0x20')];_0x1cd0fd+=0x1){_0x575caa[_0x1cd0fd]=this[_0x61f7('0x21')](_0x575caa[_0x1cd0fd],_0x350237);}return _0x575caa;}if(!_['isObject'](_0x575caa)){return _0x575caa;}if(_[_0x61f7('0x22')](_0x350237)){_0x350237=[_0x350237];}if(!_[_0x61f7('0x12')](_0x350237)){return _0x575caa;}for(var _0x314b7b=0x0;_0x314b7b<_0x350237[_0x61f7('0x20')];_0x314b7b+=0x1){_[_0x61f7('0x23')](_0x575caa,_0x350237[_0x314b7b]);}for(var _0x47941e in _0x575caa){if(_0x575caa[_0x61f7('0x24')](_0x47941e)){_0x575caa[_0x47941e]=this[_0x61f7('0x21')](_0x575caa[_0x47941e],_0x350237);}}return _0x575caa;};exports[_0x61f7('0x25')]=function(_0xa38f85){return _0xa38f85[_0x61f7('0x26')](RegExp(_0x61f7('0x27')))?!![]:![];};exports[_0x61f7('0x28')]=function(_0x28e022){return _0x28e022[_0x61f7('0x26')](/^\S+@\S+$/)?!![]:![];};exports[_0x61f7('0x29')]=function(_0x201459){var _0x5d2d23=[];_0x201459['split'](/[ ,]+/)['forEach'](function(_0x45cb80){_0x45cb80=_0x45cb80[_0x61f7('0x2a')](/([^:]")"+/g,'$1');_0x45cb80='+'+_0x45cb80+'*';if(_0x45cb80[_0x61f7('0x4')]('@'))_0x45cb80='\x22'+_0x45cb80+'\x22';_0x5d2d23[_0x61f7('0x2b')](_0x45cb80);});return _0x5d2d23[_0x61f7('0x2c')]('\x20');};exports[_0x61f7('0x2d')]=function(_0xa940b9,_0x3ba3d3,_0x12a0d1){var _0x5d78f5={},_0x145fea={};if(_0x3ba3d3[_0x61f7('0x2e')][_0x61f7('0x2f')]){_0x3ba3d3['query']['id']=_0x3ba3d3[_0x61f7('0x2e')][_0x61f7('0x2f')];delete _0x3ba3d3['query'][_0x61f7('0x2f')];}_0x5d78f5[_0x61f7('0x30')]=_['map'](_0xa940b9,_0x61f7('0x31'));_0x5d78f5[_0x61f7('0x2e')]=_[_0x61f7('0x3')](_0x3ba3d3['query']);_0x5d78f5[_0x61f7('0x6')]=_['intersection'](_0x5d78f5[_0x61f7('0x30')],_0x5d78f5[_0x61f7('0x2e')]);_0x145fea[_0x61f7('0x32')]=_[_0x61f7('0x33')](_0x5d78f5['model'],this[_0x61f7('0x5')](_0x3ba3d3[_0x61f7('0x2e')][_0x61f7('0x5')]));_0x145fea[_0x61f7('0x32')]=_0x145fea['attributes'][_0x61f7('0x20')]?_0x145fea['attributes']:_0x5d78f5[_0x61f7('0x30')];if(!_0x3ba3d3[_0x61f7('0x2e')][_0x61f7('0x24')](_0x61f7('0x34'))){_0x145fea['limit']=this[_0x61f7('0x14')](_0x3ba3d3[_0x61f7('0x2e')][_0x61f7('0x14')]);_0x145fea[_0x61f7('0x15')]=this[_0x61f7('0x15')](_0x3ba3d3[_0x61f7('0x2e')][_0x61f7('0x15')]);}_0x145fea[_0x61f7('0x35')]=this[_0x61f7('0x16')](_0x3ba3d3['query']['sort']);_0x145fea[_0x61f7('0x36')]=this['filters'](_[_0x61f7('0x37')](_0x3ba3d3[_0x61f7('0x2e')],_0x5d78f5[_0x61f7('0x6')]),_0xa940b9);if(_0x3ba3d3[_0x61f7('0x2e')][_0x61f7('0x38')]){_0x145fea[_0x61f7('0x36')]=_[_0x61f7('0x39')](_0x145fea[_0x61f7('0x36')],{'$or':_['map'](_0xa940b9,function(_0x1c6ab7){if(_0x1c6ab7['type']!==_0x61f7('0x3a')){if(_0x12a0d1){return sequelize[_0x61f7('0x36')](sequelize['fn'](_0x61f7('0x3b'),sequelize['col'](_0x1c6ab7[_0x61f7('0x31')])),{'$like':sequelize['fn'](_0x61f7('0x3b'),'%'+_0x3ba3d3['query'][_0x61f7('0x38')]+'%')});}else{var _0x1ee8af={};_0x1ee8af[_0x1c6ab7[_0x61f7('0x31')]]={'$like':'%'+_0x3ba3d3[_0x61f7('0x2e')][_0x61f7('0x38')]+'%'};return _0x1ee8af;}}})});}_0x145fea=_[_0x61f7('0x39')]({},_0x145fea,_0x3ba3d3['options']);return _0x145fea;};
\ No newline at end of file
+var _0x8cad=['^[+]?[0-9]*$','match','getFullTextValue','replace','query','$id','model','name','intersection','attributes','hasOwnProperty','offset','order','pick','where','VIRTUAL','lower','filter','merge','options','lodash','sequelize','moment','parse','includes','keys','fields','split','filters','isEmpty','forOwn','find','type','isPlainObject','$gte','YYYY-MM-DD','$lte','utc','uniqueid','limit','sort','map','indexOf','priority','col','substr','DESC','cast','unsigned','ASC','omit','isArray','length','isObject','isString','unset','isNumeric'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x8cad,0x1a3));var _0xd8ca=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x8cad[_0x1589dd];return _0x1bddd1;};'use strict';var _=require(_0xd8ca('0x0'));var sequelize=require(_0xd8ca('0x1'));var moment=require(_0xd8ca('0x2'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x18acb8){var _0x2aeccf=['ne'];try{var _0x58790f=JSON[_0xd8ca('0x3')](_0x18acb8);var _0x318a2e=Object['keys'](_0x58790f)[0x0];return _0x2aeccf[_0xd8ca('0x4')](_0x318a2e);}catch(_0x2c0ec3){return![];}}function getOperatorValue(_0x52129e){var _0x557406=JSON[_0xd8ca('0x3')](_0x52129e);var _0x19cbff=Object[_0xd8ca('0x5')](_0x557406)[0x0];var _0x37c273=_0x557406[_0x19cbff];return{['$'+_0x19cbff]:_0x37c273};}exports[_0xd8ca('0x6')]=function(_0x58ab03){var _0x3d47b0=null;if(_0x58ab03){_0x3d47b0=_0x58ab03[_0xd8ca('0x7')](',');}return _0x3d47b0;};exports[_0xd8ca('0x8')]=function(_0x470fa5,_0x121d9b){var _0x2f87b5={};if(!_[_0xd8ca('0x9')](_0x470fa5)){_[_0xd8ca('0xa')](_0x470fa5,function(_0x4cd1b4,_0x1afd68){try{if(_0x121d9b){var _0x262a30=_[_0xd8ca('0xb')](_0x121d9b,{'name':_0x1afd68})||{};if(hasSequelizeOperator(_0x4cd1b4)){_0x2f87b5[_0x1afd68]=getOperatorValue(_0x4cd1b4);}else if(_0x262a30[_0xd8ca('0xc')]==='DATE'&&_[_0xd8ca('0xd')](_0x4cd1b4)){var _0x3a5501=JSON[_0xd8ca('0x3')](_0x4cd1b4);var _0x533766={'$gte':moment(moment(_0x3a5501[_0xd8ca('0xe')])['format'](_0xd8ca('0xf')))['utc']()['format'](),'$lte':moment(moment(_0x3a5501[_0xd8ca('0x10')])['format']('YYYY-MM-DD'))[_0xd8ca('0x11')]()['subtract'](0x1,'s')['format']()};_0x2f87b5[_0x1afd68]=_0x533766;}else if(_0x262a30['name']===_0xd8ca('0x12')){_0x2f87b5[_0x1afd68]=_0x4cd1b4;}else{_0x2f87b5[_0x1afd68]=_['isArray'](_0x4cd1b4)?_0x4cd1b4:JSON[_0xd8ca('0x3')](_0x4cd1b4);}}else{_0x2f87b5[_0x1afd68]=_['isArray'](_0x4cd1b4)?_0x4cd1b4:JSON[_0xd8ca('0x3')](_0x4cd1b4);}}catch(_0x362227){_0x2f87b5[_0x1afd68]=_0x4cd1b4['split'](',');}});}return _0x2f87b5;};exports[_0xd8ca('0x13')]=function(_0x249bd4){_0x249bd4=parseInt(_0x249bd4,0xa);if(!_0x249bd4||_0x249bd4<0x0){_0x249bd4=LIMIT_VALUE;}return _0x249bd4;};exports['offset']=function(_0x1a3472){_0x1a3472=parseInt(_0x1a3472,0xa);if(!_0x1a3472||_0x1a3472<0x0){_0x1a3472=0x0;}return _0x1a3472;};exports[_0xd8ca('0x14')]=function(_0x27391b){var _0x4513a4,_0xfe0f0d=null;if(_0x27391b){_0x4513a4=_0x27391b['split'](',');_0xfe0f0d=_[_0xd8ca('0x15')](_0x4513a4,function(_0x48d2dc){if(_0x48d2dc[_0xd8ca('0x16')]('-')===0x0){return[_0x48d2dc===_0xd8ca('0x17')?sequelize['cast'](sequelize[_0xd8ca('0x18')](_0xd8ca('0x17')),'unsigned'):_0x48d2dc[_0xd8ca('0x19')](0x1),_0xd8ca('0x1a')];}else{return[_0x48d2dc===_0xd8ca('0x17')?sequelize[_0xd8ca('0x1b')](sequelize[_0xd8ca('0x18')](_0xd8ca('0x17')),_0xd8ca('0x1c')):_0x48d2dc,_0xd8ca('0x1d')];}});}return _0xfe0f0d;};exports[_0xd8ca('0x1e')]=function(_0x37644a,_0x41c077){if(_[_0xd8ca('0x9')](_0x37644a)){return _0x37644a;}if(_[_0xd8ca('0x1f')](_0x37644a)){for(var _0x31006e=0x0;_0x31006e<_0x37644a[_0xd8ca('0x20')];_0x31006e+=0x1){_0x37644a[_0x31006e]=this[_0xd8ca('0x1e')](_0x37644a[_0x31006e],_0x41c077);}return _0x37644a;}if(!_[_0xd8ca('0x21')](_0x37644a)){return _0x37644a;}if(_[_0xd8ca('0x22')](_0x41c077)){_0x41c077=[_0x41c077];}if(!_[_0xd8ca('0x1f')](_0x41c077)){return _0x37644a;}for(var _0x351a54=0x0;_0x351a54<_0x41c077[_0xd8ca('0x20')];_0x351a54+=0x1){_[_0xd8ca('0x23')](_0x37644a,_0x41c077[_0x351a54]);}for(var _0x3a4cff in _0x37644a){if(_0x37644a['hasOwnProperty'](_0x3a4cff)){_0x37644a[_0x3a4cff]=this['omit'](_0x37644a[_0x3a4cff],_0x41c077);}}return _0x37644a;};exports[_0xd8ca('0x24')]=function(_0x505c15){return _0x505c15['match'](RegExp(_0xd8ca('0x25')))?!![]:![];};exports['isEmail']=function(_0x337f5d){return _0x337f5d[_0xd8ca('0x26')](/^\S+@\S+$/)?!![]:![];};exports[_0xd8ca('0x27')]=function(_0x41fc3a){var _0x388899=[];_0x41fc3a['split'](/[ ,]+/)['forEach'](function(_0x27f595){_0x27f595=_0x27f595[_0xd8ca('0x28')](/([^:]")"+/g,'$1');_0x27f595='+'+_0x27f595+'*';if(_0x27f595['includes']('@'))_0x27f595='\x22'+_0x27f595+'\x22';_0x388899['push'](_0x27f595);});return _0x388899['join']('\x20');};exports['getOptions']=function(_0x54d5ab,_0x2c684c,_0x4262f8){var _0xc2ccc2={},_0x288e2e={};if(_0x2c684c[_0xd8ca('0x29')][_0xd8ca('0x2a')]){_0x2c684c[_0xd8ca('0x29')]['id']=_0x2c684c['query']['$id'];delete _0x2c684c[_0xd8ca('0x29')]['$id'];}_0xc2ccc2[_0xd8ca('0x2b')]=_[_0xd8ca('0x15')](_0x54d5ab,_0xd8ca('0x2c'));_0xc2ccc2[_0xd8ca('0x29')]=_['keys'](_0x2c684c[_0xd8ca('0x29')]);_0xc2ccc2[_0xd8ca('0x8')]=_[_0xd8ca('0x2d')](_0xc2ccc2[_0xd8ca('0x2b')],_0xc2ccc2[_0xd8ca('0x29')]);_0x288e2e[_0xd8ca('0x2e')]=_[_0xd8ca('0x2d')](_0xc2ccc2['model'],this[_0xd8ca('0x6')](_0x2c684c[_0xd8ca('0x29')][_0xd8ca('0x6')]));_0x288e2e[_0xd8ca('0x2e')]=_0x288e2e['attributes'][_0xd8ca('0x20')]?_0x288e2e['attributes']:_0xc2ccc2[_0xd8ca('0x2b')];if(!_0x2c684c['query'][_0xd8ca('0x2f')]('nolimit')){_0x288e2e['limit']=this[_0xd8ca('0x13')](_0x2c684c['query'][_0xd8ca('0x13')]);_0x288e2e[_0xd8ca('0x30')]=this['offset'](_0x2c684c[_0xd8ca('0x29')][_0xd8ca('0x30')]);}_0x288e2e[_0xd8ca('0x31')]=this[_0xd8ca('0x14')](_0x2c684c['query'][_0xd8ca('0x14')]);_0x288e2e['where']=this[_0xd8ca('0x8')](_[_0xd8ca('0x32')](_0x2c684c[_0xd8ca('0x29')],_0xc2ccc2['filters']),_0x54d5ab);if(_0x2c684c['query']['filter']){_0x288e2e[_0xd8ca('0x33')]=_['merge'](_0x288e2e['where'],{'$or':_[_0xd8ca('0x15')](_0x54d5ab,function(_0x445266){if(_0x445266[_0xd8ca('0xc')]!==_0xd8ca('0x34')){if(_0x4262f8){return sequelize[_0xd8ca('0x33')](sequelize['fn']('lower',sequelize[_0xd8ca('0x18')](_0x445266[_0xd8ca('0x2c')])),{'$like':sequelize['fn'](_0xd8ca('0x35'),'%'+_0x2c684c[_0xd8ca('0x29')][_0xd8ca('0x36')]+'%')});}else{var _0x4c3bf7={};_0x4c3bf7[_0x445266[_0xd8ca('0x2c')]]={'$like':'%'+_0x2c684c[_0xd8ca('0x29')][_0xd8ca('0x36')]+'%'};return _0x4c3bf7;}}})});}_0x288e2e=_[_0xd8ca('0x37')]({},_0x288e2e,_0x2c684c[_0xd8ca('0x38')]);return _0x288e2e;};
\ No newline at end of file
index 7be923d..1af1b6f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x499d=['development','test','appPath','use','json\x20replacer','toISOString','static','views','html','renderFile','view\x20engine','50mb','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','path','passport','cors','moment','../mysqldb','get','env','production','set','join','root','public'];(function(_0x29ce14,_0x334166){var _0x48f289=function(_0x288d11){while(--_0x288d11){_0x29ce14['push'](_0x29ce14['shift']());}};_0x48f289(++_0x334166);}(_0x499d,0x1ec));var _0xd499=function(_0x1cc5b2,_0x5837e7){_0x1cc5b2=_0x1cc5b2-0x0;var _0x4cbbbd=_0x499d[_0x1cc5b2];return _0x4cbbbd;};'use strict';var express=require(_0xd499('0x0'));var favicon=require(_0xd499('0x1'));var bodyParser=require(_0xd499('0x2'));var methodOverride=require(_0xd499('0x3'));var cookieParser=require(_0xd499('0x4'));var errorHandler=require(_0xd499('0x5'));var path=require(_0xd499('0x6'));var passport=require(_0xd499('0x7'));var cors=require(_0xd499('0x8'));var moment=require(_0xd499('0x9'));var config=require('./environment');var db=require(_0xd499('0xa'))['db'];exports['default']=function(_0x58b0f0){var _0x8870d2=_0x58b0f0[_0xd499('0xb')](_0xd499('0xc'));if(_0x8870d2===_0xd499('0xd')){_0x58b0f0[_0xd499('0xe')]('appPath',path[_0xd499('0xf')](config[_0xd499('0x10')],_0xd499('0x11')));}if(_0x8870d2===_0xd499('0x12')||_0x8870d2===_0xd499('0x13')){_0x58b0f0[_0xd499('0xe')](_0xd499('0x14'),path[_0xd499('0xf')](config[_0xd499('0x10')],'client'));_0x58b0f0[_0xd499('0x15')](errorHandler());}_0x58b0f0[_0xd499('0xe')](_0xd499('0x16'),function(_0x544ed9,_0x13588c){if(this[_0x544ed9]instanceof Date){_0x13588c=this[_0x544ed9][_0xd499('0x17')]()['split']('.')[0x0]+'Z';}return _0x13588c;});_0x58b0f0[_0xd499('0x15')](express[_0xd499('0x18')](_0x58b0f0[_0xd499('0xb')](_0xd499('0x14'))));_0x58b0f0[_0xd499('0xe')](_0xd499('0x19'),config['root']+'/server/views');_0x58b0f0['engine'](_0xd499('0x1a'),require('ejs')[_0xd499('0x1b')]);_0x58b0f0[_0xd499('0xe')](_0xd499('0x1c'),_0xd499('0x1a'));_0x58b0f0[_0xd499('0x15')](bodyParser['urlencoded']({'limit':_0xd499('0x1d'),'extended':!![]}));_0x58b0f0[_0xd499('0x15')](bodyParser['json']({'limit':_0xd499('0x1d')}));_0x58b0f0['use'](cors());_0x58b0f0[_0xd499('0x15')](methodOverride());_0x58b0f0[_0xd499('0x15')](cookieParser());_0x58b0f0[_0xd499('0x15')](passport['initialize']());};
\ No newline at end of file
+var _0x2a09=['initialize','express','serve-favicon','method-override','errorhandler','passport','moment','./environment','get','env','production','appPath','root','public','development','test','set','join','client','json\x20replacer','toISOString','split','use','static','views','engine','ejs','renderFile','html','urlencoded','50mb','json'];(function(_0x5eed8c,_0x4cc31a){var _0x2fec4e=function(_0x523aed){while(--_0x523aed){_0x5eed8c['push'](_0x5eed8c['shift']());}};_0x2fec4e(++_0x4cc31a);}(_0x2a09,0x1c1));var _0x92a0=function(_0x327405,_0x45a14f){_0x327405=_0x327405-0x0;var _0x32beec=_0x2a09[_0x327405];return _0x32beec;};'use strict';var express=require(_0x92a0('0x0'));var favicon=require(_0x92a0('0x1'));var bodyParser=require('body-parser');var methodOverride=require(_0x92a0('0x2'));var cookieParser=require('cookie-parser');var errorHandler=require(_0x92a0('0x3'));var path=require('path');var passport=require(_0x92a0('0x4'));var cors=require('cors');var moment=require(_0x92a0('0x5'));var config=require(_0x92a0('0x6'));var db=require('../mysqldb')['db'];exports['default']=function(_0x3cd451){var _0x5b8fdb=_0x3cd451[_0x92a0('0x7')](_0x92a0('0x8'));if(_0x5b8fdb===_0x92a0('0x9')){_0x3cd451['set'](_0x92a0('0xa'),path['join'](config[_0x92a0('0xb')],_0x92a0('0xc')));}if(_0x5b8fdb===_0x92a0('0xd')||_0x5b8fdb===_0x92a0('0xe')){_0x3cd451[_0x92a0('0xf')](_0x92a0('0xa'),path[_0x92a0('0x10')](config[_0x92a0('0xb')],_0x92a0('0x11')));_0x3cd451['use'](errorHandler());}_0x3cd451[_0x92a0('0xf')](_0x92a0('0x12'),function(_0x58ff63,_0x57676c){if(this[_0x58ff63]instanceof Date){_0x57676c=this[_0x58ff63][_0x92a0('0x13')]()[_0x92a0('0x14')]('.')[0x0]+'Z';}return _0x57676c;});_0x3cd451[_0x92a0('0x15')](express[_0x92a0('0x16')](_0x3cd451[_0x92a0('0x7')](_0x92a0('0xa'))));_0x3cd451[_0x92a0('0xf')](_0x92a0('0x17'),config[_0x92a0('0xb')]+'/server/views');_0x3cd451[_0x92a0('0x18')]('html',require(_0x92a0('0x19'))[_0x92a0('0x1a')]);_0x3cd451[_0x92a0('0xf')]('view\x20engine',_0x92a0('0x1b'));_0x3cd451[_0x92a0('0x15')](bodyParser[_0x92a0('0x1c')]({'limit':_0x92a0('0x1d'),'extended':!![]}));_0x3cd451['use'](bodyParser[_0x92a0('0x1e')]({'limit':_0x92a0('0x1d')}));_0x3cd451['use'](cors());_0x3cd451[_0x92a0('0x15')](methodOverride());_0x3cd451['use'](cookieParser());_0x3cd451[_0x92a0('0x15')](passport[_0x92a0('0x1f')]());};
\ No newline at end of file
index 046489a..c3016e5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb7a4=['platform','licenseToken','win32','replace','hostname','macAddress','ipAddress','update','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','IPv4','concat','head','mac','address','getFirstInterface','cpus','map','model','join','createHash','md5','digest','hex'];(function(_0xb40d80,_0x4c55dc){var _0x509e3a=function(_0x36bb5d){while(--_0x36bb5d){_0xb40d80['push'](_0xb40d80['shift']());}};_0x509e3a(++_0x4c55dc);}(_0xb7a4,0xae));var _0x4b7a=function(_0x5a138,_0x225902){_0x5a138=_0x5a138-0x0;var _0x19e2b7=_0xb7a4[_0x5a138];return _0x19e2b7;};'use strict';var _=require(_0x4b7a('0x0'));var os=require('os');var crypto=require(_0x4b7a('0x1'));var machine=require(_0x4b7a('0x2'));var exec=require(_0x4b7a('0x3'))[_0x4b7a('0x4')];var config=require(_0x4b7a('0x5'));function getInterfaces(){var _0x286381=[];var _0x204ad8=os[_0x4b7a('0x6')]();var _0x1f68d3=_[_0x4b7a('0x7')](_[_0x4b7a('0x8')](_0x204ad8));for(var _0x27be85=0x0;_0x27be85<_0x1f68d3[_0x4b7a('0x9')];_0x27be85++){var _0x38f7b7=_0x204ad8[_0x1f68d3[_0x27be85]]['filter'](function(_0x394299){return _0x394299['family']===_0x4b7a('0xa')&&_0x394299['internal']===![];});_0x286381=_0x286381[_0x4b7a('0xb')](_0x38f7b7);}return _0x286381;}function getFirstInterface(){var _0x10d041=_[_0x4b7a('0xc')](getInterfaces());return{'macAddress':_0x10d041&&_0x10d041[_0x4b7a('0xd')]?_0x10d041[_0x4b7a('0xd')]:'00:00:00:00:00:00','ipAddress':_0x10d041&&_0x10d041[_0x4b7a('0xe')]?_0x10d041[_0x4b7a('0xe')]:'127.0.0.1'};}exports[_0x4b7a('0xf')]=getFirstInterface;function getCPUhash(){var _0x1aa484=_['orderBy'](os[_0x4b7a('0x10')]()[_0x4b7a('0x11')](function(_0x216d76){return _0x216d76[_0x4b7a('0x12')];}))[_0x4b7a('0x13')](':');return crypto[_0x4b7a('0x14')](_0x4b7a('0x15'))['update'](_0x1aa484)[_0x4b7a('0x16')](_0x4b7a('0x17'));}exports['getUuid']=function(){var _0x5d6a1a=os[_0x4b7a('0x18')]();var _0xece91a=/[0-9a-f-]{36}/;if(config[_0x4b7a('0x19')]&&_0xece91a['test'](config[_0x4b7a('0x19')])){return config[_0x4b7a('0x19')];}else if(_0x5d6a1a===_0x4b7a('0x1a')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0x4b7a('0x1b')]('\x0d\x0a','');}else{var _0x2c8962=getFirstInterface();var _0x59e5fa=getCPUhash();var _0x5762f5=_0x59e5fa+'|'+os[_0x4b7a('0x1c')]()+'|'+_0x2c8962[_0x4b7a('0x1d')]+'|'+_0x2c8962[_0x4b7a('0x1e')];var _0x3bdc52=crypto[_0x4b7a('0x14')]('md5')[_0x4b7a('0x1f')](_0x5762f5)['digest'](_0x4b7a('0x17'));return _0x3bdc52[_0x4b7a('0x20')](0x0,0x8)+'-'+_0x3bdc52[_0x4b7a('0x20')](0x8,0xc)+'-'+_0x3bdc52[_0x4b7a('0x20')](0xc,0x10)+'-'+_0x3bdc52[_0x4b7a('0x20')](0x10,0x14)+'-'+_0x3bdc52[_0x4b7a('0x20')](0x14);}};
\ No newline at end of file
+var _0x46c9=['substring','crypto','bimedia-machine-uuid','child_process','execSync','orderBy','keys','length','filter','family','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','join','createHash','md5','update','hex','getUuid','platform','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','digest'];(function(_0x1a381e,_0x3030ab){var _0x4d0482=function(_0x56a0a6){while(--_0x56a0a6){_0x1a381e['push'](_0x1a381e['shift']());}};_0x4d0482(++_0x3030ab);}(_0x46c9,0x13c));var _0x946c=function(_0x290fa6,_0x16d017){_0x290fa6=_0x290fa6-0x0;var _0x47f1f3=_0x46c9[_0x290fa6];return _0x47f1f3;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x946c('0x0'));var machine=require(_0x946c('0x1'));var exec=require(_0x946c('0x2'))[_0x946c('0x3')];var config=require('../environment');function getInterfaces(){var _0x117133=[];var _0x59638a=os['networkInterfaces']();var _0x101db1=_[_0x946c('0x4')](_[_0x946c('0x5')](_0x59638a));for(var _0x91541e=0x0;_0x91541e<_0x101db1[_0x946c('0x6')];_0x91541e++){var _0x3b8945=_0x59638a[_0x101db1[_0x91541e]][_0x946c('0x7')](function(_0x12628b){return _0x12628b[_0x946c('0x8')]==='IPv4'&&_0x12628b[_0x946c('0x9')]===![];});_0x117133=_0x117133[_0x946c('0xa')](_0x3b8945);}return _0x117133;}function getFirstInterface(){var _0x40732e=_[_0x946c('0xb')](getInterfaces());return{'macAddress':_0x40732e&&_0x40732e[_0x946c('0xc')]?_0x40732e[_0x946c('0xc')]:_0x946c('0xd'),'ipAddress':_0x40732e&&_0x40732e[_0x946c('0xe')]?_0x40732e[_0x946c('0xe')]:_0x946c('0xf')};}exports[_0x946c('0x10')]=getFirstInterface;function getCPUhash(){var _0x50eac1=_[_0x946c('0x4')](os[_0x946c('0x11')]()[_0x946c('0x12')](function(_0x2158cc){return _0x2158cc['model'];}))[_0x946c('0x13')](':');return crypto[_0x946c('0x14')](_0x946c('0x15'))[_0x946c('0x16')](_0x50eac1)['digest'](_0x946c('0x17'));}exports[_0x946c('0x18')]=function(){var _0x41e025=os[_0x946c('0x19')]();var _0x34632a=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x34632a[_0x946c('0x1a')](config[_0x946c('0x1b')])){return config[_0x946c('0x1b')];}else if(_0x41e025===_0x946c('0x1c')){return exec(_0x946c('0x1d'),{'encoding':_0x946c('0x1e')})[_0x946c('0x1f')]('\x0d\x0a','');}else{var _0x24a096=getFirstInterface();var _0xe38cdf=getCPUhash();var _0x45c70c=_0xe38cdf+'|'+os[_0x946c('0x20')]()+'|'+_0x24a096['macAddress']+'|'+_0x24a096['ipAddress'];var _0x2e313b=crypto[_0x946c('0x14')]('md5')[_0x946c('0x16')](_0x45c70c)[_0x946c('0x21')](_0x946c('0x17'));return _0x2e313b[_0x946c('0x22')](0x0,0x8)+'-'+_0x2e313b['substring'](0x8,0xc)+'-'+_0x2e313b['substring'](0xc,0x10)+'-'+_0x2e313b[_0x946c('0x22')](0x10,0x14)+'-'+_0x2e313b[_0x946c('0x22')](0x14);}};
\ No newline at end of file
index d9afa83..dcf72a4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xed34=['license','format','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','version','GET','catch','get','data1','data2','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','Changed','info','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','update','encryptString','diff','error','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','message','default','util','moment','request-promise','bluebird','../../mysqldb','../../components/encryptor','./hardware','../logger'];(function(_0x3a4f8b,_0x306736){var _0x3574d8=function(_0x242de5){while(--_0x242de5){_0x3a4f8b['push'](_0x3a4f8b['shift']());}};_0x3574d8(++_0x306736);}(_0xed34,0x1cc));var _0x4ed3=function(_0x16f8b2,_0x5dc8f0){_0x16f8b2=_0x16f8b2-0x0;var _0x54e831=_0xed34[_0x16f8b2];return _0x54e831;};'use strict';var util=require(_0x4ed3('0x0'));var moment=require(_0x4ed3('0x1'));var rp=require(_0x4ed3('0x2'));var BPromise=require(_0x4ed3('0x3'));var pkginfo=require('pkginfo')(module,'version');var db=require(_0x4ed3('0x4'))['db'];var encryptor=require(_0x4ed3('0x5'));var hardware=require(_0x4ed3('0x6'));var logger=require(_0x4ed3('0x7'))(_0x4ed3('0x8'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x2f6b36){return new BPromise(function(_0x5e32cb,_0x35a1f3){var _0x28d96c=util[_0x4ed3('0x9')]('%s/api/servers/%s/check?version=%s',HOST,_0x2f6b36,module[_0x4ed3('0xa')]['version']);if(oldToken){_0x28d96c=util[_0x4ed3('0x9')](_0x4ed3('0xb'),HOST,_0x2f6b36,module[_0x4ed3('0xa')][_0x4ed3('0xc')],oldToken);}var _0x5d289d={'uri':_0x28d96c,'method':_0x4ed3('0xd'),'timeout':0xea60,'json':!![]};return rp(_0x5d289d)['then'](function(_0x157c9d){_0x5e32cb(_0x157c9d);})[_0x4ed3('0xe')](function(_0x6faf5f){_0x35a1f3(_0x6faf5f);});});}function manageLicense(_0x964e50,_0x2d3fee){var _0x20b94f=_0x2d3fee[_0x4ed3('0xf')]({'plain':!![]});if(!isOldTokenSent&&_0x20b94f[_0x4ed3('0x10')]!==_0x964e50&&!_0x20b94f[_0x4ed3('0x11')]){oldToken=_0x20b94f[_0x4ed3('0x10')];}httpRequest(_0x964e50)['then'](function(_0x45ca6c){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x45ca6c[_0x4ed3('0x12')]){isOldTokenSent=![];if(!_0x20b94f[_0x4ed3('0x8')]&&_0x20b94f['license']!=_0x45ca6c['license']||_0x20b94f[_0x4ed3('0x8')]&&_0x20b94f[_0x4ed3('0x11')]){logger['info'](_0x4ed3('0x13'));}if(_0x20b94f[_0x4ed3('0x8')]&&!_0x20b94f[_0x4ed3('0x11')]&&_0x20b94f['license']!=_0x45ca6c[_0x4ed3('0x8')]){logger['info'](_0x4ed3('0x14'));}if(_0x20b94f[_0x4ed3('0x8')]&&!_0x20b94f[_0x4ed3('0x11')]&&_0x20b94f[_0x4ed3('0x8')]==_0x45ca6c[_0x4ed3('0x8')]){return _0x2d3fee;}return _0x2d3fee['update']({'data1':_0x964e50,'data2':null,'license':_0x45ca6c[_0x4ed3('0x8')]});}else{if(_0x45ca6c['license']||_0x20b94f[_0x4ed3('0x8')]){if(!_0x20b94f['data2']){if(_0x20b94f[_0x4ed3('0x10')]==_0x964e50){GRAY_PERIOD_REASON=_0x4ed3('0x15');logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x4ed3('0x16');logger[_0x4ed3('0x17')](_0x4ed3('0x18'),_0x20b94f[_0x4ed3('0x10')],_0x964e50);}logger[_0x4ed3('0x17')](_0x4ed3('0x19'),GRAY_PERIOD_REASON[_0x4ed3('0x1a')](),moment()[_0x4ed3('0x9')](_0x4ed3('0x1b')));return _0x2d3fee[_0x4ed3('0x1c')]({'data2':encryptor[_0x4ed3('0x1d')](moment()['format'](_0x4ed3('0x1b')))});}else{if(moment()[_0x4ed3('0x1e')](encryptor['decryptString'](_0x20b94f[_0x4ed3('0x11')]),'days')>DAYS){logger[_0x4ed3('0x17')]('DEMO\x20START\x20AT\x20%s',moment()['format'](_0x4ed3('0x1b')));isOldTokenSent=![];return _0x2d3fee[_0x4ed3('0x1c')]({'data1':_0x964e50,'data2':null,'license':null});}}}else{if(_0x20b94f[_0x4ed3('0x10')]!=_0x964e50){logger[_0x4ed3('0x17')](_0x4ed3('0x18'),_0x20b94f['data1'],_0x964e50);return _0x2d3fee[_0x4ed3('0x1c')]({'data1':_0x964e50,'data2':null,'license':null});}}}return _0x2d3fee;})['then'](function(_0x413b3b){_0x2d3fee=_0x413b3b;})[_0x4ed3('0xe')](function(_0x45b856){logger[_0x4ed3('0x1f')](_0x45b856['message']);})[_0x4ed3('0x20')](function(){setTimeout(function(){manageLicense(hardware[_0x4ed3('0x21')](),_0x2d3fee);},TIME);});}function defaultLicense(){var _0x119af0=hardware[_0x4ed3('0x21')]();if(_0x119af0){return db[_0x4ed3('0x22')][_0x4ed3('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x119af0}})['spread'](function(_0x5ec72f,_0x3fb94d){logger[_0x4ed3('0x17')](_0x4ed3('0x24'),_0x119af0);manageLicense(_0x119af0,_0x5ec72f);})['catch'](function(_0x4852a7){logger[_0x4ed3('0x1f')](_0x4852a7[_0x4ed3('0x25')]);});}}exports[_0x4ed3('0x26')]=defaultLicense;
\ No newline at end of file
+var _0xbe60=['diff','decryptString','DEMO\x20START\x20AT\x20%s','YYYY-MM-DD\x20HH:mm','error','message','finally','getUuid','License','findOrCreate','default','util','moment','request-promise','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','get','data2','then','active','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','info','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','update','encryptString'];(function(_0x1ed1e2,_0xdc162){var _0x438756=function(_0x37aaf3){while(--_0x37aaf3){_0x1ed1e2['push'](_0x1ed1e2['shift']());}};_0x438756(++_0xdc162);}(_0xbe60,0x10d));var _0x0be6=function(_0x9770d6,_0x1d88d5){_0x9770d6=_0x9770d6-0x0;var _0x2a7380=_0xbe60[_0x9770d6];return _0x2a7380;};'use strict';var util=require(_0x0be6('0x0'));var moment=require(_0x0be6('0x1'));var rp=require(_0x0be6('0x2'));var BPromise=require('bluebird');var pkginfo=require(_0x0be6('0x3'))(module,_0x0be6('0x4'));var db=require(_0x0be6('0x5'))['db'];var encryptor=require(_0x0be6('0x6'));var hardware=require(_0x0be6('0x7'));var logger=require(_0x0be6('0x8'))(_0x0be6('0x9'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x302379){return new BPromise(function(_0x415930,_0x57eae4){var _0x2c841a=util[_0x0be6('0xa')](_0x0be6('0xb'),HOST,_0x302379,module[_0x0be6('0xc')][_0x0be6('0x4')]);if(oldToken){_0x2c841a=util['format'](_0x0be6('0xd'),HOST,_0x302379,module[_0x0be6('0xc')][_0x0be6('0x4')],oldToken);}var _0x43608c={'uri':_0x2c841a,'method':_0x0be6('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x43608c)['then'](function(_0x3b4e85){_0x415930(_0x3b4e85);})[_0x0be6('0xf')](function(_0x3fb713){_0x57eae4(_0x3fb713);});});}function manageLicense(_0x2162b7,_0x203711){var _0x4695cd=_0x203711[_0x0be6('0x10')]({'plain':!![]});if(!isOldTokenSent&&_0x4695cd['data1']!==_0x2162b7&&!_0x4695cd[_0x0be6('0x11')]){oldToken=_0x4695cd['data1'];}httpRequest(_0x2162b7)[_0x0be6('0x12')](function(_0x303db2){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x303db2[_0x0be6('0x13')]){isOldTokenSent=![];if(!_0x4695cd['license']&&_0x4695cd[_0x0be6('0x9')]!=_0x303db2[_0x0be6('0x9')]||_0x4695cd['license']&&_0x4695cd['data2']){logger['info'](_0x0be6('0x14'));}if(_0x4695cd[_0x0be6('0x9')]&&!_0x4695cd[_0x0be6('0x11')]&&_0x4695cd[_0x0be6('0x9')]!=_0x303db2[_0x0be6('0x9')]){logger['info'](_0x0be6('0x15'));}if(_0x4695cd[_0x0be6('0x9')]&&!_0x4695cd[_0x0be6('0x11')]&&_0x4695cd[_0x0be6('0x9')]==_0x303db2[_0x0be6('0x9')]){return _0x203711;}return _0x203711['update']({'data1':_0x2162b7,'data2':null,'license':_0x303db2[_0x0be6('0x9')]});}else{if(_0x303db2[_0x0be6('0x9')]||_0x4695cd[_0x0be6('0x9')]){if(!_0x4695cd['data2']){if(_0x4695cd[_0x0be6('0x16')]==_0x2162b7){GRAY_PERIOD_REASON=_0x0be6('0x17');logger['info'](_0x0be6('0x18'));}else{GRAY_PERIOD_REASON=_0x0be6('0x19');logger[_0x0be6('0x1a')](_0x0be6('0x1b'),_0x4695cd[_0x0be6('0x16')],_0x2162b7);}logger[_0x0be6('0x1a')](_0x0be6('0x1c'),GRAY_PERIOD_REASON[_0x0be6('0x1d')](),moment()[_0x0be6('0xa')]('YYYY-MM-DD\x20HH:mm'));return _0x203711[_0x0be6('0x1e')]({'data2':encryptor[_0x0be6('0x1f')](moment()[_0x0be6('0xa')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x0be6('0x20')](encryptor[_0x0be6('0x21')](_0x4695cd[_0x0be6('0x11')]),'days')>DAYS){logger[_0x0be6('0x1a')](_0x0be6('0x22'),moment()[_0x0be6('0xa')](_0x0be6('0x23')));isOldTokenSent=![];return _0x203711['update']({'data1':_0x2162b7,'data2':null,'license':null});}}}else{if(_0x4695cd[_0x0be6('0x16')]!=_0x2162b7){logger[_0x0be6('0x1a')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x4695cd['data1'],_0x2162b7);return _0x203711[_0x0be6('0x1e')]({'data1':_0x2162b7,'data2':null,'license':null});}}}return _0x203711;})['then'](function(_0x4a4640){_0x203711=_0x4a4640;})[_0x0be6('0xf')](function(_0x293db3){logger[_0x0be6('0x24')](_0x293db3[_0x0be6('0x25')]);})[_0x0be6('0x26')](function(){setTimeout(function(){manageLicense(hardware[_0x0be6('0x27')](),_0x203711);},TIME);});}function defaultLicense(){var _0x2bf3dc=hardware[_0x0be6('0x27')]();if(_0x2bf3dc){return db[_0x0be6('0x28')][_0x0be6('0x29')]({'where':{'id':0x1},'defaults':{'data1':_0x2bf3dc}})['spread'](function(_0x562313,_0x1619c8){logger[_0x0be6('0x1a')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x2bf3dc);manageLicense(_0x2bf3dc,_0x562313);})[_0x0be6('0xf')](function(_0x2b0505){logger[_0x0be6('0x24')](_0x2b0505['message']);});}}exports[_0x0be6('0x2a')]=defaultLicense;
\ No newline at end of file
index 598e14c..5b7a8d2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8355=['decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','deadline','days','grayReason','changed','findAll','role','sequelize','col','count','admin','telephone','users','telephones','forEach','user','pick','countBy','License\x20limit\x20reached\x20for\x20users','exports','util','lodash','moment','bluebird','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','Breaking\x20license','License','find','defaults','then','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split'];(function(_0x5da4aa,_0x5edb8f){var _0x4c46e4=function(_0x72613f){while(--_0x72613f){_0x5da4aa['push'](_0x5da4aa['shift']());}};_0x4c46e4(++_0x5edb8f);}(_0x8355,0x192));var _0x5835=function(_0x224e7e,_0x265a0e){_0x224e7e=_0x224e7e-0x0;var _0x1570e6=_0x8355[_0x224e7e];return _0x1570e6;};'use strict';var util=require(_0x5835('0x0'));var _=require(_0x5835('0x1'));var moment=require(_0x5835('0x2'));var BPromise=require(_0x5835('0x3'));var hardware=require('./hardware');var encryptor=require(_0x5835('0x4'));var db=require(_0x5835('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5835('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x5835('0x7'),'machineUuid':hardware[_0x5835('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x5835('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x5835('0x9'),'machineUuid':hardware[_0x5835('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x32ae2d){return new BPromise(function(_0xbcb712,_0xad7f1a){return db[_0x5835('0xa')][_0x5835('0xb')](_[_0x5835('0xc')](_0x32ae2d,{'raw':!![],'where':{'id':0x1}}))[_0x5835('0xd')](function(_0x1420b1){return checkLicense(_0x1420b1,null);})[_0x5835('0xd')](function(_0x598921){_0xbcb712(_0x598921);return;})['catch'](function(_0x1001b1){_0xad7f1a(_0x1001b1);});});}function checkLicense(_0x5cf104,_0xe76063){if(!_0x5cf104){demoLicense[_0x5835('0xe')]=_0x5cf104[_0x5835('0xf')];return demoLicense;}try{var _0x1fb959=_0xe76063||_0x5cf104[_0x5835('0x10')];if(_[_0x5835('0x11')](_0x1fb959)){throw new Error(_0x5835('0x12'));}var _0x410eb4=_0x5cf104[_0x5835('0xf')];var _0x54d397=_0x5cf104[_0x5835('0x13')];var _0x346e63=_0x410eb4[_0x5835('0x14')]('-')[0x4];var _0x3b0d3c=_0x410eb4[_0x5835('0x14')]('-')[0x0];var _0xa0a50b=encryptor[_0x5835('0x15')](_0x1fb959,util[_0x5835('0x16')](_0x5835('0x17'),_0x346e63,_0x410eb4,_0x3b0d3c));var _0x5cf410=JSON[_0x5835('0x18')](_0xa0a50b);_0x5cf410[_0x5835('0x19')]=![];_0x5cf410[_0x5835('0xe')]=_0x410eb4;_0x5cf410[_0x5835('0x1a')]=hardware[_0x5835('0x8')]();if(_0x54d397){var _0x6712b3=encryptor[_0x5835('0x15')](_0x54d397);_0x5cf410[_0x5835('0x1b')]=_0x6712b3;_0x5cf410[_0x5835('0x1c')]=moment(_0x6712b3)['add'](0x7,_0x5835('0x1d'))[_0x5835('0x16')]();_0x5cf410[_0x5835('0x1e')]=_0x5cf410[_0x5835('0xe')]!=_0x5cf410[_0x5835('0x1a')]?_0x5835('0x1f'):'disabled';}return _0x5cf410;}catch(_0x3e8f36){breakingLicense[_0x5835('0xe')]=_0x5cf104[_0x5835('0xf')];breakingLicense['message']=_0x3e8f36['message'];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x21d132,_0x38203b){getLicense()[_0x5835('0xd')](function(_0x1674b8){return db['User'][_0x5835('0x20')]({'attributes':[_0x5835('0x21'),[db[_0x5835('0x22')]['fn']('COUNT',db['sequelize'][_0x5835('0x23')](_0x5835('0x21'))),_0x5835('0x24')]],'group':_0x5835('0x21'),'where':{'role':{'$or':[_0x5835('0x25'),'user',_0x5835('0x26')]}},'raw':!![]})[_0x5835('0xd')](function(_0x14cc89){var _0x520f25={'user':_0x1674b8[_0x5835('0x27')]||0x0,'telephone':_0x1674b8[_0x5835('0x28')]||0x0};_0x14cc89[_0x5835('0x29')](function(_0x1f319d){var _0x50b146=_0x1f319d['role']===_0x5835('0x25')?_0x5835('0x2a'):_0x1f319d[_0x5835('0x21')];_0x520f25[_0x50b146]-=_0x1f319d['count'];if(_0x520f25[_0x50b146]<0x0)_0x520f25[_0x50b146]=0x0;});_0x21d132(_0x520f25);return;});})['catch'](function(_0x359f92){_0x38203b(_0x359f92);});});}function checkUserLimits(_0xb4b4ce){return new BPromise(function(_0x571049,_0x2cec33){getLimits()[_0x5835('0xd')](function(_0x3ac886){var _0x16073d=_[_0x5835('0x2b')](_[_0x5835('0x2c')](_0xb4b4ce,_0x5835('0x21')),[_0x5835('0x25'),'user','telephone']);var _0x948d08=(_0x16073d['admin']||0x0)+(_0x16073d['user']||0x0);var _0x25f1c4=_0x16073d['telephone']||0x0;if(_0x948d08>_0x3ac886[_0x5835('0x2a')])return _0x2cec33(_0x5835('0x2d'));if(_0x25f1c4>_0x3ac886['telephone'])return _0x2cec33('License\x20limit\x20reached\x20for\x20telephones');return _0x571049();})['catch'](function(_0x489cd2){_0x2cec33(_0x489cd2);});});}module[_0x5835('0x2e')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
+var _0xf62d=['changed','disabled','message','then','findAll','role','sequelize','col','count','user','users','telephones','admin','countBy','telephone','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','Breaking\x20license','getUuid','License','find','catch','uuid','data1','isEmpty','data2','split','format','%s:%s:%s','parse','demo','machineUuid','decryptString','gray','deadline','days'];(function(_0x43d3c2,_0x584fab){var _0x3d16ad=function(_0x46d01a){while(--_0x46d01a){_0x43d3c2['push'](_0x43d3c2['shift']());}};_0x3d16ad(++_0x584fab);}(_0xf62d,0x69));var _0xdf62=function(_0x32e8d5,_0x130fe2){_0x32e8d5=_0x32e8d5-0x0;var _0x276e99=_0xf62d[_0x32e8d5];return _0x276e99;};'use strict';var util=require(_0xdf62('0x0'));var _=require(_0xdf62('0x1'));var moment=require(_0xdf62('0x2'));var BPromise=require('bluebird');var hardware=require(_0xdf62('0x3'));var encryptor=require(_0xdf62('0x4'));var db=require(_0xdf62('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xdf62('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xdf62('0x7'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xdf62('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xdf62('0x8'),'machineUuid':hardware[_0xdf62('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4309ab){return new BPromise(function(_0x1ef9e1,_0x26f0f7){return db[_0xdf62('0xa')][_0xdf62('0xb')](_['defaults'](_0x4309ab,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x1880c9){return checkLicense(_0x1880c9,null);})['then'](function(_0x5c626e){_0x1ef9e1(_0x5c626e);return;})[_0xdf62('0xc')](function(_0x2f82fa){_0x26f0f7(_0x2f82fa);});});}function checkLicense(_0x1e2d84,_0x5441a8){if(!_0x1e2d84){demoLicense[_0xdf62('0xd')]=_0x1e2d84[_0xdf62('0xe')];return demoLicense;}try{var _0xfeaee7=_0x5441a8||_0x1e2d84['license'];if(_[_0xdf62('0xf')](_0xfeaee7)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x178cd3=_0x1e2d84[_0xdf62('0xe')];var _0x7a769c=_0x1e2d84[_0xdf62('0x10')];var _0x47510d=_0x178cd3[_0xdf62('0x11')]('-')[0x4];var _0x5d19d7=_0x178cd3[_0xdf62('0x11')]('-')[0x0];var _0x33233d=encryptor['decryptString'](_0xfeaee7,util[_0xdf62('0x12')](_0xdf62('0x13'),_0x47510d,_0x178cd3,_0x5d19d7));var _0x29e759=JSON[_0xdf62('0x14')](_0x33233d);_0x29e759[_0xdf62('0x15')]=![];_0x29e759['uuid']=_0x178cd3;_0x29e759[_0xdf62('0x16')]=hardware['getUuid']();if(_0x7a769c){var _0xc21d44=encryptor[_0xdf62('0x17')](_0x7a769c);_0x29e759[_0xdf62('0x18')]=_0xc21d44;_0x29e759[_0xdf62('0x19')]=moment(_0xc21d44)['add'](0x7,_0xdf62('0x1a'))[_0xdf62('0x12')]();_0x29e759['grayReason']=_0x29e759['uuid']!=_0x29e759[_0xdf62('0x16')]?_0xdf62('0x1b'):_0xdf62('0x1c');}return _0x29e759;}catch(_0x2884e6){breakingLicense[_0xdf62('0xd')]=_0x1e2d84[_0xdf62('0xe')];breakingLicense[_0xdf62('0x1d')]=_0x2884e6[_0xdf62('0x1d')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0xf7c4fb,_0x1d14f1){getLicense()[_0xdf62('0x1e')](function(_0x16153f){return db['User'][_0xdf62('0x1f')]({'attributes':[_0xdf62('0x20'),[db['sequelize']['fn']('COUNT',db[_0xdf62('0x21')][_0xdf62('0x22')](_0xdf62('0x20'))),_0xdf62('0x23')]],'group':_0xdf62('0x20'),'where':{'role':{'$or':['admin',_0xdf62('0x24'),'telephone']}},'raw':!![]})[_0xdf62('0x1e')](function(_0x3a2834){var _0x17c7e4={'user':_0x16153f[_0xdf62('0x25')]||0x0,'telephone':_0x16153f[_0xdf62('0x26')]||0x0};_0x3a2834['forEach'](function(_0x44676a){var _0x6ffa32=_0x44676a[_0xdf62('0x20')]===_0xdf62('0x27')?_0xdf62('0x24'):_0x44676a[_0xdf62('0x20')];_0x17c7e4[_0x6ffa32]-=_0x44676a[_0xdf62('0x23')];if(_0x17c7e4[_0x6ffa32]<0x0)_0x17c7e4[_0x6ffa32]=0x0;});_0xf7c4fb(_0x17c7e4);return;});})['catch'](function(_0x1d1762){_0x1d14f1(_0x1d1762);});});}function checkUserLimits(_0x20c2f3){return new BPromise(function(_0x5e3303,_0x3bd28a){getLimits()[_0xdf62('0x1e')](function(_0x3411f6){var _0x1ed7f0=_['pick'](_[_0xdf62('0x28')](_0x20c2f3,_0xdf62('0x20')),[_0xdf62('0x27'),_0xdf62('0x24'),_0xdf62('0x29')]);var _0x514770=(_0x1ed7f0[_0xdf62('0x27')]||0x0)+(_0x1ed7f0[_0xdf62('0x24')]||0x0);var _0x3eab94=_0x1ed7f0['telephone']||0x0;if(_0x514770>_0x3411f6['user'])return _0x3bd28a('License\x20limit\x20reached\x20for\x20users');if(_0x3eab94>_0x3411f6[_0xdf62('0x29')])return _0x3bd28a(_0xdf62('0x2a'));return _0x5e3303();})[_0xdf62('0xc')](function(_0x2abe5e){_0x3bd28a(_0x2abe5e);});});}module[_0xdf62('0x2b')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense};
\ No newline at end of file
index d435d8b..e692029 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd4a2=['app-id','exports'];(function(_0x4c64af,_0x189495){var _0x822f36=function(_0xbfb753){while(--_0xbfb753){_0x4c64af['push'](_0x4c64af['shift']());}};_0x822f36(++_0x189495);}(_0xd4a2,0x173));var _0x2d4a=function(_0x1202d7,_0x52753e){_0x1202d7=_0x1202d7-0x0;var _0x5b6d5f=_0xd4a2[_0x1202d7];return _0x5b6d5f;};'use strict';module[_0x2d4a('0x0')]={'DOMAIN':'http://localhost:9000','SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x2d4a('0x1'),'GOOGLE_SECRET':'secret','DEBUG':''};
\ No newline at end of file
+var _0x47c5=['app-id','secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x1c700d,_0x199cd9){var _0x17d3c3=function(_0x88a5e){while(--_0x88a5e){_0x1c700d['push'](_0x1c700d['shift']());}};_0x17d3c3(++_0x199cd9);}(_0x47c5,0x165));var _0x547c=function(_0x2a2cdf,_0x3f2801){_0x2a2cdf=_0x2a2cdf-0x0;var _0x5e8e12=_0x47c5[_0x2a2cdf];return _0x5e8e12;};'use strict';module[_0x547c('0x0')]={'DOMAIN':_0x547c('0x1'),'SESSION_SECRET':_0x547c('0x2'),'GOOGLE_ID':_0x547c('0x3'),'GOOGLE_SECRET':_0x547c('0x4'),'DEBUG':''};
\ No newline at end of file
index 40e668b..5c1d601 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x919e=['join','/var','log','xcally','format','%s-%s.log','message','{{{','}}}','replace','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','Logger','transports','File','error','%s-%s','info','env','debugLevel','moment','winston','util','INFO'];(function(_0x5b242c,_0x598276){var _0xb2479f=function(_0x5b7c6b){while(--_0x5b7c6b){_0x5b242c['push'](_0x5b242c['shift']());}};_0xb2479f(++_0x598276);}(_0x919e,0x1d7));var _0xe919=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x919e[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xe919('0x0'));var winston=require(_0xe919('0x1'));var util=require(_0xe919('0x2'));var path=require('path');var debugLevel=_0xe919('0x3');function filename(_0x55cc54,_0x4f9fcd){return path[_0xe919('0x4')](_0xe919('0x5'),_0xe919('0x6'),_0xe919('0x7'),util[_0xe919('0x8')](_0xe919('0x9'),_0x55cc54,_0x4f9fcd));}function formatter(_0x1225a5,_0x493b47){_0x493b47[_0xe919('0xa')]=_0x493b47[_0xe919('0xa')]['replace'](/@@{/g,_0xe919('0xb'))['replace'](/}@@/g,_0xe919('0xc'))[_0xe919('0xd')](/@{/g,'{{')[_0xe919('0xd')](/}@/g,'}}');return util['format'](_0xe919('0xe'),moment()[_0xe919('0x8')](_0xe919('0xf')),_0x493b47['level'][_0xe919('0x10')](),_0x1225a5,_0x493b47['message']);}module['exports']=function(_0x50703a){return new winston[(_0xe919('0x11'))]({'transports':[new winston[(_0xe919('0x12'))][(_0xe919('0x13'))]({'name':util['format']('%s-%s',_0x50703a,_0xe919('0x14')),'filename':filename(_0x50703a,_0xe919('0x14')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3c09be){return formatter(_0x50703a,_0x3c09be);}}),new winston[(_0xe919('0x12'))][(_0xe919('0x13'))]({'name':util[_0xe919('0x8')](_0xe919('0x15'),_0x50703a,_0xe919('0x16')),'filename':filename(_0x50703a,_0xe919('0x16')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x3fadb9){return formatter(_0x50703a,_0x3fadb9);}}),new winston['transports']['Console']({'level':process[_0xe919('0x17')][_0xe919('0x18')]||debugLevel,'json':![],'formatter':function(_0x5bf757){return formatter(_0x50703a,_0x5bf757);}})]});};
\ No newline at end of file
+var _0x8f76=['debugLevel','moment','util','path','INFO','/var','log','xcally','format','%s-%s.log','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','exports','transports','File','%s-%s','error','info','env'];(function(_0xd5f53e,_0x5a1236){var _0x55bd50=function(_0x3ab7ab){while(--_0x3ab7ab){_0xd5f53e['push'](_0xd5f53e['shift']());}};_0x55bd50(++_0x5a1236);}(_0x8f76,0x12c));var _0x68f7=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x8f76[_0x3b380d];return _0x54502b;};'use strict';var moment=require(_0x68f7('0x0'));var winston=require('winston');var util=require(_0x68f7('0x1'));var path=require(_0x68f7('0x2'));var debugLevel=_0x68f7('0x3');function filename(_0x372ba1,_0x5b80e1){return path['join'](_0x68f7('0x4'),_0x68f7('0x5'),_0x68f7('0x6'),util[_0x68f7('0x7')](_0x68f7('0x8'),_0x372ba1,_0x5b80e1));}function formatter(_0x48b6ec,_0x4e0f17){_0x4e0f17[_0x68f7('0x9')]=_0x4e0f17[_0x68f7('0x9')][_0x68f7('0xa')](/@@{/g,'{{{')[_0x68f7('0xa')](/}@@/g,_0x68f7('0xb'))[_0x68f7('0xa')](/@{/g,'{{')[_0x68f7('0xa')](/}@/g,'}}');return util[_0x68f7('0x7')](_0x68f7('0xc'),moment()[_0x68f7('0x7')](_0x68f7('0xd')),_0x4e0f17['level'][_0x68f7('0xe')](),_0x48b6ec,_0x4e0f17[_0x68f7('0x9')]);}module[_0x68f7('0xf')]=function(_0x5c0617){return new winston['Logger']({'transports':[new winston[(_0x68f7('0x10'))][(_0x68f7('0x11'))]({'name':util[_0x68f7('0x7')](_0x68f7('0x12'),_0x5c0617,_0x68f7('0x13')),'filename':filename(_0x5c0617,_0x68f7('0x13')),'level':_0x68f7('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1682e1){return formatter(_0x5c0617,_0x1682e1);}}),new winston[(_0x68f7('0x10'))][(_0x68f7('0x11'))]({'name':util[_0x68f7('0x7')](_0x68f7('0x12'),_0x5c0617,_0x68f7('0x14')),'filename':filename(_0x5c0617,_0x68f7('0x14')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x308230){return formatter(_0x5c0617,_0x308230);}}),new winston[(_0x68f7('0x10'))]['Console']({'level':process[_0x68f7('0x15')][_0x68f7('0x16')]||debugLevel,'json':![],'formatter':function(_0x338376){return formatter(_0x5c0617,_0x338376);}})]});};
\ No newline at end of file
index 1d30d05..514fa46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc63f=['path','express','join','../../services/express/index.js','ami','../../services/ami/index.js','../../services/agi/index.js','email','routing','../../services/routing/index.js','exports'];(function(_0x47159c,_0x1c8216){var _0x454dbe=function(_0x2b54f7){while(--_0x2b54f7){_0x47159c['push'](_0x47159c['shift']());}};_0x454dbe(++_0x1c8216);}(_0xc63f,0x129));var _0xfc63=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc63f[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0xfc63('0x0'));var os=require('os');var config={'apps':[{'name':_0xfc63('0x1'),'script':path[_0xfc63('0x2')](__dirname,_0xfc63('0x3'))},{'name':_0xfc63('0x4'),'script':path[_0xfc63('0x2')](__dirname,_0xfc63('0x5'))},{'name':'agi','script':path[_0xfc63('0x2')](__dirname,_0xfc63('0x6'))},{'name':_0xfc63('0x7'),'script':path[_0xfc63('0x2')](__dirname,'../../services/email/index.js')},{'name':_0xfc63('0x8'),'script':path['join'](__dirname,_0xfc63('0x9'))},{'name':'xdr','script':path[_0xfc63('0x2')](__dirname,'../../services/xdr/index.js')}]};module[_0xfc63('0xa')]=config;
\ No newline at end of file
+var _0xd9ec=['../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','routing','../../services/routing/index.js','xdr','exports','path','express','join','../../services/express/index.js','ami'];(function(_0x4dd86a,_0x157004){var _0x34a5d5=function(_0x5ee3f){while(--_0x5ee3f){_0x4dd86a['push'](_0x4dd86a['shift']());}};_0x34a5d5(++_0x157004);}(_0xd9ec,0x95));var _0xcd9e=function(_0x12b897,_0x1d8a72){_0x12b897=_0x12b897-0x0;var _0x2258a7=_0xd9ec[_0x12b897];return _0x2258a7;};'use strict';var path=require(_0xcd9e('0x0'));var os=require('os');var config={'apps':[{'name':_0xcd9e('0x1'),'script':path[_0xcd9e('0x2')](__dirname,_0xcd9e('0x3'))},{'name':_0xcd9e('0x4'),'script':path[_0xcd9e('0x2')](__dirname,_0xcd9e('0x5'))},{'name':_0xcd9e('0x6'),'script':path[_0xcd9e('0x2')](__dirname,_0xcd9e('0x7'))},{'name':_0xcd9e('0x8'),'script':path[_0xcd9e('0x2')](__dirname,_0xcd9e('0x9'))},{'name':_0xcd9e('0xa'),'script':path[_0xcd9e('0x2')](__dirname,_0xcd9e('0xb'))},{'name':_0xcd9e('0xc'),'script':path[_0xcd9e('0x2')](__dirname,'../../services/xdr/index.js')}]};module[_0xcd9e('0xd')]=config;
\ No newline at end of file
index 4f74ad5..253d5bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0bac=['connect','connected','start','then','disconnect','stop','restart','list','describe','delete','dump','saved','pm2','bluebird','./config'];(function(_0x3f744f,_0x4a2cf6){var _0x523f93=function(_0x12b19a){while(--_0x12b19a){_0x3f744f['push'](_0x3f744f['shift']());}};_0x523f93(++_0x4a2cf6);}(_0x0bac,0x75));var _0xc0ba=function(_0x4ed8c0,_0x415de6){_0x4ed8c0=_0x4ed8c0-0x0;var _0x4fed23=_0x0bac[_0x4ed8c0];return _0x4fed23;};'use strict';var pm2=require(_0xc0ba('0x0'));var BPromise=require(_0xc0ba('0x1'));var config=require(_0xc0ba('0x2'));function connect(){return new BPromise(function(_0x501024,_0xd32d35){return pm2[_0xc0ba('0x3')](function(_0x5ac537){if(_0x5ac537){return _0xd32d35(_0x5ac537);}return _0x501024(_0xc0ba('0x4'));});});};exports[_0xc0ba('0x5')]=function(_0x28c3dd){return connect()[_0xc0ba('0x6')](function(){return new BPromise(function(_0x440e24,_0x321a1f){return pm2[_0xc0ba('0x5')](_0x28c3dd,function(_0x3fd952,_0x3020fb){if(_0x3fd952){return _0x321a1f(_0x3fd952);}pm2[_0xc0ba('0x7')]();return _0x440e24(_0x3020fb);});});});};exports[_0xc0ba('0x8')]=function(_0x40492f){return connect()[_0xc0ba('0x6')](function(){return new BPromise(function(_0x46b0eb,_0x3563a6){return pm2['stop'](_0x40492f,function(_0x2a58fd,_0x4988e7){if(_0x2a58fd){return _0x3563a6(_0x2a58fd);}pm2['disconnect']();return _0x46b0eb(_0x4988e7);});});});};exports[_0xc0ba('0x9')]=function(_0x4bda1e){return connect()['then'](function(){return new BPromise(function(_0x1ccb89,_0x444de7){return pm2[_0xc0ba('0x9')](_0x4bda1e,function(_0x1a013d,_0xa0d849){if(_0x1a013d){return _0x444de7(_0x1a013d);}pm2['disconnect']();return _0x1ccb89(_0xa0d849);});});});};exports[_0xc0ba('0xa')]=function(){return connect()[_0xc0ba('0x6')](function(){return new BPromise(function(_0x4ba7dd,_0x4fdde1){return pm2[_0xc0ba('0xa')](function(_0x3e7c39,_0x49b7f3){if(_0x3e7c39){return _0x4fdde1(_0x3e7c39);}pm2[_0xc0ba('0x7')]();return _0x4ba7dd(_0x49b7f3);});});});};exports[_0xc0ba('0xb')]=function(_0x3864ea){return connect()[_0xc0ba('0x6')](function(){return new BPromise(function(_0x4a1edb,_0x4947e9){return pm2[_0xc0ba('0xb')](_0x3864ea,function(_0x48cfa5,_0x3edd2c){if(_0x48cfa5){return _0x4947e9(_0x48cfa5);}pm2[_0xc0ba('0x7')]();return _0x4a1edb(_0x3edd2c);});});});};exports[_0xc0ba('0xc')]=function(_0xbf91a9){return connect()[_0xc0ba('0x6')](function(){return new BPromise(function(_0xe43837,_0x496057){return pm2[_0xc0ba('0xc')](_0xbf91a9,function(_0x16dda5,_0x5ee0e9){if(_0x16dda5){return _0x496057(_0x16dda5);}pm2[_0xc0ba('0x7')]();return _0xe43837(_0x5ee0e9);});});});};exports[_0xc0ba('0xd')]=function(){return connect()['then'](function(){return new BPromise(function(_0x24f8fb,_0x319e82){return pm2[_0xc0ba('0xd')](function(_0xcbed2c){if(_0xcbed2c){return _0x319e82(_0xcbed2c);}return _0x24f8fb(_0xc0ba('0xe'));});});});};
\ No newline at end of file
+var _0x4e68=['restart','then','list','describe','delete','dump','saved','pm2','bluebird','./config','connect','connected','start','disconnect','stop'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4e68,0x124));var _0x84e6=function(_0xd62776,_0x37ec9e){_0xd62776=_0xd62776-0x0;var _0x26f4e4=_0x4e68[_0xd62776];return _0x26f4e4;};'use strict';var pm2=require(_0x84e6('0x0'));var BPromise=require(_0x84e6('0x1'));var config=require(_0x84e6('0x2'));function connect(){return new BPromise(function(_0x50a077,_0x35494b){return pm2[_0x84e6('0x3')](function(_0x14d9ed){if(_0x14d9ed){return _0x35494b(_0x14d9ed);}return _0x50a077(_0x84e6('0x4'));});});};exports[_0x84e6('0x5')]=function(_0x1e9d49){return connect()['then'](function(){return new BPromise(function(_0x10fdda,_0x2c8ed5){return pm2['start'](_0x1e9d49,function(_0x257b9d,_0x19758d){if(_0x257b9d){return _0x2c8ed5(_0x257b9d);}pm2[_0x84e6('0x6')]();return _0x10fdda(_0x19758d);});});});};exports[_0x84e6('0x7')]=function(_0x2162d1){return connect()['then'](function(){return new BPromise(function(_0x381619,_0x38dfec){return pm2[_0x84e6('0x7')](_0x2162d1,function(_0x1a2d60,_0x42038b){if(_0x1a2d60){return _0x38dfec(_0x1a2d60);}pm2[_0x84e6('0x6')]();return _0x381619(_0x42038b);});});});};exports[_0x84e6('0x8')]=function(_0x1c0133){return connect()[_0x84e6('0x9')](function(){return new BPromise(function(_0x29765a,_0x222038){return pm2[_0x84e6('0x8')](_0x1c0133,function(_0x3cc179,_0x3cccc5){if(_0x3cc179){return _0x222038(_0x3cc179);}pm2[_0x84e6('0x6')]();return _0x29765a(_0x3cccc5);});});});};exports[_0x84e6('0xa')]=function(){return connect()[_0x84e6('0x9')](function(){return new BPromise(function(_0x94254e,_0x43535d){return pm2['list'](function(_0x4d99ee,_0x57f3db){if(_0x4d99ee){return _0x43535d(_0x4d99ee);}pm2[_0x84e6('0x6')]();return _0x94254e(_0x57f3db);});});});};exports[_0x84e6('0xb')]=function(_0x5f2f9f){return connect()[_0x84e6('0x9')](function(){return new BPromise(function(_0x4d05d5,_0x27d406){return pm2['describe'](_0x5f2f9f,function(_0x2a5ae7,_0x5c81c1){if(_0x2a5ae7){return _0x27d406(_0x2a5ae7);}pm2['disconnect']();return _0x4d05d5(_0x5c81c1);});});});};exports[_0x84e6('0xc')]=function(_0x1d8845){return connect()[_0x84e6('0x9')](function(){return new BPromise(function(_0x3d82a0,_0x2e036f){return pm2[_0x84e6('0xc')](_0x1d8845,function(_0x1fa669,_0x2eef72){if(_0x1fa669){return _0x2e036f(_0x1fa669);}pm2['disconnect']();return _0x3d82a0(_0x2eef72);});});});};exports[_0x84e6('0xd')]=function(){return connect()[_0x84e6('0x9')](function(){return new BPromise(function(_0x22ee5c,_0x72d65a){return pm2['dump'](function(_0x1badbb){if(_0x1badbb){return _0x72d65a(_0x1badbb);}return _0x22ee5c(_0x84e6('0xe'));});});});};
\ No newline at end of file
index 1b34f27..afb32ec 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb78c=['update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','error','inspect','lodash','moment','ioredis','util','../../config/environment','schedule','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','length','map','[CHAT]\x20Interactions\x20to\x20close:','join'];(function(_0x41296d,_0x38f0b6){var _0x1dbcfa=function(_0x5dd763){while(--_0x5dd763){_0x41296d['push'](_0x41296d['shift']());}};_0x1dbcfa(++_0x38f0b6);}(_0xb78c,0x19d));var _0xcb78=function(_0x1ebd10,_0x4914b4){_0x1ebd10=_0x1ebd10-0x0;var _0x1004d3=_0xb78c[_0x1ebd10];return _0x1004d3;};'use strict';var _=require(_0xcb78('0x0'));var moment=require(_0xcb78('0x1'));var Redis=require(_0xcb78('0x2'));var util=require(_0xcb78('0x3'));var config=require(_0xcb78('0x4'));var db=require('../../mysqldb')['db'];var logger=require('../logger')(_0xcb78('0x5'));config[_0xcb78('0x6')]=_[_0xcb78('0x7')](config[_0xcb78('0x6')],{'host':_0xcb78('0x8'),'port':0x18eb});var io=require(_0xcb78('0x9'))(new Redis(config[_0xcb78('0x6')]));function closeInteractions(){var _0x50c799=0x0;var _0x2d2412=[];return db[_0xcb78('0xa')][_0xcb78('0xb')]({'raw':!![],'attributes':['id',_0xcb78('0xc')],'where':{'id':0x1}})[_0xcb78('0xd')](function(_0x15e963){_0x50c799=_0x15e963[_0xcb78('0xc')];if(_0x50c799){return db[_0xcb78('0xe')][_0xcb78('0xf')]({'raw':!![],'attributes':['id',_0xcb78('0x10')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x15e963['chatTimeout'],'minutes')}}});}else{return[];}})[_0xcb78('0xd')](function(_0x166ab9){if(_0x166ab9&&_0x166ab9[_0xcb78('0x11')]){_0x2d2412=_[_0xcb78('0x12')](_0x166ab9||[],'id');logger['info'](_0xcb78('0x13'),_0x2d2412[_0xcb78('0x14')]());return db[_0xcb78('0xe')][_0xcb78('0x15')]({'closeReason':_0xcb78('0x16'),'disposition':_0xcb78('0x17'),'closed':!![],'closedAt':moment()[_0xcb78('0x18')](_0xcb78('0x19'))},{'where':{'id':_0x2d2412}});}})['then'](function(){if(_0x2d2412&&_0x2d2412[_0xcb78('0x11')]){logger[_0xcb78('0x1a')](_0xcb78('0x1b'),_0x2d2412[_0xcb78('0x14')]());for(var _0x281139=0x0;_0x281139<_0x2d2412[_0xcb78('0x11')];_0x281139++){io[_0xcb78('0x1c')]('chatInteraction:update',{'id':_0x2d2412[_0x281139],'closed':!![]});}}})['catch'](function(_0x464e32){logger[_0xcb78('0x1d')]('[CHAT]\x20Error\x20closing\x20interactions',_0x464e32?util[_0xcb78('0x1e')](_0x464e32,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0xd8b6=['inspect','start','lodash','moment','ioredis','../../config/environment','../../mysqldb','../logger','redis','defaults','localhost','socket.io-emitter','Setting','find','chatTimeout','then','findAll','lastMsgAt','minutes','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','system','format','YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions'];(function(_0x4cab1e,_0xfc5cde){var _0x1a8cd8=function(_0x2ce2b6){while(--_0x2ce2b6){_0x4cab1e['push'](_0x4cab1e['shift']());}};_0x1a8cd8(++_0xfc5cde);}(_0xd8b6,0xc8));var _0x6d8b=function(_0x45cc01,_0x2e635a){_0x45cc01=_0x45cc01-0x0;var _0x349d47=_0xd8b6[_0x45cc01];return _0x349d47;};'use strict';var _=require(_0x6d8b('0x0'));var moment=require(_0x6d8b('0x1'));var Redis=require(_0x6d8b('0x2'));var util=require('util');var config=require(_0x6d8b('0x3'));var db=require(_0x6d8b('0x4'))['db'];var logger=require(_0x6d8b('0x5'))('schedule');config[_0x6d8b('0x6')]=_[_0x6d8b('0x7')](config['redis'],{'host':_0x6d8b('0x8'),'port':0x18eb});var io=require(_0x6d8b('0x9'))(new Redis(config[_0x6d8b('0x6')]));function closeInteractions(){var _0x494441=0x0;var _0x1021f8=[];return db[_0x6d8b('0xa')][_0x6d8b('0xb')]({'raw':!![],'attributes':['id',_0x6d8b('0xc')],'where':{'id':0x1}})[_0x6d8b('0xd')](function(_0x46eb28){_0x494441=_0x46eb28['chatTimeout'];if(_0x494441){return db['ChatInteraction'][_0x6d8b('0xe')]({'raw':!![],'attributes':['id',_0x6d8b('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x46eb28[_0x6d8b('0xc')],_0x6d8b('0x10'))}}});}else{return[];}})[_0x6d8b('0xd')](function(_0x5b928e){if(_0x5b928e&&_0x5b928e['length']){_0x1021f8=_[_0x6d8b('0x11')](_0x5b928e||[],'id');logger[_0x6d8b('0x12')](_0x6d8b('0x13'),_0x1021f8[_0x6d8b('0x14')]());return db[_0x6d8b('0x15')][_0x6d8b('0x16')]({'closeReason':_0x6d8b('0x17'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x6d8b('0x18')](_0x6d8b('0x19'))},{'where':{'id':_0x1021f8}});}})[_0x6d8b('0xd')](function(){if(_0x1021f8&&_0x1021f8[_0x6d8b('0x1a')]){logger[_0x6d8b('0x12')](_0x6d8b('0x1b'),_0x1021f8[_0x6d8b('0x14')]());for(var _0x419863=0x0;_0x419863<_0x1021f8[_0x6d8b('0x1a')];_0x419863++){io['emit'](_0x6d8b('0x1c'),{'id':_0x1021f8[_0x419863],'closed':!![]});}}})['catch'](function(_0x486290){logger[_0x6d8b('0x1d')](_0x6d8b('0x1e'),_0x486290?util[_0x6d8b('0x1f')](_0x486290,{'showHidden':![],'depth':null}):'');});}exports[_0x6d8b('0x20')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index d6275f3..0473497 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb523=['join','../../files/reports','%s.%s','basename','zip','existsSync','status','Sent','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','message','sendIfEmpty','request','SendMail','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','map','toString','keyBy','intersection','difference','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','run\x20job','active','isBetween','endAt','add','cron','start','add\x20cron','stop\x20cron','startAt','update','run','util','path','lodash','moment','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','info','Try\x20to\x20send\x20a\x20mail\x20to','email','Smtp','service','MailAccount','host','port','secure','pass','name','user','format','subtractNumber'];(function(_0x19ebf9,_0x10282f){var _0x3a3702=function(_0x3c6bf3){while(--_0x3c6bf3){_0x19ebf9['push'](_0x19ebf9['shift']());}};_0x3a3702(++_0x10282f);}(_0xb523,0xec));var _0x3b52=function(_0x33d549,_0x5f500a){_0x33d549=_0x33d549-0x0;var _0x64760b=_0xb523[_0x33d549];return _0x64760b;};'use strict';var fs=require('fs');var util=require(_0x3b52('0x0'));var path=require(_0x3b52('0x1'));var _=require(_0x3b52('0x2'));var moment=require(_0x3b52('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x3b52('0x4'))(_0x3b52('0x5'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x3b52('0x6'));var analyticDefaultReportController=require(_0x3b52('0x7'));var client=jayson['client']['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x15f6a9,_0x27446d){return function(){logger[_0x3b52('0x8')](_0x3b52('0x9'),_0x15f6a9[_0x3b52('0xa')]);var _0x2da597=!![];var _0x535c6c={'tls':{'rejectUnauthorized':![]}};if(_0x15f6a9['MailAccount'][_0x3b52('0xb')]['service']){_0x535c6c[_0x3b52('0xc')]=_0x15f6a9[_0x3b52('0xd')][_0x3b52('0xb')][_0x3b52('0xc')];}else{_0x535c6c[_0x3b52('0xe')]=_0x15f6a9['MailAccount'][_0x3b52('0xb')][_0x3b52('0xe')];_0x535c6c[_0x3b52('0xf')]=_0x15f6a9[_0x3b52('0xd')]['Smtp']['port'];_0x535c6c[_0x3b52('0x10')]=_0x15f6a9[_0x3b52('0xd')][_0x3b52('0xb')][_0x3b52('0x10')];}if(_0x15f6a9[_0x3b52('0xd')][_0x3b52('0xb')]['authentication']){_0x535c6c['auth']={'user':_0x15f6a9[_0x3b52('0xd')][_0x3b52('0xb')]['user'],'pass':_0x15f6a9[_0x3b52('0xd')][_0x3b52('0xb')][_0x3b52('0x11')]};}var _0x481375={'account':_0x535c6c,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x15f6a9['MailAccount'][_0x3b52('0x12')],_0x15f6a9[_0x3b52('0xd')]['email']||_0x15f6a9[_0x3b52('0xd')][_0x3b52('0xb')][_0x3b52('0x13')]),'to':_0x15f6a9[_0x3b52('0xa')],'cc':_0x15f6a9['cc'],'bcc':_0x15f6a9['bcc'],'subject':util[_0x3b52('0x14')]('Report\x20%s\x20last\x20%s\x20%s',_0x27446d[_0x3b52('0x12')],_0x15f6a9[_0x3b52('0x15')],_0x15f6a9['subtractUnit'])}};var _0x37db3d=path[_0x3b52('0x16')](__dirname,_0x3b52('0x17'));var _0x3fdb6e=_0x27446d['savename'];var _0x42866a=util[_0x3b52('0x14')](_0x3b52('0x18'),path[_0x3b52('0x19')](_0x27446d['savename'],path['extname'](_0x27446d['savename'])),_0x3b52('0x1a'));var _0x553f40=path[_0x3b52('0x16')](_0x37db3d,_0x3fdb6e);var _0x400170=path[_0x3b52('0x16')](_0x37db3d,_0x42866a);if(fs[_0x3b52('0x1b')](_0x553f40)){_0x27446d[_0x3b52('0x1c')]=_0x3b52('0x1d');_0x481375['message']['attachments']=[{'filename':_0x3fdb6e,'path':_0x553f40}];_0x481375['message'][_0x3b52('0x1e')]=util[_0x3b52('0x14')](_0x3b52('0x1f'),JSON[_0x3b52('0x20')](_0x27446d,null,0x2));}else if(fs[_0x3b52('0x1b')](_0x400170)){_0x27446d['status']=_0x3b52('0x1d');_0x481375['message']['attachments']=[{'filename':_0x42866a,'path':_0x400170}];}else{_0x481375[_0x3b52('0x21')]['text']='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x15f6a9[_0x3b52('0x22')]){_0x2da597=![];logger[_0x3b52('0x8')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x2da597){return client[_0x3b52('0x23')](_0x3b52('0x24'),_0x481375)[_0x3b52('0x25')](function(_0xbb9163){if(_0xbb9163[_0x3b52('0x26')]){return logger['error'](_0x3b52('0x27'),JSON[_0x3b52('0x20')](_0xbb9163));}return logger[_0x3b52('0x8')](_0x3b52('0x28'));})[_0x3b52('0x29')](function(_0x3c084d){return logger['error'](_0x3b52('0x27'),JSON[_0x3b52('0x20')](_0x3c084d));});}};}function handleError(){return function(_0x346ea0){return logger[_0x3b52('0x26')](JSON[_0x3b52('0x20')](_0x346ea0));};}function handleResult(_0x5404ff){return function(_0x2c6657){logger[_0x3b52('0x8')](_0x3b52('0x2a'),JSON[_0x3b52('0x20')](_0x2c6657));if(_0x5404ff[_0x3b52('0xd')]&&_0x5404ff[_0x3b52('0xd')][_0x3b52('0xb')]&&!_[_0x3b52('0x2b')](_0x5404ff['email'])){setTimeout(handleSendEmail(_0x5404ff,_0x2c6657),0x3c*0x3e8);}};}function handleJob(_0xddf8e8){return function(){try{if(_[_0x3b52('0x2b')](_0xddf8e8[_0x3b52('0x15')])){return logger[_0x3b52('0x8')](_0x3b52('0x2c'));}if(_[_0x3b52('0x2b')](_0xddf8e8[_0x3b52('0x2d')])){return logger[_0x3b52('0x8')](_0x3b52('0x2e'));}var _0x98b50b={'startDate':moment()[_0x3b52('0x2f')](_0xddf8e8[_0x3b52('0x15')],_0xddf8e8[_0x3b52('0x2d')])[_0x3b52('0x14')](_0x3b52('0x30')),'endDate':moment()[_0x3b52('0x14')](_0x3b52('0x30')),'type':_0x3b52('0x31'),'output':_0xddf8e8[_0x3b52('0x32')],'name':_0xddf8e8['name']};if(!_[_0x3b52('0x2b')](_0xddf8e8['DefaultReportId'])){logger[_0x3b52('0x8')](_0x3b52('0x33'),_0xddf8e8[_0x3b52('0x34')]);return analyticDefaultReportController[_0x3b52('0x35')]({'id':_0xddf8e8['DefaultReportId']},_0x98b50b)[_0x3b52('0x25')](handleResult(_0xddf8e8))[_0x3b52('0x29')](handleError());}if(!_[_0x3b52('0x2b')](_0xddf8e8[_0x3b52('0x36')])){logger[_0x3b52('0x8')](_0x3b52('0x37'),_0xddf8e8[_0x3b52('0x36')]);return analyticCustomReportController[_0x3b52('0x35')]({'id':_0xddf8e8[_0x3b52('0x36')]},_0x98b50b)[_0x3b52('0x25')](handleResult(_0xddf8e8))[_0x3b52('0x29')](handleError());}}catch(_0x4df68c){logger[_0x3b52('0x26')](JSON['stringify'](_0x4df68c));}return logger[_0x3b52('0x8')](_0x3b52('0x38'));};}function getJobs(_0xd18e15){var _0xfb0f14={};if(_0xd18e15){_0xfb0f14['id']=_0xd18e15;}return db[_0x3b52('0x39')][_0x3b52('0x3a')]({'where':_0xfb0f14,'include':[{'model':db[_0x3b52('0xd')],'attributes':['id','name',_0x3b52('0xa')],'include':[{'model':db[_0x3b52('0x3b')],'as':_0x3b52('0xb')}]}]})[_0x3b52('0x25')](function(_0x488ea5){var _0x4a014b=_[_0x3b52('0x3c')](manager['jobs']);var _0x1af23e=_[_0x3b52('0x3d')](_0x488ea5,function(_0x18c78a){return _0x18c78a['id'][_0x3b52('0x3e')]();});var _0x2fbb0c=_[_0x3b52('0x3f')](_0x488ea5,function(_0x199de8){return _0x199de8['id'][_0x3b52('0x3e')]();});var _0x1ac4b8=_0xd18e15?_0x1af23e:_['difference'](_0x1af23e,_0x4a014b);var _0x24b81f=_[_0x3b52('0x40')](_0x1af23e,_0x4a014b);var _0x2a9a11=_[_0x3b52('0x41')](_0x4a014b,_0x1af23e);var _0x1f8303;var _0xe195e2;for(_0x1f8303=0x0;_0x1f8303<_0x2a9a11[_0x3b52('0x42')]&&!_0xd18e15;_0x1f8303+=0x1){_0xe195e2=_0x2a9a11[_0x1f8303][_0x3b52('0x3e')]();if(manager[_0x3b52('0x43')](_0xe195e2)){manager[_0x3b52('0x44')](_0xe195e2);manager[_0x3b52('0x45')](_0xe195e2);logger[_0x3b52('0x8')](_0x3b52('0x46'),_0xe195e2);}}logger[_0x3b52('0x8')](_0x3b52('0x47'),JSON[_0x3b52('0x20')](_0x1ac4b8));for(_0x1f8303=0x0;_0x1f8303<_0x1ac4b8[_0x3b52('0x42')];_0x1f8303+=0x1){_0xe195e2=_0x1ac4b8[_0x1f8303][_0x3b52('0x3e')]();logger[_0x3b52('0x8')](_0x3b52('0x48'),_0xe195e2);if(_0xd18e15){logger[_0x3b52('0x8')](_0x3b52('0x49'),_0xd18e15);logger[_0x3b52('0x8')](JSON[_0x3b52('0x20')](_0x2fbb0c[_0xe195e2]));BPromise['resolve']()[_0x3b52('0x25')](handleJob(_0x2fbb0c[_0xe195e2]));logger[_0x3b52('0x8')](_0x3b52('0x4a'),_0x2fbb0c[_0xe195e2][_0x3b52('0x12')],_0x2fbb0c[_0xe195e2]['cron']);}else if(_0x2fbb0c[_0xe195e2]['cron']&&_0x2fbb0c[_0xe195e2][_0x3b52('0x4b')]&&moment()[_0x3b52('0x4c')](_0x2fbb0c[_0xe195e2]['startAt'],_0x2fbb0c[_0xe195e2][_0x3b52('0x4d')])){manager[_0x3b52('0x4e')](_0xe195e2,_0x2fbb0c[_0xe195e2][_0x3b52('0x4f')],handleJob(_0x2fbb0c[_0xe195e2]));manager[_0x3b52('0x50')](_0xe195e2);logger['info'](_0x3b52('0x51'),_0x2fbb0c[_0xe195e2]['name'],_0x2fbb0c[_0xe195e2][_0x3b52('0x4f')]);}else if(manager[_0x3b52('0x43')](_0xe195e2)){manager[_0x3b52('0x44')](_0xe195e2);manager[_0x3b52('0x45')](_0xe195e2);logger['info'](_0x3b52('0x52'),_0x2fbb0c[_0xe195e2]['name'],_0x2fbb0c[_0xe195e2]['cron']);}}for(_0x1f8303=0x0,_0xe195e2;_0x1f8303<_0x24b81f[_0x3b52('0x42')]&&!_0xd18e15;_0x1f8303+=0x1){_0xe195e2=_0x24b81f[_0x1f8303][_0x3b52('0x3e')]();if(manager[_0x3b52('0x43')](_0xe195e2)){if(_0x2fbb0c[_0xe195e2][_0x3b52('0x4f')]&&_0x2fbb0c[_0xe195e2][_0x3b52('0x4b')]&&moment()['isBetween'](_0x2fbb0c[_0xe195e2][_0x3b52('0x53')],_0x2fbb0c[_0xe195e2][_0x3b52('0x4d')])){manager[_0x3b52('0x54')](_0xe195e2,_0x2fbb0c[_0xe195e2][_0x3b52('0x4f')],handleJob(_0x2fbb0c[_0xe195e2]));logger['info']('update\x20cron',_0x2fbb0c[_0xe195e2]['name'],_0x2fbb0c[_0xe195e2][_0x3b52('0x4f')]);}else{manager[_0x3b52('0x44')](_0xe195e2);manager['deleteJob'](_0xe195e2);logger['info']('stop\x20cron',_0x2fbb0c[_0xe195e2]['name'],_0x2fbb0c[_0xe195e2]['cron']);}}}})[_0x3b52('0x29')](function(_0x5cb66c){logger[_0x3b52('0x26')](JSON[_0x3b52('0x20')](_0x5cb66c));});}exports[_0x3b52('0x55')]=function(_0x13d4fb){return getJobs(_0x13d4fb);};exports[_0x3b52('0x50')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
+var _0x0b65=['MailServerOut','keys','toString','keyBy','difference','intersection','length','exists','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','start','add\x20cron','stop','deleteJob','stop\x20cron','update','update\x20cron','run','path','lodash','moment','cron-job-manager','jayson/promise','../logger','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','MailAccount','Smtp','service','host','port','secure','authentication','auth','format','name','email','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','../../files/reports','savename','extname','existsSync','attachments','message','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','status','Sent','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','error\x20mail','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','subtract','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','findAll'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x0b65,0x6d));var _0x50b6=function(_0x2d57f8,_0x4f36bc){_0x2d57f8=_0x2d57f8-0x0;var _0x1c63a6=_0x0b65[_0x2d57f8];return _0x1c63a6;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x50b6('0x0'));var _=require(_0x50b6('0x1'));var moment=require(_0x50b6('0x2'));var CronJobManager=require(_0x50b6('0x3'));var jayson=require(_0x50b6('0x4'));var BPromise=require('bluebird');var logger=require(_0x50b6('0x5'))('schedule');var db=require('../../mysqldb')['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x50b6('0x6'));var client=jayson['client'][_0x50b6('0x7')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x324818,_0x50a102){return function(){logger[_0x50b6('0x8')](_0x50b6('0x9'),_0x324818['email']);var _0x5b2126=!![];var _0x117bc9={'tls':{'rejectUnauthorized':![]}};if(_0x324818[_0x50b6('0xa')][_0x50b6('0xb')][_0x50b6('0xc')]){_0x117bc9[_0x50b6('0xc')]=_0x324818[_0x50b6('0xa')][_0x50b6('0xb')][_0x50b6('0xc')];}else{_0x117bc9[_0x50b6('0xd')]=_0x324818[_0x50b6('0xa')]['Smtp'][_0x50b6('0xd')];_0x117bc9[_0x50b6('0xe')]=_0x324818[_0x50b6('0xa')][_0x50b6('0xb')][_0x50b6('0xe')];_0x117bc9[_0x50b6('0xf')]=_0x324818['MailAccount'][_0x50b6('0xb')][_0x50b6('0xf')];}if(_0x324818['MailAccount'][_0x50b6('0xb')][_0x50b6('0x10')]){_0x117bc9[_0x50b6('0x11')]={'user':_0x324818[_0x50b6('0xa')][_0x50b6('0xb')]['user'],'pass':_0x324818[_0x50b6('0xa')][_0x50b6('0xb')]['pass']};}var _0x3f58b0={'account':_0x117bc9,'message':{'from':util[_0x50b6('0x12')]('\x22%s\x22\x20<%s>',_0x324818[_0x50b6('0xa')][_0x50b6('0x13')],_0x324818[_0x50b6('0xa')][_0x50b6('0x14')]||_0x324818[_0x50b6('0xa')]['Smtp'][_0x50b6('0x15')]),'to':_0x324818[_0x50b6('0x14')],'cc':_0x324818['cc'],'bcc':_0x324818[_0x50b6('0x16')],'subject':util[_0x50b6('0x12')](_0x50b6('0x17'),_0x50a102['name'],_0x324818[_0x50b6('0x18')],_0x324818['subtractUnit'])}};var _0x4ae9c7=path[_0x50b6('0x19')](__dirname,_0x50b6('0x1a'));var _0x4df70a=_0x50a102[_0x50b6('0x1b')];var _0x23ff98=util[_0x50b6('0x12')]('%s.%s',path['basename'](_0x50a102[_0x50b6('0x1b')],path[_0x50b6('0x1c')](_0x50a102[_0x50b6('0x1b')])),'zip');var _0x3ba86b=path[_0x50b6('0x19')](_0x4ae9c7,_0x4df70a);var _0x4f0d77=path[_0x50b6('0x19')](_0x4ae9c7,_0x23ff98);if(fs[_0x50b6('0x1d')](_0x3ba86b)){_0x50a102['status']='Sent';_0x3f58b0['message'][_0x50b6('0x1e')]=[{'filename':_0x4df70a,'path':_0x3ba86b}];_0x3f58b0[_0x50b6('0x1f')]['text']=util['format'](_0x50b6('0x20'),JSON[_0x50b6('0x21')](_0x50a102,null,0x2));}else if(fs[_0x50b6('0x1d')](_0x4f0d77)){_0x50a102[_0x50b6('0x22')]=_0x50b6('0x23');_0x3f58b0[_0x50b6('0x1f')]['attachments']=[{'filename':_0x23ff98,'path':_0x4f0d77}];}else{_0x3f58b0[_0x50b6('0x1f')][_0x50b6('0x24')]=_0x50b6('0x25');if(!_0x324818['sendIfEmpty']){_0x5b2126=![];logger[_0x50b6('0x8')](_0x50b6('0x26'));}}if(_0x5b2126){return client['request'](_0x50b6('0x27'),_0x3f58b0)[_0x50b6('0x28')](function(_0x2a1806){if(_0x2a1806['error']){return logger[_0x50b6('0x29')](_0x50b6('0x2a'),JSON[_0x50b6('0x21')](_0x2a1806));}return logger[_0x50b6('0x8')]('email\x20sent');})[_0x50b6('0x2b')](function(_0xf0839b){return logger['error'](_0x50b6('0x2a'),JSON['stringify'](_0xf0839b));});}};}function handleError(){return function(_0x1e2645){return logger[_0x50b6('0x29')](JSON['stringify'](_0x1e2645));};}function handleResult(_0x2ae659){return function(_0xea548a){logger[_0x50b6('0x8')](_0x50b6('0x2c'),JSON['stringify'](_0xea548a));if(_0x2ae659[_0x50b6('0xa')]&&_0x2ae659[_0x50b6('0xa')][_0x50b6('0xb')]&&!_[_0x50b6('0x2d')](_0x2ae659[_0x50b6('0x14')])){setTimeout(handleSendEmail(_0x2ae659,_0xea548a),0x3c*0x3e8);}};}function handleJob(_0x1860b4){return function(){try{if(_[_0x50b6('0x2d')](_0x1860b4['subtractNumber'])){return logger[_0x50b6('0x8')](_0x50b6('0x2e'));}if(_[_0x50b6('0x2d')](_0x1860b4[_0x50b6('0x2f')])){return logger[_0x50b6('0x8')](_0x50b6('0x30'));}var _0x4fab3d={'startDate':moment()[_0x50b6('0x31')](_0x1860b4[_0x50b6('0x18')],_0x1860b4[_0x50b6('0x2f')])[_0x50b6('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x50b6('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x50b6('0x32'),'output':_0x1860b4[_0x50b6('0x33')],'name':_0x1860b4[_0x50b6('0x13')]};if(!_[_0x50b6('0x2d')](_0x1860b4[_0x50b6('0x34')])){logger['info'](_0x50b6('0x35'),_0x1860b4[_0x50b6('0x34')]);return analyticDefaultReportController[_0x50b6('0x36')]({'id':_0x1860b4[_0x50b6('0x34')]},_0x4fab3d)[_0x50b6('0x28')](handleResult(_0x1860b4))[_0x50b6('0x2b')](handleError());}if(!_[_0x50b6('0x2d')](_0x1860b4[_0x50b6('0x37')])){logger[_0x50b6('0x8')](_0x50b6('0x38'),_0x1860b4[_0x50b6('0x37')]);return analyticCustomReportController[_0x50b6('0x36')]({'id':_0x1860b4['CustomReportId']},_0x4fab3d)[_0x50b6('0x28')](handleResult(_0x1860b4))['catch'](handleError());}}catch(_0x68fac6){logger['error'](JSON[_0x50b6('0x21')](_0x68fac6));}return logger['info'](_0x50b6('0x39'));};}function getJobs(_0x603d35){var _0x168742={};if(_0x603d35){_0x168742['id']=_0x603d35;}return db['Schedule'][_0x50b6('0x3a')]({'where':_0x168742,'include':[{'model':db[_0x50b6('0xa')],'attributes':['id',_0x50b6('0x13'),_0x50b6('0x14')],'include':[{'model':db[_0x50b6('0x3b')],'as':_0x50b6('0xb')}]}]})[_0x50b6('0x28')](function(_0x4fcb75){var _0x284d0c=_[_0x50b6('0x3c')](manager['jobs']);var _0x204be9=_['map'](_0x4fcb75,function(_0x32d25d){return _0x32d25d['id'][_0x50b6('0x3d')]();});var _0x4238f5=_[_0x50b6('0x3e')](_0x4fcb75,function(_0x1359e2){return _0x1359e2['id'][_0x50b6('0x3d')]();});var _0x28d263=_0x603d35?_0x204be9:_[_0x50b6('0x3f')](_0x204be9,_0x284d0c);var _0x6ac883=_[_0x50b6('0x40')](_0x204be9,_0x284d0c);var _0x1dfe6c=_[_0x50b6('0x3f')](_0x284d0c,_0x204be9);var _0xb72d37;var _0x595dad;for(_0xb72d37=0x0;_0xb72d37<_0x1dfe6c[_0x50b6('0x41')]&&!_0x603d35;_0xb72d37+=0x1){_0x595dad=_0x1dfe6c[_0xb72d37][_0x50b6('0x3d')]();if(manager[_0x50b6('0x42')](_0x595dad)){manager['stop'](_0x595dad);manager['deleteJob'](_0x595dad);logger[_0x50b6('0x8')]('delete\x20cron',_0x595dad);}}logger[_0x50b6('0x8')]('toRun',JSON[_0x50b6('0x21')](_0x28d263));for(_0xb72d37=0x0;_0xb72d37<_0x28d263[_0x50b6('0x41')];_0xb72d37+=0x1){_0x595dad=_0x28d263[_0xb72d37][_0x50b6('0x3d')]();logger[_0x50b6('0x8')]('index',_0x595dad);if(_0x603d35){logger[_0x50b6('0x8')](_0x50b6('0x43'),_0x603d35);logger['info'](JSON[_0x50b6('0x21')](_0x4238f5[_0x595dad]));BPromise[_0x50b6('0x44')]()[_0x50b6('0x28')](handleJob(_0x4238f5[_0x595dad]));logger[_0x50b6('0x8')](_0x50b6('0x45'),_0x4238f5[_0x595dad][_0x50b6('0x13')],_0x4238f5[_0x595dad][_0x50b6('0x46')]);}else if(_0x4238f5[_0x595dad][_0x50b6('0x46')]&&_0x4238f5[_0x595dad][_0x50b6('0x47')]&&moment()[_0x50b6('0x48')](_0x4238f5[_0x595dad][_0x50b6('0x49')],_0x4238f5[_0x595dad][_0x50b6('0x4a')])){manager[_0x50b6('0x4b')](_0x595dad,_0x4238f5[_0x595dad][_0x50b6('0x46')],handleJob(_0x4238f5[_0x595dad]));manager[_0x50b6('0x4c')](_0x595dad);logger[_0x50b6('0x8')](_0x50b6('0x4d'),_0x4238f5[_0x595dad][_0x50b6('0x13')],_0x4238f5[_0x595dad][_0x50b6('0x46')]);}else if(manager['exists'](_0x595dad)){manager[_0x50b6('0x4e')](_0x595dad);manager[_0x50b6('0x4f')](_0x595dad);logger[_0x50b6('0x8')](_0x50b6('0x50'),_0x4238f5[_0x595dad][_0x50b6('0x13')],_0x4238f5[_0x595dad][_0x50b6('0x46')]);}}for(_0xb72d37=0x0,_0x595dad;_0xb72d37<_0x6ac883[_0x50b6('0x41')]&&!_0x603d35;_0xb72d37+=0x1){_0x595dad=_0x6ac883[_0xb72d37][_0x50b6('0x3d')]();if(manager[_0x50b6('0x42')](_0x595dad)){if(_0x4238f5[_0x595dad][_0x50b6('0x46')]&&_0x4238f5[_0x595dad][_0x50b6('0x47')]&&moment()['isBetween'](_0x4238f5[_0x595dad][_0x50b6('0x49')],_0x4238f5[_0x595dad]['endAt'])){manager[_0x50b6('0x51')](_0x595dad,_0x4238f5[_0x595dad]['cron'],handleJob(_0x4238f5[_0x595dad]));logger[_0x50b6('0x8')](_0x50b6('0x52'),_0x4238f5[_0x595dad]['name'],_0x4238f5[_0x595dad]['cron']);}else{manager['stop'](_0x595dad);manager[_0x50b6('0x4f')](_0x595dad);logger['info']('stop\x20cron',_0x4238f5[_0x595dad][_0x50b6('0x13')],_0x4238f5[_0x595dad][_0x50b6('0x46')]);}}}})['catch'](function(_0x55f237){logger[_0x50b6('0x29')](JSON[_0x50b6('0x21')](_0x55f237));});}exports[_0x50b6('0x53')]=function(_0x241fc2){return getJobs(_0x241fc2);};exports[_0x50b6('0x4c')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();};
\ No newline at end of file
index 3090ba4..12716ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7980=['../../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','results','transcripts','length','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','bucket','ValidationError','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','sentimentRegion','language','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','SentimentScore','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Negative','catch','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','Setting','Settings\x20not\x20available','Transcribe\x20not\x20configured','transcribeAccountId','all','error','start','lodash','aws-sdk','util','bluebird','../../mysqldb'];(function(_0x567c8f,_0x5226a9){var _0x5dd537=function(_0x3ca83f){while(--_0x3ca83f){_0x567c8f['push'](_0x567c8f['shift']());}};_0x5dd537(++_0x5226a9);}(_0x7980,0x123));var _0x0798=function(_0x5a83b1,_0x29f9c8){_0x5a83b1=_0x5a83b1-0x0;var _0x3943b7=_0x7980[_0x5a83b1];return _0x3943b7;};var _=require(_0x0798('0x0'));var AWS=require(_0x0798('0x1'));var rp=require('request-promise');var util=require(_0x0798('0x2'));var BPromise=require(_0x0798('0x3'));var db=require(_0x0798('0x4'))['db'];var logger=require(_0x0798('0x5'))(_0x0798('0x6'));function getTranscriptionJob(_0x43fa79,_0x119a23,_0xa50ea,_0x5568e9){return new Promise(function(_0x12ea59,_0x22a15f){var _0x429cea=new AWS[(_0x0798('0x7'))]({'accessKeyId':_0x119a23,'secretAccessKey':_0x43fa79,'region':_0xa50ea});_0x429cea[_0x0798('0x8')]({'TranscriptionJobName':_0x5568e9},function(_0x6d2904,_0x51b4c1){if(_0x6d2904){return _0x22a15f(_0x6d2904);}else{return _0x12ea59(_0x51b4c1);}});});}function sentiment(_0x34acae,_0x42f8dc,_0x772259,_0x2524a4,_0xf2c8dc){return new Promise(function(_0x393e71,_0x329189){var _0x218b3f=new AWS[(_0x0798('0x9'))]({'accessKeyId':_0x42f8dc,'secretAccessKey':_0x34acae,'region':_0x772259});_0x218b3f[_0x0798('0xa')]({'Text':_0x2524a4,'LanguageCode':_0xf2c8dc[_0x0798('0xb')](0x0,0x2)},function(_0x2e582c,_0x5a5710){if(_0x2e582c){return _0x329189(_0x2e582c);}else{return _0x393e71(_0x5a5710);}});});}function checkTranscribeJob(_0x1db338,_0x549e25,_0x24bbcf){var _0x5c2bc7;return new BPromise(function(_0x1134fc,_0x539d47){logger[_0x0798('0xc')](util[_0x0798('0xd')](_0x0798('0xe'),_0x1db338['id'],_0x1db338[_0x0798('0xf')]));return getTranscriptionJob(_0x24bbcf[_0x0798('0x10')],_0x24bbcf[_0x0798('0x11')],_0x549e25[_0x0798('0x12')],_0x1db338[_0x0798('0xf')])[_0x0798('0x13')](function(_0xe435f7){logger[_0x0798('0xc')](util[_0x0798('0xd')](_0x0798('0x14'),_0x1db338['id'],_0x1db338[_0x0798('0xf')],_0xe435f7[_0x0798('0x15')][_0x0798('0x16')]));if(!_0x1db338[_0x0798('0x17')]){switch(_0xe435f7[_0x0798('0x15')]['TranscriptionJobStatus']){case _0x0798('0x18'):var _0x101221={'transcribeStatus':_0xe435f7[_0x0798('0x15')][_0x0798('0x16')],'fileUri':_0xe435f7[_0x0798('0x15')][_0x0798('0x19')]['TranscriptFileUri']};logger[_0x0798('0xc')](util['format'](_0x0798('0x1a'),_0x1db338['id']));return rp({'uri':_0xe435f7['TranscriptionJob']['Transcript'][_0x0798('0x1b')],'json':!![]})[_0x0798('0x13')](function(_0x12e5e6){logger[_0x0798('0xc')](util[_0x0798('0xd')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x1db338['id']));if(_0x12e5e6&&_0x12e5e6[_0x0798('0x1c')]&&_0x12e5e6['results'][_0x0798('0x1d')]&&_0x12e5e6['results'][_0x0798('0x1d')][_0x0798('0x1e')]){_0x101221[_0x0798('0x17')]='';for(var _0x4cd9c0=0x0;_0x4cd9c0<_0x12e5e6[_0x0798('0x1c')]['transcripts'][_0x0798('0x1e')];_0x4cd9c0++){_0x101221[_0x0798('0x17')]+=_0x12e5e6[_0x0798('0x1c')][_0x0798('0x1d')][_0x4cd9c0]['transcript']+'';}}return _0x1db338[_0x0798('0x1f')](_0x101221);})['then'](function(){logger[_0x0798('0xc')](util[_0x0798('0xd')](_0x0798('0x20'),_0x1db338['id']));if(!_0x1db338['tempSentiment']){throw new db[(_0x0798('0x21'))]['ValidationError'](_0x0798('0x22'));}if(!_0x549e25[_0x0798('0x23')]||!_0x549e25[_0x0798('0x24')]||!_0x549e25['sentimentRegion']||!_0x549e25['language']||!_0x549e25[_0x0798('0x25')]){throw new db[(_0x0798('0x21'))][(_0x0798('0x26'))](_0x0798('0x27'));}if(!_0x101221['fileText']){throw new Error(_0x0798('0x28'));}if(_0x549e25[_0x0798('0x24')]===_0x24bbcf['id']){return _0x24bbcf;}else{return db[_0x0798('0x29')][_0x0798('0x2a')]({'where':{'id':_settings[_0x0798('0x24')]}});}})[_0x0798('0x13')](function(_0x372237){if(!_0x372237){throw new db[(_0x0798('0x21'))][(_0x0798('0x26'))](_0x0798('0x2b'));}if(!_0x372237['data1']||!_0x372237[_0x0798('0x11')]){throw new db[(_0x0798('0x21'))][(_0x0798('0x26'))]('Cloud\x20Provider\x20not\x20configured');}_0x5c2bc7=_0x372237;logger[_0x0798('0xc')](util[_0x0798('0xd')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x1db338['id']));return sentiment(_0x5c2bc7[_0x0798('0x10')],_0x5c2bc7[_0x0798('0x11')],_0x549e25[_0x0798('0x2c')],_0x101221[_0x0798('0x17')],_0x549e25[_0x0798('0x2d')]);})[_0x0798('0x13')](function(_0x1c3751){logger[_0x0798('0xc')](util[_0x0798('0xd')](_0x0798('0x2e'),_0x1db338['id']));return _0x1db338['update']({'sentiment':_0x1c3751[_0x0798('0x2f')],'sPositive':_0x1c3751['SentimentScore'][_0x0798('0x30')],'sNegative':_0x1c3751['SentimentScore']['Negative'],'sMixed':_0x1c3751[_0x0798('0x31')][_0x0798('0x32')],'sNeutral':_0x1c3751[_0x0798('0x31')][_0x0798('0x33')]});})[_0x0798('0x13')](function(){logger[_0x0798('0xc')](util['format'](_0x0798('0x20'),_0x1db338['id']));_0x1134fc();});case'FAILED':return _0x1db338[_0x0798('0x1f')]({'transcribeStatus':_0x0798('0x34'),'failureReason':_0xe435f7['TranscriptionJob'][_0x0798('0x35')]})[_0x0798('0x13')](function(){logger[_0x0798('0xc')](util[_0x0798('0xd')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1db338['id']));_0x1134fc();});default:logger['info'](util['format'](_0x0798('0x36'),_0x1db338['id']));break;}}else{return BPromise[_0x0798('0x37')]()[_0x0798('0x13')](function(){if(!_0x1db338[_0x0798('0x38')]){throw new db[(_0x0798('0x21'))][(_0x0798('0x26'))](_0x0798('0x22'));}if(!_0x549e25['sentiment']||!_0x549e25[_0x0798('0x24')]||!_0x549e25[_0x0798('0x2c')]||!_0x549e25['language']||!_0x549e25[_0x0798('0x25')]){throw new db[(_0x0798('0x21'))]['ValidationError'](_0x0798('0x27'));}if(!_0x1db338[_0x0798('0x17')]){throw new Error(_0x0798('0x28'));}if(_0x549e25[_0x0798('0x24')]===_0x24bbcf['id']){return _0x24bbcf;}else{return db['CloudProvider'][_0x0798('0x2a')]({'where':{'id':_settings[_0x0798('0x24')]}});}})['then'](function(_0x412fcd){if(!_0x412fcd){throw new db['Sequelize'][(_0x0798('0x26'))](_0x0798('0x2b'));}if(!_0x412fcd[_0x0798('0x10')]||!_0x412fcd[_0x0798('0x11')]){throw new db[(_0x0798('0x21'))]['ValidationError'](_0x0798('0x39'));}_0x5c2bc7=_0x412fcd;logger[_0x0798('0xc')](util[_0x0798('0xd')](_0x0798('0x3a'),_0x1db338['id']));return sentiment(_0x5c2bc7[_0x0798('0x10')],_0x5c2bc7[_0x0798('0x11')],_0x549e25[_0x0798('0x2c')],_0x1db338['fileText'],_0x549e25['language']);})[_0x0798('0x13')](function(_0x1a614f){logger[_0x0798('0xc')](util[_0x0798('0xd')](_0x0798('0x2e'),_0x1db338['id']));return _0x1db338[_0x0798('0x1f')]({'sentiment':_0x1a614f[_0x0798('0x2f')],'sPositive':_0x1a614f[_0x0798('0x31')][_0x0798('0x30')],'sNegative':_0x1a614f[_0x0798('0x31')][_0x0798('0x3b')],'sMixed':_0x1a614f[_0x0798('0x31')]['Mixed'],'sNeutral':_0x1a614f[_0x0798('0x31')][_0x0798('0x33')],'transcribeStatus':_0x0798('0x18')});})[_0x0798('0x13')](function(){logger[_0x0798('0xc')](util[_0x0798('0xd')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x1db338['id']));_0x1134fc();});}})[_0x0798('0x3c')](function(_0x45c9b4){if(_0x45c9b4){if(!_0x45c9b4[_0x0798('0x3d')]||_0x45c9b4[_0x0798('0x3d')]!==_0x0798('0x3e')){logger['error'](util[_0x0798('0xd')](_0x0798('0x3f'),_0x1db338['id']),util[_0x0798('0x40')](_0x45c9b4,{'showHidden':![],'depth':null}));}}_0x1134fc();});});}function checkTranscribe(){var _0x52abc9;var _0x6cd0f7;var _0x2b0cd1;return db['VoiceRecording'][_0x0798('0x41')]({'where':{'transcribeStatus':_0x0798('0x42')}})[_0x0798('0x13')](function(_0x1453d7){if(!_0x1453d7||!_0x1453d7['length']){throw new db[(_0x0798('0x21'))]['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x52abc9=_0x1453d7;return db[_0x0798('0x43')][_0x0798('0x2a')]({'where':{'id':0x1}});})[_0x0798('0x13')](function(_0x2be108){if(!_0x2be108){throw new db['Sequelize'][(_0x0798('0x26'))](_0x0798('0x44'));}_0x6cd0f7=_0x2be108;if(!_0x6cd0f7['transcribe']||!_0x6cd0f7['transcribeAccountId']||!_0x6cd0f7[_0x0798('0x12')]||!_0x6cd0f7[_0x0798('0x2d')]||!_0x6cd0f7['bucket']){throw new db['Sequelize'][(_0x0798('0x26'))](_0x0798('0x45'));}return db['CloudProvider'][_0x0798('0x2a')]({'where':{'id':_0x6cd0f7[_0x0798('0x46')]}});})[_0x0798('0x13')](function(_0x1c5643){if(!_0x1c5643){throw new db[(_0x0798('0x21'))]['ValidationError']('Cloud\x20Provider\x20not\x20available');}if(!_0x1c5643[_0x0798('0x10')]||!_0x1c5643[_0x0798('0x11')]){throw new db[(_0x0798('0x21'))]['ValidationError'](_0x0798('0x39'));}_0x2b0cd1=_0x1c5643;var _0x41d912=[];_0x52abc9['forEach'](function(_0x2d6fa7){_0x41d912['push'](checkTranscribeJob(_0x2d6fa7,_0x6cd0f7,_0x2b0cd1));});return BPromise[_0x0798('0x47')](_0x41d912);})[_0x0798('0x3c')](function(_0x2ed2e1){if(_0x2ed2e1){if(!_0x2ed2e1[_0x0798('0x3d')]||_0x2ed2e1[_0x0798('0x3d')]!==_0x0798('0x3e')){logger[_0x0798('0x48')](util[_0x0798('0x40')](_0x2ed2e1,{'showHidden':![],'depth':null}));}}});}exports[_0x0798('0x49')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
+var _0x8278=['sentiment','sentimentRegion','language','ValidationError','Transcript\x20not\x20available','sentimentAccountId','CloudProvider','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','SentimentScore','Negative','Mixed','Neutral','update','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','Sentiment\x20Analysis\x20not\x20requested','bucket','findOne','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','Positive','catch','name','SequelizeValidationError','error','inspect','VoiceRecording','findAll','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','Transcribe\x20not\x20configured','push','lodash','aws-sdk','request-promise','util','../../config/logger','transcribe','TranscribeService','getTranscriptionJob','detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','info','TranscriptionJob','TranscriptionJobStatus','COMPLETED','[RECORDING:%d]\x20Get\x20transcript','Transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','fileText','transcript','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize'];(function(_0x1e7f37,_0x1d6b90){var _0x2ae848=function(_0x15c740){while(--_0x15c740){_0x1e7f37['push'](_0x1e7f37['shift']());}};_0x2ae848(++_0x1d6b90);}(_0x8278,0x1ae));var _0x8827=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8278[_0x3dd15e];return _0x231fd0;};var _=require(_0x8827('0x0'));var AWS=require(_0x8827('0x1'));var rp=require(_0x8827('0x2'));var util=require(_0x8827('0x3'));var BPromise=require('bluebird');var db=require('../../mysqldb')['db'];var logger=require(_0x8827('0x4'))(_0x8827('0x5'));function getTranscriptionJob(_0x9a5311,_0xf4c10,_0x5b72ad,_0x400227){return new Promise(function(_0x4342d7,_0x11797a){var _0x31d236=new AWS[(_0x8827('0x6'))]({'accessKeyId':_0xf4c10,'secretAccessKey':_0x9a5311,'region':_0x5b72ad});_0x31d236[_0x8827('0x7')]({'TranscriptionJobName':_0x400227},function(_0xb78af,_0x24af1d){if(_0xb78af){return _0x11797a(_0xb78af);}else{return _0x4342d7(_0x24af1d);}});});}function sentiment(_0x117d42,_0x416ba6,_0x3c1ba6,_0x126062,_0x219264){return new Promise(function(_0x500afa,_0x2bfd74){var _0x36d32b=new AWS['Comprehend']({'accessKeyId':_0x416ba6,'secretAccessKey':_0x117d42,'region':_0x3c1ba6});_0x36d32b[_0x8827('0x8')]({'Text':_0x126062,'LanguageCode':_0x219264[_0x8827('0x9')](0x0,0x2)},function(_0x509058,_0x41bef7){if(_0x509058){return _0x2bfd74(_0x509058);}else{return _0x500afa(_0x41bef7);}});});}function checkTranscribeJob(_0x479abf,_0x4a180c,_0x2cce86){var _0x449408;return new BPromise(function(_0x83aad2,_0x2abb63){logger['info'](util[_0x8827('0xa')](_0x8827('0xb'),_0x479abf['id'],_0x479abf[_0x8827('0xc')]));return getTranscriptionJob(_0x2cce86[_0x8827('0xd')],_0x2cce86[_0x8827('0xe')],_0x4a180c[_0x8827('0xf')],_0x479abf[_0x8827('0xc')])['then'](function(_0x4456e3){logger[_0x8827('0x10')](util[_0x8827('0xa')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x479abf['id'],_0x479abf[_0x8827('0xc')],_0x4456e3[_0x8827('0x11')][_0x8827('0x12')]));if(!_0x479abf['fileText']){switch(_0x4456e3['TranscriptionJob'][_0x8827('0x12')]){case _0x8827('0x13'):var _0x5b71de={'transcribeStatus':_0x4456e3['TranscriptionJob'][_0x8827('0x12')],'fileUri':_0x4456e3['TranscriptionJob']['Transcript']['TranscriptFileUri']};logger[_0x8827('0x10')](util[_0x8827('0xa')](_0x8827('0x14'),_0x479abf['id']));return rp({'uri':_0x4456e3['TranscriptionJob'][_0x8827('0x15')]['TranscriptFileUri'],'json':!![]})[_0x8827('0x16')](function(_0x186787){logger['info'](util['format'](_0x8827('0x17'),_0x479abf['id']));if(_0x186787&&_0x186787['results']&&_0x186787[_0x8827('0x18')]['transcripts']&&_0x186787[_0x8827('0x18')][_0x8827('0x19')][_0x8827('0x1a')]){_0x5b71de['fileText']='';for(var _0x427e2f=0x0;_0x427e2f<_0x186787[_0x8827('0x18')][_0x8827('0x19')]['length'];_0x427e2f++){_0x5b71de[_0x8827('0x1b')]+=_0x186787['results'][_0x8827('0x19')][_0x427e2f][_0x8827('0x1c')]+'';}}return _0x479abf['update'](_0x5b71de);})[_0x8827('0x16')](function(){logger[_0x8827('0x10')](util[_0x8827('0xa')](_0x8827('0x1d'),_0x479abf['id']));if(!_0x479abf[_0x8827('0x1e')]){throw new db[(_0x8827('0x1f'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x4a180c[_0x8827('0x20')]||!_0x4a180c['sentimentAccountId']||!_0x4a180c[_0x8827('0x21')]||!_0x4a180c[_0x8827('0x22')]||!_0x4a180c['bucket']){throw new db['Sequelize'][(_0x8827('0x23'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x5b71de[_0x8827('0x1b')]){throw new Error(_0x8827('0x24'));}if(_0x4a180c[_0x8827('0x25')]===_0x2cce86['id']){return _0x2cce86;}else{return db[_0x8827('0x26')]['findOne']({'where':{'id':_settings[_0x8827('0x25')]}});}})['then'](function(_0x5a1888){if(!_0x5a1888){throw new db[(_0x8827('0x1f'))][(_0x8827('0x23'))](_0x8827('0x27'));}if(!_0x5a1888[_0x8827('0xd')]||!_0x5a1888['data2']){throw new db[(_0x8827('0x1f'))][(_0x8827('0x23'))](_0x8827('0x28'));}_0x449408=_0x5a1888;logger['info'](util[_0x8827('0xa')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x479abf['id']));return sentiment(_0x449408[_0x8827('0xd')],_0x449408[_0x8827('0xe')],_0x4a180c['sentimentRegion'],_0x5b71de[_0x8827('0x1b')],_0x4a180c[_0x8827('0x22')]);})['then'](function(_0x5390c9){logger[_0x8827('0x10')](util[_0x8827('0xa')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x479abf['id']));return _0x479abf['update']({'sentiment':_0x5390c9['Sentiment'],'sPositive':_0x5390c9[_0x8827('0x29')]['Positive'],'sNegative':_0x5390c9[_0x8827('0x29')][_0x8827('0x2a')],'sMixed':_0x5390c9[_0x8827('0x29')][_0x8827('0x2b')],'sNeutral':_0x5390c9[_0x8827('0x29')][_0x8827('0x2c')]});})['then'](function(){logger[_0x8827('0x10')](util[_0x8827('0xa')](_0x8827('0x1d'),_0x479abf['id']));_0x83aad2();});case'FAILED':return _0x479abf[_0x8827('0x2d')]({'transcribeStatus':_0x8827('0x2e'),'failureReason':_0x4456e3['TranscriptionJob']['FailureReason']})[_0x8827('0x16')](function(){logger[_0x8827('0x10')](util[_0x8827('0xa')](_0x8827('0x1d'),_0x479abf['id']));_0x83aad2();});default:logger[_0x8827('0x10')](util[_0x8827('0xa')](_0x8827('0x2f'),_0x479abf['id']));break;}}else{return BPromise['resolve']()[_0x8827('0x16')](function(){if(!_0x479abf['tempSentiment']){throw new db[(_0x8827('0x1f'))][(_0x8827('0x23'))](_0x8827('0x30'));}if(!_0x4a180c[_0x8827('0x20')]||!_0x4a180c[_0x8827('0x25')]||!_0x4a180c[_0x8827('0x21')]||!_0x4a180c[_0x8827('0x22')]||!_0x4a180c[_0x8827('0x31')]){throw new db[(_0x8827('0x1f'))][(_0x8827('0x23'))]('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x479abf['fileText']){throw new Error(_0x8827('0x24'));}if(_0x4a180c[_0x8827('0x25')]===_0x2cce86['id']){return _0x2cce86;}else{return db[_0x8827('0x26')][_0x8827('0x32')]({'where':{'id':_settings[_0x8827('0x25')]}});}})[_0x8827('0x16')](function(_0x2f38d7){if(!_0x2f38d7){throw new db['Sequelize']['ValidationError'](_0x8827('0x27'));}if(!_0x2f38d7['data1']||!_0x2f38d7[_0x8827('0xe')]){throw new db[(_0x8827('0x1f'))][(_0x8827('0x23'))](_0x8827('0x28'));}_0x449408=_0x2f38d7;logger[_0x8827('0x10')](util['format']('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x479abf['id']));return sentiment(_0x449408[_0x8827('0xd')],_0x449408[_0x8827('0xe')],_0x4a180c[_0x8827('0x21')],_0x479abf[_0x8827('0x1b')],_0x4a180c[_0x8827('0x22')]);})[_0x8827('0x16')](function(_0x59f0ff){logger[_0x8827('0x10')](util[_0x8827('0xa')](_0x8827('0x33'),_0x479abf['id']));return _0x479abf['update']({'sentiment':_0x59f0ff[_0x8827('0x34')],'sPositive':_0x59f0ff['SentimentScore'][_0x8827('0x35')],'sNegative':_0x59f0ff[_0x8827('0x29')][_0x8827('0x2a')],'sMixed':_0x59f0ff['SentimentScore']['Mixed'],'sNeutral':_0x59f0ff[_0x8827('0x29')]['Neutral'],'transcribeStatus':_0x8827('0x13')});})[_0x8827('0x16')](function(){logger['info'](util[_0x8827('0xa')](_0x8827('0x1d'),_0x479abf['id']));_0x83aad2();});}})[_0x8827('0x36')](function(_0x207075){if(_0x207075){if(!_0x207075[_0x8827('0x37')]||_0x207075['name']!==_0x8827('0x38')){logger[_0x8827('0x39')](util['format']('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x479abf['id']),util[_0x8827('0x3a')](_0x207075,{'showHidden':![],'depth':null}));}}_0x83aad2();});});}function checkTranscribe(){var _0x87aa7e;var _0x544ffe;var _0x361a03;return db[_0x8827('0x3b')][_0x8827('0x3c')]({'where':{'transcribeStatus':'IN_PROGRESS'}})[_0x8827('0x16')](function(_0x21b5d5){if(!_0x21b5d5||!_0x21b5d5[_0x8827('0x1a')]){throw new db[(_0x8827('0x1f'))][(_0x8827('0x23'))](_0x8827('0x3d'));}_0x87aa7e=_0x21b5d5;return db[_0x8827('0x3e')][_0x8827('0x32')]({'where':{'id':0x1}});})[_0x8827('0x16')](function(_0x3d1004){if(!_0x3d1004){throw new db[(_0x8827('0x1f'))][(_0x8827('0x23'))]('Settings\x20not\x20available');}_0x544ffe=_0x3d1004;if(!_0x544ffe[_0x8827('0x5')]||!_0x544ffe[_0x8827('0x3f')]||!_0x544ffe['transcribeRegion']||!_0x544ffe[_0x8827('0x22')]||!_0x544ffe['bucket']){throw new db[(_0x8827('0x1f'))][(_0x8827('0x23'))](_0x8827('0x40'));}return db[_0x8827('0x26')][_0x8827('0x32')]({'where':{'id':_0x544ffe[_0x8827('0x3f')]}});})[_0x8827('0x16')](function(_0x104496){if(!_0x104496){throw new db[(_0x8827('0x1f'))][(_0x8827('0x23'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x104496['data1']||!_0x104496[_0x8827('0xe')]){throw new db[(_0x8827('0x1f'))][(_0x8827('0x23'))](_0x8827('0x28'));}_0x361a03=_0x104496;var _0x4d01a6=[];_0x87aa7e['forEach'](function(_0x583dfc){_0x4d01a6[_0x8827('0x41')](checkTranscribeJob(_0x583dfc,_0x544ffe,_0x361a03));});return BPromise['all'](_0x4d01a6);})['catch'](function(_0x404604){if(_0x404604){if(!_0x404604['name']||_0x404604[_0x8827('0x37')]!==_0x8827('0x38')){logger[_0x8827('0x39')](util[_0x8827('0x3a')](_0x404604,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();};
\ No newline at end of file
index d05fcf8..97a864d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfa03=['lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','defaults','redis','localhost','socket.io-emitter','findAll','lastMsgAt','subtract','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','WhatsappInteraction','update','system','timeout','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect'];(function(_0x10dab0,_0x7537ac){var _0x263cde=function(_0x1139ec){while(--_0x1139ec){_0x10dab0['push'](_0x10dab0['shift']());}};_0x263cde(++_0x7537ac);}(_0xfa03,0xba));var _0x3fa0=function(_0x3aad16,_0x1c4969){_0x3aad16=_0x3aad16-0x0;var _0x3dc1ba=_0xfa03[_0x3aad16];return _0x3dc1ba;};'use strict';var _=require(_0x3fa0('0x0'));var moment=require(_0x3fa0('0x1'));var Redis=require(_0x3fa0('0x2'));var util=require(_0x3fa0('0x3'));var config=require(_0x3fa0('0x4'));var db=require(_0x3fa0('0x5'))['db'];var logger=require(_0x3fa0('0x6'))(_0x3fa0('0x7'));config['redis']=_[_0x3fa0('0x8')](config[_0x3fa0('0x9')],{'host':_0x3fa0('0xa'),'port':0x18eb});var io=require(_0x3fa0('0xb'))(new Redis(config[_0x3fa0('0x9')]));function closeInteractions(){var _0x914332=[];return db['WhatsappInteraction'][_0x3fa0('0xc')]({'raw':!![],'attributes':['id',_0x3fa0('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x3fa0('0xe')](0x18,'hours')}}})[_0x3fa0('0xf')](function(_0x3b7ff5){if(_0x3b7ff5&&_0x3b7ff5[_0x3fa0('0x10')]){_0x914332=_[_0x3fa0('0x11')](_0x3b7ff5||[],'id');logger[_0x3fa0('0x12')](_0x3fa0('0x13'),_0x914332['join']());return db[_0x3fa0('0x14')][_0x3fa0('0x15')]({'closeReason':_0x3fa0('0x16'),'disposition':_0x3fa0('0x17'),'closed':!![],'closedAt':moment()['format'](_0x3fa0('0x18'))},{'where':{'id':_0x914332}});}})[_0x3fa0('0xf')](function(){if(_0x914332&&_0x914332['length']){logger[_0x3fa0('0x12')](_0x3fa0('0x19'),_0x914332['join']());for(var _0x277988=0x0;_0x277988<_0x914332['length'];_0x277988++){io[_0x3fa0('0x1a')](_0x3fa0('0x1b'),{'id':_0x914332[_0x277988],'closed':!![]});}}})[_0x3fa0('0x1c')](function(_0x412e3a){logger['error'](_0x3fa0('0x1d'),_0x412e3a?util[_0x3fa0('0x1e')](_0x412e3a,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
+var _0x1d39=['length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','schedule','redis','localhost','socket.io-emitter','WhatsappInteraction','findAll','lastMsgAt','subtract','hours','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then'];(function(_0x29f2aa,_0x1c8536){var _0x27b347=function(_0x3543c6){while(--_0x3543c6){_0x29f2aa['push'](_0x29f2aa['shift']());}};_0x27b347(++_0x1c8536);}(_0x1d39,0x108));var _0x91d3=function(_0x9d5442,_0x33e9ab){_0x9d5442=_0x9d5442-0x0;var _0x5331b1=_0x1d39[_0x9d5442];return _0x5331b1;};'use strict';var _=require(_0x91d3('0x0'));var moment=require(_0x91d3('0x1'));var Redis=require(_0x91d3('0x2'));var util=require(_0x91d3('0x3'));var config=require(_0x91d3('0x4'));var db=require(_0x91d3('0x5'))['db'];var logger=require('../logger')(_0x91d3('0x6'));config[_0x91d3('0x7')]=_['defaults'](config['redis'],{'host':_0x91d3('0x8'),'port':0x18eb});var io=require(_0x91d3('0x9'))(new Redis(config[_0x91d3('0x7')]));function closeInteractions(){var _0x159243=[];return db[_0x91d3('0xa')][_0x91d3('0xb')]({'raw':!![],'attributes':['id',_0x91d3('0xc')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x91d3('0xd')](0x18,_0x91d3('0xe'))}}})['then'](function(_0x11aefa){if(_0x11aefa&&_0x11aefa['length']){_0x159243=_[_0x91d3('0xf')](_0x11aefa||[],'id');logger[_0x91d3('0x10')](_0x91d3('0x11'),_0x159243[_0x91d3('0x12')]());return db[_0x91d3('0xa')]['update']({'closeReason':_0x91d3('0x13'),'disposition':_0x91d3('0x14'),'closed':!![],'closedAt':moment()[_0x91d3('0x15')](_0x91d3('0x16'))},{'where':{'id':_0x159243}});}})[_0x91d3('0x17')](function(){if(_0x159243&&_0x159243[_0x91d3('0x18')]){logger[_0x91d3('0x10')](_0x91d3('0x19'),_0x159243[_0x91d3('0x12')]());for(var _0x294785=0x0;_0x294785<_0x159243['length'];_0x294785++){io[_0x91d3('0x1a')](_0x91d3('0x1b'),{'id':_0x159243[_0x294785],'closed':!![]});}}})[_0x91d3('0x1c')](function(_0x593ad4){logger[_0x91d3('0x1d')](_0x91d3('0x1e'),_0x593ad4?util[_0x91d3('0x1f')](_0x593ad4,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();};
\ No newline at end of file
index 0846fd1..21b3997 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6d3=['now','Biondo','then','CmContact','bulkCreate','log','finished\x20populating','contacts1','destroy','CmHopper','hopper1','contacts2','hopper2','util','../mysqldb','push','Innocenzo','innocenzo.biondo','@xcally.com'];(function(_0x2ed395,_0x24323b){var _0x14a5eb=function(_0x12a09b){while(--_0x12a09b){_0x2ed395['push'](_0x2ed395['shift']());}};_0x14a5eb(++_0x24323b);}(_0xc6d3,0xf1));var _0x3c6d=function(_0x4fc0c6,_0x48b1b8){_0x4fc0c6=_0x4fc0c6-0x0;var _0x1e0e5e=_0xc6d3[_0x4fc0c6];return _0x1e0e5e;};'use strict';var util=require(_0x3c6d('0x0'));var db=require(_0x3c6d('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x3c6d('0x2')]({'id':i,'firstName':_0x3c6d('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x3c6d('0x4')+i+_0x3c6d('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x3c6d('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x3c6d('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3c6d('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x3c6d('0x3')+i,'lastName':_0x3c6d('0x7')+i,'phone':0xf879fb460+i,'email':_0x3c6d('0x4')+i+_0x3c6d('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x3c6d('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x3c6d('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x3c6d('0x6')](),'updatedAt':Date['now']()});}db['CmContact']['destroy']({'where':{}})[_0x3c6d('0x8')](function(){return db[_0x3c6d('0x9')][_0x3c6d('0xa')](contacts);})[_0x3c6d('0x8')](function(){console[_0x3c6d('0xb')](_0x3c6d('0xc'),_0x3c6d('0xd'));return db['CmHopper'][_0x3c6d('0xe')]({'where':{}});})[_0x3c6d('0x8')](function(){return db[_0x3c6d('0xf')]['bulkCreate'](hopper);})['then'](function(){console[_0x3c6d('0xb')](_0x3c6d('0xc'),_0x3c6d('0x10'));return db[_0x3c6d('0x9')][_0x3c6d('0xa')](contacts2);})[_0x3c6d('0x8')](function(){console[_0x3c6d('0xb')](_0x3c6d('0xc'),_0x3c6d('0x11'));return db[_0x3c6d('0xf')][_0x3c6d('0xa')](hopper2);})[_0x3c6d('0x8')](function(){console['log'](_0x3c6d('0xc'),_0x3c6d('0x12'));})['catch'](function(_0x5e6fde){console[_0x3c6d('0xb')](_0x5e6fde);});
\ No newline at end of file
+var _0x3a44=['../mysqldb','Innocenzo','Biondo','innocenzo.biondo','push','now','@xcally.com','CmContact','destroy','then','finished\x20populating','contacts1','CmHopper','bulkCreate','log','hopper1','contacts2','util'];(function(_0x1e91eb,_0x5829a3){var _0x2af75a=function(_0x1815d1){while(--_0x1815d1){_0x1e91eb['push'](_0x1e91eb['shift']());}};_0x2af75a(++_0x5829a3);}(_0x3a44,0xc5));var _0x43a4=function(_0x2eb5fc,_0x113a9f){_0x2eb5fc=_0x2eb5fc-0x0;var _0x479695=_0x3a44[_0x2eb5fc];return _0x479695;};'use strict';var util=require(_0x43a4('0x0'));var db=require(_0x43a4('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x43a4('0x2')+i,'lastName':_0x43a4('0x3')+i,'phone':0xf879fb460+i,'email':_0x43a4('0x4')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x43a4('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x43a4('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x43a4('0x6')](),'updatedAt':Date[_0x43a4('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x43a4('0x5')]({'id':i,'firstName':_0x43a4('0x2')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x43a4('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x43a4('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x43a4('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}db[_0x43a4('0x8')][_0x43a4('0x9')]({'where':{}})['then'](function(){return db[_0x43a4('0x8')]['bulkCreate'](contacts);})[_0x43a4('0xa')](function(){console['log'](_0x43a4('0xb'),_0x43a4('0xc'));return db['CmHopper'][_0x43a4('0x9')]({'where':{}});})[_0x43a4('0xa')](function(){return db[_0x43a4('0xd')][_0x43a4('0xe')](hopper);})['then'](function(){console[_0x43a4('0xf')](_0x43a4('0xb'),_0x43a4('0x10'));return db[_0x43a4('0x8')][_0x43a4('0xe')](contacts2);})[_0x43a4('0xa')](function(){console['log'](_0x43a4('0xb'),_0x43a4('0x11'));return db['CmHopper'][_0x43a4('0xe')](hopper2);})['then'](function(){console[_0x43a4('0xf')]('finished\x20populating','hopper2');})['catch'](function(_0x238a9f){console[_0x43a4('0xf')](_0x238a9f);});
\ No newline at end of file
index f86ee18..a181a39 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2d4=['push','%s%s','agent','format','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','bulkCreate','then','log','add\x20user','util','../mysqldb'];(function(_0x4b824a,_0x275d05){var _0x3779ab=function(_0x3de4e5){while(--_0x3de4e5){_0x4b824a['push'](_0x4b824a['shift']());}};_0x3779ab(++_0x275d05);}(_0xe2d4,0x17a));var _0x4e2d=function(_0x24bc09,_0x294f72){_0x24bc09=_0x24bc09-0x0;var _0x2431c8=_0xe2d4[_0x24bc09];return _0x2431c8;};'use strict';var util=require(_0x4e2d('0x0'));var db=require(_0x4e2d('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x4e2d('0x2')]({'name':util['format'](_0x4e2d('0x3'),_0x4e2d('0x4'),i),'fullname':util[_0x4e2d('0x5')](_0x4e2d('0x3'),_0x4e2d('0x4'),i),'email':util[_0x4e2d('0x5')]('%s%s@xcally.com',_0x4e2d('0x4'),i),'role':_0x4e2d('0x4'),'password':_0x4e2d('0x6'),'internal':0xfa0+i,'type':_0x4e2d('0x7'),'transport':[_0x4e2d('0x8'),'ws',_0x4e2d('0x9')],'disallow':[_0x4e2d('0xa')],'allow':[_0x4e2d('0xb')],'defaultuser':util[_0x4e2d('0x5')]('%s%s',_0x4e2d('0x4'),i),'encryption':_0x4e2d('0xc'),'avpf':'yes','force_avp':'yes','icesupport':'yes','dtlsenable':_0x4e2d('0xc'),'dtlsverify':'no','dtlscertfile':_0x4e2d('0xd'),'dtlsprivatekey':_0x4e2d('0xe'),'dtlssetup':_0x4e2d('0xf'),'callerid':util[_0x4e2d('0x5')]('\x22%s\x22\x20<%s>',util[_0x4e2d('0x5')](_0x4e2d('0x3'),_0x4e2d('0x4'),i),0xfa0+i)});}db['User'][_0x4e2d('0x10')](users)[_0x4e2d('0x11')](function(){console[_0x4e2d('0x12')](_0x4e2d('0x13'));})['catch'](function(_0x2ec2c8){console[_0x4e2d('0x12')](_0x2ec2c8);});
\ No newline at end of file
+var _0x5936=['add\x20user','catch','../mysqldb','agent','format','%s%s','%s%s@xcally.com','password','friend','udp','wss','yes','actpass','\x22%s\x22\x20<%s>','bulkCreate','then','log'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x5936,0xdf));var _0x6593=function(_0x32c96f,_0xb17361){_0x32c96f=_0x32c96f-0x0;var _0x4b977b=_0x5936[_0x32c96f];return _0x4b977b;};'use strict';var util=require('util');var db=require(_0x6593('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format']('%s%s',_0x6593('0x1'),i),'fullname':util[_0x6593('0x2')](_0x6593('0x3'),_0x6593('0x1'),i),'email':util[_0x6593('0x2')](_0x6593('0x4'),_0x6593('0x1'),i),'role':_0x6593('0x1'),'password':_0x6593('0x5'),'internal':0xfa0+i,'type':_0x6593('0x6'),'transport':[_0x6593('0x7'),'ws',_0x6593('0x8')],'disallow':['all'],'allow':['ulaw'],'defaultuser':util[_0x6593('0x2')](_0x6593('0x3'),_0x6593('0x1'),i),'encryption':_0x6593('0x9'),'avpf':_0x6593('0x9'),'force_avp':_0x6593('0x9'),'icesupport':_0x6593('0x9'),'dtlsenable':_0x6593('0x9'),'dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x6593('0xa'),'callerid':util[_0x6593('0x2')](_0x6593('0xb'),util[_0x6593('0x2')](_0x6593('0x3'),_0x6593('0x1'),i),0xfa0+i)});}db['User'][_0x6593('0xc')](users)[_0x6593('0xd')](function(){console[_0x6593('0xe')](_0x6593('0xf'));})[_0x6593('0x10')](function(_0x25b0e3){console['log'](_0x25b0e3);});
\ No newline at end of file
index ec3d545..4c1019f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39e6=['MailInteraction','FaxInteraction','FaxInteractions','SmsInteraction','OpenchannelInteraction','WhatsappInteraction','voice:inbound','voice:outbound','include','push','VoiceQueue','FaxQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','ChatQueue','SmsQueue','Telephones','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','all','voice','chat','fax','mail','openchannel','whatsapp','trunk:%s','campaign:%s:%s','removeChatInteractions','emit','leave','MailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','WhatsappInteractions','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','log','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','SocketIO\x20','nsp','disconnect','DISCONNECTED','CONNECTED','lodash','bluebird','name','Agents','role','agent','telephone','type','ivr','UserProfileSection','findOne','then','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Trunks','IvrCampaigns','UserProfileResource','map','User','Campaign','where','format','%s:queue:%s','length','user:%s','handshake','find','userProfileId','query','ChatInteraction','ChatInteractions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x39e6,0x9e));var _0x639e=function(_0x5c95fb,_0x4ded42){_0x5c95fb=_0x5c95fb-0x0;var _0xbae5b3=_0x39e6[_0x5c95fb];return _0xbae5b3;};'use strict';var _=require(_0x639e('0x0'));var util=require('util');var BPromise=require(_0x639e('0x1'));var db=require('../mysqldb')['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x639e('0x2')],'include':[{'as':_0x639e('0x3'),'model':db['User'],'attributes':['id',_0x639e('0x2'),_0x639e('0x4')],'raw':!![],'where':{'role':_0x639e('0x5')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x639e('0x2')],'where':{'role':_0x639e('0x6')}};var queryTrunks={'raw':!![],'attributes':['id',_0x639e('0x2')]};var queryAgents={'raw':!![],'attributes':['id',_0x639e('0x2')],'where':{'role':_0x639e('0x5')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x639e('0x2'),_0x639e('0x7')],'where':{'type':_0x639e('0x8')}};function getAssociatedResources(_0x2fab76,_0x2a6749,_0x4410d4){return db[_0x639e('0x9')][_0x639e('0xa')]({'where':{'name':_0x2fab76,'userProfileId':_0x2a6749},'raw':!![]})[_0x639e('0xb')](function(_0x3834a6){if(_0x3834a6){if(_0x3834a6['autoAssociation']){switch(_0x2fab76){case'VoiceQueues':case _0x639e('0xc'):case _0x639e('0xd'):case _0x639e('0xe'):case _0x639e('0xf'):case _0x639e('0x10'):case _0x639e('0x11'):return db[_0x4410d4][_0x639e('0x12')](queryQueues);case'Telephones':return db[_0x4410d4]['findAll'](queryTelephones);case _0x639e('0x13'):return db[_0x4410d4][_0x639e('0x12')](queryTrunks);case _0x639e('0x14'):return db[_0x4410d4][_0x639e('0x12')](queryCampaigns);}}else{return db[_0x639e('0x15')][_0x639e('0x12')]({'attributes':['resourceId'],'where':{'sectionId':_0x3834a6['id']},'raw':!![]})[_0x639e('0xb')](function(_0x20bfbb){if(_0x20bfbb){var _0x23f0f9={'where':{'id':_[_0x639e('0x16')](_0x20bfbb,'resourceId')},'raw':!![]};switch(_0x4410d4){case _0x639e('0x17'):_0x23f0f9['where'][_0x639e('0x4')]=_0x639e('0x6');break;case _0x639e('0x18'):_0x23f0f9[_0x639e('0x19')][_0x639e('0x7')]=_0x639e('0x8');break;}return db[_0x4410d4]['findAll'](_0x23f0f9);}else{return[];}});}}else{return[];}})[_0x639e('0xb')](function(_0x34baca){return _0x34baca;});}function joinOrLeaveQueues(_0x36f71d,_0x1da55e,_0x59f772,_0x28e05e){_0x36f71d[_0x1da55e](util[_0x639e('0x1a')](_0x639e('0x1b'),_0x59f772,_0x28e05e[_0x639e('0x2')]));if(_0x28e05e[_0x639e('0x3')]){for(var _0x50de77=0x0;_0x50de77<_0x28e05e[_0x639e('0x3')][_0x639e('0x1c')];_0x50de77+=0x1){_0x36f71d[_0x1da55e](util['format'](_0x639e('0x1d'),_0x28e05e['Agents'][_0x50de77]['name']));}}}function joinOrLeave(_0x224d52,_0x3813f6,_0x3ab673){var _0x24e1ad;if(_0x224d52[_0x639e('0x1e')]['query']['id']){db[_0x639e('0x17')][_0x639e('0x1f')]({'attributes':['id',_0x639e('0x2'),_0x639e('0x4'),_0x639e('0x20')],'where':{'id':_0x224d52['handshake'][_0x639e('0x21')]['id']},'include':[{'model':db[_0x639e('0x22')],'as':_0x639e('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x639e('0x24')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x639e('0x25')],'as':_0x639e('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x639e('0x27')],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x639e('0x28')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x639e('0x29')],'as':'WhatsappInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0x2c8e3a){if(_0x2c8e3a){_0x24e1ad=_0x2c8e3a;_0x224d52[_0x3813f6](util[_0x639e('0x1a')](_0x639e('0x1d'),_0x2c8e3a[_0x639e('0x2')]));var _0x412176=[];switch(_0x2c8e3a[_0x639e('0x4')]){case'admin':_0x224d52[_0x3813f6](_0x639e('0x2a'));_0x224d52[_0x3813f6](_0x639e('0x2b'));if(queryQueues['hasOwnProperty']('include')){delete queryQueues[_0x639e('0x2c')];}_0x412176[_0x639e('0x2d')](db[_0x639e('0x2e')]['findAll'](queryQueues));_0x412176[_0x639e('0x2d')](db['ChatQueue'][_0x639e('0x12')](queryQueues));_0x412176[_0x639e('0x2d')](db[_0x639e('0x2f')]['findAll'](queryQueues));_0x412176[_0x639e('0x2d')](db['SmsQueue'][_0x639e('0x12')](queryQueues));_0x412176[_0x639e('0x2d')](db[_0x639e('0x30')]['findAll'](queryQueues));_0x412176[_0x639e('0x2d')](db[_0x639e('0x31')][_0x639e('0x12')](queryQueues));_0x412176['push'](db[_0x639e('0x32')]['findAll'](queryQueues));_0x412176[_0x639e('0x2d')](db[_0x639e('0x17')][_0x639e('0x12')](queryTelephones));_0x412176[_0x639e('0x2d')](db[_0x639e('0x33')]['findAll'](queryTrunks));_0x412176[_0x639e('0x2d')](db[_0x639e('0x18')][_0x639e('0x12')](queryCampaigns));_0x412176[_0x639e('0x2d')](db['User'][_0x639e('0x12')](queryAgents));break;case _0x639e('0x34'):_0x224d52[_0x3813f6](_0x639e('0x2a'));_0x224d52[_0x3813f6]('voice:outbound');_0x412176[_0x639e('0x2d')](getAssociatedResources('VoiceQueues',_0x2c8e3a[_0x639e('0x20')],_0x639e('0x2e')));_0x412176[_0x639e('0x2d')](getAssociatedResources(_0x639e('0xc'),_0x2c8e3a[_0x639e('0x20')],_0x639e('0x35')));_0x412176['push'](getAssociatedResources(_0x639e('0xd'),_0x2c8e3a[_0x639e('0x20')],'FaxQueue'));_0x412176[_0x639e('0x2d')](getAssociatedResources('SmsQueues',_0x2c8e3a[_0x639e('0x20')],_0x639e('0x36')));_0x412176[_0x639e('0x2d')](getAssociatedResources(_0x639e('0xf'),_0x2c8e3a[_0x639e('0x20')],_0x639e('0x30')));_0x412176[_0x639e('0x2d')](getAssociatedResources(_0x639e('0x10'),_0x2c8e3a['userProfileId'],'OpenchannelQueue'));_0x412176['push'](getAssociatedResources('WhatsappQueues',_0x2c8e3a[_0x639e('0x20')],_0x639e('0x32')));_0x412176['push'](getAssociatedResources(_0x639e('0x37'),_0x2c8e3a[_0x639e('0x20')],_0x639e('0x17')));_0x412176['push'](getAssociatedResources(_0x639e('0x13'),_0x2c8e3a[_0x639e('0x20')],_0x639e('0x33')));_0x412176[_0x639e('0x2d')](getAssociatedResources(_0x639e('0x14'),_0x2c8e3a[_0x639e('0x20')],_0x639e('0x18')));_0x412176[_0x639e('0x2d')](db[_0x639e('0x17')]['findAll'](queryAgents));break;case _0x639e('0x5'):_0x224d52[_0x3813f6](_0x639e('0x2a'));_0x224d52[_0x3813f6](_0x639e('0x2b'));_0x412176[_0x639e('0x2d')](_0x2c8e3a[_0x639e('0x38')]({'attributes':['id',_0x639e('0x2')]}));_0x412176['push'](_0x2c8e3a[_0x639e('0x39')]({'attributes':['id',_0x639e('0x2')]}));_0x412176[_0x639e('0x2d')](_0x2c8e3a[_0x639e('0x3a')]({'attributes':['id',_0x639e('0x2')]}));_0x412176[_0x639e('0x2d')](_0x2c8e3a[_0x639e('0x3b')]({'attributes':['id',_0x639e('0x2')]}));_0x412176[_0x639e('0x2d')](_0x2c8e3a[_0x639e('0x3c')]({'attributes':['id',_0x639e('0x2')]}));_0x412176[_0x639e('0x2d')](_0x2c8e3a['getOpenchannelQueues']({'attributes':['id',_0x639e('0x2')]}));_0x412176['push'](_0x2c8e3a['getWhatsappQueues']({'attributes':['id',_0x639e('0x2')]}));break;}return BPromise[_0x639e('0x3d')](_0x412176);}})[_0x639e('0xb')](function(_0x47620d){if(_0x47620d&&_0x47620d[_0x639e('0x1c')]){for(var _0x5b27b6=0x0;_0x5b27b6<_0x47620d[_0x639e('0x1c')];_0x5b27b6+=0x1){for(var _0x1fa830=0x0;_0x1fa830<_0x47620d[_0x5b27b6]['length'];_0x1fa830+=0x1){switch(_0x5b27b6){case 0x0:joinOrLeaveQueues(_0x224d52,_0x3813f6,_0x639e('0x3e'),_0x47620d[_0x5b27b6][_0x1fa830]);break;case 0x1:joinOrLeaveQueues(_0x224d52,_0x3813f6,_0x639e('0x3f'),_0x47620d[_0x5b27b6][_0x1fa830]);break;case 0x2:joinOrLeaveQueues(_0x224d52,_0x3813f6,_0x639e('0x40'),_0x47620d[_0x5b27b6][_0x1fa830]);break;case 0x3:joinOrLeaveQueues(_0x224d52,_0x3813f6,'sms',_0x47620d[_0x5b27b6][_0x1fa830]);break;case 0x4:joinOrLeaveQueues(_0x224d52,_0x3813f6,_0x639e('0x41'),_0x47620d[_0x5b27b6][_0x1fa830]);break;case 0x5:joinOrLeaveQueues(_0x224d52,_0x3813f6,_0x639e('0x42'),_0x47620d[_0x5b27b6][_0x1fa830]);break;case 0x6:joinOrLeaveQueues(_0x224d52,_0x3813f6,_0x639e('0x43'),_0x47620d[_0x5b27b6][_0x1fa830]);break;case 0x7:if(_0x24e1ad[_0x639e('0x4')]!=='agent')_0x224d52[_0x3813f6](util[_0x639e('0x1a')]('telephone:%s',_0x47620d[_0x5b27b6][_0x1fa830][_0x639e('0x2')]));break;case 0x8:if(_0x24e1ad['role']!==_0x639e('0x5'))_0x224d52[_0x3813f6](util[_0x639e('0x1a')](_0x639e('0x44'),_0x47620d[_0x5b27b6][_0x1fa830][_0x639e('0x2')]));break;case 0x9:if(_0x24e1ad[_0x639e('0x4')]!=='agent')_0x224d52[_0x3813f6](util[_0x639e('0x1a')](_0x639e('0x45'),_0x47620d[_0x5b27b6][_0x1fa830][_0x639e('0x7')],_0x47620d[_0x5b27b6][_0x1fa830]['name']));break;case 0xa:_0x224d52[_0x3813f6](util[_0x639e('0x1a')](_0x639e('0x1d'),_0x47620d[_0x5b27b6][_0x1fa830][_0x639e('0x2')]));break;}}}}})[_0x639e('0xb')](function(){if(_0x3813f6==='leave'){var _0xb7afb8=_['map'](_0x24e1ad[_0x639e('0x23')],'id');return _0x24e1ad[_0x639e('0x46')](_0xb7afb8)[_0x639e('0xb')](function(){for(var _0x555629=0x0;_0x555629<_0xb7afb8['length'];_0x555629+=0x1){_0x3ab673[_0x639e('0x47')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0xb7afb8[_0x555629]),'UserId':Number(_0x24e1ad['id'])});}});}})['then'](function(){if(_0x3813f6===_0x639e('0x48')){var _0x1e9278=_[_0x639e('0x16')](_0x24e1ad[_0x639e('0x49')],'id');return _0x24e1ad['removeMailInteractions'](_0x1e9278)[_0x639e('0xb')](function(){for(var _0x9f3c5c=0x0;_0x9f3c5c<_0x1e9278[_0x639e('0x1c')];_0x9f3c5c+=0x1){_0x3ab673['emit'](_0x639e('0x4a'),{'MailInteractionId':Number(_0x1e9278[_0x9f3c5c]),'UserId':Number(_0x24e1ad['id'])});}});}})[_0x639e('0xb')](function(){if(_0x3813f6===_0x639e('0x48')){var _0x3c22a8=_[_0x639e('0x16')](_0x24e1ad[_0x639e('0x26')],'id');return _0x24e1ad[_0x639e('0x4b')](_0x3c22a8)['then'](function(){for(var _0x349cc6=0x0;_0x349cc6<_0x3c22a8[_0x639e('0x1c')];_0x349cc6+=0x1){_0x3ab673[_0x639e('0x47')](_0x639e('0x4c'),{'FaxInteractionId':Number(_0x3c22a8[_0x349cc6]),'UserId':Number(_0x24e1ad['id'])});}});}})['then'](function(){if(_0x3813f6===_0x639e('0x48')){var _0x29ee94=_[_0x639e('0x16')](_0x24e1ad['SmsInteractions'],'id');return _0x24e1ad['removeSmsInteractions'](_0x29ee94)['then'](function(){for(var _0x151cbe=0x0;_0x151cbe<_0x29ee94[_0x639e('0x1c')];_0x151cbe+=0x1){_0x3ab673['emit'](_0x639e('0x4d'),{'SmsInteractionId':Number(_0x29ee94[_0x151cbe]),'UserId':Number(_0x24e1ad['id'])});}});}})[_0x639e('0xb')](function(){if(_0x3813f6===_0x639e('0x48')){var _0x29314a=_[_0x639e('0x16')](_0x24e1ad[_0x639e('0x4e')],'id');return _0x24e1ad[_0x639e('0x4f')](_0x29314a)[_0x639e('0xb')](function(){for(var _0x51112d=0x0;_0x51112d<_0x29314a[_0x639e('0x1c')];_0x51112d+=0x1){_0x3ab673[_0x639e('0x47')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x29314a[_0x51112d]),'UserId':Number(_0x24e1ad['id'])});}});}})['then'](function(){if(_0x3813f6===_0x639e('0x48')){var _0x549d44=_[_0x639e('0x16')](_0x24e1ad[_0x639e('0x50')],'id');return _0x24e1ad[_0x639e('0x51')](_0x549d44)['then'](function(){for(var _0x6085ca=0x0;_0x6085ca<_0x549d44[_0x639e('0x1c')];_0x6085ca+=0x1){_0x3ab673[_0x639e('0x47')](_0x639e('0x52'),{'WhatsappInteractionId':Number(_0x549d44[_0x6085ca]),'UserId':Number(_0x24e1ad['id'])});}});}})['catch'](function(_0x212e27){_0x224d52[_0x639e('0x53')](_0x212e27);});}}function onDisconnect(_0x4eda16,_0x404adb){joinOrLeave(_0x4eda16,_0x639e('0x48'),_0x404adb);}function onConnect(_0x6b1b3e){joinOrLeave(_0x6b1b3e,_0x639e('0x54'));}exports[_0x639e('0x55')]=function(_0x570835){_0x570835['on'](_0x639e('0x56'),function(_0x94fab4){_0x94fab4[_0x639e('0x57')](0x0);_0x94fab4[_0x639e('0x58')]=_0x94fab4[_0x639e('0x59')][_0x639e('0x56')][_0x639e('0x5a')]+':'+_0x94fab4[_0x639e('0x59')][_0x639e('0x56')][_0x639e('0x5b')];_0x94fab4['connectedAt']=new Date();_0x94fab4['log']=function(_0xdeb345){console[_0x639e('0x53')](_0x639e('0x5c')+_0x94fab4[_0x639e('0x5d')][_0x639e('0x2')]+'['+_0x94fab4['address']+']',_0xdeb345);};_0x94fab4['on'](_0x639e('0x5e'),function(){onDisconnect(_0x94fab4,_0x570835);_0x94fab4['log'](_0x639e('0x5f'));});onConnect(_0x94fab4);_0x94fab4[_0x639e('0x53')](_0x639e('0x60'));});};
\ No newline at end of file
+var _0x8101=['telephone','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','FaxQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','map','where','role','format','%s:queue:%s','length','user:%s','handshake','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','push','ChatQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Trunk','Campaign','VoiceQueue','SmsQueues','MailQueues','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','voice','chat','fax','sms','mail','telephone:%s','trunk:%s','campaign:%s:%s','leave','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','connection','address','request','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User'];(function(_0x4d180c,_0x45c68e){var _0x49b57e=function(_0x264741){while(--_0x264741){_0x4d180c['push'](_0x4d180c['shift']());}};_0x49b57e(++_0x45c68e);}(_0x8101,0xc0));var _0x1810=function(_0x2055a7,_0x415a4c){_0x2055a7=_0x2055a7-0x0;var _0x42a14d=_0x8101[_0x2055a7];return _0x42a14d;};'use strict';var _=require(_0x1810('0x0'));var util=require(_0x1810('0x1'));var BPromise=require(_0x1810('0x2'));var db=require(_0x1810('0x3'))['db'];var config=require(_0x1810('0x4'));var queryQueues={'attributes':['id',_0x1810('0x5')],'include':[{'as':_0x1810('0x6'),'model':db[_0x1810('0x7')],'attributes':['id',_0x1810('0x5'),'role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x1810('0x5')],'where':{'role':_0x1810('0x8')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x1810('0x5')],'where':{'role':_0x1810('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x1810('0x5'),_0x1810('0xa')],'where':{'type':_0x1810('0xb')}};function getAssociatedResources(_0x271738,_0x197255,_0x2dde85){return db[_0x1810('0xc')][_0x1810('0xd')]({'where':{'name':_0x271738,'userProfileId':_0x197255},'raw':!![]})[_0x1810('0xe')](function(_0x5126d2){if(_0x5126d2){if(_0x5126d2[_0x1810('0xf')]){switch(_0x271738){case _0x1810('0x10'):case'ChatQueues':case _0x1810('0x11'):case'SmsQueues':case'MailQueues':case _0x1810('0x12'):case _0x1810('0x13'):return db[_0x2dde85][_0x1810('0x14')](queryQueues);case _0x1810('0x15'):return db[_0x2dde85][_0x1810('0x14')](queryTelephones);case _0x1810('0x16'):return db[_0x2dde85]['findAll'](queryTrunks);case _0x1810('0x17'):return db[_0x2dde85][_0x1810('0x14')](queryCampaigns);}}else{return db['UserProfileResource']['findAll']({'attributes':[_0x1810('0x18')],'where':{'sectionId':_0x5126d2['id']},'raw':!![]})['then'](function(_0x187dca){if(_0x187dca){var _0xbdebf5={'where':{'id':_[_0x1810('0x19')](_0x187dca,_0x1810('0x18'))},'raw':!![]};switch(_0x2dde85){case _0x1810('0x7'):_0xbdebf5[_0x1810('0x1a')][_0x1810('0x1b')]='telephone';break;case'Campaign':_0xbdebf5['where'][_0x1810('0xa')]='ivr';break;}return db[_0x2dde85][_0x1810('0x14')](_0xbdebf5);}else{return[];}});}}else{return[];}})[_0x1810('0xe')](function(_0x3876b0){return _0x3876b0;});}function joinOrLeaveQueues(_0x27c51b,_0x57477e,_0x1490c3,_0x5c8c36){_0x27c51b[_0x57477e](util[_0x1810('0x1c')](_0x1810('0x1d'),_0x1490c3,_0x5c8c36['name']));if(_0x5c8c36[_0x1810('0x6')]){for(var _0x42672f=0x0;_0x42672f<_0x5c8c36[_0x1810('0x6')][_0x1810('0x1e')];_0x42672f+=0x1){_0x27c51b[_0x57477e](util[_0x1810('0x1c')](_0x1810('0x1f'),_0x5c8c36['Agents'][_0x42672f][_0x1810('0x5')]));}}}function joinOrLeave(_0x198bbc,_0x254062,_0x77b5ed){var _0x53ca63;if(_0x198bbc[_0x1810('0x20')]['query']['id']){db['User'][_0x1810('0x21')]({'attributes':['id',_0x1810('0x5'),_0x1810('0x1b'),_0x1810('0x22')],'where':{'id':_0x198bbc[_0x1810('0x20')]['query']['id']},'include':[{'model':db[_0x1810('0x23')],'as':_0x1810('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x1810('0x25')],'as':_0x1810('0x26'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x1810('0x27')],'as':_0x1810('0x28'),'attributes':['id'],'raw':!![]},{'model':db[_0x1810('0x29')],'as':_0x1810('0x2a'),'attributes':['id'],'raw':!![]},{'model':db[_0x1810('0x2b')],'as':_0x1810('0x2c'),'attributes':['id'],'raw':!![]}]})[_0x1810('0xe')](function(_0x3e122b){if(_0x3e122b){_0x53ca63=_0x3e122b;_0x198bbc[_0x254062](util[_0x1810('0x1c')](_0x1810('0x1f'),_0x3e122b[_0x1810('0x5')]));var _0x223638=[];switch(_0x3e122b[_0x1810('0x1b')]){case'admin':_0x198bbc[_0x254062](_0x1810('0x2d'));_0x198bbc[_0x254062](_0x1810('0x2e'));if(queryQueues[_0x1810('0x2f')](_0x1810('0x30'))){delete queryQueues[_0x1810('0x30')];}_0x223638[_0x1810('0x31')](db['VoiceQueue'][_0x1810('0x14')](queryQueues));_0x223638[_0x1810('0x31')](db[_0x1810('0x32')][_0x1810('0x14')](queryQueues));_0x223638[_0x1810('0x31')](db['FaxQueue'][_0x1810('0x14')](queryQueues));_0x223638[_0x1810('0x31')](db[_0x1810('0x33')]['findAll'](queryQueues));_0x223638[_0x1810('0x31')](db[_0x1810('0x34')][_0x1810('0x14')](queryQueues));_0x223638[_0x1810('0x31')](db[_0x1810('0x35')][_0x1810('0x14')](queryQueues));_0x223638[_0x1810('0x31')](db[_0x1810('0x36')][_0x1810('0x14')](queryQueues));_0x223638[_0x1810('0x31')](db[_0x1810('0x7')][_0x1810('0x14')](queryTelephones));_0x223638[_0x1810('0x31')](db[_0x1810('0x37')][_0x1810('0x14')](queryTrunks));_0x223638['push'](db[_0x1810('0x38')]['findAll'](queryCampaigns));_0x223638['push'](db[_0x1810('0x7')][_0x1810('0x14')](queryAgents));break;case'user':_0x198bbc[_0x254062](_0x1810('0x2d'));_0x198bbc[_0x254062](_0x1810('0x2e'));_0x223638[_0x1810('0x31')](getAssociatedResources(_0x1810('0x10'),_0x3e122b[_0x1810('0x22')],_0x1810('0x39')));_0x223638[_0x1810('0x31')](getAssociatedResources('ChatQueues',_0x3e122b[_0x1810('0x22')],_0x1810('0x32')));_0x223638['push'](getAssociatedResources('FaxQueues',_0x3e122b[_0x1810('0x22')],'FaxQueue'));_0x223638[_0x1810('0x31')](getAssociatedResources(_0x1810('0x3a'),_0x3e122b[_0x1810('0x22')],_0x1810('0x33')));_0x223638[_0x1810('0x31')](getAssociatedResources(_0x1810('0x3b'),_0x3e122b[_0x1810('0x22')],_0x1810('0x34')));_0x223638[_0x1810('0x31')](getAssociatedResources('OpenchannelQueues',_0x3e122b[_0x1810('0x22')],'OpenchannelQueue'));_0x223638[_0x1810('0x31')](getAssociatedResources(_0x1810('0x13'),_0x3e122b[_0x1810('0x22')],_0x1810('0x36')));_0x223638[_0x1810('0x31')](getAssociatedResources(_0x1810('0x15'),_0x3e122b[_0x1810('0x22')],_0x1810('0x7')));_0x223638[_0x1810('0x31')](getAssociatedResources(_0x1810('0x16'),_0x3e122b['userProfileId'],_0x1810('0x37')));_0x223638[_0x1810('0x31')](getAssociatedResources(_0x1810('0x17'),_0x3e122b['userProfileId'],_0x1810('0x38')));_0x223638[_0x1810('0x31')](db[_0x1810('0x7')][_0x1810('0x14')](queryAgents));break;case _0x1810('0x9'):_0x198bbc[_0x254062](_0x1810('0x2d'));_0x198bbc[_0x254062]('voice:outbound');_0x223638[_0x1810('0x31')](_0x3e122b[_0x1810('0x3c')]({'attributes':['id',_0x1810('0x5')]}));_0x223638[_0x1810('0x31')](_0x3e122b[_0x1810('0x3d')]({'attributes':['id','name']}));_0x223638[_0x1810('0x31')](_0x3e122b[_0x1810('0x3e')]({'attributes':['id',_0x1810('0x5')]}));_0x223638[_0x1810('0x31')](_0x3e122b[_0x1810('0x3f')]({'attributes':['id',_0x1810('0x5')]}));_0x223638[_0x1810('0x31')](_0x3e122b[_0x1810('0x40')]({'attributes':['id',_0x1810('0x5')]}));_0x223638[_0x1810('0x31')](_0x3e122b[_0x1810('0x41')]({'attributes':['id','name']}));_0x223638[_0x1810('0x31')](_0x3e122b['getWhatsappQueues']({'attributes':['id',_0x1810('0x5')]}));break;}return BPromise['all'](_0x223638);}})[_0x1810('0xe')](function(_0x18b946){if(_0x18b946&&_0x18b946[_0x1810('0x1e')]){for(var _0x2f3c21=0x0;_0x2f3c21<_0x18b946[_0x1810('0x1e')];_0x2f3c21+=0x1){for(var _0x9446e9=0x0;_0x9446e9<_0x18b946[_0x2f3c21][_0x1810('0x1e')];_0x9446e9+=0x1){switch(_0x2f3c21){case 0x0:joinOrLeaveQueues(_0x198bbc,_0x254062,_0x1810('0x42'),_0x18b946[_0x2f3c21][_0x9446e9]);break;case 0x1:joinOrLeaveQueues(_0x198bbc,_0x254062,_0x1810('0x43'),_0x18b946[_0x2f3c21][_0x9446e9]);break;case 0x2:joinOrLeaveQueues(_0x198bbc,_0x254062,_0x1810('0x44'),_0x18b946[_0x2f3c21][_0x9446e9]);break;case 0x3:joinOrLeaveQueues(_0x198bbc,_0x254062,_0x1810('0x45'),_0x18b946[_0x2f3c21][_0x9446e9]);break;case 0x4:joinOrLeaveQueues(_0x198bbc,_0x254062,_0x1810('0x46'),_0x18b946[_0x2f3c21][_0x9446e9]);break;case 0x5:joinOrLeaveQueues(_0x198bbc,_0x254062,'openchannel',_0x18b946[_0x2f3c21][_0x9446e9]);break;case 0x6:joinOrLeaveQueues(_0x198bbc,_0x254062,'whatsapp',_0x18b946[_0x2f3c21][_0x9446e9]);break;case 0x7:if(_0x53ca63[_0x1810('0x1b')]!=='agent')_0x198bbc[_0x254062](util[_0x1810('0x1c')](_0x1810('0x47'),_0x18b946[_0x2f3c21][_0x9446e9]['name']));break;case 0x8:if(_0x53ca63['role']!==_0x1810('0x9'))_0x198bbc[_0x254062](util[_0x1810('0x1c')](_0x1810('0x48'),_0x18b946[_0x2f3c21][_0x9446e9][_0x1810('0x5')]));break;case 0x9:if(_0x53ca63[_0x1810('0x1b')]!=='agent')_0x198bbc[_0x254062](util[_0x1810('0x1c')](_0x1810('0x49'),_0x18b946[_0x2f3c21][_0x9446e9][_0x1810('0xa')],_0x18b946[_0x2f3c21][_0x9446e9][_0x1810('0x5')]));break;case 0xa:_0x198bbc[_0x254062](util[_0x1810('0x1c')](_0x1810('0x1f'),_0x18b946[_0x2f3c21][_0x9446e9][_0x1810('0x5')]));break;}}}}})[_0x1810('0xe')](function(){if(_0x254062===_0x1810('0x4a')){var _0x3eff89=_[_0x1810('0x19')](_0x53ca63['ChatInteractions'],'id');return _0x53ca63[_0x1810('0x4b')](_0x3eff89)[_0x1810('0xe')](function(){for(var _0x236aaa=0x0;_0x236aaa<_0x3eff89[_0x1810('0x1e')];_0x236aaa+=0x1){_0x77b5ed['emit'](_0x1810('0x4c'),{'ChatInteractionId':Number(_0x3eff89[_0x236aaa]),'UserId':Number(_0x53ca63['id'])});}});}})[_0x1810('0xe')](function(){if(_0x254062==='leave'){var _0x8b722e=_['map'](_0x53ca63['MailInteractions'],'id');return _0x53ca63[_0x1810('0x4d')](_0x8b722e)['then'](function(){for(var _0x4207c4=0x0;_0x4207c4<_0x8b722e[_0x1810('0x1e')];_0x4207c4+=0x1){_0x77b5ed[_0x1810('0x4e')](_0x1810('0x4f'),{'MailInteractionId':Number(_0x8b722e[_0x4207c4]),'UserId':Number(_0x53ca63['id'])});}});}})[_0x1810('0xe')](function(){if(_0x254062===_0x1810('0x4a')){var _0x20eba4=_[_0x1810('0x19')](_0x53ca63[_0x1810('0x50')],'id');return _0x53ca63[_0x1810('0x51')](_0x20eba4)[_0x1810('0xe')](function(){for(var _0x4a71a8=0x0;_0x4a71a8<_0x20eba4['length'];_0x4a71a8+=0x1){_0x77b5ed['emit'](_0x1810('0x52'),{'FaxInteractionId':Number(_0x20eba4[_0x4a71a8]),'UserId':Number(_0x53ca63['id'])});}});}})[_0x1810('0xe')](function(){if(_0x254062===_0x1810('0x4a')){var _0x53bec7=_[_0x1810('0x19')](_0x53ca63[_0x1810('0x28')],'id');return _0x53ca63['removeSmsInteractions'](_0x53bec7)[_0x1810('0xe')](function(){for(var _0x2a9cd0=0x0;_0x2a9cd0<_0x53bec7[_0x1810('0x1e')];_0x2a9cd0+=0x1){_0x77b5ed['emit']('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x53bec7[_0x2a9cd0]),'UserId':Number(_0x53ca63['id'])});}});}})[_0x1810('0xe')](function(){if(_0x254062===_0x1810('0x4a')){var _0x4590c7=_[_0x1810('0x19')](_0x53ca63[_0x1810('0x2a')],'id');return _0x53ca63['removeOpenchannelInteractions'](_0x4590c7)[_0x1810('0xe')](function(){for(var _0x528355=0x0;_0x528355<_0x4590c7[_0x1810('0x1e')];_0x528355+=0x1){_0x77b5ed['emit'](_0x1810('0x53'),{'OpenchannelInteractionId':Number(_0x4590c7[_0x528355]),'UserId':Number(_0x53ca63['id'])});}});}})[_0x1810('0xe')](function(){if(_0x254062==='leave'){var _0xd81b16=_['map'](_0x53ca63[_0x1810('0x2c')],'id');return _0x53ca63[_0x1810('0x54')](_0xd81b16)[_0x1810('0xe')](function(){for(var _0x4638d2=0x0;_0x4638d2<_0xd81b16[_0x1810('0x1e')];_0x4638d2+=0x1){_0x77b5ed['emit'](_0x1810('0x55'),{'WhatsappInteractionId':Number(_0xd81b16[_0x4638d2]),'UserId':Number(_0x53ca63['id'])});}});}})[_0x1810('0x56')](function(_0x5a5798){_0x198bbc[_0x1810('0x57')](_0x5a5798);});}}function onDisconnect(_0x5e8b6f,_0x59f35c){joinOrLeave(_0x5e8b6f,_0x1810('0x4a'),_0x59f35c);}function onConnect(_0x116287){joinOrLeave(_0x116287,_0x1810('0x58'));}exports[_0x1810('0x59')]=function(_0x4dfae2){_0x4dfae2['on'](_0x1810('0x5a'),function(_0xb99fa0){_0xb99fa0['setMaxListeners'](0x0);_0xb99fa0[_0x1810('0x5b')]=_0xb99fa0[_0x1810('0x5c')][_0x1810('0x5a')][_0x1810('0x5d')]+':'+_0xb99fa0[_0x1810('0x5c')][_0x1810('0x5a')][_0x1810('0x5e')];_0xb99fa0[_0x1810('0x5f')]=new Date();_0xb99fa0[_0x1810('0x57')]=function(_0x41eaef){console[_0x1810('0x57')](_0x1810('0x60')+_0xb99fa0[_0x1810('0x61')][_0x1810('0x5')]+'['+_0xb99fa0[_0x1810('0x5b')]+']',_0x41eaef);};_0xb99fa0['on']('disconnect',function(){onDisconnect(_0xb99fa0,_0x4dfae2);_0xb99fa0[_0x1810('0x57')](_0x1810('0x62'));});onConnect(_0xb99fa0);_0xb99fa0[_0x1810('0x57')](_0x1810('0x63'));});};
\ No newline at end of file
index e6de424..bc14d35 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb892=['name','email','internal','interface','format','SIP/%s','agent','outgoingmessage','opened','contact','closed','fullname','default','length','model','hook','callback','toLowerCase','condition','../../mysqldb','jayson/promise','triggers','lodash','client','http','afterCreate','newinteraction','Chat','ChatInteraction','afterUpdate','closedinteraction','newmessage','SmsInteraction','Sms','SmsMessage','Whatsapp','WhatsappInteraction','WhatsappMessage','Fax','FaxInteraction','Mail','MailInteraction','substatus','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','Trigger,\x20%s','error','code','catch','get','channel','motionChannel','event','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','query','Sequelize','QueryTypes','SELECT','UserId','User','find'];(function(_0x408cbc,_0x54e587){var _0x58cfd1=function(_0x4faf84){while(--_0x4faf84){_0x408cbc['push'](_0x408cbc['shift']());}};_0x58cfd1(++_0x54e587);}(_0xb892,0x9b));var _0x2b89=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0xb892[_0x4a7631];return _0x1a5a6f;};'use strict';var util=require('util');var db=require(_0x2b89('0x0'))['db'];var jayson=require(_0x2b89('0x1'));var logger=require('../logger')(_0x2b89('0x2'));var _=require(_0x2b89('0x3'));var client=jayson[_0x2b89('0x4')][_0x2b89('0x5')]({'port':0x232a});var triggers=[{'channel':'Chat','model':'ChatInteraction','event':_0x2b89('0x6'),'condition':_0x2b89('0x7'),'callback':afterCreate},{'channel':_0x2b89('0x8'),'model':_0x2b89('0x9'),'event':_0x2b89('0xa'),'condition':_0x2b89('0xb'),'callback':afterUpdate},{'channel':_0x2b89('0x8'),'model':'ChatMessage','event':_0x2b89('0x6'),'condition':_0x2b89('0xc'),'callback':afterCreateMessage},{'channel':'Sms','model':_0x2b89('0xd'),'event':_0x2b89('0x6'),'condition':_0x2b89('0x7'),'callback':afterCreate},{'channel':'Sms','model':'SmsInteraction','event':_0x2b89('0xa'),'condition':_0x2b89('0xb'),'callback':afterUpdate},{'channel':_0x2b89('0xe'),'model':_0x2b89('0xf'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':'Whatsapp','model':'WhatsappInteraction','event':_0x2b89('0x6'),'condition':_0x2b89('0x7'),'callback':afterCreate},{'channel':_0x2b89('0x10'),'model':_0x2b89('0x11'),'event':_0x2b89('0xa'),'condition':_0x2b89('0xb'),'callback':afterUpdate},{'channel':_0x2b89('0x10'),'model':_0x2b89('0x12'),'event':'afterCreate','condition':_0x2b89('0xc'),'callback':afterCreateMessage},{'channel':_0x2b89('0x13'),'model':_0x2b89('0x14'),'event':_0x2b89('0x6'),'condition':_0x2b89('0x7'),'callback':afterCreate},{'channel':_0x2b89('0x13'),'model':'FaxInteraction','event':'afterUpdate','condition':_0x2b89('0xb'),'callback':afterUpdate},{'channel':_0x2b89('0x13'),'model':'FaxMessage','event':_0x2b89('0x6'),'condition':_0x2b89('0xc'),'callback':afterCreateMessage},{'channel':_0x2b89('0x15'),'model':_0x2b89('0x16'),'event':_0x2b89('0x6'),'condition':_0x2b89('0x7'),'callback':afterCreate},{'channel':_0x2b89('0x15'),'model':_0x2b89('0x16'),'event':_0x2b89('0xa'),'condition':_0x2b89('0xb'),'callback':afterUpdate},{'channel':_0x2b89('0x15'),'model':'MailInteraction','event':_0x2b89('0x17'),'condition':_0x2b89('0x17'),'callback':afterUpdate},{'channel':'Mail','model':_0x2b89('0x18'),'event':_0x2b89('0x6'),'condition':_0x2b89('0xc'),'callback':afterCreateMessage},{'channel':_0x2b89('0x19'),'model':_0x2b89('0x1a'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x2b89('0x19'),'model':_0x2b89('0x1a'),'event':'afterUpdate','condition':_0x2b89('0xb'),'callback':afterUpdate},{'channel':_0x2b89('0x19'),'model':_0x2b89('0x1b'),'event':'afterCreate','condition':_0x2b89('0xc'),'callback':afterCreateMessage}];function request(_0x52dc6a){return client[_0x2b89('0x1c')](_0x2b89('0x1d'),_0x52dc6a)[_0x2b89('0x1e')](function(_0x32a2b1){logger['info'](_0x2b89('0x1f'),'EventManager',_0x32a2b1);if(_0x32a2b1[_0x2b89('0x20')]){if(_0x32a2b1[_0x2b89('0x20')][_0x2b89('0x21')]===0x1f4){logger[_0x2b89('0x20')](_0x2b89('0x1f'),_0x2b89('0x1d'),_0x32a2b1[_0x2b89('0x20')]);}}})[_0x2b89('0x22')](function(_0x1c2e5a){logger[_0x2b89('0x20')](_0x2b89('0x1f'),_0x2b89('0x1d'),_0x1c2e5a);});}function afterCreateMessage(_0xac07dc,_0x1d691c){return function(_0x58d4c9,_0x86381){_0x58d4c9=_0x58d4c9[_0x2b89('0x23')]({'plain':!![]});_0x58d4c9[_0x2b89('0x24')]=_0xac07dc;_0x58d4c9[_0x2b89('0x25')]=_0xac07dc;_0x58d4c9[_0x2b89('0x26')]=_0x58d4c9['direction'];var _0x5054e2=_0x2b89('0x27')+_0x58d4c9[_0x2b89('0x28')];return db[_0x2b89('0x29')][_0x2b89('0x2a')](_0x5054e2,{'type':db[_0x2b89('0x2b')][_0x2b89('0x2c')][_0x2b89('0x2d')],'raw':!![]})[_0x2b89('0x1e')](function(_0x46b283){return _0x46b283;})[_0x2b89('0x1e')](function(_0x112c9d){if(_0x112c9d){_0x58d4c9['contact']=_0x112c9d[0x0];}if(_0x58d4c9[_0x2b89('0x2e')]){return db[_0x2b89('0x2f')][_0x2b89('0x30')]({'where':{'id':_0x58d4c9['UserId']},'attributes':['id',_0x2b89('0x31'),'fullname',_0x2b89('0x32'),_0x2b89('0x33')],'raw':!![]})['then'](function(_0x5d7f2e){_0x58d4c9[_0x2b89('0x34')]=util[_0x2b89('0x35')](_0x2b89('0x36'),_0x5d7f2e[_0x2b89('0x31')]);_0x58d4c9[_0x2b89('0x24')]=_0xac07dc;_0x58d4c9[_0x2b89('0x37')]=_0x5d7f2e;return request({'event':'incomingmessage','message':_0x58d4c9});})[_0x2b89('0x22')](function(_0x186c23){console[_0x2b89('0x20')](_0x186c23);});}else{return request({'event':_0x2b89('0x38'),'message':_0x58d4c9});}});};}function afterCreate(_0x4e0255,_0x43d9ed){return function(_0x29b216,_0x1af955){_0x29b216=_0x29b216[_0x2b89('0x23')]({'plain':!![]});_0x29b216['channel']=_0x4e0255;_0x29b216[_0x2b89('0x25')]=_0x4e0255;_0x29b216[_0x2b89('0x26')]=_0x2b89('0x39');var _0x43229e=_0x2b89('0x27')+_0x29b216[_0x2b89('0x28')];return db[_0x2b89('0x29')][_0x2b89('0x2a')](_0x43229e,{'type':db[_0x2b89('0x2b')][_0x2b89('0x2c')][_0x2b89('0x2d')],'raw':!![]})[_0x2b89('0x1e')](function(_0x1ff977){return _0x1ff977;})[_0x2b89('0x1e')](function(_0x286e2a){if(_0x286e2a){_0x29b216[_0x2b89('0x3a')]=_0x286e2a[0x0];}return request({'event':_0x43d9ed,'message':_0x29b216});});};}function afterUpdate(_0x84f9b8,_0x5e9876){return function(_0xa2c710,_0x42d256){if(_0xa2c710['changed'](_0x2b89('0x3b'))&&_0xa2c710[_0x2b89('0x3b')]){_0xa2c710=_0xa2c710['get']({'plain':!![]});_0xa2c710[_0x2b89('0x24')]=_0x84f9b8;_0xa2c710[_0x2b89('0x25')]=_0x84f9b8;_0xa2c710['event']=_0x2b89('0x3b');var _0x55259f=_0x2b89('0x27')+_0xa2c710[_0x2b89('0x28')];return db[_0x2b89('0x29')]['query'](_0x55259f,{'type':db[_0x2b89('0x2b')][_0x2b89('0x2c')][_0x2b89('0x2d')],'raw':!![]})[_0x2b89('0x1e')](function(_0xd1272){return _0xd1272;})['then'](function(_0x1a85a2){if(_0x1a85a2){_0xa2c710[_0x2b89('0x3a')]=_0x1a85a2[0x0];}if(_0xa2c710[_0x2b89('0x2e')]){return db[_0x2b89('0x2f')][_0x2b89('0x30')]({'where':{'id':_0xa2c710[_0x2b89('0x2e')]},'attributes':['id',_0x2b89('0x31'),_0x2b89('0x3c'),'email','internal'],'raw':!![]})[_0x2b89('0x1e')](function(_0x4035af){_0xa2c710[_0x2b89('0x34')]=util[_0x2b89('0x35')]('SIP/%s',_0x4035af[_0x2b89('0x31')]);_0xa2c710[_0x2b89('0x37')]=_0x4035af;return request({'event':_0x5e9876,'message':_0xa2c710});})[_0x2b89('0x22')](function(_0x39d7bb){console[_0x2b89('0x20')](_0x39d7bb);});}else{return request({'event':_0x5e9876,'message':_0xa2c710});}});}else if(_0xa2c710['changed'](_0x2b89('0x17'))){_0xa2c710=_0xa2c710['get']({'plain':!![]});_0xa2c710[_0x2b89('0x24')]=_0x84f9b8;_0xa2c710[_0x2b89('0x26')]='substatus';var _0x55259f=_0x2b89('0x27')+_0xa2c710['ContactId'];return db['sequelize'][_0x2b89('0x2a')](_0x55259f,{'type':db[_0x2b89('0x2b')]['QueryTypes'][_0x2b89('0x2d')],'raw':!![]})['then'](function(_0x47d223){return _0x47d223;})[_0x2b89('0x1e')](function(_0x163753){if(_0x163753){_0xa2c710['contact']=_0x163753[0x0];}if(_0xa2c710[_0x2b89('0x2e')]){return db[_0x2b89('0x2f')][_0x2b89('0x30')]({'where':{'id':_0xa2c710[_0x2b89('0x2e')]},'attributes':['id','name',_0x2b89('0x3c'),'email','internal'],'raw':!![]})[_0x2b89('0x1e')](function(_0x153b4b){_0xa2c710[_0x2b89('0x34')]=util[_0x2b89('0x35')](_0x2b89('0x36'),_0x153b4b[_0x2b89('0x31')]);_0xa2c710[_0x2b89('0x37')]=_0x153b4b;return request({'event':_0x5e9876,'message':_0xa2c710});})['catch'](function(_0x56fdcf){console[_0x2b89('0x20')](_0x56fdcf);});}else{return request({'event':_0x5e9876,'message':_0xa2c710});}});}};}exports[_0x2b89('0x3d')]=function(){for(var _0x4da82c=0x0;_0x4da82c<triggers[_0x2b89('0x3e')];_0x4da82c+=0x1){if(db['hasOwnProperty'](triggers[_0x4da82c][_0x2b89('0x3f')])){db[triggers[_0x4da82c][_0x2b89('0x3f')]][_0x2b89('0x40')](triggers[_0x4da82c][_0x2b89('0x26')],triggers[_0x4da82c][_0x2b89('0x41')](triggers[_0x4da82c][_0x2b89('0x24')][_0x2b89('0x42')](),triggers[_0x4da82c][_0x2b89('0x43')]));}}};
\ No newline at end of file
+var _0x5356=['Fax','FaxMessage','Mail','substatus','MailMessage','Openchannel','OpenchannelInteraction','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','direction','ContactId','sequelize','QueryTypes','SELECT','User','UserId','fullname','email','internal','format','SIP/%s','name','channel','incomingmessage','outgoingmessage','motionChannel','event','opened','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','contact','changed','closed','query','find','interface','default','length','model','toLowerCase','util','../../mysqldb','jayson/promise','../logger','client','http','Chat','ChatInteraction','afterUpdate','closedinteraction','ChatMessage','Sms','afterCreate','newinteraction','SmsInteraction','SmsMessage','Whatsapp','WhatsappInteraction','newmessage','FaxInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5356,0x17e));var _0x6535=function(_0x43feee,_0x18e157){_0x43feee=_0x43feee-0x0;var _0xfa958a=_0x5356[_0x43feee];return _0xfa958a;};'use strict';var util=require(_0x6535('0x0'));var db=require(_0x6535('0x1'))['db'];var jayson=require(_0x6535('0x2'));var logger=require(_0x6535('0x3'))('triggers');var _=require('lodash');var client=jayson[_0x6535('0x4')][_0x6535('0x5')]({'port':0x232a});var triggers=[{'channel':_0x6535('0x6'),'model':_0x6535('0x7'),'event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x6535('0x6'),'model':'ChatInteraction','event':_0x6535('0x8'),'condition':_0x6535('0x9'),'callback':afterUpdate},{'channel':_0x6535('0x6'),'model':_0x6535('0xa'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x6535('0xb'),'model':'SmsInteraction','event':_0x6535('0xc'),'condition':_0x6535('0xd'),'callback':afterCreate},{'channel':'Sms','model':_0x6535('0xe'),'event':'afterUpdate','condition':_0x6535('0x9'),'callback':afterUpdate},{'channel':_0x6535('0xb'),'model':_0x6535('0xf'),'event':_0x6535('0xc'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Whatsapp','model':'WhatsappInteraction','event':_0x6535('0xc'),'condition':_0x6535('0xd'),'callback':afterCreate},{'channel':_0x6535('0x10'),'model':_0x6535('0x11'),'event':_0x6535('0x8'),'condition':_0x6535('0x9'),'callback':afterUpdate},{'channel':_0x6535('0x10'),'model':'WhatsappMessage','event':'afterCreate','condition':_0x6535('0x12'),'callback':afterCreateMessage},{'channel':'Fax','model':_0x6535('0x13'),'event':_0x6535('0xc'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x6535('0x14'),'model':_0x6535('0x13'),'event':_0x6535('0x8'),'condition':_0x6535('0x9'),'callback':afterUpdate},{'channel':_0x6535('0x14'),'model':_0x6535('0x15'),'event':_0x6535('0xc'),'condition':_0x6535('0x12'),'callback':afterCreateMessage},{'channel':'Mail','model':'MailInteraction','event':_0x6535('0xc'),'condition':_0x6535('0xd'),'callback':afterCreate},{'channel':_0x6535('0x16'),'model':'MailInteraction','event':_0x6535('0x8'),'condition':_0x6535('0x9'),'callback':afterUpdate},{'channel':'Mail','model':'MailInteraction','event':_0x6535('0x17'),'condition':_0x6535('0x17'),'callback':afterUpdate},{'channel':_0x6535('0x16'),'model':_0x6535('0x18'),'event':_0x6535('0xc'),'condition':_0x6535('0x12'),'callback':afterCreateMessage},{'channel':_0x6535('0x19'),'model':_0x6535('0x1a'),'event':_0x6535('0xc'),'condition':_0x6535('0xd'),'callback':afterCreate},{'channel':_0x6535('0x19'),'model':_0x6535('0x1a'),'event':_0x6535('0x8'),'condition':_0x6535('0x9'),'callback':afterUpdate},{'channel':_0x6535('0x19'),'model':'OpenchannelMessage','event':_0x6535('0xc'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x2b6738){return client[_0x6535('0x1b')](_0x6535('0x1c'),_0x2b6738)[_0x6535('0x1d')](function(_0x2ac40e){logger[_0x6535('0x1e')](_0x6535('0x1f'),_0x6535('0x1c'),_0x2ac40e);if(_0x2ac40e[_0x6535('0x20')]){if(_0x2ac40e[_0x6535('0x20')][_0x6535('0x21')]===0x1f4){logger['error']('Trigger,\x20%s',_0x6535('0x1c'),_0x2ac40e[_0x6535('0x20')]);}}})[_0x6535('0x22')](function(_0x4079d9){logger[_0x6535('0x20')](_0x6535('0x1f'),_0x6535('0x1c'),_0x4079d9);});}function afterCreateMessage(_0x4b7bc5,_0x464061){return function(_0x11b4ec,_0xe82fe5){_0x11b4ec=_0x11b4ec[_0x6535('0x23')]({'plain':!![]});_0x11b4ec['channel']=_0x4b7bc5;_0x11b4ec['motionChannel']=_0x4b7bc5;_0x11b4ec['event']=_0x11b4ec[_0x6535('0x24')];var _0x2689d5='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x11b4ec[_0x6535('0x25')];return db[_0x6535('0x26')]['query'](_0x2689d5,{'type':db['Sequelize'][_0x6535('0x27')][_0x6535('0x28')],'raw':!![]})[_0x6535('0x1d')](function(_0x2d4395){return _0x2d4395;})[_0x6535('0x1d')](function(_0x13d91e){if(_0x13d91e){_0x11b4ec['contact']=_0x13d91e[0x0];}if(_0x11b4ec['UserId']){return db[_0x6535('0x29')]['find']({'where':{'id':_0x11b4ec[_0x6535('0x2a')]},'attributes':['id','name',_0x6535('0x2b'),_0x6535('0x2c'),_0x6535('0x2d')],'raw':!![]})['then'](function(_0x404f93){_0x11b4ec['interface']=util[_0x6535('0x2e')](_0x6535('0x2f'),_0x404f93[_0x6535('0x30')]);_0x11b4ec[_0x6535('0x31')]=_0x4b7bc5;_0x11b4ec['agent']=_0x404f93;return request({'event':_0x6535('0x32'),'message':_0x11b4ec});})[_0x6535('0x22')](function(_0x2840c2){console[_0x6535('0x20')](_0x2840c2);});}else{return request({'event':_0x6535('0x33'),'message':_0x11b4ec});}});};}function afterCreate(_0x314de9,_0x2f13eb){return function(_0x5e19a8,_0x143a70){_0x5e19a8=_0x5e19a8[_0x6535('0x23')]({'plain':!![]});_0x5e19a8[_0x6535('0x31')]=_0x314de9;_0x5e19a8[_0x6535('0x34')]=_0x314de9;_0x5e19a8[_0x6535('0x35')]=_0x6535('0x36');var _0x470ac3=_0x6535('0x37')+_0x5e19a8[_0x6535('0x25')];return db[_0x6535('0x26')]['query'](_0x470ac3,{'type':db[_0x6535('0x38')][_0x6535('0x27')][_0x6535('0x28')],'raw':!![]})[_0x6535('0x1d')](function(_0x5b6be4){return _0x5b6be4;})['then'](function(_0xd41b7c){if(_0xd41b7c){_0x5e19a8[_0x6535('0x39')]=_0xd41b7c[0x0];}return request({'event':_0x2f13eb,'message':_0x5e19a8});});};}function afterUpdate(_0x27bb17,_0x5c9a08){return function(_0x3a3da8,_0x399798){if(_0x3a3da8[_0x6535('0x3a')](_0x6535('0x3b'))&&_0x3a3da8[_0x6535('0x3b')]){_0x3a3da8=_0x3a3da8['get']({'plain':!![]});_0x3a3da8[_0x6535('0x31')]=_0x27bb17;_0x3a3da8[_0x6535('0x34')]=_0x27bb17;_0x3a3da8[_0x6535('0x35')]='closed';var _0x30b964=_0x6535('0x37')+_0x3a3da8['ContactId'];return db[_0x6535('0x26')][_0x6535('0x3c')](_0x30b964,{'type':db[_0x6535('0x38')][_0x6535('0x27')][_0x6535('0x28')],'raw':!![]})[_0x6535('0x1d')](function(_0x1cfe3e){return _0x1cfe3e;})[_0x6535('0x1d')](function(_0x5a75a7){if(_0x5a75a7){_0x3a3da8[_0x6535('0x39')]=_0x5a75a7[0x0];}if(_0x3a3da8[_0x6535('0x2a')]){return db['User'][_0x6535('0x3d')]({'where':{'id':_0x3a3da8[_0x6535('0x2a')]},'attributes':['id',_0x6535('0x30'),_0x6535('0x2b'),'email',_0x6535('0x2d')],'raw':!![]})[_0x6535('0x1d')](function(_0x86aefc){_0x3a3da8[_0x6535('0x3e')]=util[_0x6535('0x2e')](_0x6535('0x2f'),_0x86aefc[_0x6535('0x30')]);_0x3a3da8['agent']=_0x86aefc;return request({'event':_0x5c9a08,'message':_0x3a3da8});})[_0x6535('0x22')](function(_0x3e2b39){console['error'](_0x3e2b39);});}else{return request({'event':_0x5c9a08,'message':_0x3a3da8});}});}else if(_0x3a3da8[_0x6535('0x3a')](_0x6535('0x17'))){_0x3a3da8=_0x3a3da8[_0x6535('0x23')]({'plain':!![]});_0x3a3da8[_0x6535('0x31')]=_0x27bb17;_0x3a3da8[_0x6535('0x35')]=_0x6535('0x17');var _0x30b964=_0x6535('0x37')+_0x3a3da8[_0x6535('0x25')];return db['sequelize'][_0x6535('0x3c')](_0x30b964,{'type':db[_0x6535('0x38')][_0x6535('0x27')]['SELECT'],'raw':!![]})[_0x6535('0x1d')](function(_0x2437f4){return _0x2437f4;})['then'](function(_0x4a4a7f){if(_0x4a4a7f){_0x3a3da8['contact']=_0x4a4a7f[0x0];}if(_0x3a3da8['UserId']){return db[_0x6535('0x29')]['find']({'where':{'id':_0x3a3da8[_0x6535('0x2a')]},'attributes':['id',_0x6535('0x30'),_0x6535('0x2b'),'email',_0x6535('0x2d')],'raw':!![]})[_0x6535('0x1d')](function(_0x3cbf4c){_0x3a3da8[_0x6535('0x3e')]=util[_0x6535('0x2e')](_0x6535('0x2f'),_0x3cbf4c['name']);_0x3a3da8['agent']=_0x3cbf4c;return request({'event':_0x5c9a08,'message':_0x3a3da8});})[_0x6535('0x22')](function(_0x4ad0ec){console[_0x6535('0x20')](_0x4ad0ec);});}else{return request({'event':_0x5c9a08,'message':_0x3a3da8});}});}};}exports[_0x6535('0x3f')]=function(){for(var _0x17284=0x0;_0x17284<triggers[_0x6535('0x40')];_0x17284+=0x1){if(db['hasOwnProperty'](triggers[_0x17284][_0x6535('0x41')])){db[triggers[_0x17284][_0x6535('0x41')]]['hook'](triggers[_0x17284][_0x6535('0x35')],triggers[_0x17284]['callback'](triggers[_0x17284][_0x6535('0x31')][_0x6535('0x42')](),triggers[_0x17284]['condition']));}}};
\ No newline at end of file
index 378147a..3326448 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x23b3=['./license/util','voice','mail','chat','sms','whatsapp','getChannels','isValidChannel','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','agent','User','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x23b3,0x156));var _0x323b=function(_0x297f25,_0x594be0){_0x297f25=_0x297f25-0x0;var _0x4b16e8=_0x23b3[_0x297f25];return _0x4b16e8;};'use strict';var _=require(_0x323b('0x0'));var BPromise=require(_0x323b('0x1'));var db=require(_0x323b('0x2'))['db'];var util=require(_0x323b('0x3'));var channels=[_0x323b('0x4'),_0x323b('0x5'),_0x323b('0x6'),'fax',_0x323b('0x7'),_0x323b('0x8'),'openchannel'];exports[_0x323b('0x9')]=function(){return channels;};exports[_0x323b('0xa')]=function(_0x167362){_0x167362=_0x167362['toLowerCase']();return _[_0x323b('0xb')](channels,_0x167362);};exports[_0x323b('0xc')]=function(_0x2bf53a,_0x31e353,_0x452f48,_0x278a2b){var _0x769b13={'loginAttempts':_0x31e353,'blocked':_0x452f48};if(!_[_0x323b('0xd')](_0x278a2b)){_0x769b13[_0x323b('0xe')]=_0x278a2b;}return _0x2bf53a[_0x323b('0xf')](_0x769b13);};exports[_0x323b('0x10')]=function(_0x2064a2){return new BPromise(function(_0x1cd481,_0x4e2c0b){var _0x46dee9=0x0;if(_0x2064a2['role']!==_0x323b('0x11')){_0x1cd481(_0x2064a2);}db[_0x323b('0x12')]['count']({'where':{'role':_0x323b('0x11'),'online':!![],'id':{'$ne':_0x2064a2['id']}}})[_0x323b('0x13')](function(_0x388fd4){_0x46dee9=_0x388fd4;return util['getLicense']();})[_0x323b('0x13')](function(_0x2946b4){if(_0x2946b4&&_0x2946b4['agents']&&_0x46dee9>=_0x2946b4[_0x323b('0x14')]){throw Error(_0x323b('0x15'));}_0x1cd481(_0x2064a2);})[_0x323b('0x16')](function(_0x1d37a2){_0x4e2c0b(_0x1d37a2);});});};
\ No newline at end of file
+var _0x1463=['getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','User','then','agents','Maximum\x20login\x20has\x20been\x20reached','bluebird','voice','chat','sms','whatsapp'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1463,0x1db));var _0x3146=function(_0x3cc678,_0x2a6f89){_0x3cc678=_0x3cc678-0x0;var _0xcc8066=_0x1463[_0x3cc678];return _0xcc8066;};'use strict';var _=require('lodash');var BPromise=require(_0x3146('0x0'));var db=require('../mysqldb')['db'];var util=require('./license/util');var channels=[_0x3146('0x1'),'mail',_0x3146('0x2'),'fax',_0x3146('0x3'),_0x3146('0x4'),'openchannel'];exports[_0x3146('0x5')]=function(){return channels;};exports[_0x3146('0x6')]=function(_0x143dda){_0x143dda=_0x143dda[_0x3146('0x7')]();return _[_0x3146('0x8')](channels,_0x143dda);};exports[_0x3146('0x9')]=function(_0x238f41,_0x315c08,_0x18e40e,_0x244321){var _0x2b9b3b={'loginAttempts':_0x315c08,'blocked':_0x18e40e};if(!_[_0x3146('0xa')](_0x244321)){_0x2b9b3b[_0x3146('0xb')]=_0x244321;}return _0x238f41[_0x3146('0xc')](_0x2b9b3b);};exports[_0x3146('0xd')]=function(_0x321af0){return new BPromise(function(_0x5cb5e9,_0x25da34){var _0x24a539=0x0;if(_0x321af0[_0x3146('0xe')]!==_0x3146('0xf')){_0x5cb5e9(_0x321af0);}db[_0x3146('0x10')]['count']({'where':{'role':_0x3146('0xf'),'online':!![],'id':{'$ne':_0x321af0['id']}}})[_0x3146('0x11')](function(_0x5db57a){_0x24a539=_0x5db57a;return util['getLicense']();})['then'](function(_0x1b16c3){if(_0x1b16c3&&_0x1b16c3[_0x3146('0x12')]&&_0x24a539>=_0x1b16c3[_0x3146('0x12')]){throw Error(_0x3146('0x13'));}_0x5cb5e9(_0x321af0);})['catch'](function(_0x25ae4a){_0x25da34(_0x25ae4a);});});};
\ No newline at end of file
index 2477f9c..b350391 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb93e=['send','exports','404','status','render','json'];(function(_0x2de12b,_0x50c255){var _0xbeb344=function(_0x204475){while(--_0x204475){_0x2de12b['push'](_0x2de12b['shift']());}};_0xbeb344(++_0x50c255);}(_0xb93e,0x6d));var _0xeb93=function(_0x4c4f17,_0x421c15){_0x4c4f17=_0x4c4f17-0x0;var _0x4403be=_0xb93e[_0x4c4f17];return _0x4403be;};'use strict';module[_0xeb93('0x0')][0x194]=function pageNotFound(_0x5b3608,_0x2a7c68){var _0x2119eb=_0xeb93('0x1');var _0x280ac6=0x194;var _0x163fd9={'status':_0x280ac6};_0x2a7c68[_0xeb93('0x2')](_0x163fd9[_0xeb93('0x2')]);_0x2a7c68[_0xeb93('0x3')](_0x2119eb,{},function(_0x3164e0,_0x2beaaf){if(_0x3164e0){return _0x2a7c68[_0xeb93('0x2')](_0x163fd9[_0xeb93('0x2')])[_0xeb93('0x4')](_0x163fd9);}_0x2a7c68[_0xeb93('0x5')](_0x2beaaf);});};
\ No newline at end of file
+var _0xad55=['render','send','exports','404','status'];(function(_0xeafa35,_0x24d7ba){var _0x53b3f4=function(_0x1e2476){while(--_0x1e2476){_0xeafa35['push'](_0xeafa35['shift']());}};_0x53b3f4(++_0x24d7ba);}(_0xad55,0xe8));var _0x5ad5=function(_0xdf6b54,_0x14dc4c){_0xdf6b54=_0xdf6b54-0x0;var _0xb2cc62=_0xad55[_0xdf6b54];return _0xb2cc62;};'use strict';module[_0x5ad5('0x0')][0x194]=function pageNotFound(_0xcb6849,_0x411c69){var _0x1eaa54=_0x5ad5('0x1');var _0x445b7c=0x194;var _0xdbbce={'status':_0x445b7c};_0x411c69[_0x5ad5('0x2')](_0xdbbce[_0x5ad5('0x2')]);_0x411c69[_0x5ad5('0x3')](_0x1eaa54,{},function(_0x3ef4ce,_0x274587){if(_0x3ef4ce){return _0x411c69['status'](_0xdbbce[_0x5ad5('0x2')])['json'](_0xdbbce);}_0x411c69[_0x5ad5('0x4')](_0x274587);});};
\ No newline at end of file
index 524cc2e..4b0cbad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0acf=['../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoField','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyQuestionReport','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','../api/smsQueueReport/smsQueueReport.model','SquareReport','../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','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','Team','../api/team/team.model','../api/license/license.model','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','Plugin','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','UserNotification','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappTransferReport','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','User','hasOne','VoiceMail','cascade','UserId','hasMany','VoiceQueuesRt','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','WhatsappInteractions','UserNotifications','SenderId','belongsTo','userProfileId','ChatGroup','belongsToMany','Contacts','cm_user_has_contacts','Lists','user_has_teams','MailInteractions','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoicePrefixes','MailQueues','ChatQueues','FaxQueues','SmsQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','ChatWebsites','user_has_chat_websites','FaxAccounts','MailAccounts','user_has_mail_accounts','OpenchannelAccount','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceContext','Sounds','moh_has_sounds','CmHopper','Hoppers','VoiceQueueId','HopperFinals','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceQueueReport','QueueCalls','uniqueid','ContactId','MailAccountId','Smtp','Dispositions','Interactions','MailApplication','List','TemplateId','MailQueue','team_has_mail_queues','MailInteractionId','Account','Owner','Tag','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','restrict','TagId','ListId','Items','FaxAccountId','Applications','user_has_fax_accounts','Contact','FaxInteractionId','FaxMessage','Interaction','AttachmentId','team_has_fax_queues','SmsAccountId','Answers','sms_interaction_has_tags','user_has_sms_interactions','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelApplication','OpenchannelInteractionId','OpenchannelQueueId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','OpenchannelQueueReport','ChatApplication','Agent','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Members','Company','CompanyId','cm_contact_has_tags','Campaign','CampaignId','OwnerId','Queue','Automation','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','Extensions','MailApplications','ChatApplications','FaxApplications','SmsApplications','AnalyticCustomReport','CustomReportId','whatsapp_interaction_has_tags','AllCondition','TriggerAllId','TriggerId','Fields','DefaultReportId','MetricId','SalesforceConfiguration','Configurations','Subjects','SubjectId','DescriptionId','FieldId','AccountId','Subject','Description','Field','Variable','VariableId','SugarcrmField','Descriptions','DeskField','int_desk_configuration_has_tags','ZohoConfiguration','ZendeskAccount','ZendeskConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','FreshsalesAccount','ToId','SessionId','JscriptyAnswerReport','SmsQueueReport','ProjectId','VoiceQueues','team_has_whatsapp_queues','TrunkBackup','TrunkBackupId','SquareProjectId','MailTransferReport','FromAccount','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToQueue','ChatTransferReport','FromChatWebsiteId','ToUserId','ToAccount','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','CustomFields','HopperHistory','Queues','cm_user_has_lists','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToQueueId','WhatsappQueueId','sequelize','lodash','jstz','motion2','xcall','127.0.0.1','utf8mb4','name','utf8_general_ci','defaultsDeep','sequelizeHistory','xC@LL1234','mysql','utf8','database','username','password','options','../api/user/user.model','VoiceChanSpy','import','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.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','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport'];(function(_0x12c973,_0x2fcf0b){var _0x5d78d5=function(_0x4bf20d){while(--_0x4bf20d){_0x12c973['push'](_0x12c973['shift']());}};_0x5d78d5(++_0x2fcf0b);}(_0x0acf,0x15d));var _0xf0ac=function(_0x769935,_0x2311a5){_0x769935=_0x769935-0x0;var _0x24f62e=_0x0acf[_0x769935];return _0x24f62e;};'use strict';var config=require('../config/environment');var Sequelize=require(_0xf0ac('0x0'));var _=require(_0xf0ac('0x1'));var jstz=require(_0xf0ac('0x2'));var timezone=jstz['determine']();config[_0xf0ac('0x0')]=_['defaultsDeep'](config[_0xf0ac('0x0')],{'database':_0xf0ac('0x3'),'username':_0xf0ac('0x4'),'password':'xC@LL1234','options':{'host':_0xf0ac('0x5'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xf0ac('0x6')},'logging':![],'timezone':timezone[_0xf0ac('0x7')](),'define':{'charset':'utf8','collate':_0xf0ac('0x8')}}});config['sequelizeHistory']=_[_0xf0ac('0x9')](config[_0xf0ac('0xa')],{'database':_0xf0ac('0x3'),'username':_0xf0ac('0x4'),'password':_0xf0ac('0xb'),'options':{'host':_0xf0ac('0x5'),'port':0xcea,'dialect':_0xf0ac('0xc'),'dialectOptions':{'charset':_0xf0ac('0x6')},'logging':![],'timezone':timezone[_0xf0ac('0x7')](),'define':{'charset':_0xf0ac('0xd'),'collate':_0xf0ac('0x8')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf0ac('0x0')][_0xf0ac('0xe')],config[_0xf0ac('0x0')][_0xf0ac('0xf')],config[_0xf0ac('0x0')][_0xf0ac('0x10')],config[_0xf0ac('0x0')][_0xf0ac('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0xf0ac('0xe')],config['sequelizeHistory'][_0xf0ac('0xf')],config[_0xf0ac('0xa')][_0xf0ac('0x10')],config[_0xf0ac('0xa')]['options'])};db['User']=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x12'));db[_0xf0ac('0x13')]=db['sequelize']['import']('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/voiceContext/voiceContext.model');db[_0xf0ac('0x15')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x16'));db[_0xf0ac('0x17')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x18'));db[_0xf0ac('0x19')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x1a'));db[_0xf0ac('0x1b')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x1c'));db[_0xf0ac('0x1d')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x1e'));db['VoiceMail']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x1f'));db[_0xf0ac('0x20')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x21'));db[_0xf0ac('0x22')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x23'));db[_0xf0ac('0x24')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x25'));db[_0xf0ac('0x26')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x27'));db['VoiceQueueReport']=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0xf0ac('0x28')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x29'));db[_0xf0ac('0x2a')]=db['sequelize'][_0xf0ac('0x14')]('../api/trunk/trunk.model');db[_0xf0ac('0x2b')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0xf0ac('0x2c')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x2d'));db[_0xf0ac('0x2e')]=db[_0xf0ac('0x0')]['import']('../api/userVoiceQueue/userVoiceQueue.model');db[_0xf0ac('0x2f')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x30'));db[_0xf0ac('0x31')]=db['sequelize'][_0xf0ac('0x14')]('../api/userMailQueue/userMailQueue.model');db[_0xf0ac('0x32')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x33'));db[_0xf0ac('0x34')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x35'));db[_0xf0ac('0x36')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x37'));db[_0xf0ac('0x38')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x39'));db[_0xf0ac('0x3a')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/mailServerIn/mailServerIn.model');db[_0xf0ac('0x3b')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/mailServerOut/mailServerOut.model');db[_0xf0ac('0x3c')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x3d'));db['MailQueue']=db['sequelize']['import'](_0xf0ac('0x3e'));db[_0xf0ac('0x3f')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0x40'));db[_0xf0ac('0x41')]=db['sequelize'][_0xf0ac('0x14')]('../api/mailInteraction/mailInteraction.model');db[_0xf0ac('0x42')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/mailMessage/mailMessage.model');db['MailApplication']=db['sequelize'][_0xf0ac('0x14')]('../api/mailApplication/mailApplication.model');db[_0xf0ac('0x43')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x44'));db[_0xf0ac('0x45')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0x46'));db[_0xf0ac('0x47')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x48'));db[_0xf0ac('0x49')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x4a'));db[_0xf0ac('0x4b')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x4c'));db['FaxInteraction']=db[_0xf0ac('0x0')]['import']('../api/faxInteraction/faxInteraction.model');db['FaxMessage']=db['sequelize']['import'](_0xf0ac('0x4d'));db[_0xf0ac('0x4e')]=db['sequelize']['import'](_0xf0ac('0x4f'));db[_0xf0ac('0x50')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/faxQueueReport/faxQueueReport.model');db[_0xf0ac('0x51')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x52'));db[_0xf0ac('0x53')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x54'));db[_0xf0ac('0x55')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0x56'));db[_0xf0ac('0x57')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x58'));db['SmsQueue']=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x59'));db['OpenchannelAccount']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x5a'));db['OpenchannelApplication']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x5b'));db['OpenchannelInteraction']=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/openchannelInteraction/openchannelInteraction.model');db['OpenchannelMessage']=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x5c'));db[_0xf0ac('0x5d')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/openchannelQueue/openchannelQueue.model');db[_0xf0ac('0x5e')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x5f'));db['OpenchannelQueueReport']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x60'));db['ChatApplication']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x61'));db[_0xf0ac('0x62')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0x63'));db[_0xf0ac('0x64')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x65'));db['ChatOfflineMessage']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x66'));db[_0xf0ac('0x67')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x68'));db['ChatGroup']=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0x69'));db[_0xf0ac('0x6a')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x6b'));db[_0xf0ac('0x6c')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x6d'));db['CmHopper']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x6e'));db[_0xf0ac('0x6f')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x70'));db[_0xf0ac('0x71')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x72'));db[_0xf0ac('0x73')]=db['sequelize'][_0xf0ac('0x14')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0xf0ac('0x74')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x75'));db[_0xf0ac('0x76')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x77'));db[_0xf0ac('0x78')]=db['sequelize']['import'](_0xf0ac('0x79'));db['Automation']=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/automation/automation.model');db[_0xf0ac('0x7a')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0x7b'));db[_0xf0ac('0x7c')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x7d'));db[_0xf0ac('0x7e')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x7f'));db[_0xf0ac('0x80')]=db['sequelize']['import'](_0xf0ac('0x81'));db[_0xf0ac('0x82')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x83'));db['Cdr']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x84'));db['VoiceQueuesLog']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x85'));db[_0xf0ac('0x86')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x87'));db[_0xf0ac('0x88')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x89'));db['Tag']=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0x8a'));db[_0xf0ac('0x8b')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0x8c'));db[_0xf0ac('0x8d')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x8e'));db['Variable']=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x8f'));db[_0xf0ac('0x90')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0x91'));db[_0xf0ac('0x92')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x93'));db['AnalyticCustomReport']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x94'));db[_0xf0ac('0x95')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x96'));db[_0xf0ac('0x97')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x98'));db[_0xf0ac('0x99')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x9a'));db[_0xf0ac('0x9b')]=db['sequelize']['import'](_0xf0ac('0x9c'));db[_0xf0ac('0x9d')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x9e'));db[_0xf0ac('0x9f')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xa0'));db['SalesforceConfiguration']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xa1'));db[_0xf0ac('0xa2')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0xa3'));db[_0xf0ac('0xa4')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0xa5'));db[_0xf0ac('0xa6')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xa7'));db['SugarcrmField']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xa8'));db[_0xf0ac('0xa9')]=db['sequelize'][_0xf0ac('0x14')]('../api/intDeskAccount/intDeskAccount.model');db[_0xf0ac('0xaa')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xab'));db['DeskField']=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0xac'));db[_0xf0ac('0xad')]=db['sequelize'][_0xf0ac('0x14')]('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db['sequelize']['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xf0ac('0xae')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/intZohoField/intZohoField.model');db['ZendeskAccount']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xaf'));db['ZendeskConfiguration']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xb0'));db[_0xf0ac('0xb1')]=db['sequelize'][_0xf0ac('0x14')]('../api/intZendeskField/intZendeskField.model');db[_0xf0ac('0xb2')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xb3'));db[_0xf0ac('0xb4')]=db['sequelize'][_0xf0ac('0x14')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0xf0ac('0xb5')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0xb6'));db[_0xf0ac('0xb7')]=db['sequelize']['import'](_0xf0ac('0xb8'));db[_0xf0ac('0xb9')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xba'));db[_0xf0ac('0xbb')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0xbc'));db[_0xf0ac('0xbd')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xbe'));db[_0xf0ac('0xbf')]=db['sequelize'][_0xf0ac('0x14')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0xf0ac('0xc0')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0xc1'));db[_0xf0ac('0xc2')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0xc3'));db[_0xf0ac('0xc4')]=db['sequelize'][_0xf0ac('0x14')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xf0ac('0xc5')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xc6'));db['FreshsalesAccount']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xc7'));db[_0xf0ac('0xc8')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0xc9'));db[_0xf0ac('0xca')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0xcb'));db['Integration']=db[_0xf0ac('0x0')]['import']('../api/integration/integration.model');db['Network']=db[_0xf0ac('0x0')]['import'](_0xf0ac('0xcc'));db[_0xf0ac('0xcd')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0xce'));db[_0xf0ac('0xcf')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0xd0'));db['JscriptyAnswerReport']=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0xf0ac('0xd1')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db[_0xf0ac('0xd2')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0xd3'));db['SmsQueueReport']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xd4'));db[_0xf0ac('0xd5')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xd6'));db[_0xf0ac('0xd7')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xd8'));db[_0xf0ac('0xd9')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0xda'));db[_0xf0ac('0xdb')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0xdc'));db[_0xf0ac('0xdd')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xde'));db[_0xf0ac('0xdf')]=db['sequelize']['import'](_0xf0ac('0xe0'));db[_0xf0ac('0xe1')]=db[_0xf0ac('0x0')]['import']('../api/squareRecording/squareRecording.model');db[_0xf0ac('0xe2')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/squareMessage/squareMessage.model');db[_0xf0ac('0xe3')]=db[_0xf0ac('0x0')]['import'](_0xf0ac('0xe4'));db['License']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xe5'));db['Campaign']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xe6'));db[_0xf0ac('0xe7')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xe8'));db[_0xf0ac('0xe9')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/attachment/attachment.model');db[_0xf0ac('0xea')]=db[_0xf0ac('0x0')]['import']('../api/plugin/plugin.model');db['MailTransferReport']=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/mailTransferReport/mailTransferReport.model');db['ChatTransferReport']=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xeb'));db[_0xf0ac('0xec')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xed'));db[_0xf0ac('0xee')]=db['sequelize'][_0xf0ac('0x14')](_0xf0ac('0xef'));db[_0xf0ac('0xf0')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xf1'));db[_0xf0ac('0xf2')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/cmList/cmList.model');db[_0xf0ac('0xf3')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/voicePrefix/voicePrefix.model');db[_0xf0ac('0xf4')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xf5'));db[_0xf0ac('0xf6')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xf7'));db[_0xf0ac('0xf8')]=db['sequelize'][_0xf0ac('0x14')]('../api/userProfileResource/userProfileResource.model');db[_0xf0ac('0xf9')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/userNotification/userNotification.model');db['WhatsappAccount']=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/whatsappAccount/whatsappAccount.model');db[_0xf0ac('0xfa')]=db['sequelize']['import'](_0xf0ac('0xfb'));db[_0xf0ac('0xfc')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0xfd'));db[_0xf0ac('0xfe')]=db['sequelize']['import'](_0xf0ac('0xff'));db['WhatsappQueueReport']=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0xf0ac('0x100')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')]('../api/whatsappTransferReport/whatsappTransferReport.model');db[_0xf0ac('0x101')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x102'));db['CloudProvider']=db[_0xf0ac('0x0')]['import'](_0xf0ac('0x103'));db[_0xf0ac('0x104')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x105'));db[_0xf0ac('0x106')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x107'));db[_0xf0ac('0x108')]=db[_0xf0ac('0x0')][_0xf0ac('0x14')](_0xf0ac('0x109'));db[_0xf0ac('0x10a')][_0xf0ac('0x10b')](db['VoiceMail'],{'as':_0xf0ac('0x10c'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x10e')});db['User']['hasMany'](db['VoiceRecording'],{'as':'Recordings','foreignKey':_0xf0ac('0x10e')});db['User'][_0xf0ac('0x10f')](db['UserVoiceQueueRt'],{'as':_0xf0ac('0x110'),'foreignKey':_0xf0ac('0x10e')});db[_0xf0ac('0x10a')][_0xf0ac('0x10f')](db[_0xf0ac('0x15')],{'as':'Extensions','onDelete':'cascade','hooks':!![]});db[_0xf0ac('0x10a')]['hasMany'](db[_0xf0ac('0x71')],{'as':'HopperFinals','foreignKey':_0xf0ac('0x10e')});db[_0xf0ac('0x10a')][_0xf0ac('0x10f')](db[_0xf0ac('0x73')],{'as':'HopperHistory','foreignKey':'UserId'});db[_0xf0ac('0x10a')]['hasMany'](db['ReportAgentPreview'],{'as':_0xf0ac('0x74'),'foreignKey':_0xf0ac('0x10e')});db[_0xf0ac('0x10a')][_0xf0ac('0x10f')](db[_0xf0ac('0x111')],{'as':_0xf0ac('0x112'),'foreignKey':_0xf0ac('0x10e')});db[_0xf0ac('0x10a')][_0xf0ac('0x10f')](db['ChatInteraction'],{'as':_0xf0ac('0x113'),'foreignKey':_0xf0ac('0x10e')});db[_0xf0ac('0x10a')][_0xf0ac('0x10f')](db['SmsInteraction'],{'as':_0xf0ac('0x114'),'foreignKey':_0xf0ac('0x10e')});db['User'][_0xf0ac('0x10f')](db[_0xf0ac('0x115')],{'as':'FaxInteractions','foreignKey':_0xf0ac('0x10e')});db[_0xf0ac('0x10a')][_0xf0ac('0x10f')](db[_0xf0ac('0x41')],{'as':'MailInteractions','foreignKey':_0xf0ac('0x10e')});db[_0xf0ac('0x10a')][_0xf0ac('0x10f')](db['WhatsappInteraction'],{'as':_0xf0ac('0x116'),'foreignKey':'UserId'});db[_0xf0ac('0x10a')][_0xf0ac('0x10f')](db['UserNotification'],{'as':_0xf0ac('0x117'),'foreignKey':_0xf0ac('0x118')});db['User'][_0xf0ac('0x119')](db[_0xf0ac('0xf4')],{'as':'UserProfile','foreignKey':_0xf0ac('0x11a')});db[_0xf0ac('0x10a')]['belongsToMany'](db[_0xf0ac('0x11b')],{'as':'Groups','through':'chat_group_has_users'});db['User'][_0xf0ac('0x11c')](db[_0xf0ac('0x6c')],{'as':_0xf0ac('0x11d'),'through':_0xf0ac('0x11e')});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db[_0xf0ac('0xf2')],{'as':_0xf0ac('0x11f'),'through':'cm_user_has_lists'});db['User']['belongsToMany'](db[_0xf0ac('0xe3')],{'through':_0xf0ac('0x120')});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db['MailInteraction'],{'as':_0xf0ac('0x121'),'through':_0xf0ac('0x122')});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db['ChatInteraction'],{'as':_0xf0ac('0x113'),'through':_0xf0ac('0x123')});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db[_0xf0ac('0x115')],{'as':_0xf0ac('0x124'),'through':_0xf0ac('0x125')});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db[_0xf0ac('0x55')],{'as':'SmsInteractions','through':'user_has_sms_interactions'});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db[_0xf0ac('0x111')],{'as':_0xf0ac('0x112'),'through':_0xf0ac('0x126')});db[_0xf0ac('0x10a')]['belongsToMany'](db[_0xf0ac('0xfc')],{'as':_0xf0ac('0x116'),'through':_0xf0ac('0x127')});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db[_0xf0ac('0x19')],{'as':'VoiceQueues','through':_0xf0ac('0x2e'),'required':![]});db['User'][_0xf0ac('0x11c')](db[_0xf0ac('0xf3')],{'as':_0xf0ac('0x128'),'through':'UserVoicePrefix','required':![]});db['User']['belongsToMany'](db['MailQueue'],{'as':_0xf0ac('0x129'),'through':'UserMailQueue','required':![]});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db[_0xf0ac('0x67')],{'as':_0xf0ac('0x12a'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db[_0xf0ac('0x4e')],{'as':_0xf0ac('0x12b'),'through':'UserFaxQueue','required':![]});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db[_0xf0ac('0x12c')],{'as':_0xf0ac('0x12d'),'through':_0xf0ac('0x34'),'required':![]});db[_0xf0ac('0x10a')]['belongsToMany'](db[_0xf0ac('0x5d')],{'as':_0xf0ac('0x12e'),'through':_0xf0ac('0x36'),'required':![]});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db['WhatsappQueue'],{'as':_0xf0ac('0x12f'),'through':_0xf0ac('0x38'),'required':![]});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db[_0xf0ac('0xf2')],{'through':'cm_user_has_lists'});db['User'][_0xf0ac('0x11c')](db['ChatWebsite'],{'as':_0xf0ac('0x130'),'through':_0xf0ac('0x131')});db[_0xf0ac('0x10a')]['belongsToMany'](db[_0xf0ac('0x49')],{'as':_0xf0ac('0x132'),'through':'user_has_fax_accounts'});db['User']['belongsToMany'](db[_0xf0ac('0x3c')],{'as':_0xf0ac('0x133'),'through':_0xf0ac('0x134')});db['User'][_0xf0ac('0x11c')](db[_0xf0ac('0x135')],{'as':'OpenchannelAccounts','through':_0xf0ac('0x136')});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db[_0xf0ac('0x51')],{'as':_0xf0ac('0x137'),'through':_0xf0ac('0x138')});db[_0xf0ac('0x10a')]['belongsToMany'](db[_0xf0ac('0x139')],{'as':_0xf0ac('0x13a'),'through':_0xf0ac('0x13b')});db[_0xf0ac('0x10a')][_0xf0ac('0x11c')](db[_0xf0ac('0xdf')],{'as':_0xf0ac('0x13c'),'through':_0xf0ac('0x13d')});db[_0xf0ac('0x13')][_0xf0ac('0x10f')](db[_0xf0ac('0x15')],{'as':_0xf0ac('0x13e'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x13f')});db[_0xf0ac('0x140')][_0xf0ac('0x10f')](db[_0xf0ac('0x15')],{'onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0x15')][_0xf0ac('0x10f')](db[_0xf0ac('0x15')],{'as':'Applications','onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0x17')][_0xf0ac('0x11c')](db[_0xf0ac('0x88')],{'as':_0xf0ac('0x141'),'through':_0xf0ac('0x142')});db[_0xf0ac('0x19')][_0xf0ac('0x10f')](db[_0xf0ac('0x2c')],{'as':'Members','foreignKey':'VoiceQueueId'});db[_0xf0ac('0x19')][_0xf0ac('0x10f')](db[_0xf0ac('0x143')],{'as':_0xf0ac('0x144'),'foreignKey':_0xf0ac('0x145')});db[_0xf0ac('0x19')][_0xf0ac('0x10f')](db['CmHopperFinal'],{'as':_0xf0ac('0x146'),'foreignKey':_0xf0ac('0x145')});db[_0xf0ac('0x19')][_0xf0ac('0x10f')](db['CmHopperHistory'],{'as':_0xf0ac('0x147'),'foreignKey':_0xf0ac('0x145')});db[_0xf0ac('0x19')][_0xf0ac('0x10f')](db[_0xf0ac('0x74')],{'as':_0xf0ac('0x74'),'foreignKey':_0xf0ac('0x145')});db[_0xf0ac('0x19')][_0xf0ac('0x10f')](db[_0xf0ac('0x6f')],{'as':_0xf0ac('0x148'),'foreignKey':'VoiceQueueId'});db[_0xf0ac('0x19')][_0xf0ac('0x10f')](db[_0xf0ac('0xd2')],{'as':_0xf0ac('0x149'),'foreignKey':_0xf0ac('0x145')});db[_0xf0ac('0x19')][_0xf0ac('0x119')](db[_0xf0ac('0x2a')],{'as':'Trunk','foreignKey':_0xf0ac('0x14a')});db[_0xf0ac('0x19')]['belongsTo'](db[_0xf0ac('0x2a')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0xf0ac('0x19')][_0xf0ac('0x119')](db[_0xf0ac('0x80')],{'as':_0xf0ac('0x80'),'foreignKey':_0xf0ac('0x14b')});db['VoiceQueue'][_0xf0ac('0x119')](db[_0xf0ac('0x82')],{'as':_0xf0ac('0x14c'),'foreignKey':_0xf0ac('0x14d')});db[_0xf0ac('0x19')]['belongsToMany'](db['CmList'],{'as':'Lists','through':'voice_queues_has_cm_lists'});db[_0xf0ac('0x19')][_0xf0ac('0x11c')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x14e'),'through':_0xf0ac('0x2e')});db[_0xf0ac('0x19')][_0xf0ac('0x11c')](db[_0xf0ac('0xe3')],{'as':_0xf0ac('0x14f'),'through':_0xf0ac('0x104')});db[_0xf0ac('0x19')][_0xf0ac('0x11c')](db[_0xf0ac('0xf2')],{'as':_0xf0ac('0x150'),'through':_0xf0ac('0x151')});db['VoiceRecording'][_0xf0ac('0x119')](db['User'],{'as':'User','foreignKey':_0xf0ac('0x10e')});db[_0xf0ac('0x1d')]['belongsTo'](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x10a'),'foreignKey':_0xf0ac('0x10e')});db['VoiceMail'][_0xf0ac('0x10f')](db[_0xf0ac('0x20')],{'as':_0xf0ac('0x152'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x153'),'sourceKey':'mailbox'});db['VoiceMailMessage'][_0xf0ac('0x119')](db[_0xf0ac('0x10c')],{'foreignKey':_0xf0ac('0x153'),'targetKey':_0xf0ac('0x154')});db[_0xf0ac('0x22')]['hasMany'](db[_0xf0ac('0x155')],{'as':_0xf0ac('0x156'),'foreignKey':_0xf0ac('0x157'),'constraints':![]});db['VoiceCallReport']['hasMany'](db[_0xf0ac('0x26')],{'as':'AgentReports','foreignKey':_0xf0ac('0x157'),'constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x10a'),'foreignKey':'UserId'});db[_0xf0ac('0x22')][_0xf0ac('0x119')](db['CmContact'],{'as':'Contact','foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0x3a')][_0xf0ac('0x119')](db[_0xf0ac('0x3c')],{'as':_0xf0ac('0x3c'),'foreignKey':_0xf0ac('0x159')});db[_0xf0ac('0x3b')][_0xf0ac('0x119')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xf0ac('0x159')});db[_0xf0ac('0x3c')]['hasOne'](db[_0xf0ac('0x3a')],{'as':'Imap','onDelete':_0xf0ac('0x10d')});db['MailAccount'][_0xf0ac('0x10b')](db[_0xf0ac('0x3b')],{'as':_0xf0ac('0x15a'),'onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0x3c')][_0xf0ac('0x10f')](db[_0xf0ac('0x7c')],{'as':_0xf0ac('0x15b'),'foreignKey':'MailAccountId','onDelete':'cascade'});db[_0xf0ac('0x3c')][_0xf0ac('0x10f')](db[_0xf0ac('0x7a')],{'as':'Answers','foreignKey':_0xf0ac('0x159')});db['MailAccount'][_0xf0ac('0x10f')](db[_0xf0ac('0x42')],{'as':_0xf0ac('0x152'),'foreignKey':_0xf0ac('0x159')});db[_0xf0ac('0x3c')][_0xf0ac('0x10f')](db[_0xf0ac('0x41')],{'as':_0xf0ac('0x15c')});db[_0xf0ac('0x3c')][_0xf0ac('0x10f')](db[_0xf0ac('0x15d')],{'as':'Applications'});db[_0xf0ac('0x3c')][_0xf0ac('0x119')](db[_0xf0ac('0xf2')],{'as':_0xf0ac('0x15e'),'foreignKey':'ListId'});db[_0xf0ac('0x3c')][_0xf0ac('0x119')](db[_0xf0ac('0x8b')],{'as':_0xf0ac('0x8b'),'foreignKey':_0xf0ac('0x15f')});db[_0xf0ac('0x3c')][_0xf0ac('0x119')](db['Pause'],{'as':_0xf0ac('0x14c'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xf0ac('0x3c')][_0xf0ac('0x11c')](db['User'],{'as':'Agents','through':_0xf0ac('0x134')});db[_0xf0ac('0x160')]['belongsToMany'](db['User'],{'as':_0xf0ac('0x14e'),'through':_0xf0ac('0x31')});db[_0xf0ac('0x160')][_0xf0ac('0x11c')](db['Team'],{'through':_0xf0ac('0x161'),'as':_0xf0ac('0x14f')});db[_0xf0ac('0x41')][_0xf0ac('0x10f')](db[_0xf0ac('0x42')],{'as':'Messages','onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x162')});db['MailInteraction']['belongsTo'](db['MailAccount'],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x159')});db['MailInteraction']['belongsTo'](db[_0xf0ac('0x6c')],{'as':'Contact','foreignKey':_0xf0ac('0x158')});db['MailInteraction'][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x164'),'foreignKey':'UserId'});db['MailInteraction']['belongsToMany'](db[_0xf0ac('0x165')],{'through':_0xf0ac('0x166'),'as':_0xf0ac('0x167')});db['MailInteraction']['belongsToMany'](db['Tag'],{'through':_0xf0ac('0x166'),'as':_0xf0ac('0x168')});db[_0xf0ac('0x41')][_0xf0ac('0x11c')](db['User'],{'as':_0xf0ac('0x169'),'through':_0xf0ac('0x122'),'foreignKey':_0xf0ac('0x162')});db[_0xf0ac('0x42')][_0xf0ac('0x10f')](db[_0xf0ac('0xe9')],{'as':_0xf0ac('0x16a'),'onDelete':_0xf0ac('0x10d')});db['MailMessage'][_0xf0ac('0x119')](db['User'],{'as':_0xf0ac('0x10a')});db[_0xf0ac('0x42')][_0xf0ac('0x119')](db[_0xf0ac('0x6c')],{'onDelete':_0xf0ac('0x10d'),'as':'Contact'});db[_0xf0ac('0x42')][_0xf0ac('0x119')](db[_0xf0ac('0x41')],{'as':'Interaction','foreignKey':_0xf0ac('0x162')});db['MailMessage'][_0xf0ac('0x119')](db[_0xf0ac('0x3c')],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x159')});db['MailMessage'][_0xf0ac('0x119')](db[_0xf0ac('0x5e')],{'as':_0xf0ac('0x5e'),'foreignKey':_0xf0ac('0x16b')});db[_0xf0ac('0x42')][_0xf0ac('0x119')](db[_0xf0ac('0x16c')],{'as':'ChatOfflineMessage','foreignKey':_0xf0ac('0x16d')});db[_0xf0ac('0x15d')][_0xf0ac('0x119')](db['User'],{'onDelete':'restrict'});db[_0xf0ac('0x15d')]['belongsTo'](db['MailQueue'],{'onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0x15d')][_0xf0ac('0x119')](db['MailAccount'],{'onDelete':'restrict'});db['MailApplication'][_0xf0ac('0x119')](db[_0xf0ac('0x80')],{'onDelete':'restrict','foreignKey':_0xf0ac('0x14b')});db[_0xf0ac('0x15d')][_0xf0ac('0x119')](db[_0xf0ac('0x165')],{'onDelete':_0xf0ac('0x16e'),'foreignKey':_0xf0ac('0x16f')});db[_0xf0ac('0x43')][_0xf0ac('0x119')](db[_0xf0ac('0x3c')],{});db['MailQueueReport'][_0xf0ac('0x119')](db['CmList'],{'as':'List','foreignKey':_0xf0ac('0x170')});db[_0xf0ac('0x43')][_0xf0ac('0x119')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['MailQueueReport'][_0xf0ac('0x119')](db[_0xf0ac('0x41')],{});db[_0xf0ac('0x43')][_0xf0ac('0x119')](db[_0xf0ac('0x42')],{});db[_0xf0ac('0x43')]['belongsTo'](db[_0xf0ac('0x10a')],{});db[_0xf0ac('0x43')]['belongsTo'](db[_0xf0ac('0x160')],{});db[_0xf0ac('0x45')][_0xf0ac('0x10f')](db[_0xf0ac('0x47')],{'as':_0xf0ac('0x171'),'onDelete':'cascade'});db[_0xf0ac('0x49')][_0xf0ac('0x10f')](db[_0xf0ac('0x7c')],{'as':_0xf0ac('0x15b'),'foreignKey':_0xf0ac('0x172'),'onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0x49')]['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':'FaxAccountId'});db['FaxAccount'][_0xf0ac('0x10f')](db[_0xf0ac('0x115')],{'as':_0xf0ac('0x15c')});db['FaxAccount'][_0xf0ac('0x10f')](db[_0xf0ac('0x4b')],{'as':_0xf0ac('0x173')});db[_0xf0ac('0x49')][_0xf0ac('0x10f')](db[_0xf0ac('0x15')],{'as':'Exntensions','onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0x49')][_0xf0ac('0x10f')](db['FaxMessage'],{'as':_0xf0ac('0x152')});db[_0xf0ac('0x49')]['belongsTo'](db['Trunk'],{'as':'Trunk'});db[_0xf0ac('0x49')]['belongsTo'](db[_0xf0ac('0xf2')],{'as':_0xf0ac('0x15e'),'foreignKey':'ListId'});db[_0xf0ac('0x49')][_0xf0ac('0x119')](db[_0xf0ac('0x82')],{'as':_0xf0ac('0x14c'),'foreignKey':_0xf0ac('0x14d')});db[_0xf0ac('0x49')][_0xf0ac('0x11c')](db['User'],{'as':_0xf0ac('0x14e'),'through':_0xf0ac('0x174')});db[_0xf0ac('0x4b')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0x4b')][_0xf0ac('0x119')](db[_0xf0ac('0x4e')],{'onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0x4b')]['belongsTo'](db[_0xf0ac('0x49')],{'onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0x4b')][_0xf0ac('0x119')](db[_0xf0ac('0x165')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xf0ac('0x115')][_0xf0ac('0x10f')](db['FaxMessage'],{'as':_0xf0ac('0x152'),'onDelete':_0xf0ac('0x10d'),'foreignKey':'FaxInteractionId'});db[_0xf0ac('0x115')]['belongsTo'](db['FaxAccount'],{'as':_0xf0ac('0x163'),'foreignKey':'FaxAccountId'});db[_0xf0ac('0x115')][_0xf0ac('0x119')](db[_0xf0ac('0x6c')],{'as':_0xf0ac('0x175'),'foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0x115')]['belongsTo'](db['User'],{'as':_0xf0ac('0x164'),'foreignKey':_0xf0ac('0x10e')});db[_0xf0ac('0x115')][_0xf0ac('0x11c')](db[_0xf0ac('0x165')],{'through':'fax_interaction_has_tags','as':_0xf0ac('0x167')});db[_0xf0ac('0x115')][_0xf0ac('0x11c')](db[_0xf0ac('0x165')],{'through':'fax_interaction_has_tags','as':_0xf0ac('0x168')});db[_0xf0ac('0x115')][_0xf0ac('0x11c')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x169'),'through':_0xf0ac('0x125'),'foreignKey':_0xf0ac('0x176')});db[_0xf0ac('0x177')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'onDelete':_0xf0ac('0x10d'),'as':_0xf0ac('0x10a')});db[_0xf0ac('0x177')][_0xf0ac('0x119')](db['FaxInteraction'],{'as':_0xf0ac('0x178'),'foreignKey':_0xf0ac('0x176')});db['FaxMessage'][_0xf0ac('0x119')](db['CmContact'],{'onDelete':_0xf0ac('0x10d'),'as':_0xf0ac('0x175')});db['FaxMessage']['belongsTo'](db[_0xf0ac('0xe9')],{'as':'Attachment','foreignKey':_0xf0ac('0x179')});db[_0xf0ac('0x177')][_0xf0ac('0x119')](db[_0xf0ac('0x49')],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x172')});db['FaxQueue'][_0xf0ac('0x11c')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x14e'),'through':_0xf0ac('0x32')});db['FaxQueue'][_0xf0ac('0x11c')](db[_0xf0ac('0xe3')],{'through':_0xf0ac('0x17a'),'as':_0xf0ac('0x14f')});db[_0xf0ac('0x50')][_0xf0ac('0x119')](db['FaxAccount'],{});db[_0xf0ac('0x50')]['belongsTo'](db[_0xf0ac('0xf2')],{'as':_0xf0ac('0x15e'),'foreignKey':'ListId'});db['FaxQueueReport'][_0xf0ac('0x119')](db[_0xf0ac('0x6c')],{'as':_0xf0ac('0x175'),'foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0x50')][_0xf0ac('0x119')](db[_0xf0ac('0x115')],{});db['FaxQueueReport'][_0xf0ac('0x119')](db[_0xf0ac('0x177')],{});db[_0xf0ac('0x50')]['belongsTo'](db[_0xf0ac('0x10a')],{});db[_0xf0ac('0x50')]['belongsTo'](db[_0xf0ac('0x4e')],{});db['SmsAccount'][_0xf0ac('0x10f')](db[_0xf0ac('0x7c')],{'as':_0xf0ac('0x15b'),'foreignKey':_0xf0ac('0x17b'),'onDelete':_0xf0ac('0x10d')});db['SmsAccount'][_0xf0ac('0x10f')](db[_0xf0ac('0x7a')],{'as':_0xf0ac('0x17c'),'foreignKey':'SmsAccountId'});db[_0xf0ac('0x51')][_0xf0ac('0x10f')](db[_0xf0ac('0x57')],{'as':'Messages','foreignKey':_0xf0ac('0x17b')});db['SmsAccount']['hasMany'](db[_0xf0ac('0x55')],{'as':_0xf0ac('0x15c')});db['SmsAccount'][_0xf0ac('0x10f')](db[_0xf0ac('0x53')],{'as':_0xf0ac('0x173')});db[_0xf0ac('0x51')][_0xf0ac('0x119')](db[_0xf0ac('0xf2')],{'as':_0xf0ac('0x15e'),'foreignKey':_0xf0ac('0x170')});db[_0xf0ac('0x51')][_0xf0ac('0x119')](db[_0xf0ac('0x82')],{'as':_0xf0ac('0x14c'),'foreignKey':_0xf0ac('0x14d')});db[_0xf0ac('0x51')][_0xf0ac('0x11c')](db[_0xf0ac('0x10a')],{'as':'Agents','through':_0xf0ac('0x138')});db[_0xf0ac('0x53')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0x53')][_0xf0ac('0x119')](db[_0xf0ac('0x12c')],{'onDelete':'restrict'});db[_0xf0ac('0x53')]['belongsTo'](db['SmsAccount'],{'onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0x53')][_0xf0ac('0x119')](db[_0xf0ac('0x80')],{'onDelete':'restrict','foreignKey':_0xf0ac('0x14b')});db['SmsApplication'][_0xf0ac('0x119')](db[_0xf0ac('0x165')],{'onDelete':'restrict','foreignKey':'TagId'});db[_0xf0ac('0x55')][_0xf0ac('0x10f')](db[_0xf0ac('0x57')],{'as':_0xf0ac('0x152'),'onDelete':_0xf0ac('0x10d'),'foreignKey':'SmsInteractionId'});db[_0xf0ac('0x55')]['belongsTo'](db[_0xf0ac('0x51')],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x17b')});db['SmsInteraction']['belongsTo'](db['CmContact'],{'as':_0xf0ac('0x175'),'foreignKey':_0xf0ac('0x158')});db['SmsInteraction'][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x164'),'foreignKey':_0xf0ac('0x10e')});db[_0xf0ac('0x55')][_0xf0ac('0x11c')](db[_0xf0ac('0x165')],{'through':_0xf0ac('0x17d'),'as':'Tags'});db[_0xf0ac('0x55')][_0xf0ac('0x11c')](db['Tag'],{'through':_0xf0ac('0x17d'),'as':'ThroughTags'});db[_0xf0ac('0x55')][_0xf0ac('0x11c')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x169'),'through':_0xf0ac('0x17e'),'foreignKey':_0xf0ac('0x17f')});db[_0xf0ac('0x57')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x10a')});db[_0xf0ac('0x57')][_0xf0ac('0x119')](db[_0xf0ac('0x6c')],{'onDelete':_0xf0ac('0x10d'),'as':_0xf0ac('0x175')});db['SmsMessage']['belongsTo'](db['SmsInteraction'],{'onDelete':_0xf0ac('0x10d'),'as':_0xf0ac('0x178'),'foreignKey':'SmsInteractionId'});db[_0xf0ac('0x57')][_0xf0ac('0x119')](db['SmsAccount'],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x17b')});db['SmsQueue'][_0xf0ac('0x11c')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x14e'),'through':_0xf0ac('0x34'),'foreignKey':_0xf0ac('0x180')});db[_0xf0ac('0x12c')][_0xf0ac('0x11c')](db[_0xf0ac('0xe3')],{'through':_0xf0ac('0x181'),'as':_0xf0ac('0x14f')});db[_0xf0ac('0x135')][_0xf0ac('0x10f')](db['Disposition'],{'as':_0xf0ac('0x15b'),'foreignKey':_0xf0ac('0x182'),'onDelete':'cascade'});db['OpenchannelAccount'][_0xf0ac('0x10f')](db[_0xf0ac('0x7a')],{'as':_0xf0ac('0x17c'),'foreignKey':_0xf0ac('0x182')});db[_0xf0ac('0x135')][_0xf0ac('0x10f')](db[_0xf0ac('0x111')],{'as':_0xf0ac('0x15c'),'foreignKey':_0xf0ac('0x182')});db[_0xf0ac('0x135')][_0xf0ac('0x10f')](db[_0xf0ac('0x183')],{'as':'Messages','foreignKey':_0xf0ac('0x182')});db[_0xf0ac('0x135')][_0xf0ac('0x10f')](db['OpenchannelApplication'],{'as':'Applications','foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0xf0ac('0x119')](db[_0xf0ac('0xf2')],{'as':_0xf0ac('0x15e'),'foreignKey':_0xf0ac('0x170')});db['OpenchannelAccount'][_0xf0ac('0x119')](db['Pause'],{'as':_0xf0ac('0x14c'),'foreignKey':'mandatoryDispositionPauseId'});db['OpenchannelAccount'][_0xf0ac('0x11c')](db['User'],{'as':_0xf0ac('0x14e'),'through':_0xf0ac('0x136')});db[_0xf0ac('0x184')]['belongsTo'](db[_0xf0ac('0x10a')],{'onDelete':'restrict'});db['OpenchannelApplication'][_0xf0ac('0x119')](db[_0xf0ac('0x5d')],{'onDelete':_0xf0ac('0x16e'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelApplication'][_0xf0ac('0x119')](db['OpenchannelAccount'],{'onDelete':_0xf0ac('0x16e'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelApplication'][_0xf0ac('0x119')](db['Interval'],{'onDelete':_0xf0ac('0x16e'),'foreignKey':_0xf0ac('0x14b')});db[_0xf0ac('0x184')][_0xf0ac('0x119')](db[_0xf0ac('0x165')],{'onDelete':'restrict','foreignKey':_0xf0ac('0x16f')});db[_0xf0ac('0x111')][_0xf0ac('0x10f')](db[_0xf0ac('0x183')],{'as':_0xf0ac('0x152'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x185')});db[_0xf0ac('0x111')][_0xf0ac('0x119')](db[_0xf0ac('0x135')],{'as':_0xf0ac('0x163'),'foreignKey':'OpenchannelAccountId'});db[_0xf0ac('0x111')]['belongsTo'](db[_0xf0ac('0x6c')],{'as':_0xf0ac('0x175'),'foreignKey':_0xf0ac('0x158')});db['OpenchannelInteraction'][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x164'),'foreignKey':'UserId'});db[_0xf0ac('0x111')]['belongsToMany'](db[_0xf0ac('0x165')],{'through':'openchannel_interaction_has_tags','as':_0xf0ac('0x167')});db['OpenchannelInteraction'][_0xf0ac('0x11c')](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0xf0ac('0x168')});db['OpenchannelInteraction'][_0xf0ac('0x11c')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x169'),'through':_0xf0ac('0x126'),'foreignKey':_0xf0ac('0x185')});db[_0xf0ac('0x183')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'onDelete':_0xf0ac('0x10d'),'as':_0xf0ac('0x10a')});db[_0xf0ac('0x183')]['belongsTo'](db['CmContact'],{'onDelete':_0xf0ac('0x10d'),'as':_0xf0ac('0x175')});db[_0xf0ac('0x183')]['belongsTo'](db['OpenchannelInteraction'],{'onDelete':_0xf0ac('0x10d'),'as':_0xf0ac('0x178'),'foreignKey':'OpenchannelInteractionId'});db[_0xf0ac('0x183')][_0xf0ac('0x119')](db[_0xf0ac('0xe9')],{'as':_0xf0ac('0xe9'),'foreignKey':_0xf0ac('0x179')});db[_0xf0ac('0x183')][_0xf0ac('0x119')](db[_0xf0ac('0x135')],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x182')});db[_0xf0ac('0x5d')]['belongsToMany'](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x14e'),'through':_0xf0ac('0x36'),'foreignKey':_0xf0ac('0x186')});db[_0xf0ac('0x5d')][_0xf0ac('0x11c')](db[_0xf0ac('0xe3')],{'through':_0xf0ac('0x187'),'as':'Teams'});db['ChatWebsite'][_0xf0ac('0x10f')](db[_0xf0ac('0x7c')],{'as':_0xf0ac('0x15b'),'foreignKey':_0xf0ac('0x16b'),'onDelete':'cascade'});db[_0xf0ac('0x5e')][_0xf0ac('0x10f')](db['CannedAnswer'],{'as':_0xf0ac('0x17c'),'foreignKey':_0xf0ac('0x16b')});db['ChatWebsite'][_0xf0ac('0x10f')](db[_0xf0ac('0x188')],{'as':_0xf0ac('0x189')});db['ChatWebsite'][_0xf0ac('0x10f')](db[_0xf0ac('0x62')],{'as':_0xf0ac('0x15c')});db[_0xf0ac('0x5e')][_0xf0ac('0x10f')](db['ChatApplication'],{'as':'Applications'});db[_0xf0ac('0x5e')][_0xf0ac('0x10f')](db[_0xf0ac('0x64')],{'as':'Messages'});db[_0xf0ac('0x5e')][_0xf0ac('0x119')](db[_0xf0ac('0xf2')],{'as':'List','foreignKey':_0xf0ac('0x170')});db[_0xf0ac('0x5e')][_0xf0ac('0x119')](db[_0xf0ac('0x80')],{'as':_0xf0ac('0x80'),'foreignKey':_0xf0ac('0x14b')});db['ChatWebsite'][_0xf0ac('0x119')](db['MailAccount'],{'as':_0xf0ac('0x3c'),'foreignKey':_0xf0ac('0x159')});db[_0xf0ac('0x5e')][_0xf0ac('0x119')](db[_0xf0ac('0x82')],{'as':'mandatoryDispositionPause','foreignKey':_0xf0ac('0x14d')});db['ChatWebsite'][_0xf0ac('0x11c')](db[_0xf0ac('0x10a')],{'as':'Agents','through':'user_has_chat_websites'});db[_0xf0ac('0x18a')][_0xf0ac('0x119')](db[_0xf0ac('0x135')],{});db['OpenchannelQueueReport'][_0xf0ac('0x119')](db[_0xf0ac('0xf2')],{'as':_0xf0ac('0x15e'),'foreignKey':'ListId'});db['OpenchannelQueueReport'][_0xf0ac('0x119')](db[_0xf0ac('0x6c')],{'as':_0xf0ac('0x175'),'foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0x18a')][_0xf0ac('0x119')](db['OpenchannelInteraction'],{});db[_0xf0ac('0x18a')][_0xf0ac('0x119')](db[_0xf0ac('0x183')],{});db['OpenchannelQueueReport'][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{});db[_0xf0ac('0x18a')][_0xf0ac('0x119')](db[_0xf0ac('0x5d')],{});db[_0xf0ac('0x18b')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x18c'),'foreignKey':_0xf0ac('0x10e'),'onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0x18b')][_0xf0ac('0x119')](db[_0xf0ac('0x67')],{'as':'Queue','foreignKey':_0xf0ac('0x18d'),'onDelete':'restrict'});db[_0xf0ac('0x18b')][_0xf0ac('0x119')](db[_0xf0ac('0x5e')],{'as':_0xf0ac('0x18e'),'foreignKey':'ChatWebsiteId','onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0x18b')][_0xf0ac('0x119')](db[_0xf0ac('0x165')],{'onDelete':_0xf0ac('0x16e'),'foreignKey':_0xf0ac('0x16f')});db[_0xf0ac('0x62')][_0xf0ac('0x10f')](db[_0xf0ac('0x64')],{'as':_0xf0ac('0x152'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x18f')});db[_0xf0ac('0x62')][_0xf0ac('0x119')](db[_0xf0ac('0x5e')],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x16b')});db[_0xf0ac('0x62')][_0xf0ac('0x119')](db[_0xf0ac('0x6c')],{'as':_0xf0ac('0x175'),'foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0x62')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x164'),'foreignKey':'UserId'});db['ChatInteraction']['belongsToMany'](db[_0xf0ac('0x165')],{'through':_0xf0ac('0x190'),'as':_0xf0ac('0x167')});db[_0xf0ac('0x62')][_0xf0ac('0x11c')](db[_0xf0ac('0x165')],{'through':_0xf0ac('0x190'),'as':_0xf0ac('0x168')});db['ChatInteraction'][_0xf0ac('0x11c')](db['User'],{'as':_0xf0ac('0x169'),'through':_0xf0ac('0x123'),'foreignKey':_0xf0ac('0x18f')});db[_0xf0ac('0x64')][_0xf0ac('0x119')](db['User'],{'onDelete':_0xf0ac('0x10d'),'as':_0xf0ac('0x10a')});db[_0xf0ac('0x64')][_0xf0ac('0x119')](db[_0xf0ac('0x6c')],{'onDelete':_0xf0ac('0x10d'),'as':_0xf0ac('0x175'),'foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0x64')][_0xf0ac('0x119')](db[_0xf0ac('0x62')],{'onDelete':_0xf0ac('0x10d'),'as':'Interaction','foreignKey':'ChatInteractionId'});db[_0xf0ac('0x64')][_0xf0ac('0x119')](db[_0xf0ac('0xe9')],{'as':_0xf0ac('0xe9'),'foreignKey':_0xf0ac('0x179')});db[_0xf0ac('0x64')]['belongsTo'](db[_0xf0ac('0x5e')],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0xf0ac('0x16c')][_0xf0ac('0x10f')](db['Attachment'],{'as':_0xf0ac('0x16a'),'foreignKey':'ChatOfflineMessageId','onDelete':_0xf0ac('0x10d'),'hooks':!![]});db['ChatOfflineMessage']['belongsTo'](db[_0xf0ac('0x6c')],{'onDelete':_0xf0ac('0x10d'),'as':_0xf0ac('0x175'),'foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0x16c')][_0xf0ac('0x119')](db[_0xf0ac('0x5e')],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x16b')});db[_0xf0ac('0x67')][_0xf0ac('0x11c')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x14e'),'through':'UserChatQueue','hooks':!![]});db['ChatQueue'][_0xf0ac('0x11c')](db[_0xf0ac('0xe3')],{'through':_0xf0ac('0x191'),'as':'Teams'});db[_0xf0ac('0x11b')][_0xf0ac('0x10f')](db[_0xf0ac('0xcf')],{'as':'Messages','foreignKey':_0xf0ac('0x192'),'onDelete':_0xf0ac('0x10d')});db['ChatGroup'][_0xf0ac('0x11c')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x193'),'through':'chat_group_has_users'});db[_0xf0ac('0x188')][_0xf0ac('0x119')](db['ChatWebsite'],{'as':_0xf0ac('0x18e'),'foreignKey':_0xf0ac('0x16b')});db[_0xf0ac('0x6a')][_0xf0ac('0x10f')](db[_0xf0ac('0x6c')],{'as':_0xf0ac('0x11d'),'foreignKey':'CompanyId'});db[_0xf0ac('0x6c')]['hasMany'](db[_0xf0ac('0x143')],{'as':_0xf0ac('0x144'),'foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0x6c')][_0xf0ac('0x10f')](db[_0xf0ac('0x71')],{'as':'HopperFinals','foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0x6c')][_0xf0ac('0x10f')](db[_0xf0ac('0x73')],{'as':'HopperHistories','foreignKey':'ContactId'});db['CmContact'][_0xf0ac('0x10f')](db[_0xf0ac('0x74')],{'as':_0xf0ac('0x74'),'foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0x6c')][_0xf0ac('0x10f')](db[_0xf0ac('0xd2')],{'as':_0xf0ac('0x149'),'foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0x6c')]['hasMany'](db[_0xf0ac('0x111')],{'as':'OpenchannelInteractions','foreignKey':_0xf0ac('0x158'),'onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0x6c')][_0xf0ac('0x10f')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0xf0ac('0x158'),'onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0x6c')]['hasMany'](db[_0xf0ac('0x55')],{'as':_0xf0ac('0x114'),'foreignKey':'ContactId','onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0x6c')][_0xf0ac('0x10f')](db[_0xf0ac('0x115')],{'as':_0xf0ac('0x124'),'foreignKey':_0xf0ac('0x158'),'onDelete':'restrict'});db[_0xf0ac('0x6c')]['hasMany'](db['MailInteraction'],{'as':_0xf0ac('0x121'),'foreignKey':_0xf0ac('0x158'),'onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0x6c')][_0xf0ac('0x119')](db[_0xf0ac('0x6a')],{'as':_0xf0ac('0x194'),'foreignKey':_0xf0ac('0x195')});db['CmContact'][_0xf0ac('0x119')](db[_0xf0ac('0xf2')],{'as':'List','foreignKey':_0xf0ac('0x170'),'onDelete':'cascade'});db[_0xf0ac('0x6c')]['belongsToMany'](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x169'),'through':_0xf0ac('0x11e')});db[_0xf0ac('0x6c')][_0xf0ac('0x11c')](db[_0xf0ac('0x165')],{'as':_0xf0ac('0x167'),'through':'cm_contact_has_tags'});db[_0xf0ac('0x6c')][_0xf0ac('0x11c')](db['Tag'],{'through':_0xf0ac('0x196'),'as':'ThroughTags'});db[_0xf0ac('0x143')][_0xf0ac('0x119')](db[_0xf0ac('0x6c')],{'as':_0xf0ac('0x175'),'foreignKey':'ContactId','onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0x143')][_0xf0ac('0x119')](db['CmList'],{'as':_0xf0ac('0x15e'),'foreignKey':_0xf0ac('0x170'),'onDelete':_0xf0ac('0x10d')});db['CmHopper'][_0xf0ac('0x119')](db['User'],{'as':_0xf0ac('0x18c'),'foreignKey':'UserId'});db['CmHopper'][_0xf0ac('0x119')](db[_0xf0ac('0x19')],{'as':'Queue','foreignKey':_0xf0ac('0x145'),'onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0x143')][_0xf0ac('0x119')](db[_0xf0ac('0x197')],{'as':_0xf0ac('0x197'),'foreignKey':_0xf0ac('0x198'),'onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0x143')]['belongsTo'](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x164'),'foreignKey':_0xf0ac('0x199')});db[_0xf0ac('0x6f')][_0xf0ac('0x119')](db[_0xf0ac('0x6c')],{'as':_0xf0ac('0x175'),'foreignKey':'ContactId','onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0x6f')]['belongsTo'](db[_0xf0ac('0xf2')],{'as':'List','foreignKey':_0xf0ac('0x170'),'onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0x6f')]['belongsTo'](db['VoiceQueue'],{'as':_0xf0ac('0x19a'),'foreignKey':'VoiceQueueId','onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0x6f')][_0xf0ac('0x119')](db[_0xf0ac('0x197')],{'as':_0xf0ac('0x197'),'foreignKey':'CampaignId','onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0x19b')][_0xf0ac('0x10f')](db['Condition'],{'as':{'plural':_0xf0ac('0x19c'),'singular':_0xf0ac('0x19d')},'foreignKey':_0xf0ac('0x19e'),'onDelete':_0xf0ac('0x10d'),'hooks':!![]});db[_0xf0ac('0x19b')]['hasMany'](db['Condition'],{'as':{'plural':_0xf0ac('0x19f'),'singular':_0xf0ac('0x1a0')},'foreignKey':_0xf0ac('0x1a1'),'onDelete':'cascade','hooks':!![]});db[_0xf0ac('0x19b')][_0xf0ac('0x10f')](db[_0xf0ac('0x78')],{'as':_0xf0ac('0x1a2'),'foreignKey':_0xf0ac('0x1a3'),'onDelete':_0xf0ac('0x10d'),'hooks':!![]});db[_0xf0ac('0x7c')][_0xf0ac('0x10f')](db[_0xf0ac('0x7c')],{'as':_0xf0ac('0x15b'),'foreignKey':_0xf0ac('0x1a4'),'onDelete':'cascade'});db[_0xf0ac('0x80')][_0xf0ac('0x10f')](db[_0xf0ac('0x80')],{'as':_0xf0ac('0x1a5'),'foreignKey':'IntervalId','onDelete':_0xf0ac('0x10d'),'hooks':!![],'required':![]});db[_0xf0ac('0x80')]['hasMany'](db[_0xf0ac('0x15')],{'as':_0xf0ac('0x1a6'),'foreignKey':_0xf0ac('0x14b'),'onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0x80')]['hasMany'](db[_0xf0ac('0x15d')],{'as':_0xf0ac('0x1a7'),'foreignKey':_0xf0ac('0x14b')});db[_0xf0ac('0x80')][_0xf0ac('0x10f')](db[_0xf0ac('0x18b')],{'as':_0xf0ac('0x1a8'),'foreignKey':_0xf0ac('0x14b')});db['Interval'][_0xf0ac('0x10f')](db[_0xf0ac('0x4b')],{'as':_0xf0ac('0x1a9'),'foreignKey':'IntervalId'});db[_0xf0ac('0x80')]['hasMany'](db[_0xf0ac('0x53')],{'as':_0xf0ac('0x1aa'),'foreignKey':_0xf0ac('0x14b')});db['Schedule'][_0xf0ac('0x119')](db[_0xf0ac('0x3c')],{});db['Schedule'][_0xf0ac('0x119')](db['AnalyticDefaultReport'],{'foreignKey':'DefaultReportId'});db[_0xf0ac('0x86')][_0xf0ac('0x119')](db[_0xf0ac('0x1ab')],{'foreignKey':_0xf0ac('0x1ac')});db['Sound']['belongsToMany'](db['VoiceMusicOnHold'],{'as':'Mohs','through':_0xf0ac('0x142'),'onDelete':_0xf0ac('0x16e')});db['Tag']['belongsToMany'](db[_0xf0ac('0x6c')],{'through':_0xf0ac('0x196')});db[_0xf0ac('0x165')][_0xf0ac('0x11c')](db[_0xf0ac('0x62')],{'through':_0xf0ac('0x190')});db['Tag'][_0xf0ac('0x11c')](db[_0xf0ac('0x41')],{'through':_0xf0ac('0x166')});db['Tag']['belongsToMany'](db[_0xf0ac('0x55')],{'through':_0xf0ac('0x17d')});db[_0xf0ac('0x165')][_0xf0ac('0x11c')](db['FaxInteraction'],{'through':'fax_interaction_has_tags'});db[_0xf0ac('0x165')][_0xf0ac('0x11c')](db[_0xf0ac('0x111')],{'through':'openchannel_interaction_has_tags'});db[_0xf0ac('0x165')][_0xf0ac('0x11c')](db[_0xf0ac('0xfc')],{'through':_0xf0ac('0x1ad')});db[_0xf0ac('0x8d')][_0xf0ac('0x10f')](db[_0xf0ac('0x7e')],{'as':{'plural':'AllConditions','singular':_0xf0ac('0x1ae')},'foreignKey':_0xf0ac('0x1af'),'onDelete':_0xf0ac('0x10d'),'hooks':!![]});db['Trigger']['hasMany'](db[_0xf0ac('0x7e')],{'as':{'plural':'AnyConditions','singular':'AnyCondition'},'foreignKey':'TriggerAnyId','onDelete':_0xf0ac('0x10d'),'hooks':!![]});db[_0xf0ac('0x8d')][_0xf0ac('0x10f')](db['Action'],{'as':'Actions','foreignKey':_0xf0ac('0x1b0'),'onDelete':'cascade','hooks':!![]});db[_0xf0ac('0x1ab')][_0xf0ac('0x10f')](db['AnalyticFieldReport'],{'as':_0xf0ac('0x1b1'),'onDelete':_0xf0ac('0x10d'),'foreignKey':'CustomReportId','hooks':!![]});db['AnalyticDefaultReport'][_0xf0ac('0x10f')](db['AnalyticFieldReport'],{'as':_0xf0ac('0x1b1'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1b2')});db[_0xf0ac('0x99')][_0xf0ac('0x10f')](db[_0xf0ac('0x9b')],{'as':_0xf0ac('0x1b1'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1b3')});db[_0xf0ac('0x9b')][_0xf0ac('0x119')](db[_0xf0ac('0x99')],{'foreignKey':_0xf0ac('0x1b3')});db[_0xf0ac('0x9f')][_0xf0ac('0x10f')](db[_0xf0ac('0x1b4')],{'as':_0xf0ac('0x1b5'),'onDelete':_0xf0ac('0x10d'),'foreignKey':'AccountId'});db['SalesforceConfiguration']['hasMany'](db[_0xf0ac('0xa2')],{'as':_0xf0ac('0x1b6'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1b7')});db[_0xf0ac('0x1b4')][_0xf0ac('0x10f')](db[_0xf0ac('0xa2')],{'as':'Descriptions','onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0x1b4')][_0xf0ac('0x10f')](db[_0xf0ac('0xa2')],{'as':_0xf0ac('0x1b1'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0x1b4')][_0xf0ac('0x119')](db[_0xf0ac('0x9f')],{'as':'Account','foreignKey':_0xf0ac('0x1ba')});db[_0xf0ac('0xa2')][_0xf0ac('0x10f')](db[_0xf0ac('0xa2')],{'as':_0xf0ac('0x1bb'),'foreignKey':_0xf0ac('0x1b7')});db[_0xf0ac('0xa2')][_0xf0ac('0x10f')](db[_0xf0ac('0xa2')],{'as':_0xf0ac('0x1bc'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0xa2')][_0xf0ac('0x10f')](db[_0xf0ac('0xa2')],{'as':_0xf0ac('0x1bd'),'foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0xa2')][_0xf0ac('0x119')](db[_0xf0ac('0x1be')],{'as':_0xf0ac('0x1be'),'foreignKey':_0xf0ac('0x1bf')});db[_0xf0ac('0xa4')]['hasMany'](db[_0xf0ac('0xa6')],{'as':_0xf0ac('0x1b5'),'onDelete':'cascade','foreignKey':_0xf0ac('0x1ba')});db[_0xf0ac('0xa6')][_0xf0ac('0x10f')](db[_0xf0ac('0x1c0')],{'as':'Subjects','onDelete':_0xf0ac('0x10d'),'foreignKey':'SubjectId'});db[_0xf0ac('0xa6')][_0xf0ac('0x10f')](db['SugarcrmField'],{'as':_0xf0ac('0x1c1'),'onDelete':'cascade','foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0xa6')][_0xf0ac('0x10f')](db[_0xf0ac('0x1c0')],{'as':_0xf0ac('0x1b1'),'onDelete':'cascade','foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0xa6')][_0xf0ac('0x119')](db[_0xf0ac('0xa4')],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x1ba')});db[_0xf0ac('0x1c0')][_0xf0ac('0x10f')](db[_0xf0ac('0x1c0')],{'as':'Subject','foreignKey':_0xf0ac('0x1b7')});db[_0xf0ac('0x1c0')]['hasMany'](db[_0xf0ac('0x1c0')],{'as':_0xf0ac('0x1bc'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0x1c0')][_0xf0ac('0x10f')](db[_0xf0ac('0x1c0')],{'as':'Field','foreignKey':_0xf0ac('0x1b9')});db['SugarcrmField']['belongsTo'](db[_0xf0ac('0x1be')],{'as':_0xf0ac('0x1be'),'foreignKey':_0xf0ac('0x1bf')});db[_0xf0ac('0xa9')][_0xf0ac('0x10f')](db[_0xf0ac('0xaa')],{'as':_0xf0ac('0x1b5'),'onDelete':'cascade','foreignKey':_0xf0ac('0x1ba')});db[_0xf0ac('0xaa')][_0xf0ac('0x10f')](db['DeskField'],{'as':_0xf0ac('0x1b6'),'onDelete':'cascade','foreignKey':_0xf0ac('0x1b7')});db['DeskConfiguration'][_0xf0ac('0x10f')](db[_0xf0ac('0x1c2')],{'as':_0xf0ac('0x1c1'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0xaa')]['hasMany'](db[_0xf0ac('0x1c2')],{'as':_0xf0ac('0x1b1'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1b9')});db['DeskConfiguration'][_0xf0ac('0x119')](db['DeskAccount'],{'as':_0xf0ac('0x163'),'foreignKey':'AccountId'});db[_0xf0ac('0xaa')]['belongsToMany'](db[_0xf0ac('0x165')],{'through':_0xf0ac('0x1c3')});db[_0xf0ac('0x1c2')][_0xf0ac('0x10f')](db[_0xf0ac('0x1c2')],{'as':_0xf0ac('0x1bb'),'foreignKey':'SubjectId'});db[_0xf0ac('0x1c2')][_0xf0ac('0x10f')](db['DeskField'],{'as':_0xf0ac('0x1bc'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0x1c2')][_0xf0ac('0x10f')](db[_0xf0ac('0x1c2')],{'as':_0xf0ac('0x1bd'),'foreignKey':'FieldId'});db[_0xf0ac('0x1c2')][_0xf0ac('0x119')](db[_0xf0ac('0x1be')],{'as':_0xf0ac('0x1be'),'foreignKey':_0xf0ac('0x1bf')});db['ZohoAccount'][_0xf0ac('0x10f')](db['ZohoConfiguration'],{'as':'Configurations','onDelete':_0xf0ac('0x10d'),'foreignKey':'AccountId'});db[_0xf0ac('0x1c4')][_0xf0ac('0x10f')](db['ZohoField'],{'as':_0xf0ac('0x1b6'),'onDelete':_0xf0ac('0x10d'),'foreignKey':'SubjectId'});db[_0xf0ac('0x1c4')][_0xf0ac('0x10f')](db[_0xf0ac('0xae')],{'as':_0xf0ac('0x1c1'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0x1c4')][_0xf0ac('0x10f')](db[_0xf0ac('0xae')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0x1c4')][_0xf0ac('0x119')](db['ZohoAccount'],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x1ba')});db[_0xf0ac('0xae')][_0xf0ac('0x10f')](db[_0xf0ac('0xae')],{'as':_0xf0ac('0x1bb'),'foreignKey':_0xf0ac('0x1b7')});db['ZohoField']['hasMany'](db['ZohoField'],{'as':_0xf0ac('0x1bc'),'foreignKey':'DescriptionId'});db[_0xf0ac('0xae')][_0xf0ac('0x10f')](db[_0xf0ac('0xae')],{'as':_0xf0ac('0x1bd'),'foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0xae')][_0xf0ac('0x119')](db[_0xf0ac('0x1be')],{'as':_0xf0ac('0x1be'),'foreignKey':_0xf0ac('0x1bf')});db[_0xf0ac('0x1c5')]['hasMany'](db[_0xf0ac('0x1c6')],{'as':_0xf0ac('0x1b5'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1ba')});db[_0xf0ac('0x1c6')][_0xf0ac('0x10f')](db[_0xf0ac('0xb1')],{'as':_0xf0ac('0x1b6'),'foreignKey':_0xf0ac('0x1b7')});db['ZendeskConfiguration'][_0xf0ac('0x10f')](db[_0xf0ac('0xb1')],{'as':_0xf0ac('0x1c1'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0x1c6')][_0xf0ac('0x10f')](db[_0xf0ac('0xb1')],{'as':'Fields','foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0x1c6')][_0xf0ac('0x119')](db[_0xf0ac('0x1c5')],{'as':'Account','foreignKey':_0xf0ac('0x1ba')});db[_0xf0ac('0x1c6')]['belongsToMany'](db[_0xf0ac('0x165')],{'through':_0xf0ac('0x1c7')});db[_0xf0ac('0xb1')][_0xf0ac('0x10f')](db['ZendeskField'],{'as':_0xf0ac('0x1bb'),'foreignKey':_0xf0ac('0x1b7')});db[_0xf0ac('0xb1')][_0xf0ac('0x10f')](db['ZendeskField'],{'as':_0xf0ac('0x1bc'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0xb1')][_0xf0ac('0x10f')](db['ZendeskField'],{'as':_0xf0ac('0x1bd'),'foreignKey':_0xf0ac('0x1b9')});db['ZendeskField'][_0xf0ac('0x119')](db[_0xf0ac('0x1be')],{'as':'Variable','foreignKey':'VariableId'});db[_0xf0ac('0xb2')]['hasMany'](db[_0xf0ac('0xb4')],{'as':'Configurations','onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1ba')});db[_0xf0ac('0xb4')][_0xf0ac('0x10f')](db[_0xf0ac('0xb5')],{'as':_0xf0ac('0x1b6'),'onDelete':_0xf0ac('0x10d'),'foreignKey':'SubjectId'});db['FreshdeskConfiguration']['hasMany'](db[_0xf0ac('0xb5')],{'as':_0xf0ac('0x1c1'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0xb4')][_0xf0ac('0x10f')](db[_0xf0ac('0xb5')],{'as':_0xf0ac('0x1b1'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0xb4')]['belongsTo'](db[_0xf0ac('0xb2')],{'as':_0xf0ac('0x163'),'foreignKey':'AccountId'});db[_0xf0ac('0xb4')][_0xf0ac('0x11c')](db[_0xf0ac('0x165')],{'through':_0xf0ac('0x1c8')});db[_0xf0ac('0xb5')]['hasMany'](db[_0xf0ac('0xb5')],{'as':_0xf0ac('0x1bb'),'foreignKey':_0xf0ac('0x1b7')});db[_0xf0ac('0xb5')][_0xf0ac('0x10f')](db[_0xf0ac('0xb5')],{'as':_0xf0ac('0x1bc'),'foreignKey':'DescriptionId'});db['FreshdeskField'][_0xf0ac('0x10f')](db[_0xf0ac('0xb5')],{'as':'Field','foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0xb5')][_0xf0ac('0x119')](db['Variable'],{'as':_0xf0ac('0x1be'),'foreignKey':_0xf0ac('0x1bf')});db[_0xf0ac('0xb7')][_0xf0ac('0x10f')](db['VtigerConfiguration'],{'as':'Configurations','onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1ba')});db['VtigerConfiguration']['hasMany'](db['VtigerField'],{'as':_0xf0ac('0x1b6'),'foreignKey':'SubjectId'});db[_0xf0ac('0xb9')][_0xf0ac('0x10f')](db[_0xf0ac('0xbb')],{'as':_0xf0ac('0x1c1'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0xb9')]['hasMany'](db[_0xf0ac('0xbb')],{'as':_0xf0ac('0x1b1'),'foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0xb9')][_0xf0ac('0x119')](db[_0xf0ac('0xb7')],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x1ba')});db[_0xf0ac('0xbb')][_0xf0ac('0x10f')](db[_0xf0ac('0xbb')],{'as':_0xf0ac('0x1bb'),'foreignKey':'SubjectId'});db[_0xf0ac('0xbb')]['hasMany'](db[_0xf0ac('0xbb')],{'as':_0xf0ac('0x1bc'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0xbb')][_0xf0ac('0x10f')](db[_0xf0ac('0xbb')],{'as':_0xf0ac('0x1bd'),'foreignKey':_0xf0ac('0x1b9')});db['VtigerField'][_0xf0ac('0x119')](db[_0xf0ac('0x1be')],{'as':_0xf0ac('0x1be'),'foreignKey':_0xf0ac('0x1bf')});db['ServicenowAccount'][_0xf0ac('0x10f')](db[_0xf0ac('0xbf')],{'as':'Configurations','onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1ba')});db[_0xf0ac('0xbf')][_0xf0ac('0x10f')](db[_0xf0ac('0xc0')],{'as':'Subjects','foreignKey':'SubjectId'});db['ServicenowConfiguration'][_0xf0ac('0x10f')](db['ServicenowField'],{'as':_0xf0ac('0x1c1'),'foreignKey':_0xf0ac('0x1b8')});db['ServicenowConfiguration'][_0xf0ac('0x10f')](db[_0xf0ac('0xc0')],{'as':_0xf0ac('0x1b1'),'foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0xbf')][_0xf0ac('0x119')](db['ServicenowAccount'],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x1ba')});db[_0xf0ac('0xc0')][_0xf0ac('0x10f')](db[_0xf0ac('0xc0')],{'as':_0xf0ac('0x1bb'),'foreignKey':'SubjectId'});db[_0xf0ac('0xc0')][_0xf0ac('0x10f')](db[_0xf0ac('0xc0')],{'as':_0xf0ac('0x1bc'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0xc0')]['hasMany'](db[_0xf0ac('0xc0')],{'as':_0xf0ac('0x1bd'),'foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0xc0')][_0xf0ac('0x119')](db['Variable'],{'as':_0xf0ac('0x1be'),'foreignKey':_0xf0ac('0x1bf')});db[_0xf0ac('0xc2')][_0xf0ac('0x10f')](db[_0xf0ac('0xc4')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db['Dynamics365Configuration']['hasMany'](db[_0xf0ac('0xc5')],{'as':_0xf0ac('0x1b6'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1b7')});db[_0xf0ac('0xc4')][_0xf0ac('0x10f')](db[_0xf0ac('0xc5')],{'as':_0xf0ac('0x1c1'),'onDelete':'cascade','foreignKey':_0xf0ac('0x1b8')});db['Dynamics365Configuration'][_0xf0ac('0x10f')](db[_0xf0ac('0xc5')],{'as':_0xf0ac('0x1b1'),'onDelete':'cascade','foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0xc4')]['belongsTo'](db[_0xf0ac('0xc2')],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x1ba')});db[_0xf0ac('0xc5')][_0xf0ac('0x10f')](db[_0xf0ac('0xc5')],{'as':_0xf0ac('0x1bb'),'foreignKey':_0xf0ac('0x1b7')});db[_0xf0ac('0xc5')][_0xf0ac('0x10f')](db['Dynamics365Field'],{'as':_0xf0ac('0x1bc'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0xc5')][_0xf0ac('0x10f')](db['Dynamics365Field'],{'as':_0xf0ac('0x1bd'),'foreignKey':_0xf0ac('0x1b9')});db['Dynamics365Field'][_0xf0ac('0x119')](db['Variable'],{'as':_0xf0ac('0x1be'),'foreignKey':_0xf0ac('0x1bf')});db[_0xf0ac('0x1c9')]['hasMany'](db[_0xf0ac('0xc8')],{'as':'Configurations','onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1ba')});db['FreshsalesConfiguration']['hasMany'](db[_0xf0ac('0xca')],{'as':_0xf0ac('0x1b6'),'foreignKey':_0xf0ac('0x1b7')});db['FreshsalesConfiguration'][_0xf0ac('0x10f')](db[_0xf0ac('0xca')],{'as':_0xf0ac('0x1c1'),'foreignKey':_0xf0ac('0x1b8')});db[_0xf0ac('0xc8')][_0xf0ac('0x10f')](db['FreshsalesField'],{'as':_0xf0ac('0x1b1'),'foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0xc8')]['belongsTo'](db[_0xf0ac('0x1c9')],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x1ba')});db[_0xf0ac('0xca')]['hasMany'](db[_0xf0ac('0xca')],{'as':_0xf0ac('0x1bb'),'foreignKey':_0xf0ac('0x1b7')});db[_0xf0ac('0xca')][_0xf0ac('0x10f')](db['FreshsalesField'],{'as':_0xf0ac('0x1bc'),'foreignKey':_0xf0ac('0x1b8')});db['FreshsalesField'][_0xf0ac('0x10f')](db[_0xf0ac('0xca')],{'as':_0xf0ac('0x1bd'),'foreignKey':_0xf0ac('0x1b9')});db[_0xf0ac('0xca')][_0xf0ac('0x119')](db[_0xf0ac('0x1be')],{'as':_0xf0ac('0x1be'),'foreignKey':_0xf0ac('0x1bf')});db[_0xf0ac('0xcd')][_0xf0ac('0x119')](db[_0xf0ac('0x5e')],{});db[_0xf0ac('0xcd')][_0xf0ac('0x119')](db['CmList'],{'as':_0xf0ac('0x15e'),'foreignKey':_0xf0ac('0x170')});db['ChatQueueReport'][_0xf0ac('0x119')](db[_0xf0ac('0x6c')],{'as':_0xf0ac('0x175'),'foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0xcd')][_0xf0ac('0x119')](db['ChatInteraction'],{});db['ChatQueueReport']['belongsTo'](db['ChatMessage'],{});db[_0xf0ac('0xcd')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{});db['ChatQueueReport'][_0xf0ac('0x119')](db['ChatQueue'],{});db['ChatInternalMessage'][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'onDelete':_0xf0ac('0x10d'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1ca')});db[_0xf0ac('0xd2')][_0xf0ac('0x10f')](db[_0xf0ac('0xd1')],{'foreignKey':_0xf0ac('0x1cb'),'onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0xd2')][_0xf0ac('0x10f')](db[_0xf0ac('0x1cc')],{'foreignKey':'SessionId','onDelete':'cascade'});db[_0xf0ac('0x1cd')][_0xf0ac('0x119')](db[_0xf0ac('0x51')],{});db['SmsQueueReport'][_0xf0ac('0x119')](db[_0xf0ac('0xf2')],{'as':_0xf0ac('0x15e'),'foreignKey':_0xf0ac('0x170')});db['SmsQueueReport']['belongsTo'](db[_0xf0ac('0x6c')],{'as':_0xf0ac('0x175'),'foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0x1cd')][_0xf0ac('0x119')](db[_0xf0ac('0x55')],{});db[_0xf0ac('0x1cd')][_0xf0ac('0x119')](db[_0xf0ac('0x57')],{});db[_0xf0ac('0x1cd')][_0xf0ac('0x119')](db['User'],{});db['SmsQueueReport'][_0xf0ac('0x119')](db['SmsQueue'],{});db[_0xf0ac('0xd9')]['hasMany'](db[_0xf0ac('0xd2')],{'foreignKey':_0xf0ac('0x1ce')});db[_0xf0ac('0xd9')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0xf0ac('0x1ce')});db[_0xf0ac('0xd9')][_0xf0ac('0x10f')](db[_0xf0ac('0x1cc')],{'foreignKey':_0xf0ac('0x1ce')});db['SquareProject']['belongsToMany'](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x169'),'through':_0xf0ac('0x13d')});db['Team']['belongsToMany'](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x14e'),'through':_0xf0ac('0x120')});db['Team']['belongsToMany'](db[_0xf0ac('0x19')],{'through':_0xf0ac('0x104'),'as':_0xf0ac('0x1cf')});db[_0xf0ac('0xe3')]['belongsToMany'](db[_0xf0ac('0x160')],{'through':'team_has_mail_queues','as':'MailQueues'});db['Team'][_0xf0ac('0x11c')](db['ChatQueue'],{'through':_0xf0ac('0x191'),'as':'ChatQueues'});db[_0xf0ac('0xe3')][_0xf0ac('0x11c')](db[_0xf0ac('0x4e')],{'through':'team_has_fax_queues','as':'FaxQueues'});db[_0xf0ac('0xe3')][_0xf0ac('0x11c')](db[_0xf0ac('0x12c')],{'through':_0xf0ac('0x181'),'as':_0xf0ac('0x12d')});db[_0xf0ac('0xe3')]['belongsToMany'](db[_0xf0ac('0x5d')],{'through':'team_has_openchannel_queues','as':'OpenchannelQueues'});db['Team']['belongsToMany'](db[_0xf0ac('0x101')],{'through':_0xf0ac('0x1d0'),'as':_0xf0ac('0x12f')});db[_0xf0ac('0xe3')][_0xf0ac('0x11c')](db[_0xf0ac('0xf3')],{'through':_0xf0ac('0x106'),'as':_0xf0ac('0x128')});db['Campaign'][_0xf0ac('0x10f')](db['CmHopper'],{'as':_0xf0ac('0x144'),'foreignKey':'CampaignId'});db[_0xf0ac('0x197')][_0xf0ac('0x10f')](db[_0xf0ac('0x71')],{'as':_0xf0ac('0x146'),'foreignKey':_0xf0ac('0x198')});db[_0xf0ac('0x197')][_0xf0ac('0x10f')](db[_0xf0ac('0x73')],{'as':_0xf0ac('0x147'),'foreignKey':_0xf0ac('0x198')});db[_0xf0ac('0x197')]['hasMany'](db[_0xf0ac('0x6f')],{'as':_0xf0ac('0x148'),'foreignKey':_0xf0ac('0x198')});db[_0xf0ac('0x197')][_0xf0ac('0x119')](db[_0xf0ac('0x2a')],{'as':_0xf0ac('0x2a'),'foreignKey':_0xf0ac('0x14a')});db['Campaign'][_0xf0ac('0x119')](db[_0xf0ac('0x2a')],{'as':_0xf0ac('0x1d1'),'foreignKey':_0xf0ac('0x1d2')});db[_0xf0ac('0x197')][_0xf0ac('0x119')](db[_0xf0ac('0x80')],{'as':_0xf0ac('0x80'),'foreignKey':_0xf0ac('0x14b')});db['Campaign']['belongsTo'](db['SquareProject'],{'as':_0xf0ac('0xdf'),'foreignKey':_0xf0ac('0x1d3')});db[_0xf0ac('0x197')][_0xf0ac('0x11c')](db[_0xf0ac('0xf2')],{'as':_0xf0ac('0x11f'),'through':'campaigns_has_cm_lists'});db[_0xf0ac('0x197')]['belongsToMany'](db[_0xf0ac('0xf2')],{'as':'BlackLists','through':'campaigns_has_cm_blacklists'});db[_0xf0ac('0xe9')][_0xf0ac('0x119')](db[_0xf0ac('0x16c')],{'as':_0xf0ac('0x16c'),'foreignKey':_0xf0ac('0x16d')});db[_0xf0ac('0x1d4')]['belongsTo'](db['MailMessage'],{});db['MailTransferReport'][_0xf0ac('0x119')](db['MailInteraction'],{});db[_0xf0ac('0x1d4')][_0xf0ac('0x119')](db[_0xf0ac('0x3c')],{'foreignKey':'FromMailAccountId','as':_0xf0ac('0x1d5')});db['MailTransferReport']['belongsTo'](db[_0xf0ac('0x10a')],{'foreignKey':_0xf0ac('0x1d6'),'as':_0xf0ac('0x1d7')});db['MailTransferReport'][_0xf0ac('0x119')](db['User'],{'foreignKey':'ToUserId','as':_0xf0ac('0x1d8')});db[_0xf0ac('0x1d4')][_0xf0ac('0x119')](db['MailQueue'],{'foreignKey':_0xf0ac('0x1d9'),'as':_0xf0ac('0x1da')});db['MailTransferReport'][_0xf0ac('0x119')](db[_0xf0ac('0x3c')],{'foreignKey':'ToMailAccountId','as':'ToAccount'});db[_0xf0ac('0x1db')][_0xf0ac('0x119')](db[_0xf0ac('0x64')],{});db[_0xf0ac('0x1db')]['belongsTo'](db[_0xf0ac('0x62')],{});db[_0xf0ac('0x1db')]['belongsTo'](db[_0xf0ac('0x5e')],{'foreignKey':_0xf0ac('0x1dc'),'as':'FromAccount'});db[_0xf0ac('0x1db')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'foreignKey':'FromUserId','as':_0xf0ac('0x1d7')});db[_0xf0ac('0x1db')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'foreignKey':_0xf0ac('0x1dd'),'as':_0xf0ac('0x1d8')});db['ChatTransferReport'][_0xf0ac('0x119')](db[_0xf0ac('0x67')],{'foreignKey':'ToChatQueueId','as':_0xf0ac('0x1da')});db[_0xf0ac('0x1db')][_0xf0ac('0x119')](db[_0xf0ac('0x5e')],{'foreignKey':'ToChatWebsiteId','as':_0xf0ac('0x1de')});db['FaxTransferReport']['belongsTo'](db[_0xf0ac('0x177')],{});db[_0xf0ac('0xec')][_0xf0ac('0x119')](db[_0xf0ac('0x115')],{});db[_0xf0ac('0xec')][_0xf0ac('0x119')](db[_0xf0ac('0x49')],{'foreignKey':'FromFaxAccountId','as':_0xf0ac('0x1d5')});db[_0xf0ac('0xec')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'foreignKey':_0xf0ac('0x1d6'),'as':_0xf0ac('0x1d7')});db['FaxTransferReport'][_0xf0ac('0x119')](db['User'],{'foreignKey':_0xf0ac('0x1dd'),'as':_0xf0ac('0x1d8')});db['FaxTransferReport'][_0xf0ac('0x119')](db[_0xf0ac('0x4e')],{'foreignKey':_0xf0ac('0x1df'),'as':_0xf0ac('0x1da')});db['FaxTransferReport'][_0xf0ac('0x119')](db[_0xf0ac('0x49')],{'foreignKey':_0xf0ac('0x1e0'),'as':_0xf0ac('0x1de')});db[_0xf0ac('0xee')]['belongsTo'](db[_0xf0ac('0x183')],{});db[_0xf0ac('0xee')][_0xf0ac('0x119')](db[_0xf0ac('0x111')],{});db[_0xf0ac('0xee')][_0xf0ac('0x119')](db['OpenchannelAccount'],{'foreignKey':_0xf0ac('0x1e1'),'as':_0xf0ac('0x1d5')});db[_0xf0ac('0xee')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'foreignKey':_0xf0ac('0x1d6'),'as':_0xf0ac('0x1d7')});db['OpenchannelTransferReport'][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'foreignKey':'ToUserId','as':_0xf0ac('0x1d8')});db[_0xf0ac('0xee')][_0xf0ac('0x119')](db[_0xf0ac('0x5d')],{'foreignKey':_0xf0ac('0x1e2'),'as':_0xf0ac('0x1da')});db[_0xf0ac('0xee')][_0xf0ac('0x119')](db[_0xf0ac('0x135')],{'foreignKey':_0xf0ac('0x1e3'),'as':_0xf0ac('0x1de')});db[_0xf0ac('0xf0')][_0xf0ac('0x119')](db['SmsMessage'],{});db[_0xf0ac('0xf0')]['belongsTo'](db[_0xf0ac('0x55')],{});db[_0xf0ac('0xf0')][_0xf0ac('0x119')](db['SmsAccount'],{'foreignKey':_0xf0ac('0x1e4'),'as':_0xf0ac('0x1d5')});db[_0xf0ac('0xf0')][_0xf0ac('0x119')](db['User'],{'foreignKey':_0xf0ac('0x1d6'),'as':_0xf0ac('0x1d7')});db[_0xf0ac('0xf0')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'foreignKey':'ToUserId','as':_0xf0ac('0x1d8')});db['SmsTransferReport'][_0xf0ac('0x119')](db[_0xf0ac('0x12c')],{'foreignKey':_0xf0ac('0x1e5'),'as':'ToQueue'});db['SmsTransferReport'][_0xf0ac('0x119')](db['SmsAccount'],{'foreignKey':'ToSmsAccountId','as':_0xf0ac('0x1de')});db[_0xf0ac('0xf2')][_0xf0ac('0x10f')](db[_0xf0ac('0x7c')],{'as':_0xf0ac('0x15b'),'foreignKey':_0xf0ac('0x170'),'onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0xf2')]['hasMany'](db[_0xf0ac('0x76')],{'as':_0xf0ac('0x1e6'),'foreignKey':'ListId'});db[_0xf0ac('0xf2')][_0xf0ac('0x10f')](db[_0xf0ac('0x6c')],{'as':_0xf0ac('0x11d'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x170')});db[_0xf0ac('0xf2')]['hasMany'](db[_0xf0ac('0x71')],{'as':_0xf0ac('0x146'),'foreignKey':'ListId'});db[_0xf0ac('0xf2')][_0xf0ac('0x10f')](db[_0xf0ac('0x73')],{'as':_0xf0ac('0x1e7'),'foreignKey':_0xf0ac('0x170')});db['CmList'][_0xf0ac('0x10f')](db[_0xf0ac('0x74')],{'as':_0xf0ac('0x74'),'foreignKey':_0xf0ac('0x170')});db[_0xf0ac('0xf2')][_0xf0ac('0x11c')](db['VoiceQueue'],{'as':_0xf0ac('0x1e8'),'through':'voice_queues_has_cm_lists'});db['CmList'][_0xf0ac('0x11c')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x14e'),'through':_0xf0ac('0x1e9')});db['VoicePrefix'][_0xf0ac('0x10f')](db[_0xf0ac('0x15')],{'as':'Extensions','onDelete':_0xf0ac('0x10d')});db['VoicePrefix']['belongsToMany'](db['User'],{'as':'Agents','through':_0xf0ac('0x108')});db[_0xf0ac('0xf3')][_0xf0ac('0x11c')](db[_0xf0ac('0xe3')],{'through':_0xf0ac('0x106'),'as':_0xf0ac('0x14f')});db['UserProfile']['hasMany'](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x169'),'foreignKey':_0xf0ac('0x11a')});db[_0xf0ac('0xf4')][_0xf0ac('0x10f')](db['UserProfileSection'],{'as':_0xf0ac('0x1ea'),'foreignKey':'userProfileId','onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0xf6')][_0xf0ac('0x10f')](db['UserProfileResource'],{'as':_0xf0ac('0x1eb'),'foreignKey':_0xf0ac('0x1ec'),'onDelete':_0xf0ac('0x10d')});db[_0xf0ac('0x139')][_0xf0ac('0x10f')](db['Disposition'],{'as':_0xf0ac('0x15b'),'foreignKey':_0xf0ac('0x1ed'),'onDelete':'cascade'});db[_0xf0ac('0x139')]['hasMany'](db['CannedAnswer'],{'as':_0xf0ac('0x17c'),'foreignKey':_0xf0ac('0x1ed')});db['WhatsappAccount'][_0xf0ac('0x10f')](db[_0xf0ac('0xfe')],{'as':_0xf0ac('0x152'),'foreignKey':_0xf0ac('0x1ed')});db[_0xf0ac('0x139')]['hasMany'](db[_0xf0ac('0xfc')],{'as':_0xf0ac('0x15c')});db['WhatsappAccount'][_0xf0ac('0x10f')](db[_0xf0ac('0xfa')],{'as':_0xf0ac('0x173')});db[_0xf0ac('0x139')][_0xf0ac('0x119')](db[_0xf0ac('0xf2')],{'as':_0xf0ac('0x15e'),'foreignKey':_0xf0ac('0x170')});db[_0xf0ac('0x139')][_0xf0ac('0x119')](db['Pause'],{'as':_0xf0ac('0x14c'),'foreignKey':_0xf0ac('0x14d')});db[_0xf0ac('0x139')]['belongsToMany'](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x14e'),'through':_0xf0ac('0x13b')});db[_0xf0ac('0xfa')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'onDelete':'restrict'});db[_0xf0ac('0xfa')][_0xf0ac('0x119')](db['WhatsappQueue'],{'onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0xfa')][_0xf0ac('0x119')](db[_0xf0ac('0x139')],{'onDelete':_0xf0ac('0x16e')});db[_0xf0ac('0xfa')][_0xf0ac('0x119')](db[_0xf0ac('0x80')],{'onDelete':_0xf0ac('0x16e'),'foreignKey':'IntervalId'});db['WhatsappApplication'][_0xf0ac('0x119')](db[_0xf0ac('0x165')],{'onDelete':_0xf0ac('0x16e'),'foreignKey':_0xf0ac('0x16f')});db[_0xf0ac('0xfc')][_0xf0ac('0x10f')](db[_0xf0ac('0xfe')],{'as':_0xf0ac('0x152'),'onDelete':_0xf0ac('0x10d'),'foreignKey':_0xf0ac('0x1ee')});db[_0xf0ac('0xfc')][_0xf0ac('0x119')](db[_0xf0ac('0x139')],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x1ed')});db[_0xf0ac('0xfc')][_0xf0ac('0x119')](db[_0xf0ac('0x6c')],{'as':_0xf0ac('0x175'),'foreignKey':_0xf0ac('0x158')});db[_0xf0ac('0xfc')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'as':'Owner','foreignKey':_0xf0ac('0x10e')});db[_0xf0ac('0xfc')]['belongsToMany'](db['Tag'],{'through':_0xf0ac('0x1ad'),'as':_0xf0ac('0x167')});db[_0xf0ac('0xfc')][_0xf0ac('0x11c')](db[_0xf0ac('0x165')],{'through':_0xf0ac('0x1ad'),'as':_0xf0ac('0x168')});db[_0xf0ac('0xfc')][_0xf0ac('0x11c')](db[_0xf0ac('0x10a')],{'as':'Users','through':_0xf0ac('0x127'),'foreignKey':'WhatsappInteractionId'});db[_0xf0ac('0xfe')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x10a')});db[_0xf0ac('0xfe')][_0xf0ac('0x119')](db[_0xf0ac('0x6c')],{'onDelete':_0xf0ac('0x10d'),'as':_0xf0ac('0x175')});db[_0xf0ac('0xfe')][_0xf0ac('0x119')](db[_0xf0ac('0xfc')],{'onDelete':_0xf0ac('0x10d'),'as':_0xf0ac('0x178'),'foreignKey':_0xf0ac('0x1ee')});db[_0xf0ac('0xfe')][_0xf0ac('0x119')](db[_0xf0ac('0x139')],{'as':_0xf0ac('0x163'),'foreignKey':_0xf0ac('0x1ed')});db[_0xf0ac('0x1ef')][_0xf0ac('0x119')](db[_0xf0ac('0x139')],{});db[_0xf0ac('0x1ef')]['belongsTo'](db[_0xf0ac('0xf2')],{'as':_0xf0ac('0x15e'),'foreignKey':'ListId'});db[_0xf0ac('0x1ef')][_0xf0ac('0x119')](db['CmContact'],{'as':'Contact','foreignKey':_0xf0ac('0x158')});db['WhatsappQueueReport'][_0xf0ac('0x119')](db['WhatsappInteraction'],{});db[_0xf0ac('0x1ef')][_0xf0ac('0x119')](db[_0xf0ac('0x101')],{});db[_0xf0ac('0x1ef')][_0xf0ac('0x119')](db[_0xf0ac('0xfe')],{});db[_0xf0ac('0x1ef')]['belongsTo'](db['User'],{});db[_0xf0ac('0x100')][_0xf0ac('0x119')](db[_0xf0ac('0xfe')],{});db[_0xf0ac('0x100')][_0xf0ac('0x119')](db[_0xf0ac('0xfc')],{});db[_0xf0ac('0x100')]['belongsTo'](db[_0xf0ac('0x139')],{'foreignKey':_0xf0ac('0x1f0'),'as':_0xf0ac('0x1d5')});db[_0xf0ac('0x100')][_0xf0ac('0x119')](db[_0xf0ac('0x139')],{'foreignKey':'ToWhatsappAccountId','as':_0xf0ac('0x1de')});db[_0xf0ac('0x100')][_0xf0ac('0x119')](db[_0xf0ac('0x101')],{'foreignKey':_0xf0ac('0x1f1'),'as':_0xf0ac('0x1da')});db[_0xf0ac('0x100')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'foreignKey':_0xf0ac('0x1d6'),'as':_0xf0ac('0x1d7')});db[_0xf0ac('0x100')][_0xf0ac('0x119')](db[_0xf0ac('0x10a')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0xf0ac('0x101')][_0xf0ac('0x11c')](db[_0xf0ac('0x10a')],{'as':_0xf0ac('0x14e'),'through':_0xf0ac('0x38'),'foreignKey':_0xf0ac('0x1f2')});db[_0xf0ac('0x101')][_0xf0ac('0x11c')](db[_0xf0ac('0xe3')],{'through':_0xf0ac('0x1d0'),'as':_0xf0ac('0x14f')});module['exports']={'db':db,'dbH':dbH};
\ No newline at end of file
+var _0xecd7=['user_has_openchannel_interactions','user_has_whatsapp_interactions','VoicePrefixes','MailQueues','ChatQueues','SmsQueue','SmsQueues','OpenchannelQueue','WhatsappQueues','UserWhatsappQueue','ChatWebsites','user_has_chat_websites','FaxAccounts','MailAccount','user_has_mail_accounts','OpenchannelAccounts','SmsAccounts','user_has_sms_accounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceContext','Applications','Sound','moh_has_sounds','VoiceQueueId','Hoppers','HopperHistories','HopperBlacks','JscriptySessionReport','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','Interval','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Teams','VoiceRecording','Messages','VoiceMailMessage','VoiceCallReport','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','ContactId','MailAccountId','Imap','Smtp','Disposition','Dispositions','Answers','Interactions','MailApplication','List','ListId','TemplateId','Agents','team_has_mail_queues','MailInteractionId','Account','Owner','Tag','mail_interaction_has_tags','ThroughTags','Interaction','ChatOfflineMessageId','restrict','MailQueueReport','DashboardItem','Items','FaxAccountId','Exntensions','FaxMessage','user_has_fax_accounts','TagId','FaxInteractionId','fax_interaction_has_tags','Tags','Users','AttachmentId','UserFaxQueue','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','team_has_sms_queues','OpenchannelAccountId','user_has_openchannel_accounts','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Members','CompanyId','OpenchannelInteractions','CmCompany','Company','cm_contact_has_tags','Agent','OwnerId','Queue','CampaignId','Automation','All','Any','AutomationAnyId','Actions','AutomationId','ParentId','Intervals','Extensions','MailApplications','FaxApplications','SmsApplications','DefaultReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Fields','CustomReportId','AnalyticMetric','MetricId','Configurations','AccountId','Subjects','DescriptionId','Subject','Description','Field','FieldId','Variable','VariableId','SubjectId','Descriptions','int_desk_configuration_has_tags','int_zendesk_configuration_has_tags','VtigerAccount','ServicenowAccount','ToId','SessionId','JscriptyQuestionReport','ProjectId','VoiceQueues','FaxQueues','OpenchannelQueues','team_has_whatsapp_queues','SquareProjectId','BlackLists','FromAccount','FromUserId','ToUserId','ToMailQueueId','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAgent','ToAgent','ToChatQueueId','ToQueue','ToChatWebsiteId','FaxTransferReport','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelAccountId','ToSmsAccountId','CustomFields','Queues','userProfileId','UserProfileSections','sectionId','WhatsappAccountId','WhatsappMessage','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','xcall','database','password','options','username','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','../api/voiceCallReport/voiceCallReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.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','SmsMessage','../api/smsMessage/smsMessage.model','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','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','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','../api/disposition/disposition.model','Condition','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','../api/tag/tag.model','Template','../api/template/template.model','Trigger','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','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','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','Plugin','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','../api/whatsappMessage/whatsappMessage.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','UserId','hasMany','Recordings','VoiceQueuesRt','cascade','CmHopperFinal','HopperFinals','HopperHistory','ChatInteractions','FaxInteractions','WhatsappInteractions','UserNotifications','SenderId','belongsTo','Groups','chat_group_has_users','belongsToMany','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','MailInteraction','MailInteractions','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions'];(function(_0x58965a,_0x2e71db){var _0x254efc=function(_0xf14fb4){while(--_0xf14fb4){_0x58965a['push'](_0x58965a['shift']());}};_0x254efc(++_0x2e71db);}(_0xecd7,0xc7));var _0x7ecd=function(_0x42eec9,_0x226928){_0x42eec9=_0x42eec9-0x0;var _0x49b27a=_0xecd7[_0x42eec9];return _0x49b27a;};'use strict';var config=require(_0x7ecd('0x0'));var Sequelize=require(_0x7ecd('0x1'));var _=require(_0x7ecd('0x2'));var jstz=require(_0x7ecd('0x3'));var timezone=jstz[_0x7ecd('0x4')]();config[_0x7ecd('0x1')]=_[_0x7ecd('0x5')](config[_0x7ecd('0x1')],{'database':_0x7ecd('0x6'),'username':'xcall','password':_0x7ecd('0x7'),'options':{'host':_0x7ecd('0x8'),'port':0xcea,'dialect':_0x7ecd('0x9'),'dialectOptions':{'charset':_0x7ecd('0xa')},'logging':![],'timezone':timezone[_0x7ecd('0xb')](),'define':{'charset':_0x7ecd('0xc'),'collate':_0x7ecd('0xd')}}});config[_0x7ecd('0xe')]=_[_0x7ecd('0x5')](config[_0x7ecd('0xe')],{'database':'motion2','username':_0x7ecd('0xf'),'password':_0x7ecd('0x7'),'options':{'host':_0x7ecd('0x8'),'port':0xcea,'dialect':_0x7ecd('0x9'),'dialectOptions':{'charset':_0x7ecd('0xa')},'logging':![],'timezone':timezone[_0x7ecd('0xb')](),'define':{'charset':_0x7ecd('0xc'),'collate':_0x7ecd('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x7ecd('0x1')][_0x7ecd('0x10')],config[_0x7ecd('0x1')]['username'],config[_0x7ecd('0x1')][_0x7ecd('0x11')],config[_0x7ecd('0x1')][_0x7ecd('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x7ecd('0x10')],config[_0x7ecd('0xe')][_0x7ecd('0x13')],config[_0x7ecd('0xe')]['password'],config[_0x7ecd('0xe')]['options'])};db[_0x7ecd('0x14')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/user/user.model');db[_0x7ecd('0x16')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0x17'));db['VoiceContext']=db[_0x7ecd('0x1')]['import'](_0x7ecd('0x18'));db[_0x7ecd('0x19')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x1a'));db[_0x7ecd('0x1b')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x1c'));db[_0x7ecd('0x1d')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x1e'));db['VoiceRecording']=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/voiceRecording/voiceRecording.model');db[_0x7ecd('0x1f')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x20'));db['VoiceMail']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x21'));db['VoiceMailMessage']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x22'));db['VoiceCallReport']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x23'));db['VoiceDialReport']=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/voiceDialReport/voiceDialReport.model');db['VoiceAgentReport']=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/voiceAgentReport/voiceAgentReport.model');db['VoiceQueueReport']=db['sequelize']['import'](_0x7ecd('0x24'));db[_0x7ecd('0x25')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x26'));db[_0x7ecd('0x27')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0x28'));db['VoiceTransferReport']=db[_0x7ecd('0x1')]['import'](_0x7ecd('0x29'));db[_0x7ecd('0x2a')]=db[_0x7ecd('0x1')]['import']('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0x7ecd('0x2b')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x2c'));db['UserChatQueue']=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/userChatQueue/userChatQueue.model');db[_0x7ecd('0x2d')]=db[_0x7ecd('0x1')]['import'](_0x7ecd('0x2e'));db['UserFaxQueue']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x2f'));db[_0x7ecd('0x30')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0x31'));db[_0x7ecd('0x32')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x33'));db['UserWhatsappQueue']=db['sequelize']['import'](_0x7ecd('0x34'));db[_0x7ecd('0x35')]=db[_0x7ecd('0x1')]['import'](_0x7ecd('0x36'));db[_0x7ecd('0x37')]=db[_0x7ecd('0x1')]['import'](_0x7ecd('0x38'));db['MailAccount']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x39'));db[_0x7ecd('0x3a')]=db['sequelize']['import']('../api/mailQueue/mailQueue.model');db[_0x7ecd('0x3b')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/mailSubstatus/mailSubstatus.model');db['MailInteraction']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x3c'));db[_0x7ecd('0x3d')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x3e'));db['MailApplication']=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db['sequelize']['import'](_0x7ecd('0x3f'));db[_0x7ecd('0x40')]=db['sequelize'][_0x7ecd('0x15')]('../api/dashboard/dashboard.model');db['DashboardItem']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x41'));db[_0x7ecd('0x42')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0x43'));db[_0x7ecd('0x44')]=db['sequelize']['import'](_0x7ecd('0x45'));db[_0x7ecd('0x46')]=db[_0x7ecd('0x1')]['import'](_0x7ecd('0x47'));db['FaxMessage']=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/faxMessage/faxMessage.model');db[_0x7ecd('0x48')]=db[_0x7ecd('0x1')]['import'](_0x7ecd('0x49'));db[_0x7ecd('0x4a')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x4b'));db[_0x7ecd('0x4c')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x4d'));db[_0x7ecd('0x4e')]=db[_0x7ecd('0x1')]['import'](_0x7ecd('0x4f'));db[_0x7ecd('0x50')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0x51'));db[_0x7ecd('0x52')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x53'));db['SmsQueue']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x54'));db[_0x7ecd('0x55')]=db[_0x7ecd('0x1')]['import'](_0x7ecd('0x56'));db[_0x7ecd('0x57')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0x58'));db[_0x7ecd('0x59')]=db['sequelize']['import'](_0x7ecd('0x5a'));db[_0x7ecd('0x5b')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/openchannelMessage/openchannelMessage.model');db['OpenchannelQueue']=db['sequelize'][_0x7ecd('0x15')]('../api/openchannelQueue/openchannelQueue.model');db[_0x7ecd('0x5c')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x5d'));db[_0x7ecd('0x5e')]=db[_0x7ecd('0x1')]['import'](_0x7ecd('0x5f'));db[_0x7ecd('0x60')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x61'));db[_0x7ecd('0x62')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x63'));db[_0x7ecd('0x64')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x65'));db[_0x7ecd('0x66')]=db['sequelize'][_0x7ecd('0x15')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0x7ecd('0x67')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x68'));db[_0x7ecd('0x69')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0x6a'));db[_0x7ecd('0x6b')]=db['sequelize'][_0x7ecd('0x15')]('../api/chatProactiveAction/chatProactiveAction.model');db['CmCompany']=db[_0x7ecd('0x1')]['import']('../api/cmCompany/cmCompany.model');db[_0x7ecd('0x6c')]=db['sequelize']['import'](_0x7ecd('0x6d'));db[_0x7ecd('0x6e')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x6f'));db[_0x7ecd('0x70')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x71'));db['CmHopperFinal']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x72'));db[_0x7ecd('0x73')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0x74'));db[_0x7ecd('0x75')]=db['sequelize']['import'](_0x7ecd('0x76'));db[_0x7ecd('0x77')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x78'));db[_0x7ecd('0x79')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x7a'));db['Automation']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x7b'));db[_0x7ecd('0x7c')]=db['sequelize'][_0x7ecd('0x15')]('../api/cannedAnswer/cannedAnswer.model');db['Disposition']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x7d'));db[_0x7ecd('0x7e')]=db['sequelize'][_0x7ecd('0x15')]('../api/condition/condition.model');db['Interval']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x7f'));db[_0x7ecd('0x80')]=db[_0x7ecd('0x1')]['import'](_0x7ecd('0x81'));db['Cdr']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x82'));db[_0x7ecd('0x83')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x84'));db[_0x7ecd('0x85')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x86'));db['Sound']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x87'));db['Tag']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x88'));db[_0x7ecd('0x89')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x8a'));db[_0x7ecd('0x8b')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/trigger/trigger.model');db['Variable']=db['sequelize'][_0x7ecd('0x15')]('../api/variable/variable.model');db[_0x7ecd('0x8c')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0x8d'));db[_0x7ecd('0x8e')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/integrationReport/integrationReport.model');db[_0x7ecd('0x8f')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/analyticCustomReport/analyticCustomReport.model');db[_0x7ecd('0x90')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x91'));db['AnalyticExtractedReport']=db[_0x7ecd('0x1')]['import']('../api/analyticExtractedReport/analyticExtractedReport.model');db['AnalyticMetric']=db[_0x7ecd('0x1')]['import'](_0x7ecd('0x92'));db[_0x7ecd('0x93')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x7ecd('0x94')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x95'));db[_0x7ecd('0x96')]=db[_0x7ecd('0x1')]['import']('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0x7ecd('0x97')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x98'));db[_0x7ecd('0x99')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/intSalesforceField/intSalesforceField.model');db[_0x7ecd('0x9a')]=db[_0x7ecd('0x1')]['import']('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x7ecd('0x9b')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x7ecd('0x9c')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x9d'));db[_0x7ecd('0x9e')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x9f'));db[_0x7ecd('0xa0')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xa1'));db[_0x7ecd('0xa2')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0xa3'));db[_0x7ecd('0xa4')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xa5'));db[_0x7ecd('0xa6')]=db['sequelize']['import'](_0x7ecd('0xa7'));db[_0x7ecd('0xa8')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/intZohoField/intZohoField.model');db[_0x7ecd('0xa9')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xaa'));db[_0x7ecd('0xab')]=db[_0x7ecd('0x1')]['import'](_0x7ecd('0xac'));db[_0x7ecd('0xad')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xae'));db[_0x7ecd('0xaf')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xb0'));db[_0x7ecd('0xb1')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xb2'));db[_0x7ecd('0xb3')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0xb4'));db['VtigerAccount']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xb5'));db[_0x7ecd('0xb6')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db[_0x7ecd('0xb7')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xb8'));db['ServicenowAccount']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xb9'));db[_0x7ecd('0xba')]=db['sequelize']['import'](_0x7ecd('0xbb'));db[_0x7ecd('0xbc')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xbd'));db[_0x7ecd('0xbe')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xbf'));db[_0x7ecd('0xc0')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xc1'));db[_0x7ecd('0xc2')]=db['sequelize']['import']('../api/intDynamics365Field/intDynamics365Field.model');db[_0x7ecd('0xc3')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xc4'));db[_0x7ecd('0xc5')]=db[_0x7ecd('0x1')]['import'](_0x7ecd('0xc6'));db[_0x7ecd('0xc7')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xc8'));db[_0x7ecd('0x8c')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x8d'));db[_0x7ecd('0xc9')]=db[_0x7ecd('0x1')]['import'](_0x7ecd('0xca'));db[_0x7ecd('0xcb')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/chatQueueReport/chatQueueReport.model');db[_0x7ecd('0xcc')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xcd'));db[_0x7ecd('0xce')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xcf'));db['JscriptyQuestionReport']=db[_0x7ecd('0x1')]['import'](_0x7ecd('0xd0'));db['JscriptySessionReport']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xd1'));db[_0x7ecd('0xd2')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/smsQueueReport/smsQueueReport.model');db[_0x7ecd('0xd3')]=db['sequelize']['import']('../api/squareReport/squareReport.model');db[_0x7ecd('0xd4')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xd5'));db[_0x7ecd('0xd6')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xd7'));db[_0x7ecd('0xd8')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xd9'));db[_0x7ecd('0xda')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/squareOdbc/squareOdbc.model');db[_0x7ecd('0xdb')]=db['sequelize']['import'](_0x7ecd('0xdc'));db['SquareRecording']=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0xdd'));db[_0x7ecd('0xde')]=db[_0x7ecd('0x1')]['import'](_0x7ecd('0xdf'));db[_0x7ecd('0xe0')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xe1'));db[_0x7ecd('0xe2')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xe3'));db[_0x7ecd('0xe4')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xe5'));db[_0x7ecd('0xe6')]=db['sequelize']['import'](_0x7ecd('0xe7'));db[_0x7ecd('0xe8')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/attachment/attachment.model');db[_0x7ecd('0xe9')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/plugin/plugin.model');db[_0x7ecd('0xea')]=db[_0x7ecd('0x1')]['import']('../api/mailTransferReport/mailTransferReport.model');db[_0x7ecd('0xeb')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xec'));db['FaxTransferReport']=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/faxTransferReport/faxTransferReport.model');db[_0x7ecd('0xed')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xee'));db[_0x7ecd('0xef')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xf0'));db[_0x7ecd('0xf1')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0xf2'));db[_0x7ecd('0xf3')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xf4'));db[_0x7ecd('0xf5')]=db['sequelize'][_0x7ecd('0x15')]('../api/userProfile/userProfile.model');db[_0x7ecd('0xf6')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0xf7'));db[_0x7ecd('0xf8')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xf9'));db[_0x7ecd('0xfa')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/userNotification/userNotification.model');db[_0x7ecd('0xfb')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0xfc'));db[_0x7ecd('0xfd')]=db['sequelize'][_0x7ecd('0x15')](_0x7ecd('0xfe'));db[_0x7ecd('0xff')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x100'));db['WhatsappMessage']=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x101'));db['WhatsappQueueReport']=db[_0x7ecd('0x1')][_0x7ecd('0x15')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0x7ecd('0x102')]=db['sequelize']['import'](_0x7ecd('0x103'));db[_0x7ecd('0x104')]=db['sequelize'][_0x7ecd('0x15')]('../api/whatsappQueue/whatsappQueue.model');db[_0x7ecd('0x105')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x106'));db[_0x7ecd('0x107')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x108'));db[_0x7ecd('0x109')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x10a'));db[_0x7ecd('0x10b')]=db[_0x7ecd('0x1')][_0x7ecd('0x15')](_0x7ecd('0x10c'));db[_0x7ecd('0x14')][_0x7ecd('0x10d')](db[_0x7ecd('0x10e')],{'as':_0x7ecd('0x10e'),'onDelete':'cascade','foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x14')][_0x7ecd('0x110')](db['VoiceRecording'],{'as':_0x7ecd('0x111'),'foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x14')][_0x7ecd('0x110')](db[_0x7ecd('0x2a')],{'as':_0x7ecd('0x112'),'foreignKey':_0x7ecd('0x10f')});db['User'][_0x7ecd('0x110')](db[_0x7ecd('0x19')],{'as':'Extensions','onDelete':_0x7ecd('0x113'),'hooks':!![]});db[_0x7ecd('0x14')][_0x7ecd('0x110')](db[_0x7ecd('0x114')],{'as':_0x7ecd('0x115'),'foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x14')]['hasMany'](db['CmHopperHistory'],{'as':_0x7ecd('0x116'),'foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x14')][_0x7ecd('0x110')](db[_0x7ecd('0x75')],{'as':_0x7ecd('0x75'),'foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x14')][_0x7ecd('0x110')](db[_0x7ecd('0x59')],{'as':'OpenchannelInteractions','foreignKey':_0x7ecd('0x10f')});db['User']['hasMany'](db[_0x7ecd('0x62')],{'as':_0x7ecd('0x117'),'foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x14')]['hasMany'](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x14')]['hasMany'](db[_0x7ecd('0x46')],{'as':_0x7ecd('0x118'),'foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x14')]['hasMany'](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x14')][_0x7ecd('0x110')](db[_0x7ecd('0xff')],{'as':_0x7ecd('0x119'),'foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x14')][_0x7ecd('0x110')](db[_0x7ecd('0xfa')],{'as':_0x7ecd('0x11a'),'foreignKey':_0x7ecd('0x11b')});db['User'][_0x7ecd('0x11c')](db[_0x7ecd('0xf5')],{'as':_0x7ecd('0xf5'),'foreignKey':'userProfileId'});db[_0x7ecd('0x14')]['belongsToMany'](db['ChatGroup'],{'as':_0x7ecd('0x11d'),'through':_0x7ecd('0x11e')});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db[_0x7ecd('0x6c')],{'as':_0x7ecd('0x120'),'through':_0x7ecd('0x121')});db['User'][_0x7ecd('0x11f')](db[_0x7ecd('0xf1')],{'as':_0x7ecd('0x122'),'through':_0x7ecd('0x123')});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db['Team'],{'through':_0x7ecd('0x124')});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db[_0x7ecd('0x125')],{'as':_0x7ecd('0x126'),'through':_0x7ecd('0x127')});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db[_0x7ecd('0x62')],{'as':_0x7ecd('0x117'),'through':_0x7ecd('0x128')});db['User'][_0x7ecd('0x11f')](db[_0x7ecd('0x46')],{'as':'FaxInteractions','through':_0x7ecd('0x129')});db['User'][_0x7ecd('0x11f')](db[_0x7ecd('0x50')],{'as':_0x7ecd('0x12a'),'through':_0x7ecd('0x12b')});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db[_0x7ecd('0x59')],{'as':'OpenchannelInteractions','through':_0x7ecd('0x12c')});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db['WhatsappInteraction'],{'as':_0x7ecd('0x119'),'through':_0x7ecd('0x12d')});db[_0x7ecd('0x14')]['belongsToMany'](db['VoiceQueue'],{'as':'VoiceQueues','through':_0x7ecd('0x2b'),'required':![]});db[_0x7ecd('0x14')]['belongsToMany'](db[_0x7ecd('0xf3')],{'as':_0x7ecd('0x12e'),'through':_0x7ecd('0x10b'),'required':![]});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db[_0x7ecd('0x3a')],{'as':_0x7ecd('0x12f'),'through':_0x7ecd('0x2d'),'required':![]});db['User'][_0x7ecd('0x11f')](db[_0x7ecd('0x67')],{'as':_0x7ecd('0x130'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db[_0x7ecd('0x48')],{'as':'FaxQueues','through':'UserFaxQueue','required':![]});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db[_0x7ecd('0x131')],{'as':_0x7ecd('0x132'),'through':_0x7ecd('0x30'),'required':![]});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db[_0x7ecd('0x133')],{'as':'OpenchannelQueues','through':_0x7ecd('0x32'),'required':![]});db[_0x7ecd('0x14')]['belongsToMany'](db[_0x7ecd('0x104')],{'as':_0x7ecd('0x134'),'through':_0x7ecd('0x135'),'required':![]});db[_0x7ecd('0x14')]['belongsToMany'](db['CmList'],{'through':'cm_user_has_lists'});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db[_0x7ecd('0x5c')],{'as':_0x7ecd('0x136'),'through':_0x7ecd('0x137')});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db[_0x7ecd('0x42')],{'as':_0x7ecd('0x138'),'through':'user_has_fax_accounts'});db['User']['belongsToMany'](db[_0x7ecd('0x139')],{'as':'MailAccounts','through':_0x7ecd('0x13a')});db['User'][_0x7ecd('0x11f')](db[_0x7ecd('0x55')],{'as':_0x7ecd('0x13b'),'through':'user_has_openchannel_accounts'});db[_0x7ecd('0x14')]['belongsToMany'](db['SmsAccount'],{'as':_0x7ecd('0x13c'),'through':_0x7ecd('0x13d')});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db[_0x7ecd('0xfb')],{'as':'WhatsappAccounts','through':_0x7ecd('0x13e')});db[_0x7ecd('0x14')][_0x7ecd('0x11f')](db['SquareProject'],{'as':_0x7ecd('0x13f'),'through':_0x7ecd('0x140')});db[_0x7ecd('0x16')][_0x7ecd('0x110')](db[_0x7ecd('0x19')],{'as':_0x7ecd('0x141'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x142')});db[_0x7ecd('0x143')]['hasMany'](db['VoiceExtension'],{'onDelete':_0x7ecd('0x113')});db[_0x7ecd('0x19')][_0x7ecd('0x110')](db[_0x7ecd('0x19')],{'as':_0x7ecd('0x144'),'onDelete':_0x7ecd('0x113')});db[_0x7ecd('0x1b')]['belongsToMany'](db[_0x7ecd('0x145')],{'as':'Sounds','through':_0x7ecd('0x146')});db[_0x7ecd('0x1d')]['hasMany'](db['UserVoiceQueueRt'],{'as':'Members','foreignKey':_0x7ecd('0x147')});db[_0x7ecd('0x1d')][_0x7ecd('0x110')](db[_0x7ecd('0x6e')],{'as':_0x7ecd('0x148'),'foreignKey':'VoiceQueueId'});db[_0x7ecd('0x1d')][_0x7ecd('0x110')](db[_0x7ecd('0x114')],{'as':_0x7ecd('0x115'),'foreignKey':_0x7ecd('0x147')});db['VoiceQueue'][_0x7ecd('0x110')](db[_0x7ecd('0x73')],{'as':_0x7ecd('0x149'),'foreignKey':_0x7ecd('0x147')});db[_0x7ecd('0x1d')]['hasMany'](db[_0x7ecd('0x75')],{'as':_0x7ecd('0x75'),'foreignKey':'VoiceQueueId'});db[_0x7ecd('0x1d')][_0x7ecd('0x110')](db[_0x7ecd('0x70')],{'as':_0x7ecd('0x14a'),'foreignKey':_0x7ecd('0x147')});db['VoiceQueue'][_0x7ecd('0x110')](db[_0x7ecd('0x14b')],{'as':_0x7ecd('0x14c'),'foreignKey':_0x7ecd('0x147')});db['VoiceQueue'][_0x7ecd('0x11c')](db[_0x7ecd('0x27')],{'as':'Trunk','foreignKey':_0x7ecd('0x14d')});db[_0x7ecd('0x1d')][_0x7ecd('0x11c')](db['Trunk'],{'as':_0x7ecd('0x14e'),'foreignKey':_0x7ecd('0x14f')});db[_0x7ecd('0x1d')]['belongsTo'](db[_0x7ecd('0x150')],{'as':_0x7ecd('0x150'),'foreignKey':_0x7ecd('0x151')});db[_0x7ecd('0x1d')][_0x7ecd('0x11c')](db[_0x7ecd('0x80')],{'as':_0x7ecd('0x152'),'foreignKey':_0x7ecd('0x153')});db[_0x7ecd('0x1d')]['belongsToMany'](db[_0x7ecd('0xf1')],{'as':_0x7ecd('0x122'),'through':_0x7ecd('0x154')});db[_0x7ecd('0x1d')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':'Agents','through':_0x7ecd('0x2b')});db[_0x7ecd('0x1d')][_0x7ecd('0x11f')](db[_0x7ecd('0xe0')],{'as':_0x7ecd('0x155'),'through':_0x7ecd('0x107')});db[_0x7ecd('0x1d')][_0x7ecd('0x11f')](db[_0x7ecd('0xf1')],{'as':'BlackLists','through':'voice_queues_has_cm_blacklists'});db[_0x7ecd('0x156')][_0x7ecd('0x11c')](db['User'],{'as':_0x7ecd('0x14'),'foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x1f')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x14'),'foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x10e')][_0x7ecd('0x110')](db['VoiceMailMessage'],{'as':_0x7ecd('0x157'),'onDelete':_0x7ecd('0x113'),'foreignKey':'mailboxuser','sourceKey':'mailbox'});db[_0x7ecd('0x158')][_0x7ecd('0x11c')](db[_0x7ecd('0x10e')],{'foreignKey':'mailboxuser','targetKey':'mailbox'});db[_0x7ecd('0x159')][_0x7ecd('0x110')](db['VoiceQueueReport'],{'as':_0x7ecd('0x15a'),'foreignKey':_0x7ecd('0x15b'),'constraints':![]});db[_0x7ecd('0x159')][_0x7ecd('0x110')](db[_0x7ecd('0x15c')],{'as':_0x7ecd('0x15d'),'foreignKey':_0x7ecd('0x15b'),'constraints':![]});db[_0x7ecd('0x159')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'as':'User','foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x159')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'as':_0x7ecd('0x15e'),'foreignKey':_0x7ecd('0x15f')});db['MailServerIn']['belongsTo'](db[_0x7ecd('0x139')],{'as':_0x7ecd('0x139'),'foreignKey':_0x7ecd('0x160')});db[_0x7ecd('0x37')][_0x7ecd('0x11c')](db[_0x7ecd('0x139')],{'as':'MailAccount','foreignKey':_0x7ecd('0x160')});db[_0x7ecd('0x139')][_0x7ecd('0x10d')](db[_0x7ecd('0x35')],{'as':_0x7ecd('0x161'),'onDelete':_0x7ecd('0x113')});db[_0x7ecd('0x139')][_0x7ecd('0x10d')](db[_0x7ecd('0x37')],{'as':_0x7ecd('0x162'),'onDelete':_0x7ecd('0x113')});db[_0x7ecd('0x139')]['hasMany'](db[_0x7ecd('0x163')],{'as':_0x7ecd('0x164'),'foreignKey':_0x7ecd('0x160'),'onDelete':'cascade'});db[_0x7ecd('0x139')][_0x7ecd('0x110')](db[_0x7ecd('0x7c')],{'as':_0x7ecd('0x165'),'foreignKey':'MailAccountId'});db[_0x7ecd('0x139')]['hasMany'](db[_0x7ecd('0x3d')],{'as':'Messages','foreignKey':'MailAccountId'});db[_0x7ecd('0x139')]['hasMany'](db[_0x7ecd('0x125')],{'as':_0x7ecd('0x166')});db[_0x7ecd('0x139')][_0x7ecd('0x110')](db[_0x7ecd('0x167')],{'as':'Applications'});db['MailAccount'][_0x7ecd('0x11c')](db[_0x7ecd('0xf1')],{'as':_0x7ecd('0x168'),'foreignKey':_0x7ecd('0x169')});db[_0x7ecd('0x139')][_0x7ecd('0x11c')](db[_0x7ecd('0x89')],{'as':_0x7ecd('0x89'),'foreignKey':_0x7ecd('0x16a')});db[_0x7ecd('0x139')][_0x7ecd('0x11c')](db['Pause'],{'as':_0x7ecd('0x152'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x7ecd('0x139')]['belongsToMany'](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x16b'),'through':_0x7ecd('0x13a')});db[_0x7ecd('0x3a')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':'Agents','through':_0x7ecd('0x2d')});db[_0x7ecd('0x3a')]['belongsToMany'](db['Team'],{'through':_0x7ecd('0x16c'),'as':_0x7ecd('0x155')});db[_0x7ecd('0x125')]['hasMany'](db['MailMessage'],{'as':_0x7ecd('0x157'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x16d')});db[_0x7ecd('0x125')][_0x7ecd('0x11c')](db[_0x7ecd('0x139')],{'as':_0x7ecd('0x16e'),'foreignKey':_0x7ecd('0x160')});db[_0x7ecd('0x125')][_0x7ecd('0x11c')](db['CmContact'],{'as':_0x7ecd('0x15e'),'foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0x125')]['belongsTo'](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x16f'),'foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x125')][_0x7ecd('0x11f')](db[_0x7ecd('0x170')],{'through':'mail_interaction_has_tags','as':'Tags'});db[_0x7ecd('0x125')][_0x7ecd('0x11f')](db[_0x7ecd('0x170')],{'through':_0x7ecd('0x171'),'as':_0x7ecd('0x172')});db[_0x7ecd('0x125')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':'Users','through':_0x7ecd('0x127'),'foreignKey':_0x7ecd('0x16d')});db['MailMessage'][_0x7ecd('0x110')](db[_0x7ecd('0xe8')],{'as':'Attachments','onDelete':'cascade'});db[_0x7ecd('0x3d')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x14')});db[_0x7ecd('0x3d')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'onDelete':_0x7ecd('0x113'),'as':_0x7ecd('0x15e')});db[_0x7ecd('0x3d')][_0x7ecd('0x11c')](db[_0x7ecd('0x125')],{'as':_0x7ecd('0x173'),'foreignKey':_0x7ecd('0x16d')});db['MailMessage'][_0x7ecd('0x11c')](db['MailAccount'],{'as':'Account','foreignKey':_0x7ecd('0x160')});db[_0x7ecd('0x3d')][_0x7ecd('0x11c')](db[_0x7ecd('0x5c')],{'as':_0x7ecd('0x5c'),'foreignKey':'ChatWebsiteId'});db[_0x7ecd('0x3d')][_0x7ecd('0x11c')](db[_0x7ecd('0x66')],{'as':_0x7ecd('0x66'),'foreignKey':_0x7ecd('0x174')});db[_0x7ecd('0x167')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'onDelete':'restrict'});db[_0x7ecd('0x167')][_0x7ecd('0x11c')](db['MailQueue'],{'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0x167')][_0x7ecd('0x11c')](db[_0x7ecd('0x139')],{'onDelete':'restrict'});db[_0x7ecd('0x167')]['belongsTo'](db['Interval'],{'onDelete':_0x7ecd('0x175'),'foreignKey':_0x7ecd('0x151')});db['MailApplication'][_0x7ecd('0x11c')](db[_0x7ecd('0x170')],{'onDelete':_0x7ecd('0x175'),'foreignKey':'TagId'});db[_0x7ecd('0x176')][_0x7ecd('0x11c')](db[_0x7ecd('0x139')],{});db[_0x7ecd('0x176')][_0x7ecd('0x11c')](db[_0x7ecd('0xf1')],{'as':'List','foreignKey':_0x7ecd('0x169')});db[_0x7ecd('0x176')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'as':_0x7ecd('0x15e'),'foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0x176')][_0x7ecd('0x11c')](db[_0x7ecd('0x125')],{});db['MailQueueReport'][_0x7ecd('0x11c')](db['MailMessage'],{});db['MailQueueReport'][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{});db[_0x7ecd('0x176')]['belongsTo'](db['MailQueue'],{});db[_0x7ecd('0x40')][_0x7ecd('0x110')](db[_0x7ecd('0x177')],{'as':_0x7ecd('0x178'),'onDelete':_0x7ecd('0x113')});db[_0x7ecd('0x42')][_0x7ecd('0x110')](db[_0x7ecd('0x163')],{'as':_0x7ecd('0x164'),'foreignKey':'FaxAccountId','onDelete':_0x7ecd('0x113')});db[_0x7ecd('0x42')][_0x7ecd('0x110')](db['CannedAnswer'],{'as':_0x7ecd('0x165'),'foreignKey':_0x7ecd('0x179')});db[_0x7ecd('0x42')][_0x7ecd('0x110')](db[_0x7ecd('0x46')],{'as':_0x7ecd('0x166')});db[_0x7ecd('0x42')][_0x7ecd('0x110')](db[_0x7ecd('0x44')],{'as':_0x7ecd('0x144')});db[_0x7ecd('0x42')][_0x7ecd('0x110')](db[_0x7ecd('0x19')],{'as':_0x7ecd('0x17a'),'onDelete':'cascade'});db['FaxAccount'][_0x7ecd('0x110')](db[_0x7ecd('0x17b')],{'as':_0x7ecd('0x157')});db['FaxAccount'][_0x7ecd('0x11c')](db[_0x7ecd('0x27')],{'as':_0x7ecd('0x27')});db[_0x7ecd('0x42')][_0x7ecd('0x11c')](db[_0x7ecd('0xf1')],{'as':_0x7ecd('0x168'),'foreignKey':_0x7ecd('0x169')});db[_0x7ecd('0x42')][_0x7ecd('0x11c')](db[_0x7ecd('0x80')],{'as':_0x7ecd('0x152'),'foreignKey':_0x7ecd('0x153')});db[_0x7ecd('0x42')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':'Agents','through':_0x7ecd('0x17c')});db[_0x7ecd('0x44')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0x44')][_0x7ecd('0x11c')](db['FaxQueue'],{'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0x44')][_0x7ecd('0x11c')](db[_0x7ecd('0x42')],{'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0x44')][_0x7ecd('0x11c')](db['Tag'],{'onDelete':_0x7ecd('0x175'),'foreignKey':_0x7ecd('0x17d')});db[_0x7ecd('0x46')]['hasMany'](db[_0x7ecd('0x17b')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x7ecd('0x17e')});db[_0x7ecd('0x46')][_0x7ecd('0x11c')](db['FaxAccount'],{'as':_0x7ecd('0x16e'),'foreignKey':_0x7ecd('0x179')});db[_0x7ecd('0x46')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'as':_0x7ecd('0x15e'),'foreignKey':'ContactId'});db[_0x7ecd('0x46')]['belongsTo'](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x16f'),'foreignKey':'UserId'});db[_0x7ecd('0x46')][_0x7ecd('0x11f')](db[_0x7ecd('0x170')],{'through':_0x7ecd('0x17f'),'as':_0x7ecd('0x180')});db[_0x7ecd('0x46')][_0x7ecd('0x11f')](db[_0x7ecd('0x170')],{'through':_0x7ecd('0x17f'),'as':_0x7ecd('0x172')});db['FaxInteraction']['belongsToMany'](db['User'],{'as':_0x7ecd('0x181'),'through':_0x7ecd('0x129'),'foreignKey':'FaxInteractionId'});db[_0x7ecd('0x17b')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'onDelete':_0x7ecd('0x113'),'as':_0x7ecd('0x14')});db['FaxMessage'][_0x7ecd('0x11c')](db[_0x7ecd('0x46')],{'as':'Interaction','foreignKey':_0x7ecd('0x17e')});db[_0x7ecd('0x17b')]['belongsTo'](db[_0x7ecd('0x6c')],{'onDelete':'cascade','as':_0x7ecd('0x15e')});db[_0x7ecd('0x17b')][_0x7ecd('0x11c')](db[_0x7ecd('0xe8')],{'as':'Attachment','foreignKey':_0x7ecd('0x182')});db[_0x7ecd('0x17b')]['belongsTo'](db[_0x7ecd('0x42')],{'as':_0x7ecd('0x16e'),'foreignKey':'FaxAccountId'});db[_0x7ecd('0x48')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x16b'),'through':_0x7ecd('0x183')});db[_0x7ecd('0x48')]['belongsToMany'](db[_0x7ecd('0xe0')],{'through':_0x7ecd('0x184'),'as':_0x7ecd('0x155')});db[_0x7ecd('0x4a')][_0x7ecd('0x11c')](db[_0x7ecd('0x42')],{});db['FaxQueueReport'][_0x7ecd('0x11c')](db[_0x7ecd('0xf1')],{'as':_0x7ecd('0x168'),'foreignKey':'ListId'});db[_0x7ecd('0x4a')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'as':_0x7ecd('0x15e'),'foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0x4a')]['belongsTo'](db['FaxInteraction'],{});db[_0x7ecd('0x4a')][_0x7ecd('0x11c')](db['FaxMessage'],{});db['FaxQueueReport'][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{});db[_0x7ecd('0x4a')]['belongsTo'](db['FaxQueue'],{});db[_0x7ecd('0x4c')]['hasMany'](db['Disposition'],{'as':_0x7ecd('0x164'),'foreignKey':_0x7ecd('0x185'),'onDelete':'cascade'});db[_0x7ecd('0x4c')][_0x7ecd('0x110')](db[_0x7ecd('0x7c')],{'as':_0x7ecd('0x165'),'foreignKey':_0x7ecd('0x185')});db[_0x7ecd('0x4c')][_0x7ecd('0x110')](db[_0x7ecd('0x52')],{'as':_0x7ecd('0x157'),'foreignKey':'SmsAccountId'});db[_0x7ecd('0x4c')]['hasMany'](db['SmsInteraction'],{'as':_0x7ecd('0x166')});db[_0x7ecd('0x4c')]['hasMany'](db[_0x7ecd('0x4e')],{'as':_0x7ecd('0x144')});db[_0x7ecd('0x4c')][_0x7ecd('0x11c')](db[_0x7ecd('0xf1')],{'as':_0x7ecd('0x168'),'foreignKey':_0x7ecd('0x169')});db[_0x7ecd('0x4c')][_0x7ecd('0x11c')](db['Pause'],{'as':_0x7ecd('0x152'),'foreignKey':_0x7ecd('0x153')});db[_0x7ecd('0x4c')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x16b'),'through':'user_has_sms_accounts'});db[_0x7ecd('0x4e')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0x4e')][_0x7ecd('0x11c')](db[_0x7ecd('0x131')],{'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0x4e')][_0x7ecd('0x11c')](db['SmsAccount'],{'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0x4e')][_0x7ecd('0x11c')](db[_0x7ecd('0x150')],{'onDelete':_0x7ecd('0x175'),'foreignKey':_0x7ecd('0x151')});db[_0x7ecd('0x4e')]['belongsTo'](db[_0x7ecd('0x170')],{'onDelete':_0x7ecd('0x175'),'foreignKey':_0x7ecd('0x17d')});db[_0x7ecd('0x50')]['hasMany'](db[_0x7ecd('0x52')],{'as':'Messages','onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x186')});db['SmsInteraction'][_0x7ecd('0x11c')](db['SmsAccount'],{'as':'Account','foreignKey':'SmsAccountId'});db[_0x7ecd('0x50')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'as':'Contact','foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0x50')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'as':'Owner','foreignKey':'UserId'});db['SmsInteraction'][_0x7ecd('0x11f')](db[_0x7ecd('0x170')],{'through':_0x7ecd('0x187'),'as':_0x7ecd('0x180')});db['SmsInteraction'][_0x7ecd('0x11f')](db[_0x7ecd('0x170')],{'through':_0x7ecd('0x187'),'as':_0x7ecd('0x172')});db[_0x7ecd('0x50')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x181'),'through':_0x7ecd('0x12b'),'foreignKey':_0x7ecd('0x186')});db[_0x7ecd('0x52')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x14')});db[_0x7ecd('0x52')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'onDelete':_0x7ecd('0x113'),'as':'Contact'});db[_0x7ecd('0x52')][_0x7ecd('0x11c')](db['SmsInteraction'],{'onDelete':_0x7ecd('0x113'),'as':'Interaction','foreignKey':_0x7ecd('0x186')});db[_0x7ecd('0x52')]['belongsTo'](db['SmsAccount'],{'as':_0x7ecd('0x16e'),'foreignKey':'SmsAccountId'});db[_0x7ecd('0x131')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':'Agents','through':_0x7ecd('0x30'),'foreignKey':'SmsQueueId'});db[_0x7ecd('0x131')][_0x7ecd('0x11f')](db['Team'],{'through':_0x7ecd('0x188'),'as':'Teams'});db[_0x7ecd('0x55')]['hasMany'](db[_0x7ecd('0x163')],{'as':_0x7ecd('0x164'),'foreignKey':_0x7ecd('0x189'),'onDelete':_0x7ecd('0x113')});db['OpenchannelAccount'][_0x7ecd('0x110')](db['CannedAnswer'],{'as':_0x7ecd('0x165'),'foreignKey':_0x7ecd('0x189')});db[_0x7ecd('0x55')][_0x7ecd('0x110')](db['OpenchannelInteraction'],{'as':_0x7ecd('0x166'),'foreignKey':_0x7ecd('0x189')});db[_0x7ecd('0x55')][_0x7ecd('0x110')](db['OpenchannelMessage'],{'as':_0x7ecd('0x157'),'foreignKey':_0x7ecd('0x189')});db[_0x7ecd('0x55')][_0x7ecd('0x110')](db[_0x7ecd('0x57')],{'as':_0x7ecd('0x144'),'foreignKey':_0x7ecd('0x189')});db[_0x7ecd('0x55')][_0x7ecd('0x11c')](db['CmList'],{'as':_0x7ecd('0x168'),'foreignKey':'ListId'});db['OpenchannelAccount']['belongsTo'](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x7ecd('0x55')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x16b'),'through':_0x7ecd('0x18a')});db[_0x7ecd('0x57')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0x57')][_0x7ecd('0x11c')](db[_0x7ecd('0x133')],{'onDelete':_0x7ecd('0x175'),'foreignKey':_0x7ecd('0x18b')});db[_0x7ecd('0x57')][_0x7ecd('0x11c')](db[_0x7ecd('0x55')],{'onDelete':_0x7ecd('0x175'),'foreignKey':_0x7ecd('0x189')});db[_0x7ecd('0x57')][_0x7ecd('0x11c')](db[_0x7ecd('0x150')],{'onDelete':_0x7ecd('0x175'),'foreignKey':'IntervalId'});db[_0x7ecd('0x57')][_0x7ecd('0x11c')](db[_0x7ecd('0x170')],{'onDelete':_0x7ecd('0x175'),'foreignKey':_0x7ecd('0x17d')});db['OpenchannelInteraction'][_0x7ecd('0x110')](db[_0x7ecd('0x5b')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x7ecd('0x18c')});db['OpenchannelInteraction'][_0x7ecd('0x11c')](db[_0x7ecd('0x55')],{'as':'Account','foreignKey':_0x7ecd('0x189')});db[_0x7ecd('0x59')][_0x7ecd('0x11c')](db['CmContact'],{'as':_0x7ecd('0x15e'),'foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0x59')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x16f'),'foreignKey':_0x7ecd('0x10f')});db['OpenchannelInteraction'][_0x7ecd('0x11f')](db['Tag'],{'through':_0x7ecd('0x18d'),'as':'Tags'});db[_0x7ecd('0x59')][_0x7ecd('0x11f')](db[_0x7ecd('0x170')],{'through':'openchannel_interaction_has_tags','as':_0x7ecd('0x172')});db[_0x7ecd('0x59')][_0x7ecd('0x11f')](db['User'],{'as':_0x7ecd('0x181'),'through':'user_has_openchannel_interactions','foreignKey':_0x7ecd('0x18c')});db[_0x7ecd('0x5b')][_0x7ecd('0x11c')](db['User'],{'onDelete':_0x7ecd('0x113'),'as':_0x7ecd('0x14')});db[_0x7ecd('0x5b')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'onDelete':'cascade','as':_0x7ecd('0x15e')});db['OpenchannelMessage'][_0x7ecd('0x11c')](db[_0x7ecd('0x59')],{'onDelete':_0x7ecd('0x113'),'as':_0x7ecd('0x173'),'foreignKey':'OpenchannelInteractionId'});db[_0x7ecd('0x5b')][_0x7ecd('0x11c')](db[_0x7ecd('0xe8')],{'as':_0x7ecd('0xe8'),'foreignKey':'AttachmentId'});db[_0x7ecd('0x5b')][_0x7ecd('0x11c')](db['OpenchannelAccount'],{'as':_0x7ecd('0x16e'),'foreignKey':_0x7ecd('0x189')});db[_0x7ecd('0x133')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x16b'),'through':_0x7ecd('0x32'),'foreignKey':_0x7ecd('0x18b')});db['OpenchannelQueue'][_0x7ecd('0x11f')](db[_0x7ecd('0xe0')],{'through':_0x7ecd('0x18e'),'as':_0x7ecd('0x155')});db[_0x7ecd('0x5c')][_0x7ecd('0x110')](db[_0x7ecd('0x163')],{'as':_0x7ecd('0x164'),'foreignKey':_0x7ecd('0x18f'),'onDelete':_0x7ecd('0x113')});db['ChatWebsite'][_0x7ecd('0x110')](db['CannedAnswer'],{'as':_0x7ecd('0x165'),'foreignKey':_0x7ecd('0x18f')});db[_0x7ecd('0x5c')][_0x7ecd('0x110')](db[_0x7ecd('0x6b')],{'as':_0x7ecd('0x190')});db[_0x7ecd('0x5c')][_0x7ecd('0x110')](db['ChatInteraction'],{'as':_0x7ecd('0x166')});db[_0x7ecd('0x5c')][_0x7ecd('0x110')](db[_0x7ecd('0x60')],{'as':'Applications'});db[_0x7ecd('0x5c')]['hasMany'](db[_0x7ecd('0x64')],{'as':_0x7ecd('0x157')});db[_0x7ecd('0x5c')][_0x7ecd('0x11c')](db[_0x7ecd('0xf1')],{'as':'List','foreignKey':_0x7ecd('0x169')});db['ChatWebsite'][_0x7ecd('0x11c')](db[_0x7ecd('0x150')],{'as':_0x7ecd('0x150'),'foreignKey':_0x7ecd('0x151')});db[_0x7ecd('0x5c')]['belongsTo'](db['MailAccount'],{'as':_0x7ecd('0x139'),'foreignKey':_0x7ecd('0x160')});db['ChatWebsite'][_0x7ecd('0x11c')](db[_0x7ecd('0x80')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x7ecd('0x5c')]['belongsToMany'](db['User'],{'as':_0x7ecd('0x16b'),'through':'user_has_chat_websites'});db[_0x7ecd('0x5e')][_0x7ecd('0x11c')](db[_0x7ecd('0x55')],{});db[_0x7ecd('0x5e')][_0x7ecd('0x11c')](db[_0x7ecd('0xf1')],{'as':_0x7ecd('0x168'),'foreignKey':_0x7ecd('0x169')});db[_0x7ecd('0x5e')]['belongsTo'](db[_0x7ecd('0x6c')],{'as':_0x7ecd('0x15e'),'foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0x5e')][_0x7ecd('0x11c')](db[_0x7ecd('0x59')],{});db[_0x7ecd('0x5e')]['belongsTo'](db[_0x7ecd('0x5b')],{});db['OpenchannelQueueReport'][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{});db[_0x7ecd('0x5e')][_0x7ecd('0x11c')](db['OpenchannelQueue'],{});db[_0x7ecd('0x60')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'as':'Agent','foreignKey':_0x7ecd('0x10f'),'onDelete':_0x7ecd('0x175')});db['ChatApplication'][_0x7ecd('0x11c')](db[_0x7ecd('0x67')],{'as':'Queue','foreignKey':_0x7ecd('0x191'),'onDelete':_0x7ecd('0x175')});db['ChatApplication'][_0x7ecd('0x11c')](db[_0x7ecd('0x5c')],{'as':_0x7ecd('0x192'),'foreignKey':_0x7ecd('0x18f'),'onDelete':'restrict'});db[_0x7ecd('0x60')][_0x7ecd('0x11c')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x7ecd('0x17d')});db[_0x7ecd('0x62')][_0x7ecd('0x110')](db[_0x7ecd('0x64')],{'as':_0x7ecd('0x157'),'onDelete':'cascade','foreignKey':_0x7ecd('0x193')});db[_0x7ecd('0x62')]['belongsTo'](db[_0x7ecd('0x5c')],{'as':_0x7ecd('0x16e'),'foreignKey':'ChatWebsiteId'});db[_0x7ecd('0x62')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'as':_0x7ecd('0x15e'),'foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0x62')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x16f'),'foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x62')]['belongsToMany'](db[_0x7ecd('0x170')],{'through':_0x7ecd('0x194'),'as':_0x7ecd('0x180')});db[_0x7ecd('0x62')][_0x7ecd('0x11f')](db[_0x7ecd('0x170')],{'through':_0x7ecd('0x194'),'as':_0x7ecd('0x172')});db[_0x7ecd('0x62')]['belongsToMany'](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x181'),'through':'user_has_chat_interactions','foreignKey':_0x7ecd('0x193')});db[_0x7ecd('0x64')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'onDelete':_0x7ecd('0x113'),'as':_0x7ecd('0x14')});db[_0x7ecd('0x64')]['belongsTo'](db['CmContact'],{'onDelete':_0x7ecd('0x113'),'as':_0x7ecd('0x15e'),'foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0x64')]['belongsTo'](db[_0x7ecd('0x62')],{'onDelete':_0x7ecd('0x113'),'as':'Interaction','foreignKey':_0x7ecd('0x193')});db['ChatMessage'][_0x7ecd('0x11c')](db[_0x7ecd('0xe8')],{'as':_0x7ecd('0xe8'),'foreignKey':_0x7ecd('0x182')});db[_0x7ecd('0x64')][_0x7ecd('0x11c')](db['ChatWebsite'],{'as':_0x7ecd('0x16e'),'foreignKey':_0x7ecd('0x18f')});db[_0x7ecd('0x66')][_0x7ecd('0x110')](db[_0x7ecd('0xe8')],{'as':'Attachments','foreignKey':_0x7ecd('0x174'),'onDelete':'cascade','hooks':!![]});db[_0x7ecd('0x66')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'onDelete':_0x7ecd('0x113'),'as':_0x7ecd('0x15e'),'foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0x66')]['belongsTo'](db[_0x7ecd('0x5c')],{'as':_0x7ecd('0x16e'),'foreignKey':'ChatWebsiteId'});db[_0x7ecd('0x67')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':'Agents','through':'UserChatQueue','hooks':!![]});db['ChatQueue'][_0x7ecd('0x11f')](db[_0x7ecd('0xe0')],{'through':_0x7ecd('0x195'),'as':'Teams'});db['ChatGroup']['hasMany'](db[_0x7ecd('0xcc')],{'as':_0x7ecd('0x157'),'foreignKey':_0x7ecd('0x196'),'onDelete':'cascade'});db[_0x7ecd('0x69')]['belongsToMany'](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x197'),'through':'chat_group_has_users'});db[_0x7ecd('0x6b')][_0x7ecd('0x11c')](db[_0x7ecd('0x5c')],{'as':_0x7ecd('0x192'),'foreignKey':_0x7ecd('0x18f')});db['CmCompany'][_0x7ecd('0x110')](db['CmContact'],{'as':_0x7ecd('0x120'),'foreignKey':_0x7ecd('0x198')});db[_0x7ecd('0x6c')][_0x7ecd('0x110')](db[_0x7ecd('0x6e')],{'as':_0x7ecd('0x148'),'foreignKey':_0x7ecd('0x15f')});db['CmContact'][_0x7ecd('0x110')](db[_0x7ecd('0x114')],{'as':_0x7ecd('0x115'),'foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0x6c')][_0x7ecd('0x110')](db[_0x7ecd('0x73')],{'as':_0x7ecd('0x149'),'foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0x6c')][_0x7ecd('0x110')](db[_0x7ecd('0x75')],{'as':_0x7ecd('0x75'),'foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0x6c')]['hasMany'](db[_0x7ecd('0x14b')],{'as':'JscriptySessions','foreignKey':'ContactId'});db[_0x7ecd('0x6c')]['hasMany'](db[_0x7ecd('0x59')],{'as':_0x7ecd('0x199'),'foreignKey':_0x7ecd('0x15f'),'onDelete':_0x7ecd('0x175')});db['CmContact'][_0x7ecd('0x110')](db['ChatInteraction'],{'as':_0x7ecd('0x117'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x7ecd('0x6c')]['hasMany'](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':'ContactId','onDelete':_0x7ecd('0x175')});db[_0x7ecd('0x6c')][_0x7ecd('0x110')](db[_0x7ecd('0x46')],{'as':_0x7ecd('0x118'),'foreignKey':_0x7ecd('0x15f'),'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0x6c')][_0x7ecd('0x110')](db[_0x7ecd('0x125')],{'as':_0x7ecd('0x126'),'foreignKey':_0x7ecd('0x15f'),'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0x6c')][_0x7ecd('0x11c')](db[_0x7ecd('0x19a')],{'as':_0x7ecd('0x19b'),'foreignKey':_0x7ecd('0x198')});db[_0x7ecd('0x6c')][_0x7ecd('0x11c')](db['CmList'],{'as':_0x7ecd('0x168'),'foreignKey':'ListId','onDelete':'cascade'});db[_0x7ecd('0x6c')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x181'),'through':'cm_user_has_contacts'});db[_0x7ecd('0x6c')][_0x7ecd('0x11f')](db[_0x7ecd('0x170')],{'as':_0x7ecd('0x180'),'through':_0x7ecd('0x19c')});db[_0x7ecd('0x6c')][_0x7ecd('0x11f')](db[_0x7ecd('0x170')],{'through':_0x7ecd('0x19c'),'as':_0x7ecd('0x172')});db[_0x7ecd('0x6e')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'as':_0x7ecd('0x15e'),'foreignKey':_0x7ecd('0x15f'),'onDelete':_0x7ecd('0x113')});db['CmHopper']['belongsTo'](db[_0x7ecd('0xf1')],{'as':_0x7ecd('0x168'),'foreignKey':_0x7ecd('0x169'),'onDelete':'cascade'});db['CmHopper'][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x19d'),'foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0x6e')][_0x7ecd('0x11c')](db['VoiceQueue'],{'as':'Queue','foreignKey':'VoiceQueueId','onDelete':_0x7ecd('0x113')});db[_0x7ecd('0x6e')][_0x7ecd('0x11c')](db[_0x7ecd('0xe4')],{'as':_0x7ecd('0xe4'),'foreignKey':'CampaignId','onDelete':_0x7ecd('0x113')});db[_0x7ecd('0x6e')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'as':'Owner','foreignKey':_0x7ecd('0x19e')});db['CmHopperBlack'][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'as':'Contact','foreignKey':_0x7ecd('0x15f'),'onDelete':_0x7ecd('0x113')});db['CmHopperBlack'][_0x7ecd('0x11c')](db['CmList'],{'as':_0x7ecd('0x168'),'foreignKey':_0x7ecd('0x169'),'onDelete':'cascade'});db['CmHopperBlack'][_0x7ecd('0x11c')](db[_0x7ecd('0x1d')],{'as':_0x7ecd('0x19f'),'foreignKey':_0x7ecd('0x147'),'onDelete':_0x7ecd('0x113')});db[_0x7ecd('0x70')][_0x7ecd('0x11c')](db[_0x7ecd('0xe4')],{'as':'Campaign','foreignKey':_0x7ecd('0x1a0'),'onDelete':_0x7ecd('0x113')});db[_0x7ecd('0x1a1')][_0x7ecd('0x110')](db[_0x7ecd('0x7e')],{'as':{'plural':_0x7ecd('0x1a2'),'singular':'OneAll'},'foreignKey':'AutomationAllId','onDelete':_0x7ecd('0x113'),'hooks':!![]});db[_0x7ecd('0x1a1')][_0x7ecd('0x110')](db[_0x7ecd('0x7e')],{'as':{'plural':_0x7ecd('0x1a3'),'singular':'OneAny'},'foreignKey':_0x7ecd('0x1a4'),'onDelete':_0x7ecd('0x113'),'hooks':!![]});db[_0x7ecd('0x1a1')][_0x7ecd('0x110')](db[_0x7ecd('0x79')],{'as':_0x7ecd('0x1a5'),'foreignKey':_0x7ecd('0x1a6'),'onDelete':_0x7ecd('0x113'),'hooks':!![]});db['Disposition'][_0x7ecd('0x110')](db[_0x7ecd('0x163')],{'as':_0x7ecd('0x164'),'foreignKey':_0x7ecd('0x1a7'),'onDelete':_0x7ecd('0x113')});db[_0x7ecd('0x150')][_0x7ecd('0x110')](db[_0x7ecd('0x150')],{'as':_0x7ecd('0x1a8'),'foreignKey':_0x7ecd('0x151'),'onDelete':_0x7ecd('0x113'),'hooks':!![],'required':![]});db['Interval']['hasMany'](db[_0x7ecd('0x19')],{'as':_0x7ecd('0x1a9'),'foreignKey':_0x7ecd('0x151'),'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0x150')]['hasMany'](db[_0x7ecd('0x167')],{'as':_0x7ecd('0x1aa'),'foreignKey':_0x7ecd('0x151')});db[_0x7ecd('0x150')][_0x7ecd('0x110')](db[_0x7ecd('0x60')],{'as':'ChatApplications','foreignKey':_0x7ecd('0x151')});db[_0x7ecd('0x150')][_0x7ecd('0x110')](db[_0x7ecd('0x44')],{'as':_0x7ecd('0x1ab'),'foreignKey':'IntervalId'});db['Interval'][_0x7ecd('0x110')](db['SmsApplication'],{'as':_0x7ecd('0x1ac'),'foreignKey':_0x7ecd('0x151')});db[_0x7ecd('0x85')][_0x7ecd('0x11c')](db['MailAccount'],{});db['Schedule'][_0x7ecd('0x11c')](db['AnalyticDefaultReport'],{'foreignKey':_0x7ecd('0x1ad')});db['Schedule'][_0x7ecd('0x11c')](db[_0x7ecd('0x8f')],{'foreignKey':'CustomReportId'});db['Sound'][_0x7ecd('0x11f')](db[_0x7ecd('0x1b')],{'as':_0x7ecd('0x1ae'),'through':_0x7ecd('0x146'),'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0x170')][_0x7ecd('0x11f')](db[_0x7ecd('0x6c')],{'through':_0x7ecd('0x19c')});db[_0x7ecd('0x170')][_0x7ecd('0x11f')](db[_0x7ecd('0x62')],{'through':_0x7ecd('0x194')});db[_0x7ecd('0x170')][_0x7ecd('0x11f')](db[_0x7ecd('0x125')],{'through':_0x7ecd('0x171')});db[_0x7ecd('0x170')][_0x7ecd('0x11f')](db[_0x7ecd('0x50')],{'through':_0x7ecd('0x187')});db[_0x7ecd('0x170')][_0x7ecd('0x11f')](db[_0x7ecd('0x46')],{'through':_0x7ecd('0x17f')});db['Tag'][_0x7ecd('0x11f')](db[_0x7ecd('0x59')],{'through':'openchannel_interaction_has_tags'});db[_0x7ecd('0x170')]['belongsToMany'](db[_0x7ecd('0xff')],{'through':_0x7ecd('0x1af')});db['Trigger'][_0x7ecd('0x110')](db['Condition'],{'as':{'plural':_0x7ecd('0x1b0'),'singular':_0x7ecd('0x1b1')},'foreignKey':_0x7ecd('0x1b2'),'onDelete':_0x7ecd('0x113'),'hooks':!![]});db['Trigger'][_0x7ecd('0x110')](db[_0x7ecd('0x7e')],{'as':{'plural':_0x7ecd('0x1b3'),'singular':_0x7ecd('0x1b4')},'foreignKey':_0x7ecd('0x1b5'),'onDelete':_0x7ecd('0x113'),'hooks':!![]});db[_0x7ecd('0x8b')]['hasMany'](db[_0x7ecd('0x79')],{'as':'Actions','foreignKey':'TriggerId','onDelete':_0x7ecd('0x113'),'hooks':!![]});db[_0x7ecd('0x8f')][_0x7ecd('0x110')](db[_0x7ecd('0x93')],{'as':_0x7ecd('0x1b6'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1b7'),'hooks':!![]});db[_0x7ecd('0x90')][_0x7ecd('0x110')](db[_0x7ecd('0x93')],{'as':_0x7ecd('0x1b6'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1ad')});db[_0x7ecd('0x1b8')][_0x7ecd('0x110')](db['AnalyticFieldReport'],{'as':_0x7ecd('0x1b6'),'onDelete':'cascade','foreignKey':_0x7ecd('0x1b9')});db['AnalyticFieldReport'][_0x7ecd('0x11c')](db[_0x7ecd('0x1b8')],{'foreignKey':'MetricId'});db[_0x7ecd('0x96')][_0x7ecd('0x110')](db[_0x7ecd('0x97')],{'as':_0x7ecd('0x1ba'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1bb')});db[_0x7ecd('0x97')]['hasMany'](db['SalesforceField'],{'as':_0x7ecd('0x1bc'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x7ecd('0x97')][_0x7ecd('0x110')](db['SalesforceField'],{'as':'Descriptions','onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1bd')});db['SalesforceConfiguration'][_0x7ecd('0x110')](db[_0x7ecd('0x99')],{'as':_0x7ecd('0x1b6'),'onDelete':_0x7ecd('0x113'),'foreignKey':'FieldId'});db['SalesforceConfiguration'][_0x7ecd('0x11c')](db[_0x7ecd('0x96')],{'as':_0x7ecd('0x16e'),'foreignKey':_0x7ecd('0x1bb')});db['SalesforceField']['hasMany'](db['SalesforceField'],{'as':_0x7ecd('0x1be'),'foreignKey':'SubjectId'});db[_0x7ecd('0x99')][_0x7ecd('0x110')](db[_0x7ecd('0x99')],{'as':_0x7ecd('0x1bf'),'foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0x99')]['hasMany'](db['SalesforceField'],{'as':_0x7ecd('0x1c0'),'foreignKey':_0x7ecd('0x1c1')});db[_0x7ecd('0x99')]['belongsTo'](db['Variable'],{'as':_0x7ecd('0x1c2'),'foreignKey':_0x7ecd('0x1c3')});db[_0x7ecd('0x9a')][_0x7ecd('0x110')](db[_0x7ecd('0x9b')],{'as':_0x7ecd('0x1ba'),'onDelete':'cascade','foreignKey':_0x7ecd('0x1bb')});db[_0x7ecd('0x9b')][_0x7ecd('0x110')](db[_0x7ecd('0x9c')],{'as':_0x7ecd('0x1bc'),'onDelete':'cascade','foreignKey':_0x7ecd('0x1c4')});db[_0x7ecd('0x9b')][_0x7ecd('0x110')](db[_0x7ecd('0x9c')],{'as':_0x7ecd('0x1c5'),'onDelete':_0x7ecd('0x113'),'foreignKey':'DescriptionId'});db[_0x7ecd('0x9b')][_0x7ecd('0x110')](db[_0x7ecd('0x9c')],{'as':_0x7ecd('0x1b6'),'onDelete':_0x7ecd('0x113'),'foreignKey':'FieldId'});db[_0x7ecd('0x9b')][_0x7ecd('0x11c')](db[_0x7ecd('0x9a')],{'as':_0x7ecd('0x16e'),'foreignKey':_0x7ecd('0x1bb')});db['SugarcrmField'][_0x7ecd('0x110')](db[_0x7ecd('0x9c')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x7ecd('0x9c')][_0x7ecd('0x110')](db[_0x7ecd('0x9c')],{'as':_0x7ecd('0x1bf'),'foreignKey':'DescriptionId'});db[_0x7ecd('0x9c')][_0x7ecd('0x110')](db[_0x7ecd('0x9c')],{'as':'Field','foreignKey':_0x7ecd('0x1c1')});db[_0x7ecd('0x9c')][_0x7ecd('0x11c')](db[_0x7ecd('0x1c2')],{'as':_0x7ecd('0x1c2'),'foreignKey':_0x7ecd('0x1c3')});db[_0x7ecd('0x9e')][_0x7ecd('0x110')](db[_0x7ecd('0xa0')],{'as':_0x7ecd('0x1ba'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1bb')});db[_0x7ecd('0xa0')]['hasMany'](db[_0x7ecd('0xa2')],{'as':_0x7ecd('0x1bc'),'onDelete':'cascade','foreignKey':_0x7ecd('0x1c4')});db[_0x7ecd('0xa0')][_0x7ecd('0x110')](db[_0x7ecd('0xa2')],{'as':_0x7ecd('0x1c5'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0xa0')]['hasMany'](db['DeskField'],{'as':_0x7ecd('0x1b6'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1c1')});db[_0x7ecd('0xa0')][_0x7ecd('0x11c')](db[_0x7ecd('0x9e')],{'as':_0x7ecd('0x16e'),'foreignKey':_0x7ecd('0x1bb')});db[_0x7ecd('0xa0')][_0x7ecd('0x11f')](db['Tag'],{'through':_0x7ecd('0x1c6')});db[_0x7ecd('0xa2')][_0x7ecd('0x110')](db[_0x7ecd('0xa2')],{'as':'Subject','foreignKey':_0x7ecd('0x1c4')});db['DeskField'][_0x7ecd('0x110')](db[_0x7ecd('0xa2')],{'as':_0x7ecd('0x1bf'),'foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0xa2')][_0x7ecd('0x110')](db[_0x7ecd('0xa2')],{'as':_0x7ecd('0x1c0'),'foreignKey':'FieldId'});db['DeskField'][_0x7ecd('0x11c')](db[_0x7ecd('0x1c2')],{'as':_0x7ecd('0x1c2'),'foreignKey':_0x7ecd('0x1c3')});db[_0x7ecd('0xa4')][_0x7ecd('0x110')](db[_0x7ecd('0xa6')],{'as':_0x7ecd('0x1ba'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1bb')});db[_0x7ecd('0xa6')]['hasMany'](db[_0x7ecd('0xa8')],{'as':_0x7ecd('0x1bc'),'onDelete':'cascade','foreignKey':_0x7ecd('0x1c4')});db['ZohoConfiguration'][_0x7ecd('0x110')](db['ZohoField'],{'as':_0x7ecd('0x1c5'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0xa6')]['hasMany'](db[_0x7ecd('0xa8')],{'as':_0x7ecd('0x1b6'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1c1')});db['ZohoConfiguration'][_0x7ecd('0x11c')](db[_0x7ecd('0xa4')],{'as':_0x7ecd('0x16e'),'foreignKey':_0x7ecd('0x1bb')});db[_0x7ecd('0xa8')][_0x7ecd('0x110')](db[_0x7ecd('0xa8')],{'as':'Subject','foreignKey':'SubjectId'});db['ZohoField'][_0x7ecd('0x110')](db[_0x7ecd('0xa8')],{'as':'Description','foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0xa8')]['hasMany'](db[_0x7ecd('0xa8')],{'as':'Field','foreignKey':_0x7ecd('0x1c1')});db[_0x7ecd('0xa8')][_0x7ecd('0x11c')](db[_0x7ecd('0x1c2')],{'as':_0x7ecd('0x1c2'),'foreignKey':_0x7ecd('0x1c3')});db['ZendeskAccount'][_0x7ecd('0x110')](db['ZendeskConfiguration'],{'as':_0x7ecd('0x1ba'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1bb')});db[_0x7ecd('0xab')][_0x7ecd('0x110')](db[_0x7ecd('0xad')],{'as':_0x7ecd('0x1bc'),'foreignKey':_0x7ecd('0x1c4')});db['ZendeskConfiguration'][_0x7ecd('0x110')](db[_0x7ecd('0xad')],{'as':'Descriptions','foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0xab')]['hasMany'](db['ZendeskField'],{'as':_0x7ecd('0x1b6'),'foreignKey':_0x7ecd('0x1c1')});db[_0x7ecd('0xab')]['belongsTo'](db[_0x7ecd('0xa9')],{'as':'Account','foreignKey':_0x7ecd('0x1bb')});db[_0x7ecd('0xab')][_0x7ecd('0x11f')](db['Tag'],{'through':_0x7ecd('0x1c7')});db['ZendeskField'][_0x7ecd('0x110')](db[_0x7ecd('0xad')],{'as':_0x7ecd('0x1be'),'foreignKey':'SubjectId'});db[_0x7ecd('0xad')][_0x7ecd('0x110')](db['ZendeskField'],{'as':_0x7ecd('0x1bf'),'foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0xad')][_0x7ecd('0x110')](db[_0x7ecd('0xad')],{'as':_0x7ecd('0x1c0'),'foreignKey':_0x7ecd('0x1c1')});db[_0x7ecd('0xad')][_0x7ecd('0x11c')](db[_0x7ecd('0x1c2')],{'as':_0x7ecd('0x1c2'),'foreignKey':_0x7ecd('0x1c3')});db[_0x7ecd('0xaf')][_0x7ecd('0x110')](db[_0x7ecd('0xb1')],{'as':_0x7ecd('0x1ba'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1bb')});db[_0x7ecd('0xb1')]['hasMany'](db[_0x7ecd('0xb3')],{'as':_0x7ecd('0x1bc'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1c4')});db[_0x7ecd('0xb1')]['hasMany'](db['FreshdeskField'],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x7ecd('0xb1')]['hasMany'](db[_0x7ecd('0xb3')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x7ecd('0x1c1')});db[_0x7ecd('0xb1')][_0x7ecd('0x11c')](db[_0x7ecd('0xaf')],{'as':_0x7ecd('0x16e'),'foreignKey':_0x7ecd('0x1bb')});db[_0x7ecd('0xb1')][_0x7ecd('0x11f')](db[_0x7ecd('0x170')],{'through':'int_freshdesk_configuration_has_tags'});db[_0x7ecd('0xb3')][_0x7ecd('0x110')](db[_0x7ecd('0xb3')],{'as':_0x7ecd('0x1be'),'foreignKey':_0x7ecd('0x1c4')});db[_0x7ecd('0xb3')][_0x7ecd('0x110')](db[_0x7ecd('0xb3')],{'as':_0x7ecd('0x1bf'),'foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0xb3')][_0x7ecd('0x110')](db[_0x7ecd('0xb3')],{'as':_0x7ecd('0x1c0'),'foreignKey':'FieldId'});db[_0x7ecd('0xb3')][_0x7ecd('0x11c')](db['Variable'],{'as':_0x7ecd('0x1c2'),'foreignKey':_0x7ecd('0x1c3')});db[_0x7ecd('0x1c8')]['hasMany'](db[_0x7ecd('0xb6')],{'as':_0x7ecd('0x1ba'),'onDelete':'cascade','foreignKey':'AccountId'});db['VtigerConfiguration'][_0x7ecd('0x110')](db[_0x7ecd('0xb7')],{'as':'Subjects','foreignKey':_0x7ecd('0x1c4')});db['VtigerConfiguration']['hasMany'](db[_0x7ecd('0xb7')],{'as':_0x7ecd('0x1c5'),'foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0xb6')][_0x7ecd('0x110')](db[_0x7ecd('0xb7')],{'as':_0x7ecd('0x1b6'),'foreignKey':_0x7ecd('0x1c1')});db[_0x7ecd('0xb6')][_0x7ecd('0x11c')](db[_0x7ecd('0x1c8')],{'as':'Account','foreignKey':_0x7ecd('0x1bb')});db['VtigerField'][_0x7ecd('0x110')](db[_0x7ecd('0xb7')],{'as':_0x7ecd('0x1be'),'foreignKey':_0x7ecd('0x1c4')});db['VtigerField'][_0x7ecd('0x110')](db['VtigerField'],{'as':_0x7ecd('0x1bf'),'foreignKey':'DescriptionId'});db[_0x7ecd('0xb7')][_0x7ecd('0x110')](db[_0x7ecd('0xb7')],{'as':_0x7ecd('0x1c0'),'foreignKey':_0x7ecd('0x1c1')});db[_0x7ecd('0xb7')][_0x7ecd('0x11c')](db[_0x7ecd('0x1c2')],{'as':_0x7ecd('0x1c2'),'foreignKey':_0x7ecd('0x1c3')});db[_0x7ecd('0x1c9')]['hasMany'](db[_0x7ecd('0xba')],{'as':_0x7ecd('0x1ba'),'onDelete':_0x7ecd('0x113'),'foreignKey':'AccountId'});db['ServicenowConfiguration'][_0x7ecd('0x110')](db['ServicenowField'],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x7ecd('0xba')]['hasMany'](db[_0x7ecd('0xbc')],{'as':_0x7ecd('0x1c5'),'foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0xba')][_0x7ecd('0x110')](db['ServicenowField'],{'as':_0x7ecd('0x1b6'),'foreignKey':_0x7ecd('0x1c1')});db[_0x7ecd('0xba')][_0x7ecd('0x11c')](db[_0x7ecd('0x1c9')],{'as':_0x7ecd('0x16e'),'foreignKey':'AccountId'});db[_0x7ecd('0xbc')][_0x7ecd('0x110')](db[_0x7ecd('0xbc')],{'as':_0x7ecd('0x1be'),'foreignKey':_0x7ecd('0x1c4')});db[_0x7ecd('0xbc')][_0x7ecd('0x110')](db['ServicenowField'],{'as':_0x7ecd('0x1bf'),'foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0xbc')][_0x7ecd('0x110')](db[_0x7ecd('0xbc')],{'as':_0x7ecd('0x1c0'),'foreignKey':'FieldId'});db[_0x7ecd('0xbc')]['belongsTo'](db[_0x7ecd('0x1c2')],{'as':_0x7ecd('0x1c2'),'foreignKey':_0x7ecd('0x1c3')});db['Dynamics365Account'][_0x7ecd('0x110')](db[_0x7ecd('0xc0')],{'as':_0x7ecd('0x1ba'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1bb')});db[_0x7ecd('0xc0')][_0x7ecd('0x110')](db['Dynamics365Field'],{'as':_0x7ecd('0x1bc'),'onDelete':_0x7ecd('0x113'),'foreignKey':'SubjectId'});db[_0x7ecd('0xc0')][_0x7ecd('0x110')](db[_0x7ecd('0xc2')],{'as':_0x7ecd('0x1c5'),'onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0xc0')][_0x7ecd('0x110')](db['Dynamics365Field'],{'as':'Fields','onDelete':_0x7ecd('0x113'),'foreignKey':_0x7ecd('0x1c1')});db[_0x7ecd('0xc0')][_0x7ecd('0x11c')](db[_0x7ecd('0xbe')],{'as':'Account','foreignKey':_0x7ecd('0x1bb')});db[_0x7ecd('0xc2')][_0x7ecd('0x110')](db[_0x7ecd('0xc2')],{'as':_0x7ecd('0x1be'),'foreignKey':'SubjectId'});db['Dynamics365Field'][_0x7ecd('0x110')](db[_0x7ecd('0xc2')],{'as':_0x7ecd('0x1bf'),'foreignKey':'DescriptionId'});db[_0x7ecd('0xc2')][_0x7ecd('0x110')](db['Dynamics365Field'],{'as':'Field','foreignKey':_0x7ecd('0x1c1')});db[_0x7ecd('0xc2')]['belongsTo'](db[_0x7ecd('0x1c2')],{'as':_0x7ecd('0x1c2'),'foreignKey':_0x7ecd('0x1c3')});db[_0x7ecd('0xc3')][_0x7ecd('0x110')](db[_0x7ecd('0xc5')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x7ecd('0x1bb')});db['FreshsalesConfiguration'][_0x7ecd('0x110')](db[_0x7ecd('0xc7')],{'as':_0x7ecd('0x1bc'),'foreignKey':'SubjectId'});db[_0x7ecd('0xc5')][_0x7ecd('0x110')](db[_0x7ecd('0xc7')],{'as':_0x7ecd('0x1c5'),'foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0xc5')][_0x7ecd('0x110')](db[_0x7ecd('0xc7')],{'as':'Fields','foreignKey':'FieldId'});db['FreshsalesConfiguration'][_0x7ecd('0x11c')](db['FreshsalesAccount'],{'as':'Account','foreignKey':'AccountId'});db[_0x7ecd('0xc7')][_0x7ecd('0x110')](db['FreshsalesField'],{'as':_0x7ecd('0x1be'),'foreignKey':_0x7ecd('0x1c4')});db[_0x7ecd('0xc7')][_0x7ecd('0x110')](db[_0x7ecd('0xc7')],{'as':_0x7ecd('0x1bf'),'foreignKey':_0x7ecd('0x1bd')});db[_0x7ecd('0xc7')][_0x7ecd('0x110')](db[_0x7ecd('0xc7')],{'as':_0x7ecd('0x1c0'),'foreignKey':_0x7ecd('0x1c1')});db['FreshsalesField'][_0x7ecd('0x11c')](db['Variable'],{'as':_0x7ecd('0x1c2'),'foreignKey':_0x7ecd('0x1c3')});db[_0x7ecd('0xcb')]['belongsTo'](db['ChatWebsite'],{});db['ChatQueueReport'][_0x7ecd('0x11c')](db[_0x7ecd('0xf1')],{'as':_0x7ecd('0x168'),'foreignKey':_0x7ecd('0x169')});db[_0x7ecd('0xcb')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'as':_0x7ecd('0x15e'),'foreignKey':'ContactId'});db[_0x7ecd('0xcb')][_0x7ecd('0x11c')](db[_0x7ecd('0x62')],{});db[_0x7ecd('0xcb')][_0x7ecd('0x11c')](db[_0x7ecd('0x64')],{});db['ChatQueueReport']['belongsTo'](db[_0x7ecd('0x14')],{});db[_0x7ecd('0xcb')][_0x7ecd('0x11c')](db[_0x7ecd('0x67')],{});db['ChatInternalMessage'][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'onDelete':'cascade','foreignKey':'FromId'});db[_0x7ecd('0xcc')][_0x7ecd('0x11c')](db['User'],{'onDelete':'cascade','foreignKey':_0x7ecd('0x1ca')});db[_0x7ecd('0x14b')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0x7ecd('0x1cb'),'onDelete':_0x7ecd('0x113')});db[_0x7ecd('0x14b')][_0x7ecd('0x110')](db['JscriptyAnswerReport'],{'foreignKey':_0x7ecd('0x1cb'),'onDelete':_0x7ecd('0x113')});db[_0x7ecd('0xd2')][_0x7ecd('0x11c')](db['SmsAccount'],{});db['SmsQueueReport'][_0x7ecd('0x11c')](db['CmList'],{'as':'List','foreignKey':_0x7ecd('0x169')});db['SmsQueueReport'][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'as':_0x7ecd('0x15e'),'foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0xd2')][_0x7ecd('0x11c')](db[_0x7ecd('0x50')],{});db['SmsQueueReport'][_0x7ecd('0x11c')](db[_0x7ecd('0x52')],{});db[_0x7ecd('0xd2')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{});db[_0x7ecd('0xd2')][_0x7ecd('0x11c')](db[_0x7ecd('0x131')],{});db[_0x7ecd('0xd6')][_0x7ecd('0x110')](db[_0x7ecd('0x14b')],{'foreignKey':'ProjectId'});db[_0x7ecd('0xd6')][_0x7ecd('0x110')](db[_0x7ecd('0x1cc')],{'foreignKey':_0x7ecd('0x1cd')});db[_0x7ecd('0xd6')][_0x7ecd('0x110')](db['JscriptyAnswerReport'],{'foreignKey':_0x7ecd('0x1cd')});db[_0x7ecd('0xdb')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x181'),'through':'user_has_square_projects'});db[_0x7ecd('0xe0')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x16b'),'through':_0x7ecd('0x124')});db[_0x7ecd('0xe0')][_0x7ecd('0x11f')](db[_0x7ecd('0x1d')],{'through':'TeamVoiceQueue','as':_0x7ecd('0x1ce')});db[_0x7ecd('0xe0')][_0x7ecd('0x11f')](db['MailQueue'],{'through':'team_has_mail_queues','as':_0x7ecd('0x12f')});db[_0x7ecd('0xe0')][_0x7ecd('0x11f')](db[_0x7ecd('0x67')],{'through':'team_has_chat_queues','as':_0x7ecd('0x130')});db['Team'][_0x7ecd('0x11f')](db[_0x7ecd('0x48')],{'through':_0x7ecd('0x184'),'as':_0x7ecd('0x1cf')});db[_0x7ecd('0xe0')][_0x7ecd('0x11f')](db[_0x7ecd('0x131')],{'through':_0x7ecd('0x188'),'as':_0x7ecd('0x132')});db[_0x7ecd('0xe0')][_0x7ecd('0x11f')](db[_0x7ecd('0x133')],{'through':'team_has_openchannel_queues','as':_0x7ecd('0x1d0')});db[_0x7ecd('0xe0')]['belongsToMany'](db[_0x7ecd('0x104')],{'through':_0x7ecd('0x1d1'),'as':_0x7ecd('0x134')});db[_0x7ecd('0xe0')][_0x7ecd('0x11f')](db[_0x7ecd('0xf3')],{'through':_0x7ecd('0x109'),'as':_0x7ecd('0x12e')});db[_0x7ecd('0xe4')][_0x7ecd('0x110')](db['CmHopper'],{'as':'Hoppers','foreignKey':'CampaignId'});db[_0x7ecd('0xe4')][_0x7ecd('0x110')](db[_0x7ecd('0x114')],{'as':_0x7ecd('0x115'),'foreignKey':_0x7ecd('0x1a0')});db['Campaign']['hasMany'](db[_0x7ecd('0x73')],{'as':_0x7ecd('0x149'),'foreignKey':_0x7ecd('0x1a0')});db[_0x7ecd('0xe4')]['hasMany'](db[_0x7ecd('0x70')],{'as':_0x7ecd('0x14a'),'foreignKey':'CampaignId'});db['Campaign']['belongsTo'](db[_0x7ecd('0x27')],{'as':'Trunk','foreignKey':'TrunkId'});db[_0x7ecd('0xe4')]['belongsTo'](db[_0x7ecd('0x27')],{'as':'TrunkBackup','foreignKey':_0x7ecd('0x14f')});db['Campaign'][_0x7ecd('0x11c')](db['Interval'],{'as':_0x7ecd('0x150'),'foreignKey':_0x7ecd('0x151')});db[_0x7ecd('0xe4')][_0x7ecd('0x11c')](db[_0x7ecd('0xdb')],{'as':_0x7ecd('0xdb'),'foreignKey':_0x7ecd('0x1d2')});db[_0x7ecd('0xe4')]['belongsToMany'](db['CmList'],{'as':_0x7ecd('0x122'),'through':'campaigns_has_cm_lists'});db[_0x7ecd('0xe4')][_0x7ecd('0x11f')](db[_0x7ecd('0xf1')],{'as':_0x7ecd('0x1d3'),'through':'campaigns_has_cm_blacklists'});db['Attachment'][_0x7ecd('0x11c')](db[_0x7ecd('0x66')],{'as':_0x7ecd('0x66'),'foreignKey':_0x7ecd('0x174')});db[_0x7ecd('0xea')][_0x7ecd('0x11c')](db[_0x7ecd('0x3d')],{});db[_0x7ecd('0xea')][_0x7ecd('0x11c')](db[_0x7ecd('0x125')],{});db[_0x7ecd('0xea')][_0x7ecd('0x11c')](db[_0x7ecd('0x139')],{'foreignKey':'FromMailAccountId','as':_0x7ecd('0x1d4')});db[_0x7ecd('0xea')]['belongsTo'](db[_0x7ecd('0x14')],{'foreignKey':_0x7ecd('0x1d5'),'as':'FromAgent'});db[_0x7ecd('0xea')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'foreignKey':_0x7ecd('0x1d6'),'as':'ToAgent'});db['MailTransferReport']['belongsTo'](db[_0x7ecd('0x3a')],{'foreignKey':_0x7ecd('0x1d7'),'as':'ToQueue'});db[_0x7ecd('0xea')][_0x7ecd('0x11c')](db['MailAccount'],{'foreignKey':_0x7ecd('0x1d8'),'as':_0x7ecd('0x1d9')});db[_0x7ecd('0xeb')][_0x7ecd('0x11c')](db[_0x7ecd('0x64')],{});db[_0x7ecd('0xeb')][_0x7ecd('0x11c')](db[_0x7ecd('0x62')],{});db['ChatTransferReport'][_0x7ecd('0x11c')](db[_0x7ecd('0x5c')],{'foreignKey':_0x7ecd('0x1da'),'as':_0x7ecd('0x1d4')});db['ChatTransferReport'][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'foreignKey':'FromUserId','as':_0x7ecd('0x1db')});db[_0x7ecd('0xeb')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'foreignKey':'ToUserId','as':_0x7ecd('0x1dc')});db[_0x7ecd('0xeb')][_0x7ecd('0x11c')](db[_0x7ecd('0x67')],{'foreignKey':_0x7ecd('0x1dd'),'as':_0x7ecd('0x1de')});db[_0x7ecd('0xeb')][_0x7ecd('0x11c')](db['ChatWebsite'],{'foreignKey':_0x7ecd('0x1df'),'as':_0x7ecd('0x1d9')});db[_0x7ecd('0x1e0')]['belongsTo'](db[_0x7ecd('0x17b')],{});db[_0x7ecd('0x1e0')][_0x7ecd('0x11c')](db['FaxInteraction'],{});db[_0x7ecd('0x1e0')][_0x7ecd('0x11c')](db[_0x7ecd('0x42')],{'foreignKey':'FromFaxAccountId','as':_0x7ecd('0x1d4')});db[_0x7ecd('0x1e0')]['belongsTo'](db[_0x7ecd('0x14')],{'foreignKey':_0x7ecd('0x1d5'),'as':_0x7ecd('0x1db')});db[_0x7ecd('0x1e0')][_0x7ecd('0x11c')](db['User'],{'foreignKey':'ToUserId','as':_0x7ecd('0x1dc')});db[_0x7ecd('0x1e0')][_0x7ecd('0x11c')](db[_0x7ecd('0x48')],{'foreignKey':_0x7ecd('0x1e1'),'as':_0x7ecd('0x1de')});db[_0x7ecd('0x1e0')]['belongsTo'](db[_0x7ecd('0x42')],{'foreignKey':_0x7ecd('0x1e2'),'as':_0x7ecd('0x1d9')});db[_0x7ecd('0xed')]['belongsTo'](db['OpenchannelMessage'],{});db[_0x7ecd('0xed')]['belongsTo'](db['OpenchannelInteraction'],{});db[_0x7ecd('0xed')]['belongsTo'](db[_0x7ecd('0x55')],{'foreignKey':_0x7ecd('0x1e3'),'as':_0x7ecd('0x1d4')});db[_0x7ecd('0xed')][_0x7ecd('0x11c')](db['User'],{'foreignKey':_0x7ecd('0x1d5'),'as':'FromAgent'});db[_0x7ecd('0xed')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'foreignKey':_0x7ecd('0x1d6'),'as':_0x7ecd('0x1dc')});db[_0x7ecd('0xed')][_0x7ecd('0x11c')](db[_0x7ecd('0x133')],{'foreignKey':'ToOpenchannelQueueId','as':'ToQueue'});db[_0x7ecd('0xed')][_0x7ecd('0x11c')](db[_0x7ecd('0x55')],{'foreignKey':_0x7ecd('0x1e4'),'as':'ToAccount'});db[_0x7ecd('0xef')]['belongsTo'](db[_0x7ecd('0x52')],{});db['SmsTransferReport'][_0x7ecd('0x11c')](db['SmsInteraction'],{});db[_0x7ecd('0xef')][_0x7ecd('0x11c')](db[_0x7ecd('0x4c')],{'foreignKey':'FromSmsAccountId','as':_0x7ecd('0x1d4')});db[_0x7ecd('0xef')]['belongsTo'](db[_0x7ecd('0x14')],{'foreignKey':_0x7ecd('0x1d5'),'as':_0x7ecd('0x1db')});db['SmsTransferReport']['belongsTo'](db[_0x7ecd('0x14')],{'foreignKey':_0x7ecd('0x1d6'),'as':_0x7ecd('0x1dc')});db[_0x7ecd('0xef')][_0x7ecd('0x11c')](db[_0x7ecd('0x131')],{'foreignKey':'ToSmsQueueId','as':_0x7ecd('0x1de')});db['SmsTransferReport']['belongsTo'](db['SmsAccount'],{'foreignKey':_0x7ecd('0x1e5'),'as':'ToAccount'});db['CmList'][_0x7ecd('0x110')](db[_0x7ecd('0x163')],{'as':_0x7ecd('0x164'),'foreignKey':_0x7ecd('0x169'),'onDelete':'cascade'});db[_0x7ecd('0xf1')]['hasMany'](db[_0x7ecd('0x77')],{'as':_0x7ecd('0x1e6'),'foreignKey':'ListId'});db[_0x7ecd('0xf1')][_0x7ecd('0x110')](db[_0x7ecd('0x6c')],{'as':_0x7ecd('0x120'),'onDelete':'cascade','foreignKey':_0x7ecd('0x169')});db['CmList'][_0x7ecd('0x110')](db[_0x7ecd('0x114')],{'as':_0x7ecd('0x115'),'foreignKey':_0x7ecd('0x169')});db[_0x7ecd('0xf1')][_0x7ecd('0x110')](db['CmHopperHistory'],{'as':_0x7ecd('0x116'),'foreignKey':_0x7ecd('0x169')});db[_0x7ecd('0xf1')]['hasMany'](db[_0x7ecd('0x75')],{'as':_0x7ecd('0x75'),'foreignKey':_0x7ecd('0x169')});db[_0x7ecd('0xf1')][_0x7ecd('0x11f')](db[_0x7ecd('0x1d')],{'as':_0x7ecd('0x1e7'),'through':_0x7ecd('0x154')});db[_0x7ecd('0xf1')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x16b'),'through':_0x7ecd('0x123')});db[_0x7ecd('0xf3')][_0x7ecd('0x110')](db[_0x7ecd('0x19')],{'as':_0x7ecd('0x1a9'),'onDelete':_0x7ecd('0x113')});db[_0x7ecd('0xf3')]['belongsToMany'](db[_0x7ecd('0x14')],{'as':'Agents','through':_0x7ecd('0x10b')});db[_0x7ecd('0xf3')][_0x7ecd('0x11f')](db[_0x7ecd('0xe0')],{'through':_0x7ecd('0x109'),'as':_0x7ecd('0x155')});db[_0x7ecd('0xf5')]['hasMany'](db['User'],{'as':_0x7ecd('0x181'),'foreignKey':_0x7ecd('0x1e8')});db[_0x7ecd('0xf5')][_0x7ecd('0x110')](db[_0x7ecd('0xf6')],{'as':_0x7ecd('0x1e9'),'foreignKey':'userProfileId','onDelete':'cascade'});db[_0x7ecd('0xf6')][_0x7ecd('0x110')](db['UserProfileResource'],{'as':'Resources','foreignKey':_0x7ecd('0x1ea'),'onDelete':'cascade'});db['WhatsappAccount'][_0x7ecd('0x110')](db['Disposition'],{'as':_0x7ecd('0x164'),'foreignKey':_0x7ecd('0x1eb'),'onDelete':_0x7ecd('0x113')});db['WhatsappAccount']['hasMany'](db[_0x7ecd('0x7c')],{'as':_0x7ecd('0x165'),'foreignKey':'WhatsappAccountId'});db[_0x7ecd('0xfb')][_0x7ecd('0x110')](db[_0x7ecd('0x1ec')],{'as':_0x7ecd('0x157'),'foreignKey':_0x7ecd('0x1eb')});db[_0x7ecd('0xfb')]['hasMany'](db[_0x7ecd('0xff')],{'as':_0x7ecd('0x166')});db['WhatsappAccount']['hasMany'](db[_0x7ecd('0xfd')],{'as':_0x7ecd('0x144')});db[_0x7ecd('0xfb')][_0x7ecd('0x11c')](db[_0x7ecd('0xf1')],{'as':_0x7ecd('0x168'),'foreignKey':_0x7ecd('0x169')});db[_0x7ecd('0xfb')][_0x7ecd('0x11c')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x7ecd('0x153')});db[_0x7ecd('0xfb')][_0x7ecd('0x11f')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x16b'),'through':_0x7ecd('0x13e')});db[_0x7ecd('0xfd')][_0x7ecd('0x11c')](db['User'],{'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0xfd')][_0x7ecd('0x11c')](db[_0x7ecd('0x104')],{'onDelete':_0x7ecd('0x175')});db[_0x7ecd('0xfd')]['belongsTo'](db['WhatsappAccount'],{'onDelete':'restrict'});db[_0x7ecd('0xfd')][_0x7ecd('0x11c')](db[_0x7ecd('0x150')],{'onDelete':'restrict','foreignKey':_0x7ecd('0x151')});db[_0x7ecd('0xfd')][_0x7ecd('0x11c')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x7ecd('0x17d')});db[_0x7ecd('0xff')][_0x7ecd('0x110')](db['WhatsappMessage'],{'as':_0x7ecd('0x157'),'onDelete':_0x7ecd('0x113'),'foreignKey':'WhatsappInteractionId'});db[_0x7ecd('0xff')][_0x7ecd('0x11c')](db[_0x7ecd('0xfb')],{'as':_0x7ecd('0x16e'),'foreignKey':_0x7ecd('0x1eb')});db['WhatsappInteraction'][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'as':'Contact','foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0xff')][_0x7ecd('0x11c')](db['User'],{'as':'Owner','foreignKey':_0x7ecd('0x10f')});db[_0x7ecd('0xff')]['belongsToMany'](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':_0x7ecd('0x180')});db[_0x7ecd('0xff')][_0x7ecd('0x11f')](db['Tag'],{'through':'whatsapp_interaction_has_tags','as':'ThroughTags'});db['WhatsappInteraction'][_0x7ecd('0x11f')](db['User'],{'as':_0x7ecd('0x181'),'through':_0x7ecd('0x12d'),'foreignKey':_0x7ecd('0x1ed')});db[_0x7ecd('0x1ec')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'as':_0x7ecd('0x14')});db[_0x7ecd('0x1ec')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'onDelete':'cascade','as':_0x7ecd('0x15e')});db['WhatsappMessage']['belongsTo'](db['WhatsappInteraction'],{'onDelete':_0x7ecd('0x113'),'as':_0x7ecd('0x173'),'foreignKey':'WhatsappInteractionId'});db[_0x7ecd('0x1ec')][_0x7ecd('0x11c')](db['WhatsappAccount'],{'as':_0x7ecd('0x16e'),'foreignKey':_0x7ecd('0x1eb')});db[_0x7ecd('0x1ee')][_0x7ecd('0x11c')](db[_0x7ecd('0xfb')],{});db[_0x7ecd('0x1ee')][_0x7ecd('0x11c')](db[_0x7ecd('0xf1')],{'as':_0x7ecd('0x168'),'foreignKey':'ListId'});db[_0x7ecd('0x1ee')][_0x7ecd('0x11c')](db[_0x7ecd('0x6c')],{'as':'Contact','foreignKey':_0x7ecd('0x15f')});db[_0x7ecd('0x1ee')][_0x7ecd('0x11c')](db['WhatsappInteraction'],{});db[_0x7ecd('0x1ee')][_0x7ecd('0x11c')](db[_0x7ecd('0x104')],{});db['WhatsappQueueReport'][_0x7ecd('0x11c')](db['WhatsappMessage'],{});db[_0x7ecd('0x1ee')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{});db[_0x7ecd('0x102')][_0x7ecd('0x11c')](db[_0x7ecd('0x1ec')],{});db[_0x7ecd('0x102')]['belongsTo'](db[_0x7ecd('0xff')],{});db[_0x7ecd('0x102')][_0x7ecd('0x11c')](db['WhatsappAccount'],{'foreignKey':_0x7ecd('0x1ef'),'as':_0x7ecd('0x1d4')});db[_0x7ecd('0x102')]['belongsTo'](db['WhatsappAccount'],{'foreignKey':_0x7ecd('0x1f0'),'as':'ToAccount'});db[_0x7ecd('0x102')]['belongsTo'](db[_0x7ecd('0x104')],{'foreignKey':_0x7ecd('0x1f1'),'as':_0x7ecd('0x1de')});db[_0x7ecd('0x102')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'foreignKey':_0x7ecd('0x1d5'),'as':'FromAgent'});db[_0x7ecd('0x102')][_0x7ecd('0x11c')](db[_0x7ecd('0x14')],{'foreignKey':_0x7ecd('0x1d6'),'as':_0x7ecd('0x1dc')});db['WhatsappQueue'][_0x7ecd('0x11f')](db['User'],{'as':_0x7ecd('0x16b'),'through':'UserWhatsappQueue','foreignKey':_0x7ecd('0x1f2')});db['WhatsappQueue'][_0x7ecd('0x11f')](db[_0x7ecd('0xe0')],{'through':_0x7ecd('0x1d1'),'as':_0x7ecd('0x155')});module['exports']={'db':db,'dbH':dbH};
\ No newline at end of file
index 31e4b81..6c1e12d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3d89=['./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./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/square/reports','/api/square/details/reports','./api/jscriptyProject','/api/settings','/api/square/odbc','/api/square/projects','./api/squareProject','/api/square/recordings','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/plugins','./api/plugin','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','/api/rpc','./api/rpc','/api/version','./api/version','/api/system','./api/system','./api/pm2','./api/webbar','/apidoc','static','root','/www','/demo','join','/snippet','3.0.0','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','/index.html','password','newPassword','apiKey','lastName','street','phone','mobile','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','consumerKey','consumerSecret','calleridname','exten','clientEmail','accesskeyid','secretaccesskey','pass','accountSid','localstationid','dsn','secret','oldPassword','isPlainObject','length','replace','@@{','}@@','includes','path','util','./errors','./config/logger','api','auth','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','\x20body=%s','body','format','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','role','inspect','logger','%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)','method','name','other','agent_name','test','/api/users','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','/api/trunks','/api/voice/transfers/reports','./api/voiceTransferReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','/api/mail/reports/queue','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatInteraction','/api/chat/messages','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','/api/cm/contacts','./api/cmContact','./api/cmHopperBlack','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/intervals','./api/interval','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/templates','./api/template','/api/triggers','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x3d89,0x1cc));var _0x93d8=function(_0x4c7f36,_0x258987){_0x4c7f36=_0x4c7f36-0x0;var _0x24f44c=_0x3d89[_0x4c7f36];return _0x24f44c;};'use strict';var _=require('lodash');var path=require(_0x93d8('0x0'));var express=require('express');var ewinston=require('express-winston');var util=require(_0x93d8('0x1'));var errors=require(_0x93d8('0x2'));var config=require('./config/environment');var logger=require(_0x93d8('0x3'))(_0x93d8('0x4'));var authLogger=require('./config/logger')(_0x93d8('0x5'));exports['default']=function(_0xa9a686){_0xa9a686[_0x93d8('0x6')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x554ca6,_0x27173d){var _0x47528b=_0x93d8('0x7');if(!_[_0x93d8('0x8')](_0x554ca6['body'])){_0x47528b+=_0x93d8('0x9');var _0x477962=_0x554ca6[_0x93d8('0xa')];maskSensitiveData(_0x477962);}return util[_0x93d8('0xb')](_0x47528b,_0x554ca6['method'],_0x554ca6['headers'][_0x93d8('0xc')]?_0x554ca6['headers'][_0x93d8('0xc')]:_0x554ca6[_0x93d8('0xd')][_0x93d8('0xe')]||_0x554ca6['ip'],_0x554ca6[_0x93d8('0xf')],_0x27173d[_0x93d8('0x10')],_0x27173d[_0x93d8('0x11')],_0x554ca6[_0x93d8('0x12')]?_0x554ca6[_0x93d8('0x12')]['id']:null,_0x554ca6['user']?_0x554ca6[_0x93d8('0x12')]['name']:null,_0x554ca6[_0x93d8('0x12')]?_0x554ca6[_0x93d8('0x12')][_0x93d8('0x13')]:null,_0x477962?util[_0x93d8('0x14')](_0x477962,![],null):'');}}));_0xa9a686[_0x93d8('0x6')](ewinston[_0x93d8('0x15')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x2b0220,_0x209cb1){var _0x4a7cde=_0x93d8('0x16');if(_0x2b0220[_0x93d8('0xa')]&&_0x2b0220[_0x93d8('0xa')][_0x93d8('0x17')]&&_0x2b0220[_0x93d8('0xa')][_0x93d8('0x18')]){_0x4a7cde=_0x93d8('0x19');}return util['format'](_0x4a7cde,_0x2b0220[_0x93d8('0x1a')],_0x2b0220['headers'][_0x93d8('0xc')]?_0x2b0220['headers'][_0x93d8('0xc')]:_0x2b0220['connection'][_0x93d8('0xe')]||_0x2b0220['ip'],_0x2b0220[_0x93d8('0xf')],_0x209cb1[_0x93d8('0x10')],_0x209cb1['responseTime'],_0x2b0220[_0x93d8('0x12')]?_0x2b0220[_0x93d8('0x12')]['id']:null,_0x2b0220[_0x93d8('0x12')]?_0x2b0220[_0x93d8('0x12')][_0x93d8('0x1b')]:null,_0x2b0220[_0x93d8('0x12')]?_0x2b0220[_0x93d8('0x12')]['role']:null,_0x2b0220['body']&&_0x2b0220[_0x93d8('0xa')][_0x93d8('0x17')]?_0x2b0220['body'][_0x93d8('0x17')]:_0x93d8('0x1c'),_0x2b0220[_0x93d8('0xa')]&&_0x2b0220[_0x93d8('0xa')][_0x93d8('0x18')]?_0x2b0220['body'][_0x93d8('0x18')]:'',_0x2b0220[_0x93d8('0xa')]&&_0x2b0220[_0x93d8('0xa')][_0x93d8('0x1d')]?_0x2b0220[_0x93d8('0xa')][_0x93d8('0x1d')]:'');},'ignoreRoute':function(_0x45a912){var _0x51e2d0=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x51e2d0[_0x93d8('0x1e')](_0x45a912[_0x93d8('0xf')]);}}));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x1f'),require('./api/user'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x20'),require(_0x93d8('0x21')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x22'),require(_0x93d8('0x23')));_0xa9a686['use'](_0x93d8('0x24'),require(_0x93d8('0x25')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x26'),require(_0x93d8('0x27')));_0xa9a686[_0x93d8('0x6')]('/api/voice/queues',require('./api/voiceQueue'));_0xa9a686[_0x93d8('0x6')]('/api/voice/recordings',require(_0x93d8('0x28')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x29'),require(_0x93d8('0x2a')));_0xa9a686[_0x93d8('0x6')]('/api/voice/mails',require(_0x93d8('0x2b')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x2c'),require('./api/voiceMailMessage'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x2d'),require(_0x93d8('0x2e')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x2f'),require(_0x93d8('0x30')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x31'),require('./api/voiceAgentReport'));_0xa9a686['use'](_0x93d8('0x32'),require(_0x93d8('0x33')));_0xa9a686['use'](_0x93d8('0x34'),require('./api/memberReport'));_0xa9a686['use'](_0x93d8('0x35'),require('./api/trunk'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x36'),require(_0x93d8('0x37')));_0xa9a686[_0x93d8('0x6')]('/api/mail/out_servers',require(_0x93d8('0x38')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x39'),require(_0x93d8('0x3a')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x3b'),require(_0x93d8('0x3c')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x3d'),require(_0x93d8('0x3e')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x3f'),require(_0x93d8('0x40')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x41'),require(_0x93d8('0x42')));_0xa9a686['use'](_0x93d8('0x43'),require('./api/mailApplication'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x44'),require('./api/mailQueueReport'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x45'),require('./api/dashboard'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x46'),require(_0x93d8('0x47')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x48'),require('./api/faxAccount'));_0xa9a686[_0x93d8('0x6')]('/api/fax/applications',require(_0x93d8('0x49')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x4a'),require(_0x93d8('0x4b')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x4c'),require('./api/faxMessage'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x4d'),require('./api/faxQueue'));_0xa9a686['use'](_0x93d8('0x4e'),require(_0x93d8('0x4f')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x50'),require(_0x93d8('0x51')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x52'),require('./api/smsApplication'));_0xa9a686[_0x93d8('0x6')]('/api/sms/interactions',require('./api/smsInteraction'));_0xa9a686['use'](_0x93d8('0x53'),require(_0x93d8('0x54')));_0xa9a686[_0x93d8('0x6')]('/api/sms/queues',require(_0x93d8('0x55')));_0xa9a686[_0x93d8('0x6')]('/api/openchannel/accounts',require('./api/openchannelAccount'));_0xa9a686['use'](_0x93d8('0x56'),require(_0x93d8('0x57')));_0xa9a686[_0x93d8('0x6')]('/api/openchannel/interactions',require(_0x93d8('0x58')));_0xa9a686['use']('/api/openchannel/messages',require(_0x93d8('0x59')));_0xa9a686['use'](_0x93d8('0x5a'),require(_0x93d8('0x5b')));_0xa9a686['use'](_0x93d8('0x5c'),require(_0x93d8('0x5d')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x5e'),require(_0x93d8('0x5f')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x60'),require('./api/chatApplication'));_0xa9a686[_0x93d8('0x6')]('/api/chat/interactions',require(_0x93d8('0x61')));_0xa9a686['use'](_0x93d8('0x62'),require('./api/chatMessage'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x63'),require(_0x93d8('0x64')));_0xa9a686['use'](_0x93d8('0x65'),require(_0x93d8('0x66')));_0xa9a686[_0x93d8('0x6')]('/api/chat/groups',require(_0x93d8('0x67')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x68'),require('./api/chatProactiveAction'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x69'),require('./api/cmCompany'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x6a'),require(_0x93d8('0x6b')));_0xa9a686['use']('/api/cm/hopper',require('./api/cmHopper'));_0xa9a686[_0x93d8('0x6')]('/api/cm/hopper_black',require(_0x93d8('0x6c')));_0xa9a686['use']('/api/cm/hopper_final',require(_0x93d8('0x6d')));_0xa9a686[_0x93d8('0x6')]('/api/cm/hopper_history',require(_0x93d8('0x6e')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x6f'),require(_0x93d8('0x70')));_0xa9a686[_0x93d8('0x6')]('/api/actions',require('./api/action'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x71'),require(_0x93d8('0x72')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x73'),require(_0x93d8('0x74')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x75'),require(_0x93d8('0x76')));_0xa9a686[_0x93d8('0x6')]('/api/conditions',require('./api/condition'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x77'),require(_0x93d8('0x78')));_0xa9a686[_0x93d8('0x6')]('/api/pauses',require('./api/pause'));_0xa9a686['use'](_0x93d8('0x79'),require(_0x93d8('0x7a')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x7b'),require(_0x93d8('0x7c')));_0xa9a686[_0x93d8('0x6')]('/api/schedules',require(_0x93d8('0x7d')));_0xa9a686['use'](_0x93d8('0x7e'),require(_0x93d8('0x7f')));_0xa9a686[_0x93d8('0x6')]('/api/tags',require(_0x93d8('0x80')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x81'),require(_0x93d8('0x82')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x83'),require('./api/trigger'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x84'),require(_0x93d8('0x85')));_0xa9a686['use']('/api/integrations',require(_0x93d8('0x86')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x87'),require(_0x93d8('0x88')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x89'),require('./api/analyticCustomReport'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x8a'),require('./api/analyticDefaultReport'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x8b'),require(_0x93d8('0x8c')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x8d'),require(_0x93d8('0x8e')));_0xa9a686[_0x93d8('0x6')]('/api/analytics/field_reports',require(_0x93d8('0x8f')));_0xa9a686['use'](_0x93d8('0x90'),require(_0x93d8('0x91')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x92'),require('./api/intSalesforceAccount'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x93'),require(_0x93d8('0x94')));_0xa9a686[_0x93d8('0x6')]('/api/integrations/salesforce/fields',require(_0x93d8('0x95')));_0xa9a686[_0x93d8('0x6')]('/api/integrations/sugarcrm/accounts',require(_0x93d8('0x96')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x97'),require(_0x93d8('0x98')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x99'),require(_0x93d8('0x9a')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x9b'),require(_0x93d8('0x9c')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x9d'),require(_0x93d8('0x9e')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x9f'),require(_0x93d8('0xa0')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xa1'),require(_0x93d8('0xa2')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xa3'),require(_0x93d8('0xa4')));_0xa9a686['use'](_0x93d8('0xa5'),require('./api/intZohoField'));_0xa9a686['use'](_0x93d8('0xa6'),require(_0x93d8('0xa7')));_0xa9a686[_0x93d8('0x6')]('/api/integrations/zendesk/configurations',require(_0x93d8('0xa8')));_0xa9a686[_0x93d8('0x6')]('/api/integrations/zendesk/fields',require(_0x93d8('0xa9')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xaa'),require('./api/intFreshdeskAccount'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xab'),require(_0x93d8('0xac')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xad'),require('./api/intFreshdeskField'));_0xa9a686['use'](_0x93d8('0xae'),require('./api/intVtigerAccount'));_0xa9a686['use'](_0x93d8('0xaf'),require(_0x93d8('0xb0')));_0xa9a686[_0x93d8('0x6')]('/api/integrations/vtiger/fields',require(_0x93d8('0xb1')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xb2'),require(_0x93d8('0xb3')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xb4'),require('./api/intServicenowConfiguration'));_0xa9a686[_0x93d8('0x6')]('/api/integrations/servicenow/fields',require(_0x93d8('0xb5')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xb6'),require('./api/intDynamics365Account'));_0xa9a686['use'](_0x93d8('0xb7'),require(_0x93d8('0xb8')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xb9'),require(_0x93d8('0xba')));_0xa9a686[_0x93d8('0x6')]('/api/integrations/freshsales/accounts',require(_0x93d8('0xbb')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xbc'),require(_0x93d8('0xbd')));_0xa9a686[_0x93d8('0x6')]('/api/integrations/freshsales/fields',require(_0x93d8('0xbe')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xbf'),require('./api/network'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xc0'),require('./api/chatQueueReport'));_0xa9a686[_0x93d8('0x6')]('/api/chat/internal/messages',require(_0x93d8('0xc1')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xc2'),require(_0x93d8('0xc3')));_0xa9a686['use'](_0x93d8('0xc4'),require(_0x93d8('0xc5')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xc6'),require(_0x93d8('0xc7')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xc8'),require('./api/smsQueueReport'));_0xa9a686['use'](_0x93d8('0xc9'),require('./api/squareReport'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xca'),require('./api/squareReportDetail'));_0xa9a686[_0x93d8('0x6')]('/api/jscripty/projects',require(_0x93d8('0xcb')));_0xa9a686['use'](_0x93d8('0xcc'),require('./api/setting'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xcd'),require('./api/squareOdbc'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xce'),require(_0x93d8('0xcf')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xd0'),require('./api/squareRecording'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xd1'),require(_0x93d8('0xd2')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xd3'),require(_0x93d8('0xd4')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xd5'),require('./api/license'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xd6'),require(_0x93d8('0xd7')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xd8'),require(_0x93d8('0xd9')));_0xa9a686[_0x93d8('0x6')]('/api/attachments',require('./api/attachment'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xda'),require(_0x93d8('0xdb')));_0xa9a686[_0x93d8('0x6')]('/api/mail/reports/transfer',require(_0x93d8('0xdc')));_0xa9a686['use'](_0x93d8('0xdd'),require(_0x93d8('0xde')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xdf'),require(_0x93d8('0xe0')));_0xa9a686[_0x93d8('0x6')]('/api/openchannel/reports/transfer',require(_0x93d8('0xe1')));_0xa9a686[_0x93d8('0x6')]('/api/sms/reports/transfer',require(_0x93d8('0xe2')));_0xa9a686['use'](_0x93d8('0xe3'),require('./api/cmList'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xe4'),require(_0x93d8('0xe5')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xe6'),require(_0x93d8('0xe7')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xe8'),require(_0x93d8('0xe9')));_0xa9a686[_0x93d8('0x6')]('/api/userProfile/resources',require(_0x93d8('0xea')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xeb'),require(_0x93d8('0xec')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xed'),require(_0x93d8('0xee')));_0xa9a686[_0x93d8('0x6')]('/api/whatsapp/applications',require(_0x93d8('0xef')));_0xa9a686['use'](_0x93d8('0xf0'),require(_0x93d8('0xf1')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xf2'),require(_0x93d8('0xf3')));_0xa9a686['use'](_0x93d8('0xf4'),require(_0x93d8('0xf5')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xf6'),require(_0x93d8('0xf7')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xf8'),require(_0x93d8('0xf9')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xfa'),require(_0x93d8('0xfb')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xfc'),require(_0x93d8('0xfd')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0xfe'),require(_0x93d8('0xff')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x100'),require(_0x93d8('0x101')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x102'),require('./api/jira'));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x103'),require(_0x93d8('0x104')));_0xa9a686['use'](_0x93d8('0x105'),require(_0x93d8('0x106')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x107'),require(_0x93d8('0x108')));_0xa9a686['use']('/api/pm2',require(_0x93d8('0x109')));_0xa9a686[_0x93d8('0x6')]('/api/webbar',require(_0x93d8('0x10a')));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x10b'),express[_0x93d8('0x10c')](path['join'](config[_0x93d8('0x10d')],_0x93d8('0x10b'))));_0xa9a686[_0x93d8('0x6')]('/www',express[_0x93d8('0x10c')](path['join'](config[_0x93d8('0x10d')],_0x93d8('0x10e'))));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x10f'),express['static'](path[_0x93d8('0x110')](config[_0x93d8('0x10d')],_0x93d8('0x10f'))));_0xa9a686[_0x93d8('0x6')](_0x93d8('0x111'),express[_0x93d8('0x10c')](path[_0x93d8('0x110')](config[_0x93d8('0x10d')],'snippet',_0x93d8('0x112'))));_0xa9a686[_0x93d8('0x6')]('/plugins',express[_0x93d8('0x10c')](path[_0x93d8('0x110')](config['root'],_0x93d8('0x113'))));_0xa9a686[_0x93d8('0x114')](_0x93d8('0x115'))[_0x93d8('0x116')](errors[0x194]);_0xa9a686[_0x93d8('0x114')]('/*')['get'](function(_0x518a6f,_0x4b9a90){_0x4b9a90[_0x93d8('0x117')](path['resolve'](_0xa9a686[_0x93d8('0x116')]('appPath')+_0x93d8('0x118')));});};var sensitiveFields=['username',_0x93d8('0x119'),_0x93d8('0x11a'),_0x93d8('0x11b'),'firstName',_0x93d8('0x11c'),_0x93d8('0x11d'),_0x93d8('0x11e'),_0x93d8('0x11f'),'fax',_0x93d8('0x120'),_0x93d8('0x121'),_0x93d8('0x122'),_0x93d8('0x123'),_0x93d8('0x124'),_0x93d8('0x125'),_0x93d8('0x126'),_0x93d8('0x127'),_0x93d8('0x128'),'accessToken','accessTokenSecret','authToken',_0x93d8('0x129'),_0x93d8('0x12a'),'membername',_0x93d8('0x12b'),'calleridnum',_0x93d8('0x12c'),'vidaooApiKey',_0x93d8('0x12d'),'privateKey',_0x93d8('0x12e'),_0x93d8('0x12f'),'key',_0x93d8('0x12'),_0x93d8('0x130'),_0x93d8('0x131'),_0x93d8('0x132'),_0x93d8('0x133'),_0x93d8('0x134'),'registry',_0x93d8('0x135')];function maskSensitiveData(_0x333563){var _0x10723f=/(?!^)[\s\S](?!$)/g;if(!_[_0x93d8('0x136')](_0x333563))return;for(var _0x531ce7 in _0x333563){if(_['isArray'](_0x333563[_0x531ce7])){for(var _0x218ce4=0x0;_0x218ce4<_0x333563[_0x531ce7][_0x93d8('0x137')];_0x218ce4++){maskSensitiveData(_0x333563[_0x531ce7][_0x218ce4]);}}else if(_['isPlainObject'](_0x333563[_0x531ce7])){maskSensitiveData(_0x333563[_0x531ce7]);}else if(_['isString'](_0x333563[_0x531ce7])){_0x333563[_0x531ce7]=_0x333563[_0x531ce7][_0x93d8('0x138')](/{{{/g,_0x93d8('0x139'))[_0x93d8('0x138')](/}}}/g,_0x93d8('0x13a'))[_0x93d8('0x138')](/{{/g,'@{')['replace'](/}}/g,'}@');if(_[_0x93d8('0x13b')](sensitiveFields,_0x531ce7)){_0x333563[_0x531ce7]=_0x333563[_0x531ce7]['replace'](_0x10723f,'*');}}}}
\ No newline at end of file
+var _0x93f6=['./api/voiceQueuesLog','/api/schedules','/api/sounds','./api/sound','/api/tags','/api/templates','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intZendeskField','/api/integrations/freshdesk/accounts','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','./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/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/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/accounts','./api/whatsappAccount','./api/whatsappApplication','./api/whatsappInteraction','/api/whatsapp/messages','/api/whatsapp/reports/queue','/api/whatsapp/queues','/api/cloudProviders','./api/cloudProvider','/api/realtime','/api/auth/local','./api/authLocal','/api/jira','/api/rpc','./api/rpc','/api/version','/api/system','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','join','/www','static','root','/demo','/snippet','/plugins','/server/files/plugins','route','get','sendFile','resolve','appPath','/index.html','username','password','newPassword','apiKey','firstName','lastName','phone','mobile','clientId','clientSecret','securityToken','code','accessKey','tenantId','channelSecret','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridnum','exten','privateKey','accesskeyid','secretaccesskey','accountSid','localstationid','secret','registry','oldPassword','isPlainObject','}@@','replace','lodash','path','express','express-winston','./config/environment','api','./config/logger','auth','default','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','body','\x20body=%s','method','x-forwarded-for','headers','connection','statusCode','user','name','role','inspect','use','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','remoteAddress','responseTime','agent_name','test','url','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','./api/voiceMailMessage','/api/voice/dials/reports','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','/api/dashboards','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/groups','/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/action','/api/automations','./api/automation','/api/canned_answers','/api/dispositions','./api/disposition','./api/condition','/api/pauses','./api/pause','/api/voiceQueuesLog'];(function(_0x2a3542,_0x5494d2){var _0xef0c09=function(_0x45d535){while(--_0x45d535){_0x2a3542['push'](_0x2a3542['shift']());}};_0xef0c09(++_0x5494d2);}(_0x93f6,0xc2));var _0x693f=function(_0x2d0ba4,_0x2182ab){_0x2d0ba4=_0x2d0ba4-0x0;var _0x3d7822=_0x93f6[_0x2d0ba4];return _0x3d7822;};'use strict';var _=require(_0x693f('0x0'));var path=require(_0x693f('0x1'));var express=require(_0x693f('0x2'));var ewinston=require(_0x693f('0x3'));var util=require('util');var errors=require('./errors');var config=require(_0x693f('0x4'));var logger=require('./config/logger')(_0x693f('0x5'));var authLogger=require(_0x693f('0x6'))(_0x693f('0x7'));exports[_0x693f('0x8')]=function(_0x30a389){_0x30a389['use'](ewinston[_0x693f('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x42e8ee,_0x24efe0){var _0x5964df=_0x693f('0xa');if(!_['isEmpty'](_0x42e8ee[_0x693f('0xb')])){_0x5964df+=_0x693f('0xc');var _0x3038cc=_0x42e8ee[_0x693f('0xb')];maskSensitiveData(_0x3038cc);}return util['format'](_0x5964df,_0x42e8ee[_0x693f('0xd')],_0x42e8ee['headers'][_0x693f('0xe')]?_0x42e8ee[_0x693f('0xf')][_0x693f('0xe')]:_0x42e8ee[_0x693f('0x10')]['remoteAddress']||_0x42e8ee['ip'],_0x42e8ee['url'],_0x24efe0[_0x693f('0x11')],_0x24efe0['responseTime'],_0x42e8ee['user']?_0x42e8ee[_0x693f('0x12')]['id']:null,_0x42e8ee['user']?_0x42e8ee[_0x693f('0x12')][_0x693f('0x13')]:null,_0x42e8ee[_0x693f('0x12')]?_0x42e8ee[_0x693f('0x12')][_0x693f('0x14')]:null,_0x3038cc?util[_0x693f('0x15')](_0x3038cc,![],null):'');}}));_0x30a389[_0x693f('0x16')](ewinston[_0x693f('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x4f8cde,_0x6eff13){var _0x107d0c='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x4f8cde['body']&&_0x4f8cde[_0x693f('0xb')][_0x693f('0x17')]&&_0x4f8cde[_0x693f('0xb')][_0x693f('0x18')]){_0x107d0c=_0x693f('0x19');}return util[_0x693f('0x1a')](_0x107d0c,_0x4f8cde[_0x693f('0xd')],_0x4f8cde['headers'][_0x693f('0xe')]?_0x4f8cde[_0x693f('0xf')][_0x693f('0xe')]:_0x4f8cde[_0x693f('0x10')][_0x693f('0x1b')]||_0x4f8cde['ip'],_0x4f8cde['url'],_0x6eff13[_0x693f('0x11')],_0x6eff13[_0x693f('0x1c')],_0x4f8cde[_0x693f('0x12')]?_0x4f8cde[_0x693f('0x12')]['id']:null,_0x4f8cde[_0x693f('0x12')]?_0x4f8cde[_0x693f('0x12')][_0x693f('0x13')]:null,_0x4f8cde['user']?_0x4f8cde['user']['role']:null,_0x4f8cde[_0x693f('0xb')]&&_0x4f8cde[_0x693f('0xb')]['device']?_0x4f8cde[_0x693f('0xb')][_0x693f('0x17')]:'other',_0x4f8cde[_0x693f('0xb')]&&_0x4f8cde['body'][_0x693f('0x18')]?_0x4f8cde[_0x693f('0xb')]['agent_id']:'',_0x4f8cde[_0x693f('0xb')]&&_0x4f8cde[_0x693f('0xb')][_0x693f('0x1d')]?_0x4f8cde[_0x693f('0xb')][_0x693f('0x1d')]:'');},'ignoreRoute':function(_0x5d0542){var _0x31c7bf=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x31c7bf[_0x693f('0x1e')](_0x5d0542[_0x693f('0x1f')]);}}));_0x30a389[_0x693f('0x16')]('/api/users',require(_0x693f('0x20')));_0x30a389[_0x693f('0x16')](_0x693f('0x21'),require(_0x693f('0x22')));_0x30a389[_0x693f('0x16')]('/api/voice/contexts',require(_0x693f('0x23')));_0x30a389[_0x693f('0x16')](_0x693f('0x24'),require(_0x693f('0x25')));_0x30a389[_0x693f('0x16')](_0x693f('0x26'),require('./api/voiceMusicOnHold'));_0x30a389['use'](_0x693f('0x27'),require(_0x693f('0x28')));_0x30a389[_0x693f('0x16')](_0x693f('0x29'),require(_0x693f('0x2a')));_0x30a389[_0x693f('0x16')](_0x693f('0x2b'),require(_0x693f('0x2c')));_0x30a389[_0x693f('0x16')](_0x693f('0x2d'),require(_0x693f('0x2e')));_0x30a389['use']('/api/voice/mails/messages',require(_0x693f('0x2f')));_0x30a389[_0x693f('0x16')]('/api/voice/calls/reports',require('./api/voiceCallReport'));_0x30a389[_0x693f('0x16')](_0x693f('0x30'),require('./api/voiceDialReport'));_0x30a389[_0x693f('0x16')](_0x693f('0x31'),require(_0x693f('0x32')));_0x30a389[_0x693f('0x16')]('/api/voice/queues/reports',require(_0x693f('0x33')));_0x30a389[_0x693f('0x16')](_0x693f('0x34'),require(_0x693f('0x35')));_0x30a389['use'](_0x693f('0x36'),require(_0x693f('0x37')));_0x30a389['use']('/api/voice/transfers/reports',require('./api/voiceTransferReport'));_0x30a389['use']('/api/mail/out_servers',require(_0x693f('0x38')));_0x30a389[_0x693f('0x16')](_0x693f('0x39'),require(_0x693f('0x3a')));_0x30a389[_0x693f('0x16')](_0x693f('0x3b'),require('./api/mailQueue'));_0x30a389[_0x693f('0x16')]('/api/mail/substatuses',require(_0x693f('0x3c')));_0x30a389[_0x693f('0x16')](_0x693f('0x3d'),require('./api/mailInteraction'));_0x30a389[_0x693f('0x16')](_0x693f('0x3e'),require(_0x693f('0x3f')));_0x30a389[_0x693f('0x16')](_0x693f('0x40'),require(_0x693f('0x41')));_0x30a389['use'](_0x693f('0x42'),require('./api/mailQueueReport'));_0x30a389['use'](_0x693f('0x43'),require(_0x693f('0x44')));_0x30a389[_0x693f('0x16')](_0x693f('0x45'),require('./api/dashboardItem'));_0x30a389['use'](_0x693f('0x46'),require(_0x693f('0x47')));_0x30a389['use'](_0x693f('0x48'),require('./api/faxApplication'));_0x30a389[_0x693f('0x16')](_0x693f('0x49'),require(_0x693f('0x4a')));_0x30a389[_0x693f('0x16')](_0x693f('0x4b'),require('./api/faxMessage'));_0x30a389[_0x693f('0x16')](_0x693f('0x4c'),require(_0x693f('0x4d')));_0x30a389['use'](_0x693f('0x4e'),require(_0x693f('0x4f')));_0x30a389[_0x693f('0x16')](_0x693f('0x50'),require(_0x693f('0x51')));_0x30a389[_0x693f('0x16')](_0x693f('0x52'),require('./api/smsApplication'));_0x30a389[_0x693f('0x16')]('/api/sms/interactions',require(_0x693f('0x53')));_0x30a389[_0x693f('0x16')]('/api/sms/messages',require(_0x693f('0x54')));_0x30a389['use'](_0x693f('0x55'),require(_0x693f('0x56')));_0x30a389[_0x693f('0x16')](_0x693f('0x57'),require(_0x693f('0x58')));_0x30a389[_0x693f('0x16')](_0x693f('0x59'),require(_0x693f('0x5a')));_0x30a389[_0x693f('0x16')](_0x693f('0x5b'),require(_0x693f('0x5c')));_0x30a389['use'](_0x693f('0x5d'),require(_0x693f('0x5e')));_0x30a389['use'](_0x693f('0x5f'),require('./api/openchannelQueue'));_0x30a389[_0x693f('0x16')](_0x693f('0x60'),require(_0x693f('0x61')));_0x30a389[_0x693f('0x16')]('/api/openchannel/reports/queue',require(_0x693f('0x62')));_0x30a389['use'](_0x693f('0x63'),require(_0x693f('0x64')));_0x30a389[_0x693f('0x16')](_0x693f('0x65'),require(_0x693f('0x66')));_0x30a389[_0x693f('0x16')](_0x693f('0x67'),require(_0x693f('0x68')));_0x30a389[_0x693f('0x16')](_0x693f('0x69'),require(_0x693f('0x6a')));_0x30a389[_0x693f('0x16')]('/api/chat/queues',require('./api/chatQueue'));_0x30a389[_0x693f('0x16')](_0x693f('0x6b'),require('./api/chatGroup'));_0x30a389[_0x693f('0x16')](_0x693f('0x6c'),require(_0x693f('0x6d')));_0x30a389['use'](_0x693f('0x6e'),require(_0x693f('0x6f')));_0x30a389[_0x693f('0x16')](_0x693f('0x70'),require(_0x693f('0x71')));_0x30a389['use'](_0x693f('0x72'),require(_0x693f('0x73')));_0x30a389[_0x693f('0x16')](_0x693f('0x74'),require(_0x693f('0x75')));_0x30a389[_0x693f('0x16')](_0x693f('0x76'),require(_0x693f('0x77')));_0x30a389['use'](_0x693f('0x78'),require(_0x693f('0x79')));_0x30a389['use'](_0x693f('0x7a'),require(_0x693f('0x7b')));_0x30a389[_0x693f('0x16')]('/api/actions',require(_0x693f('0x7c')));_0x30a389[_0x693f('0x16')](_0x693f('0x7d'),require(_0x693f('0x7e')));_0x30a389[_0x693f('0x16')](_0x693f('0x7f'),require('./api/cannedAnswer'));_0x30a389[_0x693f('0x16')](_0x693f('0x80'),require(_0x693f('0x81')));_0x30a389[_0x693f('0x16')]('/api/conditions',require(_0x693f('0x82')));_0x30a389[_0x693f('0x16')]('/api/intervals',require('./api/interval'));_0x30a389['use'](_0x693f('0x83'),require(_0x693f('0x84')));_0x30a389['use']('/api/cdr',require('./api/cdr'));_0x30a389['use'](_0x693f('0x85'),require(_0x693f('0x86')));_0x30a389[_0x693f('0x16')](_0x693f('0x87'),require('./api/schedule'));_0x30a389[_0x693f('0x16')](_0x693f('0x88'),require(_0x693f('0x89')));_0x30a389[_0x693f('0x16')](_0x693f('0x8a'),require('./api/tag'));_0x30a389[_0x693f('0x16')](_0x693f('0x8b'),require('./api/template'));_0x30a389[_0x693f('0x16')]('/api/triggers',require('./api/trigger'));_0x30a389[_0x693f('0x16')](_0x693f('0x8c'),require(_0x693f('0x8d')));_0x30a389[_0x693f('0x16')](_0x693f('0x8e'),require(_0x693f('0x8f')));_0x30a389[_0x693f('0x16')](_0x693f('0x90'),require(_0x693f('0x91')));_0x30a389[_0x693f('0x16')](_0x693f('0x92'),require(_0x693f('0x93')));_0x30a389['use'](_0x693f('0x94'),require(_0x693f('0x95')));_0x30a389[_0x693f('0x16')]('/api/analytics/extracted_reports',require(_0x693f('0x96')));_0x30a389[_0x693f('0x16')](_0x693f('0x97'),require(_0x693f('0x98')));_0x30a389[_0x693f('0x16')](_0x693f('0x99'),require(_0x693f('0x9a')));_0x30a389[_0x693f('0x16')](_0x693f('0x9b'),require(_0x693f('0x9c')));_0x30a389[_0x693f('0x16')]('/api/integrations/salesforce/accounts',require(_0x693f('0x9d')));_0x30a389['use'](_0x693f('0x9e'),require(_0x693f('0x9f')));_0x30a389[_0x693f('0x16')](_0x693f('0xa0'),require(_0x693f('0xa1')));_0x30a389[_0x693f('0x16')]('/api/integrations/sugarcrm/accounts',require(_0x693f('0xa2')));_0x30a389[_0x693f('0x16')](_0x693f('0xa3'),require(_0x693f('0xa4')));_0x30a389[_0x693f('0x16')](_0x693f('0xa5'),require('./api/intSugarcrmField'));_0x30a389[_0x693f('0x16')](_0x693f('0xa6'),require(_0x693f('0xa7')));_0x30a389[_0x693f('0x16')](_0x693f('0xa8'),require(_0x693f('0xa9')));_0x30a389['use'](_0x693f('0xaa'),require(_0x693f('0xab')));_0x30a389['use'](_0x693f('0xac'),require(_0x693f('0xad')));_0x30a389[_0x693f('0x16')](_0x693f('0xae'),require('./api/intZohoConfiguration'));_0x30a389[_0x693f('0x16')](_0x693f('0xaf'),require(_0x693f('0xb0')));_0x30a389['use'](_0x693f('0xb1'),require(_0x693f('0xb2')));_0x30a389[_0x693f('0x16')](_0x693f('0xb3'),require(_0x693f('0xb4')));_0x30a389[_0x693f('0x16')]('/api/integrations/zendesk/fields',require(_0x693f('0xb5')));_0x30a389[_0x693f('0x16')](_0x693f('0xb6'),require('./api/intFreshdeskAccount'));_0x30a389[_0x693f('0x16')](_0x693f('0xb7'),require(_0x693f('0xb8')));_0x30a389[_0x693f('0x16')](_0x693f('0xb9'),require('./api/intFreshdeskField'));_0x30a389[_0x693f('0x16')]('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0x30a389['use'](_0x693f('0xba'),require(_0x693f('0xbb')));_0x30a389[_0x693f('0x16')](_0x693f('0xbc'),require(_0x693f('0xbd')));_0x30a389[_0x693f('0x16')](_0x693f('0xbe'),require(_0x693f('0xbf')));_0x30a389[_0x693f('0x16')](_0x693f('0xc0'),require(_0x693f('0xc1')));_0x30a389[_0x693f('0x16')](_0x693f('0xc2'),require(_0x693f('0xc3')));_0x30a389[_0x693f('0x16')](_0x693f('0xc4'),require(_0x693f('0xc5')));_0x30a389[_0x693f('0x16')](_0x693f('0xc6'),require(_0x693f('0xc7')));_0x30a389['use'](_0x693f('0xc8'),require(_0x693f('0xc9')));_0x30a389[_0x693f('0x16')](_0x693f('0xca'),require(_0x693f('0xcb')));_0x30a389[_0x693f('0x16')]('/api/integrations/freshsales/configurations',require(_0x693f('0xcc')));_0x30a389[_0x693f('0x16')](_0x693f('0xcd'),require(_0x693f('0xce')));_0x30a389[_0x693f('0x16')](_0x693f('0xcf'),require(_0x693f('0xd0')));_0x30a389['use'](_0x693f('0xd1'),require(_0x693f('0xd2')));_0x30a389[_0x693f('0x16')](_0x693f('0xd3'),require(_0x693f('0xd4')));_0x30a389[_0x693f('0x16')](_0x693f('0xd5'),require('./api/jscriptyAnswerReport'));_0x30a389[_0x693f('0x16')]('/api/jscripty/questions/reports',require(_0x693f('0xd6')));_0x30a389[_0x693f('0x16')](_0x693f('0xd7'),require(_0x693f('0xd8')));_0x30a389[_0x693f('0x16')](_0x693f('0xd9'),require('./api/smsQueueReport'));_0x30a389[_0x693f('0x16')](_0x693f('0xda'),require(_0x693f('0xdb')));_0x30a389[_0x693f('0x16')](_0x693f('0xdc'),require(_0x693f('0xdd')));_0x30a389[_0x693f('0x16')](_0x693f('0xde'),require(_0x693f('0xdf')));_0x30a389[_0x693f('0x16')](_0x693f('0xe0'),require(_0x693f('0xe1')));_0x30a389['use'](_0x693f('0xe2'),require(_0x693f('0xe3')));_0x30a389['use'](_0x693f('0xe4'),require(_0x693f('0xe5')));_0x30a389[_0x693f('0x16')]('/api/square/recordings',require(_0x693f('0xe6')));_0x30a389['use'](_0x693f('0xe7'),require(_0x693f('0xe8')));_0x30a389['use']('/api/teams',require('./api/team'));_0x30a389['use']('/api/license',require(_0x693f('0xe9')));_0x30a389[_0x693f('0x16')](_0x693f('0xea'),require(_0x693f('0xeb')));_0x30a389[_0x693f('0x16')](_0x693f('0xec'),require(_0x693f('0xed')));_0x30a389['use'](_0x693f('0xee'),require(_0x693f('0xef')));_0x30a389['use'](_0x693f('0xf0'),require(_0x693f('0xf1')));_0x30a389[_0x693f('0x16')](_0x693f('0xf2'),require(_0x693f('0xf3')));_0x30a389[_0x693f('0x16')](_0x693f('0xf4'),require(_0x693f('0xf5')));_0x30a389[_0x693f('0x16')]('/api/fax/reports/transfer',require('./api/faxTransferReport'));_0x30a389['use'](_0x693f('0xf6'),require(_0x693f('0xf7')));_0x30a389[_0x693f('0x16')](_0x693f('0xf8'),require('./api/smsTransferReport'));_0x30a389[_0x693f('0x16')](_0x693f('0xf9'),require('./api/cmList'));_0x30a389[_0x693f('0x16')](_0x693f('0xfa'),require(_0x693f('0xfb')));_0x30a389[_0x693f('0x16')](_0x693f('0xfc'),require(_0x693f('0xfd')));_0x30a389[_0x693f('0x16')]('/api/userProfile/sections',require(_0x693f('0xfe')));_0x30a389['use'](_0x693f('0xff'),require(_0x693f('0x100')));_0x30a389[_0x693f('0x16')](_0x693f('0x101'),require(_0x693f('0x102')));_0x30a389[_0x693f('0x16')](_0x693f('0x103'),require(_0x693f('0x104')));_0x30a389['use']('/api/whatsapp/applications',require(_0x693f('0x105')));_0x30a389[_0x693f('0x16')]('/api/whatsapp/interactions',require(_0x693f('0x106')));_0x30a389[_0x693f('0x16')](_0x693f('0x107'),require('./api/whatsappMessage'));_0x30a389[_0x693f('0x16')](_0x693f('0x108'),require('./api/whatsappQueueReport'));_0x30a389[_0x693f('0x16')]('/api/whatsapp/reports/transfer',require('./api/whatsappTransferReport'));_0x30a389['use'](_0x693f('0x109'),require('./api/whatsappQueue'));_0x30a389['use'](_0x693f('0x10a'),require(_0x693f('0x10b')));_0x30a389[_0x693f('0x16')](_0x693f('0x10c'),require('./api/realtime'));_0x30a389[_0x693f('0x16')](_0x693f('0x10d'),require(_0x693f('0x10e')));_0x30a389[_0x693f('0x16')]('/api/auth/google',require('./api/authGoogle'));_0x30a389[_0x693f('0x16')](_0x693f('0x10f'),require('./api/jira'));_0x30a389['use'](_0x693f('0x110'),require(_0x693f('0x111')));_0x30a389[_0x693f('0x16')](_0x693f('0x112'),require('./api/version'));_0x30a389[_0x693f('0x16')](_0x693f('0x113'),require(_0x693f('0x114')));_0x30a389[_0x693f('0x16')](_0x693f('0x115'),require(_0x693f('0x116')));_0x30a389[_0x693f('0x16')](_0x693f('0x117'),require(_0x693f('0x118')));_0x30a389[_0x693f('0x16')](_0x693f('0x119'),express['static'](path[_0x693f('0x11a')](config['root'],_0x693f('0x119'))));_0x30a389[_0x693f('0x16')](_0x693f('0x11b'),express[_0x693f('0x11c')](path[_0x693f('0x11a')](config[_0x693f('0x11d')],_0x693f('0x11b'))));_0x30a389[_0x693f('0x16')](_0x693f('0x11e'),express[_0x693f('0x11c')](path['join'](config[_0x693f('0x11d')],_0x693f('0x11e'))));_0x30a389[_0x693f('0x16')](_0x693f('0x11f'),express[_0x693f('0x11c')](path[_0x693f('0x11a')](config[_0x693f('0x11d')],'snippet','3.0.0')));_0x30a389[_0x693f('0x16')](_0x693f('0x120'),express[_0x693f('0x11c')](path[_0x693f('0x11a')](config[_0x693f('0x11d')],_0x693f('0x121'))));_0x30a389['route']('/:url(api|auth|components|app|bower_components|assets)/*')['get'](errors[0x194]);_0x30a389[_0x693f('0x122')]('/*')[_0x693f('0x123')](function(_0x1e4add,_0x5b0936){_0x5b0936[_0x693f('0x124')](path[_0x693f('0x125')](_0x30a389[_0x693f('0x123')](_0x693f('0x126'))+_0x693f('0x127')));});};var sensitiveFields=[_0x693f('0x128'),_0x693f('0x129'),_0x693f('0x12a'),_0x693f('0x12b'),_0x693f('0x12c'),_0x693f('0x12d'),'street',_0x693f('0x12e'),_0x693f('0x12f'),'fax','email',_0x693f('0x130'),_0x693f('0x131'),_0x693f('0x132'),_0x693f('0x133'),_0x693f('0x134'),_0x693f('0x135'),'token',_0x693f('0x136'),'accessToken',_0x693f('0x137'),_0x693f('0x138'),_0x693f('0x139'),_0x693f('0x13a'),'membername','calleridname',_0x693f('0x13b'),_0x693f('0x13c'),'vidaooApiKey','clientEmail',_0x693f('0x13d'),_0x693f('0x13e'),_0x693f('0x13f'),'key','user','pass',_0x693f('0x140'),_0x693f('0x141'),'dsn',_0x693f('0x142'),_0x693f('0x143'),_0x693f('0x144')];function maskSensitiveData(_0x1db350){var _0x205e7b=/(?!^)[\s\S](?!$)/g;if(!_[_0x693f('0x145')](_0x1db350))return;for(var _0x5a307e in _0x1db350){if(_['isArray'](_0x1db350[_0x5a307e])){for(var _0xa25ba=0x0;_0xa25ba<_0x1db350[_0x5a307e]['length'];_0xa25ba++){maskSensitiveData(_0x1db350[_0x5a307e][_0xa25ba]);}}else if(_[_0x693f('0x145')](_0x1db350[_0x5a307e])){maskSensitiveData(_0x1db350[_0x5a307e]);}else if(_['isString'](_0x1db350[_0x5a307e])){_0x1db350[_0x5a307e]=_0x1db350[_0x5a307e]['replace'](/{{{/g,'@@{')['replace'](/}}}/g,_0x693f('0x146'))[_0x693f('0x147')](/{{/g,'@{')[_0x693f('0x147')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x5a307e)){_0x1db350[_0x5a307e]=_0x1db350[_0x5a307e][_0x693f('0x147')](_0x205e7b,'*');}}}}
\ No newline at end of file
index 38d0e71..491e10a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9584=['bluebird','lodash','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.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/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/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','server','http','rpc','port','localhost','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','RPC\x20listening\x20on\x20'];(function(_0x1787d0,_0x2f2305){var _0x338c91=function(_0x463f89){while(--_0x463f89){_0x1787d0['push'](_0x1787d0['shift']());}};_0x338c91(++_0x2f2305);}(_0x9584,0x110));var _0x4958=function(_0x266e9d,_0x3ead2f){_0x266e9d=_0x266e9d-0x0;var _0x204f80=_0x9584[_0x266e9d];return _0x204f80;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x4958('0x0'));var _=require(_0x4958('0x1'));var config=require(_0x4958('0x2'));exports[_0x4958('0x3')]=function(){return new BPromise(function(_0x1a1da5,_0x2a1246){var _0x442b42={};_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/user/user.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x5')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x6')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/voiceRecording/voiceRecording.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x7')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x442b42=_['merge'](_0x442b42,require(_0x4958('0x8')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x9')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0xa')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0xb')));_0x442b42=_['merge'](_0x442b42,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x442b42=_['merge'](_0x442b42,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x442b42=_['merge'](_0x442b42,require(_0x4958('0xc')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0xd')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/mailQueue/mailQueue.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0xe')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0xf')));_0x442b42=_['merge'](_0x442b42,require(_0x4958('0x10')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x11')));_0x442b42=_['merge'](_0x442b42,require(_0x4958('0x12')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x13')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x14')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x15')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x16')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/smsAccount/smsAccount.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x17')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x18')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x19')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x1a')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x1b')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x1c')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x1d')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x1e')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/chatMessage/chatMessage.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/chatQueue/chatQueue.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/cmContact/cmContact.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x1f')));_0x442b42=_['merge'](_0x442b42,require(_0x4958('0x20')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x21')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x22')));_0x442b42=_['merge'](_0x442b42,require('../api/interval/interval.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/pause/pause.rpc'));_0x442b42=_['merge'](_0x442b42,require(_0x4958('0x23')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x24')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/trigger/trigger.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/variable/variable.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x25')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x26')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x27')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x28')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x29')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x2a')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x2b')));_0x442b42=_['merge'](_0x442b42,require(_0x4958('0x2c')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x2d')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x2e')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x2f')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x30')));_0x442b42=_['merge'](_0x442b42,require(_0x4958('0x31')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x32')));_0x442b42=_['merge'](_0x442b42,require(_0x4958('0x33')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x34')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require('../api/campaign/campaign.rpc'));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x35')));_0x442b42=_['merge'](_0x442b42,require(_0x4958('0x36')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x37')));_0x442b42=_['merge'](_0x442b42,require(_0x4958('0x38')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x39')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x3a')));_0x442b42=_[_0x4958('0x4')](_0x442b42,require(_0x4958('0x3b')));var _0x260d65=jayson[_0x4958('0x3c')](_0x442b42)[_0x4958('0x3d')]();var _0x5ae3a2=config[_0x4958('0x3e')][_0x4958('0x3f')]||config['port']+0x1;var _0x2f41cd=config[_0x4958('0x3e')]['ip']||_0x4958('0x40');_0x260d65['on']('error',function(_0x4d7137){return _0x2a1246(_0x4d7137);});_0x260d65[_0x4958('0x3')](_0x5ae3a2,_0x2f41cd,function(){console[_0x4958('0x41')](_0x4958('0x42'),_0x2f41cd,_0x5ae3a2);require('../config/triggers')['default']();return _0x1a1da5(_0x4958('0x43')+_0x2f41cd+':'+_0x5ae3a2);});});};
\ No newline at end of file
+var _0x1c25=['jayson/promise','bluebird','lodash','../config/environment','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailQueue/mailQueue.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.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','default'];(function(_0x68385b,_0x4817d6){var _0x1b9dbb=function(_0x5b6b31){while(--_0x5b6b31){_0x68385b['push'](_0x68385b['shift']());}};_0x1b9dbb(++_0x4817d6);}(_0x1c25,0x118));var _0x51c2=function(_0x2b8202,_0x196a97){_0x2b8202=_0x2b8202-0x0;var _0xecfc33=_0x1c25[_0x2b8202];return _0xecfc33;};'use strict';var jayson=require(_0x51c2('0x0'));var BPromise=require(_0x51c2('0x1'));var _=require(_0x51c2('0x2'));var config=require(_0x51c2('0x3'));exports['listen']=function(){return new BPromise(function(_0x1adbff,_0x49db1c){var _0x12b631={};_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x5')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x6')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x7')));_0x12b631=_['merge'](_0x12b631,require(_0x51c2('0x8')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x9')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0xa')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/memberReport/memberReport.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0xb')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0xc')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0xd')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/mailAccount/mailAccount.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0xe')));_0x12b631=_['merge'](_0x12b631,require('../api/mailInteraction/mailInteraction.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/mailMessage/mailMessage.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/mailApplication/mailApplication.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0xf')));_0x12b631=_['merge'](_0x12b631,require('../api/faxAccount/faxAccount.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x10')));_0x12b631=_['merge'](_0x12b631,require(_0x51c2('0x11')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x12')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x13')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x14')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x15')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x16')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x17')));_0x12b631=_['merge'](_0x12b631,require(_0x51c2('0x18')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x12b631=_['merge'](_0x12b631,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x12b631=_['merge'](_0x12b631,require(_0x51c2('0x19')));_0x12b631=_['merge'](_0x12b631,require(_0x51c2('0x1a')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x1b')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x1c')));_0x12b631=_['merge'](_0x12b631,require(_0x51c2('0x1d')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x1e')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x1f')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x20')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x21')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x22')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x23')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x24')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x25')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x26')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x27')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x28')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/trigger/trigger.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x29')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x2a')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x12b631=_['merge'](_0x12b631,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x2b')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x2c')));_0x12b631=_['merge'](_0x12b631,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x2d')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x2e')));_0x12b631=_['merge'](_0x12b631,require(_0x51c2('0x2f')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x30')));_0x12b631=_['merge'](_0x12b631,require(_0x51c2('0x31')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x32')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/setting/setting.rpc'));_0x12b631=_['merge'](_0x12b631,require(_0x51c2('0x33')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x34')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x35')));_0x12b631=_['merge'](_0x12b631,require(_0x51c2('0x36')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x37')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require('../api/attachment/attachment.rpc'));_0x12b631=_['merge'](_0x12b631,require(_0x51c2('0x38')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x39')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x3a')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x3b')));_0x12b631=_[_0x51c2('0x4')](_0x12b631,require(_0x51c2('0x3c')));_0x12b631=_['merge'](_0x12b631,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x235a4e=jayson[_0x51c2('0x3d')](_0x12b631)[_0x51c2('0x3e')]();var _0x346ee5=config[_0x51c2('0x3f')][_0x51c2('0x40')]||config['port']+0x1;var _0x310bc0=config[_0x51c2('0x3f')]['ip']||'localhost';_0x235a4e['on'](_0x51c2('0x41'),function(_0x402a0b){return _0x49db1c(_0x402a0b);});_0x235a4e[_0x51c2('0x42')](_0x346ee5,_0x310bc0,function(){console['log'](_0x51c2('0x43'),_0x310bc0,_0x346ee5);require(_0x51c2('0x44'))[_0x51c2('0x45')]();return _0x1adbff('RPC\x20listening\x20on\x20'+_0x310bc0+':'+_0x346ee5);});});};
\ No newline at end of file
index 5f403b6..6984c09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4ca6=['error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sync','answer','ANSWER','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','sendRequest','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','toString','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','getVariable','GET\x20VARIABLE\x20\x22%s\x22','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','./error','setEncoding','setTimeout','utf8','emit','ready','line','toLowerCase','hangup','520-Invalid','search','function','substring','no\x20code','replace','indexOf','startsWith','split','length','match'];(function(_0x833f99,_0x3cf4b6){var _0x5681bf=function(_0x4de463){while(--_0x4de463){_0x833f99['push'](_0x833f99['shift']());}};_0x5681bf(++_0x3cf4b6);}(_0x4ca6,0x1a9));var _0x64ca=function(_0x29df9a,_0x42aff3){_0x29df9a=_0x29df9a-0x0;var _0x3a8e96=_0x4ca6[_0x29df9a];return _0x3a8e96;};'use strict';var util=require(_0x64ca('0x0'));var _=require(_0x64ca('0x1'));var EventEmitter=require(_0x64ca('0x2'))[_0x64ca('0x3')];var AGIReply=require(_0x64ca('0x4'));var AGIError=require(_0x64ca('0x5'));function AGIChannel(_0x49e6c6){var _0x15b3f9=this,_0x577afc=new AGIReply(),_0x29d468=![],_0x2714f1={};EventEmitter['call'](_0x15b3f9);_0x49e6c6[_0x64ca('0x6')]('utf8');_0x49e6c6[_0x64ca('0x7')](0x8*0x3c*0x3c*0x3e8);_0x577afc['setEncoding'](_0x64ca('0x8'));_0x577afc['on']('headers',function(_0x596fc0){for(var _0x3ade8f in _0x596fc0){_0x15b3f9[_0x3ade8f]=_0x596fc0[_0x3ade8f];}_0x15b3f9[_0x64ca('0x9')](_0x64ca('0xa'));});_0x577afc['on'](_0x64ca('0xb'),function(_0x432ddf){if(_0x432ddf[_0x64ca('0xc')]()=='hangup'){_0x15b3f9['emit'](_0x64ca('0xd'));return;}if(_0x432ddf['substring'](0x0,0xb)==_0x64ca('0xe')){_0x29d468=!![];}if(_0x29d468){_0x2714f1['rx']+=_0x432ddf+'\x0a';if(_0x432ddf[_0x64ca('0xf')]('520\x20End\x20of\x20proper')!=-0x1){_0x29d468=![];}}else{_0x2714f1['rx']=_0x432ddf;}if(_0x29d468){return;}if(typeof _0x2714f1['cb']==_0x64ca('0x10')){var _0x1fab09=_0x2714f1['rx'][_0x64ca('0x11')](0x0,0x3),_0x43b31e=null,_0x503ab7=null;_0x1fab09=parseInt(_0x1fab09);if(isNaN(_0x1fab09)){_0x2714f1['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x64ca('0x12')});return;}if(_0x1fab09!=0xc8){_0x2714f1['cb'](null,{'code':_0x1fab09,'result':-0x1,'extra':'KO'});return;}_0x43b31e=_0x2714f1['rx'][_0x64ca('0x11')](0x4)[_0x64ca('0x13')]('result=','');if(_0x43b31e[_0x64ca('0x14')]('\x20')!=-0x1){_0x43b31e=_0x43b31e['substr'](0x0,_0x43b31e[_0x64ca('0x14')]('\x20'));}if(_[_0x64ca('0x15')](_0x43b31e,'-1')){_0x43b31e=parseInt(_0x43b31e);}_0x503ab7=_0x2714f1['rx'][_0x64ca('0x16')]('\x20');if(_0x503ab7[_0x64ca('0x17')]==0x3){_0x503ab7=_0x503ab7[0x2][_0x64ca('0x11')](0x1,_0x503ab7[0x2]['length']-0x1);}else if(_0x503ab7[_0x64ca('0x17')]>0x3){var _0x163bb2=/\((.+)\)/;var _0x1c27e5=_0x2714f1['rx'][_0x64ca('0x18')](_0x163bb2);if(_0x1c27e5){_0x503ab7=_0x1c27e5[0x1];}else{_0x503ab7=null;}}else{_0x503ab7=null;}_0x2714f1['cb'](null,{'code':_0x1fab09,'result':_0x43b31e,'extra':_0x503ab7});}});_0x49e6c6['on'](_0x64ca('0x19'),function(_0x2b5da3){_0x15b3f9['emit'](_0x64ca('0x19'),new AGIError(_0x64ca('0x1a'),_0x2b5da3['code']));});_0x49e6c6['on'](_0x64ca('0x1b'),function(){_0x15b3f9['emit'](_0x64ca('0x1b'),new AGIError(_0x64ca('0x1c')));});_0x49e6c6['on'](_0x64ca('0x1d'),function(){_0x15b3f9[_0x64ca('0x9')](_0x64ca('0x1d'),new AGIError(_0x64ca('0x1e')));_0x49e6c6[_0x64ca('0x1f')]();});_0x49e6c6[_0x64ca('0x20')](_0x577afc);this[_0x64ca('0x21')]=function(_0x4d5d87,_0x1f8c84){var _0x4d5d87=_0x4d5d87||'',_0x1f8c84=typeof _0x1f8c84==_0x64ca('0x10')?_0x1f8c84:new Function();_0x2714f1={'tx':_0x4d5d87,'rx':'','cb':_0x1f8c84};_0x49e6c6[_0x64ca('0x22')](_0x4d5d87+'\x0a');},this[_0x64ca('0x1b')]=function(){_0x49e6c6[_0x64ca('0x1f')]();};}util[_0x64ca('0x23')](AGIChannel,EventEmitter);AGIChannel[_0x64ca('0x24')]['sendRequest']=function(_0x1db1cf){return this[_0x64ca('0x21')][_0x64ca('0x25')](this,_0x1db1cf);};AGIChannel['prototype'][_0x64ca('0x26')]=function(){return this['sendRequest'](_0x64ca('0x27'));};AGIChannel['prototype']['getData']=function(_0x34b82d,_0x4bb4f3,_0xc94f93){_0x34b82d=_0x34b82d===undefined?'beep':_0x34b82d;_0x4bb4f3=_0x4bb4f3===undefined?'5':_0x4bb4f3;_0xc94f93=_0xc94f93===undefined?'1':_0xc94f93;return this['sendRequest'](util[_0x64ca('0x28')](_0x64ca('0x29'),_0x34b82d,_0x4bb4f3*0x3e8,_0xc94f93));};AGIChannel[_0x64ca('0x24')][_0x64ca('0x2a')]=function(_0x360b06){_0x360b06=_0x360b06||_0x64ca('0x2b');return this[_0x64ca('0x2c')](util[_0x64ca('0x28')]('VERBOSE\x20\x22%s\x22',_0x360b06));};AGIChannel[_0x64ca('0x24')][_0x64ca('0x2d')]=function(_0x2af41a,_0x57e82c){if(_[_0x64ca('0x2e')](_0x57e82c)){return this[_0x64ca('0x2c')](util[_0x64ca('0x28')](_0x64ca('0x2f'),_0x2af41a,_0x57e82c[_0x64ca('0x30')](',')));}return this[_0x64ca('0x2c')](util[_0x64ca('0x28')](_0x64ca('0x2f'),_0x2af41a,_0x57e82c));};AGIChannel['prototype'][_0x64ca('0x31')]=function(_0x530a53){return this['sendRequest'](util['format'](_0x64ca('0x32'),_0x530a53));};AGIChannel['prototype'][_0x64ca('0x33')]=function(_0x17e31b){return this[_0x64ca('0x2c')](util[_0x64ca('0x28')](_0x64ca('0x34'),_0x17e31b));};AGIChannel[_0x64ca('0x24')][_0x64ca('0x35')]=function(_0x20d7e0){return this[_0x64ca('0x2c')](util['format'](_0x64ca('0x36'),_0x20d7e0));};AGIChannel[_0x64ca('0x24')][_0x64ca('0xd')]=function(){return this['sendRequest'](_0x64ca('0x37'));};AGIChannel[_0x64ca('0x24')][_0x64ca('0x38')]=function(_0x37801a,_0x482959){var _0x4ec7b2=_[_0x64ca('0x39')](_0x482959)||_['isNumber'](_0x482959)?_0x482959['toString']():_0x482959;return this['sendRequest'](util[_0x64ca('0x28')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x37801a,_0x4ec7b2?_0x4ec7b2[_0x64ca('0x3a')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x64ca('0x24')]['sayNumber']=function(_0x43ae23,_0x4a6187){return this['sendRequest'](util[_0x64ca('0x28')](_0x64ca('0x3b'),_0x43ae23,_0x4a6187));};AGIChannel[_0x64ca('0x24')][_0x64ca('0x3c')]=function(_0x38b22f,_0x6f8879){return this[_0x64ca('0x2c')](util[_0x64ca('0x28')](_0x64ca('0x3d'),_0x38b22f,_0x6f8879));};AGIChannel[_0x64ca('0x24')][_0x64ca('0x3e')]=function(_0x188d4a,_0x31a53b){return this[_0x64ca('0x2c')](util[_0x64ca('0x28')](_0x64ca('0x3f'),_0x188d4a,_0x31a53b));};AGIChannel[_0x64ca('0x24')][_0x64ca('0x40')]=function(_0x4c5949,_0x39b251,_0x5c1a43){_0x39b251=_0x39b251||this['extension'];_0x5c1a43=_0x5c1a43||0x1;this[_0x64ca('0x31')](_0x4c5949);this[_0x64ca('0x33')](_0x39b251);this[_0x64ca('0x35')](_0x5c1a43);return this[_0x64ca('0x2a')](util['format']('GOTO\x20%s\x20%s\x20%s',_0x4c5949,_0x39b251,_0x5c1a43));};AGIChannel['prototype'][_0x64ca('0x41')]=function(_0x445334){return this[_0x64ca('0x2c')](util[_0x64ca('0x28')](_0x64ca('0x42'),_0x445334));};AGIChannel[_0x64ca('0x24')]['recordFile']=function(_0x2512a5,_0x15937a,_0x32b879,_0xdb99b9,_0x85c515,_0x4b74f2){_0x15937a=_0x15937a||_0x64ca('0x43');_0x32b879=_0x32b879||'';_0xdb99b9=_0xdb99b9===undefined?-0x1:_0xdb99b9==='-1'?-0x1:_0xdb99b9*0x3e8;_0x85c515=_0x85c515===undefined?'':'s='+_0x85c515;_0x4b74f2=_0x4b74f2?_0x64ca('0x44'):'';return this[_0x64ca('0x2c')](util['format'](_0x64ca('0x45'),_0x2512a5,_0x15937a,_0x32b879,_0xdb99b9,_0x4b74f2,_0x85c515));};AGIChannel[_0x64ca('0x24')]['streamFile']=function(_0x46cd81,_0x146fd0){_0x146fd0=_0x146fd0||'';return this[_0x64ca('0x2c')](util[_0x64ca('0x28')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x46cd81,_0x146fd0));};AGIChannel[_0x64ca('0x24')]['agi']=function(_0x346455){return this[_0x64ca('0x2d')]('AGI',_0x346455);};AGIChannel[_0x64ca('0x24')][_0x64ca('0x46')]=function(_0x20a9a1){return this['exec'](_0x64ca('0x47'),_0x20a9a1);};AGIChannel[_0x64ca('0x24')][_0x64ca('0x19')]=function(_0x4677e3,_0x578828){this['noop'](util[_0x64ca('0x28')](_0x64ca('0x48'),_0x4677e3['id'],_0x4677e3[_0x64ca('0x49')],_0x578828));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x64ca('0x4a')]=AGIChannel;
\ No newline at end of file
+var _0x553f=['pipe','command','write','inherits','sendRequest','prototype','ANSWER','getData','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','join','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','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','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','./reply','call','utf8','setTimeout','setEncoding','headers','line','hangup','substring','search','520\x20End\x20of\x20proper','function','no\x20code','replace','indexOf','substr','startsWith','split','length','match','error','emit','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x553f,0x1c0));var _0xf553=function(_0x50ce08,_0x341c11){_0x50ce08=_0x50ce08-0x0;var _0x3005c3=_0x553f[_0x50ce08];return _0x3005c3;};'use strict';var util=require(_0xf553('0x0'));var _=require(_0xf553('0x1'));var EventEmitter=require(_0xf553('0x2'))[_0xf553('0x3')];var AGIReply=require(_0xf553('0x4'));var AGIError=require('./error');function AGIChannel(_0x5bcb5b){var _0x44e3b4=this,_0x59dcf9=new AGIReply(),_0x2864fd=![],_0x3b3c90={};EventEmitter[_0xf553('0x5')](_0x44e3b4);_0x5bcb5b['setEncoding'](_0xf553('0x6'));_0x5bcb5b[_0xf553('0x7')](0x8*0x3c*0x3c*0x3e8);_0x59dcf9[_0xf553('0x8')]('utf8');_0x59dcf9['on'](_0xf553('0x9'),function(_0xe2eec6){for(var _0x5d750a in _0xe2eec6){_0x44e3b4[_0x5d750a]=_0xe2eec6[_0x5d750a];}_0x44e3b4['emit']('ready');});_0x59dcf9['on'](_0xf553('0xa'),function(_0x1c9514){if(_0x1c9514['toLowerCase']()==_0xf553('0xb')){_0x44e3b4['emit'](_0xf553('0xb'));return;}if(_0x1c9514[_0xf553('0xc')](0x0,0xb)=='520-Invalid'){_0x2864fd=!![];}if(_0x2864fd){_0x3b3c90['rx']+=_0x1c9514+'\x0a';if(_0x1c9514[_0xf553('0xd')](_0xf553('0xe'))!=-0x1){_0x2864fd=![];}}else{_0x3b3c90['rx']=_0x1c9514;}if(_0x2864fd){return;}if(typeof _0x3b3c90['cb']==_0xf553('0xf')){var _0x3a296c=_0x3b3c90['rx'][_0xf553('0xc')](0x0,0x3),_0x16be09=null,_0x15231e=null;_0x3a296c=parseInt(_0x3a296c);if(isNaN(_0x3a296c)){_0x3b3c90['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xf553('0x10')});return;}if(_0x3a296c!=0xc8){_0x3b3c90['cb'](null,{'code':_0x3a296c,'result':-0x1,'extra':'KO'});return;}_0x16be09=_0x3b3c90['rx'][_0xf553('0xc')](0x4)[_0xf553('0x11')]('result=','');if(_0x16be09[_0xf553('0x12')]('\x20')!=-0x1){_0x16be09=_0x16be09[_0xf553('0x13')](0x0,_0x16be09['indexOf']('\x20'));}if(_[_0xf553('0x14')](_0x16be09,'-1')){_0x16be09=parseInt(_0x16be09);}_0x15231e=_0x3b3c90['rx'][_0xf553('0x15')]('\x20');if(_0x15231e[_0xf553('0x16')]==0x3){_0x15231e=_0x15231e[0x2][_0xf553('0xc')](0x1,_0x15231e[0x2][_0xf553('0x16')]-0x1);}else if(_0x15231e[_0xf553('0x16')]>0x3){var _0x4b4292=/\((.+)\)/;var _0x450bb3=_0x3b3c90['rx'][_0xf553('0x17')](_0x4b4292);if(_0x450bb3){_0x15231e=_0x450bb3[0x1];}else{_0x15231e=null;}}else{_0x15231e=null;}_0x3b3c90['cb'](null,{'code':_0x3a296c,'result':_0x16be09,'extra':_0x15231e});}});_0x5bcb5b['on'](_0xf553('0x18'),function(_0x14ae9c){_0x44e3b4[_0xf553('0x19')]('error',new AGIError(_0xf553('0x1a'),_0x14ae9c[_0xf553('0x1b')]));});_0x5bcb5b['on']('close',function(){_0x44e3b4['emit'](_0xf553('0x1c'),new AGIError(_0xf553('0x1d')));});_0x5bcb5b['on']('timeout',function(){_0x44e3b4['emit'](_0xf553('0x1e'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x5bcb5b[_0xf553('0x1f')]();});_0x5bcb5b[_0xf553('0x20')](_0x59dcf9);this[_0xf553('0x21')]=function(_0x392e45,_0x2ad893){var _0x392e45=_0x392e45||'',_0x2ad893=typeof _0x2ad893=='function'?_0x2ad893:new Function();_0x3b3c90={'tx':_0x392e45,'rx':'','cb':_0x2ad893};_0x5bcb5b[_0xf553('0x22')](_0x392e45+'\x0a');},this[_0xf553('0x1c')]=function(){_0x5bcb5b['destroy']();};}util[_0xf553('0x23')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0xf553('0x24')]=function(_0x107f0f){return this[_0xf553('0x21')]['sync'](this,_0x107f0f);};AGIChannel[_0xf553('0x25')]['answer']=function(){return this[_0xf553('0x24')](_0xf553('0x26'));};AGIChannel['prototype'][_0xf553('0x27')]=function(_0x532fa5,_0x14d287,_0x33ee2d){_0x532fa5=_0x532fa5===undefined?'beep':_0x532fa5;_0x14d287=_0x14d287===undefined?'5':_0x14d287;_0x33ee2d=_0x33ee2d===undefined?'1':_0x33ee2d;return this[_0xf553('0x24')](util[_0xf553('0x28')](_0xf553('0x29'),_0x532fa5,_0x14d287*0x3e8,_0x33ee2d));};AGIChannel['prototype'][_0xf553('0x2a')]=function(_0x3e06e0){_0x3e06e0=_0x3e06e0||_0xf553('0x2b');return this[_0xf553('0x24')](util['format'](_0xf553('0x2c'),_0x3e06e0));};AGIChannel[_0xf553('0x25')][_0xf553('0x2d')]=function(_0xac9992,_0x31cafc){if(_[_0xf553('0x2e')](_0x31cafc)){return this[_0xf553('0x24')](util[_0xf553('0x28')]('EXEC\x20%s\x20%s',_0xac9992,_0x31cafc[_0xf553('0x2f')](',')));}return this[_0xf553('0x24')](util['format'](_0xf553('0x30'),_0xac9992,_0x31cafc));};AGIChannel[_0xf553('0x25')][_0xf553('0x31')]=function(_0x279108){return this[_0xf553('0x24')](util['format'](_0xf553('0x32'),_0x279108));};AGIChannel[_0xf553('0x25')][_0xf553('0x33')]=function(_0x17d93e){return this[_0xf553('0x24')](util[_0xf553('0x28')](_0xf553('0x34'),_0x17d93e));};AGIChannel[_0xf553('0x25')][_0xf553('0x35')]=function(_0x2d2904){return this[_0xf553('0x24')](util['format'](_0xf553('0x36'),_0x2d2904));};AGIChannel[_0xf553('0x25')][_0xf553('0xb')]=function(){return this[_0xf553('0x24')](_0xf553('0x37'));};AGIChannel[_0xf553('0x25')][_0xf553('0x38')]=function(_0x5b2ef,_0x109585){var _0x47c502=_[_0xf553('0x39')](_0x109585)||_[_0xf553('0x3a')](_0x109585)?_0x109585[_0xf553('0x3b')]():_0x109585;return this[_0xf553('0x24')](util['format'](_0xf553('0x3c'),_0x5b2ef,_0x47c502?_0x47c502[_0xf553('0x3b')]()[_0xf553('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xf553('0x25')][_0xf553('0x3d')]=function(_0x38ae1c,_0x26a0ec){return this[_0xf553('0x24')](util[_0xf553('0x28')](_0xf553('0x3e'),_0x38ae1c,_0x26a0ec));};AGIChannel['prototype'][_0xf553('0x3f')]=function(_0x101518,_0x266b9d){return this['sendRequest'](util[_0xf553('0x28')]('SAY\x20DIGITS\x20%s\x20%s',_0x101518,_0x266b9d));};AGIChannel[_0xf553('0x25')][_0xf553('0x40')]=function(_0x582931,_0x16a533){return this['sendRequest'](util[_0xf553('0x28')](_0xf553('0x41'),_0x582931,_0x16a533));};AGIChannel[_0xf553('0x25')][_0xf553('0x42')]=function(_0x2b0535,_0x1f7b3a,_0x580077){_0x1f7b3a=_0x1f7b3a||this[_0xf553('0x43')];_0x580077=_0x580077||0x1;this[_0xf553('0x31')](_0x2b0535);this[_0xf553('0x33')](_0x1f7b3a);this[_0xf553('0x35')](_0x580077);return this[_0xf553('0x2a')](util[_0xf553('0x28')](_0xf553('0x44'),_0x2b0535,_0x1f7b3a,_0x580077));};AGIChannel[_0xf553('0x25')]['getVariable']=function(_0x222666){return this[_0xf553('0x24')](util[_0xf553('0x28')](_0xf553('0x45'),_0x222666));};AGIChannel[_0xf553('0x25')][_0xf553('0x46')]=function(_0x38f1b5,_0x4ef97d,_0xbd6be1,_0x286b1c,_0x5dabbb,_0x42b21d){_0x4ef97d=_0x4ef97d||'wav';_0xbd6be1=_0xbd6be1||'';_0x286b1c=_0x286b1c===undefined?-0x1:_0x286b1c==='-1'?-0x1:_0x286b1c*0x3e8;_0x5dabbb=_0x5dabbb===undefined?'':'s='+_0x5dabbb;_0x42b21d=_0x42b21d?_0xf553('0x47'):'';return this[_0xf553('0x24')](util[_0xf553('0x28')](_0xf553('0x48'),_0x38f1b5,_0x4ef97d,_0xbd6be1,_0x286b1c,_0x42b21d,_0x5dabbb));};AGIChannel[_0xf553('0x25')][_0xf553('0x49')]=function(_0x2581d4,_0x2a8313){_0x2a8313=_0x2a8313||'';return this[_0xf553('0x24')](util[_0xf553('0x28')](_0xf553('0x4a'),_0x2581d4,_0x2a8313));};AGIChannel[_0xf553('0x25')]['agi']=function(_0x230dac){return this[_0xf553('0x2d')](_0xf553('0x4b'),_0x230dac);};AGIChannel[_0xf553('0x25')]['wait']=function(_0x421ad8){return this['exec'](_0xf553('0x4c'),_0x421ad8);};AGIChannel[_0xf553('0x25')]['error']=function(_0x374c59,_0x4d2e2e){this['noop'](util[_0xf553('0x28')](_0xf553('0x4d'),_0x374c59['id'],_0x374c59[_0xf553('0x4e')],_0x4d2e2e));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xf553('0x4f')]=AGIChannel;
\ No newline at end of file
index 4798121..6fe1e82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x53fb=['Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','E_AGI_UNDEFINED','push','format','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.'];(function(_0x5b0a4a,_0x11a985){var _0x2ce5c6=function(_0x4b3a55){while(--_0x4b3a55){_0x5b0a4a['push'](_0x5b0a4a['shift']());}};_0x2ce5c6(++_0x11a985);}(_0x53fb,0xcc));var _0xb53f=function(_0x3eef57,_0xdbe4e7){_0x3eef57=_0x3eef57-0x0;var _0xe006d4=_0x53fb[_0x3eef57];return _0xe006d4;};'use strict';var util=require(_0xb53f('0x0'));var error={'E_AGI_UNDEFINED':_0xb53f('0x1'),'E_AGI_ARGUMENT_PORT':_0xb53f('0x2'),'E_AGI_SERVER_ERROR':_0xb53f('0x3'),'E_AGI_SERVER_CLOSE':_0xb53f('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xb53f('0x5'),'E_AGI_SOCKET_ERROR':_0xb53f('0x6'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0xb53f('0x7'),'E_AGI_COMMAND_EMPTY':_0xb53f('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x1f2b45){var _0x1f2b45=_0x1f2b45||null,_0x36c19b=_0x36c19b||[],_0x176628=0x1,_0x17cbeb='';if(!error[_0x1f2b45]){_0x1f2b45=_0xb53f('0x9');}_0x36c19b[_0xb53f('0xa')](error[_0x1f2b45]);while(arguments[_0x176628]){_0x36c19b[_0xb53f('0xa')](arguments[_0x176628]);_0x176628++;}_0x17cbeb=util[_0xb53f('0xb')]['apply'](util,_0x36c19b);this[_0xb53f('0xc')]=_0x17cbeb;this[_0xb53f('0xd')]=_0x1f2b45;}module[_0xb53f('0xe')]=AGIError;
\ No newline at end of file
+var _0xae20=['Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED','push','format','apply','message','name','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.'];(function(_0x595fe2,_0x5bc192){var _0x391c92=function(_0x4c97b1){while(--_0x4c97b1){_0x595fe2['push'](_0x595fe2['shift']());}};_0x391c92(++_0x5bc192);}(_0xae20,0x85));var _0x0ae2=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xae20[_0x4a9fb1];return _0x348672;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0x0ae2('0x0'),'E_AGI_ARGUMENT_PORT':_0x0ae2('0x1'),'E_AGI_SERVER_ERROR':_0x0ae2('0x2'),'E_AGI_SERVER_CLOSE':_0x0ae2('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x0ae2('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x0ae2('0x5'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x0ae2('0x6'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x0ae2('0x7'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x0ae2('0x8'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x4a0f2d){var _0x4a0f2d=_0x4a0f2d||null,_0x13d1d2=_0x13d1d2||[],_0x539be0=0x1,_0x1db73d='';if(!error[_0x4a0f2d]){_0x4a0f2d=_0x0ae2('0x9');}_0x13d1d2[_0x0ae2('0xa')](error[_0x4a0f2d]);while(arguments[_0x539be0]){_0x13d1d2[_0x0ae2('0xa')](arguments[_0x539be0]);_0x539be0++;}_0x1db73d=util[_0x0ae2('0xb')][_0x0ae2('0xc')](util,_0x13d1d2);this[_0x0ae2('0xd')]=_0x1db73d;this[_0x0ae2('0xe')]=_0x4a0f2d;}module['exports']=AGIError;
\ No newline at end of file
index be666b7..6fa86c9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd206=['edges','addVertex','prototype','addEdge','push','numberOfEdges','size','vertices','getVertex','traverseBFS','no\x20vertex\x20found','stop\x20traverse','length','info','no\x20edge/s\x20available','condition','split','vswitch','target','default','agicommand','invalid','includes','max\x20retry\x20reach','condition\x20not\x20found','lodash','getdigits','getsecretdigits'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xd206,0x89));var _0x6d20=function(_0x525c7b,_0x488fcc){_0x525c7b=_0x525c7b-0x0;var _0x27b33e=_0xd206[_0x525c7b];return _0x27b33e;};'use strict';var _=require(_0x6d20('0x0'));var logger=require('../../../config/logger')('agi');var verticesWithRetry=['menu',_0x6d20('0x1'),_0x6d20('0x2')];var Graph=function(){this['vertices']={};this[_0x6d20('0x3')]={};this['numberOfEdges']=0x0;};Graph['prototype'][_0x6d20('0x4')]=function(_0x24ff79){this['vertices'][_0x24ff79['id']]=_0x24ff79;this[_0x6d20('0x3')][_0x24ff79['id']]=[];};Graph[_0x6d20('0x5')][_0x6d20('0x6')]=function(_0x1969a1,_0x331f24,_0x9ecd59){this[_0x6d20('0x3')][_0x1969a1][_0x6d20('0x7')]({'target':_0x331f24,'condition':_0x9ecd59});this[_0x6d20('0x8')]+=0x1;};Graph[_0x6d20('0x5')][_0x6d20('0x9')]=function(){return _[_0x6d20('0x9')](this[_0x6d20('0xa')]);};Graph[_0x6d20('0x5')]['relations']=function(){return this[_0x6d20('0x8')];};Graph['prototype'][_0x6d20('0xb')]=function(_0x5e9c32){return this[_0x6d20('0xa')][_0x5e9c32];};Graph[_0x6d20('0x5')][_0x6d20('0xc')]=function(_0x2a94d2,_0xba5c2e){if(!this[_0x6d20('0xa')][_0x2a94d2]){return logger['info'](_0x6d20('0xd'));}var _0x204bff=_0xba5c2e(this[_0x6d20('0xa')][_0x2a94d2]);if(!_0x204bff){return logger['info'](_0x6d20('0xe'));}if(this['edges'][_0x2a94d2][_0x6d20('0xf')]===0x0){return logger[_0x6d20('0x10')](_0x6d20('0x11'));}for(var _0x29e381=0x0,_0x33395d=[],_0x2acb7b=![];_0x29e381<this[_0x6d20('0x3')][_0x2a94d2]['length'];_0x29e381+=0x1){if(this[_0x6d20('0x3')][_0x2a94d2][_0x29e381]['condition']){_0x33395d=this['edges'][_0x2a94d2][_0x29e381][_0x6d20('0x12')][_0x6d20('0x13')](',');for(var _0x3f009d=0x0;_0x3f009d<_0x33395d[_0x6d20('0xf')];_0x3f009d+=0x1){if(this['vertices'][_0x2a94d2]['agicommand']===_0x6d20('0x14')&&_0x33395d[_0x3f009d]==='-'){_0x2acb7b=this['edges'][_0x2a94d2][_0x29e381][_0x6d20('0x15')];logger[_0x6d20('0x10')](_0x6d20('0x16'),_0x33395d[_0x3f009d],this[_0x6d20('0x3')][_0x2a94d2][_0x29e381][_0x6d20('0x15')]);}else if(this[_0x6d20('0xa')][_0x2a94d2][_0x6d20('0x17')]==='menu'&&_0x33395d[_0x3f009d]==='i'){_0x2acb7b=this['edges'][_0x2a94d2][_0x29e381][_0x6d20('0x15')];logger[_0x6d20('0x10')](_0x6d20('0x18'),_0x33395d[_0x3f009d],this[_0x6d20('0x3')][_0x2a94d2][_0x29e381]['target']);}if(_0x33395d[_0x3f009d]===_0x204bff){return this[_0x6d20('0xc')](this[_0x6d20('0x3')][_0x2a94d2][_0x29e381][_0x6d20('0x15')],_0xba5c2e);}}}else{return this[_0x6d20('0xc')](this[_0x6d20('0x3')][_0x2a94d2][_0x29e381][_0x6d20('0x15')],_0xba5c2e);}}if(_0x33395d['length']){if(this[_0x6d20('0xa')][_0x2a94d2][_0x6d20('0x17')]===_0x6d20('0x14')){if(_0x2acb7b){return this[_0x6d20('0xc')](_0x2acb7b,_0xba5c2e);}return logger[_0x6d20('0x10')]('default\x20on\x20switch\x20not\x20found');}else if(_[_0x6d20('0x19')](verticesWithRetry,this[_0x6d20('0xa')][_0x2a94d2][_0x6d20('0x17')])){if(_0x204bff==='-'){return logger[_0x6d20('0x10')](_0x6d20('0x1a'));}if(_0x2acb7b&&_0x204bff!=='t'){return this['traverseBFS'](_0x2acb7b,_0xba5c2e);}return this['traverseBFS'](_0x2a94d2,_0xba5c2e);}return logger[_0x6d20('0x10')](_0x6d20('0x1b'));}};module['exports']=Graph;
\ No newline at end of file
+var _0x5c0f=['info','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','invalid','includes','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','agi','menu','getdigits','getsecretdigits','vertices','numberOfEdges','addVertex','edges','prototype','addEdge','size','getVertex','traverseBFS','stop\x20traverse','length'];(function(_0x46cbed,_0x27428c){var _0x54aba8=function(_0x3ee20f){while(--_0x3ee20f){_0x46cbed['push'](_0x46cbed['shift']());}};_0x54aba8(++_0x27428c);}(_0x5c0f,0xb4));var _0xf5c0=function(_0x229cbb,_0x4ca837){_0x229cbb=_0x229cbb-0x0;var _0x14432a=_0x5c0f[_0x229cbb];return _0x14432a;};'use strict';var _=require(_0xf5c0('0x0'));var logger=require('../../../config/logger')(_0xf5c0('0x1'));var verticesWithRetry=[_0xf5c0('0x2'),_0xf5c0('0x3'),_0xf5c0('0x4')];var Graph=function(){this[_0xf5c0('0x5')]={};this['edges']={};this[_0xf5c0('0x6')]=0x0;};Graph['prototype'][_0xf5c0('0x7')]=function(_0xa74eb1){this[_0xf5c0('0x5')][_0xa74eb1['id']]=_0xa74eb1;this[_0xf5c0('0x8')][_0xa74eb1['id']]=[];};Graph[_0xf5c0('0x9')][_0xf5c0('0xa')]=function(_0x1c761a,_0x51b74f,_0x25ce50){this[_0xf5c0('0x8')][_0x1c761a]['push']({'target':_0x51b74f,'condition':_0x25ce50});this[_0xf5c0('0x6')]+=0x1;};Graph['prototype'][_0xf5c0('0xb')]=function(){return _[_0xf5c0('0xb')](this['vertices']);};Graph['prototype']['relations']=function(){return this['numberOfEdges'];};Graph['prototype'][_0xf5c0('0xc')]=function(_0x42fe6a){return this['vertices'][_0x42fe6a];};Graph[_0xf5c0('0x9')][_0xf5c0('0xd')]=function(_0x3c8f48,_0x16b8c0){if(!this[_0xf5c0('0x5')][_0x3c8f48]){return logger['info']('no\x20vertex\x20found');}var _0x40bf4d=_0x16b8c0(this['vertices'][_0x3c8f48]);if(!_0x40bf4d){return logger['info'](_0xf5c0('0xe'));}if(this[_0xf5c0('0x8')][_0x3c8f48][_0xf5c0('0xf')]===0x0){return logger[_0xf5c0('0x10')](_0xf5c0('0x11'));}for(var _0x5f418d=0x0,_0x2e30aa=[],_0x1a1919=![];_0x5f418d<this[_0xf5c0('0x8')][_0x3c8f48][_0xf5c0('0xf')];_0x5f418d+=0x1){if(this[_0xf5c0('0x8')][_0x3c8f48][_0x5f418d][_0xf5c0('0x12')]){_0x2e30aa=this[_0xf5c0('0x8')][_0x3c8f48][_0x5f418d][_0xf5c0('0x12')][_0xf5c0('0x13')](',');for(var _0x512893=0x0;_0x512893<_0x2e30aa['length'];_0x512893+=0x1){if(this[_0xf5c0('0x5')][_0x3c8f48][_0xf5c0('0x14')]===_0xf5c0('0x15')&&_0x2e30aa[_0x512893]==='-'){_0x1a1919=this['edges'][_0x3c8f48][_0x5f418d]['target'];logger['info']('default',_0x2e30aa[_0x512893],this[_0xf5c0('0x8')][_0x3c8f48][_0x5f418d][_0xf5c0('0x16')]);}else if(this[_0xf5c0('0x5')][_0x3c8f48]['agicommand']==='menu'&&_0x2e30aa[_0x512893]==='i'){_0x1a1919=this[_0xf5c0('0x8')][_0x3c8f48][_0x5f418d][_0xf5c0('0x16')];logger['info'](_0xf5c0('0x17'),_0x2e30aa[_0x512893],this[_0xf5c0('0x8')][_0x3c8f48][_0x5f418d]['target']);}if(_0x2e30aa[_0x512893]===_0x40bf4d){return this[_0xf5c0('0xd')](this[_0xf5c0('0x8')][_0x3c8f48][_0x5f418d][_0xf5c0('0x16')],_0x16b8c0);}}}else{return this['traverseBFS'](this[_0xf5c0('0x8')][_0x3c8f48][_0x5f418d]['target'],_0x16b8c0);}}if(_0x2e30aa[_0xf5c0('0xf')]){if(this[_0xf5c0('0x5')][_0x3c8f48][_0xf5c0('0x14')]==='vswitch'){if(_0x1a1919){return this[_0xf5c0('0xd')](_0x1a1919,_0x16b8c0);}return logger['info']('default\x20on\x20switch\x20not\x20found');}else if(_[_0xf5c0('0x18')](verticesWithRetry,this[_0xf5c0('0x5')][_0x3c8f48][_0xf5c0('0x14')])){if(_0x40bf4d==='-'){return logger[_0xf5c0('0x10')](_0xf5c0('0x19'));}if(_0x1a1919&&_0x40bf4d!=='t'){return this[_0xf5c0('0xd')](_0x1a1919,_0x16b8c0);}return this['traverseBFS'](_0x3c8f48,_0x16b8c0);}return logger[_0xf5c0('0x10')](_0xf5c0('0x1a'));}};module[_0xf5c0('0x1b')]=Graph;
\ No newline at end of file
index 4d5ef47..639bb09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda7a=['source','value','getSquareProject','then','createSquareReport','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','timeout','hangup','production','start','joinAt','format','YYYY-MM-DD\x20HH:mm:ss','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc\x20block\x20stop\x20traverse\x20BFS','context','priority','response','result','isUndefined','toString','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','extension','Project\x20%s\x20not\x20published','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','xml2json','lodash','moment','../../config/environment','agi','../../config/license/util','./mailRpc','./graph','./vertices','defaults','nextTick','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','message','error','[%s]\x20%s','stack','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','root','agicommand','hasOwnProperty','retry','maxRetry','mxCell','isArray','length','target','addEdge'];(function(_0x4a8440,_0x3ab425){var _0xc11147=function(_0x210804){while(--_0x210804){_0x4a8440['push'](_0x4a8440['shift']());}};_0xc11147(++_0x3ab425);}(_0xda7a,0x8f));var _0xada7=function(_0x33e06c,_0x4f9475){_0x33e06c=_0x33e06c-0x0;var _0xc987e8=_0xda7a[_0x33e06c];return _0xc987e8;};'use strict';var parser=require(_0xada7('0x0'));var _=require(_0xada7('0x1'));var syncho=require('syncho');var util=require('util');var moment=require(_0xada7('0x2'));var config=require(_0xada7('0x3'));var logger=require('../../config/logger')(_0xada7('0x4'));var utilLicense=require(_0xada7('0x5'));var rpc=require('./rpc');var mailRpc=require(_0xada7('0x6'));var Graph=require(_0xada7('0x7'));var Vertices=require(_0xada7('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xada7('0x4')]=_[_0xada7('0x9')](config[_0xada7('0x4')],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x1f67e1){process[_0xada7('0xa')](function(){syncho(function(){try{setChannelVariables(_0x1f67e1);agiHandler(_0x1f67e1);}catch(_0x5e764e){logger['error'](_0x5e764e['stack']);}});});}function listeningHandler(){console[_0xada7('0xb')](_0xada7('0xc'),config[_0xada7('0x4')]['port']);logger[_0xada7('0xd')](util['format'](_0xada7('0xe'),config[_0xada7('0x4')]['ip'],config[_0xada7('0x4')][_0xada7('0xf')]));}function errorHandler(_0x2fef1f){if(_0x2fef1f&&_0x2fef1f[_0xada7('0x10')]&&_0x2fef1f[_0xada7('0x11')]){logger[_0xada7('0x12')](util['format'](_0xada7('0x13'),_0x2fef1f[_0xada7('0x10')],_0x2fef1f[_0xada7('0x11')]));}else{logger[_0xada7('0x12')](util['format']('[ERROR]\x20%s',_0x2fef1f[_0xada7('0x14')]));}}function closeHandler(){logger['info'](util['format'](_0xada7('0x15'),this[_0xada7('0x16')],this['calleridname'],this[_0xada7('0x17')],this[_0xada7('0x18')],this[_0xada7('0x19')]));try{createSquareReport(this);}catch(_0x2e0384){logger[_0xada7('0x12')](_0x2e0384['stack']);}}function timeoutHandler(){logger[_0xada7('0xd')](util['format'](_0xada7('0x1a'),this['arg_1'],this[_0xada7('0x1b')],this['callerid'],this[_0xada7('0x18')],this[_0xada7('0x19')]));}function hangupHandler(){logger[_0xada7('0xd')](util['format'](_0xada7('0x1c'),this[_0xada7('0x16')],this[_0xada7('0x1b')],this[_0xada7('0x17')],this[_0xada7('0x18')],this[_0xada7('0x19')]));this[_0xada7('0x1d')]=!![];}function getRoot(_0x2a3d79){return parser[_0xada7('0x1e')](_0x2a3d79,{'object':!![]})['mxGraphModel'][_0xada7('0x1f')];}function addVertex(_0x280d6c,_0xea634,_0x40a608){_0xea634[_0xada7('0x20')]=_0x40a608;if(_0xea634[_0xada7('0x21')](_0xada7('0x22'))){_0xea634[_0xada7('0x23')]=parseInt(_0xea634[_0xada7('0x22')],0xa);}_0x280d6c['addVertex'](_['omit'](_0xea634,_0xada7('0x24')));}function initGraph(_0x3ed3f3,_0x1a6058){var _0x1a8a7d=new Graph();for(var _0x399d0c in _0x3ed3f3){if(_0x3ed3f3[_0xada7('0x21')](_0x399d0c)){if(_[_0xada7('0x25')](_0x3ed3f3[_0x399d0c])){for(var _0x10d8c0=0x0;_0x10d8c0<_0x3ed3f3[_0x399d0c][_0xada7('0x26')];_0x10d8c0+=0x1){addVertex(_0x1a8a7d,_0x3ed3f3[_0x399d0c][_0x10d8c0],_0x399d0c);}}else{addVertex(_0x1a8a7d,_0x3ed3f3[_0x399d0c],_0x399d0c);}}}for(var _0x3d9d8b=0x0;_0x3d9d8b<_0x1a6058['length'];_0x3d9d8b+=0x1){if(_0x1a6058[_0x3d9d8b]['source']&&_0x1a6058[_0x3d9d8b][_0xada7('0x27')]){_0x1a8a7d[_0xada7('0x28')](_0x1a6058[_0x3d9d8b][_0xada7('0x29')],_0x1a6058[_0x3d9d8b][_0xada7('0x27')],_0x1a6058[_0x3d9d8b][_0xada7('0x2a')]);}}return _0x1a8a7d;}function getSquareProject(_0x4cf0d4,_0x3a33ce){rpc[_0xada7('0x2b')](_0x4cf0d4)[_0xada7('0x2c')](function(_0x2191dd){_0x3a33ce(null,_0x2191dd);})['catch'](function(_0x24fb31){_0x3a33ce(null,_0x24fb31);});}function createSquareReport(_0x1f9c6c,_0x512fee){rpc[_0xada7('0x2d')](_0x1f9c6c)[_0xada7('0x2c')](function(_0x4828be){if(_0x512fee){_0x512fee(null,_0x4828be);}})[_0xada7('0x2e')](function(_0x1b02a7){if(_0x512fee){_0x512fee(null,_0x1b02a7);}});}function setChannelVariables(_0xb361b2){for(var _0x455c12 in _0xb361b2){if(_0xb361b2['hasOwnProperty'](_0x455c12)){if(_0x455c12[_0xada7('0x2f')](_0xada7('0x30'))===0x0){_0xb361b2[_0x455c12[_0xada7('0x31')](0x4)]=_0xb361b2[_0x455c12];delete _0xb361b2[_0x455c12];}}}}function getLogFromObject(_0x5ee0f0){return util[_0xada7('0x32')](_0x5ee0f0,{'showHidden':![],'depth':null});}function agiHandler(_0xa80cc){var _0x11483d,_0x2ce9d9,_0x2b0e84,_0x5561b6,_0x5b8b38;logger[_0xada7('0x33')](_0xada7('0x34'),JSON[_0xada7('0x35')](_0xa80cc,null,0x2));logger['info'](util['format'](_0xada7('0x36'),_0xa80cc[_0xada7('0x16')],_0xa80cc[_0xada7('0x1b')],_0xa80cc[_0xada7('0x17')],_0xa80cc['dnid'],_0xa80cc[_0xada7('0x19')]));_0xa80cc['on'](_0xada7('0x12'),errorHandler);_0xa80cc['on'](_0xada7('0x37'),closeHandler);_0xa80cc['on'](_0xada7('0x38'),timeoutHandler);_0xa80cc[_0xada7('0x1d')]=![];_0xa80cc['on'](_0xada7('0x39'),hangupHandler);var _0x1a044e=getSquareProject['sync'](null,_0xa80cc['arg_1']);if(_0x1a044e){if(_0x1a044e[_0xada7('0x3a')]){_0x11483d=getRoot(_0x1a044e[_0xada7('0x3a')]);if(_0x11483d&&_0x11483d[_0xada7('0x3b')]){logger[_0xada7('0x33')](_0xada7('0x1f'),JSON[_0xada7('0x35')](_0x11483d,null,0x2));_0xa80cc[_0xada7('0x3c')]=moment()[_0xada7('0x3d')](_0xada7('0x3e'));_0x2ce9d9=initGraph(_[_0xada7('0x3f')](_0x11483d,'mxCell'),_0x11483d[_0xada7('0x24')]);_0x2b0e84=new Vertices(_0xa80cc,rpc,mailRpc);logger[_0xada7('0xd')](util[_0xada7('0x3d')](_0xada7('0x40'),_0xa80cc['arg_1'],_0xa80cc[_0xada7('0x1b')],_0xa80cc[_0xada7('0x17')],_0xa80cc[_0xada7('0x18')],_0xa80cc[_0xada7('0x19')]));_0x2ce9d9[_0xada7('0x41')](_0x11483d[_0xada7('0x3b')]['id'],function(_0x109097){try{_0x109097=_0x2b0e84[_0xada7('0x42')](_0x109097);logger[_0xada7('0x33')](_0xada7('0x43'),JSON['stringify'](_0x109097,null,0x2));if(_0x109097['agicommand']==='gotoc'){logger[_0xada7('0xd')](_0xada7('0x44'));_0xa80cc['context']=_0x109097[_0xada7('0x45')]||_0xa80cc[_0xada7('0x45')];_0xa80cc['extension']=_0x109097['extension'];_0xa80cc[_0xada7('0x46')]=_0x109097['priority']?_0x109097[_0xada7('0x46')]-0x1:0x1;return null;}else if(_0x109097&&_0x2b0e84[_0x109097['agicommand']]){_0x5b8b38=_0x2b0e84[_0x109097[_0xada7('0x20')]](_0x109097);logger[_0xada7('0xd')](_0xada7('0x47'),JSON['stringify'](_0x5b8b38,null,0x2));if(_0x5b8b38&&_0x5b8b38['code']===AGI_CODE_SUCCESS&&_0x5b8b38[_0xada7('0x48')]!==AGI_RESULT_ERROR&&!_0xa80cc[_0xada7('0x1d')]){logger[_0xada7('0x33')](_0xada7('0x47'),getLogFromObject(_0x5b8b38));return _[_0xada7('0x49')](_0x5b8b38[_0xada7('0x48')])?null:_0x5b8b38[_0xada7('0x48')][_0xada7('0x4a')]();}else{logger[_0xada7('0x12')](_0xada7('0x47'),getLogFromObject(_0x5b8b38));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x187ccd){logger[_0xada7('0x12')](_0x187ccd['stack']);return null;}});if(_0x11483d[_0xada7('0x4b')]){logger[_0xada7('0xd')](util[_0xada7('0x3d')](_0xada7('0x4c'),_0xa80cc[_0xada7('0x16')],_0xa80cc[_0xada7('0x1b')],_0xa80cc['callerid'],_0xa80cc['dnid'],_0xa80cc[_0xada7('0x19')]));_0x2ce9d9[_0xada7('0x41')](_0x11483d['finally']['id'],function(_0x1b72cf){try{_0x1b72cf=_0x2b0e84['clear'](_0x1b72cf);logger[_0xada7('0x33')](_0xada7('0x43'),JSON['stringify'](_0x1b72cf,null,0x2));if(_0x1b72cf&&_0x2b0e84[_0x1b72cf['agicommand']]){_0x5b8b38=_0x2b0e84[_0x1b72cf[_0xada7('0x20')]](_0x1b72cf);if(_0x5b8b38){logger[_0xada7('0x33')](_0xada7('0x47'),getLogFromObject(_0x5b8b38));return _[_0xada7('0x49')](_0x5b8b38[_0xada7('0x48')])?null:_0x5b8b38[_0xada7('0x48')][_0xada7('0x4a')]();}else{logger['error'](_0xada7('0x47'),getLogFromObject(_0x5b8b38));return null;}}else{logger[_0xada7('0x12')](_0xada7('0x4d'));return null;}}catch(_0x3db81f){logger[_0xada7('0x12')](_0x3db81f[_0xada7('0x14')]);return null;}});}logger['info'](util[_0xada7('0x3d')](_0xada7('0x4e'),_0xa80cc[_0xada7('0x16')],_0xa80cc[_0xada7('0x1b')],_0xa80cc[_0xada7('0x17')],_0xa80cc[_0xada7('0x18')],_0xa80cc[_0xada7('0x19')]));logger['info'](util[_0xada7('0x3d')](_0xada7('0x4f'),_0xa80cc['context'],_0xa80cc['extension'],parseInt(_0xa80cc[_0xada7('0x46')],0xa)+0x1));_0xa80cc[_0xada7('0x50')](_0xa80cc['context'],_0xa80cc[_0xada7('0x51')],parseInt(_0xa80cc[_0xada7('0x46')],0xa)+0x1);_0xa80cc['close']();}}else{logger[_0xada7('0x12')](util[_0xada7('0x3d')](_0xada7('0x52'),_0xa80cc[_0xada7('0x16')]));_0xa80cc[_0xada7('0x50')](_0xa80cc[_0xada7('0x45')],_0xa80cc['extension'],parseInt(_0xa80cc[_0xada7('0x46')],0xa)+0x1);_0xa80cc[_0xada7('0x37')]();}}else{logger[_0xada7('0x12')](util[_0xada7('0x3d')]('Project\x20%s\x20not\x20found',_0xa80cc['arg_1']));_0xa80cc[_0xada7('0x50')](_0xa80cc['context'],_0xa80cc[_0xada7('0x51')],parseInt(_0xa80cc[_0xada7('0x46')],0xa)+0x1);_0xa80cc[_0xada7('0x37')]();}}function main(){var _0x171326;return utilLicense[_0xada7('0x53')]()[_0xada7('0x2c')](function(_0x9f6194){if(_0x9f6194){if(_0x9f6194[_0xada7('0x54')]){if(_0x9f6194['callysquare']&&_0x9f6194[_0xada7('0x55')]>0x0){logger['info'](util[_0xada7('0x3d')](_0xada7('0x56'),_0x9f6194[_0xada7('0x55')]));_0x171326=_0x9f6194[_0xada7('0x55')];}else{logger[_0xada7('0xd')](_0xada7('0x57'));}}else{logger[_0xada7('0xd')](_0xada7('0x58'));_0x171326=-0x1;}}})[_0xada7('0x2e')](function(_0x1aa548){logger[_0xada7('0x12')](_0xada7('0x59'),_0x1aa548[_0xada7('0x14')]);})[_0xada7('0x4b')](function(){var _0x891b16=require(_0xada7('0x5a'))(config[_0xada7('0x4')][_0xada7('0xf')],config[_0xada7('0x4')]['ip'],_0x171326);_0x891b16['on']('error',errorHandler);_0x891b16['on'](_0xada7('0x5b'),listeningHandler);_0x891b16['on']('connection',connectionHandler);_0x891b16['on'](_0xada7('0x37'),closeHandler);});}main();
\ No newline at end of file
+var _0xa349=['calleridname','callerid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[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','mxCell','isArray','length','source','target','value','getSquareProject','then','catch','createSquareReport','agi_','substring','inspect','debug','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','listening','connection','xml2json','lodash','syncho','util','moment','../../config/environment','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','agi','defaults','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','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'];(function(_0x21001b,_0x3ff1a8){var _0x665a00=function(_0x98d912){while(--_0x98d912){_0x21001b['push'](_0x21001b['shift']());}};_0x665a00(++_0x3ff1a8);}(_0xa349,0x161));var _0x9a34=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa349[_0x3dd15e];return _0x231fd0;};'use strict';var parser=require(_0x9a34('0x0'));var _=require(_0x9a34('0x1'));var syncho=require(_0x9a34('0x2'));var util=require(_0x9a34('0x3'));var moment=require(_0x9a34('0x4'));var config=require(_0x9a34('0x5'));var logger=require('../../config/logger')('agi');var utilLicense=require(_0x9a34('0x6'));var rpc=require(_0x9a34('0x7'));var mailRpc=require(_0x9a34('0x8'));var Graph=require(_0x9a34('0x9'));var Vertices=require(_0x9a34('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x9a34('0xb')]=_[_0x9a34('0xc')](config['agi'],{'ip':_0x9a34('0xd'),'port':0x11dd});function connectionHandler(_0x357801){process[_0x9a34('0xe')](function(){syncho(function(){try{setChannelVariables(_0x357801);agiHandler(_0x357801);}catch(_0x115270){logger[_0x9a34('0xf')](_0x115270[_0x9a34('0x10')]);}});});}function listeningHandler(){console[_0x9a34('0x11')](_0x9a34('0x12'),config[_0x9a34('0xb')][_0x9a34('0x13')]);logger[_0x9a34('0x14')](util[_0x9a34('0x15')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x9a34('0xb')]['ip'],config[_0x9a34('0xb')][_0x9a34('0x13')]));}function errorHandler(_0x18d932){if(_0x18d932&&_0x18d932[_0x9a34('0x16')]&&_0x18d932[_0x9a34('0x17')]){logger[_0x9a34('0xf')](util[_0x9a34('0x15')](_0x9a34('0x18'),_0x18d932['name'],_0x18d932[_0x9a34('0x17')]));}else{logger[_0x9a34('0xf')](util[_0x9a34('0x15')]('[ERROR]\x20%s',_0x18d932[_0x9a34('0x10')]));}}function closeHandler(){logger[_0x9a34('0x14')](util['format'](_0x9a34('0x19'),this[_0x9a34('0x1a')],this[_0x9a34('0x1b')],this[_0x9a34('0x1c')],this['dnid'],this[_0x9a34('0x1d')]));try{createSquareReport(this);}catch(_0x441ce9){logger[_0x9a34('0xf')](_0x441ce9[_0x9a34('0x10')]);}}function timeoutHandler(){logger['info'](util['format'](_0x9a34('0x1e'),this[_0x9a34('0x1a')],this[_0x9a34('0x1b')],this[_0x9a34('0x1c')],this[_0x9a34('0x1f')],this['uniqueid']));}function hangupHandler(){logger[_0x9a34('0x14')](util[_0x9a34('0x15')](_0x9a34('0x20'),this[_0x9a34('0x1a')],this[_0x9a34('0x1b')],this['callerid'],this[_0x9a34('0x1f')],this[_0x9a34('0x1d')]));this[_0x9a34('0x21')]=!![];}function getRoot(_0x11cd2d){return parser[_0x9a34('0x22')](_0x11cd2d,{'object':!![]})[_0x9a34('0x23')][_0x9a34('0x24')];}function addVertex(_0x29d356,_0xcd7a2c,_0x1e1fd4){_0xcd7a2c[_0x9a34('0x25')]=_0x1e1fd4;if(_0xcd7a2c[_0x9a34('0x26')](_0x9a34('0x27'))){_0xcd7a2c[_0x9a34('0x28')]=parseInt(_0xcd7a2c[_0x9a34('0x27')],0xa);}_0x29d356[_0x9a34('0x29')](_['omit'](_0xcd7a2c,_0x9a34('0x2a')));}function initGraph(_0x1b6c73,_0x531339){var _0x5a1bde=new Graph();for(var _0x48951f in _0x1b6c73){if(_0x1b6c73[_0x9a34('0x26')](_0x48951f)){if(_[_0x9a34('0x2b')](_0x1b6c73[_0x48951f])){for(var _0x1172aa=0x0;_0x1172aa<_0x1b6c73[_0x48951f][_0x9a34('0x2c')];_0x1172aa+=0x1){addVertex(_0x5a1bde,_0x1b6c73[_0x48951f][_0x1172aa],_0x48951f);}}else{addVertex(_0x5a1bde,_0x1b6c73[_0x48951f],_0x48951f);}}}for(var _0x21adb1=0x0;_0x21adb1<_0x531339['length'];_0x21adb1+=0x1){if(_0x531339[_0x21adb1][_0x9a34('0x2d')]&&_0x531339[_0x21adb1][_0x9a34('0x2e')]){_0x5a1bde['addEdge'](_0x531339[_0x21adb1][_0x9a34('0x2d')],_0x531339[_0x21adb1][_0x9a34('0x2e')],_0x531339[_0x21adb1][_0x9a34('0x2f')]);}}return _0x5a1bde;}function getSquareProject(_0x41c6d3,_0x2a634e){rpc[_0x9a34('0x30')](_0x41c6d3)[_0x9a34('0x31')](function(_0x262249){_0x2a634e(null,_0x262249);})[_0x9a34('0x32')](function(_0x1ee34f){_0x2a634e(null,_0x1ee34f);});}function createSquareReport(_0x2d196f,_0x37ecf3){rpc[_0x9a34('0x33')](_0x2d196f)[_0x9a34('0x31')](function(_0x1a25b9){if(_0x37ecf3){_0x37ecf3(null,_0x1a25b9);}})[_0x9a34('0x32')](function(_0x346e48){if(_0x37ecf3){_0x37ecf3(null,_0x346e48);}});}function setChannelVariables(_0x9bc8d5){for(var _0x12e08b in _0x9bc8d5){if(_0x9bc8d5['hasOwnProperty'](_0x12e08b)){if(_0x12e08b['indexOf'](_0x9a34('0x34'))===0x0){_0x9bc8d5[_0x12e08b[_0x9a34('0x35')](0x4)]=_0x9bc8d5[_0x12e08b];delete _0x9bc8d5[_0x12e08b];}}}}function getLogFromObject(_0x1b463c){return util[_0x9a34('0x36')](_0x1b463c,{'showHidden':![],'depth':null});}function agiHandler(_0x19b171){var _0x158ac2,_0x31049c,_0x3ec7ce,_0x569ae6,_0xa4dda8;logger[_0x9a34('0x37')]('variables',JSON[_0x9a34('0x38')](_0x19b171,null,0x2));logger[_0x9a34('0x14')](util[_0x9a34('0x15')](_0x9a34('0x39'),_0x19b171[_0x9a34('0x1a')],_0x19b171[_0x9a34('0x1b')],_0x19b171[_0x9a34('0x1c')],_0x19b171[_0x9a34('0x1f')],_0x19b171[_0x9a34('0x1d')]));_0x19b171['on']('error',errorHandler);_0x19b171['on'](_0x9a34('0x3a'),closeHandler);_0x19b171['on'](_0x9a34('0x3b'),timeoutHandler);_0x19b171[_0x9a34('0x21')]=![];_0x19b171['on'](_0x9a34('0x3c'),hangupHandler);var _0x496941=getSquareProject[_0x9a34('0x3d')](null,_0x19b171[_0x9a34('0x1a')]);if(_0x496941){if(_0x496941[_0x9a34('0x3e')]){_0x158ac2=getRoot(_0x496941[_0x9a34('0x3e')]);if(_0x158ac2&&_0x158ac2[_0x9a34('0x3f')]){logger[_0x9a34('0x37')](_0x9a34('0x24'),JSON[_0x9a34('0x38')](_0x158ac2,null,0x2));_0x19b171[_0x9a34('0x40')]=moment()[_0x9a34('0x15')](_0x9a34('0x41'));_0x31049c=initGraph(_[_0x9a34('0x42')](_0x158ac2,_0x9a34('0x2a')),_0x158ac2[_0x9a34('0x2a')]);_0x3ec7ce=new Vertices(_0x19b171,rpc,mailRpc);logger[_0x9a34('0x14')](util[_0x9a34('0x15')](_0x9a34('0x43'),_0x19b171[_0x9a34('0x1a')],_0x19b171[_0x9a34('0x1b')],_0x19b171[_0x9a34('0x1c')],_0x19b171['dnid'],_0x19b171[_0x9a34('0x1d')]));_0x31049c[_0x9a34('0x44')](_0x158ac2[_0x9a34('0x3f')]['id'],function(_0x2ce044){try{_0x2ce044=_0x3ec7ce['clear'](_0x2ce044);logger[_0x9a34('0x37')](_0x9a34('0x45'),JSON['stringify'](_0x2ce044,null,0x2));if(_0x2ce044[_0x9a34('0x25')]==='gotoc'){logger[_0x9a34('0x14')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x19b171['context']=_0x2ce044[_0x9a34('0x46')]||_0x19b171['context'];_0x19b171[_0x9a34('0x47')]=_0x2ce044[_0x9a34('0x47')];_0x19b171[_0x9a34('0x48')]=_0x2ce044[_0x9a34('0x48')]?_0x2ce044[_0x9a34('0x48')]-0x1:0x1;return null;}else if(_0x2ce044&&_0x3ec7ce[_0x2ce044[_0x9a34('0x25')]]){_0xa4dda8=_0x3ec7ce[_0x2ce044[_0x9a34('0x25')]](_0x2ce044);logger['info'](_0x9a34('0x49'),JSON[_0x9a34('0x38')](_0xa4dda8,null,0x2));if(_0xa4dda8&&_0xa4dda8[_0x9a34('0x4a')]===AGI_CODE_SUCCESS&&_0xa4dda8[_0x9a34('0x4b')]!==AGI_RESULT_ERROR&&!_0x19b171[_0x9a34('0x21')]){logger[_0x9a34('0x37')]('response',getLogFromObject(_0xa4dda8));return _[_0x9a34('0x4c')](_0xa4dda8[_0x9a34('0x4b')])?null:_0xa4dda8['result'][_0x9a34('0x4d')]();}else{logger[_0x9a34('0xf')]('response',getLogFromObject(_0xa4dda8));return null;}}else{logger[_0x9a34('0xf')](_0x9a34('0x4e'));return null;}}catch(_0x2c3ab2){logger[_0x9a34('0xf')](_0x2c3ab2['stack']);return null;}});if(_0x158ac2[_0x9a34('0x4f')]){logger[_0x9a34('0x14')](util['format'](_0x9a34('0x50'),_0x19b171['arg_1'],_0x19b171[_0x9a34('0x1b')],_0x19b171[_0x9a34('0x1c')],_0x19b171[_0x9a34('0x1f')],_0x19b171[_0x9a34('0x1d')]));_0x31049c[_0x9a34('0x44')](_0x158ac2[_0x9a34('0x4f')]['id'],function(_0x1e54e3){try{_0x1e54e3=_0x3ec7ce['clear'](_0x1e54e3);logger[_0x9a34('0x37')](_0x9a34('0x45'),JSON[_0x9a34('0x38')](_0x1e54e3,null,0x2));if(_0x1e54e3&&_0x3ec7ce[_0x1e54e3[_0x9a34('0x25')]]){_0xa4dda8=_0x3ec7ce[_0x1e54e3[_0x9a34('0x25')]](_0x1e54e3);if(_0xa4dda8){logger['debug'](_0x9a34('0x49'),getLogFromObject(_0xa4dda8));return _[_0x9a34('0x4c')](_0xa4dda8[_0x9a34('0x4b')])?null:_0xa4dda8[_0x9a34('0x4b')][_0x9a34('0x4d')]();}else{logger['error'](_0x9a34('0x49'),getLogFromObject(_0xa4dda8));return null;}}else{logger[_0x9a34('0xf')]('agicommand\x20not\x20found');return null;}}catch(_0x508c17){logger[_0x9a34('0xf')](_0x508c17['stack']);return null;}});}logger[_0x9a34('0x14')](util[_0x9a34('0x15')](_0x9a34('0x51'),_0x19b171[_0x9a34('0x1a')],_0x19b171[_0x9a34('0x1b')],_0x19b171[_0x9a34('0x1c')],_0x19b171[_0x9a34('0x1f')],_0x19b171['uniqueid']));logger['info'](util[_0x9a34('0x15')](_0x9a34('0x52'),_0x19b171['context'],_0x19b171['extension'],parseInt(_0x19b171[_0x9a34('0x48')],0xa)+0x1));_0x19b171[_0x9a34('0x53')](_0x19b171[_0x9a34('0x46')],_0x19b171[_0x9a34('0x47')],parseInt(_0x19b171['priority'],0xa)+0x1);_0x19b171[_0x9a34('0x3a')]();}}else{logger[_0x9a34('0xf')](util[_0x9a34('0x15')](_0x9a34('0x54'),_0x19b171[_0x9a34('0x1a')]));_0x19b171['continueAt'](_0x19b171[_0x9a34('0x46')],_0x19b171['extension'],parseInt(_0x19b171[_0x9a34('0x48')],0xa)+0x1);_0x19b171[_0x9a34('0x3a')]();}}else{logger[_0x9a34('0xf')](util[_0x9a34('0x15')](_0x9a34('0x55'),_0x19b171['arg_1']));_0x19b171['continueAt'](_0x19b171['context'],_0x19b171[_0x9a34('0x47')],parseInt(_0x19b171[_0x9a34('0x48')],0xa)+0x1);_0x19b171[_0x9a34('0x3a')]();}}function main(){var _0x5dabf1;return utilLicense[_0x9a34('0x56')]()[_0x9a34('0x31')](function(_0x15b56f){if(_0x15b56f){if(_0x15b56f[_0x9a34('0x57')]){if(_0x15b56f[_0x9a34('0x58')]&&_0x15b56f['callysquare']>0x0){logger['info'](util[_0x9a34('0x15')](_0x9a34('0x59'),_0x15b56f[_0x9a34('0x58')]));_0x5dabf1=_0x15b56f[_0x9a34('0x58')];}else{logger[_0x9a34('0x14')](_0x9a34('0x5a'));}}else{logger[_0x9a34('0x14')](_0x9a34('0x5b'));_0x5dabf1=-0x1;}}})[_0x9a34('0x32')](function(_0x3d4738){logger['error'](_0x9a34('0x5c'),_0x3d4738[_0x9a34('0x10')]);})[_0x9a34('0x4f')](function(){var _0x415020=require('./server')(config[_0x9a34('0xb')][_0x9a34('0x13')],config['agi']['ip'],_0x5dabf1);_0x415020['on'](_0x9a34('0xf'),errorHandler);_0x415020['on'](_0x9a34('0x5d'),listeningHandler);_0x415020['on'](_0x9a34('0x5e'),connectionHandler);_0x415020['on']('close',closeHandler);});}main();
\ No newline at end of file
index 14cd2b5..693a084 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4083=['request','then','error','message','catch','sendMailMessage','SendMail','bluebird','jayson/promise','http'];(function(_0x1987f3,_0x39f746){var _0x272441=function(_0x485997){while(--_0x485997){_0x1987f3['push'](_0x1987f3['shift']());}};_0x272441(++_0x39f746);}(_0x4083,0x7f));var _0x3408=function(_0x556f76,_0x16b700){_0x556f76=_0x556f76-0x0;var _0x6cec33=_0x4083[_0x556f76];return _0x6cec33;};'use strict';var BPromise=require(_0x3408('0x0'));var jayson=require(_0x3408('0x1'));var client=jayson['client'][_0x3408('0x2')]({'port':0x232b});function request(_0x48791b,_0x4b6be5){return new BPromise(function(_0x2dc7a4,_0x1057a4){return client[_0x3408('0x3')](_0x48791b,_0x4b6be5)[_0x3408('0x4')](function(_0x173944){if(_0x173944['error']){return _0x1057a4(_0x173944[_0x3408('0x5')][_0x3408('0x6')]);}else{return _0x2dc7a4(_0x173944['result']);}})[_0x3408('0x7')](function(_0x4f7ca5){return _0x1057a4(_0x4f7ca5);});});}exports[_0x3408('0x8')]=function(_0x10b0c9,_0x5ed50b){return request(_0x3408('0x9'),{'account':_0x10b0c9,'message':_0x5ed50b});};
\ No newline at end of file
+var _0xddfb=['message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','request','then','error'];(function(_0x245e1c,_0x1213a8){var _0x4308ca=function(_0x4de3e7){while(--_0x4de3e7){_0x245e1c['push'](_0x245e1c['shift']());}};_0x4308ca(++_0x1213a8);}(_0xddfb,0x14f));var _0xbddf=function(_0x4020f3,_0x61e83c){_0x4020f3=_0x4020f3-0x0;var _0x2cc849=_0xddfb[_0x4020f3];return _0x2cc849;};'use strict';var BPromise=require(_0xbddf('0x0'));var jayson=require(_0xbddf('0x1'));var client=jayson[_0xbddf('0x2')]['http']({'port':0x232b});function request(_0x596f57,_0x43a4ea){return new BPromise(function(_0x47807e,_0x2e7664){return client[_0xbddf('0x3')](_0x596f57,_0x43a4ea)[_0xbddf('0x4')](function(_0x5a99d9){if(_0x5a99d9[_0xbddf('0x5')]){return _0x2e7664(_0x5a99d9['error'][_0xbddf('0x6')]);}else{return _0x47807e(_0x5a99d9[_0xbddf('0x7')]);}})[_0xbddf('0x8')](function(_0x143c73){return _0x2e7664(_0x143c73);});});}exports[_0xbddf('0x9')]=function(_0x2b3495,_0x4cfd11){return request(_0xbddf('0xa'),{'account':_0x2b3495,'message':_0x4cfd11});};
\ No newline at end of file
index 7a15a20..5ef5d8a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9acc=['\x0d\x0a\x0d\x0a','toString','_inBody','indexOf','substring','length','split','trim','slice','emit','line','exports','util','stream','Transform','call','_localBuffer','inherits','_transform'];(function(_0x29a3df,_0x442bf5){var _0x5793f7=function(_0x133c8d){while(--_0x133c8d){_0x29a3df['push'](_0x29a3df['shift']());}};_0x5793f7(++_0x442bf5);}(_0x9acc,0x175));var _0xc9ac=function(_0x2a9235,_0x20010d){_0x2a9235=_0x2a9235-0x0;var _0x2c6fa2=_0x9acc[_0x2a9235];return _0x2c6fa2;};'use strict';var util=require(_0xc9ac('0x0'));var Transform=require(_0xc9ac('0x1'))[_0xc9ac('0x2')];function AGIReply(_0xfc9284){Transform[_0xc9ac('0x3')](this,_0xfc9284);this[_0xc9ac('0x4')]='';this['_inBody']=![];}util[_0xc9ac('0x5')](AGIReply,Transform);AGIReply['prototype'][_0xc9ac('0x6')]=function(_0x59cd56,_0x1f2766,_0x113ac3){var _0x3caf33='\x0a',_0x1c8307=['\x0a\x0a',_0xc9ac('0x7')],_0x212dcc=-0x1,_0x391c03=-0x1,_0x387423='',_0x1d552a=0x0,_0x1b56b8='',_0x19ecd9='';this[_0xc9ac('0x4')]+=_0x59cd56[_0xc9ac('0x8')]();_0x1b56b8=this[_0xc9ac('0x4')];if(!this[_0xc9ac('0x9')]){_0x1d552a=0x0;while(_0x1c8307[_0x1d552a]){while((_0x391c03=_0x1b56b8[_0xc9ac('0xa')](_0x1c8307[_0x1d552a]))!=-0x1){_0x387423=_0x1c8307[_0x1d552a];_0x19ecd9=_0x1b56b8[_0xc9ac('0xb')](0x0,_0x391c03);_0x1b56b8=_0x1b56b8[_0xc9ac('0xb')](_0x391c03+_0x387423[_0xc9ac('0xc')]);var _0x7c4771=_0x19ecd9[_0xc9ac('0xd')](_0x3caf33),_0x559552=0x0,_0x41a719={},_0x108d80='',_0x5b1334='',_0x113881=-0x1;while(_0x7c4771[_0x559552]){_0x113881=_0x7c4771[_0x559552][_0xc9ac('0xa')](':');if(_0x113881!=-0x1){_0x108d80=_0x7c4771[_0x559552]['slice'](0x0,_0x113881)[_0xc9ac('0xe')]();_0x5b1334=_0x7c4771[_0x559552][_0xc9ac('0xf')](_0x113881+0x1)['trim']();if(_0x108d80[_0xc9ac('0xc')]>0x0){_0x41a719[_0x108d80]=_0x5b1334;}}else{}_0x559552++;}this[_0xc9ac('0x10')]('headers',_0x41a719);this[_0xc9ac('0x9')]=!![];}_0x1d552a++;}this[_0xc9ac('0x4')]=_0x1b56b8;}else{while((_0x212dcc=_0x1b56b8[_0xc9ac('0xa')](_0x3caf33))!=-0x1){_0x19ecd9=_0x1b56b8[_0xc9ac('0xb')](0x0,_0x212dcc);this[_0xc9ac('0x10')](_0xc9ac('0x11'),_0x19ecd9);_0x1b56b8=_0x1b56b8[_0xc9ac('0xb')](_0x212dcc+_0x3caf33[_0xc9ac('0xc')]);}this['_localBuffer']=_0x1b56b8;}_0x113ac3();};module[_0xc9ac('0x12')]=AGIReply;
\ No newline at end of file
+var _0x8441=['length','split','indexOf','slice','trim','headers','emit','line','exports','util','stream','Transform','_localBuffer','_inBody','prototype','\x0d\x0a\x0d\x0a','toString','substring'];(function(_0x5a4d0d,_0x40a833){var _0x4e5562=function(_0x66b580){while(--_0x66b580){_0x5a4d0d['push'](_0x5a4d0d['shift']());}};_0x4e5562(++_0x40a833);}(_0x8441,0x1dd));var _0x1844=function(_0x3371a5,_0x24f8e2){_0x3371a5=_0x3371a5-0x0;var _0x47a8ea=_0x8441[_0x3371a5];return _0x47a8ea;};'use strict';var util=require(_0x1844('0x0'));var Transform=require(_0x1844('0x1'))[_0x1844('0x2')];function AGIReply(_0x1f0f2f){Transform['call'](this,_0x1f0f2f);this[_0x1844('0x3')]='';this[_0x1844('0x4')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x1844('0x5')]['_transform']=function(_0x1ecb90,_0x546d9b,_0x2cd366){var _0x28076b='\x0a',_0x44ab21=['\x0a\x0a',_0x1844('0x6')],_0x11eb95=-0x1,_0x335bba=-0x1,_0x21bc6a='',_0xcc16c0=0x0,_0x406e2d='',_0x37caaf='';this[_0x1844('0x3')]+=_0x1ecb90[_0x1844('0x7')]();_0x406e2d=this['_localBuffer'];if(!this[_0x1844('0x4')]){_0xcc16c0=0x0;while(_0x44ab21[_0xcc16c0]){while((_0x335bba=_0x406e2d['indexOf'](_0x44ab21[_0xcc16c0]))!=-0x1){_0x21bc6a=_0x44ab21[_0xcc16c0];_0x37caaf=_0x406e2d[_0x1844('0x8')](0x0,_0x335bba);_0x406e2d=_0x406e2d[_0x1844('0x8')](_0x335bba+_0x21bc6a[_0x1844('0x9')]);var _0x3b4b97=_0x37caaf[_0x1844('0xa')](_0x28076b),_0x3ece79=0x0,_0x28b4f1={},_0x4293c9='',_0x507794='',_0x229db9=-0x1;while(_0x3b4b97[_0x3ece79]){_0x229db9=_0x3b4b97[_0x3ece79][_0x1844('0xb')](':');if(_0x229db9!=-0x1){_0x4293c9=_0x3b4b97[_0x3ece79][_0x1844('0xc')](0x0,_0x229db9)[_0x1844('0xd')]();_0x507794=_0x3b4b97[_0x3ece79][_0x1844('0xc')](_0x229db9+0x1)[_0x1844('0xd')]();if(_0x4293c9[_0x1844('0x9')]>0x0){_0x28b4f1[_0x4293c9]=_0x507794;}}else{}_0x3ece79++;}this['emit'](_0x1844('0xe'),_0x28b4f1);this[_0x1844('0x4')]=!![];}_0xcc16c0++;}this[_0x1844('0x3')]=_0x406e2d;}else{while((_0x11eb95=_0x406e2d['indexOf'](_0x28076b))!=-0x1){_0x37caaf=_0x406e2d[_0x1844('0x8')](0x0,_0x11eb95);this[_0x1844('0xf')](_0x1844('0x10'),_0x37caaf);_0x406e2d=_0x406e2d[_0x1844('0x8')](_0x11eb95+_0x28076b[_0x1844('0x9')]);}this[_0x1844('0x3')]=_0x406e2d;}_0x2cd366();};module[_0x1844('0x11')]=AGIReply;
\ No newline at end of file
index ec57d94..195caab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4711=['arg_2','format','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','createCmContact','phone','then','CreateCmContact','getPauseById','ShowPause','LoginUser','agentPause','PauseUser','agentUnpause','agentLogout','LogoutUser','bluebird','moment','util','jayson/promise','client','http','request','message','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','dsn','getUserById','ShowUser','ShowTrunk','getSoundById','save_name','getIntervalById','Interval','Intervals','getSmsAccountById','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','merge'];(function(_0x41ea8e,_0x4e5aae){var _0x3f628a=function(_0xb687d0){while(--_0xb687d0){_0x41ea8e['push'](_0x41ea8e['shift']());}};_0x3f628a(++_0x4e5aae);}(_0x4711,0xe4));var _0x1471=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4711[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x1471('0x0'));var moment=require(_0x1471('0x1'));var _=require('lodash');var util=require(_0x1471('0x2'));var jayson=require(_0x1471('0x3'));var client=jayson[_0x1471('0x4')][_0x1471('0x5')]({'port':0x2329});function request(_0x550cf1,_0x595c50){return new BPromise(function(_0x45e027,_0x3c972b){return client[_0x1471('0x6')](_0x550cf1,_0x595c50)['then'](function(_0x174c8a){if(_0x174c8a['error']){return _0x3c972b(_0x174c8a['error'][_0x1471('0x7')]);}else{return _0x45e027(_0x174c8a[_0x1471('0x8')]);}})[_0x1471('0x9')](function(_0x3a91dd){return _0x3c972b(_0x3a91dd);});});}exports[_0x1471('0xa')]=function(_0x536b98){return request(_0x1471('0xb'),{'options':{'raw':![],'where':{'name':_0x536b98},'attributes':[_0x1471('0xc')]}});};exports[_0x1471('0xd')]=function(_0x444023){return request(_0x1471('0xe'),{'options':{'raw':![],'where':{'id':_0x444023},'include':[{'model':'MailServerOut','as':'Smtp'}],'attributes':['id',_0x1471('0xf'),_0x1471('0x10')]}});};exports[_0x1471('0x11')]=function(_0x2f2b14){return request(_0x1471('0xb'),{'options':{'where':{'id':_0x2f2b14},'attributes':[_0x1471('0xf')]}});};exports[_0x1471('0x12')]=function(_0x1b2081){return request(_0x1471('0x13'),{'options':{'where':{'id':_0x1b2081},'attributes':[_0x1471('0xf')]}});};exports[_0x1471('0x14')]=function(_0x19cb60){return request('ShowVariable',{'options':{'where':{'id':_0x19cb60},'attributes':[_0x1471('0xf')]}});};exports['getSquareOdbcById']=function(_0x2aeb6d){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x2aeb6d},'attributes':[_0x1471('0x15')]}});};exports[_0x1471('0x16')]=function(_0x166a41){return request(_0x1471('0x17'),{'options':{'where':{'id':_0x166a41},'attributes':['name']}});};exports['getTrunkById']=function(_0x3b0c44){return request(_0x1471('0x18'),{'options':{'where':{'id':_0x3b0c44},'attributes':['name']}});};exports[_0x1471('0x19')]=function(_0x314757){return request('ShowSound',{'options':{'where':{'id':_0x314757},'attributes':[_0x1471('0x1a')]}});};exports[_0x1471('0x1b')]=function(_0x51c8a1){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x51c8a1},'include':[{'model':_0x1471('0x1c'),'as':_0x1471('0x1d')}]}});};exports[_0x1471('0x1e')]=function(_0x5b4625){return request('ShowSmsAccount',{'options':{'where':{'id':_0x5b4625},'attributes':['id','name']}});};exports[_0x1471('0x1f')]=function(_0xa69dee){return request(_0x1471('0x20'),{'body':_0xa69dee});};exports[_0x1471('0x21')]=function(_0x174c11){return request(_0x1471('0x22'),{'body':_0x174c11});};exports[_0x1471('0x23')]=function(_0x420dac){return request('CreateSquareReport',{'body':_[_0x1471('0x24')](_0x420dac,{'project_name':_0x420dac['arg_1'],'prev_project_name':_0x420dac[_0x1471('0x25')]||'','is_subproject':_0x420dac[_0x1471('0x25')]?!![]:![],'leaveAt':moment()[_0x1471('0x26')](_0x1471('0x27'))})});};exports['createSquareRecording']=function(_0x2f89ba){return request(_0x1471('0x28'),{'body':_0x2f89ba});};exports['createSquareMessage']=function(_0x3d5f56){return request('CreateSquareMessage',{'body':_0x3d5f56});};exports[_0x1471('0x29')]=function(_0x332f07){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x332f07[_0x1471('0x2a')],'ListId':_0x332f07['ListId']}}})[_0x1471('0x2b')](function(_0x2bb1b4){if(_0x2bb1b4){return _0x2bb1b4;}return request(_0x1471('0x2c'),{'body':_0x332f07});});};exports[_0x1471('0x2d')]=function(_0x176891){return request(_0x1471('0x2e'),{'options':{'where':{'id':_0x176891},'attributes':[_0x1471('0xf')]}});};exports['agentLogin']=function(_0x32b3ec,_0x2a9cd6){return request(_0x1471('0x2f'),{'body':{'interface':_0x2a9cd6},'options':{'where':_0x32b3ec}});};exports[_0x1471('0x30')]=function(_0x3f3e84,_0x447f69,_0x4a2910){return request(_0x1471('0x31'),{'body':{'type':_0x447f69,'uniqueid':_0x4a2910},'options':{'where':_0x3f3e84}});};exports[_0x1471('0x32')]=function(_0x3398f0){return request('UnpauseUser',{'body':{},'options':{'where':_0x3398f0}});};exports[_0x1471('0x33')]=function(_0x4063e1){return request(_0x1471('0x34'),{'body':{},'options':{'where':_0x4063e1}});};
\ No newline at end of file
+var _0x811e=['save_name','getIntervalById','ShowInterval','Interval','createSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','then','CreateCmContact','getPauseById','agentLogin','LoginUser','agentPause','agentUnpause','UnpauseUser','agentLogout','LogoutUser','moment','util','jayson/promise','client','http','request','error','message','result','catch','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','ShowTrunk','getSoundById'];(function(_0x57110a,_0x3f7b1c){var _0x40be25=function(_0x4c74d4){while(--_0x4c74d4){_0x57110a['push'](_0x57110a['shift']());}};_0x40be25(++_0x3f7b1c);}(_0x811e,0x173));var _0xe811=function(_0xbbfbe5,_0xea27e5){_0xbbfbe5=_0xbbfbe5-0x0;var _0x1bd762=_0x811e[_0xbbfbe5];return _0x1bd762;};'use strict';var BPromise=require('bluebird');var moment=require(_0xe811('0x0'));var _=require('lodash');var util=require(_0xe811('0x1'));var jayson=require(_0xe811('0x2'));var client=jayson[_0xe811('0x3')][_0xe811('0x4')]({'port':0x2329});function request(_0x41c6a0,_0x3b37d3){return new BPromise(function(_0x3bc235,_0x5b0ecf){return client[_0xe811('0x5')](_0x41c6a0,_0x3b37d3)['then'](function(_0x5d99ca){if(_0x5d99ca[_0xe811('0x6')]){return _0x5b0ecf(_0x5d99ca['error'][_0xe811('0x7')]);}else{return _0x3bc235(_0x5d99ca[_0xe811('0x8')]);}})[_0xe811('0x9')](function(_0x383cdf){return _0x5b0ecf(_0x383cdf);});});}exports['getSquareProject']=function(_0x4fe722){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x4fe722},'attributes':[_0xe811('0xa')]}});};exports[_0xe811('0xb')]=function(_0x2f60c3){return request(_0xe811('0xc'),{'options':{'raw':![],'where':{'id':_0x2f60c3},'include':[{'model':_0xe811('0xd'),'as':_0xe811('0xe')}],'attributes':['id',_0xe811('0xf'),_0xe811('0x10')]}});};exports['getSquareProjectById']=function(_0x11d0ff){return request(_0xe811('0x11'),{'options':{'where':{'id':_0x11d0ff},'attributes':[_0xe811('0xf')]}});};exports[_0xe811('0x12')]=function(_0x691d8){return request(_0xe811('0x13'),{'options':{'where':{'id':_0x691d8},'attributes':[_0xe811('0xf')]}});};exports[_0xe811('0x14')]=function(_0x1e3a6a){return request(_0xe811('0x15'),{'options':{'where':{'id':_0x1e3a6a},'attributes':[_0xe811('0xf')]}});};exports[_0xe811('0x16')]=function(_0x1d8d0a){return request(_0xe811('0x17'),{'options':{'where':{'id':_0x1d8d0a},'attributes':['dsn']}});};exports[_0xe811('0x18')]=function(_0x51423d){return request(_0xe811('0x19'),{'options':{'where':{'id':_0x51423d},'attributes':[_0xe811('0xf')]}});};exports['getTrunkById']=function(_0x24773a){return request(_0xe811('0x1a'),{'options':{'where':{'id':_0x24773a},'attributes':[_0xe811('0xf')]}});};exports[_0xe811('0x1b')]=function(_0x544a9e){return request('ShowSound',{'options':{'where':{'id':_0x544a9e},'attributes':[_0xe811('0x1c')]}});};exports[_0xe811('0x1d')]=function(_0x296234){return request(_0xe811('0x1e'),{'options':{'raw':![],'where':{'id':_0x296234},'include':[{'model':_0xe811('0x1f'),'as':'Intervals'}]}});};exports['getSmsAccountById']=function(_0x2ce312){return request('ShowSmsAccount',{'options':{'where':{'id':_0x2ce312},'attributes':['id',_0xe811('0xf')]}});};exports[_0xe811('0x20')]=function(_0x5d6f92){return request('CreateSmsMessage',{'body':_0x5d6f92});};exports[_0xe811('0x21')]=function(_0x1bb877){return request(_0xe811('0x22'),{'body':_0x1bb877});};exports[_0xe811('0x23')]=function(_0x41fd55){return request(_0xe811('0x24'),{'body':_[_0xe811('0x25')](_0x41fd55,{'project_name':_0x41fd55[_0xe811('0x26')],'prev_project_name':_0x41fd55[_0xe811('0x27')]||'','is_subproject':_0x41fd55[_0xe811('0x27')]?!![]:![],'leaveAt':moment()[_0xe811('0x28')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0xe811('0x29')]=function(_0x5591ff){return request(_0xe811('0x2a'),{'body':_0x5591ff});};exports[_0xe811('0x2b')]=function(_0x5bfdbe){return request(_0xe811('0x2c'),{'body':_0x5bfdbe});};exports[_0xe811('0x2d')]=function(_0x351152){return request(_0xe811('0x2e'),{'options':{'raw':![],'where':{'phone':_0x351152['phone'],'ListId':_0x351152['ListId']}}})[_0xe811('0x2f')](function(_0x149841){if(_0x149841){return _0x149841;}return request(_0xe811('0x30'),{'body':_0x351152});});};exports[_0xe811('0x31')]=function(_0x4fcaeb){return request('ShowPause',{'options':{'where':{'id':_0x4fcaeb},'attributes':[_0xe811('0xf')]}});};exports[_0xe811('0x32')]=function(_0x5a856f,_0x386e9a){return request(_0xe811('0x33'),{'body':{'interface':_0x386e9a},'options':{'where':_0x5a856f}});};exports[_0xe811('0x34')]=function(_0x4ff246,_0x2fc272,_0x565ee4){return request('PauseUser',{'body':{'type':_0x2fc272,'uniqueid':_0x565ee4},'options':{'where':_0x4ff246}});};exports[_0xe811('0x35')]=function(_0x36d559){return request(_0xe811('0x36'),{'body':{},'options':{'where':_0x36d559}});};exports[_0xe811('0x37')]=function(_0x2c443f){return request(_0xe811('0x38'),{'body':{},'options':{'where':_0x2c443f}});};
\ No newline at end of file
index 143a73d..42b002e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7dee=['./polly','exports'];(function(_0x3d9e0b,_0x521f5a){var _0x5d18d3=function(_0x4e9698){while(--_0x4e9698){_0x3d9e0b['push'](_0x3d9e0b['shift']());}};_0x5d18d3(++_0x521f5a);}(_0x7dee,0xb0));var _0xe7de=function(_0x2a5e63,_0x3def42){_0x2a5e63=_0x2a5e63-0x0;var _0x51fbef=_0x7dee[_0x2a5e63];return _0x51fbef;};var polly=require(_0xe7de('0x0'));var lex=require('./lex');module[_0xe7de('0x1')]={'polly':polly,'lex':lex};
\ No newline at end of file
+var _0x938d=['./polly','./lex'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x938d,0x122));var _0xd938=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x938d[_0x3dd15e];return _0x231fd0;};var polly=require(_0xd938('0x0'));var lex=require(_0xd938('0x1'));module['exports']={'polly':polly,'lex':lex};
\ No newline at end of file
index fae549d..aa294fd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6e6c=['exports','./lib/api'];(function(_0x2a558d,_0x2df0ff){var _0xa7bc9c=function(_0x12a30e){while(--_0x12a30e){_0x2a558d['push'](_0x2a558d['shift']());}};_0xa7bc9c(++_0x2df0ff);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e6c[_0x14add3];return _0x4a174f;};'use strict';var lex=require(_0xc6e6('0x0'));module[_0xc6e6('0x1')]=function(_0x545f2c,_0x370b21,_0x1b63fe,_0x58f303,_0x550e47,_0x2e97f5){return lex(_0x545f2c,_0x370b21,_0x1b63fe,_0x58f303,_0x550e47,_0x2e97f5);};
\ No newline at end of file
+var _0x9c00=['./lib/api','exports'];(function(_0x1a4969,_0x3bb31e){var _0x2ff811=function(_0x3f144d){while(--_0x3f144d){_0x1a4969['push'](_0x1a4969['shift']());}};_0x2ff811(++_0x3bb31e);}(_0x9c00,0x1a0));var _0x09c0=function(_0x4057a1,_0x315235){_0x4057a1=_0x4057a1-0x0;var _0x12f4a3=_0x9c00[_0x4057a1];return _0x12f4a3;};'use strict';var lex=require(_0x09c0('0x0'));module[_0x09c0('0x1')]=function(_0x4dff21,_0x5e32e7,_0xe0d293,_0x8c9907,_0x5d1967,_0x220c0c){return lex(_0x4dff21,_0x5e32e7,_0xe0d293,_0x8c9907,_0x5d1967,_0x220c0c);};
\ No newline at end of file
index a1bb9ab..cc6feb8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x209617,_0x57e825){var _0x36a496=function(_0x79f29c){while(--_0x79f29c){_0x209617['push'](_0x209617['shift']());}};_0x36a496(++_0x57e825);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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(_0x44c19f,_0x28eec2){var _0x3f2bd1=function(_0x363815){while(--_0x363815){_0x44c19f['push'](_0x44c19f['shift']());}};_0x3f2bd1(++_0x28eec2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'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 1e2693f..e4754bc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb8ab=['./lib/api'];(function(_0x400ef1,_0x3e9bf1){var _0x2762ec=function(_0x2ddccf){while(--_0x2ddccf){_0x400ef1['push'](_0x400ef1['shift']());}};_0x2762ec(++_0x3e9bf1);}(_0xb8ab,0xc0));var _0xbb8a=function(_0x13f3f1,_0x29345d){_0x13f3f1=_0x13f3f1-0x0;var _0xa5a374=_0xb8ab[_0x13f3f1];return _0xa5a374;};'use strict';var polly=require(_0xbb8a('0x0'));module['exports']=function(_0xb8ed54,_0x290539,_0x389f73,_0x34a383,_0x5e113b,_0x2aa1e4,_0x5ada8){return polly(_0xb8ed54,_0x290539,_0x389f73,_0x34a383,_0x5e113b,_0x2aa1e4,_0x5ada8);};
\ No newline at end of file
+var _0x7a14=['./lib/api','exports'];(function(_0x106aac,_0x66eb9a){var _0x4ac9f2=function(_0x567b8a){while(--_0x567b8a){_0x106aac['push'](_0x106aac['shift']());}};_0x4ac9f2(++_0x66eb9a);}(_0x7a14,0xfa));var _0x47a1=function(_0x19605e,_0x32be85){_0x19605e=_0x19605e-0x0;var _0x47545b=_0x7a14[_0x19605e];return _0x47545b;};'use strict';var polly=require(_0x47a1('0x0'));module[_0x47a1('0x1')]=function(_0x3e15ac,_0x44ab6f,_0x151373,_0x627e71,_0x11b992,_0x52a9b4,_0xc8bed){return polly(_0x3e15ac,_0x44ab6f,_0x151373,_0x627e71,_0x11b992,_0x52a9b4,_0xc8bed);};
\ No newline at end of file
index 144ddc0..ba6b60a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87d1=['synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','text','bluebird','randomstring','aws-sdk'];(function(_0xccc0d4,_0x2f6bf7){var _0x27a653=function(_0x285e63){while(--_0x285e63){_0xccc0d4['push'](_0xccc0d4['shift']());}};_0x27a653(++_0x2f6bf7);}(_0x87d1,0xe7));var _0x187d=function(_0x24110d,_0x1a75f4){_0x24110d=_0x24110d-0x0;var _0x378697=_0x87d1[_0x24110d];return _0x378697;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x187d('0x0'));var rs=require(_0x187d('0x1'));var AWS=require(_0x187d('0x2'));function pollyResult(_0x4841ff,_0x27b1cc,_0x56a9fe){return new BPromise(function(_0xccdf4d,_0x4f03af){_0x4841ff[_0x187d('0x3')](_0x27b1cc,function(_0x13c97b,_0xde6874){if(_0x13c97b){_0x4f03af(_0x13c97b);}else if(_0xde6874){if(_0xde6874[_0x187d('0x4')]instanceof Buffer){fs[_0x187d('0x5')](_0x56a9fe,_0xde6874['AudioStream'],function(_0x31bc7f){if(_0x31bc7f){_0x4f03af(_0x31bc7f);}else{_0xccdf4d();}});}else{_0x4f03af(new Error(_0x187d('0x6')));}}else{_0x4f03af(new Error(_0x187d('0x7')));}});});}module['exports']=function(_0x4b9c78,_0x262f24,_0x2e6523,_0x55a1d0,_0x153289,_0x1e6873,_0x2dadfe){var _0x5c5285=new AWS['Polly']({'accessKeyId':_0x4b9c78,'secretAccessKey':_0x262f24,'region':_0x2e6523});var _0x395a2b={'Text':_0x153289,'TextType':_0x1e6873||_0x187d('0x8'),'OutputFormat':'mp3','VoiceId':_0x55a1d0};return pollyResult(_0x5c5285,_0x395a2b,_0x2dadfe);};
\ No newline at end of file
+var _0x7737=['Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','mp3','path','synthesizeSpeech','AudioStream'];(function(_0x93813a,_0x42999a){var _0x201d7b=function(_0x5492ac){while(--_0x5492ac){_0x93813a['push'](_0x93813a['shift']());}};_0x201d7b(++_0x42999a);}(_0x7737,0x162));var _0x7773=function(_0x5f4cd7,_0x459c44){_0x5f4cd7=_0x5f4cd7-0x0;var _0x47c93f=_0x7737[_0x5f4cd7];return _0x47c93f;};'use strict';var fs=require('fs');var path=require(_0x7773('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var AWS=require('aws-sdk');function pollyResult(_0x5ac6ee,_0x3c6987,_0xfe0fe2){return new BPromise(function(_0x11b372,_0x1fed04){_0x5ac6ee[_0x7773('0x1')](_0x3c6987,function(_0x527a36,_0x1dbba9){if(_0x527a36){_0x1fed04(_0x527a36);}else if(_0x1dbba9){if(_0x1dbba9[_0x7773('0x2')]instanceof Buffer){fs['writeFile'](_0xfe0fe2,_0x1dbba9['AudioStream'],function(_0x4f1855){if(_0x4f1855){_0x1fed04(_0x4f1855);}else{_0x11b372();}});}else{_0x1fed04(new Error(_0x7773('0x3')));}}else{_0x1fed04(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x7773('0x4')]=function(_0x4a279e,_0x47674d,_0x24fbdd,_0x148b9c,_0x515f07,_0x4e9fcf,_0x37c209){var _0x2b74ab=new AWS[(_0x7773('0x5'))]({'accessKeyId':_0x4a279e,'secretAccessKey':_0x47674d,'region':_0x24fbdd});var _0x35d857={'Text':_0x515f07,'TextType':_0x4e9fcf||'text','OutputFormat':_0x7773('0x6'),'VoiceId':_0x148b9c};return pollyResult(_0x2b74ab,_0x35d857,_0x37c209);};
\ No newline at end of file
index 1d8fb2d..0089519 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb3a=['./lib/api','exports'];(function(_0x263901,_0x36ae24){var _0x31f81e=function(_0x3c36d9){while(--_0x3c36d9){_0x263901['push'](_0x263901['shift']());}};_0x31f81e(++_0x36ae24);}(_0xdb3a,0x1d6));var _0xadb3=function(_0x4748a2,_0x5d04bd){_0x4748a2=_0x4748a2-0x0;var _0x16c342=_0xdb3a[_0x4748a2];return _0x16c342;};'use strict';var asr=require(_0xadb3('0x0'));module[_0xadb3('0x1')]=function(_0x59fc5a,_0x3a0341,_0x3b2791,_0xda09a3){return asr(_0x59fc5a,_0x3a0341,_0x3b2791);};
\ No newline at end of file
+var _0x2ec8=['exports','./lib/api'];(function(_0xaa9c26,_0x207191){var _0x5d4ec9=function(_0x591f86){while(--_0x591f86){_0xaa9c26['push'](_0xaa9c26['shift']());}};_0x5d4ec9(++_0x207191);}(_0x2ec8,0x177));var _0x82ec=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x2ec8[_0x5ddb1c];return _0x354adc;};'use strict';var asr=require(_0x82ec('0x0'));module[_0x82ec('0x1')]=function(_0x45ba4e,_0x1c93a0,_0x495489,_0x2b42ce){return asr(_0x45ba4e,_0x1c93a0,_0x495489);};
\ No newline at end of file
index 649771f..f24d711 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee39=['toString','LINEAR16','url','bluebird','https://speech.googleapis.com','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0xee39,0x1e6));var _0x9ee3=function(_0x3500cb,_0x35a934){_0x3500cb=_0x3500cb-0x0;var _0x248df0=_0xee39[_0x3500cb];return _0x248df0;};'use strict';var url=require(_0x9ee3('0x0'));var BPromise=require(_0x9ee3('0x1'));var fs=require('fs');var host=_0x9ee3('0x2');module['exports']=function(_0x39e617,_0x64784f,_0x18357f){return new BPromise(function(_0x3cdeaf,_0x2724c7){var _0x3a556a;if(typeof _0x39e617!==_0x9ee3('0x3')||_0x39e617[_0x9ee3('0x4')]===0x0){return _0x2724c7(_0x9ee3('0x5'));}if(typeof _0x64784f!==_0x9ee3('0x3')||_0x64784f['length']===0x0){return _0x2724c7(_0x9ee3('0x6'));}if(typeof _0x18357f!==_0x9ee3('0x7')&&(typeof _0x18357f!==_0x9ee3('0x3')||_0x18357f['length']===0x0)){return _0x2724c7(_0x9ee3('0x8'));}try{_0x3a556a=fs['readFileSync'](_0x39e617)[_0x9ee3('0x9')]('base64');}catch(_0x2a5ae7){return _0x2724c7(_0x2a5ae7);}return _0x3cdeaf({'method':'POST','uri':host+'/v1/speech:recognize?key='+_0x64784f,'body':{'config':{'encoding':_0x9ee3('0xa'),'sampleRateHertz':'8000','languageCode':_0x18357f},'audio':{'content':_0x3a556a}},'json':!![]});});};
\ No newline at end of file
+var _0xbe31=['string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','https://speech.googleapis.com','exports','length'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0xbe31,0x83));var _0x1be3=function(_0x30dea6,_0x45559f){_0x30dea6=_0x30dea6-0x0;var _0x1a70bd=_0xbe31[_0x30dea6];return _0x1a70bd;};'use strict';var url=require('url');var BPromise=require(_0x1be3('0x0'));var fs=require('fs');var host=_0x1be3('0x1');module[_0x1be3('0x2')]=function(_0x474db2,_0x228047,_0x1bd12d){return new BPromise(function(_0xacfa1e,_0x2c1ddd){var _0x3aacc2;if(typeof _0x474db2!=='string'||_0x474db2[_0x1be3('0x3')]===0x0){return _0x2c1ddd('filepath\x20should\x20be\x20a\x20string');}if(typeof _0x228047!==_0x1be3('0x4')||_0x228047[_0x1be3('0x3')]===0x0){return _0x2c1ddd(_0x1be3('0x5'));}if(typeof _0x1bd12d!==_0x1be3('0x6')&&(typeof _0x1bd12d!==_0x1be3('0x4')||_0x1bd12d[_0x1be3('0x3')]===0x0)){return _0x2c1ddd(_0x1be3('0x7'));}try{_0x3aacc2=fs[_0x1be3('0x8')](_0x474db2)[_0x1be3('0x9')](_0x1be3('0xa'));}catch(_0x548e99){return _0x2c1ddd(_0x548e99);}return _0xacfa1e({'method':_0x1be3('0xb'),'uri':host+_0x1be3('0xc')+_0x228047,'body':{'config':{'encoding':_0x1be3('0xd'),'sampleRateHertz':_0x1be3('0xe'),'languageCode':_0x1bd12d},'audio':{'content':_0x3aacc2}},'json':!![]});});};
\ No newline at end of file
index 016c936..8900592 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39f6=['./asr','exports'];(function(_0x484c03,_0x13c1d2){var _0x294127=function(_0x45a834){while(--_0x45a834){_0x484c03['push'](_0x484c03['shift']());}};_0x294127(++_0x13c1d2);}(_0x39f6,0x19e));var _0x639f=function(_0x46eb8b,_0x574ae2){_0x46eb8b=_0x46eb8b-0x0;var _0x512d37=_0x39f6[_0x46eb8b];return _0x512d37;};var asr=require(_0x639f('0x0'));module[_0x639f('0x1')]={'asr':asr};
\ No newline at end of file
+var _0x54a6=['./asr','exports'];(function(_0x22df61,_0x4ae290){var _0x18329f=function(_0x3ec2ee){while(--_0x3ec2ee){_0x22df61['push'](_0x22df61['shift']());}};_0x18329f(++_0x4ae290);}(_0x54a6,0x1bc));var _0x654a=function(_0x381276,_0x3f9d76){_0x381276=_0x381276-0x0;var _0xdadc4=_0x54a6[_0x381276];return _0xdadc4;};var asr=require(_0x654a('0x0'));module[_0x654a('0x1')]={'asr':asr};
\ No newline at end of file
index 0a894ce..b7e3003 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe6be=['application/x-www-form-urlencoded','f.req=','jQ1olc','stringify','null','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','transcript','alternatives','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','message','googleDialogflow','textRequest','source','result','action','fulfillment','speech','score','metadata','endConversation','isFallbackIntent','replace','sessionPath','detectIntent','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','name','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','dirName','apiai-promise','bluebird','dialogflow','https','md5','path','request-promise','randomstring','sox','url','parse','util','./aws','./google','./sestek','agi','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','statusCode','error','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream','finish','info','finish\x20download\x20file','unlink','download\x20error','pipe','end','wav','finish\x20to\x20convert','start','resolve','generate','.wav','then','chmodSync','777','split','readFileSync','toString','base64','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','voice','MP3','text:synthesize','POST','tmp','from','audioContent','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8'];(function(_0x545150,_0x2c2b6c){var _0xff7fd6=function(_0x18bb22){while(--_0x18bb22){_0x545150['push'](_0x545150['shift']());}};_0xff7fd6(++_0x2c2b6c);}(_0xe6be,0x1eb));var _0xee6b=function(_0x12a069,_0x478b58){_0x12a069=_0x12a069-0x0;var _0x5ad121=_0xe6be[_0x12a069];return _0x5ad121;};'use strict';var apiai=require(_0xee6b('0x0'));var BPromise=require(_0xee6b('0x1'));var dialogflow=require(_0xee6b('0x2'));var fs=require('fs');var http=require('http');var https=require(_0xee6b('0x3'));var md5=require(_0xee6b('0x4'));var path=require(_0xee6b('0x5'));var querystring=require('querystring');var rp=require(_0xee6b('0x6'));var rs=require(_0xee6b('0x7'));var sox=require(_0xee6b('0x8'));var tts=require('google-tts-api');var urlParse=require(_0xee6b('0x9'))[_0xee6b('0xa')];var util=require(_0xee6b('0xb'));var aws=require(_0xee6b('0xc'));var google=require(_0xee6b('0xd'));var sestek=require(_0xee6b('0xe'));var tilde=require('./tilde');var logger=require('../../../config/logger')(_0xee6b('0xf'));var ISPEECH_API=_0xee6b('0x10');function downloadFile(_0x1a7f59,_0x24a5f8){return new BPromise(function(_0x343635,_0x2b72f5){var _0x2376b1=urlParse(_0x1a7f59);var _0x49f4da=_0x2376b1['protocol']===_0xee6b('0x11')?https:http;var _0x461c17={'host':_0x2376b1[_0xee6b('0x12')],'path':_0x2376b1['path'],'headers':{'user-agent':_0xee6b('0x13')}};_0x49f4da[_0xee6b('0x14')](_0x461c17,function(_0x32a416){if(_0x32a416[_0xee6b('0x15')]!==0xc8){logger[_0xee6b('0x16')]('request\x20to\x20'+_0x1a7f59+_0xee6b('0x17')+_0x32a416[_0xee6b('0x15')]+'\x20('+_0x32a416[_0xee6b('0x18')]+')');_0x2b72f5(new Error(_0xee6b('0x19')+_0x1a7f59+'\x20failed,\x20status\x20code\x20=\x20'+_0x32a416[_0xee6b('0x15')]+'\x20('+_0x32a416[_0xee6b('0x18')]+')'));return;}var _0x315473=fs[_0xee6b('0x1a')](_0x24a5f8);_0x315473['on'](_0xee6b('0x1b'),function(){logger[_0xee6b('0x1c')](_0xee6b('0x1d'));_0x315473['close'](_0x343635);});_0x315473['on'](_0xee6b('0x16'),function(_0x4510d7){fs[_0xee6b('0x1e')](_0x24a5f8);logger[_0xee6b('0x16')](_0xee6b('0x1f'),_0x4510d7);_0x2b72f5(_0x4510d7);});_0x32a416[_0xee6b('0x20')](_0x315473);})['on'](_0xee6b('0x16'),function(_0x457413){logger[_0xee6b('0x16')](_0x457413);_0x2b72f5(_0x457413);})[_0xee6b('0x21')]();});}function uploadFile(_0x349e7f){return new BPromise(function(_0x408fa8,_0x4a853b){var _0x2837bd=urlParse(_0x349e7f);var _0x17c50d=_0x2837bd['protocol']===_0xee6b('0x11')?https:http;var _0x4f25a1={'host':_0x2837bd['host'],'path':_0x2837bd['path'],'headers':{'user-agent':_0xee6b('0x13')}};_0x17c50d['get'](_0x4f25a1,function(_0x441566){if(_0x441566[_0xee6b('0x15')]!==0xc8){_0x4a853b(new Error('request\x20to\x20'+_0x349e7f+_0xee6b('0x17')+_0x441566['statusCode']+'\x20('+_0x441566[_0xee6b('0x18')]+')'));return;}var _0x5bf1fb='';_0x441566['on']('data',function(_0x138d18){_0x5bf1fb+=_0x138d18;});_0x441566['on'](_0xee6b('0x21'),function(){_0x408fa8(_0x5bf1fb);});})['on'](_0xee6b('0x16'),function(_0x402ead){_0x4a853b(_0x402ead);})[_0xee6b('0x21')]();});}function convertFile(_0x420732,_0x3cf63f){return new BPromise(function(_0x38facb,_0x2df118){var _0x3dd037=sox['transcode'](_0x420732,_0x3cf63f,{'sampleRate':0x1f40,'format':_0xee6b('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3dd037['on'](_0xee6b('0x16'),function(_0x33704e){logger[_0xee6b('0x16')]('error\x20convert',_0x33704e);_0x2df118(_0x33704e);});_0x3dd037['on'](_0xee6b('0x21'),function(){logger['info'](_0xee6b('0x23'));_0x38facb();});_0x3dd037[_0xee6b('0x24')]();});}function base64Decode(_0x2a6477,_0x2f4ccd){var _0x27bf3d=path[_0xee6b('0x25')](__dirname,'tmp',rs[_0xee6b('0x26')](0x4)+_0xee6b('0x27'));fs['writeFileSync'](_0x27bf3d,_0x2a6477,'base64');return convertFile(_0x27bf3d,_0x2f4ccd)[_0xee6b('0x28')](function(){try{fs[_0xee6b('0x1e')](_0x27bf3d);fs[_0xee6b('0x29')](_0x2f4ccd,_0xee6b('0x2a'));}catch(_0x181aa0){logger[_0xee6b('0x16')](_0x181aa0);}return _0x2f4ccd[_0xee6b('0x2b')]('.')[0x0];});}function base64Encode(_0x3a1805){var _0x25a77f=fs[_0xee6b('0x2c')](_0x3a1805);return new Buffer(_0x25a77f)[_0xee6b('0x2d')](_0xee6b('0x2e'));}exports['googleCloudTTS']=function(_0x1050df,_0x2fb495,_0x404f65,_0x3496d1,_0xfbe2e7,_0xb20e80){var _0x455607,_0xc53aaf;var _0x1aca79=_0xee6b('0x2f');var _0x221dab=_0xee6b('0x30')+_0x1050df;var _0x3ba93b={};if(_0x2fb495===_0xee6b('0x31')){_0x3ba93b[_0xee6b('0x32')]={'ssml':_0x404f65};}else{_0x3ba93b[_0xee6b('0x32')]={'text':_0x404f65};};_0x3ba93b[_0xee6b('0x33')]={'languageCode':_0x3496d1,'ssmlGender':_0xfbe2e7};_0x3ba93b['audioConfig']={'audioEncoding':_0xee6b('0x34'),'sampleRateHertz':0x1f40};var _0x3e8b66={'url':_0x1aca79+_0xee6b('0x35')+_0x221dab,'method':_0xee6b('0x36'),'json':!![],'body':_0x3ba93b};return rp(_0x3e8b66)[_0xee6b('0x28')](function(_0x4d8524){return new BPromise(function(_0x4a0f98,_0x4d31f4){_0x455607=path[_0xee6b('0x25')](__dirname,_0xee6b('0x37'),rs[_0xee6b('0x26')](0x4)+'.mp3');var _0x5e3121=Buffer[_0xee6b('0x38')](_0x4d8524[_0xee6b('0x39')],_0xee6b('0x2e'));return fs['writeFile'](_0x455607,_0x5e3121,function(_0x3c8499){_0x4d31f4(_0x3c8499);},function(_0x1a2eba){fs[_0xee6b('0x29')](_0x455607,_0xee6b('0x2a'));_0x4a0f98(_0x1a2eba);});});})[_0xee6b('0x28')](function(_0xdb74fe){_0xc53aaf=path[_0xee6b('0x25')](__dirname,_0xee6b('0x37'),rs['generate'](0x4)+'.wav');return convertFile(_0x455607,_0xc53aaf);})['then'](function(){try{fs[_0xee6b('0x1e')](_0x455607);fs[_0xee6b('0x29')](_0xc53aaf,_0xee6b('0x2a'));}catch(_0x1a697d){logger[_0xee6b('0x16')](_0x1a697d);}logger['info']('googleCloudTTS\x20path',_0xc53aaf[_0xee6b('0x2b')]('.')[0x0]);return _0xc53aaf[_0xee6b('0x2b')]('.')[0x0];});};exports[_0xee6b('0x3a')]=function(_0x430836,_0x4e8ccd){var _0x8fc53d=_0xee6b('0x3b');var _0x4a278d,_0x4ff8c3;var _0x46df11;var _0x5540a9={'encoding':_0xee6b('0x3c'),'method':_0xee6b('0x36'),'timeout':0x2710,'url':_0x8fc53d,'headers':{'Content-Type':_0xee6b('0x3d')},'body':_0xee6b('0x3e')+encodeURIComponent(JSON['stringify']([[[_0xee6b('0x3f'),JSON[_0xee6b('0x40')]([_0x430836,_0x4e8ccd||'en',![],_0xee6b('0x41')]),null,_0xee6b('0x42')]]]))};return rp(_0x5540a9)['then'](function(_0x10b7b9){try{_0x46df11=eval(_0x10b7b9[_0xee6b('0x43')](0x5))[0x0][0x2];}catch(_0x45b0da){throw new Error(_0xee6b('0x44')+_0x10b7b9['data']);}if(!_0x46df11){if(_0x430836[_0xee6b('0x45')]>0xc8){throw new Error(_0xee6b('0x46'));}else{throw new Error(_0xee6b('0x47')+_0x4e8ccd+_0xee6b('0x48'));}}try{_0x46df11=eval(_0x46df11)[0x0];}catch(_0x744118){throw new Error(_0xee6b('0x44')+res['data']);}const _0x3c607f=_0x46df11;_0x4a278d=path[_0xee6b('0x25')](__dirname,_0xee6b('0x37'),rs['generate'](0x4)+_0xee6b('0x49'));fs['writeFileSync'](_0x4a278d,_0x46df11,{'encoding':_0xee6b('0x2e')});_0x4ff8c3=path['resolve'](__dirname,_0xee6b('0x37'),rs['generate'](0x4)+_0xee6b('0x27'));return convertFile(_0x4a278d,_0x4ff8c3);})[_0xee6b('0x28')](function(){try{fs[_0xee6b('0x1e')](_0x4a278d);fs['chmodSync'](_0x4ff8c3,'777');}catch(_0x3732c4){logger[_0xee6b('0x16')](_0x3732c4);}logger[_0xee6b('0x1c')](_0xee6b('0x4a'),_0x4ff8c3[_0xee6b('0x2b')]('.')[0x0]);return _0x4ff8c3[_0xee6b('0x2b')]('.')[0x0];});};exports[_0xee6b('0x4b')]=function(_0x171aae,_0x501ccc,_0x381613){return google[_0xee6b('0x4c')](_0x171aae,_0x501ccc,_0x381613)[_0xee6b('0x28')](function(_0x2f6692){logger[_0xee6b('0x1c')](_0x2f6692[_0xee6b('0x4d')]);return rp(_0x2f6692);})['then'](function(_0x4b5810){var _0x10baf5='';var _0x39129f=0x0;try{fs[_0xee6b('0x1e')](_0x171aae);}catch(_0x2a7f5a){logger[_0xee6b('0x16')](_0x2a7f5a);}if(_0x4b5810&&_0x4b5810[_0xee6b('0x4e')]){_0x10baf5=_0x4b5810[_0xee6b('0x4e')]['map'](function(_0xafda95){return _0xafda95&&_0xafda95['alternatives'][0x0]&&_0xafda95['alternatives'][0x0][_0xee6b('0x4f')]?_0xafda95[_0xee6b('0x50')][0x0][_0xee6b('0x4f')]:'';})[_0xee6b('0x51')]('\x0a');_0x39129f=_0x4b5810[_0xee6b('0x4e')][_0xee6b('0x52')](function(_0x275a4){return _0x275a4&&_0x275a4[_0xee6b('0x50')][0x0]&&_0x275a4[_0xee6b('0x50')][0x0][_0xee6b('0x53')]?_0x275a4[_0xee6b('0x50')][0x0][_0xee6b('0x53')]:0x0;})['join']('\x0a');}logger[_0xee6b('0x1c')](_0xee6b('0x54'),_0x10baf5);logger['info'](_0xee6b('0x55'),_0x39129f);return{'transcript':_0x10baf5,'confidence':_0x39129f};})[_0xee6b('0x56')](function(_0xb72f4b){logger[_0xee6b('0x16')](_0xee6b('0x57'),_0xb72f4b[_0xee6b('0x15')],_0xb72f4b['name'],_0xb72f4b[_0xee6b('0x58')]);});};exports[_0xee6b('0x59')]=function(_0x37253d,_0x264c04,_0x416c88,_0x1fec11){var _0x19190c=apiai(_0x264c04,{'language':_0x1fec11||'en'});return _0x19190c[_0xee6b('0x5a')](_0x416c88,{'sessionId':md5(_0x37253d)})['then'](function(_0xce6582){logger[_0xee6b('0x1c')](JSON[_0xee6b('0x40')](_0xce6582));return{'source':_0xce6582['result'][_0xee6b('0x5b')],'resolvedQuery':_0xce6582[_0xee6b('0x5c')]['resolvedQuery'],'action':_0xce6582[_0xee6b('0x5c')][_0xee6b('0x5d')],'actionIncomplete':_0xce6582['result']['actionIncomplete'],'speech':_0xce6582[_0xee6b('0x5c')][_0xee6b('0x5e')][_0xee6b('0x5f')],'score':_0xce6582[_0xee6b('0x5c')][_0xee6b('0x60')],'statusCode':_0xce6582['status']['code'],'endConversation':_0xce6582[_0xee6b('0x5c')][_0xee6b('0x61')][_0xee6b('0x62')]||![],'isFallbackIntent':_0xce6582[_0xee6b('0x5c')][_0xee6b('0x61')][_0xee6b('0x63')]};});};exports['googleDialogflowV2']=function(_0x4c8a82,_0x30a557,_0x4bd890,_0x34889e,_0x518f7e,_0xe8249f){var _0x456932=_0x34889e[_0xee6b('0x64')](/\\n/g,'\x0a');var _0x56232c={'credentials':{'private_key':_0x456932,'client_email':_0x4bd890}};var _0x5b9dd8=new dialogflow['SessionsClient'](_0x56232c);var _0x3dccab=_0x5b9dd8[_0xee6b('0x65')](_0x30a557,md5(_0x4c8a82));var _0x47837a={'session':_0x3dccab,'queryInput':{'text':{'text':_0x518f7e,'languageCode':_0xe8249f}}};return _0x5b9dd8[_0xee6b('0x66')](_0x47837a)[_0xee6b('0x28')](function(_0x34bcc3){if(_0x34bcc3&&_0x34bcc3[_0xee6b('0x45')]){logger[_0xee6b('0x1c')]('Dialogflow\x20V2\x20response:',JSON[_0xee6b('0x40')](_0x34bcc3));var _0x552fc4=_0x34bcc3[0x0];if(_0x552fc4){var _0x5d7d6c={'action':_0x552fc4['queryResult'][_0xee6b('0x5d')],'allRequiredParamsPresent':_0x552fc4[_0xee6b('0x67')][_0xee6b('0x68')],'endConversation':_0x552fc4[_0xee6b('0x67')][_0xee6b('0x69')]&&_0x552fc4[_0xee6b('0x67')]['diagnosticInfo'][_0xee6b('0x6a')]?_0x552fc4[_0xee6b('0x67')]['diagnosticInfo']['fields'][_0xee6b('0x6b')][_0xee6b('0x6c')]:![],'fulfillmentText':_0x552fc4[_0xee6b('0x67')]['fulfillmentText'],'intentName':_0x552fc4['queryResult'][_0xee6b('0x6d')][_0xee6b('0x6e')],'intentDisplayName':_0x552fc4['queryResult'][_0xee6b('0x6d')][_0xee6b('0x6f')],'isFallbackIntent':_0x552fc4['queryResult'][_0xee6b('0x6d')][_0xee6b('0x70')],'languageCode':_0x552fc4[_0xee6b('0x67')][_0xee6b('0x71')],'queryText':_0x552fc4[_0xee6b('0x67')][_0xee6b('0x72')],'responseId':_0x552fc4[_0xee6b('0x73')],'score':_0x552fc4['queryResult'][_0xee6b('0x74')],'speech':_0x552fc4[_0xee6b('0x67')]['fulfillmentText'],'providerResponse':JSON['stringify'](_0x34bcc3)};return _0x5d7d6c;}}});};exports['tildeASR']=function(_0x1fd464,_0x1565ec,_0x4fb6bd,_0x36d520){return tilde[_0xee6b('0x4c')](_0x1fd464,_0x1565ec,_0x4fb6bd,_0x36d520)[_0xee6b('0x28')](function(_0x542cdb){try{fs[_0xee6b('0x1e')](_0x1fd464);}catch(_0x657ab0){logger['error'](_0x657ab0);}logger[_0xee6b('0x1c')](_0xee6b('0x75'),_0x542cdb[_0xee6b('0x4f')]);logger[_0xee6b('0x1c')](_0xee6b('0x76'),_0x542cdb[_0xee6b('0x53')]);return _0x542cdb;});};exports[_0xee6b('0x77')]=function(_0x289c9f,_0x31e930,_0x372e34,_0xce5f04,_0x4260fe,_0x3bfbbe){var _0x244496=path[_0xee6b('0x25')](__dirname,_0xee6b('0x37'),rs[_0xee6b('0x26')](0x4)+'.mp3');var _0xf8a084;return aws[_0xee6b('0x78')](_0x289c9f,_0x31e930,_0x372e34,_0xce5f04,_0x4260fe,_0x3bfbbe,_0x244496)[_0xee6b('0x28')](function(){_0xf8a084=path[_0xee6b('0x25')](__dirname,'tmp',rs[_0xee6b('0x26')](0x4)+_0xee6b('0x27'));return convertFile(_0x244496,_0xf8a084);})['then'](function(){try{fs[_0xee6b('0x1e')](_0x244496);fs[_0xee6b('0x29')](_0xf8a084,_0xee6b('0x2a'));}catch(_0x55d299){logger['error'](_0x55d299);}return _0xf8a084[_0xee6b('0x2b')]('.')[0x0];});};exports[_0xee6b('0x79')]=function(_0x3640b5,_0x24f1ce,_0x973416,_0x48ae8d,_0xf6bc13,_0x29fcbe){return aws[_0xee6b('0x7a')](_0x3640b5,_0x24f1ce,_0x973416,_0x48ae8d,_0xf6bc13,_0x29fcbe)['then'](function(_0x296c4c){logger[_0xee6b('0x1c')](JSON[_0xee6b('0x40')](_0x296c4c));return _0x296c4c;});};exports['ispeechTTS']=function(_0x58bf85,_0x2754b3,_0x32e3d2,_0x32bfbc){var _0x4fd007=util[_0xee6b('0x7b')](_0xee6b('0x7c'),ISPEECH_API,_0x58bf85,encodeURIComponent(_0x2754b3),_0x32e3d2,_0x32bfbc);var _0x1ea246=path['resolve'](__dirname,_0xee6b('0x37'),rs['generate'](0x4)+'.mp3');var _0x1478a1;return downloadFile(_0x4fd007,_0x1ea246)[_0xee6b('0x28')](function(){_0x1478a1=path[_0xee6b('0x25')](__dirname,_0xee6b('0x37'),rs[_0xee6b('0x26')](0x4)+_0xee6b('0x27'));return convertFile(_0x1ea246,_0x1478a1);})[_0xee6b('0x28')](function(){try{fs['unlink'](_0x1ea246);fs[_0xee6b('0x29')](_0x1478a1,'777');}catch(_0x471951){logger[_0xee6b('0x16')](_0x471951);}return _0x1478a1['split']('.')[0x0];});};exports[_0xee6b('0x7d')]=function(_0x1b9070,_0x235e20,_0x3b35a2,_0xb5782f){var _0x14e61c=util['format'](_0xee6b('0x7e'),ISPEECH_API,_0x235e20,_0x3b35a2,base64Encode(_0x1b9070),_0xb5782f?util[_0xee6b('0x7b')](_0xee6b('0x7f'),encodeURIComponent(_0xb5782f)):_0xee6b('0x80'));return uploadFile(_0x14e61c)[_0xee6b('0x28')](function(_0x307eb6){return querystring[_0xee6b('0xa')](_0x307eb6);});};exports[_0xee6b('0x81')]=function(_0xfe611f,_0x419854){return sestek[_0xee6b('0x82')](_0xfe611f,_0x419854)[_0xee6b('0x28')](function(_0x230b6f){logger[_0xee6b('0x1c')](JSON[_0xee6b('0x40')](_0x230b6f));var _0x221daf={'speech':_0x230b6f[_0xee6b('0x83')],'action':_0x230b6f[_0xee6b('0x84')]?_0x230b6f[_0xee6b('0x84')][_0xee6b('0x85')]:undefined,'actiondata':_0x230b6f['channelData']?_0x230b6f[_0xee6b('0x84')][_0xee6b('0x86')]:undefined};if(_0x230b6f[_0xee6b('0x84')]&&_0x230b6f['channelData']['AudioFromTts']){return base64Decode(_0x230b6f[_0xee6b('0x84')][_0xee6b('0x87')][_0xee6b('0x88')],path[_0xee6b('0x25')](__dirname,_0xee6b('0x37'),rs[_0xee6b('0x26')](0x4)+_0xee6b('0x27')))['then'](function(_0x3347fa){_0x221daf['audiofile']=_0x3347fa;return _0x221daf;});}return _0x221daf;});};exports[_0xee6b('0x89')]=function(){return __dirname;};
\ No newline at end of file
+var _0x2536=['./google','./sestek','./tilde','../../../config/logger','agi','https:','path','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','unlink','pipe','end','protocol','data','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','then','chmodSync','777','split','toString','base64','googleCloudTTS','?key=','voice','audioConfig','text:synthesize','POST','from','writeFile','googleCloudTTS\x20path','googleTTS','utf8','f.req=','stringify','jQ1olc','null','generic','slice','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','parse\x20response\x20failed:\x0a','.mp3','goggleTTS\x20path','googleASR','uri','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','message','googleDialogflow','result','source','actionIncomplete','fulfillment','speech','score','status','code','endConversation','metadata','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','action','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','intent','name','displayName','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','asr','Tilde\x20ASR\x20confidence','awsPolly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','freeform=3','sestekNDA','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','apiai-promise','bluebird','http','https','md5','request-promise','randomstring','url','util','./aws'];(function(_0x159c31,_0x245238){var _0x2c10e4=function(_0x1a495a){while(--_0x1a495a){_0x159c31['push'](_0x159c31['shift']());}};_0x2c10e4(++_0x245238);}(_0x2536,0x7c));var _0x6253=function(_0x27fcaa,_0x4d1dca){_0x27fcaa=_0x27fcaa-0x0;var _0x204840=_0x2536[_0x27fcaa];return _0x204840;};'use strict';var apiai=require(_0x6253('0x0'));var BPromise=require(_0x6253('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x6253('0x2'));var https=require(_0x6253('0x3'));var md5=require(_0x6253('0x4'));var path=require('path');var querystring=require('querystring');var rp=require(_0x6253('0x5'));var rs=require(_0x6253('0x6'));var sox=require('sox');var tts=require('google-tts-api');var urlParse=require(_0x6253('0x7'))['parse'];var util=require(_0x6253('0x8'));var aws=require(_0x6253('0x9'));var google=require(_0x6253('0xa'));var sestek=require(_0x6253('0xb'));var tilde=require(_0x6253('0xc'));var logger=require(_0x6253('0xd'))(_0x6253('0xe'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x574093,_0x40863){return new BPromise(function(_0x10403e,_0x38b82c){var _0xff8c71=urlParse(_0x574093);var _0x5241f1=_0xff8c71['protocol']===_0x6253('0xf')?https:http;var _0x3f3fcb={'host':_0xff8c71['host'],'path':_0xff8c71[_0x6253('0x10')],'headers':{'user-agent':_0x6253('0x11')}};_0x5241f1[_0x6253('0x12')](_0x3f3fcb,function(_0x1492f6){if(_0x1492f6[_0x6253('0x13')]!==0xc8){logger[_0x6253('0x14')](_0x6253('0x15')+_0x574093+_0x6253('0x16')+_0x1492f6[_0x6253('0x13')]+'\x20('+_0x1492f6['statusMessage']+')');_0x38b82c(new Error(_0x6253('0x15')+_0x574093+_0x6253('0x16')+_0x1492f6[_0x6253('0x13')]+'\x20('+_0x1492f6[_0x6253('0x17')]+')'));return;}var _0x2d48b5=fs[_0x6253('0x18')](_0x40863);_0x2d48b5['on'](_0x6253('0x19'),function(){logger[_0x6253('0x1a')]('finish\x20download\x20file');_0x2d48b5['close'](_0x10403e);});_0x2d48b5['on'](_0x6253('0x14'),function(_0x14c98a){fs[_0x6253('0x1b')](_0x40863);logger[_0x6253('0x14')]('download\x20error',_0x14c98a);_0x38b82c(_0x14c98a);});_0x1492f6[_0x6253('0x1c')](_0x2d48b5);})['on']('error',function(_0x1dfc1c){logger[_0x6253('0x14')](_0x1dfc1c);_0x38b82c(_0x1dfc1c);})[_0x6253('0x1d')]();});}function uploadFile(_0x3b5f12){return new BPromise(function(_0x26b27a,_0x51672a){var _0x5b825b=urlParse(_0x3b5f12);var _0x35dd6a=_0x5b825b[_0x6253('0x1e')]===_0x6253('0xf')?https:http;var _0x3e7824={'host':_0x5b825b['host'],'path':_0x5b825b['path'],'headers':{'user-agent':_0x6253('0x11')}};_0x35dd6a['get'](_0x3e7824,function(_0x294efd){if(_0x294efd['statusCode']!==0xc8){_0x51672a(new Error(_0x6253('0x15')+_0x3b5f12+_0x6253('0x16')+_0x294efd[_0x6253('0x13')]+'\x20('+_0x294efd['statusMessage']+')'));return;}var _0x453175='';_0x294efd['on'](_0x6253('0x1f'),function(_0x4bebce){_0x453175+=_0x4bebce;});_0x294efd['on'](_0x6253('0x1d'),function(){_0x26b27a(_0x453175);});})['on'](_0x6253('0x14'),function(_0x2a5bf4){_0x51672a(_0x2a5bf4);})[_0x6253('0x1d')]();});}function convertFile(_0x259714,_0x329101){return new BPromise(function(_0x17f32b,_0x2585de){var _0x4c7fda=sox[_0x6253('0x20')](_0x259714,_0x329101,{'sampleRate':0x1f40,'format':_0x6253('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4c7fda['on'](_0x6253('0x14'),function(_0x4fd2dc){logger[_0x6253('0x14')](_0x6253('0x22'),_0x4fd2dc);_0x2585de(_0x4fd2dc);});_0x4c7fda['on'](_0x6253('0x1d'),function(){logger[_0x6253('0x1a')](_0x6253('0x23'));_0x17f32b();});_0x4c7fda[_0x6253('0x24')]();});}function base64Decode(_0x4bc58a,_0x2b2999){var _0x5a2f6b=path[_0x6253('0x25')](__dirname,_0x6253('0x26'),rs[_0x6253('0x27')](0x4)+_0x6253('0x28'));fs[_0x6253('0x29')](_0x5a2f6b,_0x4bc58a,'base64');return convertFile(_0x5a2f6b,_0x2b2999)[_0x6253('0x2a')](function(){try{fs[_0x6253('0x1b')](_0x5a2f6b);fs[_0x6253('0x2b')](_0x2b2999,_0x6253('0x2c'));}catch(_0x10c059){logger[_0x6253('0x14')](_0x10c059);}return _0x2b2999[_0x6253('0x2d')]('.')[0x0];});}function base64Encode(_0x3b300d){var _0x3e5297=fs['readFileSync'](_0x3b300d);return new Buffer(_0x3e5297)[_0x6253('0x2e')](_0x6253('0x2f'));}exports[_0x6253('0x30')]=function(_0x3eb90c,_0x4b3056,_0x56e3ea,_0x327172,_0xa1a1d5,_0x264fc8){var _0x292478,_0x2f8c29;var _0xc69a72='https://texttospeech.googleapis.com/v1/';var _0xdbf8f6=_0x6253('0x31')+_0x3eb90c;var _0x58d4af={};if(_0x4b3056==='ssml'){_0x58d4af['input']={'ssml':_0x56e3ea};}else{_0x58d4af['input']={'text':_0x56e3ea};};_0x58d4af[_0x6253('0x32')]={'languageCode':_0x327172,'ssmlGender':_0xa1a1d5};_0x58d4af[_0x6253('0x33')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x57c092={'url':_0xc69a72+_0x6253('0x34')+_0xdbf8f6,'method':_0x6253('0x35'),'json':!![],'body':_0x58d4af};return rp(_0x57c092)[_0x6253('0x2a')](function(_0x331598){return new BPromise(function(_0x2b7958,_0x3a2aca){_0x292478=path['resolve'](__dirname,_0x6253('0x26'),rs[_0x6253('0x27')](0x4)+'.mp3');var _0x2ea3cb=Buffer[_0x6253('0x36')](_0x331598['audioContent'],_0x6253('0x2f'));return fs[_0x6253('0x37')](_0x292478,_0x2ea3cb,function(_0x405916){_0x3a2aca(_0x405916);},function(_0x4db56e){fs[_0x6253('0x2b')](_0x292478,_0x6253('0x2c'));_0x2b7958(_0x4db56e);});});})['then'](function(_0x555424){_0x2f8c29=path['resolve'](__dirname,'tmp',rs[_0x6253('0x27')](0x4)+_0x6253('0x28'));return convertFile(_0x292478,_0x2f8c29);})[_0x6253('0x2a')](function(){try{fs[_0x6253('0x1b')](_0x292478);fs[_0x6253('0x2b')](_0x2f8c29,_0x6253('0x2c'));}catch(_0x440d08){logger[_0x6253('0x14')](_0x440d08);}logger['info'](_0x6253('0x38'),_0x2f8c29[_0x6253('0x2d')]('.')[0x0]);return _0x2f8c29[_0x6253('0x2d')]('.')[0x0];});};exports[_0x6253('0x39')]=function(_0x5d5b94,_0xc7a074){var _0x17d34c='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x3acae2,_0x51e7fa;var _0x4f3bdd;var _0x104599={'encoding':_0x6253('0x3a'),'method':_0x6253('0x35'),'timeout':0x2710,'url':_0x17d34c,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x6253('0x3b')+encodeURIComponent(JSON[_0x6253('0x3c')]([[[_0x6253('0x3d'),JSON[_0x6253('0x3c')]([_0x5d5b94,_0xc7a074||'en',![],_0x6253('0x3e')]),null,_0x6253('0x3f')]]]))};return rp(_0x104599)[_0x6253('0x2a')](function(_0x2420eb){try{_0x4f3bdd=eval(_0x2420eb[_0x6253('0x40')](0x5))[0x0][0x2];}catch(_0x950548){throw new Error('parse\x20response\x20failed:\x0a'+_0x2420eb[_0x6253('0x1f')]);}if(!_0x4f3bdd){if(_0x5d5b94[_0x6253('0x41')]>0xc8){throw new Error(_0x6253('0x42'));}else{throw new Error('lang\x20\x22'+_0xc7a074+_0x6253('0x43'));}}try{_0x4f3bdd=eval(_0x4f3bdd)[0x0];}catch(_0x57f977){throw new Error(_0x6253('0x44')+res['data']);}const _0x305288=_0x4f3bdd;_0x3acae2=path['resolve'](__dirname,_0x6253('0x26'),rs[_0x6253('0x27')](0x4)+_0x6253('0x45'));fs[_0x6253('0x29')](_0x3acae2,_0x4f3bdd,{'encoding':_0x6253('0x2f')});_0x51e7fa=path[_0x6253('0x25')](__dirname,'tmp',rs[_0x6253('0x27')](0x4)+_0x6253('0x28'));return convertFile(_0x3acae2,_0x51e7fa);})[_0x6253('0x2a')](function(){try{fs[_0x6253('0x1b')](_0x3acae2);fs[_0x6253('0x2b')](_0x51e7fa,'777');}catch(_0x15d8b7){logger[_0x6253('0x14')](_0x15d8b7);}logger[_0x6253('0x1a')](_0x6253('0x46'),_0x51e7fa[_0x6253('0x2d')]('.')[0x0]);return _0x51e7fa['split']('.')[0x0];});};exports[_0x6253('0x47')]=function(_0x5e17c6,_0x1e7722,_0x102077){return google['asr'](_0x5e17c6,_0x1e7722,_0x102077)[_0x6253('0x2a')](function(_0x11fd6c){logger[_0x6253('0x1a')](_0x11fd6c[_0x6253('0x48')]);return rp(_0x11fd6c);})['then'](function(_0x4640d8){var _0x31a895='';var _0x16ef35=0x0;try{fs[_0x6253('0x1b')](_0x5e17c6);}catch(_0x56c00f){logger['error'](_0x56c00f);}if(_0x4640d8&&_0x4640d8['results']){_0x31a895=_0x4640d8[_0x6253('0x49')][_0x6253('0x4a')](function(_0x299825){return _0x299825&&_0x299825[_0x6253('0x4b')][0x0]&&_0x299825[_0x6253('0x4b')][0x0][_0x6253('0x4c')]?_0x299825[_0x6253('0x4b')][0x0][_0x6253('0x4c')]:'';})[_0x6253('0x4d')]('\x0a');_0x16ef35=_0x4640d8[_0x6253('0x49')]['map'](function(_0xbbba6){return _0xbbba6&&_0xbbba6['alternatives'][0x0]&&_0xbbba6[_0x6253('0x4b')][0x0][_0x6253('0x4e')]?_0xbbba6['alternatives'][0x0][_0x6253('0x4e')]:0x0;})['join']('\x0a');}logger[_0x6253('0x1a')](_0x6253('0x4f'),_0x31a895);logger[_0x6253('0x1a')](_0x6253('0x50'),_0x16ef35);return{'transcript':_0x31a895,'confidence':_0x16ef35};})[_0x6253('0x51')](function(_0x4007ca){logger[_0x6253('0x14')](_0x6253('0x52'),_0x4007ca['statusCode'],_0x4007ca['name'],_0x4007ca[_0x6253('0x53')]);});};exports[_0x6253('0x54')]=function(_0x52cbc9,_0x4c3f76,_0x25acae,_0x2ccf66){var _0x5f5149=apiai(_0x4c3f76,{'language':_0x2ccf66||'en'});return _0x5f5149['textRequest'](_0x25acae,{'sessionId':md5(_0x52cbc9)})[_0x6253('0x2a')](function(_0x128307){logger[_0x6253('0x1a')](JSON[_0x6253('0x3c')](_0x128307));return{'source':_0x128307[_0x6253('0x55')][_0x6253('0x56')],'resolvedQuery':_0x128307['result']['resolvedQuery'],'action':_0x128307[_0x6253('0x55')]['action'],'actionIncomplete':_0x128307['result'][_0x6253('0x57')],'speech':_0x128307[_0x6253('0x55')][_0x6253('0x58')][_0x6253('0x59')],'score':_0x128307['result'][_0x6253('0x5a')],'statusCode':_0x128307[_0x6253('0x5b')][_0x6253('0x5c')],'endConversation':_0x128307['result']['metadata'][_0x6253('0x5d')]||![],'isFallbackIntent':_0x128307['result'][_0x6253('0x5e')]['isFallbackIntent']};});};exports['googleDialogflowV2']=function(_0x207085,_0x1fda44,_0x451fd3,_0x51fef2,_0x240f9f,_0x24b0af){var _0x208e54=_0x51fef2[_0x6253('0x5f')](/\\n/g,'\x0a');var _0x1f4342={'credentials':{'private_key':_0x208e54,'client_email':_0x451fd3}};var _0x4ba8d2=new dialogflow[(_0x6253('0x60'))](_0x1f4342);var _0x508b55=_0x4ba8d2[_0x6253('0x61')](_0x1fda44,md5(_0x207085));var _0x4c1834={'session':_0x508b55,'queryInput':{'text':{'text':_0x240f9f,'languageCode':_0x24b0af}}};return _0x4ba8d2[_0x6253('0x62')](_0x4c1834)[_0x6253('0x2a')](function(_0x119729){if(_0x119729&&_0x119729[_0x6253('0x41')]){logger[_0x6253('0x1a')](_0x6253('0x63'),JSON[_0x6253('0x3c')](_0x119729));var _0x42441d=_0x119729[0x0];if(_0x42441d){var _0x28225d={'action':_0x42441d['queryResult'][_0x6253('0x64')],'allRequiredParamsPresent':_0x42441d[_0x6253('0x65')][_0x6253('0x66')],'endConversation':_0x42441d['queryResult'][_0x6253('0x67')]&&_0x42441d['queryResult'][_0x6253('0x67')][_0x6253('0x68')]?_0x42441d['queryResult'][_0x6253('0x67')][_0x6253('0x68')][_0x6253('0x69')]['boolValue']:![],'fulfillmentText':_0x42441d[_0x6253('0x65')]['fulfillmentText'],'intentName':_0x42441d[_0x6253('0x65')][_0x6253('0x6a')][_0x6253('0x6b')],'intentDisplayName':_0x42441d[_0x6253('0x65')]['intent'][_0x6253('0x6c')],'isFallbackIntent':_0x42441d[_0x6253('0x65')][_0x6253('0x6a')][_0x6253('0x6d')],'languageCode':_0x42441d[_0x6253('0x65')][_0x6253('0x6e')],'queryText':_0x42441d['queryResult'][_0x6253('0x6f')],'responseId':_0x42441d[_0x6253('0x70')],'score':_0x42441d['queryResult'][_0x6253('0x71')],'speech':_0x42441d[_0x6253('0x65')]['fulfillmentText'],'providerResponse':JSON[_0x6253('0x3c')](_0x119729)};return _0x28225d;}}});};exports['tildeASR']=function(_0x4afae1,_0x195a84,_0x284722,_0x5cf5d4){return tilde[_0x6253('0x72')](_0x4afae1,_0x195a84,_0x284722,_0x5cf5d4)['then'](function(_0x2eef5e){try{fs[_0x6253('0x1b')](_0x4afae1);}catch(_0x5ab302){logger[_0x6253('0x14')](_0x5ab302);}logger[_0x6253('0x1a')]('Tilde\x20ASR\x20transcription',_0x2eef5e['transcript']);logger[_0x6253('0x1a')](_0x6253('0x73'),_0x2eef5e[_0x6253('0x4e')]);return _0x2eef5e;});};exports[_0x6253('0x74')]=function(_0x22f592,_0x460bbc,_0x5474b6,_0x214600,_0xbc8796,_0x25615a){var _0x4fef2f=path['resolve'](__dirname,'tmp',rs[_0x6253('0x27')](0x4)+_0x6253('0x45'));var _0x3fc835;return aws['polly'](_0x22f592,_0x460bbc,_0x5474b6,_0x214600,_0xbc8796,_0x25615a,_0x4fef2f)['then'](function(){_0x3fc835=path[_0x6253('0x25')](__dirname,_0x6253('0x26'),rs['generate'](0x4)+_0x6253('0x28'));return convertFile(_0x4fef2f,_0x3fc835);})['then'](function(){try{fs['unlink'](_0x4fef2f);fs['chmodSync'](_0x3fc835,_0x6253('0x2c'));}catch(_0x4fc68d){logger[_0x6253('0x14')](_0x4fc68d);}return _0x3fc835['split']('.')[0x0];});};exports[_0x6253('0x75')]=function(_0x5b2d4b,_0x14eeb6,_0x3f1eb2,_0x45b4b4,_0x46731c,_0x1951b3){return aws[_0x6253('0x76')](_0x5b2d4b,_0x14eeb6,_0x3f1eb2,_0x45b4b4,_0x46731c,_0x1951b3)[_0x6253('0x2a')](function(_0x306e30){logger['info'](JSON[_0x6253('0x3c')](_0x306e30));return _0x306e30;});};exports[_0x6253('0x77')]=function(_0x39e03d,_0x42f8e8,_0x436d84,_0x4cc595){var _0x259e0=util[_0x6253('0x78')](_0x6253('0x79'),ISPEECH_API,_0x39e03d,encodeURIComponent(_0x42f8e8),_0x436d84,_0x4cc595);var _0x35ce05=path[_0x6253('0x25')](__dirname,_0x6253('0x26'),rs[_0x6253('0x27')](0x4)+_0x6253('0x45'));var _0x4b93d8;return downloadFile(_0x259e0,_0x35ce05)[_0x6253('0x2a')](function(){_0x4b93d8=path[_0x6253('0x25')](__dirname,_0x6253('0x26'),rs[_0x6253('0x27')](0x4)+'.wav');return convertFile(_0x35ce05,_0x4b93d8);})[_0x6253('0x2a')](function(){try{fs[_0x6253('0x1b')](_0x35ce05);fs[_0x6253('0x2b')](_0x4b93d8,_0x6253('0x2c'));}catch(_0x26e21c){logger[_0x6253('0x14')](_0x26e21c);}return _0x4b93d8[_0x6253('0x2d')]('.')[0x0];});};exports[_0x6253('0x7a')]=function(_0x1af2cf,_0x522121,_0x58da55,_0x57b3ea){var _0x514b74=util[_0x6253('0x78')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x522121,_0x58da55,base64Encode(_0x1af2cf),_0x57b3ea?util[_0x6253('0x78')](_0x6253('0x7b'),encodeURIComponent(_0x57b3ea)):_0x6253('0x7c'));return uploadFile(_0x514b74)[_0x6253('0x2a')](function(_0x2248e1){return querystring['parse'](_0x2248e1);});};exports[_0x6253('0x7d')]=function(_0x2a9c6f,_0xf63233){return sestek['nda'](_0x2a9c6f,_0xf63233)[_0x6253('0x2a')](function(_0x190358){logger[_0x6253('0x1a')](JSON['stringify'](_0x190358));var _0x20e260={'speech':_0x190358[_0x6253('0x7e')],'action':_0x190358[_0x6253('0x7f')]?_0x190358[_0x6253('0x7f')][_0x6253('0x80')]:undefined,'actiondata':_0x190358[_0x6253('0x7f')]?_0x190358['channelData'][_0x6253('0x81')]:undefined};if(_0x190358[_0x6253('0x7f')]&&_0x190358[_0x6253('0x7f')][_0x6253('0x82')]){return base64Decode(_0x190358[_0x6253('0x7f')][_0x6253('0x82')][_0x6253('0x83')],path['resolve'](__dirname,_0x6253('0x26'),rs[_0x6253('0x27')](0x4)+_0x6253('0x28')))['then'](function(_0x4d0353){_0x20e260[_0x6253('0x84')]=_0x4d0353;return _0x20e260;});}return _0x20e260;});};exports[_0x6253('0x85')]=function(){return __dirname;};
\ No newline at end of file
index 9c48b17..a65e033 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x72b3=['exports'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x72b3,0x10b));var _0x372b=function(_0x4c4037,_0x15054b){_0x4c4037=_0x4c4037-0x0;var _0x357862=_0x72b3[_0x4c4037];return _0x357862;};var nda=require('./nda');module[_0x372b('0x0')]={'nda':nda};
\ No newline at end of file
+var _0x15bb=['./nda'];(function(_0x2a9d17,_0x27fa70){var _0x39bafb=function(_0x2fd563){while(--_0x2fd563){_0x2a9d17['push'](_0x2a9d17['shift']());}};_0x39bafb(++_0x27fa70);}(_0x15bb,0x140));var _0xb15b=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x15bb[_0x1035c1];return _0x308d67;};var nda=require(_0xb15b('0x0'));module['exports']={'nda':nda};
\ No newline at end of file
index 489032e..0886c5e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf6fb=['access_token','project','body','ProjectName','ndagenerate_audio','channelData','AudioOutputSettings','custom_action','CustomAction','custom_action_data','info','stringify','../../../../../config/logger','agi','POST','ndauth_url','/token','password','username','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','callerid','calleridname','dnid','text'];(function(_0xb2595c,_0x16e127){var _0x4c9709=function(_0x3d63bb){while(--_0x3d63bb){_0xb2595c['push'](_0xb2595c['shift']());}};_0x4c9709(++_0x16e127);}(_0xf6fb,0x111));var _0xbf6f=function(_0x4bd611,_0x23855a){_0x4bd611=_0x4bd611-0x0;var _0x5d5606=_0xf6fb[_0x4bd611];return _0x5d5606;};'use strict';var rp=require('request-promise');var url=require('url');var logger=require(_0xbf6f('0x0'))(_0xbf6f('0x1'));module['exports']=function(_0x270dda,_0x7191f2){var _0x5709b7={'method':_0xbf6f('0x2'),'uri':url['resolve'](_0x7191f2[_0xbf6f('0x3')],_0xbf6f('0x4')),'form':{'grant_type':_0xbf6f('0x5'),'username':_0x7191f2[_0xbf6f('0x6')],'password':_0x7191f2[_0xbf6f('0x5')]},'json':!![]};return rp(_0x5709b7)[_0xbf6f('0x7')](function(_0x9d0c63){var _0x43d56b={'method':'POST','uri':url[_0xbf6f('0x8')](_0x7191f2[_0xbf6f('0x9')],_0xbf6f('0xa')),'body':{'type':_0x7191f2[_0xbf6f('0xb')]||_0xbf6f('0xc'),'channelId':'Nda','conversation':{'id':_0x270dda['uniqueid']},'from':{'id':_0x270dda[_0xbf6f('0xd')],'name':_0x270dda[_0xbf6f('0xe')]},'recipient':{'id':_0x270dda[_0xbf6f('0xf')],'name':_0x270dda['extension']},'text':_0x7191f2[_0xbf6f('0x10')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x9d0c63[_0xbf6f('0x11')]},'json':!![]};if(_0x7191f2[_0xbf6f('0x12')]){_0x43d56b[_0xbf6f('0x13')]['channelData'][_0xbf6f('0x14')]=_0x7191f2[_0xbf6f('0x12')];}if(_0x7191f2[_0xbf6f('0x15')]=='1'){_0x43d56b[_0xbf6f('0x13')][_0xbf6f('0x16')][_0xbf6f('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x7191f2[_0xbf6f('0x18')]){_0x43d56b[_0xbf6f('0x13')][_0xbf6f('0x16')][_0xbf6f('0x19')]=_0x7191f2[_0xbf6f('0x18')];if(_0x7191f2[_0xbf6f('0x1a')]){_0x43d56b[_0xbf6f('0x13')]['channelData']['CustomActionData']=_0x7191f2[_0xbf6f('0x1a')];}}logger[_0xbf6f('0x1b')](JSON[_0xbf6f('0x1c')](_0x43d56b));return rp(_0x43d56b);});};
\ No newline at end of file
+var _0xd9dc=['Bearer\x20','project','body','channelData','AudioOutputSettings','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','url','../../../../../config/logger','exports','POST','resolve','ndauth_url','/token','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','extension'];(function(_0x1973cd,_0x21d1b3){var _0x38f926=function(_0x1f3fd4){while(--_0x1f3fd4){_0x1973cd['push'](_0x1973cd['shift']());}};_0x38f926(++_0x21d1b3);}(_0xd9dc,0x1be));var _0xcd9d=function(_0x15f5e4,_0x5b6b4c){_0x15f5e4=_0x15f5e4-0x0;var _0x4830e5=_0xd9dc[_0x15f5e4];return _0x4830e5;};'use strict';var rp=require('request-promise');var url=require(_0xcd9d('0x0'));var logger=require(_0xcd9d('0x1'))('agi');module[_0xcd9d('0x2')]=function(_0x21af9a,_0x8b7ba5){var _0x521588={'method':_0xcd9d('0x3'),'uri':url[_0xcd9d('0x4')](_0x8b7ba5[_0xcd9d('0x5')],_0xcd9d('0x6')),'form':{'grant_type':_0xcd9d('0x7'),'username':_0x8b7ba5['username'],'password':_0x8b7ba5[_0xcd9d('0x7')]},'json':!![]};return rp(_0x521588)[_0xcd9d('0x8')](function(_0x1d8770){var _0x285e75={'method':_0xcd9d('0x3'),'uri':url['resolve'](_0x8b7ba5[_0xcd9d('0x9')],_0xcd9d('0xa')),'body':{'type':_0x8b7ba5[_0xcd9d('0xb')]||_0xcd9d('0xc'),'channelId':_0xcd9d('0xd'),'conversation':{'id':_0x21af9a[_0xcd9d('0xe')]},'from':{'id':_0x21af9a[_0xcd9d('0xf')],'name':_0x21af9a[_0xcd9d('0x10')]},'recipient':{'id':_0x21af9a['dnid'],'name':_0x21af9a[_0xcd9d('0x11')]},'text':_0x8b7ba5['text'],'channelData':{}},'headers':{'Authorization':_0xcd9d('0x12')+_0x1d8770['access_token']},'json':!![]};if(_0x8b7ba5[_0xcd9d('0x13')]){_0x285e75[_0xcd9d('0x14')][_0xcd9d('0x15')]['ProjectName']=_0x8b7ba5[_0xcd9d('0x13')];}if(_0x8b7ba5['ndagenerate_audio']=='1'){_0x285e75[_0xcd9d('0x14')][_0xcd9d('0x15')][_0xcd9d('0x16')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x8b7ba5[_0xcd9d('0x17')]){_0x285e75[_0xcd9d('0x14')]['channelData'][_0xcd9d('0x18')]=_0x8b7ba5['custom_action'];if(_0x8b7ba5[_0xcd9d('0x19')]){_0x285e75['body'][_0xcd9d('0x15')][_0xcd9d('0x1a')]=_0x8b7ba5[_0xcd9d('0x19')];}}logger[_0xcd9d('0x1b')](JSON[_0xcd9d('0x1c')](_0x285e75));return rp(_0x285e75);});};
\ No newline at end of file
index 974fbe0..fabb257 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfce6=['./lib/api','exports'];(function(_0x255b94,_0x352b45){var _0xc5806b=function(_0x530e79){while(--_0x530e79){_0x255b94['push'](_0x255b94['shift']());}};_0xc5806b(++_0x352b45);}(_0xfce6,0x1c6));var _0x6fce=function(_0xeedbcc,_0x42f007){_0xeedbcc=_0xeedbcc-0x0;var _0x4a9b38=_0xfce6[_0xeedbcc];return _0x4a9b38;};'use strict';var asr=require(_0x6fce('0x0'));module[_0x6fce('0x1')]=function(_0x345a6c,_0xc49f3b,_0x4841c7,_0x4fd990){return asr(_0x345a6c,_0xc49f3b,_0x4841c7,_0x4fd990);};
\ No newline at end of file
+var _0x7dc5=['exports','./lib/api'];(function(_0x4744de,_0x1790bd){var _0x3fb120=function(_0xcb8bd8){while(--_0xcb8bd8){_0x4744de['push'](_0x4744de['shift']());}};_0x3fb120(++_0x1790bd);}(_0x7dc5,0x179));var _0x57dc=function(_0x1188a8,_0xc1498d){_0x1188a8=_0x1188a8-0x0;var _0x50c1c1=_0x7dc5[_0x1188a8];return _0x50c1c1;};'use strict';var asr=require(_0x57dc('0x0'));module[_0x57dc('0x1')]=function(_0x2f91a4,_0x30c7d8,_0x450355,_0x3e7875){return asr(_0x2f91a4,_0x30c7d8,_0x450355,_0x3e7875);};
\ No newline at end of file
index dbde38d..fb58fc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x57f9=['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','open','close','bluebird','lodash','crypto','../../../../../../config/logger','agi','exports','info','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','digest','hex','send','stringify','data','error','Tilde\x20ASR\x20send\x20error','terminate','final','Tilde\x20ASR\x20hypoteses','result','transcript','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.'];(function(_0x8a3fb7,_0x1c1632){var _0x1d4606=function(_0x3061e5){while(--_0x3061e5){_0x8a3fb7['push'](_0x8a3fb7['shift']());}};_0x1d4606(++_0x1c1632);}(_0x57f9,0xd3));var _0x957f=function(_0x6dd195,_0x2898ea){_0x6dd195=_0x6dd195-0x0;var _0x48ef7d=_0x57f9[_0x6dd195];return _0x48ef7d;};'use strict';var BPromise=require(_0x957f('0x0'));var _=require(_0x957f('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x957f('0x2'));var logger=require(_0x957f('0x3'))(_0x957f('0x4'));module[_0x957f('0x5')]=function(_0x5868f1,_0x22c29d,_0x4f2e4e,_0x3835d7){return new BPromise(function(_0x45ce03,_0x27a9d4){logger[_0x957f('0x6')]('Tilde\x20URI',_0x3835d7||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x301df1=new WebSocket(_0x3835d7||_0x957f('0x7'),{'perMessageDeflate':![]});var _0x5037c2='';var _0x437de7='0';var _0x3a0eaa='1';var _0x1ee4e1=_0x957f('0x8');function _0x18092e(_0xa893e){var _0x3b88aa=crypto[_0x957f('0x9')](_0x957f('0xa'));_0x3b88aa[_0x957f('0xb')](_0xa893e);return _0x3b88aa[_0x957f('0xc')](_0x957f('0xd'));}function _0x2e0daa(){try{logger[_0x957f('0x6')]('Open\x20Tilde\x20ASR\x20socket');var _0xa20c67=moment()['unix']();var _0x5da239=_0x18092e(_0xa20c67+_0x22c29d+_0x4f2e4e);_0x301df1[_0x957f('0xe')](JSON[_0x957f('0xf')]({'appID':_0x22c29d,'timestamp':_0xa20c67,'appKey':_0x5da239}));var _0x15ff7e=fs['createReadStream'](_0x5868f1);_0x15ff7e['on'](_0x957f('0x10'),function(_0xb1777){_0x301df1[_0x957f('0xe')](_0xb1777);});_0x15ff7e['on']('close',function(){_0x301df1[_0x957f('0xe')]('EOS');});}catch(_0x1001b5){logger[_0x957f('0x11')](_0x957f('0x12'),JSON['stringify'](_0x1001b5));_0x301df1[_0x957f('0x13')]();}}function _0xcc65d0(_0x334497){try{if(_0x334497){var _0xaeccbb=JSON['parse'](_0x334497);switch(_0xaeccbb['status']){case 0x0:if(_0xaeccbb['result']){if(_0xaeccbb['result'][_0x957f('0x14')]){logger[_0x957f('0x6')](_0x957f('0x15'),JSON[_0x957f('0xf')](_0xaeccbb[_0x957f('0x16')]['hypotheses']));_0x5037c2=_0xaeccbb['result']['hypotheses'][0x0][_0x957f('0x17')];_0x437de7=_0xaeccbb[_0x957f('0x16')]['hypotheses'][0x0]['likelihood'];_0x3a0eaa='0';_0x1ee4e1=_0x957f('0x18');_0x301df1['terminate']();}}break;case 0x1:logger['info'](_0x957f('0x8'));_0x3a0eaa='1';_0x1ee4e1=_0x957f('0x8');break;case 0x2:logger[_0x957f('0x6')](_0x957f('0x19'));_0x3a0eaa='2';_0x1ee4e1=_0x957f('0x19');break;case 0x9:logger[_0x957f('0x6')](_0x957f('0x1a'));_0x3a0eaa='9';_0x1ee4e1=_0x957f('0x1a');break;case 0xa:logger[_0x957f('0x6')]('Authentication\x20failed.');_0x3a0eaa='10';_0x1ee4e1=_0x957f('0x1b');break;case 0xb:logger[_0x957f('0x6')](_0x957f('0x1c'));_0x3a0eaa='11';_0x1ee4e1=_0x957f('0x1c');}}}catch(_0x3d4f34){logger[_0x957f('0x11')](_0x957f('0x1d'),JSON[_0x957f('0xf')](_0x3d4f34));_0x301df1['terminate']();}}function _0x31ed6d(){logger[_0x957f('0x6')]('Close\x20Tilde\x20ASR\x20socket');_0x45ce03({'transcript':_0x5037c2,'confidence':_0x437de7,'status':_0x3a0eaa,'status_message':_0x1ee4e1});}function _0x3e782b(_0x4191cb){logger['error'](_0x957f('0x1e'));if(!_[_0x957f('0x1f')](_0x4191cb)){logger[_0x957f('0x11')](_['isObject'](_0x4191cb)?JSON['stringify'](_0x4191cb):_0x4191cb);}}_0x301df1['on'](_0x957f('0x20'),_0x2e0daa);_0x301df1['on']('message',_0xcc65d0);_0x301df1['on'](_0x957f('0x21'),_0x31ed6d);_0x301df1['on'](_0x957f('0x11'),_0x3e782b);});};
\ No newline at end of file
+var _0x003f=['open','message','bluebird','lodash','crypto','../../../../../../config/logger','agi','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','result','final','info','hypotheses','transcript','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','Error\x20Tilde\x20ASR\x20socket','isObject'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x003f,0x9a));var _0xf003=function(_0x4a00fc,_0x477312){_0x4a00fc=_0x4a00fc-0x0;var _0x58e756=_0x003f[_0x4a00fc];return _0x58e756;};'use strict';var BPromise=require(_0xf003('0x0'));var _=require(_0xf003('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xf003('0x2'));var logger=require(_0xf003('0x3'))(_0xf003('0x4'));module[_0xf003('0x5')]=function(_0x3e9ea9,_0xe7133b,_0x1caf6b,_0x36ff4f){return new BPromise(function(_0x289604,_0x2f70ed){logger['info'](_0xf003('0x6'),_0x36ff4f||_0xf003('0x7'));var _0x51d6c7=new WebSocket(_0x36ff4f||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x22c338='';var _0x457d98='0';var _0x2e6d22='1';var _0xe1e0a9=_0xf003('0x8');function _0x5f0f90(_0x56f4b4){var _0x3ba913=crypto['createHash'](_0xf003('0x9'));_0x3ba913[_0xf003('0xa')](_0x56f4b4);return _0x3ba913[_0xf003('0xb')]('hex');}function _0x3ec177(){try{logger['info'](_0xf003('0xc'));var _0x2fa9fa=moment()[_0xf003('0xd')]();var _0x426479=_0x5f0f90(_0x2fa9fa+_0xe7133b+_0x1caf6b);_0x51d6c7[_0xf003('0xe')](JSON[_0xf003('0xf')]({'appID':_0xe7133b,'timestamp':_0x2fa9fa,'appKey':_0x426479}));var _0x4809d0=fs[_0xf003('0x10')](_0x3e9ea9);_0x4809d0['on']('data',function(_0x31783d){_0x51d6c7[_0xf003('0xe')](_0x31783d);});_0x4809d0['on'](_0xf003('0x11'),function(){_0x51d6c7[_0xf003('0xe')](_0xf003('0x12'));});}catch(_0x55a638){logger[_0xf003('0x13')](_0xf003('0x14'),JSON[_0xf003('0xf')](_0x55a638));_0x51d6c7[_0xf003('0x15')]();}}function _0x8f7e37(_0x67b9d1){try{if(_0x67b9d1){var _0x38c6f1=JSON['parse'](_0x67b9d1);switch(_0x38c6f1['status']){case 0x0:if(_0x38c6f1['result']){if(_0x38c6f1[_0xf003('0x16')][_0xf003('0x17')]){logger[_0xf003('0x18')]('Tilde\x20ASR\x20hypoteses',JSON[_0xf003('0xf')](_0x38c6f1[_0xf003('0x16')][_0xf003('0x19')]));_0x22c338=_0x38c6f1['result'][_0xf003('0x19')][0x0][_0xf003('0x1a')];_0x457d98=_0x38c6f1['result'][_0xf003('0x19')][0x0][_0xf003('0x1b')];_0x2e6d22='0';_0xe1e0a9=_0xf003('0x1c');_0x51d6c7[_0xf003('0x15')]();}}break;case 0x1:logger[_0xf003('0x18')](_0xf003('0x8'));_0x2e6d22='1';_0xe1e0a9=_0xf003('0x8');break;case 0x2:logger[_0xf003('0x18')](_0xf003('0x1d'));_0x2e6d22='2';_0xe1e0a9='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0xf003('0x18')](_0xf003('0x1e'));_0x2e6d22='9';_0xe1e0a9=_0xf003('0x1e');break;case 0xa:logger['info']('Authentication\x20failed.');_0x2e6d22='10';_0xe1e0a9=_0xf003('0x1f');break;case 0xb:logger[_0xf003('0x18')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x2e6d22='11';_0xe1e0a9=_0xf003('0x20');}}}catch(_0x1be9ae){logger[_0xf003('0x13')](_0xf003('0x21'),JSON[_0xf003('0xf')](_0x1be9ae));_0x51d6c7[_0xf003('0x15')]();}}function _0x5ca60d(){logger[_0xf003('0x18')]('Close\x20Tilde\x20ASR\x20socket');_0x289604({'transcript':_0x22c338,'confidence':_0x457d98,'status':_0x2e6d22,'status_message':_0xe1e0a9});}function _0x4cc1b6(_0x3d38f9){logger[_0xf003('0x13')](_0xf003('0x22'));if(!_['isNil'](_0x3d38f9)){logger[_0xf003('0x13')](_[_0xf003('0x23')](_0x3d38f9)?JSON['stringify'](_0x3d38f9):_0x3d38f9);}}_0x51d6c7['on'](_0xf003('0x24'),_0x3ec177);_0x51d6c7['on'](_0xf003('0x25'),_0x8f7e37);_0x51d6c7['on'](_0xf003('0x11'),_0x5ca60d);_0x51d6c7['on'](_0xf003('0x13'),_0x4cc1b6);});};
\ No newline at end of file
index c9241a1..d57b397 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8f3d=['./asr','exports'];(function(_0x1e3671,_0x9ae4fc){var _0x48d5f5=function(_0xfab713){while(--_0xfab713){_0x1e3671['push'](_0x1e3671['shift']());}};_0x48d5f5(++_0x9ae4fc);}(_0x8f3d,0xa8));var _0xd8f3=function(_0x836478,_0xe5914b){_0x836478=_0x836478-0x0;var _0x514664=_0x8f3d[_0x836478];return _0x514664;};var asr=require(_0xd8f3('0x0'));module[_0xd8f3('0x1')]={'asr':asr};
\ No newline at end of file
+var _0x4856=['./asr','exports'];(function(_0x4f4bb8,_0x32e15d){var _0xf6e91f=function(_0x2d1fd6){while(--_0x2d1fd6){_0x4f4bb8['push'](_0x4f4bb8['shift']());}};_0xf6e91f(++_0x32e15d);}(_0x4856,0x12c));var _0x6485=function(_0x2a7210,_0x2f3d23){_0x2a7210=_0x2a7210-0x0;var _0x460766=_0x4856[_0x2a7210];return _0x460766;};var asr=require(_0x6485('0x0'));module[_0x6485('0x1')]={'asr':asr};
\ No newline at end of file
index 1e4498b..fe8ae04 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa49d=['createServer','listen','emit','listening','connection','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','close','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','./error','./channel','127.0.0.1','call','error'];(function(_0x56ef1e,_0x3226f2){var _0x19e171=function(_0x5d9414){while(--_0x5d9414){_0x56ef1e['push'](_0x56ef1e['shift']());}};_0x19e171(++_0x3226f2);}(_0xa49d,0x142));var _0xda49=function(_0x28caa5,_0x5643e0){_0x28caa5=_0x28caa5-0x0;var _0x1e0d91=_0xa49d[_0x28caa5];return _0x1e0d91;};'use strict';var util=require(_0xda49('0x0'));var net=require(_0xda49('0x1'));var EventEmitter=require(_0xda49('0x2'))['EventEmitter'];var AGIError=require(_0xda49('0x3'));var AGIChannel=require(_0xda49('0x4'));var AGIServer=function(_0x4c0021,_0x13822a,_0x570db9){var _0x5127ff=this,_0x4c0021=_0x4c0021||0x11dd,_0x13822a=_0x13822a||_0xda49('0x5'),_0x148ecd=null,_0xaea5f2=0x0;EventEmitter[_0xda49('0x6')](_0x5127ff);function _0x3eeb2d(){if(!_0x4c0021){_0x5127ff['emit'](_0xda49('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x148ecd=net[_0xda49('0x8')]();_0x148ecd[_0xda49('0x9')](_0x4c0021,_0x13822a);_0x148ecd['on']('listening',function(){_0x5127ff[_0xda49('0xa')](_0xda49('0xb'));});_0x148ecd['on'](_0xda49('0xc'),function(_0xf39a23){_0x148ecd[_0xda49('0xd')](function(_0x1d91b0,_0x10e12a){if(_0x1d91b0){_0x5127ff[_0xda49('0xa')]('error',new AGIError(_0xda49('0xe'),_0x1d91b0));}else if(_0x570db9&&_0x570db9<0x0){_0x5127ff[_0xda49('0xa')](_0xda49('0x7'),new AGIError(_0xda49('0xf')));_0xf39a23[_0xda49('0x10')]();}else if(_0x570db9&&_0x570db9>0x0&&_0x570db9<_0x10e12a){_0xaea5f2+=0x1;_0x5127ff[_0xda49('0xa')](_0xda49('0x7'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0xaea5f2));_0xf39a23['destroy']();}else{var _0x1ce8fe=new AGIChannel(_0xf39a23);_0x1ce8fe['on']('ready',function(){_0x5127ff[_0xda49('0xa')]('connection',_0x1ce8fe);});}});});_0x148ecd['on'](_0xda49('0x7'),function(_0x32e0bc){_0x5127ff['emit']('error',new AGIError(_0xda49('0xe'),_0x32e0bc['code']));});_0x148ecd['on'](_0xda49('0x11'),function(){_0x5127ff[_0xda49('0xa')](_0xda49('0x11'),new AGIError(_0xda49('0x12')));});}process[_0xda49('0x13')](function(){_0x3eeb2d();});};util[_0xda49('0x14')](AGIServer,EventEmitter);module[_0xda49('0x15')]=function(_0x532890,_0x2d0dd2,_0x1c8981){return new AGIServer(_0x532890,_0x2d0dd2,_0x1c8981);};
\ No newline at end of file
+var _0x30ac=['call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','E_AGI_SERVER_CLOSE','nextTick','inherits','exports','util','net','events','EventEmitter','./error','./channel','127.0.0.1'];(function(_0x13b6fc,_0x539ca2){var _0x5079aa=function(_0x45158f){while(--_0x45158f){_0x13b6fc['push'](_0x13b6fc['shift']());}};_0x5079aa(++_0x539ca2);}(_0x30ac,0x191));var _0xc30a=function(_0x55e1d1,_0x3c9376){_0x55e1d1=_0x55e1d1-0x0;var _0x1165db=_0x30ac[_0x55e1d1];return _0x1165db;};'use strict';var util=require(_0xc30a('0x0'));var net=require(_0xc30a('0x1'));var EventEmitter=require(_0xc30a('0x2'))[_0xc30a('0x3')];var AGIError=require(_0xc30a('0x4'));var AGIChannel=require(_0xc30a('0x5'));var AGIServer=function(_0x1226d6,_0x1f845a,_0x174af7){var _0x8c45a=this,_0x1226d6=_0x1226d6||0x11dd,_0x1f845a=_0x1f845a||_0xc30a('0x6'),_0x59e5e3=null,_0x52ffa4=0x0;EventEmitter[_0xc30a('0x7')](_0x8c45a);function _0x24f1cf(){if(!_0x1226d6){_0x8c45a[_0xc30a('0x8')](_0xc30a('0x9'),new AGIError(_0xc30a('0xa')));return![];}_0x59e5e3=net[_0xc30a('0xb')]();_0x59e5e3[_0xc30a('0xc')](_0x1226d6,_0x1f845a);_0x59e5e3['on'](_0xc30a('0xd'),function(){_0x8c45a[_0xc30a('0x8')]('listening');});_0x59e5e3['on']('connection',function(_0x4f3cc3){_0x59e5e3['getConnections'](function(_0x44a162,_0x49dd66){if(_0x44a162){_0x8c45a[_0xc30a('0x8')](_0xc30a('0x9'),new AGIError('E_AGI_SERVER_ERROR',_0x44a162));}else if(_0x174af7&&_0x174af7<0x0){_0x8c45a['emit']('error',new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x4f3cc3[_0xc30a('0xe')]();}else if(_0x174af7&&_0x174af7>0x0&&_0x174af7<_0x49dd66){_0x52ffa4+=0x1;_0x8c45a['emit'](_0xc30a('0x9'),new AGIError(_0xc30a('0xf'),_0x52ffa4));_0x4f3cc3['destroy']();}else{var _0x5b7c8b=new AGIChannel(_0x4f3cc3);_0x5b7c8b['on'](_0xc30a('0x10'),function(){_0x8c45a[_0xc30a('0x8')](_0xc30a('0x11'),_0x5b7c8b);});}});});_0x59e5e3['on'](_0xc30a('0x9'),function(_0xdf1b78){_0x8c45a['emit'](_0xc30a('0x9'),new AGIError(_0xc30a('0x12'),_0xdf1b78[_0xc30a('0x13')]));});_0x59e5e3['on']('close',function(){_0x8c45a['emit']('close',new AGIError(_0xc30a('0x14')));});}process[_0xc30a('0x15')](function(){_0x24f1cf();});};util[_0xc30a('0x16')](AGIServer,EventEmitter);module[_0xc30a('0x17')]=function(_0x5ce147,_0x3bbfa7,_0x21e4b2){return new AGIServer(_0x5ce147,_0x3bbfa7,_0x21e4b2);};
\ No newline at end of file
index c18147a..4ed95e4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x47c5=['toUpperCase','body','parse','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','dialogflowV2_project_id','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','clear','clone','replaceObjectAllVariables','hasOwnProperty','isPlainObject','recursiveNodeIndex','isArray','length','isString','%s.%s','saveRestApiResult','replaceAllVariables','split','replaceAll','extra','getAndSetVariable','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','setVariable','maxRetry','sync','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','result','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','delay','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','SIP/%s','opts','url','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','googleDialogflowV2','providerResponse','DIALOGFLOW_%s','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','SESTEK_NDA_%s','audiofile','streamFile','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','getData','maxdigit','mindigit','hiddendigitsnum','hiddendigitspos','first','substr','generate','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','aws\x20Polly\x20%s\x20file\x20created','unlink','.wav','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','recordFile','intKey','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','wav','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','false','EVAL\x20CONDITION\x20%s\x20%s','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','true','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','beep','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','agentLogout','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','forEach','%s[%s]','variable\x20%s[key]\x20set','no\x20file\x20audio\x20found','digit','no\x20variable\x20found','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','toLowerCase','macro','gosub','position','QUEUE','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s/recordings/%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','Response:','no\x20variable\x20selected\x20for\x20the\x20response','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','auth','template_id','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','createSmsMessage','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','yes','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','Executed\x20command\x20%s\x20%s','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','path','util','lodash','shelljs','odbc','randomstring','mustache','request-promise','agi','../../config/environment','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','then','catch','getVoiceQueue','getVoiceQueueById','name','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','info','Error\x20executing\x20query\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','accountcode','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','callback_priority','getPause','getPauseById','agentPause','agentUnpause','agent','%s/%s@from-sip/n','LOCAL','agentLogin','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','googleTTS','google_tts_language','restAPI','timeout','number','includes','POST','PUT','method'];(function(_0x466db3,_0x36316d){var _0x143e1e=function(_0x528f31){while(--_0x528f31){_0x466db3['push'](_0x466db3['shift']());}};_0x143e1e(++_0x36316d);}(_0x47c5,0x165));var _0x547c=function(_0x5f1617,_0x46277b){_0x5f1617=_0x5f1617-0x0;var _0x3af5da=_0x47c5[_0x5f1617];return _0x3af5da;};'use strict';var fs=require('fs');var path=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var _=require(_0x547c('0x2'));var sh=require(_0x547c('0x3'));var odbc=require(_0x547c('0x4'))();var rs=require(_0x547c('0x5'));var moment=require('moment');var Mustache=require(_0x547c('0x6'));var rp=require(_0x547c('0x7'));var logger=require('../../config/logger')(_0x547c('0x8'));var config=require(_0x547c('0x9'));var scripts=require('./scripts');var FILES_PATH=_0x547c('0xa');var recursiveMapAttributes=[_0x547c('0xb'),_0x547c('0xc')];var verticesWithRetry=[_0x547c('0xd'),_0x547c('0xe'),_0x547c('0xf')];var AGIVertices=function(_0x3e2279,_0x40be25,_0x10dec9){this[_0x547c('0x10')]=_0x3e2279;this[_0x547c('0x11')]=_0x40be25;this[_0x547c('0x12')]=_0x10dec9;};AGIVertices[_0x547c('0x13')][_0x547c('0x14')]=function(_0x386e2c,_0x8addbe){this[_0x547c('0x11')]['getVariableById'](_0x386e2c)[_0x547c('0x15')](function(_0x39dce7){_0x8addbe(null,_0x39dce7?_0x39dce7['name']:![]);})[_0x547c('0x16')](function(_0x201d95){_0x8addbe(_0x201d95);});};AGIVertices[_0x547c('0x13')][_0x547c('0x17')]=function(_0x392a35,_0x150317){this[_0x547c('0x11')][_0x547c('0x18')](_0x392a35)[_0x547c('0x15')](function(_0x161991){_0x150317(null,_0x161991?_0x161991[_0x547c('0x19')]:![]);})[_0x547c('0x16')](function(_0x39f316){_0x150317(_0x39f316);});};AGIVertices[_0x547c('0x13')][_0x547c('0x1a')]=function(_0xf32cdd,_0x39498d){this[_0x547c('0x11')]['getSquareProjectById'](_0xf32cdd)['then'](function(_0x23fa9e){_0x39498d(null,_0x23fa9e?_0x23fa9e[_0x547c('0x19')]:![]);})[_0x547c('0x16')](function(_0x4a8901){_0x39498d(_0x4a8901);});};AGIVertices[_0x547c('0x13')][_0x547c('0x1b')]=function(_0x1ddbd3,_0x58ddc9){this[_0x547c('0x11')][_0x547c('0x1c')](_0x1ddbd3)['then'](function(_0x5453f9){_0x58ddc9(null,_0x5453f9?_0x5453f9[_0x547c('0x1d')]:![]);})[_0x547c('0x16')](function(_0x4f20c1){_0x58ddc9(_0x4f20c1);});};AGIVertices[_0x547c('0x13')][_0x547c('0x1e')]=function(_0x592e46,_0x2e317a){this[_0x547c('0x11')][_0x547c('0x1f')](_0x592e46)['then'](function(_0x3a55a0){_0x2e317a(null,_0x3a55a0?_0x3a55a0[_0x547c('0x19')]:![]);})[_0x547c('0x16')](function(_0x26823c){_0x2e317a(_0x26823c);});};AGIVertices[_0x547c('0x13')][_0x547c('0x20')]=function(_0x2ab2cc,_0x17fa33){this['rpc'][_0x547c('0x21')](_0x2ab2cc)['then'](function(_0x5b05f2){_0x17fa33(null,_0x5b05f2?_0x5b05f2['name']:![]);})['catch'](function(_0x2c725d){_0x17fa33(_0x2c725d);});};AGIVertices['prototype'][_0x547c('0x22')]=function(_0x5729b0,_0x3ea493){var _0x486216=this;this[_0x547c('0x11')][_0x547c('0x23')](_0x5729b0)[_0x547c('0x15')](function(_0x30a96c){_0x3ea493(null,_0x30a96c?_0x486216[_0x547c('0x24')](_0x30a96c['save_name']):![]);})['catch'](function(_0x28c282){_0x3ea493(_0x28c282);});};AGIVertices['prototype'][_0x547c('0x25')]=function(_0xed2d39,_0x3e7652){this[_0x547c('0x11')][_0x547c('0x26')](_0xed2d39)[_0x547c('0x15')](function(_0x342c10){_0x3e7652(null,_0x342c10?_0x342c10:![]);})['catch'](function(_0x54f6a8){_0x3e7652(_0x54f6a8);});};AGIVertices[_0x547c('0x13')][_0x547c('0x27')]=function(_0x1e4313,_0x26850a,_0x1b8c17){this[_0x547c('0x12')][_0x547c('0x27')](_0x1e4313,_0x26850a)[_0x547c('0x15')](function(){_0x1b8c17(null);})[_0x547c('0x16')](function(_0x31026e){_0x1b8c17(_0x31026e);});};AGIVertices[_0x547c('0x13')][_0x547c('0x28')]=function(_0x243cb,_0x385275){this['rpc'][_0x547c('0x29')](_0x243cb)['then'](function(_0x4ad00e){if(_0x4ad00e){if(_0x4ad00e['IntervalId']){_0x385275(null,[_0x4ad00e[_0x547c('0x2a')]]);}else{_0x385275(null,_[_0x547c('0x2b')](_0x4ad00e[_0x547c('0x2c')],_0x547c('0x2a')));}}else{_0x385275(null,![]);}})[_0x547c('0x16')](function(_0x45f724){_0x385275(_0x45f724);});};AGIVertices['prototype']['getSoundPath']=function(_0x5ea2c7){return util[_0x547c('0x2d')](_0x547c('0x2e'),FILES_PATH,_0x5ea2c7);};AGIVertices[_0x547c('0x13')][_0x547c('0x2f')]=function(_0xe0352c,_0x185465,_0x57ce3b){odbc[_0x547c('0x30')](_0xe0352c,function(_0x4e2e52){if(_0x4e2e52){logger[_0x547c('0x31')](_0x547c('0x32'),_0x4e2e52);_0x57ce3b(_0x4e2e52);}else{logger['info'](_0x547c('0x33'));odbc['query'](_0x185465,function(_0x511103,_0x3137e0){if(_0x511103){logger[_0x547c('0x34')](_0x547c('0x35'),_0x185465);_0x57ce3b(_0x511103);}else{logger[_0x547c('0x34')]('Query\x20executed\x20correctly\x20%s',_0x185465);odbc['close'](function(_0xe5f1b9){if(_0xe5f1b9){logger[_0x547c('0x31')](_0x547c('0x36'),_0xe5f1b9);}_0x57ce3b(null,_0x3137e0);});}});}});};AGIVertices['prototype'][_0x547c('0x37')]=function(_0x21838a,_0x4746ee){this['rpc'][_0x547c('0x38')](_0x21838a)[_0x547c('0x15')](function(_0xbb08e7){_0x4746ee(null,_0xbb08e7?_0xbb08e7:![]);})['catch'](function(_0x26e8d2){_0x4746ee(_0x26e8d2);});};AGIVertices[_0x547c('0x13')]['createSmsMessage']=function(_0x26ea8c,_0x23c8b2){this[_0x547c('0x11')]['createSmsMessage'](_0x26ea8c)[_0x547c('0x15')](function(_0x4f2859){_0x23c8b2(null,_0x4f2859);})[_0x547c('0x16')](function(_0x5393a2){_0x23c8b2(_0x5393a2);});};AGIVertices[_0x547c('0x13')][_0x547c('0x39')]=function(_0x3d37d7,_0x3797d3,_0x139a61){this[_0x547c('0x11')]['createSquareDetailsReport']({'uniqueid':this['channel'][_0x547c('0x3a')],'node':_0x3d37d7[_0x547c('0x3b')],'application':_0x3d37d7[_0x547c('0x3c')],'data':_0x3797d3||null,'project_name':this['channel'][_0x547c('0x3d')],'callerid':this[_0x547c('0x10')][_0x547c('0x3e')]})[_0x547c('0x15')](function(_0x1e4ab7){if(_0x139a61){_0x139a61(null,_0x1e4ab7);}})[_0x547c('0x16')](function(_0x4adb6f){if(_0x139a61){_0x139a61(_0x4adb6f);}});};AGIVertices[_0x547c('0x13')][_0x547c('0x3f')]=function(_0x3d7088,_0x4c4287,_0x291302,_0x478320){this[_0x547c('0x11')][_0x547c('0x3f')]({'uniqueid':this['channel'][_0x547c('0x3a')],'callerid':this['channel'][_0x547c('0x3e')],'calleridname':this['channel'][_0x547c('0x40')],'context':this[_0x547c('0x10')]['context'],'extension':this[_0x547c('0x10')][_0x547c('0x41')],'priority':this[_0x547c('0x10')][_0x547c('0x42')],'accountcode':this['channel'][_0x547c('0x43')],'dnid':this['channel']['dnid'],'projectName':this[_0x547c('0x10')][_0x547c('0x3d')],'saveName':_0x4c4287,'filename':_0x3d7088[_0x547c('0x44')]||_0x4c4287,'savePath':_0x291302})[_0x547c('0x15')](function(_0x1daaf4){_0x478320(null,_0x1daaf4);})[_0x547c('0x16')](function(_0x153392){_0x478320(_0x153392);});};AGIVertices[_0x547c('0x13')][_0x547c('0x45')]=function(_0x31a262,_0x25b267,_0x38b2bc,_0x503b41,_0x4a0f42){this[_0x547c('0x11')][_0x547c('0x45')]({'uniqueid':this['channel'][_0x547c('0x3a')],'body':_0x31a262,'direction':_0x25b267,'providerName':_0x38b2bc,'providerResponse':_0x503b41})[_0x547c('0x15')](function(_0x3ab131){if(_0x4a0f42){_0x4a0f42(null,_0x3ab131);}})[_0x547c('0x16')](function(_0x30680d){if(_0x4a0f42){_0x4a0f42(_0x30680d);}});};AGIVertices[_0x547c('0x13')]['createCmContact']=function(_0x152982,_0x5258cf){this[_0x547c('0x11')][_0x547c('0x46')]({'firstName':_[_0x547c('0x47')](_0x152982['name'])||_[_0x547c('0x48')](_0x152982['name'])?_0x547c('0x49')+Math[_0x547c('0x4a')]():_0x152982['name'],'lastName':_[_0x547c('0x47')](_0x152982[_0x547c('0x4b')])||_[_0x547c('0x48')](_0x152982[_0x547c('0x4b')])?null:_0x152982[_0x547c('0x4b')],'phone':_0x152982[_0x547c('0x4c')],'ListId':_0x152982[_0x547c('0x4d')],'scheduledat':_0x152982['scheduledAt'],'callbackUniqueid':this[_0x547c('0x10')]['uniqueid'],'tags':_0x547c('0x4e'),'description':_0x547c('0x4f')+_0x152982[_0x547c('0x50')][_0x547c('0x51')](),'priority':_0x152982[_0x547c('0x52')]})['then'](function(_0x369fb0){_0x5258cf(null,_0x369fb0);})['catch'](function(_0x124222){_0x5258cf(_0x124222);});};AGIVertices[_0x547c('0x13')][_0x547c('0x53')]=function(_0x2b14e0,_0x347536){this['rpc'][_0x547c('0x54')](_0x2b14e0)[_0x547c('0x15')](function(_0x4efdd5){_0x347536(null,_0x4efdd5?_0x4efdd5[_0x547c('0x19')]:![]);})[_0x547c('0x16')](function(_0x22e016){_0x347536(_0x22e016);});};AGIVertices[_0x547c('0x13')]['agentPause']=function(_0x52d134,_0x56125c,_0x188363){var _0x455467={'role':'agent'};_0x455467[_0x52d134]=this[_0x547c('0x10')]['callerid'];this[_0x547c('0x11')][_0x547c('0x55')](_0x455467,_0x56125c,this[_0x547c('0x10')][_0x547c('0x3a')])[_0x547c('0x15')](function(_0x423889){_0x188363(null,_[_0x547c('0x48')](_0x423889)?![]:!![]);})['catch'](function(_0x5746ee){logger[_0x547c('0x31')](_0x5746ee);_0x188363(null,![]);});};AGIVertices[_0x547c('0x13')][_0x547c('0x56')]=function(_0x64bf1e,_0xd3b584){var _0x50582e={'role':'agent'};_0x50582e[_0x64bf1e]=this['channel']['callerid'];this['rpc'][_0x547c('0x56')](_0x50582e)[_0x547c('0x15')](function(_0xe32d09){_0xd3b584(null,_['isNil'](_0xe32d09)?![]:!![]);})[_0x547c('0x16')](function(_0x1f901b){logger[_0x547c('0x31')](_0x1f901b);_0xd3b584(null,![]);});};AGIVertices[_0x547c('0x13')]['agentLogout']=function(_0x4ab718,_0x5c395d){var _0xa66eee={'role':_0x547c('0x57')};_0xa66eee[_0x4ab718]=this[_0x547c('0x10')][_0x547c('0x3e')];this[_0x547c('0x11')]['agentLogout'](_0xa66eee)['then'](function(_0x1e2826){_0x5c395d(null,_[_0x547c('0x48')](_0x1e2826)?![]:!![]);})[_0x547c('0x16')](function(_0x70451){logger[_0x547c('0x31')](_0x70451);_0x5c395d(null,![]);});};AGIVertices['prototype']['agentLogin']=function(_0x531892,_0x244e32){var _0x48f519={'role':_0x547c('0x57')};_0x48f519[_0x531892]=this[_0x547c('0x10')][_0x547c('0x3e')];var _0x50f4e6=_0x531892!='internal'?util[_0x547c('0x2d')](_0x547c('0x58'),_0x547c('0x59'),this[_0x547c('0x10')][_0x547c('0x3e')]):undefined;this[_0x547c('0x11')][_0x547c('0x5a')](_0x48f519,_0x50f4e6)['then'](function(_0x310243){_0x244e32(null,_[_0x547c('0x48')](_0x310243)?![]:!![]);})[_0x547c('0x16')](function(_0x6bf96d){logger[_0x547c('0x31')](_0x6bf96d);_0x244e32(null,![]);});};AGIVertices[_0x547c('0x13')][_0x547c('0x5b')]=function(_0x4066ce,_0x49dc3c){sh[_0x547c('0x5c')](_[_0x547c('0x5d')](_0x4066ce),function(_0x1dedca,_0xe3e820){var _0x4f0ed4=_0xe3e820[_0x547c('0x5e')](/(\r\n|\n|\r)/gm,'');_0x49dc3c(null,_0x4f0ed4);});};AGIVertices[_0x547c('0x13')][_0x547c('0x5f')]=function(_0x4e2acc,_0x52cccd){scripts['googleCloudTTS'](_0x4e2acc[_0x547c('0x60')],_0x4e2acc[_0x547c('0x61')]||_0x547c('0x62'),_0x4e2acc['text'],_0x4e2acc[_0x547c('0x63')]||_0x547c('0x64'),_0x4e2acc[_0x547c('0x65')]||_0x547c('0x66'),_0x4e2acc['audioEncoding']||'MP3')[_0x547c('0x15')](function(_0x5e41e4){_0x52cccd(null,_0x5e41e4);})[_0x547c('0x16')](function(_0x393204){_0x52cccd(_0x393204);});};AGIVertices['prototype'][_0x547c('0x67')]=function(_0x4edded,_0x1566d6){scripts[_0x547c('0x67')](_0x4edded['text'],_0x4edded[_0x547c('0x68')]||'en',0x1)[_0x547c('0x15')](function(_0xdd0ebc){_0x1566d6(null,_0xdd0ebc);})[_0x547c('0x16')](function(_0x4c7e53){_0x1566d6(_0x4c7e53);});};AGIVertices['prototype'][_0x547c('0x69')]=function(_0x165bfe,_0x358aed){var _0x3378a3={'uri':_0x165bfe['url'],'method':_0x165bfe['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x165bfe[_0x547c('0x6a')])===_0x547c('0x6b')&&parseInt(_0x165bfe[_0x547c('0x6a')])>=0x1?parseInt(_0x165bfe[_0x547c('0x6a')])*0x3e8:0x5*0x3e8};if(_[_0x547c('0x6c')]([_0x547c('0x6d'),_0x547c('0x6e')],_0x3378a3[_0x547c('0x6f')][_0x547c('0x70')]())){try{_0x3378a3[_0x547c('0x71')]=_0x165bfe[_0x547c('0xc')]?JSON[_0x547c('0x72')](_0x165bfe[_0x547c('0xc')]):{};}catch(_0x4e038b){logger['error']('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x4e038b);}}try{_0x3378a3[_0x547c('0x73')]=_0x165bfe['rawHeaders']?JSON['parse'](_0x165bfe[_0x547c('0xb')]):{};}catch(_0x5cbef2){logger['error'](_0x547c('0x74'),_0x5cbef2);}if(_0x165bfe[_0x547c('0x75')]){try{var _0x2ab7d3=require(_0x165bfe[_0x547c('0x75')])['sync'](this,_0x3378a3);_0x3378a3[_0x547c('0x76')]=Mustache[_0x547c('0x77')](_0x165bfe['url'],_0x2ab7d3,{},['$$','$$']);if(_0x3378a3['headers']){_0x3378a3[_0x547c('0x73')]=JSON[_0x547c('0x72')](Mustache[_0x547c('0x77')](JSON[_0x547c('0x78')](_0x3378a3[_0x547c('0x73')]),_0x2ab7d3,{},['$$','$$']));}if(_0x3378a3[_0x547c('0x71')]){_0x3378a3[_0x547c('0x71')]=JSON[_0x547c('0x72')](Mustache['render'](JSON[_0x547c('0x78')](_0x3378a3[_0x547c('0x71')]),_0x2ab7d3,{},['$$','$$']));}}catch(_0x1fd7d1){logger['error'](_0x547c('0x79'),_0x1fd7d1);}}rp(_0x3378a3)[_0x547c('0x15')](function(_0x2cb2ff){var _0x1fa904={'statusCode':_0x2cb2ff[_0x547c('0x7a')]||0xc8,'statusMessage':_0x2cb2ff[_0x547c('0x7b')]||'OK','headers':_0x2cb2ff[_0x547c('0x73')]||{},'body':_0x2cb2ff[_0x547c('0x71')]||{}};_0x358aed(null,_0x1fa904);})[_0x547c('0x16')](function(_0x7a72fd){var _0x73eb72={'statusCode':_0x7a72fd[_0x547c('0x7a')]||0x1f4,'statusMessage':_0x7a72fd[_0x547c('0x7c')]||_0x547c('0x7d'),'headers':_0x7a72fd['options'][_0x547c('0x73')]||{},'body':_0x7a72fd[_0x547c('0x7e')][_0x547c('0x71')]||{}};_0x358aed(null,_0x73eb72);});};AGIVertices['prototype'][_0x547c('0x7f')]=function(_0x19927b,_0x185176){scripts[_0x547c('0x7f')](this[_0x547c('0x10')][_0x547c('0x3a')],_0x19927b[_0x547c('0x80')],_0x19927b[_0x547c('0x62')],_0x19927b[_0x547c('0x81')]||'en')[_0x547c('0x15')](function(_0x224f62){_0x185176(null,_0x224f62);})[_0x547c('0x16')](function(_0x3a988f){_0x185176(_0x3a988f);});};AGIVertices['prototype']['googleDialogflowV2']=function(_0x4d8594,_0x588e2b){scripts['googleDialogflowV2'](this['channel'][_0x547c('0x3a')],_0x4d8594[_0x547c('0x82')],_0x4d8594[_0x547c('0x83')],_0x4d8594[_0x547c('0x84')],_0x4d8594['text'],_0x4d8594[_0x547c('0x85')]||'en')[_0x547c('0x15')](function(_0x27410e){_0x588e2b(null,_0x27410e);})['catch'](function(_0x4607f4){_0x588e2b(_0x4607f4);});};AGIVertices[_0x547c('0x13')][_0x547c('0x86')]=function(_0x53a0a7,_0x51f200){scripts['sestekNDA'](this[_0x547c('0x10')],_0x53a0a7)['then'](function(_0x41e2c2){_0x51f200(null,_0x41e2c2);})[_0x547c('0x16')](function(_0x58d2b3){_0x51f200(_0x58d2b3);});};AGIVertices[_0x547c('0x13')][_0x547c('0x87')]=function(_0x168b42,_0x3f54cf){scripts[_0x547c('0x87')](_0x168b42['key'],_0x168b42[_0x547c('0x62')],_0x168b42['ispeech_tts_language']||_0x547c('0x64'),_0x168b42[_0x547c('0x88')])[_0x547c('0x15')](function(_0x1dfce9){_0x3f54cf(null,_0x1dfce9);})['catch'](function(_0x1e8cd7){_0x3f54cf(_0x1e8cd7);});};AGIVertices['prototype'][_0x547c('0x89')]=function(_0x8eb70e,_0x506426,_0x348ef8){scripts['ispeechASR'](_0x506426,_0x8eb70e[_0x547c('0x80')],_0x8eb70e[_0x547c('0x8a')]||_0x547c('0x64'),this[_0x547c('0x8b')](_0x8eb70e['model'])?_0x8eb70e[_0x547c('0x8c')]:undefined)[_0x547c('0x15')](function(_0xea441b){_0x348ef8(null,_0xea441b);})[_0x547c('0x16')](function(_0x2febce){_0x348ef8(_0x2febce);});};AGIVertices['prototype'][_0x547c('0x8d')]=function(_0x36d1b0,_0x28cbee){scripts['awsPolly'](_0x36d1b0[_0x547c('0x8e')],_0x36d1b0[_0x547c('0x8f')],_0x36d1b0[_0x547c('0x90')],_0x36d1b0[_0x547c('0x91')]||'Amy',_0x36d1b0[_0x547c('0x62')],_0x36d1b0['aws_text_type']||_0x547c('0x62'))['then'](function(_0x196128){_0x28cbee(null,_0x196128);})[_0x547c('0x16')](function(_0xc17a4d){_0x28cbee(_0xc17a4d);});};AGIVertices[_0x547c('0x13')][_0x547c('0x92')]=function(_0x2b314d,_0x48bb39){scripts['awsLex'](this['channel'][_0x547c('0x3a')],_0x2b314d[_0x547c('0x8e')],_0x2b314d[_0x547c('0x8f')],_0x2b314d[_0x547c('0x93')],_0x2b314d['text'],_0x2b314d[_0x547c('0x94')])['then'](function(_0xbd5c0e){_0x48bb39(null,_0xbd5c0e);})[_0x547c('0x16')](function(_0x7edc0f){_0x48bb39(_0x7edc0f);});};AGIVertices[_0x547c('0x13')][_0x547c('0x95')]=function(_0x15778c,_0x51e60a,_0x40bc73){scripts['googleASR'](_0x51e60a,_0x15778c[_0x547c('0x80')],_0x15778c[_0x547c('0x96')]||'en-US')[_0x547c('0x15')](function(_0x141f89){_0x40bc73(null,_0x141f89);})[_0x547c('0x16')](function(_0x1fe6a2){_0x40bc73(_0x1fe6a2);});};AGIVertices[_0x547c('0x13')][_0x547c('0x97')]=function(_0x24339b,_0x59bc57,_0xcdd93f){scripts[_0x547c('0x97')](_0x59bc57,_0x24339b[_0x547c('0x98')],_0x24339b['appsecret'],_0x24339b[_0x547c('0x76')])['then'](function(_0x1a29ca){_0xcdd93f(null,_0x1a29ca);})['catch'](function(_0x44b5e9){_0xcdd93f(_0x44b5e9);});};AGIVertices[_0x547c('0x13')][_0x547c('0x99')]=function(_0x13bbfe){var _0x515220=_[_0x547c('0x6c')](verticesWithRetry,_0x13bbfe[_0x547c('0x3c')])?_0x13bbfe:_[_0x547c('0x9a')](_0x13bbfe);for(var _0x358ca1 in _0x515220){if(_0x515220['hasOwnProperty'](_0x358ca1)){if(_0x515220[_0x358ca1]&&_['isString'](_0x515220[_0x358ca1])){if(_[_0x547c('0x6c')](recursiveMapAttributes,_0x358ca1)){_0x515220[_0x358ca1]=this[_0x547c('0x9b')](_0x515220[_0x358ca1]);}else{_0x515220[_0x358ca1]=this['replaceAllVariables'](_0x515220[_0x358ca1]);}}}}return _0x515220;};AGIVertices[_0x547c('0x13')]['recursiveNodeIndex']=function(_0x4c91fe){for(var _0x5c4b10 in _0x4c91fe){if(_0x4c91fe[_0x547c('0x9c')](_0x5c4b10)){if(_[_0x547c('0x9d')](_0x4c91fe[_0x5c4b10])){this[_0x547c('0x9e')](_0x4c91fe[_0x5c4b10]);}else if(_[_0x547c('0x9f')](_0x4c91fe[_0x5c4b10])){for(var _0x508a62=0x0;_0x508a62<_0x4c91fe[_0x5c4b10][_0x547c('0xa0')];_0x508a62++){this[_0x547c('0x9e')](_0x4c91fe[_0x5c4b10][_0x508a62]);}}else if(_[_0x547c('0xa1')](_0x4c91fe[_0x5c4b10])){_0x4c91fe[_0x5c4b10]=this['replaceAllVariables'](_0x4c91fe[_0x5c4b10]);}}}};AGIVertices[_0x547c('0x13')]['saveRestApiResult']=function(_0x90de50,_0x3ffc1e){for(var _0xc648f4 in _0x90de50){if(_0x90de50['hasOwnProperty'](_0xc648f4)){if(_[_0x547c('0x9d')](_0x90de50[_0xc648f4])){if(!_[_0x547c('0x47')](_0x90de50[_0xc648f4])){this['saveRestApiResult'](_0x90de50[_0xc648f4],util[_0x547c('0x2d')](_0x547c('0xa2'),_0x3ffc1e,_0xc648f4));}}else if(_[_0x547c('0x9f')](_0x90de50[_0xc648f4])){for(var _0x2fb055=0x0;_0x2fb055<_0x90de50[_0xc648f4][_0x547c('0xa0')];_0x2fb055++){this[_0x547c('0xa3')](_0x90de50[_0xc648f4][_0x2fb055],util[_0x547c('0x2d')](_0x547c('0xa2'),_0x3ffc1e,_0xc648f4+'['+_0x2fb055+']'));}}else{if(!_[_0x547c('0x48')](_0x90de50[_0xc648f4])){this[_0x547c('0x10')]['setVariable'](util['format'](_0x547c('0xa2'),_0x3ffc1e,_0xc648f4),_0x90de50[_0xc648f4]);}}}}};AGIVertices['prototype'][_0x547c('0x9b')]=function(_0x557e76){try{var _0x66a70c=JSON[_0x547c('0x72')](_0x557e76);this[_0x547c('0x9e')](_0x66a70c);return JSON[_0x547c('0x78')](_0x66a70c);}catch(_0x2c962d){return this[_0x547c('0xa4')](_0x557e76);}};AGIVertices[_0x547c('0x13')]['replaceAllVariables']=function(_0x180b89){var _0x23701c=_0x180b89[_0x547c('0xa5')]('{');for(var _0x436c13=0x1;_0x436c13<_0x23701c[_0x547c('0xa0')];_0x436c13+=0x1){var _0x3fa33c=_0x23701c[_0x436c13][_0x547c('0xa5')]('}');if(_0x3fa33c[_0x547c('0xa0')]>0x1){_0x180b89=_0x180b89[_0x547c('0xa6')]('{'+_0x3fa33c[0x0]+'}',this[_0x547c('0x10')][_0x547c('0x14')](_0x3fa33c[0x0])[_0x547c('0xa7')]||_0x3fa33c[0x0]);}}if(_0x23701c[_0x547c('0xa0')]===0x1){return _0x180b89['toString']();}return this[_0x547c('0xa4')](_0x180b89);};AGIVertices[_0x547c('0x13')][_0x547c('0xa8')]=function(_0x8811ee,_0x23da9d){var _0x11e9fd=this[_0x547c('0x10')][_0x547c('0x14')](_0x8811ee);if(_0x11e9fd['result']===-0x1){return _0x11e9fd;}logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0xa9'),_0x23da9d,_0x11e9fd['extra']));return this['channel'][_0x547c('0xaa')](_0x23da9d,_0x11e9fd[_0x547c('0xa7')]);};AGIVertices[_0x547c('0x13')][_0x547c('0x8b')]=function(_0x443680){return _0x443680&&_0x443680!=='0'&&_0x443680!=='-1'&&_0x443680!=='';};AGIVertices[_0x547c('0x13')][_0x547c('0xab')]=function(_0xb541a7){this['createSquareDetailsReport'][_0x547c('0xac')](this,_0xb541a7,'-');_0xb541a7[_0x547c('0xad')]=_0xb541a7['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x547c('0x13')][_0x547c('0xae')]=function(_0x40421b){logger[_0x547c('0x34')](util['format'](_0x547c('0xaf'),_0x40421b[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x40421b[_0x547c('0x62')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xb1'));}var _0x50d13b='\x22'+_0x40421b[_0x547c('0x62')]+'\x22';if(this[_0x547c('0x8b')](_0x40421b[_0x547c('0x7e')])){_0x50d13b+=','+_0x40421b[_0x547c('0x7e')];}var _0x57dae1=this[_0x547c('0x10')]['exec']('MRCPSynth',_0x50d13b);if(_0x57dae1[_0x547c('0xb2')]===-0x1){return _0x57dae1;}return this[_0x547c('0x10')]['noop'](util[_0x547c('0x2d')](_0x547c('0xb3'),_0x50d13b));};AGIVertices[_0x547c('0x13')]['mrcprecog']=function(_0x5c3ccc){logger[_0x547c('0x34')](util['format'](_0x547c('0xb4'),_0x5c3ccc[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x5c3ccc[_0x547c('0xb5')])){return this['channel'][_0x547c('0xb0')](_0x547c('0xb6'));}var _0x580190=_0x5c3ccc[_0x547c('0xb5')];if(this[_0x547c('0x8b')](_0x5c3ccc['options'])){_0x580190+=','+_0x5c3ccc[_0x547c('0x7e')];}var _0xa5710=this[_0x547c('0x10')]['exec'](_0x547c('0xb7'),_0x580190);if(_0xa5710['result']===-0x1){return _0xa5710;}var _0x47c368=this[_0x547c('0xa8')]('RECOG_CONFIDENCE()',_0x547c('0xb8'));if(_0x47c368['result']===-0x1){return _0x47c368;}var _0x1d00ea=this['getAndSetVariable'](_0x547c('0xb9'),_0x547c('0xba'));if(_0x1d00ea[_0x547c('0xb2')]===-0x1){return _0x1d00ea;}var _0x1bf745=this[_0x547c('0xa8')](_0x547c('0xbb'),_0x547c('0xbc'));if(_0x1bf745[_0x547c('0xb2')]===-0x1){return _0x1bf745;}return this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0xbd'),_0x580190));};AGIVertices[_0x547c('0x13')][_0x547c('0x8')]=function(_0x6105fe){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0xbe'),_0x6105fe[_0x547c('0x3b')]));return this[_0x547c('0x10')][_0x547c('0x8')]([_0x6105fe[_0x547c('0xbf')],_0x6105fe[_0x547c('0xc0')]]);};AGIVertices['prototype'][_0x547c('0xc1')]=function(_0x2ea971){logger[_0x547c('0x34')](util[_0x547c('0x2d')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x2ea971[_0x547c('0x3b')]));if(this[_0x547c('0x8b')](_0x2ea971[_0x547c('0x6a')])){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0xc2'),_0x2ea971[_0x547c('0x6a')]));var _0xecf19c=this['channel'][_0x547c('0xc3')](_0x2ea971[_0x547c('0x6a')]);if(_0xecf19c[_0x547c('0xb2')]===-0x1){return _0xecf19c;}}return this[_0x547c('0x10')][_0x547c('0xc1')]();};AGIVertices[_0x547c('0x13')][_0x547c('0x4e')]=function(_0x30a5b2){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0xc4'),_0x30a5b2[_0x547c('0x3b')]));if(!this['isConfigured'](_0x30a5b2[_0x547c('0x4d')])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x30a5b2,_0x547c('0xc5'));}_0x30a5b2[_0x547c('0x50')]=moment();if(this['isConfigured'](_0x30a5b2['delay'])){_0x30a5b2[_0x547c('0x50')]=moment()[_0x547c('0xc6')](_0x30a5b2[_0x547c('0xc7')],'minutes');}if(!this[_0x547c('0x8b')](_0x30a5b2[_0x547c('0x52')])){_0x30a5b2[_0x547c('0x52')]=0x2;}this[_0x547c('0x46')][_0x547c('0xac')](this,_0x30a5b2);return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0xc8'),_0x30a5b2['phone'],_0x30a5b2['list_id'],_0x30a5b2[_0x547c('0x50')]));};AGIVertices[_0x547c('0x13')]['custom_app']=function(_0x101cd1){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0xc9'),_0x101cd1[_0x547c('0x3b')]));var _0x21d031=this[_0x547c('0x10')][_0x547c('0x5c')](_0x101cd1['application'],_0x101cd1['options']);if(_0x21d031[_0x547c('0xb2')]===-0x1){return _0x21d031;}return this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')]('Executed\x20command\x20%s\x20%s',_0x101cd1[_0x547c('0xca')],_0x101cd1['options']));};AGIVertices[_0x547c('0x13')][_0x547c('0xcb')]=function(_0x5b1afb){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0xcc'),_0x5b1afb[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x5b1afb[_0x547c('0x62')])){return this[_0x547c('0x10')]['noop']('no\x20text\x20configured');}var _0x21c274='\x22'+_0x5b1afb[_0x547c('0x62')]+'\x22';if(this['isConfigured'](_0x5b1afb[_0x547c('0x7e')])){_0x21c274+=','+_0x5b1afb['options'];}var _0x340512=this[_0x547c('0x10')][_0x547c('0x5c')](_0x547c('0xcd'),_0x21c274);if(_0x340512['result']===-0x1){return _0x340512;}return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')]('Executed\x20command\x20MRCPSynth\x20%s',_0x21c274));};AGIVertices[_0x547c('0x13')]['sestektts']=function(_0x2b4fd7){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0xce'),_0x2b4fd7[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x2b4fd7[_0x547c('0x62')])){return this[_0x547c('0x10')]['noop']('no\x20text\x20configured');}var _0x36ee98='\x22'+_0x2b4fd7[_0x547c('0x62')]+'\x22';if(this['isConfigured'](_0x2b4fd7[_0x547c('0x7e')])){_0x36ee98+=','+_0x2b4fd7[_0x547c('0x7e')];}var _0x4a5a9b=this['channel'][_0x547c('0x5c')](_0x547c('0xcd'),_0x36ee98);if(_0x4a5a9b[_0x547c('0xb2')]===-0x1){return _0x4a5a9b;}return this[_0x547c('0x10')]['noop'](util[_0x547c('0x2d')](_0x547c('0xb3'),_0x36ee98));};AGIVertices[_0x547c('0x13')][_0x547c('0xcf')]=function(_0x5256b0){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0xd0'),_0x5256b0[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x5256b0[_0x547c('0xb5')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xb6'));}var _0x42c8c5=_0x5256b0[_0x547c('0xb5')];if(this[_0x547c('0x8b')](_0x5256b0[_0x547c('0x7e')])){_0x42c8c5+=','+_0x5256b0[_0x547c('0x7e')];}var _0x5f2608=this['channel'][_0x547c('0x5c')](_0x547c('0xb7'),_0x42c8c5);if(_0x5f2608[_0x547c('0xb2')]===-0x1){return _0x5f2608;}var _0x5add20=this[_0x547c('0xa8')](_0x547c('0xd1'),_0x547c('0xd2'));if(_0x5add20[_0x547c('0xb2')]===-0x1){return _0x5add20;}var _0x45f2b7=this[_0x547c('0xa8')]('RECOG_INPUT()',_0x547c('0xd3'));if(_0x45f2b7[_0x547c('0xb2')]===-0x1){return _0x45f2b7;}var _0x47ad34=this['getAndSetVariable'](_0x547c('0xbb'),_0x547c('0xd4'));if(_0x47ad34[_0x547c('0xb2')]===-0x1){return _0x47ad34;}return this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0xbd'),_0x42c8c5));};AGIVertices[_0x547c('0x13')][_0x547c('0xd5')]=function(_0x4a2d0d){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0xd6'),_0x4a2d0d[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x4a2d0d[_0x547c('0xb5')])){return this[_0x547c('0x10')]['noop']('no\x20grammar\x20configured');}var _0x4eee3e=_0x4a2d0d[_0x547c('0xb5')];if(this['isConfigured'](_0x4a2d0d[_0x547c('0x7e')])){_0x4eee3e+=','+_0x4a2d0d[_0x547c('0x7e')];}var _0x135c87=this[_0x547c('0x10')]['exec'](_0x547c('0xb7'),_0x4eee3e);if(_0x135c87[_0x547c('0xb2')]===-0x1){return _0x135c87;}var _0x65a4e4=this['getAndSetVariable'](_0x547c('0xd1'),_0x547c('0xd7'));if(_0x65a4e4['result']===-0x1){return _0x65a4e4;}var _0x203b7d=this[_0x547c('0xa8')](_0x547c('0xb9'),_0x547c('0xd8'));if(_0x203b7d['result']===-0x1){return _0x203b7d;}var _0x1e3004=this[_0x547c('0xa8')]('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x1e3004[_0x547c('0xb2')]===-0x1){return _0x1e3004;}return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0xbd'),_0x4eee3e));};AGIVertices[_0x547c('0x13')][_0x547c('0xd9')]=function(_0x3abe71){logger[_0x547c('0x34')](util['format'](_0x547c('0xda'),_0x3abe71[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x3abe71[_0x547c('0xdb')])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x3abe71,_0x547c('0xdc'));}var _0x1059cd=this['getSquareOdbc'][_0x547c('0xac')](this,_0x3abe71['odbc_id']);if(!_0x1059cd){return this[_0x547c('0x10')][_0x547c('0x31')](_0x3abe71,_0x547c('0xdd'));}if(!this[_0x547c('0x8b')](_0x3abe71[_0x547c('0xde')])){return this['channel'][_0x547c('0x31')](_0x3abe71,'no\x20query\x20configured');}var _0xae973e=_0x3abe71[_0x547c('0xde')][_0x547c('0x5e')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0xdf'),_0xae973e));var _0x2026bf=this[_0x547c('0x2f')]['sync'](this,_0x1059cd,_0xae973e);this['createSquareDetailsReport'][_0x547c('0xac')](this,_0x3abe71,_0xae973e);if(!this[_0x547c('0x8b')](_0x3abe71['variable_id'])){return this[_0x547c('0x10')]['noop'](_0x547c('0xe0'));}var _0x36eb83=this['getVariable'][_0x547c('0xac')](this,_0x3abe71[_0x547c('0xe1')]);if(!_0x36eb83){return this['channel'][_0x547c('0x31')](_0x3abe71,'no\x20variable\x20found');}var _0x85ac5c=this;_0x2026bf['forEach'](function(_0x2eff31,_0x288fa8){Object['keys'](_0x2eff31)['forEach'](function(_0x4cdef9){_0x85ac5c[_0x547c('0x10')][_0x547c('0xaa')](util[_0x547c('0x2d')]('%s[%s][%s]',_0x36eb83,_0x288fa8,_0x4cdef9),_0x2eff31[_0x4cdef9]);});});this[_0x547c('0x10')][_0x547c('0xaa')](util['format'](_0x547c('0xe2'),_0x36eb83),_0x2026bf[_0x547c('0xa0')]);return this[_0x547c('0x10')][_0x547c('0xb0')](util['format'](_0x547c('0xe3'),_0x36eb83));};AGIVertices['prototype'][_0x547c('0xe4')]=function(_0x27ad64){logger[_0x547c('0xe5')](util[_0x547c('0x2d')](_0x547c('0xe6'),_0x27ad64[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x27ad64[_0x547c('0xe7')])){return this['channel'][_0x547c('0x31')](_0x27ad64,'no\x20user\x20selected');}var _0x21c7be=this[_0x547c('0x1e')][_0x547c('0xac')](this,_0x27ad64[_0x547c('0xe7')]);if(!_0x21c7be){return this['channel']['error'](_0x27ad64,_0x547c('0xe8'));}var _0x490e1e=this[_0x547c('0x10')][_0x547c('0x5c')](_0x547c('0xe9'),[util[_0x547c('0x2d')](_0x547c('0xea'),_0x21c7be),_0x27ad64[_0x547c('0x6a')],_0x27ad64[_0x547c('0xeb')],_0x27ad64[_0x547c('0xec')]]);if(_0x490e1e[_0x547c('0xb2')]===-0x1){return _0x490e1e;}return this[_0x547c('0x10')]['noop'](util['format']('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x547c('0x13')][_0x547c('0xed')]=function(_0x27aeb1){logger[_0x547c('0x34')](util[_0x547c('0x2d')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x27aeb1[_0x547c('0x3b')]));if(!this['isConfigured'](_0x27aeb1[_0x547c('0x80')])){return this[_0x547c('0x10')]['noop'](_0x547c('0xee'));}if(!this[_0x547c('0x8b')](_0x27aeb1['text'])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xb1'));}this[_0x547c('0x10')][_0x547c('0xef')]=!![];this['createSquareDetailsReport'](_0x27aeb1);this[_0x547c('0x45')](_0x27aeb1[_0x547c('0x62')],'in','','');this[_0x547c('0x10')]['noop'](util[_0x547c('0x2d')](_0x547c('0xf0'),_0x27aeb1[_0x547c('0x62')]));var _0x251e38=this[_0x547c('0x7f')]['sync'](this,_0x27aeb1);if(_0x251e38){for(var _0x57eba7 in _0x251e38){if(_0x251e38[_0x547c('0x9c')](_0x57eba7)){this[_0x547c('0x10')]['setVariable'](util['format']('DIALOGFLOW_%s',_0x57eba7[_0x547c('0x70')]()),_0x251e38[_0x57eba7]);}}this[_0x547c('0x45')](_0x251e38['speech'],_0x547c('0xf1'),'dialogflow','');return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0xf2'),_0x251e38[_0x547c('0xf3')]));}return this['channel'][_0x547c('0x31')](_0x27aeb1,_0x547c('0xf4'));};AGIVertices[_0x547c('0x13')]['dialogflowV2']=function(_0x309343){logger['info'](util[_0x547c('0x2d')](_0x547c('0xf5'),_0x309343[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x309343['dialogflowV2_project_id'])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xf6'));}if(!this[_0x547c('0x8b')](_0x309343[_0x547c('0x83')])){return this[_0x547c('0x10')][_0x547c('0xb0')]('no\x20client_email\x20configured');}if(!this[_0x547c('0x8b')](_0x309343['private_key'])){return this[_0x547c('0x10')][_0x547c('0xb0')]('no\x20private_key\x20configured');}if(!this[_0x547c('0x8b')](_0x309343[_0x547c('0x85')])){return this['channel'][_0x547c('0xb0')](_0x547c('0xf7'));}if(!this[_0x547c('0x8b')](_0x309343[_0x547c('0x62')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xb1'));}this['channel']['bot']=!![];this[_0x547c('0x39')](_0x309343);this[_0x547c('0x45')](_0x309343[_0x547c('0x62')],'in','','');this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0xf8'),_0x309343[_0x547c('0x62')]));var _0x25e06e=this[_0x547c('0xf9')][_0x547c('0xac')](this,_0x309343);if(_0x25e06e){for(var _0x583fce in _0x25e06e){if(_0x25e06e['hasOwnProperty'](_0x583fce)){if(_0x583fce!==_0x547c('0xfa')){this[_0x547c('0x10')][_0x547c('0xaa')](util[_0x547c('0x2d')](_0x547c('0xfb'),_0x583fce[_0x547c('0x70')]()),_0x25e06e[_0x583fce]);}}}this[_0x547c('0x45')](_0x25e06e[_0x547c('0xf3')],_0x547c('0xf1'),'dialogflowV2',_0x25e06e['providerResponse']);return this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0xfc'),_0x25e06e[_0x547c('0xf3')]));}return this[_0x547c('0x10')]['error'](_0x309343,_0x547c('0xfd'));};AGIVertices[_0x547c('0x13')][_0x547c('0xfe')]=function(_0x770ced){logger[_0x547c('0x34')](util['format']('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x770ced['label']));if(!this[_0x547c('0x8b')](_0x770ced[_0x547c('0xff')])){return this[_0x547c('0x10')][_0x547c('0xb0')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x547c('0x8b')](_0x770ced[_0x547c('0x100')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x101'));}if(!this[_0x547c('0x8b')](_0x770ced['password'])){return this[_0x547c('0x10')]['noop'](_0x547c('0x102'));}if(!this[_0x547c('0x8b')](_0x770ced[_0x547c('0x103')])){return this['channel']['noop'](_0x547c('0xb1'));}this[_0x547c('0x10')][_0x547c('0xef')]=!![];this[_0x547c('0x39')](_0x770ced);this['createSquareMessage'](_0x770ced[_0x547c('0x62')],'in','','');this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')]('Trying\x20SestekNDA:\x20%s',_0x770ced[_0x547c('0x62')]));var _0x4da4e0=this['sestekNDA'][_0x547c('0xac')](this,_0x770ced);if(_0x4da4e0){for(var _0x2cee60 in _0x4da4e0){if(_0x4da4e0['hasOwnProperty'](_0x2cee60)){this[_0x547c('0x10')][_0x547c('0xaa')](util[_0x547c('0x2d')](_0x547c('0x104'),_0x2cee60['toUpperCase']()),_0x4da4e0[_0x2cee60]);}}this[_0x547c('0x45')](_0x4da4e0['speech'],_0x547c('0xf1'),_0x547c('0xfe'),'');if(_0x4da4e0[_0x547c('0x105')]){this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x4da4e0['audiofile']));var _0x5bbcbf=this[_0x547c('0x10')][_0x547c('0x106')](_0x4da4e0['audiofile']);try{fs['unlink'](_0x4da4e0[_0x547c('0x105')]+'.wav');}catch(_0x4c7112){logger[_0x547c('0x31')](_0x4c7112);}return _0x5bbcbf;}else{return this[_0x547c('0x10')]['noop'](util[_0x547c('0x2d')]('SestekNDA\x20Result\x20%s',_0x4da4e0[_0x547c('0xf3')]));}}return this[_0x547c('0x10')][_0x547c('0x31')](_0x770ced,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype'][_0x547c('0x107')]=function(_0x25b70d){logger['info'](util[_0x547c('0x2d')](_0x547c('0x108'),_0x25b70d['label']));return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x107'));};AGIVertices[_0x547c('0x13')][_0x547c('0x109')]=function(_0x2bceab){logger[_0x547c('0x34')](util[_0x547c('0x2d')]('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x2bceab[_0x547c('0x3b')]));var _0x161191='';if(_0x2bceab['trunk_id']){if(!this[_0x547c('0x8b')](_0x2bceab[_0x547c('0x10a')])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x2bceab,_0x547c('0x10b'));}else{var _0x1e0c5b=parseInt(_0x2bceab[_0x547c('0x10a')],0xa);if(isNaN(_0x1e0c5b)){_0x161191=_0x2bceab[_0x547c('0x10a')];}else{_0x161191=this[_0x547c('0x20')][_0x547c('0xac')](this,_0x2bceab[_0x547c('0x10a')]);if(!_0x161191){return this[_0x547c('0x10')]['error'](_0x2bceab,_0x547c('0x10c'));}}}}else if(_0x2bceab['trunk_name']){_0x161191=_0x2bceab['trunk_name'];}else{return this[_0x547c('0x10')][_0x547c('0x31')](_0x2bceab,_0x547c('0x10b'));}var _0x545620=this[_0x547c('0x10')]['exec'](_0x547c('0xe9'),[util[_0x547c('0x2d')](_0x547c('0x10d'),_0x161191,_0x2bceab[_0x547c('0x4c')]),_0x2bceab[_0x547c('0x6a')],_0x2bceab[_0x547c('0xeb')],_0x2bceab['url']]);if(_0x545620[_0x547c('0xb2')]===-0x1){return _0x545620;}return this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x10e'),_0x547c('0xe9')));};AGIVertices[_0x547c('0x13')][_0x547c('0x10f')]=function(_0x7ba892){logger[_0x547c('0x34')](util['format'](_0x547c('0x110'),_0x7ba892['label']));return this['channel'][_0x547c('0xb0')](_0x547c('0x10f'));};AGIVertices[_0x547c('0x13')][_0x547c('0xe')]=function(_0x40061a){logger[_0x547c('0x34')](util['format'](_0x547c('0x111'),_0x40061a[_0x547c('0x3b')]));if(_0x40061a[_0x547c('0xad')]===0x0){return this[_0x547c('0xab')](_0x40061a);}_0x40061a[_0x547c('0xad')]-=0x1;if(!this[_0x547c('0x8b')](_0x40061a['file_id'])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x40061a,_0x547c('0x112'));}var _0x410192=this[_0x547c('0x22')]['sync'](this,_0x40061a[_0x547c('0x113')]);if(!_0x410192){return this[_0x547c('0x10')][_0x547c('0x31')](_0x40061a,'no\x20file\x20audio\x20found');}if(!this[_0x547c('0x8b')](_0x40061a[_0x547c('0xe1')])){return this[_0x547c('0x10')][_0x547c('0x31')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1748ef=this[_0x547c('0x10')][_0x547c('0x114')](_0x410192,_0x40061a['response'],_0x40061a[_0x547c('0x115')]);var _0x1201b7=_0x1748ef[_0x547c('0xb2')]?_0x1748ef['result']['toString']():'';logger['info']('test',JSON[_0x547c('0x78')](_0x1748ef));if(_0x1748ef['result']===-0x1){this[_0x547c('0x39')][_0x547c('0xac')](this,_0x40061a,_0x1201b7);return _0x1748ef;}else if(_0x1748ef['extra']==='timeout'){_0x1748ef[_0x547c('0xb2')]=_0x1201b7[_0x547c('0xa0')]>=parseInt(_0x40061a[_0x547c('0x116')])?'x':'i';}else{_0x1748ef[_0x547c('0xb2')]=_0x1201b7[_0x547c('0xa0')]>=parseInt(_0x40061a[_0x547c('0x116')])&&_0x1201b7[_0x547c('0xa0')]<=parseInt(_0x40061a[_0x547c('0x115')])?'x':'i';}var _0x214304=this['getVariable']['sync'](this,_0x40061a['variable_id']);if(!_0x214304){return this[_0x547c('0x10')][_0x547c('0x31')](_0x40061a,'no\x20variable\x20found');}this[_0x547c('0x10')][_0x547c('0xaa')](_0x214304,_0x1201b7);if(this[_0x547c('0x8b')](_0x40061a[_0x547c('0x117')])){var _0x1ddfff=parseInt(_0x40061a['hiddendigitsnum'],0xa);var _0x2f70e0=rs['generate']({'charset':'*','length':_0x1ddfff});var _0x5d8d4d=_0x1201b7[_0x547c('0xa0')];if(_0x5d8d4d>0x0){if(_0x5d8d4d>_0x1ddfff){this['createSquareDetailsReport'][_0x547c('0xac')](this,_0x40061a,_0x40061a[_0x547c('0x118')]===_0x547c('0x119')?_0x2f70e0+_0x1201b7[_0x547c('0x11a')](_0x1ddfff):_0x1201b7[_0x547c('0x11a')](0x0,_0x5d8d4d-_0x1ddfff)+_0x2f70e0);}else{this['createSquareDetailsReport'][_0x547c('0xac')](this,_0x40061a,rs[_0x547c('0x11b')]({'charset':'*','length':_0x5d8d4d}));}}else{this[_0x547c('0x39')][_0x547c('0xac')](this,_0x40061a,'');}}else{this[_0x547c('0x39')]['sync'](this,_0x40061a,_0x1201b7);}return _0x1748ef;};AGIVertices[_0x547c('0x13')]['getsecretdigits']=function(_0x28f27b){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x11c'),_0x28f27b[_0x547c('0x3b')]));return this[_0x547c('0xe')](_0x28f27b);};AGIVertices[_0x547c('0x13')][_0x547c('0x11d')]=function(_0x5f4eac){logger['info'](util['format'](_0x547c('0x11e'),_0x5f4eac[_0x547c('0x3b')]));this[_0x547c('0x39')]['sync'](this,_0x5f4eac,_0x5f4eac[_0x547c('0x11f')]);return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x120'),_0x5f4eac[_0x547c('0x11f')]));};AGIVertices[_0x547c('0x13')]['awspolly']=function(_0x1ddf54){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x121'),_0x1ddf54['label']));if(!this[_0x547c('0x8b')](_0x1ddf54[_0x547c('0x8e')])||!this[_0x547c('0x8b')](_0x1ddf54[_0x547c('0x8f')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x122'));}if(!this[_0x547c('0x8b')](_0x1ddf54[_0x547c('0x62')])){return this[_0x547c('0x10')]['noop']('no\x20text\x20configured');}this[_0x547c('0x10')]['noop'](util[_0x547c('0x2d')]('Trying\x20aws\x20Polly\x20%s',_0x1ddf54[_0x547c('0x62')]));var _0x2c4f37=this['awsPolly'][_0x547c('0xac')](this,_0x1ddf54);if(_0x2c4f37){this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x123'),_0x2c4f37));var _0x2d8ffd=this['channel'][_0x547c('0x106')](_0x2c4f37);try{fs[_0x547c('0x124')](_0x2c4f37+_0x547c('0x125'));}catch(_0x348577){logger[_0x547c('0x31')](_0x348577);}return _0x2d8ffd;}return this[_0x547c('0x10')][_0x547c('0x31')](_0x1ddf54,'aws\x20Polly\x20is\x20unreachable');};AGIVertices[_0x547c('0x13')][_0x547c('0x126')]=function(_0x303f60){logger[_0x547c('0x34')](util['format'](_0x547c('0x127'),_0x303f60[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x303f60[_0x547c('0x8e')])||!this['isConfigured'](_0x303f60[_0x547c('0x8f')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x122'));}if(!this['isConfigured'](_0x303f60['aws_bot_name'])){return this['channel'][_0x547c('0xb0')](_0x547c('0x128'));}if(!this[_0x547c('0x8b')](_0x303f60['text'])){return this[_0x547c('0x10')][_0x547c('0xb0')]('no\x20text\x20configured');}this['channel']['bot']=!![];this['createSquareDetailsReport'](_0x303f60);this[_0x547c('0x45')](_0x303f60[_0x547c('0x62')],'in','','');this[_0x547c('0x10')]['noop'](util['format'](_0x547c('0x129'),_0x303f60[_0x547c('0x62')]));var _0x1e8dec=this[_0x547c('0x92')]['sync'](this,_0x303f60);if(_0x1e8dec){for(var _0x39275c in _0x1e8dec){if(_0x1e8dec[_0x547c('0x9c')](_0x39275c)&&_['isString'](_0x1e8dec[_0x39275c])){this[_0x547c('0x10')][_0x547c('0xaa')](util[_0x547c('0x2d')]('AWS_LEX_%s',_0x39275c[_0x547c('0x70')]()),_0x1e8dec[_0x39275c]);}}if(_['isNil'](_0x1e8dec[_0x547c('0x7c')])){return this[_0x547c('0x10')][_0x547c('0xb0')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x547c('0x45')](_0x1e8dec[_0x547c('0x7c')],_0x547c('0xf1'),_0x547c('0x12a'),'');return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x12b'),_0x1e8dec[_0x547c('0x7c')]));}}return this['channel']['error'](_0x303f60,_0x547c('0x12c'));};AGIVertices[_0x547c('0x13')][_0x547c('0x12d')]=function(_0x5ac314){logger['info'](util[_0x547c('0x2d')](_0x547c('0x12e'),_0x5ac314['label'],_0x5ac314[_0x547c('0x6a')]));if(!this[_0x547c('0x8b')](_0x5ac314[_0x547c('0x80')])){return this[_0x547c('0x10')][_0x547c('0xb0')]('no\x20key\x20configured');}var _0x5699a0='wav';var _0x45fbb2=util[_0x547c('0x2d')](_0x547c('0x12f'),FILES_PATH,rs[_0x547c('0x11b')](0x4));var _0x4f4482=util[_0x547c('0x2d')](_0x547c('0xa2'),_0x45fbb2,_0x5699a0);var _0x23c84c=!![];if(_0x5ac314['beep']==='NOBEEP'){_0x23c84c=![];}var _0x54948d=this['channel'][_0x547c('0x130')](_0x45fbb2,_0x5699a0,_0x5ac314[_0x547c('0x131')],_0x5ac314[_0x547c('0x6a')],undefined,_0x23c84c);if(_0x54948d[_0x547c('0xb2')]!==-0x1){this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')]('google\x20%s\x20file\x20created',_0x4f4482));var _0x1510a1=this[_0x547c('0x95')][_0x547c('0xac')](this,_0x5ac314,_0x4f4482);if(_0x1510a1){for(var _0x4824d1 in _0x1510a1){if(_0x1510a1[_0x547c('0x9c')](_0x4824d1)){this[_0x547c('0x10')]['setVariable'](util[_0x547c('0x2d')](_0x547c('0x132'),_0x4824d1[_0x547c('0x70')]()),_0x1510a1[_0x4824d1]);}}return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x133'),JSON['stringify'](_0x1510a1)));}}return _0x54948d;};AGIVertices[_0x547c('0x13')]['tildeasr']=function(_0xad307c){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x134'),_0xad307c[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0xad307c[_0x547c('0x98')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x135'));}if(!this[_0x547c('0x8b')](_0xad307c[_0x547c('0x136')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x137'));}var _0x9ddf2=_0x547c('0x138');var _0x1b4961=util[_0x547c('0x2d')](_0x547c('0x12f'),FILES_PATH,rs['generate'](0x4));var _0x1a386f=util[_0x547c('0x2d')](_0x547c('0xa2'),_0x1b4961,_0x9ddf2);var _0x3e4503=!![];if(_0xad307c['beep']===_0x547c('0x139')){_0x3e4503=![];}var _0x4cd14a=this[_0x547c('0x10')][_0x547c('0x130')](_0x1b4961,_0x9ddf2,_0xad307c['intKey'],_0xad307c[_0x547c('0x6a')],undefined,_0x3e4503);if(_0x4cd14a[_0x547c('0xb2')]!==-0x1){this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x13a'),_0x1a386f));var _0x44309c=this[_0x547c('0x97')]['sync'](this,_0xad307c,_0x1a386f);if(_0x44309c){for(var _0x15e613 in _0x44309c){if(_0x44309c[_0x547c('0x9c')](_0x15e613)){this[_0x547c('0x10')][_0x547c('0xaa')](util[_0x547c('0x2d')](_0x547c('0x13b'),_0x15e613[_0x547c('0x70')]()),_0x44309c[_0x15e613]);}}return this[_0x547c('0x10')]['noop'](util['format'](_0x547c('0x13c'),JSON[_0x547c('0x78')](_0x44309c)));}}return _0x4cd14a;};AGIVertices[_0x547c('0x13')]['gotoc']=function(_0xf3bc02){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x13d'),_0xf3bc02['label']));return this['channel'][_0x547c('0x13e')](_0xf3bc02[_0x547c('0x13f')],_0xf3bc02[_0x547c('0x41')],_0xf3bc02[_0x547c('0x42')]);};AGIVertices['prototype'][_0x547c('0x140')]=function(_0x4cc4bb){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x141'),_0x4cc4bb['label']));if(!this[_0x547c('0x8b')](_0x4cc4bb[_0x547c('0x142')])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x4cc4bb,_0x547c('0x143'));}try{var _0x3522ba=eval(_0x4cc4bb['condition'])?'true':_0x547c('0x144');this[_0x547c('0x10')]['noop'](util[_0x547c('0x2d')](_0x547c('0x145'),_0x4cc4bb['condition'],_0x3522ba));return{'code':0xc8,'result':_0x3522ba};}catch(_0x2b3ba6){return{'code':0xc8,'result':'false'};}};AGIVertices['prototype']['gotoiftime']=function(_0x1226e5){logger[_0x547c('0x34')](util[_0x547c('0x2d')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x1226e5['label']));if(!this[_0x547c('0x8b')](_0x1226e5[_0x547c('0x146')])){return this['channel']['error'](_0x1226e5,_0x547c('0x147'));}var _0xbb471d=this['getIntervals']['sync'](this,_0x1226e5['interval_id']);if(!_0xbb471d){return this[_0x547c('0x10')][_0x547c('0x31')](_0x1226e5,_0x547c('0x148'));}for(var _0x52e3c3=0x0;_0x52e3c3<_0xbb471d[_0x547c('0xa0')];_0x52e3c3+=0x1){var _0x7fdeb=this['channel'][_0x547c('0x14')](util[_0x547c('0x2d')](_0x547c('0x149'),_0xbb471d[_0x52e3c3]));if(_0x7fdeb[_0x547c('0xb2')]===-0x1){return _0x7fdeb;}logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x14a'),_0xbb471d[_0x52e3c3],_0x7fdeb['extra']));if(_0x7fdeb[_0x547c('0xa7')]===_0x547c('0x14b')){logger[_0x547c('0x34')](util['format']('IFTIME\x20%s\x20%s',_0xbb471d[_0x52e3c3],_0x547c('0x14b')));this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x14a'),_0xbb471d[_0x52e3c3],_0x547c('0x14b')));return{'code':0xc8,'result':_0x547c('0x14b')};}else{logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x14a'),_0xbb471d[_0x52e3c3],_0x547c('0x144')));this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x14a'),_0xbb471d[_0x52e3c3],'false'));}}return{'code':0xc8,'result':_0x547c('0x144')};};AGIVertices[_0x547c('0x13')][_0x547c('0x14c')]=function(_0x15458f){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x14d'),_0x15458f[_0x547c('0x3b')]));return this['channel']['hangup']();};AGIVertices[_0x547c('0x13')][_0x547c('0x14e')]=function(_0x3c0b69){logger['info'](util[_0x547c('0x2d')](_0x547c('0x14f'),_0x3c0b69[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x3c0b69[_0x547c('0x80')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xee'));}var _0x4430dd=_0x547c('0x138');var _0x2467e2=util[_0x547c('0x2d')](_0x547c('0x12f'),FILES_PATH,rs['generate'](0x4));var _0x5386c4=util[_0x547c('0x2d')](_0x547c('0xa2'),_0x2467e2,_0x4430dd);var _0x3c29b9=!![];if(_0x3c0b69[_0x547c('0x150')]==='NOBEEP'){_0x3c29b9=![];}var _0x28dd3e=this[_0x547c('0x10')][_0x547c('0x130')](_0x2467e2,_0x4430dd,_0x3c0b69['intKey'],_0x3c0b69[_0x547c('0x6a')],undefined,_0x3c29b9);if(_0x28dd3e['result']!==-0x1){this['channel']['noop'](util[_0x547c('0x2d')]('ispeech\x20%s\x20file\x20created',_0x5386c4));var _0xeacc0a=this['ispeechASR']['sync'](this,_0x3c0b69,_0x5386c4);if(_0xeacc0a){for(var _0x39fdc2 in _0xeacc0a){if(_0xeacc0a[_0x547c('0x9c')](_0x39fdc2)){this[_0x547c('0x10')][_0x547c('0xaa')](util[_0x547c('0x2d')](_0x547c('0x151'),_0x39fdc2[_0x547c('0x70')]()),_0xeacc0a[_0x39fdc2]);}}return this['channel'][_0x547c('0xb0')](util['format'](_0x547c('0x152'),JSON[_0x547c('0x78')](_0xeacc0a)));}}return _0x28dd3e;};AGIVertices[_0x547c('0x13')][_0x547c('0x153')]=function(_0x433d30){logger[_0x547c('0x34')](util['format'](_0x547c('0x154'),_0x433d30[_0x547c('0x3b')]));if(!this['isConfigured'](_0x433d30[_0x547c('0x80')])){return this[_0x547c('0x10')][_0x547c('0xb0')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x433d30[_0x547c('0x62')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xb1'));}this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x155'),_0x433d30['text']));var _0x1ab6e0=this[_0x547c('0x87')][_0x547c('0xac')](this,_0x433d30);if(_0x1ab6e0){this[_0x547c('0x10')]['noop'](util[_0x547c('0x2d')](_0x547c('0x156'),_0x1ab6e0));var _0x2a7ae0=this[_0x547c('0x10')][_0x547c('0x106')](_0x1ab6e0,_0x433d30[_0x547c('0x131')]);try{fs[_0x547c('0x124')](_0x1ab6e0+'.wav');}catch(_0x31f68b){logger['error'](_0x31f68b);}return _0x2a7ae0;}return this[_0x547c('0x10')][_0x547c('0x31')](_0x433d30,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x547c('0x13')]['login']=function(_0x39e457){logger['info'](util[_0x547c('0x2d')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x39e457[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x39e457['findBy'])){return this[_0x547c('0x10')]['error'](_0x39e457,'no\x20find\x20by\x20configured');}logger['info'](util['format'](_0x547c('0x157'),this['channel']['callerid'],_0x39e457['findBy']));var _0x36618f=this[_0x547c('0x5a')][_0x547c('0xac')](this,_0x39e457[_0x547c('0x158')]);if(_0x36618f){logger['info'](util[_0x547c('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x547c('0x3e')],_0x39e457[_0x547c('0x158')]));this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x159'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x39e457[_0x547c('0x158')]));return{'code':0xc8,'result':_0x547c('0x15a')};}else{logger[_0x547c('0x34')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x547c('0x10')][_0x547c('0x3e')],_0x39e457[_0x547c('0x158')]));this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x15b'),this[_0x547c('0x10')]['callerid'],_0x39e457['findBy']));return{'code':0xc8,'result':_0x547c('0x15c')};}};AGIVertices[_0x547c('0x13')][_0x547c('0x15d')]=function(_0x336e89){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x15e'),_0x336e89[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x336e89[_0x547c('0x158')])){return this[_0x547c('0x10')]['error'](_0x336e89,_0x547c('0x15f'));}logger[_0x547c('0x34')](util[_0x547c('0x2d')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x547c('0x3e')],_0x336e89[_0x547c('0x158')]));var _0x28f8f2=this[_0x547c('0x160')][_0x547c('0xac')](this,_0x336e89[_0x547c('0x158')]);if(_0x28f8f2){logger['info'](util[_0x547c('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x547c('0x10')][_0x547c('0x3e')],_0x336e89[_0x547c('0x158')]));this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x159'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x336e89[_0x547c('0x158')]));return{'code':0xc8,'result':_0x547c('0x15a')};}else{logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x15b'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x336e89[_0x547c('0x158')]));this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x15b'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x336e89[_0x547c('0x158')]));return{'code':0xc8,'result':_0x547c('0x15c')};}};AGIVertices['prototype'][_0x547c('0x161')]=function(_0x2d7ed4){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x162'),_0x2d7ed4['label']));if(!this['isConfigured'](_0x2d7ed4[_0x547c('0x163')])){return this[_0x547c('0x10')]['error'](_0x2d7ed4,_0x547c('0x164'));}this['channel']['noop'](util[_0x547c('0x2d')](_0x547c('0x165'),_0x2d7ed4[_0x547c('0x163')]));var _0x556b00=eval(_0x2d7ed4[_0x547c('0x163')]);if(!this[_0x547c('0x8b')](_0x2d7ed4[_0x547c('0xe1')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xe0'));}var _0x151cba=this[_0x547c('0x14')][_0x547c('0xac')](this,_0x2d7ed4[_0x547c('0xe1')]);if(!_0x151cba){return this[_0x547c('0x10')][_0x547c('0x31')](_0x2d7ed4,'no\x20variable\x20found');}if(_['isArray'](_0x556b00)){var _0x263366=this;_0x556b00[_0x547c('0x166')](function(_0x23add7,_0x54eb69){_0x263366[_0x547c('0x10')][_0x547c('0xaa')](util[_0x547c('0x2d')](_0x547c('0x167'),_0x151cba,_0x54eb69),_0x23add7);});return this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x168'),_0x151cba));}else{return this[_0x547c('0x10')][_0x547c('0xaa')](_0x151cba,_0x556b00);}};AGIVertices[_0x547c('0x13')]['menu']=function(_0x416264){logger[_0x547c('0x34')](util[_0x547c('0x2d')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x416264[_0x547c('0x3b')]));if(_0x416264[_0x547c('0xad')]===0x0){return this[_0x547c('0xab')](_0x416264);}_0x416264[_0x547c('0xad')]-=0x1;if(!this[_0x547c('0x8b')](_0x416264['file_id'])){return this['channel'][_0x547c('0x31')](_0x416264,_0x547c('0x112'));}var _0x22f5cc=this['getSound'][_0x547c('0xac')](this,_0x416264[_0x547c('0x113')]);if(!_0x22f5cc){return this['channel'][_0x547c('0x31')](_0x416264,_0x547c('0x169'));}var _0x5d6c6c=this[_0x547c('0x10')][_0x547c('0x114')](_0x22f5cc,_0x416264['response'],_0x416264[_0x547c('0x16a')]);var _0x14828a=_0x5d6c6c[_0x547c('0xb2')];if(_0x5d6c6c[_0x547c('0xb2')]===-0x1){this[_0x547c('0x39')]['sync'](this,_0x416264,'-1');return _0x5d6c6c;}else if(_0x5d6c6c[_0x547c('0xa7')]===_0x547c('0x6a')){_0x5d6c6c[_0x547c('0xb2')]=_0x5d6c6c[_0x547c('0xb2')][_0x547c('0xa0')]>0x0?_0x5d6c6c['result']:'t';}else if(_[_0x547c('0x47')](_0x5d6c6c[_0x547c('0xb2')])){_0x5d6c6c[_0x547c('0xb2')]='#';_0x14828a='#';}if(!this['isConfigured'](_0x416264[_0x547c('0xe1')])){this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xe0'));}else{var _0x467e81=this[_0x547c('0x14')][_0x547c('0xac')](this,_0x416264[_0x547c('0xe1')]);if(!_0x467e81){return this[_0x547c('0x10')][_0x547c('0x31')](_0x416264,_0x547c('0x16b'));}this[_0x547c('0x10')]['setVariable'](_0x467e81,_0x14828a);}this[_0x547c('0x39')][_0x547c('0xac')](this,_0x416264,_0x14828a);return _0x5d6c6c;};AGIVertices['prototype'][_0x547c('0xb0')]=function(_0x5a15e6){logger[_0x547c('0x34')](util[_0x547c('0x2d')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x5a15e6[_0x547c('0x3b')]));return this[_0x547c('0x10')][_0x547c('0xb0')](_0x5a15e6[_0x547c('0x16c')]||_0x5a15e6[_0x547c('0x3b')]);};AGIVertices[_0x547c('0x13')][_0x547c('0x16d')]=function(_0x48ab51){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x16e'),_0x48ab51[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x48ab51[_0x547c('0x158')])){return this[_0x547c('0x10')]['error'](_0x48ab51,'no\x20find\x20by\x20configured');}logger[_0x547c('0x34')](util['format'](_0x547c('0x157'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x48ab51['findBy']));var _0x30890f=this[_0x547c('0x53')][_0x547c('0xac')](this,_0x48ab51[_0x547c('0x16f')]);var _0x1609d9=this['agentPause'][_0x547c('0xac')](this,_0x48ab51[_0x547c('0x158')],_0x30890f);if(_0x1609d9){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x159'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x48ab51[_0x547c('0x158')]));this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x159'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x48ab51[_0x547c('0x158')]));return{'code':0xc8,'result':_0x547c('0x15a')};}else{logger['info'](util[_0x547c('0x2d')](_0x547c('0x15b'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x48ab51[_0x547c('0x158')]));this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x547c('0x3e')],_0x48ab51[_0x547c('0x158')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x547c('0x13')]['playback']=function(_0x59377a){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x170'),_0x59377a[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x59377a[_0x547c('0x113')])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x59377a,_0x547c('0x112'));}var _0x3a6283=this[_0x547c('0x22')][_0x547c('0xac')](this,_0x59377a[_0x547c('0x113')]);if(!_0x3a6283){return this['channel']['error'](_0x59377a,_0x547c('0x169'));}var _0x312c76=this[_0x547c('0x10')][_0x547c('0x5c')](_0x547c('0x171'),[_0x3a6283,_0x59377a['opts']]);if(_0x312c76['result']===-0x1){return _0x312c76;}return this['channel'][_0x547c('0xb0')](util['format']('Executed\x20command\x20%s\x20%s',_0x547c('0x171'),_0x3a6283));};AGIVertices[_0x547c('0x13')]['queue']=function(_0x38655f){logger['info'](util[_0x547c('0x2d')](_0x547c('0x172'),_0x38655f['label']));if(!this['isConfigured'](_0x38655f[_0x547c('0x173')])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x38655f,_0x547c('0x174'));}var _0x26cedc='';var _0xe042ea=parseInt(_0x38655f[_0x547c('0x173')],0xa);if(isNaN(_0xe042ea)){_0x26cedc=_0x38655f[_0x547c('0x173')];}else{_0x26cedc=this[_0x547c('0x17')][_0x547c('0xac')](this,_0x38655f[_0x547c('0x173')]);if(!_0x26cedc){return this[_0x547c('0x10')]['error'](_0x38655f,'no\x20queue\x20found');}}var _0x5abe57='';if(this[_0x547c('0x8b')](_0x38655f[_0x547c('0x113')])){var _0x3f029d=this['getSound']['sync'](this,_0x38655f[_0x547c('0x113')]);if(_0x3f029d){_0x5abe57=_0x3f029d;}}this[_0x547c('0x39')][_0x547c('0xac')](this,_0x38655f,_0x26cedc);if(_0x38655f[_0x547c('0xeb')][_0x547c('0x175')]('x')<0x0){_0x38655f['opts']+='x';}if(_0x38655f[_0x547c('0xeb')][_0x547c('0x175')]('X')<0x0){_0x38655f[_0x547c('0xeb')]+='X';}this[_0x547c('0x10')]['setVariable'](_0x547c('0x176'),_0x26cedc?_0x26cedc[_0x547c('0x177')]():'');var _0x327db8=this[_0x547c('0x10')][_0x547c('0x5c')]('QUEUE',[_0x26cedc,_0x38655f[_0x547c('0xeb')],_0x38655f['url'],_0x5abe57,_0x38655f[_0x547c('0x6a')],_0x38655f[_0x547c('0x8')],_0x38655f[_0x547c('0x178')],_0x38655f[_0x547c('0x179')],'',_0x38655f[_0x547c('0x17a')]]);if(_0x327db8[_0x547c('0xb2')]===-0x1){return _0x327db8;}return this[_0x547c('0x10')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0x547c('0x17b'),_0x26cedc));};AGIVertices[_0x547c('0x13')][_0x547c('0x17c')]=function(_0x806a2e){logger[_0x547c('0x34')](util['format'](_0x547c('0x17d'),_0x806a2e[_0x547c('0x3b')]));var _0x4b6a72=_0x806a2e[_0x547c('0x17e')]||'wav';var _0x372c70=util[_0x547c('0x2d')]('%s_%s',this['channel']['uniqueid'],rs[_0x547c('0x11b')](0x5));var _0x2a73e1=util[_0x547c('0x2d')](_0x547c('0x17f'),FILES_PATH,_0x372c70,_0x4b6a72);var _0x92c34c=util[_0x547c('0x2d')](_0x547c('0x12f'),FILES_PATH,_0x372c70);this[_0x547c('0x3f')][_0x547c('0xac')](this,_0x806a2e,_0x372c70,_0x2a73e1);this[_0x547c('0x10')][_0x547c('0xaa')](_0x547c('0x180'),_0x372c70);logger[_0x547c('0x34')](_0x547c('0x181'),_0x92c34c,_0x4b6a72,_0x806a2e[_0x547c('0x182')],_0x806a2e[_0x547c('0x6a')]);return this['channel']['recordFile'](_0x92c34c,_0x4b6a72,_0x806a2e[_0x547c('0x182')],_0x806a2e[_0x547c('0x6a')],undefined,!![]);};AGIVertices[_0x547c('0x13')][_0x547c('0x183')]=function(_0x1129db){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x184'),_0x1129db[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x1129db['url'])){return this['channel'][_0x547c('0xb0')](_0x547c('0x185'));}var _0x55fbd0=this['restAPI'][_0x547c('0xac')](this,_0x1129db);logger[_0x547c('0x34')](util['format'](_0x547c('0x186'),util['inspect'](_0x55fbd0,{'showHidden':![],'depth':null})));if(!this[_0x547c('0x8b')](_0x1129db[_0x547c('0xe1')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x187'));}var _0x4f0d29=this[_0x547c('0x14')]['sync'](this,_0x1129db[_0x547c('0xe1')]);if(!_0x4f0d29){return this[_0x547c('0x10')][_0x547c('0x31')](_0x1129db,_0x547c('0x16b'));}this['channel'][_0x547c('0xaa')](util[_0x547c('0x2d')]('%s_STATUS_CODE',_0x4f0d29),_0x55fbd0[_0x547c('0x7a')]?_0x55fbd0[_0x547c('0x7a')]:_0x547c('0x188'));this[_0x547c('0x10')][_0x547c('0xaa')](util[_0x547c('0x2d')]('%s_STATUS_MESSAGE',_0x4f0d29),_0x55fbd0[_0x547c('0x7b')]?_0x55fbd0[_0x547c('0x7b')]:'OK');if(_0x55fbd0[_0x547c('0x71')]){try{this[_0x547c('0xa3')](_0x55fbd0[_0x547c('0x71')],_0x4f0d29);}catch(_0x3757a9){logger['error'](util['format'](_0x547c('0x189'),_0x4f0d29));}}return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0xe3'),_0x4f0d29));};AGIVertices[_0x547c('0x13')][_0x547c('0x18a')]=function(_0xaadcb7){logger['info'](util['format'](_0x547c('0x18b'),_0xaadcb7['label']));return this[_0x547c('0x10')]['sayDigits'](_0xaadcb7[_0x547c('0x18c')]['replace'](/\s+/g,''),_0xaadcb7[_0x547c('0x182')]);};AGIVertices[_0x547c('0x13')]['saynumber']=function(_0x1ce40e){logger['info'](util[_0x547c('0x2d')](_0x547c('0x18d'),_0x1ce40e[_0x547c('0x3b')]));return this['channel'][_0x547c('0x18e')](_0x1ce40e['number'][_0x547c('0x5e')](/\s+/g,''),_0x1ce40e[_0x547c('0x182')]);};AGIVertices[_0x547c('0x13')][_0x547c('0x18f')]=function(_0x5e7c6b){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x190'),_0x5e7c6b[_0x547c('0x3b')]));return this[_0x547c('0x10')][_0x547c('0x191')](_0x5e7c6b[_0x547c('0x62')],_0x5e7c6b[_0x547c('0x182')]);};AGIVertices[_0x547c('0x13')][_0x547c('0x192')]=function(_0x4aa68e){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x193'),_0x4aa68e[_0x547c('0x3b')]));if(!this['isConfigured'](_0x4aa68e[_0x547c('0x194')])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x195'));}var _0x509e98=this[_0x547c('0x25')][_0x547c('0xac')](this,_0x4aa68e[_0x547c('0x194')]);if(!_0x509e98||!_0x509e98[_0x547c('0x196')]){return this[_0x547c('0x10')]['error'](_0x4aa68e,_0x547c('0x197'));}var _0x5eedb4={'from':util[_0x547c('0x2d')](_0x547c('0x198'),_0x509e98[_0x547c('0x19')],_0x509e98[_0x547c('0x199')]||_0x509e98['Smtp'][_0x547c('0x19a')]),'to':_0x4aa68e['to']||'','cc':_0x4aa68e['cc']||'','bcc':_0x4aa68e[_0x547c('0x19b')]||'','subject':_0x4aa68e[_0x547c('0x19c')],'html':_0x4aa68e[_0x547c('0x62')],'text':_0x4aa68e[_0x547c('0x62')]};var _0x166864={'tls':{'rejectUnauthorized':![]}};if(_0x509e98[_0x547c('0x196')][_0x547c('0x19d')]){_0x166864[_0x547c('0x19d')]=_0x509e98[_0x547c('0x196')][_0x547c('0x19d')];}else{_0x166864[_0x547c('0x19e')]=_0x509e98[_0x547c('0x196')]['host'];_0x166864['port']=_0x509e98[_0x547c('0x196')][_0x547c('0x19f')];_0x166864[_0x547c('0x1a0')]=_0x509e98['Smtp'][_0x547c('0x1a0')];}if(_0x509e98[_0x547c('0x196')][_0x547c('0x1a1')]){_0x166864[_0x547c('0x1a2')]={'user':_0x509e98[_0x547c('0x196')][_0x547c('0x19a')],'pass':_0x509e98[_0x547c('0x196')]['pass']};}if(this[_0x547c('0x8b')](_0x4aa68e[_0x547c('0x1a3')])){}logger['debug']('sendMail\x20message',JSON[_0x547c('0x78')](_0x5eedb4));this['createSquareDetailsReport']['sync'](this,_0x4aa68e,_0x4aa68e[_0x547c('0x194')]);this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x509e98['name']));this[_0x547c('0x27')][_0x547c('0xac')](this,_0x166864,_0x5eedb4);return this[_0x547c('0x10')]['noop'](_0x547c('0x1a4'));};AGIVertices[_0x547c('0x13')]['sendFax']=function(_0x3b3d31){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x1a5'),_0x3b3d31[_0x547c('0x3b')]));return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x1a6'));};AGIVertices[_0x547c('0x13')]['sendSMS']=function(_0x26a68f){logger['info'](util[_0x547c('0x2d')](_0x547c('0x1a7'),_0x26a68f[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x26a68f['sms_account_id'])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x1a8'));}var _0x20f33b=this[_0x547c('0x37')][_0x547c('0xac')](this,_0x26a68f[_0x547c('0x1a9')]);if(!_0x20f33b){return this['channel'][_0x547c('0x31')](_0x26a68f,_0x547c('0x1aa'));}var _0x125278={'body':_0x26a68f[_0x547c('0x1ab')],'phone':_0x26a68f['to']||'','SmsAccountId':_0x20f33b['id']};logger[_0x547c('0xe5')](_0x547c('0x1ac'),JSON['stringify'](_0x125278));this[_0x547c('0x39')][_0x547c('0xac')](this,_0x26a68f,_0x26a68f[_0x547c('0x1a9')]);this['channel']['noop'](util['format']('Trying\x20SendSMS\x20with\x20account\x20%s',_0x20f33b[_0x547c('0x19')]));this[_0x547c('0x1ad')][_0x547c('0xac')](this,_0x125278);return this['channel'][_0x547c('0xb0')](_0x547c('0x1ae'));};AGIVertices['prototype'][_0x547c('0x1af')]=function(_0x4498f3){logger[_0x547c('0x34')](util['format']('Enter\x20in\x20SET\x20(%s)\x20block',_0x4498f3['label']));if(!this['isConfigured'](_0x4498f3[_0x547c('0xe1')])){return this['channel'][_0x547c('0x31')](_0x4498f3,_0x547c('0x1b0'));}var _0x27b6e7=this[_0x547c('0x14')][_0x547c('0xac')](this,_0x4498f3[_0x547c('0xe1')]);if(!_0x27b6e7){return this[_0x547c('0x10')][_0x547c('0x31')](_0x4498f3,_0x547c('0x16b'));}return this['channel'][_0x547c('0xaa')](_0x27b6e7,_0x4498f3[_0x547c('0x1b1')]);};AGIVertices[_0x547c('0x13')][_0x547c('0x1b2')]=function(_0x15b69c){logger[_0x547c('0x34')](util[_0x547c('0x2d')]('Enter\x20in\x20START\x20(%s)\x20block',_0x15b69c['label']));this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0x1b3'));if(_0x15b69c['answer']===_0x547c('0x1b4')){this['channel'][_0x547c('0xb0')](_0x547c('0x1b5'));return this[_0x547c('0x10')]['answer']();}return this[_0x547c('0x10')][_0x547c('0xb0')]('Skipped\x20Answer');};AGIVertices[_0x547c('0x13')][_0x547c('0x1b6')]=function(_0x169091){logger['info'](util['format'](_0x547c('0x1b7'),_0x169091[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x169091[_0x547c('0x1b8')])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x169091,_0x547c('0x1b9'));}var _0x530d50=this[_0x547c('0x1a')][_0x547c('0xac')](this,_0x169091[_0x547c('0x1b8')]);if(!this[_0x547c('0x8b')](_0x530d50)){return this['channel'][_0x547c('0x31')](_0x169091,util['format'](_0x547c('0x1ba'),_0x169091[_0x547c('0x1b8')]));}if(_0x530d50===this[_0x547c('0x10')]['arg_1']){return this[_0x547c('0x10')]['error'](_0x169091,_0x547c('0x1bb'));}this[_0x547c('0x39')]['sync'](this,_0x169091,_0x530d50);var _0x4eca26=this['channel'][_0x547c('0x5c')](_0x547c('0x1bc'),util[_0x547c('0x2d')](_0x547c('0x1bd'),config[_0x547c('0x8')][_0x547c('0x19e')]||_0x547c('0x1be'),_0x530d50,this[_0x547c('0x10')][_0x547c('0x3d')]));if(_0x4eca26[_0x547c('0xb2')]===-0x1){return _0x4eca26;}return this[_0x547c('0x10')]['noop'](util[_0x547c('0x2d')]('Executed\x20command\x20%s\x20%s',_0x547c('0x1bc'),_0x530d50));};AGIVertices[_0x547c('0x13')][_0x547c('0x1bf')]=function(_0x57326b){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x1c0'),_0x57326b[_0x547c('0x3b')]));var _0x44c078=this[_0x547c('0x5b')][_0x547c('0xac')](this,_0x57326b['command']);this['createSquareDetailsReport'][_0x547c('0xac')](this,_0x57326b,_0x57326b[_0x547c('0xbf')]);if(this[_0x547c('0x8b')](_0x57326b[_0x547c('0xe1')])){var _0x855cb3=this['getVariable'][_0x547c('0xac')](this,_0x57326b[_0x547c('0xe1')]);if(_0x855cb3){this[_0x547c('0x10')][_0x547c('0xaa')](_0x855cb3,_0x44c078);return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x1c1'),_0x57326b[_0x547c('0xbf')],_0x855cb3));}}return this[_0x547c('0x10')][_0x547c('0xb0')](util['format']('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x57326b['command']));};AGIVertices[_0x547c('0x13')][_0x547c('0x1c2')]=function(_0x4a38af){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x1c3'),_0x4a38af[_0x547c('0x3b')]));_0x4a38af[_0x547c('0x62')]=_0x4a38af[_0x547c('0x62')][_0x547c('0x5e')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x4a38af[_0x547c('0x60')])){return this[_0x547c('0x10')]['noop'](_0x547c('0x1c4'));}if(!this[_0x547c('0x8b')](_0x4a38af['text'])){return this[_0x547c('0x10')][_0x547c('0xb0')](_0x547c('0xb1'));}this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x1c5'),_0x4a38af['text']));var _0xea5d21=this['googleCloudTTS']['sync'](this,_0x4a38af);if(_0xea5d21){this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x1c6'),_0xea5d21));var _0x105da8=this['channel'][_0x547c('0x106')](_0xea5d21);try{fs[_0x547c('0x124')](_0xea5d21+_0x547c('0x125'));}catch(_0x4b4130){logger['error'](_0x4b4130);}return _0x105da8;}return this[_0x547c('0x10')][_0x547c('0x31')](_0x4a38af,_0x547c('0x1c7'));};AGIVertices[_0x547c('0x13')][_0x547c('0x1c8')]=function(_0x7bfc89){logger['info'](util[_0x547c('0x2d')](_0x547c('0x1c9'),_0x7bfc89['label']));_0x7bfc89[_0x547c('0x62')]=_0x7bfc89[_0x547c('0x62')][_0x547c('0x5e')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x7bfc89[_0x547c('0x62')])){return this[_0x547c('0x10')][_0x547c('0xb0')]('no\x20text\x20configured');}this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x1ca'),_0x7bfc89['text']));var _0x2a3508=this[_0x547c('0x67')][_0x547c('0xac')](this,_0x7bfc89);if(_0x2a3508){this[_0x547c('0x10')]['noop'](util['format'](_0x547c('0x1cb'),_0x2a3508));var _0x3e79e1=this[_0x547c('0x10')][_0x547c('0x106')](_0x2a3508);try{fs[_0x547c('0x124')](_0x2a3508+'.wav');}catch(_0x40fa4b){logger[_0x547c('0x31')](_0x40fa4b);}return _0x3e79e1;}return this['channel'][_0x547c('0x31')](_0x7bfc89,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x547c('0x13')][_0x547c('0x1cc')]=function(_0x56932e){logger['info'](util['format'](_0x547c('0x1cd'),_0x56932e[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x56932e[_0x547c('0x158')])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x56932e,_0x547c('0x15f'));}logger['info'](util[_0x547c('0x2d')](_0x547c('0x157'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x56932e['findBy']));var _0x46e7a9=this['agentUnpause'][_0x547c('0xac')](this,_0x56932e['findBy']);if(_0x46e7a9){logger[_0x547c('0x34')](util[_0x547c('0x2d')](_0x547c('0x159'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x56932e['findBy']));this['channel'][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x159'),this[_0x547c('0x10')][_0x547c('0x3e')],_0x56932e['findBy']));return{'code':0xc8,'result':_0x547c('0x15a')};}else{logger[_0x547c('0x34')](util[_0x547c('0x2d')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x547c('0x10')]['callerid'],_0x56932e[_0x547c('0x158')]));this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x15b'),this['channel'][_0x547c('0x3e')],_0x56932e[_0x547c('0x158')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x547c('0x13')]['voicemail']=function(_0x5ce54a){logger['info'](util[_0x547c('0x2d')](_0x547c('0x1ce'),_0x5ce54a[_0x547c('0x3b')]));var _0x44f83e=this[_0x547c('0x10')][_0x547c('0x5c')](_0x547c('0x1cf'),[_0x5ce54a['mailbox'],_0x5ce54a[_0x547c('0x7e')]]);if(_0x44f83e[_0x547c('0xb2')]===-0x1){return _0x44f83e;}return this[_0x547c('0x10')][_0x547c('0xb0')](util[_0x547c('0x2d')](_0x547c('0x1d0'),_0x547c('0x1cf'),_0x5ce54a[_0x547c('0x1d1')]));};AGIVertices[_0x547c('0x13')][_0x547c('0x1d2')]=function(_0x11cf1b){logger['info'](util[_0x547c('0x2d')](_0x547c('0x1d3'),_0x11cf1b[_0x547c('0x3b')]));if(!this[_0x547c('0x8b')](_0x11cf1b[_0x547c('0xe1')])){return this[_0x547c('0x10')][_0x547c('0x31')](_0x11cf1b,_0x547c('0x1b0'));}var _0x5d47ae=this[_0x547c('0x14')]['sync'](this,_0x11cf1b[_0x547c('0xe1')]);if(!_0x5d47ae){return this[_0x547c('0x10')][_0x547c('0x31')](_0x11cf1b,_0x547c('0x16b'));}var _0x391845=this[_0x547c('0x10')][_0x547c('0x14')](_0x5d47ae);return{'code':0xc8,'result':_0x391845['extra']?_0x391845[_0x547c('0xa7')]:'-'};};String['prototype'][_0x547c('0xa6')]=function(_0xc48591,_0x156307){return this[_0x547c('0xa5')](_0xc48591)[_0x547c('0x1d4')](_0x156307);};module['exports']=AGIVertices;
\ No newline at end of file
+var _0x6aa1=['getVariableById','then','name','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getSoundById','getSoundPath','getMailAccount','getMailAccountById','sendMailMessage','getIntervalById','IntervalId','map','Intervals','interval','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','query','Error\x20executing\x20query\x20%s','info','Query\x20executed\x20correctly\x20%s','close','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','agicommand','arg_1','callerid','createSquareRecording','uniqueid','calleridname','context','priority','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','callback','Callback\x20scheduled\x20at\x20','scheduledAt','toString','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','trim','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','restAPI','url','method','number','timeout','includes','POST','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','headers','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','dialogflowV2_project_id','client_email','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_voice','Amy','aws_text_type','awsLex','aws_bot_name','googleASR','key','google_asr_language','tildeASR','appid','clone','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','replaceObjectAllVariables','split','replaceAll','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','label','noop','no\x20text\x20configured','exec','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','minutes','callback_priority','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','variable_id','no\x20variable\x20found','forEach','keys','%s_ROWS_COUNT','dial','debug','sip_id','DIAL','SIP/%s','opts','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','DIALOGFLOW_%s','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','googleDialogflowV2','providerResponse','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20username\x20configured','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','.wav','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','getTrunk','trunk_name','finally','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getSound','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','mindigit','hiddendigitsnum','generate','first','substr','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','recordFile','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','appsecret','no\x20appsecret\x20configured','intKey','tilde\x20%s\x20file\x20created','gotoc','continueAt','extension','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','gotoiftime','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','NOBEEP','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','%s/recordings/%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','statusMessage','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','sms_account_id','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','127.0.0.1','system','shellCommand','command','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','exports','lodash','shelljs','odbc','randomstring','moment','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','channel','rpc','mailRpc','prototype','getVariable'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6aa1,0x1b5));var _0x16aa=function(_0xef0b6b,_0x3fda41){_0xef0b6b=_0xef0b6b-0x0;var _0x32d020=_0x6aa1[_0xef0b6b];return _0x32d020;};'use strict';var fs=require('fs');var path=require('path');var util=require('util');var _=require(_0x16aa('0x0'));var sh=require(_0x16aa('0x1'));var odbc=require(_0x16aa('0x2'))();var rs=require(_0x16aa('0x3'));var moment=require(_0x16aa('0x4'));var Mustache=require('mustache');var rp=require(_0x16aa('0x5'));var logger=require(_0x16aa('0x6'))(_0x16aa('0x7'));var config=require(_0x16aa('0x8'));var scripts=require(_0x16aa('0x9'));var FILES_PATH=_0x16aa('0xa');var recursiveMapAttributes=[_0x16aa('0xb'),_0x16aa('0xc')];var verticesWithRetry=[_0x16aa('0xd'),'getdigits','getsecretdigits'];var AGIVertices=function(_0x4003fd,_0x4f90ce,_0x29658f){this[_0x16aa('0xe')]=_0x4003fd;this[_0x16aa('0xf')]=_0x4f90ce;this[_0x16aa('0x10')]=_0x29658f;};AGIVertices[_0x16aa('0x11')][_0x16aa('0x12')]=function(_0x37c4f4,_0x49d13a){this[_0x16aa('0xf')][_0x16aa('0x13')](_0x37c4f4)[_0x16aa('0x14')](function(_0x16ef79){_0x49d13a(null,_0x16ef79?_0x16ef79[_0x16aa('0x15')]:![]);})[_0x16aa('0x16')](function(_0x4e56b1){_0x49d13a(_0x4e56b1);});};AGIVertices['prototype'][_0x16aa('0x17')]=function(_0x760422,_0x50f9bd){this[_0x16aa('0xf')][_0x16aa('0x18')](_0x760422)[_0x16aa('0x14')](function(_0x10affb){_0x50f9bd(null,_0x10affb?_0x10affb['name']:![]);})[_0x16aa('0x16')](function(_0x58dd9a){_0x50f9bd(_0x58dd9a);});};AGIVertices['prototype'][_0x16aa('0x19')]=function(_0x42f25a,_0x2df462){this[_0x16aa('0xf')][_0x16aa('0x1a')](_0x42f25a)[_0x16aa('0x14')](function(_0x358d53){_0x2df462(null,_0x358d53?_0x358d53[_0x16aa('0x15')]:![]);})[_0x16aa('0x16')](function(_0x262432){_0x2df462(_0x262432);});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x1b')]=function(_0x2be220,_0xb509fa){this['rpc'][_0x16aa('0x1c')](_0x2be220)[_0x16aa('0x14')](function(_0x90e5a7){_0xb509fa(null,_0x90e5a7?_0x90e5a7[_0x16aa('0x1d')]:![]);})[_0x16aa('0x16')](function(_0x33c2d4){_0xb509fa(_0x33c2d4);});};AGIVertices['prototype'][_0x16aa('0x1e')]=function(_0x24b71c,_0x4f5eba){this[_0x16aa('0xf')][_0x16aa('0x1f')](_0x24b71c)[_0x16aa('0x14')](function(_0x41dcfc){_0x4f5eba(null,_0x41dcfc?_0x41dcfc[_0x16aa('0x15')]:![]);})[_0x16aa('0x16')](function(_0x21482c){_0x4f5eba(_0x21482c);});};AGIVertices[_0x16aa('0x11')]['getTrunk']=function(_0x379f59,_0x283931){this['rpc']['getTrunkById'](_0x379f59)[_0x16aa('0x14')](function(_0x47a0f4){_0x283931(null,_0x47a0f4?_0x47a0f4[_0x16aa('0x15')]:![]);})[_0x16aa('0x16')](function(_0x1d121b){_0x283931(_0x1d121b);});};AGIVertices['prototype']['getSound']=function(_0x447548,_0x377137){var _0xd80f7f=this;this[_0x16aa('0xf')][_0x16aa('0x20')](_0x447548)[_0x16aa('0x14')](function(_0x295605){_0x377137(null,_0x295605?_0xd80f7f[_0x16aa('0x21')](_0x295605['save_name']):![]);})[_0x16aa('0x16')](function(_0x1da0d7){_0x377137(_0x1da0d7);});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x22')]=function(_0x296b40,_0x61ecae){this[_0x16aa('0xf')][_0x16aa('0x23')](_0x296b40)[_0x16aa('0x14')](function(_0x736806){_0x61ecae(null,_0x736806?_0x736806:![]);})[_0x16aa('0x16')](function(_0x4f944f){_0x61ecae(_0x4f944f);});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x24')]=function(_0x3192de,_0x1329e4,_0xa98818){this[_0x16aa('0x10')][_0x16aa('0x24')](_0x3192de,_0x1329e4)['then'](function(){_0xa98818(null);})[_0x16aa('0x16')](function(_0x42d8f1){_0xa98818(_0x42d8f1);});};AGIVertices[_0x16aa('0x11')]['getIntervals']=function(_0x57e224,_0x55cb68){this[_0x16aa('0xf')][_0x16aa('0x25')](_0x57e224)[_0x16aa('0x14')](function(_0x160a26){if(_0x160a26){if(_0x160a26[_0x16aa('0x26')]){_0x55cb68(null,[_0x160a26['interval']]);}else{_0x55cb68(null,_[_0x16aa('0x27')](_0x160a26[_0x16aa('0x28')],_0x16aa('0x29')));}}else{_0x55cb68(null,![]);}})[_0x16aa('0x16')](function(_0x4b8302){_0x55cb68(_0x4b8302);});};AGIVertices[_0x16aa('0x11')]['getSoundPath']=function(_0x35ac3f){return util[_0x16aa('0x2a')](_0x16aa('0x2b'),FILES_PATH,_0x35ac3f);};AGIVertices[_0x16aa('0x11')][_0x16aa('0x2c')]=function(_0x56cc9c,_0x84853b,_0x3484ca){odbc['open'](_0x56cc9c,function(_0x297bad){if(_0x297bad){logger[_0x16aa('0x2d')](_0x16aa('0x2e'),_0x297bad);_0x3484ca(_0x297bad);}else{logger['info']('ODBC\x20connection\x20successfully');odbc[_0x16aa('0x2f')](_0x84853b,function(_0x27859,_0x473002){if(_0x27859){logger['info'](_0x16aa('0x30'),_0x84853b);_0x3484ca(_0x27859);}else{logger[_0x16aa('0x31')](_0x16aa('0x32'),_0x84853b);odbc[_0x16aa('0x33')](function(_0x1de1d3){if(_0x1de1d3){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x1de1d3);}_0x3484ca(null,_0x473002);});}});}});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x34')]=function(_0x554afa,_0x38d123){this['rpc'][_0x16aa('0x35')](_0x554afa)[_0x16aa('0x14')](function(_0x5866f5){_0x38d123(null,_0x5866f5?_0x5866f5:![]);})[_0x16aa('0x16')](function(_0x3a6e92){_0x38d123(_0x3a6e92);});};AGIVertices['prototype'][_0x16aa('0x36')]=function(_0x4db57d,_0x1c210b){this[_0x16aa('0xf')][_0x16aa('0x36')](_0x4db57d)[_0x16aa('0x14')](function(_0x23df88){_0x1c210b(null,_0x23df88);})['catch'](function(_0x2cc068){_0x1c210b(_0x2cc068);});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x37')]=function(_0x1b0c05,_0x388697,_0x31abe2){this['rpc'][_0x16aa('0x37')]({'uniqueid':this[_0x16aa('0xe')]['uniqueid'],'node':_0x1b0c05['label'],'application':_0x1b0c05[_0x16aa('0x38')],'data':_0x388697||null,'project_name':this[_0x16aa('0xe')][_0x16aa('0x39')],'callerid':this['channel'][_0x16aa('0x3a')]})[_0x16aa('0x14')](function(_0x4a2cc3){if(_0x31abe2){_0x31abe2(null,_0x4a2cc3);}})[_0x16aa('0x16')](function(_0x42eff4){if(_0x31abe2){_0x31abe2(_0x42eff4);}});};AGIVertices[_0x16aa('0x11')]['createSquareRecording']=function(_0x4ebae4,_0x5264bf,_0x2bd4cf,_0x4e0a51){this['rpc'][_0x16aa('0x3b')]({'uniqueid':this[_0x16aa('0xe')][_0x16aa('0x3c')],'callerid':this['channel'][_0x16aa('0x3a')],'calleridname':this['channel'][_0x16aa('0x3d')],'context':this[_0x16aa('0xe')][_0x16aa('0x3e')],'extension':this[_0x16aa('0xe')]['extension'],'priority':this[_0x16aa('0xe')][_0x16aa('0x3f')],'accountcode':this[_0x16aa('0xe')]['accountcode'],'dnid':this[_0x16aa('0xe')][_0x16aa('0x40')],'projectName':this[_0x16aa('0xe')]['arg_1'],'saveName':_0x5264bf,'filename':_0x4ebae4[_0x16aa('0x41')]||_0x5264bf,'savePath':_0x2bd4cf})[_0x16aa('0x14')](function(_0x22625c){_0x4e0a51(null,_0x22625c);})[_0x16aa('0x16')](function(_0x21e7a8){_0x4e0a51(_0x21e7a8);});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x42')]=function(_0x556b1c,_0x530eae,_0x82a2c3,_0x3f0a2a,_0x415bd9){this['rpc'][_0x16aa('0x42')]({'uniqueid':this[_0x16aa('0xe')][_0x16aa('0x3c')],'body':_0x556b1c,'direction':_0x530eae,'providerName':_0x82a2c3,'providerResponse':_0x3f0a2a})[_0x16aa('0x14')](function(_0x2232a9){if(_0x415bd9){_0x415bd9(null,_0x2232a9);}})['catch'](function(_0x1fbee9){if(_0x415bd9){_0x415bd9(_0x1fbee9);}});};AGIVertices['prototype'][_0x16aa('0x43')]=function(_0x178b4e,_0x13791d){this[_0x16aa('0xf')][_0x16aa('0x43')]({'firstName':_[_0x16aa('0x44')](_0x178b4e[_0x16aa('0x15')])||_[_0x16aa('0x45')](_0x178b4e['name'])?_0x16aa('0x46')+Math[_0x16aa('0x47')]():_0x178b4e[_0x16aa('0x15')],'lastName':_[_0x16aa('0x44')](_0x178b4e[_0x16aa('0x48')])||_[_0x16aa('0x45')](_0x178b4e['lastName'])?null:_0x178b4e['lastName'],'phone':_0x178b4e[_0x16aa('0x49')],'ListId':_0x178b4e[_0x16aa('0x4a')],'scheduledat':_0x178b4e['scheduledAt'],'callbackUniqueid':this[_0x16aa('0xe')]['uniqueid'],'tags':_0x16aa('0x4b'),'description':_0x16aa('0x4c')+_0x178b4e[_0x16aa('0x4d')][_0x16aa('0x4e')](),'priority':_0x178b4e['callback_priority']})[_0x16aa('0x14')](function(_0x240390){_0x13791d(null,_0x240390);})[_0x16aa('0x16')](function(_0x1eab03){_0x13791d(_0x1eab03);});};AGIVertices['prototype'][_0x16aa('0x4f')]=function(_0x5f311e,_0x4158f8){this[_0x16aa('0xf')][_0x16aa('0x50')](_0x5f311e)[_0x16aa('0x14')](function(_0x366b99){_0x4158f8(null,_0x366b99?_0x366b99['name']:![]);})[_0x16aa('0x16')](function(_0x58bf07){_0x4158f8(_0x58bf07);});};AGIVertices['prototype'][_0x16aa('0x51')]=function(_0x5bbe4a,_0xaef44a,_0x2d8726){var _0x26fb4f={'role':_0x16aa('0x52')};_0x26fb4f[_0x5bbe4a]=this[_0x16aa('0xe')]['callerid'];this['rpc'][_0x16aa('0x51')](_0x26fb4f,_0xaef44a,this[_0x16aa('0xe')][_0x16aa('0x3c')])[_0x16aa('0x14')](function(_0x5bf947){_0x2d8726(null,_[_0x16aa('0x45')](_0x5bf947)?![]:!![]);})[_0x16aa('0x16')](function(_0x47cdb6){logger['error'](_0x47cdb6);_0x2d8726(null,![]);});};AGIVertices[_0x16aa('0x11')]['agentUnpause']=function(_0x673a6c,_0x392637){var _0x54bff0={'role':_0x16aa('0x52')};_0x54bff0[_0x673a6c]=this['channel'][_0x16aa('0x3a')];this[_0x16aa('0xf')][_0x16aa('0x53')](_0x54bff0)[_0x16aa('0x14')](function(_0x3aef45){_0x392637(null,_[_0x16aa('0x45')](_0x3aef45)?![]:!![]);})[_0x16aa('0x16')](function(_0x572ab1){logger[_0x16aa('0x2d')](_0x572ab1);_0x392637(null,![]);});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x54')]=function(_0x14a159,_0x4557b6){var _0x2eae7d={'role':_0x16aa('0x52')};_0x2eae7d[_0x14a159]=this['channel'][_0x16aa('0x3a')];this['rpc'][_0x16aa('0x54')](_0x2eae7d)[_0x16aa('0x14')](function(_0x3e2bfa){_0x4557b6(null,_[_0x16aa('0x45')](_0x3e2bfa)?![]:!![]);})[_0x16aa('0x16')](function(_0x3a9ba6){logger[_0x16aa('0x2d')](_0x3a9ba6);_0x4557b6(null,![]);});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x55')]=function(_0x993ef8,_0x491762){var _0x48b06a={'role':_0x16aa('0x52')};_0x48b06a[_0x993ef8]=this[_0x16aa('0xe')][_0x16aa('0x3a')];var _0xf2d122=_0x993ef8!=_0x16aa('0x56')?util[_0x16aa('0x2a')](_0x16aa('0x57'),_0x16aa('0x58'),this[_0x16aa('0xe')]['callerid']):undefined;this[_0x16aa('0xf')][_0x16aa('0x55')](_0x48b06a,_0xf2d122)[_0x16aa('0x14')](function(_0x24a1b8){_0x491762(null,_[_0x16aa('0x45')](_0x24a1b8)?![]:!![]);})['catch'](function(_0x3905d8){logger[_0x16aa('0x2d')](_0x3905d8);_0x491762(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x40a99b,_0x18f70d){sh['exec'](_[_0x16aa('0x59')](_0x40a99b),function(_0x26c95e,_0x734763){var _0x1846d7=_0x734763[_0x16aa('0x5a')](/(\r\n|\n|\r)/gm,'');_0x18f70d(null,_0x1846d7);});};AGIVertices[_0x16aa('0x11')]['googleCloudTTS']=function(_0x596035,_0x1934b8){scripts[_0x16aa('0x5b')](_0x596035[_0x16aa('0x5c')],_0x596035['google_cloud_tts_text_type']||_0x16aa('0x5d'),_0x596035[_0x16aa('0x5d')],_0x596035[_0x16aa('0x5e')]||_0x16aa('0x5f'),_0x596035[_0x16aa('0x60')]||_0x16aa('0x61'),_0x596035[_0x16aa('0x62')]||_0x16aa('0x63'))[_0x16aa('0x14')](function(_0x2a3f3a){_0x1934b8(null,_0x2a3f3a);})[_0x16aa('0x16')](function(_0x1c30b4){_0x1934b8(_0x1c30b4);});};AGIVertices['prototype'][_0x16aa('0x64')]=function(_0x44cc30,_0x2d54e4){scripts['googleTTS'](_0x44cc30['text'],_0x44cc30['google_tts_language']||'en',0x1)[_0x16aa('0x14')](function(_0x14749a){_0x2d54e4(null,_0x14749a);})[_0x16aa('0x16')](function(_0x58b967){_0x2d54e4(_0x58b967);});};AGIVertices['prototype'][_0x16aa('0x65')]=function(_0x3e3234,_0x236d8d){var _0x294863={'uri':_0x3e3234[_0x16aa('0x66')],'method':_0x3e3234[_0x16aa('0x67')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x3e3234['timeout'])===_0x16aa('0x68')&&parseInt(_0x3e3234[_0x16aa('0x69')])>=0x1?parseInt(_0x3e3234['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x16aa('0x6a')]([_0x16aa('0x6b'),'PUT'],_0x294863[_0x16aa('0x67')]['toUpperCase']())){try{_0x294863[_0x16aa('0x6c')]=_0x3e3234['rawBody']?JSON[_0x16aa('0x6d')](_0x3e3234[_0x16aa('0xc')]):{};}catch(_0x1585cb){logger[_0x16aa('0x2d')](_0x16aa('0x6e'),_0x1585cb);}}try{_0x294863['headers']=_0x3e3234['rawHeaders']?JSON[_0x16aa('0x6d')](_0x3e3234['rawHeaders']):{};}catch(_0x1258b1){logger[_0x16aa('0x2d')](_0x16aa('0x6f'),_0x1258b1);}if(_0x3e3234[_0x16aa('0x70')]){try{var _0x36473e=require(_0x3e3234['computedVariables'])[_0x16aa('0x71')](this,_0x294863);_0x294863['uri']=Mustache[_0x16aa('0x72')](_0x3e3234[_0x16aa('0x66')],_0x36473e,{},['$$','$$']);if(_0x294863[_0x16aa('0x73')]){_0x294863[_0x16aa('0x73')]=JSON['parse'](Mustache[_0x16aa('0x72')](JSON[_0x16aa('0x74')](_0x294863[_0x16aa('0x73')]),_0x36473e,{},['$$','$$']));}if(_0x294863[_0x16aa('0x6c')]){_0x294863[_0x16aa('0x6c')]=JSON['parse'](Mustache[_0x16aa('0x72')](JSON[_0x16aa('0x74')](_0x294863['body']),_0x36473e,{},['$$','$$']));}}catch(_0x270d6d){logger[_0x16aa('0x2d')](_0x16aa('0x75'),_0x270d6d);}}rp(_0x294863)[_0x16aa('0x14')](function(_0x53acba){var _0x285f43={'statusCode':_0x53acba[_0x16aa('0x76')]||0xc8,'statusMessage':_0x53acba['statusMessage']||'OK','headers':_0x53acba['headers']||{},'body':_0x53acba[_0x16aa('0x6c')]||{}};_0x236d8d(null,_0x285f43);})[_0x16aa('0x16')](function(_0x3ee127){var _0x2f8d0d={'statusCode':_0x3ee127[_0x16aa('0x76')]||0x1f4,'statusMessage':_0x3ee127[_0x16aa('0x77')]||_0x16aa('0x78'),'headers':_0x3ee127[_0x16aa('0x79')]['headers']||{},'body':_0x3ee127['options']['body']||{}};_0x236d8d(null,_0x2f8d0d);});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x7a')]=function(_0x1c1ff9,_0x192fc0){scripts[_0x16aa('0x7a')](this[_0x16aa('0xe')][_0x16aa('0x3c')],_0x1c1ff9['key'],_0x1c1ff9[_0x16aa('0x5d')],_0x1c1ff9[_0x16aa('0x7b')]||'en')[_0x16aa('0x14')](function(_0x37fb92){_0x192fc0(null,_0x37fb92);})[_0x16aa('0x16')](function(_0x541a13){_0x192fc0(_0x541a13);});};AGIVertices[_0x16aa('0x11')]['googleDialogflowV2']=function(_0x21007b,_0x3ffbdb){scripts['googleDialogflowV2'](this[_0x16aa('0xe')][_0x16aa('0x3c')],_0x21007b[_0x16aa('0x7c')],_0x21007b[_0x16aa('0x7d')],_0x21007b[_0x16aa('0x7e')],_0x21007b[_0x16aa('0x5d')],_0x21007b['dialogflowV2_language']||'en')[_0x16aa('0x14')](function(_0x5d3b47){_0x3ffbdb(null,_0x5d3b47);})['catch'](function(_0xccadab){_0x3ffbdb(_0xccadab);});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x7f')]=function(_0x3cf14b,_0x3adbcf){scripts[_0x16aa('0x7f')](this[_0x16aa('0xe')],_0x3cf14b)[_0x16aa('0x14')](function(_0xb7ddd0){_0x3adbcf(null,_0xb7ddd0);})['catch'](function(_0x36d6d0){_0x3adbcf(_0x36d6d0);});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x80')]=function(_0x56e5af,_0x476329){scripts['ispeechTTS'](_0x56e5af['key'],_0x56e5af[_0x16aa('0x5d')],_0x56e5af[_0x16aa('0x81')]||_0x16aa('0x5f'),_0x56e5af[_0x16aa('0x82')])['then'](function(_0x2b7ddc){_0x476329(null,_0x2b7ddc);})['catch'](function(_0x41686c){_0x476329(_0x41686c);});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x83')]=function(_0x5a4c83,_0x57edf1,_0x18f844){scripts['ispeechASR'](_0x57edf1,_0x5a4c83['key'],_0x5a4c83[_0x16aa('0x84')]||_0x16aa('0x5f'),this[_0x16aa('0x85')](_0x5a4c83[_0x16aa('0x86')])?_0x5a4c83[_0x16aa('0x86')]:undefined)[_0x16aa('0x14')](function(_0x151e7e){_0x18f844(null,_0x151e7e);})[_0x16aa('0x16')](function(_0x1157fe){_0x18f844(_0x1157fe);});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x87')]=function(_0x19587d,_0xccee32){scripts['awsPolly'](_0x19587d['aws_access_key_id'],_0x19587d[_0x16aa('0x88')],_0x19587d['aws_polly_region'],_0x19587d[_0x16aa('0x89')]||_0x16aa('0x8a'),_0x19587d[_0x16aa('0x5d')],_0x19587d[_0x16aa('0x8b')]||_0x16aa('0x5d'))[_0x16aa('0x14')](function(_0x280cae){_0xccee32(null,_0x280cae);})[_0x16aa('0x16')](function(_0x207de1){_0xccee32(_0x207de1);});};AGIVertices[_0x16aa('0x11')][_0x16aa('0x8c')]=function(_0x2a7893,_0x2539c0){scripts[_0x16aa('0x8c')](this[_0x16aa('0xe')][_0x16aa('0x3c')],_0x2a7893['aws_access_key_id'],_0x2a7893['aws_secret_access_key'],_0x2a7893['aws_lex_region'],_0x2a7893[_0x16aa('0x5d')],_0x2a7893[_0x16aa('0x8d')])['then'](function(_0x4c5363){_0x2539c0(null,_0x4c5363);})[_0x16aa('0x16')](function(_0x157b17){_0x2539c0(_0x157b17);});};AGIVertices['prototype'][_0x16aa('0x8e')]=function(_0x23db92,_0x59291a,_0x570465){scripts[_0x16aa('0x8e')](_0x59291a,_0x23db92[_0x16aa('0x8f')],_0x23db92[_0x16aa('0x90')]||'en-US')[_0x16aa('0x14')](function(_0x3afd75){_0x570465(null,_0x3afd75);})['catch'](function(_0x44b109){_0x570465(_0x44b109);});};AGIVertices[_0x16aa('0x11')]['tildeASR']=function(_0x4a2382,_0x32b531,_0x55edc1){scripts[_0x16aa('0x91')](_0x32b531,_0x4a2382[_0x16aa('0x92')],_0x4a2382['appsecret'],_0x4a2382['uri'])[_0x16aa('0x14')](function(_0x5bf008){_0x55edc1(null,_0x5bf008);})[_0x16aa('0x16')](function(_0xe36d0c){_0x55edc1(_0xe36d0c);});};AGIVertices[_0x16aa('0x11')]['clear']=function(_0x40db63){var _0x1b97cf=_[_0x16aa('0x6a')](verticesWithRetry,_0x40db63['agicommand'])?_0x40db63:_[_0x16aa('0x93')](_0x40db63);for(var _0x4d9de1 in _0x1b97cf){if(_0x1b97cf[_0x16aa('0x94')](_0x4d9de1)){if(_0x1b97cf[_0x4d9de1]&&_[_0x16aa('0x95')](_0x1b97cf[_0x4d9de1])){if(_[_0x16aa('0x6a')](recursiveMapAttributes,_0x4d9de1)){_0x1b97cf[_0x4d9de1]=this['replaceObjectAllVariables'](_0x1b97cf[_0x4d9de1]);}else{_0x1b97cf[_0x4d9de1]=this[_0x16aa('0x96')](_0x1b97cf[_0x4d9de1]);}}}}return _0x1b97cf;};AGIVertices[_0x16aa('0x11')][_0x16aa('0x97')]=function(_0x4e8b9c){for(var _0x14c7ac in _0x4e8b9c){if(_0x4e8b9c[_0x16aa('0x94')](_0x14c7ac)){if(_[_0x16aa('0x98')](_0x4e8b9c[_0x14c7ac])){this[_0x16aa('0x97')](_0x4e8b9c[_0x14c7ac]);}else if(_[_0x16aa('0x99')](_0x4e8b9c[_0x14c7ac])){for(var _0x178e6d=0x0;_0x178e6d<_0x4e8b9c[_0x14c7ac][_0x16aa('0x9a')];_0x178e6d++){this[_0x16aa('0x97')](_0x4e8b9c[_0x14c7ac][_0x178e6d]);}}else if(_[_0x16aa('0x95')](_0x4e8b9c[_0x14c7ac])){_0x4e8b9c[_0x14c7ac]=this[_0x16aa('0x96')](_0x4e8b9c[_0x14c7ac]);}}}};AGIVertices[_0x16aa('0x11')]['saveRestApiResult']=function(_0x2a82d8,_0x56e1b4){for(var _0x120e44 in _0x2a82d8){if(_0x2a82d8['hasOwnProperty'](_0x120e44)){if(_[_0x16aa('0x98')](_0x2a82d8[_0x120e44])){if(!_[_0x16aa('0x44')](_0x2a82d8[_0x120e44])){this[_0x16aa('0x9b')](_0x2a82d8[_0x120e44],util[_0x16aa('0x2a')](_0x16aa('0x9c'),_0x56e1b4,_0x120e44));}}else if(_[_0x16aa('0x99')](_0x2a82d8[_0x120e44])){for(var _0xa6b953=0x0;_0xa6b953<_0x2a82d8[_0x120e44][_0x16aa('0x9a')];_0xa6b953++){this[_0x16aa('0x9b')](_0x2a82d8[_0x120e44][_0xa6b953],util[_0x16aa('0x2a')](_0x16aa('0x9c'),_0x56e1b4,_0x120e44+'['+_0xa6b953+']'));}}else{if(!_[_0x16aa('0x45')](_0x2a82d8[_0x120e44])){this[_0x16aa('0xe')][_0x16aa('0x9d')](util[_0x16aa('0x2a')](_0x16aa('0x9c'),_0x56e1b4,_0x120e44),_0x2a82d8[_0x120e44]);}}}}};AGIVertices['prototype'][_0x16aa('0x9e')]=function(_0x443861){try{var _0x1a0784=JSON[_0x16aa('0x6d')](_0x443861);this[_0x16aa('0x97')](_0x1a0784);return JSON[_0x16aa('0x74')](_0x1a0784);}catch(_0x546e53){return this[_0x16aa('0x96')](_0x443861);}};AGIVertices[_0x16aa('0x11')][_0x16aa('0x96')]=function(_0x31f2d6){var _0x4beb22=_0x31f2d6['split']('{');for(var _0x4fb884=0x1;_0x4fb884<_0x4beb22['length'];_0x4fb884+=0x1){var _0x2055a9=_0x4beb22[_0x4fb884][_0x16aa('0x9f')]('}');if(_0x2055a9[_0x16aa('0x9a')]>0x1){_0x31f2d6=_0x31f2d6[_0x16aa('0xa0')]('{'+_0x2055a9[0x0]+'}',this['channel']['getVariable'](_0x2055a9[0x0])['extra']||_0x2055a9[0x0]);}}if(_0x4beb22[_0x16aa('0x9a')]===0x1){return _0x31f2d6[_0x16aa('0x4e')]();}return this[_0x16aa('0x96')](_0x31f2d6);};AGIVertices[_0x16aa('0x11')][_0x16aa('0xa1')]=function(_0x11e424,_0x281c6c){var _0x1f4e4b=this[_0x16aa('0xe')]['getVariable'](_0x11e424);if(_0x1f4e4b[_0x16aa('0xa2')]===-0x1){return _0x1f4e4b;}logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0xa3'),_0x281c6c,_0x1f4e4b[_0x16aa('0xa4')]));return this[_0x16aa('0xe')]['setVariable'](_0x281c6c,_0x1f4e4b[_0x16aa('0xa4')]);};AGIVertices['prototype'][_0x16aa('0x85')]=function(_0x550e8a){return _0x550e8a&&_0x550e8a!=='0'&&_0x550e8a!=='-1'&&_0x550e8a!=='';};AGIVertices[_0x16aa('0x11')][_0x16aa('0xa5')]=function(_0x52d506){this[_0x16aa('0x37')][_0x16aa('0x71')](this,_0x52d506,'-');_0x52d506[_0x16aa('0xa6')]=_0x52d506['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x16aa('0x11')][_0x16aa('0xa7')]=function(_0x101333){logger[_0x16aa('0x31')](util['format'](_0x16aa('0xa8'),_0x101333[_0x16aa('0xa9')]));if(!this['isConfigured'](_0x101333['text'])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0xab'));}var _0x19ed7b='\x22'+_0x101333['text']+'\x22';if(this[_0x16aa('0x85')](_0x101333[_0x16aa('0x79')])){_0x19ed7b+=','+_0x101333['options'];}var _0x178c65=this[_0x16aa('0xe')][_0x16aa('0xac')](_0x16aa('0xad'),_0x19ed7b);if(_0x178c65[_0x16aa('0xa2')]===-0x1){return _0x178c65;}return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0x19ed7b));};AGIVertices[_0x16aa('0x11')][_0x16aa('0xae')]=function(_0x4fc0ef){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0xaf'),_0x4fc0ef[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x4fc0ef[_0x16aa('0xb0')])){return this['channel'][_0x16aa('0xaa')](_0x16aa('0xb1'));}var _0x582b8e=_0x4fc0ef[_0x16aa('0xb0')];if(this['isConfigured'](_0x4fc0ef[_0x16aa('0x79')])){_0x582b8e+=','+_0x4fc0ef['options'];}var _0x5959e0=this['channel'][_0x16aa('0xac')](_0x16aa('0xb2'),_0x582b8e);if(_0x5959e0['result']===-0x1){return _0x5959e0;}var _0x2563b4=this[_0x16aa('0xa1')]('RECOG_CONFIDENCE()',_0x16aa('0xb3'));if(_0x2563b4['result']===-0x1){return _0x2563b4;}var _0x390d74=this[_0x16aa('0xa1')](_0x16aa('0xb4'),_0x16aa('0xb5'));if(_0x390d74[_0x16aa('0xa2')]===-0x1){return _0x390d74;}var _0x4df897=this[_0x16aa('0xa1')](_0x16aa('0xb6'),'MRCP_RECOG_INSTANCE');if(_0x4df897[_0x16aa('0xa2')]===-0x1){return _0x4df897;}return this[_0x16aa('0xe')][_0x16aa('0xaa')](util['format'](_0x16aa('0xb7'),_0x582b8e));};AGIVertices[_0x16aa('0x11')][_0x16aa('0x7')]=function(_0x3a6b64){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0xb8'),_0x3a6b64[_0x16aa('0xa9')]));return this[_0x16aa('0xe')][_0x16aa('0x7')]([_0x3a6b64['command'],_0x3a6b64[_0x16aa('0xb9')]]);};AGIVertices[_0x16aa('0x11')][_0x16aa('0xba')]=function(_0x1d64b4){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0xbb'),_0x1d64b4[_0x16aa('0xa9')]));if(this[_0x16aa('0x85')](_0x1d64b4['timeout'])){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x1d64b4[_0x16aa('0x69')]));var _0x159d50=this[_0x16aa('0xe')][_0x16aa('0xbc')](_0x1d64b4[_0x16aa('0x69')]);if(_0x159d50[_0x16aa('0xa2')]===-0x1){return _0x159d50;}}return this[_0x16aa('0xe')]['answer']();};AGIVertices[_0x16aa('0x11')][_0x16aa('0x4b')]=function(_0x2c5c88){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0xbd'),_0x2c5c88['label']));if(!this[_0x16aa('0x85')](_0x2c5c88['list_id'])){return this['channel'][_0x16aa('0x2d')](_0x2c5c88,_0x16aa('0xbe'));}_0x2c5c88[_0x16aa('0x4d')]=moment();if(this['isConfigured'](_0x2c5c88[_0x16aa('0xbf')])){_0x2c5c88['scheduledAt']=moment()['add'](_0x2c5c88['delay'],_0x16aa('0xc0'));}if(!this['isConfigured'](_0x2c5c88['callback_priority'])){_0x2c5c88[_0x16aa('0xc1')]=0x2;}this[_0x16aa('0x43')]['sync'](this,_0x2c5c88);return this[_0x16aa('0xe')]['noop'](util['format'](_0x16aa('0xc2'),_0x2c5c88['phone'],_0x2c5c88['list_id'],_0x2c5c88['scheduledAt']));};AGIVertices[_0x16aa('0x11')][_0x16aa('0xc3')]=function(_0x434ea8){logger[_0x16aa('0x31')](util['format'](_0x16aa('0xc4'),_0x434ea8[_0x16aa('0xa9')]));var _0x33742b=this['channel']['exec'](_0x434ea8[_0x16aa('0xc5')],_0x434ea8[_0x16aa('0x79')]);if(_0x33742b[_0x16aa('0xa2')]===-0x1){return _0x33742b;}return this[_0x16aa('0xe')]['noop'](util['format'](_0x16aa('0xc6'),_0x434ea8[_0x16aa('0xc5')],_0x434ea8[_0x16aa('0x79')]));};AGIVertices[_0x16aa('0x11')][_0x16aa('0xc7')]=function(_0x2245e4){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0xc8'),_0x2245e4['label']));if(!this[_0x16aa('0x85')](_0x2245e4[_0x16aa('0x5d')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0xab'));}var _0x34fcb9='\x22'+_0x2245e4[_0x16aa('0x5d')]+'\x22';if(this[_0x16aa('0x85')](_0x2245e4[_0x16aa('0x79')])){_0x34fcb9+=','+_0x2245e4[_0x16aa('0x79')];}var _0x372331=this[_0x16aa('0xe')][_0x16aa('0xac')]('MRCPSynth',_0x34fcb9);if(_0x372331[_0x16aa('0xa2')]===-0x1){return _0x372331;}return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0xc9'),_0x34fcb9));};AGIVertices[_0x16aa('0x11')][_0x16aa('0xca')]=function(_0x4a5424){logger['info'](util['format'](_0x16aa('0xcb'),_0x4a5424['label']));if(!this[_0x16aa('0x85')](_0x4a5424[_0x16aa('0x5d')])){return this[_0x16aa('0xe')]['noop'](_0x16aa('0xab'));}var _0xd0c680='\x22'+_0x4a5424['text']+'\x22';if(this[_0x16aa('0x85')](_0x4a5424[_0x16aa('0x79')])){_0xd0c680+=','+_0x4a5424[_0x16aa('0x79')];}var _0x38b214=this[_0x16aa('0xe')][_0x16aa('0xac')](_0x16aa('0xad'),_0xd0c680);if(_0x38b214[_0x16aa('0xa2')]===-0x1){return _0x38b214;}return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')]('Executed\x20command\x20MRCPSynth\x20%s',_0xd0c680));};AGIVertices[_0x16aa('0x11')][_0x16aa('0xcc')]=function(_0x33fe5b){logger['info'](util[_0x16aa('0x2a')](_0x16aa('0xcd'),_0x33fe5b[_0x16aa('0xa9')]));if(!this['isConfigured'](_0x33fe5b[_0x16aa('0xb0')])){return this[_0x16aa('0xe')]['noop'](_0x16aa('0xb1'));}var _0xd0e5fe=_0x33fe5b[_0x16aa('0xb0')];if(this[_0x16aa('0x85')](_0x33fe5b[_0x16aa('0x79')])){_0xd0e5fe+=','+_0x33fe5b[_0x16aa('0x79')];}var _0x4b955f=this['channel']['exec'](_0x16aa('0xb2'),_0xd0e5fe);if(_0x4b955f['result']===-0x1){return _0x4b955f;}var _0x2a19c1=this[_0x16aa('0xa1')](_0x16aa('0xce'),'LUMENVOX_ASR_CONFIDENCE');if(_0x2a19c1[_0x16aa('0xa2')]===-0x1){return _0x2a19c1;}var _0x3e9fcd=this['getAndSetVariable'](_0x16aa('0xb4'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x3e9fcd['result']===-0x1){return _0x3e9fcd;}var _0x155bed=this[_0x16aa('0xa1')](_0x16aa('0xb6'),_0x16aa('0xcf'));if(_0x155bed[_0x16aa('0xa2')]===-0x1){return _0x155bed;}return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0xb7'),_0xd0e5fe));};AGIVertices[_0x16aa('0x11')][_0x16aa('0xd0')]=function(_0x38287d){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0xd1'),_0x38287d[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x38287d[_0x16aa('0xb0')])){return this[_0x16aa('0xe')]['noop'](_0x16aa('0xb1'));}var _0x2a820f=_0x38287d[_0x16aa('0xb0')];if(this[_0x16aa('0x85')](_0x38287d[_0x16aa('0x79')])){_0x2a820f+=','+_0x38287d[_0x16aa('0x79')];}var _0x5c4e37=this[_0x16aa('0xe')][_0x16aa('0xac')]('MRCPRecog',_0x2a820f);if(_0x5c4e37[_0x16aa('0xa2')]===-0x1){return _0x5c4e37;}var _0x1ee381=this[_0x16aa('0xa1')]('RECOG_CONFIDENCE()',_0x16aa('0xd2'));if(_0x1ee381[_0x16aa('0xa2')]===-0x1){return _0x1ee381;}var _0x13000b=this[_0x16aa('0xa1')]('RECOG_INPUT()',_0x16aa('0xd3'));if(_0x13000b['result']===-0x1){return _0x13000b;}var _0x36221a=this[_0x16aa('0xa1')](_0x16aa('0xb6'),_0x16aa('0xd4'));if(_0x36221a[_0x16aa('0xa2')]===-0x1){return _0x36221a;}return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0xb7'),_0x2a820f));};AGIVertices['prototype'][_0x16aa('0xd5')]=function(_0x21f330){logger[_0x16aa('0x31')](util['format'](_0x16aa('0xd6'),_0x21f330[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x21f330[_0x16aa('0xd7')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x21f330,_0x16aa('0xd8'));}var _0x24e03b=this['getSquareOdbc']['sync'](this,_0x21f330[_0x16aa('0xd7')]);if(!_0x24e03b){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x21f330,'no\x20odbc\x20database\x20found');}if(!this[_0x16aa('0x85')](_0x21f330[_0x16aa('0x2f')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x21f330,'no\x20query\x20configured');}var _0x39c80e=_0x21f330[_0x16aa('0x2f')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x16aa('0xe')]['noop'](util[_0x16aa('0x2a')]('query:\x20%s',_0x39c80e));var _0x45b865=this[_0x16aa('0x2c')][_0x16aa('0x71')](this,_0x24e03b,_0x39c80e);this['createSquareDetailsReport']['sync'](this,_0x21f330,_0x39c80e);if(!this[_0x16aa('0x85')](_0x21f330[_0x16aa('0xd9')])){return this['channel'][_0x16aa('0xaa')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x174cbc=this[_0x16aa('0x12')][_0x16aa('0x71')](this,_0x21f330[_0x16aa('0xd9')]);if(!_0x174cbc){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x21f330,_0x16aa('0xda'));}var _0x103f90=this;_0x45b865[_0x16aa('0xdb')](function(_0x5a0711,_0x285c79){Object[_0x16aa('0xdc')](_0x5a0711)['forEach'](function(_0x164608){_0x103f90[_0x16aa('0xe')][_0x16aa('0x9d')](util[_0x16aa('0x2a')]('%s[%s][%s]',_0x174cbc,_0x285c79,_0x164608),_0x5a0711[_0x164608]);});});this[_0x16aa('0xe')]['setVariable'](util[_0x16aa('0x2a')](_0x16aa('0xdd'),_0x174cbc),_0x45b865[_0x16aa('0x9a')]);return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')]('variable\x20%s\x20set',_0x174cbc));};AGIVertices['prototype'][_0x16aa('0xde')]=function(_0xbd18fb){logger[_0x16aa('0xdf')](util[_0x16aa('0x2a')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0xbd18fb[_0x16aa('0xa9')]));if(!this['isConfigured'](_0xbd18fb[_0x16aa('0xe0')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0xbd18fb,'no\x20user\x20selected');}var _0x269aee=this[_0x16aa('0x1e')]['sync'](this,_0xbd18fb['sip_id']);if(!_0x269aee){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0xbd18fb,'no\x20user\x20found');}var _0x500d2c=this[_0x16aa('0xe')][_0x16aa('0xac')](_0x16aa('0xe1'),[util['format'](_0x16aa('0xe2'),_0x269aee),_0xbd18fb[_0x16aa('0x69')],_0xbd18fb[_0x16aa('0xe3')],_0xbd18fb[_0x16aa('0x66')]]);if(_0x500d2c[_0x16aa('0xa2')]===-0x1){return _0x500d2c;}return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')]('Executed\x20command\x20%s',_0x16aa('0xe1')));};AGIVertices[_0x16aa('0x11')][_0x16aa('0xe4')]=function(_0x4bf0cc){logger['info'](util[_0x16aa('0x2a')](_0x16aa('0xe5'),_0x4bf0cc[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x4bf0cc[_0x16aa('0x8f')])){return this['channel'][_0x16aa('0xaa')](_0x16aa('0xe6'));}if(!this[_0x16aa('0x85')](_0x4bf0cc[_0x16aa('0x5d')])){return this['channel'][_0x16aa('0xaa')](_0x16aa('0xab'));}this[_0x16aa('0xe')][_0x16aa('0xe7')]=!![];this['createSquareDetailsReport'](_0x4bf0cc);this[_0x16aa('0x42')](_0x4bf0cc[_0x16aa('0x5d')],'in','','');this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')]('Trying\x20Dialogflow:\x20%s',_0x4bf0cc[_0x16aa('0x5d')]));var _0x438ef5=this[_0x16aa('0x7a')]['sync'](this,_0x4bf0cc);if(_0x438ef5){for(var _0x1f8ea2 in _0x438ef5){if(_0x438ef5[_0x16aa('0x94')](_0x1f8ea2)){this['channel'][_0x16aa('0x9d')](util[_0x16aa('0x2a')](_0x16aa('0xe8'),_0x1f8ea2[_0x16aa('0xe9')]()),_0x438ef5[_0x1f8ea2]);}}this[_0x16aa('0x42')](_0x438ef5[_0x16aa('0xea')],_0x16aa('0xeb'),_0x16aa('0xe4'),'');return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0xec'),_0x438ef5['speech']));}return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x4bf0cc,_0x16aa('0xed'));};AGIVertices['prototype'][_0x16aa('0xee')]=function(_0x1909b5){logger['info'](util[_0x16aa('0x2a')](_0x16aa('0xef'),_0x1909b5[_0x16aa('0xa9')]));if(!this['isConfigured'](_0x1909b5['dialogflowV2_project_id'])){return this[_0x16aa('0xe')]['noop'](_0x16aa('0xf0'));}if(!this[_0x16aa('0x85')](_0x1909b5[_0x16aa('0x7d')])){return this['channel'][_0x16aa('0xaa')](_0x16aa('0xf1'));}if(!this[_0x16aa('0x85')](_0x1909b5['private_key'])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0xf2'));}if(!this[_0x16aa('0x85')](_0x1909b5[_0x16aa('0xf3')])){return this['channel'][_0x16aa('0xaa')](_0x16aa('0xf4'));}if(!this['isConfigured'](_0x1909b5[_0x16aa('0x5d')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')]('no\x20text\x20configured');}this[_0x16aa('0xe')][_0x16aa('0xe7')]=!![];this[_0x16aa('0x37')](_0x1909b5);this[_0x16aa('0x42')](_0x1909b5[_0x16aa('0x5d')],'in','','');this[_0x16aa('0xe')]['noop'](util['format'](_0x16aa('0xf5'),_0x1909b5['text']));var _0x506cc0=this[_0x16aa('0xf6')]['sync'](this,_0x1909b5);if(_0x506cc0){for(var _0x4a5935 in _0x506cc0){if(_0x506cc0[_0x16aa('0x94')](_0x4a5935)){if(_0x4a5935!=='providerResponse'){this[_0x16aa('0xe')][_0x16aa('0x9d')](util[_0x16aa('0x2a')]('DIALOGFLOW_%s',_0x4a5935[_0x16aa('0xe9')]()),_0x506cc0[_0x4a5935]);}}}this[_0x16aa('0x42')](_0x506cc0['speech'],_0x16aa('0xeb'),_0x16aa('0xee'),_0x506cc0[_0x16aa('0xf7')]);return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')]('DialogflowV2\x20Result\x20%s',_0x506cc0[_0x16aa('0xea')]));}return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x1909b5,'DialogflowV2\x20is\x20unreachable');};AGIVertices[_0x16aa('0x11')][_0x16aa('0xf8')]=function(_0x322da8){logger[_0x16aa('0x31')](util['format'](_0x16aa('0xf9'),_0x322da8['label']));if(!this[_0x16aa('0x85')](_0x322da8[_0x16aa('0xfa')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x16aa('0x85')](_0x322da8['username'])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0xfb'));}if(!this[_0x16aa('0x85')](_0x322da8[_0x16aa('0xfc')])){return this[_0x16aa('0xe')]['noop'](_0x16aa('0xfd'));}if(!this[_0x16aa('0x85')](_0x322da8['ndassistant_url'])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0xab'));}this['channel']['bot']=!![];this[_0x16aa('0x37')](_0x322da8);this[_0x16aa('0x42')](_0x322da8[_0x16aa('0x5d')],'in','','');this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0xfe'),_0x322da8[_0x16aa('0x5d')]));var _0x65f68=this['sestekNDA']['sync'](this,_0x322da8);if(_0x65f68){for(var _0x147ab6 in _0x65f68){if(_0x65f68[_0x16aa('0x94')](_0x147ab6)){this[_0x16aa('0xe')][_0x16aa('0x9d')](util[_0x16aa('0x2a')]('SESTEK_NDA_%s',_0x147ab6[_0x16aa('0xe9')]()),_0x65f68[_0x147ab6]);}}this[_0x16aa('0x42')](_0x65f68['speech'],_0x16aa('0xeb'),'sesteknda','');if(_0x65f68[_0x16aa('0xff')]){this[_0x16aa('0xe')][_0x16aa('0xaa')](util['format'](_0x16aa('0x100'),_0x65f68['audiofile']));var _0x3369f0=this[_0x16aa('0xe')][_0x16aa('0x101')](_0x65f68['audiofile']);try{fs['unlink'](_0x65f68[_0x16aa('0xff')]+_0x16aa('0x102'));}catch(_0x330a22){logger[_0x16aa('0x2d')](_0x330a22);}return _0x3369f0;}else{return this[_0x16aa('0xe')][_0x16aa('0xaa')](util['format'](_0x16aa('0x103'),_0x65f68['speech']));}}return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x322da8,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype'][_0x16aa('0x104')]=function(_0x5bcf90){logger[_0x16aa('0x31')](util['format']('Enter\x20in\x20END\x20(%s)\x20block',_0x5bcf90['label']));return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0x104'));};AGIVertices[_0x16aa('0x11')]['ext_dial']=function(_0x5b7366){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x105'),_0x5b7366[_0x16aa('0xa9')]));var _0x548aba='';if(_0x5b7366[_0x16aa('0x106')]){if(!this[_0x16aa('0x85')](_0x5b7366[_0x16aa('0x106')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x5b7366,_0x16aa('0x107'));}else{var _0x7c3bd8=parseInt(_0x5b7366[_0x16aa('0x106')],0xa);if(isNaN(_0x7c3bd8)){_0x548aba=_0x5b7366[_0x16aa('0x106')];}else{_0x548aba=this[_0x16aa('0x108')]['sync'](this,_0x5b7366[_0x16aa('0x106')]);if(!_0x548aba){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x5b7366,'no\x20trunk\x20found');}}}}else if(_0x5b7366[_0x16aa('0x109')]){_0x548aba=_0x5b7366[_0x16aa('0x109')];}else{return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x5b7366,'no\x20trunk\x20selected');}var _0x37c11e=this[_0x16aa('0xe')]['exec'](_0x16aa('0xe1'),[util[_0x16aa('0x2a')]('SIP/%s/%s',_0x548aba,_0x5b7366[_0x16aa('0x49')]),_0x5b7366[_0x16aa('0x69')],_0x5b7366[_0x16aa('0xe3')],_0x5b7366[_0x16aa('0x66')]]);if(_0x37c11e['result']===-0x1){return _0x37c11e;}return this[_0x16aa('0xe')]['noop'](util['format']('Executed\x20command\x20%s','DIAL'));};AGIVertices[_0x16aa('0x11')][_0x16aa('0x10a')]=function(_0x4ddecb){logger[_0x16aa('0x31')](util['format']('Enter\x20in\x20FINALLY\x20(%s)\x20block',_0x4ddecb[_0x16aa('0xa9')]));return this[_0x16aa('0xe')][_0x16aa('0xaa')]('finally');};AGIVertices['prototype'][_0x16aa('0x10b')]=function(_0x4223f2){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x10c'),_0x4223f2[_0x16aa('0xa9')]));if(_0x4223f2[_0x16aa('0xa6')]===0x0){return this[_0x16aa('0xa5')](_0x4223f2);}_0x4223f2['retry']-=0x1;if(!this[_0x16aa('0x85')](_0x4223f2[_0x16aa('0x10d')])){return this['channel'][_0x16aa('0x2d')](_0x4223f2,_0x16aa('0x10e'));}var _0x40470e=this[_0x16aa('0x10f')][_0x16aa('0x71')](this,_0x4223f2[_0x16aa('0x10d')]);if(!_0x40470e){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x4223f2,_0x16aa('0x110'));}if(!this[_0x16aa('0x85')](_0x4223f2[_0x16aa('0xd9')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x16aa('0x111'));}var _0x2ddde0=this[_0x16aa('0xe')][_0x16aa('0x112')](_0x40470e,_0x4223f2[_0x16aa('0x113')],_0x4223f2[_0x16aa('0x114')]);var _0x33185b=_0x2ddde0['result']?_0x2ddde0[_0x16aa('0xa2')][_0x16aa('0x4e')]():'';logger[_0x16aa('0x31')]('test',JSON['stringify'](_0x2ddde0));if(_0x2ddde0[_0x16aa('0xa2')]===-0x1){this[_0x16aa('0x37')][_0x16aa('0x71')](this,_0x4223f2,_0x33185b);return _0x2ddde0;}else if(_0x2ddde0[_0x16aa('0xa4')]==='timeout'){_0x2ddde0[_0x16aa('0xa2')]=_0x33185b['length']>=parseInt(_0x4223f2[_0x16aa('0x115')])?'x':'i';}else{_0x2ddde0[_0x16aa('0xa2')]=_0x33185b[_0x16aa('0x9a')]>=parseInt(_0x4223f2[_0x16aa('0x115')])&&_0x33185b[_0x16aa('0x9a')]<=parseInt(_0x4223f2[_0x16aa('0x114')])?'x':'i';}var _0x52750f=this['getVariable'][_0x16aa('0x71')](this,_0x4223f2[_0x16aa('0xd9')]);if(!_0x52750f){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x4223f2,'no\x20variable\x20found');}this[_0x16aa('0xe')]['setVariable'](_0x52750f,_0x33185b);if(this[_0x16aa('0x85')](_0x4223f2[_0x16aa('0x116')])){var _0x2eeae1=parseInt(_0x4223f2[_0x16aa('0x116')],0xa);var _0x1fa983=rs[_0x16aa('0x117')]({'charset':'*','length':_0x2eeae1});var _0x31d430=_0x33185b['length'];if(_0x31d430>0x0){if(_0x31d430>_0x2eeae1){this[_0x16aa('0x37')][_0x16aa('0x71')](this,_0x4223f2,_0x4223f2['hiddendigitspos']===_0x16aa('0x118')?_0x1fa983+_0x33185b[_0x16aa('0x119')](_0x2eeae1):_0x33185b[_0x16aa('0x119')](0x0,_0x31d430-_0x2eeae1)+_0x1fa983);}else{this[_0x16aa('0x37')][_0x16aa('0x71')](this,_0x4223f2,rs[_0x16aa('0x117')]({'charset':'*','length':_0x31d430}));}}else{this[_0x16aa('0x37')][_0x16aa('0x71')](this,_0x4223f2,'');}}else{this[_0x16aa('0x37')][_0x16aa('0x71')](this,_0x4223f2,_0x33185b);}return _0x2ddde0;};AGIVertices[_0x16aa('0x11')]['getsecretdigits']=function(_0x158c4d){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x158c4d[_0x16aa('0xa9')]));return this['getdigits'](_0x158c4d);};AGIVertices[_0x16aa('0x11')][_0x16aa('0x11a')]=function(_0x152014){logger['info'](util['format'](_0x16aa('0x11b'),_0x152014[_0x16aa('0xa9')]));this[_0x16aa('0x37')][_0x16aa('0x71')](this,_0x152014,_0x152014[_0x16aa('0x11c')]);return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x11d'),_0x152014[_0x16aa('0x11c')]));};AGIVertices[_0x16aa('0x11')][_0x16aa('0x11e')]=function(_0x4c53e6){logger[_0x16aa('0x31')](util['format'](_0x16aa('0x11f'),_0x4c53e6[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x4c53e6['aws_access_key_id'])||!this[_0x16aa('0x85')](_0x4c53e6['aws_secret_access_key'])){return this[_0x16aa('0xe')]['noop'](_0x16aa('0x120'));}if(!this[_0x16aa('0x85')](_0x4c53e6['text'])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0xab'));}this[_0x16aa('0xe')]['noop'](util[_0x16aa('0x2a')](_0x16aa('0x121'),_0x4c53e6[_0x16aa('0x5d')]));var _0x14a19f=this['awsPolly'][_0x16aa('0x71')](this,_0x4c53e6);if(_0x14a19f){this[_0x16aa('0xe')]['noop'](util[_0x16aa('0x2a')](_0x16aa('0x122'),_0x14a19f));var _0x5e6cb5=this[_0x16aa('0xe')][_0x16aa('0x101')](_0x14a19f);try{fs[_0x16aa('0x123')](_0x14a19f+_0x16aa('0x102'));}catch(_0x1efbab){logger[_0x16aa('0x2d')](_0x1efbab);}return _0x5e6cb5;}return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x4c53e6,_0x16aa('0x124'));};AGIVertices[_0x16aa('0x11')][_0x16aa('0x125')]=function(_0xc5c993){logger['info'](util[_0x16aa('0x2a')](_0x16aa('0x126'),_0xc5c993[_0x16aa('0xa9')]));if(!this['isConfigured'](_0xc5c993['aws_access_key_id'])||!this['isConfigured'](_0xc5c993[_0x16aa('0x88')])){return this[_0x16aa('0xe')]['noop'](_0x16aa('0x120'));}if(!this[_0x16aa('0x85')](_0xc5c993[_0x16aa('0x8d')])){return this['channel']['noop'](_0x16aa('0x127'));}if(!this[_0x16aa('0x85')](_0xc5c993[_0x16aa('0x5d')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')]('no\x20text\x20configured');}this[_0x16aa('0xe')][_0x16aa('0xe7')]=!![];this['createSquareDetailsReport'](_0xc5c993);this[_0x16aa('0x42')](_0xc5c993[_0x16aa('0x5d')],'in','','');this['channel'][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x128'),_0xc5c993[_0x16aa('0x5d')]));var _0x4b9e07=this['awsLex'][_0x16aa('0x71')](this,_0xc5c993);if(_0x4b9e07){for(var _0x1e846f in _0x4b9e07){if(_0x4b9e07['hasOwnProperty'](_0x1e846f)&&_['isString'](_0x4b9e07[_0x1e846f])){this[_0x16aa('0xe')][_0x16aa('0x9d')](util['format']('AWS_LEX_%s',_0x1e846f[_0x16aa('0xe9')]()),_0x4b9e07[_0x1e846f]);}}if(_[_0x16aa('0x45')](_0x4b9e07[_0x16aa('0x77')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0x129'));}else{this['createSquareMessage'](_0x4b9e07['message'],'out',_0x16aa('0x12a'),'');return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x12b'),_0x4b9e07['message']));}}return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0xc5c993,_0x16aa('0x12c'));};AGIVertices[_0x16aa('0x11')][_0x16aa('0x12d')]=function(_0x2b1e1b){logger['info'](util[_0x16aa('0x2a')](_0x16aa('0x12e'),_0x2b1e1b[_0x16aa('0xa9')],_0x2b1e1b[_0x16aa('0x69')]));if(!this[_0x16aa('0x85')](_0x2b1e1b[_0x16aa('0x8f')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0xe6'));}var _0x418af7=_0x16aa('0x12f');var _0x55414e=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x16aa('0x117')](0x4));var _0x327a6d=util[_0x16aa('0x2a')](_0x16aa('0x9c'),_0x55414e,_0x418af7);var _0x465b32=!![];if(_0x2b1e1b[_0x16aa('0x130')]==='NOBEEP'){_0x465b32=![];}var _0x285735=this['channel'][_0x16aa('0x131')](_0x55414e,_0x418af7,_0x2b1e1b['intKey'],_0x2b1e1b[_0x16aa('0x69')],undefined,_0x465b32);if(_0x285735[_0x16aa('0xa2')]!==-0x1){this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x132'),_0x327a6d));var _0x4508e0=this['googleASR'][_0x16aa('0x71')](this,_0x2b1e1b,_0x327a6d);if(_0x4508e0){for(var _0x10df4d in _0x4508e0){if(_0x4508e0[_0x16aa('0x94')](_0x10df4d)){this[_0x16aa('0xe')]['setVariable'](util[_0x16aa('0x2a')](_0x16aa('0x133'),_0x10df4d['toUpperCase']()),_0x4508e0[_0x10df4d]);}}return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x134'),JSON[_0x16aa('0x74')](_0x4508e0)));}}return _0x285735;};AGIVertices['prototype'][_0x16aa('0x135')]=function(_0x68a073){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x68a073[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x68a073[_0x16aa('0x92')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')]('no\x20appid\x20configured');}if(!this[_0x16aa('0x85')](_0x68a073[_0x16aa('0x136')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0x137'));}var _0x1943a5=_0x16aa('0x12f');var _0x1da1b6=util[_0x16aa('0x2a')]('%s/recordings/%s',FILES_PATH,rs[_0x16aa('0x117')](0x4));var _0x54b8cc=util['format'](_0x16aa('0x9c'),_0x1da1b6,_0x1943a5);var _0x186dd1=!![];if(_0x68a073[_0x16aa('0x130')]==='NOBEEP'){_0x186dd1=![];}var _0x54c09e=this['channel'][_0x16aa('0x131')](_0x1da1b6,_0x1943a5,_0x68a073[_0x16aa('0x138')],_0x68a073['timeout'],undefined,_0x186dd1);if(_0x54c09e['result']!==-0x1){this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x139'),_0x54b8cc));var _0x578060=this[_0x16aa('0x91')]['sync'](this,_0x68a073,_0x54b8cc);if(_0x578060){for(var _0x1bcf0e in _0x578060){if(_0x578060[_0x16aa('0x94')](_0x1bcf0e)){this['channel'][_0x16aa('0x9d')](util[_0x16aa('0x2a')]('TILDE_ASR_%s',_0x1bcf0e[_0x16aa('0xe9')]()),_0x578060[_0x1bcf0e]);}}return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')]('TildeASR\x20Result\x20%s',JSON['stringify'](_0x578060)));}}return _0x54c09e;};AGIVertices['prototype'][_0x16aa('0x13a')]=function(_0x225a6a){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x225a6a[_0x16aa('0xa9')]));return this[_0x16aa('0xe')][_0x16aa('0x13b')](_0x225a6a[_0x16aa('0x3e')],_0x225a6a[_0x16aa('0x13c')],_0x225a6a[_0x16aa('0x3f')]);};AGIVertices[_0x16aa('0x11')]['gotoif']=function(_0x1fbb65){logger['info'](util[_0x16aa('0x2a')](_0x16aa('0x13d'),_0x1fbb65[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x1fbb65[_0x16aa('0x13e')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x1fbb65,_0x16aa('0x13f'));}try{var _0x3f449d=eval(_0x1fbb65[_0x16aa('0x13e')])?_0x16aa('0x140'):_0x16aa('0x141');this['channel']['noop'](util['format']('EVAL\x20CONDITION\x20%s\x20%s',_0x1fbb65[_0x16aa('0x13e')],_0x3f449d));return{'code':0xc8,'result':_0x3f449d};}catch(_0x51e2b8){return{'code':0xc8,'result':_0x16aa('0x141')};}};AGIVertices[_0x16aa('0x11')][_0x16aa('0x142')]=function(_0x238677){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x238677[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x238677[_0x16aa('0x143')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x238677,_0x16aa('0x144'));}var _0x52e9b3=this['getIntervals']['sync'](this,_0x238677[_0x16aa('0x143')]);if(!_0x52e9b3){return this['channel']['error'](_0x238677,_0x16aa('0x145'));}for(var _0x2c64a2=0x0;_0x2c64a2<_0x52e9b3[_0x16aa('0x9a')];_0x2c64a2+=0x1){var _0x122c63=this[_0x16aa('0xe')][_0x16aa('0x12')](util[_0x16aa('0x2a')](_0x16aa('0x146'),_0x52e9b3[_0x2c64a2]));if(_0x122c63[_0x16aa('0xa2')]===-0x1){return _0x122c63;}logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x147'),_0x52e9b3[_0x2c64a2],_0x122c63['extra']));if(_0x122c63[_0x16aa('0xa4')]==='true'){logger['info'](util[_0x16aa('0x2a')]('IFTIME\x20%s\x20%s',_0x52e9b3[_0x2c64a2],_0x16aa('0x140')));this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x147'),_0x52e9b3[_0x2c64a2],_0x16aa('0x140')));return{'code':0xc8,'result':_0x16aa('0x140')};}else{logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x147'),_0x52e9b3[_0x2c64a2],'false'));this[_0x16aa('0xe')]['noop'](util[_0x16aa('0x2a')](_0x16aa('0x147'),_0x52e9b3[_0x2c64a2],_0x16aa('0x141')));}}return{'code':0xc8,'result':_0x16aa('0x141')};};AGIVertices[_0x16aa('0x11')][_0x16aa('0x148')]=function(_0x36a0e2){logger['info'](util[_0x16aa('0x2a')](_0x16aa('0x149'),_0x36a0e2[_0x16aa('0xa9')]));return this[_0x16aa('0xe')]['hangup']();};AGIVertices[_0x16aa('0x11')][_0x16aa('0x14a')]=function(_0x3ab7f6){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x3ab7f6[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x3ab7f6[_0x16aa('0x8f')])){return this[_0x16aa('0xe')]['noop']('no\x20key\x20configured');}var _0x36326d=_0x16aa('0x12f');var _0x19caf1=util[_0x16aa('0x2a')]('%s/recordings/%s',FILES_PATH,rs[_0x16aa('0x117')](0x4));var _0xa902c9=util[_0x16aa('0x2a')](_0x16aa('0x9c'),_0x19caf1,_0x36326d);var _0xb9cd12=!![];if(_0x3ab7f6['beep']===_0x16aa('0x14b')){_0xb9cd12=![];}var _0x2b5837=this['channel'][_0x16aa('0x131')](_0x19caf1,_0x36326d,_0x3ab7f6[_0x16aa('0x138')],_0x3ab7f6[_0x16aa('0x69')],undefined,_0xb9cd12);if(_0x2b5837[_0x16aa('0xa2')]!==-0x1){this[_0x16aa('0xe')][_0x16aa('0xaa')](util['format'](_0x16aa('0x14c'),_0xa902c9));var _0x4b372e=this[_0x16aa('0x83')][_0x16aa('0x71')](this,_0x3ab7f6,_0xa902c9);if(_0x4b372e){for(var _0x412136 in _0x4b372e){if(_0x4b372e[_0x16aa('0x94')](_0x412136)){this[_0x16aa('0xe')][_0x16aa('0x9d')](util[_0x16aa('0x2a')]('ISPEECH_ASR_%s',_0x412136[_0x16aa('0xe9')]()),_0x4b372e[_0x412136]);}}return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x14d'),JSON[_0x16aa('0x74')](_0x4b372e)));}}return _0x2b5837;};AGIVertices[_0x16aa('0x11')][_0x16aa('0x14e')]=function(_0x3d45a1){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x3d45a1[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x3d45a1[_0x16aa('0x8f')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0xe6'));}if(!this[_0x16aa('0x85')](_0x3d45a1[_0x16aa('0x5d')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0xab'));}this['channel'][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x14f'),_0x3d45a1[_0x16aa('0x5d')]));var _0x496288=this[_0x16aa('0x80')][_0x16aa('0x71')](this,_0x3d45a1);if(_0x496288){this[_0x16aa('0xe')][_0x16aa('0xaa')](util['format']('ispeech\x20%s\x20file\x20created',_0x496288));var _0x1538f9=this[_0x16aa('0xe')][_0x16aa('0x101')](_0x496288,_0x3d45a1[_0x16aa('0x138')]);try{fs[_0x16aa('0x123')](_0x496288+_0x16aa('0x102'));}catch(_0x4a081f){logger['error'](_0x4a081f);}return _0x1538f9;}return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x3d45a1,_0x16aa('0x150'));};AGIVertices[_0x16aa('0x11')][_0x16aa('0x151')]=function(_0x3d89cd){logger['info'](util[_0x16aa('0x2a')](_0x16aa('0x152'),_0x3d89cd[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x3d89cd[_0x16aa('0x153')])){return this[_0x16aa('0xe')]['error'](_0x3d89cd,_0x16aa('0x154'));}logger['info'](util[_0x16aa('0x2a')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x16aa('0xe')][_0x16aa('0x3a')],_0x3d89cd[_0x16aa('0x153')]));var _0x1c602d=this[_0x16aa('0x55')]['sync'](this,_0x3d89cd[_0x16aa('0x153')]);if(_0x1c602d){logger['info'](util[_0x16aa('0x2a')](_0x16aa('0x155'),this['channel'][_0x16aa('0x3a')],_0x3d89cd['findBy']));this['channel']['noop'](util[_0x16aa('0x2a')](_0x16aa('0x155'),this[_0x16aa('0xe')][_0x16aa('0x3a')],_0x3d89cd[_0x16aa('0x153')]));return{'code':0xc8,'result':_0x16aa('0x156')};}else{logger[_0x16aa('0x31')](util[_0x16aa('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x16aa('0xe')][_0x16aa('0x3a')],_0x3d89cd['findBy']));this[_0x16aa('0xe')][_0x16aa('0xaa')](util['format'](_0x16aa('0x157'),this[_0x16aa('0xe')]['callerid'],_0x3d89cd[_0x16aa('0x153')]));return{'code':0xc8,'result':_0x16aa('0x158')};}};AGIVertices['prototype'][_0x16aa('0x159')]=function(_0x86356d){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x15a'),_0x86356d['label']));if(!this['isConfigured'](_0x86356d['findBy'])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x86356d,_0x16aa('0x154'));}logger[_0x16aa('0x31')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x16aa('0xe')][_0x16aa('0x3a')],_0x86356d['findBy']));var _0x266969=this[_0x16aa('0x54')][_0x16aa('0x71')](this,_0x86356d[_0x16aa('0x153')]);if(_0x266969){logger['info'](util[_0x16aa('0x2a')](_0x16aa('0x155'),this['channel'][_0x16aa('0x3a')],_0x86356d[_0x16aa('0x153')]));this['channel']['noop'](util[_0x16aa('0x2a')](_0x16aa('0x155'),this[_0x16aa('0xe')][_0x16aa('0x3a')],_0x86356d[_0x16aa('0x153')]));return{'code':0xc8,'result':'success'};}else{logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x157'),this['channel'][_0x16aa('0x3a')],_0x86356d[_0x16aa('0x153')]));this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x157'),this['channel'][_0x16aa('0x3a')],_0x86356d[_0x16aa('0x153')]));return{'code':0xc8,'result':_0x16aa('0x158')};}};AGIVertices[_0x16aa('0x11')]['math']=function(_0x28709a){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x15b'),_0x28709a['label']));if(!this[_0x16aa('0x85')](_0x28709a[_0x16aa('0x15c')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x28709a,'no\x20operation\x20configured');}this['channel'][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x15d'),_0x28709a[_0x16aa('0x15c')]));var _0x24453d=eval(_0x28709a[_0x16aa('0x15c')]);if(!this[_0x16aa('0x85')](_0x28709a['variable_id'])){return this['channel']['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x54da73=this[_0x16aa('0x12')][_0x16aa('0x71')](this,_0x28709a[_0x16aa('0xd9')]);if(!_0x54da73){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x28709a,_0x16aa('0xda'));}if(_[_0x16aa('0x99')](_0x24453d)){var _0xd20d65=this;_0x24453d[_0x16aa('0xdb')](function(_0x16b0c6,_0x37c7db){_0xd20d65['channel'][_0x16aa('0x9d')](util['format'](_0x16aa('0x15e'),_0x54da73,_0x37c7db),_0x16b0c6);});return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')]('variable\x20%s[key]\x20set',_0x54da73));}else{return this[_0x16aa('0xe')][_0x16aa('0x9d')](_0x54da73,_0x24453d);}};AGIVertices[_0x16aa('0x11')][_0x16aa('0xd')]=function(_0xd092){logger['info'](util['format'](_0x16aa('0x15f'),_0xd092['label']));if(_0xd092[_0x16aa('0xa6')]===0x0){return this[_0x16aa('0xa5')](_0xd092);}_0xd092[_0x16aa('0xa6')]-=0x1;if(!this[_0x16aa('0x85')](_0xd092[_0x16aa('0x10d')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0xd092,_0x16aa('0x10e'));}var _0x31ad55=this[_0x16aa('0x10f')][_0x16aa('0x71')](this,_0xd092[_0x16aa('0x10d')]);if(!_0x31ad55){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0xd092,_0x16aa('0x110'));}var _0x1960e7=this['channel'][_0x16aa('0x112')](_0x31ad55,_0xd092[_0x16aa('0x113')],_0xd092[_0x16aa('0x160')]);var _0x748d13=_0x1960e7[_0x16aa('0xa2')];if(_0x1960e7[_0x16aa('0xa2')]===-0x1){this[_0x16aa('0x37')]['sync'](this,_0xd092,'-1');return _0x1960e7;}else if(_0x1960e7[_0x16aa('0xa4')]===_0x16aa('0x69')){_0x1960e7[_0x16aa('0xa2')]=_0x1960e7[_0x16aa('0xa2')][_0x16aa('0x9a')]>0x0?_0x1960e7[_0x16aa('0xa2')]:'t';}else if(_['isEmpty'](_0x1960e7['result'])){_0x1960e7['result']='#';_0x748d13='#';}if(!this[_0x16aa('0x85')](_0xd092[_0x16aa('0xd9')])){this['channel'][_0x16aa('0xaa')](_0x16aa('0x111'));}else{var _0x145507=this['getVariable'][_0x16aa('0x71')](this,_0xd092[_0x16aa('0xd9')]);if(!_0x145507){return this[_0x16aa('0xe')]['error'](_0xd092,_0x16aa('0xda'));}this['channel'][_0x16aa('0x9d')](_0x145507,_0x748d13);}this['createSquareDetailsReport']['sync'](this,_0xd092,_0x748d13);return _0x1960e7;};AGIVertices[_0x16aa('0x11')][_0x16aa('0xaa')]=function(_0x214bf2){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x161'),_0x214bf2[_0x16aa('0xa9')]));return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x214bf2[_0x16aa('0x162')]||_0x214bf2[_0x16aa('0xa9')]);};AGIVertices[_0x16aa('0x11')]['pause']=function(_0x3ee0b9){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x163'),_0x3ee0b9[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x3ee0b9['findBy'])){return this['channel'][_0x16aa('0x2d')](_0x3ee0b9,'no\x20find\x20by\x20configured');}logger['info'](util[_0x16aa('0x2a')](_0x16aa('0x164'),this[_0x16aa('0xe')][_0x16aa('0x3a')],_0x3ee0b9['findBy']));var _0x30853a=this[_0x16aa('0x4f')][_0x16aa('0x71')](this,_0x3ee0b9['pause_id']);var _0x5381fd=this[_0x16aa('0x51')][_0x16aa('0x71')](this,_0x3ee0b9[_0x16aa('0x153')],_0x30853a);if(_0x5381fd){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x16aa('0x3a')],_0x3ee0b9[_0x16aa('0x153')]));this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x155'),this[_0x16aa('0xe')]['callerid'],_0x3ee0b9[_0x16aa('0x153')]));return{'code':0xc8,'result':_0x16aa('0x156')};}else{logger['info'](util[_0x16aa('0x2a')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x3ee0b9[_0x16aa('0x153')]));this['channel'][_0x16aa('0xaa')](util['format'](_0x16aa('0x155'),this[_0x16aa('0xe')]['callerid'],_0x3ee0b9['findBy']));return{'code':0xc8,'result':_0x16aa('0x158')};}};AGIVertices['prototype'][_0x16aa('0x165')]=function(_0x5a11ab){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x166'),_0x5a11ab[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x5a11ab[_0x16aa('0x10d')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x5a11ab,_0x16aa('0x10e'));}var _0xa35b74=this['getSound']['sync'](this,_0x5a11ab[_0x16aa('0x10d')]);if(!_0xa35b74){return this['channel']['error'](_0x5a11ab,_0x16aa('0x110'));}var _0x583ee2=this[_0x16aa('0xe')][_0x16aa('0xac')]('PLAYBACK',[_0xa35b74,_0x5a11ab[_0x16aa('0xe3')]]);if(_0x583ee2[_0x16aa('0xa2')]===-0x1){return _0x583ee2;}return this[_0x16aa('0xe')]['noop'](util[_0x16aa('0x2a')]('Executed\x20command\x20%s\x20%s','PLAYBACK',_0xa35b74));};AGIVertices[_0x16aa('0x11')]['queue']=function(_0x2c2244){logger[_0x16aa('0x31')](util['format'](_0x16aa('0x167'),_0x2c2244[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x2c2244[_0x16aa('0x168')])){return this[_0x16aa('0xe')]['error'](_0x2c2244,_0x16aa('0x169'));}var _0x39f81c='';var _0x48eda6=parseInt(_0x2c2244[_0x16aa('0x168')],0xa);if(isNaN(_0x48eda6)){_0x39f81c=_0x2c2244[_0x16aa('0x168')];}else{_0x39f81c=this[_0x16aa('0x17')][_0x16aa('0x71')](this,_0x2c2244[_0x16aa('0x168')]);if(!_0x39f81c){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x2c2244,_0x16aa('0x16a'));}}var _0x58a540='';if(this[_0x16aa('0x85')](_0x2c2244[_0x16aa('0x10d')])){var _0x1cdf67=this[_0x16aa('0x10f')]['sync'](this,_0x2c2244[_0x16aa('0x10d')]);if(_0x1cdf67){_0x58a540=_0x1cdf67;}}this['createSquareDetailsReport']['sync'](this,_0x2c2244,_0x39f81c);if(_0x2c2244[_0x16aa('0xe3')][_0x16aa('0x16b')]('x')<0x0){_0x2c2244['opts']+='x';}if(_0x2c2244[_0x16aa('0xe3')][_0x16aa('0x16b')]('X')<0x0){_0x2c2244[_0x16aa('0xe3')]+='X';}this[_0x16aa('0xe')][_0x16aa('0x9d')](_0x16aa('0x16c'),_0x39f81c?_0x39f81c[_0x16aa('0x16d')]():'');var _0x2479d9=this[_0x16aa('0xe')]['exec'](_0x16aa('0x16e'),[_0x39f81c,_0x2c2244[_0x16aa('0xe3')],_0x2c2244['url'],_0x58a540,_0x2c2244[_0x16aa('0x69')],_0x2c2244[_0x16aa('0x7')],_0x2c2244[_0x16aa('0x16f')],_0x2c2244[_0x16aa('0x170')],'',_0x2c2244[_0x16aa('0x171')]]);if(_0x2479d9[_0x16aa('0xa2')]===-0x1){return _0x2479d9;}return this['channel'][_0x16aa('0xaa')](util['format']('Executed\x20command\x20%s\x20%s',_0x16aa('0x16e'),_0x39f81c));};AGIVertices['prototype'][_0x16aa('0x172')]=function(_0x44319b){logger['info'](util[_0x16aa('0x2a')](_0x16aa('0x173'),_0x44319b[_0x16aa('0xa9')]));var _0x7853bf=_0x44319b[_0x16aa('0x174')]||_0x16aa('0x12f');var _0x4e13b7=util['format'](_0x16aa('0x175'),this[_0x16aa('0xe')][_0x16aa('0x3c')],rs['generate'](0x5));var _0x216cba=util['format'](_0x16aa('0x176'),FILES_PATH,_0x4e13b7,_0x7853bf);var _0x4d7063=util[_0x16aa('0x2a')](_0x16aa('0x177'),FILES_PATH,_0x4e13b7);this['createSquareRecording'][_0x16aa('0x71')](this,_0x44319b,_0x4e13b7,_0x216cba);this[_0x16aa('0xe')][_0x16aa('0x9d')]('RECORDING_SAVENAME',_0x4e13b7);logger[_0x16aa('0x31')](_0x16aa('0x178'),_0x4d7063,_0x7853bf,_0x44319b['escape_digits'],_0x44319b[_0x16aa('0x69')]);return this[_0x16aa('0xe')]['recordFile'](_0x4d7063,_0x7853bf,_0x44319b[_0x16aa('0x179')],_0x44319b[_0x16aa('0x69')],undefined,!![]);};AGIVertices[_0x16aa('0x11')][_0x16aa('0x17a')]=function(_0x5a18d5){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x5a18d5[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x5a18d5[_0x16aa('0x66')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0x17b'));}var _0x1c7949=this[_0x16aa('0x65')][_0x16aa('0x71')](this,_0x5a18d5);logger[_0x16aa('0x31')](util[_0x16aa('0x2a')]('Response:',util[_0x16aa('0x17c')](_0x1c7949,{'showHidden':![],'depth':null})));if(!this[_0x16aa('0x85')](_0x5a18d5[_0x16aa('0xd9')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0x17d'));}var _0x5c06b5=this[_0x16aa('0x12')][_0x16aa('0x71')](this,_0x5a18d5[_0x16aa('0xd9')]);if(!_0x5c06b5){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x5a18d5,'no\x20variable\x20found');}this['channel'][_0x16aa('0x9d')](util[_0x16aa('0x2a')](_0x16aa('0x17e'),_0x5c06b5),_0x1c7949['statusCode']?_0x1c7949[_0x16aa('0x76')]:'200');this[_0x16aa('0xe')][_0x16aa('0x9d')](util['format']('%s_STATUS_MESSAGE',_0x5c06b5),_0x1c7949[_0x16aa('0x17f')]?_0x1c7949[_0x16aa('0x17f')]:'OK');if(_0x1c7949[_0x16aa('0x6c')]){try{this[_0x16aa('0x9b')](_0x1c7949[_0x16aa('0x6c')],_0x5c06b5);}catch(_0x40754e){logger[_0x16aa('0x2d')](util[_0x16aa('0x2a')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x5c06b5));}}return this['channel'][_0x16aa('0xaa')](util[_0x16aa('0x2a')]('variable\x20%s\x20set',_0x5c06b5));};AGIVertices[_0x16aa('0x11')][_0x16aa('0x180')]=function(_0x4998c2){logger['info'](util[_0x16aa('0x2a')](_0x16aa('0x181'),_0x4998c2['label']));return this[_0x16aa('0xe')]['sayDigits'](_0x4998c2[_0x16aa('0x182')][_0x16aa('0x5a')](/\s+/g,''),_0x4998c2['escape_digits']);};AGIVertices[_0x16aa('0x11')][_0x16aa('0x183')]=function(_0x2b57c5){logger['info'](util['format'](_0x16aa('0x184'),_0x2b57c5[_0x16aa('0xa9')]));return this[_0x16aa('0xe')][_0x16aa('0x185')](_0x2b57c5['number']['replace'](/\s+/g,''),_0x2b57c5['escape_digits']);};AGIVertices[_0x16aa('0x11')][_0x16aa('0x186')]=function(_0x2e3d36){logger[_0x16aa('0x31')](util['format'](_0x16aa('0x187'),_0x2e3d36['label']));return this[_0x16aa('0xe')]['sayPhonetic'](_0x2e3d36[_0x16aa('0x5d')],_0x2e3d36['escape_digits']);};AGIVertices[_0x16aa('0x11')][_0x16aa('0x188')]=function(_0x3d1e57){logger[_0x16aa('0x31')](util['format'](_0x16aa('0x189'),_0x3d1e57[_0x16aa('0xa9')]));if(!this['isConfigured'](_0x3d1e57[_0x16aa('0x18a')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')]('no\x20mail\x20account\x20configured');}var _0x42e665=this[_0x16aa('0x22')]['sync'](this,_0x3d1e57[_0x16aa('0x18a')]);if(!_0x42e665||!_0x42e665[_0x16aa('0x18b')]){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x3d1e57,_0x16aa('0x18c'));}var _0x2a86e4={'from':util[_0x16aa('0x2a')](_0x16aa('0x18d'),_0x42e665[_0x16aa('0x15')],_0x42e665[_0x16aa('0x18e')]||_0x42e665[_0x16aa('0x18b')][_0x16aa('0x18f')]),'to':_0x3d1e57['to']||'','cc':_0x3d1e57['cc']||'','bcc':_0x3d1e57[_0x16aa('0x190')]||'','subject':_0x3d1e57[_0x16aa('0x191')],'html':_0x3d1e57[_0x16aa('0x5d')],'text':_0x3d1e57[_0x16aa('0x5d')]};var _0x5c65b3={'tls':{'rejectUnauthorized':![]}};if(_0x42e665[_0x16aa('0x18b')][_0x16aa('0x192')]){_0x5c65b3[_0x16aa('0x192')]=_0x42e665[_0x16aa('0x18b')][_0x16aa('0x192')];}else{_0x5c65b3['host']=_0x42e665[_0x16aa('0x18b')][_0x16aa('0x193')];_0x5c65b3[_0x16aa('0x194')]=_0x42e665['Smtp']['port'];_0x5c65b3[_0x16aa('0x195')]=_0x42e665[_0x16aa('0x18b')]['secure'];}if(_0x42e665[_0x16aa('0x18b')][_0x16aa('0x196')]){_0x5c65b3['auth']={'user':_0x42e665['Smtp'][_0x16aa('0x18f')],'pass':_0x42e665[_0x16aa('0x18b')][_0x16aa('0x197')]};}if(this[_0x16aa('0x85')](_0x3d1e57[_0x16aa('0x198')])){}logger[_0x16aa('0xdf')](_0x16aa('0x199'),JSON[_0x16aa('0x74')](_0x2a86e4));this['createSquareDetailsReport'][_0x16aa('0x71')](this,_0x3d1e57,_0x3d1e57[_0x16aa('0x18a')]);this['channel']['noop'](util[_0x16aa('0x2a')](_0x16aa('0x19a'),_0x42e665['name']));this['sendMailMessage'][_0x16aa('0x71')](this,_0x5c65b3,_0x2a86e4);return this[_0x16aa('0xe')]['noop'](_0x16aa('0x19b'));};AGIVertices['prototype']['sendFax']=function(_0x2a95d8){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x19c'),_0x2a95d8[_0x16aa('0xa9')]));return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0x19d'));};AGIVertices['prototype']['sendSMS']=function(_0x12852a){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x19e'),_0x12852a['label']));if(!this[_0x16aa('0x85')](_0x12852a['sms_account_id'])){return this[_0x16aa('0xe')]['noop'](_0x16aa('0x19f'));}var _0x244a0c=this[_0x16aa('0x34')][_0x16aa('0x71')](this,_0x12852a[_0x16aa('0x1a0')]);if(!_0x244a0c){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x12852a,_0x16aa('0x1a1'));}var _0x1da3e4={'body':_0x12852a['sms_text'],'phone':_0x12852a['to']||'','SmsAccountId':_0x244a0c['id']};logger[_0x16aa('0xdf')](_0x16aa('0x1a2'),JSON[_0x16aa('0x74')](_0x1da3e4));this[_0x16aa('0x37')]['sync'](this,_0x12852a,_0x12852a[_0x16aa('0x1a0')]);this['channel']['noop'](util[_0x16aa('0x2a')](_0x16aa('0x1a3'),_0x244a0c[_0x16aa('0x15')]));this[_0x16aa('0x36')][_0x16aa('0x71')](this,_0x1da3e4);return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0x1a4'));};AGIVertices[_0x16aa('0x11')][_0x16aa('0x1a5')]=function(_0x43dad8){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x1a6'),_0x43dad8[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x43dad8[_0x16aa('0xd9')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x43dad8,'no\x20variable\x20selected');}var _0x4efed9=this[_0x16aa('0x12')][_0x16aa('0x71')](this,_0x43dad8[_0x16aa('0xd9')]);if(!_0x4efed9){return this[_0x16aa('0xe')]['error'](_0x43dad8,_0x16aa('0xda'));}return this[_0x16aa('0xe')]['setVariable'](_0x4efed9,_0x43dad8[_0x16aa('0x1a7')]);};AGIVertices['prototype']['start']=function(_0x385f84){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x1a8'),_0x385f84[_0x16aa('0xa9')]));this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0x1a9'));if(_0x385f84['answer']===_0x16aa('0x1aa')){this['channel'][_0x16aa('0xaa')](_0x16aa('0x1ab'));return this[_0x16aa('0xe')][_0x16aa('0xba')]();}return this[_0x16aa('0xe')]['noop'](_0x16aa('0x1ac'));};AGIVertices[_0x16aa('0x11')][_0x16aa('0x1ad')]=function(_0xed51bd){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0xed51bd[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0xed51bd[_0x16aa('0x1ae')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0xed51bd,_0x16aa('0x1af'));}var _0x53da30=this[_0x16aa('0x19')]['sync'](this,_0xed51bd[_0x16aa('0x1ae')]);if(!this['isConfigured'](_0x53da30)){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0xed51bd,util[_0x16aa('0x2a')](_0x16aa('0x1b0'),_0xed51bd[_0x16aa('0x1ae')]));}if(_0x53da30===this[_0x16aa('0xe')][_0x16aa('0x39')]){return this['channel'][_0x16aa('0x2d')](_0xed51bd,_0x16aa('0x1b1'));}this['createSquareDetailsReport']['sync'](this,_0xed51bd,_0x53da30);var _0x22af03=this[_0x16aa('0xe')]['exec'](_0x16aa('0x1b2'),util['format']('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi'][_0x16aa('0x193')]||_0x16aa('0x1b3'),_0x53da30,this['channel'][_0x16aa('0x39')]));if(_0x22af03['result']===-0x1){return _0x22af03;}return this['channel'][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0xc6'),'AGI',_0x53da30));};AGIVertices[_0x16aa('0x11')][_0x16aa('0x1b4')]=function(_0x154694){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x154694[_0x16aa('0xa9')]));var _0x5d8e10=this[_0x16aa('0x1b5')]['sync'](this,_0x154694[_0x16aa('0x1b6')]);this[_0x16aa('0x37')]['sync'](this,_0x154694,_0x154694[_0x16aa('0x1b6')]);if(this[_0x16aa('0x85')](_0x154694['variable_id'])){var _0x5996cf=this[_0x16aa('0x12')][_0x16aa('0x71')](this,_0x154694[_0x16aa('0xd9')]);if(_0x5996cf){this[_0x16aa('0xe')][_0x16aa('0x9d')](_0x5996cf,_0x5d8e10);return this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x154694[_0x16aa('0x1b6')],_0x5996cf));}}return this[_0x16aa('0xe')]['noop'](util[_0x16aa('0x2a')](_0x16aa('0x1b7'),_0x154694['command']));};AGIVertices[_0x16aa('0x11')][_0x16aa('0x1b8')]=function(_0x4d7e65){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x1b9'),_0x4d7e65[_0x16aa('0xa9')]));_0x4d7e65[_0x16aa('0x5d')]=_0x4d7e65['text'][_0x16aa('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x4d7e65[_0x16aa('0x5c')])){return this[_0x16aa('0xe')]['noop']('no\x20apiKey\x20configured');}if(!this[_0x16aa('0x85')](_0x4d7e65[_0x16aa('0x5d')])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0xab'));}this['channel']['noop'](util[_0x16aa('0x2a')](_0x16aa('0x1ba'),_0x4d7e65[_0x16aa('0x5d')]));var _0x22267f=this[_0x16aa('0x5b')]['sync'](this,_0x4d7e65);if(_0x22267f){this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x1bb'),_0x22267f));var _0x545119=this[_0x16aa('0xe')]['streamFile'](_0x22267f);try{fs[_0x16aa('0x123')](_0x22267f+_0x16aa('0x102'));}catch(_0x41b96c){logger[_0x16aa('0x2d')](_0x41b96c);}return _0x545119;}return this[_0x16aa('0xe')]['error'](_0x4d7e65,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype']['tts']=function(_0x48c3b8){logger[_0x16aa('0x31')](util['format'](_0x16aa('0x1bc'),_0x48c3b8[_0x16aa('0xa9')]));_0x48c3b8[_0x16aa('0x5d')]=_0x48c3b8[_0x16aa('0x5d')][_0x16aa('0x5a')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x16aa('0x85')](_0x48c3b8['text'])){return this[_0x16aa('0xe')][_0x16aa('0xaa')](_0x16aa('0xab'));}this[_0x16aa('0xe')][_0x16aa('0xaa')](util['format'](_0x16aa('0x1bd'),_0x48c3b8[_0x16aa('0x5d')]));var _0x2b48ae=this[_0x16aa('0x64')][_0x16aa('0x71')](this,_0x48c3b8);if(_0x2b48ae){this[_0x16aa('0xe')][_0x16aa('0xaa')](util[_0x16aa('0x2a')](_0x16aa('0x1be'),_0x2b48ae));var _0x15b63c=this[_0x16aa('0xe')][_0x16aa('0x101')](_0x2b48ae);try{fs[_0x16aa('0x123')](_0x2b48ae+'.wav');}catch(_0x4da5ec){logger[_0x16aa('0x2d')](_0x4da5ec);}return _0x15b63c;}return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x48c3b8,'Google\x20TTS\x20is\x20unreachable');};AGIVertices[_0x16aa('0x11')][_0x16aa('0x1bf')]=function(_0x3462b1){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x1c0'),_0x3462b1[_0x16aa('0xa9')]));if(!this['isConfigured'](_0x3462b1[_0x16aa('0x153')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x3462b1,'no\x20find\x20by\x20configured');}logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x164'),this['channel']['callerid'],_0x3462b1[_0x16aa('0x153')]));var _0x599841=this[_0x16aa('0x53')][_0x16aa('0x71')](this,_0x3462b1[_0x16aa('0x153')]);if(_0x599841){logger['info'](util[_0x16aa('0x2a')](_0x16aa('0x155'),this['channel'][_0x16aa('0x3a')],_0x3462b1[_0x16aa('0x153')]));this[_0x16aa('0xe')]['noop'](util[_0x16aa('0x2a')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x16aa('0xe')][_0x16aa('0x3a')],_0x3462b1[_0x16aa('0x153')]));return{'code':0xc8,'result':_0x16aa('0x156')};}else{logger[_0x16aa('0x31')](util['format'](_0x16aa('0x157'),this[_0x16aa('0xe')][_0x16aa('0x3a')],_0x3462b1[_0x16aa('0x153')]));this[_0x16aa('0xe')]['noop'](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0x16aa('0x3a')],_0x3462b1[_0x16aa('0x153')]));return{'code':0xc8,'result':_0x16aa('0x158')};}};AGIVertices[_0x16aa('0x11')]['voicemail']=function(_0x4f6078){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')]('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x4f6078[_0x16aa('0xa9')]));var _0x3a442e=this[_0x16aa('0xe')][_0x16aa('0xac')](_0x16aa('0x1c1'),[_0x4f6078[_0x16aa('0x1c2')],_0x4f6078[_0x16aa('0x79')]]);if(_0x3a442e[_0x16aa('0xa2')]===-0x1){return _0x3a442e;}return this[_0x16aa('0xe')]['noop'](util['format'](_0x16aa('0xc6'),_0x16aa('0x1c1'),_0x4f6078[_0x16aa('0x1c2')]));};AGIVertices[_0x16aa('0x11')][_0x16aa('0x1c3')]=function(_0x296af7){logger[_0x16aa('0x31')](util[_0x16aa('0x2a')](_0x16aa('0x1c4'),_0x296af7[_0x16aa('0xa9')]));if(!this[_0x16aa('0x85')](_0x296af7[_0x16aa('0xd9')])){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x296af7,_0x16aa('0x1c5'));}var _0x5e1f98=this[_0x16aa('0x12')][_0x16aa('0x71')](this,_0x296af7[_0x16aa('0xd9')]);if(!_0x5e1f98){return this[_0x16aa('0xe')][_0x16aa('0x2d')](_0x296af7,'no\x20variable\x20found');}var _0x2f8521=this[_0x16aa('0xe')][_0x16aa('0x12')](_0x5e1f98);return{'code':0xc8,'result':_0x2f8521[_0x16aa('0xa4')]?_0x2f8521[_0x16aa('0xa4')]:'-'};};String['prototype'][_0x16aa('0xa0')]=function(_0x1b0379,_0x47036f){return this[_0x16aa('0x9f')](_0x1b0379)[_0x16aa('0x1c6')](_0x47036f);};module[_0x16aa('0x1c7')]=AGIVertices;
\ No newline at end of file
index 547f181..2458cea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x42f3=['[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','../ami','../rpc/user','../rpc/voiceAgentReport','voiceQueues','timers','channels','syncAgentConnect','bind','hanguprequest','hangup','syncAgentRingNoAnswer','attendedtransfer','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','queue','ACW','mandatoryDisposition','name','mandatoryDispositionPause','QueuePause','then','agents','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','timer','update','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','acw','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','[%s][HANGUP:UNIQUEID]','linkedid','isUndefined','attended','[%s][HANGUP:LINKEDID]','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]'];(function(_0x59c389,_0x19e789){var _0x2d35c6=function(_0x4deae7){while(--_0x4deae7){_0x59c389['push'](_0x59c389['shift']());}};_0x2d35c6(++_0x19e789);}(_0x42f3,0x69));var _0x342f=function(_0xbad322,_0x3e6b0b){_0xbad322=_0xbad322-0x0;var _0x2101cb=_0x42f3[_0xbad322];return _0x2101cb;};'use strict';var util=require(_0x342f('0x0'));var _=require(_0x342f('0x1'));var moment=require('moment');var ami=require(_0x342f('0x2'));var logger=require('../../../config/logger')('acw');var RpcUser=require(_0x342f('0x3'));var RpcVoiceAgentReport=require(_0x342f('0x4'));function Acw(_0x21a001){this[_0x342f('0x5')]=_0x21a001['voiceQueues'];this['agents']=_0x21a001['agents'];this[_0x342f('0x6')]=_0x21a001['timers'];this[_0x342f('0x7')]={};ami['on']('agentconnect',this[_0x342f('0x8')][_0x342f('0x9')](this));ami['on'](_0x342f('0xa'),this['syncHangupRequest'][_0x342f('0x9')](this));ami['on'](_0x342f('0xb'),this['syncHangup'][_0x342f('0x9')](this));ami['on']('agentringnoanswer',this[_0x342f('0xc')][_0x342f('0x9')](this));ami['on'](_0x342f('0xd'),this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x342f('0x9')](this));ami['on']('custom:agentConnectPreview',this[_0x342f('0xe')][_0x342f('0x9')](this));}function getDiff(_0x572c29){var _0x25853f=moment()[_0x342f('0xf')](0x0);var _0x23a616=moment(_0x572c29)[_0x342f('0xf')](0x0);return _0x25853f['diff'](_0x23a616,_0x342f('0x10'));}Acw[_0x342f('0x11')][_0x342f('0x12')]=function(_0x1f618b){try{var _0x3cb3e9=this;var _0x1ae98c=this[_0x342f('0x7')][_0x1f618b]['interface'];var _0x19db65=this[_0x342f('0x7')][_0x1f618b][_0x342f('0x13')];var _0x2e97b9=this[_0x342f('0x5')][_0x19db65];var _0x2604f2=![];var _0x2c856c=_0x342f('0x14');if(_0x2e97b9[_0x342f('0x15')]){if(_0x2e97b9['mandatoryDispositionPause'][_0x342f('0x16')]){_0x2604f2=!![];_0x2c856c=_0x2e97b9[_0x342f('0x17')]['name'];}}ami['Action']({'action':_0x342f('0x18'),'interface':_0x1ae98c,'paused':!![],'reason':_0x2c856c})[_0x342f('0x19')](function(_0x33f234){if(_0x3cb3e9[_0x342f('0x1a')][_0x1ae98c]){return RpcUser[_0x342f('0x1b')](_0x3cb3e9[_0x342f('0x1a')][_0x1ae98c]['id'])['then'](function(_0x59fc0e){if(_0x59fc0e&&!_0x59fc0e[_0x342f('0x1c')]){logger[_0x342f('0x1d')](_0x342f('0x1e'),_0x1f618b,_0x1ae98c,_0x19db65);var _0x37d11b=_0x3cb3e9[_0x342f('0x7')][_0x1f618b]['attended']&&_0x3cb3e9[_0x342f('0x7')][_0x1f618b]['destlinkedid']?_0x3cb3e9[_0x342f('0x7')][_0x1f618b][_0x342f('0x1f')]:_0x1f618b;return RpcUser[_0x342f('0x20')](_0x3cb3e9[_0x342f('0x1a')][_0x1ae98c],_0x2c856c,_0x37d11b)['then'](function(_0x23571a){if(!_0x2604f2){_0x3cb3e9[_0x342f('0x6')][_0x1ae98c]={};logger[_0x342f('0x1d')](_0x342f('0x21'),_0x1f618b,_0x3cb3e9[_0x342f('0x5')][_0x19db65][_0x342f('0x22')],_0x1ae98c,_0x19db65);_0x3cb3e9[_0x342f('0x6')][_0x1ae98c]['timer']=setTimeout(_0x3cb3e9[_0x342f('0x23')]['bind'](_0x3cb3e9,_0x1ae98c),_0x3cb3e9[_0x342f('0x5')][_0x19db65]['acwTimeout']*0x3e8);_0x3cb3e9[_0x342f('0x6')][_0x1ae98c][_0x342f('0x24')]=moment()[_0x342f('0x25')](_0x342f('0x26'));_0x3cb3e9['timers'][_0x1ae98c][_0x342f('0x27')]=_0x1f618b;_0x3cb3e9[_0x342f('0x6')][_0x1ae98c][_0x342f('0x13')]=_0x19db65;_0x3cb3e9[_0x342f('0x6')][_0x1ae98c][_0x342f('0x28')]=function(){var _0x2149a0=getDiff(_0x3cb3e9['timers'][_0x1ae98c][_0x342f('0x24')]);clearTimeout(_0x3cb3e9['timers'][_0x1ae98c][_0x342f('0x29')]);_0x3cb3e9[_0x342f('0x6')][_0x1ae98c][_0x342f('0x29')]=![];RpcVoiceAgentReport[_0x342f('0x2a')]({'acwtime':_0x2149a0},_0x3cb3e9[_0x342f('0x6')][_0x1ae98c][_0x342f('0x27')],_0x1ae98c)[_0x342f('0x19')](function(_0x2ba203){logger[_0x342f('0x1d')](_0x342f('0x2b'),_0x1f618b,_0x2149a0,_0x2ba203);})['catch'](function(_0x189c4e){logger[_0x342f('0x2c')](_0x342f('0x2d'),_0x1f618b,_0x189c4e);});delete _0x3cb3e9[_0x342f('0x6')][_0x1ae98c];};}});}else{logger[_0x342f('0x1d')](_0x342f('0x2e'),_0x1f618b,_0x1ae98c,_0x19db65);}});}})[_0x342f('0x2f')](function(_0x2676ce){logger[_0x342f('0x2c')](_0x342f('0x21'),_0x1f618b,_0x3cb3e9[_0x342f('0x5')][_0x19db65]['acwTimeout'],_0x1ae98c,_0x19db65);})[_0x342f('0x30')](function(){delete _0x3cb3e9['channels'][_0x1f618b];});}catch(_0x32af19){logger[_0x342f('0x2c')](_0x342f('0x31'),_0x32af19[_0x342f('0x32')]);}};Acw[_0x342f('0x11')][_0x342f('0x23')]=function(_0x3f9658){try{var _0x3307e8=this;if(_0x3307e8[_0x342f('0x6')][_0x3f9658]){_0x3307e8[_0x342f('0x6')][_0x3f9658][_0x342f('0x29')]=![];var _0x1432ae=_0x3307e8[_0x342f('0x6')][_0x3f9658][_0x342f('0x27')];var _0x2f1c94=_0x3307e8[_0x342f('0x6')][_0x3f9658][_0x342f('0x13')];var _0x3f2e4f=_0x3307e8['voiceQueues'][_0x2f1c94][_0x342f('0x22')];logger[_0x342f('0x1d')](_0x342f('0x33'),_0x1432ae,_0x3f9658);RpcUser[_0x342f('0x34')](this[_0x342f('0x1a')][_0x3f9658]);RpcVoiceAgentReport[_0x342f('0x2a')]({'acwtime':_0x3f2e4f,'agentacw':!![]},_0x1432ae,_0x3f9658)['then'](function(_0xe34cd3){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x1432ae,_0x3f2e4f,_0xe34cd3);})[_0x342f('0x2f')](function(_0x576dd6){logger[_0x342f('0x2c')]('[%s][UPDATE][ERRORS:%s]',_0x1432ae,_0x576dd6);});}else{logger[_0x342f('0x2c')](_0x342f('0x35'),_0x3f9658);if(_0x3307e8['timers']){logger[_0x342f('0x1d')](_0x342f('0x36'),JSON[_0x342f('0x37')](_0x3307e8['timers']));}}}catch(_0x178dce){logger['error'](_0x342f('0x38'),_0x178dce[_0x342f('0x32')]);}};Acw['prototype']['syncAgentConnect']=function(_0x17f1db){try{if(this[_0x342f('0x5')][_0x17f1db['queue']]&&(this[_0x342f('0x5')][_0x17f1db[_0x342f('0x13')]][_0x342f('0x39')]||this[_0x342f('0x5')][_0x17f1db['queue']][_0x342f('0x15')])){if(this['agents'][_0x17f1db[_0x342f('0x3a')]]){this[_0x342f('0x7')][_0x17f1db[_0x342f('0x27')]]={'queue':_0x17f1db[_0x342f('0x13')],'interface':_0x17f1db[_0x342f('0x3a')],'destlinkedid':_0x17f1db['destlinkedid']};}}}catch(_0x556c03){logger['error'](_0x342f('0x3b'),_0x556c03[_0x342f('0x32')]);}};Acw[_0x342f('0x11')][_0x342f('0xe')]=function(_0x54d87f){try{if(this['voiceQueues'][_0x54d87f[_0x342f('0x13')]]&&(this['voiceQueues'][_0x54d87f[_0x342f('0x13')]][_0x342f('0x39')]||this[_0x342f('0x5')][_0x54d87f[_0x342f('0x13')]][_0x342f('0x15')])){if(this[_0x342f('0x1a')][_0x54d87f[_0x342f('0x3a')]]){this[_0x342f('0x7')][_0x54d87f['uniqueid']]={'queue':_0x54d87f[_0x342f('0x13')],'interface':_0x54d87f[_0x342f('0x3a')]};}}}catch(_0x16d403){logger[_0x342f('0x2c')](_0x342f('0x3c'),_0x16d403[_0x342f('0x32')]);}};Acw[_0x342f('0x11')][_0x342f('0x3d')]=function(_0x4cb1e1){try{if(this[_0x342f('0x7')][_0x4cb1e1[_0x342f('0x27')]]&&_['isUndefined'](this[_0x342f('0x7')][_0x4cb1e1[_0x342f('0x27')]]['attended'])){logger['info'](_0x342f('0x3e'),_0x4cb1e1[_0x342f('0x27')]);this[_0x342f('0x12')](_0x4cb1e1[_0x342f('0x27')]);}else if(this[_0x342f('0x7')][_0x4cb1e1[_0x342f('0x3f')]]&&_[_0x342f('0x40')](this[_0x342f('0x7')][_0x4cb1e1[_0x342f('0x3f')]][_0x342f('0x41')])){logger[_0x342f('0x1d')](_0x342f('0x42'),_0x4cb1e1['linkedid']);this[_0x342f('0x12')](_0x4cb1e1[_0x342f('0x3f')]);}}catch(_0x2df698){logger[_0x342f('0x2c')]('[ACW][syncHangupRequest]\x20%s',_0x2df698[_0x342f('0x32')]);}};Acw[_0x342f('0x11')][_0x342f('0x43')]=function(_0x515dab){try{if(this['channels'][_0x515dab[_0x342f('0x27')]]&&this[_0x342f('0x7')][_0x515dab[_0x342f('0x27')]][_0x342f('0x41')]){logger['info'](_0x342f('0x44'),_0x515dab[_0x342f('0x27')]);this[_0x342f('0x12')](_0x515dab[_0x342f('0x27')]);}else if(this['channels'][_0x515dab[_0x342f('0x3f')]]&&this[_0x342f('0x7')][_0x515dab[_0x342f('0x3f')]][_0x342f('0x41')]){logger[_0x342f('0x1d')](_0x342f('0x45'),_0x515dab[_0x342f('0x3f')]);this[_0x342f('0x12')](_0x515dab['linkedid']);}}catch(_0x263e5c){logger[_0x342f('0x2c')]('[ACW][syncHangup]\x20%s',_0x263e5c[_0x342f('0x32')]);}};Acw[_0x342f('0x11')][_0x342f('0x46')]=function(_0x2075b0){try{if(!_[_0x342f('0x47')](this[_0x342f('0x7')][_0x2075b0[_0x342f('0x48')]])){this[_0x342f('0x12')](_0x2075b0[_0x342f('0x48')]);if(this[_0x342f('0x7')][_0x2075b0[_0x342f('0x49')]]){this[_0x342f('0x7')][_0x2075b0[_0x342f('0x49')]][_0x342f('0x41')]=!![];this[_0x342f('0x7')][_0x2075b0[_0x342f('0x4a')]]=this[_0x342f('0x7')][_0x2075b0['secondtransfereruniqueid']];delete this[_0x342f('0x7')][_0x2075b0[_0x342f('0x49')]];}}else if(!_[_0x342f('0x47')](this[_0x342f('0x7')][_0x2075b0[_0x342f('0x4a')]])){this['startAcw'](_0x2075b0[_0x342f('0x4a')]);if(this['channels'][_0x2075b0[_0x342f('0x4b')]]){this[_0x342f('0x7')][_0x2075b0['origtransfereruniqueid']][_0x342f('0x41')]=!![];this[_0x342f('0x7')][_0x2075b0[_0x342f('0x48')]]=this[_0x342f('0x7')][_0x2075b0['origtransfereruniqueid']];delete this[_0x342f('0x7')][_0x2075b0[_0x342f('0x4b')]];}}}catch(_0x3e7dcc){logger[_0x342f('0x2c')](_0x342f('0x4c'),_0x3e7dcc[_0x342f('0x32')]);}};Acw[_0x342f('0x11')][_0x342f('0x4d')]=function(_0x5764f3){try{if(this[_0x342f('0x7')][_0x5764f3[_0x342f('0x4e')]]){logger[_0x342f('0x1d')](_0x342f('0x4f'),JSON['stringify'](_0x5764f3[_0x342f('0x4e')]));this[_0x342f('0x12')](_0x5764f3['transfereruniqueid']);}else if(this[_0x342f('0x7')][_0x5764f3[_0x342f('0x50')]]){logger[_0x342f('0x1d')](_0x342f('0x51'),JSON[_0x342f('0x37')](_0x5764f3[_0x342f('0x50')]));this[_0x342f('0x12')](_0x5764f3[_0x342f('0x50')]);}}catch(_0x54a255){logger[_0x342f('0x2c')](_0x342f('0x52'),_0x54a255[_0x342f('0x32')]);}};Acw[_0x342f('0x11')]['syncAgentRingNoAnswer']=function(_0x12df87){try{if(this[_0x342f('0x5')][_0x12df87[_0x342f('0x13')]]&&this[_0x342f('0x5')][_0x12df87['queue']][_0x342f('0x53')]===_0x342f('0x54')){if(this['agents'][_0x12df87['interface']]){logger[_0x342f('0x1d')](_0x342f('0x55'),_0x12df87[_0x342f('0x27')],_0x12df87['interface'],_0x12df87['queue']);return RpcUser[_0x342f('0x20')](this['agents'][_0x12df87['interface']],'Auto-Pause',_0x12df87[_0x342f('0x27')]);}}}catch(_0x2452e9){logger[_0x342f('0x2c')](_0x342f('0x56'),_0x2452e9[_0x342f('0x32')]);}};module['exports']=Acw;
\ No newline at end of file
+var _0x8ce4=['message','mandatoryDisposition','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','channels','bind','hanguprequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','startAcw','queue','ACW','mandatoryDispositionPause','then','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','timers','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','[ACW][START]\x20%s','prototype','update','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s'];(function(_0x2fcdbe,_0x27f901){var _0x28ced4=function(_0x5d809f){while(--_0x5d809f){_0x2fcdbe['push'](_0x2fcdbe['shift']());}};_0x28ced4(++_0x27f901);}(_0x8ce4,0xb9));var _0x48ce=function(_0x5ec453,_0x30b0ba){_0x5ec453=_0x5ec453-0x0;var _0x25548f=_0x8ce4[_0x5ec453];return _0x25548f;};'use strict';var util=require(_0x48ce('0x0'));var _=require(_0x48ce('0x1'));var moment=require(_0x48ce('0x2'));var ami=require(_0x48ce('0x3'));var logger=require(_0x48ce('0x4'))(_0x48ce('0x5'));var RpcUser=require(_0x48ce('0x6'));var RpcVoiceAgentReport=require(_0x48ce('0x7'));function Acw(_0x45c83a){this['voiceQueues']=_0x45c83a[_0x48ce('0x8')];this[_0x48ce('0x9')]=_0x45c83a[_0x48ce('0x9')];this['timers']=_0x45c83a['timers'];this[_0x48ce('0xa')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0x48ce('0xb')](this));ami['on'](_0x48ce('0xc'),this['syncHangupRequest'][_0x48ce('0xb')](this));ami['on'](_0x48ce('0xd'),this['syncHangup'][_0x48ce('0xb')](this));ami['on'](_0x48ce('0xe'),this[_0x48ce('0xf')][_0x48ce('0xb')](this));ami['on'](_0x48ce('0x10'),this[_0x48ce('0x11')][_0x48ce('0xb')](this));ami['on']('blindtransfer',this[_0x48ce('0x12')][_0x48ce('0xb')](this));ami['on'](_0x48ce('0x13'),this[_0x48ce('0x14')]['bind'](this));}function getDiff(_0x38f7c6){var _0x3b7dd0=moment()[_0x48ce('0x15')](0x0);var _0x44171e=moment(_0x38f7c6)[_0x48ce('0x15')](0x0);return _0x3b7dd0[_0x48ce('0x16')](_0x44171e,'seconds');}Acw['prototype'][_0x48ce('0x17')]=function(_0x1b1ca6){try{var _0x2d654d=this;var _0x36ec96=this[_0x48ce('0xa')][_0x1b1ca6]['interface'];var _0x67e382=this[_0x48ce('0xa')][_0x1b1ca6][_0x48ce('0x18')];var _0x42e13e=this['voiceQueues'][_0x67e382];var _0x5f02e7=![];var _0x3cfb3c=_0x48ce('0x19');if(_0x42e13e['mandatoryDisposition']){if(_0x42e13e[_0x48ce('0x1a')]['name']){_0x5f02e7=!![];_0x3cfb3c=_0x42e13e[_0x48ce('0x1a')]['name'];}}ami['Action']({'action':'QueuePause','interface':_0x36ec96,'paused':!![],'reason':_0x3cfb3c})[_0x48ce('0x1b')](function(_0x374746){if(_0x2d654d[_0x48ce('0x9')][_0x36ec96]){return RpcUser['getAgent'](_0x2d654d[_0x48ce('0x9')][_0x36ec96]['id'])[_0x48ce('0x1b')](function(_0xba883f){if(_0xba883f&&!_0xba883f['voicePause']){logger[_0x48ce('0x1c')](_0x48ce('0x1d'),_0x1b1ca6,_0x36ec96,_0x67e382);var _0x342b77=_0x2d654d[_0x48ce('0xa')][_0x1b1ca6][_0x48ce('0x1e')]&&_0x2d654d[_0x48ce('0xa')][_0x1b1ca6][_0x48ce('0x1f')]?_0x2d654d[_0x48ce('0xa')][_0x1b1ca6][_0x48ce('0x1f')]:_0x1b1ca6;return RpcUser[_0x48ce('0x20')](_0x2d654d['agents'][_0x36ec96],_0x3cfb3c,_0x342b77)[_0x48ce('0x1b')](function(_0x40e7a1){if(!_0x5f02e7){_0x2d654d[_0x48ce('0x21')][_0x36ec96]={};logger['info'](_0x48ce('0x22'),_0x1b1ca6,_0x2d654d[_0x48ce('0x8')][_0x67e382][_0x48ce('0x23')],_0x36ec96,_0x67e382);_0x2d654d[_0x48ce('0x21')][_0x36ec96][_0x48ce('0x24')]=setTimeout(_0x2d654d['stopAcw']['bind'](_0x2d654d,_0x36ec96),_0x2d654d[_0x48ce('0x8')][_0x67e382][_0x48ce('0x23')]*0x3e8);_0x2d654d['timers'][_0x36ec96][_0x48ce('0x25')]=moment()[_0x48ce('0x26')](_0x48ce('0x27'));_0x2d654d[_0x48ce('0x21')][_0x36ec96][_0x48ce('0x28')]=_0x1b1ca6;_0x2d654d[_0x48ce('0x21')][_0x36ec96]['queue']=_0x67e382;_0x2d654d[_0x48ce('0x21')][_0x36ec96][_0x48ce('0x29')]=function(){var _0x1ea4a6=getDiff(_0x2d654d[_0x48ce('0x21')][_0x36ec96][_0x48ce('0x25')]);clearTimeout(_0x2d654d['timers'][_0x36ec96]['timer']);_0x2d654d[_0x48ce('0x21')][_0x36ec96][_0x48ce('0x24')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x1ea4a6},_0x2d654d[_0x48ce('0x21')][_0x36ec96]['uniqueid'],_0x36ec96)[_0x48ce('0x1b')](function(_0x2b1869){logger[_0x48ce('0x1c')](_0x48ce('0x2a'),_0x1b1ca6,_0x1ea4a6,_0x2b1869);})[_0x48ce('0x2b')](function(_0x161e39){logger[_0x48ce('0x2c')](_0x48ce('0x2d'),_0x1b1ca6,_0x161e39);});delete _0x2d654d[_0x48ce('0x21')][_0x36ec96];};}});}else{logger[_0x48ce('0x1c')](_0x48ce('0x2e'),_0x1b1ca6,_0x36ec96,_0x67e382);}});}})[_0x48ce('0x2b')](function(_0x3782d3){logger[_0x48ce('0x2c')](_0x48ce('0x22'),_0x1b1ca6,_0x2d654d[_0x48ce('0x8')][_0x67e382][_0x48ce('0x23')],_0x36ec96,_0x67e382);})[_0x48ce('0x2f')](function(){delete _0x2d654d['channels'][_0x1b1ca6];});}catch(_0x20fae4){logger[_0x48ce('0x2c')](_0x48ce('0x30'),_0x20fae4['message']);}};Acw[_0x48ce('0x31')]['stopAcw']=function(_0x19b90b){try{var _0x54098b=this;if(_0x54098b[_0x48ce('0x21')][_0x19b90b]){_0x54098b[_0x48ce('0x21')][_0x19b90b]['timer']=![];var _0x551290=_0x54098b['timers'][_0x19b90b]['uniqueid'];var _0x42a69a=_0x54098b['timers'][_0x19b90b][_0x48ce('0x18')];var _0x5bed86=_0x54098b[_0x48ce('0x8')][_0x42a69a][_0x48ce('0x23')];logger[_0x48ce('0x1c')]('[%s][TIMER][STOP][AGENT:%s]',_0x551290,_0x19b90b);RpcUser['saveUnpause'](this[_0x48ce('0x9')][_0x19b90b]);RpcVoiceAgentReport[_0x48ce('0x32')]({'acwtime':_0x5bed86,'agentacw':!![]},_0x551290,_0x19b90b)[_0x48ce('0x1b')](function(_0x4b905c){logger[_0x48ce('0x1c')]('[%s][UPDATE][ACWTIME:%s]',_0x551290,_0x5bed86,_0x4b905c);})[_0x48ce('0x2b')](function(_0x5d23cc){logger[_0x48ce('0x2c')](_0x48ce('0x2d'),_0x551290,_0x5d23cc);});}else{logger[_0x48ce('0x2c')](_0x48ce('0x33'),_0x19b90b);if(_0x54098b[_0x48ce('0x21')]){logger['info'](_0x48ce('0x34'),JSON[_0x48ce('0x35')](_0x54098b[_0x48ce('0x21')]));}}}catch(_0x22ffbe){logger[_0x48ce('0x2c')](_0x48ce('0x36'),_0x22ffbe[_0x48ce('0x37')]);}};Acw[_0x48ce('0x31')]['syncAgentConnect']=function(_0x173b8f){try{if(this[_0x48ce('0x8')][_0x173b8f[_0x48ce('0x18')]]&&(this[_0x48ce('0x8')][_0x173b8f['queue']]['acw']||this[_0x48ce('0x8')][_0x173b8f[_0x48ce('0x18')]][_0x48ce('0x38')])){if(this[_0x48ce('0x9')][_0x173b8f[_0x48ce('0x39')]]){this[_0x48ce('0xa')][_0x173b8f[_0x48ce('0x28')]]={'queue':_0x173b8f[_0x48ce('0x18')],'interface':_0x173b8f[_0x48ce('0x39')],'destlinkedid':_0x173b8f['destlinkedid']};}}}catch(_0x1598fd){logger['error'](_0x48ce('0x3a'),_0x1598fd[_0x48ce('0x37')]);}};Acw[_0x48ce('0x31')][_0x48ce('0x14')]=function(_0x470e8a){try{if(this[_0x48ce('0x8')][_0x470e8a[_0x48ce('0x18')]]&&(this[_0x48ce('0x8')][_0x470e8a[_0x48ce('0x18')]][_0x48ce('0x5')]||this[_0x48ce('0x8')][_0x470e8a[_0x48ce('0x18')]][_0x48ce('0x38')])){if(this[_0x48ce('0x9')][_0x470e8a[_0x48ce('0x39')]]){this[_0x48ce('0xa')][_0x470e8a[_0x48ce('0x28')]]={'queue':_0x470e8a[_0x48ce('0x18')],'interface':_0x470e8a[_0x48ce('0x39')]};}}}catch(_0x106a27){logger[_0x48ce('0x2c')](_0x48ce('0x3b'),_0x106a27[_0x48ce('0x37')]);}};Acw[_0x48ce('0x31')][_0x48ce('0x3c')]=function(_0x91e94f){try{if(this[_0x48ce('0xa')][_0x91e94f[_0x48ce('0x28')]]&&_[_0x48ce('0x3d')](this[_0x48ce('0xa')][_0x91e94f['uniqueid']][_0x48ce('0x1e')])){logger[_0x48ce('0x1c')](_0x48ce('0x3e'),_0x91e94f[_0x48ce('0x28')]);this[_0x48ce('0x17')](_0x91e94f[_0x48ce('0x28')]);}else if(this[_0x48ce('0xa')][_0x91e94f[_0x48ce('0x3f')]]&&_[_0x48ce('0x3d')](this[_0x48ce('0xa')][_0x91e94f[_0x48ce('0x3f')]]['attended'])){logger[_0x48ce('0x1c')](_0x48ce('0x40'),_0x91e94f[_0x48ce('0x3f')]);this['startAcw'](_0x91e94f[_0x48ce('0x3f')]);}}catch(_0xd0dc6f){logger['error'](_0x48ce('0x41'),_0xd0dc6f[_0x48ce('0x37')]);}};Acw[_0x48ce('0x31')]['syncHangup']=function(_0x39b6e5){try{if(this[_0x48ce('0xa')][_0x39b6e5[_0x48ce('0x28')]]&&this[_0x48ce('0xa')][_0x39b6e5['uniqueid']][_0x48ce('0x1e')]){logger[_0x48ce('0x1c')](_0x48ce('0x42'),_0x39b6e5['uniqueid']);this[_0x48ce('0x17')](_0x39b6e5[_0x48ce('0x28')]);}else if(this[_0x48ce('0xa')][_0x39b6e5[_0x48ce('0x3f')]]&&this[_0x48ce('0xa')][_0x39b6e5['linkedid']][_0x48ce('0x1e')]){logger['info'](_0x48ce('0x43'),_0x39b6e5[_0x48ce('0x3f')]);this[_0x48ce('0x17')](_0x39b6e5['linkedid']);}}catch(_0x3fbdf0){logger[_0x48ce('0x2c')](_0x48ce('0x44'),_0x3fbdf0[_0x48ce('0x37')]);}};Acw[_0x48ce('0x31')][_0x48ce('0x11')]=function(_0x21e36f){try{if(!_[_0x48ce('0x45')](this[_0x48ce('0xa')][_0x21e36f[_0x48ce('0x46')]])){this[_0x48ce('0x17')](_0x21e36f[_0x48ce('0x46')]);if(this[_0x48ce('0xa')][_0x21e36f['secondtransfereruniqueid']]){this['channels'][_0x21e36f['secondtransfereruniqueid']][_0x48ce('0x1e')]=!![];this[_0x48ce('0xa')][_0x21e36f[_0x48ce('0x47')]]=this['channels'][_0x21e36f['secondtransfereruniqueid']];delete this[_0x48ce('0xa')][_0x21e36f['secondtransfereruniqueid']];}}else if(!_['isNil'](this[_0x48ce('0xa')][_0x21e36f[_0x48ce('0x47')]])){this[_0x48ce('0x17')](_0x21e36f[_0x48ce('0x47')]);if(this[_0x48ce('0xa')][_0x21e36f[_0x48ce('0x48')]]){this['channels'][_0x21e36f[_0x48ce('0x48')]]['attended']=!![];this[_0x48ce('0xa')][_0x21e36f[_0x48ce('0x46')]]=this[_0x48ce('0xa')][_0x21e36f[_0x48ce('0x48')]];delete this[_0x48ce('0xa')][_0x21e36f['origtransfereruniqueid']];}}}catch(_0x2d1b6e){logger['error']('[ACW][syncAttendedTransfer]\x20%s',_0x2d1b6e['message']);}};Acw['prototype'][_0x48ce('0x12')]=function(_0x455d1a){try{if(this['channels'][_0x455d1a[_0x48ce('0x49')]]){logger[_0x48ce('0x1c')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x48ce('0x35')](_0x455d1a['transfereruniqueid']));this[_0x48ce('0x17')](_0x455d1a['transfereruniqueid']);}else if(this[_0x48ce('0xa')][_0x455d1a['transfererlinkedid']]){logger['info'](_0x48ce('0x4a'),JSON[_0x48ce('0x35')](_0x455d1a[_0x48ce('0x4b')]));this[_0x48ce('0x17')](_0x455d1a['transfererlinkedid']);}}catch(_0x15d33b){logger[_0x48ce('0x2c')](_0x48ce('0x4c'),_0x15d33b[_0x48ce('0x37')]);}};Acw[_0x48ce('0x31')][_0x48ce('0xf')]=function(_0x3b2c85){try{if(this[_0x48ce('0x8')][_0x3b2c85[_0x48ce('0x18')]]&&this[_0x48ce('0x8')][_0x3b2c85[_0x48ce('0x18')]]['autopause']===_0x48ce('0x4d')){if(this[_0x48ce('0x9')][_0x3b2c85['interface']]){logger[_0x48ce('0x1c')](_0x48ce('0x4e'),_0x3b2c85['uniqueid'],_0x3b2c85[_0x48ce('0x39')],_0x3b2c85[_0x48ce('0x18')]);return RpcUser[_0x48ce('0x20')](this[_0x48ce('0x9')][_0x3b2c85[_0x48ce('0x39')]],'Auto-Pause',_0x3b2c85[_0x48ce('0x28')]);}}}catch(_0x49c39a){logger[_0x48ce('0x2c')](_0x48ce('0x4f'),_0x49c39a['message']);}};module['exports']=Acw;
\ No newline at end of file
index 8001d08..292445c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d03=['actionSipShowRegistry','Action','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','format','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionCoreShowChannels','catch','log','exports','bluebird','moment','util','lodash','../../config/logger','asterisk','port','username','password','keepConnected','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s'];(function(_0x335235,_0x3aa499){var _0x74bae8=function(_0x347a52){while(--_0x347a52){_0x335235['push'](_0x335235['shift']());}};_0x74bae8(++_0x3aa499);}(_0x6d03,0xe1));var _0x36d0=function(_0x506ecb,_0x2957e4){_0x506ecb=_0x506ecb-0x0;var _0x341e49=_0x6d03[_0x506ecb];return _0x341e49;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x36d0('0x0'));var moment=require(_0x36d0('0x1'));var util=require(_0x36d0('0x2'));var _=require(_0x36d0('0x3'));var logger=require(_0x36d0('0x4'))('ami');var config=require('../../config/environment');var ami=new Manager(config[_0x36d0('0x5')][_0x36d0('0x6')],config[_0x36d0('0x5')]['ip'],config[_0x36d0('0x5')][_0x36d0('0x7')],config[_0x36d0('0x5')][_0x36d0('0x8')],!![]);ami[_0x36d0('0x9')]();ami['Action']=BPromise['promisify'](ami[_0x36d0('0xa')]);function error(_0xd89ac1){logger[_0x36d0('0xb')](util['format'](_0x36d0('0xc'),config['asterisk']['username'],config[_0x36d0('0x5')]['ip'],config[_0x36d0('0x5')][_0x36d0('0x6')],util[_0x36d0('0xd')](_0xd89ac1,![],null)));}function close(){logger['error'](util['format'](_0x36d0('0xe'),config[_0x36d0('0x5')][_0x36d0('0x7')],config[_0x36d0('0x5')]['ip'],config[_0x36d0('0x5')]['port']));}ami[_0x36d0('0xf')]=function(){return function(){return ami[_0x36d0('0x10')]({'action':_0x36d0('0x11')});};};ami[_0x36d0('0x12')]=function(){return function(){return ami[_0x36d0('0x10')]({'action':_0x36d0('0x13')});};};ami[_0x36d0('0x14')]=function(){return function(){return ami[_0x36d0('0x10')]({'action':_0x36d0('0x15')});};};ami[_0x36d0('0x16')]=function(){return function(){return ami[_0x36d0('0x10')]({'action':_0x36d0('0x17')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x36d0('0x10')]({'action':_0x36d0('0x18')});};};function connect(_0x329f1c){logger[_0x36d0('0x19')](util['format'](_0x36d0('0x1a'),config[_0x36d0('0x5')][_0x36d0('0x7')],config['asterisk']['ip'],config[_0x36d0('0x5')][_0x36d0('0x6')]));ami[_0x36d0('0x1b')](_0x36d0('0xb'),error);ami[_0x36d0('0x1b')](_0x36d0('0x1c'),close);}ami['on'](_0x36d0('0x1d'),connect);ami['on']('shutdown',function(_0x53f59f){logger[_0x36d0('0x19')](util['format'](_0x36d0('0x1e'),config['asterisk'][_0x36d0('0x7')],config[_0x36d0('0x5')]['ip'],config[_0x36d0('0x5')][_0x36d0('0x6')],util['inspect'](_0x53f59f,![],null)));});ami['on'](_0x36d0('0x1f'),function(_0x8fcd42){logger[_0x36d0('0x19')](util[_0x36d0('0x20')](_0x36d0('0x21'),config['asterisk'][_0x36d0('0x7')],config[_0x36d0('0x5')]['ip'],config['asterisk'][_0x36d0('0x6')]));return BPromise[_0x36d0('0x22')]()['then'](ami[_0x36d0('0xf')]())[_0x36d0('0x23')](ami[_0x36d0('0x12')]())[_0x36d0('0x23')](ami[_0x36d0('0x14')]())[_0x36d0('0x23')](ami[_0x36d0('0x16')]())['then'](ami[_0x36d0('0x24')]())[_0x36d0('0x25')](function(_0x2781fc){console[_0x36d0('0x26')](_0x2781fc);});});ami[_0x36d0('0x1b')](_0x36d0('0xb'),error);ami['once'](_0x36d0('0x1c'),close);module[_0x36d0('0x27')]=ami;
\ No newline at end of file
+var _0x3981=['queuesummary','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionDeviceStateList','actionCoreShowChannels','catch','log','close','exports','bluebird','lodash','../../config/logger','ami','../../config/environment','asterisk','port','password','Action','promisify','format','inspect','error','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','username','actionSipShowRegistry','sipshowregistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary'];(function(_0x2a3081,_0x3885e3){var _0x34180b=function(_0x1580d0){while(--_0x1580d0){_0x2a3081['push'](_0x2a3081['shift']());}};_0x34180b(++_0x3885e3);}(_0x3981,0xd5));var _0x1398=function(_0x28c9f9,_0x104b33){_0x28c9f9=_0x28c9f9-0x0;var _0xb8494e=_0x3981[_0x28c9f9];return _0xb8494e;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x1398('0x0'));var moment=require('moment');var util=require('util');var _=require(_0x1398('0x1'));var logger=require(_0x1398('0x2'))(_0x1398('0x3'));var config=require(_0x1398('0x4'));var ami=new Manager(config[_0x1398('0x5')][_0x1398('0x6')],config[_0x1398('0x5')]['ip'],config['asterisk']['username'],config['asterisk'][_0x1398('0x7')],!![]);ami['keepConnected']();ami[_0x1398('0x8')]=BPromise[_0x1398('0x9')](ami['action']);function error(_0x39eb62){logger['error'](util[_0x1398('0xa')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x1398('0x5')]['username'],config[_0x1398('0x5')]['ip'],config[_0x1398('0x5')][_0x1398('0x6')],util[_0x1398('0xb')](_0x39eb62,![],null)));}function close(){logger[_0x1398('0xc')](util[_0x1398('0xa')](_0x1398('0xd'),config['asterisk'][_0x1398('0xe')],config[_0x1398('0x5')]['ip'],config[_0x1398('0x5')]['port']));}ami[_0x1398('0xf')]=function(){return function(){return ami['Action']({'action':_0x1398('0x10')});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x1398('0x8')]({'action':_0x1398('0x11')});};};ami[_0x1398('0x12')]=function(){return function(){return ami[_0x1398('0x8')]({'action':_0x1398('0x13')});};};ami[_0x1398('0x14')]=function(){return function(){return ami[_0x1398('0x8')]({'action':_0x1398('0x15')});};};ami['actionCoreShowChannels']=function(){return function(){return ami['Action']({'action':_0x1398('0x16')});};};function connect(_0x32fce8){logger[_0x1398('0x17')](util[_0x1398('0xa')](_0x1398('0x18'),config['asterisk'][_0x1398('0xe')],config[_0x1398('0x5')]['ip'],config[_0x1398('0x5')][_0x1398('0x6')]));ami[_0x1398('0x19')](_0x1398('0xc'),error);ami[_0x1398('0x19')]('close',close);}ami['on'](_0x1398('0x1a'),connect);ami['on'](_0x1398('0x1b'),function(_0x11af97){logger['info'](util[_0x1398('0xa')](_0x1398('0x1c'),config[_0x1398('0x5')][_0x1398('0xe')],config[_0x1398('0x5')]['ip'],config[_0x1398('0x5')]['port'],util[_0x1398('0xb')](_0x11af97,![],null)));});ami['on'](_0x1398('0x1d'),function(_0x218a03){logger[_0x1398('0x17')](util[_0x1398('0xa')](_0x1398('0x1e'),config['asterisk'][_0x1398('0xe')],config[_0x1398('0x5')]['ip'],config[_0x1398('0x5')][_0x1398('0x6')]));return BPromise[_0x1398('0x1f')]()[_0x1398('0x20')](ami['actionSipShowRegistry']())[_0x1398('0x20')](ami[_0x1398('0x21')]())[_0x1398('0x20')](ami['actionSipPeerStatus']())[_0x1398('0x20')](ami[_0x1398('0x14')]())[_0x1398('0x20')](ami[_0x1398('0x22')]())[_0x1398('0x23')](function(_0x2ce0df){console[_0x1398('0x24')](_0x2ce0df);});});ami[_0x1398('0x19')](_0x1398('0xc'),error);ami[_0x1398('0x19')](_0x1398('0x25'),close);module[_0x1398('0x26')]=ami;
\ No newline at end of file
index 670fbfe..17d2f7c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda3f=['then','rpc','memberReport','error','message','result','catch','exports','bluebird','../../config/logger','Request','request'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xda3f,0xec));var _0xfda3=function(_0x2630dd,_0x4ff833){_0x2630dd=_0x2630dd-0x0;var _0x251e6f=_0xda3f[_0x2630dd];return _0x251e6f;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xfda3('0x0'));var logger=require(_0xfda3('0x1'))('ami');var client=jayson['client']['http']({'port':0x2329});client[_0xfda3('0x2')]=function(_0x581693,_0x36dc71){return new BPromise(function(_0x22187d,_0x516500){return client[_0xfda3('0x3')](_0x581693,_0x36dc71)[_0xfda3('0x4')](function(_0x47e7e2){logger['debug'](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x36dc71,_0x47e7e2);if(_0x47e7e2[_0xfda3('0x7')]){logger[_0xfda3('0x7')](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x47e7e2[_0xfda3('0x7')][_0xfda3('0x8')],_0x36dc71);return _0x516500(_0x47e7e2[_0xfda3('0x7')][_0xfda3('0x8')]);}else{return _0x22187d(_0x47e7e2[_0xfda3('0x9')]);}})[_0xfda3('0xa')](function(_0x4d7841){logger[_0xfda3('0x7')](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x4d7841,_0x36dc71);return _0x516500(_0x4d7841);});});};module[_0xfda3('0xb')]=client;
\ No newline at end of file
+var _0xcb91=['request','debug','memberReport','error','rpc','message','result','catch','exports','../../config/logger','ami','client','http'];(function(_0x54d4fe,_0x55e869){var _0x1ab5bb=function(_0x5b1af2){while(--_0x5b1af2){_0x54d4fe['push'](_0x54d4fe['shift']());}};_0x1ab5bb(++_0x55e869);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4b9978,_0x58eb71){_0x4b9978=_0x4b9978-0x0;var _0x42f0e5=_0xcb91[_0x4b9978];return _0x42f0e5;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var client=jayson[_0x1cb9('0x2')][_0x1cb9('0x3')]({'port':0x2329});client['Request']=function(_0x8c392f,_0x2c17b8){return new BPromise(function(_0x545a34,_0x13d5fd){return client[_0x1cb9('0x4')](_0x8c392f,_0x2c17b8)['then'](function(_0x226b69){logger[_0x1cb9('0x5')]('rpc',_0x1cb9('0x6'),_0x8c392f,_0x2c17b8,_0x226b69);if(_0x226b69[_0x1cb9('0x7')]){logger['error'](_0x1cb9('0x8'),'memberReport',_0x8c392f,_0x226b69['error'][_0x1cb9('0x9')],_0x2c17b8);return _0x13d5fd(_0x226b69[_0x1cb9('0x7')][_0x1cb9('0x9')]);}else{return _0x545a34(_0x226b69[_0x1cb9('0xa')]);}})[_0x1cb9('0xb')](function(_0x50ce71){logger[_0x1cb9('0x7')](_0x1cb9('0x8'),_0x1cb9('0x6'),_0x8c392f,_0x50ce71,_0x2c17b8);return _0x13d5fd(_0x50ce71);});});};module[_0x1cb9('0xc')]=client;
\ No newline at end of file
index 270a0b0..0794ea9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd485=['util','moment','string','isNil','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countdropretry','countabandonedretry','countmachineretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','getCaller','\x22%s\x22\x20<%s>','substring','dialCutDigit','getQueue','exports'];(function(_0x5a0957,_0x22f040){var _0x3ceab1=function(_0x3d6344){while(--_0x3d6344){_0x5a0957['push'](_0x5a0957['shift']());}};_0x3ceab1(++_0x22f040);}(_0xd485,0xcd));var _0x5d48=function(_0x30d77a,_0x55d542){_0x30d77a=_0x30d77a-0x0;var _0x382841=_0xd485[_0x30d77a];return _0x382841;};'use strict';var util=require(_0x5d48('0x0'));var _=require('lodash');var moment=require(_0x5d48('0x1'));function checkNameSurname(_0x5cb90d,_0x27862b,_0x353049){var _0x4bb26e='';if(!_['isNil'](_0x27862b)&&_0x5d48('0x2')===typeof _0x27862b){_0x4bb26e+=_0x27862b;}if(!_[_0x5d48('0x3')](_0x353049)&&_0x5d48('0x2')===typeof _0x353049){_0x4bb26e+='\x20'+_0x353049;}if(_0x4bb26e!==''){return _0x4bb26e;}return _0x5cb90d;}function Action(_0x246e3f,_0x5ce4a5,_0x501cb8){this[_0x5d48('0x4')]=_0x246e3f;this[_0x5d48('0x5')]=_0x501cb8||undefined;this[_0x5d48('0x6')]=checkNameSurname(_0x5ce4a5[_0x5d48('0x7')][_0x5d48('0x8')],_0x5ce4a5[_0x5d48('0x7')][_0x5d48('0x9')],_0x5ce4a5[_0x5d48('0x7')][_0x5d48('0xa')]);this[_0x5d48('0xb')]=_0x5ce4a5[_0x5d48('0x7')][_0x5d48('0x8')];this[_0x5d48('0xc')]=_0x246e3f[_0x5d48('0x6')];this[_0x5d48('0xd')]=_0x5ce4a5[_0x5d48('0xd')]||![];this[_0x5d48('0xe')]=_0x246e3f['type'];this[_0x5d48('0xf')]=_0x246e3f[_0x5d48('0xf')]||0x3;this[_0x5d48('0x10')]=_0x5ce4a5['scheduledat'];this[_0x5d48('0x11')]=_0x5ce4a5[_0x5d48('0x11')];this[_0x5d48('0x12')]=_0x5ce4a5['countcongestionretry'];this['countnoanswerretry']=_0x5ce4a5['countnoanswerretry'];this['countnosuchnumberretry']=_0x5ce4a5['countnosuchnumberretry'];this[_0x5d48('0x13')]=_0x5ce4a5[_0x5d48('0x13')];this[_0x5d48('0x14')]=_0x5ce4a5[_0x5d48('0x14')];this[_0x5d48('0x15')]=_0x5ce4a5[_0x5d48('0x15')];this['countagentrejectretry']=_0x5ce4a5['countagentrejectretry'];this[_0x5d48('0x16')]=_0x5ce4a5[_0x5d48('0x16')];this[_0x5d48('0x17')]=_0x5ce4a5[_0x5d48('0x17')];this['UserId']=_0x5ce4a5[_0x5d48('0x18')];this[_0x5d48('0x19')]=_0x5ce4a5[_0x5d48('0x19')];this[_0x5d48('0x1a')]=_0x5ce4a5[_0x5d48('0x1a')];this[_0x5d48('0x1b')]=_0x5ce4a5['id'];this['ContactFirstName']=_0x5ce4a5[_0x5d48('0x7')][_0x5d48('0x9')]||'';this['starttime']=moment()[_0x5d48('0x1c')](_0x5d48('0x1d'));this[_0x5d48('0x1e')]=_0x5ce4a5[_0x5d48('0x1e')];this[_0x5d48('0x1f')]=_0x5ce4a5['callbackuniqueid'];this['callbackat']=_0x5ce4a5[_0x5d48('0x20')];this[_0x5d48('0x21')]=_0x5ce4a5['recallme'];this[_0x5d48('0x22')]='';this['originatecalleridname']='';}Action['prototype'][_0x5d48('0x23')]=function(){return util[_0x5d48('0x1c')](_0x5d48('0x24'),this[_0x5d48('0x6')],this[_0x5d48('0x4')]['dialCutDigit']>0x0?this[_0x5d48('0xb')][_0x5d48('0x25')](this[_0x5d48('0x4')][_0x5d48('0x26')]):this[_0x5d48('0xb')]);};Action['prototype'][_0x5d48('0x27')]=function(){return this[_0x5d48('0xc')];};module[_0x5d48('0x28')]=Action;
\ No newline at end of file
+var _0x93ed=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','substring','getQueue','exports','util','moment','string','isNil','voiceQueue','name','phone','Contact','firstName','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x2b9705,_0xe1f810){var _0x5b72d3=function(_0x110fa7){while(--_0x110fa7){_0x2b9705['push'](_0x2b9705['shift']());}};_0x5b72d3(++_0xe1f810);}(_0x93ed,0xca));var _0xd93e=function(_0x38baac,_0x2772b3){_0x38baac=_0x38baac-0x0;var _0x47baf1=_0x93ed[_0x38baac];return _0x47baf1;};'use strict';var util=require(_0xd93e('0x0'));var _=require('lodash');var moment=require(_0xd93e('0x1'));function checkNameSurname(_0x5d9945,_0x1d2291,_0xbb71f){var _0x5e8800='';if(!_['isNil'](_0x1d2291)&&_0xd93e('0x2')===typeof _0x1d2291){_0x5e8800+=_0x1d2291;}if(!_[_0xd93e('0x3')](_0xbb71f)&&_0xd93e('0x2')===typeof _0xbb71f){_0x5e8800+='\x20'+_0xbb71f;}if(_0x5e8800!==''){return _0x5e8800;}return _0x5d9945;}function Action(_0x4be0fb,_0x3df26e,_0x40fac7){this[_0xd93e('0x4')]=_0x4be0fb;this['uniqueid']=_0x40fac7||undefined;this[_0xd93e('0x5')]=checkNameSurname(_0x3df26e['Contact'][_0xd93e('0x6')],_0x3df26e[_0xd93e('0x7')][_0xd93e('0x8')],_0x3df26e[_0xd93e('0x7')][_0xd93e('0x9')]);this['number']=_0x3df26e[_0xd93e('0x7')][_0xd93e('0x6')];this[_0xd93e('0xa')]=_0x4be0fb[_0xd93e('0x5')];this[_0xd93e('0xb')]=_0x3df26e[_0xd93e('0xb')]||![];this['type']=_0x4be0fb[_0xd93e('0xc')];this[_0xd93e('0xd')]=_0x4be0fb['dialQueueTimeout']||0x3;this[_0xd93e('0xe')]=_0x3df26e[_0xd93e('0xe')];this[_0xd93e('0xf')]=_0x3df26e['countbusyretry'];this[_0xd93e('0x10')]=_0x3df26e[_0xd93e('0x10')];this[_0xd93e('0x11')]=_0x3df26e[_0xd93e('0x11')];this[_0xd93e('0x12')]=_0x3df26e['countnosuchnumberretry'];this[_0xd93e('0x13')]=_0x3df26e[_0xd93e('0x13')];this[_0xd93e('0x14')]=_0x3df26e[_0xd93e('0x14')];this[_0xd93e('0x15')]=_0x3df26e[_0xd93e('0x15')];this[_0xd93e('0x16')]=_0x3df26e[_0xd93e('0x16')];this[_0xd93e('0x17')]=_0x3df26e[_0xd93e('0x17')];this[_0xd93e('0x18')]=_0x3df26e[_0xd93e('0x18')];this[_0xd93e('0x19')]=_0x3df26e['UserId'];this[_0xd93e('0x1a')]=_0x3df26e[_0xd93e('0x1a')];this[_0xd93e('0x1b')]=_0x3df26e[_0xd93e('0x1b')];this[_0xd93e('0x1c')]=_0x3df26e['id'];this['ContactFirstName']=_0x3df26e[_0xd93e('0x7')]['firstName']||'';this[_0xd93e('0x1d')]=moment()[_0xd93e('0x1e')](_0xd93e('0x1f'));this[_0xd93e('0x20')]=_0x3df26e[_0xd93e('0x20')];this[_0xd93e('0x21')]=_0x3df26e[_0xd93e('0x21')];this['callbackat']=_0x3df26e[_0xd93e('0x22')];this[_0xd93e('0x23')]=_0x3df26e[_0xd93e('0x23')];this['originatecalleridnum']='';this[_0xd93e('0x24')]='';}Action[_0xd93e('0x25')][_0xd93e('0x26')]=function(){return util[_0xd93e('0x1e')](_0xd93e('0x27'),this[_0xd93e('0x5')],this[_0xd93e('0x4')][_0xd93e('0x28')]>0x0?this[_0xd93e('0x29')][_0xd93e('0x2a')](this['voiceQueue'][_0xd93e('0x28')]):this[_0xd93e('0x29')]);};Action[_0xd93e('0x25')][_0xd93e('0x2b')]=function(){return this[_0xd93e('0xa')];};module[_0xd93e('0x2c')]=Action;
\ No newline at end of file
index 2cdffd6..c30c2cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4a20=['starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number'];(function(_0x228284,_0x791773){var _0x3715d5=function(_0x47d091){while(--_0x47d091){_0x228284['push'](_0x228284['shift']());}};_0x3715d5(++_0x791773);}(_0x4a20,0x75));var _0x04a2=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x4a20[_0xaa1b3e];return _0x454d7d;};'use strict';var util=require('util');var _=require(_0x04a2('0x0'));var moment=require(_0x04a2('0x1'));function getSeconds(_0x46adbc,_0x4644cd){var _0x548893=moment(_0x46adbc)[_0x04a2('0x2')](0x0);var _0x3da70a=moment(_0x4644cd)[_0x04a2('0x2')](0x0);return _0x548893[_0x04a2('0x3')](_0x3da70a,_0x04a2('0x4'));}function AgentComplete(_0x14bcbd,_0x58d3bc){this[_0x04a2('0x5')]=0x4;this[_0x04a2('0x6')]=_0x04a2('0x7');this[_0x04a2('0x8')]=_0x14bcbd[_0x04a2('0x8')];this['type']=_0x14bcbd[_0x04a2('0x9')];this['campaigntype']=_0x14bcbd[_0x04a2('0x9')]===_0x04a2('0xa')?'queue':_0x14bcbd[_0x04a2('0x9')];this[_0x04a2('0xb')]=_0x14bcbd['countbusyretry'];this[_0x04a2('0xc')]=_0x14bcbd[_0x04a2('0xc')];this[_0x04a2('0xd')]=_0x14bcbd[_0x04a2('0xd')];this[_0x04a2('0xe')]=_0x14bcbd[_0x04a2('0xb')]+_0x14bcbd[_0x04a2('0xc')]+_0x14bcbd[_0x04a2('0xd')]+_0x14bcbd['countnosuchnumberretry']+_0x14bcbd[_0x04a2('0xf')]+_0x14bcbd['countabandonedretry']+_0x14bcbd['countmachineretry']+_0x14bcbd['countagentrejectretry'];this[_0x04a2('0x10')]=_0x14bcbd[_0x04a2('0x10')];this[_0x04a2('0xf')]=_0x14bcbd[_0x04a2('0xf')];this['countabandonedretry']=_0x14bcbd['countabandonedretry'];this[_0x04a2('0x11')]=_0x14bcbd['countmachineretry'];this['countagentrejectretry']=_0x14bcbd[_0x04a2('0x12')];this['uniqueid']=_0x58d3bc[_0x04a2('0x13')];this[_0x04a2('0x14')]=_0x14bcbd[_0x04a2('0x15')];this[_0x04a2('0x16')]=_0x14bcbd[_0x04a2('0x17')];this[_0x04a2('0x18')]=_0x14bcbd[_0x04a2('0x18')];this[_0x04a2('0x19')]=_0x14bcbd['responsetime'];this['answertime']=_0x14bcbd[_0x04a2('0x1a')];this[_0x04a2('0x1b')]=moment()[_0x04a2('0x1c')](_0x04a2('0x1d'));this[_0x04a2('0x1e')]=getSeconds(_0x14bcbd[_0x04a2('0x19')],_0x14bcbd[_0x04a2('0x18')]);this['holdtime']=getSeconds(_0x14bcbd[_0x04a2('0x1a')],_0x14bcbd[_0x04a2('0x19')]);this[_0x04a2('0x1f')]=getSeconds(this['endtime'],_0x14bcbd[_0x04a2('0x1a')]);this[_0x04a2('0x20')]=_0x58d3bc[_0x04a2('0x20')];this[_0x04a2('0x21')]=_0x58d3bc[_0x04a2('0x21')];this[_0x04a2('0x22')]=_0x58d3bc[_0x04a2('0x22')];this[_0x04a2('0x23')]=_0x14bcbd[_0x04a2('0x23')];this['callbackuniqueid']=_0x14bcbd[_0x04a2('0x24')];this[_0x04a2('0x25')]=_0x14bcbd['callbackat'];this[_0x04a2('0x26')]=_0x14bcbd[_0x04a2('0x26')];this['ContactId']=_0x14bcbd[_0x04a2('0x27')];this['ListId']=_0x14bcbd[_0x04a2('0x28')];this[_0x04a2('0x29')]=_0x14bcbd[_0x04a2('0x29')];this[_0x04a2('0x2a')]=_0x14bcbd[_0x04a2('0x2a')];this[_0x04a2('0x2b')]=_0x14bcbd[_0x04a2('0x2b')];this[_0x04a2('0x2c')]=_0x14bcbd['originatecalleridnum']||'';this['originatecalleridname']=_0x14bcbd[_0x04a2('0x2d')]||'';}module[_0x04a2('0x2e')]=AgentComplete;
\ No newline at end of file
+var _0x7dfb=['CampaignId','originatecalleridnum','originatecalleridname','util','lodash','milliseconds','diff','seconds','state','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x7dfb,0x10b));var _0xb7df=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x7dfb[_0x28947d];return _0x12d2ee;};'use strict';var util=require(_0xb7df('0x0'));var _=require(_0xb7df('0x1'));var moment=require('moment');function getSeconds(_0x349df6,_0x3910d5){var _0x54456c=moment(_0x349df6)[_0xb7df('0x2')](0x0);var _0x4f6290=moment(_0x3910d5)[_0xb7df('0x2')](0x0);return _0x54456c[_0xb7df('0x3')](_0x4f6290,_0xb7df('0x4'));}function AgentComplete(_0x563d19,_0x6241eb){this[_0xb7df('0x5')]=0x4;this['statedesc']=_0xb7df('0x6');this['scheduledat']=_0x563d19[_0xb7df('0x7')];this[_0xb7df('0x8')]=_0x563d19[_0xb7df('0x8')];this[_0xb7df('0x9')]=_0x563d19[_0xb7df('0x8')]===_0xb7df('0xa')?_0xb7df('0xb'):_0x563d19[_0xb7df('0x8')];this[_0xb7df('0xc')]=_0x563d19[_0xb7df('0xc')];this[_0xb7df('0xd')]=_0x563d19[_0xb7df('0xd')];this['countnoanswerretry']=_0x563d19[_0xb7df('0xe')];this[_0xb7df('0xf')]=_0x563d19[_0xb7df('0xc')]+_0x563d19[_0xb7df('0xd')]+_0x563d19['countnoanswerretry']+_0x563d19['countnosuchnumberretry']+_0x563d19[_0xb7df('0x10')]+_0x563d19[_0xb7df('0x11')]+_0x563d19[_0xb7df('0x12')]+_0x563d19[_0xb7df('0x13')];this[_0xb7df('0x14')]=_0x563d19['countnosuchnumberretry'];this[_0xb7df('0x10')]=_0x563d19[_0xb7df('0x10')];this[_0xb7df('0x11')]=_0x563d19[_0xb7df('0x11')];this[_0xb7df('0x12')]=_0x563d19[_0xb7df('0x12')];this[_0xb7df('0x13')]=_0x563d19[_0xb7df('0x13')];this[_0xb7df('0x15')]=_0x6241eb[_0xb7df('0x15')];this[_0xb7df('0x16')]=_0x563d19['name'];this['calleridnum']=_0x563d19['number'];this[_0xb7df('0x17')]=_0x563d19['starttime'];this[_0xb7df('0x18')]=_0x563d19[_0xb7df('0x18')];this[_0xb7df('0x19')]=_0x563d19[_0xb7df('0x19')];this[_0xb7df('0x1a')]=moment()[_0xb7df('0x1b')](_0xb7df('0x1c'));this[_0xb7df('0x1d')]=getSeconds(_0x563d19['responsetime'],_0x563d19[_0xb7df('0x17')]);this['holdtime']=getSeconds(_0x563d19['answertime'],_0x563d19[_0xb7df('0x18')]);this[_0xb7df('0x1e')]=getSeconds(this[_0xb7df('0x1a')],_0x563d19[_0xb7df('0x19')]);this['queue']=_0x6241eb[_0xb7df('0xb')];this[_0xb7df('0x1f')]=_0x6241eb['membername'];this[_0xb7df('0x20')]=_0x6241eb['reason'];this['callback']=_0x563d19[_0xb7df('0x21')];this[_0xb7df('0x22')]=_0x563d19[_0xb7df('0x22')];this[_0xb7df('0x23')]=_0x563d19[_0xb7df('0x23')];this[_0xb7df('0x24')]=_0x563d19['recallme'];this[_0xb7df('0x25')]=_0x563d19[_0xb7df('0x25')];this[_0xb7df('0x26')]=_0x563d19[_0xb7df('0x26')];this[_0xb7df('0x27')]=_0x563d19[_0xb7df('0x27')];this[_0xb7df('0x28')]=_0x563d19[_0xb7df('0x28')];this[_0xb7df('0x29')]=_0x563d19[_0xb7df('0x29')];this[_0xb7df('0x2a')]=_0x563d19[_0xb7df('0x2a')]||'';this[_0xb7df('0x2b')]=_0x563d19['originatecalleridname']||'';}module['exports']=AgentComplete;
\ No newline at end of file
index e2c50f2..bdfc663 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc978=['UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x3efbff,_0x3d6b69){var _0x3997e8=function(_0x3b7ecd){while(--_0x3b7ecd){_0x3efbff['push'](_0x3efbff['shift']());}};_0x3997e8(++_0x3d6b69);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x8c97('0x0'));var _=require(_0x8c97('0x1'));var moment=require(_0x8c97('0x2'));function getSeconds(_0x35f7e9,_0x371c48){var _0x44d4ea=moment(_0x35f7e9)['milliseconds'](0x0);var _0x23f5e9=moment(_0x371c48)[_0x8c97('0x3')](0x0);return _0x44d4ea[_0x8c97('0x4')](_0x23f5e9,_0x8c97('0x5'));}function Final(_0x426a77){this[_0x8c97('0x6')]=_0x426a77[_0x8c97('0x6')];this['scheduledat']=_0x426a77[_0x8c97('0x7')];this[_0x8c97('0x8')]=_0x426a77[_0x8c97('0x8')];this[_0x8c97('0x9')]=_0x426a77[_0x8c97('0x8')]===_0x8c97('0xa')?_0x8c97('0xb'):_0x426a77['type'];this[_0x8c97('0xc')]=_0x426a77[_0x8c97('0xc')];this[_0x8c97('0xd')]=_0x426a77[_0x8c97('0xd')];this[_0x8c97('0xe')]=_0x426a77[_0x8c97('0xe')];this[_0x8c97('0xf')]=_0x426a77[_0x8c97('0xc')]+_0x426a77[_0x8c97('0xd')]+_0x426a77['countnoanswerretry']+_0x426a77[_0x8c97('0x10')]+_0x426a77[_0x8c97('0x11')]+_0x426a77['countabandonedretry']+_0x426a77[_0x8c97('0x12')]+_0x426a77[_0x8c97('0x13')];this['countnosuchnumberretry']=_0x426a77[_0x8c97('0x10')];this['countdropretry']=_0x426a77['countdropretry'];this['countabandonedretry']=_0x426a77[_0x8c97('0x14')];this[_0x8c97('0x12')]=_0x426a77[_0x8c97('0x12')];this[_0x8c97('0x13')]=_0x426a77[_0x8c97('0x13')];this[_0x8c97('0xb')]=_0x426a77[_0x8c97('0xb')];this[_0x8c97('0x15')]=_0x426a77[_0x8c97('0x15')];this['calleridnum']=_0x426a77[_0x8c97('0x16')];this[_0x8c97('0x17')]=_0x426a77[_0x8c97('0x17')];this[_0x8c97('0x18')]=_0x426a77[_0x8c97('0x18')];this[_0x8c97('0x19')]=_0x426a77[_0x8c97('0x18')];this[_0x8c97('0x1a')]=_0x426a77[_0x8c97('0x1a')]||0x0;this[_0x8c97('0x1b')]=_0x426a77[_0x8c97('0x1b')]||0x0;this[_0x8c97('0x1c')]=_0x426a77[_0x8c97('0x1c')]||0x0;this[_0x8c97('0x1d')]=_0x426a77[_0x8c97('0x1d')];this[_0x8c97('0x1e')]=_0x426a77['callbackuniqueid'];this[_0x8c97('0x1f')]=_0x426a77[_0x8c97('0x1f')];this[_0x8c97('0x20')]=_0x426a77['recallme'];this['ContactId']=_0x426a77[_0x8c97('0x21')];this['ListId']=_0x426a77[_0x8c97('0x22')];this[_0x8c97('0x23')]=_0x426a77[_0x8c97('0x23')];this[_0x8c97('0x24')]=_0x426a77[_0x8c97('0x24')];this[_0x8c97('0x25')]=_0x426a77[_0x8c97('0x25')];this['originatecalleridnum']=_0x426a77['originatecalleridnum']||'';this[_0x8c97('0x26')]=_0x426a77[_0x8c97('0x26')]||'';}module[_0x8c97('0x27')]=Final;
\ No newline at end of file
+var _0x106f=['scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','queue','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','uniqueid'];(function(_0x509a5b,_0x5f43a1){var _0x107f1e=function(_0x491fc8){while(--_0x491fc8){_0x509a5b['push'](_0x509a5b['shift']());}};_0x107f1e(++_0x5f43a1);}(_0x106f,0x162));var _0xf106=function(_0x477c83,_0x2c5e84){_0x477c83=_0x477c83-0x0;var _0x24fb6c=_0x106f[_0x477c83];return _0x24fb6c;};'use strict';var util=require(_0xf106('0x0'));var _=require(_0xf106('0x1'));var moment=require('moment');function getSeconds(_0x4014dd,_0x6d8236){var _0x59bc3a=moment(_0x4014dd)[_0xf106('0x2')](0x0);var _0x4ab04f=moment(_0x6d8236)[_0xf106('0x2')](0x0);return _0x59bc3a[_0xf106('0x3')](_0x4ab04f,_0xf106('0x4'));}function Final(_0x318376){this[_0xf106('0x5')]=_0x318376[_0xf106('0x5')];this[_0xf106('0x6')]=_0x318376['scheduledat'];this[_0xf106('0x7')]=_0x318376[_0xf106('0x7')];this['campaigntype']=_0x318376['type']==='outbound'?'queue':_0x318376['type'];this[_0xf106('0x8')]=_0x318376[_0xf106('0x8')];this[_0xf106('0x9')]=_0x318376[_0xf106('0x9')];this[_0xf106('0xa')]=_0x318376[_0xf106('0xa')];this[_0xf106('0xb')]=_0x318376[_0xf106('0x8')]+_0x318376[_0xf106('0x9')]+_0x318376[_0xf106('0xa')]+_0x318376[_0xf106('0xc')]+_0x318376['countdropretry']+_0x318376[_0xf106('0xd')]+_0x318376[_0xf106('0xe')]+_0x318376['countagentrejectretry'];this['countnosuchnumberretry']=_0x318376[_0xf106('0xc')];this[_0xf106('0xf')]=_0x318376[_0xf106('0xf')];this['countabandonedretry']=_0x318376[_0xf106('0xd')];this[_0xf106('0xe')]=_0x318376[_0xf106('0xe')];this['countagentrejectretry']=_0x318376[_0xf106('0x10')];this[_0xf106('0x11')]=_0x318376['queue'];this[_0xf106('0x12')]=_0x318376[_0xf106('0x12')];this[_0xf106('0x13')]=_0x318376['calleridnum'];this['starttime']=_0x318376[_0xf106('0x14')];this[_0xf106('0x15')]=_0x318376[_0xf106('0x15')];this['endtime']=_0x318376[_0xf106('0x15')];this[_0xf106('0x16')]=_0x318376[_0xf106('0x16')]||0x0;this[_0xf106('0x17')]=_0x318376[_0xf106('0x17')]||0x0;this[_0xf106('0x18')]=_0x318376[_0xf106('0x18')]||0x0;this[_0xf106('0x19')]=_0x318376[_0xf106('0x19')];this['callbackuniqueid']=_0x318376['callbackuniqueid'];this[_0xf106('0x1a')]=_0x318376['callbackat'];this[_0xf106('0x1b')]=_0x318376[_0xf106('0x1b')];this[_0xf106('0x1c')]=_0x318376[_0xf106('0x1c')];this[_0xf106('0x1d')]=_0x318376['ListId'];this['UserId']=_0x318376[_0xf106('0x1e')];this[_0xf106('0x1f')]=_0x318376[_0xf106('0x1f')];this[_0xf106('0x20')]=_0x318376[_0xf106('0x20')];this[_0xf106('0x21')]=_0x318376[_0xf106('0x21')]||'';this[_0xf106('0x22')]=_0x318376[_0xf106('0x22')]||'';}module[_0xf106('0x23')]=Final;
\ No newline at end of file
index db90b8c..b852c62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf598=['queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','countabandonedretry','countmachineretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','membername','IVR','reason','cause-txt','callback','callbackat','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound'];(function(_0x556ef1,_0x3bd90d){var _0x1b519b=function(_0x51f3e9){while(--_0x51f3e9){_0x556ef1['push'](_0x556ef1['shift']());}};_0x1b519b(++_0x3bd90d);}(_0xf598,0x1d7));var _0x8f59=function(_0x2f9d9c,_0x4f50a0){_0x2f9d9c=_0x2f9d9c-0x0;var _0x3d3acb=_0xf598[_0x2f9d9c];return _0x3d3acb;};'use strict';var util=require(_0x8f59('0x0'));var _=require(_0x8f59('0x1'));var moment=require(_0x8f59('0x2'));function getSeconds(_0x2a8091,_0x59f91c){var _0x5741c2=moment(_0x2a8091)[_0x8f59('0x3')](0x0);var _0x3049c0=moment(_0x59f91c)[_0x8f59('0x3')](0x0);return _0x5741c2[_0x8f59('0x4')](_0x3049c0,_0x8f59('0x5'));}function Hangup(_0x3fce24,_0x49a544){this[_0x8f59('0x6')]=0x4;this[_0x8f59('0x7')]=_0x8f59('0x8');this[_0x8f59('0x9')]=_0x3fce24[_0x8f59('0x9')];this['type']=_0x3fce24[_0x8f59('0xa')];this[_0x8f59('0xb')]=_0x3fce24[_0x8f59('0xa')]===_0x8f59('0xc')?_0x8f59('0xd'):_0x3fce24[_0x8f59('0xa')];this[_0x8f59('0xe')]=_0x3fce24[_0x8f59('0xe')];this['countcongestionretry']=_0x3fce24[_0x8f59('0xf')];this['countnoanswerretry']=_0x3fce24['countnoanswerretry'];this[_0x8f59('0x10')]=_0x3fce24['countbusyretry']+_0x3fce24[_0x8f59('0xf')]+_0x3fce24[_0x8f59('0x11')]+_0x3fce24[_0x8f59('0x12')]+_0x3fce24[_0x8f59('0x13')]+_0x3fce24['countabandonedretry']+_0x3fce24['countmachineretry']+_0x3fce24[_0x8f59('0x14')];this[_0x8f59('0x12')]=_0x3fce24[_0x8f59('0x12')];this[_0x8f59('0x13')]=_0x3fce24[_0x8f59('0x13')];this[_0x8f59('0x15')]=_0x3fce24[_0x8f59('0x15')];this[_0x8f59('0x16')]=_0x3fce24['countmachineretry'];this[_0x8f59('0x14')]=_0x3fce24[_0x8f59('0x14')];this[_0x8f59('0x17')]=_0x49a544[_0x8f59('0x17')];this['calleridname']=_0x3fce24[_0x8f59('0x18')];this[_0x8f59('0x19')]=_0x3fce24[_0x8f59('0x1a')];this[_0x8f59('0x1b')]=_0x3fce24['starttime'];this[_0x8f59('0x1c')]=_0x3fce24[_0x8f59('0x1c')];this[_0x8f59('0x1d')]=moment()['format'](_0x8f59('0x1e'));this[_0x8f59('0x1f')]=getSeconds(_0x3fce24[_0x8f59('0x1c')],_0x3fce24['starttime']);this['holdtime']=0x0;this[_0x8f59('0x20')]=getSeconds(this[_0x8f59('0x1d')],_0x3fce24[_0x8f59('0x1c')]);this['queue']=_0x3fce24[_0x8f59('0xd')];this[_0x8f59('0x21')]=_0x8f59('0x22');this[_0x8f59('0x23')]=_0x49a544[_0x8f59('0x24')];this[_0x8f59('0x25')]=_0x3fce24[_0x8f59('0x25')];this['callbackuniqueid']=_0x3fce24['callbackuniqueid'];this[_0x8f59('0x26')]=_0x3fce24[_0x8f59('0x26')];this['recallme']=_0x3fce24['recallme'];this[_0x8f59('0x27')]=_0x3fce24[_0x8f59('0x27')];this['ListId']=_0x3fce24['ListId'];this[_0x8f59('0x28')]=_0x3fce24[_0x8f59('0x28')];this['VoiceQueueId']=_0x3fce24[_0x8f59('0x29')];this['CampaignId']=_0x3fce24[_0x8f59('0x2a')];}module[_0x8f59('0x2b')]=Hangup;
\ No newline at end of file
+var _0xa0ae=['callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','IVR','reason','cause-txt'];(function(_0x168143,_0x3ec1e4){var _0x164b3c=function(_0x239fbf){while(--_0x239fbf){_0x168143['push'](_0x168143['shift']());}};_0x164b3c(++_0x3ec1e4);}(_0xa0ae,0x1ac));var _0xea0a=function(_0x245afe,_0x319cde){_0x245afe=_0x245afe-0x0;var _0x4eefde=_0xa0ae[_0x245afe];return _0x4eefde;};'use strict';var util=require('util');var _=require(_0xea0a('0x0'));var moment=require(_0xea0a('0x1'));function getSeconds(_0xea2909,_0x4f0eaf){var _0x487187=moment(_0xea2909)[_0xea0a('0x2')](0x0);var _0x370bf4=moment(_0x4f0eaf)[_0xea0a('0x2')](0x0);return _0x487187[_0xea0a('0x3')](_0x370bf4,_0xea0a('0x4'));}function Hangup(_0x4ca7d5,_0xac9684){this[_0xea0a('0x5')]=0x4;this[_0xea0a('0x6')]=_0xea0a('0x7');this[_0xea0a('0x8')]=_0x4ca7d5[_0xea0a('0x8')];this['type']=_0x4ca7d5[_0xea0a('0x9')];this[_0xea0a('0xa')]=_0x4ca7d5['type']===_0xea0a('0xb')?_0xea0a('0xc'):_0x4ca7d5['type'];this[_0xea0a('0xd')]=_0x4ca7d5[_0xea0a('0xd')];this[_0xea0a('0xe')]=_0x4ca7d5[_0xea0a('0xe')];this[_0xea0a('0xf')]=_0x4ca7d5[_0xea0a('0xf')];this['countglobal']=_0x4ca7d5[_0xea0a('0xd')]+_0x4ca7d5['countcongestionretry']+_0x4ca7d5['countnoanswerretry']+_0x4ca7d5[_0xea0a('0x10')]+_0x4ca7d5[_0xea0a('0x11')]+_0x4ca7d5[_0xea0a('0x12')]+_0x4ca7d5[_0xea0a('0x13')]+_0x4ca7d5[_0xea0a('0x14')];this[_0xea0a('0x10')]=_0x4ca7d5[_0xea0a('0x10')];this[_0xea0a('0x11')]=_0x4ca7d5[_0xea0a('0x11')];this['countabandonedretry']=_0x4ca7d5[_0xea0a('0x12')];this[_0xea0a('0x13')]=_0x4ca7d5[_0xea0a('0x13')];this['countagentrejectretry']=_0x4ca7d5[_0xea0a('0x14')];this['uniqueid']=_0xac9684[_0xea0a('0x15')];this[_0xea0a('0x16')]=_0x4ca7d5[_0xea0a('0x17')];this['calleridnum']=_0x4ca7d5['number'];this[_0xea0a('0x18')]=_0x4ca7d5[_0xea0a('0x18')];this['responsetime']=_0x4ca7d5[_0xea0a('0x19')];this[_0xea0a('0x1a')]=moment()[_0xea0a('0x1b')](_0xea0a('0x1c'));this[_0xea0a('0x1d')]=getSeconds(_0x4ca7d5[_0xea0a('0x19')],_0x4ca7d5[_0xea0a('0x18')]);this[_0xea0a('0x1e')]=0x0;this['talktime']=getSeconds(this[_0xea0a('0x1a')],_0x4ca7d5[_0xea0a('0x19')]);this[_0xea0a('0xc')]=_0x4ca7d5[_0xea0a('0xc')];this['membername']=_0xea0a('0x1f');this[_0xea0a('0x20')]=_0xac9684[_0xea0a('0x21')];this['callback']=_0x4ca7d5['callback'];this[_0xea0a('0x22')]=_0x4ca7d5['callbackuniqueid'];this[_0xea0a('0x23')]=_0x4ca7d5[_0xea0a('0x23')];this[_0xea0a('0x24')]=_0x4ca7d5[_0xea0a('0x24')];this[_0xea0a('0x25')]=_0x4ca7d5[_0xea0a('0x25')];this[_0xea0a('0x26')]=_0x4ca7d5[_0xea0a('0x26')];this[_0xea0a('0x27')]=_0x4ca7d5[_0xea0a('0x27')];this[_0xea0a('0x28')]=_0x4ca7d5[_0xea0a('0x28')];this[_0xea0a('0x29')]=_0x4ca7d5['CampaignId'];}module['exports']=Hangup;
\ No newline at end of file
index c2df813..b81b950 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x527c=['calleridname','calleridnum','starttime','responsetime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','queue'];(function(_0x3611cd,_0x5b2b47){var _0x58d809=function(_0xc1e519){while(--_0xc1e519){_0x3611cd['push'](_0x3611cd['shift']());}};_0x58d809(++_0x5b2b47);}(_0x527c,0x15f));var _0xc527=function(_0x34ecbf,_0x210898){_0x34ecbf=_0x34ecbf-0x0;var _0x115f8a=_0x527c[_0x34ecbf];return _0x115f8a;};'use strict';var util=require(_0xc527('0x0'));var _=require(_0xc527('0x1'));var moment=require('moment');function getSeconds(_0x8f9a33,_0xaca864){var _0x4928d4=moment(_0x8f9a33)[_0xc527('0x2')](0x0);var _0x5b55e9=moment(_0xaca864)[_0xc527('0x2')](0x0);return _0x4928d4['diff'](_0x5b55e9,_0xc527('0x3'));}function History(_0x24c3ea){this[_0xc527('0x4')]=_0x24c3ea[_0xc527('0x4')];this[_0xc527('0x5')]=_0x24c3ea[_0xc527('0x5')]||undefined;this[_0xc527('0x6')]=_0x24c3ea[_0xc527('0x6')];this[_0xc527('0x7')]=_0x24c3ea[_0xc527('0x6')]===_0xc527('0x8')?'queue':_0x24c3ea['type'];this['countbusyretry']=_0x24c3ea['countbusyretry'];this[_0xc527('0x9')]=_0x24c3ea[_0xc527('0x9')];this[_0xc527('0xa')]=_0x24c3ea['countnoanswerretry'];this[_0xc527('0xb')]=_0x24c3ea[_0xc527('0xc')]+_0x24c3ea[_0xc527('0x9')]+_0x24c3ea['countnoanswerretry']+_0x24c3ea['countnosuchnumberretry']+_0x24c3ea[_0xc527('0xd')]+_0x24c3ea['countabandonedretry']+_0x24c3ea[_0xc527('0xe')]+_0x24c3ea[_0xc527('0xf')];this[_0xc527('0x10')]=_0x24c3ea['countnosuchnumberretry'];this[_0xc527('0xd')]=_0x24c3ea[_0xc527('0xd')];this[_0xc527('0x11')]=_0x24c3ea[_0xc527('0x11')];this['countmachineretry']=_0x24c3ea['countmachineretry'];this[_0xc527('0xf')]=_0x24c3ea[_0xc527('0xf')];this[_0xc527('0x12')]=_0x24c3ea[_0xc527('0x12')];this[_0xc527('0x13')]=_0x24c3ea['name'];this[_0xc527('0x14')]=_0x24c3ea['number'];this[_0xc527('0x15')]=_0x24c3ea[_0xc527('0x15')];this[_0xc527('0x16')]=_0x24c3ea[_0xc527('0x16')];this['endtime']=_0x24c3ea[_0xc527('0x16')];this['ringtime']=getSeconds(_0x24c3ea[_0xc527('0x16')],_0x24c3ea['starttime']);this[_0xc527('0x17')]=0x0;this[_0xc527('0x18')]=0x0;this[_0xc527('0x19')]=_0x24c3ea[_0xc527('0x19')];this[_0xc527('0x1a')]=_0x24c3ea[_0xc527('0x1a')];this[_0xc527('0x1b')]=_0x24c3ea[_0xc527('0x1b')];this[_0xc527('0x1c')]=_0x24c3ea[_0xc527('0x1c')];this['ContactId']=_0x24c3ea[_0xc527('0x1d')];this[_0xc527('0x1e')]=_0x24c3ea[_0xc527('0x1e')];this[_0xc527('0x1f')]=_0x24c3ea[_0xc527('0x1f')];this['VoiceQueueId']=_0x24c3ea[_0xc527('0x20')];this[_0xc527('0x21')]=_0x24c3ea[_0xc527('0x21')];this[_0xc527('0x22')]=_0x24c3ea[_0xc527('0x22')]||'';this[_0xc527('0x23')]=_0x24c3ea[_0xc527('0x23')]||'';}module[_0xc527('0x24')]=History;
\ No newline at end of file
+var _0x0eca=['recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','moment','milliseconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat'];(function(_0x11ff8a,_0x269ec4){var _0x415be3=function(_0x407051){while(--_0x407051){_0x11ff8a['push'](_0x11ff8a['shift']());}};_0x415be3(++_0x269ec4);}(_0x0eca,0x12f));var _0xa0ec=function(_0x55bf29,_0x42915f){_0x55bf29=_0x55bf29-0x0;var _0x3bcec5=_0x0eca[_0x55bf29];return _0x3bcec5;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xa0ec('0x0'));function getSeconds(_0x45515c,_0x3d872d){var _0x423387=moment(_0x45515c)['milliseconds'](0x0);var _0x3f362c=moment(_0x3d872d)[_0xa0ec('0x1')](0x0);return _0x423387['diff'](_0x3f362c,'seconds');}function History(_0x30f1f0){this[_0xa0ec('0x2')]=_0x30f1f0[_0xa0ec('0x2')];this[_0xa0ec('0x3')]=_0x30f1f0[_0xa0ec('0x3')]||undefined;this[_0xa0ec('0x4')]=_0x30f1f0[_0xa0ec('0x4')];this[_0xa0ec('0x5')]=_0x30f1f0[_0xa0ec('0x4')]===_0xa0ec('0x6')?_0xa0ec('0x7'):_0x30f1f0[_0xa0ec('0x4')];this[_0xa0ec('0x8')]=_0x30f1f0[_0xa0ec('0x8')];this[_0xa0ec('0x9')]=_0x30f1f0['countcongestionretry'];this['countnoanswerretry']=_0x30f1f0[_0xa0ec('0xa')];this[_0xa0ec('0xb')]=_0x30f1f0[_0xa0ec('0x8')]+_0x30f1f0[_0xa0ec('0x9')]+_0x30f1f0['countnoanswerretry']+_0x30f1f0['countnosuchnumberretry']+_0x30f1f0[_0xa0ec('0xc')]+_0x30f1f0[_0xa0ec('0xd')]+_0x30f1f0[_0xa0ec('0xe')]+_0x30f1f0[_0xa0ec('0xf')];this[_0xa0ec('0x10')]=_0x30f1f0['countnosuchnumberretry'];this['countdropretry']=_0x30f1f0[_0xa0ec('0xc')];this[_0xa0ec('0xd')]=_0x30f1f0[_0xa0ec('0xd')];this[_0xa0ec('0xe')]=_0x30f1f0['countmachineretry'];this['countagentrejectretry']=_0x30f1f0[_0xa0ec('0xf')];this['queue']=_0x30f1f0[_0xa0ec('0x7')];this[_0xa0ec('0x11')]=_0x30f1f0[_0xa0ec('0x12')];this[_0xa0ec('0x13')]=_0x30f1f0[_0xa0ec('0x14')];this[_0xa0ec('0x15')]=_0x30f1f0[_0xa0ec('0x15')];this[_0xa0ec('0x16')]=_0x30f1f0[_0xa0ec('0x16')];this[_0xa0ec('0x17')]=_0x30f1f0[_0xa0ec('0x16')];this[_0xa0ec('0x18')]=getSeconds(_0x30f1f0[_0xa0ec('0x16')],_0x30f1f0['starttime']);this[_0xa0ec('0x19')]=0x0;this[_0xa0ec('0x1a')]=0x0;this[_0xa0ec('0x1b')]=_0x30f1f0['callback'];this[_0xa0ec('0x1c')]=_0x30f1f0['callbackuniqueid'];this['callbackat']=_0x30f1f0[_0xa0ec('0x1d')];this[_0xa0ec('0x1e')]=_0x30f1f0[_0xa0ec('0x1e')];this[_0xa0ec('0x1f')]=_0x30f1f0[_0xa0ec('0x1f')];this['ListId']=_0x30f1f0['ListId'];this['UserId']=_0x30f1f0[_0xa0ec('0x20')];this[_0xa0ec('0x21')]=_0x30f1f0['VoiceQueueId'];this[_0xa0ec('0x22')]=_0x30f1f0['CampaignId'];this[_0xa0ec('0x23')]=_0x30f1f0[_0xa0ec('0x23')]||'';this[_0xa0ec('0x24')]=_0x30f1f0[_0xa0ec('0x24')]||'';}module['exports']=History;
\ No newline at end of file
index 7443960..efb2ed3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5db8=['[syncQueueSummary]','\x5cw{0,','pow','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialQueueTimeout','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[callProgressDetecting]','entity\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','dialNoSuchNumberMaxRetry','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','AgentReject','custom:agentreject','agentreject','reason\x2020\x20agentreject','reason','[moveContactManagedDialer][0]','contact\x20not\x20moved','round','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','dialPredictiveOptimizationPercentage','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','[booked][checkContactBlack]','queueStatusComplete:\x20','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','Queue:\x20','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','[countReScheduled]\x20','tryOriginatePredictive','not_inuse','[actionOriginate]\x20','[actionOriginatePredictive]\x20','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','interval\x20=\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Ts\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','moment','md5','ioredis','../../../config/logger','dialer','booked','predictiveCalls','syncQueueSummary','redis','localhost','socket.io-emitter','../rpc/voiceQueueRt','./action','./final','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','newexten','syncNewExten','varset','syncVarSet','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','name','message','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','abandoned','waiting','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\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','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\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','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','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','originated','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contactsRescheduled','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','available','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','state','statedesc','endtime','clearZombieChannels','[actions]','isNil','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','queue','countReScheduled','resolve','then','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','unmonitored','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','uniqueid','HangupInAMD','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','MACHINE','outboundAnswerAgiCallsDay','Machine','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countcongestionretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','add','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','membername','[syncHangupInAMDIvr]','countbusyretry','countnoanswerretry','countnosuchnumberretry','createStateFinal','minutes','syncHangup','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','AGI','dialQueueProject','outboundUnknownCallsDay','syncAgentComplete','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','droptime','responsetime','Drop','dropreason','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncQueueMember','actionid','locked','stateinterface','strategy','push','merge','idHopper','paused','[booked][unlockQueueStatus]','queueStatusComplete','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','run','contactAgent-idHopper:\x20','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','ifTime','checkIfTimeIntervals','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','indexOf','true','content','some','GLOBAL_INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','predictive','Queue','launchHandleIvr','handleIvr','dialActive','checkIsTrunkReachable','checkIfTime','dialGlobalInterval','dialTimezone'];(function(_0x149955,_0xe033d3){var _0x943baa=function(_0x3de40b){while(--_0x3de40b){_0x149955['push'](_0x149955['shift']());}};_0x943baa(++_0xe033d3);}(_0x5db8,0xbb));var _0x85db=function(_0x1460f6,_0x59051a){_0x1460f6=_0x1460f6-0x0;var _0x46ce94=_0x5db8[_0x1460f6];return _0x46ce94;};'use strict';var util=require(_0x85db('0x0'));var _=require(_0x85db('0x1'));var BPromise=require(_0x85db('0x2'));var uuid=require('uuid');var moment=require(_0x85db('0x3'));var rr=require('rr');var md5=require(_0x85db('0x4'));var Redis=require(_0x85db('0x5'));var ut=require('../preview/util/util');var config=require('../../../config/environment/');var logger=require(_0x85db('0x6'))(_0x85db('0x7'));var loggerBooked=require(_0x85db('0x6'))(_0x85db('0x8'));var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require(_0x85db('0x6'))(_0x85db('0x9'));var loggerSyncQueueSummary=require(_0x85db('0x6'))(_0x85db('0xa'));var ami=require('../ami');config[_0x85db('0xb')]=_['defaults'](config[_0x85db('0xb')],{'host':_0x85db('0xc'),'port':0x18eb});var io=require(_0x85db('0xd'))(new Redis(config[_0x85db('0xb')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x85db('0xe'));var Action=require(_0x85db('0xf'));var History=require('./history');var Final=require(_0x85db('0x10'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x85db('0x11'));var Hangup=require(_0x85db('0x12'));var ipAgi=process[_0x85db('0x13')][_0x85db('0x14')]||_0x85db('0x15');var strategy={'rrmemory':_0x85db('0x16'),'roundrobin':_0x85db('0x17')};var Sequence=function(){};Sequence[_0x85db('0x18')][_0x85db('0x19')]=function(_0x415281){this[_0x85db('0x1a')]=this[_0x85db('0x1a')]?this[_0x85db('0x1a')]['finally'](_0x415281):_0x415281();};function Dialer(_0x27bd65,_0x175622){this[_0x85db('0x1b')]=new Sequence();this[_0x85db('0x1c')]=_0x175622;this[_0x85db('0x1d')]=_0x27bd65[_0x85db('0x1d')];this[_0x85db('0x1e')]=_0x27bd65['campaigns'];this[_0x85db('0x1f')]=_0x27bd65[_0x85db('0x1f')];this[_0x85db('0x20')]=_0x27bd65[_0x85db('0x20')];this[_0x85db('0x21')]=config[_0x85db('0x21')]||0x2;this[_0x85db('0x22')]={};this[_0x85db('0x23')]={};this[_0x85db('0x24')]={};this[_0x85db('0x25')]={};this['optionPredictive']={};this[_0x85db('0x26')]={};this[_0x85db('0x27')]={};this[_0x85db('0x28')]={};this[_0x85db('0x29')]={};this[_0x85db('0x2a')]={};ami['on'](_0x85db('0x2b'),this[_0x85db('0x2c')][_0x85db('0x2d')](this));ami['on']('queuecallerabandon',this[_0x85db('0x2e')][_0x85db('0x2d')](this));ami['on'](_0x85db('0x2f'),this[_0x85db('0x30')][_0x85db('0x2d')](this));ami['on'](_0x85db('0x31'),this['syncAgentComplete'][_0x85db('0x2d')](this));ami['on'](_0x85db('0x32'),this[_0x85db('0xa')]['bind'](this));ami['on']('hangup',this['syncHangup'][_0x85db('0x2d')](this));ami['on'](_0x85db('0x33'),this[_0x85db('0x34')]['bind'](this));ami['on'](_0x85db('0x35'),this[_0x85db('0x36')][_0x85db('0x2d')](this));ami['on']('queuemember',this['syncQueueMember'][_0x85db('0x2d')](this));ami['on'](_0x85db('0x37'),this[_0x85db('0x38')][_0x85db('0x2d')](this));this[_0x85db('0x39')]();this[_0x85db('0x3a')]();}function isNotNull(_0x8af4a4){return _0x8af4a4!==null&&!_[_0x85db('0x3b')](_0x8af4a4);}function checkIsLoggedIn(_0x6ee161,_0x1edc8d){return function(){if(_0x1edc8d<=0x0){_0x6ee161['message']='AGENTS_NOT_LOGGED';throw _0x6ee161[_0x85db('0x3c')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x22e404){return _0x22e404;}function checkIsActive(_0x203cad,_0x5abdb7){return function(){if(!isActive(_0x5abdb7)){_0x203cad[_0x85db('0x3d')]=_0x85db('0x3e');throw _0x203cad[_0x85db('0x3c')]+_0x85db('0x3f');}};}function checkInterval(_0x515a06){return function(){if(!isNotNull(_0x515a06[_0x85db('0x40')])){_0x515a06[_0x85db('0x3d')]=_0x85db('0x41');throw _0x515a06[_0x85db('0x3c')]+_0x85db('0x42');}if(!isNotNull(_0x515a06['Interval'][_0x85db('0x43')])){_0x515a06[_0x85db('0x3d')]=_0x85db('0x41');throw _0x515a06[_0x85db('0x3c')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x85db('0x44')](_0x515a06[_0x85db('0x40')][_0x85db('0x43')]))){_0x515a06['message']='INTERVAL_IS_NULL';throw _0x515a06[_0x85db('0x3c')]+_0x85db('0x42');}};}function msgResponse(_0x4980b7,_0x33b08e,_0x2e2879){return{'action':_0x4980b7,'response':_0x33b08e,'message':_0x2e2879,'stack':_0x2e2879};}function myreject(_0x20939b){return function(_0x240325){return _0x20939b(msgResponse(_0x85db('0x45'),_0x85db('0x46'),JSON[_0x85db('0x47')](_0x240325)));};}function getSeconds(_0x281a7e,_0x158ac8){var _0x27b218=moment(_0x281a7e)[_0x85db('0x48')](0x0);var _0x365f2d=moment(_0x158ac8)['milliseconds'](0x0);return _0x27b218[_0x85db('0x49')](_0x365f2d,_0x85db('0x4a'));}function emit(_0x254167,_0x11f00f,_0x57a77a){io['to'](_0x254167)[_0x85db('0x4b')](_0x11f00f,_0x57a77a);}function emitVoiceQueueSummary(_0x31d169){if(_0x31d169[_0x85db('0x4c')]===_0x85db('0x4d')){var _0x5a759d={'id':_0x31d169['id'],'name':_0x31d169['name'],'strategy':_0x31d169['strategy'],'answered':_0x31d169['answered'],'available':_0x31d169['available'],'loggedIn':_0x31d169[_0x85db('0x4e')],'pTalking':_0x31d169[_0x85db('0x4f')],'sumBillable':_0x31d169[_0x85db('0x50')],'sumDuration':_0x31d169[_0x85db('0x51')],'sumHoldTime':_0x31d169[_0x85db('0x52')]||0x0,'talking':_0x31d169['talking'],'total':_0x31d169['total'],'type':_0x31d169[_0x85db('0x4c')],'unmanaged':_0x31d169['unmanaged'],'abandoned':_0x31d169[_0x85db('0x53')],'waiting':_0x31d169[_0x85db('0x54')],'loggedInDb':_0x31d169['loggedInDb'],'dialActive':_0x31d169['dialActive'],'dialMethod':_0x31d169[_0x85db('0x55')],'dialOriginateCallerIdName':_0x31d169[_0x85db('0x56')],'dialOriginateCallerIdNumber':_0x31d169[_0x85db('0x57')],'dialOriginateTimeout':_0x31d169[_0x85db('0x58')],'dialPrefix':_0x31d169[_0x85db('0x59')],'outboundAnswerAgiCallsDay':_0x31d169['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x31d169[_0x85db('0x5a')],'outboundBlacklistCallsDay':_0x31d169[_0x85db('0x5b')],'outboundBusyCallsDay':_0x31d169[_0x85db('0x5c')],'outboundCongestionCallsDay':_0x31d169['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x31d169['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x31d169['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x31d169[_0x85db('0x5d')],'outboundNoAnswerCallsDay':_0x31d169[_0x85db('0x5e')],'outboundNoSuchCallsDay':_0x31d169[_0x85db('0x5f')],'outboundOriginateFailureCallsDay':_0x31d169['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x31d169['outboundReCallsDay'],'outboundRejectCallsDay':_0x31d169[_0x85db('0x60')],'outboundUnknownCallsDay':_0x31d169['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x31d169[_0x85db('0x61')],'predictiveIntervalAvgHoldtime':_0x31d169[_0x85db('0x62')],'predictiveIntervalAvgTalktime':_0x31d169[_0x85db('0x63')],'predictiveIntervalDroppedCallsCallersExit':_0x31d169['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x31d169[_0x85db('0x64')],'predictiveIntervalErlangCalls':_0x31d169[_0x85db('0x65')],'predictiveIntervalErlangCallsDroppedCalls':_0x31d169[_0x85db('0x66')],'predictiveIntervalHitRate':_0x31d169[_0x85db('0x67')],'predictiveIntervalMultiplicativeFactor':_0x31d169[_0x85db('0x68')],'predictiveIntervalPauses':_0x31d169[_0x85db('0x69')],'predictiveIntervalAvailable':_0x31d169[_0x85db('0x6a')],'predictiveIntervalTotalCalls':_0x31d169[_0x85db('0x6b')],'message':_0x31d169[_0x85db('0x3d')],'originated':_0x31d169['originated'],'erlangCalls':_0x31d169[_0x85db('0x6c')],'erlangCallToSecond':_0x31d169[_0x85db('0x6d')],'erlangAbandonmentRate':_0x31d169[_0x85db('0x6e')],'erlangBusyFactor':_0x31d169[_0x85db('0x6f')],'startPredictive':_0x31d169[_0x85db('0x26')],'startProgressive':_0x31d169[_0x85db('0x27')]};if(_0x31d169['Trunk']){_0x5a759d[_0x85db('0x70')]={'id':_0x31d169[_0x85db('0x70')]['id'],'name':_0x31d169[_0x85db('0x70')]['name'],'active':_0x31d169['Trunk'][_0x85db('0x71')],'callerid':_0x31d169['Trunk'][_0x85db('0x72')]};}if(_0x31d169[_0x85db('0x40')]){_0x5a759d[_0x85db('0x40')]={'id':_0x31d169[_0x85db('0x40')]['id'],'name':_0x31d169[_0x85db('0x40')]['name']};}var _0x5d44ef=md5(JSON[_0x85db('0x47')](_0x5a759d));if(_0x31d169[_0x85db('0x4')]!==_0x5d44ef){_0x31d169[_0x85db('0x4')]=_0x5d44ef;emit(util[_0x85db('0x73')](_0x85db('0x74'),_0x5a759d[_0x85db('0x3c')]),_0x85db('0x75'),_0x5a759d);}}}function emitCampaignSummary(_0x114509){if(_0x114509[_0x85db('0x4c')]===_0x85db('0x76')){emit(util['format'](_0x85db('0x77'),_0x114509[_0x85db('0x3c')]),'campaign:save',_0x114509);}}function checkGetDataPredictive(_0x5a175b){if(isNotNull(_0x5a175b)&&!_[_0x85db('0x44')](_0x5a175b)){loggerPredictive[_0x85db('0x78')]('-----\x20Stats\x20Predictive\x20---');loggerPredictive['info'](_0x85db('0x79'),_0x5a175b[_0x85db('0x6b')]);loggerPredictive['info'](_0x85db('0x7a'),_0x5a175b[_0x85db('0x61')]);loggerPredictive[_0x85db('0x78')](_0x85db('0x7b'),_0x5a175b[_0x85db('0x64')]);loggerPredictive[_0x85db('0x78')](_0x85db('0x7c'),_0x5a175b[_0x85db('0x7d')]);loggerPredictive[_0x85db('0x78')](_0x85db('0x7e'),_0x5a175b['predictiveIntervalAvgHoldtime']);loggerPredictive['info'](_0x85db('0x7f'),_0x5a175b[_0x85db('0x63')]);loggerPredictive[_0x85db('0x78')](_0x85db('0x80'));if(_0x5a175b[_0x85db('0x6b')]>0x0){if(!_[_0x85db('0x3b')](_0x5a175b[_0x85db('0x63')])&&_0x5a175b[_0x85db('0x63')]>0x0){return!![];}loggerPredictive[_0x85db('0x78')](_0x85db('0x81'));if(!_[_0x85db('0x3b')](_0x5a175b[_0x85db('0x62')])&&_0x5a175b[_0x85db('0x62')]>0x0){return!![];}loggerPredictive[_0x85db('0x78')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x85db('0x78')](_0x85db('0x82'));}}else{loggerPredictive['info'](_0x85db('0x83'));}return![];}function mergeDataErlangB(_0x40a009){return function(_0x88cfa6){loggerPredictive[_0x85db('0x78')](_0x85db('0x84'));loggerPredictive[_0x85db('0x78')](_0x85db('0x85'),_0x88cfa6['erlangCalls']);loggerPredictive[_0x85db('0x78')](_0x85db('0x86'),_0x88cfa6['erlangCallToSecond']);loggerPredictive['info'](_0x85db('0x87'),_0x88cfa6['erlangAbandonmentRate']);loggerPredictive[_0x85db('0x78')](_0x85db('0x88'),_0x88cfa6[_0x85db('0x6f')]);loggerPredictive[_0x85db('0x78')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x88cfa6[_0x85db('0x6e')]);loggerPredictive['info']('---------------------------');_['merge'](_0x40a009,_0x88cfa6);};}function getDiff(_0x367e3e){var _0x310b42=moment()['milliseconds'](0x0);var _0x2b4dcb=moment(_0x367e3e)[_0x85db('0x48')](0x0);return _0x310b42['diff'](_0x2b4dcb,_0x85db('0x4a'));}function ifInterval(_0x20e15f,_0x5d71aa){if(_[_0x85db('0x3b')](_0x5d71aa)){return![];}return getDiff(_0x5d71aa)<_0x20e15f*0x3c;}function freeVariablesPredictive(_0x42eddd){if(isNotNull(_0x42eddd)){if(!_[_0x85db('0x3b')](_0x42eddd['startProgressive'])){_0x42eddd[_0x85db('0x27')]=undefined;loggerPredictive[_0x85db('0x78')](_0x42eddd[_0x85db('0x3c')],_0x85db('0x89'));}if(!_[_0x85db('0x3b')](_0x42eddd[_0x85db('0x26')])){_0x42eddd[_0x85db('0x26')]=undefined;loggerPredictive[_0x85db('0x78')](_0x42eddd['name'],'clearing\x20variable\x20start\x20predictive');}if(!_['isUndefined'](_0x42eddd['handlePredictive'])){clearInterval(_0x42eddd[_0x85db('0x8a')]);_0x42eddd[_0x85db('0x8a')]=undefined;loggerPredictive[_0x85db('0x78')](_0x42eddd[_0x85db('0x3c')],_0x85db('0x8b'));}}}function erlangb(_0x2f7148,_0x5636fa){if(_0x5636fa===0x0){return 0x0;}var _0x367ebe=0x1;for(var _0x6e3240=0x1;_0x6e3240<=_0x5636fa;_0x6e3240+=0x1){_0x367ebe=0x1+_0x367ebe*_0x6e3240/_0x2f7148;}return 0x1/_0x367ebe;}function isVoiceQueueOutbound(_0x11bc25){return _0x11bc25===_0x85db('0x4d');}function isNotPreview(_0x560784){return _0x560784!==_0x85db('0x1c');}function isCampaignIvr(_0x3dc6f0){return _0x3dc6f0===_0x85db('0x76');}function getCallerId(_0x1aa93a,_0x4d042c,_0x2a7f1e){if(!_[_0x85db('0x3b')](_0x2a7f1e)&&typeof _0x2a7f1e===_0x85db('0x8c')&&!_[_0x85db('0x44')](_0x2a7f1e)){if(!_[_0x85db('0x3b')](_0x4d042c)&&typeof _0x4d042c==='string'&&!_[_0x85db('0x44')](_0x4d042c)){return util[_0x85db('0x73')](_0x85db('0x8d'),_0x4d042c,_0x2a7f1e);}return util[_0x85db('0x73')](_0x85db('0x8d'),_0x2a7f1e,_0x2a7f1e);}if(!_['isUndefined'](_0x1aa93a)&&typeof _0x1aa93a===_0x85db('0x8c')&&!_[_0x85db('0x44')](_0x1aa93a)){return _0x1aa93a;}return _0x85db('0x8e');}function loggerCatchQueueSummary(_0x1da7ed,_0x20c059){return function(_0x51ff84){freeVariablesPredictive(_0x20c059);emitVoiceQueueSummary(_0x20c059);emitCampaignSummary(_0x20c059);loggerSyncQueueSummary[_0x85db('0x8f')](_0x1da7ed,util[_0x85db('0x90')](_0x51ff84,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x176e51,_0x58ff0f){return function(_0xee1099){loggerPredictive[_0x85db('0x8f')](_0x58ff0f[_0x85db('0x3c')],_0x176e51);loggerPredictive['error'](_0xee1099[_0x85db('0x91')]);freeVariablesPredictive(_0x58ff0f);};}function loggerCatch(_0xc840a){return function(_0x5b516d){logger[_0x85db('0x8f')](_0xc840a,util[_0x85db('0x90')](_0x5b516d,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x1b1c1b){return _0x1b1c1b&&!_[_0x85db('0x3b')](_0x1b1c1b)&&_0x1b1c1b[_0x85db('0x92')]>0x0;}function decremetOriginate(_0xb391ff){if(!_[_0x85db('0x3b')](_0xb391ff)&&_0xb391ff!==null){if(typeof _0xb391ff[_0x85db('0x93')]!==_0x85db('0x94')){if(_0xb391ff[_0x85db('0x93')]>0x0){_0xb391ff[_0x85db('0x93')]-=0x1;}else{logger[_0x85db('0x8f')](_0x85db('0x95'));}}}else{logger[_0x85db('0x8f')](_0x85db('0x96'));}}function checkContactLowerLimitOriginate(_0x4da42e,_0x420831,_0x2f7f7a){if(_0x420831>_0x2f7f7a){for(var _0x1c48ac=0x0;_0x1c48ac<_0x420831-_0x2f7f7a;_0x1c48ac+=0x1){decremetOriginate(_0x4da42e);}}}function loggerGetContactDialer(_0x24fec7,_0x4edff1,_0x4e6cc8){return function(_0x21bfe8){checkContactLowerLimitOriginate(_0x4edff1,_0x4e6cc8,0x0);logger['error'](_0x24fec7,util[_0x85db('0x90')](_0x21bfe8,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x45cfd2){return function(_0x3fc37e){if(isNotNull(_0x3fc37e)&&isNotNull(_0x3fc37e[0x0])){if(_0x3fc37e[0x0]['contactsRescheduled']>0x0){_0x45cfd2[_0x85db('0x3d')]=_0x85db('0x97');logger[_0x85db('0x78')](_0x85db('0x98')+_0x45cfd2['name'],_0x3fc37e[0x0][_0x85db('0x99')],'contacts');}else{_0x45cfd2[_0x85db('0x3d')]=_0x85db('0x9a');logger[_0x85db('0x78')](_0x85db('0x9b')+_0x45cfd2[_0x85db('0x3c')]);}}};}function notSendMessagesQueue(_0x40e97e){if(_0x40e97e[_0x85db('0x9c')]){freeVariablesPredictive(_0x40e97e);if(_0x40e97e[_0x85db('0x93')]===0x0&&_0x40e97e[_0x85db('0x9d')]===0x0&&_0x40e97e[_0x85db('0x54')]===0x0&&(_0x40e97e[_0x85db('0x4f')]||0x0)===0x0){_0x40e97e[_0x85db('0x9c')]=![];_0x40e97e[_0x85db('0x9e')]=0x0;_0x40e97e['message']=_0x85db('0x3e');loggerSyncQueueSummary['error'](_0x85db('0x9f'),_0x40e97e[_0x85db('0x3c')],'is\x20not\x20active');}else{_0x40e97e[_0x85db('0x3d')]=_0x85db('0xa0');loggerSyncQueueSummary[_0x85db('0x8f')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x40e97e[_0x85db('0x3c')],'is\x20disactive');}emitVoiceQueueSummary(_0x40e97e);}}function notSendMessagesCampaign(_0xa2d663){if(_0xa2d663['sendMessageOneNotActive']){if(_0xa2d663[_0x85db('0x93')]===0x0){_0xa2d663[_0x85db('0x9c')]=![];_0xa2d663['message']=_0x85db('0x3e');loggerSyncQueueSummary[_0x85db('0x8f')](_0x85db('0xa1'),_0xa2d663[_0x85db('0x3c')],_0x85db('0xa2'));}else{_0xa2d663[_0x85db('0x3d')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x85db('0x8f')](_0x85db('0xa1'),_0xa2d663[_0x85db('0x3c')],'is\x20disactive');}emitCampaignSummary(_0xa2d663);}}function createObjHistory(_0x3c92b3,_0x2c6f48,_0x388fa4,_0x294d7b,_0x22183f){_0x3c92b3[_0x85db('0x3d')]=_0x388fa4;var _0x13fd5=new Action(_0x3c92b3,_0x2c6f48);var _0x308537=new History(_0x13fd5);_0x308537[_0x85db('0xa3')]=_0x294d7b;_0x308537[_0x85db('0xa4')]=_0x22183f;_0x308537[_0x85db('0xa5')]=_0x13fd5['starttime'];return _0x308537;}Dialer[_0x85db('0x18')][_0x85db('0x3a')]=function(){var _0xdcb072=this;setInterval(function(){_0xdcb072['clearZombieChannels'](_0xdcb072[_0x85db('0x25')],'[uniqueid]');_0xdcb072[_0x85db('0xa6')](_0xdcb072['actions'],_0x85db('0xa7'));},0x32c8);};Dialer['prototype'][_0x85db('0xa6')]=function(_0x5c6028,_0x28741a){var _0x3ca9e7=this;for(var _0x4d268a in _0x5c6028){if(typeof _0x5c6028[_0x4d268a]!==_0x85db('0x94')){this['sequence']['enqueue'](function(){if(!_[_0x85db('0xa8')](_0x5c6028[_0x4d268a])){return ami[_0x85db('0xa9')]({'action':_0x85db('0xaa'),'channel':_0x5c6028[_0x4d268a][_0x85db('0xab')]})[_0x85db('0xac')](function(_0x2aa231){if(_0x2aa231['message']===_0x85db('0xad')){setTimeout(function(){if(_0x5c6028[_0x4d268a]&&_0x5c6028[_0x4d268a][_0x85db('0x4c')]!==_0x85db('0x76')){_0x3ca9e7[_0x85db('0xae')](_0x3ca9e7[_0x85db('0x1d')][_0x5c6028[_0x4d268a]['queue']]);logger[_0x85db('0x8f')]('[Dialer][checkChannel]',_0x28741a,_0x4d268a,_0x5c6028[_0x4d268a][_0x85db('0xaf')]);delete _0x5c6028[_0x4d268a];}if(_0x5c6028[_0x4d268a]&&_0x5c6028[_0x4d268a][_0x85db('0x4c')]===_0x85db('0x76')){_0x3ca9e7['updateOriginated'](_0x3ca9e7['campaigns'][_0x5c6028[_0x4d268a][_0x85db('0xaf')]]);logger['error']('[Dialer][checkChannel][ivr]',_0x28741a,_0x4d268a,_0x5c6028[_0x4d268a]['queue']);delete _0x5c6028[_0x4d268a];}},0x2328);}});}});}}};Dialer[_0x85db('0x18')][_0x85db('0xb0')]=function(_0x1eec46){return BPromise[_0x85db('0xb1')]()[_0x85db('0xb2')](cmHopper[_0x85db('0xb0')](_0x1eec46))[_0x85db('0xac')](loggerCatch('[countReScheduled]\x20'));};Dialer[_0x85db('0x18')][_0x85db('0xb3')]=function(_0x43d786){return BPromise[_0x85db('0xb1')]()[_0x85db('0xb2')](cmHopperBlack[_0x85db('0xb3')](_0x43d786))['catch'](loggerCatch(_0x85db('0xb4')));};Dialer['prototype']['checkIsBlackListIvr']=function(_0x15c530){return BPromise[_0x85db('0xb1')]()[_0x85db('0xb2')](cmHopperBlack[_0x85db('0xb5')](_0x15c530))[_0x85db('0xac')](loggerCatch(_0x85db('0xb6')));};Dialer[_0x85db('0x18')][_0x85db('0xb7')]=function(_0x5e56e8){return BPromise[_0x85db('0xb1')]()[_0x85db('0xb2')](cmHopperHistory[_0x85db('0xb8')](_0x5e56e8))[_0x85db('0xac')](loggerCatch(_0x85db('0xb9')));};Dialer['prototype'][_0x85db('0xba')]=function(_0x392253){return BPromise[_0x85db('0xb1')]()[_0x85db('0xb2')](cmHopper[_0x85db('0xba')](_0x392253))['catch'](loggerCatch(_0x85db('0xbb')));};Dialer[_0x85db('0x18')]['unlockContact']=function(_0x416f42,_0x283fba,_0x63f52a){return BPromise[_0x85db('0xb1')]()['then'](cmHopper[_0x85db('0xbc')](_0x416f42,_0x283fba,_0x63f52a))['catch'](loggerCatch(_0x85db('0xbd')));};Dialer[_0x85db('0x18')][_0x85db('0xbe')]=function(_0x4acecc,_0xb40a10,_0x117521,_0x41fd89,_0x159d0e){return BPromise['resolve']()[_0x85db('0xb2')](cmHopper['getContactDialer'](_0x4acecc,_0xb40a10,_0x117521,_0x41fd89))[_0x85db('0xac')](function(_0xec5d61){_0x159d0e['temp']-=_0x117521;_0x159d0e['temp']=_0x159d0e[_0x85db('0xbf')]>0x0?_0x159d0e['temp']:0x0;loggerCatch(_0x85db('0xc0'))(_0xec5d61);});};Dialer[_0x85db('0x18')]['getContactDialerIvr']=function(_0x2828bc,_0x104809,_0xe6ec04,_0x593907){return BPromise['resolve']()['then'](cmHopper[_0x85db('0xc1')](_0x2828bc,_0x104809,_0xe6ec04))[_0x85db('0xac')](function(_0x2e44bd){_0x593907[_0x85db('0xbf')]-=_0x104809;_0x593907[_0x85db('0xbf')]=_0x593907[_0x85db('0xbf')]>0x0?_0x593907[_0x85db('0xbf')]:0x0;loggerCatch(_0x85db('0xc2'))(_0x2e44bd);});};Dialer[_0x85db('0x18')][_0x85db('0xc3')]=function(_0x5884d1){return BPromise[_0x85db('0xb1')]()[_0x85db('0xb2')](voiceQueueRt[_0x85db('0xc3')](_0x5884d1))[_0x85db('0xac')](loggerCatch(_0x85db('0xc4')));};Dialer[_0x85db('0x18')][_0x85db('0xc5')]=function(_0x13aeed){return BPromise['resolve']()[_0x85db('0xb2')](cmHopper[_0x85db('0xc5')](_0x13aeed))[_0x85db('0xac')](loggerCatch(_0x85db('0xc6')));};Dialer[_0x85db('0x18')][_0x85db('0xc7')]=function(_0x4ae8c4){return BPromise[_0x85db('0xb1')]()[_0x85db('0xb2')](cmHopperHistory['createHistory'](_0x4ae8c4))['catch'](loggerCatch(_0x85db('0xc8')));};Dialer[_0x85db('0x18')][_0x85db('0xae')]=function(_0x4f9d67){if(!_[_0x85db('0x3b')](_0x4f9d67)&&_0x4f9d67!==null){if(typeof _0x4f9d67['originated']!==_0x85db('0x94')){if(_0x4f9d67['originated']>0x0){_0x4f9d67[_0x85db('0x93')]-=0x1;}else{logger[_0x85db('0x8f')](_0x85db('0xc9'));}}}else{logger[_0x85db('0x8f')](_0x85db('0xca'));}};Dialer[_0x85db('0x18')][_0x85db('0xcb')]=function(_0x1b2695,_0x20883a){var _0x528b48=this;return function(_0xac6512){_0x528b48[_0x85db('0xae')](_0x20883a);logger[_0x85db('0x8f')](_0x1b2695,util['inspect'](_0xac6512,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x85db('0xcc')]=function(_0x3c8346,_0x106542,_0x872bc3){var _0x1aef96={'state':0x19,'statedesc':'notFound'};this[_0x85db('0xae')](_0x106542);this[_0x85db('0xcd')](_['merge'](_0x1aef96,_[_0x85db('0xce')](_0x872bc3,[_0x85db('0xcf'),_0x85db('0xd0'),_0x85db('0xd1'),_0x85db('0xd2'),_0x85db('0xd3')])),'[emptyContact][createHistory]','[emptyContact]');logger[_0x85db('0x8f')](_0x3c8346);};Dialer[_0x85db('0x18')][_0x85db('0xd4')]=function(_0x417c8a){return _0x417c8a===_0x85db('0xd5');};Dialer[_0x85db('0x18')][_0x85db('0xd6')]=function(_0x410b77){return!_['isUndefined'](_0x410b77)&&_0x410b77&&!_[_0x85db('0x3b')](_0x410b77['name'])&&!_['isUndefined'](_0x410b77['active'])&&_0x410b77['active']&&(this[_0x85db('0x20')][util[_0x85db('0x73')](_0x85db('0xd7'),_0x410b77['name'])]['status']===_0x85db('0xd8')||this[_0x85db('0x20')][util[_0x85db('0x73')]('SIP/%s',_0x410b77[_0x85db('0x3c')])][_0x85db('0xaa')]===_0x85db('0xd9'));};Dialer[_0x85db('0x18')]['saveInDb']=function(_0x4423f1,_0x31887a,_0x5ba1f9){this[_0x85db('0xc7')](_0x4423f1)[_0x85db('0xac')](loggerCatch(_0x31887a));this[_0x85db('0xc5')](_0x4423f1)[_0x85db('0xac')](loggerCatch(_0x5ba1f9));};Dialer['prototype'][_0x85db('0x36')]=function(_0x19dffb){var _0x43d419=this[_0x85db('0x25')][_0x19dffb['uniqueid']];var _0x5528e6;if(!_['isNil'](_0x19dffb)&&!_[_0x85db('0xa8')](_0x19dffb[_0x85db('0xda')])&&!_[_0x85db('0xa8')](_0x19dffb[_0x85db('0xda')][_0x85db('0xdb')])&&_0x19dffb[_0x85db('0xdc')]===_0x85db('0xdd')&&_0x43d419){if(_0x43d419[_0x85db('0x4c')]!==_0x85db('0x76')&&this['voiceQueues'][_0x43d419[_0x85db('0xaf')]]['dialAMDActive']&&_0x19dffb[_0x85db('0xde')]===_0x85db('0xdf')){delete this[_0x85db('0x25')][_0x19dffb[_0x85db('0xe0')]];this[_0x85db('0xae')](this[_0x85db('0x1d')][_0x43d419[_0x85db('0xaf')]]);this[_0x85db('0x1d')][_0x43d419[_0x85db('0xaf')]][_0x85db('0x5a')]+=0x1;this[_0x85db('0x1d')][_0x43d419['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x5528e6=new Hangup(_0x43d419,_0x19dffb);_0x5528e6[_0x85db('0xa3')]=0x12;_0x5528e6[_0x85db('0xa4')]=_0x85db('0xe1');_0x5528e6['membername']=_0x85db('0xe2');ami[_0x85db('0x4b')](_0x85db('0xe3'),ut[_0x85db('0xe4')](_0x5528e6,_0x85db('0xe5')));this[_0x85db('0xcd')](_0x5528e6,_0x85db('0xe6'),_0x85db('0xe7'));}if(_0x43d419[_0x85db('0x4c')]!=='ivr'&&this[_0x85db('0x1d')][_0x43d419[_0x85db('0xaf')]][_0x85db('0xe8')]&&_0x19dffb[_0x85db('0xde')]===_0x85db('0xe9')){var _0x170ab4=this;return new BPromise(function(_0xb3eac6,_0x584448){delete _0x170ab4[_0x85db('0x25')][_0x19dffb[_0x85db('0xe0')]];_0x170ab4[_0x85db('0xae')](_0x170ab4[_0x85db('0x1d')][_0x43d419['queue']]);_0x170ab4[_0x85db('0x1d')][_0x43d419[_0x85db('0xaf')]][_0x85db('0x5a')]+=0x1;_0x170ab4[_0x85db('0x1d')][_0x43d419[_0x85db('0xaf')]][_0x85db('0xea')]+=0x1;var _0x45b430=_0x170ab4[_0x85db('0x1d')][_0x43d419[_0x85db('0xaf')]];var _0x43ef4d=new Hangup(_0x43d419,_0x19dffb);_0x43ef4d['state']=0x13;_0x43ef4d[_0x85db('0xa4')]=_0x85db('0xeb');_0x43ef4d['membername']=_0x85db('0xe2');_0x43ef4d[_0x85db('0xec')]+=0x1;_0x43ef4d[_0x85db('0xed')]+=0x1;_0x43ef4d[_0x85db('0xe5')]=!![];ami[_0x85db('0x4b')](_0x85db('0xe3'),ut[_0x85db('0xe4')](_0x43ef4d,_0x85db('0xe5')));_0x170ab4['createHistory'](_0x43ef4d)[_0x85db('0xac')](loggerCatch(_0x85db('0xee')));if(_0x43ef4d['countbusyretry']+_0x43ef4d[_0x85db('0xef')]+_0x43ef4d['countnoanswerretry']+_0x43ef4d['countnosuchnumberretry']+_0x43ef4d[_0x85db('0xf0')]+_0x43ef4d[_0x85db('0xf1')]+_0x43ef4d[_0x85db('0xec')]+_0x43ef4d[_0x85db('0xf2')]>=_0x45b430[_0x85db('0xf3')]){_0x170ab4[_0x85db('0xf4')](_0x43ef4d,_0xb3eac6,_0x584448,_0x85db('0xf5'));}else{if(_0x43ef4d['countmachineretry']>=_0x45b430[_0x85db('0xf6')]){_0x170ab4['createStateFinal'](_0x43ef4d,_0xb3eac6,_0x584448,_0x85db('0xf7'));}else{_0x170ab4[_0x85db('0xba')]({'active':![],'countmachineretry':_0x43ef4d[_0x85db('0xec')],'scheduledat':moment()[_0x85db('0xf8')](_0x45b430[_0x85db('0xf9')],'minutes')[_0x85db('0x73')](_0x85db('0xfa')),'ContactId':_0x43ef4d['ContactId'],'ListId':_0x43ef4d[_0x85db('0xd0')],'VoiceQueueId':_0x43ef4d['VoiceQueueId']||undefined,'CampaignId':_0x43ef4d['CampaignId']||undefined})[_0x85db('0xac')](loggerCatch(_0x85db('0xfb')));_0xb3eac6({'reschedule':0x1});}}});}if(_0x43d419['type']===_0x85db('0x76')&&this[_0x85db('0x1e')][_0x43d419[_0x85db('0xaf')]]['dialAMDActive']&&_0x19dffb[_0x85db('0xde')]===_0x85db('0xdf')){delete this[_0x85db('0x25')][_0x19dffb['uniqueid']];this[_0x85db('0xae')](this[_0x85db('0x1e')][_0x43d419[_0x85db('0xaf')]]);_0x5528e6=new Hangup(_0x43d419,_0x19dffb);_0x5528e6[_0x85db('0xa3')]=0x12;_0x5528e6[_0x85db('0xa4')]=_0x85db('0xe1');_0x5528e6[_0x85db('0xfc')]=_0x85db('0xe2');ami[_0x85db('0x4b')](_0x85db('0xe3'),ut[_0x85db('0xe4')](_0x5528e6,'amd'));this[_0x85db('0xcd')](_0x5528e6,'[syncHangupInAMDIvr][createHistory]',_0x85db('0xfd'));}if(_0x43d419['type']===_0x85db('0x76')&&this[_0x85db('0x1e')][_0x43d419[_0x85db('0xaf')]][_0x85db('0xe8')]&&_0x19dffb[_0x85db('0xde')]===_0x85db('0xe9')){var _0x170ab4=this;return new BPromise(function(_0x1c8b7b,_0x5cf9f4){delete _0x170ab4[_0x85db('0x25')][_0x19dffb['uniqueid']];_0x170ab4[_0x85db('0xae')](_0x170ab4['campaigns'][_0x43d419[_0x85db('0xaf')]]);_0x170ab4['campaigns'][_0x43d419[_0x85db('0xaf')]][_0x85db('0x5a')]+=0x1;_0x170ab4[_0x85db('0x1e')][_0x43d419[_0x85db('0xaf')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x2aeae6=_0x170ab4[_0x85db('0x1e')][_0x43d419[_0x85db('0xaf')]];var _0x26c5e5=new Hangup(_0x43d419,_0x19dffb);_0x26c5e5['state']=0x13;_0x26c5e5[_0x85db('0xa4')]=_0x85db('0xeb');_0x26c5e5[_0x85db('0xfc')]=_0x85db('0xe2');_0x26c5e5[_0x85db('0xec')]+=0x1;_0x26c5e5[_0x85db('0xed')]+=0x1;_0x26c5e5[_0x85db('0xe5')]=!![];ami[_0x85db('0x4b')]('custom:amd',ut[_0x85db('0xe4')](_0x26c5e5,'amd'));_0x170ab4[_0x85db('0xc7')](_0x26c5e5)[_0x85db('0xac')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x26c5e5[_0x85db('0xfe')]+_0x26c5e5[_0x85db('0xef')]+_0x26c5e5[_0x85db('0xff')]+_0x26c5e5[_0x85db('0x100')]+_0x26c5e5[_0x85db('0xf0')]+_0x26c5e5['countabandonedretry']+_0x26c5e5[_0x85db('0xec')]+_0x26c5e5[_0x85db('0xf2')]>=_0x2aeae6['dialGlobalMaxRetry']){_0x170ab4[_0x85db('0xf4')](_0x26c5e5,_0x1c8b7b,_0x5cf9f4,_0x85db('0xf5'));}else{if(_0x26c5e5[_0x85db('0xec')]>=_0x2aeae6[_0x85db('0xf6')]){_0x170ab4[_0x85db('0x101')](_0x26c5e5,_0x1c8b7b,_0x5cf9f4,_0x85db('0xf7'));}else{_0x170ab4[_0x85db('0xba')]({'active':![],'countmachineretry':_0x26c5e5[_0x85db('0xec')],'scheduledat':moment()[_0x85db('0xf8')](_0x2aeae6[_0x85db('0xf9')],_0x85db('0x102'))[_0x85db('0x73')](_0x85db('0xfa')),'ContactId':_0x26c5e5[_0x85db('0xcf')],'ListId':_0x26c5e5[_0x85db('0xd0')],'VoiceQueueId':_0x26c5e5[_0x85db('0xd2')]||undefined,'CampaignId':_0x26c5e5[_0x85db('0xd3')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x1c8b7b({'reschedule':0x1});}}});}}};Dialer[_0x85db('0x18')][_0x85db('0x103')]=function(_0x5a7714){var _0xdfda89=this[_0x85db('0x25')][_0x5a7714['uniqueid']];var _0x157942=this;var _0x1b3249;if(_0xdfda89&&_0xdfda89['type']==='ivr'){delete this[_0x85db('0x25')][_0x5a7714[_0x85db('0xe0')]];this['updateOriginated'](this['campaigns'][_0xdfda89[_0x85db('0xaf')]]);this[_0x85db('0x1e')][_0xdfda89[_0x85db('0xaf')]][_0x85db('0x104')]+=0x1;_0x1b3249=new Hangup(_0xdfda89,_0x5a7714);this[_0x85db('0xc7')](_0x1b3249)[_0x85db('0xac')](loggerCatch(_0x85db('0x105')));this[_0x85db('0xc5')](_0x1b3249)[_0x85db('0xac')](loggerCatch(_0x85db('0x106')));}if(_0xdfda89&&_0xdfda89[_0x85db('0x4c')]!==_0x85db('0x76')&&isNotNull(this['voiceQueues'][_0xdfda89['queue']]['dialQueueProject'])){delete this['uniqueId'][_0x5a7714[_0x85db('0xe0')]];this[_0x85db('0xae')](this[_0x85db('0x1d')][_0xdfda89[_0x85db('0xaf')]]);this[_0x85db('0x1d')][_0xdfda89[_0x85db('0xaf')]][_0x85db('0x5a')]+=0x1;this[_0x85db('0x1d')][_0xdfda89[_0x85db('0xaf')]][_0x85db('0xea')]+=0x1;_0x1b3249=new Hangup(_0xdfda89,_0x5a7714);_0x1b3249[_0x85db('0xa3')]=0x10;_0x1b3249[_0x85db('0xa4')]='AnswerAGI';_0x1b3249['membername']=_0x85db('0x107');this['createHistory'](_0x1b3249)[_0x85db('0xac')](loggerCatch(_0x85db('0x105')));this['moveContactManagedDialer'](_0x1b3249)['catch'](loggerCatch(_0x85db('0x106')));}if(_0xdfda89&&_0xdfda89['type']!==_0x85db('0x76')&&!isNotNull(this[_0x85db('0x1d')][_0xdfda89['queue']][_0x85db('0x108')])){delete this['uniqueId'][_0x5a7714[_0x85db('0xe0')]];this[_0x85db('0xae')](this['voiceQueues'][_0xdfda89[_0x85db('0xaf')]]);this[_0x85db('0x1d')][_0xdfda89[_0x85db('0xaf')]][_0x85db('0x109')]+=0x1;_0x1b3249=new Hangup(_0xdfda89,_0x5a7714);_0x1b3249[_0x85db('0xa3')]=0xc;_0x1b3249['statedesc']=_0x5a7714['cause-txt'];_0x1b3249[_0x85db('0xfc')]='Unknow';this[_0x85db('0xc7')](_0x1b3249)[_0x85db('0xac')](loggerCatch(_0x85db('0x105')));this[_0x85db('0xc5')](_0x1b3249)[_0x85db('0xac')](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype'][_0x85db('0x10a')]=function(_0x2bafcc){var _0x9b1dda=this[_0x85db('0x25')][_0x2bafcc['uniqueid']];var _0x3e6a48=this;if(this[_0x85db('0x1d')][_0x2bafcc[_0x85db('0xaf')]]){if(_0x9b1dda&&_0x9b1dda[_0x85db('0x4c')]!==_0x85db('0x76')){delete this[_0x85db('0x25')][_0x2bafcc[_0x85db('0xe0')]];this[_0x85db('0x1d')][_0x2bafcc[_0x85db('0xaf')]][_0x85db('0x5a')]+=0x1;var _0x48d30c=new AgentComplete(_0x9b1dda,_0x2bafcc);if(_0x2bafcc['reason']===_0x85db('0x10b')){_0x48d30c[_0x85db('0x10c')]=this[_0x85db('0x1d')][_0x2bafcc[_0x85db('0xaf')]][_0x85db('0x10d')]&&this[_0x85db('0x1d')][_0x2bafcc[_0x85db('0xaf')]][_0x85db('0x10e')]?moment()[_0x85db('0x73')](_0x85db('0xfa')):undefined;}this[_0x85db('0xc7')](_0x48d30c)['catch'](loggerCatch(_0x85db('0x10f')));this[_0x85db('0xc5')](_0x48d30c)[_0x85db('0xac')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x85db('0x18')][_0x85db('0x2c')]=function(_0x320726){if(this[_0x85db('0x1d')][_0x320726['queue']]){if(this['uniqueId'][_0x320726[_0x85db('0xe0')]]&&this[_0x85db('0x25')][_0x320726['uniqueid']][_0x85db('0x4c')]!==_0x85db('0x76')){this[_0x85db('0xae')](this[_0x85db('0x1d')][_0x320726['queue']]);this[_0x85db('0x25')][_0x320726[_0x85db('0xe0')]][_0x85db('0x110')]=moment()[_0x85db('0x73')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0x85db('0x18')][_0x85db('0x111')]=function(_0x34d8fb){this[_0x85db('0xc7')](_0x34d8fb)[_0x85db('0xac')](loggerCatch(_0x85db('0x10f')));this[_0x85db('0xc5')](_0x34d8fb)['catch'](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer[_0x85db('0x18')]['syncQueueCallerAbandon']=function(_0x1a4f7c){var _0x391556=this[_0x85db('0x25')][_0x1a4f7c[_0x85db('0xe0')]];var _0x436173=this;if(this['voiceQueues'][_0x1a4f7c[_0x85db('0xaf')]]){if(_0x391556&&_0x391556[_0x85db('0x4c')]!=='ivr'){delete this[_0x85db('0x25')][_0x1a4f7c[_0x85db('0xe0')]];this[_0x85db('0xae')](this[_0x85db('0x1d')][_0x1a4f7c[_0x85db('0xaf')]]);_0x391556['droptime']=moment()[_0x85db('0x73')]('YYYY-MM-DD\x20HH:mm:ss');var _0x20020b=new QueueCallerAbandon(_0x391556,_0x1a4f7c);if(getSeconds(_0x391556[_0x85db('0x112')],_0x391556[_0x85db('0x113')])>=_0x391556['dialQueueTimeout']){this[_0x85db('0x1d')][_0x1a4f7c[_0x85db('0xaf')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x85db('0x1d')][_0x1a4f7c[_0x85db('0xaf')]][_0x85db('0x5d')]+=0x1;this[_0x85db('0x1d')][_0x1a4f7c[_0x85db('0xaf')]][_0x85db('0x66')]+=0x1;_0x20020b['state']=0xa;_0x20020b[_0x85db('0xa4')]=_0x85db('0x114');_0x20020b[_0x85db('0x115')]='TIMEOUT';_0x20020b[_0x85db('0x10c')]=this[_0x85db('0x1d')][_0x1a4f7c[_0x85db('0xaf')]][_0x85db('0x10d')]?moment()[_0x85db('0x73')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x20020b[_0x85db('0xf0')]+=0x1;_0x20020b['countglobal']+=0x1;if(_0x20020b[_0x85db('0xf0')]>=this[_0x85db('0x1d')][_0x1a4f7c[_0x85db('0xaf')]]['dialDropMaxRetry']){this[_0x85db('0x111')](_0x20020b);}else{this[_0x85db('0xba')]({'active':![],'countdropretry':_0x20020b[_0x85db('0xf0')],'scheduledat':moment()[_0x85db('0xf8')](this[_0x85db('0x1d')][_0x1a4f7c['queue']]['dialDropRetryFrequency'],'minutes')[_0x85db('0x73')](_0x85db('0xfa')),'ContactId':_0x391556['ContactId'],'ListId':_0x391556['ListId'],'VoiceQueueId':_0x391556['VoiceQueueId']||undefined,'CampaignId':_0x391556['CampaignId']||undefined})['catch'](loggerCatch(_0x85db('0x116')));var _0x47d827=new History(_0x20020b);_0x47d827[_0x85db('0xa3')]=0xa;_0x47d827['statedesc']=_0x85db('0x114');_0x47d827[_0x85db('0x117')]=moment()[_0x85db('0x73')]('YYYY-MM-DD\x20HH:mm:ss');_0x47d827['endtime']=_0x47d827['starttime'];_0x47d827[_0x85db('0x118')]=_0x20020b['calleridname'];_0x47d827[_0x85db('0x119')]=_0x20020b['calleridnum'];this['createHistory'](_0x47d827)['catch'](loggerCatch(_0x85db('0x11a')));}}else{this[_0x85db('0x1d')][_0x1a4f7c['queue']][_0x85db('0x7d')]+=0x1;this[_0x85db('0x1d')][_0x1a4f7c[_0x85db('0xaf')]][_0x85db('0x11b')]+=0x1;_0x20020b[_0x85db('0xa3')]=0xb;_0x20020b['statedesc']=_0x85db('0x11c');_0x20020b[_0x85db('0x115')]=_0x85db('0x11d');_0x20020b['countabandonedretry']+=0x1;_0x20020b[_0x85db('0xed')]+=0x1;if(_0x20020b['countabandonedretry']>=this[_0x85db('0x1d')][_0x1a4f7c[_0x85db('0xaf')]][_0x85db('0x11e')]){this['queueCallerAbandonCreateState'](_0x20020b);}else{this[_0x85db('0xba')]({'active':![],'countabandonedretry':_0x20020b[_0x85db('0xf1')],'scheduledat':moment()[_0x85db('0xf8')](this[_0x85db('0x1d')][_0x1a4f7c['queue']][_0x85db('0x11f')],_0x85db('0x102'))[_0x85db('0x73')](_0x85db('0xfa')),'ContactId':_0x391556['ContactId'],'ListId':_0x391556[_0x85db('0xd0')],'VoiceQueueId':_0x391556[_0x85db('0xd2')]||undefined,'CampaignId':_0x391556[_0x85db('0xd3')]||undefined})['catch'](loggerCatch(_0x85db('0x120')));var _0x47d827=new History(_0x20020b);_0x47d827[_0x85db('0xa3')]=0xb;_0x47d827[_0x85db('0xa4')]='Abandoned';_0x47d827[_0x85db('0x117')]=moment()[_0x85db('0x73')]('YYYY-MM-DD\x20HH:mm:ss');_0x47d827[_0x85db('0xa5')]=_0x47d827[_0x85db('0x117')];_0x47d827[_0x85db('0x118')]=_0x20020b['calleridname'];_0x47d827[_0x85db('0x119')]=_0x20020b[_0x85db('0x119')];this['createHistory'](_0x47d827)[_0x85db('0xac')](loggerCatch(_0x85db('0x121')));}}}}};Dialer[_0x85db('0x18')][_0x85db('0x34')]=function(_0x214cc4){if(this[_0x85db('0x23')][_0x214cc4[_0x85db('0xe0')]]){this[_0x85db('0x23')][_0x214cc4[_0x85db('0xe0')]][_0x85db('0xab')]=_0x214cc4['channel'];}if(this[_0x85db('0x25')][_0x214cc4['uniqueid']]){this[_0x85db('0x25')][_0x214cc4[_0x85db('0xe0')]][_0x85db('0xab')]=_0x214cc4[_0x85db('0xab')];}};Dialer[_0x85db('0x18')][_0x85db('0x122')]=function(_0x5e877f){if(strategy[this['voiceQueues'][this[_0x85db('0x23')][_0x5e877f[_0x85db('0x123')]][_0x85db('0xaf')]]['strategy']]==='roundrobin'){if(this['actions'][_0x5e877f[_0x85db('0x123')]]&&_[_0x85db('0xa8')](this[_0x85db('0x23')][_0x5e877f['actionid']][_0x85db('0x124')])&&_0x5e877f['status']==='1'&&_0x5e877f['paused']==='0'){if(this[_0x85db('0x1f')][_0x5e877f['stateinterface']]){if(!this[_0x85db('0x1f')][_0x5e877f[_0x85db('0x125')]][_0x85db('0x124')]){this['agents'][_0x5e877f[_0x85db('0x125')]][_0x85db('0x124')]=!![];this['actions'][_0x5e877f[_0x85db('0x123')]][_0x85db('0x124')]=!![];this['actions'][_0x5e877f[_0x85db('0x123')]]['stateinterface']=_0x5e877f[_0x85db('0x125')];}}}}else if((strategy[this['voiceQueues'][this[_0x85db('0x23')][_0x5e877f[_0x85db('0x123')]][_0x85db('0xaf')]][_0x85db('0x126')]]||_0x85db('0x16'))==='rrmemory'){if(this[_0x85db('0x23')][_0x5e877f[_0x85db('0x123')]]){if(this[_0x85db('0x1f')][_0x5e877f[_0x85db('0x125')]]){this[_0x85db('0x23')][_0x5e877f['actionid']][_0x85db('0x125')]=_0x5e877f[_0x85db('0x125')];if(_['isNil'](this['queueBooked'][this[_0x85db('0x23')][_0x5e877f[_0x85db('0x123')]]['queue']])){this[_0x85db('0x29')][this[_0x85db('0x23')][_0x5e877f[_0x85db('0x123')]][_0x85db('0xaf')]]=[];}this['queueBooked'][this[_0x85db('0x23')][_0x5e877f[_0x85db('0x123')]]['queue']][_0x85db('0x127')](_[_0x85db('0x128')](_[_0x85db('0xce')](this[_0x85db('0x23')][_0x5e877f[_0x85db('0x123')]],[_0x85db('0x129'),_0x85db('0x125')]),{'status':_0x5e877f[_0x85db('0xaa')],'paused':_0x5e877f[_0x85db('0x12a')]}));}}}};function unlockQueueStatus(_0x1d42a3,_0x2c7b0b){setTimeout(function(){if(_[_0x85db('0x3b')](_0x1d42a3['queueStatusComplete'])){loggerBooked['error']('[unlockQueueStatus][undefined]',_0x2c7b0b);}_0x1d42a3['queueStatusComplete']=!![];loggerBooked['info'](_0x85db('0x12b'),_0x2c7b0b,JSON['stringify'](_['pick'](_0x1d42a3,[_0x85db('0x3c'),_0x85db('0x12c')])));},0x1f3);}Dialer['prototype']['syncQueueStatusComplete']=function(_0x5f29f0){var _0xecb89b=this;var _0x367ce6=_0xecb89b['voiceQueues'][_0xecb89b[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xaf')]];if(strategy[this['voiceQueues'][this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xaf')]][_0x85db('0x126')]]===_0x85db('0x17')){if(this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]]&&this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]]['stateinterface']){this[_0x85db('0x1c')]['run'](this['actions'][_0x5f29f0[_0x85db('0x123')]][_0x85db('0x129')],this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0x125')])[_0x85db('0xac')](function(_0x135f91){logger['error'](_0x85db('0x12d'),util[_0x85db('0x90')](_0x135f91,{'showHidden':![],'depth':null}));})[_0x85db('0x12e')](function(){_0xecb89b['updateOriginated'](_0xecb89b[_0x85db('0x1d')][_0xecb89b['actions'][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xaf')]]);_0xecb89b[_0x85db('0x1f')][_0xecb89b[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0x125')]]['locked']=![];delete _0xecb89b[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]];unlockQueueStatus(_0x367ce6);});}else{this[_0x85db('0xae')](this['voiceQueues'][this[_0x85db('0x23')][_0x5f29f0['actionid']]['queue']]);this[_0x85db('0xba')]({'active':![],'ContactId':this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xcf')],'ListId':this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xd0')],'VoiceQueueId':this['actions'][_0x5f29f0[_0x85db('0x123')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x85db('0x23')][_0x5f29f0['actionid']][_0x85db('0xd3')]||undefined})[_0x85db('0xac')](loggerCatch(_0x85db('0x12f')));delete this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]];unlockQueueStatus(_0x367ce6);}}else if((strategy[this[_0x85db('0x1d')][this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xaf')]][_0x85db('0x126')]]||_0x85db('0x16'))==='rrmemory'){var _0x454a88;if(this['actions'][_0x5f29f0['actionid']]&&!_[_0x85db('0x44')](this[_0x85db('0x29')][this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xaf')]])){if(this[_0x85db('0x2a')][_0xecb89b[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xaf')]]){this[_0x85db('0x2a')][_0xecb89b[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]]['queue']]=this['queueBookedRR'][this[_0x85db('0x23')][_0x5f29f0['actionid']][_0x85db('0xaf')]]?this['queueBookedRR'][this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xaf')]]:this[_0x85db('0x29')][this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xaf')]]?this[_0x85db('0x29')][this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xaf')]][_0x85db('0x130')]||0x0:0x0;}this['queueBooked'][this['actions'][_0x5f29f0[_0x85db('0x123')]]['queue']][_0x85db('0x130')]=this[_0x85db('0x2a')][this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xaf')]];for(var _0x569f1d=0x0;_0x569f1d<this[_0x85db('0x29')][this['actions'][_0x5f29f0['actionid']][_0x85db('0xaf')]]['length'];_0x569f1d+=0x1){_0x454a88=rr(this[_0x85db('0x29')][this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xaf')]]);this[_0x85db('0x2a')][_0xecb89b['actions'][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xaf')]]=this['queueBooked'][this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xaf')]]['_rr'];if(_0x454a88['status']==='1'&&_0x454a88[_0x85db('0x12a')]==='0'){break;}}if(!_[_0x85db('0xa8')](_0x454a88)){this[_0x85db('0x1f')][_0x454a88['stateinterface']][_0x85db('0x131')]=_[_0x85db('0x3b')](this[_0x85db('0x1f')][_0x454a88['stateinterface']][_0x85db('0x131')])?!![]:this[_0x85db('0x1f')][_0x454a88[_0x85db('0x125')]][_0x85db('0x131')];}loggerBooked[_0x85db('0x78')]('[booked][RR]',_0x5f29f0['actionid'],_0x85db('0x132'),JSON[_0x85db('0x47')](_['pick'](this[_0x85db('0x1f')][_0x454a88[_0x85db('0x125')]],[_0x85db('0x3c'),_0x85db('0x131')])),'contactAgent-idHopper:\x20',JSON[_0x85db('0x47')](_0x454a88[_0x85db('0x129')]));if(!_['isNil'](_0x454a88)&&_0x454a88[_0x85db('0xaa')]==='1'&&_0x454a88[_0x85db('0x12a')]==='0'&&this[_0x85db('0x1f')][_0x454a88[_0x85db('0x125')]][_0x85db('0x131')]){this[_0x85db('0x1f')][_0x454a88[_0x85db('0x125')]][_0x85db('0x131')]=![];this['queueBooked'][_0xecb89b['actions'][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xaf')]]=[];this[_0x85db('0x1c')][_0x85db('0x133')](_0x454a88['idHopper'],_0x454a88[_0x85db('0x125')])[_0x85db('0xac')](function(_0x3931d6){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0x85db('0x90')](_0x3931d6,{'showHidden':![],'depth':null}));})[_0x85db('0x12e')](function(){_0xecb89b[_0x85db('0xae')](_0xecb89b[_0x85db('0x1d')][_0xecb89b[_0x85db('0x23')][_0x5f29f0['actionid']]['queue']]);setTimeout(function(){_0xecb89b[_0x85db('0x1f')][_0x454a88[_0x85db('0x125')]][_0x85db('0x131')]=!![];loggerBooked['info']('[booked][RR][finaly]',_0x5f29f0[_0x85db('0x123')],_0x85db('0x132'),JSON['stringify'](_[_0x85db('0xce')](_0xecb89b[_0x85db('0x1f')][_0x454a88[_0x85db('0x125')]],[_0x85db('0x3c'),_0x85db('0x131')])),_0x85db('0x134'),JSON[_0x85db('0x47')](_0x454a88[_0x85db('0x129')]));},0xc7);delete _0xecb89b[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]];unlockQueueStatus(_0x367ce6,_0x5f29f0[_0x85db('0x123')]);});}else{loggerBooked[_0x85db('0x78')](_0x85db('0x135'));this['updateOriginated'](this[_0x85db('0x1d')][this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]]['queue']]);this[_0x85db('0xba')]({'active':![],'ContactId':this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xcf')],'ListId':this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xd0')],'VoiceQueueId':this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xd2')]||undefined,'CampaignId':this['actions'][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xd3')]||undefined})[_0x85db('0xac')](loggerCatch(_0x85db('0x12f')));delete this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]];unlockQueueStatus(_0x367ce6);}}else{loggerBooked['info']('[booked][unlock2]');this[_0x85db('0xae')](this[_0x85db('0x1d')][this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xaf')]]);this[_0x85db('0xba')]({'active':![],'ContactId':this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xcf')],'ListId':this['actions'][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xd0')],'VoiceQueueId':this['actions'][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xd2')]||undefined,'CampaignId':this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]]['CampaignId']||undefined})['catch'](loggerCatch(_0x85db('0x136')));delete this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]];unlockQueueStatus(_0x367ce6);}}else{loggerBooked[_0x85db('0x78')](_0x85db('0x137'));this[_0x85db('0xae')](this['voiceQueues'][this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]]['queue']]);this[_0x85db('0xba')]({'active':![],'ContactId':this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xcf')],'ListId':this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]]['ListId'],'VoiceQueueId':this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x85db('0x23')][_0x5f29f0[_0x85db('0x123')]][_0x85db('0xd3')]||undefined})[_0x85db('0xac')](loggerCatch(_0x85db('0x138')));delete this[_0x85db('0x23')][_0x5f29f0['actionid']];unlockQueueStatus(_0x367ce6);}};Dialer[_0x85db('0x18')][_0x85db('0x39')]=function(){var _0x24b6dc=this;setInterval(function(){_0x24b6dc[_0x85db('0x139')]();},0x3e8);};Dialer[_0x85db('0x18')]['checkIsTrunkReachable']=function(_0x46942a){var _0x50977a=this;return function(){if(!_0x50977a[_0x85db('0xd6')](_0x46942a['Trunk'])){if(!_0x50977a['isTrunkReachable'](_0x46942a[_0x85db('0x13a')])){_0x46942a[_0x85db('0x3d')]='TRUNK_IS_NOT_REACHABLE';throw _0x46942a['name']+_0x85db('0x13b');}}};};Dialer['prototype']['checkIfTime']=function(_0x534129,_0x277a3c,_0x132cc1,_0x559d31){var _0x43a83f=this;return function(){var _0x431422=!![];return _0x43a83f[_0x85db('0x13c')](_0x534129,_0x277a3c,_0x132cc1,_0x559d31,_0x431422);};};Dialer['prototype'][_0x85db('0x13d')]=function(_0x4ebc07,_0x165cc3,_0x358fca,_0x5157ad){var _0x2c8343=this;return function(){var _0x9b9c=![];return _0x2c8343[_0x85db('0x13c')](_0x4ebc07[_0x85db('0x43')],_0x165cc3,_0x358fca,_0x5157ad,_0x9b9c);};};Dialer[_0x85db('0x18')][_0x85db('0x13c')]=function(_0x50b052,_0x38be88,_0x10194d,_0x59f182,_0x134352){var _0x514e25=[];return new BPromise(function(_0xa4e3e4,_0x58b523){if(!isNotNull(_0x50b052)){_0x59f182[_0x85db('0x3d')]='INTERVAL_IS_NULL';return _0x58b523(msgResponse('ifTime',_0x85db('0x13e'),_0x10194d+'\x20Intervals\x20is\x20null\x20'));}if(_['isEmpty'](_0x50b052)){_0x59f182['message']=_0x85db('0x13f');return _0x58b523(msgResponse('ifTime',_0x85db('0x13e'),_0x10194d+_0x85db('0x140')));}if(_0x38be88&&_[_0x85db('0x3b')](config[_0x85db('0x141')][_0x38be88])){_0x59f182[_0x85db('0x3d')]='TIMEZONE_UNKNOW';return _0x58b523(msgResponse('ifTime',_0x85db('0x13e'),_0x10194d+_0x85db('0x142')+_0x38be88));}if(_[_0x85db('0x143')](_0x50b052)){for(var _0x50571f=0x0;_0x50571f<_0x50b052['length'];_0x50571f+=0x1){_0x514e25[_0x85db('0x127')](ami[_0x85db('0xa9')]({'action':_0x85db('0x144'),'command':util['format'](_0x85db('0x145'),_0x50b052[_0x50571f][_0x85db('0x146')],!_[_0x85db('0x3b')](config[_0x85db('0x141')][_0x38be88])?_0x38be88:'')})['then'](function(_0xf8d05c){return _0xf8d05c['content'][_0x85db('0x147')](_0x85db('0x148'))>=0x0;})[_0x85db('0xac')](myreject(_0x58b523)));}}else{_0x514e25[_0x85db('0x127')](ami[_0x85db('0xa9')]({'action':_0x85db('0x144'),'command':util[_0x85db('0x73')](_0x85db('0x145'),_0x50b052,!_[_0x85db('0x3b')](config[_0x85db('0x141')][_0x38be88])?_0x38be88:'')})[_0x85db('0xb2')](function(_0x2fbd1a){return _0x2fbd1a[_0x85db('0x149')][_0x85db('0x147')]('true')>=0x0;})['catch'](myreject(_0x58b523)));}BPromise['all'](_0x514e25)[_0x85db('0xb2')](function(_0x4384b9){var _0x3a6b1f=_[_0x85db('0x14a')](_0x4384b9);if(_0x3a6b1f){return _0xa4e3e4(_0x3a6b1f);}else{_0x59f182[_0x85db('0x3d')]=_0x134352?_0x85db('0x14b'):'INTERVAL_IS_OVERTIME';return _0x58b523(msgResponse('[ifTime][promiseAll]',_0x85db('0x13e'),_0x85db('0x14c')+_0x134352+'\x20'+_0x10194d+_0x85db('0x14d')+util[_0x85db('0x90')](_0x50b052,{'showHidden':![],'depth':null})+_0x85db('0x14e')+_0x38be88));}})[_0x85db('0xac')](function(_0x195305){return _0x58b523(msgResponse('ifTime',_0x85db('0x13e'),JSON['stringify'](_0x195305)));});});};Dialer[_0x85db('0x18')][_0x85db('0x14f')]=function(_0x25a0d1){var _0x55f52a=this;return function(){switch(_0x25a0d1[_0x85db('0x55')]){case _0x85db('0x150'):freeVariablesPredictive(_0x25a0d1);_0x55f52a[_0x85db('0x151')](_0x25a0d1,0x1);break;case _0x85db('0x152'):freeVariablesPredictive(_0x25a0d1);_0x55f52a[_0x85db('0x151')](_0x25a0d1,_0x25a0d1['dialPowerLevel']);break;case'predictive':_0x55f52a[_0x85db('0x153')](_0x25a0d1);break;case _0x85db('0x8'):freeVariablesPredictive(_0x25a0d1);_0x55f52a[_0x85db('0x151')](_0x25a0d1,0x1);break;default:freeVariablesPredictive(_0x25a0d1);logger['error'](_0x85db('0x154'),_0x25a0d1[_0x85db('0x3c')],'method\x20not\x20recognized');}};};Dialer[_0x85db('0x18')][_0x85db('0x155')]=function(_0x3c11d7){var _0x211e72=this;return function(){_0x211e72[_0x85db('0x156')](_0x3c11d7);};};Dialer[_0x85db('0x18')]['syncQueueSummary']=function(_0x3fe764){var _0x3c2899=this;if(isNotPreview(_0x3fe764['dialMethod'])){if(isVoiceQueueOutbound(_0x3fe764[_0x85db('0x4c')])&&isActive(_0x3fe764[_0x85db('0x157')])){_0x3fe764[_0x85db('0x9c')]=!![];BPromise[_0x85db('0xb1')]()[_0x85db('0xb2')](checkIsLoggedIn(_0x3fe764,_0x3fe764[_0x85db('0x4e')]))[_0x85db('0xb2')](checkIsActive(_0x3fe764,_0x3fe764[_0x85db('0x157')]))[_0x85db('0xb2')](checkInterval(_0x3fe764))['then'](_0x3c2899[_0x85db('0x158')](_0x3fe764))[_0x85db('0xb2')](_0x3c2899[_0x85db('0x159')](_0x3fe764[_0x85db('0x15a')],_0x3fe764['dialTimezone'],_0x3fe764[_0x85db('0x3c')],_0x3fe764))['then'](_0x3c2899[_0x85db('0x13d')](_0x3fe764[_0x85db('0x40')],_0x3fe764[_0x85db('0x15b')],_0x3fe764[_0x85db('0x3c')],_0x3fe764))[_0x85db('0xb2')](_0x3c2899[_0x85db('0x14f')](_0x3fe764))[_0x85db('0xac')](loggerCatchQueueSummary(_0x85db('0x15c'),_0x3fe764));}else{notSendMessagesQueue(_0x3fe764);}}else{freeVariablesPredictive(_0x3fe764);}};Dialer[_0x85db('0x18')][_0x85db('0x139')]=function(){var _0x4ad4c5=this;var _0x1193b9;for(var _0x2796b4 in this[_0x85db('0x1e')]){if(typeof this['campaigns'][_0x2796b4]!=='undefined'){_0x1193b9=this[_0x85db('0x1e')][_0x2796b4];if(isCampaignIvr(_0x1193b9['type'])&&isActive(_0x1193b9[_0x85db('0x71')])){_0x1193b9[_0x85db('0x9c')]=!![];BPromise[_0x85db('0xb1')]()[_0x85db('0xb2')](checkIsActive(_0x1193b9,_0x1193b9[_0x85db('0x71')]))['then'](checkInterval(_0x1193b9))[_0x85db('0xb2')](_0x4ad4c5[_0x85db('0x158')](_0x1193b9))[_0x85db('0xb2')](_0x4ad4c5[_0x85db('0x159')](_0x1193b9[_0x85db('0x15a')],_0x1193b9[_0x85db('0x15b')],_0x1193b9[_0x85db('0x3c')],_0x1193b9))['then'](_0x4ad4c5[_0x85db('0x13d')](_0x1193b9[_0x85db('0x40')],_0x1193b9[_0x85db('0x15b')],_0x1193b9[_0x85db('0x3c')],_0x1193b9))[_0x85db('0xb2')](_0x4ad4c5[_0x85db('0x155')](_0x1193b9))[_0x85db('0xac')](loggerCatchQueueSummary('[syncCampaigns]',_0x1193b9));}else{notSendMessagesCampaign(_0x1193b9);}}}};function getCallerIdRandom(_0x341631,_0x460bc6){var _0x1bd358;var _0x4b5fa2;var _0x56594b;if(_0x460bc6<=0x0){_0x460bc6=0x1;}_0x1bd358=new RegExp(_0x85db('0x15d')+_0x460bc6+'}$');_0x4b5fa2=Math[_0x85db('0x15e')](0xa,_0x460bc6-0x1);_0x56594b=Math['pow'](0xa,_0x460bc6)-0x1;return util[_0x85db('0x73')]('%s',_['replace'](_0x341631,_0x1bd358,_[_0x85db('0x15f')](_0x4b5fa2,_0x56594b)));}function extractCalleridName(_0x2a5225){var _0x39edac=_0x2a5225[_0x85db('0x160')](/"(.*?)"/);return _0x39edac?_0x39edac[0x1]:_0x2a5225;}function extractCalleridNumber(_0x353239){var _0x4429a2=_0x353239[_0x85db('0x160')](/<(.*?)>/);return _0x4429a2?_0x4429a2[0x1]:_0x353239;}Dialer['prototype'][_0x85db('0x161')]=function(_0x1d16b1,_0x344577){var _0x30266d=this;var _0xcb9d4=uuid['v4']();this['actions'][_0xcb9d4]=new Action(_0x1d16b1,_0x344577,_0xcb9d4);return new BPromise(function(_0x5b190e,_0x10329b){if(_['isUndefined'](_0x1d16b1)&&typeof _0x1d16b1!==_0x85db('0x162')){return _0x10329b(msgResponse(_0x85db('0x163'),_0x85db('0x13e'),_0x85db('0x164')));}if(_[_0x85db('0x3b')](_0x344577[_0x85db('0x165')][_0x85db('0x166')])||_0x344577[_0x85db('0x165')][_0x85db('0x166')]===null){return _0x10329b(msgResponse('originate',_0x85db('0x13e'),_0x85db('0x167')));}var _0x51c2ce={'XMD-CALLERID':_0x30266d[_0x85db('0x23')][_0xcb9d4][_0x85db('0x168')](),'XMD-AGI':_0x1d16b1[_0x85db('0x108')]?util[_0x85db('0x73')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1d16b1['dialQueueProject']):_0x85db('0x169'),'XMD-AGIAFTER':_0x1d16b1['dialQueueProject2']?util[_0x85db('0x73')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1d16b1['dialQueueProject2']):'NONE','XMD-QUEUE':_0x1d16b1[_0x85db('0x4c')]===_0x85db('0x4d')?util[_0x85db('0x73')](_0x85db('0x16a'),_0x1d16b1[_0x85db('0x3c')],_0x1d16b1[_0x85db('0x16b')]||'',_0x1d16b1[_0x85db('0x10e')]?'c':'',_0x1d16b1[_0x85db('0x16c')]||0x3):_0x85db('0x169'),'XMD-CONTACTID':_0x344577[_0x85db('0xcf')],'XMD-CDRTYPE':_0x85db('0x7'),'CALLERID(all)':_0x30266d[_0x85db('0x23')][_0xcb9d4][_0x85db('0x168')](),'XMD-AMD':_0x1d16b1[_0x85db('0xe8')]?_0x85db('0x16d'):'NONE','XMD-DESTINATION':_0x85db('0xdd')};if(_0x1d16b1['dialAMDActive']){_0x51c2ce[_0x85db('0x16e')]=_0x1d16b1['dialAMDInitialSilence']||0x9c4;_0x51c2ce[_0x85db('0x16f')]=_0x1d16b1[_0x85db('0x170')]||0x5dc;_0x51c2ce[_0x85db('0x171')]=_0x1d16b1[_0x85db('0x172')]||0x320;_0x51c2ce[_0x85db('0x173')]=_0x1d16b1[_0x85db('0x174')]||0x1388;_0x51c2ce[_0x85db('0x175')]=_0x1d16b1['dialAMDMinWordLength']||0x64;_0x51c2ce['XMD-AMDBETWEENWORDSSILENCE']=_0x1d16b1[_0x85db('0x176')]||0x32;_0x51c2ce[_0x85db('0x177')]=_0x1d16b1[_0x85db('0x178')]||0x3;_0x51c2ce[_0x85db('0x179')]=_0x1d16b1[_0x85db('0x17a')]||0x100;_0x51c2ce['XMD-AMDMAXIMUMWORDLENGTH']=_0x1d16b1[_0x85db('0x17b')]||0x1388;}if(_0x1d16b1[_0x85db('0x4c')]==='outbound'){_0x51c2ce[_0x85db('0x17c')]=_0x344577[_0x85db('0xd2')];}else{_0x51c2ce[_0x85db('0x17d')]=_0x344577[_0x85db('0xd3')];}for(var _0x4c2652 in _0x344577[_0x85db('0x165')]){if(typeof _0x344577[_0x85db('0x165')][_0x4c2652]!==_0x85db('0x94')){if(isNotNull(_0x344577['Contact'][_0x4c2652])&&_0x4c2652!=='id'&&_0x4c2652!==_0x85db('0x17e')&&_0x4c2652!==_0x85db('0x17f')&&_0x4c2652!==_0x85db('0x180')){_0x51c2ce[util[_0x85db('0x73')](_0x85db('0x181'),_0x85db('0x182'),_[_0x85db('0x183')](_0x4c2652))]=_0x344577[_0x85db('0x165')][_0x4c2652];}}}var _0x4dad18=_0x30266d[_0x85db('0xd6')](_0x1d16b1['Trunk'])?getCallerId(_0x1d16b1['Trunk'][_0x85db('0x72')],_0x1d16b1['dialOriginateCallerIdName'],_0x1d16b1[_0x85db('0x184')]>0x0?getCallerIdRandom(_0x1d16b1[_0x85db('0x57')],_0x1d16b1[_0x85db('0x184')]):_0x1d16b1['dialOriginateCallerIdNumber']):getCallerId(_[_0x85db('0xa8')](_0x1d16b1[_0x85db('0x13a')])?_0x1d16b1[_0x85db('0x70')][_0x85db('0x72')]:_0x1d16b1['TrunkBackup'][_0x85db('0x72')],_0x1d16b1['dialOriginateCallerIdName'],_0x1d16b1[_0x85db('0x184')]>0x0?getCallerIdRandom(_0x1d16b1[_0x85db('0x57')],_0x1d16b1['dialRandomLastDigitCallerIdNumber']):_0x1d16b1['dialOriginateCallerIdNumber']);if(_0x4dad18){_0x51c2ce['XMD-ORIGINATECALLERIDNAME']=_0x30266d[_0x85db('0x23')][_0xcb9d4][_0x85db('0x185')]=extractCalleridName(_0x4dad18);_0x51c2ce[_0x85db('0x186')]=_0x30266d[_0x85db('0x23')][_0xcb9d4][_0x85db('0x187')]=extractCalleridNumber(_0x4dad18);}return ami[_0x85db('0xa9')]({'actionid':_0xcb9d4,'action':_0x85db('0x163'),'channel':_0x30266d['isTrunkReachable'](_0x1d16b1[_0x85db('0x70')])?util[_0x85db('0x73')](_0x85db('0x188'),_0x1d16b1[_0x85db('0x70')][_0x85db('0x3c')],isNotNull(_0x1d16b1[_0x85db('0x59')])?_0x1d16b1['dialPrefix'][_0x85db('0x189')]()||'':'',_0x1d16b1[_0x85db('0x18a')]>0x0?_0x344577[_0x85db('0x165')]['phone']['substring'](_0x1d16b1[_0x85db('0x18a')]):_0x344577[_0x85db('0x165')]['phone']):util[_0x85db('0x73')](_0x85db('0x188'),_[_0x85db('0xa8')](_0x1d16b1[_0x85db('0x13a')])?_0x1d16b1['Trunk']['name']:_0x1d16b1[_0x85db('0x13a')]['name'],isNotNull(_0x1d16b1[_0x85db('0x59')])?_0x1d16b1[_0x85db('0x59')][_0x85db('0x189')]()||'':'',_0x1d16b1[_0x85db('0x18a')]>0x0?_0x344577[_0x85db('0x165')]['phone'][_0x85db('0x18b')](_0x1d16b1[_0x85db('0x18a')]):_0x344577[_0x85db('0x165')][_0x85db('0x166')]),'callerid':_0x4dad18,'Exten':_0x85db('0xdd'),'Context':_0x85db('0x18c'),'Priority':'1','variable':_0x51c2ce,'timeout':(_0x1d16b1[_0x85db('0x58')]||0x1e)*0x3e8,'async':!![],'channelid':_0xcb9d4})[_0x85db('0xb2')](function(_0x1e86cd){return _0x5b190e(_0x1e86cd);})[_0x85db('0xac')](function(_0x2259e0){_0x1d16b1[_0x85db('0x18d')]+=0x1;var _0x5990ac=new History(_0x30266d[_0x85db('0x23')][_0xcb9d4]);logger[_0x85db('0x8f')](util['format'](_0x85db('0x18e'),JSON[_0x85db('0x47')](_0x2259e0)));_0x5990ac[_0x85db('0xa3')]=0xe;_0x5990ac[_0x85db('0xa4')]=_0x85db('0x18f');_0x5990ac[_0x85db('0x117')]=moment()['format'](_0x85db('0xfa'));_0x5990ac[_0x85db('0xa5')]=_0x5990ac['starttime'];_0x30266d[_0x85db('0xc7')](_0x5990ac)[_0x85db('0xac')](loggerCatch('[originate][error]'));_0x30266d[_0x85db('0xc5')](_0x5990ac)[_0x85db('0xac')](loggerCatch(_0x85db('0x190')))['finally'](function(){delete _0x30266d[_0x85db('0x23')][_0xcb9d4];return _0x10329b(msgResponse(_0x85db('0x163'),_0x85db('0x46'),'originate\x20action\x20Error'));});});});};Dialer['prototype'][_0x85db('0x30')]=function(_0xbc62dd){var _0x22401c=this[_0x85db('0x23')][_0xbc62dd[_0x85db('0x123')]];if(_0x22401c){delete this[_0x85db('0x23')][_0xbc62dd['actionid']];_0x22401c[_0x85db('0x113')]=moment()[_0x85db('0x73')]('YYYY-MM-DD\x20HH:mm:ss');var _0x18cdfb=_0x22401c[_0x85db('0x4c')]===_0x85db('0x76')?this[_0x85db('0x1e')][_0x22401c[_0x85db('0xaf')]]:this[_0x85db('0x1d')][_0x22401c[_0x85db('0x191')]()];if(!this[_0x85db('0xd4')](_0xbc62dd[_0x85db('0x192')])){this['updateOriginated'](_0x18cdfb);return this[_0x85db('0x193')](_0x22401c,_0x18cdfb,_0xbc62dd)['catch'](loggerCatch(_0x85db('0x194')));}this[_0x85db('0x25')][_0xbc62dd[_0x85db('0xe0')]]=_0x22401c;}};Dialer[_0x85db('0x18')][_0x85db('0x195')]=function(_0x3426cf,_0x35c127,_0xbde8c5){var _0x3797ba=new History(_0x35c127);if(_0x3797ba[_0x85db('0xfe')]+_0x3797ba[_0x85db('0xef')]+_0x3797ba[_0x85db('0xff')]+_0x3797ba[_0x85db('0x100')]+_0x3797ba['countdropretry']+_0x3797ba[_0x85db('0xf1')]+_0x3797ba['countmachineretry']+_0x3797ba['countagentrejectretry']>=_0xbde8c5[_0x85db('0xf3')]-0x1){return!![];}switch(_0x3426cf){case 0x3:if(_0x3797ba[_0x85db('0xff')]>=_0xbde8c5[_0x85db('0x196')]-0x1){return!![];}this[_0x85db('0xba')]({'active':![],'countnoanswerretry':_0x3797ba['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x85db('0xf8')](_0xbde8c5[_0x85db('0x197')],'minutes')[_0x85db('0x73')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3797ba[_0x85db('0xcf')],'ListId':_0x3797ba[_0x85db('0xd0')],'VoiceQueueId':_0x3797ba[_0x85db('0xd2')]||undefined,'CampaignId':_0x3797ba['CampaignId']||undefined})[_0x85db('0xac')](loggerCatch(_0x85db('0x198')));break;case 0x5:if(_0x3797ba['countbusyretry']>=_0xbde8c5[_0x85db('0x199')]-0x1){return!![];}this[_0x85db('0xba')]({'active':![],'countbusyretry':_0x3797ba[_0x85db('0xfe')]+=0x1,'scheduledat':moment()['add'](_0xbde8c5[_0x85db('0x19a')],_0x85db('0x102'))[_0x85db('0x73')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3797ba['ContactId'],'ListId':_0x3797ba['ListId'],'VoiceQueueId':_0x3797ba['VoiceQueueId']||undefined,'CampaignId':_0x3797ba[_0x85db('0xd3')]||undefined})[_0x85db('0xac')](loggerCatch(_0x85db('0x19b')));break;case 0x8:if(_0x3797ba[_0x85db('0xef')]>=_0xbde8c5[_0x85db('0x19c')]-0x1){return!![];}this[_0x85db('0xba')]({'active':![],'countcongestionretry':_0x3797ba[_0x85db('0xef')]+=0x1,'scheduledat':moment()['add'](_0xbde8c5[_0x85db('0x19d')],_0x85db('0x102'))[_0x85db('0x73')](_0x85db('0xfa')),'ContactId':_0x3797ba[_0x85db('0xcf')],'ListId':_0x3797ba[_0x85db('0xd0')],'VoiceQueueId':_0x3797ba[_0x85db('0xd2')]||undefined,'CampaignId':_0x3797ba[_0x85db('0xd3')]||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x3797ba['countnosuchnumberretry']>=_0xbde8c5['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x85db('0xba')]({'active':![],'countnosuchnumberretry':_0x3797ba[_0x85db('0x100')]+=0x1,'scheduledat':moment()[_0x85db('0xf8')](_0xbde8c5[_0x85db('0x19e')],_0x85db('0x102'))[_0x85db('0x73')](_0x85db('0xfa')),'ContactId':_0x3797ba[_0x85db('0xcf')],'ListId':_0x3797ba[_0x85db('0xd0')],'VoiceQueueId':_0x3797ba[_0x85db('0xd2')]||undefined,'CampaignId':_0x3797ba[_0x85db('0xd3')]||undefined})[_0x85db('0xac')](loggerCatch(_0x85db('0x19f')));}break;case 0xa:if(_0x3797ba[_0x85db('0xf0')]>=_0xbde8c5[_0x85db('0x1a0')]-0x1){return!![];}this[_0x85db('0xba')]({'active':![],'countdropretry':_0x3797ba[_0x85db('0xf0')]+=0x1,'scheduledat':moment()['add'](_0xbde8c5['dialDropRetryFrequency'],_0x85db('0x102'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3797ba[_0x85db('0xcf')],'ListId':_0x3797ba[_0x85db('0xd0')],'VoiceQueueId':_0x3797ba[_0x85db('0xd2')]||undefined,'CampaignId':_0x3797ba[_0x85db('0xd3')]||undefined})[_0x85db('0xac')](loggerCatch(_0x85db('0x116')));break;case 0xb:if(_0x3797ba[_0x85db('0xf1')]>=_0xbde8c5[_0x85db('0x11e')]-0x1){return!![];}this[_0x85db('0xba')]({'active':![],'countabandonedretry':_0x3797ba[_0x85db('0xf1')]+=0x1,'scheduledat':moment()[_0x85db('0xf8')](_0xbde8c5['dialAbandonedRetryFrequency'],'minutes')[_0x85db('0x73')](_0x85db('0xfa')),'ContactId':_0x3797ba[_0x85db('0xcf')],'ListId':_0x3797ba[_0x85db('0xd0')],'VoiceQueueId':_0x3797ba[_0x85db('0xd2')]||undefined,'CampaignId':_0x3797ba[_0x85db('0xd3')]||undefined})[_0x85db('0xac')](loggerCatch(_0x85db('0x120')));break;case 0x13:if(_0x3797ba[_0x85db('0xec')]>=_0xbde8c5[_0x85db('0xf6')]-0x1){return!![];}this[_0x85db('0xba')]({'active':![],'countmachineretry':_0x3797ba['countmachineretry']+=0x1,'scheduledat':moment()[_0x85db('0xf8')](_0xbde8c5[_0x85db('0xf9')],_0x85db('0x102'))[_0x85db('0x73')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3797ba[_0x85db('0xcf')],'ListId':_0x3797ba[_0x85db('0xd0')],'VoiceQueueId':_0x3797ba['VoiceQueueId']||undefined,'CampaignId':_0x3797ba[_0x85db('0xd3')]||undefined})[_0x85db('0xac')](loggerCatch(_0x85db('0xfb')));break;case 0x14:if(_0x3797ba['countagentrejectretry']>=_0xbde8c5[_0x85db('0x1a1')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countagentrejectretry':_0x3797ba[_0x85db('0xf2')]+=0x1,'scheduledat':moment()[_0x85db('0xf8')](_0xbde8c5[_0x85db('0x1a2')],_0x85db('0x102'))[_0x85db('0x73')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x3797ba[_0x85db('0xcf')],'ListId':_0x3797ba[_0x85db('0xd0')],'VoiceQueueId':_0x3797ba['VoiceQueueId']||undefined,'CampaignId':_0x3797ba[_0x85db('0xd3')]||undefined})[_0x85db('0xac')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x85db('0x18')][_0x85db('0x193')]=function(_0x2537fd,_0x2309ff,_0x247055){var _0x6c95fe=this;var _0x391fed=new History(_0x2537fd);return new BPromise(function(_0x5b1d66,_0x4c2173){if(_[_0x85db('0x3b')](_0x2309ff)&&typeof _0x2309ff!==_0x85db('0x162')){return _0x4c2173(msgResponse(_0x85db('0x1a3'),_0x85db('0x13e'),_0x85db('0x1a4')));}if(_['isUndefined'](_0x247055)&&typeof _0x247055!==_0x85db('0x162')){return _0x4c2173(msgResponse('[callProgressDetecting]',_0x85db('0x13e'),'evt\x20is\x20undefine'));}switch(_0x247055['reason']){case'0':_0x2309ff[_0x85db('0x5f')]+=0x1;_0x391fed[_0x85db('0xa3')]=0x0;_0x391fed[_0x85db('0xa4')]=_0x85db('0x1a5');_0x391fed[_0x85db('0x100')]+=0x1;_0x391fed[_0x85db('0xed')]+=0x1;ami['emit'](_0x85db('0x1a6'),ut['buildObj'](_0x2537fd,_0x85db('0x1a7')));_0x6c95fe['createHistory'](_0x391fed)['catch'](loggerCatch(_0x85db('0xee')));if(_0x6c95fe[_0x85db('0x195')](0x0,_0x2537fd,_0x2309ff)){if(_0x391fed[_0x85db('0x100')]>=_0x2309ff[_0x85db('0x1a8')]){_0x6c95fe[_0x85db('0x101')](_0x391fed,_0x5b1d66,_0x4c2173,_0x85db('0x1a9'));}else{_0x6c95fe[_0x85db('0xf4')](_0x391fed,_0x5b1d66,_0x4c2173,_0x85db('0x1a9'));}}break;case'3':_0x2309ff[_0x85db('0x5e')]+=0x1;_0x391fed[_0x85db('0xa3')]=0x3;_0x391fed[_0x85db('0xa4')]=_0x85db('0x1aa');_0x391fed[_0x85db('0xff')]+=0x1;_0x391fed['countglobal']+=0x1;ami[_0x85db('0x4b')](_0x85db('0x1ab'),ut[_0x85db('0xe4')](_0x2537fd,_0x85db('0x1ac')));_0x6c95fe[_0x85db('0xc7')](_0x391fed)['catch'](loggerCatch(_0x85db('0x1ad')));if(_0x6c95fe['checkRetriveMax'](0x3,_0x2537fd,_0x2309ff)){if(_0x391fed[_0x85db('0xff')]>=_0x2309ff[_0x85db('0x196')]){_0x6c95fe[_0x85db('0x101')](_0x391fed,_0x5b1d66,_0x4c2173,_0x85db('0x1ae'));}else{_0x6c95fe[_0x85db('0xf4')](_0x391fed,_0x5b1d66,_0x4c2173,_0x85db('0x1ae'));}}break;case'5':_0x2309ff[_0x85db('0x5c')]+=0x1;_0x391fed[_0x85db('0xa3')]=0x5;_0x391fed[_0x85db('0xa4')]=_0x85db('0x1af');_0x391fed[_0x85db('0xfe')]+=0x1;_0x391fed['countglobal']+=0x1;ami[_0x85db('0x4b')](_0x85db('0x1b0'),ut[_0x85db('0xe4')](_0x2537fd,_0x85db('0x1b1')));_0x6c95fe[_0x85db('0xc7')](_0x391fed)[_0x85db('0xac')](loggerCatch(_0x85db('0x1b2')));if(_0x6c95fe['checkRetriveMax'](0x5,_0x2537fd,_0x2309ff)){if(_0x391fed[_0x85db('0xfe')]>=_0x2309ff[_0x85db('0x199')]){_0x6c95fe['createStateFinal'](_0x391fed,_0x5b1d66,_0x4c2173,_0x85db('0x1b3'));}else{_0x6c95fe['stateGlobal'](_0x391fed,_0x5b1d66,_0x4c2173,_0x85db('0x1b3'));}}break;case'8':_0x2309ff[_0x85db('0x1b4')]+=0x1;_0x391fed[_0x85db('0xa3')]=0x8;_0x391fed[_0x85db('0xa4')]=_0x85db('0x1b5');_0x391fed[_0x85db('0xef')]+=0x1;_0x391fed[_0x85db('0xed')]+=0x1;ami[_0x85db('0x4b')](_0x85db('0x1b6'),ut[_0x85db('0xe4')](_0x2537fd,'congestion'));_0x6c95fe['createHistory'](_0x391fed)[_0x85db('0xac')](loggerCatch(_0x85db('0x1b7')));if(_0x6c95fe[_0x85db('0x195')](0x8,_0x2537fd,_0x2309ff)){if(_0x391fed[_0x85db('0xef')]>=_0x2309ff[_0x85db('0x19c')]){_0x6c95fe[_0x85db('0x101')](_0x391fed,_0x5b1d66,_0x4c2173,_0x85db('0x1b8'));}else{_0x6c95fe['stateGlobal'](_0x391fed,_0x5b1d66,_0x4c2173,_0x85db('0x1b8'));}}break;case'11':_0x2309ff[_0x85db('0x1b9')]+=0x1;_0x391fed[_0x85db('0xa3')]=0xb;_0x391fed[_0x85db('0xa4')]=_0x85db('0x11c');_0x391fed[_0x85db('0xf1')]+=0x1;_0x391fed['countglobal']+=0x1;_0x6c95fe[_0x85db('0xc7')](_0x391fed)['catch'](loggerCatch(_0x85db('0x121')));if(_0x6c95fe[_0x85db('0x195')](0xb,_0x2537fd,_0x2309ff)){if(_0x391fed[_0x85db('0xf1')]>=_0x2309ff['dialAbandonedMaxRetry']){_0x6c95fe[_0x85db('0x101')](_0x391fed,_0x5b1d66,_0x4c2173,'reason\x2011\x20abandoned');}else{_0x6c95fe[_0x85db('0xf4')](_0x391fed,_0x5b1d66,_0x4c2173,'reason\x2011\x20abandoned');}}break;case'20':_0x2309ff['outboundRejectCallsDay']+=0x1;_0x391fed['state']=0x14;_0x391fed[_0x85db('0xa4')]=_0x85db('0x1ba');_0x391fed[_0x85db('0xf2')]+=0x1;_0x391fed[_0x85db('0xed')]+=0x1;ami['emit'](_0x85db('0x1bb'),ut[_0x85db('0xe4')](_0x2537fd,_0x85db('0x1bc')));_0x6c95fe['createHistory'](_0x391fed)[_0x85db('0xac')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x6c95fe['checkRetriveMax'](0x14,_0x2537fd,_0x2309ff)){if(_0x391fed[_0x85db('0xf2')]>=_0x2309ff[_0x85db('0x1a1')]){_0x6c95fe[_0x85db('0x101')](_0x391fed,_0x5b1d66,_0x4c2173,_0x85db('0x1bd'));}else{_0x6c95fe[_0x85db('0xf4')](_0x391fed,_0x5b1d66,_0x4c2173,_0x85db('0x1bd'));}}break;default:_0x2309ff[_0x85db('0x109')]+=0x1;_0x391fed['state']=0xc;_0x391fed[_0x85db('0xa4')]=_0x247055[_0x85db('0x1be')];_0x6c95fe[_0x85db('0xc7')](_0x391fed)[_0x85db('0xac')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x6c95fe[_0x85db('0x195')](_0x247055['reason'],_0x2537fd,_0x2309ff)){if(_0x391fed[_0x85db('0xfe')]+_0x391fed[_0x85db('0xef')]+_0x391fed[_0x85db('0xff')]+_0x391fed[_0x85db('0x100')]+_0x391fed[_0x85db('0xf0')]+_0x391fed[_0x85db('0xf1')]+_0x391fed['countmachineretry']+_0x391fed[_0x85db('0xf2')]>=_0x2309ff[_0x85db('0xf3')]){_0x6c95fe['stateGlobal'](_0x391fed,_0x5b1d66,_0x4c2173,_0x247055[_0x85db('0x1be')]);}else{_0x6c95fe['createStateFinal'](_0x391fed,_0x5b1d66,_0x4c2173,_0x247055[_0x85db('0x1be')]);}}}});};Dialer[_0x85db('0x18')][_0x85db('0xf4')]=function(_0x432cab,_0x4afa87,_0x1a0879,_0x4d983d){var _0xe8668=new Final(_0x432cab);_0xe8668[_0x85db('0xa3')]=0xf;_0xe8668[_0x85db('0xa4')]='Global';this[_0x85db('0x101')](_0xe8668,_0x4afa87,_0x1a0879,_0x4d983d);};Dialer['prototype'][_0x85db('0x101')]=function(_0x56e101,_0x1e33a0,_0x20e819,_0x290f80){this[_0x85db('0xc5')](_0x56e101)[_0x85db('0xb2')](function(){return _0x1e33a0(msgResponse(_0x85db('0x1a3'),_0x85db('0xd5'),_0x290f80));})['catch'](function(){return _0x20e819(msgResponse(_0x85db('0x1bf'),_0x85db('0x13e'),_0x85db('0x1c0')));});};Dialer[_0x85db('0x18')][_0x85db('0x153')]=function(_0x26948e){var _0x4520af=_0x26948e['dialPredictiveOptimizationPercentage']/0x64;var _0x49fc8e=_0x26948e[_0x85db('0x5d')]/(_0x26948e[_0x85db('0x5d')]+_0x26948e[_0x85db('0x5a')]);var _0x511183=Math[_0x85db('0x1c1')](_0x26948e[_0x85db('0x6a')]*(_0x26948e['predictiveIntervalMaxThreshold']/0x64));var _0x25ac0c=Math[_0x85db('0x1c1')](_0x26948e[_0x85db('0x6a')]*(_0x26948e[_0x85db('0x1c2')]/0x64));var _0x1f5bda=_0x26948e[_0x85db('0x9e')]+_0x26948e['talking'];var _0x2821b8=Math[_0x85db('0x1c3')](_0x26948e[_0x85db('0x6c')]*_0x26948e[_0x85db('0x6e')]*_0x26948e[_0x85db('0x67')]*_0x26948e[_0x85db('0x68')]);if(_[_0x85db('0x3b')](_0x26948e[_0x85db('0x27')])){if(!_[_0x85db('0x3b')](_0x26948e[_0x85db('0x26')])){_0x26948e[_0x85db('0x26')]=undefined;loggerPredictive[_0x85db('0x8f')](_0x85db('0x1c4'),_0x85db('0x1c5'));}if(!_['isUndefined'](_0x26948e[_0x85db('0x8a')])){loggerPredictive[_0x85db('0x8f')](_0x85db('0x1c4'),_0x85db('0x1c6'));clearInterval(_0x26948e[_0x85db('0x8a')]);_0x26948e['handlePredictive']=undefined;}_0x26948e[_0x85db('0x27')]=moment()[_0x85db('0x73')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x85db('0x78')](_0x26948e['name'],'collection\x20data\x20in\x20progressive\x20at',_0x26948e['startProgressive']);this[_0x85db('0x151')](_0x26948e,0x1);}else if(ifInterval(_0x26948e[_0x85db('0x1c7')],_0x26948e[_0x85db('0x27')])){this['handlePower'](_0x26948e,0x1);loggerPredictiveCalls[_0x85db('0x78')](_0x85db('0x1c8'),_0x26948e[_0x85db('0x27')],_0x26948e[_0x85db('0x3c')]);_0x26948e['erlangCalls']=0x0;_0x26948e['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x4520af<_0x49fc8e&&_0x26948e[_0x85db('0x1c9')]===_0x85db('0x1ca')){freeVariablesPredictive(_0x26948e);loggerPredictive[_0x85db('0x78')](_0x85db('0x1cb'),_0x85db('0x1cc'),_0x49fc8e,_0x85db('0x27'),_0x26948e[_0x85db('0x3c')]);}else if(_0x2821b8<_0x26948e['predictiveIntervalErlangCallsDroppedCalls']&&_0x26948e['dialPredictiveOptimization']===_0x85db('0x1ca')){freeVariablesPredictive(_0x26948e);loggerPredictive[_0x85db('0x78')]('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x85db('0x1cd'),_0x2821b8,_0x85db('0x1ce'),_0x26948e['predictiveIntervalErlangCallsDroppedCalls'],_0x85db('0x27'),_0x26948e[_0x85db('0x3c')]);}else if(!ifInterval(_0x26948e[_0x85db('0x1c7')],_0x26948e[_0x85db('0x27')])&&_[_0x85db('0x3b')](_0x26948e[_0x85db('0x26')])&&!_[_0x85db('0x3b')](_0x26948e[_0x85db('0x27')])){_0x26948e[_0x85db('0x26')]=moment()['format'](_0x85db('0xfa'));loggerPredictive['info'](_0x26948e[_0x85db('0x3c')],_0x85db('0x1cf'),_0x26948e['startPredictive']);this[_0x85db('0xb7')](_0x26948e[_0x85db('0x1c7')])[_0x85db('0xb2')](this['getDataPredictive'](_0x26948e))['then'](mergeDataErlangB(_0x26948e))['then'](this[_0x85db('0x1d0')](_0x26948e))[_0x85db('0xac')](loggerCatchPredictive(_0x85db('0x1d1'),_0x26948e));}else if(!ifInterval(_0x26948e[_0x85db('0x1c7')],_0x26948e[_0x85db('0x26')])){_0x26948e['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x26948e[_0x85db('0x26')]=moment()[_0x85db('0x73')](_0x85db('0xfa'));loggerPredictive[_0x85db('0x78')](_0x26948e[_0x85db('0x3c')],_0x85db('0x1d2'),_0x26948e[_0x85db('0x26')]);clearInterval(_0x26948e[_0x85db('0x8a')]);_0x26948e[_0x85db('0x8a')]=undefined;this[_0x85db('0xb7')](_0x26948e[_0x85db('0x1c7')])['then'](this[_0x85db('0x1d3')](_0x26948e))[_0x85db('0xb2')](mergeDataErlangB(_0x26948e))[_0x85db('0xb2')](this['startMethodPredictive'](_0x26948e))['catch'](loggerCatchPredictive(_0x85db('0x1d4'),_0x26948e));}else if(_0x26948e['predictiveIntervalAvailable']&&_0x1f5bda<_0x26948e[_0x85db('0x6a')]-_0x25ac0c){freeVariablesPredictive(_0x26948e);loggerPredictive[_0x85db('0x78')](_0x26948e[_0x85db('0x3c')],_0x85db('0x1d5'),_0x1f5bda,_0x85db('0x1d6'),_0x26948e[_0x85db('0x6a')],'-',_0x25ac0c,'=',_0x26948e[_0x85db('0x6a')]-_0x25ac0c,')');}else if(_0x26948e[_0x85db('0x6a')]&&_0x1f5bda>_0x26948e[_0x85db('0x6a')]+_0x511183){freeVariablesPredictive(_0x26948e);loggerPredictive[_0x85db('0x78')](_0x26948e[_0x85db('0x3c')],_0x85db('0x1d5'),_0x1f5bda,_0x85db('0x1d7'),_0x26948e[_0x85db('0x6a')],'+',_0x511183,'=',_0x26948e['predictiveIntervalAvailable']+_0x511183,')');}};Dialer[_0x85db('0x18')]['getDataPredictive']=function(_0x2d1b48){var _0x47647f=this;return function(_0x5e86a1){return new BPromise(function(_0x9b1b0f,_0x2ecf34){_[_0x85db('0x128')](_0x2d1b48,_0x5e86a1[0x0]);if(checkGetDataPredictive(_0x5e86a1[0x0])){var _0x3de7f5=_0x2d1b48['predictiveIntervalAvailable']=_0x2d1b48[_0x85db('0x9d')]+_0x2d1b48[_0x85db('0x9e')];var _0xc863df=_0x2d1b48[_0x85db('0x1c7')]*0x3c;var _0x1d6c69=_0x5e86a1[0x0][_0x85db('0x63')]+_0x5e86a1[0x0][_0x85db('0x62')];var _0x3da01c=(_0x5e86a1[0x0]['predictiveIntervalAnsweredCalls']+_0x5e86a1[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x5e86a1[0x0][_0x85db('0x7d')])/_0x5e86a1[0x0][_0x85db('0x6b')];_0x2d1b48['predictiveIntervalHitRate']=_0x3da01c>0x0?_0x3da01c:0x1;switch(_0x2d1b48[_0x85db('0x1c9')]){case _0x85db('0x1ca'):var _0x2dfb35=_0x2d1b48['dialPredictiveOptimizationPercentage']/0x64;return _0x47647f[_0x85db('0x1d8')](_0x3de7f5,_0xc863df,_0x1d6c69,_0x3da01c,_0x2dfb35)[_0x85db('0xb2')](function(_0x5c1e06){return _0x9b1b0f(_0x5c1e06);});case _0x85db('0x1d9'):var _0x45a726=_0x2d1b48['dialPredictiveOptimizationPercentage']/0x64;return _0x47647f[_0x85db('0x1da')](_0x3de7f5,_0xc863df,_0x1d6c69,_0x3da01c,_0x45a726)['then'](function(_0x5966e9){return _0x9b1b0f(_0x5966e9);});default:return _0x2ecf34(msgResponse(_0x85db('0x1db'),_0x85db('0x13e'),_0x85db('0x1dc')));}}else{return _0x2ecf34(msgResponse(_0x85db('0x1db'),_0x85db('0x13e'),_0x85db('0x1dd')));}});};};Dialer[_0x85db('0x18')][_0x85db('0x1de')]=function(_0x4cc9a0){var _0x1ee3bd=this;return function(_0x403cce){return new BPromise(function(_0x3b90c7,_0x497fae){_[_0x85db('0x128')](_0x4cc9a0,_0x403cce[0x0]);if(checkGetDataPredictive(_0x403cce[0x0])){loggerPredictive['info'](JSON[_0x85db('0x47')](_0x403cce[0x0]));if(_0x4cc9a0[_0x85db('0x1c9')]==='dropRate'){return _0x1ee3bd[_0x85db('0xc3')](_0x4cc9a0['id'])[_0x85db('0xb2')](function(_0x4ba99e){var _0xdf3e57=_0x4cc9a0[_0x85db('0x4e')]-_0x4ba99e[0x0][_0x85db('0x1df')];var _0x23971b=_0x4cc9a0[_0x85db('0x1c7')]*0x3c;var _0x1cdc9e=_0x403cce[0x0][_0x85db('0x63')]+_0x403cce[0x0][_0x85db('0x62')];var _0x3c6816=(_0x403cce[0x0][_0x85db('0x61')]+_0x403cce[0x0][_0x85db('0x64')]+_0x403cce[0x0][_0x85db('0x7d')])/_0x403cce[0x0][_0x85db('0x6b')];var _0x390cfc=_0x4cc9a0[_0x85db('0x1e0')]/0x64;_0x4cc9a0[_0x85db('0x69')]=_0x4ba99e[0x0][_0x85db('0x1df')]||0x0;_0x4cc9a0[_0x85db('0x67')]=_0x3c6816>0x0?_0x3c6816:0x1;return _0x1ee3bd[_0x85db('0x1d8')](_0xdf3e57,_0x23971b,_0x1cdc9e,_0x3c6816,_0x390cfc);})[_0x85db('0xb2')](function(_0x589a4f){return _0x3b90c7(_0x589a4f);})[_0x85db('0xac')](function(_0x5b219f){return _0x497fae(msgResponse(_0x85db('0x1e1'),_0x85db('0x13e'),JSON['stringify'](_0x5b219f)));});}if(_0x4cc9a0['dialPredictiveOptimization']===_0x85db('0x1d9')){return _0x1ee3bd[_0x85db('0xc3')](_0x4cc9a0['id'])[_0x85db('0xb2')](function(_0x1b332f){var _0x268a66=_0x4cc9a0[_0x85db('0x4e')]-_0x1b332f[0x0][_0x85db('0x1df')];var _0x49e929=_0x4cc9a0['dialPredictiveInterval']*0x3c;var _0x2dc674=_0x403cce[0x0][_0x85db('0x63')]+_0x403cce[0x0][_0x85db('0x62')];var _0x42b4d1=(_0x403cce[0x0][_0x85db('0x61')]+_0x403cce[0x0][_0x85db('0x64')]+_0x403cce[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x403cce[0x0][_0x85db('0x6b')];var _0x3beb08=_0x4cc9a0[_0x85db('0x1e0')]/0x64;_0x4cc9a0[_0x85db('0x69')]=_0x1b332f[0x0][_0x85db('0x1df')]||0x0;_0x4cc9a0[_0x85db('0x67')]=_0x42b4d1>0x0?_0x42b4d1:0x1;return _0x1ee3bd[_0x85db('0x1da')](_0x268a66,_0x49e929,_0x2dc674,_0x42b4d1,_0x3beb08);})[_0x85db('0xb2')](function(_0x3eebb2){return _0x3b90c7(_0x3eebb2);})[_0x85db('0xac')](function(_0x79bf6c){return _0x497fae(msgResponse(_0x85db('0x1e1'),_0x85db('0x13e'),JSON[_0x85db('0x47')](_0x79bf6c)));});}}else{return _0x497fae(msgResponse('[getDataPredictive]',_0x85db('0x13e'),'check\x20failure'));}});};};Dialer[_0x85db('0x18')][_0x85db('0x1d0')]=function(_0x35fafb){var _0x230f52=this;return function(){var _0x57acce=0x0;var _0x38b78c=Math['floor'](_0x35fafb[_0x85db('0x6d')]*0x3e8);if(_0x38b78c>0x0){_0x38b78c=_0x38b78c<0x64?0x64:_0x38b78c;loggerPredictive[_0x85db('0x78')](_0x35fafb[_0x85db('0x3c')],_0x85db('0x1e2'),_0x38b78c,_0x85db('0x48'));_0x35fafb[_0x85db('0x8a')]=setInterval(function(){_0x230f52[_0x85db('0x8a')](_0x35fafb);loggerPredictiveCalls['info'](_0x85db('0x1e3'),_0x57acce+=0x1);},_0x38b78c);}else{loggerPredictive[_0x85db('0x78')](_0x35fafb[_0x85db('0x3c')],_0x85db('0x1e4'));}};};Dialer['prototype'][_0x85db('0x1e5')]=function(_0x44f09b,_0x49240f){var _0x56916a=this;return function(_0x108e12){if(_[_0x85db('0x44')](_0x108e12)){if(_[_0x85db('0xa8')](_0x49240f[_0x85db('0xd1')])||!_0x49240f['recallme']){if(_0x44f09b[_0x85db('0x55')]==='booked'){_0x44f09b['queueStatusComplete']=_[_0x85db('0x3b')](_0x44f09b[_0x85db('0x12c')])?!![]:_0x44f09b['queueStatusComplete'];var _0xbf3d73=uuid['v4']();_0x56916a[_0x85db('0x23')][_0xbf3d73]=new Action(_0x44f09b,_0x49240f,_0xbf3d73);loggerBooked[_0x85db('0x78')](_0x85db('0x1e6'),_0xbf3d73,_0x85db('0x1e7'),JSON[_0x85db('0x47')](_0x44f09b['queueStatusComplete']),'Queue:\x20',_0x44f09b[_0x85db('0x3c')]);if(_0x44f09b[_0x85db('0x12c')]){_0x44f09b['queueStatusComplete']=![];_0x56916a[_0x85db('0x29')][_0x56916a['actions'][_0xbf3d73][_0x85db('0xaf')]]=[];ami['Action']({'actionid':_0xbf3d73,'action':'queuestatus','queue':_0x44f09b[_0x85db('0x3c')]})['catch'](function(){_0x56916a['updateOriginated'](_0x44f09b);_0x56916a[_0x85db('0xba')]({'active':![],'ContactId':_0x56916a[_0x85db('0x23')][_0xbf3d73]['ContactId'],'ListId':_0x56916a[_0x85db('0x23')][_0xbf3d73]['ListId'],'VoiceQueueId':_0x56916a[_0x85db('0x23')][_0xbf3d73]['VoiceQueueId']||undefined,'CampaignId':_0x56916a[_0x85db('0x23')][_0xbf3d73][_0x85db('0xd3')]||undefined})[_0x85db('0xac')](loggerCatch(_0x85db('0x1e8')));delete _0x56916a[_0x85db('0x23')][_0xbf3d73];});}else{loggerBooked[_0x85db('0x78')](_0x85db('0x1e9'),JSON['stringify'](_0x44f09b[_0x85db('0x12c')]),_0x85db('0x1ea'),_0x44f09b[_0x85db('0x3c')]);_0x56916a[_0x85db('0xae')](_0x44f09b);_0x56916a[_0x85db('0xba')]({'active':![],'ContactId':_0x56916a[_0x85db('0x23')][_0xbf3d73][_0x85db('0xcf')],'ListId':_0x56916a[_0x85db('0x23')][_0xbf3d73][_0x85db('0xd0')],'VoiceQueueId':_0x56916a[_0x85db('0x23')][_0xbf3d73]['VoiceQueueId']||undefined,'CampaignId':_0x56916a['actions'][_0xbf3d73][_0x85db('0xd3')]||undefined})[_0x85db('0xac')](loggerCatch(_0x85db('0x1e8')));delete _0x56916a['actions'][_0xbf3d73];}}else{return _0x56916a['actionOriginate'](_0x44f09b,_0x49240f);}}else{if(getDiff(_0x49240f[_0x85db('0x1eb')])<_0x44f09b[_0x85db('0x1ec')]*0x3c){if(_0x49240f['Agent']&&!_0x49240f[_0x85db('0x1ed')][_0x85db('0x1ee')]){_0x56916a[_0x85db('0x1c')][_0x85db('0x133')](_0x49240f['id'])[_0x85db('0x12e')](function(){_0x56916a['updateOriginated'](_0x44f09b);});}else{_0x56916a['unlockContact']({'active':![]},_0x49240f['id'],0x1)[_0x85db('0x12e')](function(){_0x56916a['updateOriginated'](_0x44f09b);});}}else{_0x44f09b['outboundReCallsDay']+=0x1;_0x56916a[_0x85db('0xae')](_0x44f09b);if(_0x44f09b[_0x85db('0x1ef')]){_0x56916a[_0x85db('0xba')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x49240f[_0x85db('0xcf')],'ListId':_0x49240f['ListId'],'VoiceQueueId':_0x49240f[_0x85db('0xd2')]||undefined,'CampaignId':_0x49240f['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x56916a[_0x85db('0xc7')](createObjHistory(_0x44f09b,_0x49240f,_0x85db('0x1f0'),0x17,_0x85db('0x1f1')))[_0x85db('0xac')](loggerCatch(_0x85db('0x1f2')));}else{_0x56916a['saveInDb'](createObjHistory(_0x44f09b,_0x49240f,_0x85db('0x1f3'),0x16,_0x85db('0x1f4')),'[Originate][HistoryRecallClose][historyCatch]',_0x85db('0x1f5'));}}}}else{_0x44f09b['outboundBlacklistCallsDay']+=0x1;_0x56916a[_0x85db('0xcd')](createObjHistory(_0x44f09b,_0x49240f,_0x85db('0x1f6'),0xd,_0x85db('0x1f7')),_0x85db('0x1f8'),_0x85db('0x1f9'));throw _0x85db('0x1fa');}};};Dialer[_0x85db('0x18')][_0x85db('0x156')]=function(_0x4ae33d){var _0x1cc78d=this;var _0x27a33c=_0x4ae33d[_0x85db('0x1fb')]-_0x4ae33d['originated']-_0x4ae33d['temp'];emitCampaignSummary(_0x4ae33d);if(_0x27a33c>0x0){if(_0x27a33c>this[_0x85db('0x21')]){_0x27a33c=this[_0x85db('0x21')];}_0x4ae33d[_0x85db('0xbf')]+=_0x27a33c;this[_0x85db('0xc1')](_0x4ae33d['id'],_0x27a33c,_0x4ae33d[_0x85db('0x1fc')],_0x4ae33d)[_0x85db('0xb2')](function(_0x110401){_0x4ae33d[_0x85db('0xbf')]-=_0x27a33c;_0x4ae33d[_0x85db('0xbf')]=_0x4ae33d[_0x85db('0xbf')]>0x0?_0x4ae33d[_0x85db('0xbf')]:0x0;if(!checkContactEmpty(_0x110401)){_0x4ae33d['message']=_0x85db('0x9a');logger[_0x85db('0x78')](_0x85db('0x1fd')+_0x4ae33d[_0x85db('0x3c')]);}else{_0x4ae33d[_0x85db('0x93')]+=_0x110401[_0x85db('0x92')];_0x4ae33d[_0x85db('0x3d')]=_0x85db('0x1fe');for(var _0x98e302=0x0;_0x98e302<_0x110401[_0x85db('0x92')];_0x98e302+=0x1){_0x4ae33d[_0x85db('0x1ff')]+=0x1;if(_['isNil'](_0x110401[_0x98e302])||_['isNil'](_0x110401[_0x98e302]['Contact'])||_[_0x85db('0xa8')](_0x110401[_0x98e302][_0x85db('0x165')]['phone'])){_0x1cc78d[_0x85db('0xcc')]('[actionOriginate]\x20',_0x4ae33d,_0x110401[_0x98e302]);}else{_0x1cc78d[_0x85db('0xb5')](_[_0x85db('0xce')](_0x110401[_0x98e302],[_0x85db('0xd3'),_0x85db('0x200')]))[_0x85db('0xb2')](_0x1cc78d[_0x85db('0x1e5')](_0x4ae33d,_0x110401[_0x98e302]))[_0x85db('0xac')](_0x1cc78d[_0x85db('0xcb')](_0x85db('0x201'),_0x4ae33d));}}}})[_0x85db('0xac')](loggerGetContactDialer(_0x85db('0x202'),_0x4ae33d,_0x27a33c));}};Dialer[_0x85db('0x18')][_0x85db('0x151')]=function(_0x3dd2e2,_0x13ba35){var _0x21887f=this;var _0xdfd1cc=[];var _0x531f2a=_0x13ba35>=0x1?_0x13ba35:0x1;if(_0x3dd2e2[_0x85db('0x55')]===_0x85db('0x8')){_0x531f2a=0x1;}var _0x50c02d=Math[_0x85db('0x1c3')](_0x3dd2e2[_0x85db('0x9e')]*_0x531f2a)-_0x3dd2e2[_0x85db('0x93')]-_0x3dd2e2['temp'];emitVoiceQueueSummary(_0x3dd2e2);if(_0x3dd2e2[_0x85db('0x203')]>0x0){var _0x3e5183=_0x3dd2e2[_0x85db('0x203')]-_0x3dd2e2['originated']-_0x3dd2e2[_0x85db('0x9d')]-_0x3dd2e2[_0x85db('0xbf')]-_0x3dd2e2[_0x85db('0x4f')];if(_0x50c02d>_0x3e5183){_0x50c02d=_0x3e5183;}}if(_0x50c02d>0x0){if(_0x3dd2e2[_0x85db('0x55')]==='booked'){_0x50c02d=0x1;}if(_0x50c02d>this[_0x85db('0x21')]){_0x50c02d=this[_0x85db('0x21')];}_0x3dd2e2['temp']+=_0x50c02d;for(var _0x52d123 in this[_0x85db('0x1f')]){if(typeof this[_0x85db('0x1f')][_0x52d123]!=='undefined'){if(this['agents'][_0x52d123][_0x85db('0xa3')]==='not_inuse'&&this[_0x85db('0x1f')][_0x52d123]['status']===_0x85db('0xd8')){_0xdfd1cc[_0x85db('0x127')](this[_0x85db('0x1f')][_0x52d123]['id']);}}}this['getContactDialer'](_0x3dd2e2['id'],_0xdfd1cc,_0x50c02d,_0x3dd2e2['dialOrderByScheduledAt'],_0x3dd2e2)[_0x85db('0xb2')](function(_0x512ae0){_0x3dd2e2[_0x85db('0xbf')]-=_0x50c02d;_0x3dd2e2['temp']=_0x3dd2e2[_0x85db('0xbf')]>0x0?_0x3dd2e2['temp']:0x0;if(!checkContactEmpty(_0x512ae0)){_0x21887f['countReScheduled'](_0x3dd2e2)[_0x85db('0xb2')](sendMessageReschedule(_0x3dd2e2))[_0x85db('0xac')](loggerCatch(_0x85db('0x204')));}else{_0x3dd2e2[_0x85db('0x93')]+=_0x512ae0['length'];_0x3dd2e2[_0x85db('0x3d')]=_0x3dd2e2[_0x85db('0x55')]===_0x85db('0x8')?_0x85db('0x16d'):_0x85db('0x1fe');for(var _0x466d12=0x0;_0x466d12<_0x512ae0[_0x85db('0x92')];_0x466d12+=0x1){if(_['isNil'](_0x512ae0[_0x466d12])||_[_0x85db('0xa8')](_0x512ae0[_0x466d12][_0x85db('0x165')])||_['isNil'](_0x512ae0[_0x466d12][_0x85db('0x165')][_0x85db('0x166')])){_0x21887f[_0x85db('0xcc')]('[actionOriginate]\x20',_0x3dd2e2,_0x512ae0[_0x466d12]);}else{_0x21887f['checkIsBlackList'](_[_0x85db('0xce')](_0x512ae0[_0x466d12],[_0x85db('0xd2'),_0x85db('0x200')]))[_0x85db('0xb2')](_0x21887f[_0x85db('0x1e5')](_0x3dd2e2,_0x512ae0[_0x466d12]))[_0x85db('0xac')](_0x21887f[_0x85db('0xcb')]('[actionOriginate]\x20',_0x3dd2e2));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x3dd2e2,_0x50c02d));}};Dialer['prototype'][_0x85db('0x8a')]=function(_0x17213e){if(_0x17213e['dialLimitQueue']>0x0){var _0x2d2987=_0x17213e[_0x85db('0x203')]-_0x17213e['originated']-_0x17213e[_0x85db('0x9d')];if(_0x2d2987>0x0){this[_0x85db('0x205')](_0x17213e);}else{loggerPredictiveCalls[_0x85db('0x78')]('[handlePredictive][limitChannel]');}}else{this[_0x85db('0x205')](_0x17213e);}};Dialer[_0x85db('0x18')][_0x85db('0x205')]=function(_0x41dc5d){var _0x1f3f15=this;var _0x7f010b=[];_0x41dc5d[_0x85db('0x93')]+=0x1;for(var _0x45038b in this[_0x85db('0x1f')]){if(typeof this[_0x85db('0x1f')][_0x45038b]!=='undefined'){if(this['agents'][_0x45038b][_0x85db('0xa3')]===_0x85db('0x206')&&this[_0x85db('0x1f')][_0x45038b][_0x85db('0xaa')]===_0x85db('0xd8')){_0x7f010b[_0x85db('0x127')](this[_0x85db('0x1f')][_0x45038b]['id']);}}}this['getContactDialer'](_0x41dc5d['id'],_0x7f010b,0x1,_0x41dc5d[_0x85db('0x1fc')],_0x41dc5d)[_0x85db('0xb2')](function(_0x350544){if(!checkContactEmpty(_0x350544)){checkContactLowerLimitOriginate(_0x41dc5d,0x1,0x0);_0x1f3f15[_0x85db('0xb0')](_0x41dc5d)[_0x85db('0xb2')](sendMessageReschedule(_0x41dc5d))[_0x85db('0xac')](loggerCatch(_0x85db('0x204')));}else{_0x41dc5d[_0x85db('0x3d')]=_0x85db('0x1fe');if(_['isNil'](_0x350544[0x0])||_['isNil'](_0x350544[0x0]['Contact'])||_[_0x85db('0xa8')](_0x350544[0x0]['Contact'][_0x85db('0x166')])){_0x1f3f15[_0x85db('0xcc')](_0x85db('0x207'),_0x41dc5d,_0x350544[0x0]);}else{_0x1f3f15[_0x85db('0xb3')](_['pick'](_0x350544[0x0],[_0x85db('0xd2'),_0x85db('0x200')]))['then'](_0x1f3f15[_0x85db('0x1e5')](_0x41dc5d,_0x350544[0x0]))[_0x85db('0xac')](_0x1f3f15['loggerHandler'](_0x85db('0x208'),_0x41dc5d));}}})[_0x85db('0xac')](loggerGetContactDialer('[getContactDialerPredictive]',_0x41dc5d,0x1));emitVoiceQueueSummary(_0x41dc5d);};Dialer[_0x85db('0x18')][_0x85db('0x1d8')]=function(_0x310523,_0x369b70,_0x5dca56,_0x5ac24e,_0x187585,_0xb6e49e){loggerPredictive[_0x85db('0x78')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x85db('0x78')](_0x85db('0x209'),_0x310523);loggerPredictive[_0x85db('0x78')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x369b70);loggerPredictive[_0x85db('0x78')](_0x85db('0x20a'),_0x5dca56);loggerPredictive[_0x85db('0x78')](_0x85db('0x20b'),_0x5ac24e);loggerPredictive['info'](_0x85db('0x20c'),_0x187585);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x16d33f,_0x5343ec){if(_0x310523<=0x0||isNaN(_0x310523)){return _0x5343ec(msgResponse(_0x85db('0x20d'),_0x85db('0x46'),_0x85db('0x20e')+_0x310523));}if(_0x5dca56<=0x0||isNaN(_0x5dca56)){return _0x5343ec(msgResponse(_0x85db('0x20d'),_0x85db('0x46'),'Ts\x20=\x20'+_0x5dca56));}if(_0x5ac24e<=0x0||isNaN(_0x5ac24e)){return _0x5343ec(msgResponse('[abandonmentRate]','Error',_0x85db('0x20f')+_0x5ac24e));}if(_0x369b70<=0x0||isNaN(_0x369b70)){return _0x5343ec(msgResponse('[abandonmentRate]',_0x85db('0x46'),_0x85db('0x210')+_0x369b70));}if(_0x187585<=0x0||isNaN(_0x187585)){return _0x5343ec(msgResponse(_0x85db('0x20d'),_0x85db('0x46'),'Amax\x20=\x20'+_0x187585));}_0xb6e49e=_0xb6e49e||0x0;var _0x4631fa=0x1/_0x5dca56;var _0x45bfe0=0x0;var _0x3e1646=0x0;var _0x4da4ae=0x0;var _0x466ee8=0x0;for(var _0x201030=0x0;_0x4da4ae<_0x187585;_0x201030+=0x1){_0x3e1646=_0x201030/_0x369b70;_0x45bfe0=(_0x5ac24e*_0x3e1646+_0xb6e49e)/_0x4631fa;_0x4da4ae=erlangb(_0x45bfe0,_0x310523);_0x466ee8=_0x45bfe0/_0x310523*(0x1-erlangb(_0x45bfe0,_0x310523));}return _0x16d33f({'erlangCalls':_0x201030,'erlangCallToSecond':_0x369b70/_0x201030,'erlangAbandonmentRate':_0x4da4ae,'erlangBusyFactor':_0x466ee8});});};Dialer['prototype']['busyFactor']=function(_0x30468c,_0x5dd10d,_0x2c83cd,_0x2e1453,_0x2b2482,_0x1cb2d2){loggerPredictive[_0x85db('0x78')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x85db('0x78')](_0x85db('0x209'),_0x30468c);loggerPredictive[_0x85db('0x78')](_0x85db('0x211'),_0x5dd10d);loggerPredictive['info']('Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2c83cd);loggerPredictive['info']('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2e1453);loggerPredictive[_0x85db('0x78')](_0x85db('0x212'),_0x2b2482);loggerPredictive[_0x85db('0x78')](_0x85db('0x80'));return new BPromise(function(_0x4390cc,_0x3263cd){if(_0x30468c<=0x0||isNaN(_0x30468c)){return _0x3263cd(msgResponse(_0x85db('0x213'),'Error',_0x85db('0x20e')+_0x30468c));}if(_0x2c83cd<=0x0||isNaN(_0x2c83cd)){return _0x3263cd(msgResponse(_0x85db('0x213'),_0x85db('0x46'),_0x85db('0x214')+_0x2c83cd));}if(_0x2e1453<=0x0||isNaN(_0x2e1453)){return _0x3263cd(msgResponse(_0x85db('0x213'),_0x85db('0x46'),_0x85db('0x20f')+_0x2e1453));}if(_0x5dd10d<=0x0||isNaN(_0x5dd10d)){return _0x3263cd(msgResponse('[busyFactor]',_0x85db('0x46'),_0x85db('0x210')+_0x5dd10d));}if(_0x2b2482<=0x0||isNaN(_0x2b2482)){return _0x3263cd(msgResponse(_0x85db('0x213'),_0x85db('0x46'),_0x85db('0x215')+_0x2b2482));}_0x1cb2d2=_0x1cb2d2||0x0;var _0x2d2582=0x1/_0x2c83cd;var _0x3a596f=0x0;var _0x3475c5=0x0;var _0x27ef74=0x0;var _0x237faf=0x0;for(var _0x1065c7=0x0;_0x237faf<_0x2b2482;_0x1065c7+=0x1){_0x3475c5=_0x1065c7/_0x5dd10d;_0x3a596f=(_0x2e1453*_0x3475c5+_0x1cb2d2)/_0x2d2582;_0x27ef74=erlangb(_0x3a596f,_0x30468c);_0x237faf=_0x3a596f/_0x30468c*(0x1-erlangb(_0x3a596f,_0x30468c));}return _0x4390cc({'erlangCalls':_0x1065c7,'erlangCallToSecond':_0x5dd10d/_0x1065c7,'erlangAbandonmentRate':_0x27ef74,'erlangBusyFactor':_0x237faf});});};module[_0x85db('0x216')]=Dialer;
\ No newline at end of file
+var _0x4a47=['replace','random','match','actionOriginate','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','xcally-motion-dialer','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-CAMPAIGNID','tags','createdAt','updatedAt','XMD-','toUpper','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','syncOriginateResponse','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialAbandonedMaxRetry','[rescheduleContact][Abandoned]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','reason\x208\x20congestion','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','Global','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalAvailable','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[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','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','[CatchErlangB]','outboundQueuePauses','floor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','Blacklist','inBlackList','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','dialOrderByScheduledAt','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\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]','Error','p\x20=\x20','interval\x20=\x20','Amax\x20=\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','[busyFactor]','m\x20=\x20','exports','util','lodash','bluebird','uuid','moment','ioredis','../../../config/environment/','../../../config/logger','booked','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','./action','./history','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','startProgressive','ivrOriginated','queueBooked','queueBookedRR','syncAgentConnect','syncQueueCallerAbandon','bind','originateresponse','agentcomplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','syncQueueStatusComplete','loopCampaigns','isUndefined','NOT_ACTIVE','name','\x20NOT\x20Active','Interval','message','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','stringify','milliseconds','diff','emit','type','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','unmanaged','abandoned','waiting','dialMethod','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','Trunk','callerid','md5','format','voice_queue:save','ivr','campaign:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','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','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','seconds','clearing\x20variable\x20start\x20predictive','handlePredictive','outbound','string','\x22%s\x22\x20<%s>','error','inspect','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','state','statedesc','endtime','clearZombieChannels','[uniqueid]','[actions]','sequence','isNil','Action','status','channel','catch','No\x20such\x20channel','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','temp','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','updateOriginated','[updateOriginated]\x20object\x20originated\x20is\x20negative','emptyContact','notFound','saveInDb','pick','ContactId','ListId','VoiceQueueId','CampaignId','[emptyContact]','isSuccess','Success','isTrunkReachable','active','SIP/%s','unmonitored','variable','exten','HANGUP','uniqueid','outboundAnswerCallsDay','buildObj','amd','[syncHangupInAMD]','dialAMDActive','value','MACHINE','Machine','membername','AMD','countmachineretry','countglobal','custom:amd','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncAgentComplete][createHistory][0]','countabandonedretry','countagentrejectretry','dialMachineMaxRetry','createStateFinal','add','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','ivrAnswerCallsDay','dialQueueProject','AnswerAGI','cause-txt','Unknow','[syncHangupIvr][createHistory]','[syncHangupIvr]','reason','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','dropreason','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','actions','syncQueueMember','actionid','strategy','locked','paused','stateinterface','push','merge','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','idHopper','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','power','handlePower','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','syncQueueSummary','dialActive','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow'];(function(_0xfcfe92,_0x14ea66){var _0x166ba1=function(_0x45f01a){while(--_0x45f01a){_0xfcfe92['push'](_0xfcfe92['shift']());}};_0x166ba1(++_0x14ea66);}(_0x4a47,0xb5));var _0x74a4=function(_0x26474a,_0x3cfcfd){_0x26474a=_0x26474a-0x0;var _0x32e0e0=_0x4a47[_0x26474a];return _0x32e0e0;};'use strict';var util=require(_0x74a4('0x0'));var _=require(_0x74a4('0x1'));var BPromise=require(_0x74a4('0x2'));var uuid=require(_0x74a4('0x3'));var moment=require(_0x74a4('0x4'));var rr=require('rr');var md5=require('md5');var Redis=require(_0x74a4('0x5'));var ut=require('../preview/util/util');var config=require(_0x74a4('0x6'));var logger=require(_0x74a4('0x7'))('dialer');var loggerBooked=require(_0x74a4('0x7'))(_0x74a4('0x8'));var loggerPredictive=require(_0x74a4('0x7'))('predictive');var loggerPredictiveCalls=require(_0x74a4('0x7'))('predictiveCalls');var loggerSyncQueueSummary=require(_0x74a4('0x7'))('syncQueueSummary');var ami=require(_0x74a4('0x9'));config[_0x74a4('0xa')]=_[_0x74a4('0xb')](config[_0x74a4('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x74a4('0xc'))(new Redis(config[_0x74a4('0xa')]));var cmHopper=require(_0x74a4('0xd'));var cmHopperHistory=require(_0x74a4('0xe'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x74a4('0xf'));var Action=require(_0x74a4('0x10'));var History=require(_0x74a4('0x11'));var Final=require('./final');var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x74a4('0x12'));var Hangup=require(_0x74a4('0x13'));var ipAgi=process[_0x74a4('0x14')][_0x74a4('0x15')]||_0x74a4('0x16');var strategy={'rrmemory':_0x74a4('0x17'),'roundrobin':_0x74a4('0x18')};var Sequence=function(){};Sequence[_0x74a4('0x19')][_0x74a4('0x1a')]=function(_0xbf6e1e){this[_0x74a4('0x1b')]=this[_0x74a4('0x1b')]?this[_0x74a4('0x1b')][_0x74a4('0x1c')](_0xbf6e1e):_0xbf6e1e();};function Dialer(_0x3d9b8c,_0xa1dd7e){this['sequence']=new Sequence();this[_0x74a4('0x1d')]=_0xa1dd7e;this[_0x74a4('0x1e')]=_0x3d9b8c[_0x74a4('0x1e')];this[_0x74a4('0x1f')]=_0x3d9b8c['campaigns'];this[_0x74a4('0x20')]=_0x3d9b8c[_0x74a4('0x20')];this[_0x74a4('0x21')]=_0x3d9b8c[_0x74a4('0x21')];this['maxNumberOriginate']=config[_0x74a4('0x22')]||0x2;this[_0x74a4('0x23')]={};this['actions']={};this[_0x74a4('0x24')]={};this[_0x74a4('0x25')]={};this['optionPredictive']={};this['startPredictive']={};this[_0x74a4('0x26')]={};this[_0x74a4('0x27')]={};this[_0x74a4('0x28')]={};this[_0x74a4('0x29')]={};ami['on']('agentconnect',this[_0x74a4('0x2a')]['bind'](this));ami['on']('queuecallerabandon',this[_0x74a4('0x2b')][_0x74a4('0x2c')](this));ami['on'](_0x74a4('0x2d'),this['syncOriginateResponse'][_0x74a4('0x2c')](this));ami['on'](_0x74a4('0x2e'),this['syncAgentComplete'][_0x74a4('0x2c')](this));ami['on'](_0x74a4('0x2f'),this['syncQueueSummary'][_0x74a4('0x2c')](this));ami['on'](_0x74a4('0x30'),this[_0x74a4('0x31')]['bind'](this));ami['on'](_0x74a4('0x32'),this[_0x74a4('0x33')][_0x74a4('0x2c')](this));ami['on'](_0x74a4('0x34'),this[_0x74a4('0x35')][_0x74a4('0x2c')](this));ami['on']('queuemember',this['syncQueueMember'][_0x74a4('0x2c')](this));ami['on']('queuestatuscomplete',this[_0x74a4('0x36')]['bind'](this));this[_0x74a4('0x37')]();this['loopClearZombieChannels']();}function isNotNull(_0x5a1dad){return _0x5a1dad!==null&&!_[_0x74a4('0x38')](_0x5a1dad);}function checkIsLoggedIn(_0x376f29,_0x309846){return function(){if(_0x309846<=0x0){_0x376f29['message']='AGENTS_NOT_LOGGED';throw _0x376f29['name']+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x56ffa5){return _0x56ffa5;}function checkIsActive(_0x4c5f49,_0x176610){return function(){if(!isActive(_0x176610)){_0x4c5f49['message']=_0x74a4('0x39');throw _0x4c5f49[_0x74a4('0x3a')]+_0x74a4('0x3b');}};}function checkInterval(_0x5b277a){return function(){if(!isNotNull(_0x5b277a[_0x74a4('0x3c')])){_0x5b277a[_0x74a4('0x3d')]=_0x74a4('0x3e');throw _0x5b277a[_0x74a4('0x3a')]+_0x74a4('0x3f');}if(!isNotNull(_0x5b277a[_0x74a4('0x3c')][_0x74a4('0x40')])){_0x5b277a[_0x74a4('0x3d')]='INTERVAL_IS_NULL';throw _0x5b277a[_0x74a4('0x3a')]+_0x74a4('0x3f');}if(!isNotNull(_['isEmpty'](_0x5b277a[_0x74a4('0x3c')]['Intervals']))){_0x5b277a['message']=_0x74a4('0x3e');throw _0x5b277a[_0x74a4('0x3a')]+_0x74a4('0x3f');}};}function msgResponse(_0x30cd17,_0x1d4e14,_0x431264){return{'action':_0x30cd17,'response':_0x1d4e14,'message':_0x431264,'stack':_0x431264};}function myreject(_0x299179){return function(_0x582eb4){return _0x299179(msgResponse(_0x74a4('0x41'),'Error',JSON[_0x74a4('0x42')](_0x582eb4)));};}function getSeconds(_0x3da4f6,_0x26572e){var _0x5d874c=moment(_0x3da4f6)[_0x74a4('0x43')](0x0);var _0x4ad9f9=moment(_0x26572e)[_0x74a4('0x43')](0x0);return _0x5d874c[_0x74a4('0x44')](_0x4ad9f9,'seconds');}function emit(_0x2d503d,_0x43f44d,_0x461b22){io['to'](_0x2d503d)[_0x74a4('0x45')](_0x43f44d,_0x461b22);}function emitVoiceQueueSummary(_0x1de439){if(_0x1de439[_0x74a4('0x46')]==='outbound'){var _0x46dcc2={'id':_0x1de439['id'],'name':_0x1de439[_0x74a4('0x3a')],'strategy':_0x1de439['strategy'],'answered':_0x1de439[_0x74a4('0x47')],'available':_0x1de439[_0x74a4('0x48')],'loggedIn':_0x1de439[_0x74a4('0x49')],'pTalking':_0x1de439[_0x74a4('0x4a')],'sumBillable':_0x1de439[_0x74a4('0x4b')],'sumDuration':_0x1de439['sumDuration'],'sumHoldTime':_0x1de439[_0x74a4('0x4c')]||0x0,'talking':_0x1de439[_0x74a4('0x4d')],'total':_0x1de439['total'],'type':_0x1de439[_0x74a4('0x46')],'unmanaged':_0x1de439[_0x74a4('0x4e')],'abandoned':_0x1de439[_0x74a4('0x4f')],'waiting':_0x1de439[_0x74a4('0x50')],'loggedInDb':_0x1de439['loggedInDb'],'dialActive':_0x1de439['dialActive'],'dialMethod':_0x1de439[_0x74a4('0x51')],'dialOriginateCallerIdName':_0x1de439['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x1de439['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x1de439[_0x74a4('0x52')],'dialPrefix':_0x1de439[_0x74a4('0x53')],'outboundAnswerAgiCallsDay':_0x1de439[_0x74a4('0x54')],'outboundAnswerCallsDay':_0x1de439['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x1de439[_0x74a4('0x55')],'outboundBusyCallsDay':_0x1de439[_0x74a4('0x56')],'outboundCongestionCallsDay':_0x1de439['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x1de439[_0x74a4('0x57')],'outboundDropCallsDayCallersExit':_0x1de439[_0x74a4('0x58')],'outboundDropCallsDayTimeout':_0x1de439[_0x74a4('0x59')],'outboundNoAnswerCallsDay':_0x1de439[_0x74a4('0x5a')],'outboundNoSuchCallsDay':_0x1de439['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x1de439[_0x74a4('0x5b')],'outboundReCallsDay':_0x1de439[_0x74a4('0x5c')],'outboundRejectCallsDay':_0x1de439['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x1de439[_0x74a4('0x5d')],'predictiveIntervalAnsweredCalls':_0x1de439[_0x74a4('0x5e')],'predictiveIntervalAvgHoldtime':_0x1de439[_0x74a4('0x5f')],'predictiveIntervalAvgTalktime':_0x1de439[_0x74a4('0x60')],'predictiveIntervalDroppedCallsCallersExit':_0x1de439[_0x74a4('0x61')],'predictiveIntervalDroppedCallsTimeout':_0x1de439[_0x74a4('0x62')],'predictiveIntervalErlangCalls':_0x1de439[_0x74a4('0x63')],'predictiveIntervalErlangCallsDroppedCalls':_0x1de439[_0x74a4('0x64')],'predictiveIntervalHitRate':_0x1de439[_0x74a4('0x65')],'predictiveIntervalMultiplicativeFactor':_0x1de439[_0x74a4('0x66')],'predictiveIntervalPauses':_0x1de439[_0x74a4('0x67')],'predictiveIntervalAvailable':_0x1de439['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x1de439[_0x74a4('0x68')],'message':_0x1de439['message'],'originated':_0x1de439[_0x74a4('0x69')],'erlangCalls':_0x1de439[_0x74a4('0x6a')],'erlangCallToSecond':_0x1de439[_0x74a4('0x6b')],'erlangAbandonmentRate':_0x1de439['erlangAbandonmentRate'],'erlangBusyFactor':_0x1de439[_0x74a4('0x6c')],'startPredictive':_0x1de439[_0x74a4('0x6d')],'startProgressive':_0x1de439['startProgressive']};if(_0x1de439[_0x74a4('0x6e')]){_0x46dcc2[_0x74a4('0x6e')]={'id':_0x1de439[_0x74a4('0x6e')]['id'],'name':_0x1de439[_0x74a4('0x6e')][_0x74a4('0x3a')],'active':_0x1de439['Trunk']['active'],'callerid':_0x1de439['Trunk'][_0x74a4('0x6f')]};}if(_0x1de439[_0x74a4('0x3c')]){_0x46dcc2[_0x74a4('0x3c')]={'id':_0x1de439['Interval']['id'],'name':_0x1de439[_0x74a4('0x3c')][_0x74a4('0x3a')]};}var _0x1c0ebf=md5(JSON[_0x74a4('0x42')](_0x46dcc2));if(_0x1de439['md5']!==_0x1c0ebf){_0x1de439[_0x74a4('0x70')]=_0x1c0ebf;emit(util[_0x74a4('0x71')]('voice:queue:%s',_0x46dcc2['name']),_0x74a4('0x72'),_0x46dcc2);}}}function emitCampaignSummary(_0x386c38){if(_0x386c38['type']===_0x74a4('0x73')){emit(util[_0x74a4('0x71')]('campaign:ivr:%s',_0x386c38[_0x74a4('0x3a')]),_0x74a4('0x74'),_0x386c38);}}function checkGetDataPredictive(_0x64ee1d){if(isNotNull(_0x64ee1d)&&!_[_0x74a4('0x75')](_0x64ee1d)){loggerPredictive[_0x74a4('0x76')](_0x74a4('0x77'));loggerPredictive[_0x74a4('0x76')](_0x74a4('0x78'),_0x64ee1d[_0x74a4('0x68')]);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x79'),_0x64ee1d[_0x74a4('0x5e')]);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x7a'),_0x64ee1d['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x74a4('0x76')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x64ee1d[_0x74a4('0x61')]);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x7b'),_0x64ee1d[_0x74a4('0x5f')]);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x7c'),_0x64ee1d[_0x74a4('0x60')]);loggerPredictive[_0x74a4('0x76')]('---------------------------');if(_0x64ee1d[_0x74a4('0x68')]>0x0){if(!_[_0x74a4('0x38')](_0x64ee1d['predictiveIntervalAvgTalktime'])&&_0x64ee1d[_0x74a4('0x60')]>0x0){return!![];}loggerPredictive['info'](_0x74a4('0x7d'));if(!_[_0x74a4('0x38')](_0x64ee1d[_0x74a4('0x5f')])&&_0x64ee1d[_0x74a4('0x5f')]>0x0){return!![];}loggerPredictive[_0x74a4('0x76')](_0x74a4('0x7e'));}else{loggerPredictive[_0x74a4('0x76')]('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x74a4('0x76')](_0x74a4('0x7f'));}return![];}function mergeDataErlangB(_0x4077cd){return function(_0x60dfe2){loggerPredictive[_0x74a4('0x76')]('---------\x20ErlangB\x20---------');loggerPredictive['info']('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x60dfe2['erlangCalls']);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x80'),_0x60dfe2[_0x74a4('0x6b')]);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x81'),_0x60dfe2[_0x74a4('0x82')]);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x83'),_0x60dfe2[_0x74a4('0x6c')]);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x81'),_0x60dfe2[_0x74a4('0x82')]);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x84'));_['merge'](_0x4077cd,_0x60dfe2);};}function getDiff(_0x17df43){var _0x4708a5=moment()['milliseconds'](0x0);var _0x52f5fb=moment(_0x17df43)[_0x74a4('0x43')](0x0);return _0x4708a5['diff'](_0x52f5fb,_0x74a4('0x85'));}function ifInterval(_0x46936c,_0x41d5db){if(_[_0x74a4('0x38')](_0x41d5db)){return![];}return getDiff(_0x41d5db)<_0x46936c*0x3c;}function freeVariablesPredictive(_0x2e07c2){if(isNotNull(_0x2e07c2)){if(!_['isUndefined'](_0x2e07c2['startProgressive'])){_0x2e07c2[_0x74a4('0x26')]=undefined;loggerPredictive['info'](_0x2e07c2[_0x74a4('0x3a')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x74a4('0x38')](_0x2e07c2[_0x74a4('0x6d')])){_0x2e07c2[_0x74a4('0x6d')]=undefined;loggerPredictive[_0x74a4('0x76')](_0x2e07c2[_0x74a4('0x3a')],_0x74a4('0x86'));}if(!_[_0x74a4('0x38')](_0x2e07c2[_0x74a4('0x87')])){clearInterval(_0x2e07c2['handlePredictive']);_0x2e07c2['handlePredictive']=undefined;loggerPredictive['info'](_0x2e07c2['name'],'clearing\x20variable\x20handle\x20predictive');}}}function erlangb(_0x5142d7,_0x1beb18){if(_0x1beb18===0x0){return 0x0;}var _0x2ff38b=0x1;for(var _0xaba4f3=0x1;_0xaba4f3<=_0x1beb18;_0xaba4f3+=0x1){_0x2ff38b=0x1+_0x2ff38b*_0xaba4f3/_0x5142d7;}return 0x1/_0x2ff38b;}function isVoiceQueueOutbound(_0x4972dd){return _0x4972dd===_0x74a4('0x88');}function isNotPreview(_0x256d8e){return _0x256d8e!==_0x74a4('0x1d');}function isCampaignIvr(_0x28ebb2){return _0x28ebb2===_0x74a4('0x73');}function getCallerId(_0x375954,_0x115223,_0x554bc5){if(!_[_0x74a4('0x38')](_0x554bc5)&&typeof _0x554bc5===_0x74a4('0x89')&&!_[_0x74a4('0x75')](_0x554bc5)){if(!_[_0x74a4('0x38')](_0x115223)&&typeof _0x115223===_0x74a4('0x89')&&!_[_0x74a4('0x75')](_0x115223)){return util[_0x74a4('0x71')]('\x22%s\x22\x20<%s>',_0x115223,_0x554bc5);}return util[_0x74a4('0x71')](_0x74a4('0x8a'),_0x554bc5,_0x554bc5);}if(!_[_0x74a4('0x38')](_0x375954)&&typeof _0x375954==='string'&&!_[_0x74a4('0x75')](_0x375954)){return _0x375954;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x50d047,_0x94a50f){return function(_0x292a10){freeVariablesPredictive(_0x94a50f);emitVoiceQueueSummary(_0x94a50f);emitCampaignSummary(_0x94a50f);loggerSyncQueueSummary[_0x74a4('0x8b')](_0x50d047,util[_0x74a4('0x8c')](_0x292a10,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x24d2ef,_0x5b3235){return function(_0x56858b){loggerPredictive[_0x74a4('0x8b')](_0x5b3235[_0x74a4('0x3a')],_0x24d2ef);loggerPredictive[_0x74a4('0x8b')](_0x56858b['stack']);freeVariablesPredictive(_0x5b3235);};}function loggerCatch(_0x290300){return function(_0x3256c6){logger['error'](_0x290300,util[_0x74a4('0x8c')](_0x3256c6,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2ab6e2){return _0x2ab6e2&&!_[_0x74a4('0x38')](_0x2ab6e2)&&_0x2ab6e2[_0x74a4('0x8d')]>0x0;}function decremetOriginate(_0x59b269){if(!_[_0x74a4('0x38')](_0x59b269)&&_0x59b269!==null){if(typeof _0x59b269[_0x74a4('0x69')]!==_0x74a4('0x8e')){if(_0x59b269['originated']>0x0){_0x59b269[_0x74a4('0x69')]-=0x1;}else{logger[_0x74a4('0x8b')](_0x74a4('0x8f'));}}}else{logger['error'](_0x74a4('0x90'));}}function checkContactLowerLimitOriginate(_0x13a613,_0x321cfa,_0x1e6408){if(_0x321cfa>_0x1e6408){for(var _0x4435a3=0x0;_0x4435a3<_0x321cfa-_0x1e6408;_0x4435a3+=0x1){decremetOriginate(_0x13a613);}}}function loggerGetContactDialer(_0x3b2710,_0x337cf2,_0x441d2f){return function(_0xaf7752){checkContactLowerLimitOriginate(_0x337cf2,_0x441d2f,0x0);logger[_0x74a4('0x8b')](_0x3b2710,util[_0x74a4('0x8c')](_0xaf7752,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1292b4){return function(_0x338692){if(isNotNull(_0x338692)&&isNotNull(_0x338692[0x0])){if(_0x338692[0x0][_0x74a4('0x91')]>0x0){_0x1292b4[_0x74a4('0x3d')]=_0x74a4('0x92');logger['info']('[getContactDialer2][ReScheduled]'+_0x1292b4[_0x74a4('0x3a')],_0x338692[0x0][_0x74a4('0x91')],_0x74a4('0x93'));}else{_0x1292b4[_0x74a4('0x3d')]=_0x74a4('0x94');logger[_0x74a4('0x76')](_0x74a4('0x95')+_0x1292b4[_0x74a4('0x3a')]);}}};}function notSendMessagesQueue(_0x11daf3){if(_0x11daf3[_0x74a4('0x96')]){freeVariablesPredictive(_0x11daf3);if(_0x11daf3['originated']===0x0&&_0x11daf3[_0x74a4('0x4d')]===0x0&&_0x11daf3['waiting']===0x0&&(_0x11daf3[_0x74a4('0x4a')]||0x0)===0x0){_0x11daf3['sendMessageOneNotActive']=![];_0x11daf3[_0x74a4('0x48')]=0x0;_0x11daf3[_0x74a4('0x3d')]=_0x74a4('0x39');loggerSyncQueueSummary['error'](_0x74a4('0x97'),_0x11daf3['name'],'is\x20not\x20active');}else{_0x11daf3[_0x74a4('0x3d')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x74a4('0x8b')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x11daf3[_0x74a4('0x3a')],_0x74a4('0x98'));}emitVoiceQueueSummary(_0x11daf3);}}function notSendMessagesCampaign(_0x2f42ad){if(_0x2f42ad[_0x74a4('0x96')]){if(_0x2f42ad[_0x74a4('0x69')]===0x0){_0x2f42ad[_0x74a4('0x96')]=![];_0x2f42ad['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0x74a4('0x8b')](_0x74a4('0x99'),_0x2f42ad['name'],_0x74a4('0x9a'));}else{_0x2f42ad['message']='IS_DISACTIVED';loggerSyncQueueSummary[_0x74a4('0x8b')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x2f42ad[_0x74a4('0x3a')],'is\x20disactive');}emitCampaignSummary(_0x2f42ad);}}function createObjHistory(_0x1c7972,_0x5477ec,_0x1b9dbd,_0x3d20fb,_0xe4823b){_0x1c7972[_0x74a4('0x3d')]=_0x1b9dbd;var _0x4d6a25=new Action(_0x1c7972,_0x5477ec);var _0x281347=new History(_0x4d6a25);_0x281347[_0x74a4('0x9b')]=_0x3d20fb;_0x281347[_0x74a4('0x9c')]=_0xe4823b;_0x281347[_0x74a4('0x9d')]=_0x4d6a25['starttime'];return _0x281347;}Dialer[_0x74a4('0x19')]['loopClearZombieChannels']=function(){var _0x1f3925=this;setInterval(function(){_0x1f3925[_0x74a4('0x9e')](_0x1f3925[_0x74a4('0x25')],_0x74a4('0x9f'));_0x1f3925[_0x74a4('0x9e')](_0x1f3925['actions'],_0x74a4('0xa0'));},0x32c8);};Dialer[_0x74a4('0x19')][_0x74a4('0x9e')]=function(_0x1566f8,_0x165f59){var _0x337d19=this;for(var _0x2e33be in _0x1566f8){if(typeof _0x1566f8[_0x2e33be]!==_0x74a4('0x8e')){this[_0x74a4('0xa1')][_0x74a4('0x1a')](function(){if(!_[_0x74a4('0xa2')](_0x1566f8[_0x2e33be])){return ami[_0x74a4('0xa3')]({'action':_0x74a4('0xa4'),'channel':_0x1566f8[_0x2e33be][_0x74a4('0xa5')]})[_0x74a4('0xa6')](function(_0x2ed6c0){if(_0x2ed6c0[_0x74a4('0x3d')]===_0x74a4('0xa7')){setTimeout(function(){if(_0x1566f8[_0x2e33be]&&_0x1566f8[_0x2e33be][_0x74a4('0x46')]!==_0x74a4('0x73')){_0x337d19['updateOriginated'](_0x337d19[_0x74a4('0x1e')][_0x1566f8[_0x2e33be][_0x74a4('0xa8')]]);logger[_0x74a4('0x8b')]('[Dialer][checkChannel]',_0x165f59,_0x2e33be,_0x1566f8[_0x2e33be][_0x74a4('0xa8')]);delete _0x1566f8[_0x2e33be];}if(_0x1566f8[_0x2e33be]&&_0x1566f8[_0x2e33be][_0x74a4('0x46')]==='ivr'){_0x337d19['updateOriginated'](_0x337d19[_0x74a4('0x1f')][_0x1566f8[_0x2e33be][_0x74a4('0xa8')]]);logger[_0x74a4('0x8b')](_0x74a4('0xa9'),_0x165f59,_0x2e33be,_0x1566f8[_0x2e33be][_0x74a4('0xa8')]);delete _0x1566f8[_0x2e33be];}},0x2328);}});}});}}};Dialer[_0x74a4('0x19')][_0x74a4('0xaa')]=function(_0x54a11c){return BPromise[_0x74a4('0xab')]()[_0x74a4('0xac')](cmHopper['countReScheduled'](_0x54a11c))[_0x74a4('0xa6')](loggerCatch(_0x74a4('0xad')));};Dialer[_0x74a4('0x19')][_0x74a4('0xae')]=function(_0x334eec){return BPromise[_0x74a4('0xab')]()[_0x74a4('0xac')](cmHopperBlack[_0x74a4('0xae')](_0x334eec))[_0x74a4('0xa6')](loggerCatch('[checkIsBlackList]\x20'));};Dialer[_0x74a4('0x19')]['checkIsBlackListIvr']=function(_0x5e2410){return BPromise[_0x74a4('0xab')]()[_0x74a4('0xac')](cmHopperBlack['checkIsBlackListIvr'](_0x5e2410))[_0x74a4('0xa6')](loggerCatch(_0x74a4('0xaf')));};Dialer[_0x74a4('0x19')][_0x74a4('0xb0')]=function(_0x21d836){return BPromise[_0x74a4('0xab')]()[_0x74a4('0xac')](cmHopperHistory[_0x74a4('0xb1')](_0x21d836))['catch'](loggerCatch(_0x74a4('0xb2')));};Dialer['prototype'][_0x74a4('0xb3')]=function(_0x397feb){return BPromise[_0x74a4('0xab')]()[_0x74a4('0xac')](cmHopper[_0x74a4('0xb3')](_0x397feb))['catch'](loggerCatch(_0x74a4('0xb4')));};Dialer[_0x74a4('0x19')][_0x74a4('0xb5')]=function(_0x2d0473,_0x2b0352,_0x199684){return BPromise['resolve']()[_0x74a4('0xac')](cmHopper[_0x74a4('0xb5')](_0x2d0473,_0x2b0352,_0x199684))[_0x74a4('0xa6')](loggerCatch(_0x74a4('0xb6')));};Dialer[_0x74a4('0x19')][_0x74a4('0xb7')]=function(_0x240229,_0x5c0997,_0x5b6b55,_0x1f79f9,_0x28df00){return BPromise[_0x74a4('0xab')]()[_0x74a4('0xac')](cmHopper[_0x74a4('0xb7')](_0x240229,_0x5c0997,_0x5b6b55,_0x1f79f9))[_0x74a4('0xa6')](function(_0x5d11a4){_0x28df00[_0x74a4('0xb8')]-=_0x5b6b55;_0x28df00[_0x74a4('0xb8')]=_0x28df00[_0x74a4('0xb8')]>0x0?_0x28df00[_0x74a4('0xb8')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x5d11a4);});};Dialer[_0x74a4('0x19')][_0x74a4('0xb9')]=function(_0xecc7e8,_0x479996,_0x2ccefb,_0x4d2932){return BPromise['resolve']()[_0x74a4('0xac')](cmHopper['getContactDialerIvr'](_0xecc7e8,_0x479996,_0x2ccefb))['catch'](function(_0x22286d){_0x4d2932['temp']-=_0x479996;_0x4d2932['temp']=_0x4d2932[_0x74a4('0xb8')]>0x0?_0x4d2932['temp']:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x22286d);});};Dialer[_0x74a4('0x19')][_0x74a4('0xba')]=function(_0xaf0478){return BPromise[_0x74a4('0xab')]()[_0x74a4('0xac')](voiceQueueRt[_0x74a4('0xba')](_0xaf0478))[_0x74a4('0xa6')](loggerCatch(_0x74a4('0xbb')));};Dialer[_0x74a4('0x19')][_0x74a4('0xbc')]=function(_0x43f669){return BPromise[_0x74a4('0xab')]()[_0x74a4('0xac')](cmHopper[_0x74a4('0xbc')](_0x43f669))[_0x74a4('0xa6')](loggerCatch(_0x74a4('0xbd')));};Dialer[_0x74a4('0x19')][_0x74a4('0xbe')]=function(_0x2a522c){return BPromise[_0x74a4('0xab')]()[_0x74a4('0xac')](cmHopperHistory[_0x74a4('0xbe')](_0x2a522c))[_0x74a4('0xa6')](loggerCatch(_0x74a4('0xbf')));};Dialer['prototype'][_0x74a4('0xc0')]=function(_0x263036){if(!_['isUndefined'](_0x263036)&&_0x263036!==null){if(typeof _0x263036[_0x74a4('0x69')]!==_0x74a4('0x8e')){if(_0x263036[_0x74a4('0x69')]>0x0){_0x263036[_0x74a4('0x69')]-=0x1;}else{logger[_0x74a4('0x8b')](_0x74a4('0xc1'));}}}else{logger[_0x74a4('0x8b')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype']['loggerHandler']=function(_0x1d099f,_0x1b59f7){var _0x40bbbd=this;return function(_0x4c49a4){_0x40bbbd['updateOriginated'](_0x1b59f7);logger['error'](_0x1d099f,util[_0x74a4('0x8c')](_0x4c49a4,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x74a4('0xc2')]=function(_0x25e0e7,_0x17148e,_0x261e35){var _0x453705={'state':0x19,'statedesc':_0x74a4('0xc3')};this[_0x74a4('0xc0')](_0x17148e);this[_0x74a4('0xc4')](_['merge'](_0x453705,_[_0x74a4('0xc5')](_0x261e35,[_0x74a4('0xc6'),_0x74a4('0xc7'),'UserId',_0x74a4('0xc8'),_0x74a4('0xc9')])),'[emptyContact][createHistory]',_0x74a4('0xca'));logger['error'](_0x25e0e7);};Dialer[_0x74a4('0x19')][_0x74a4('0xcb')]=function(_0x5b3d31){return _0x5b3d31===_0x74a4('0xcc');};Dialer['prototype'][_0x74a4('0xcd')]=function(_0x1d25ef){return!_[_0x74a4('0x38')](_0x1d25ef)&&_0x1d25ef&&!_[_0x74a4('0x38')](_0x1d25ef['name'])&&!_[_0x74a4('0x38')](_0x1d25ef['active'])&&_0x1d25ef[_0x74a4('0xce')]&&(this[_0x74a4('0x21')][util[_0x74a4('0x71')]('SIP/%s',_0x1d25ef['name'])][_0x74a4('0xa4')]==='reachable'||this[_0x74a4('0x21')][util[_0x74a4('0x71')](_0x74a4('0xcf'),_0x1d25ef[_0x74a4('0x3a')])]['status']===_0x74a4('0xd0'));};Dialer['prototype'][_0x74a4('0xc4')]=function(_0xfe2e31,_0x1fe6c4,_0x39acb7){this[_0x74a4('0xbe')](_0xfe2e31)[_0x74a4('0xa6')](loggerCatch(_0x1fe6c4));this[_0x74a4('0xbc')](_0xfe2e31)[_0x74a4('0xa6')](loggerCatch(_0x39acb7));};Dialer[_0x74a4('0x19')][_0x74a4('0x35')]=function(_0x217182){var _0x438d32=this[_0x74a4('0x25')][_0x217182['uniqueid']];var _0x5c06f6;if(!_[_0x74a4('0xa2')](_0x217182)&&!_[_0x74a4('0xa2')](_0x217182[_0x74a4('0xd1')])&&!_['isNil'](_0x217182[_0x74a4('0xd1')]['amdstatus'])&&_0x217182[_0x74a4('0xd2')]==='xcally-motion-dialer'&&_0x438d32){if(_0x438d32[_0x74a4('0x46')]!==_0x74a4('0x73')&&this[_0x74a4('0x1e')][_0x438d32[_0x74a4('0xa8')]]['dialAMDActive']&&_0x217182['value']===_0x74a4('0xd3')){delete this[_0x74a4('0x25')][_0x217182[_0x74a4('0xd4')]];this['updateOriginated'](this[_0x74a4('0x1e')][_0x438d32[_0x74a4('0xa8')]]);this[_0x74a4('0x1e')][_0x438d32['queue']][_0x74a4('0xd5')]+=0x1;this[_0x74a4('0x1e')][_0x438d32[_0x74a4('0xa8')]][_0x74a4('0x54')]+=0x1;_0x5c06f6=new Hangup(_0x438d32,_0x217182);_0x5c06f6[_0x74a4('0x9b')]=0x12;_0x5c06f6['statedesc']='HangupInAMD';_0x5c06f6['membername']='AMD';ami['emit']('custom:amd',ut[_0x74a4('0xd6')](_0x5c06f6,_0x74a4('0xd7')));this[_0x74a4('0xc4')](_0x5c06f6,'[syncHangupInAMD][createHistory]',_0x74a4('0xd8'));}if(_0x438d32[_0x74a4('0x46')]!==_0x74a4('0x73')&&this[_0x74a4('0x1e')][_0x438d32['queue']][_0x74a4('0xd9')]&&_0x217182[_0x74a4('0xda')]===_0x74a4('0xdb')){var _0x2c0beb=this;return new BPromise(function(_0x350e79,_0x4c4a7f){delete _0x2c0beb[_0x74a4('0x25')][_0x217182[_0x74a4('0xd4')]];_0x2c0beb[_0x74a4('0xc0')](_0x2c0beb[_0x74a4('0x1e')][_0x438d32['queue']]);_0x2c0beb[_0x74a4('0x1e')][_0x438d32[_0x74a4('0xa8')]]['outboundAnswerCallsDay']+=0x1;_0x2c0beb[_0x74a4('0x1e')][_0x438d32[_0x74a4('0xa8')]][_0x74a4('0x54')]+=0x1;var _0x28a67d=_0x2c0beb['voiceQueues'][_0x438d32[_0x74a4('0xa8')]];var _0xf264c=new Hangup(_0x438d32,_0x217182);_0xf264c['state']=0x13;_0xf264c['statedesc']=_0x74a4('0xdc');_0xf264c[_0x74a4('0xdd')]=_0x74a4('0xde');_0xf264c[_0x74a4('0xdf')]+=0x1;_0xf264c[_0x74a4('0xe0')]+=0x1;_0xf264c[_0x74a4('0xd7')]=!![];ami[_0x74a4('0x45')](_0x74a4('0xe1'),ut[_0x74a4('0xd6')](_0xf264c,_0x74a4('0xd7')));_0x2c0beb[_0x74a4('0xbe')](_0xf264c)['catch'](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0xf264c[_0x74a4('0xe2')]+_0xf264c[_0x74a4('0xe3')]+_0xf264c[_0x74a4('0xe4')]+_0xf264c[_0x74a4('0xe5')]+_0xf264c[_0x74a4('0xe6')]+_0xf264c['countabandonedretry']+_0xf264c[_0x74a4('0xdf')]+_0xf264c['countagentrejectretry']>=_0x28a67d[_0x74a4('0xe7')]){_0x2c0beb[_0x74a4('0xe8')](_0xf264c,_0x350e79,_0x4c4a7f,_0x74a4('0xe9'));}else{if(_0xf264c[_0x74a4('0xdf')]>=_0x28a67d['dialMachineMaxRetry']){_0x2c0beb['createStateFinal'](_0xf264c,_0x350e79,_0x4c4a7f,_0x74a4('0xea'));}else{_0x2c0beb['rescheduleContact']({'active':![],'countmachineretry':_0xf264c[_0x74a4('0xdf')],'scheduledat':moment()['add'](_0x28a67d[_0x74a4('0xeb')],_0x74a4('0xec'))[_0x74a4('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xf264c[_0x74a4('0xc6')],'ListId':_0xf264c[_0x74a4('0xc7')],'VoiceQueueId':_0xf264c[_0x74a4('0xc8')]||undefined,'CampaignId':_0xf264c['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x350e79({'reschedule':0x1});}}});}if(_0x438d32[_0x74a4('0x46')]==='ivr'&&this['campaigns'][_0x438d32[_0x74a4('0xa8')]][_0x74a4('0xd9')]&&_0x217182['value']==='HANGUP'){delete this[_0x74a4('0x25')][_0x217182[_0x74a4('0xd4')]];this[_0x74a4('0xc0')](this[_0x74a4('0x1f')][_0x438d32['queue']]);_0x5c06f6=new Hangup(_0x438d32,_0x217182);_0x5c06f6[_0x74a4('0x9b')]=0x12;_0x5c06f6[_0x74a4('0x9c')]=_0x74a4('0xed');_0x5c06f6[_0x74a4('0xdd')]=_0x74a4('0xde');ami['emit']('custom:amd',ut[_0x74a4('0xd6')](_0x5c06f6,_0x74a4('0xd7')));this['saveInDb'](_0x5c06f6,_0x74a4('0xee'),'[syncHangupInAMDIvr]');}if(_0x438d32[_0x74a4('0x46')]===_0x74a4('0x73')&&this['campaigns'][_0x438d32[_0x74a4('0xa8')]]['dialAMDActive']&&_0x217182[_0x74a4('0xda')]===_0x74a4('0xdb')){var _0x2c0beb=this;return new BPromise(function(_0x3dafa0,_0xd96bfd){delete _0x2c0beb[_0x74a4('0x25')][_0x217182[_0x74a4('0xd4')]];_0x2c0beb[_0x74a4('0xc0')](_0x2c0beb['campaigns'][_0x438d32[_0x74a4('0xa8')]]);_0x2c0beb[_0x74a4('0x1f')][_0x438d32['queue']][_0x74a4('0xd5')]+=0x1;_0x2c0beb[_0x74a4('0x1f')][_0x438d32[_0x74a4('0xa8')]][_0x74a4('0x54')]+=0x1;var _0x3d076c=_0x2c0beb['campaigns'][_0x438d32[_0x74a4('0xa8')]];var _0x2a5112=new Hangup(_0x438d32,_0x217182);_0x2a5112[_0x74a4('0x9b')]=0x13;_0x2a5112[_0x74a4('0x9c')]='Machine';_0x2a5112['membername']=_0x74a4('0xde');_0x2a5112['countmachineretry']+=0x1;_0x2a5112[_0x74a4('0xe0')]+=0x1;_0x2a5112[_0x74a4('0xd7')]=!![];ami['emit'](_0x74a4('0xe1'),ut[_0x74a4('0xd6')](_0x2a5112,_0x74a4('0xd7')));_0x2c0beb[_0x74a4('0xbe')](_0x2a5112)[_0x74a4('0xa6')](loggerCatch(_0x74a4('0xef')));if(_0x2a5112[_0x74a4('0xe2')]+_0x2a5112['countcongestionretry']+_0x2a5112['countnoanswerretry']+_0x2a5112['countnosuchnumberretry']+_0x2a5112[_0x74a4('0xe6')]+_0x2a5112[_0x74a4('0xf0')]+_0x2a5112[_0x74a4('0xdf')]+_0x2a5112[_0x74a4('0xf1')]>=_0x3d076c[_0x74a4('0xe7')]){_0x2c0beb[_0x74a4('0xe8')](_0x2a5112,_0x3dafa0,_0xd96bfd,'reason19\x20machine....');}else{if(_0x2a5112[_0x74a4('0xdf')]>=_0x3d076c[_0x74a4('0xf2')]){_0x2c0beb[_0x74a4('0xf3')](_0x2a5112,_0x3dafa0,_0xd96bfd,_0x74a4('0xea'));}else{_0x2c0beb['rescheduleContact']({'active':![],'countmachineretry':_0x2a5112[_0x74a4('0xdf')],'scheduledat':moment()[_0x74a4('0xf4')](_0x3d076c[_0x74a4('0xeb')],_0x74a4('0xec'))[_0x74a4('0x71')](_0x74a4('0xf5')),'ContactId':_0x2a5112[_0x74a4('0xc6')],'ListId':_0x2a5112['ListId'],'VoiceQueueId':_0x2a5112['VoiceQueueId']||undefined,'CampaignId':_0x2a5112['CampaignId']||undefined})[_0x74a4('0xa6')](loggerCatch(_0x74a4('0xf6')));_0x3dafa0({'reschedule':0x1});}}});}}};Dialer[_0x74a4('0x19')][_0x74a4('0x31')]=function(_0x3d52dc){var _0x1f6d5f=this[_0x74a4('0x25')][_0x3d52dc[_0x74a4('0xd4')]];var _0x4a78a3=this;var _0x556331;if(_0x1f6d5f&&_0x1f6d5f[_0x74a4('0x46')]===_0x74a4('0x73')){delete this[_0x74a4('0x25')][_0x3d52dc[_0x74a4('0xd4')]];this['updateOriginated'](this[_0x74a4('0x1f')][_0x1f6d5f[_0x74a4('0xa8')]]);this['campaigns'][_0x1f6d5f['queue']][_0x74a4('0xf7')]+=0x1;_0x556331=new Hangup(_0x1f6d5f,_0x3d52dc);this[_0x74a4('0xbe')](_0x556331)[_0x74a4('0xa6')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x74a4('0xbc')](_0x556331)[_0x74a4('0xa6')](loggerCatch('[syncHangupIvr]'));}if(_0x1f6d5f&&_0x1f6d5f[_0x74a4('0x46')]!==_0x74a4('0x73')&&isNotNull(this[_0x74a4('0x1e')][_0x1f6d5f['queue']][_0x74a4('0xf8')])){delete this[_0x74a4('0x25')][_0x3d52dc[_0x74a4('0xd4')]];this[_0x74a4('0xc0')](this[_0x74a4('0x1e')][_0x1f6d5f[_0x74a4('0xa8')]]);this[_0x74a4('0x1e')][_0x1f6d5f['queue']][_0x74a4('0xd5')]+=0x1;this[_0x74a4('0x1e')][_0x1f6d5f[_0x74a4('0xa8')]][_0x74a4('0x54')]+=0x1;_0x556331=new Hangup(_0x1f6d5f,_0x3d52dc);_0x556331[_0x74a4('0x9b')]=0x10;_0x556331[_0x74a4('0x9c')]=_0x74a4('0xf9');_0x556331['membername']='AGI';this[_0x74a4('0xbe')](_0x556331)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x74a4('0xbc')](_0x556331)[_0x74a4('0xa6')](loggerCatch('[syncHangupIvr]'));}if(_0x1f6d5f&&_0x1f6d5f['type']!==_0x74a4('0x73')&&!isNotNull(this[_0x74a4('0x1e')][_0x1f6d5f[_0x74a4('0xa8')]]['dialQueueProject'])){delete this[_0x74a4('0x25')][_0x3d52dc['uniqueid']];this[_0x74a4('0xc0')](this[_0x74a4('0x1e')][_0x1f6d5f['queue']]);this[_0x74a4('0x1e')][_0x1f6d5f[_0x74a4('0xa8')]][_0x74a4('0x5d')]+=0x1;_0x556331=new Hangup(_0x1f6d5f,_0x3d52dc);_0x556331[_0x74a4('0x9b')]=0xc;_0x556331[_0x74a4('0x9c')]=_0x3d52dc[_0x74a4('0xfa')];_0x556331[_0x74a4('0xdd')]=_0x74a4('0xfb');this['createHistory'](_0x556331)['catch'](loggerCatch(_0x74a4('0xfc')));this[_0x74a4('0xbc')](_0x556331)['catch'](loggerCatch(_0x74a4('0xfd')));}};Dialer['prototype']['syncAgentComplete']=function(_0xc798f8){var _0x5c56c8=this[_0x74a4('0x25')][_0xc798f8[_0x74a4('0xd4')]];var _0x4ccd04=this;if(this[_0x74a4('0x1e')][_0xc798f8[_0x74a4('0xa8')]]){if(_0x5c56c8&&_0x5c56c8[_0x74a4('0x46')]!=='ivr'){delete this[_0x74a4('0x25')][_0xc798f8[_0x74a4('0xd4')]];this[_0x74a4('0x1e')][_0xc798f8[_0x74a4('0xa8')]][_0x74a4('0xd5')]+=0x1;var _0x56e59d=new AgentComplete(_0x5c56c8,_0xc798f8);if(_0xc798f8[_0x74a4('0xfe')]===_0x74a4('0xff')){_0x56e59d[_0x74a4('0x100')]=this[_0x74a4('0x1e')][_0xc798f8[_0x74a4('0xa8')]]['dialQueueProject2']&&this[_0x74a4('0x1e')][_0xc798f8[_0x74a4('0xa8')]][_0x74a4('0x101')]?moment()[_0x74a4('0x71')](_0x74a4('0xf5')):undefined;}this[_0x74a4('0xbe')](_0x56e59d)[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x102')));this[_0x74a4('0xbc')](_0x56e59d)[_0x74a4('0xa6')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x74a4('0x19')][_0x74a4('0x2a')]=function(_0x26708e){if(this['voiceQueues'][_0x26708e['queue']]){if(this[_0x74a4('0x25')][_0x26708e[_0x74a4('0xd4')]]&&this[_0x74a4('0x25')][_0x26708e[_0x74a4('0xd4')]]['type']!=='ivr'){this[_0x74a4('0xc0')](this[_0x74a4('0x1e')][_0x26708e[_0x74a4('0xa8')]]);this['uniqueId'][_0x26708e['uniqueid']][_0x74a4('0x103')]=moment()[_0x74a4('0x71')](_0x74a4('0xf5'));}}};Dialer[_0x74a4('0x19')][_0x74a4('0x104')]=function(_0xafbe1c){this['createHistory'](_0xafbe1c)[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x102')));this['moveContactManagedDialer'](_0xafbe1c)[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x105')));};Dialer['prototype'][_0x74a4('0x2b')]=function(_0x5a84bb){var _0xc9468f=this[_0x74a4('0x25')][_0x5a84bb['uniqueid']];var _0x43310d=this;if(this[_0x74a4('0x1e')][_0x5a84bb[_0x74a4('0xa8')]]){if(_0xc9468f&&_0xc9468f[_0x74a4('0x46')]!==_0x74a4('0x73')){delete this[_0x74a4('0x25')][_0x5a84bb[_0x74a4('0xd4')]];this['updateOriginated'](this[_0x74a4('0x1e')][_0x5a84bb[_0x74a4('0xa8')]]);_0xc9468f[_0x74a4('0x106')]=moment()[_0x74a4('0x71')](_0x74a4('0xf5'));var _0x3b5c31=new QueueCallerAbandon(_0xc9468f,_0x5a84bb);if(getSeconds(_0xc9468f[_0x74a4('0x106')],_0xc9468f[_0x74a4('0x107')])>=_0xc9468f[_0x74a4('0x108')]){this[_0x74a4('0x1e')][_0x5a84bb[_0x74a4('0xa8')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this[_0x74a4('0x1e')][_0x5a84bb[_0x74a4('0xa8')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x74a4('0x1e')][_0x5a84bb[_0x74a4('0xa8')]][_0x74a4('0x64')]+=0x1;_0x3b5c31['state']=0xa;_0x3b5c31[_0x74a4('0x9c')]=_0x74a4('0x109');_0x3b5c31[_0x74a4('0x10a')]='TIMEOUT';_0x3b5c31[_0x74a4('0x100')]=this['voiceQueues'][_0x5a84bb[_0x74a4('0xa8')]]['dialQueueProject2']?moment()[_0x74a4('0x71')](_0x74a4('0xf5')):undefined;_0x3b5c31[_0x74a4('0xe6')]+=0x1;_0x3b5c31[_0x74a4('0xe0')]+=0x1;if(_0x3b5c31[_0x74a4('0xe6')]>=this[_0x74a4('0x1e')][_0x5a84bb['queue']][_0x74a4('0x10b')]){this[_0x74a4('0x104')](_0x3b5c31);}else{this[_0x74a4('0xb3')]({'active':![],'countdropretry':_0x3b5c31[_0x74a4('0xe6')],'scheduledat':moment()[_0x74a4('0xf4')](this[_0x74a4('0x1e')][_0x5a84bb[_0x74a4('0xa8')]][_0x74a4('0x10c')],_0x74a4('0xec'))['format'](_0x74a4('0xf5')),'ContactId':_0xc9468f['ContactId'],'ListId':_0xc9468f[_0x74a4('0xc7')],'VoiceQueueId':_0xc9468f['VoiceQueueId']||undefined,'CampaignId':_0xc9468f['CampaignId']||undefined})['catch'](loggerCatch(_0x74a4('0x10d')));var _0x417843=new History(_0x3b5c31);_0x417843[_0x74a4('0x9b')]=0xa;_0x417843[_0x74a4('0x9c')]=_0x74a4('0x109');_0x417843[_0x74a4('0x10e')]=moment()[_0x74a4('0x71')](_0x74a4('0xf5'));_0x417843[_0x74a4('0x9d')]=_0x417843['starttime'];_0x417843[_0x74a4('0x10f')]=_0x3b5c31[_0x74a4('0x10f')];_0x417843[_0x74a4('0x110')]=_0x3b5c31[_0x74a4('0x110')];this['createHistory'](_0x417843)['catch'](loggerCatch(_0x74a4('0x111')));}}else{this[_0x74a4('0x1e')][_0x5a84bb['queue']][_0x74a4('0x61')]+=0x1;this[_0x74a4('0x1e')][_0x5a84bb[_0x74a4('0xa8')]][_0x74a4('0x58')]+=0x1;_0x3b5c31[_0x74a4('0x9b')]=0xb;_0x3b5c31[_0x74a4('0x9c')]=_0x74a4('0x112');_0x3b5c31[_0x74a4('0x10a')]=_0x74a4('0x113');_0x3b5c31['countabandonedretry']+=0x1;_0x3b5c31[_0x74a4('0xe0')]+=0x1;if(_0x3b5c31[_0x74a4('0xf0')]>=this[_0x74a4('0x1e')][_0x5a84bb[_0x74a4('0xa8')]]['dialAbandonedMaxRetry']){this[_0x74a4('0x104')](_0x3b5c31);}else{this[_0x74a4('0xb3')]({'active':![],'countabandonedretry':_0x3b5c31[_0x74a4('0xf0')],'scheduledat':moment()[_0x74a4('0xf4')](this[_0x74a4('0x1e')][_0x5a84bb[_0x74a4('0xa8')]]['dialAbandonedRetryFrequency'],'minutes')[_0x74a4('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xc9468f[_0x74a4('0xc6')],'ListId':_0xc9468f['ListId'],'VoiceQueueId':_0xc9468f['VoiceQueueId']||undefined,'CampaignId':_0xc9468f[_0x74a4('0xc9')]||undefined})[_0x74a4('0xa6')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x417843=new History(_0x3b5c31);_0x417843[_0x74a4('0x9b')]=0xb;_0x417843[_0x74a4('0x9c')]=_0x74a4('0x112');_0x417843[_0x74a4('0x10e')]=moment()[_0x74a4('0x71')](_0x74a4('0xf5'));_0x417843[_0x74a4('0x9d')]=_0x417843[_0x74a4('0x10e')];_0x417843[_0x74a4('0x10f')]=_0x3b5c31['calleridname'];_0x417843['calleridnum']=_0x3b5c31[_0x74a4('0x110')];this[_0x74a4('0xbe')](_0x417843)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));}}}}};Dialer[_0x74a4('0x19')][_0x74a4('0x33')]=function(_0x7077ba){if(this[_0x74a4('0x114')][_0x7077ba[_0x74a4('0xd4')]]){this[_0x74a4('0x114')][_0x7077ba[_0x74a4('0xd4')]][_0x74a4('0xa5')]=_0x7077ba['channel'];}if(this['uniqueId'][_0x7077ba[_0x74a4('0xd4')]]){this[_0x74a4('0x25')][_0x7077ba[_0x74a4('0xd4')]][_0x74a4('0xa5')]=_0x7077ba[_0x74a4('0xa5')];}};Dialer[_0x74a4('0x19')][_0x74a4('0x115')]=function(_0x3549a0){if(strategy[this[_0x74a4('0x1e')][this['actions'][_0x3549a0[_0x74a4('0x116')]][_0x74a4('0xa8')]][_0x74a4('0x117')]]===_0x74a4('0x18')){if(this[_0x74a4('0x114')][_0x3549a0[_0x74a4('0x116')]]&&_[_0x74a4('0xa2')](this[_0x74a4('0x114')][_0x3549a0[_0x74a4('0x116')]][_0x74a4('0x118')])&&_0x3549a0[_0x74a4('0xa4')]==='1'&&_0x3549a0[_0x74a4('0x119')]==='0'){if(this['agents'][_0x3549a0[_0x74a4('0x11a')]]){if(!this['agents'][_0x3549a0[_0x74a4('0x11a')]][_0x74a4('0x118')]){this[_0x74a4('0x20')][_0x3549a0['stateinterface']]['locked']=!![];this[_0x74a4('0x114')][_0x3549a0[_0x74a4('0x116')]][_0x74a4('0x118')]=!![];this[_0x74a4('0x114')][_0x3549a0['actionid']][_0x74a4('0x11a')]=_0x3549a0[_0x74a4('0x11a')];}}}}else if((strategy[this[_0x74a4('0x1e')][this[_0x74a4('0x114')][_0x3549a0[_0x74a4('0x116')]][_0x74a4('0xa8')]][_0x74a4('0x117')]]||_0x74a4('0x17'))===_0x74a4('0x17')){if(this[_0x74a4('0x114')][_0x3549a0['actionid']]){if(this[_0x74a4('0x20')][_0x3549a0['stateinterface']]){this['actions'][_0x3549a0[_0x74a4('0x116')]][_0x74a4('0x11a')]=_0x3549a0[_0x74a4('0x11a')];if(_['isNil'](this[_0x74a4('0x28')][this[_0x74a4('0x114')][_0x3549a0[_0x74a4('0x116')]][_0x74a4('0xa8')]])){this[_0x74a4('0x28')][this[_0x74a4('0x114')][_0x3549a0[_0x74a4('0x116')]][_0x74a4('0xa8')]]=[];}this[_0x74a4('0x28')][this[_0x74a4('0x114')][_0x3549a0[_0x74a4('0x116')]][_0x74a4('0xa8')]][_0x74a4('0x11b')](_[_0x74a4('0x11c')](_['pick'](this['actions'][_0x3549a0['actionid']],['idHopper',_0x74a4('0x11a')]),{'status':_0x3549a0['status'],'paused':_0x3549a0[_0x74a4('0x119')]}));}}}};function unlockQueueStatus(_0x581fb7,_0x33a124){setTimeout(function(){if(_['isUndefined'](_0x581fb7[_0x74a4('0x11d')])){loggerBooked['error'](_0x74a4('0x11e'),_0x33a124);}_0x581fb7['queueStatusComplete']=!![];loggerBooked[_0x74a4('0x76')](_0x74a4('0x11f'),_0x33a124,JSON['stringify'](_[_0x74a4('0xc5')](_0x581fb7,[_0x74a4('0x3a'),_0x74a4('0x11d')])));},0x1f3);}Dialer[_0x74a4('0x19')]['syncQueueStatusComplete']=function(_0x38cb43){var _0x5830fd=this;var _0x1c7f0d=_0x5830fd[_0x74a4('0x1e')][_0x5830fd[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xa8')]];if(strategy[this[_0x74a4('0x1e')][this['actions'][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xa8')]][_0x74a4('0x117')]]===_0x74a4('0x18')){if(this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]]&&this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0x11a')]){this[_0x74a4('0x1d')][_0x74a4('0x120')](this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0x121')],this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0x11a')])[_0x74a4('0xa6')](function(_0x33eec8){logger[_0x74a4('0x8b')](_0x74a4('0x122'),util[_0x74a4('0x8c')](_0x33eec8,{'showHidden':![],'depth':null}));})['finally'](function(){_0x5830fd[_0x74a4('0xc0')](_0x5830fd[_0x74a4('0x1e')][_0x5830fd['actions'][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xa8')]]);_0x5830fd[_0x74a4('0x20')][_0x5830fd[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0x11a')]][_0x74a4('0x118')]=![];delete _0x5830fd[_0x74a4('0x114')][_0x38cb43['actionid']];unlockQueueStatus(_0x1c7f0d);});}else{this[_0x74a4('0xc0')](this[_0x74a4('0x1e')][this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xa8')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x74a4('0x114')][_0x38cb43['actionid']][_0x74a4('0xc6')],'ListId':this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xc7')],'VoiceQueueId':this['actions'][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xc8')]||undefined,'CampaignId':this[_0x74a4('0x114')][_0x38cb43['actionid']][_0x74a4('0xc9')]||undefined})[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x123')));delete this[_0x74a4('0x114')][_0x38cb43['actionid']];unlockQueueStatus(_0x1c7f0d);}}else if((strategy[this[_0x74a4('0x1e')][this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xa8')]]['strategy']]||_0x74a4('0x17'))===_0x74a4('0x17')){var _0x249f31;if(this[_0x74a4('0x114')][_0x38cb43['actionid']]&&!_[_0x74a4('0x75')](this[_0x74a4('0x28')][this[_0x74a4('0x114')][_0x38cb43['actionid']][_0x74a4('0xa8')]])){if(this[_0x74a4('0x29')][_0x5830fd[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xa8')]]){this[_0x74a4('0x29')][_0x5830fd[_0x74a4('0x114')][_0x38cb43['actionid']][_0x74a4('0xa8')]]=this[_0x74a4('0x29')][this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]]['queue']]?this[_0x74a4('0x29')][this['actions'][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xa8')]]:this[_0x74a4('0x28')][this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]]['queue']]?this[_0x74a4('0x28')][this['actions'][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xa8')]][_0x74a4('0x124')]||0x0:0x0;}this['queueBooked'][this[_0x74a4('0x114')][_0x38cb43['actionid']][_0x74a4('0xa8')]][_0x74a4('0x124')]=this['queueBookedRR'][this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xa8')]];for(var _0x5621ec=0x0;_0x5621ec<this[_0x74a4('0x28')][this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xa8')]][_0x74a4('0x8d')];_0x5621ec+=0x1){_0x249f31=rr(this['queueBooked'][this[_0x74a4('0x114')][_0x38cb43['actionid']][_0x74a4('0xa8')]]);this[_0x74a4('0x29')][_0x5830fd[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xa8')]]=this[_0x74a4('0x28')][this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xa8')]][_0x74a4('0x124')];if(_0x249f31[_0x74a4('0xa4')]==='1'&&_0x249f31['paused']==='0'){break;}}if(!_[_0x74a4('0xa2')](_0x249f31)){this[_0x74a4('0x20')][_0x249f31[_0x74a4('0x11a')]][_0x74a4('0x125')]=_['isUndefined'](this[_0x74a4('0x20')][_0x249f31['stateinterface']][_0x74a4('0x125')])?!![]:this[_0x74a4('0x20')][_0x249f31[_0x74a4('0x11a')]][_0x74a4('0x125')];}loggerBooked[_0x74a4('0x76')]('[booked][RR]',_0x38cb43[_0x74a4('0x116')],_0x74a4('0x126'),JSON[_0x74a4('0x42')](_[_0x74a4('0xc5')](this[_0x74a4('0x20')][_0x249f31['stateinterface']],[_0x74a4('0x3a'),_0x74a4('0x125')])),_0x74a4('0x127'),JSON['stringify'](_0x249f31[_0x74a4('0x121')]));if(!_['isNil'](_0x249f31)&&_0x249f31['status']==='1'&&_0x249f31[_0x74a4('0x119')]==='0'&&this['agents'][_0x249f31[_0x74a4('0x11a')]][_0x74a4('0x125')]){this['agents'][_0x249f31[_0x74a4('0x11a')]]['unlockRR']=![];this['queueBooked'][_0x5830fd['actions'][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xa8')]]=[];this[_0x74a4('0x1d')]['run'](_0x249f31[_0x74a4('0x121')],_0x249f31['stateinterface'])[_0x74a4('0xa6')](function(_0x31bc7a){logger[_0x74a4('0x8b')]('[Catch][Preview][syncQueueStatusComplete]',util[_0x74a4('0x8c')](_0x31bc7a,{'showHidden':![],'depth':null}));})[_0x74a4('0x1c')](function(){_0x5830fd[_0x74a4('0xc0')](_0x5830fd['voiceQueues'][_0x5830fd[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]]['queue']]);setTimeout(function(){_0x5830fd[_0x74a4('0x20')][_0x249f31[_0x74a4('0x11a')]]['unlockRR']=!![];loggerBooked['info'](_0x74a4('0x128'),_0x38cb43['actionid'],_0x74a4('0x126'),JSON[_0x74a4('0x42')](_[_0x74a4('0xc5')](_0x5830fd[_0x74a4('0x20')][_0x249f31[_0x74a4('0x11a')]],[_0x74a4('0x3a'),_0x74a4('0x125')])),_0x74a4('0x127'),JSON['stringify'](_0x249f31[_0x74a4('0x121')]));},0xc7);delete _0x5830fd[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]];unlockQueueStatus(_0x1c7f0d,_0x38cb43[_0x74a4('0x116')]);});}else{loggerBooked[_0x74a4('0x76')]('[booked][unlock]');this[_0x74a4('0xc0')](this['voiceQueues'][this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xa8')]]);this[_0x74a4('0xb3')]({'active':![],'ContactId':this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]]['ContactId'],'ListId':this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]]['ListId'],'VoiceQueueId':this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xc8')]||undefined,'CampaignId':this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xc9')]||undefined})[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x123')));delete this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]];unlockQueueStatus(_0x1c7f0d);}}else{loggerBooked[_0x74a4('0x76')](_0x74a4('0x129'));this['updateOriginated'](this[_0x74a4('0x1e')][this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xa8')]]);this[_0x74a4('0xb3')]({'active':![],'ContactId':this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xc6')],'ListId':this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xc7')],'VoiceQueueId':this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xc9')]||undefined})['catch'](loggerCatch(_0x74a4('0x12a')));delete this[_0x74a4('0x114')][_0x38cb43['actionid']];unlockQueueStatus(_0x1c7f0d);}}else{loggerBooked[_0x74a4('0x76')]('[booked][unlock3]');this[_0x74a4('0xc0')](this[_0x74a4('0x1e')][this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xa8')]]);this[_0x74a4('0xb3')]({'active':![],'ContactId':this[_0x74a4('0x114')][_0x38cb43['actionid']]['ContactId'],'ListId':this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]]['ListId'],'VoiceQueueId':this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xc8')]||undefined,'CampaignId':this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]][_0x74a4('0xc9')]||undefined})['catch'](loggerCatch('[unlock3][syncQueueStatusComplete]'));delete this[_0x74a4('0x114')][_0x38cb43[_0x74a4('0x116')]];unlockQueueStatus(_0x1c7f0d);}};Dialer[_0x74a4('0x19')]['loopCampaigns']=function(){var _0x25849f=this;setInterval(function(){_0x25849f[_0x74a4('0x12b')]();},0x3e8);};Dialer[_0x74a4('0x19')][_0x74a4('0x12c')]=function(_0x25efbc){var _0x5f17a8=this;return function(){if(!_0x5f17a8[_0x74a4('0xcd')](_0x25efbc['Trunk'])){if(!_0x5f17a8['isTrunkReachable'](_0x25efbc[_0x74a4('0x12d')])){_0x25efbc[_0x74a4('0x3d')]=_0x74a4('0x12e');throw _0x25efbc[_0x74a4('0x3a')]+'\x20trunk\x20is\x20not\x20reachable';}}};};Dialer[_0x74a4('0x19')][_0x74a4('0x12f')]=function(_0x300668,_0x58be74,_0xfbfcef,_0x2ea147){var _0x230c92=this;return function(){var _0x5d1447=!![];return _0x230c92[_0x74a4('0x130')](_0x300668,_0x58be74,_0xfbfcef,_0x2ea147,_0x5d1447);};};Dialer[_0x74a4('0x19')][_0x74a4('0x131')]=function(_0x592446,_0x1def07,_0x3e87c4,_0x286d55){var _0x2ac7ea=this;return function(){var _0x244a33=![];return _0x2ac7ea[_0x74a4('0x130')](_0x592446[_0x74a4('0x40')],_0x1def07,_0x3e87c4,_0x286d55,_0x244a33);};};Dialer[_0x74a4('0x19')][_0x74a4('0x130')]=function(_0x10d393,_0x32bb44,_0x4a2b3e,_0xe823d6,_0x175eed){var _0x56fc0d=[];return new BPromise(function(_0x1141d3,_0x3bd2e5){if(!isNotNull(_0x10d393)){_0xe823d6[_0x74a4('0x3d')]=_0x74a4('0x3e');return _0x3bd2e5(msgResponse(_0x74a4('0x130'),_0x74a4('0x132'),_0x4a2b3e+_0x74a4('0x133')));}if(_['isEmpty'](_0x10d393)){_0xe823d6[_0x74a4('0x3d')]=_0x74a4('0x134');return _0x3bd2e5(msgResponse(_0x74a4('0x130'),_0x74a4('0x132'),_0x4a2b3e+_0x74a4('0x135')));}if(_0x32bb44&&_[_0x74a4('0x38')](config[_0x74a4('0x136')][_0x32bb44])){_0xe823d6[_0x74a4('0x3d')]=_0x74a4('0x137');return _0x3bd2e5(msgResponse(_0x74a4('0x130'),_0x74a4('0x132'),_0x4a2b3e+'\x20Timezone\x20unknow\x20'+_0x32bb44));}if(_['isArray'](_0x10d393)){for(var _0x28ffaa=0x0;_0x28ffaa<_0x10d393[_0x74a4('0x8d')];_0x28ffaa+=0x1){_0x56fc0d[_0x74a4('0x11b')](ami['Action']({'action':_0x74a4('0x138'),'command':util[_0x74a4('0x71')](_0x74a4('0x139'),_0x10d393[_0x28ffaa][_0x74a4('0x13a')],!_[_0x74a4('0x38')](config[_0x74a4('0x136')][_0x32bb44])?_0x32bb44:'')})[_0x74a4('0xac')](function(_0x140c33){return _0x140c33[_0x74a4('0x13b')][_0x74a4('0x13c')](_0x74a4('0x13d'))>=0x0;})['catch'](myreject(_0x3bd2e5)));}}else{_0x56fc0d[_0x74a4('0x11b')](ami['Action']({'action':'command','command':util['format'](_0x74a4('0x139'),_0x10d393,!_[_0x74a4('0x38')](config['timezones'][_0x32bb44])?_0x32bb44:'')})[_0x74a4('0xac')](function(_0x424d03){return _0x424d03[_0x74a4('0x13b')][_0x74a4('0x13c')](_0x74a4('0x13d'))>=0x0;})[_0x74a4('0xa6')](myreject(_0x3bd2e5)));}BPromise[_0x74a4('0x13e')](_0x56fc0d)[_0x74a4('0xac')](function(_0x1380ba){var _0x191310=_[_0x74a4('0x13f')](_0x1380ba);if(_0x191310){return _0x1141d3(_0x191310);}else{_0xe823d6['message']=_0x175eed?_0x74a4('0x140'):_0x74a4('0x141');return _0x3bd2e5(msgResponse('[ifTime][promiseAll]',_0x74a4('0x132'),'Global:\x20'+_0x175eed+'\x20'+_0x4a2b3e+_0x74a4('0x142')+util['inspect'](_0x10d393,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x32bb44));}})['catch'](function(_0x5c12ac){return _0x3bd2e5(msgResponse(_0x74a4('0x130'),_0x74a4('0x132'),JSON[_0x74a4('0x42')](_0x5c12ac)));});});};Dialer['prototype'][_0x74a4('0x143')]=function(_0x359a0f){var _0xaf1278=this;return function(){switch(_0x359a0f['dialMethod']){case'progressive':freeVariablesPredictive(_0x359a0f);_0xaf1278['handlePower'](_0x359a0f,0x1);break;case _0x74a4('0x144'):freeVariablesPredictive(_0x359a0f);_0xaf1278[_0x74a4('0x145')](_0x359a0f,_0x359a0f[_0x74a4('0x146')]);break;case _0x74a4('0x147'):_0xaf1278['predictive'](_0x359a0f);break;case _0x74a4('0x8'):freeVariablesPredictive(_0x359a0f);_0xaf1278[_0x74a4('0x145')](_0x359a0f,0x1);break;default:freeVariablesPredictive(_0x359a0f);logger[_0x74a4('0x8b')](_0x74a4('0x148'),_0x359a0f['name'],_0x74a4('0x149'));}};};Dialer[_0x74a4('0x19')][_0x74a4('0x14a')]=function(_0x12c5d2){var _0x1da8a7=this;return function(){_0x1da8a7[_0x74a4('0x14b')](_0x12c5d2);};};Dialer['prototype'][_0x74a4('0x14c')]=function(_0x12ab4a){var _0x512b2f=this;if(isNotPreview(_0x12ab4a[_0x74a4('0x51')])){if(isVoiceQueueOutbound(_0x12ab4a['type'])&&isActive(_0x12ab4a[_0x74a4('0x14d')])){_0x12ab4a['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0x74a4('0xac')](checkIsLoggedIn(_0x12ab4a,_0x12ab4a['loggedIn']))[_0x74a4('0xac')](checkIsActive(_0x12ab4a,_0x12ab4a['dialActive']))[_0x74a4('0xac')](checkInterval(_0x12ab4a))['then'](_0x512b2f[_0x74a4('0x12c')](_0x12ab4a))[_0x74a4('0xac')](_0x512b2f[_0x74a4('0x12f')](_0x12ab4a[_0x74a4('0x14e')],_0x12ab4a[_0x74a4('0x14f')],_0x12ab4a[_0x74a4('0x3a')],_0x12ab4a))['then'](_0x512b2f[_0x74a4('0x131')](_0x12ab4a[_0x74a4('0x3c')],_0x12ab4a[_0x74a4('0x14f')],_0x12ab4a[_0x74a4('0x3a')],_0x12ab4a))[_0x74a4('0xac')](_0x512b2f[_0x74a4('0x143')](_0x12ab4a))[_0x74a4('0xa6')](loggerCatchQueueSummary(_0x74a4('0x150'),_0x12ab4a));}else{notSendMessagesQueue(_0x12ab4a);}}else{freeVariablesPredictive(_0x12ab4a);}};Dialer[_0x74a4('0x19')][_0x74a4('0x12b')]=function(){var _0x1870fa=this;var _0x18caac;for(var _0x1477cb in this[_0x74a4('0x1f')]){if(typeof this[_0x74a4('0x1f')][_0x1477cb]!==_0x74a4('0x8e')){_0x18caac=this[_0x74a4('0x1f')][_0x1477cb];if(isCampaignIvr(_0x18caac[_0x74a4('0x46')])&&isActive(_0x18caac[_0x74a4('0xce')])){_0x18caac[_0x74a4('0x96')]=!![];BPromise[_0x74a4('0xab')]()[_0x74a4('0xac')](checkIsActive(_0x18caac,_0x18caac[_0x74a4('0xce')]))[_0x74a4('0xac')](checkInterval(_0x18caac))['then'](_0x1870fa[_0x74a4('0x12c')](_0x18caac))['then'](_0x1870fa['checkIfTime'](_0x18caac[_0x74a4('0x14e')],_0x18caac[_0x74a4('0x14f')],_0x18caac[_0x74a4('0x3a')],_0x18caac))['then'](_0x1870fa[_0x74a4('0x131')](_0x18caac[_0x74a4('0x3c')],_0x18caac[_0x74a4('0x14f')],_0x18caac[_0x74a4('0x3a')],_0x18caac))['then'](_0x1870fa[_0x74a4('0x14a')](_0x18caac))['catch'](loggerCatchQueueSummary(_0x74a4('0x151'),_0x18caac));}else{notSendMessagesCampaign(_0x18caac);}}}};function getCallerIdRandom(_0xce9b64,_0x568cf3){var _0x4d912f;var _0x5578ee;var _0x2b4d2b;if(_0x568cf3<=0x0){_0x568cf3=0x1;}_0x4d912f=new RegExp(_0x74a4('0x152')+_0x568cf3+'}$');_0x5578ee=Math[_0x74a4('0x153')](0xa,_0x568cf3-0x1);_0x2b4d2b=Math['pow'](0xa,_0x568cf3)-0x1;return util[_0x74a4('0x71')]('%s',_[_0x74a4('0x154')](_0xce9b64,_0x4d912f,_[_0x74a4('0x155')](_0x5578ee,_0x2b4d2b)));}function extractCalleridName(_0xcfb124){var _0x15f30f=_0xcfb124['match'](/"(.*?)"/);return _0x15f30f?_0x15f30f[0x1]:_0xcfb124;}function extractCalleridNumber(_0x787d20){var _0x28535c=_0x787d20[_0x74a4('0x156')](/<(.*?)>/);return _0x28535c?_0x28535c[0x1]:_0x787d20;}Dialer[_0x74a4('0x19')][_0x74a4('0x157')]=function(_0x1917f5,_0x24a1f6){var _0x4bdcc2=this;var _0x295bb9=uuid['v4']();this[_0x74a4('0x114')][_0x295bb9]=new Action(_0x1917f5,_0x24a1f6,_0x295bb9);return new BPromise(function(_0x1f61cd,_0x4bc074){if(_[_0x74a4('0x38')](_0x1917f5)&&typeof _0x1917f5!=='object'){return _0x4bc074(msgResponse(_0x74a4('0x158'),_0x74a4('0x132'),_0x74a4('0x159')));}if(_[_0x74a4('0x38')](_0x24a1f6[_0x74a4('0x15a')][_0x74a4('0x15b')])||_0x24a1f6['Contact'][_0x74a4('0x15b')]===null){return _0x4bc074(msgResponse('originate','Failure',_0x74a4('0x15c')));}var _0x29b5ce={'XMD-CALLERID':_0x4bdcc2[_0x74a4('0x114')][_0x295bb9]['getCaller'](),'XMD-AGI':_0x1917f5[_0x74a4('0xf8')]?util[_0x74a4('0x71')](_0x74a4('0x15d'),ipAgi,_0x1917f5[_0x74a4('0xf8')]):_0x74a4('0x15e'),'XMD-AGIAFTER':_0x1917f5['dialQueueProject2']?util['format'](_0x74a4('0x15d'),ipAgi,_0x1917f5['dialQueueProject2']):_0x74a4('0x15e'),'XMD-QUEUE':_0x1917f5[_0x74a4('0x46')]===_0x74a4('0x88')?util[_0x74a4('0x71')](_0x74a4('0x15f'),_0x1917f5[_0x74a4('0x3a')],_0x1917f5[_0x74a4('0x160')]||'',_0x1917f5[_0x74a4('0x101')]?'c':'',_0x1917f5['dialQueueTimeout']||0x3):_0x74a4('0x15e'),'XMD-CONTACTID':_0x24a1f6[_0x74a4('0xc6')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x4bdcc2[_0x74a4('0x114')][_0x295bb9]['getCaller'](),'XMD-AMD':_0x1917f5[_0x74a4('0xd9')]?_0x74a4('0x161'):_0x74a4('0x15e'),'XMD-DESTINATION':_0x74a4('0x162')};if(_0x1917f5[_0x74a4('0xd9')]){_0x29b5ce['XMD-AMDINITIALSILENCE']=_0x1917f5['dialAMDInitialSilence']||0x9c4;_0x29b5ce[_0x74a4('0x163')]=_0x1917f5[_0x74a4('0x164')]||0x5dc;_0x29b5ce[_0x74a4('0x165')]=_0x1917f5[_0x74a4('0x166')]||0x320;_0x29b5ce[_0x74a4('0x167')]=_0x1917f5[_0x74a4('0x168')]||0x1388;_0x29b5ce[_0x74a4('0x169')]=_0x1917f5['dialAMDMinWordLength']||0x64;_0x29b5ce[_0x74a4('0x16a')]=_0x1917f5[_0x74a4('0x16b')]||0x32;_0x29b5ce[_0x74a4('0x16c')]=_0x1917f5[_0x74a4('0x16d')]||0x3;_0x29b5ce['XMD-AMDSILENCETHRESHOLD']=_0x1917f5[_0x74a4('0x16e')]||0x100;_0x29b5ce[_0x74a4('0x16f')]=_0x1917f5[_0x74a4('0x170')]||0x1388;}if(_0x1917f5[_0x74a4('0x46')]===_0x74a4('0x88')){_0x29b5ce['XMD-VOICEQUEUEID']=_0x24a1f6['VoiceQueueId'];}else{_0x29b5ce[_0x74a4('0x171')]=_0x24a1f6['CampaignId'];}for(var _0x1674e8 in _0x24a1f6[_0x74a4('0x15a')]){if(typeof _0x24a1f6[_0x74a4('0x15a')][_0x1674e8]!==_0x74a4('0x8e')){if(isNotNull(_0x24a1f6[_0x74a4('0x15a')][_0x1674e8])&&_0x1674e8!=='id'&&_0x1674e8!==_0x74a4('0x172')&&_0x1674e8!==_0x74a4('0x173')&&_0x1674e8!==_0x74a4('0x174')){_0x29b5ce[util[_0x74a4('0x71')]('%s%s',_0x74a4('0x175'),_[_0x74a4('0x176')](_0x1674e8))]=_0x24a1f6['Contact'][_0x1674e8];}}}var _0x164c5b=_0x4bdcc2[_0x74a4('0xcd')](_0x1917f5[_0x74a4('0x6e')])?getCallerId(_0x1917f5[_0x74a4('0x6e')][_0x74a4('0x6f')],_0x1917f5[_0x74a4('0x177')],_0x1917f5[_0x74a4('0x178')]>0x0?getCallerIdRandom(_0x1917f5[_0x74a4('0x179')],_0x1917f5[_0x74a4('0x178')]):_0x1917f5['dialOriginateCallerIdNumber']):getCallerId(_['isNil'](_0x1917f5['TrunkBackup'])?_0x1917f5['Trunk'][_0x74a4('0x6f')]:_0x1917f5[_0x74a4('0x12d')]['callerid'],_0x1917f5[_0x74a4('0x177')],_0x1917f5[_0x74a4('0x178')]>0x0?getCallerIdRandom(_0x1917f5['dialOriginateCallerIdNumber'],_0x1917f5[_0x74a4('0x178')]):_0x1917f5[_0x74a4('0x179')]);if(_0x164c5b){_0x29b5ce[_0x74a4('0x17a')]=_0x4bdcc2[_0x74a4('0x114')][_0x295bb9]['originatecalleridname']=extractCalleridName(_0x164c5b);_0x29b5ce[_0x74a4('0x17b')]=_0x4bdcc2[_0x74a4('0x114')][_0x295bb9][_0x74a4('0x17c')]=extractCalleridNumber(_0x164c5b);}return ami['Action']({'actionid':_0x295bb9,'action':_0x74a4('0x158'),'channel':_0x4bdcc2[_0x74a4('0xcd')](_0x1917f5[_0x74a4('0x6e')])?util[_0x74a4('0x71')](_0x74a4('0x17d'),_0x1917f5['Trunk'][_0x74a4('0x3a')],isNotNull(_0x1917f5[_0x74a4('0x53')])?_0x1917f5[_0x74a4('0x53')][_0x74a4('0x17e')]()||'':'',_0x1917f5[_0x74a4('0x17f')]>0x0?_0x24a1f6['Contact'][_0x74a4('0x15b')][_0x74a4('0x180')](_0x1917f5[_0x74a4('0x17f')]):_0x24a1f6[_0x74a4('0x15a')]['phone']):util[_0x74a4('0x71')]('SIP/%s/%s%s',_[_0x74a4('0xa2')](_0x1917f5[_0x74a4('0x12d')])?_0x1917f5[_0x74a4('0x6e')]['name']:_0x1917f5[_0x74a4('0x12d')][_0x74a4('0x3a')],isNotNull(_0x1917f5[_0x74a4('0x53')])?_0x1917f5['dialPrefix'][_0x74a4('0x17e')]()||'':'',_0x1917f5[_0x74a4('0x17f')]>0x0?_0x24a1f6['Contact']['phone'][_0x74a4('0x180')](_0x1917f5[_0x74a4('0x17f')]):_0x24a1f6[_0x74a4('0x15a')]['phone']),'callerid':_0x164c5b,'Exten':_0x74a4('0x162'),'Context':_0x74a4('0x181'),'Priority':'1','variable':_0x29b5ce,'timeout':(_0x1917f5[_0x74a4('0x52')]||0x1e)*0x3e8,'async':!![],'channelid':_0x295bb9})[_0x74a4('0xac')](function(_0x5c23bd){return _0x1f61cd(_0x5c23bd);})[_0x74a4('0xa6')](function(_0x1727ba){_0x1917f5['outboundOriginateFailureCallsDay']+=0x1;var _0x287e37=new History(_0x4bdcc2[_0x74a4('0x114')][_0x295bb9]);logger[_0x74a4('0x8b')](util[_0x74a4('0x71')](_0x74a4('0x182'),JSON[_0x74a4('0x42')](_0x1727ba)));_0x287e37['state']=0xe;_0x287e37[_0x74a4('0x9c')]=_0x74a4('0x183');_0x287e37[_0x74a4('0x10e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x287e37[_0x74a4('0x9d')]=_0x287e37[_0x74a4('0x10e')];_0x4bdcc2[_0x74a4('0xbe')](_0x287e37)[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x184')));_0x4bdcc2[_0x74a4('0xbc')](_0x287e37)[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x184')))[_0x74a4('0x1c')](function(){delete _0x4bdcc2[_0x74a4('0x114')][_0x295bb9];return _0x4bc074(msgResponse(_0x74a4('0x158'),'Error','originate\x20action\x20Error'));});});});};Dialer[_0x74a4('0x19')][_0x74a4('0x185')]=function(_0x5b66d9){var _0x5f013c=this[_0x74a4('0x114')][_0x5b66d9['actionid']];if(_0x5f013c){delete this[_0x74a4('0x114')][_0x5b66d9['actionid']];_0x5f013c[_0x74a4('0x107')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x28d6ae=_0x5f013c[_0x74a4('0x46')]===_0x74a4('0x73')?this[_0x74a4('0x1f')][_0x5f013c['queue']]:this['voiceQueues'][_0x5f013c[_0x74a4('0x186')]()];if(!this[_0x74a4('0xcb')](_0x5b66d9[_0x74a4('0x187')])){this[_0x74a4('0xc0')](_0x28d6ae);return this[_0x74a4('0x188')](_0x5f013c,_0x28d6ae,_0x5b66d9)[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x189')));}this[_0x74a4('0x25')][_0x5b66d9['uniqueid']]=_0x5f013c;}};Dialer[_0x74a4('0x19')][_0x74a4('0x18a')]=function(_0x3d0c6c,_0x2cc4f6,_0x472b59){var _0x14092d=new History(_0x2cc4f6);if(_0x14092d['countbusyretry']+_0x14092d[_0x74a4('0xe3')]+_0x14092d[_0x74a4('0xe4')]+_0x14092d[_0x74a4('0xe5')]+_0x14092d[_0x74a4('0xe6')]+_0x14092d[_0x74a4('0xf0')]+_0x14092d[_0x74a4('0xdf')]+_0x14092d[_0x74a4('0xf1')]>=_0x472b59['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x3d0c6c){case 0x3:if(_0x14092d[_0x74a4('0xe4')]>=_0x472b59['dialNoAnswerMaxRetry']-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x14092d[_0x74a4('0xe4')]+=0x1,'scheduledat':moment()[_0x74a4('0xf4')](_0x472b59[_0x74a4('0x18b')],_0x74a4('0xec'))['format'](_0x74a4('0xf5')),'ContactId':_0x14092d[_0x74a4('0xc6')],'ListId':_0x14092d[_0x74a4('0xc7')],'VoiceQueueId':_0x14092d[_0x74a4('0xc8')]||undefined,'CampaignId':_0x14092d['CampaignId']||undefined})[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x18c')));break;case 0x5:if(_0x14092d[_0x74a4('0xe2')]>=_0x472b59[_0x74a4('0x18d')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x14092d[_0x74a4('0xe2')]+=0x1,'scheduledat':moment()['add'](_0x472b59['dialBusyRetryFrequency'],_0x74a4('0xec'))[_0x74a4('0x71')](_0x74a4('0xf5')),'ContactId':_0x14092d[_0x74a4('0xc6')],'ListId':_0x14092d[_0x74a4('0xc7')],'VoiceQueueId':_0x14092d[_0x74a4('0xc8')]||undefined,'CampaignId':_0x14092d[_0x74a4('0xc9')]||undefined})[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x18e')));break;case 0x8:if(_0x14092d[_0x74a4('0xe3')]>=_0x472b59[_0x74a4('0x18f')]-0x1){return!![];}this[_0x74a4('0xb3')]({'active':![],'countcongestionretry':_0x14092d[_0x74a4('0xe3')]+=0x1,'scheduledat':moment()[_0x74a4('0xf4')](_0x472b59['dialCongestionRetryFrequency'],_0x74a4('0xec'))[_0x74a4('0x71')](_0x74a4('0xf5')),'ContactId':_0x14092d[_0x74a4('0xc6')],'ListId':_0x14092d[_0x74a4('0xc7')],'VoiceQueueId':_0x14092d[_0x74a4('0xc8')]||undefined,'CampaignId':_0x14092d[_0x74a4('0xc9')]||undefined})['catch'](loggerCatch(_0x74a4('0x190')));break;case 0x0:if(_0x14092d[_0x74a4('0xe5')]>=_0x472b59[_0x74a4('0x191')]-0x1){return!![];}else{this[_0x74a4('0xb3')]({'active':![],'countnosuchnumberretry':_0x14092d[_0x74a4('0xe5')]+=0x1,'scheduledat':moment()[_0x74a4('0xf4')](_0x472b59[_0x74a4('0x192')],'minutes')[_0x74a4('0x71')](_0x74a4('0xf5')),'ContactId':_0x14092d[_0x74a4('0xc6')],'ListId':_0x14092d[_0x74a4('0xc7')],'VoiceQueueId':_0x14092d[_0x74a4('0xc8')]||undefined,'CampaignId':_0x14092d[_0x74a4('0xc9')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x14092d['countdropretry']>=_0x472b59[_0x74a4('0x10b')]-0x1){return!![];}this[_0x74a4('0xb3')]({'active':![],'countdropretry':_0x14092d[_0x74a4('0xe6')]+=0x1,'scheduledat':moment()[_0x74a4('0xf4')](_0x472b59[_0x74a4('0x10c')],'minutes')[_0x74a4('0x71')](_0x74a4('0xf5')),'ContactId':_0x14092d['ContactId'],'ListId':_0x14092d[_0x74a4('0xc7')],'VoiceQueueId':_0x14092d[_0x74a4('0xc8')]||undefined,'CampaignId':_0x14092d[_0x74a4('0xc9')]||undefined})[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x10d')));break;case 0xb:if(_0x14092d[_0x74a4('0xf0')]>=_0x472b59[_0x74a4('0x193')]-0x1){return!![];}this[_0x74a4('0xb3')]({'active':![],'countabandonedretry':_0x14092d[_0x74a4('0xf0')]+=0x1,'scheduledat':moment()[_0x74a4('0xf4')](_0x472b59['dialAbandonedRetryFrequency'],_0x74a4('0xec'))[_0x74a4('0x71')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x14092d['ContactId'],'ListId':_0x14092d['ListId'],'VoiceQueueId':_0x14092d[_0x74a4('0xc8')]||undefined,'CampaignId':_0x14092d[_0x74a4('0xc9')]||undefined})['catch'](loggerCatch(_0x74a4('0x194')));break;case 0x13:if(_0x14092d[_0x74a4('0xdf')]>=_0x472b59[_0x74a4('0xf2')]-0x1){return!![];}this[_0x74a4('0xb3')]({'active':![],'countmachineretry':_0x14092d[_0x74a4('0xdf')]+=0x1,'scheduledat':moment()[_0x74a4('0xf4')](_0x472b59[_0x74a4('0xeb')],_0x74a4('0xec'))[_0x74a4('0x71')](_0x74a4('0xf5')),'ContactId':_0x14092d[_0x74a4('0xc6')],'ListId':_0x14092d[_0x74a4('0xc7')],'VoiceQueueId':_0x14092d['VoiceQueueId']||undefined,'CampaignId':_0x14092d[_0x74a4('0xc9')]||undefined})[_0x74a4('0xa6')](loggerCatch(_0x74a4('0xf6')));break;case 0x14:if(_0x14092d[_0x74a4('0xf1')]>=_0x472b59[_0x74a4('0x195')]-0x1){return!![];}this[_0x74a4('0xb3')]({'active':![],'countagentrejectretry':_0x14092d['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x74a4('0xf4')](_0x472b59[_0x74a4('0x196')],_0x74a4('0xec'))[_0x74a4('0x71')](_0x74a4('0xf5')),'ContactId':_0x14092d[_0x74a4('0xc6')],'ListId':_0x14092d[_0x74a4('0xc7')],'VoiceQueueId':_0x14092d[_0x74a4('0xc8')]||undefined,'CampaignId':_0x14092d[_0x74a4('0xc9')]||undefined})[_0x74a4('0xa6')](loggerCatch('[rescheduleContact][AgentReject]'));break;default:return!![];}};Dialer[_0x74a4('0x19')][_0x74a4('0x188')]=function(_0x3c0133,_0x310da9,_0x1ae0bd){var _0x170c0f=this;var _0x426206=new History(_0x3c0133);return new BPromise(function(_0x36aa6f,_0x46538e){if(_[_0x74a4('0x38')](_0x310da9)&&typeof _0x310da9!==_0x74a4('0x197')){return _0x46538e(msgResponse(_0x74a4('0x198'),_0x74a4('0x132'),_0x74a4('0x199')));}if(_[_0x74a4('0x38')](_0x1ae0bd)&&typeof _0x1ae0bd!==_0x74a4('0x197')){return _0x46538e(msgResponse(_0x74a4('0x198'),_0x74a4('0x132'),_0x74a4('0x19a')));}switch(_0x1ae0bd[_0x74a4('0xfe')]){case'0':_0x310da9[_0x74a4('0x19b')]+=0x1;_0x426206[_0x74a4('0x9b')]=0x0;_0x426206['statedesc']=_0x74a4('0x19c');_0x426206['countnosuchnumberretry']+=0x1;_0x426206['countglobal']+=0x1;ami[_0x74a4('0x45')](_0x74a4('0x19d'),ut[_0x74a4('0xd6')](_0x3c0133,_0x74a4('0x19e')));_0x170c0f[_0x74a4('0xbe')](_0x426206)[_0x74a4('0xa6')](loggerCatch(_0x74a4('0xef')));if(_0x170c0f[_0x74a4('0x18a')](0x0,_0x3c0133,_0x310da9)){if(_0x426206[_0x74a4('0xe5')]>=_0x310da9[_0x74a4('0x191')]){_0x170c0f[_0x74a4('0xf3')](_0x426206,_0x36aa6f,_0x46538e,_0x74a4('0x19f'));}else{_0x170c0f['stateGlobal'](_0x426206,_0x36aa6f,_0x46538e,_0x74a4('0x19f'));}}break;case'3':_0x310da9[_0x74a4('0x5a')]+=0x1;_0x426206[_0x74a4('0x9b')]=0x3;_0x426206[_0x74a4('0x9c')]=_0x74a4('0x1a0');_0x426206[_0x74a4('0xe4')]+=0x1;_0x426206[_0x74a4('0xe0')]+=0x1;ami[_0x74a4('0x45')](_0x74a4('0x1a1'),ut[_0x74a4('0xd6')](_0x3c0133,_0x74a4('0x1a2')));_0x170c0f[_0x74a4('0xbe')](_0x426206)[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x1a3')));if(_0x170c0f[_0x74a4('0x18a')](0x3,_0x3c0133,_0x310da9)){if(_0x426206[_0x74a4('0xe4')]>=_0x310da9['dialNoAnswerMaxRetry']){_0x170c0f[_0x74a4('0xf3')](_0x426206,_0x36aa6f,_0x46538e,_0x74a4('0x1a4'));}else{_0x170c0f[_0x74a4('0xe8')](_0x426206,_0x36aa6f,_0x46538e,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x310da9[_0x74a4('0x56')]+=0x1;_0x426206[_0x74a4('0x9b')]=0x5;_0x426206[_0x74a4('0x9c')]=_0x74a4('0x1a5');_0x426206['countbusyretry']+=0x1;_0x426206[_0x74a4('0xe0')]+=0x1;ami[_0x74a4('0x45')](_0x74a4('0x1a6'),ut[_0x74a4('0xd6')](_0x3c0133,'busy'));_0x170c0f['createHistory'](_0x426206)[_0x74a4('0xa6')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x170c0f['checkRetriveMax'](0x5,_0x3c0133,_0x310da9)){if(_0x426206[_0x74a4('0xe2')]>=_0x310da9[_0x74a4('0x18d')]){_0x170c0f['createStateFinal'](_0x426206,_0x36aa6f,_0x46538e,_0x74a4('0x1a7'));}else{_0x170c0f[_0x74a4('0xe8')](_0x426206,_0x36aa6f,_0x46538e,_0x74a4('0x1a7'));}}break;case'8':_0x310da9[_0x74a4('0x1a8')]+=0x1;_0x426206[_0x74a4('0x9b')]=0x8;_0x426206['statedesc']=_0x74a4('0x1a9');_0x426206[_0x74a4('0xe3')]+=0x1;_0x426206[_0x74a4('0xe0')]+=0x1;ami[_0x74a4('0x45')](_0x74a4('0x1aa'),ut[_0x74a4('0xd6')](_0x3c0133,'congestion'));_0x170c0f[_0x74a4('0xbe')](_0x426206)[_0x74a4('0xa6')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x170c0f[_0x74a4('0x18a')](0x8,_0x3c0133,_0x310da9)){if(_0x426206[_0x74a4('0xe3')]>=_0x310da9[_0x74a4('0x18f')]){_0x170c0f[_0x74a4('0xf3')](_0x426206,_0x36aa6f,_0x46538e,_0x74a4('0x1ab'));}else{_0x170c0f[_0x74a4('0xe8')](_0x426206,_0x36aa6f,_0x46538e,'reason\x208\x20congestion');}}break;case'11':_0x310da9['outboundAbandonedCallsDay']+=0x1;_0x426206[_0x74a4('0x9b')]=0xb;_0x426206[_0x74a4('0x9c')]=_0x74a4('0x112');_0x426206[_0x74a4('0xf0')]+=0x1;_0x426206[_0x74a4('0xe0')]+=0x1;_0x170c0f[_0x74a4('0xbe')](_0x426206)[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x1ac')));if(_0x170c0f['checkRetriveMax'](0xb,_0x3c0133,_0x310da9)){if(_0x426206[_0x74a4('0xf0')]>=_0x310da9[_0x74a4('0x193')]){_0x170c0f[_0x74a4('0xf3')](_0x426206,_0x36aa6f,_0x46538e,_0x74a4('0x1ad'));}else{_0x170c0f[_0x74a4('0xe8')](_0x426206,_0x36aa6f,_0x46538e,'reason\x2011\x20abandoned');}}break;case'20':_0x310da9[_0x74a4('0x1ae')]+=0x1;_0x426206[_0x74a4('0x9b')]=0x14;_0x426206[_0x74a4('0x9c')]=_0x74a4('0x1af');_0x426206[_0x74a4('0xf1')]+=0x1;_0x426206[_0x74a4('0xe0')]+=0x1;ami[_0x74a4('0x45')](_0x74a4('0x1b0'),ut[_0x74a4('0xd6')](_0x3c0133,_0x74a4('0x1b1')));_0x170c0f[_0x74a4('0xbe')](_0x426206)[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x1b2')));if(_0x170c0f[_0x74a4('0x18a')](0x14,_0x3c0133,_0x310da9)){if(_0x426206['countagentrejectretry']>=_0x310da9[_0x74a4('0x195')]){_0x170c0f['createStateFinal'](_0x426206,_0x36aa6f,_0x46538e,_0x74a4('0x1b3'));}else{_0x170c0f[_0x74a4('0xe8')](_0x426206,_0x36aa6f,_0x46538e,'reason\x2020\x20agentreject');}}break;default:_0x310da9[_0x74a4('0x5d')]+=0x1;_0x426206[_0x74a4('0x9b')]=0xc;_0x426206[_0x74a4('0x9c')]=_0x1ae0bd[_0x74a4('0xfe')];_0x170c0f['createHistory'](_0x426206)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x170c0f['checkRetriveMax'](_0x1ae0bd[_0x74a4('0xfe')],_0x3c0133,_0x310da9)){if(_0x426206[_0x74a4('0xe2')]+_0x426206['countcongestionretry']+_0x426206[_0x74a4('0xe4')]+_0x426206[_0x74a4('0xe5')]+_0x426206['countdropretry']+_0x426206[_0x74a4('0xf0')]+_0x426206[_0x74a4('0xdf')]+_0x426206[_0x74a4('0xf1')]>=_0x310da9[_0x74a4('0xe7')]){_0x170c0f[_0x74a4('0xe8')](_0x426206,_0x36aa6f,_0x46538e,_0x1ae0bd[_0x74a4('0xfe')]);}else{_0x170c0f[_0x74a4('0xf3')](_0x426206,_0x36aa6f,_0x46538e,_0x1ae0bd[_0x74a4('0xfe')]);}}}});};Dialer[_0x74a4('0x19')][_0x74a4('0xe8')]=function(_0xd02d34,_0x3b336f,_0x2a6e35,_0x54149d){var _0x195116=new Final(_0xd02d34);_0x195116['state']=0xf;_0x195116[_0x74a4('0x9c')]=_0x74a4('0x1b4');this[_0x74a4('0xf3')](_0x195116,_0x3b336f,_0x2a6e35,_0x54149d);};Dialer[_0x74a4('0x19')]['createStateFinal']=function(_0x53ac0d,_0x242e50,_0x3fbe75,_0x127477){this[_0x74a4('0xbc')](_0x53ac0d)[_0x74a4('0xac')](function(){return _0x242e50(msgResponse(_0x74a4('0x198'),'Success',_0x127477));})[_0x74a4('0xa6')](function(){return _0x3fbe75(msgResponse('[moveContactManagedDialer][0]','Failure','contact\x20not\x20moved'));});};Dialer[_0x74a4('0x19')][_0x74a4('0x147')]=function(_0x249da0){var _0x1b7c31=_0x249da0[_0x74a4('0x1b5')]/0x64;var _0x3395c8=_0x249da0['outboundDropCallsDayTimeout']/(_0x249da0['outboundDropCallsDayTimeout']+_0x249da0['outboundAnswerCallsDay']);var _0x143fcf=Math[_0x74a4('0x1b6')](_0x249da0['predictiveIntervalAvailable']*(_0x249da0[_0x74a4('0x1b7')]/0x64));var _0x58fba4=Math[_0x74a4('0x1b6')](_0x249da0[_0x74a4('0x1b8')]*(_0x249da0[_0x74a4('0x1b9')]/0x64));var _0x29f3a0=_0x249da0['available']+_0x249da0[_0x74a4('0x4d')];var _0x299ae0=Math['floor'](_0x249da0['erlangCalls']*_0x249da0[_0x74a4('0x82')]*_0x249da0[_0x74a4('0x65')]*_0x249da0[_0x74a4('0x66')]);if(_[_0x74a4('0x38')](_0x249da0[_0x74a4('0x26')])){if(!_[_0x74a4('0x38')](_0x249da0['startPredictive'])){_0x249da0[_0x74a4('0x6d')]=undefined;loggerPredictive['error'](_0x74a4('0x1ba'),_0x74a4('0x1bb'));}if(!_[_0x74a4('0x38')](_0x249da0[_0x74a4('0x87')])){loggerPredictive[_0x74a4('0x8b')]('[startMethodPredictive][StartProgressive]',_0x74a4('0x1bc'));clearInterval(_0x249da0['handlePredictive']);_0x249da0['handlePredictive']=undefined;}_0x249da0[_0x74a4('0x26')]=moment()[_0x74a4('0x71')](_0x74a4('0xf5'));loggerPredictive[_0x74a4('0x76')](_0x249da0[_0x74a4('0x3a')],_0x74a4('0x1bd'),_0x249da0[_0x74a4('0x26')]);this[_0x74a4('0x145')](_0x249da0,0x1);}else if(ifInterval(_0x249da0[_0x74a4('0x1be')],_0x249da0[_0x74a4('0x26')])){this[_0x74a4('0x145')](_0x249da0,0x1);loggerPredictiveCalls[_0x74a4('0x76')](_0x74a4('0x1bf'),_0x249da0['startProgressive'],_0x249da0['name']);_0x249da0[_0x74a4('0x6a')]=0x0;_0x249da0[_0x74a4('0x64')]=0x0;}else if(_0x1b7c31<_0x3395c8&&_0x249da0[_0x74a4('0x1c0')]===_0x74a4('0x1c1')){freeVariablesPredictive(_0x249da0);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x1c2'),'Dropped\x20calls\x20day',_0x3395c8,_0x74a4('0x26'),_0x249da0['name']);}else if(_0x299ae0<_0x249da0[_0x74a4('0x64')]&&_0x249da0[_0x74a4('0x1c0')]===_0x74a4('0x1c1')){freeVariablesPredictive(_0x249da0);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x1c3'),_0x74a4('0x1c4'),_0x299ae0,_0x74a4('0x1c5'),_0x249da0[_0x74a4('0x64')],_0x74a4('0x26'),_0x249da0['name']);}else if(!ifInterval(_0x249da0['dialPredictiveInterval'],_0x249da0[_0x74a4('0x26')])&&_[_0x74a4('0x38')](_0x249da0['startPredictive'])&&!_['isUndefined'](_0x249da0[_0x74a4('0x26')])){_0x249da0[_0x74a4('0x6d')]=moment()[_0x74a4('0x71')](_0x74a4('0xf5'));loggerPredictive['info'](_0x249da0[_0x74a4('0x3a')],_0x74a4('0x1c6'),_0x249da0['startPredictive']);this[_0x74a4('0xb0')](_0x249da0[_0x74a4('0x1be')])[_0x74a4('0xac')](this[_0x74a4('0x1c7')](_0x249da0))['then'](mergeDataErlangB(_0x249da0))[_0x74a4('0xac')](this[_0x74a4('0x1c8')](_0x249da0))[_0x74a4('0xa6')](loggerCatchPredictive(_0x74a4('0x1c9'),_0x249da0));}else if(!ifInterval(_0x249da0[_0x74a4('0x1be')],_0x249da0[_0x74a4('0x6d')])){_0x249da0['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x249da0[_0x74a4('0x6d')]=moment()['format'](_0x74a4('0xf5'));loggerPredictive[_0x74a4('0x76')](_0x249da0['name'],'recalculate\x20predictive\x20at',_0x249da0[_0x74a4('0x6d')]);clearInterval(_0x249da0['handlePredictive']);_0x249da0[_0x74a4('0x87')]=undefined;this[_0x74a4('0xb0')](_0x249da0[_0x74a4('0x1be')])[_0x74a4('0xac')](this['getDataPredictive'](_0x249da0))[_0x74a4('0xac')](mergeDataErlangB(_0x249da0))[_0x74a4('0xac')](this[_0x74a4('0x1c8')](_0x249da0))[_0x74a4('0xa6')](loggerCatchPredictive(_0x74a4('0x1ca'),_0x249da0));}else if(_0x249da0[_0x74a4('0x1b8')]&&_0x29f3a0<_0x249da0[_0x74a4('0x1b8')]-_0x58fba4){freeVariablesPredictive(_0x249da0);loggerPredictive['info'](_0x249da0['name'],_0x74a4('0x1cb'),_0x29f3a0,_0x74a4('0x1cc'),_0x249da0['predictiveIntervalAvailable'],'-',_0x58fba4,'=',_0x249da0[_0x74a4('0x1b8')]-_0x58fba4,')');}else if(_0x249da0['predictiveIntervalAvailable']&&_0x29f3a0>_0x249da0[_0x74a4('0x1b8')]+_0x143fcf){freeVariablesPredictive(_0x249da0);loggerPredictive[_0x74a4('0x76')](_0x249da0['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x29f3a0,')\x20are\x20more\x20than\x20threshold\x20(',_0x249da0[_0x74a4('0x1b8')],'+',_0x143fcf,'=',_0x249da0[_0x74a4('0x1b8')]+_0x143fcf,')');}};Dialer['prototype']['getDataPredictive']=function(_0x1acfd6){var _0xf3e9ff=this;return function(_0x4d895f){return new BPromise(function(_0x362e7c,_0x179285){_['merge'](_0x1acfd6,_0x4d895f[0x0]);if(checkGetDataPredictive(_0x4d895f[0x0])){var _0x5697f0=_0x1acfd6[_0x74a4('0x1b8')]=_0x1acfd6[_0x74a4('0x4d')]+_0x1acfd6[_0x74a4('0x48')];var _0xb7e4e0=_0x1acfd6[_0x74a4('0x1be')]*0x3c;var _0x54e437=_0x4d895f[0x0][_0x74a4('0x60')]+_0x4d895f[0x0][_0x74a4('0x5f')];var _0x195b55=(_0x4d895f[0x0]['predictiveIntervalAnsweredCalls']+_0x4d895f[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4d895f[0x0][_0x74a4('0x61')])/_0x4d895f[0x0]['predictiveIntervalTotalCalls'];_0x1acfd6[_0x74a4('0x65')]=_0x195b55>0x0?_0x195b55:0x1;switch(_0x1acfd6[_0x74a4('0x1c0')]){case'dropRate':var _0x3e6c5d=_0x1acfd6[_0x74a4('0x1b5')]/0x64;return _0xf3e9ff[_0x74a4('0x1cd')](_0x5697f0,_0xb7e4e0,_0x54e437,_0x195b55,_0x3e6c5d)['then'](function(_0x27ff58){return _0x362e7c(_0x27ff58);});case _0x74a4('0x1ce'):var _0x204371=_0x1acfd6['dialPredictiveOptimizationPercentage']/0x64;return _0xf3e9ff[_0x74a4('0x1cf')](_0x5697f0,_0xb7e4e0,_0x54e437,_0x195b55,_0x204371)[_0x74a4('0xac')](function(_0x1a046c){return _0x362e7c(_0x1a046c);});default:return _0x179285(msgResponse(_0x74a4('0x1d0'),'Failure',_0x74a4('0x1d1')));}}else{return _0x179285(msgResponse(_0x74a4('0x1d0'),'Failure',_0x74a4('0x1d2')));}});};};Dialer['prototype']['getDataPredictiveOld']=function(_0x28955e){var _0x3a461d=this;return function(_0x41f1ec){return new BPromise(function(_0x2fa2c1,_0x396e07){_[_0x74a4('0x11c')](_0x28955e,_0x41f1ec[0x0]);if(checkGetDataPredictive(_0x41f1ec[0x0])){loggerPredictive[_0x74a4('0x76')](JSON[_0x74a4('0x42')](_0x41f1ec[0x0]));if(_0x28955e[_0x74a4('0x1c0')]===_0x74a4('0x1c1')){return _0x3a461d[_0x74a4('0xba')](_0x28955e['id'])[_0x74a4('0xac')](function(_0x492b45){var _0x9d08c9=_0x28955e[_0x74a4('0x49')]-_0x492b45[0x0]['outboundQueuePauses'];var _0x168824=_0x28955e[_0x74a4('0x1be')]*0x3c;var _0x45583a=_0x41f1ec[0x0]['predictiveIntervalAvgTalktime']+_0x41f1ec[0x0][_0x74a4('0x5f')];var _0x43a1c5=(_0x41f1ec[0x0][_0x74a4('0x5e')]+_0x41f1ec[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x41f1ec[0x0][_0x74a4('0x61')])/_0x41f1ec[0x0]['predictiveIntervalTotalCalls'];var _0x34e25b=_0x28955e[_0x74a4('0x1b5')]/0x64;_0x28955e[_0x74a4('0x67')]=_0x492b45[0x0]['outboundQueuePauses']||0x0;_0x28955e[_0x74a4('0x65')]=_0x43a1c5>0x0?_0x43a1c5:0x1;return _0x3a461d['abandonmentRate'](_0x9d08c9,_0x168824,_0x45583a,_0x43a1c5,_0x34e25b);})[_0x74a4('0xac')](function(_0x4175da){return _0x2fa2c1(_0x4175da);})[_0x74a4('0xa6')](function(_0x3f2d3c){return _0x396e07(msgResponse(_0x74a4('0x1d3'),'Failure',JSON[_0x74a4('0x42')](_0x3f2d3c)));});}if(_0x28955e[_0x74a4('0x1c0')]===_0x74a4('0x1ce')){return _0x3a461d[_0x74a4('0xba')](_0x28955e['id'])[_0x74a4('0xac')](function(_0x21664c){var _0x3b7418=_0x28955e['loggedIn']-_0x21664c[0x0][_0x74a4('0x1d4')];var _0x2d86d4=_0x28955e['dialPredictiveInterval']*0x3c;var _0x385d46=_0x41f1ec[0x0]['predictiveIntervalAvgTalktime']+_0x41f1ec[0x0][_0x74a4('0x5f')];var _0x109911=(_0x41f1ec[0x0]['predictiveIntervalAnsweredCalls']+_0x41f1ec[0x0][_0x74a4('0x62')]+_0x41f1ec[0x0][_0x74a4('0x61')])/_0x41f1ec[0x0][_0x74a4('0x68')];var _0xf9603d=_0x28955e[_0x74a4('0x1b5')]/0x64;_0x28955e[_0x74a4('0x67')]=_0x21664c[0x0][_0x74a4('0x1d4')]||0x0;_0x28955e[_0x74a4('0x65')]=_0x109911>0x0?_0x109911:0x1;return _0x3a461d[_0x74a4('0x1cf')](_0x3b7418,_0x2d86d4,_0x385d46,_0x109911,_0xf9603d);})[_0x74a4('0xac')](function(_0x5f52fa){return _0x2fa2c1(_0x5f52fa);})[_0x74a4('0xa6')](function(_0x49cd1b){return _0x396e07(msgResponse(_0x74a4('0x1d3'),'Failure',JSON['stringify'](_0x49cd1b)));});}}else{return _0x396e07(msgResponse('[getDataPredictive]',_0x74a4('0x132'),'check\x20failure'));}});};};Dialer[_0x74a4('0x19')][_0x74a4('0x1c8')]=function(_0x463c7e){var _0xda86b4=this;return function(){var _0x4d5a58=0x0;var _0x58202a=Math[_0x74a4('0x1d5')](_0x463c7e['erlangCallToSecond']*0x3e8);if(_0x58202a>0x0){_0x58202a=_0x58202a<0x64?0x64:_0x58202a;loggerPredictive[_0x74a4('0x76')](_0x463c7e[_0x74a4('0x3a')],_0x74a4('0x1d6'),_0x58202a,_0x74a4('0x43'));_0x463c7e['handlePredictive']=setInterval(function(){_0xda86b4[_0x74a4('0x87')](_0x463c7e);loggerPredictiveCalls[_0x74a4('0x76')](_0x74a4('0x1d7'),_0x4d5a58+=0x1);},_0x58202a);}else{loggerPredictive[_0x74a4('0x76')](_0x463c7e[_0x74a4('0x3a')],_0x74a4('0x1d8'));}};};Dialer[_0x74a4('0x19')][_0x74a4('0x1d9')]=function(_0x3b7bb7,_0x3c1b9e){var _0x25e77d=this;return function(_0x3f3178){if(_[_0x74a4('0x75')](_0x3f3178)){if(_[_0x74a4('0xa2')](_0x3c1b9e['UserId'])||!_0x3c1b9e[_0x74a4('0x1da')]){if(_0x3b7bb7[_0x74a4('0x51')]==='booked'){_0x3b7bb7['queueStatusComplete']=_[_0x74a4('0x38')](_0x3b7bb7[_0x74a4('0x11d')])?!![]:_0x3b7bb7['queueStatusComplete'];var _0x542bc7=uuid['v4']();_0x25e77d[_0x74a4('0x114')][_0x542bc7]=new Action(_0x3b7bb7,_0x3c1b9e,_0x542bc7);loggerBooked[_0x74a4('0x76')]('[booked][checkContactBlack]',_0x542bc7,_0x74a4('0x1db'),JSON[_0x74a4('0x42')](_0x3b7bb7['queueStatusComplete']),_0x74a4('0x1dc'),_0x3b7bb7[_0x74a4('0x3a')]);if(_0x3b7bb7[_0x74a4('0x11d')]){_0x3b7bb7['queueStatusComplete']=![];_0x25e77d[_0x74a4('0x28')][_0x25e77d[_0x74a4('0x114')][_0x542bc7]['queue']]=[];ami['Action']({'actionid':_0x542bc7,'action':_0x74a4('0x1dd'),'queue':_0x3b7bb7[_0x74a4('0x3a')]})[_0x74a4('0xa6')](function(){_0x25e77d[_0x74a4('0xc0')](_0x3b7bb7);_0x25e77d[_0x74a4('0xb3')]({'active':![],'ContactId':_0x25e77d[_0x74a4('0x114')][_0x542bc7][_0x74a4('0xc6')],'ListId':_0x25e77d[_0x74a4('0x114')][_0x542bc7]['ListId'],'VoiceQueueId':_0x25e77d[_0x74a4('0x114')][_0x542bc7][_0x74a4('0xc8')]||undefined,'CampaignId':_0x25e77d['actions'][_0x542bc7][_0x74a4('0xc9')]||undefined})[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x1de')));delete _0x25e77d['actions'][_0x542bc7];});}else{loggerBooked[_0x74a4('0x76')](_0x74a4('0x1df'),JSON['stringify'](_0x3b7bb7[_0x74a4('0x11d')]),_0x74a4('0x1dc'),_0x3b7bb7['name']);_0x25e77d[_0x74a4('0xc0')](_0x3b7bb7);_0x25e77d[_0x74a4('0xb3')]({'active':![],'ContactId':_0x25e77d['actions'][_0x542bc7][_0x74a4('0xc6')],'ListId':_0x25e77d[_0x74a4('0x114')][_0x542bc7][_0x74a4('0xc7')],'VoiceQueueId':_0x25e77d[_0x74a4('0x114')][_0x542bc7][_0x74a4('0xc8')]||undefined,'CampaignId':_0x25e77d[_0x74a4('0x114')][_0x542bc7][_0x74a4('0xc9')]||undefined})[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x1de')));delete _0x25e77d[_0x74a4('0x114')][_0x542bc7];}}else{return _0x25e77d['actionOriginate'](_0x3b7bb7,_0x3c1b9e);}}else{if(getDiff(_0x3c1b9e[_0x74a4('0x1e0')])<_0x3b7bb7[_0x74a4('0x1e1')]*0x3c){if(_0x3c1b9e[_0x74a4('0x1e2')]&&!_0x3c1b9e[_0x74a4('0x1e2')][_0x74a4('0x1e3')]){_0x25e77d[_0x74a4('0x1d')][_0x74a4('0x120')](_0x3c1b9e['id'])['finally'](function(){_0x25e77d[_0x74a4('0xc0')](_0x3b7bb7);});}else{_0x25e77d[_0x74a4('0xb5')]({'active':![]},_0x3c1b9e['id'],0x1)['finally'](function(){_0x25e77d[_0x74a4('0xc0')](_0x3b7bb7);});}}else{_0x3b7bb7['outboundReCallsDay']+=0x1;_0x25e77d['updateOriginated'](_0x3b7bb7);if(_0x3b7bb7[_0x74a4('0x1e4')]){_0x25e77d['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3c1b9e[_0x74a4('0xc6')],'ListId':_0x3c1b9e[_0x74a4('0xc7')],'VoiceQueueId':_0x3c1b9e['VoiceQueueId']||undefined,'CampaignId':_0x3c1b9e[_0x74a4('0xc9')]||undefined})[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x1e5')));_0x25e77d[_0x74a4('0xbe')](createObjHistory(_0x3b7bb7,_0x3c1b9e,'RECALLINQUEUE',0x17,_0x74a4('0x1e6')))[_0x74a4('0xa6')](loggerCatch(_0x74a4('0x1e7')));}else{_0x25e77d[_0x74a4('0xc4')](createObjHistory(_0x3b7bb7,_0x3c1b9e,_0x74a4('0x1e8'),0x16,_0x74a4('0x1e9')),_0x74a4('0x1ea'),_0x74a4('0x1eb'));}}}}else{_0x3b7bb7[_0x74a4('0x55')]+=0x1;_0x25e77d[_0x74a4('0xc4')](createObjHistory(_0x3b7bb7,_0x3c1b9e,'BLACKLIST',0xd,_0x74a4('0x1ec')),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw _0x74a4('0x1ed');}};};Dialer[_0x74a4('0x19')][_0x74a4('0x14b')]=function(_0xc6f824){var _0x3bde02=this;var _0x31f092=_0xc6f824['limitCalls']-_0xc6f824[_0x74a4('0x69')]-_0xc6f824[_0x74a4('0xb8')];emitCampaignSummary(_0xc6f824);if(_0x31f092>0x0){if(_0x31f092>this[_0x74a4('0x22')]){_0x31f092=this[_0x74a4('0x22')];}_0xc6f824['temp']+=_0x31f092;this['getContactDialerIvr'](_0xc6f824['id'],_0x31f092,_0xc6f824['dialOrderByScheduledAt'],_0xc6f824)[_0x74a4('0xac')](function(_0x5e6416){_0xc6f824['temp']-=_0x31f092;_0xc6f824[_0x74a4('0xb8')]=_0xc6f824['temp']>0x0?_0xc6f824['temp']:0x0;if(!checkContactEmpty(_0x5e6416)){_0xc6f824[_0x74a4('0x3d')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x74a4('0x76')]('[getContactCampaign2][Empty]'+_0xc6f824[_0x74a4('0x3a')]);}else{_0xc6f824[_0x74a4('0x69')]+=_0x5e6416['length'];_0xc6f824[_0x74a4('0x3d')]=_0x74a4('0x1ee');for(var _0x4e91ca=0x0;_0x4e91ca<_0x5e6416[_0x74a4('0x8d')];_0x4e91ca+=0x1){_0xc6f824[_0x74a4('0x1ef')]+=0x1;if(_[_0x74a4('0xa2')](_0x5e6416[_0x4e91ca])||_[_0x74a4('0xa2')](_0x5e6416[_0x4e91ca][_0x74a4('0x15a')])||_['isNil'](_0x5e6416[_0x4e91ca][_0x74a4('0x15a')][_0x74a4('0x15b')])){_0x3bde02[_0x74a4('0xc2')](_0x74a4('0x1f0'),_0xc6f824,_0x5e6416[_0x4e91ca]);}else{_0x3bde02['checkIsBlackListIvr'](_[_0x74a4('0xc5')](_0x5e6416[_0x4e91ca],[_0x74a4('0xc9'),_0x74a4('0x1f1')]))['then'](_0x3bde02[_0x74a4('0x1d9')](_0xc6f824,_0x5e6416[_0x4e91ca]))[_0x74a4('0xa6')](_0x3bde02[_0x74a4('0x1f2')](_0x74a4('0x1f3'),_0xc6f824));}}}})[_0x74a4('0xa6')](loggerGetContactDialer(_0x74a4('0x1f4'),_0xc6f824,_0x31f092));}};Dialer[_0x74a4('0x19')]['handlePower']=function(_0x153af6,_0x304edc){var _0x498b9e=this;var _0x4e1767=[];var _0x252a5c=_0x304edc>=0x1?_0x304edc:0x1;if(_0x153af6['dialMethod']===_0x74a4('0x8')){_0x252a5c=0x1;}var _0x34b7b6=Math[_0x74a4('0x1d5')](_0x153af6[_0x74a4('0x48')]*_0x252a5c)-_0x153af6['originated']-_0x153af6['temp'];emitVoiceQueueSummary(_0x153af6);if(_0x153af6['dialLimitQueue']>0x0){var _0x2bde95=_0x153af6[_0x74a4('0x1f5')]-_0x153af6['originated']-_0x153af6[_0x74a4('0x4d')]-_0x153af6['temp']-_0x153af6['pTalking'];if(_0x34b7b6>_0x2bde95){_0x34b7b6=_0x2bde95;}}if(_0x34b7b6>0x0){if(_0x153af6['dialMethod']===_0x74a4('0x8')){_0x34b7b6=0x1;}if(_0x34b7b6>this[_0x74a4('0x22')]){_0x34b7b6=this[_0x74a4('0x22')];}_0x153af6['temp']+=_0x34b7b6;for(var _0x4d210a in this[_0x74a4('0x20')]){if(typeof this[_0x74a4('0x20')][_0x4d210a]!==_0x74a4('0x8e')){if(this['agents'][_0x4d210a]['state']===_0x74a4('0x1f6')&&this[_0x74a4('0x20')][_0x4d210a][_0x74a4('0xa4')]===_0x74a4('0x1f7')){_0x4e1767[_0x74a4('0x11b')](this['agents'][_0x4d210a]['id']);}}}this[_0x74a4('0xb7')](_0x153af6['id'],_0x4e1767,_0x34b7b6,_0x153af6[_0x74a4('0x1f8')],_0x153af6)['then'](function(_0x2b72b0){_0x153af6[_0x74a4('0xb8')]-=_0x34b7b6;_0x153af6[_0x74a4('0xb8')]=_0x153af6[_0x74a4('0xb8')]>0x0?_0x153af6[_0x74a4('0xb8')]:0x0;if(!checkContactEmpty(_0x2b72b0)){_0x498b9e['countReScheduled'](_0x153af6)['then'](sendMessageReschedule(_0x153af6))['catch'](loggerCatch('[countReScheduled]\x20'));}else{_0x153af6[_0x74a4('0x69')]+=_0x2b72b0[_0x74a4('0x8d')];_0x153af6[_0x74a4('0x3d')]=_0x153af6['dialMethod']===_0x74a4('0x8')?_0x74a4('0x161'):_0x74a4('0x1ee');for(var _0x42284d=0x0;_0x42284d<_0x2b72b0['length'];_0x42284d+=0x1){if(_['isNil'](_0x2b72b0[_0x42284d])||_[_0x74a4('0xa2')](_0x2b72b0[_0x42284d]['Contact'])||_[_0x74a4('0xa2')](_0x2b72b0[_0x42284d][_0x74a4('0x15a')][_0x74a4('0x15b')])){_0x498b9e[_0x74a4('0xc2')](_0x74a4('0x1f0'),_0x153af6,_0x2b72b0[_0x42284d]);}else{_0x498b9e[_0x74a4('0xae')](_[_0x74a4('0xc5')](_0x2b72b0[_0x42284d],[_0x74a4('0xc8'),'Contact.phone']))[_0x74a4('0xac')](_0x498b9e[_0x74a4('0x1d9')](_0x153af6,_0x2b72b0[_0x42284d]))[_0x74a4('0xa6')](_0x498b9e['loggerHandler']('[actionOriginate]\x20',_0x153af6));}}}})[_0x74a4('0xa6')](loggerGetContactDialer('[getContactDialer2]',_0x153af6,_0x34b7b6));}};Dialer[_0x74a4('0x19')][_0x74a4('0x87')]=function(_0x5ae559){if(_0x5ae559[_0x74a4('0x1f5')]>0x0){var _0x1e094b=_0x5ae559[_0x74a4('0x1f5')]-_0x5ae559[_0x74a4('0x69')]-_0x5ae559[_0x74a4('0x4d')];if(_0x1e094b>0x0){this[_0x74a4('0x1f9')](_0x5ae559);}else{loggerPredictiveCalls[_0x74a4('0x76')](_0x74a4('0x1fa'));}}else{this[_0x74a4('0x1f9')](_0x5ae559);}};Dialer[_0x74a4('0x19')][_0x74a4('0x1f9')]=function(_0x55bb9d){var _0x1ed62f=this;var _0x5a9d43=[];_0x55bb9d[_0x74a4('0x69')]+=0x1;for(var _0x3def6f in this[_0x74a4('0x20')]){if(typeof this['agents'][_0x3def6f]!=='undefined'){if(this[_0x74a4('0x20')][_0x3def6f][_0x74a4('0x9b')]==='not_inuse'&&this['agents'][_0x3def6f][_0x74a4('0xa4')]===_0x74a4('0x1f7')){_0x5a9d43[_0x74a4('0x11b')](this[_0x74a4('0x20')][_0x3def6f]['id']);}}}this[_0x74a4('0xb7')](_0x55bb9d['id'],_0x5a9d43,0x1,_0x55bb9d[_0x74a4('0x1f8')],_0x55bb9d)[_0x74a4('0xac')](function(_0x19ec1f){if(!checkContactEmpty(_0x19ec1f)){checkContactLowerLimitOriginate(_0x55bb9d,0x1,0x0);_0x1ed62f[_0x74a4('0xaa')](_0x55bb9d)['then'](sendMessageReschedule(_0x55bb9d))[_0x74a4('0xa6')](loggerCatch('[countReScheduled]\x20'));}else{_0x55bb9d[_0x74a4('0x3d')]=_0x74a4('0x1ee');if(_['isNil'](_0x19ec1f[0x0])||_[_0x74a4('0xa2')](_0x19ec1f[0x0][_0x74a4('0x15a')])||_[_0x74a4('0xa2')](_0x19ec1f[0x0]['Contact'][_0x74a4('0x15b')])){_0x1ed62f[_0x74a4('0xc2')](_0x74a4('0x1f0'),_0x55bb9d,_0x19ec1f[0x0]);}else{_0x1ed62f['checkIsBlackList'](_[_0x74a4('0xc5')](_0x19ec1f[0x0],[_0x74a4('0xc8'),'Contact.phone']))[_0x74a4('0xac')](_0x1ed62f['checkContactBlack'](_0x55bb9d,_0x19ec1f[0x0]))[_0x74a4('0xa6')](_0x1ed62f['loggerHandler'](_0x74a4('0x1fb'),_0x55bb9d));}}})[_0x74a4('0xa6')](loggerGetContactDialer('[getContactDialerPredictive]',_0x55bb9d,0x1));emitVoiceQueueSummary(_0x55bb9d);};Dialer[_0x74a4('0x19')][_0x74a4('0x1cd')]=function(_0x103ee3,_0x476189,_0x457f22,_0x5b6484,_0x1e756f,_0x5cb93d){loggerPredictive['info']('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x74a4('0x76')]('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',_0x103ee3);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x1fc'),_0x476189);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x1fd'),_0x457f22);loggerPredictive['info'](_0x74a4('0x1fe'),_0x5b6484);loggerPredictive['info'](_0x74a4('0x1ff'),_0x1e756f);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x84'));return new BPromise(function(_0x915349,_0x5730a6){if(_0x103ee3<=0x0||isNaN(_0x103ee3)){return _0x5730a6(msgResponse(_0x74a4('0x200'),_0x74a4('0x201'),'m\x20=\x20'+_0x103ee3));}if(_0x457f22<=0x0||isNaN(_0x457f22)){return _0x5730a6(msgResponse('[abandonmentRate]',_0x74a4('0x201'),'Ts\x20=\x20'+_0x457f22));}if(_0x5b6484<=0x0||isNaN(_0x5b6484)){return _0x5730a6(msgResponse(_0x74a4('0x200'),_0x74a4('0x201'),_0x74a4('0x202')+_0x5b6484));}if(_0x476189<=0x0||isNaN(_0x476189)){return _0x5730a6(msgResponse(_0x74a4('0x200'),_0x74a4('0x201'),_0x74a4('0x203')+_0x476189));}if(_0x1e756f<=0x0||isNaN(_0x1e756f)){return _0x5730a6(msgResponse('[abandonmentRate]','Error',_0x74a4('0x204')+_0x1e756f));}_0x5cb93d=_0x5cb93d||0x0;var _0x4c2116=0x1/_0x457f22;var _0x2ba523=0x0;var _0x1a33b1=0x0;var _0x2827c7=0x0;var _0x3af1b1=0x0;for(var _0x5c5a9e=0x0;_0x2827c7<_0x1e756f;_0x5c5a9e+=0x1){_0x1a33b1=_0x5c5a9e/_0x476189;_0x2ba523=(_0x5b6484*_0x1a33b1+_0x5cb93d)/_0x4c2116;_0x2827c7=erlangb(_0x2ba523,_0x103ee3);_0x3af1b1=_0x2ba523/_0x103ee3*(0x1-erlangb(_0x2ba523,_0x103ee3));}return _0x915349({'erlangCalls':_0x5c5a9e,'erlangCallToSecond':_0x476189/_0x5c5a9e,'erlangAbandonmentRate':_0x2827c7,'erlangBusyFactor':_0x3af1b1});});};Dialer[_0x74a4('0x19')][_0x74a4('0x1cf')]=function(_0x17208a,_0x3aada7,_0xaea958,_0x3d2fe3,_0x38fcce,_0x384e36){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x74a4('0x76')](_0x74a4('0x205'),_0x17208a);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3aada7);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x1fd'),_0xaea958);loggerPredictive[_0x74a4('0x76')]('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',_0x3d2fe3);loggerPredictive[_0x74a4('0x76')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x38fcce);loggerPredictive[_0x74a4('0x76')](_0x74a4('0x84'));return new BPromise(function(_0x4cf54b,_0x34dfef){if(_0x17208a<=0x0||isNaN(_0x17208a)){return _0x34dfef(msgResponse(_0x74a4('0x206'),'Error',_0x74a4('0x207')+_0x17208a));}if(_0xaea958<=0x0||isNaN(_0xaea958)){return _0x34dfef(msgResponse(_0x74a4('0x206'),_0x74a4('0x201'),'Ts\x20=\x20'+_0xaea958));}if(_0x3d2fe3<=0x0||isNaN(_0x3d2fe3)){return _0x34dfef(msgResponse(_0x74a4('0x206'),_0x74a4('0x201'),_0x74a4('0x202')+_0x3d2fe3));}if(_0x3aada7<=0x0||isNaN(_0x3aada7)){return _0x34dfef(msgResponse(_0x74a4('0x206'),'Error',_0x74a4('0x203')+_0x3aada7));}if(_0x38fcce<=0x0||isNaN(_0x38fcce)){return _0x34dfef(msgResponse(_0x74a4('0x206'),_0x74a4('0x201'),'Umin\x20=\x20'+_0x38fcce));}_0x384e36=_0x384e36||0x0;var _0x24455c=0x1/_0xaea958;var _0x3617bb=0x0;var _0x3084fe=0x0;var _0x3fb199=0x0;var _0x395a63=0x0;for(var _0x30ec97=0x0;_0x395a63<_0x38fcce;_0x30ec97+=0x1){_0x3084fe=_0x30ec97/_0x3aada7;_0x3617bb=(_0x3d2fe3*_0x3084fe+_0x384e36)/_0x24455c;_0x3fb199=erlangb(_0x3617bb,_0x17208a);_0x395a63=_0x3617bb/_0x17208a*(0x1-erlangb(_0x3617bb,_0x17208a));}return _0x4cf54b({'erlangCalls':_0x30ec97,'erlangCallToSecond':_0x3aada7/_0x30ec97,'erlangAbandonmentRate':_0x3fb199,'erlangBusyFactor':_0x395a63});});};module[_0x74a4('0x208')]=Dialer;
\ No newline at end of file
index 2fba5cd..80945a5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7e2a=['responsetime','droptime','holdtime','connectedlinename','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','seconds','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','calleridname','calleridnum','number','starttime'];(function(_0x569560,_0x16b989){var _0x3c1de0=function(_0x1f652b){while(--_0x1f652b){_0x569560['push'](_0x569560['shift']());}};_0x3c1de0(++_0x16b989);}(_0x7e2a,0x1b2));var _0xa7e2=function(_0x418361,_0x5816c8){_0x418361=_0x418361-0x0;var _0x3f2c3c=_0x7e2a[_0x418361];return _0x3f2c3c;};'use strict';var util=require(_0xa7e2('0x0'));var _=require(_0xa7e2('0x1'));var moment=require(_0xa7e2('0x2'));function getSeconds(_0x169cc4,_0x97c978){var _0x3055b0=moment(_0x169cc4)['milliseconds'](0x0);var _0x478b72=moment(_0x97c978)[_0xa7e2('0x3')](0x0);return _0x3055b0['diff'](_0x478b72,_0xa7e2('0x4'));}function QueueCallerAbandon(_0x4f60b9,_0x5d48e3){this[_0xa7e2('0x5')]=_0x4f60b9[_0xa7e2('0x5')];this['type']=_0x4f60b9['type'];this['campaigntype']=_0x4f60b9[_0xa7e2('0x6')]===_0xa7e2('0x7')?_0xa7e2('0x8'):_0x4f60b9['type'];this[_0xa7e2('0x9')]=_0x4f60b9['countbusyretry'];this[_0xa7e2('0xa')]=_0x4f60b9[_0xa7e2('0xa')];this[_0xa7e2('0xb')]=_0x4f60b9['countnoanswerretry'];this[_0xa7e2('0xc')]=_0x4f60b9[_0xa7e2('0x9')]+_0x4f60b9[_0xa7e2('0xa')]+_0x4f60b9[_0xa7e2('0xb')]+_0x4f60b9[_0xa7e2('0xd')]+_0x4f60b9['countdropretry']+_0x4f60b9['countabandonedretry']+_0x4f60b9[_0xa7e2('0xe')]+_0x4f60b9[_0xa7e2('0xf')];this['countnosuchnumberretry']=_0x4f60b9[_0xa7e2('0xd')];this[_0xa7e2('0x10')]=_0x4f60b9[_0xa7e2('0x10')];this[_0xa7e2('0x11')]=_0x4f60b9[_0xa7e2('0x11')];this['countmachineretry']=_0x4f60b9['countmachineretry'];this[_0xa7e2('0xf')]=_0x4f60b9[_0xa7e2('0xf')];this['uniqueid']=_0x5d48e3['uniqueid'];this[_0xa7e2('0x12')]=_0x4f60b9['name'];this[_0xa7e2('0x13')]=_0x4f60b9[_0xa7e2('0x14')];this[_0xa7e2('0x15')]=_0x4f60b9['starttime'];this[_0xa7e2('0x16')]=_0x4f60b9['responsetime'];this[_0xa7e2('0x17')]=_0x4f60b9['droptime'];this['endtime']=this['droptime'];this['ringtime']=getSeconds(_0x4f60b9['responsetime'],_0x4f60b9[_0xa7e2('0x15')]);this[_0xa7e2('0x18')]=getSeconds(this['droptime'],_0x4f60b9[_0xa7e2('0x16')]);this['talktime']=0x0;this[_0xa7e2('0x8')]=_0x5d48e3['queue'];this['membername']=_0x5d48e3[_0xa7e2('0x19')];this[_0xa7e2('0x1a')]=_0x5d48e3[_0xa7e2('0x1a')];this[_0xa7e2('0x1b')]=_0x4f60b9[_0xa7e2('0x1b')];this['callbackuniqueid']=_0x4f60b9['callbackuniqueid'];this['callbackat']=_0x4f60b9[_0xa7e2('0x1c')];this[_0xa7e2('0x1d')]=_0x4f60b9[_0xa7e2('0x1d')];this[_0xa7e2('0x1e')]=_0x4f60b9[_0xa7e2('0x1e')];this[_0xa7e2('0x1f')]=_0x4f60b9[_0xa7e2('0x1f')];this['UserId']=_0x4f60b9[_0xa7e2('0x20')];this[_0xa7e2('0x21')]=_0x4f60b9[_0xa7e2('0x21')];this[_0xa7e2('0x22')]=_0x4f60b9[_0xa7e2('0x22')];this['originatecalleridnum']=_0x4f60b9[_0xa7e2('0x23')]||'';this[_0xa7e2('0x24')]=_0x4f60b9[_0xa7e2('0x24')]||'';}module[_0xa7e2('0x25')]=QueueCallerAbandon;
\ No newline at end of file
+var _0x5e99=['type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime','endtime','ringtime','membername','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','milliseconds','diff','seconds','scheduledat'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x5e99,0x19d));var _0x95e9=function(_0x16d7c6,_0x4338a4){_0x16d7c6=_0x16d7c6-0x0;var _0x2838ac=_0x5e99[_0x16d7c6];return _0x2838ac;};'use strict';var util=require(_0x95e9('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x3c76ab,_0xb00c36){var _0x5218a2=moment(_0x3c76ab)[_0x95e9('0x1')](0x0);var _0x9f2137=moment(_0xb00c36)['milliseconds'](0x0);return _0x5218a2[_0x95e9('0x2')](_0x9f2137,_0x95e9('0x3'));}function QueueCallerAbandon(_0x4aa4ab,_0x2dd6f7){this[_0x95e9('0x4')]=_0x4aa4ab[_0x95e9('0x4')];this[_0x95e9('0x5')]=_0x4aa4ab[_0x95e9('0x5')];this['campaigntype']=_0x4aa4ab[_0x95e9('0x5')]===_0x95e9('0x6')?_0x95e9('0x7'):_0x4aa4ab[_0x95e9('0x5')];this[_0x95e9('0x8')]=_0x4aa4ab['countbusyretry'];this['countcongestionretry']=_0x4aa4ab[_0x95e9('0x9')];this[_0x95e9('0xa')]=_0x4aa4ab[_0x95e9('0xa')];this[_0x95e9('0xb')]=_0x4aa4ab[_0x95e9('0x8')]+_0x4aa4ab['countcongestionretry']+_0x4aa4ab['countnoanswerretry']+_0x4aa4ab[_0x95e9('0xc')]+_0x4aa4ab[_0x95e9('0xd')]+_0x4aa4ab[_0x95e9('0xe')]+_0x4aa4ab[_0x95e9('0xf')]+_0x4aa4ab[_0x95e9('0x10')];this[_0x95e9('0xc')]=_0x4aa4ab[_0x95e9('0xc')];this[_0x95e9('0xd')]=_0x4aa4ab[_0x95e9('0xd')];this[_0x95e9('0xe')]=_0x4aa4ab['countabandonedretry'];this[_0x95e9('0xf')]=_0x4aa4ab[_0x95e9('0xf')];this['countagentrejectretry']=_0x4aa4ab[_0x95e9('0x10')];this['uniqueid']=_0x2dd6f7[_0x95e9('0x11')];this[_0x95e9('0x12')]=_0x4aa4ab[_0x95e9('0x13')];this[_0x95e9('0x14')]=_0x4aa4ab['number'];this[_0x95e9('0x15')]=_0x4aa4ab['starttime'];this['responsetime']=_0x4aa4ab[_0x95e9('0x16')];this[_0x95e9('0x17')]=_0x4aa4ab['droptime'];this[_0x95e9('0x18')]=this[_0x95e9('0x17')];this[_0x95e9('0x19')]=getSeconds(_0x4aa4ab[_0x95e9('0x16')],_0x4aa4ab['starttime']);this['holdtime']=getSeconds(this[_0x95e9('0x17')],_0x4aa4ab['responsetime']);this['talktime']=0x0;this[_0x95e9('0x7')]=_0x2dd6f7['queue'];this[_0x95e9('0x1a')]=_0x2dd6f7['connectedlinename'];this[_0x95e9('0x1b')]=_0x2dd6f7['reason'];this[_0x95e9('0x1c')]=_0x4aa4ab[_0x95e9('0x1c')];this['callbackuniqueid']=_0x4aa4ab['callbackuniqueid'];this[_0x95e9('0x1d')]=_0x4aa4ab['callbackat'];this['recallme']=_0x4aa4ab[_0x95e9('0x1e')];this[_0x95e9('0x1f')]=_0x4aa4ab[_0x95e9('0x1f')];this[_0x95e9('0x20')]=_0x4aa4ab[_0x95e9('0x20')];this[_0x95e9('0x21')]=_0x4aa4ab[_0x95e9('0x21')];this['VoiceQueueId']=_0x4aa4ab[_0x95e9('0x22')];this[_0x95e9('0x23')]=_0x4aa4ab[_0x95e9('0x23')];this[_0x95e9('0x24')]=_0x4aa4ab['originatecalleridnum']||'';this['originatecalleridname']=_0x4aa4ab[_0x95e9('0x25')]||'';}module['exports']=QueueCallerAbandon;
\ No newline at end of file
index 9609ea8..330ad43 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(_0x18c5ab,_0x30cdf4){var _0x5cc9f1=function(_0x488a68){while(--_0x488a68){_0x18c5ab['push'](_0x18c5ab['shift']());}};_0x5cc9f1(++_0x30cdf4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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(_0x143f1c,_0x21d805){var _0x404d38=function(_0x3061c6){while(--_0x3061c6){_0x143f1c['push'](_0x143f1c['shift']());}};_0x404d38(++_0x21d805);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action;
\ No newline at end of file
index 926b6c4..11fcf1c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b39=['[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20faxRiceive\x20','faxpages','faxstatusstring','SENDING\x20FAILED','send','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','path','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','execOriginate','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','uuid','moment','tiff2pdf','./util/gs','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','faxAccounts','trunks','actions','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','originateresponse','syncOriginateResponse','context','hasOwnProperty','exten','localstationid','uniqueid','channels','channel','name','\x20syncNewchannel\x20','info','prototype','variable','channelstate','channelstatedesc','syncNewExten','value','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','updateStatus','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2b39,0x197));var _0x92b3=function(_0x426fb9,_0x73b8ed){_0x426fb9=_0x426fb9-0x0;var _0x2d1760=_0x2b39[_0x426fb9];return _0x2d1760;};'use strict';var util=require(_0x92b3('0x0'));var _=require(_0x92b3('0x1'));var BPromise=require('bluebird');var uuid=require(_0x92b3('0x2'));var moment=require(_0x92b3('0x3'));var path=require('path');var tiff2pdf=require(_0x92b3('0x4'));var gs=require(_0x92b3('0x5'));var logger=require('../../../config/logger')(_0x92b3('0x6'));var ami=require(_0x92b3('0x7'));var rpcDb=require(_0x92b3('0x8'));var Channel=require(_0x92b3('0x9'));var ut=require(_0x92b3('0xa'));var Action=require(_0x92b3('0xb'));var faxAccount=require(_0x92b3('0xc'));var attachment=require(_0x92b3('0xd'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x332d93){this['channels']={};this[_0x92b3('0xe')]=_0x332d93[_0x92b3('0xe')];this['trunks']=_0x332d93[_0x92b3('0xf')];this[_0x92b3('0x10')]={};ami['on']('newchannel',this[_0x92b3('0x11')][_0x92b3('0x12')](this));ami['on'](_0x92b3('0x13'),this[_0x92b3('0x14')][_0x92b3('0x12')](this));ami['on'](_0x92b3('0x15'),this[_0x92b3('0x16')][_0x92b3('0x12')](this));ami['on']('newexten',this['syncNewExten'][_0x92b3('0x12')](this));ami['on'](_0x92b3('0x17'),this[_0x92b3('0x18')]['bind'](this));ami['on'](_0x92b3('0x19'),this[_0x92b3('0x1a')]['bind'](this));ami['on'](_0x92b3('0x1b'),this['syncHangup'][_0x92b3('0x12')](this));ami['on'](_0x92b3('0x1c'),this[_0x92b3('0x1d')][_0x92b3('0x12')](this));}Fax['prototype']['syncNewchannel']=function(_0x2d57a0){if(_0x2d57a0[_0x92b3('0x1e')]==='from-voip-provider'){for(var _0x3c373b in this[_0x92b3('0xe')]){if(this[_0x92b3('0xe')][_0x92b3('0x1f')](_0x3c373b)){if(_0x2d57a0[_0x92b3('0x20')]===this[_0x92b3('0xe')][_0x3c373b][_0x92b3('0x21')]){this['channels'][_0x2d57a0[_0x92b3('0x22')]]={};this[_0x92b3('0x23')][_0x2d57a0[_0x92b3('0x22')]][_0x92b3('0x24')]=_0x2d57a0[_0x92b3('0x24')];this[_0x92b3('0x23')][_0x2d57a0[_0x92b3('0x22')]]['id']=this[_0x92b3('0xe')][_0x3c373b]['id'];this[_0x92b3('0x23')][_0x2d57a0[_0x92b3('0x22')]][_0x92b3('0x25')]=this[_0x92b3('0xe')][_0x3c373b][_0x92b3('0x25')];logger['info'](_0x2d57a0['uniqueid'],_0x92b3('0x26'));}}}}if(this[_0x92b3('0x10')][_0x2d57a0['uniqueid']]){this['channels'][_0x2d57a0[_0x92b3('0x22')]]={};this[_0x92b3('0x23')][_0x2d57a0[_0x92b3('0x22')]][_0x92b3('0x24')]=_0x2d57a0[_0x92b3('0x24')];logger[_0x92b3('0x27')](_0x2d57a0[_0x92b3('0x22')],_0x92b3('0x26'));}};Fax[_0x92b3('0x28')][_0x92b3('0x14')]=function(_0x5c0ca0){if(this[_0x92b3('0x23')][_0x5c0ca0['uniqueid']]){for(var _0x11ac1d in _0x5c0ca0[_0x92b3('0x29')]){if(_0x5c0ca0[_0x92b3('0x29')]['hasOwnProperty'](_0x11ac1d)){this[_0x92b3('0x23')][_0x5c0ca0['uniqueid']][_0x11ac1d]=_0x5c0ca0['value'];}}}};Fax[_0x92b3('0x28')][_0x92b3('0x16')]=function(_0x28cd67){if(this[_0x92b3('0x23')][_0x28cd67[_0x92b3('0x22')]]){this[_0x92b3('0x23')][_0x28cd67[_0x92b3('0x22')]][_0x92b3('0x2a')]=_0x28cd67[_0x92b3('0x2a')];this[_0x92b3('0x23')][_0x28cd67['uniqueid']][_0x92b3('0x2b')]=_0x28cd67[_0x92b3('0x2b')];}};Fax['prototype'][_0x92b3('0x2c')]=function(_0x377279){if(this['channels'][_0x377279['uniqueid']]){for(var _0x465369 in _0x377279[_0x92b3('0x29')]){if(_0x377279[_0x92b3('0x29')]['hasOwnProperty'](_0x465369)){this[_0x92b3('0x23')][_0x377279[_0x92b3('0x22')]][_0x465369]=_0x377279[_0x92b3('0x2d')];}}}};Fax[_0x92b3('0x28')][_0x92b3('0x18')]=function(_0x4a4b93){if(this['channels'][_0x4a4b93[_0x92b3('0x22')]]){this['channels'][_0x4a4b93[_0x92b3('0x22')]]['operation']=_0x4a4b93['operation'];this['channels'][_0x4a4b93['uniqueid']][_0x92b3('0x2e')]=_0x4a4b93['status'];this[_0x92b3('0x23')][_0x4a4b93[_0x92b3('0x22')]][_0x92b3('0x21')]=_0x4a4b93['localstationid'];this['channels'][_0x4a4b93[_0x92b3('0x22')]][_0x92b3('0x2f')]=_0x4a4b93[_0x92b3('0x2f')];logger['info'](_0x4a4b93['uniqueid'],_0x92b3('0x30'));}};Fax['prototype'][_0x92b3('0x1a')]=function(_0x489948){var _0x4eb7e1=this;if(this['channels'][_0x489948[_0x92b3('0x22')]]){var _0x204b89=this['channels'][_0x489948[_0x92b3('0x22')]]['id'];this[_0x92b3('0x23')][_0x489948['uniqueid']][_0x92b3('0x31')]=_0x489948[_0x92b3('0x31')];this['channels'][_0x489948[_0x92b3('0x22')]]['pagestransferred']=_0x489948[_0x92b3('0x32')];this['channels'][_0x489948[_0x92b3('0x22')]][_0x92b3('0x21')]=_0x489948[_0x92b3('0x21')];this[_0x92b3('0x23')][_0x489948[_0x92b3('0x22')]][_0x92b3('0x33')]=_0x489948[_0x92b3('0x33')];this[_0x92b3('0x23')][_0x489948[_0x92b3('0x22')]]['transferrate']=_0x489948[_0x92b3('0x34')];this[_0x92b3('0x23')][_0x489948['uniqueid']]['filename']=_0x489948[_0x92b3('0x2f')];this[_0x92b3('0x23')][_0x489948[_0x92b3('0x22')]][_0x92b3('0x35')]=_0x489948[_0x92b3('0x35')];if(this['channels'][_0x489948[_0x92b3('0x22')]][_0x92b3('0x32')]>0x0){tiff2pdf(_0x489948['filename'],_0x92b3('0x36'),function(_0x15b440){logger[_0x92b3('0x27')](_0x489948[_0x92b3('0x22')],_0x92b3('0x37'),_0x15b440[_0x92b3('0x38')]);attachment[_0x92b3('0x39')]({'name':path[_0x92b3('0x3a')](_0x489948[_0x92b3('0x2f')])['name'],'basename':path[_0x92b3('0x3a')](_0x489948[_0x92b3('0x2f')])[_0x92b3('0x25')]+_0x92b3('0x3b'),'type':_0x92b3('0x3c')})[_0x92b3('0x3d')](function(_0x1a77cd){faxAccount['notify'](_0x204b89,{'from':_0x489948['calleridnum'],'mapKey':_0x92b3('0x6'),'body':path['parse'](_0x489948[_0x92b3('0x2f')])[_0x92b3('0x25')]+_0x92b3('0x3b'),'AttachmentId':_0x1a77cd['id']})[_0x92b3('0x3e')](function(_0xdf1f83){logger[_0x92b3('0x3f')](_0x489948['uniqueid'],_0x92b3('0x40'),JSON[_0x92b3('0x41')](_0xdf1f83));});})[_0x92b3('0x3e')](function(_0x822de6){logger[_0x92b3('0x3f')](_0x489948[_0x92b3('0x22')],_0x92b3('0x42'),JSON[_0x92b3('0x41')](_0x822de6));});});}logger['info'](_0x489948[_0x92b3('0x22')],'\x20receiveFax\x20');}};Fax[_0x92b3('0x28')]['syncOriginateResponse']=function(_0xa84256){if(this[_0x92b3('0x10')][_0xa84256[_0x92b3('0x22')]]){_[_0x92b3('0x43')](this[_0x92b3('0x23')][_0xa84256['uniqueid']],_[_0x92b3('0x44')](_0xa84256,[_0x92b3('0x45'),'reason']));}};function updateStatus(_0x1402e9){if(_0x1402e9[_0x92b3('0x46')]){faxMessage['update'](_0x1402e9['AttachmentId'],{'failMessage':_0x92b3('0x47')})[_0x92b3('0x3d')](function(_0x84c214){ut[_0x92b3('0x48')](_0x92b3('0x49'),_0x84c214);})['catch'](function(_0x5941a2){ut[_0x92b3('0x48')](_0x92b3('0x4a'),_0x5941a2);});}else{ut[_0x92b3('0x48')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x92b3('0x28')][_0x92b3('0x4b')]=function(_0x5297dd,_0x16071d,_0x2cad3c){var _0x59619c=this;var _0x1d3ed2={};if(_0x16071d){_0x1d3ed2={'read':_0x16071d};}else{_0x1d3ed2={'failMessage':_0x2cad3c};}if(this[_0x92b3('0x10')][_0x5297dd]['AttachmentId']){faxMessage[_0x92b3('0x4c')](this[_0x92b3('0x10')][_0x5297dd][_0x92b3('0x46')],_0x1d3ed2)['then'](function(_0x26a8a6){ut[_0x92b3('0x48')]('[Fax][Message][Updated]',_0x26a8a6);})['catch'](function(_0x352924){ut[_0x92b3('0x48')](_0x92b3('0x4d'),_0x352924);})[_0x92b3('0x4e')](function(){delete _0x59619c[_0x92b3('0x23')][_0x5297dd];delete _0x59619c['actions'][_0x5297dd];});}else{ut[_0x92b3('0x48')](_0x92b3('0x4f'));delete this['channels'][_0x5297dd];delete this[_0x92b3('0x10')][_0x5297dd];}};Fax['prototype'][_0x92b3('0x50')]=function(_0x576461){var _0x188249=this;if(this['channels'][_0x576461[_0x92b3('0x22')]]){if(this[_0x92b3('0x10')][_0x576461[_0x92b3('0x22')]]){this[_0x92b3('0x23')][_0x576461[_0x92b3('0x22')]]['id']=this['actions'][_0x576461['uniqueid']]['id'];this[_0x92b3('0x23')][_0x576461['uniqueid']][_0x92b3('0x25')]=this[_0x92b3('0x10')][_0x576461[_0x92b3('0x22')]][_0x92b3('0x25')];}logger[_0x92b3('0x27')](_0x576461[_0x92b3('0x22')],this[_0x92b3('0x10')][_0x576461[_0x92b3('0x22')]]?'\x20hangup\x20sendFile\x20':_0x92b3('0x51'),JSON[_0x92b3('0x41')](this[_0x92b3('0x23')][_0x576461[_0x92b3('0x22')]]));if(this['actions'][_0x576461[_0x92b3('0x22')]]){if(this[_0x92b3('0x23')][_0x576461[_0x92b3('0x22')]][_0x92b3('0x52')]>0x0&&this[_0x92b3('0x23')][_0x576461[_0x92b3('0x22')]][_0x92b3('0x17')]==='SUCCESS'){this['updateStatus'](_0x576461['uniqueid'],!![]);}else{this[_0x92b3('0x4b')](_0x576461[_0x92b3('0x22')],![],this[_0x92b3('0x23')][_0x576461[_0x92b3('0x22')]][_0x92b3('0x53')]?'SENDING\x20FAILED:\x20'+this['channels'][_0x576461['uniqueid']][_0x92b3('0x53')]:_0x92b3('0x54'));}}}};Fax['prototype'][_0x92b3('0x55')]=function(_0x2000b6){var _0x2a1e60=this;return new BPromise(function(_0x1bd961,_0x239156){_0x2a1e60['execOriginate'](_0x2000b6,_0x2a1e60['faxAccounts'][_0x2000b6['FaxAccountId']])['then'](function(_0x526926){ut[_0x92b3('0x48')](_0x92b3('0x56'),_0x526926);_0x1bd961(ut[_0x92b3('0x38')](_0x92b3('0x57')));})[_0x92b3('0x3e')](function(_0x537426){ut[_0x92b3('0x48')]('[Fax][execOriginate][failure]',_0x537426);updateStatus(_0x2000b6);_0x239156(ut['message'](_0x92b3('0x58')));});});};Fax['prototype'][_0x92b3('0x59')]=function(_0x4d3a4f){var _0x49782f=this;return new BPromise(function(_0x356bd4,_0x43bf65){var _0x17f5d1=_0x49782f[_0x92b3('0x5a')](_0x49782f[_0x92b3('0xe')][_0x4d3a4f[_0x92b3('0x5b')]][_0x92b3('0x5c')],_0x4d3a4f);if(_0x17f5d1['isValid']){_0x356bd4(ut[_0x92b3('0x38')](_0x92b3('0x5d')));}else{_0x43bf65(ut['message'](_0x17f5d1[_0x92b3('0x38')]));}});};function originate(_0x55197c,_0x506cbf,_0x3dc55d){return new BPromise(function(_0x12aa06,_0x85c48){if(_0x3dc55d){var _0x16ca09=util[_0x92b3('0x5e')](_0x92b3('0x5f'),path[_0x92b3('0x3a')](_0x55197c['path'])[_0x92b3('0x25')],_0x55197c[_0x92b3('0x60')]);gs[_0x92b3('0x61')](_0x16ca09)[_0x92b3('0x3d')](function(){_0x55197c[_0x92b3('0x60')]=util[_0x92b3('0x5e')](_0x92b3('0x62'),path[_0x92b3('0x3a')](_0x55197c[_0x92b3('0x60')])[_0x92b3('0x63')],path[_0x92b3('0x3a')](_0x55197c[_0x92b3('0x60')])['name']);_0x506cbf[_0x92b3('0x64')]=_0x55197c[_0x92b3('0x60')];ut['logger'](_0x92b3('0x65'),'');ami[_0x92b3('0x66')](ut[_0x92b3('0x67')](_0x55197c,_0x506cbf))['then'](function(_0x5388b9){_0x12aa06(_0x5388b9);})[_0x92b3('0x3e')](function(_0x1b7f8b){_0x85c48(_0x1b7f8b);});})[_0x92b3('0x3e')](function(_0x39d415){_0x85c48(_0x39d415);});}else{ami[_0x92b3('0x66')](ut[_0x92b3('0x67')](_0x55197c,_0x506cbf))[_0x92b3('0x3d')](function(_0x499fc3){_0x12aa06(_0x499fc3);})['catch'](function(_0x762dca){_0x85c48(_0x762dca);});}});}Fax[_0x92b3('0x28')][_0x92b3('0x68')]=function(_0x5f2593,_0x59e02a){var _0x4812bd=this;return new BPromise(function(_0x1d7a60,_0x18cd20){var _0x2c0107=uuid['v4']();var _0x4a7fd5=ut[_0x92b3('0x69')](_0x5f2593,_0x59e02a);_0x4812bd[_0x92b3('0x10')][_0x2c0107]=new Action(_0x2c0107,_0x59e02a,_0x5f2593);var _0x591995=_0x4812bd[_0x92b3('0x10')][_0x2c0107];if(path[_0x92b3('0x3a')](_0x5f2593['path'])[_0x92b3('0x6a')]===_0x92b3('0x3b')){originate(_0x591995,_0x4a7fd5,!![])[_0x92b3('0x3d')](function(_0x4d1b4c){_0x1d7a60(_0x4d1b4c);})[_0x92b3('0x3e')](function(_0x343899){_0x18cd20(_0x343899);});}else{originate(_0x591995,_0x4a7fd5,![])[_0x92b3('0x3d')](function(_0x514f29){_0x1d7a60(_0x514f29);})[_0x92b3('0x3e')](function(_0x54c9a9){_0x18cd20(_0x54c9a9);});}});};Fax[_0x92b3('0x28')][_0x92b3('0x6b')]=function(_0x41294e){return!_[_0x92b3('0x6c')](_0x41294e)&&!_[_0x92b3('0x6c')](_0x41294e[_0x92b3('0x25')])&&!_[_0x92b3('0x6c')](_0x41294e[_0x92b3('0x6d')])&&_0x41294e[_0x92b3('0x6d')]&&!_[_0x92b3('0x6c')](this[_0x92b3('0xf')][util[_0x92b3('0x5e')](_0x92b3('0x6e'),_0x41294e[_0x92b3('0x25')])])&&!_['isNil'](this['trunks'][util[_0x92b3('0x5e')](_0x92b3('0x6e'),_0x41294e[_0x92b3('0x25')])][_0x92b3('0x2e')])&&(this[_0x92b3('0xf')][util[_0x92b3('0x5e')](_0x92b3('0x6e'),_0x41294e[_0x92b3('0x25')])][_0x92b3('0x2e')]===_0x92b3('0x6f')||this[_0x92b3('0xf')][util[_0x92b3('0x5e')](_0x92b3('0x6e'),_0x41294e[_0x92b3('0x25')])]['status']===_0x92b3('0x70'));};Fax[_0x92b3('0x28')]['checkTrunk']=function(_0x4c4fc8,_0x1cb0b9){if(!this['isTrunkReachable'](_0x4c4fc8)){ut[_0x92b3('0x48')](_0x92b3('0x71'),_[_0x92b3('0x6c')](_0x4c4fc8)?'':_0x4c4fc8[_0x92b3('0x25')]+_0x92b3('0x72'));return{'isValid':![],'message':_0x92b3('0x73')};}if(_[_0x92b3('0x6c')](_0x1cb0b9['fax'])){ut[_0x92b3('0x48')](_0x92b3('0x74'),JSON[_0x92b3('0x41')](_0x1cb0b9));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x92b3('0x6c')](_0x1cb0b9[_0x92b3('0x60')])){ut['logger'](_0x92b3('0x75'),JSON[_0x92b3('0x41')](_0x1cb0b9));return{'isValid':![],'message':_0x92b3('0x76')};}return{'isValid':!![],'message':_0x92b3('0x77')};};module[_0x92b3('0x78')]=Fax;
\ No newline at end of file
+var _0xe133=['%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','addVariables','ext','isTrunkReachable','isNil','SIP/%s','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20path','Is\x20Valid','bluebird','moment','path','./util/gs','../../../config/logger','fax','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','originateresponse','syncOriginateResponse','prototype','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','variable','value','channelstate','channelstatedesc','syncNewExten','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','create','.pdf','application/pdf','parse','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','pick','response','AttachmentId','update','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','send','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','Trunk','isValid','format','execute'];(function(_0x209584,_0x3f06f0){var _0x4f3e4c=function(_0x139951){while(--_0x139951){_0x209584['push'](_0x209584['shift']());}};_0x4f3e4c(++_0x3f06f0);}(_0xe133,0x163));var _0x3e13=function(_0x5b4b54,_0x4eb635){_0x5b4b54=_0x5b4b54-0x0;var _0xe8e8a4=_0xe133[_0x5b4b54];return _0xe8e8a4;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x3e13('0x0'));var uuid=require('uuid');var moment=require(_0x3e13('0x1'));var path=require(_0x3e13('0x2'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x3e13('0x3'));var logger=require(_0x3e13('0x4'))(_0x3e13('0x5'));var ami=require('../ami');var rpcDb=require(_0x3e13('0x6'));var Channel=require(_0x3e13('0x7'));var ut=require(_0x3e13('0x8'));var Action=require(_0x3e13('0x9'));var faxAccount=require(_0x3e13('0xa'));var attachment=require(_0x3e13('0xb'));var faxMessage=require(_0x3e13('0xc'));function Fax(_0x318651){this[_0x3e13('0xd')]={};this[_0x3e13('0xe')]=_0x318651[_0x3e13('0xe')];this[_0x3e13('0xf')]=_0x318651['trunks'];this['actions']={};ami['on'](_0x3e13('0x10'),this[_0x3e13('0x11')][_0x3e13('0x12')](this));ami['on'](_0x3e13('0x13'),this[_0x3e13('0x14')][_0x3e13('0x12')](this));ami['on'](_0x3e13('0x15'),this[_0x3e13('0x16')][_0x3e13('0x12')](this));ami['on'](_0x3e13('0x17'),this['syncNewExten'][_0x3e13('0x12')](this));ami['on'](_0x3e13('0x18'),this[_0x3e13('0x19')][_0x3e13('0x12')](this));ami['on'](_0x3e13('0x1a'),this[_0x3e13('0x1b')][_0x3e13('0x12')](this));ami['on']('hangup',this['syncHangup'][_0x3e13('0x12')](this));ami['on'](_0x3e13('0x1c'),this[_0x3e13('0x1d')][_0x3e13('0x12')](this));}Fax[_0x3e13('0x1e')][_0x3e13('0x11')]=function(_0x3a31d5){if(_0x3a31d5['context']===_0x3e13('0x1f')){for(var _0x4cc527 in this['faxAccounts']){if(this['faxAccounts'][_0x3e13('0x20')](_0x4cc527)){if(_0x3a31d5[_0x3e13('0x21')]===this[_0x3e13('0xe')][_0x4cc527][_0x3e13('0x22')]){this[_0x3e13('0xd')][_0x3a31d5[_0x3e13('0x23')]]={};this['channels'][_0x3a31d5[_0x3e13('0x23')]][_0x3e13('0x24')]=_0x3a31d5['channel'];this['channels'][_0x3a31d5[_0x3e13('0x23')]]['id']=this[_0x3e13('0xe')][_0x4cc527]['id'];this[_0x3e13('0xd')][_0x3a31d5['uniqueid']][_0x3e13('0x25')]=this[_0x3e13('0xe')][_0x4cc527][_0x3e13('0x25')];logger[_0x3e13('0x26')](_0x3a31d5[_0x3e13('0x23')],_0x3e13('0x27'));}}}}if(this[_0x3e13('0x28')][_0x3a31d5['uniqueid']]){this['channels'][_0x3a31d5[_0x3e13('0x23')]]={};this[_0x3e13('0xd')][_0x3a31d5[_0x3e13('0x23')]][_0x3e13('0x24')]=_0x3a31d5[_0x3e13('0x24')];logger[_0x3e13('0x26')](_0x3a31d5[_0x3e13('0x23')],_0x3e13('0x27'));}};Fax[_0x3e13('0x1e')][_0x3e13('0x14')]=function(_0x19112d){if(this[_0x3e13('0xd')][_0x19112d[_0x3e13('0x23')]]){for(var _0x3a078b in _0x19112d[_0x3e13('0x29')]){if(_0x19112d['variable']['hasOwnProperty'](_0x3a078b)){this[_0x3e13('0xd')][_0x19112d[_0x3e13('0x23')]][_0x3a078b]=_0x19112d[_0x3e13('0x2a')];}}}};Fax[_0x3e13('0x1e')]['syncNewState']=function(_0x24e9f2){if(this[_0x3e13('0xd')][_0x24e9f2[_0x3e13('0x23')]]){this[_0x3e13('0xd')][_0x24e9f2['uniqueid']][_0x3e13('0x2b')]=_0x24e9f2[_0x3e13('0x2b')];this['channels'][_0x24e9f2[_0x3e13('0x23')]][_0x3e13('0x2c')]=_0x24e9f2['channelstatedesc'];}};Fax['prototype'][_0x3e13('0x2d')]=function(_0x39df24){if(this['channels'][_0x39df24[_0x3e13('0x23')]]){for(var _0x56ea44 in _0x39df24[_0x3e13('0x29')]){if(_0x39df24['variable'][_0x3e13('0x20')](_0x56ea44)){this[_0x3e13('0xd')][_0x39df24[_0x3e13('0x23')]][_0x56ea44]=_0x39df24['value'];}}}};Fax['prototype'][_0x3e13('0x19')]=function(_0x4dfcc7){if(this[_0x3e13('0xd')][_0x4dfcc7[_0x3e13('0x23')]]){this['channels'][_0x4dfcc7[_0x3e13('0x23')]][_0x3e13('0x2e')]=_0x4dfcc7[_0x3e13('0x2e')];this['channels'][_0x4dfcc7[_0x3e13('0x23')]][_0x3e13('0x2f')]=_0x4dfcc7[_0x3e13('0x2f')];this[_0x3e13('0xd')][_0x4dfcc7[_0x3e13('0x23')]][_0x3e13('0x22')]=_0x4dfcc7[_0x3e13('0x22')];this[_0x3e13('0xd')][_0x4dfcc7[_0x3e13('0x23')]][_0x3e13('0x30')]=_0x4dfcc7[_0x3e13('0x30')];logger[_0x3e13('0x26')](_0x4dfcc7[_0x3e13('0x23')],_0x3e13('0x31'));}};Fax['prototype']['syncReceiveFax']=function(_0x799ef4){var _0x360eac=this;if(this['channels'][_0x799ef4[_0x3e13('0x23')]]){var _0x1c6cbe=this[_0x3e13('0xd')][_0x799ef4[_0x3e13('0x23')]]['id'];this[_0x3e13('0xd')][_0x799ef4[_0x3e13('0x23')]][_0x3e13('0x32')]=_0x799ef4[_0x3e13('0x32')];this[_0x3e13('0xd')][_0x799ef4['uniqueid']][_0x3e13('0x33')]=_0x799ef4[_0x3e13('0x33')];this[_0x3e13('0xd')][_0x799ef4[_0x3e13('0x23')]][_0x3e13('0x22')]=_0x799ef4[_0x3e13('0x22')];this['channels'][_0x799ef4[_0x3e13('0x23')]][_0x3e13('0x34')]=_0x799ef4['resolution'];this[_0x3e13('0xd')][_0x799ef4[_0x3e13('0x23')]][_0x3e13('0x35')]=_0x799ef4[_0x3e13('0x35')];this[_0x3e13('0xd')][_0x799ef4['uniqueid']][_0x3e13('0x30')]=_0x799ef4[_0x3e13('0x30')];this['channels'][_0x799ef4[_0x3e13('0x23')]][_0x3e13('0x36')]=_0x799ef4[_0x3e13('0x36')];if(this['channels'][_0x799ef4[_0x3e13('0x23')]]['pagestransferred']>0x0){tiff2pdf(_0x799ef4[_0x3e13('0x30')],_0x3e13('0x37'),function(_0x13585e){logger[_0x3e13('0x26')](_0x799ef4['uniqueid'],'\x20result\x20conversion\x20file\x20',_0x13585e[_0x3e13('0x38')]);attachment[_0x3e13('0x39')]({'name':path['parse'](_0x799ef4[_0x3e13('0x30')])['name'],'basename':path['parse'](_0x799ef4['filename'])['name']+_0x3e13('0x3a'),'type':_0x3e13('0x3b')})['then'](function(_0x14390a){faxAccount['notify'](_0x1c6cbe,{'from':_0x799ef4[_0x3e13('0x36')],'mapKey':'fax','body':path[_0x3e13('0x3c')](_0x799ef4[_0x3e13('0x30')])['name']+_0x3e13('0x3a'),'AttachmentId':_0x14390a['id']})[_0x3e13('0x3d')](function(_0x3fa584){logger[_0x3e13('0x3e')](_0x799ef4['uniqueid'],_0x3e13('0x3f'),JSON[_0x3e13('0x40')](_0x3fa584));});})[_0x3e13('0x3d')](function(_0x4e5ab6){logger[_0x3e13('0x3e')](_0x799ef4['uniqueid'],'\x20receiveFax\x20',JSON[_0x3e13('0x40')](_0x4e5ab6));});});}logger['info'](_0x799ef4[_0x3e13('0x23')],_0x3e13('0x41'));}};Fax[_0x3e13('0x1e')][_0x3e13('0x1d')]=function(_0x3d36c2){if(this[_0x3e13('0x28')][_0x3d36c2['uniqueid']]){_['merge'](this[_0x3e13('0xd')][_0x3d36c2[_0x3e13('0x23')]],_[_0x3e13('0x42')](_0x3d36c2,[_0x3e13('0x43'),'reason']));}};function updateStatus(_0x22a318){if(_0x22a318[_0x3e13('0x44')]){faxMessage[_0x3e13('0x45')](_0x22a318['AttachmentId'],{'failMessage':_0x3e13('0x46')})[_0x3e13('0x47')](function(_0x1f9d18){ut[_0x3e13('0x48')](_0x3e13('0x49'),_0x1f9d18);})[_0x3e13('0x3d')](function(_0x44623b){ut[_0x3e13('0x48')](_0x3e13('0x4a'),_0x44623b);});}else{ut[_0x3e13('0x48')]('[Fax][Message][Error][NoUpdate2]');}}Fax['prototype'][_0x3e13('0x4b')]=function(_0x1fe56d,_0x25a8d8,_0x4afe7d){var _0x23eff1=this;var _0x7e7748={};if(_0x25a8d8){_0x7e7748={'read':_0x25a8d8};}else{_0x7e7748={'failMessage':_0x4afe7d};}if(this[_0x3e13('0x28')][_0x1fe56d]['AttachmentId']){faxMessage[_0x3e13('0x45')](this[_0x3e13('0x28')][_0x1fe56d]['AttachmentId'],_0x7e7748)['then'](function(_0x48d5f8){ut[_0x3e13('0x48')](_0x3e13('0x4c'),_0x48d5f8);})[_0x3e13('0x3d')](function(_0x12bbfe){ut['logger'](_0x3e13('0x4d'),_0x12bbfe);})[_0x3e13('0x4e')](function(){delete _0x23eff1[_0x3e13('0xd')][_0x1fe56d];delete _0x23eff1[_0x3e13('0x28')][_0x1fe56d];});}else{ut['logger'](_0x3e13('0x4f'));delete this[_0x3e13('0xd')][_0x1fe56d];delete this[_0x3e13('0x28')][_0x1fe56d];}};Fax[_0x3e13('0x1e')][_0x3e13('0x50')]=function(_0x5c7375){var _0x4fd5bf=this;if(this[_0x3e13('0xd')][_0x5c7375[_0x3e13('0x23')]]){if(this[_0x3e13('0x28')][_0x5c7375[_0x3e13('0x23')]]){this['channels'][_0x5c7375[_0x3e13('0x23')]]['id']=this[_0x3e13('0x28')][_0x5c7375[_0x3e13('0x23')]]['id'];this[_0x3e13('0xd')][_0x5c7375['uniqueid']]['name']=this[_0x3e13('0x28')][_0x5c7375['uniqueid']][_0x3e13('0x25')];}logger['info'](_0x5c7375[_0x3e13('0x23')],this[_0x3e13('0x28')][_0x5c7375[_0x3e13('0x23')]]?_0x3e13('0x51'):_0x3e13('0x52'),JSON['stringify'](this[_0x3e13('0xd')][_0x5c7375[_0x3e13('0x23')]]));if(this[_0x3e13('0x28')][_0x5c7375[_0x3e13('0x23')]]){if(this['channels'][_0x5c7375[_0x3e13('0x23')]][_0x3e13('0x53')]>0x0&&this[_0x3e13('0xd')][_0x5c7375[_0x3e13('0x23')]]['faxstatus']===_0x3e13('0x54')){this[_0x3e13('0x4b')](_0x5c7375['uniqueid'],!![]);}else{this[_0x3e13('0x4b')](_0x5c7375['uniqueid'],![],this['channels'][_0x5c7375[_0x3e13('0x23')]]['faxstatusstring']?'SENDING\x20FAILED:\x20'+this[_0x3e13('0xd')][_0x5c7375[_0x3e13('0x23')]][_0x3e13('0x55')]:'SENDING\x20FAILED');}}}};Fax[_0x3e13('0x1e')][_0x3e13('0x56')]=function(_0x209e1b){var _0x2988b8=this;return new BPromise(function(_0x427f3b,_0xa769b2){_0x2988b8[_0x3e13('0x57')](_0x209e1b,_0x2988b8['faxAccounts'][_0x209e1b[_0x3e13('0x58')]])[_0x3e13('0x47')](function(_0x5a9787){ut[_0x3e13('0x48')]('[Fax][execOriginate][success]',_0x5a9787);_0x427f3b(ut['message'](_0x3e13('0x59')));})[_0x3e13('0x3d')](function(_0x360721){ut[_0x3e13('0x48')](_0x3e13('0x5a'),_0x360721);updateStatus(_0x209e1b);_0xa769b2(ut['message'](_0x3e13('0x5b')));});});};Fax['prototype']['checkAfterSend']=function(_0x12698a){var _0x43d3ff=this;return new BPromise(function(_0xea22d7,_0x5e887d){var _0x36eb36=_0x43d3ff[_0x3e13('0x5c')](_0x43d3ff['faxAccounts'][_0x12698a['FaxAccountId']][_0x3e13('0x5d')],_0x12698a);if(_0x36eb36[_0x3e13('0x5e')]){_0xea22d7(ut[_0x3e13('0x38')]('Trunk\x20Reachable'));}else{_0x5e887d(ut['message'](_0x36eb36[_0x3e13('0x38')]));}});};function originate(_0x1b7123,_0x19a990,_0x738d04){return new BPromise(function(_0x6f36ba,_0x45c8c3){if(_0x738d04){var _0x1eacfa=util[_0x3e13('0x5f')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0x3e13('0x3c')](_0x1b7123[_0x3e13('0x2')])[_0x3e13('0x25')],_0x1b7123[_0x3e13('0x2')]);gs[_0x3e13('0x60')](_0x1eacfa)['then'](function(){_0x1b7123['path']=util[_0x3e13('0x5f')](_0x3e13('0x61'),path[_0x3e13('0x3c')](_0x1b7123[_0x3e13('0x2')])[_0x3e13('0x62')],path['parse'](_0x1b7123[_0x3e13('0x2')])[_0x3e13('0x25')]);_0x19a990[_0x3e13('0x63')]=_0x1b7123[_0x3e13('0x2')];ut[_0x3e13('0x48')](_0x3e13('0x64'),'');ami['Action'](ut['variablesAction'](_0x1b7123,_0x19a990))[_0x3e13('0x47')](function(_0x4760d9){_0x6f36ba(_0x4760d9);})[_0x3e13('0x3d')](function(_0x17f87c){_0x45c8c3(_0x17f87c);});})[_0x3e13('0x3d')](function(_0x4b55a9){_0x45c8c3(_0x4b55a9);});}else{ami[_0x3e13('0x65')](ut['variablesAction'](_0x1b7123,_0x19a990))[_0x3e13('0x47')](function(_0x549221){_0x6f36ba(_0x549221);})[_0x3e13('0x3d')](function(_0x3d4146){_0x45c8c3(_0x3d4146);});}});}Fax[_0x3e13('0x1e')][_0x3e13('0x57')]=function(_0x7e982f,_0x50c6ca){var _0x9d52f9=this;return new BPromise(function(_0x68db53,_0x145954){var _0x3c4f81=uuid['v4']();var _0x1be530=ut[_0x3e13('0x66')](_0x7e982f,_0x50c6ca);_0x9d52f9[_0x3e13('0x28')][_0x3c4f81]=new Action(_0x3c4f81,_0x50c6ca,_0x7e982f);var _0xd66965=_0x9d52f9[_0x3e13('0x28')][_0x3c4f81];if(path[_0x3e13('0x3c')](_0x7e982f[_0x3e13('0x2')])[_0x3e13('0x67')]===_0x3e13('0x3a')){originate(_0xd66965,_0x1be530,!![])['then'](function(_0x2cccab){_0x68db53(_0x2cccab);})[_0x3e13('0x3d')](function(_0x1687af){_0x145954(_0x1687af);});}else{originate(_0xd66965,_0x1be530,![])[_0x3e13('0x47')](function(_0x352230){_0x68db53(_0x352230);})[_0x3e13('0x3d')](function(_0x310b25){_0x145954(_0x310b25);});}});};Fax[_0x3e13('0x1e')][_0x3e13('0x68')]=function(_0x14468b){return!_[_0x3e13('0x69')](_0x14468b)&&!_[_0x3e13('0x69')](_0x14468b['name'])&&!_['isNil'](_0x14468b['active'])&&_0x14468b['active']&&!_[_0x3e13('0x69')](this[_0x3e13('0xf')][util[_0x3e13('0x5f')]('SIP/%s',_0x14468b[_0x3e13('0x25')])])&&!_[_0x3e13('0x69')](this[_0x3e13('0xf')][util[_0x3e13('0x5f')](_0x3e13('0x6a'),_0x14468b[_0x3e13('0x25')])][_0x3e13('0x2f')])&&(this[_0x3e13('0xf')][util[_0x3e13('0x5f')](_0x3e13('0x6a'),_0x14468b[_0x3e13('0x25')])]['status']==='reachable'||this[_0x3e13('0xf')][util['format'](_0x3e13('0x6a'),_0x14468b[_0x3e13('0x25')])][_0x3e13('0x2f')]==='unmonitored');};Fax['prototype']['checkTrunk']=function(_0x5f34be,_0x33edc3){if(!this[_0x3e13('0x68')](_0x5f34be)){ut[_0x3e13('0x48')](_0x3e13('0x6b'),_[_0x3e13('0x69')](_0x5f34be)?'':_0x5f34be[_0x3e13('0x25')]+_0x3e13('0x6c'));return{'isValid':![],'message':_0x3e13('0x6d')};}if(_[_0x3e13('0x69')](_0x33edc3[_0x3e13('0x5')])){ut[_0x3e13('0x48')](_0x3e13('0x6e'),JSON[_0x3e13('0x40')](_0x33edc3));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x3e13('0x69')](_0x33edc3[_0x3e13('0x2')])){ut[_0x3e13('0x48')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0x3e13('0x40')](_0x33edc3));return{'isValid':![],'message':_0x3e13('0x6f')};}return{'isValid':!![],'message':_0x3e13('0x70')};};module['exports']=Fax;
\ No newline at end of file
index 06c2b2b..621c8bf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe291=['inspect','notify','resolve','then','[Notify]\x20','util','bluebird','preview','lodash','../rpc/faxAccount','error'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xe291,0x1a7));var _0x1e29=function(_0x34d319,_0x2e5614){_0x34d319=_0x34d319-0x0;var _0x2bc087=_0xe291[_0x34d319];return _0x2bc087;};'use strict';var util=require(_0x1e29('0x0'));var BPromise=require(_0x1e29('0x1'));var logger=require('../../../config/logger')(_0x1e29('0x2'));var _=require(_0x1e29('0x3'));var faxAccount=require(_0x1e29('0x4'));function loggerCatch(_0x307f0a){return function(_0x47041d){logger[_0x1e29('0x5')](_0x307f0a,util[_0x1e29('0x6')](_0x47041d,{'showHidden':![],'depth':null}));};}exports[_0x1e29('0x7')]=function(_0xe3e078,_0x309eee){return BPromise[_0x1e29('0x8')]()[_0x1e29('0x9')](faxAccount[_0x1e29('0x7')](_0xe3e078,_0x309eee))['catch'](loggerCatch(_0x1e29('0xa')));};
\ No newline at end of file
+var _0x1397=['notify','resolve','catch','util','bluebird','preview','lodash','error','inspect'];(function(_0xe33081,_0x2a90a1){var _0x3cbbf7=function(_0x1fa95c){while(--_0x1fa95c){_0xe33081['push'](_0xe33081['shift']());}};_0x3cbbf7(++_0x2a90a1);}(_0x1397,0x66));var _0x7139=function(_0x357d69,_0xf80d4d){_0x357d69=_0x357d69-0x0;var _0x3182e9=_0x1397[_0x357d69];return _0x3182e9;};'use strict';var util=require(_0x7139('0x0'));var BPromise=require(_0x7139('0x1'));var logger=require('../../../config/logger')(_0x7139('0x2'));var _=require(_0x7139('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x50a1cf){return function(_0x2ce95c){logger[_0x7139('0x4')](_0x50a1cf,util[_0x7139('0x5')](_0x2ce95c,{'showHidden':![],'depth':null}));};}exports[_0x7139('0x6')]=function(_0x1af7de,_0x5b830f){return BPromise[_0x7139('0x7')]()['then'](faxAccount[_0x7139('0x6')](_0x1af7de,_0x5b830f))[_0x7139('0x8')](loggerCatch('[Notify]\x20'));};
\ No newline at end of file
index 05626ad..03df804 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcc01=['execute','info','Exec\x20gs','\x20Error\x20:','inspect','../../../../config/logger','fax','child_process'];(function(_0x18ef99,_0x24b6b9){var _0x2960e5=function(_0x3b80c7){while(--_0x3b80c7){_0x18ef99['push'](_0x18ef99['shift']());}};_0x2960e5(++_0x24b6b9);}(_0xcc01,0xad));var _0x1cc0=function(_0x1551af,_0x5223c3){_0x1551af=_0x1551af-0x0;var _0xd8eb82=_0xcc01[_0x1551af];return _0xd8eb82;};'use strict';var util=require('util');var logger=require(_0x1cc0('0x0'))(_0x1cc0('0x1'));var BPromise=require('bluebird');var exec=require(_0x1cc0('0x2'))['exec'];exports[_0x1cc0('0x3')]=function(_0x16eb2a){return new BPromise(function(_0x1b6bca,_0xb0817a){exec(_0x16eb2a,function(_0x1394a2,_0x8df5f5,_0x1dcc14){logger[_0x1cc0('0x4')](_0x1cc0('0x5'),_0x8df5f5);if(_0x1394a2){logger[_0x1cc0('0x4')]('Exec\x20gs',_0x1cc0('0x6'),util[_0x1cc0('0x7')](_0x1394a2,{'showHidden':![],'depth':null}),_0x8df5f5,_0x1dcc14);_0xb0817a(_0x1394a2);}_0x1b6bca(_0x8df5f5);});});};
\ No newline at end of file
+var _0x607b=['../../../../config/logger','bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','util'];(function(_0x54a892,_0x1a4eeb){var _0x1f24f1=function(_0x2044d5){while(--_0x2044d5){_0x54a892['push'](_0x54a892['shift']());}};_0x1f24f1(++_0x1a4eeb);}(_0x607b,0x9f));var _0xb607=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x607b[_0x311c35];return _0x5cc50c;};'use strict';var util=require(_0xb607('0x0'));var logger=require(_0xb607('0x1'))('fax');var BPromise=require(_0xb607('0x2'));var exec=require(_0xb607('0x3'))[_0xb607('0x4')];exports[_0xb607('0x5')]=function(_0x1a31be){return new BPromise(function(_0x32474b,_0x470fe5){exec(_0x1a31be,function(_0x335e74,_0x1ea4e0,_0x5cd9b1){logger[_0xb607('0x6')](_0xb607('0x7'),_0x1ea4e0);if(_0x335e74){logger[_0xb607('0x6')](_0xb607('0x7'),_0xb607('0x8'),util[_0xb607('0x9')](_0x335e74,{'showHidden':![],'depth':null}),_0x1ea4e0,_0x5cd9b1);_0x470fe5(_0x335e74);}_0x32474b(_0x1ea4e0);});});};
\ No newline at end of file
index 1475cef..b5f1f68 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x97f2=['moment','../../../../config/logger','message','info','inspect','addVariables','ecm','headerinfo','minrate','maxrate','format','modem','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','xcally-motion-fax','from-sip','util','lodash'];(function(_0x422103,_0x4277fa){var _0x494110=function(_0x462097){while(--_0x462097){_0x422103['push'](_0x422103['shift']());}};_0x494110(++_0x4277fa);}(_0x97f2,0x129));var _0x297f=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x97f2[_0x4a9fb1];return _0x348672;};'use strict';var util=require(_0x297f('0x0'));var _=require(_0x297f('0x1'));var moment=require(_0x297f('0x2'));var logger=require(_0x297f('0x3'))('fax');exports[_0x297f('0x4')]=function(_0x8b2381){return{'message':_0x8b2381};};exports['logger']=function(_0x2faeb5,_0xafc062){logger[_0x297f('0x5')](_0x2faeb5,util[_0x297f('0x6')](_0xafc062,{'showHidden':![],'depth':null}));};exports[_0x297f('0x7')]=function(_0x54c59c,_0x3d7c32){var _0x110303={'XMF-ECM':_0x3d7c32[_0x297f('0x8')],'XMF-HEADERINFO':_0x3d7c32[_0x297f('0x9')],'XMF-MINRATE':_0x3d7c32[_0x297f('0xa')],'XMF-MAXRATE':_0x3d7c32[_0x297f('0xb')],'XMF-MODEM':util[_0x297f('0xc')]('\x22%s\x22',_0x3d7c32[_0x297f('0xd')]),'XMF-GATEWAY':_0x3d7c32['gateway'],'XMF-FAXDETECT':_0x3d7c32[_0x297f('0xe')],'XMF-T38TIMEOUT':_0x3d7c32[_0x297f('0xf')],'XMF-LOCALSTATIONID':_0x3d7c32[_0x297f('0x10')],'XMF-PATH':_0x54c59c[_0x297f('0x11')]};return _0x110303;};exports[_0x297f('0x12')]=function(_0x5adbd4,_0x4a0279){return{'actionid':_0x5adbd4[_0x297f('0x13')],'action':_0x297f('0x14'),'channel':_0x5adbd4['channel'],'Exten':_0x297f('0x15'),'Context':_0x297f('0x16'),'Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x5adbd4[_0x297f('0x9')]?_0x5adbd4[_0x297f('0x9')]:'',_0x5adbd4[_0x297f('0x10')]),'variable':_0x4a0279,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x5adbd4[_0x297f('0x13')]};};
\ No newline at end of file
+var _0xd81f=['logger','info','ecm','minrate','maxrate','\x22%s\x22','modem','t38timeout','localstationid','path','variablesAction','uniqueid','originate','xcally-motion-fax','from-sip','format','\x22%s\x22\x20<%s>','headerinfo','util','lodash','moment','../../../../config/logger','fax','message'];(function(_0x108c5b,_0x52c0fb){var _0x2afb52=function(_0x586416){while(--_0x586416){_0x108c5b['push'](_0x108c5b['shift']());}};_0x2afb52(++_0x52c0fb);}(_0xd81f,0x1c2));var _0xfd81=function(_0x2d364e,_0x301c5e){_0x2d364e=_0x2d364e-0x0;var _0x1b9312=_0xd81f[_0x2d364e];return _0x1b9312;};'use strict';var util=require(_0xfd81('0x0'));var _=require(_0xfd81('0x1'));var moment=require(_0xfd81('0x2'));var logger=require(_0xfd81('0x3'))(_0xfd81('0x4'));exports[_0xfd81('0x5')]=function(_0x4408ec){return{'message':_0x4408ec};};exports[_0xfd81('0x6')]=function(_0x14c3cb,_0x1f3a18){logger[_0xfd81('0x7')](_0x14c3cb,util['inspect'](_0x1f3a18,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x34008a,_0x518119){var _0x1dd30c={'XMF-ECM':_0x518119[_0xfd81('0x8')],'XMF-HEADERINFO':_0x518119['headerinfo'],'XMF-MINRATE':_0x518119[_0xfd81('0x9')],'XMF-MAXRATE':_0x518119[_0xfd81('0xa')],'XMF-MODEM':util['format'](_0xfd81('0xb'),_0x518119[_0xfd81('0xc')]),'XMF-GATEWAY':_0x518119['gateway'],'XMF-FAXDETECT':_0x518119['faxdetect'],'XMF-T38TIMEOUT':_0x518119[_0xfd81('0xd')],'XMF-LOCALSTATIONID':_0x518119[_0xfd81('0xe')],'XMF-PATH':_0x34008a[_0xfd81('0xf')]};return _0x1dd30c;};exports[_0xfd81('0x10')]=function(_0x22c774,_0x1fdbe7){return{'actionid':_0x22c774[_0xfd81('0x11')],'action':_0xfd81('0x12'),'channel':_0x22c774['channel'],'Exten':_0xfd81('0x13'),'Context':_0xfd81('0x14'),'Priority':'1','callerid':util[_0xfd81('0x15')](_0xfd81('0x16'),_0x22c774[_0xfd81('0x17')]?_0x22c774['headerinfo']:'',_0x22c774[_0xfd81('0xe')]),'variable':_0x1fdbe7,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x22c774[_0xfd81('0x11')]};};
\ No newline at end of file
index 96d76c6..addcaad 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1a41=['./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','log','listen','sync','util','moment','./realtime','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueueReport'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a41,0x115));var _0x11a4=function(_0x208d39,_0x318d89){_0x208d39=_0x208d39-0x0;var _0x3e4f4b=_0x1a41[_0x208d39];return _0x3e4f4b;};'use strict';var BPromise=require('bluebird');var util=require(_0x11a4('0x0'));var moment=require(_0x11a4('0x1'));var server=require('./server');var Realtime=require(_0x11a4('0x2'));var Report=require(_0x11a4('0x3'));var Acw=require(_0x11a4('0x4'));var Trigger=require(_0x11a4('0x5'));var Dialer=require(_0x11a4('0x6'));var Preview=require(_0x11a4('0x7'));var Fax=require(_0x11a4('0x8'));var user=require(_0x11a4('0x9'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x11a4('0xa'));var voiceCallReport=require(_0x11a4('0xb'));var trunk=require(_0x11a4('0xc'));var trigger=require(_0x11a4('0xd'));var template=require(_0x11a4('0xe'));var cmHopperHistory=require(_0x11a4('0xf'));var campaign=require(_0x11a4('0x10'));var voiceExtension=require(_0x11a4('0x11'));var faxAccount=require(_0x11a4('0x12'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x11a4('0x13'));var sugarcrm=require(_0x11a4('0x14'));var freshdesk=require(_0x11a4('0x15'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x11a4('0x16'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0x11a4('0x17'));var servicenow=require(_0x11a4('0x18'));var dynamics365=require(_0x11a4('0x19'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x11a4('0x1a')](_0x11a4('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x11a4('0x1a')](_0x11a4('0x1b'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x11a4('0x1c')]()[_0x11a4('0x1d')](user[_0x11a4('0x1e')]())[_0x11a4('0x1d')](realtime[_0x11a4('0x1f')]())['then'](user[_0x11a4('0x20')]())[_0x11a4('0x1d')](realtime[_0x11a4('0x21')]())[_0x11a4('0x1d')](trunk[_0x11a4('0x22')]())['then'](realtime[_0x11a4('0x23')]())['then'](voiceQueue[_0x11a4('0x24')]())['then'](realtime[_0x11a4('0x25')]())['then'](trigger[_0x11a4('0x26')]())[_0x11a4('0x1d')](realtime[_0x11a4('0x27')]())[_0x11a4('0x1d')](template[_0x11a4('0x28')]())[_0x11a4('0x1d')](realtime[_0x11a4('0x29')]())[_0x11a4('0x1d')](zendesk['getZendeskAccounts']())[_0x11a4('0x1d')](realtime[_0x11a4('0x2a')]())[_0x11a4('0x1d')](salesforce[_0x11a4('0x2b')]())['then'](realtime[_0x11a4('0x2c')]())[_0x11a4('0x1d')](sugarcrm[_0x11a4('0x2d')]())[_0x11a4('0x1d')](realtime[_0x11a4('0x2e')]())[_0x11a4('0x1d')](freshdesk[_0x11a4('0x2f')]())['then'](realtime[_0x11a4('0x30')]())[_0x11a4('0x1d')](desk[_0x11a4('0x31')]())[_0x11a4('0x1d')](realtime[_0x11a4('0x32')]())['then'](zoho[_0x11a4('0x33')]())[_0x11a4('0x1d')](realtime[_0x11a4('0x34')]())['then'](vtiger[_0x11a4('0x35')]())[_0x11a4('0x1d')](realtime[_0x11a4('0x36')]())['then'](freshsales['getFreshsalesAccounts']())[_0x11a4('0x1d')](realtime[_0x11a4('0x37')]())['then'](servicenow[_0x11a4('0x38')]())[_0x11a4('0x1d')](realtime['initServicenowAccounts']())[_0x11a4('0x1d')](dynamics365[_0x11a4('0x39')]())[_0x11a4('0x1d')](realtime[_0x11a4('0x3a')]())[_0x11a4('0x1d')](campaign[_0x11a4('0x3b')]())[_0x11a4('0x1d')](realtime[_0x11a4('0x3c')]())[_0x11a4('0x1d')](voiceExtension['getVoiceExtensions']())[_0x11a4('0x1d')](realtime[_0x11a4('0x3d')]())[_0x11a4('0x1d')](faxAccount['getFaxAccounts']())[_0x11a4('0x1d')](realtime[_0x11a4('0x3e')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x11a4('0x1c')]()[_0x11a4('0x1d')](voiceQueueReport[_0x11a4('0x3f')]())[_0x11a4('0x1d')](realtime['initVoiceQueueReports']())[_0x11a4('0x1d')](cmHopperHistory[_0x11a4('0x40')]())[_0x11a4('0x1d')](realtime['initVoiceQueueHopperHistory']())['then'](cmHopperHistory[_0x11a4('0x41')]())[_0x11a4('0x1d')](realtime[_0x11a4('0x42')]())[_0x11a4('0x1d')](voiceCallReport[_0x11a4('0x43')]())['then'](realtime['initVoiceCallReports']())[_0x11a4('0x1d')](function(_0x463de0){})[_0x11a4('0x44')](function(_0x4dd25){console[_0x11a4('0x45')](_0x4dd25);});}function main(){return server[_0x11a4('0x46')](realtime,preview,fax)[_0x11a4('0x1d')](function(_0x1ece0b){return initRealtime();})[_0x11a4('0x1d')](function(){return initParams();})['then'](function(){report[_0x11a4('0x47')]();setInterval(initRealtime,0x1388);})[_0x11a4('0x44')](function(_0xc340be){console[_0x11a4('0x45')](_0xc340be);});}main();
\ No newline at end of file
+var _0xa636=['initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','log','listen','sync','util','./server','./report','./acw','./trigger','./dialer','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','get','hour','then','getAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','initSugarcrmAccounts','initFreshdeskAccounts'];(function(_0x53da91,_0x269795){var _0x58c9df=function(_0x4f54e2){while(--_0x4f54e2){_0x53da91['push'](_0x53da91['shift']());}};_0x58c9df(++_0x269795);}(_0xa636,0xe0));var _0x6a63=function(_0x28ad6c,_0x599a96){_0x28ad6c=_0x28ad6c-0x0;var _0x597de8=_0xa636[_0x28ad6c];return _0x597de8;};'use strict';var BPromise=require('bluebird');var util=require(_0x6a63('0x0'));var moment=require('moment');var server=require(_0x6a63('0x1'));var Realtime=require('./realtime');var Report=require(_0x6a63('0x2'));var Acw=require(_0x6a63('0x3'));var Trigger=require(_0x6a63('0x4'));var Dialer=require(_0x6a63('0x5'));var Preview=require(_0x6a63('0x6'));var Fax=require(_0x6a63('0x7'));var user=require(_0x6a63('0x8'));var voiceQueue=require(_0x6a63('0x9'));var voiceQueueReport=require(_0x6a63('0xa'));var voiceCallReport=require(_0x6a63('0xb'));var trunk=require(_0x6a63('0xc'));var trigger=require('./rpc/trigger');var template=require(_0x6a63('0xd'));var cmHopperHistory=require(_0x6a63('0xe'));var campaign=require(_0x6a63('0xf'));var voiceExtension=require(_0x6a63('0x10'));var faxAccount=require(_0x6a63('0x11'));var zendesk=require(_0x6a63('0x12'));var salesforce=require(_0x6a63('0x13'));var sugarcrm=require(_0x6a63('0x14'));var freshdesk=require(_0x6a63('0x15'));var desk=require(_0x6a63('0x16'));var zoho=require(_0x6a63('0x17'));var vtiger=require(_0x6a63('0x18'));var freshsales=require(_0x6a63('0x19'));var servicenow=require('./rpc/integrations/servicenow');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()[_0x6a63('0x1a')](_0x6a63('0x1b'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x6a63('0x1a')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x6a63('0x1c')](user[_0x6a63('0x1d')]())[_0x6a63('0x1c')](realtime['initAgents']())[_0x6a63('0x1c')](user[_0x6a63('0x1e')]())['then'](realtime[_0x6a63('0x1f')]())['then'](trunk[_0x6a63('0x20')]())['then'](realtime[_0x6a63('0x21')]())['then'](voiceQueue[_0x6a63('0x22')]())[_0x6a63('0x1c')](realtime['initVoiceQueues']())['then'](trigger[_0x6a63('0x23')]())[_0x6a63('0x1c')](realtime['initTriggers']())[_0x6a63('0x1c')](template[_0x6a63('0x24')]())[_0x6a63('0x1c')](realtime[_0x6a63('0x25')]())['then'](zendesk[_0x6a63('0x26')]())[_0x6a63('0x1c')](realtime[_0x6a63('0x27')]())[_0x6a63('0x1c')](salesforce[_0x6a63('0x28')]())[_0x6a63('0x1c')](realtime[_0x6a63('0x29')]())[_0x6a63('0x1c')](sugarcrm['getSugarcrmAccounts']())[_0x6a63('0x1c')](realtime[_0x6a63('0x2a')]())[_0x6a63('0x1c')](freshdesk['getFreshdeskAccounts']())['then'](realtime[_0x6a63('0x2b')]())[_0x6a63('0x1c')](desk['getDeskAccounts']())[_0x6a63('0x1c')](realtime[_0x6a63('0x2c')]())[_0x6a63('0x1c')](zoho[_0x6a63('0x2d')]())[_0x6a63('0x1c')](realtime[_0x6a63('0x2e')]())[_0x6a63('0x1c')](vtiger[_0x6a63('0x2f')]())['then'](realtime['initVtigerAccounts']())[_0x6a63('0x1c')](freshsales[_0x6a63('0x30')]())[_0x6a63('0x1c')](realtime['initFreshsalesAccounts']())[_0x6a63('0x1c')](servicenow['getServicenowAccounts']())[_0x6a63('0x1c')](realtime[_0x6a63('0x31')]())[_0x6a63('0x1c')](dynamics365[_0x6a63('0x32')]())[_0x6a63('0x1c')](realtime[_0x6a63('0x33')]())['then'](campaign[_0x6a63('0x34')]())[_0x6a63('0x1c')](realtime[_0x6a63('0x35')]())[_0x6a63('0x1c')](voiceExtension[_0x6a63('0x36')]())[_0x6a63('0x1c')](realtime['initVoiceExtensions']())['then'](faxAccount['getFaxAccounts']())[_0x6a63('0x1c')](realtime[_0x6a63('0x37')]())[_0x6a63('0x1c')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0x6a63('0x1c')](voiceQueueReport[_0x6a63('0x38')]())[_0x6a63('0x1c')](realtime[_0x6a63('0x39')]())['then'](cmHopperHistory[_0x6a63('0x3a')]())['then'](realtime['initVoiceQueueHopperHistory']())[_0x6a63('0x1c')](cmHopperHistory[_0x6a63('0x3b')]())[_0x6a63('0x1c')](realtime[_0x6a63('0x3c')]())['then'](voiceCallReport[_0x6a63('0x3d')]())[_0x6a63('0x1c')](realtime[_0x6a63('0x3e')]())['then'](function(_0x5c2c96){})[_0x6a63('0x3f')](function(_0x37818d){console[_0x6a63('0x40')](_0x37818d);});}function main(){return server[_0x6a63('0x41')](realtime,preview,fax)[_0x6a63('0x1c')](function(_0x52e226){return initRealtime();})[_0x6a63('0x1c')](function(){return initParams();})[_0x6a63('0x1c')](function(){report[_0x6a63('0x42')]();setInterval(initRealtime,0x1388);})[_0x6a63('0x3f')](function(_0x3938a3){console[_0x6a63('0x40')](_0x3938a3);});}main();
\ No newline at end of file
index 636da2c..0501c0e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0713=['idle','inuse','talking','voiceStatusTime','toNumber','format','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','state','toLowerCase','not_inuse'];(function(_0x259cf3,_0xcdf232){var _0x267c74=function(_0x5e8c1d){while(--_0x5e8c1d){_0x259cf3['push'](_0x259cf3['shift']());}};_0x267c74(++_0xcdf232);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent;
\ No newline at end of file
+var _0xe706=['address','phone','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','updateStatusRealtime','not_inuse','inuse','talking','format','interface','stringify','md5','user:%s','emit','user:presence','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status'];(function(_0x432a9a,_0x5d951c){var _0x5dc88c=function(_0x2f5ee8){while(--_0x2f5ee8){_0x432a9a['push'](_0x432a9a['shift']());}};_0x5dc88c(++_0x5d951c);}(_0xe706,0xa3));var _0x6e70=function(_0x134999,_0x4de0c9){_0x134999=_0x134999-0x0;var _0x46e471=_0xe706[_0x134999];return _0x46e471;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var md5=require('md5');var Redis=require(_0x6e70('0x3'));var config=require(_0x6e70('0x4'));config[_0x6e70('0x5')]=_[_0x6e70('0x6')](config[_0x6e70('0x5')],{'host':_0x6e70('0x7'),'port':0x18eb});var io=require(_0x6e70('0x8'))(new Redis(config[_0x6e70('0x5')]));function Agent(_0x1b0389){this['id']=_0x1b0389['id']||0x0;this[_0x6e70('0x9')]=_0x1b0389[_0x6e70('0x9')]||'';this[_0x6e70('0xa')]=_0x1b0389[_0x6e70('0xa')]||'';this[_0x6e70('0xb')]=_0x1b0389[_0x6e70('0xb')]||'';this[_0x6e70('0xc')]=_0x1b0389[_0x6e70('0xc')]||'';this[_0x6e70('0xd')]=_0x6e70('0xe');this[_0x6e70('0xf')]=0x0;this[_0x6e70('0x10')]=_0x6e70('0xe');this[_0x6e70('0x11')]='';this[_0x6e70('0x12')]='';this['mobile']='';this['interface']='';this[_0x6e70('0x13')]=_0x1b0389[_0x6e70('0x13')]||![];this[_0x6e70('0x14')]=_0x6e70('0xe');this[_0x6e70('0x15')]=0x0;this[_0x6e70('0x16')]='';this[_0x6e70('0x17')]='';this[_0x6e70('0x18')]=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x6e70('0x19')]=function(_0x5a37a6){var _0x53aed0;if(_0x5a37a6&&_0x5a37a6[_0x6e70('0xd')]){_0x53aed0=_0x5a37a6[_0x6e70('0xd')]['toLowerCase']();switch(_0x53aed0){case _0x6e70('0x1a'):_0x53aed0='idle';break;case _0x6e70('0x1b'):_0x53aed0=_0x6e70('0x1c');break;}}if(_0x53aed0&&this['voiceStatus']!==_0x53aed0||_0x5a37a6['statePause']){this[_0x6e70('0x15')]=_['toNumber'](moment()[_0x6e70('0x1d')]('x'));}if(_0x53aed0){this[_0x6e70('0x14')]=_0x53aed0;}var _0x53acdc={'id':this['id'],'name':this['name'],'email':this[_0x6e70('0xa')],'accountcode':this[_0x6e70('0xb')],'fullname':this[_0x6e70('0xc')],'state':this[_0x6e70('0xd')],'stateTime':this[_0x6e70('0xf')],'status':this[_0x6e70('0x10')],'address':this[_0x6e70('0x11')],'online':this[_0x6e70('0x13')],'voiceStatus':this[_0x6e70('0x14')],'voiceStatusTime':this[_0x6e70('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x6e70('0x17')],'interface':this[_0x6e70('0x1e')],'onhold':this[_0x6e70('0x18')]};var _0x502b2d=md5(JSON[_0x6e70('0x1f')](_0x53acdc));if(this[_0x6e70('0x20')]!==_0x502b2d){this[_0x6e70('0x20')]=_0x502b2d;io['to'](util['format'](_0x6e70('0x21'),_0x53acdc['name']))['emit']('user:save',_0x53acdc);io[_0x6e70('0x22')](_0x6e70('0x23'),_0x53acdc);}};module['exports']=Agent;
\ No newline at end of file
index c0b0db4..b51bc62 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1dc=['dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','dialTimezone','dialGlobalInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency'];(function(_0x18882b,_0x25d1c0){var _0x4ef0fc=function(_0x252b01){while(--_0x252b01){_0x18882b['push'](_0x18882b['shift']());}};_0x4ef0fc(++_0x25d1c0);}(_0xe1dc,0x12d));var _0xce1d=function(_0xee94a1,_0x32bfab){_0xee94a1=_0xee94a1-0x0;var _0x510b45=_0xe1dc[_0xee94a1];return _0x510b45;};'use strict';function Campaign(_0x3c431e){this['id']=_0x3c431e['id']||0x0;this[_0xce1d('0x0')]=_0x3c431e['name']||'';this[_0xce1d('0x1')]=_0x3c431e[_0xce1d('0x1')]||'campaign';this[_0xce1d('0x2')]=0x0;this[_0xce1d('0x3')]=0x0;this[_0xce1d('0x4')]=0x0;this[_0xce1d('0x5')]=0x0;this[_0xce1d('0x6')]='';this[_0xce1d('0x7')]=!![];this[_0xce1d('0x8')]=_0x3c431e[_0xce1d('0x8')];this['limitCalls']=_0x3c431e['limitCalls'];this['dialTimezone']=_0x3c431e[_0xce1d('0x9')]||null;this[_0xce1d('0xa')]=_0x3c431e[_0xce1d('0xa')]?_0x3c431e['dialGlobalInterval']:null;this['dialOriginateCallerIdName']=_0x3c431e['dialOriginateCallerIdName'];this[_0xce1d('0xb')]=_0x3c431e['dialOriginateCallerIdNumber'];this[_0xce1d('0xc')]=_0x3c431e[_0xce1d('0xc')]||0x1e;this[_0xce1d('0xd')]=_0x3c431e[_0xce1d('0xd')];this[_0xce1d('0xe')]=_0x3c431e['dialCongestionRetryFrequency'];this[_0xce1d('0xf')]=_0x3c431e[_0xce1d('0xf')];this[_0xce1d('0x10')]=_0x3c431e[_0xce1d('0x10')];this[_0xce1d('0x11')]=_0x3c431e[_0xce1d('0x11')];this['dialNoAnswerRetryFrequency']=_0x3c431e['dialNoAnswerRetryFrequency'];this[_0xce1d('0x12')]=_0x3c431e[_0xce1d('0x12')];this[_0xce1d('0x13')]=_0x3c431e['dialNoSuchNumberMaxRetry']||0x3;this[_0xce1d('0x14')]=_0x3c431e[_0xce1d('0x14')]||0x96;this[_0xce1d('0x15')]=_0x3c431e[_0xce1d('0x15')]||0x3;this['dialDropRetryFrequency']=_0x3c431e[_0xce1d('0x16')]||0x96;this[_0xce1d('0x17')]=_0x3c431e['dialAbandonedMaxRetry']||0x3;this[_0xce1d('0x18')]=_0x3c431e[_0xce1d('0x18')]||0x96;this[_0xce1d('0x19')]=_0x3c431e['dialMachineMaxRetry']||0x3;this['dialMachineRetryFrequency']=_0x3c431e['dialMachineRetryFrequency']||0x96;this['dialAgentRejectMaxRetry']=_0x3c431e[_0xce1d('0x1a')]||0x3;this['dialAgentRejectRetryFrequency']=_0x3c431e[_0xce1d('0x1b')]||0x96;this[_0xce1d('0x1c')]=_0x3c431e['dialOrderByScheduledAt']||_0xce1d('0x1d');this[_0xce1d('0x1e')]=_0x3c431e[_0xce1d('0x1e')]||undefined;this[_0xce1d('0x1f')]=_0x3c431e[_0xce1d('0x1f')]||undefined;this['dialCutDigit']=_0x3c431e[_0xce1d('0x20')]||undefined;this[_0xce1d('0x21')]=_0x3c431e[_0xce1d('0x21')]?_0x3c431e['TrunkBackup']:undefined;this[_0xce1d('0x22')]=_0x3c431e['Trunk']?_0x3c431e[_0xce1d('0x22')]:undefined;this[_0xce1d('0x23')]=_0x3c431e[_0xce1d('0x23')]?_0x3c431e[_0xce1d('0x23')]:undefined;this[_0xce1d('0x24')]=_0x3c431e[_0xce1d('0x24')]?_0x3c431e['SquareProject']:undefined;this[_0xce1d('0x25')]=_0x3c431e[_0xce1d('0x24')]?_0x3c431e['SquareProject']['name']:undefined;this['dialAMDActive']=_0x3c431e[_0xce1d('0x26')]||![];this[_0xce1d('0x27')]=_0x3c431e[_0xce1d('0x27')];this[_0xce1d('0x28')]=_0x3c431e[_0xce1d('0x28')];this[_0xce1d('0x29')]=_0x3c431e[_0xce1d('0x29')];this[_0xce1d('0x2a')]=_0x3c431e['dialAMDTotalAnalysisTime'];this[_0xce1d('0x2b')]=_0x3c431e[_0xce1d('0x2b')];this[_0xce1d('0x2c')]=_0x3c431e[_0xce1d('0x2c')];this['dialAMDMaximumNumberOfWords']=_0x3c431e[_0xce1d('0x2d')];this[_0xce1d('0x2e')]=_0x3c431e[_0xce1d('0x2e')];this['dialAMDMaximumWordLength']=_0x3c431e['dialAMDMaximumWordLength'];}module['exports']=Campaign;
\ No newline at end of file
+var _0x11d9=['originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','name','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','type','campaign'];(function(_0x2085f3,_0x50105b){var _0x384e3c=function(_0x235fa0){while(--_0x235fa0){_0x2085f3['push'](_0x2085f3['shift']());}};_0x384e3c(++_0x50105b);}(_0x11d9,0x155));var _0x911d=function(_0x48e404,_0x579a40){_0x48e404=_0x48e404-0x0;var _0x217f36=_0x11d9[_0x48e404];return _0x217f36;};'use strict';function Campaign(_0x59f80e){this['id']=_0x59f80e['id']||0x0;this['name']=_0x59f80e['name']||'';this[_0x911d('0x0')]=_0x59f80e[_0x911d('0x0')]||_0x911d('0x1');this[_0x911d('0x2')]=0x0;this[_0x911d('0x3')]=0x0;this[_0x911d('0x4')]=0x0;this[_0x911d('0x5')]=0x0;this[_0x911d('0x6')]='';this[_0x911d('0x7')]=!![];this[_0x911d('0x8')]=_0x59f80e[_0x911d('0x8')];this[_0x911d('0x9')]=_0x59f80e[_0x911d('0x9')];this[_0x911d('0xa')]=_0x59f80e[_0x911d('0xa')]||null;this[_0x911d('0xb')]=_0x59f80e['dialGlobalInterval']?_0x59f80e[_0x911d('0xb')]:null;this[_0x911d('0xc')]=_0x59f80e[_0x911d('0xc')];this[_0x911d('0xd')]=_0x59f80e[_0x911d('0xd')];this['dialOriginateTimeout']=_0x59f80e[_0x911d('0xe')]||0x1e;this['dialCongestionMaxRetry']=_0x59f80e['dialCongestionMaxRetry'];this[_0x911d('0xf')]=_0x59f80e[_0x911d('0xf')];this[_0x911d('0x10')]=_0x59f80e[_0x911d('0x10')];this['dialBusyRetryFrequency']=_0x59f80e[_0x911d('0x11')];this['dialNoAnswerMaxRetry']=_0x59f80e[_0x911d('0x12')];this[_0x911d('0x13')]=_0x59f80e[_0x911d('0x13')];this[_0x911d('0x14')]=_0x59f80e[_0x911d('0x14')];this[_0x911d('0x15')]=_0x59f80e[_0x911d('0x15')]||0x3;this[_0x911d('0x16')]=_0x59f80e['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x59f80e[_0x911d('0x17')]||0x3;this['dialDropRetryFrequency']=_0x59f80e[_0x911d('0x18')]||0x96;this[_0x911d('0x19')]=_0x59f80e[_0x911d('0x19')]||0x3;this['dialAbandonedRetryFrequency']=_0x59f80e['dialAbandonedRetryFrequency']||0x96;this[_0x911d('0x1a')]=_0x59f80e[_0x911d('0x1a')]||0x3;this[_0x911d('0x1b')]=_0x59f80e['dialMachineRetryFrequency']||0x96;this[_0x911d('0x1c')]=_0x59f80e['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x59f80e['dialAgentRejectRetryFrequency']||0x96;this['dialOrderByScheduledAt']=_0x59f80e[_0x911d('0x1d')]||'DESC';this['dialPrefix']=_0x59f80e[_0x911d('0x1e')]||undefined;this[_0x911d('0x1f')]=_0x59f80e[_0x911d('0x1f')]||undefined;this[_0x911d('0x20')]=_0x59f80e[_0x911d('0x20')]||undefined;this['TrunkBackup']=_0x59f80e[_0x911d('0x21')]?_0x59f80e[_0x911d('0x21')]:undefined;this[_0x911d('0x22')]=_0x59f80e['Trunk']?_0x59f80e[_0x911d('0x22')]:undefined;this[_0x911d('0x23')]=_0x59f80e[_0x911d('0x23')]?_0x59f80e[_0x911d('0x23')]:undefined;this[_0x911d('0x24')]=_0x59f80e['SquareProject']?_0x59f80e['SquareProject']:undefined;this[_0x911d('0x25')]=_0x59f80e[_0x911d('0x24')]?_0x59f80e[_0x911d('0x24')][_0x911d('0x26')]:undefined;this[_0x911d('0x27')]=_0x59f80e[_0x911d('0x27')]||![];this[_0x911d('0x28')]=_0x59f80e[_0x911d('0x28')];this[_0x911d('0x29')]=_0x59f80e['dialAMDGreeting'];this[_0x911d('0x2a')]=_0x59f80e[_0x911d('0x2a')];this['dialAMDTotalAnalysisTime']=_0x59f80e[_0x911d('0x2b')];this['dialAMDMinWordLength']=_0x59f80e[_0x911d('0x2c')];this['dialAMDBetweenWordsSilence']=_0x59f80e[_0x911d('0x2d')];this[_0x911d('0x2e')]=_0x59f80e[_0x911d('0x2e')];this[_0x911d('0x2f')]=_0x59f80e['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x59f80e[_0x911d('0x30')];}module['exports']=Campaign;
\ No newline at end of file
index 8bb30c1..8a3964f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5c9=['holdtime','type','tag','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','exports','starttime','channel','destinationchannel','calleridnum','connectedlinename','accountcode','exten','answered','answertime','endtime','abandoned','lastdata','duration'];(function(_0x2962d5,_0x38deda){var _0x273406=function(_0x3e0775){while(--_0x3e0775){_0x2962d5['push'](_0x2962d5['shift']());}};_0x273406(++_0x38deda);}(_0xa5c9,0x143));var _0x9a5c=function(_0x4de1b1,_0x18c64c){_0x4de1b1=_0x4de1b1-0x0;var _0x639f27=_0xa5c9[_0x4de1b1];return _0x639f27;};'use strict';function Channel(){this[_0x9a5c('0x0')]=null;this[_0x9a5c('0x1')]='';this[_0x9a5c('0x2')]='';this[_0x9a5c('0x3')]=0x0;this['calleridname']='';this['connectedlinenum']=undefined;this[_0x9a5c('0x4')]=undefined;this[_0x9a5c('0x5')]=0x0;this['context']='';this['uniqueid']=0x0;this['linkedid']=0x0;this[_0x9a5c('0x6')]=0x0;this[_0x9a5c('0x7')]=![];this[_0x9a5c('0x8')]=null;this[_0x9a5c('0x9')]=null;this['unmanaged']=![];this[_0x9a5c('0xa')]=![];this['lastapplication']='';this[_0x9a5c('0xb')]='';this[_0x9a5c('0xc')]=0x0;this['billableseconds']=0x0;this[_0x9a5c('0xd')]=0x0;this[_0x9a5c('0xe')]=null;this[_0x9a5c('0xf')]=null;this['disposition']=null;this['monitor']=![];this[_0x9a5c('0x10')]=null;this[_0x9a5c('0x11')]=null;this[_0x9a5c('0x12')]=[];this[_0x9a5c('0x13')]=undefined;this[_0x9a5c('0x14')]=undefined;this[_0x9a5c('0x15')]=undefined;this[_0x9a5c('0x16')]=0x0;}module[_0x9a5c('0x17')]=Channel;
\ No newline at end of file
+var _0x00ea=['abandoned','lastapplication','duration','billableseconds','type','tag','disposition','monitorFilename','queue','transfercalleridnum','transferType','mohtime','exports','channel','destinationchannel','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','exten','answered','answertime','endtime'];(function(_0x187a70,_0x1c55a0){var _0x33e3e9=function(_0x1d5873){while(--_0x1d5873){_0x187a70['push'](_0x187a70['shift']());}};_0x33e3e9(++_0x1c55a0);}(_0x00ea,0x19d));var _0xa00e=function(_0x4d1e96,_0x36196a){_0x4d1e96=_0x4d1e96-0x0;var _0x1e0c01=_0x00ea[_0x4d1e96];return _0x1e0c01;};'use strict';function Channel(){this['starttime']=null;this[_0xa00e('0x0')]='';this[_0xa00e('0x1')]='';this['calleridnum']=0x0;this[_0xa00e('0x2')]='';this[_0xa00e('0x3')]=undefined;this[_0xa00e('0x4')]=undefined;this[_0xa00e('0x5')]=0x0;this[_0xa00e('0x6')]='';this[_0xa00e('0x7')]=0x0;this['linkedid']=0x0;this[_0xa00e('0x8')]=0x0;this[_0xa00e('0x9')]=![];this[_0xa00e('0xa')]=null;this[_0xa00e('0xb')]=null;this['unmanaged']=![];this[_0xa00e('0xc')]=![];this[_0xa00e('0xd')]='';this['lastdata']='';this[_0xa00e('0xe')]=0x0;this[_0xa00e('0xf')]=0x0;this['holdtime']=0x0;this[_0xa00e('0x10')]=null;this[_0xa00e('0x11')]=null;this[_0xa00e('0x12')]=null;this['monitor']=![];this[_0xa00e('0x13')]=null;this[_0xa00e('0x14')]=null;this['monitors']=[];this[_0xa00e('0x15')]=undefined;this['transferconnectedlinenum']=undefined;this[_0xa00e('0x16')]=undefined;this[_0xa00e('0x17')]=0x0;}module[_0xa00e('0x18')]=Channel;
\ No newline at end of file
index 7b3072a..0281287 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6ef9=['authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username','remoteUri'];(function(_0x3f2357,_0x7203b4){var _0x567eb1=function(_0x4f53f7){while(--_0x4f53f7){_0x3f2357['push'](_0x3f2357['shift']());}};_0x567eb1(++_0x7203b4);}(_0x6ef9,0x171));var _0x96ef=function(_0x57b432,_0x1589a0){_0x57b432=_0x57b432-0x0;var _0x2edf2a=_0x6ef9[_0x57b432];return _0x2edf2a;};'use strict';function DeskAccount(_0x13ede1){this['id']=_0x13ede1['id']||0x0;this[_0x96ef('0x0')]=_0x13ede1[_0x96ef('0x0')]||'';this[_0x96ef('0x1')]=_0x13ede1[_0x96ef('0x1')]||'';this[_0x96ef('0x2')]=_0x13ede1['remoteUri']||'';this['authType']=_0x13ede1[_0x96ef('0x3')]||'';this[_0x96ef('0x4')]=_0x13ede1[_0x96ef('0x4')]||'';this['consumerKey']=_0x13ede1[_0x96ef('0x5')]||'';this[_0x96ef('0x6')]=_0x13ede1[_0x96ef('0x6')]||'';this[_0x96ef('0x7')]=_0x13ede1['token']||'';this[_0x96ef('0x8')]=_0x13ede1['tokenSecret']||'';this[_0x96ef('0x9')]=_0x13ede1['type']||'';this['serverUrl']=_0x13ede1[_0x96ef('0xa')]||'';this[_0x96ef('0xb')]=_0x13ede1[_0x96ef('0xb')]||{};}module['exports']=DeskAccount;
\ No newline at end of file
+var _0x4fa2=['serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0x53d22f,_0x467b3c){var _0xc332de=function(_0x380419){while(--_0x380419){_0x53d22f['push'](_0x53d22f['shift']());}};_0xc332de(++_0x467b3c);}(_0x4fa2,0x107));var _0x24fa=function(_0x2afbb0,_0x44f16d){_0x2afbb0=_0x2afbb0-0x0;var _0x411ff2=_0x4fa2[_0x2afbb0];return _0x411ff2;};'use strict';function DeskAccount(_0x5c2195){this['id']=_0x5c2195['id']||0x0;this[_0x24fa('0x0')]=_0x5c2195['name']||'';this['username']=_0x5c2195[_0x24fa('0x1')]||'';this[_0x24fa('0x2')]=_0x5c2195[_0x24fa('0x2')]||'';this[_0x24fa('0x3')]=_0x5c2195[_0x24fa('0x3')]||'';this[_0x24fa('0x4')]=_0x5c2195[_0x24fa('0x4')]||'';this['consumerKey']=_0x5c2195[_0x24fa('0x5')]||'';this[_0x24fa('0x6')]=_0x5c2195[_0x24fa('0x6')]||'';this[_0x24fa('0x7')]=_0x5c2195['token']||'';this[_0x24fa('0x8')]=_0x5c2195[_0x24fa('0x8')]||'';this[_0x24fa('0x9')]=_0x5c2195[_0x24fa('0x9')]||'';this[_0x24fa('0xa')]=_0x5c2195[_0x24fa('0xa')]||'';this[_0x24fa('0xb')]=_0x5c2195[_0x24fa('0xb')]||{};}module[_0x24fa('0xc')]=DeskAccount;
\ No newline at end of file
index abe2559..d94042f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xee5b=['clientId','clientSecret','name','username','password','remoteUri'];(function(_0x1d2195,_0x4b8096){var _0x4962cd=function(_0x301f5a){while(--_0x301f5a){_0x1d2195['push'](_0x1d2195['shift']());}};_0x4962cd(++_0x4b8096);}(_0xee5b,0x1f4));var _0xbee5=function(_0xece08d,_0x435b79){_0xece08d=_0xece08d-0x0;var _0x1e15b8=_0xee5b[_0xece08d];return _0x1e15b8;};'use strict';function Dynamics365Account(_0x5384bd){this['id']=_0x5384bd['id']||0x0;this['name']=_0x5384bd[_0xbee5('0x0')]||'';this[_0xbee5('0x1')]=_0x5384bd['username']||'';this[_0xbee5('0x2')]=_0x5384bd[_0xbee5('0x2')]||'';this[_0xbee5('0x3')]=_0x5384bd[_0xbee5('0x3')]||'';this['tenantId']=_0x5384bd['tenantId']||'';this[_0xbee5('0x4')]=_0x5384bd[_0xbee5('0x4')]||'';this[_0xbee5('0x5')]=_0x5384bd[_0xbee5('0x5')]||{};this['serverUrl']=_0x5384bd['serverUrl']||'';this['Configurations']=_0x5384bd['Configurations']||{};}module['exports']=Dynamics365Account;
\ No newline at end of file
+var _0xe706=['serverUrl','Configurations','exports','name','username','password','remoteUri','tenantId','clientId','clientSecret'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0xe706,0xa3));var _0x6e70=function(_0x42276c,_0x141d47){_0x42276c=_0x42276c-0x0;var _0x1b5009=_0xe706[_0x42276c];return _0x1b5009;};'use strict';function Dynamics365Account(_0x454c8f){this['id']=_0x454c8f['id']||0x0;this[_0x6e70('0x0')]=_0x454c8f[_0x6e70('0x0')]||'';this['username']=_0x454c8f[_0x6e70('0x1')]||'';this[_0x6e70('0x2')]=_0x454c8f[_0x6e70('0x2')]||'';this[_0x6e70('0x3')]=_0x454c8f[_0x6e70('0x3')]||'';this[_0x6e70('0x4')]=_0x454c8f[_0x6e70('0x4')]||'';this[_0x6e70('0x5')]=_0x454c8f[_0x6e70('0x5')]||'';this[_0x6e70('0x6')]=_0x454c8f[_0x6e70('0x6')]||{};this[_0x6e70('0x7')]=_0x454c8f[_0x6e70('0x7')]||'';this[_0x6e70('0x8')]=_0x454c8f[_0x6e70('0x8')]||{};}module[_0x6e70('0x9')]=Dynamics365Account;
\ No newline at end of file
index 53794c0..0134131 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae16=['localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo'];(function(_0x8e276f,_0x356cc2){var _0x2da08d=function(_0x3f69fd){while(--_0x3f69fd){_0x8e276f['push'](_0x8e276f['shift']());}};_0x2da08d(++_0x356cc2);}(_0xae16,0x1ac));var _0x6ae1=function(_0x12a614,_0x3f8b65){_0x12a614=_0x12a614-0x0;var _0x23b9a1=_0xae16[_0x12a614];return _0x23b9a1;};'use strict';function FaxAccount(_0x7936c6){this['id']=_0x7936c6['id']||0x0;this[_0x6ae1('0x0')]=_0x7936c6['name']||'';this[_0x6ae1('0x1')]=_0x7936c6[_0x6ae1('0x1')];this[_0x6ae1('0x2')]=_0x7936c6['ecm'];this['headerinfo']=_0x7936c6[_0x6ae1('0x3')];this[_0x6ae1('0x4')]=_0x7936c6[_0x6ae1('0x4')];this[_0x6ae1('0x5')]=_0x7936c6[_0x6ae1('0x5')]||0x960;this[_0x6ae1('0x6')]=_0x7936c6[_0x6ae1('0x6')]||0x3840;this['modem']=_0x7936c6[_0x6ae1('0x7')]||'v17,v27,v29';this[_0x6ae1('0x8')]=_0x7936c6[_0x6ae1('0x8')]||'no';this[_0x6ae1('0x9')]=_0x7936c6[_0x6ae1('0x9')]||'no';this['t38timeout']=_0x7936c6[_0x6ae1('0xa')]||0x1388;this[_0x6ae1('0xb')]=_0x7936c6['tech']||'SIP';this['Trunk']=_0x7936c6[_0x6ae1('0xc')]?_0x7936c6[_0x6ae1('0xc')]:undefined;this[_0x6ae1('0xd')]=_0x7936c6[_0x6ae1('0xd')];this[_0x6ae1('0xe')]=_0x7936c6[_0x6ae1('0xe')];}module[_0x6ae1('0xf')]=FaxAccount;
\ No newline at end of file
+var _0xec63=['modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','name','description','ecm','headerinfo','localstationid','minrate','maxrate'];(function(_0x39db05,_0x3868d0){var _0x3f0e22=function(_0x532c4f){while(--_0x532c4f){_0x39db05['push'](_0x39db05['shift']());}};_0x3f0e22(++_0x3868d0);}(_0xec63,0x12b));var _0x3ec6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xec63[_0x20a584];return _0x4b41a8;};'use strict';function FaxAccount(_0x316135){this['id']=_0x316135['id']||0x0;this[_0x3ec6('0x0')]=_0x316135[_0x3ec6('0x0')]||'';this[_0x3ec6('0x1')]=_0x316135[_0x3ec6('0x1')];this[_0x3ec6('0x2')]=_0x316135[_0x3ec6('0x2')];this[_0x3ec6('0x3')]=_0x316135[_0x3ec6('0x3')];this[_0x3ec6('0x4')]=_0x316135['localstationid'];this[_0x3ec6('0x5')]=_0x316135[_0x3ec6('0x5')]||0x960;this['maxrate']=_0x316135[_0x3ec6('0x6')]||0x3840;this[_0x3ec6('0x7')]=_0x316135[_0x3ec6('0x7')]||_0x3ec6('0x8');this[_0x3ec6('0x9')]=_0x316135[_0x3ec6('0x9')]||'no';this[_0x3ec6('0xa')]=_0x316135[_0x3ec6('0xa')]||'no';this[_0x3ec6('0xb')]=_0x316135['t38timeout']||0x1388;this[_0x3ec6('0xc')]=_0x316135[_0x3ec6('0xc')]||_0x3ec6('0xd');this['Trunk']=_0x316135['Trunk']?_0x316135[_0x3ec6('0xe')]:undefined;this[_0x3ec6('0xf')]=_0x316135['ListId'];this[_0x3ec6('0x10')]=_0x316135['key'];}module['exports']=FaxAccount;
\ No newline at end of file
index 7111645..8d5bd11 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb340=['exports','name','username','apiKey','remoteUri','serverUrl'];(function(_0x5cfcee,_0x392025){var _0x54163f=function(_0x1955a5){while(--_0x1955a5){_0x5cfcee['push'](_0x5cfcee['shift']());}};_0x54163f(++_0x392025);}(_0xb340,0x15d));var _0x0b34=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xb340[_0x465028];return _0xb783d4;};'use strict';function FreshdeskAccount(_0x5ed574){this['id']=_0x5ed574['id']||0x0;this[_0x0b34('0x0')]=_0x5ed574[_0x0b34('0x0')]||'';this[_0x0b34('0x1')]=_0x5ed574[_0x0b34('0x1')]||'';this[_0x0b34('0x2')]=_0x5ed574['token']||'';this[_0x0b34('0x3')]=_0x5ed574[_0x0b34('0x3')]||'';this[_0x0b34('0x4')]=_0x5ed574['serverUrl']||'';this['Configurations']=_0x5ed574['Configurations']||{};}module[_0x0b34('0x5')]=FreshdeskAccount;
\ No newline at end of file
+var _0xb68f=['token','remoteUri','serverUrl','Configurations','name','username'];(function(_0x17510c,_0x33647c){var _0x40edef=function(_0xe326be){while(--_0xe326be){_0x17510c['push'](_0x17510c['shift']());}};_0x40edef(++_0x33647c);}(_0xb68f,0x1d8));var _0xfb68=function(_0x2e1299,_0x143cc9){_0x2e1299=_0x2e1299-0x0;var _0x690203=_0xb68f[_0x2e1299];return _0x690203;};'use strict';function FreshdeskAccount(_0x29f675){this['id']=_0x29f675['id']||0x0;this[_0xfb68('0x0')]=_0x29f675[_0xfb68('0x0')]||'';this[_0xfb68('0x1')]=_0x29f675[_0xfb68('0x1')]||'';this['apiKey']=_0x29f675[_0xfb68('0x2')]||'';this[_0xfb68('0x3')]=_0x29f675[_0xfb68('0x3')]||'';this['serverUrl']=_0x29f675[_0xfb68('0x4')]||'';this['Configurations']=_0x29f675[_0xfb68('0x5')]||{};}module['exports']=FreshdeskAccount;
\ No newline at end of file
index 6f29b3f..bfa6ea4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe9e8=['username','apiKey','token','remoteUri','serverUrl','Configurations','name'];(function(_0x190b90,_0x4a0059){var _0x462d37=function(_0x5b3a0a){while(--_0x5b3a0a){_0x190b90['push'](_0x190b90['shift']());}};_0x462d37(++_0x4a0059);}(_0xe9e8,0x179));var _0x8e9e=function(_0x1be737,_0x1eb845){_0x1be737=_0x1be737-0x0;var _0x5a661b=_0xe9e8[_0x1be737];return _0x5a661b;};'use strict';function FreshsalesAccount(_0x298ee0){this['id']=_0x298ee0['id']||0x0;this[_0x8e9e('0x0')]=_0x298ee0[_0x8e9e('0x0')]||'';this[_0x8e9e('0x1')]=_0x298ee0[_0x8e9e('0x1')]||'';this[_0x8e9e('0x2')]=_0x298ee0[_0x8e9e('0x3')]||'';this['remoteUri']=_0x298ee0[_0x8e9e('0x4')]||'';this['serverUrl']=_0x298ee0[_0x8e9e('0x5')]||'';this[_0x8e9e('0x6')]=_0x298ee0[_0x8e9e('0x6')]||{};}module['exports']=FreshsalesAccount;
\ No newline at end of file
+var _0x9a14=['name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x29de96,_0x42cc38){var _0x1b9352=function(_0x4a288a){while(--_0x4a288a){_0x29de96['push'](_0x29de96['shift']());}};_0x1b9352(++_0x42cc38);}(_0x9a14,0xa8));var _0x49a1=function(_0x3ca5dc,_0x3e5c12){_0x3ca5dc=_0x3ca5dc-0x0;var _0x4d3b89=_0x9a14[_0x3ca5dc];return _0x4d3b89;};'use strict';function FreshsalesAccount(_0x1d4a28){this['id']=_0x1d4a28['id']||0x0;this['name']=_0x1d4a28[_0x49a1('0x0')]||'';this[_0x49a1('0x1')]=_0x1d4a28[_0x49a1('0x1')]||'';this[_0x49a1('0x2')]=_0x1d4a28[_0x49a1('0x3')]||'';this[_0x49a1('0x4')]=_0x1d4a28[_0x49a1('0x4')]||'';this[_0x49a1('0x5')]=_0x1d4a28['serverUrl']||'';this['Configurations']=_0x1d4a28['Configurations']||{};}module['exports']=FreshsalesAccount;
\ No newline at end of file
index 31b17ff..88da915 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfdc8=['exten','priority','holdtime','assigned','lastAssignedTo','motionChannel','voice','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','connectedlinename','accountcode','context'];(function(_0x17068e,_0x115480){var _0xa24249=function(_0x49bcac){while(--_0x49bcac){_0x17068e['push'](_0x17068e['shift']());}};_0xa24249(++_0x115480);}(_0xfdc8,0x13e));var _0x8fdc=function(_0x171fdc,_0x16ae91){_0x171fdc=_0x171fdc-0x0;var _0x3782ea=_0xfdc8[_0x171fdc];return _0x3782ea;};'use strict';function QueueReport(){this[_0x8fdc('0x0')]=_0x8fdc('0x1');this[_0x8fdc('0x2')]='';this[_0x8fdc('0x3')]='';this[_0x8fdc('0x4')]='';this['queue']='';this[_0x8fdc('0x5')]=null;this[_0x8fdc('0x6')]=null;this[_0x8fdc('0x7')]=0x1;this[_0x8fdc('0x8')]=0x1;this[_0x8fdc('0x9')]=![];this[_0x8fdc('0xa')]=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this[_0x8fdc('0xb')]=![];this[_0x8fdc('0xc')]=null;this['originalposition']=0x1;this[_0x8fdc('0xd')]='';this[_0x8fdc('0xe')]='';this[_0x8fdc('0xf')]='';this[_0x8fdc('0x10')]='';this[_0x8fdc('0x11')]='';this[_0x8fdc('0x12')]='';this[_0x8fdc('0x13')]='';this[_0x8fdc('0x14')]=0x0;this[_0x8fdc('0x15')]=![];this[_0x8fdc('0x16')]='';this[_0x8fdc('0x17')]=_0x8fdc('0x18');this[_0x8fdc('0x19')]=0x0;this[_0x8fdc('0x1a')]={};}module[_0x8fdc('0x1b')]=QueueReport;
\ No newline at end of file
+var _0xafd7=['context','exten','priority','holdtime','assigned','motionChannel','voice','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode'];(function(_0x2d4065,_0x38dc95){var _0xef6016=function(_0x195cee){while(--_0x195cee){_0x2d4065['push'](_0x2d4065['shift']());}};_0xef6016(++_0x38dc95);}(_0xafd7,0x1bd));var _0x7afd=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xafd7[_0x4a9fb1];return _0x348672;};'use strict';function QueueReport(){this[_0x7afd('0x0')]=_0x7afd('0x1');this[_0x7afd('0x2')]='';this[_0x7afd('0x3')]='';this[_0x7afd('0x4')]='';this[_0x7afd('0x5')]='';this[_0x7afd('0x6')]=null;this[_0x7afd('0x7')]=null;this[_0x7afd('0x8')]=0x1;this['count']=0x1;this[_0x7afd('0x9')]=![];this[_0x7afd('0xa')]=null;this[_0x7afd('0xb')]=![];this[_0x7afd('0xc')]=null;this['queuecallerexit']=![];this[_0x7afd('0xd')]=null;this[_0x7afd('0xe')]=0x1;this[_0x7afd('0xf')]='';this[_0x7afd('0x10')]='';this[_0x7afd('0x11')]='';this[_0x7afd('0x12')]='';this[_0x7afd('0x13')]='';this[_0x7afd('0x14')]='';this[_0x7afd('0x15')]='';this[_0x7afd('0x16')]=0x0;this[_0x7afd('0x17')]=![];this['lastAssignedTo']='';this[_0x7afd('0x18')]=_0x7afd('0x19');this[_0x7afd('0x1a')]=0x0;this[_0x7afd('0x1b')]={};}module[_0x7afd('0x1c')]=QueueReport;
\ No newline at end of file
index c405d2f..6245871 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x69d4=['Configurations','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl'];(function(_0x64a57c,_0x4179f0){var _0x33e84e=function(_0x242c49){while(--_0x242c49){_0x64a57c['push'](_0x64a57c['shift']());}};_0x33e84e(++_0x4179f0);}(_0x69d4,0x83));var _0x469d=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x69d4[_0x49b207];return _0x2dc8fa;};'use strict';function SalesforceAccount(_0x59afa3){this['id']=_0x59afa3['id']||0x0;this[_0x469d('0x0')]=_0x59afa3['name']||'';this[_0x469d('0x1')]=_0x59afa3[_0x469d('0x1')]||'';this[_0x469d('0x2')]=_0x59afa3['remoteUri']||'';this[_0x469d('0x3')]=_0x59afa3['password']||'';this[_0x469d('0x4')]=_0x59afa3[_0x469d('0x4')]||'';this[_0x469d('0x5')]=_0x59afa3[_0x469d('0x5')]||'';this[_0x469d('0x6')]=_0x59afa3[_0x469d('0x6')]||'';this['type']=_0x59afa3[_0x469d('0x7')]||'integrationTab';this[_0x469d('0x8')]=_0x59afa3[_0x469d('0x8')]||'';this[_0x469d('0x9')]=_0x59afa3['Configurations']||{};}module['exports']=SalesforceAccount;
\ No newline at end of file
+var _0x3713=['password','clientId','clientSecret','securityToken','type','integrationTab','Configurations','exports','name','username','remoteUri'];(function(_0x6f25cf,_0x390699){var _0x11145c=function(_0x2a0a27){while(--_0x2a0a27){_0x6f25cf['push'](_0x6f25cf['shift']());}};_0x11145c(++_0x390699);}(_0x3713,0xa2));var _0x3371=function(_0x308a49,_0x522c88){_0x308a49=_0x308a49-0x0;var _0x48a495=_0x3713[_0x308a49];return _0x48a495;};'use strict';function SalesforceAccount(_0x47ef96){this['id']=_0x47ef96['id']||0x0;this[_0x3371('0x0')]=_0x47ef96[_0x3371('0x0')]||'';this[_0x3371('0x1')]=_0x47ef96[_0x3371('0x1')]||'';this[_0x3371('0x2')]=_0x47ef96['remoteUri']||'';this[_0x3371('0x3')]=_0x47ef96[_0x3371('0x3')]||'';this[_0x3371('0x4')]=_0x47ef96[_0x3371('0x4')]||'';this['clientSecret']=_0x47ef96[_0x3371('0x5')]||'';this[_0x3371('0x6')]=_0x47ef96[_0x3371('0x6')]||'';this[_0x3371('0x7')]=_0x47ef96[_0x3371('0x7')]||_0x3371('0x8');this['serverUrl']=_0x47ef96['serverUrl']||'';this[_0x3371('0x9')]=_0x47ef96['Configurations']||{};}module[_0x3371('0xa')]=SalesforceAccount;
\ No newline at end of file
index 97495a1..1587d76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2152=['name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x1d4eed,_0x4922b2){var _0x10911b=function(_0x5422ab){while(--_0x5422ab){_0x1d4eed['push'](_0x1d4eed['shift']());}};_0x10911b(++_0x4922b2);}(_0x2152,0x90));var _0x2215=function(_0xe23dc9,_0x55b7e7){_0xe23dc9=_0xe23dc9-0x0;var _0x2fd74d=_0x2152[_0xe23dc9];return _0x2fd74d;};'use strict';function ServicenowAccount(_0x106f25){this['id']=_0x106f25['id']||0x0;this[_0x2215('0x0')]=_0x106f25['name']||'';this[_0x2215('0x1')]=_0x106f25[_0x2215('0x1')]||'';this['password']=_0x106f25[_0x2215('0x2')]||'';this[_0x2215('0x3')]=_0x106f25[_0x2215('0x3')]||'';this[_0x2215('0x4')]=_0x106f25[_0x2215('0x4')]||'';this[_0x2215('0x5')]=_0x106f25['Configurations']||{};}module['exports']=ServicenowAccount;
\ No newline at end of file
+var _0xf681=['name','password','remoteUri','serverUrl','Configurations'];(function(_0x52ddf2,_0x2ff25f){var _0x2dce61=function(_0x2d1831){while(--_0x2d1831){_0x52ddf2['push'](_0x52ddf2['shift']());}};_0x2dce61(++_0x2ff25f);}(_0xf681,0xaf));var _0x1f68=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf681[_0xa464c9];return _0x3d73c4;};'use strict';function ServicenowAccount(_0x3993b3){this['id']=_0x3993b3['id']||0x0;this[_0x1f68('0x0')]=_0x3993b3['name']||'';this['username']=_0x3993b3['username']||'';this[_0x1f68('0x1')]=_0x3993b3[_0x1f68('0x1')]||'';this[_0x1f68('0x2')]=_0x3993b3['remoteUri']||'';this[_0x1f68('0x3')]=_0x3993b3[_0x1f68('0x3')]||'';this['Configurations']=_0x3993b3[_0x1f68('0x4')]||{};}module['exports']=ServicenowAccount;
\ No newline at end of file
index e1f81be..6219930 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bfa=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x4bfa,0x172));var _0xa4bf=function(_0x221332,_0x5c0307){_0x221332=_0x221332-0x0;var _0x281621=_0x4bfa[_0x221332];return _0x281621;};'use strict';function SugarcrmAccount(_0x5f19a7){this['id']=_0x5f19a7['id']||0x0;this[_0xa4bf('0x0')]=_0x5f19a7[_0xa4bf('0x0')]||'';this[_0xa4bf('0x1')]=_0x5f19a7[_0xa4bf('0x1')]||'';this['password']=_0x5f19a7[_0xa4bf('0x2')]||'';this[_0xa4bf('0x3')]=_0x5f19a7['remoteUri']||'';this['serverUrl']=_0x5f19a7[_0xa4bf('0x4')]||'';this['Configurations']=_0x5f19a7[_0xa4bf('0x5')]||{};}module[_0xa4bf('0x6')]=SugarcrmAccount;
\ No newline at end of file
+var _0x1550=['Configurations','exports','name','username','password','remoteUri'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1550,0x170));var _0x0155=function(_0x23f526,_0x73a21e){_0x23f526=_0x23f526-0x0;var _0xe289ab=_0x1550[_0x23f526];return _0xe289ab;};'use strict';function SugarcrmAccount(_0x1bf52d){this['id']=_0x1bf52d['id']||0x0;this[_0x0155('0x0')]=_0x1bf52d[_0x0155('0x0')]||'';this[_0x0155('0x1')]=_0x1bf52d[_0x0155('0x1')]||'';this[_0x0155('0x2')]=_0x1bf52d[_0x0155('0x2')]||'';this['remoteUri']=_0x1bf52d[_0x0155('0x3')]||'';this['serverUrl']=_0x1bf52d['serverUrl']||'';this[_0x0155('0x4')]=_0x1bf52d[_0x0155('0x4')]||{};}module[_0x0155('0x5')]=SugarcrmAccount;
\ No newline at end of file
index 22a826c..bd77d36 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2724=['name','accountcode','state','stateTime','status','unknown','address','exports'];(function(_0x1f5027,_0x523274){var _0xb775c0=function(_0x2ee038){while(--_0x2ee038){_0x1f5027['push'](_0x1f5027['shift']());}};_0xb775c0(++_0x523274);}(_0x2724,0xa8));var _0x4272=function(_0x56c7c2,_0x2a9c04){_0x56c7c2=_0x56c7c2-0x0;var _0x378358=_0x2724[_0x56c7c2];return _0x378358;};'use strict';function Telephone(_0x3ddafe){this['id']=_0x3ddafe['id']||0x0;this[_0x4272('0x0')]=_0x3ddafe['name']||'';this[_0x4272('0x1')]=_0x3ddafe['accountcode']||'';this[_0x4272('0x2')]='unknown';this[_0x4272('0x3')]=0x0;this[_0x4272('0x4')]=_0x4272('0x5');this[_0x4272('0x6')]='';}module[_0x4272('0x7')]=Telephone;
\ No newline at end of file
+var _0x8e44=['exports','name','state','unknown','stateTime','status','address'];(function(_0x10067f,_0x308021){var _0x59e395=function(_0x1d5f91){while(--_0x1d5f91){_0x10067f['push'](_0x10067f['shift']());}};_0x59e395(++_0x308021);}(_0x8e44,0x1ac));var _0x48e4=function(_0x572473,_0x43edff){_0x572473=_0x572473-0x0;var _0x2bc49d=_0x8e44[_0x572473];return _0x2bc49d;};'use strict';function Telephone(_0x21fbc7){this['id']=_0x21fbc7['id']||0x0;this[_0x48e4('0x0')]=_0x21fbc7[_0x48e4('0x0')]||'';this['accountcode']=_0x21fbc7['accountcode']||'';this[_0x48e4('0x1')]=_0x48e4('0x2');this[_0x48e4('0x3')]=0x0;this[_0x48e4('0x4')]='unknown';this[_0x48e4('0x5')]='';}module[_0x48e4('0x6')]=Telephone;
\ No newline at end of file
index b11b2c1..2e85bdc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['exports','name'];(function(_0x163142,_0x4d1a1c){var _0x3017e7=function(_0x2697db){while(--_0x2697db){_0x163142['push'](_0x163142['shift']());}};_0x3017e7(++_0x4d1a1c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template;
\ No newline at end of file
+var _0xa9e0=['exports','name'];(function(_0x245426,_0x48b9e5){var _0x43ee14=function(_0x1c2630){while(--_0x1c2630){_0x245426['push'](_0x245426['shift']());}};_0x43ee14(++_0x48b9e5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template;
\ No newline at end of file
index a253720..5b151a6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4fc2=['name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x32fed9,_0x5b94c7){var _0x11cd7f=function(_0x2b2654){while(--_0x2b2654){_0x32fed9['push'](_0x32fed9['shift']());}};_0x11cd7f(++_0x5b94c7);}(_0x4fc2,0x111));var _0x24fc=function(_0x443547,_0x21d7a8){_0x443547=_0x443547-0x0;var _0x1423a8=_0x4fc2[_0x443547];return _0x1423a8;};'use strict';function Trigger(_0x5ea3ab){this['id']=_0x5ea3ab['id']||0x0;this[_0x24fc('0x0')]=_0x5ea3ab[_0x24fc('0x0')]||'';this[_0x24fc('0x1')]=_0x5ea3ab['channel']||_0x24fc('0x2');this[_0x24fc('0x3')]=_0x5ea3ab[_0x24fc('0x3')]||![];this['AllConditions']=_0x5ea3ab[_0x24fc('0x4')]||[];this[_0x24fc('0x5')]=_0x5ea3ab['AnyConditions']||[];this[_0x24fc('0x6')]=_0x5ea3ab[_0x24fc('0x6')]||[];}module['exports']=Trigger;
\ No newline at end of file
+var _0x2032=['exports','name','channel','voice','status','AllConditions','AnyConditions','Actions'];(function(_0x43d64e,_0x2a537a){var _0x550ae8=function(_0x1cf4ec){while(--_0x1cf4ec){_0x43d64e['push'](_0x43d64e['shift']());}};_0x550ae8(++_0x2a537a);}(_0x2032,0xd9));var _0x2203=function(_0x3e2ada,_0x1eb5ca){_0x3e2ada=_0x3e2ada-0x0;var _0x4149ee=_0x2032[_0x3e2ada];return _0x4149ee;};'use strict';function Trigger(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['channel']||_0x2203('0x2');this[_0x2203('0x3')]=_0x4d6c97['status']||![];this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||[];this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||[];this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||[];}module[_0x2203('0x7')]=Trigger;
\ No newline at end of file
index 31fd3c6..f77b9b7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf3f0=['stateRegistry','registrationtime','address','defaultuser','exports','active','name','state','unknown','status','registry','indexOf','split','host','domain','domainport','refresh'];(function(_0x3a2d4e,_0x339dd6){var _0x3085af=function(_0x45d954){while(--_0x45d954){_0x3a2d4e['push'](_0x3a2d4e['shift']());}};_0x3085af(++_0x339dd6);}(_0xf3f0,0xc0));var _0x0f3f=function(_0x23c6c5,_0x5c41a1){_0x23c6c5=_0x23c6c5-0x0;var _0x4b80d9=_0xf3f0[_0x23c6c5];return _0x4b80d9;};'use strict';function Trunk(_0x145fda){this['id']=_0x145fda['id']||0x0;this[_0x0f3f('0x0')]=_0x145fda[_0x0f3f('0x0')]||![];this[_0x0f3f('0x1')]=_0x145fda[_0x0f3f('0x1')]||'';this[_0x0f3f('0x2')]=_0x0f3f('0x3');this['stateTime']=0x0;this[_0x0f3f('0x4')]=_0x0f3f('0x3');this[_0x0f3f('0x5')]=_0x145fda[_0x0f3f('0x5')]&&_0x145fda['registry'][_0x0f3f('0x6')](':')?_0x145fda[_0x0f3f('0x5')][_0x0f3f('0x7')](':')[0x0]:'';this[_0x0f3f('0x8')]='';this['port']='';this[_0x0f3f('0x9')]='';this[_0x0f3f('0xa')]='';this[_0x0f3f('0xb')]='';this[_0x0f3f('0xc')]=_0x0f3f('0x3');this[_0x0f3f('0xd')]='';this[_0x0f3f('0xe')]='';this[_0x0f3f('0xf')]=_0x145fda[_0x0f3f('0xf')]||'';}module[_0x0f3f('0x10')]=Trunk;
\ No newline at end of file
+var _0xd278=['address','defaultuser','exports','active','name','unknown','registry','port','domainport','refresh','stateRegistry'];(function(_0x31ef44,_0x3741ab){var _0x110a80=function(_0x11c2fb){while(--_0x11c2fb){_0x31ef44['push'](_0x31ef44['shift']());}};_0x110a80(++_0x3741ab);}(_0xd278,0x179));var _0x8d27=function(_0x4a5b7f,_0xc83244){_0x4a5b7f=_0x4a5b7f-0x0;var _0x4a7959=_0xd278[_0x4a5b7f];return _0x4a7959;};'use strict';function Trunk(_0x16cb20){this['id']=_0x16cb20['id']||0x0;this[_0x8d27('0x0')]=_0x16cb20[_0x8d27('0x0')]||![];this['name']=_0x16cb20[_0x8d27('0x1')]||'';this['state']='unknown';this['stateTime']=0x0;this['status']=_0x8d27('0x2');this[_0x8d27('0x3')]=_0x16cb20[_0x8d27('0x3')]&&_0x16cb20[_0x8d27('0x3')]['indexOf'](':')?_0x16cb20[_0x8d27('0x3')]['split'](':')[0x0]:'';this['host']='';this[_0x8d27('0x4')]='';this['domain']='';this[_0x8d27('0x5')]='';this[_0x8d27('0x6')]='';this[_0x8d27('0x7')]=_0x8d27('0x2');this['registrationtime']='';this[_0x8d27('0x8')]='';this[_0x8d27('0x9')]=_0x16cb20[_0x8d27('0x9')]||'';}module[_0x8d27('0xa')]=Trunk;
\ No newline at end of file
index d0ad7fe..b52ae1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb03=['exten','recordingFormat','none','mandatoryDisposition'];(function(_0x1d418a,_0x30d642){var _0x256f72=function(_0x2911d4){while(--_0x2911d4){_0x1d418a['push'](_0x1d418a['shift']());}};_0x256f72(++_0x30d642);}(_0xbb03,0xec));var _0x3bb0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xbb03[_0x321bb2];return _0x9c12ed;};'use strict';function voiceExtension(_0x30f586){this['id']=_0x30f586['id']||0x0;this[_0x3bb0('0x0')]=_0x30f586[_0x3bb0('0x0')]||'';this[_0x3bb0('0x1')]=_0x30f586[_0x3bb0('0x1')]||_0x3bb0('0x2');this['mandatoryDisposition']=_0x30f586[_0x3bb0('0x3')]||![];}module['exports']=voiceExtension;
\ No newline at end of file
+var _0x4c86=['recordingFormat','exports','exten'];(function(_0x2fd064,_0x10f8ab){var _0x1b0168=function(_0x4fee0e){while(--_0x4fee0e){_0x2fd064['push'](_0x2fd064['shift']());}};_0x1b0168(++_0x10f8ab);}(_0x4c86,0x161));var _0x64c8=function(_0xb228c7,_0x17c4e3){_0xb228c7=_0xb228c7-0x0;var _0x1ec18f=_0x4c86[_0xb228c7];return _0x1ec18f;};'use strict';function voiceExtension(_0x564562){this['id']=_0x564562['id']||0x0;this[_0x64c8('0x0')]=_0x564562[_0x64c8('0x0')]||'';this[_0x64c8('0x1')]=_0x564562['recordingFormat']||'none';this['mandatoryDisposition']=_0x564562['mandatoryDisposition']||![];}module[_0x64c8('0x2')]=voiceExtension;
\ No newline at end of file
index 5552cf9..b597254 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9a0a=['unknown','not_inuse','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','talking','answered','sumDuration','sumHoldTime','sumBillable','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundReCallsDay','outboundAbandonedDay','startProgressive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports'];(function(_0x15d18f,_0x126b0e){var _0xd12bf7=function(_0x19e661){while(--_0x19e661){_0x15d18f['push'](_0x15d18f['shift']());}};_0xd12bf7(++_0x126b0e);}(_0x9a0a,0x7c));var _0xa9a0=function(_0x36f002,_0x4a0869){_0x36f002=_0x36f002-0x0;var _0x25e84e=_0x9a0a[_0x36f002];return _0x25e84e;};'use strict';var statusDesc=[_0xa9a0('0x0'),_0xa9a0('0x1'),_0xa9a0('0x2'),_0xa9a0('0x3'),_0xa9a0('0x4'),_0xa9a0('0x5'),_0xa9a0('0x6'),_0xa9a0('0x7'),_0xa9a0('0x8')];var monitorFormat={'wav':'wav','wav49':_0xa9a0('0x9'),'gsm':_0xa9a0('0xa')};var strategy={'rrmemory':_0xa9a0('0xb'),'roundrobin':_0xa9a0('0xc')};function VoiceQueue(_0x1357ea){this['id']=_0x1357ea['id']||0x0;this[_0xa9a0('0xd')]=_0x1357ea['name']||'';this[_0xa9a0('0xe')]=_0x1357ea[_0xa9a0('0xe')]||'';this[_0xa9a0('0xf')]=_0x1357ea[_0xa9a0('0xf')]||_0xa9a0('0x10');this['waiting']=0x0;this[_0xa9a0('0x11')]=0x0;this['total']=0x0;this[_0xa9a0('0x12')]=0x0;this[_0xa9a0('0x13')]=0x0;this[_0xa9a0('0x14')]=0x0;this[_0xa9a0('0x15')]=0x0;this['unmanaged']=0x0;this[_0xa9a0('0x16')]=0x0;this[_0xa9a0('0x17')]=0x0;this[_0xa9a0('0x18')]=0x0;this[_0xa9a0('0x19')]=_0x1357ea[_0xa9a0('0x19')]||![];this[_0xa9a0('0x1a')]=_0x1357ea[_0xa9a0('0x1a')]||0xa;this['autopause']=_0x1357ea[_0xa9a0('0x1b')]||'no';this[_0xa9a0('0x1c')]=!![];this[_0xa9a0('0x1d')]='';this[_0xa9a0('0x1e')]=0x0;this[_0xa9a0('0x1f')]=0x0;this[_0xa9a0('0x20')]=_0x1357ea[_0xa9a0('0x20')]||null;this[_0xa9a0('0x21')]=_0x1357ea[_0xa9a0('0x21')]?_0x1357ea[_0xa9a0('0x21')]:null;this['dialActive']=_0x1357ea[_0xa9a0('0x22')];this['dialMethod']=_0x1357ea[_0xa9a0('0x23')]||_0xa9a0('0x24');this[_0xa9a0('0x25')]=_0x1357ea[_0xa9a0('0x25')]||0x0;this[_0xa9a0('0x26')]=_0x1357ea[_0xa9a0('0x26')]||0x0;this[_0xa9a0('0x27')]=_0x1357ea['dialPowerLevel']||0x1;this[_0xa9a0('0x28')]=_0x1357ea[_0xa9a0('0x28')]||'dropRate';this[_0xa9a0('0x29')]=_0x1357ea['dialPredictiveOptimizationPercentage']||0.03;this[_0xa9a0('0x2a')]=_0x1357ea[_0xa9a0('0x2a')]||0x258;this['dialOriginateCallerIdName']=_0x1357ea[_0xa9a0('0x2b')]||_0xa9a0('0x2c');this[_0xa9a0('0x2d')]=_0x1357ea[_0xa9a0('0x2d')]||_0xa9a0('0x2c');this['dialOriginateTimeout']=_0x1357ea['dialOriginateTimeout']||0x1e;this[_0xa9a0('0x2e')]=_0x1357ea[_0xa9a0('0x2e')]||_0xa9a0('0x2f');this[_0xa9a0('0x30')]=_0x1357ea[_0xa9a0('0x30')]||0x3;this[_0xa9a0('0x31')]=_0x1357ea[_0xa9a0('0x31')]||undefined;this[_0xa9a0('0x32')]=_0x1357ea[_0xa9a0('0x32')]||0x3;this[_0xa9a0('0x33')]=_0x1357ea[_0xa9a0('0x33')]||0x96;this[_0xa9a0('0x34')]=_0x1357ea[_0xa9a0('0x34')]||0x3;this[_0xa9a0('0x35')]=_0x1357ea[_0xa9a0('0x35')]||0x96;this[_0xa9a0('0x36')]=_0x1357ea[_0xa9a0('0x36')]||0x3;this[_0xa9a0('0x37')]=_0x1357ea[_0xa9a0('0x37')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x1357ea[_0xa9a0('0x38')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x1357ea[_0xa9a0('0x39')]||0x96;this[_0xa9a0('0x3a')]=_0x1357ea[_0xa9a0('0x3a')]||0x3;this[_0xa9a0('0x3b')]=_0x1357ea[_0xa9a0('0x3b')]||0x96;this[_0xa9a0('0x3c')]=_0x1357ea[_0xa9a0('0x3c')]||0x3;this[_0xa9a0('0x3d')]=_0x1357ea[_0xa9a0('0x3d')]||0x96;this[_0xa9a0('0x3e')]=_0x1357ea[_0xa9a0('0x3e')]||0x3;this[_0xa9a0('0x3f')]=_0x1357ea['dialMachineRetryFrequency']||0x96;this[_0xa9a0('0x40')]=_0x1357ea[_0xa9a0('0x40')]||0x3;this['dialAgentRejectRetryFrequency']=_0x1357ea['dialAgentRejectRetryFrequency']||0x96;this[_0xa9a0('0x41')]=_0x1357ea[_0xa9a0('0x41')]||0x4;this[_0xa9a0('0x42')]=_0x1357ea[_0xa9a0('0x42')]?_0x1357ea[_0xa9a0('0x42')]:undefined;this['TrunkBackup']=_0x1357ea[_0xa9a0('0x43')]?_0x1357ea[_0xa9a0('0x43')]:undefined;this[_0xa9a0('0x44')]=_0x1357ea[_0xa9a0('0x44')]||undefined;this[_0xa9a0('0x45')]=_0x1357ea['Interval']?_0x1357ea['Interval']:undefined;this[_0xa9a0('0x46')]=_0x1357ea['dialOrderByScheduledAt']||_0xa9a0('0x47');this['dialRandomLastDigitCallerIdNumber']=_0x1357ea[_0xa9a0('0x48')]||undefined;this[_0xa9a0('0x49')]=_0x1357ea[_0xa9a0('0x49')]||undefined;this['strategy']=strategy[_0x1357ea[_0xa9a0('0x4a')]]||_0xa9a0('0xb');this[_0xa9a0('0x4b')]=!![];this[_0xa9a0('0x4c')]=_0x1357ea[_0xa9a0('0x4c')]||![];this['dialAMDInitialSilence']=_0x1357ea[_0xa9a0('0x4d')];this[_0xa9a0('0x4e')]=_0x1357ea[_0xa9a0('0x4e')];this['dialAMDAfterGreetingSilence']=_0x1357ea['dialAMDAfterGreetingSilence'];this[_0xa9a0('0x4f')]=_0x1357ea[_0xa9a0('0x4f')];this['dialAMDMinWordLength']=_0x1357ea['dialAMDMinWordLength'];this[_0xa9a0('0x50')]=_0x1357ea[_0xa9a0('0x50')];this[_0xa9a0('0x51')]=_0x1357ea[_0xa9a0('0x51')];this[_0xa9a0('0x52')]=_0x1357ea[_0xa9a0('0x52')];this[_0xa9a0('0x53')]=_0x1357ea[_0xa9a0('0x53')];this[_0xa9a0('0x54')]=0x0;this['pTalking']=0x0;this[_0xa9a0('0x55')]=_0x1357ea[_0xa9a0('0x55')];this[_0xa9a0('0x56')]=0x0;this[_0xa9a0('0x57')]=0x0;this[_0xa9a0('0x58')]=0x0;this[_0xa9a0('0x59')]=0x0;this[_0xa9a0('0x5a')]=0x0;this[_0xa9a0('0x5b')]=0x0;this[_0xa9a0('0x5c')]=0x0;this[_0xa9a0('0x5d')]=0x0;this[_0xa9a0('0x5e')]=0x0;this[_0xa9a0('0x5f')]=0x0;this[_0xa9a0('0x60')]=0x0;this['outboundDropCallsDayACS']=0x0;this[_0xa9a0('0x61')]=0x0;this[_0xa9a0('0x62')]=0x0;this[_0xa9a0('0x63')]=undefined;this['startPredictive']=undefined;this[_0xa9a0('0x64')]=undefined;this[_0xa9a0('0x65')]=1.05;this[_0xa9a0('0x66')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this[_0xa9a0('0x67')]=0x0;this[_0xa9a0('0x68')]=0x0;this[_0xa9a0('0x69')]=0x0;this[_0xa9a0('0x6a')]=0x0;this[_0xa9a0('0x6b')]=0x0;this[_0xa9a0('0x6c')]=_0x1357ea[_0xa9a0('0x6d')]||0x14;this[_0xa9a0('0x6e')]=_0x1357ea['dialPredictiveIntervalMaxThreshold']||0xa;this[_0xa9a0('0x6f')]=0x0;this[_0xa9a0('0x70')]=0x0;this[_0xa9a0('0x71')]=0x1;this[_0xa9a0('0x72')]=0x0;this[_0xa9a0('0x73')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xa9a0('0x74')]=0x0;this['dialRecallMeTimeout']=_0x1357ea['dialRecallMeTimeout']||0x1e;this[_0xa9a0('0x75')]=_0x1357ea[_0xa9a0('0x75')]||![];this['dialQueueProject2']=_0x1357ea[_0xa9a0('0x76')]||undefined;this['dialAgiAfterHangupClient']=_0x1357ea[_0xa9a0('0x77')]||![];this[_0xa9a0('0x78')]=_0x1357ea[_0xa9a0('0x78')]||![];this[_0xa9a0('0xe')]=monitorFormat[_0x1357ea['monitor_format']]?monitorFormat[_0x1357ea[_0xa9a0('0xe')]]:undefined;this[_0xa9a0('0x79')]=_0x1357ea[_0xa9a0('0x79')]||![];this['mandatoryDispositionPause']=_0x1357ea[_0xa9a0('0x7a')]?_0x1357ea[_0xa9a0('0x7a')]:undefined;}module[_0xa9a0('0x7b')]=VoiceQueue;
\ No newline at end of file
+var _0x83a7=['dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayCallersExit','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','unknown','not_inuse','invalid','unavailable','ringing','wav','wav49','gsm','roundrobin','name','monitor_format','inbound','waiting','total','sumBillable','abandoned','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords'];(function(_0xc6e150,_0x119453){var _0x859eb4=function(_0x2cafbe){while(--_0x2cafbe){_0xc6e150['push'](_0xc6e150['shift']());}};_0x859eb4(++_0x119453);}(_0x83a7,0x1f2));var _0x783a=function(_0x14e937,_0x2dbe0f){_0x14e937=_0x14e937-0x0;var _0x5b6faa=_0x83a7[_0x14e937];return _0x5b6faa;};'use strict';var statusDesc=[_0x783a('0x0'),_0x783a('0x1'),'inuse','busy',_0x783a('0x2'),_0x783a('0x3'),_0x783a('0x4'),'ringinuse','onhold'];var monitorFormat={'wav':_0x783a('0x5'),'wav49':_0x783a('0x6'),'gsm':_0x783a('0x7')};var strategy={'rrmemory':'rrmemory','roundrobin':_0x783a('0x8')};function VoiceQueue(_0x103273){this['id']=_0x103273['id']||0x0;this['name']=_0x103273[_0x783a('0x9')]||'';this['monitor_format']=_0x103273[_0x783a('0xa')]||'';this['type']=_0x103273['type']||_0x783a('0xb');this[_0x783a('0xc')]=0x0;this['talking']=0x0;this[_0x783a('0xd')]=0x0;this['answered']=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this[_0x783a('0xe')]=0x0;this['unmanaged']=0x0;this[_0x783a('0xf')]=0x0;this[_0x783a('0x10')]=0x0;this[_0x783a('0x11')]=0x0;this['acw']=_0x103273[_0x783a('0x12')]||![];this[_0x783a('0x13')]=_0x103273[_0x783a('0x13')]||0xa;this['autopause']=_0x103273[_0x783a('0x14')]||'no';this[_0x783a('0x15')]=!![];this[_0x783a('0x16')]='';this[_0x783a('0x17')]=0x0;this['temp']=0x0;this[_0x783a('0x18')]=_0x103273[_0x783a('0x18')]||null;this[_0x783a('0x19')]=_0x103273[_0x783a('0x19')]?_0x103273[_0x783a('0x19')]:null;this['dialActive']=_0x103273['dialActive'];this[_0x783a('0x1a')]=_0x103273[_0x783a('0x1a')]||_0x783a('0x1b');this[_0x783a('0x1c')]=_0x103273[_0x783a('0x1c')]||0x0;this[_0x783a('0x1d')]=_0x103273[_0x783a('0x1d')]||0x0;this[_0x783a('0x1e')]=_0x103273[_0x783a('0x1e')]||0x1;this[_0x783a('0x1f')]=_0x103273[_0x783a('0x1f')]||'dropRate';this[_0x783a('0x20')]=_0x103273['dialPredictiveOptimizationPercentage']||0.03;this[_0x783a('0x21')]=_0x103273[_0x783a('0x21')]||0x258;this[_0x783a('0x22')]=_0x103273['dialOriginateCallerIdName']||_0x783a('0x23');this[_0x783a('0x24')]=_0x103273[_0x783a('0x24')]||_0x783a('0x23');this[_0x783a('0x25')]=_0x103273[_0x783a('0x25')]||0x1e;this[_0x783a('0x26')]=_0x103273[_0x783a('0x26')]||_0x783a('0x27');this[_0x783a('0x28')]=_0x103273[_0x783a('0x28')]||0x3;this[_0x783a('0x29')]=_0x103273[_0x783a('0x29')]||undefined;this[_0x783a('0x2a')]=_0x103273['dialCongestionMaxRetry']||0x3;this[_0x783a('0x2b')]=_0x103273['dialCongestionRetryFrequency']||0x96;this['dialBusyMaxRetry']=_0x103273[_0x783a('0x2c')]||0x3;this[_0x783a('0x2d')]=_0x103273[_0x783a('0x2d')]||0x96;this[_0x783a('0x2e')]=_0x103273['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x103273[_0x783a('0x2f')]||0x96;this[_0x783a('0x30')]=_0x103273[_0x783a('0x30')]||0x3;this[_0x783a('0x31')]=_0x103273[_0x783a('0x31')]||0x96;this[_0x783a('0x32')]=_0x103273['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0x103273[_0x783a('0x33')]||0x96;this[_0x783a('0x34')]=_0x103273[_0x783a('0x34')]||0x3;this[_0x783a('0x35')]=_0x103273[_0x783a('0x35')]||0x96;this[_0x783a('0x36')]=_0x103273['dialMachineMaxRetry']||0x3;this[_0x783a('0x37')]=_0x103273[_0x783a('0x37')]||0x96;this[_0x783a('0x38')]=_0x103273[_0x783a('0x38')]||0x3;this[_0x783a('0x39')]=_0x103273[_0x783a('0x39')]||0x96;this[_0x783a('0x3a')]=_0x103273[_0x783a('0x3a')]||0x4;this[_0x783a('0x3b')]=_0x103273[_0x783a('0x3b')]?_0x103273[_0x783a('0x3b')]:undefined;this[_0x783a('0x3c')]=_0x103273['TrunkBackup']?_0x103273[_0x783a('0x3c')]:undefined;this[_0x783a('0x3d')]=_0x103273[_0x783a('0x3d')]||undefined;this[_0x783a('0x3e')]=_0x103273[_0x783a('0x3e')]?_0x103273['Interval']:undefined;this[_0x783a('0x3f')]=_0x103273['dialOrderByScheduledAt']||_0x783a('0x40');this[_0x783a('0x41')]=_0x103273['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x783a('0x42')]=_0x103273['dialCutDigit']||undefined;this[_0x783a('0x43')]=strategy[_0x103273[_0x783a('0x43')]]||_0x783a('0x44');this[_0x783a('0x45')]=!![];this[_0x783a('0x46')]=_0x103273[_0x783a('0x46')]||![];this[_0x783a('0x47')]=_0x103273[_0x783a('0x47')];this[_0x783a('0x48')]=_0x103273[_0x783a('0x48')];this[_0x783a('0x49')]=_0x103273['dialAMDAfterGreetingSilence'];this[_0x783a('0x4a')]=_0x103273['dialAMDTotalAnalysisTime'];this[_0x783a('0x4b')]=_0x103273[_0x783a('0x4b')];this['dialAMDBetweenWordsSilence']=_0x103273['dialAMDBetweenWordsSilence'];this[_0x783a('0x4c')]=_0x103273[_0x783a('0x4c')];this['dialAMDSilenceThreshold']=_0x103273[_0x783a('0x4d')];this[_0x783a('0x4e')]=_0x103273[_0x783a('0x4e')];this[_0x783a('0x4f')]=0x0;this['pTalking']=0x0;this[_0x783a('0x50')]=_0x103273[_0x783a('0x50')];this[_0x783a('0x51')]=0x0;this[_0x783a('0x52')]=0x0;this[_0x783a('0x53')]=0x0;this[_0x783a('0x54')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x783a('0x55')]=0x0;this[_0x783a('0x56')]=0x0;this['outboundBlacklistCallsDay']=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x783a('0x57')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this['outboundDropCallsDayACS']=0x0;this[_0x783a('0x58')]=0x0;this[_0x783a('0x59')]=0x0;this[_0x783a('0x5a')]=undefined;this[_0x783a('0x5b')]=undefined;this['handlePredictive']=undefined;this[_0x783a('0x5c')]=1.05;this[_0x783a('0x5d')]=0x0;this[_0x783a('0x5e')]=0x0;this[_0x783a('0x5f')]=0x0;this[_0x783a('0x60')]=0x0;this[_0x783a('0x61')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this[_0x783a('0x62')]=0x0;this[_0x783a('0x63')]=0x0;this[_0x783a('0x64')]=_0x103273[_0x783a('0x65')]||0x14;this[_0x783a('0x66')]=_0x103273[_0x783a('0x65')]||0xa;this[_0x783a('0x67')]=0x0;this[_0x783a('0x68')]=0x0;this['predictiveIntervalHitRate']=0x1;this[_0x783a('0x69')]=0x0;this[_0x783a('0x6a')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0x783a('0x6b')]=0x0;this[_0x783a('0x6c')]=_0x103273['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x103273[_0x783a('0x6d')]||![];this[_0x783a('0x6e')]=_0x103273[_0x783a('0x6e')]||undefined;this[_0x783a('0x6f')]=_0x103273['dialAgiAfterHangupClient']||![];this[_0x783a('0x70')]=_0x103273[_0x783a('0x70')]||![];this[_0x783a('0xa')]=monitorFormat[_0x103273[_0x783a('0xa')]]?monitorFormat[_0x103273[_0x783a('0xa')]]:undefined;this[_0x783a('0x71')]=_0x103273[_0x783a('0x71')]||![];this[_0x783a('0x72')]=_0x103273[_0x783a('0x72')]?_0x103273['mandatoryDispositionPause']:undefined;}module['exports']=VoiceQueue;
\ No newline at end of file
index c811f0a..2e22f4e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xae4f=['remoteUri','Configurations','exports','name','username','accessKey'];(function(_0xbfbbac,_0x27949e){var _0x3f55b6=function(_0x657769){while(--_0x657769){_0xbfbbac['push'](_0xbfbbac['shift']());}};_0x3f55b6(++_0x27949e);}(_0xae4f,0xd5));var _0xfae4=function(_0x36d402,_0x7d6a49){_0x36d402=_0x36d402-0x0;var _0x3064be=_0xae4f[_0x36d402];return _0x3064be;};'use strict';function VtigerAccount(_0x43d6a4){this['id']=_0x43d6a4['id']||0x0;this[_0xfae4('0x0')]=_0x43d6a4[_0xfae4('0x0')]||'';this[_0xfae4('0x1')]=_0x43d6a4['username']||'';this[_0xfae4('0x2')]=_0x43d6a4[_0xfae4('0x2')]||'';this[_0xfae4('0x3')]=_0x43d6a4['remoteUri']||'';this['serverUrl']=_0x43d6a4['serverUrl']||'';this[_0xfae4('0x4')]=_0x43d6a4[_0xfae4('0x4')]||{};}module[_0xfae4('0x5')]=VtigerAccount;
\ No newline at end of file
+var _0xb393=['name','username','accessKey','remoteUri','serverUrl','exports'];(function(_0x3de177,_0x297e3a){var _0x79c1cc=function(_0x16cb1d){while(--_0x16cb1d){_0x3de177['push'](_0x3de177['shift']());}};_0x79c1cc(++_0x297e3a);}(_0xb393,0x78));var _0x3b39=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb393[_0x3dd15e];return _0x231fd0;};'use strict';function VtigerAccount(_0x1e0aed){this['id']=_0x1e0aed['id']||0x0;this[_0x3b39('0x0')]=_0x1e0aed['name']||'';this[_0x3b39('0x1')]=_0x1e0aed[_0x3b39('0x1')]||'';this[_0x3b39('0x2')]=_0x1e0aed[_0x3b39('0x2')]||'';this[_0x3b39('0x3')]=_0x1e0aed[_0x3b39('0x3')]||'';this[_0x3b39('0x4')]=_0x1e0aed[_0x3b39('0x4')]||'';this['Configurations']=_0x1e0aed['Configurations']||{};}module[_0x3b39('0x5')]=VtigerAccount;
\ No newline at end of file
index 3db02dd..9ab49cf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd13e=['type','integrationTab','Configurations','exports','name','username','password','token','remoteUri','authType'];(function(_0x317f09,_0x38dcf2){var _0x350832=function(_0x36ad19){while(--_0x36ad19){_0x317f09['push'](_0x317f09['shift']());}};_0x350832(++_0x38dcf2);}(_0xd13e,0x18a));var _0xed13=function(_0x2fbfba,_0x107d2f){_0x2fbfba=_0x2fbfba-0x0;var _0x511287=_0xd13e[_0x2fbfba];return _0x511287;};'use strict';function ZendeskAccount(_0x5c2dc2){this['id']=_0x5c2dc2['id']||0x0;this[_0xed13('0x0')]=_0x5c2dc2[_0xed13('0x0')]||'';this['username']=_0x5c2dc2[_0xed13('0x1')]||'';this['password']=_0x5c2dc2[_0xed13('0x2')]||'';this[_0xed13('0x3')]=_0x5c2dc2[_0xed13('0x3')]||'';this[_0xed13('0x4')]=_0x5c2dc2['remoteUri']||'';this[_0xed13('0x5')]=_0x5c2dc2['authType']||'';this['type']=_0x5c2dc2[_0xed13('0x6')]||_0xed13('0x7');this['serverUrl']=_0x5c2dc2['serverUrl']||'';this[_0xed13('0x8')]=_0x5c2dc2[_0xed13('0x8')]||{};}module[_0xed13('0x9')]=ZendeskAccount;
\ No newline at end of file
+var _0xeb43=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name','username','password'];(function(_0x2b7627,_0x326fb8){var _0x3a2ba8=function(_0x2d7c0e){while(--_0x2d7c0e){_0x2b7627['push'](_0x2b7627['shift']());}};_0x3a2ba8(++_0x326fb8);}(_0xeb43,0xb8));var _0x3eb4=function(_0x39cc8f,_0xb60cd8){_0x39cc8f=_0x39cc8f-0x0;var _0x15e616=_0xeb43[_0x39cc8f];return _0x15e616;};'use strict';function ZendeskAccount(_0xee75b1){this['id']=_0xee75b1['id']||0x0;this[_0x3eb4('0x0')]=_0xee75b1['name']||'';this[_0x3eb4('0x1')]=_0xee75b1[_0x3eb4('0x1')]||'';this[_0x3eb4('0x2')]=_0xee75b1['password']||'';this[_0x3eb4('0x3')]=_0xee75b1['token']||'';this['remoteUri']=_0xee75b1[_0x3eb4('0x4')]||'';this[_0x3eb4('0x5')]=_0xee75b1[_0x3eb4('0x5')]||'';this[_0x3eb4('0x6')]=_0xee75b1['type']||_0x3eb4('0x7');this['serverUrl']=_0xee75b1[_0x3eb4('0x8')]||'';this[_0x3eb4('0x9')]=_0xee75b1[_0x3eb4('0x9')]||{};}module[_0x3eb4('0xa')]=ZendeskAccount;
\ No newline at end of file
index 2b21e96..2bc4bc4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb3f5=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x5b7f92,_0x29b3ee){var _0x593946=function(_0x2a24db){while(--_0x2a24db){_0x5b7f92['push'](_0x5b7f92['shift']());}};_0x593946(++_0x29b3ee);}(_0xb3f5,0xbb));var _0x5b3f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb3f5[_0x3dd15e];return _0x231fd0;};'use strict';function ZohoAccount(_0x342d9b){this['id']=_0x342d9b['id']||0x0;this[_0x5b3f('0x0')]=_0x342d9b[_0x5b3f('0x0')]||'';this[_0x5b3f('0x1')]=_0x342d9b[_0x5b3f('0x1')]||'';this['host']=_0x342d9b[_0x5b3f('0x2')]||'';this['zone']=_0x342d9b[_0x5b3f('0x3')]||'';this[_0x5b3f('0x4')]=_0x342d9b[_0x5b3f('0x4')]||'';this[_0x5b3f('0x5')]=_0x342d9b[_0x5b3f('0x5')]||'';this[_0x5b3f('0x6')]=_0x342d9b[_0x5b3f('0x6')]||'';this['code']=_0x342d9b[_0x5b3f('0x7')]||'';this[_0x5b3f('0x8')]=_0x342d9b[_0x5b3f('0x8')]||'';this[_0x5b3f('0x9')]=_0x342d9b[_0x5b3f('0x9')]||{};}module[_0x5b3f('0xa')]=ZohoAccount;
\ No newline at end of file
+var _0x1903=['exports','description','host','zone','clientSecret','serverUrl','code','refreshToken','Configurations'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1903,0xd0));var _0x3190=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1903[_0x14add3];return _0x4a174f;};'use strict';function ZohoAccount(_0x3127c9){this['id']=_0x3127c9['id']||0x0;this['name']=_0x3127c9['name']||'';this['description']=_0x3127c9[_0x3190('0x0')]||'';this[_0x3190('0x1')]=_0x3127c9[_0x3190('0x1')]||'';this[_0x3190('0x2')]=_0x3127c9[_0x3190('0x2')]||'';this['clientId']=_0x3127c9['clientId']||'';this[_0x3190('0x3')]=_0x3127c9[_0x3190('0x3')]||'';this[_0x3190('0x4')]=_0x3127c9['serverUrl']||'';this[_0x3190('0x5')]=_0x3127c9[_0x3190('0x5')]||'';this[_0x3190('0x6')]=_0x3127c9[_0x3190('0x6')]||'';this[_0x3190('0x7')]=_0x3127c9[_0x3190('0x7')]||{};}module[_0x3190('0x8')]=ZohoAccount;
\ No newline at end of file
index d9288ae..5e53cde 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9f76=['getCaller','\x22%s\x22\x20<%s>','number','util','lodash','moment','isNil','string','uniqueid','idContact','queue','type','campaigntype','membername','Agent','name','channelAgent','format','SIP/%s','calleridname','Contact','active','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0x9f76,0x1b1));var _0x69f7=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x9f76[_0x1f9f37];return _0x21c080;};'use strict';var util=require(_0x69f7('0x0'));var _=require(_0x69f7('0x1'));var moment=require(_0x69f7('0x2'));function checkNameSurname(_0x30d626,_0x57e6c4,_0x28dd06){var _0x274583='';if(!_[_0x69f7('0x3')](_0x57e6c4)&&_0x69f7('0x4')===typeof _0x57e6c4){_0x274583+=_0x57e6c4;}if(!_[_0x69f7('0x3')](_0x28dd06)&&_0x69f7('0x4')===typeof _0x28dd06){_0x274583+='\x20'+_0x28dd06;}if(_0x274583!==''){return _0x274583;}return _0x30d626;}function Action(_0x379d99,_0x27db88,_0xbe08f8,_0x202e34,_0x38f9a7){this[_0x69f7('0x5')]=_0xbe08f8||undefined;this[_0x69f7('0x6')]=_0x379d99['id'];this[_0x69f7('0x7')]=_0x27db88['name'];this[_0x69f7('0x8')]=_0x27db88['type'];this[_0x69f7('0x9')]=_0x69f7('0x7');this['dialAnswer']=![];this[_0x69f7('0xa')]=_[_0x69f7('0x3')](_0x379d99[_0x69f7('0xb')])?undefined:_0x379d99['Agent'][_0x69f7('0xc')];this[_0x69f7('0xd')]=this['membername']?util[_0x69f7('0xe')](_0x69f7('0xf'),this['membername']):_0x202e34||undefined;this[_0x69f7('0x10')]=checkNameSurname(_0x379d99[_0x69f7('0x11')]['phone'],_0x379d99[_0x69f7('0x11')]['firstName'],_0x379d99[_0x69f7('0x11')]['lastName']);this[_0x69f7('0x12')]=_0x379d99['active']||![];this['calleridnum']=_0x379d99[_0x69f7('0x11')][_0x69f7('0x13')];this[_0x69f7('0x14')]=_0x379d99[_0x69f7('0x14')];this[_0x69f7('0x15')]=_0x379d99[_0x69f7('0x15')]||0x0;this[_0x69f7('0x16')]=_0x379d99[_0x69f7('0x16')]||0x0;this[_0x69f7('0x17')]=_0x379d99['countnoanswerretry']||0x0;this[_0x69f7('0x18')]=(_0x379d99[_0x69f7('0x15')]||0x0)+(_0x379d99[_0x69f7('0x16')]||0x0)+(_0x379d99[_0x69f7('0x17')]||0x0)+(_0x379d99[_0x69f7('0x19')]||0x0)+(_0x379d99['countdropretry']||0x0)+(_0x379d99[_0x69f7('0x1a')]||0x0)+(_0x379d99[_0x69f7('0x1b')]||0x0)+(_0x379d99[_0x69f7('0x1c')]||0x0);this[_0x69f7('0x19')]=_0x379d99[_0x69f7('0x19')]||0x0;this[_0x69f7('0x1d')]=_0x379d99[_0x69f7('0x1d')]||0x0;this[_0x69f7('0x1a')]=_0x379d99['countabandonedretry']||0x0;this[_0x69f7('0x1b')]=_0x379d99['countmachineretry']||0x0;this['countagentrejectretry']=_0x379d99[_0x69f7('0x1c')]||0x0;this['callback']=_0x379d99[_0x69f7('0x1e')];this[_0x69f7('0x1f')]=_0x379d99[_0x69f7('0x1f')];this[_0x69f7('0x20')]=_0x379d99[_0x69f7('0x20')];this[_0x69f7('0x21')]=_0x379d99['recallme'];this[_0x69f7('0x22')]=_0x379d99[_0x69f7('0x22')];this[_0x69f7('0x23')]=_0x379d99['ListId'];this[_0x69f7('0x24')]=_[_0x69f7('0x3')](_0x379d99[_0x69f7('0xb')])?_0x379d99[_0x69f7('0x24')]:_0x379d99[_0x69f7('0xb')]['id'];this['VoiceQueueId']=_0x379d99[_0x69f7('0x25')];this['originatecalleridnum']='';this[_0x69f7('0x26')]='';}Action[_0x69f7('0x27')][_0x69f7('0x28')]=function(){return util['format'](_0x69f7('0x29'),this['calleridname'],this[_0x69f7('0x2a')]);};module['exports']=Action;
\ No newline at end of file
+var _0x9282=['countnosuchnumberretry','countdropretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','number','lodash','moment','string','isNil','uniqueid','type','campaigntype','queue','dialAnswer','membername','Agent','name','channelAgent','SIP/%s','calleridname','phone','Contact','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x36087c,_0x34daad){var _0x24563e=function(_0x485aa8){while(--_0x485aa8){_0x36087c['push'](_0x36087c['shift']());}};_0x24563e(++_0x34daad);}(_0x9282,0xd0));var _0x2928=function(_0x514816,_0x57c091){_0x514816=_0x514816-0x0;var _0x5c3a43=_0x9282[_0x514816];return _0x5c3a43;};'use strict';var util=require('util');var _=require(_0x2928('0x0'));var moment=require(_0x2928('0x1'));function checkNameSurname(_0x27e9b4,_0x1d8783,_0x466465){var _0x5a0082='';if(!_['isNil'](_0x1d8783)&&_0x2928('0x2')===typeof _0x1d8783){_0x5a0082+=_0x1d8783;}if(!_[_0x2928('0x3')](_0x466465)&&_0x2928('0x2')===typeof _0x466465){_0x5a0082+='\x20'+_0x466465;}if(_0x5a0082!==''){return _0x5a0082;}return _0x27e9b4;}function Action(_0xbe1ffc,_0x3d85be,_0x57d1b5,_0x15afce,_0x44323f){this[_0x2928('0x4')]=_0x57d1b5||undefined;this['idContact']=_0xbe1ffc['id'];this['queue']=_0x3d85be['name'];this['type']=_0x3d85be[_0x2928('0x5')];this[_0x2928('0x6')]=_0x2928('0x7');this[_0x2928('0x8')]=![];this[_0x2928('0x9')]=_[_0x2928('0x3')](_0xbe1ffc['Agent'])?undefined:_0xbe1ffc[_0x2928('0xa')][_0x2928('0xb')];this[_0x2928('0xc')]=this[_0x2928('0x9')]?util['format'](_0x2928('0xd'),this[_0x2928('0x9')]):_0x15afce||undefined;this[_0x2928('0xe')]=checkNameSurname(_0xbe1ffc['Contact'][_0x2928('0xf')],_0xbe1ffc['Contact']['firstName'],_0xbe1ffc[_0x2928('0x10')][_0x2928('0x11')]);this[_0x2928('0x12')]=_0xbe1ffc[_0x2928('0x12')]||![];this['calleridnum']=_0xbe1ffc[_0x2928('0x10')]['phone'];this[_0x2928('0x13')]=_0xbe1ffc[_0x2928('0x13')];this[_0x2928('0x14')]=_0xbe1ffc[_0x2928('0x14')]||0x0;this['countcongestionretry']=_0xbe1ffc[_0x2928('0x15')]||0x0;this[_0x2928('0x16')]=_0xbe1ffc[_0x2928('0x16')]||0x0;this['countglobal']=(_0xbe1ffc['countbusyretry']||0x0)+(_0xbe1ffc[_0x2928('0x15')]||0x0)+(_0xbe1ffc[_0x2928('0x16')]||0x0)+(_0xbe1ffc['countnosuchnumberretry']||0x0)+(_0xbe1ffc['countdropretry']||0x0)+(_0xbe1ffc[_0x2928('0x17')]||0x0)+(_0xbe1ffc[_0x2928('0x18')]||0x0)+(_0xbe1ffc[_0x2928('0x19')]||0x0);this['countnosuchnumberretry']=_0xbe1ffc[_0x2928('0x1a')]||0x0;this[_0x2928('0x1b')]=_0xbe1ffc[_0x2928('0x1b')]||0x0;this['countabandonedretry']=_0xbe1ffc[_0x2928('0x17')]||0x0;this[_0x2928('0x18')]=_0xbe1ffc[_0x2928('0x18')]||0x0;this[_0x2928('0x19')]=_0xbe1ffc[_0x2928('0x19')]||0x0;this[_0x2928('0x1c')]=_0xbe1ffc['callback'];this[_0x2928('0x1d')]=_0xbe1ffc['callbackuniqueid'];this[_0x2928('0x1e')]=_0xbe1ffc['callbackat'];this[_0x2928('0x1f')]=_0xbe1ffc[_0x2928('0x1f')];this['ContactId']=_0xbe1ffc[_0x2928('0x20')];this[_0x2928('0x21')]=_0xbe1ffc['ListId'];this[_0x2928('0x22')]=_[_0x2928('0x3')](_0xbe1ffc[_0x2928('0xa')])?_0xbe1ffc[_0x2928('0x22')]:_0xbe1ffc['Agent']['id'];this[_0x2928('0x23')]=_0xbe1ffc[_0x2928('0x23')];this['originatecalleridnum']='';this[_0x2928('0x24')]='';}Action[_0x2928('0x25')]['getCaller']=function(){return util['format']('\x22%s\x22\x20<%s>',this['calleridname'],this[_0x2928('0x26')]);};module['exports']=Action;
\ No newline at end of file
index 96e7d81..e348b78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x79fd=['[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','unmonitored','execRun','unlock','unlockContact','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','dialPrefix','substring','SIP/%s/%s%s','trim','dialCutDigit','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','originatecalleridname','addVariables','merge','channelAgent','destconnectedlinenum','user:%s','user:agentconnect','accountcode','calleridnum','[originateFailure][logOriginateFailure]','actionid','clone','isFailure','response','idContact','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','[syncHangup][talking][transfer]','syncDialEnd','destuniqueid','syncHangupRequest','addVariable','variables','filterKey','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','syncBlindTransfer','transfererlinkedid','exports','util','bluebird','uuid','moment','md5','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','./util/util','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','voiceQueues','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','dialend','syncNewExten','varset','attendedtransfer','syncAttendedTransfer','blindtransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','available','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','setMessage','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','pTalking:\x20','campaignsPreview','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','No\x20such\x20channel','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','size','getContactRecallMe','agentReadyId','then','length','scheduledat','dialRecallMeTimeout','Agent','voicePause','catch','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','RecallFailedTimeout','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','responsetime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','connect','acw','custom:agentConnectPreview','complete','decrementTalkink','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','\x20Queue','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','outboundCongestionCallsDay','countcongestionretry','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','ABANDONED','Abandoned','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','updateOriginated','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','Busy','[callProgressDetectingAgent][logBusy]','logAgent','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','execCall'];(function(_0x571a71,_0x3933bb){var _0x622df3=function(_0x46fc9d){while(--_0x46fc9d){_0x571a71['push'](_0x571a71['shift']());}};_0x622df3(++_0x3933bb);}(_0x79fd,0x1ae));var _0xd79f=function(_0x362636,_0x5d23d9){_0x362636=_0x362636-0x0;var _0x4b868d=_0x79fd[_0x362636];return _0x4b868d;};'use strict';var util=require(_0xd79f('0x0'));var _=require('lodash');var BPromise=require(_0xd79f('0x1'));var uuid=require(_0xd79f('0x2'));var moment=require(_0xd79f('0x3'));var md5=require(_0xd79f('0x4'));var Redis=require(_0xd79f('0x5'));var config=require(_0xd79f('0x6'));var logger=require(_0xd79f('0x7'))(_0xd79f('0x8'));var loggerAction=require(_0xd79f('0x7'))(_0xd79f('0x9'));var ami=require(_0xd79f('0xa'));var rpcDb=require(_0xd79f('0xb'));var Action=require(_0xd79f('0xc'));var ut=require(_0xd79f('0xd'));config[_0xd79f('0xe')]=_[_0xd79f('0xf')](config[_0xd79f('0xe')],{'host':_0xd79f('0x10'),'port':0x18eb});var io=require(_0xd79f('0x11'))(new Redis(config[_0xd79f('0xe')]));var Sequence=function(){};Sequence[_0xd79f('0x12')][_0xd79f('0x13')]=function(_0x2acd34){this[_0xd79f('0x14')]=this['tail']?this[_0xd79f('0x14')][_0xd79f('0x15')](_0x2acd34):_0x2acd34();};function Preview(_0x53584c){this[_0xd79f('0x16')]=new Sequence();this['campaignsPreview']=_0x53584c[_0xd79f('0x17')];this[_0xd79f('0x18')]=_0x53584c[_0xd79f('0x18')];this[_0xd79f('0x19')]={};this[_0xd79f('0x1a')]=_0x53584c[_0xd79f('0x1a')];this[_0xd79f('0x1b')]=0x0;ami['on']('originateresponse',this[_0xd79f('0x1c')][_0xd79f('0x1d')](this));ami['on'](_0xd79f('0x1e'),this[_0xd79f('0x1f')][_0xd79f('0x1d')](this));ami['on'](_0xd79f('0x20'),this['syncHangupRequest'][_0xd79f('0x1d')](this));ami['on'](_0xd79f('0x21'),this['syncDialEnd'][_0xd79f('0x1d')](this));ami['on']('newexten',this[_0xd79f('0x22')]['bind'](this));ami['on'](_0xd79f('0x23'),this['syncVarSet'][_0xd79f('0x1d')](this));ami['on'](_0xd79f('0x24'),this[_0xd79f('0x25')][_0xd79f('0x1d')](this));ami['on'](_0xd79f('0x26'),this['syncBlindTransfer'][_0xd79f('0x1d')](this));this[_0xd79f('0x27')](this['campaignsPreview']);}function emit(_0x17c5ce,_0x1b1cf3,_0x563b3f){io['to'](_0x17c5ce)[_0xd79f('0x28')](_0x1b1cf3,_0x563b3f);}function emitCampaignPreview(_0x4bdf01){if(_0x4bdf01[_0xd79f('0x29')]===_0xd79f('0x2a')){var _0xc98927={'id':_0x4bdf01['id'],'name':_0x4bdf01[_0xd79f('0x2b')],'strategy':_0x4bdf01[_0xd79f('0x2c')],'answered':_0x4bdf01[_0xd79f('0x2d')],'available':_0x4bdf01['available'],'loggedIn':_0x4bdf01[_0xd79f('0x2e')],'pTalking':_0x4bdf01[_0xd79f('0x2f')],'sumBillable':_0x4bdf01[_0xd79f('0x30')],'sumDuration':_0x4bdf01[_0xd79f('0x31')],'sumHoldTime':_0x4bdf01[_0xd79f('0x32')]||0x0,'talking':_0x4bdf01['talking'],'total':_0x4bdf01[_0xd79f('0x33')],'type':_0x4bdf01[_0xd79f('0x29')],'unmanaged':_0x4bdf01['unmanaged'],'abandoned':_0x4bdf01[_0xd79f('0x34')],'waiting':_0x4bdf01[_0xd79f('0x35')],'loggedInDb':_0x4bdf01[_0xd79f('0x36')],'dialActive':_0x4bdf01[_0xd79f('0x37')],'dialMethod':_0x4bdf01[_0xd79f('0x38')],'dialOriginateCallerIdName':_0x4bdf01[_0xd79f('0x39')],'dialOriginateCallerIdNumber':_0x4bdf01[_0xd79f('0x3a')],'dialOriginateTimeout':_0x4bdf01[_0xd79f('0x3b')],'dialPrefix':_0x4bdf01['dialPrefix'],'outboundAnswerAgiCallsDay':_0x4bdf01[_0xd79f('0x3c')],'outboundAnswerCallsDay':_0x4bdf01[_0xd79f('0x3d')],'outboundBlacklistCallsDay':_0x4bdf01['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x4bdf01[_0xd79f('0x3e')],'outboundCongestionCallsDay':_0x4bdf01['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x4bdf01['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x4bdf01[_0xd79f('0x3f')],'outboundDropCallsDayTimeout':_0x4bdf01[_0xd79f('0x40')],'outboundNoAnswerCallsDay':_0x4bdf01[_0xd79f('0x41')],'outboundNoSuchCallsDay':_0x4bdf01[_0xd79f('0x42')],'outboundOriginateFailureCallsDay':_0x4bdf01['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x4bdf01[_0xd79f('0x43')],'outboundRejectCallsDay':_0x4bdf01['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x4bdf01[_0xd79f('0x44')],'outboundAbandonedCallsDay':_0x4bdf01['outboundAbandonedCallsDay'],'predictiveIntervalAnsweredCalls':_0x4bdf01[_0xd79f('0x45')],'predictiveIntervalAvgHoldtime':_0x4bdf01['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x4bdf01[_0xd79f('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x4bdf01['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x4bdf01[_0xd79f('0x47')],'predictiveIntervalErlangCalls':_0x4bdf01[_0xd79f('0x48')],'predictiveIntervalErlangCallsDroppedCalls':_0x4bdf01[_0xd79f('0x49')],'predictiveIntervalHitRate':_0x4bdf01['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x4bdf01['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x4bdf01[_0xd79f('0x4a')],'predictiveIntervalAvailable':_0x4bdf01[_0xd79f('0x4b')],'predictiveIntervalTotalCalls':_0x4bdf01['predictiveIntervalTotalCalls'],'message':_0x4bdf01['message'],'originated':_0x4bdf01[_0xd79f('0x4c')],'erlangCalls':_0x4bdf01[_0xd79f('0x4d')],'erlangCallToSecond':_0x4bdf01[_0xd79f('0x4e')],'erlangAbandonmentRate':_0x4bdf01[_0xd79f('0x4f')],'erlangBusyFactor':_0x4bdf01['erlangBusyFactor'],'startPredictive':_0x4bdf01[_0xd79f('0x50')],'startProgressive':_0x4bdf01[_0xd79f('0x51')]};if(_0x4bdf01[_0xd79f('0x52')]){_0xc98927[_0xd79f('0x52')]={'id':_0x4bdf01[_0xd79f('0x52')]['id'],'name':_0x4bdf01[_0xd79f('0x52')][_0xd79f('0x2b')],'active':_0x4bdf01[_0xd79f('0x52')]['active'],'callerid':_0x4bdf01['Trunk']['callerid']};}if(_0x4bdf01['Interval']){_0xc98927[_0xd79f('0x53')]={'id':_0x4bdf01[_0xd79f('0x53')]['id'],'name':_0x4bdf01[_0xd79f('0x53')][_0xd79f('0x2b')]};}var _0x2eae2f=md5(JSON[_0xd79f('0x54')](_0xc98927));if(_0x4bdf01['md5']!==_0x2eae2f){_0x4bdf01[_0xd79f('0x4')]=_0x2eae2f;emit(util[_0xd79f('0x55')](_0xd79f('0x56'),_0xc98927[_0xd79f('0x2b')]),_0xd79f('0x57'),_0xc98927);}}}function emitVoiceQueueChannelRemove(_0x225dea){logger[_0xd79f('0x58')](_0xd79f('0x59'),JSON[_0xd79f('0x54')](_0x225dea));emit(util['format']('voice:queue:%s',_0x225dea[_0xd79f('0x2b')]),_0xd79f('0x5a'),_0x225dea);io[_0xd79f('0x28')](_0xd79f('0x5b'),_0x225dea);}function notSendMessagesQueue(_0x3b3023){if(_0x3b3023[_0xd79f('0x5c')]){if(_0x3b3023['originated']===0x0&&_0x3b3023[_0xd79f('0x2f')]===0x0){_0x3b3023[_0xd79f('0x5c')]=![];_0x3b3023[_0xd79f('0x5d')]=0x0;_0x3b3023[_0xd79f('0x5e')]=0x0;_0x3b3023[_0xd79f('0x5f')]=_0xd79f('0x60');ut[_0xd79f('0x61')](_0xd79f('0x62'),_0x3b3023[_0xd79f('0x2b')]+'\x20is\x20not\x20active');}else{_0x3b3023[_0xd79f('0x5f')]=_0xd79f('0x63');ut[_0xd79f('0x61')](_0xd79f('0x62'),_0x3b3023[_0xd79f('0x2b')]+'\x20is\x20disactive');}emitCampaignPreview(_0x3b3023);}}Preview[_0xd79f('0x12')][_0xd79f('0x27')]=function(){var _0x2568c9=this;setInterval(function(){_0x2568c9[_0xd79f('0x64')]();},0x7cf);};Preview['prototype'][_0xd79f('0x64')]=function(){var _0x3da263=this['campaignsPreview'];this['clockClearZombieChannels']+=0x1;for(var _0x315df1 in _0x3da263){if(_0x3da263[_0xd79f('0x65')](_0x315df1)&&(_0x3da263[_0x315df1][_0xd79f('0x38')]===_0xd79f('0x8')||_0x3da263[_0x315df1]['dialMethod']===_0xd79f('0x66'))&&_0x3da263[_0x315df1]['type']===_0xd79f('0x2a')){if(this[_0xd79f('0x1b')]>0x7){this[_0xd79f('0x1b')]=0x0;this[_0xd79f('0x67')]();}}if(_0x3da263[_0xd79f('0x65')](_0x315df1)&&_0x3da263[_0x315df1]['dialMethod']==='preview'&&_0x3da263[_0x315df1][_0xd79f('0x29')]==='outbound'){if(_0x3da263[_0x315df1][_0xd79f('0x37')]){this[_0xd79f('0x68')](_0x3da263[_0x315df1]);this[_0xd79f('0x69')](_0x3da263[_0x315df1]);}else{notSendMessagesQueue(_0x3da263[_0x315df1]);}}}};Preview[_0xd79f('0x12')][_0xd79f('0x6a')]=function(_0x1c1626){var _0x21d1d2=this;this[_0xd79f('0x16')][_0xd79f('0x13')](function(){if(!_[_0xd79f('0x6b')](_0x21d1d2['actions'][_0x1c1626])){loggerAction[_0xd79f('0x58')](_0xd79f('0x6c'),_0x1c1626,_0xd79f('0x6d'),_0x21d1d2['actions'][_0x1c1626][_0xd79f('0x6e')],_0xd79f('0x6f'),JSON['stringify'](_0x21d1d2['campaignsPreview'][_0x21d1d2[_0xd79f('0x19')][_0x1c1626][_0xd79f('0x6e')]][_0xd79f('0x4c')]),_0xd79f('0x70'),JSON[_0xd79f('0x54')](_0x21d1d2[_0xd79f('0x71')][_0x21d1d2['actions'][_0x1c1626]['queue']]['pTalking']),JSON[_0xd79f('0x54')](_0x21d1d2['actions'][_0x1c1626][_0xd79f('0x72')]),JSON['stringify'](_[_0xd79f('0x73')](_0x21d1d2[_0xd79f('0x19')][_0x1c1626],[_0xd79f('0x74'),_0xd79f('0x75'),_0xd79f('0x76'),_0xd79f('0x77')])));return ami[_0xd79f('0x78')]({'action':_0xd79f('0x79'),'channel':_0x21d1d2[_0xd79f('0x19')][_0x1c1626][_0xd79f('0x7a')]})['catch'](function(_0x53700c){if(_0x53700c['message']===_0xd79f('0x7b')){setTimeout(function(){if(_0x21d1d2['actions'][_0x1c1626]){ut['updateOriginated'](_0x21d1d2[_0xd79f('0x71')][_0x21d1d2['actions'][_0x1c1626][_0xd79f('0x6e')]],'[clearZombieChannel]');if(_0x21d1d2[_0xd79f('0x19')][_0x1c1626][_0xd79f('0x72')]===!![]){ut['decrementTalkink'](_0x21d1d2[_0xd79f('0x71')][_0x21d1d2[_0xd79f('0x19')][_0x1c1626][_0xd79f('0x6e')]],_0xd79f('0x7c'));ut[_0xd79f('0x7d')](_0xd79f('0x7e')+_0x1c1626,_0x21d1d2['actions'][_0x1c1626]['queue']);}ut[_0xd79f('0x7d')]('[Dialer][checkChannel][Preview]'+_0x1c1626,_0x21d1d2[_0xd79f('0x19')][_0x1c1626][_0xd79f('0x6e')]);delete _0x21d1d2['actions'][_0x1c1626];}},0x2328);}});}});};Preview[_0xd79f('0x12')][_0xd79f('0x67')]=function(){var _0x34862f=this;loggerAction[_0xd79f('0x58')]('[action]',_[_0xd79f('0x7f')](this['actions']));for(var _0x2663b7 in this['actions']){if(_0x34862f[_0xd79f('0x19')][_0xd79f('0x65')](_0x2663b7)){_0x34862f['clearZombieChannel'](_0x2663b7);}}};Preview[_0xd79f('0x12')]['recallMe']=function(_0x4dc964){var _0x1c033e=this;rpcDb[_0xd79f('0x80')](_0x4dc964['id'],ut[_0xd79f('0x81')](this[_0xd79f('0x1a')]))[_0xd79f('0x82')](function(_0x503d00){if(!_['isNil'](_0x503d00)){for(var _0x20dd01=0x0;_0x20dd01<_0x503d00[_0xd79f('0x83')];_0x20dd01+=0x1){if(ut['getDiff'](_0x503d00[_0x20dd01][_0xd79f('0x84')])<_0x4dc964[_0xd79f('0x85')]*0x3c){if(_0x503d00[_0x20dd01][_0xd79f('0x86')]&&!_0x503d00[_0x20dd01][_0xd79f('0x86')][_0xd79f('0x87')]){_0x1c033e['run'](_0x503d00[_0x20dd01]['id'])['then'](ut['logger2']('[RecallMe]'))[_0xd79f('0x88')](ut[_0xd79f('0x89')](_0xd79f('0x8a')));}else{rpcDb[_0xd79f('0x8b')](_0x503d00[_0x20dd01]['id']);}}else{var _0x2f979e=new Action(_0x503d00[_0x20dd01],_0x4dc964);_0x2f979e[_0xd79f('0x8c')]=moment()[_0xd79f('0x55')](_0xd79f('0x8d'));_0x4dc964[_0xd79f('0x43')]+=0x1;ut[_0xd79f('0x8e')](_0x2f979e,0x17,_0xd79f('0x8f'));if(_0x4dc964[_0xd79f('0x90')]){rpcDb[_0xd79f('0x91')](ut[_0xd79f('0x92')](_0x503d00[_0x20dd01]));rpcDb[_0xd79f('0x93')](_0x2f979e,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0xd79f('0x8e')](_0x2f979e,0x16,_0xd79f('0x94'));rpcDb[_0xd79f('0x93')](_0x2f979e,'[HistoryRecallClose]');rpcDb[_0xd79f('0x95')](_0x2f979e,_0xd79f('0x96'));}}}}})[_0xd79f('0x88')](ut[_0xd79f('0x89')](_0xd79f('0x97')));};Preview[_0xd79f('0x12')][_0xd79f('0x68')]=function(_0x3baced){_0x3baced[_0xd79f('0x5c')]=!![];if(ut[_0xd79f('0x98')](_0x3baced['loggedIn'])){_0x3baced['message']=_0xd79f('0x99');}else if(!ut['isActive'](_0x3baced[_0xd79f('0x37')])){_0x3baced[_0xd79f('0x5f')]=_0xd79f('0x60');}else if(!this[_0xd79f('0x9a')](_0x3baced['Trunk'])){if(!this['isTrunkReachable'](_0x3baced[_0xd79f('0x9b')])){_0x3baced[_0xd79f('0x5f')]=_0xd79f('0x9c');}else{_0x3baced[_0xd79f('0x5f')]=_0xd79f('0x9d');}}else{_0x3baced[_0xd79f('0x5f')]=_0xd79f('0x9d');}emitCampaignPreview(_0x3baced);};Preview[_0xd79f('0x12')][_0xd79f('0x9e')]=function(_0x48ca8b,_0x4b7769,_0xa688f2){var _0x34652c=this;var _0x3be880=this[_0xd79f('0x19')][_0x4b7769];var _0x39a07e=this[_0xd79f('0x71')][_0x3be880[_0xd79f('0x6e')]];var _0x2e26e4;if(_0x39a07e){switch(_0xa688f2){case'1':_0x39a07e[_0xd79f('0x42')]+=0x1;_0x3be880[_0xd79f('0x9f')]+=0x1;_0x3be880[_0xd79f('0xa0')]=ut['totalGlobal'](_0x3be880);ut[_0xd79f('0x8e')](_0x3be880,0x0,_0xd79f('0xa1'));ami[_0xd79f('0x28')](_0xd79f('0xa2'),ut[_0xd79f('0xa3')](_0x3be880,_0xd79f('0xa4')));rpcDb['createCustomerHistory'](_0x3be880,_0xd79f('0xa5'));if(ut[_0xd79f('0xa6')](_0x3be880)>=_0x39a07e[_0xd79f('0xa7')]){_0x2e26e4=ut[_0xd79f('0xa8')](_0x3be880,0xf,_0xd79f('0xa9'));rpcDb[_0xd79f('0x95')](_0x2e26e4,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x3be880[_0xd79f('0x9f')]>=_0x39a07e[_0xd79f('0xaa')]){rpcDb[_0xd79f('0x95')](_0x3be880,_0xd79f('0xab'));}else{rpcDb[_0xd79f('0xac')](ut[_0xd79f('0xad')](_0x3be880,_0xd79f('0x9f'),_0x39a07e[_0xd79f('0xae')]),_0x3be880[_0xd79f('0xaf')],_0x3be880[_0xd79f('0xb0')]);}}delete this['actions'][_0x48ca8b[_0xd79f('0xb1')]];break;case _0xd79f('0xb2'):var _0x3cbce9=moment()[_0xd79f('0x55')](_0xd79f('0x8d'));_0x3be880[_0xd79f('0xb3')]=_0x3cbce9;_0x3be880['answertime']=_0x3cbce9;_0x3be880['dialAnswer']=!![];_0x39a07e[_0xd79f('0x2f')]+=0x1;logger['info'](_0xd79f('0xb4'),_0x3be880[_0xd79f('0xb5')],'\x20Queue',_0x39a07e[_0xd79f('0x2b')],_0xd79f('0x70'),_0x39a07e[_0xd79f('0x2f')]);ami[_0xd79f('0x28')](_0xd79f('0xb6'),ut[_0xd79f('0xa3')](_0x3be880,_0xd79f('0xb7'),this['campaignsPreview'][_0x3be880[_0xd79f('0x6e')]]));if(_0x39a07e[_0xd79f('0xb8')]){ami[_0xd79f('0x28')](_0xd79f('0xb9'),ut['buildAcw'](_0x3be880));}break;case'16':ami[_0xd79f('0x28')]('custom:agentcomplete',ut[_0xd79f('0xa3')](_0x3be880,_0xd79f('0xba'),this[_0xd79f('0x71')][_0x3be880['queue']]));emitVoiceQueueChannelRemove(ut[_0xd79f('0xa3')](_0x3be880,_0xd79f('0xba')));_0x39a07e[_0xd79f('0x3d')]+=0x1;_0x39a07e[_0xd79f('0x33')]+=0x1;_0x39a07e['answered']+=0x1;ut[_0xd79f('0xbb')](_0x39a07e,'[16]');_0x3be880[_0xd79f('0xa0')]=ut[_0xd79f('0xa6')](_0x3be880);ut[_0xd79f('0x8e')](_0x3be880,0x4,_0xd79f('0xbc'));rpcDb['createCustomerHistory'](_0x3be880,_0xd79f('0xbd'));rpcDb[_0xd79f('0x95')](_0x3be880,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0xd79f('0xbe')](_0x3be880);_0x39a07e[_0xd79f('0x31')]+=_0x3be880[_0xd79f('0xbf')];_0x39a07e['sumBillable']+=_0x3be880['talktime'];logger[_0xd79f('0x58')](_0xd79f('0xc0'),_0x3be880[_0xd79f('0xb5')],_0xd79f('0xc1'),_0x39a07e['name'],_0xd79f('0x70'),_0x39a07e[_0xd79f('0x2f')]);delete this['actions'][_0x48ca8b[_0xd79f('0xb1')]];break;case'BUSY':_0x39a07e[_0xd79f('0x3e')]+=0x1;_0x3be880['countbusyretry']+=0x1;_0x3be880[_0xd79f('0xa0')]=ut[_0xd79f('0xa6')](_0x3be880);ut[_0xd79f('0x8e')](_0x3be880,0x5,'Busy');ami['emit'](_0xd79f('0xc2'),ut[_0xd79f('0xa3')](_0x3be880,_0xd79f('0xc3')));rpcDb[_0xd79f('0x93')](_0x3be880,_0xd79f('0xc4'));if(ut[_0xd79f('0xa6')](_0x3be880)>=_0x39a07e[_0xd79f('0xa7')]){_0x2e26e4=ut['cloneAction'](_0x3be880,0xf,_0xd79f('0xa9'));rpcDb['createCustomerFinal'](_0x2e26e4,_0xd79f('0xc5'));}else{if(_0x3be880[_0xd79f('0xc6')]>=_0x39a07e[_0xd79f('0xc7')]){rpcDb['createCustomerFinal'](_0x3be880,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xd79f('0xac')](ut[_0xd79f('0xad')](_0x3be880,_0xd79f('0xc6'),_0x39a07e[_0xd79f('0xc8')]),_0x3be880[_0xd79f('0xaf')],_0x3be880['activeContact']);}}break;case _0xd79f('0xc9'):_0x39a07e['outboundNoAnswerCallsDay']+=0x1;_0x3be880[_0xd79f('0xca')]+=0x1;_0x3be880[_0xd79f('0xa0')]=ut[_0xd79f('0xa6')](_0x3be880);ut[_0xd79f('0x8e')](_0x3be880,0x3,_0xd79f('0xcb'));ami[_0xd79f('0x28')](_0xd79f('0xcc'),ut[_0xd79f('0xa3')](_0x3be880,'noanswer'));rpcDb[_0xd79f('0x93')](_0x3be880,_0xd79f('0xcd'));if(ut[_0xd79f('0xa6')](_0x3be880)>=_0x39a07e['dialGlobalMaxRetry']){_0x2e26e4=ut[_0xd79f('0xa8')](_0x3be880,0xf,_0xd79f('0xa9'));rpcDb['createCustomerFinal'](_0x2e26e4,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x3be880['countnoanswerretry']>=_0x39a07e['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0x3be880,_0xd79f('0xcd'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x3be880,_0xd79f('0xca'),_0x39a07e[_0xd79f('0xce')]),_0x3be880['unlockAgent'],_0x3be880[_0xd79f('0xb0')]);}}break;case'CONGESTION':_0x39a07e[_0xd79f('0xcf')]+=0x1;_0x3be880[_0xd79f('0xd0')]+=0x1;_0x3be880[_0xd79f('0xa0')]=ut[_0xd79f('0xa6')](_0x3be880);ut['logCustomer'](_0x3be880,0x8,'Congestion');ami[_0xd79f('0x28')](_0xd79f('0xd1'),ut[_0xd79f('0xa3')](_0x3be880,_0xd79f('0xd2')));rpcDb[_0xd79f('0x93')](_0x3be880,_0xd79f('0xd3'));if(ut[_0xd79f('0xa6')](_0x3be880)>=_0x39a07e['dialGlobalMaxRetry']){_0x2e26e4=ut['cloneAction'](_0x3be880,0xf,_0xd79f('0xa9'));rpcDb[_0xd79f('0x95')](_0x2e26e4,_0xd79f('0xd4'));}else{if(_0x3be880[_0xd79f('0xd0')]>=_0x39a07e[_0xd79f('0xd5')]){rpcDb[_0xd79f('0x95')](_0x3be880,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0xd79f('0xac')](ut[_0xd79f('0xad')](_0x3be880,_0xd79f('0xd0'),_0x39a07e[_0xd79f('0xc8')]),_0x3be880[_0xd79f('0xaf')],_0x3be880[_0xd79f('0xb0')]);}}break;case _0xd79f('0xd6'):_0x39a07e[_0xd79f('0xd7')]+=0x1;_0x3be880[_0xd79f('0xd8')]+=0x1;_0x3be880[_0xd79f('0xa0')]=ut['totalGlobal'](_0x3be880);ut[_0xd79f('0x8e')](_0x3be880,0x14,_0xd79f('0xd9'));ami[_0xd79f('0x28')](_0xd79f('0xda'),ut[_0xd79f('0xa3')](_0x3be880,_0xd79f('0xdb')));rpcDb[_0xd79f('0x93')](_0x3be880,_0xd79f('0xdc'));if(ut[_0xd79f('0xa6')](_0x3be880)>=_0x39a07e[_0xd79f('0xa7')]){_0x2e26e4=ut[_0xd79f('0xa8')](_0x3be880,0x14,_0xd79f('0xd9'));rpcDb[_0xd79f('0x95')](_0x2e26e4,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x3be880['countagentrejectretry']>=_0x39a07e[_0xd79f('0xdd')]){rpcDb['createCustomerFinal'](_0x3be880,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0xd79f('0xac')](ut[_0xd79f('0xad')](_0x3be880,_0xd79f('0xd8'),_0x39a07e[_0xd79f('0xde')]),_0x3be880[_0xd79f('0xaf')],_0x3be880[_0xd79f('0xb0')]);}}break;case _0xd79f('0xdf'):_0x39a07e['outboundAbandonedCallsDay']+=0x1;_0x3be880['countabandonedretry']+=0x1;_0x3be880['countglobal']=ut[_0xd79f('0xa6')](_0x3be880);ut[_0xd79f('0x8e')](_0x3be880,0xb,_0xd79f('0xe0'));rpcDb[_0xd79f('0x93')](_0x3be880,'[callProgressDetectingCustomer][logAbandoned]');if(ut[_0xd79f('0xa6')](_0x3be880)>=_0x39a07e[_0xd79f('0xa7')]){_0x2e26e4=ut[_0xd79f('0xa8')](_0x3be880,0xf,_0xd79f('0xa9'));rpcDb[_0xd79f('0x95')](_0x2e26e4,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x3be880['countabandonedetry']>=_0x39a07e[_0xd79f('0xe1')]){rpcDb[_0xd79f('0x95')](_0x3be880,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb[_0xd79f('0xac')](ut[_0xd79f('0xad')](_0x3be880,_0xd79f('0xe2'),_0x39a07e[_0xd79f('0xe3')]),_0x3be880['unlockAgent'],_0x3be880[_0xd79f('0xb0')]);}}break;case'18':_0x39a07e[_0xd79f('0x44')]+=0x1;_0x3be880[_0xd79f('0xe4')]+=0x1;_0x3be880[_0xd79f('0xa0')]=ut['totalGlobal'](_0x3be880);ut[_0xd79f('0x8e')](_0x3be880,0x12,_0x48ca8b[_0xd79f('0xe5')]||_0x48ca8b[_0xd79f('0xe6')]);ami[_0xd79f('0x28')](_0xd79f('0xe7'),ut[_0xd79f('0xa3')](_0x3be880,_0xd79f('0xe8')));rpcDb[_0xd79f('0x93')](_0x3be880,_0xd79f('0xe9'));if(ut[_0xd79f('0xa6')](_0x3be880)>=_0x39a07e[_0xd79f('0xa7')]){_0x2e26e4=ut[_0xd79f('0xa8')](_0x3be880,0xf,_0xd79f('0xa9'));rpcDb[_0xd79f('0x95')](_0x2e26e4,_0xd79f('0xe9'));}else{rpcDb[_0xd79f('0x95')](_0x3be880,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0xd79f('0x19')][_0x48ca8b['linkedid']];break;case'19':_0x39a07e[_0xd79f('0x44')]+=0x1;_0x3be880[_0xd79f('0xa0')]=ut[_0xd79f('0xa6')](_0x3be880);ut[_0xd79f('0x8e')](_0x3be880,0x13,_0x48ca8b['cause-txt']||_0x48ca8b[_0xd79f('0xe6')]);ami[_0xd79f('0x28')](_0xd79f('0xe7'),ut[_0xd79f('0xa3')](_0x3be880,_0xd79f('0xe8')));rpcDb[_0xd79f('0x93')](_0x3be880,'[callProgressDetectingCustomer][machine]');if(ut['totalGlobal'](_0x3be880)>=_0x39a07e[_0xd79f('0xa7')]){_0x2e26e4=ut[_0xd79f('0xa8')](_0x3be880,0xf,_0xd79f('0xa9'));rpcDb[_0xd79f('0x95')](_0x2e26e4,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0xd79f('0x95')](_0x3be880,'[callProgressDetectingCustomer][machine]');}delete this[_0xd79f('0x19')][_0x48ca8b[_0xd79f('0xb1')]];break;default:if(_0x3be880['dialAnswer']){ut[_0xd79f('0xbb')](_0x39a07e,_0xd79f('0xea'));ut['loggerError'](_0xd79f('0xeb')+_0x39a07e[_0xd79f('0x2b')],_0x48ca8b);}_0x39a07e['outboundUnknownCallsDay']+=0x1;_0x3be880[_0xd79f('0xa0')]=ut[_0xd79f('0xa6')](_0x3be880);ut[_0xd79f('0x8e')](_0x3be880,0xc,_0x48ca8b['cause-txt']||_0x48ca8b[_0xd79f('0xe6')]);rpcDb['createCustomerHistory'](_0x3be880,_0xd79f('0xec'));if(ut['totalGlobal'](_0x3be880)>=_0x39a07e[_0xd79f('0xa7')]){_0x2e26e4=ut[_0xd79f('0xa8')](_0x3be880,0xf,_0xd79f('0xa9'));rpcDb['createCustomerFinal'](_0x2e26e4,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0xd79f('0x95')](_0x3be880,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this['actions'][_0x48ca8b[_0xd79f('0xb1')]];}if(!(_0x3be880[_0xd79f('0x72')]&&_0xa688f2==='16')){ut[_0xd79f('0xed')](_0x39a07e,_0xd79f('0xee'));logger['info'](_0xd79f('0xef'),_0x3be880[_0xd79f('0xb5')],_0xd79f('0xc1'),_0x39a07e[_0xd79f('0x2b')],'originated:\x20',_0x39a07e[_0xd79f('0x4c')]);}if(_0xa688f2!==_0xd79f('0xb2')){delete this[_0xd79f('0x19')][_0x48ca8b[_0xd79f('0xb1')]];delete this[_0xd79f('0x19')][_0x48ca8b[_0xd79f('0xf0')]];}}};Preview[_0xd79f('0x12')][_0xd79f('0xf1')]=function(_0x1cafee,_0x5891eb,_0x1ac1b8){if(_[_0xd79f('0xf2')](_0x5891eb)&&_0xd79f('0xf3')!==typeof _0x5891eb){return;}if(_[_0xd79f('0xf2')](_0x1ac1b8)&&_0xd79f('0xf3')!==typeof _0x1ac1b8){return;}switch(_0x1ac1b8[_0xd79f('0xf4')]){case'0':ut['logAgent'](_0x1cafee,0x0,_0xd79f('0xa1'));rpcDb[_0xd79f('0xf5')](_0x1cafee,_0xd79f('0xf6'));break;case'3':ut['logAgent'](_0x1cafee,0x3,_0xd79f('0xcb'));rpcDb['createAgentHistory'](_0x1cafee,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut['logAgent'](_0x1cafee,0x5,_0xd79f('0xf7'));rpcDb[_0xd79f('0xf5')](_0x1cafee,_0xd79f('0xf8'));break;case'8':ut[_0xd79f('0xf9')](_0x1cafee,0x8,_0xd79f('0xfa'));rpcDb[_0xd79f('0xf5')](_0x1cafee,_0xd79f('0xfb'));break;case'22':ut[_0xd79f('0xf9')](_0x1cafee,0x16,_0xd79f('0xfc'));rpcDb[_0xd79f('0xf5')](_0x1cafee,_0xd79f('0xfd'));break;default:ut[_0xd79f('0xf9')](_0x1cafee,0xc,_0x1ac1b8[_0xd79f('0xf4')]);rpcDb[_0xd79f('0xf5')](_0x1cafee,_0xd79f('0xfb'));}ut[_0xd79f('0xed')](_0x5891eb,_0xd79f('0xfe'));logger[_0xd79f('0x58')](_0xd79f('0xff'),_0x1cafee[_0xd79f('0xb5')],_0xd79f('0xc1'),_0x5891eb[_0xd79f('0x2b')],'originated:\x20',_0x5891eb[_0xd79f('0x4c')]);delete this[_0xd79f('0x19')][_0x1cafee[_0xd79f('0xb5')]];};Preview[_0xd79f('0x12')][_0xd79f('0x100')]=function(_0x4be110,_0x377dbb,_0x3c5060,_0x47b2fb,_0x2f969b){var _0xdeef45=this;return new BPromise(function(_0x1b6332,_0x281b70){if(_[_0xd79f('0x6b')](_0x377dbb)||_[_0xd79f('0x6b')](_0x377dbb['Contact'])||_[_0xd79f('0x6b')](_0x377dbb[_0xd79f('0x101')][_0xd79f('0x102')])||_[_0xd79f('0x6b')](_0x377dbb[_0xd79f('0x76')])){_0x281b70(ut['message'](_0xd79f('0x103'),_0x47b2fb,_0x2f969b));return;}var _0x47ebf4=uuid['v4']();var _0x462a1f=_0xdeef45[_0xd79f('0x71')][_0x377dbb[_0xd79f('0x6d')][_0xd79f('0x2b')]];var _0x1af9af=_0x3c5060?_0xdeef45[_0xd79f('0x1a')][_0x3c5060]['id']:undefined;_0xdeef45['actions'][_0x47ebf4]=new Action(_0x377dbb,_0x462a1f,_0x47ebf4,_0x3c5060,_0x1af9af);var _0x5dab03=_0xdeef45[_0xd79f('0x19')][_0x47ebf4];_0x5dab03[_0xd79f('0xaf')]=_0x47b2fb;_0x5dab03[_0xd79f('0xb0')]=_0x2f969b;_0x5dab03[_0xd79f('0x104')]=_0x3c5060;if(_['isEmpty'](_0x4be110)){_0xdeef45[_0xd79f('0x105')](_0x5dab03,_0x462a1f,_0x377dbb,_0x3c5060)['then'](function(_0x154394){logger['info'](_0xd79f('0x106'),_0xd79f('0x107')+_0x5dab03['queue']+_0xd79f('0x108')+_0x5dab03['idContact'],JSON[_0xd79f('0x54')](_0x154394));ami['emit'](_0xd79f('0x109'),ut['buildObj'](_0x5dab03,_0xd79f('0x10a'),_0xdeef45[_0xd79f('0x71')][_0x5dab03[_0xd79f('0x6e')]]));_0x1b6332(ut['message']('Calling'));})['catch'](function(_0x1ee491){ut[_0xd79f('0x61')](_0xd79f('0x10b'),_0x1ee491);_0x281b70(ut[_0xd79f('0x5f')](_0xd79f('0x10c'),_0x47b2fb,_0x2f969b));});}else{_0x462a1f[_0xd79f('0x10d')]+=0x1;ut[_0xd79f('0x10e')](_0x5dab03);rpcDb[_0xd79f('0x10f')](_0x5dab03,_0xd79f('0x110'));delete _0xdeef45[_0xd79f('0x19')][_0x47ebf4];_0x281b70(ut[_0xd79f('0x5f')](_0xd79f('0x111'),_0x47b2fb,_0x2f969b));}});};Preview[_0xd79f('0x12')][_0xd79f('0x9a')]=function(_0x1a90ce){return!_['isNil'](_0x1a90ce)&&!_[_0xd79f('0x6b')](_0x1a90ce['name'])&&!_['isNil'](_0x1a90ce[_0xd79f('0x112')])&&_0x1a90ce[_0xd79f('0x112')]&&!_['isNil'](this[_0xd79f('0x18')][util[_0xd79f('0x55')]('SIP/%s',_0x1a90ce[_0xd79f('0x2b')])])&&!_[_0xd79f('0x6b')](this[_0xd79f('0x18')][util[_0xd79f('0x55')](_0xd79f('0x113'),_0x1a90ce[_0xd79f('0x2b')])]['status'])&&(this['trunks'][util[_0xd79f('0x55')](_0xd79f('0x113'),_0x1a90ce[_0xd79f('0x2b')])][_0xd79f('0x79')]===_0xd79f('0x114')||this[_0xd79f('0x18')][util[_0xd79f('0x55')](_0xd79f('0x113'),_0x1a90ce[_0xd79f('0x2b')])][_0xd79f('0x79')]===_0xd79f('0x115'));};Preview[_0xd79f('0x12')]['run']=function(_0x594bef,_0x1c10ef){var _0x3dd9c4=this;return new BPromise(function(_0xbda512,_0x563709){_0x3dd9c4[_0xd79f('0x116')](_0x594bef,_0x1c10ef)[_0xd79f('0x82')](function(_0x5f5a37){_0xbda512(_[_0xd79f('0x73')](_0x5f5a37,[_0xd79f('0x5f')]));})[_0xd79f('0x88')](function(_0x1ed490){if(_0x1ed490[_0xd79f('0x117')]){rpcDb[_0xd79f('0x118')](_0x594bef);}if(_0x1ed490[_0xd79f('0x112')]){rpcDb[_0xd79f('0x8b')](_0x594bef);}_0x563709(_[_0xd79f('0x73')](_0x1ed490,[_0xd79f('0x5f')]));});});};Preview[_0xd79f('0x12')][_0xd79f('0x116')]=function(_0x36fbb4,_0x22d78c){var _0x4dfe75=this;return new BPromise(function(_0x4d7788,_0x7c6cd1){var _0x185965,_0x43c486;rpcDb[_0xd79f('0x119')](_0x36fbb4)['then'](function(_0x3425a2){if(!_['isNil'](_0x3425a2[0x0])){_0x43c486=_0x3425a2[0x0][_0xd79f('0x11a')]?![]:!![];_0x185965=_0x3425a2[0x0]['recallme']?!![]:![];_0x185965=_0x22d78c?!![]:_0x185965;}var _0x20df0c=_0x4dfe75[_0xd79f('0x11b')](_0x3425a2);if(_0x20df0c[_0xd79f('0x11c')]){rpcDb[_0xd79f('0x11d')](_[_0xd79f('0x73')](_0x3425a2[0x0],['VoiceQueueId','Contact.phone']))[_0xd79f('0x82')](function(_0x213f4e){_0x4dfe75[_0xd79f('0x100')](_0x213f4e,_0x3425a2[0x0],_0x22d78c,_0x43c486,_0x185965)[_0xd79f('0x82')](function(_0x5397c5){_0x4d7788(_0x5397c5);})['catch'](function(_0x47f922){_0x7c6cd1(_0x47f922);});})['catch'](function(_0x46665c){ut[_0xd79f('0x61')]('[Preview][checkIsBlackList]',_0x46665c);_0x7c6cd1(ut[_0xd79f('0x5f')](_0xd79f('0x11e'),_0x43c486,_0x185965));});}else{_0x7c6cd1(ut['message'](_0x20df0c[_0xd79f('0x5f')],_0x43c486,_0x185965));}})['catch'](function(_0x4e5034){ut[_0xd79f('0x61')](_0xd79f('0x11f'),_0x4e5034);_0x7c6cd1(ut[_0xd79f('0x5f')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0xd79f('0x12')]['validateContact']=function(_0x2d60b6){if(_[_0xd79f('0x6b')](_0x2d60b6)||_[_0xd79f('0x120')](_0x2d60b6)||!_['isNil'](_0x2d60b6[0x0][_0xd79f('0x86')])&&_[_0xd79f('0x6b')](_0x2d60b6[0x0][_0xd79f('0x86')][_0xd79f('0x2b')])){ut['logger'](_0xd79f('0x121'),_0x2d60b6);return{'isValid':![],'message':_0xd79f('0x122')};}var _0x142753=this[_0xd79f('0x71')][_0x2d60b6[0x0][_0xd79f('0x6d')][_0xd79f('0x2b')]];_0x142753[_0xd79f('0x5f')]=_0xd79f('0x9d');if(_[_0xd79f('0x6b')](_0x142753)){ut[_0xd79f('0x61')](_0xd79f('0x123'),_0x142753);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this['isTrunkReachable'](_0x142753[_0xd79f('0x52')])){ut['logger'](_0xd79f('0x124'),_0xd79f('0x125')+_0x142753[_0xd79f('0x2b')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0xd79f('0x9a')](_0x142753[_0xd79f('0x9b')])){ut['logger'](_0xd79f('0x124'),_0x142753[_0xd79f('0x2b')]+_0xd79f('0x126'));return{'isValid':![],'message':_0xd79f('0x127')};}}if(!ut['isActive'](_0x142753[_0xd79f('0x37')])){ut[_0xd79f('0x61')](_0xd79f('0x128'),_0x142753[_0xd79f('0x2b')]+_0xd79f('0x129'));return{'isValid':![],'message':_0xd79f('0x125')+_0x142753[_0xd79f('0x2b')]+_0xd79f('0x129')};}return{'isValid':!![],'message':_0xd79f('0x12a')};};Preview[_0xd79f('0x12')][_0xd79f('0x105')]=function(_0x5c4bc3,_0x58547b,_0x4cdc0f,_0x50fd67){var _0x173a96=this;return new BPromise(function(_0x2481ce,_0x238e4f){var _0x92ada2=_0x5c4bc3[_0xd79f('0xb5')];var _0x543b12=_0x173a96[_0xd79f('0x9a')](_0x58547b[_0xd79f('0x52')])?util[_0xd79f('0x55')]('SIP/%s/%s%s',_0x58547b['Trunk'][_0xd79f('0x2b')],_[_0xd79f('0x6b')](_0x58547b[_0xd79f('0x12b')])?'':_0x58547b['dialPrefix']['trim']()||'',_0x58547b['dialCutDigit']>0x0?_0x4cdc0f['Contact'][_0xd79f('0x102')][_0xd79f('0x12c')](_0x58547b['dialCutDigit']):_0x4cdc0f[_0xd79f('0x101')][_0xd79f('0x102')]):util[_0xd79f('0x55')](_0xd79f('0x12d'),_[_0xd79f('0x6b')](_0x58547b['TrunkBackup'])?_0x58547b[_0xd79f('0x52')][_0xd79f('0x2b')]:_0x58547b['TrunkBackup'][_0xd79f('0x2b')],_['isNil'](_0x58547b[_0xd79f('0x12b')])?'':_0x58547b[_0xd79f('0x12b')][_0xd79f('0x12e')]()||'',_0x58547b[_0xd79f('0x12f')]>0x0?_0x4cdc0f[_0xd79f('0x101')][_0xd79f('0x102')][_0xd79f('0x12c')](_0x58547b[_0xd79f('0x12f')]):_0x4cdc0f[_0xd79f('0x101')][_0xd79f('0x102')]);var _0xe313ff=_0x173a96[_0xd79f('0x9a')](_0x58547b[_0xd79f('0x52')])?ut[_0xd79f('0x130')](_0x58547b[_0xd79f('0x52')][_0xd79f('0x131')],_0x58547b[_0xd79f('0x39')],_0x58547b[_0xd79f('0x132')]>0x0?ut['getCallerIdRandom'](_0x58547b['dialOriginateCallerIdNumber'],_0x58547b['dialRandomLastDigitCallerIdNumber']):_0x58547b[_0xd79f('0x3a')]):ut[_0xd79f('0x130')](_[_0xd79f('0x6b')](_0x58547b[_0xd79f('0x9b')])?_0x58547b[_0xd79f('0x52')][_0xd79f('0x131')]:_0x58547b['TrunkBackup'][_0xd79f('0x131')],_0x58547b[_0xd79f('0x39')],_0x58547b[_0xd79f('0x132')]>0x0?ut['getCallerIdRandom'](_0x58547b['dialOriginateCallerIdNumber'],_0x58547b[_0xd79f('0x132')]):_0x58547b['dialOriginateCallerIdNumber']);if(_0xe313ff){_0x5c4bc3[_0xd79f('0x133')]=ut['extractCalleridName'](_0xe313ff);_0x5c4bc3['originatecalleridnum']=ut['extractCalleridNumber'](_0xe313ff);}var _0x295237=ut[_0xd79f('0x134')](_0x58547b,_0x4cdc0f,_0x543b12,_0xe313ff,_0x92ada2,_0x5c4bc3);_[_0xd79f('0x135')](_0x5c4bc3,ut['toLowerVariables'](_0x295237));_0x5c4bc3['starttime']=moment()[_0xd79f('0x55')](_0xd79f('0x8d'));ami[_0xd79f('0x78')](ut['variablesAction'](_0x5c4bc3,_0x58547b,_0x295237,_0x5c4bc3[_0xd79f('0xb0')],_0x50fd67))[_0xd79f('0x82')](function(_0x56ea2b){var _0x6d5ade=_0x5c4bc3[_0xd79f('0x136')];if(!_['isNil'](_0x6d5ade)){if(!_[_0xd79f('0x6b')](_0x173a96['agents'][_0x6d5ade])){_0x173a96[_0xd79f('0x1a')][_0x6d5ade][_0xd79f('0x137')]=_0x5c4bc3['calleridnum'];emit(util['format'](_0xd79f('0x138'),_0x173a96['agents'][_0x6d5ade][_0xd79f('0x2b')]),_0xd79f('0x139'),{'destaccountcode':_0x173a96[_0xd79f('0x1a')][_0x6d5ade][_0xd79f('0x13a')],'destconnectedlinenum':_0x5c4bc3[_0xd79f('0x13b')]});}}_0x58547b[_0xd79f('0x4c')]+=0x1;logger[_0xd79f('0x58')]('[originated][increment]',_0x92ada2,_0xd79f('0xc1'),_0x58547b['name'],_0xd79f('0x6f'),_0x58547b[_0xd79f('0x4c')]);_0x2481ce(_0x56ea2b);})['catch'](function(_0x2a9219){ut[_0xd79f('0xf9')](_0x5c4bc3,0xe,'OriginateError');rpcDb[_0xd79f('0xf5')](_0x5c4bc3,_0xd79f('0x13c'));_0x238e4f(_0x2a9219);});});};Preview[_0xd79f('0x12')][_0xd79f('0x22')]=function(_0x1f7741){if(this['actions'][_0x1f7741[_0xd79f('0xb1')]]){this['actions'][_0x1f7741[_0xd79f('0xb1')]][_0xd79f('0x7a')]=_0x1f7741[_0xd79f('0x7a')];}};Preview[_0xd79f('0x12')][_0xd79f('0x1c')]=function(_0x3acd88){var _0xb5964b=this;var _0x37ae34=this['actions'][_0x3acd88[_0xd79f('0x13d')]];if(_0x37ae34){if(_0x37ae34[_0xd79f('0x104')]&&this[_0xd79f('0x1a')][_0x37ae34[_0xd79f('0x104')]]){ut['logLookAgent'](_0x37ae34,this[_0xd79f('0x1a')][_0x37ae34[_0xd79f('0x104')]][_0xd79f('0x2b')],this[_0xd79f('0x1a')][_0x37ae34[_0xd79f('0x104')]]['id']);}var _0x37b7dd=_[_0xd79f('0x13e')](_0x37ae34);_0x37b7dd[_0xd79f('0xb3')]=moment()[_0xd79f('0x55')]('YYYY-MM-DD\x20HH:mm:ss');var _0x5b3de7=_0xb5964b['campaignsPreview'][_0x37ae34[_0xd79f('0x6e')]];if(ut[_0xd79f('0x13f')](_0x3acd88[_0xd79f('0x140')])){if(_0x37ae34[_0xd79f('0xaf')]){rpcDb[_0xd79f('0x118')](_0x37ae34[_0xd79f('0x141')]);}if(_0x37ae34['activeContact']){rpcDb[_0xd79f('0x8b')](_0x37ae34[_0xd79f('0x141')]);}ami['emit']('custom:agentringnoanswer',ut['buildObj'](_0x37ae34,'rejected',this[_0xd79f('0x71')][_0x37ae34['queue']]));this['callProgressDetectingAgent'](_0x37b7dd,_0x5b3de7,_0x3acd88);}else{_0x37ae34[_0xd79f('0x8c')]=moment()['format'](_0xd79f('0x8d'));ut['logAgent'](_0x37b7dd,0x4,_0xd79f('0xbc'));rpcDb[_0xd79f('0xf5')](_0x37b7dd,_0xd79f('0x142'));}}};Preview[_0xd79f('0x12')][_0xd79f('0x1f')]=function(_0x550e77){var _0x598b86=this;var _0x3443b6=this[_0xd79f('0x19')][_0x550e77[_0xd79f('0xb1')]];var _0x1ebf60;if(_0x3443b6){_0x1ebf60=this['campaignsPreview'][_0x3443b6[_0xd79f('0x6e')]];logger[_0xd79f('0x58')](_0xd79f('0x143'),_0x550e77[_0xd79f('0xb1')],_0xd79f('0xc1'),_0x1ebf60[_0xd79f('0x2b')],_0xd79f('0x70'),_0x1ebf60[_0xd79f('0x2f')]);}if(this['actions'][_0x550e77[_0xd79f('0xb1')]]&&_0x550e77[_0xd79f('0xb1')]!==_0x550e77['uniqueid']){if(_0x550e77['cause']==='16'&&this[_0xd79f('0x19')][_0x550e77[_0xd79f('0xb1')]]['dialAnswer']){this[_0xd79f('0x9e')](_0x550e77,_0x550e77[_0xd79f('0xb1')],_0x550e77[_0xd79f('0x144')]);}else if(this[_0xd79f('0x19')][_0x550e77['linkedid']][_0xd79f('0x72')]){logger[_0xd79f('0x58')](_0xd79f('0x145'),_0x550e77[_0xd79f('0xb1')],_0x550e77[_0xd79f('0x144')],_0xd79f('0xc1'),_0x1ebf60[_0xd79f('0x2b')],_0xd79f('0x70'),_0x1ebf60[_0xd79f('0x2f')]);this[_0xd79f('0x9e')](_0x550e77,_0x550e77[_0xd79f('0xb1')],_0x550e77[_0xd79f('0x144')]);}}else if(_0x3443b6&&_[_0xd79f('0x6b')](_0x3443b6[_0xd79f('0x146')])&&_0x1ebf60[_0xd79f('0x147')]&&_0x550e77[_0xd79f('0xb1')]===_0x550e77[_0xd79f('0xb5')]&&_[_0xd79f('0x6b')](_0x550e77[_0xd79f('0xf4')])&&_0x550e77['cause']==='16'&&_0x550e77[_0xd79f('0x148')]==='6'&&_['isUndefined'](_0x3443b6[_0xd79f('0x149')])){if(_0x3443b6[_0xd79f('0xaf')]){rpcDb['unlockContact'](_0x3443b6[_0xd79f('0x141')]);}if(_0x3443b6[_0xd79f('0xb0')]){rpcDb[_0xd79f('0x8b')](_0x3443b6[_0xd79f('0x141')]);}_0x550e77[_0xd79f('0xf4')]='22';this[_0xd79f('0xf1')](_0x3443b6,_0x1ebf60,_0x550e77);}else if(_0x3443b6&&_0x3443b6[_0xd79f('0x149')]){if(_0x550e77[_0xd79f('0x144')]==='16'&&this[_0xd79f('0x19')][_0x550e77[_0xd79f('0xb1')]]['dialAnswer']){logger[_0xd79f('0x58')](_0xd79f('0x14a'),_0x550e77['linkedid'],_0x550e77['cause'],_0xd79f('0xc1'),_0x1ebf60[_0xd79f('0x2b')],_0xd79f('0x70'),_0x1ebf60[_0xd79f('0x2f')]);this[_0xd79f('0x9e')](_0x550e77,_0x550e77[_0xd79f('0xb1')],_0x550e77[_0xd79f('0x144')]);}else if(this[_0xd79f('0x19')][_0x550e77[_0xd79f('0xb1')]][_0xd79f('0x72')]){logger[_0xd79f('0x58')]('[syncHangup][talking][cause]',_0x550e77[_0xd79f('0xb1')],_0x550e77[_0xd79f('0x144')],_0xd79f('0xc1'),_0x1ebf60['name'],_0xd79f('0x70'),_0x1ebf60[_0xd79f('0x2f')]);this['callProgressDetectingCustomer'](_0x550e77,_0x550e77['linkedid'],_0x550e77['cause']);}}};Preview[_0xd79f('0x12')][_0xd79f('0x14b')]=function(_0x1be247){if(this[_0xd79f('0x19')][_0x1be247[_0xd79f('0xf0')]]&&_0x1be247['destlinkedid']!==_0x1be247[_0xd79f('0x14c')]){this[_0xd79f('0x9e')](_0x1be247,_0x1be247['destlinkedid'],_0x1be247['dialstatus']);}};Preview[_0xd79f('0x12')][_0xd79f('0x14d')]=function(_0x78fc5a){if(this[_0xd79f('0x19')][_0x78fc5a[_0xd79f('0xb1')]]&&_0x78fc5a[_0xd79f('0xb1')]!==_0x78fc5a[_0xd79f('0xb5')]&&!this[_0xd79f('0x19')][_0x78fc5a[_0xd79f('0xb1')]][_0xd79f('0x72')]){if(_0x78fc5a[_0xd79f('0x144')]==='1'){this[_0xd79f('0x9e')](_0x78fc5a,_0x78fc5a[_0xd79f('0xb1')],_0x78fc5a[_0xd79f('0x144')]);}}};Preview[_0xd79f('0x12')][_0xd79f('0x14e')]=function(_0x495e05,_0x1e8a7d,_0x41e41f){if(this['actions'][_0x495e05]){if(_[_0xd79f('0x6b')](this['actions'][_0x495e05][_0xd79f('0x14f')])){this[_0xd79f('0x19')][_0x495e05][_0xd79f('0x14f')]={};}this[_0xd79f('0x19')][_0x495e05][_0xd79f('0x14f')][_0x1e8a7d]=_0x41e41f;}};Preview[_0xd79f('0x12')]['syncVarSet']=function(_0x57d550){try{if(!_['isNil'](_0x57d550)){if(ut[_0xd79f('0x150')](_['keys'](_0x57d550[_0xd79f('0x151')])[0x0])){this[_0xd79f('0x14e')](_0x57d550[_0xd79f('0xb5')],_['keys'](_0x57d550[_0xd79f('0x151')])[0x0],_0x57d550[_0xd79f('0x152')]);}}}catch(_0x10ad6d){logger[_0xd79f('0x153')](_0xd79f('0x154'),util[_0xd79f('0x155')](_0x10ad6d,{'showHidden':![],'depth':null}));}};Preview[_0xd79f('0x12')][_0xd79f('0x25')]=function(_0x52fbe1){if(_0x52fbe1){if(this[_0xd79f('0x19')][_0x52fbe1[_0xd79f('0x156')]]){this[_0xd79f('0x19')][_0x52fbe1[_0xd79f('0x156')]][_0xd79f('0x149')]=!![];}}};Preview['prototype'][_0xd79f('0x157')]=function(_0xed82a9){if(_0xed82a9){if(this[_0xd79f('0x19')][_0xed82a9[_0xd79f('0x158')]]){this[_0xd79f('0x19')][_0xed82a9[_0xd79f('0x158')]][_0xd79f('0x149')]=!![];}}};module[_0xd79f('0x159')]=Preview;
\ No newline at end of file
+var _0x735a=['custom:agentcalled','called','Calling','[Preview][execCall][failure]','Call\x20failed','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','execRun','unlockContact','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','trim','substring','dialCutDigit','SIP/%s/%s%s','getCallerId','getCallerIdRandom','dialRandomLastDigitCallerIdNumber','originatecalleridname','originatecalleridnum','toLowerVariables','Action','variablesAction','channelAgent','destconnectedlinenum','calleridnum','user:%s','user:agentconnect','accountcode','[originated][increment]','logLookAgent','clone','isFailure','response','rejected','starttime','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','syncVarSet','keys','variable','[syncVarSet][Preview]','transfertargetlinkedid','transfererlinkedid','exports','util','bluebird','uuid','md5','ioredis','../../../config/environment','../../../config/logger','./rpcDb','./util/util','redis','socket.io-emitter','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','bind','hangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','varset','attendedtransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','answered','available','loggedIn','pTalking','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','sendMessageOneNotActive','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','hasOwnProperty','dialMethod','booked','setMessage','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','originated','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','status','channel','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','getContactRecallMe','agentReadyId','then','length','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','catch','disableContact','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','scheduledAt','unlockAgent','linkedid','ANSWER','responsetime','answertime','\x20Queue','custom:agentconnect','connect','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','sumDuration','talktime','sumBillable','BUSY','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','rescheduleContact','dialBusyRetryFrequency','activeContact','NOANSWER','countnoanswerretry','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','CANCEL','countagentrejectretry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','uniqueid','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','lookAgent','execCall','Queue:\x20','\x20IdHopper:\x20','idContact'];(function(_0x526524,_0x3f3389){var _0x2a689d=function(_0x3a20f0){while(--_0x3a20f0){_0x526524['push'](_0x526524['shift']());}};_0x2a689d(++_0x3f3389);}(_0x735a,0x193));var _0xa735=function(_0x10f3d0,_0x4fe1e1){_0x10f3d0=_0x10f3d0-0x0;var _0x3710dd=_0x735a[_0x10f3d0];return _0x3710dd;};'use strict';var util=require(_0xa735('0x0'));var _=require('lodash');var BPromise=require(_0xa735('0x1'));var uuid=require(_0xa735('0x2'));var moment=require('moment');var md5=require(_0xa735('0x3'));var Redis=require(_0xa735('0x4'));var config=require(_0xa735('0x5'));var logger=require('../../../config/logger')('preview');var loggerAction=require(_0xa735('0x6'))('actionPreview');var ami=require('../ami');var rpcDb=require(_0xa735('0x7'));var Action=require('./action');var ut=require(_0xa735('0x8'));config[_0xa735('0x9')]=_['defaults'](config[_0xa735('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xa735('0xa'))(new Redis(config[_0xa735('0x9')]));var Sequence=function(){};Sequence[_0xa735('0xb')][_0xa735('0xc')]=function(_0x267427){this[_0xa735('0xd')]=this[_0xa735('0xd')]?this['tail']['finally'](_0x267427):_0x267427();};function Preview(_0xe99e13){this[_0xa735('0xe')]=new Sequence();this[_0xa735('0xf')]=_0xe99e13[_0xa735('0x10')];this[_0xa735('0x11')]=_0xe99e13[_0xa735('0x11')];this[_0xa735('0x12')]={};this['agents']=_0xe99e13[_0xa735('0x13')];this[_0xa735('0x14')]=0x0;ami['on']('originateresponse',this[_0xa735('0x15')][_0xa735('0x16')](this));ami['on'](_0xa735('0x17'),this['syncHangup'][_0xa735('0x16')](this));ami['on'](_0xa735('0x18'),this[_0xa735('0x19')]['bind'](this));ami['on'](_0xa735('0x1a'),this[_0xa735('0x1b')][_0xa735('0x16')](this));ami['on'](_0xa735('0x1c'),this[_0xa735('0x1d')][_0xa735('0x16')](this));ami['on'](_0xa735('0x1e'),this['syncVarSet'][_0xa735('0x16')](this));ami['on'](_0xa735('0x1f'),this['syncAttendedTransfer'][_0xa735('0x16')](this));ami['on'](_0xa735('0x20'),this[_0xa735('0x21')][_0xa735('0x16')](this));this[_0xa735('0x22')](this[_0xa735('0xf')]);}function emit(_0x281d8f,_0x5df816,_0xa70b5a){io['to'](_0x281d8f)[_0xa735('0x23')](_0x5df816,_0xa70b5a);}function emitCampaignPreview(_0x40b528){if(_0x40b528[_0xa735('0x24')]===_0xa735('0x25')){var _0x4dcb74={'id':_0x40b528['id'],'name':_0x40b528[_0xa735('0x26')],'strategy':_0x40b528['strategy'],'answered':_0x40b528[_0xa735('0x27')],'available':_0x40b528[_0xa735('0x28')],'loggedIn':_0x40b528[_0xa735('0x29')],'pTalking':_0x40b528[_0xa735('0x2a')],'sumBillable':_0x40b528['sumBillable'],'sumDuration':_0x40b528['sumDuration'],'sumHoldTime':_0x40b528[_0xa735('0x2b')]||0x0,'talking':_0x40b528[_0xa735('0x2c')],'total':_0x40b528[_0xa735('0x2d')],'type':_0x40b528[_0xa735('0x24')],'unmanaged':_0x40b528[_0xa735('0x2e')],'abandoned':_0x40b528[_0xa735('0x2f')],'waiting':_0x40b528[_0xa735('0x30')],'loggedInDb':_0x40b528[_0xa735('0x31')],'dialActive':_0x40b528[_0xa735('0x32')],'dialMethod':_0x40b528['dialMethod'],'dialOriginateCallerIdName':_0x40b528[_0xa735('0x33')],'dialOriginateCallerIdNumber':_0x40b528[_0xa735('0x34')],'dialOriginateTimeout':_0x40b528['dialOriginateTimeout'],'dialPrefix':_0x40b528[_0xa735('0x35')],'outboundAnswerAgiCallsDay':_0x40b528[_0xa735('0x36')],'outboundAnswerCallsDay':_0x40b528['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x40b528[_0xa735('0x37')],'outboundBusyCallsDay':_0x40b528[_0xa735('0x38')],'outboundCongestionCallsDay':_0x40b528[_0xa735('0x39')],'outboundDropCallsDayACS':_0x40b528[_0xa735('0x3a')],'outboundDropCallsDayCallersExit':_0x40b528[_0xa735('0x3b')],'outboundDropCallsDayTimeout':_0x40b528[_0xa735('0x3c')],'outboundNoAnswerCallsDay':_0x40b528[_0xa735('0x3d')],'outboundNoSuchCallsDay':_0x40b528['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x40b528[_0xa735('0x3e')],'outboundReCallsDay':_0x40b528[_0xa735('0x3f')],'outboundRejectCallsDay':_0x40b528[_0xa735('0x40')],'outboundUnknownCallsDay':_0x40b528[_0xa735('0x41')],'outboundAbandonedCallsDay':_0x40b528[_0xa735('0x42')],'predictiveIntervalAnsweredCalls':_0x40b528[_0xa735('0x43')],'predictiveIntervalAvgHoldtime':_0x40b528['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x40b528[_0xa735('0x44')],'predictiveIntervalDroppedCallsCallersExit':_0x40b528['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x40b528[_0xa735('0x45')],'predictiveIntervalErlangCalls':_0x40b528[_0xa735('0x46')],'predictiveIntervalErlangCallsDroppedCalls':_0x40b528['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x40b528[_0xa735('0x47')],'predictiveIntervalMultiplicativeFactor':_0x40b528['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x40b528[_0xa735('0x48')],'predictiveIntervalAvailable':_0x40b528['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x40b528[_0xa735('0x49')],'message':_0x40b528['message'],'originated':_0x40b528['originated'],'erlangCalls':_0x40b528[_0xa735('0x4a')],'erlangCallToSecond':_0x40b528[_0xa735('0x4b')],'erlangAbandonmentRate':_0x40b528['erlangAbandonmentRate'],'erlangBusyFactor':_0x40b528[_0xa735('0x4c')],'startPredictive':_0x40b528[_0xa735('0x4d')],'startProgressive':_0x40b528['startProgressive']};if(_0x40b528[_0xa735('0x4e')]){_0x4dcb74[_0xa735('0x4e')]={'id':_0x40b528[_0xa735('0x4e')]['id'],'name':_0x40b528[_0xa735('0x4e')]['name'],'active':_0x40b528[_0xa735('0x4e')][_0xa735('0x4f')],'callerid':_0x40b528[_0xa735('0x4e')][_0xa735('0x50')]};}if(_0x40b528['Interval']){_0x4dcb74[_0xa735('0x51')]={'id':_0x40b528[_0xa735('0x51')]['id'],'name':_0x40b528[_0xa735('0x51')][_0xa735('0x26')]};}var _0x53399f=md5(JSON[_0xa735('0x52')](_0x4dcb74));if(_0x40b528['md5']!==_0x53399f){_0x40b528[_0xa735('0x3')]=_0x53399f;emit(util[_0xa735('0x53')](_0xa735('0x54'),_0x4dcb74[_0xa735('0x26')]),_0xa735('0x55'),_0x4dcb74);}}}function emitVoiceQueueChannelRemove(_0x4011bb){logger[_0xa735('0x56')](_0xa735('0x57'),JSON[_0xa735('0x52')](_0x4011bb));emit(util['format']('voice:queue:%s',_0x4011bb[_0xa735('0x26')]),_0xa735('0x58'),_0x4011bb);io['emit']('voice_queue_presence:remove',_0x4011bb);}function notSendMessagesQueue(_0x3bd8a6){if(_0x3bd8a6[_0xa735('0x59')]){if(_0x3bd8a6['originated']===0x0&&_0x3bd8a6[_0xa735('0x2a')]===0x0){_0x3bd8a6['sendMessageOneNotActive']=![];_0x3bd8a6[_0xa735('0x28')]=0x0;_0x3bd8a6[_0xa735('0x5a')]=0x0;_0x3bd8a6[_0xa735('0x5b')]=_0xa735('0x5c');ut[_0xa735('0x5d')](_0xa735('0x5e'),_0x3bd8a6['name']+'\x20is\x20not\x20active');}else{_0x3bd8a6['message']='IS_DISACTIVED';ut[_0xa735('0x5d')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x3bd8a6[_0xa735('0x26')]+_0xa735('0x5f'));}emitCampaignPreview(_0x3bd8a6);}}Preview['prototype'][_0xa735('0x22')]=function(){var _0x9ec851=this;setInterval(function(){_0x9ec851['syncCampaigns']();},0x7cf);};Preview[_0xa735('0xb')]['syncCampaigns']=function(){var _0x511ca2=this[_0xa735('0xf')];this[_0xa735('0x14')]+=0x1;for(var _0xc99f13 in _0x511ca2){if(_0x511ca2[_0xa735('0x60')](_0xc99f13)&&(_0x511ca2[_0xc99f13]['dialMethod']==='preview'||_0x511ca2[_0xc99f13][_0xa735('0x61')]===_0xa735('0x62'))&&_0x511ca2[_0xc99f13][_0xa735('0x24')]===_0xa735('0x25')){if(this[_0xa735('0x14')]>0x7){this[_0xa735('0x14')]=0x0;this['clearZombieChannels']();}}if(_0x511ca2[_0xa735('0x60')](_0xc99f13)&&_0x511ca2[_0xc99f13][_0xa735('0x61')]==='preview'&&_0x511ca2[_0xc99f13][_0xa735('0x24')]===_0xa735('0x25')){if(_0x511ca2[_0xc99f13][_0xa735('0x32')]){this[_0xa735('0x63')](_0x511ca2[_0xc99f13]);this[_0xa735('0x64')](_0x511ca2[_0xc99f13]);}else{notSendMessagesQueue(_0x511ca2[_0xc99f13]);}}}};Preview[_0xa735('0xb')][_0xa735('0x65')]=function(_0xdf18f3){var _0x40de11=this;this[_0xa735('0xe')][_0xa735('0xc')](function(){if(!_[_0xa735('0x66')](_0x40de11[_0xa735('0x12')][_0xdf18f3])){loggerAction[_0xa735('0x56')](_0xa735('0x67'),_0xdf18f3,_0xa735('0x68'),_0x40de11[_0xa735('0x12')][_0xdf18f3][_0xa735('0x69')],_0xa735('0x6a'),JSON[_0xa735('0x52')](_0x40de11[_0xa735('0xf')][_0x40de11[_0xa735('0x12')][_0xdf18f3][_0xa735('0x69')]][_0xa735('0x6b')]),_0xa735('0x6c'),JSON[_0xa735('0x52')](_0x40de11[_0xa735('0xf')][_0x40de11[_0xa735('0x12')][_0xdf18f3][_0xa735('0x69')]][_0xa735('0x2a')]),JSON[_0xa735('0x52')](_0x40de11[_0xa735('0x12')][_0xdf18f3][_0xa735('0x6d')]),JSON[_0xa735('0x52')](_[_0xa735('0x6e')](_0x40de11[_0xa735('0x12')][_0xdf18f3],[_0xa735('0x6f'),_0xa735('0x70'),_0xa735('0x71'),_0xa735('0x72')])));return ami['Action']({'action':_0xa735('0x73'),'channel':_0x40de11['actions'][_0xdf18f3][_0xa735('0x74')]})['catch'](function(_0x49f6fc){if(_0x49f6fc[_0xa735('0x5b')]===_0xa735('0x75')){setTimeout(function(){if(_0x40de11[_0xa735('0x12')][_0xdf18f3]){ut[_0xa735('0x76')](_0x40de11[_0xa735('0xf')][_0x40de11[_0xa735('0x12')][_0xdf18f3][_0xa735('0x69')]],'[clearZombieChannel]');if(_0x40de11[_0xa735('0x12')][_0xdf18f3][_0xa735('0x6d')]===!![]){ut[_0xa735('0x77')](_0x40de11[_0xa735('0xf')][_0x40de11[_0xa735('0x12')][_0xdf18f3][_0xa735('0x69')]],_0xa735('0x78'));ut[_0xa735('0x79')](_0xa735('0x7a')+_0xdf18f3,_0x40de11[_0xa735('0x12')][_0xdf18f3][_0xa735('0x69')]);}ut['loggerError'](_0xa735('0x7b')+_0xdf18f3,_0x40de11[_0xa735('0x12')][_0xdf18f3]['queue']);delete _0x40de11['actions'][_0xdf18f3];}},0x2328);}});}});};Preview[_0xa735('0xb')][_0xa735('0x7c')]=function(){var _0x147346=this;loggerAction[_0xa735('0x56')](_0xa735('0x7d'),_['size'](this[_0xa735('0x12')]));for(var _0x4b05c3 in this['actions']){if(_0x147346[_0xa735('0x12')][_0xa735('0x60')](_0x4b05c3)){_0x147346['clearZombieChannel'](_0x4b05c3);}}};Preview['prototype'][_0xa735('0x64')]=function(_0x28ab40){var _0x17a302=this;rpcDb[_0xa735('0x7e')](_0x28ab40['id'],ut[_0xa735('0x7f')](this[_0xa735('0x13')]))[_0xa735('0x80')](function(_0x4d431d){if(!_['isNil'](_0x4d431d)){for(var _0x260336=0x0;_0x260336<_0x4d431d[_0xa735('0x81')];_0x260336+=0x1){if(ut['getDiff'](_0x4d431d[_0x260336][_0xa735('0x82')])<_0x28ab40[_0xa735('0x83')]*0x3c){if(_0x4d431d[_0x260336][_0xa735('0x84')]&&!_0x4d431d[_0x260336][_0xa735('0x84')][_0xa735('0x85')]){_0x17a302[_0xa735('0x86')](_0x4d431d[_0x260336]['id'])[_0xa735('0x80')](ut[_0xa735('0x87')](_0xa735('0x88')))[_0xa735('0x89')](ut[_0xa735('0x87')](_0xa735('0x88')));}else{rpcDb[_0xa735('0x8a')](_0x4d431d[_0x260336]['id']);}}else{var _0x48f865=new Action(_0x4d431d[_0x260336],_0x28ab40);_0x48f865['starttime']=moment()[_0xa735('0x53')](_0xa735('0x8b'));_0x28ab40[_0xa735('0x3f')]+=0x1;ut[_0xa735('0x8c')](_0x48f865,0x17,_0xa735('0x8d'));if(_0x28ab40[_0xa735('0x8e')]){rpcDb['rescheduleContactInQueue'](ut['createBody'](_0x4d431d[_0x260336]));rpcDb[_0xa735('0x8f')](_0x48f865,_0xa735('0x90'));}else{ut['logCustomer'](_0x48f865,0x16,'RecallFailedTimeout');rpcDb[_0xa735('0x8f')](_0x48f865,_0xa735('0x91'));rpcDb[_0xa735('0x92')](_0x48f865,_0xa735('0x91'));}}}}})['catch'](ut[_0xa735('0x87')](_0xa735('0x93')));};Preview[_0xa735('0xb')][_0xa735('0x63')]=function(_0x10e55d){_0x10e55d['sendMessageOneNotActive']=!![];if(ut[_0xa735('0x94')](_0x10e55d[_0xa735('0x29')])){_0x10e55d['message']='AGENTS_NOT_LOGGED';}else if(!ut[_0xa735('0x95')](_0x10e55d[_0xa735('0x32')])){_0x10e55d[_0xa735('0x5b')]=_0xa735('0x5c');}else if(!this[_0xa735('0x96')](_0x10e55d['Trunk'])){if(!this['isTrunkReachable'](_0x10e55d[_0xa735('0x97')])){_0x10e55d[_0xa735('0x5b')]=_0xa735('0x98');}else{_0x10e55d['message']=_0xa735('0x99');}}else{_0x10e55d['message']=_0xa735('0x99');}emitCampaignPreview(_0x10e55d);};Preview[_0xa735('0xb')][_0xa735('0x9a')]=function(_0x1ee7df,_0x2fe40f,_0x4e2434){var _0x35070d=this;var _0x33ef2e=this[_0xa735('0x12')][_0x2fe40f];var _0x3e4eb8=this[_0xa735('0xf')][_0x33ef2e['queue']];var _0x2878ad;if(_0x3e4eb8){switch(_0x4e2434){case'1':_0x3e4eb8[_0xa735('0x9b')]+=0x1;_0x33ef2e[_0xa735('0x9c')]+=0x1;_0x33ef2e['countglobal']=ut[_0xa735('0x9d')](_0x33ef2e);ut['logCustomer'](_0x33ef2e,0x0,_0xa735('0x9e'));ami['emit'](_0xa735('0x9f'),ut[_0xa735('0xa0')](_0x33ef2e,_0xa735('0xa1')));rpcDb[_0xa735('0x8f')](_0x33ef2e,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0xa735('0x9d')](_0x33ef2e)>=_0x3e4eb8['dialGlobalMaxRetry']){_0x2878ad=ut[_0xa735('0xa2')](_0x33ef2e,0xf,_0xa735('0xa3'));rpcDb['createCustomerFinal'](_0x2878ad,_0xa735('0xa4'));}else{if(_0x33ef2e[_0xa735('0x9c')]>=_0x3e4eb8[_0xa735('0xa5')]){rpcDb[_0xa735('0x92')](_0x33ef2e,_0xa735('0xa4'));}else{rpcDb['rescheduleContact'](ut[_0xa735('0xa6')](_0x33ef2e,'countnosuchnumberretry',_0x3e4eb8['dialNoSuchNumberRetryFrequency']),_0x33ef2e[_0xa735('0xa7')],_0x33ef2e['activeContact']);}}delete this[_0xa735('0x12')][_0x1ee7df[_0xa735('0xa8')]];break;case _0xa735('0xa9'):var _0x2e0e33=moment()[_0xa735('0x53')](_0xa735('0x8b'));_0x33ef2e[_0xa735('0xaa')]=_0x2e0e33;_0x33ef2e[_0xa735('0xab')]=_0x2e0e33;_0x33ef2e['dialAnswer']=!![];_0x3e4eb8['pTalking']+=0x1;logger[_0xa735('0x56')]('[syncHangup][talking][increment]',_0x33ef2e['uniqueid'],_0xa735('0xac'),_0x3e4eb8[_0xa735('0x26')],_0xa735('0x6c'),_0x3e4eb8[_0xa735('0x2a')]);ami['emit'](_0xa735('0xad'),ut[_0xa735('0xa0')](_0x33ef2e,_0xa735('0xae'),this[_0xa735('0xf')][_0x33ef2e[_0xa735('0x69')]]));if(_0x3e4eb8['acw']){ami[_0xa735('0x23')]('custom:agentConnectPreview',ut[_0xa735('0xaf')](_0x33ef2e));}break;case'16':ami[_0xa735('0x23')](_0xa735('0xb0'),ut['buildObj'](_0x33ef2e,_0xa735('0xb1'),this[_0xa735('0xf')][_0x33ef2e[_0xa735('0x69')]]));emitVoiceQueueChannelRemove(ut[_0xa735('0xa0')](_0x33ef2e,_0xa735('0xb1')));_0x3e4eb8[_0xa735('0xb2')]+=0x1;_0x3e4eb8[_0xa735('0x2d')]+=0x1;_0x3e4eb8[_0xa735('0x27')]+=0x1;ut[_0xa735('0x77')](_0x3e4eb8,_0xa735('0xb3'));_0x33ef2e[_0xa735('0xb4')]=ut['totalGlobal'](_0x33ef2e);ut[_0xa735('0x8c')](_0x33ef2e,0x4,_0xa735('0xb5'));rpcDb[_0xa735('0x8f')](_0x33ef2e,_0xa735('0xb6'));rpcDb[_0xa735('0x92')](_0x33ef2e,_0xa735('0xb7'));rpcDb['crateCustomerReportQueue'](_0x33ef2e);_0x3e4eb8[_0xa735('0xb8')]+=_0x33ef2e[_0xa735('0xb9')];_0x3e4eb8[_0xa735('0xba')]+=_0x33ef2e['talktime'];logger['info']('[syncHangup][talking][decrement]',_0x33ef2e['uniqueid'],_0xa735('0xac'),_0x3e4eb8[_0xa735('0x26')],'pTalking:\x20',_0x3e4eb8[_0xa735('0x2a')]);delete this[_0xa735('0x12')][_0x1ee7df[_0xa735('0xa8')]];break;case _0xa735('0xbb'):_0x3e4eb8[_0xa735('0x38')]+=0x1;_0x33ef2e['countbusyretry']+=0x1;_0x33ef2e['countglobal']=ut['totalGlobal'](_0x33ef2e);ut[_0xa735('0x8c')](_0x33ef2e,0x5,_0xa735('0xbc'));ami[_0xa735('0x23')](_0xa735('0xbd'),ut[_0xa735('0xa0')](_0x33ef2e,_0xa735('0xbe')));rpcDb[_0xa735('0x8f')](_0x33ef2e,_0xa735('0xbf'));if(ut[_0xa735('0x9d')](_0x33ef2e)>=_0x3e4eb8[_0xa735('0xc0')]){_0x2878ad=ut[_0xa735('0xa2')](_0x33ef2e,0xf,_0xa735('0xa3'));rpcDb['createCustomerFinal'](_0x2878ad,_0xa735('0xc1'));}else{if(_0x33ef2e[_0xa735('0xc2')]>=_0x3e4eb8[_0xa735('0xc3')]){rpcDb[_0xa735('0x92')](_0x33ef2e,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0xa735('0xc4')](ut[_0xa735('0xa6')](_0x33ef2e,_0xa735('0xc2'),_0x3e4eb8[_0xa735('0xc5')]),_0x33ef2e[_0xa735('0xa7')],_0x33ef2e[_0xa735('0xc6')]);}}break;case _0xa735('0xc7'):_0x3e4eb8[_0xa735('0x3d')]+=0x1;_0x33ef2e[_0xa735('0xc8')]+=0x1;_0x33ef2e[_0xa735('0xb4')]=ut['totalGlobal'](_0x33ef2e);ut[_0xa735('0x8c')](_0x33ef2e,0x3,_0xa735('0xc9'));ami[_0xa735('0x23')](_0xa735('0xca'),ut[_0xa735('0xa0')](_0x33ef2e,'noanswer'));rpcDb[_0xa735('0x8f')](_0x33ef2e,_0xa735('0xcb'));if(ut['totalGlobal'](_0x33ef2e)>=_0x3e4eb8[_0xa735('0xc0')]){_0x2878ad=ut[_0xa735('0xa2')](_0x33ef2e,0xf,_0xa735('0xa3'));rpcDb['createCustomerFinal'](_0x2878ad,_0xa735('0xcc'));}else{if(_0x33ef2e['countnoanswerretry']>=_0x3e4eb8['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0x33ef2e,_0xa735('0xcb'));}else{rpcDb[_0xa735('0xc4')](ut['scheduledAt'](_0x33ef2e,'countnoanswerretry',_0x3e4eb8[_0xa735('0xcd')]),_0x33ef2e[_0xa735('0xa7')],_0x33ef2e['activeContact']);}}break;case _0xa735('0xce'):_0x3e4eb8[_0xa735('0x39')]+=0x1;_0x33ef2e[_0xa735('0xcf')]+=0x1;_0x33ef2e[_0xa735('0xb4')]=ut[_0xa735('0x9d')](_0x33ef2e);ut[_0xa735('0x8c')](_0x33ef2e,0x8,_0xa735('0xd0'));ami[_0xa735('0x23')]('custom:agentcongestion',ut[_0xa735('0xa0')](_0x33ef2e,'congestion'));rpcDb[_0xa735('0x8f')](_0x33ef2e,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0xa735('0x9d')](_0x33ef2e)>=_0x3e4eb8[_0xa735('0xc0')]){_0x2878ad=ut[_0xa735('0xa2')](_0x33ef2e,0xf,'Global');rpcDb['createCustomerFinal'](_0x2878ad,_0xa735('0xd1'));}else{if(_0x33ef2e['countcongestionretry']>=_0x3e4eb8[_0xa735('0xd2')]){rpcDb[_0xa735('0x92')](_0x33ef2e,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0xa735('0xc4')](ut['scheduledAt'](_0x33ef2e,_0xa735('0xcf'),_0x3e4eb8[_0xa735('0xc5')]),_0x33ef2e[_0xa735('0xa7')],_0x33ef2e['activeContact']);}}break;case _0xa735('0xd3'):_0x3e4eb8['outboundRejectCallsDay']+=0x1;_0x33ef2e[_0xa735('0xd4')]+=0x1;_0x33ef2e[_0xa735('0xb4')]=ut[_0xa735('0x9d')](_0x33ef2e);ut[_0xa735('0x8c')](_0x33ef2e,0x14,'AgentReject');ami['emit'](_0xa735('0xd5'),ut[_0xa735('0xa0')](_0x33ef2e,_0xa735('0xd6')));rpcDb[_0xa735('0x8f')](_0x33ef2e,_0xa735('0xd7'));if(ut[_0xa735('0x9d')](_0x33ef2e)>=_0x3e4eb8[_0xa735('0xc0')]){_0x2878ad=ut['cloneAction'](_0x33ef2e,0x14,_0xa735('0xd8'));rpcDb[_0xa735('0x92')](_0x2878ad,_0xa735('0xd9'));}else{if(_0x33ef2e['countagentrejectretry']>=_0x3e4eb8[_0xa735('0xda')]){rpcDb[_0xa735('0x92')](_0x33ef2e,_0xa735('0xd9'));}else{rpcDb[_0xa735('0xc4')](ut[_0xa735('0xa6')](_0x33ef2e,_0xa735('0xd4'),_0x3e4eb8['dialAgentRejectRetryFrequency']),_0x33ef2e['unlockAgent'],_0x33ef2e[_0xa735('0xc6')]);}}break;case'ABANDONED':_0x3e4eb8['outboundAbandonedCallsDay']+=0x1;_0x33ef2e[_0xa735('0xdb')]+=0x1;_0x33ef2e['countglobal']=ut[_0xa735('0x9d')](_0x33ef2e);ut[_0xa735('0x8c')](_0x33ef2e,0xb,_0xa735('0xdc'));rpcDb['createCustomerHistory'](_0x33ef2e,_0xa735('0xdd'));if(ut[_0xa735('0x9d')](_0x33ef2e)>=_0x3e4eb8[_0xa735('0xc0')]){_0x2878ad=ut[_0xa735('0xa2')](_0x33ef2e,0xf,_0xa735('0xa3'));rpcDb[_0xa735('0x92')](_0x2878ad,_0xa735('0xdd'));}else{if(_0x33ef2e[_0xa735('0xde')]>=_0x3e4eb8[_0xa735('0xdf')]){rpcDb[_0xa735('0x92')](_0x33ef2e,_0xa735('0xdd'));}else{rpcDb[_0xa735('0xc4')](ut[_0xa735('0xa6')](_0x33ef2e,_0xa735('0xdb'),_0x3e4eb8['dialAbandonedRetryFrequency']),_0x33ef2e[_0xa735('0xa7')],_0x33ef2e['activeContact']);}}break;case'18':_0x3e4eb8[_0xa735('0x41')]+=0x1;_0x33ef2e[_0xa735('0xe0')]+=0x1;_0x33ef2e[_0xa735('0xb4')]=ut[_0xa735('0x9d')](_0x33ef2e);ut[_0xa735('0x8c')](_0x33ef2e,0x12,_0x1ee7df[_0xa735('0xe1')]||_0x1ee7df[_0xa735('0xe2')]);ami[_0xa735('0x23')](_0xa735('0xe3'),ut[_0xa735('0xa0')](_0x33ef2e,_0xa735('0xe4')));rpcDb[_0xa735('0x8f')](_0x33ef2e,_0xa735('0xe5'));if(ut[_0xa735('0x9d')](_0x33ef2e)>=_0x3e4eb8[_0xa735('0xc0')]){_0x2878ad=ut[_0xa735('0xa2')](_0x33ef2e,0xf,'Global');rpcDb['createCustomerFinal'](_0x2878ad,_0xa735('0xe5'));}else{rpcDb[_0xa735('0x92')](_0x33ef2e,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0xa735('0x12')][_0x1ee7df[_0xa735('0xa8')]];break;case'19':_0x3e4eb8[_0xa735('0x41')]+=0x1;_0x33ef2e[_0xa735('0xb4')]=ut['totalGlobal'](_0x33ef2e);ut[_0xa735('0x8c')](_0x33ef2e,0x13,_0x1ee7df[_0xa735('0xe1')]||_0x1ee7df['dialstatus']);ami[_0xa735('0x23')](_0xa735('0xe3'),ut['buildObj'](_0x33ef2e,_0xa735('0xe4')));rpcDb[_0xa735('0x8f')](_0x33ef2e,_0xa735('0xe6'));if(ut[_0xa735('0x9d')](_0x33ef2e)>=_0x3e4eb8[_0xa735('0xc0')]){_0x2878ad=ut[_0xa735('0xa2')](_0x33ef2e,0xf,'Global');rpcDb[_0xa735('0x92')](_0x2878ad,_0xa735('0xe6'));}else{rpcDb[_0xa735('0x92')](_0x33ef2e,'[callProgressDetectingCustomer][machine]');}delete this['actions'][_0x1ee7df[_0xa735('0xa8')]];break;default:if(_0x33ef2e[_0xa735('0x6d')]){ut[_0xa735('0x77')](_0x3e4eb8,'[default]');ut[_0xa735('0x79')](_0xa735('0xe7')+_0x3e4eb8[_0xa735('0x26')],_0x1ee7df);}_0x3e4eb8[_0xa735('0x41')]+=0x1;_0x33ef2e[_0xa735('0xb4')]=ut[_0xa735('0x9d')](_0x33ef2e);ut[_0xa735('0x8c')](_0x33ef2e,0xc,_0x1ee7df['cause-txt']||_0x1ee7df[_0xa735('0xe2')]);rpcDb[_0xa735('0x8f')](_0x33ef2e,_0xa735('0xe8'));if(ut[_0xa735('0x9d')](_0x33ef2e)>=_0x3e4eb8[_0xa735('0xc0')]){_0x2878ad=ut['cloneAction'](_0x33ef2e,0xf,_0xa735('0xa3'));rpcDb['createCustomerFinal'](_0x2878ad,_0xa735('0xe9'));}else{rpcDb['createCustomerFinal'](_0x33ef2e,_0xa735('0xe9'));}delete this['actions'][_0x1ee7df[_0xa735('0xa8')]];}if(!(_0x33ef2e[_0xa735('0x6d')]&&_0x4e2434==='16')){ut['updateOriginated'](_0x3e4eb8,_0xa735('0xea'));logger[_0xa735('0x56')](_0xa735('0xeb'),_0x33ef2e[_0xa735('0xec')],'\x20Queue',_0x3e4eb8[_0xa735('0x26')],'originated:\x20',_0x3e4eb8[_0xa735('0x6b')]);}if(_0x4e2434!==_0xa735('0xa9')){delete this[_0xa735('0x12')][_0x1ee7df[_0xa735('0xa8')]];delete this[_0xa735('0x12')][_0x1ee7df[_0xa735('0xed')]];}}};Preview['prototype'][_0xa735('0xee')]=function(_0x4b6ab3,_0x5c9b9e,_0x372634){if(_[_0xa735('0xef')](_0x5c9b9e)&&'object'!==typeof _0x5c9b9e){return;}if(_[_0xa735('0xef')](_0x372634)&&_0xa735('0xf0')!==typeof _0x372634){return;}switch(_0x372634[_0xa735('0xf1')]){case'0':ut['logAgent'](_0x4b6ab3,0x0,'NoSuchNumber');rpcDb[_0xa735('0xf2')](_0x4b6ab3,_0xa735('0xf3'));break;case'3':ut[_0xa735('0xf4')](_0x4b6ab3,0x3,_0xa735('0xc9'));rpcDb[_0xa735('0xf2')](_0x4b6ab3,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut['logAgent'](_0x4b6ab3,0x5,'Busy');rpcDb[_0xa735('0xf2')](_0x4b6ab3,_0xa735('0xf5'));break;case'8':ut[_0xa735('0xf4')](_0x4b6ab3,0x8,'Congestion');rpcDb['createAgentHistory'](_0x4b6ab3,_0xa735('0xf6'));break;case'22':ut[_0xa735('0xf4')](_0x4b6ab3,0x16,_0xa735('0xf7'));rpcDb[_0xa735('0xf2')](_0x4b6ab3,_0xa735('0xf8'));break;default:ut['logAgent'](_0x4b6ab3,0xc,_0x372634[_0xa735('0xf1')]);rpcDb[_0xa735('0xf2')](_0x4b6ab3,_0xa735('0xf6'));}ut['updateOriginated'](_0x5c9b9e,_0xa735('0xf9'));logger['info'](_0xa735('0xfa'),_0x4b6ab3[_0xa735('0xec')],'\x20Queue',_0x5c9b9e[_0xa735('0x26')],_0xa735('0x6a'),_0x5c9b9e['originated']);delete this[_0xa735('0x12')][_0x4b6ab3['uniqueid']];};Preview[_0xa735('0xb')][_0xa735('0xfb')]=function(_0x438326,_0xb344d3,_0x3f1dc6,_0x3c22bc,_0x202936){var _0x41fc9c=this;return new BPromise(function(_0x3468c8,_0x28e10b){if(_[_0xa735('0x66')](_0xb344d3)||_[_0xa735('0x66')](_0xb344d3[_0xa735('0xfc')])||_[_0xa735('0x66')](_0xb344d3['Contact'][_0xa735('0xfd')])||_['isNil'](_0xb344d3[_0xa735('0x71')])){_0x28e10b(ut[_0xa735('0x5b')]('Contact\x20is\x20undefined',_0x3c22bc,_0x202936));return;}var _0x4f20f3=uuid['v4']();var _0x2f0da8=_0x41fc9c['campaignsPreview'][_0xb344d3[_0xa735('0x68')]['name']];var _0x1e9c88=_0x3f1dc6?_0x41fc9c[_0xa735('0x13')][_0x3f1dc6]['id']:undefined;_0x41fc9c[_0xa735('0x12')][_0x4f20f3]=new Action(_0xb344d3,_0x2f0da8,_0x4f20f3,_0x3f1dc6,_0x1e9c88);var _0x3b5219=_0x41fc9c[_0xa735('0x12')][_0x4f20f3];_0x3b5219[_0xa735('0xa7')]=_0x3c22bc;_0x3b5219[_0xa735('0xc6')]=_0x202936;_0x3b5219[_0xa735('0xfe')]=_0x3f1dc6;if(_['isEmpty'](_0x438326)){_0x41fc9c[_0xa735('0xff')](_0x3b5219,_0x2f0da8,_0xb344d3,_0x3f1dc6)[_0xa735('0x80')](function(_0x3b8188){logger[_0xa735('0x56')]('[Preview][execCall][success]',_0xa735('0x100')+_0x3b5219[_0xa735('0x69')]+_0xa735('0x101')+_0x3b5219[_0xa735('0x102')],JSON[_0xa735('0x52')](_0x3b8188));ami[_0xa735('0x23')](_0xa735('0x103'),ut[_0xa735('0xa0')](_0x3b5219,_0xa735('0x104'),_0x41fc9c[_0xa735('0xf')][_0x3b5219[_0xa735('0x69')]]));_0x3468c8(ut[_0xa735('0x5b')](_0xa735('0x105')));})[_0xa735('0x89')](function(_0x526491){ut[_0xa735('0x5d')](_0xa735('0x106'),_0x526491);_0x28e10b(ut['message'](_0xa735('0x107'),_0x3c22bc,_0x202936));});}else{_0x2f0da8[_0xa735('0x37')]+=0x1;ut['logBlacklist'](_0x3b5219);rpcDb[_0xa735('0x108')](_0x3b5219,_0xa735('0x109'));delete _0x41fc9c[_0xa735('0x12')][_0x4f20f3];_0x28e10b(ut[_0xa735('0x5b')](_0xa735('0x10a'),_0x3c22bc,_0x202936));}});};Preview[_0xa735('0xb')][_0xa735('0x96')]=function(_0x58b02b){return!_['isNil'](_0x58b02b)&&!_[_0xa735('0x66')](_0x58b02b[_0xa735('0x26')])&&!_['isNil'](_0x58b02b[_0xa735('0x4f')])&&_0x58b02b['active']&&!_[_0xa735('0x66')](this['trunks'][util['format']('SIP/%s',_0x58b02b[_0xa735('0x26')])])&&!_[_0xa735('0x66')](this['trunks'][util[_0xa735('0x53')](_0xa735('0x10b'),_0x58b02b['name'])]['status'])&&(this['trunks'][util[_0xa735('0x53')](_0xa735('0x10b'),_0x58b02b[_0xa735('0x26')])][_0xa735('0x73')]===_0xa735('0x10c')||this[_0xa735('0x11')][util[_0xa735('0x53')](_0xa735('0x10b'),_0x58b02b['name'])]['status']==='unmonitored');};Preview[_0xa735('0xb')][_0xa735('0x86')]=function(_0x356d25,_0x82f9f0){var _0x4c9df4=this;return new BPromise(function(_0x1747f6,_0x54a7ec){_0x4c9df4[_0xa735('0x10d')](_0x356d25,_0x82f9f0)[_0xa735('0x80')](function(_0x75d60d){_0x1747f6(_[_0xa735('0x6e')](_0x75d60d,['message']));})[_0xa735('0x89')](function(_0x20d689){if(_0x20d689['unlock']){rpcDb[_0xa735('0x10e')](_0x356d25);}if(_0x20d689['active']){rpcDb[_0xa735('0x8a')](_0x356d25);}_0x54a7ec(_[_0xa735('0x6e')](_0x20d689,[_0xa735('0x5b')]));});});};Preview['prototype'][_0xa735('0x10d')]=function(_0x4c6b1b,_0x2e26d6){var _0x3b09ec=this;return new BPromise(function(_0x5c3ea0,_0x242934){var _0x41185d,_0x2976b3;rpcDb['getContactPreview'](_0x4c6b1b)[_0xa735('0x80')](function(_0x5e2293){if(!_[_0xa735('0x66')](_0x5e2293[0x0])){_0x2976b3=_0x5e2293[0x0][_0xa735('0x10f')]?![]:!![];_0x41185d=_0x5e2293[0x0]['recallme']?!![]:![];_0x41185d=_0x2e26d6?!![]:_0x41185d;}var _0x1a761f=_0x3b09ec[_0xa735('0x110')](_0x5e2293);if(_0x1a761f[_0xa735('0x111')]){rpcDb[_0xa735('0x112')](_[_0xa735('0x6e')](_0x5e2293[0x0],[_0xa735('0x71'),_0xa735('0x113')]))[_0xa735('0x80')](function(_0x483a96){_0x3b09ec[_0xa735('0xfb')](_0x483a96,_0x5e2293[0x0],_0x2e26d6,_0x2976b3,_0x41185d)['then'](function(_0x2f158e){_0x5c3ea0(_0x2f158e);})[_0xa735('0x89')](function(_0x3a1ba0){_0x242934(_0x3a1ba0);});})[_0xa735('0x89')](function(_0x2f2681){ut['logger'](_0xa735('0x114'),_0x2f2681);_0x242934(ut[_0xa735('0x5b')](_0xa735('0x115'),_0x2976b3,_0x41185d));});}else{_0x242934(ut[_0xa735('0x5b')](_0x1a761f[_0xa735('0x5b')],_0x2976b3,_0x41185d));}})[_0xa735('0x89')](function(_0x47f666){ut['logger'](_0xa735('0x116'),_0x47f666);_0x242934(ut[_0xa735('0x5b')](_0xa735('0x115'),![],!![]));});});};Preview[_0xa735('0xb')][_0xa735('0x110')]=function(_0x36ba68){if(_['isNil'](_0x36ba68)||_[_0xa735('0x117')](_0x36ba68)||!_['isNil'](_0x36ba68[0x0][_0xa735('0x84')])&&_['isNil'](_0x36ba68[0x0]['Agent'][_0xa735('0x26')])){ut['logger']('[Preview][validateContact][Empty\x20Contact]',_0x36ba68);return{'isValid':![],'message':'Empty\x20Contact'};}var _0x214125=this[_0xa735('0xf')][_0x36ba68[0x0][_0xa735('0x68')][_0xa735('0x26')]];_0x214125['message']=_0xa735('0x99');if(_[_0xa735('0x66')](_0x214125)){ut['logger']('[Preview][validateContact][Empty\x20Campaign]',_0x214125);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xa735('0x96')](_0x214125['Trunk'])){ut[_0xa735('0x5d')](_0xa735('0x118'),_0xa735('0x119')+_0x214125[_0xa735('0x26')]+_0xa735('0x11a'));if(!this['isTrunkReachable'](_0x214125[_0xa735('0x97')])){ut[_0xa735('0x5d')](_0xa735('0x118'),_0x214125[_0xa735('0x26')]+_0xa735('0x11b'));return{'isValid':![],'message':_0xa735('0x11c')};}}if(!ut[_0xa735('0x95')](_0x214125[_0xa735('0x32')])){ut[_0xa735('0x5d')](_0xa735('0x11d'),_0x214125[_0xa735('0x26')]+_0xa735('0x11e'));return{'isValid':![],'message':_0xa735('0x119')+_0x214125['name']+_0xa735('0x11e')};}return{'isValid':!![],'message':_0xa735('0x11f')};};Preview[_0xa735('0xb')][_0xa735('0xff')]=function(_0x2a298a,_0x5c80fa,_0x315b78,_0x1372ed){var _0x3b071c=this;return new BPromise(function(_0x5628d9,_0x53d932){var _0x256896=_0x2a298a[_0xa735('0xec')];var _0x1fb0dd=_0x3b071c[_0xa735('0x96')](_0x5c80fa['Trunk'])?util['format']('SIP/%s/%s%s',_0x5c80fa[_0xa735('0x4e')][_0xa735('0x26')],_[_0xa735('0x66')](_0x5c80fa[_0xa735('0x35')])?'':_0x5c80fa[_0xa735('0x35')][_0xa735('0x120')]()||'',_0x5c80fa['dialCutDigit']>0x0?_0x315b78[_0xa735('0xfc')][_0xa735('0xfd')][_0xa735('0x121')](_0x5c80fa[_0xa735('0x122')]):_0x315b78[_0xa735('0xfc')]['phone']):util['format'](_0xa735('0x123'),_[_0xa735('0x66')](_0x5c80fa[_0xa735('0x97')])?_0x5c80fa[_0xa735('0x4e')][_0xa735('0x26')]:_0x5c80fa[_0xa735('0x97')]['name'],_['isNil'](_0x5c80fa[_0xa735('0x35')])?'':_0x5c80fa[_0xa735('0x35')][_0xa735('0x120')]()||'',_0x5c80fa[_0xa735('0x122')]>0x0?_0x315b78[_0xa735('0xfc')][_0xa735('0xfd')]['substring'](_0x5c80fa['dialCutDigit']):_0x315b78['Contact']['phone']);var _0x4c847d=_0x3b071c[_0xa735('0x96')](_0x5c80fa[_0xa735('0x4e')])?ut[_0xa735('0x124')](_0x5c80fa[_0xa735('0x4e')][_0xa735('0x50')],_0x5c80fa[_0xa735('0x33')],_0x5c80fa['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0xa735('0x125')](_0x5c80fa[_0xa735('0x34')],_0x5c80fa['dialRandomLastDigitCallerIdNumber']):_0x5c80fa[_0xa735('0x34')]):ut[_0xa735('0x124')](_['isNil'](_0x5c80fa[_0xa735('0x97')])?_0x5c80fa[_0xa735('0x4e')][_0xa735('0x50')]:_0x5c80fa[_0xa735('0x97')]['callerid'],_0x5c80fa[_0xa735('0x33')],_0x5c80fa[_0xa735('0x126')]>0x0?ut[_0xa735('0x125')](_0x5c80fa[_0xa735('0x34')],_0x5c80fa[_0xa735('0x126')]):_0x5c80fa[_0xa735('0x34')]);if(_0x4c847d){_0x2a298a[_0xa735('0x127')]=ut['extractCalleridName'](_0x4c847d);_0x2a298a[_0xa735('0x128')]=ut['extractCalleridNumber'](_0x4c847d);}var _0x4eb700=ut['addVariables'](_0x5c80fa,_0x315b78,_0x1fb0dd,_0x4c847d,_0x256896,_0x2a298a);_['merge'](_0x2a298a,ut[_0xa735('0x129')](_0x4eb700));_0x2a298a['starttime']=moment()[_0xa735('0x53')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0xa735('0x12a')](ut[_0xa735('0x12b')](_0x2a298a,_0x5c80fa,_0x4eb700,_0x2a298a[_0xa735('0xc6')],_0x1372ed))['then'](function(_0x347a55){var _0x50ba96=_0x2a298a[_0xa735('0x12c')];if(!_[_0xa735('0x66')](_0x50ba96)){if(!_[_0xa735('0x66')](_0x3b071c[_0xa735('0x13')][_0x50ba96])){_0x3b071c[_0xa735('0x13')][_0x50ba96][_0xa735('0x12d')]=_0x2a298a[_0xa735('0x12e')];emit(util[_0xa735('0x53')](_0xa735('0x12f'),_0x3b071c[_0xa735('0x13')][_0x50ba96]['name']),_0xa735('0x130'),{'destaccountcode':_0x3b071c[_0xa735('0x13')][_0x50ba96][_0xa735('0x131')],'destconnectedlinenum':_0x2a298a[_0xa735('0x12e')]});}}_0x5c80fa[_0xa735('0x6b')]+=0x1;logger[_0xa735('0x56')](_0xa735('0x132'),_0x256896,_0xa735('0xac'),_0x5c80fa[_0xa735('0x26')],_0xa735('0x6a'),_0x5c80fa[_0xa735('0x6b')]);_0x5628d9(_0x347a55);})[_0xa735('0x89')](function(_0x30fb2a){ut[_0xa735('0xf4')](_0x2a298a,0xe,'OriginateError');rpcDb[_0xa735('0xf2')](_0x2a298a,'[originateFailure][logOriginateFailure]');_0x53d932(_0x30fb2a);});});};Preview['prototype'][_0xa735('0x1d')]=function(_0x37d1e4){if(this[_0xa735('0x12')][_0x37d1e4[_0xa735('0xa8')]]){this[_0xa735('0x12')][_0x37d1e4[_0xa735('0xa8')]][_0xa735('0x74')]=_0x37d1e4[_0xa735('0x74')];}};Preview[_0xa735('0xb')][_0xa735('0x15')]=function(_0x4bf208){var _0x1bb1d6=this;var _0x53eae1=this[_0xa735('0x12')][_0x4bf208['actionid']];if(_0x53eae1){if(_0x53eae1['lookAgent']&&this['agents'][_0x53eae1[_0xa735('0xfe')]]){ut[_0xa735('0x133')](_0x53eae1,this[_0xa735('0x13')][_0x53eae1[_0xa735('0xfe')]]['name'],this[_0xa735('0x13')][_0x53eae1['lookAgent']]['id']);}var _0x539c33=_[_0xa735('0x134')](_0x53eae1);_0x539c33[_0xa735('0xaa')]=moment()[_0xa735('0x53')]('YYYY-MM-DD\x20HH:mm:ss');var _0x3a4e10=_0x1bb1d6[_0xa735('0xf')][_0x53eae1[_0xa735('0x69')]];if(ut[_0xa735('0x135')](_0x4bf208[_0xa735('0x136')])){if(_0x53eae1[_0xa735('0xa7')]){rpcDb[_0xa735('0x10e')](_0x53eae1[_0xa735('0x102')]);}if(_0x53eae1['activeContact']){rpcDb[_0xa735('0x8a')](_0x53eae1['idContact']);}ami[_0xa735('0x23')]('custom:agentringnoanswer',ut[_0xa735('0xa0')](_0x53eae1,_0xa735('0x137'),this['campaignsPreview'][_0x53eae1['queue']]));this[_0xa735('0xee')](_0x539c33,_0x3a4e10,_0x4bf208);}else{_0x53eae1[_0xa735('0x138')]=moment()['format'](_0xa735('0x8b'));ut[_0xa735('0xf4')](_0x539c33,0x4,_0xa735('0xb5'));rpcDb[_0xa735('0xf2')](_0x539c33,_0xa735('0x139'));}}};Preview[_0xa735('0xb')]['syncHangup']=function(_0x5ce2db){var _0x59158d=this;var _0x8f37f4=this[_0xa735('0x12')][_0x5ce2db[_0xa735('0xa8')]];var _0x1905e4;if(_0x8f37f4){_0x1905e4=this[_0xa735('0xf')][_0x8f37f4[_0xa735('0x69')]];logger[_0xa735('0x56')](_0xa735('0x13a'),_0x5ce2db[_0xa735('0xa8')],_0xa735('0xac'),_0x1905e4[_0xa735('0x26')],_0xa735('0x6c'),_0x1905e4[_0xa735('0x2a')]);}if(this[_0xa735('0x12')][_0x5ce2db[_0xa735('0xa8')]]&&_0x5ce2db[_0xa735('0xa8')]!==_0x5ce2db[_0xa735('0xec')]){if(_0x5ce2db[_0xa735('0x13b')]==='16'&&this[_0xa735('0x12')][_0x5ce2db[_0xa735('0xa8')]][_0xa735('0x6d')]){this['callProgressDetectingCustomer'](_0x5ce2db,_0x5ce2db[_0xa735('0xa8')],_0x5ce2db['cause']);}else if(this[_0xa735('0x12')][_0x5ce2db[_0xa735('0xa8')]][_0xa735('0x6d')]){logger[_0xa735('0x56')](_0xa735('0x13c'),_0x5ce2db[_0xa735('0xa8')],_0x5ce2db[_0xa735('0x13b')],_0xa735('0xac'),_0x1905e4['name'],'pTalking:\x20',_0x1905e4[_0xa735('0x2a')]);this[_0xa735('0x9a')](_0x5ce2db,_0x5ce2db[_0xa735('0xa8')],_0x5ce2db['cause']);}}else if(_0x8f37f4&&_[_0xa735('0x66')](_0x8f37f4[_0xa735('0x13d')])&&_0x1905e4[_0xa735('0x13e')]&&_0x5ce2db[_0xa735('0xa8')]===_0x5ce2db[_0xa735('0xec')]&&_[_0xa735('0x66')](_0x5ce2db[_0xa735('0xf1')])&&_0x5ce2db[_0xa735('0x13b')]==='16'&&_0x5ce2db['channelstate']==='6'&&_['isUndefined'](_0x8f37f4[_0xa735('0x13f')])){if(_0x8f37f4[_0xa735('0xa7')]){rpcDb[_0xa735('0x10e')](_0x8f37f4[_0xa735('0x102')]);}if(_0x8f37f4[_0xa735('0xc6')]){rpcDb[_0xa735('0x8a')](_0x8f37f4['idContact']);}_0x5ce2db[_0xa735('0xf1')]='22';this[_0xa735('0xee')](_0x8f37f4,_0x1905e4,_0x5ce2db);}else if(_0x8f37f4&&_0x8f37f4[_0xa735('0x13f')]){if(_0x5ce2db['cause']==='16'&&this[_0xa735('0x12')][_0x5ce2db[_0xa735('0xa8')]][_0xa735('0x6d')]){logger[_0xa735('0x56')](_0xa735('0x140'),_0x5ce2db[_0xa735('0xa8')],_0x5ce2db[_0xa735('0x13b')],'\x20Queue',_0x1905e4[_0xa735('0x26')],'pTalking:\x20',_0x1905e4[_0xa735('0x2a')]);this['callProgressDetectingCustomer'](_0x5ce2db,_0x5ce2db[_0xa735('0xa8')],_0x5ce2db[_0xa735('0x13b')]);}else if(this[_0xa735('0x12')][_0x5ce2db['linkedid']][_0xa735('0x6d')]){logger[_0xa735('0x56')]('[syncHangup][talking][cause]',_0x5ce2db[_0xa735('0xa8')],_0x5ce2db['cause'],'\x20Queue',_0x1905e4[_0xa735('0x26')],_0xa735('0x6c'),_0x1905e4[_0xa735('0x2a')]);this[_0xa735('0x9a')](_0x5ce2db,_0x5ce2db[_0xa735('0xa8')],_0x5ce2db[_0xa735('0x13b')]);}}};Preview[_0xa735('0xb')][_0xa735('0x1b')]=function(_0x13881e){if(this[_0xa735('0x12')][_0x13881e[_0xa735('0xed')]]&&_0x13881e[_0xa735('0xed')]!==_0x13881e[_0xa735('0x141')]){this[_0xa735('0x9a')](_0x13881e,_0x13881e[_0xa735('0xed')],_0x13881e[_0xa735('0xe2')]);}};Preview[_0xa735('0xb')][_0xa735('0x19')]=function(_0x3e55ad){if(this['actions'][_0x3e55ad[_0xa735('0xa8')]]&&_0x3e55ad['linkedid']!==_0x3e55ad[_0xa735('0xec')]&&!this[_0xa735('0x12')][_0x3e55ad[_0xa735('0xa8')]][_0xa735('0x6d')]){if(_0x3e55ad['cause']==='1'){this[_0xa735('0x9a')](_0x3e55ad,_0x3e55ad['linkedid'],_0x3e55ad[_0xa735('0x13b')]);}}};Preview[_0xa735('0xb')][_0xa735('0x142')]=function(_0x38588f,_0x402f21,_0x38fdb8){if(this[_0xa735('0x12')][_0x38588f]){if(_[_0xa735('0x66')](this[_0xa735('0x12')][_0x38588f][_0xa735('0x143')])){this[_0xa735('0x12')][_0x38588f][_0xa735('0x143')]={};}this[_0xa735('0x12')][_0x38588f][_0xa735('0x143')][_0x402f21]=_0x38fdb8;}};Preview['prototype'][_0xa735('0x144')]=function(_0x54e66f){try{if(!_['isNil'](_0x54e66f)){if(ut['filterKey'](_[_0xa735('0x145')](_0x54e66f[_0xa735('0x146')])[0x0])){this[_0xa735('0x142')](_0x54e66f[_0xa735('0xec')],_[_0xa735('0x145')](_0x54e66f[_0xa735('0x146')])[0x0],_0x54e66f['value']);}}}catch(_0x356f23){logger['error'](_0xa735('0x147'),util['inspect'](_0x356f23,{'showHidden':![],'depth':null}));}};Preview['prototype']['syncAttendedTransfer']=function(_0x4955d4){if(_0x4955d4){if(this[_0xa735('0x12')][_0x4955d4[_0xa735('0x148')]]){this[_0xa735('0x12')][_0x4955d4[_0xa735('0x148')]][_0xa735('0x13f')]=!![];}}};Preview['prototype'][_0xa735('0x21')]=function(_0x50dd27){if(_0x50dd27){if(this[_0xa735('0x12')][_0x50dd27[_0xa735('0x149')]]){this['actions'][_0x50dd27['transfererlinkedid']][_0xa735('0x13f')]=!![];}}};module[_0xa735('0x14a')]=Preview;
\ No newline at end of file
index 4044b51..d38268c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdf91=['../rpc/voiceQueueRt','../rpc/agentReportPreview','error','resolve','then','catch','[createHistory]\x20','createHistory','moveContactManagedDialer','[moveContactManagedDialer]\x20','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','UserId','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','calleridnum','calleridname','queue','answertime','queuecallerleaveAt','queuecallercomplete','membername','context','from-sip','exten','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','../../../config/logger','preview','lodash','../rpc/cmHopperBlack'];(function(_0x516048,_0x4d20a5){var _0x2197f4=function(_0x2b7586){while(--_0x2b7586){_0x516048['push'](_0x516048['shift']());}};_0x2197f4(++_0x4d20a5);}(_0xdf91,0x12d));var _0x1df9=function(_0x40cd5f,_0x3c217f){_0x40cd5f=_0x40cd5f-0x0;var _0x291bd5=_0xdf91[_0x40cd5f];return _0x291bd5;};'use strict';var util=require(_0x1df9('0x0'));var BPromise=require('bluebird');var logger=require(_0x1df9('0x1'))(_0x1df9('0x2'));var _=require(_0x1df9('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x1df9('0x4'));var voiceQueueRt=require(_0x1df9('0x5'));var agentReportPreview=require(_0x1df9('0x6'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x7f2605){return function(_0x34a925){logger[_0x1df9('0x7')](_0x7f2605,util['inspect'](_0x34a925,{'showHidden':![],'depth':null}));};}function create(_0x3863d3){return BPromise[_0x1df9('0x8')]()[_0x1df9('0x9')](cmHopperHistory['createHistory'](_0x3863d3))[_0x1df9('0xa')](loggerCatch(_0x1df9('0xb')));}function createAgent(_0x3d8b9f){return BPromise[_0x1df9('0x8')]()['then'](agentReportPreview[_0x1df9('0xc')](_0x3d8b9f))[_0x1df9('0xa')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x2e8726){return BPromise['resolve']()['then'](cmHopper[_0x1df9('0xd')](_0x2e8726,!![]))['catch'](loggerCatch(_0x1df9('0xe')));}exports['checkIsBlackList']=function(_0x2761b1){return BPromise['resolve']()['then'](cmHopperBlack['checkIsBlackList'](_0x2761b1))[_0x1df9('0xa')](loggerCatch(_0x1df9('0xf')));};exports['getContactPreview']=function(_0x42d134){return BPromise[_0x1df9('0x8')]()[_0x1df9('0x9')](cmHopper[_0x1df9('0x10')](_0x42d134))[_0x1df9('0xa')](loggerCatch(_0x1df9('0x11')));};exports[_0x1df9('0xc')]=function(_0x8905d7,_0x3dd96d){create(_0x8905d7)[_0x1df9('0xa')](loggerCatch(_0x3dd96d));moveContact(_0x8905d7)[_0x1df9('0xa')](loggerCatch(_0x3dd96d));};exports['createAgentHistory']=function(_0xb7b1db,_0x13b278){createAgent(_0xb7b1db)[_0x1df9('0xa')](loggerCatch(_0x13b278));};exports[_0x1df9('0x12')]=function(_0x3d150c,_0x4aaf61){create(_0x3d150c)['catch'](loggerCatch(_0x4aaf61));};exports['createCustomerFinal']=function(_0x4c1c16,_0x337b3d){moveContact(_0x4c1c16)[_0x1df9('0xa')](loggerCatch(_0x337b3d));};exports['rescheduleContact']=function(_0x50d9b6,_0xf79699,_0x22ad46){if(_0xf79699){_0x50d9b6[_0x1df9('0x13')]=null;}if(_0x22ad46){_0x50d9b6[_0x1df9('0x14')]=![];}return BPromise[_0x1df9('0x8')]()[_0x1df9('0x9')](cmHopper[_0x1df9('0x15')](_0x50d9b6))['catch'](loggerCatch(_0x1df9('0x16')));};exports[_0x1df9('0x17')]=function(_0x32b147){return BPromise[_0x1df9('0x8')]()[_0x1df9('0x9')](cmHopper[_0x1df9('0x17')](_0x32b147))[_0x1df9('0xa')](loggerCatch(_0x1df9('0x18')));};exports[_0x1df9('0x19')]=function(_0x470867){return BPromise[_0x1df9('0x8')]()[_0x1df9('0x9')](cmHopper[_0x1df9('0x19')]({'UserId':null},_0x470867,0x1))[_0x1df9('0xa')](loggerCatch(_0x1df9('0x1a')));};exports[_0x1df9('0x1b')]=function(_0x54f24d){return BPromise[_0x1df9('0x8')]()[_0x1df9('0x9')](cmHopper[_0x1df9('0x19')]({'active':![]},_0x54f24d,0x1))[_0x1df9('0xa')](loggerCatch(_0x1df9('0x1c')));};exports[_0x1df9('0x1d')]=function(_0x301312){var _0x5e7055={};_0x5e7055[_0x1df9('0x1e')]=_0x301312[_0x1df9('0x1e')];_0x5e7055['uniqueid']=_0x301312['uniqueid'];_0x5e7055['calleridnum']=_0x301312[_0x1df9('0x1f')];_0x5e7055['calleridname']=_0x301312[_0x1df9('0x20')];_0x5e7055[_0x1df9('0x21')]=_0x301312[_0x1df9('0x21')];_0x5e7055['queuecallerjoinAt']=_0x301312[_0x1df9('0x22')];_0x5e7055[_0x1df9('0x23')]=_0x301312['answertime'];_0x5e7055[_0x1df9('0x24')]=0x1;_0x5e7055['queuecallercompleteAt']=_0x301312['endtime'];_0x5e7055['connectedlinename']=_0x301312[_0x1df9('0x25')];_0x5e7055[_0x1df9('0x26')]=_0x1df9('0x27');_0x5e7055[_0x1df9('0x28')]='xcally-motion-preview';_0x5e7055['holdtime']=0x0;_0x5e7055[_0x1df9('0x29')]=0x1;_0x5e7055[_0x1df9('0x2a')]=_0x301312[_0x1df9('0x25')];_0x5e7055[_0x1df9('0x2b')]=_0x1df9('0x2c');return BPromise['resolve']()[_0x1df9('0x9')](voiceQueueReport[_0x1df9('0x2d')](_0x5e7055))['catch'](loggerCatch(_0x1df9('0x2e')));};exports['getContactRecallMe']=function(_0xf1d123,_0x4bdb62){return BPromise[_0x1df9('0x8')]()[_0x1df9('0x9')](cmHopper[_0x1df9('0x2f')](_0xf1d123,_0x4bdb62))[_0x1df9('0xa')](loggerCatch(_0x1df9('0x30')));};exports[_0x1df9('0x31')]=function(_0x71cf96){return BPromise['resolve']()[_0x1df9('0x9')](cmHopper['rescheduleContact'](_0x71cf96,!![],!![]))['catch'](loggerCatch(_0x1df9('0x32')));};
\ No newline at end of file
+var _0xf938=['queuecallercompleteAt','endtime','connectedlinename','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','membername','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','../../../config/logger','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect','then','createHistory','catch','[createHistory]\x20','[moveContactManagedDialer]\x20','checkIsBlackList','resolve','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','active','rescheduleContact','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','queuecallerleaveAt','queuecallercomplete'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xf938,0x7e));var _0x8f93=function(_0x3dd23c,_0x18c32f){_0x3dd23c=_0x3dd23c-0x0;var _0x520bf8=_0xf938[_0x3dd23c];return _0x520bf8;};'use strict';var util=require(_0x8f93('0x0'));var BPromise=require(_0x8f93('0x1'));var logger=require(_0x8f93('0x2'))('preview');var _=require('lodash');var cmHopper=require(_0x8f93('0x3'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0x8f93('0x4'));var cmHopperBlack=require(_0x8f93('0x5'));var voiceQueueRt=require(_0x8f93('0x6'));var agentReportPreview=require(_0x8f93('0x7'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x329575){return function(_0x4e0350){logger[_0x8f93('0x8')](_0x329575,util[_0x8f93('0x9')](_0x4e0350,{'showHidden':![],'depth':null}));};}function create(_0x117e09){return BPromise['resolve']()[_0x8f93('0xa')](cmHopperHistory[_0x8f93('0xb')](_0x117e09))[_0x8f93('0xc')](loggerCatch(_0x8f93('0xd')));}function createAgent(_0x49b239){return BPromise['resolve']()[_0x8f93('0xa')](agentReportPreview[_0x8f93('0xb')](_0x49b239))['catch'](loggerCatch(_0x8f93('0xd')));}function moveContact(_0x3cc0f9){return BPromise['resolve']()[_0x8f93('0xa')](cmHopper['moveContactManagedDialer'](_0x3cc0f9,!![]))['catch'](loggerCatch(_0x8f93('0xe')));}exports[_0x8f93('0xf')]=function(_0x541d2b){return BPromise[_0x8f93('0x10')]()['then'](cmHopperBlack[_0x8f93('0xf')](_0x541d2b))[_0x8f93('0xc')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x8f93('0x11')]=function(_0x290264){return BPromise['resolve']()[_0x8f93('0xa')](cmHopper[_0x8f93('0x11')](_0x290264))[_0x8f93('0xc')](loggerCatch(_0x8f93('0x12')));};exports[_0x8f93('0xb')]=function(_0x338e5d,_0x135e8a){create(_0x338e5d)['catch'](loggerCatch(_0x135e8a));moveContact(_0x338e5d)[_0x8f93('0xc')](loggerCatch(_0x135e8a));};exports[_0x8f93('0x13')]=function(_0x18b375,_0x5c779c){createAgent(_0x18b375)[_0x8f93('0xc')](loggerCatch(_0x5c779c));};exports[_0x8f93('0x14')]=function(_0x386148,_0x540127){create(_0x386148)[_0x8f93('0xc')](loggerCatch(_0x540127));};exports['createCustomerFinal']=function(_0x2db908,_0x1fc766){moveContact(_0x2db908)[_0x8f93('0xc')](loggerCatch(_0x1fc766));};exports['rescheduleContact']=function(_0x201a1f,_0x594a59,_0x191f8d){if(_0x594a59){_0x201a1f['UserId']=null;}if(_0x191f8d){_0x201a1f[_0x8f93('0x15')]=![];}return BPromise['resolve']()[_0x8f93('0xa')](cmHopper[_0x8f93('0x16')](_0x201a1f))[_0x8f93('0xc')](loggerCatch(_0x8f93('0x17')));};exports[_0x8f93('0x18')]=function(_0x4aa536){return BPromise[_0x8f93('0x10')]()[_0x8f93('0xa')](cmHopper[_0x8f93('0x18')](_0x4aa536))[_0x8f93('0xc')](loggerCatch(_0x8f93('0x19')));};exports[_0x8f93('0x1a')]=function(_0x4bca19){return BPromise[_0x8f93('0x10')]()[_0x8f93('0xa')](cmHopper['unlockContact']({'UserId':null},_0x4bca19,0x1))[_0x8f93('0xc')](loggerCatch(_0x8f93('0x1b')));};exports[_0x8f93('0x1c')]=function(_0x36ed28){return BPromise[_0x8f93('0x10')]()[_0x8f93('0xa')](cmHopper[_0x8f93('0x1a')]({'active':![]},_0x36ed28,0x1))[_0x8f93('0xc')](loggerCatch(_0x8f93('0x1d')));};exports[_0x8f93('0x1e')]=function(_0x2dee25){var _0x475ccd={};_0x475ccd[_0x8f93('0x1f')]=_0x2dee25[_0x8f93('0x1f')];_0x475ccd[_0x8f93('0x20')]=_0x2dee25[_0x8f93('0x20')];_0x475ccd[_0x8f93('0x21')]=_0x2dee25[_0x8f93('0x21')];_0x475ccd['calleridname']=_0x2dee25['calleridname'];_0x475ccd['queue']=_0x2dee25['queue'];_0x475ccd['queuecallerjoinAt']=_0x2dee25['answertime'];_0x475ccd[_0x8f93('0x22')]=_0x2dee25['answertime'];_0x475ccd[_0x8f93('0x23')]=0x1;_0x475ccd[_0x8f93('0x24')]=_0x2dee25[_0x8f93('0x25')];_0x475ccd[_0x8f93('0x26')]=_0x2dee25['membername'];_0x475ccd[_0x8f93('0x27')]=_0x8f93('0x28');_0x475ccd[_0x8f93('0x29')]=_0x8f93('0x2a');_0x475ccd[_0x8f93('0x2b')]=0x0;_0x475ccd[_0x8f93('0x2c')]=0x1;_0x475ccd[_0x8f93('0x2d')]=_0x2dee25[_0x8f93('0x2e')];_0x475ccd[_0x8f93('0x2f')]=_0x8f93('0x30');return BPromise[_0x8f93('0x10')]()[_0x8f93('0xa')](voiceQueueReport[_0x8f93('0x31')](_0x475ccd))[_0x8f93('0xc')](loggerCatch(_0x8f93('0x32')));};exports[_0x8f93('0x33')]=function(_0x5c84ad,_0x4bf2d4){return BPromise[_0x8f93('0x10')]()[_0x8f93('0xa')](cmHopper[_0x8f93('0x33')](_0x5c84ad,_0x4bf2d4))[_0x8f93('0xc')](loggerCatch(_0x8f93('0x34')));};exports[_0x8f93('0x35')]=function(_0x37480b){return BPromise[_0x8f93('0x10')]()[_0x8f93('0xa')](cmHopper[_0x8f93('0x16')](_0x37480b,!![],!![]))[_0x8f93('0xc')](loggerCatch('[rescheduleContactInQueue]\x20'));};
\ No newline at end of file
index cabc749..c3c3afc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5248=['variablesAction','RECALL','calleridname','uniqueid','originate','channelAgent','from-sip','totalGlobal','countcongestionretry','countnoanswerretry','countagentrejectretry','Global','active','add','minutes','ListId','decrementTalkink','pTalking','buildObj','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','agentReadyId','not_inuse','status','reachable','getDiff','createBody','CampaignId','filterKey','idContact','campaigntype','dialAnswer','scheduledat','countglobal','callbackuniqueid','callbackat','recallme','xmd-queue','xmd-listid','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','replace','random','match','extractCalleridNumber','util','lodash','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','inspect','logger','info','logger2','getCallerId','isEmpty','isUndefined','string','\x22%s\x22\x20<%s>','format','isActive','isNil','Queue','name','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','updateOriginated','originated','error','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','endtime','logAgent','responsetime','ringtime','talktime','answertime','isFailure','Failure'];(function(_0x2ffa17,_0x35b3a8){var _0x3a783b=function(_0x16d13d){while(--_0x16d13d){_0x2ffa17['push'](_0x2ffa17['shift']());}};_0x3a783b(++_0x35b3a8);}(_0x5248,0x1c6));var _0x8524=function(_0x4340f0,_0x2c6471){_0x4340f0=_0x4340f0-0x0;var _0x21d3e4=_0x5248[_0x4340f0];return _0x21d3e4;};'use strict';var util=require(_0x8524('0x0'));var _=require(_0x8524('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')(_0x8524('0x2'));var ipAgi=process[_0x8524('0x3')][_0x8524('0x4')]||_0x8524('0x5');function getSeconds(_0x587b42,_0x5b5171){var _0x1fe5c7=moment(_0x587b42)[_0x8524('0x6')](0x0);var _0x4fa0f2=moment(_0x5b5171)[_0x8524('0x6')](0x0);return _0x1fe5c7[_0x8524('0x7')](_0x4fa0f2,_0x8524('0x8'));}exports[_0x8524('0x9')]=function(_0x298f0a){return function(_0x5a104c){logger['error'](_0x298f0a,util[_0x8524('0xa')](_0x5a104c,{'showHidden':![],'depth':null}));};};exports[_0x8524('0xb')]=function(_0x2d591e,_0x158cd7){logger[_0x8524('0xc')](_0x2d591e,util[_0x8524('0xa')](_0x158cd7,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x2bb2d0,_0x504bcf){logger['error'](_0x2bb2d0,util['inspect'](_0x504bcf,{'showHidden':![],'depth':null}));};exports[_0x8524('0xd')]=function(_0x319962){return function(_0x51c08a){logger[_0x8524('0xc')](_0x319962,util['inspect'](_0x51c08a,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x4f6898,_0x258d31,_0x31501d){return{'message':_0x4f6898,'unlock':_0x258d31,'active':_0x31501d};};exports[_0x8524('0xe')]=function(_0x46f4b0,_0xe27241,_0x5e056b){if(!_['isUndefined'](_0x5e056b)&&'string'===typeof _0x5e056b&&!_[_0x8524('0xf')](_0x5e056b)){if(!_[_0x8524('0x10')](_0xe27241)&&_0x8524('0x11')===typeof _0xe27241&&!_[_0x8524('0xf')](_0xe27241)){return util['format'](_0x8524('0x12'),_0xe27241,_0x5e056b);}return util[_0x8524('0x13')](_0x8524('0x12'),_0x5e056b,_0x5e056b);}if(!_[_0x8524('0x10')](_0x46f4b0)&&'string'===typeof _0x46f4b0&&!_[_0x8524('0xf')](_0x46f4b0)){return _0x46f4b0;}return'\x22\x22\x20<>';};exports[_0x8524('0x14')]=function(_0x423e97){if(_[_0x8524('0x15')](_0x423e97)){return![];}return _0x423e97;};exports['addVariables']=function(_0x4e7651,_0x1d9194,_0x5b2f37,_0x37e192,_0x3be87f,_0xaf71a8){var _0x1b7380={'XMD-QUEUE':_0x1d9194['Queue']?_0x1d9194[_0x8524('0x16')][_0x8524('0x17')]:'','XMD-CALLERID':_0x37e192,'XMD-CALLERID-PREVIEW':_0xaf71a8?util[_0x8524('0x13')](_0x8524('0x12'),_0xaf71a8['calleridname'],_0xaf71a8[_0x8524('0x18')]):_0x37e192,'XMD-DIALID':_0x3be87f,'XMD-CONTACTID':_0x1d9194[_0x8524('0x19')],'XMD-CDRTYPE':_0x8524('0x1a'),'CALLERID(all)':_0x37e192,'XMD-VOICEQUEUEID':_0x1d9194[_0x8524('0x1b')],'XMD-DIALCHANNEL':_0x5b2f37,'XMD-DIALTIMEOUT':_0x4e7651[_0x8524('0x1c')]||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x4e7651[_0x8524('0x1d')]?'g':'',_[_0x8524('0xf')](_0x4e7651[_0x8524('0x1e')])?'':_0x8524('0x1f')),'XMD-DIALURL':_0x4e7651['dialPreviewUrl']||'','XMD-AGI':_0x4e7651[_0x8524('0x20')]?util[_0x8524('0x13')](_0x8524('0x21'),ipAgi,_0x4e7651[_0x8524('0x20')]):_0x8524('0x22'),'XMD-AGIAFTER':_0x4e7651['dialQueueProject2']?util[_0x8524('0x13')](_0x8524('0x21'),ipAgi,_0x4e7651[_0x8524('0x1d')]):_0x8524('0x22'),'XMD-ORIGINATECALLERIDNUM':_0xaf71a8?_0xaf71a8['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0xaf71a8?_0xaf71a8[_0x8524('0x23')]:'','XMD-DESTINATION':_0x8524('0x24')};if(!_['isEmpty'](_0x4e7651['monitor_format'])){_0x1b7380[util[_0x8524('0x13')]('%s',_0x8524('0x25'))]=_0x4e7651[_0x8524('0x1e')];_0x1b7380[util['format']('%s',_0x8524('0x26'))]=_0x3be87f;}if(_0x1d9194&&_0x1d9194['Contact']){for(var _0x445ba8 in _0x1d9194[_0x8524('0x27')]){if(_0x1d9194['Contact'][_0x8524('0x28')](_0x445ba8)){if(!_[_0x8524('0x15')](_0x1d9194['Contact'][_0x445ba8])&&_0x445ba8!=='id'&&_0x445ba8!==_0x8524('0x29')&&_0x445ba8!==_0x8524('0x2a')&&_0x445ba8!==_0x8524('0x2b')){_0x1b7380[util['format'](_0x8524('0x2c'),_0x8524('0x2d'),_[_0x8524('0x2e')](_0x445ba8))]=_0x1d9194[_0x8524('0x27')][_0x445ba8];}}}}return _0x1b7380;};exports['toLowerVariables']=function(_0x1276d9){var _0x2cc493={};for(var _0x1ac2f0 in _0x1276d9){if(_0x1276d9[_0x8524('0x28')](_0x1ac2f0)){_0x2cc493[util[_0x8524('0x13')]('%s',_['toLower'](_0x1ac2f0))]=_0x1276d9[_0x1ac2f0];}}return{'variables':_0x2cc493};};exports[_0x8524('0x2f')]=function(_0x34518b,_0x31e537){if(!_[_0x8524('0x15')](_0x34518b)){if(_0x34518b[_0x8524('0x28')](_0x8524('0x30'))){if(_0x34518b[_0x8524('0x30')]>0x0){_0x34518b[_0x8524('0x30')]-=0x1;}else{logger[_0x8524('0x31')](_0x8524('0x32'),_0x31e537);}}}else{logger['error'](_0x8524('0x33'),_0x31e537);}};exports[_0x8524('0x34')]=function(_0x4dd60b){var _0x816206=moment()[_0x8524('0x13')](_0x8524('0x35'));_0x4dd60b[_0x8524('0x36')]=0xd;_0x4dd60b[_0x8524('0x37')]=_0x8524('0x38');_0x4dd60b[_0x8524('0x39')]=_0x816206;_0x4dd60b['responsetime']=_0x816206;_0x4dd60b[_0x8524('0x3a')]=_0x816206;};exports[_0x8524('0x3b')]=function(_0x41594a,_0x6b2309,_0x35d8dd){var _0x22102f=moment()[_0x8524('0x13')]('YYYY-MM-DD\x20HH:mm:ss');_0x41594a['state']=_0x6b2309;_0x41594a['statedesc']=_0x35d8dd;_0x41594a[_0x8524('0x3c')]=_0x22102f;_0x41594a[_0x8524('0x3d')]=getSeconds(_0x41594a[_0x8524('0x3c')],_0x41594a[_0x8524('0x39')]);};exports['logLookAgent']=function(_0x3aa76e,_0x44292c,_0x406725){_0x3aa76e['membername']=_0x44292c;_0x3aa76e['UserId']=_0x406725;};exports['logCustomer']=function(_0x2bf598,_0x20dd31,_0x982399){var _0x82f3d=moment()[_0x8524('0x13')](_0x8524('0x35'));_0x2bf598['state']=_0x20dd31;_0x2bf598['statedesc']=_0x982399;_0x2bf598[_0x8524('0x3c')]=_0x2bf598[_0x8524('0x3c')]?_0x2bf598[_0x8524('0x3c')]:_0x82f3d;_0x2bf598[_0x8524('0x3a')]=_0x2bf598['endtime']?_0x2bf598[_0x8524('0x3a')]:_0x82f3d;_0x2bf598[_0x8524('0x3d')]=getSeconds(_0x2bf598[_0x8524('0x3c')]||0x0,_0x2bf598[_0x8524('0x39')]||0x0);_0x2bf598[_0x8524('0x3e')]=_0x2bf598[_0x8524('0x3f')]?getSeconds(_0x2bf598[_0x8524('0x3a')],_0x2bf598[_0x8524('0x3f')]):0x0;};exports[_0x8524('0x40')]=function(_0x1fdc40){return _0x1fdc40===_0x8524('0x41');};exports[_0x8524('0x42')]=function(_0x129df1,_0x4c6b48,_0x532387,_0x5e6ef5,_0xebd242){var _0x544f25=_0x5e6ef5?_0x8524('0x43'):_0x129df1[_0x8524('0x44')];_0x544f25=_0xebd242?'BOOKED':_0x544f25;return{'actionid':_0x129df1[_0x8524('0x45')],'action':_0x8524('0x46'),'channel':_0x129df1[_0x8524('0x47')],'callerid':util[_0x8524('0x13')](_0x8524('0x12'),_0x544f25,_0x129df1[_0x8524('0x18')]),'Exten':_0x8524('0x24'),'Context':_0x8524('0x48'),'Priority':'1','variable':_0x532387,'timeout':(_0x4c6b48['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x129df1['uniqueid']};};exports[_0x8524('0x49')]=function(_0xe9e30e){return _0xe9e30e['countbusyretry']+_0xe9e30e[_0x8524('0x4a')]+_0xe9e30e[_0x8524('0x4b')]+_0xe9e30e[_0x8524('0x4c')]+_0xe9e30e['countnosuchnumberretry'];};exports['cloneAction']=function(_0xbade74){var _0x1f186c=_['clone'](_0xbade74);_0x1f186c['state']=0xf;_0x1f186c['statedesc']=_0x8524('0x4d');return _0x1f186c;};exports['scheduledAt']=function(_0x690760,_0x2744c0,_0x244c45){var _0x5b43ad={};_0x5b43ad[_0x2744c0]=_0x690760[_0x2744c0];_0x5b43ad[_0x8524('0x4e')]=![];_0x5b43ad['scheduledat']=moment()[_0x8524('0x4f')](_0x244c45,_0x8524('0x50'))[_0x8524('0x13')](_0x8524('0x35'));_0x5b43ad[_0x8524('0x19')]=_0x690760['ContactId'];_0x5b43ad['ListId']=_0x690760[_0x8524('0x51')];_0x5b43ad[_0x8524('0x1b')]=_0x690760[_0x8524('0x1b')]||undefined;return _0x5b43ad;};exports[_0x8524('0x52')]=function(_0xcae708,_0x5db57c){if(!_[_0x8524('0x15')](_0xcae708)){if(_0xcae708[_0x8524('0x53')]>0x0){_0xcae708[_0x8524('0x53')]-=0x1;}else{logger[_0x8524('0x31')](_0x5db57c,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x8524('0x31')](_0x5db57c,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports['IsNotLoggedIn']=function(_0x229b5a){if(_0x229b5a<=0x0){return!![];}return![];};exports[_0x8524('0x54')]=function(_0x3b7fa7,_0x2d822e,_0x1ed49d){_0x3b7fa7[_0x8524('0x55')]=_0x2d822e;_0x3b7fa7['name']=_0x3b7fa7[_0x8524('0x56')];_0x3b7fa7[_0x8524('0x57')]=_0x3b7fa7[_0x8524('0x47')];_0x3b7fa7[_0x8524('0x58')]=_0x8524('0x59');if(_0x1ed49d){_0x3b7fa7[_0x8524('0x5a')]=_0x1ed49d[_0x8524('0x5a')];}return _0x3b7fa7;};exports['buildAcw']=function(_0xd119ea){var _0x27daec={};_0x27daec[_0x8524('0x56')]=_0xd119ea[_0x8524('0x56')];_0x27daec[_0x8524('0x57')]=_0xd119ea[_0x8524('0x47')];_0x27daec[_0x8524('0x45')]=_0xd119ea[_0x8524('0x45')];return _0x27daec;};exports[_0x8524('0x5b')]=function(_0x5933a1){var _0x57b30e=[];for(var _0x2f4675 in _0x5933a1){if(_0x5933a1['hasOwnProperty'](_0x2f4675)){if(!_[_0x8524('0x15')](_0x5933a1[_0x2f4675])&&_0x5933a1[_0x2f4675][_0x8524('0x36')]===_0x8524('0x5c')&&_0x5933a1[_0x2f4675][_0x8524('0x5d')]===_0x8524('0x5e')){_0x57b30e['push'](_0x5933a1[_0x2f4675]['id']);}}}return _0x57b30e;};exports[_0x8524('0x5f')]=function(_0x133997){var _0x28dbfd=moment()['milliseconds'](0x0);var _0x27a501=moment(_0x133997)[_0x8524('0x6')](0x0);return _0x28dbfd[_0x8524('0x7')](_0x27a501,_0x8524('0x8'));};exports[_0x8524('0x60')]=function(_0x38cd9b){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x38cd9b[_0x8524('0x19')],'ListId':_0x38cd9b[_0x8524('0x51')],'VoiceQueueId':_0x38cd9b[_0x8524('0x1b')]||undefined,'CampaignId':_0x38cd9b[_0x8524('0x61')]||undefined};};exports[_0x8524('0x62')]=function(_0x2d7645){if(_0x2d7645===_0x8524('0x45')||_0x2d7645===_0x8524('0x63')||_0x2d7645===_0x8524('0x56')||_0x2d7645==='type'||_0x2d7645===_0x8524('0x64')||_0x2d7645===_0x8524('0x65')||_0x2d7645==='membername'||_0x2d7645===_0x8524('0x47')||_0x2d7645===_0x8524('0x44')||_0x2d7645===_0x8524('0x4e')||_0x2d7645===_0x8524('0x18')||_0x2d7645===_0x8524('0x66')||_0x2d7645==='countbusyretry'||_0x2d7645==='countcongestionretry'||_0x2d7645===_0x8524('0x4b')||_0x2d7645===_0x8524('0x67')||_0x2d7645==='callback'||_0x2d7645===_0x8524('0x68')||_0x2d7645===_0x8524('0x69')||_0x2d7645===_0x8524('0x6a')||_0x2d7645===_0x8524('0x19')||_0x2d7645===_0x8524('0x51')||_0x2d7645==='UserId'||_0x2d7645===_0x8524('0x1b')||_0x2d7645==='sipcallid'||_0x2d7645==='xmd-voicequeueid'||_0x2d7645===_0x8524('0x6b')||_0x2d7645==='xmd-phone'||_0x2d7645===_0x8524('0x6c')||_0x2d7645==='xmd-dialurl'||_0x2d7645==='xmd-dialtimeout'||_0x2d7645==='xmd-dialoptions'||_0x2d7645===_0x8524('0x6d')||_0x2d7645===_0x8524('0x6e')||_0x2d7645===_0x8524('0x6f')||_0x2d7645===_0x8524('0x70')||_0x2d7645===_0x8524('0x71')||_0x2d7645===_0x8524('0x72')||_0x2d7645==='xmd-agi'||_0x2d7645===_0x8524('0x73')||_0x2d7645==='rtpaudioqosbridged'||_0x2d7645==='rtpaudioqosjitter'||_0x2d7645==='rtpaudioqosjitterbridged'||_0x2d7645==='rtpaudioqosloss'||_0x2d7645===_0x8524('0x74')||_0x2d7645===_0x8524('0x75')||_0x2d7645===_0x8524('0x76')||_0x2d7645==='rtpaudioqos'||_0x2d7645==='rtpaudioqosbridged'||_0x2d7645===_0x8524('0x77')||_0x2d7645===_0x8524('0x78')||_0x2d7645===_0x8524('0x79')||_0x2d7645===_0x8524('0x74')||_0x2d7645==='rtpaudioqosrtt'||_0x2d7645===_0x8524('0x76')||_0x2d7645===_0x8524('0x7a')||_0x2d7645===_0x8524('0x7b')||_0x2d7645===_0x8524('0x36')||_0x2d7645===_0x8524('0x37')){return![];}return!![];};exports[_0x8524('0x7c')]=function(_0x10f7a6,_0x3861b3){var _0x3cee7e,_0x4e1cc9,_0x561d9c;if(_0x3861b3<=0x0){_0x3861b3=0x1;}_0x3cee7e=new RegExp('\x5cw{0,'+_0x3861b3+'}$');_0x4e1cc9=Math[_0x8524('0x7d')](0xa,_0x3861b3-0x1);_0x561d9c=Math['pow'](0xa,_0x3861b3)-0x1;return util['format']('%s',_[_0x8524('0x7e')](_0x10f7a6,_0x3cee7e,_[_0x8524('0x7f')](_0x4e1cc9,_0x561d9c)));};exports['extractCalleridName']=function(_0x48e75b){var _0x370ffe=_0x48e75b[_0x8524('0x80')](/"(.*?)"/);return _0x370ffe?_0x370ffe[0x1]:_0x48e75b;};exports[_0x8524('0x81')]=function(_0x5b15bd){var _0x25f61f=_0x5b15bd[_0x8524('0x80')](/<(.*?)>/);return _0x25f61f?_0x25f61f[0x1]:_0x5b15bd;};
\ No newline at end of file
+var _0x09b2=['variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','Global','scheduledAt','active','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','voice','mandatoryDisposition','interface','not_inuse','status','reachable','push','diff','createBody','filterKey','idContact','type','dialAnswer','calleridname','countglobal','callbackuniqueid','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-contactid','xmd-cdrtype','xmd-agi','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','extractCalleridNumber','match','util','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','seconds','loggerCatch','error','inspect','info','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridnum','ContactId','dialer','dialOriginateTimeout','dialQueueProject2','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','createdAt','updatedAt','%s%s','XMD-','toLowerVariables','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','logLookAgent','membername','UserId','answertime','isFailure','Failure'];(function(_0x35f168,_0x576358){var _0x397a87=function(_0xddc043){while(--_0xddc043){_0x35f168['push'](_0x35f168['shift']());}};_0x397a87(++_0x576358);}(_0x09b2,0x15e));var _0x209b=function(_0x49d21f,_0x6e7f5){_0x49d21f=_0x49d21f-0x0;var _0x1b93f2=_0x09b2[_0x49d21f];return _0x1b93f2;};'use strict';var util=require(_0x209b('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0x209b('0x1'))(_0x209b('0x2'));var ipAgi=process[_0x209b('0x3')][_0x209b('0x4')]||_0x209b('0x5');function getSeconds(_0x3cfda8,_0x1a8a3d){var _0x14fc19=moment(_0x3cfda8)['milliseconds'](0x0);var _0x1e589d=moment(_0x1a8a3d)[_0x209b('0x6')](0x0);return _0x14fc19['diff'](_0x1e589d,_0x209b('0x7'));}exports[_0x209b('0x8')]=function(_0x1325f2){return function(_0x2b2600){logger[_0x209b('0x9')](_0x1325f2,util[_0x209b('0xa')](_0x2b2600,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x1f60c8,_0x1630b3){logger[_0x209b('0xb')](_0x1f60c8,util['inspect'](_0x1630b3,{'showHidden':![],'depth':null}));};exports[_0x209b('0xc')]=function(_0x10a456,_0x5ae6a8){logger[_0x209b('0x9')](_0x10a456,util[_0x209b('0xa')](_0x5ae6a8,{'showHidden':![],'depth':null}));};exports[_0x209b('0xd')]=function(_0x4b0470){return function(_0x4e7345){logger['info'](_0x4b0470,util[_0x209b('0xa')](_0x4e7345,{'showHidden':![],'depth':null}));};};exports[_0x209b('0xe')]=function(_0xae3f70,_0x3fdd9e,_0x41724b){return{'message':_0xae3f70,'unlock':_0x3fdd9e,'active':_0x41724b};};exports[_0x209b('0xf')]=function(_0x271a23,_0x58154d,_0xa2b181){if(!_[_0x209b('0x10')](_0xa2b181)&&_0x209b('0x11')===typeof _0xa2b181&&!_[_0x209b('0x12')](_0xa2b181)){if(!_['isUndefined'](_0x58154d)&&_0x209b('0x11')===typeof _0x58154d&&!_[_0x209b('0x12')](_0x58154d)){return util['format'](_0x209b('0x13'),_0x58154d,_0xa2b181);}return util[_0x209b('0x14')](_0x209b('0x13'),_0xa2b181,_0xa2b181);}if(!_[_0x209b('0x10')](_0x271a23)&&_0x209b('0x11')===typeof _0x271a23&&!_[_0x209b('0x12')](_0x271a23)){return _0x271a23;}return _0x209b('0x15');};exports[_0x209b('0x16')]=function(_0x5c6cf2){if(_[_0x209b('0x17')](_0x5c6cf2)){return![];}return _0x5c6cf2;};exports[_0x209b('0x18')]=function(_0x16a264,_0x5f3bb2,_0x3c9645,_0x20e07b,_0x2c9bc5,_0x538707){var _0x272492={'XMD-QUEUE':_0x5f3bb2[_0x209b('0x19')]?_0x5f3bb2['Queue'][_0x209b('0x1a')]:'','XMD-CALLERID':_0x20e07b,'XMD-CALLERID-PREVIEW':_0x538707?util[_0x209b('0x14')](_0x209b('0x13'),_0x538707['calleridname'],_0x538707[_0x209b('0x1b')]):_0x20e07b,'XMD-DIALID':_0x2c9bc5,'XMD-CONTACTID':_0x5f3bb2[_0x209b('0x1c')],'XMD-CDRTYPE':_0x209b('0x1d'),'CALLERID(all)':_0x20e07b,'XMD-VOICEQUEUEID':_0x5f3bb2['VoiceQueueId'],'XMD-DIALCHANNEL':_0x3c9645,'XMD-DIALTIMEOUT':_0x16a264[_0x209b('0x1e')]||0x1e,'XMD-DIALOPTIONS':util[_0x209b('0x14')]('\x22rtTxX%s%s\x22',_0x16a264[_0x209b('0x1f')]?'g':'',_['isEmpty'](_0x16a264['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x16a264['dialPreviewUrl']||'','XMD-AGI':_0x16a264['dialQueueProject']?util[_0x209b('0x14')](_0x209b('0x20'),ipAgi,_0x16a264[_0x209b('0x21')]):_0x209b('0x22'),'XMD-AGIAFTER':_0x16a264[_0x209b('0x1f')]?util[_0x209b('0x14')](_0x209b('0x20'),ipAgi,_0x16a264['dialQueueProject2']):_0x209b('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x538707?_0x538707['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x538707?_0x538707[_0x209b('0x23')]:'','XMD-DESTINATION':_0x209b('0x24')};if(!_['isEmpty'](_0x16a264['monitor_format'])){_0x272492[util[_0x209b('0x14')]('%s',_0x209b('0x25'))]=_0x16a264['monitor_format'];_0x272492[util[_0x209b('0x14')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x2c9bc5;}if(_0x5f3bb2&&_0x5f3bb2[_0x209b('0x26')]){for(var _0x5e4df8 in _0x5f3bb2[_0x209b('0x26')]){if(_0x5f3bb2[_0x209b('0x26')][_0x209b('0x27')](_0x5e4df8)){if(!_[_0x209b('0x17')](_0x5f3bb2[_0x209b('0x26')][_0x5e4df8])&&_0x5e4df8!=='id'&&_0x5e4df8!=='tags'&&_0x5e4df8!==_0x209b('0x28')&&_0x5e4df8!==_0x209b('0x29')){_0x272492[util['format'](_0x209b('0x2a'),_0x209b('0x2b'),_['toUpper'](_0x5e4df8))]=_0x5f3bb2[_0x209b('0x26')][_0x5e4df8];}}}}return _0x272492;};exports[_0x209b('0x2c')]=function(_0xb9b8fe){var _0xa472ea={};for(var _0x5d9fb3 in _0xb9b8fe){if(_0xb9b8fe['hasOwnProperty'](_0x5d9fb3)){_0xa472ea[util[_0x209b('0x14')]('%s',_['toLower'](_0x5d9fb3))]=_0xb9b8fe[_0x5d9fb3];}}return{'variables':_0xa472ea};};exports['updateOriginated']=function(_0x1715b4,_0x1da125){if(!_['isNil'](_0x1715b4)){if(_0x1715b4[_0x209b('0x27')](_0x209b('0x2d'))){if(_0x1715b4[_0x209b('0x2d')]>0x0){_0x1715b4[_0x209b('0x2d')]-=0x1;}else{logger[_0x209b('0x9')](_0x209b('0x2e'),_0x1da125);}}}else{logger[_0x209b('0x9')](_0x209b('0x2f'),_0x1da125);}};exports[_0x209b('0x30')]=function(_0x3e0a40){var _0x39a192=moment()[_0x209b('0x14')](_0x209b('0x31'));_0x3e0a40[_0x209b('0x32')]=0xd;_0x3e0a40[_0x209b('0x33')]=_0x209b('0x34');_0x3e0a40[_0x209b('0x35')]=_0x39a192;_0x3e0a40[_0x209b('0x36')]=_0x39a192;_0x3e0a40[_0x209b('0x37')]=_0x39a192;};exports[_0x209b('0x38')]=function(_0x638e0,_0x2edc52,_0x38a1ab){var _0x3a1583=moment()[_0x209b('0x14')](_0x209b('0x31'));_0x638e0[_0x209b('0x32')]=_0x2edc52;_0x638e0['statedesc']=_0x38a1ab;_0x638e0[_0x209b('0x36')]=_0x3a1583;_0x638e0[_0x209b('0x39')]=getSeconds(_0x638e0['responsetime'],_0x638e0[_0x209b('0x35')]);};exports[_0x209b('0x3a')]=function(_0x4bf10e,_0x543b6a,_0x146464){_0x4bf10e[_0x209b('0x3b')]=_0x543b6a;_0x4bf10e[_0x209b('0x3c')]=_0x146464;};exports['logCustomer']=function(_0x159df7,_0x438b8a,_0x23c346){var _0x335d34=moment()[_0x209b('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x159df7['state']=_0x438b8a;_0x159df7[_0x209b('0x33')]=_0x23c346;_0x159df7[_0x209b('0x36')]=_0x159df7['responsetime']?_0x159df7[_0x209b('0x36')]:_0x335d34;_0x159df7[_0x209b('0x37')]=_0x159df7[_0x209b('0x37')]?_0x159df7[_0x209b('0x37')]:_0x335d34;_0x159df7[_0x209b('0x39')]=getSeconds(_0x159df7[_0x209b('0x36')]||0x0,_0x159df7[_0x209b('0x35')]||0x0);_0x159df7['talktime']=_0x159df7[_0x209b('0x3d')]?getSeconds(_0x159df7[_0x209b('0x37')],_0x159df7[_0x209b('0x3d')]):0x0;};exports[_0x209b('0x3e')]=function(_0x15680f){return _0x15680f===_0x209b('0x3f');};exports[_0x209b('0x40')]=function(_0x58c282,_0x3535c9,_0x38509e,_0x5e5e94,_0x2d86f5){var _0x4941dd=_0x5e5e94?_0x209b('0x41'):_0x58c282['calleridname'];_0x4941dd=_0x2d86f5?_0x209b('0x42'):_0x4941dd;return{'actionid':_0x58c282[_0x209b('0x43')],'action':_0x209b('0x44'),'channel':_0x58c282[_0x209b('0x45')],'callerid':util[_0x209b('0x14')](_0x209b('0x13'),_0x4941dd,_0x58c282[_0x209b('0x1b')]),'Exten':_0x209b('0x24'),'Context':_0x209b('0x46'),'Priority':'1','variable':_0x38509e,'timeout':(_0x3535c9[_0x209b('0x47')]||0x1e)*0x3e8,'async':!![],'channelid':_0x58c282['uniqueid']};};exports[_0x209b('0x48')]=function(_0x2cf33b){return _0x2cf33b[_0x209b('0x49')]+_0x2cf33b[_0x209b('0x4a')]+_0x2cf33b[_0x209b('0x4b')]+_0x2cf33b['countagentrejectretry']+_0x2cf33b['countnosuchnumberretry'];};exports[_0x209b('0x4c')]=function(_0x21d05d){var _0x57a5df=_['clone'](_0x21d05d);_0x57a5df['state']=0xf;_0x57a5df['statedesc']=_0x209b('0x4d');return _0x57a5df;};exports[_0x209b('0x4e')]=function(_0x3cb791,_0x9198ca,_0xd9bbba){var _0x5783bb={};_0x5783bb[_0x9198ca]=_0x3cb791[_0x9198ca];_0x5783bb[_0x209b('0x4f')]=![];_0x5783bb['scheduledat']=moment()[_0x209b('0x50')](_0xd9bbba,_0x209b('0x51'))['format'](_0x209b('0x31'));_0x5783bb[_0x209b('0x1c')]=_0x3cb791[_0x209b('0x1c')];_0x5783bb[_0x209b('0x52')]=_0x3cb791[_0x209b('0x52')];_0x5783bb[_0x209b('0x53')]=_0x3cb791['VoiceQueueId']||undefined;return _0x5783bb;};exports[_0x209b('0x54')]=function(_0x56061,_0x3bbb82){if(!_[_0x209b('0x17')](_0x56061)){if(_0x56061[_0x209b('0x55')]>0x0){_0x56061[_0x209b('0x55')]-=0x1;}else{logger[_0x209b('0x9')](_0x3bbb82,_0x209b('0x56'));}}else{logger[_0x209b('0x9')](_0x3bbb82,_0x209b('0x57'));}};exports[_0x209b('0x58')]=function(_0x4d859e){if(_0x4d859e<=0x0){return!![];}return![];};exports[_0x209b('0x59')]=function(_0x46ee14,_0x4caf8f,_0x2c9b1c){_0x46ee14[_0x209b('0x5a')]=_0x4caf8f;_0x46ee14['name']=_0x46ee14[_0x209b('0x5b')];_0x46ee14['interface']=_0x46ee14['channelAgent'];_0x46ee14['motionChannel']=_0x209b('0x5c');if(_0x2c9b1c){_0x46ee14[_0x209b('0x5d')]=_0x2c9b1c[_0x209b('0x5d')];}return _0x46ee14;};exports['buildAcw']=function(_0x8ddbf4){var _0xfa59e5={};_0xfa59e5[_0x209b('0x5b')]=_0x8ddbf4['queue'];_0xfa59e5[_0x209b('0x5e')]=_0x8ddbf4[_0x209b('0x45')];_0xfa59e5['uniqueid']=_0x8ddbf4[_0x209b('0x43')];return _0xfa59e5;};exports['agentReadyId']=function(_0x41a70f){var _0x3374ea=[];for(var _0x5b5b31 in _0x41a70f){if(_0x41a70f[_0x209b('0x27')](_0x5b5b31)){if(!_[_0x209b('0x17')](_0x41a70f[_0x5b5b31])&&_0x41a70f[_0x5b5b31]['state']===_0x209b('0x5f')&&_0x41a70f[_0x5b5b31][_0x209b('0x60')]===_0x209b('0x61')){_0x3374ea[_0x209b('0x62')](_0x41a70f[_0x5b5b31]['id']);}}}return _0x3374ea;};exports['getDiff']=function(_0x2358b7){var _0x4e5c6c=moment()['milliseconds'](0x0);var _0x1cb31c=moment(_0x2358b7)[_0x209b('0x6')](0x0);return _0x4e5c6c[_0x209b('0x63')](_0x1cb31c,_0x209b('0x7'));};exports[_0x209b('0x64')]=function(_0xc88fdb){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0xc88fdb[_0x209b('0x1c')],'ListId':_0xc88fdb[_0x209b('0x52')],'VoiceQueueId':_0xc88fdb[_0x209b('0x53')]||undefined,'CampaignId':_0xc88fdb['CampaignId']||undefined};};exports[_0x209b('0x65')]=function(_0x14f1ae){if(_0x14f1ae===_0x209b('0x43')||_0x14f1ae===_0x209b('0x66')||_0x14f1ae===_0x209b('0x5b')||_0x14f1ae===_0x209b('0x67')||_0x14f1ae==='campaigntype'||_0x14f1ae===_0x209b('0x68')||_0x14f1ae==='membername'||_0x14f1ae==='channelAgent'||_0x14f1ae===_0x209b('0x69')||_0x14f1ae==='active'||_0x14f1ae==='calleridnum'||_0x14f1ae==='scheduledat'||_0x14f1ae===_0x209b('0x49')||_0x14f1ae===_0x209b('0x4a')||_0x14f1ae==='countnoanswerretry'||_0x14f1ae===_0x209b('0x6a')||_0x14f1ae==='callback'||_0x14f1ae===_0x209b('0x6b')||_0x14f1ae==='callbackat'||_0x14f1ae===_0x209b('0x6c')||_0x14f1ae===_0x209b('0x1c')||_0x14f1ae===_0x209b('0x52')||_0x14f1ae==='UserId'||_0x14f1ae===_0x209b('0x53')||_0x14f1ae===_0x209b('0x6d')||_0x14f1ae===_0x209b('0x6e')||_0x14f1ae===_0x209b('0x6f')||_0x14f1ae===_0x209b('0x70')||_0x14f1ae===_0x209b('0x71')||_0x14f1ae==='xmd-dialurl'||_0x14f1ae===_0x209b('0x72')||_0x14f1ae===_0x209b('0x73')||_0x14f1ae===_0x209b('0x74')||_0x14f1ae==='xmd-dialchannel'||_0x14f1ae===_0x209b('0x75')||_0x14f1ae===_0x209b('0x76')||_0x14f1ae==='xmd-callerid'||_0x14f1ae==='xmd-agiafter'||_0x14f1ae===_0x209b('0x77')||_0x14f1ae==='rtpaudioqos'||_0x14f1ae==='rtpaudioqosbridged'||_0x14f1ae===_0x209b('0x78')||_0x14f1ae===_0x209b('0x79')||_0x14f1ae===_0x209b('0x7a')||_0x14f1ae===_0x209b('0x7b')||_0x14f1ae===_0x209b('0x7c')||_0x14f1ae===_0x209b('0x7d')||_0x14f1ae===_0x209b('0x7e')||_0x14f1ae===_0x209b('0x7f')||_0x14f1ae===_0x209b('0x78')||_0x14f1ae==='rtpaudioqosjitterbridged'||_0x14f1ae==='rtpaudioqosloss'||_0x14f1ae==='rtpaudioqoslossbridged'||_0x14f1ae===_0x209b('0x7c')||_0x14f1ae===_0x209b('0x7d')||_0x14f1ae===_0x209b('0x80')||_0x14f1ae===_0x209b('0x81')||_0x14f1ae===_0x209b('0x32')||_0x14f1ae===_0x209b('0x33')){return![];}return!![];};exports[_0x209b('0x82')]=function(_0x9bd63e,_0x1ac11d){var _0x198fe3,_0x3f7bc1,_0x409499;if(_0x1ac11d<=0x0){_0x1ac11d=0x1;}_0x198fe3=new RegExp(_0x209b('0x83')+_0x1ac11d+'}$');_0x3f7bc1=Math[_0x209b('0x84')](0xa,_0x1ac11d-0x1);_0x409499=Math[_0x209b('0x84')](0xa,_0x1ac11d)-0x1;return util[_0x209b('0x14')]('%s',_[_0x209b('0x85')](_0x9bd63e,_0x198fe3,_[_0x209b('0x86')](_0x3f7bc1,_0x409499)));};exports[_0x209b('0x87')]=function(_0x4dbecd){var _0x46bdbf=_0x4dbecd['match'](/"(.*?)"/);return _0x46bdbf?_0x46bdbf[0x1]:_0x4dbecd;};exports[_0x209b('0x88')]=function(_0x4e249d){var _0x3e5c33=_0x4e249d[_0x209b('0x89')](/<(.*?)>/);return _0x3e5c33?_0x3e5c33[0x1]:_0x4e249d;};
\ No newline at end of file
index 50886d3..81d28a8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x325d=['number','boolean','reload','voicequeuechannelredirect','queueadd','string'];(function(_0x4f69de,_0x25c68d){var _0x4cbe66=function(_0x24a682){while(--_0x24a682){_0x4f69de['push'](_0x4f69de['shift']());}};_0x4cbe66(++_0x25c68d);}(_0x325d,0xb2));var _0xd325=function(_0x4d3180,_0x377996){_0x4d3180=_0x4d3180-0x0;var _0x103996=_0x325d[_0x4d3180];return _0x103996;};'use strict';exports[_0xd325('0x0')]={'queue':{'type':_0xd325('0x1'),'required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0xd325('0x2'),'required':![]},'paused':{'type':_0xd325('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0xd325('0x1'),'required':!![]},'interface':{'type':_0xd325('0x1'),'required':!![]}};exports['queuepause']={'interface':{'type':_0xd325('0x1'),'required':!![]},'paused':{'type':_0xd325('0x3')},'reason':{'type':'string','required':![]}};exports[_0xd325('0x4')]={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xd325('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':'string','required':!![]},'filename':{'type':_0xd325('0x1')},'format':{'type':_0xd325('0x1')},'mixmonitorid':{'type':_0xd325('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0xd325('0x1'),'required':!![]}};exports[_0xd325('0x5')]={'uniqueid':{'type':_0xd325('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}};
\ No newline at end of file
+var _0xc8b1=['queueremove','queuepause','voicequeuechannel','voicechannel','voicequeuechannelredirect','queueadd','string','number','boolean'];(function(_0x3e7f7b,_0x2663db){var _0x5e9cce=function(_0x4be0f1){while(--_0x4be0f1){_0x3e7f7b['push'](_0x3e7f7b['shift']());}};_0x5e9cce(++_0x2663db);}(_0xc8b1,0x17f));var _0x1c8b=function(_0x1c6003,_0x438753){_0x1c6003=_0x1c6003-0x0;var _0x2ed126=_0xc8b1[_0x1c6003];return _0x2ed126;};'use strict';exports[_0x1c8b('0x0')]={'queue':{'type':_0x1c8b('0x1'),'required':!![]},'interface':{'type':_0x1c8b('0x1'),'required':!![]},'membername':{'type':_0x1c8b('0x1'),'required':!![]},'penalty':{'type':_0x1c8b('0x2'),'required':![]},'paused':{'type':_0x1c8b('0x3'),'required':![]}};exports[_0x1c8b('0x4')]={'queue':{'type':_0x1c8b('0x1'),'required':!![]},'interface':{'type':_0x1c8b('0x1'),'required':!![]}};exports[_0x1c8b('0x5')]={'interface':{'type':_0x1c8b('0x1'),'required':!![]},'paused':{'type':_0x1c8b('0x3')},'reason':{'type':'string','required':![]}};exports['reload']={'module':{'type':_0x1c8b('0x1'),'required':![]}};exports[_0x1c8b('0x6')]={'uniqueid':{'type':_0x1c8b('0x1'),'required':!![]}};exports[_0x1c8b('0x7')]={'uniqueid':{'type':_0x1c8b('0x1'),'required':!![]},'filename':{'type':_0x1c8b('0x1')},'format':{'type':_0x1c8b('0x1')},'mixmonitorid':{'type':'string'}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x1c8b('0x1'),'required':!![]}};exports[_0x1c8b('0x8')]={'uniqueid':{'type':_0x1c8b('0x1'),'required':!![]},'exten':{'type':_0x1c8b('0x1'),'required':!![]},'context':{'type':_0x1c8b('0x1')}};
\ No newline at end of file
index 97d3a1a..006b48d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadd7=['initDynamics365Accounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','uniqueid','queue','queuecallerexit','unmanaged','queuecallerabandon','diff','queuecallerjoinAt','seconds','queuecallerexitAt','queuecallercompleteAt','queuecallerleaveAt','initVoiceCallReports','duration','billableseconds','initCampaigns','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/dynamics365Account','agents','telephones','triggers','campaigns','outbound','voiceExtensions','channels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','interface','total','answered','sumHoldTime','sumDuration','sumBillable','ivrTotalCallsDays','ivrAnswerCallsDay','abandoned','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','prototype','mergeFromDatabase','initAgents','length','isNil','isUndefined','initTelephones','trunks','initVoiceQueues','voiceQueues','initTriggers','initTemplates','templates','initZendeskAccounts','initSalesforceAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts'];(function(_0x11e4e7,_0xc44822){var _0x3794a5=function(_0x2232eb){while(--_0x2232eb){_0x11e4e7['push'](_0x11e4e7['shift']());}};_0x3794a5(++_0xc44822);}(_0xadd7,0x151));var _0x7add=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xadd7[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require('bluebird');var util=require(_0x7add('0x0'));var _=require(_0x7add('0x1'));var moment=require(_0x7add('0x2'));var Agent=require(_0x7add('0x3'));var Telephone=require(_0x7add('0x4'));var Trunk=require(_0x7add('0x5'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x7add('0x6'));var Template=require(_0x7add('0x7'));var Campaign=require(_0x7add('0x8'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x7add('0x9'));var SalesforceAccount=require(_0x7add('0xa'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require(_0x7add('0xb'));var ZohoAccount=require(_0x7add('0xc'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x7add('0xd'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x7add('0xe'));var FreshsalesAccount=require('../model/freshsalesAccount');var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x7add('0xf')]={};this[_0x7add('0x10')]={};this['trunks']={};this['voiceQueues']={};this[_0x7add('0x11')]={};this[_0x7add('0x12')]={};this['templates']={};this[_0x7add('0x13')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x7add('0x14')]={};this[_0x7add('0x15')]={};this['queueChannels']={};this[_0x7add('0x16')]={};this[_0x7add('0x17')]={};this['settings']={};this[_0x7add('0x18')]={};this[_0x7add('0x19')]={};this[_0x7add('0x1a')]={};this[_0x7add('0x1b')]={};this[_0x7add('0x1c')]={};this[_0x7add('0x1d')]={};this[_0x7add('0x1e')]={};this[_0x7add('0x1f')]={};this['dynamics365Accounts']={};this[_0x7add('0x20')]={};this[_0x7add('0x21')]={};};function freeIsNotKey(_0x571074,_0x3931d4,_0x37104c){var _0x1ee037=_[_0x7add('0x22')](_0x571074,function(_0x19aef5,_0x4b66a7){return _0x19aef5[_0x37104c];});for(var _0x15b45c in _0x3931d4){if(_0x3931d4[_0x7add('0x23')](_0x15b45c)){if(!_0x1ee037[_0x15b45c]){delete _0x3931d4[_0x15b45c];}}}}function freeIsNotKeySip(_0x73910b,_0x4ccba5){var _0xee2895=_[_0x7add('0x22')](_0x73910b,function(_0x3da816,_0x5a91e6){return util[_0x7add('0x24')](_0x7add('0x25'),_0x3da816[_0x7add('0x26')]);});for(var _0x36d1ed in _0x4ccba5){if(_0x4ccba5[_0x7add('0x23')](_0x36d1ed)){if(!_0xee2895[_0x36d1ed]){delete _0x4ccba5[_0x36d1ed];}}}}function freeIsNotKeyAgent(_0x596c4e,_0x3debd3){var _0x13fd7a=_[_0x7add('0x22')](_0x596c4e,function(_0x19f60c,_0xec1053){var _0x23e759=_['isNil'](_0x19f60c[_0x7add('0x27')])?util[_0x7add('0x24')](_0x7add('0x25'),_0x19f60c[_0x7add('0x26')]):_0x19f60c[_0x7add('0x27')];return _0x23e759;});for(var _0x31cffd in _0x3debd3){if(_0x3debd3[_0x7add('0x23')](_0x31cffd)){if(!_0x13fd7a[_0x31cffd]){delete _0x3debd3[_0x31cffd];}}}}function clearVoiceCallReports(_0x47c665){_0x47c665[_0x7add('0x28')]=0x0;_0x47c665[_0x7add('0x29')]=0x0;_0x47c665[_0x7add('0x2a')]=0x0;_0x47c665[_0x7add('0x2b')]=0x0;_0x47c665[_0x7add('0x2c')]=0x0;}function clearCampaigns(_0x31fed0){if(!_['isEmpty'](_0x31fed0)){for(var _0x76d146 in _0x31fed0){if(_0x31fed0['hasOwnProperty'](_0x76d146)){_0x31fed0[_0x76d146][_0x7add('0x2d')]=0x0;_0x31fed0[_0x76d146][_0x7add('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x5192af){if(!_['isEmpty'](_0x5192af)){for(var _0x133452 in _0x5192af){if(_0x5192af[_0x7add('0x23')](_0x133452)){_0x5192af[_0x133452][_0x7add('0x28')]=0x0;_0x5192af[_0x133452][_0x7add('0x29')]=0x0;_0x5192af[_0x133452]['unmanaged']=0x0;_0x5192af[_0x133452][_0x7add('0x2f')]=0x0;_0x5192af[_0x133452]['sumHoldTime']=0x0;_0x5192af[_0x133452][_0x7add('0x2b')]=0x0;_0x5192af[_0x133452][_0x7add('0x2c')]=0x0;_0x5192af[_0x133452][_0x7add('0x30')]=0x0;_0x5192af[_0x133452]['outboundNoAnswerCallsDay']=0x0;_0x5192af[_0x133452][_0x7add('0x31')]=0x0;_0x5192af[_0x133452][_0x7add('0x32')]=0x0;_0x5192af[_0x133452][_0x7add('0x33')]=0x0;_0x5192af[_0x133452][_0x7add('0x34')]=0x0;_0x5192af[_0x133452][_0x7add('0x35')]=0x0;_0x5192af[_0x133452][_0x7add('0x36')]=0x0;_0x5192af[_0x133452][_0x7add('0x37')]=0x0;_0x5192af[_0x133452][_0x7add('0x38')]=0x0;_0x5192af[_0x133452][_0x7add('0x39')]=0x0;_0x5192af[_0x133452][_0x7add('0x3a')]=0x0;_0x5192af[_0x133452][_0x7add('0x30')]=0x0;_0x5192af[_0x133452][_0x7add('0x3b')]=0x0;_0x5192af[_0x133452]['queueStatusComplete']=!![];}}}}Realtime[_0x7add('0x3c')][_0x7add('0x3d')]=function(_0x537964,_0x1399e4){for(var _0x135be0 in _0x1399e4){if(_0x537964[_0x7add('0x23')](_0x135be0)){_0x537964[_0x135be0]=_0x1399e4[_0x135be0];}}};Realtime[_0x7add('0x3c')][_0x7add('0x3e')]=function(){var _0x2978c2=this;return function(_0x3ac66a){if(_0x3ac66a){freeIsNotKeyAgent(_0x3ac66a,_0x2978c2[_0x7add('0xf')]);for(var _0x2667e2=0x0,_0x3c5f5e={},_0x5f35a7={};_0x2667e2<_0x3ac66a[_0x7add('0x3f')];_0x2667e2+=0x1){_0x3c5f5e=_0x3ac66a[_0x2667e2];var _0x34a9bb=_[_0x7add('0x40')](_0x3c5f5e[_0x7add('0x27')])?util[_0x7add('0x24')](_0x7add('0x25'),_0x3c5f5e[_0x7add('0x26')]):_0x3c5f5e[_0x7add('0x27')];if(_[_0x7add('0x41')](_0x2978c2[_0x7add('0xf')][_0x34a9bb])){_0x2978c2[_0x7add('0xf')][_0x34a9bb]=new Agent(_0x3c5f5e);}else{_0x2978c2['mergeFromDatabase'](_0x2978c2[_0x7add('0xf')][_0x34a9bb],_0x3c5f5e);}}}return _0x2978c2['agents'];};};Realtime[_0x7add('0x3c')][_0x7add('0x42')]=function(){var _0x216c16=this;return function(_0x48f280){if(_0x48f280){freeIsNotKeySip(_0x48f280,_0x216c16[_0x7add('0x10')]);for(var _0x208ea7=0x0,_0x30e692={},_0x29f4ea={};_0x208ea7<_0x48f280[_0x7add('0x3f')];_0x208ea7+=0x1){_0x30e692=_0x48f280[_0x208ea7];if(_[_0x7add('0x41')](_0x216c16[_0x7add('0x10')][util[_0x7add('0x24')]('SIP/%s',_0x30e692[_0x7add('0x26')])])){_0x216c16['telephones'][util[_0x7add('0x24')](_0x7add('0x25'),_0x30e692[_0x7add('0x26')])]=new Telephone(_0x30e692);}else{_0x216c16['mergeFromDatabase'](_0x216c16[_0x7add('0x10')][util['format']('SIP/%s',_0x30e692[_0x7add('0x26')])],_0x30e692);}}}return _0x216c16['telephones'];};};Realtime[_0x7add('0x3c')]['initTrunks']=function(){var _0x559ebd=this;return function(_0x302c17){if(_0x302c17){freeIsNotKeySip(_0x302c17,_0x559ebd['trunks']);for(var _0x36046b=0x0,_0x25a622={},_0x2309d3={};_0x36046b<_0x302c17[_0x7add('0x3f')];_0x36046b+=0x1){_0x25a622=_0x302c17[_0x36046b];if(_[_0x7add('0x41')](_0x559ebd[_0x7add('0x43')][util[_0x7add('0x24')](_0x7add('0x25'),_0x25a622[_0x7add('0x26')])])){_0x559ebd[_0x7add('0x43')][util[_0x7add('0x24')](_0x7add('0x25'),_0x25a622[_0x7add('0x26')])]=new Trunk(_0x25a622);}else{_0x559ebd[_0x7add('0x3d')](_0x559ebd['trunks'][util[_0x7add('0x24')](_0x7add('0x25'),_0x25a622[_0x7add('0x26')])],_0x25a622);}}}return _0x559ebd['trunks'];};};Realtime[_0x7add('0x3c')][_0x7add('0x44')]=function(){var _0x4b2735=this;return function(_0x208505){if(_0x208505){freeIsNotKey(_0x208505,_0x4b2735[_0x7add('0x45')],_0x7add('0x26'));for(var _0x2e020e=0x0,_0x1a902b={},_0x20ce8b={};_0x2e020e<_0x208505['length'];_0x2e020e+=0x1){_0x1a902b=_0x208505[_0x2e020e];if(_[_0x7add('0x41')](_0x4b2735[_0x7add('0x45')][_0x1a902b[_0x7add('0x26')]])){_0x4b2735[_0x7add('0x45')][_0x1a902b[_0x7add('0x26')]]=new VoiceQueue(_0x1a902b);}else{_0x4b2735[_0x7add('0x3d')](_0x4b2735[_0x7add('0x45')][_0x1a902b[_0x7add('0x26')]],_0x1a902b);}}}return _0x4b2735['voiceQueues'];};};Realtime[_0x7add('0x3c')][_0x7add('0x46')]=function(){var _0x4f84b5=this;return function(_0x8982ee){if(_0x8982ee){freeIsNotKey(_0x8982ee,_0x4f84b5[_0x7add('0x11')],'id');for(var _0x318d12=0x0,_0x1a898c={},_0x303860={};_0x318d12<_0x8982ee[_0x7add('0x3f')];_0x318d12+=0x1){_0x1a898c=_0x8982ee[_0x318d12];if(_[_0x7add('0x41')](_0x4f84b5[_0x7add('0x11')][_0x1a898c['id']])){_0x4f84b5[_0x7add('0x11')][_0x1a898c['id']]=new Trigger(_0x1a898c);}else{_0x4f84b5[_0x7add('0x3d')](_0x4f84b5['triggers'][_0x1a898c['id']],_0x1a898c);}}}return _0x4f84b5[_0x7add('0x11')];};};Realtime['prototype'][_0x7add('0x47')]=function(){var _0x5be84e=this;return function(_0x41c48f){if(_0x41c48f){freeIsNotKey(_0x41c48f,_0x5be84e['templates'],'id');for(var _0x464650=0x0,_0x1d9524={},_0x5d0430={};_0x464650<_0x41c48f['length'];_0x464650+=0x1){_0x1d9524=_0x41c48f[_0x464650];if(_[_0x7add('0x41')](_0x5be84e[_0x7add('0x48')][_0x1d9524['id']])){_0x5be84e['templates'][_0x1d9524['id']]=new Template(_0x1d9524);}else{_0x5be84e[_0x7add('0x3d')](_0x5be84e[_0x7add('0x48')][_0x1d9524['id']],_0x1d9524);}}}return _0x5be84e[_0x7add('0x48')];};};Realtime['prototype'][_0x7add('0x49')]=function(){var _0x87e45f=this;return function(_0x6c57d8){if(_0x6c57d8){freeIsNotKey(_0x6c57d8,_0x87e45f[_0x7add('0x18')],'id');for(var _0x5c5c62=0x0,_0x200bc9={},_0x7a5cea={};_0x5c5c62<_0x6c57d8[_0x7add('0x3f')];_0x5c5c62+=0x1){_0x200bc9=_0x6c57d8[_0x5c5c62];if(_['isUndefined'](_0x87e45f[_0x7add('0x18')][_0x200bc9['id']])){_0x87e45f[_0x7add('0x18')][_0x200bc9['id']]=new ZendeskAccount(_0x200bc9);}else{_0x87e45f[_0x7add('0x3d')](_0x87e45f[_0x7add('0x18')][_0x200bc9['id']],_0x200bc9);}}}return _0x87e45f['zendeskAccounts'];};};Realtime[_0x7add('0x3c')][_0x7add('0x4a')]=function(){var _0x1d8a4c=this;return function(_0x367aa0){if(_0x367aa0){freeIsNotKey(_0x367aa0,_0x1d8a4c[_0x7add('0x19')],'id');for(var _0x1e2a04=0x0,_0x59069c={},_0x4999a9={};_0x1e2a04<_0x367aa0['length'];_0x1e2a04+=0x1){_0x59069c=_0x367aa0[_0x1e2a04];if(_['isUndefined'](_0x1d8a4c['salesforceAccounts'][_0x59069c['id']])){_0x1d8a4c[_0x7add('0x19')][_0x59069c['id']]=new SalesforceAccount(_0x59069c);}else{_0x1d8a4c[_0x7add('0x3d')](_0x1d8a4c[_0x7add('0x19')][_0x59069c['id']],_0x59069c);}}}return _0x1d8a4c['salesforceAccounts'];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x4de35b=this;return function(_0x4dd976){if(_0x4dd976){freeIsNotKey(_0x4dd976,_0x4de35b['freshdeskAccounts'],'id');for(var _0x532386=0x0,_0x1cacd7={},_0x3454e5={};_0x532386<_0x4dd976['length'];_0x532386+=0x1){_0x1cacd7=_0x4dd976[_0x532386];if(_[_0x7add('0x41')](_0x4de35b[_0x7add('0x1b')][_0x1cacd7['id']])){_0x4de35b[_0x7add('0x1b')][_0x1cacd7['id']]=new FreshdeskAccount(_0x1cacd7);}else{_0x4de35b['mergeFromDatabase'](_0x4de35b['freshdeskAccounts'][_0x1cacd7['id']],_0x1cacd7);}}}return _0x4de35b[_0x7add('0x1b')];};};Realtime[_0x7add('0x3c')][_0x7add('0x4b')]=function(){var _0x4ddb1e=this;return function(_0x48c7c0){if(_0x48c7c0){freeIsNotKey(_0x48c7c0,_0x4ddb1e[_0x7add('0x1c')],'id');for(var _0x37d8fa=0x0,_0x1b8f86={},_0x1755c6={};_0x37d8fa<_0x48c7c0[_0x7add('0x3f')];_0x37d8fa+=0x1){_0x1b8f86=_0x48c7c0[_0x37d8fa];if(_[_0x7add('0x41')](_0x4ddb1e[_0x7add('0x1c')][_0x1b8f86['id']])){_0x4ddb1e['zohoAccounts'][_0x1b8f86['id']]=new ZohoAccount(_0x1b8f86);}else{_0x4ddb1e[_0x7add('0x3d')](_0x4ddb1e['zohoAccounts'][_0x1b8f86['id']],_0x1b8f86);}}}return _0x4ddb1e['zohoAccounts'];};};Realtime[_0x7add('0x3c')][_0x7add('0x4c')]=function(){var _0x2f9289=this;return function(_0x4eaee1){if(_0x4eaee1){freeIsNotKey(_0x4eaee1,_0x2f9289[_0x7add('0x1d')],'id');for(var _0x503440=0x0,_0x57a274={},_0x2847f2={};_0x503440<_0x4eaee1['length'];_0x503440+=0x1){_0x57a274=_0x4eaee1[_0x503440];if(_[_0x7add('0x41')](_0x2f9289[_0x7add('0x1d')][_0x57a274['id']])){_0x2f9289[_0x7add('0x1d')][_0x57a274['id']]=new DeskAccount(_0x57a274);}else{_0x2f9289[_0x7add('0x3d')](_0x2f9289[_0x7add('0x1d')][_0x57a274['id']],_0x57a274);}}}return _0x2f9289['deskAccounts'];};};Realtime[_0x7add('0x3c')][_0x7add('0x4d')]=function(){var _0x450f34=this;return function(_0x1c1608){if(_0x1c1608){freeIsNotKey(_0x1c1608,_0x450f34[_0x7add('0x1a')],'id');for(var _0x3516c2=0x0,_0x3e1c5f={},_0x561f59={};_0x3516c2<_0x1c1608['length'];_0x3516c2+=0x1){_0x3e1c5f=_0x1c1608[_0x3516c2];if(_[_0x7add('0x41')](_0x450f34[_0x7add('0x1a')][_0x3e1c5f['id']])){_0x450f34['sugarcrmAccounts'][_0x3e1c5f['id']]=new SugarcrmAccount(_0x3e1c5f);}else{_0x450f34[_0x7add('0x3d')](_0x450f34['sugarcrmAccounts'][_0x3e1c5f['id']],_0x3e1c5f);}}}return _0x450f34[_0x7add('0x1a')];};};Realtime[_0x7add('0x3c')][_0x7add('0x4e')]=function(){var _0xd954d2=this;return function(_0x5530de){if(_0x5530de){freeIsNotKey(_0x5530de,_0xd954d2[_0x7add('0x1e')],'id');for(var _0x423a66=0x0,_0x1b1633={},_0x3ea0c3={};_0x423a66<_0x5530de[_0x7add('0x3f')];_0x423a66+=0x1){_0x1b1633=_0x5530de[_0x423a66];if(_[_0x7add('0x41')](_0xd954d2[_0x7add('0x1e')][_0x1b1633['id']])){_0xd954d2[_0x7add('0x1e')][_0x1b1633['id']]=new VtigerAccount(_0x1b1633);}else{_0xd954d2[_0x7add('0x3d')](_0xd954d2[_0x7add('0x1e')][_0x1b1633['id']],_0x1b1633);}}}return _0xd954d2[_0x7add('0x1e')];};};Realtime[_0x7add('0x3c')]['initServicenowAccounts']=function(){var _0xcca292=this;return function(_0x5b39b2){if(_0x5b39b2){freeIsNotKey(_0x5b39b2,_0xcca292['servicenowAccounts'],'id');for(var _0x5d5f31=0x0,_0x3ee7c4={},_0x6f86c0={};_0x5d5f31<_0x5b39b2[_0x7add('0x3f')];_0x5d5f31+=0x1){_0x3ee7c4=_0x5b39b2[_0x5d5f31];if(_[_0x7add('0x41')](_0xcca292[_0x7add('0x1f')][_0x3ee7c4['id']])){_0xcca292['servicenowAccounts'][_0x3ee7c4['id']]=new ServicenowAccount(_0x3ee7c4);}else{_0xcca292[_0x7add('0x3d')](_0xcca292['servicenowAccounts'][_0x3ee7c4['id']],_0x3ee7c4);}}}return _0xcca292[_0x7add('0x1f')];};};Realtime['prototype'][_0x7add('0x4f')]=function(){var _0x299773=this;return function(_0x31a630){if(_0x31a630){freeIsNotKey(_0x31a630,_0x299773['dynamics365Accounts'],'id');for(var _0x14d7de=0x0,_0x481844={},_0x15b7c8={};_0x14d7de<_0x31a630[_0x7add('0x3f')];_0x14d7de+=0x1){_0x481844=_0x31a630[_0x14d7de];if(_['isUndefined'](_0x299773['dynamics365Accounts'][_0x481844['id']])){_0x299773[_0x7add('0x50')][_0x481844['id']]=new Dynamics365Account(_0x481844);}else{_0x299773['mergeFromDatabase'](_0x299773['dynamics365Accounts'][_0x481844['id']],_0x481844);}}}return _0x299773['dynamics365Accounts'];};};Realtime[_0x7add('0x3c')][_0x7add('0x51')]=function(){var _0x58f0ba=this;return function(_0x19d241){if(_0x19d241){freeIsNotKey(_0x19d241,_0x58f0ba[_0x7add('0x20')],'id');for(var _0x3feafd=0x0,_0x7b3478={},_0x59d623={};_0x3feafd<_0x19d241[_0x7add('0x3f')];_0x3feafd+=0x1){_0x7b3478=_0x19d241[_0x3feafd];if(_[_0x7add('0x41')](_0x58f0ba[_0x7add('0x20')][_0x7b3478['id']])){_0x58f0ba['freshsalesAccounts'][_0x7b3478['id']]=new FreshsalesAccount(_0x7b3478);}else{_0x58f0ba[_0x7add('0x3d')](_0x58f0ba['freshsalesAccounts'][_0x7b3478['id']],_0x7b3478);}}}return _0x58f0ba[_0x7add('0x20')];};};Realtime[_0x7add('0x3c')][_0x7add('0x52')]=function(){var _0x4b4128=this;return function(_0x1d2c16){for(var _0x4b4d12=0x0;_0x4b4d12<_0x1d2c16[_0x7add('0x3f')];_0x4b4d12+=0x1){_[_0x7add('0x53')](_0x4b4128[_0x7add('0x45')][_0x1d2c16[_0x4b4d12][_0x7add('0x26')]],_0x1d2c16[_0x4b4d12]);}return _0x4b4128['voiceQueues'];};};Realtime[_0x7add('0x3c')][_0x7add('0x54')]=function(){var _0x266067=this;return function(_0x31a569){clearVoiceQueues(_0x266067[_0x7add('0x45')]);if(_0x31a569){_0x31a569=_['groupBy'](_0x31a569,_0x7add('0x55'));for(var _0x5e8c35 in _0x31a569){if(_0x31a569['hasOwnProperty'](_0x5e8c35)){var _0x1fd8cb={};for(var _0x203924=0x0;_0x203924<_0x31a569[_0x5e8c35]['length'];_0x203924+=0x1){var _0x1d47e9=_0x31a569[_0x5e8c35][_0x203924][_0x7add('0x56')];if(_0x266067[_0x7add('0x45')][_0x1d47e9]){if(_0x31a569[_0x5e8c35][_0x203924][_0x7add('0x57')]){_0x266067['voiceQueues'][_0x1d47e9][_0x7add('0x58')]+=0x1;}if(_0x31a569[_0x5e8c35][_0x203924][_0x7add('0x59')]){_0x266067[_0x7add('0x45')][_0x1d47e9]['abandoned']+=0x1;}_0x266067[_0x7add('0x45')][_0x1d47e9][_0x7add('0x2a')]+=moment(_0x31a569[_0x5e8c35][_0x203924]['queuecallerleaveAt'])[_0x7add('0x5a')](moment(_0x31a569[_0x5e8c35][_0x203924][_0x7add('0x5b')]),_0x7add('0x5c'))||0x0;if(_0x203924===_0x31a569[_0x5e8c35][_0x7add('0x3f')]-0x1){_0x266067['voiceQueues'][_0x1d47e9][_0x7add('0x2b')]+=moment(_0x31a569[_0x5e8c35][_0x203924]['queuecallercompleteAt']||_0x31a569[_0x5e8c35][_0x203924]['queuecallerabandonAt']||_0x31a569[_0x5e8c35][_0x203924][_0x7add('0x5d')])[_0x7add('0x5a')](moment(_0x31a569[_0x5e8c35][_0x203924][_0x7add('0x5b')]),_0x7add('0x5c'))||0x0;_0x266067[_0x7add('0x45')][_0x1d47e9][_0x7add('0x28')]+=0x1;if(_0x31a569[_0x5e8c35][_0x203924]['queuecallercomplete']){_0x266067[_0x7add('0x45')][_0x1d47e9][_0x7add('0x29')]+=0x1;_0x266067[_0x7add('0x45')][_0x1d47e9]['sumBillable']+=moment(_0x31a569[_0x5e8c35][_0x203924][_0x7add('0x5e')])['diff'](moment(_0x31a569[_0x5e8c35][_0x203924][_0x7add('0x5f')]),'seconds')||0x0;}}else{_0x266067[_0x7add('0x45')][_0x1d47e9][_0x7add('0x2b')]+=_0x266067[_0x7add('0x45')][_0x1d47e9][_0x7add('0x2a')]||0x0;}}}}}}return _0x266067['voiceQueues'];};};Realtime['prototype'][_0x7add('0x60')]=function(){var _0x6bd23d=this;return function(_0x417f9f){clearVoiceCallReports(_0x6bd23d[_0x7add('0x13')]);if(_0x417f9f){for(var _0xbe158f=0x0;_0xbe158f<_0x417f9f[_0x7add('0x3f')];_0xbe158f+=0x1){_0x6bd23d['outbound'][_0x7add('0x28')]+=0x1;_0x6bd23d[_0x7add('0x13')][_0x7add('0x2b')]+=_0x417f9f[_0xbe158f][_0x7add('0x61')];if(_0x417f9f[_0xbe158f]['disposition']==='ANSWERED'){_0x6bd23d[_0x7add('0x13')][_0x7add('0x29')]+=0x1;_0x6bd23d[_0x7add('0x13')][_0x7add('0x2a')]+=_0x417f9f[_0xbe158f][_0x7add('0x61')]-_0x417f9f[_0xbe158f][_0x7add('0x62')]||0x0;_0x6bd23d[_0x7add('0x13')][_0x7add('0x2c')]+=_0x417f9f[_0xbe158f][_0x7add('0x62')];}}}return _0x6bd23d[_0x7add('0x13')];};};Realtime['prototype'][_0x7add('0x63')]=function(){var _0x59d99a=this;return function(_0x70b109){if(_0x70b109){freeIsNotKey(_0x70b109,_0x59d99a['campaigns'],'name');for(var _0x27f56a=0x0,_0x5ad173={};_0x27f56a<_0x70b109[_0x7add('0x3f')];_0x27f56a+=0x1){_0x5ad173=_0x70b109[_0x27f56a];if(_[_0x7add('0x41')](_0x59d99a[_0x7add('0x12')][_0x5ad173[_0x7add('0x26')]])){_0x59d99a[_0x7add('0x12')][_0x5ad173[_0x7add('0x26')]]=new Campaign(_0x5ad173);}else{_0x59d99a[_0x7add('0x3d')](_0x59d99a[_0x7add('0x12')][_0x5ad173[_0x7add('0x26')]],_0x5ad173);_0x59d99a[_0x7add('0x12')][_0x5ad173[_0x7add('0x26')]]['dialQueueProject']=_0x5ad173[_0x7add('0x64')]?_0x5ad173['SquareProject']['name']:undefined;}}}return _0x59d99a[_0x7add('0x12')];};};Realtime[_0x7add('0x3c')][_0x7add('0x65')]=function(){var _0x567ecc=this;return function(_0x35ef8d){if(_0x35ef8d){freeIsNotKey(_0x35ef8d,_0x567ecc[_0x7add('0x14')],'id');for(var _0x3f1f7f=0x0,_0x590e15={};_0x3f1f7f<_0x35ef8d[_0x7add('0x3f')];_0x3f1f7f+=0x1){_0x590e15=_0x35ef8d[_0x3f1f7f];if(_['isUndefined'](_0x567ecc[_0x7add('0x14')][_0x590e15['id']])){_0x567ecc[_0x7add('0x14')][_0x590e15['id']]=new VoiceExtension(_0x590e15);}else{_0x567ecc[_0x7add('0x3d')](_0x567ecc['voiceExtensions'][_0x590e15['id']],_0x590e15);}}}return _0x567ecc['voiceExtensions'];};};Realtime[_0x7add('0x3c')][_0x7add('0x66')]=function(){var _0x147720=this;return function(_0x35a525){clearCampaigns(_0x147720[_0x7add('0x12')]);for(var _0x570805=0x0;_0x570805<_0x35a525[_0x7add('0x3f')];_0x570805+=0x1){_['merge'](_0x147720[_0x7add('0x12')][_0x35a525[_0x570805][_0x7add('0x26')]],_0x35a525[_0x570805]);}return _0x147720[_0x7add('0x12')];};};Realtime[_0x7add('0x3c')][_0x7add('0x67')]=function(){var _0x7267f2=this;return function(_0x2043b0){if(_0x2043b0){freeIsNotKey(_0x2043b0,_0x7267f2[_0x7add('0x21')],'id');for(var _0x251df8=0x0,_0x3c33c9={},_0x5f536e={};_0x251df8<_0x2043b0[_0x7add('0x3f')];_0x251df8+=0x1){_0x3c33c9=_0x2043b0[_0x251df8];if(_['isUndefined'](_0x7267f2[_0x7add('0x21')][_0x3c33c9['id']])){_0x7267f2[_0x7add('0x21')][_0x3c33c9['id']]=new FaxAccount(_0x3c33c9);}else{_0x7267f2[_0x7add('0x3d')](_0x7267f2[_0x7add('0x21')][_0x3c33c9['id']],_0x3c33c9);}}}return _0x7267f2[_0x7add('0x21')];};};module['exports']=Realtime;
\ No newline at end of file
+var _0x2a39=['initTelephones','length','isUndefined','initTrunks','initTemplates','initSalesforceAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','merge','initVoiceQueueReports','groupBy','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallercomplete','initVoiceCallReports','outbound','duration','disposition','answered','billableseconds','initCampaigns','dialQueueProject','SquareProject','voiceExtensions','initFaxAccounts','bluebird','util','lodash','moment','../model/agent','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceQueues','triggers','campaigns','templates','channels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','faxAccounts','mapKeys','hasOwnProperty','format','name','interface','SIP/%s','total','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','agents'];(function(_0x359bbe,_0x5b7fcc){var _0x1b3353=function(_0x34b41c){while(--_0x34b41c){_0x359bbe['push'](_0x359bbe['shift']());}};_0x1b3353(++_0x5b7fcc);}(_0x2a39,0x91));var _0x92a3=function(_0x469687,_0x40608d){_0x469687=_0x469687-0x0;var _0x1127c9=_0x2a39[_0x469687];return _0x1127c9;};'use strict';var BPromise=require(_0x92a3('0x0'));var util=require(_0x92a3('0x1'));var _=require(_0x92a3('0x2'));var moment=require(_0x92a3('0x3'));var Agent=require(_0x92a3('0x4'));var Telephone=require('../model/telephone');var Trunk=require(_0x92a3('0x5'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x92a3('0x6'));var Template=require(_0x92a3('0x7'));var Campaign=require(_0x92a3('0x8'));var VoiceExtension=require(_0x92a3('0x9'));var ZendeskAccount=require(_0x92a3('0xa'));var SalesforceAccount=require(_0x92a3('0xb'));var FreshdeskAccount=require(_0x92a3('0xc'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x92a3('0xd'));var DeskAccount=require(_0x92a3('0xe'));var VtigerAccount=require(_0x92a3('0xf'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x92a3('0x10'));var FaxAccount=require(_0x92a3('0x11'));var Realtime=function(){this['agents']={};this[_0x92a3('0x12')]={};this[_0x92a3('0x13')]={};this[_0x92a3('0x14')]={};this[_0x92a3('0x15')]={};this[_0x92a3('0x16')]={};this[_0x92a3('0x17')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x92a3('0x18')]={};this['queueChannels']={};this[_0x92a3('0x19')]={};this[_0x92a3('0x1a')]={};this[_0x92a3('0x1b')]={};this[_0x92a3('0x1c')]={};this[_0x92a3('0x1d')]={};this[_0x92a3('0x1e')]={};this[_0x92a3('0x1f')]={};this[_0x92a3('0x20')]={};this[_0x92a3('0x21')]={};this[_0x92a3('0x22')]={};this['servicenowAccounts']={};this[_0x92a3('0x23')]={};this['freshsalesAccounts']={};this[_0x92a3('0x24')]={};};function freeIsNotKey(_0x282eed,_0x5691c2,_0x58fd40){var _0x22221d=_[_0x92a3('0x25')](_0x282eed,function(_0x378c10,_0x442fb8){return _0x378c10[_0x58fd40];});for(var _0x286bb5 in _0x5691c2){if(_0x5691c2[_0x92a3('0x26')](_0x286bb5)){if(!_0x22221d[_0x286bb5]){delete _0x5691c2[_0x286bb5];}}}}function freeIsNotKeySip(_0x35d773,_0x235823){var _0x4149ae=_[_0x92a3('0x25')](_0x35d773,function(_0x390e86,_0x4584b5){return util[_0x92a3('0x27')]('SIP/%s',_0x390e86[_0x92a3('0x28')]);});for(var _0x2f6583 in _0x235823){if(_0x235823[_0x92a3('0x26')](_0x2f6583)){if(!_0x4149ae[_0x2f6583]){delete _0x235823[_0x2f6583];}}}}function freeIsNotKeyAgent(_0x4cc8d1,_0x38d04f){var _0x21654b=_[_0x92a3('0x25')](_0x4cc8d1,function(_0x357b3,_0x24cb0d){var _0x525127=_['isNil'](_0x357b3[_0x92a3('0x29')])?util['format'](_0x92a3('0x2a'),_0x357b3['name']):_0x357b3['interface'];return _0x525127;});for(var _0x9a7bd4 in _0x38d04f){if(_0x38d04f[_0x92a3('0x26')](_0x9a7bd4)){if(!_0x21654b[_0x9a7bd4]){delete _0x38d04f[_0x9a7bd4];}}}}function clearVoiceCallReports(_0x4d928a){_0x4d928a[_0x92a3('0x2b')]=0x0;_0x4d928a['answered']=0x0;_0x4d928a[_0x92a3('0x2c')]=0x0;_0x4d928a[_0x92a3('0x2d')]=0x0;_0x4d928a[_0x92a3('0x2e')]=0x0;}function clearCampaigns(_0x312be1){if(!_[_0x92a3('0x2f')](_0x312be1)){for(var _0x3d8f37 in _0x312be1){if(_0x312be1[_0x92a3('0x26')](_0x3d8f37)){_0x312be1[_0x3d8f37][_0x92a3('0x30')]=0x0;_0x312be1[_0x3d8f37][_0x92a3('0x31')]=0x0;}}}}function clearVoiceQueues(_0x5248e7){if(!_[_0x92a3('0x2f')](_0x5248e7)){for(var _0x415dad in _0x5248e7){if(_0x5248e7[_0x92a3('0x26')](_0x415dad)){_0x5248e7[_0x415dad]['total']=0x0;_0x5248e7[_0x415dad]['answered']=0x0;_0x5248e7[_0x415dad][_0x92a3('0x32')]=0x0;_0x5248e7[_0x415dad]['abandoned']=0x0;_0x5248e7[_0x415dad]['sumHoldTime']=0x0;_0x5248e7[_0x415dad][_0x92a3('0x2d')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x2e')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x33')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x34')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x35')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x36')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x37')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x38')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x39')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x3a')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x3b')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x3c')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x3d')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x3e')]=0x0;_0x5248e7[_0x415dad]['outboundAnswerAgiCallsDay']=0x0;_0x5248e7[_0x415dad][_0x92a3('0x3f')]=0x0;_0x5248e7[_0x415dad][_0x92a3('0x40')]=!![];}}}}Realtime['prototype'][_0x92a3('0x41')]=function(_0x30e562,_0x36aafd){for(var _0x17c321 in _0x36aafd){if(_0x30e562[_0x92a3('0x26')](_0x17c321)){_0x30e562[_0x17c321]=_0x36aafd[_0x17c321];}}};Realtime[_0x92a3('0x42')][_0x92a3('0x43')]=function(){var _0x7d4aad=this;return function(_0x38934f){if(_0x38934f){freeIsNotKeyAgent(_0x38934f,_0x7d4aad[_0x92a3('0x44')]);for(var _0x53919d=0x0,_0x56231b={},_0xd47a04={};_0x53919d<_0x38934f['length'];_0x53919d+=0x1){_0x56231b=_0x38934f[_0x53919d];var _0xfe159b=_['isNil'](_0x56231b[_0x92a3('0x29')])?util[_0x92a3('0x27')](_0x92a3('0x2a'),_0x56231b[_0x92a3('0x28')]):_0x56231b[_0x92a3('0x29')];if(_['isUndefined'](_0x7d4aad['agents'][_0xfe159b])){_0x7d4aad[_0x92a3('0x44')][_0xfe159b]=new Agent(_0x56231b);}else{_0x7d4aad[_0x92a3('0x41')](_0x7d4aad[_0x92a3('0x44')][_0xfe159b],_0x56231b);}}}return _0x7d4aad[_0x92a3('0x44')];};};Realtime[_0x92a3('0x42')][_0x92a3('0x45')]=function(){var _0x54afe1=this;return function(_0x5c1d5f){if(_0x5c1d5f){freeIsNotKeySip(_0x5c1d5f,_0x54afe1[_0x92a3('0x12')]);for(var _0x4781ad=0x0,_0x443a03={},_0x312362={};_0x4781ad<_0x5c1d5f[_0x92a3('0x46')];_0x4781ad+=0x1){_0x443a03=_0x5c1d5f[_0x4781ad];if(_[_0x92a3('0x47')](_0x54afe1['telephones'][util[_0x92a3('0x27')](_0x92a3('0x2a'),_0x443a03[_0x92a3('0x28')])])){_0x54afe1[_0x92a3('0x12')][util['format'](_0x92a3('0x2a'),_0x443a03['name'])]=new Telephone(_0x443a03);}else{_0x54afe1[_0x92a3('0x41')](_0x54afe1['telephones'][util[_0x92a3('0x27')](_0x92a3('0x2a'),_0x443a03[_0x92a3('0x28')])],_0x443a03);}}}return _0x54afe1[_0x92a3('0x12')];};};Realtime[_0x92a3('0x42')][_0x92a3('0x48')]=function(){var _0x2022e8=this;return function(_0x33d905){if(_0x33d905){freeIsNotKeySip(_0x33d905,_0x2022e8[_0x92a3('0x13')]);for(var _0x359bb9=0x0,_0x1b7940={},_0x2dd266={};_0x359bb9<_0x33d905[_0x92a3('0x46')];_0x359bb9+=0x1){_0x1b7940=_0x33d905[_0x359bb9];if(_['isUndefined'](_0x2022e8[_0x92a3('0x13')][util[_0x92a3('0x27')](_0x92a3('0x2a'),_0x1b7940[_0x92a3('0x28')])])){_0x2022e8[_0x92a3('0x13')][util[_0x92a3('0x27')](_0x92a3('0x2a'),_0x1b7940['name'])]=new Trunk(_0x1b7940);}else{_0x2022e8[_0x92a3('0x41')](_0x2022e8[_0x92a3('0x13')][util[_0x92a3('0x27')]('SIP/%s',_0x1b7940[_0x92a3('0x28')])],_0x1b7940);}}}return _0x2022e8[_0x92a3('0x13')];};};Realtime[_0x92a3('0x42')]['initVoiceQueues']=function(){var _0x3968fe=this;return function(_0x1fb7e1){if(_0x1fb7e1){freeIsNotKey(_0x1fb7e1,_0x3968fe[_0x92a3('0x14')],'name');for(var _0x2afc7e=0x0,_0x8464c8={},_0x752725={};_0x2afc7e<_0x1fb7e1[_0x92a3('0x46')];_0x2afc7e+=0x1){_0x8464c8=_0x1fb7e1[_0x2afc7e];if(_[_0x92a3('0x47')](_0x3968fe[_0x92a3('0x14')][_0x8464c8[_0x92a3('0x28')]])){_0x3968fe['voiceQueues'][_0x8464c8[_0x92a3('0x28')]]=new VoiceQueue(_0x8464c8);}else{_0x3968fe[_0x92a3('0x41')](_0x3968fe[_0x92a3('0x14')][_0x8464c8[_0x92a3('0x28')]],_0x8464c8);}}}return _0x3968fe[_0x92a3('0x14')];};};Realtime['prototype']['initTriggers']=function(){var _0x26287a=this;return function(_0x3e2db2){if(_0x3e2db2){freeIsNotKey(_0x3e2db2,_0x26287a['triggers'],'id');for(var _0xfbf807=0x0,_0x1d09a7={},_0x3fd683={};_0xfbf807<_0x3e2db2['length'];_0xfbf807+=0x1){_0x1d09a7=_0x3e2db2[_0xfbf807];if(_[_0x92a3('0x47')](_0x26287a[_0x92a3('0x15')][_0x1d09a7['id']])){_0x26287a[_0x92a3('0x15')][_0x1d09a7['id']]=new Trigger(_0x1d09a7);}else{_0x26287a[_0x92a3('0x41')](_0x26287a['triggers'][_0x1d09a7['id']],_0x1d09a7);}}}return _0x26287a[_0x92a3('0x15')];};};Realtime['prototype'][_0x92a3('0x49')]=function(){var _0x54e5a4=this;return function(_0x10af79){if(_0x10af79){freeIsNotKey(_0x10af79,_0x54e5a4[_0x92a3('0x17')],'id');for(var _0x1ab761=0x0,_0x16a2b4={},_0x20f10e={};_0x1ab761<_0x10af79[_0x92a3('0x46')];_0x1ab761+=0x1){_0x16a2b4=_0x10af79[_0x1ab761];if(_[_0x92a3('0x47')](_0x54e5a4[_0x92a3('0x17')][_0x16a2b4['id']])){_0x54e5a4[_0x92a3('0x17')][_0x16a2b4['id']]=new Template(_0x16a2b4);}else{_0x54e5a4[_0x92a3('0x41')](_0x54e5a4[_0x92a3('0x17')][_0x16a2b4['id']],_0x16a2b4);}}}return _0x54e5a4['templates'];};};Realtime['prototype']['initZendeskAccounts']=function(){var _0x511a3b=this;return function(_0x5988b8){if(_0x5988b8){freeIsNotKey(_0x5988b8,_0x511a3b['zendeskAccounts'],'id');for(var _0x27338e=0x0,_0x2399bb={},_0x45b47c={};_0x27338e<_0x5988b8['length'];_0x27338e+=0x1){_0x2399bb=_0x5988b8[_0x27338e];if(_[_0x92a3('0x47')](_0x511a3b[_0x92a3('0x1c')][_0x2399bb['id']])){_0x511a3b['zendeskAccounts'][_0x2399bb['id']]=new ZendeskAccount(_0x2399bb);}else{_0x511a3b[_0x92a3('0x41')](_0x511a3b[_0x92a3('0x1c')][_0x2399bb['id']],_0x2399bb);}}}return _0x511a3b[_0x92a3('0x1c')];};};Realtime['prototype'][_0x92a3('0x4a')]=function(){var _0x153502=this;return function(_0x4dde29){if(_0x4dde29){freeIsNotKey(_0x4dde29,_0x153502['salesforceAccounts'],'id');for(var _0x2940c2=0x0,_0x2aadd6={},_0x815f76={};_0x2940c2<_0x4dde29[_0x92a3('0x46')];_0x2940c2+=0x1){_0x2aadd6=_0x4dde29[_0x2940c2];if(_['isUndefined'](_0x153502[_0x92a3('0x1d')][_0x2aadd6['id']])){_0x153502[_0x92a3('0x1d')][_0x2aadd6['id']]=new SalesforceAccount(_0x2aadd6);}else{_0x153502[_0x92a3('0x41')](_0x153502[_0x92a3('0x1d')][_0x2aadd6['id']],_0x2aadd6);}}}return _0x153502[_0x92a3('0x1d')];};};Realtime[_0x92a3('0x42')]['initFreshdeskAccounts']=function(){var _0x3b8d49=this;return function(_0x313222){if(_0x313222){freeIsNotKey(_0x313222,_0x3b8d49[_0x92a3('0x1f')],'id');for(var _0x17d751=0x0,_0x7ad466={},_0x2540e8={};_0x17d751<_0x313222[_0x92a3('0x46')];_0x17d751+=0x1){_0x7ad466=_0x313222[_0x17d751];if(_[_0x92a3('0x47')](_0x3b8d49['freshdeskAccounts'][_0x7ad466['id']])){_0x3b8d49['freshdeskAccounts'][_0x7ad466['id']]=new FreshdeskAccount(_0x7ad466);}else{_0x3b8d49[_0x92a3('0x41')](_0x3b8d49['freshdeskAccounts'][_0x7ad466['id']],_0x7ad466);}}}return _0x3b8d49['freshdeskAccounts'];};};Realtime[_0x92a3('0x42')]['initZohoAccounts']=function(){var _0x4aa6c2=this;return function(_0x5bf2bf){if(_0x5bf2bf){freeIsNotKey(_0x5bf2bf,_0x4aa6c2[_0x92a3('0x20')],'id');for(var _0x5995aa=0x0,_0x38de75={},_0x4a6a73={};_0x5995aa<_0x5bf2bf[_0x92a3('0x46')];_0x5995aa+=0x1){_0x38de75=_0x5bf2bf[_0x5995aa];if(_[_0x92a3('0x47')](_0x4aa6c2['zohoAccounts'][_0x38de75['id']])){_0x4aa6c2['zohoAccounts'][_0x38de75['id']]=new ZohoAccount(_0x38de75);}else{_0x4aa6c2['mergeFromDatabase'](_0x4aa6c2[_0x92a3('0x20')][_0x38de75['id']],_0x38de75);}}}return _0x4aa6c2['zohoAccounts'];};};Realtime[_0x92a3('0x42')][_0x92a3('0x4b')]=function(){var _0xbd71a7=this;return function(_0x51a8b5){if(_0x51a8b5){freeIsNotKey(_0x51a8b5,_0xbd71a7[_0x92a3('0x21')],'id');for(var _0x563ed5=0x0,_0x3b0cb1={},_0x2a5197={};_0x563ed5<_0x51a8b5[_0x92a3('0x46')];_0x563ed5+=0x1){_0x3b0cb1=_0x51a8b5[_0x563ed5];if(_[_0x92a3('0x47')](_0xbd71a7[_0x92a3('0x21')][_0x3b0cb1['id']])){_0xbd71a7[_0x92a3('0x21')][_0x3b0cb1['id']]=new DeskAccount(_0x3b0cb1);}else{_0xbd71a7['mergeFromDatabase'](_0xbd71a7['deskAccounts'][_0x3b0cb1['id']],_0x3b0cb1);}}}return _0xbd71a7[_0x92a3('0x21')];};};Realtime[_0x92a3('0x42')][_0x92a3('0x4c')]=function(){var _0x1e7ba8=this;return function(_0x3e0002){if(_0x3e0002){freeIsNotKey(_0x3e0002,_0x1e7ba8['sugarcrmAccounts'],'id');for(var _0x53ba70=0x0,_0xe58137={},_0x1a4430={};_0x53ba70<_0x3e0002[_0x92a3('0x46')];_0x53ba70+=0x1){_0xe58137=_0x3e0002[_0x53ba70];if(_[_0x92a3('0x47')](_0x1e7ba8[_0x92a3('0x1e')][_0xe58137['id']])){_0x1e7ba8[_0x92a3('0x1e')][_0xe58137['id']]=new SugarcrmAccount(_0xe58137);}else{_0x1e7ba8[_0x92a3('0x41')](_0x1e7ba8['sugarcrmAccounts'][_0xe58137['id']],_0xe58137);}}}return _0x1e7ba8[_0x92a3('0x1e')];};};Realtime[_0x92a3('0x42')][_0x92a3('0x4d')]=function(){var _0x4b15a2=this;return function(_0xa399a9){if(_0xa399a9){freeIsNotKey(_0xa399a9,_0x4b15a2[_0x92a3('0x22')],'id');for(var _0x5cdaf5=0x0,_0x3955e8={},_0x347cbb={};_0x5cdaf5<_0xa399a9[_0x92a3('0x46')];_0x5cdaf5+=0x1){_0x3955e8=_0xa399a9[_0x5cdaf5];if(_[_0x92a3('0x47')](_0x4b15a2[_0x92a3('0x22')][_0x3955e8['id']])){_0x4b15a2['vtigerAccounts'][_0x3955e8['id']]=new VtigerAccount(_0x3955e8);}else{_0x4b15a2[_0x92a3('0x41')](_0x4b15a2[_0x92a3('0x22')][_0x3955e8['id']],_0x3955e8);}}}return _0x4b15a2[_0x92a3('0x22')];};};Realtime[_0x92a3('0x42')][_0x92a3('0x4e')]=function(){var _0x1a6b61=this;return function(_0x2c45fd){if(_0x2c45fd){freeIsNotKey(_0x2c45fd,_0x1a6b61[_0x92a3('0x4f')],'id');for(var _0x1a274b=0x0,_0x509f54={},_0x3c057f={};_0x1a274b<_0x2c45fd['length'];_0x1a274b+=0x1){_0x509f54=_0x2c45fd[_0x1a274b];if(_[_0x92a3('0x47')](_0x1a6b61[_0x92a3('0x4f')][_0x509f54['id']])){_0x1a6b61[_0x92a3('0x4f')][_0x509f54['id']]=new ServicenowAccount(_0x509f54);}else{_0x1a6b61[_0x92a3('0x41')](_0x1a6b61['servicenowAccounts'][_0x509f54['id']],_0x509f54);}}}return _0x1a6b61[_0x92a3('0x4f')];};};Realtime[_0x92a3('0x42')][_0x92a3('0x50')]=function(){var _0x261555=this;return function(_0x2aae62){if(_0x2aae62){freeIsNotKey(_0x2aae62,_0x261555[_0x92a3('0x23')],'id');for(var _0x4dd4c1=0x0,_0x325582={},_0x498313={};_0x4dd4c1<_0x2aae62[_0x92a3('0x46')];_0x4dd4c1+=0x1){_0x325582=_0x2aae62[_0x4dd4c1];if(_[_0x92a3('0x47')](_0x261555['dynamics365Accounts'][_0x325582['id']])){_0x261555[_0x92a3('0x23')][_0x325582['id']]=new Dynamics365Account(_0x325582);}else{_0x261555['mergeFromDatabase'](_0x261555['dynamics365Accounts'][_0x325582['id']],_0x325582);}}}return _0x261555[_0x92a3('0x23')];};};Realtime[_0x92a3('0x42')][_0x92a3('0x51')]=function(){var _0x3de503=this;return function(_0x196be5){if(_0x196be5){freeIsNotKey(_0x196be5,_0x3de503[_0x92a3('0x52')],'id');for(var _0x1b2b18=0x0,_0x1fe2d5={},_0x4fdf80={};_0x1b2b18<_0x196be5[_0x92a3('0x46')];_0x1b2b18+=0x1){_0x1fe2d5=_0x196be5[_0x1b2b18];if(_[_0x92a3('0x47')](_0x3de503[_0x92a3('0x52')][_0x1fe2d5['id']])){_0x3de503[_0x92a3('0x52')][_0x1fe2d5['id']]=new FreshsalesAccount(_0x1fe2d5);}else{_0x3de503[_0x92a3('0x41')](_0x3de503[_0x92a3('0x52')][_0x1fe2d5['id']],_0x1fe2d5);}}}return _0x3de503['freshsalesAccounts'];};};Realtime['prototype']['initVoiceQueueHopperHistory']=function(){var _0x2a40b4=this;return function(_0xd08e0){for(var _0x2fd91=0x0;_0x2fd91<_0xd08e0[_0x92a3('0x46')];_0x2fd91+=0x1){_[_0x92a3('0x53')](_0x2a40b4[_0x92a3('0x14')][_0xd08e0[_0x2fd91]['name']],_0xd08e0[_0x2fd91]);}return _0x2a40b4[_0x92a3('0x14')];};};Realtime[_0x92a3('0x42')][_0x92a3('0x54')]=function(){var _0x46d879=this;return function(_0x5766f8){clearVoiceQueues(_0x46d879['voiceQueues']);if(_0x5766f8){_0x5766f8=_[_0x92a3('0x55')](_0x5766f8,'uniqueid');for(var _0x2fabc2 in _0x5766f8){if(_0x5766f8[_0x92a3('0x26')](_0x2fabc2)){var _0x3b08ca={};for(var _0x44fac9=0x0;_0x44fac9<_0x5766f8[_0x2fabc2][_0x92a3('0x46')];_0x44fac9+=0x1){var _0x26f7ae=_0x5766f8[_0x2fabc2][_0x44fac9][_0x92a3('0x56')];if(_0x46d879['voiceQueues'][_0x26f7ae]){if(_0x5766f8[_0x2fabc2][_0x44fac9][_0x92a3('0x57')]){_0x46d879[_0x92a3('0x14')][_0x26f7ae][_0x92a3('0x32')]+=0x1;}if(_0x5766f8[_0x2fabc2][_0x44fac9][_0x92a3('0x58')]){_0x46d879[_0x92a3('0x14')][_0x26f7ae]['abandoned']+=0x1;}_0x46d879[_0x92a3('0x14')][_0x26f7ae][_0x92a3('0x2c')]+=moment(_0x5766f8[_0x2fabc2][_0x44fac9][_0x92a3('0x59')])[_0x92a3('0x5a')](moment(_0x5766f8[_0x2fabc2][_0x44fac9][_0x92a3('0x5b')]),_0x92a3('0x5c'))||0x0;if(_0x44fac9===_0x5766f8[_0x2fabc2]['length']-0x1){_0x46d879[_0x92a3('0x14')][_0x26f7ae]['sumDuration']+=moment(_0x5766f8[_0x2fabc2][_0x44fac9][_0x92a3('0x5d')]||_0x5766f8[_0x2fabc2][_0x44fac9][_0x92a3('0x5e')]||_0x5766f8[_0x2fabc2][_0x44fac9]['queuecallerexitAt'])['diff'](moment(_0x5766f8[_0x2fabc2][_0x44fac9]['queuecallerjoinAt']),'seconds')||0x0;_0x46d879[_0x92a3('0x14')][_0x26f7ae][_0x92a3('0x2b')]+=0x1;if(_0x5766f8[_0x2fabc2][_0x44fac9][_0x92a3('0x5f')]){_0x46d879[_0x92a3('0x14')][_0x26f7ae]['answered']+=0x1;_0x46d879[_0x92a3('0x14')][_0x26f7ae][_0x92a3('0x2e')]+=moment(_0x5766f8[_0x2fabc2][_0x44fac9][_0x92a3('0x5d')])[_0x92a3('0x5a')](moment(_0x5766f8[_0x2fabc2][_0x44fac9][_0x92a3('0x59')]),_0x92a3('0x5c'))||0x0;}}else{_0x46d879[_0x92a3('0x14')][_0x26f7ae][_0x92a3('0x2d')]+=_0x46d879[_0x92a3('0x14')][_0x26f7ae][_0x92a3('0x2c')]||0x0;}}}}}}return _0x46d879[_0x92a3('0x14')];};};Realtime[_0x92a3('0x42')][_0x92a3('0x60')]=function(){var _0x2807ae=this;return function(_0x36f839){clearVoiceCallReports(_0x2807ae[_0x92a3('0x61')]);if(_0x36f839){for(var _0x155091=0x0;_0x155091<_0x36f839['length'];_0x155091+=0x1){_0x2807ae['outbound'][_0x92a3('0x2b')]+=0x1;_0x2807ae[_0x92a3('0x61')][_0x92a3('0x2d')]+=_0x36f839[_0x155091][_0x92a3('0x62')];if(_0x36f839[_0x155091][_0x92a3('0x63')]==='ANSWERED'){_0x2807ae[_0x92a3('0x61')][_0x92a3('0x64')]+=0x1;_0x2807ae[_0x92a3('0x61')][_0x92a3('0x2c')]+=_0x36f839[_0x155091][_0x92a3('0x62')]-_0x36f839[_0x155091]['billableseconds']||0x0;_0x2807ae['outbound'][_0x92a3('0x2e')]+=_0x36f839[_0x155091][_0x92a3('0x65')];}}}return _0x2807ae[_0x92a3('0x61')];};};Realtime[_0x92a3('0x42')][_0x92a3('0x66')]=function(){var _0x4c9167=this;return function(_0x4ae85f){if(_0x4ae85f){freeIsNotKey(_0x4ae85f,_0x4c9167[_0x92a3('0x16')],'name');for(var _0xc49bea=0x0,_0x486908={};_0xc49bea<_0x4ae85f[_0x92a3('0x46')];_0xc49bea+=0x1){_0x486908=_0x4ae85f[_0xc49bea];if(_[_0x92a3('0x47')](_0x4c9167[_0x92a3('0x16')][_0x486908[_0x92a3('0x28')]])){_0x4c9167['campaigns'][_0x486908['name']]=new Campaign(_0x486908);}else{_0x4c9167[_0x92a3('0x41')](_0x4c9167['campaigns'][_0x486908[_0x92a3('0x28')]],_0x486908);_0x4c9167[_0x92a3('0x16')][_0x486908[_0x92a3('0x28')]][_0x92a3('0x67')]=_0x486908[_0x92a3('0x68')]?_0x486908[_0x92a3('0x68')][_0x92a3('0x28')]:undefined;}}}return _0x4c9167[_0x92a3('0x16')];};};Realtime[_0x92a3('0x42')]['initVoiceExtensions']=function(){var _0x527f1e=this;return function(_0x429476){if(_0x429476){freeIsNotKey(_0x429476,_0x527f1e[_0x92a3('0x69')],'id');for(var _0x2db122=0x0,_0x370f05={};_0x2db122<_0x429476[_0x92a3('0x46')];_0x2db122+=0x1){_0x370f05=_0x429476[_0x2db122];if(_[_0x92a3('0x47')](_0x527f1e[_0x92a3('0x69')][_0x370f05['id']])){_0x527f1e[_0x92a3('0x69')][_0x370f05['id']]=new VoiceExtension(_0x370f05);}else{_0x527f1e[_0x92a3('0x41')](_0x527f1e['voiceExtensions'][_0x370f05['id']],_0x370f05);}}}return _0x527f1e[_0x92a3('0x69')];};};Realtime[_0x92a3('0x42')]['initCampaignHopperHistory']=function(){var _0x227f13=this;return function(_0x5edfc2){clearCampaigns(_0x227f13[_0x92a3('0x16')]);for(var _0x43ce46=0x0;_0x43ce46<_0x5edfc2[_0x92a3('0x46')];_0x43ce46+=0x1){_[_0x92a3('0x53')](_0x227f13[_0x92a3('0x16')][_0x5edfc2[_0x43ce46]['name']],_0x5edfc2[_0x43ce46]);}return _0x227f13[_0x92a3('0x16')];};};Realtime['prototype'][_0x92a3('0x6a')]=function(){var _0x149ea0=this;return function(_0x588e38){if(_0x588e38){freeIsNotKey(_0x588e38,_0x149ea0[_0x92a3('0x24')],'id');for(var _0x5c38e2=0x0,_0x3b633f={},_0x16edf6={};_0x5c38e2<_0x588e38[_0x92a3('0x46')];_0x5c38e2+=0x1){_0x3b633f=_0x588e38[_0x5c38e2];if(_[_0x92a3('0x47')](_0x149ea0[_0x92a3('0x24')][_0x3b633f['id']])){_0x149ea0[_0x92a3('0x24')][_0x3b633f['id']]=new FaxAccount(_0x3b633f);}else{_0x149ea0[_0x92a3('0x41')](_0x149ea0['faxAccounts'][_0x3b633f['id']],_0x3b633f);}}}return _0x149ea0['faxAccounts'];};};module['exports']=Realtime;
\ No newline at end of file
index 6661f0c..7a63d2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3226=['channel','disposition','ANSWERED','connectedlinenum','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','monitors','monitorFilename','filename','createdAt','connectedlinename','xcally-motion-dialer','isArray','forEach','voiceDialReport','startsWith','Local','substring','indexOf','mobile','lastIndexOf','membername','transfererlinkedid','attendedTransfer','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','agents','telephones','prototype','sync','realtime','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindTransfer','attendedtransfer','findAgent','find','accountcode','name','interface','format','SIP/%s','length','lastAssignedTo','isNil','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','destination','exten','type','dialer','lastapplication','queue','context','from-voip-provider','callerid','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum'];(function(_0x488e98,_0x1806fc){var _0x57acd8=function(_0x4bdb4c){while(--_0x4bdb4c){_0x488e98['push'](_0x488e98['shift']());}};_0x57acd8(++_0x1806fc);}(_0x3226,0x128));var _0x6322=function(_0x39e23f,_0x27fd31){_0x39e23f=_0x39e23f-0x0;var _0x3f6388=_0x3226[_0x39e23f];return _0x3f6388;};'use strict';var _=require(_0x6322('0x0'));var moment=require(_0x6322('0x1'));var util=require(_0x6322('0x2'));var config=require(_0x6322('0x3'));var ami=require(_0x6322('0x4'));var RpcVoiceAgentReport=require(_0x6322('0x5'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x6322('0x6'));var RpcMemberReport=require(_0x6322('0x7'));var RpcVoiceQueueReport=require(_0x6322('0x8'));var RpcVoiceRecording=require(_0x6322('0x9'));var RpcVoiceTransferReport=require(_0x6322('0xa'));var VoiceQueueReport=require(_0x6322('0xb'));var VoiceCallReport=require(_0x6322('0xc'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x6322('0xd'));var UserReport=require(_0x6322('0xe'));function Report(_0xbe18a4){this['realtime']=_0xbe18a4;this[_0x6322('0xf')]=_0xbe18a4[_0x6322('0xf')];this['telephones']=_0xbe18a4[_0x6322('0x10')];}Report[_0x6322('0x11')][_0x6322('0x12')]=function(_0x2481de){var _0x4cd7ec=new VoiceQueueReport(this[_0x6322('0x13')]);var _0x11a059=new VoiceAgentReport(this[_0x6322('0x13')]);var _0xfd9de8=new VoiceDialReport(this['realtime']);var _0x305e79=new VoiceCallReport(this['realtime']);var _0x254ea9=new UserReport(this[_0x6322('0x13')]);if(config['xdr']&&config['xdr'][_0x6322('0x14')]){ami['on'](_0x6322('0x15'),this[_0x6322('0x16')][_0x6322('0x17')](this));ami['on'](_0x6322('0x18'),this[_0x6322('0x19')]['bind'](this));ami['on'](_0x6322('0x1a'),this[_0x6322('0x1b')]['bind'](this));ami['on'](_0x6322('0x1c'),this['voiceDialReport'][_0x6322('0x17')](this));ami['on']('blindtransfer',this[_0x6322('0x1d')][_0x6322('0x17')](this));ami['on'](_0x6322('0x1e'),this['attendedTransfer'][_0x6322('0x17')](this));}};Report[_0x6322('0x11')][_0x6322('0x1f')]=function(_0x57db05){var _0x52612a;_0x52612a=_[_0x6322('0x20')](this[_0x6322('0xf')],function(_0x2f8f6a){return _0x2f8f6a[_0x6322('0x21')]==_0x57db05||_0x2f8f6a[_0x6322('0x22')]==_0x57db05;});if(_['isNil'](_0x52612a)){var _0x385077=_[_0x6322('0x20')](this[_0x6322('0x10')],function(_0x22cd49){return _0x22cd49[_0x6322('0x21')]==_0x57db05||_0x22cd49['name']==_0x57db05;});if(_0x385077){_0x52612a=_[_0x6322('0x20')](this[_0x6322('0xf')],function(_0x593b05){return _0x593b05[_0x6322('0x23')]==util[_0x6322('0x24')](_0x6322('0x25'),_0x385077[_0x6322('0x22')]);});}}return _0x52612a;};Report[_0x6322('0x11')][_0x6322('0x16')]=function(_0x3afd8f){for(var _0x457492=0x0;_0x457492<_0x3afd8f[_0x6322('0x26')];_0x457492+=0x1){var _0x50c263=this['findAgent'](_0x3afd8f[_0x457492]['connectedlinenum']);if(_0x50c263){_0x3afd8f[_0x457492]['accountcode']=_0x50c263[_0x6322('0x21')];_0x3afd8f[_0x457492]['assigned']=!![];_0x3afd8f[_0x457492][_0x6322('0x27')]=_0x50c263[_0x6322('0x22')];_0x3afd8f[_0x457492][_0x6322('0x23')]=_[_0x6322('0x28')](_0x50c263['interface'])?util[_0x6322('0x24')](_0x6322('0x25'),_0x50c263['name']):_0x50c263[_0x6322('0x23')];if(_0x3afd8f[_0x457492][_0x6322('0x29')]){_0x3afd8f[_0x457492]['queuecallercompleteAt']=moment()[_0x6322('0x24')](_0x6322('0x2a'));}if(_0x3afd8f[_0x457492][_0x6322('0x2b')]){_0x3afd8f[_0x457492][_0x6322('0x2c')]=moment()['format'](_0x6322('0x2a'));}RpcMemberReport[_0x6322('0x16')](_0x3afd8f[_0x457492]);}RpcVoiceQueueReport[_0x6322('0x2d')](_0x3afd8f[_0x457492]);}};function extractCalleridNumber(_0x51ae7f){var _0x67318=_0x51ae7f[_0x6322('0x2e')](/<(.*?)>/);return _0x67318?_0x67318[0x1]:_0x51ae7f;}Report[_0x6322('0x11')][_0x6322('0x19')]=function(_0x4d7821){_0x4d7821[_0x6322('0x2f')]=_0x4d7821[_0x6322('0x2f')]||_0x4d7821[_0x6322('0x30')];if(_0x4d7821[_0x6322('0x31')]==_0x6322('0x32')){_0x4d7821[_0x6322('0x33')]=_0x6322('0x34');_0x4d7821['lastdata']=_0x4d7821[_0x6322('0x34')];if(_0x4d7821[_0x6322('0x35')]==_0x6322('0x36')){_0x4d7821['accountcode']='';_0x4d7821[_0x6322('0x2f')]=extractCalleridNumber(_0x4d7821[_0x6322('0x37')]);}else if(_0x4d7821['context']=='from-sip'){if(_0x4d7821[_0x6322('0x2f')]==_0x6322('0x38')){_0x4d7821['destination']=extractCalleridNumber(_0x4d7821[_0x6322('0x39')]);_0x4d7821[_0x6322('0x3a')]=_0x4d7821[_0x6322('0x3b')];_0x4d7821['destinationchannel']=[_0x4d7821[_0x6322('0x3c')],_0x4d7821[_0x6322('0x3c')]=_0x4d7821['destinationchannel']][0x0];_0x4d7821['callerid']=_0x4d7821[_0x6322('0x39')];}else{_0x4d7821[_0x6322('0x2f')]=_0x4d7821[_0x6322('0x3a')];_0x4d7821[_0x6322('0x3a')]=_0x4d7821[_0x6322('0x3b')];if(_0x4d7821[_0x6322('0x3d')]==_0x6322('0x3e')){_0x4d7821[_0x6322('0x21')]=_0x4d7821[_0x6322('0x3f')];}else{_0x4d7821['accountcode']='';}}}}else{_0x4d7821[_0x6322('0x37')]=util[_0x6322('0x24')](_0x6322('0x40'),_0x4d7821[_0x6322('0x41')],_0x4d7821[_0x6322('0x3a')]);}if(RpcVoiceTransferReport[_0x6322('0x42')][_0x4d7821[_0x6322('0x43')]]){var _0x48856a=RpcVoiceTransferReport[_0x6322('0x42')][_0x4d7821[_0x6322('0x43')]];_0x48856a[_0x6322('0x44')]=_0x4d7821[_0x6322('0x45')];RpcVoiceTransferReport[_0x6322('0x1d')](_0x48856a);delete RpcVoiceTransferReport[_0x6322('0x42')][_0x4d7821[_0x6322('0x43')]];}RpcVoiceCallReport[_0x6322('0x2d')](_0x4d7821);if(_0x4d7821['monitor']){for(var _0xb0bb54=0x0;_0xb0bb54<_0x4d7821[_0x6322('0x46')][_0x6322('0x26')];_0xb0bb54+=0x1){_0x4d7821[_0x6322('0x47')]=_0x4d7821[_0x6322('0x46')][_0xb0bb54][_0x6322('0x48')];_0x4d7821[_0x6322('0x49')]=_0x4d7821[_0x6322('0x46')][_0xb0bb54][_0x6322('0x49')];if(_0x4d7821[_0x6322('0x30')]==_0x6322('0x38')){_0x4d7821[_0x6322('0x3a')]=_0x4d7821[_0x6322('0x3f')];_0x4d7821['calleridname']=_0x4d7821['connectedlinename'];_0x4d7821[_0x6322('0x3f')]=_0x4d7821[_0x6322('0x21')];_0x4d7821[_0x6322('0x4a')]=_0x4d7821['membername'];_0x4d7821[_0x6322('0x30')]=_0x4d7821['originatecalleridnum'];}else if(_0x4d7821[_0x6322('0x30')]==_0x6322('0x4b')){_0x4d7821['calleridnum']=_0x4d7821[_0x6322('0x2f')];_0x4d7821[_0x6322('0x30')]=_0x4d7821[_0x6322('0x3b')];}RpcVoiceRecording[_0x6322('0x2d')](_0x4d7821);}}};Report[_0x6322('0x11')][_0x6322('0x1b')]=function(_0x502ad2){if(_[_0x6322('0x4c')](_0x502ad2)){_0x502ad2[_0x6322('0x4d')](function(_0x72b649){RpcVoiceAgentReport[_0x6322('0x2d')](_0x72b649);});}else{RpcVoiceAgentReport[_0x6322('0x2d')](_0x502ad2);}};Report[_0x6322('0x11')][_0x6322('0x4e')]=function(_0x20bb66){RpcVoiceDialReport[_0x6322('0x2d')](_0x20bb66);var _0x315d00;var _0x2e274d;var _0x204476=_0x20bb66[_0x6322('0x3c')];if(_[_0x6322('0x4f')](_0x204476,_0x6322('0x50'))){_0x2e274d=_0x204476[_0x6322('0x51')](_0x204476[_0x6322('0x52')]('/')+0x1,_0x204476[_0x6322('0x52')]('@'));_0x315d00=_[_0x6322('0x20')](this[_0x6322('0xf')],function(_0x3153a0){return _0x3153a0[_0x6322('0x53')]==_0x2e274d||_0x3153a0['phone']==_0x2e274d||_0x3153a0[_0x6322('0x21')]==_0x2e274d;});}else{_0x2e274d=_0x204476[_0x6322('0x51')](_0x204476[_0x6322('0x52')]('/')+0x1,_0x204476[_0x6322('0x54')]('-'));_0x315d00=this[_0x6322('0x1f')](_0x2e274d);}if(_0x315d00){_0x20bb66[_0x6322('0x23')]=_[_0x6322('0x28')](_0x315d00['interface'])?util[_0x6322('0x24')](_0x6322('0x25'),_0x315d00[_0x6322('0x22')]):_0x315d00[_0x6322('0x23')];_0x20bb66[_0x6322('0x55')]=_0x315d00[_0x6322('0x22')];_0x20bb66[_0x6322('0x21')]=_0x315d00['accountcode'];RpcMemberReport['voiceDialReport'](_0x20bb66);}};Report[_0x6322('0x11')][_0x6322('0x1d')]=function(_0x544942){RpcVoiceTransferReport[_0x6322('0x42')][_0x544942[_0x6322('0x56')]]=_0x544942;};Report['prototype'][_0x6322('0x57')]=function(_0x2c61bc){RpcVoiceTransferReport['attendedTransfer'](_0x2c61bc);};module[_0x6322('0x58')]=Report;
\ No newline at end of file
+var _0xb675=['transfererlinkedid','lodash','moment','util','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','telephones','prototype','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','agents','accountcode','name','isNil','find','format','SIP/%s','length','assigned','interface','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','destination','type','dialer','queue','lastdata','from-voip-provider','callerid','context','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','ANSWERED','connectedlinenum','calleridname','linkedid','transfers','transfereelinkedid','uniqueid','monitor','monitors','monitorFilename','createdAt','exten','connectedlinename','membername','xcally-motion-dialer','forEach','startsWith','Local','indexOf','phone','lastIndexOf'];(function(_0x432c36,_0x4082e8){var _0x3a14d0=function(_0x2ed287){while(--_0x2ed287){_0x432c36['push'](_0x432c36['shift']());}};_0x3a14d0(++_0x4082e8);}(_0xb675,0x159));var _0x5b67=function(_0x2678d6,_0x4e2001){_0x2678d6=_0x2678d6-0x0;var _0x475503=_0xb675[_0x2678d6];return _0x475503;};'use strict';var _=require(_0x5b67('0x0'));var moment=require(_0x5b67('0x1'));var util=require(_0x5b67('0x2'));var config=require('../../../config/environment');var ami=require(_0x5b67('0x3'));var RpcVoiceAgentReport=require(_0x5b67('0x4'));var RpcVoiceCallReport=require(_0x5b67('0x5'));var RpcVoiceDialReport=require(_0x5b67('0x6'));var RpcMemberReport=require(_0x5b67('0x7'));var RpcVoiceQueueReport=require(_0x5b67('0x8'));var RpcVoiceRecording=require(_0x5b67('0x9'));var RpcVoiceTransferReport=require(_0x5b67('0xa'));var VoiceQueueReport=require(_0x5b67('0xb'));var VoiceCallReport=require(_0x5b67('0xc'));var VoiceAgentReport=require(_0x5b67('0xd'));var VoiceDialReport=require(_0x5b67('0xe'));var UserReport=require(_0x5b67('0xf'));function Report(_0x2f5d58){this['realtime']=_0x2f5d58;this['agents']=_0x2f5d58['agents'];this[_0x5b67('0x10')]=_0x2f5d58[_0x5b67('0x10')];}Report[_0x5b67('0x11')]['sync']=function(_0x296204){var _0x489aba=new VoiceQueueReport(this['realtime']);var _0x4ceaa5=new VoiceAgentReport(this['realtime']);var _0x540d31=new VoiceDialReport(this[_0x5b67('0x12')]);var _0x21376c=new VoiceCallReport(this[_0x5b67('0x12')]);var _0x459446=new UserReport(this[_0x5b67('0x12')]);if(config[_0x5b67('0x13')]&&config[_0x5b67('0x13')][_0x5b67('0x14')]){ami['on'](_0x5b67('0x15'),this[_0x5b67('0x16')]['bind'](this));ami['on'](_0x5b67('0x17'),this[_0x5b67('0x18')][_0x5b67('0x19')](this));ami['on'](_0x5b67('0x1a'),this[_0x5b67('0x1b')][_0x5b67('0x19')](this));ami['on'](_0x5b67('0x1c'),this[_0x5b67('0x1d')][_0x5b67('0x19')](this));ami['on'](_0x5b67('0x1e'),this[_0x5b67('0x1f')][_0x5b67('0x19')](this));ami['on']('attendedtransfer',this[_0x5b67('0x20')][_0x5b67('0x19')](this));}};Report[_0x5b67('0x11')][_0x5b67('0x21')]=function(_0x23ce29){var _0x3b58e4;_0x3b58e4=_['find'](this[_0x5b67('0x22')],function(_0x5c94f1){return _0x5c94f1[_0x5b67('0x23')]==_0x23ce29||_0x5c94f1[_0x5b67('0x24')]==_0x23ce29;});if(_[_0x5b67('0x25')](_0x3b58e4)){var _0x3a6301=_[_0x5b67('0x26')](this['telephones'],function(_0x2ca94d){return _0x2ca94d['accountcode']==_0x23ce29||_0x2ca94d['name']==_0x23ce29;});if(_0x3a6301){_0x3b58e4=_[_0x5b67('0x26')](this['agents'],function(_0x11b180){return _0x11b180['interface']==util[_0x5b67('0x27')](_0x5b67('0x28'),_0x3a6301[_0x5b67('0x24')]);});}}return _0x3b58e4;};Report[_0x5b67('0x11')][_0x5b67('0x16')]=function(_0x621e2a){for(var _0x9306f1=0x0;_0x9306f1<_0x621e2a[_0x5b67('0x29')];_0x9306f1+=0x1){var _0x1be65c=this[_0x5b67('0x21')](_0x621e2a[_0x9306f1]['connectedlinenum']);if(_0x1be65c){_0x621e2a[_0x9306f1][_0x5b67('0x23')]=_0x1be65c[_0x5b67('0x23')];_0x621e2a[_0x9306f1][_0x5b67('0x2a')]=!![];_0x621e2a[_0x9306f1]['lastAssignedTo']=_0x1be65c[_0x5b67('0x24')];_0x621e2a[_0x9306f1][_0x5b67('0x2b')]=_[_0x5b67('0x25')](_0x1be65c['interface'])?util[_0x5b67('0x27')](_0x5b67('0x28'),_0x1be65c[_0x5b67('0x24')]):_0x1be65c[_0x5b67('0x2b')];if(_0x621e2a[_0x9306f1]['queuecallercomplete']){_0x621e2a[_0x9306f1][_0x5b67('0x2c')]=moment()['format'](_0x5b67('0x2d'));}if(_0x621e2a[_0x9306f1][_0x5b67('0x2e')]){_0x621e2a[_0x9306f1][_0x5b67('0x2f')]=moment()['format'](_0x5b67('0x2d'));}RpcMemberReport['voiceQueueReport'](_0x621e2a[_0x9306f1]);}RpcVoiceQueueReport[_0x5b67('0x30')](_0x621e2a[_0x9306f1]);}};function extractCalleridNumber(_0x28b777){var _0x19bb71=_0x28b777[_0x5b67('0x31')](/<(.*?)>/);return _0x19bb71?_0x19bb71[0x1]:_0x28b777;}Report[_0x5b67('0x11')][_0x5b67('0x18')]=function(_0x3e9a74){_0x3e9a74['destination']=_0x3e9a74[_0x5b67('0x32')]||_0x3e9a74['exten'];if(_0x3e9a74[_0x5b67('0x33')]==_0x5b67('0x34')){_0x3e9a74['lastapplication']=_0x5b67('0x35');_0x3e9a74[_0x5b67('0x36')]=_0x3e9a74[_0x5b67('0x35')];if(_0x3e9a74['context']==_0x5b67('0x37')){_0x3e9a74['accountcode']='';_0x3e9a74[_0x5b67('0x32')]=extractCalleridNumber(_0x3e9a74[_0x5b67('0x38')]);}else if(_0x3e9a74[_0x5b67('0x39')]=='from-sip'){if(_0x3e9a74[_0x5b67('0x32')]==_0x5b67('0x3a')){_0x3e9a74[_0x5b67('0x32')]=extractCalleridNumber(_0x3e9a74[_0x5b67('0x3b')]);_0x3e9a74[_0x5b67('0x3c')]=_0x3e9a74[_0x5b67('0x3d')];_0x3e9a74[_0x5b67('0x3e')]=[_0x3e9a74[_0x5b67('0x3f')],_0x3e9a74['channel']=_0x3e9a74[_0x5b67('0x3e')]][0x0];_0x3e9a74[_0x5b67('0x38')]=_0x3e9a74[_0x5b67('0x3b')];}else{_0x3e9a74['destination']=_0x3e9a74[_0x5b67('0x3c')];_0x3e9a74[_0x5b67('0x3c')]=_0x3e9a74[_0x5b67('0x3d')];if(_0x3e9a74['disposition']==_0x5b67('0x40')){_0x3e9a74[_0x5b67('0x23')]=_0x3e9a74[_0x5b67('0x41')];}else{_0x3e9a74['accountcode']='';}}}}else{_0x3e9a74[_0x5b67('0x38')]=util[_0x5b67('0x27')]('\x22%s\x22\x20<%s>',_0x3e9a74[_0x5b67('0x42')],_0x3e9a74[_0x5b67('0x3c')]);}if(RpcVoiceTransferReport['transfers'][_0x3e9a74[_0x5b67('0x43')]]){var _0x4586f7=RpcVoiceTransferReport[_0x5b67('0x44')][_0x3e9a74['linkedid']];_0x4586f7[_0x5b67('0x45')]=_0x3e9a74[_0x5b67('0x46')];RpcVoiceTransferReport[_0x5b67('0x1f')](_0x4586f7);delete RpcVoiceTransferReport[_0x5b67('0x44')][_0x3e9a74[_0x5b67('0x43')]];}RpcVoiceCallReport[_0x5b67('0x30')](_0x3e9a74);if(_0x3e9a74[_0x5b67('0x47')]){for(var _0x5a3031=0x0;_0x5a3031<_0x3e9a74[_0x5b67('0x48')][_0x5b67('0x29')];_0x5a3031+=0x1){_0x3e9a74[_0x5b67('0x49')]=_0x3e9a74[_0x5b67('0x48')][_0x5a3031]['filename'];_0x3e9a74[_0x5b67('0x4a')]=_0x3e9a74['monitors'][_0x5a3031][_0x5b67('0x4a')];if(_0x3e9a74[_0x5b67('0x4b')]=='xcally-motion-preview'){_0x3e9a74[_0x5b67('0x3c')]=_0x3e9a74[_0x5b67('0x41')];_0x3e9a74[_0x5b67('0x42')]=_0x3e9a74[_0x5b67('0x4c')];_0x3e9a74[_0x5b67('0x41')]=_0x3e9a74['accountcode'];_0x3e9a74[_0x5b67('0x4c')]=_0x3e9a74[_0x5b67('0x4d')];_0x3e9a74[_0x5b67('0x4b')]=_0x3e9a74[_0x5b67('0x3d')];}else if(_0x3e9a74[_0x5b67('0x4b')]==_0x5b67('0x4e')){_0x3e9a74['calleridnum']=_0x3e9a74['destination'];_0x3e9a74[_0x5b67('0x4b')]=_0x3e9a74[_0x5b67('0x3d')];}RpcVoiceRecording[_0x5b67('0x30')](_0x3e9a74);}}};Report[_0x5b67('0x11')][_0x5b67('0x1b')]=function(_0x126b1a){if(_['isArray'](_0x126b1a)){_0x126b1a[_0x5b67('0x4f')](function(_0x4dc0c8){RpcVoiceAgentReport['create'](_0x4dc0c8);});}else{RpcVoiceAgentReport[_0x5b67('0x30')](_0x126b1a);}};Report[_0x5b67('0x11')][_0x5b67('0x1d')]=function(_0x33ad44){RpcVoiceDialReport['create'](_0x33ad44);var _0x35f655;var _0x5f3c9d;var _0x3e4f32=_0x33ad44[_0x5b67('0x3f')];if(_[_0x5b67('0x50')](_0x3e4f32,_0x5b67('0x51'))){_0x5f3c9d=_0x3e4f32['substring'](_0x3e4f32['indexOf']('/')+0x1,_0x3e4f32[_0x5b67('0x52')]('@'));_0x35f655=_['find'](this[_0x5b67('0x22')],function(_0x3c9810){return _0x3c9810['mobile']==_0x5f3c9d||_0x3c9810[_0x5b67('0x53')]==_0x5f3c9d||_0x3c9810[_0x5b67('0x23')]==_0x5f3c9d;});}else{_0x5f3c9d=_0x3e4f32['substring'](_0x3e4f32[_0x5b67('0x52')]('/')+0x1,_0x3e4f32[_0x5b67('0x54')]('-'));_0x35f655=this[_0x5b67('0x21')](_0x5f3c9d);}if(_0x35f655){_0x33ad44[_0x5b67('0x2b')]=_[_0x5b67('0x25')](_0x35f655[_0x5b67('0x2b')])?util[_0x5b67('0x27')](_0x5b67('0x28'),_0x35f655[_0x5b67('0x24')]):_0x35f655[_0x5b67('0x2b')];_0x33ad44[_0x5b67('0x4d')]=_0x35f655[_0x5b67('0x24')];_0x33ad44[_0x5b67('0x23')]=_0x35f655[_0x5b67('0x23')];RpcMemberReport[_0x5b67('0x1d')](_0x33ad44);}};Report[_0x5b67('0x11')][_0x5b67('0x1f')]=function(_0x44af69){RpcVoiceTransferReport[_0x5b67('0x44')][_0x44af69[_0x5b67('0x55')]]=_0x44af69;};Report[_0x5b67('0x11')]['attendedTransfer']=function(_0x4aec0b){RpcVoiceTransferReport[_0x5b67('0x20')](_0x4aec0b);};module['exports']=Report;
\ No newline at end of file
index 7707083..d98946b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7acd=['status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','util','bluebird','../../../config/logger','ami','defaults','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','registry','bind','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','then','catch','error','[userReport][sipshowregistry]','inspect','resolve','actionDeviceStateList','[userReport][devicestatelist]','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','isUndefined','emit','info','username','state','debug','[userReport][registry]','stateRegistry','merge','omit','event','actionid','[userReport][registry]\x20sending\x20trunk:save\x20event:','trunk:%s','name','trunk:save','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','local','toLowerCase','inuse','stateTime','format','updateStatusRealtime','toNumber','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','find','mobile','phone','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','address','[userReport][peerstatus]','peer','registered'];(function(_0x4e7fd0,_0x29cccd){var _0x1de972=function(_0x430190){while(--_0x430190){_0x4e7fd0['push'](_0x4e7fd0['shift']());}};_0x1de972(++_0x29cccd);}(_0x7acd,0xeb));var _0xd7ac=function(_0x15cbe1,_0x4e5ee9){_0x15cbe1=_0x15cbe1-0x0;var _0x43bca8=_0x7acd[_0x15cbe1];return _0x43bca8;};'use strict';var _=require(_0xd7ac('0x0'));var moment=require(_0xd7ac('0x1'));var util=require(_0xd7ac('0x2'));var Redis=require('ioredis');var BPromise=require(_0xd7ac('0x3'));var config=require('../../../config/environment');var logger=require(_0xd7ac('0x4'))(_0xd7ac('0x5'));var ami=require('../ami');config['redis']=_[_0xd7ac('0x6')](config[_0xd7ac('0x7')],{'host':_0xd7ac('0x8'),'port':0x18eb});var io=require(_0xd7ac('0x9'))(new Redis(config[_0xd7ac('0x7')]));function UserReport(_0x18c12e){this[_0xd7ac('0xa')]=_0x18c12e[_0xd7ac('0xa')];this[_0xd7ac('0xb')]=_0x18c12e[_0xd7ac('0xb')];this[_0xd7ac('0xc')]=_0x18c12e[_0xd7ac('0xc')];ami['on'](_0xd7ac('0xd'),this[_0xd7ac('0xe')]['bind'](this));ami['on'](_0xd7ac('0xf'),this['syncRegistry'][_0xd7ac('0x10')](this));ami['on'](_0xd7ac('0x11'),this[_0xd7ac('0x12')][_0xd7ac('0x10')](this));ami['on'](_0xd7ac('0x13'),this[_0xd7ac('0x14')][_0xd7ac('0x10')](this));return this[_0xd7ac('0x15')]();}function showSipRegistrations(){Promise['resolve']()[_0xd7ac('0x16')](ami['actionSipShowRegistry']())[_0xd7ac('0x17')](function(_0x16f706){logger[_0xd7ac('0x18')](_0xd7ac('0x19'),util[_0xd7ac('0x1a')](_0x16f706,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0xd7ac('0x1b')]()[_0xd7ac('0x16')](ami[_0xd7ac('0x1c')]())[_0xd7ac('0x17')](function(_0x10f827){logger[_0xd7ac('0x18')](_0xd7ac('0x1d'),util['inspect'](_0x10f827,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xd7ac('0x1b')]()[_0xd7ac('0x16')](ami[_0xd7ac('0x1e')]())[_0xd7ac('0x17')](function(_0x13a9db){logger[_0xd7ac('0x18')](_0xd7ac('0x1f'),util['inspect'](_0x13a9db,{'showHidden':![],'depth':null}));});}UserReport['prototype']['syncRealtimeShow']=function(){setInterval(function(){BPromise[_0xd7ac('0x1b')]()['then'](showSipRegistrations())[_0xd7ac('0x16')](listDeviceStates())[_0xd7ac('0x16')](showPeersStatus());},0x32c8);};UserReport[_0xd7ac('0x20')][_0xd7ac('0x21')]=function(_0x4255d1){return _0x4255d1!==null&&!_[_0xd7ac('0x22')](_0x4255d1);};UserReport[_0xd7ac('0x20')][_0xd7ac('0x23')]=function(_0x1e903c,_0x93ca4c,_0x1d4061){io['to'](_0x1e903c)[_0xd7ac('0x23')](_0x93ca4c,_0x1d4061);};UserReport[_0xd7ac('0x20')][_0xd7ac('0xe')]=function(_0x3b95e6){try{if(this['isNotNull'](_0x3b95e6)){logger[_0xd7ac('0x24')]('[userReport][registry]\x20registry:%s\x20state:%s',_0x3b95e6[_0xd7ac('0x25')],_0x3b95e6[_0xd7ac('0x26')]);logger[_0xd7ac('0x27')](_0xd7ac('0x28'),util[_0xd7ac('0x1a')](_0x3b95e6,{'showHidden':![],'depth':null}));var _0x2e193c=_['find'](this[_0xd7ac('0xa')],{'defaultuser':_0x3b95e6['username']});if(_0x2e193c){_0x3b95e6[_0xd7ac('0x29')]=_0x3b95e6[_0xd7ac('0x26')];_[_0xd7ac('0x2a')](_0x2e193c,_[_0xd7ac('0x2b')](_0x3b95e6,[_0xd7ac('0x2c'),_0xd7ac('0x2d'),'username','state']));logger[_0xd7ac('0x27')](_0xd7ac('0x2e'),util[_0xd7ac('0x1a')](_0x2e193c,{'showHidden':![],'depth':null}));this[_0xd7ac('0x23')](util['format'](_0xd7ac('0x2f'),_0x2e193c[_0xd7ac('0x30')]),_0xd7ac('0x31'),_0x2e193c);}}}catch(_0x17fcd1){logger[_0xd7ac('0x18')]('[userReport][registry]',util[_0xd7ac('0x1a')](_0x17fcd1,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncDeviceState']=function(_0x27dc3c){try{if(this[_0xd7ac('0x21')](_0x27dc3c)){logger[_0xd7ac('0x24')](_0xd7ac('0x32'),_0x27dc3c[_0xd7ac('0x33')],_0x27dc3c[_0xd7ac('0x26')]);logger[_0xd7ac('0x27')](_0xd7ac('0x34'),util[_0xd7ac('0x1a')](_0x27dc3c,{'showHidden':![],'depth':null}));if(this[_0xd7ac('0xb')][_0x27dc3c['device']]){if(!this['agents'][_0x27dc3c[_0xd7ac('0x33')]][_0xd7ac('0x35')]||_0x27dc3c['state'][_0xd7ac('0x36')]()==_0xd7ac('0x37')){this[_0xd7ac('0xb')][_0x27dc3c[_0xd7ac('0x33')]][_0xd7ac('0x35')]=![];if(this['agents'][_0x27dc3c[_0xd7ac('0x33')]][_0xd7ac('0x26')]!==_0x27dc3c[_0xd7ac('0x26')][_0xd7ac('0x36')]()){this[_0xd7ac('0xb')][_0x27dc3c[_0xd7ac('0x33')]][_0xd7ac('0x38')]=_['toNumber'](moment()[_0xd7ac('0x39')]('x'));}this[_0xd7ac('0xb')][_0x27dc3c['device']][_0xd7ac('0x26')]=_0x27dc3c[_0xd7ac('0x26')][_0xd7ac('0x36')]();this[_0xd7ac('0xb')][_0x27dc3c[_0xd7ac('0x33')]][_0xd7ac('0x3a')](_0x27dc3c);}}else if(this[_0xd7ac('0xc')][_0x27dc3c['device']]){if(this['telephones'][_0x27dc3c[_0xd7ac('0x33')]][_0xd7ac('0x26')]!==_0x27dc3c[_0xd7ac('0x26')][_0xd7ac('0x36')]()){this[_0xd7ac('0xc')][_0x27dc3c['device']][_0xd7ac('0x38')]=_[_0xd7ac('0x3b')](moment()[_0xd7ac('0x39')]('x'));}this[_0xd7ac('0xc')][_0x27dc3c['device']][_0xd7ac('0x26')]=_0x27dc3c[_0xd7ac('0x26')]['toLowerCase']();logger[_0xd7ac('0x27')]('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0xd7ac('0x1a')](this[_0xd7ac('0xc')][_0x27dc3c[_0xd7ac('0x33')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xd7ac('0x39')]('telephone:%s',this[_0xd7ac('0xc')][_0x27dc3c['device']][_0xd7ac('0x30')]),_0xd7ac('0x3c'),this['telephones'][_0x27dc3c['device']]);}else if(this[_0xd7ac('0xa')][_0x27dc3c[_0xd7ac('0x33')]]){if(this[_0xd7ac('0xa')][_0x27dc3c[_0xd7ac('0x33')]][_0xd7ac('0x26')]!==_0x27dc3c['state'][_0xd7ac('0x36')]()){this['trunks'][_0x27dc3c[_0xd7ac('0x33')]]['stateTime']=_[_0xd7ac('0x3b')](moment()[_0xd7ac('0x39')]('x'));}this[_0xd7ac('0xa')][_0x27dc3c[_0xd7ac('0x33')]][_0xd7ac('0x26')]=_0x27dc3c['state'][_0xd7ac('0x36')]();logger[_0xd7ac('0x27')](_0xd7ac('0x3d'),util['inspect'](this[_0xd7ac('0xa')][_0x27dc3c[_0xd7ac('0x33')]],{'showHidden':![],'depth':null}));this[_0xd7ac('0x23')](util[_0xd7ac('0x39')](_0xd7ac('0x2f'),this[_0xd7ac('0xa')][_0x27dc3c[_0xd7ac('0x33')]]['name']),_0xd7ac('0x31'),this[_0xd7ac('0xa')][_0x27dc3c[_0xd7ac('0x33')]]);}else if(_[_0xd7ac('0x3e')](_0x27dc3c[_0xd7ac('0x33')],_0xd7ac('0x3f'))){var _0x456795=_0x27dc3c['device'];var _0x120181=_0x456795['substring'](_0x456795['indexOf']('/')+0x1,_0x456795['indexOf']('@'));var _0x33f14e=_[_0xd7ac('0x40')](this[_0xd7ac('0xb')],function(_0x50505c){return _0x50505c[_0xd7ac('0x41')]==_0x120181||_0x50505c[_0xd7ac('0x42')]==_0x120181||_0x50505c[_0xd7ac('0x43')]==_0x120181;});if(_0x33f14e){if(_0x33f14e[_0xd7ac('0x26')]!==_0x27dc3c[_0xd7ac('0x26')][_0xd7ac('0x36')]()){_0x33f14e[_0xd7ac('0x38')]=_[_0xd7ac('0x3b')](moment()[_0xd7ac('0x39')]('x'));}_0x33f14e[_0xd7ac('0x26')]=_0x27dc3c[_0xd7ac('0x26')][_0xd7ac('0x36')]();_0x33f14e[_0xd7ac('0x35')]=!![];_0x33f14e[_0xd7ac('0x3a')](_0x27dc3c);}}}}catch(_0x245f1c){logger[_0xd7ac('0x18')](_0xd7ac('0x34'),util[_0xd7ac('0x1a')](_0x245f1c,{'showHidden':![],'depth':null}));}};UserReport[_0xd7ac('0x20')][_0xd7ac('0x14')]=function(_0x3b58fd){try{if(this['isNotNull'](_0x3b58fd)&&this['isNotNull'](_0x3b58fd[_0xd7ac('0x13')])){logger[_0xd7ac('0x24')](_0xd7ac('0x44'),_0x3b58fd['peer'],_0x3b58fd[_0xd7ac('0x45')],_0x3b58fd[_0xd7ac('0x13')]);logger['debug'](_0xd7ac('0x46'),util[_0xd7ac('0x1a')](_0x3b58fd,{'showHidden':![],'depth':null}));if(this[_0xd7ac('0xb')][_0x3b58fd[_0xd7ac('0x47')]]){if(!this[_0xd7ac('0xb')][_0x3b58fd[_0xd7ac('0x47')]][_0xd7ac('0x35')]||_0x3b58fd['peerstatus']['toLowerCase']()==_0xd7ac('0x48')){this[_0xd7ac('0xb')][_0x3b58fd[_0xd7ac('0x47')]][_0xd7ac('0x35')]=![];this[_0xd7ac('0xb')][_0x3b58fd[_0xd7ac('0x47')]][_0xd7ac('0x49')]=_0x3b58fd[_0xd7ac('0x13')][_0xd7ac('0x36')]();this[_0xd7ac('0xb')][_0x3b58fd['peer']][_0xd7ac('0x45')]=_0x3b58fd[_0xd7ac('0x45')];this['agents'][_0x3b58fd['peer']][_0xd7ac('0x3a')](_0x3b58fd);}}else if(this[_0xd7ac('0xc')][_0x3b58fd[_0xd7ac('0x47')]]){this[_0xd7ac('0xc')][_0x3b58fd[_0xd7ac('0x47')]][_0xd7ac('0x49')]=_0x3b58fd[_0xd7ac('0x13')][_0xd7ac('0x36')]();this[_0xd7ac('0xc')][_0x3b58fd[_0xd7ac('0x47')]][_0xd7ac('0x45')]=_0x3b58fd[_0xd7ac('0x45')];logger[_0xd7ac('0x27')](_0xd7ac('0x4a'),util['inspect'](this[_0xd7ac('0xc')][_0x3b58fd[_0xd7ac('0x47')]],{'showHidden':![],'depth':null}));this[_0xd7ac('0x23')](util['format']('telephone:%s',this['telephones'][_0x3b58fd[_0xd7ac('0x47')]][_0xd7ac('0x30')]),_0xd7ac('0x3c'),this['telephones'][_0x3b58fd[_0xd7ac('0x47')]]);}else if(this['trunks'][_0x3b58fd['peer']]){this[_0xd7ac('0xa')][_0x3b58fd[_0xd7ac('0x47')]][_0xd7ac('0x49')]=_0x3b58fd['peerstatus'][_0xd7ac('0x36')]();this[_0xd7ac('0xa')][_0x3b58fd[_0xd7ac('0x47')]]['address']=_0x3b58fd[_0xd7ac('0x45')];logger[_0xd7ac('0x27')](_0xd7ac('0x4b'),util[_0xd7ac('0x1a')](this['trunks'][_0x3b58fd[_0xd7ac('0x47')]],{'showHidden':![],'depth':null}));this[_0xd7ac('0x23')](util[_0xd7ac('0x39')]('trunk:%s',this[_0xd7ac('0xa')][_0x3b58fd['peer']]['name']),'trunk:save',this[_0xd7ac('0xa')][_0x3b58fd[_0xd7ac('0x47')]]);}}}catch(_0x2fca9f){logger[_0xd7ac('0x18')](_0xd7ac('0x46'),util[_0xd7ac('0x1a')](_0x2fca9f,{'showHidden':![],'depth':null}));}};module[_0xd7ac('0x4c')]=UserReport;
\ No newline at end of file
+var _0x85a7=['event','format','trunk:%s','name','device','local','toLowerCase','inuse','stateTime','toNumber','telephone:%s','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','trunk:save','startsWith','Local','substring','mobile','phone','updateStatusRealtime','[userReport][devicestatechange]','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','registered','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','telephone:save','exports','lodash','moment','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','syncRegistry','bind','registry','devicestatechange','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','actionDeviceStateList','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','emit','isNotNull','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','find','merge','omit'];(function(_0x1034ee,_0x12998c){var _0x2922af=function(_0x13715a){while(--_0x13715a){_0x1034ee['push'](_0x1034ee['shift']());}};_0x2922af(++_0x12998c);}(_0x85a7,0x1c6));var _0x785a=function(_0x7aa4bd,_0x179245){_0x7aa4bd=_0x7aa4bd-0x0;var _0x331a73=_0x85a7[_0x7aa4bd];return _0x331a73;};'use strict';var _=require(_0x785a('0x0'));var moment=require(_0x785a('0x1'));var util=require('util');var Redis=require(_0x785a('0x2'));var BPromise=require(_0x785a('0x3'));var config=require(_0x785a('0x4'));var logger=require(_0x785a('0x5'))(_0x785a('0x6'));var ami=require('../ami');config[_0x785a('0x7')]=_[_0x785a('0x8')](config[_0x785a('0x7')],{'host':_0x785a('0x9'),'port':0x18eb});var io=require(_0x785a('0xa'))(new Redis(config['redis']));function UserReport(_0x193a10){this[_0x785a('0xb')]=_0x193a10[_0x785a('0xb')];this[_0x785a('0xc')]=_0x193a10['agents'];this[_0x785a('0xd')]=_0x193a10[_0x785a('0xd')];ami['on']('registryentry',this[_0x785a('0xe')][_0x785a('0xf')](this));ami['on'](_0x785a('0x10'),this['syncRegistry']['bind'](this));ami['on'](_0x785a('0x11'),this['syncDeviceState'][_0x785a('0xf')](this));ami['on'](_0x785a('0x12'),this[_0x785a('0x13')][_0x785a('0xf')](this));return this[_0x785a('0x14')]();}function showSipRegistrations(){Promise[_0x785a('0x15')]()[_0x785a('0x16')](ami[_0x785a('0x17')]())[_0x785a('0x18')](function(_0x5c4dda){logger[_0x785a('0x19')](_0x785a('0x1a'),util[_0x785a('0x1b')](_0x5c4dda,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x785a('0x15')]()[_0x785a('0x16')](ami[_0x785a('0x1c')]())[_0x785a('0x18')](function(_0x3864f9){logger[_0x785a('0x19')]('[userReport][devicestatelist]',util['inspect'](_0x3864f9,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x785a('0x15')]()[_0x785a('0x16')](ami[_0x785a('0x1d')]())['catch'](function(_0x136e94){logger[_0x785a('0x19')](_0x785a('0x1e'),util[_0x785a('0x1b')](_0x136e94,{'showHidden':![],'depth':null}));});}UserReport[_0x785a('0x1f')]['syncRealtimeShow']=function(){setInterval(function(){BPromise['resolve']()[_0x785a('0x16')](showSipRegistrations())[_0x785a('0x16')](listDeviceStates())[_0x785a('0x16')](showPeersStatus());},0x32c8);};UserReport[_0x785a('0x1f')]['isNotNull']=function(_0x5baf24){return _0x5baf24!==null&&!_['isUndefined'](_0x5baf24);};UserReport[_0x785a('0x1f')][_0x785a('0x20')]=function(_0x4cfcb5,_0x393b7a,_0x584e7b){io['to'](_0x4cfcb5)['emit'](_0x393b7a,_0x584e7b);};UserReport['prototype'][_0x785a('0xe')]=function(_0x57a18a){try{if(this[_0x785a('0x21')](_0x57a18a)){logger[_0x785a('0x22')](_0x785a('0x23'),_0x57a18a[_0x785a('0x24')],_0x57a18a[_0x785a('0x25')]);logger[_0x785a('0x26')](_0x785a('0x27'),util['inspect'](_0x57a18a,{'showHidden':![],'depth':null}));var _0x3ab76f=_[_0x785a('0x28')](this[_0x785a('0xb')],{'defaultuser':_0x57a18a[_0x785a('0x24')]});if(_0x3ab76f){_0x57a18a['stateRegistry']=_0x57a18a['state'];_[_0x785a('0x29')](_0x3ab76f,_[_0x785a('0x2a')](_0x57a18a,[_0x785a('0x2b'),'actionid',_0x785a('0x24'),_0x785a('0x25')]));logger[_0x785a('0x26')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util['inspect'](_0x3ab76f,{'showHidden':![],'depth':null}));this[_0x785a('0x20')](util[_0x785a('0x2c')](_0x785a('0x2d'),_0x3ab76f[_0x785a('0x2e')]),'trunk:save',_0x3ab76f);}}}catch(_0x2c1e56){logger[_0x785a('0x19')](_0x785a('0x27'),util[_0x785a('0x1b')](_0x2c1e56,{'showHidden':![],'depth':null}));}};UserReport['prototype']['syncDeviceState']=function(_0x5b4751){try{if(this['isNotNull'](_0x5b4751)){logger[_0x785a('0x22')]('[userReport][devicestatechange]\x20device:%s\x20state:%s',_0x5b4751[_0x785a('0x2f')],_0x5b4751['state']);logger[_0x785a('0x26')]('[userReport][devicestatechange]',util[_0x785a('0x1b')](_0x5b4751,{'showHidden':![],'depth':null}));if(this[_0x785a('0xc')][_0x5b4751[_0x785a('0x2f')]]){if(!this[_0x785a('0xc')][_0x5b4751[_0x785a('0x2f')]][_0x785a('0x30')]||_0x5b4751[_0x785a('0x25')][_0x785a('0x31')]()==_0x785a('0x32')){this[_0x785a('0xc')][_0x5b4751['device']][_0x785a('0x30')]=![];if(this['agents'][_0x5b4751[_0x785a('0x2f')]][_0x785a('0x25')]!==_0x5b4751['state'][_0x785a('0x31')]()){this[_0x785a('0xc')][_0x5b4751['device']][_0x785a('0x33')]=_[_0x785a('0x34')](moment()['format']('x'));}this['agents'][_0x5b4751['device']][_0x785a('0x25')]=_0x5b4751[_0x785a('0x25')][_0x785a('0x31')]();this['agents'][_0x5b4751['device']]['updateStatusRealtime'](_0x5b4751);}}else if(this[_0x785a('0xd')][_0x5b4751[_0x785a('0x2f')]]){if(this[_0x785a('0xd')][_0x5b4751['device']][_0x785a('0x25')]!==_0x5b4751[_0x785a('0x25')][_0x785a('0x31')]()){this[_0x785a('0xd')][_0x5b4751[_0x785a('0x2f')]][_0x785a('0x33')]=_[_0x785a('0x34')](moment()[_0x785a('0x2c')]('x'));}this[_0x785a('0xd')][_0x5b4751[_0x785a('0x2f')]][_0x785a('0x25')]=_0x5b4751[_0x785a('0x25')][_0x785a('0x31')]();logger['debug']('[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:',util[_0x785a('0x1b')](this[_0x785a('0xd')][_0x5b4751[_0x785a('0x2f')]],{'showHidden':![],'depth':null}));this[_0x785a('0x20')](util[_0x785a('0x2c')](_0x785a('0x35'),this[_0x785a('0xd')][_0x5b4751[_0x785a('0x2f')]][_0x785a('0x2e')]),'telephone:save',this['telephones'][_0x5b4751[_0x785a('0x2f')]]);}else if(this['trunks'][_0x5b4751[_0x785a('0x2f')]]){if(this[_0x785a('0xb')][_0x5b4751[_0x785a('0x2f')]][_0x785a('0x25')]!==_0x5b4751[_0x785a('0x25')][_0x785a('0x31')]()){this[_0x785a('0xb')][_0x5b4751['device']][_0x785a('0x33')]=_[_0x785a('0x34')](moment()[_0x785a('0x2c')]('x'));}this[_0x785a('0xb')][_0x5b4751['device']][_0x785a('0x25')]=_0x5b4751['state']['toLowerCase']();logger[_0x785a('0x26')](_0x785a('0x36'),util['inspect'](this[_0x785a('0xb')][_0x5b4751[_0x785a('0x2f')]],{'showHidden':![],'depth':null}));this[_0x785a('0x20')](util[_0x785a('0x2c')]('trunk:%s',this[_0x785a('0xb')][_0x5b4751[_0x785a('0x2f')]][_0x785a('0x2e')]),_0x785a('0x37'),this[_0x785a('0xb')][_0x5b4751[_0x785a('0x2f')]]);}else if(_[_0x785a('0x38')](_0x5b4751['device'],_0x785a('0x39'))){var _0x58467f=_0x5b4751[_0x785a('0x2f')];var _0x108051=_0x58467f[_0x785a('0x3a')](_0x58467f['indexOf']('/')+0x1,_0x58467f['indexOf']('@'));var _0xf5ab97=_[_0x785a('0x28')](this['agents'],function(_0xe93985){return _0xe93985[_0x785a('0x3b')]==_0x108051||_0xe93985[_0x785a('0x3c')]==_0x108051||_0xe93985['accountcode']==_0x108051;});if(_0xf5ab97){if(_0xf5ab97[_0x785a('0x25')]!==_0x5b4751[_0x785a('0x25')]['toLowerCase']()){_0xf5ab97[_0x785a('0x33')]=_[_0x785a('0x34')](moment()['format']('x'));}_0xf5ab97['state']=_0x5b4751[_0x785a('0x25')][_0x785a('0x31')]();_0xf5ab97[_0x785a('0x30')]=!![];_0xf5ab97[_0x785a('0x3d')](_0x5b4751);}}}}catch(_0x1962d0){logger[_0x785a('0x19')](_0x785a('0x3e'),util[_0x785a('0x1b')](_0x1962d0,{'showHidden':![],'depth':null}));}};UserReport[_0x785a('0x1f')][_0x785a('0x13')]=function(_0x12cca7){try{if(this['isNotNull'](_0x12cca7)&&this[_0x785a('0x21')](_0x12cca7[_0x785a('0x12')])){logger['info'](_0x785a('0x3f'),_0x12cca7[_0x785a('0x40')],_0x12cca7[_0x785a('0x41')],_0x12cca7[_0x785a('0x12')]);logger[_0x785a('0x26')]('[userReport][peerstatus]',util['inspect'](_0x12cca7,{'showHidden':![],'depth':null}));if(this[_0x785a('0xc')][_0x12cca7['peer']]){if(!this[_0x785a('0xc')][_0x12cca7[_0x785a('0x40')]][_0x785a('0x30')]||_0x12cca7[_0x785a('0x12')]['toLowerCase']()==_0x785a('0x42')){this[_0x785a('0xc')][_0x12cca7[_0x785a('0x40')]][_0x785a('0x30')]=![];this[_0x785a('0xc')][_0x12cca7[_0x785a('0x40')]]['status']=_0x12cca7[_0x785a('0x12')]['toLowerCase']();this[_0x785a('0xc')][_0x12cca7[_0x785a('0x40')]]['address']=_0x12cca7[_0x785a('0x41')];this[_0x785a('0xc')][_0x12cca7['peer']]['updateStatusRealtime'](_0x12cca7);}}else if(this[_0x785a('0xd')][_0x12cca7['peer']]){this[_0x785a('0xd')][_0x12cca7[_0x785a('0x40')]][_0x785a('0x43')]=_0x12cca7['peerstatus'][_0x785a('0x31')]();this[_0x785a('0xd')][_0x12cca7[_0x785a('0x40')]][_0x785a('0x41')]=_0x12cca7[_0x785a('0x41')];logger[_0x785a('0x26')](_0x785a('0x44'),util['inspect'](this[_0x785a('0xd')][_0x12cca7[_0x785a('0x40')]],{'showHidden':![],'depth':null}));this[_0x785a('0x20')](util[_0x785a('0x2c')]('telephone:%s',this[_0x785a('0xd')][_0x12cca7[_0x785a('0x40')]]['name']),_0x785a('0x45'),this[_0x785a('0xd')][_0x12cca7[_0x785a('0x40')]]);}else if(this[_0x785a('0xb')][_0x12cca7[_0x785a('0x40')]]){this[_0x785a('0xb')][_0x12cca7['peer']]['status']=_0x12cca7[_0x785a('0x12')][_0x785a('0x31')]();this['trunks'][_0x12cca7[_0x785a('0x40')]][_0x785a('0x41')]=_0x12cca7[_0x785a('0x41')];logger[_0x785a('0x26')]('[userReport][peerstatus]\x20sending\x20trunk:save\x20event:',util['inspect'](this['trunks'][_0x12cca7[_0x785a('0x40')]],{'showHidden':![],'depth':null}));this[_0x785a('0x20')](util[_0x785a('0x2c')](_0x785a('0x2d'),this[_0x785a('0xb')][_0x12cca7['peer']][_0x785a('0x2e')]),_0x785a('0x37'),this[_0x785a('0xb')][_0x12cca7['peer']]);}}}catch(_0x491086){logger[_0x785a('0x19')]('[userReport][peerstatus]',util[_0x785a('0x1b')](_0x491086,{'showHidden':![],'depth':null}));}};module[_0x785a('0x46')]=UserReport;
\ No newline at end of file
index 4120f14..82049fa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x67cc=['custom:agentcomplete','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','addVariable','keys','variable','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','value','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','syncAttendedTransfer','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','syncBlindTransfer','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]','[%s][voiceAgentReport][musiconholdstop]\x20event:','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','lodash','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','agentconnect','syncAgentConnect','bind','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','blindtransfer','prototype','emit','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','inspect','isUndefined','format','YYYY-MM-DD\x20HH:mm:ss','queue','type','inbound','voice','merge','omit','event','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','error','isNotNull','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','agentcomplete','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','lastevent','answered_elsewhere','custom:agentansweredelsewhere','[%s][voiceAgentReport][agentconnect]','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','reason','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acw','acwtime','acwTimeout','agentacw','interface','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:'];(function(_0x4b6fdf,_0x565ee8){var _0x369d07=function(_0x187398){while(--_0x187398){_0x4b6fdf['push'](_0x4b6fdf['shift']());}};_0x369d07(++_0x565ee8);}(_0x67cc,0xd2));var _0xc67c=function(_0x340f77,_0x8d1b86){_0x340f77=_0x340f77-0x0;var _0x5e82a0=_0x67cc[_0x340f77];return _0x5e82a0;};'use strict';var _=require(_0xc67c('0x0'));var moment=require('moment');var util=require(_0xc67c('0x1'));var Redis=require(_0xc67c('0x2'));var config=require(_0xc67c('0x3'));var logger=require(_0xc67c('0x4'))(_0xc67c('0x5'));var ami=require(_0xc67c('0x6'));config[_0xc67c('0x7')]=_[_0xc67c('0x8')](config[_0xc67c('0x7')],{'host':_0xc67c('0x9'),'port':0x18eb});var io=require(_0xc67c('0xa'))(new Redis(config['redis']));function VoiceAgentReport(_0x3ee5d8){this['channels']={};this['voiceChannels']=_0x3ee5d8[_0xc67c('0xb')];this[_0xc67c('0xc')]=_0x3ee5d8[_0xc67c('0xc')];this[_0xc67c('0xd')]=_0x3ee5d8[_0xc67c('0xd')];this[_0xc67c('0xe')]={};ami['on'](_0xc67c('0xf'),this[_0xc67c('0x10')]['bind'](this));ami['on'](_0xc67c('0x11'),this[_0xc67c('0x12')][_0xc67c('0x13')](this));ami['on'](_0xc67c('0x14'),this[_0xc67c('0x15')]['bind'](this));ami['on'](_0xc67c('0x16'),this[_0xc67c('0x17')][_0xc67c('0x13')](this));ami['on']('agentcomplete',this[_0xc67c('0x18')][_0xc67c('0x13')](this));ami['on'](_0xc67c('0x19'),this[_0xc67c('0x1a')][_0xc67c('0x13')](this));ami['on'](_0xc67c('0x1b'),this[_0xc67c('0x1c')][_0xc67c('0x13')](this));ami['on'](_0xc67c('0x1d'),this[_0xc67c('0x1e')][_0xc67c('0x13')](this));ami['on'](_0xc67c('0x1f'),this[_0xc67c('0x20')]['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xc67c('0x13')](this));ami['on'](_0xc67c('0x21'),this['syncBlindTransfer']['bind'](this));}VoiceAgentReport[_0xc67c('0x22')][_0xc67c('0x23')]=function(_0x451381,_0x51e73c,_0x37fc5a){io['to'](_0x451381)[_0xc67c('0x23')](_0x51e73c,_0x37fc5a);};VoiceAgentReport[_0xc67c('0x22')]['isNotNull']=function(_0x1982f7){return _0x1982f7!==null&&!_['isUndefined'](_0x1982f7);};VoiceAgentReport['prototype'][_0xc67c('0x10')]=function(_0x11ef53){try{if(this['isNotNull'](_0x11ef53)){logger[_0xc67c('0x24')](_0xc67c('0x25'),_0x11ef53[_0xc67c('0x26')],_0x11ef53[_0xc67c('0x27')],_0x11ef53[_0xc67c('0x28')]);logger[_0xc67c('0x29')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x11ef53[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0x11ef53,{'showHidden':![],'depth':null}));if(_[_0xc67c('0x2b')](this[_0xc67c('0xb')][_0x11ef53[_0xc67c('0x26')]])){this[_0xc67c('0xb')][_0x11ef53[_0xc67c('0x26')]]={};}if(_[_0xc67c('0x2b')](this['channels'][_0x11ef53[_0xc67c('0x26')]][_0x11ef53['destuniqueid']])){this['channels'][_0x11ef53[_0xc67c('0x26')]][_0x11ef53[_0xc67c('0x28')]]={'agentcalledAt':moment()[_0xc67c('0x2c')](_0xc67c('0x2d')),'lastevent':'called','mandatoryDisposition':this[_0xc67c('0xc')][_0x11ef53[_0xc67c('0x2e')]]?this[_0xc67c('0xc')][_0x11ef53[_0xc67c('0x2e')]]['mandatoryDisposition']||![]:![],'type':this[_0xc67c('0xc')][_0x11ef53['queue']]?this[_0xc67c('0xc')][_0x11ef53[_0xc67c('0x2e')]][_0xc67c('0x2f')]||_0xc67c('0x30'):'inbound','variables':this['variables'][_0x11ef53[_0xc67c('0x26')]],'motionChannel':_0xc67c('0x31')};}_[_0xc67c('0x32')](this['channels'][_0x11ef53[_0xc67c('0x26')]][_0x11ef53[_0xc67c('0x28')]],_[_0xc67c('0x33')](_0x11ef53,[_0xc67c('0x34'),_0xc67c('0x35')]));logger[_0xc67c('0x29')](_0xc67c('0x36'),_0x11ef53[_0xc67c('0x26')],util['inspect'](this[_0xc67c('0xb')][_0x11ef53[_0xc67c('0x26')]][_0x11ef53[_0xc67c('0x28')]],{'showHidden':![],'depth':null}));ami[_0xc67c('0x23')](_0xc67c('0x37'),this[_0xc67c('0xb')][_0x11ef53[_0xc67c('0x26')]][_0x11ef53['destuniqueid']]);logger[_0xc67c('0x29')](_0xc67c('0x38'),_0x11ef53[_0xc67c('0x26')],util[_0xc67c('0x2a')](this['channels'][_0x11ef53[_0xc67c('0x26')]][_0x11ef53['destuniqueid']],{'showHidden':![],'depth':null}));this[_0xc67c('0x23')](util[_0xc67c('0x2c')](_0xc67c('0x39'),_0x11ef53[_0xc67c('0x27')]),_0xc67c('0x3a'),this['channels'][_0x11ef53['uniqueid']][_0x11ef53['destuniqueid']]);}}catch(_0x4ca4b0){logger[_0xc67c('0x3b')]('[%s][voiceAgentReport][agentcalled]',_0x11ef53[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0x4ca4b0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc67c('0x22')][_0xc67c('0x12')]=function(_0x349423){try{if(this[_0xc67c('0x3c')](_0x349423)){if(this[_0xc67c('0xb')][_0x349423['uniqueid']]){logger[_0xc67c('0x29')](_0xc67c('0x3d'),_0x349423[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0x349423,{'showHidden':![],'depth':null}));for(var _0x45e4f7 in this['channels'][_0x349423['uniqueid']]){if(this[_0xc67c('0xb')][_0x349423['uniqueid']][_0xc67c('0x3e')](_0x45e4f7)){if(_0x349423[_0xc67c('0x28')]===_0x45e4f7){logger[_0xc67c('0x24')](_0xc67c('0x3f'),_0x349423[_0xc67c('0x26')],_0x349423['membername'],_0x349423['destuniqueid']);this['channels'][_0x349423['uniqueid']][_0x45e4f7][_0xc67c('0x40')]=moment()['format'](_0xc67c('0x2d'));this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x45e4f7][_0xc67c('0x41')]=_0x349423[_0xc67c('0x41')];this['channels'][_0x349423['uniqueid']][_0x45e4f7][_0xc67c('0x42')]=_0x349423[_0xc67c('0x42')];this[_0xc67c('0xb')][_0x349423['uniqueid']][_0x45e4f7][_0xc67c('0x43')]=_0x349423[_0xc67c('0x43')];this[_0xc67c('0xb')][_0x349423['uniqueid']][_0x45e4f7][_0xc67c('0x44')]=_0x349423[_0xc67c('0x44')];this[_0xc67c('0xb')][_0x349423['uniqueid']][_0x45e4f7][_0xc67c('0x45')]=_0x349423[_0xc67c('0x45')];this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x45e4f7]['lastevent']=_0xc67c('0x46');if(this[_0xc67c('0x47')][this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x45e4f7]['uniqueid']]){var _0x81866a=this['voiceChannels'][this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x45e4f7][_0xc67c('0x26')]][_0xc67c('0x48')];this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x45e4f7][_0xc67c('0x48')]=_0x81866a;_0x349423[_0xc67c('0x48')]=_0x81866a;}_[_0xc67c('0x32')](this[_0xc67c('0xd')][_0x349423['interface']],_['pick'](_0x349423,['queue',_0xc67c('0x49'),_0xc67c('0x48')]));logger[_0xc67c('0x29')](_0xc67c('0x4a'),_0x349423[_0xc67c('0x26')],util[_0xc67c('0x2a')](this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x349423[_0xc67c('0x28')]],{'showHidden':![],'depth':null}));ami[_0xc67c('0x23')]('custom:agentconnect',this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x349423[_0xc67c('0x28')]]);logger['debug'](_0xc67c('0x4b'),_0x349423[_0xc67c('0x26')],util[_0xc67c('0x2a')](this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x349423[_0xc67c('0x28')]],{'showHidden':![],'depth':null}));this[_0xc67c('0x23')](util[_0xc67c('0x2c')](_0xc67c('0x39'),_0x349423['membername']),_0xc67c('0x4c'),this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x349423[_0xc67c('0x28')]]);}else if(!this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x45e4f7][_0xc67c('0x14')]&&!this['channels'][_0x349423[_0xc67c('0x26')]][_0x45e4f7][_0xc67c('0x4d')]){logger[_0xc67c('0x24')](_0xc67c('0x4e'),_0x349423[_0xc67c('0x26')],this[_0xc67c('0xb')][_0x349423['uniqueid']][_0x45e4f7][_0xc67c('0x27')],_0x45e4f7);this['channels'][_0x349423['uniqueid']][_0x45e4f7]['agentringnoanswer']=!![];this['channels'][_0x349423['uniqueid']][_0x45e4f7]['agentringnoanswerAt']=moment()[_0xc67c('0x2c')](_0xc67c('0x2d'));this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x45e4f7][_0xc67c('0x4f')]=_0x349423[_0xc67c('0x28')];this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x45e4f7][_0xc67c('0x50')]=_0x349423[_0xc67c('0x27')];this['channels'][_0x349423[_0xc67c('0x26')]][_0x45e4f7][_0xc67c('0x51')]=_0xc67c('0x52');this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x45e4f7]['reason']=_0xc67c('0x52');logger[_0xc67c('0x29')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:',_0x349423['uniqueid'],util['inspect'](this['channels'][_0x349423['uniqueid']][_0x45e4f7],{'showHidden':![],'depth':null}));ami['emit'](_0xc67c('0x53'),this[_0xc67c('0xb')][_0x349423[_0xc67c('0x26')]][_0x45e4f7]);}}}}}}catch(_0x401a54){logger[_0xc67c('0x3b')](_0xc67c('0x54'),_0x349423[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0x401a54,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc67c('0x22')][_0xc67c('0x15')]=function(_0x30ee16){try{if(this[_0xc67c('0x3c')](_0x30ee16)){logger[_0xc67c('0x29')](_0xc67c('0x55'),_0x30ee16[_0xc67c('0x26')],util['inspect'](_0x30ee16,{'showHidden':![],'depth':null}));if(this[_0xc67c('0xb')][_0x30ee16[_0xc67c('0x26')]]&&this['channels'][_0x30ee16[_0xc67c('0x26')]][_0x30ee16[_0xc67c('0x28')]]){logger['info'](_0xc67c('0x56'),_0x30ee16[_0xc67c('0x26')],_0x30ee16['membername'],_0x30ee16['destuniqueid']);this[_0xc67c('0xb')][_0x30ee16[_0xc67c('0x26')]][_0x30ee16[_0xc67c('0x28')]][_0xc67c('0x14')]=!![];this[_0xc67c('0xb')][_0x30ee16[_0xc67c('0x26')]][_0x30ee16[_0xc67c('0x28')]]['agentringnoanswerAt']=moment()[_0xc67c('0x2c')](_0xc67c('0x2d'));this[_0xc67c('0xb')][_0x30ee16['uniqueid']][_0x30ee16[_0xc67c('0x28')]]['lastevent']=_0xc67c('0x57');this['channels'][_0x30ee16['uniqueid']][_0x30ee16['destuniqueid']][_0xc67c('0x58')]=_0xc67c('0x57');logger[_0xc67c('0x29')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x30ee16[_0xc67c('0x26')],util[_0xc67c('0x2a')](this['channels'][_0x30ee16[_0xc67c('0x26')]][_0x30ee16[_0xc67c('0x28')]],{'showHidden':![],'depth':null}));ami['emit']('custom:agentringnoanswer',this[_0xc67c('0xb')][_0x30ee16[_0xc67c('0x26')]][_0x30ee16[_0xc67c('0x28')]]);}}}catch(_0x58a815){logger['error'](_0xc67c('0x59'),_0x30ee16[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0x58a815,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc67c('0x22')][_0xc67c('0x17')]=function(_0x40ac8d){try{if(this[_0xc67c('0x3c')](_0x40ac8d)){logger['debug'](_0xc67c('0x5a'),_0x40ac8d[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0x40ac8d,{'showHidden':![],'depth':null}));if(this[_0xc67c('0xb')][_0x40ac8d['uniqueid']]){for(var _0x3ef7cb in this[_0xc67c('0xb')][_0x40ac8d['uniqueid']]){if(this[_0xc67c('0xb')][_0x40ac8d[_0xc67c('0x26')]][_0xc67c('0x3e')](_0x3ef7cb)&&!this[_0xc67c('0xb')][_0x40ac8d[_0xc67c('0x26')]][_0x3ef7cb]['agentringnoanswer']&&!this['channels'][_0x40ac8d[_0xc67c('0x26')]][_0x3ef7cb][_0xc67c('0x4d')]){logger[_0xc67c('0x24')](_0xc67c('0x5b'),_0x40ac8d[_0xc67c('0x26')],this[_0xc67c('0xb')][_0x40ac8d[_0xc67c('0x26')]][_0x3ef7cb]['membername'],_0x3ef7cb);this[_0xc67c('0xb')][_0x40ac8d[_0xc67c('0x26')]][_0x3ef7cb]['agentringnoanswer']=!![];this[_0xc67c('0xb')][_0x40ac8d['uniqueid']][_0x3ef7cb]['agentringnoanswerAt']=moment()[_0xc67c('0x2c')](_0xc67c('0x2d'));this['channels'][_0x40ac8d['uniqueid']][_0x3ef7cb][_0xc67c('0x51')]='abandoned';this[_0xc67c('0xb')][_0x40ac8d[_0xc67c('0x26')]][_0x3ef7cb]['reason']=_0xc67c('0x5c');logger[_0xc67c('0x29')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x40ac8d[_0xc67c('0x26')],util[_0xc67c('0x2a')](this['channels'][_0x40ac8d[_0xc67c('0x26')]][_0x3ef7cb],{'showHidden':![],'depth':null}));ami['emit'](_0xc67c('0x5d'),this[_0xc67c('0xb')][_0x40ac8d['uniqueid']][_0x3ef7cb]);}}}}}catch(_0x4dba9a){logger[_0xc67c('0x3b')](_0xc67c('0x5e'),_0x40ac8d[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0x4dba9a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc67c('0x22')][_0xc67c('0x18')]=function(_0x3967fe){try{if(this['isNotNull'](_0x3967fe)){logger[_0xc67c('0x29')](_0xc67c('0x5f'),_0x3967fe[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0x3967fe,{'showHidden':![],'depth':null}));if(this['channels'][_0x3967fe[_0xc67c('0x26')]]){for(var _0x56278b in this['channels'][_0x3967fe[_0xc67c('0x26')]]){if(this[_0xc67c('0xb')][_0x3967fe[_0xc67c('0x26')]]['hasOwnProperty'](_0x56278b)){if(this[_0xc67c('0xb')][_0x3967fe[_0xc67c('0x26')]][_0x56278b]['agentconnectAt']&&!this[_0xc67c('0xb')][_0x3967fe[_0xc67c('0x26')]][_0x56278b]['agentcomplete']){logger['info'](_0xc67c('0x60'),_0x3967fe[_0xc67c('0x26')],this['channels'][_0x3967fe[_0xc67c('0x26')]][_0x56278b]['membername'],_0x56278b);this['channels'][_0x3967fe[_0xc67c('0x26')]][_0x56278b]['agentcomplete']=!![];this['channels'][_0x3967fe['uniqueid']][_0x56278b][_0xc67c('0x61')]=moment()[_0xc67c('0x2c')](_0xc67c('0x2d'));this[_0xc67c('0xb')][_0x3967fe[_0xc67c('0x26')]][_0x56278b][_0xc67c('0x51')]=_0xc67c('0x62');this['channels'][_0x3967fe[_0xc67c('0x26')]][_0x56278b][_0xc67c('0x58')]=_0x3967fe[_0xc67c('0x58')]==_0xc67c('0x63')?_0xc67c('0x64'):_0x3967fe[_0xc67c('0x58')];this[_0xc67c('0xb')][_0x3967fe['uniqueid']][_0x56278b][_0xc67c('0x65')]=_0x3967fe[_0xc67c('0x65')];if(this[_0xc67c('0xc')][_0x3967fe[_0xc67c('0x2e')]]&&this['voiceQueues'][_0x3967fe[_0xc67c('0x2e')]][_0xc67c('0x66')]){this[_0xc67c('0xb')][_0x3967fe['uniqueid']][_0x56278b][_0xc67c('0x67')]=this['voiceQueues'][_0x3967fe[_0xc67c('0x2e')]][_0xc67c('0x68')];this['channels'][_0x3967fe[_0xc67c('0x26')]][_0x56278b][_0xc67c('0x69')]=!![];}this['agents'][_0x3967fe[_0xc67c('0x6a')]]=_[_0xc67c('0x33')](this[_0xc67c('0xd')][_0x3967fe[_0xc67c('0x6a')]],[_0xc67c('0x2e'),_0xc67c('0x49')]);logger['debug'](_0xc67c('0x6b'),_0x3967fe[_0xc67c('0x26')],util[_0xc67c('0x2a')](this[_0xc67c('0xb')][_0x3967fe[_0xc67c('0x26')]][_0x56278b],{'showHidden':![],'depth':null}));ami[_0xc67c('0x23')](_0xc67c('0x6c'),this[_0xc67c('0xb')][_0x3967fe[_0xc67c('0x26')]][_0x56278b]);logger[_0xc67c('0x29')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:',_0x3967fe[_0xc67c('0x26')],util[_0xc67c('0x2a')](this['channels'][_0x3967fe[_0xc67c('0x26')]][_0x56278b],{'showHidden':![],'depth':null}));this[_0xc67c('0x23')](util[_0xc67c('0x2c')](_0xc67c('0x39'),_0x3967fe[_0xc67c('0x27')]),_0xc67c('0x6d'),this[_0xc67c('0xb')][_0x3967fe['uniqueid']][_0x56278b]);}}}}}}catch(_0x30bc2e){logger[_0xc67c('0x3b')](_0xc67c('0x6e'),_0x3967fe[_0xc67c('0x26')],util['inspect'](_0x30bc2e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc67c('0x22')][_0xc67c('0x1a')]=function(_0x10589d){try{if(this[_0xc67c('0x3c')](_0x10589d)){logger[_0xc67c('0x29')]('[%s][voiceAgentReport][varset]\x20event:',_0x10589d[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0x10589d,{'showHidden':![],'depth':null}));this[_0xc67c('0x6f')](_0x10589d[_0xc67c('0x26')],_[_0xc67c('0x70')](_0x10589d[_0xc67c('0x71')])[0x0],_0x10589d['value']);if(this[_0xc67c('0xb')][_0x10589d[_0xc67c('0x26')]]){for(var _0x528b95 in this[_0xc67c('0xb')][_0x10589d[_0xc67c('0x26')]]){if(this[_0xc67c('0xb')][_0x10589d[_0xc67c('0x26')]]['hasOwnProperty'](_0x528b95)){logger[_0xc67c('0x24')](_0xc67c('0x72'),_0x10589d['uniqueid'],_0x528b95,_[_0xc67c('0x70')](_0x10589d['variable'])[0x0],_0x10589d[_0xc67c('0x73')]);if(_[_0xc67c('0x2b')](this[_0xc67c('0xb')][_0x10589d['uniqueid']][_0x528b95][_0xc67c('0xe')])){this[_0xc67c('0xb')][_0x10589d['uniqueid']][_0x528b95]['variables']={};}this['channels'][_0x10589d[_0xc67c('0x26')]][_0x528b95]['variables']=this[_0xc67c('0xe')][_0x10589d[_0xc67c('0x26')]];}}}}}catch(_0x5420c9){logger[_0xc67c('0x3b')](_0xc67c('0x74'),_0x10589d[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0x5420c9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc67c('0x22')][_0xc67c('0x6f')]=function(_0x56f579,_0x47d4e1,_0x588454){var _0x4d6af9=[_0xc67c('0x75'),_0xc67c('0x76'),'rtpaudioqosjitter',_0xc67c('0x77'),_0xc67c('0x78'),'rtpaudioqoslossbridged',_0xc67c('0x79'),_0xc67c('0x7a'),_0xc67c('0x7b'),_0xc67c('0x7c'),_0xc67c('0x7d'),_0xc67c('0x7e'),_0xc67c('0x7f'),'memberdynamic',_0xc67c('0x80'),'memberlastcall',_0xc67c('0x27'),_0xc67c('0x81'),_0xc67c('0x82')];if(!_[_0xc67c('0x83')](_0x47d4e1)&&!_[_0xc67c('0x84')](_0x4d6af9,_0x47d4e1)){if(_['isUndefined'](this[_0xc67c('0xe')][_0x56f579])){this[_0xc67c('0xe')][_0x56f579]={};}this[_0xc67c('0xe')][_0x56f579][_0x47d4e1]=_0x588454;}};VoiceAgentReport[_0xc67c('0x22')]['syncHangup']=function(_0x455123){try{if(this['isNotNull'](_0x455123)){logger['debug']('[%s][voiceAgentReport][hangup]\x20event:',_0x455123[_0xc67c('0x26')],util['inspect'](_0x455123,{'showHidden':![],'depth':null}));if(this[_0xc67c('0xb')][_0x455123[_0xc67c('0x26')]]){for(var _0x131242 in this[_0xc67c('0xb')][_0x455123[_0xc67c('0x26')]]){if(this[_0xc67c('0xb')][_0x455123['uniqueid']][_0xc67c('0x3e')](_0x131242)){if(this[_0xc67c('0xb')][_0x455123[_0xc67c('0x26')]][_0x131242][_0xc67c('0x58')]==_0xc67c('0x63')&&this['channels'][_0x455123[_0xc67c('0x26')]][_0x131242][_0xc67c('0x4d')]){logger['info'](_0xc67c('0x85'),_0x455123[_0xc67c('0x26')],_0x131242);this['channels'][_0x455123[_0xc67c('0x26')]][_0x131242]['agentcompleteAt']=moment()[_0xc67c('0x2c')]('YYYY-MM-DD\x20HH:mm:ss');}}}logger[_0xc67c('0x29')](_0xc67c('0x86'),_0x455123[_0xc67c('0x26')],util['inspect'](_[_0xc67c('0x87')](this['channels'][_0x455123[_0xc67c('0x26')]]),{'showHidden':![],'depth':null}));ami[_0xc67c('0x23')](_0xc67c('0x88'),_[_0xc67c('0x87')](this['channels'][_0x455123[_0xc67c('0x26')]]));delete this['channels'][_0x455123[_0xc67c('0x26')]];}if(this[_0xc67c('0xe')][_0x455123[_0xc67c('0x26')]]){delete this[_0xc67c('0xe')][_0x455123[_0xc67c('0x26')]];}}}catch(_0x56547a){logger['error'](_0xc67c('0x89'),_0x455123[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0x56547a,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc67c('0x22')][_0xc67c('0x8a')]=function(_0xfb4267){try{if(this[_0xc67c('0x3c')](_0xfb4267)){logger[_0xc67c('0x29')]('[%s][voiceAgentReport][attendedtransfer]\x20event:',_0xfb4267[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0xfb4267,{'showHidden':![],'depth':null}));if(this[_0xc67c('0xb')][_0xfb4267[_0xc67c('0x8b')]]){for(var _0xa2aba2 in this[_0xc67c('0xb')][_0xfb4267['transfereeuniqueid']]){if(this[_0xc67c('0xb')][_0xfb4267[_0xc67c('0x8b')]]['hasOwnProperty'](_0xa2aba2)){if(_0xfb4267[_0xc67c('0x8c')]===_0xa2aba2){logger[_0xc67c('0x24')](_0xc67c('0x8d'),_0xfb4267[_0xc67c('0x26')],this[_0xc67c('0xb')][_0xfb4267['transfereeuniqueid']][_0xa2aba2][_0xc67c('0x27')],_0xa2aba2);var _0x46c8e1=moment();this[_0xc67c('0xb')][_0xfb4267[_0xc67c('0x8b')]][_0xa2aba2][_0xc67c('0x4d')]=!![];this[_0xc67c('0xb')][_0xfb4267['transfereeuniqueid']][_0xa2aba2]['agentcompleteAt']=moment()[_0xc67c('0x2c')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xc67c('0xb')][_0xfb4267[_0xc67c('0x8b')]][_0xa2aba2][_0xc67c('0x51')]='complete';this[_0xc67c('0xb')][_0xfb4267[_0xc67c('0x8b')]][_0xa2aba2][_0xc67c('0x58')]='transfer';this[_0xc67c('0xb')][_0xfb4267[_0xc67c('0x8b')]][_0xa2aba2][_0xc67c('0x65')]=_0x46c8e1[_0xc67c('0x8e')](this[_0xc67c('0xb')][_0xfb4267[_0xc67c('0x8b')]][_0xa2aba2][_0xc67c('0x40')],_0xc67c('0x8f'));}}}}if(this[_0xc67c('0xb')][_0xfb4267[_0xc67c('0x90')]]){var _0x9995af=this['channels'][_0xfb4267[_0xc67c('0x90')]];this['channels'][_0xfb4267[_0xc67c('0x90')]]=this[_0xc67c('0xb')][_0xfb4267[_0xc67c('0x8b')]];this['channels'][_0xfb4267[_0xc67c('0x8b')]]=_0x9995af;}}}catch(_0x2af758){logger[_0xc67c('0x3b')]('[%s][voiceAgentReport][attendedtransfer]',_0xfb4267[_0xc67c('0x26')],util['inspect'](_0x2af758,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xc67c('0x91')]=function(_0x41c61a){try{if(this[_0xc67c('0x3c')](_0x41c61a)){logger[_0xc67c('0x29')](_0xc67c('0x92'),_0x41c61a[_0xc67c('0x26')],util['inspect'](_0x41c61a,{'showHidden':![],'depth':null}));if(this[_0xc67c('0xb')][_0x41c61a[_0xc67c('0x8b')]]){for(var _0x2f7848 in this[_0xc67c('0xb')][_0x41c61a['transfereeuniqueid']]){if(this[_0xc67c('0xb')][_0x41c61a['transfereeuniqueid']][_0xc67c('0x3e')](_0x2f7848)){if(_0x41c61a[_0xc67c('0x93')]===_0x2f7848){logger['info']('[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x41c61a[_0xc67c('0x26')],this[_0xc67c('0xb')][_0x41c61a[_0xc67c('0x8b')]][_0x2f7848][_0xc67c('0x27')],_0x2f7848);var _0x44034f=moment();this[_0xc67c('0xb')][_0x41c61a[_0xc67c('0x8b')]][_0x2f7848][_0xc67c('0x4d')]=!![];this[_0xc67c('0xb')][_0x41c61a[_0xc67c('0x8b')]][_0x2f7848]['agentcompleteAt']=_0x44034f;this[_0xc67c('0xb')][_0x41c61a[_0xc67c('0x8b')]][_0x2f7848][_0xc67c('0x51')]='complete';this[_0xc67c('0xb')][_0x41c61a[_0xc67c('0x8b')]][_0x2f7848]['reason']=_0xc67c('0x63');this[_0xc67c('0xb')][_0x41c61a[_0xc67c('0x8b')]][_0x2f7848][_0xc67c('0x65')]=_0x44034f[_0xc67c('0x8e')](this['channels'][_0x41c61a[_0xc67c('0x8b')]][_0x2f7848][_0xc67c('0x40')],_0xc67c('0x8f'));}}}}}}catch(_0x251ca0){logger['error']('[%s][voiceAgentReport][blindtransfer]',_0x41c61a[_0xc67c('0x26')],util['inspect'](_0x251ca0,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStart']=function(_0xec9d44){var _0x38d78f='';try{if(this[_0xc67c('0x3c')](_0xec9d44)){logger[_0xc67c('0x29')](_0xc67c('0x94'),_0xec9d44[_0xc67c('0x26')],util['inspect'](_0xec9d44,{'showHidden':![],'depth':null}));if(_0xec9d44['channel']){_0x38d78f=_0xec9d44[_0xc67c('0x95')][_0xc67c('0x96')](0x0,_0xec9d44[_0xc67c('0x95')]['lastIndexOf']('-'));if(this[_0xc67c('0xd')][_0x38d78f]){logger[_0xc67c('0x24')](_0xc67c('0x97'),_0xec9d44['uniqueid'],_0x38d78f);this[_0xc67c('0xd')][_0x38d78f][_0xc67c('0x98')]=!![];}}}}catch(_0x1b81e2){logger['error'](_0xc67c('0x99'),_0xec9d44[_0xc67c('0x26')],util['inspect'](_0x1b81e2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xc67c('0x22')]['syncMusicOnHoldStop']=function(_0x4d292d){var _0x85169d='';try{if(this[_0xc67c('0x3c')](_0x4d292d)){logger[_0xc67c('0x29')](_0xc67c('0x9a'),_0x4d292d[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0x4d292d,{'showHidden':![],'depth':null}));if(_0x4d292d[_0xc67c('0x95')]){_0x85169d=_0x4d292d[_0xc67c('0x95')][_0xc67c('0x96')](0x0,_0x4d292d[_0xc67c('0x95')][_0xc67c('0x9b')]('-'));if(this[_0xc67c('0xd')][_0x85169d]){logger[_0xc67c('0x24')](_0xc67c('0x9c'),_0x4d292d[_0xc67c('0x26')],_0x85169d);this['agents'][_0x85169d][_0xc67c('0x98')]=![];}}}}catch(_0xe02adf){logger[_0xc67c('0x3b')](_0xc67c('0x9d'),_0x4d292d[_0xc67c('0x26')],util[_0xc67c('0x2a')](_0xe02adf,{'showHidden':![],'depth':null}));}};module[_0xc67c('0x9e')]=VoiceAgentReport;
\ No newline at end of file
+var _0xdbcd=['syncAgentComplete','syncVarSet','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','uniqueid','membername','debug','inspect','isUndefined','destuniqueid','format','called','inbound','voice','merge','event','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','syncAgentConnect','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','info','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','lastevent','connect','routealias','interface','pick','queue','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','YYYY-MM-DD\x20HH:mm:ss','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','reason','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','[%s][voiceAgentReport][agentconnect]','isNotNull','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','syncQueueCallerAbandon','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:','[%s][voiceAgentReport][queuecallerabandon]','[%s][voiceAgentReport][agentcomplete]\x20event:','agentconnectAt','agentcompleteAt','complete','transfer','agent','talktime','acw','acwTimeout','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','values','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','[%s][voiceAgentReport][blindtransfer]','[%s][voiceAgentReport][musiconholdstart]\x20event:','channel','substring','onhold','[%s][voiceAgentReport][musiconholdstart]','lastIndexOf','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','moment','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceChannels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','agentconnect','agentringnoanswer','bind','queuecallerabandon','agentcomplete'];(function(_0x36463f,_0x429571){var _0x14e517=function(_0x198d96){while(--_0x198d96){_0x36463f['push'](_0x36463f['shift']());}};_0x14e517(++_0x429571);}(_0xdbcd,0x1bc));var _0xddbc=function(_0x36dae3,_0x2623e7){_0x36dae3=_0x36dae3-0x0;var _0x423428=_0xdbcd[_0x36dae3];return _0x423428;};'use strict';var _=require('lodash');var moment=require(_0xddbc('0x0'));var util=require('util');var Redis=require(_0xddbc('0x1'));var config=require(_0xddbc('0x2'));var logger=require(_0xddbc('0x3'))('ami');var ami=require(_0xddbc('0x4'));config[_0xddbc('0x5')]=_[_0xddbc('0x6')](config['redis'],{'host':_0xddbc('0x7'),'port':0x18eb});var io=require(_0xddbc('0x8'))(new Redis(config[_0xddbc('0x5')]));function VoiceAgentReport(_0x84699b){this[_0xddbc('0x9')]={};this[_0xddbc('0xa')]=_0x84699b[_0xddbc('0x9')];this[_0xddbc('0xb')]=_0x84699b[_0xddbc('0xb')];this[_0xddbc('0xc')]=_0x84699b[_0xddbc('0xc')];this[_0xddbc('0xd')]={};ami['on'](_0xddbc('0xe'),this[_0xddbc('0xf')]['bind'](this));ami['on'](_0xddbc('0x10'),this['syncAgentConnect']['bind'](this));ami['on'](_0xddbc('0x11'),this['syncAgentRingNoAnswer'][_0xddbc('0x12')](this));ami['on'](_0xddbc('0x13'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0xddbc('0x14'),this[_0xddbc('0x15')]['bind'](this));ami['on']('varset',this[_0xddbc('0x16')]['bind'](this));ami['on'](_0xddbc('0x17'),this[_0xddbc('0x18')]['bind'](this));ami['on']('musiconholdstart',this[_0xddbc('0x19')][_0xddbc('0x12')](this));ami['on'](_0xddbc('0x1a'),this[_0xddbc('0x1b')][_0xddbc('0x12')](this));ami['on'](_0xddbc('0x1c'),this[_0xddbc('0x1d')]['bind'](this));ami['on'](_0xddbc('0x1e'),this[_0xddbc('0x1f')][_0xddbc('0x12')](this));}VoiceAgentReport[_0xddbc('0x20')][_0xddbc('0x21')]=function(_0x22da1d,_0x54d4f5,_0x4240ff){io['to'](_0x22da1d)[_0xddbc('0x21')](_0x54d4f5,_0x4240ff);};VoiceAgentReport['prototype']['isNotNull']=function(_0x267b70){return _0x267b70!==null&&!_['isUndefined'](_0x267b70);};VoiceAgentReport[_0xddbc('0x20')]['syncAgentCalled']=function(_0x2a2c35){try{if(this['isNotNull'](_0x2a2c35)){logger['info']('[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x2a2c35[_0xddbc('0x22')],_0x2a2c35[_0xddbc('0x23')],_0x2a2c35['destuniqueid']);logger[_0xddbc('0x24')]('[%s][voiceAgentReport][agentcalled]\x20event:',_0x2a2c35['uniqueid'],util[_0xddbc('0x25')](_0x2a2c35,{'showHidden':![],'depth':null}));if(_[_0xddbc('0x26')](this[_0xddbc('0x9')][_0x2a2c35[_0xddbc('0x22')]])){this[_0xddbc('0x9')][_0x2a2c35[_0xddbc('0x22')]]={};}if(_[_0xddbc('0x26')](this['channels'][_0x2a2c35['uniqueid']][_0x2a2c35[_0xddbc('0x27')]])){this[_0xddbc('0x9')][_0x2a2c35[_0xddbc('0x22')]][_0x2a2c35[_0xddbc('0x27')]]={'agentcalledAt':moment()[_0xddbc('0x28')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0xddbc('0x29'),'mandatoryDisposition':this['voiceQueues'][_0x2a2c35['queue']]?this['voiceQueues'][_0x2a2c35['queue']]['mandatoryDisposition']||![]:![],'type':this[_0xddbc('0xb')][_0x2a2c35['queue']]?this['voiceQueues'][_0x2a2c35['queue']]['type']||_0xddbc('0x2a'):_0xddbc('0x2a'),'variables':this['variables'][_0x2a2c35[_0xddbc('0x22')]],'motionChannel':_0xddbc('0x2b')};}_[_0xddbc('0x2c')](this[_0xddbc('0x9')][_0x2a2c35['uniqueid']][_0x2a2c35[_0xddbc('0x27')]],_['omit'](_0x2a2c35,[_0xddbc('0x2d'),'privilege']));logger['debug'](_0xddbc('0x2e'),_0x2a2c35[_0xddbc('0x22')],util[_0xddbc('0x25')](this[_0xddbc('0x9')][_0x2a2c35[_0xddbc('0x22')]][_0x2a2c35[_0xddbc('0x27')]],{'showHidden':![],'depth':null}));ami['emit'](_0xddbc('0x2f'),this['channels'][_0x2a2c35[_0xddbc('0x22')]][_0x2a2c35[_0xddbc('0x27')]]);logger['debug'](_0xddbc('0x30'),_0x2a2c35[_0xddbc('0x22')],util[_0xddbc('0x25')](this[_0xddbc('0x9')][_0x2a2c35[_0xddbc('0x22')]][_0x2a2c35['destuniqueid']],{'showHidden':![],'depth':null}));this[_0xddbc('0x21')](util['format'](_0xddbc('0x31'),_0x2a2c35['membername']),_0xddbc('0x32'),this[_0xddbc('0x9')][_0x2a2c35['uniqueid']][_0x2a2c35[_0xddbc('0x27')]]);}}catch(_0x4ab6d1){logger[_0xddbc('0x33')](_0xddbc('0x34'),_0x2a2c35[_0xddbc('0x22')],util['inspect'](_0x4ab6d1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xddbc('0x20')][_0xddbc('0x35')]=function(_0x57b806){try{if(this['isNotNull'](_0x57b806)){if(this[_0xddbc('0x9')][_0x57b806[_0xddbc('0x22')]]){logger[_0xddbc('0x24')](_0xddbc('0x36'),_0x57b806[_0xddbc('0x22')],util[_0xddbc('0x25')](_0x57b806,{'showHidden':![],'depth':null}));for(var _0x4737e2 in this[_0xddbc('0x9')][_0x57b806[_0xddbc('0x22')]]){if(this[_0xddbc('0x9')][_0x57b806[_0xddbc('0x22')]][_0xddbc('0x37')](_0x4737e2)){if(_0x57b806[_0xddbc('0x27')]===_0x4737e2){logger[_0xddbc('0x38')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x57b806['uniqueid'],_0x57b806[_0xddbc('0x23')],_0x57b806[_0xddbc('0x27')]);this['channels'][_0x57b806[_0xddbc('0x22')]][_0x4737e2]['agentconnectAt']=moment()[_0xddbc('0x28')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xddbc('0x9')][_0x57b806['uniqueid']][_0x4737e2][_0xddbc('0x39')]=_0x57b806[_0xddbc('0x39')];this[_0xddbc('0x9')][_0x57b806[_0xddbc('0x22')]][_0x4737e2][_0xddbc('0x3a')]=_0x57b806[_0xddbc('0x3a')];this[_0xddbc('0x9')][_0x57b806[_0xddbc('0x22')]][_0x4737e2][_0xddbc('0x3b')]=_0x57b806[_0xddbc('0x3b')];this['channels'][_0x57b806['uniqueid']][_0x4737e2][_0xddbc('0x3c')]=_0x57b806[_0xddbc('0x3c')];this[_0xddbc('0x9')][_0x57b806[_0xddbc('0x22')]][_0x4737e2][_0xddbc('0x3d')]=_0x57b806[_0xddbc('0x3d')];this[_0xddbc('0x9')][_0x57b806[_0xddbc('0x22')]][_0x4737e2][_0xddbc('0x3e')]=_0xddbc('0x3f');if(this[_0xddbc('0xa')][this['channels'][_0x57b806[_0xddbc('0x22')]][_0x4737e2][_0xddbc('0x22')]]){var _0x26f06e=this[_0xddbc('0xa')][this[_0xddbc('0x9')][_0x57b806[_0xddbc('0x22')]][_0x4737e2][_0xddbc('0x22')]][_0xddbc('0x40')];this['channels'][_0x57b806['uniqueid']][_0x4737e2]['routealias']=_0x26f06e;_0x57b806['routealias']=_0x26f06e;}_[_0xddbc('0x2c')](this[_0xddbc('0xc')][_0x57b806[_0xddbc('0x41')]],_[_0xddbc('0x42')](_0x57b806,[_0xddbc('0x43'),_0xddbc('0x44'),'routealias']));logger[_0xddbc('0x24')](_0xddbc('0x45'),_0x57b806[_0xddbc('0x22')],util[_0xddbc('0x25')](this['channels'][_0x57b806[_0xddbc('0x22')]][_0x57b806['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0xddbc('0x21')](_0xddbc('0x46'),this[_0xddbc('0x9')][_0x57b806['uniqueid']][_0x57b806[_0xddbc('0x27')]]);logger['debug'](_0xddbc('0x47'),_0x57b806[_0xddbc('0x22')],util['inspect'](this['channels'][_0x57b806['uniqueid']][_0x57b806[_0xddbc('0x27')]],{'showHidden':![],'depth':null}));this[_0xddbc('0x21')](util[_0xddbc('0x28')]('user:%s',_0x57b806[_0xddbc('0x23')]),_0xddbc('0x48'),this[_0xddbc('0x9')][_0x57b806['uniqueid']][_0x57b806[_0xddbc('0x27')]]);}else if(!this[_0xddbc('0x9')][_0x57b806[_0xddbc('0x22')]][_0x4737e2]['agentringnoanswer']&&!this['channels'][_0x57b806[_0xddbc('0x22')]][_0x4737e2][_0xddbc('0x14')]){logger[_0xddbc('0x38')](_0xddbc('0x49'),_0x57b806['uniqueid'],this[_0xddbc('0x9')][_0x57b806[_0xddbc('0x22')]][_0x4737e2][_0xddbc('0x23')],_0x4737e2);this[_0xddbc('0x9')][_0x57b806['uniqueid']][_0x4737e2][_0xddbc('0x11')]=!![];this[_0xddbc('0x9')][_0x57b806[_0xddbc('0x22')]][_0x4737e2][_0xddbc('0x4a')]=moment()[_0xddbc('0x28')](_0xddbc('0x4b'));this['channels'][_0x57b806[_0xddbc('0x22')]][_0x4737e2][_0xddbc('0x4c')]=_0x57b806[_0xddbc('0x27')];this['channels'][_0x57b806['uniqueid']][_0x4737e2][_0xddbc('0x4d')]=_0x57b806[_0xddbc('0x23')];this['channels'][_0x57b806['uniqueid']][_0x4737e2]['lastevent']=_0xddbc('0x4e');this['channels'][_0x57b806[_0xddbc('0x22')]][_0x4737e2][_0xddbc('0x4f')]=_0xddbc('0x4e');logger[_0xddbc('0x24')](_0xddbc('0x50'),_0x57b806[_0xddbc('0x22')],util[_0xddbc('0x25')](this[_0xddbc('0x9')][_0x57b806['uniqueid']][_0x4737e2],{'showHidden':![],'depth':null}));ami['emit']('custom:agentansweredelsewhere',this['channels'][_0x57b806[_0xddbc('0x22')]][_0x4737e2]);}}}}}}catch(_0x393309){logger[_0xddbc('0x33')](_0xddbc('0x51'),_0x57b806[_0xddbc('0x22')],util['inspect'](_0x393309,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentRingNoAnswer']=function(_0x36bb47){try{if(this[_0xddbc('0x52')](_0x36bb47)){logger[_0xddbc('0x24')]('[%s][voiceAgentReport][agentringnoanswer]\x20event:',_0x36bb47[_0xddbc('0x22')],util[_0xddbc('0x25')](_0x36bb47,{'showHidden':![],'depth':null}));if(this['channels'][_0x36bb47[_0xddbc('0x22')]]&&this[_0xddbc('0x9')][_0x36bb47[_0xddbc('0x22')]][_0x36bb47['destuniqueid']]){logger[_0xddbc('0x38')](_0xddbc('0x53'),_0x36bb47['uniqueid'],_0x36bb47[_0xddbc('0x23')],_0x36bb47[_0xddbc('0x27')]);this['channels'][_0x36bb47[_0xddbc('0x22')]][_0x36bb47[_0xddbc('0x27')]]['agentringnoanswer']=!![];this[_0xddbc('0x9')][_0x36bb47[_0xddbc('0x22')]][_0x36bb47[_0xddbc('0x27')]][_0xddbc('0x4a')]=moment()[_0xddbc('0x28')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xddbc('0x9')][_0x36bb47[_0xddbc('0x22')]][_0x36bb47[_0xddbc('0x27')]][_0xddbc('0x3e')]=_0xddbc('0x54');this[_0xddbc('0x9')][_0x36bb47[_0xddbc('0x22')]][_0x36bb47[_0xddbc('0x27')]][_0xddbc('0x4f')]=_0xddbc('0x54');logger[_0xddbc('0x24')](_0xddbc('0x55'),_0x36bb47[_0xddbc('0x22')],util[_0xddbc('0x25')](this[_0xddbc('0x9')][_0x36bb47[_0xddbc('0x22')]][_0x36bb47['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0xddbc('0x21')](_0xddbc('0x56'),this['channels'][_0x36bb47['uniqueid']][_0x36bb47[_0xddbc('0x27')]]);}}}catch(_0x2e3cd0){logger[_0xddbc('0x33')](_0xddbc('0x57'),_0x36bb47['uniqueid'],util[_0xddbc('0x25')](_0x2e3cd0,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xddbc('0x20')][_0xddbc('0x58')]=function(_0x30f0d2){try{if(this[_0xddbc('0x52')](_0x30f0d2)){logger[_0xddbc('0x24')](_0xddbc('0x59'),_0x30f0d2[_0xddbc('0x22')],util[_0xddbc('0x25')](_0x30f0d2,{'showHidden':![],'depth':null}));if(this[_0xddbc('0x9')][_0x30f0d2[_0xddbc('0x22')]]){for(var _0x36dba7 in this[_0xddbc('0x9')][_0x30f0d2[_0xddbc('0x22')]]){if(this['channels'][_0x30f0d2[_0xddbc('0x22')]]['hasOwnProperty'](_0x36dba7)&&!this['channels'][_0x30f0d2[_0xddbc('0x22')]][_0x36dba7]['agentringnoanswer']&&!this[_0xddbc('0x9')][_0x30f0d2[_0xddbc('0x22')]][_0x36dba7][_0xddbc('0x14')]){logger[_0xddbc('0x38')](_0xddbc('0x5a'),_0x30f0d2['uniqueid'],this[_0xddbc('0x9')][_0x30f0d2['uniqueid']][_0x36dba7]['membername'],_0x36dba7);this[_0xddbc('0x9')][_0x30f0d2[_0xddbc('0x22')]][_0x36dba7][_0xddbc('0x11')]=!![];this[_0xddbc('0x9')][_0x30f0d2[_0xddbc('0x22')]][_0x36dba7][_0xddbc('0x4a')]=moment()['format'](_0xddbc('0x4b'));this[_0xddbc('0x9')][_0x30f0d2[_0xddbc('0x22')]][_0x36dba7][_0xddbc('0x3e')]=_0xddbc('0x5b');this[_0xddbc('0x9')][_0x30f0d2['uniqueid']][_0x36dba7][_0xddbc('0x4f')]=_0xddbc('0x5b');logger['debug'](_0xddbc('0x5c'),_0x30f0d2[_0xddbc('0x22')],util[_0xddbc('0x25')](this['channels'][_0x30f0d2[_0xddbc('0x22')]][_0x36dba7],{'showHidden':![],'depth':null}));ami[_0xddbc('0x21')]('custom:agentqueuecallerabandon',this[_0xddbc('0x9')][_0x30f0d2[_0xddbc('0x22')]][_0x36dba7]);}}}}}catch(_0x3b01b2){logger[_0xddbc('0x33')](_0xddbc('0x5d'),_0x30f0d2[_0xddbc('0x22')],util['inspect'](_0x3b01b2,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xddbc('0x15')]=function(_0x2f9aff){try{if(this[_0xddbc('0x52')](_0x2f9aff)){logger[_0xddbc('0x24')](_0xddbc('0x5e'),_0x2f9aff[_0xddbc('0x22')],util[_0xddbc('0x25')](_0x2f9aff,{'showHidden':![],'depth':null}));if(this[_0xddbc('0x9')][_0x2f9aff[_0xddbc('0x22')]]){for(var _0x45a783 in this[_0xddbc('0x9')][_0x2f9aff[_0xddbc('0x22')]]){if(this[_0xddbc('0x9')][_0x2f9aff['uniqueid']][_0xddbc('0x37')](_0x45a783)){if(this[_0xddbc('0x9')][_0x2f9aff[_0xddbc('0x22')]][_0x45a783][_0xddbc('0x5f')]&&!this[_0xddbc('0x9')][_0x2f9aff[_0xddbc('0x22')]][_0x45a783][_0xddbc('0x14')]){logger[_0xddbc('0x38')]('[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x2f9aff['uniqueid'],this[_0xddbc('0x9')][_0x2f9aff[_0xddbc('0x22')]][_0x45a783][_0xddbc('0x23')],_0x45a783);this[_0xddbc('0x9')][_0x2f9aff[_0xddbc('0x22')]][_0x45a783][_0xddbc('0x14')]=!![];this[_0xddbc('0x9')][_0x2f9aff[_0xddbc('0x22')]][_0x45a783][_0xddbc('0x60')]=moment()[_0xddbc('0x28')](_0xddbc('0x4b'));this['channels'][_0x2f9aff['uniqueid']][_0x45a783][_0xddbc('0x3e')]=_0xddbc('0x61');this[_0xddbc('0x9')][_0x2f9aff[_0xddbc('0x22')]][_0x45a783][_0xddbc('0x4f')]=_0x2f9aff[_0xddbc('0x4f')]==_0xddbc('0x62')?_0xddbc('0x63'):_0x2f9aff[_0xddbc('0x4f')];this['channels'][_0x2f9aff[_0xddbc('0x22')]][_0x45a783][_0xddbc('0x64')]=_0x2f9aff[_0xddbc('0x64')];if(this[_0xddbc('0xb')][_0x2f9aff[_0xddbc('0x43')]]&&this[_0xddbc('0xb')][_0x2f9aff['queue']][_0xddbc('0x65')]){this[_0xddbc('0x9')][_0x2f9aff['uniqueid']][_0x45a783]['acwtime']=this['voiceQueues'][_0x2f9aff['queue']][_0xddbc('0x66')];this[_0xddbc('0x9')][_0x2f9aff[_0xddbc('0x22')]][_0x45a783]['agentacw']=!![];}this[_0xddbc('0xc')][_0x2f9aff[_0xddbc('0x41')]]=_['omit'](this[_0xddbc('0xc')][_0x2f9aff[_0xddbc('0x41')]],[_0xddbc('0x43'),_0xddbc('0x44')]);logger['debug']('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x2f9aff[_0xddbc('0x22')],util[_0xddbc('0x25')](this[_0xddbc('0x9')][_0x2f9aff[_0xddbc('0x22')]][_0x45a783],{'showHidden':![],'depth':null}));ami[_0xddbc('0x21')](_0xddbc('0x67'),this[_0xddbc('0x9')][_0x2f9aff[_0xddbc('0x22')]][_0x45a783]);logger['debug'](_0xddbc('0x68'),_0x2f9aff[_0xddbc('0x22')],util[_0xddbc('0x25')](this[_0xddbc('0x9')][_0x2f9aff[_0xddbc('0x22')]][_0x45a783],{'showHidden':![],'depth':null}));this[_0xddbc('0x21')](util['format'](_0xddbc('0x31'),_0x2f9aff[_0xddbc('0x23')]),_0xddbc('0x69'),this[_0xddbc('0x9')][_0x2f9aff[_0xddbc('0x22')]][_0x45a783]);}}}}}}catch(_0x5420c){logger['error'](_0xddbc('0x6a'),_0x2f9aff[_0xddbc('0x22')],util[_0xddbc('0x25')](_0x5420c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xddbc('0x20')][_0xddbc('0x16')]=function(_0xc6ce72){try{if(this['isNotNull'](_0xc6ce72)){logger[_0xddbc('0x24')]('[%s][voiceAgentReport][varset]\x20event:',_0xc6ce72[_0xddbc('0x22')],util[_0xddbc('0x25')](_0xc6ce72,{'showHidden':![],'depth':null}));this[_0xddbc('0x6b')](_0xc6ce72['uniqueid'],_[_0xddbc('0x6c')](_0xc6ce72[_0xddbc('0x6d')])[0x0],_0xc6ce72[_0xddbc('0x6e')]);if(this[_0xddbc('0x9')][_0xc6ce72[_0xddbc('0x22')]]){for(var _0x5a605c in this[_0xddbc('0x9')][_0xc6ce72[_0xddbc('0x22')]]){if(this[_0xddbc('0x9')][_0xc6ce72['uniqueid']]['hasOwnProperty'](_0x5a605c)){logger[_0xddbc('0x38')](_0xddbc('0x6f'),_0xc6ce72[_0xddbc('0x22')],_0x5a605c,_[_0xddbc('0x6c')](_0xc6ce72['variable'])[0x0],_0xc6ce72[_0xddbc('0x6e')]);if(_[_0xddbc('0x26')](this[_0xddbc('0x9')][_0xc6ce72[_0xddbc('0x22')]][_0x5a605c][_0xddbc('0xd')])){this['channels'][_0xc6ce72[_0xddbc('0x22')]][_0x5a605c][_0xddbc('0xd')]={};}this[_0xddbc('0x9')][_0xc6ce72[_0xddbc('0x22')]][_0x5a605c]['variables']=this['variables'][_0xc6ce72[_0xddbc('0x22')]];}}}}}catch(_0x364914){logger[_0xddbc('0x33')](_0xddbc('0x70'),_0xc6ce72['uniqueid'],util[_0xddbc('0x25')](_0x364914,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xddbc('0x20')][_0xddbc('0x6b')]=function(_0x14f8c4,_0x3b14d7,_0x3904ef){var _0x2af5e8=[_0xddbc('0x71'),_0xddbc('0x72'),_0xddbc('0x73'),_0xddbc('0x74'),_0xddbc('0x75'),_0xddbc('0x76'),_0xddbc('0x77'),_0xddbc('0x78'),_0xddbc('0x79'),_0xddbc('0x7a'),'bridgepeer',_0xddbc('0x7b'),_0xddbc('0x7c'),_0xddbc('0x7d'),'memberinterface',_0xddbc('0x7e'),'membername',_0xddbc('0x7f'),_0xddbc('0x80')];if(!_[_0xddbc('0x81')](_0x3b14d7)&&!_[_0xddbc('0x82')](_0x2af5e8,_0x3b14d7)){if(_['isUndefined'](this[_0xddbc('0xd')][_0x14f8c4])){this[_0xddbc('0xd')][_0x14f8c4]={};}this[_0xddbc('0xd')][_0x14f8c4][_0x3b14d7]=_0x3904ef;}};VoiceAgentReport[_0xddbc('0x20')]['syncHangup']=function(_0x24a339){try{if(this[_0xddbc('0x52')](_0x24a339)){logger[_0xddbc('0x24')]('[%s][voiceAgentReport][hangup]\x20event:',_0x24a339['uniqueid'],util[_0xddbc('0x25')](_0x24a339,{'showHidden':![],'depth':null}));if(this['channels'][_0x24a339[_0xddbc('0x22')]]){for(var _0xb6c4e6 in this[_0xddbc('0x9')][_0x24a339['uniqueid']]){if(this[_0xddbc('0x9')][_0x24a339[_0xddbc('0x22')]]['hasOwnProperty'](_0xb6c4e6)){if(this[_0xddbc('0x9')][_0x24a339[_0xddbc('0x22')]][_0xb6c4e6]['reason']==_0xddbc('0x62')&&this[_0xddbc('0x9')][_0x24a339['uniqueid']][_0xb6c4e6]['agentcomplete']){logger[_0xddbc('0x38')](_0xddbc('0x83'),_0x24a339[_0xddbc('0x22')],_0xb6c4e6);this['channels'][_0x24a339[_0xddbc('0x22')]][_0xb6c4e6][_0xddbc('0x60')]=moment()[_0xddbc('0x28')](_0xddbc('0x4b'));}}}logger['debug']('[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:',_0x24a339[_0xddbc('0x22')],util[_0xddbc('0x25')](_[_0xddbc('0x84')](this['channels'][_0x24a339['uniqueid']]),{'showHidden':![],'depth':null}));ami[_0xddbc('0x21')]('custom:voiceAgentReport',_[_0xddbc('0x84')](this[_0xddbc('0x9')][_0x24a339[_0xddbc('0x22')]]));delete this[_0xddbc('0x9')][_0x24a339[_0xddbc('0x22')]];}if(this['variables'][_0x24a339[_0xddbc('0x22')]]){delete this[_0xddbc('0xd')][_0x24a339[_0xddbc('0x22')]];}}}catch(_0x5436bd){logger[_0xddbc('0x33')](_0xddbc('0x85'),_0x24a339['uniqueid'],util[_0xddbc('0x25')](_0x5436bd,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xddbc('0x20')]['syncAttendedTransfer']=function(_0x40d787){try{if(this[_0xddbc('0x52')](_0x40d787)){logger[_0xddbc('0x24')](_0xddbc('0x86'),_0x40d787['uniqueid'],util[_0xddbc('0x25')](_0x40d787,{'showHidden':![],'depth':null}));if(this[_0xddbc('0x9')][_0x40d787['transfereeuniqueid']]){for(var _0x18a282 in this['channels'][_0x40d787[_0xddbc('0x87')]]){if(this['channels'][_0x40d787['transfereeuniqueid']]['hasOwnProperty'](_0x18a282)){if(_0x40d787[_0xddbc('0x88')]===_0x18a282){logger[_0xddbc('0x38')](_0xddbc('0x89'),_0x40d787[_0xddbc('0x22')],this[_0xddbc('0x9')][_0x40d787[_0xddbc('0x87')]][_0x18a282][_0xddbc('0x23')],_0x18a282);var _0x597612=moment();this[_0xddbc('0x9')][_0x40d787['transfereeuniqueid']][_0x18a282][_0xddbc('0x14')]=!![];this[_0xddbc('0x9')][_0x40d787[_0xddbc('0x87')]][_0x18a282][_0xddbc('0x60')]=moment()[_0xddbc('0x28')](_0xddbc('0x4b'));this[_0xddbc('0x9')][_0x40d787[_0xddbc('0x87')]][_0x18a282][_0xddbc('0x3e')]=_0xddbc('0x61');this['channels'][_0x40d787[_0xddbc('0x87')]][_0x18a282]['reason']=_0xddbc('0x62');this['channels'][_0x40d787[_0xddbc('0x87')]][_0x18a282][_0xddbc('0x64')]=_0x597612['diff'](this[_0xddbc('0x9')][_0x40d787[_0xddbc('0x87')]][_0x18a282]['agentconnectAt'],_0xddbc('0x8a'));}}}}if(this[_0xddbc('0x9')][_0x40d787[_0xddbc('0x8b')]]){var _0x32a6c6=this[_0xddbc('0x9')][_0x40d787['secondtransfereruniqueid']];this[_0xddbc('0x9')][_0x40d787[_0xddbc('0x8b')]]=this['channels'][_0x40d787['transfereeuniqueid']];this['channels'][_0x40d787[_0xddbc('0x87')]]=_0x32a6c6;}}}catch(_0x2b1152){logger['error'](_0xddbc('0x8c'),_0x40d787[_0xddbc('0x22')],util[_0xddbc('0x25')](_0x2b1152,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xddbc('0x20')][_0xddbc('0x1f')]=function(_0x114b1c){try{if(this['isNotNull'](_0x114b1c)){logger['debug'](_0xddbc('0x8d'),_0x114b1c[_0xddbc('0x22')],util[_0xddbc('0x25')](_0x114b1c,{'showHidden':![],'depth':null}));if(this[_0xddbc('0x9')][_0x114b1c['transfereeuniqueid']]){for(var _0x51ac99 in this[_0xddbc('0x9')][_0x114b1c['transfereeuniqueid']]){if(this[_0xddbc('0x9')][_0x114b1c[_0xddbc('0x87')]][_0xddbc('0x37')](_0x51ac99)){if(_0x114b1c[_0xddbc('0x8e')]===_0x51ac99){logger[_0xddbc('0x38')](_0xddbc('0x8f'),_0x114b1c[_0xddbc('0x22')],this[_0xddbc('0x9')][_0x114b1c[_0xddbc('0x87')]][_0x51ac99][_0xddbc('0x23')],_0x51ac99);var _0x17c7fa=moment();this[_0xddbc('0x9')][_0x114b1c[_0xddbc('0x87')]][_0x51ac99][_0xddbc('0x14')]=!![];this[_0xddbc('0x9')][_0x114b1c[_0xddbc('0x87')]][_0x51ac99][_0xddbc('0x60')]=_0x17c7fa;this[_0xddbc('0x9')][_0x114b1c['transfereeuniqueid']][_0x51ac99][_0xddbc('0x3e')]='complete';this[_0xddbc('0x9')][_0x114b1c[_0xddbc('0x87')]][_0x51ac99][_0xddbc('0x4f')]=_0xddbc('0x62');this[_0xddbc('0x9')][_0x114b1c[_0xddbc('0x87')]][_0x51ac99][_0xddbc('0x64')]=_0x17c7fa[_0xddbc('0x90')](this[_0xddbc('0x9')][_0x114b1c['transfereeuniqueid']][_0x51ac99]['agentconnectAt'],_0xddbc('0x8a'));}}}}}}catch(_0x107af3){logger[_0xddbc('0x33')](_0xddbc('0x91'),_0x114b1c[_0xddbc('0x22')],util['inspect'](_0x107af3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xddbc('0x20')][_0xddbc('0x19')]=function(_0xa8deef){var _0x2f1665='';try{if(this['isNotNull'](_0xa8deef)){logger['debug'](_0xddbc('0x92'),_0xa8deef['uniqueid'],util['inspect'](_0xa8deef,{'showHidden':![],'depth':null}));if(_0xa8deef[_0xddbc('0x93')]){_0x2f1665=_0xa8deef['channel'][_0xddbc('0x94')](0x0,_0xa8deef[_0xddbc('0x93')]['lastIndexOf']('-'));if(this[_0xddbc('0xc')][_0x2f1665]){logger[_0xddbc('0x38')]('[%s][voiceAgentReport][musiconholdstart]\x20interface:%s',_0xa8deef[_0xddbc('0x22')],_0x2f1665);this[_0xddbc('0xc')][_0x2f1665][_0xddbc('0x95')]=!![];}}}}catch(_0x5e2ba7){logger[_0xddbc('0x33')](_0xddbc('0x96'),_0xa8deef['uniqueid'],util[_0xddbc('0x25')](_0x5e2ba7,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xddbc('0x20')]['syncMusicOnHoldStop']=function(_0x4ac89b){var _0x1decbf='';try{if(this[_0xddbc('0x52')](_0x4ac89b)){logger[_0xddbc('0x24')]('[%s][voiceAgentReport][musiconholdstop]\x20event:',_0x4ac89b[_0xddbc('0x22')],util['inspect'](_0x4ac89b,{'showHidden':![],'depth':null}));if(_0x4ac89b[_0xddbc('0x93')]){_0x1decbf=_0x4ac89b['channel'][_0xddbc('0x94')](0x0,_0x4ac89b[_0xddbc('0x93')][_0xddbc('0x97')]('-'));if(this[_0xddbc('0xc')][_0x1decbf]){logger['info'](_0xddbc('0x98'),_0x4ac89b['uniqueid'],_0x1decbf);this[_0xddbc('0xc')][_0x1decbf][_0xddbc('0x95')]=![];}}}}catch(_0x487547){logger['error'](_0xddbc('0x99'),_0x4ac89b['uniqueid'],util[_0xddbc('0x25')](_0x487547,{'showHidden':![],'depth':null}));}};module[_0xddbc('0x9a')]=VoiceAgentReport;
\ No newline at end of file
index 5651da0..50d421b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x52bb=['[%s][voiceCallReport][mixMonitorFilename]','[%s][voiceCallReport][varset]\x20event:','variable','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','syncMixMonitorFilename','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','callerid','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','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:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','mixmonitor_filename','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','cause-txt','endtime','billableseconds','holdtime','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','transferType','undefined','isEmpty','getSettings','then','stopRecordingOnTransfer','resolve','Action','StopMixMonitor','catch','finally','destinationchannel','webbar:stopmonitors','event','BlindTransfer','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','outbound','routeid','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','exports','bluebird','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','../ami','../model/channel','../rpc/setting','unknown','not_inuse','inuse','invalid','unavailable','ringinuse','onhold','set','queue','agi','dial','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newchannel','newstate','varset','syncVarSet','hangup','syncHangup','newcallerid','syncNewCallerId','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','inspect','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','merge','pick','keys','context','from-sip','exten','split','destconnectedlinenum','user:%s','name','user:agentconnect','channel','connectedlinenum','[%s][voiceCallReport][newcallerid]','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','starttime','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','accountcode','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','toLowerCase','applicationdata','appdata','CDR(routeAlias)','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','application','duration','seconds','lastapplication','lastdata','startsWith','[%s][voiceCallReport][newexten]','syncNewState','[%s][voiceCallReport][newstate]\x20event:','answertime','diff','xcally-motion-preview','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','endsWith','.wav49','monitorFilename','find','monitors','isNil','push','rec'];(function(_0x81ab8b,_0x5677be){var _0x377eba=function(_0x4eb469){while(--_0x4eb469){_0x81ab8b['push'](_0x81ab8b['shift']());}};_0x377eba(++_0x5677be);}(_0x52bb,0x127));var _0xb52b=function(_0x2fa1d0,_0x41a848){_0x2fa1d0=_0x2fa1d0-0x0;var _0x170d37=_0x52bb[_0x2fa1d0];return _0x170d37;};'use strict';var BPromise=require(_0xb52b('0x0'));var _=require(_0xb52b('0x1'));var moment=require(_0xb52b('0x2'));var util=require(_0xb52b('0x3'));var path=require(_0xb52b('0x4'));var Redis=require(_0xb52b('0x5'));var config=require(_0xb52b('0x6'));var logger=require(_0xb52b('0x7'))('ami');var ami=require(_0xb52b('0x8'));var Channel=require(_0xb52b('0x9'));var RpcSetting=require(_0xb52b('0xa'));var statusDesc=[_0xb52b('0xb'),_0xb52b('0xc'),_0xb52b('0xd'),'busy',_0xb52b('0xe'),_0xb52b('0xf'),'ringing',_0xb52b('0x10'),_0xb52b('0x11')];var applications=[_0xb52b('0x12'),_0xb52b('0x13'),_0xb52b('0x14'),_0xb52b('0x15'),'playback','voicemail'];var dispositions=[_0xb52b('0x16'),_0xb52b('0x17'),_0xb52b('0x17'),'NO\x20ANSWER','NO\x20ANSWER',_0xb52b('0x16'),_0xb52b('0x18'),_0xb52b('0x19'),_0xb52b('0x17'),_0xb52b('0x17'),_0xb52b('0x17')];var actions={};config[_0xb52b('0x1a')]=_[_0xb52b('0x1b')](config[_0xb52b('0x1a')],{'host':_0xb52b('0x1c'),'port':0x18eb});var io=require(_0xb52b('0x1d'))(new Redis(config[_0xb52b('0x1a')]));function VoiceCallReport(_0x4224d6){this[_0xb52b('0x1e')]=_0x4224d6['channels'];this[_0xb52b('0x1f')]=_0x4224d6[_0xb52b('0x1f')];this[_0xb52b('0x20')]={};ami['on'](_0xb52b('0x21'),this[_0xb52b('0x22')][_0xb52b('0x23')](this));ami['on'](_0xb52b('0x24'),this[_0xb52b('0x22')]['bind'](this));ami['on'](_0xb52b('0x25'),this['syncNewChannel']['bind'](this));ami['on'](_0xb52b('0x26'),this['syncNewState'][_0xb52b('0x23')](this));ami['on'](_0xb52b('0x27'),this[_0xb52b('0x28')][_0xb52b('0x23')](this));ami['on'](_0xb52b('0x29'),this[_0xb52b('0x2a')][_0xb52b('0x23')](this));ami['on'](_0xb52b('0x2b'),this[_0xb52b('0x2c')]['bind'](this));ami['on']('attendedtransfer',this[_0xb52b('0x2d')][_0xb52b('0x23')](this));ami['on'](_0xb52b('0x2e'),this[_0xb52b('0x2f')][_0xb52b('0x23')](this));ami['on'](_0xb52b('0x30'),this[_0xb52b('0x31')][_0xb52b('0x23')](this));ami['on'](_0xb52b('0x32'),this[_0xb52b('0x33')][_0xb52b('0x23')](this));try{logger[_0xb52b('0x34')](_0xb52b('0x35'));ami[_0xb52b('0x36')]();}catch(_0x70f582){logger[_0xb52b('0x37')]('[voiceCallReport][coreshowchannels]',util[_0xb52b('0x38')](_0x70f582,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xb52b('0x39')][_0xb52b('0x3a')]=function(_0xfe5be7){return _0xfe5be7!==null&&!_[_0xb52b('0x3b')](_0xfe5be7);};VoiceCallReport[_0xb52b('0x39')][_0xb52b('0x3c')]=function(_0x2afa5f,_0x235662,_0x44b57c){io['to'](_0x2afa5f)[_0xb52b('0x3c')](_0x235662,_0x44b57c);};VoiceCallReport[_0xb52b('0x39')]['syncNewCallerId']=function(_0xcb6a58){try{if(this[_0xb52b('0x3a')](_0xcb6a58)){logger[_0xb52b('0x34')](_0xb52b('0x3d'),_0xcb6a58[_0xb52b('0x3e')],_0xcb6a58[_0xb52b('0x3f')],_0xcb6a58[_0xb52b('0x40')]);logger[_0xb52b('0x41')](_0xb52b('0x42'),_0xcb6a58[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0xcb6a58,{'showHidden':![],'depth':null}));if(_0xcb6a58[_0xb52b('0x3e')]===_0xcb6a58[_0xb52b('0x43')]){if(!_['isUndefined'](this[_0xb52b('0x1e')][_0xcb6a58[_0xb52b('0x3e')]])){_[_0xb52b('0x44')](this['channels'][_0xcb6a58['uniqueid']],_[_0xb52b('0x45')](_0xcb6a58,_[_0xb52b('0x46')](this[_0xb52b('0x1e')][_0xcb6a58[_0xb52b('0x3e')]])));}}if(_0xcb6a58[_0xb52b('0x47')]===_0xb52b('0x48')){if(this[_0xb52b('0x1f')][_0xcb6a58['channel']['split']('-')[0x0]]){if(_0xcb6a58[_0xb52b('0x49')]=='xcally-motion-preview'){this[_0xb52b('0x1f')][_0xcb6a58['channel'][_0xb52b('0x4a')]('-')[0x0]][_0xb52b('0x4b')]=_0xcb6a58['connectedlinenum'];this[_0xb52b('0x3c')](util['format'](_0xb52b('0x4c'),this['agents'][_0xcb6a58['channel'][_0xb52b('0x4a')]('-')[0x0]][_0xb52b('0x4d')]),_0xb52b('0x4e'),{'destaccountcode':this[_0xb52b('0x1f')][_0xcb6a58[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0xcb6a58[_0xb52b('0x50')]});}}}}}catch(_0x5d1b5c){logger['error'](_0xb52b('0x51'),_0xcb6a58[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0x5d1b5c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewChannel']=function(_0x4ec32c){try{if(this[_0xb52b('0x3a')](_0x4ec32c)){logger[_0xb52b('0x41')](_0xb52b('0x52'),_0x4ec32c[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0x4ec32c,{'showHidden':![],'depth':null}));if(_0x4ec32c[_0xb52b('0x3e')]===_0x4ec32c[_0xb52b('0x43')]&&_0x4ec32c[_0xb52b('0x4f')]!=_0xb52b('0x53')){if(_[_0xb52b('0x3b')](this[_0xb52b('0x1e')][_0x4ec32c['uniqueid']])){logger[_0xb52b('0x34')]('[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s',_0x4ec32c[_0xb52b('0x3e')],_0x4ec32c['context'],_0x4ec32c['exten']);this['channels'][_0x4ec32c['uniqueid']]=new Channel();this[_0xb52b('0x1e')][_0x4ec32c['uniqueid']][_0xb52b('0x54')]=moment()[_0xb52b('0x55')](_0xb52b('0x56'));this[_0xb52b('0x1e')][_0x4ec32c[_0xb52b('0x3e')]][_0xb52b('0x57')]=dispositions[_[_0xb52b('0x58')](_0x4ec32c[_0xb52b('0x59')])];_[_0xb52b('0x44')](this[_0xb52b('0x1e')][_0x4ec32c[_0xb52b('0x3e')]],_[_0xb52b('0x45')](_0x4ec32c,_['keys'](this['channels'][_0x4ec32c[_0xb52b('0x3e')]])));if(_0x4ec32c['context']==='from-sip'){if(this[_0xb52b('0x1f')][_0x4ec32c[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]]){if(_[_0xb52b('0x3b')](this[_0xb52b('0x1f')][_0x4ec32c['channel'][_0xb52b('0x4a')]('-')[0x0]]['destconnectedlinenum'])){this[_0xb52b('0x1f')][_0x4ec32c[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]]['destconnectedlinenum']=_0x4ec32c[_0xb52b('0x49')];logger[_0xb52b('0x41')](_0xb52b('0x5a'),_0x4ec32c[_0xb52b('0x3e')],util[_0xb52b('0x38')]({'destaccountcode':this[_0xb52b('0x1f')][_0x4ec32c['channel'][_0xb52b('0x4a')]('-')[0x0]][_0xb52b('0x5b')],'destconnectedlinenum':_0x4ec32c[_0xb52b('0x49')]},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xb52b('0x4c'),this[_0xb52b('0x1f')][_0x4ec32c[_0xb52b('0x4f')]['split']('-')[0x0]][_0xb52b('0x4d')]),_0xb52b('0x4e'),{'destaccountcode':this['agents'][_0x4ec32c[_0xb52b('0x4f')]['split']('-')[0x0]][_0xb52b('0x5b')],'destconnectedlinenum':_0x4ec32c[_0xb52b('0x49')]});}}}}}}}catch(_0x1ad75d){logger[_0xb52b('0x37')](_0xb52b('0x5c'),_0x4ec32c[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0x1ad75d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb52b('0x39')][_0xb52b('0x22')]=function(_0x2bb311){try{if(this[_0xb52b('0x3a')](_0x2bb311)){logger[_0xb52b('0x41')](_0xb52b('0x5d'),_0x2bb311[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0x2bb311,{'showHidden':![],'depth':null}));if(_0x2bb311[_0xb52b('0x3e')]===_0x2bb311[_0xb52b('0x43')]&&_0x2bb311[_0xb52b('0x49')]!='h'&&_0x2bb311['channel']!=_0xb52b('0x53')){_0x2bb311['application']=_0x2bb311['application'][_0xb52b('0x5e')]();_0x2bb311[_0xb52b('0x5f')]=_0x2bb311[_0xb52b('0x60')]&&_0x2bb311[_0xb52b('0x60')]['startsWith'](_0xb52b('0x61'))?_0x2bb311[_0xb52b('0x60')]:(_0x2bb311[_0xb52b('0x60')]||_0x2bb311[_0xb52b('0x5f')])[_0xb52b('0x5e')]();logger[_0xb52b('0x34')](_0xb52b('0x62'),_0x2bb311[_0xb52b('0x3e')],_0x2bb311[_0xb52b('0x63')],_0x2bb311[_0xb52b('0x5f')]);if(_[_0xb52b('0x3b')](this[_0xb52b('0x1e')][_0x2bb311[_0xb52b('0x3e')]])){this[_0xb52b('0x1e')][_0x2bb311[_0xb52b('0x3e')]]=new Channel();this[_0xb52b('0x1e')][_0x2bb311['uniqueid']][_0xb52b('0x54')]=_0x2bb311[_0xb52b('0x64')]?moment()['subtract'](moment[_0xb52b('0x64')](_0x2bb311[_0xb52b('0x64')])[_0xb52b('0x65')](),_0xb52b('0x65'))[_0xb52b('0x55')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0xb52b('0x55')](_0xb52b('0x56'));this[_0xb52b('0x1e')][_0x2bb311[_0xb52b('0x3e')]]['disposition']=_0xb52b('0x16');}_['merge'](this['channels'][_0x2bb311[_0xb52b('0x3e')]],_[_0xb52b('0x45')](_0x2bb311,_[_0xb52b('0x46')](this[_0xb52b('0x1e')][_0x2bb311[_0xb52b('0x3e')]])));if(_['includes'](applications,_0x2bb311['application'])){this[_0xb52b('0x1e')][_0x2bb311['uniqueid']][_0xb52b('0x66')]=_0x2bb311[_0xb52b('0x63')];this[_0xb52b('0x1e')][_0x2bb311[_0xb52b('0x3e')]][_0xb52b('0x67')]=_0x2bb311['applicationdata'];if(_0x2bb311[_0xb52b('0x63')]==='set'&&_[_0xb52b('0x68')](_0x2bb311['applicationdata']['toLowerCase'](),'cdr(')){var _0x2927e0=_0x2bb311[_0xb52b('0x5f')][_0xb52b('0x4a')]('=');var _0x4fe524=_0x2927e0[0x0]['toLowerCase']()['match'](/cdr\((.*)\)/);if(_0x4fe524){this[_0xb52b('0x1e')][_0x2bb311[_0xb52b('0x3e')]][_0x4fe524[0x1]]=_0x2927e0[0x1];}}else if(_0x2bb311[_0xb52b('0x63')]===_0xb52b('0x13')){this[_0xb52b('0x1e')][_0x2bb311['uniqueid']][_0xb52b('0x13')]=_0x2bb311['applicationdata'][_0xb52b('0x4a')](',')[0x0];}}}}}catch(_0x5ba0e6){logger[_0xb52b('0x37')](_0xb52b('0x69'),_0x2bb311[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0x5ba0e6,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xb52b('0x6a')]=function(_0x1cc933){try{if(this[_0xb52b('0x3a')](_0x1cc933)){logger['info']('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x1cc933[_0xb52b('0x3e')],_0x1cc933['linkedid'],_0x1cc933[_0xb52b('0x3f')],_0x1cc933[_0xb52b('0x40')]);logger[_0xb52b('0x41')](_0xb52b('0x6b'),_0x1cc933[_0xb52b('0x3e')],util['inspect'](_0x1cc933,{'showHidden':![],'depth':null}));if(_0x1cc933['uniqueid']!==_0x1cc933['linkedid']){if(this['channels'][_0x1cc933[_0xb52b('0x43')]]){if(_0x1cc933['channelstate']==='6'){if(!this[_0xb52b('0x1e')][_0x1cc933['linkedid']]['answered']){var _0x34e6a4=moment();this[_0xb52b('0x1e')][_0x1cc933['linkedid']]['answered']=!![];this['channels'][_0x1cc933[_0xb52b('0x43')]][_0xb52b('0x6c')]=_0x34e6a4[_0xb52b('0x55')](_0xb52b('0x56'));if(this[_0xb52b('0x1e')][_0x1cc933[_0xb52b('0x43')]][_0xb52b('0x54')]){this[_0xb52b('0x1e')][_0x1cc933[_0xb52b('0x43')]]['holdtime']=_0x34e6a4[_0xb52b('0x6d')](this[_0xb52b('0x1e')][_0x1cc933[_0xb52b('0x43')]][_0xb52b('0x54')],'seconds');}}this[_0xb52b('0x1e')][_0x1cc933[_0xb52b('0x43')]][_0xb52b('0x43')]=_0x1cc933[_0xb52b('0x3e')];if(_0x1cc933[_0xb52b('0x40')]!==_0xb52b('0x6e')){this[_0xb52b('0x1e')][_0x1cc933[_0xb52b('0x43')]][_0xb52b('0x50')]=_0x1cc933[_0xb52b('0x40')];}this['channels'][_0x1cc933[_0xb52b('0x43')]]['connectedlinename']=_0x1cc933[_0xb52b('0x3f')];this[_0xb52b('0x1e')][_0x1cc933[_0xb52b('0x43')]]['destinationchannel']=_0x1cc933['channel'];this[_0xb52b('0x1e')][_0x1cc933['linkedid']][_0xb52b('0x57')]=dispositions[_[_0xb52b('0x58')](_0x1cc933[_0xb52b('0x59')])];if(this[_0xb52b('0x1f')][_0x1cc933['channel']['split']('-')[0x0]]){this['channels'][_0x1cc933[_0xb52b('0x43')]][_0xb52b('0x6f')]=this[_0xb52b('0x1f')][_0x1cc933['channel'][_0xb52b('0x4a')]('-')[0x0]]['id'];this['channels'][_0x1cc933[_0xb52b('0x43')]][_0xb52b('0x70')]=this[_0xb52b('0x1f')][_0x1cc933[_0xb52b('0x4f')]['split']('-')[0x0]][_0xb52b('0x4d')];}}}}else{if(this[_0xb52b('0x1e')][_0x1cc933[_0xb52b('0x3e')]]){if(_0x1cc933[_0xb52b('0x59')]==='6'){if(this[_0xb52b('0x1f')][_0x1cc933['channel'][_0xb52b('0x4a')]('-')[0x0]]){this[_0xb52b('0x1e')][_0x1cc933[_0xb52b('0x3e')]][_0xb52b('0x6f')]=this[_0xb52b('0x1f')][_0x1cc933['channel']['split']('-')[0x0]]['id'];this[_0xb52b('0x1e')][_0x1cc933['uniqueid']][_0xb52b('0x70')]=this['agents'][_0x1cc933[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]][_0xb52b('0x4d')];}}}}if(_0x1cc933['channelstate']==='6'&&_0x1cc933[_0xb52b('0x47')]===_0xb52b('0x48')){if(this[_0xb52b('0x1f')][_0x1cc933[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]]){this['agents'][_0x1cc933[_0xb52b('0x4f')]['split']('-')[0x0]]['destconnectedlinenum']=_0x1cc933['exten'];var _0x1795e3;if(this[_0xb52b('0x1e')][_0x1cc933[_0xb52b('0x3e')]])_0x1795e3=this[_0xb52b('0x1e')][_0x1cc933[_0xb52b('0x3e')]][_0xb52b('0x71')];else if(this[_0xb52b('0x1e')][_0x1cc933[_0xb52b('0x43')]])_0x1795e3=this['channels'][_0x1cc933['linkedid']][_0xb52b('0x71')];logger[_0xb52b('0x41')](_0xb52b('0x72'),_0x1cc933['uniqueid'],util['inspect']({'destaccountcode':this[_0xb52b('0x1f')][_0x1cc933[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]][_0xb52b('0x5b')],'destconnectedlinenum':_0x1cc933[_0xb52b('0x49')],'routealias':_0x1795e3},{'showHidden':![],'depth':null}));this[_0xb52b('0x3c')](util[_0xb52b('0x55')](_0xb52b('0x4c'),this[_0xb52b('0x1f')][_0x1cc933[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]][_0xb52b('0x4d')]),'user:agentconnect',{'destaccountcode':this['agents'][_0x1cc933[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]][_0xb52b('0x5b')],'destconnectedlinenum':_0x1cc933[_0xb52b('0x49')],'routealias':_0x1795e3});}}}}catch(_0x5e025d){logger['error'](_0xb52b('0x73'),_0x1cc933[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0x5e025d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb52b('0x39')]['syncMixMonitorFilename']=function(_0xf6d727,_0x51e693){try{if(this[_0xb52b('0x1e')][_0xf6d727]){logger[_0xb52b('0x34')](_0xb52b('0x74'),_0xf6d727,_0x51e693);this['channels'][_0xf6d727]['monitor']=!![];if(_[_0xb52b('0x75')](_0x51e693,_0xb52b('0x76'))){_0x51e693=_0x51e693['replace'](_0xb52b('0x76'),'.WAV');}this[_0xb52b('0x1e')][_0xf6d727][_0xb52b('0x77')]=_0x51e693;var _0x228566=_[_0xb52b('0x78')](this[_0xb52b('0x1e')][_0xf6d727][_0xb52b('0x79')],{'filename':_0x51e693});if(_[_0xb52b('0x7a')](_0x228566)){this[_0xb52b('0x1e')][_0xf6d727][_0xb52b('0x79')][_0xb52b('0x7b')]({'filename':_0x51e693,'createdAt':moment()[_0xb52b('0x55')](_0xb52b('0x56')),'mixmonitorid':'','status':_0xb52b('0x7c')});}}}catch(_0x5caba8){logger[_0xb52b('0x37')](_0xb52b('0x7d'),_0xf6d727,util[_0xb52b('0x38')](_0x5caba8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb52b('0x39')][_0xb52b('0x28')]=function(_0x1e9f98){try{if(this['isNotNull'](_0x1e9f98)){logger[_0xb52b('0x41')](_0xb52b('0x7e'),_0x1e9f98['uniqueid'],util['inspect'](_0x1e9f98,{'showHidden':![],'depth':null}));if(this[_0xb52b('0x1e')][_0x1e9f98[_0xb52b('0x3e')]]&&_0x1e9f98['channel']!=_0xb52b('0x53')){if(this['isNotNull'](_0x1e9f98[_0xb52b('0x7f')])){if(this['isNotNull'](_0x1e9f98[_0xb52b('0x7f')]['mixmonitor_filename'])){logger['info'](_0xb52b('0x80'),_0x1e9f98[_0xb52b('0x3e')],_0x1e9f98[_0xb52b('0x81')]);this[_0xb52b('0x82')](_0x1e9f98[_0xb52b('0x3e')],_0x1e9f98[_0xb52b('0x81')]);}else if(this['isNotNull'](_0x1e9f98[_0xb52b('0x7f')][_0xb52b('0x83')])){logger['info'](_0xb52b('0x84'),_0x1e9f98[_0xb52b('0x3e')],_0x1e9f98[_0xb52b('0x81')]);this[_0xb52b('0x1e')][_0x1e9f98['uniqueid']]['calleridnum']=_0x1e9f98[_0xb52b('0x81')];}else if(this[_0xb52b('0x3a')](_0x1e9f98[_0xb52b('0x7f')][_0xb52b('0x85')])){logger['info'](_0xb52b('0x86'),_0x1e9f98[_0xb52b('0x3e')],_0x1e9f98[_0xb52b('0x81')]);this[_0xb52b('0x1e')][_0x1e9f98[_0xb52b('0x3e')]][_0xb52b('0x87')]=_0x1e9f98[_0xb52b('0x81')];}else if(this[_0xb52b('0x3a')](_0x1e9f98[_0xb52b('0x7f')]['xmd-cdrtype'])){logger['info'](_0xb52b('0x88'),_0x1e9f98[_0xb52b('0x3e')],_0x1e9f98['value']);this[_0xb52b('0x1e')][_0x1e9f98['uniqueid']][_0xb52b('0x89')]=_0x1e9f98[_0xb52b('0x81')];}else if(this[_0xb52b('0x3a')](_0x1e9f98[_0xb52b('0x7f')][_0xb52b('0x8a')])){logger['info'](_0xb52b('0x8b'),_0x1e9f98['uniqueid'],_0x1e9f98['value'][_0xb52b('0x4a')](',')[0x0]);this['channels'][_0x1e9f98[_0xb52b('0x3e')]][_0xb52b('0x13')]=_0x1e9f98[_0xb52b('0x81')][_0xb52b('0x4a')](',')[0x0];}else if(this[_0xb52b('0x3a')](_0x1e9f98[_0xb52b('0x7f')][_0xb52b('0x8c')])){logger[_0xb52b('0x34')]('[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x1e9f98[_0xb52b('0x3e')],_0x1e9f98[_0xb52b('0x81')]);this[_0xb52b('0x1e')][_0x1e9f98[_0xb52b('0x3e')]][_0xb52b('0x8d')]=_0x1e9f98[_0xb52b('0x81')];}else if(this['isNotNull'](_0x1e9f98[_0xb52b('0x7f')][_0xb52b('0x8e')])){logger[_0xb52b('0x34')](_0xb52b('0x8f'),_0x1e9f98['uniqueid'],_0x1e9f98['value']);this[_0xb52b('0x1e')][_0x1e9f98[_0xb52b('0x3e')]][_0xb52b('0x90')]=_0x1e9f98[_0xb52b('0x81')];}else if(this[_0xb52b('0x3a')](_0x1e9f98[_0xb52b('0x7f')][_0xb52b('0x91')])){logger[_0xb52b('0x34')](_0xb52b('0x92'),_0x1e9f98[_0xb52b('0x3e')],_0x1e9f98['value']);this[_0xb52b('0x1e')][_0x1e9f98['uniqueid']][_0xb52b('0x93')]=_0x1e9f98[_0xb52b('0x81')];}else if(this[_0xb52b('0x3a')](_0x1e9f98[_0xb52b('0x7f')][_0xb52b('0x94')])){logger['info'](_0xb52b('0x95'),_0x1e9f98[_0xb52b('0x3e')],_0x1e9f98['value']);this[_0xb52b('0x1e')][_0x1e9f98[_0xb52b('0x3e')]][_0xb52b('0x13')]=_0x1e9f98[_0xb52b('0x81')];}else if(this[_0xb52b('0x3a')](_0x1e9f98['variable'][_0xb52b('0x96')])){logger[_0xb52b('0x34')](_0xb52b('0x97'),_0x1e9f98['uniqueid'],_0x1e9f98[_0xb52b('0x81')]);this['channels'][_0x1e9f98['uniqueid']][_0xb52b('0x98')]=_0x1e9f98['value'];}}}else if(this[_0xb52b('0x3a')](_0x1e9f98[_0xb52b('0x7f')][_0xb52b('0x99')])){if(_0x1e9f98[_0xb52b('0x81')]){var _0x2b2e46=path['parse'](_0x1e9f98[_0xb52b('0x81')])[_0xb52b('0x4d')];logger[_0xb52b('0x34')](_0xb52b('0x80'),_0x2b2e46,_0x1e9f98[_0xb52b('0x81')]);this[_0xb52b('0x82')](_0x2b2e46,_0x1e9f98['value']);}}else if(this[_0xb52b('0x1e')][_0x1e9f98['linkedid']]){if(this[_0xb52b('0x3a')](_0x1e9f98[_0xb52b('0x7f')])){if(this[_0xb52b('0x3a')](_0x1e9f98[_0xb52b('0x7f')]['sipcallid'])){logger['info']('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x1e9f98['linkedid'],_0x1e9f98[_0xb52b('0x81')]);this[_0xb52b('0x1e')][_0x1e9f98[_0xb52b('0x43')]][_0xb52b('0x9a')]=_0x1e9f98[_0xb52b('0x81')];}}}}}catch(_0x56fef5){logger[_0xb52b('0x37')](_0xb52b('0x9b'),_0x1e9f98['uniqueid'],util[_0xb52b('0x38')](_0x56fef5,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xb52b('0x2a')]=function(_0x41c197){try{if(this[_0xb52b('0x3a')](_0x41c197)){logger[_0xb52b('0x41')](_0xb52b('0x9c'),_0x41c197[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0x41c197,{'showHidden':![],'depth':null}));if(this[_0xb52b('0x1e')][_0x41c197[_0xb52b('0x3e')]]){logger[_0xb52b('0x34')](_0xb52b('0x9d'),_0x41c197['uniqueid'],_0x41c197[_0xb52b('0x9e')]);var _0x4a13a4=moment();this['channels'][_0x41c197[_0xb52b('0x3e')]][_0xb52b('0x9f')]=_0x4a13a4[_0xb52b('0x55')](_0xb52b('0x56'));this['channels'][_0x41c197['uniqueid']][_0xb52b('0x64')]=_0x4a13a4[_0xb52b('0x6d')](this[_0xb52b('0x1e')][_0x41c197[_0xb52b('0x3e')]][_0xb52b('0x54')],_0xb52b('0x65'));if(this['channels'][_0x41c197[_0xb52b('0x3e')]]['answered']){this['channels'][_0x41c197['uniqueid']][_0xb52b('0xa0')]=_0x4a13a4[_0xb52b('0x6d')](this[_0xb52b('0x1e')][_0x41c197[_0xb52b('0x3e')]][_0xb52b('0x6c')],_0xb52b('0x65'));this['channels'][_0x41c197[_0xb52b('0x3e')]][_0xb52b('0xa1')]=this[_0xb52b('0x1e')][_0x41c197['uniqueid']][_0xb52b('0x64')]-this[_0xb52b('0x1e')][_0x41c197['uniqueid']][_0xb52b('0xa0')];}if(_0x41c197[_0xb52b('0x47')]===_0xb52b('0x48')){if(this[_0xb52b('0x1f')][_0x41c197[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]]){this[_0xb52b('0x1f')][_0x41c197[_0xb52b('0x4f')]['split']('-')[0x0]]=_['omit'](this[_0xb52b('0x1f')][_0x41c197[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]],[_0xb52b('0x4b')]);logger[_0xb52b('0x41')](_0xb52b('0xa2'),_0x41c197[_0xb52b('0x3e')],util[_0xb52b('0x38')]({'id':this[_0xb52b('0x1f')][_0x41c197[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]]['id'],'destaccountcode':this[_0xb52b('0x1f')][_0x41c197[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]][_0xb52b('0x5b')]},{'showHidden':![],'depth':null}));this[_0xb52b('0x3c')](util['format'](_0xb52b('0x4c'),this['agents'][_0x41c197[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]][_0xb52b('0x4d')]),_0xb52b('0xa3'),{'id':this[_0xb52b('0x1f')][_0x41c197[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]]['id'],'destaccountcode':this[_0xb52b('0x1f')][_0x41c197[_0xb52b('0x4f')][_0xb52b('0x4a')]('-')[0x0]][_0xb52b('0x5b')]});}}var _0x4d6a83=this;Promise['resolve']()['then'](function(){var _0x503809=_0x4d6a83[_0xb52b('0x1e')][_0x41c197[_0xb52b('0x3e')]];if(typeof _0x503809[_0xb52b('0xa4')]===_0xb52b('0xa5'))return;if(_[_0xb52b('0xa6')](_0x503809[_0xb52b('0x79')]))return;return RpcSetting[_0xb52b('0xa7')]()[_0xb52b('0xa8')](function(_0x2af1ba){if(!_0x2af1ba[_0xb52b('0xa9')])return;return Promise[_0xb52b('0xaa')]()['then'](function(){return ami[_0xb52b('0xab')]({'action':_0xb52b('0xac'),'channel':_0x503809[_0xb52b('0x4f')]})[_0xb52b('0xad')](function(){});})[_0xb52b('0xa8')](function(){return ami[_0xb52b('0xab')]({'action':_0xb52b('0xac'),'channel':_0x503809['destinationchannel']})[_0xb52b('0xad')](function(){})[_0xb52b('0xae')](function(){var _0x274f3d=_0x4d6a83[_0xb52b('0x1f')][_0x503809[_0xb52b('0xaf')]['split']('-')[0x0]];if(!_0x274f3d)return;io[_0xb52b('0x3c')](_0xb52b('0xb0'),{'agentId':_0x274f3d['id'],'uniqueid':_0x503809[_0xb52b('0x3e')]});});});});})[_0xb52b('0xa8')](function(){if(_0x41c197[_0xb52b('0xb1')]===_0xb52b('0xb2')){_0x4d6a83[_0xb52b('0x20')][_0x41c197['uniqueid']]=_0x4d6a83['channels'][_0x41c197[_0xb52b('0x3e')]];}else{if(_0x4d6a83[_0xb52b('0x1e')][_0x41c197[_0xb52b('0x3e')]][_0xb52b('0x89')]==='outbound'&&_0x4d6a83[_0xb52b('0x20')][_0x41c197[_0xb52b('0x3e')]]){_0x4d6a83[_0xb52b('0x1e')][_0x41c197['uniqueid']][_0xb52b('0x3e')]=[_0x4d6a83[_0xb52b('0x1e')][_0x41c197['uniqueid']][_0xb52b('0x43')],_0x4d6a83[_0xb52b('0x1e')][_0x41c197[_0xb52b('0x3e')]][_0xb52b('0x43')]=_0x4d6a83[_0xb52b('0x1e')][_0x41c197[_0xb52b('0x3e')]][_0xb52b('0x3e')]][0x0];delete _0x4d6a83[_0xb52b('0x20')][_0x41c197[_0xb52b('0x3e')]];}}logger[_0xb52b('0x41')](_0xb52b('0xb3'),_0x41c197[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0x4d6a83['channels'][_0x41c197[_0xb52b('0x3e')]],{'showHidden':![],'depth':null}));ami[_0xb52b('0x3c')]('custom:voiceCallReport',_0x4d6a83['channels'][_0x41c197[_0xb52b('0x3e')]]);delete _0x4d6a83[_0xb52b('0x1e')][_0x41c197[_0xb52b('0x3e')]];});}}}catch(_0x384b27){logger['error']('[%s][voiceCallReport][hangup]',_0x41c197[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0x384b27,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb52b('0x39')][_0xb52b('0x2d')]=function(_0x4835bb){try{if(this[_0xb52b('0x3a')](_0x4835bb)){logger['info']('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x4835bb[_0xb52b('0x3e')],_0x4835bb[_0xb52b('0xb4')],_0x4835bb[_0xb52b('0xb5')]);logger['debug'](_0xb52b('0xb6'),_0x4835bb['uniqueid'],util[_0xb52b('0x38')](_0x4835bb,{'showHidden':![],'depth':null}));if(this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xb7')]]){this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xb7')]][_0xb52b('0xb8')]=_0x4835bb[_0xb52b('0xb4')];this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xb7')]][_0xb52b('0xb9')]=_0x4835bb[_0xb52b('0xb5')];if(this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xba')]]){var _0x16a07d=this['channels'][_0x4835bb[_0xb52b('0xba')]];this['channels'][_0x4835bb[_0xb52b('0xba')]]=this['channels'][_0x4835bb[_0xb52b('0xb7')]];this['channels'][_0x4835bb[_0xb52b('0xb7')]]=_0x16a07d;}}else if(this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xbb')]]){this[_0xb52b('0x1e')][_0x4835bb['transfertargetuniqueid']][_0xb52b('0xb8')]=_0x4835bb[_0xb52b('0xb4')];this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xbb')]][_0xb52b('0xb9')]=_0x4835bb[_0xb52b('0xb5')];if(this['channels'][_0x4835bb[_0xb52b('0xbc')]]){var _0x16a07d=this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xbc')]];this['channels'][_0x4835bb[_0xb52b('0xbc')]]=this['channels'][_0x4835bb['transfertargetuniqueid']];this[_0xb52b('0x1e')][_0x4835bb['transfertargetuniqueid']]=_0x16a07d;}}if((this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xbc')]]||this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xbd')]])&&this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xba')]]){var _0x779dbc=_[_0xb52b('0xbe')]([this['channels'][_0x4835bb[_0xb52b('0xbc')]],this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xbd')]],this['channels'][_0x4835bb[_0xb52b('0xba')]]],function(_0x70b734){return _0x70b734&&_0x70b734[_0xb52b('0x89')]===_0xb52b('0xbf')&&_0x70b734[_0xb52b('0xc0')];});if(_0x779dbc){if(this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xbc')]])this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xbc')]][_0xb52b('0xa4')]='ATTENDED';if(this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xbd')]])this['channels'][_0x4835bb[_0xb52b('0xbd')]]['transferType']='ATTENDED';this[_0xb52b('0x1e')][_0x4835bb[_0xb52b('0xba')]][_0xb52b('0xa4')]=_0xb52b('0xc1');}}}}catch(_0x43c174){logger[_0xb52b('0x37')](_0xb52b('0xc2'),_0x4835bb['uniqueid'],util[_0xb52b('0x38')](_0x43c174,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb52b('0x39')]['syncBlindTransfer']=function(_0x17d9ba){try{if(this[_0xb52b('0x3a')](_0x17d9ba)){logger['info'](_0xb52b('0xc3'),_0x17d9ba[_0xb52b('0x3e')],_0x17d9ba[_0xb52b('0xc4')],_0x17d9ba[_0xb52b('0xc5')]);logger[_0xb52b('0x41')](_0xb52b('0xc6'),_0x17d9ba[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0x17d9ba,{'showHidden':![],'depth':null}));if(this['channels'][_0x17d9ba['transfereeuniqueid']]){this['channels'][_0x17d9ba[_0xb52b('0xb7')]][_0xb52b('0xb8')]=_0x17d9ba[_0xb52b('0xc4')];this['channels'][_0x17d9ba[_0xb52b('0xb7')]][_0xb52b('0xb9')]=_0x17d9ba[_0xb52b('0xc5')];this[_0xb52b('0x1e')][_0x17d9ba[_0xb52b('0xb7')]]['transferType']=_0xb52b('0xc7');this[_0xb52b('0x2a')]({'event':_0xb52b('0xb2'),'uniqueid':_0x17d9ba[_0xb52b('0xb7')],'context':_0x17d9ba['context'],'channel':_0x17d9ba['transfererchannel']});}else{this[_0xb52b('0x1e')][_0x17d9ba[_0xb52b('0xc8')]][_0xb52b('0xa4')]='BLIND';}}}catch(_0x2d2634){logger[_0xb52b('0x37')](_0xb52b('0xc9'),_0x17d9ba[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0x2d2634,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb52b('0x39')]['syncMusicOnHoldStart']=function(_0x4e676c){try{if(this[_0xb52b('0x3a')](_0x4e676c)){logger['debug'](_0xb52b('0xca'),_0x4e676c[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0x4e676c,{'showHidden':![],'depth':null}));if(this[_0xb52b('0x1e')][_0x4e676c[_0xb52b('0x3e')]]){if(!_[_0xb52b('0x7a')](this['channels'][_0x4e676c[_0xb52b('0x3e')]][_0xb52b('0x6c')])){this['channels'][_0x4e676c['uniqueid']][_0xb52b('0xcb')]=moment()[_0xb52b('0x55')](_0xb52b('0x56'));logger[_0xb52b('0x34')](_0xb52b('0xcc'),_0x4e676c[_0xb52b('0x3e')],this[_0xb52b('0x1e')][_0x4e676c[_0xb52b('0x3e')]][_0xb52b('0xcb')]);}}}}catch(_0xddc2e6){logger[_0xb52b('0x37')](_0xb52b('0xcd'),_0x4e676c[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0xddc2e6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb52b('0x39')][_0xb52b('0x33')]=function(_0x2a68c8){try{if(this[_0xb52b('0x3a')](_0x2a68c8)){logger[_0xb52b('0x41')](_0xb52b('0xce'),_0x2a68c8['uniqueid'],util[_0xb52b('0x38')](_0x2a68c8,{'showHidden':![],'depth':null}));if(this[_0xb52b('0x1e')][_0x2a68c8[_0xb52b('0x3e')]]){if(!_[_0xb52b('0x7a')](this[_0xb52b('0x1e')][_0x2a68c8[_0xb52b('0x3e')]][_0xb52b('0xcb')])){this['channels'][_0x2a68c8[_0xb52b('0x3e')]][_0xb52b('0xcf')]+=moment()[_0xb52b('0xd0')](0x0)[_0xb52b('0x6d')](this[_0xb52b('0x1e')][_0x2a68c8[_0xb52b('0x3e')]][_0xb52b('0xcb')],'seconds');logger[_0xb52b('0x34')]('[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s',_0x2a68c8[_0xb52b('0x3e')],this[_0xb52b('0x1e')][_0x2a68c8[_0xb52b('0x3e')]][_0xb52b('0xcf')]);delete this[_0xb52b('0x1e')][_0x2a68c8[_0xb52b('0x3e')]][_0xb52b('0xcb')];}}}}catch(_0x2f5df4){logger[_0xb52b('0x37')]('[%s][voiceCallReport][musiconholdstop]',_0x2a68c8[_0xb52b('0x3e')],util[_0xb52b('0x38')](_0x2f5df4,{'showHidden':![],'depth':null}));}};module[_0xb52b('0xd1')]=VoiceCallReport;
\ No newline at end of file
+var _0x4169=['endtime','holdtime','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','transferType','isEmpty','monitors','getSettings','Action','then','StopMixMonitor','catch','finally','event','BlindTransfer','type','outbound','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','transfercalleridnum','origtransfereruniqueid','origtransfererlinkedid','some','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','[%s][voiceCallReport][blindtransfer]\x20event:','extension','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohstarttime','mohtime','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','bluebird','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../rpc/setting','unknown','inuse','busy','invalid','ringing','ringinuse','onhold','agi','dial','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newexten','newchannel','newstate','syncNewState','varset','syncVarSet','hangup','syncHangup','newcallerid','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','syncNewCallerId','info','uniqueid','calleridname','debug','linkedid','merge','pick','context','from-sip','channel','split','destconnectedlinenum','connectedlinenum','format','user:%s','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','syncNewChannel','[%s][voiceCallReport][newchannel]\x20event:','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','exten','starttime','YYYY-MM-DD\x20HH:mm:ss','channelstate','keys','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','name','[%s][voiceCallReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','CDR(routeAlias)','duration','subtract','seconds','disposition','includes','lastdata','set','cdr(','match','queue','[%s][voiceCallReport][newexten]','answered','answertime','diff','calleridnum','xcally-motion-preview','connectedlinename','destinationchannel','toNumber','UserId','membername','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','isNil','push','rec','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','xmd-callerid','callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','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:xmd-callerid-preview\x20value:%s','calleridpreview','xmcs-queue','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s','sipcalluniqueid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','cause-txt'];(function(_0x352809,_0x59100a){var _0x351383=function(_0x63b89b){while(--_0x63b89b){_0x352809['push'](_0x352809['shift']());}};_0x351383(++_0x59100a);}(_0x4169,0x102));var _0x9416=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4169[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0x9416('0x0'));var _=require('lodash');var moment=require(_0x9416('0x1'));var util=require(_0x9416('0x2'));var path=require(_0x9416('0x3'));var Redis=require(_0x9416('0x4'));var config=require(_0x9416('0x5'));var logger=require(_0x9416('0x6'))(_0x9416('0x7'));var ami=require(_0x9416('0x8'));var Channel=require('../model/channel');var RpcSetting=require(_0x9416('0x9'));var statusDesc=[_0x9416('0xa'),'not_inuse',_0x9416('0xb'),_0x9416('0xc'),_0x9416('0xd'),'unavailable',_0x9416('0xe'),_0x9416('0xf'),_0x9416('0x10')];var applications=['set','queue',_0x9416('0x11'),_0x9416('0x12'),'playback',_0x9416('0x13')];var dispositions=[_0x9416('0x14'),_0x9416('0x15'),_0x9416('0x15'),_0x9416('0x14'),_0x9416('0x14'),_0x9416('0x14'),_0x9416('0x16'),_0x9416('0x17'),_0x9416('0x15'),_0x9416('0x15'),_0x9416('0x15')];var actions={};config[_0x9416('0x18')]=_[_0x9416('0x19')](config['redis'],{'host':_0x9416('0x1a'),'port':0x18eb});var io=require(_0x9416('0x1b'))(new Redis(config[_0x9416('0x18')]));function VoiceCallReport(_0x3164e3){this[_0x9416('0x1c')]=_0x3164e3[_0x9416('0x1c')];this[_0x9416('0x1d')]=_0x3164e3['agents'];this[_0x9416('0x1e')]={};ami['on'](_0x9416('0x1f'),this[_0x9416('0x20')][_0x9416('0x21')](this));ami['on'](_0x9416('0x22'),this[_0x9416('0x20')]['bind'](this));ami['on'](_0x9416('0x23'),this['syncNewChannel'][_0x9416('0x21')](this));ami['on'](_0x9416('0x24'),this[_0x9416('0x25')][_0x9416('0x21')](this));ami['on'](_0x9416('0x26'),this[_0x9416('0x27')][_0x9416('0x21')](this));ami['on'](_0x9416('0x28'),this[_0x9416('0x29')]['bind'](this));ami['on'](_0x9416('0x2a'),this['syncNewCallerId']['bind'](this));ami['on'](_0x9416('0x2b'),this[_0x9416('0x2c')][_0x9416('0x21')](this));ami['on']('blindtransfer',this[_0x9416('0x2d')][_0x9416('0x21')](this));ami['on'](_0x9416('0x2e'),this[_0x9416('0x2f')][_0x9416('0x21')](this));ami['on'](_0x9416('0x30'),this[_0x9416('0x31')][_0x9416('0x21')](this));try{logger['info'](_0x9416('0x32'));ami[_0x9416('0x33')]();}catch(_0x3bd8f9){logger[_0x9416('0x34')](_0x9416('0x35'),util[_0x9416('0x36')](_0x3bd8f9,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0x9416('0x37')][_0x9416('0x38')]=function(_0x83e2a5){return _0x83e2a5!==null&&!_[_0x9416('0x39')](_0x83e2a5);};VoiceCallReport['prototype']['emit']=function(_0x2ff3a7,_0x37f128,_0x22cd38){io['to'](_0x2ff3a7)[_0x9416('0x3a')](_0x37f128,_0x22cd38);};VoiceCallReport['prototype'][_0x9416('0x3b')]=function(_0x3a7c07){try{if(this[_0x9416('0x38')](_0x3a7c07)){logger[_0x9416('0x3c')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x3a7c07[_0x9416('0x3d')],_0x3a7c07[_0x9416('0x3e')],_0x3a7c07['calleridnum']);logger[_0x9416('0x3f')]('[%s][voiceCallReport][newcallerid]\x20event:',_0x3a7c07[_0x9416('0x3d')],util[_0x9416('0x36')](_0x3a7c07,{'showHidden':![],'depth':null}));if(_0x3a7c07['uniqueid']===_0x3a7c07[_0x9416('0x40')]){if(!_[_0x9416('0x39')](this[_0x9416('0x1c')][_0x3a7c07[_0x9416('0x3d')]])){_[_0x9416('0x41')](this[_0x9416('0x1c')][_0x3a7c07[_0x9416('0x3d')]],_[_0x9416('0x42')](_0x3a7c07,_['keys'](this['channels'][_0x3a7c07[_0x9416('0x3d')]])));}}if(_0x3a7c07[_0x9416('0x43')]===_0x9416('0x44')){if(this['agents'][_0x3a7c07[_0x9416('0x45')]['split']('-')[0x0]]){if(_0x3a7c07['exten']=='xcally-motion-preview'){this['agents'][_0x3a7c07[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]][_0x9416('0x47')]=_0x3a7c07[_0x9416('0x48')];this[_0x9416('0x3a')](util[_0x9416('0x49')](_0x9416('0x4a'),this['agents'][_0x3a7c07[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]]['name']),_0x9416('0x4b'),{'destaccountcode':this[_0x9416('0x1d')][_0x3a7c07[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]][_0x9416('0x4c')],'destconnectedlinenum':_0x3a7c07[_0x9416('0x48')]});}}}}}catch(_0x6a78f8){logger[_0x9416('0x34')](_0x9416('0x4d'),_0x3a7c07[_0x9416('0x3d')],util[_0x9416('0x36')](_0x6a78f8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9416('0x37')][_0x9416('0x4e')]=function(_0x368b11){try{if(this[_0x9416('0x38')](_0x368b11)){logger[_0x9416('0x3f')](_0x9416('0x4f'),_0x368b11[_0x9416('0x3d')],util[_0x9416('0x36')](_0x368b11,{'showHidden':![],'depth':null}));if(_0x368b11[_0x9416('0x3d')]===_0x368b11[_0x9416('0x40')]&&_0x368b11['channel']!=_0x9416('0x50')){if(_[_0x9416('0x39')](this[_0x9416('0x1c')][_0x368b11[_0x9416('0x3d')]])){logger[_0x9416('0x3c')](_0x9416('0x51'),_0x368b11[_0x9416('0x3d')],_0x368b11[_0x9416('0x43')],_0x368b11[_0x9416('0x52')]);this[_0x9416('0x1c')][_0x368b11[_0x9416('0x3d')]]=new Channel();this['channels'][_0x368b11[_0x9416('0x3d')]][_0x9416('0x53')]=moment()[_0x9416('0x49')](_0x9416('0x54'));this['channels'][_0x368b11[_0x9416('0x3d')]]['disposition']=dispositions[_['toNumber'](_0x368b11[_0x9416('0x55')])];_[_0x9416('0x41')](this[_0x9416('0x1c')][_0x368b11[_0x9416('0x3d')]],_[_0x9416('0x42')](_0x368b11,_[_0x9416('0x56')](this[_0x9416('0x1c')][_0x368b11[_0x9416('0x3d')]])));if(_0x368b11[_0x9416('0x43')]===_0x9416('0x44')){if(this[_0x9416('0x1d')][_0x368b11['channel'][_0x9416('0x46')]('-')[0x0]]){if(_[_0x9416('0x39')](this[_0x9416('0x1d')][_0x368b11[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]][_0x9416('0x47')])){this[_0x9416('0x1d')][_0x368b11[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]][_0x9416('0x47')]=_0x368b11[_0x9416('0x52')];logger[_0x9416('0x3f')](_0x9416('0x57'),_0x368b11[_0x9416('0x3d')],util[_0x9416('0x36')]({'destaccountcode':this[_0x9416('0x1d')][_0x368b11[_0x9416('0x45')]['split']('-')[0x0]][_0x9416('0x4c')],'destconnectedlinenum':_0x368b11[_0x9416('0x52')]},{'showHidden':![],'depth':null}));this[_0x9416('0x3a')](util[_0x9416('0x49')](_0x9416('0x4a'),this[_0x9416('0x1d')][_0x368b11[_0x9416('0x45')]['split']('-')[0x0]][_0x9416('0x58')]),_0x9416('0x4b'),{'destaccountcode':this[_0x9416('0x1d')][_0x368b11['channel']['split']('-')[0x0]][_0x9416('0x4c')],'destconnectedlinenum':_0x368b11[_0x9416('0x52')]});}}}}}}}catch(_0x194307){logger['error']('[%s][voiceCallReport][newchannel]',_0x368b11['uniqueid'],util[_0x9416('0x36')](_0x194307,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9416('0x37')][_0x9416('0x20')]=function(_0x3bf0b3){try{if(this[_0x9416('0x38')](_0x3bf0b3)){logger[_0x9416('0x3f')](_0x9416('0x59'),_0x3bf0b3[_0x9416('0x3d')],util[_0x9416('0x36')](_0x3bf0b3,{'showHidden':![],'depth':null}));if(_0x3bf0b3[_0x9416('0x3d')]===_0x3bf0b3[_0x9416('0x40')]&&_0x3bf0b3[_0x9416('0x52')]!='h'&&_0x3bf0b3[_0x9416('0x45')]!='OutgoingSpoolFailed'){_0x3bf0b3[_0x9416('0x5a')]=_0x3bf0b3[_0x9416('0x5a')][_0x9416('0x5b')]();_0x3bf0b3[_0x9416('0x5c')]=_0x3bf0b3[_0x9416('0x5d')]&&_0x3bf0b3[_0x9416('0x5d')][_0x9416('0x5e')](_0x9416('0x5f'))?_0x3bf0b3[_0x9416('0x5d')]:(_0x3bf0b3[_0x9416('0x5d')]||_0x3bf0b3[_0x9416('0x5c')])[_0x9416('0x5b')]();logger[_0x9416('0x3c')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x3bf0b3[_0x9416('0x3d')],_0x3bf0b3[_0x9416('0x5a')],_0x3bf0b3[_0x9416('0x5c')]);if(_[_0x9416('0x39')](this[_0x9416('0x1c')][_0x3bf0b3[_0x9416('0x3d')]])){this[_0x9416('0x1c')][_0x3bf0b3[_0x9416('0x3d')]]=new Channel();this['channels'][_0x3bf0b3[_0x9416('0x3d')]][_0x9416('0x53')]=_0x3bf0b3[_0x9416('0x60')]?moment()[_0x9416('0x61')](moment[_0x9416('0x60')](_0x3bf0b3[_0x9416('0x60')])[_0x9416('0x62')](),_0x9416('0x62'))[_0x9416('0x49')](_0x9416('0x54')):moment()[_0x9416('0x49')](_0x9416('0x54'));this[_0x9416('0x1c')][_0x3bf0b3[_0x9416('0x3d')]][_0x9416('0x63')]=_0x9416('0x14');}_[_0x9416('0x41')](this['channels'][_0x3bf0b3[_0x9416('0x3d')]],_[_0x9416('0x42')](_0x3bf0b3,_[_0x9416('0x56')](this[_0x9416('0x1c')][_0x3bf0b3[_0x9416('0x3d')]])));if(_[_0x9416('0x64')](applications,_0x3bf0b3[_0x9416('0x5a')])){this['channels'][_0x3bf0b3[_0x9416('0x3d')]]['lastapplication']=_0x3bf0b3[_0x9416('0x5a')];this[_0x9416('0x1c')][_0x3bf0b3[_0x9416('0x3d')]][_0x9416('0x65')]=_0x3bf0b3['applicationdata'];if(_0x3bf0b3[_0x9416('0x5a')]===_0x9416('0x66')&&_[_0x9416('0x5e')](_0x3bf0b3[_0x9416('0x5c')][_0x9416('0x5b')](),_0x9416('0x67'))){var _0x2bf858=_0x3bf0b3[_0x9416('0x5c')]['split']('=');var _0x4130f1=_0x2bf858[0x0][_0x9416('0x5b')]()[_0x9416('0x68')](/cdr\((.*)\)/);if(_0x4130f1){this[_0x9416('0x1c')][_0x3bf0b3[_0x9416('0x3d')]][_0x4130f1[0x1]]=_0x2bf858[0x1];}}else if(_0x3bf0b3[_0x9416('0x5a')]===_0x9416('0x69')){this['channels'][_0x3bf0b3[_0x9416('0x3d')]][_0x9416('0x69')]=_0x3bf0b3[_0x9416('0x5c')]['split'](',')[0x0];}}}}}catch(_0x315db4){logger['error'](_0x9416('0x6a'),_0x3bf0b3[_0x9416('0x3d')],util[_0x9416('0x36')](_0x315db4,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9416('0x37')][_0x9416('0x25')]=function(_0x25a97d){try{if(this[_0x9416('0x38')](_0x25a97d)){logger[_0x9416('0x3c')]('[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s',_0x25a97d['uniqueid'],_0x25a97d[_0x9416('0x40')],_0x25a97d[_0x9416('0x3e')],_0x25a97d['calleridnum']);logger[_0x9416('0x3f')]('[%s][voiceCallReport][newstate]\x20event:',_0x25a97d[_0x9416('0x3d')],util[_0x9416('0x36')](_0x25a97d,{'showHidden':![],'depth':null}));if(_0x25a97d[_0x9416('0x3d')]!==_0x25a97d[_0x9416('0x40')]){if(this['channels'][_0x25a97d[_0x9416('0x40')]]){if(_0x25a97d['channelstate']==='6'){if(!this[_0x9416('0x1c')][_0x25a97d[_0x9416('0x40')]][_0x9416('0x6b')]){var _0x8c3e2e=moment();this['channels'][_0x25a97d['linkedid']]['answered']=!![];this['channels'][_0x25a97d['linkedid']][_0x9416('0x6c')]=_0x8c3e2e[_0x9416('0x49')](_0x9416('0x54'));if(this[_0x9416('0x1c')][_0x25a97d[_0x9416('0x40')]][_0x9416('0x53')]){this[_0x9416('0x1c')][_0x25a97d[_0x9416('0x40')]]['holdtime']=_0x8c3e2e[_0x9416('0x6d')](this[_0x9416('0x1c')][_0x25a97d[_0x9416('0x40')]][_0x9416('0x53')],_0x9416('0x62'));}}this[_0x9416('0x1c')][_0x25a97d[_0x9416('0x40')]][_0x9416('0x40')]=_0x25a97d['uniqueid'];if(_0x25a97d[_0x9416('0x6e')]!==_0x9416('0x6f')){this['channels'][_0x25a97d['linkedid']][_0x9416('0x48')]=_0x25a97d['calleridnum'];}this[_0x9416('0x1c')][_0x25a97d[_0x9416('0x40')]][_0x9416('0x70')]=_0x25a97d['calleridname'];this['channels'][_0x25a97d[_0x9416('0x40')]][_0x9416('0x71')]=_0x25a97d[_0x9416('0x45')];this['channels'][_0x25a97d[_0x9416('0x40')]]['disposition']=dispositions[_[_0x9416('0x72')](_0x25a97d[_0x9416('0x55')])];if(this['agents'][_0x25a97d[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]]){this['channels'][_0x25a97d['linkedid']][_0x9416('0x73')]=this[_0x9416('0x1d')][_0x25a97d['channel'][_0x9416('0x46')]('-')[0x0]]['id'];this[_0x9416('0x1c')][_0x25a97d['linkedid']][_0x9416('0x74')]=this['agents'][_0x25a97d[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]][_0x9416('0x58')];}}}}else{if(this[_0x9416('0x1c')][_0x25a97d[_0x9416('0x3d')]]){if(_0x25a97d['channelstate']==='6'){if(this[_0x9416('0x1d')][_0x25a97d[_0x9416('0x45')]['split']('-')[0x0]]){this[_0x9416('0x1c')][_0x25a97d[_0x9416('0x3d')]][_0x9416('0x73')]=this[_0x9416('0x1d')][_0x25a97d[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]]['id'];this[_0x9416('0x1c')][_0x25a97d[_0x9416('0x3d')]][_0x9416('0x74')]=this[_0x9416('0x1d')][_0x25a97d['channel'][_0x9416('0x46')]('-')[0x0]][_0x9416('0x58')];}}}}if(_0x25a97d[_0x9416('0x55')]==='6'&&_0x25a97d[_0x9416('0x43')]===_0x9416('0x44')){if(this['agents'][_0x25a97d[_0x9416('0x45')]['split']('-')[0x0]]){this['agents'][_0x25a97d[_0x9416('0x45')]['split']('-')[0x0]]['destconnectedlinenum']=_0x25a97d['exten'];var _0x45c7cb;if(this[_0x9416('0x1c')][_0x25a97d['uniqueid']])_0x45c7cb=this[_0x9416('0x1c')][_0x25a97d[_0x9416('0x3d')]]['routealias'];else if(this[_0x9416('0x1c')][_0x25a97d[_0x9416('0x40')]])_0x45c7cb=this[_0x9416('0x1c')][_0x25a97d['linkedid']]['routealias'];logger[_0x9416('0x3f')](_0x9416('0x75'),_0x25a97d[_0x9416('0x3d')],util[_0x9416('0x36')]({'destaccountcode':this[_0x9416('0x1d')][_0x25a97d[_0x9416('0x45')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x25a97d['exten'],'routealias':_0x45c7cb},{'showHidden':![],'depth':null}));this[_0x9416('0x3a')](util[_0x9416('0x49')](_0x9416('0x4a'),this[_0x9416('0x1d')][_0x25a97d[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]][_0x9416('0x58')]),_0x9416('0x4b'),{'destaccountcode':this[_0x9416('0x1d')][_0x25a97d[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]][_0x9416('0x4c')],'destconnectedlinenum':_0x25a97d[_0x9416('0x52')],'routealias':_0x45c7cb});}}}}catch(_0x2ca25c){logger[_0x9416('0x34')](_0x9416('0x76'),_0x25a97d['uniqueid'],util[_0x9416('0x36')](_0x2ca25c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9416('0x37')][_0x9416('0x77')]=function(_0x5c3c11,_0x119e2d){try{if(this[_0x9416('0x1c')][_0x5c3c11]){logger[_0x9416('0x3c')]('[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s',_0x5c3c11,_0x119e2d);this[_0x9416('0x1c')][_0x5c3c11][_0x9416('0x78')]=!![];if(_[_0x9416('0x79')](_0x119e2d,_0x9416('0x7a'))){_0x119e2d=_0x119e2d[_0x9416('0x7b')](_0x9416('0x7a'),_0x9416('0x7c'));}this[_0x9416('0x1c')][_0x5c3c11][_0x9416('0x7d')]=_0x119e2d;var _0x3fe2c5=_['find'](this[_0x9416('0x1c')][_0x5c3c11]['monitors'],{'filename':_0x119e2d});if(_[_0x9416('0x7e')](_0x3fe2c5)){this[_0x9416('0x1c')][_0x5c3c11]['monitors'][_0x9416('0x7f')]({'filename':_0x119e2d,'createdAt':moment()['format'](_0x9416('0x54')),'mixmonitorid':'','status':_0x9416('0x80')});}}}catch(_0x4f0d00){logger[_0x9416('0x34')]('[%s][voiceCallReport][mixMonitorFilename]',_0x5c3c11,util['inspect'](_0x4f0d00,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9416('0x37')][_0x9416('0x27')]=function(_0x495853){try{if(this[_0x9416('0x38')](_0x495853)){logger[_0x9416('0x3f')](_0x9416('0x81'),_0x495853[_0x9416('0x3d')],util[_0x9416('0x36')](_0x495853,{'showHidden':![],'depth':null}));if(this['channels'][_0x495853[_0x9416('0x3d')]]&&_0x495853[_0x9416('0x45')]!='OutgoingSpoolFailed'){if(this[_0x9416('0x38')](_0x495853[_0x9416('0x82')])){if(this[_0x9416('0x38')](_0x495853[_0x9416('0x82')][_0x9416('0x83')])){logger['info'](_0x9416('0x84'),_0x495853[_0x9416('0x3d')],_0x495853[_0x9416('0x85')]);this['syncMixMonitorFilename'](_0x495853[_0x9416('0x3d')],_0x495853[_0x9416('0x85')]);}else if(this[_0x9416('0x38')](_0x495853[_0x9416('0x82')][_0x9416('0x86')])){logger[_0x9416('0x3c')]('[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s',_0x495853[_0x9416('0x3d')],_0x495853['value']);this[_0x9416('0x1c')][_0x495853[_0x9416('0x3d')]][_0x9416('0x6e')]=_0x495853['value'];}else if(this['isNotNull'](_0x495853[_0x9416('0x82')][_0x9416('0x87')])){logger['info']('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0x495853[_0x9416('0x3d')],_0x495853[_0x9416('0x85')]);this[_0x9416('0x1c')][_0x495853[_0x9416('0x3d')]][_0x9416('0x88')]=_0x495853[_0x9416('0x85')];}else if(this[_0x9416('0x38')](_0x495853[_0x9416('0x82')][_0x9416('0x89')])){logger[_0x9416('0x3c')](_0x9416('0x8a'),_0x495853[_0x9416('0x3d')],_0x495853[_0x9416('0x85')]);this[_0x9416('0x1c')][_0x495853[_0x9416('0x3d')]]['type']=_0x495853[_0x9416('0x85')];}else if(this[_0x9416('0x38')](_0x495853['variable'][_0x9416('0x8b')])){logger[_0x9416('0x3c')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x495853[_0x9416('0x3d')],_0x495853[_0x9416('0x85')][_0x9416('0x46')](',')[0x0]);this[_0x9416('0x1c')][_0x495853[_0x9416('0x3d')]]['queue']=_0x495853[_0x9416('0x85')][_0x9416('0x46')](',')[0x0];}else if(this[_0x9416('0x38')](_0x495853[_0x9416('0x82')][_0x9416('0x8c')])){logger[_0x9416('0x3c')](_0x9416('0x8d'),_0x495853[_0x9416('0x3d')],_0x495853[_0x9416('0x85')]);this['channels'][_0x495853[_0x9416('0x3d')]]['originatecalleridnum']=_0x495853['value'];}else if(this[_0x9416('0x38')](_0x495853[_0x9416('0x82')][_0x9416('0x8e')])){logger[_0x9416('0x3c')](_0x9416('0x8f'),_0x495853[_0x9416('0x3d')],_0x495853['value']);this[_0x9416('0x1c')][_0x495853['uniqueid']][_0x9416('0x90')]=_0x495853[_0x9416('0x85')];}else if(this[_0x9416('0x38')](_0x495853['variable'][_0x9416('0x91')])){logger['info'](_0x9416('0x92'),_0x495853[_0x9416('0x3d')],_0x495853[_0x9416('0x85')]);this['channels'][_0x495853[_0x9416('0x3d')]][_0x9416('0x93')]=_0x495853[_0x9416('0x85')];}else if(this[_0x9416('0x38')](_0x495853['variable'][_0x9416('0x94')])){logger[_0x9416('0x3c')](_0x9416('0x95'),_0x495853[_0x9416('0x3d')],_0x495853[_0x9416('0x85')]);this[_0x9416('0x1c')][_0x495853['uniqueid']]['queue']=_0x495853[_0x9416('0x85')];}else if(this[_0x9416('0x38')](_0x495853[_0x9416('0x82')][_0x9416('0x96')])){logger[_0x9416('0x3c')](_0x9416('0x97'),_0x495853[_0x9416('0x3d')],_0x495853[_0x9416('0x85')]);this['channels'][_0x495853['uniqueid']][_0x9416('0x98')]=_0x495853['value'];}}}else if(this[_0x9416('0x38')](_0x495853[_0x9416('0x82')]['mixmonitor_filename'])){if(_0x495853[_0x9416('0x85')]){var _0x5323ce=path['parse'](_0x495853[_0x9416('0x85')])[_0x9416('0x58')];logger[_0x9416('0x3c')]('[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s',_0x5323ce,_0x495853[_0x9416('0x85')]);this[_0x9416('0x77')](_0x5323ce,_0x495853[_0x9416('0x85')]);}}else if(this[_0x9416('0x1c')][_0x495853[_0x9416('0x40')]]){if(this[_0x9416('0x38')](_0x495853[_0x9416('0x82')])){if(this[_0x9416('0x38')](_0x495853[_0x9416('0x82')][_0x9416('0x96')])){logger[_0x9416('0x3c')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x495853[_0x9416('0x40')],_0x495853[_0x9416('0x85')]);this[_0x9416('0x1c')][_0x495853[_0x9416('0x40')]]['sipcalllinkedid']=_0x495853[_0x9416('0x85')];}}}}}catch(_0x11d52e){logger['error'](_0x9416('0x99'),_0x495853[_0x9416('0x3d')],util['inspect'](_0x11d52e,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9416('0x29')]=function(_0x46f682){try{if(this[_0x9416('0x38')](_0x46f682)){logger['debug'](_0x9416('0x9a'),_0x46f682[_0x9416('0x3d')],util['inspect'](_0x46f682,{'showHidden':![],'depth':null}));if(this['channels'][_0x46f682[_0x9416('0x3d')]]){logger[_0x9416('0x3c')]('[%s][voiceCallReport][hangup]\x20reason:%s',_0x46f682[_0x9416('0x3d')],_0x46f682[_0x9416('0x9b')]);var _0x365913=moment();this[_0x9416('0x1c')][_0x46f682[_0x9416('0x3d')]][_0x9416('0x9c')]=_0x365913[_0x9416('0x49')](_0x9416('0x54'));this[_0x9416('0x1c')][_0x46f682['uniqueid']][_0x9416('0x60')]=_0x365913['diff'](this[_0x9416('0x1c')][_0x46f682[_0x9416('0x3d')]][_0x9416('0x53')],_0x9416('0x62'));if(this[_0x9416('0x1c')][_0x46f682[_0x9416('0x3d')]][_0x9416('0x6b')]){this['channels'][_0x46f682['uniqueid']]['billableseconds']=_0x365913[_0x9416('0x6d')](this[_0x9416('0x1c')][_0x46f682[_0x9416('0x3d')]]['answertime'],_0x9416('0x62'));this[_0x9416('0x1c')][_0x46f682[_0x9416('0x3d')]][_0x9416('0x9d')]=this[_0x9416('0x1c')][_0x46f682[_0x9416('0x3d')]][_0x9416('0x60')]-this[_0x9416('0x1c')][_0x46f682[_0x9416('0x3d')]][_0x9416('0x9e')];}if(_0x46f682['context']==='from-sip'){if(this[_0x9416('0x1d')][_0x46f682['channel']['split']('-')[0x0]]){this[_0x9416('0x1d')][_0x46f682[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]]=_[_0x9416('0x9f')](this['agents'][_0x46f682['channel'][_0x9416('0x46')]('-')[0x0]],[_0x9416('0x47')]);logger[_0x9416('0x3f')](_0x9416('0xa0'),_0x46f682[_0x9416('0x3d')],util[_0x9416('0x36')]({'id':this[_0x9416('0x1d')][_0x46f682[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]]['id'],'destaccountcode':this[_0x9416('0x1d')][_0x46f682[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]][_0x9416('0x4c')]},{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x9416('0x4a'),this[_0x9416('0x1d')][_0x46f682[_0x9416('0x45')]['split']('-')[0x0]][_0x9416('0x58')]),_0x9416('0xa1'),{'id':this[_0x9416('0x1d')][_0x46f682[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]]['id'],'destaccountcode':this['agents'][_0x46f682[_0x9416('0x45')][_0x9416('0x46')]('-')[0x0]]['accountcode']});}}var _0x3e01ae=this;Promise[_0x9416('0xa2')]()['then'](function(){var _0x225566=_0x3e01ae[_0x9416('0x1c')][_0x46f682['uniqueid']];if(typeof _0x225566[_0x9416('0xa3')]==='undefined')return;if(_[_0x9416('0xa4')](_0x225566[_0x9416('0xa5')]))return;return RpcSetting[_0x9416('0xa6')]()['then'](function(_0xdfd13){if(!_0xdfd13['stopRecordingOnTransfer'])return;return Promise['resolve']()['then'](function(){return ami[_0x9416('0xa7')]({'action':'StopMixMonitor','channel':_0x225566['channel']})['catch'](function(){});})[_0x9416('0xa8')](function(){return ami[_0x9416('0xa7')]({'action':_0x9416('0xa9'),'channel':_0x225566[_0x9416('0x71')]})[_0x9416('0xaa')](function(){})[_0x9416('0xab')](function(){var _0x586321=_0x3e01ae[_0x9416('0x1d')][_0x225566[_0x9416('0x71')][_0x9416('0x46')]('-')[0x0]];if(!_0x586321)return;io[_0x9416('0x3a')]('webbar:stopmonitors',{'agentId':_0x586321['id'],'uniqueid':_0x225566[_0x9416('0x3d')]});});});});})[_0x9416('0xa8')](function(){if(_0x46f682[_0x9416('0xac')]===_0x9416('0xad')){_0x3e01ae[_0x9416('0x1e')][_0x46f682[_0x9416('0x3d')]]=_0x3e01ae['channels'][_0x46f682['uniqueid']];}else{if(_0x3e01ae['channels'][_0x46f682['uniqueid']][_0x9416('0xae')]===_0x9416('0xaf')&&_0x3e01ae[_0x9416('0x1e')][_0x46f682[_0x9416('0x3d')]]){_0x3e01ae[_0x9416('0x1c')][_0x46f682[_0x9416('0x3d')]][_0x9416('0x3d')]=[_0x3e01ae[_0x9416('0x1c')][_0x46f682['uniqueid']][_0x9416('0x40')],_0x3e01ae[_0x9416('0x1c')][_0x46f682['uniqueid']]['linkedid']=_0x3e01ae[_0x9416('0x1c')][_0x46f682[_0x9416('0x3d')]][_0x9416('0x3d')]][0x0];delete _0x3e01ae[_0x9416('0x1e')][_0x46f682[_0x9416('0x3d')]];}}logger[_0x9416('0x3f')](_0x9416('0xb0'),_0x46f682['uniqueid'],util[_0x9416('0x36')](_0x3e01ae[_0x9416('0x1c')][_0x46f682[_0x9416('0x3d')]],{'showHidden':![],'depth':null}));ami[_0x9416('0x3a')](_0x9416('0xb1'),_0x3e01ae[_0x9416('0x1c')][_0x46f682['uniqueid']]);delete _0x3e01ae[_0x9416('0x1c')][_0x46f682[_0x9416('0x3d')]];});}}}catch(_0x98567d){logger[_0x9416('0x34')](_0x9416('0xb2'),_0x46f682[_0x9416('0x3d')],util[_0x9416('0x36')](_0x98567d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9416('0x37')][_0x9416('0x2c')]=function(_0x40125b){try{if(this[_0x9416('0x38')](_0x40125b)){logger[_0x9416('0x3c')]('[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s',_0x40125b[_0x9416('0x3d')],_0x40125b[_0x9416('0xb3')],_0x40125b[_0x9416('0xb4')]);logger[_0x9416('0x3f')](_0x9416('0xb5'),_0x40125b[_0x9416('0x3d')],util[_0x9416('0x36')](_0x40125b,{'showHidden':![],'depth':null}));if(this[_0x9416('0x1c')][_0x40125b['transfereeuniqueid']]){this[_0x9416('0x1c')][_0x40125b['transfereeuniqueid']]['transfercalleridnum']=_0x40125b[_0x9416('0xb3')];this[_0x9416('0x1c')][_0x40125b[_0x9416('0xb6')]][_0x9416('0xb7')]=_0x40125b[_0x9416('0xb4')];if(this[_0x9416('0x1c')][_0x40125b[_0x9416('0xb8')]]){var _0x24b938=this['channels'][_0x40125b[_0x9416('0xb8')]];this[_0x9416('0x1c')][_0x40125b[_0x9416('0xb8')]]=this[_0x9416('0x1c')][_0x40125b[_0x9416('0xb6')]];this[_0x9416('0x1c')][_0x40125b[_0x9416('0xb6')]]=_0x24b938;}}else if(this[_0x9416('0x1c')][_0x40125b[_0x9416('0xb9')]]){this[_0x9416('0x1c')][_0x40125b['transfertargetuniqueid']][_0x9416('0xba')]=_0x40125b[_0x9416('0xb3')];this[_0x9416('0x1c')][_0x40125b['transfertargetuniqueid']][_0x9416('0xb7')]=_0x40125b['transfertargetcalleridnum'];if(this[_0x9416('0x1c')][_0x40125b['origtransfereruniqueid']]){var _0x24b938=this[_0x9416('0x1c')][_0x40125b[_0x9416('0xbb')]];this['channels'][_0x40125b[_0x9416('0xbb')]]=this[_0x9416('0x1c')][_0x40125b['transfertargetuniqueid']];this['channels'][_0x40125b['transfertargetuniqueid']]=_0x24b938;}}if((this['channels'][_0x40125b[_0x9416('0xbb')]]||this[_0x9416('0x1c')][_0x40125b[_0x9416('0xbc')]])&&this[_0x9416('0x1c')][_0x40125b[_0x9416('0xb8')]]){var _0x134e44=_[_0x9416('0xbd')]([this[_0x9416('0x1c')][_0x40125b[_0x9416('0xbb')]],this[_0x9416('0x1c')][_0x40125b['origtransfererlinkedid']],this[_0x9416('0x1c')][_0x40125b[_0x9416('0xb8')]]],function(_0x38aace){return _0x38aace&&_0x38aace['type']===_0x9416('0xaf')&&_0x38aace['routeid'];});if(_0x134e44){if(this[_0x9416('0x1c')][_0x40125b['origtransfereruniqueid']])this[_0x9416('0x1c')][_0x40125b[_0x9416('0xbb')]]['transferType']='ATTENDED';if(this[_0x9416('0x1c')][_0x40125b[_0x9416('0xbc')]])this[_0x9416('0x1c')][_0x40125b[_0x9416('0xbc')]][_0x9416('0xa3')]=_0x9416('0xbe');this['channels'][_0x40125b[_0x9416('0xb8')]][_0x9416('0xa3')]=_0x9416('0xbe');}}}}catch(_0x4debcf){logger['error'](_0x9416('0xbf'),_0x40125b[_0x9416('0x3d')],util['inspect'](_0x4debcf,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9416('0x37')][_0x9416('0x2d')]=function(_0x9e0c3c){try{if(this[_0x9416('0x38')](_0x9e0c3c)){logger['info'](_0x9416('0xc0'),_0x9e0c3c[_0x9416('0x3d')],_0x9e0c3c[_0x9416('0xc1')],_0x9e0c3c['extension']);logger[_0x9416('0x3f')](_0x9416('0xc2'),_0x9e0c3c[_0x9416('0x3d')],util[_0x9416('0x36')](_0x9e0c3c,{'showHidden':![],'depth':null}));if(this[_0x9416('0x1c')][_0x9e0c3c['transfereeuniqueid']]){this[_0x9416('0x1c')][_0x9e0c3c[_0x9416('0xb6')]][_0x9416('0xba')]=_0x9e0c3c['transfereecalleridnum'];this[_0x9416('0x1c')][_0x9e0c3c['transfereeuniqueid']]['transferconnectedlinenum']=_0x9e0c3c[_0x9416('0xc3')];this['channels'][_0x9e0c3c[_0x9416('0xb6')]][_0x9416('0xa3')]='BLIND';this['syncHangup']({'event':_0x9416('0xad'),'uniqueid':_0x9e0c3c[_0x9416('0xb6')],'context':_0x9e0c3c[_0x9416('0x43')],'channel':_0x9e0c3c[_0x9416('0xc4')]});}else{this[_0x9416('0x1c')][_0x9e0c3c[_0x9416('0xc5')]][_0x9416('0xa3')]='BLIND';}}}catch(_0x93e60b){logger[_0x9416('0x34')](_0x9416('0xc6'),_0x9e0c3c[_0x9416('0x3d')],util[_0x9416('0x36')](_0x93e60b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9416('0x37')][_0x9416('0x2f')]=function(_0x18f7f4){try{if(this[_0x9416('0x38')](_0x18f7f4)){logger[_0x9416('0x3f')]('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x18f7f4[_0x9416('0x3d')],util[_0x9416('0x36')](_0x18f7f4,{'showHidden':![],'depth':null}));if(this[_0x9416('0x1c')][_0x18f7f4['uniqueid']]){if(!_['isNil'](this[_0x9416('0x1c')][_0x18f7f4['uniqueid']][_0x9416('0x6c')])){this['channels'][_0x18f7f4['uniqueid']]['mohstarttime']=moment()['format'](_0x9416('0x54'));logger[_0x9416('0x3c')](_0x9416('0xc7'),_0x18f7f4[_0x9416('0x3d')],this[_0x9416('0x1c')][_0x18f7f4[_0x9416('0x3d')]]['mohstarttime']);}}}}catch(_0x59505b){logger[_0x9416('0x34')](_0x9416('0xc8'),_0x18f7f4['uniqueid'],util[_0x9416('0x36')](_0x59505b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9416('0x37')]['syncMusicOnHoldStop']=function(_0x3df801){try{if(this[_0x9416('0x38')](_0x3df801)){logger[_0x9416('0x3f')](_0x9416('0xc9'),_0x3df801[_0x9416('0x3d')],util['inspect'](_0x3df801,{'showHidden':![],'depth':null}));if(this[_0x9416('0x1c')][_0x3df801[_0x9416('0x3d')]]){if(!_[_0x9416('0x7e')](this[_0x9416('0x1c')][_0x3df801[_0x9416('0x3d')]][_0x9416('0xca')])){this['channels'][_0x3df801[_0x9416('0x3d')]][_0x9416('0xcb')]+=moment()['milliseconds'](0x0)[_0x9416('0x6d')](this[_0x9416('0x1c')][_0x3df801[_0x9416('0x3d')]][_0x9416('0xca')],_0x9416('0x62'));logger[_0x9416('0x3c')](_0x9416('0xcc'),_0x3df801['uniqueid'],this[_0x9416('0x1c')][_0x3df801[_0x9416('0x3d')]]['mohtime']);delete this[_0x9416('0x1c')][_0x3df801[_0x9416('0x3d')]][_0x9416('0xca')];}}}}catch(_0x1a850c){logger[_0x9416('0x34')](_0x9416('0xcd'),_0x3df801[_0x9416('0x3d')],util[_0x9416('0x36')](_0x1a850c,{'showHidden':![],'depth':null}));}};module[_0x9416('0xce')]=VoiceCallReport;
\ No newline at end of file
index dfb43fa..dcf78c4 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x28fb=['billableseconds','sumHoldTime','holdtime','sumBillable','sumDuration','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','voice_outbound:save','stringify','voice:outbound','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','syncNewExten','application','toLowerCase','set','appdata','applicationdata','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','match','[%s][voiceDialReport][newexten]','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','dialbegin','syncDialBegin','bind','dialend','varset','syncVarSet','newexten','syncHangup','prototype','isUndefined','emit','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','event','privilege','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','debug','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','inspect','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','syncDialEnd','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','info','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','[%s][voiceDialReport][dialend]','variable','value','isNotNull','outboundrouteid','variables','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','keys','[%s][voiceDialReport][varset]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberpenalty','isNil','includes','cause-txt','endtime','duration','diff','starttime','seconds','complete','total'];(function(_0x54808c,_0x36e290){var _0xe9459=function(_0x55df21){while(--_0x55df21){_0x54808c['push'](_0x54808c['shift']());}};_0xe9459(++_0x36e290);}(_0x28fb,0x109));var _0xb28f=function(_0x2f1114,_0x4561f1){_0x2f1114=_0x2f1114-0x0;var _0x2fe856=_0x28fb[_0x2f1114];return _0x2fe856;};'use strict';var _=require(_0xb28f('0x0'));var moment=require(_0xb28f('0x1'));var util=require('util');var Redis=require(_0xb28f('0x2'));var config=require(_0xb28f('0x3'));var logger=require(_0xb28f('0x4'))('ami');var ami=require('../ami');config[_0xb28f('0x5')]=_[_0xb28f('0x6')](config['redis'],{'host':_0xb28f('0x7'),'port':0x18eb});var io=require(_0xb28f('0x8'))(new Redis(config['redis']));function VoiceDialReport(_0x6a478e){this[_0xb28f('0x9')]=_0x6a478e[_0xb28f('0xa')];this[_0xb28f('0xb')]=_0x6a478e['outbound'];this[_0xb28f('0xc')]={};this['variables']={};ami['on'](_0xb28f('0xd'),this[_0xb28f('0xe')][_0xb28f('0xf')](this));ami['on'](_0xb28f('0x10'),this['syncDialEnd'][_0xb28f('0xf')](this));ami['on'](_0xb28f('0x11'),this[_0xb28f('0x12')]['bind'](this));ami['on'](_0xb28f('0x13'),this['syncNewExten'][_0xb28f('0xf')](this));ami['on']('hangup',this[_0xb28f('0x14')][_0xb28f('0xf')](this));}VoiceDialReport[_0xb28f('0x15')]['isNotNull']=function(_0x5c128d){return _0x5c128d!==null&&!_[_0xb28f('0x16')](_0x5c128d);};VoiceDialReport[_0xb28f('0x15')][_0xb28f('0x17')]=function(_0x479f47,_0x4f4adc,_0x4f553c){io['to'](_0x479f47)[_0xb28f('0x17')](_0x4f4adc,_0x4f553c);};VoiceDialReport['prototype']['syncDialBegin']=function(_0xee0426){try{if(this['isNotNull'](_0xee0426)){logger['debug']('[%s][voiceDialReport][dialbegin]\x20event:',_0xee0426[_0xb28f('0x18')],util['inspect'](_0xee0426,{'showHidden':![],'depth':null}));if(this[_0xb28f('0x9')][_0xee0426['uniqueid']]){_[_0xb28f('0x19')](this[_0xb28f('0x9')][_0xee0426[_0xb28f('0x18')]],{'starttime':moment()[_0xb28f('0x1a')](_0xb28f('0x1b')),'lastevent':_0xb28f('0x1c'),'interface':_0xee0426[_0xb28f('0x1d')][_0xb28f('0x1e')](0x0,_0xee0426[_0xb28f('0x1d')][_0xb28f('0x1f')]('-')),'membername':_0xee0426[_0xb28f('0x1d')][_0xb28f('0x1e')](_0xee0426[_0xb28f('0x1d')][_0xb28f('0x1f')]('/')+0x1,_0xee0426[_0xb28f('0x1d')][_0xb28f('0x1f')]('-'))},_['omit'](_0xee0426,[_0xb28f('0x20'),_0xb28f('0x21')]));logger['info'](_0xb28f('0x22'),_0xee0426[_0xb28f('0x18')],this['channels'][_0xee0426['uniqueid']][_0xb28f('0x23')],this[_0xb28f('0x9')][_0xee0426[_0xb28f('0x18')]][_0xb28f('0x24')]);logger[_0xb28f('0x25')](_0xb28f('0x26'),_0xee0426[_0xb28f('0x18')],util[_0xb28f('0x27')](this[_0xb28f('0x9')][_0xee0426[_0xb28f('0x18')]],{'showHidden':![],'depth':null}));if(this[_0xb28f('0xc')][_0xee0426[_0xb28f('0x18')]])_[_0xb28f('0x19')](this['channels'][_0xee0426[_0xb28f('0x18')]],this[_0xb28f('0xc')][_0xee0426[_0xb28f('0x18')]]);this['emit']('voice:outbound',_0xb28f('0x28'),this[_0xb28f('0x9')][_0xee0426['uniqueid']]);logger['debug'](_0xb28f('0x29'),_0xee0426['uniqueid'],util['inspect'](this[_0xb28f('0x9')][_0xee0426['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xb28f('0x17')](_0xb28f('0x2a'),this[_0xb28f('0x9')][_0xee0426[_0xb28f('0x18')]]);}}}catch(_0x4fc3a2){logger[_0xb28f('0x2b')]('[%s][voiceDialReport][dialbegin]',_0xee0426[_0xb28f('0x18')],util[_0xb28f('0x27')](_0x4fc3a2,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xb28f('0x15')][_0xb28f('0x2c')]=function(_0xca648b){try{if(this['isNotNull'](_0xca648b)){logger['debug'](_0xb28f('0x2d'),_0xca648b[_0xb28f('0x18')],util[_0xb28f('0x27')](_0xca648b,{'showHidden':![],'depth':null}));if(this[_0xb28f('0x9')][_0xca648b['uniqueid']]){this[_0xb28f('0x9')][_0xca648b['uniqueid']][_0xb28f('0x2e')]=_0xca648b['dialstatus'];if(_0xca648b['dialstatus']===_0xb28f('0x2f')){this[_0xb28f('0x9')][_0xca648b[_0xb28f('0x18')]][_0xb28f('0x30')]=_0xca648b['connectedlinenum'];this[_0xb28f('0x9')][_0xca648b[_0xb28f('0x18')]][_0xb28f('0x31')]=_0xca648b[_0xb28f('0x31')];this['channels'][_0xca648b['uniqueid']][_0xb28f('0x32')]=moment()[_0xb28f('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xb28f('0x9')][_0xca648b[_0xb28f('0x18')]][_0xb28f('0x33')]=_0xb28f('0x34');logger[_0xb28f('0x35')](_0xb28f('0x36'),_0xca648b[_0xb28f('0x18')],_0xca648b['channel']['substring'](_0xca648b['channel']['lastIndexOf']('/')+0x1,_0xca648b[_0xb28f('0x1d')]['lastIndexOf']('-')));logger['debug'](_0xb28f('0x37'),_0xca648b[_0xb28f('0x18')],util[_0xb28f('0x27')](this[_0xb28f('0x9')][_0xca648b['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xb28f('0x17')]('custom:dialconnect',this[_0xb28f('0x9')][_0xca648b[_0xb28f('0x18')]]);}logger[_0xb28f('0x25')](_0xb28f('0x38'),_0xca648b[_0xb28f('0x18')],util[_0xb28f('0x27')](this[_0xb28f('0x9')][_0xca648b['uniqueid']],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0xb28f('0x28'),this[_0xb28f('0x9')][_0xca648b['uniqueid']]);}}}catch(_0x57c82e){logger[_0xb28f('0x2b')](_0xb28f('0x39'),_0xca648b[_0xb28f('0x18')],util[_0xb28f('0x27')](_0x57c82e,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0xb28f('0x15')][_0xb28f('0x12')]=function(_0x1d63c7){try{if(this['isNotNull'](_0x1d63c7)){logger[_0xb28f('0x25')]('[%s][voiceDialReport][varset]\x20event:',_0x1d63c7[_0xb28f('0x18')],util[_0xb28f('0x27')](_0x1d63c7,{'showHidden':![],'depth':null}));this['addVariable'](_0x1d63c7[_0xb28f('0x18')],_['keys'](_0x1d63c7[_0xb28f('0x3a')])[0x0],_0x1d63c7[_0xb28f('0x3b')]);if(this[_0xb28f('0x3c')](_0x1d63c7[_0xb28f('0x3a')])&&this['isNotNull'](_0x1d63c7[_0xb28f('0x3a')][_0xb28f('0x3d')])){if(_[_0xb28f('0x16')](this['channels'][_0x1d63c7[_0xb28f('0x18')]])){this[_0xb28f('0x9')][_0x1d63c7[_0xb28f('0x18')]]={'routeId':_0x1d63c7['value'],'variables':this[_0xb28f('0x3e')][_0x1d63c7[_0xb28f('0x18')]],'motionChannel':'voice'};logger[_0xb28f('0x35')](_0xb28f('0x3f'),_0x1d63c7[_0xb28f('0x18')],_0x1d63c7[_0xb28f('0x3a')][_0xb28f('0x3d')],_[_0xb28f('0x40')](_0x1d63c7['variable'])[0x0],_0x1d63c7['value']);logger[_0xb28f('0x25')]('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x1d63c7[_0xb28f('0x18')],util[_0xb28f('0x27')](this['channels'][_0x1d63c7[_0xb28f('0x18')]],{'showHidden':![],'depth':null}));this[_0xb28f('0x17')]('voice:outbound',_0xb28f('0x28'),this[_0xb28f('0x9')][_0x1d63c7[_0xb28f('0x18')]]);}}}}catch(_0x2f0444){logger[_0xb28f('0x2b')](_0xb28f('0x41'),_0x1d63c7['uniqueid'],util[_0xb28f('0x27')](_0x2f0444,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xb28f('0x42')]=function(_0x276992,_0x4f4c58,_0xfd1c6e){var _0x16674c=[_0xb28f('0x43'),_0xb28f('0x44'),_0xb28f('0x45'),_0xb28f('0x46'),_0xb28f('0x47'),_0xb28f('0x48'),_0xb28f('0x49'),_0xb28f('0x4a'),_0xb28f('0x4b'),_0xb28f('0x4c'),_0xb28f('0x4d'),_0xb28f('0x4e'),_0xb28f('0x4f'),'memberdynamic',_0xb28f('0x50'),'memberlastcall',_0xb28f('0x23'),_0xb28f('0x51'),'memberrealtime'];if(!_[_0xb28f('0x52')](_0x4f4c58)&&!_[_0xb28f('0x53')](_0x16674c,_0x4f4c58)){if(_[_0xb28f('0x16')](this[_0xb28f('0x3e')][_0x276992])){this['variables'][_0x276992]={};}this[_0xb28f('0x3e')][_0x276992][_0x4f4c58]=_0xfd1c6e;}};VoiceDialReport[_0xb28f('0x15')]['syncHangup']=function(_0x44e6ea){try{if(this[_0xb28f('0x3c')](_0x44e6ea)){logger[_0xb28f('0x25')]('[%s][voiceDialReport][hangup]\x20event:',_0x44e6ea[_0xb28f('0x18')],util['inspect'](_0x44e6ea,{'showHidden':![],'depth':null}));if(this[_0xb28f('0x9')][_0x44e6ea['uniqueid']]){logger[_0xb28f('0x35')]('[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete',_0x44e6ea[_0xb28f('0x18')],_0x44e6ea[_0xb28f('0x54')]);this[_0xb28f('0x9')][_0x44e6ea[_0xb28f('0x18')]][_0xb28f('0x55')]=moment()[_0xb28f('0x1a')](_0xb28f('0x1b'));this[_0xb28f('0x9')][_0x44e6ea['uniqueid']][_0xb28f('0x56')]=moment(this[_0xb28f('0x9')][_0x44e6ea['uniqueid']][_0xb28f('0x55')])[_0xb28f('0x57')](this['channels'][_0x44e6ea['uniqueid']][_0xb28f('0x58')],_0xb28f('0x59'));this['channels'][_0x44e6ea[_0xb28f('0x18')]][_0xb28f('0x33')]=_0xb28f('0x5a');this[_0xb28f('0xb')][_0xb28f('0x5b')]+=0x1;if(this[_0xb28f('0x9')][_0x44e6ea[_0xb28f('0x18')]][_0xb28f('0x32')]){this[_0xb28f('0xb')]['answered']+=0x1;this[_0xb28f('0x9')][_0x44e6ea[_0xb28f('0x18')]]['holdtime']=moment(this[_0xb28f('0x9')][_0x44e6ea['uniqueid']][_0xb28f('0x32')])[_0xb28f('0x57')](this[_0xb28f('0x9')][_0x44e6ea[_0xb28f('0x18')]][_0xb28f('0x58')],_0xb28f('0x59'));this['channels'][_0x44e6ea[_0xb28f('0x18')]][_0xb28f('0x5c')]=moment(this['channels'][_0x44e6ea[_0xb28f('0x18')]][_0xb28f('0x55')])[_0xb28f('0x57')](this['channels'][_0x44e6ea['uniqueid']][_0xb28f('0x32')],_0xb28f('0x59'));this['outbound'][_0xb28f('0x5d')]+=this[_0xb28f('0x9')][_0x44e6ea[_0xb28f('0x18')]][_0xb28f('0x5e')]||0x0;this[_0xb28f('0xb')][_0xb28f('0x5f')]+=this['channels'][_0x44e6ea['uniqueid']][_0xb28f('0x5c')];}this['outbound'][_0xb28f('0x60')]+=this['channels'][_0x44e6ea['uniqueid']]['duration'];logger[_0xb28f('0x25')]('[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:',_0x44e6ea[_0xb28f('0x18')],util[_0xb28f('0x27')](this[_0xb28f('0x9')][_0x44e6ea[_0xb28f('0x18')]],{'showHidden':![],'depth':null}));ami[_0xb28f('0x17')](_0xb28f('0x61'),this[_0xb28f('0x9')][_0x44e6ea[_0xb28f('0x18')]]);logger['debug'](_0xb28f('0x62'),_0x44e6ea[_0xb28f('0x18')],util[_0xb28f('0x27')](this[_0xb28f('0x9')][_0x44e6ea[_0xb28f('0x18')]],{'showHidden':![],'depth':null}));ami['emit'](_0xb28f('0x63'),this[_0xb28f('0x9')][_0x44e6ea[_0xb28f('0x18')]]);logger['debug'](_0xb28f('0x64'),_0x44e6ea['uniqueid'],util[_0xb28f('0x27')](this[_0xb28f('0x9')][_0x44e6ea['uniqueid']],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0xb28f('0x65'),this[_0xb28f('0xb')]);logger[_0xb28f('0x35')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0xb28f('0x66')](this['channels'][_0x44e6ea[_0xb28f('0x18')]]));logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x44e6ea[_0xb28f('0x18')],util[_0xb28f('0x27')](this[_0xb28f('0x9')][_0x44e6ea[_0xb28f('0x18')]],{'showHidden':![],'depth':null}));this[_0xb28f('0x17')](_0xb28f('0x67'),_0xb28f('0x68'),this[_0xb28f('0x9')][_0x44e6ea['uniqueid']]);delete this['channels'][_0x44e6ea[_0xb28f('0x18')]];}else if(this[_0xb28f('0x9')][_0x44e6ea[_0xb28f('0x69')]]){this[_0xb28f('0x9')][_0x44e6ea['linkedid']][_0xb28f('0x18')]=this[_0xb28f('0x9')][_0x44e6ea['linkedid']][_0xb28f('0x6a')];}if(this['variables'][_0x44e6ea[_0xb28f('0x18')]]){delete this['variables'][_0x44e6ea[_0xb28f('0x18')]];}}}catch(_0x186d2d){logger['error'](_0xb28f('0x6b'),_0x44e6ea['uniqueid'],util[_0xb28f('0x27')](_0x186d2d,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0xb28f('0x6c')]=function(_0x1c493a){try{if(this[_0xb28f('0x3c')](_0x1c493a)){logger[_0xb28f('0x25')]('[%s][voiceDialReport][newexten]\x20event:',_0x1c493a['uniqueid'],util['inspect'](_0x1c493a,{'showHidden':![],'depth':null}));if(_0x1c493a[_0xb28f('0x6d')][_0xb28f('0x6e')]()===_0xb28f('0x6f')){_0x1c493a['applicationdata']=(_0x1c493a[_0xb28f('0x70')]||_0x1c493a[_0xb28f('0x71')])[_0xb28f('0x6e')]();if(_['startsWith'](_0x1c493a['applicationdata'],_0xb28f('0x72'))){if(_['isUndefined'](this[_0xb28f('0xc')][_0x1c493a[_0xb28f('0x18')]]))this['applications'][_0x1c493a[_0xb28f('0x18')]]={};logger[_0xb28f('0x35')](_0xb28f('0x73'),_0x1c493a[_0xb28f('0x18')],_0x1c493a['application'],_0x1c493a[_0xb28f('0x71')]);var _0x4bc433=_0x1c493a[_0xb28f('0x71')]['split']('=');var _0x58530a=_0x4bc433[0x0][_0xb28f('0x74')](/cdr\((.*)\)/);if(_0x58530a)this[_0xb28f('0xc')][_0x1c493a[_0xb28f('0x18')]][_0x58530a[0x1]]=_0x4bc433[0x1];}}}}catch(_0x3b6eae){logger['error'](_0xb28f('0x75'),_0x1c493a['uniqueid'],util['inspect'](_0x3b6eae,{'showHidden':![],'depth':null}));}};module[_0xb28f('0x76')]=VoiceDialReport;
\ No newline at end of file
+var _0x2a75=['sumHoldTime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','[%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','voice_outbound_channel:remove','linkedid','destuniqueid','[%s][voiceDialReport][hangup]','[%s][voiceDialReport][newexten]\x20event:','toLowerCase','set','applicationdata','appdata','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','application','split','[%s][voiceDialReport][newexten]','exports','lodash','../../../config/logger','../ami','redis','defaults','localhost','channels','outboundChannels','outbound','applications','variables','dialbegin','syncDialBegin','bind','dialend','syncDialEnd','varset','newexten','syncNewExten','hangup','syncHangup','prototype','isUndefined','emit','isNotNull','debug','[%s][voiceDialReport][dialbegin]\x20event:','uniqueid','merge','format','called','substring','channel','lastIndexOf','omit','event','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','inspect','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','error','dialstatus','connectedlinenum','connectedlinename','answertime','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]','syncVarSet','addVariable','keys','variable','outboundrouteid','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberpenalty','isNil','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','endtime','YYYY-MM-DD\x20HH:mm:ss','diff','starttime','seconds','lastevent','complete','total','holdtime','billableseconds'];(function(_0x3ada0a,_0x5e94e9){var _0x41ffc0=function(_0xd4dabc){while(--_0xd4dabc){_0x3ada0a['push'](_0x3ada0a['shift']());}};_0x41ffc0(++_0x5e94e9);}(_0x2a75,0x8b));var _0x52a7=function(_0x35f17a,_0x19eee7){_0x35f17a=_0x35f17a-0x0;var _0x27e42b=_0x2a75[_0x35f17a];return _0x27e42b;};'use strict';var _=require(_0x52a7('0x0'));var moment=require('moment');var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x52a7('0x1'))('ami');var ami=require(_0x52a7('0x2'));config[_0x52a7('0x3')]=_[_0x52a7('0x4')](config[_0x52a7('0x3')],{'host':_0x52a7('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x52a7('0x3')]));function VoiceDialReport(_0xe0adb6){this[_0x52a7('0x6')]=_0xe0adb6[_0x52a7('0x7')];this[_0x52a7('0x8')]=_0xe0adb6['outbound'];this[_0x52a7('0x9')]={};this[_0x52a7('0xa')]={};ami['on'](_0x52a7('0xb'),this[_0x52a7('0xc')][_0x52a7('0xd')](this));ami['on'](_0x52a7('0xe'),this[_0x52a7('0xf')]['bind'](this));ami['on'](_0x52a7('0x10'),this['syncVarSet'][_0x52a7('0xd')](this));ami['on'](_0x52a7('0x11'),this[_0x52a7('0x12')][_0x52a7('0xd')](this));ami['on'](_0x52a7('0x13'),this[_0x52a7('0x14')][_0x52a7('0xd')](this));}VoiceDialReport[_0x52a7('0x15')]['isNotNull']=function(_0x107e13){return _0x107e13!==null&&!_[_0x52a7('0x16')](_0x107e13);};VoiceDialReport[_0x52a7('0x15')][_0x52a7('0x17')]=function(_0x242a1c,_0x2e1f85,_0x2c2566){io['to'](_0x242a1c)[_0x52a7('0x17')](_0x2e1f85,_0x2c2566);};VoiceDialReport['prototype'][_0x52a7('0xc')]=function(_0x4cc9e1){try{if(this[_0x52a7('0x18')](_0x4cc9e1)){logger[_0x52a7('0x19')](_0x52a7('0x1a'),_0x4cc9e1[_0x52a7('0x1b')],util['inspect'](_0x4cc9e1,{'showHidden':![],'depth':null}));if(this[_0x52a7('0x6')][_0x4cc9e1['uniqueid']]){_[_0x52a7('0x1c')](this[_0x52a7('0x6')][_0x4cc9e1[_0x52a7('0x1b')]],{'starttime':moment()[_0x52a7('0x1d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x52a7('0x1e'),'interface':_0x4cc9e1['channel'][_0x52a7('0x1f')](0x0,_0x4cc9e1[_0x52a7('0x20')][_0x52a7('0x21')]('-')),'membername':_0x4cc9e1['channel']['substring'](_0x4cc9e1[_0x52a7('0x20')][_0x52a7('0x21')]('/')+0x1,_0x4cc9e1[_0x52a7('0x20')][_0x52a7('0x21')]('-'))},_[_0x52a7('0x22')](_0x4cc9e1,[_0x52a7('0x23'),_0x52a7('0x24')]));logger[_0x52a7('0x25')](_0x52a7('0x26'),_0x4cc9e1[_0x52a7('0x1b')],this[_0x52a7('0x6')][_0x4cc9e1[_0x52a7('0x1b')]][_0x52a7('0x27')],this[_0x52a7('0x6')][_0x4cc9e1['uniqueid']][_0x52a7('0x28')]);logger[_0x52a7('0x19')](_0x52a7('0x29'),_0x4cc9e1['uniqueid'],util[_0x52a7('0x2a')](this[_0x52a7('0x6')][_0x4cc9e1[_0x52a7('0x1b')]],{'showHidden':![],'depth':null}));if(this[_0x52a7('0x9')][_0x4cc9e1[_0x52a7('0x1b')]])_[_0x52a7('0x1c')](this[_0x52a7('0x6')][_0x4cc9e1[_0x52a7('0x1b')]],this[_0x52a7('0x9')][_0x4cc9e1[_0x52a7('0x1b')]]);this[_0x52a7('0x17')](_0x52a7('0x2b'),_0x52a7('0x2c'),this[_0x52a7('0x6')][_0x4cc9e1[_0x52a7('0x1b')]]);logger[_0x52a7('0x19')](_0x52a7('0x2d'),_0x4cc9e1[_0x52a7('0x1b')],util[_0x52a7('0x2a')](this[_0x52a7('0x6')][_0x4cc9e1[_0x52a7('0x1b')]],{'showHidden':![],'depth':null}));ami['emit']('custom:dialbegin',this[_0x52a7('0x6')][_0x4cc9e1['uniqueid']]);}}}catch(_0xa8d465){logger[_0x52a7('0x2e')]('[%s][voiceDialReport][dialbegin]',_0x4cc9e1['uniqueid'],util[_0x52a7('0x2a')](_0xa8d465,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x52a7('0xf')]=function(_0x1c09f7){try{if(this['isNotNull'](_0x1c09f7)){logger[_0x52a7('0x19')]('[%s][voiceDialReport][dialend]\x20event:',_0x1c09f7[_0x52a7('0x1b')],util[_0x52a7('0x2a')](_0x1c09f7,{'showHidden':![],'depth':null}));if(this[_0x52a7('0x6')][_0x1c09f7['uniqueid']]){this[_0x52a7('0x6')][_0x1c09f7['uniqueid']]['dialstatus']=_0x1c09f7[_0x52a7('0x2f')];if(_0x1c09f7[_0x52a7('0x2f')]==='ANSWER'){this['channels'][_0x1c09f7['uniqueid']]['connectedlinenum']=_0x1c09f7[_0x52a7('0x30')];this[_0x52a7('0x6')][_0x1c09f7['uniqueid']]['connectedlinename']=_0x1c09f7[_0x52a7('0x31')];this[_0x52a7('0x6')][_0x1c09f7[_0x52a7('0x1b')]][_0x52a7('0x32')]=moment()[_0x52a7('0x1d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x52a7('0x6')][_0x1c09f7[_0x52a7('0x1b')]]['lastevent']='connect';logger[_0x52a7('0x25')](_0x52a7('0x33'),_0x1c09f7[_0x52a7('0x1b')],_0x1c09f7[_0x52a7('0x20')][_0x52a7('0x1f')](_0x1c09f7[_0x52a7('0x20')][_0x52a7('0x21')]('/')+0x1,_0x1c09f7[_0x52a7('0x20')]['lastIndexOf']('-')));logger[_0x52a7('0x19')](_0x52a7('0x34'),_0x1c09f7[_0x52a7('0x1b')],util[_0x52a7('0x2a')](this['channels'][_0x1c09f7[_0x52a7('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x52a7('0x17')](_0x52a7('0x35'),this['channels'][_0x1c09f7[_0x52a7('0x1b')]]);}logger[_0x52a7('0x19')]('[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:',_0x1c09f7[_0x52a7('0x1b')],util[_0x52a7('0x2a')](this[_0x52a7('0x6')][_0x1c09f7[_0x52a7('0x1b')]],{'showHidden':![],'depth':null}));this[_0x52a7('0x17')]('voice:outbound',_0x52a7('0x2c'),this[_0x52a7('0x6')][_0x1c09f7[_0x52a7('0x1b')]]);}}}catch(_0x88f5b0){logger[_0x52a7('0x2e')](_0x52a7('0x36'),_0x1c09f7[_0x52a7('0x1b')],util[_0x52a7('0x2a')](_0x88f5b0,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x52a7('0x15')][_0x52a7('0x37')]=function(_0x3a97a4){try{if(this[_0x52a7('0x18')](_0x3a97a4)){logger[_0x52a7('0x19')]('[%s][voiceDialReport][varset]\x20event:',_0x3a97a4['uniqueid'],util['inspect'](_0x3a97a4,{'showHidden':![],'depth':null}));this[_0x52a7('0x38')](_0x3a97a4[_0x52a7('0x1b')],_[_0x52a7('0x39')](_0x3a97a4['variable'])[0x0],_0x3a97a4['value']);if(this[_0x52a7('0x18')](_0x3a97a4[_0x52a7('0x3a')])&&this['isNotNull'](_0x3a97a4[_0x52a7('0x3a')][_0x52a7('0x3b')])){if(_['isUndefined'](this['channels'][_0x3a97a4[_0x52a7('0x1b')]])){this['channels'][_0x3a97a4[_0x52a7('0x1b')]]={'routeId':_0x3a97a4['value'],'variables':this[_0x52a7('0xa')][_0x3a97a4[_0x52a7('0x1b')]],'motionChannel':_0x52a7('0x3c')};logger[_0x52a7('0x25')](_0x52a7('0x3d'),_0x3a97a4['uniqueid'],_0x3a97a4[_0x52a7('0x3a')][_0x52a7('0x3b')],_[_0x52a7('0x39')](_0x3a97a4['variable'])[0x0],_0x3a97a4['value']);logger[_0x52a7('0x19')]('[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:',_0x3a97a4['uniqueid'],util[_0x52a7('0x2a')](this[_0x52a7('0x6')][_0x3a97a4[_0x52a7('0x1b')]],{'showHidden':![],'depth':null}));this['emit']('voice:outbound',_0x52a7('0x2c'),this[_0x52a7('0x6')][_0x3a97a4[_0x52a7('0x1b')]]);}}}}catch(_0x131b61){logger[_0x52a7('0x2e')](_0x52a7('0x3e'),_0x3a97a4[_0x52a7('0x1b')],util[_0x52a7('0x2a')](_0x131b61,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x52a7('0x15')][_0x52a7('0x38')]=function(_0x49b5c9,_0xa9e06b,_0x36250c){var _0x781ec4=['rtpaudioqos',_0x52a7('0x3f'),_0x52a7('0x40'),_0x52a7('0x41'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0x52a7('0x42'),_0x52a7('0x43'),_0x52a7('0x44'),_0x52a7('0x45'),_0x52a7('0x46'),_0x52a7('0x47'),_0x52a7('0x48'),'memberdynamic',_0x52a7('0x49'),_0x52a7('0x4a'),_0x52a7('0x27'),_0x52a7('0x4b'),'memberrealtime'];if(!_[_0x52a7('0x4c')](_0xa9e06b)&&!_['includes'](_0x781ec4,_0xa9e06b)){if(_[_0x52a7('0x16')](this['variables'][_0x49b5c9])){this[_0x52a7('0xa')][_0x49b5c9]={};}this[_0x52a7('0xa')][_0x49b5c9][_0xa9e06b]=_0x36250c;}};VoiceDialReport[_0x52a7('0x15')][_0x52a7('0x14')]=function(_0x5e38ff){try{if(this['isNotNull'](_0x5e38ff)){logger[_0x52a7('0x19')](_0x52a7('0x4d'),_0x5e38ff[_0x52a7('0x1b')],util[_0x52a7('0x2a')](_0x5e38ff,{'showHidden':![],'depth':null}));if(this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]]){logger[_0x52a7('0x25')](_0x52a7('0x4e'),_0x5e38ff[_0x52a7('0x1b')],_0x5e38ff['cause-txt']);this[_0x52a7('0x6')][_0x5e38ff['uniqueid']][_0x52a7('0x4f')]=moment()[_0x52a7('0x1d')](_0x52a7('0x50'));this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]]['duration']=moment(this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]][_0x52a7('0x4f')])[_0x52a7('0x51')](this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]][_0x52a7('0x52')],_0x52a7('0x53'));this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]][_0x52a7('0x54')]=_0x52a7('0x55');this['outbound'][_0x52a7('0x56')]+=0x1;if(this[_0x52a7('0x6')][_0x5e38ff['uniqueid']][_0x52a7('0x32')]){this[_0x52a7('0x8')]['answered']+=0x1;this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]][_0x52a7('0x57')]=moment(this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]]['answertime'])[_0x52a7('0x51')](this['channels'][_0x5e38ff[_0x52a7('0x1b')]]['starttime'],_0x52a7('0x53'));this['channels'][_0x5e38ff[_0x52a7('0x1b')]][_0x52a7('0x58')]=moment(this[_0x52a7('0x6')][_0x5e38ff['uniqueid']][_0x52a7('0x4f')])[_0x52a7('0x51')](this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]][_0x52a7('0x32')],'seconds');this[_0x52a7('0x8')][_0x52a7('0x59')]+=this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]][_0x52a7('0x57')]||0x0;this[_0x52a7('0x8')][_0x52a7('0x5a')]+=this['channels'][_0x5e38ff[_0x52a7('0x1b')]][_0x52a7('0x58')];}this['outbound'][_0x52a7('0x5b')]+=this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]]['duration'];logger[_0x52a7('0x19')](_0x52a7('0x5c'),_0x5e38ff['uniqueid'],util['inspect'](this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]],{'showHidden':![],'depth':null}));ami['emit']('custom:voiceDialReport',this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]]);logger[_0x52a7('0x19')](_0x52a7('0x5d'),_0x5e38ff[_0x52a7('0x1b')],util[_0x52a7('0x2a')](this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x52a7('0x17')](_0x52a7('0x5e'),this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]]);logger[_0x52a7('0x19')](_0x52a7('0x5f'),_0x5e38ff[_0x52a7('0x1b')],util[_0x52a7('0x2a')](this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]],{'showHidden':![],'depth':null}));this[_0x52a7('0x17')](_0x52a7('0x2b'),_0x52a7('0x60'),this[_0x52a7('0x8')]);logger[_0x52a7('0x25')](_0x52a7('0x61'),JSON['stringify'](this[_0x52a7('0x6')][_0x5e38ff['uniqueid']]));logger[_0x52a7('0x19')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x5e38ff[_0x52a7('0x1b')],util[_0x52a7('0x2a')](this['channels'][_0x5e38ff[_0x52a7('0x1b')]],{'showHidden':![],'depth':null}));this[_0x52a7('0x17')](_0x52a7('0x2b'),_0x52a7('0x62'),this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]]);delete this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x1b')]];}else if(this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x63')]]){this[_0x52a7('0x6')][_0x5e38ff[_0x52a7('0x63')]][_0x52a7('0x1b')]=this[_0x52a7('0x6')][_0x5e38ff['linkedid']][_0x52a7('0x64')];}if(this[_0x52a7('0xa')][_0x5e38ff[_0x52a7('0x1b')]]){delete this['variables'][_0x5e38ff[_0x52a7('0x1b')]];}}}catch(_0x3fba33){logger[_0x52a7('0x2e')](_0x52a7('0x65'),_0x5e38ff[_0x52a7('0x1b')],util[_0x52a7('0x2a')](_0x3fba33,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x52a7('0x15')][_0x52a7('0x12')]=function(_0x221601){try{if(this[_0x52a7('0x18')](_0x221601)){logger['debug'](_0x52a7('0x66'),_0x221601[_0x52a7('0x1b')],util[_0x52a7('0x2a')](_0x221601,{'showHidden':![],'depth':null}));if(_0x221601['application'][_0x52a7('0x67')]()===_0x52a7('0x68')){_0x221601[_0x52a7('0x69')]=(_0x221601[_0x52a7('0x6a')]||_0x221601[_0x52a7('0x69')])[_0x52a7('0x67')]();if(_[_0x52a7('0x6b')](_0x221601[_0x52a7('0x69')],_0x52a7('0x6c'))){if(_[_0x52a7('0x16')](this[_0x52a7('0x9')][_0x221601['uniqueid']]))this[_0x52a7('0x9')][_0x221601[_0x52a7('0x1b')]]={};logger[_0x52a7('0x25')](_0x52a7('0x6d'),_0x221601[_0x52a7('0x1b')],_0x221601[_0x52a7('0x6e')],_0x221601[_0x52a7('0x69')]);var _0x4e593b=_0x221601[_0x52a7('0x69')][_0x52a7('0x6f')]('=');var _0x3bcfca=_0x4e593b[0x0]['match'](/cdr\((.*)\)/);if(_0x3bcfca)this[_0x52a7('0x9')][_0x221601['uniqueid']][_0x3bcfca[0x1]]=_0x4e593b[0x1];}}}}catch(_0x5e447c){logger[_0x52a7('0x2e')](_0x52a7('0x70'),_0x221601[_0x52a7('0x1b')],util[_0x52a7('0x2a')](_0x5e447c,{'showHidden':![],'depth':null}));}};module[_0x52a7('0x71')]=VoiceDialReport;
\ No newline at end of file
index 23a8bab..1131268 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0bc=['attendedtransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','pTalking','waiting','queueStatusComplete','clearZombieChannels','switch','isNil','Action','status','channel','catch','message','error','[%s][voiceQueueReport][checkChannel]','queueReports','[%s][voiceQueueReport][checkQueueReport]','inspect','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','format','voice:queue:%s','name','voice_queue_channel:save','uniqueid','voice_queue_presence:remove','emitVoiceQueueSummary','inbound','strategy','available','loggedIn','sumBillable','talking','total','type','abandoned','Trunk','callerid','Interval','md5','debug',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','isUndefined','queues','[voiceQueueReport][queues]','then','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummary]\x20event:','queue','countBy','toNumber','callers','loggedin','queuesummary','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','syncQueueSummaryComplete','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','position','count','routealias','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','keys','push','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercompleteAt','holdtime','originalposition','YYYY-MM-DD\x20HH:mm:ss','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','[%s][voiceQueueReport][agentconnect]','queuecallercomplete','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','syncAgentComplete','queuecallerabandonAt','assigned','queuecallerexit','queuecallerexitAt','reason','transfer','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','add','seconds','transfertype','FORWARD','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][agentcomplete]','variable','queuestatus','value','CONTINUE','TIMEOUT','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','syncHangup','unmanaged','sumHoldTime','length','sumDuration','milliseconds','answered','diff','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfereruniqueid','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceQueueReport][newexten]\x20event:','application','applicationdata','appdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','[%s][voiceQueueReport][newexten]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','syncQueueSummary','bind','queuesummarycomplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentConnect','varset','hangup','fullybooted','syncFullyBooted','newexten','syncNewExten','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop'];(function(_0xb8e44,_0x2a6a20){var _0x3dbb16=function(_0x15fca8){while(--_0x15fca8){_0xb8e44['push'](_0xb8e44['shift']());}};_0x3dbb16(++_0x2a6a20);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var moment=require(_0xca0b('0x0'));var util=require(_0xca0b('0x1'));var md5=require('md5');var Redis=require(_0xca0b('0x2'));var config=require(_0xca0b('0x3'));var logger=require(_0xca0b('0x4'))(_0xca0b('0x5'));var ami=require(_0xca0b('0x6'));var QueueReport=require(_0xca0b('0x7'));config[_0xca0b('0x8')]=_[_0xca0b('0x9')](config[_0xca0b('0x8')],{'host':_0xca0b('0xa'),'port':0x18eb});var io=require(_0xca0b('0xb'))(new Redis(config[_0xca0b('0x8')]));var Sequence=function(){};Sequence[_0xca0b('0xc')][_0xca0b('0xd')]=function(_0x55a1de){this[_0xca0b('0xe')]=this[_0xca0b('0xe')]?this[_0xca0b('0xe')][_0xca0b('0xf')](_0x55a1de):_0x55a1de();};function VoiceQueueReport(_0x128730){this[_0xca0b('0x10')]=new Sequence();this['queueReports']={};this[_0xca0b('0x11')]=_0x128730[_0xca0b('0x11')];this[_0xca0b('0x12')]=_0x128730[_0xca0b('0x13')];this[_0xca0b('0x14')]=_0x128730[_0xca0b('0x14')];this[_0xca0b('0x15')]=!![];this[_0xca0b('0x16')]=_0x128730[_0xca0b('0x16')];this[_0xca0b('0x17')]={};ami['on']('queuesummary',this[_0xca0b('0x18')][_0xca0b('0x19')](this));ami['on'](_0xca0b('0x1a'),this['syncQueueSummaryComplete'][_0xca0b('0x19')](this));ami['on'](_0xca0b('0x1b'),this[_0xca0b('0x1c')][_0xca0b('0x19')](this));ami['on'](_0xca0b('0x1d'),this[_0xca0b('0x1e')]['bind'](this));ami['on'](_0xca0b('0x1f'),this[_0xca0b('0x20')]['bind'](this));ami['on'](_0xca0b('0x21'),this['syncAgentComplete'][_0xca0b('0x19')](this));ami['on']('agentconnect',this[_0xca0b('0x22')][_0xca0b('0x19')](this));ami['on'](_0xca0b('0x23'),this['syncVarSet'][_0xca0b('0x19')](this));ami['on'](_0xca0b('0x24'),this['syncHangup'][_0xca0b('0x19')](this));ami['on'](_0xca0b('0x25'),this[_0xca0b('0x26')]['bind'](this));ami['on'](_0xca0b('0x27'),this[_0xca0b('0x28')][_0xca0b('0x19')](this));ami['on'](_0xca0b('0x29'),this[_0xca0b('0x2a')][_0xca0b('0x19')](this));ami['on']('musiconholdstop',this[_0xca0b('0x2b')][_0xca0b('0x19')](this));ami['on'](_0xca0b('0x2c'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0xca0b('0x2d'),this[_0xca0b('0x2e')][_0xca0b('0x19')](this));this[_0xca0b('0x2f')]();this[_0xca0b('0x30')]();}function clearChannels(_0x5ed78a){if(!_[_0xca0b('0x31')](_0x5ed78a)){for(var _0x10b5f3 in _0x5ed78a){if(_0x5ed78a[_0xca0b('0x32')](_0x10b5f3)){delete _0x5ed78a[_0x10b5f3];}}}}function clearCampaigns(_0x2f82a5){if(!_[_0xca0b('0x31')](_0x2f82a5)){for(var _0x48e172 in _0x2f82a5){if(_0x2f82a5['hasOwnProperty'](_0x48e172)){_0x2f82a5[_0x48e172]['originated']=0x0;}}}}function clearVoiceQueues(_0x44a6fd){if(!_[_0xca0b('0x31')](_0x44a6fd)){for(var _0x3fd832 in _0x44a6fd){if(_0x44a6fd[_0xca0b('0x32')](_0x3fd832)){_0x44a6fd[_0x3fd832][_0xca0b('0x33')]=0x0;_0x44a6fd[_0x3fd832]['talking']=0x0;_0x44a6fd[_0x3fd832][_0xca0b('0x34')]=0x0;_0x44a6fd[_0x3fd832][_0xca0b('0x35')]=0x0;_0x44a6fd[_0x3fd832][_0xca0b('0x36')]=!![];}}}}function clearAgentBooked(_0x20f0d5){if(!_[_0xca0b('0x31')](_0x20f0d5)){for(var _0x449a3a in _0x20f0d5){if(_0x20f0d5[_0xca0b('0x32')](_0x449a3a)){_0x20f0d5[_0x449a3a]['unlockRR']=!![];}}}}VoiceQueueReport[_0xca0b('0xc')][_0xca0b('0x37')]=function(){var _0x3b72b2=this;for(var _0x26f168 in this['channels']){if(this[_0xca0b('0x12')][_0xca0b('0x32')](_0x26f168)&&!this[_0xca0b('0x12')][_0x26f168][_0xca0b('0x38')]){this[_0xca0b('0x10')][_0xca0b('0xd')](function(){if(!_[_0xca0b('0x39')](_0x3b72b2[_0xca0b('0x12')][_0x26f168])){return ami[_0xca0b('0x3a')]({'action':_0xca0b('0x3b'),'channel':_0x3b72b2[_0xca0b('0x12')][_0x26f168][_0xca0b('0x3c')]})[_0xca0b('0x3d')](function(_0x15c7b1){if(_0x15c7b1[_0xca0b('0x3e')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x3b72b2[_0xca0b('0x12')][_0x26f168]){delete _0x3b72b2[_0xca0b('0x12')][_0x26f168];logger[_0xca0b('0x3f')](_0xca0b('0x40'),_0x26f168,util['inspect'](_0x15c7b1,{'showHidden':![],'depth':null}));}if(_0x3b72b2[_0xca0b('0x41')][_0x26f168]){delete _0x3b72b2[_0xca0b('0x41')][_0x26f168];logger['error'](_0xca0b('0x42'),_0x26f168,util[_0xca0b('0x43')](_0x15c7b1,{'showHidden':![],'depth':null}));}if(_0x3b72b2[_0xca0b('0x17')][_0x26f168]){delete _0x3b72b2[_0xca0b('0x17')][_0x26f168];logger[_0xca0b('0x3f')](_0xca0b('0x44'),_0x26f168,util[_0xca0b('0x43')](_0x15c7b1,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xca0b('0xc')]['syncFullyBooted']=function(){logger['error'](_0xca0b('0x45'));clearChannels(this[_0xca0b('0x12')]);this[_0xca0b('0x46')](this[_0xca0b('0x41')]);clearAgentBooked(this[_0xca0b('0x11')]);clearVoiceQueues(this[_0xca0b('0x14')]);clearCampaigns(this[_0xca0b('0x16')]);};VoiceQueueReport[_0xca0b('0xc')][_0xca0b('0x46')]=function(_0x3521d1){var _0x30a9c4=this;if(!_[_0xca0b('0x31')](_0x3521d1)){for(var _0x3a4403 in _0x3521d1){if(_0x3521d1[_0xca0b('0x32')](_0x3a4403)){_0x30a9c4[_0xca0b('0x47')](_0x3521d1[_0x3a4403],_0xca0b('0x48'));delete _0x3521d1[_0x3a4403];}}}};VoiceQueueReport[_0xca0b('0xc')][_0xca0b('0x49')]=function(_0x23ea0c,_0x2c1225,_0x177e1c){io['to'](_0x23ea0c)[_0xca0b('0x49')](_0x2c1225,_0x177e1c);};VoiceQueueReport[_0xca0b('0xc')][_0xca0b('0x4a')]=function(_0x90dc6c,_0x548e49){logger['debug'](_0xca0b('0x4b')+_0x548e49+_0xca0b('0x4c'),_0x90dc6c['uniqueid'],util['inspect'](_0x90dc6c,{'showHidden':![],'depth':null}));this['emit'](util[_0xca0b('0x4d')](_0xca0b('0x4e'),_0x90dc6c[_0xca0b('0x4f')]),_0xca0b('0x50'),_0x90dc6c);io[_0xca0b('0x49')]('voice_queue_presence:save',_0x90dc6c);};VoiceQueueReport['prototype'][_0xca0b('0x47')]=function(_0x543bf8,_0x170d76){logger['debug']('[%s][voiceQueueReport]['+_0x170d76+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x543bf8[_0xca0b('0x51')],util[_0xca0b('0x43')](_0x543bf8,{'showHidden':![],'depth':null}));this[_0xca0b('0x49')](util[_0xca0b('0x4d')](_0xca0b('0x4e'),_0x543bf8[_0xca0b('0x4f')]),'voice_queue_channel:remove',_0x543bf8);io[_0xca0b('0x49')](_0xca0b('0x52'),_0x543bf8);};VoiceQueueReport[_0xca0b('0xc')][_0xca0b('0x53')]=function(_0x411f15,_0x4dd8f4){if(_0x411f15['type']===_0xca0b('0x54')){var _0xc0ba20={'id':_0x411f15['id'],'name':_0x411f15[_0xca0b('0x4f')],'strategy':_0x411f15[_0xca0b('0x55')],'answered':_0x411f15['answered'],'available':_0x411f15[_0xca0b('0x56')],'loggedIn':_0x411f15[_0xca0b('0x57')],'pTalking':_0x411f15[_0xca0b('0x34')],'sumBillable':_0x411f15[_0xca0b('0x58')],'sumDuration':_0x411f15['sumDuration'],'sumHoldTime':_0x411f15['sumHoldTime']||0x0,'talking':_0x411f15[_0xca0b('0x59')],'total':_0x411f15[_0xca0b('0x5a')],'type':_0x411f15[_0xca0b('0x5b')],'unmanaged':_0x411f15['unmanaged'],'abandoned':_0x411f15[_0xca0b('0x5c')],'waiting':_0x411f15[_0xca0b('0x35')]};if(_0x411f15['Trunk']){_0xc0ba20['Trunk']={'id':_0x411f15['Trunk']['id'],'name':_0x411f15[_0xca0b('0x5d')][_0xca0b('0x4f')],'active':_0x411f15[_0xca0b('0x5d')]['active'],'callerid':_0x411f15['Trunk'][_0xca0b('0x5e')]};}if(_0x411f15[_0xca0b('0x5f')]){_0xc0ba20[_0xca0b('0x5f')]={'id':_0x411f15[_0xca0b('0x5f')]['id'],'name':_0x411f15[_0xca0b('0x5f')][_0xca0b('0x4f')]};}var _0x4b89dc=md5(JSON['stringify'](_0xc0ba20));if(_0x411f15['md5']!==_0x4b89dc){_0x411f15[_0xca0b('0x60')]=_0x4b89dc;logger[_0xca0b('0x61')]('[voiceQueueReport]['+_0x4dd8f4+_0xca0b('0x62'),util[_0xca0b('0x43')](_0xc0ba20,{'showHidden':![],'depth':null}));this[_0xca0b('0x49')](util['format'](_0xca0b('0x4e'),_0xc0ba20['name']),_0xca0b('0x63'),_0xc0ba20);}}};VoiceQueueReport[_0xca0b('0xc')][_0xca0b('0x64')]=function(_0xd9e187){return _0xd9e187!==null&&!_[_0xca0b('0x65')](_0xd9e187);};VoiceQueueReport[_0xca0b('0xc')][_0xca0b('0x30')]=function(){var _0x25e582=this;setInterval(function(){_0x25e582[_0xca0b('0x37')]();ami[_0xca0b('0x3a')]({'action':_0xca0b('0x66')})[_0xca0b('0x3d')](function(_0x6d737e){logger[_0xca0b('0x3f')](_0xca0b('0x67'),util[_0xca0b('0x43')](_0x6d737e,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xca0b('0xc')][_0xca0b('0x2f')]=function(){var _0x5a0592=this;setInterval(function(){if(_0x5a0592[_0xca0b('0x15')]){return ami[_0xca0b('0x3a')]({'action':'queuesummary'})[_0xca0b('0x68')](function(_0x1dd1a2){_0x5a0592[_0xca0b('0x15')]=![];})[_0xca0b('0x3d')](function(_0x36763b){logger[_0xca0b('0x3f')](_0xca0b('0x69'),util[_0xca0b('0x43')](_0x36763b,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype'][_0xca0b('0x18')]=function(_0x36feaa){try{if(this[_0xca0b('0x64')](_0x36feaa)&&this[_0xca0b('0x64')](_0x36feaa['queue'])){logger['debug'](_0xca0b('0x6a'),util[_0xca0b('0x43')](_0x36feaa,{'showHidden':![],'depth':null}));if(this['voiceQueues'][_0x36feaa[_0xca0b('0x6b')]]){logger['info']('[voiceQueueReport][queuesummary]\x20name:%s',_0x36feaa[_0xca0b('0x6b')]);var _0x3716e8=_[_0xca0b('0x6c')](this['channels'],'queue')[_0x36feaa[_0xca0b('0x6b')]]||0x0;var _0x5aee92=_0x3716e8-_0x36feaa['callers'];if(this[_0xca0b('0x14')][_0x36feaa['queue']][_0xca0b('0x35')]!==_[_0xca0b('0x6d')](_0x36feaa[_0xca0b('0x6e')])||this['voiceQueues'][_0x36feaa[_0xca0b('0x6b')]]['loggedIn']!==_[_0xca0b('0x6d')](_0x36feaa[_0xca0b('0x6f')])||this[_0xca0b('0x14')][_0x36feaa[_0xca0b('0x6b')]]['available']!==_[_0xca0b('0x6d')](_0x36feaa[_0xca0b('0x56')])||this[_0xca0b('0x14')][_0x36feaa[_0xca0b('0x6b')]][_0xca0b('0x59')]!==_0x5aee92){this[_0xca0b('0x14')][_0x36feaa[_0xca0b('0x6b')]][_0xca0b('0x35')]=_[_0xca0b('0x6d')](_0x36feaa['callers']);this['voiceQueues'][_0x36feaa[_0xca0b('0x6b')]][_0xca0b('0x57')]=_[_0xca0b('0x6d')](_0x36feaa[_0xca0b('0x6f')]);this[_0xca0b('0x14')][_0x36feaa[_0xca0b('0x6b')]]['available']=_[_0xca0b('0x6d')](_0x36feaa[_0xca0b('0x56')]);this[_0xca0b('0x14')][_0x36feaa['queue']][_0xca0b('0x59')]=_0x5aee92>0x0?_0x5aee92:0x0;this[_0xca0b('0x14')][_0x36feaa[_0xca0b('0x6b')]][_0xca0b('0x59')]=this[_0xca0b('0x14')][_0x36feaa[_0xca0b('0x6b')]][_0xca0b('0x59')]>_[_0xca0b('0x6d')](_0x36feaa['loggedin'])?_['toNumber'](_0x36feaa['loggedin']):this['voiceQueues'][_0x36feaa['queue']][_0xca0b('0x59')];this[_0xca0b('0x53')](this[_0xca0b('0x14')][_0x36feaa[_0xca0b('0x6b')]],_0xca0b('0x70'));}logger[_0xca0b('0x61')](_0xca0b('0x71'),util[_0xca0b('0x43')](this[_0xca0b('0x14')][_0x36feaa[_0xca0b('0x6b')]],{'showHidden':![],'depth':null}));ami['emit'](_0xca0b('0x72'),this['voiceQueues'][_0x36feaa[_0xca0b('0x6b')]]);}}}catch(_0x4c0b99){logger[_0xca0b('0x3f')](_0xca0b('0x69'),util['inspect'](_0x4c0b99,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xca0b('0x73')]=function(_0x3f3d28){logger[_0xca0b('0x61')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0xca0b('0x43')](_0x3f3d28,{'showHidden':![],'depth':null}));this[_0xca0b('0x15')]=!![];};VoiceQueueReport[_0xca0b('0xc')][_0xca0b('0x1c')]=function(_0x541ba4){try{if(this[_0xca0b('0x64')](_0x541ba4)){logger['debug'](_0xca0b('0x74'),_0x541ba4['uniqueid'],util[_0xca0b('0x43')](_0x541ba4,{'showHidden':![],'depth':null}));if(_[_0xca0b('0x65')](this['queueReports'][_0x541ba4[_0xca0b('0x51')]]))this[_0xca0b('0x41')][_0x541ba4['uniqueid']]=[];if(_[_0xca0b('0x65')](this[_0xca0b('0x12')][_0x541ba4[_0xca0b('0x51')]]))this['channels'][_0x541ba4[_0xca0b('0x51')]]={};var _0x462908=new QueueReport();_0x462908[_0xca0b('0x4f')]=_0x541ba4['queue'];_0x462908[_0xca0b('0x5b')]=this[_0xca0b('0x14')][_0x462908[_0xca0b('0x4f')]]&&this[_0xca0b('0x14')][_0x462908[_0xca0b('0x4f')]][_0xca0b('0x5b')]?this[_0xca0b('0x14')][_0x462908[_0xca0b('0x4f')]][_0xca0b('0x5b')]||_0xca0b('0x54'):_0xca0b('0x54');_0x462908[_0xca0b('0x6b')]=_0x541ba4[_0xca0b('0x6b')];_0x462908[_0xca0b('0x75')]=moment()[_0xca0b('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x462908[_0xca0b('0x76')]=_0x541ba4[_0xca0b('0x76')];_0x462908[_0xca0b('0x77')]=_0x541ba4[_0xca0b('0x77')];_0x462908[_0xca0b('0x51')]=_0x541ba4[_0xca0b('0x51')];_0x462908[_0xca0b('0x78')]=this[_0xca0b('0x12')][_0x541ba4['uniqueid']][_0xca0b('0x78')];logger[_0xca0b('0x79')](_0xca0b('0x7a'),_0x462908[_0xca0b('0x4f')],_0x462908[_0xca0b('0x5b')]);_[_0xca0b('0x7b')](_0x462908,_['pick'](_0x541ba4,_[_0xca0b('0x7c')](_0x462908)));this[_0xca0b('0x41')][_0x541ba4[_0xca0b('0x51')]][_0xca0b('0x7d')](_0x462908);this[_0xca0b('0x12')][_0x541ba4[_0xca0b('0x51')]]=_0x462908;this[_0xca0b('0x4a')](_0x462908,_0xca0b('0x1b'));}}catch(_0xbf0bc6){logger[_0xca0b('0x3f')](_0xca0b('0x74'),_0x541ba4[_0xca0b('0x51')],util['inspect'](_0xbf0bc6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xca0b('0xc')]['syncQueueCallerAbandon']=function(_0x1779cf){try{if(this[_0xca0b('0x64')](_0x1779cf)){logger['debug'](_0xca0b('0x7e'),_0x1779cf[_0xca0b('0x51')],util['inspect'](_0x1779cf,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1779cf[_0xca0b('0x51')]]){var _0x415ad5=_[_0xca0b('0x7f')](this['queueReports'][_0x1779cf[_0xca0b('0x51')]]);_0x415ad5['queuecallercomplete']=![];_0x415ad5[_0xca0b('0x80')]=null;_0x415ad5['holdtime']=_0x1779cf[_0xca0b('0x81')];_0x415ad5[_0xca0b('0x82')]=_0x1779cf[_0xca0b('0x82')];_0x415ad5['queuecallerabandon']=!![];_0x415ad5['queuecallerabandonAt']=moment()['format'](_0xca0b('0x83'));_0x415ad5[_0xca0b('0x84')]=_0xca0b('0x85');_0x415ad5[_0xca0b('0x86')]=null;logger[_0xca0b('0x79')](_0xca0b('0x87'),_0x415ad5[_0xca0b('0x4f')],_0x415ad5['type']);this['channels'][_0x1779cf[_0xca0b('0x51')]]=_0x415ad5;this[_0xca0b('0x47')](_0x415ad5,_0xca0b('0x1d'));}}}catch(_0x1cc727){logger[_0xca0b('0x3f')](_0xca0b('0x7e'),_0x1779cf[_0xca0b('0x51')],util[_0xca0b('0x43')](_0x1cc727,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xca0b('0xc')][_0xca0b('0x20')]=function(_0x4b9764){try{if(this['isNotNull'](_0x4b9764)){logger['debug'](_0xca0b('0x88'),_0x4b9764[_0xca0b('0x51')],util[_0xca0b('0x43')](_0x4b9764,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4b9764['uniqueid']]){var _0x151f5f=_[_0xca0b('0x7f')](this[_0xca0b('0x41')][_0x4b9764['uniqueid']]);_0x151f5f[_0xca0b('0x89')]=moment()[_0xca0b('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x151f5f[_0xca0b('0x8a')]=_0x4b9764[_0xca0b('0x8a')];_0x151f5f[_0xca0b('0x8b')]=_0x4b9764[_0xca0b('0x8b')];logger['info'](_0xca0b('0x8c'),_0x151f5f[_0xca0b('0x4f')],_0x151f5f[_0xca0b('0x5b')],_0x4b9764['connectedlinenum'],_0x4b9764[_0xca0b('0x8b')]);this[_0xca0b('0x12')][_0x4b9764['uniqueid']]=_0x151f5f;this['emitVoiceQueueChannelSave'](_0x151f5f,_0xca0b('0x1f'));}}}catch(_0x5e965b){logger[_0xca0b('0x3f')]('[%s][voiceQueueReport][queuecallerleave]',_0x4b9764['uniqueid'],util[_0xca0b('0x43')](_0x5e965b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xca0b('0xc')]['syncAgentConnect']=function(_0x259da0){try{if(this['isNotNull'](_0x259da0)){logger['debug'](_0xca0b('0x8d'),_0x259da0['uniqueid'],util[_0xca0b('0x43')](_0x259da0,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x259da0['uniqueid']]){var _0x4c8863=_[_0xca0b('0x7f')](this['queueReports'][_0x259da0[_0xca0b('0x51')]]);_0x4c8863[_0xca0b('0x8e')]=!![];_0x4c8863['queuecallerexitreason']=_0xca0b('0x8f');logger[_0xca0b('0x79')](_0xca0b('0x90'),_0x4c8863[_0xca0b('0x4f')],_0x4c8863[_0xca0b('0x5b')]);}}}catch(_0x3d9dc7){logger[_0xca0b('0x3f')](_0xca0b('0x8d'),_0x259da0['uniqueid'],util['inspect'](_0x3d9dc7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xca0b('0xc')][_0xca0b('0x91')]=function(_0x541114){try{if(this[_0xca0b('0x64')](_0x541114)){logger[_0xca0b('0x61')]('[%s][voiceQueueReport][agentcomplete]',_0x541114[_0xca0b('0x51')],util[_0xca0b('0x43')](_0x541114,{'showHidden':![],'depth':null}));if(this[_0xca0b('0x41')][_0x541114[_0xca0b('0x51')]]){var _0x3a94aa=_[_0xca0b('0x7f')](this[_0xca0b('0x41')][_0x541114['uniqueid']]);_0x3a94aa['queuecallerabandon']=![];_0x3a94aa[_0xca0b('0x92')]=null;_0x3a94aa[_0xca0b('0x93')]=!![];_0x3a94aa[_0xca0b('0x86')]=_0x541114['membername'];_0x3a94aa['holdtime']=_0x541114[_0xca0b('0x81')];_0x3a94aa['queuecallercomplete']=!![];_0x3a94aa[_0xca0b('0x94')]=![];_0x3a94aa[_0xca0b('0x95')]=null;if(!_0x3a94aa['transfer']){if(_0x541114[_0xca0b('0x96')]==_0xca0b('0x97')){_0x3a94aa[_0xca0b('0x84')]=_0xca0b('0x98');logger[_0xca0b('0x79')](_0xca0b('0x99'),_0x3a94aa[_0xca0b('0x4f')],_0x3a94aa[_0xca0b('0x5b')]);}else{if(_[_0xca0b('0x9a')](_0x541114[_0xca0b('0x3c')][_0xca0b('0x9b')](),_0xca0b('0x9c'))){if(this[_0xca0b('0x41')][_0x541114[_0xca0b('0x9d')]]){var _0x542d4f=_[_0xca0b('0x7f')](this[_0xca0b('0x41')][_0x541114[_0xca0b('0x9d')]]);_0x542d4f[_0xca0b('0x8e')]=![];_0x542d4f['queuecallerexit']=!![];_0x542d4f[_0xca0b('0x95')]=moment(_0x3a94aa[_0xca0b('0x75')])[_0xca0b('0x9e')](_0x541114[_0xca0b('0x81')],_0xca0b('0x9f'))[_0xca0b('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x542d4f[_0xca0b('0x84')]='FORWARDTRANSFER';_0x542d4f[_0xca0b('0x97')]=!![];_0x542d4f[_0xca0b('0xa0')]=_0xca0b('0xa1');_0x542d4f[_0xca0b('0xa2')]=_0x541114[_0xca0b('0xa3')];_0x542d4f[_0xca0b('0xa4')]=_0x541114['uniqueid'];logger[_0xca0b('0x79')](_0xca0b('0xa5'),_0x542d4f[_0xca0b('0x4f')],_0x542d4f[_0xca0b('0x5b')]);var _0x15b0a1=this['queueReports'][_0x541114['linkedid']];this[_0xca0b('0x41')][_0x541114[_0xca0b('0x9d')]]=this[_0xca0b('0x41')][_0x541114[_0xca0b('0x51')]];this[_0xca0b('0x41')][_0x541114['uniqueid']]=_0x15b0a1;}}else{_0x3a94aa[_0xca0b('0x84')]=_0xca0b('0xa6')+_0x541114[_0xca0b('0x96')][_0xca0b('0xa7')]();logger[_0xca0b('0x79')](_0xca0b('0xa8'),_0x3a94aa[_0xca0b('0x4f')],_0x3a94aa['type'],_0x3a94aa['queuecallerexitreason']);}}}this['channels'][_0x541114['uniqueid']]=_0x3a94aa;this[_0xca0b('0x47')](_0x3a94aa,'agentcomplete');}}}catch(_0x17745c){logger['error'](_0xca0b('0xa9'),_0x541114[_0xca0b('0x51')],util[_0xca0b('0x43')](_0x17745c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xca0b('0xc')]['syncVarSet']=function(_0xa9ba11){try{if(this[_0xca0b('0x64')](_0xa9ba11)){logger['debug']('[%s][voiceQueueReport][varset]',_0xa9ba11['uniqueid'],util[_0xca0b('0x43')](_0xa9ba11,{'showHidden':![],'depth':null}));this['addVariable'](_0xa9ba11[_0xca0b('0x51')],_[_0xca0b('0x7c')](_0xa9ba11['variable'])[0x0],_0xa9ba11['value']);if(this[_0xca0b('0x41')][_0xa9ba11[_0xca0b('0x51')]]){var _0x37ce06=_[_0xca0b('0x7f')](this[_0xca0b('0x41')][_0xa9ba11[_0xca0b('0x51')]]);if(_0x37ce06){if(this[_0xca0b('0x64')](_0xa9ba11[_0xca0b('0xaa')])&&this[_0xca0b('0x64')](_0xa9ba11['variable'][_0xca0b('0xab')])){switch(_0xa9ba11[_0xca0b('0xac')]){case _0xca0b('0xad'):_0x37ce06['queuecallerexit']=![];_0x37ce06[_0xca0b('0x95')]=null;break;case _0xca0b('0xae'):_0x37ce06[_0xca0b('0xaf')]=_0xca0b('0xb0');_0x37ce06[_0xca0b('0x94')]=!![];_0x37ce06['queuecallerexitAt']=moment()[_0xca0b('0x4d')](_0xca0b('0x83'));_0x37ce06[_0xca0b('0x89')]=moment()[_0xca0b('0x4d')](_0xca0b('0x83'));logger['debug'](_0xca0b('0xb1'),_0xa9ba11['uniqueid'],util['inspect'](_0x37ce06,{'showHidden':![],'depth':null}));ami[_0xca0b('0x49')](_0xca0b('0xb2'),_0x37ce06);break;default:_0x37ce06[_0xca0b('0x94')]=!![];_0x37ce06['queuecallerexitAt']=moment()[_0xca0b('0x4d')](_0xca0b('0x83'));_0x37ce06[_0xca0b('0x89')]=moment()[_0xca0b('0x4d')](_0xca0b('0x83'));}_0x37ce06[_0xca0b('0x1d')]=![];_0x37ce06[_0xca0b('0x92')]=null;_0x37ce06[_0xca0b('0x84')]=_0xa9ba11[_0xca0b('0xac')];this['channels'][_0xa9ba11[_0xca0b('0x51')]]=_0x37ce06;this[_0xca0b('0x47')](_0x37ce06,_0xca0b('0x23'));}else if(this[_0xca0b('0x64')](_0xa9ba11['variable'])&&this[_0xca0b('0x64')](_0xa9ba11[_0xca0b('0xaa')]['queueposition'])){if(!_0x37ce06['queuecallerabandon']){_0x37ce06['queuecallerexit']=!![];_0x37ce06[_0xca0b('0x95')]=moment()['format'](_0xca0b('0x83'));_0x37ce06[_0xca0b('0x84')]=_0xca0b('0xb3');_0x37ce06[_0xca0b('0x89')]=moment()[_0xca0b('0x4d')](_0xca0b('0x83'));this[_0xca0b('0x12')][_0xa9ba11[_0xca0b('0x51')]]=_0x37ce06;}}logger['info'](_0xca0b('0xb4'),_0xa9ba11[_0xca0b('0x51')],_0x37ce06['name'],_0x37ce06[_0xca0b('0x5b')],_[_0xca0b('0x7c')](_0xa9ba11[_0xca0b('0xaa')])[0x0],_0xa9ba11[_0xca0b('0xac')]);_0x37ce06[_0xca0b('0x17')]=this[_0xca0b('0x17')][_0xa9ba11[_0xca0b('0x51')]];}}}}catch(_0x21645f){logger[_0xca0b('0x3f')]('[%s][voiceQueueReport][varset]',_0xa9ba11[_0xca0b('0x51')],util[_0xca0b('0x43')](_0x21645f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xca0b('0xc')][_0xca0b('0xb5')]=function(_0x576880,_0x4b6f9c,_0x3b9ac3){var _0x69837b=[_0xca0b('0xb6'),_0xca0b('0xb7'),'rtpaudioqosjitter',_0xca0b('0xb8'),_0xca0b('0xb9'),_0xca0b('0xba'),'rtpaudioqosrtt',_0xca0b('0xbb'),_0xca0b('0xbc'),_0xca0b('0xbd'),_0xca0b('0xbe'),_0xca0b('0xbf'),'membercalls','memberdynamic',_0xca0b('0xc0'),_0xca0b('0xc1'),'membername',_0xca0b('0xc2'),_0xca0b('0xc3')];if(!_[_0xca0b('0x39')](_0x4b6f9c)&&!_[_0xca0b('0xc4')](_0x69837b,_0x4b6f9c)){if(_[_0xca0b('0x65')](this[_0xca0b('0x17')][_0x576880])){this['variables'][_0x576880]={};}this[_0xca0b('0x17')][_0x576880][_0x4b6f9c]=_0x3b9ac3;}};VoiceQueueReport['prototype'][_0xca0b('0xc5')]=function(_0x1818f4){try{if(this[_0xca0b('0x64')](_0x1818f4)){logger[_0xca0b('0x61')]('[%s][voiceQueueReport][hangup]',_0x1818f4['uniqueid'],util['inspect'](_0x1818f4,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1818f4[_0xca0b('0x51')]]){for(var _0x20a03f=0x0,_0x1e767c={};_0x20a03f<this['queueReports'][_0x1818f4[_0xca0b('0x51')]]['length'];_0x20a03f+=0x1){_0x1e767c=this[_0xca0b('0x41')][_0x1818f4[_0xca0b('0x51')]][_0x20a03f];if(this['voiceQueues'][_0x1e767c[_0xca0b('0x6b')]]){if(_0x1e767c[_0xca0b('0x94')]&&_0x1e767c[_0xca0b('0x97')]!=!![]){this[_0xca0b('0x14')][_0x1e767c[_0xca0b('0x6b')]][_0xca0b('0xc6')]+=0x1;}if(_0x1e767c[_0xca0b('0x1d')]){this[_0xca0b('0x14')][_0x1e767c[_0xca0b('0x6b')]][_0xca0b('0x5c')]+=0x1;}this[_0xca0b('0x14')][_0x1e767c[_0xca0b('0x6b')]][_0xca0b('0xc7')]+=moment(_0x1e767c['queuecallerleaveAt'])['diff'](_0x1e767c[_0xca0b('0x75')],_0xca0b('0x9f'))||0x0;if(_0x20a03f===this[_0xca0b('0x41')][_0x1818f4[_0xca0b('0x51')]][_0xca0b('0xc8')]-0x1){this[_0xca0b('0x14')][_0x1e767c['queue']][_0xca0b('0xc9')]+=moment()[_0xca0b('0xca')](0x0)['diff'](_0x1e767c[_0xca0b('0x75')],_0xca0b('0x9f'));this[_0xca0b('0x14')][_0x1e767c[_0xca0b('0x6b')]][_0xca0b('0x5a')]+=0x1;if(_0x1e767c[_0xca0b('0x8e')]){this[_0xca0b('0x14')][_0x1e767c[_0xca0b('0x6b')]][_0xca0b('0xcb')]+=0x1;this[_0xca0b('0x14')][_0x1e767c['queue']][_0xca0b('0x58')]+=moment()[_0xca0b('0xca')](0x0)[_0xca0b('0xcc')](_0x1e767c[_0xca0b('0x89')],'seconds');_0x1e767c['queuecallercompleteAt']=moment()[_0xca0b('0x4d')](_0xca0b('0x83'));_0x1e767c['queuecallerexit']=![];_0x1e767c[_0xca0b('0x95')]=null;}if(_0x1e767c['queuecallerexit']&&_0x1e767c[_0xca0b('0x97')]!=!![]){_0x1e767c[_0xca0b('0xaf')]='unmanaged';logger[_0xca0b('0x61')](_0xca0b('0xcd'),_0x1818f4[_0xca0b('0x51')],util[_0xca0b('0x43')](_0x1e767c,{'showHidden':![],'depth':null}));ami[_0xca0b('0x49')](_0xca0b('0xce'),_0x1e767c);}if(_0x1e767c[_0xca0b('0x1d')]){_0x1e767c[_0xca0b('0xaf')]=_0xca0b('0x5c');logger[_0xca0b('0x61')](_0xca0b('0xcf'),_0x1818f4[_0xca0b('0x51')],util[_0xca0b('0x43')](_0x1e767c,{'showHidden':![],'depth':null}));ami[_0xca0b('0x49')](_0xca0b('0xd0'),_0x1e767c);}}else{this[_0xca0b('0x14')][_0x1e767c[_0xca0b('0x6b')]][_0xca0b('0xc9')]+=this[_0xca0b('0x14')][_0x1e767c[_0xca0b('0x6b')]][_0xca0b('0xc7')];}logger[_0xca0b('0x79')](_0xca0b('0xd1'),_0x1818f4[_0xca0b('0x51')],_0x1e767c[_0xca0b('0x4f')],_0x1e767c['type'],_0x1818f4[_0xca0b('0xd2')]);this['channels'][_0x1818f4[_0xca0b('0x51')]]=_0x1e767c;this['emitVoiceQueueChannelRemove'](_0x1e767c,_0xca0b('0x24'));this[_0xca0b('0x53')](this['voiceQueues'][_0x1e767c[_0xca0b('0x6b')]],_0xca0b('0x24'));}}logger[_0xca0b('0x61')](_0xca0b('0xd3'),_0x1818f4['uniqueid'],util['inspect'](this[_0xca0b('0x41')][_0x1818f4[_0xca0b('0x51')]],{'showHidden':![],'depth':null}));ami['emit'](_0xca0b('0xd4'),this['queueReports'][_0x1818f4[_0xca0b('0x51')]]);delete this['queueReports'][_0x1818f4[_0xca0b('0x51')]];delete this[_0xca0b('0x12')][_0x1818f4[_0xca0b('0x51')]];}if(this[_0xca0b('0x17')][_0x1818f4[_0xca0b('0x51')]]){delete this[_0xca0b('0x17')][_0x1818f4[_0xca0b('0x51')]];}}}catch(_0x388660){logger[_0xca0b('0x3f')]('[%s][voiceQueueReport][hangup]',_0x1818f4[_0xca0b('0x51')],util[_0xca0b('0x43')](_0x388660,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xca0b('0xc')]['syncAttendedTransfer']=function(_0x2d9684){try{if(this[_0xca0b('0x64')](_0x2d9684)){logger[_0xca0b('0x61')](_0xca0b('0xd5'),_0x2d9684[_0xca0b('0x51')],util[_0xca0b('0x43')](_0x2d9684,{'showHidden':![],'depth':null}));var _0x30ef24;if(this[_0xca0b('0x41')][_0x2d9684[_0xca0b('0xd6')]]){_0x30ef24=_['last'](this[_0xca0b('0x41')][_0x2d9684[_0xca0b('0xd6')]]);_0x30ef24[_0xca0b('0xa2')]=_0x2d9684['secondtransfererexten'];_0x30ef24[_0xca0b('0xa4')]=_0x2d9684[_0xca0b('0xd7')];_0x30ef24[_0xca0b('0x84')]=_0xca0b('0xd8');_0x30ef24[_0xca0b('0x97')]=!![];_0x30ef24[_0xca0b('0xa0')]=_0xca0b('0xd9');if(this[_0xca0b('0x41')][_0x2d9684[_0xca0b('0xd7')]]){var _0x28fa5f=this[_0xca0b('0x41')][_0x2d9684[_0xca0b('0xd7')]];this[_0xca0b('0x41')][_0x2d9684['secondtransfereruniqueid']]=this['queueReports'][_0x2d9684['transfereeuniqueid']];this[_0xca0b('0x41')][_0x2d9684[_0xca0b('0xd6')]]=_0x28fa5f;var _0x3fd78e=_[_0xca0b('0x7f')](this[_0xca0b('0x41')][_0x2d9684['transfereeuniqueid']]);_0x3fd78e[_0xca0b('0x38')]=!![];}logger[_0xca0b('0x79')](_0xca0b('0xda'),_0x2d9684['uniqueid'],_0x30ef24['name'],_0x30ef24[_0xca0b('0x5b')],_0x30ef24['transferexten'],_0x30ef24['transferuniqueid']);}else if(this[_0xca0b('0x41')][_0x2d9684['transfertargetuniqueid']]){_0x30ef24=_[_0xca0b('0x7f')](this[_0xca0b('0x41')][_0x2d9684[_0xca0b('0xdb')]]);_0x30ef24[_0xca0b('0xa2')]=_0x2d9684['origtransfererexten'];_0x30ef24[_0xca0b('0xa4')]=_0x2d9684[_0xca0b('0xdc')];_0x30ef24[_0xca0b('0x84')]=_0xca0b('0xd8');_0x30ef24[_0xca0b('0x97')]=!![];_0x30ef24[_0xca0b('0xa0')]=_0xca0b('0xd9');if(this[_0xca0b('0x41')][_0x2d9684['origtransfereruniqueid']]){var _0x28fa5f=this['queueReports'][_0x2d9684[_0xca0b('0xdc')]];this[_0xca0b('0x41')][_0x2d9684[_0xca0b('0xdc')]]=this[_0xca0b('0x41')][_0x2d9684[_0xca0b('0xdb')]];this[_0xca0b('0x41')][_0x2d9684[_0xca0b('0xdb')]]=_0x28fa5f;var _0x3fd78e=_[_0xca0b('0x7f')](this['queueReports'][_0x2d9684[_0xca0b('0xdb')]]);_0x3fd78e[_0xca0b('0x38')]=!![];}logger[_0xca0b('0x79')](_0xca0b('0xda'),_0x2d9684[_0xca0b('0x51')],_0x30ef24[_0xca0b('0x4f')],_0x30ef24[_0xca0b('0x5b')],_0x30ef24['transferexten'],_0x30ef24['transferuniqueid']);}}}catch(_0x148cfc){logger[_0xca0b('0x3f')](_0xca0b('0xd5'),_0x2d9684[_0xca0b('0x51')],util['inspect'](_0x148cfc,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncBlindTransfer']=function(_0x6b23e7){try{if(this['isNotNull'](_0x6b23e7)){logger[_0xca0b('0x61')]('[%s][voiceQueueReport][blindtransfer]',_0x6b23e7['uniqueid'],util['inspect'](_0x6b23e7,{'showHidden':![],'depth':null}));if(this[_0xca0b('0x41')][_0x6b23e7[_0xca0b('0xd6')]]){var _0x53a080=_['last'](this[_0xca0b('0x41')][_0x6b23e7['transfereeuniqueid']]);_0x53a080[_0xca0b('0x84')]=_0xca0b('0xdd');_0x53a080[_0xca0b('0x97')]=!![];_0x53a080['transfertype']=_0xca0b('0xde');_0x53a080[_0xca0b('0xa2')]=_0x6b23e7[_0xca0b('0xdf')];_0x53a080[_0xca0b('0xa4')]=_0x6b23e7['transfereeuniqueid'];logger['info'](_0xca0b('0xe0'),_0x6b23e7[_0xca0b('0x51')],_0x53a080[_0xca0b('0x4f')],_0x53a080[_0xca0b('0x5b')],_0x53a080[_0xca0b('0xa2')],_0x53a080[_0xca0b('0xa4')]);this[_0xca0b('0xc5')]({'event':_0xca0b('0xe1'),'uniqueid':_0x6b23e7['transfereeuniqueid'],'context':_0x6b23e7['context'],'channel':_0x6b23e7['transfererchannel']});}}}catch(_0x9374fb){logger[_0xca0b('0x3f')]('[%s][voiceQueueReport][blindtransfer]',_0x6b23e7['uniqueid'],util[_0xca0b('0x43')](_0x9374fb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xca0b('0xc')]['syncMusicOnHoldStart']=function(_0x55d9d1){try{if(this[_0xca0b('0x64')](_0x55d9d1)){logger[_0xca0b('0x61')](_0xca0b('0xe2'),_0x55d9d1[_0xca0b('0x51')],util[_0xca0b('0x43')](_0x55d9d1,{'showHidden':![],'depth':null}));if(this[_0xca0b('0x41')][_0x55d9d1[_0xca0b('0x51')]]){var _0x3ba21c=_[_0xca0b('0x7f')](this[_0xca0b('0x41')][_0x55d9d1[_0xca0b('0x51')]]);if(!_[_0xca0b('0x39')](_0x3ba21c[_0xca0b('0x89')])){_0x3ba21c[_0xca0b('0xe3')]=moment()[_0xca0b('0x4d')](_0xca0b('0x83'));logger[_0xca0b('0x79')](_0xca0b('0xe4'),_0x55d9d1['uniqueid'],_0x3ba21c[_0xca0b('0xe3')]);}}}}catch(_0x5584bb){logger[_0xca0b('0x3f')](_0xca0b('0xe2'),_0x55d9d1[_0xca0b('0x51')],util[_0xca0b('0x43')](_0x5584bb,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xca0b('0x2b')]=function(_0x1af921){try{if(this[_0xca0b('0x64')](_0x1af921)){logger[_0xca0b('0x61')](_0xca0b('0xe5'),_0x1af921['uniqueid'],util[_0xca0b('0x43')](_0x1af921,{'showHidden':![],'depth':null}));if(this[_0xca0b('0x41')][_0x1af921[_0xca0b('0x51')]]){var _0x2a529a=_['last'](this[_0xca0b('0x41')][_0x1af921['uniqueid']]);if(!_['isNil'](_0x2a529a[_0xca0b('0xe3')])){_0x2a529a['mohtime']+=moment()[_0xca0b('0xca')](0x0)[_0xca0b('0xcc')](_0x2a529a[_0xca0b('0xe3')],_0xca0b('0x9f'));logger[_0xca0b('0x79')](_0xca0b('0xe6'),_0x1af921[_0xca0b('0x51')],_0x2a529a[_0xca0b('0xe7')]);delete _0x2a529a[_0xca0b('0xe3')];}}}}catch(_0x1645f2){logger['error']('[%s][voiceQueueReport][musiconholdstop]',_0x1af921['uniqueid'],util[_0xca0b('0x43')](_0x1645f2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xca0b('0xc')][_0xca0b('0x28')]=function(_0x27c84b){try{if(this[_0xca0b('0x64')](_0x27c84b)){logger['debug'](_0xca0b('0xe8'),_0x27c84b[_0xca0b('0x51')],util[_0xca0b('0x43')](_0x27c84b,{'showHidden':![],'depth':null}));if(_0x27c84b[_0xca0b('0xe9')][_0xca0b('0x9b')]()==='set'){_0x27c84b[_0xca0b('0xea')]=_0x27c84b[_0xca0b('0xeb')]&&_0x27c84b[_0xca0b('0xeb')][_0xca0b('0x9a')]('CDR(routeAlias)')?_0x27c84b['appdata']:(_0x27c84b[_0xca0b('0xeb')]||_0x27c84b[_0xca0b('0xea')])[_0xca0b('0x9b')]();if(_['startsWith'](_0x27c84b['applicationdata']['toLowerCase'](),_0xca0b('0xec'))){logger[_0xca0b('0x79')](_0xca0b('0xed'),_0x27c84b[_0xca0b('0x51')],_0x27c84b[_0xca0b('0xe9')],_0x27c84b[_0xca0b('0xea')]);if(_[_0xca0b('0x65')](this[_0xca0b('0x12')][_0x27c84b[_0xca0b('0x51')]]))this[_0xca0b('0x12')][_0x27c84b[_0xca0b('0x51')]]={};var _0x12e2cd=_0x27c84b['applicationdata'][_0xca0b('0xee')]('=');var _0x2d4554=_0x12e2cd[0x0][_0xca0b('0x9b')]()['match'](/cdr\((.*)\)/);if(_0x2d4554)this[_0xca0b('0x12')][_0x27c84b['uniqueid']][_0x2d4554[0x1]]=_0x12e2cd[0x1];}}}}catch(_0x1c194e){logger['error'](_0xca0b('0xef'),_0x27c84b[_0xca0b('0x51')],util[_0xca0b('0x43')](_0x1c194e,{'showHidden':![],'depth':null}));}};module[_0xca0b('0xf0')]=VoiceQueueReport;
\ No newline at end of file
+var _0x8d97=['waiting','toNumber','callers','loggedin','available','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','isUndefined','queuecallerjoinAt','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','pick','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitreason','ABANDONED','lastAssignedTo','[%s][voiceQueueReport][queuecallerabandon]','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','membername','transfer','reason','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','queuecallerexit','add','FORWARDTRANSFER','transfertype','FORWARD','destexten','transferuniqueid','COMPLETEDBY','toUpperCase','[%s][voiceQueueReport][varset]','keys','variable','queuestatus','value','CONTINUE','queuecallerexitAt','TIMEOUT','lastevent','timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','[%s][voiceQueueReport][hangup]','abandoned','seconds','length','milliseconds','diff','total','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','transferexten','origtransfereruniqueid','[%s][voiceQueueReport][attendedtransfer]','syncBlindTransfer','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','match','[%s][voiceQueueReport][newexten]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','prototype','enqueue','tail','sequence','queueReports','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','newexten','syncNewExten','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','isEmpty','hasOwnProperty','originated','talking','pTalking','unlockRR','clearZombieChannels','switch','isNil','Action','status','channel','catch','message','No\x20such\x20channel','[%s][voiceQueueReport][checkChannel]','[%s][voiceQueueReport][checkQueueReport]','inspect','error','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','agents','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','name','voice_queue_channel:save','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:remove\x20event:','voice_queue_channel:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','loggedIn','sumBillable','sumDuration','sumHoldTime','unmanaged','Trunk','active','callerid','Interval','md5','[voiceQueueReport][','voice_queue:save','isNotNull','queues','[voiceQueueReport][queues]','loopQueueSummary','then','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','queue','countBy'];(function(_0x5ad6f9,_0x4729a3){var _0x5a90fd=function(_0x247973){while(--_0x247973){_0x5ad6f9['push'](_0x5ad6f9['shift']());}};_0x5a90fd(++_0x4729a3);}(_0x8d97,0x82));var _0x78d9=function(_0x2c326d,_0x40810f){_0x2c326d=_0x2c326d-0x0;var _0x397af0=_0x8d97[_0x2c326d];return _0x397af0;};'use strict';var _=require('lodash');var moment=require(_0x78d9('0x0'));var util=require(_0x78d9('0x1'));var md5=require('md5');var Redis=require(_0x78d9('0x2'));var config=require(_0x78d9('0x3'));var logger=require(_0x78d9('0x4'))(_0x78d9('0x5'));var ami=require(_0x78d9('0x6'));var QueueReport=require('../model/queueReport');config[_0x78d9('0x7')]=_[_0x78d9('0x8')](config[_0x78d9('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x78d9('0x9')][_0x78d9('0xa')]=function(_0x36b8f5){this[_0x78d9('0xb')]=this[_0x78d9('0xb')]?this[_0x78d9('0xb')]['finally'](_0x36b8f5):_0x36b8f5();};function VoiceQueueReport(_0x1a1453){this[_0x78d9('0xc')]=new Sequence();this[_0x78d9('0xd')]={};this['agents']=_0x1a1453['agents'];this[_0x78d9('0xe')]=_0x1a1453[_0x78d9('0xf')];this[_0x78d9('0x10')]=_0x1a1453[_0x78d9('0x10')];this[_0x78d9('0x11')]=!![];this[_0x78d9('0x12')]=_0x1a1453['campaigns'];this[_0x78d9('0x13')]={};ami['on'](_0x78d9('0x14'),this[_0x78d9('0x15')][_0x78d9('0x16')](this));ami['on'](_0x78d9('0x17'),this[_0x78d9('0x18')][_0x78d9('0x16')](this));ami['on'](_0x78d9('0x19'),this[_0x78d9('0x1a')][_0x78d9('0x16')](this));ami['on'](_0x78d9('0x1b'),this[_0x78d9('0x1c')][_0x78d9('0x16')](this));ami['on'](_0x78d9('0x1d'),this[_0x78d9('0x1e')][_0x78d9('0x16')](this));ami['on'](_0x78d9('0x1f'),this['syncAgentComplete'][_0x78d9('0x16')](this));ami['on'](_0x78d9('0x20'),this[_0x78d9('0x21')][_0x78d9('0x16')](this));ami['on'](_0x78d9('0x22'),this[_0x78d9('0x23')][_0x78d9('0x16')](this));ami['on'](_0x78d9('0x24'),this[_0x78d9('0x25')][_0x78d9('0x16')](this));ami['on'](_0x78d9('0x26'),this[_0x78d9('0x27')][_0x78d9('0x16')](this));ami['on'](_0x78d9('0x28'),this[_0x78d9('0x29')][_0x78d9('0x16')](this));ami['on']('musiconholdstart',this[_0x78d9('0x2a')][_0x78d9('0x16')](this));ami['on'](_0x78d9('0x2b'),this[_0x78d9('0x2c')]['bind'](this));ami['on'](_0x78d9('0x2d'),this[_0x78d9('0x2e')][_0x78d9('0x16')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x78d9('0x16')](this));this['loopQueueSummary']();this['loopQueueShow']();}function clearChannels(_0x4802f4){if(!_[_0x78d9('0x2f')](_0x4802f4)){for(var _0x1fa9a1 in _0x4802f4){if(_0x4802f4[_0x78d9('0x30')](_0x1fa9a1)){delete _0x4802f4[_0x1fa9a1];}}}}function clearCampaigns(_0xacd80c){if(!_[_0x78d9('0x2f')](_0xacd80c)){for(var _0x17db22 in _0xacd80c){if(_0xacd80c['hasOwnProperty'](_0x17db22)){_0xacd80c[_0x17db22][_0x78d9('0x31')]=0x0;}}}}function clearVoiceQueues(_0x53a0ab){if(!_[_0x78d9('0x2f')](_0x53a0ab)){for(var _0x3d9a53 in _0x53a0ab){if(_0x53a0ab[_0x78d9('0x30')](_0x3d9a53)){_0x53a0ab[_0x3d9a53]['originated']=0x0;_0x53a0ab[_0x3d9a53][_0x78d9('0x32')]=0x0;_0x53a0ab[_0x3d9a53][_0x78d9('0x33')]=0x0;_0x53a0ab[_0x3d9a53]['waiting']=0x0;_0x53a0ab[_0x3d9a53]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x55617c){if(!_['isEmpty'](_0x55617c)){for(var _0x1e4f67 in _0x55617c){if(_0x55617c[_0x78d9('0x30')](_0x1e4f67)){_0x55617c[_0x1e4f67][_0x78d9('0x34')]=!![];}}}}VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0x35')]=function(){var _0x3fe42b=this;for(var _0x457cc9 in this[_0x78d9('0xe')]){if(this[_0x78d9('0xe')][_0x78d9('0x30')](_0x457cc9)&&!this['channels'][_0x457cc9][_0x78d9('0x36')]){this['sequence']['enqueue'](function(){if(!_[_0x78d9('0x37')](_0x3fe42b[_0x78d9('0xe')][_0x457cc9])){return ami[_0x78d9('0x38')]({'action':_0x78d9('0x39'),'channel':_0x3fe42b[_0x78d9('0xe')][_0x457cc9][_0x78d9('0x3a')]})[_0x78d9('0x3b')](function(_0x5cc2c0){if(_0x5cc2c0[_0x78d9('0x3c')]===_0x78d9('0x3d')){setTimeout(function(){if(_0x3fe42b[_0x78d9('0xe')][_0x457cc9]){delete _0x3fe42b[_0x78d9('0xe')][_0x457cc9];logger['error'](_0x78d9('0x3e'),_0x457cc9,util['inspect'](_0x5cc2c0,{'showHidden':![],'depth':null}));}if(_0x3fe42b['queueReports'][_0x457cc9]){delete _0x3fe42b['queueReports'][_0x457cc9];logger['error'](_0x78d9('0x3f'),_0x457cc9,util[_0x78d9('0x40')](_0x5cc2c0,{'showHidden':![],'depth':null}));}if(_0x3fe42b[_0x78d9('0x13')][_0x457cc9]){delete _0x3fe42b[_0x78d9('0x13')][_0x457cc9];logger[_0x78d9('0x41')](_0x78d9('0x42'),_0x457cc9,util[_0x78d9('0x40')](_0x5cc2c0,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0x27')]=function(){logger[_0x78d9('0x41')](_0x78d9('0x43'));clearChannels(this[_0x78d9('0xe')]);this[_0x78d9('0x44')](this[_0x78d9('0xd')]);clearAgentBooked(this[_0x78d9('0x45')]);clearVoiceQueues(this[_0x78d9('0x10')]);clearCampaigns(this[_0x78d9('0x12')]);};VoiceQueueReport[_0x78d9('0x9')]['clearQueueReport']=function(_0x4cd79e){var _0x2ca911=this;if(!_[_0x78d9('0x2f')](_0x4cd79e)){for(var _0x14e404 in _0x4cd79e){if(_0x4cd79e[_0x78d9('0x30')](_0x14e404)){_0x2ca911[_0x78d9('0x46')](_0x4cd79e[_0x14e404],_0x78d9('0x47'));delete _0x4cd79e[_0x14e404];}}}};VoiceQueueReport['prototype'][_0x78d9('0x48')]=function(_0x364ac1,_0x2dc5f2,_0x237818){io['to'](_0x364ac1)[_0x78d9('0x48')](_0x2dc5f2,_0x237818);};VoiceQueueReport['prototype'][_0x78d9('0x49')]=function(_0x3ec28a,_0x1863d2){logger[_0x78d9('0x4a')]('[%s][voiceQueueReport]['+_0x1863d2+_0x78d9('0x4b'),_0x3ec28a[_0x78d9('0x4c')],util[_0x78d9('0x40')](_0x3ec28a,{'showHidden':![],'depth':null}));this[_0x78d9('0x48')](util[_0x78d9('0x4d')](_0x78d9('0x4e'),_0x3ec28a[_0x78d9('0x4f')]),_0x78d9('0x50'),_0x3ec28a);io[_0x78d9('0x48')]('voice_queue_presence:save',_0x3ec28a);};VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0x46')]=function(_0x5c7854,_0xc4e054){logger[_0x78d9('0x4a')](_0x78d9('0x51')+_0xc4e054+_0x78d9('0x52'),_0x5c7854[_0x78d9('0x4c')],util[_0x78d9('0x40')](_0x5c7854,{'showHidden':![],'depth':null}));this[_0x78d9('0x48')](util[_0x78d9('0x4d')]('voice:queue:%s',_0x5c7854['name']),_0x78d9('0x53'),_0x5c7854);io[_0x78d9('0x48')]('voice_queue_presence:remove',_0x5c7854);};VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0x54')]=function(_0x3ddf56,_0x347c33){if(_0x3ddf56[_0x78d9('0x55')]===_0x78d9('0x56')){var _0x302aa4={'id':_0x3ddf56['id'],'name':_0x3ddf56[_0x78d9('0x4f')],'strategy':_0x3ddf56[_0x78d9('0x57')],'answered':_0x3ddf56[_0x78d9('0x58')],'available':_0x3ddf56['available'],'loggedIn':_0x3ddf56[_0x78d9('0x59')],'pTalking':_0x3ddf56[_0x78d9('0x33')],'sumBillable':_0x3ddf56[_0x78d9('0x5a')],'sumDuration':_0x3ddf56[_0x78d9('0x5b')],'sumHoldTime':_0x3ddf56[_0x78d9('0x5c')]||0x0,'talking':_0x3ddf56['talking'],'total':_0x3ddf56['total'],'type':_0x3ddf56[_0x78d9('0x55')],'unmanaged':_0x3ddf56[_0x78d9('0x5d')],'abandoned':_0x3ddf56['abandoned'],'waiting':_0x3ddf56['waiting']};if(_0x3ddf56[_0x78d9('0x5e')]){_0x302aa4['Trunk']={'id':_0x3ddf56[_0x78d9('0x5e')]['id'],'name':_0x3ddf56[_0x78d9('0x5e')][_0x78d9('0x4f')],'active':_0x3ddf56[_0x78d9('0x5e')][_0x78d9('0x5f')],'callerid':_0x3ddf56[_0x78d9('0x5e')][_0x78d9('0x60')]};}if(_0x3ddf56[_0x78d9('0x61')]){_0x302aa4[_0x78d9('0x61')]={'id':_0x3ddf56[_0x78d9('0x61')]['id'],'name':_0x3ddf56[_0x78d9('0x61')]['name']};}var _0x3265a2=md5(JSON['stringify'](_0x302aa4));if(_0x3ddf56[_0x78d9('0x62')]!==_0x3265a2){_0x3ddf56[_0x78d9('0x62')]=_0x3265a2;logger[_0x78d9('0x4a')](_0x78d9('0x63')+_0x347c33+']\x20sending\x20voice_queue:save\x20event:',util[_0x78d9('0x40')](_0x302aa4,{'showHidden':![],'depth':null}));this['emit'](util['format']('voice:queue:%s',_0x302aa4[_0x78d9('0x4f')]),_0x78d9('0x64'),_0x302aa4);}}};VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0x65')]=function(_0xae58bb){return _0xae58bb!==null&&!_['isUndefined'](_0xae58bb);};VoiceQueueReport[_0x78d9('0x9')]['loopQueueShow']=function(){var _0x351d4a=this;setInterval(function(){_0x351d4a[_0x78d9('0x35')]();ami[_0x78d9('0x38')]({'action':_0x78d9('0x66')})['catch'](function(_0x57a741){logger[_0x78d9('0x41')](_0x78d9('0x67'),util[_0x78d9('0x40')](_0x57a741,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0x68')]=function(){var _0x176ba0=this;setInterval(function(){if(_0x176ba0[_0x78d9('0x11')]){return ami[_0x78d9('0x38')]({'action':_0x78d9('0x14')})[_0x78d9('0x69')](function(_0x468a4b){_0x176ba0[_0x78d9('0x11')]=![];})['catch'](function(_0xa9e1eb){logger[_0x78d9('0x41')](_0x78d9('0x6a'),util[_0x78d9('0x40')](_0xa9e1eb,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype'][_0x78d9('0x15')]=function(_0x42c3b9){try{if(this['isNotNull'](_0x42c3b9)&&this[_0x78d9('0x65')](_0x42c3b9['queue'])){logger['debug'](_0x78d9('0x6b'),util[_0x78d9('0x40')](_0x42c3b9,{'showHidden':![],'depth':null}));if(this[_0x78d9('0x10')][_0x42c3b9['queue']]){logger[_0x78d9('0x6c')](_0x78d9('0x6d'),_0x42c3b9[_0x78d9('0x6e')]);var _0x4c370c=_[_0x78d9('0x6f')](this['channels'],_0x78d9('0x6e'))[_0x42c3b9[_0x78d9('0x6e')]]||0x0;var _0x20f545=_0x4c370c-_0x42c3b9['callers'];if(this['voiceQueues'][_0x42c3b9[_0x78d9('0x6e')]][_0x78d9('0x70')]!==_[_0x78d9('0x71')](_0x42c3b9[_0x78d9('0x72')])||this['voiceQueues'][_0x42c3b9['queue']][_0x78d9('0x59')]!==_[_0x78d9('0x71')](_0x42c3b9[_0x78d9('0x73')])||this['voiceQueues'][_0x42c3b9['queue']][_0x78d9('0x74')]!==_[_0x78d9('0x71')](_0x42c3b9[_0x78d9('0x74')])||this[_0x78d9('0x10')][_0x42c3b9[_0x78d9('0x6e')]]['talking']!==_0x20f545){this[_0x78d9('0x10')][_0x42c3b9[_0x78d9('0x6e')]]['waiting']=_[_0x78d9('0x71')](_0x42c3b9[_0x78d9('0x72')]);this[_0x78d9('0x10')][_0x42c3b9[_0x78d9('0x6e')]][_0x78d9('0x59')]=_[_0x78d9('0x71')](_0x42c3b9[_0x78d9('0x73')]);this[_0x78d9('0x10')][_0x42c3b9[_0x78d9('0x6e')]][_0x78d9('0x74')]=_[_0x78d9('0x71')](_0x42c3b9[_0x78d9('0x74')]);this[_0x78d9('0x10')][_0x42c3b9[_0x78d9('0x6e')]][_0x78d9('0x32')]=_0x20f545>0x0?_0x20f545:0x0;this[_0x78d9('0x10')][_0x42c3b9[_0x78d9('0x6e')]][_0x78d9('0x32')]=this[_0x78d9('0x10')][_0x42c3b9[_0x78d9('0x6e')]]['talking']>_[_0x78d9('0x71')](_0x42c3b9[_0x78d9('0x73')])?_['toNumber'](_0x42c3b9[_0x78d9('0x73')]):this[_0x78d9('0x10')][_0x42c3b9[_0x78d9('0x6e')]][_0x78d9('0x32')];this['emitVoiceQueueSummary'](this[_0x78d9('0x10')][_0x42c3b9['queue']],_0x78d9('0x14'));}logger[_0x78d9('0x4a')](_0x78d9('0x75'),util[_0x78d9('0x40')](this[_0x78d9('0x10')][_0x42c3b9[_0x78d9('0x6e')]],{'showHidden':![],'depth':null}));ami[_0x78d9('0x48')](_0x78d9('0x76'),this['voiceQueues'][_0x42c3b9['queue']]);}}}catch(_0x4589de){logger['error'](_0x78d9('0x6a'),util['inspect'](_0x4589de,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0x18')]=function(_0x5e6af7){logger[_0x78d9('0x4a')](_0x78d9('0x77'),util[_0x78d9('0x40')](_0x5e6af7,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0x1a')]=function(_0x538322){try{if(this[_0x78d9('0x65')](_0x538322)){logger[_0x78d9('0x4a')](_0x78d9('0x78'),_0x538322[_0x78d9('0x4c')],util['inspect'](_0x538322,{'showHidden':![],'depth':null}));if(_[_0x78d9('0x79')](this[_0x78d9('0xd')][_0x538322[_0x78d9('0x4c')]]))this[_0x78d9('0xd')][_0x538322[_0x78d9('0x4c')]]=[];if(_[_0x78d9('0x79')](this[_0x78d9('0xe')][_0x538322[_0x78d9('0x4c')]]))this[_0x78d9('0xe')][_0x538322['uniqueid']]={};var _0x5ae238=new QueueReport();_0x5ae238[_0x78d9('0x4f')]=_0x538322[_0x78d9('0x6e')];_0x5ae238[_0x78d9('0x55')]=this[_0x78d9('0x10')][_0x5ae238[_0x78d9('0x4f')]]&&this[_0x78d9('0x10')][_0x5ae238[_0x78d9('0x4f')]]['type']?this[_0x78d9('0x10')][_0x5ae238[_0x78d9('0x4f')]][_0x78d9('0x55')]||_0x78d9('0x56'):_0x78d9('0x56');_0x5ae238[_0x78d9('0x6e')]=_0x538322[_0x78d9('0x6e')];_0x5ae238[_0x78d9('0x7a')]=moment()[_0x78d9('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x5ae238[_0x78d9('0x7b')]=_0x538322['position'];_0x5ae238[_0x78d9('0x7c')]=_0x538322['count'];_0x5ae238['uniqueid']=_0x538322[_0x78d9('0x4c')];_0x5ae238[_0x78d9('0x7d')]=this[_0x78d9('0xe')][_0x538322[_0x78d9('0x4c')]][_0x78d9('0x7d')];logger['info'](_0x78d9('0x7e'),_0x5ae238['name'],_0x5ae238[_0x78d9('0x55')]);_['merge'](_0x5ae238,_[_0x78d9('0x7f')](_0x538322,_['keys'](_0x5ae238)));this[_0x78d9('0xd')][_0x538322[_0x78d9('0x4c')]]['push'](_0x5ae238);this['channels'][_0x538322[_0x78d9('0x4c')]]=_0x5ae238;this[_0x78d9('0x49')](_0x5ae238,_0x78d9('0x19'));}}catch(_0x2c9007){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0x538322['uniqueid'],util[_0x78d9('0x40')](_0x2c9007,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0x1c')]=function(_0x25bf3b){try{if(this['isNotNull'](_0x25bf3b)){logger[_0x78d9('0x4a')]('[%s][voiceQueueReport][queuecallerabandon]',_0x25bf3b['uniqueid'],util[_0x78d9('0x40')](_0x25bf3b,{'showHidden':![],'depth':null}));if(this[_0x78d9('0xd')][_0x25bf3b[_0x78d9('0x4c')]]){var _0x238cd9=_[_0x78d9('0x80')](this[_0x78d9('0xd')][_0x25bf3b[_0x78d9('0x4c')]]);_0x238cd9[_0x78d9('0x81')]=![];_0x238cd9[_0x78d9('0x82')]=null;_0x238cd9[_0x78d9('0x83')]=_0x25bf3b[_0x78d9('0x83')];_0x238cd9[_0x78d9('0x84')]=_0x25bf3b[_0x78d9('0x84')];_0x238cd9[_0x78d9('0x1b')]=!![];_0x238cd9[_0x78d9('0x85')]=moment()[_0x78d9('0x4d')](_0x78d9('0x86'));_0x238cd9[_0x78d9('0x87')]=_0x78d9('0x88');_0x238cd9[_0x78d9('0x89')]=null;logger[_0x78d9('0x6c')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x238cd9[_0x78d9('0x4f')],_0x238cd9[_0x78d9('0x55')]);this[_0x78d9('0xe')][_0x25bf3b[_0x78d9('0x4c')]]=_0x238cd9;this[_0x78d9('0x46')](_0x238cd9,_0x78d9('0x1b'));}}}catch(_0x4a64c9){logger[_0x78d9('0x41')](_0x78d9('0x8a'),_0x25bf3b['uniqueid'],util['inspect'](_0x4a64c9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0x1e')]=function(_0x176aac){try{if(this[_0x78d9('0x65')](_0x176aac)){logger['debug'](_0x78d9('0x8b'),_0x176aac['uniqueid'],util[_0x78d9('0x40')](_0x176aac,{'showHidden':![],'depth':null}));if(this[_0x78d9('0xd')][_0x176aac[_0x78d9('0x4c')]]){var _0x37f51a=_[_0x78d9('0x80')](this['queueReports'][_0x176aac[_0x78d9('0x4c')]]);_0x37f51a[_0x78d9('0x8c')]=moment()['format'](_0x78d9('0x86'));_0x37f51a[_0x78d9('0x8d')]=_0x176aac[_0x78d9('0x8d')];_0x37f51a['connectedlinename']=_0x176aac['connectedlinename'];logger['info'](_0x78d9('0x8e'),_0x37f51a['name'],_0x37f51a['type'],_0x176aac[_0x78d9('0x8d')],_0x176aac[_0x78d9('0x8f')]);this[_0x78d9('0xe')][_0x176aac['uniqueid']]=_0x37f51a;this['emitVoiceQueueChannelSave'](_0x37f51a,_0x78d9('0x1d'));}}}catch(_0x3eee2e){logger['error'](_0x78d9('0x8b'),_0x176aac[_0x78d9('0x4c')],util['inspect'](_0x3eee2e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0x21')]=function(_0xed29b5){try{if(this[_0x78d9('0x65')](_0xed29b5)){logger[_0x78d9('0x4a')](_0x78d9('0x90'),_0xed29b5[_0x78d9('0x4c')],util[_0x78d9('0x40')](_0xed29b5,{'showHidden':![],'depth':null}));if(this[_0x78d9('0xd')][_0xed29b5['uniqueid']]){var _0x1533ae=_[_0x78d9('0x80')](this['queueReports'][_0xed29b5[_0x78d9('0x4c')]]);_0x1533ae[_0x78d9('0x81')]=!![];_0x1533ae[_0x78d9('0x87')]=_0x78d9('0x91');logger[_0x78d9('0x6c')](_0x78d9('0x92'),_0x1533ae[_0x78d9('0x4f')],_0x1533ae[_0x78d9('0x55')]);}}}catch(_0x5533b2){logger[_0x78d9('0x41')]('[%s][voiceQueueReport][agentconnect]',_0xed29b5[_0x78d9('0x4c')],util[_0x78d9('0x40')](_0x5533b2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x9')]['syncAgentComplete']=function(_0x1ba4fe){try{if(this[_0x78d9('0x65')](_0x1ba4fe)){logger[_0x78d9('0x4a')](_0x78d9('0x93'),_0x1ba4fe[_0x78d9('0x4c')],util[_0x78d9('0x40')](_0x1ba4fe,{'showHidden':![],'depth':null}));if(this[_0x78d9('0xd')][_0x1ba4fe[_0x78d9('0x4c')]]){var _0x36c101=_[_0x78d9('0x80')](this[_0x78d9('0xd')][_0x1ba4fe[_0x78d9('0x4c')]]);_0x36c101[_0x78d9('0x1b')]=![];_0x36c101[_0x78d9('0x85')]=null;_0x36c101[_0x78d9('0x94')]=!![];_0x36c101[_0x78d9('0x89')]=_0x1ba4fe[_0x78d9('0x95')];_0x36c101[_0x78d9('0x83')]=_0x1ba4fe[_0x78d9('0x83')];_0x36c101[_0x78d9('0x81')]=!![];_0x36c101['queuecallerexit']=![];_0x36c101['queuecallerexitAt']=null;if(!_0x36c101[_0x78d9('0x96')]){if(_0x1ba4fe[_0x78d9('0x97')]=='transfer'){_0x36c101[_0x78d9('0x87')]='COMPLETED';logger[_0x78d9('0x6c')](_0x78d9('0x98'),_0x36c101[_0x78d9('0x4f')],_0x36c101[_0x78d9('0x55')]);}else{if(_[_0x78d9('0x99')](_0x1ba4fe['channel'][_0x78d9('0x9a')](),_0x78d9('0x9b'))){if(this['queueReports'][_0x1ba4fe[_0x78d9('0x9c')]]){var _0x445078=_[_0x78d9('0x80')](this['queueReports'][_0x1ba4fe[_0x78d9('0x9c')]]);_0x445078[_0x78d9('0x81')]=![];_0x445078[_0x78d9('0x9d')]=!![];_0x445078['queuecallerexitAt']=moment(_0x36c101[_0x78d9('0x7a')])[_0x78d9('0x9e')](_0x1ba4fe[_0x78d9('0x83')],'seconds')['format'](_0x78d9('0x86'));_0x445078[_0x78d9('0x87')]=_0x78d9('0x9f');_0x445078[_0x78d9('0x96')]=!![];_0x445078[_0x78d9('0xa0')]=_0x78d9('0xa1');_0x445078['transferexten']=_0x1ba4fe[_0x78d9('0xa2')];_0x445078[_0x78d9('0xa3')]=_0x1ba4fe['uniqueid'];logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x445078['name'],_0x445078[_0x78d9('0x55')]);var _0x2ccf0e=this[_0x78d9('0xd')][_0x1ba4fe[_0x78d9('0x9c')]];this[_0x78d9('0xd')][_0x1ba4fe[_0x78d9('0x9c')]]=this[_0x78d9('0xd')][_0x1ba4fe[_0x78d9('0x4c')]];this['queueReports'][_0x1ba4fe[_0x78d9('0x4c')]]=_0x2ccf0e;}}else{_0x36c101['queuecallerexitreason']=_0x78d9('0xa4')+_0x1ba4fe[_0x78d9('0x97')][_0x78d9('0xa5')]();logger[_0x78d9('0x6c')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x36c101['name'],_0x36c101[_0x78d9('0x55')],_0x36c101[_0x78d9('0x87')]);}}}this[_0x78d9('0xe')][_0x1ba4fe['uniqueid']]=_0x36c101;this[_0x78d9('0x46')](_0x36c101,_0x78d9('0x1f'));}}}catch(_0x202b34){logger[_0x78d9('0x41')](_0x78d9('0x93'),_0x1ba4fe[_0x78d9('0x4c')],util[_0x78d9('0x40')](_0x202b34,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0x23')]=function(_0xf52cb6){try{if(this[_0x78d9('0x65')](_0xf52cb6)){logger[_0x78d9('0x4a')](_0x78d9('0xa6'),_0xf52cb6[_0x78d9('0x4c')],util['inspect'](_0xf52cb6,{'showHidden':![],'depth':null}));this['addVariable'](_0xf52cb6[_0x78d9('0x4c')],_[_0x78d9('0xa7')](_0xf52cb6['variable'])[0x0],_0xf52cb6['value']);if(this[_0x78d9('0xd')][_0xf52cb6[_0x78d9('0x4c')]]){var _0x329d0f=_['last'](this['queueReports'][_0xf52cb6[_0x78d9('0x4c')]]);if(_0x329d0f){if(this['isNotNull'](_0xf52cb6[_0x78d9('0xa8')])&&this['isNotNull'](_0xf52cb6[_0x78d9('0xa8')][_0x78d9('0xa9')])){switch(_0xf52cb6[_0x78d9('0xaa')]){case _0x78d9('0xab'):_0x329d0f[_0x78d9('0x9d')]=![];_0x329d0f[_0x78d9('0xac')]=null;break;case _0x78d9('0xad'):_0x329d0f[_0x78d9('0xae')]=_0x78d9('0xaf');_0x329d0f[_0x78d9('0x9d')]=!![];_0x329d0f[_0x78d9('0xac')]=moment()[_0x78d9('0x4d')](_0x78d9('0x86'));_0x329d0f['queuecallerleaveAt']=moment()[_0x78d9('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0xf52cb6[_0x78d9('0x4c')],util[_0x78d9('0x40')](_0x329d0f,{'showHidden':![],'depth':null}));ami[_0x78d9('0x48')]('custom:timeout',_0x329d0f);break;default:_0x329d0f[_0x78d9('0x9d')]=!![];_0x329d0f[_0x78d9('0xac')]=moment()[_0x78d9('0x4d')](_0x78d9('0x86'));_0x329d0f['queuecallerleaveAt']=moment()[_0x78d9('0x4d')](_0x78d9('0x86'));}_0x329d0f[_0x78d9('0x1b')]=![];_0x329d0f['queuecallerabandonAt']=null;_0x329d0f[_0x78d9('0x87')]=_0xf52cb6[_0x78d9('0xaa')];this['channels'][_0xf52cb6[_0x78d9('0x4c')]]=_0x329d0f;this['emitVoiceQueueChannelRemove'](_0x329d0f,_0x78d9('0x22'));}else if(this[_0x78d9('0x65')](_0xf52cb6[_0x78d9('0xa8')])&&this[_0x78d9('0x65')](_0xf52cb6['variable'][_0x78d9('0xb0')])){if(!_0x329d0f['queuecallerabandon']){_0x329d0f[_0x78d9('0x9d')]=!![];_0x329d0f[_0x78d9('0xac')]=moment()[_0x78d9('0x4d')](_0x78d9('0x86'));_0x329d0f[_0x78d9('0x87')]=_0x78d9('0xb1');_0x329d0f[_0x78d9('0x8c')]=moment()[_0x78d9('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x78d9('0xe')][_0xf52cb6[_0x78d9('0x4c')]]=_0x329d0f;}}logger[_0x78d9('0x6c')](_0x78d9('0xb2'),_0xf52cb6[_0x78d9('0x4c')],_0x329d0f['name'],_0x329d0f[_0x78d9('0x55')],_[_0x78d9('0xa7')](_0xf52cb6[_0x78d9('0xa8')])[0x0],_0xf52cb6['value']);_0x329d0f[_0x78d9('0x13')]=this[_0x78d9('0x13')][_0xf52cb6[_0x78d9('0x4c')]];}}}}catch(_0x15c943){logger[_0x78d9('0x41')]('[%s][voiceQueueReport][varset]',_0xf52cb6[_0x78d9('0x4c')],util[_0x78d9('0x40')](_0x15c943,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0xb3')]=function(_0x20d81a,_0x3ae8b7,_0x1cb775){var _0x4dfeec=[_0x78d9('0xb4'),_0x78d9('0xb5'),'rtpaudioqosjitter',_0x78d9('0xb6'),_0x78d9('0xb7'),_0x78d9('0xb8'),_0x78d9('0xb9'),_0x78d9('0xba'),_0x78d9('0xbb'),_0x78d9('0xbc'),_0x78d9('0xbd'),_0x78d9('0xbe'),_0x78d9('0xbf'),_0x78d9('0xc0'),_0x78d9('0xc1'),_0x78d9('0xc2'),_0x78d9('0x95'),_0x78d9('0xc3'),_0x78d9('0xc4')];if(!_[_0x78d9('0x37')](_0x3ae8b7)&&!_['includes'](_0x4dfeec,_0x3ae8b7)){if(_[_0x78d9('0x79')](this[_0x78d9('0x13')][_0x20d81a])){this['variables'][_0x20d81a]={};}this['variables'][_0x20d81a][_0x3ae8b7]=_0x1cb775;}};VoiceQueueReport['prototype'][_0x78d9('0x25')]=function(_0xb4ee3f){try{if(this[_0x78d9('0x65')](_0xb4ee3f)){logger[_0x78d9('0x4a')](_0x78d9('0xc5'),_0xb4ee3f[_0x78d9('0x4c')],util['inspect'](_0xb4ee3f,{'showHidden':![],'depth':null}));if(this[_0x78d9('0xd')][_0xb4ee3f[_0x78d9('0x4c')]]){for(var _0x46e300=0x0,_0x2f0905={};_0x46e300<this[_0x78d9('0xd')][_0xb4ee3f['uniqueid']]['length'];_0x46e300+=0x1){_0x2f0905=this[_0x78d9('0xd')][_0xb4ee3f[_0x78d9('0x4c')]][_0x46e300];if(this[_0x78d9('0x10')][_0x2f0905[_0x78d9('0x6e')]]){if(_0x2f0905[_0x78d9('0x9d')]&&_0x2f0905[_0x78d9('0x96')]!=!![]){this[_0x78d9('0x10')][_0x2f0905[_0x78d9('0x6e')]][_0x78d9('0x5d')]+=0x1;}if(_0x2f0905[_0x78d9('0x1b')]){this[_0x78d9('0x10')][_0x2f0905[_0x78d9('0x6e')]][_0x78d9('0xc6')]+=0x1;}this['voiceQueues'][_0x2f0905[_0x78d9('0x6e')]][_0x78d9('0x5c')]+=moment(_0x2f0905[_0x78d9('0x8c')])['diff'](_0x2f0905[_0x78d9('0x7a')],_0x78d9('0xc7'))||0x0;if(_0x46e300===this['queueReports'][_0xb4ee3f['uniqueid']][_0x78d9('0xc8')]-0x1){this[_0x78d9('0x10')][_0x2f0905[_0x78d9('0x6e')]][_0x78d9('0x5b')]+=moment()[_0x78d9('0xc9')](0x0)[_0x78d9('0xca')](_0x2f0905['queuecallerjoinAt'],_0x78d9('0xc7'));this[_0x78d9('0x10')][_0x2f0905['queue']][_0x78d9('0xcb')]+=0x1;if(_0x2f0905[_0x78d9('0x81')]){this['voiceQueues'][_0x2f0905[_0x78d9('0x6e')]][_0x78d9('0x58')]+=0x1;this[_0x78d9('0x10')][_0x2f0905['queue']][_0x78d9('0x5a')]+=moment()[_0x78d9('0xc9')](0x0)[_0x78d9('0xca')](_0x2f0905[_0x78d9('0x8c')],_0x78d9('0xc7'));_0x2f0905[_0x78d9('0x82')]=moment()[_0x78d9('0x4d')](_0x78d9('0x86'));_0x2f0905[_0x78d9('0x9d')]=![];_0x2f0905[_0x78d9('0xac')]=null;}if(_0x2f0905[_0x78d9('0x9d')]&&_0x2f0905['transfer']!=!![]){_0x2f0905[_0x78d9('0xae')]='unmanaged';logger[_0x78d9('0x4a')](_0x78d9('0xcc'),_0xb4ee3f[_0x78d9('0x4c')],util[_0x78d9('0x40')](_0x2f0905,{'showHidden':![],'depth':null}));ami['emit'](_0x78d9('0xcd'),_0x2f0905);}if(_0x2f0905['queuecallerabandon']){_0x2f0905[_0x78d9('0xae')]='abandoned';logger[_0x78d9('0x4a')](_0x78d9('0xce'),_0xb4ee3f[_0x78d9('0x4c')],util['inspect'](_0x2f0905,{'showHidden':![],'depth':null}));ami[_0x78d9('0x48')]('custom:queuecallerabandon',_0x2f0905);}}else{this[_0x78d9('0x10')][_0x2f0905[_0x78d9('0x6e')]][_0x78d9('0x5b')]+=this[_0x78d9('0x10')][_0x2f0905[_0x78d9('0x6e')]][_0x78d9('0x5c')];}logger['info'](_0x78d9('0xcf'),_0xb4ee3f[_0x78d9('0x4c')],_0x2f0905[_0x78d9('0x4f')],_0x2f0905[_0x78d9('0x55')],_0xb4ee3f[_0x78d9('0xd0')]);this[_0x78d9('0xe')][_0xb4ee3f[_0x78d9('0x4c')]]=_0x2f0905;this[_0x78d9('0x46')](_0x2f0905,'hangup');this[_0x78d9('0x54')](this['voiceQueues'][_0x2f0905['queue']],'hangup');}}logger[_0x78d9('0x4a')](_0x78d9('0xd1'),_0xb4ee3f['uniqueid'],util[_0x78d9('0x40')](this[_0x78d9('0xd')][_0xb4ee3f[_0x78d9('0x4c')]],{'showHidden':![],'depth':null}));ami['emit'](_0x78d9('0xd2'),this[_0x78d9('0xd')][_0xb4ee3f['uniqueid']]);delete this[_0x78d9('0xd')][_0xb4ee3f['uniqueid']];delete this[_0x78d9('0xe')][_0xb4ee3f[_0x78d9('0x4c')]];}if(this['variables'][_0xb4ee3f['uniqueid']]){delete this['variables'][_0xb4ee3f['uniqueid']];}}}catch(_0x47f71d){logger[_0x78d9('0x41')]('[%s][voiceQueueReport][hangup]',_0xb4ee3f[_0x78d9('0x4c')],util[_0x78d9('0x40')](_0x47f71d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x78d9('0x2e')]=function(_0xed27a9){try{if(this[_0x78d9('0x65')](_0xed27a9)){logger[_0x78d9('0x4a')]('[%s][voiceQueueReport][attendedtransfer]',_0xed27a9[_0x78d9('0x4c')],util[_0x78d9('0x40')](_0xed27a9,{'showHidden':![],'depth':null}));var _0x109068;if(this['queueReports'][_0xed27a9[_0x78d9('0xd3')]]){_0x109068=_[_0x78d9('0x80')](this[_0x78d9('0xd')][_0xed27a9[_0x78d9('0xd3')]]);_0x109068['transferexten']=_0xed27a9[_0x78d9('0xd4')];_0x109068[_0x78d9('0xa3')]=_0xed27a9[_0x78d9('0xd5')];_0x109068['queuecallerexitreason']=_0x78d9('0xd6');_0x109068[_0x78d9('0x96')]=!![];_0x109068[_0x78d9('0xa0')]=_0x78d9('0xd7');if(this[_0x78d9('0xd')][_0xed27a9[_0x78d9('0xd5')]]){var _0x4cf510=this[_0x78d9('0xd')][_0xed27a9['secondtransfereruniqueid']];this['queueReports'][_0xed27a9[_0x78d9('0xd5')]]=this[_0x78d9('0xd')][_0xed27a9['transfereeuniqueid']];this['queueReports'][_0xed27a9[_0x78d9('0xd3')]]=_0x4cf510;var _0x26ce07=_['last'](this[_0x78d9('0xd')][_0xed27a9['transfereeuniqueid']]);_0x26ce07['switch']=!![];}logger[_0x78d9('0x6c')](_0x78d9('0xd8'),_0xed27a9[_0x78d9('0x4c')],_0x109068[_0x78d9('0x4f')],_0x109068['type'],_0x109068['transferexten'],_0x109068[_0x78d9('0xa3')]);}else if(this[_0x78d9('0xd')][_0xed27a9[_0x78d9('0xd9')]]){_0x109068=_[_0x78d9('0x80')](this[_0x78d9('0xd')][_0xed27a9['transfertargetuniqueid']]);_0x109068[_0x78d9('0xda')]=_0xed27a9['origtransfererexten'];_0x109068[_0x78d9('0xa3')]=_0xed27a9[_0x78d9('0xdb')];_0x109068[_0x78d9('0x87')]=_0x78d9('0xd6');_0x109068['transfer']=!![];_0x109068[_0x78d9('0xa0')]=_0x78d9('0xd7');if(this[_0x78d9('0xd')][_0xed27a9[_0x78d9('0xdb')]]){var _0x4cf510=this['queueReports'][_0xed27a9[_0x78d9('0xdb')]];this[_0x78d9('0xd')][_0xed27a9[_0x78d9('0xdb')]]=this[_0x78d9('0xd')][_0xed27a9[_0x78d9('0xd9')]];this[_0x78d9('0xd')][_0xed27a9[_0x78d9('0xd9')]]=_0x4cf510;var _0x26ce07=_['last'](this['queueReports'][_0xed27a9[_0x78d9('0xd9')]]);_0x26ce07[_0x78d9('0x36')]=!![];}logger['info']('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0xed27a9[_0x78d9('0x4c')],_0x109068[_0x78d9('0x4f')],_0x109068[_0x78d9('0x55')],_0x109068[_0x78d9('0xda')],_0x109068[_0x78d9('0xa3')]);}}}catch(_0x525bd3){logger['error'](_0x78d9('0xdc'),_0xed27a9[_0x78d9('0x4c')],util['inspect'](_0x525bd3,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x78d9('0xdd')]=function(_0x2cf11b){try{if(this[_0x78d9('0x65')](_0x2cf11b)){logger['debug'](_0x78d9('0xde'),_0x2cf11b[_0x78d9('0x4c')],util['inspect'](_0x2cf11b,{'showHidden':![],'depth':null}));if(this[_0x78d9('0xd')][_0x2cf11b[_0x78d9('0xd3')]]){var _0x44c0e1=_[_0x78d9('0x80')](this[_0x78d9('0xd')][_0x2cf11b[_0x78d9('0xd3')]]);_0x44c0e1['queuecallerexitreason']=_0x78d9('0xdf');_0x44c0e1[_0x78d9('0x96')]=!![];_0x44c0e1[_0x78d9('0xa0')]='BLIND';_0x44c0e1[_0x78d9('0xda')]=_0x2cf11b[_0x78d9('0xe0')];_0x44c0e1[_0x78d9('0xa3')]=_0x2cf11b[_0x78d9('0xd3')];logger['info'](_0x78d9('0xe1'),_0x2cf11b[_0x78d9('0x4c')],_0x44c0e1[_0x78d9('0x4f')],_0x44c0e1[_0x78d9('0x55')],_0x44c0e1[_0x78d9('0xda')],_0x44c0e1[_0x78d9('0xa3')]);this[_0x78d9('0x25')]({'event':_0x78d9('0xe2'),'uniqueid':_0x2cf11b[_0x78d9('0xd3')],'context':_0x2cf11b['context'],'channel':_0x2cf11b['transfererchannel']});}}}catch(_0x2262ad){logger[_0x78d9('0x41')](_0x78d9('0xde'),_0x2cf11b[_0x78d9('0x4c')],util[_0x78d9('0x40')](_0x2262ad,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0x2a')]=function(_0x24e620){try{if(this[_0x78d9('0x65')](_0x24e620)){logger[_0x78d9('0x4a')](_0x78d9('0xe3'),_0x24e620[_0x78d9('0x4c')],util[_0x78d9('0x40')](_0x24e620,{'showHidden':![],'depth':null}));if(this[_0x78d9('0xd')][_0x24e620[_0x78d9('0x4c')]]){var _0x2c1136=_[_0x78d9('0x80')](this[_0x78d9('0xd')][_0x24e620[_0x78d9('0x4c')]]);if(!_[_0x78d9('0x37')](_0x2c1136[_0x78d9('0x8c')])){_0x2c1136[_0x78d9('0xe4')]=moment()[_0x78d9('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x78d9('0x6c')]('[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s',_0x24e620[_0x78d9('0x4c')],_0x2c1136[_0x78d9('0xe4')]);}}}}catch(_0xcbcea6){logger[_0x78d9('0x41')]('[%s][voiceQueueReport][musiconholdstart]',_0x24e620[_0x78d9('0x4c')],util[_0x78d9('0x40')](_0xcbcea6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0x2c')]=function(_0x12046a){try{if(this[_0x78d9('0x65')](_0x12046a)){logger['debug'](_0x78d9('0xe5'),_0x12046a[_0x78d9('0x4c')],util[_0x78d9('0x40')](_0x12046a,{'showHidden':![],'depth':null}));if(this[_0x78d9('0xd')][_0x12046a[_0x78d9('0x4c')]]){var _0x50b911=_['last'](this[_0x78d9('0xd')][_0x12046a[_0x78d9('0x4c')]]);if(!_[_0x78d9('0x37')](_0x50b911[_0x78d9('0xe4')])){_0x50b911['mohtime']+=moment()[_0x78d9('0xc9')](0x0)[_0x78d9('0xca')](_0x50b911['mohstarttime'],_0x78d9('0xc7'));logger[_0x78d9('0x6c')](_0x78d9('0xe6'),_0x12046a[_0x78d9('0x4c')],_0x50b911[_0x78d9('0xe7')]);delete _0x50b911[_0x78d9('0xe4')];}}}}catch(_0x2fa1e7){logger[_0x78d9('0x41')]('[%s][voiceQueueReport][musiconholdstop]',_0x12046a['uniqueid'],util[_0x78d9('0x40')](_0x2fa1e7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x78d9('0x9')][_0x78d9('0x29')]=function(_0x4a5321){try{if(this[_0x78d9('0x65')](_0x4a5321)){logger['debug'](_0x78d9('0xe8'),_0x4a5321[_0x78d9('0x4c')],util[_0x78d9('0x40')](_0x4a5321,{'showHidden':![],'depth':null}));if(_0x4a5321[_0x78d9('0xe9')][_0x78d9('0x9a')]()===_0x78d9('0xea')){_0x4a5321[_0x78d9('0xeb')]=_0x4a5321[_0x78d9('0xec')]&&_0x4a5321[_0x78d9('0xec')]['startsWith']('CDR(routeAlias)')?_0x4a5321['appdata']:(_0x4a5321[_0x78d9('0xec')]||_0x4a5321['applicationdata'])[_0x78d9('0x9a')]();if(_['startsWith'](_0x4a5321[_0x78d9('0xeb')][_0x78d9('0x9a')](),_0x78d9('0xed'))){logger[_0x78d9('0x6c')](_0x78d9('0xee'),_0x4a5321[_0x78d9('0x4c')],_0x4a5321['application'],_0x4a5321[_0x78d9('0xeb')]);if(_[_0x78d9('0x79')](this[_0x78d9('0xe')][_0x4a5321['uniqueid']]))this[_0x78d9('0xe')][_0x4a5321['uniqueid']]={};var _0x4afe29=_0x4a5321[_0x78d9('0xeb')]['split']('=');var _0x51f73c=_0x4afe29[0x0]['toLowerCase']()[_0x78d9('0xef')](/cdr\((.*)\)/);if(_0x51f73c)this['channels'][_0x4a5321[_0x78d9('0x4c')]][_0x51f73c[0x1]]=_0x4afe29[0x1];}}}}catch(_0x1cf274){logger[_0x78d9('0x41')](_0x78d9('0xf0'),_0x4a5321[_0x78d9('0x4c')],util['inspect'](_0x1cf274,{'showHidden':![],'depth':null}));}};module[_0x78d9('0xf1')]=VoiceQueueReport;
\ No newline at end of file
index 43d6870..04516ab 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4d88=['../client','createHistory','campaign','queue','Request','CreateReportAgentPreview'];(function(_0x5ed2d3,_0x369de7){var _0x1a6b68=function(_0x4afd00){while(--_0x4afd00){_0x5ed2d3['push'](_0x5ed2d3['shift']());}};_0x1a6b68(++_0x369de7);}(_0x4d88,0x12c));var _0x84d8=function(_0x1abbbe,_0x1ef72e){_0x1abbbe=_0x1abbbe-0x0;var _0x1f1c17=_0x4d88[_0x1abbbe];return _0x1f1c17;};'use strict';var client=require(_0x84d8('0x0'));exports[_0x84d8('0x1')]=function(_0x108598){return function(){_0x108598[_0x84d8('0x2')]=_0x108598[_0x84d8('0x3')];return client[_0x84d8('0x4')](_0x84d8('0x5'),{'body':_0x108598,'log':_0x84d8('0x5')});};};
\ No newline at end of file
+var _0xf5f5=['CreateReportAgentPreview','../client','campaign'];(function(_0x2ec3aa,_0x29bd65){var _0x284ab2=function(_0x41bf34){while(--_0x41bf34){_0x2ec3aa['push'](_0x2ec3aa['shift']());}};_0x284ab2(++_0x29bd65);}(_0xf5f5,0x1d8));var _0x5f5f=function(_0x47bbc6,_0x3ab281){_0x47bbc6=_0x47bbc6-0x0;var _0x2c75b4=_0xf5f5[_0x47bbc6];return _0x2c75b4;};'use strict';var client=require(_0x5f5f('0x0'));exports['createHistory']=function(_0x2d09c9){return function(){_0x2d09c9[_0x5f5f('0x1')]=_0x2d09c9['queue'];return client['Request'](_0x5f5f('0x2'),{'body':_0x2d09c9,'log':'CreateReportAgentPreview'});};};
\ No newline at end of file
index 259fe13..eca768f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3cb4=['Request','CreateAttachment','create'];(function(_0x2ec901,_0x336291){var _0x56675f=function(_0x83cd5c){while(--_0x83cd5c){_0x2ec901['push'](_0x2ec901['shift']());}};_0x56675f(++_0x336291);}(_0x3cb4,0x1f1));var _0x43cb=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x3cb4[_0x491a7f];return _0x3d8f44;};'use strict';var client=require('../client');exports[_0x43cb('0x0')]=function(_0x23901c){return client[_0x43cb('0x1')](_0x43cb('0x2'),{'body':_0x23901c,'log':_0x43cb('0x2')});};
\ No newline at end of file
+var _0xd57b=['../client','CreateAttachment'];(function(_0x276d95,_0x4c193f){var _0x4c55c1=function(_0x12d7f6){while(--_0x12d7f6){_0x276d95['push'](_0x276d95['shift']());}};_0x4c55c1(++_0x4c193f);}(_0xd57b,0x1be));var _0xbd57=function(_0x3c729b,_0x2a4146){_0x3c729b=_0x3c729b-0x0;var _0x55894c=_0xd57b[_0x3c729b];return _0x55894c;};'use strict';var client=require(_0xbd57('0x0'));exports['create']=function(_0x5c869b){return client['Request']('CreateAttachment',{'body':_0x5c869b,'log':_0xbd57('0x1')});};
\ No newline at end of file
index 780f050..8f69bac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ef3=['dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialTimezone','dialGlobalInterval','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumWordLength','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','active','TrunkBackup','Interval','Intervals','interval','SquareProject','getCampaign','../client','getCampaigns','Request','GetCampaign','name','type','limitCalls','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry'];(function(_0x3dfeb9,_0x1cc6e4){var _0x412314=function(_0x321253){while(--_0x321253){_0x3dfeb9['push'](_0x3dfeb9['shift']());}};_0x412314(++_0x1cc6e4);}(_0x2ef3,0xba));var _0x32ef=function(_0x43d766,_0x3ef2e2){_0x43d766=_0x43d766-0x0;var _0x439b83=_0x2ef3[_0x43d766];return _0x439b83;};'use strict';var client=require(_0x32ef('0x0'));exports[_0x32ef('0x1')]=function(){return function(){return client[_0x32ef('0x2')](_0x32ef('0x3'),{'options':{'raw':![],'attributes':['id',_0x32ef('0x4'),_0x32ef('0x5'),'active',_0x32ef('0x6'),_0x32ef('0x7'),'dialOriginateCallerIdNumber',_0x32ef('0x8'),_0x32ef('0x9'),'dialCongestionRetryFrequency','dialBusyMaxRetry',_0x32ef('0xa'),_0x32ef('0xb'),_0x32ef('0xc'),_0x32ef('0xd'),_0x32ef('0xe'),_0x32ef('0xf'),_0x32ef('0x10'),_0x32ef('0x11'),_0x32ef('0x12'),_0x32ef('0x13'),'dialMachineMaxRetry','dialMachineRetryFrequency',_0x32ef('0x14'),_0x32ef('0x15'),_0x32ef('0x16'),_0x32ef('0x17'),'dialAMDActive',_0x32ef('0x18'),'dialAMDGreeting',_0x32ef('0x19'),'dialAMDTotalAnalysisTime',_0x32ef('0x1a'),_0x32ef('0x1b'),'dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold',_0x32ef('0x1c'),'dialOrderByScheduledAt',_0x32ef('0x1d'),_0x32ef('0x1e'),_0x32ef('0x1f')],'include':[{'model':_0x32ef('0x20'),'as':'Trunk','attributes':['id','name','callerid',_0x32ef('0x21')]},{'model':_0x32ef('0x20'),'as':_0x32ef('0x22'),'attributes':['id','name','callerid',_0x32ef('0x21')]},{'model':_0x32ef('0x23'),'as':_0x32ef('0x23'),'attributes':['id','name'],'include':[{'model':_0x32ef('0x23'),'as':_0x32ef('0x24'),'attributes':['id','name',_0x32ef('0x25')]}]},{'model':_0x32ef('0x26'),'as':_0x32ef('0x26'),'attributes':['id',_0x32ef('0x4')]}]},'log':_0x32ef('0x27')});};};
\ No newline at end of file
+var _0x2ef3=['dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialTimezone','dialGlobalInterval','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumWordLength','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','Trunk','active','TrunkBackup','Interval','Intervals','interval','SquareProject','getCampaign','../client','getCampaigns','Request','GetCampaign','name','type','limitCalls','dialOriginateCallerIdName','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry'];(function(_0x3227c1,_0x4318c5){var _0x31fd48=function(_0x5c5850){while(--_0x5c5850){_0x3227c1['push'](_0x3227c1['shift']());}};_0x31fd48(++_0x4318c5);}(_0x2ef3,0xba));var _0x32ef=function(_0x452a7b,_0x494c19){_0x452a7b=_0x452a7b-0x0;var _0x51e07e=_0x2ef3[_0x452a7b];return _0x51e07e;};'use strict';var client=require(_0x32ef('0x0'));exports[_0x32ef('0x1')]=function(){return function(){return client[_0x32ef('0x2')](_0x32ef('0x3'),{'options':{'raw':![],'attributes':['id',_0x32ef('0x4'),_0x32ef('0x5'),'active',_0x32ef('0x6'),_0x32ef('0x7'),'dialOriginateCallerIdNumber',_0x32ef('0x8'),_0x32ef('0x9'),'dialCongestionRetryFrequency','dialBusyMaxRetry',_0x32ef('0xa'),_0x32ef('0xb'),_0x32ef('0xc'),_0x32ef('0xd'),_0x32ef('0xe'),_0x32ef('0xf'),_0x32ef('0x10'),_0x32ef('0x11'),_0x32ef('0x12'),_0x32ef('0x13'),'dialMachineMaxRetry','dialMachineRetryFrequency',_0x32ef('0x14'),_0x32ef('0x15'),_0x32ef('0x16'),_0x32ef('0x17'),'dialAMDActive',_0x32ef('0x18'),'dialAMDGreeting',_0x32ef('0x19'),'dialAMDTotalAnalysisTime',_0x32ef('0x1a'),_0x32ef('0x1b'),'dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold',_0x32ef('0x1c'),'dialOrderByScheduledAt',_0x32ef('0x1d'),_0x32ef('0x1e'),_0x32ef('0x1f')],'include':[{'model':_0x32ef('0x20'),'as':'Trunk','attributes':['id','name','callerid',_0x32ef('0x21')]},{'model':_0x32ef('0x20'),'as':_0x32ef('0x22'),'attributes':['id','name','callerid',_0x32ef('0x21')]},{'model':_0x32ef('0x23'),'as':_0x32ef('0x23'),'attributes':['id','name'],'include':[{'model':_0x32ef('0x23'),'as':_0x32ef('0x24'),'attributes':['id','name',_0x32ef('0x25')]}]},{'model':_0x32ef('0x26'),'as':_0x32ef('0x26'),'attributes':['id',_0x32ef('0x4')]}]},'log':_0x32ef('0x27')});};};
\ No newline at end of file
index 0c63926..65cacbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf8ca=['../client','Request','CreateCmContact','getContacts','GetCmContact'];(function(_0x4ac867,_0x12be25){var _0x5bb4af=function(_0x104bbe){while(--_0x104bbe){_0x4ac867['push'](_0x4ac867['shift']());}};_0x5bb4af(++_0x12be25);}(_0xf8ca,0x1cc));var _0xaf8c=function(_0x10004e,_0xd701e6){_0x10004e=_0x10004e-0x0;var _0x5af990=_0xf8ca[_0x10004e];return _0x5af990;};'use strict';var client=require(_0xaf8c('0x0'));exports['createContact']=function(_0x439231){return function(){return client[_0xaf8c('0x1')](_0xaf8c('0x2'),{'body':_0x439231,'log':'CreateCmContact'});};};exports[_0xaf8c('0x3')]=function(_0x33aa10){return function(){return client[_0xaf8c('0x1')]('GetCmContact',{'options':_0x33aa10,'log':_0xaf8c('0x4')});};};
\ No newline at end of file
+var _0xdcb0=['GetCmContact','../client','createContact','Request','CreateCmContact','getContacts'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xdcb0,0x19f));var _0x0dcb=function(_0x5ddc32,_0x2f5670){_0x5ddc32=_0x5ddc32-0x0;var _0x3e03bf=_0xdcb0[_0x5ddc32];return _0x3e03bf;};'use strict';var client=require(_0x0dcb('0x0'));exports[_0x0dcb('0x1')]=function(_0x9606fd){return function(){return client[_0x0dcb('0x2')](_0x0dcb('0x3'),{'body':_0x9606fd,'log':'CreateCmContact'});};};exports[_0x0dcb('0x4')]=function(_0x4198f7){return function(){return client[_0x0dcb('0x2')](_0x0dcb('0x5'),{'options':_0x4198f7,'log':_0x0dcb('0x5')});};};
\ No newline at end of file
index cf98086..fd6d349 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xab04=['ASC','getContactDialerIvr','GetContactDialerIvr','moveContactManagedDialer','campaign','queue','ContactId','MoveContactManagedDialer','countReScheduled','CountReScheduled','GetCmHopperPreview','User','Agent','name','Queue','unlockContact','GetContactRecallMe','voicePause','db.CmHopper.UserId','../client','moment','lodash','getContacts','Request','GetCmHopper','CmContact','Contact','getCmHopper','UpdateCmHopper','format','YYYY-MM-DD\x20HH:mm:ss','ListId','VoiceQueueId','CampaignId','rescheduleContact','destroyContact','DestroyCmHopper','GetContactDialer','priority','DESC','scheduledat'];(function(_0x128495,_0x25a304){var _0xcb1a0e=function(_0x451f3f){while(--_0x451f3f){_0x128495['push'](_0x128495['shift']());}};_0xcb1a0e(++_0x25a304);}(_0xab04,0x1d6));var _0x4ab0=function(_0x418c0d,_0x329944){_0x418c0d=_0x418c0d-0x0;var _0x470ebb=_0xab04[_0x418c0d];return _0x470ebb;};'use strict';var client=require(_0x4ab0('0x0'));var moment=require(_0x4ab0('0x1'));var _=require(_0x4ab0('0x2'));exports[_0x4ab0('0x3')]=function(_0x51e236,_0x5b4e7d){return function(){return client[_0x4ab0('0x4')](_0x4ab0('0x5'),{'options':{'where':{'VoiceQueueId':_0x51e236},'include':[{'model':_0x4ab0('0x6'),'as':_0x4ab0('0x7')}],'limit':_0x5b4e7d,'raw':![]},'log':_0x4ab0('0x8')});};};exports['updateContacts']=function(_0x43b590,_0x669331,_0xa1987){return function(){return client[_0x4ab0('0x4')](_0x4ab0('0x9'),{'body':_0x43b590,'options':{'where':{'VoiceQueueId':_0x669331,'scheduledat':{'$lte':moment()[_0x4ab0('0xa')](_0x4ab0('0xb'))}},'limit':_0xa1987},'log':_0x4ab0('0x9')});};};exports['rescheduleContact']=function(_0x23b547){return function(){return client['Request']('UpdateCmHopper',{'body':_0x23b547,'options':{'where':{'ContactId':_0x23b547['ContactId'],'ListId':_0x23b547[_0x4ab0('0xc')],'VoiceQueueId':_0x23b547[_0x4ab0('0xd')],'CampaignId':_0x23b547[_0x4ab0('0xe')]}},'log':_0x4ab0('0xf')});};};exports[_0x4ab0('0x10')]=function(_0x1267d2,_0x58c094,_0x29fbff){return function(){return client[_0x4ab0('0x4')]('DestroyCmHopper',{'options':{'where':{'VoiceQueueId':_0x1267d2,'ListId':_0x58c094,'ContactId':_0x29fbff}},'log':_0x4ab0('0x11')});};};exports['getContactDialer']=function(_0x3d25c5,_0x562f44,_0x1fe955,_0xa2c82f){return function(){return client[_0x4ab0('0x4')](_0x4ab0('0x12'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x3d25c5,'active':![],'scheduledat':{'$lte':moment()[_0x4ab0('0xa')](_0x4ab0('0xb'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x562f44}}]},'order':[[_0x4ab0('0x13'),_0x4ab0('0x14')],[_0x4ab0('0x15'),_0xa2c82f],['id',_0x4ab0('0x16')]],'raw':!![],'limit':_0x1fe955},'log':_0x4ab0('0x12')});};};exports[_0x4ab0('0x17')]=function(_0x3f9e99,_0x132c43,_0x515887){return function(){return client['Request'](_0x4ab0('0x12'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x3f9e99,'active':![],'scheduledat':{'$lte':moment()['format'](_0x4ab0('0xb'))}},'include':[{'model':_0x4ab0('0x6'),'as':_0x4ab0('0x7')}],'order':[['priority','DESC'],[_0x4ab0('0x15'),_0x515887],['id',_0x4ab0('0x16')]],'raw':!![],'limit':_0x132c43},'log':_0x4ab0('0x18')});};};exports[_0x4ab0('0x19')]=function(_0x1a9cb9,_0x3d4992){return function(){_0x1a9cb9[_0x4ab0('0x1a')]=_0x1a9cb9[_0x4ab0('0x1b')];return client[_0x4ab0('0x4')]('MoveContactManagedDialer',{'body':_0x1a9cb9,'options':{'where':{'ContactId':_0x1a9cb9[_0x4ab0('0x1c')],'ListId':_0x1a9cb9[_0x4ab0('0xc')],'VoiceQueueId':_0x1a9cb9[_0x4ab0('0xd')],'CampaignId':_0x1a9cb9[_0x4ab0('0xe')],'active':_0x3d4992?undefined:!![]}},'log':_0x4ab0('0x1d')});};};exports[_0x4ab0('0x1e')]=function(_0x41a27d){return function(){return client[_0x4ab0('0x4')](_0x4ab0('0x1f'),{'options':{'where':{'VoiceQueueId':_0x41a27d['id']?_0x41a27d['id']||null:null}},'log':_0x4ab0('0x1e')});};};exports['getContactPreview']=function(_0xef4bdd){return function(){return client[_0x4ab0('0x4')](_0x4ab0('0x20'),{'options':{'where':{'id':_0xef4bdd},'include':[{'model':'CmContact','as':_0x4ab0('0x7')},{'model':_0x4ab0('0x21'),'as':_0x4ab0('0x22'),'attributes':['id',_0x4ab0('0x23')]},{'model':'VoiceQueue','as':_0x4ab0('0x24'),'attributes':['id',_0x4ab0('0x23')]}],'raw':!![]},'log':_0x4ab0('0x8')});};};exports[_0x4ab0('0x25')]=function(_0x5f57ce,_0x48dd02,_0x5b10e4){return function(){return client[_0x4ab0('0x4')](_0x4ab0('0x9'),{'body':_0x5f57ce,'options':{'where':{'id':_0x48dd02},'limit':_0x5b10e4},'log':_0x4ab0('0x9')});};};exports['getContactRecallMe']=function(_0x56eb95,_0x3e7ebd){return function(){return client[_0x4ab0('0x4')](_0x4ab0('0x26'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x56eb95,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x4ab0('0xa')]('YYYY-MM-DD\x20HH:mm:ss')},'UserId':{'$in':_0x3e7ebd}},'order':[[_0x4ab0('0x13'),_0x4ab0('0x14')],['scheduledat',_0x4ab0('0x14')],['id',_0x4ab0('0x16')]],'include':[{'model':_0x4ab0('0x6'),'as':_0x4ab0('0x7')},{'model':_0x4ab0('0x21'),'as':_0x4ab0('0x22'),'attributes':['id',_0x4ab0('0x23'),_0x4ab0('0x27')]}],'group':_0x4ab0('0x28'),'raw':!![]},'log':_0x4ab0('0x12')});};};
\ No newline at end of file
+var _0x3765=['destroyContact','DestroyCmHopper','getContactDialer','priority','DESC','scheduledat','GetContactDialer','getContactDialerIvr','Contact','moveContactManagedDialer','queue','MoveContactManagedDialer','countReScheduled','CountReScheduled','getContactPreview','GetCmHopperPreview','User','name','Queue','getCmHopper','getContactRecallMe','GetContactRecallMe','ASC','Agent','voicePause','db.CmHopper.UserId','../client','moment','Request','GetCmHopper','CmContact','updateContacts','UpdateCmHopper','format','YYYY-MM-DD\x20HH:mm:ss','ContactId','ListId','VoiceQueueId','CampaignId','rescheduleContact'];(function(_0x57aa62,_0x763c99){var _0x4b3e59=function(_0x5cffcb){while(--_0x5cffcb){_0x57aa62['push'](_0x57aa62['shift']());}};_0x4b3e59(++_0x763c99);}(_0x3765,0x15a));var _0x5376=function(_0x2715e8,_0x26d0a6){_0x2715e8=_0x2715e8-0x0;var _0x4eb427=_0x3765[_0x2715e8];return _0x4eb427;};'use strict';var client=require(_0x5376('0x0'));var moment=require(_0x5376('0x1'));var _=require('lodash');exports['getContacts']=function(_0x50cdf5,_0x1209fe){return function(){return client[_0x5376('0x2')](_0x5376('0x3'),{'options':{'where':{'VoiceQueueId':_0x50cdf5},'include':[{'model':_0x5376('0x4'),'as':'Contact'}],'limit':_0x1209fe,'raw':![]},'log':'getCmHopper'});};};exports[_0x5376('0x5')]=function(_0x379711,_0x3c92cd,_0x978794){return function(){return client['Request'](_0x5376('0x6'),{'body':_0x379711,'options':{'where':{'VoiceQueueId':_0x3c92cd,'scheduledat':{'$lte':moment()[_0x5376('0x7')](_0x5376('0x8'))}},'limit':_0x978794},'log':'UpdateCmHopper'});};};exports['rescheduleContact']=function(_0x54a59e){return function(){return client[_0x5376('0x2')](_0x5376('0x6'),{'body':_0x54a59e,'options':{'where':{'ContactId':_0x54a59e[_0x5376('0x9')],'ListId':_0x54a59e[_0x5376('0xa')],'VoiceQueueId':_0x54a59e[_0x5376('0xb')],'CampaignId':_0x54a59e[_0x5376('0xc')]}},'log':_0x5376('0xd')});};};exports[_0x5376('0xe')]=function(_0x586ff0,_0x3b2a3a,_0x15939c){return function(){return client[_0x5376('0x2')]('DestroyCmHopper',{'options':{'where':{'VoiceQueueId':_0x586ff0,'ListId':_0x3b2a3a,'ContactId':_0x15939c}},'log':_0x5376('0xf')});};};exports[_0x5376('0x10')]=function(_0x138015,_0x1f466e,_0x3e55f7,_0xf22c94){return function(){return client[_0x5376('0x2')]('GetContactDialer',{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x138015,'active':![],'scheduledat':{'$lte':moment()[_0x5376('0x7')](_0x5376('0x8'))},'$or':[{'UserId':null},{'UserId':{'$in':_0x1f466e}}]},'order':[[_0x5376('0x11'),_0x5376('0x12')],[_0x5376('0x13'),_0xf22c94],['id','ASC']],'raw':!![],'limit':_0x3e55f7},'log':_0x5376('0x14')});};};exports[_0x5376('0x15')]=function(_0x2932cc,_0x2e1312,_0x4026a){return function(){return client[_0x5376('0x2')](_0x5376('0x14'),{'body':{'active':!![]},'options':{'where':{'CampaignId':_0x2932cc,'active':![],'scheduledat':{'$lte':moment()[_0x5376('0x7')](_0x5376('0x8'))}},'include':[{'model':_0x5376('0x4'),'as':_0x5376('0x16')}],'order':[[_0x5376('0x11'),_0x5376('0x12')],[_0x5376('0x13'),_0x4026a],['id','ASC']],'raw':!![],'limit':_0x2e1312},'log':'GetContactDialerIvr'});};};exports[_0x5376('0x17')]=function(_0x42bc33,_0xc17bf9){return function(){_0x42bc33['campaign']=_0x42bc33[_0x5376('0x18')];return client['Request'](_0x5376('0x19'),{'body':_0x42bc33,'options':{'where':{'ContactId':_0x42bc33[_0x5376('0x9')],'ListId':_0x42bc33[_0x5376('0xa')],'VoiceQueueId':_0x42bc33[_0x5376('0xb')],'CampaignId':_0x42bc33['CampaignId'],'active':_0xc17bf9?undefined:!![]}},'log':'MoveContactManagedDialer'});};};exports[_0x5376('0x1a')]=function(_0x523d34){return function(){return client['Request'](_0x5376('0x1b'),{'options':{'where':{'VoiceQueueId':_0x523d34['id']?_0x523d34['id']||null:null}},'log':_0x5376('0x1a')});};};exports[_0x5376('0x1c')]=function(_0xa05488){return function(){return client[_0x5376('0x2')](_0x5376('0x1d'),{'options':{'where':{'id':_0xa05488},'include':[{'model':_0x5376('0x4'),'as':_0x5376('0x16')},{'model':_0x5376('0x1e'),'as':'Agent','attributes':['id',_0x5376('0x1f')]},{'model':'VoiceQueue','as':_0x5376('0x20'),'attributes':['id',_0x5376('0x1f')]}],'raw':!![]},'log':_0x5376('0x21')});};};exports['unlockContact']=function(_0x3a60f3,_0x209669,_0x20de2f){return function(){return client['Request'](_0x5376('0x6'),{'body':_0x3a60f3,'options':{'where':{'id':_0x209669},'limit':_0x20de2f},'log':_0x5376('0x6')});};};exports[_0x5376('0x22')]=function(_0x59c761,_0x5c6780){return function(){return client['Request'](_0x5376('0x23'),{'body':{'active':!![]},'options':{'where':{'VoiceQueueId':_0x59c761,'active':![],'recallme':!![],'scheduledat':{'$lte':moment()[_0x5376('0x7')](_0x5376('0x8'))},'UserId':{'$in':_0x5c6780}},'order':[[_0x5376('0x11'),_0x5376('0x12')],[_0x5376('0x13'),_0x5376('0x12')],['id',_0x5376('0x24')]],'include':[{'model':_0x5376('0x4'),'as':'Contact'},{'model':'User','as':_0x5376('0x25'),'attributes':['id',_0x5376('0x1f'),_0x5376('0x26')]}],'group':_0x5376('0x27'),'raw':!![]},'log':'GetContactDialer'});};};
\ No newline at end of file
index d08f1e3..95d8239 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x58a4=['checkIsBlackListIvr','GetCmHopperBlackIvr','../client','checkIsBlackList','Request','GetCmHopperBlack','VoiceQueueId','Contact','phone'];(function(_0x591bce,_0x42e203){var _0x1fb88d=function(_0x32b3d8){while(--_0x32b3d8){_0x591bce['push'](_0x591bce['shift']());}};_0x1fb88d(++_0x42e203);}(_0x58a4,0xbf));var _0x458a=function(_0x3a1ea5,_0x349f01){_0x3a1ea5=_0x3a1ea5-0x0;var _0xfac9b2=_0x58a4[_0x3a1ea5];return _0xfac9b2;};'use strict';var client=require(_0x458a('0x0'));exports[_0x458a('0x1')]=function(_0x4043ce){return function(){return client[_0x458a('0x2')](_0x458a('0x3'),{'options':{'where':{'VoiceQueueId':_0x4043ce[_0x458a('0x4')],'phone':_0x4043ce[_0x458a('0x5')][_0x458a('0x6')]},'raw':![]},'log':_0x458a('0x3')});};};exports[_0x458a('0x7')]=function(_0x2fde72){return function(){return client[_0x458a('0x2')](_0x458a('0x3'),{'options':{'where':{'CampaignId':_0x2fde72['CampaignId'],'phone':_0x2fde72['Contact'][_0x458a('0x6')]},'raw':![]},'log':_0x458a('0x8')});};};
\ No newline at end of file
+var _0x1399=['phone','GetCmHopperBlack','checkIsBlackListIvr','CampaignId','../client','checkIsBlackList','Request','VoiceQueueId','Contact'];(function(_0x453084,_0x24303b){var _0x422a40=function(_0x2059f5){while(--_0x2059f5){_0x453084['push'](_0x453084['shift']());}};_0x422a40(++_0x24303b);}(_0x1399,0x16c));var _0x9139=function(_0x496895,_0x5a1ba5){_0x496895=_0x496895-0x0;var _0xe195f=_0x1399[_0x496895];return _0xe195f;};'use strict';var client=require(_0x9139('0x0'));exports[_0x9139('0x1')]=function(_0x5740a9){return function(){return client[_0x9139('0x2')]('GetCmHopperBlack',{'options':{'where':{'VoiceQueueId':_0x5740a9[_0x9139('0x3')],'phone':_0x5740a9[_0x9139('0x4')][_0x9139('0x5')]},'raw':![]},'log':_0x9139('0x6')});};};exports[_0x9139('0x7')]=function(_0x2acb38){return function(){return client['Request']('GetCmHopperBlack',{'options':{'where':{'CampaignId':_0x2acb38[_0x9139('0x8')],'phone':_0x2acb38[_0x9139('0x4')][_0x9139('0x5')]},'raw':![]},'log':'GetCmHopperBlackIvr'});};};
\ No newline at end of file
index b0ba0b5..fe7f9a1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x871d=['CreateCmHopperFinal','createContact','queue'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x871d,0x184));var _0xd871=function(_0x568d59,_0x48f06d){_0x568d59=_0x568d59-0x0;var _0x149cce=_0x871d[_0x568d59];return _0x149cce;};'use strict';var client=require('../client');exports[_0xd871('0x0')]=function(_0x13ea1e){return function(){_0x13ea1e['campaign']=_0x13ea1e[_0xd871('0x1')];return client['Request'](_0xd871('0x2'),{'body':_0x13ea1e,'log':'CreateCmHopperFinal'});};};
\ No newline at end of file
+var _0x714e=['Request','CreateCmHopperFinal','campaign'];(function(_0x527aaf,_0x34dcd3){var _0xf49a7e=function(_0x548309){while(--_0x548309){_0x527aaf['push'](_0x527aaf['shift']());}};_0xf49a7e(++_0x34dcd3);}(_0x714e,0x95));var _0xe714=function(_0x2d05fa,_0x372364){_0x2d05fa=_0x2d05fa-0x0;var _0x10ae61=_0x714e[_0x2d05fa];return _0x10ae61;};'use strict';var client=require('../client');exports['createContact']=function(_0x6c36aa){return function(){_0x6c36aa[_0xe714('0x0')]=_0x6c36aa['queue'];return client[_0xe714('0x1')]('CreateCmHopperFinal',{'body':_0x6c36aa,'log':_0xe714('0x2')});};};
\ No newline at end of file
index 6bc4d59..ef27061 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63b4=['endOf','getCampaignHopperHistory','GetCampaignHopperHistory','startOf','ivr','moment','createHistory','campaign','queue','CreateCmHopperHistory','avgHandleTime','AvgHandleTime','minutes','YYYY-MM-DD\x20HH:mm:ss','format','GetCmHopperHistory','getVoiceQueueHopperHistory','Request','GetVoiceQueueHopperHistory','day'];(function(_0x467cb0,_0x303070){var _0x2153f7=function(_0x51775a){while(--_0x51775a){_0x467cb0['push'](_0x467cb0['shift']());}};_0x2153f7(++_0x303070);}(_0x63b4,0x11d));var _0x463b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x63b4[_0x321bb2];return _0x9c12ed;};'use strict';var client=require('../client');var moment=require(_0x463b('0x0'));exports[_0x463b('0x1')]=function(_0x57e5bf){return function(){_0x57e5bf[_0x463b('0x2')]=_0x57e5bf[_0x463b('0x3')];return client['Request'](_0x463b('0x4'),{'body':_0x57e5bf,'log':'CreateCmHopperHistory'});};};exports[_0x463b('0x5')]=function(_0x3e0c87){return function(){return client['Request'](_0x463b('0x6'),{'options':{'where':{'endtime':{'$between':[moment()['subtract'](_0x3e0c87,_0x463b('0x7'))['format'](_0x463b('0x8')),moment()[_0x463b('0x9')](_0x463b('0x8'))]}},'raw':![]},'log':_0x463b('0xa')});};};exports[_0x463b('0xb')]=function(_0x423f55){return function(){return client[_0x463b('0xc')](_0x463b('0xd'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x463b('0xe'))[_0x463b('0x9')](_0x463b('0x8')),moment()[_0x463b('0xf')](_0x463b('0xe'))[_0x463b('0x9')](_0x463b('0x8'))]},'campaigntype':_0x463b('0x3')},'raw':![]},'log':_0x463b('0xd')});};};exports[_0x463b('0x10')]=function(_0x3d3b78){return function(){return client[_0x463b('0xc')](_0x463b('0x11'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x463b('0x12')](_0x463b('0xe'))[_0x463b('0x9')](_0x463b('0x8')),moment()[_0x463b('0xf')]('day')[_0x463b('0x9')]('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':_0x463b('0x13')},'raw':![]},'log':_0x463b('0x11')});};};
\ No newline at end of file
+var _0x6e27=['getVoiceQueueHopperHistory','Request','GetVoiceQueueHopperHistory','day','endOf','queue','getCampaignHopperHistory','startOf','ivr','GetCampaignHopperHistory','moment','createHistory','campaign','CreateCmHopperHistory','AvgHandleTime','subtract','minutes','YYYY-MM-DD\x20HH:mm:ss','format','GetCmHopperHistory'];(function(_0x5070a4,_0x1db896){var _0x179668=function(_0x43b757){while(--_0x43b757){_0x5070a4['push'](_0x5070a4['shift']());}};_0x179668(++_0x1db896);}(_0x6e27,0xbe));var _0x76e2=function(_0x3ab46c,_0x4d26cc){_0x3ab46c=_0x3ab46c-0x0;var _0x2c7e90=_0x6e27[_0x3ab46c];return _0x2c7e90;};'use strict';var client=require('../client');var moment=require(_0x76e2('0x0'));exports[_0x76e2('0x1')]=function(_0xda014c){return function(){_0xda014c[_0x76e2('0x2')]=_0xda014c['queue'];return client['Request'](_0x76e2('0x3'),{'body':_0xda014c,'log':'CreateCmHopperHistory'});};};exports['avgHandleTime']=function(_0x26b7b9){return function(){return client['Request'](_0x76e2('0x4'),{'options':{'where':{'endtime':{'$between':[moment()[_0x76e2('0x5')](_0x26b7b9,_0x76e2('0x6'))['format'](_0x76e2('0x7')),moment()[_0x76e2('0x8')](_0x76e2('0x7'))]}},'raw':![]},'log':_0x76e2('0x9')});};};exports[_0x76e2('0xa')]=function(_0x2ba168){return function(){return client[_0x76e2('0xb')](_0x76e2('0xc'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x76e2('0xd'))[_0x76e2('0x8')](_0x76e2('0x7')),moment()[_0x76e2('0xe')](_0x76e2('0xd'))[_0x76e2('0x8')]('YYYY-MM-DD\x20HH:mm:ss')]},'campaigntype':_0x76e2('0xf')},'raw':![]},'log':'GetVoiceQueueHopperHistory'});};};exports[_0x76e2('0x10')]=function(_0x56772c){return function(){return client[_0x76e2('0xb')]('GetCampaignHopperHistory',{'options':{'where':{'createdAt':{'$between':[moment()[_0x76e2('0x11')](_0x76e2('0xd'))[_0x76e2('0x8')](_0x76e2('0x7')),moment()['endOf'](_0x76e2('0xd'))['format'](_0x76e2('0x7'))]},'campaigntype':_0x76e2('0x12')},'raw':![]},'log':_0x76e2('0x13')});};};
\ No newline at end of file
index b398cf4..9fa853d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x18c9=['localstationid','maxrate','gateway','faxdetect','t38timeout','tech','TrunkId','key','callerid','active','getFaxAccount','notify','../client','getFaxAccounts','Request','GetFaxAccount','name','description','headerinfo'];(function(_0x5af81e,_0x3a0d0b){var _0x198f7c=function(_0x39269c){while(--_0x39269c){_0x5af81e['push'](_0x5af81e['shift']());}};_0x198f7c(++_0x3a0d0b);}(_0x18c9,0x13c));var _0x918c=function(_0x2e04ef,_0x31a596){_0x2e04ef=_0x2e04ef-0x0;var _0x5722b0=_0x18c9[_0x2e04ef];return _0x5722b0;};'use strict';var client=require(_0x918c('0x0'));exports[_0x918c('0x1')]=function(){return function(){return client[_0x918c('0x2')](_0x918c('0x3'),{'options':{'raw':![],'attributes':['id',_0x918c('0x4'),_0x918c('0x5'),'ecm',_0x918c('0x6'),_0x918c('0x7'),'minrate',_0x918c('0x8'),'modem',_0x918c('0x9'),_0x918c('0xa'),_0x918c('0xb'),_0x918c('0xc'),_0x918c('0xd'),'ListId',_0x918c('0xe')],'include':[{'model':'Trunk','as':'Trunk','attributes':['id',_0x918c('0x4'),_0x918c('0xf'),_0x918c('0x10')]}]},'log':_0x918c('0x11')});};};exports[_0x918c('0x12')]=function(_0x1f3fbf,_0x17919b){return client[_0x918c('0x2')]('NotifyFaxAccount',{'account':{'id':_0x1f3fbf},'body':_0x17919b,'log':'NotifyFaxAccount'});};
\ No newline at end of file
+var _0x8ba6=['getFaxAccount','notify','NotifyFaxAccount','../client','Request','name','description','ecm','headerinfo','maxrate','modem','gateway','faxdetect','t38timeout','tech','TrunkId','ListId','Trunk','callerid','active'];(function(_0x5e0a38,_0xd6d811){var _0x347f0f=function(_0x514275){while(--_0x514275){_0x5e0a38['push'](_0x5e0a38['shift']());}};_0x347f0f(++_0xd6d811);}(_0x8ba6,0x11b));var _0x68ba=function(_0x4db666,_0x39bbff){_0x4db666=_0x4db666-0x0;var _0x52640f=_0x8ba6[_0x4db666];return _0x52640f;};'use strict';var client=require(_0x68ba('0x0'));exports['getFaxAccounts']=function(){return function(){return client[_0x68ba('0x1')]('GetFaxAccount',{'options':{'raw':![],'attributes':['id',_0x68ba('0x2'),_0x68ba('0x3'),_0x68ba('0x4'),_0x68ba('0x5'),'localstationid','minrate',_0x68ba('0x6'),_0x68ba('0x7'),_0x68ba('0x8'),_0x68ba('0x9'),_0x68ba('0xa'),_0x68ba('0xb'),_0x68ba('0xc'),_0x68ba('0xd'),'key'],'include':[{'model':_0x68ba('0xe'),'as':_0x68ba('0xe'),'attributes':['id',_0x68ba('0x2'),_0x68ba('0xf'),_0x68ba('0x10')]}]},'log':_0x68ba('0x11')});};};exports[_0x68ba('0x12')]=function(_0x2cbef4,_0x2535ed){return client[_0x68ba('0x1')]('NotifyFaxAccount',{'account':{'id':_0x2cbef4},'body':_0x2535ed,'log':_0x68ba('0x13')});};
\ No newline at end of file
index 96c5be6..be3ecf1 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc50c=['UpdateFaxMessage','update','Request'];(function(_0x3976fd,_0x3a804c){var _0x535ae3=function(_0x28825b){while(--_0x28825b){_0x3976fd['push'](_0x3976fd['shift']());}};_0x535ae3(++_0x3a804c);}(_0xc50c,0xd3));var _0xcc50=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xc50c[_0x413feb];return _0x40ee88;};'use strict';var client=require('../client');exports[_0xcc50('0x0')]=function(_0x38af9d,_0x439112){return client[_0xcc50('0x1')](_0xcc50('0x2'),{'body':_0x439112,'options':{'where':{'AttachmentId':_0x38af9d}},'log':_0xcc50('0x2')});};
\ No newline at end of file
+var _0x4fce=['UpdateFaxMessage','../client'];(function(_0xa9645c,_0x51922d){var _0x4c3d4b=function(_0x1d343d){while(--_0x1d343d){_0xa9645c['push'](_0xa9645c['shift']());}};_0x4c3d4b(++_0x51922d);}(_0x4fce,0x145));var _0xe4fc=function(_0x477d04,_0x386235){_0x477d04=_0x477d04-0x0;var _0x41a02a=_0x4fce[_0x477d04];return _0x41a02a;};'use strict';var client=require(_0xe4fc('0x0'));exports['update']=function(_0x240e2e,_0x176e5a){return client['Request'](_0xe4fc('0x1'),{'body':_0x176e5a,'options':{'where':{'AttachmentId':_0x240e2e}},'log':'UpdateFaxMessage'});};
\ No newline at end of file
index b27656c..3853119 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7369=['type','serverUrl','DeskConfiguration','DeskField','Subjects','content','Variable','key','variableName','idField','nameField','Tags','../../client','Request','GetDeskAccount','name','username','remoteUri','authType'];(function(_0xdc0c5d,_0x1f4def){var _0x388210=function(_0x4ea26d){while(--_0x4ea26d){_0xdc0c5d['push'](_0xdc0c5d['shift']());}};_0x388210(++_0x1f4def);}(_0x7369,0xa4));var _0x9736=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x7369[_0x3054be];return _0x3df150;};'use strict';var client=require(_0x9736('0x0'));exports['getDeskAccounts']=function(){return function(_0x4be1f0){return client[_0x9736('0x1')](_0x9736('0x2'),{'options':{'raw':![],'attributes':['id',_0x9736('0x3'),'description',_0x9736('0x4'),'password',_0x9736('0x5'),_0x9736('0x6'),_0x9736('0x7'),_0x9736('0x8')],'include':[{'model':_0x9736('0x9'),'as':'Configurations','attributes':['id',_0x9736('0x3')],'include':[{'model':_0x9736('0xa'),'as':_0x9736('0xb'),'attributes':['id','type',_0x9736('0xc'),'variableName'],'include':[{'model':_0x9736('0xd'),'as':_0x9736('0xd'),'attributes':['id',_0x9736('0x3')]}]},{'model':_0x9736('0xa'),'as':'Descriptions','attributes':['id',_0x9736('0x7'),'content',_0x9736('0xe'),'keyType','keyContent',_0x9736('0xf')],'include':[{'model':'Variable','as':_0x9736('0xd'),'attributes':['id',_0x9736('0x3')]}]},{'model':_0x9736('0xa'),'as':'Fields','attributes':['id','type',_0x9736('0xc'),_0x9736('0x10'),_0x9736('0x11'),'customField',_0x9736('0xf')],'include':[{'model':_0x9736('0xd'),'as':_0x9736('0xd'),'attributes':['id',_0x9736('0x3')]}]},{'model':'Tag','as':_0x9736('0x12'),'attributes':['id',_0x9736('0x3')]}]}]},'log':_0x9736('0x2')});};};
\ No newline at end of file
+var _0xe624=['Descriptions','key','keyType','Fields','content','idField','nameField','customField','variableName','Tag','Tags','GetDeskAccount','../../client','getDeskAccounts','Request','name','description','username','password','remoteUri','type','serverUrl','DeskConfiguration','Configurations','DeskField','Subjects','Variable'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe624,0xff));var _0x4e62=function(_0x5b6cf1,_0x32fdcd){_0x5b6cf1=_0x5b6cf1-0x0;var _0x46278c=_0xe624[_0x5b6cf1];return _0x46278c;};'use strict';var client=require(_0x4e62('0x0'));exports[_0x4e62('0x1')]=function(){return function(_0x7279a9){return client[_0x4e62('0x2')]('GetDeskAccount',{'options':{'raw':![],'attributes':['id',_0x4e62('0x3'),_0x4e62('0x4'),_0x4e62('0x5'),_0x4e62('0x6'),_0x4e62('0x7'),'authType',_0x4e62('0x8'),_0x4e62('0x9')],'include':[{'model':_0x4e62('0xa'),'as':_0x4e62('0xb'),'attributes':['id',_0x4e62('0x3')],'include':[{'model':_0x4e62('0xc'),'as':_0x4e62('0xd'),'attributes':['id',_0x4e62('0x8'),'content','variableName'],'include':[{'model':'Variable','as':_0x4e62('0xe'),'attributes':['id',_0x4e62('0x3')]}]},{'model':_0x4e62('0xc'),'as':_0x4e62('0xf'),'attributes':['id','type','content',_0x4e62('0x10'),_0x4e62('0x11'),'keyContent','variableName'],'include':[{'model':_0x4e62('0xe'),'as':_0x4e62('0xe'),'attributes':['id',_0x4e62('0x3')]}]},{'model':_0x4e62('0xc'),'as':_0x4e62('0x12'),'attributes':['id','type',_0x4e62('0x13'),_0x4e62('0x14'),_0x4e62('0x15'),_0x4e62('0x16'),_0x4e62('0x17')],'include':[{'model':_0x4e62('0xe'),'as':_0x4e62('0xe'),'attributes':['id',_0x4e62('0x3')]}]},{'model':_0x4e62('0x18'),'as':_0x4e62('0x19'),'attributes':['id',_0x4e62('0x3')]}]}]},'log':_0x4e62('0x1a')});};};
\ No newline at end of file
index f080229..6279014 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5f2=['Descriptions','content','key','keyType','keyContent','Fields','idField','nameField','customField','variableName','../../client','getDynamics365Accounts','username','password','remoteUri','tenantId','clientId','Dynamics365Configuration','Configurations','Subjects','type','Variable','name','Dynamics365Field'];(function(_0x1d88cf,_0x4ab82d){var _0x206f66=function(_0x46816e){while(--_0x46816e){_0x1d88cf['push'](_0x1d88cf['shift']());}};_0x206f66(++_0x4ab82d);}(_0xe5f2,0x112));var _0x2e5f=function(_0x9ebe0c,_0x50752a){_0x9ebe0c=_0x9ebe0c-0x0;var _0x3f1e41=_0xe5f2[_0x9ebe0c];return _0x3f1e41;};'use strict';var client=require(_0x2e5f('0x0'));exports[_0x2e5f('0x1')]=function(){return function(_0x237c59){return client['Request']('GetDynamics365Account',{'options':{'raw':![],'attributes':['id','name',_0x2e5f('0x2'),_0x2e5f('0x3'),_0x2e5f('0x4'),_0x2e5f('0x5'),_0x2e5f('0x6'),'clientSecret','serverUrl','description'],'include':[{'model':_0x2e5f('0x7'),'as':_0x2e5f('0x8'),'attributes':['id','name','ticketType'],'include':[{'model':'Dynamics365Field','as':_0x2e5f('0x9'),'attributes':['id',_0x2e5f('0xa'),'content','variableName'],'include':[{'model':_0x2e5f('0xb'),'as':_0x2e5f('0xb'),'attributes':['id',_0x2e5f('0xc')]}]},{'model':_0x2e5f('0xd'),'as':_0x2e5f('0xe'),'attributes':['id',_0x2e5f('0xa'),_0x2e5f('0xf'),_0x2e5f('0x10'),_0x2e5f('0x11'),_0x2e5f('0x12'),'variableName'],'include':[{'model':_0x2e5f('0xb'),'as':'Variable','attributes':['id',_0x2e5f('0xc')]}]},{'model':_0x2e5f('0xd'),'as':_0x2e5f('0x13'),'attributes':['id',_0x2e5f('0xa'),_0x2e5f('0xf'),_0x2e5f('0x14'),_0x2e5f('0x15'),_0x2e5f('0x16'),_0x2e5f('0x17')],'include':[{'model':_0x2e5f('0xb'),'as':'Variable','attributes':['id','name']}]}]}]},'log':'GetDynamics365Account'});};};
\ No newline at end of file
+var _0x53c0=['Variable','Descriptions','type','content','keyType','keyContent','variableName','Fields','idField','nameField','customField','../../client','getDynamics365Accounts','Request','GetDynamics365Account','name','username','password','remoteUri','tenantId','clientId','serverUrl','description','Configurations','ticketType','Dynamics365Field','Subjects'];(function(_0x5b6cf1,_0x32fdcd){var _0x46278c=function(_0x53fd9b){while(--_0x53fd9b){_0x5b6cf1['push'](_0x5b6cf1['shift']());}};_0x46278c(++_0x32fdcd);}(_0x53c0,0x77));var _0x053c=function(_0x2bd88d,_0x2d5dc3){_0x2bd88d=_0x2bd88d-0x0;var _0x5516d4=_0x53c0[_0x2bd88d];return _0x5516d4;};'use strict';var client=require(_0x053c('0x0'));exports[_0x053c('0x1')]=function(){return function(_0xabbaf5){return client[_0x053c('0x2')](_0x053c('0x3'),{'options':{'raw':![],'attributes':['id',_0x053c('0x4'),_0x053c('0x5'),_0x053c('0x6'),_0x053c('0x7'),_0x053c('0x8'),_0x053c('0x9'),'clientSecret',_0x053c('0xa'),_0x053c('0xb')],'include':[{'model':'Dynamics365Configuration','as':_0x053c('0xc'),'attributes':['id',_0x053c('0x4'),_0x053c('0xd')],'include':[{'model':_0x053c('0xe'),'as':_0x053c('0xf'),'attributes':['id','type','content','variableName'],'include':[{'model':_0x053c('0x10'),'as':_0x053c('0x10'),'attributes':['id',_0x053c('0x4')]}]},{'model':_0x053c('0xe'),'as':_0x053c('0x11'),'attributes':['id',_0x053c('0x12'),_0x053c('0x13'),'key',_0x053c('0x14'),_0x053c('0x15'),_0x053c('0x16')],'include':[{'model':_0x053c('0x10'),'as':_0x053c('0x10'),'attributes':['id',_0x053c('0x4')]}]},{'model':_0x053c('0xe'),'as':_0x053c('0x17'),'attributes':['id',_0x053c('0x12'),'content',_0x053c('0x18'),_0x053c('0x19'),_0x053c('0x1a'),'variableName'],'include':[{'model':_0x053c('0x10'),'as':_0x053c('0x10'),'attributes':['id',_0x053c('0x4')]}]}]}]},'log':_0x053c('0x3')});};};
\ No newline at end of file
index 16dc664..ebbb34a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1cc3=['key','keyType','keyContent','Fields','idField','nameField','customField','GetFreshdeskAccount','../../client','getFreshdeskAccounts','Request','name','username','apiKey','serverUrl','FreshdeskConfiguration','Configurations','Tag','FreshdeskField','Subjects','type','content','variableName','Variable','Descriptions'];(function(_0x1234cd,_0x3a11e3){var _0x5e83b2=function(_0x3ca27d){while(--_0x3ca27d){_0x1234cd['push'](_0x1234cd['shift']());}};_0x5e83b2(++_0x3a11e3);}(_0x1cc3,0x11b));var _0x31cc=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x1cc3[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0x31cc('0x0'));exports[_0x31cc('0x1')]=function(){return function(_0x50bc9e){return client[_0x31cc('0x2')]('GetFreshdeskAccount',{'options':{'raw':![],'attributes':['id',_0x31cc('0x3'),_0x31cc('0x4'),_0x31cc('0x5'),'remoteUri',_0x31cc('0x6')],'include':[{'model':_0x31cc('0x7'),'as':_0x31cc('0x8'),'attributes':['id','name'],'include':[{'model':_0x31cc('0x9'),'attributes':['id',_0x31cc('0x3')]},{'model':_0x31cc('0xa'),'as':_0x31cc('0xb'),'attributes':['id',_0x31cc('0xc'),_0x31cc('0xd'),_0x31cc('0xe')],'include':[{'model':_0x31cc('0xf'),'as':_0x31cc('0xf'),'attributes':['id','name']}]},{'model':_0x31cc('0xa'),'as':_0x31cc('0x10'),'attributes':['id',_0x31cc('0xc'),_0x31cc('0xd'),_0x31cc('0x11'),_0x31cc('0x12'),_0x31cc('0x13'),_0x31cc('0xe')],'include':[{'model':_0x31cc('0xf'),'as':_0x31cc('0xf'),'attributes':['id','name']}]},{'model':_0x31cc('0xa'),'as':_0x31cc('0x14'),'attributes':['id','type',_0x31cc('0xd'),_0x31cc('0x15'),_0x31cc('0x16'),_0x31cc('0x17'),_0x31cc('0xe')],'include':[{'model':_0x31cc('0xf'),'as':_0x31cc('0xf'),'attributes':['id',_0x31cc('0x3')]}]}]}]},'log':_0x31cc('0x18')});};};
\ No newline at end of file
+var _0x438a=['username','apiKey','remoteUri','serverUrl','FreshdeskConfiguration','Configurations','Tag','FreshdeskField','Subjects','type','content','variableName','Variable','Descriptions','key','keyType','keyContent','Fields','idField','nameField','../../client','getFreshdeskAccounts','Request','GetFreshdeskAccount','name'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x438a,0x18b));var _0xa438=function(_0x5b538b,_0x533db2){_0x5b538b=_0x5b538b-0x0;var _0x50b776=_0x438a[_0x5b538b];return _0x50b776;};'use strict';var client=require(_0xa438('0x0'));exports[_0xa438('0x1')]=function(){return function(_0x3511f5){return client[_0xa438('0x2')](_0xa438('0x3'),{'options':{'raw':![],'attributes':['id',_0xa438('0x4'),_0xa438('0x5'),_0xa438('0x6'),_0xa438('0x7'),_0xa438('0x8')],'include':[{'model':_0xa438('0x9'),'as':_0xa438('0xa'),'attributes':['id',_0xa438('0x4')],'include':[{'model':_0xa438('0xb'),'attributes':['id',_0xa438('0x4')]},{'model':_0xa438('0xc'),'as':_0xa438('0xd'),'attributes':['id',_0xa438('0xe'),_0xa438('0xf'),_0xa438('0x10')],'include':[{'model':_0xa438('0x11'),'as':_0xa438('0x11'),'attributes':['id','name']}]},{'model':'FreshdeskField','as':_0xa438('0x12'),'attributes':['id',_0xa438('0xe'),_0xa438('0xf'),_0xa438('0x13'),_0xa438('0x14'),_0xa438('0x15'),'variableName'],'include':[{'model':_0xa438('0x11'),'as':'Variable','attributes':['id',_0xa438('0x4')]}]},{'model':'FreshdeskField','as':_0xa438('0x16'),'attributes':['id','type',_0xa438('0xf'),_0xa438('0x17'),_0xa438('0x18'),'customField',_0xa438('0x10')],'include':[{'model':_0xa438('0x11'),'as':_0xa438('0x11'),'attributes':['id',_0xa438('0x4')]}]}]}]},'log':_0xa438('0x3')});};};
\ No newline at end of file
index 8c31577..a1f77e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x187d=['key','keyType','GetFreshsalesccount','../../client','Request','GetFreshsalesAccount','name','username','apiKey','serverUrl','FreshsalesConfiguration','FreshsalesField','Subjects','type','content','variableName','Variable','Descriptions'];(function(_0x152aa1,_0x307718){var _0x1bc01a=function(_0xd3211e){while(--_0xd3211e){_0x152aa1['push'](_0x152aa1['shift']());}};_0x1bc01a(++_0x307718);}(_0x187d,0x93));var _0xd187=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x187d[_0x2d8fc2];return _0x3a9e53;};'use strict';var client=require(_0xd187('0x0'));exports['getFreshsalesAccounts']=function(){return function(_0x3b9b6d){return client[_0xd187('0x1')](_0xd187('0x2'),{'options':{'raw':![],'attributes':['id',_0xd187('0x3'),_0xd187('0x4'),_0xd187('0x5'),'remoteUri',_0xd187('0x6')],'include':[{'model':_0xd187('0x7'),'as':'Configurations','attributes':['id',_0xd187('0x3')],'include':[{'model':_0xd187('0x8'),'as':_0xd187('0x9'),'attributes':['id',_0xd187('0xa'),_0xd187('0xb'),_0xd187('0xc')],'include':[{'model':_0xd187('0xd'),'as':_0xd187('0xd'),'attributes':['id','name']}]},{'model':_0xd187('0x8'),'as':_0xd187('0xe'),'attributes':['id',_0xd187('0xa'),_0xd187('0xb'),_0xd187('0xf'),_0xd187('0x10'),'keyContent',_0xd187('0xc')],'include':[{'model':_0xd187('0xd'),'as':_0xd187('0xd'),'attributes':['id','name']}]}]}]},'log':_0xd187('0x11')});};};
\ No newline at end of file
+var _0xfdbd=['Descriptions','type','content','key','keyType','GetFreshsalesccount','../../client','getFreshsalesAccounts','Request','GetFreshsalesAccount','name','username','apiKey','remoteUri','FreshsalesConfiguration','FreshsalesField','variableName','Variable'];(function(_0x595f52,_0x3c8e9b){var _0x5b24ff=function(_0x133ce6){while(--_0x133ce6){_0x595f52['push'](_0x595f52['shift']());}};_0x5b24ff(++_0x3c8e9b);}(_0xfdbd,0xf0));var _0xdfdb=function(_0xb77dfe,_0x39c4c7){_0xb77dfe=_0xb77dfe-0x0;var _0x5e4f5d=_0xfdbd[_0xb77dfe];return _0x5e4f5d;};'use strict';var client=require(_0xdfdb('0x0'));exports[_0xdfdb('0x1')]=function(){return function(_0x270b19){return client[_0xdfdb('0x2')](_0xdfdb('0x3'),{'options':{'raw':![],'attributes':['id',_0xdfdb('0x4'),_0xdfdb('0x5'),_0xdfdb('0x6'),_0xdfdb('0x7'),'serverUrl'],'include':[{'model':_0xdfdb('0x8'),'as':'Configurations','attributes':['id',_0xdfdb('0x4')],'include':[{'model':_0xdfdb('0x9'),'as':'Subjects','attributes':['id','type','content',_0xdfdb('0xa')],'include':[{'model':_0xdfdb('0xb'),'as':'Variable','attributes':['id',_0xdfdb('0x4')]}]},{'model':_0xdfdb('0x9'),'as':_0xdfdb('0xc'),'attributes':['id',_0xdfdb('0xd'),_0xdfdb('0xe'),_0xdfdb('0xf'),_0xdfdb('0x10'),'keyContent',_0xdfdb('0xa')],'include':[{'model':_0xdfdb('0xb'),'as':'Variable','attributes':['id',_0xdfdb('0x4')]}]}]}]},'log':_0xdfdb('0x11')});};};
\ No newline at end of file
index 8eb5192..6424dd8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe666=['password','clientId','clientSecret','securityToken','serverUrl','type','ticketType','leadId','additionalSearchAccount','additionalSearchContact','additionalSearchLead','Subjects','Variable','Descriptions','Fields','../../client','Request','name'];(function(_0x56c7c0,_0x463d97){var _0x666b9a=function(_0x56e4a5){while(--_0x56e4a5){_0x56c7c0['push'](_0x56c7c0['shift']());}};_0x666b9a(++_0x463d97);}(_0xe666,0x189));var _0x6e66=function(_0x39410c,_0x351a2d){_0x39410c=_0x39410c-0x0;var _0x2a308e=_0xe666[_0x39410c];return _0x2a308e;};'use strict';var client=require(_0x6e66('0x0'));exports['getSalesforceAccounts']=function(){return function(_0x4ded2c){return client[_0x6e66('0x1')]('GetSalesforceAccount',{'options':{'raw':![],'attributes':['id',_0x6e66('0x2'),'username',_0x6e66('0x3'),'remoteUri',_0x6e66('0x4'),_0x6e66('0x5'),_0x6e66('0x6'),_0x6e66('0x7'),_0x6e66('0x8')],'include':[{'model':'SalesforceConfiguration','as':'Configurations','attributes':['id','name','moduleSearch','moduleCreate',_0x6e66('0x9'),_0x6e66('0xa'),_0x6e66('0xb'),_0x6e66('0xc'),_0x6e66('0xd')],'include':[{'model':'SalesforceField','as':_0x6e66('0xe'),'include':[{'model':_0x6e66('0xf'),'as':'Variable','attributes':['id',_0x6e66('0x2')]}]},{'model':'SalesforceField','as':_0x6e66('0x10'),'include':[{'model':_0x6e66('0xf'),'as':_0x6e66('0xf'),'attributes':['id',_0x6e66('0x2')]}]},{'model':'SalesforceField','as':_0x6e66('0x11'),'include':[{'model':_0x6e66('0xf'),'as':_0x6e66('0xf'),'attributes':['id',_0x6e66('0x2')]}]}]}]},'log':'GetSalesforceAccount'});};};
\ No newline at end of file
+var _0x3176=['serverUrl','type','SalesforceConfiguration','Configurations','moduleSearch','moduleCreate','ticketType','additionalSearchAccount','SalesforceField','Subjects','Variable','Descriptions','../../client','getSalesforceAccounts','Request','GetSalesforceAccount','name','username','password','remoteUri','clientId','clientSecret','securityToken'];(function(_0x1edd59,_0x5d5245){var _0x431eb1=function(_0x23c9b1){while(--_0x23c9b1){_0x1edd59['push'](_0x1edd59['shift']());}};_0x431eb1(++_0x5d5245);}(_0x3176,0x1d8));var _0x6317=function(_0x501e12,_0x13d9e0){_0x501e12=_0x501e12-0x0;var _0x39da44=_0x3176[_0x501e12];return _0x39da44;};'use strict';var client=require(_0x6317('0x0'));exports[_0x6317('0x1')]=function(){return function(_0x3fa186){return client[_0x6317('0x2')](_0x6317('0x3'),{'options':{'raw':![],'attributes':['id',_0x6317('0x4'),_0x6317('0x5'),_0x6317('0x6'),_0x6317('0x7'),_0x6317('0x8'),_0x6317('0x9'),_0x6317('0xa'),_0x6317('0xb'),_0x6317('0xc')],'include':[{'model':_0x6317('0xd'),'as':_0x6317('0xe'),'attributes':['id','name',_0x6317('0xf'),_0x6317('0x10'),_0x6317('0x11'),'leadId',_0x6317('0x12'),'additionalSearchContact','additionalSearchLead'],'include':[{'model':_0x6317('0x13'),'as':_0x6317('0x14'),'include':[{'model':_0x6317('0x15'),'as':_0x6317('0x15'),'attributes':['id',_0x6317('0x4')]}]},{'model':'SalesforceField','as':_0x6317('0x16'),'include':[{'model':_0x6317('0x15'),'as':'Variable','attributes':['id',_0x6317('0x4')]}]},{'model':_0x6317('0x13'),'as':'Fields','include':[{'model':_0x6317('0x15'),'as':_0x6317('0x15'),'attributes':['id','name']}]}]}]},'log':_0x6317('0x3')});};};
\ No newline at end of file
index 3df66a4..cf3fe63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xba34=['keyContent','Fields','idField','nameField','customField','GetServicenowkAccount','../../client','getServicenowAccounts','Request','GetServicenowAccount','password','email','remoteUri','serverUrl','ServicenowConfiguration','Configurations','name','Subjects','type','content','variableName','Variable','ServicenowField','Descriptions','keyType'];(function(_0x160b8d,_0xb14dcb){var _0x430a81=function(_0x3875d7){while(--_0x3875d7){_0x160b8d['push'](_0x160b8d['shift']());}};_0x430a81(++_0xb14dcb);}(_0xba34,0x119));var _0x4ba3=function(_0x179d0d,_0x5e7f00){_0x179d0d=_0x179d0d-0x0;var _0x156c04=_0xba34[_0x179d0d];return _0x156c04;};'use strict';var client=require(_0x4ba3('0x0'));exports[_0x4ba3('0x1')]=function(){return function(_0xb04f7b){return client[_0x4ba3('0x2')](_0x4ba3('0x3'),{'options':{'raw':![],'attributes':['id','name','description','username',_0x4ba3('0x4'),_0x4ba3('0x5'),_0x4ba3('0x6'),_0x4ba3('0x7')],'include':[{'model':_0x4ba3('0x8'),'as':_0x4ba3('0x9'),'attributes':['id',_0x4ba3('0xa')],'include':[{'model':'ServicenowField','as':_0x4ba3('0xb'),'attributes':['id',_0x4ba3('0xc'),_0x4ba3('0xd'),_0x4ba3('0xe')],'include':[{'model':_0x4ba3('0xf'),'as':_0x4ba3('0xf'),'attributes':['id',_0x4ba3('0xa')]}]},{'model':_0x4ba3('0x10'),'as':_0x4ba3('0x11'),'attributes':['id',_0x4ba3('0xc'),_0x4ba3('0xd'),'key',_0x4ba3('0x12'),_0x4ba3('0x13'),'variableName'],'include':[{'model':_0x4ba3('0xf'),'as':'Variable','attributes':['id',_0x4ba3('0xa')]}]},{'model':'ServicenowField','as':_0x4ba3('0x14'),'attributes':['id',_0x4ba3('0xc'),_0x4ba3('0xd'),_0x4ba3('0x15'),_0x4ba3('0x16'),_0x4ba3('0x17'),_0x4ba3('0xe')],'include':[{'model':_0x4ba3('0xf'),'as':_0x4ba3('0xf'),'attributes':['id',_0x4ba3('0xa')]}]}]}]},'log':_0x4ba3('0x18')});};};
\ No newline at end of file
+var _0x2675=['ServicenowField','type','content','Variable','Descriptions','keyType','variableName','Fields','idField','nameField','customField','GetServicenowkAccount','../../client','GetServicenowAccount','name','username','password','remoteUri','serverUrl','ServicenowConfiguration','Configurations'];(function(_0x32b4ec,_0x20dec2){var _0x2e6482=function(_0x5775b9){while(--_0x5775b9){_0x32b4ec['push'](_0x32b4ec['shift']());}};_0x2e6482(++_0x20dec2);}(_0x2675,0x75));var _0x5267=function(_0x538aa,_0x1dd8be){_0x538aa=_0x538aa-0x0;var _0x131a36=_0x2675[_0x538aa];return _0x131a36;};'use strict';var client=require(_0x5267('0x0'));exports['getServicenowAccounts']=function(){return function(_0x53e71f){return client['Request'](_0x5267('0x1'),{'options':{'raw':![],'attributes':['id',_0x5267('0x2'),'description',_0x5267('0x3'),_0x5267('0x4'),'email',_0x5267('0x5'),_0x5267('0x6')],'include':[{'model':_0x5267('0x7'),'as':_0x5267('0x8'),'attributes':['id',_0x5267('0x2')],'include':[{'model':_0x5267('0x9'),'as':'Subjects','attributes':['id',_0x5267('0xa'),_0x5267('0xb'),'variableName'],'include':[{'model':_0x5267('0xc'),'as':'Variable','attributes':['id',_0x5267('0x2')]}]},{'model':_0x5267('0x9'),'as':_0x5267('0xd'),'attributes':['id','type',_0x5267('0xb'),'key',_0x5267('0xe'),'keyContent',_0x5267('0xf')],'include':[{'model':_0x5267('0xc'),'as':_0x5267('0xc'),'attributes':['id',_0x5267('0x2')]}]},{'model':_0x5267('0x9'),'as':_0x5267('0x10'),'attributes':['id',_0x5267('0xa'),_0x5267('0xb'),_0x5267('0x11'),_0x5267('0x12'),_0x5267('0x13'),_0x5267('0xf')],'include':[{'model':_0x5267('0xc'),'as':'Variable','attributes':['id','name']}]}]}]},'log':_0x5267('0x14')});};};
\ No newline at end of file
index 5c98507..0ae295b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xadb5=['idField','nameField','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','password','remoteUri','serverUrl','Configurations','SugarcrmField','Subjects','type','content','variableName','Variable','Descriptions','keyContent','Fields'];(function(_0x3f1718,_0x5360ad){var _0x29627e=function(_0x18abc1){while(--_0x18abc1){_0x3f1718['push'](_0x3f1718['shift']());}};_0x29627e(++_0x5360ad);}(_0xadb5,0xad));var _0x5adb=function(_0x51eda2,_0x598570){_0x51eda2=_0x51eda2-0x0;var _0xc63a6b=_0xadb5[_0x51eda2];return _0xc63a6b;};'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'),'username',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6')],'include':[{'model':'SugarcrmConfiguration','as':_0x5adb('0x7'),'attributes':['id',_0x5adb('0x3')],'include':[{'model':_0x5adb('0x8'),'as':_0x5adb('0x9'),'attributes':['id',_0x5adb('0xa'),_0x5adb('0xb'),_0x5adb('0xc')],'include':[{'model':_0x5adb('0xd'),'as':_0x5adb('0xd'),'attributes':['id',_0x5adb('0x3')]}]},{'model':_0x5adb('0x8'),'as':_0x5adb('0xe'),'attributes':['id',_0x5adb('0xa'),_0x5adb('0xb'),'key','keyType',_0x5adb('0xf'),_0x5adb('0xc')],'include':[{'model':_0x5adb('0xd'),'as':'Variable','attributes':['id',_0x5adb('0x3')]}]},{'model':'SugarcrmField','as':_0x5adb('0x10'),'attributes':['id','type',_0x5adb('0xb'),_0x5adb('0x11'),_0x5adb('0x12'),'customField',_0x5adb('0xc')],'include':[{'model':_0x5adb('0xd'),'as':_0x5adb('0xd'),'attributes':['id','name']}]}]}]},'log':_0x5adb('0x2')});};};
\ No newline at end of file
+var _0xadb5=['idField','nameField','getSugarcrmAccounts','Request','GetSugarcrmAccount','name','password','remoteUri','serverUrl','Configurations','SugarcrmField','Subjects','type','content','variableName','Variable','Descriptions','keyContent','Fields'];(function(_0x385d89,_0x2fe099){var _0x1454e8=function(_0x19bc6d){while(--_0x19bc6d){_0x385d89['push'](_0x385d89['shift']());}};_0x1454e8(++_0x2fe099);}(_0xadb5,0xad));var _0x5adb=function(_0x50942d,_0x345ec3){_0x50942d=_0x50942d-0x0;var _0x3c926d=_0xadb5[_0x50942d];return _0x3c926d;};'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'),'username',_0x5adb('0x4'),_0x5adb('0x5'),_0x5adb('0x6')],'include':[{'model':'SugarcrmConfiguration','as':_0x5adb('0x7'),'attributes':['id',_0x5adb('0x3')],'include':[{'model':_0x5adb('0x8'),'as':_0x5adb('0x9'),'attributes':['id',_0x5adb('0xa'),_0x5adb('0xb'),_0x5adb('0xc')],'include':[{'model':_0x5adb('0xd'),'as':_0x5adb('0xd'),'attributes':['id',_0x5adb('0x3')]}]},{'model':_0x5adb('0x8'),'as':_0x5adb('0xe'),'attributes':['id',_0x5adb('0xa'),_0x5adb('0xb'),'key','keyType',_0x5adb('0xf'),_0x5adb('0xc')],'include':[{'model':_0x5adb('0xd'),'as':'Variable','attributes':['id',_0x5adb('0x3')]}]},{'model':'SugarcrmField','as':_0x5adb('0x10'),'attributes':['id','type',_0x5adb('0xb'),_0x5adb('0x11'),_0x5adb('0x12'),'customField',_0x5adb('0xc')],'include':[{'model':_0x5adb('0xd'),'as':_0x5adb('0xd'),'attributes':['id','name']}]}]}]},'log':_0x5adb('0x2')});};};
\ No newline at end of file
index 70af751..e5af69d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe51=['type','content','variableName','Variable','VtigerField','Descriptions','key','keyType','Fields','nameField','../../client','getVtigerAccounts','Request','GetVtigerAccount','name','description','serverUrl','VtigerConfiguration','Configurations'];(function(_0x3156cb,_0x3ca7bf){var _0x2e65ef=function(_0x2197c4){while(--_0x2197c4){_0x3156cb['push'](_0x3156cb['shift']());}};_0x2e65ef(++_0x3ca7bf);}(_0xfe51,0xdb));var _0x1fe5=function(_0x5bc4a4,_0x4a5550){_0x5bc4a4=_0x5bc4a4-0x0;var _0xc24d24=_0xfe51[_0x5bc4a4];return _0xc24d24;};'use strict';var client=require(_0x1fe5('0x0'));exports[_0x1fe5('0x1')]=function(){return function(_0x1bd728){return client[_0x1fe5('0x2')](_0x1fe5('0x3'),{'options':{'raw':![],'attributes':['id',_0x1fe5('0x4'),_0x1fe5('0x5'),'username','accessKey','remoteUri',_0x1fe5('0x6')],'include':[{'model':_0x1fe5('0x7'),'as':_0x1fe5('0x8'),'attributes':['id','name'],'include':[{'model':'VtigerField','as':'Subjects','attributes':['id',_0x1fe5('0x9'),_0x1fe5('0xa'),_0x1fe5('0xb')],'include':[{'model':'Variable','as':_0x1fe5('0xc'),'attributes':['id',_0x1fe5('0x4')]}]},{'model':_0x1fe5('0xd'),'as':_0x1fe5('0xe'),'attributes':['id','type','content',_0x1fe5('0xf'),_0x1fe5('0x10'),'keyContent',_0x1fe5('0xb')],'include':[{'model':_0x1fe5('0xc'),'as':_0x1fe5('0xc'),'attributes':['id','name']}]},{'model':_0x1fe5('0xd'),'as':_0x1fe5('0x11'),'attributes':['id',_0x1fe5('0x9'),_0x1fe5('0xa'),'idField',_0x1fe5('0x12'),'customField',_0x1fe5('0xb')],'include':[{'model':_0x1fe5('0xc'),'as':'Variable','attributes':['id','name']}]}]}]},'log':_0x1fe5('0x3')});};};
\ No newline at end of file
+var _0x1173=['getVtigerAccounts','Request','GetVtigerAccount','name','description','username','remoteUri','serverUrl','Configurations','Subjects','type','content','variableName','Variable','Descriptions','key','keyType','keyContent','VtigerField','Fields','idField','customField','../../client'];(function(_0x4d3fdf,_0x5b5d91){var _0x1ddc61=function(_0x1e4a2b){while(--_0x1e4a2b){_0x4d3fdf['push'](_0x4d3fdf['shift']());}};_0x1ddc61(++_0x5b5d91);}(_0x1173,0x12a));var _0x3117=function(_0x12954a,_0x304691){_0x12954a=_0x12954a-0x0;var _0x5ccde2=_0x1173[_0x12954a];return _0x5ccde2;};'use strict';var client=require(_0x3117('0x0'));exports[_0x3117('0x1')]=function(){return function(_0x366a17){return client[_0x3117('0x2')](_0x3117('0x3'),{'options':{'raw':![],'attributes':['id',_0x3117('0x4'),_0x3117('0x5'),_0x3117('0x6'),'accessKey',_0x3117('0x7'),_0x3117('0x8')],'include':[{'model':'VtigerConfiguration','as':_0x3117('0x9'),'attributes':['id','name'],'include':[{'model':'VtigerField','as':_0x3117('0xa'),'attributes':['id',_0x3117('0xb'),_0x3117('0xc'),_0x3117('0xd')],'include':[{'model':_0x3117('0xe'),'as':_0x3117('0xe'),'attributes':['id','name']}]},{'model':'VtigerField','as':_0x3117('0xf'),'attributes':['id','type',_0x3117('0xc'),_0x3117('0x10'),_0x3117('0x11'),_0x3117('0x12'),_0x3117('0xd')],'include':[{'model':_0x3117('0xe'),'as':_0x3117('0xe'),'attributes':['id',_0x3117('0x4')]}]},{'model':_0x3117('0x13'),'as':_0x3117('0x14'),'attributes':['id',_0x3117('0xb'),'content',_0x3117('0x15'),'nameField',_0x3117('0x16'),_0x3117('0xd')],'include':[{'model':_0x3117('0xe'),'as':_0x3117('0xe'),'attributes':['id',_0x3117('0x4')]}]}]}]},'log':_0x3117('0x3')});};};
\ No newline at end of file
index 09ff4e1..9697e9e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2e9d=['Descriptions','key','keyContent','Fields','idField','nameField','customField','../../client','getZendeskAccounts','Request','GetZendeskAccount','username','token','remoteUri','authType','serverUrl','Configurations','name','Tag','ZendeskField','type','content','variableName','Variable'];(function(_0x2da1d0,_0x535276){var _0x3bb203=function(_0x4e6fef){while(--_0x4e6fef){_0x2da1d0['push'](_0x2da1d0['shift']());}};_0x3bb203(++_0x535276);}(_0x2e9d,0x7f));var _0xd2e9=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0x2e9d[_0x65c50e];return _0x4573e7;};'use strict';var client=require(_0xd2e9('0x0'));exports[_0xd2e9('0x1')]=function(){return function(_0x201288){return client[_0xd2e9('0x2')](_0xd2e9('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xd2e9('0x4'),'password',_0xd2e9('0x5'),_0xd2e9('0x6'),_0xd2e9('0x7'),_0xd2e9('0x8'),'type'],'include':[{'model':'ZendeskConfiguration','as':_0xd2e9('0x9'),'attributes':['id',_0xd2e9('0xa')],'include':[{'model':_0xd2e9('0xb'),'attributes':['id',_0xd2e9('0xa')]},{'model':_0xd2e9('0xc'),'as':'Subjects','attributes':['id',_0xd2e9('0xd'),_0xd2e9('0xe'),_0xd2e9('0xf')],'include':[{'model':'Variable','as':_0xd2e9('0x10'),'attributes':['id',_0xd2e9('0xa')]}]},{'model':_0xd2e9('0xc'),'as':_0xd2e9('0x11'),'attributes':['id',_0xd2e9('0xd'),'content',_0xd2e9('0x12'),'keyType',_0xd2e9('0x13'),'variableName'],'include':[{'model':_0xd2e9('0x10'),'as':_0xd2e9('0x10'),'attributes':['id',_0xd2e9('0xa')]}]},{'model':_0xd2e9('0xc'),'as':_0xd2e9('0x14'),'attributes':['id',_0xd2e9('0xd'),'content',_0xd2e9('0x15'),_0xd2e9('0x16'),_0xd2e9('0x17'),_0xd2e9('0xf')],'include':[{'model':_0xd2e9('0x10'),'as':'Variable','attributes':['id',_0xd2e9('0xa')]}]}]}]},'log':_0xd2e9('0x3')});};};
\ No newline at end of file
+var _0xded6=['authType','serverUrl','ZendeskConfiguration','Tag','ZendeskField','Subjects','content','variableName','Variable','type','key','keyType','keyContent','Fields','customField','getZendeskAccounts','Request','GetZendeskAccount','name','username','password','token'];(function(_0x22b3be,_0x2ee812){var _0x5038d3=function(_0x2c414a){while(--_0x2c414a){_0x22b3be['push'](_0x22b3be['shift']());}};_0x5038d3(++_0x2ee812);}(_0xded6,0x117));var _0x6ded=function(_0x533893,_0x3132ce){_0x533893=_0x533893-0x0;var _0x140d6a=_0xded6[_0x533893];return _0x140d6a;};'use strict';var client=require('../../client');exports[_0x6ded('0x0')]=function(){return function(_0x50d16f){return client[_0x6ded('0x1')](_0x6ded('0x2'),{'options':{'raw':![],'attributes':['id',_0x6ded('0x3'),_0x6ded('0x4'),_0x6ded('0x5'),_0x6ded('0x6'),'remoteUri',_0x6ded('0x7'),_0x6ded('0x8'),'type'],'include':[{'model':_0x6ded('0x9'),'as':'Configurations','attributes':['id',_0x6ded('0x3')],'include':[{'model':_0x6ded('0xa'),'attributes':['id',_0x6ded('0x3')]},{'model':_0x6ded('0xb'),'as':_0x6ded('0xc'),'attributes':['id','type',_0x6ded('0xd'),_0x6ded('0xe')],'include':[{'model':_0x6ded('0xf'),'as':'Variable','attributes':['id',_0x6ded('0x3')]}]},{'model':_0x6ded('0xb'),'as':'Descriptions','attributes':['id',_0x6ded('0x10'),'content',_0x6ded('0x11'),_0x6ded('0x12'),_0x6ded('0x13'),_0x6ded('0xe')],'include':[{'model':'Variable','as':_0x6ded('0xf'),'attributes':['id',_0x6ded('0x3')]}]},{'model':_0x6ded('0xb'),'as':_0x6ded('0x14'),'attributes':['id',_0x6ded('0x10'),_0x6ded('0xd'),'idField','nameField',_0x6ded('0x15'),_0x6ded('0xe')],'include':[{'model':_0x6ded('0xf'),'as':'Variable','attributes':['id','name']}]}]}]},'log':_0x6ded('0x2')});};};
\ No newline at end of file
index e87a282..906df96 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8d2=['variableName','getZohoAccounts','Request','GetZohoAccount','description','zone','clientId','clientSecret','serverUrl','code','refreshToken','ZohoConfiguration','Configurations','name','moduleCreate','moduleSearch','Subjects','type','content','Variable','ZohoField','Descriptions','keyType','idField','nameField'];(function(_0x32b993,_0x1c5989){var _0x482780=function(_0x404179){while(--_0x404179){_0x32b993['push'](_0x32b993['shift']());}};_0x482780(++_0x1c5989);}(_0xc8d2,0x97));var _0x2c8d=function(_0x41acc3,_0x5969a5){_0x41acc3=_0x41acc3-0x0;var _0x160232=_0xc8d2[_0x41acc3];return _0x160232;};'use strict';var client=require('../../client');exports[_0x2c8d('0x0')]=function(){return function(_0x2c5c14){return client[_0x2c8d('0x1')](_0x2c8d('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x2c8d('0x3'),'host',_0x2c8d('0x4'),_0x2c8d('0x5'),_0x2c8d('0x6'),_0x2c8d('0x7'),_0x2c8d('0x8'),_0x2c8d('0x9')],'include':[{'model':_0x2c8d('0xa'),'as':_0x2c8d('0xb'),'attributes':['id',_0x2c8d('0xc'),_0x2c8d('0xd'),_0x2c8d('0xe'),_0x2c8d('0x3')],'include':[{'model':'ZohoField','as':_0x2c8d('0xf'),'attributes':['id',_0x2c8d('0x10'),_0x2c8d('0x11'),'variableName'],'include':[{'model':_0x2c8d('0x12'),'as':'Variable','attributes':['id','name']}]},{'model':_0x2c8d('0x13'),'as':_0x2c8d('0x14'),'attributes':['id','type','content','key',_0x2c8d('0x15'),'keyContent','variableName'],'include':[{'model':_0x2c8d('0x12'),'as':'Variable','attributes':['id',_0x2c8d('0xc')]}]},{'model':'ZohoField','as':'Fields','attributes':['id','type','content',_0x2c8d('0x16'),_0x2c8d('0x17'),'customField',_0x2c8d('0x18')],'include':[{'model':'Variable','as':_0x2c8d('0x12'),'attributes':['id','name']}]}]}]},'log':_0x2c8d('0x2')});};};
\ No newline at end of file
+var _0xe16e=['moduleSearch','ZohoField','Subjects','content','variableName','Variable','keyContent','Fields','type','idField','nameField','../../client','getZohoAccounts','Request','GetZohoAccount','name','description','host','zone','clientId','clientSecret','serverUrl','refreshToken','ZohoConfiguration','Configurations','moduleCreate'];(function(_0x4e713e,_0x1ac682){var _0x296ac0=function(_0x26a297){while(--_0x26a297){_0x4e713e['push'](_0x4e713e['shift']());}};_0x296ac0(++_0x1ac682);}(_0xe16e,0x1df));var _0xee16=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0xe16e[_0x22b68a];return _0x1ac67a;};'use strict';var client=require(_0xee16('0x0'));exports[_0xee16('0x1')]=function(){return function(_0x1b1e92){return client[_0xee16('0x2')](_0xee16('0x3'),{'options':{'raw':![],'attributes':['id',_0xee16('0x4'),_0xee16('0x5'),_0xee16('0x6'),_0xee16('0x7'),_0xee16('0x8'),_0xee16('0x9'),_0xee16('0xa'),'code',_0xee16('0xb')],'include':[{'model':_0xee16('0xc'),'as':_0xee16('0xd'),'attributes':['id',_0xee16('0x4'),_0xee16('0xe'),_0xee16('0xf'),'description'],'include':[{'model':_0xee16('0x10'),'as':_0xee16('0x11'),'attributes':['id','type',_0xee16('0x12'),_0xee16('0x13')],'include':[{'model':'Variable','as':_0xee16('0x14'),'attributes':['id','name']}]},{'model':_0xee16('0x10'),'as':'Descriptions','attributes':['id','type','content','key','keyType',_0xee16('0x15'),_0xee16('0x13')],'include':[{'model':_0xee16('0x14'),'as':_0xee16('0x14'),'attributes':['id',_0xee16('0x4')]}]},{'model':'ZohoField','as':_0xee16('0x16'),'attributes':['id',_0xee16('0x17'),_0xee16('0x12'),_0xee16('0x18'),_0xee16('0x19'),'customField','variableName'],'include':[{'model':_0xee16('0x14'),'as':'Variable','attributes':['id',_0xee16('0x4')]}]}]}]},'log':'GetZohoAccount'});};};
\ No newline at end of file
index af36006..8c4a56e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x49fb=['diff','seconds','queue','agent','accountcode','toNumber','uniqueid','voiceDialReport','endtime','starttime','outbound','exten','dialstring','moment','util','../client','voiceQueueReport','Request','CreateMemberReport','voice','isNil','interface','format','SIP/%s','lastAssignedTo','TALKING','queuecallerleaveAt'];(function(_0xb9232,_0x52ba7c){var _0x4189fb=function(_0x49b84e){while(--_0x49b84e){_0xb9232['push'](_0xb9232['shift']());}};_0x4189fb(++_0x52ba7c);}(_0x49fb,0x1a2));var _0xb49f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x49fb[_0xfae23b];return _0x200640;};'use strict';var moment=require(_0xb49f('0x0'));var _=require('lodash');var util=require(_0xb49f('0x1'));var client=require(_0xb49f('0x2'));exports[_0xb49f('0x3')]=function(_0x47d237){var _0x39f53f=_0x47d237['queuecallercompleteAt']||_0x47d237['queuecallerexitAt'];return client[_0xb49f('0x4')](_0xb49f('0x5'),{'body':{'channel':_0xb49f('0x6'),'membername':_0x47d237['lastAssignedTo'],'interface':_[_0xb49f('0x7')](_0x47d237[_0xb49f('0x8')])?util[_0xb49f('0x9')](_0xb49f('0xa'),_0x47d237[_0xb49f('0xb')]):_0x47d237[_0xb49f('0x8')],'type':_0xb49f('0xc'),'enterAt':_0x47d237[_0xb49f('0xd')],'exitAt':_0x39f53f,'duration':moment(_0x39f53f)[_0xb49f('0xe')](_0x47d237[_0xb49f('0xd')],_0xb49f('0xf')),'data1':'inbound','data2':_0x47d237['calleridnum'],'data3':_0x47d237['exten'],'data4':null,'data5':_0x47d237[_0xb49f('0x10')],'role':_0xb49f('0x11'),'internal':_0x47d237[_0xb49f('0x12')]?_[_0xb49f('0x13')](_0x47d237[_0xb49f('0x12')]):undefined,'uniqueid':_0x47d237[_0xb49f('0x14')]},'log':'CreateMemberReport'});};exports[_0xb49f('0x15')]=function(_0x342673){return client[_0xb49f('0x4')]('CreateMemberReport',{'body':{'channel':_0xb49f('0x6'),'membername':_0x342673['membername'],'interface':_0x342673[_0xb49f('0x8')],'type':_0xb49f('0xc'),'enterAt':_0x342673['starttime'],'exitAt':_0x342673[_0xb49f('0x16')],'duration':moment(_0x342673[_0xb49f('0x16')])[_0xb49f('0xe')](_0x342673['starttime'],'seconds')>=0x0?moment(_0x342673[_0xb49f('0x16')])[_0xb49f('0xe')](_0x342673[_0xb49f('0x17')],_0xb49f('0xf')):null,'data1':_0xb49f('0x18'),'data2':_0x342673[_0xb49f('0x12')],'data3':_0x342673[_0xb49f('0x19')],'data4':_0x342673[_0xb49f('0x1a')]||null,'role':'agent','internal':_0x342673[_0xb49f('0x12')]?_['toNumber'](_0x342673[_0xb49f('0x12')]):undefined,'uniqueid':_0x342673[_0xb49f('0x14')]},'log':'CreateMemberReport'});};
\ No newline at end of file
+var _0xc43e=['endtime','diff','outbound','accountcode','moment','lodash','util','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','queuecallerleaveAt','seconds','inbound','exten','queue','agent','toNumber','uniqueid','membername','starttime'];(function(_0x53d60f,_0xfb96f3){var _0x391554=function(_0x5ea57f){while(--_0x5ea57f){_0x53d60f['push'](_0x53d60f['shift']());}};_0x391554(++_0xfb96f3);}(_0xc43e,0x1ea));var _0xec43=function(_0x52e7e8,_0x442452){_0x52e7e8=_0x52e7e8-0x0;var _0x4a7339=_0xc43e[_0x52e7e8];return _0x4a7339;};'use strict';var moment=require(_0xec43('0x0'));var _=require(_0xec43('0x1'));var util=require(_0xec43('0x2'));var client=require('../client');exports[_0xec43('0x3')]=function(_0x3875ab){var _0x455b90=_0x3875ab[_0xec43('0x4')]||_0x3875ab[_0xec43('0x5')];return client[_0xec43('0x6')](_0xec43('0x7'),{'body':{'channel':_0xec43('0x8'),'membername':_0x3875ab[_0xec43('0x9')],'interface':_[_0xec43('0xa')](_0x3875ab[_0xec43('0xb')])?util[_0xec43('0xc')]('SIP/%s',_0x3875ab[_0xec43('0x9')]):_0x3875ab[_0xec43('0xb')],'type':'TALKING','enterAt':_0x3875ab[_0xec43('0xd')],'exitAt':_0x455b90,'duration':moment(_0x455b90)['diff'](_0x3875ab['queuecallerleaveAt'],_0xec43('0xe')),'data1':_0xec43('0xf'),'data2':_0x3875ab['calleridnum'],'data3':_0x3875ab[_0xec43('0x10')],'data4':null,'data5':_0x3875ab[_0xec43('0x11')],'role':_0xec43('0x12'),'internal':_0x3875ab['accountcode']?_[_0xec43('0x13')](_0x3875ab['accountcode']):undefined,'uniqueid':_0x3875ab[_0xec43('0x14')]},'log':'CreateMemberReport'});};exports['voiceDialReport']=function(_0x1e1dc8){return client[_0xec43('0x6')]('CreateMemberReport',{'body':{'channel':_0xec43('0x8'),'membername':_0x1e1dc8[_0xec43('0x15')],'interface':_0x1e1dc8[_0xec43('0xb')],'type':'TALKING','enterAt':_0x1e1dc8[_0xec43('0x16')],'exitAt':_0x1e1dc8[_0xec43('0x17')],'duration':moment(_0x1e1dc8[_0xec43('0x17')])[_0xec43('0x18')](_0x1e1dc8['starttime'],_0xec43('0xe'))>=0x0?moment(_0x1e1dc8['endtime'])[_0xec43('0x18')](_0x1e1dc8[_0xec43('0x16')],_0xec43('0xe')):null,'data1':_0xec43('0x19'),'data2':_0x1e1dc8[_0xec43('0x1a')],'data3':_0x1e1dc8[_0xec43('0x10')],'data4':_0x1e1dc8['dialstring']||null,'role':_0xec43('0x12'),'internal':_0x1e1dc8[_0xec43('0x1a')]?_['toNumber'](_0x1e1dc8['accountcode']):undefined,'uniqueid':_0x1e1dc8[_0xec43('0x14')]},'log':_0xec43('0x7')});};
\ No newline at end of file
index 4cc24e0..d74ebc9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb49a=['stopRecordingOnTransfer','../client','getSettings','Request','ShowSetting'];(function(_0x3bab40,_0x381406){var _0x46093e=function(_0x1b10e2){while(--_0x1b10e2){_0x3bab40['push'](_0x3bab40['shift']());}};_0x46093e(++_0x381406);}(_0xb49a,0xfb));var _0xab49=function(_0x3c59fc,_0x10dbd2){_0x3c59fc=_0x3c59fc-0x0;var _0x2b78d4=_0xb49a[_0x3c59fc];return _0x2b78d4;};'use strict';var client=require(_0xab49('0x0'));exports[_0xab49('0x1')]=function(){return client[_0xab49('0x2')](_0xab49('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xab49('0x4')]},'log':'GetSettings'});};
\ No newline at end of file
+var _0xf7c3=['../client','getSettings','Request','ShowSetting','GetSettings'];(function(_0x3bd76b,_0x1af0bd){var _0x24473d=function(_0x1fa3c4){while(--_0x1fa3c4){_0x3bd76b['push'](_0x3bd76b['shift']());}};_0x24473d(++_0x1af0bd);}(_0xf7c3,0x154));var _0x3f7c=function(_0x3e6a0c,_0x5e3743){_0x3e6a0c=_0x3e6a0c-0x0;var _0x306142=_0xf7c3[_0x3e6a0c];return _0x306142;};'use strict';var client=require(_0x3f7c('0x0'));exports[_0x3f7c('0x1')]=function(){return client[_0x3f7c('0x2')](_0x3f7c('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0x3f7c('0x4')});};
\ No newline at end of file
index 252c6db..5f7bd78 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa327=['../client','getTemplates','Request','GetTemplate','html'];(function(_0x21dc8d,_0x2d3c63){var _0x42de1a=function(_0x4ec78a){while(--_0x4ec78a){_0x21dc8d['push'](_0x21dc8d['shift']());}};_0x42de1a(++_0x2d3c63);}(_0xa327,0x136));var _0x7a32=function(_0x21ab64,_0x20cda3){_0x21ab64=_0x21ab64-0x0;var _0x5812c9=_0xa327[_0x21ab64];return _0x5812c9;};'use strict';var client=require(_0x7a32('0x0'));exports[_0x7a32('0x1')]=function(_0x13de96){return function(_0x5ed06a){return client[_0x7a32('0x2')](_0x7a32('0x3'),{'options':{'raw':!![],'attributes':['id','name',_0x7a32('0x4')]},'log':_0x7a32('0x3')});};};
\ No newline at end of file
+var _0x4dee=['../client','getTemplates','Request','GetTemplate','html'];(function(_0x48a80d,_0x1b2aaf){var _0x267bcb=function(_0x5e7234){while(--_0x5e7234){_0x48a80d['push'](_0x48a80d['shift']());}};_0x267bcb(++_0x1b2aaf);}(_0x4dee,0x172));var _0xe4de=function(_0xadc71e,_0x14dec4){_0xadc71e=_0xadc71e-0x0;var _0x30cf04=_0x4dee[_0xadc71e];return _0x30cf04;};'use strict';var client=require(_0xe4de('0x0'));exports[_0xe4de('0x1')]=function(_0x3f3c74){return function(_0x1c55fa){return client[_0xe4de('0x2')](_0xe4de('0x3'),{'options':{'raw':!![],'attributes':['id','name',_0xe4de('0x4')]},'log':_0xe4de('0x3')});};};
\ No newline at end of file
index c795eba..93aa441 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf34c=['data4','data5','data6','data7','getTriggers','GetTrigger','channel','Condition','AllConditions','field','operator','value','AnyConditions','action','data1','data2','data3'];(function(_0x30806e,_0x41bb0d){var _0x2777c6=function(_0x2557b6){while(--_0x2557b6){_0x30806e['push'](_0x30806e['shift']());}};_0x2777c6(++_0x41bb0d);}(_0xf34c,0x1cf));var _0xcf34=function(_0x520e31,_0x4ef38e){_0x520e31=_0x520e31-0x0;var _0x24492e=_0xf34c[_0x520e31];return _0x24492e;};'use strict';var client=require('../client');exports[_0xcf34('0x0')]=function(_0x599bb0){return function(_0x38daed){return client['Request'](_0xcf34('0x1'),{'options':{'raw':![],'attributes':['id','name',_0xcf34('0x2'),'status'],'include':[{'model':_0xcf34('0x3'),'as':_0xcf34('0x4'),'attributes':['id',_0xcf34('0x5'),_0xcf34('0x6'),_0xcf34('0x7')]},{'model':_0xcf34('0x3'),'as':_0xcf34('0x8'),'attributes':['id',_0xcf34('0x5'),_0xcf34('0x6'),_0xcf34('0x7')]},{'model':'Action','as':'Actions','attributes':['id',_0xcf34('0x9'),_0xcf34('0xa'),_0xcf34('0xb'),_0xcf34('0xc'),_0xcf34('0xd'),_0xcf34('0xe'),_0xcf34('0xf'),_0xcf34('0x10')]}]},'log':_0xcf34('0x1')});};};
\ No newline at end of file
+var _0x5598=['data7','../client','getTriggers','Request','GetTrigger','channel','status','Condition','AllConditions','field','operator','AnyConditions','value','action','data1','data2','data3','data4','data5','data6'];(function(_0x176317,_0x4897b3){var _0xef2759=function(_0x581e2b){while(--_0x581e2b){_0x176317['push'](_0x176317['shift']());}};_0xef2759(++_0x4897b3);}(_0x5598,0x169));var _0x8559=function(_0x1559a3,_0x1e4f51){_0x1559a3=_0x1559a3-0x0;var _0x3a4b87=_0x5598[_0x1559a3];return _0x3a4b87;};'use strict';var client=require(_0x8559('0x0'));exports[_0x8559('0x1')]=function(_0x4fb4d5){return function(_0x5d8afd){return client[_0x8559('0x2')](_0x8559('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x8559('0x4'),_0x8559('0x5')],'include':[{'model':_0x8559('0x6'),'as':_0x8559('0x7'),'attributes':['id',_0x8559('0x8'),_0x8559('0x9'),'value']},{'model':'Condition','as':_0x8559('0xa'),'attributes':['id',_0x8559('0x8'),_0x8559('0x9'),_0x8559('0xb')]},{'model':'Action','as':'Actions','attributes':['id',_0x8559('0xc'),_0x8559('0xd'),_0x8559('0xe'),_0x8559('0xf'),_0x8559('0x10'),_0x8559('0x11'),_0x8559('0x12'),_0x8559('0x13')]}]},'log':_0x8559('0x3')});};};
\ No newline at end of file
index 8c7650d..7e69fe6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xda73=['GetTrunk','name','registry','defaultuser','../client','getTrunks'];(function(_0x7dc0bf,_0xca3827){var _0x5a7f3b=function(_0x33cd59){while(--_0x33cd59){_0x7dc0bf['push'](_0x7dc0bf['shift']());}};_0x5a7f3b(++_0xca3827);}(_0xda73,0x160));var _0x3da7=function(_0x55d7da,_0x14459d){_0x55d7da=_0x55d7da-0x0;var _0x7a431c=_0xda73[_0x55d7da];return _0x7a431c;};'use strict';var client=require(_0x3da7('0x0'));exports[_0x3da7('0x1')]=function(_0x435bae){return function(_0x4a0419){return client['Request'](_0x3da7('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x3da7('0x3'),_0x3da7('0x4'),_0x3da7('0x5')]},'log':_0x3da7('0x2')});};};
\ No newline at end of file
+var _0xf4e6=['defaultuser','Request','GetTrunk','registry'];(function(_0x2aebf8,_0x4b07f5){var _0x304826=function(_0x57479f){while(--_0x57479f){_0x2aebf8['push'](_0x2aebf8['shift']());}};_0x304826(++_0x4b07f5);}(_0xf4e6,0x1e1));var _0x6f4e=function(_0x593564,_0x43583f){_0x593564=_0x593564-0x0;var _0x211a89=_0xf4e6[_0x593564];return _0x211a89;};'use strict';var client=require('../client');exports['getTrunks']=function(_0x5b5b9b){return function(_0x3a840e){return client[_0x6f4e('0x0')](_0x6f4e('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0x6f4e('0x2'),_0x6f4e('0x3')]},'log':_0x6f4e('0x1')});};};
\ No newline at end of file
index 8386d31..661319c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x2c42fc,_0xc7df41){var _0x1df9a4=function(_0x5401d6){while(--_0x5401d6){_0x2c42fc['push'](_0x2c42fc['shift']());}};_0x1df9a4(++_0xc7df41);}(_0xedd9,0xfc));var _0x9edd=function(_0x45c481,_0x5736cd){_0x45c481=_0x45c481-0x0;var _0x38a5c0=_0xedd9[_0x45c481];return _0x38a5c0;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});};
\ No newline at end of file
+var _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x338f34,_0x48feb5){var _0xad0c12=function(_0x520459){while(--_0x520459){_0x338f34['push'](_0x338f34['shift']());}};_0xad0c12(++_0x48feb5);}(_0xedd9,0xfc));var _0x9edd=function(_0x2ef0a1,_0x54b424){_0x2ef0a1=_0x2ef0a1-0x0;var _0x44a1e1=_0xedd9[_0x2ef0a1];return _0x44a1e1;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});};
\ No newline at end of file
index b9492b3..00a7afa 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa0b4=['Request','update','UpdateVoiceAgentReport','create'];(function(_0xd050c6,_0x58ffb4){var _0x7278a=function(_0x16d03e){while(--_0x16d03e){_0xd050c6['push'](_0xd050c6['shift']());}};_0x7278a(++_0x58ffb4);}(_0xa0b4,0x12f));var _0x4a0b=function(_0x506391,_0x36bb23){_0x506391=_0x506391-0x0;var _0x1a47f3=_0xa0b4[_0x506391];return _0x1a47f3;};'use strict';var client=require('../client');exports[_0x4a0b('0x0')]=function(_0x356746){return client[_0x4a0b('0x1')]('CreateVoiceAgentReport',{'body':_0x356746,'log':'CreateVoiceAgentReport'});};exports[_0x4a0b('0x2')]=function(_0x551da4,_0x4b4900,_0x5670f4){return client['Request'](_0x4a0b('0x3'),{'body':_0x551da4,'options':{'where':{'uniqueid':_0x4b4900,'interface':_0x5670f4,'agentcomplete':!![]}},'log':_0x4a0b('0x3')});};
\ No newline at end of file
+var _0x6ebd=['Request','CreateVoiceAgentReport','UpdateVoiceAgentReport','../client','create'];(function(_0x5d5bcb,_0x25e2ea){var _0x4ea5eb=function(_0x36782b){while(--_0x36782b){_0x5d5bcb['push'](_0x5d5bcb['shift']());}};_0x4ea5eb(++_0x25e2ea);}(_0x6ebd,0x94));var _0xd6eb=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x6ebd[_0x2b4411];return _0x8e41ef;};'use strict';var client=require(_0xd6eb('0x0'));exports[_0xd6eb('0x1')]=function(_0x5c3179){return client[_0xd6eb('0x2')]('CreateVoiceAgentReport',{'body':_0x5c3179,'log':_0xd6eb('0x3')});};exports['update']=function(_0x654643,_0x1b4c3f,_0x107d86){return client[_0xd6eb('0x2')]('UpdateVoiceAgentReport',{'body':_0x654643,'options':{'where':{'uniqueid':_0x1b4c3f,'interface':_0x107d86,'agentcomplete':!![]}},'log':_0xd6eb('0x4')});};
\ No newline at end of file
index 1e76d99..e7f5511 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6588=['disposition','util','lodash','create','Request','merge','context','callerid','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','GetVoiceCallReport','outbound','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf'];(function(_0x4586c6,_0x757d6a){var _0x5f054b=function(_0x388c63){while(--_0x388c63){_0x4586c6['push'](_0x4586c6['shift']());}};_0x5f054b(++_0x757d6a);}(_0x6588,0x188));var _0x8658=function(_0x5ddafe,_0x1fb508){_0x5ddafe=_0x5ddafe-0x0;var _0x5e23aa=_0x6588[_0x5ddafe];return _0x5e23aa;};'use strict';var moment=require('moment');var util=require(_0x8658('0x0'));var _=require(_0x8658('0x1'));var client=require('../client');exports[_0x8658('0x2')]=function(_0x939e3){return client[_0x8658('0x3')]('CreateVoiceCallReport',{'body':_[_0x8658('0x4')](_0x939e3,{'source':_0x939e3['calleridnum'],'destinationcontext':_0x939e3[_0x8658('0x5')],'callerid':_0x939e3[_0x8658('0x6')],'amaflags':_0x8658('0x7')}),'log':_0x8658('0x8')});};exports[_0x8658('0x9')]=function(){return function(){return client[_0x8658('0x3')](_0x8658('0xa'),{'options':{'where':{'type':[_0x8658('0xb')],'createdAt':{'$between':[moment()['startOf'](_0x8658('0xc'))[_0x8658('0xd')](_0x8658('0xe')),moment()[_0x8658('0xf')](_0x8658('0xc'))[_0x8658('0xd')](_0x8658('0xe'))]}},'attributes':['type',_0x8658('0x10'),'duration','billableseconds']},'log':'GetVoiceCallReports'});};};
\ No newline at end of file
+var _0x4e31=['outbound','day','endOf','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','GetVoiceCallReports','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','callerid','getVoiceCallReports'];(function(_0x5c3781,_0x5824bd){var _0x2d3963=function(_0x423e72){while(--_0x423e72){_0x5c3781['push'](_0x5c3781['shift']());}};_0x2d3963(++_0x5824bd);}(_0x4e31,0x10e));var _0x14e3=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4e31[_0x14add3];return _0x4a174f;};'use strict';var moment=require('moment');var util=require('util');var _=require(_0x14e3('0x0'));var client=require(_0x14e3('0x1'));exports[_0x14e3('0x2')]=function(_0x52ebc5){return client[_0x14e3('0x3')](_0x14e3('0x4'),{'body':_[_0x14e3('0x5')](_0x52ebc5,{'source':_0x52ebc5[_0x14e3('0x6')],'destinationcontext':_0x52ebc5[_0x14e3('0x7')],'callerid':_0x52ebc5[_0x14e3('0x8')],'amaflags':'DOCUMENTATION'}),'log':_0x14e3('0x4')});};exports[_0x14e3('0x9')]=function(){return function(){return client['Request']('GetVoiceCallReport',{'options':{'where':{'type':[_0x14e3('0xa')],'createdAt':{'$between':[moment()['startOf'](_0x14e3('0xb'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x14e3('0xc')](_0x14e3('0xb'))[_0x14e3('0xd')](_0x14e3('0xe'))]}},'attributes':[_0x14e3('0xf'),_0x14e3('0x10'),_0x14e3('0x11'),_0x14e3('0x12')]},'log':_0x14e3('0x13')});};};
\ No newline at end of file
index 0e69168..d01e8ca 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe406=['CreateVoiceDialReport','../client','create'];(function(_0x1fd3e2,_0x1a6772){var _0x5a9210=function(_0x37e9c3){while(--_0x37e9c3){_0x1fd3e2['push'](_0x1fd3e2['shift']());}};_0x5a9210(++_0x1a6772);}(_0xe406,0x1de));var _0x6e40=function(_0xa10b0d,_0x5652d4){_0xa10b0d=_0xa10b0d-0x0;var _0xd12973=_0xe406[_0xa10b0d];return _0xd12973;};'use strict';var client=require(_0x6e40('0x0'));exports[_0x6e40('0x1')]=function(_0x14854c){return client['Request'](_0x6e40('0x2'),{'body':_0x14854c,'log':_0x6e40('0x2')});};
\ No newline at end of file
+var _0xaf6b=['Request','CreateVoiceDialReport'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xaf6b,0x18e));var _0xbaf6=function(_0x2942eb,_0xfe049b){_0x2942eb=_0x2942eb-0x0;var _0x411cb3=_0xaf6b[_0x2942eb];return _0x411cb3;};'use strict';var client=require('../client');exports['create']=function(_0x297da4){return client[_0xbaf6('0x0')](_0xbaf6('0x1'),{'body':_0x297da4,'log':_0xbaf6('0x1')});};
\ No newline at end of file
index 31004b6..e8adb6d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5fa=['getVoiceExtensions','Request','GetVoiceExtension','exten'];(function(_0x42509b,_0x5e36e5){var _0x549670=function(_0x199458){while(--_0x199458){_0x42509b['push'](_0x42509b['shift']());}};_0x549670(++_0x5e36e5);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x7e55a4,_0x10ff38){_0x7e55a4=_0x7e55a4-0x0;var _0x1e152b=_0xa5fa[_0x7e55a4];return _0x1e152b;};'use strict';var client=require('../client');exports[_0xaa5f('0x0')]=function(){return function(){return client[_0xaa5f('0x1')](_0xaa5f('0x2'),{'options':{'raw':!![],'attributes':['id',_0xaa5f('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xaa5f('0x0')});};};
\ No newline at end of file
+var _0x6ea9=['GetVoiceExtension','exten','../client','getVoiceExtensions','Request'];(function(_0x5c08cb,_0x456960){var _0x147907=function(_0x1da1be){while(--_0x1da1be){_0x5c08cb['push'](_0x5c08cb['shift']());}};_0x147907(++_0x456960);}(_0x6ea9,0x89));var _0x96ea=function(_0xce2aef,_0x1fd045){_0xce2aef=_0xce2aef-0x0;var _0x4f7781=_0x6ea9[_0xce2aef];return _0x4f7781;};'use strict';var client=require(_0x96ea('0x0'));exports[_0x96ea('0x1')]=function(){return function(){return client[_0x96ea('0x2')](_0x96ea('0x3'),{'options':{'raw':!![],'attributes':['id',_0x96ea('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x96ea('0x1')});};};
\ No newline at end of file
index 500c4c1..14b4e63 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc55d=['dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialQueueProject2','monitor_format','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialPredictiveIntervalMaxThreshold','Trunk','callerid','Pause','mandatoryDispositionPause','name','TrunkBackup','active','Interval','Intervals','../client','getVoiceQueues','GetVoiceQueue','acw','acwTimeout','autopause','type','dialActive','dialMethod','dialLimitChannel','dialPredictiveOptimization','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence'];(function(_0x2a8122,_0xd957e){var _0x49a5c7=function(_0x12ab58){while(--_0x12ab58){_0x2a8122['push'](_0x2a8122['shift']());}};_0x49a5c7(++_0xd957e);}(_0xc55d,0x179));var _0xdc55=function(_0x3c34fb,_0x59cacf){_0x3c34fb=_0x3c34fb-0x0;var _0x320156=_0xc55d[_0x3c34fb];return _0x320156;};'use strict';var client=require(_0xdc55('0x0'));exports[_0xdc55('0x1')]=function(){return function(){return client['Request'](_0xdc55('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xdc55('0x3'),_0xdc55('0x4'),_0xdc55('0x5'),'monitor_format',_0xdc55('0x6'),_0xdc55('0x7'),_0xdc55('0x8'),_0xdc55('0x9'),'dialLimitQueue','dialPowerLevel',_0xdc55('0xa'),'dialPredictiveOptimizationPercentage',_0xdc55('0xb'),_0xdc55('0xc'),_0xdc55('0xd'),_0xdc55('0xe'),_0xdc55('0xf'),_0xdc55('0x10'),_0xdc55('0x11'),'dialCongestionMaxRetry',_0xdc55('0x12'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0xdc55('0x13'),_0xdc55('0x14'),_0xdc55('0x15'),'dialTimezone',_0xdc55('0x16'),_0xdc55('0x17'),_0xdc55('0x18'),_0xdc55('0x19'),_0xdc55('0x1a'),_0xdc55('0x1b'),_0xdc55('0x1c'),_0xdc55('0x1d'),_0xdc55('0x1e'),'dialAMDBetweenWordsSilence',_0xdc55('0x1f'),_0xdc55('0x20'),_0xdc55('0x21'),'timeout',_0xdc55('0x22'),_0xdc55('0x23'),_0xdc55('0x24'),'dialAgiAfterHangupAgent','dialAgiAfterHangupClient',_0xdc55('0x25'),_0xdc55('0x26'),_0xdc55('0x27'),'dialRandomLastDigitCallerIdNumber',_0xdc55('0x28'),_0xdc55('0x29'),'dialNoSuchNumberRetryFrequency','dialDropMaxRetry',_0xdc55('0x2a'),'dialAbandonedMaxRetry',_0xdc55('0x2b'),_0xdc55('0x2c'),_0xdc55('0x2d'),_0xdc55('0x2e'),_0xdc55('0x2f'),'mandatoryDisposition',_0xdc55('0x30'),'dialPredictiveIntervalMinThreshold'],'include':[{'model':_0xdc55('0x31'),'as':_0xdc55('0x31'),'attributes':['id','name',_0xdc55('0x32'),'active']},{'model':_0xdc55('0x33'),'as':_0xdc55('0x34'),'attributes':['id',_0xdc55('0x35')]},{'model':_0xdc55('0x31'),'as':_0xdc55('0x36'),'attributes':['id',_0xdc55('0x35'),_0xdc55('0x32'),_0xdc55('0x37')]},{'model':_0xdc55('0x38'),'as':_0xdc55('0x38'),'attributes':['id',_0xdc55('0x35')],'include':[{'model':'Interval','as':_0xdc55('0x39'),'attributes':['id',_0xdc55('0x35'),'interval']}]}]},'log':'getVoiceQueues'});};};
\ No newline at end of file
+var _0xb7d7=['monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0xb7d7,0xac));var _0x7b7d=function(_0x4ff5c7,_0x37473e){_0x4ff5c7=_0x4ff5c7-0x0;var _0x4db090=_0xb7d7[_0x4ff5c7];return _0x4db090;};'use strict';var client=require(_0x7b7d('0x0'));exports[_0x7b7d('0x1')]=function(){return function(){return client[_0x7b7d('0x2')](_0x7b7d('0x3'),{'options':{'raw':![],'attributes':['id',_0x7b7d('0x4'),_0x7b7d('0x5'),_0x7b7d('0x6'),_0x7b7d('0x7'),_0x7b7d('0x8'),_0x7b7d('0x9'),_0x7b7d('0xa'),_0x7b7d('0xb'),_0x7b7d('0xc'),'dialLimitQueue',_0x7b7d('0xd'),_0x7b7d('0xe'),'dialPredictiveOptimizationPercentage','dialPredictiveInterval',_0x7b7d('0xf'),_0x7b7d('0x10'),_0x7b7d('0x11'),_0x7b7d('0x12'),_0x7b7d('0x13'),_0x7b7d('0x14'),_0x7b7d('0x15'),'dialCongestionRetryFrequency',_0x7b7d('0x16'),_0x7b7d('0x17'),_0x7b7d('0x18'),_0x7b7d('0x19'),'dialGlobalMaxRetry',_0x7b7d('0x1a'),_0x7b7d('0x1b'),_0x7b7d('0x1c'),'dialCheckDuplicateType',_0x7b7d('0x1d'),'dialAMDInitialSilence',_0x7b7d('0x1e'),_0x7b7d('0x1f'),'dialAMDTotalAnalysisTime',_0x7b7d('0x20'),'dialAMDBetweenWordsSilence',_0x7b7d('0x21'),_0x7b7d('0x22'),'dialAMDMaximumWordLength','timeout',_0x7b7d('0x23'),_0x7b7d('0x24'),_0x7b7d('0x25'),_0x7b7d('0x26'),_0x7b7d('0x27'),_0x7b7d('0x28'),'monitor_format','strategy','dialRandomLastDigitCallerIdNumber',_0x7b7d('0x29'),'dialNoSuchNumberMaxRetry',_0x7b7d('0x2a'),_0x7b7d('0x2b'),_0x7b7d('0x2c'),_0x7b7d('0x2d'),'dialAbandonedRetryFrequency','dialMachineMaxRetry',_0x7b7d('0x2e'),_0x7b7d('0x2f'),_0x7b7d('0x30'),_0x7b7d('0x31'),_0x7b7d('0x32'),_0x7b7d('0x33')],'include':[{'model':_0x7b7d('0x34'),'as':_0x7b7d('0x34'),'attributes':['id','name',_0x7b7d('0x35'),_0x7b7d('0x36')]},{'model':_0x7b7d('0x37'),'as':_0x7b7d('0x38'),'attributes':['id','name']},{'model':'Trunk','as':_0x7b7d('0x39'),'attributes':['id','name',_0x7b7d('0x35'),'active']},{'model':'Interval','as':'Interval','attributes':['id',_0x7b7d('0x4')],'include':[{'model':_0x7b7d('0x3a'),'as':'Intervals','attributes':['id',_0x7b7d('0x4'),_0x7b7d('0x3b')]}]}]},'log':_0x7b7d('0x1')});};};
\ No newline at end of file
index 771d180..ce676e8 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(_0x5be024,_0x11f9b5){var _0x47c8d5=function(_0x45d0b4){while(--_0x45d0b4){_0x5be024['push'](_0x5be024['shift']());}};_0x47c8d5(++_0x11f9b5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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(_0x513b11,_0x2e3b0e){var _0x429c70=function(_0x1fe340){while(--_0x1fe340){_0x513b11['push'](_0x513b11['shift']());}};_0x429c70(++_0x2e3b0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 ca0851f..b1beb03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb78c=['../client','getVoiceQueueRtPauses'];(function(_0x3a876d,_0x2ab77b){var _0x31e089=function(_0x1b11b6){while(--_0x1b11b6){_0x3a876d['push'](_0x3a876d['shift']());}};_0x31e089(++_0x2ab77b);}(_0xb78c,0x194));var _0xcb78=function(_0x8ba624,_0x42e30e){_0x8ba624=_0x8ba624-0x0;var _0x43940f=_0xb78c[_0x8ba624];return _0x43940f;};'use strict';var client=require(_0xcb78('0x0'));exports[_0xcb78('0x1')]=function(_0x4f4e5b){return function(){return client['Request']('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x4f4e5b,'paused':!![]},'raw':!![]},'log':_0xcb78('0x1')});};};
\ No newline at end of file
+var _0xef5a=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xef5a,0x1a1));var _0xaef5=function(_0x41d851,_0x22fdd1){_0x41d851=_0x41d851-0x0;var _0x5c11d5=_0xef5a[_0x41d851];return _0x5c11d5;};'use strict';var client=require(_0xaef5('0x0'));exports[_0xaef5('0x1')]=function(_0x35b675){return function(){return client[_0xaef5('0x2')](_0xaef5('0x3'),{'options':{'where':{'VoiceQueueId':_0x35b675,'paused':!![]},'raw':!![]},'log':_0xaef5('0x1')});};};
\ No newline at end of file
index cd5e045..391cdbe 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x2b0f2a,_0xcdba36){var _0x2e3e23=function(_0x2486b7){while(--_0x2486b7){_0x2b0f2a['push'](_0x2b0f2a['shift']());}};_0x2e3e23(++_0xcdba36);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});};
\ No newline at end of file
+var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x20e645,_0x3188fc){var _0x37a281=function(_0x124856){while(--_0x124856){_0x20e645['push'](_0x20e645['shift']());}};_0x37a281(++_0x3188fc);}(_0x7a54,0x106));var _0x47a5=function(_0x540c31,_0x578d44){_0x540c31=_0x540c31-0x0;var _0x3b1bf7=_0x7a54[_0x540c31];return _0x3b1bf7;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});};
\ No newline at end of file
index 661a1e0..d9fa3ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa5fb=['transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','origtransferercontext','attended','../client','transfers','Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','context','extension','attendedTransfer','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname'];(function(_0x3414c1,_0x3d8623){var _0x154711=function(_0xfe929a){while(--_0xfe929a){_0x3414c1['push'](_0x3414c1['shift']());}};_0x154711(++_0x3d8623);}(_0xa5fb,0x1f4));var _0xba5f=function(_0x32e0df,_0x4a6d94){_0x32e0df=_0x32e0df-0x0;var _0x4874bf=_0xa5fb[_0x32e0df];return _0x4874bf;};'use strict';var client=require(_0xba5f('0x0'));exports[_0xba5f('0x1')]={};exports['blindTransfer']=function(_0x5bd664){return client[_0xba5f('0x2')](_0xba5f('0x3'),{'body':{'result':_0x5bd664[_0xba5f('0x4')],'transfererchannel':_0x5bd664['transfererchannel'],'transferercalleridnum':_0x5bd664[_0xba5f('0x5')],'transferercalleridname':_0x5bd664[_0xba5f('0x6')],'transfererconnectedlinenum':_0x5bd664['transfererconnectedlinenum'],'transfererconnectedlinename':_0x5bd664[_0xba5f('0x7')],'transfereraccountcode':_0x5bd664[_0xba5f('0x8')],'transferercontext':_0x5bd664[_0xba5f('0x9')],'transfererexten':_0x5bd664[_0xba5f('0xa')],'transfererlinkedid':_0x5bd664[_0xba5f('0xb')],'transfereechannel':_0x5bd664[_0xba5f('0xc')],'transfereecalleridnum':_0x5bd664[_0xba5f('0xd')],'transfereecalleridname':_0x5bd664['transfereecalleridname'],'transfereeconnectedlinenum':_0x5bd664[_0xba5f('0xe')],'transfereeconnectedlinename':_0x5bd664[_0xba5f('0xf')],'transfereeaccountcode':_0x5bd664[_0xba5f('0x10')],'transfereecontext':_0x5bd664[_0xba5f('0x11')],'transfereeexten':_0x5bd664[_0xba5f('0x12')],'transfereelinkedid':_0x5bd664[_0xba5f('0x13')],'isexternal':_0x5bd664['isexternal'],'context':_0x5bd664[_0xba5f('0x14')],'extension':_0x5bd664[_0xba5f('0x15')],'type':'blind'},'log':_0xba5f('0x3')});};exports[_0xba5f('0x16')]=function(_0x5312f5){return client[_0xba5f('0x2')](_0xba5f('0x3'),{'body':{'result':_0x5312f5['result'],'transfererchannel':_0x5312f5['origtransfererchannel'],'transferercalleridnum':_0x5312f5[_0xba5f('0x17')],'transferercalleridname':_0x5312f5[_0xba5f('0x18')],'transfererconnectedlinenum':_0x5312f5[_0xba5f('0x19')],'transfererconnectedlinename':_0x5312f5['secondtransfererconnectedlinename'],'transfereraccountcode':_0x5312f5[_0xba5f('0x1a')],'transferercontext':_0x5312f5[_0xba5f('0x1b')],'transfererexten':_0x5312f5[_0xba5f('0x1c')],'transfererlinkedid':_0x5312f5[_0xba5f('0x1d')],'transfereechannel':_0x5312f5['transfertargetchannel'],'transfereecalleridnum':_0x5312f5[_0xba5f('0x1e')],'transfereecalleridname':_0x5312f5[_0xba5f('0x1f')],'transfereeconnectedlinenum':_0x5312f5[_0xba5f('0x20')],'transfereeconnectedlinename':_0x5312f5[_0xba5f('0x21')],'transfereeaccountcode':_0x5312f5['transfertargetaccountcode'],'transfereecontext':_0x5312f5[_0xba5f('0x22')],'transfereeexten':_0x5312f5[_0xba5f('0x23')],'transfereelinkedid':_0x5312f5['transfertargetlinkedid'],'isexternal':_0x5312f5['isexternal'],'context':_0x5312f5[_0xba5f('0x24')],'extension':_0x5312f5['origtransfererexten'],'type':_0xba5f('0x25')},'log':_0xba5f('0x3')});};
\ No newline at end of file
+var _0xed0e=['result','transfererchannel','transferercalleridname','transfererconnectedlinenum','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeaccountcode','transfereeexten','context','extension','CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','isexternal','origtransferercontext','origtransfererexten','attended','transfers','blindTransfer','Request'];(function(_0x2ca9d4,_0x51d5c6){var _0x258956=function(_0x47a0e5){while(--_0x47a0e5){_0x2ca9d4['push'](_0x2ca9d4['shift']());}};_0x258956(++_0x51d5c6);}(_0xed0e,0x1de));var _0xeed0=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xed0e[_0x20589d];return _0x422de9;};'use strict';var client=require('../client');exports[_0xeed0('0x0')]={};exports[_0xeed0('0x1')]=function(_0xba2585){return client[_0xeed0('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0xba2585[_0xeed0('0x3')],'transfererchannel':_0xba2585[_0xeed0('0x4')],'transferercalleridnum':_0xba2585['transferercalleridnum'],'transferercalleridname':_0xba2585[_0xeed0('0x5')],'transfererconnectedlinenum':_0xba2585[_0xeed0('0x6')],'transfererconnectedlinename':_0xba2585['transfererconnectedlinename'],'transfereraccountcode':_0xba2585['transfereraccountcode'],'transferercontext':_0xba2585[_0xeed0('0x7')],'transfererexten':_0xba2585['transfererexten'],'transfererlinkedid':_0xba2585[_0xeed0('0x8')],'transfereechannel':_0xba2585[_0xeed0('0x9')],'transfereecalleridnum':_0xba2585[_0xeed0('0xa')],'transfereecalleridname':_0xba2585[_0xeed0('0xb')],'transfereeconnectedlinenum':_0xba2585[_0xeed0('0xc')],'transfereeconnectedlinename':_0xba2585['transfereeconnectedlinename'],'transfereeaccountcode':_0xba2585[_0xeed0('0xd')],'transfereecontext':_0xba2585['transfereecontext'],'transfereeexten':_0xba2585[_0xeed0('0xe')],'transfereelinkedid':_0xba2585['transfereelinkedid'],'isexternal':_0xba2585['isexternal'],'context':_0xba2585[_0xeed0('0xf')],'extension':_0xba2585[_0xeed0('0x10')],'type':'blind'},'log':_0xeed0('0x11')});};exports[_0xeed0('0x12')]=function(_0x3929af){return client[_0xeed0('0x2')](_0xeed0('0x11'),{'body':{'result':_0x3929af[_0xeed0('0x3')],'transfererchannel':_0x3929af[_0xeed0('0x13')],'transferercalleridnum':_0x3929af[_0xeed0('0x14')],'transferercalleridname':_0x3929af[_0xeed0('0x15')],'transfererconnectedlinenum':_0x3929af['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x3929af[_0xeed0('0x16')],'transfereraccountcode':_0x3929af['origtransfereraccountcode'],'transferercontext':_0x3929af[_0xeed0('0x17')],'transfererexten':_0x3929af[_0xeed0('0x18')],'transfererlinkedid':_0x3929af[_0xeed0('0x19')],'transfereechannel':_0x3929af[_0xeed0('0x1a')],'transfereecalleridnum':_0x3929af['transfertargetcalleridnum'],'transfereecalleridname':_0x3929af[_0xeed0('0x1b')],'transfereeconnectedlinenum':_0x3929af[_0xeed0('0x1c')],'transfereeconnectedlinename':_0x3929af[_0xeed0('0x1d')],'transfereeaccountcode':_0x3929af[_0xeed0('0x1e')],'transfereecontext':_0x3929af['transfertargetcontext'],'transfereeexten':_0x3929af[_0xeed0('0x1f')],'transfereelinkedid':_0x3929af[_0xeed0('0x20')],'isexternal':_0x3929af[_0xeed0('0x21')],'context':_0x3929af[_0xeed0('0x22')],'extension':_0x3929af[_0xeed0('0x23')],'type':_0xeed0('0x24')},'log':_0xeed0('0x11')});};
\ No newline at end of file
index 3991e29..7abd323 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe626=['StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','values','voicequeuechannel','queueChannels','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outbound','emit','custom:','faxAccounts','send','checkAfterSend','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','listen','%s/%s','SIP','timers','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','keys','module','action','Reload','Action','then','message','catch','pick','command','Command','content','voiceQueues','name','strategy','answered','loggedIn','pTalking','sumBillable','talking','waiting','type','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','length','find','omit','undefined','channels','voicechannel','uniqueid','%s.%s','filename','format','wav','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','push','mixmonitorid','rec','status','Channel\x20doesn\x27t\x20exist','map','resolve'];(function(_0x28506e,_0x10ce43){var _0x2ebaa6=function(_0x5ee621){while(--_0x5ee621){_0x28506e['push'](_0x28506e['shift']());}};_0x2ebaa6(++_0x10ce43);}(_0xe626,0x9d));var _0x6e62=function(_0x3e8e83,_0x3d3efb){_0x3e8e83=_0x3e8e83-0x0;var _0x24aff6=_0xe626[_0x3e8e83];return _0x24aff6;};'use strict';var _=require(_0x6e62('0x0'));var util=require(_0x6e62('0x1'));var jayson=require(_0x6e62('0x2'));var schema=require(_0x6e62('0x3'));var BPromise=require('bluebird');var moment=require(_0x6e62('0x4'));var config=require(_0x6e62('0x5'));var properties=require(_0x6e62('0x6'));var ami=require(_0x6e62('0x7'));exports[_0x6e62('0x8')]=function(_0x4d4816,_0x5f25a3,_0x4a778d){return new BPromise(function(_0x2ee927,_0x157047){var _0x55165e={'QueuePause':function(_0x32fd89){return new Promise(function(_0x1dfbaf,_0x16fa52){var _0x3317f1=util['format'](_0x6e62('0x9'),_0x6e62('0xa'),_0x32fd89['name']);if(_0x4d4816[_0x6e62('0xb')]&&_0x4d4816['timers'][_0x3317f1]&&_0x4d4816[_0x6e62('0xb')][_0x3317f1]['timer']){_0x4d4816[_0x6e62('0xb')][_0x3317f1]['updateAcw']();}if(_0x4d4816[_0x6e62('0xc')][_0x3317f1]){_0x4d4816[_0x6e62('0xc')][_0x3317f1][_0x6e62('0xd')]({'statePause':_0x32fd89[_0x6e62('0xe')]?!![]:![]});}_0x1dfbaf({'code':0xc8,'message':_0x6e62('0xf')});});},'Reload':function(_0x1c266b){var _0x3b5c11=this;return new Promise(function(_0x49be2d,_0x4e7917){if(ami[_0x6e62('0x10')]()==![]){return _0x4e7917(_0x3b5c11[_0x6e62('0x11')](0x1f4,[config['asterisk']['ip'],config[_0x6e62('0x12')][_0x6e62('0x13')],_0x6e62('0x14')][_0x6e62('0x15')]('\x20')));}_0x1c266b=_['pick'](_0x1c266b,_[_0x6e62('0x16')](properties[_0x6e62('0x17')]));_0x1c266b[_0x6e62('0x18')]=_0x6e62('0x19');return ami[_0x6e62('0x1a')](_0x1c266b)[_0x6e62('0x1b')](function(_0x42c2ea){_0x49be2d({'code':0xc8,'message':_0x42c2ea[_0x6e62('0x1c')]});})[_0x6e62('0x1d')](function(_0x15bce5){_0x4e7917(_0x3b5c11['error'](0x1f5,_0x15bce5[_0x6e62('0x1c')]));});});},'Command':function(_0x400bcc){var _0x55ce3b=this;return new Promise(function(_0xefbfb6,_0x4ecdff){if(ami[_0x6e62('0x10')]()==![]){return _0x4ecdff(_0x55ce3b[_0x6e62('0x11')](0x1f4,[config[_0x6e62('0x12')]['ip'],config[_0x6e62('0x12')][_0x6e62('0x13')],_0x6e62('0x14')][_0x6e62('0x15')]('\x20')));}_0x400bcc=_[_0x6e62('0x1e')](_0x400bcc,_0x6e62('0x1f'));_0x400bcc[_0x6e62('0x18')]=_0x6e62('0x20');return ami['Action'](_0x400bcc)[_0x6e62('0x1b')](function(_0x52d5e7){_0xefbfb6({'code':0xc8,'message':_0x52d5e7[_0x6e62('0x21')]});})[_0x6e62('0x1d')](function(_0x345af8){_0x4ecdff(_0x55ce3b[_0x6e62('0x11')](0x1f5,_0x345af8[_0x6e62('0x1c')]));});});},'VoiceQueues':function(_0x425d1c){return new Promise(function(_0x4373b5,_0x3a1683){var _0x2e4fe1=[];for(var _0x448691 in _0x4d4816['voiceQueues']){if(_0x4d4816[_0x6e62('0x22')]['hasOwnProperty'](_0x448691)){var _0x2f9c68=_0x4d4816[_0x6e62('0x22')][_0x448691];var _0x318fc3={'id':_0x2f9c68['id'],'name':_0x2f9c68[_0x6e62('0x23')],'strategy':_0x2f9c68[_0x6e62('0x24')],'answered':_0x2f9c68[_0x6e62('0x25')],'available':_0x2f9c68['available'],'loggedIn':_0x2f9c68[_0x6e62('0x26')],'pTalking':_0x2f9c68[_0x6e62('0x27')],'sumBillable':_0x2f9c68[_0x6e62('0x28')],'sumDuration':_0x2f9c68['sumDuration'],'sumHoldTime':_0x2f9c68['sumHoldTime']||0x0,'talking':_0x2f9c68[_0x6e62('0x29')],'total':_0x2f9c68['total'],'type':_0x2f9c68['type'],'unmanaged':_0x2f9c68['unmanaged'],'abandoned':_0x2f9c68['abandoned'],'waiting':_0x2f9c68[_0x6e62('0x2a')],'loggedInDb':_0x2f9c68['loggedInDb']};if(_0x2f9c68[_0x6e62('0x2b')]==='outbound'){_0x318fc3[_0x6e62('0x2c')]=_0x2f9c68[_0x6e62('0x2c')];_0x318fc3[_0x6e62('0x2d')]=_0x2f9c68['dialMethod'];_0x318fc3['dialOriginateCallerIdName']=_0x2f9c68[_0x6e62('0x2e')];_0x318fc3[_0x6e62('0x2f')]=_0x2f9c68['dialOriginateCallerIdNumber'];_0x318fc3['dialOriginateTimeout']=_0x2f9c68['dialOriginateTimeout'];_0x318fc3[_0x6e62('0x30')]=_0x2f9c68['dialPrefix'];_0x318fc3[_0x6e62('0x31')]=_0x2f9c68[_0x6e62('0x31')];_0x318fc3[_0x6e62('0x32')]=_0x2f9c68[_0x6e62('0x32')];_0x318fc3[_0x6e62('0x33')]=_0x2f9c68['outboundAnswerCallsDay'];_0x318fc3['outboundBlacklistCallsDay']=_0x2f9c68[_0x6e62('0x34')];_0x318fc3[_0x6e62('0x35')]=_0x2f9c68[_0x6e62('0x35')];_0x318fc3[_0x6e62('0x36')]=_0x2f9c68[_0x6e62('0x36')];_0x318fc3[_0x6e62('0x37')]=_0x2f9c68[_0x6e62('0x37')];_0x318fc3[_0x6e62('0x38')]=_0x2f9c68[_0x6e62('0x38')];_0x318fc3['outboundDropCallsDayTimeout']=_0x2f9c68[_0x6e62('0x39')];_0x318fc3[_0x6e62('0x3a')]=_0x2f9c68[_0x6e62('0x3a')];_0x318fc3['outboundNoSuchCallsDay']=_0x2f9c68[_0x6e62('0x3b')];_0x318fc3[_0x6e62('0x3c')]=_0x2f9c68['outboundOriginateFailureCallsDay'];_0x318fc3[_0x6e62('0x3d')]=_0x2f9c68[_0x6e62('0x3d')];_0x318fc3[_0x6e62('0x3e')]=_0x2f9c68[_0x6e62('0x3e')];_0x318fc3[_0x6e62('0x3f')]=_0x2f9c68['outboundUnknownCallsDay'];_0x318fc3[_0x6e62('0x40')]=_0x2f9c68[_0x6e62('0x40')];_0x318fc3[_0x6e62('0x41')]=_0x2f9c68[_0x6e62('0x41')];_0x318fc3[_0x6e62('0x42')]=_0x2f9c68['predictiveIntervalAvgTalktime'];_0x318fc3[_0x6e62('0x43')]=_0x2f9c68[_0x6e62('0x43')];_0x318fc3[_0x6e62('0x44')]=_0x2f9c68['predictiveIntervalDroppedCallsTimeout'];_0x318fc3[_0x6e62('0x45')]=_0x2f9c68[_0x6e62('0x45')];_0x318fc3['predictiveIntervalErlangCallsDroppedCalls']=_0x2f9c68['predictiveIntervalErlangCallsDroppedCalls'];_0x318fc3[_0x6e62('0x46')]=_0x2f9c68[_0x6e62('0x46')];_0x318fc3[_0x6e62('0x47')]=_0x2f9c68['predictiveIntervalMultiplicativeFactor'];_0x318fc3['predictiveIntervalPauses']=_0x2f9c68[_0x6e62('0x48')];_0x318fc3['predictiveIntervalAvailable']=_0x2f9c68['predictiveIntervalAvailable'];_0x318fc3[_0x6e62('0x49')]=_0x2f9c68[_0x6e62('0x49')];_0x318fc3[_0x6e62('0x1c')]=_0x2f9c68[_0x6e62('0x1c')];_0x318fc3[_0x6e62('0x4a')]=_0x2f9c68['originated'];_0x318fc3[_0x6e62('0x4b')]=_0x2f9c68['erlangCalls'];_0x318fc3['erlangCallToSecond']=_0x2f9c68[_0x6e62('0x4c')];_0x318fc3[_0x6e62('0x4d')]=_0x2f9c68[_0x6e62('0x4d')];_0x318fc3['erlangBusyFactor']=_0x2f9c68[_0x6e62('0x4e')];_0x318fc3['startPredictive']=_0x2f9c68[_0x6e62('0x4f')];_0x318fc3[_0x6e62('0x50')]=_0x2f9c68[_0x6e62('0x50')];}if(_0x2f9c68[_0x6e62('0x51')]){_0x318fc3[_0x6e62('0x51')]={'id':_0x2f9c68[_0x6e62('0x51')]['id'],'name':_0x2f9c68[_0x6e62('0x51')][_0x6e62('0x23')],'active':_0x2f9c68[_0x6e62('0x51')][_0x6e62('0x52')],'callerid':_0x2f9c68['Trunk']['callerid']};}if(_0x2f9c68['Interval']){_0x318fc3[_0x6e62('0x53')]={'id':_0x2f9c68['Interval']['id'],'name':_0x2f9c68[_0x6e62('0x53')][_0x6e62('0x23')]};}_0x2e4fe1['push'](_0x318fc3);}}_0x4373b5({'count':_0x2e4fe1[_0x6e62('0x54')],'rows':_0x2e4fe1});});},'UpdateVoiceQueue':function(_0x10c992){return new Promise(function(_0x223c3b,_0x2efc75){var _0x11cd3b=_[_0x6e62('0x55')](_0x4d4816[_0x6e62('0x22')],{'id':parseInt(_0x10c992['id'])});var _0x22f217=_[_0x6e62('0x56')](_0x10c992,['id']);if(_0x11cd3b){for(var _0x7e251d in _0x22f217){if(typeof _0x22f217[_0x7e251d]!==_0x6e62('0x57')&&typeof _0x11cd3b[_0x7e251d]!==_0x6e62('0x57')){_0x11cd3b[_0x7e251d]=_0x22f217[_0x7e251d];}}_0x223c3b(_0x11cd3b);}else{_0x2efc75();}});},'VoiceChannels':function(_0x7c26d2){return new Promise(function(_0x5efc0c,_0x419fab){var _0x158c75=_['values'](_0x4d4816[_0x6e62('0x58')]);_0x5efc0c({'count':_0x158c75['length'],'rows':_0x158c75});});},'VoiceChannelMixMonitor':function(_0x45da05){var _0x1aaec8=this;return new Promise(function(_0x34d642,_0x5ca4eb){if(ami[_0x6e62('0x10')]()==![]){return _0x5ca4eb(_0x1aaec8[_0x6e62('0x11')](0x1f4,[config[_0x6e62('0x12')]['ip'],config[_0x6e62('0x12')][_0x6e62('0x13')],_0x6e62('0x14')][_0x6e62('0x15')]('\x20')));}var _0x315ed4=schema(properties[_0x6e62('0x59')])[_0x6e62('0x3')](_0x45da05);if(_0x315ed4[_0x6e62('0x54')]>0x0){return _0x5ca4eb(_0x1aaec8['error'](0x1f4,_['map'](_0x315ed4,_0x6e62('0x1c'))[_0x6e62('0x15')](',\x20')));}var _0x168992=_[_0x6e62('0x55')](_0x4d4816[_0x6e62('0x58')],{'uniqueid':_0x45da05[_0x6e62('0x5a')]});if(_0x168992&&_0x168992['channel']){var _0x19a7e9=util['format'](_0x6e62('0x5b'),_0x45da05[_0x6e62('0x5c')]||_0x45da05[_0x6e62('0x5a')],_0x45da05[_0x6e62('0x5d')]||_0x6e62('0x5e'));return ami['Action']({'action':_0x6e62('0x5f'),'channel':_0x168992[_0x6e62('0x60')],'file':_0x19a7e9,'options':_0x6e62('0x61')})[_0x6e62('0x1b')](function(_0x5378b5){var _0x2aa82d=_['find'](_0x168992[_0x6e62('0x62')],{'filename':_0x6e62('0x63')+_0x19a7e9[_0x6e62('0x64')]()});if(_[_0x6e62('0x65')](_0x2aa82d)){_0x168992[_0x6e62('0x62')][_0x6e62('0x66')]({'filename':_0x6e62('0x63')+_0x19a7e9['toLowerCase'](),'createdAt':moment()[_0x6e62('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x5378b5[_0x6e62('0x67')],'status':_0x6e62('0x68')});}else{_0x2aa82d[_0x6e62('0x67')]=_0x5378b5[_0x6e62('0x67')];_0x2aa82d[_0x6e62('0x69')]='rec';}_0x34d642({'code':0xc8,'message':[_0x45da05[_0x6e62('0x5a')],'MixMonitor\x20Success',_0x5378b5[_0x6e62('0x67')]][_0x6e62('0x15')]('\x20'),'mixmonitorid':_0x5378b5[_0x6e62('0x67')]});})['catch'](function(_0x577eb4){_0x5ca4eb(_0x1aaec8[_0x6e62('0x11')](0x1f5,[_0x45da05['uniqueid'],_0x577eb4[_0x6e62('0x1c')]['toLowerCase']()][_0x6e62('0x15')]('\x20')));});}else{return _0x5ca4eb(_0x1aaec8['error'](0x1f5,_0x6e62('0x6a')));}});},'VoiceChannelStopMixMonitor':function(_0xb19995){var _0x5f2d00=this;return new Promise(function(_0x1226ce,_0x2f4f20){if(ami['isConnected']()==![]){return _0x2f4f20(_0x5f2d00['error'](0x1f4,[config[_0x6e62('0x12')]['ip'],config[_0x6e62('0x12')][_0x6e62('0x13')],_0x6e62('0x14')][_0x6e62('0x15')]('\x20')));}var _0x1eb6e8=schema(properties[_0x6e62('0x59')])['validate'](_0xb19995);if(_0x1eb6e8[_0x6e62('0x54')]>0x0){return _0x2f4f20(_0x5f2d00[_0x6e62('0x11')](0x1f4,_[_0x6e62('0x6b')](_0x1eb6e8,_0x6e62('0x1c'))[_0x6e62('0x15')](',\x20')));}var _0x492ffd=_[_0x6e62('0x55')](_0x4d4816[_0x6e62('0x58')],{'uniqueid':_0xb19995['uniqueid']});if(_0x492ffd){return BPromise[_0x6e62('0x6c')]()[_0x6e62('0x1b')](function(){if(_0x492ffd[_0x6e62('0x60')]){return ami[_0x6e62('0x1a')]({'action':_0x6e62('0x6d'),'channel':_0x492ffd['channel'],'mixmonitorid':_0xb19995[_0x6e62('0x67')]})[_0x6e62('0x1d')](function(_0x28435b){});}})['then'](function(){if(_0x492ffd[_0x6e62('0x6e')]){return ami[_0x6e62('0x1a')]({'action':'StopMixMonitor','channel':_0x492ffd[_0x6e62('0x6e')],'mixmonitorid':_0xb19995['mixmonitorid']})[_0x6e62('0x1d')](function(_0xb22e54){});}})[_0x6e62('0x1b')](function(_0x5db78e){var _0x58e9bd=_[_0x6e62('0x55')](_0x492ffd[_0x6e62('0x62')],{'mixmonitorid':_0xb19995[_0x6e62('0x67')]});if(_0x58e9bd){_0x58e9bd[_0x6e62('0x69')]=_0x6e62('0x6f');}})[_0x6e62('0x1b')](function(){var _0x1a778a=util[_0x6e62('0x5d')]('%s.%s',_0xb19995[_0x6e62('0x5c')]||_0xb19995[_0x6e62('0x5a')],_0xb19995['format']||_0x6e62('0x5e'));var _0x4a079d=_[_0x6e62('0x55')](_0x492ffd[_0x6e62('0x62')],{'filename':_0x6e62('0x63')+_0x1a778a[_0x6e62('0x64')]()});if(_0x4a079d){_0x4a079d['status']='stop';}})[_0x6e62('0x1b')](function(){_0x1226ce({'code':0xc8,'message':[_0xb19995[_0x6e62('0x5a')],_0x6e62('0x70')][_0x6e62('0x15')]('\x20')});})[_0x6e62('0x1d')](function(_0x60b516){_0x2f4f20(_0x5f2d00[_0x6e62('0x11')](0x1f5,[_0xb19995[_0x6e62('0x5a')],_0x60b516['message'][_0x6e62('0x64')]()][_0x6e62('0x15')]('\x20')));});}else{return _0x2f4f20(_0x5f2d00[_0x6e62('0x11')](0x1f5,_0x6e62('0x6a')));}});},'VoiceQueuesChannels':function(_0x1685c4){return new Promise(function(_0x8ff2c0,_0x3268e2){var _0x37816e=_[_0x6e62('0x71')](_0x4d4816['queueChannels']);_0x8ff2c0({'count':_0x37816e[_0x6e62('0x54')],'rows':_0x37816e});});},'VoiceQueuesChannel':function(_0x256993){var _0x3ddc7f=this;return new Promise(function(_0x8b84d7,_0xeb5195){var _0x3937b3=schema(properties[_0x6e62('0x72')])[_0x6e62('0x3')](_0x256993);if(_0x3937b3[_0x6e62('0x54')]>0x0){return _0xeb5195(_0x3ddc7f[_0x6e62('0x11')](0x1f4,_[_0x6e62('0x6b')](_0x3937b3,_0x6e62('0x1c'))[_0x6e62('0x15')](',\x20')));}var _0x3be758=_[_0x6e62('0x55')](_0x4d4816[_0x6e62('0x73')],{'uniqueid':_0x256993[_0x6e62('0x5a')]});if(_0x3be758){_0x8b84d7(_0x3be758);}else{return _0xeb5195(_0x3ddc7f['error'](0x1f5,_0x6e62('0x6a')));}});},'VoiceQueuesChannelHangup':function(_0x174f93){var _0x2c11e4=this;return new Promise(function(_0x256608,_0x53684f){if(ami[_0x6e62('0x10')]()==![]){return _0x53684f(_0x2c11e4[_0x6e62('0x11')](0x1f4,[config[_0x6e62('0x12')]['ip'],config['asterisk'][_0x6e62('0x13')],_0x6e62('0x14')][_0x6e62('0x15')]('\x20')));}var _0x1fd508=schema(properties['voicequeuechannelhangup'])[_0x6e62('0x3')](_0x174f93);if(_0x1fd508[_0x6e62('0x54')]>0x0){return _0x53684f(_0x2c11e4[_0x6e62('0x11')](0x1f4,_[_0x6e62('0x6b')](_0x1fd508,_0x6e62('0x1c'))[_0x6e62('0x15')](',\x20')));}var _0x1e7420=_[_0x6e62('0x55')](_0x4d4816[_0x6e62('0x73')],{'uniqueid':_0x174f93[_0x6e62('0x5a')]});if(_0x1e7420&&_0x1e7420[_0x6e62('0x60')]){return ami[_0x6e62('0x1a')]({'action':_0x6e62('0x74'),'channel':_0x1e7420[_0x6e62('0x60')]})['then'](function(_0xf25da3){_0x256608({'code':0xc8,'message':[_0x174f93[_0x6e62('0x5a')],_0xf25da3[_0x6e62('0x1c')][_0x6e62('0x64')]()][_0x6e62('0x15')]('\x20')});})[_0x6e62('0x1d')](function(_0x451dd1){_0x53684f(_0x2c11e4[_0x6e62('0x11')](0x1f5,[_0x174f93['uniqueid'],_0x451dd1[_0x6e62('0x1c')][_0x6e62('0x64')]()][_0x6e62('0x15')]('\x20')));});}else{return _0x53684f(_0x2c11e4[_0x6e62('0x11')](0x1f5,_0x6e62('0x6a')));}});},'VoiceQueuesChannelRedirect':function(_0x2f6e7c){var _0x4066aa=this;return new Promise(function(_0x489e44,_0x45319f){if(ami[_0x6e62('0x10')]()==![]){return _0x45319f(_0x4066aa[_0x6e62('0x11')](0x1f4,[config[_0x6e62('0x12')]['ip'],config[_0x6e62('0x12')][_0x6e62('0x13')],_0x6e62('0x14')][_0x6e62('0x15')]('\x20')));}var _0x2034bf=schema(properties[_0x6e62('0x75')])[_0x6e62('0x3')](_0x2f6e7c);if(_0x2034bf[_0x6e62('0x54')]>0x0){return _0x45319f(_0x4066aa[_0x6e62('0x11')](0x1f4,_[_0x6e62('0x6b')](_0x2034bf,_0x6e62('0x1c'))[_0x6e62('0x15')](',\x20')));}var _0x4577c0=_[_0x6e62('0x55')](_0x4d4816['queueChannels'],{'uniqueid':_0x2f6e7c[_0x6e62('0x5a')]});if(_0x4577c0&&_0x4577c0[_0x6e62('0x60')]){return ami[_0x6e62('0x1a')]({'action':_0x6e62('0x76'),'channel':_0x4577c0[_0x6e62('0x60')],'exten':_0x2f6e7c[_0x6e62('0x77')],'context':_0x2f6e7c['context']||_0x4577c0[_0x6e62('0x78')],'priority':0x1})[_0x6e62('0x1b')](function(_0x518213){_0x489e44({'code':0xc8,'message':[_0x2f6e7c[_0x6e62('0x5a')],_0x518213['message']['toLowerCase']()][_0x6e62('0x15')]('\x20')});})[_0x6e62('0x1d')](function(_0x14b2a7){_0x45319f(_0x4066aa[_0x6e62('0x11')](0x1f5,[_0x2f6e7c['uniqueid'],_0x14b2a7[_0x6e62('0x1c')][_0x6e62('0x64')]()][_0x6e62('0x15')]('\x20')));});}else{return _0x45319f(_0x4066aa[_0x6e62('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x320981){return new Promise(function(_0x374d33,_0x44747a){var _0x5cfbb9=_[_0x6e62('0x71')](_0x4d4816['agents']);_0x374d33({'count':_0x5cfbb9['length'],'rows':_0x5cfbb9});});},'Telephones':function(_0x35beef){return new Promise(function(_0x3b1917,_0x129eca){var _0x5368de=_['values'](_0x4d4816[_0x6e62('0x79')]);_0x3b1917({'count':_0x5368de[_0x6e62('0x54')],'rows':_0x5368de});});},'Trunks':function(_0x15c205){return new Promise(function(_0x38a760,_0x28d430){var _0x54ee57=_[_0x6e62('0x71')](_0x4d4816[_0x6e62('0x7a')]);_0x38a760({'count':_0x54ee57[_0x6e62('0x54')],'rows':_0x54ee57});});},'OutboundChannels':function(_0x1c7688){return new Promise(function(_0x5cc806,_0x48e7b7){var _0x8f326e=_[_0x6e62('0x71')](_0x4d4816['outboundChannels']);_0x5cc806({'count':_0x8f326e['length'],'rows':_0x8f326e});});},'Outbound':function(_0x3eb4a1){return new Promise(function(_0x2fb04e,_0x346cd6){_0x2fb04e(_0x4d4816[_0x6e62('0x7b')]);});},'Campaigns':function(_0x102e42){return new Promise(function(_0x288955,_0x431bdd){var _0x1ac390=_[_0x6e62('0x71')](_0x4d4816['campaigns']);_0x288955({'count':_0x1ac390[_0x6e62('0x54')],'rows':_0x1ac390});});},'VoiceQueuesPreview':function(_0x1ee1f9){var _0x1e753b=this;return new Promise(function(_0x5ae85e,_0x1efc4c){_0x5f25a3['run'](_0x1ee1f9['id'])[_0x6e62('0x1b')](function(_0x258314){_0x5ae85e({'code':0xc8,'message':_0x258314['message']});})[_0x6e62('0x1d')](function(_0x19879c){_0x1efc4c(_0x1e753b[_0x6e62('0x11')](0x1f4,_0x19879c[_0x6e62('0x1c')]));});});},'EventManager':function(_0x25d318){var _0x35f31b=this;return new Promise(function(_0x162750,_0x519e98){if(!_0x25d318['event']){return _0x519e98(_0x35f31b[_0x6e62('0x11')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x6e62('0x7c')](_0x6e62('0x7d')+_0x25d318['event'],_0x25d318[_0x6e62('0x1c')]);_0x162750({'code':0xc8,'message':_0x25d318});});},'FaxAccounts':function(_0x4cf02a){return new Promise(function(_0xc63c1a,_0x567624){var _0x334092=_['values'](_0x4d4816[_0x6e62('0x7e')]);_0xc63c1a({'count':_0x334092[_0x6e62('0x54')],'rows':_0x334092});});},'SendFax':function(_0x454f23){var _0x47745e=this;return new Promise(function(_0x45f361,_0x5ce958){_0x4a778d[_0x6e62('0x7f')](_0x454f23)[_0x6e62('0x1b')](function(_0x14df12){_0x45f361({'code':0xc8,'message':_0x14df12[_0x6e62('0x1c')]});})[_0x6e62('0x1d')](function(_0x2049e4){_0x5ce958(_0x47745e[_0x6e62('0x11')](0x1f4,_0x2049e4[_0x6e62('0x1c')]));});});},'CheckAfterSend':function(_0x7fa90b){var _0x4767b1=this;return new Promise(function(_0x1f7b9d,_0x5706a9){_0x4a778d[_0x6e62('0x80')](_0x7fa90b)[_0x6e62('0x1b')](function(_0x52c724){_0x1f7b9d({'code':0xc8,'message':_0x52c724['message']});})['catch'](function(_0xaa43f){_0x5706a9(_0x4767b1[_0x6e62('0x11')](0x1f4,_0xaa43f[_0x6e62('0x1c')]));});});}};var _0x40d958=jayson['server'](_0x55165e)['http']();_0x40d958['on'](_0x6e62('0x11'),function(_0x22cfd7){return _0x157047(_0x22cfd7);});_0x40d958[_0x6e62('0x8')](0x232a,_0x6e62('0x81'),function(){console[_0x6e62('0x82')](_0x6e62('0x83'),0x232a);return _0x2ee927(_0x6e62('0x84')+0x232a);});});};
\ No newline at end of file
+var _0x6657=['loggedIn','pTalking','sumBillable','sumDuration','talking','unmanaged','abandoned','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','push','length','find','omit','undefined','values','channels','map','uniqueid','filename','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','%s.%s','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','Hangup','voicequeuechannelredirect','exten','context','trunks','outboundChannels','run','Event\x20name\x20mandatory','emit','custom:','event','faxAccounts','checkAfterSend','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','validate','bluebird','moment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','QueuePause','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','Reload','Action','then','message','catch','isConnected','command','Command','content','voiceQueues','hasOwnProperty','answered','available'];(function(_0x510d7a,_0x338220){var _0x12adfa=function(_0x5e966c){while(--_0x5e966c){_0x510d7a['push'](_0x510d7a['shift']());}};_0x12adfa(++_0x338220);}(_0x6657,0x17f));var _0x7665=function(_0x399b6e,_0x3ef3fd){_0x399b6e=_0x399b6e-0x0;var _0x145cf3=_0x6657[_0x399b6e];return _0x145cf3;};'use strict';var _=require(_0x7665('0x0'));var util=require('util');var jayson=require(_0x7665('0x1'));var schema=require(_0x7665('0x2'));var BPromise=require(_0x7665('0x3'));var moment=require(_0x7665('0x4'));var config=require('../../../config/environment');var properties=require(_0x7665('0x5'));var ami=require(_0x7665('0x6'));exports[_0x7665('0x7')]=function(_0x1c33b1,_0xcf83a8,_0x28b410){return new BPromise(function(_0x1a6f2f,_0x3387d8){var _0x4c0b5c={'QueuePause':function(_0x31da89){return new Promise(function(_0x464ec1,_0x24e6aa){var _0x37f647=util[_0x7665('0x8')](_0x7665('0x9'),_0x7665('0xa'),_0x31da89[_0x7665('0xb')]);if(_0x1c33b1['timers']&&_0x1c33b1[_0x7665('0xc')][_0x37f647]&&_0x1c33b1[_0x7665('0xc')][_0x37f647][_0x7665('0xd')]){_0x1c33b1['timers'][_0x37f647][_0x7665('0xe')]();}if(_0x1c33b1['agents'][_0x37f647]){_0x1c33b1[_0x7665('0xf')][_0x37f647][_0x7665('0x10')]({'statePause':_0x31da89['pause']?!![]:![]});}_0x464ec1({'code':0xc8,'message':_0x7665('0x11')});});},'Reload':function(_0x2e8dda){var _0x4dd9aa=this;return new Promise(function(_0x3e2717,_0x3ee33){if(ami['isConnected']()==![]){return _0x3ee33(_0x4dd9aa[_0x7665('0x12')](0x1f4,[config[_0x7665('0x13')]['ip'],config[_0x7665('0x13')][_0x7665('0x14')],_0x7665('0x15')][_0x7665('0x16')]('\x20')));}_0x2e8dda=_[_0x7665('0x17')](_0x2e8dda,_[_0x7665('0x18')](properties[_0x7665('0x19')]));_0x2e8dda[_0x7665('0x1a')]=_0x7665('0x1b');return ami[_0x7665('0x1c')](_0x2e8dda)[_0x7665('0x1d')](function(_0x34e7a8){_0x3e2717({'code':0xc8,'message':_0x34e7a8[_0x7665('0x1e')]});})[_0x7665('0x1f')](function(_0x522944){_0x3ee33(_0x4dd9aa[_0x7665('0x12')](0x1f5,_0x522944[_0x7665('0x1e')]));});});},'Command':function(_0x4f1f1d){var _0x32b37a=this;return new Promise(function(_0x2033a5,_0x6dd715){if(ami[_0x7665('0x20')]()==![]){return _0x6dd715(_0x32b37a['error'](0x1f4,[config[_0x7665('0x13')]['ip'],config[_0x7665('0x13')][_0x7665('0x14')],_0x7665('0x15')][_0x7665('0x16')]('\x20')));}_0x4f1f1d=_['pick'](_0x4f1f1d,_0x7665('0x21'));_0x4f1f1d['action']=_0x7665('0x22');return ami[_0x7665('0x1c')](_0x4f1f1d)['then'](function(_0x5652dd){_0x2033a5({'code':0xc8,'message':_0x5652dd[_0x7665('0x23')]});})[_0x7665('0x1f')](function(_0x4a9a25){_0x6dd715(_0x32b37a[_0x7665('0x12')](0x1f5,_0x4a9a25[_0x7665('0x1e')]));});});},'VoiceQueues':function(_0xcc4a89){return new Promise(function(_0x488d86,_0x5b5be6){var _0x566415=[];for(var _0x4dc736 in _0x1c33b1[_0x7665('0x24')]){if(_0x1c33b1[_0x7665('0x24')][_0x7665('0x25')](_0x4dc736)){var _0x5809e9=_0x1c33b1[_0x7665('0x24')][_0x4dc736];var _0x383d06={'id':_0x5809e9['id'],'name':_0x5809e9['name'],'strategy':_0x5809e9['strategy'],'answered':_0x5809e9[_0x7665('0x26')],'available':_0x5809e9[_0x7665('0x27')],'loggedIn':_0x5809e9[_0x7665('0x28')],'pTalking':_0x5809e9[_0x7665('0x29')],'sumBillable':_0x5809e9[_0x7665('0x2a')],'sumDuration':_0x5809e9[_0x7665('0x2b')],'sumHoldTime':_0x5809e9['sumHoldTime']||0x0,'talking':_0x5809e9[_0x7665('0x2c')],'total':_0x5809e9['total'],'type':_0x5809e9['type'],'unmanaged':_0x5809e9[_0x7665('0x2d')],'abandoned':_0x5809e9[_0x7665('0x2e')],'waiting':_0x5809e9[_0x7665('0x2f')],'loggedInDb':_0x5809e9[_0x7665('0x30')]};if(_0x5809e9[_0x7665('0x31')]===_0x7665('0x32')){_0x383d06[_0x7665('0x33')]=_0x5809e9[_0x7665('0x33')];_0x383d06[_0x7665('0x34')]=_0x5809e9[_0x7665('0x34')];_0x383d06[_0x7665('0x35')]=_0x5809e9[_0x7665('0x35')];_0x383d06[_0x7665('0x36')]=_0x5809e9[_0x7665('0x36')];_0x383d06[_0x7665('0x37')]=_0x5809e9[_0x7665('0x37')];_0x383d06[_0x7665('0x38')]=_0x5809e9[_0x7665('0x38')];_0x383d06[_0x7665('0x39')]=_0x5809e9['temp'];_0x383d06[_0x7665('0x3a')]=_0x5809e9[_0x7665('0x3a')];_0x383d06[_0x7665('0x3b')]=_0x5809e9[_0x7665('0x3b')];_0x383d06[_0x7665('0x3c')]=_0x5809e9[_0x7665('0x3c')];_0x383d06['outboundBusyCallsDay']=_0x5809e9[_0x7665('0x3d')];_0x383d06[_0x7665('0x3e')]=_0x5809e9[_0x7665('0x3e')];_0x383d06[_0x7665('0x3f')]=_0x5809e9[_0x7665('0x3f')];_0x383d06['outboundDropCallsDayCallersExit']=_0x5809e9[_0x7665('0x40')];_0x383d06['outboundDropCallsDayTimeout']=_0x5809e9[_0x7665('0x41')];_0x383d06['outboundNoAnswerCallsDay']=_0x5809e9[_0x7665('0x42')];_0x383d06[_0x7665('0x43')]=_0x5809e9[_0x7665('0x43')];_0x383d06[_0x7665('0x44')]=_0x5809e9[_0x7665('0x44')];_0x383d06[_0x7665('0x45')]=_0x5809e9['outboundReCallsDay'];_0x383d06[_0x7665('0x46')]=_0x5809e9[_0x7665('0x46')];_0x383d06[_0x7665('0x47')]=_0x5809e9[_0x7665('0x47')];_0x383d06['predictiveIntervalAnsweredCalls']=_0x5809e9[_0x7665('0x48')];_0x383d06[_0x7665('0x49')]=_0x5809e9[_0x7665('0x49')];_0x383d06[_0x7665('0x4a')]=_0x5809e9[_0x7665('0x4a')];_0x383d06['predictiveIntervalDroppedCallsCallersExit']=_0x5809e9[_0x7665('0x4b')];_0x383d06[_0x7665('0x4c')]=_0x5809e9[_0x7665('0x4c')];_0x383d06[_0x7665('0x4d')]=_0x5809e9[_0x7665('0x4d')];_0x383d06[_0x7665('0x4e')]=_0x5809e9[_0x7665('0x4e')];_0x383d06[_0x7665('0x4f')]=_0x5809e9[_0x7665('0x4f')];_0x383d06[_0x7665('0x50')]=_0x5809e9['predictiveIntervalMultiplicativeFactor'];_0x383d06['predictiveIntervalPauses']=_0x5809e9[_0x7665('0x51')];_0x383d06[_0x7665('0x52')]=_0x5809e9['predictiveIntervalAvailable'];_0x383d06['predictiveIntervalTotalCalls']=_0x5809e9[_0x7665('0x53')];_0x383d06[_0x7665('0x1e')]=_0x5809e9['message'];_0x383d06[_0x7665('0x54')]=_0x5809e9[_0x7665('0x54')];_0x383d06[_0x7665('0x55')]=_0x5809e9[_0x7665('0x55')];_0x383d06[_0x7665('0x56')]=_0x5809e9[_0x7665('0x56')];_0x383d06[_0x7665('0x57')]=_0x5809e9[_0x7665('0x57')];_0x383d06[_0x7665('0x58')]=_0x5809e9[_0x7665('0x58')];_0x383d06[_0x7665('0x59')]=_0x5809e9[_0x7665('0x59')];_0x383d06[_0x7665('0x5a')]=_0x5809e9[_0x7665('0x5a')];}if(_0x5809e9['Trunk']){_0x383d06[_0x7665('0x5b')]={'id':_0x5809e9['Trunk']['id'],'name':_0x5809e9[_0x7665('0x5b')][_0x7665('0xb')],'active':_0x5809e9[_0x7665('0x5b')][_0x7665('0x5c')],'callerid':_0x5809e9[_0x7665('0x5b')]['callerid']};}if(_0x5809e9[_0x7665('0x5d')]){_0x383d06[_0x7665('0x5d')]={'id':_0x5809e9['Interval']['id'],'name':_0x5809e9[_0x7665('0x5d')]['name']};}_0x566415[_0x7665('0x5e')](_0x383d06);}}_0x488d86({'count':_0x566415[_0x7665('0x5f')],'rows':_0x566415});});},'UpdateVoiceQueue':function(_0x1a1cd9){return new Promise(function(_0x503679,_0x4bc743){var _0x1c174c=_[_0x7665('0x60')](_0x1c33b1['voiceQueues'],{'id':parseInt(_0x1a1cd9['id'])});var _0x2343de=_[_0x7665('0x61')](_0x1a1cd9,['id']);if(_0x1c174c){for(var _0x2bc404 in _0x2343de){if(typeof _0x2343de[_0x2bc404]!==_0x7665('0x62')&&typeof _0x1c174c[_0x2bc404]!==_0x7665('0x62')){_0x1c174c[_0x2bc404]=_0x2343de[_0x2bc404];}}_0x503679(_0x1c174c);}else{_0x4bc743();}});},'VoiceChannels':function(_0x9bca68){return new Promise(function(_0x41dd53,_0x453904){var _0x2fe046=_[_0x7665('0x63')](_0x1c33b1[_0x7665('0x64')]);_0x41dd53({'count':_0x2fe046['length'],'rows':_0x2fe046});});},'VoiceChannelMixMonitor':function(_0x3762b6){var _0x5a21ee=this;return new Promise(function(_0x3d1ed0,_0x1cf4e2){if(ami[_0x7665('0x20')]()==![]){return _0x1cf4e2(_0x5a21ee[_0x7665('0x12')](0x1f4,[config['asterisk']['ip'],config[_0x7665('0x13')][_0x7665('0x14')],_0x7665('0x15')][_0x7665('0x16')]('\x20')));}var _0x69912d=schema(properties['voicechannel'])[_0x7665('0x2')](_0x3762b6);if(_0x69912d['length']>0x0){return _0x1cf4e2(_0x5a21ee[_0x7665('0x12')](0x1f4,_[_0x7665('0x65')](_0x69912d,'message')['join'](',\x20')));}var _0x9d5c0b=_[_0x7665('0x60')](_0x1c33b1[_0x7665('0x64')],{'uniqueid':_0x3762b6[_0x7665('0x66')]});if(_0x9d5c0b&&_0x9d5c0b['channel']){var _0x4d2d7a=util[_0x7665('0x8')]('%s.%s',_0x3762b6[_0x7665('0x67')]||_0x3762b6[_0x7665('0x66')],_0x3762b6[_0x7665('0x8')]||'wav');return ami[_0x7665('0x1c')]({'action':_0x7665('0x68'),'channel':_0x9d5c0b[_0x7665('0x69')],'file':_0x4d2d7a,'options':_0x7665('0x6a')})[_0x7665('0x1d')](function(_0x1d6814){var _0x13d10b=_[_0x7665('0x60')](_0x9d5c0b[_0x7665('0x6b')],{'filename':_0x7665('0x6c')+_0x4d2d7a[_0x7665('0x6d')]()});if(_[_0x7665('0x6e')](_0x13d10b)){_0x9d5c0b[_0x7665('0x6b')][_0x7665('0x5e')]({'filename':'/var/spool/asterisk/monitor/'+_0x4d2d7a['toLowerCase'](),'createdAt':moment()[_0x7665('0x8')](_0x7665('0x6f')),'mixmonitorid':_0x1d6814['mixmonitorid'],'status':'rec'});}else{_0x13d10b['mixmonitorid']=_0x1d6814[_0x7665('0x70')];_0x13d10b[_0x7665('0x71')]=_0x7665('0x72');}_0x3d1ed0({'code':0xc8,'message':[_0x3762b6[_0x7665('0x66')],_0x7665('0x73'),_0x1d6814[_0x7665('0x70')]][_0x7665('0x16')]('\x20'),'mixmonitorid':_0x1d6814[_0x7665('0x70')]});})[_0x7665('0x1f')](function(_0x242386){_0x1cf4e2(_0x5a21ee['error'](0x1f5,[_0x3762b6['uniqueid'],_0x242386[_0x7665('0x1e')][_0x7665('0x6d')]()][_0x7665('0x16')]('\x20')));});}else{return _0x1cf4e2(_0x5a21ee['error'](0x1f5,_0x7665('0x74')));}});},'VoiceChannelStopMixMonitor':function(_0x56ee91){var _0x17bbbe=this;return new Promise(function(_0xed47d0,_0x3d056c){if(ami[_0x7665('0x20')]()==![]){return _0x3d056c(_0x17bbbe[_0x7665('0x12')](0x1f4,[config[_0x7665('0x13')]['ip'],config[_0x7665('0x13')][_0x7665('0x14')],_0x7665('0x15')][_0x7665('0x16')]('\x20')));}var _0x3c6515=schema(properties['voicechannel'])[_0x7665('0x2')](_0x56ee91);if(_0x3c6515[_0x7665('0x5f')]>0x0){return _0x3d056c(_0x17bbbe[_0x7665('0x12')](0x1f4,_[_0x7665('0x65')](_0x3c6515,_0x7665('0x1e'))[_0x7665('0x16')](',\x20')));}var _0x42932e=_[_0x7665('0x60')](_0x1c33b1['channels'],{'uniqueid':_0x56ee91['uniqueid']});if(_0x42932e){return BPromise[_0x7665('0x75')]()[_0x7665('0x1d')](function(){if(_0x42932e[_0x7665('0x69')]){return ami[_0x7665('0x1c')]({'action':_0x7665('0x76'),'channel':_0x42932e[_0x7665('0x69')],'mixmonitorid':_0x56ee91['mixmonitorid']})[_0x7665('0x1f')](function(_0x38743a){});}})[_0x7665('0x1d')](function(){if(_0x42932e[_0x7665('0x77')]){return ami[_0x7665('0x1c')]({'action':_0x7665('0x76'),'channel':_0x42932e['destinationchannel'],'mixmonitorid':_0x56ee91[_0x7665('0x70')]})[_0x7665('0x1f')](function(_0x21151d){});}})[_0x7665('0x1d')](function(_0x54fc74){var _0x3b2b96=_[_0x7665('0x60')](_0x42932e[_0x7665('0x6b')],{'mixmonitorid':_0x56ee91[_0x7665('0x70')]});if(_0x3b2b96){_0x3b2b96[_0x7665('0x71')]='stop';}})[_0x7665('0x1d')](function(){var _0x44a17a=util['format'](_0x7665('0x78'),_0x56ee91['filename']||_0x56ee91[_0x7665('0x66')],_0x56ee91[_0x7665('0x8')]||'wav');var _0x2af15f=_['find'](_0x42932e['monitors'],{'filename':_0x7665('0x6c')+_0x44a17a[_0x7665('0x6d')]()});if(_0x2af15f){_0x2af15f['status']='stop';}})[_0x7665('0x1d')](function(){_0xed47d0({'code':0xc8,'message':[_0x56ee91['uniqueid'],_0x7665('0x79')][_0x7665('0x16')]('\x20')});})['catch'](function(_0x49562b){_0x3d056c(_0x17bbbe[_0x7665('0x12')](0x1f5,[_0x56ee91[_0x7665('0x66')],_0x49562b[_0x7665('0x1e')][_0x7665('0x6d')]()][_0x7665('0x16')]('\x20')));});}else{return _0x3d056c(_0x17bbbe[_0x7665('0x12')](0x1f5,_0x7665('0x74')));}});},'VoiceQueuesChannels':function(_0x4b86be){return new Promise(function(_0x3d3acd,_0x1f6b54){var _0x269621=_[_0x7665('0x63')](_0x1c33b1[_0x7665('0x7a')]);_0x3d3acd({'count':_0x269621[_0x7665('0x5f')],'rows':_0x269621});});},'VoiceQueuesChannel':function(_0xa89a8b){var _0x4ea88e=this;return new Promise(function(_0x561c2f,_0x2a4d06){var _0x52dd8d=schema(properties[_0x7665('0x7b')])['validate'](_0xa89a8b);if(_0x52dd8d[_0x7665('0x5f')]>0x0){return _0x2a4d06(_0x4ea88e[_0x7665('0x12')](0x1f4,_[_0x7665('0x65')](_0x52dd8d,'message')[_0x7665('0x16')](',\x20')));}var _0xeac63f=_['find'](_0x1c33b1['queueChannels'],{'uniqueid':_0xa89a8b[_0x7665('0x66')]});if(_0xeac63f){_0x561c2f(_0xeac63f);}else{return _0x2a4d06(_0x4ea88e[_0x7665('0x12')](0x1f5,_0x7665('0x74')));}});},'VoiceQueuesChannelHangup':function(_0xe6732){var _0x2d888a=this;return new Promise(function(_0x430dd0,_0xa8e489){if(ami[_0x7665('0x20')]()==![]){return _0xa8e489(_0x2d888a['error'](0x1f4,[config['asterisk']['ip'],config[_0x7665('0x13')][_0x7665('0x14')],'ami\x20disconnected'][_0x7665('0x16')]('\x20')));}var _0x48f351=schema(properties['voicequeuechannelhangup'])[_0x7665('0x2')](_0xe6732);if(_0x48f351[_0x7665('0x5f')]>0x0){return _0xa8e489(_0x2d888a[_0x7665('0x12')](0x1f4,_[_0x7665('0x65')](_0x48f351,_0x7665('0x1e'))['join'](',\x20')));}var _0x59b28c=_['find'](_0x1c33b1[_0x7665('0x7a')],{'uniqueid':_0xe6732['uniqueid']});if(_0x59b28c&&_0x59b28c[_0x7665('0x69')]){return ami['Action']({'action':_0x7665('0x7c'),'channel':_0x59b28c[_0x7665('0x69')]})[_0x7665('0x1d')](function(_0xe149cd){_0x430dd0({'code':0xc8,'message':[_0xe6732['uniqueid'],_0xe149cd['message'][_0x7665('0x6d')]()][_0x7665('0x16')]('\x20')});})[_0x7665('0x1f')](function(_0x2d8f53){_0xa8e489(_0x2d888a[_0x7665('0x12')](0x1f5,[_0xe6732[_0x7665('0x66')],_0x2d8f53[_0x7665('0x1e')][_0x7665('0x6d')]()][_0x7665('0x16')]('\x20')));});}else{return _0xa8e489(_0x2d888a[_0x7665('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x106908){var _0x18e913=this;return new Promise(function(_0x5d8b95,_0x1b6506){if(ami['isConnected']()==![]){return _0x1b6506(_0x18e913['error'](0x1f4,[config['asterisk']['ip'],config['asterisk']['username'],_0x7665('0x15')][_0x7665('0x16')]('\x20')));}var _0x506c71=schema(properties[_0x7665('0x7d')])[_0x7665('0x2')](_0x106908);if(_0x506c71[_0x7665('0x5f')]>0x0){return _0x1b6506(_0x18e913[_0x7665('0x12')](0x1f4,_['map'](_0x506c71,_0x7665('0x1e'))[_0x7665('0x16')](',\x20')));}var _0x5ce6b1=_[_0x7665('0x60')](_0x1c33b1[_0x7665('0x7a')],{'uniqueid':_0x106908[_0x7665('0x66')]});if(_0x5ce6b1&&_0x5ce6b1['channel']){return ami[_0x7665('0x1c')]({'action':'Redirect','channel':_0x5ce6b1['channel'],'exten':_0x106908[_0x7665('0x7e')],'context':_0x106908[_0x7665('0x7f')]||_0x5ce6b1[_0x7665('0x7f')],'priority':0x1})[_0x7665('0x1d')](function(_0x535e29){_0x5d8b95({'code':0xc8,'message':[_0x106908[_0x7665('0x66')],_0x535e29[_0x7665('0x1e')][_0x7665('0x6d')]()][_0x7665('0x16')]('\x20')});})[_0x7665('0x1f')](function(_0x244e57){_0x1b6506(_0x18e913[_0x7665('0x12')](0x1f5,[_0x106908[_0x7665('0x66')],_0x244e57[_0x7665('0x1e')][_0x7665('0x6d')]()][_0x7665('0x16')]('\x20')));});}else{return _0x1b6506(_0x18e913[_0x7665('0x12')](0x1f5,_0x7665('0x74')));}});},'Agents':function(_0x1ff152){return new Promise(function(_0x5c7eae,_0x2e1868){var _0x1b8830=_[_0x7665('0x63')](_0x1c33b1[_0x7665('0xf')]);_0x5c7eae({'count':_0x1b8830['length'],'rows':_0x1b8830});});},'Telephones':function(_0x36f154){return new Promise(function(_0xdf3ff2,_0x52108b){var _0x3bb518=_[_0x7665('0x63')](_0x1c33b1['telephones']);_0xdf3ff2({'count':_0x3bb518[_0x7665('0x5f')],'rows':_0x3bb518});});},'Trunks':function(_0x117d07){return new Promise(function(_0x1ec913,_0x4b6fc7){var _0xd8a3f6=_[_0x7665('0x63')](_0x1c33b1[_0x7665('0x80')]);_0x1ec913({'count':_0xd8a3f6[_0x7665('0x5f')],'rows':_0xd8a3f6});});},'OutboundChannels':function(_0x52090c){return new Promise(function(_0x2e1a9b,_0xa3e105){var _0x509904=_[_0x7665('0x63')](_0x1c33b1[_0x7665('0x81')]);_0x2e1a9b({'count':_0x509904[_0x7665('0x5f')],'rows':_0x509904});});},'Outbound':function(_0x294e3f){return new Promise(function(_0x3e79c4,_0x5ee9a6){_0x3e79c4(_0x1c33b1[_0x7665('0x32')]);});},'Campaigns':function(_0x2a9601){return new Promise(function(_0x1d82b2,_0x37540f){var _0x53c492=_[_0x7665('0x63')](_0x1c33b1['campaigns']);_0x1d82b2({'count':_0x53c492[_0x7665('0x5f')],'rows':_0x53c492});});},'VoiceQueuesPreview':function(_0x4f3a38){var _0x101e40=this;return new Promise(function(_0xf05cae,_0x231282){_0xcf83a8[_0x7665('0x82')](_0x4f3a38['id'])[_0x7665('0x1d')](function(_0xb074a7){_0xf05cae({'code':0xc8,'message':_0xb074a7[_0x7665('0x1e')]});})[_0x7665('0x1f')](function(_0x1088c8){_0x231282(_0x101e40[_0x7665('0x12')](0x1f4,_0x1088c8[_0x7665('0x1e')]));});});},'EventManager':function(_0x1983bd){var _0x58cb69=this;return new Promise(function(_0x51837a,_0x41bbb4){if(!_0x1983bd['event']){return _0x41bbb4(_0x58cb69['error'](0x1f4,_0x7665('0x83')));}ami[_0x7665('0x84')](_0x7665('0x85')+_0x1983bd[_0x7665('0x86')],_0x1983bd[_0x7665('0x1e')]);_0x51837a({'code':0xc8,'message':_0x1983bd});});},'FaxAccounts':function(_0x1e617f){return new Promise(function(_0x346328,_0x39a6e2){var _0x21af97=_['values'](_0x1c33b1[_0x7665('0x87')]);_0x346328({'count':_0x21af97[_0x7665('0x5f')],'rows':_0x21af97});});},'SendFax':function(_0x3a5993){var _0xd4452b=this;return new Promise(function(_0x4558ea,_0x442d83){_0x28b410['send'](_0x3a5993)[_0x7665('0x1d')](function(_0x1c505e){_0x4558ea({'code':0xc8,'message':_0x1c505e[_0x7665('0x1e')]});})[_0x7665('0x1f')](function(_0x3a4045){_0x442d83(_0xd4452b[_0x7665('0x12')](0x1f4,_0x3a4045['message']));});});},'CheckAfterSend':function(_0xba1a77){var _0x6949dc=this;return new Promise(function(_0x165ddd,_0xa64995){_0x28b410[_0x7665('0x88')](_0xba1a77)[_0x7665('0x1d')](function(_0x4410fe){_0x165ddd({'code':0xc8,'message':_0x4410fe[_0x7665('0x1e')]});})[_0x7665('0x1f')](function(_0x132170){_0xa64995(_0x6949dc[_0x7665('0x12')](0x1f4,_0x132170['message']));});});}};var _0x356786=jayson['server'](_0x4c0b5c)['http']();_0x356786['on'](_0x7665('0x12'),function(_0x1c83cb){return _0x3387d8(_0x1c83cb);});_0x356786[_0x7665('0x7')](0x232a,_0x7665('0x89'),function(){console[_0x7665('0x8a')](_0x7665('0x8b'),0x232a);return _0x1a6f2f(_0x7665('0x8c')+0x232a);});});};
\ No newline at end of file
index 3bf2b58..ee9dd3f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5f12=['emit','exec','data1','data2','xmd-contactid','ListId','data3','split','phone','map','destcalleridnum','firstName','lastName','fax','createdAt','scheduledAt','updatedAt','union','resolve','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','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','routeId','calleridnum','calleridname','<unknown>','Unknown','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','user:%s','name','trigger:%s','action','merge','../../../../config/logger','../../rpc/cmContact','redis','socket.io-emitter','info','[CM][%s][%s]','stringify'];(function(_0x5eb409,_0x2566cf){var _0x45418e=function(_0x5c30d7){while(--_0x5c30d7){_0x5eb409['push'](_0x5eb409['shift']());}};_0x45418e(++_0x2566cf);}(_0x5f12,0xc9));var _0x25f1=function(_0x40a21c,_0x248e9c){_0x40a21c=_0x40a21c-0x0;var _0x4eb108=_0x5f12[_0x40a21c];return _0x4eb108;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var Redis=require('ioredis');var util=require('util');var config=require('../../../../config/environment');var logger=require(_0x25f1('0x0'))('trigger');var cmContactRpc=require(_0x25f1('0x1'));config[_0x25f1('0x2')]=_['defaults'](config[_0x25f1('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0x25f1('0x3'))(new Redis(config[_0x25f1('0x2')]));function emit(_0x3e2091,_0x5b499f,_0x2dd24a,_0x2ed71f,_0x36c74f){logger[_0x25f1('0x4')](_0x25f1('0x5'),_0x3e2091,_0x5b499f['id'],_0x2dd24a,_0x2ed71f,JSON[_0x25f1('0x6')](_0x36c74f));io['to'](_0x2dd24a)[_0x25f1('0x7')](_0x2ed71f,_0x36c74f);}exports[_0x25f1('0x8')]=function(_0x362088,_0x49bc2d,_0x56b59c,_0x142e5f){var _0x1d16eb,_0x4d03fd;var _0xa064b={};var _0x409561=Number(_0x56b59c[_0x25f1('0x9')]);var _0xc3c805=_0x56b59c[_0x25f1('0xa')]?Boolean(Number(_0x56b59c[_0x25f1('0xa')])):![];var _0x1e13c1;if(_0x142e5f[_0x25f1('0xb')]){_0xa064b['id']=_0x142e5f[_0x25f1('0xb')];}if(!_0xa064b['id']){_0xa064b[_0x25f1('0xc')]=_0x409561;_0x1e13c1=_0x56b59c[_0x25f1('0xd')]&&_0x56b59c['data3']!=='0'?_0x56b59c[_0x25f1('0xd')][_0x25f1('0xe')](','):[_0x25f1('0xf')];_0xa064b['$or']=_[_0x25f1('0x10')](_0x1e13c1,function(_0x364ec8){var _0x2de28a={};_0x2de28a[_0x364ec8]=_0x142e5f['routeId']?_0x142e5f[_0x25f1('0x11')]:_0x142e5f['calleridnum'];return _0x2de28a;});}var _0x361239=['id',_0x25f1('0x12'),_0x25f1('0x13'),_0x25f1('0xf'),'mobile',_0x25f1('0x14'),_0x25f1('0xc'),_0x25f1('0x15'),_0x25f1('0x16'),_0x25f1('0x17')];var _0x23030e=_[_0x25f1('0x18')](_0x361239,_0x1e13c1);BPromise[_0x25f1('0x19')]()[_0x25f1('0x1a')](cmContactRpc[_0x25f1('0x1b')]({'attributes':_0x23030e,'where':_0xa064b}))[_0x25f1('0x1a')](function(_0x164d51){_0x4d03fd=_0x164d51;if(!_[_0x25f1('0x1c')](_0x4d03fd)){if(_0x4d03fd[_0x25f1('0x1d')]===0x1){_0x1d16eb=_0x4d03fd[0x0];logger[_0x25f1('0x4')](_0x25f1('0x1e'),_0x142e5f['uniqueid'],_0x49bc2d['id'],_0x1d16eb['id']);}else{logger[_0x25f1('0x4')](_0x25f1('0x1f'),_0x142e5f[_0x25f1('0x20')],_0x49bc2d['id'],_[_0x25f1('0x10')](_0x4d03fd,'id')[_0x25f1('0x21')](','));}return;}else{logger[_0x25f1('0x4')](_0x25f1('0x22'),_0x142e5f[_0x25f1('0x20')],_0x49bc2d['id']);var _0x194627={'ListId':_0x409561};var _0x3f3d37=_0x56b59c[_0x25f1('0x23')]&&_0x56b59c['data4']!=='0'?_0x56b59c['data4']:'phone';if(_0xc3c805){logger['info'](_0x25f1('0x24'),_0x142e5f['uniqueid'],_0x49bc2d['id']);_0x194627[_0x3f3d37]=_[_0x25f1('0x25')](_0x142e5f[_0x25f1('0x26')])?_0x142e5f[_0x25f1('0x27')]:_0x142e5f[_0x25f1('0x11')];if(_[_0x25f1('0x25')](_0x142e5f[_0x25f1('0x26')])){_0x194627[_0x25f1('0x12')]=_0x142e5f[_0x25f1('0x28')]&&_0x142e5f['calleridname']!==_0x25f1('0x29')?_0x142e5f['calleridname']:_0x25f1('0x2a');}else{_0x194627[_0x25f1('0x12')]=_0x142e5f[_0x25f1('0x2b')]&&_0x142e5f[_0x25f1('0x2b')]!==_0x25f1('0x29')?_0x142e5f['destcalleridname']:_0x25f1('0x2a');}return BPromise[_0x25f1('0x19')]()[_0x25f1('0x1a')](cmContactRpc['createContact'](_0x194627))['then'](function(_0xfb78f3){_0x1d16eb=_0xfb78f3;_0x4d03fd[_0x25f1('0x2c')](_0xfb78f3);if(_0x1d16eb){logger[_0x25f1('0x4')](_0x25f1('0x2d'),_0x142e5f[_0x25f1('0x20')],_0x49bc2d['id'],_0x1d16eb['id']);}return;});}else{logger[_0x25f1('0x4')](_0x25f1('0x2e'),_0x142e5f['uniqueid'],_0x49bc2d['id']);_0x194627[_0x3f3d37]=_[_0x25f1('0x25')](_0x142e5f['routeId'])?_0x142e5f['calleridnum']:_0x142e5f[_0x25f1('0x11')];if(_[_0x25f1('0x25')](_0x142e5f[_0x25f1('0x26')])){_0x194627[_0x25f1('0x12')]=_0x142e5f[_0x25f1('0x28')]&&_0x142e5f[_0x25f1('0x28')]!==_0x25f1('0x29')?_0x142e5f['calleridname']:_0x25f1('0x2a');}else{_0x194627[_0x25f1('0x12')]=_0x142e5f[_0x25f1('0x2b')]&&_0x142e5f[_0x25f1('0x2b')]!==_0x25f1('0x29')?_0x142e5f[_0x25f1('0x2b')]:_0x25f1('0x2a');}_0x1d16eb=_0x194627;_0x4d03fd[_0x25f1('0x2c')](_0x194627);return;}}})['then'](function(){if(_0x362088){emit(_0x142e5f[_0x25f1('0x20')],_0x49bc2d,util['format'](_0x25f1('0x2f'),_0x362088[_0x25f1('0x30')]),util['format'](_0x25f1('0x31'),_0x56b59c[_0x25f1('0x32')]['toLowerCase']()),{'evt':_[_0x25f1('0x33')](_0x142e5f,{'autoCreate':_0xc3c805}),'contact':_0x1d16eb===undefined?{}:_0x1d16eb,'contacts':_0x4d03fd[_0x25f1('0x1d')]===0x0?undefined:_0x4d03fd});}});};
\ No newline at end of file
+var _0x6ca2=['uniqueid','data4','calleridnum','isNil','<unknown>','calleridname','Unknown','destcalleridname','resolve','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','format','user:%s','name','trigger:%s','toLowerCase','bluebird','ioredis','util','../../../../config/logger','redis','defaults','localhost','stringify','emit','data1','data2','xmd-contactid','data3','routeId','destcalleridnum','firstName','lastName','phone','mobile','fax','ListId','createdAt','scheduledAt','updatedAt','union','then','length','[CM][%s][%s]\x20Contact\x20found:%s','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','map','join','info','[CM][%s][%s]\x20Contact\x20not\x20found'];(function(_0x4fe19c,_0x45d0fe){var _0x952ac7=function(_0x274a16){while(--_0x274a16){_0x4fe19c['push'](_0x4fe19c['shift']());}};_0x952ac7(++_0x45d0fe);}(_0x6ca2,0xa7));var _0x26ca=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6ca2[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var BPromise=require(_0x26ca('0x0'));var Redis=require(_0x26ca('0x1'));var util=require(_0x26ca('0x2'));var config=require('../../../../config/environment');var logger=require(_0x26ca('0x3'))('trigger');var cmContactRpc=require('../../rpc/cmContact');config[_0x26ca('0x4')]=_[_0x26ca('0x5')](config[_0x26ca('0x4')],{'host':_0x26ca('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x26ca('0x4')]));function emit(_0x3d1241,_0x57aa23,_0x536b10,_0x3b786a,_0x382cd7){logger['info']('[CM][%s][%s]',_0x3d1241,_0x57aa23['id'],_0x536b10,_0x3b786a,JSON[_0x26ca('0x7')](_0x382cd7));io['to'](_0x536b10)[_0x26ca('0x8')](_0x3b786a,_0x382cd7);}exports['exec']=function(_0x412a12,_0x5e5d4c,_0x44790c,_0x5d345b){var _0x2e6474,_0x3bcb7f;var _0x4c88e2={};var _0x124b43=Number(_0x44790c[_0x26ca('0x9')]);var _0x2aa19d=_0x44790c[_0x26ca('0xa')]?Boolean(Number(_0x44790c[_0x26ca('0xa')])):![];var _0xd409fe;if(_0x5d345b[_0x26ca('0xb')]){_0x4c88e2['id']=_0x5d345b[_0x26ca('0xb')];}if(!_0x4c88e2['id']){_0x4c88e2['ListId']=_0x124b43;_0xd409fe=_0x44790c[_0x26ca('0xc')]&&_0x44790c[_0x26ca('0xc')]!=='0'?_0x44790c['data3']['split'](','):['phone'];_0x4c88e2['$or']=_['map'](_0xd409fe,function(_0x5e3630){var _0x5bb132={};_0x5bb132[_0x5e3630]=_0x5d345b[_0x26ca('0xd')]?_0x5d345b[_0x26ca('0xe')]:_0x5d345b['calleridnum'];return _0x5bb132;});}var _0x1ce763=['id',_0x26ca('0xf'),_0x26ca('0x10'),_0x26ca('0x11'),_0x26ca('0x12'),_0x26ca('0x13'),_0x26ca('0x14'),_0x26ca('0x15'),_0x26ca('0x16'),_0x26ca('0x17')];var _0x5876cf=_[_0x26ca('0x18')](_0x1ce763,_0xd409fe);BPromise['resolve']()['then'](cmContactRpc['getContacts']({'attributes':_0x5876cf,'where':_0x4c88e2}))[_0x26ca('0x19')](function(_0x570f9c){_0x3bcb7f=_0x570f9c;if(!_['isEmpty'](_0x3bcb7f)){if(_0x3bcb7f[_0x26ca('0x1a')]===0x1){_0x2e6474=_0x3bcb7f[0x0];logger['info'](_0x26ca('0x1b'),_0x5d345b['uniqueid'],_0x5e5d4c['id'],_0x2e6474['id']);}else{logger['info'](_0x26ca('0x1c'),_0x5d345b['uniqueid'],_0x5e5d4c['id'],_[_0x26ca('0x1d')](_0x3bcb7f,'id')[_0x26ca('0x1e')](','));}return;}else{logger[_0x26ca('0x1f')](_0x26ca('0x20'),_0x5d345b[_0x26ca('0x21')],_0x5e5d4c['id']);var _0x286af2={'ListId':_0x124b43};var _0x38ef03=_0x44790c[_0x26ca('0x22')]&&_0x44790c[_0x26ca('0x22')]!=='0'?_0x44790c[_0x26ca('0x22')]:'phone';if(_0x2aa19d){logger['info']('[CM][%s][%s]\x20Autocreate\x20enabled',_0x5d345b[_0x26ca('0x21')],_0x5e5d4c['id']);_0x286af2[_0x38ef03]=_['isNil'](_0x5d345b[_0x26ca('0xd')])?_0x5d345b[_0x26ca('0x23')]:_0x5d345b[_0x26ca('0xe')];if(_[_0x26ca('0x24')](_0x5d345b['routeId'])){_0x286af2[_0x26ca('0xf')]=_0x5d345b['calleridname']&&_0x5d345b['calleridname']!==_0x26ca('0x25')?_0x5d345b[_0x26ca('0x26')]:_0x26ca('0x27');}else{_0x286af2[_0x26ca('0xf')]=_0x5d345b[_0x26ca('0x28')]&&_0x5d345b['destcalleridname']!=='<unknown>'?_0x5d345b[_0x26ca('0x28')]:'Unknown';}return BPromise[_0x26ca('0x29')]()[_0x26ca('0x19')](cmContactRpc[_0x26ca('0x2a')](_0x286af2))[_0x26ca('0x19')](function(_0xbfaa0){_0x2e6474=_0xbfaa0;_0x3bcb7f[_0x26ca('0x2b')](_0xbfaa0);if(_0x2e6474){logger[_0x26ca('0x1f')](_0x26ca('0x2c'),_0x5d345b[_0x26ca('0x21')],_0x5e5d4c['id'],_0x2e6474['id']);}return;});}else{logger[_0x26ca('0x1f')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x5d345b[_0x26ca('0x21')],_0x5e5d4c['id']);_0x286af2[_0x38ef03]=_[_0x26ca('0x24')](_0x5d345b['routeId'])?_0x5d345b[_0x26ca('0x23')]:_0x5d345b[_0x26ca('0xe')];if(_[_0x26ca('0x24')](_0x5d345b[_0x26ca('0xd')])){_0x286af2[_0x26ca('0xf')]=_0x5d345b[_0x26ca('0x26')]&&_0x5d345b['calleridname']!==_0x26ca('0x25')?_0x5d345b[_0x26ca('0x26')]:_0x26ca('0x27');}else{_0x286af2['firstName']=_0x5d345b[_0x26ca('0x28')]&&_0x5d345b[_0x26ca('0x28')]!==_0x26ca('0x25')?_0x5d345b[_0x26ca('0x28')]:_0x26ca('0x27');}_0x2e6474=_0x286af2;_0x3bcb7f['push'](_0x286af2);return;}}})[_0x26ca('0x19')](function(){if(_0x412a12){emit(_0x5d345b[_0x26ca('0x21')],_0x5e5d4c,util[_0x26ca('0x2d')](_0x26ca('0x2e'),_0x412a12[_0x26ca('0x2f')]),util['format'](_0x26ca('0x30'),_0x44790c['action'][_0x26ca('0x31')]()),{'evt':_['merge'](_0x5d345b,{'autoCreate':_0x2aa19d}),'contact':_0x2e6474===undefined?{}:_0x2e6474,'contacts':_0x3bcb7f[_0x26ca('0x1a')]===0x0?undefined:_0x3bcb7f});}});};
\ No newline at end of file
index 71ce993..ea26490 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfe53=['freshsalesAccounts','accounts','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:amd','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','prototype','emit','info','stringify','clone','motionChannel','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','action','toLowerCase','contactmanager','motionbar','browser','data1','data2','html','template\x20not\x20found','uri','buildUri','data3','isNil','data4','uriLocation','800','data5','windowHeight','data6','winApplication','render','winArguments','format','trigger:%s:%s','name','trigger:%s','exec','integration','queue','routeId','urlforward','script','parse','query','search','replace','channel','AllConditions','every','checkConditions','AnyConditions','some','field','chat','operator','ChatWebsiteId','upperFirst','AccountId','value','interaction','message','event','agent','membername','lastevent','mailSubstatus','substatus','exports','util','lodash','mustache','ioredis','./urlforward','./integration','trigger','../ami','defaults','redis','socket.io-emitter','popup','url','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts'];(function(_0x3feaba,_0x42e1bd){var _0x3fccc9=function(_0xdf964a){while(--_0xdf964a){_0x3feaba['push'](_0x3feaba['shift']());}};_0x3fccc9(++_0x42e1bd);}(_0xfe53,0x146));var _0x3fe5=function(_0x329031,_0x51584b){_0x329031=_0x329031-0x0;var _0x52f346=_0xfe53[_0x329031];return _0x52f346;};'use strict';var util=require(_0x3fe5('0x0'));var _=require(_0x3fe5('0x1'));var url=require('url');var Mustache=require(_0x3fe5('0x2'));var Redis=require(_0x3fe5('0x3'));var urlforward=require(_0x3fe5('0x4'));var integration=require(_0x3fe5('0x5'));var cmContact=require('./cmContact');var script=require('./script');var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x3fe5('0x6'));var ami=require(_0x3fe5('0x7'));config['redis']=_[_0x3fe5('0x8')](config[_0x3fe5('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x3fe5('0xa'))(new Redis(config['redis']));var operators={'equals':function(_0x2f1383,_0x16b1d5){return _0x2f1383==_0x16b1d5;},'not_equals':function(_0x2997da,_0x27a1d0){return _0x2997da!=_0x27a1d0;}};var barAndWebActions=[_0x3fe5('0xb'),_0x3fe5('0xc'),_0x3fe5('0xd')];function Trigger(_0x490a9e){this[_0x3fe5('0xe')]=_0x490a9e['triggers'];this['agents']=_0x490a9e[_0x3fe5('0xf')];this[_0x3fe5('0x10')]=_0x490a9e[_0x3fe5('0x10')];this[_0x3fe5('0x11')]=_0x490a9e[_0x3fe5('0x11')];this['voiceExtensions']=_0x490a9e[_0x3fe5('0x12')];this[_0x3fe5('0x13')]=_0x490a9e['zendeskAccounts'];this[_0x3fe5('0x14')]=_0x490a9e['freshdeskAccounts'];this[_0x3fe5('0x15')]=_0x490a9e[_0x3fe5('0x15')];this[_0x3fe5('0x16')]=_0x490a9e[_0x3fe5('0x16')];this[_0x3fe5('0x17')]=_0x490a9e[_0x3fe5('0x17')];this[_0x3fe5('0x18')]=_0x490a9e[_0x3fe5('0x18')];this['vtigerAccounts']=_0x490a9e[_0x3fe5('0x19')];this[_0x3fe5('0x1a')]=_0x490a9e['servicenowAccounts'];this['dynamics365Accounts']=_0x490a9e[_0x3fe5('0x1b')];this[_0x3fe5('0x1c')]=_0x490a9e['freshsalesAccounts'];this[_0x3fe5('0x1d')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x3fe5('0x15')],'freshdesk':this[_0x3fe5('0x14')],'sugarcrm':this[_0x3fe5('0x16')],'zoho':this[_0x3fe5('0x17')],'desk':this['deskAccounts'],'vtiger':this[_0x3fe5('0x19')],'dynamics365':this[_0x3fe5('0x1b')],'freshsales':this['freshsalesAccounts'],'servicenow':this['servicenowAccounts']};ami['on']('custom:agentcalled',this[_0x3fe5('0x1e')][_0x3fe5('0x1f')](this));ami['on']('custom:agentconnect',this['syncCustomEvent'][_0x3fe5('0x1f')](this));ami['on'](_0x3fe5('0x20'),this[_0x3fe5('0x1e')][_0x3fe5('0x1f')](this));ami['on'](_0x3fe5('0x21'),this[_0x3fe5('0x1e')][_0x3fe5('0x1f')](this));ami['on']('custom:agentnosuchnumber',this[_0x3fe5('0x1e')][_0x3fe5('0x1f')](this));ami['on'](_0x3fe5('0x22'),this[_0x3fe5('0x1e')]['bind'](this));ami['on'](_0x3fe5('0x23'),this['syncCustomEvent']['bind'](this));ami['on'](_0x3fe5('0x24'),this[_0x3fe5('0x1e')][_0x3fe5('0x1f')](this));ami['on']('custom:agentreject',this['syncCustomEvent'][_0x3fe5('0x1f')](this));ami['on'](_0x3fe5('0x25'),this['syncCustomEvent'][_0x3fe5('0x1f')](this));ami['on']('custom:queuecallerabandon',this[_0x3fe5('0x1e')]['bind'](this));ami['on']('custom:timeout',this[_0x3fe5('0x1e')][_0x3fe5('0x1f')](this));ami['on']('custom:dialbegin',this[_0x3fe5('0x26')]['bind'](this));ami['on'](_0x3fe5('0x27'),this[_0x3fe5('0x26')][_0x3fe5('0x1f')](this));ami['on'](_0x3fe5('0x28'),this[_0x3fe5('0x26')]['bind'](this));ami['on'](_0x3fe5('0x29'),this[_0x3fe5('0x1e')][_0x3fe5('0x1f')](this));ami['on'](_0x3fe5('0x2a'),this[_0x3fe5('0x1e')]['bind'](this));ami['on'](_0x3fe5('0x2b'),this[_0x3fe5('0x1e')][_0x3fe5('0x1f')](this));ami['on'](_0x3fe5('0x2c'),this[_0x3fe5('0x1e')]['bind'](this));ami['on'](_0x3fe5('0x2d'),this[_0x3fe5('0x1e')]['bind'](this));ami['on']('custom:rejectmessage',this[_0x3fe5('0x1e')]['bind'](this));}Trigger[_0x3fe5('0x2e')][_0x3fe5('0x2f')]=function(_0x52206e,_0x213d60,_0x55be52){logger[_0x3fe5('0x30')](_0x52206e,_0x213d60,JSON[_0x3fe5('0x31')](_0x55be52));io['to'](_0x52206e)['emit'](_0x213d60,_0x55be52);};Trigger['prototype'][_0x3fe5('0x1e')]=function(_0x314906){var _0xed8c16=_[_0x3fe5('0x32')](_0x314906);if(typeof _0xed8c16[_0x3fe5('0x33')]==='undefined'){_0xed8c16[_0x3fe5('0x33')]='voice';}this[_0x3fe5('0x34')](_0xed8c16);};Trigger[_0x3fe5('0x2e')][_0x3fe5('0x26')]=function(_0x5b5930){if(this['agents'][_0x5b5930[_0x3fe5('0x35')]]){this[_0x3fe5('0x1e')](_0x5b5930);}};Trigger[_0x3fe5('0x2e')][_0x3fe5('0x34')]=function(_0x187615){var _0x2beb15;for(var _0x2522bb in this[_0x3fe5('0xe')]){if(this[_0x3fe5('0xe')][_0x3fe5('0x36')](_0x2522bb)){if(this[_0x3fe5('0xe')][_0x2522bb][_0x3fe5('0x37')]){_0x2beb15=this[_0x3fe5('0x38')](this[_0x3fe5('0xe')][_0x2522bb],_0x187615);if(_0x2beb15){_[_0x3fe5('0x39')](_0x187615,_0x187615[_0x3fe5('0x3a')]);for(var _0x38b25c=0x0,_0x369d81,_0x393af3,_0x191a22;_0x38b25c<this[_0x3fe5('0xe')][_0x2522bb][_0x3fe5('0x3b')]['length'];_0x38b25c+=0x1){_0x369d81=this[_0x3fe5('0xe')][_0x2522bb][_0x3fe5('0x3b')][_0x38b25c];if(this[_0x3fe5('0xf')][_0x187615[_0x3fe5('0x35')]]){switch(_0x369d81[_0x3fe5('0x3c')][_0x3fe5('0x3d')]()){case _0x3fe5('0x3e'):break;case _0x3fe5('0x3f'):case _0x3fe5('0x40'):var _0x30f23a={};switch(barAndWebActions[_0x369d81[_0x3fe5('0x41')]]){case'popup':_0x30f23a['TemplateId']=_0x369d81[_0x3fe5('0x42')];_0x30f23a[_0x3fe5('0x43')]=this[_0x3fe5('0x11')][_0x369d81[_0x3fe5('0x42')]]?Mustache['render'](this[_0x3fe5('0x11')][_0x369d81[_0x3fe5('0x42')]][_0x3fe5('0x43')],_0x187615):_0x3fe5('0x44');break;case _0x3fe5('0xc'):_0x30f23a[_0x3fe5('0x45')]=this[_0x3fe5('0x46')](_0x369d81[_0x3fe5('0x42')],_0x187615,_['isNil'](_0x369d81[_0x3fe5('0x47')])?!![]:parseInt(_0x369d81['data3'],0xa));if(_[_0x3fe5('0x48')](_0x369d81[_0x3fe5('0x49')])){_0x30f23a['location']='0';}else{_0x30f23a[_0x3fe5('0x4a')]=_0x369d81[_0x3fe5('0x49')];_0x30f23a['windowWidth']=_[_0x3fe5('0x48')](_0x369d81['data5'])?_0x3fe5('0x4b'):_0x369d81[_0x3fe5('0x4c')];_0x30f23a[_0x3fe5('0x4d')]=_[_0x3fe5('0x48')](_0x369d81[_0x3fe5('0x4e')])?'600':_0x369d81[_0x3fe5('0x4e')];}break;case _0x3fe5('0xd'):_0x30f23a[_0x3fe5('0x4f')]=_0x369d81[_0x3fe5('0x42')]?Mustache[_0x3fe5('0x50')](_0x369d81[_0x3fe5('0x42')],_0x187615):'';_0x30f23a[_0x3fe5('0x51')]=_0x369d81['data3']?Mustache[_0x3fe5('0x50')](_0x369d81[_0x3fe5('0x47')],_0x187615):'';break;}this[_0x3fe5('0x2f')](util[_0x3fe5('0x52')]('user:%s',this['agents'][_0x187615[_0x3fe5('0x35')]]['name']),util[_0x3fe5('0x52')](_0x3fe5('0x53'),_0x369d81[_0x3fe5('0x3c')]['toLowerCase'](),barAndWebActions[_0x369d81[_0x3fe5('0x41')]]),_[_0x3fe5('0x39')](_0x30f23a,_0x187615));break;case'jscripty':this[_0x3fe5('0x2f')](util[_0x3fe5('0x52')]('user:%s',this[_0x3fe5('0xf')][_0x187615[_0x3fe5('0x35')]][_0x3fe5('0x54')]),util['format'](_0x3fe5('0x55'),_0x369d81[_0x3fe5('0x3c')][_0x3fe5('0x3d')]()),_[_0x3fe5('0x39')]({'ProjectId':parseInt(_0x369d81['data1'],0xa)},_0x187615));break;default:this[_0x3fe5('0x2f')](util[_0x3fe5('0x52')]('user:%s',this['agents'][_0x187615[_0x3fe5('0x35')]][_0x3fe5('0x54')]),util['format']('trigger:%s',_0x369d81[_0x3fe5('0x3c')][_0x3fe5('0x3d')]()),_[_0x3fe5('0x39')]({},_0x369d81,_0x187615));}}switch(_0x369d81[_0x3fe5('0x3c')][_0x3fe5('0x3d')]()){case _0x3fe5('0x3e'):cmContact[_0x3fe5('0x56')](this[_0x3fe5('0xf')][_0x187615[_0x3fe5('0x35')]],this[_0x3fe5('0xe')][_0x2522bb],_0x369d81,_0x187615);break;case _0x3fe5('0x57'):integration[_0x3fe5('0x56')](_0x369d81,_0x187615,this['accounts'],this['agents'][_0x187615['interface']],this[_0x3fe5('0x10')][_0x187615[_0x3fe5('0x58')]],this[_0x3fe5('0x12')][_0x187615[_0x3fe5('0x59')]]);break;case _0x3fe5('0x5a'):urlforward[_0x3fe5('0x56')](_0x369d81,_0x187615);break;case _0x3fe5('0x5b'):script[_0x3fe5('0x56')](_0x369d81,_0x187615);break;}}}}}}};Trigger[_0x3fe5('0x2e')][_0x3fe5('0x46')]=function(_0x3020b4,_0xf4b50f,_0x2253be){var _0x2c4be8=url[_0x3fe5('0x5c')](Mustache[_0x3fe5('0x50')](_0x3020b4,_0xf4b50f),!![]);if(_0x2253be){_[_0x3fe5('0x39')](_0x2c4be8[_0x3fe5('0x5d')],_0xf4b50f);}delete _0x2c4be8[_0x3fe5('0x5e')];var _0x1855ef=url[_0x3fe5('0x52')](_0x2c4be8);_0x1855ef=_0x1855ef[_0x3fe5('0x5f')](/\/\?/g,'?');return _0x1855ef;};Trigger[_0x3fe5('0x2e')]['checkTrigger']=function(_0x17879f,_0x2a675c){var _0x3920b5=!![];var _0x2cc2df=!![];var _0x4306ff=![];if(_0x17879f[_0x3fe5('0x60')]===_0x2a675c[_0x3fe5('0x33')]){_0x4306ff=!![];}if(_0x17879f[_0x3fe5('0x61')]['length']){_0x3920b5=_[_0x3fe5('0x62')](_0x17879f[_0x3fe5('0x61')],this[_0x3fe5('0x63')](_0x2a675c,_0x17879f[_0x3fe5('0x60')]));}if(_0x17879f[_0x3fe5('0x64')]['length']){_0x2cc2df=_[_0x3fe5('0x65')](_0x17879f[_0x3fe5('0x64')],this[_0x3fe5('0x63')](_0x2a675c,_0x17879f[_0x3fe5('0x60')]));}return _0x4306ff&&_0x3920b5&&_0x2cc2df;};Trigger[_0x3fe5('0x2e')][_0x3fe5('0x63')]=function(_0x26e221,_0x5dee71){return function(_0x5c2faf){switch(_0x5c2faf[_0x3fe5('0x66')]){case'account':if(_0x26e221[_0x3fe5('0x60')]===_0x5dee71){if(_0x5dee71===_0x3fe5('0x67')){return _0x26e221['ChatWebsiteId']?operators[_0x5c2faf[_0x3fe5('0x68')]](Number(_0x5c2faf['value']),_0x26e221[_0x3fe5('0x69')]):![];}else{return _0x26e221[_[_0x3fe5('0x6a')](_0x5dee71)+_0x3fe5('0x6b')]?operators[_0x5c2faf['operator']](Number(_0x5c2faf[_0x3fe5('0x6c')]),_0x26e221[_['upperFirst'](_0x5dee71)+_0x3fe5('0x6b')]):![];}}break;case _0x3fe5('0x6d'):case _0x3fe5('0x6e'):if(_0x26e221['channel']===_0x5dee71){return _0x26e221[_0x3fe5('0x6f')]?operators[_0x5c2faf[_0x3fe5('0x68')]](_0x5c2faf[_0x3fe5('0x6c')],_0x26e221[_0x3fe5('0x6f')]):![];}break;case _0x3fe5('0x58'):return _0x26e221[_0x3fe5('0x58')]?operators[_0x5c2faf[_0x3fe5('0x68')]](_0x5c2faf[_0x3fe5('0x6c')],_0x26e221[_0x3fe5('0x58')]):![];case _0x3fe5('0x70'):return _0x26e221[_0x3fe5('0x71')]?operators[_0x5c2faf[_0x3fe5('0x68')]](_0x5c2faf[_0x3fe5('0x6c')],_0x26e221[_0x3fe5('0x71')]):![];case _0x3fe5('0x72'):return _0x26e221[_0x3fe5('0x72')]?operators[_0x5c2faf[_0x3fe5('0x68')]](_0x5c2faf[_0x3fe5('0x6c')],_0x26e221[_0x3fe5('0x72')]):![];case _0x3fe5('0x59'):return _0x26e221['routeId']?operators[_0x5c2faf[_0x3fe5('0x68')]](_0x5c2faf[_0x3fe5('0x6c')],_0x26e221['routeId']):![];case _0x3fe5('0x73'):return _0x26e221[_0x3fe5('0x74')]?operators[_0x5c2faf[_0x3fe5('0x68')]](_0x5c2faf['value'],_0x26e221[_0x3fe5('0x74')]):![];}return![];};};module[_0x3fe5('0x75')]=Trigger;
\ No newline at end of file
+var _0xc6ef=['winApplication','winArguments','format','user:%s','name','action','trigger:%s','data1','contactmanager','exec','integration','queue','routeId','urlforward','search','replace','channel','every','AllConditions','checkConditions','AnyConditions','field','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','mailSubstatus','substatus','exports','util','lodash','url','ioredis','./integration','./cmContact','./script','../../../config/logger','trigger','redis','defaults','localhost','socket.io-emitter','popup','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentnosuchnumber','custom:agentnoanswer','custom:agentbusy','custom:queuecallerabandon','custom:timeout','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','emit','info','stringify','clone','motionChannel','undefined','voice','checkTriggers','interface','prototype','status','checkTrigger','merge','length','Actions','toLowerCase','motionbar','TemplateId','data2','html','render','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','windowWidth','800','data5','windowHeight','data6','600'];(function(_0x3a8d06,_0xc5596f){var _0x3c1015=function(_0x1888a5){while(--_0x1888a5){_0x3a8d06['push'](_0x3a8d06['shift']());}};_0x3c1015(++_0xc5596f);}(_0xc6ef,0x18e));var _0xfc6e=function(_0x5c0935,_0x510eb7){_0x5c0935=_0x5c0935-0x0;var _0x15ae90=_0xc6ef[_0x5c0935];return _0x15ae90;};'use strict';var util=require(_0xfc6e('0x0'));var _=require(_0xfc6e('0x1'));var url=require(_0xfc6e('0x2'));var Mustache=require('mustache');var Redis=require(_0xfc6e('0x3'));var urlforward=require('./urlforward');var integration=require(_0xfc6e('0x4'));var cmContact=require(_0xfc6e('0x5'));var script=require(_0xfc6e('0x6'));var config=require('../../../config/environment');var logger=require(_0xfc6e('0x7'))(_0xfc6e('0x8'));var ami=require('../ami');config[_0xfc6e('0x9')]=_[_0xfc6e('0xa')](config[_0xfc6e('0x9')],{'host':_0xfc6e('0xb'),'port':0x18eb});var io=require(_0xfc6e('0xc'))(new Redis(config[_0xfc6e('0x9')]));var operators={'equals':function(_0x340d7d,_0xa6e74f){return _0x340d7d==_0xa6e74f;},'not_equals':function(_0x2f164f,_0x47928e){return _0x2f164f!=_0x47928e;}};var barAndWebActions=[_0xfc6e('0xd'),_0xfc6e('0x2'),_0xfc6e('0xe')];function Trigger(_0x2ceff6){this[_0xfc6e('0xf')]=_0x2ceff6[_0xfc6e('0xf')];this['agents']=_0x2ceff6[_0xfc6e('0x10')];this[_0xfc6e('0x11')]=_0x2ceff6[_0xfc6e('0x11')];this[_0xfc6e('0x12')]=_0x2ceff6[_0xfc6e('0x12')];this[_0xfc6e('0x13')]=_0x2ceff6['voiceExtensions'];this[_0xfc6e('0x14')]=_0x2ceff6[_0xfc6e('0x14')];this['freshdeskAccounts']=_0x2ceff6[_0xfc6e('0x15')];this['salesforceAccounts']=_0x2ceff6[_0xfc6e('0x16')];this[_0xfc6e('0x17')]=_0x2ceff6['sugarcrmAccounts'];this[_0xfc6e('0x18')]=_0x2ceff6[_0xfc6e('0x18')];this[_0xfc6e('0x19')]=_0x2ceff6[_0xfc6e('0x19')];this[_0xfc6e('0x1a')]=_0x2ceff6[_0xfc6e('0x1a')];this[_0xfc6e('0x1b')]=_0x2ceff6['servicenowAccounts'];this[_0xfc6e('0x1c')]=_0x2ceff6[_0xfc6e('0x1c')];this[_0xfc6e('0x1d')]=_0x2ceff6[_0xfc6e('0x1d')];this[_0xfc6e('0x1e')]={'zendesk':this[_0xfc6e('0x14')],'salesforce':this[_0xfc6e('0x16')],'freshdesk':this[_0xfc6e('0x15')],'sugarcrm':this[_0xfc6e('0x17')],'zoho':this[_0xfc6e('0x18')],'desk':this['deskAccounts'],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0xfc6e('0x1c')],'freshsales':this[_0xfc6e('0x1d')],'servicenow':this[_0xfc6e('0x1b')]};ami['on'](_0xfc6e('0x1f'),this[_0xfc6e('0x20')][_0xfc6e('0x21')](this));ami['on'](_0xfc6e('0x22'),this['syncCustomEvent'][_0xfc6e('0x21')](this));ami['on']('custom:agentringnoanswer',this[_0xfc6e('0x20')][_0xfc6e('0x21')](this));ami['on']('custom:agentcomplete',this['syncCustomEvent'][_0xfc6e('0x21')](this));ami['on'](_0xfc6e('0x23'),this[_0xfc6e('0x20')]['bind'](this));ami['on'](_0xfc6e('0x24'),this[_0xfc6e('0x20')][_0xfc6e('0x21')](this));ami['on'](_0xfc6e('0x25'),this[_0xfc6e('0x20')][_0xfc6e('0x21')](this));ami['on']('custom:agentcongestion',this['syncCustomEvent'][_0xfc6e('0x21')](this));ami['on']('custom:agentreject',this['syncCustomEvent'][_0xfc6e('0x21')](this));ami['on']('custom:amd',this[_0xfc6e('0x20')][_0xfc6e('0x21')](this));ami['on'](_0xfc6e('0x26'),this['syncCustomEvent']['bind'](this));ami['on'](_0xfc6e('0x27'),this[_0xfc6e('0x20')][_0xfc6e('0x21')](this));ami['on']('custom:dialbegin',this[_0xfc6e('0x28')][_0xfc6e('0x21')](this));ami['on'](_0xfc6e('0x29'),this[_0xfc6e('0x28')]['bind'](this));ami['on'](_0xfc6e('0x2a'),this[_0xfc6e('0x28')][_0xfc6e('0x21')](this));ami['on'](_0xfc6e('0x2b'),this[_0xfc6e('0x20')][_0xfc6e('0x21')](this));ami['on'](_0xfc6e('0x2c'),this['syncCustomEvent'][_0xfc6e('0x21')](this));ami['on'](_0xfc6e('0x2d'),this[_0xfc6e('0x20')][_0xfc6e('0x21')](this));ami['on']('custom:outgoingmessage',this[_0xfc6e('0x20')][_0xfc6e('0x21')](this));ami['on'](_0xfc6e('0x2e'),this[_0xfc6e('0x20')][_0xfc6e('0x21')](this));ami['on'](_0xfc6e('0x2f'),this['syncCustomEvent'][_0xfc6e('0x21')](this));}Trigger['prototype'][_0xfc6e('0x30')]=function(_0x5b4342,_0x2bcb81,_0x5c0ad5){logger[_0xfc6e('0x31')](_0x5b4342,_0x2bcb81,JSON[_0xfc6e('0x32')](_0x5c0ad5));io['to'](_0x5b4342)[_0xfc6e('0x30')](_0x2bcb81,_0x5c0ad5);};Trigger['prototype']['syncCustomEvent']=function(_0x45b59f){var _0x365f63=_[_0xfc6e('0x33')](_0x45b59f);if(typeof _0x365f63[_0xfc6e('0x34')]===_0xfc6e('0x35')){_0x365f63[_0xfc6e('0x34')]=_0xfc6e('0x36');}this[_0xfc6e('0x37')](_0x365f63);};Trigger['prototype'][_0xfc6e('0x28')]=function(_0xe86429){if(this[_0xfc6e('0x10')][_0xe86429[_0xfc6e('0x38')]]){this[_0xfc6e('0x20')](_0xe86429);}};Trigger[_0xfc6e('0x39')][_0xfc6e('0x37')]=function(_0xe7ec84){var _0x33bd5e;for(var _0x4548f0 in this[_0xfc6e('0xf')]){if(this[_0xfc6e('0xf')]['hasOwnProperty'](_0x4548f0)){if(this['triggers'][_0x4548f0][_0xfc6e('0x3a')]){_0x33bd5e=this[_0xfc6e('0x3b')](this['triggers'][_0x4548f0],_0xe7ec84);if(_0x33bd5e){_[_0xfc6e('0x3c')](_0xe7ec84,_0xe7ec84['variables']);for(var _0xc5747b=0x0,_0x5470d9,_0x28782b,_0x3a2d38;_0xc5747b<this['triggers'][_0x4548f0]['Actions'][_0xfc6e('0x3d')];_0xc5747b+=0x1){_0x5470d9=this[_0xfc6e('0xf')][_0x4548f0][_0xfc6e('0x3e')][_0xc5747b];if(this[_0xfc6e('0x10')][_0xe7ec84[_0xfc6e('0x38')]]){switch(_0x5470d9['action'][_0xfc6e('0x3f')]()){case'contactmanager':break;case _0xfc6e('0x40'):case'browser':var _0xf80b1f={};switch(barAndWebActions[_0x5470d9['data1']]){case _0xfc6e('0xd'):_0xf80b1f[_0xfc6e('0x41')]=_0x5470d9[_0xfc6e('0x42')];_0xf80b1f[_0xfc6e('0x43')]=this[_0xfc6e('0x12')][_0x5470d9[_0xfc6e('0x42')]]?Mustache[_0xfc6e('0x44')](this[_0xfc6e('0x12')][_0x5470d9[_0xfc6e('0x42')]][_0xfc6e('0x43')],_0xe7ec84):_0xfc6e('0x45');break;case _0xfc6e('0x2'):_0xf80b1f[_0xfc6e('0x46')]=this[_0xfc6e('0x47')](_0x5470d9[_0xfc6e('0x42')],_0xe7ec84,_[_0xfc6e('0x48')](_0x5470d9['data3'])?!![]:parseInt(_0x5470d9[_0xfc6e('0x49')],0xa));if(_[_0xfc6e('0x48')](_0x5470d9[_0xfc6e('0x4a')])){_0xf80b1f[_0xfc6e('0x4b')]='0';}else{_0xf80b1f['uriLocation']=_0x5470d9[_0xfc6e('0x4a')];_0xf80b1f[_0xfc6e('0x4c')]=_[_0xfc6e('0x48')](_0x5470d9['data5'])?_0xfc6e('0x4d'):_0x5470d9[_0xfc6e('0x4e')];_0xf80b1f[_0xfc6e('0x4f')]=_[_0xfc6e('0x48')](_0x5470d9[_0xfc6e('0x50')])?_0xfc6e('0x51'):_0x5470d9[_0xfc6e('0x50')];}break;case _0xfc6e('0xe'):_0xf80b1f[_0xfc6e('0x52')]=_0x5470d9[_0xfc6e('0x42')]?Mustache[_0xfc6e('0x44')](_0x5470d9[_0xfc6e('0x42')],_0xe7ec84):'';_0xf80b1f[_0xfc6e('0x53')]=_0x5470d9[_0xfc6e('0x49')]?Mustache[_0xfc6e('0x44')](_0x5470d9['data3'],_0xe7ec84):'';break;}this['emit'](util[_0xfc6e('0x54')](_0xfc6e('0x55'),this[_0xfc6e('0x10')][_0xe7ec84['interface']][_0xfc6e('0x56')]),util[_0xfc6e('0x54')]('trigger:%s:%s',_0x5470d9[_0xfc6e('0x57')]['toLowerCase'](),barAndWebActions[_0x5470d9['data1']]),_['merge'](_0xf80b1f,_0xe7ec84));break;case'jscripty':this[_0xfc6e('0x30')](util[_0xfc6e('0x54')](_0xfc6e('0x55'),this[_0xfc6e('0x10')][_0xe7ec84['interface']][_0xfc6e('0x56')]),util['format'](_0xfc6e('0x58'),_0x5470d9[_0xfc6e('0x57')]['toLowerCase']()),_[_0xfc6e('0x3c')]({'ProjectId':parseInt(_0x5470d9[_0xfc6e('0x59')],0xa)},_0xe7ec84));break;default:this[_0xfc6e('0x30')](util['format'](_0xfc6e('0x55'),this[_0xfc6e('0x10')][_0xe7ec84[_0xfc6e('0x38')]]['name']),util['format'](_0xfc6e('0x58'),_0x5470d9[_0xfc6e('0x57')][_0xfc6e('0x3f')]()),_[_0xfc6e('0x3c')]({},_0x5470d9,_0xe7ec84));}}switch(_0x5470d9[_0xfc6e('0x57')][_0xfc6e('0x3f')]()){case _0xfc6e('0x5a'):cmContact[_0xfc6e('0x5b')](this[_0xfc6e('0x10')][_0xe7ec84[_0xfc6e('0x38')]],this[_0xfc6e('0xf')][_0x4548f0],_0x5470d9,_0xe7ec84);break;case _0xfc6e('0x5c'):integration[_0xfc6e('0x5b')](_0x5470d9,_0xe7ec84,this['accounts'],this[_0xfc6e('0x10')][_0xe7ec84[_0xfc6e('0x38')]],this[_0xfc6e('0x11')][_0xe7ec84[_0xfc6e('0x5d')]],this['voiceExtensions'][_0xe7ec84[_0xfc6e('0x5e')]]);break;case _0xfc6e('0x5f'):urlforward[_0xfc6e('0x5b')](_0x5470d9,_0xe7ec84);break;case'script':script[_0xfc6e('0x5b')](_0x5470d9,_0xe7ec84);break;}}}}}}};Trigger[_0xfc6e('0x39')][_0xfc6e('0x47')]=function(_0x1a77f1,_0x217764,_0x5a683e){var _0x8e8e8b=url['parse'](Mustache[_0xfc6e('0x44')](_0x1a77f1,_0x217764),!![]);if(_0x5a683e){_[_0xfc6e('0x3c')](_0x8e8e8b['query'],_0x217764);}delete _0x8e8e8b[_0xfc6e('0x60')];var _0x69801f=url[_0xfc6e('0x54')](_0x8e8e8b);_0x69801f=_0x69801f[_0xfc6e('0x61')](/\/\?/g,'?');return _0x69801f;};Trigger[_0xfc6e('0x39')][_0xfc6e('0x3b')]=function(_0xcea79,_0x3f7a14){var _0x445352=!![];var _0x50da67=!![];var _0x1e52ab=![];if(_0xcea79[_0xfc6e('0x62')]===_0x3f7a14[_0xfc6e('0x34')]){_0x1e52ab=!![];}if(_0xcea79['AllConditions']['length']){_0x445352=_[_0xfc6e('0x63')](_0xcea79[_0xfc6e('0x64')],this[_0xfc6e('0x65')](_0x3f7a14,_0xcea79['channel']));}if(_0xcea79[_0xfc6e('0x66')][_0xfc6e('0x3d')]){_0x50da67=_['some'](_0xcea79[_0xfc6e('0x66')],this[_0xfc6e('0x65')](_0x3f7a14,_0xcea79['channel']));}return _0x1e52ab&&_0x445352&&_0x50da67;};Trigger['prototype'][_0xfc6e('0x65')]=function(_0x3f8442,_0xcf2e85){return function(_0x29abbb){switch(_0x29abbb[_0xfc6e('0x67')]){case _0xfc6e('0x68'):if(_0x3f8442[_0xfc6e('0x62')]===_0xcf2e85){if(_0xcf2e85===_0xfc6e('0x69')){return _0x3f8442[_0xfc6e('0x6a')]?operators[_0x29abbb[_0xfc6e('0x6b')]](Number(_0x29abbb[_0xfc6e('0x6c')]),_0x3f8442[_0xfc6e('0x6a')]):![];}else{return _0x3f8442[_[_0xfc6e('0x6d')](_0xcf2e85)+'AccountId']?operators[_0x29abbb['operator']](Number(_0x29abbb['value']),_0x3f8442[_[_0xfc6e('0x6d')](_0xcf2e85)+_0xfc6e('0x6e')]):![];}}break;case _0xfc6e('0x6f'):case _0xfc6e('0x70'):if(_0x3f8442[_0xfc6e('0x62')]===_0xcf2e85){return _0x3f8442[_0xfc6e('0x71')]?operators[_0x29abbb[_0xfc6e('0x6b')]](_0x29abbb[_0xfc6e('0x6c')],_0x3f8442[_0xfc6e('0x71')]):![];}break;case'queue':return _0x3f8442[_0xfc6e('0x5d')]?operators[_0x29abbb['operator']](_0x29abbb['value'],_0x3f8442[_0xfc6e('0x5d')]):![];case _0xfc6e('0x72'):return _0x3f8442[_0xfc6e('0x73')]?operators[_0x29abbb[_0xfc6e('0x6b')]](_0x29abbb[_0xfc6e('0x6c')],_0x3f8442[_0xfc6e('0x73')]):![];case _0xfc6e('0x74'):return _0x3f8442['lastevent']?operators[_0x29abbb[_0xfc6e('0x6b')]](_0x29abbb[_0xfc6e('0x6c')],_0x3f8442[_0xfc6e('0x74')]):![];case'routeId':return _0x3f8442[_0xfc6e('0x5e')]?operators[_0x29abbb[_0xfc6e('0x6b')]](_0x29abbb[_0xfc6e('0x6c')],_0x3f8442[_0xfc6e('0x5e')]):![];case _0xfc6e('0x75'):return _0x3f8442[_0xfc6e('0x76')]?operators[_0x29abbb[_0xfc6e('0x6b')]](_0x29abbb['value'],_0x3f8442['substatus']):![];}return![];};};module[_0xfc6e('0x77')]=Trigger;
\ No newline at end of file
index f406429..f474a8c 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(_0x5b3602,_0x3291d8){var _0x28eb7f=function(_0x5f3e60){while(--_0x5f3e60){_0x5b3602['push'](_0x5b3602['shift']());}};_0x28eb7f(++_0x3291d8);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 _0x3e74=['customField','content','idField','custom_fields','variable','variableName','name','Variable','toLowerCase','priority','Creating\x20new\x20ticket...','getString','phone','new','xCALLY','Motion','CTI','concat','Descriptions','/api/v2/users/%d','user','Fields','%s/customers/%d/cases','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','catch','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','The\x20Enduser\x20ID\x20is:','trigger:desk:display','trigger:browser:url','%s/agent/tickets/%s','stringify','unmanaged','monitor_format','lastevent','toUpperCase','calleridnum','lodash','md5','util','ioredis','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Getting\x20agent\x20with\x20email','%s/users','then','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','format','debug','[HTTP]','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','total_entries','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','length','forEach','includes','string','picklist','type','nameField'];(function(_0x43dc21,_0x55a307){var _0x53a89e=function(_0x313c7b){while(--_0x313c7b){_0x43dc21['push'](_0x43dc21['shift']());}};_0x53a89e(++_0x55a307);}(_0x3e74,0x175));var _0x43e7=function(_0x4c60d9,_0x2d9176){_0x4c60d9=_0x4c60d9-0x0;var _0x4cc95e=_0x3e74[_0x4c60d9];return _0x4cc95e;};'use strict';var _=require(_0x43e7('0x0'));var rp=require('request-promise');var md5=require(_0x43e7('0x1'));var util=require(_0x43e7('0x2'));var Redis=require(_0x43e7('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x43e7('0x4'))('desk');config[_0x43e7('0x5')]=_[_0x43e7('0x6')](config[_0x43e7('0x5')],{'host':_0x43e7('0x7'),'port':0x18eb});var io=require(_0x43e7('0x8'))(new Redis(config['redis']));function emit(_0x45a0d1,_0x3491d6,_0x2ede2d){io['to'](_0x45a0d1)[_0x43e7('0x9')](_0x3491d6,_0x2ede2d);}var headers={'Content-Type':_0x43e7('0xa'),'Accept':'application/json'};function getUser(_0x212c6c,_0x554d44){if(intUtil['validateEmail'](_0x554d44)===!![]){logger[_0x43e7('0xb')](_0x43e7('0xc'),_0x554d44);return request({'uri':util['format'](_0x43e7('0xd'),_0x212c6c['remoteUri'])})[_0x43e7('0xe')](function(_0x37302c){if(_0x37302c['total_entries']){return _[_0x43e7('0xf')](_0x37302c[_0x43e7('0x10')][_0x43e7('0x11')],{'email':_0x554d44});}})[_0x43e7('0xe')](function(_0x4e008c){if(_0x4e008c){logger['info'](_0x43e7('0x12'));return _0x4e008c;}else{logger[_0x43e7('0xb')](_0x43e7('0x13'));return request({'uri':util['format']('%s/users/me',_0x212c6c[_0x43e7('0x14')])});}});}else{logger[_0x43e7('0xb')](_0x43e7('0x15'));return request({'uri':util[_0x43e7('0x16')]('%s/users/me',_0x212c6c['remoteUri'])});}}function request(_0xdf16c){logger[_0x43e7('0x17')](_0x43e7('0x18'),JSON['stringify'](_0xdf16c));return rp(_['defaults'](_0xdf16c,{'method':_0x43e7('0x19'),'headers':headers,'json':!![]}));}function getAuth(_0x1ca758){var _0x9037d3;if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1b')){_0x9037d3=util[_0x43e7('0x16')](_0x43e7('0x1c'),_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1e')]);}else if(_0x1ca758[_0x43e7('0x1a')]===_0x43e7('0x1f')){_0x9037d3=util[_0x43e7('0x16')]('%s/token:%s',_0x1ca758[_0x43e7('0x1d')],_0x1ca758[_0x43e7('0x1f')]);}return util['format'](_0x43e7('0x20'),new Buffer(_0x9037d3)[_0x43e7('0x21')](_0x43e7('0x22')));}function getEndUser(_0x28aacc,_0x4077fb,_0x2f4cb4){logger['info'](_0x43e7('0x23'),_0x2f4cb4);return request({'uri':util['format']('%s/customers/search',_0x28aacc[_0x43e7('0x14')]),'qs':{'phone':_0x2f4cb4}})[_0x43e7('0xe')](function(_0x4b2b9f){if(_0x4b2b9f[_0x43e7('0x24')]){logger['info'](_0x43e7('0x25'));return _0x4b2b9f['_embedded'][_0x43e7('0x11')][0x0];}else{logger[_0x43e7('0xb')](_0x43e7('0x26'));return request({'uri':util[_0x43e7('0x16')]('%s/customers',_0x28aacc['remoteUri']),'method':_0x43e7('0x27'),'body':{'first_name':_0x4077fb,'title':_0x4077fb,'phone_numbers':[{'type':'work','value':_0x2f4cb4}]}});}});}function getTags(_0x2dd5f,_0x40dc8f){var _0x3565cf=[];if(_0x2dd5f&&_0x2dd5f[_0x43e7('0x28')]>0x0){_0x3565cf=_['map'](_0x2dd5f,_0x40dc8f);}return _0x3565cf;}function getCustomFields(_0x33a1a5,_0x4690a6){var _0x45b675=[];var _0x50f9f5={'custom_fields':{}};if(_0x33a1a5[_0x43e7('0x28')]>0x0){_[_0x43e7('0x29')](_0x33a1a5,function(_0x2b85a5){if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5[_0x43e7('0x2d')])&&_0x2b85a5[_0x43e7('0x2e')]&&!_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x2b85a5[_0x43e7('0x2e')]['toLowerCase']()]=_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x21')]();}else if(_[_0x43e7('0x2a')]([_0x43e7('0x2b'),_0x43e7('0x2c')],_0x2b85a5['type'])&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x2b85a5['content']['toString']();}else if(_0x2b85a5['type']===_0x43e7('0x33')&&_0x2b85a5[_0x43e7('0x34')]&&_0x2b85a5[_0x43e7('0x31')]&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x34')]]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5['idField']]=_0x4690a6[_0x2b85a5['variableName']]['toString']());}else if(_0x2b85a5['type']==='customVariable'&&_0x2b85a5['Variable']&&_0x2b85a5['Variable'][_0x43e7('0x35')]&&_0x2b85a5['idField']&&_0x2b85a5[_0x43e7('0x2f')]){_0x4690a6[_0x2b85a5[_0x43e7('0x36')][_0x43e7('0x35')][_0x43e7('0x37')]()]&&(_0x50f9f5[_0x43e7('0x32')][_0x2b85a5[_0x43e7('0x31')]]=_0x4690a6[_0x2b85a5[_0x43e7('0x36')]['name']['toLowerCase']()]['toString']());}});}if(_0x50f9f5[_0x43e7('0x38')]){_0x50f9f5[_0x43e7('0x38')]=Number(_0x50f9f5[_0x43e7('0x38')]);}return _0x50f9f5;}function getTicket(_0x16cdba,_0x1b1440,_0x1ed538,_0x1d4589,_0x2ffd43){logger['info'](_0x43e7('0x39'));var _0x2b0ffe=_['merge']({'subject':intUtil[_0x43e7('0x3a')](_0x1d4589['Subjects'],_0x2ffd43,'\x20'),'type':_0x43e7('0x3b'),'status':_0x43e7('0x3c'),'labels':[_0x43e7('0x3d'),_0x43e7('0x3e'),_0x43e7('0x3f')][_0x43e7('0x40')](getTags(_0x1d4589['Tags'],'name')),'description':intUtil[_0x43e7('0x3a')](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a'),'_links':{'assigned_user':{'href':util[_0x43e7('0x16')](_0x43e7('0x42'),_0x1b1440['id']),'class':_0x43e7('0x43')}},'message':{'direction':'in','body':intUtil['getString'](_0x1d4589[_0x43e7('0x41')],_0x2ffd43,'\x0a')}},getCustomFields(_0x1d4589[_0x43e7('0x44')],_0x2ffd43));return request({'uri':util['format'](_0x43e7('0x45'),_0x16cdba['remoteUri'],_0x1ed538['id']),'method':_0x43e7('0x27'),'body':_0x2b0ffe});}exports['queue']=function(_0x3d81ae,_0x3b4235,_0x3a5807,_0x1c2c6b,_0x49b866,_0x47d6a1){var _0x103393,_0x40c509;_0x47d6a1[_0x43e7('0x14')]=intUtil[_0x43e7('0x46')](_0x47d6a1['remoteUri']);_0x47d6a1['serverUrl']=intUtil['stripTrailingSlash'](_0x47d6a1[_0x43e7('0x47')]);if(_0x49b866&&_0x49b866['monitor_format']){logger[_0x43e7('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x3b4235[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x47d6a1[_0x43e7('0x47')],_0x3b4235[_0x43e7('0x4a')],md5(_0x3b4235[_0x43e7('0x4a')]));}else{_0x3b4235['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x47d6a1);return getUser(_0x47d6a1,_0x1c2c6b[_0x43e7('0x4c')])[_0x43e7('0xe')](function(_0x1fd277){_0x103393=_0x1fd277;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x103393['id']);return getEndUser(_0x47d6a1,_0x3b4235['calleridname'],_0x3b4235['calleridnum']);})[_0x43e7('0xe')](function(_0x36a09e){_0x40c509=_0x36a09e;logger[_0x43e7('0xb')]('The\x20Enduser\x20ID\x20is:',_0x40c509['id']);return getTicket(_0x47d6a1,_0x103393,_0x40c509,_0x3a5807,_0x3b4235);})['then'](function(_0x56489b){if(_0x56489b){logger[_0x43e7('0xb')](_0x43e7('0x4e'));logger['info'](_0x43e7('0x4f'),_0x56489b['id']);switch(_0x47d6a1[_0x43e7('0x2d')]){case _0x43e7('0x50'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x43e7('0x51'),_0x1c2c6b[_0x43e7('0x35')]),'trigger:desk:display',{'recordId':_0x56489b['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')](_0x43e7('0x53'),_0x43e7('0x54'));emit(util['format'](_0x43e7('0x51'),_0x1c2c6b['name']),'trigger:browser:url',{'uri':util[_0x43e7('0x16')](_0x43e7('0x55'),_0x56489b['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x53'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x1cd87c){console[_0x43e7('0x56')](_0x1cd87c);logger[_0x43e7('0x56')](_0x43e7('0x53'),JSON['stringify'](_0x1cd87c));});};exports[_0x43e7('0x59')]=function(_0x46c910,_0x499c03,_0x39e3ca,_0x4e6f6d,_0x35b799,_0x520857,_0x34e2ec){var _0x1f561f,_0xfe13fa;_0x520857['remoteUri']=intUtil['stripTrailingSlash'](_0x520857[_0x43e7('0x14')]);_0x520857[_0x43e7('0x47')]=intUtil[_0x43e7('0x46')](_0x520857[_0x43e7('0x47')]);if(_0x34e2ec&&_0x34e2ec[_0x43e7('0x5a')]&&_0x34e2ec[_0x43e7('0x5a')]!==_0x43e7('0x5b')){logger[_0x43e7('0xb')](_0x43e7('0x5c'),_0x43e7('0x5d'));_0x499c03[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x520857[_0x43e7('0x47')],_0x499c03['uniqueid'],md5(_0x499c03[_0x43e7('0x4a')]));}headers[_0x43e7('0x4b')]=getAuth(_0x520857);return getUser(_0x520857,_0x4e6f6d[_0x43e7('0x4c')])['then'](function(_0x5d63c6){_0x1f561f=_0x5d63c6;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0x1f561f['id']);return getEndUser(_0x520857,_0x499c03['destcalleridname'],_0x499c03[_0x43e7('0x5e')]);})['then'](function(_0x49a6ce){_0xfe13fa=_0x49a6ce;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xfe13fa['id']);return getTicket(_0x520857,_0x1f561f,_0xfe13fa,_0x39e3ca,_0x499c03);})[_0x43e7('0xe')](function(_0x40155c){if(_0x40155c){logger[_0x43e7('0xb')]('Ticket\x20created!');logger[_0x43e7('0xb')](_0x43e7('0x4f'),_0x40155c['id']);switch(_0x520857['type']){case _0x43e7('0x50'):logger[_0x43e7('0xb')](_0x43e7('0x53'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format']('user:%s',_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x60'),{'recordId':_0x40155c['id']});break;case _0x43e7('0x52'):logger[_0x43e7('0xb')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x43e7('0x16')](_0x43e7('0x51'),_0x4e6f6d[_0x43e7('0x35')]),_0x43e7('0x61'),{'uri':util['format'](_0x43e7('0x62'),_0x520857[_0x43e7('0x14')],_0x40155c['id'])});break;default:logger[_0x43e7('0x56')](_0x43e7('0x5c'),_0x43e7('0x57'));}}})[_0x43e7('0x58')](function(_0x4665db){logger[_0x43e7('0x56')](_0x43e7('0x5c'),JSON[_0x43e7('0x63')](_0x4665db));});};exports[_0x43e7('0x64')]=function(_0x57fdfe,_0x5f3824,_0x2b0711,_0x58a3a8,_0x501616,_0x50edb2){var _0xb3e981,_0xe666b0;_0x50edb2['remoteUri']=intUtil[_0x43e7('0x46')](_0x50edb2[_0x43e7('0x14')]);_0x50edb2[_0x43e7('0x47')]=intUtil['stripTrailingSlash'](_0x50edb2[_0x43e7('0x47')]);if(_0x501616&&_0x501616[_0x43e7('0x65')]){logger[_0x43e7('0xb')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',_0x43e7('0x5d'));_0x5f3824[_0x43e7('0x48')]=util['format'](_0x43e7('0x49'),_0x50edb2[_0x43e7('0x47')],_0x5f3824[_0x43e7('0x4a')],md5(_0x5f3824['uniqueid']));}else{_0x5f3824['recordingURL']='';}headers[_0x43e7('0x4b')]=getAuth(_0x50edb2);return getUser(_0x50edb2)['then'](function(_0x5cb26e){_0xb3e981=_0x5cb26e;logger[_0x43e7('0xb')](_0x43e7('0x4d'),_0xb3e981['id']);return getEndUser(_0x50edb2,_0x5f3824['calleridname'],_0x5f3824[_0x43e7('0x68')]);})[_0x43e7('0xe')](function(_0x1e2fed){_0xe666b0=_0x1e2fed;logger[_0x43e7('0xb')](_0x43e7('0x5f'),_0xe666b0['id']);return getTicket(_0x50edb2,_0xb3e981,_0xe666b0,_0x2b0711,_0x5f3824);})[_0x43e7('0xe')](function(_0x398a78){if(_0x398a78){logger['info'](_0x43e7('0x4e'));logger[_0x43e7('0xb')]('The\x20Ticket\x20ID\x20is:',_0x398a78['id']);}})[_0x43e7('0x58')](function(_0x5c2c5f){logger[_0x43e7('0x56')]('['+_0x5f3824[_0x43e7('0x66')][_0x43e7('0x67')]()+']',JSON[_0x43e7('0x63')](_0x5c2c5f));});};
\ No newline at end of file
index 6cfbdb4..95c426f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa624=['destcalleridnum','calleridnum','contacts','/systemusers(','4.0','headers','odata-entityid','lastIndexOf','enduserId','outbound','GET','replace','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','picklist','type','customField','idField','substring','indexOf','ticketType','incident','incidents','getString','Descriptions','/contacts(','Fields','phonecalls','assign','callDirection','queue','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','name','request-promise','util','./util','md5','ioredis','../../../../config/logger','redis','localhost','socket.io-emitter','POST','password','clientSecret','then','access_token','catch','error',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','validateEmail','email','userEmail','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId','toUpperCase','username','length'];(function(_0x49bd20,_0x141ebb){var _0x318f58=function(_0x4b8068){while(--_0x4b8068){_0x49bd20['push'](_0x49bd20['shift']());}};_0x318f58(++_0x141ebb);}(_0xa624,0x9b));var _0x4a62=function(_0xa4c85,_0x2b52a7){_0xa4c85=_0xa4c85-0x0;var _0x172c1f=_0xa624[_0xa4c85];return _0x172c1f;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var rp=require(_0x4a62('0x0'));var util=require(_0x4a62('0x1'));var intUtil=require(_0x4a62('0x2'));var md5=require(_0x4a62('0x3'));var Redis=require(_0x4a62('0x4'));var logger=require(_0x4a62('0x5'))('dynamics365');var config=require('../../../../config/environment');config['redis']=_['defaults'](config[_0x4a62('0x6')],{'host':_0x4a62('0x7'),'port':0x18eb});var io=require(_0x4a62('0x8'))(new Redis(config[_0x4a62('0x6')]));function getAuthToken(_0x408be4,_0x10ccfa,_0x1d06f7){var _0x168fa3={'method':_0x4a62('0x9'),'uri':_0x10ccfa,'form':{'client_id':_0x408be4['clientId'],'resource':_0x408be4['remoteUri'],'username':_0x408be4['username'],'password':_0x408be4[_0x4a62('0xa')],'grant_type':'password','client_secret':_0x408be4[_0x4a62('0xb')]},'json':!![]};return rp(_0x168fa3)[_0x4a62('0xc')](function(_0x50f7db){return _0x50f7db[_0x4a62('0xd')];})[_0x4a62('0xe')](function(_0xd61738){logger[_0x4a62('0xf')]('['+[_0x1d06f7['toUpperCase']()]+_0x4a62('0x10'));return _0xd61738[_0x4a62('0x11')];});}function getUser(_0x4ee049,_0xf2ddf3,_0x3e676b,_0x40fc4b,_0x24bbac,_0x47766c){return new BPromise(function(_0x86872,_0x33471f){return getAuthToken(_0xf2ddf3,_0x40fc4b,_0x47766c)['then'](function(_0x4ca5b3){var _0x6d53f3={'method':'GET','uri':_0x24bbac+_0x4a62('0x12'),'headers':{'Authorization':_0x4a62('0x13')+_0x4ca5b3,'OData-Version':'4.0'},'json':!![]};return rp(_0x6d53f3);})['then'](function(_0x479005){var _0x252c15=_0x479005[_0x4a62('0x14')];var _0x24ce22=![];var _0x20ed76=null;if(!_['isNil'](_0x3e676b)){if(intUtil[_0x4a62('0x15')](_0x3e676b[_0x4a62('0x16')])){_0x4ee049[_0x4a62('0x17')]=_0x3e676b['email'];for(_0x20ed76=0x0;_0x20ed76<_0x252c15['length'];_0x20ed76++){if(_0x252c15[_0x20ed76][_0x4a62('0x18')]===_0x3e676b[_0x4a62('0x16')]&&!_0x252c15[_0x20ed76][_0x4a62('0x19')]){_0x24ce22=!![];logger[_0x4a62('0x1a')]('['+[_0x47766c['toUpperCase']()]+_0x4a62('0x1b')+_0x252c15[_0x20ed76][_0x4a62('0x1c')]+'!');_0x4ee049[_0x4a62('0x1d')]=_0x252c15[_0x20ed76][_0x4a62('0x1c')];}}}}if(!_0x24ce22){logger[_0x4a62('0x1a')]('['+[_0x47766c[_0x4a62('0x1e')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0x4ee049[_0x4a62('0x17')]=_0xf2ddf3[_0x4a62('0x1f')];for(_0x20ed76=0x0;_0x20ed76<_0x252c15[_0x4a62('0x20')];_0x20ed76++){if(_0x252c15[_0x20ed76][_0x4a62('0x18')]===_0xf2ddf3['username']){_0x4ee049[_0x4a62('0x1d')]=_0x252c15[_0x20ed76][_0x4a62('0x1c')];}}}_0x86872(_0x4ee049);})[_0x4a62('0xe')](function(_0x4fa851){_0x33471f(_0x4fa851[_0x4a62('0x11')]);});});}function createEndUser(_0x3f1669,_0x4f5fe6,_0x3e7941,_0x2a1b2b,_0x2cb162,_0x37f328){return new BPromise(function(_0x385c59,_0x5984c2){return getAuthToken(_0x4f5fe6,_0x3e7941,_0x37f328)[_0x4a62('0xc')](function(_0x37840d){var _0x586e04=_0x37f328['toLowerCase']()==='outbound'?_0x2cb162[_0x4a62('0x21')]:_0x2cb162[_0x4a62('0x22')];var _0x551789={'method':'POST','uri':_0x2a1b2b+_0x4a62('0x23'),'body':{'telephone1':_0x586e04,'fullname':_0x586e04,'firstname':_0x586e04,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x4a62('0x24')+_0x3f1669[_0x4a62('0x1d')]+')'},'headers':{'Authorization':_0x4a62('0x13')+_0x37840d,'OData-Version':_0x4a62('0x25')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x551789);})[_0x4a62('0xc')](function(_0x499ff0){var _0xb0d63f=_0x499ff0[_0x4a62('0x26')][_0x4a62('0x27')];var _0x912c3d=_0xb0d63f['substring'](_0xb0d63f[_0x4a62('0x28')]('(')+0x1,_0xb0d63f[_0x4a62('0x28')](')'));_0x3f1669[_0x4a62('0x29')]=_0x912c3d;_0x385c59(_0x3f1669);})[_0x4a62('0xe')](function(_0x1490b9){_0x5984c2(_0x1490b9[_0x4a62('0x11')]);});});}function getEndUser(_0x2b7a39,_0x2cd968,_0x620356,_0x5da66b,_0x17facd,_0x25dec0){return new BPromise(function(_0x2ca83a,_0x2d1cd5){var _0x468756=_0x25dec0['toLowerCase']()===_0x4a62('0x2a')?_0x17facd['destcalleridnum']:_0x17facd[_0x4a62('0x22')];return getAuthToken(_0x2cd968,_0x620356,_0x25dec0)['then'](function(_0x18d926){var _0x4a33ce={'method':_0x4a62('0x2b'),'uri':_0x5da66b+'contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27'+_0x468756[_0x4a62('0x2c')]('+','%2b')+'\x27','headers':{'Authorization':'Bearer\x20'+_0x18d926,'If-None-Match':null,'OData-Version':_0x4a62('0x25')},'json':!![]};return rp(_0x4a33ce);})[_0x4a62('0xc')](function(_0x2987da){var _0x2cca94=null;if(_0x2987da){var _0x4451a1=_0x2987da[_0x4a62('0x14')];var _0x383699=![];for(_0x2cca94=0x0;_0x2cca94<_0x4451a1['length'];_0x2cca94++){if(_0x4451a1[_0x2cca94][_0x4a62('0x2d')]===_0x468756){_0x383699=!![];_0x2b7a39[_0x4a62('0x29')]=_0x4451a1[_0x2cca94][_0x4a62('0x2e')];}}if(_0x383699){_0x2ca83a(_0x2b7a39);}else{return createEndUser(_0x2b7a39,_0x2cd968,_0x620356,_0x5da66b,_0x17facd,_0x25dec0)[_0x4a62('0xc')](function(_0x1404a3){logger[_0x4a62('0x1a')]('['+[_0x25dec0['toUpperCase']()]+_0x4a62('0x2f'),_0x1404a3[_0x4a62('0x29')]);_0x2ca83a(_0x1404a3);});}}else{return createEndUser(_0x2b7a39,_0x2cd968,_0x620356,_0x5da66b,_0x17facd,_0x25dec0)[_0x4a62('0xc')](function(_0xe84bfd){logger['info']('['+[_0x25dec0['toUpperCase']()]+_0x4a62('0x30'),_0xe84bfd[_0x4a62('0x29')]);_0x2ca83a(_0xe84bfd);});}});});}function getCustomFields(_0x334ddc,_0x24f894,_0x292942){var _0x43c3b6={};if(_0x334ddc['length']>0x0){_[_0x4a62('0x31')](_0x334ddc,function(_0x14e307){if(_[_0x4a62('0x32')]([_0x4a62('0x33'),_0x4a62('0x34')],_0x14e307[_0x4a62('0x35')])&&_0x14e307['nameField']&&!_0x14e307[_0x4a62('0x36')]){var _0x31d732=_0x14e307[_0x4a62('0x37')]['toLowerCase']();var _0x2e21e0=_0x31d732[_0x4a62('0x38')](0x0,_0x31d732[_0x4a62('0x39')]('_'));var _0x171f2c=_0x31d732[_0x4a62('0x38')](_0x31d732['indexOf']('_')+0x1);if(_0x2e21e0===_0x292942){_0x43c3b6[_0x171f2c]=_0x14e307['content'];}}});}return _0x43c3b6;}function getTicket(_0x41cb73,_0x15202f,_0x313a8d,_0x4f52a7,_0x3708bc,_0x289a9e,_0x4d9c3e){return new BPromise(function(_0x47422a,_0x416f97){var _0x3cc5a8;return getAuthToken(_0x15202f,_0x313a8d,_0x4d9c3e)['then'](function(_0x11f0f1){if(_0x289a9e[_0x4a62('0x3a')]===_0x4a62('0x3b')){_0x3cc5a8={'method':'POST','uri':_0x4f52a7+_0x4a62('0x3c'),'body':Object['assign']({},{'title':intUtil[_0x4a62('0x3d')](_0x289a9e['Subjects'],_0x3708bc,'\x20'),'description':intUtil[_0x4a62('0x3d')](_0x289a9e[_0x4a62('0x3e')],_0x3708bc,'\x0a'),'customerid_contact@odata.bind':_0x4a62('0x3f')+_0x41cb73[_0x4a62('0x29')]+')','ownerid@odata.bind':_0x4a62('0x24')+_0x41cb73['userId']+')','caseorigincode':'1'},getCustomFields(_0x289a9e[_0x4a62('0x40')],_0x3708bc,_0x289a9e[_0x4a62('0x3a')])),'headers':{'Authorization':_0x4a62('0x13')+_0x11f0f1,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x289a9e[_0x4a62('0x3a')]==='phonecall'){_0x3cc5a8={'method':_0x4a62('0x9'),'uri':_0x4f52a7+_0x4a62('0x41'),'body':Object[_0x4a62('0x42')]({},{'subject':intUtil[_0x4a62('0x3d')](_0x289a9e['Subjects'],_0x3708bc,'\x20'),'phonenumber':String(_0x3708bc[_0x4a62('0x22')]),'description':intUtil['getString'](_0x289a9e[_0x4a62('0x3e')],_0x3708bc,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4a62('0x3f')+_0x41cb73[_0x4a62('0x29')]+')','ownerid@odata.bind':'/systemusers('+_0x41cb73[_0x4a62('0x1d')]+')','directioncode':_0x41cb73[_0x4a62('0x43')]===_0x4a62('0x44')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x4a62('0x24')+_0x41cb73['userId']+')','participationtypemask':_0x41cb73[_0x4a62('0x43')]===_0x4a62('0x44')?0x2:0x1},{'partyid_contact@odata.bind':_0x4a62('0x3f')+_0x41cb73['enduserId']+')','participationtypemask':_0x41cb73['callDirection']===_0x4a62('0x44')?0x1:0x2}]},getCustomFields(_0x289a9e['Fields'],_0x3708bc,_0x289a9e[_0x4a62('0x3a')])),'headers':{'Authorization':_0x4a62('0x13')+_0x11f0f1,'OData-Version':_0x4a62('0x25')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3cc5a8);})[_0x4a62('0xc')](function(_0x55c59d){var _0x103711=_0x55c59d[_0x4a62('0x26')][_0x4a62('0x27')];var _0x2c3f79=_0x103711[_0x4a62('0x38')](_0x103711[_0x4a62('0x28')]('(')+0x1,_0x103711[_0x4a62('0x28')](')'));_0x41cb73['ticketId']=_0x2c3f79;_0x47422a(_0x41cb73);})['catch'](function(_0x53d9c9){_0x416f97(_0x53d9c9[_0x4a62('0x11')]);});});}function emit(_0x1d77bf,_0x2099f4,_0x2cfe9f,_0x4e65a0){var _0x588fd6={'uri':util[_0x4a62('0x45')](_0x4a62('0x46'),_0x1d77bf,_0x2cfe9f,_0x4e65a0)};io['to'](util[_0x4a62('0x45')](_0x4a62('0x47'),_0x2099f4))[_0x4a62('0x48')](_0x4a62('0x49'),_0x588fd6);}exports['cs']=function(_0x10adb8,_0x4c4c30,_0x392433,_0xd5c903,_0xd495d6,_0x189e5a,_0x388a06,_0x12fe2e){var _0x37f98d={};_0x189e5a[_0x4a62('0x4a')]=intUtil[_0x4a62('0x4b')](_0x189e5a[_0x4a62('0x4a')]);_0x189e5a[_0x4a62('0x4c')]=intUtil[_0x4a62('0x4b')](_0x189e5a['serverUrl']);_0x37f98d[_0x4a62('0x43')]=_0x12fe2e===_0x4a62('0x44')||_0x12fe2e===_0x4a62('0x4d')?_0x4a62('0x44'):_0x4a62('0x2a');var _0x94f26=util[_0x4a62('0x45')](_0x4a62('0x4e'),_0x189e5a['remoteUri']);var _0x2167b7=util[_0x4a62('0x45')]('https://login.microsoftonline.com/%s/oauth2/token',_0x189e5a[_0x4a62('0x4f')]);var _0xa5edfb=util['format'](_0x4a62('0x50'),_0x189e5a[_0x4a62('0x4c')],_0x4c4c30[_0x4a62('0x51')],md5(_0x4c4c30[_0x4a62('0x51')]));if(_0xd495d6&&_0xd495d6[_0x4a62('0x52')]){logger[_0x4a62('0x1a')](_0x4a62('0x53'),_0x4a62('0x54'));_0x4c4c30['recordingURL']=_0xa5edfb;}else if(_0x388a06&&_0x388a06[_0x4a62('0x55')]&&_0x388a06[_0x4a62('0x55')]!==_0x4a62('0x56')){logger[_0x4a62('0x1a')]('[OUTBOUND]',_0x4a62('0x54'));_0x4c4c30['recordingURL']=_0xa5edfb;}else{_0x4c4c30[_0x4a62('0x57')]='';}return getUser(_0x37f98d,_0x189e5a,_0xd5c903,_0x2167b7,_0x94f26,_0x12fe2e)[_0x4a62('0xc')](function(_0x37d6b7){logger['info']('['+_0x12fe2e['toUpperCase']()+_0x4a62('0x58'),_0x37d6b7[_0x4a62('0x1d')]);logger[_0x4a62('0x1a')]('['+_0x12fe2e[_0x4a62('0x1e')]()+']\x20The\x20User\x20email\x20is:',_0x37d6b7[_0x4a62('0x17')]);return getEndUser(_0x37d6b7,_0x189e5a,_0x2167b7,_0x94f26,_0x4c4c30,_0x12fe2e);})[_0x4a62('0xc')](function(_0x25a185){logger[_0x4a62('0x1a')]('['+_0x12fe2e[_0x4a62('0x1e')]()+_0x4a62('0x59'),_0x25a185[_0x4a62('0x29')]);logger[_0x4a62('0x1a')]('['+_0x12fe2e['toUpperCase']()+_0x4a62('0x5a'),_0x4c4c30[_0x4a62('0x22')]);return getTicket(_0x25a185,_0x189e5a,_0x2167b7,_0x94f26,_0x4c4c30,_0x392433,_0x12fe2e);})['then'](function(_0x5a8705){logger['info'](util[_0x4a62('0x45')]('['+_0x12fe2e[_0x4a62('0x1e')]()+_0x4a62('0x5b'),_0x392433[_0x4a62('0x3a')],_0x5a8705['ticketId']));logger[_0x4a62('0x1a')](util[_0x4a62('0x45')]('['+_0x12fe2e[_0x4a62('0x1e')]()+_0x4a62('0x5c'),_0x12fe2e));if(_0x12fe2e!==_0x4a62('0x4d')){logger[_0x4a62('0x1a')]('['+_0x12fe2e[_0x4a62('0x1e')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x189e5a[_0x4a62('0x4a')],_0xd5c903[_0x4a62('0x5d')],_0x392433[_0x4a62('0x3a')],_0x5a8705['ticketId']);}})[_0x4a62('0xe')](function(_0x1b8a54){logger[_0x4a62('0xf')]('['+_0x12fe2e[_0x4a62('0x1e')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util['inspect'](_0x1b8a54,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x6f11=['toUpperCase','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','message','toLowerCase','outbound','destcalleridnum','calleridnum','/systemusers(','odata-entityid','substring','lastIndexOf','enduserId','GET','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','includes','string','picklist','type','nameField','idField','indexOf','content','ticketType','incident','POST','assign','getString','Descriptions','/contacts(','Fields','phonecall','phonecalls','Subjects','callDirection','headers','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','queue','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','uniqueid','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','bluebird','util','./util','md5','ioredis','../../../../config/logger','../../../../config/environment','redis','defaults','clientId','remoteUri','username','password','clientSecret','then','catch','error',']\x20Wrong\x20credentials!','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','validateEmail','email','userEmail','length','internalemailaddress','info'];(function(_0x48b8b3,_0x14c694){var _0x3fb319=function(_0x9d13e9){while(--_0x9d13e9){_0x48b8b3['push'](_0x48b8b3['shift']());}};_0x3fb319(++_0x14c694);}(_0x6f11,0x1d2));var _0x16f1=function(_0x1d7608,_0x3cff59){_0x1d7608=_0x1d7608-0x0;var _0x3212bc=_0x6f11[_0x1d7608];return _0x3212bc;};'use strict';var _=require(_0x16f1('0x0'));var BPromise=require(_0x16f1('0x1'));var rp=require('request-promise');var util=require(_0x16f1('0x2'));var intUtil=require(_0x16f1('0x3'));var md5=require(_0x16f1('0x4'));var Redis=require(_0x16f1('0x5'));var logger=require(_0x16f1('0x6'))('dynamics365');var config=require(_0x16f1('0x7'));config[_0x16f1('0x8')]=_[_0x16f1('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x16f1('0x8')]));function getAuthToken(_0x32663f,_0x333051,_0x2b9652){var _0x4588af={'method':'POST','uri':_0x333051,'form':{'client_id':_0x32663f[_0x16f1('0xa')],'resource':_0x32663f[_0x16f1('0xb')],'username':_0x32663f[_0x16f1('0xc')],'password':_0x32663f[_0x16f1('0xd')],'grant_type':_0x16f1('0xd'),'client_secret':_0x32663f[_0x16f1('0xe')]},'json':!![]};return rp(_0x4588af)[_0x16f1('0xf')](function(_0x50ea9a){return _0x50ea9a['access_token'];})[_0x16f1('0x10')](function(_0x1e1f59){logger[_0x16f1('0x11')]('['+[_0x2b9652['toUpperCase']()]+_0x16f1('0x12'));return _0x1e1f59['message'];});}function getUser(_0x4b5e3d,_0xc463ed,_0x3745ca,_0x5d16fb,_0x1f10e9,_0x4ba3d3){return new BPromise(function(_0x3b7719,_0x188dc1){return getAuthToken(_0xc463ed,_0x5d16fb,_0x4ba3d3)[_0x16f1('0xf')](function(_0xd0f654){var _0x19790c={'method':'GET','uri':_0x1f10e9+_0x16f1('0x13'),'headers':{'Authorization':_0x16f1('0x14')+_0xd0f654,'OData-Version':_0x16f1('0x15')},'json':!![]};return rp(_0x19790c);})[_0x16f1('0xf')](function(_0x4355ec){var _0x17ac30=_0x4355ec[_0x16f1('0x16')];var _0x41e880=![];var _0x16cb42=null;if(!_['isNil'](_0x3745ca)){if(intUtil[_0x16f1('0x17')](_0x3745ca[_0x16f1('0x18')])){_0x4b5e3d[_0x16f1('0x19')]=_0x3745ca[_0x16f1('0x18')];for(_0x16cb42=0x0;_0x16cb42<_0x17ac30[_0x16f1('0x1a')];_0x16cb42++){if(_0x17ac30[_0x16cb42][_0x16f1('0x1b')]===_0x3745ca[_0x16f1('0x18')]&&!_0x17ac30[_0x16cb42]['isdisabled']){_0x41e880=!![];logger[_0x16f1('0x1c')]('['+[_0x4ba3d3[_0x16f1('0x1d')]()]+']\x20Agent\x20found\x20'+_0x17ac30[_0x16cb42][_0x16f1('0x1e')]+'!');_0x4b5e3d[_0x16f1('0x1f')]=_0x17ac30[_0x16cb42]['systemuserid'];}}}}if(!_0x41e880){logger[_0x16f1('0x1c')]('['+[_0x4ba3d3[_0x16f1('0x1d')]()]+_0x16f1('0x20'));_0x4b5e3d['userEmail']=_0xc463ed[_0x16f1('0xc')];for(_0x16cb42=0x0;_0x16cb42<_0x17ac30[_0x16f1('0x1a')];_0x16cb42++){if(_0x17ac30[_0x16cb42][_0x16f1('0x1b')]===_0xc463ed[_0x16f1('0xc')]){_0x4b5e3d['userId']=_0x17ac30[_0x16cb42][_0x16f1('0x1e')];}}}_0x3b7719(_0x4b5e3d);})[_0x16f1('0x10')](function(_0x5d7a60){_0x188dc1(_0x5d7a60[_0x16f1('0x21')]);});});}function createEndUser(_0x1442d8,_0x1c3525,_0x473180,_0x482835,_0x1990ae,_0x5dda3d){return new BPromise(function(_0x5b295d,_0x15fd55){return getAuthToken(_0x1c3525,_0x473180,_0x5dda3d)[_0x16f1('0xf')](function(_0x37d1ba){var _0x1a574a=_0x5dda3d[_0x16f1('0x22')]()===_0x16f1('0x23')?_0x1990ae[_0x16f1('0x24')]:_0x1990ae[_0x16f1('0x25')];var _0x47a49c={'method':'POST','uri':_0x482835+'contacts','body':{'telephone1':_0x1a574a,'fullname':_0x1a574a,'firstname':_0x1a574a,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x16f1('0x26')+_0x1442d8[_0x16f1('0x1f')]+')'},'headers':{'Authorization':_0x16f1('0x14')+_0x37d1ba,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x47a49c);})[_0x16f1('0xf')](function(_0x49c01f){var _0x47dc85=_0x49c01f['headers'][_0x16f1('0x27')];var _0xe97bbe=_0x47dc85[_0x16f1('0x28')](_0x47dc85[_0x16f1('0x29')]('(')+0x1,_0x47dc85['lastIndexOf'](')'));_0x1442d8[_0x16f1('0x2a')]=_0xe97bbe;_0x5b295d(_0x1442d8);})['catch'](function(_0x20675d){_0x15fd55(_0x20675d[_0x16f1('0x21')]);});});}function getEndUser(_0x43b4ba,_0x2ac210,_0x4ae537,_0xa89de,_0x3b7c94,_0x2ae31d){return new BPromise(function(_0x5a0927,_0xf6404b){var _0x519a9b=_0x2ae31d[_0x16f1('0x22')]()==='outbound'?_0x3b7c94[_0x16f1('0x24')]:_0x3b7c94[_0x16f1('0x25')];return getAuthToken(_0x2ac210,_0x4ae537,_0x2ae31d)['then'](function(_0x5e2d3a){var _0xe6910d={'method':_0x16f1('0x2b'),'uri':_0xa89de+_0x16f1('0x2c')+_0x519a9b[_0x16f1('0x2d')]('+',_0x16f1('0x2e'))+'\x27','headers':{'Authorization':_0x16f1('0x14')+_0x5e2d3a,'If-None-Match':null,'OData-Version':_0x16f1('0x15')},'json':!![]};return rp(_0xe6910d);})[_0x16f1('0xf')](function(_0x212d2d){var _0x24a90b=null;if(_0x212d2d){var _0x33391a=_0x212d2d[_0x16f1('0x16')];var _0x2489aa=![];for(_0x24a90b=0x0;_0x24a90b<_0x33391a[_0x16f1('0x1a')];_0x24a90b++){if(_0x33391a[_0x24a90b][_0x16f1('0x2f')]===_0x519a9b){_0x2489aa=!![];_0x43b4ba[_0x16f1('0x2a')]=_0x33391a[_0x24a90b][_0x16f1('0x30')];}}if(_0x2489aa){_0x5a0927(_0x43b4ba);}else{return createEndUser(_0x43b4ba,_0x2ac210,_0x4ae537,_0xa89de,_0x3b7c94,_0x2ae31d)['then'](function(_0x541661){logger[_0x16f1('0x1c')]('['+[_0x2ae31d['toUpperCase']()]+_0x16f1('0x31'),_0x541661[_0x16f1('0x2a')]);_0x5a0927(_0x541661);});}}else{return createEndUser(_0x43b4ba,_0x2ac210,_0x4ae537,_0xa89de,_0x3b7c94,_0x2ae31d)['then'](function(_0x5e14fd){logger[_0x16f1('0x1c')]('['+[_0x2ae31d[_0x16f1('0x1d')]()]+_0x16f1('0x32'),_0x5e14fd[_0x16f1('0x2a')]);_0x5a0927(_0x5e14fd);});}});});}function getCustomFields(_0x7f8e5d,_0x61bdb5,_0x41859a){var _0x30ff48={};if(_0x7f8e5d[_0x16f1('0x1a')]>0x0){_[_0x16f1('0x33')](_0x7f8e5d,function(_0x16ebb4){if(_[_0x16f1('0x34')]([_0x16f1('0x35'),_0x16f1('0x36')],_0x16ebb4[_0x16f1('0x37')])&&_0x16ebb4[_0x16f1('0x38')]&&!_0x16ebb4['customField']){var _0x117504=_0x16ebb4[_0x16f1('0x39')][_0x16f1('0x22')]();var _0x28dfdb=_0x117504[_0x16f1('0x28')](0x0,_0x117504[_0x16f1('0x3a')]('_'));var _0x252df2=_0x117504[_0x16f1('0x28')](_0x117504[_0x16f1('0x3a')]('_')+0x1);if(_0x28dfdb===_0x41859a){_0x30ff48[_0x252df2]=_0x16ebb4[_0x16f1('0x3b')];}}});}return _0x30ff48;}function getTicket(_0x5145a8,_0x4e0746,_0x1d3981,_0x131614,_0x40efcc,_0x26eaa2,_0x2e7b6d){return new BPromise(function(_0x31b077,_0x3b7976){var _0x21c241;return getAuthToken(_0x4e0746,_0x1d3981,_0x2e7b6d)[_0x16f1('0xf')](function(_0x12d18a){if(_0x26eaa2[_0x16f1('0x3c')]===_0x16f1('0x3d')){_0x21c241={'method':_0x16f1('0x3e'),'uri':_0x131614+'incidents','body':Object[_0x16f1('0x3f')]({},{'title':intUtil[_0x16f1('0x40')](_0x26eaa2['Subjects'],_0x40efcc,'\x20'),'description':intUtil['getString'](_0x26eaa2[_0x16f1('0x41')],_0x40efcc,'\x0a'),'customerid_contact@odata.bind':_0x16f1('0x42')+_0x5145a8['enduserId']+')','ownerid@odata.bind':_0x16f1('0x26')+_0x5145a8['userId']+')','caseorigincode':'1'},getCustomFields(_0x26eaa2[_0x16f1('0x43')],_0x40efcc,_0x26eaa2['ticketType'])),'headers':{'Authorization':_0x16f1('0x14')+_0x12d18a,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x26eaa2[_0x16f1('0x3c')]===_0x16f1('0x44')){_0x21c241={'method':_0x16f1('0x3e'),'uri':_0x131614+_0x16f1('0x45'),'body':Object['assign']({},{'subject':intUtil[_0x16f1('0x40')](_0x26eaa2[_0x16f1('0x46')],_0x40efcc,'\x20'),'phonenumber':String(_0x40efcc[_0x16f1('0x25')]),'description':intUtil[_0x16f1('0x40')](_0x26eaa2[_0x16f1('0x41')],_0x40efcc,'\x0a'),'regardingobjectid_contact@odata.bind':_0x16f1('0x42')+_0x5145a8[_0x16f1('0x2a')]+')','ownerid@odata.bind':_0x16f1('0x26')+_0x5145a8[_0x16f1('0x1f')]+')','directioncode':_0x5145a8['callDirection']==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x16f1('0x26')+_0x5145a8[_0x16f1('0x1f')]+')','participationtypemask':_0x5145a8[_0x16f1('0x47')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x5145a8[_0x16f1('0x2a')]+')','participationtypemask':_0x5145a8[_0x16f1('0x47')]==='queue'?0x1:0x2}]},getCustomFields(_0x26eaa2[_0x16f1('0x43')],_0x40efcc,_0x26eaa2[_0x16f1('0x3c')])),'headers':{'Authorization':_0x16f1('0x14')+_0x12d18a,'OData-Version':_0x16f1('0x15')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x21c241);})[_0x16f1('0xf')](function(_0x3db7f9){var _0x230212=_0x3db7f9[_0x16f1('0x48')]['odata-entityid'];var _0x32a05b=_0x230212['substring'](_0x230212[_0x16f1('0x29')]('(')+0x1,_0x230212[_0x16f1('0x29')](')'));_0x5145a8['ticketId']=_0x32a05b;_0x31b077(_0x5145a8);})[_0x16f1('0x10')](function(_0x15f4b4){_0x3b7976(_0x15f4b4[_0x16f1('0x21')]);});});}function emit(_0x592d15,_0x2bf948,_0x54f7ae,_0x5e77e5){var _0x930c6e={'uri':util['format'](_0x16f1('0x49'),_0x592d15,_0x54f7ae,_0x5e77e5)};io['to'](util[_0x16f1('0x4a')](_0x16f1('0x4b'),_0x2bf948))[_0x16f1('0x4c')](_0x16f1('0x4d'),_0x930c6e);}exports['cs']=function(_0x786a40,_0x4a67fb,_0x44b6b9,_0x27d223,_0x59ef11,_0x45af0e,_0x131052,_0x1bf0cc){var _0x58baff={};_0x45af0e['remoteUri']=intUtil[_0x16f1('0x4e')](_0x45af0e[_0x16f1('0xb')]);_0x45af0e[_0x16f1('0x4f')]=intUtil[_0x16f1('0x4e')](_0x45af0e[_0x16f1('0x4f')]);_0x58baff['callDirection']=_0x1bf0cc===_0x16f1('0x50')||_0x1bf0cc===_0x16f1('0x51')?'queue':'outbound';var _0x3f82cd=util['format'](_0x16f1('0x52'),_0x45af0e[_0x16f1('0xb')]);var _0x3763be=util[_0x16f1('0x4a')](_0x16f1('0x53'),_0x45af0e[_0x16f1('0x54')]);var _0x3d8767=util[_0x16f1('0x4a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x45af0e[_0x16f1('0x4f')],_0x4a67fb[_0x16f1('0x55')],md5(_0x4a67fb['uniqueid']));if(_0x59ef11&&_0x59ef11['monitor_format']){logger[_0x16f1('0x1c')](_0x16f1('0x56'),'Recording\x20is\x20enabled!');_0x4a67fb[_0x16f1('0x57')]=_0x3d8767;}else if(_0x131052&&_0x131052[_0x16f1('0x58')]&&_0x131052['recordingFormat']!==_0x16f1('0x59')){logger[_0x16f1('0x1c')](_0x16f1('0x5a'),_0x16f1('0x5b'));_0x4a67fb[_0x16f1('0x57')]=_0x3d8767;}else{_0x4a67fb['recordingURL']='';}return getUser(_0x58baff,_0x45af0e,_0x27d223,_0x3763be,_0x3f82cd,_0x1bf0cc)['then'](function(_0x3fc1fe){logger[_0x16f1('0x1c')]('['+_0x1bf0cc['toUpperCase']()+']\x20The\x20User\x20ID\x20is:',_0x3fc1fe[_0x16f1('0x1f')]);logger[_0x16f1('0x1c')]('['+_0x1bf0cc[_0x16f1('0x1d')]()+']\x20The\x20User\x20email\x20is:',_0x3fc1fe[_0x16f1('0x19')]);return getEndUser(_0x3fc1fe,_0x45af0e,_0x3763be,_0x3f82cd,_0x4a67fb,_0x1bf0cc);})['then'](function(_0x266a0b){logger[_0x16f1('0x1c')]('['+_0x1bf0cc[_0x16f1('0x1d')]()+_0x16f1('0x5c'),_0x266a0b[_0x16f1('0x2a')]);logger[_0x16f1('0x1c')]('['+_0x1bf0cc[_0x16f1('0x1d')]()+_0x16f1('0x5d'),_0x4a67fb[_0x16f1('0x25')]);return getTicket(_0x266a0b,_0x45af0e,_0x3763be,_0x3f82cd,_0x4a67fb,_0x44b6b9,_0x1bf0cc);})['then'](function(_0x820a98){logger[_0x16f1('0x1c')](util[_0x16f1('0x4a')]('['+_0x1bf0cc[_0x16f1('0x1d')]()+_0x16f1('0x5e'),_0x44b6b9[_0x16f1('0x3c')],_0x820a98[_0x16f1('0x5f')]));logger['info'](util['format']('['+_0x1bf0cc['toUpperCase']()+_0x16f1('0x60'),_0x1bf0cc));if(_0x1bf0cc!=='unmanaged'){logger[_0x16f1('0x1c')]('['+_0x1bf0cc['toUpperCase']()+']',_0x16f1('0x61'));emit(_0x45af0e[_0x16f1('0xb')],_0x27d223['name'],_0x44b6b9[_0x16f1('0x3c')],_0x820a98[_0x16f1('0x5f')]);}})[_0x16f1('0x10')](function(_0x5d8574){logger['error']('['+_0x1bf0cc[_0x16f1('0x1d')]()+_0x16f1('0x62'),util['inspect'](_0x5d8574,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 0c26688..71fe575 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe5da=['toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','recordingFormat','[OUTBOUND]','The\x20User\x20ID\x20is:','%s/helpdesk/tickets/%d','catch','error','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','freshdesk','redis','defaults','localhost','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','calleridname','calleridnum','getString','Subjects','Descriptions','<br>','Tags','name','Fields','custom_fields','keyBy','value','%s/api/v2/tickets','POST','Ticket\x20created!','validateEmail','%s/api/v2/agents','remoteUri','then','length','Agent\x20found!','contact','email','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','Basic\x20%s','toString','base64','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','nameField','customField','content','type','push','variable','variableName','idField','customVariable','Variable'];(function(_0x217c7e,_0x1ddaf1){var _0x58f008=function(_0x5f527b){while(--_0x5f527b){_0x217c7e['push'](_0x217c7e['shift']());}};_0x58f008(++_0x1ddaf1);}(_0xe5da,0x134));var _0xae5d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe5da[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xae5d('0x0'));var rp=require(_0xae5d('0x1'));var md5=require(_0xae5d('0x2'));var util=require(_0xae5d('0x3'));var Redis=require(_0xae5d('0x4'));var intUtil=require(_0xae5d('0x5'));var config=require(_0xae5d('0x6'));var logger=require('../../../../config/logger')(_0xae5d('0x7'));config[_0xae5d('0x8')]=_[_0xae5d('0x9')](config[_0xae5d('0x8')],{'host':_0xae5d('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0xae5d('0xb'),'Accept':_0xae5d('0xb')};function emit(_0x2c5733,_0x59cac0,_0x3b4521){io['to'](_0x2c5733)[_0xae5d('0xc')](_0x59cac0,_0x3b4521);}function getTicket(_0x52c610,_0x309728,_0x311de1,_0x33cd2a,_0x1fcad9){logger[_0xae5d('0xd')](_0xae5d('0xe'));var _0xc2fdc=_[_0xae5d('0xf')]({'responder_id':_0x309728['id'],'requester_id':_0x311de1['id'],'name':util[_0xae5d('0x10')]('Caller\x20-\x20%s',_0x1fcad9[_0xae5d('0x11')]),'phone':_0x1fcad9[_0xae5d('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xae5d('0x13')](_0x33cd2a[_0xae5d('0x14')],_0x1fcad9,'\x20'),'description':intUtil[_0xae5d('0x13')](_0x33cd2a[_0xae5d('0x15')],_0x1fcad9,_0xae5d('0x16')),'tags':getTags(_0x33cd2a[_0xae5d('0x17')],_0xae5d('0x18'))},getCustomFields(_0x33cd2a[_0xae5d('0x19')],_0x1fcad9));_0xc2fdc[_0xae5d('0x1a')]=_['mapValues'](_[_0xae5d('0x1b')](_0xc2fdc['custom_fields'],'id'),_0xae5d('0x1c'));return request({'uri':util['format'](_0xae5d('0x1d'),_0x52c610['remoteUri']),'method':_0xae5d('0x1e'),'body':_0xc2fdc})['then'](function(_0x2c0a72){logger[_0xae5d('0xd')](_0xae5d('0x1f'));return _0x2c0a72;});}function getUser(_0x54eeef,_0x2e6096){if(intUtil[_0xae5d('0x20')](_0x2e6096)){return request({'uri':util[_0xae5d('0x10')](_0xae5d('0x21'),_0x54eeef[_0xae5d('0x22')]),'qs':{'email':_0x2e6096}})[_0xae5d('0x23')](function(_0x42161a){if(_0x42161a[_0xae5d('0x24')]){logger[_0xae5d('0xd')](_0xae5d('0x25'));return _['find'](_0x42161a,function(_0x3996c4){return _0x3996c4[_0xae5d('0x26')][_0xae5d('0x27')]===_0x2e6096;});}else{logger[_0xae5d('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xae5d('0x10')]('%s/api/v2/agents/me',_0x54eeef[_0xae5d('0x22')])})[_0xae5d('0x23')](function(_0x931827){logger[_0xae5d('0xd')](_0xae5d('0x28'));return _0x931827;});}});}else{logger[_0xae5d('0xd')](_0xae5d('0x29'));return request({'uri':util[_0xae5d('0x10')](_0xae5d('0x2a'),_0x54eeef[_0xae5d('0x22')])})[_0xae5d('0x23')](function(_0xbc9103){logger[_0xae5d('0xd')](_0xae5d('0x28'));return _0xbc9103;});}}function getEndUser(_0x2daaae,_0xa4431c,_0x4f4410){logger[_0xae5d('0xd')]('Searching\x20enduser\x20with\x20phone',_0x4f4410);return request({'uri':util[_0xae5d('0x10')](_0xae5d('0x2b'),_0x2daaae[_0xae5d('0x22')]),'qs':{'phone':_0x4f4410}})['then'](function(_0x3c8448){if(_0x3c8448['length']){logger['info'](_0xae5d('0x2c'));return _['find'](_0x3c8448,{'phone':_0x4f4410});}else{logger[_0xae5d('0xd')](_0xae5d('0x2d'));return request({'uri':util['format']('%s/api/v2/contacts',_0x2daaae['remoteUri']),'method':_0xae5d('0x1e'),'body':{'name':_0xa4431c,'phone':_0x4f4410}})['then'](function(_0x161698){logger[_0xae5d('0xd')](_0xae5d('0x2e'));return _0x161698;});}});}function getAuth(_0x192ef6){return util[_0xae5d('0x10')](_0xae5d('0x2f'),new Buffer(_0x192ef6['apiKey']+':X')[_0xae5d('0x30')](_0xae5d('0x31')));}function request(_0x3e08f6){logger['debug'](_0xae5d('0x32'),JSON[_0xae5d('0x33')](_0x3e08f6));return rp(_[_0xae5d('0x9')](_0x3e08f6,{'method':_0xae5d('0x34'),'headers':headers,'json':!![]}));}function getTags(_0x316e63,_0x26168d){var _0xbd3f8c=[];if(_0x316e63&&_0x316e63[_0xae5d('0x24')]>0x0){_0xbd3f8c=_[_0xae5d('0x35')](_0x316e63,_0x26168d);}return _0xbd3f8c;}function getCustomFields(_0x49e748,_0x356b00){var _0xcfb65d=[];var _0x5aaa6e={'custom_fields':[]};if(_0x49e748[_0xae5d('0x24')]>0x0){_[_0xae5d('0x36')](_0x49e748,function(_0x35aba4){if(_[_0xae5d('0x37')]([_0xae5d('0x38'),_0xae5d('0x39')],_0x35aba4['type'])&&_0x35aba4[_0xae5d('0x3a')]&&!_0x35aba4[_0xae5d('0x3b')]){_0x5aaa6e[_0x35aba4[_0xae5d('0x3a')]['toLowerCase']()]=_0x35aba4[_0xae5d('0x3c')][_0xae5d('0x30')]();}else if(_['includes']([_0xae5d('0x38'),_0xae5d('0x39')],_0x35aba4[_0xae5d('0x3d')])&&_0x35aba4['idField']&&_0x35aba4['customField']){_0x5aaa6e[_0xae5d('0x1a')][_0xae5d('0x3e')]({'id':_0x35aba4['idField'],'value':_0x35aba4['content'][_0xae5d('0x30')]()});}else if(_0x35aba4['type']===_0xae5d('0x3f')&&_0x35aba4[_0xae5d('0x40')]&&_0x35aba4[_0xae5d('0x41')]&&_0x35aba4[_0xae5d('0x3b')]){_0x356b00[_0x35aba4[_0xae5d('0x40')]]&&_0x5aaa6e[_0xae5d('0x1a')]['push']({'id':_0x35aba4[_0xae5d('0x41')],'value':_0x356b00[_0x35aba4[_0xae5d('0x40')]][_0xae5d('0x30')]()});}else if(_0x35aba4[_0xae5d('0x3d')]===_0xae5d('0x42')&&_0x35aba4['Variable']&&_0x35aba4['Variable']['name']&&_0x35aba4['idField']&&_0x35aba4[_0xae5d('0x3b')]){_0x356b00[_0x35aba4[_0xae5d('0x43')][_0xae5d('0x18')][_0xae5d('0x44')]()]&&_0x5aaa6e['custom_fields'][_0xae5d('0x3e')]({'id':_0x35aba4[_0xae5d('0x41')],'value':_0x356b00[_0x35aba4['Variable'][_0xae5d('0x18')]['toLowerCase']()][_0xae5d('0x30')]()});}});}return _0x5aaa6e;}exports[_0xae5d('0x45')]=function(_0x54b074,_0x4e7ee5,_0x559987,_0x597782,_0xf292ba,_0x1a734b){var _0x47dda8,_0xab326d;_0x1a734b['remoteUri']=intUtil[_0xae5d('0x46')](_0x1a734b[_0xae5d('0x22')]);_0x1a734b['serverUrl']=intUtil[_0xae5d('0x46')](_0x1a734b[_0xae5d('0x47')]);if(_0xf292ba&&_0xf292ba[_0xae5d('0x48')]){logger[_0xae5d('0xd')](_0xae5d('0x49'),_0xae5d('0x4a'));_0x4e7ee5[_0xae5d('0x4b')]=util['format'](_0xae5d('0x4c'),_0x1a734b['serverUrl'],_0x4e7ee5['uniqueid'],md5(_0x4e7ee5[_0xae5d('0x4d')]));}else{_0x4e7ee5[_0xae5d('0x4b')]='';}headers[_0xae5d('0x4e')]=getAuth(_0x1a734b);return getUser(_0x1a734b,_0x597782[_0xae5d('0x27')])[_0xae5d('0x23')](function(_0x47a48d){_0x47dda8=_0x47a48d;logger[_0xae5d('0xd')]('The\x20User\x20ID\x20is:',_0x47dda8['id']);return getEndUser(_0x1a734b,_0x4e7ee5[_0xae5d('0x11')],_0x4e7ee5[_0xae5d('0x12')]);})['then'](function(_0x586625){_0xab326d=_0x586625;logger[_0xae5d('0xd')](_0xae5d('0x4f'),_0xab326d['id']);return getTicket(_0x1a734b,_0x47dda8,_0xab326d,_0x559987,_0x4e7ee5);})[_0xae5d('0x23')](function(_0x2f4a7d){if(_0x2f4a7d&&_0x2f4a7d['id']){logger['info']('Ticket\x20created!');logger[_0xae5d('0xd')](_0xae5d('0x50'),_0x2f4a7d['id']);logger[_0xae5d('0xd')](_0xae5d('0x49'),_0xae5d('0x51'));emit(util[_0xae5d('0x10')](_0xae5d('0x52'),_0x597782['name']),_0xae5d('0x53'),{'uri':util[_0xae5d('0x10')]('%s/helpdesk/tickets/%d',_0x1a734b[_0xae5d('0x22')],_0x2f4a7d['id'])});}})['catch'](function(_0x3ae68d){logger['error'](_0xae5d('0x49'),JSON['stringify'](_0x3ae68d));});};exports[_0xae5d('0x54')]=function(_0x897506,_0x4235b3,_0x5724fd,_0x21916f,_0x3579f9,_0x2ce0da,_0x383c45){var _0x1c27fb,_0x12b704;_0x2ce0da[_0xae5d('0x22')]=intUtil[_0xae5d('0x46')](_0x2ce0da[_0xae5d('0x22')]);_0x2ce0da['serverUrl']=intUtil[_0xae5d('0x46')](_0x2ce0da[_0xae5d('0x47')]);if(_0x383c45&&_0x383c45[_0xae5d('0x55')]&&_0x383c45[_0xae5d('0x55')]!=='none'){logger[_0xae5d('0xd')](_0xae5d('0x56'),_0xae5d('0x4a'));_0x4235b3[_0xae5d('0x4b')]=util['format'](_0xae5d('0x4c'),_0x2ce0da[_0xae5d('0x47')],_0x4235b3[_0xae5d('0x4d')],md5(_0x4235b3[_0xae5d('0x4d')]));}headers[_0xae5d('0x4e')]=getAuth(_0x2ce0da);return getUser(_0x2ce0da,_0x21916f[_0xae5d('0x27')])['then'](function(_0x45c0b7){_0x1c27fb=_0x45c0b7;logger[_0xae5d('0xd')](_0xae5d('0x57'),_0x1c27fb['id']);return getEndUser(_0x2ce0da,_0x4235b3['destcalleridname'],_0x4235b3['destcalleridnum']);})[_0xae5d('0x23')](function(_0x5d204d){_0x12b704=_0x5d204d;logger[_0xae5d('0xd')](_0xae5d('0x4f'),_0x12b704['id']);return getTicket(_0x2ce0da,_0x1c27fb,_0x12b704,_0x5724fd,_0x4235b3);})[_0xae5d('0x23')](function(_0x220472){if(_0x220472&&_0x220472['id']){logger[_0xae5d('0xd')](_0xae5d('0x1f'));logger[_0xae5d('0xd')](_0xae5d('0x50'),_0x220472['id']);logger[_0xae5d('0xd')](_0xae5d('0x56'),_0xae5d('0x51'));emit(util[_0xae5d('0x10')]('user:%s',_0x21916f[_0xae5d('0x18')]),_0xae5d('0x53'),{'uri':util['format'](_0xae5d('0x58'),_0x2ce0da['remoteUri'],_0x220472['id'])});}})[_0xae5d('0x59')](function(_0x50e9a8){logger[_0xae5d('0x5a')](_0xae5d('0x56'),JSON['stringify'](_0x50e9a8));});};exports[_0xae5d('0x5b')]=function(_0x1e0e7f,_0x18ad73,_0x26906f,_0x4c60bf,_0x3c9db7,_0x387024){var _0x57ce6f,_0x2ff64f;_0x387024[_0xae5d('0x22')]=intUtil[_0xae5d('0x46')](_0x387024['remoteUri']);_0x387024[_0xae5d('0x47')]=intUtil['stripTrailingSlash'](_0x387024[_0xae5d('0x47')]);if(_0x3c9db7&&_0x3c9db7[_0xae5d('0x48')]){logger[_0xae5d('0xd')]('['+_0x18ad73[_0xae5d('0x5c')][_0xae5d('0x5d')]()+']',_0xae5d('0x4a'));_0x18ad73[_0xae5d('0x4b')]=util['format'](_0xae5d('0x4c'),_0x387024[_0xae5d('0x47')],_0x18ad73[_0xae5d('0x4d')],md5(_0x18ad73[_0xae5d('0x4d')]));}else{_0x18ad73['recordingURL']='';}headers[_0xae5d('0x4e')]=getAuth(_0x387024);return getUser(_0x387024,'')[_0xae5d('0x23')](function(_0x21e4bd){_0x57ce6f=_0x21e4bd;logger[_0xae5d('0xd')]('The\x20User\x20ID\x20is:',_0x57ce6f['id']);return getEndUser(_0x387024,_0x18ad73['calleridname'],_0x18ad73[_0xae5d('0x12')]);})[_0xae5d('0x23')](function(_0xd373d5){_0x2ff64f=_0xd373d5;logger['info'](_0xae5d('0x4f'),_0x2ff64f['id']);return getTicket(_0x387024,_0x57ce6f,_0x2ff64f,_0x26906f,_0x18ad73);})['then'](function(_0x15f21c){if(_0x15f21c){logger[_0xae5d('0xd')](_0xae5d('0x1f'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x15f21c['id']);}})[_0xae5d('0x59')](function(_0x5152d5){logger[_0xae5d('0x5a')]('['+_0x18ad73['lastevent'][_0xae5d('0x5d')]()+']',JSON['stringify'](_0x5152d5));});};
\ No newline at end of file
+var _0x4d6e=['calleridname','calleridnum','getString','Subjects','Descriptions','<br>','name','Fields','custom_fields','mapValues','keyBy','%s/api/v2/tickets','remoteUri','POST','Ticket\x20created!','validateEmail','%s/api/v2/agents','then','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','apiKey','toString','base64','debug','[HTTP]','stringify','GET','length','forEach','includes','string','type','nameField','toLowerCase','content','picklist','idField','customField','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','Authorization','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','error','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','freshdesk','defaults','redis','socket.io-emitter','application/json','emit','info','merge','format','Caller\x20-\x20%s'];(function(_0x59909d,_0x25cc06){var _0x294710=function(_0x144d71){while(--_0x144d71){_0x59909d['push'](_0x59909d['shift']());}};_0x294710(++_0x25cc06);}(_0x4d6e,0xb3));var _0xe4d6=function(_0x338338,_0x782573){_0x338338=_0x338338-0x0;var _0x3cf852=_0x4d6e[_0x338338];return _0x3cf852;};'use strict';var _=require(_0xe4d6('0x0'));var rp=require(_0xe4d6('0x1'));var md5=require(_0xe4d6('0x2'));var util=require(_0xe4d6('0x3'));var Redis=require('ioredis');var intUtil=require(_0xe4d6('0x4'));var config=require(_0xe4d6('0x5'));var logger=require(_0xe4d6('0x6'))(_0xe4d6('0x7'));config['redis']=_[_0xe4d6('0x8')](config[_0xe4d6('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xe4d6('0xa'))(new Redis(config[_0xe4d6('0x9')]));var headers={'Content-Type':_0xe4d6('0xb'),'Accept':_0xe4d6('0xb')};function emit(_0x39a776,_0x2c59d8,_0x31be72){io['to'](_0x39a776)[_0xe4d6('0xc')](_0x2c59d8,_0x31be72);}function getTicket(_0x3e7ddd,_0xf14e2e,_0x3f3bd1,_0x3c6ddd,_0x445ab3){logger[_0xe4d6('0xd')]('Creating\x20new\x20ticket...');var _0x525cec=_[_0xe4d6('0xe')]({'responder_id':_0xf14e2e['id'],'requester_id':_0x3f3bd1['id'],'name':util[_0xe4d6('0xf')](_0xe4d6('0x10'),_0x445ab3[_0xe4d6('0x11')]),'phone':_0x445ab3[_0xe4d6('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xe4d6('0x13')](_0x3c6ddd[_0xe4d6('0x14')],_0x445ab3,'\x20'),'description':intUtil[_0xe4d6('0x13')](_0x3c6ddd[_0xe4d6('0x15')],_0x445ab3,_0xe4d6('0x16')),'tags':getTags(_0x3c6ddd['Tags'],_0xe4d6('0x17'))},getCustomFields(_0x3c6ddd[_0xe4d6('0x18')],_0x445ab3));_0x525cec[_0xe4d6('0x19')]=_[_0xe4d6('0x1a')](_[_0xe4d6('0x1b')](_0x525cec[_0xe4d6('0x19')],'id'),'value');return request({'uri':util[_0xe4d6('0xf')](_0xe4d6('0x1c'),_0x3e7ddd[_0xe4d6('0x1d')]),'method':_0xe4d6('0x1e'),'body':_0x525cec})['then'](function(_0x90439e){logger[_0xe4d6('0xd')](_0xe4d6('0x1f'));return _0x90439e;});}function getUser(_0x158544,_0x4b8012){if(intUtil[_0xe4d6('0x20')](_0x4b8012)){return request({'uri':util[_0xe4d6('0xf')](_0xe4d6('0x21'),_0x158544['remoteUri']),'qs':{'email':_0x4b8012}})[_0xe4d6('0x22')](function(_0x3a1c9d){if(_0x3a1c9d['length']){logger[_0xe4d6('0xd')](_0xe4d6('0x23'));return _[_0xe4d6('0x24')](_0x3a1c9d,function(_0x535bfd){return _0x535bfd[_0xe4d6('0x25')][_0xe4d6('0x26')]===_0x4b8012;});}else{logger['info'](_0xe4d6('0x27'));return request({'uri':util[_0xe4d6('0xf')](_0xe4d6('0x28'),_0x158544['remoteUri'])})['then'](function(_0x118559){logger[_0xe4d6('0xd')](_0xe4d6('0x29'));return _0x118559;});}});}else{logger['info'](_0xe4d6('0x2a'));return request({'uri':util[_0xe4d6('0xf')]('%s/api/v2/agents/me',_0x158544[_0xe4d6('0x1d')])})[_0xe4d6('0x22')](function(_0x4af0ca){logger[_0xe4d6('0xd')](_0xe4d6('0x29'));return _0x4af0ca;});}}function getEndUser(_0x2dbecf,_0x10d8e6,_0x7fe060){logger[_0xe4d6('0xd')](_0xe4d6('0x2b'),_0x7fe060);return request({'uri':util[_0xe4d6('0xf')](_0xe4d6('0x2c'),_0x2dbecf[_0xe4d6('0x1d')]),'qs':{'phone':_0x7fe060}})['then'](function(_0x29a5fe){if(_0x29a5fe['length']){logger[_0xe4d6('0xd')]('Enduser\x20found!');return _['find'](_0x29a5fe,{'phone':_0x7fe060});}else{logger[_0xe4d6('0xd')](_0xe4d6('0x2d'));return request({'uri':util['format'](_0xe4d6('0x2c'),_0x2dbecf[_0xe4d6('0x1d')]),'method':_0xe4d6('0x1e'),'body':{'name':_0x10d8e6,'phone':_0x7fe060}})[_0xe4d6('0x22')](function(_0x17311e){logger[_0xe4d6('0xd')](_0xe4d6('0x2e'));return _0x17311e;});}});}function getAuth(_0x8d11e3){return util[_0xe4d6('0xf')]('Basic\x20%s',new Buffer(_0x8d11e3[_0xe4d6('0x2f')]+':X')[_0xe4d6('0x30')](_0xe4d6('0x31')));}function request(_0x45936d){logger[_0xe4d6('0x32')](_0xe4d6('0x33'),JSON[_0xe4d6('0x34')](_0x45936d));return rp(_[_0xe4d6('0x8')](_0x45936d,{'method':_0xe4d6('0x35'),'headers':headers,'json':!![]}));}function getTags(_0x124f2e,_0x153695){var _0x12d245=[];if(_0x124f2e&&_0x124f2e['length']>0x0){_0x12d245=_['map'](_0x124f2e,_0x153695);}return _0x12d245;}function getCustomFields(_0x170669,_0x42953e){var _0x14eb9e=[];var _0x4063ef={'custom_fields':[]};if(_0x170669[_0xe4d6('0x36')]>0x0){_[_0xe4d6('0x37')](_0x170669,function(_0x3525f1){if(_[_0xe4d6('0x38')]([_0xe4d6('0x39'),'picklist'],_0x3525f1[_0xe4d6('0x3a')])&&_0x3525f1[_0xe4d6('0x3b')]&&!_0x3525f1['customField']){_0x4063ef[_0x3525f1[_0xe4d6('0x3b')][_0xe4d6('0x3c')]()]=_0x3525f1[_0xe4d6('0x3d')][_0xe4d6('0x30')]();}else if(_[_0xe4d6('0x38')]([_0xe4d6('0x39'),_0xe4d6('0x3e')],_0x3525f1[_0xe4d6('0x3a')])&&_0x3525f1[_0xe4d6('0x3f')]&&_0x3525f1[_0xe4d6('0x40')]){_0x4063ef[_0xe4d6('0x19')][_0xe4d6('0x41')]({'id':_0x3525f1['idField'],'value':_0x3525f1[_0xe4d6('0x3d')][_0xe4d6('0x30')]()});}else if(_0x3525f1[_0xe4d6('0x3a')]===_0xe4d6('0x42')&&_0x3525f1['variableName']&&_0x3525f1['idField']&&_0x3525f1[_0xe4d6('0x40')]){_0x42953e[_0x3525f1[_0xe4d6('0x43')]]&&_0x4063ef[_0xe4d6('0x19')]['push']({'id':_0x3525f1['idField'],'value':_0x42953e[_0x3525f1[_0xe4d6('0x43')]][_0xe4d6('0x30')]()});}else if(_0x3525f1[_0xe4d6('0x3a')]===_0xe4d6('0x44')&&_0x3525f1[_0xe4d6('0x45')]&&_0x3525f1['Variable'][_0xe4d6('0x17')]&&_0x3525f1[_0xe4d6('0x3f')]&&_0x3525f1[_0xe4d6('0x40')]){_0x42953e[_0x3525f1[_0xe4d6('0x45')]['name'][_0xe4d6('0x3c')]()]&&_0x4063ef['custom_fields'][_0xe4d6('0x41')]({'id':_0x3525f1[_0xe4d6('0x3f')],'value':_0x42953e[_0x3525f1[_0xe4d6('0x45')][_0xe4d6('0x17')][_0xe4d6('0x3c')]()]['toString']()});}});}return _0x4063ef;}exports[_0xe4d6('0x46')]=function(_0x3b18d2,_0x3d02f8,_0x58eb1f,_0x460e38,_0x4c7185,_0x49a81c){var _0x26cf5e,_0x41d6bf;_0x49a81c[_0xe4d6('0x1d')]=intUtil[_0xe4d6('0x47')](_0x49a81c[_0xe4d6('0x1d')]);_0x49a81c['serverUrl']=intUtil['stripTrailingSlash'](_0x49a81c['serverUrl']);if(_0x4c7185&&_0x4c7185[_0xe4d6('0x48')]){logger[_0xe4d6('0xd')](_0xe4d6('0x49'),_0xe4d6('0x4a'));_0x3d02f8[_0xe4d6('0x4b')]=util[_0xe4d6('0xf')](_0xe4d6('0x4c'),_0x49a81c[_0xe4d6('0x4d')],_0x3d02f8['uniqueid'],md5(_0x3d02f8['uniqueid']));}else{_0x3d02f8[_0xe4d6('0x4b')]='';}headers[_0xe4d6('0x4e')]=getAuth(_0x49a81c);return getUser(_0x49a81c,_0x460e38[_0xe4d6('0x26')])[_0xe4d6('0x22')](function(_0x1cb401){_0x26cf5e=_0x1cb401;logger['info'](_0xe4d6('0x4f'),_0x26cf5e['id']);return getEndUser(_0x49a81c,_0x3d02f8[_0xe4d6('0x11')],_0x3d02f8['calleridnum']);})['then'](function(_0x4216bf){_0x41d6bf=_0x4216bf;logger[_0xe4d6('0xd')]('The\x20Enduser\x20ID\x20is:',_0x41d6bf['id']);return getTicket(_0x49a81c,_0x26cf5e,_0x41d6bf,_0x58eb1f,_0x3d02f8);})[_0xe4d6('0x22')](function(_0x390501){if(_0x390501&&_0x390501['id']){logger['info'](_0xe4d6('0x1f'));logger[_0xe4d6('0xd')](_0xe4d6('0x50'),_0x390501['id']);logger[_0xe4d6('0xd')](_0xe4d6('0x49'),_0xe4d6('0x51'));emit(util[_0xe4d6('0xf')](_0xe4d6('0x52'),_0x460e38[_0xe4d6('0x17')]),_0xe4d6('0x53'),{'uri':util[_0xe4d6('0xf')](_0xe4d6('0x54'),_0x49a81c[_0xe4d6('0x1d')],_0x390501['id'])});}})[_0xe4d6('0x55')](function(_0x1f2b65){logger['error'](_0xe4d6('0x49'),JSON[_0xe4d6('0x34')](_0x1f2b65));});};exports[_0xe4d6('0x56')]=function(_0x3e8f36,_0x215a59,_0x5b8651,_0x55a28f,_0x228716,_0x22f4d7,_0x567129){var _0x12becf,_0x4cb739;_0x22f4d7[_0xe4d6('0x1d')]=intUtil['stripTrailingSlash'](_0x22f4d7[_0xe4d6('0x1d')]);_0x22f4d7[_0xe4d6('0x4d')]=intUtil[_0xe4d6('0x47')](_0x22f4d7[_0xe4d6('0x4d')]);if(_0x567129&&_0x567129['recordingFormat']&&_0x567129[_0xe4d6('0x57')]!==_0xe4d6('0x58')){logger[_0xe4d6('0xd')](_0xe4d6('0x59'),_0xe4d6('0x4a'));_0x215a59[_0xe4d6('0x4b')]=util[_0xe4d6('0xf')](_0xe4d6('0x4c'),_0x22f4d7['serverUrl'],_0x215a59['uniqueid'],md5(_0x215a59[_0xe4d6('0x5a')]));}headers[_0xe4d6('0x4e')]=getAuth(_0x22f4d7);return getUser(_0x22f4d7,_0x55a28f[_0xe4d6('0x26')])[_0xe4d6('0x22')](function(_0x1ec520){_0x12becf=_0x1ec520;logger[_0xe4d6('0xd')](_0xe4d6('0x4f'),_0x12becf['id']);return getEndUser(_0x22f4d7,_0x215a59[_0xe4d6('0x5b')],_0x215a59[_0xe4d6('0x5c')]);})['then'](function(_0x53c890){_0x4cb739=_0x53c890;logger['info'](_0xe4d6('0x5d'),_0x4cb739['id']);return getTicket(_0x22f4d7,_0x12becf,_0x4cb739,_0x5b8651,_0x215a59);})[_0xe4d6('0x22')](function(_0x44eb05){if(_0x44eb05&&_0x44eb05['id']){logger['info']('Ticket\x20created!');logger[_0xe4d6('0xd')]('The\x20Ticket\x20ID\x20is:',_0x44eb05['id']);logger[_0xe4d6('0xd')]('[OUTBOUND]',_0xe4d6('0x51'));emit(util[_0xe4d6('0xf')](_0xe4d6('0x52'),_0x55a28f[_0xe4d6('0x17')]),_0xe4d6('0x53'),{'uri':util[_0xe4d6('0xf')](_0xe4d6('0x54'),_0x22f4d7[_0xe4d6('0x1d')],_0x44eb05['id'])});}})['catch'](function(_0x9c4a4d){logger[_0xe4d6('0x5e')](_0xe4d6('0x59'),JSON['stringify'](_0x9c4a4d));});};exports[_0xe4d6('0x5f')]=function(_0x371980,_0x2bfd15,_0x37e799,_0x56770c,_0x3bdb20,_0x3eb521){var _0x5688f8,_0x306598;_0x3eb521[_0xe4d6('0x1d')]=intUtil['stripTrailingSlash'](_0x3eb521[_0xe4d6('0x1d')]);_0x3eb521[_0xe4d6('0x4d')]=intUtil['stripTrailingSlash'](_0x3eb521[_0xe4d6('0x4d')]);if(_0x3bdb20&&_0x3bdb20[_0xe4d6('0x48')]){logger[_0xe4d6('0xd')]('['+_0x2bfd15[_0xe4d6('0x60')]['toUpperCase']()+']',_0xe4d6('0x4a'));_0x2bfd15['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3eb521[_0xe4d6('0x4d')],_0x2bfd15[_0xe4d6('0x5a')],md5(_0x2bfd15[_0xe4d6('0x5a')]));}else{_0x2bfd15[_0xe4d6('0x4b')]='';}headers[_0xe4d6('0x4e')]=getAuth(_0x3eb521);return getUser(_0x3eb521,'')[_0xe4d6('0x22')](function(_0x66169e){_0x5688f8=_0x66169e;logger[_0xe4d6('0xd')](_0xe4d6('0x4f'),_0x5688f8['id']);return getEndUser(_0x3eb521,_0x2bfd15[_0xe4d6('0x11')],_0x2bfd15['calleridnum']);})[_0xe4d6('0x22')](function(_0x37c8b4){_0x306598=_0x37c8b4;logger['info'](_0xe4d6('0x5d'),_0x306598['id']);return getTicket(_0x3eb521,_0x5688f8,_0x306598,_0x37e799,_0x2bfd15);})[_0xe4d6('0x22')](function(_0x5ac55f){if(_0x5ac55f){logger['info']('Ticket\x20created!');logger['info'](_0xe4d6('0x50'),_0x5ac55f['id']);}})[_0xe4d6('0x55')](function(_0x4c5a59){logger['error']('['+_0x2bfd15[_0xe4d6('0x60')][_0xe4d6('0x61')]()+']',JSON[_0xe4d6('0x34')](_0x4c5a59));});};
\ No newline at end of file
index 313dbd7..5db4938 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6c0=['name',']\x20Error\x20running\x20Freshsales\x20integration','request-promise','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','Getting\x20admin\x20information','then','users','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','info','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','length','userId','User\x20found:','/api/lookup?q=','&f=','find','contacts','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','serverUrl','toLowerCase','destcalleridnum','calleridnum','callDirection','unmanaged','outbound','uniqueid','monitor_format','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...'];(function(_0x4dbff0,_0xd80451){var _0xf762b6=function(_0x3b5c4f){while(--_0x3b5c4f){_0x4dbff0['push'](_0x4dbff0['shift']());}};_0xf762b6(++_0xd80451);}(_0xc6c0,0x152));var _0x0c6c=function(_0x53b53e,_0x498437){_0x53b53e=_0x53b53e-0x0;var _0xbb6179=_0xc6c0[_0x53b53e];return _0xbb6179;};'use strict';var _=require('lodash');var rp=require(_0x0c6c('0x0'));var md5=require('md5');var util=require(_0x0c6c('0x1'));var moment=require(_0x0c6c('0x2'));var Promise=require(_0x0c6c('0x3'));var Redis=require(_0x0c6c('0x4'));var intUtil=require(_0x0c6c('0x5'));var config=require(_0x0c6c('0x6'));var logger=require(_0x0c6c('0x7'))(_0x0c6c('0x8'));config[_0x0c6c('0x9')]=_['defaults'](config['redis'],{'host':_0x0c6c('0xa'),'port':0x18eb});var io=require(_0x0c6c('0xb'))(new Redis(config[_0x0c6c('0x9')]));function getAdminId(_0x35fdda,_0x47389e,_0x47fcf8,_0x806d9a){return new Promise(function(_0x1dc97f,_0x4e12ba){var _0x3bf41b=![];var _0x382a64={'method':_0x0c6c('0xc'),'uri':_0x806d9a+_0x0c6c('0xd'),'json':!![]};_0x382a64[_0x0c6c('0xe')]=_0x47fcf8;logger['info'](_0x0c6c('0xf'));return rp(_0x382a64)[_0x0c6c('0x10')](function(_0x5b3c89){if(_0x5b3c89){var _0x18f257=_0x5b3c89[_0x0c6c('0x11')];var _0x5692a1=null;for(_0x5692a1=0x0;_0x5692a1<_0x18f257['length'];_0x5692a1++){if(_0x18f257[_0x5692a1][_0x0c6c('0x12')]===_0x35fdda[_0x0c6c('0x13')]){_0x35fdda[_0x0c6c('0x14')]=_0x18f257[_0x5692a1]['id'];_0x3bf41b=!![];}}if(_0x3bf41b){logger['info'](_0x0c6c('0x15'),_0x35fdda[_0x0c6c('0x14')]);_0x1dc97f(_0x35fdda);}else{_0x4e12ba({'statusCode':0x194,'message':_0x0c6c('0x16')});}}else{_0x4e12ba({'statusCode':0x194,'message':_0x0c6c('0x16')});}})[_0x0c6c('0x17')](function(_0x3bd46f){logger[_0x0c6c('0x18')]('['+[_0x47389e[_0x0c6c('0x19')]()]+']',_0x3bd46f[_0x0c6c('0x1a')]);_0x4e12ba(_0x3bd46f);});});}function getUser(_0x5476e8,_0x249615,_0x4aaf79){return function(_0x402e07){return new Promise(function(_0x136cd7,_0x43bf4b){var _0x5becf1={'method':_0x0c6c('0xc'),'uri':_0x4aaf79+_0x0c6c('0xd'),'json':!![]};_0x5becf1['headers']=_0x249615;logger[_0x0c6c('0x1b')](_0x0c6c('0x1c'));return rp(_0x5becf1)[_0x0c6c('0x10')](function(_0x237aca){if(_0x237aca){var _0x1cc984=_0x237aca[_0x0c6c('0x11')];var _0x18488b=![];var _0x347c5c=null;if(_0x402e07[_0x0c6c('0x1d')]!==null){logger['info'](_0x0c6c('0x1e'),_0x402e07[_0x0c6c('0x1d')]);_0x402e07[_0x0c6c('0x1f')]=_0x402e07[_0x0c6c('0x1d')];for(_0x347c5c=0x0;_0x347c5c<_0x1cc984[_0x0c6c('0x20')];_0x347c5c++){if(_0x1cc984[_0x347c5c][_0x0c6c('0x12')]===_0x402e07['agentEmail']){_0x18488b=!![];_0x402e07[_0x0c6c('0x21')]=_0x1cc984[_0x347c5c]['id'];logger[_0x0c6c('0x1b')](_0x0c6c('0x22'),_0x402e07[_0x0c6c('0x21')]);}}}if(!_0x18488b){logger[_0x0c6c('0x1b')]('Admin\x20selected');_0x402e07[_0x0c6c('0x1f')]=_0x402e07[_0x0c6c('0x13')];_0x402e07['userId']=_0x402e07[_0x0c6c('0x14')];_0x18488b=!![];}if(_0x18488b){_0x136cd7(_0x402e07);}else{_0x43bf4b({'statusCode':0x194,'message':_0x0c6c('0x16')});}}else{_0x43bf4b({'statusCode':0x194,'message':_0x0c6c('0x16')});}})[_0x0c6c('0x17')](function(_0x13fa95){logger[_0x0c6c('0x18')]('['+[_0x5476e8[_0x0c6c('0x19')]()]+']',_0x13fa95[_0x0c6c('0x1a')]);_0x43bf4b(_0x13fa95);});});};}function searchContact(_0x507ce6,_0x51f89d,_0x122ea5,_0x2277a1){return new Promise(function(_0x15f7a5,_0xf2c16c){var _0x143d51={'method':_0x0c6c('0xc'),'headers':_0x51f89d,'uri':_0x507ce6+_0x0c6c('0x23')+_0x2277a1+_0x0c6c('0x24')+_0x122ea5+'&entities=contact','json':!![]};rp(_0x143d51)[_0x0c6c('0x10')](function(_0x1a9ad8){var _0x369db6=_[_0x0c6c('0x25')](_0x1a9ad8['contacts'][_0x0c6c('0x26')],[_0x122ea5,_0x2277a1]);_0x15f7a5(_0x369db6);})[_0x0c6c('0x17')](function(_0x26dc07){_0xf2c16c(_0x26dc07);});});}function getEndUser(_0x48e976,_0x46e061,_0x5b0e71){return function(_0x5e9af0){return new Promise(function(_0x31b47d,_0x326bad){logger[_0x0c6c('0x1b')](util[_0x0c6c('0x27')]('Searching\x20contact\x20with\x20phone\x20%s',_0x5e9af0[_0x0c6c('0x28')]));searchContact(_0x5b0e71,_0x46e061,_0x0c6c('0x29'),_0x5e9af0[_0x0c6c('0x28')])['then'](function(_0x18d28c){if(_0x18d28c){_0x5e9af0[_0x0c6c('0x2a')]=_0x18d28c['id'];logger['info'](_0x0c6c('0x2b'),_0x5e9af0['endUserId']);return _0x31b47d(_0x5e9af0);}searchContact(_0x5b0e71,_0x46e061,_0x0c6c('0x2c'),_0x5e9af0[_0x0c6c('0x28')])[_0x0c6c('0x10')](function(_0x25b980){if(_0x25b980){_0x5e9af0['endUserId']=_0x25b980['id'];logger[_0x0c6c('0x1b')]('Contact\x20found\x20work_number:',_0x5e9af0[_0x0c6c('0x2a')]);return _0x31b47d(_0x5e9af0);}createEndUser(_0x5e9af0,_0x48e976,_0x46e061,_0x5b0e71)[_0x0c6c('0x10')](function(_0x4db3a6){logger[_0x0c6c('0x1b')]('Contact\x20created:',_0x4db3a6[_0x0c6c('0x2a')]);return _0x31b47d(_0x4db3a6);});});})[_0x0c6c('0x17')](function(_0x2973da){_0x326bad(_0x2973da);});});};}function createEndUser(_0x4c5856,_0xcdd633,_0x4a0ffc,_0x3c1471){return new Promise(function(_0x4bc64a,_0x54ab4c){var _0x4750ef=moment();var _0x1bcf16={'method':'POST','uri':_0x3c1471+_0x0c6c('0x2d'),'body':{'contact':{'last_name':_0x4c5856[_0x0c6c('0x28')],'work_number':_0x4c5856[_0x0c6c('0x28')],'mobile_number':_0x4c5856['contactNumber'],'owner_id':_0x4c5856[_0x0c6c('0x21')],'created_at':_0x4750ef['format'](_0x0c6c('0x2e'))}},'json':!![]};_0x1bcf16[_0x0c6c('0xe')]=_0x4a0ffc;logger['info'](_0x0c6c('0x2f'));return rp(_0x1bcf16)['then'](function(_0x13d621){_0x4c5856[_0x0c6c('0x2a')]=_0x13d621[_0x0c6c('0x30')]['id'];_0x4bc64a(_0x4c5856);})['catch'](function(_0x3f2de4){logger[_0x0c6c('0x18')]('['+[_0xcdd633['toUpperCase']()]+']',_0x3f2de4[_0x0c6c('0x1a')]);_0x54ab4c(_0x3f2de4['message']);});});}function getTicket(_0x5688c1,_0x53ac2c,_0x4aef38,_0x271bf0,_0x44b331){return function(_0x511ef1){logger[_0x0c6c('0x1b')](_0x0c6c('0x31'));return new Promise(function(_0x5b23c2,_0x263636){var _0x18fe3b=moment();var _0x3c17ab={'method':'POST','uri':_0x4aef38+_0x0c6c('0x32'),'body':{'title':intUtil[_0x0c6c('0x33')](_0x271bf0[_0x0c6c('0x34')],_0x44b331,'\x20'),'description':intUtil['getString'](_0x271bf0[_0x0c6c('0x35')],_0x44b331,'\x0a'),'owner_id':_0x511ef1[_0x0c6c('0x21')],'creater_id':_0x511ef1[_0x0c6c('0x14')],'targetable_id':_0x511ef1[_0x0c6c('0x2a')],'targetable_type':_0x0c6c('0x36'),'created_at':_0x18fe3b[_0x0c6c('0x27')]('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x18fe3b[_0x0c6c('0x37')](0x1e,'m')[_0x0c6c('0x27')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x3c17ab[_0x0c6c('0xe')]=_0x53ac2c;return rp(_0x3c17ab)[_0x0c6c('0x10')](function(_0x7a0e7b){_0x511ef1[_0x0c6c('0x38')]=_0x7a0e7b[_0x0c6c('0x39')]['id'];logger['info'](_0x0c6c('0x3a'),_0x511ef1[_0x0c6c('0x38')]);_0x5b23c2(_0x511ef1);})['catch'](function(_0x3a6bd5){logger[_0x0c6c('0x18')]('['+[_0x5688c1[_0x0c6c('0x19')]()]+']',_0x3a6bd5[_0x0c6c('0x1a')]);_0x263636(_0x3a6bd5[_0x0c6c('0x1a')]);});});};}function emit(_0x28dc67,_0x4c7d56,_0x4a5354){var _0x49b630={'uri':_0x28dc67+_0x0c6c('0x3b')+_0x4a5354};io['to'](util['format'](_0x0c6c('0x3c'),_0x4c7d56))[_0x0c6c('0x3d')](_0x0c6c('0x3e'),_0x49b630);}exports['cs']=function(_0x437b22,_0xd1a5f1,_0x7777aa,_0x387c28,_0x5a6773,_0x26d43e,_0x18dd2b,_0x411c0b){var _0x290b98={};var _0x2c0ee2={'Authorization':_0x0c6c('0x3f')+_0x26d43e[_0x0c6c('0x40')]};_0x26d43e['remoteUri']=intUtil['stripTrailingSlash'](_0x26d43e[_0x0c6c('0x41')]);_0x26d43e[_0x0c6c('0x42')]=intUtil['stripTrailingSlash'](_0x26d43e[_0x0c6c('0x42')]);var _0x5e2459=_0x26d43e[_0x0c6c('0x41')];_0x290b98['adminEmail']=_0x26d43e['username'];_0x290b98[_0x0c6c('0x28')]=_0x411c0b[_0x0c6c('0x43')]()==='outbound'?_0xd1a5f1[_0x0c6c('0x44')]:_0xd1a5f1[_0x0c6c('0x45')];_0x290b98[_0x0c6c('0x46')]=_0x411c0b==='queue'||_0x411c0b===_0x0c6c('0x47')?'queue':_0x0c6c('0x48');if(_0x387c28){_0x290b98['agentEmail']=_0x387c28[_0x0c6c('0x12')];}var _0x17086e=util[_0x0c6c('0x27')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x26d43e[_0x0c6c('0x42')],_0xd1a5f1[_0x0c6c('0x49')],md5(_0xd1a5f1[_0x0c6c('0x49')]));if(_0x5a6773&&_0x5a6773[_0x0c6c('0x4a')]){logger[_0x0c6c('0x1b')]('[QUEUE]','Recording\x20is\x20enabled!');_0xd1a5f1[_0x0c6c('0x4b')]=_0x17086e;}else if(_0x18dd2b&&_0x18dd2b[_0x0c6c('0x4c')]&&_0x18dd2b['recordingFormat']!==_0x0c6c('0x4d')){logger[_0x0c6c('0x1b')](_0x0c6c('0x4e'),_0x0c6c('0x4f'));_0xd1a5f1[_0x0c6c('0x4b')]=_0x17086e;}else{_0xd1a5f1['recordingURL']='';}return getAdminId(_0x290b98,_0x411c0b,_0x2c0ee2,_0x5e2459)[_0x0c6c('0x10')](getUser(_0x411c0b,_0x2c0ee2,_0x5e2459))[_0x0c6c('0x10')](getEndUser(_0x411c0b,_0x2c0ee2,_0x5e2459))[_0x0c6c('0x10')](getTicket(_0x411c0b,_0x2c0ee2,_0x5e2459,_0x7777aa,_0xd1a5f1))['then'](function(_0x37a680){logger[_0x0c6c('0x1b')](util[_0x0c6c('0x27')](_0x0c6c('0x50'),_0x37a680['ticketId']));if(_0x411c0b!==_0x0c6c('0x47')){logger[_0x0c6c('0x1b')]('['+[_0x411c0b[_0x0c6c('0x19')]()]+']',_0x0c6c('0x51'));emit(_0x5e2459,_0x387c28[_0x0c6c('0x52')],_0x37a680[_0x0c6c('0x2a')]);}})[_0x0c6c('0x17')](function(_0x391169){logger[_0x0c6c('0x18')]('['+[_0x411c0b['toUpperCase']()]+_0x0c6c('0x53'),util['inspect'](_0x391169,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x6f09=['mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20created:','POST','/api/contacts','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','getString','Subjects','Descriptions','Contact','add','ticketId','task','/contacts/','user:%s','emit','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','destcalleridnum','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/logger','freshsales','defaults','redis','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','users','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','message','then','Getting\x20user\x20with\x20email','agentEmail','userEmail','length','email','userId','User\x20found:','catch','error','toUpperCase','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber'];(function(_0x2c801e,_0x35485f){var _0x214743=function(_0x3d9f2c){while(--_0x3d9f2c){_0x2c801e['push'](_0x2c801e['shift']());}};_0x214743(++_0x35485f);}(_0x6f09,0x1ec));var _0x96f0=function(_0x27f019,_0x55a7f3){_0x27f019=_0x27f019-0x0;var _0x972691=_0x6f09[_0x27f019];return _0x972691;};'use strict';var _=require('lodash');var rp=require(_0x96f0('0x0'));var md5=require(_0x96f0('0x1'));var util=require(_0x96f0('0x2'));var moment=require(_0x96f0('0x3'));var Promise=require(_0x96f0('0x4'));var Redis=require(_0x96f0('0x5'));var intUtil=require(_0x96f0('0x6'));var config=require('../../../../config/environment');var logger=require(_0x96f0('0x7'))(_0x96f0('0x8'));config['redis']=_[_0x96f0('0x9')](config[_0x96f0('0xa')],{'host':_0x96f0('0xb'),'port':0x18eb});var io=require(_0x96f0('0xc'))(new Redis(config[_0x96f0('0xa')]));function getAdminId(_0x4d98ed,_0x53285f,_0x2617e9,_0xa2ecd8){return new Promise(function(_0x3a7056,_0xa14657){var _0x51240d=![];var _0x234123={'method':_0x96f0('0xd'),'uri':_0xa2ecd8+_0x96f0('0xe'),'json':!![]};_0x234123[_0x96f0('0xf')]=_0x2617e9;logger[_0x96f0('0x10')](_0x96f0('0x11'));return rp(_0x234123)['then'](function(_0x524ae9){if(_0x524ae9){var _0x3d1ec1=_0x524ae9[_0x96f0('0x12')];var _0xdb60e9=null;for(_0xdb60e9=0x0;_0xdb60e9<_0x3d1ec1['length'];_0xdb60e9++){if(_0x3d1ec1[_0xdb60e9]['email']===_0x4d98ed[_0x96f0('0x13')]){_0x4d98ed[_0x96f0('0x14')]=_0x3d1ec1[_0xdb60e9]['id'];_0x51240d=!![];}}if(_0x51240d){logger['info']('Admin\x20found:',_0x4d98ed[_0x96f0('0x14')]);_0x3a7056(_0x4d98ed);}else{_0xa14657({'statusCode':0x194,'message':_0x96f0('0x15')});}}else{_0xa14657({'statusCode':0x194,'message':_0x96f0('0x15')});}})['catch'](function(_0x40ca5c){logger['error']('['+[_0x53285f['toUpperCase']()]+']',_0x40ca5c[_0x96f0('0x16')]);_0xa14657(_0x40ca5c);});});}function getUser(_0x100460,_0x27de73,_0x2f27b1){return function(_0x3e73a9){return new Promise(function(_0x513dfc,_0x309be1){var _0x4c0976={'method':_0x96f0('0xd'),'uri':_0x2f27b1+_0x96f0('0xe'),'json':!![]};_0x4c0976[_0x96f0('0xf')]=_0x27de73;logger[_0x96f0('0x10')]('Getting\x20user\x20list');return rp(_0x4c0976)[_0x96f0('0x17')](function(_0x8cafda){if(_0x8cafda){var _0x2490f5=_0x8cafda[_0x96f0('0x12')];var _0x4a74af=![];var _0x934a1e=null;if(_0x3e73a9['agentEmail']!==null){logger['info'](_0x96f0('0x18'),_0x3e73a9[_0x96f0('0x19')]);_0x3e73a9[_0x96f0('0x1a')]=_0x3e73a9[_0x96f0('0x19')];for(_0x934a1e=0x0;_0x934a1e<_0x2490f5[_0x96f0('0x1b')];_0x934a1e++){if(_0x2490f5[_0x934a1e][_0x96f0('0x1c')]===_0x3e73a9['agentEmail']){_0x4a74af=!![];_0x3e73a9[_0x96f0('0x1d')]=_0x2490f5[_0x934a1e]['id'];logger['info'](_0x96f0('0x1e'),_0x3e73a9['userId']);}}}if(!_0x4a74af){logger[_0x96f0('0x10')]('Admin\x20selected');_0x3e73a9[_0x96f0('0x1a')]=_0x3e73a9[_0x96f0('0x13')];_0x3e73a9['userId']=_0x3e73a9['adminId'];_0x4a74af=!![];}if(_0x4a74af){_0x513dfc(_0x3e73a9);}else{_0x309be1({'statusCode':0x194,'message':_0x96f0('0x15')});}}else{_0x309be1({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x96f0('0x1f')](function(_0x57909c){logger[_0x96f0('0x20')]('['+[_0x100460[_0x96f0('0x21')]()]+']',_0x57909c[_0x96f0('0x16')]);_0x309be1(_0x57909c);});});};}function searchContact(_0x4b1444,_0x4742ba,_0x273a9c,_0x48285c){return new Promise(function(_0x337466,_0x5f538b){var _0xdb9fe6={'method':_0x96f0('0xd'),'headers':_0x4742ba,'uri':_0x4b1444+_0x96f0('0x22')+_0x48285c+_0x96f0('0x23')+_0x273a9c+_0x96f0('0x24'),'json':!![]};rp(_0xdb9fe6)['then'](function(_0x4a2ab3){var _0x184192=_[_0x96f0('0x25')](_0x4a2ab3[_0x96f0('0x26')][_0x96f0('0x26')],[_0x273a9c,_0x48285c]);_0x337466(_0x184192);})[_0x96f0('0x1f')](function(_0x5ac3cc){_0x5f538b(_0x5ac3cc);});});}function getEndUser(_0x25d223,_0x454499,_0x381fd1){return function(_0x130790){return new Promise(function(_0x16a7c8,_0x21eac1){logger[_0x96f0('0x10')](util[_0x96f0('0x27')](_0x96f0('0x28'),_0x130790[_0x96f0('0x29')]));searchContact(_0x381fd1,_0x454499,_0x96f0('0x2a'),_0x130790[_0x96f0('0x29')])[_0x96f0('0x17')](function(_0x150a9e){if(_0x150a9e){_0x130790[_0x96f0('0x2b')]=_0x150a9e['id'];logger[_0x96f0('0x10')](_0x96f0('0x2c'),_0x130790[_0x96f0('0x2b')]);return _0x16a7c8(_0x130790);}searchContact(_0x381fd1,_0x454499,_0x96f0('0x2d'),_0x130790['contactNumber'])[_0x96f0('0x17')](function(_0x4bc5fc){if(_0x4bc5fc){_0x130790[_0x96f0('0x2b')]=_0x4bc5fc['id'];logger['info']('Contact\x20found\x20work_number:',_0x130790['endUserId']);return _0x16a7c8(_0x130790);}createEndUser(_0x130790,_0x25d223,_0x454499,_0x381fd1)[_0x96f0('0x17')](function(_0x327cf4){logger[_0x96f0('0x10')](_0x96f0('0x2e'),_0x327cf4[_0x96f0('0x2b')]);return _0x16a7c8(_0x327cf4);});});})[_0x96f0('0x1f')](function(_0x464e8f){_0x21eac1(_0x464e8f);});});};}function createEndUser(_0x560d7b,_0x257de4,_0x3d8d28,_0x1bb2bd){return new Promise(function(_0x242373,_0x5506d2){var _0x564bc9=moment();var _0x3c97fa={'method':_0x96f0('0x2f'),'uri':_0x1bb2bd+_0x96f0('0x30'),'body':{'contact':{'last_name':_0x560d7b[_0x96f0('0x29')],'work_number':_0x560d7b[_0x96f0('0x29')],'mobile_number':_0x560d7b[_0x96f0('0x29')],'owner_id':_0x560d7b['userId'],'created_at':_0x564bc9['format'](_0x96f0('0x31'))}},'json':!![]};_0x3c97fa['headers']=_0x3d8d28;logger[_0x96f0('0x10')](_0x96f0('0x32'));return rp(_0x3c97fa)[_0x96f0('0x17')](function(_0x316f36){_0x560d7b[_0x96f0('0x2b')]=_0x316f36[_0x96f0('0x33')]['id'];_0x242373(_0x560d7b);})[_0x96f0('0x1f')](function(_0x41e454){logger[_0x96f0('0x20')]('['+[_0x257de4[_0x96f0('0x21')]()]+']',_0x41e454['message']);_0x5506d2(_0x41e454['message']);});});}function getTicket(_0xabac98,_0xb17803,_0x164256,_0xd7d6ae,_0x1d2fe4){return function(_0x14ee68){logger[_0x96f0('0x10')](_0x96f0('0x34'));return new Promise(function(_0x4be472,_0x505faa){var _0x2f6932=moment();var _0x187ec5={'method':_0x96f0('0x2f'),'uri':_0x164256+'/api/tasks','body':{'title':intUtil[_0x96f0('0x35')](_0xd7d6ae[_0x96f0('0x36')],_0x1d2fe4,'\x20'),'description':intUtil[_0x96f0('0x35')](_0xd7d6ae[_0x96f0('0x37')],_0x1d2fe4,'\x0a'),'owner_id':_0x14ee68[_0x96f0('0x1d')],'creater_id':_0x14ee68[_0x96f0('0x14')],'targetable_id':_0x14ee68[_0x96f0('0x2b')],'targetable_type':_0x96f0('0x38'),'created_at':_0x2f6932['format']('YYYY-MM-DDTHH:mm:ss'),'due_date':_0x2f6932[_0x96f0('0x39')](0x1e,'m')[_0x96f0('0x27')]('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x187ec5['headers']=_0xb17803;return rp(_0x187ec5)[_0x96f0('0x17')](function(_0x87c5da){_0x14ee68[_0x96f0('0x3a')]=_0x87c5da[_0x96f0('0x3b')]['id'];logger['info']('Task\x20created:',_0x14ee68[_0x96f0('0x3a')]);_0x4be472(_0x14ee68);})[_0x96f0('0x1f')](function(_0x5b5273){logger[_0x96f0('0x20')]('['+[_0xabac98[_0x96f0('0x21')]()]+']',_0x5b5273['message']);_0x505faa(_0x5b5273[_0x96f0('0x16')]);});});};}function emit(_0x5147b9,_0x59149b,_0x39a357){var _0x5ccfe8={'uri':_0x5147b9+_0x96f0('0x3c')+_0x39a357};io['to'](util['format'](_0x96f0('0x3d'),_0x59149b))[_0x96f0('0x3e')]('trigger:browser:url',_0x5ccfe8);}exports['cs']=function(_0x2f7f8d,_0x3507d2,_0x27ec71,_0x17dc92,_0x4b7674,_0x150553,_0x4f29ab,_0x77ca57){var _0x562e66={};var _0x174bf9={'Authorization':_0x96f0('0x3f')+_0x150553[_0x96f0('0x40')]};_0x150553[_0x96f0('0x41')]=intUtil[_0x96f0('0x42')](_0x150553[_0x96f0('0x41')]);_0x150553[_0x96f0('0x43')]=intUtil[_0x96f0('0x42')](_0x150553[_0x96f0('0x43')]);var _0x1756cb=_0x150553[_0x96f0('0x41')];_0x562e66['adminEmail']=_0x150553[_0x96f0('0x44')];_0x562e66[_0x96f0('0x29')]=_0x77ca57[_0x96f0('0x45')]()==='outbound'?_0x3507d2[_0x96f0('0x46')]:_0x3507d2['calleridnum'];_0x562e66[_0x96f0('0x47')]=_0x77ca57===_0x96f0('0x48')||_0x77ca57===_0x96f0('0x49')?_0x96f0('0x48'):_0x96f0('0x4a');if(_0x17dc92){_0x562e66[_0x96f0('0x19')]=_0x17dc92[_0x96f0('0x1c')];}var _0x56544b=util['format'](_0x96f0('0x4b'),_0x150553[_0x96f0('0x43')],_0x3507d2[_0x96f0('0x4c')],md5(_0x3507d2[_0x96f0('0x4c')]));if(_0x4b7674&&_0x4b7674[_0x96f0('0x4d')]){logger[_0x96f0('0x10')](_0x96f0('0x4e'),_0x96f0('0x4f'));_0x3507d2[_0x96f0('0x50')]=_0x56544b;}else if(_0x4f29ab&&_0x4f29ab['recordingFormat']&&_0x4f29ab[_0x96f0('0x51')]!==_0x96f0('0x52')){logger[_0x96f0('0x10')](_0x96f0('0x53'),_0x96f0('0x4f'));_0x3507d2[_0x96f0('0x50')]=_0x56544b;}else{_0x3507d2[_0x96f0('0x50')]='';}return getAdminId(_0x562e66,_0x77ca57,_0x174bf9,_0x1756cb)['then'](getUser(_0x77ca57,_0x174bf9,_0x1756cb))[_0x96f0('0x17')](getEndUser(_0x77ca57,_0x174bf9,_0x1756cb))[_0x96f0('0x17')](getTicket(_0x77ca57,_0x174bf9,_0x1756cb,_0x27ec71,_0x3507d2))[_0x96f0('0x17')](function(_0x24117b){logger[_0x96f0('0x10')](util[_0x96f0('0x27')](_0x96f0('0x54'),_0x24117b[_0x96f0('0x3a')]));if(_0x77ca57!==_0x96f0('0x49')){logger[_0x96f0('0x10')]('['+[_0x77ca57[_0x96f0('0x21')]()]+']',_0x96f0('0x55'));emit(_0x1756cb,_0x17dc92[_0x96f0('0x56')],_0x24117b[_0x96f0('0x2b')]);}})[_0x96f0('0x1f')](function(_0x1eff73){logger[_0x96f0('0x20')]('['+[_0x77ca57[_0x96f0('0x21')]()]+_0x96f0('0x57'),util[_0x96f0('0x58')](_0x1eff73,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index c8d9a0e..324f8d8 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc551=['servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','vtiger','unknown\x20integration','error','[EXEC]','format','../../../../config/logger','util','./zendesk','./salesforce','./sugarcrm','./desk','./vtiger','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','dynamics365','freshsales'];(function(_0x7ecd61,_0x28c775){var _0x67d35d=function(_0x103519){while(--_0x103519){_0x7ecd61['push'](_0x7ecd61['shift']());}};_0x67d35d(++_0x28c775);}(_0xc551,0x1d1));var _0x1c55=function(_0x150e6b,_0x3b8604){_0x150e6b=_0x150e6b-0x0;var _0x22a4e5=_0xc551[_0x150e6b];return _0x22a4e5;};'use strict';var _=require('lodash');var util=require(_0x1c55('0x0'));var zendesk=require(_0x1c55('0x1'));var salesforce=require(_0x1c55('0x2'));var sugarcrm=require(_0x1c55('0x3'));var freshdesk=require('./freshdesk');var zoho=require('./zoho');var desk=require(_0x1c55('0x4'));var vtiger=require(_0x1c55('0x5'));var servicenow=require('./servicenow');var dynamics365=require(_0x1c55('0x6'));var freshsales=require(_0x1c55('0x7'));var integrations=[_0x1c55('0x8'),_0x1c55('0x9'),_0x1c55('0xa'),_0x1c55('0xb'),_0x1c55('0xc'),_0x1c55('0xd'),'vtiger',_0x1c55('0xe'),_0x1c55('0xf'),_0x1c55('0x10')];exports[_0x1c55('0x11')]=function(_0x319d9b,_0x42f2eb,_0x424a1d,_0x18e6af,_0x488ab0,_0x5e460b){if(_0x424a1d){if(_[_0x1c55('0x12')](integrations,_0x319d9b[_0x1c55('0x13')][_0x1c55('0x14')]())){try{var _0x29f7df=null;var _0xaa41ae='';var _0x5549a2=_0x424a1d[_0x319d9b[_0x1c55('0x13')][_0x1c55('0x14')]()];if(_0x5549a2){var _0x34ab5e=_0x5549a2[_0x319d9b[_0x1c55('0x15')]];if(_0x34ab5e){var _0x31c6a4=_[_0x1c55('0x16')](_0x34ab5e[_0x1c55('0x17')],{'id':parseInt(_0x319d9b[_0x1c55('0x18')],0xa)});if(_0x31c6a4){if(_0x18e6af){if(_0x488ab0&&_0x42f2eb[_0x1c55('0x19')]){_0xaa41ae=_0x1c55('0x19');}else if(_0x42f2eb[_0x1c55('0x1a')]){_0xaa41ae=_0x1c55('0x1b');}else{console[_0x1c55('0x1c')](_0x1c55('0x1d'),_0x42f2eb);}}else{_0xaa41ae=_0x1c55('0x1e');}switch(_0x319d9b[_0x1c55('0x13')]['toLowerCase']()){case _0x1c55('0x8'):zendesk[_0xaa41ae](_0x319d9b,_0x42f2eb,_0x31c6a4,_0x18e6af,_0x488ab0,_0x34ab5e,_0x5e460b);break;case'salesforce':salesforce[_0xaa41ae](_0x319d9b,_0x42f2eb,_0x31c6a4,_0x18e6af,_0x488ab0,_0x34ab5e,_0x5e460b);break;case _0x1c55('0xa'):sugarcrm[_0xaa41ae](_0x319d9b,_0x42f2eb,_0x31c6a4,_0x18e6af,_0x488ab0,_0x34ab5e,_0x5e460b);break;case _0x1c55('0xb'):freshdesk[_0xaa41ae](_0x319d9b,_0x42f2eb,_0x31c6a4,_0x18e6af,_0x488ab0,_0x34ab5e,_0x5e460b);break;case'zoho':zoho[_0xaa41ae](_0x319d9b,_0x42f2eb,_0x31c6a4,_0x18e6af,_0x488ab0,_0x34ab5e,_0x5e460b);break;case _0x1c55('0xd'):desk[_0xaa41ae](_0x319d9b,_0x42f2eb,_0x31c6a4,_0x18e6af,_0x488ab0,_0x34ab5e,_0x5e460b);break;case _0x1c55('0x1f'):vtiger[_0xaa41ae](_0x319d9b,_0x42f2eb,_0x31c6a4,_0x18e6af,_0x488ab0,_0x34ab5e,_0x5e460b);break;case _0x1c55('0xf'):freshsales['cs'](_0x319d9b,_0x42f2eb,_0x31c6a4,_0x18e6af,_0x488ab0,_0x34ab5e,_0x5e460b,_0xaa41ae);break;case _0x1c55('0x10'):servicenow['cs'](_0x319d9b,_0x42f2eb,_0x31c6a4,_0x18e6af,_0x488ab0,_0x34ab5e,_0x5e460b,_0xaa41ae);break;case'dynamics365':dynamics365['cs'](_0x319d9b,_0x42f2eb,_0x31c6a4,_0x18e6af,_0x488ab0,_0x34ab5e,_0x5e460b,_0xaa41ae);break;default:console[_0x1c55('0x1c')](_0x1c55('0x20'));}}else{_0x29f7df=require('../../../../config/logger')(_0x319d9b[_0x1c55('0x13')][_0x1c55('0x14')]());_0x29f7df[_0x1c55('0x21')](_0x1c55('0x22'),util[_0x1c55('0x23')]('%s\x20configuration\x20#%s\x20not\x20found',_0x319d9b[_0x1c55('0x13')]['toLowerCase'](),_0x319d9b[_0x1c55('0x18')]));}}else{_0x29f7df=require(_0x1c55('0x24'))(_0x319d9b['data1'][_0x1c55('0x14')]());_0x29f7df[_0x1c55('0x21')](_0x1c55('0x22'),util[_0x1c55('0x23')]('%s\x20account\x20#%s\x20not\x20found',_0x319d9b['data1'][_0x1c55('0x14')](),_0x319d9b[_0x1c55('0x15')]));}}else{}}catch(_0x355d08){console[_0x1c55('0x21')](_0x355d08);}}}};
\ No newline at end of file
+var _0xf278=['%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./servicenow','./dynamics365','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','toLowerCase','data1','data2','find','data3','queue','routeId','outbound','log','EVENT\x20UNKNOWN','unmanaged','zendesk','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found'];(function(_0x21333c,_0x4fbbff){var _0x3a4dd6=function(_0x241665){while(--_0x241665){_0x21333c['push'](_0x21333c['shift']());}};_0x3a4dd6(++_0x4fbbff);}(_0xf278,0xeb));var _0x8f27=function(_0x40b2ed,_0x2b1765){_0x40b2ed=_0x40b2ed-0x0;var _0x18397d=_0xf278[_0x40b2ed];return _0x18397d;};'use strict';var _=require(_0x8f27('0x0'));var util=require(_0x8f27('0x1'));var zendesk=require(_0x8f27('0x2'));var salesforce=require(_0x8f27('0x3'));var sugarcrm=require(_0x8f27('0x4'));var freshdesk=require(_0x8f27('0x5'));var zoho=require(_0x8f27('0x6'));var desk=require(_0x8f27('0x7'));var vtiger=require('./vtiger');var servicenow=require(_0x8f27('0x8'));var dynamics365=require(_0x8f27('0x9'));var freshsales=require('./freshsales');var integrations=['zendesk',_0x8f27('0xa'),_0x8f27('0xb'),_0x8f27('0xc'),_0x8f27('0xd'),_0x8f27('0xe'),_0x8f27('0xf'),_0x8f27('0x10'),_0x8f27('0x11'),_0x8f27('0x12')];exports[_0x8f27('0x13')]=function(_0x33c6a5,_0x5e77d5,_0x2f0ba2,_0x131434,_0xfd4610,_0x12576a){if(_0x2f0ba2){if(_['includes'](integrations,_0x33c6a5['data1'][_0x8f27('0x14')]())){try{var _0x389bab=null;var _0x2daf57='';var _0x44543d=_0x2f0ba2[_0x33c6a5[_0x8f27('0x15')][_0x8f27('0x14')]()];if(_0x44543d){var _0x15ed7d=_0x44543d[_0x33c6a5[_0x8f27('0x16')]];if(_0x15ed7d){var _0x348b6e=_[_0x8f27('0x17')](_0x15ed7d['Configurations'],{'id':parseInt(_0x33c6a5[_0x8f27('0x18')],0xa)});if(_0x348b6e){if(_0x131434){if(_0xfd4610&&_0x5e77d5[_0x8f27('0x19')]){_0x2daf57=_0x8f27('0x19');}else if(_0x5e77d5[_0x8f27('0x1a')]){_0x2daf57=_0x8f27('0x1b');}else{console[_0x8f27('0x1c')](_0x8f27('0x1d'),_0x5e77d5);}}else{_0x2daf57=_0x8f27('0x1e');}switch(_0x33c6a5[_0x8f27('0x15')][_0x8f27('0x14')]()){case _0x8f27('0x1f'):zendesk[_0x2daf57](_0x33c6a5,_0x5e77d5,_0x348b6e,_0x131434,_0xfd4610,_0x15ed7d,_0x12576a);break;case _0x8f27('0xa'):salesforce[_0x2daf57](_0x33c6a5,_0x5e77d5,_0x348b6e,_0x131434,_0xfd4610,_0x15ed7d,_0x12576a);break;case _0x8f27('0xb'):sugarcrm[_0x2daf57](_0x33c6a5,_0x5e77d5,_0x348b6e,_0x131434,_0xfd4610,_0x15ed7d,_0x12576a);break;case _0x8f27('0xc'):freshdesk[_0x2daf57](_0x33c6a5,_0x5e77d5,_0x348b6e,_0x131434,_0xfd4610,_0x15ed7d,_0x12576a);break;case'zoho':zoho[_0x2daf57](_0x33c6a5,_0x5e77d5,_0x348b6e,_0x131434,_0xfd4610,_0x15ed7d,_0x12576a);break;case _0x8f27('0xe'):desk[_0x2daf57](_0x33c6a5,_0x5e77d5,_0x348b6e,_0x131434,_0xfd4610,_0x15ed7d,_0x12576a);break;case'vtiger':vtiger[_0x2daf57](_0x33c6a5,_0x5e77d5,_0x348b6e,_0x131434,_0xfd4610,_0x15ed7d,_0x12576a);break;case'freshsales':freshsales['cs'](_0x33c6a5,_0x5e77d5,_0x348b6e,_0x131434,_0xfd4610,_0x15ed7d,_0x12576a,_0x2daf57);break;case'servicenow':servicenow['cs'](_0x33c6a5,_0x5e77d5,_0x348b6e,_0x131434,_0xfd4610,_0x15ed7d,_0x12576a,_0x2daf57);break;case _0x8f27('0x10'):dynamics365['cs'](_0x33c6a5,_0x5e77d5,_0x348b6e,_0x131434,_0xfd4610,_0x15ed7d,_0x12576a,_0x2daf57);break;default:console[_0x8f27('0x1c')](_0x8f27('0x20'));}}else{_0x389bab=require(_0x8f27('0x21'))(_0x33c6a5[_0x8f27('0x15')][_0x8f27('0x14')]());_0x389bab[_0x8f27('0x22')](_0x8f27('0x23'),util[_0x8f27('0x24')](_0x8f27('0x25'),_0x33c6a5[_0x8f27('0x15')][_0x8f27('0x14')](),_0x33c6a5[_0x8f27('0x18')]));}}else{_0x389bab=require(_0x8f27('0x21'))(_0x33c6a5['data1']['toLowerCase']());_0x389bab['error'](_0x8f27('0x23'),util[_0x8f27('0x24')](_0x8f27('0x26'),_0x33c6a5[_0x8f27('0x15')][_0x8f27('0x14')](),_0x33c6a5[_0x8f27('0x16')]));}}else{}}catch(_0x10fee2){console['error'](_0x10fee2);}}}};
\ No newline at end of file
index fa0d128..a969d2b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0516=['Account','Phone','attributes','type','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','<unknown>','format','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','create','includes','string','picklist','idField','content','toString','variable','variableName','Variable','name','password','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','Connection\x20established.','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','none','[OUTBOUND]','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','unmanaged','lastevent',']\x20Ticket\x20%s\x20created.','toUpperCase',']\x20Integration\x20account\x20type\x20%s.','request-promise','moment','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','assign','getString','Subjects','Descriptions','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','ticketType','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','isNil','validateEmail','User','find','execute','then','length','Agent\x20%s\x20found.','resolve','Name','identity','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','additionalSearchContact','$or','Contact','additionalSearchLead','merge','Lead','cloneDeep','additionalSearchAccount'];(function(_0x10e36f,_0x97a78f){var _0x1ac5ec=function(_0x1258b5){while(--_0x1258b5){_0x10e36f['push'](_0x10e36f['shift']());}};_0x1ac5ec(++_0x97a78f);}(_0x0516,0x14b));var _0x6051=function(_0x1e41ba,_0x455a21){_0x1e41ba=_0x1e41ba-0x0;var _0x201d61=_0x0516[_0x1e41ba];return _0x201d61;};'use strict';var _=require('lodash');var rp=require(_0x6051('0x0'));var moment=require(_0x6051('0x1'));var BPromise=require(_0x6051('0x2'));var md5=require(_0x6051('0x3'));var jsforce=require(_0x6051('0x4'));var util=require(_0x6051('0x5'));var Redis=require(_0x6051('0x6'));var intUtil=require(_0x6051('0x7'));var config=require(_0x6051('0x8'));var logger=require(_0x6051('0x9'))(_0x6051('0xa'));config[_0x6051('0xb')]=_[_0x6051('0xc')](config['redis'],{'host':_0x6051('0xd'),'port':0x18eb});var io=require(_0x6051('0xe'))(new Redis(config[_0x6051('0xb')]));function emit(_0x36599a,_0x2bf309,_0x18bc85){io['to'](_0x36599a)[_0x6051('0xf')](_0x2bf309,_0x18bc85);}function getTicket(_0x5e9141,_0xfc5591,_0x6e9745,_0xdac55e,_0x360da1,_0x2348f5,_0x24610e,_0x14090c){var _0x436daf=Object[_0x6051('0x10')]({},{'OwnerId':_0xfc5591['id'],'Subject':intUtil[_0x6051('0x11')](_0xdac55e[_0x6051('0x12')],_0x360da1,'\x20'),'Description':intUtil[_0x6051('0x11')](_0xdac55e[_0x6051('0x13')],_0x360da1,'\x0a')},getCustomFields(_0x2348f5,_0x360da1));if(_0x6e9745){if(_0xdac55e['ticketType']===_0x6051('0x14')){_0x436daf[_0x6051('0x15')]=moment[_0x6051('0x16')]();_0x436daf[_0x6051('0x17')]=![];_0x436daf[_0x6051('0x18')]=![];if(_0x6e9745[_0x6051('0x19')]===_0x6051('0x1a')||_0x6e9745['endUserType']===_0x6051('0x1b')){_0x436daf[_0x6051('0x1c')]=_0x6e9745['id'];}else if(_0x6e9745[_0x6051('0x19')]===_0x6051('0x1d')){_0x436daf['WhatId']=_0x6e9745['id'];}}else if(_0xdac55e[_0x6051('0x1e')]==='Case'){if(_0x6e9745[_0x6051('0x19')]==='contact'){_0x436daf[_0x6051('0x1f')]=_0x6e9745['id'];}else if(_0x6e9745[_0x6051('0x19')]===_0x6051('0x1d')){_0x436daf[_0x6051('0x20')]=_0x6e9745['id'];}else if(_0x6e9745[_0x6051('0x19')]===_0x6051('0x1b')&&_0xdac55e[_0x6051('0x21')]){_0x436daf[_0xdac55e[_0x6051('0x21')]]=_0x6e9745['id'];}else{logger[_0x6051('0x22')](_0x6051('0x23'));}}}return _0x24610e[_0x6051('0x24')](_0xdac55e[_0x6051('0x1e')])['create'](_0x436daf);}function getUser(_0x530f9a,_0xb42d13,_0x8ed5ac){if(!_[_0x6051('0x25')](_0xb42d13)&&intUtil[_0x6051('0x26')](_0xb42d13)){var _0x588077={'Email':_0xb42d13};var _0x1c3acf={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x8ed5ac[_0x6051('0x24')](_0x6051('0x27'))[_0x6051('0x28')](_0x588077,_0x1c3acf)[_0x6051('0x29')]()[_0x6051('0x2a')](function(_0x2aa069){if(_0x2aa069[_0x6051('0x2b')]){var _0x457d3d=_[_0x6051('0x28')](_0x2aa069,function(_0x1bd717){return _0x1bd717['Email']===_0xb42d13;});if(_0x457d3d){logger[_0x6051('0x22')](_0x6051('0x2c'),_0xb42d13);return BPromise[_0x6051('0x2d')]({'id':_0x457d3d['Id'],'name':_0x457d3d[_0x6051('0x2e')]});}}else{logger[_0x6051('0x22')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0xb42d13);return _0x8ed5ac[_0x6051('0x2f')]()['then'](function(_0x2f62f2){return BPromise[_0x6051('0x2d')]({'id':_0x2f62f2[_0x6051('0x30')],'name':_0x2f62f2[_0x6051('0x31')]});});}});}else{logger['info'](_0x6051('0x32'),_0xb42d13);return _0x8ed5ac[_0x6051('0x2f')]()['then'](function(_0x19adf1){return BPromise[_0x6051('0x2d')]({'id':_0x19adf1[_0x6051('0x30')],'name':_0x19adf1[_0x6051('0x31')]});});}}function getEndUser(_0x5474e9,_0x55529b,_0x204123,_0xa94318,_0x43351d){var _0x18895b={'$or':{'Phone':_0xa94318}};var _0x2d7606={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x6051('0x2d')]()[_0x6051('0x2a')](function(){logger[_0x6051('0x22')](_0x6051('0x33'),_0xa94318,_0x55529b[_0x6051('0x34')]);switch(_0x55529b[_0x6051('0x34')]){case _0x6051('0x35'):var _0x5d0827=_['cloneDeep'](_0x18895b);if(_0x55529b[_0x6051('0x36')]){var _0x255e44={};_0x255e44[_0x55529b[_0x6051('0x36')]]=_0xa94318;_['merge'](_0x5d0827[_0x6051('0x37')],_0x255e44);}return _0x43351d[_0x6051('0x24')](_0x6051('0x38'))[_0x6051('0x28')](_0x5d0827,_0x2d7606)[_0x6051('0x29')]()[_0x6051('0x2a')](function(_0x44b37f){if(_0x44b37f&&_0x44b37f[_0x6051('0x2b')]){return _0x44b37f;}else{var _0x370ceb=_['cloneDeep'](_0x18895b);if(_0x55529b['additionalSearchLead']){var _0x11793e={};_0x11793e[_0x55529b[_0x6051('0x39')]]=_0xa94318;_[_0x6051('0x3a')](_0x370ceb['$or'],_0x11793e);}return _0x43351d[_0x6051('0x24')](_0x6051('0x3b'))[_0x6051('0x28')](_0x370ceb,_0x2d7606);}});case'account_contact_lead':var _0xb8e58b=_[_0x6051('0x3c')](_0x18895b);if(_0x55529b[_0x6051('0x3d')]){var _0x255e44={};_0x255e44[_0x55529b[_0x6051('0x3d')]]=_0xa94318;_[_0x6051('0x3a')](_0xb8e58b[_0x6051('0x37')],_0x255e44);}return _0x43351d[_0x6051('0x24')]('Account')[_0x6051('0x28')](_0xb8e58b,_0x2d7606)['execute']()['then'](function(_0x1c2394){if(_0x1c2394&&_0x1c2394[_0x6051('0x2b')]){return _0x1c2394;}else{var _0x509075=_['cloneDeep'](_0x18895b);if(_0x55529b[_0x6051('0x36')]){var _0x19b521={};_0x19b521[_0x55529b[_0x6051('0x36')]]=_0xa94318;_[_0x6051('0x3a')](_0x509075['$or'],_0x19b521);}return _0x43351d[_0x6051('0x24')](_0x6051('0x38'))[_0x6051('0x28')](_0x509075,_0x2d7606)[_0x6051('0x2a')](function(_0x3f9107){if(_0x3f9107&&_0x3f9107['length']){return _0x3f9107;}else{var _0x5a6bca=_['cloneDeep'](_0x18895b);if(_0x55529b[_0x6051('0x39')]){var _0x32dd8d={};_0x32dd8d[_0x55529b[_0x6051('0x39')]]=_0xa94318;_['merge'](_0x5a6bca[_0x6051('0x37')],_0x32dd8d);}return _0x43351d[_0x6051('0x24')](_0x6051('0x3b'))[_0x6051('0x28')](_0x5a6bca,_0x2d7606);}});}});case _0x6051('0x1a'):var _0x5d0827=_['cloneDeep'](_0x18895b);if(_0x55529b[_0x6051('0x36')]){var _0x255e44={};_0x255e44[_0x55529b[_0x6051('0x36')]]=_0xa94318;_[_0x6051('0x3a')](_0x5d0827[_0x6051('0x37')],_0x255e44);}return _0x43351d[_0x6051('0x24')](_0x6051('0x38'))['find'](_0x5d0827,_0x2d7606)[_0x6051('0x29')]();case _0x6051('0x1b'):var _0x178905=_[_0x6051('0x3c')](_0x18895b);if(_0x55529b[_0x6051('0x39')]){var _0x255e44={};_0x255e44[_0x55529b[_0x6051('0x39')]]=_0xa94318;_['merge'](_0x178905[_0x6051('0x37')],_0x255e44);}return _0x43351d[_0x6051('0x24')](_0x6051('0x3b'))[_0x6051('0x28')](_0x178905,_0x2d7606);case _0x6051('0x1d'):var _0xb8e58b=_[_0x6051('0x3c')](_0x18895b);if(_0x55529b[_0x6051('0x3d')]){var _0x255e44={};_0x255e44[_0x55529b[_0x6051('0x3d')]]=_0xa94318;_[_0x6051('0x3a')](_0xb8e58b[_0x6051('0x37')],_0x255e44);}return _0x43351d[_0x6051('0x24')](_0x6051('0x3e'))[_0x6051('0x28')](_0xb8e58b,_0x2d7606);default:return null;}})[_0x6051('0x2a')](function(_0x2827a8){if(_0x2827a8&&_0x2827a8['length']){var _0x508837=_['first'](_0x2827a8);if(_0x508837){return BPromise[_0x6051('0x2d')]({'id':_0x508837['Id'],'name':_0x508837[_0x6051('0x2e')],'phone':_0x508837[_0x6051('0x3f')],'endUserType':_0x508837[_0x6051('0x40')][_0x6051('0x41')][_0x6051('0x42')]()});}}})['then'](function(_0x13c273){if(_0x13c273){logger[_0x6051('0x22')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x13c273[_0x6051('0x19')],_0xa94318);return BPromise['resolve'](_0x13c273);}else{logger[_0x6051('0x22')](_0x6051('0x43'),_0xa94318);var _0x290389={'Phone':_0xa94318};if(_0x55529b[_0x6051('0x44')]){if(_0x55529b[_0x6051('0x44')]===_0x6051('0x1a')){logger['info']('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0xa94318,_0x55529b[_0x6051('0x44')]);_0x290389[_0x6051('0x45')]=_0x204123!==_0x6051('0x46')?_0x204123:util[_0x6051('0x47')](_0x6051('0x48'),_0xa94318);}else if(_0x55529b[_0x6051('0x44')]===_0x6051('0x1b')){logger['info'](_0x6051('0x49'),_0xa94318,_0x55529b['moduleCreate']);_0x290389['LastName']=_0x204123!==_0x6051('0x46')?_0x204123:util[_0x6051('0x47')]('Caller\x20-\x20%s',_0xa94318);_0x290389[_0x6051('0x4a')]=_0x6051('0x4b');}else if(_0x55529b[_0x6051('0x44')]===_0x6051('0x1d')){logger[_0x6051('0x22')](_0x6051('0x49'),_0xa94318,_0x55529b['moduleCreate']);_0x290389[_0x6051('0x2e')]=_0x204123!==_0x6051('0x46')?_0x204123:util[_0x6051('0x47')]('Caller\x20-\x20%s',_0xa94318);}else{return null;}}return _0x43351d[_0x6051('0x24')](_[_0x6051('0x4c')](_0x55529b[_0x6051('0x44')]))[_0x6051('0x4d')](_0x290389)[_0x6051('0x2a')](function(_0x1c65ca){return BPromise[_0x6051('0x2d')]({'id':_0x1c65ca['id'],'endUserType':_0x55529b[_0x6051('0x44')]});});}});}function getCustomFields(_0x547b5e,_0x1f17a1){var _0x1d3e0d={};if(_0x547b5e[_0x6051('0x2b')]>0x0){_['forEach'](_0x547b5e,function(_0x5b74db){if(_[_0x6051('0x4e')]([_0x6051('0x4f'),_0x6051('0x50')],_0x5b74db[_0x6051('0x41')])&&_0x5b74db[_0x6051('0x51')]){_0x1d3e0d[_0x5b74db[_0x6051('0x51')]]=_0x5b74db[_0x6051('0x52')][_0x6051('0x53')]();}else if(_0x5b74db['type']===_0x6051('0x54')&&_0x5b74db['variableName']&&_0x5b74db[_0x6051('0x51')]){_0x1f17a1[_0x5b74db['variableName']]&&(_0x1d3e0d[_0x5b74db[_0x6051('0x51')]]=_0x1f17a1[_0x5b74db[_0x6051('0x55')]][_0x6051('0x53')]());}else if(_0x5b74db[_0x6051('0x41')]==='customVariable'&&_0x5b74db[_0x6051('0x56')]&&_0x5b74db[_0x6051('0x56')][_0x6051('0x57')]&&_0x5b74db[_0x6051('0x51')]){_0x1f17a1[_0x5b74db['Variable'][_0x6051('0x57')]['toLowerCase']()]&&(_0x1d3e0d[_0x5b74db['idField']]=_0x1f17a1[_0x5b74db[_0x6051('0x56')][_0x6051('0x57')]['toLowerCase']()][_0x6051('0x53')]());}});}return _0x1d3e0d;}function getConnection(_0x1a7b16){var _0x278fcf=_0x1a7b16[_0x6051('0x58')]['concat'](_0x1a7b16[_0x6051('0x59')]);var _0x3e572a=new jsforce[(_0x6051('0x5a'))]({'oauth2':{'loginUrl':_0x1a7b16[_0x6051('0x5b')]||_0x6051('0x5c'),'clientId':_0x1a7b16[_0x6051('0x5d')],'clientSecret':_0x1a7b16[_0x6051('0x5e')]}});return _0x3e572a[_0x6051('0x5f')](_0x1a7b16['username'],_0x278fcf)[_0x6051('0x2a')](function(){logger['info'](_0x6051('0x60'));return _0x3e572a;});}exports[_0x6051('0x61')]=function(_0x2071a1,_0x5b1846,_0x22cd07,_0x52008f,_0x3842a0,_0x188748){var _0x1b7068,_0x1c6d58,_0x266a51,_0x17043f;_0x188748['serverUrl']=intUtil[_0x6051('0x62')](_0x188748['serverUrl']);_0x188748['remoteUri']=intUtil[_0x6051('0x62')](_0x188748[_0x6051('0x5b')]);if(_0x3842a0&&_0x3842a0[_0x6051('0x63')]){logger['info'](_0x6051('0x64'),_0x6051('0x65'));_0x5b1846[_0x6051('0x66')]=util[_0x6051('0x47')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x188748[_0x6051('0x67')],_0x5b1846['uniqueid'],md5(_0x5b1846[_0x6051('0x68')]));}else{_0x5b1846['recordingURL']='';}return getConnection(_0x188748)[_0x6051('0x2a')](function(_0x32446d){_0x17043f=_0x32446d;return getUser(_0x188748,_0x52008f[_0x6051('0x69')],_0x17043f);})[_0x6051('0x2a')](function(_0x3efe98){_0x1b7068=_0x3efe98;return getEndUser(_0x188748,_0x22cd07,_0x5b1846[_0x6051('0x6a')],_0x5b1846[_0x6051('0x6b')],_0x17043f);})[_0x6051('0x2a')](function(_0x4d04da){_0x1c6d58=_0x4d04da;return getTicket(_0x188748,_0x1b7068,_0x1c6d58,_0x22cd07,_0x5b1846,_0x22cd07[_0x6051('0x6c')],_0x17043f,_0x6051('0x61'));})[_0x6051('0x2a')](function(_0x1e697e){_0x266a51=_0x1e697e;logger['info'](_0x6051('0x6d'),_0x266a51['id']);logger[_0x6051('0x22')](_0x6051('0x6e'),_0x266a51['id'],_0x52008f['name'],_0x188748[_0x6051('0x41')]);switch(_0x188748[_0x6051('0x41')]){case'integrationTab':emit(util[_0x6051('0x47')]('user:%s',_0x52008f['name']),'trigger:salesforce:display',{'recordId':_0x266a51['id']});break;case _0x6051('0x6f'):emit(util[_0x6051('0x47')](_0x6051('0x70'),_0x52008f[_0x6051('0x57')]),_0x6051('0x71'),{'uri':util['format'](_0x6051('0x72'),_0x17043f[_0x6051('0x73')],_0x266a51['id'])});break;default:logger[_0x6051('0x74')](_0x6051('0x75'));}})[_0x6051('0x76')](function(_0x44ca37){logger[_0x6051('0x74')](_0x6051('0x64'),_0x44ca37);});};exports['outbound']=function(_0x43718e,_0x1e4047,_0x43e6c6,_0x240607,_0x5a2ccf,_0x110f68,_0x5d6e21){var _0x1cca10,_0x5669ef,_0x4fba9d,_0x18d078;_0x110f68['serverUrl']=intUtil['stripTrailingSlash'](_0x110f68[_0x6051('0x67')]);_0x110f68[_0x6051('0x5b')]=intUtil[_0x6051('0x62')](_0x110f68['remoteUri']);if(_0x5d6e21&&_0x5d6e21[_0x6051('0x77')]&&_0x5d6e21[_0x6051('0x77')]!==_0x6051('0x78')){logger[_0x6051('0x22')](_0x6051('0x79'),'Recording\x20is\x20enabled!');_0x1e4047[_0x6051('0x66')]=util[_0x6051('0x47')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x110f68[_0x6051('0x67')],_0x1e4047[_0x6051('0x68')],md5(_0x1e4047['uniqueid']));}return getConnection(_0x110f68)['then'](function(_0x4eb35a){_0x18d078=_0x4eb35a;return getUser(_0x110f68,_0x240607[_0x6051('0x69')],_0x18d078);})[_0x6051('0x2a')](function(_0x5e89ee){_0x1cca10=_0x5e89ee;return getEndUser(_0x110f68,_0x43e6c6,_0x1e4047['destcalleridname'],_0x1e4047['destcalleridnum'],_0x18d078);})[_0x6051('0x2a')](function(_0x3eaa2c){_0x5669ef=_0x3eaa2c;return getTicket(_0x110f68,_0x1cca10,_0x5669ef,_0x43e6c6,_0x1e4047,_0x43e6c6[_0x6051('0x6c')],_0x18d078,_0x6051('0x7a'));})[_0x6051('0x2a')](function(_0x16c635){_0x4fba9d=_0x16c635;logger['info'](_0x6051('0x7b'),_0x4fba9d['id']);logger[_0x6051('0x22')](_0x6051('0x7c'),_0x4fba9d['id'],_0x240607['name'],_0x110f68['type']);switch(_0x110f68[_0x6051('0x41')]){case _0x6051('0x7d'):emit(util[_0x6051('0x47')](_0x6051('0x70'),_0x240607[_0x6051('0x57')]),'trigger:salesforce:display',{'recordId':_0x4fba9d['id']});break;case _0x6051('0x6f'):emit(util[_0x6051('0x47')](_0x6051('0x70'),_0x240607[_0x6051('0x57')]),'trigger:browser:url',{'uri':util[_0x6051('0x47')](_0x6051('0x72'),_0x18d078[_0x6051('0x73')],_0x4fba9d['id'])});break;default:logger[_0x6051('0x74')](_0x6051('0x79'),'Salesforce\x20account\x20type\x20not\x20recognized');}})['catch'](function(_0x22159d){logger['error'](_0x6051('0x79'),_0x22159d);});};exports[_0x6051('0x7e')]=function(_0x2de740,_0xe290f8,_0x28968f,_0x2e4fdc,_0xf89fc0,_0x36650f){var _0x169c1b,_0x8022b0,_0x6f46f6,_0x344143;_0x36650f[_0x6051('0x67')]=intUtil[_0x6051('0x62')](_0x36650f['serverUrl']);_0x36650f[_0x6051('0x5b')]=intUtil[_0x6051('0x62')](_0x36650f['remoteUri']);if(_0xf89fc0&&_0xf89fc0['monitor_format']){logger['info']('['+_0xe290f8[_0x6051('0x7f')]['toUpperCase']()+']',_0x6051('0x65'));_0xe290f8['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x36650f[_0x6051('0x67')],_0xe290f8[_0x6051('0x68')],md5(_0xe290f8[_0x6051('0x68')]));}else{_0xe290f8['recordingURL']='';}return getConnection(_0x36650f)[_0x6051('0x2a')](function(_0x4bd908){_0x344143=_0x4bd908;if(!_['isNil'](_0x2e4fdc)){return getUser(_0x36650f,_0x2e4fdc[_0x6051('0x57')],_0x344143);}else{return getUser(_0x36650f,null,_0x344143);}})[_0x6051('0x2a')](function(_0x1ac7f0){_0x169c1b=_0x1ac7f0;return getEndUser(_0x36650f,_0x28968f,_0xe290f8['calleridname'],_0xe290f8['calleridnum'],_0x344143);})[_0x6051('0x2a')](function(_0x529341){_0x8022b0=_0x529341;return getTicket(_0x36650f,_0x169c1b,_0x8022b0,_0x28968f,_0xe290f8,_0x28968f['Fields'],_0x344143);})[_0x6051('0x2a')](function(_0x41308a){_0x6f46f6=_0x41308a;logger[_0x6051('0x22')]('['+_0xe290f8[_0x6051('0x7f')]['toUpperCase']()+_0x6051('0x80'),_0x6f46f6['id']);logger['info']('['+_0xe290f8[_0x6051('0x7f')][_0x6051('0x81')]()+_0x6051('0x82'),_0x36650f[_0x6051('0x41')]);})[_0x6051('0x76')](function(_0x579b38){logger[_0x6051('0x74')]('['+_0xe290f8['lastevent'][_0x6051('0x81')]()+']',_0x579b38);});};
\ No newline at end of file
+var _0xb57a=['[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','moment','bluebird','md5','jsforce','ioredis','../../../../config/logger','salesforce','defaults','redis','socket.io-emitter','Subjects','getString','Descriptions','ticketType','Task','ActivityDate','utc','contact','endUserType','lead','WhoId','account','Case','ContactId','AccountId','leadId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','User','find','then','length','resolve','Name','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','Contact','additionalSearchLead','merge','$or','account_contact_lead','additionalSearchAccount','execute','Lead','Account','first','Phone','attributes','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','<unknown>','Caller\x20-\x20%s','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','format','Company','upperFirst','forEach','includes','string','type','idField','content','toString','variable','variableName','customVariable','name','Variable','password','concat','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','username','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat'];(function(_0x3b9dd9,_0x260f93){var _0x2025d3=function(_0x5682a1){while(--_0x5682a1){_0x3b9dd9['push'](_0x3b9dd9['shift']());}};_0x2025d3(++_0x260f93);}(_0xb57a,0x88));var _0xab57=function(_0x3b1cab,_0x141d99){_0x3b1cab=_0x3b1cab-0x0;var _0xa8b56=_0xb57a[_0x3b1cab];return _0xa8b56;};'use strict';var _=require(_0xab57('0x0'));var rp=require('request-promise');var moment=require(_0xab57('0x1'));var BPromise=require(_0xab57('0x2'));var md5=require(_0xab57('0x3'));var jsforce=require(_0xab57('0x4'));var util=require('util');var Redis=require(_0xab57('0x5'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0xab57('0x6'))(_0xab57('0x7'));config['redis']=_[_0xab57('0x8')](config[_0xab57('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xab57('0xa'))(new Redis(config[_0xab57('0x9')]));function emit(_0x1e3c45,_0x131f1c,_0x346820){io['to'](_0x1e3c45)['emit'](_0x131f1c,_0x346820);}function getTicket(_0x3093b5,_0x3f03b3,_0x25276c,_0x113e31,_0x2f5dd0,_0x4164ee,_0x4d00a9,_0x31019b){var _0x1e2313=Object['assign']({},{'OwnerId':_0x3f03b3['id'],'Subject':intUtil['getString'](_0x113e31[_0xab57('0xb')],_0x2f5dd0,'\x20'),'Description':intUtil[_0xab57('0xc')](_0x113e31[_0xab57('0xd')],_0x2f5dd0,'\x0a')},getCustomFields(_0x4164ee,_0x2f5dd0));if(_0x25276c){if(_0x113e31[_0xab57('0xe')]===_0xab57('0xf')){_0x1e2313[_0xab57('0x10')]=moment[_0xab57('0x11')]();_0x1e2313['IsReminderSet']=![];_0x1e2313['IsRecurrence']=![];if(_0x25276c['endUserType']===_0xab57('0x12')||_0x25276c[_0xab57('0x13')]===_0xab57('0x14')){_0x1e2313[_0xab57('0x15')]=_0x25276c['id'];}else if(_0x25276c[_0xab57('0x13')]===_0xab57('0x16')){_0x1e2313['WhatId']=_0x25276c['id'];}}else if(_0x113e31[_0xab57('0xe')]===_0xab57('0x17')){if(_0x25276c['endUserType']==='contact'){_0x1e2313[_0xab57('0x18')]=_0x25276c['id'];}else if(_0x25276c[_0xab57('0x13')]===_0xab57('0x16')){_0x1e2313[_0xab57('0x19')]=_0x25276c['id'];}else if(_0x25276c[_0xab57('0x13')]===_0xab57('0x14')&&_0x113e31[_0xab57('0x1a')]){_0x1e2313[_0x113e31['leadId']]=_0x25276c['id'];}else{logger[_0xab57('0x1b')](_0xab57('0x1c'));}}}return _0x4d00a9[_0xab57('0x1d')](_0x113e31[_0xab57('0xe')])[_0xab57('0x1e')](_0x1e2313);}function getUser(_0x52df5e,_0x4bb603,_0x521d15){if(!_[_0xab57('0x1f')](_0x4bb603)&&intUtil[_0xab57('0x20')](_0x4bb603)){var _0x4f22c6={'Email':_0x4bb603};var _0x177c24={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x521d15[_0xab57('0x1d')](_0xab57('0x21'))[_0xab57('0x22')](_0x4f22c6,_0x177c24)['execute']()[_0xab57('0x23')](function(_0x30c218){if(_0x30c218[_0xab57('0x24')]){var _0xf5427f=_['find'](_0x30c218,function(_0x2a77f9){return _0x2a77f9['Email']===_0x4bb603;});if(_0xf5427f){logger[_0xab57('0x1b')]('Agent\x20%s\x20found.',_0x4bb603);return BPromise[_0xab57('0x25')]({'id':_0xf5427f['Id'],'name':_0xf5427f[_0xab57('0x26')]});}}else{logger[_0xab57('0x1b')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x4bb603);return _0x521d15['identity']()[_0xab57('0x23')](function(_0xd4f1cb){return BPromise[_0xab57('0x25')]({'id':_0xd4f1cb[_0xab57('0x27')],'name':_0xd4f1cb[_0xab57('0x28')]});});}});}else{logger['info'](_0xab57('0x29'),_0x4bb603);return _0x521d15[_0xab57('0x2a')]()[_0xab57('0x23')](function(_0x415463){return BPromise[_0xab57('0x25')]({'id':_0x415463['user_id'],'name':_0x415463[_0xab57('0x28')]});});}}function getEndUser(_0x25558e,_0x2e66e8,_0x1b0155,_0x57a01b,_0x567054){var _0x20827c={'$or':{'Phone':_0x57a01b}};var _0x1acc69={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xab57('0x25')]()[_0xab57('0x23')](function(){logger[_0xab57('0x1b')](_0xab57('0x2b'),_0x57a01b,_0x2e66e8[_0xab57('0x2c')]);switch(_0x2e66e8[_0xab57('0x2c')]){case _0xab57('0x2d'):var _0x58fa21=_[_0xab57('0x2e')](_0x20827c);if(_0x2e66e8[_0xab57('0x2f')]){var _0x3a856e={};_0x3a856e[_0x2e66e8['additionalSearchContact']]=_0x57a01b;_['merge'](_0x58fa21['$or'],_0x3a856e);}return _0x567054[_0xab57('0x1d')](_0xab57('0x30'))[_0xab57('0x22')](_0x58fa21,_0x1acc69)['execute']()[_0xab57('0x23')](function(_0x1a1d31){if(_0x1a1d31&&_0x1a1d31[_0xab57('0x24')]){return _0x1a1d31;}else{var _0xd0da7e=_[_0xab57('0x2e')](_0x20827c);if(_0x2e66e8[_0xab57('0x31')]){var _0x3253a9={};_0x3253a9[_0x2e66e8[_0xab57('0x31')]]=_0x57a01b;_[_0xab57('0x32')](_0xd0da7e[_0xab57('0x33')],_0x3253a9);}return _0x567054[_0xab57('0x1d')]('Lead')[_0xab57('0x22')](_0xd0da7e,_0x1acc69);}});case _0xab57('0x34'):var _0x3bb434=_[_0xab57('0x2e')](_0x20827c);if(_0x2e66e8[_0xab57('0x35')]){var _0x3a856e={};_0x3a856e[_0x2e66e8[_0xab57('0x35')]]=_0x57a01b;_[_0xab57('0x32')](_0x3bb434[_0xab57('0x33')],_0x3a856e);}return _0x567054['sobject']('Account')[_0xab57('0x22')](_0x3bb434,_0x1acc69)[_0xab57('0x36')]()[_0xab57('0x23')](function(_0x465a0e){if(_0x465a0e&&_0x465a0e[_0xab57('0x24')]){return _0x465a0e;}else{var _0x3f1c9f=_[_0xab57('0x2e')](_0x20827c);if(_0x2e66e8[_0xab57('0x2f')]){var _0x1618ad={};_0x1618ad[_0x2e66e8[_0xab57('0x2f')]]=_0x57a01b;_['merge'](_0x3f1c9f['$or'],_0x1618ad);}return _0x567054['sobject']('Contact')[_0xab57('0x22')](_0x3f1c9f,_0x1acc69)[_0xab57('0x23')](function(_0x2bc83f){if(_0x2bc83f&&_0x2bc83f['length']){return _0x2bc83f;}else{var _0x310d90=_[_0xab57('0x2e')](_0x20827c);if(_0x2e66e8[_0xab57('0x31')]){var _0x390e95={};_0x390e95[_0x2e66e8[_0xab57('0x31')]]=_0x57a01b;_[_0xab57('0x32')](_0x310d90['$or'],_0x390e95);}return _0x567054[_0xab57('0x1d')]('Lead')[_0xab57('0x22')](_0x310d90,_0x1acc69);}});}});case'contact':var _0x58fa21=_['cloneDeep'](_0x20827c);if(_0x2e66e8[_0xab57('0x2f')]){var _0x3a856e={};_0x3a856e[_0x2e66e8[_0xab57('0x2f')]]=_0x57a01b;_[_0xab57('0x32')](_0x58fa21[_0xab57('0x33')],_0x3a856e);}return _0x567054[_0xab57('0x1d')](_0xab57('0x30'))['find'](_0x58fa21,_0x1acc69)[_0xab57('0x36')]();case _0xab57('0x14'):var _0x3bdbfe=_['cloneDeep'](_0x20827c);if(_0x2e66e8[_0xab57('0x31')]){var _0x3a856e={};_0x3a856e[_0x2e66e8[_0xab57('0x31')]]=_0x57a01b;_[_0xab57('0x32')](_0x3bdbfe[_0xab57('0x33')],_0x3a856e);}return _0x567054[_0xab57('0x1d')](_0xab57('0x37'))[_0xab57('0x22')](_0x3bdbfe,_0x1acc69);case _0xab57('0x16'):var _0x3bb434=_[_0xab57('0x2e')](_0x20827c);if(_0x2e66e8[_0xab57('0x35')]){var _0x3a856e={};_0x3a856e[_0x2e66e8[_0xab57('0x35')]]=_0x57a01b;_['merge'](_0x3bb434['$or'],_0x3a856e);}return _0x567054[_0xab57('0x1d')](_0xab57('0x38'))[_0xab57('0x22')](_0x3bb434,_0x1acc69);default:return null;}})[_0xab57('0x23')](function(_0x362060){if(_0x362060&&_0x362060[_0xab57('0x24')]){var _0x5111a7=_[_0xab57('0x39')](_0x362060);if(_0x5111a7){return BPromise['resolve']({'id':_0x5111a7['Id'],'name':_0x5111a7[_0xab57('0x26')],'phone':_0x5111a7[_0xab57('0x3a')],'endUserType':_0x5111a7[_0xab57('0x3b')]['type'][_0xab57('0x3c')]()});}}})[_0xab57('0x23')](function(_0x22d611){if(_0x22d611){logger['info']('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x22d611[_0xab57('0x13')],_0x57a01b);return BPromise['resolve'](_0x22d611);}else{logger[_0xab57('0x1b')](_0xab57('0x3d'),_0x57a01b);var _0x380a8e={'Phone':_0x57a01b};if(_0x2e66e8[_0xab57('0x3e')]){if(_0x2e66e8[_0xab57('0x3e')]===_0xab57('0x12')){logger[_0xab57('0x1b')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x57a01b,_0x2e66e8[_0xab57('0x3e')]);_0x380a8e[_0xab57('0x3f')]=_0x1b0155!==_0xab57('0x40')?_0x1b0155:util['format'](_0xab57('0x41'),_0x57a01b);}else if(_0x2e66e8[_0xab57('0x3e')]==='lead'){logger[_0xab57('0x1b')](_0xab57('0x42'),_0x57a01b,_0x2e66e8['moduleCreate']);_0x380a8e[_0xab57('0x3f')]=_0x1b0155!==_0xab57('0x40')?_0x1b0155:util[_0xab57('0x43')](_0xab57('0x41'),_0x57a01b);_0x380a8e[_0xab57('0x44')]='No\x20Company';}else if(_0x2e66e8[_0xab57('0x3e')]===_0xab57('0x16')){logger[_0xab57('0x1b')](_0xab57('0x42'),_0x57a01b,_0x2e66e8[_0xab57('0x3e')]);_0x380a8e[_0xab57('0x26')]=_0x1b0155!=='<unknown>'?_0x1b0155:util[_0xab57('0x43')](_0xab57('0x41'),_0x57a01b);}else{return null;}}return _0x567054[_0xab57('0x1d')](_[_0xab57('0x45')](_0x2e66e8[_0xab57('0x3e')]))[_0xab57('0x1e')](_0x380a8e)[_0xab57('0x23')](function(_0x5019d3){return BPromise[_0xab57('0x25')]({'id':_0x5019d3['id'],'endUserType':_0x2e66e8[_0xab57('0x3e')]});});}});}function getCustomFields(_0xe0dd32,_0x1370d4){var _0x125bcf={};if(_0xe0dd32[_0xab57('0x24')]>0x0){_[_0xab57('0x46')](_0xe0dd32,function(_0x3d28d7){if(_[_0xab57('0x47')]([_0xab57('0x48'),'picklist'],_0x3d28d7[_0xab57('0x49')])&&_0x3d28d7[_0xab57('0x4a')]){_0x125bcf[_0x3d28d7[_0xab57('0x4a')]]=_0x3d28d7[_0xab57('0x4b')][_0xab57('0x4c')]();}else if(_0x3d28d7[_0xab57('0x49')]===_0xab57('0x4d')&&_0x3d28d7[_0xab57('0x4e')]&&_0x3d28d7[_0xab57('0x4a')]){_0x1370d4[_0x3d28d7['variableName']]&&(_0x125bcf[_0x3d28d7[_0xab57('0x4a')]]=_0x1370d4[_0x3d28d7[_0xab57('0x4e')]]['toString']());}else if(_0x3d28d7[_0xab57('0x49')]===_0xab57('0x4f')&&_0x3d28d7['Variable']&&_0x3d28d7['Variable'][_0xab57('0x50')]&&_0x3d28d7[_0xab57('0x4a')]){_0x1370d4[_0x3d28d7[_0xab57('0x51')][_0xab57('0x50')][_0xab57('0x3c')]()]&&(_0x125bcf[_0x3d28d7['idField']]=_0x1370d4[_0x3d28d7['Variable'][_0xab57('0x50')][_0xab57('0x3c')]()]['toString']());}});}return _0x125bcf;}function getConnection(_0x3829c5){var _0x44ca1b=_0x3829c5[_0xab57('0x52')][_0xab57('0x53')](_0x3829c5['securityToken']);var _0x5c90d1=new jsforce[(_0xab57('0x54'))]({'oauth2':{'loginUrl':_0x3829c5[_0xab57('0x55')]||_0xab57('0x56'),'clientId':_0x3829c5[_0xab57('0x57')],'clientSecret':_0x3829c5[_0xab57('0x58')]}});return _0x5c90d1['login'](_0x3829c5[_0xab57('0x59')],_0x44ca1b)[_0xab57('0x23')](function(){logger[_0xab57('0x1b')]('Connection\x20established.');return _0x5c90d1;});}exports[_0xab57('0x5a')]=function(_0x4573b4,_0x18d342,_0x46c0be,_0x1e650e,_0x450314,_0x447d6b){var _0x4dd443,_0x22be70,_0x533883,_0x358fc1;_0x447d6b['serverUrl']=intUtil[_0xab57('0x5b')](_0x447d6b[_0xab57('0x5c')]);_0x447d6b[_0xab57('0x55')]=intUtil[_0xab57('0x5b')](_0x447d6b[_0xab57('0x55')]);if(_0x450314&&_0x450314[_0xab57('0x5d')]){logger[_0xab57('0x1b')](_0xab57('0x5e'),_0xab57('0x5f'));_0x18d342[_0xab57('0x60')]=util['format'](_0xab57('0x61'),_0x447d6b[_0xab57('0x5c')],_0x18d342['uniqueid'],md5(_0x18d342[_0xab57('0x62')]));}else{_0x18d342[_0xab57('0x60')]='';}return getConnection(_0x447d6b)[_0xab57('0x23')](function(_0x23d1d5){_0x358fc1=_0x23d1d5;return getUser(_0x447d6b,_0x1e650e[_0xab57('0x63')],_0x358fc1);})[_0xab57('0x23')](function(_0x23ccf1){_0x4dd443=_0x23ccf1;return getEndUser(_0x447d6b,_0x46c0be,_0x18d342[_0xab57('0x64')],_0x18d342[_0xab57('0x65')],_0x358fc1);})[_0xab57('0x23')](function(_0x489225){_0x22be70=_0x489225;return getTicket(_0x447d6b,_0x4dd443,_0x22be70,_0x46c0be,_0x18d342,_0x46c0be[_0xab57('0x66')],_0x358fc1,_0xab57('0x5a'));})[_0xab57('0x23')](function(_0x379a74){_0x533883=_0x379a74;logger[_0xab57('0x1b')](_0xab57('0x67'),_0x533883['id']);logger['info'](_0xab57('0x68'),_0x533883['id'],_0x1e650e[_0xab57('0x50')],_0x447d6b[_0xab57('0x49')]);switch(_0x447d6b['type']){case _0xab57('0x69'):emit(util[_0xab57('0x43')]('user:%s',_0x1e650e[_0xab57('0x50')]),_0xab57('0x6a'),{'recordId':_0x533883['id']});break;case'newTab':emit(util[_0xab57('0x43')](_0xab57('0x6b'),_0x1e650e['name']),_0xab57('0x6c'),{'uri':util[_0xab57('0x43')](_0xab57('0x6d'),_0x358fc1[_0xab57('0x6e')],_0x533883['id'])});break;default:logger[_0xab57('0x6f')](_0xab57('0x70'));}})[_0xab57('0x71')](function(_0x44bed3){logger['error'](_0xab57('0x5e'),_0x44bed3);});};exports[_0xab57('0x72')]=function(_0x574911,_0x132ed2,_0x4dc122,_0x1519b8,_0x265896,_0x337c49,_0x121452){var _0x480458,_0x2c17c0,_0x2146d5,_0x4bd3f3;_0x337c49[_0xab57('0x5c')]=intUtil[_0xab57('0x5b')](_0x337c49[_0xab57('0x5c')]);_0x337c49['remoteUri']=intUtil['stripTrailingSlash'](_0x337c49[_0xab57('0x55')]);if(_0x121452&&_0x121452[_0xab57('0x73')]&&_0x121452[_0xab57('0x73')]!=='none'){logger[_0xab57('0x1b')](_0xab57('0x74'),_0xab57('0x5f'));_0x132ed2[_0xab57('0x60')]=util['format'](_0xab57('0x61'),_0x337c49[_0xab57('0x5c')],_0x132ed2[_0xab57('0x62')],md5(_0x132ed2[_0xab57('0x62')]));}return getConnection(_0x337c49)['then'](function(_0x220016){_0x4bd3f3=_0x220016;return getUser(_0x337c49,_0x1519b8['email'],_0x4bd3f3);})[_0xab57('0x23')](function(_0x3a088c){_0x480458=_0x3a088c;return getEndUser(_0x337c49,_0x4dc122,_0x132ed2[_0xab57('0x75')],_0x132ed2[_0xab57('0x76')],_0x4bd3f3);})[_0xab57('0x23')](function(_0x26fa20){_0x2c17c0=_0x26fa20;return getTicket(_0x337c49,_0x480458,_0x2c17c0,_0x4dc122,_0x132ed2,_0x4dc122[_0xab57('0x66')],_0x4bd3f3,_0xab57('0x72'));})['then'](function(_0x5f2786){_0x2146d5=_0x5f2786;logger['info'](_0xab57('0x77'),_0x2146d5['id']);logger['info'](_0xab57('0x78'),_0x2146d5['id'],_0x1519b8[_0xab57('0x50')],_0x337c49[_0xab57('0x49')]);switch(_0x337c49[_0xab57('0x49')]){case _0xab57('0x69'):emit(util['format']('user:%s',_0x1519b8[_0xab57('0x50')]),_0xab57('0x6a'),{'recordId':_0x2146d5['id']});break;case'newTab':emit(util[_0xab57('0x43')]('user:%s',_0x1519b8[_0xab57('0x50')]),_0xab57('0x6c'),{'uri':util[_0xab57('0x43')](_0xab57('0x6d'),_0x4bd3f3[_0xab57('0x6e')],_0x2146d5['id'])});break;default:logger[_0xab57('0x6f')](_0xab57('0x74'),'Salesforce\x20account\x20type\x20not\x20recognized');}})[_0xab57('0x71')](function(_0x4b4e63){logger[_0xab57('0x6f')]('[OUTBOUND]',_0x4b4e63);});};exports[_0xab57('0x79')]=function(_0x554b90,_0x553848,_0x1730a9,_0x1c2093,_0x41be7b,_0x5d1f90){var _0x4b532b,_0x211f33,_0x141c5d,_0x2e355d;_0x5d1f90[_0xab57('0x5c')]=intUtil[_0xab57('0x5b')](_0x5d1f90[_0xab57('0x5c')]);_0x5d1f90[_0xab57('0x55')]=intUtil[_0xab57('0x5b')](_0x5d1f90[_0xab57('0x55')]);if(_0x41be7b&&_0x41be7b[_0xab57('0x5d')]){logger[_0xab57('0x1b')]('['+_0x553848[_0xab57('0x7a')][_0xab57('0x7b')]()+']',_0xab57('0x5f'));_0x553848[_0xab57('0x60')]=util[_0xab57('0x43')](_0xab57('0x61'),_0x5d1f90[_0xab57('0x5c')],_0x553848[_0xab57('0x62')],md5(_0x553848[_0xab57('0x62')]));}else{_0x553848[_0xab57('0x60')]='';}return getConnection(_0x5d1f90)['then'](function(_0x3692fb){_0x2e355d=_0x3692fb;if(!_['isNil'](_0x1c2093)){return getUser(_0x5d1f90,_0x1c2093[_0xab57('0x50')],_0x2e355d);}else{return getUser(_0x5d1f90,null,_0x2e355d);}})[_0xab57('0x23')](function(_0x1adc3f){_0x4b532b=_0x1adc3f;return getEndUser(_0x5d1f90,_0x1730a9,_0x553848[_0xab57('0x64')],_0x553848[_0xab57('0x65')],_0x2e355d);})[_0xab57('0x23')](function(_0x20e4f0){_0x211f33=_0x20e4f0;return getTicket(_0x5d1f90,_0x4b532b,_0x211f33,_0x1730a9,_0x553848,_0x1730a9['Fields'],_0x2e355d);})[_0xab57('0x23')](function(_0x59f3ce){_0x141c5d=_0x59f3ce;logger[_0xab57('0x1b')]('['+_0x553848[_0xab57('0x7a')][_0xab57('0x7b')]()+_0xab57('0x7c'),_0x141c5d['id']);logger[_0xab57('0x1b')]('['+_0x553848[_0xab57('0x7a')][_0xab57('0x7b')]()+_0xab57('0x7d'),_0x5d1f90[_0xab57('0x49')]);})[_0xab57('0x71')](function(_0x2b0e87){logger['error']('['+_0x553848[_0xab57('0x7a')][_0xab57('0x7b')]()+']',_0x2b0e87);});};
\ No newline at end of file
index f6b0a0e..b50e18d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbb91=['../../../../config/environment','../../../../config/logger','servicenow','redis','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','],\x20getAdminUser\x20crm','catch','error','toUpperCase','message','],\x20getUser\x20input\x20crm','sys_user?sysparm_query=email%3D','userEmail','info','],\x20getUser\x20rp\x20obj','length','active','true','userId','sys_id','adminId','adminEmail','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','user','],\x20EndUser\x20schema','sys_user?sysparm_query=phone%3D','],\x20createEndUser\x20crm','forEach','string','picklist','type','nameField','customField','toLowerCase','content','toString','idField','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Subjects','Descriptions','Fields','number',']\x20getTicket\x20crm','POST','label','?sysparm_query=name%3D','label_entry','ticketId','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','user:%s','emit','password','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','format','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','md5','ioredis','./util'];(function(_0x5650ea,_0x55186b){var _0x5a82cf=function(_0x1fe01c){while(--_0x1fe01c){_0x5650ea['push'](_0x5650ea['shift']());}};_0x5a82cf(++_0x55186b);}(_0xbb91,0xce));var _0x1bb9=function(_0x737a1f,_0x235fef){_0x737a1f=_0x737a1f-0x0;var _0x16eba1=_0xbb91[_0x737a1f];return _0x16eba1;};'use strict';var _=require(_0x1bb9('0x0'));var Promise=require(_0x1bb9('0x1'));var rp=require(_0x1bb9('0x2'));var util=require('util');var md5=require(_0x1bb9('0x3'));var Redis=require(_0x1bb9('0x4'));var intUtil=require(_0x1bb9('0x5'));var config=require(_0x1bb9('0x6'));var logger=require(_0x1bb9('0x7'))(_0x1bb9('0x8'));config[_0x1bb9('0x9')]=_['defaults'](config[_0x1bb9('0x9')],{'host':_0x1bb9('0xa'),'port':0x18eb});var io=require(_0x1bb9('0xb'))(new Redis(config[_0x1bb9('0x9')]));function getAdminUser(_0x257cae,_0x5becd3,_0x5a45f0,_0x14e709,_0x33f7b6,_0x3217ab){return new Promise(function(_0x4be0ec,_0x5d8df9){var _0x303345={'method':_0x1bb9('0xc'),'uri':_0x14e709+_0x1bb9('0xd')+'&'+_0x33f7b6+'&'+_0x3217ab,'auth':_0x5becd3,'json':!![]};return rp(_0x303345)[_0x1bb9('0xe')](function(_0xc697c7){if(_0xc697c7[_0x1bb9('0xf')]['length']>0x0){_0x5a45f0['adminId']=_0xc697c7[_0x1bb9('0xf')][0x0]['sys_id'];}logger['info']('['+[_0x257cae['toUpperCase']()]+_0x1bb9('0x10'),_0x5a45f0);_0x4be0ec(_0x5a45f0);})[_0x1bb9('0x11')](function(_0x399883){logger[_0x1bb9('0x12')]('['+[_0x257cae[_0x1bb9('0x13')]()]+']',_0x399883[_0x1bb9('0x14')]);_0x5d8df9(_0x399883[_0x1bb9('0x14')]);});});}function getUser(_0x1dd719,_0x11c55b,_0x21d334,_0xa2729e,_0x178b5e){return function(_0x1fee8b){logger['info']('['+[_0x1dd719[_0x1bb9('0x13')]()]+_0x1bb9('0x15'),_0x1fee8b);return new Promise(function(_0x1d5e98,_0x1ec5be){if(intUtil['validateEmail'](_0x1fee8b['userEmail'])){var _0x5c11c6={'method':_0x1bb9('0xc'),'uri':_0x21d334+_0x1bb9('0x16')+_0x1fee8b[_0x1bb9('0x17')]+'&'+_0xa2729e+'&'+_0x178b5e,'auth':_0x11c55b,'json':!![]};logger[_0x1bb9('0x18')]('['+[_0x1dd719[_0x1bb9('0x13')]()]+_0x1bb9('0x19'),_0x5c11c6);return rp(_0x5c11c6)['then'](function(_0x298961){logger[_0x1bb9('0x18')]('['+[_0x1dd719['toUpperCase']()]+'],\x20getUser\x20entity',_0x298961);if(_0x298961[_0x1bb9('0xf')][_0x1bb9('0x1a')]>0x0&&String(_0x298961[_0x1bb9('0xf')][0x0][_0x1bb9('0x1b')])===_0x1bb9('0x1c')){_0x1fee8b[_0x1bb9('0x1d')]=_0x298961['result'][0x0][_0x1bb9('0x1e')];}else{_0x1fee8b[_0x1bb9('0x1d')]=_0x1fee8b[_0x1bb9('0x1f')];_0x1fee8b[_0x1bb9('0x17')]=_0x1fee8b[_0x1bb9('0x20')];}logger[_0x1bb9('0x18')]('['+[_0x1dd719['toUpperCase']()]+_0x1bb9('0x21'),_0x1fee8b);_0x1d5e98(_0x1fee8b);})[_0x1bb9('0x11')](function(_0x21b0c9){logger[_0x1bb9('0x12')]('['+[_0x1dd719[_0x1bb9('0x13')]()]+']',_0x21b0c9[_0x1bb9('0x14')]);_0x1ec5be(_0x21b0c9[_0x1bb9('0x14')]);});}else{logger[_0x1bb9('0x18')]('['+[_0x1dd719['toUpperCase']()]+_0x1bb9('0x22'));_0x1fee8b[_0x1bb9('0x1d')]=_0x1fee8b[_0x1bb9('0x1f')];_0x1fee8b[_0x1bb9('0x17')]=_0x1fee8b[_0x1bb9('0x20')];_0x1d5e98(_0x1fee8b);}});};}function createEndUser(_0xcab952,_0x57add6,_0x1026bd,_0xd11446,_0x8641a4){logger[_0x1bb9('0x18')]('['+[_0xcab952[_0x1bb9('0x13')]()]+_0x1bb9('0x23'),_0x1026bd);return new Promise(function(_0x4237fa,_0x3f1562){var _0x3204b2={'method':'POST','uri':_0xd11446+_0x1bb9('0x24')+_0x8641a4,'body':{'user_name':_0x1026bd[_0x1bb9('0x25')],'roles':_0x1bb9('0x26'),'first_name':_0x1026bd[_0x1bb9('0x25')],'active':_0x1bb9('0x1c'),'date_format':'System','phone':_0x1026bd[_0x1bb9('0x25')]},'auth':_0x57add6,'json':!![]};return rp(_0x3204b2)[_0x1bb9('0xe')](function(_0x165f33){logger['info']('['+[_0xcab952[_0x1bb9('0x13')]()]+_0x1bb9('0x27'),_0x165f33[_0x1bb9('0xf')]);_0x1026bd['endUserId']=_0x165f33[_0x1bb9('0xf')]['sys_id'];_0x4237fa(_0x1026bd);})[_0x1bb9('0x11')](function(_0x1ba731){logger[_0x1bb9('0x12')]('['+[_0xcab952[_0x1bb9('0x13')]()]+']',_0x1ba731[_0x1bb9('0x14')]);_0x3f1562(_0x1ba731[_0x1bb9('0x14')]);});});}function getEndUser(_0x5be855,_0x1f47e6,_0x28a3c4,_0x4a05bf,_0x5d4869){return function(_0x3e5f3e){logger[_0x1bb9('0x18')]('['+[_0x5be855['toUpperCase']()]+'],\x20getEndUser\x20input\x20crm',_0x3e5f3e);return new Promise(function(_0x507db8,_0xee4ff3){var _0x3a0fad={'method':'GET','uri':_0x28a3c4+_0x1bb9('0x28')+_0x3e5f3e[_0x1bb9('0x25')]+'&'+_0x4a05bf+'&'+_0x5d4869,'auth':_0x1f47e6,'json':!![]};return rp(_0x3a0fad)[_0x1bb9('0xe')](function(_0x64396f){if(_0x64396f[_0x1bb9('0xf')]['length']>0x0){_0x3e5f3e['endUserId']=_0x64396f[_0x1bb9('0xf')][0x0][_0x1bb9('0x1e')];logger[_0x1bb9('0x18')]('['+[_0x5be855['toUpperCase']()]+'],\x20getEndUser\x20crm',_0x3e5f3e);_0x507db8(_0x3e5f3e);}else{return createEndUser(_0x5be855,_0x1f47e6,_0x3e5f3e,_0x28a3c4,_0x4a05bf)['then'](function(_0x44aaa4){logger[_0x1bb9('0x18')]('['+[_0x5be855[_0x1bb9('0x13')]()]+_0x1bb9('0x29'),_0x44aaa4);_0x507db8(_0x44aaa4);});}})[_0x1bb9('0x11')](function(_0x2ffee6){logger['error']('['+[_0x5be855[_0x1bb9('0x13')]()]+']',_0x2ffee6[_0x1bb9('0x14')]);_0xee4ff3(_0x2ffee6['message']);});});};}function getCustomFields(_0x32ecb2,_0x512f9f){var _0x40f28b={};if(_0x32ecb2[_0x1bb9('0x1a')]>0x0){_[_0x1bb9('0x2a')](_0x32ecb2,function(_0x43c254){if(_['includes']([_0x1bb9('0x2b'),_0x1bb9('0x2c')],_0x43c254[_0x1bb9('0x2d')])&&_0x43c254[_0x1bb9('0x2e')]&&!_0x43c254[_0x1bb9('0x2f')]){_0x40f28b[_0x43c254[_0x1bb9('0x2e')][_0x1bb9('0x30')]()]=_0x43c254[_0x1bb9('0x31')][_0x1bb9('0x32')]();}else if(_['includes']([_0x1bb9('0x2b'),_0x1bb9('0x2c')],_0x43c254[_0x1bb9('0x2d')])&&_0x43c254[_0x1bb9('0x33')]&&_0x43c254['customField']){_0x40f28b[_0x43c254[_0x1bb9('0x33')]['toLowerCase']()]=_0x43c254[_0x1bb9('0x31')][_0x1bb9('0x32')]();}else if(_0x43c254['type']===_0x1bb9('0x34')&&_0x43c254[_0x1bb9('0x35')]&&_0x43c254[_0x1bb9('0x33')]&&_0x43c254[_0x1bb9('0x2f')]){_0x40f28b[_0x43c254[_0x1bb9('0x33')][_0x1bb9('0x30')]()]=_0x512f9f[_0x43c254[_0x1bb9('0x35')]][_0x1bb9('0x32')]();}else if(_0x43c254[_0x1bb9('0x2d')]==='customVariable'&&_0x43c254[_0x1bb9('0x36')]&&_0x43c254[_0x1bb9('0x36')][_0x1bb9('0x37')]&&_0x43c254['idField']&&_0x43c254[_0x1bb9('0x2f')]){_0x40f28b[_0x43c254['idField'][_0x1bb9('0x30')]()]=_0x512f9f[_0x43c254[_0x1bb9('0x36')][_0x1bb9('0x37')]['toLowerCase']()][_0x1bb9('0x32')]();}});}return _0x40f28b;}function getTicket(_0x56fe6b,_0x457d50,_0x30102a,_0x2f5065,_0x5cd5c3,_0x28f58b){return function(_0x34bbc0){logger[_0x1bb9('0x18')]('['+[_0x56fe6b['toUpperCase']()]+_0x1bb9('0x38'),_0x34bbc0);return new Promise(function(_0x2be632,_0x102ba4){var _0x49d219=_0x56fe6b[_0x1bb9('0x30')]()===_0x1bb9('0x39')?_0x34bbc0['userId']:_0x34bbc0['endUserId'];var _0x5f0a14={'method':'POST','uri':_0x30102a+_0x1bb9('0x3a')+'?'+_0x28f58b,'body':Object[_0x1bb9('0x3b')]({},{'active':_0x1bb9('0x1c'),'caller_id':_0x49d219,'assigned_to':_0x34bbc0[_0x1bb9('0x1d')],'short_description':intUtil[_0x1bb9('0x3c')](_0x2f5065[_0x1bb9('0x3d')],_0x5cd5c3,'\x20'),'description':intUtil['getString'](_0x2f5065[_0x1bb9('0x3e')],_0x5cd5c3,'\x0a')},getCustomFields(_0x2f5065[_0x1bb9('0x3f')],_0x5cd5c3)),'auth':_0x457d50,'json':!![]};return rp(_0x5f0a14)['then'](function(_0x311523){logger[_0x1bb9('0x18')]('['+[_0x56fe6b['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x311523[_0x1bb9('0xf')]);_0x34bbc0['ticketId']=_0x311523[_0x1bb9('0xf')][_0x1bb9('0x1e')];_0x34bbc0['ticketNumber']=_0x311523[_0x1bb9('0xf')][_0x1bb9('0x40')];logger[_0x1bb9('0x18')]('['+[_0x56fe6b[_0x1bb9('0x13')]()]+_0x1bb9('0x41'),_0x34bbc0);_0x2be632(_0x34bbc0);})['catch'](function(_0x437321){logger[_0x1bb9('0x12')]('['+[_0x56fe6b[_0x1bb9('0x13')]()]+']',_0x437321[_0x1bb9('0x14')]);_0x102ba4(_0x437321[_0x1bb9('0x14')]);});});};}function createRemoteTag(_0x143017,_0x31d688,_0x422b80,_0x546d9a){return new Promise(function(_0x5497a0,_0x3fce42){var _0x2f5db6={'method':_0x1bb9('0x42'),'uri':_0x422b80+'label'+'?'+_0x546d9a,'body':{'short_description':_0x143017,'global':!![],'active':!![],'name':_0x143017},'auth':_0x31d688,'json':!![]};return rp(_0x2f5db6)[_0x1bb9('0xe')](function(_0x474912){var _0x2f45e4=_0x474912[_0x1bb9('0xf')][_0x1bb9('0x1e')];_0x5497a0(_0x2f45e4);});});}function getRemoteTag(_0x940348,_0x30219d,_0x28552d,_0x48b0f9,_0x208498){return new Promise(function(_0x47cf53,_0x81e74){var _0x537ecf={'method':'GET','uri':_0x28552d+_0x1bb9('0x43')+_0x1bb9('0x44')+_0x940348+'&'+_0x48b0f9,'auth':_0x30219d,'json':!![]};return rp(_0x537ecf)['then'](function(_0x24594e){if(_0x24594e[_0x1bb9('0xf')]['length']>0x0){var _0x51e902=_0x24594e[_0x1bb9('0xf')][0x0][_0x1bb9('0x1e')];_0x47cf53(_0x51e902);}else{return createRemoteTag(_0x940348,_0x30219d,_0x28552d,_0x48b0f9)['then'](function(_0x4047fd){_0x47cf53(_0x4047fd);});}});});}function assignTagToIncident(_0x2141fa,_0x593a8a,_0xc2b75d,_0x5c50c2,_0x214285){return new Promise(function(_0x11cf48,_0xe7ec08){var _0x5b578f={'method':'POST','uri':_0xc2b75d+_0x1bb9('0x45')+'?'+_0x214285,'body':{'label':_0x2141fa,'table':_0x1bb9('0x3a'),'id_type':'Incident','table_key':_0x5c50c2[_0x1bb9('0x46')],'title':'Incident\x20-\x20'+_0x5c50c2[_0x1bb9('0x47')],'id_display':_0x5c50c2[_0x1bb9('0x47')]},'auth':_0x593a8a,'json':!![]};return rp(_0x5b578f)[_0x1bb9('0xe')](function(_0x3e1ca6){_0x11cf48();})['catch'](function(){_0x11cf48();});});}function manageTags(_0x4fa5bb,_0x3fa373,_0x132357,_0x477031,_0x42ed43,_0x4afca7,_0x277958){return new Promise(function(_0x40eef8,_0x32be85){var _0x2e9036=[];_0x3fa373[_0x1bb9('0x2a')](function(_0x43f591){_0x2e9036[_0x1bb9('0x48')](getRemoteTag(_0x43f591,_0x132357,_0x477031,_0x4afca7,_0x277958));});return Promise[_0x1bb9('0x49')](_0x2e9036)[_0x1bb9('0xe')](function(_0x17c937){if(_0x17c937[_0x1bb9('0x1a')]){logger[_0x1bb9('0x18')]('['+[_0x4fa5bb['toUpperCase']()]+_0x1bb9('0x4a'),_0x17c937);var _0x35df2=[];_0x17c937[_0x1bb9('0x2a')](function(_0x1e7b40){_0x35df2[_0x1bb9('0x48')](assignTagToIncident(_0x1e7b40,_0x132357,_0x477031,_0x42ed43,_0x4afca7));});return Promise['all'](_0x35df2)[_0x1bb9('0xe')](function(){_0x40eef8();})[_0x1bb9('0x11')](function(){_0x40eef8();});}else{_0x40eef8();}});});}function getTags(_0x2946b8,_0x38db69,_0xa778b6,_0x5d6c74,_0x1f571a,_0x37d91e){return function(_0x31e030){return new Promise(function(_0x49229b,_0x2bfde5){var _0x343a80=[];var _0x5367e8=_0x5d6c74[_0x1bb9('0x4b')];if(_0x5367e8&&_0x5367e8['length']>0x0){_0x343a80=_[_0x1bb9('0x4c')](_0x5367e8,_0x1bb9('0x37'));}if(_0x343a80['length']>0x0){return manageTags(_0x2946b8,_0x343a80,_0x38db69,_0xa778b6,_0x31e030,_0x1f571a,_0x37d91e)[_0x1bb9('0xe')](function(){_0x49229b(_0x31e030);});}else{_0x49229b(_0x31e030);}});};}function emit(_0x5e3590,_0x3e074b,_0x2d91e2){var _0x130050=_0x1bb9('0x4d')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x1bb9('0x4e')+'%255EORDERBYDESCnumber';var _0x6a0b58={'uri':_0x5e3590+_0x1bb9('0x4f')+_0x2d91e2+_0x130050};io['to'](util['format'](_0x1bb9('0x50'),_0x3e074b))[_0x1bb9('0x51')]('trigger:browser:url',_0x6a0b58);}exports['cs']=function(_0x5c3afd,_0x59b8e9,_0x205471,_0x473af1,_0x159538,_0x4f8f12,_0x4c24f6,_0x183e44){var _0x6a8019={};var _0x3dcb5d={'user':_0x4f8f12['username'],'pass':_0x4f8f12[_0x1bb9('0x52')]};var _0x307086=_0x1bb9('0x53');var _0x1cdfd5='sysparm_display_value=true';_0x4f8f12[_0x1bb9('0x54')]=intUtil[_0x1bb9('0x55')](_0x4f8f12[_0x1bb9('0x54')]);_0x4f8f12[_0x1bb9('0x56')]=intUtil[_0x1bb9('0x55')](_0x4f8f12[_0x1bb9('0x56')]);var _0x25a2e1=util[_0x1bb9('0x57')](_0x1bb9('0x58'),_0x4f8f12['remoteUri']);_0x6a8019['userEmail']=!_[_0x1bb9('0x59')](_0x473af1)?_0x473af1[_0x1bb9('0x5a')]:null;_0x6a8019[_0x1bb9('0x20')]=_0x4f8f12[_0x1bb9('0x5a')];_0x6a8019[_0x1bb9('0x25')]=_0x183e44[_0x1bb9('0x30')]()===_0x1bb9('0x39')?_0x59b8e9[_0x1bb9('0x5b')]:_0x59b8e9[_0x1bb9('0x5c')];_0x6a8019[_0x1bb9('0x5d')]=_0x183e44===_0x1bb9('0x5e')||_0x183e44===_0x1bb9('0x5f')?_0x1bb9('0x5e'):_0x1bb9('0x39');var _0xfb13bf=util['format'](_0x1bb9('0x60'),_0x4f8f12['serverUrl'],_0x59b8e9[_0x1bb9('0x61')],md5(_0x59b8e9[_0x1bb9('0x61')]));if(_0x159538&&_0x159538['monitor_format']){logger[_0x1bb9('0x18')]('[QUEUE]',_0x1bb9('0x62'));_0x59b8e9[_0x1bb9('0x63')]=_0xfb13bf;}else if(_0x4c24f6&&_0x4c24f6['recordingFormat']&&_0x4c24f6[_0x1bb9('0x64')]!==_0x1bb9('0x65')){logger['info'](_0x1bb9('0x66'),_0x1bb9('0x62'));_0x59b8e9[_0x1bb9('0x63')]=_0xfb13bf;}else{_0x59b8e9[_0x1bb9('0x63')]='';}return getAdminUser(_0x183e44,_0x3dcb5d,_0x6a8019,_0x25a2e1,_0x1cdfd5,_0x307086)[_0x1bb9('0xe')](getUser(_0x183e44,_0x3dcb5d,_0x25a2e1,_0x1cdfd5,_0x307086))[_0x1bb9('0xe')](getEndUser(_0x183e44,_0x3dcb5d,_0x25a2e1,_0x1cdfd5,_0x307086))['then'](getTicket(_0x183e44,_0x3dcb5d,_0x25a2e1,_0x205471,_0x59b8e9,_0x1cdfd5))[_0x1bb9('0xe')](function(_0x11d050){logger[_0x1bb9('0x18')](util[_0x1bb9('0x57')](_0x1bb9('0x67'),_0x11d050['ticketId']));logger[_0x1bb9('0x18')](util[_0x1bb9('0x57')](_0x1bb9('0x68'),_0x183e44));if(_0x183e44!==_0x1bb9('0x5f')){logger[_0x1bb9('0x18')]('['+[_0x183e44[_0x1bb9('0x13')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x4f8f12[_0x1bb9('0x54')],_0x473af1[_0x1bb9('0x37')],_0x11d050[_0x1bb9('0x46')]);}})[_0x1bb9('0x11')](function(_0x25d8ec){logger[_0x1bb9('0x12')]('['+[_0x183e44[_0x1bb9('0x13')]()]+_0x1bb9('0x69'),util['inspect'](_0x25d8ec,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0x4e84=['],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','],\x20getEndUser\x20crm','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','toString','idField','type','variable','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','POST','incident','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','Incident','Incident\x20-\x20','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%255EORDERBYDESCnumber','format','user:%s','emit','trigger:browser:url','username','password','sysparm_display_value=true','remoteUri','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','recordingURL','recordingFormat','none','Recording\x20is\x20enabled!','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','util','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','defaults','redis','localhost','sys_user?sysparm_query=user_name%3Dadmin','result','length','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','then','],\x20getUser\x20entity','true','userId','adminId','adminEmail',']\x20using\x20admin\x20profile','sys_user?','endUserNumber','user','System'];(function(_0x54cfcf,_0x3ecf5b){var _0x1c2060=function(_0x484a41){while(--_0x484a41){_0x54cfcf['push'](_0x54cfcf['shift']());}};_0x1c2060(++_0x3ecf5b);}(_0x4e84,0x183));var _0x44e8=function(_0x2eab35,_0xd8bab0){_0x2eab35=_0x2eab35-0x0;var _0x146028=_0x4e84[_0x2eab35];return _0x146028;};'use strict';var _=require(_0x44e8('0x0'));var Promise=require(_0x44e8('0x1'));var rp=require(_0x44e8('0x2'));var util=require(_0x44e8('0x3'));var md5=require(_0x44e8('0x4'));var Redis=require(_0x44e8('0x5'));var intUtil=require(_0x44e8('0x6'));var config=require(_0x44e8('0x7'));var logger=require(_0x44e8('0x8'))('servicenow');config['redis']=_[_0x44e8('0x9')](config[_0x44e8('0xa')],{'host':_0x44e8('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminUser(_0x100c81,_0x4ee326,_0x57510c,_0x2b2e59,_0x21ebda,_0x2f58a9){return new Promise(function(_0x310c8d,_0x3c11b7){var _0x229427={'method':'GET','uri':_0x2b2e59+_0x44e8('0xc')+'&'+_0x21ebda+'&'+_0x2f58a9,'auth':_0x4ee326,'json':!![]};return rp(_0x229427)['then'](function(_0x379a74){if(_0x379a74[_0x44e8('0xd')][_0x44e8('0xe')]>0x0){_0x57510c['adminId']=_0x379a74[_0x44e8('0xd')][0x0][_0x44e8('0xf')];}logger[_0x44e8('0x10')]('['+[_0x100c81[_0x44e8('0x11')]()]+_0x44e8('0x12'),_0x57510c);_0x310c8d(_0x57510c);})[_0x44e8('0x13')](function(_0x16efe6){logger[_0x44e8('0x14')]('['+[_0x100c81[_0x44e8('0x11')]()]+']',_0x16efe6[_0x44e8('0x15')]);_0x3c11b7(_0x16efe6[_0x44e8('0x15')]);});});}function getUser(_0x2b6fff,_0x397cbc,_0x3d64e4,_0x1d1f60,_0x15c101){return function(_0x5dff08){logger[_0x44e8('0x10')]('['+[_0x2b6fff[_0x44e8('0x11')]()]+_0x44e8('0x16'),_0x5dff08);return new Promise(function(_0x4f6e8d,_0x25290a){if(intUtil[_0x44e8('0x17')](_0x5dff08[_0x44e8('0x18')])){var _0x4849f5={'method':'GET','uri':_0x3d64e4+_0x44e8('0x19')+_0x5dff08[_0x44e8('0x18')]+'&'+_0x1d1f60+'&'+_0x15c101,'auth':_0x397cbc,'json':!![]};logger[_0x44e8('0x10')]('['+[_0x2b6fff[_0x44e8('0x11')]()]+'],\x20getUser\x20rp\x20obj',_0x4849f5);return rp(_0x4849f5)[_0x44e8('0x1a')](function(_0x4ca6ab){logger[_0x44e8('0x10')]('['+[_0x2b6fff[_0x44e8('0x11')]()]+_0x44e8('0x1b'),_0x4ca6ab);if(_0x4ca6ab['result'][_0x44e8('0xe')]>0x0&&String(_0x4ca6ab['result'][0x0]['active'])===_0x44e8('0x1c')){_0x5dff08[_0x44e8('0x1d')]=_0x4ca6ab['result'][0x0][_0x44e8('0xf')];}else{_0x5dff08[_0x44e8('0x1d')]=_0x5dff08[_0x44e8('0x1e')];_0x5dff08[_0x44e8('0x18')]=_0x5dff08[_0x44e8('0x1f')];}logger[_0x44e8('0x10')]('['+[_0x2b6fff[_0x44e8('0x11')]()]+'],\x20getUser\x20crm',_0x5dff08);_0x4f6e8d(_0x5dff08);})[_0x44e8('0x13')](function(_0x357ff5){logger['error']('['+[_0x2b6fff[_0x44e8('0x11')]()]+']',_0x357ff5['message']);_0x25290a(_0x357ff5['message']);});}else{logger[_0x44e8('0x10')]('['+[_0x2b6fff[_0x44e8('0x11')]()]+_0x44e8('0x20'));_0x5dff08[_0x44e8('0x1d')]=_0x5dff08[_0x44e8('0x1e')];_0x5dff08['userEmail']=_0x5dff08[_0x44e8('0x1f')];_0x4f6e8d(_0x5dff08);}});};}function createEndUser(_0xce7a1a,_0x4f3087,_0x2f775c,_0x16e9e6,_0x7c7631){logger[_0x44e8('0x10')]('['+[_0xce7a1a[_0x44e8('0x11')]()]+'],\x20createEndUser\x20input\x20crm',_0x2f775c);return new Promise(function(_0x1d82a4,_0x249c5b){var _0x2583c7={'method':'POST','uri':_0x16e9e6+_0x44e8('0x21')+_0x7c7631,'body':{'user_name':_0x2f775c[_0x44e8('0x22')],'roles':_0x44e8('0x23'),'first_name':_0x2f775c[_0x44e8('0x22')],'active':_0x44e8('0x1c'),'date_format':_0x44e8('0x24'),'phone':_0x2f775c[_0x44e8('0x22')]},'auth':_0x4f3087,'json':!![]};return rp(_0x2583c7)[_0x44e8('0x1a')](function(_0x59a6c3){logger[_0x44e8('0x10')]('['+[_0xce7a1a[_0x44e8('0x11')]()]+_0x44e8('0x25'),_0x59a6c3[_0x44e8('0xd')]);_0x2f775c[_0x44e8('0x26')]=_0x59a6c3[_0x44e8('0xd')][_0x44e8('0xf')];_0x1d82a4(_0x2f775c);})[_0x44e8('0x13')](function(_0x1f37e5){logger[_0x44e8('0x14')]('['+[_0xce7a1a[_0x44e8('0x11')]()]+']',_0x1f37e5[_0x44e8('0x15')]);_0x249c5b(_0x1f37e5[_0x44e8('0x15')]);});});}function getEndUser(_0x2b0371,_0x56fff4,_0x3f658b,_0x291908,_0x5d3d36){return function(_0x318068){logger[_0x44e8('0x10')]('['+[_0x2b0371[_0x44e8('0x11')]()]+_0x44e8('0x27'),_0x318068);return new Promise(function(_0xa917c5,_0x1d6818){var _0x2b0684={'method':'GET','uri':_0x3f658b+'sys_user?sysparm_query=phone%3D'+_0x318068['endUserNumber']+'&'+_0x291908+'&'+_0x5d3d36,'auth':_0x56fff4,'json':!![]};return rp(_0x2b0684)[_0x44e8('0x1a')](function(_0x3ec28d){if(_0x3ec28d[_0x44e8('0xd')][_0x44e8('0xe')]>0x0){_0x318068[_0x44e8('0x26')]=_0x3ec28d[_0x44e8('0xd')][0x0][_0x44e8('0xf')];logger[_0x44e8('0x10')]('['+[_0x2b0371['toUpperCase']()]+_0x44e8('0x28'),_0x318068);_0xa917c5(_0x318068);}else{return createEndUser(_0x2b0371,_0x56fff4,_0x318068,_0x3f658b,_0x291908)['then'](function(_0x2d67d3){logger[_0x44e8('0x10')]('['+[_0x2b0371['toUpperCase']()]+'],\x20createEndUser\x20crm',_0x2d67d3);_0xa917c5(_0x2d67d3);});}})[_0x44e8('0x13')](function(_0x190b1d){logger[_0x44e8('0x14')]('['+[_0x2b0371[_0x44e8('0x11')]()]+']',_0x190b1d[_0x44e8('0x15')]);_0x1d6818(_0x190b1d['message']);});});};}function getCustomFields(_0x234783,_0x5c743f){var _0x582c73={};if(_0x234783[_0x44e8('0xe')]>0x0){_[_0x44e8('0x29')](_0x234783,function(_0x5ba3ac){if(_[_0x44e8('0x2a')]([_0x44e8('0x2b'),_0x44e8('0x2c')],_0x5ba3ac['type'])&&_0x5ba3ac[_0x44e8('0x2d')]&&!_0x5ba3ac[_0x44e8('0x2e')]){_0x582c73[_0x5ba3ac['nameField'][_0x44e8('0x2f')]()]=_0x5ba3ac[_0x44e8('0x30')][_0x44e8('0x31')]();}else if(_['includes']([_0x44e8('0x2b'),_0x44e8('0x2c')],_0x5ba3ac['type'])&&_0x5ba3ac['idField']&&_0x5ba3ac[_0x44e8('0x2e')]){_0x582c73[_0x5ba3ac[_0x44e8('0x32')][_0x44e8('0x2f')]()]=_0x5ba3ac[_0x44e8('0x30')]['toString']();}else if(_0x5ba3ac[_0x44e8('0x33')]===_0x44e8('0x34')&&_0x5ba3ac['variableName']&&_0x5ba3ac[_0x44e8('0x32')]&&_0x5ba3ac[_0x44e8('0x2e')]){_0x582c73[_0x5ba3ac[_0x44e8('0x32')][_0x44e8('0x2f')]()]=_0x5c743f[_0x5ba3ac[_0x44e8('0x35')]][_0x44e8('0x31')]();}else if(_0x5ba3ac[_0x44e8('0x33')]===_0x44e8('0x36')&&_0x5ba3ac[_0x44e8('0x37')]&&_0x5ba3ac[_0x44e8('0x37')][_0x44e8('0x38')]&&_0x5ba3ac[_0x44e8('0x32')]&&_0x5ba3ac[_0x44e8('0x2e')]){_0x582c73[_0x5ba3ac['idField']['toLowerCase']()]=_0x5c743f[_0x5ba3ac[_0x44e8('0x37')][_0x44e8('0x38')][_0x44e8('0x2f')]()][_0x44e8('0x31')]();}});}return _0x582c73;}function getTicket(_0x2e978e,_0x265391,_0x1f126f,_0x164a6c,_0x4bd601,_0x5a4caf){return function(_0x56a9ee){logger['info']('['+[_0x2e978e[_0x44e8('0x11')]()]+_0x44e8('0x39'),_0x56a9ee);return new Promise(function(_0x4f49f9,_0x160374){var _0x50ace0=_0x2e978e[_0x44e8('0x2f')]()==='outbound'?_0x56a9ee[_0x44e8('0x1d')]:_0x56a9ee[_0x44e8('0x26')];var _0x177078={'method':_0x44e8('0x3a'),'uri':_0x1f126f+_0x44e8('0x3b')+'?'+_0x5a4caf,'body':Object[_0x44e8('0x3c')]({},{'active':_0x44e8('0x1c'),'caller_id':_0x50ace0,'assigned_to':_0x56a9ee[_0x44e8('0x1d')],'short_description':intUtil[_0x44e8('0x3d')](_0x164a6c[_0x44e8('0x3e')],_0x4bd601,'\x20'),'description':intUtil[_0x44e8('0x3d')](_0x164a6c[_0x44e8('0x3f')],_0x4bd601,'\x0a')},getCustomFields(_0x164a6c['Fields'],_0x4bd601)),'auth':_0x265391,'json':!![]};return rp(_0x177078)[_0x44e8('0x1a')](function(_0x33c76c){logger['info']('['+[_0x2e978e[_0x44e8('0x11')]()]+_0x44e8('0x40'),_0x33c76c[_0x44e8('0xd')]);_0x56a9ee[_0x44e8('0x41')]=_0x33c76c[_0x44e8('0xd')][_0x44e8('0xf')];_0x56a9ee[_0x44e8('0x42')]=_0x33c76c[_0x44e8('0xd')][_0x44e8('0x43')];logger[_0x44e8('0x10')]('['+[_0x2e978e[_0x44e8('0x11')]()]+_0x44e8('0x44'),_0x56a9ee);_0x4f49f9(_0x56a9ee);})[_0x44e8('0x13')](function(_0x1ea033){logger[_0x44e8('0x14')]('['+[_0x2e978e[_0x44e8('0x11')]()]+']',_0x1ea033[_0x44e8('0x15')]);_0x160374(_0x1ea033[_0x44e8('0x15')]);});});};}function createRemoteTag(_0x16363b,_0x57e418,_0x4ff037,_0x7fcf55){return new Promise(function(_0x5d3258,_0x5138ac){var _0x189d51={'method':'POST','uri':_0x4ff037+_0x44e8('0x45')+'?'+_0x7fcf55,'body':{'short_description':_0x16363b,'global':!![],'active':!![],'name':_0x16363b},'auth':_0x57e418,'json':!![]};return rp(_0x189d51)[_0x44e8('0x1a')](function(_0x455df6){var _0x4973ad=_0x455df6[_0x44e8('0xd')][_0x44e8('0xf')];_0x5d3258(_0x4973ad);});});}function getRemoteTag(_0x202657,_0x45ac60,_0xb13d76,_0xcb65d9,_0x413c67){return new Promise(function(_0x27c196,_0x23da6d){var _0x120ae9={'method':'GET','uri':_0xb13d76+'label'+'?sysparm_query=name%3D'+_0x202657+'&'+_0xcb65d9,'auth':_0x45ac60,'json':!![]};return rp(_0x120ae9)[_0x44e8('0x1a')](function(_0x50957b){if(_0x50957b[_0x44e8('0xd')][_0x44e8('0xe')]>0x0){var _0x508ba6=_0x50957b['result'][0x0][_0x44e8('0xf')];_0x27c196(_0x508ba6);}else{return createRemoteTag(_0x202657,_0x45ac60,_0xb13d76,_0xcb65d9)[_0x44e8('0x1a')](function(_0x44797b){_0x27c196(_0x44797b);});}});});}function assignTagToIncident(_0x577111,_0x2584a3,_0x4f070a,_0x34dff3,_0x11b589){return new Promise(function(_0x51ffe0,_0x6c1e53){var _0x2f454a={'method':'POST','uri':_0x4f070a+'label_entry'+'?'+_0x11b589,'body':{'label':_0x577111,'table':_0x44e8('0x3b'),'id_type':_0x44e8('0x46'),'table_key':_0x34dff3['ticketId'],'title':_0x44e8('0x47')+_0x34dff3[_0x44e8('0x42')],'id_display':_0x34dff3[_0x44e8('0x42')]},'auth':_0x2584a3,'json':!![]};return rp(_0x2f454a)[_0x44e8('0x1a')](function(_0x3ec47b){_0x51ffe0();})[_0x44e8('0x13')](function(){_0x51ffe0();});});}function manageTags(_0x5994b2,_0x1f3f43,_0x5e2822,_0x16fec0,_0x1165bd,_0x269a3c,_0x79f43f){return new Promise(function(_0x3313a6,_0x54b6ca){var _0x266532=[];_0x1f3f43[_0x44e8('0x29')](function(_0xb05e5){_0x266532[_0x44e8('0x48')](getRemoteTag(_0xb05e5,_0x5e2822,_0x16fec0,_0x269a3c,_0x79f43f));});return Promise[_0x44e8('0x49')](_0x266532)[_0x44e8('0x1a')](function(_0x3314a1){if(_0x3314a1['length']){logger[_0x44e8('0x10')]('['+[_0x5994b2[_0x44e8('0x11')]()]+_0x44e8('0x4a'),_0x3314a1);var _0x15352=[];_0x3314a1['forEach'](function(_0x504772){_0x15352[_0x44e8('0x48')](assignTagToIncident(_0x504772,_0x5e2822,_0x16fec0,_0x1165bd,_0x269a3c));});return Promise[_0x44e8('0x49')](_0x15352)[_0x44e8('0x1a')](function(){_0x3313a6();})[_0x44e8('0x13')](function(){_0x3313a6();});}else{_0x3313a6();}});});}function getTags(_0x4dc14e,_0x4b3e3f,_0x262af3,_0x105eb6,_0x1f97fa,_0x5bc21a){return function(_0x429c3f){return new Promise(function(_0x4ea48d,_0x49f94a){var _0xd36c1c=[];var _0x21729d=_0x105eb6[_0x44e8('0x4b')];if(_0x21729d&&_0x21729d[_0x44e8('0xe')]>0x0){_0xd36c1c=_[_0x44e8('0x4c')](_0x21729d,_0x44e8('0x38'));}if(_0xd36c1c['length']>0x0){return manageTags(_0x4dc14e,_0xd36c1c,_0x4b3e3f,_0x262af3,_0x429c3f,_0x1f97fa,_0x5bc21a)[_0x44e8('0x1a')](function(){_0x4ea48d(_0x429c3f);});}else{_0x4ea48d(_0x429c3f);}});};}function emit(_0x53c27f,_0x572c07,_0x60acd1){var _0x33f2d8=_0x44e8('0x4d')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x44e8('0x4e');var _0x41830d={'uri':_0x53c27f+'/nav_to.do?uri=incident.do?sys_id%3D'+_0x60acd1+_0x33f2d8};io['to'](util[_0x44e8('0x4f')](_0x44e8('0x50'),_0x572c07))[_0x44e8('0x51')](_0x44e8('0x52'),_0x41830d);}exports['cs']=function(_0x42a482,_0x6a9574,_0x2c796a,_0x340382,_0x3aa9f7,_0x2679fb,_0x1aadb5,_0x2215f1){var _0x4f1ca7={};var _0x1628cb={'user':_0x2679fb[_0x44e8('0x53')],'pass':_0x2679fb[_0x44e8('0x54')]};var _0x34e263='sysparm_limit=1';var _0xd22ad1=_0x44e8('0x55');_0x2679fb[_0x44e8('0x56')]=intUtil['stripTrailingSlash'](_0x2679fb[_0x44e8('0x56')]);_0x2679fb[_0x44e8('0x57')]=intUtil['stripTrailingSlash'](_0x2679fb[_0x44e8('0x57')]);var _0xcac68f=util[_0x44e8('0x4f')](_0x44e8('0x58'),_0x2679fb[_0x44e8('0x56')]);_0x4f1ca7[_0x44e8('0x18')]=!_[_0x44e8('0x59')](_0x340382)?_0x340382['email']:null;_0x4f1ca7[_0x44e8('0x1f')]=_0x2679fb[_0x44e8('0x5a')];_0x4f1ca7[_0x44e8('0x22')]=_0x2215f1[_0x44e8('0x2f')]()==='outbound'?_0x6a9574[_0x44e8('0x5b')]:_0x6a9574[_0x44e8('0x5c')];_0x4f1ca7[_0x44e8('0x5d')]=_0x2215f1===_0x44e8('0x5e')||_0x2215f1===_0x44e8('0x5f')?_0x44e8('0x5e'):'outbound';var _0xe1a6aa=util[_0x44e8('0x4f')](_0x44e8('0x60'),_0x2679fb[_0x44e8('0x57')],_0x6a9574[_0x44e8('0x61')],md5(_0x6a9574[_0x44e8('0x61')]));if(_0x3aa9f7&&_0x3aa9f7['monitor_format']){logger[_0x44e8('0x10')](_0x44e8('0x62'),'Recording\x20is\x20enabled!');_0x6a9574[_0x44e8('0x63')]=_0xe1a6aa;}else if(_0x1aadb5&&_0x1aadb5[_0x44e8('0x64')]&&_0x1aadb5[_0x44e8('0x64')]!==_0x44e8('0x65')){logger[_0x44e8('0x10')]('[OUTBOUND]',_0x44e8('0x66'));_0x6a9574[_0x44e8('0x63')]=_0xe1a6aa;}else{_0x6a9574['recordingURL']='';}return getAdminUser(_0x2215f1,_0x1628cb,_0x4f1ca7,_0xcac68f,_0xd22ad1,_0x34e263)['then'](getUser(_0x2215f1,_0x1628cb,_0xcac68f,_0xd22ad1,_0x34e263))[_0x44e8('0x1a')](getEndUser(_0x2215f1,_0x1628cb,_0xcac68f,_0xd22ad1,_0x34e263))[_0x44e8('0x1a')](getTicket(_0x2215f1,_0x1628cb,_0xcac68f,_0x2c796a,_0x6a9574,_0xd22ad1))[_0x44e8('0x1a')](function(_0x26fb5b){logger['info'](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x26fb5b[_0x44e8('0x41')]));logger[_0x44e8('0x10')](util[_0x44e8('0x4f')](_0x44e8('0x67'),_0x2215f1));if(_0x2215f1!==_0x44e8('0x5f')){logger[_0x44e8('0x10')]('['+[_0x2215f1[_0x44e8('0x11')]()]+']',_0x44e8('0x68'));emit(_0x2679fb[_0x44e8('0x56')],_0x340382['name'],_0x26fb5b[_0x44e8('0x41')]);}})['catch'](function(_0x5127c6){logger[_0x44e8('0x14')]('['+[_0x2215f1['toUpperCase']()]+_0x44e8('0x69'),util['inspect'](_0x5127c6,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 6b1c112..bace306 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb5d7=['util','ioredis','./util','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','emit','info','name','getString','Subjects','assigned_user_id','created_by','Descriptions','date_start','toISOString','slice','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','direction','length','push','idField','variableName','JSON','stringify','Calls','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','find','name_value_list','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','value','user_id','phone_home','Enduser\x20found!','set_entry','<unknown>','Caller\x20-\x20%s','first_name','debug','[HTTP]','merge','map','forEach','string','nameField','toLowerCase','content','type','customField','custom_fields','customVariable','Variable','POST','login','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','uri','recordingFormat','[OUTBOUND]','destcalleridnum','Fields','Outbound','Ticket\x20created!','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','unmanaged','lastevent','The\x20User\x20ID\x20is:','toUpperCase','bluebird','md5'];(function(_0x263fcc,_0x38c118){var _0x25a0a1=function(_0x5af6b2){while(--_0x5af6b2){_0x263fcc['push'](_0x263fcc['shift']());}};_0x25a0a1(++_0x38c118);}(_0xb5d7,0x79));var _0x7b5d=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xb5d7[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x7b5d('0x0'));var md5=require(_0x7b5d('0x1'));var util=require(_0x7b5d('0x2'));var Redis=require(_0x7b5d('0x3'));var intUtil=require(_0x7b5d('0x4'));var config=require('../../../../config/environment');var logger=require(_0x7b5d('0x5'))(_0x7b5d('0x6'));config[_0x7b5d('0x7')]=_[_0x7b5d('0x8')](config['redis'],{'host':_0x7b5d('0x9'),'port':0x18eb});var io=require(_0x7b5d('0xa'))(new Redis(config[_0x7b5d('0x7')]));var def={'method':'POST','json':!![]};function emit(_0x4ccde2,_0x180092,_0x50e1e5){io['to'](_0x4ccde2)[_0x7b5d('0xb')](_0x180092,_0x50e1e5);}function getTicket(_0x3c7fc6,_0x430fb3,_0x16a360,_0x2c0b91,_0x1939a1,_0x487197,_0x5d076e,_0x296b0e){logger[_0x7b5d('0xc')]('Creating\x20new\x20ticket...');var _0x168729=new Date();var _0x567dc8=[{'name':_0x7b5d('0xd'),'value':intUtil[_0x7b5d('0xe')](_0x2c0b91[_0x7b5d('0xf')],_0x1939a1,'\x20')},{'name':_0x7b5d('0x10'),'value':_0x430fb3['id']},{'name':_0x7b5d('0x11'),'value':_0x430fb3['id']},{'name':'description','value':intUtil[_0x7b5d('0xe')](_0x2c0b91[_0x7b5d('0x12')],_0x1939a1,'\x0a')},{'name':_0x7b5d('0x13'),'value':_0x168729[_0x7b5d('0x14')]()[_0x7b5d('0x15')](0x0,0x13)['replace']('T','\x20')},{'name':_0x7b5d('0x16'),'value':'0'},{'name':_0x7b5d('0x17'),'value':'15'},{'name':_0x7b5d('0x18'),'value':_0x16a360['id']},{'name':_0x7b5d('0x19'),'value':_0x7b5d('0x1a')},{'name':_0x7b5d('0x1b'),'value':_0x16a360[_0x7b5d('0xd')]},{'name':_0x7b5d('0x1c'),'value':_0x296b0e}];if(_0x487197[_0x7b5d('0x1d')]){_['forEach'](_0x487197,function(_0x270dd0){if(_0x1939a1[_0x270dd0['variableName']]){_0x567dc8[_0x7b5d('0x1e')]({'name':_0x270dd0[_0x7b5d('0x1f')],'value':_0x1939a1[_0x270dd0[_0x7b5d('0x20')]]});}});}return request({'form':{'method':'set_entry','input_type':_0x7b5d('0x21'),'response_type':_0x7b5d('0x21'),'rest_data':JSON[_0x7b5d('0x22')]({'session':_0x5d076e['id'],'module_name':_0x7b5d('0x23'),'name_value_list':_0x567dc8})}});}function getAuth(_0x44d51b){return util['format'](_0x7b5d('0x24'),new Buffer(_0x44d51b[_0x7b5d('0x25')]+':X')[_0x7b5d('0x26')](_0x7b5d('0x27')));}function getServerInfo(_0x1208de){return request({'form':{'method':_0x7b5d('0x28'),'input_type':_0x7b5d('0x21'),'response_type':_0x7b5d('0x21'),'rest_data':JSON['stringify']({'session':_0x1208de['id']})}});}function getUser(_0x13bce2,_0x173212,_0xc2ec9f){if(!_[_0x7b5d('0x29')](_0x173212)){logger[_0x7b5d('0xc')](_0x7b5d('0x2a'),_0x173212);return request({'form':{'method':_0x7b5d('0x2b'),'input_type':_0x7b5d('0x21'),'response_type':_0x7b5d('0x21'),'rest_data':JSON[_0x7b5d('0x22')]({'session':_0xc2ec9f['id'],'module_name':_0x7b5d('0x2c'),'query':util[_0x7b5d('0x2d')](_0x7b5d('0x2e'),_0x173212),'order_by':'','offset':'0','select_fields':['id','name',_0x7b5d('0x2f')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x7b5d('0x30')](function(_0x187e1f){if(_0x187e1f[_0x7b5d('0x31')][_0x7b5d('0x1d')]){var _0x4de2fc=_[_0x7b5d('0x32')](_0x187e1f[_0x7b5d('0x31')],function(_0x4295b9){return _0x4295b9[_0x7b5d('0x33')][_0x7b5d('0x2f')]['value']===_0x173212;});if(_0x4de2fc){logger['info'](_0x7b5d('0x34'));return BPromise[_0x7b5d('0x35')]({'id':_0x4de2fc[_0x7b5d('0x33')]['id']['value'],'name':_0x4de2fc[_0x7b5d('0x33')]['name']['value']});}}logger[_0x7b5d('0xc')](_0x7b5d('0x36'));return BPromise[_0x7b5d('0x35')]({'id':_0xc2ec9f[_0x7b5d('0x33')]['user_id'][_0x7b5d('0x37')],'name':_0xc2ec9f[_0x7b5d('0x33')]['user_name'][_0x7b5d('0x37')]});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0xc2ec9f[_0x7b5d('0x33')][_0x7b5d('0x38')][_0x7b5d('0x37')],'name':_0xc2ec9f[_0x7b5d('0x33')][_0x7b5d('0x2f')]['value']});}}function getEndUser(_0x3f3e5b,_0x262a41,_0x4b34f4,_0xf00bd6){logger[_0x7b5d('0xc')]('Searching\x20enduser\x20with\x20phone',_0x4b34f4);return request({'form':{'method':_0x7b5d('0x2b'),'input_type':_0x7b5d('0x21'),'response_type':_0x7b5d('0x21'),'rest_data':JSON[_0x7b5d('0x22')]({'session':_0xf00bd6['id'],'module_name':_0x7b5d('0x1a'),'query':util[_0x7b5d('0x2d')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x4b34f4),'order_by':'','offset':'0','select_fields':['id',_0x7b5d('0xd'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x4dd18b){if(_0x4dd18b[_0x7b5d('0x31')][_0x7b5d('0x1d')]){var _0x1e1ce2=_[_0x7b5d('0x32')](_0x4dd18b[_0x7b5d('0x31')],function(_0x53dede){return _0x53dede[_0x7b5d('0x33')][_0x7b5d('0x39')][_0x7b5d('0x37')]===_0x4b34f4;});if(_0x1e1ce2){logger[_0x7b5d('0xc')](_0x7b5d('0x3a'));return BPromise[_0x7b5d('0x35')]({'id':_0x1e1ce2['name_value_list']['id'][_0x7b5d('0x37')],'name':_0x1e1ce2['name_value_list']['name'][_0x7b5d('0x37')],'phone':_0x1e1ce2['name_value_list'][_0x7b5d('0x39')]['value']});}}else{logger[_0x7b5d('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x7b5d('0x3b'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0xf00bd6['id'],'module_name':_0x7b5d('0x1a'),'name_value_list':[{'name':'first_name','value':_0x262a41!==_0x7b5d('0x3c')?_0x262a41:util['format'](_0x7b5d('0x3d'),_0x4b34f4)},{'name':_0x7b5d('0x39'),'value':_0x4b34f4}]})}})[_0x7b5d('0x30')](function(_0x12d970){logger[_0x7b5d('0xc')]('Enduser\x20created.');return BPromise[_0x7b5d('0x35')]({'id':_0x12d970['id'],'name':_0x12d970['entry_list'][_0x7b5d('0x3e')][_0x7b5d('0x37')],'phone':_0x12d970[_0x7b5d('0x31')][_0x7b5d('0x39')]['value']});});}});}function request(_0xda0024){logger[_0x7b5d('0x3f')](_0x7b5d('0x40'),JSON['stringify'](_0xda0024));return rp(_[_0x7b5d('0x41')](def,_0xda0024));}function getTags(_0x4522b4,_0xc9b331){var _0x31b97e=[];if(_0x4522b4&&_0x4522b4[_0x7b5d('0x1d')]>0x0){_0x31b97e=_[_0x7b5d('0x42')](_0x4522b4,_0xc9b331);}return _0x31b97e;}function getCustomFields(_0x3be80d,_0x3e5f4b){var _0x46a89b=[];var _0x2d5faf={'custom_fields':[]};if(_0x3be80d[_0x7b5d('0x1d')]>0x0){_[_0x7b5d('0x43')](_0x3be80d,function(_0x1c0771){if(_0x1c0771['type']===_0x7b5d('0x44')&&_0x1c0771[_0x7b5d('0x45')]&&!_0x1c0771['customField']){_0x2d5faf[_0x1c0771[_0x7b5d('0x45')][_0x7b5d('0x46')]()]=_0x1c0771[_0x7b5d('0x47')][_0x7b5d('0x26')]();}else if(_0x1c0771[_0x7b5d('0x48')]===_0x7b5d('0x44')&&_0x1c0771[_0x7b5d('0x1f')]&&_0x1c0771[_0x7b5d('0x49')]){_0x2d5faf['custom_fields'][_0x7b5d('0x1e')]({'id':_0x1c0771[_0x7b5d('0x1f')],'value':_0x1c0771[_0x7b5d('0x47')][_0x7b5d('0x26')]()});}else if(_0x1c0771[_0x7b5d('0x48')]==='variable'&&_0x1c0771[_0x7b5d('0x20')]&&_0x1c0771[_0x7b5d('0x1f')]&&_0x1c0771[_0x7b5d('0x49')]){_0x3e5f4b[_0x1c0771['variableName']]&&_0x2d5faf[_0x7b5d('0x4a')][_0x7b5d('0x1e')]({'id':_0x1c0771[_0x7b5d('0x1f')],'value':_0x3e5f4b[_0x1c0771[_0x7b5d('0x20')]][_0x7b5d('0x26')]()});}else if(_0x1c0771[_0x7b5d('0x48')]===_0x7b5d('0x4b')&&_0x1c0771[_0x7b5d('0x4c')]&&_0x1c0771[_0x7b5d('0x4c')][_0x7b5d('0xd')]&&_0x1c0771[_0x7b5d('0x1f')]&&_0x1c0771[_0x7b5d('0x49')]){_0x3e5f4b[_0x1c0771[_0x7b5d('0x4c')][_0x7b5d('0xd')][_0x7b5d('0x46')]()]&&_0x2d5faf[_0x7b5d('0x4a')][_0x7b5d('0x1e')]({'id':_0x1c0771[_0x7b5d('0x1f')],'value':_0x3e5f4b[_0x1c0771[_0x7b5d('0x4c')][_0x7b5d('0xd')]['toLowerCase']()][_0x7b5d('0x26')]()});}});}return _0x2d5faf;}function getConnection(_0x258fda){return request({'method':_0x7b5d('0x4d'),'form':{'method':_0x7b5d('0x4e'),'input_type':_0x7b5d('0x21'),'response_type':_0x7b5d('0x21'),'rest_data':JSON[_0x7b5d('0x22')]({'user_auth':{'user_name':_0x258fda['username'],'password':_0x258fda[_0x7b5d('0x4f')],'encryption':_0x7b5d('0x50')},'application':_0x7b5d('0x51')})}})['then'](function(_0x316234){var _0x513bf3=_0x316234;if(_0x513bf3['id']){def[_0x7b5d('0x52')]=_0x513bf3['id'];return BPromise[_0x7b5d('0x35')](_0x513bf3);}else{throw new Error(util[_0x7b5d('0x2d')](_0x7b5d('0x53'),_0x258fda['id']));}});}function setRelationship(_0x500b55,_0x468d0f,_0x1dba73,_0x3defd2){return request({'form':{'method':_0x7b5d('0x54'),'input_type':_0x7b5d('0x21'),'response_type':'JSON','rest_data':JSON[_0x7b5d('0x22')]({'session':_0x500b55['id'],'module_name':'Calls','module_id':_0x1dba73['id'],'link_field_name':_0x3defd2,'related_ids':[_0x468d0f['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x7b5d('0x55')]=function(_0x40e57b,_0x5f5979,_0x3c741a,_0x286ddd,_0x487132,_0x1bc456){var _0x54f598,_0x253057,_0x1a61d1,_0x135a38;_0x1bc456[_0x7b5d('0x56')]=intUtil['stripTrailingSlash'](_0x1bc456[_0x7b5d('0x56')]);_0x1bc456['serverUrl']=intUtil[_0x7b5d('0x57')](_0x1bc456['serverUrl']);def['uri']=util['format'](_0x7b5d('0x58'),_0x1bc456[_0x7b5d('0x56')]);if(_0x487132&&_0x487132[_0x7b5d('0x59')]){logger[_0x7b5d('0xc')](_0x7b5d('0x5a'),_0x7b5d('0x5b'));_0x5f5979[_0x7b5d('0x5c')]=util[_0x7b5d('0x2d')](_0x7b5d('0x5d'),_0x1bc456[_0x7b5d('0x5e')],_0x5f5979[_0x7b5d('0x5f')],md5(_0x5f5979[_0x7b5d('0x5f')]));}else{_0x5f5979['recordingURL']='';}return getConnection(_0x1bc456)['then'](function(_0x2c7843){_0x135a38=_0x2c7843;return getUser(_0x1bc456,_0x286ddd['name'],_0x135a38);})[_0x7b5d('0x30')](function(_0x56107d){_0x54f598=_0x56107d;logger[_0x7b5d('0xc')]('The\x20User\x20ID\x20is:',_0x54f598['id']);return getEndUser(_0x1bc456,_0x5f5979[_0x7b5d('0x60')],_0x5f5979[_0x7b5d('0x61')],_0x135a38);})[_0x7b5d('0x30')](function(_0x3424f8){_0x253057=_0x3424f8;logger['info'](_0x7b5d('0x62'),_0x253057['id']);return getTicket(_0x1bc456,_0x54f598,_0x253057,_0x3c741a,_0x5f5979,_0x3c741a['Fields'],_0x135a38,_0x7b5d('0x63'));})[_0x7b5d('0x30')](function(_0x450e0a){_0x1a61d1=_0x450e0a;logger[_0x7b5d('0xc')]('Ticket\x20created!');logger[_0x7b5d('0xc')](_0x7b5d('0x64'),_0x1a61d1['id']);return setRelationship(_0x135a38,_0x54f598,_0x1a61d1,_0x7b5d('0x65'));})['then'](function(){return setRelationship(_0x135a38,_0x253057,_0x1a61d1,_0x7b5d('0x66'));})[_0x7b5d('0x30')](function(){return getServerInfo(_0x135a38);})[_0x7b5d('0x30')](function(_0x4ec92b){var _0x55bd1f=parseInt(_0x4ec92b[_0x7b5d('0x67')][_0x7b5d('0x68')](0x0));var _0x24521b=util[_0x7b5d('0x2d')](_0x7b5d('0x69'),_0x1bc456[_0x7b5d('0x56')],_0x1a61d1['id']);if(_0x55bd1f>0x6){_0x24521b=util['format']('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x1bc456[_0x7b5d('0x56')],_0x1a61d1['id']);}logger[_0x7b5d('0xc')](_0x7b5d('0x5a'),_0x7b5d('0x6a'));emit(util['format'](_0x7b5d('0x6b'),_0x286ddd[_0x7b5d('0xd')]),_0x7b5d('0x6c'),{'uri':_0x24521b});})[_0x7b5d('0x6d')](function(_0x3b885e){logger[_0x7b5d('0x6e')]('[QUEUE]',JSON[_0x7b5d('0x22')](_0x3b885e));});};exports['outbound']=function(_0x1ece8b,_0x3331e,_0xbf5c26,_0x55297e,_0x1bedac,_0x5cb197,_0xf5dccf){var _0x334e6c,_0x13cc2f,_0x3250df,_0x4a5840;_0x5cb197[_0x7b5d('0x56')]=intUtil[_0x7b5d('0x57')](_0x5cb197[_0x7b5d('0x56')]);_0x5cb197[_0x7b5d('0x5e')]=intUtil[_0x7b5d('0x57')](_0x5cb197[_0x7b5d('0x5e')]);def[_0x7b5d('0x6f')]=util['format']('%s/service/v4_1/rest.php',_0x5cb197[_0x7b5d('0x56')]);if(_0xf5dccf&&_0xf5dccf[_0x7b5d('0x70')]&&_0xf5dccf[_0x7b5d('0x70')]!=='none'){logger[_0x7b5d('0xc')](_0x7b5d('0x71'),_0x7b5d('0x5b'));_0x3331e[_0x7b5d('0x5c')]=util[_0x7b5d('0x2d')](_0x7b5d('0x5d'),_0x5cb197[_0x7b5d('0x5e')],_0x3331e['uniqueid'],md5(_0x3331e[_0x7b5d('0x5f')]));}return getConnection(_0x5cb197)[_0x7b5d('0x30')](function(_0x1ac78c){_0x4a5840=_0x1ac78c;return getUser(_0x5cb197,_0x55297e[_0x7b5d('0xd')],_0x4a5840);})['then'](function(_0xb8d71d){_0x334e6c=_0xb8d71d;logger[_0x7b5d('0xc')]('The\x20User\x20ID\x20is:',_0x334e6c['id']);return getEndUser(_0x5cb197,_0x3331e['destcalleridname'],_0x3331e[_0x7b5d('0x72')],_0x4a5840);})['then'](function(_0x3a2628){_0x13cc2f=_0x3a2628;logger['info'](_0x7b5d('0x62'),_0x13cc2f['id']);return getTicket(_0x5cb197,_0x334e6c,_0x13cc2f,_0xbf5c26,_0x3331e,_0xbf5c26[_0x7b5d('0x73')],_0x4a5840,_0x7b5d('0x74'));})[_0x7b5d('0x30')](function(_0x43834c){_0x3250df=_0x43834c;logger[_0x7b5d('0xc')](_0x7b5d('0x75'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x3250df['id']);return setRelationship(_0x4a5840,_0x334e6c,_0x3250df,'users');})['then'](function(){return setRelationship(_0x4a5840,_0x13cc2f,_0x3250df,'contacts');})[_0x7b5d('0x30')](function(){return getServerInfo(_0x4a5840);})[_0x7b5d('0x30')](function(_0x5ccfa0){var _0x2d0fe7=parseInt(_0x5ccfa0[_0x7b5d('0x67')][_0x7b5d('0x68')](0x0));var _0x11c545=util[_0x7b5d('0x2d')](_0x7b5d('0x69'),_0x5cb197[_0x7b5d('0x56')],_0x3250df['id']);if(_0x2d0fe7>0x6){_0x11c545=util[_0x7b5d('0x2d')](_0x7b5d('0x76'),_0x5cb197['remoteUri'],_0x3250df['id']);}logger[_0x7b5d('0xc')](_0x7b5d('0x71'),_0x7b5d('0x6a'));emit(util[_0x7b5d('0x2d')](_0x7b5d('0x6b'),_0x55297e[_0x7b5d('0xd')]),_0x7b5d('0x6c'),{'uri':_0x11c545});})[_0x7b5d('0x6d')](function(_0x18425d){logger[_0x7b5d('0x6e')](_0x7b5d('0x71'),JSON[_0x7b5d('0x22')](_0x18425d));});};exports[_0x7b5d('0x77')]=function(_0x15afb6,_0x356afb,_0xe3f43,_0x47b4ac,_0x292aa9,_0x11c71f){var _0x466dd0,_0x38f627,_0xf06ed6,_0x5dd121;_0x11c71f['remoteUri']=intUtil[_0x7b5d('0x57')](_0x11c71f[_0x7b5d('0x56')]);_0x11c71f[_0x7b5d('0x5e')]=intUtil[_0x7b5d('0x57')](_0x11c71f[_0x7b5d('0x5e')]);def[_0x7b5d('0x6f')]=util[_0x7b5d('0x2d')](_0x7b5d('0x58'),_0x11c71f[_0x7b5d('0x56')]);if(_0x292aa9&&_0x292aa9['monitor_format']){logger[_0x7b5d('0xc')]('['+_0x356afb[_0x7b5d('0x78')]['toUpperCase']()+']',_0x7b5d('0x5b'));_0x356afb[_0x7b5d('0x5c')]=util[_0x7b5d('0x2d')](_0x7b5d('0x5d'),_0x11c71f[_0x7b5d('0x5e')],_0x356afb[_0x7b5d('0x5f')],md5(_0x356afb[_0x7b5d('0x5f')]));}else{_0x356afb[_0x7b5d('0x5c')]='';}return getConnection(_0x11c71f)[_0x7b5d('0x30')](function(_0x2046a){_0x5dd121=_0x2046a;if(!_['isNil'](_0x47b4ac)){return getUser(_0x11c71f,_0x47b4ac[_0x7b5d('0xd')],_0x5dd121);}else{return getUser(_0x11c71f,null,_0x5dd121);}})[_0x7b5d('0x30')](function(_0x31728f){_0x466dd0=_0x31728f;logger[_0x7b5d('0xc')](_0x7b5d('0x79'),_0x466dd0['id']);return getEndUser(_0x11c71f,_0x356afb[_0x7b5d('0x60')],_0x356afb[_0x7b5d('0x61')],_0x5dd121);})[_0x7b5d('0x30')](function(_0x540d7b){_0x38f627=_0x540d7b;logger[_0x7b5d('0xc')](_0x7b5d('0x62'),_0x38f627['id']);return getTicket(_0x11c71f,_0x466dd0,_0x38f627,_0xe3f43,_0x356afb,_0xe3f43[_0x7b5d('0x73')],_0x5dd121,'Inbound');})['then'](function(_0x34b7a3){_0xf06ed6=_0x34b7a3;logger[_0x7b5d('0xc')](_0x7b5d('0x75'));logger['info'](_0x7b5d('0x64'),_0xf06ed6['id']);return setRelationship(_0x5dd121,_0x466dd0,_0xf06ed6,_0x7b5d('0x65'));})[_0x7b5d('0x30')](function(){return setRelationship(_0x5dd121,_0x38f627,_0xf06ed6,_0x7b5d('0x66'));})[_0x7b5d('0x30')](function(){return getServerInfo(_0x5dd121);})['catch'](function(_0x1fa78c){logger['error']('['+_0x356afb['lastevent'][_0x7b5d('0x7a')]()+']',JSON[_0x7b5d('0x22')](_0x1fa78c));});};
\ No newline at end of file
+var _0xb750=['map','type','string','nameField','toLowerCase','content','customField','variable','custom_fields','customVariable','Variable','POST','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','error','outbound','uri','recordingFormat','none','destcalleridname','destcalleridnum','Outbound','version','catch','[OUTBOUND]','lastevent','toUpperCase','Inbound','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','info','name','getString','Subjects','assigned_user_id','Descriptions','date_start','toISOString','slice','duration_hours','parent_id','parent_type','direction','length','forEach','variableName','push','idField','set_entry','JSON','stringify','Calls','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','entry_list','name_value_list','user_name','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','get_entry_list','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','<unknown>','Enduser\x20created.','debug','[HTTP]'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xb750,0x19f));var _0x0b75=function(_0x21721f,_0x4169e5){_0x21721f=_0x21721f-0x0;var _0x4b3367=_0xb750[_0x21721f];return _0x4b3367;};'use strict';var _=require(_0x0b75('0x0'));var rp=require('request-promise');var BPromise=require('bluebird');var md5=require('md5');var util=require(_0x0b75('0x1'));var Redis=require(_0x0b75('0x2'));var intUtil=require(_0x0b75('0x3'));var config=require(_0x0b75('0x4'));var logger=require(_0x0b75('0x5'))('sugarcrm');config[_0x0b75('0x6')]=_['defaults'](config[_0x0b75('0x6')],{'host':_0x0b75('0x7'),'port':0x18eb});var io=require(_0x0b75('0x8'))(new Redis(config[_0x0b75('0x6')]));var def={'method':'POST','json':!![]};function emit(_0x6078ec,_0x506b03,_0x4da4e7){io['to'](_0x6078ec)['emit'](_0x506b03,_0x4da4e7);}function getTicket(_0x5d2a91,_0x38a3c2,_0x333583,_0x10b7b4,_0x5f14bd,_0x1f2657,_0x3356a3,_0x4bc0fd){logger[_0x0b75('0x9')]('Creating\x20new\x20ticket...');var _0x125a55=new Date();var _0x405e72=[{'name':_0x0b75('0xa'),'value':intUtil[_0x0b75('0xb')](_0x10b7b4[_0x0b75('0xc')],_0x5f14bd,'\x20')},{'name':_0x0b75('0xd'),'value':_0x38a3c2['id']},{'name':'created_by','value':_0x38a3c2['id']},{'name':'description','value':intUtil['getString'](_0x10b7b4[_0x0b75('0xe')],_0x5f14bd,'\x0a')},{'name':_0x0b75('0xf'),'value':_0x125a55[_0x0b75('0x10')]()[_0x0b75('0x11')](0x0,0x13)['replace']('T','\x20')},{'name':_0x0b75('0x12'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x0b75('0x13'),'value':_0x333583['id']},{'name':_0x0b75('0x14'),'value':'Contacts'},{'name':'parent_name','value':_0x333583[_0x0b75('0xa')]},{'name':_0x0b75('0x15'),'value':_0x4bc0fd}];if(_0x1f2657[_0x0b75('0x16')]){_[_0x0b75('0x17')](_0x1f2657,function(_0x2113db){if(_0x5f14bd[_0x2113db[_0x0b75('0x18')]]){_0x405e72[_0x0b75('0x19')]({'name':_0x2113db[_0x0b75('0x1a')],'value':_0x5f14bd[_0x2113db['variableName']]});}});}return request({'form':{'method':_0x0b75('0x1b'),'input_type':_0x0b75('0x1c'),'response_type':_0x0b75('0x1c'),'rest_data':JSON[_0x0b75('0x1d')]({'session':_0x3356a3['id'],'module_name':_0x0b75('0x1e'),'name_value_list':_0x405e72})}});}function getAuth(_0x7f748){return util['format']('Basic\x20%s',new Buffer(_0x7f748[_0x0b75('0x1f')]+':X')[_0x0b75('0x20')](_0x0b75('0x21')));}function getServerInfo(_0x49fb35){return request({'form':{'method':_0x0b75('0x22'),'input_type':_0x0b75('0x1c'),'response_type':_0x0b75('0x1c'),'rest_data':JSON[_0x0b75('0x1d')]({'session':_0x49fb35['id']})}});}function getUser(_0x4c0f57,_0x175231,_0x1df884){if(!_[_0x0b75('0x23')](_0x175231)){logger['info'](_0x0b75('0x24'),_0x175231);return request({'form':{'method':'get_entry_list','input_type':_0x0b75('0x1c'),'response_type':_0x0b75('0x1c'),'rest_data':JSON[_0x0b75('0x1d')]({'session':_0x1df884['id'],'module_name':'Employees','query':util[_0x0b75('0x25')](_0x0b75('0x26'),_0x175231),'order_by':'','offset':'0','select_fields':['id',_0x0b75('0xa'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x344a58){if(_0x344a58[_0x0b75('0x27')][_0x0b75('0x16')]){var _0x36f728=_['find'](_0x344a58[_0x0b75('0x27')],function(_0xf07d5){return _0xf07d5[_0x0b75('0x28')][_0x0b75('0x29')][_0x0b75('0x2a')]===_0x175231;});if(_0x36f728){logger['info'](_0x0b75('0x2b'));return BPromise[_0x0b75('0x2c')]({'id':_0x36f728['name_value_list']['id'][_0x0b75('0x2a')],'name':_0x36f728['name_value_list'][_0x0b75('0xa')]['value']});}}logger[_0x0b75('0x9')](_0x0b75('0x2d'));return BPromise[_0x0b75('0x2c')]({'id':_0x1df884[_0x0b75('0x28')][_0x0b75('0x2e')]['value'],'name':_0x1df884['name_value_list'][_0x0b75('0x29')][_0x0b75('0x2a')]});});}else{logger[_0x0b75('0x9')](_0x0b75('0x2f'));return BPromise[_0x0b75('0x2c')]({'id':_0x1df884['name_value_list'][_0x0b75('0x2e')][_0x0b75('0x2a')],'name':_0x1df884['name_value_list']['user_name'][_0x0b75('0x2a')]});}}function getEndUser(_0x2b1638,_0x2f42f6,_0x1f1c82,_0x29237f){logger[_0x0b75('0x9')]('Searching\x20enduser\x20with\x20phone',_0x1f1c82);return request({'form':{'method':_0x0b75('0x30'),'input_type':_0x0b75('0x1c'),'response_type':_0x0b75('0x1c'),'rest_data':JSON[_0x0b75('0x1d')]({'session':_0x29237f['id'],'module_name':_0x0b75('0x31'),'query':util['format'](_0x0b75('0x32'),_0x1f1c82),'order_by':'','offset':'0','select_fields':['id','name',_0x0b75('0x33')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x0b75('0x34')](function(_0x595852){if(_0x595852[_0x0b75('0x27')]['length']){var _0x4e65ec=_[_0x0b75('0x35')](_0x595852[_0x0b75('0x27')],function(_0x7cb5af){return _0x7cb5af['name_value_list'][_0x0b75('0x33')][_0x0b75('0x2a')]===_0x1f1c82;});if(_0x4e65ec){logger[_0x0b75('0x9')](_0x0b75('0x36'));return BPromise[_0x0b75('0x2c')]({'id':_0x4e65ec[_0x0b75('0x28')]['id']['value'],'name':_0x4e65ec[_0x0b75('0x28')]['name'][_0x0b75('0x2a')],'phone':_0x4e65ec['name_value_list'][_0x0b75('0x33')]['value']});}}else{logger['info'](_0x0b75('0x37'));return request({'form':{'method':_0x0b75('0x1b'),'input_type':_0x0b75('0x1c'),'response_type':_0x0b75('0x1c'),'rest_data':JSON['stringify']({'session':_0x29237f['id'],'module_name':'Contacts','name_value_list':[{'name':_0x0b75('0x38'),'value':_0x2f42f6!==_0x0b75('0x39')?_0x2f42f6:util[_0x0b75('0x25')]('Caller\x20-\x20%s',_0x1f1c82)},{'name':_0x0b75('0x33'),'value':_0x1f1c82}]})}})[_0x0b75('0x34')](function(_0x49a081){logger['info'](_0x0b75('0x3a'));return BPromise[_0x0b75('0x2c')]({'id':_0x49a081['id'],'name':_0x49a081[_0x0b75('0x27')][_0x0b75('0x38')]['value'],'phone':_0x49a081[_0x0b75('0x27')]['phone_home']['value']});});}});}function request(_0x127fda){logger[_0x0b75('0x3b')](_0x0b75('0x3c'),JSON[_0x0b75('0x1d')](_0x127fda));return rp(_['merge'](def,_0x127fda));}function getTags(_0x71aae1,_0x5471a7){var _0x1e6009=[];if(_0x71aae1&&_0x71aae1[_0x0b75('0x16')]>0x0){_0x1e6009=_[_0x0b75('0x3d')](_0x71aae1,_0x5471a7);}return _0x1e6009;}function getCustomFields(_0x5bbbe7,_0x3feed7){var _0xadc780=[];var _0x4271ec={'custom_fields':[]};if(_0x5bbbe7['length']>0x0){_['forEach'](_0x5bbbe7,function(_0x45d682){if(_0x45d682[_0x0b75('0x3e')]===_0x0b75('0x3f')&&_0x45d682[_0x0b75('0x40')]&&!_0x45d682['customField']){_0x4271ec[_0x45d682[_0x0b75('0x40')][_0x0b75('0x41')]()]=_0x45d682[_0x0b75('0x42')]['toString']();}else if(_0x45d682[_0x0b75('0x3e')]==='string'&&_0x45d682[_0x0b75('0x1a')]&&_0x45d682[_0x0b75('0x43')]){_0x4271ec['custom_fields']['push']({'id':_0x45d682['idField'],'value':_0x45d682[_0x0b75('0x42')][_0x0b75('0x20')]()});}else if(_0x45d682[_0x0b75('0x3e')]===_0x0b75('0x44')&&_0x45d682[_0x0b75('0x18')]&&_0x45d682['idField']&&_0x45d682['customField']){_0x3feed7[_0x45d682['variableName']]&&_0x4271ec[_0x0b75('0x45')][_0x0b75('0x19')]({'id':_0x45d682[_0x0b75('0x1a')],'value':_0x3feed7[_0x45d682[_0x0b75('0x18')]]['toString']()});}else if(_0x45d682[_0x0b75('0x3e')]===_0x0b75('0x46')&&_0x45d682['Variable']&&_0x45d682[_0x0b75('0x47')]['name']&&_0x45d682['idField']&&_0x45d682[_0x0b75('0x43')]){_0x3feed7[_0x45d682[_0x0b75('0x47')][_0x0b75('0xa')]['toLowerCase']()]&&_0x4271ec[_0x0b75('0x45')][_0x0b75('0x19')]({'id':_0x45d682[_0x0b75('0x1a')],'value':_0x3feed7[_0x45d682[_0x0b75('0x47')][_0x0b75('0xa')][_0x0b75('0x41')]()]['toString']()});}});}return _0x4271ec;}function getConnection(_0x1256fa){return request({'method':_0x0b75('0x48'),'form':{'method':'login','input_type':_0x0b75('0x1c'),'response_type':_0x0b75('0x1c'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x1256fa[_0x0b75('0x49')],'password':_0x1256fa[_0x0b75('0x4a')],'encryption':_0x0b75('0x4b')},'application':_0x0b75('0x4c')})}})[_0x0b75('0x34')](function(_0x5c9ba0){var _0x11d4e4=_0x5c9ba0;if(_0x11d4e4['id']){def[_0x0b75('0x4d')]=_0x11d4e4['id'];return BPromise['resolve'](_0x11d4e4);}else{throw new Error(util['format'](_0x0b75('0x4e'),_0x1256fa['id']));}});}function setRelationship(_0x3b6342,_0x492765,_0x32e416,_0x3dc885){return request({'form':{'method':_0x0b75('0x4f'),'input_type':_0x0b75('0x1c'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x3b6342['id'],'module_name':_0x0b75('0x1e'),'module_id':_0x32e416['id'],'link_field_name':_0x3dc885,'related_ids':[_0x492765['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x0b75('0x50')]=function(_0x5c4569,_0x5a29b5,_0x84e8ba,_0x2620cc,_0xa22dba,_0x5ee950){var _0x406455,_0x26a287,_0x3af9b8,_0x516704;_0x5ee950[_0x0b75('0x51')]=intUtil[_0x0b75('0x52')](_0x5ee950[_0x0b75('0x51')]);_0x5ee950[_0x0b75('0x53')]=intUtil[_0x0b75('0x52')](_0x5ee950[_0x0b75('0x53')]);def['uri']=util[_0x0b75('0x25')](_0x0b75('0x54'),_0x5ee950['remoteUri']);if(_0xa22dba&&_0xa22dba[_0x0b75('0x55')]){logger[_0x0b75('0x9')](_0x0b75('0x56'),_0x0b75('0x57'));_0x5a29b5[_0x0b75('0x58')]=util[_0x0b75('0x25')](_0x0b75('0x59'),_0x5ee950[_0x0b75('0x53')],_0x5a29b5[_0x0b75('0x5a')],md5(_0x5a29b5[_0x0b75('0x5a')]));}else{_0x5a29b5['recordingURL']='';}return getConnection(_0x5ee950)[_0x0b75('0x34')](function(_0xf15238){_0x516704=_0xf15238;return getUser(_0x5ee950,_0x2620cc[_0x0b75('0xa')],_0x516704);})[_0x0b75('0x34')](function(_0x3651ba){_0x406455=_0x3651ba;logger[_0x0b75('0x9')](_0x0b75('0x5b'),_0x406455['id']);return getEndUser(_0x5ee950,_0x5a29b5[_0x0b75('0x5c')],_0x5a29b5[_0x0b75('0x5d')],_0x516704);})[_0x0b75('0x34')](function(_0x582099){_0x26a287=_0x582099;logger[_0x0b75('0x9')](_0x0b75('0x5e'),_0x26a287['id']);return getTicket(_0x5ee950,_0x406455,_0x26a287,_0x84e8ba,_0x5a29b5,_0x84e8ba[_0x0b75('0x5f')],_0x516704,'Inbound');})['then'](function(_0x18756b){_0x3af9b8=_0x18756b;logger[_0x0b75('0x9')](_0x0b75('0x60'));logger[_0x0b75('0x9')](_0x0b75('0x61'),_0x3af9b8['id']);return setRelationship(_0x516704,_0x406455,_0x3af9b8,_0x0b75('0x62'));})[_0x0b75('0x34')](function(){return setRelationship(_0x516704,_0x26a287,_0x3af9b8,_0x0b75('0x63'));})['then'](function(){return getServerInfo(_0x516704);})['then'](function(_0x387c42){var _0x20c2f1=parseInt(_0x387c42['version'][_0x0b75('0x64')](0x0));var _0x2eb257=util['format'](_0x0b75('0x65'),_0x5ee950[_0x0b75('0x51')],_0x3af9b8['id']);if(_0x20c2f1>0x6){_0x2eb257=util['format'](_0x0b75('0x66'),_0x5ee950['remoteUri'],_0x3af9b8['id']);}logger['info'](_0x0b75('0x56'),_0x0b75('0x67'));emit(util[_0x0b75('0x25')](_0x0b75('0x68'),_0x2620cc[_0x0b75('0xa')]),'trigger:browser:url',{'uri':_0x2eb257});})['catch'](function(_0x2f8aff){logger[_0x0b75('0x69')](_0x0b75('0x56'),JSON['stringify'](_0x2f8aff));});};exports[_0x0b75('0x6a')]=function(_0x1faf0c,_0x25764d,_0x2b2f76,_0x2a9c67,_0x1a2a2c,_0x44ed9d,_0x170192){var _0x41dab9,_0xb1264b,_0x5205b5,_0x33a844;_0x44ed9d[_0x0b75('0x51')]=intUtil[_0x0b75('0x52')](_0x44ed9d[_0x0b75('0x51')]);_0x44ed9d['serverUrl']=intUtil['stripTrailingSlash'](_0x44ed9d[_0x0b75('0x53')]);def[_0x0b75('0x6b')]=util[_0x0b75('0x25')](_0x0b75('0x54'),_0x44ed9d[_0x0b75('0x51')]);if(_0x170192&&_0x170192[_0x0b75('0x6c')]&&_0x170192[_0x0b75('0x6c')]!==_0x0b75('0x6d')){logger[_0x0b75('0x9')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x25764d[_0x0b75('0x58')]=util[_0x0b75('0x25')](_0x0b75('0x59'),_0x44ed9d[_0x0b75('0x53')],_0x25764d[_0x0b75('0x5a')],md5(_0x25764d['uniqueid']));}return getConnection(_0x44ed9d)['then'](function(_0x31cd91){_0x33a844=_0x31cd91;return getUser(_0x44ed9d,_0x2a9c67[_0x0b75('0xa')],_0x33a844);})['then'](function(_0x5dd156){_0x41dab9=_0x5dd156;logger[_0x0b75('0x9')](_0x0b75('0x5b'),_0x41dab9['id']);return getEndUser(_0x44ed9d,_0x25764d[_0x0b75('0x6e')],_0x25764d[_0x0b75('0x6f')],_0x33a844);})[_0x0b75('0x34')](function(_0x2ea78b){_0xb1264b=_0x2ea78b;logger['info']('The\x20Enduser\x20ID\x20is:',_0xb1264b['id']);return getTicket(_0x44ed9d,_0x41dab9,_0xb1264b,_0x2b2f76,_0x25764d,_0x2b2f76['Fields'],_0x33a844,_0x0b75('0x70'));})[_0x0b75('0x34')](function(_0x4e6f1a){_0x5205b5=_0x4e6f1a;logger['info']('Ticket\x20created!');logger['info'](_0x0b75('0x61'),_0x5205b5['id']);return setRelationship(_0x33a844,_0x41dab9,_0x5205b5,_0x0b75('0x62'));})['then'](function(){return setRelationship(_0x33a844,_0xb1264b,_0x5205b5,_0x0b75('0x63'));})['then'](function(){return getServerInfo(_0x33a844);})[_0x0b75('0x34')](function(_0x35fa58){var _0xeec727=parseInt(_0x35fa58[_0x0b75('0x71')]['charAt'](0x0));var _0x56bfb2=util[_0x0b75('0x25')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x44ed9d[_0x0b75('0x51')],_0x5205b5['id']);if(_0xeec727>0x6){_0x56bfb2=util[_0x0b75('0x25')](_0x0b75('0x66'),_0x44ed9d[_0x0b75('0x51')],_0x5205b5['id']);}logger[_0x0b75('0x9')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x0b75('0x68'),_0x2a9c67[_0x0b75('0xa')]),'trigger:browser:url',{'uri':_0x56bfb2});})[_0x0b75('0x72')](function(_0x870a08){logger[_0x0b75('0x69')](_0x0b75('0x73'),JSON['stringify'](_0x870a08));});};exports['unmanaged']=function(_0x501c7d,_0x42e9e7,_0x3f8cac,_0x30550f,_0xfdaf55,_0x3009ef){var _0x1ff176,_0x270a1d,_0x30b8c4,_0x35eb56;_0x3009ef[_0x0b75('0x51')]=intUtil['stripTrailingSlash'](_0x3009ef['remoteUri']);_0x3009ef[_0x0b75('0x53')]=intUtil['stripTrailingSlash'](_0x3009ef['serverUrl']);def[_0x0b75('0x6b')]=util[_0x0b75('0x25')]('%s/service/v4_1/rest.php',_0x3009ef['remoteUri']);if(_0xfdaf55&&_0xfdaf55[_0x0b75('0x55')]){logger['info']('['+_0x42e9e7[_0x0b75('0x74')][_0x0b75('0x75')]()+']','Recording\x20is\x20enabled!');_0x42e9e7[_0x0b75('0x58')]=util[_0x0b75('0x25')](_0x0b75('0x59'),_0x3009ef['serverUrl'],_0x42e9e7[_0x0b75('0x5a')],md5(_0x42e9e7[_0x0b75('0x5a')]));}else{_0x42e9e7[_0x0b75('0x58')]='';}return getConnection(_0x3009ef)['then'](function(_0x20bebb){_0x35eb56=_0x20bebb;if(!_[_0x0b75('0x23')](_0x30550f)){return getUser(_0x3009ef,_0x30550f[_0x0b75('0xa')],_0x35eb56);}else{return getUser(_0x3009ef,null,_0x35eb56);}})[_0x0b75('0x34')](function(_0x3eb73b){_0x1ff176=_0x3eb73b;logger[_0x0b75('0x9')](_0x0b75('0x5b'),_0x1ff176['id']);return getEndUser(_0x3009ef,_0x42e9e7['calleridname'],_0x42e9e7[_0x0b75('0x5d')],_0x35eb56);})['then'](function(_0x10cb14){_0x270a1d=_0x10cb14;logger[_0x0b75('0x9')](_0x0b75('0x5e'),_0x270a1d['id']);return getTicket(_0x3009ef,_0x1ff176,_0x270a1d,_0x3f8cac,_0x42e9e7,_0x3f8cac[_0x0b75('0x5f')],_0x35eb56,_0x0b75('0x76'));})['then'](function(_0x3a0aec){_0x30b8c4=_0x3a0aec;logger[_0x0b75('0x9')](_0x0b75('0x60'));logger['info'](_0x0b75('0x61'),_0x30b8c4['id']);return setRelationship(_0x35eb56,_0x1ff176,_0x30b8c4,_0x0b75('0x62'));})[_0x0b75('0x34')](function(){return setRelationship(_0x35eb56,_0x270a1d,_0x30b8c4,_0x0b75('0x63'));})[_0x0b75('0x34')](function(){return getServerInfo(_0x35eb56);})[_0x0b75('0x72')](function(_0x5ce1d4){logger[_0x0b75('0x69')]('['+_0x42e9e7[_0x0b75('0x74')][_0x0b75('0x75')]()+']',JSON[_0x0b75('0x1d')](_0x5ce1d4));});};
\ No newline at end of file
index 2381013..a28cbac 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5790=['getString','sortBy','length','type','push','variable','variableName','toString','customVariable','Variable','toLowerCase','name','string','key','format','%s:\x20%s','keyContent','keyType','join','stripTrailingSlash','slice','substring','lastIndexOf','isNil','test','lodash'];(function(_0x2738a0,_0x379e6e){var _0x4308ef=function(_0x5098a2){while(--_0x5098a2){_0x2738a0['push'](_0x2738a0['shift']());}};_0x4308ef(++_0x379e6e);}(_0x5790,0xe9));var _0x0579=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x5790[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x0579('0x0'));var util=require('util');exports[_0x0579('0x1')]=function(_0x18da17,_0x55d16c,_0x23507f){var _0x197949=[];if(_0x18da17['length']>0x0){var _0x2fc868=_[_0x0579('0x2')](_0x18da17,['id']);for(var _0x12b2bb=0x0;_0x12b2bb<_0x2fc868[_0x0579('0x3')];_0x12b2bb++){var _0x34b563=_0x2fc868[_0x12b2bb];if(_0x34b563[_0x0579('0x4')]==='string'){_0x197949[_0x0579('0x5')](_0x34b563['content']);}else if(_0x34b563['type']===_0x0579('0x6')&&_0x34b563[_0x0579('0x7')]){_0x55d16c[_0x34b563['variableName']]&&_0x197949[_0x0579('0x5')](_0x55d16c[_0x34b563[_0x0579('0x7')]][_0x0579('0x8')]());}else if(_0x34b563[_0x0579('0x4')]===_0x0579('0x9')&&_0x34b563[_0x0579('0xa')]&&_0x34b563['Variable']['name']){_0x55d16c[_0x34b563[_0x0579('0xa')]['name'][_0x0579('0xb')]()]&&_0x197949[_0x0579('0x5')](_0x55d16c[_0x34b563[_0x0579('0xa')][_0x0579('0xc')]['toLowerCase']()][_0x0579('0x8')]());}else if(_0x34b563['type']==='keyValue'){if(_0x34b563['keyType']===_0x0579('0xd')&&_0x34b563[_0x0579('0xe')]){_0x197949[_0x0579('0x5')](util[_0x0579('0xf')](_0x0579('0x10'),_0x34b563['key'],_0x34b563[_0x0579('0x11')]));}else if(_0x34b563[_0x0579('0x12')]===_0x0579('0x6')&&_0x34b563[_0x0579('0x7')]&&_0x34b563[_0x0579('0xe')]){_0x55d16c[_0x34b563[_0x0579('0x7')]]&&_0x197949[_0x0579('0x5')](util['format']('%s:\x20%s',_0x34b563['key'],_0x55d16c[_0x34b563['variableName']]));}else if(_0x34b563['keyType']===_0x0579('0x9')&&_0x34b563[_0x0579('0xa')]&&_0x34b563['Variable'][_0x0579('0xc')]&&_0x34b563[_0x0579('0xe')]){_0x55d16c[_0x34b563['Variable'][_0x0579('0xc')]['toLowerCase']()]&&_0x197949['push'](util[_0x0579('0xf')](_0x0579('0x10'),_0x34b563[_0x0579('0xe')],_0x55d16c[_0x34b563[_0x0579('0xa')][_0x0579('0xc')]['toLowerCase']()]));}}}}return _0x197949[_0x0579('0x13')](_0x23507f);};exports[_0x0579('0x14')]=function(_0x3d5b2b){var _0x14db34=_0x3d5b2b[_0x0579('0x15')](-0x1);if(_0x14db34==='/'){_0x3d5b2b=_0x3d5b2b[_0x0579('0x16')](0x0,_0x3d5b2b[_0x0579('0x17')](_0x14db34));}return _0x3d5b2b;};exports['validateEmail']=function(_0x8916f6){if(!_[_0x0579('0x18')](_0x8916f6)&&_0x8916f6!==''){var _0x5644c1=/^(([^<>()\[\]\\.,;:\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 _0x5644c1[_0x0579('0x19')](String(_0x8916f6)[_0x0579('0xb')]());}else{return![];}};
\ No newline at end of file
+var _0xa340=['name','toLowerCase','toString','keyValue','format','%s:\x20%s','keyContent','key','keyType','join','stripTrailingSlash','substring','lastIndexOf','isNil','test','lodash','util','getString','length','sortBy','type','string','push','variable','variableName','customVariable','Variable'];(function(_0x4087a4,_0xcc1d6d){var _0x245694=function(_0x2fb92f){while(--_0x2fb92f){_0x4087a4['push'](_0x4087a4['shift']());}};_0x245694(++_0xcc1d6d);}(_0xa340,0x11d));var _0x0a34=function(_0x5f467f,_0x26c296){_0x5f467f=_0x5f467f-0x0;var _0x4143aa=_0xa340[_0x5f467f];return _0x4143aa;};'use strict';var _=require(_0x0a34('0x0'));var util=require(_0x0a34('0x1'));exports[_0x0a34('0x2')]=function(_0x3e6eee,_0x4695f2,_0x2139e8){var _0x3294cb=[];if(_0x3e6eee[_0x0a34('0x3')]>0x0){var _0x577bfc=_[_0x0a34('0x4')](_0x3e6eee,['id']);for(var _0x2264be=0x0;_0x2264be<_0x577bfc['length'];_0x2264be++){var _0x15be4b=_0x577bfc[_0x2264be];if(_0x15be4b[_0x0a34('0x5')]===_0x0a34('0x6')){_0x3294cb[_0x0a34('0x7')](_0x15be4b['content']);}else if(_0x15be4b[_0x0a34('0x5')]===_0x0a34('0x8')&&_0x15be4b[_0x0a34('0x9')]){_0x4695f2[_0x15be4b[_0x0a34('0x9')]]&&_0x3294cb[_0x0a34('0x7')](_0x4695f2[_0x15be4b[_0x0a34('0x9')]]['toString']());}else if(_0x15be4b['type']===_0x0a34('0xa')&&_0x15be4b[_0x0a34('0xb')]&&_0x15be4b[_0x0a34('0xb')][_0x0a34('0xc')]){_0x4695f2[_0x15be4b[_0x0a34('0xb')][_0x0a34('0xc')][_0x0a34('0xd')]()]&&_0x3294cb[_0x0a34('0x7')](_0x4695f2[_0x15be4b['Variable'][_0x0a34('0xc')][_0x0a34('0xd')]()][_0x0a34('0xe')]());}else if(_0x15be4b[_0x0a34('0x5')]===_0x0a34('0xf')){if(_0x15be4b['keyType']==='string'&&_0x15be4b['key']){_0x3294cb[_0x0a34('0x7')](util[_0x0a34('0x10')](_0x0a34('0x11'),_0x15be4b['key'],_0x15be4b[_0x0a34('0x12')]));}else if(_0x15be4b['keyType']===_0x0a34('0x8')&&_0x15be4b[_0x0a34('0x9')]&&_0x15be4b[_0x0a34('0x13')]){_0x4695f2[_0x15be4b[_0x0a34('0x9')]]&&_0x3294cb[_0x0a34('0x7')](util[_0x0a34('0x10')](_0x0a34('0x11'),_0x15be4b['key'],_0x4695f2[_0x15be4b[_0x0a34('0x9')]]));}else if(_0x15be4b[_0x0a34('0x14')]===_0x0a34('0xa')&&_0x15be4b[_0x0a34('0xb')]&&_0x15be4b[_0x0a34('0xb')]['name']&&_0x15be4b[_0x0a34('0x13')]){_0x4695f2[_0x15be4b[_0x0a34('0xb')][_0x0a34('0xc')]['toLowerCase']()]&&_0x3294cb[_0x0a34('0x7')](util[_0x0a34('0x10')](_0x0a34('0x11'),_0x15be4b[_0x0a34('0x13')],_0x4695f2[_0x15be4b[_0x0a34('0xb')][_0x0a34('0xc')][_0x0a34('0xd')]()]));}}}}return _0x3294cb[_0x0a34('0x15')](_0x2139e8);};exports[_0x0a34('0x16')]=function(_0x30b46b){var _0x281df7=_0x30b46b['slice'](-0x1);if(_0x281df7==='/'){_0x30b46b=_0x30b46b[_0x0a34('0x17')](0x0,_0x30b46b[_0x0a34('0x18')](_0x281df7));}return _0x30b46b;};exports['validateEmail']=function(_0x35c4d1){if(!_[_0x0a34('0x19')](_0x35c4d1)&&_0x35c4d1!==''){var _0x36c666=/^(([^<>()\[\]\\.,;:\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 _0x36c666[_0x0a34('0x1a')](String(_0x35c4d1)[_0x0a34('0xd')]());}else{return![];}};
\ No newline at end of file
index ca072ae..00e671e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','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]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x276fae,_0x1424c1){var _0x132c7e=function(_0x4bf08a){while(--_0x4bf08a){_0x276fae['push'](_0x276fae['shift']());}};_0x132c7e(++_0x1424c1);}(_0xe706,0xa3));var _0x6e70=function(_0x25ad66,_0x46e4dc){_0x25ad66=_0x25ad66-0x0;var _0x141bc4=_0xe706[_0x25ad66];return _0x141bc4;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});};
\ No newline at end of file
+var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});};
\ No newline at end of file
index a4e48d8..ebf899a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x44e5=['Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','Zendesk\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase','calleridname','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','remoteUri','POST','merge','Tags','name','Subjects','Descriptions','Fields','then','Ticket\x20created!','Getting\x20agent\x20with\x20email','format','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','filter','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','Enduser\x20created.','user','authType','%s:%s','password','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','string','picklist','type','nameField','toLowerCase','idField','customField','push','content','variable','variableName','custom_fields','customVariable','Variable','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','Authorization','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json'];(function(_0x7266ce,_0x2d9063){var _0x870e0=function(_0x4dc8f9){while(--_0x4dc8f9){_0x7266ce['push'](_0x7266ce['shift']());}};_0x870e0(++_0x2d9063);}(_0x44e5,0x14e));var _0x544e=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0x44e5[_0x231e16];return _0x570a7c;};'use strict';var _=require('lodash');var rp=require(_0x544e('0x0'));var md5=require(_0x544e('0x1'));var util=require(_0x544e('0x2'));var Redis=require(_0x544e('0x3'));var intUtil=require(_0x544e('0x4'));var config=require(_0x544e('0x5'));var logger=require(_0x544e('0x6'))(_0x544e('0x7'));config[_0x544e('0x8')]=_[_0x544e('0x9')](config[_0x544e('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x544e('0xa'))(new Redis(config[_0x544e('0x8')]));function emit(_0x5cf9bb,_0x529c45,_0x53d624){io['to'](_0x5cf9bb)['emit'](_0x529c45,_0x53d624);}var headers={'Content-Type':_0x544e('0xb'),'Accept':'application/json'};function getTicket(_0x3a4baa,_0x951dd,_0x346684,_0x2ca11c,_0x10d18f){logger[_0x544e('0xc')](_0x544e('0xd'));return request({'uri':util['format']('%s/tickets.json',_0x3a4baa[_0x544e('0xe')]),'method':_0x544e('0xf'),'body':{'ticket':_[_0x544e('0x10')]({'requester_id':_0x346684['id'],'submitter_id':_0x951dd?_0x951dd['id']:undefined,'assignee_id':_0x951dd?_0x951dd['id']:undefined,'tags':getTags(_0x2ca11c[_0x544e('0x11')],_0x544e('0x12')),'subject':intUtil['getString'](_0x2ca11c[_0x544e('0x13')],_0x10d18f,'\x20'),'description':intUtil['getString'](_0x2ca11c[_0x544e('0x14')],_0x10d18f,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x2ca11c[_0x544e('0x14')],_0x10d18f,'\x0a')}},getCustomFields(_0x2ca11c[_0x544e('0x15')],_0x10d18f))}})[_0x544e('0x16')](function(_0x241de6){logger[_0x544e('0xc')](_0x544e('0x17'));return _0x241de6['ticket'];});}function getUser(_0x286614,_0x2159e7){if(intUtil['validateEmail'](_0x2159e7)){logger[_0x544e('0xc')](_0x544e('0x18'),_0x2159e7);return request({'uri':util[_0x544e('0x19')](_0x544e('0x1a'),_0x286614[_0x544e('0xe')]),'qs':{'query':util[_0x544e('0x19')](_0x544e('0x1b'),_0x2159e7)}})[_0x544e('0x16')](function(_0x2371f2){if(_0x2371f2[_0x544e('0x1c')]){logger[_0x544e('0xc')](_0x544e('0x1d'));return _['find'](_0x2371f2[_0x544e('0x1e')],{'email':_0x2159e7,'role':_0x544e('0x1f')});}else{logger[_0x544e('0xc')](_0x544e('0x20'));return request({'uri':util[_0x544e('0x19')](_0x544e('0x21'),_0x286614[_0x544e('0xe')])})[_0x544e('0x16')](function(_0x176983){logger[_0x544e('0xc')](_0x544e('0x22'));return _0x176983['user'];});}});}else{logger['info'](_0x544e('0x20'));return request({'uri':util[_0x544e('0x19')](_0x544e('0x21'),_0x286614[_0x544e('0xe')])})[_0x544e('0x16')](function(_0x3c4ec5){logger[_0x544e('0xc')]('Admin\x20account\x20selected.');return _0x3c4ec5['user'];});}}function getEndUser(_0x26785f,_0x5ea5fe,_0x5d374c){logger[_0x544e('0xc')](_0x544e('0x23'),_0x5d374c);return request({'uri':util['format']('%s/search.json',_0x26785f[_0x544e('0xe')]),'qs':{'query':util['format'](_0x544e('0x24'),_0x5d374c)}})[_0x544e('0x16')](function(_0x21a3c8){var _0x24709e;if(_0x21a3c8[_0x544e('0x1e')][_0x544e('0x25')]){_0x21a3c8['results']=_[_0x544e('0x26')](_0x21a3c8[_0x544e('0x1e')],{'suspended':![],'role':'end-user'});if(_0x21a3c8[_0x544e('0x1e')]['length']){_0x24709e=_[_0x544e('0x27')](_0x21a3c8['results']);}}if(_0x24709e){logger[_0x544e('0xc')]('Enduser\x20found!');return _0x24709e;}else{logger['info'](_0x544e('0x28'));return request({'uri':util['format'](_0x544e('0x29'),_0x26785f[_0x544e('0xe')]),'method':_0x544e('0xf'),'body':{'user':{'role':_0x544e('0x2a'),'name':util[_0x544e('0x19')](_0x544e('0x2b'),_0x5ea5fe||_0x5d374c),'phone':_0x5d374c}}})[_0x544e('0x16')](function(_0x17f910){logger[_0x544e('0xc')](_0x544e('0x2c'));return _0x17f910[_0x544e('0x2d')];});}});}function getAuth(_0x5e30e1){var _0x565f5e;if(_0x5e30e1[_0x544e('0x2e')]==='password'){_0x565f5e=util[_0x544e('0x19')](_0x544e('0x2f'),_0x5e30e1['username'],_0x5e30e1[_0x544e('0x30')]);}else if(_0x5e30e1[_0x544e('0x2e')]===_0x544e('0x31')){_0x565f5e=util[_0x544e('0x19')](_0x544e('0x32'),_0x5e30e1['username'],_0x5e30e1['token']);}return util[_0x544e('0x19')](_0x544e('0x33'),new Buffer(_0x565f5e)[_0x544e('0x34')](_0x544e('0x35')));}function request(_0x21ba06){logger[_0x544e('0x36')](_0x544e('0x37'),JSON[_0x544e('0x38')](_0x21ba06));return rp(_[_0x544e('0x9')](_0x21ba06,{'method':_0x544e('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x32366a,_0x561427){var _0xe3bd78=[];if(_0x32366a&&_0x32366a[_0x544e('0x25')]>0x0){_0xe3bd78=_['map'](_0x32366a,_0x561427);}return _0xe3bd78;}function getCustomFields(_0x28d8df,_0x3274a9){var _0x15c1fb=[];var _0x2c6fb0={'custom_fields':[]};if(_0x28d8df[_0x544e('0x25')]>0x0){_['forEach'](_0x28d8df,function(_0x4efe2c){if(_['includes']([_0x544e('0x3a'),_0x544e('0x3b')],_0x4efe2c[_0x544e('0x3c')])&&_0x4efe2c[_0x544e('0x3d')]&&!_0x4efe2c['customField']){_0x2c6fb0[_0x4efe2c['nameField'][_0x544e('0x3e')]()]=_0x4efe2c['content']['toString']();}else if(_['includes']([_0x544e('0x3a'),_0x544e('0x3b')],_0x4efe2c['type'])&&_0x4efe2c[_0x544e('0x3f')]&&_0x4efe2c[_0x544e('0x40')]){_0x2c6fb0['custom_fields'][_0x544e('0x41')]({'id':_0x4efe2c[_0x544e('0x3f')],'value':_0x4efe2c[_0x544e('0x42')][_0x544e('0x34')]()});}else if(_0x4efe2c[_0x544e('0x3c')]===_0x544e('0x43')&&_0x4efe2c[_0x544e('0x44')]&&_0x4efe2c[_0x544e('0x3f')]&&_0x4efe2c[_0x544e('0x40')]){_0x3274a9[_0x4efe2c[_0x544e('0x44')]]&&_0x2c6fb0[_0x544e('0x45')][_0x544e('0x41')]({'id':_0x4efe2c[_0x544e('0x3f')],'value':_0x3274a9[_0x4efe2c['variableName']][_0x544e('0x34')]()});}else if(_0x4efe2c[_0x544e('0x3c')]===_0x544e('0x46')&&_0x4efe2c[_0x544e('0x47')]&&_0x4efe2c[_0x544e('0x47')][_0x544e('0x12')]&&_0x4efe2c[_0x544e('0x3f')]&&_0x4efe2c[_0x544e('0x40')]){_0x3274a9[_0x4efe2c['Variable'][_0x544e('0x12')]['toLowerCase']()]&&_0x2c6fb0[_0x544e('0x45')][_0x544e('0x41')]({'id':_0x4efe2c[_0x544e('0x3f')],'value':_0x3274a9[_0x4efe2c['Variable']['name'][_0x544e('0x3e')]()][_0x544e('0x34')]()});}});}return _0x2c6fb0;}exports[_0x544e('0x48')]=function(_0x49415e,_0x15d5cf,_0x1e8f12,_0x1d9654,_0x463712,_0x24eb38){var _0x2e0236,_0x81f357;_0x24eb38[_0x544e('0xe')]=intUtil[_0x544e('0x49')](_0x24eb38[_0x544e('0xe')]);_0x24eb38['serverUrl']=intUtil[_0x544e('0x49')](_0x24eb38['serverUrl']);if(_0x463712&&_0x463712[_0x544e('0x4a')]){logger['info'](_0x544e('0x4b'),_0x544e('0x4c'));_0x15d5cf[_0x544e('0x4d')]=util[_0x544e('0x19')](_0x544e('0x4e'),_0x24eb38[_0x544e('0x4f')],_0x15d5cf[_0x544e('0x50')],md5(_0x15d5cf[_0x544e('0x50')]));}else{_0x15d5cf[_0x544e('0x4d')]='';}headers[_0x544e('0x51')]=getAuth(_0x24eb38);return getUser(_0x24eb38,_0x1d9654['email'])[_0x544e('0x16')](function(_0x37417a){_0x2e0236=_0x37417a;logger['info']('The\x20User\x20ID\x20is:',_0x2e0236['id']);return getEndUser(_0x24eb38,_0x15d5cf['calleridname'],_0x15d5cf['calleridnum']);})[_0x544e('0x16')](function(_0x2851ba){_0x81f357=_0x2851ba;logger[_0x544e('0xc')](_0x544e('0x52'),_0x81f357['id']);return getTicket(_0x24eb38,_0x2e0236,_0x81f357,_0x1e8f12,_0x15d5cf);})['then'](function(_0x55ef93){if(_0x55ef93){logger[_0x544e('0xc')](_0x544e('0x53'),_0x55ef93['id']);switch(_0x24eb38['type']){case'integrationTab':logger[_0x544e('0xc')](_0x544e('0x4b'),_0x544e('0x54'));return request({'uri':util['format'](_0x544e('0x55'),_0x24eb38[_0x544e('0xe')],_0x2e0236['id'],_0x55ef93['id']),'method':_0x544e('0xf')});case'newTab':logger['info']('[QUEUE]',_0x544e('0x56'));emit(util[_0x544e('0x19')](_0x544e('0x57'),_0x1d9654[_0x544e('0x12')]),_0x544e('0x58'),{'uri':util[_0x544e('0x19')](_0x544e('0x59'),_0x24eb38['remoteUri'][_0x544e('0x5a')](_0x544e('0x5b'),''),_0x55ef93['id'])});break;default:logger[_0x544e('0x5c')]('[QUEUE]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x544e('0x5d')](function(_0x45f7c){logger['error'](_0x544e('0x5e'),util[_0x544e('0x5f')](_0x45f7c,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x4230ea,_0x80bfc3,_0xcce6bf,_0x30392e,_0x503a14,_0x3af347,_0x33dafe){var _0x59c38a,_0xd9f5f8;_0x3af347[_0x544e('0xe')]=intUtil[_0x544e('0x49')](_0x3af347[_0x544e('0xe')]);_0x3af347[_0x544e('0x4f')]=intUtil['stripTrailingSlash'](_0x3af347[_0x544e('0x4f')]);if(_0x33dafe&&_0x33dafe[_0x544e('0x60')]&&_0x33dafe[_0x544e('0x60')]!==_0x544e('0x61')){logger[_0x544e('0xc')](_0x544e('0x62'),_0x544e('0x4c'));_0x80bfc3[_0x544e('0x4d')]=util[_0x544e('0x19')](_0x544e('0x4e'),_0x3af347[_0x544e('0x4f')],_0x80bfc3[_0x544e('0x50')],md5(_0x80bfc3[_0x544e('0x50')]));}headers[_0x544e('0x51')]=getAuth(_0x3af347);return getUser(_0x3af347,_0x30392e['email'])['then'](function(_0x1b9190){_0x59c38a=_0x1b9190;logger[_0x544e('0xc')](_0x544e('0x63'),_0x59c38a['id']);return getEndUser(_0x3af347,_0x80bfc3[_0x544e('0x64')],_0x80bfc3['destcalleridnum']);})[_0x544e('0x16')](function(_0x318056){_0xd9f5f8=_0x318056;logger[_0x544e('0xc')](_0x544e('0x52'),_0xd9f5f8['id']);return getTicket(_0x3af347,_0x59c38a,_0xd9f5f8,_0xcce6bf,_0x80bfc3);})[_0x544e('0x16')](function(_0x56ab23){if(_0x56ab23){logger[_0x544e('0xc')](_0x544e('0x53'),_0x56ab23['id']);switch(_0x3af347[_0x544e('0x3c')]){case'integrationTab':logger['info'](_0x544e('0x62'),_0x544e('0x54'));return request({'uri':util[_0x544e('0x19')](_0x544e('0x55'),_0x3af347[_0x544e('0xe')],_0x59c38a['id'],_0x56ab23['id']),'method':_0x544e('0xf')});case'newTab':logger['info'](_0x544e('0x62'),_0x544e('0x56'));emit(util[_0x544e('0x19')]('user:%s',_0x30392e[_0x544e('0x12')]),_0x544e('0x58'),{'uri':util[_0x544e('0x19')](_0x544e('0x59'),_0x3af347['remoteUri']['replace'](_0x544e('0x5b'),''),_0x56ab23['id'])});break;default:logger[_0x544e('0x5c')](_0x544e('0x62'),_0x544e('0x65'));}}})[_0x544e('0x5d')](function(_0x3bb2b8){logger[_0x544e('0x5c')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x544e('0x5f')](_0x3bb2b8,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x6ca2be,_0x24a904,_0x487c53,_0x1975ec,_0x41c831,_0x26dc6c){var _0x255e17,_0x408f0c;_0x26dc6c[_0x544e('0xe')]=intUtil[_0x544e('0x49')](_0x26dc6c['remoteUri']);_0x26dc6c[_0x544e('0x4f')]=intUtil[_0x544e('0x49')](_0x26dc6c[_0x544e('0x4f')]);if(_0x41c831&&_0x41c831[_0x544e('0x4a')]){logger[_0x544e('0xc')]('['+_0x24a904[_0x544e('0x66')][_0x544e('0x67')]()+']','Recording\x20is\x20enabled!');_0x24a904[_0x544e('0x4d')]=util['format'](_0x544e('0x4e'),_0x26dc6c[_0x544e('0x4f')],_0x24a904[_0x544e('0x50')],md5(_0x24a904[_0x544e('0x50')]));}else{_0x24a904[_0x544e('0x4d')]='';}headers[_0x544e('0x51')]=getAuth(_0x26dc6c);return getUser(_0x26dc6c)[_0x544e('0x16')](function(_0x12bf3a){_0x255e17=_0x12bf3a;logger[_0x544e('0xc')](_0x544e('0x63'),_0x255e17['id']);return getEndUser(_0x26dc6c,_0x24a904[_0x544e('0x68')],_0x24a904['calleridnum']);})[_0x544e('0x16')](function(_0x1a310b){_0x408f0c=_0x1a310b;logger[_0x544e('0xc')](_0x544e('0x52'),_0x408f0c['id']);return getTicket(_0x26dc6c,_0x255e17,_0x408f0c,_0x487c53,_0x24a904);})[_0x544e('0x16')](function(_0x138bc0){if(_0x138bc0){logger[_0x544e('0xc')](_0x544e('0x53'),_0x138bc0['id']);}})[_0x544e('0x5d')](function(_0x35a087){logger[_0x544e('0x5c')]('['+_0x24a904[_0x544e('0x66')]['toUpperCase']()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x544e('0x5f')](_0x35a087,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
+var _0xc18e=['The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','newTab','%s/agent/tickets/%s','replace','catch','inspect','unmanaged','lastevent','calleridname','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','Tags','name','getString','Fields','then','info','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','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','length','filter','end-user','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','authType','password','%s:%s','token','%s/token:%s','Basic\x20%s','toString','base64','[HTTP]','stringify','GET','forEach','string','type','nameField','content','includes','idField','customField','custom_fields','push','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xc18e,0xe9));var _0xec18=function(_0x2ff238,_0x1811d2){_0x2ff238=_0x2ff238-0x0;var _0x204a56=_0xc18e[_0x2ff238];return _0x204a56;};'use strict';var _=require(_0xec18('0x0'));var rp=require(_0xec18('0x1'));var md5=require(_0xec18('0x2'));var util=require('util');var Redis=require(_0xec18('0x3'));var intUtil=require(_0xec18('0x4'));var config=require(_0xec18('0x5'));var logger=require(_0xec18('0x6'))(_0xec18('0x7'));config[_0xec18('0x8')]=_['defaults'](config[_0xec18('0x8')],{'host':_0xec18('0x9'),'port':0x18eb});var io=require(_0xec18('0xa'))(new Redis(config['redis']));function emit(_0x245a9b,_0x2059c8,_0xd82fb3){io['to'](_0x245a9b)['emit'](_0x2059c8,_0xd82fb3);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getTicket(_0x561d7e,_0x3d337b,_0x2e5f04,_0x275ff4,_0x1b1fd5){logger['info'](_0xec18('0xb'));return request({'uri':util[_0xec18('0xc')](_0xec18('0xd'),_0x561d7e[_0xec18('0xe')]),'method':_0xec18('0xf'),'body':{'ticket':_['merge']({'requester_id':_0x2e5f04['id'],'submitter_id':_0x3d337b?_0x3d337b['id']:undefined,'assignee_id':_0x3d337b?_0x3d337b['id']:undefined,'tags':getTags(_0x275ff4[_0xec18('0x10')],_0xec18('0x11')),'subject':intUtil[_0xec18('0x12')](_0x275ff4['Subjects'],_0x1b1fd5,'\x20'),'description':intUtil[_0xec18('0x12')](_0x275ff4['Descriptions'],_0x1b1fd5,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x275ff4['Descriptions'],_0x1b1fd5,'\x0a')}},getCustomFields(_0x275ff4[_0xec18('0x13')],_0x1b1fd5))}})[_0xec18('0x14')](function(_0xee02e9){logger[_0xec18('0x15')](_0xec18('0x16'));return _0xee02e9[_0xec18('0x17')];});}function getUser(_0x145a82,_0x5baeea){if(intUtil[_0xec18('0x18')](_0x5baeea)){logger[_0xec18('0x15')](_0xec18('0x19'),_0x5baeea);return request({'uri':util['format']('%s/search.json',_0x145a82['remoteUri']),'qs':{'query':util[_0xec18('0xc')](_0xec18('0x1a'),_0x5baeea)}})[_0xec18('0x14')](function(_0x1a98fc){if(_0x1a98fc[_0xec18('0x1b')]){logger[_0xec18('0x15')](_0xec18('0x1c'));return _[_0xec18('0x1d')](_0x1a98fc[_0xec18('0x1e')],{'email':_0x5baeea,'role':_0xec18('0x1f')});}else{logger['info'](_0xec18('0x20'));return request({'uri':util[_0xec18('0xc')](_0xec18('0x21'),_0x145a82[_0xec18('0xe')])})[_0xec18('0x14')](function(_0x11205f){logger['info'](_0xec18('0x22'));return _0x11205f[_0xec18('0x23')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xec18('0xc')]('%s/users/me.json',_0x145a82[_0xec18('0xe')])})[_0xec18('0x14')](function(_0xa9c7fa){logger[_0xec18('0x15')]('Admin\x20account\x20selected.');return _0xa9c7fa['user'];});}}function getEndUser(_0x21d066,_0x39eb95,_0x2e8ba8){logger[_0xec18('0x15')](_0xec18('0x24'),_0x2e8ba8);return request({'uri':util['format'](_0xec18('0x25'),_0x21d066[_0xec18('0xe')]),'qs':{'query':util[_0xec18('0xc')](_0xec18('0x26'),_0x2e8ba8)}})[_0xec18('0x14')](function(_0x4316f5){var _0x5d3c5b;if(_0x4316f5[_0xec18('0x1e')][_0xec18('0x27')]){_0x4316f5[_0xec18('0x1e')]=_[_0xec18('0x28')](_0x4316f5['results'],{'suspended':![],'role':_0xec18('0x29')});if(_0x4316f5[_0xec18('0x1e')][_0xec18('0x27')]){_0x5d3c5b=_['first'](_0x4316f5[_0xec18('0x1e')]);}}if(_0x5d3c5b){logger['info']('Enduser\x20found!');return _0x5d3c5b;}else{logger[_0xec18('0x15')](_0xec18('0x2a'));return request({'uri':util['format']('%s/users.json',_0x21d066['remoteUri']),'method':_0xec18('0xf'),'body':{'user':{'role':_0xec18('0x29'),'name':util['format'](_0xec18('0x2b'),_0x39eb95||_0x2e8ba8),'phone':_0x2e8ba8}}})[_0xec18('0x14')](function(_0x28a641){logger[_0xec18('0x15')]('Enduser\x20created.');return _0x28a641[_0xec18('0x23')];});}});}function getAuth(_0x2c8fd0){var _0x82324b;if(_0x2c8fd0[_0xec18('0x2c')]===_0xec18('0x2d')){_0x82324b=util[_0xec18('0xc')](_0xec18('0x2e'),_0x2c8fd0['username'],_0x2c8fd0['password']);}else if(_0x2c8fd0[_0xec18('0x2c')]===_0xec18('0x2f')){_0x82324b=util['format'](_0xec18('0x30'),_0x2c8fd0['username'],_0x2c8fd0['token']);}return util['format'](_0xec18('0x31'),new Buffer(_0x82324b)[_0xec18('0x32')](_0xec18('0x33')));}function request(_0xdc8e12){logger['debug'](_0xec18('0x34'),JSON[_0xec18('0x35')](_0xdc8e12));return rp(_['defaults'](_0xdc8e12,{'method':_0xec18('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x4b4fe7,_0xcc8cf7){var _0x165fa5=[];if(_0x4b4fe7&&_0x4b4fe7[_0xec18('0x27')]>0x0){_0x165fa5=_['map'](_0x4b4fe7,_0xcc8cf7);}return _0x165fa5;}function getCustomFields(_0x3f65a5,_0xd6b285){var _0x157150=[];var _0x49cf0e={'custom_fields':[]};if(_0x3f65a5[_0xec18('0x27')]>0x0){_[_0xec18('0x37')](_0x3f65a5,function(_0x247e20){if(_['includes']([_0xec18('0x38'),'picklist'],_0x247e20[_0xec18('0x39')])&&_0x247e20[_0xec18('0x3a')]&&!_0x247e20['customField']){_0x49cf0e[_0x247e20['nameField']['toLowerCase']()]=_0x247e20[_0xec18('0x3b')][_0xec18('0x32')]();}else if(_[_0xec18('0x3c')]([_0xec18('0x38'),'picklist'],_0x247e20[_0xec18('0x39')])&&_0x247e20[_0xec18('0x3d')]&&_0x247e20[_0xec18('0x3e')]){_0x49cf0e[_0xec18('0x3f')][_0xec18('0x40')]({'id':_0x247e20['idField'],'value':_0x247e20[_0xec18('0x3b')][_0xec18('0x32')]()});}else if(_0x247e20[_0xec18('0x39')]==='variable'&&_0x247e20[_0xec18('0x41')]&&_0x247e20[_0xec18('0x3d')]&&_0x247e20[_0xec18('0x3e')]){_0xd6b285[_0x247e20['variableName']]&&_0x49cf0e[_0xec18('0x3f')][_0xec18('0x40')]({'id':_0x247e20['idField'],'value':_0xd6b285[_0x247e20['variableName']][_0xec18('0x32')]()});}else if(_0x247e20[_0xec18('0x39')]===_0xec18('0x42')&&_0x247e20[_0xec18('0x43')]&&_0x247e20[_0xec18('0x43')][_0xec18('0x11')]&&_0x247e20[_0xec18('0x3d')]&&_0x247e20[_0xec18('0x3e')]){_0xd6b285[_0x247e20[_0xec18('0x43')][_0xec18('0x11')][_0xec18('0x44')]()]&&_0x49cf0e[_0xec18('0x3f')][_0xec18('0x40')]({'id':_0x247e20[_0xec18('0x3d')],'value':_0xd6b285[_0x247e20[_0xec18('0x43')][_0xec18('0x11')][_0xec18('0x44')]()]['toString']()});}});}return _0x49cf0e;}exports[_0xec18('0x45')]=function(_0xad775e,_0x285dc9,_0x254e02,_0x253274,_0x42580c,_0xe54e99){var _0x264111,_0x14378a;_0xe54e99[_0xec18('0xe')]=intUtil[_0xec18('0x46')](_0xe54e99[_0xec18('0xe')]);_0xe54e99[_0xec18('0x47')]=intUtil[_0xec18('0x46')](_0xe54e99[_0xec18('0x47')]);if(_0x42580c&&_0x42580c[_0xec18('0x48')]){logger[_0xec18('0x15')](_0xec18('0x49'),_0xec18('0x4a'));_0x285dc9[_0xec18('0x4b')]=util[_0xec18('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xe54e99[_0xec18('0x47')],_0x285dc9[_0xec18('0x4c')],md5(_0x285dc9[_0xec18('0x4c')]));}else{_0x285dc9[_0xec18('0x4b')]='';}headers[_0xec18('0x4d')]=getAuth(_0xe54e99);return getUser(_0xe54e99,_0x253274[_0xec18('0x4e')])['then'](function(_0x4506fe){_0x264111=_0x4506fe;logger['info']('The\x20User\x20ID\x20is:',_0x264111['id']);return getEndUser(_0xe54e99,_0x285dc9['calleridname'],_0x285dc9[_0xec18('0x4f')]);})[_0xec18('0x14')](function(_0x5050d9){_0x14378a=_0x5050d9;logger['info'](_0xec18('0x50'),_0x14378a['id']);return getTicket(_0xe54e99,_0x264111,_0x14378a,_0x254e02,_0x285dc9);})[_0xec18('0x14')](function(_0x5c0822){if(_0x5c0822){logger[_0xec18('0x15')](_0xec18('0x51'),_0x5c0822['id']);switch(_0xe54e99[_0xec18('0x39')]){case _0xec18('0x52'):logger[_0xec18('0x15')](_0xec18('0x49'),_0xec18('0x53'));return request({'uri':util[_0xec18('0xc')](_0xec18('0x54'),_0xe54e99['remoteUri'],_0x264111['id'],_0x5c0822['id']),'method':'POST'});case'newTab':logger['info'](_0xec18('0x49'),_0xec18('0x55'));emit(util[_0xec18('0xc')](_0xec18('0x56'),_0x253274[_0xec18('0x11')]),_0xec18('0x57'),{'uri':util['format']('%s/agent/tickets/%s',_0xe54e99['remoteUri']['replace'](_0xec18('0x58'),''),_0x5c0822['id'])});break;default:logger[_0xec18('0x59')](_0xec18('0x49'),_0xec18('0x5a'));}}})['catch'](function(_0x33f423){logger['error'](_0xec18('0x5b'),util['inspect'](_0x33f423,{'showHidden':!![],'depth':null}));});};exports[_0xec18('0x5c')]=function(_0x2b837a,_0x39f188,_0x4593be,_0x1a9e03,_0x565030,_0x383210,_0x31649e){var _0x5b400e,_0xdd0644;_0x383210[_0xec18('0xe')]=intUtil[_0xec18('0x46')](_0x383210[_0xec18('0xe')]);_0x383210[_0xec18('0x47')]=intUtil[_0xec18('0x46')](_0x383210[_0xec18('0x47')]);if(_0x31649e&&_0x31649e[_0xec18('0x5d')]&&_0x31649e['recordingFormat']!==_0xec18('0x5e')){logger[_0xec18('0x15')](_0xec18('0x5f'),'Recording\x20is\x20enabled!');_0x39f188['recordingURL']=util[_0xec18('0xc')](_0xec18('0x60'),_0x383210[_0xec18('0x47')],_0x39f188[_0xec18('0x4c')],md5(_0x39f188[_0xec18('0x4c')]));}headers[_0xec18('0x4d')]=getAuth(_0x383210);return getUser(_0x383210,_0x1a9e03[_0xec18('0x4e')])[_0xec18('0x14')](function(_0x1090f6){_0x5b400e=_0x1090f6;logger[_0xec18('0x15')](_0xec18('0x61'),_0x5b400e['id']);return getEndUser(_0x383210,_0x39f188[_0xec18('0x62')],_0x39f188[_0xec18('0x63')]);})[_0xec18('0x14')](function(_0x3bca98){_0xdd0644=_0x3bca98;logger[_0xec18('0x15')](_0xec18('0x50'),_0xdd0644['id']);return getTicket(_0x383210,_0x5b400e,_0xdd0644,_0x4593be,_0x39f188);})[_0xec18('0x14')](function(_0x298df0){if(_0x298df0){logger[_0xec18('0x15')](_0xec18('0x51'),_0x298df0['id']);switch(_0x383210[_0xec18('0x39')]){case _0xec18('0x52'):logger[_0xec18('0x15')]('[OUTBOUND]',_0xec18('0x53'));return request({'uri':util[_0xec18('0xc')](_0xec18('0x54'),_0x383210[_0xec18('0xe')],_0x5b400e['id'],_0x298df0['id']),'method':_0xec18('0xf')});case _0xec18('0x64'):logger[_0xec18('0x15')](_0xec18('0x5f'),_0xec18('0x55'));emit(util[_0xec18('0xc')](_0xec18('0x56'),_0x1a9e03[_0xec18('0x11')]),_0xec18('0x57'),{'uri':util[_0xec18('0xc')](_0xec18('0x65'),_0x383210[_0xec18('0xe')][_0xec18('0x66')](_0xec18('0x58'),''),_0x298df0['id'])});break;default:logger[_0xec18('0x59')](_0xec18('0x5f'),_0xec18('0x5a'));}}})[_0xec18('0x67')](function(_0x4418f1){logger[_0xec18('0x59')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xec18('0x68')](_0x4418f1,{'showHidden':!![],'depth':null}));});};exports[_0xec18('0x69')]=function(_0x458f1c,_0x56b13a,_0x4aafcf,_0x503bf5,_0x1aa82e,_0x1b5ff9){var _0x22efab,_0x2a6187;_0x1b5ff9['remoteUri']=intUtil[_0xec18('0x46')](_0x1b5ff9[_0xec18('0xe')]);_0x1b5ff9[_0xec18('0x47')]=intUtil[_0xec18('0x46')](_0x1b5ff9[_0xec18('0x47')]);if(_0x1aa82e&&_0x1aa82e[_0xec18('0x48')]){logger['info']('['+_0x56b13a[_0xec18('0x6a')]['toUpperCase']()+']',_0xec18('0x4a'));_0x56b13a[_0xec18('0x4b')]=util[_0xec18('0xc')](_0xec18('0x60'),_0x1b5ff9[_0xec18('0x47')],_0x56b13a['uniqueid'],md5(_0x56b13a[_0xec18('0x4c')]));}else{_0x56b13a[_0xec18('0x4b')]='';}headers[_0xec18('0x4d')]=getAuth(_0x1b5ff9);return getUser(_0x1b5ff9)[_0xec18('0x14')](function(_0x4b0b06){_0x22efab=_0x4b0b06;logger[_0xec18('0x15')]('The\x20User\x20ID\x20is:',_0x22efab['id']);return getEndUser(_0x1b5ff9,_0x56b13a[_0xec18('0x6b')],_0x56b13a[_0xec18('0x4f')]);})['then'](function(_0x4c4e0c){_0x2a6187=_0x4c4e0c;logger['info'](_0xec18('0x50'),_0x2a6187['id']);return getTicket(_0x1b5ff9,_0x22efab,_0x2a6187,_0x4aafcf,_0x56b13a);})[_0xec18('0x14')](function(_0x44a554){if(_0x44a554){logger[_0xec18('0x15')]('The\x20Ticket\x20ID\x20is:',_0x44a554['id']);}})['catch'](function(_0x3cd86c){logger[_0xec18('0x59')]('['+_0x56b13a[_0xec18('0x6a')][_0xec18('0x6c')]()+']'+_0xec18('0x6d'),util[_0xec18('0x68')](_0x3cd86c,{'showHidden':!![],'depth':null}));});};
\ No newline at end of file
index 9198046..3fea12b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xd5a2=['access_token','isBefore','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','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','Zoho-oauthtoken\x20','then','users','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','findIndex','Administrator','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','startCase','moduleCreate','role','first_name','last_name','SUCCESS','details','log','CREATE\x20ERROR','moduleSearch','contact_lead','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','Leads','contact','uri','nothing','/crm/v2/Leads/search?criteria=((Phone:equals:','Owner','profile','Subject','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','What_Id','Last_Name','$se_module','talktime','Call_Duration','mm:ss','utc','diff','starttime','YYYY-MM-DDTHH:mm:ss','called','Call_Result','Called','complete','connect','rejected','abandoned','Abandoned','timeout','outbound','agentcalledAt','Inbound','Fields','/crm/v2/Calls','Call\x20created!','err','queue','host','serverUrl','stripTrailingSlash','[QUEUE]','recordingURL','/downloads?type=uniqueid&token=','com','The\x20User\x20ID\x20is:','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','recordingFormat','none','[OUTBOUND]','/api/voice/recordings/','uniqueid','zoho.eu','destcalleridnum','Outbound','trigger:browser:url','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','request-promise','md5','util','./util','moment','ioredis','../../../../config/environment','zoho','redis','defaults','localhost','emit','debug','[HTTP]','stringify','forEach','includes','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil'];(function(_0x27530d,_0x46480a){var _0x59e561=function(_0x395fe9){while(--_0x395fe9){_0x27530d['push'](_0x27530d['shift']());}};_0x59e561(++_0x46480a);}(_0xd5a2,0x79));var _0x2d5a=function(_0x2a826d,_0x48e05d){_0x2a826d=_0x2a826d-0x0;var _0x25f799=_0xd5a2[_0x2a826d];return _0x25f799;};'use strict';var _=require('lodash');var rp=require(_0x2d5a('0x0'));var md5=require(_0x2d5a('0x1'));var util=require(_0x2d5a('0x2'));var intUtil=require(_0x2d5a('0x3'));var moment=require(_0x2d5a('0x4'));var Redis=require(_0x2d5a('0x5'));var BPromise=require('bluebird');var config=require(_0x2d5a('0x6'));var logger=require('../../../../config/logger')(_0x2d5a('0x7'));config[_0x2d5a('0x8')]=_[_0x2d5a('0x9')](config['redis'],{'host':_0x2d5a('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2d5a('0x8')]));function emit(_0x333bbe,_0x28d78c,_0x3ad6d3){io['to'](_0x333bbe)[_0x2d5a('0xb')](_0x28d78c,_0x3ad6d3);}function request(_0x13be3c){logger[_0x2d5a('0xc')](_0x2d5a('0xd'),JSON[_0x2d5a('0xe')](_0x13be3c));return rp(_0x13be3c);}function getCustomFields(_0x4ec94b,_0x1af0a2){var _0x27daa5={};if(_0x4ec94b['length']>0x0){_[_0x2d5a('0xf')](_0x4ec94b,function(_0x46d9be){if(_[_0x2d5a('0x10')](['string',_0x2d5a('0x11')],_0x46d9be[_0x2d5a('0x12')])&&_0x46d9be['idField']){_0x27daa5[_0x46d9be[_0x2d5a('0x13')]]=_0x46d9be[_0x2d5a('0x14')][_0x2d5a('0x15')]();}else if(_0x46d9be[_0x2d5a('0x12')]===_0x2d5a('0x16')&&_0x46d9be['variableName']&&_0x46d9be[_0x2d5a('0x13')]&&_0x1af0a2[_0x46d9be[_0x2d5a('0x17')]]){_0x27daa5[_0x46d9be[_0x2d5a('0x13')]]=_0x1af0a2[_0x46d9be['variableName']][_0x2d5a('0x15')]();}else if(_0x46d9be[_0x2d5a('0x12')]===_0x2d5a('0x18')&&_0x46d9be[_0x2d5a('0x19')]&&_0x46d9be[_0x2d5a('0x19')][_0x2d5a('0x1a')]&&_0x46d9be[_0x2d5a('0x13')]&&_0x1af0a2[_0x46d9be[_0x2d5a('0x19')][_0x2d5a('0x1a')][_0x2d5a('0x1b')]()]){_0x27daa5[_0x46d9be[_0x2d5a('0x13')]]=_0x1af0a2[_0x46d9be['Variable'][_0x2d5a('0x1a')][_0x2d5a('0x1b')]()][_0x2d5a('0x15')]();}});}return _0x27daa5;}function getName(_0x424b0b){if(_0x424b0b['indexOf']('\x20')>0x0){var _0x3f08ce=_0x424b0b[_0x2d5a('0x1c')](/ (.+)/);if(_0x3f08ce[0x1]){return _0x3f08ce;}}return[_0x424b0b,_0x424b0b];}var accountsTokens={};function getAccessToken(_0x5159ba){return new Promise(function(_0x53c24f,_0x40f634){if(!_[_0x2d5a('0x1d')](accountsTokens[_0x5159ba['id']])&&!_[_0x2d5a('0x1d')](accountsTokens[_0x5159ba['id']][_0x2d5a('0x1e')])){if(moment()[_0x2d5a('0x1f')](accountsTokens[_0x5159ba['id']][_0x2d5a('0x20')])){_0x53c24f(accountsTokens[_0x5159ba['id']]['access_token']);}}var _0x27e084;switch(_0x5159ba[_0x2d5a('0x21')]){case'US':_0x27e084=_0x2d5a('0x22');break;case'AU':_0x27e084=_0x2d5a('0x23');break;case'EU':_0x27e084='https://accounts.zoho.eu';break;case'IN':_0x27e084=_0x2d5a('0x24');break;case'CN':_0x27e084=_0x2d5a('0x25');break;default:_0x27e084=_0x2d5a('0x26');break;}var _0x4de853={'method':_0x2d5a('0x27'),'uri':_0x27e084+_0x2d5a('0x28'),'qs':{'refresh_token':_0x5159ba[_0x2d5a('0x29')],'client_id':_0x5159ba[_0x2d5a('0x2a')],'client_secret':_0x5159ba[_0x2d5a('0x2b')],'grant_type':_0x2d5a('0x2c')},'json':!![]};return rp(_0x4de853)['then'](function(_0x15bb96){accountsTokens[_0x5159ba['id']]={'access_token':_0x15bb96[_0x2d5a('0x1e')],'expires_in':moment()[_0x2d5a('0x2d')](_0x15bb96['expires_in'],_0x2d5a('0x2e'))};_0x53c24f(_0x15bb96[_0x2d5a('0x1e')]);})[_0x2d5a('0x2f')](function(_0x56eca8){logger[_0x2d5a('0x30')](_0x2d5a('0x31'),_0x56eca8[_0x2d5a('0x32')]);_0x40f634(_0x56eca8);});});}function getUser(_0x55a28a,_0x5d7a25,_0x13b6fe,_0x1e64d3){logger['info'](_0x2d5a('0x33'));return request({'method':_0x2d5a('0x34'),'uri':util[_0x2d5a('0x35')](_0x2d5a('0x36'),_0x5d7a25),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0x2d5a('0x37')+_0x55a28a},'json':!![]})[_0x2d5a('0x38')](function(_0x273004){if(_0x273004[_0x2d5a('0x39')]){var _0xb391c3=-0x1;if(_['isArrayLikeObject'](_0x273004['users'])){if(!_[_0x2d5a('0x1d')](_0x1e64d3)){_0xb391c3=_['findIndex'](_0x273004[_0x2d5a('0x39')],function(_0x575f50){return _0x575f50[_0x2d5a('0x3a')]===_0x1e64d3;});}if(_0xb391c3>=0x0){logger[_0x2d5a('0x3b')](_0x2d5a('0x3c'));}else{logger['info'](_0x2d5a('0x3d'));_0xb391c3=_[_0x2d5a('0x3e')](_0x273004[_0x2d5a('0x39')],function(_0x2bd230){return _0x2bd230['profile'][_0x2d5a('0x1a')]===_0x2d5a('0x3f');});}return _0x273004[_0x2d5a('0x39')][_0xb391c3];}else{if(_0x273004['user']['profile'][_0x2d5a('0x1a')]===_0x2d5a('0x3f')){logger[_0x2d5a('0x3b')](_0x2d5a('0x3d'));user=_0x273004[_0x2d5a('0x40')];return user;}else{logger[_0x2d5a('0x30')](_0x2d5a('0x41'),JSON[_0x2d5a('0xe')](_0x273004));throw new Error(_0x2d5a('0x42')+JSON[_0x2d5a('0xe')](_0x273004));}}}else{logger[_0x2d5a('0x30')]('The\x20failing\x20result\x20is',JSON[_0x2d5a('0xe')](_0x273004));throw new Error(_0x2d5a('0x42')+JSON['stringify'](_0x273004));}})['catch'](function(_0x2c8a9a){console[_0x2d5a('0x30')](_0x2c8a9a);});}function getZohoUser(_0x2c8b88,_0x5ba0b1){return new BPromise(function(_0x15fc97,_0x4c3130){request(_0x2c8b88)[_0x2d5a('0x38')](function(_0x5e0b56){var _0x4a5738=null;if(_0x5e0b56){_0x4a5738=_0x5e0b56[_0x2d5a('0x43')][0x0];_0x4a5738[_0x2d5a('0x44')]=_0x5ba0b1;}_0x15fc97(_0x4a5738);})[_0x2d5a('0x2f')](function(_0x5c84c3){_0x4c3130(_0x5c84c3);});});}function createEndUser(_0x324f63,_0x12154b,_0x44bac4,_0x42eed6,_0x2e636a,_0x1292ab){var _0x44bac4=getName(_0x44bac4);return request({'method':_0x2d5a('0x27'),'uri':_0x2d5a('0x45')+_0x12154b+'/crm/v2/'+_[_0x2d5a('0x46')](_0x1292ab[_0x2d5a('0x47')])+'s','body':{'data':[{'Last_Name':_0x44bac4[0x1],'First_Name':_0x44bac4[0x0],'Phone':_0x42eed6,'Owner':{'name':!_[_0x2d5a('0x1d')](_0x2e636a[_0x2d5a('0x48')][_0x2d5a('0x1a')])?_0x2e636a[_0x2d5a('0x48')][_0x2d5a('0x1a')]:!_[_0x2d5a('0x1d')](_0x2e636a['first_name'])?_0x2e636a[_0x2d5a('0x49')]+'\x20'+_0x2e636a[_0x2d5a('0x4a')]:_0x2e636a[_0x2d5a('0x4a')],'id':_0x2e636a['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x324f63},'json':!![]})[_0x2d5a('0x38')](function(_0x3cde27){if(_0x3cde27&&_0x3cde27[_0x2d5a('0x43')][0x0]['code']===_0x2d5a('0x4b')){var _0x25a98a=_0x3cde27[_0x2d5a('0x43')][0x0][_0x2d5a('0x4c')];_0x25a98a[_0x2d5a('0x44')]=_[_0x2d5a('0x46')](_0x1292ab[_0x2d5a('0x47')])+'s';return _0x25a98a;}logger[_0x2d5a('0x30')]('The\x20failing\x20result\x20is',JSON[_0x2d5a('0xe')](data));throw new Error('Error:\x20'+JSON['stringify'](data));})['catch'](function(_0x1c5c25){console[_0x2d5a('0x4d')](_0x2d5a('0x4e'),_0x1c5c25);});}function getEndUser(_0x229a6f,_0x10f95d,_0x2da65d,_0x1563cb,_0x34bcb3,_0x8312ff,_0x12d357){var _0x372bda={'method':_0x2d5a('0x34'),'uri':'','headers':{'Authorization':_0x2d5a('0x37')+_0x229a6f},'json':!![]};switch(_0x12d357[_0x2d5a('0x4f')]){case _0x2d5a('0x50'):_0x372bda['uri']=_0x2d5a('0x45')+_0x10f95d+_0x2d5a('0x51')+_0x34bcb3+'))';return getZohoUser(_0x372bda,_0x2d5a('0x52'))[_0x2d5a('0x38')](function(_0x34af97){if(_0x34af97)return _0x34af97;_0x372bda['uri']='https://www.zohoapis.'+_0x10f95d+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x34bcb3+'))';return getZohoUser(_0x372bda,_0x2d5a('0x53'))[_0x2d5a('0x38')](function(_0x3be1d2){if(_0x3be1d2)return _0x3be1d2;if(_0x12d357[_0x2d5a('0x47')]!='nothing'){return createEndUser(_0x229a6f,_0x10f95d,_0x1563cb,_0x34bcb3,_0x8312ff,_0x12d357);}else{return{};}});});break;case _0x2d5a('0x54'):_0x372bda[_0x2d5a('0x55')]=_0x2d5a('0x45')+_0x10f95d+_0x2d5a('0x51')+_0x34bcb3+'))';return getZohoUser(_0x372bda,_0x2d5a('0x52'))[_0x2d5a('0x38')](function(_0x92a36f){if(_0x92a36f)return _0x92a36f;if(_0x12d357[_0x2d5a('0x47')]!=_0x2d5a('0x56')){return createEndUser(_0x229a6f,_0x10f95d,_0x1563cb,_0x34bcb3,_0x8312ff,_0x12d357);}else{return{};}});break;case'lead':_0x372bda[_0x2d5a('0x55')]=_0x2d5a('0x45')+_0x10f95d+_0x2d5a('0x57')+_0x34bcb3+'))';return getZohoUser(_0x372bda,_0x2d5a('0x53'))[_0x2d5a('0x38')](function(_0x15529d){if(_0x15529d)return _0x15529d;if(_0x12d357['moduleCreate']!=_0x2d5a('0x56')){return createEndUser(_0x229a6f,_0x10f95d,_0x1563cb,_0x34bcb3,_0x8312ff,_0x12d357);}else{return{};}});break;}}function getCall(_0x3bfc43,_0x171bc9,_0x4abf1b,_0x3d1d69,_0x18e3ee,_0x2423f9,_0x2a5d6d,_0x1045b3){logger[_0x2d5a('0x3b')]('Creating\x20new\x20call...');var _0x22e183={};_0x22e183[_0x2d5a('0x58')]={'name':!_[_0x2d5a('0x1d')](_0x3d1d69[_0x2d5a('0x48')][_0x2d5a('0x1a')])&&!_['isNil'](_0x3d1d69[_0x2d5a('0x59')]['name'])&&_0x3d1d69[_0x2d5a('0x59')][_0x2d5a('0x1a')]==='administrator'?_0x3d1d69[_0x2d5a('0x48')]['name']:!_['isNil'](_0x3d1d69[_0x2d5a('0x49')])?_0x3d1d69['first_name']+'\x20'+_0x3d1d69['last_name']:_0x3d1d69['last_name'],'id':_0x3d1d69['id']};_0x22e183[_0x2d5a('0x5a')]=intUtil['getString'](_0x2423f9[_0x2d5a('0x5b')],_0x2a5d6d,'\x20');_0x22e183[_0x2d5a('0x5c')]=intUtil['getString'](_0x2423f9[_0x2d5a('0x5d')],_0x2a5d6d,'\x0a');if(_0x18e3ee[_0x2d5a('0x44')]===_0x2d5a('0x52')){_0x22e183[_0x2d5a('0x5e')]={'name':!_['isNil'](_0x18e3ee['Full_Name'])?_0x18e3ee[_0x2d5a('0x5f')]:!_[_0x2d5a('0x1d')](_0x18e3ee[_0x2d5a('0x60')])?_0x18e3ee[_0x2d5a('0x60')]+'\x20'+_0x18e3ee['Last_Name']:_0x18e3ee['Last_Name'],'id':_0x18e3ee['id']};}if(_0x18e3ee[_0x2d5a('0x44')]===_0x2d5a('0x53')){_0x22e183[_0x2d5a('0x61')]={'name':!_[_0x2d5a('0x1d')](_0x18e3ee['Full_Name'])?_0x18e3ee[_0x2d5a('0x5f')]:!_[_0x2d5a('0x1d')](_0x18e3ee[_0x2d5a('0x60')])?_0x18e3ee[_0x2d5a('0x60')]+'\x20'+_0x18e3ee['Last_Name']:_0x18e3ee[_0x2d5a('0x62')],'id':_0x18e3ee['id']};_0x22e183[_0x2d5a('0x63')]=_[_0x2d5a('0x46')](_0x18e3ee[_0x2d5a('0x44')]);}if(_0x2a5d6d[_0x2d5a('0x64')]){_0x22e183[_0x2d5a('0x65')]=moment['utc'](parseInt(_0x2a5d6d['talktime'])*0x3e8)[_0x2d5a('0x35')](_0x2d5a('0x66'));}else if(_0x2a5d6d['answertime']&&_0x2a5d6d['endtime']){_0x22e183[_0x2d5a('0x65')]=moment[_0x2d5a('0x67')](moment(_0x2a5d6d['endtime'],'YYYY-MM-DDTHH:mm:ss')[_0x2d5a('0x68')](moment(_0x2a5d6d[_0x2d5a('0x69')],_0x2d5a('0x6a'))))['format'](_0x2d5a('0x66'));}switch(_0x2a5d6d['lastevent']){case _0x2d5a('0x6b'):_0x22e183[_0x2d5a('0x6c')]=_0x2d5a('0x6d');break;case _0x2d5a('0x6e'):case _0x2d5a('0x6f'):_0x22e183[_0x2d5a('0x6c')]='Answered';break;case _0x2d5a('0x70'):_0x22e183[_0x2d5a('0x6c')]='Rejected';break;case _0x2d5a('0x71'):_0x22e183[_0x2d5a('0x6c')]=_0x2d5a('0x72');break;case _0x2d5a('0x73'):_0x22e183['Call_Result']='Timeout';default:}_0x22e183['Call_Start_Time']=(_0x1045b3===_0x2d5a('0x74')?moment(_0x2a5d6d[_0x2d5a('0x69')])[_0x2d5a('0x35')](_0x2d5a('0x6a')):moment(_0x2a5d6d[_0x2d5a('0x75')])[_0x2d5a('0x35')](_0x2d5a('0x6a')))||moment()[_0x2d5a('0x35')](_0x2d5a('0x6a'));_0x22e183['Call_Type']=_0x1045b3||_0x2d5a('0x76');_0x22e183=_['merge'](_0x22e183,getCustomFields(_0x2423f9[_0x2d5a('0x77')],_0x2a5d6d));return request({'method':_0x2d5a('0x27'),'uri':'https://www.zohoapis.'+_0x171bc9+_0x2d5a('0x78'),'headers':{'Authorization':_0x2d5a('0x37')+_0x3bfc43},'body':{'data':[_0x22e183]},'json':!![]})[_0x2d5a('0x38')](function(_0x4103de){if(_0x4103de&&_0x4103de[_0x2d5a('0x43')][0x0]['code']==='SUCCESS'){logger[_0x2d5a('0x3b')](_0x2d5a('0x79'));return{'id':_0x4103de[_0x2d5a('0x43')][0x0]['details']['id']};}})[_0x2d5a('0x2f')](function(_0x3c1e5f){logger[_0x2d5a('0x3b')](_0x2d5a('0x7a'),_0x3c1e5f[_0x2d5a('0x32')]);console[_0x2d5a('0x4d')](_0x2d5a('0x7a'),_0x3c1e5f);});}exports[_0x2d5a('0x7b')]=function(_0x344a25,_0x65b116,_0x9b3a98,_0x2d9649,_0x29c7a3,_0x2bf74c){var _0x6dff37,_0xc19024,_0x54ae91;_0x2bf74c['host']=intUtil['stripTrailingSlash'](_0x2bf74c[_0x2d5a('0x7c')]);_0x2bf74c[_0x2d5a('0x7d')]=intUtil[_0x2d5a('0x7e')](_0x2bf74c[_0x2d5a('0x7d')]);if(_0x29c7a3&&_0x29c7a3['monitor_format']){logger[_0x2d5a('0x3b')](_0x2d5a('0x7f'),'Recording\x20is\x20enabled!');_0x65b116[_0x2d5a('0x80')]=_0x2bf74c['serverUrl']+'/api/voice/recordings/'+_0x65b116['uniqueid']+_0x2d5a('0x81')+md5(_0x65b116['uniqueid']);}else{_0x65b116['recordingURL']='';}var _0x171659=_0x2bf74c[_0x2d5a('0x7c')]==='zoho.eu'?'eu':_0x2d5a('0x82');return getAccessToken(_0x2bf74c)[_0x2d5a('0x38')](function(_0x4e72f){_0x54ae91=_0x4e72f;return getUser(_0x54ae91,_0x171659,_0x2bf74c,_0x2d9649[_0x2d5a('0x3a')]);})['then'](function(_0x542eef){_0x6dff37=_0x542eef;logger[_0x2d5a('0x3b')](_0x2d5a('0x83'),_0x6dff37['id']);return getEndUser(_0x54ae91,_0x171659,_0x2bf74c,_0x65b116['calleridname'],_0x65b116[_0x2d5a('0x84')],_0x6dff37,_0x9b3a98);})[_0x2d5a('0x38')](function(_0x3853ad){_0xc19024=_0x3853ad;return getCall(_0x54ae91,_0x171659,_0x2bf74c,_0x6dff37,_0xc19024,_0x9b3a98,_0x65b116,'Inbound');})['then'](function(_0x3c904b){if(_0x3c904b){logger[_0x2d5a('0x3b')](_0x2d5a('0x85'),_0x3c904b['id']);logger[_0x2d5a('0x3b')]('[QUEUE]',_0x2d5a('0x86'));emit(util[_0x2d5a('0x35')](_0x2d5a('0x87'),_0x2d9649[_0x2d5a('0x1a')]),'trigger:browser:url',{'uri':_0x2d5a('0x88')+_0x2bf74c[_0x2d5a('0x7c')]+'/crm/EntityInfo.do?module=Calls&id='+_0x3c904b['id']});}})[_0x2d5a('0x2f')](function(_0xc1faca){logger[_0x2d5a('0x30')](_0x2d5a('0x7f'),JSON[_0x2d5a('0xe')](_0xc1faca));});};exports[_0x2d5a('0x74')]=function(_0x59162f,_0x17558a,_0x58d75d,_0x556abe,_0x462a53,_0x1aa0ba,_0x91e943){var _0x544e96,_0x259b0a,_0xd60f88;_0x1aa0ba['host']=intUtil[_0x2d5a('0x7e')](_0x1aa0ba[_0x2d5a('0x7c')]);_0x1aa0ba['serverUrl']=intUtil[_0x2d5a('0x7e')](_0x1aa0ba[_0x2d5a('0x7d')]);if(_0x91e943&&_0x91e943[_0x2d5a('0x89')]&&_0x91e943['recordingFormat']!==_0x2d5a('0x8a')){logger[_0x2d5a('0x3b')](_0x2d5a('0x8b'),'Recording\x20is\x20enabled!');_0x17558a['recordingURL']=_0x1aa0ba['serverUrl']+_0x2d5a('0x8c')+_0x17558a[_0x2d5a('0x8d')]+_0x2d5a('0x81')+md5(_0x17558a[_0x2d5a('0x8d')]);}var _0x44fcdf=_0x1aa0ba[_0x2d5a('0x7c')]===_0x2d5a('0x8e')?'eu':_0x2d5a('0x82');return getAccessToken(_0x1aa0ba)[_0x2d5a('0x38')](function(_0x25f6e4){_0xd60f88=_0x25f6e4;return getUser(_0xd60f88,_0x44fcdf,_0x1aa0ba,_0x556abe['email']);})[_0x2d5a('0x38')](function(_0x2510d4){_0x544e96=_0x2510d4;logger[_0x2d5a('0x3b')](_0x2d5a('0x83'),_0x544e96['id']);return getEndUser(_0xd60f88,_0x44fcdf,_0x1aa0ba,_0x17558a['destcalleridname'],_0x17558a[_0x2d5a('0x8f')],_0x544e96,_0x58d75d);})[_0x2d5a('0x38')](function(_0x280134){_0x259b0a=_0x280134;return getCall(_0xd60f88,_0x44fcdf,_0x1aa0ba,_0x544e96,_0x259b0a,_0x58d75d,_0x17558a,_0x2d5a('0x90'));})[_0x2d5a('0x38')](function(_0x5737c1){if(_0x5737c1){logger[_0x2d5a('0x3b')](_0x2d5a('0x85'),_0x5737c1['id']);logger[_0x2d5a('0x3b')](_0x2d5a('0x8b'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x2d5a('0x35')](_0x2d5a('0x87'),_0x556abe[_0x2d5a('0x1a')]),_0x2d5a('0x91'),{'uri':_0x2d5a('0x88')+_0x1aa0ba[_0x2d5a('0x7c')]+'/crm/EntityInfo.do?module=Calls&id='+_0x5737c1['id']});}})[_0x2d5a('0x2f')](function(_0x70da12){logger['error'](_0x2d5a('0x8b'),JSON[_0x2d5a('0xe')](_0x70da12));});};exports[_0x2d5a('0x92')]=function(_0x5af6e3,_0xb38db3,_0x4cc706,_0x6d2d61,_0x44adec,_0x4473e6){var _0x310451,_0x1a0eaa,_0x563561;_0x4473e6[_0x2d5a('0x7c')]=intUtil[_0x2d5a('0x7e')](_0x4473e6[_0x2d5a('0x7c')]);_0x4473e6[_0x2d5a('0x7d')]=intUtil[_0x2d5a('0x7e')](_0x4473e6[_0x2d5a('0x7d')]);if(_0x44adec&&_0x44adec[_0x2d5a('0x93')]){logger[_0x2d5a('0x3b')]('['+_0xb38db3[_0x2d5a('0x94')][_0x2d5a('0x95')]()+']',_0x2d5a('0x96'));_0xb38db3[_0x2d5a('0x80')]=_0x4473e6[_0x2d5a('0x7d')]+'/api/voice/recordings/'+_0xb38db3['uniqueid']+_0x2d5a('0x81')+md5(_0xb38db3[_0x2d5a('0x8d')]);}else{_0xb38db3['recordingURL']='';}var _0x479bd9=_0x4473e6[_0x2d5a('0x7c')]===_0x2d5a('0x8e')?'eu':_0x2d5a('0x82');return getAccessToken(_0x4473e6)[_0x2d5a('0x38')](function(_0x10aa69){_0x563561=_0x10aa69;return getUser(_0x563561,_0x479bd9,_0x4473e6);})[_0x2d5a('0x38')](function(_0x3330ba){_0x310451=_0x3330ba;logger[_0x2d5a('0x3b')](_0x2d5a('0x83'),_0x310451['id']);return getEndUser(_0x563561,_0x479bd9,_0x4473e6,_0xb38db3['calleridname'],_0xb38db3[_0x2d5a('0x84')],_0x310451,_0x4cc706);})['then'](function(_0x5b116b){_0x1a0eaa=_0x5b116b;return getCall(_0x563561,_0x479bd9,_0x4473e6,_0x310451,_0x1a0eaa,_0x4cc706,_0xb38db3,_0x2d5a('0x76'));})[_0x2d5a('0x38')](function(_0x68a958){if(_0x68a958){logger[_0x2d5a('0x3b')](_0x2d5a('0x85'),_0x68a958['id']);}})[_0x2d5a('0x2f')](function(_0x583858){logger[_0x2d5a('0x30')]('['+_0xb38db3[_0x2d5a('0x94')]['toUpperCase']()+']',JSON[_0x2d5a('0xe')](_0x583858));});};
\ No newline at end of file
+var _0x34b2=['variable','variableName','toString','customVariable','Variable','name','toLowerCase','split','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','/oauth/v2/token','clientId','clientSecret','refresh_token','then','add','seconds','catch','error','stack','format','ActiveUsers','Zoho-oauthtoken\x20','users','findIndex','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','user','profile','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','POST','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','details','Error:\x20','log','GET','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','Contacts','lead','Owner','administrator','Subject','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','abandoned','Abandoned','Call_Start_Time','outbound','agentcalledAt','Inbound','merge','Call\x20created!','err','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','toUpperCase','calleridnum','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','debug','[HTTP]','stringify','length','forEach','includes','string','picklist','type','idField','content'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x34b2,0x11c));var _0x234b=function(_0x2bf8ac,_0x4226be){_0x2bf8ac=_0x2bf8ac-0x0;var _0x3ef094=_0x34b2[_0x2bf8ac];return _0x3ef094;};'use strict';var _=require(_0x234b('0x0'));var rp=require(_0x234b('0x1'));var md5=require(_0x234b('0x2'));var util=require(_0x234b('0x3'));var intUtil=require(_0x234b('0x4'));var moment=require(_0x234b('0x5'));var Redis=require(_0x234b('0x6'));var BPromise=require(_0x234b('0x7'));var config=require(_0x234b('0x8'));var logger=require(_0x234b('0x9'))(_0x234b('0xa'));config[_0x234b('0xb')]=_[_0x234b('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x234b('0xb')]));function emit(_0x84f1f0,_0x153974,_0x36d33f){io['to'](_0x84f1f0)['emit'](_0x153974,_0x36d33f);}function request(_0x4f4899){logger[_0x234b('0xd')](_0x234b('0xe'),JSON[_0x234b('0xf')](_0x4f4899));return rp(_0x4f4899);}function getCustomFields(_0x30b17b,_0x2446ee){var _0x1bd00f={};if(_0x30b17b[_0x234b('0x10')]>0x0){_[_0x234b('0x11')](_0x30b17b,function(_0x465dd4){if(_[_0x234b('0x12')]([_0x234b('0x13'),_0x234b('0x14')],_0x465dd4[_0x234b('0x15')])&&_0x465dd4['idField']){_0x1bd00f[_0x465dd4[_0x234b('0x16')]]=_0x465dd4[_0x234b('0x17')]['toString']();}else if(_0x465dd4[_0x234b('0x15')]===_0x234b('0x18')&&_0x465dd4['variableName']&&_0x465dd4[_0x234b('0x16')]&&_0x2446ee[_0x465dd4[_0x234b('0x19')]]){_0x1bd00f[_0x465dd4[_0x234b('0x16')]]=_0x2446ee[_0x465dd4[_0x234b('0x19')]][_0x234b('0x1a')]();}else if(_0x465dd4[_0x234b('0x15')]===_0x234b('0x1b')&&_0x465dd4[_0x234b('0x1c')]&&_0x465dd4[_0x234b('0x1c')]['name']&&_0x465dd4[_0x234b('0x16')]&&_0x2446ee[_0x465dd4[_0x234b('0x1c')][_0x234b('0x1d')][_0x234b('0x1e')]()]){_0x1bd00f[_0x465dd4[_0x234b('0x16')]]=_0x2446ee[_0x465dd4[_0x234b('0x1c')][_0x234b('0x1d')][_0x234b('0x1e')]()][_0x234b('0x1a')]();}});}return _0x1bd00f;}function getName(_0x2f2b0f){if(_0x2f2b0f['indexOf']('\x20')>0x0){var _0x2d11cf=_0x2f2b0f[_0x234b('0x1f')](/ (.+)/);if(_0x2d11cf[0x1]){return _0x2d11cf;}}return[_0x2f2b0f,_0x2f2b0f];}var accountsTokens={};function getAccessToken(_0x2a47e1){return new Promise(function(_0x44d8d3,_0x2b7191){if(!_['isNil'](accountsTokens[_0x2a47e1['id']])&&!_[_0x234b('0x20')](accountsTokens[_0x2a47e1['id']][_0x234b('0x21')])){if(moment()['isBefore'](accountsTokens[_0x2a47e1['id']][_0x234b('0x22')])){_0x44d8d3(accountsTokens[_0x2a47e1['id']][_0x234b('0x21')]);}}var _0xb3222;switch(_0x2a47e1[_0x234b('0x23')]){case'US':_0xb3222=_0x234b('0x24');break;case'AU':_0xb3222=_0x234b('0x25');break;case'EU':_0xb3222=_0x234b('0x26');break;case'IN':_0xb3222=_0x234b('0x27');break;case'CN':_0xb3222=_0x234b('0x28');break;default:_0xb3222=_0x234b('0x26');break;}var _0x476fb7={'method':'POST','uri':_0xb3222+_0x234b('0x29'),'qs':{'refresh_token':_0x2a47e1['refreshToken'],'client_id':_0x2a47e1[_0x234b('0x2a')],'client_secret':_0x2a47e1[_0x234b('0x2b')],'grant_type':_0x234b('0x2c')},'json':!![]};return rp(_0x476fb7)[_0x234b('0x2d')](function(_0x493108){accountsTokens[_0x2a47e1['id']]={'access_token':_0x493108[_0x234b('0x21')],'expires_in':moment()[_0x234b('0x2e')](_0x493108['expires_in'],_0x234b('0x2f'))};_0x44d8d3(_0x493108[_0x234b('0x21')]);})[_0x234b('0x30')](function(_0x45c6b3){logger[_0x234b('0x31')]('Failing\x20creating\x20the\x20access_token',_0x45c6b3[_0x234b('0x32')]);_0x2b7191(_0x45c6b3);});});}function getUser(_0x5d211b,_0x439577,_0x3b698f,_0x2cca1a){logger['info']('Search\x20user');return request({'method':'GET','uri':util[_0x234b('0x33')]('https://www.zohoapis.%s/crm/v2/users',_0x439577),'qs':{'type':_0x234b('0x34')},'headers':{'Authorization':_0x234b('0x35')+_0x5d211b},'json':!![]})[_0x234b('0x2d')](function(_0x2f00bf){if(_0x2f00bf['users']){var _0x51c089=-0x1;if(_['isArrayLikeObject'](_0x2f00bf[_0x234b('0x36')])){if(!_[_0x234b('0x20')](_0x2cca1a)){_0x51c089=_[_0x234b('0x37')](_0x2f00bf['users'],function(_0x21a2c6){return _0x21a2c6[_0x234b('0x38')]===_0x2cca1a;});}if(_0x51c089>=0x0){logger[_0x234b('0x39')](_0x234b('0x3a'));}else{logger[_0x234b('0x39')](_0x234b('0x3b'));_0x51c089=_[_0x234b('0x37')](_0x2f00bf[_0x234b('0x36')],function(_0x232195){return _0x232195['profile'][_0x234b('0x1d')]===_0x234b('0x3c');});}return _0x2f00bf['users'][_0x51c089];}else{if(_0x2f00bf[_0x234b('0x3d')][_0x234b('0x3e')]['name']===_0x234b('0x3c')){logger[_0x234b('0x39')]('Using\x20the\x20admin\x20account!');user=_0x2f00bf[_0x234b('0x3d')];return user;}else{logger[_0x234b('0x31')](_0x234b('0x3f'),JSON['stringify'](_0x2f00bf));throw new Error(_0x234b('0x40')+JSON[_0x234b('0xf')](_0x2f00bf));}}}else{logger['error'](_0x234b('0x3f'),JSON['stringify'](_0x2f00bf));throw new Error(_0x234b('0x40')+JSON['stringify'](_0x2f00bf));}})['catch'](function(_0x5063b6){console[_0x234b('0x31')](_0x5063b6);});}function getZohoUser(_0x41289d,_0x38e685){return new BPromise(function(_0x37c1f4,_0x7d9398){request(_0x41289d)[_0x234b('0x2d')](function(_0x201bb4){var _0x167950=null;if(_0x201bb4){_0x167950=_0x201bb4[_0x234b('0x41')][0x0];_0x167950[_0x234b('0x42')]=_0x38e685;}_0x37c1f4(_0x167950);})['catch'](function(_0xd48e4e){_0x7d9398(_0xd48e4e);});});}function createEndUser(_0x6aeb71,_0x1243d5,_0x515246,_0x45200a,_0x4d31fe,_0x5e11a3){var _0x515246=getName(_0x515246);return request({'method':_0x234b('0x43'),'uri':'https://www.zohoapis.'+_0x1243d5+_0x234b('0x44')+_[_0x234b('0x45')](_0x5e11a3[_0x234b('0x46')])+'s','body':{'data':[{'Last_Name':_0x515246[0x1],'First_Name':_0x515246[0x0],'Phone':_0x45200a,'Owner':{'name':!_[_0x234b('0x20')](_0x4d31fe[_0x234b('0x47')][_0x234b('0x1d')])?_0x4d31fe[_0x234b('0x47')][_0x234b('0x1d')]:!_['isNil'](_0x4d31fe[_0x234b('0x48')])?_0x4d31fe[_0x234b('0x48')]+'\x20'+_0x4d31fe[_0x234b('0x49')]:_0x4d31fe[_0x234b('0x49')],'id':_0x4d31fe['id']}}]},'headers':{'Authorization':_0x234b('0x35')+_0x6aeb71},'json':!![]})[_0x234b('0x2d')](function(_0x4817ca){if(_0x4817ca&&_0x4817ca[_0x234b('0x41')][0x0][_0x234b('0x4a')]===_0x234b('0x4b')){var _0xb5d9e3=_0x4817ca[_0x234b('0x41')][0x0][_0x234b('0x4c')];_0xb5d9e3['enduserType']=_[_0x234b('0x45')](_0x5e11a3['moduleCreate'])+'s';return _0xb5d9e3;}logger['error'](_0x234b('0x3f'),JSON[_0x234b('0xf')](data));throw new Error(_0x234b('0x4d')+JSON[_0x234b('0xf')](data));})['catch'](function(_0x47c712){console[_0x234b('0x4e')]('CREATE\x20ERROR',_0x47c712);});}function getEndUser(_0x30ef44,_0x1f6a9b,_0x314011,_0x5816cc,_0x61d331,_0x5ef306,_0x9fdb90){var _0x3d803d={'method':_0x234b('0x4f'),'uri':'','headers':{'Authorization':_0x234b('0x35')+_0x30ef44},'json':!![]};switch(_0x9fdb90['moduleSearch']){case _0x234b('0x50'):_0x3d803d[_0x234b('0x51')]=_0x234b('0x52')+_0x1f6a9b+_0x234b('0x53')+_0x61d331+'))';return getZohoUser(_0x3d803d,'Contacts')['then'](function(_0x5e86cd){if(_0x5e86cd)return _0x5e86cd;_0x3d803d['uri']=_0x234b('0x52')+_0x1f6a9b+_0x234b('0x54')+_0x61d331+'))';return getZohoUser(_0x3d803d,_0x234b('0x55'))['then'](function(_0x538738){if(_0x538738)return _0x538738;if(_0x9fdb90[_0x234b('0x46')]!=_0x234b('0x56')){return createEndUser(_0x30ef44,_0x1f6a9b,_0x5816cc,_0x61d331,_0x5ef306,_0x9fdb90);}else{return{};}});});break;case _0x234b('0x57'):_0x3d803d[_0x234b('0x51')]=_0x234b('0x52')+_0x1f6a9b+_0x234b('0x53')+_0x61d331+'))';return getZohoUser(_0x3d803d,_0x234b('0x58'))[_0x234b('0x2d')](function(_0x4d3cb3){if(_0x4d3cb3)return _0x4d3cb3;if(_0x9fdb90[_0x234b('0x46')]!='nothing'){return createEndUser(_0x30ef44,_0x1f6a9b,_0x5816cc,_0x61d331,_0x5ef306,_0x9fdb90);}else{return{};}});break;case _0x234b('0x59'):_0x3d803d[_0x234b('0x51')]='https://www.zohoapis.'+_0x1f6a9b+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x61d331+'))';return getZohoUser(_0x3d803d,_0x234b('0x55'))[_0x234b('0x2d')](function(_0x47d267){if(_0x47d267)return _0x47d267;if(_0x9fdb90[_0x234b('0x46')]!='nothing'){return createEndUser(_0x30ef44,_0x1f6a9b,_0x5816cc,_0x61d331,_0x5ef306,_0x9fdb90);}else{return{};}});break;}}function getCall(_0xe056e6,_0x39e15c,_0x31d969,_0x57b591,_0x54dd00,_0x18732c,_0x2fdae6,_0x54449b){logger[_0x234b('0x39')]('Creating\x20new\x20call...');var _0x5423a5={};_0x5423a5[_0x234b('0x5a')]={'name':!_[_0x234b('0x20')](_0x57b591[_0x234b('0x47')][_0x234b('0x1d')])&&!_['isNil'](_0x57b591[_0x234b('0x3e')]['name'])&&_0x57b591['profile'][_0x234b('0x1d')]===_0x234b('0x5b')?_0x57b591[_0x234b('0x47')][_0x234b('0x1d')]:!_[_0x234b('0x20')](_0x57b591[_0x234b('0x48')])?_0x57b591['first_name']+'\x20'+_0x57b591[_0x234b('0x49')]:_0x57b591[_0x234b('0x49')],'id':_0x57b591['id']};_0x5423a5[_0x234b('0x5c')]=intUtil[_0x234b('0x5d')](_0x18732c['Subjects'],_0x2fdae6,'\x20');_0x5423a5[_0x234b('0x5e')]=intUtil[_0x234b('0x5d')](_0x18732c[_0x234b('0x5f')],_0x2fdae6,'\x0a');if(_0x54dd00['enduserType']===_0x234b('0x58')){_0x5423a5[_0x234b('0x60')]={'name':!_[_0x234b('0x20')](_0x54dd00[_0x234b('0x61')])?_0x54dd00[_0x234b('0x61')]:!_[_0x234b('0x20')](_0x54dd00['First_Name'])?_0x54dd00[_0x234b('0x62')]+'\x20'+_0x54dd00[_0x234b('0x63')]:_0x54dd00[_0x234b('0x63')],'id':_0x54dd00['id']};}if(_0x54dd00[_0x234b('0x42')]==='Leads'){_0x5423a5['What_Id']={'name':!_[_0x234b('0x20')](_0x54dd00[_0x234b('0x61')])?_0x54dd00[_0x234b('0x61')]:!_[_0x234b('0x20')](_0x54dd00['First_Name'])?_0x54dd00['First_Name']+'\x20'+_0x54dd00[_0x234b('0x63')]:_0x54dd00['Last_Name'],'id':_0x54dd00['id']};_0x5423a5[_0x234b('0x64')]=_['startCase'](_0x54dd00[_0x234b('0x42')]);}if(_0x2fdae6[_0x234b('0x65')]){_0x5423a5[_0x234b('0x66')]=moment[_0x234b('0x67')](parseInt(_0x2fdae6[_0x234b('0x65')])*0x3e8)[_0x234b('0x33')](_0x234b('0x68'));}else if(_0x2fdae6[_0x234b('0x69')]&&_0x2fdae6[_0x234b('0x6a')]){_0x5423a5['Call_Duration']=moment[_0x234b('0x67')](moment(_0x2fdae6[_0x234b('0x6a')],'YYYY-MM-DDTHH:mm:ss')[_0x234b('0x6b')](moment(_0x2fdae6[_0x234b('0x6c')],_0x234b('0x6d'))))[_0x234b('0x33')](_0x234b('0x68'));}switch(_0x2fdae6[_0x234b('0x6e')]){case _0x234b('0x6f'):_0x5423a5[_0x234b('0x70')]=_0x234b('0x71');break;case _0x234b('0x72'):case _0x234b('0x73'):_0x5423a5[_0x234b('0x70')]=_0x234b('0x74');break;case _0x234b('0x75'):_0x5423a5[_0x234b('0x70')]='Rejected';break;case _0x234b('0x76'):_0x5423a5[_0x234b('0x70')]=_0x234b('0x77');break;case'timeout':_0x5423a5[_0x234b('0x70')]='Timeout';default:}_0x5423a5[_0x234b('0x78')]=(_0x54449b===_0x234b('0x79')?moment(_0x2fdae6[_0x234b('0x6c')])[_0x234b('0x33')](_0x234b('0x6d')):moment(_0x2fdae6[_0x234b('0x7a')])[_0x234b('0x33')]('YYYY-MM-DDTHH:mm:ss'))||moment()['format'](_0x234b('0x6d'));_0x5423a5['Call_Type']=_0x54449b||_0x234b('0x7b');_0x5423a5=_[_0x234b('0x7c')](_0x5423a5,getCustomFields(_0x18732c['Fields'],_0x2fdae6));return request({'method':_0x234b('0x43'),'uri':'https://www.zohoapis.'+_0x39e15c+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xe056e6},'body':{'data':[_0x5423a5]},'json':!![]})[_0x234b('0x2d')](function(_0x1ff450){if(_0x1ff450&&_0x1ff450['data'][0x0]['code']==='SUCCESS'){logger[_0x234b('0x39')](_0x234b('0x7d'));return{'id':_0x1ff450[_0x234b('0x41')][0x0][_0x234b('0x4c')]['id']};}})['catch'](function(_0x2eb15f){logger[_0x234b('0x39')](_0x234b('0x7e'),_0x2eb15f[_0x234b('0x32')]);console['log'](_0x234b('0x7e'),_0x2eb15f);});}exports['queue']=function(_0xe39173,_0x180986,_0x1f7c8c,_0x16231d,_0x3f4f2a,_0x52252b){var _0x54fd7b,_0x22c2d4,_0x14a6e9;_0x52252b[_0x234b('0x7f')]=intUtil[_0x234b('0x80')](_0x52252b[_0x234b('0x7f')]);_0x52252b[_0x234b('0x81')]=intUtil[_0x234b('0x80')](_0x52252b[_0x234b('0x81')]);if(_0x3f4f2a&&_0x3f4f2a[_0x234b('0x82')]){logger[_0x234b('0x39')](_0x234b('0x83'),_0x234b('0x84'));_0x180986[_0x234b('0x85')]=_0x52252b[_0x234b('0x81')]+_0x234b('0x86')+_0x180986[_0x234b('0x87')]+_0x234b('0x88')+md5(_0x180986[_0x234b('0x87')]);}else{_0x180986[_0x234b('0x85')]='';}var _0x5cd132=_0x52252b[_0x234b('0x7f')]===_0x234b('0x89')?'eu':_0x234b('0x8a');return getAccessToken(_0x52252b)[_0x234b('0x2d')](function(_0x5580f7){_0x14a6e9=_0x5580f7;return getUser(_0x14a6e9,_0x5cd132,_0x52252b,_0x16231d[_0x234b('0x38')]);})[_0x234b('0x2d')](function(_0x21ae7d){_0x54fd7b=_0x21ae7d;logger[_0x234b('0x39')](_0x234b('0x8b'),_0x54fd7b['id']);return getEndUser(_0x14a6e9,_0x5cd132,_0x52252b,_0x180986[_0x234b('0x8c')],_0x180986['calleridnum'],_0x54fd7b,_0x1f7c8c);})['then'](function(_0x19ad09){_0x22c2d4=_0x19ad09;return getCall(_0x14a6e9,_0x5cd132,_0x52252b,_0x54fd7b,_0x22c2d4,_0x1f7c8c,_0x180986,_0x234b('0x7b'));})[_0x234b('0x2d')](function(_0x5f0549){if(_0x5f0549){logger[_0x234b('0x39')](_0x234b('0x8d'),_0x5f0549['id']);logger[_0x234b('0x39')](_0x234b('0x83'),_0x234b('0x8e'));emit(util['format'](_0x234b('0x8f'),_0x16231d[_0x234b('0x1d')]),_0x234b('0x90'),{'uri':_0x234b('0x91')+_0x52252b[_0x234b('0x7f')]+_0x234b('0x92')+_0x5f0549['id']});}})[_0x234b('0x30')](function(_0x525139){logger[_0x234b('0x31')]('[QUEUE]',JSON[_0x234b('0xf')](_0x525139));});};exports[_0x234b('0x79')]=function(_0x3598d8,_0x23436c,_0x453a31,_0x15484f,_0x2006a1,_0x50fe54,_0x495212){var _0x4dd6bb,_0x235ef0,_0x16539c;_0x50fe54[_0x234b('0x7f')]=intUtil['stripTrailingSlash'](_0x50fe54[_0x234b('0x7f')]);_0x50fe54['serverUrl']=intUtil['stripTrailingSlash'](_0x50fe54[_0x234b('0x81')]);if(_0x495212&&_0x495212[_0x234b('0x93')]&&_0x495212[_0x234b('0x93')]!==_0x234b('0x94')){logger['info'](_0x234b('0x95'),_0x234b('0x84'));_0x23436c[_0x234b('0x85')]=_0x50fe54[_0x234b('0x81')]+_0x234b('0x86')+_0x23436c['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x23436c['uniqueid']);}var _0x6a52c2=_0x50fe54[_0x234b('0x7f')]===_0x234b('0x89')?'eu':_0x234b('0x8a');return getAccessToken(_0x50fe54)[_0x234b('0x2d')](function(_0x395d11){_0x16539c=_0x395d11;return getUser(_0x16539c,_0x6a52c2,_0x50fe54,_0x15484f[_0x234b('0x38')]);})['then'](function(_0x1af1ee){_0x4dd6bb=_0x1af1ee;logger[_0x234b('0x39')](_0x234b('0x8b'),_0x4dd6bb['id']);return getEndUser(_0x16539c,_0x6a52c2,_0x50fe54,_0x23436c[_0x234b('0x96')],_0x23436c[_0x234b('0x97')],_0x4dd6bb,_0x453a31);})[_0x234b('0x2d')](function(_0xa5953a){_0x235ef0=_0xa5953a;return getCall(_0x16539c,_0x6a52c2,_0x50fe54,_0x4dd6bb,_0x235ef0,_0x453a31,_0x23436c,'Outbound');})[_0x234b('0x2d')](function(_0x679eb1){if(_0x679eb1){logger[_0x234b('0x39')](_0x234b('0x8d'),_0x679eb1['id']);logger[_0x234b('0x39')](_0x234b('0x95'),_0x234b('0x8e'));emit(util[_0x234b('0x33')](_0x234b('0x8f'),_0x15484f[_0x234b('0x1d')]),_0x234b('0x90'),{'uri':_0x234b('0x91')+_0x50fe54[_0x234b('0x7f')]+_0x234b('0x92')+_0x679eb1['id']});}})[_0x234b('0x30')](function(_0x39fb1b){logger['error'](_0x234b('0x95'),JSON['stringify'](_0x39fb1b));});};exports['unmanaged']=function(_0x3515b8,_0x5a960a,_0x879977,_0x1c676a,_0x239f03,_0x189e60){var _0x186dc2,_0x2b9b9b,_0x1915e1;_0x189e60[_0x234b('0x7f')]=intUtil[_0x234b('0x80')](_0x189e60['host']);_0x189e60[_0x234b('0x81')]=intUtil[_0x234b('0x80')](_0x189e60['serverUrl']);if(_0x239f03&&_0x239f03[_0x234b('0x82')]){logger[_0x234b('0x39')]('['+_0x5a960a['lastevent'][_0x234b('0x98')]()+']',_0x234b('0x84'));_0x5a960a[_0x234b('0x85')]=_0x189e60[_0x234b('0x81')]+'/api/voice/recordings/'+_0x5a960a[_0x234b('0x87')]+_0x234b('0x88')+md5(_0x5a960a[_0x234b('0x87')]);}else{_0x5a960a['recordingURL']='';}var _0x969363=_0x189e60[_0x234b('0x7f')]===_0x234b('0x89')?'eu':_0x234b('0x8a');return getAccessToken(_0x189e60)[_0x234b('0x2d')](function(_0x320fd0){_0x1915e1=_0x320fd0;return getUser(_0x1915e1,_0x969363,_0x189e60);})['then'](function(_0x59b100){_0x186dc2=_0x59b100;logger[_0x234b('0x39')](_0x234b('0x8b'),_0x186dc2['id']);return getEndUser(_0x1915e1,_0x969363,_0x189e60,_0x5a960a['calleridname'],_0x5a960a[_0x234b('0x99')],_0x186dc2,_0x879977);})['then'](function(_0x5a5b05){_0x2b9b9b=_0x5a5b05;return getCall(_0x1915e1,_0x969363,_0x189e60,_0x186dc2,_0x2b9b9b,_0x879977,_0x5a960a,_0x234b('0x7b'));})[_0x234b('0x2d')](function(_0x13e8ff){if(_0x13e8ff){logger[_0x234b('0x39')](_0x234b('0x8d'),_0x13e8ff['id']);}})[_0x234b('0x30')](function(_0x3c26e0){logger[_0x234b('0x31')]('['+_0x5a960a[_0x234b('0x6e')][_0x234b('0x98')]()+']',JSON[_0x234b('0xf')](_0x3c26e0));});};
\ No newline at end of file
index a1e2e8b..f8643e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2c6b=['mustache','../../../../config/logger','trigger','exec','data2','Script','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x1295a1,_0x5e11a7){var _0x868b0c=function(_0x24a52e){while(--_0x24a52e){_0x1295a1['push'](_0x1295a1['shift']());}};_0x868b0c(++_0x5e11a7);}(_0x2c6b,0x1ab));var _0xb2c6=function(_0x5de505,_0xee5804){_0x5de505=_0x5de505-0x0;var _0x1df98e=_0x2c6b[_0x5de505];return _0x1df98e;};'use strict';var util=require(_0xb2c6('0x0'));var sh=require(_0xb2c6('0x1'));var Mustache=require(_0xb2c6('0x2'));var logger=require(_0xb2c6('0x3'))(_0xb2c6('0x4'));exports[_0xb2c6('0x5')]=function(_0x3a40ca,_0x2e82c0){var _0xa5d270=_0x3a40ca[_0xb2c6('0x6')]?_0x3a40ca[_0xb2c6('0x6')]:_0xb2c6('0x7');var _0x1de330=_0x3a40ca[_0xb2c6('0x8')]?Mustache['render'](_0x3a40ca[_0xb2c6('0x8')],_0x2e82c0):_0x2e82c0;sh[_0xb2c6('0x5')](_0x1de330,function(_0x51752c,_0x2fbcf2,_0x5407bb){if(_0x51752c!==0x0){logger[_0xb2c6('0x9')](util[_0xb2c6('0xa')](_0xb2c6('0xb'),_0xa5d270,_0x1de330,_0x51752c,_0x5407bb));}else{logger['info'](util[_0xb2c6('0xa')](_0xb2c6('0xc'),_0xa5d270,_0x1de330,_0x2fbcf2));}});};
\ No newline at end of file
+var _0xccd7=['data2','data3','render','exec','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','util','shelljs','mustache','../../../../config/logger','trigger'];(function(_0x31b0c2,_0x166038){var _0x141601=function(_0x592ad6){while(--_0x592ad6){_0x31b0c2['push'](_0x31b0c2['shift']());}};_0x141601(++_0x166038);}(_0xccd7,0x140));var _0x7ccd=function(_0x132558,_0x521d93){_0x132558=_0x132558-0x0;var _0x34f138=_0xccd7[_0x132558];return _0x34f138;};'use strict';var util=require(_0x7ccd('0x0'));var sh=require(_0x7ccd('0x1'));var Mustache=require(_0x7ccd('0x2'));var logger=require(_0x7ccd('0x3'))(_0x7ccd('0x4'));exports['exec']=function(_0x160c76,_0x4fb0e6){var _0x115919=_0x160c76[_0x7ccd('0x5')]?_0x160c76['data2']:'Script';var _0x44dcb9=_0x160c76[_0x7ccd('0x6')]?Mustache[_0x7ccd('0x7')](_0x160c76[_0x7ccd('0x6')],_0x4fb0e6):_0x4fb0e6;sh[_0x7ccd('0x8')](_0x44dcb9,function(_0x28c009,_0x2e8df9,_0x39817c){if(_0x28c009!==0x0){logger[_0x7ccd('0x9')](util[_0x7ccd('0xa')](_0x7ccd('0xb'),_0x115919,_0x44dcb9,_0x28c009,_0x39817c));}else{logger[_0x7ccd('0xc')](util[_0x7ccd('0xa')]('%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s',_0x115919,_0x44dcb9,_0x2e8df9));}});};
\ No newline at end of file
index a5602f4..c7edf84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a13=['render','error','stack','data1','toUpperCase','GET','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','name','request-promise','lodash','mustache','../../../../config/logger','trigger','data2','data5','headers','data6','parse'];(function(_0x1f9e8d,_0xcd553c){var _0x4fa024=function(_0x18f7ff){while(--_0x18f7ff){_0x1f9e8d['push'](_0x1f9e8d['shift']());}};_0x4fa024(++_0xcd553c);}(_0x3a13,0x176));var _0x33a1=function(_0x3f0b30,_0x159bc8){_0x3f0b30=_0x3f0b30-0x0;var _0x2748a5=_0x3a13[_0x3f0b30];return _0x2748a5;};'use strict';var rp=require(_0x33a1('0x0'));var util=require('util');var _=require(_0x33a1('0x1'));var Mustache=require(_0x33a1('0x2'));var logger=require(_0x33a1('0x3'))(_0x33a1('0x4'));exports['exec']=function(_0x35fc06,_0x43894d){var _0x5e8dd5,_0x315db9;var _0x224342={'method':_0x35fc06['data1']['toUpperCase'](),'uri':Mustache['render'](_0x35fc06[_0x33a1('0x5')],_0x43894d),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x35fc06[_0x33a1('0x6')])==='number'&&parseInt(_0x35fc06['data5'])>=0x1&&parseInt(_0x35fc06[_0x33a1('0x6')])<=0xa?parseInt(_0x35fc06[_0x33a1('0x6')])*0x3e8:0x5*0x3e8};try{_0x224342[_0x33a1('0x7')]=_0x35fc06[_0x33a1('0x8')]?JSON[_0x33a1('0x9')](Mustache[_0x33a1('0xa')](_0x35fc06[_0x33a1('0x8')],_0x43894d)):{};}catch(_0x3ae689){logger[_0x33a1('0xb')](_0x3ae689[_0x33a1('0xc')]);}switch(_0x35fc06[_0x33a1('0xd')][_0x33a1('0xe')]()){case _0x33a1('0xf'):case'DELETE':_0x5e8dd5=null;_0x224342['qs']=_0x43894d;break;case'POST':case _0x33a1('0x10'):if(_0x35fc06[_0x33a1('0x11')]){try{_0x5e8dd5=JSON[_0x33a1('0x9')](Mustache[_0x33a1('0xa')](_0x35fc06['data7'],_0x43894d));_0x224342[_0x33a1('0x12')]=_0x5e8dd5;}catch(_0x205c22){logger['error'](_0x205c22[_0x33a1('0xc')]);logger['error'](_0x33a1('0x13'));}}else{_0x5e8dd5=_0x43894d;_0x224342[_0x33a1('0x12')]=_0x5e8dd5;}break;}logger[_0x33a1('0x14')](util[_0x33a1('0x15')](_0x33a1('0x16'),_0x35fc06[_0x33a1('0xd')],_0x35fc06['data2'],JSON[_0x33a1('0x17')](_0x224342)));rp(_0x224342)[_0x33a1('0x18')](function(_0xe55a1a){_0x5e8dd5=!_[_0x33a1('0x19')](_0x5e8dd5)?_0x33a1('0x1a')+_0x5e8dd5:'';_0x315db9=typeof _0xe55a1a[_0x33a1('0x12')]===_0x33a1('0x1b')?JSON[_0x33a1('0x17')](_0xe55a1a[_0x33a1('0x12')]):_0xe55a1a['body'];logger[_0x33a1('0x14')](util[_0x33a1('0x15')](_0x33a1('0x1c'),_0x35fc06[_0x33a1('0xd')],_0x35fc06['data2'],_0xe55a1a[_0x33a1('0x1d')],_0x315db9));})[_0x33a1('0x1e')](function(_0x4da420){logger[_0x33a1('0xb')](util[_0x33a1('0x15')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x35fc06[_0x33a1('0xd')],_0x35fc06[_0x33a1('0x5')],_0x4da420[_0x33a1('0x1d')],_0x4da420[_0x33a1('0x1f')],_0x4da420['message']));});};
\ No newline at end of file
+var _0x1178=['%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','name','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','toUpperCase','data2','data5','number','data6','parse','error','stack','data1','DELETE','data7','render','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then'];(function(_0x2be99e,_0x6212bb){var _0x4bf783=function(_0x328bf2){while(--_0x328bf2){_0x2be99e['push'](_0x2be99e['shift']());}};_0x4bf783(++_0x6212bb);}(_0x1178,0x16c));var _0x8117=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x1178[_0x20a584];return _0x4b41a8;};'use strict';var rp=require(_0x8117('0x0'));var util=require(_0x8117('0x1'));var _=require(_0x8117('0x2'));var Mustache=require(_0x8117('0x3'));var logger=require(_0x8117('0x4'))(_0x8117('0x5'));exports[_0x8117('0x6')]=function(_0x1f8867,_0x214a8f){var _0x402974,_0x373a8b;var _0x23c711={'method':_0x1f8867['data1'][_0x8117('0x7')](),'uri':Mustache['render'](_0x1f8867[_0x8117('0x8')],_0x214a8f),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1f8867[_0x8117('0x9')])===_0x8117('0xa')&&parseInt(_0x1f8867[_0x8117('0x9')])>=0x1&&parseInt(_0x1f8867[_0x8117('0x9')])<=0xa?parseInt(_0x1f8867[_0x8117('0x9')])*0x3e8:0x5*0x3e8};try{_0x23c711['headers']=_0x1f8867[_0x8117('0xb')]?JSON[_0x8117('0xc')](Mustache['render'](_0x1f8867[_0x8117('0xb')],_0x214a8f)):{};}catch(_0xaf057a){logger[_0x8117('0xd')](_0xaf057a[_0x8117('0xe')]);}switch(_0x1f8867[_0x8117('0xf')][_0x8117('0x7')]()){case'GET':case _0x8117('0x10'):_0x402974=null;_0x23c711['qs']=_0x214a8f;break;case'POST':case'PUT':if(_0x1f8867[_0x8117('0x11')]){try{_0x402974=JSON[_0x8117('0xc')](Mustache[_0x8117('0x12')](_0x1f8867[_0x8117('0x11')],_0x214a8f));_0x23c711[_0x8117('0x13')]=_0x402974;}catch(_0x4daf38){logger['error'](_0x4daf38[_0x8117('0xe')]);logger[_0x8117('0xd')](_0x8117('0x14'));}}else{_0x402974=_0x214a8f;_0x23c711[_0x8117('0x13')]=_0x402974;}break;}logger[_0x8117('0x15')](util[_0x8117('0x16')](_0x8117('0x17'),_0x1f8867[_0x8117('0xf')],_0x1f8867[_0x8117('0x8')],JSON[_0x8117('0x18')](_0x23c711)));rp(_0x23c711)[_0x8117('0x19')](function(_0x1e491b){_0x402974=!_['isNil'](_0x402974)?',\x20request\x20body:\x20'+_0x402974:'';_0x373a8b=typeof _0x1e491b[_0x8117('0x13')]==='object'?JSON[_0x8117('0x18')](_0x1e491b[_0x8117('0x13')]):_0x1e491b['body'];logger[_0x8117('0x15')](util[_0x8117('0x16')](_0x8117('0x1a'),_0x1f8867[_0x8117('0xf')],_0x1f8867['data2'],_0x1e491b['statusCode'],_0x373a8b));})['catch'](function(_0x20822d){logger[_0x8117('0xd')](util[_0x8117('0x16')]('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x1f8867[_0x8117('0xf')],_0x1f8867[_0x8117('0x8')],_0x20822d[_0x8117('0x1b')],_0x20822d[_0x8117('0x1c')],_0x20822d[_0x8117('0x1d')]));});};
\ No newline at end of file
index 7835fd4..a1c0775 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96d4=['client','http','Request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing'];(function(_0x49dcfc,_0x1904ea){var _0x22374c=function(_0x36b875){while(--_0x36b875){_0x49dcfc['push'](_0x49dcfc['shift']());}};_0x22374c(++_0x1904ea);}(_0x96d4,0xdd));var _0x496d=function(_0x1458c2,_0x5e1de9){_0x1458c2=_0x1458c2-0x0;var _0x562d7a=_0x96d4[_0x1458c2];return _0x562d7a;};'use strict';var jayson=require(_0x496d('0x0'));var BPromise=require(_0x496d('0x1'));var logger=require(_0x496d('0x2'))(_0x496d('0x3'));var client=jayson[_0x496d('0x4')][_0x496d('0x5')]({'port':0x2329});client[_0x496d('0x6')]=function(_0x3efd4f,_0x5f2065){return new BPromise(function(_0x5166c3,_0x21d821){return client['request'](_0x3efd4f,_0x5f2065)[_0x496d('0x7')](function(_0x454206){logger[_0x496d('0x8')](_0x496d('0x9'),'routing',_0x3efd4f,_0x5f2065,_0x454206);if(_0x454206['error']){logger[_0x496d('0xa')](_0x496d('0x9'),_0x496d('0x3'),_0x3efd4f,_0x454206['error'][_0x496d('0xb')],_0x5f2065);return _0x21d821(_0x454206[_0x496d('0xa')]['message']);}else{return _0x5166c3(_0x454206[_0x496d('0xc')]);}})[_0x496d('0xd')](function(_0x3b15eb){logger[_0x496d('0xa')](_0x496d('0x9'),_0x496d('0x3'),_0x3efd4f,_0x3b15eb,_0x5f2065);return _0x21d821(_0x3b15eb);});});};module[_0x496d('0xe')]=client;
\ No newline at end of file
+var _0xe048=['then','debug','rpc','error','message','result','exports','jayson/promise','../../config/logger','routing','client','Request','request'];(function(_0x3c4e4c,_0x36ff70){var _0x144a87=function(_0x5efb4b){while(--_0x5efb4b){_0x3c4e4c['push'](_0x3c4e4c['shift']());}};_0x144a87(++_0x36ff70);}(_0xe048,0x13f));var _0x8e04=function(_0x569ff4,_0x1f7757){_0x569ff4=_0x569ff4-0x0;var _0x256a36=_0xe048[_0x569ff4];return _0x256a36;};'use strict';var jayson=require(_0x8e04('0x0'));var BPromise=require('bluebird');var logger=require(_0x8e04('0x1'))(_0x8e04('0x2'));var client=jayson[_0x8e04('0x3')]['http']({'port':0x2329});client[_0x8e04('0x4')]=function(_0x3fe6d0,_0x4b4c00){return new BPromise(function(_0x41d5b4,_0x36691b){return client[_0x8e04('0x5')](_0x3fe6d0,_0x4b4c00)[_0x8e04('0x6')](function(_0xe61d15){logger[_0x8e04('0x7')](_0x8e04('0x8'),_0x8e04('0x2'),_0x3fe6d0,_0x4b4c00,_0xe61d15);if(_0xe61d15[_0x8e04('0x9')]){logger[_0x8e04('0x9')](_0x8e04('0x8'),_0x8e04('0x2'),_0x3fe6d0,_0xe61d15[_0x8e04('0x9')]['message'],_0x4b4c00);return _0x36691b(_0xe61d15[_0x8e04('0x9')][_0x8e04('0xa')]);}else{return _0x41d5b4(_0xe61d15[_0x8e04('0xb')]);}})['catch'](function(_0x3a70ca){logger[_0x8e04('0x9')](_0x8e04('0x8'),_0x8e04('0x2'),_0x3fe6d0,_0x3a70ca,_0x4b4c00);return _0x36691b(_0x3a70ca);});});};module[_0x8e04('0xc')]=client;
\ No newline at end of file
index 798f893..d8fe82a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5a02=['catch','log','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','resolve','then','getMailAccounts','initMailAccounts','listen','getSettings','loginMailFrequency'];(function(_0xae2cbf,_0x1446a6){var _0x31931b=function(_0x2717af){while(--_0x2717af){_0xae2cbf['push'](_0xae2cbf['shift']());}};_0x31931b(++_0x1446a6);}(_0x5a02,0x152));var _0x25a0=function(_0x7275e9,_0x321fa5){_0x7275e9=_0x7275e9-0x0;var _0x17b99d=_0x5a02[_0x7275e9];return _0x17b99d;};'use strict';var BPromise=require('bluebird');var server=require(_0x25a0('0x0'));var Realtime=require(_0x25a0('0x1'));var EmailChannel=require(_0x25a0('0x2'));var mailAccount=require(_0x25a0('0x3'));var setting=require(_0x25a0('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x25a0('0x5')]()[_0x25a0('0x6')](mailAccount[_0x25a0('0x7')]())[_0x25a0('0x6')](realtime[_0x25a0('0x8')]())[_0x25a0('0x6')](function(){email['refresh'](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x25a0('0x9')](realtime,email)[_0x25a0('0x6')](function(){return initRealtime();})[_0x25a0('0x6')](function(){return setting[_0x25a0('0xa')]();})[_0x25a0('0x6')](function(_0x1591a9){return setInterval(initRealtime,_0x1591a9[_0x25a0('0xb')]*0x3e8);})[_0x25a0('0xc')](function(_0x59eaea){console[_0x25a0('0xd')](_0x59eaea);});}main();
\ No newline at end of file
+var _0x0e08=['then','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','resolve'];(function(_0x260320,_0x5e0c95){var _0x457fef=function(_0x25311b){while(--_0x25311b){_0x260320['push'](_0x260320['shift']());}};_0x457fef(++_0x5e0c95);}(_0x0e08,0x18e));var _0x80e0=function(_0x49ce9a,_0x665aa0){_0x49ce9a=_0x49ce9a-0x0;var _0x337fa2=_0x0e08[_0x49ce9a];return _0x337fa2;};'use strict';var BPromise=require(_0x80e0('0x0'));var server=require(_0x80e0('0x1'));var Realtime=require(_0x80e0('0x2'));var EmailChannel=require(_0x80e0('0x3'));var mailAccount=require(_0x80e0('0x4'));var setting=require(_0x80e0('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x80e0('0x6')]()['then'](mailAccount['getMailAccounts']())[_0x80e0('0x7')](realtime[_0x80e0('0x8')]())['then'](function(){email[_0x80e0('0x9')](realtime[_0x80e0('0xa')]);return realtime;});}function main(){return server[_0x80e0('0xb')](realtime,email)['then'](function(){return initRealtime();})[_0x80e0('0x7')](function(){return setting[_0x80e0('0xc')]();})[_0x80e0('0x7')](function(_0x4dd961){return setInterval(initRealtime,_0x4dd961[_0x80e0('0xd')]*0x3e8);})[_0x80e0('0xe')](function(_0x21776c){console['log'](_0x21776c);});}main();
\ No newline at end of file
index 7aad097..fd91d4b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11e0=['Smtp','verify','exports','lodash','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','emit','name','active','Imap','status','total','isNil','stringify','mailAccount:update','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','handleImapEnd','handleImapError','disabled','messageStatus','messages','firstName','lastName','from','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','send'];(function(_0xe2f878,_0x451892){var _0x43ba4e=function(_0x20e1ee){while(--_0x20e1ee){_0xe2f878['push'](_0xe2f878['shift']());}};_0x43ba4e(++_0x451892);}(_0x11e0,0x96));var _0x011e=function(_0x59810d,_0x557a67){_0x59810d=_0x59810d-0x0;var _0x49c35a=_0x11e0[_0x59810d];return _0x49c35a;};'use strict';var _=require(_0x011e('0x0'));var moment=require('moment');var BPromise=require(_0x011e('0x1'));var md5=require(_0x011e('0x2'));var Redis=require(_0x011e('0x3'));var config=require(_0x011e('0x4'));var logger=require(_0x011e('0x5'))(_0x011e('0x6'));config[_0x011e('0x7')]=_[_0x011e('0x8')](config[_0x011e('0x7')],{'host':_0x011e('0x9'),'port':0x18eb});var io=require(_0x011e('0xa'))(new Redis(config[_0x011e('0x7')]));var EmailImap=require(_0x011e('0xb'));var EmailSmtp=require(_0x011e('0xc'));var mailAccount=require(_0x011e('0xd'));var md5Accounts={};function EmailChannel(_0x2e4e35){logger[_0x011e('0xe')]('start\x20email\x20channel');this[_0x011e('0xf')]=_0x2e4e35[_0x011e('0xf')];this[_0x011e('0x10')]={};this[_0x011e('0x11')]=new EmailSmtp();}EmailChannel[_0x011e('0x12')][_0x011e('0x13')]=function(_0x419628){var _0x4e7e3c=this[_0x011e('0xf')][_0x419628];var _0x1f2c0a={'id':_0x4e7e3c['id'],'name':_0x4e7e3c[_0x011e('0x14')],'key':_0x4e7e3c['key'],'active':_0x4e7e3c[_0x011e('0x15')],'Imap':{'status':_0x4e7e3c[_0x011e('0x16')][_0x011e('0x17')],'messageStatus':_0x4e7e3c[_0x011e('0x16')]['messageStatus'],'total':_0x4e7e3c[_0x011e('0x16')][_0x011e('0x18')]}};if(_[_0x011e('0x19')](md5Accounts[_0x419628])){md5Accounts[_0x419628]={};}var _0x1e64cd=md5(JSON[_0x011e('0x1a')](_0x1f2c0a));if(md5Accounts[_0x419628][_0x011e('0x2')]!==_0x1e64cd){md5Accounts[_0x419628]['md5']=_0x1e64cd;io[_0x011e('0x13')](_0x011e('0x1b'),_0x1f2c0a);}};EmailChannel[_0x011e('0x12')]['refresh']=function(_0x2bee0a){for(var _0x2fd54a in _0x2bee0a){if(_0x2bee0a[_0x011e('0x1c')](_0x2fd54a)){if(_0x2bee0a[_0x2fd54a][_0x011e('0x16')]&&_0x2bee0a[_0x2fd54a][_0x011e('0x15')]){var _0x30631a=_0x2bee0a[_0x2fd54a][_0x011e('0x16')];if(!this[_0x011e('0x10')][_0x011e('0x1c')](_0x30631a['id'])){this['imapAccounts'][_0x30631a['id']]=new EmailImap(_0x30631a,_0x2bee0a[_0x2fd54a]['email']);this[_0x011e('0x10')][_0x30631a['id']]['on'](_0x011e('0x1d'),this[_0x011e('0x1e')][_0x011e('0x1f')](this,_0x2fd54a));this[_0x011e('0x10')][_0x30631a['id']]['on'](_0x011e('0x6'),this[_0x011e('0x20')][_0x011e('0x1f')](this,_0x2fd54a));this[_0x011e('0x10')][_0x30631a['id']]['on']('end',this[_0x011e('0x21')][_0x011e('0x1f')](this,_0x2fd54a));this[_0x011e('0x10')][_0x30631a['id']]['on']('error',this[_0x011e('0x22')][_0x011e('0x1f')](this,_0x2fd54a));}}else{if(_[_0x011e('0x19')](this[_0x011e('0xf')][_0x2fd54a]['Imap'])){this['mailAccounts'][_0x2fd54a][_0x011e('0x16')]={};}this[_0x011e('0xf')][_0x2fd54a][_0x011e('0x16')][_0x011e('0x17')]=_0x011e('0x23');this['mailAccounts'][_0x2fd54a]['Imap'][_0x011e('0x24')]='';this[_0x011e('0x13')](_0x2fd54a);}}}};EmailChannel[_0x011e('0x12')]['handleImapBox']=function(_0x3c6666,_0x19cc16){if(this['mailAccounts'][_0x3c6666]){this[_0x011e('0xf')][_0x3c6666][_0x011e('0x16')][_0x011e('0x17')]='connected';this[_0x011e('0xf')][_0x3c6666]['Imap'][_0x011e('0x24')]=_0x19cc16['name'];if(_0x19cc16[_0x011e('0x25')]){this[_0x011e('0xf')][_0x3c6666][_0x011e('0x16')][_0x011e('0x18')]=_0x19cc16[_0x011e('0x25')]['total'];}return this[_0x011e('0x13')](_0x3c6666);}};EmailChannel[_0x011e('0x12')][_0x011e('0x20')]=function(_0x4e430f,_0x5d9e28){logger[_0x011e('0xe')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x5d9e28[_0x011e('0x26')],_0x5d9e28[_0x011e('0x27')],_0x5d9e28[_0x011e('0x28')],_0x4e430f);if(this['mailAccounts'][_0x4e430f]){return mailAccount['notify'](_0x4e430f,_0x5d9e28)['then'](function(_0x315f1b){if(_0x315f1b){logger[_0x011e('0xe')]('Mail\x20accepted\x20from\x20routing');}})[_0x011e('0x29')](function(_0x20810c){logger[_0x011e('0x2a')](_0x011e('0x2b'),JSON[_0x011e('0x1a')](_0x20810c));});}};EmailChannel[_0x011e('0x12')][_0x011e('0x21')]=function(_0x5e9076){if(this[_0x011e('0xf')][_0x5e9076]&&this[_0x011e('0xf')][_0x5e9076][_0x011e('0x16')]){if(this[_0x011e('0x10')][this[_0x011e('0xf')][_0x5e9076][_0x011e('0x16')]['id']]){delete this[_0x011e('0x10')][this[_0x011e('0xf')][_0x5e9076][_0x011e('0x16')]['id']];}this[_0x011e('0xf')][_0x5e9076][_0x011e('0x16')]['lastSync']=moment();this[_0x011e('0x13')](_0x5e9076);}};EmailChannel[_0x011e('0x12')][_0x011e('0x22')]=function(_0x5a88f1,_0x57d296){if(this[_0x011e('0xf')][_0x5a88f1]){this[_0x011e('0xf')][_0x5a88f1][_0x011e('0x16')]['status']=_0x011e('0x2a');this['mailAccounts'][_0x5a88f1]['Imap'][_0x011e('0x24')]=_0x57d296;return this[_0x011e('0x13')](_0x5a88f1);}};EmailChannel[_0x011e('0x12')][_0x011e('0x2c')]=function(_0x59e99e,_0x2303c3){return this[_0x011e('0x11')][_0x011e('0x2d')](_0x59e99e,_0x2303c3);};EmailChannel[_0x011e('0x12')]['verifySmtp']=function(_0x3ea499){var _0x2c58a7=this;if(this[_0x011e('0xf')][_0x3ea499['id']]){if(_[_0x011e('0x19')](this[_0x011e('0xf')][_0x3ea499['id']][_0x011e('0x2e')])){this[_0x011e('0xf')][_0x3ea499['id']]['Smtp']={};}this[_0x011e('0xf')][_0x3ea499['id']][_0x011e('0x2e')]['lastSync']=moment();return new BPromise(function(_0x52116d,_0x41e998){return _0x2c58a7[_0x011e('0x11')][_0x011e('0x2f')](_0x3ea499)['then'](function(_0xaa63d3){_0x2c58a7[_0x011e('0xf')][_0x3ea499['id']][_0x011e('0x2e')][_0x011e('0x17')]='verified';_0x2c58a7[_0x011e('0xf')][_0x3ea499['id']][_0x011e('0x2e')][_0x011e('0x24')]='';_0x2c58a7[_0x011e('0x13')](_0x3ea499['id']);_0x52116d(_0xaa63d3);})[_0x011e('0x29')](function(_0xf273ad){_0x2c58a7['mailAccounts'][_0x3ea499['id']][_0x011e('0x2e')][_0x011e('0x17')]=_0x011e('0x2a');_0x2c58a7['mailAccounts'][_0x3ea499['id']]['Smtp'][_0x011e('0x24')]=_0xf273ad;_0x2c58a7[_0x011e('0x13')](_0x3ea499['id']);_0x41e998(_0xf273ad);});});}return this['smtp'][_0x011e('0x2f')](_0x3ea499);};module[_0x011e('0x30')]=EmailChannel;
\ No newline at end of file
+var _0xba71=['from','then','Mail\x20accepted\x20from\x20routing','lastSync','sendMail','send','Smtp','verify','verified','catch','exports','lodash','moment','bluebird','md5','ioredis','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','emit','key','active','status','Imap','messageStatus','total','isNil','stringify','mailAccount:update','prototype','refresh','hasOwnProperty','handleImapBox','bind','end','handleImapEnd','error','handleImapError','disabled','connected','messages','handleImapEmail','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName'];(function(_0x443fae,_0x20eec1){var _0x45e27e=function(_0x4185f1){while(--_0x4185f1){_0x443fae['push'](_0x443fae['shift']());}};_0x45e27e(++_0x20eec1);}(_0xba71,0x77));var _0x1ba7=function(_0x1893b3,_0x44decb){_0x1893b3=_0x1893b3-0x0;var _0x42df82=_0xba71[_0x1893b3];return _0x42df82;};'use strict';var _=require(_0x1ba7('0x0'));var moment=require(_0x1ba7('0x1'));var BPromise=require(_0x1ba7('0x2'));var md5=require(_0x1ba7('0x3'));var Redis=require(_0x1ba7('0x4'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x1ba7('0x5'));config[_0x1ba7('0x6')]=_[_0x1ba7('0x7')](config['redis'],{'host':_0x1ba7('0x8'),'port':0x18eb});var io=require(_0x1ba7('0x9'))(new Redis(config[_0x1ba7('0x6')]));var EmailImap=require(_0x1ba7('0xa'));var EmailSmtp=require(_0x1ba7('0xb'));var mailAccount=require(_0x1ba7('0xc'));var md5Accounts={};function EmailChannel(_0x22f153){logger[_0x1ba7('0xd')]('start\x20email\x20channel');this[_0x1ba7('0xe')]=_0x22f153[_0x1ba7('0xe')];this[_0x1ba7('0xf')]={};this[_0x1ba7('0x10')]=new EmailSmtp();}EmailChannel['prototype'][_0x1ba7('0x11')]=function(_0x41598c){var _0x241d06=this[_0x1ba7('0xe')][_0x41598c];var _0x445bb7={'id':_0x241d06['id'],'name':_0x241d06['name'],'key':_0x241d06[_0x1ba7('0x12')],'active':_0x241d06[_0x1ba7('0x13')],'Imap':{'status':_0x241d06['Imap'][_0x1ba7('0x14')],'messageStatus':_0x241d06[_0x1ba7('0x15')][_0x1ba7('0x16')],'total':_0x241d06['Imap'][_0x1ba7('0x17')]}};if(_[_0x1ba7('0x18')](md5Accounts[_0x41598c])){md5Accounts[_0x41598c]={};}var _0x532a84=md5(JSON[_0x1ba7('0x19')](_0x445bb7));if(md5Accounts[_0x41598c]['md5']!==_0x532a84){md5Accounts[_0x41598c][_0x1ba7('0x3')]=_0x532a84;io['emit'](_0x1ba7('0x1a'),_0x445bb7);}};EmailChannel[_0x1ba7('0x1b')][_0x1ba7('0x1c')]=function(_0x3c7de1){for(var _0x10a73d in _0x3c7de1){if(_0x3c7de1[_0x1ba7('0x1d')](_0x10a73d)){if(_0x3c7de1[_0x10a73d][_0x1ba7('0x15')]&&_0x3c7de1[_0x10a73d][_0x1ba7('0x13')]){var _0x5cf05c=_0x3c7de1[_0x10a73d][_0x1ba7('0x15')];if(!this[_0x1ba7('0xf')]['hasOwnProperty'](_0x5cf05c['id'])){this['imapAccounts'][_0x5cf05c['id']]=new EmailImap(_0x5cf05c,_0x3c7de1[_0x10a73d]['email']);this[_0x1ba7('0xf')][_0x5cf05c['id']]['on']('box',this[_0x1ba7('0x1e')][_0x1ba7('0x1f')](this,_0x10a73d));this[_0x1ba7('0xf')][_0x5cf05c['id']]['on'](_0x1ba7('0x5'),this['handleImapEmail'][_0x1ba7('0x1f')](this,_0x10a73d));this[_0x1ba7('0xf')][_0x5cf05c['id']]['on'](_0x1ba7('0x20'),this[_0x1ba7('0x21')]['bind'](this,_0x10a73d));this[_0x1ba7('0xf')][_0x5cf05c['id']]['on'](_0x1ba7('0x22'),this[_0x1ba7('0x23')][_0x1ba7('0x1f')](this,_0x10a73d));}}else{if(_['isNil'](this[_0x1ba7('0xe')][_0x10a73d]['Imap'])){this[_0x1ba7('0xe')][_0x10a73d]['Imap']={};}this['mailAccounts'][_0x10a73d]['Imap']['status']=_0x1ba7('0x24');this[_0x1ba7('0xe')][_0x10a73d][_0x1ba7('0x15')][_0x1ba7('0x16')]='';this[_0x1ba7('0x11')](_0x10a73d);}}}};EmailChannel[_0x1ba7('0x1b')]['handleImapBox']=function(_0x3f2580,_0x7dd654){if(this['mailAccounts'][_0x3f2580]){this[_0x1ba7('0xe')][_0x3f2580]['Imap']['status']=_0x1ba7('0x25');this[_0x1ba7('0xe')][_0x3f2580]['Imap']['messageStatus']=_0x7dd654['name'];if(_0x7dd654['messages']){this['mailAccounts'][_0x3f2580][_0x1ba7('0x15')][_0x1ba7('0x17')]=_0x7dd654[_0x1ba7('0x26')]['total'];}return this[_0x1ba7('0x11')](_0x3f2580);}};EmailChannel[_0x1ba7('0x1b')][_0x1ba7('0x27')]=function(_0x24bcca,_0x384331){logger[_0x1ba7('0xd')](_0x1ba7('0x28'),_0x384331[_0x1ba7('0x29')],_0x384331[_0x1ba7('0x2a')],_0x384331[_0x1ba7('0x2b')],_0x24bcca);if(this[_0x1ba7('0xe')][_0x24bcca]){return mailAccount['notify'](_0x24bcca,_0x384331)[_0x1ba7('0x2c')](function(_0x56dfa0){if(_0x56dfa0){logger[_0x1ba7('0xd')](_0x1ba7('0x2d'));}})['catch'](function(_0x25cc4a){logger[_0x1ba7('0x22')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON['stringify'](_0x25cc4a));});}};EmailChannel[_0x1ba7('0x1b')][_0x1ba7('0x21')]=function(_0x12b14e){if(this['mailAccounts'][_0x12b14e]&&this[_0x1ba7('0xe')][_0x12b14e][_0x1ba7('0x15')]){if(this['imapAccounts'][this[_0x1ba7('0xe')][_0x12b14e][_0x1ba7('0x15')]['id']]){delete this[_0x1ba7('0xf')][this[_0x1ba7('0xe')][_0x12b14e][_0x1ba7('0x15')]['id']];}this[_0x1ba7('0xe')][_0x12b14e][_0x1ba7('0x15')][_0x1ba7('0x2e')]=moment();this['emit'](_0x12b14e);}};EmailChannel['prototype'][_0x1ba7('0x23')]=function(_0x34cc8d,_0x5f406b){if(this['mailAccounts'][_0x34cc8d]){this[_0x1ba7('0xe')][_0x34cc8d][_0x1ba7('0x15')][_0x1ba7('0x14')]=_0x1ba7('0x22');this[_0x1ba7('0xe')][_0x34cc8d][_0x1ba7('0x15')]['messageStatus']=_0x5f406b;return this[_0x1ba7('0x11')](_0x34cc8d);}};EmailChannel[_0x1ba7('0x1b')][_0x1ba7('0x2f')]=function(_0x489363,_0x14fc60){return this[_0x1ba7('0x10')][_0x1ba7('0x30')](_0x489363,_0x14fc60);};EmailChannel[_0x1ba7('0x1b')]['verifySmtp']=function(_0x8662f3){var _0x31eb51=this;if(this[_0x1ba7('0xe')][_0x8662f3['id']]){if(_[_0x1ba7('0x18')](this[_0x1ba7('0xe')][_0x8662f3['id']][_0x1ba7('0x31')])){this[_0x1ba7('0xe')][_0x8662f3['id']]['Smtp']={};}this[_0x1ba7('0xe')][_0x8662f3['id']]['Smtp'][_0x1ba7('0x2e')]=moment();return new BPromise(function(_0x19d34f,_0x3aa6d5){return _0x31eb51[_0x1ba7('0x10')][_0x1ba7('0x32')](_0x8662f3)[_0x1ba7('0x2c')](function(_0xad5bcc){_0x31eb51['mailAccounts'][_0x8662f3['id']][_0x1ba7('0x31')][_0x1ba7('0x14')]=_0x1ba7('0x33');_0x31eb51['mailAccounts'][_0x8662f3['id']][_0x1ba7('0x31')][_0x1ba7('0x16')]='';_0x31eb51[_0x1ba7('0x11')](_0x8662f3['id']);_0x19d34f(_0xad5bcc);})[_0x1ba7('0x34')](function(_0xf8413e){_0x31eb51[_0x1ba7('0xe')][_0x8662f3['id']][_0x1ba7('0x31')]['status']='error';_0x31eb51[_0x1ba7('0xe')][_0x8662f3['id']]['Smtp'][_0x1ba7('0x16')]=_0xf8413e;_0x31eb51['emit'](_0x8662f3['id']);_0x3aa6d5(_0xf8413e);});});}return this[_0x1ba7('0x10')][_0x1ba7('0x32')](_0x8662f3);};module[_0x1ba7('0x35')]=EmailChannel;
\ No newline at end of file
index 6879742..25b88ba 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc8bf=['error','handleError','inherits','prototype','connTimeout','authTimeout','isNil','service','user','password','host','port','tls','autotls','getHost','anonymous@xcally.com','handleReady','openBox','handleOpenBox','emit','box','handleCloseBox','search','handleReadUnseen','length','message','handleFetchError','handleFetchMessage','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','closeBox','textCode','upperFirst','exports','path','util','imap','lodash','randomstring','mailparser','simpleParser','iconv','events','EventEmitter','./utils','../../../config/logger','email','INBOX','getAccount','account','once','ready','bind','end','handleEnd'];(function(_0x6dcfe7,_0x44b8e8){var _0x6d0996=function(_0x79d45d){while(--_0x79d45d){_0x6dcfe7['push'](_0x6dcfe7['shift']());}};_0x6d0996(++_0x44b8e8);}(_0xc8bf,0x181));var _0xfc8b=function(_0x201479,_0x242234){_0x201479=_0x201479-0x0;var _0x17b19e=_0xc8bf[_0x201479];return _0x17b19e;};'use strict';var fs=require('fs');var path=require(_0xfc8b('0x0'));var util=require(_0xfc8b('0x1'));var Imap=require(_0xfc8b('0x2'));var _=require(_0xfc8b('0x3'));var rs=require(_0xfc8b('0x4'));var simpleParser=require(_0xfc8b('0x5'))[_0xfc8b('0x6')];var Iconv=require(_0xfc8b('0x7'))['Iconv'];var EventEmitter=require(_0xfc8b('0x8'))[_0xfc8b('0x9')];var utils=require(_0xfc8b('0xa'));var logger=require(_0xfc8b('0xb'))(_0xfc8b('0xc'));function EmailImap(_0x4a1e34,_0x29dc20){this['mailbox']=_0xfc8b('0xd');this['account']=this[_0xfc8b('0xe')](_0x4a1e34,_0x29dc20);this['imap']=new Imap(this[_0xfc8b('0xf')]);this[_0xfc8b('0x2')][_0xfc8b('0x10')](_0xfc8b('0x11'),this['handleReady'][_0xfc8b('0x12')](this));this['imap'][_0xfc8b('0x10')](_0xfc8b('0x13'),this[_0xfc8b('0x14')][_0xfc8b('0x12')](this));this[_0xfc8b('0x2')]['on'](_0xfc8b('0x15'),this[_0xfc8b('0x16')][_0xfc8b('0x12')](this));this[_0xfc8b('0x2')]['connect']();}util[_0xfc8b('0x17')](EmailImap,EventEmitter);EmailImap[_0xfc8b('0x18')]['getAccount']=function(_0x78eb76,_0x4a06fc){var _0x1b8697={'connTimeout':_0x78eb76[_0xfc8b('0x19')]?_0x78eb76[_0xfc8b('0x19')]*0x3e8:0x2710,'authTimeout':_0x78eb76[_0xfc8b('0x1a')]?_0x78eb76['authTimeout']*0x3e8:0x1388};if(_[_0xfc8b('0x1b')](_0x78eb76[_0xfc8b('0x1c')])){if(_0x78eb76['authentication']){_0x1b8697[_0xfc8b('0x1d')]=_0x78eb76[_0xfc8b('0x1d')];_0x1b8697[_0xfc8b('0x1e')]=_0x78eb76['password'];}_0x1b8697[_0xfc8b('0x1f')]=_0x78eb76[_0xfc8b('0x1f')];_0x1b8697['port']=_0x78eb76[_0xfc8b('0x20')]||0x3e1;if(_0x78eb76[_0xfc8b('0x21')]){_0x1b8697[_0xfc8b('0x21')]=!![];}else{_0x1b8697[_0xfc8b('0x21')]=![];_0x1b8697[_0xfc8b('0x22')]='required';}}else{_0x1b8697['user']=_0x78eb76[_0xfc8b('0x1d')];_0x1b8697[_0xfc8b('0x1e')]=_0x78eb76[_0xfc8b('0x1e')];_0x1b8697[_0xfc8b('0x1f')]=utils[_0xfc8b('0x23')](_0x78eb76[_0xfc8b('0x1c')]);_0x1b8697[_0xfc8b('0x20')]=0x3e1;_0x1b8697[_0xfc8b('0x21')]=!![];}_0x1b8697['email']=_0x4a06fc||_0x78eb76['user']||_0xfc8b('0x24');return _0x1b8697;};EmailImap['prototype'][_0xfc8b('0x25')]=function(){this[_0xfc8b('0x2')][_0xfc8b('0x26')](this['mailbox'],![],this[_0xfc8b('0x27')]['bind'](this));};EmailImap['prototype']['handleOpenBox']=function(_0x59b2bf,_0x5345ed){if(_0x59b2bf){this[_0xfc8b('0x16')](_0x59b2bf,!![]);}else{this[_0xfc8b('0x28')](_0xfc8b('0x29'),_0x5345ed);this['readUnseen']();}};EmailImap[_0xfc8b('0x18')][_0xfc8b('0x2a')]=function(_0x3fd826){if(_0x3fd826){this[_0xfc8b('0x16')](_0x3fd826,!![]);}else{this['imap'][_0xfc8b('0x13')]();}};EmailImap[_0xfc8b('0x18')]['readUnseen']=function(){this[_0xfc8b('0x2')][_0xfc8b('0x2b')](['UNSEEN'],this[_0xfc8b('0x2c')][_0xfc8b('0x12')](this));};EmailImap['prototype']['handleReadUnseen']=function(_0xf0d853,_0x5821e0){if(_0xf0d853){this[_0xfc8b('0x16')](_0xf0d853,!![]);}else{if(_0x5821e0[_0xfc8b('0x2d')]){try{var _0x274f1d=this[_0xfc8b('0x2')]['fetch'](_0x5821e0,{'bodies':'','markSeen':!![]});_0x274f1d['on'](_0xfc8b('0x2e'),this['handleFetchMessage'][_0xfc8b('0x12')](this));_0x274f1d[_0xfc8b('0x10')](_0xfc8b('0x15'),this[_0xfc8b('0x2f')][_0xfc8b('0x12')](this));_0x274f1d[_0xfc8b('0x10')]('end',this['handleFetchEnd'][_0xfc8b('0x12')](this));}catch(_0xc49e28){logger['error'](_0xc49e28);}}else{this[_0xfc8b('0x2')]['closeBox'](!![],this[_0xfc8b('0x2a')]['bind'](this));}}};EmailImap[_0xfc8b('0x18')][_0xfc8b('0x30')]=function(_0x1a2cc1,_0x36f3a4){_0x1a2cc1['on'](_0xfc8b('0x31'),this[_0xfc8b('0x32')][_0xfc8b('0x12')](this));_0x1a2cc1[_0xfc8b('0x10')]('attributes',this[_0xfc8b('0x33')][_0xfc8b('0x12')](this));_0x1a2cc1['once'](_0xfc8b('0x13'),this[_0xfc8b('0x34')][_0xfc8b('0x12')](this));};EmailImap['prototype']['handleMessageBody']=function(_0x39425b,_0x2ca818){simpleParser(_0x39425b,{'Iconv':Iconv},this[_0xfc8b('0x35')]['bind'](this));};EmailImap[_0xfc8b('0x18')][_0xfc8b('0x33')]=function(_0x16b11c){};EmailImap[_0xfc8b('0x18')]['handleMessageEnd']=function(){};EmailImap[_0xfc8b('0x18')][_0xfc8b('0x35')]=function(_0x2d4b3b,_0x1b492b){if(_0x2d4b3b){logger[_0xfc8b('0x15')](_0x2d4b3b);}else{var _0x28d963=this;utils['parser'](this[_0xfc8b('0xf')],_0x1b492b,function(_0x539ab4){_0x28d963[_0xfc8b('0x28')](_0xfc8b('0xc'),_0x539ab4);});}};EmailImap[_0xfc8b('0x18')]['handleFetchEnd']=function(){this[_0xfc8b('0x2')]['closeBox'](!![],this[_0xfc8b('0x2a')][_0xfc8b('0x12')](this));};EmailImap[_0xfc8b('0x18')][_0xfc8b('0x2f')]=function(_0x2eb0d5){this['handleError'](_0x2eb0d5);this['imap'][_0xfc8b('0x36')](!![],this[_0xfc8b('0x2a')][_0xfc8b('0x12')](this));};EmailImap[_0xfc8b('0x18')][_0xfc8b('0x14')]=function(){this[_0xfc8b('0x28')](_0xfc8b('0x13'));};EmailImap['prototype'][_0xfc8b('0x16')]=function(_0x5c9d7d,_0x287b2c){logger[_0xfc8b('0x15')]('handleError',this[_0xfc8b('0xf')][_0xfc8b('0xc')],JSON['stringify'](_0x5c9d7d));var _0x5e6f0e='';if(_0x5c9d7d){if(_0x5c9d7d[_0xfc8b('0x37')]){_0x5e6f0e=_0x5c9d7d[_0xfc8b('0x37')];}else{for(var _0x4ce14b in _0x5c9d7d){if(_0x5c9d7d['hasOwnProperty'](_0x4ce14b)){_0x5e6f0e+=_[_0xfc8b('0x38')](_0x4ce14b)+':\x20'+_0x5c9d7d[_0x4ce14b]+'\x0a';}}}}if(_0x287b2c){this[_0xfc8b('0x2')][_0xfc8b('0x13')]();}else{this[_0xfc8b('0x28')](_0xfc8b('0x15'),_0x5e6f0e);this[_0xfc8b('0x28')](_0xfc8b('0x13'));}};module[_0xfc8b('0x39')]=EmailImap;
\ No newline at end of file
+var _0x574d=['EventEmitter','./utils','email','mailbox','INBOX','account','once','ready','handleReady','bind','end','handleEnd','error','handleError','connect','inherits','prototype','getAccount','connTimeout','authTimeout','isNil','service','user','password','port','tls','autotls','required','getHost','anonymous@xcally.com','openBox','handleOpenBox','box','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','handleCloseBox','body','attributes','handleMessageAttributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','emit','closeBox','stringify','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','lodash','randomstring','mailparser','simpleParser','Iconv','events'];(function(_0x32b4c3,_0x41d9d4){var _0xb0866e=function(_0x576d2b){while(--_0x576d2b){_0x32b4c3['push'](_0x32b4c3['shift']());}};_0xb0866e(++_0x41d9d4);}(_0x574d,0xc0));var _0xd574=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x574d[_0x21549c];return _0x426cbd;};'use strict';var fs=require('fs');var path=require(_0xd574('0x0'));var util=require(_0xd574('0x1'));var Imap=require(_0xd574('0x2'));var _=require(_0xd574('0x3'));var rs=require(_0xd574('0x4'));var simpleParser=require(_0xd574('0x5'))[_0xd574('0x6')];var Iconv=require('iconv')[_0xd574('0x7')];var EventEmitter=require(_0xd574('0x8'))[_0xd574('0x9')];var utils=require(_0xd574('0xa'));var logger=require('../../../config/logger')(_0xd574('0xb'));function EmailImap(_0x13a566,_0x3ce54f){this[_0xd574('0xc')]=_0xd574('0xd');this[_0xd574('0xe')]=this['getAccount'](_0x13a566,_0x3ce54f);this['imap']=new Imap(this[_0xd574('0xe')]);this[_0xd574('0x2')][_0xd574('0xf')](_0xd574('0x10'),this[_0xd574('0x11')][_0xd574('0x12')](this));this[_0xd574('0x2')]['once'](_0xd574('0x13'),this[_0xd574('0x14')][_0xd574('0x12')](this));this[_0xd574('0x2')]['on'](_0xd574('0x15'),this[_0xd574('0x16')][_0xd574('0x12')](this));this[_0xd574('0x2')][_0xd574('0x17')]();}util[_0xd574('0x18')](EmailImap,EventEmitter);EmailImap[_0xd574('0x19')][_0xd574('0x1a')]=function(_0x564b36,_0xb44f5d){var _0x147cdf={'connTimeout':_0x564b36[_0xd574('0x1b')]?_0x564b36[_0xd574('0x1b')]*0x3e8:0x2710,'authTimeout':_0x564b36[_0xd574('0x1c')]?_0x564b36[_0xd574('0x1c')]*0x3e8:0x1388};if(_[_0xd574('0x1d')](_0x564b36[_0xd574('0x1e')])){if(_0x564b36['authentication']){_0x147cdf['user']=_0x564b36[_0xd574('0x1f')];_0x147cdf[_0xd574('0x20')]=_0x564b36[_0xd574('0x20')];}_0x147cdf['host']=_0x564b36['host'];_0x147cdf[_0xd574('0x21')]=_0x564b36[_0xd574('0x21')]||0x3e1;if(_0x564b36[_0xd574('0x22')]){_0x147cdf[_0xd574('0x22')]=!![];}else{_0x147cdf[_0xd574('0x22')]=![];_0x147cdf[_0xd574('0x23')]=_0xd574('0x24');}}else{_0x147cdf[_0xd574('0x1f')]=_0x564b36[_0xd574('0x1f')];_0x147cdf[_0xd574('0x20')]=_0x564b36[_0xd574('0x20')];_0x147cdf['host']=utils[_0xd574('0x25')](_0x564b36[_0xd574('0x1e')]);_0x147cdf['port']=0x3e1;_0x147cdf[_0xd574('0x22')]=!![];}_0x147cdf['email']=_0xb44f5d||_0x564b36[_0xd574('0x1f')]||_0xd574('0x26');return _0x147cdf;};EmailImap[_0xd574('0x19')][_0xd574('0x11')]=function(){this[_0xd574('0x2')][_0xd574('0x27')](this[_0xd574('0xc')],![],this[_0xd574('0x28')][_0xd574('0x12')](this));};EmailImap[_0xd574('0x19')][_0xd574('0x28')]=function(_0x44ddae,_0x3e0501){if(_0x44ddae){this[_0xd574('0x16')](_0x44ddae,!![]);}else{this['emit'](_0xd574('0x29'),_0x3e0501);this['readUnseen']();}};EmailImap[_0xd574('0x19')]['handleCloseBox']=function(_0x49f2e9){if(_0x49f2e9){this[_0xd574('0x16')](_0x49f2e9,!![]);}else{this[_0xd574('0x2')][_0xd574('0x13')]();}};EmailImap['prototype'][_0xd574('0x2a')]=function(){this[_0xd574('0x2')][_0xd574('0x2b')]([_0xd574('0x2c')],this['handleReadUnseen']['bind'](this));};EmailImap[_0xd574('0x19')][_0xd574('0x2d')]=function(_0x203bcb,_0x23a495){if(_0x203bcb){this[_0xd574('0x16')](_0x203bcb,!![]);}else{if(_0x23a495[_0xd574('0x2e')]){try{var _0x5b66eb=this['imap'][_0xd574('0x2f')](_0x23a495,{'bodies':'','markSeen':!![]});_0x5b66eb['on'](_0xd574('0x30'),this[_0xd574('0x31')][_0xd574('0x12')](this));_0x5b66eb[_0xd574('0xf')](_0xd574('0x15'),this[_0xd574('0x32')][_0xd574('0x12')](this));_0x5b66eb['once']('end',this[_0xd574('0x33')][_0xd574('0x12')](this));}catch(_0xd4b730){logger[_0xd574('0x15')](_0xd4b730);}}else{this[_0xd574('0x2')]['closeBox'](!![],this[_0xd574('0x34')][_0xd574('0x12')](this));}}};EmailImap[_0xd574('0x19')][_0xd574('0x31')]=function(_0x911c31,_0x2f1a1e){_0x911c31['on'](_0xd574('0x35'),this['handleMessageBody'][_0xd574('0x12')](this));_0x911c31['once'](_0xd574('0x36'),this[_0xd574('0x37')][_0xd574('0x12')](this));_0x911c31[_0xd574('0xf')](_0xd574('0x13'),this[_0xd574('0x38')][_0xd574('0x12')](this));};EmailImap[_0xd574('0x19')][_0xd574('0x39')]=function(_0x2d06d9,_0x1cfad2){simpleParser(_0x2d06d9,{'Iconv':Iconv},this['handleSimpleParser'][_0xd574('0x12')](this));};EmailImap[_0xd574('0x19')][_0xd574('0x37')]=function(_0x538721){};EmailImap[_0xd574('0x19')][_0xd574('0x38')]=function(){};EmailImap[_0xd574('0x19')][_0xd574('0x3a')]=function(_0x15d429,_0x445068){if(_0x15d429){logger['error'](_0x15d429);}else{var _0x1dbeb9=this;utils[_0xd574('0x3b')](this[_0xd574('0xe')],_0x445068,function(_0x211479){_0x1dbeb9[_0xd574('0x3c')]('email',_0x211479);});}};EmailImap[_0xd574('0x19')][_0xd574('0x33')]=function(){this[_0xd574('0x2')]['closeBox'](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0xd574('0x19')]['handleFetchError']=function(_0x5874e4){this['handleError'](_0x5874e4);this[_0xd574('0x2')][_0xd574('0x3d')](!![],this[_0xd574('0x34')][_0xd574('0x12')](this));};EmailImap['prototype'][_0xd574('0x14')]=function(){this[_0xd574('0x3c')](_0xd574('0x13'));};EmailImap[_0xd574('0x19')]['handleError']=function(_0x1bf7c5,_0x4caf06){logger[_0xd574('0x15')](_0xd574('0x16'),this[_0xd574('0xe')][_0xd574('0xb')],JSON[_0xd574('0x3e')](_0x1bf7c5));var _0x1baedc='';if(_0x1bf7c5){if(_0x1bf7c5[_0xd574('0x3f')]){_0x1baedc=_0x1bf7c5[_0xd574('0x3f')];}else{for(var _0x1857bb in _0x1bf7c5){if(_0x1bf7c5[_0xd574('0x40')](_0x1857bb)){_0x1baedc+=_[_0xd574('0x41')](_0x1857bb)+':\x20'+_0x1bf7c5[_0x1857bb]+'\x0a';}}}}if(_0x4caf06){this[_0xd574('0x2')][_0xd574('0x13')]();}else{this['emit'](_0xd574('0x15'),_0x1baedc);this['emit']('end');}};module[_0xd574('0x42')]=EmailImap;
\ No newline at end of file
index 251f80a..2db4d88 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x88a8=['prototype','send','createTransport','use','compile','toString','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64'];(function(_0x1f8053,_0x111077){var _0x174fd8=function(_0x2f92fc){while(--_0x2f92fc){_0x1f8053['push'](_0x1f8053['shift']());}};_0x174fd8(++_0x111077);}(_0x88a8,0x1ed));var _0x888a=function(_0x5cc862,_0x2f62b6){_0x5cc862=_0x5cc862-0x0;var _0x16c794=_0x88a8[_0x5cc862];return _0x16c794;};'use strict';var nodemailer=require(_0x888a('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0x888a('0x1'));function EmailSmtp(){}EmailSmtp[_0x888a('0x2')][_0x888a('0x3')]=function(_0x54e08d,_0x5939a9){return new BPromise(function(_0x3a7974,_0xe93622){var _0x5748f6=nodemailer[_0x888a('0x4')](_0x54e08d);_0x5748f6[_0x888a('0x5')](_0x888a('0x6'),inlineBase64());_0x5748f6['sendMail'](_0x5939a9,function(_0x137ca5,_0x2aed29){if(_0x137ca5){_0xe93622(_0x137ca5[_0x888a('0x7')]());}else{_0x3a7974(_0x2aed29);}});});};EmailSmtp[_0x888a('0x2')][_0x888a('0x8')]=function(_0x206299){return new BPromise(function(_0x5b4831,_0x303104){var _0x2ca348=nodemailer[_0x888a('0x4')](_0x206299);_0x2ca348['verify'](function(_0x3ead41,_0x3b7333){if(_0x3ead41){_0x303104(_0x3ead41[_0x888a('0x7')]());}else{if(_0x3b7333){_0x5b4831(_0x3b7333);}else{_0x303104(_0x888a('0x9'));}}});});};module[_0x888a('0xa')]=EmailSmtp;
\ No newline at end of file
+var _0x3d4a=['prototype','send','createTransport','sendMail','toString','verify','Not\x20verifired','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64'];(function(_0x4a2259,_0x156a88){var _0x537488=function(_0x5b5e24){while(--_0x5b5e24){_0x4a2259['push'](_0x4a2259['shift']());}};_0x537488(++_0x156a88);}(_0x3d4a,0xef));var _0xa3d4=function(_0x2e309b,_0x3b36c9){_0x2e309b=_0x2e309b-0x0;var _0x52ad92=_0x3d4a[_0x2e309b];return _0x52ad92;};'use strict';var nodemailer=require(_0xa3d4('0x0'));var BPromise=require(_0xa3d4('0x1'));var inlineBase64=require(_0xa3d4('0x2'));function EmailSmtp(){}EmailSmtp[_0xa3d4('0x3')][_0xa3d4('0x4')]=function(_0x27e9eb,_0x25e8f5){return new BPromise(function(_0x31c98e,_0x31fbc9){var _0x34a3c0=nodemailer[_0xa3d4('0x5')](_0x27e9eb);_0x34a3c0['use']('compile',inlineBase64());_0x34a3c0[_0xa3d4('0x6')](_0x25e8f5,function(_0x45ff7e,_0x2abb6f){if(_0x45ff7e){_0x31fbc9(_0x45ff7e[_0xa3d4('0x7')]());}else{_0x31c98e(_0x2abb6f);}});});};EmailSmtp['prototype'][_0xa3d4('0x8')]=function(_0x492b5a){return new BPromise(function(_0x5675f0,_0x1cc09e){var _0x59069d=nodemailer[_0xa3d4('0x5')](_0x492b5a);_0x59069d[_0xa3d4('0x8')](function(_0xbe4a7,_0x4ba223){if(_0xbe4a7){_0x1cc09e(_0xbe4a7[_0xa3d4('0x7')]());}else{if(_0x4ba223){_0x5675f0(_0x4ba223);}else{_0x1cc09e(_0xa3d4('0x9'));}}});});};module[_0xa3d4('0xa')]=EmailSmtp;
\ No newline at end of file
index 54ae6f6..75b3c43 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6d11=['writeFileSync','content','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','parser','from','subject','messageId','inReplyTo','date','format','YYYY-MM-DD\x20HH:mm:ss','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','Attachments','Title','Data','<p>Empty\x20message</p>','getHost','imap.gmail.com','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','util','../../../config/logger','email','head','value','address','anonymous','generate','name','substring','indexOf','split','length','join','Anonymous','pop','@xcally.com','test','html','replace','includes','<img','attachments','forEach','push','filename','_IMG','<span\x20style=font-weight:bold>\x20[Attachment:\x20','\x20]</span>','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message','originTo','isEmpty','originCc','bcc','attach','type','attachment','attachment-','root','server/files/attachments/'];(function(_0x5019cb,_0x2d6481){var _0x17306e=function(_0xb97f1a){while(--_0xb97f1a){_0x5019cb['push'](_0x5019cb['shift']());}};_0x17306e(++_0x2d6481);}(_0x6d11,0xbf));var _0x16d1=function(_0x37958b,_0xa70eb){_0x37958b=_0x37958b-0x0;var _0x155818=_0x6d11[_0x37958b];return _0x155818;};'use strict';var _=require(_0x16d1('0x0'));var moment=require(_0x16d1('0x1'));var random=require(_0x16d1('0x2'));var fs=require('fs');var path=require('path');var util=require(_0x16d1('0x3'));var tnef=require('node-tnef');var logger=require(_0x16d1('0x4'))(_0x16d1('0x5'));var config=require('../../../config/environment');function getAddress(_0x48754e){var _0x3e0e86=_[_0x16d1('0x6')](_0x48754e[_0x16d1('0x7')]);return _0x3e0e86&&_0x3e0e86[_0x16d1('0x8')]?_0x3e0e86[_0x16d1('0x8')]:_0x16d1('0x9')+random[_0x16d1('0xa')](0x6)+'@xcally.com';}function getFirstName(_0x58a7a2){var _0x4fca47=_[_0x16d1('0x6')](_0x58a7a2[_0x16d1('0x7')]);if(_0x4fca47&&_0x4fca47[_0x16d1('0xb')]){if(_0x4fca47[_0x16d1('0xb')]==_0x4fca47['address']){return _0x4fca47[_0x16d1('0xb')][_0x16d1('0xc')](0x0,_0x4fca47[_0x16d1('0xb')][_0x16d1('0xd')]('@'));}var _0x28188f=_0x4fca47[_0x16d1('0xb')][_0x16d1('0xe')](/\s+/);return _0x28188f[_0x16d1('0xf')]>0x1?_0x28188f['slice'](0x0,-0x1)[_0x16d1('0x10')]('\x20'):_0x4fca47[_0x16d1('0xb')];}return _0x16d1('0x11');}function getLastName(_0x32351b){var _0x2efcba=_['head'](_0x32351b[_0x16d1('0x7')]);if(_0x2efcba&&_0x2efcba[_0x16d1('0xb')]){var _0x29dddb=_0x2efcba[_0x16d1('0xb')][_0x16d1('0xe')](/\s+/);return _0x29dddb[_0x16d1('0xf')]>0x1?_0x29dddb[_0x16d1('0x12')]():'';}return'';}function getMails(_0x4ee46c,_0x169e76){var _0x2b399c='';for(var _0x555b2d=0x0;_0x555b2d<_0x169e76['value'][_0x16d1('0xf')];_0x555b2d+=0x1){if(_0x169e76['value'][_0x555b2d][_0x16d1('0x8')]!==_0x4ee46c){if(!_['isEmpty'](_0x2b399c)){_0x2b399c+=',';}_0x2b399c+=_0x169e76[_0x16d1('0x7')][_0x555b2d]['name']||_0x169e76[_0x16d1('0x7')][_0x555b2d][_0x16d1('0x8')]||'';_0x2b399c+='\x20<';_0x2b399c+=_0x169e76['value'][_0x555b2d]['address']?_0x169e76['value'][_0x555b2d]['address']:_0x16d1('0x9')+random['generate'](0x6)+_0x16d1('0x13');_0x2b399c+='>';}}return _0x2b399c;}function parseEmail(_0x7887d5,_0x1f6add,_0x50c1da){if(_0x1f6add['html']){var _0x2c7825=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x2c7825[_0x16d1('0x14')](_0x1f6add[_0x16d1('0x15')])){_0x1f6add['html']=_0x1f6add[_0x16d1('0x15')][_0x16d1('0x16')](_0x2c7825,'');}if(_0x1f6add[_0x16d1('0x15')][_0x16d1('0x17')](_0x16d1('0x18'))){var _0x1448b7=[];_0x1f6add[_0x16d1('0x19')][_0x16d1('0x1a')](_0x3f8436=>{_0x1448b7[_0x16d1('0x1b')](_0x3f8436[_0x16d1('0x1c')]);});var _0x15203b=/<img.*? _SRC(.*?)[^>]+>/g;var _0x9edd96=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x262f89=_0x1f6add[_0x16d1('0x15')][_0x16d1('0x16')](_0x9edd96,'_SRC');var _0x25ae4e=_0x262f89[_0x16d1('0x16')](_0x15203b,_0x16d1('0x1d'));for(let _0x49fc1b=0x0;_0x49fc1b<_0x1448b7[_0x16d1('0xf')];_0x49fc1b++){var _0x1deb1e=_0x25ae4e[_0x16d1('0x16')](_0x16d1('0x1d'),_0x16d1('0x1e')+_0x1448b7[_0x49fc1b]+_0x16d1('0x1f'));_0x25ae4e=_0x1deb1e;}_0x1f6add[_0x16d1('0x15')]=_0x25ae4e;}_0x50c1da['body']=_0x1f6add[_0x16d1('0x15')];}else{_0x50c1da[_0x16d1('0x20')]=_0x1f6add[_0x16d1('0x21')];}if(_0x50c1da[_0x16d1('0x20')]){_0x50c1da['body']=_0x50c1da['body'][_0x16d1('0x16')](/<a\s+/gi,_0x16d1('0x22'));}if(_0x1f6add['to']){_0x50c1da[_0x16d1('0x23')][_0x16d1('0x24')]=getMails(null,_0x1f6add['to']);var _0x22120e=getMails(_0x7887d5[_0x16d1('0x5')],_0x1f6add['to']);if(!_[_0x16d1('0x25')](_0x22120e)){_0x50c1da[_0x16d1('0x23')]['cc']+=_0x22120e;}}if(_0x1f6add['cc']){_0x50c1da[_0x16d1('0x23')][_0x16d1('0x26')]=getMails(null,_0x1f6add['cc']);var _0x366a28=getMails(_0x7887d5[_0x16d1('0x5')],_0x1f6add['cc']);if(!_[_0x16d1('0x25')](_0x366a28)){if(!_[_0x16d1('0x25')](_0x50c1da['message']['cc'])){_0x50c1da[_0x16d1('0x23')]['cc']+=',';}_0x50c1da['message']['cc']+=_0x366a28;}}if(!_[_0x16d1('0x17')](_0x50c1da[_0x16d1('0x23')][_0x16d1('0x24')],_0x7887d5[_0x16d1('0x5')])&&!_[_0x16d1('0x17')](_0x50c1da[_0x16d1('0x23')]['originCc'],_0x7887d5['email'])){_0x50c1da['message'][_0x16d1('0x27')]=_0x7887d5[_0x16d1('0x5')];}if(_0x1f6add[_0x16d1('0x19')]&&_0x1f6add[_0x16d1('0x19')]['length']){_0x50c1da[_0x16d1('0x23')][_0x16d1('0x28')]=_0x1f6add['attachments']['length'];for(var _0x508ed7=0x0,_0x2f49b0,_0xb491bd,_0x186bce;_0x508ed7<_0x1f6add['attachments'][_0x16d1('0xf')];_0x508ed7+=0x1){if(_0x1f6add[_0x16d1('0x19')][_0x508ed7][_0x16d1('0x29')]===_0x16d1('0x2a')){_0x186bce=_0x1f6add[_0x16d1('0x19')][_0x508ed7][_0x16d1('0x1c')]||_0x16d1('0x2b')+_0x508ed7;_0x2f49b0=util['format']('%s-%s',Date['now'](),_0x186bce);_0xb491bd=path[_0x16d1('0x10')](config[_0x16d1('0x2c')],_0x16d1('0x2d'),_0x2f49b0);fs[_0x16d1('0x2e')](_0xb491bd,_0x1f6add[_0x16d1('0x19')][_0x508ed7][_0x16d1('0x2f')]);_0x50c1da[_0x16d1('0x23')][_0x16d1('0x19')]['push']({'name':_0x186bce,'basename':_0x2f49b0,'type':_0x1f6add[_0x16d1('0x19')][_0x508ed7]['contentType'],'filepath':_0xb491bd});}}}if(_0x1f6add['headerLines']&&_0x1f6add[_0x16d1('0x30')][_0x16d1('0xf')]>0x0){var _0x1e54fc=[_0x16d1('0x31'),_0x16d1('0x32'),_0x16d1('0x33')];for(var _0x504145=0x0;_0x504145<_0x1f6add[_0x16d1('0x30')]['length'];_0x504145++){var _0x4833f7=_['indexOf'](_0x1e54fc,_0x1f6add['headerLines'][_0x504145][_0x16d1('0x34')]);if(_0x4833f7>=0x0){_0x50c1da[_0x16d1('0x35')]=!![];}}}return _0x50c1da;}exports[_0x16d1('0x36')]=function(_0x1eb761,_0x53de06,_0x2569d1){var _0x524ab8={'from':getAddress(_0x53de06[_0x16d1('0x37')]),'firstName':getFirstName(_0x53de06[_0x16d1('0x37')]),'lastName':getLastName(_0x53de06[_0x16d1('0x37')]),'mapKey':_0x16d1('0x5'),'message':{'from':getMails(_0x1eb761[_0x16d1('0x5')],_0x53de06[_0x16d1('0x37')]),'to':_0x1eb761[_0x16d1('0x5')],'cc':'','subject':_0x53de06[_0x16d1('0x38')]||'','messageId':_0x53de06[_0x16d1('0x39')],'inReplyTo':_0x53de06[_0x16d1('0x3a')],'sentAt':moment(_0x53de06[_0x16d1('0x3b')])[_0x16d1('0x3c')](_0x16d1('0x3d')),'attach':![],'attachments':[]}};if(!_0x53de06[_0x16d1('0x15')]&&!_0x53de06[_0x16d1('0x21')]){var _0x583747=_['filter'](_0x53de06[_0x16d1('0x19')],{'contentType':_0x16d1('0x3e')});if(_0x583747[_0x16d1('0xf')]){logger[_0x16d1('0x3f')](util[_0x16d1('0x3c')](_0x16d1('0x40'),_0x53de06['messageId']));tnef[_0x16d1('0x41')](_[_0x16d1('0x42')](_0x583747)[_0x16d1('0x2f')],function(_0x4ba7ee,_0x4c0c15){if(_0x4c0c15){_0x53de06[_0x16d1('0x15')]=_0x4c0c15[_0x16d1('0x43')]||'<p>Empty\x20message</p>';if(_0x4c0c15[_0x16d1('0x44')]){for(var _0x583151=0x0;_0x583151<_0x4c0c15[_0x16d1('0x44')][_0x16d1('0xf')];_0x583151++){var _0x4769c7=_0x4c0c15[_0x16d1('0x44')][_0x583151];_0x524ab8['message']['attachments'][_0x16d1('0x1b')]({'filename':_0x4769c7[_0x16d1('0x45')],'content':Buffer['from'](_0x4769c7[_0x16d1('0x46')])});}}}_0x2569d1(parseEmail(_0x1eb761,_0x53de06,_0x524ab8));});}else{_0x53de06[_0x16d1('0x15')]=_0x16d1('0x47');_0x2569d1(parseEmail(_0x1eb761,_0x53de06,_0x524ab8));}}else{_0x2569d1(parseEmail(_0x1eb761,_0x53de06,_0x524ab8));}};exports[_0x16d1('0x48')]=function(_0x3b77db){switch(_0x3b77db){case'gmail':return _0x16d1('0x49');case'yahoo':return _0x16d1('0x4a');case _0x16d1('0x4b'):return'imap-mail.outlook.com';case _0x16d1('0x4c'):return _0x16d1('0x4d');}return _0x16d1('0x4e');};
\ No newline at end of file
+var _0x9e2e=['getHost','imap.gmail.com','yahoo','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','lodash','moment','randomstring','util','email','../../../config/environment','head','value','address','anonymous','@xcally.com','name','indexOf','slice','join','Anonymous','length','isEmpty','generate','html','test','replace','includes','<img','attachments','forEach','push','filename','_SRC','_IMG','body','textAsHtml','<a\x20target=\x22_blank\x22\x20','message','originTo','originCc','bcc','type','attachment','attachment-','format','%s-%s','server/files/attachments/','writeFileSync','content','headerLines','Auto-Submitted:\x20auto-replied','X-Auto-Response-Suppress:\x20All','line','parser','from','subject','messageId','date','application/ms-tnef','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','Attachments','Data','<p>Empty\x20message</p>'];(function(_0x249dcd,_0xeae469){var _0x2b952d=function(_0x5ca7d8){while(--_0x5ca7d8){_0x249dcd['push'](_0x249dcd['shift']());}};_0x2b952d(++_0xeae469);}(_0x9e2e,0xd6));var _0xe9e2=function(_0x3173a5,_0x4d7458){_0x3173a5=_0x3173a5-0x0;var _0x2d4cf4=_0x9e2e[_0x3173a5];return _0x2d4cf4;};'use strict';var _=require(_0xe9e2('0x0'));var moment=require(_0xe9e2('0x1'));var random=require(_0xe9e2('0x2'));var fs=require('fs');var path=require('path');var util=require(_0xe9e2('0x3'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0xe9e2('0x4'));var config=require(_0xe9e2('0x5'));function getAddress(_0x3bfa90){var _0x212d98=_[_0xe9e2('0x6')](_0x3bfa90[_0xe9e2('0x7')]);return _0x212d98&&_0x212d98[_0xe9e2('0x8')]?_0x212d98['address']:_0xe9e2('0x9')+random['generate'](0x6)+_0xe9e2('0xa');}function getFirstName(_0x1ade12){var _0x58a008=_[_0xe9e2('0x6')](_0x1ade12[_0xe9e2('0x7')]);if(_0x58a008&&_0x58a008['name']){if(_0x58a008[_0xe9e2('0xb')]==_0x58a008[_0xe9e2('0x8')]){return _0x58a008['name']['substring'](0x0,_0x58a008[_0xe9e2('0xb')][_0xe9e2('0xc')]('@'));}var _0x2e02c8=_0x58a008[_0xe9e2('0xb')]['split'](/\s+/);return _0x2e02c8['length']>0x1?_0x2e02c8[_0xe9e2('0xd')](0x0,-0x1)[_0xe9e2('0xe')]('\x20'):_0x58a008[_0xe9e2('0xb')];}return _0xe9e2('0xf');}function getLastName(_0x13bfad){var _0x23331d=_[_0xe9e2('0x6')](_0x13bfad[_0xe9e2('0x7')]);if(_0x23331d&&_0x23331d[_0xe9e2('0xb')]){var _0x33a169=_0x23331d['name']['split'](/\s+/);return _0x33a169[_0xe9e2('0x10')]>0x1?_0x33a169['pop']():'';}return'';}function getMails(_0x533e9e,_0x17a5c3){var _0x28aff7='';for(var _0x3550ce=0x0;_0x3550ce<_0x17a5c3[_0xe9e2('0x7')][_0xe9e2('0x10')];_0x3550ce+=0x1){if(_0x17a5c3[_0xe9e2('0x7')][_0x3550ce]['address']!==_0x533e9e){if(!_[_0xe9e2('0x11')](_0x28aff7)){_0x28aff7+=',';}_0x28aff7+=_0x17a5c3[_0xe9e2('0x7')][_0x3550ce][_0xe9e2('0xb')]||_0x17a5c3['value'][_0x3550ce][_0xe9e2('0x8')]||'';_0x28aff7+='\x20<';_0x28aff7+=_0x17a5c3[_0xe9e2('0x7')][_0x3550ce][_0xe9e2('0x8')]?_0x17a5c3['value'][_0x3550ce][_0xe9e2('0x8')]:_0xe9e2('0x9')+random[_0xe9e2('0x12')](0x6)+'@xcally.com';_0x28aff7+='>';}}return _0x28aff7;}function parseEmail(_0x16d953,_0x36c8a3,_0x456455){if(_0x36c8a3[_0xe9e2('0x13')]){var _0x5bb286=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi;while(_0x5bb286[_0xe9e2('0x14')](_0x36c8a3[_0xe9e2('0x13')])){_0x36c8a3[_0xe9e2('0x13')]=_0x36c8a3[_0xe9e2('0x13')][_0xe9e2('0x15')](_0x5bb286,'');}if(_0x36c8a3[_0xe9e2('0x13')][_0xe9e2('0x16')](_0xe9e2('0x17'))){var _0x261d12=[];_0x36c8a3[_0xe9e2('0x18')][_0xe9e2('0x19')](_0x2e8577=>{_0x261d12[_0xe9e2('0x1a')](_0x2e8577[_0xe9e2('0x1b')]);});var _0x313b09=/<img.*? _SRC(.*?)[^>]+>/g;var _0x1bf061=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x2fac3e=_0x36c8a3['html'][_0xe9e2('0x15')](_0x1bf061,_0xe9e2('0x1c'));var _0x32775d=_0x2fac3e[_0xe9e2('0x15')](_0x313b09,'_IMG');for(let _0x325bf4=0x0;_0x325bf4<_0x261d12[_0xe9e2('0x10')];_0x325bf4++){var _0x13d181=_0x32775d[_0xe9e2('0x15')](_0xe9e2('0x1d'),'<span\x20style=font-weight:bold>\x20[Attachment:\x20'+_0x261d12[_0x325bf4]+'\x20]</span>');_0x32775d=_0x13d181;}_0x36c8a3[_0xe9e2('0x13')]=_0x32775d;}_0x456455[_0xe9e2('0x1e')]=_0x36c8a3[_0xe9e2('0x13')];}else{_0x456455[_0xe9e2('0x1e')]=_0x36c8a3[_0xe9e2('0x1f')];}if(_0x456455[_0xe9e2('0x1e')]){_0x456455[_0xe9e2('0x1e')]=_0x456455[_0xe9e2('0x1e')][_0xe9e2('0x15')](/<a\s+/gi,_0xe9e2('0x20'));}if(_0x36c8a3['to']){_0x456455[_0xe9e2('0x21')][_0xe9e2('0x22')]=getMails(null,_0x36c8a3['to']);var _0x43b730=getMails(_0x16d953[_0xe9e2('0x4')],_0x36c8a3['to']);if(!_['isEmpty'](_0x43b730)){_0x456455['message']['cc']+=_0x43b730;}}if(_0x36c8a3['cc']){_0x456455[_0xe9e2('0x21')][_0xe9e2('0x23')]=getMails(null,_0x36c8a3['cc']);var _0x498e12=getMails(_0x16d953[_0xe9e2('0x4')],_0x36c8a3['cc']);if(!_[_0xe9e2('0x11')](_0x498e12)){if(!_[_0xe9e2('0x11')](_0x456455['message']['cc'])){_0x456455[_0xe9e2('0x21')]['cc']+=',';}_0x456455[_0xe9e2('0x21')]['cc']+=_0x498e12;}}if(!_[_0xe9e2('0x16')](_0x456455[_0xe9e2('0x21')]['originTo'],_0x16d953[_0xe9e2('0x4')])&&!_[_0xe9e2('0x16')](_0x456455[_0xe9e2('0x21')]['originCc'],_0x16d953['email'])){_0x456455[_0xe9e2('0x21')][_0xe9e2('0x24')]=_0x16d953[_0xe9e2('0x4')];}if(_0x36c8a3[_0xe9e2('0x18')]&&_0x36c8a3[_0xe9e2('0x18')][_0xe9e2('0x10')]){_0x456455[_0xe9e2('0x21')]['attach']=_0x36c8a3['attachments'][_0xe9e2('0x10')];for(var _0x4b3184=0x0,_0x33ea98,_0x6d029,_0x4e53d2;_0x4b3184<_0x36c8a3[_0xe9e2('0x18')][_0xe9e2('0x10')];_0x4b3184+=0x1){if(_0x36c8a3['attachments'][_0x4b3184][_0xe9e2('0x25')]===_0xe9e2('0x26')){_0x4e53d2=_0x36c8a3['attachments'][_0x4b3184]['filename']||_0xe9e2('0x27')+_0x4b3184;_0x33ea98=util[_0xe9e2('0x28')](_0xe9e2('0x29'),Date['now'](),_0x4e53d2);_0x6d029=path[_0xe9e2('0xe')](config['root'],_0xe9e2('0x2a'),_0x33ea98);fs[_0xe9e2('0x2b')](_0x6d029,_0x36c8a3[_0xe9e2('0x18')][_0x4b3184][_0xe9e2('0x2c')]);_0x456455[_0xe9e2('0x21')][_0xe9e2('0x18')][_0xe9e2('0x1a')]({'name':_0x4e53d2,'basename':_0x33ea98,'type':_0x36c8a3[_0xe9e2('0x18')][_0x4b3184]['contentType'],'filepath':_0x6d029});}}}if(_0x36c8a3['headerLines']&&_0x36c8a3[_0xe9e2('0x2d')][_0xe9e2('0x10')]>0x0){var _0x4b423e=[_0xe9e2('0x2e'),_0xe9e2('0x2f'),'Precedence:\x20auto_reply'];for(var _0x2eb636=0x0;_0x2eb636<_0x36c8a3['headerLines'][_0xe9e2('0x10')];_0x2eb636++){var _0x552ff0=_[_0xe9e2('0xc')](_0x4b423e,_0x36c8a3[_0xe9e2('0x2d')][_0x2eb636][_0xe9e2('0x30')]);if(_0x552ff0>=0x0){_0x456455['isAutoreply']=!![];}}}return _0x456455;}exports[_0xe9e2('0x31')]=function(_0x40d34b,_0x22092e,_0x340f11){var _0xc00528={'from':getAddress(_0x22092e[_0xe9e2('0x32')]),'firstName':getFirstName(_0x22092e['from']),'lastName':getLastName(_0x22092e['from']),'mapKey':_0xe9e2('0x4'),'message':{'from':getMails(_0x40d34b[_0xe9e2('0x4')],_0x22092e[_0xe9e2('0x32')]),'to':_0x40d34b[_0xe9e2('0x4')],'cc':'','subject':_0x22092e[_0xe9e2('0x33')]||'','messageId':_0x22092e[_0xe9e2('0x34')],'inReplyTo':_0x22092e['inReplyTo'],'sentAt':moment(_0x22092e[_0xe9e2('0x35')])['format']('YYYY-MM-DD\x20HH:mm:ss'),'attach':![],'attachments':[]}};if(!_0x22092e[_0xe9e2('0x13')]&&!_0x22092e[_0xe9e2('0x1f')]){var _0x5b2ae0=_['filter'](_0x22092e[_0xe9e2('0x18')],{'contentType':_0xe9e2('0x36')});if(_0x5b2ae0['length']){logger['info'](util[_0xe9e2('0x28')](_0xe9e2('0x37'),_0x22092e[_0xe9e2('0x34')]));tnef[_0xe9e2('0x38')](_[_0xe9e2('0x39')](_0x5b2ae0)['content'],function(_0xffdf05,_0x333a2c){if(_0x333a2c){_0x22092e[_0xe9e2('0x13')]=_0x333a2c[_0xe9e2('0x3a')]||'<p>Empty\x20message</p>';if(_0x333a2c[_0xe9e2('0x3b')]){for(var _0x176c73=0x0;_0x176c73<_0x333a2c['Attachments']['length'];_0x176c73++){var _0x33505e=_0x333a2c[_0xe9e2('0x3b')][_0x176c73];_0xc00528[_0xe9e2('0x21')][_0xe9e2('0x18')][_0xe9e2('0x1a')]({'filename':_0x33505e['Title'],'content':Buffer[_0xe9e2('0x32')](_0x33505e[_0xe9e2('0x3c')])});}}}_0x340f11(parseEmail(_0x40d34b,_0x22092e,_0xc00528));});}else{_0x22092e[_0xe9e2('0x13')]=_0xe9e2('0x3d');_0x340f11(parseEmail(_0x40d34b,_0x22092e,_0xc00528));}}else{_0x340f11(parseEmail(_0x40d34b,_0x22092e,_0xc00528));}};exports[_0xe9e2('0x3e')]=function(_0x568625){switch(_0x568625){case'gmail':return _0xe9e2('0x3f');case _0xe9e2('0x40'):return _0xe9e2('0x41');case'hotmail':return _0xe9e2('0x42');case _0xe9e2('0x43'):return _0xe9e2('0x44');}return'127.0.0.1';};
\ No newline at end of file
index a57d415..418b806 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb613=['SERV','active','Imap','Smtp','lodash','name','Service','key'];(function(_0x22a46e,_0x3950c2){var _0x1c7be3=function(_0x1bdf4c){while(--_0x1bdf4c){_0x22a46e['push'](_0x22a46e['shift']());}};_0x1c7be3(++_0x3950c2);}(_0xb613,0x1cc));var _0x3b61=function(_0x412e27,_0x20a978){_0x412e27=_0x412e27-0x0;var _0x53da42=_0xb613[_0x412e27];return _0x53da42;};'use strict';var _=require(_0x3b61('0x0'));function MailAccount(_0x48c99e){this['id']=_0x48c99e['id']||0x0;this[_0x3b61('0x1')]=_0x48c99e[_0x3b61('0x1')]||_0x3b61('0x2');this['key']=_0x48c99e[_0x3b61('0x3')]||_0x3b61('0x4');this[_0x3b61('0x5')]=_0x48c99e[_0x3b61('0x5')]||![];this[_0x3b61('0x6')]=_0x48c99e[_0x3b61('0x6')]||[];this[_0x3b61('0x7')]=_0x48c99e['Smtp']||[];}module['exports']=MailAccount;
\ No newline at end of file
+var _0x5559=['exports','lodash','name','Service','key','SERV','active','Imap','Smtp'];(function(_0x4c2d60,_0x92e137){var _0x29664f=function(_0x3f6fe3){while(--_0x3f6fe3){_0x4c2d60['push'](_0x4c2d60['shift']());}};_0x29664f(++_0x92e137);}(_0x5559,0x133));var _0x9555=function(_0x360b5b,_0x44188d){_0x360b5b=_0x360b5b-0x0;var _0x1b273f=_0x5559[_0x360b5b];return _0x1b273f;};'use strict';var _=require(_0x9555('0x0'));function MailAccount(_0x4ba9c1){this['id']=_0x4ba9c1['id']||0x0;this[_0x9555('0x1')]=_0x4ba9c1['name']||_0x9555('0x2');this['key']=_0x4ba9c1[_0x9555('0x3')]||_0x9555('0x4');this[_0x9555('0x5')]=_0x4ba9c1[_0x9555('0x5')]||![];this[_0x9555('0x6')]=_0x4ba9c1[_0x9555('0x6')]||[];this[_0x9555('0x7')]=_0x4ba9c1[_0x9555('0x7')]||[];}module[_0x9555('0x8')]=MailAccount;
\ No newline at end of file
index 60eac73..e1af28f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x96af=['prototype','mergeFromDatabase','exports','lodash','mailAccounts','mapKeys','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x96af,0x1ca));var _0xf96a=function(_0x406696,_0x39f9b1){_0x406696=_0x406696-0x0;var _0x10e35c=_0x96af[_0x406696];return _0x10e35c;};'use strict';var _=require(_0xf96a('0x0'));var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0xf96a('0x1')]={};};function freeIsNotKey(_0xe2ae43,_0x588969,_0x56201){var _0x1fa968=_[_0xf96a('0x2')](_0xe2ae43,function(_0x2c48b8,_0xcfaa41){return _0x2c48b8[_0x56201];});for(var _0x29f1aa in _0x588969){if(_0x588969[_0xf96a('0x3')](_0x29f1aa)){if(!_0x1fa968[_0x29f1aa]){delete _0x588969[_0x29f1aa];}}}}Realtime[_0xf96a('0x4')][_0xf96a('0x5')]=function(_0x230c8c,_0x171391){for(var _0x40217c in _0x171391){if(_0x230c8c['hasOwnProperty'](_0x40217c)){_0x230c8c[_0x40217c]=_0x171391[_0x40217c];}}};Realtime[_0xf96a('0x4')]['initMailAccounts']=function(){var _0x3d6418=this;return function(_0xd5fbb1){if(_0xd5fbb1){freeIsNotKey(_0xd5fbb1,_0x3d6418['mailAccounts'],'id');for(var _0x5d21eb=0x0,_0x51b11a={},_0x5ddca5={};_0x5d21eb<_0xd5fbb1['length'];_0x5d21eb+=0x1){_0x51b11a=_0xd5fbb1[_0x5d21eb];if(_['isUndefined'](_0x3d6418[_0xf96a('0x1')][_0x51b11a['id']])){_0x3d6418[_0xf96a('0x1')][_0x51b11a['id']]=new MailAccount(_0x51b11a);}else{_['merge'](_0x3d6418[_0xf96a('0x1')][_0x51b11a['id']],_0x51b11a);}}}return _0x3d6418[_0xf96a('0x1')];};};module[_0xf96a('0x6')]=Realtime;
\ No newline at end of file
+var _0xa26e=['mailAccounts','mapKeys','hasOwnProperty','prototype','length','isUndefined','merge','lodash','../model/mailAccount'];(function(_0x2d4663,_0x52c0b0){var _0x1736de=function(_0xad68bb){while(--_0xad68bb){_0x2d4663['push'](_0x2d4663['shift']());}};_0x1736de(++_0x52c0b0);}(_0xa26e,0x73));var _0xea26=function(_0x3cdac5,_0x48fdfb){_0x3cdac5=_0x3cdac5-0x0;var _0x359b5a=_0xa26e[_0x3cdac5];return _0x359b5a;};'use strict';var _=require(_0xea26('0x0'));var MailAccount=require(_0xea26('0x1'));var Realtime=function(){this[_0xea26('0x2')]={};};function freeIsNotKey(_0x5b08ec,_0x448685,_0x365446){var _0x26b271=_[_0xea26('0x3')](_0x5b08ec,function(_0x20a07c,_0x2fae7d){return _0x20a07c[_0x365446];});for(var _0x251b5c in _0x448685){if(_0x448685[_0xea26('0x4')](_0x251b5c)){if(!_0x26b271[_0x251b5c]){delete _0x448685[_0x251b5c];}}}}Realtime[_0xea26('0x5')]['mergeFromDatabase']=function(_0x5ccf67,_0x58450d){for(var _0x1b4c20 in _0x58450d){if(_0x5ccf67[_0xea26('0x4')](_0x1b4c20)){_0x5ccf67[_0x1b4c20]=_0x58450d[_0x1b4c20];}}};Realtime[_0xea26('0x5')]['initMailAccounts']=function(){var _0x20cbce=this;return function(_0x18640f){if(_0x18640f){freeIsNotKey(_0x18640f,_0x20cbce[_0xea26('0x2')],'id');for(var _0x51a524=0x0,_0x520fde={},_0xc219b4={};_0x51a524<_0x18640f[_0xea26('0x6')];_0x51a524+=0x1){_0x520fde=_0x18640f[_0x51a524];if(_[_0xea26('0x7')](_0x20cbce[_0xea26('0x2')][_0x520fde['id']])){_0x20cbce[_0xea26('0x2')][_0x520fde['id']]=new MailAccount(_0x520fde);}else{_[_0xea26('0x8')](_0x20cbce[_0xea26('0x2')][_0x520fde['id']],_0x520fde);}}}return _0x20cbce['mailAccounts'];};};module['exports']=Realtime;
\ No newline at end of file
index fe75119..154140a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xce68=['email','key','ListId','TemplateId','Imap','MailServerOut','notify','NotifyMailAccount','../client','Request','GetMailAccount','name','service'];(function(_0xcc18a5,_0x4dbb0a){var _0x314c9b=function(_0x4b9582){while(--_0x4b9582){_0xcc18a5['push'](_0xcc18a5['shift']());}};_0x314c9b(++_0x4dbb0a);}(_0xce68,0x10c));var _0x8ce6=function(_0x4dfcab,_0x283d3d){_0x4dfcab=_0x4dfcab-0x0;var _0x438396=_0xce68[_0x4dfcab];return _0x438396;};'use strict';var client=require(_0x8ce6('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0x8ce6('0x1')](_0x8ce6('0x2'),{'options':{'attributes':['id',_0x8ce6('0x3'),_0x8ce6('0x4'),_0x8ce6('0x5'),'active',_0x8ce6('0x6'),_0x8ce6('0x7'),_0x8ce6('0x8')],'raw':![],'include':[{'model':'MailServerIn','as':_0x8ce6('0x9')},{'model':_0x8ce6('0xa'),'as':'Smtp'}]},'log':'getMailAccount'});};};exports[_0x8ce6('0xb')]=function(_0x357fbb,_0x17811e){return client[_0x8ce6('0x1')]('NotifyMailAccount',{'account':{'id':_0x357fbb},'body':_0x17811e,'log':_0x8ce6('0xc')});};
\ No newline at end of file
+var _0xb235=['active','key','ListId','MailServerIn','Imap','MailServerOut','getMailAccount','Request','NotifyMailAccount','GetMailAccount','name','service','email'];(function(_0x187dbd,_0x2ecf58){var _0x45d1e9=function(_0x2364c0){while(--_0x2364c0){_0x187dbd['push'](_0x187dbd['shift']());}};_0x45d1e9(++_0x2ecf58);}(_0xb235,0x10d));var _0x5b23=function(_0x348021,_0x24fc80){_0x348021=_0x348021-0x0;var _0x426682=_0xb235[_0x348021];return _0x426682;};'use strict';var client=require('../client');exports['getMailAccounts']=function(){return function(){return client['Request'](_0x5b23('0x0'),{'options':{'attributes':['id',_0x5b23('0x1'),_0x5b23('0x2'),_0x5b23('0x3'),_0x5b23('0x4'),_0x5b23('0x5'),_0x5b23('0x6'),'TemplateId'],'raw':![],'include':[{'model':_0x5b23('0x7'),'as':_0x5b23('0x8')},{'model':_0x5b23('0x9'),'as':'Smtp'}]},'log':_0x5b23('0xa')});};};exports['notify']=function(_0x5bea9e,_0x12d845){return client[_0x5b23('0xb')]('NotifyMailAccount',{'account':{'id':_0x5bea9e},'body':_0x12d845,'log':_0x5b23('0xc')});};
\ No newline at end of file
index 7086216..077e054 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0b8c=['GetSettings','../client','getSettings','ShowSetting'];(function(_0xd0bc07,_0xf98168){var _0x512631=function(_0xc1ffdf){while(--_0xc1ffdf){_0xd0bc07['push'](_0xd0bc07['shift']());}};_0x512631(++_0xf98168);}(_0x0b8c,0xe5));var _0xc0b8=function(_0x58d5d9,_0x5d104e){_0x58d5d9=_0x58d5d9-0x0;var _0x23d483=_0x0b8c[_0x58d5d9];return _0x23d483;};'use strict';var client=require(_0xc0b8('0x0'));exports[_0xc0b8('0x1')]=function(){return client['Request'](_0xc0b8('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':_0xc0b8('0x3')});};
\ No newline at end of file
+var _0xa231=['ShowSetting','loginMailFrequency','GetSettings','../client','Request'];(function(_0x31b90f,_0x35ef73){var _0x15653b=function(_0x3b992f){while(--_0x3b992f){_0x31b90f['push'](_0x31b90f['shift']());}};_0x15653b(++_0x35ef73);}(_0xa231,0x1b1));var _0x1a23=function(_0x1a55c5,_0x4949a8){_0x1a55c5=_0x1a55c5-0x0;var _0x5eeeb2=_0xa231[_0x1a55c5];return _0x5eeeb2;};'use strict';var client=require(_0x1a23('0x0'));exports['getSettings']=function(){return client[_0x1a23('0x1')](_0x1a23('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x1a23('0x3')]},'log':_0x1a23('0x4')});};
\ No newline at end of file
index 617fa41..918a9ee 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(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'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 a51502e..f7c76f7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6269=['websocket','redis','localhost','socket.io-redis','default','../../config/socketio','../../config/express','once','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','express','sticky-session','createServer','socket.io'];(function(_0x40f280,_0x53f1a4){var _0x11ad62=function(_0x15cc38){while(--_0x15cc38){_0x40f280['push'](_0x40f280['shift']());}};_0x11ad62(++_0x53f1a4);}(_0x6269,0x10b));var _0x9626=function(_0x21b861,_0x420c1d){_0x21b861=_0x21b861-0x0;var _0x38f7a7=_0x6269[_0x21b861];return _0x38f7a7;};'use strict';var _=require(_0x9626('0x0'));var http=require('http');var express=require(_0x9626('0x1'));var sticky=require(_0x9626('0x2'));var Redis=require('ioredis');var config=require('../../config/environment');var app=express();var server=http[_0x9626('0x3')](app);server['timeout']=0xdbba0;if(sticky['listen'](server,config['port'])){var socketio=require(_0x9626('0x4'))(server,{'transports':[_0x9626('0x5'),'polling']});config['redis']=_['defaults'](config[_0x9626('0x6')],{'host':_0x9626('0x7'),'port':0x18eb});socketio['adapter'](require(_0x9626('0x8'))({'pubClient':new Redis(config[_0x9626('0x6')]),'subClient':new Redis(config['redis'])}));require('../../config/triggers')[_0x9626('0x9')]();require(_0x9626('0xa'))[_0x9626('0x9')](socketio);require(_0x9626('0xb'))['default'](app);require('../../routes')[_0x9626('0x9')](app);}else{server[_0x9626('0xc')]('listening',function(){console[_0x9626('0xd')](_0x9626('0xe'),config[_0x9626('0xf')]);});}exports=module[_0x9626('0x10')]=app;
\ No newline at end of file
+var _0x6d8e=['Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','express','ioredis','createServer','timeout','listen','port','socket.io','websocket','redis','defaults','adapter','socket.io-redis','../../config/triggers','../../config/socketio','../../config/express','default','../../routes','once','listening','log'];(function(_0x33aa12,_0x124178){var _0xed2764=function(_0x29d98a){while(--_0x29d98a){_0x33aa12['push'](_0x33aa12['shift']());}};_0xed2764(++_0x124178);}(_0x6d8e,0xe8));var _0xe6d8=function(_0x3fd712,_0x1c8adc){_0x3fd712=_0x3fd712-0x0;var _0x53a884=_0x6d8e[_0x3fd712];return _0x53a884;};'use strict';var _=require(_0xe6d8('0x0'));var http=require('http');var express=require(_0xe6d8('0x1'));var sticky=require('sticky-session');var Redis=require(_0xe6d8('0x2'));var config=require('../../config/environment');var app=express();var server=http[_0xe6d8('0x3')](app);server[_0xe6d8('0x4')]=0xdbba0;if(sticky[_0xe6d8('0x5')](server,config[_0xe6d8('0x6')])){var socketio=require(_0xe6d8('0x7'))(server,{'transports':[_0xe6d8('0x8'),'polling']});config[_0xe6d8('0x9')]=_[_0xe6d8('0xa')](config[_0xe6d8('0x9')],{'host':'localhost','port':0x18eb});socketio[_0xe6d8('0xb')](require(_0xe6d8('0xc'))({'pubClient':new Redis(config[_0xe6d8('0x9')]),'subClient':new Redis(config[_0xe6d8('0x9')])}));require(_0xe6d8('0xd'))['default']();require(_0xe6d8('0xe'))['default'](socketio);require(_0xe6d8('0xf'))[_0xe6d8('0x10')](app);require(_0xe6d8('0x11'))[_0xe6d8('0x10')](app);}else{server[_0xe6d8('0x12')](_0xe6d8('0x13'),function(){console[_0xe6d8('0x14')](_0xe6d8('0x15'),config[_0xe6d8('0x6')]);});}exports=module[_0xe6d8('0x16')]=app;
\ No newline at end of file
index 3a47ba6..3cf671f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x235a=['rpc','error','message','catch','exports','jayson/promise','../../config/logger','routing','client','http','request','then'];(function(_0x31bab3,_0x44554f){var _0x4fd382=function(_0x42b336){while(--_0x42b336){_0x31bab3['push'](_0x31bab3['shift']());}};_0x4fd382(++_0x44554f);}(_0x235a,0x155));var _0xa235=function(_0x465efd,_0x3579f6){_0x465efd=_0x465efd-0x0;var _0x53bf39=_0x235a[_0x465efd];return _0x53bf39;};'use strict';var jayson=require(_0xa235('0x0'));var BPromise=require('bluebird');var logger=require(_0xa235('0x1'))(_0xa235('0x2'));var client=jayson[_0xa235('0x3')][_0xa235('0x4')]({'port':0x2329});client['Request']=function(_0x5efac9,_0xcc1027){return new BPromise(function(_0x2a941a,_0x34b749){return client[_0xa235('0x5')](_0x5efac9,_0xcc1027)[_0xa235('0x6')](function(_0x480dca){logger['debug'](_0xa235('0x7'),_0xa235('0x2'),_0x5efac9,_0xcc1027,_0x480dca);if(_0x480dca[_0xa235('0x8')]){logger[_0xa235('0x8')](_0xa235('0x7'),_0xa235('0x2'),_0x5efac9,_0x480dca[_0xa235('0x8')][_0xa235('0x9')],_0xcc1027);return _0x34b749(_0x480dca['error'][_0xa235('0x9')]);}else{return _0x2a941a(_0x480dca['result']);}})[_0xa235('0xa')](function(_0x20f558){logger[_0xa235('0x8')](_0xa235('0x7'),_0xa235('0x2'),_0x5efac9,_0x20f558,_0xcc1027);return _0x34b749(_0x20f558);});});};module[_0xa235('0xb')]=client;
\ No newline at end of file
+var _0x78aa=['../../config/logger','client','http','Request','request','then','debug','rpc','error','routing','message','bluebird'];(function(_0x507ac5,_0x33aaee){var _0x12c1bc=function(_0x5c953c){while(--_0x5c953c){_0x507ac5['push'](_0x507ac5['shift']());}};_0x12c1bc(++_0x33aaee);}(_0x78aa,0x77));var _0xa78a=function(_0x1509aa,_0x37491a){_0x1509aa=_0x1509aa-0x0;var _0x233fc5=_0x78aa[_0x1509aa];return _0x233fc5;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xa78a('0x0'));var logger=require(_0xa78a('0x1'))('routing');var client=jayson[_0xa78a('0x2')][_0xa78a('0x3')]({'port':0x2329});client[_0xa78a('0x4')]=function(_0x2034cc,_0x2c7ab4){return new BPromise(function(_0x4b7d07,_0x1cf725){return client[_0xa78a('0x5')](_0x2034cc,_0x2c7ab4)[_0xa78a('0x6')](function(_0x49d254){logger[_0xa78a('0x7')](_0xa78a('0x8'),'routing',_0x2034cc,_0x2c7ab4,_0x49d254);if(_0x49d254[_0xa78a('0x9')]){logger[_0xa78a('0x9')](_0xa78a('0x8'),_0xa78a('0xa'),_0x2034cc,_0x49d254[_0xa78a('0x9')]['message'],_0x2c7ab4);return _0x1cf725(_0x49d254[_0xa78a('0x9')][_0xa78a('0xb')]);}else{return _0x4b7d07(_0x49d254['result']);}})['catch'](function(_0x580a1a){logger[_0xa78a('0x9')](_0xa78a('0x8'),_0xa78a('0xa'),_0x2034cc,_0x580a1a,_0x2c7ab4);return _0x1cf725(_0x580a1a);});});};module['exports']=client;
\ No newline at end of file
index fb5a678..f5f7f03 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3c44=['initWhatsappQueues','listen','catch','log','bluebird','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','then','initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','getWhatsappQueues'];(function(_0x1e240e,_0x199b7f){var _0x40225a=function(_0x1bbd25){while(--_0x1bbd25){_0x1e240e['push'](_0x1e240e['shift']());}};_0x40225a(++_0x199b7f);}(_0x3c44,0x122));var _0x43c4=function(_0x311e45,_0x20e2dd){_0x311e45=_0x311e45-0x0;var _0x46c9d9=_0x3c44[_0x311e45];return _0x46c9d9;};'use strict';var BPromise=require(_0x43c4('0x0'));var server=require('./server');var Realtime=require(_0x43c4('0x1'));var user=require(_0x43c4('0x2'));var interval=require(_0x43c4('0x3'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x43c4('0x4'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x43c4('0x5'));var faxQueue=require(_0x43c4('0x6'));var whatsappQueue=require(_0x43c4('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x43c4('0x8')]()['then'](user[_0x43c4('0x9')]())[_0x43c4('0xa')](realtime[_0x43c4('0xb')]())[_0x43c4('0xa')](interval[_0x43c4('0xc')]())[_0x43c4('0xa')](realtime['initIntervals']())[_0x43c4('0xa')](openchannelQueue[_0x43c4('0xd')]())[_0x43c4('0xa')](realtime[_0x43c4('0xe')]())[_0x43c4('0xa')](chatQueue['getChatQueues']())[_0x43c4('0xa')](realtime[_0x43c4('0xf')]())[_0x43c4('0xa')](smsQueue[_0x43c4('0x10')]())['then'](realtime[_0x43c4('0x11')]())[_0x43c4('0xa')](mailQueue[_0x43c4('0x12')]())[_0x43c4('0xa')](realtime[_0x43c4('0x13')]())[_0x43c4('0xa')](faxQueue[_0x43c4('0x14')]())[_0x43c4('0xa')](realtime['initFaxQueues']())[_0x43c4('0xa')](whatsappQueue[_0x43c4('0x15')]())[_0x43c4('0xa')](realtime[_0x43c4('0x16')]())['then'](function(){return realtime;});}function main(){return server[_0x43c4('0x17')](realtime)[_0x43c4('0xa')](function(_0x3e0d6c){return initRealtime();})[_0x43c4('0xa')](function(_0x5569ad){return setInterval(initRealtime,0x1388);})[_0x43c4('0x18')](function(_0x1e4ea8){console[_0x43c4('0x19')](_0x1e4ea8);});}main();
\ No newline at end of file
+var _0xcb41=['getIntervals','initIntervals','getOpenchannelQueues','getChatQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','bluebird','./server','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then','getAgents','initAgents'];(function(_0x2c84e8,_0x2d67ac){var _0x20d730=function(_0x133586){while(--_0x133586){_0x2c84e8['push'](_0x2c84e8['shift']());}};_0x20d730(++_0x2d67ac);}(_0xcb41,0xdc));var _0x1cb4=function(_0x24a8f8,_0x1c3423){_0x24a8f8=_0x24a8f8-0x0;var _0x2c0878=_0xcb41[_0x24a8f8];return _0x2c0878;};'use strict';var BPromise=require(_0x1cb4('0x0'));var server=require(_0x1cb4('0x1'));var Realtime=require('./realtime');var user=require(_0x1cb4('0x2'));var interval=require(_0x1cb4('0x3'));var openchannelQueue=require(_0x1cb4('0x4'));var chatQueue=require(_0x1cb4('0x5'));var smsQueue=require(_0x1cb4('0x6'));var mailQueue=require(_0x1cb4('0x7'));var faxQueue=require(_0x1cb4('0x8'));var whatsappQueue=require(_0x1cb4('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x1cb4('0xa')]()[_0x1cb4('0xb')](user[_0x1cb4('0xc')]())[_0x1cb4('0xb')](realtime[_0x1cb4('0xd')]())[_0x1cb4('0xb')](interval[_0x1cb4('0xe')]())['then'](realtime[_0x1cb4('0xf')]())[_0x1cb4('0xb')](openchannelQueue[_0x1cb4('0x10')]())['then'](realtime['initOpenchannelQueues']())[_0x1cb4('0xb')](chatQueue[_0x1cb4('0x11')]())[_0x1cb4('0xb')](realtime['initChatQueues']())['then'](smsQueue['getSmsQueues']())[_0x1cb4('0xb')](realtime[_0x1cb4('0x12')]())[_0x1cb4('0xb')](mailQueue[_0x1cb4('0x13')]())['then'](realtime[_0x1cb4('0x14')]())[_0x1cb4('0xb')](faxQueue[_0x1cb4('0x15')]())['then'](realtime[_0x1cb4('0x16')]())[_0x1cb4('0xb')](whatsappQueue[_0x1cb4('0x17')]())['then'](realtime['initWhatsappQueues']())[_0x1cb4('0xb')](function(){return realtime;});}function main(){return server[_0x1cb4('0x18')](realtime)[_0x1cb4('0xb')](function(_0x202210){return initRealtime();})['then'](function(_0x524abf){return setInterval(initRealtime,0x1388);})[_0x1cb4('0x19')](function(_0x24709a){console['log'](_0x24709a);});}main();
\ No newline at end of file
index f7cde76..29c7d4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5fc3=['lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','activeRules','prototype','register','isArray','rules','isObject','sync','orderBy','asc','execute','clone','ruleRef','name','index_','push','call','nextTick','next','isEqual','restart','length','condition','matchPath','noop','findRules','filter','prioritize','priority','toJSON','map','consequence','toString','fromJSON','isString','parse'];(function(_0x343308,_0x500535){var _0x1504f1=function(_0x24e0b6){while(--_0x24e0b6){_0x343308['push'](_0x343308['shift']());}};_0x1504f1(++_0x500535);}(_0x5fc3,0xa8));var _0x35fc=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x5fc3[_0xdea41a];return _0x15d0d8;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var EventEmitter=require('events')[_0x35fc('0x2')];function RuleEngine(_0x2ac6da,_0x196bc2){this[_0x35fc('0x3')]();if(!_[_0x35fc('0x4')](_0x2ac6da)){this['register'](_0x2ac6da);}if(_0x196bc2){this[_0x35fc('0x5')]=_0x196bc2[_0x35fc('0x5')];}return this;}util[_0x35fc('0x6')](RuleEngine,EventEmitter);RuleEngine['prototype']['init']=function(_0x19a0d1){this['rules']=[];this[_0x35fc('0x7')]=[];};RuleEngine[_0x35fc('0x8')][_0x35fc('0x9')]=function(_0x1e5f90){if(Array[_0x35fc('0xa')](_0x1e5f90)){this[_0x35fc('0xb')]=this[_0x35fc('0xb')]['concat'](_0x1e5f90);}else if(_0x1e5f90!==null&&_[_0x35fc('0xc')](_0x1e5f90)){this[_0x35fc('0xb')]['push'](_0x1e5f90);}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')]['sync']=function(){this[_0x35fc('0x7')]=this[_0x35fc('0xb')]['filter'](function(_0x4cbe74){if(_[_0x35fc('0x4')](_0x4cbe74['on'])){_0x4cbe74['on']=!![];}if(_0x4cbe74['on']===!![]){return _0x4cbe74;}});this['activeRules']=_[_0x35fc('0xe')](this[_0x35fc('0x7')],['p'],[_0x35fc('0xf')]);};RuleEngine[_0x35fc('0x8')][_0x35fc('0x10')]=function(_0x5cfe94,_0x59507a){var _0x5eac0f=![];_0x5cfe94['result']=!![];var _0x398b67=_[_0x35fc('0x11')](_0x5cfe94);var _0x53b898=_[_0x35fc('0x11')](_0x5cfe94);var _0x227a49=this[_0x35fc('0x7')];var _0x480851=[];var _0x26ba54=this[_0x35fc('0x5')];(function FnRuleLoop(_0x553677){var _0x41e165={'rules':function(){return _0x227a49;},'rule':function(){return _0x227a49[_0x553677];},'when':function(_0x363e47){if(_0x363e47){var _0x2e513b=_0x227a49[_0x553677]['consequence'];_0x2e513b[_0x35fc('0x12')]=_0x227a49[_0x553677]['id']||_0x227a49[_0x553677][_0x35fc('0x13')]||_0x35fc('0x14')+_0x553677;process['nextTick'](function(){_0x480851[_0x35fc('0x15')](_0x2e513b[_0x35fc('0x12')]);_0x2e513b[_0x35fc('0x16')](_0x398b67,_0x41e165);});}else{process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x18')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x5eac0f=!![];return FnRuleLoop(0x0);},'next':function(_0x21f1a9){if(!_0x26ba54&&!_[_0x35fc('0x19')](_0x53b898,_0x398b67)){_0x53b898=_[_0x35fc('0x11')](_0x398b67);process[_0x35fc('0x17')](function(){_0x41e165[_0x35fc('0x1a')]();});}else{process['nextTick'](function(){if(_[_0x35fc('0x4')](_0x21f1a9)){return FnRuleLoop(_0x553677+0x1);}else{return FnRuleLoop(_0x21f1a9);}});}}};if(_0x553677<_0x227a49[_0x35fc('0x1b')]&&_0x5eac0f===![]){var _0x257719=_0x227a49[_0x553677][_0x35fc('0x1c')];_0x257719[_0x35fc('0x16')](_0x398b67,_0x41e165);}else{process['nextTick'](function(){_0x398b67[_0x35fc('0x1d')]=_0x480851;return _0x59507a?_0x59507a(_0x398b67):_[_0x35fc('0x1e')]();});}}(0x0));};RuleEngine['prototype'][_0x35fc('0x1f')]=function(_0x5a93df){if(_[_0x35fc('0x4')](_0x5a93df)){return this['rules'];}else{var _0x4086e9=_['matches'](_0x5a93df);return _[_0x35fc('0x20')](this[_0x35fc('0xb')],_0x4086e9);}};RuleEngine['prototype']['turn']=function(_0x47774c,_0x58edb6){var _0x274208=_0x47774c==='on'||_0x47774c==='ON'?!![]:![];var _0x1a5d92=this['findRules'](_0x58edb6);for(var _0x26b7cb=0x0,_0x645eac=_0x1a5d92[_0x35fc('0x1b')];_0x26b7cb<_0x645eac;_0x26b7cb+=0x1){_0x1a5d92[_0x26b7cb]['on']=_0x274208;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x21')]=function(_0x11ccdb,_0x451f0c){_0x11ccdb=parseInt(_0x11ccdb,0xa);var _0x54aedc=this[_0x35fc('0x1f')](_0x451f0c);for(var _0x220931=0x0,_0x22af18=_0x54aedc['length'];_0x220931<_0x22af18;_0x220931+=0x1){_0x54aedc[_0x220931][_0x35fc('0x22')]=_0x11ccdb;}this[_0x35fc('0xd')]();};RuleEngine[_0x35fc('0x8')][_0x35fc('0x23')]=function(){var _0xd8a4ca=this[_0x35fc('0xb')];if(_0xd8a4ca instanceof Array){_0xd8a4ca=_0xd8a4ca[_0x35fc('0x24')](function(_0x37b435){_0x37b435[_0x35fc('0x1c')]=_0x37b435[_0x35fc('0x1c')]['toString']();_0x37b435['consequence']=_0x37b435[_0x35fc('0x25')]['toString']();return _0x37b435;});}else if(!_[_0x35fc('0x4')](_0xd8a4ca)){_0xd8a4ca[_0x35fc('0x1c')]=_0xd8a4ca[_0x35fc('0x1c')][_0x35fc('0x26')]();_0xd8a4ca[_0x35fc('0x25')]=_0xd8a4ca[_0x35fc('0x25')]['toString']();}return _0xd8a4ca;};RuleEngine[_0x35fc('0x8')][_0x35fc('0x27')]=function(_0x46b9ef){this[_0x35fc('0x3')]();if(_[_0x35fc('0x28')](_0x46b9ef)){_0x46b9ef=JSON[_0x35fc('0x29')](_0x46b9ef);}if(_0x46b9ef instanceof Array){_0x46b9ef=_0x46b9ef['map'](function(_0x2483be){_0x2483be[_0x35fc('0x1c')]=eval('('+_0x2483be[_0x35fc('0x1c')]+')');_0x2483be['consequence']=eval('('+_0x2483be[_0x35fc('0x25')]+')');return _0x2483be;});}else if(_0x46b9ef!==null&&typeof _0x46b9ef=='object'){_0x46b9ef[_0x35fc('0x1c')]=eval('('+_0x46b9ef[_0x35fc('0x1c')]+')');_0x46b9ef[_0x35fc('0x25')]=eval('('+_0x46b9ef[_0x35fc('0x25')]+')');}this['register'](_0x46b9ef);};module['exports']=RuleEngine;
\ No newline at end of file
+var _0xe14b=['next','restart','condition','noop','findRules','matches','turn','length','prioritize','priority','toJSON','map','toString','fromJSON','isString','object','register','exports','lodash','util','isNil','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','push','sync','filter','orderBy','asc','execute','result','clone','consequence','ruleRef','name','index_','nextTick','call'];(function(_0x9f2e1b,_0x20f3e4){var _0x1ab90f=function(_0x2ae8d9){while(--_0x2ae8d9){_0x9f2e1b['push'](_0x9f2e1b['shift']());}};_0x1ab90f(++_0x20f3e4);}(_0xe14b,0x93));var _0xbe14=function(_0x3f7b20,_0x3fa430){_0x3f7b20=_0x3f7b20-0x0;var _0x340fe9=_0xe14b[_0x3f7b20];return _0x340fe9;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var EventEmitter=require('events')['EventEmitter'];function RuleEngine(_0x11c3a0,_0x36393a){this['init']();if(!_[_0xbe14('0x2')](_0x11c3a0)){this['register'](_0x11c3a0);}if(_0x36393a){this['ignoreFactChanges']=_0x36393a[_0xbe14('0x3')];}return this;}util[_0xbe14('0x4')](RuleEngine,EventEmitter);RuleEngine[_0xbe14('0x5')][_0xbe14('0x6')]=function(_0x1d9ade){this[_0xbe14('0x7')]=[];this[_0xbe14('0x8')]=[];};RuleEngine['prototype']['register']=function(_0x496063){if(Array[_0xbe14('0x9')](_0x496063)){this[_0xbe14('0x7')]=this[_0xbe14('0x7')][_0xbe14('0xa')](_0x496063);}else if(_0x496063!==null&&_['isObject'](_0x496063)){this['rules'][_0xbe14('0xb')](_0x496063);}this[_0xbe14('0xc')]();};RuleEngine['prototype'][_0xbe14('0xc')]=function(){this[_0xbe14('0x8')]=this[_0xbe14('0x7')][_0xbe14('0xd')](function(_0x27792f){if(_[_0xbe14('0x2')](_0x27792f['on'])){_0x27792f['on']=!![];}if(_0x27792f['on']===!![]){return _0x27792f;}});this[_0xbe14('0x8')]=_[_0xbe14('0xe')](this[_0xbe14('0x8')],['p'],[_0xbe14('0xf')]);};RuleEngine[_0xbe14('0x5')][_0xbe14('0x10')]=function(_0x813399,_0x530538){var _0x55b3a7=![];_0x813399[_0xbe14('0x11')]=!![];var _0x3dc4a9=_[_0xbe14('0x12')](_0x813399);var _0x37ce4e=_['clone'](_0x813399);var _0x21c789=this[_0xbe14('0x8')];var _0xfd7b8f=[];var _0x123ede=this[_0xbe14('0x3')];(function FnRuleLoop(_0x29ab73){var _0x17ae86={'rules':function(){return _0x21c789;},'rule':function(){return _0x21c789[_0x29ab73];},'when':function(_0x5ea1f8){if(_0x5ea1f8){var _0x137ee5=_0x21c789[_0x29ab73][_0xbe14('0x13')];_0x137ee5[_0xbe14('0x14')]=_0x21c789[_0x29ab73]['id']||_0x21c789[_0x29ab73][_0xbe14('0x15')]||_0xbe14('0x16')+_0x29ab73;process[_0xbe14('0x17')](function(){_0xfd7b8f['push'](_0x137ee5[_0xbe14('0x14')]);_0x137ee5[_0xbe14('0x18')](_0x3dc4a9,_0x17ae86);});}else{process[_0xbe14('0x17')](function(){_0x17ae86[_0xbe14('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x55b3a7=!![];return FnRuleLoop(0x0);},'next':function(_0x188ec4){if(!_0x123ede&&!_['isEqual'](_0x37ce4e,_0x3dc4a9)){_0x37ce4e=_[_0xbe14('0x12')](_0x3dc4a9);process['nextTick'](function(){_0x17ae86[_0xbe14('0x1a')]();});}else{process['nextTick'](function(){if(_[_0xbe14('0x2')](_0x188ec4)){return FnRuleLoop(_0x29ab73+0x1);}else{return FnRuleLoop(_0x188ec4);}});}}};if(_0x29ab73<_0x21c789['length']&&_0x55b3a7===![]){var _0x274018=_0x21c789[_0x29ab73][_0xbe14('0x1b')];_0x274018['call'](_0x3dc4a9,_0x17ae86);}else{process[_0xbe14('0x17')](function(){_0x3dc4a9['matchPath']=_0xfd7b8f;return _0x530538?_0x530538(_0x3dc4a9):_[_0xbe14('0x1c')]();});}}(0x0));};RuleEngine['prototype'][_0xbe14('0x1d')]=function(_0x5fa043){if(_[_0xbe14('0x2')](_0x5fa043)){return this[_0xbe14('0x7')];}else{var _0x15ef02=_[_0xbe14('0x1e')](_0x5fa043);return _['filter'](this[_0xbe14('0x7')],_0x15ef02);}};RuleEngine[_0xbe14('0x5')][_0xbe14('0x1f')]=function(_0x169369,_0x5dd475){var _0x16f884=_0x169369==='on'||_0x169369==='ON'?!![]:![];var _0x29fc64=this['findRules'](_0x5dd475);for(var _0x3c3613=0x0,_0x3b3e84=_0x29fc64[_0xbe14('0x20')];_0x3c3613<_0x3b3e84;_0x3c3613+=0x1){_0x29fc64[_0x3c3613]['on']=_0x16f884;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x21')]=function(_0x31a664,_0x2b05cb){_0x31a664=parseInt(_0x31a664,0xa);var _0x4168c8=this[_0xbe14('0x1d')](_0x2b05cb);for(var _0x40538f=0x0,_0x3bf43c=_0x4168c8[_0xbe14('0x20')];_0x40538f<_0x3bf43c;_0x40538f+=0x1){_0x4168c8[_0x40538f][_0xbe14('0x22')]=_0x31a664;}this[_0xbe14('0xc')]();};RuleEngine[_0xbe14('0x5')][_0xbe14('0x23')]=function(){var _0x2ff48e=this[_0xbe14('0x7')];if(_0x2ff48e instanceof Array){_0x2ff48e=_0x2ff48e[_0xbe14('0x24')](function(_0x581e86){_0x581e86[_0xbe14('0x1b')]=_0x581e86['condition']['toString']();_0x581e86[_0xbe14('0x13')]=_0x581e86['consequence'][_0xbe14('0x25')]();return _0x581e86;});}else if(!_[_0xbe14('0x2')](_0x2ff48e)){_0x2ff48e['condition']=_0x2ff48e['condition']['toString']();_0x2ff48e[_0xbe14('0x13')]=_0x2ff48e[_0xbe14('0x13')]['toString']();}return _0x2ff48e;};RuleEngine[_0xbe14('0x5')][_0xbe14('0x26')]=function(_0x452635){this[_0xbe14('0x6')]();if(_[_0xbe14('0x27')](_0x452635)){_0x452635=JSON['parse'](_0x452635);}if(_0x452635 instanceof Array){_0x452635=_0x452635['map'](function(_0x15a997){_0x15a997['condition']=eval('('+_0x15a997['condition']+')');_0x15a997['consequence']=eval('('+_0x15a997[_0xbe14('0x13')]+')');return _0x15a997;});}else if(_0x452635!==null&&typeof _0x452635==_0xbe14('0x28')){_0x452635[_0xbe14('0x1b')]=eval('('+_0x452635[_0xbe14('0x1b')]+')');_0x452635[_0xbe14('0x13')]=eval('('+_0x452635[_0xbe14('0x13')]+')');}this[_0xbe14('0x29')](_0x452635);};module[_0xbe14('0x2a')]=RuleEngine;
\ No newline at end of file
index da454e6..7b8a015 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x675f=['jayson/promise','client','http','request','error','message','result','sendMailMessage','SendMail','bluebird'];(function(_0x1a3bb7,_0xd65f59){var _0x9ead71=function(_0x549a13){while(--_0x549a13){_0x1a3bb7['push'](_0x1a3bb7['shift']());}};_0x9ead71(++_0xd65f59);}(_0x675f,0x8b));var _0xf675=function(_0x358c03,_0x3f92ce){_0x358c03=_0x358c03-0x0;var _0x50b883=_0x675f[_0x358c03];return _0x50b883;};'use strict';var BPromise=require(_0xf675('0x0'));var jayson=require(_0xf675('0x1'));var client=jayson[_0xf675('0x2')][_0xf675('0x3')]({'port':0x232b});function request(_0x3f6799,_0x2b4bea){return new BPromise(function(_0x8aac09,_0x54aa72){return client[_0xf675('0x4')](_0x3f6799,_0x2b4bea)['then'](function(_0x19bf10){if(_0x19bf10[_0xf675('0x5')]){return _0x54aa72(_0x19bf10[_0xf675('0x5')][_0xf675('0x6')]);}else{return _0x8aac09(_0x19bf10[_0xf675('0x7')]);}})['catch'](function(_0x15a3b0){return _0x54aa72(_0x15a3b0);});});}exports[_0xf675('0x8')]=function(_0x5d0417,_0x146af2){return request(_0xf675('0x9'),{'account':_0x5d0417,'message':_0x146af2});};
\ No newline at end of file
+var _0x936d=['jayson/promise','client','http','request','error','message','SendMail','bluebird'];(function(_0x48c7ea,_0x131737){var _0x474c83=function(_0x150c86){while(--_0x150c86){_0x48c7ea['push'](_0x48c7ea['shift']());}};_0x474c83(++_0x131737);}(_0x936d,0x7f));var _0xd936=function(_0x51323f,_0x3e44ee){_0x51323f=_0x51323f-0x0;var _0x4eeb0f=_0x936d[_0x51323f];return _0x4eeb0f;};'use strict';var BPromise=require(_0xd936('0x0'));var jayson=require(_0xd936('0x1'));var client=jayson[_0xd936('0x2')][_0xd936('0x3')]({'port':0x232b});function request(_0x4bf979,_0x7a39da){return new BPromise(function(_0x491796,_0x5d7848){return client[_0xd936('0x4')](_0x4bf979,_0x7a39da)['then'](function(_0x4bade7){if(_0x4bade7[_0xd936('0x5')]){return _0x5d7848(_0x4bade7[_0xd936('0x5')][_0xd936('0x6')]);}else{return _0x491796(_0x4bade7['result']);}})['catch'](function(_0x1f6887){return _0x5d7848(_0x1f6887);});});}exports['sendMailMessage']=function(_0x3c6829,_0x3dcfd0){return request(_0xd936('0x7'),{'account':_0x3c6829,'message':_0x3dcfd0});};
\ No newline at end of file
index 5dfdc70..5140731 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0be6=['defaults','localhost','socket.io-emitter','name','voicePause','mailPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','openchannel','whatsapp','length','Status','StatusTime','format','online','chatPause','faxPause','mailCurrentCapacity','faxStatusTime','stringify','emit','exports','md5','ioredis','../../../config/environment'];(function(_0x35b870,_0x11ad5f){var _0x143d6e=function(_0x3c2c89){while(--_0x3c2c89){_0x35b870['push'](_0x35b870['shift']());}};_0x143d6e(++_0x11ad5f);}(_0x0be6,0xa8));var _0x60be=function(_0x1ec274,_0x51440a){_0x1ec274=_0x1ec274-0x0;var _0x3d020f=_0x0be6[_0x1ec274];return _0x3d020f;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require(_0x60be('0x0'));var Redis=require(_0x60be('0x1'));var config=require(_0x60be('0x2'));config['redis']=_[_0x60be('0x3')](config['redis'],{'host':_0x60be('0x4'),'port':0x18eb});var io=require(_0x60be('0x5'))(new Redis(config['redis']));function Agent(_0x311554){this['id']=_0x311554['id']||0x0;this[_0x60be('0x6')]=_0x311554[_0x60be('0x6')]||'';this['online']=_0x311554['online']||!![];this[_0x60be('0x7')]=_0x311554[_0x60be('0x7')]||![];this['chatPause']=_0x311554['chatPause']||![];this[_0x60be('0x8')]=_0x311554[_0x60be('0x8')]||![];this['faxPause']=_0x311554['faxPause']||![];this[_0x60be('0x9')]=_0x311554[_0x60be('0x9')]||![];this[_0x60be('0xa')]=_0x311554['openchannelPause']||![];this[_0x60be('0xb')]=_0x60be('0xc');this[_0x60be('0xd')]=0x0;this[_0x60be('0xe')]=_0x311554[_0x60be('0xe')]||0x0;this[_0x60be('0xf')]=0x0;this[_0x60be('0x10')]='unknown';this[_0x60be('0x11')]=0x0;this[_0x60be('0x12')]=_0x311554[_0x60be('0x12')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x60be('0x13')]='unknown';this['faxStatusTime']=0x0;this[_0x60be('0x14')]=_0x311554[_0x60be('0x14')]||0x0;this[_0x60be('0x15')]=0x0;this[_0x60be('0x16')]=_0x60be('0xc');this[_0x60be('0x17')]=0x0;this[_0x60be('0x18')]=_0x311554[_0x60be('0x18')]||0x0;this[_0x60be('0x19')]=0x0;this[_0x60be('0x1a')]='unknown';this[_0x60be('0x1b')]=0x0;this['whatsappCapacity']=_0x311554[_0x60be('0x1c')]||0x0;this[_0x60be('0x1d')]=0x0;this[_0x60be('0x1e')]=_0x60be('0xc');this[_0x60be('0x1f')]=0x0;this[_0x60be('0x20')]=_0x311554[_0x60be('0x20')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x60be('0x21')]=![];this[_0x60be('0x22')]=undefined;this[_0x60be('0x0')]='';this['updateRealtime']();}Agent[_0x60be('0x23')][_0x60be('0x24')]=function(_0x105510){if(this[_0x105510+_0x60be('0x25')]>0x0){if(this[_0x105510+_0x60be('0x26')]>0x0&&this[_0x105510+_0x60be('0x25')]>=this[_0x105510+_0x60be('0x26')]){return _0x60be('0x27');}else{return _0x60be('0x28');}}else{return _0x60be('0x29');}};Agent[_0x60be('0x23')]['updateRealtime']=function(){var _0x5c3fba=[_0x60be('0x2a'),'chat',_0x60be('0x2b'),'fax','sms',_0x60be('0x2c')];for(var _0x35fe80=0x0;_0x35fe80<_0x5c3fba[_0x60be('0x2d')];_0x35fe80+=0x1){var _0x53af97=this[_0x60be('0x24')](_0x5c3fba[_0x35fe80]);if(this[_0x5c3fba[_0x35fe80]+_0x60be('0x2e')]!==_0x53af97){this[_0x5c3fba[_0x35fe80]+_0x60be('0x2f')]=_['toNumber'](moment()[_0x60be('0x30')]('x'));}this[_0x5c3fba[_0x35fe80]+_0x60be('0x2e')]=_0x53af97;}var _0x4b08b0={'id':this['id'],'name':this[_0x60be('0x6')],'online':this[_0x60be('0x31')],'voicePause':this[_0x60be('0x7')],'chatPause':this[_0x60be('0x32')],'mailPause':this[_0x60be('0x8')],'smsPause':this[_0x60be('0x9')],'faxPause':this[_0x60be('0x33')],'openchannelPause':this[_0x60be('0xa')],'chatStatus':this[_0x60be('0xb')],'chatStatusTime':this[_0x60be('0xd')],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x60be('0x11')],'mailCapacity':this[_0x60be('0x12')],'mailCurrentCapacity':this[_0x60be('0x34')],'faxStatus':this[_0x60be('0x13')],'faxStatusTime':this[_0x60be('0x35')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x60be('0x15')],'smsStatus':this[_0x60be('0x16')],'smsStatusTime':this[_0x60be('0x17')],'smsCapacity':this[_0x60be('0x18')],'smsCurrentCapacity':this[_0x60be('0x19')],'whatsappStatus':this[_0x60be('0x1a')],'whatsappStatusTime':this[_0x60be('0x1b')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this['whatsappCurrentCapacity'],'openchannelStatus':this[_0x60be('0x1e')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x60be('0x20')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x60be('0x21')],'busyQueue':this[_0x60be('0x22')]};var _0x15b3cf=md5(JSON[_0x60be('0x36')](_0x4b08b0));if(this[_0x60be('0x0')]!==_0x15b3cf){this['md5']=_0x15b3cf;io[_0x60be('0x37')]('user:save',_0x4b08b0);}};module[_0x60be('0x38')]=Agent;
\ No newline at end of file
+var _0x94df=['mailStatus','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','smsCurrentCapacity','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','openchannel','fax','sms','whatsapp','length','Status','StatusTime','toNumber','chatCapacity','mailCurrentCapacity','whatsappStatus','whatsappStatusTime','stringify','exports','lodash','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCurrentCapacity'];(function(_0xc939ce,_0x5d6dd6){var _0x436094=function(_0x38b05c){while(--_0x38b05c){_0xc939ce['push'](_0xc939ce['shift']());}};_0x436094(++_0x5d6dd6);}(_0x94df,0xa3));var _0xf94d=function(_0x5d6486,_0x33a779){_0x5d6486=_0x5d6486-0x0;var _0x45b894=_0x94df[_0x5d6486];return _0x45b894;};'use strict';var _=require(_0xf94d('0x0'));var moment=require(_0xf94d('0x1'));var md5=require(_0xf94d('0x2'));var Redis=require(_0xf94d('0x3'));var config=require(_0xf94d('0x4'));config[_0xf94d('0x5')]=_['defaults'](config[_0xf94d('0x5')],{'host':_0xf94d('0x6'),'port':0x18eb});var io=require(_0xf94d('0x7'))(new Redis(config[_0xf94d('0x5')]));function Agent(_0x4af826){this['id']=_0x4af826['id']||0x0;this[_0xf94d('0x8')]=_0x4af826[_0xf94d('0x8')]||'';this[_0xf94d('0x9')]=_0x4af826[_0xf94d('0x9')]||!![];this[_0xf94d('0xa')]=_0x4af826[_0xf94d('0xa')]||![];this['chatPause']=_0x4af826[_0xf94d('0xb')]||![];this[_0xf94d('0xc')]=_0x4af826[_0xf94d('0xc')]||![];this[_0xf94d('0xd')]=_0x4af826[_0xf94d('0xd')]||![];this[_0xf94d('0xe')]=_0x4af826['smsPause']||![];this[_0xf94d('0xf')]=_0x4af826[_0xf94d('0xf')]||![];this[_0xf94d('0x10')]=_0xf94d('0x11');this[_0xf94d('0x12')]=0x0;this['chatCapacity']=_0x4af826['chatCapacity']||0x0;this[_0xf94d('0x13')]=0x0;this[_0xf94d('0x14')]=_0xf94d('0x11');this[_0xf94d('0x15')]=0x0;this[_0xf94d('0x16')]=_0x4af826[_0xf94d('0x16')]||0x0;this['mailCurrentCapacity']=0x0;this[_0xf94d('0x17')]=_0xf94d('0x11');this[_0xf94d('0x18')]=0x0;this[_0xf94d('0x19')]=_0x4af826[_0xf94d('0x19')]||0x0;this[_0xf94d('0x1a')]=0x0;this[_0xf94d('0x1b')]=_0xf94d('0x11');this['smsStatusTime']=0x0;this[_0xf94d('0x1c')]=_0x4af826['smsCapacity']||0x0;this[_0xf94d('0x1d')]=0x0;this['whatsappStatus']=_0xf94d('0x11');this['whatsappStatusTime']=0x0;this[_0xf94d('0x1e')]=_0x4af826[_0xf94d('0x1e')]||0x0;this[_0xf94d('0x1f')]=0x0;this[_0xf94d('0x20')]='unknown';this[_0xf94d('0x21')]=0x0;this['openchannelCapacity']=_0x4af826[_0xf94d('0x22')]||0x0;this[_0xf94d('0x23')]=0x0;this[_0xf94d('0x24')]=![];this[_0xf94d('0x25')]=undefined;this['md5']='';this[_0xf94d('0x26')]();}Agent['prototype'][_0xf94d('0x27')]=function(_0x1fa6bf){if(this[_0x1fa6bf+_0xf94d('0x28')]>0x0){if(this[_0x1fa6bf+'Capacity']>0x0&&this[_0x1fa6bf+_0xf94d('0x28')]>=this[_0x1fa6bf+_0xf94d('0x29')]){return _0xf94d('0x2a');}else{return _0xf94d('0x2b');}}else{return _0xf94d('0x2c');}};Agent['prototype'][_0xf94d('0x26')]=function(){var _0x51f7f8=[_0xf94d('0x2d'),_0xf94d('0x2e'),_0xf94d('0x2f'),_0xf94d('0x30'),_0xf94d('0x31'),_0xf94d('0x32')];for(var _0x2804dc=0x0;_0x2804dc<_0x51f7f8[_0xf94d('0x33')];_0x2804dc+=0x1){var _0x3c9fe3=this[_0xf94d('0x27')](_0x51f7f8[_0x2804dc]);if(this[_0x51f7f8[_0x2804dc]+_0xf94d('0x34')]!==_0x3c9fe3){this[_0x51f7f8[_0x2804dc]+_0xf94d('0x35')]=_[_0xf94d('0x36')](moment()['format']('x'));}this[_0x51f7f8[_0x2804dc]+'Status']=_0x3c9fe3;}var _0x55a7de={'id':this['id'],'name':this['name'],'online':this[_0xf94d('0x9')],'voicePause':this[_0xf94d('0xa')],'chatPause':this['chatPause'],'mailPause':this[_0xf94d('0xc')],'smsPause':this[_0xf94d('0xe')],'faxPause':this[_0xf94d('0xd')],'openchannelPause':this['openchannelPause'],'chatStatus':this[_0xf94d('0x10')],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this[_0xf94d('0x37')],'chatCurrentCapacity':this[_0xf94d('0x13')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xf94d('0x15')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0xf94d('0x38')],'faxStatus':this['faxStatus'],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xf94d('0x1a')],'smsStatus':this[_0xf94d('0x1b')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xf94d('0x1c')],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0xf94d('0x39')],'whatsappStatusTime':this[_0xf94d('0x3a')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0xf94d('0x1f')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0xf94d('0x21')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xf94d('0x23')],'busy':this['busy'],'busyQueue':this[_0xf94d('0x25')]};var _0x1ada36=md5(JSON[_0xf94d('0x3b')](_0x55a7de));if(this[_0xf94d('0x2')]!==_0x1ada36){this['md5']=_0x1ada36;io['emit']('user:save',_0x55a7de);}};module[_0xf94d('0x3c')]=Agent;
\ No newline at end of file
index 6bae3e9..fc20d4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe1da=['redis','defaults','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','map','_rr','updateRealtime','paused','online','chatPause','loggedIn','available','stringify','format','chat:queue:%s','lodash','md5','util','ioredis','../../../config/environment'];(function(_0x3e997e,_0xcb6704){var _0x1873b5=function(_0x575e06){while(--_0x575e06){_0x3e997e['push'](_0x3e997e['shift']());}};_0x1873b5(++_0xcb6704);}(_0xe1da,0x67));var _0xae1d=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xe1da[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xae1d('0x0'));var md5=require(_0xae1d('0x1'));var util=require(_0xae1d('0x2'));var Redis=require(_0xae1d('0x3'));var config=require(_0xae1d('0x4'));config[_0xae1d('0x5')]=_[_0xae1d('0x6')](config[_0xae1d('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xae1d('0x5')]));function ChatQueue(_0x1e82d3){this['id']=_0x1e82d3['id']||0x0;this[_0xae1d('0x7')]=_0x1e82d3[_0xae1d('0x7')]||'';this['timeout']=_0x1e82d3[_0xae1d('0x8')]||0xa;this[_0xae1d('0x9')]=_0x1e82d3['strategy']||_0xae1d('0xa');this['Agents']=_0x1e82d3[_0xae1d('0xb')];this[_0xae1d('0xc')]={};this[_0xae1d('0xd')]=0x0;this[_0xae1d('0x1')]='';this[_0xae1d('0xe')]();this['updateRealtime']();}ChatQueue[_0xae1d('0xf')][_0xae1d('0xe')]=function(){var _0x57e6e4=this[_0xae1d('0xc')]['_rr'];this[_0xae1d('0xc')]=_[_0xae1d('0x10')](this[_0xae1d('0xb')],'id');this[_0xae1d('0xc')][_0xae1d('0x11')]=_0x57e6e4;};ChatQueue[_0xae1d('0xf')][_0xae1d('0x12')]=function(){this['loggedIn']=0x0;this[_0xae1d('0x13')]=0x0;for(var _0x7fd796=0x0;_0x7fd796<this[_0xae1d('0xb')]['length'];_0x7fd796+=0x1){if(this[_0xae1d('0xb')][_0x7fd796][_0xae1d('0x14')]){this['loggedIn']+=0x1;}if(this[_0xae1d('0xb')][_0x7fd796][_0xae1d('0x15')]){this[_0xae1d('0x13')]+=0x1;}}this['available']=this[_0xae1d('0x16')]-this[_0xae1d('0x13')];this[_0xae1d('0x17')]=this['available']>=0x0?this['available']:0x0;var _0x59fccb={'id':this['id'],'available':this[_0xae1d('0x17')],'loggedIn':this['loggedIn'],'name':this[_0xae1d('0x7')],'paused':this[_0xae1d('0x13')],'waiting':this[_0xae1d('0xd')]};var _0x9ec5b4=md5(JSON[_0xae1d('0x18')](_0x59fccb));if(this['md5']!==_0x9ec5b4){this[_0xae1d('0x1')]=_0x9ec5b4;io['to'](util[_0xae1d('0x19')](_0xae1d('0x1a'),_0x59fccb[_0xae1d('0x7')]))['emit']('chat_queue:save',_0x59fccb);}};module['exports']=ChatQueue;
\ No newline at end of file
+var _0xa6c8=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','map','loggedIn','length','online','chatPause','paused','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','../../../config/environment','redis'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0xa6c8,0x19f));var _0x8a6c=function(_0x2f3b0d,_0x467a37){_0x2f3b0d=_0x2f3b0d-0x0;var _0x37af64=_0xa6c8[_0x2f3b0d];return _0x37af64;};'use strict';var _=require(_0x8a6c('0x0'));var md5=require(_0x8a6c('0x1'));var util=require(_0x8a6c('0x2'));var Redis=require('ioredis');var config=require(_0x8a6c('0x3'));config[_0x8a6c('0x4')]=_['defaults'](config[_0x8a6c('0x4')],{'host':_0x8a6c('0x5'),'port':0x18eb});var io=require(_0x8a6c('0x6'))(new Redis(config['redis']));function ChatQueue(_0x3ea5c7){this['id']=_0x3ea5c7['id']||0x0;this[_0x8a6c('0x7')]=_0x3ea5c7[_0x8a6c('0x7')]||'';this['timeout']=_0x3ea5c7[_0x8a6c('0x8')]||0xa;this[_0x8a6c('0x9')]=_0x3ea5c7[_0x8a6c('0x9')]||_0x8a6c('0xa');this['Agents']=_0x3ea5c7[_0x8a6c('0xb')];this['mapAgentsId']={};this[_0x8a6c('0xc')]=0x0;this[_0x8a6c('0x1')]='';this[_0x8a6c('0xd')]();this[_0x8a6c('0xe')]();}ChatQueue[_0x8a6c('0xf')][_0x8a6c('0xd')]=function(){var _0x3c1973=this[_0x8a6c('0x10')]['_rr'];this[_0x8a6c('0x10')]=_[_0x8a6c('0x11')](this[_0x8a6c('0xb')],'id');this[_0x8a6c('0x10')]['_rr']=_0x3c1973;};ChatQueue['prototype']['updateRealtime']=function(){this[_0x8a6c('0x12')]=0x0;this['paused']=0x0;for(var _0x18f6b3=0x0;_0x18f6b3<this[_0x8a6c('0xb')][_0x8a6c('0x13')];_0x18f6b3+=0x1){if(this[_0x8a6c('0xb')][_0x18f6b3][_0x8a6c('0x14')]){this['loggedIn']+=0x1;}if(this[_0x8a6c('0xb')][_0x18f6b3][_0x8a6c('0x15')]){this[_0x8a6c('0x16')]+=0x1;}}this['available']=this[_0x8a6c('0x12')]-this[_0x8a6c('0x16')];this[_0x8a6c('0x17')]=this[_0x8a6c('0x17')]>=0x0?this[_0x8a6c('0x17')]:0x0;var _0x48e302={'id':this['id'],'available':this[_0x8a6c('0x17')],'loggedIn':this[_0x8a6c('0x12')],'name':this[_0x8a6c('0x7')],'paused':this[_0x8a6c('0x16')],'waiting':this[_0x8a6c('0xc')]};var _0x4d5361=md5(JSON[_0x8a6c('0x18')](_0x48e302));if(this['md5']!==_0x4d5361){this[_0x8a6c('0x1')]=_0x4d5361;io['to'](util[_0x8a6c('0x19')](_0x8a6c('0x1a'),_0x48e302['name']))[_0x8a6c('0x1b')](_0x8a6c('0x1c'),_0x48e302);}};module[_0x8a6c('0x1d')]=ChatQueue;
\ No newline at end of file
index 3b41baa..566dddd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4dd7=['strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','length','faxPause','available','paused','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout'];(function(_0x1c7137,_0x4c7c26){var _0xeb4432=function(_0x26d850){while(--_0x26d850){_0x1c7137['push'](_0x1c7137['shift']());}};_0xeb4432(++_0x4c7c26);}(_0x4dd7,0x14a));var _0x74dd=function(_0x982737,_0x1e01a6){_0x982737=_0x982737-0x0;var _0x24d720=_0x4dd7[_0x982737];return _0x24d720;};'use strict';var _=require(_0x74dd('0x0'));var md5=require(_0x74dd('0x1'));var util=require(_0x74dd('0x2'));var Redis=require(_0x74dd('0x3'));var config=require(_0x74dd('0x4'));config[_0x74dd('0x5')]=_[_0x74dd('0x6')](config[_0x74dd('0x5')],{'host':_0x74dd('0x7'),'port':0x18eb});var io=require(_0x74dd('0x8'))(new Redis(config['redis']));function FaxQueue(_0x500ba4){this['id']=_0x500ba4['id']||0x0;this['name']=_0x500ba4[_0x74dd('0x9')]||'';this[_0x74dd('0xa')]=_0x500ba4[_0x74dd('0xa')]||0xa;this[_0x74dd('0xb')]=_0x500ba4[_0x74dd('0xb')]||_0x74dd('0xc');this['Agents']=_0x500ba4[_0x74dd('0xd')];this[_0x74dd('0xe')]={};this[_0x74dd('0xf')]=0x0;this['md5']='';this['updateRouting']();this[_0x74dd('0x10')]();}FaxQueue[_0x74dd('0x11')][_0x74dd('0x12')]=function(){var _0x5e43bf=this[_0x74dd('0xe')][_0x74dd('0x13')];this[_0x74dd('0xe')]=_[_0x74dd('0x14')](this['Agents'],'id');this['mapAgentsId'][_0x74dd('0x13')]=_0x5e43bf;};FaxQueue[_0x74dd('0x11')][_0x74dd('0x10')]=function(){this[_0x74dd('0x15')]=0x0;this['paused']=0x0;for(var _0x18362c=0x0;_0x18362c<this[_0x74dd('0xd')][_0x74dd('0x16')];_0x18362c+=0x1){if(this[_0x74dd('0xd')][_0x18362c]['online']){this[_0x74dd('0x15')]+=0x1;}if(this[_0x74dd('0xd')][_0x18362c][_0x74dd('0x17')]){this['paused']+=0x1;}}this['available']=this[_0x74dd('0x15')]-this['paused'];this[_0x74dd('0x18')]=this[_0x74dd('0x18')]>=0x0?this[_0x74dd('0x18')]:0x0;var _0x2950c6={'id':this['id'],'available':this[_0x74dd('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x74dd('0x9')],'paused':this[_0x74dd('0x19')],'waiting':this[_0x74dd('0xf')]};var _0x4c83b7=md5(JSON['stringify'](_0x2950c6));if(this['md5']!==_0x4c83b7){this[_0x74dd('0x1')]=_0x4c83b7;io['to'](util[_0x74dd('0x1a')](_0x74dd('0x1b'),_0x2950c6[_0x74dd('0x9')]))[_0x74dd('0x1c')](_0x74dd('0x1d'),_0x2950c6);}};module[_0x74dd('0x1e')]=FaxQueue;
\ No newline at end of file
+var _0xcbb8=['name','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','online','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x5f36cd,_0x37d4c9){var _0x49832a=function(_0xa82985){while(--_0xa82985){_0x5f36cd['push'](_0x5f36cd['shift']());}};_0x49832a(++_0x37d4c9);}(_0xcbb8,0x11a));var _0x8cbb=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xcbb8[_0xc4001c];return _0x49f7bc;};'use strict';var _=require('lodash');var md5=require(_0x8cbb('0x0'));var util=require(_0x8cbb('0x1'));var Redis=require(_0x8cbb('0x2'));var config=require(_0x8cbb('0x3'));config[_0x8cbb('0x4')]=_[_0x8cbb('0x5')](config['redis'],{'host':_0x8cbb('0x6'),'port':0x18eb});var io=require(_0x8cbb('0x7'))(new Redis(config['redis']));function FaxQueue(_0x363273){this['id']=_0x363273['id']||0x0;this[_0x8cbb('0x8')]=_0x363273[_0x8cbb('0x8')]||'';this[_0x8cbb('0x9')]=_0x363273[_0x8cbb('0x9')]||0xa;this['strategy']=_0x363273['strategy']||_0x8cbb('0xa');this[_0x8cbb('0xb')]=_0x363273[_0x8cbb('0xb')];this[_0x8cbb('0xc')]={};this[_0x8cbb('0xd')]=0x0;this['md5']='';this[_0x8cbb('0xe')]();this[_0x8cbb('0xf')]();}FaxQueue[_0x8cbb('0x10')]['updateRouting']=function(){var _0x3c349b=this[_0x8cbb('0xc')]['_rr'];this[_0x8cbb('0xc')]=_[_0x8cbb('0x11')](this[_0x8cbb('0xb')],'id');this[_0x8cbb('0xc')][_0x8cbb('0x12')]=_0x3c349b;};FaxQueue[_0x8cbb('0x10')][_0x8cbb('0xf')]=function(){this[_0x8cbb('0x13')]=0x0;this[_0x8cbb('0x14')]=0x0;for(var _0x458e3a=0x0;_0x458e3a<this['Agents']['length'];_0x458e3a+=0x1){if(this[_0x8cbb('0xb')][_0x458e3a][_0x8cbb('0x15')]){this['loggedIn']+=0x1;}if(this[_0x8cbb('0xb')][_0x458e3a]['faxPause']){this[_0x8cbb('0x14')]+=0x1;}}this['available']=this['loggedIn']-this['paused'];this['available']=this[_0x8cbb('0x16')]>=0x0?this[_0x8cbb('0x16')]:0x0;var _0x43779b={'id':this['id'],'available':this[_0x8cbb('0x16')],'loggedIn':this[_0x8cbb('0x13')],'name':this[_0x8cbb('0x8')],'paused':this[_0x8cbb('0x14')],'waiting':this[_0x8cbb('0xd')]};var _0x2d2aa6=md5(JSON[_0x8cbb('0x17')](_0x43779b));if(this[_0x8cbb('0x0')]!==_0x2d2aa6){this[_0x8cbb('0x0')]=_0x2d2aa6;io['to'](util[_0x8cbb('0x18')](_0x8cbb('0x19'),_0x43779b['name']))[_0x8cbb('0x1a')](_0x8cbb('0x1b'),_0x43779b);}};module[_0x8cbb('0x1c')]=FaxQueue;
\ No newline at end of file
index 9853c5f..42b792c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe2da=['Intervals','name'];(function(_0x385142,_0x25aa0e){var _0x5a02fd=function(_0x42e60c){while(--_0x42e60c){_0x385142['push'](_0x385142['shift']());}};_0x5a02fd(++_0x25aa0e);}(_0xe2da,0x1eb));var _0xae2d=function(_0x406e1c,_0x4acb3e){_0x406e1c=_0x406e1c-0x0;var _0x2166f1=_0xe2da[_0x406e1c];return _0x2166f1;};'use strict';function Interval(_0x4131ba){this['id']=_0x4131ba['id']||0x0;this['name']=_0x4131ba[_0xae2d('0x0')]||'';this[_0xae2d('0x1')]=_0x4131ba['Intervals']||{};}module['exports']=Interval;
\ No newline at end of file
+var _0xeae5=['name'];(function(_0x181434,_0x3b27ec){var _0xa7544b=function(_0x4f95bf){while(--_0x4f95bf){_0x181434['push'](_0x181434['shift']());}};_0xa7544b(++_0x3b27ec);}(_0xeae5,0x171));var _0x5eae=function(_0x19efb2,_0x4bda67){_0x19efb2=_0x19efb2-0x0;var _0x24c966=_0xeae5[_0x19efb2];return _0x24c966;};'use strict';function Interval(_0x5c0ccf){this['id']=_0x5c0ccf['id']||0x0;this['name']=_0x5c0ccf[_0x5eae('0x0')]||'';this['Intervals']=_0x5c0ccf['Intervals']||{};}module['exports']=Interval;
\ No newline at end of file
index a3ffa16..230126a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9881=['length','online','mailPause','available','format','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','prototype','_rr','updateRealtime','loggedIn','paused'];(function(_0x1d930e,_0x20d8b8){var _0x5bbd66=function(_0x3c7488){while(--_0x3c7488){_0x1d930e['push'](_0x1d930e['shift']());}};_0x5bbd66(++_0x20d8b8);}(_0x9881,0xb7));var _0x1988=function(_0x539592,_0x160280){_0x539592=_0x539592-0x0;var _0x3979b0=_0x9881[_0x539592];return _0x3979b0;};'use strict';var _=require(_0x1988('0x0'));var md5=require(_0x1988('0x1'));var util=require(_0x1988('0x2'));var Redis=require(_0x1988('0x3'));var config=require(_0x1988('0x4'));config[_0x1988('0x5')]=_['defaults'](config[_0x1988('0x5')],{'host':_0x1988('0x6'),'port':0x18eb});var io=require(_0x1988('0x7'))(new Redis(config[_0x1988('0x5')]));function MailQueue(_0x52bf1f){this['id']=_0x52bf1f['id']||0x0;this['name']=_0x52bf1f[_0x1988('0x8')]||'';this['timeout']=_0x52bf1f[_0x1988('0x9')]||0xa;this[_0x1988('0xa')]=_0x52bf1f[_0x1988('0xa')]||'beepall';this['Agents']=_0x52bf1f[_0x1988('0xb')];this[_0x1988('0xc')]={};this[_0x1988('0xd')]=0x0;this['md5']='';this[_0x1988('0xe')]();this['updateRealtime']();}MailQueue[_0x1988('0xf')][_0x1988('0xe')]=function(){var _0x2b392e=this['mapAgentsId'][_0x1988('0x10')];this[_0x1988('0xc')]=_['map'](this[_0x1988('0xb')],'id');this[_0x1988('0xc')][_0x1988('0x10')]=_0x2b392e;};MailQueue[_0x1988('0xf')][_0x1988('0x11')]=function(){this[_0x1988('0x12')]=0x0;this[_0x1988('0x13')]=0x0;for(var _0x190d9d=0x0;_0x190d9d<this[_0x1988('0xb')][_0x1988('0x14')];_0x190d9d+=0x1){if(this[_0x1988('0xb')][_0x190d9d][_0x1988('0x15')]){this['loggedIn']+=0x1;}if(this[_0x1988('0xb')][_0x190d9d][_0x1988('0x16')]){this[_0x1988('0x13')]+=0x1;}}this[_0x1988('0x17')]=this[_0x1988('0x12')]-this['paused'];this[_0x1988('0x17')]=this[_0x1988('0x17')]>=0x0?this[_0x1988('0x17')]:0x0;var _0x4a637f={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x1988('0x8')],'paused':this['paused'],'waiting':this[_0x1988('0xd')]};var _0x308758=md5(JSON['stringify'](_0x4a637f));if(this[_0x1988('0x1')]!==_0x308758){this['md5']=_0x308758;io['to'](util[_0x1988('0x18')](_0x1988('0x19'),_0x4a637f[_0x1988('0x8')]))[_0x1988('0x1a')](_0x1988('0x1b'),_0x4a637f);}};module[_0x1988('0x1c')]=MailQueue;
\ No newline at end of file
+var _0xf6fd=['length','online','mailPause','available','name','mail:queue:%s','emit','mail_queue:save','exports','lodash','md5','util','ioredis','redis','defaults','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','map','_rr','loggedIn','paused'];(function(_0xbca161,_0x4ff432){var _0x16b108=function(_0x1f0463){while(--_0x1f0463){_0xbca161['push'](_0xbca161['shift']());}};_0x16b108(++_0x4ff432);}(_0xf6fd,0xbd));var _0xdf6f=function(_0x45cd26,_0x5f2575){_0x45cd26=_0x45cd26-0x0;var _0x3801a6=_0xf6fd[_0x45cd26];return _0x3801a6;};'use strict';var _=require(_0xdf6f('0x0'));var md5=require(_0xdf6f('0x1'));var util=require(_0xdf6f('0x2'));var Redis=require(_0xdf6f('0x3'));var config=require('../../../config/environment');config[_0xdf6f('0x4')]=_[_0xdf6f('0x5')](config['redis'],{'host':_0xdf6f('0x6'),'port':0x18eb});var io=require(_0xdf6f('0x7'))(new Redis(config['redis']));function MailQueue(_0x26aedf){this['id']=_0x26aedf['id']||0x0;this['name']=_0x26aedf['name']||'';this[_0xdf6f('0x8')]=_0x26aedf['timeout']||0xa;this[_0xdf6f('0x9')]=_0x26aedf[_0xdf6f('0x9')]||_0xdf6f('0xa');this[_0xdf6f('0xb')]=_0x26aedf[_0xdf6f('0xb')];this['mapAgentsId']={};this[_0xdf6f('0xc')]=0x0;this[_0xdf6f('0x1')]='';this[_0xdf6f('0xd')]();this[_0xdf6f('0xe')]();}MailQueue[_0xdf6f('0xf')][_0xdf6f('0xd')]=function(){var _0x3eee55=this[_0xdf6f('0x10')]['_rr'];this[_0xdf6f('0x10')]=_[_0xdf6f('0x11')](this[_0xdf6f('0xb')],'id');this[_0xdf6f('0x10')][_0xdf6f('0x12')]=_0x3eee55;};MailQueue['prototype']['updateRealtime']=function(){this[_0xdf6f('0x13')]=0x0;this[_0xdf6f('0x14')]=0x0;for(var _0x3a4094=0x0;_0x3a4094<this['Agents'][_0xdf6f('0x15')];_0x3a4094+=0x1){if(this['Agents'][_0x3a4094][_0xdf6f('0x16')]){this[_0xdf6f('0x13')]+=0x1;}if(this[_0xdf6f('0xb')][_0x3a4094][_0xdf6f('0x17')]){this[_0xdf6f('0x14')]+=0x1;}}this[_0xdf6f('0x18')]=this[_0xdf6f('0x13')]-this[_0xdf6f('0x14')];this[_0xdf6f('0x18')]=this[_0xdf6f('0x18')]>=0x0?this[_0xdf6f('0x18')]:0x0;var _0x3b4294={'id':this['id'],'available':this[_0xdf6f('0x18')],'loggedIn':this[_0xdf6f('0x13')],'name':this[_0xdf6f('0x19')],'paused':this[_0xdf6f('0x14')],'waiting':this[_0xdf6f('0xc')]};var _0x1778e3=md5(JSON['stringify'](_0x3b4294));if(this[_0xdf6f('0x1')]!==_0x1778e3){this[_0xdf6f('0x1')]=_0x1778e3;io['to'](util['format'](_0xdf6f('0x1a'),_0x3b4294['name']))[_0xdf6f('0x1b')](_0xdf6f('0x1c'),_0x3b4294);}};module[_0xdf6f('0x1d')]=MailQueue;
\ No newline at end of file
index 1ce4ac9..bad5e2c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x95411e,_0x38b4c3){var _0x2c8718=function(_0x35c672){while(--_0x35c672){_0x95411e['push'](_0x95411e['shift']());}};_0x2c8718(++_0x38b4c3);}(_0x1261,0x144));var _0x1126=function(_0xea98ab,_0x297344){_0xea98ab=_0xea98ab-0x0;var _0x39058e=_0x1261[_0xea98ab];return _0x39058e;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0<this['Agents'][_0x1126('0x16')];_0x53a8f0+=0x1){if(this[_0x1126('0xc')][_0x53a8f0][_0x1126('0x17')]){this['loggedIn']+=0x1;}if(this[_0x1126('0xc')][_0x53a8f0]['openchannelPause']){this[_0x1126('0x15')]+=0x1;}}this[_0x1126('0x18')]=this[_0x1126('0x14')]-this['paused'];this[_0x1126('0x18')]=this[_0x1126('0x18')]>=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue;
\ No newline at end of file
+var _0x5fc3=['format','openchannel:queue:%s','name','emit','openchannel_queue:save','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','prototype','loggedIn','paused','openchannelPause','available'];(function(_0xf40d11,_0xb4dd63){var _0x2c21c8=function(_0x14a2cc){while(--_0x14a2cc){_0xf40d11['push'](_0xf40d11['shift']());}};_0x2c21c8(++_0xb4dd63);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4fa438,_0x1f15a7){_0x4fa438=_0x4fa438-0x0;var _0x4e3958=_0x5fc3[_0x4fa438];return _0x4e3958;};'use strict';var _=require(_0x35fc('0x0'));var md5=require(_0x35fc('0x1'));var util=require('util');var Redis=require(_0x35fc('0x2'));var config=require(_0x35fc('0x3'));config[_0x35fc('0x4')]=_[_0x35fc('0x5')](config[_0x35fc('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x35fc('0x6'))(new Redis(config[_0x35fc('0x4')]));function OpenchannelQueue(_0x186a06){this['id']=_0x186a06['id']||0x0;this['name']=_0x186a06['name']||'';this[_0x35fc('0x7')]=_0x186a06['timeout']||0xa;this[_0x35fc('0x8')]=_0x186a06[_0x35fc('0x8')]||_0x35fc('0x9');this[_0x35fc('0xa')]=_0x186a06[_0x35fc('0xa')];this[_0x35fc('0xb')]={};this[_0x35fc('0xc')]=0x0;this['md5']='';this[_0x35fc('0xd')]();this[_0x35fc('0xe')]();}OpenchannelQueue['prototype'][_0x35fc('0xd')]=function(){var _0x33f491=this['mapAgentsId'][_0x35fc('0xf')];this[_0x35fc('0xb')]=_['map'](this['Agents'],'id');this[_0x35fc('0xb')]['_rr']=_0x33f491;};OpenchannelQueue[_0x35fc('0x10')][_0x35fc('0xe')]=function(){this[_0x35fc('0x11')]=0x0;this[_0x35fc('0x12')]=0x0;for(var _0x38d9f2=0x0;_0x38d9f2<this['Agents']['length'];_0x38d9f2+=0x1){if(this['Agents'][_0x38d9f2]['online']){this[_0x35fc('0x11')]+=0x1;}if(this[_0x35fc('0xa')][_0x38d9f2][_0x35fc('0x13')]){this[_0x35fc('0x12')]+=0x1;}}this[_0x35fc('0x14')]=this[_0x35fc('0x11')]-this['paused'];this[_0x35fc('0x14')]=this[_0x35fc('0x14')]>=0x0?this['available']:0x0;var _0x41e165={'id':this['id'],'available':this[_0x35fc('0x14')],'loggedIn':this[_0x35fc('0x11')],'name':this['name'],'paused':this[_0x35fc('0x12')],'waiting':this[_0x35fc('0xc')]};var _0x465eb3=md5(JSON['stringify'](_0x41e165));if(this[_0x35fc('0x1')]!==_0x465eb3){this[_0x35fc('0x1')]=_0x465eb3;io['to'](util[_0x35fc('0x15')](_0x35fc('0x16'),_0x41e165[_0x35fc('0x17')]))[_0x35fc('0x18')](_0x35fc('0x19'),_0x41e165);}};module[_0x35fc('0x1a')]=OpenchannelQueue;
\ No newline at end of file
index 7b20002..c3f4e5d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9b87=['emit','sms_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','online','available','stringify','format','sms:queue:%s'];(function(_0x3bd1be,_0x18942b){var _0x361d8f=function(_0x302f8e){while(--_0x302f8e){_0x3bd1be['push'](_0x3bd1be['shift']());}};_0x361d8f(++_0x18942b);}(_0x9b87,0x8e));var _0x79b8=function(_0x514eff,_0x14e2b8){_0x514eff=_0x514eff-0x0;var _0x2608d6=_0x9b87[_0x514eff];return _0x2608d6;};'use strict';var _=require(_0x79b8('0x0'));var md5=require(_0x79b8('0x1'));var util=require(_0x79b8('0x2'));var Redis=require(_0x79b8('0x3'));var config=require(_0x79b8('0x4'));config[_0x79b8('0x5')]=_[_0x79b8('0x6')](config[_0x79b8('0x5')],{'host':_0x79b8('0x7'),'port':0x18eb});var io=require(_0x79b8('0x8'))(new Redis(config[_0x79b8('0x5')]));function SmsQueue(_0x399796){this['id']=_0x399796['id']||0x0;this[_0x79b8('0x9')]=_0x399796[_0x79b8('0x9')]||'';this[_0x79b8('0xa')]=_0x399796[_0x79b8('0xa')]||0xa;this['strategy']=_0x399796['strategy']||'beepall';this['Agents']=_0x399796[_0x79b8('0xb')];this[_0x79b8('0xc')]={};this[_0x79b8('0xd')]=0x0;this['md5']='';this[_0x79b8('0xe')]();this[_0x79b8('0xf')]();}SmsQueue[_0x79b8('0x10')]['updateRouting']=function(){var _0x5a4683=this[_0x79b8('0xc')][_0x79b8('0x11')];this[_0x79b8('0xc')]=_[_0x79b8('0x12')](this[_0x79b8('0xb')],'id');this[_0x79b8('0xc')][_0x79b8('0x11')]=_0x5a4683;};SmsQueue[_0x79b8('0x10')][_0x79b8('0xf')]=function(){this[_0x79b8('0x13')]=0x0;this[_0x79b8('0x14')]=0x0;for(var _0x59e229=0x0;_0x59e229<this[_0x79b8('0xb')]['length'];_0x59e229+=0x1){if(this['Agents'][_0x59e229][_0x79b8('0x15')]){this[_0x79b8('0x13')]+=0x1;}if(this[_0x79b8('0xb')][_0x59e229]['smsPause']){this[_0x79b8('0x14')]+=0x1;}}this['available']=this['loggedIn']-this[_0x79b8('0x14')];this[_0x79b8('0x16')]=this[_0x79b8('0x16')]>=0x0?this[_0x79b8('0x16')]:0x0;var _0x383a34={'id':this['id'],'available':this[_0x79b8('0x16')],'loggedIn':this['loggedIn'],'name':this[_0x79b8('0x9')],'paused':this['paused'],'waiting':this['waiting']};var _0x9bcb94=md5(JSON[_0x79b8('0x17')](_0x383a34));if(this[_0x79b8('0x1')]!==_0x9bcb94){this[_0x79b8('0x1')]=_0x9bcb94;io['to'](util[_0x79b8('0x18')](_0x79b8('0x19'),_0x383a34[_0x79b8('0x9')]))[_0x79b8('0x1a')](_0x79b8('0x1b'),_0x383a34);}};module['exports']=SmsQueue;
\ No newline at end of file
+var _0xe2cc=['timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','length','smsPause','paused','available','format','sms:queue:%s','name','emit','sms_queue:save','lodash','md5','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x394635,_0x14e475){var _0x2009bf=function(_0x1b6c26){while(--_0x1b6c26){_0x394635['push'](_0x394635['shift']());}};_0x2009bf(++_0x14e475);}(_0xe2cc,0x69));var _0xce2c=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xe2cc[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0xce2c('0x0'));var md5=require(_0xce2c('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0xce2c('0x2'));config[_0xce2c('0x3')]=_[_0xce2c('0x4')](config[_0xce2c('0x3')],{'host':_0xce2c('0x5'),'port':0x18eb});var io=require(_0xce2c('0x6'))(new Redis(config[_0xce2c('0x3')]));function SmsQueue(_0x16312a){this['id']=_0x16312a['id']||0x0;this['name']=_0x16312a['name']||'';this[_0xce2c('0x7')]=_0x16312a[_0xce2c('0x7')]||0xa;this[_0xce2c('0x8')]=_0x16312a[_0xce2c('0x8')]||_0xce2c('0x9');this[_0xce2c('0xa')]=_0x16312a['Agents'];this[_0xce2c('0xb')]={};this[_0xce2c('0xc')]=0x0;this[_0xce2c('0x1')]='';this[_0xce2c('0xd')]();this[_0xce2c('0xe')]();}SmsQueue[_0xce2c('0xf')][_0xce2c('0xd')]=function(){var _0x6fc2c3=this[_0xce2c('0xb')][_0xce2c('0x10')];this[_0xce2c('0xb')]=_[_0xce2c('0x11')](this[_0xce2c('0xa')],'id');this[_0xce2c('0xb')][_0xce2c('0x10')]=_0x6fc2c3;};SmsQueue['prototype']['updateRealtime']=function(){this[_0xce2c('0x12')]=0x0;this['paused']=0x0;for(var _0x214c62=0x0;_0x214c62<this[_0xce2c('0xa')][_0xce2c('0x13')];_0x214c62+=0x1){if(this[_0xce2c('0xa')][_0x214c62]['online']){this[_0xce2c('0x12')]+=0x1;}if(this[_0xce2c('0xa')][_0x214c62][_0xce2c('0x14')]){this[_0xce2c('0x15')]+=0x1;}}this[_0xce2c('0x16')]=this[_0xce2c('0x12')]-this[_0xce2c('0x15')];this['available']=this[_0xce2c('0x16')]>=0x0?this[_0xce2c('0x16')]:0x0;var _0x383085={'id':this['id'],'available':this[_0xce2c('0x16')],'loggedIn':this[_0xce2c('0x12')],'name':this['name'],'paused':this[_0xce2c('0x15')],'waiting':this[_0xce2c('0xc')]};var _0x591921=md5(JSON['stringify'](_0x383085));if(this[_0xce2c('0x1')]!==_0x591921){this[_0xce2c('0x1')]=_0x591921;io['to'](util[_0xce2c('0x17')](_0xce2c('0x18'),_0x383085[_0xce2c('0x19')]))[_0xce2c('0x1a')](_0xce2c('0x1b'),_0x383085);}};module['exports']=SmsQueue;
\ No newline at end of file
index 926d56f..e97f882 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x493d=['Agents','mapAgentsId','md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','whatsappPause','available','waiting','stringify','format','whatsapp:queue:%s','whatsapp_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x416cdc,_0x213b87){var _0x1931ce=function(_0x1dc762){while(--_0x1dc762){_0x416cdc['push'](_0x416cdc['shift']());}};_0x1931ce(++_0x213b87);}(_0x493d,0xae));var _0xd493=function(_0x107741,_0x135bfd){_0x107741=_0x107741-0x0;var _0x42f9e1=_0x493d[_0x107741];return _0x42f9e1;};'use strict';var _=require(_0xd493('0x0'));var md5=require('md5');var util=require(_0xd493('0x1'));var Redis=require(_0xd493('0x2'));var config=require(_0xd493('0x3'));config[_0xd493('0x4')]=_[_0xd493('0x5')](config[_0xd493('0x4')],{'host':_0xd493('0x6'),'port':0x18eb});var io=require(_0xd493('0x7'))(new Redis(config[_0xd493('0x4')]));function WhatsappQueue(_0xef45c4){this['id']=_0xef45c4['id']||0x0;this[_0xd493('0x8')]=_0xef45c4[_0xd493('0x8')]||'';this['timeout']=_0xef45c4[_0xd493('0x9')]||0xa;this['strategy']=_0xef45c4[_0xd493('0xa')]||_0xd493('0xb');this[_0xd493('0xc')]=_0xef45c4[_0xd493('0xc')];this[_0xd493('0xd')]={};this['waiting']=0x0;this[_0xd493('0xe')]='';this[_0xd493('0xf')]();this[_0xd493('0x10')]();}WhatsappQueue[_0xd493('0x11')]['updateRouting']=function(){var _0x1838b2=this[_0xd493('0xd')][_0xd493('0x12')];this['mapAgentsId']=_[_0xd493('0x13')](this['Agents'],'id');this[_0xd493('0xd')][_0xd493('0x12')]=_0x1838b2;};WhatsappQueue[_0xd493('0x11')]['updateRealtime']=function(){this[_0xd493('0x14')]=0x0;this[_0xd493('0x15')]=0x0;for(var _0x194f7a=0x0;_0x194f7a<this[_0xd493('0xc')][_0xd493('0x16')];_0x194f7a+=0x1){if(this[_0xd493('0xc')][_0x194f7a]['online']){this['loggedIn']+=0x1;}if(this[_0xd493('0xc')][_0x194f7a][_0xd493('0x17')]){this[_0xd493('0x15')]+=0x1;}}this[_0xd493('0x18')]=this['loggedIn']-this[_0xd493('0x15')];this['available']=this['available']>=0x0?this['available']:0x0;var _0x1dad59={'id':this['id'],'available':this[_0xd493('0x18')],'loggedIn':this[_0xd493('0x14')],'name':this[_0xd493('0x8')],'paused':this[_0xd493('0x15')],'waiting':this[_0xd493('0x19')]};var _0xf61bcc=md5(JSON[_0xd493('0x1a')](_0x1dad59));if(this[_0xd493('0xe')]!==_0xf61bcc){this['md5']=_0xf61bcc;io['to'](util[_0xd493('0x1b')](_0xd493('0x1c'),_0x1dad59[_0xd493('0x8')]))['emit'](_0xd493('0x1d'),_0x1dad59);}};module[_0xd493('0x1e')]=WhatsappQueue;
\ No newline at end of file
+var _0xa40d=['strategy','beepall','Agents','mapAgentsId','md5','updateRouting','updateRealtime','prototype','_rr','loggedIn','length','online','whatsappPause','paused','available','waiting','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout'];(function(_0x41ed2f,_0xc2c150){var _0xd966eb=function(_0x83013a){while(--_0x83013a){_0x41ed2f['push'](_0x41ed2f['shift']());}};_0xd966eb(++_0xc2c150);}(_0xa40d,0x18e));var _0xda40=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xa40d[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0xda40('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xda40('0x1'));var config=require(_0xda40('0x2'));config[_0xda40('0x3')]=_[_0xda40('0x4')](config[_0xda40('0x3')],{'host':_0xda40('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function WhatsappQueue(_0x4685d4){this['id']=_0x4685d4['id']||0x0;this['name']=_0x4685d4[_0xda40('0x6')]||'';this['timeout']=_0x4685d4[_0xda40('0x7')]||0xa;this[_0xda40('0x8')]=_0x4685d4[_0xda40('0x8')]||_0xda40('0x9');this[_0xda40('0xa')]=_0x4685d4[_0xda40('0xa')];this[_0xda40('0xb')]={};this['waiting']=0x0;this[_0xda40('0xc')]='';this[_0xda40('0xd')]();this[_0xda40('0xe')]();}WhatsappQueue[_0xda40('0xf')][_0xda40('0xd')]=function(){var _0x1b1a9c=this[_0xda40('0xb')][_0xda40('0x10')];this[_0xda40('0xb')]=_['map'](this[_0xda40('0xa')],'id');this[_0xda40('0xb')][_0xda40('0x10')]=_0x1b1a9c;};WhatsappQueue['prototype'][_0xda40('0xe')]=function(){this[_0xda40('0x11')]=0x0;this['paused']=0x0;for(var _0x257a7b=0x0;_0x257a7b<this['Agents'][_0xda40('0x12')];_0x257a7b+=0x1){if(this[_0xda40('0xa')][_0x257a7b][_0xda40('0x13')]){this[_0xda40('0x11')]+=0x1;}if(this[_0xda40('0xa')][_0x257a7b][_0xda40('0x14')]){this[_0xda40('0x15')]+=0x1;}}this[_0xda40('0x16')]=this[_0xda40('0x11')]-this[_0xda40('0x15')];this[_0xda40('0x16')]=this['available']>=0x0?this['available']:0x0;var _0x20f696={'id':this['id'],'available':this[_0xda40('0x16')],'loggedIn':this[_0xda40('0x11')],'name':this[_0xda40('0x6')],'paused':this[_0xda40('0x15')],'waiting':this[_0xda40('0x17')]};var _0x360e44=md5(JSON['stringify'](_0x20f696));if(this[_0xda40('0xc')]!==_0x360e44){this[_0xda40('0xc')]=_0x360e44;io['to'](util[_0xda40('0x18')](_0xda40('0x19'),_0x20f696[_0xda40('0x6')]))[_0xda40('0x1a')](_0xda40('0x1b'),_0x20f696);}};module[_0xda40('0x1c')]=WhatsappQueue;
\ No newline at end of file
index 4503736..6ab8163 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime;
\ No newline at end of file
+var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime;
\ No newline at end of file
index 302d0ca..b414834 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5695=['updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','Request','UpdateChatInteraction'];(function(_0x48ce41,_0x5b31e3){var _0x15595c=function(_0x2c3888){while(--_0x2c3888){_0x48ce41['push'](_0x48ce41['shift']());}};_0x15595c(++_0x5b31e3);}(_0x5695,0xe4));var _0x5569=function(_0x4264bf,_0x39db0f){_0x4264bf=_0x4264bf-0x0;var _0x515e5f=_0x5695[_0x4264bf];return _0x515e5f;};'use strict';var client=require(_0x5569('0x0'));exports['update']=function(_0x490f08,_0x392d8e){return client[_0x5569('0x1')](_0x5569('0x2'),{'body':_0x392d8e,'options':{'where':{'id':_0x490f08}},'log':_0x5569('0x3')});};exports[_0x5569('0x4')]=function(_0x5d7c9b,_0x182d5e){return client[_0x5569('0x1')](_0x5569('0x5'),{'body':_0x182d5e,'options':{'where':{'id':_0x5d7c9b}},'log':_0x5569('0x6')});};
\ No newline at end of file
+var _0x37fa=['update','Request','addTagsToChatInteraction','../client'];(function(_0x53a828,_0x55cb8b){var _0x417c69=function(_0x42564c){while(--_0x42564c){_0x53a828['push'](_0x53a828['shift']());}};_0x417c69(++_0x55cb8b);}(_0x37fa,0x13f));var _0xa37f=function(_0x5d8e11,_0x1b2574){_0x5d8e11=_0x5d8e11-0x0;var _0x25fa53=_0x37fa[_0x5d8e11];return _0x25fa53;};'use strict';var client=require(_0xa37f('0x0'));exports[_0xa37f('0x1')]=function(_0xb0f696,_0x8ed71e){return client[_0xa37f('0x2')]('UpdateChatInteraction',{'body':_0x8ed71e,'options':{'where':{'id':_0xb0f696}},'log':'updateChatInteraction'});};exports['addTags']=function(_0x1ea99e,_0x229ffe){return client[_0xa37f('0x2')]('AddTagsToChatInteraction',{'body':_0x229ffe,'options':{'where':{'id':_0x1ea99e}},'log':_0xa37f('0x3')});};
\ No newline at end of file
index 0a398c9..c3de2c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x11bd=['create','Request','CreateChatMessage','createChatMessage','../client'];(function(_0xa1077a,_0x19049d){var _0x5d1859=function(_0x54d1c0){while(--_0x54d1c0){_0xa1077a['push'](_0xa1077a['shift']());}};_0x5d1859(++_0x19049d);}(_0x11bd,0x1ee));var _0xd11b=function(_0x347842,_0x44a39c){_0x347842=_0x347842-0x0;var _0x2748d0=_0x11bd[_0x347842];return _0x2748d0;};'use strict';var client=require(_0xd11b('0x0'));exports[_0xd11b('0x1')]=function(_0x262dde){return client[_0xd11b('0x2')](_0xd11b('0x3'),{'body':_0x262dde,'log':_0xd11b('0x4')});};
\ No newline at end of file
+var _0x25a7=['CreateChatMessage','../client','Request'];(function(_0x24eae8,_0x45613e){var _0x50e2f0=function(_0x5ec66f){while(--_0x5ec66f){_0x24eae8['push'](_0x24eae8['shift']());}};_0x50e2f0(++_0x45613e);}(_0x25a7,0xb2));var _0x725a=function(_0x31de5d,_0x1cbe7d){_0x31de5d=_0x31de5d-0x0;var _0x31ad05=_0x25a7[_0x31de5d];return _0x31ad05;};'use strict';var client=require(_0x725a('0x0'));exports['create']=function(_0x13d61d){return client[_0x725a('0x1')](_0x725a('0x2'),{'body':_0x13d61d,'log':'createChatMessage'});};
\ No newline at end of file
index 66e89a9..6b44eda 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2bae=['name','timeout','User','chatPause','../client','getChatQueues','Request','GetChatQueue'];(function(_0x475740,_0x2e08c8){var _0x31da43=function(_0x4d23aa){while(--_0x4d23aa){_0x475740['push'](_0x475740['shift']());}};_0x31da43(++_0x2e08c8);}(_0x2bae,0x164));var _0xe2ba=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2bae[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xe2ba('0x0'));exports[_0xe2ba('0x1')]=function(){return function(){return client[_0xe2ba('0x2')](_0xe2ba('0x3'),{'options':{'raw':![],'attributes':['id',_0xe2ba('0x4'),_0xe2ba('0x5'),'strategy'],'include':[{'model':_0xe2ba('0x6'),'as':'Agents','attributes':['id',_0xe2ba('0x4'),'online',_0xe2ba('0x7')]}]},'log':_0xe2ba('0x1')});};};
\ No newline at end of file
+var _0x4403=['timeout','strategy','User','Agents','online','GetChatQueue'];(function(_0x20b9fc,_0x5dab92){var _0x511a2b=function(_0x292cbd){while(--_0x292cbd){_0x20b9fc['push'](_0x20b9fc['shift']());}};_0x511a2b(++_0x5dab92);}(_0x4403,0x179));var _0x3440=function(_0x46efdf,_0x553044){_0x46efdf=_0x46efdf-0x0;var _0x1a12b2=_0x4403[_0x46efdf];return _0x1a12b2;};'use strict';var client=require('../client');exports['getChatQueues']=function(){return function(){return client['Request'](_0x3440('0x0'),{'options':{'raw':![],'attributes':['id','name',_0x3440('0x1'),_0x3440('0x2')],'include':[{'model':_0x3440('0x3'),'as':_0x3440('0x4'),'attributes':['id','name',_0x3440('0x5'),'chatPause']}]},'log':'getChatQueues'});};};
\ No newline at end of file
index bbebb93..0c27c83 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xffdc=['UpdateChatQueueReport','../client','create','Request','CreateChatQueueReport','update'];(function(_0x12cdb4,_0x356e67){var _0x3cde1e=function(_0x17ec35){while(--_0x17ec35){_0x12cdb4['push'](_0x12cdb4['shift']());}};_0x3cde1e(++_0x356e67);}(_0xffdc,0x7f));var _0xcffd=function(_0x46bc75,_0x3fda3b){_0x46bc75=_0x46bc75-0x0;var _0x3294c5=_0xffdc[_0x46bc75];return _0x3294c5;};'use strict';var client=require(_0xcffd('0x0'));exports[_0xcffd('0x1')]=function(_0x56b164){return client[_0xcffd('0x2')](_0xcffd('0x3'),{'body':_0x56b164,'log':'CreateChatQueueReport'});};exports[_0xcffd('0x4')]=function(_0x234c50,_0x37c566){return client[_0xcffd('0x2')](_0xcffd('0x5'),{'body':_0x37c566,'options':{'where':{'uniqueid':_0x234c50},'order':[['id','DESC']],'limit':0x1},'log':_0xcffd('0x5')});};
\ No newline at end of file
+var _0x6183=['update','UpdateChatQueueReport','DESC','create','Request','CreateChatQueueReport'];(function(_0x3001d0,_0x3cf8e5){var _0xda85f3=function(_0x332aec){while(--_0x332aec){_0x3001d0['push'](_0x3001d0['shift']());}};_0xda85f3(++_0x3cf8e5);}(_0x6183,0x19b));var _0x3618=function(_0x478c8a,_0x9afc92){_0x478c8a=_0x478c8a-0x0;var _0x3b6b3e=_0x6183[_0x478c8a];return _0x3b6b3e;};'use strict';var client=require('../client');exports[_0x3618('0x0')]=function(_0x3a9324){return client[_0x3618('0x1')]('CreateChatQueueReport',{'body':_0x3a9324,'log':_0x3618('0x2')});};exports[_0x3618('0x3')]=function(_0x176f61,_0x2d62a7){return client[_0x3618('0x1')](_0x3618('0x4'),{'body':_0x2d62a7,'options':{'where':{'uniqueid':_0x176f61},'order':[['id',_0x3618('0x5')]],'limit':0x1},'log':_0x3618('0x4')});};
\ No newline at end of file
index ab024a9..c3eed67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x4a0f16,_0x21ba18){var _0x45d653=function(_0x137e2c){while(--_0x137e2c){_0x4a0f16['push'](_0x4a0f16['shift']());}};_0x45d653(++_0x21ba18);}(_0x7a54,0x106));var _0x47a5=function(_0x4a163f,_0x2fefe5){_0x4a163f=_0x4a163f-0x0;var _0x44f7f4=_0x7a54[_0x4a163f];return _0x44f7f4;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});};
\ No newline at end of file
+var _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0xda6ad1,_0x5f09e3){var _0xedc3a5=function(_0x5459d7){while(--_0x5459d7){_0xda6ad1['push'](_0xda6ad1['shift']());}};_0xedc3a5(++_0x5f09e3);}(_0x7a54,0x106));var _0x47a5=function(_0xe75bee,_0x22e5b2){_0xe75bee=_0xe75bee-0x0;var _0x38f6e5=_0x7a54[_0xe75bee];return _0x38f6e5;};'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 8873a93..8928d45 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1590=['Request','CreateFaxMessage','../client','create'];(function(_0x5da4e0,_0x4e560a){var _0x532670=function(_0x14649c){while(--_0x14649c){_0x5da4e0['push'](_0x5da4e0['shift']());}};_0x532670(++_0x4e560a);}(_0x1590,0x1ee));var _0x0159=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x1590[_0x1f9f37];return _0x21c080;};'use strict';var client=require(_0x0159('0x0'));exports[_0x0159('0x1')]=function(_0x469749){return client[_0x0159('0x2')](_0x0159('0x3'),{'body':_0x469749,'log':'createFaxMessage'});};
\ No newline at end of file
+var _0x3129=['../client','create','CreateFaxMessage'];(function(_0x1931e9,_0x5603b5){var _0x5a87f1=function(_0x22ca92){while(--_0x22ca92){_0x1931e9['push'](_0x1931e9['shift']());}};_0x5a87f1(++_0x5603b5);}(_0x3129,0xfc));var _0x9312=function(_0x5e976a,_0x36f04f){_0x5e976a=_0x5e976a-0x0;var _0x4a59db=_0x3129[_0x5e976a];return _0x4a59db;};'use strict';var client=require(_0x9312('0x0'));exports[_0x9312('0x1')]=function(_0x93f98b){return client['Request'](_0x9312('0x2'),{'body':_0x93f98b,'log':'createFaxMessage'});};
\ No newline at end of file
index 7de4ccf..6557649 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c65=['User','Agents','faxPause','../client','getFaxQueues','GetFaxQueue','name','timeout','strategy'];(function(_0x4a782b,_0x55584a){var _0x5cb5a0=function(_0x3010ed){while(--_0x3010ed){_0x4a782b['push'](_0x4a782b['shift']());}};_0x5cb5a0(++_0x55584a);}(_0x9c65,0x159));var _0x59c6=function(_0x2898f7,_0x283d1d){_0x2898f7=_0x2898f7-0x0;var _0x2c6fc5=_0x9c65[_0x2898f7];return _0x2c6fc5;};'use strict';var client=require(_0x59c6('0x0'));exports[_0x59c6('0x1')]=function(){return function(){return client['Request'](_0x59c6('0x2'),{'options':{'raw':![],'attributes':['id',_0x59c6('0x3'),_0x59c6('0x4'),_0x59c6('0x5')],'include':[{'model':_0x59c6('0x6'),'as':_0x59c6('0x7'),'attributes':['id','name','online',_0x59c6('0x8')]}]},'log':'getFaxQueues'});};};
\ No newline at end of file
+var _0x9387=['faxPause','Request','GetFaxQueue','name','User','Agents','online'];(function(_0xe0aac4,_0x3aa252){var _0x4ed1cd=function(_0x196633){while(--_0x196633){_0xe0aac4['push'](_0xe0aac4['shift']());}};_0x4ed1cd(++_0x3aa252);}(_0x9387,0x1d6));var _0x7938=function(_0x36c888,_0x13398b){_0x36c888=_0x36c888-0x0;var _0x56a597=_0x9387[_0x36c888];return _0x56a597;};'use strict';var client=require('../client');exports['getFaxQueues']=function(){return function(){return client[_0x7938('0x0')](_0x7938('0x1'),{'options':{'raw':![],'attributes':['id',_0x7938('0x2'),'timeout','strategy'],'include':[{'model':_0x7938('0x3'),'as':_0x7938('0x4'),'attributes':['id',_0x7938('0x2'),_0x7938('0x5'),_0x7938('0x6')]}]},'log':'getFaxQueues'});};};
\ No newline at end of file
index 729bbd1..7583854 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x60de=['create','Request','CreateFaxQueueReport','UpdateFaxQueueReport','DESC','../client'];(function(_0x4aa784,_0x264dbd){var _0xfe46c=function(_0x4463cd){while(--_0x4463cd){_0x4aa784['push'](_0x4aa784['shift']());}};_0xfe46c(++_0x264dbd);}(_0x60de,0x77));var _0xe60d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x60de[_0x19950b];return _0x3c6b41;};'use strict';var client=require(_0xe60d('0x0'));exports[_0xe60d('0x1')]=function(_0x2f6bc3){return client[_0xe60d('0x2')]('CreateFaxQueueReport',{'body':_0x2f6bc3,'log':_0xe60d('0x3')});};exports['update']=function(_0xda929c,_0xc3127d){return client[_0xe60d('0x2')](_0xe60d('0x4'),{'body':_0xc3127d,'options':{'where':{'uniqueid':_0xda929c},'order':[['id',_0xe60d('0x5')]],'limit':0x1},'log':'UpdateFaxQueueReport'});};
\ No newline at end of file
+var _0x5dc7=['UpdateFaxQueueReport','../client','Request','update'];(function(_0x37c8fd,_0x34b282){var _0x27412c=function(_0x3d087f){while(--_0x3d087f){_0x37c8fd['push'](_0x37c8fd['shift']());}};_0x27412c(++_0x34b282);}(_0x5dc7,0x191));var _0x75dc=function(_0x5b05e2,_0x268950){_0x5b05e2=_0x5b05e2-0x0;var _0x410e34=_0x5dc7[_0x5b05e2];return _0x410e34;};'use strict';var client=require(_0x75dc('0x0'));exports['create']=function(_0x120af9){return client[_0x75dc('0x1')]('CreateFaxQueueReport',{'body':_0x120af9,'log':'CreateFaxQueueReport'});};exports[_0x75dc('0x2')]=function(_0x41ab6d,_0x50071f){return client[_0x75dc('0x1')](_0x75dc('0x3'),{'body':_0x50071f,'options':{'where':{'uniqueid':_0x41ab6d},'order':[['id','DESC']],'limit':0x1},'log':_0x75dc('0x3')});};
\ No newline at end of file
index 01a359f..f1ea668 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0747=['Interval','Intervals','interval','getIntervals','GetInterval','name'];(function(_0x4e4622,_0x3cb625){var _0x24505d=function(_0x75d2e2){while(--_0x75d2e2){_0x4e4622['push'](_0x4e4622['shift']());}};_0x24505d(++_0x3cb625);}(_0x0747,0x1e4));var _0x7074=function(_0x496436,_0x2a46c1){_0x496436=_0x496436-0x0;var _0x8c4fc5=_0x0747[_0x496436];return _0x8c4fc5;};'use strict';var client=require('../client');exports['getIntervals']=function(){return function(){return client['Request'](_0x7074('0x0'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x7074('0x1')],'include':[{'model':_0x7074('0x2'),'as':_0x7074('0x3'),'attributes':['id',_0x7074('0x1'),_0x7074('0x4')]}]},'log':_0x7074('0x5')});};};
\ No newline at end of file
+var _0xaad4=['GetInterval','name','Interval','Intervals','../client','getIntervals'];(function(_0x3c3ae6,_0x15d3e7){var _0x258468=function(_0x3d04cd){while(--_0x3d04cd){_0x3c3ae6['push'](_0x3c3ae6['shift']());}};_0x258468(++_0x15d3e7);}(_0xaad4,0x190));var _0x4aad=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xaad4[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0x4aad('0x0'));exports[_0x4aad('0x1')]=function(){return function(){return client['Request'](_0x4aad('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x4aad('0x3')],'include':[{'model':_0x4aad('0x4'),'as':_0x4aad('0x5'),'attributes':['id',_0x4aad('0x3'),'interval']}]},'log':_0x4aad('0x1')});};};
\ No newline at end of file
index f3cacfd..72b5486 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7d25=['update','Request','UpdateMailInteraction','updateMailInteraction','addTags','addTagsToChatInteraction'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7d25,0x8a));var _0x57d2=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0x7d25[_0x3e44fa];return _0x2a0aba;};'use strict';var client=require('../client');exports[_0x57d2('0x0')]=function(_0x1537a7,_0x35bca8){return client[_0x57d2('0x1')](_0x57d2('0x2'),{'body':_0x35bca8,'options':{'where':{'id':_0x1537a7}},'log':_0x57d2('0x3')});};exports[_0x57d2('0x4')]=function(_0x5c1baa,_0x5337ca){return client['Request']('AddTagsToMailInteraction',{'body':_0x5337ca,'options':{'where':{'id':_0x5c1baa}},'log':_0x57d2('0x5')});};
\ No newline at end of file
+var _0x2a07=['updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x15106b,_0x4d96f6){var _0x521203=function(_0x4dbe23){while(--_0x4dbe23){_0x15106b['push'](_0x15106b['shift']());}};_0x521203(++_0x4d96f6);}(_0x2a07,0x74));var _0x72a0=function(_0x2e65ee,_0x29dad9){_0x2e65ee=_0x2e65ee-0x0;var _0x4c712a=_0x2a07[_0x2e65ee];return _0x4c712a;};'use strict';var client=require(_0x72a0('0x0'));exports[_0x72a0('0x1')]=function(_0x3ed8a9,_0x437db4){return client[_0x72a0('0x2')]('UpdateMailInteraction',{'body':_0x437db4,'options':{'where':{'id':_0x3ed8a9}},'log':_0x72a0('0x3')});};exports[_0x72a0('0x4')]=function(_0x135982,_0x45b155){return client[_0x72a0('0x2')](_0x72a0('0x5'),{'body':_0x45b155,'options':{'where':{'id':_0x135982}},'log':_0x72a0('0x6')});};
\ No newline at end of file
index ecb0242..b404411 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43b6=['CreateMailMessage','createMailMessage','create'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x43b6,0x179));var _0x643b=function(_0x462150,_0x48ac37){_0x462150=_0x462150-0x0;var _0x28a15c=_0x43b6[_0x462150];return _0x28a15c;};'use strict';var client=require('../client');exports[_0x643b('0x0')]=function(_0x30d1c8){return client['Request'](_0x643b('0x1'),{'body':_0x30d1c8,'log':_0x643b('0x2')});};
\ No newline at end of file
+var _0xb9e5=['create','Request','createMailMessage'];(function(_0xdbbc81,_0x1df854){var _0x108d6d=function(_0x3a95ad){while(--_0x3a95ad){_0xdbbc81['push'](_0xdbbc81['shift']());}};_0x108d6d(++_0x1df854);}(_0xb9e5,0xfc));var _0x5b9e=function(_0x143759,_0x249c49){_0x143759=_0x143759-0x0;var _0x4582be=_0xb9e5[_0x143759];return _0x4582be;};'use strict';var client=require('../client');exports[_0x5b9e('0x0')]=function(_0x2933e1){return client[_0x5b9e('0x1')]('CreateMailMessage',{'body':_0x2933e1,'log':_0x5b9e('0x2')});};
\ No newline at end of file
index 4e5817a..65f77e7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa671=['User','Agents','mailPause','getMailQueues','Request','GetMailQueue','name','timeout'];(function(_0xc9b215,_0x49ee80){var _0x356a0d=function(_0x1cad8b){while(--_0x1cad8b){_0xc9b215['push'](_0xc9b215['shift']());}};_0x356a0d(++_0x49ee80);}(_0xa671,0x153));var _0x1a67=function(_0x2b2e81,_0x8f4fd7){_0x2b2e81=_0x2b2e81-0x0;var _0x110630=_0xa671[_0x2b2e81];return _0x110630;};'use strict';var client=require('../client');exports[_0x1a67('0x0')]=function(){return function(){return client[_0x1a67('0x1')](_0x1a67('0x2'),{'options':{'raw':![],'attributes':['id',_0x1a67('0x3'),_0x1a67('0x4'),'strategy'],'include':[{'model':_0x1a67('0x5'),'as':_0x1a67('0x6'),'attributes':['id','name','online',_0x1a67('0x7')]}]},'log':_0x1a67('0x0')});};};
\ No newline at end of file
+var _0x6d48=['timeout','strategy','User','online','mailPause','../client','getMailQueues','GetMailQueue'];(function(_0x24453b,_0x53ffa9){var _0x3c741e=function(_0x18f26a){while(--_0x18f26a){_0x24453b['push'](_0x24453b['shift']());}};_0x3c741e(++_0x53ffa9);}(_0x6d48,0x135));var _0x86d4=function(_0x4113bc,_0x419549){_0x4113bc=_0x4113bc-0x0;var _0x174008=_0x6d48[_0x4113bc];return _0x174008;};'use strict';var client=require(_0x86d4('0x0'));exports[_0x86d4('0x1')]=function(){return function(){return client['Request'](_0x86d4('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x86d4('0x3'),_0x86d4('0x4')],'include':[{'model':_0x86d4('0x5'),'as':'Agents','attributes':['id','name',_0x86d4('0x6'),_0x86d4('0x7')]}]},'log':_0x86d4('0x1')});};};
\ No newline at end of file
index 64c8741..f7348fc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc32c=['CreateMailQueueReport','update','DESC','UpdateMailQueueReport','../client','create','Request'];(function(_0x31eb98,_0x592fa2){var _0x20cf3e=function(_0x5e30b1){while(--_0x5e30b1){_0x31eb98['push'](_0x31eb98['shift']());}};_0x20cf3e(++_0x592fa2);}(_0xc32c,0x162));var _0xcc32=function(_0x10df5c,_0x14c714){_0x10df5c=_0x10df5c-0x0;var _0x9fcba6=_0xc32c[_0x10df5c];return _0x9fcba6;};'use strict';var client=require(_0xcc32('0x0'));exports[_0xcc32('0x1')]=function(_0x2e9bcf){return client[_0xcc32('0x2')](_0xcc32('0x3'),{'body':_0x2e9bcf,'log':_0xcc32('0x3')});};exports[_0xcc32('0x4')]=function(_0x1a7b0c,_0x25e414){return client[_0xcc32('0x2')]('UpdateMailQueueReport',{'body':_0x25e414,'options':{'where':{'uniqueid':_0x1a7b0c},'order':[['id',_0xcc32('0x5')]],'limit':0x1},'log':_0xcc32('0x6')});};
\ No newline at end of file
+var _0x4e9c=['UpdateMailQueueReport','../client','create','CreateMailQueueReport','Request'];(function(_0x482393,_0x355061){var _0x4c07ae=function(_0x139328){while(--_0x139328){_0x482393['push'](_0x482393['shift']());}};_0x4c07ae(++_0x355061);}(_0x4e9c,0x9c));var _0xc4e9=function(_0x5c6731,_0x3c5a9d){_0x5c6731=_0x5c6731-0x0;var _0x1a6f21=_0x4e9c[_0x5c6731];return _0x1a6f21;};'use strict';var client=require(_0xc4e9('0x0'));exports[_0xc4e9('0x1')]=function(_0x444261){return client['Request'](_0xc4e9('0x2'),{'body':_0x444261,'log':_0xc4e9('0x2')});};exports['update']=function(_0xfd8971,_0x2cbc68){return client[_0xc4e9('0x3')](_0xc4e9('0x4'),{'body':_0x2cbc68,'options':{'where':{'uniqueid':_0xfd8971},'order':[['id','DESC']],'limit':0x1},'log':'UpdateMailQueueReport'});};
\ No newline at end of file
index d594207..aca5c3c 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe458=['updateOpenchannelInteraction','addTags','addTagsToChatInteraction','../client','Request','UpdateOpenchannelInteraction'];(function(_0x4d0662,_0x145963){var _0x6eea6d=function(_0x2def06){while(--_0x2def06){_0x4d0662['push'](_0x4d0662['shift']());}};_0x6eea6d(++_0x145963);}(_0xe458,0x69));var _0x8e45=function(_0x5758f4,_0x4735e6){_0x5758f4=_0x5758f4-0x0;var _0x1bcef0=_0xe458[_0x5758f4];return _0x1bcef0;};'use strict';var client=require(_0x8e45('0x0'));exports['update']=function(_0x36cf4c,_0x3d7d35){return client[_0x8e45('0x1')](_0x8e45('0x2'),{'body':_0x3d7d35,'options':{'where':{'id':_0x36cf4c}},'log':_0x8e45('0x3')});};exports[_0x8e45('0x4')]=function(_0x2544f3,_0x1fac86){return client['Request']('AddTagsToOpenchannelInteraction',{'body':_0x1fac86,'options':{'where':{'id':_0x2544f3}},'log':_0x8e45('0x5')});};
\ No newline at end of file
+var _0x438d=['../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x365dce,_0x507cd5){var _0x30581f=function(_0x779184){while(--_0x779184){_0x365dce['push'](_0x365dce['shift']());}};_0x30581f(++_0x507cd5);}(_0x438d,0x156));var _0xd438=function(_0x214bde,_0x575edb){_0x214bde=_0x214bde-0x0;var _0x14040c=_0x438d[_0x214bde];return _0x14040c;};'use strict';var client=require(_0xd438('0x0'));exports[_0xd438('0x1')]=function(_0x15d16a,_0x1faacf){return client[_0xd438('0x2')](_0xd438('0x3'),{'body':_0x1faacf,'options':{'where':{'id':_0x15d16a}},'log':_0xd438('0x4')});};exports['addTags']=function(_0x20200f,_0xb25b61){return client[_0xd438('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0xb25b61,'options':{'where':{'id':_0x20200f}},'log':_0xd438('0x5')});};
\ No newline at end of file
index 4db84b2..813948e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdc0a=['create','Request','createOpenchannelMessage'];(function(_0x382d6b,_0x15e2a8){var _0x4d5c19=function(_0x2acb93){while(--_0x2acb93){_0x382d6b['push'](_0x382d6b['shift']());}};_0x4d5c19(++_0x15e2a8);}(_0xdc0a,0x150));var _0xadc0=function(_0x57c2c7,_0x2851b6){_0x57c2c7=_0x57c2c7-0x0;var _0x12efc7=_0xdc0a[_0x57c2c7];return _0x12efc7;};'use strict';var client=require('../client');exports[_0xadc0('0x0')]=function(_0xd18618){return client[_0xadc0('0x1')]('CreateOpenchannelMessage',{'body':_0xd18618,'log':_0xadc0('0x2')});};
\ No newline at end of file
+var _0xcefb=['Request','CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x11742d,_0x56f928){var _0x569570=function(_0x2fea6d){while(--_0x2fea6d){_0x11742d['push'](_0x11742d['shift']());}};_0x569570(++_0x56f928);}(_0xcefb,0x177));var _0xbcef=function(_0x1b4ca6,_0x37f5d0){_0x1b4ca6=_0x1b4ca6-0x0;var _0x189463=_0xcefb[_0x1b4ca6];return _0x189463;};'use strict';var client=require(_0xbcef('0x0'));exports['create']=function(_0xb92be0){return client[_0xbcef('0x1')](_0xbcef('0x2'),{'body':_0xb92be0,'log':_0xbcef('0x3')});};
\ No newline at end of file
index 2b93a49..353a53d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf04c=['openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','name','strategy','User','Agents'];(function(_0x22c673,_0x4a3c2c){var _0x3a1c96=function(_0x5a8b97){while(--_0x5a8b97){_0x22c673['push'](_0x22c673['shift']());}};_0x3a1c96(++_0x4a3c2c);}(_0xf04c,0xfd));var _0xcf04=function(_0x25a74e,_0x2ac460){_0x25a74e=_0x25a74e-0x0;var _0x1635d7=_0xf04c[_0x25a74e];return _0x1635d7;};'use strict';var client=require(_0xcf04('0x0'));exports[_0xcf04('0x1')]=function(){return function(){return client[_0xcf04('0x2')](_0xcf04('0x3'),{'options':{'raw':![],'attributes':['id',_0xcf04('0x4'),'timeout',_0xcf04('0x5')],'include':[{'model':_0xcf04('0x6'),'as':_0xcf04('0x7'),'attributes':['id',_0xcf04('0x4'),'online',_0xcf04('0x8')]}]},'log':_0xcf04('0x1')});};};
\ No newline at end of file
+var _0xec1d=['User','Agents','name','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue','timeout','strategy'];(function(_0x19b710,_0xc2858c){var _0x13b42f=function(_0x1b4946){while(--_0x1b4946){_0x19b710['push'](_0x19b710['shift']());}};_0x13b42f(++_0xc2858c);}(_0xec1d,0x7c));var _0xdec1=function(_0x55ff57,_0x157169){_0x55ff57=_0x55ff57-0x0;var _0x3615f5=_0xec1d[_0x55ff57];return _0x3615f5;};'use strict';var client=require(_0xdec1('0x0'));exports[_0xdec1('0x1')]=function(){return function(){return client[_0xdec1('0x2')](_0xdec1('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xdec1('0x4'),_0xdec1('0x5')],'include':[{'model':_0xdec1('0x6'),'as':_0xdec1('0x7'),'attributes':['id',_0xdec1('0x8'),'online',_0xdec1('0x9')]}]},'log':_0xdec1('0x1')});};};
\ No newline at end of file
index a942382..4af119e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a5d=['DESC','../client','Request','CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport'];(function(_0x34f1e7,_0x566996){var _0x8155d2=function(_0x5b59b6){while(--_0x5b59b6){_0x34f1e7['push'](_0x34f1e7['shift']());}};_0x8155d2(++_0x566996);}(_0x3a5d,0x193));var _0xd3a5=function(_0x1ae73b,_0x1148bc){_0x1ae73b=_0x1ae73b-0x0;var _0x2fc85b=_0x3a5d[_0x1ae73b];return _0x2fc85b;};'use strict';var client=require(_0xd3a5('0x0'));exports['create']=function(_0x2257d8){return client[_0xd3a5('0x1')](_0xd3a5('0x2'),{'body':_0x2257d8,'log':_0xd3a5('0x2')});};exports[_0xd3a5('0x3')]=function(_0x505fcf,_0x4d9edb){return client[_0xd3a5('0x1')](_0xd3a5('0x4'),{'body':_0x4d9edb,'options':{'where':{'uniqueid':_0x505fcf},'order':[['id',_0xd3a5('0x5')]],'limit':0x1},'log':_0xd3a5('0x4')});};
\ No newline at end of file
+var _0x317b=['update','UpdateOpenchannelQueueReport','DESC','../client','create','Request','CreateOpenchannelQueueReport'];(function(_0x2b8f54,_0x4023e0){var _0x3514a2=function(_0xdf0545){while(--_0xdf0545){_0x2b8f54['push'](_0x2b8f54['shift']());}};_0x3514a2(++_0x4023e0);}(_0x317b,0x96));var _0xb317=function(_0x30d7fc,_0x44b881){_0x30d7fc=_0x30d7fc-0x0;var _0xd7b0f4=_0x317b[_0x30d7fc];return _0xd7b0f4;};'use strict';var client=require(_0xb317('0x0'));exports[_0xb317('0x1')]=function(_0x101a29){return client[_0xb317('0x2')](_0xb317('0x3'),{'body':_0x101a29,'log':_0xb317('0x3')});};exports[_0xb317('0x4')]=function(_0x3bc8d7,_0x1393dd){return client[_0xb317('0x2')](_0xb317('0x5'),{'body':_0x1393dd,'options':{'where':{'uniqueid':_0x3bc8d7},'order':[['id',_0xb317('0x6')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});};
\ No newline at end of file
index be12a85..9567b76 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1354=['update','Request','UpdateSmsInteraction','updateSmsInteraction','addTagsToSmsInteraction','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1354,0x95));var _0x4135=function(_0x320cb3,_0x49c0cf){_0x320cb3=_0x320cb3-0x0;var _0x899c86=_0x1354[_0x320cb3];return _0x899c86;};'use strict';var client=require(_0x4135('0x0'));exports[_0x4135('0x1')]=function(_0x3cb9a9,_0x27fa62){return client[_0x4135('0x2')](_0x4135('0x3'),{'body':_0x27fa62,'options':{'where':{'id':_0x3cb9a9}},'log':_0x4135('0x4')});};exports['addTags']=function(_0x2c75a3,_0x4ed434){return client[_0x4135('0x2')]('AddTagsToSmsInteraction',{'body':_0x4ed434,'options':{'where':{'id':_0x2c75a3}},'log':_0x4135('0x5')});};
\ No newline at end of file
+var _0x616c=['updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','update','Request','UpdateSmsInteraction'];(function(_0x1356ef,_0x495929){var _0x31d502=function(_0x53585d){while(--_0x53585d){_0x1356ef['push'](_0x1356ef['shift']());}};_0x31d502(++_0x495929);}(_0x616c,0x1b6));var _0xc616=function(_0x474f78,_0x22aab9){_0x474f78=_0x474f78-0x0;var _0x274c3d=_0x616c[_0x474f78];return _0x274c3d;};'use strict';var client=require('../client');exports[_0xc616('0x0')]=function(_0xebad2f,_0x5a267e){return client[_0xc616('0x1')](_0xc616('0x2'),{'body':_0x5a267e,'options':{'where':{'id':_0xebad2f}},'log':_0xc616('0x3')});};exports[_0xc616('0x4')]=function(_0x52b492,_0x5f2d88){return client[_0xc616('0x1')](_0xc616('0x5'),{'body':_0x5f2d88,'options':{'where':{'id':_0x52b492}},'log':_0xc616('0x6')});};
\ No newline at end of file
index bbe1e36..c3eb5c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x767c=['CreateSmsMessage','createSmsMessage','../client','create'];(function(_0x37d557,_0xadd016){var _0xd2bcf3=function(_0x3a3382){while(--_0x3a3382){_0x37d557['push'](_0x37d557['shift']());}};_0xd2bcf3(++_0xadd016);}(_0x767c,0xf6));var _0xc767=function(_0x4cd6ec,_0x50391c){_0x4cd6ec=_0x4cd6ec-0x0;var _0x181b2b=_0x767c[_0x4cd6ec];return _0x181b2b;};'use strict';var client=require(_0xc767('0x0'));exports[_0xc767('0x1')]=function(_0x3a8f57){return client['Request'](_0xc767('0x2'),{'body':_0x3a8f57,'log':_0xc767('0x3')});};
\ No newline at end of file
+var _0x8675=['create','CreateSmsMessage','createSmsMessage','../client'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x8675,0x9f));var _0x5867=function(_0x1db923,_0x426bc8){_0x1db923=_0x1db923-0x0;var _0x2bf565=_0x8675[_0x1db923];return _0x2bf565;};'use strict';var client=require(_0x5867('0x0'));exports[_0x5867('0x1')]=function(_0x49101a){return client['Request'](_0x5867('0x2'),{'body':_0x49101a,'log':_0x5867('0x3')});};
\ No newline at end of file
index 3cca144..fe16c52 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x185c79,_0x3db22c){var _0x49e7db=function(_0x28cbf5){while(--_0x28cbf5){_0x185c79['push'](_0x185c79['shift']());}};_0x49e7db(++_0x3db22c);}(_0x70e0,0x17b));var _0x070e=function(_0x416a9a,_0x588e07){_0x416a9a=_0x416a9a-0x0;var _0x4a6d04=_0x70e0[_0x416a9a];return _0x4a6d04;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};};
\ No newline at end of file
+var _0x70e0=['User','Agents','online','../client','getSmsQueues','Request','timeout','strategy'];(function(_0x225d43,_0x22f803){var _0x213152=function(_0x16634e){while(--_0x16634e){_0x225d43['push'](_0x225d43['shift']());}};_0x213152(++_0x22f803);}(_0x70e0,0x17b));var _0x070e=function(_0x2082ba,_0x4c6da3){_0x2082ba=_0x2082ba-0x0;var _0x193ae7=_0x70e0[_0x2082ba];return _0x193ae7;};'use strict';var client=require(_0x070e('0x0'));exports[_0x070e('0x1')]=function(){return function(){return client[_0x070e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x070e('0x3'),_0x070e('0x4')],'include':[{'model':_0x070e('0x5'),'as':_0x070e('0x6'),'attributes':['id','name',_0x070e('0x7'),'smsPause']}]},'log':_0x070e('0x1')});};};
\ No newline at end of file
index d1f3bfb..896704b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x711446,_0x1b57ae){var _0x599a3b=function(_0x37d117){while(--_0x37d117){_0x711446['push'](_0x711446['shift']());}};_0x599a3b(++_0x1b57ae);}(_0x9c44,0x178));var _0x49c4=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x9c44[_0x50a0c2];return _0x5ebadd;};'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 _0x9957=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x43c2bb,_0x2d4ace){var _0x233a7f=function(_0x27b59b){while(--_0x27b59b){_0x43c2bb['push'](_0x43c2bb['shift']());}};_0x233a7f(++_0x2d4ace);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3){return client[_0x7995('0x2')]('CreateSmsQueueReport',{'body':_0x2722a3,'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x1902b4,_0x462a03){return client['Request'](_0x7995('0x5'),{'body':_0x462a03,'options':{'where':{'uniqueid':_0x1902b4},'order':[['id',_0x7995('0x6')]],'limit':0x1},'log':_0x7995('0x5')});};
\ No newline at end of file
index baaab8f..8941943 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(_0x340c8e,_0x18f717){var _0x33d19c=function(_0x1a8299){while(--_0x1a8299){_0x340c8e['push'](_0x340c8e['shift']());}};_0x33d19c(++_0x18f717);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xa9e0[_0x5447fd];return _0x15b28a;};'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(_0x4de2e4,_0x3142c3){var _0x364d5a=function(_0x1d4470){while(--_0x1d4470){_0x4de2e4['push'](_0x4de2e4['shift']());}};_0x364d5a(++_0x3142c3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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 05eb5a8..54ec0c7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x677a=['UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','Request'];(function(_0x99956a,_0x3d5b6c){var _0x3da435=function(_0x188491){while(--_0x188491){_0x99956a['push'](_0x99956a['shift']());}};_0x3da435(++_0x3d5b6c);}(_0x677a,0xd6));var _0xa677=function(_0x155488,_0x5e3f9a){_0x155488=_0x155488-0x0;var _0x4da352=_0x677a[_0x155488];return _0x4da352;};'use strict';var client=require(_0xa677('0x0'));exports['update']=function(_0x3896be,_0x1a14cf){return client[_0xa677('0x1')](_0xa677('0x2'),{'body':_0x1a14cf,'options':{'where':{'id':_0x3896be}},'log':_0xa677('0x3')});};exports['addTags']=function(_0x1ca988,_0x2e46f8){return client[_0xa677('0x1')](_0xa677('0x4'),{'body':_0x2e46f8,'options':{'where':{'id':_0x1ca988}},'log':_0xa677('0x5')});};
\ No newline at end of file
+var _0x687b=['addTagsToWhatsappInteraction','../client','update','updateWhatsappInteraction','addTags','Request','AddTagsToWhatsappInteraction'];(function(_0x2c6bc9,_0x4ababb){var _0x5408b4=function(_0x1d5021){while(--_0x1d5021){_0x2c6bc9['push'](_0x2c6bc9['shift']());}};_0x5408b4(++_0x4ababb);}(_0x687b,0x14a));var _0xb687=function(_0x32c012,_0xe3c576){_0x32c012=_0x32c012-0x0;var _0x48562e=_0x687b[_0x32c012];return _0x48562e;};'use strict';var client=require(_0xb687('0x0'));exports[_0xb687('0x1')]=function(_0xd000be,_0x26d69b){return client['Request']('UpdateWhatsappInteraction',{'body':_0x26d69b,'options':{'where':{'id':_0xd000be}},'log':_0xb687('0x2')});};exports[_0xb687('0x3')]=function(_0x36c468,_0x31bd0d){return client[_0xb687('0x4')](_0xb687('0x5'),{'body':_0x31bd0d,'options':{'where':{'id':_0x36c468}},'log':_0xb687('0x6')});};
\ No newline at end of file
index a16e5df..9380a67 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x3a9a=['create','Request','CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0xdfd7dc,_0x2f45a1){var _0x5e2f73=function(_0x5a6300){while(--_0x5a6300){_0xdfd7dc['push'](_0xdfd7dc['shift']());}};_0x5e2f73(++_0x2f45a1);}(_0x3a9a,0x153));var _0xa3a9=function(_0x383356,_0x33d2f5){_0x383356=_0x383356-0x0;var _0x32ee5a=_0x3a9a[_0x383356];return _0x32ee5a;};'use strict';var client=require(_0xa3a9('0x0'));exports[_0xa3a9('0x1')]=function(_0x37c178){return client[_0xa3a9('0x2')](_0xa3a9('0x3'),{'body':_0x37c178,'log':_0xa3a9('0x4')});};
\ No newline at end of file
+var _0x2272=['Request','createWhatsappMessage','../client','create'];(function(_0x17c1da,_0x36ecce){var _0x5552f5=function(_0x1cfc88){while(--_0x1cfc88){_0x17c1da['push'](_0x17c1da['shift']());}};_0x5552f5(++_0x36ecce);}(_0x2272,0x1a6));var _0x2227=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2272[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0x2227('0x0'));exports[_0x2227('0x1')]=function(_0x4e2c3a){return client[_0x2227('0x2')]('CreateWhatsappMessage',{'body':_0x4e2c3a,'log':_0x2227('0x3')});};
\ No newline at end of file
index e564472..6e6dcf7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x7f85=['User','Agents','name','online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','timeout','strategy'];(function(_0x4b7d01,_0x394c1e){var _0xe34570=function(_0xebe1ff){while(--_0xebe1ff){_0x4b7d01['push'](_0x4b7d01['shift']());}};_0xe34570(++_0x394c1e);}(_0x7f85,0xaa));var _0x57f8=function(_0x11160d,_0x413adc){_0x11160d=_0x11160d-0x0;var _0x21520a=_0x7f85[_0x11160d];return _0x21520a;};'use strict';var client=require(_0x57f8('0x0'));exports[_0x57f8('0x1')]=function(){return function(){return client[_0x57f8('0x2')](_0x57f8('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x57f8('0x4'),_0x57f8('0x5')],'include':[{'model':_0x57f8('0x6'),'as':_0x57f8('0x7'),'attributes':['id',_0x57f8('0x8'),_0x57f8('0x9'),_0x57f8('0xa')]}]},'log':_0x57f8('0x1')});};};
\ No newline at end of file
+var _0xd103=['name','timeout','strategy','Agents','getWhatsappQueues','Request','GetWhatsappQueue'];(function(_0x5288aa,_0x1f3cfe){var _0x4784d7=function(_0xa07983){while(--_0xa07983){_0x5288aa['push'](_0x5288aa['shift']());}};_0x4784d7(++_0x1f3cfe);}(_0xd103,0xa5));var _0x3d10=function(_0x22002b,_0x4da695){_0x22002b=_0x22002b-0x0;var _0x3072a0=_0xd103[_0x22002b];return _0x3072a0;};'use strict';var client=require('../client');exports[_0x3d10('0x0')]=function(){return function(){return client[_0x3d10('0x1')](_0x3d10('0x2'),{'options':{'raw':![],'attributes':['id',_0x3d10('0x3'),_0x3d10('0x4'),_0x3d10('0x5')],'include':[{'model':'User','as':_0x3d10('0x6'),'attributes':['id',_0x3d10('0x3'),'online','whatsappPause']}]},'log':_0x3d10('0x0')});};};
\ No newline at end of file
index c2d4511..95c6021 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa07d=['create','Request','CreateWhatsappQueueReport','update','DESC','UpdateWhatsappQueueReport','../client'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xa07d,0x156));var _0xda07=function(_0x4d3940,_0x167a82){_0x4d3940=_0x4d3940-0x0;var _0x542862=_0xa07d[_0x4d3940];return _0x542862;};'use strict';var client=require(_0xda07('0x0'));exports[_0xda07('0x1')]=function(_0xcbfbf0){return client[_0xda07('0x2')](_0xda07('0x3'),{'body':_0xcbfbf0,'log':_0xda07('0x3')});};exports[_0xda07('0x4')]=function(_0x51e091,_0x448759){return client[_0xda07('0x2')]('UpdateWhatsappQueueReport',{'body':_0x448759,'options':{'where':{'uniqueid':_0x51e091},'order':[['id',_0xda07('0x5')]],'limit':0x1},'log':_0xda07('0x6')});};
\ No newline at end of file
+var _0x5934=['Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','create'];(function(_0x5c5df2,_0x367d02){var _0x3d6e09=function(_0x2c13a0){while(--_0x2c13a0){_0x5c5df2['push'](_0x5c5df2['shift']());}};_0x3d6e09(++_0x367d02);}(_0x5934,0x167));var _0x4593=function(_0x1b433f,_0xbfb267){_0x1b433f=_0x1b433f-0x0;var _0x52c22c=_0x5934[_0x1b433f];return _0x52c22c;};'use strict';var client=require('../client');exports[_0x4593('0x0')]=function(_0x242a75){return client[_0x4593('0x1')](_0x4593('0x2'),{'body':_0x242a75,'log':'CreateWhatsappQueueReport'});};exports[_0x4593('0x3')]=function(_0x5e3537,_0x2b9063){return client[_0x4593('0x1')](_0x4593('0x4'),{'body':_0x2b9063,'options':{'where':{'uniqueid':_0x5e3537},'order':[['id',_0x4593('0x5')]],'limit':0x1},'log':_0x4593('0x4')});};
\ No newline at end of file
index d7add79..77e7288 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2b98=['length','error','[%s][AGENT]\x20%s','map','message','join','find','timeout','createQueue','atimeout','channel','START:%s','rules','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%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','format','name','toLowerCase','consequence'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2b98,0x109));var _0x82b9=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x2b98[_0x2b4411];return _0x8e41ef;};'use strict';var schema=require(_0x82b9('0x0'));var _=require(_0x82b9('0x1'));var util=require(_0x82b9('0x2'));var seqqueue=require(_0x82b9('0x3'));var logger=require(_0x82b9('0x4'))(_0x82b9('0x5'));var strategy=require(_0x82b9('0x6'));var queue=schema({'name':{'type':_0x82b9('0x7'),'required':!![],'message':_0x82b9('0x8')},'timeout':{'type':_0x82b9('0x9'),'message':_0x82b9('0xa')}});function writeLog(_0x20f993,_0x34736e,_0x183591){return logger['info'](util[_0x82b9('0xb')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x20f993,_0x34736e[_0x82b9('0xc')],_0x183591));}function handleFindAgent(_0x31a705){return function(_0xda0317){return _0xda0317[_0x82b9('0xc')][_0x82b9('0xd')]()===_0x31a705['toLowerCase']();};}exports[_0x82b9('0xe')]=function(_0x53d12a,_0x7b9755,_0x360dc4,_0x3f58f1){return function(_0x5c5924){try{var _0x39a9e1={'name':_0x7b9755[0x0],'timeout':_0x7b9755[0x1]};var _0x17311e=queue['validate'](_0x39a9e1,{'typecast':!![]});if(_0x17311e[_0x82b9('0xf')]){logger[_0x82b9('0x10')](_0x82b9('0x11'),_0x53d12a,_[_0x82b9('0x12')](_0x17311e,_0x82b9('0x13'))[_0x82b9('0x14')](',\x20'));_0x5c5924['stop']();}else{var _0x26d5b1=_[_0x82b9('0x15')](_0x360dc4['agents'],handleFindAgent(_0x39a9e1[_0x82b9('0xc')]));if(_0x26d5b1){var _0x5b0eda=(_0x39a9e1[_0x82b9('0x16')]||0xa)*0x3e8;var _0x238e8d,_0x59aee9;var _0x12f55a=seqqueue[_0x82b9('0x17')](_0x5b0eda);_0x12f55a['id']=_0x53d12a;_0x12f55a[_0x82b9('0x18')]=_0x5b0eda;_0x12f55a['channel']=_0x3f58f1[_0x82b9('0x19')];writeLog(_0x53d12a,_0x26d5b1,util['format'](_0x82b9('0x1a'),_0x5b0eda));_0x360dc4[_0x82b9('0x1b')][_0x53d12a]['on']('end',function(){logger[_0x82b9('0x1c')](_0x82b9('0x1d'),_0x53d12a);clearTimeout(_0x59aee9);_0x59aee9=undefined;_0x12f55a[_0x82b9('0x1e')]();if(_0x360dc4['rules'][_0x53d12a]){delete _0x360dc4['rules'][_0x53d12a];}_0x5c5924[_0x82b9('0x1f')]();});_0x360dc4[_0x82b9('0x1b')][_0x53d12a]['on'](_0x82b9('0x20'),function(){if(_0x360dc4['rules'][_0x53d12a]){delete _0x360dc4[_0x82b9('0x1b')][_0x53d12a];}});_0x59aee9=setTimeout(function(){logger[_0x82b9('0x1c')](_0x82b9('0x21'),_0x53d12a);clearTimeout(_0x59aee9);_0x12f55a['close']();_0x5c5924[_0x82b9('0x22')]();},_0x5b0eda);strategy[_0x82b9('0x23')](_0x12f55a,_0x26d5b1,_0x360dc4,_0x3f58f1);}else{logger[_0x82b9('0x10')](_0x82b9('0x24'),_0x53d12a,_0x39a9e1[_0x82b9('0xc')]);_0x5c5924[_0x82b9('0x1f')]();}}}catch(_0x444377){console[_0x82b9('0x25')](_0x444377);logger[_0x82b9('0x10')](_0x82b9('0x26'),_0x53d12a,_0x444377[_0x82b9('0x27')]);_0x5c5924['stop']();}};};
\ No newline at end of file
+var _0xe13f=['agents','timeout','createQueue','channel','format','START:%s','rules','end','close','next','stop','[%s][QUEUE]\x20%s','validate','util','../../../../config/logger','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','info','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','find'];(function(_0x44ea1b,_0x36bbd3){var _0x239690=function(_0x3ec34b){while(--_0x3ec34b){_0x44ea1b['push'](_0x44ea1b['shift']());}};_0x239690(++_0x36bbd3);}(_0xe13f,0x14c));var _0xfe13=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xe13f[_0x47a7d0];return _0xb9bd08;};'use strict';var schema=require(_0xfe13('0x0'));var _=require('lodash');var util=require(_0xfe13('0x1'));var seqqueue=require('seq-queue');var logger=require(_0xfe13('0x2'))(_0xfe13('0x3'));var strategy=require(_0xfe13('0x4'));var queue=schema({'name':{'type':_0xfe13('0x5'),'required':!![],'message':_0xfe13('0x6')},'timeout':{'type':_0xfe13('0x7'),'message':_0xfe13('0x8')}});function writeLog(_0xf830a0,_0xef1565,_0xd5235a){return logger[_0xfe13('0x9')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0xf830a0,_0xef1565['name'],_0xd5235a));}function handleFindAgent(_0x491459){return function(_0x3795df){return _0x3795df[_0xfe13('0xa')][_0xfe13('0xb')]()===_0x491459[_0xfe13('0xb')]();};}exports[_0xfe13('0xc')]=function(_0x1f23bf,_0x1968de,_0xfebf89,_0x28bff8){return function(_0x889fb1){try{var _0x2fc2a4={'name':_0x1968de[0x0],'timeout':_0x1968de[0x1]};var _0x1556f5=queue['validate'](_0x2fc2a4,{'typecast':!![]});if(_0x1556f5[_0xfe13('0xd')]){logger[_0xfe13('0xe')](_0xfe13('0xf'),_0x1f23bf,_[_0xfe13('0x10')](_0x1556f5,_0xfe13('0x11'))[_0xfe13('0x12')](',\x20'));_0x889fb1['stop']();}else{var _0x1a826b=_[_0xfe13('0x13')](_0xfebf89[_0xfe13('0x14')],handleFindAgent(_0x2fc2a4[_0xfe13('0xa')]));if(_0x1a826b){var _0x141b03=(_0x2fc2a4[_0xfe13('0x15')]||0xa)*0x3e8;var _0x5c69b0,_0x448eef;var _0x3a3aca=seqqueue[_0xfe13('0x16')](_0x141b03);_0x3a3aca['id']=_0x1f23bf;_0x3a3aca['atimeout']=_0x141b03;_0x3a3aca['channel']=_0x28bff8[_0xfe13('0x17')];writeLog(_0x1f23bf,_0x1a826b,util[_0xfe13('0x18')](_0xfe13('0x19'),_0x141b03));_0xfebf89[_0xfe13('0x1a')][_0x1f23bf]['on'](_0xfe13('0x1b'),function(){logger[_0xfe13('0x9')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x1f23bf);clearTimeout(_0x448eef);_0x448eef=undefined;_0x3a3aca[_0xfe13('0x1c')]();if(_0xfebf89[_0xfe13('0x1a')][_0x1f23bf]){delete _0xfebf89[_0xfe13('0x1a')][_0x1f23bf];}_0x889fb1['stop']();});_0xfebf89['rules'][_0x1f23bf]['on']('complete',function(){if(_0xfebf89[_0xfe13('0x1a')][_0x1f23bf]){delete _0xfebf89['rules'][_0x1f23bf];}});_0x448eef=setTimeout(function(){logger[_0xfe13('0x9')]('[%s][AGENT]\x20ROUTING\x20END',_0x1f23bf);clearTimeout(_0x448eef);_0x3a3aca[_0xfe13('0x1c')]();_0x889fb1[_0xfe13('0x1d')]();},_0x141b03);strategy['agent'](_0x3a3aca,_0x1a826b,_0xfebf89,_0x28bff8);}else{logger[_0xfe13('0xe')]('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x1f23bf,_0x2fc2a4[_0xfe13('0xa')]);_0x889fb1[_0xfe13('0x1e')]();}}}catch(_0xa3d00d){console['log'](_0xa3d00d);logger[_0xfe13('0xe')](_0xfe13('0x1f'),_0x1f23bf,_0xa3d00d['stack']);_0x889fb1[_0xfe13('0x1e')]();}};};
\ No newline at end of file
index 9cbf3de..6a256ee 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xfc46=['UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty','getMustacheRender','Message','create','then','body','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','providerResponse','dialogState','Failed','catch','lodash','moment','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc46,0x167));var _0x6fc4=function(_0x5d61b4,_0x4f7b91){_0x5d61b4=_0x5d61b4-0x0;var _0x183fc5=_0xfc46[_0x5d61b4];return _0x183fc5;};'use strict';var _=require(_0x6fc4('0x0'));var moment=require(_0x6fc4('0x1'));var AWS=require('aws-sdk');var utils=require(_0x6fc4('0x2'));var logger=require(_0x6fc4('0x3'))(_0x6fc4('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x6fc4('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x6fc4('0x6')),'faxMessage':require(_0x6fc4('0x7')),'whatsappMessage':require(_0x6fc4('0x8'))};exports[_0x6fc4('0x9')]=function(_0x3e9a28,_0x305785){return function(_0x165feb){try{if(!_[_0x6fc4('0xa')](this[_0x6fc4('0xb')][_0x6fc4('0xc')])){logger[_0x6fc4('0xd')](_0x6fc4('0xe'),_0x3e9a28,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x165feb[_0x6fc4('0xf')]();}var _0x5af111={'ContactId':this[_0x6fc4('0x10')]['id'],'sentAt':moment()[_0x6fc4('0x11')](_0x6fc4('0x12')),'direction':_0x6fc4('0x13')};if(this[_0x6fc4('0x14')]===_0x6fc4('0x15')||this[_0x6fc4('0x14')]===_0x6fc4('0x16')){_0x5af111[_0x6fc4('0x17')]=this[_0x6fc4('0xb')][_0x6fc4('0x17')];}var _0x4d571e=this[_0x6fc4('0x14')];if(_0x4d571e===_0x6fc4('0x18')){_0x5af111[_0x6fc4('0x19')]=this['account']['id'];}else{_0x5af111[_[_0x6fc4('0x1a')](_0x4d571e)+_0x6fc4('0x1b')]=this[_0x6fc4('0x1c')]['id'];}_0x5af111[_[_0x6fc4('0x1a')](_0x4d571e)+_0x6fc4('0x1d')]=this[_0x6fc4('0xb')]['id'];if(this[_0x6fc4('0xb')][_0x6fc4('0x1e')]){var _0x241a96=_0x305785[0x4];if(!_[_0x6fc4('0x1f')](_0x241a96)){_0x5af111['body']=utils[_0x6fc4('0x20')](_0x241a96,this);return rpc[_0x4d571e+_0x6fc4('0x21')][_0x6fc4('0x22')](_0x5af111)[_0x6fc4('0x23')](function(_0x134e6b){logger[_0x6fc4('0xd')](_0x6fc4('0xe'),_0x3e9a28,_0x5af111[_0x6fc4('0x24')]);})['catch'](function(_0x3274d7){logger[_0x6fc4('0x25')](_0x6fc4('0xe'),_0x3e9a28,JSON[_0x6fc4('0x26')](_0x3274d7));})[_0x6fc4('0x27')](function(){logger[_0x6fc4('0xd')](_0x6fc4('0x28'),_0x3e9a28);_0x165feb[_0x6fc4('0x29')]();});}else{logger[_0x6fc4('0xd')](_0x6fc4('0x2a'),_0x3e9a28);_0x165feb['stop']();}}else{var _0x80801=this;var _0x5868de=new AWS[(_0x6fc4('0x2b'))]({'accessKeyId':_0x305785[0x0],'secretAccessKey':_0x305785[0x1],'region':_0x305785[0x2]});var _0x55260d={'botAlias':_0x6fc4('0x2c'),'botName':_0x305785[0x3],'inputText':this[_0x6fc4('0x2d')][_0x6fc4('0x24')],'userId':this['channel']+':'+this[_0x6fc4('0xb')]['id'][_0x6fc4('0x2e')]()};_0x5868de[_0x6fc4('0x2f')](_0x55260d,function(_0x33153f,_0x550104){if(_0x33153f){logger[_0x6fc4('0x25')](_0x6fc4('0xe'),_0x3e9a28,_0x33153f['message']);_0x165feb['next']();}else if(_0x550104&&_0x550104[_0x6fc4('0x2d')]){_0x80801[_0x6fc4('0x24')]['amazonlex']=_0x550104;_0x5af111[_0x6fc4('0x24')]=_0x550104[_0x6fc4('0x2d')];_0x5af111['providerName']=_0x6fc4('0x30');_0x5af111[_0x6fc4('0x31')]=JSON[_0x6fc4('0x26')](_0x550104);return rpc[_0x4d571e+'Message'][_0x6fc4('0x22')](_0x5af111)[_0x6fc4('0x23')](function(_0x527ba3){logger[_0x6fc4('0xd')](_0x6fc4('0xe'),_0x3e9a28,_0x5af111[_0x6fc4('0x24')]);if(_0x550104[_0x6fc4('0x32')]==_0x6fc4('0x33')){_0x165feb[_0x6fc4('0xf')]();}else{_0x165feb['stop']();}})[_0x6fc4('0x34')](function(_0x36eff0){logger[_0x6fc4('0x25')](_0x6fc4('0xe'),_0x3e9a28,JSON[_0x6fc4('0x26')](_0x36eff0));_0x165feb[_0x6fc4('0xf')]();});}else{_0x165feb[_0x6fc4('0xf')]();}});}}catch(_0x45a4ad){logger['error'](_0x6fc4('0xe'),_0x3e9a28,JSON[_0x6fc4('0x26')](_0x45a4ad));_0x165feb[_0x6fc4('0x29')]();}};};
\ No newline at end of file
+var _0x6086=['channel','toString','postText','providerName','amazonlex','providerResponse','create','then','dialogState','lodash','moment','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','whatsapp','phone','chat','account','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','message'];(function(_0x31e025,_0x4fb40){var _0x14dc32=function(_0x1cdde9){while(--_0x1cdde9){_0x31e025['push'](_0x31e025['shift']());}};_0x14dc32(++_0x4fb40);}(_0x6086,0x147));var _0x6608=function(_0x4311bd,_0x4b4e4b){_0x4311bd=_0x4311bd-0x0;var _0xe2f809=_0x6086[_0x4311bd];return _0xe2f809;};'use strict';var _=require(_0x6608('0x0'));var moment=require(_0x6608('0x1'));var AWS=require(_0x6608('0x2'));var utils=require('./utils');var logger=require(_0x6608('0x3'))(_0x6608('0x4'));var rpc={'chatMessage':require(_0x6608('0x5')),'openchannelMessage':require(_0x6608('0x6')),'mailMessage':require(_0x6608('0x7')),'smsMessage':require(_0x6608('0x8')),'faxMessage':require(_0x6608('0x9')),'whatsappMessage':require(_0x6608('0xa'))};exports[_0x6608('0xb')]=function(_0x24d5c2,_0x49de6e){return function(_0x3b7f62){try{if(!_[_0x6608('0xc')](this[_0x6608('0xd')][_0x6608('0xe')])){logger[_0x6608('0xf')](_0x6608('0x10'),_0x24d5c2,_0x6608('0x11'));return _0x3b7f62[_0x6608('0x12')]();}var _0x413e8c={'ContactId':this[_0x6608('0x13')]['id'],'sentAt':moment()[_0x6608('0x14')](_0x6608('0x15')),'direction':_0x6608('0x16')};if(this['channel']===_0x6608('0x17')||this['channel']===_0x6608('0x18')){_0x413e8c['phone']=this['interaction'][_0x6608('0x19')];}var _0x2a6435=this['channel'];if(_0x2a6435===_0x6608('0x1a')){_0x413e8c['ChatWebsiteId']=this[_0x6608('0x1b')]['id'];}else{_0x413e8c[_[_0x6608('0x1c')](_0x2a6435)+'AccountId']=this[_0x6608('0x1b')]['id'];}_0x413e8c[_[_0x6608('0x1c')](_0x2a6435)+_0x6608('0x1d')]=this[_0x6608('0xd')]['id'];if(this[_0x6608('0xd')][_0x6608('0x1e')]){var _0x531ec6=_0x49de6e[0x4];if(!_[_0x6608('0x1f')](_0x531ec6)){_0x413e8c[_0x6608('0x20')]=utils[_0x6608('0x21')](_0x531ec6,this);return rpc[_0x2a6435+_0x6608('0x22')]['create'](_0x413e8c)['then'](function(_0x449603){logger[_0x6608('0xf')]('[%s][AMAZONLEX]\x20%s',_0x24d5c2,_0x413e8c['body']);})[_0x6608('0x23')](function(_0x5a1d6a){logger[_0x6608('0x24')](_0x6608('0x10'),_0x24d5c2,JSON[_0x6608('0x25')](_0x5a1d6a));})[_0x6608('0x26')](function(){logger['info'](_0x6608('0x27'),_0x24d5c2);_0x3b7f62[_0x6608('0x28')]();});}else{logger[_0x6608('0xf')](_0x6608('0x29'),_0x24d5c2);_0x3b7f62[_0x6608('0x28')]();}}else{var _0x275de7=this;var _0x2f6e83=new AWS[(_0x6608('0x2a'))]({'accessKeyId':_0x49de6e[0x0],'secretAccessKey':_0x49de6e[0x1],'region':_0x49de6e[0x2]});var _0x4154e9={'botAlias':'$LATEST','botName':_0x49de6e[0x3],'inputText':this[_0x6608('0x2b')]['body'],'userId':this[_0x6608('0x2c')]+':'+this[_0x6608('0xd')]['id'][_0x6608('0x2d')]()};_0x2f6e83[_0x6608('0x2e')](_0x4154e9,function(_0x4437f9,_0x46fa55){if(_0x4437f9){logger[_0x6608('0x24')]('[%s][AMAZONLEX]\x20%s',_0x24d5c2,_0x4437f9['message']);_0x3b7f62[_0x6608('0x12')]();}else if(_0x46fa55&&_0x46fa55[_0x6608('0x2b')]){_0x275de7[_0x6608('0x20')]['amazonlex']=_0x46fa55;_0x413e8c[_0x6608('0x20')]=_0x46fa55[_0x6608('0x2b')];_0x413e8c[_0x6608('0x2f')]=_0x6608('0x30');_0x413e8c[_0x6608('0x31')]=JSON[_0x6608('0x25')](_0x46fa55);return rpc[_0x2a6435+_0x6608('0x22')][_0x6608('0x32')](_0x413e8c)[_0x6608('0x33')](function(_0x26684e){logger[_0x6608('0xf')](_0x6608('0x10'),_0x24d5c2,_0x413e8c[_0x6608('0x20')]);if(_0x46fa55[_0x6608('0x34')]=='Failed'){_0x3b7f62[_0x6608('0x12')]();}else{_0x3b7f62['stop']();}})[_0x6608('0x23')](function(_0x35cc8c){logger['error'](_0x6608('0x10'),_0x24d5c2,JSON[_0x6608('0x25')](_0x35cc8c));_0x3b7f62[_0x6608('0x12')]();});}else{_0x3b7f62[_0x6608('0x12')]();}});}}catch(_0x567306){logger[_0x6608('0x24')](_0x6608('0x10'),_0x24d5c2,JSON['stringify'](_0x567306));_0x3b7f62[_0x6608('0x28')]();}};};
\ No newline at end of file
index 21d70ba..1b02e80 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa52c=['../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','YYYY-MM-DD\x20HH:mm:ss','channel','mail','body','getMustacheRender','message','from','phone','read','subject','startsWith','Re:','Re:\x20','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','Message','service','Smtp','host','port','secure','authentication','auth','user','pass','messageId','html','<div\x20id=\x22xm-mail-content\x22>','replace','<div\x20id=\x22xm-mail-content\x22','</div>','headers','auto-replied','All','then','create','stringify','catch','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','update','error','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','stop','lodash','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage'];(function(_0x350182,_0x2a9feb){var _0x4a0892=function(_0x2c994d){while(--_0x2c994d){_0x350182['push'](_0x350182['shift']());}};_0x4a0892(++_0x2a9feb);}(_0xa52c,0xe7));var _0xca52=function(_0x1ee9d0,_0x2ca43b){_0x1ee9d0=_0x1ee9d0-0x0;var _0x230994=_0xa52c[_0x1ee9d0];return _0x230994;};'use strict';var _=require(_0xca52('0x0'));var moment=require(_0xca52('0x1'));var utils=require(_0xca52('0x2'));var logger=require(_0xca52('0x3'))('routing');var rpc={'chatMessage':require(_0xca52('0x4')),'openchannelMessage':require(_0xca52('0x5')),'mailMessage':require(_0xca52('0x6')),'smsMessage':require(_0xca52('0x7')),'faxMessage':require(_0xca52('0x8')),'whatsappMessage':require(_0xca52('0x9')),'chatInteraction':require(_0xca52('0xa')),'openchannelInteraction':require(_0xca52('0xb')),'mailInteraction':require(_0xca52('0xc')),'smsInteraction':require(_0xca52('0xd')),'faxInteraction':require(_0xca52('0xe')),'whatsappInteraction':require(_0xca52('0xf'))};var mailRpc=require(_0xca52('0x10'));exports[_0xca52('0x11')]=function(_0x1885f4,_0x21841e,_0xf11aa2,_0x44c861){return function(_0x2f7936){try{var _0x336e3d=this['channel'];if(_0x336e3d==='mail'&&_0x44c861['body'][_0xca52('0x12')]){logger[_0xca52('0x13')](_0xca52('0x14'),_0x1885f4,_0xca52('0x15'));return _0x2f7936['next']();}if(_0x21841e[0x0]==='1'&&(_[_0xca52('0x16')](this['interaction']['created'])||!this['interaction']['created'])){logger[_0xca52('0x13')]('[%s][AUTOREPLY]\x20%s',_0x1885f4,_0xca52('0x17'));return _0x2f7936[_0xca52('0x18')]();}if(_0x21841e[0x0]==='2'&&this['interaction'][_0xca52('0x19')]){logger[_0xca52('0x13')](_0xca52('0x1a'),_0x1885f4,_0xca52('0x1b'));return _0x2f7936['next']();}var _0x552e33={'ContactId':this[_0xca52('0x1c')]['id'],'sentAt':moment()['format'](_0xca52('0x1d')),'direction':'out'};if(this[_0xca52('0x1e')]===_0xca52('0x1f')){_0x552e33[_0xca52('0x20')]=utils[_0xca52('0x21')](_0x21841e[0x2],this);}else{_0x552e33[_0xca52('0x20')]=utils[_0xca52('0x21')](_0x21841e[0x1],this);}if(this[_0xca52('0x22')]){_0x552e33['to']=this[_0xca52('0x22')][_0xca52('0x23')]||'';if(this[_0xca52('0x1e')]===_0xca52('0x1f')&&_0x21841e[0x1]==='1'){_0x552e33['cc']=this['message']['cc']||'';}_0x552e33[_0xca52('0x23')]=this[_0xca52('0x22')]['to']||'';_0x552e33[_0xca52('0x24')]=this['message'][_0xca52('0x24')]||'';_0x552e33[_0xca52('0x25')]=!![];if(this['message'][_0xca52('0x26')]){_0x552e33[_0xca52('0x26')]='';_0x552e33[_0xca52('0x26')]+=_[_0xca52('0x27')](this['message'][_0xca52('0x26')],_0xca52('0x28'))?'':_0xca52('0x29');_0x552e33['subject']+=this[_0xca52('0x22')][_0xca52('0x26')];}}if(this[_0xca52('0x1e')]==='chat'){_0x552e33[_0xca52('0x2a')]=this[_0xca52('0x2b')]['id'];}else{_0x552e33[_[_0xca52('0x2c')](this[_0xca52('0x1e')])+_0xca52('0x2d')]=this[_0xca52('0x2b')]['id'];}_0x552e33[_[_0xca52('0x2c')](this[_0xca52('0x1e')])+_0xca52('0x2e')]=this[_0xca52('0x2f')]['id'];var _0x3be39c=this[_0xca52('0x2f')];if(rpc[this[_0xca52('0x1e')]+_0xca52('0x30')]){if(this[_0xca52('0x1e')]===_0xca52('0x1f')){var _0x16fd0c={'tls':{'rejectUnauthorized':![]}};if(this[_0xca52('0x2b')]['Smtp'][_0xca52('0x31')]){_0x16fd0c['service']=this[_0xca52('0x2b')][_0xca52('0x32')][_0xca52('0x31')];}else{_0x16fd0c[_0xca52('0x33')]=this[_0xca52('0x2b')]['Smtp'][_0xca52('0x33')];_0x16fd0c[_0xca52('0x34')]=this[_0xca52('0x2b')]['Smtp'][_0xca52('0x34')];_0x16fd0c[_0xca52('0x35')]=this[_0xca52('0x2b')]['Smtp']['secure'];}if(this[_0xca52('0x2b')][_0xca52('0x32')][_0xca52('0x36')]){_0x16fd0c[_0xca52('0x37')]={'user':this[_0xca52('0x2b')][_0xca52('0x32')][_0xca52('0x38')],'pass':this['account'][_0xca52('0x32')][_0xca52('0x39')]};}_0x552e33['inReplyTo']=this[_0xca52('0x22')][_0xca52('0x3a')];_0x552e33[_0xca52('0x3b')]=_0xca52('0x3c')+_[_0xca52('0x3d')](_0x552e33[_0xca52('0x20')],_0xca52('0x3e'),'<div')+_0xca52('0x3f');_0x552e33[_0xca52('0x40')]={'Auto-Submitted':_0xca52('0x41'),'X-Auto-Response-Suppress':_0xca52('0x42'),'Precedence':'auto_reply'};return mailRpc['sendMailMessage'](_0x16fd0c,_0x552e33)[_0xca52('0x43')](function(_0x2428cd){logger['info']('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x1885f4);_0x552e33[_0xca52('0x3a')]=_0x2428cd[_0xca52('0x22')][_0xca52('0x3a')];return rpc[_0x336e3d+_0xca52('0x30')][_0xca52('0x44')](_0x552e33);})[_0xca52('0x43')](function(_0x32ccb3){logger[_0xca52('0x13')]('[%s][AUTOREPLY]\x20%s',_0x1885f4,JSON[_0xca52('0x45')](_0x32ccb3));})[_0xca52('0x46')](function(_0x56ada4){logger['error'](_0xca52('0x47'),_0x1885f4,JSON[_0xca52('0x45')](_0x56ada4));})[_0xca52('0x48')](function(){Promise[_0xca52('0x49')]()['then'](function(){if(_0x21841e[0x0]!=='2'||_0x3be39c[_0xca52('0x19')])return;return rpc[_0x336e3d+_0xca52('0x4a')][_0xca52('0x4b')](_0x3be39c['id'],{'autoreplyExecuted':!![]})[_0xca52('0x43')](function(_0x1feb58){logger[_0xca52('0x13')](_0xca52('0x1a'),_0x1885f4,JSON['stringify'](_0x1feb58));})[_0xca52('0x46')](function(_0x2b04bb){logger[_0xca52('0x4c')](_0xca52('0x4d'),_0x1885f4,JSON[_0xca52('0x45')](_0x2b04bb));});})[_0xca52('0x43')](function(){_0x2f7936['next']();});});}else{return rpc[this['channel']+_0xca52('0x30')]['create'](_0x552e33)[_0xca52('0x43')](function(_0xfdda7d){logger[_0xca52('0x13')](_0xca52('0x14'),_0x1885f4,_0x552e33[_0xca52('0x20')]);})[_0xca52('0x46')](function(_0x2f4fae){logger[_0xca52('0x4c')](_0xca52('0x14'),_0x1885f4,JSON['stringify'](_0x2f4fae));})['finally'](function(){Promise[_0xca52('0x49')]()['then'](function(){if(_0x21841e[0x0]!=='2'||_0x3be39c[_0xca52('0x19')])return;return rpc[_0x336e3d+_0xca52('0x4a')][_0xca52('0x4b')](_0x3be39c['id'],{'autoreplyExecuted':!![]})[_0xca52('0x43')](function(_0x119d51){logger['info'](_0xca52('0x1a'),_0x1885f4,JSON['stringify'](_0x119d51));})['catch'](function(_0x20a8fa){logger[_0xca52('0x4c')](_0xca52('0x4d'),_0x1885f4,JSON[_0xca52('0x45')](_0x20a8fa));});})[_0xca52('0x43')](function(){_0x2f7936['next']();});});}}}catch(_0x1026a4){logger[_0xca52('0x4c')]('[%s][AUTOREPLY]\x20%s',_0x1885f4,JSON[_0xca52('0x45')](_0x1026a4));_0x2f7936[_0xca52('0x4e')]();}};};
\ No newline at end of file
+var _0x4801=['account','InteractionId','Message','Smtp','service','host','port','secure','authentication','auth','user','inReplyTo','messageId','html','<div\x20id=\x22xm-mail-content\x22>','replace','<div\x20id=\x22xm-mail-content\x22','</div>','headers','auto-replied','All','auto_reply','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','then','update','stringify','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','Interaction','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','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','format','out','getMustacheRender','message','from','phone','read','subject','startsWith','ChatWebsiteId','upperFirst','AccountId'];(function(_0x53b8e0,_0x55d46e){var _0x10630c=function(_0x3189aa){while(--_0x3189aa){_0x53b8e0['push'](_0x53b8e0['shift']());}};_0x10630c(++_0x55d46e);}(_0x4801,0x1f2));var _0x1480=function(_0x32ad42,_0x4c6948){_0x32ad42=_0x32ad42-0x0;var _0x672a14=_0x4801[_0x32ad42];return _0x672a14;};'use strict';var _=require(_0x1480('0x0'));var moment=require('moment');var utils=require(_0x1480('0x1'));var logger=require(_0x1480('0x2'))(_0x1480('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x1480('0x4')),'smsMessage':require(_0x1480('0x5')),'faxMessage':require(_0x1480('0x6')),'whatsappMessage':require(_0x1480('0x7')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x1480('0x8')),'mailInteraction':require(_0x1480('0x9')),'smsInteraction':require(_0x1480('0xa')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x1480('0xb'))};var mailRpc=require('../../mailRpc');exports[_0x1480('0xc')]=function(_0x532614,_0x90098b,_0x5e619a,_0x56e726){return function(_0x184755){try{var _0x57700b=this[_0x1480('0xd')];if(_0x57700b===_0x1480('0xe')&&_0x56e726[_0x1480('0xf')][_0x1480('0x10')]){logger[_0x1480('0x11')](_0x1480('0x12'),_0x532614,_0x1480('0x13'));return _0x184755[_0x1480('0x14')]();}if(_0x90098b[0x0]==='1'&&(_[_0x1480('0x15')](this[_0x1480('0x16')][_0x1480('0x17')])||!this[_0x1480('0x16')][_0x1480('0x17')])){logger[_0x1480('0x11')](_0x1480('0x12'),_0x532614,_0x1480('0x18'));return _0x184755['next']();}if(_0x90098b[0x0]==='2'&&this[_0x1480('0x16')][_0x1480('0x19')]){logger[_0x1480('0x11')](_0x1480('0x1a'),_0x532614,_0x1480('0x1b'));return _0x184755[_0x1480('0x14')]();}var _0x16bf21={'ContactId':this[_0x1480('0x1c')]['id'],'sentAt':moment()[_0x1480('0x1d')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x1480('0x1e')};if(this[_0x1480('0xd')]==='mail'){_0x16bf21[_0x1480('0xf')]=utils[_0x1480('0x1f')](_0x90098b[0x2],this);}else{_0x16bf21[_0x1480('0xf')]=utils[_0x1480('0x1f')](_0x90098b[0x1],this);}if(this[_0x1480('0x20')]){_0x16bf21['to']=this[_0x1480('0x20')][_0x1480('0x21')]||'';if(this['channel']===_0x1480('0xe')&&_0x90098b[0x1]==='1'){_0x16bf21['cc']=this[_0x1480('0x20')]['cc']||'';}_0x16bf21[_0x1480('0x21')]=this[_0x1480('0x20')]['to']||'';_0x16bf21[_0x1480('0x22')]=this['message'][_0x1480('0x22')]||'';_0x16bf21[_0x1480('0x23')]=!![];if(this['message'][_0x1480('0x24')]){_0x16bf21[_0x1480('0x24')]='';_0x16bf21[_0x1480('0x24')]+=_[_0x1480('0x25')](this[_0x1480('0x20')][_0x1480('0x24')],'Re:')?'':'Re:\x20';_0x16bf21[_0x1480('0x24')]+=this[_0x1480('0x20')][_0x1480('0x24')];}}if(this[_0x1480('0xd')]==='chat'){_0x16bf21[_0x1480('0x26')]=this['account']['id'];}else{_0x16bf21[_[_0x1480('0x27')](this[_0x1480('0xd')])+_0x1480('0x28')]=this[_0x1480('0x29')]['id'];}_0x16bf21[_[_0x1480('0x27')](this['channel'])+_0x1480('0x2a')]=this[_0x1480('0x16')]['id'];var _0x5d9018=this[_0x1480('0x16')];if(rpc[this['channel']+_0x1480('0x2b')]){if(this[_0x1480('0xd')]===_0x1480('0xe')){var _0x3f92c7={'tls':{'rejectUnauthorized':![]}};if(this[_0x1480('0x29')][_0x1480('0x2c')][_0x1480('0x2d')]){_0x3f92c7[_0x1480('0x2d')]=this[_0x1480('0x29')][_0x1480('0x2c')][_0x1480('0x2d')];}else{_0x3f92c7[_0x1480('0x2e')]=this['account'][_0x1480('0x2c')][_0x1480('0x2e')];_0x3f92c7[_0x1480('0x2f')]=this[_0x1480('0x29')][_0x1480('0x2c')][_0x1480('0x2f')];_0x3f92c7[_0x1480('0x30')]=this['account'][_0x1480('0x2c')][_0x1480('0x30')];}if(this[_0x1480('0x29')]['Smtp'][_0x1480('0x31')]){_0x3f92c7[_0x1480('0x32')]={'user':this['account'][_0x1480('0x2c')][_0x1480('0x33')],'pass':this['account']['Smtp']['pass']};}_0x16bf21[_0x1480('0x34')]=this[_0x1480('0x20')][_0x1480('0x35')];_0x16bf21[_0x1480('0x36')]=_0x1480('0x37')+_[_0x1480('0x38')](_0x16bf21['body'],_0x1480('0x39'),'<div')+_0x1480('0x3a');_0x16bf21[_0x1480('0x3b')]={'Auto-Submitted':_0x1480('0x3c'),'X-Auto-Response-Suppress':_0x1480('0x3d'),'Precedence':_0x1480('0x3e')};return mailRpc[_0x1480('0x3f')](_0x3f92c7,_0x16bf21)['then'](function(_0x36d4db){logger[_0x1480('0x11')](_0x1480('0x40'),_0x532614);_0x16bf21['messageId']=_0x36d4db[_0x1480('0x20')][_0x1480('0x35')];return rpc[_0x57700b+_0x1480('0x2b')][_0x1480('0x41')](_0x16bf21);})['then'](function(_0x2c99e6){logger['info'](_0x1480('0x12'),_0x532614,JSON['stringify'](_0x2c99e6));})[_0x1480('0x42')](function(_0x43edcd){logger[_0x1480('0x43')](_0x1480('0x44'),_0x532614,JSON['stringify'](_0x43edcd));})[_0x1480('0x45')](function(){Promise[_0x1480('0x46')]()[_0x1480('0x47')](function(){if(_0x90098b[0x0]!=='2'||_0x5d9018[_0x1480('0x19')])return;return rpc[_0x57700b+'Interaction'][_0x1480('0x48')](_0x5d9018['id'],{'autoreplyExecuted':!![]})[_0x1480('0x47')](function(_0x2b2c6c){logger[_0x1480('0x11')](_0x1480('0x1a'),_0x532614,JSON[_0x1480('0x49')](_0x2b2c6c));})[_0x1480('0x42')](function(_0x3fc90d){logger[_0x1480('0x43')](_0x1480('0x4a'),_0x532614,JSON['stringify'](_0x3fc90d));});})[_0x1480('0x47')](function(){_0x184755[_0x1480('0x14')]();});});}else{return rpc[this['channel']+_0x1480('0x2b')][_0x1480('0x41')](_0x16bf21)['then'](function(_0x316ab8){logger['info']('[%s][AUTOREPLY]\x20%s',_0x532614,_0x16bf21[_0x1480('0xf')]);})[_0x1480('0x42')](function(_0x1c0dc7){logger[_0x1480('0x43')](_0x1480('0x12'),_0x532614,JSON[_0x1480('0x49')](_0x1c0dc7));})[_0x1480('0x45')](function(){Promise[_0x1480('0x46')]()[_0x1480('0x47')](function(){if(_0x90098b[0x0]!=='2'||_0x5d9018[_0x1480('0x19')])return;return rpc[_0x57700b+_0x1480('0x4b')][_0x1480('0x48')](_0x5d9018['id'],{'autoreplyExecuted':!![]})[_0x1480('0x47')](function(_0x44e0a8){logger[_0x1480('0x11')](_0x1480('0x1a'),_0x532614,JSON[_0x1480('0x49')](_0x44e0a8));})[_0x1480('0x42')](function(_0x34d6d6){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x532614,JSON['stringify'](_0x34d6d6));});})['then'](function(){_0x184755[_0x1480('0x14')]();});});}}}catch(_0x1636bf){logger['error']('[%s][AUTOREPLY]\x20%s',_0x532614,JSON[_0x1480('0x49')](_0x1636bf));_0x184755[_0x1480('0x4c')]();}};};
\ No newline at end of file
index 784ff4d..5be4c09 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x792c=['consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','finally','stop','[%s][CLOSE]\x20%s','stringify','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction'];(function(_0x1cd65b,_0x52df8f){var _0x72f353=function(_0x16774c){while(--_0x16774c){_0x1cd65b['push'](_0x1cd65b['shift']());}};_0x72f353(++_0x52df8f);}(_0x792c,0xc0));var _0xc792=function(_0xb6910a,_0x7926fa){_0xb6910a=_0xb6910a-0x0;var _0x55b86a=_0x792c[_0xb6910a];return _0x55b86a;};'use strict';var moment=require(_0xc792('0x0'));var logger=require(_0xc792('0x1'))(_0xc792('0x2'));var rpc={'chatInteraction':require(_0xc792('0x3')),'openchannelInteraction':require(_0xc792('0x4')),'smsInteraction':require(_0xc792('0x5')),'mailInteraction':require(_0xc792('0x6')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xc792('0x7'))};exports[_0xc792('0x8')]=function(_0xc17620,_0x5a4844,_0x27364d,_0x276dda){return function(_0x837ea){try{logger[_0xc792('0x9')](_0xc792('0xa'),_0xc17620,_0x5a4844[0x0]);var _0xa45adf={'closed':0x1,'closedAt':moment()[_0xc792('0xb')](_0xc792('0xc')),'closeReason':_0xc792('0xd'),'disposition':_0x5a4844[0x0]};if(rpc[_0x276dda[_0xc792('0xe')]+_0xc792('0xf')]){rpc[_0x276dda[_0xc792('0xe')]+'Interaction'][_0xc792('0x10')](_0x276dda[_0xc792('0x11')]['id'],_0xa45adf)[_0xc792('0x12')](function(_0x1ee1fd){logger[_0xc792('0x9')](_0xc792('0x13'),_0xc17620,_0x276dda['interaction']['id']);})['catch'](function(_0x1effb5){logger[_0xc792('0x14')]('[%s][CLOSE]\x20%s',_0xc17620,JSON['stringify'](_0x1effb5));})[_0xc792('0x15')](function(){_0x837ea[_0xc792('0x16')]();});}}catch(_0x1bc324){logger[_0xc792('0x14')](_0xc792('0x17'),_0xc17620,JSON[_0xc792('0x18')](_0x1bc324));_0x837ea[_0xc792('0x16')]();}};};
\ No newline at end of file
+var _0xd620=['stop','moment','../../../../config/logger','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','catch','[%s][CLOSE]\x20%s','stringify','finally'];(function(_0x262f42,_0x4a6ca0){var _0x2b0712=function(_0x406fb8){while(--_0x406fb8){_0x262f42['push'](_0x262f42['shift']());}};_0x2b0712(++_0x4a6ca0);}(_0xd620,0x119));var _0x0d62=function(_0x3efe04,_0x3e9219){_0x3efe04=_0x3efe04-0x0;var _0xdee702=_0xd620[_0x3efe04];return _0xdee702;};'use strict';var moment=require(_0x0d62('0x0'));var logger=require(_0x0d62('0x1'))('routing');var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x0d62('0x2')),'smsInteraction':require(_0x0d62('0x3')),'mailInteraction':require(_0x0d62('0x4')),'faxInteraction':require(_0x0d62('0x5')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x0d62('0x6')]=function(_0xe05bbe,_0x3fc203,_0x54ba79,_0x1344c9){return function(_0x1ba3f1){try{logger[_0x0d62('0x7')](_0x0d62('0x8'),_0xe05bbe,_0x3fc203[0x0]);var _0x33632a={'closed':0x1,'closedAt':moment()['format'](_0x0d62('0x9')),'closeReason':_0x0d62('0xa'),'disposition':_0x3fc203[0x0]};if(rpc[_0x1344c9[_0x0d62('0xb')]+'Interaction']){rpc[_0x1344c9[_0x0d62('0xb')]+_0x0d62('0xc')][_0x0d62('0xd')](_0x1344c9[_0x0d62('0xe')]['id'],_0x33632a)['then'](function(_0xc6e778){logger[_0x0d62('0x7')]('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0xe05bbe,_0x1344c9[_0x0d62('0xe')]['id']);})[_0x0d62('0xf')](function(_0x544c1f){logger['error'](_0x0d62('0x10'),_0xe05bbe,JSON[_0x0d62('0x11')](_0x544c1f));})[_0x0d62('0x12')](function(){_0x1ba3f1['stop']();});}}catch(_0x36d25a){logger['error'](_0x0d62('0x10'),_0xe05bbe,JSON[_0x0d62('0x11')](_0x36d25a));_0x1ba3f1[_0x0d62('0x13')]();}};};
\ No newline at end of file
index cde7b17..e1cdb1a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5b20=['next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','AccountId','account','created','isEmpty','body','getMustacheRender','Message','create','then','catch','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','dialogflow','result','metadata','endConversation','error','message','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.'];(function(_0x41a14b,_0x650061){var _0x48ea55=function(_0x5d0a05){while(--_0x5d0a05){_0x41a14b['push'](_0x41a14b['shift']());}};_0x48ea55(++_0x650061);}(_0x5b20,0x86));var _0x05b2=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x5b20[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x05b2('0x0'));var moment=require(_0x05b2('0x1'));var apiai=require(_0x05b2('0x2'));var md5=require(_0x05b2('0x3'));var utils=require(_0x05b2('0x4'));var logger=require(_0x05b2('0x5'))(_0x05b2('0x6'));var rpc={'chatMessage':require(_0x05b2('0x7')),'openchannelMessage':require(_0x05b2('0x8')),'mailMessage':require(_0x05b2('0x9')),'smsMessage':require(_0x05b2('0xa')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x05b2('0xb'))};exports[_0x05b2('0xc')]=function(_0x541855,_0x24f11f){return function(_0x43cd94){try{if(!_[_0x05b2('0xd')](this[_0x05b2('0xe')][_0x05b2('0xf')])){logger[_0x05b2('0x10')](_0x05b2('0x11'),_0x541855,_0x05b2('0x12'));return _0x43cd94[_0x05b2('0x13')]();}var _0x2b10a5={'ContactId':this[_0x05b2('0x14')]['id'],'sentAt':moment()[_0x05b2('0x15')](_0x05b2('0x16')),'direction':_0x05b2('0x17')};if(this[_0x05b2('0x18')]===_0x05b2('0x19')||this['channel']===_0x05b2('0x1a')){_0x2b10a5[_0x05b2('0x1b')]=this[_0x05b2('0xe')][_0x05b2('0x1b')];}var _0x5c71e2=this[_0x05b2('0x18')];if(_0x5c71e2===_0x05b2('0x1c')){_0x2b10a5[_0x05b2('0x1d')]=this['account']['id'];}else{_0x2b10a5[_['upperFirst'](_0x5c71e2)+_0x05b2('0x1e')]=this[_0x05b2('0x1f')]['id'];}_0x2b10a5[_['upperFirst'](_0x5c71e2)+'InteractionId']=this[_0x05b2('0xe')]['id'];if(this[_0x05b2('0xe')][_0x05b2('0x20')]){var _0x189114=_0x24f11f[0x2];if(!_[_0x05b2('0x21')](_0x189114)){_0x2b10a5[_0x05b2('0x22')]=utils[_0x05b2('0x23')](_0x189114,this);return rpc[_0x5c71e2+_0x05b2('0x24')][_0x05b2('0x25')](_0x2b10a5)[_0x05b2('0x26')](function(_0x8c390d){logger[_0x05b2('0x10')](_0x05b2('0x11'),_0x541855,_0x2b10a5[_0x05b2('0x22')]);})[_0x05b2('0x27')](function(_0x130a27){logger['error'](_0x05b2('0x11'),_0x541855,JSON[_0x05b2('0x28')](_0x130a27));})[_0x05b2('0x29')](function(){logger[_0x05b2('0x10')](_0x05b2('0x2a'),_0x541855);_0x43cd94[_0x05b2('0x2b')]();});}else{logger[_0x05b2('0x10')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x541855);_0x43cd94[_0x05b2('0x2b')]();}}else{var _0x4b14ec=this;var _0x2874e8=apiai(_0x24f11f[0x0],{'language':_0x24f11f[0x1]||'en'});return _0x2874e8[_0x05b2('0x2c')](this['message'][_0x05b2('0x22')],{'sessionId':md5(this[_0x05b2('0xe')]['id'])})[_0x05b2('0x26')](function(_0x4221f5){_0x4b14ec[_0x05b2('0x22')][_0x05b2('0x2d')]=_0x4221f5;_0x2b10a5[_0x05b2('0x22')]=_0x4221f5[_0x05b2('0x2e')]['fulfillment']['speech'];_0x2b10a5['providerName']=_0x05b2('0x2d');_0x2b10a5['providerResponse']=JSON['stringify'](_0x4221f5);return rpc[_0x5c71e2+_0x05b2('0x24')][_0x05b2('0x25')](_0x2b10a5)[_0x05b2('0x26')](function(_0x218b77){logger[_0x05b2('0x10')](_0x05b2('0x11'),_0x541855,_0x2b10a5[_0x05b2('0x22')]);if(_0x4221f5['result'][_0x05b2('0x2f')][_0x05b2('0x30')]){_0x43cd94[_0x05b2('0x13')]();}else{_0x43cd94[_0x05b2('0x2b')]();}})['catch'](function(_0x1d2ea1){logger['error'](_0x05b2('0x11'),_0x541855,JSON[_0x05b2('0x28')](_0x1d2ea1));_0x43cd94[_0x05b2('0x13')]();});})[_0x05b2('0x27')](function(_0x5b83ca){logger[_0x05b2('0x31')]('[%s][DIALOGFLOW]\x20%s',_0x541855,_0x5b83ca[_0x05b2('0x32')]);_0x43cd94['next']();});}}catch(_0x27f699){logger[_0x05b2('0x31')](_0x05b2('0x11'),_0x541855,JSON['stringify'](_0x27f699));_0x43cd94['stop']();}};};
\ No newline at end of file
+var _0xdc59=['error','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','message','dialogflow','speech','providerName','providerResponse','then','metadata','endConversation','lodash','moment','apiai-promise','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','created','body','getMustacheRender','Message','create','catch'];(function(_0xd388f8,_0x42ef6b){var _0x4fa313=function(_0x3cdf7f){while(--_0x3cdf7f){_0xd388f8['push'](_0xd388f8['shift']());}};_0x4fa313(++_0x42ef6b);}(_0xdc59,0x12c));var _0x9dc5=function(_0x2d89ce,_0x24d58d){_0x2d89ce=_0x2d89ce-0x0;var _0x3fad10=_0xdc59[_0x2d89ce];return _0x3fad10;};'use strict';var _=require(_0x9dc5('0x0'));var moment=require(_0x9dc5('0x1'));var apiai=require(_0x9dc5('0x2'));var md5=require('md5');var utils=require('./utils');var logger=require(_0x9dc5('0x3'))(_0x9dc5('0x4'));var rpc={'chatMessage':require(_0x9dc5('0x5')),'openchannelMessage':require(_0x9dc5('0x6')),'mailMessage':require(_0x9dc5('0x7')),'smsMessage':require(_0x9dc5('0x8')),'faxMessage':require(_0x9dc5('0x9')),'whatsappMessage':require(_0x9dc5('0xa'))};exports[_0x9dc5('0xb')]=function(_0x48beee,_0x42941b){return function(_0x10b268){try{if(!_[_0x9dc5('0xc')](this[_0x9dc5('0xd')][_0x9dc5('0xe')])){logger[_0x9dc5('0xf')](_0x9dc5('0x10'),_0x48beee,_0x9dc5('0x11'));return _0x10b268[_0x9dc5('0x12')]();}var _0x32c99b={'ContactId':this['contact']['id'],'sentAt':moment()[_0x9dc5('0x13')](_0x9dc5('0x14')),'direction':_0x9dc5('0x15')};if(this[_0x9dc5('0x16')]==='sms'||this[_0x9dc5('0x16')]===_0x9dc5('0x17')){_0x32c99b[_0x9dc5('0x18')]=this['interaction'][_0x9dc5('0x18')];}var _0x27e748=this[_0x9dc5('0x16')];if(_0x27e748===_0x9dc5('0x19')){_0x32c99b[_0x9dc5('0x1a')]=this[_0x9dc5('0x1b')]['id'];}else{_0x32c99b[_[_0x9dc5('0x1c')](_0x27e748)+_0x9dc5('0x1d')]=this[_0x9dc5('0x1b')]['id'];}_0x32c99b[_[_0x9dc5('0x1c')](_0x27e748)+'InteractionId']=this[_0x9dc5('0xd')]['id'];if(this['interaction'][_0x9dc5('0x1e')]){var _0x9c1b35=_0x42941b[0x2];if(!_['isEmpty'](_0x9c1b35)){_0x32c99b[_0x9dc5('0x1f')]=utils[_0x9dc5('0x20')](_0x9c1b35,this);return rpc[_0x27e748+_0x9dc5('0x21')][_0x9dc5('0x22')](_0x32c99b)['then'](function(_0x4493c7){logger[_0x9dc5('0xf')](_0x9dc5('0x10'),_0x48beee,_0x32c99b[_0x9dc5('0x1f')]);})[_0x9dc5('0x23')](function(_0x4e999c){logger[_0x9dc5('0x24')](_0x9dc5('0x10'),_0x48beee,JSON[_0x9dc5('0x25')](_0x4e999c));})['finally'](function(){logger['info'](_0x9dc5('0x26'),_0x48beee);_0x10b268['stop']();});}else{logger[_0x9dc5('0xf')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x48beee);_0x10b268[_0x9dc5('0x27')]();}}else{var _0x5c8956=this;var _0x100ae7=apiai(_0x42941b[0x0],{'language':_0x42941b[0x1]||'en'});return _0x100ae7['textRequest'](this[_0x9dc5('0x28')][_0x9dc5('0x1f')],{'sessionId':md5(this[_0x9dc5('0xd')]['id'])})['then'](function(_0x184d78){_0x5c8956[_0x9dc5('0x1f')][_0x9dc5('0x29')]=_0x184d78;_0x32c99b[_0x9dc5('0x1f')]=_0x184d78['result']['fulfillment'][_0x9dc5('0x2a')];_0x32c99b[_0x9dc5('0x2b')]=_0x9dc5('0x29');_0x32c99b[_0x9dc5('0x2c')]=JSON['stringify'](_0x184d78);return rpc[_0x27e748+'Message'][_0x9dc5('0x22')](_0x32c99b)[_0x9dc5('0x2d')](function(_0x483778){logger[_0x9dc5('0xf')](_0x9dc5('0x10'),_0x48beee,_0x32c99b[_0x9dc5('0x1f')]);if(_0x184d78['result'][_0x9dc5('0x2e')][_0x9dc5('0x2f')]){_0x10b268[_0x9dc5('0x12')]();}else{_0x10b268[_0x9dc5('0x27')]();}})[_0x9dc5('0x23')](function(_0x2d73e5){logger['error'](_0x9dc5('0x10'),_0x48beee,JSON[_0x9dc5('0x25')](_0x2d73e5));_0x10b268[_0x9dc5('0x12')]();});})[_0x9dc5('0x23')](function(_0x420158){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x48beee,_0x420158[_0x9dc5('0x28')]);_0x10b268[_0x9dc5('0x12')]();});}}catch(_0x4fb3f5){logger[_0x9dc5('0x24')](_0x9dc5('0x10'),_0x48beee,JSON[_0x9dc5('0x25')](_0x4fb3f5));_0x10b268[_0x9dc5('0x27')]();}};};
\ No newline at end of file
index a3299ed..c384ee6 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe984=['end_conversation','boolValue','DIALOGFLOWV2_INTENTNAME','intent','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','DIALOGFLOWV2_LANGUAGECODE','languageCode','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','dialogflowV2','providerResponse','fulfillmentText','push','all','next','dialogflow','moment','bluebird','routing','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','Message','create','then','[%s][DIALOGFLOWV2]\x20%s','body','catch','error','consequence','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','whatsapp','phone','ChatWebsiteId','upperFirst','account','InteractionId','interaction','isEmpty','stringify','info','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','length','diagnosticInfo','queryResult','fields','DIALOGFLOWV2_ACTION','action','allRequiredParamsPresent'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe984,0x1aa));var _0x4e98=function(_0x1b76e6,_0x598520){_0x1b76e6=_0x1b76e6-0x0;var _0x333b53=_0xe984[_0x1b76e6];return _0x333b53;};'use strict';var _=require('lodash');var dialogflow=require(_0x4e98('0x0'));var md5=require('md5');var moment=require(_0x4e98('0x1'));var Promise=require(_0x4e98('0x2'));var logger=require('../../../../config/logger')(_0x4e98('0x3'));var utils=require(_0x4e98('0x4'));var rpc={'chatMessage':require(_0x4e98('0x5')),'openchannelMessage':require(_0x4e98('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x4e98('0x7')),'faxMessage':require(_0x4e98('0x8')),'whatsappMessage':require(_0x4e98('0x9'))};function createMessage(_0x1985ab,_0xa11e18,_0x369c3f,_0x38d594){return new Promise(function(_0x5eea7,_0x57d8e1){var _0x13b7b1=_['clone'](_0x369c3f);_0x13b7b1['body']=_0x38d594;return rpc[_0xa11e18+_0x4e98('0xa')][_0x4e98('0xb')](_0x13b7b1)[_0x4e98('0xc')](function(){logger['info'](_0x4e98('0xd'),_0x1985ab,_0x13b7b1[_0x4e98('0xe')]);_0x5eea7();})[_0x4e98('0xf')](function(_0x246983){logger[_0x4e98('0x10')](_0x4e98('0xd'),_0x1985ab,JSON['stringify'](_0x246983));_0x57d8e1(_0x246983);});});}exports[_0x4e98('0x11')]=function(_0x136a43,_0x4c871a){return function(_0x25a775){try{if(!_['isNil'](this['interaction'][_0x4e98('0x12')])){logger['info'](_0x4e98('0xd'),_0x136a43,_0x4e98('0x13'));return _0x25a775['next']();}var _0x30a080={'ContactId':this['contact']['id'],'sentAt':moment()[_0x4e98('0x14')](_0x4e98('0x15')),'direction':_0x4e98('0x16')};if(this[_0x4e98('0x17')]===_0x4e98('0x18')||this[_0x4e98('0x17')]===_0x4e98('0x19')){_0x30a080[_0x4e98('0x1a')]=this['interaction'][_0x4e98('0x1a')];}var _0x335e71=this[_0x4e98('0x17')];if(_0x335e71==='chat'){_0x30a080[_0x4e98('0x1b')]=this['account']['id'];}else{_0x30a080[_[_0x4e98('0x1c')](_0x335e71)+'AccountId']=this[_0x4e98('0x1d')]['id'];}_0x30a080[_[_0x4e98('0x1c')](_0x335e71)+_0x4e98('0x1e')]=this[_0x4e98('0x1f')]['id'];if(this[_0x4e98('0x1f')]['created']){var _0x2552fa=_0x4c871a[0x4];if(!_[_0x4e98('0x20')](_0x2552fa)){_0x30a080[_0x4e98('0xe')]=utils['getMustacheRender'](_0x2552fa,this);return rpc[_0x335e71+_0x4e98('0xa')][_0x4e98('0xb')](_0x30a080)['then'](function(_0x588758){logger['info'](_0x4e98('0xd'),_0x136a43,_0x30a080[_0x4e98('0xe')]);})[_0x4e98('0xf')](function(_0x5934a6){logger[_0x4e98('0x10')](_0x4e98('0xd'),_0x136a43,JSON[_0x4e98('0x21')](_0x5934a6));})['finally'](function(){logger[_0x4e98('0x22')](_0x4e98('0x23'),_0x136a43);_0x25a775[_0x4e98('0x24')]();});}else{logger[_0x4e98('0x22')](_0x4e98('0x25'),_0x136a43);_0x25a775['stop']();}}else{var _0x2ed0b6=this;var _0x65f462=_0x4c871a[0x2][_0x4e98('0x26')](/\\n/g,'\x0a');var _0x577245={'credentials':{'private_key':_0x65f462,'client_email':_0x4c871a[0x1]}};var _0x14939b=new dialogflow[(_0x4e98('0x27'))](_0x577245);var _0x167121=_0x14939b[_0x4e98('0x28')](_0x4c871a[0x0],md5(_0x2ed0b6[_0x4e98('0x1f')]['id']));var _0x491082={'session':_0x167121,'queryInput':{'text':{'text':_0x2ed0b6[_0x4e98('0x29')][_0x4e98('0xe')],'languageCode':_0x4c871a[0x3]||'en'}}};return _0x14939b[_0x4e98('0x2a')](_0x491082)['then'](function(_0x43a919){if(_0x43a919&&_0x43a919[_0x4e98('0x2b')]){_0x2ed0b6[_0x4e98('0xe')]['dialogflowV2']=_0x43a919;var _0xbea447=_0x43a919[0x0];var _0x4b8629=_0xbea447['queryResult'][_0x4e98('0x2c')]&&_0xbea447[_0x4e98('0x2d')]['diagnosticInfo'][_0x4e98('0x2e')]?_0xbea447[_0x4e98('0x2d')]['diagnosticInfo'][_0x4e98('0x2e')]['end_conversation']['boolValue']:![];_0x2ed0b6['body'][_0x4e98('0x2f')]=_0xbea447[_0x4e98('0x2d')][_0x4e98('0x30')];_0x2ed0b6['body']['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0xbea447[_0x4e98('0x2d')][_0x4e98('0x31')];_0x2ed0b6[_0x4e98('0xe')]['DIALOGFLOWV2_ENDCONVERSATION']=_0xbea447[_0x4e98('0x2d')][_0x4e98('0x2c')]&&_0xbea447['queryResult'][_0x4e98('0x2c')][_0x4e98('0x2e')]?_0xbea447['queryResult'][_0x4e98('0x2c')][_0x4e98('0x2e')][_0x4e98('0x32')][_0x4e98('0x33')]:![];_0x2ed0b6[_0x4e98('0xe')][_0x4e98('0x34')]=_0xbea447[_0x4e98('0x2d')][_0x4e98('0x35')]['name'];_0x2ed0b6[_0x4e98('0xe')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0xbea447[_0x4e98('0x2d')][_0x4e98('0x35')][_0x4e98('0x36')];_0x2ed0b6['body'][_0x4e98('0x37')]=_0xbea447['queryResult'][_0x4e98('0x35')]['isFallback'];_0x2ed0b6[_0x4e98('0xe')][_0x4e98('0x38')]=_0xbea447['queryResult'][_0x4e98('0x39')];_0x2ed0b6[_0x4e98('0xe')]['DIALOGFLOWV2_QUERYTEXT']=_0xbea447['queryResult'][_0x4e98('0x3a')];_0x2ed0b6[_0x4e98('0xe')][_0x4e98('0x3b')]=_0xbea447[_0x4e98('0x2d')][_0x4e98('0x3c')];_0x30a080[_0x4e98('0x3d')]=_0x4e98('0x3e');_0x30a080[_0x4e98('0x3f')]=JSON['stringify'](_0x43a919);var _0x4f4ebd=[];for(var _0x297e41=0x0;_0x297e41<_0x43a919[_0x4e98('0x2b')];_0x297e41++){var _0x51f546=_0x43a919[_0x297e41];if(_0x51f546&&_0x51f546['queryResult']&&_0x51f546[_0x4e98('0x2d')][_0x4e98('0x40')]){_0x4f4ebd[_0x4e98('0x41')](createMessage(_0x136a43,_0x335e71,_0x30a080,_0x51f546[_0x4e98('0x2d')]['fulfillmentText']));}}return Promise[_0x4e98('0x42')](_0x4f4ebd)[_0x4e98('0xc')](function(){if(_0x4b8629){_0x25a775[_0x4e98('0x43')]();}else{_0x25a775[_0x4e98('0x24')]();}})[_0x4e98('0xf')](function(_0x366cc0){logger['error'](_0x4e98('0xd'),_0x136a43,JSON[_0x4e98('0x21')](_0x366cc0));_0x25a775['next']();});}})[_0x4e98('0xf')](function(_0x3e035e){logger[_0x4e98('0x10')]('[%s][DIALOGFLOWV2]\x20%s',_0x136a43,_0x3e035e[_0x4e98('0x29')]);_0x25a775['next']();});}}catch(_0x2f8750){logger[_0x4e98('0x10')](_0x4e98('0xd'),_0x136a43,JSON[_0x4e98('0x21')](_0x2f8750));_0x25a775[_0x4e98('0x24')]();}};};
\ No newline at end of file
+var _0x08bb=['error','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','boolValue','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','DIALOGFLOWV2_ISFALLBACKINTENT','languageCode','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','fulfillmentText','all','catch','lodash','dialogflow','moment','bluebird','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','create','then','body','[%s][DIALOGFLOWV2]\x20%s','stringify','consequence','isNil','interaction','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','ChatWebsiteId','upperFirst','AccountId','InteractionId','created','getMustacheRender'];(function(_0x4f93db,_0x3bcabb){var _0x10ac20=function(_0x48058c){while(--_0x48058c){_0x4f93db['push'](_0x4f93db['shift']());}};_0x10ac20(++_0x3bcabb);}(_0x08bb,0x177));var _0xb08b=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0x08bb[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0xb08b('0x0'));var dialogflow=require(_0xb08b('0x1'));var md5=require('md5');var moment=require(_0xb08b('0x2'));var Promise=require(_0xb08b('0x3'));var logger=require(_0xb08b('0x4'))(_0xb08b('0x5'));var utils=require('./utils');var rpc={'chatMessage':require(_0xb08b('0x6')),'openchannelMessage':require(_0xb08b('0x7')),'mailMessage':require(_0xb08b('0x8')),'smsMessage':require(_0xb08b('0x9')),'faxMessage':require(_0xb08b('0xa')),'whatsappMessage':require(_0xb08b('0xb'))};function createMessage(_0x2eeb47,_0x4fd380,_0x453f31,_0x13273c){return new Promise(function(_0x48470d,_0x304865){var _0x1ff2c6=_[_0xb08b('0xc')](_0x453f31);_0x1ff2c6['body']=_0x13273c;return rpc[_0x4fd380+'Message'][_0xb08b('0xd')](_0x1ff2c6)[_0xb08b('0xe')](function(){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x2eeb47,_0x1ff2c6[_0xb08b('0xf')]);_0x48470d();})['catch'](function(_0x3027b5){logger['error'](_0xb08b('0x10'),_0x2eeb47,JSON[_0xb08b('0x11')](_0x3027b5));_0x304865(_0x3027b5);});});}exports[_0xb08b('0x12')]=function(_0x45a5ef,_0x593732){return function(_0x28df7b){try{if(!_[_0xb08b('0x13')](this[_0xb08b('0x14')][_0xb08b('0x15')])){logger[_0xb08b('0x16')](_0xb08b('0x10'),_0x45a5ef,_0xb08b('0x17'));return _0x28df7b[_0xb08b('0x18')]();}var _0x1c3118={'ContactId':this[_0xb08b('0x19')]['id'],'sentAt':moment()[_0xb08b('0x1a')](_0xb08b('0x1b')),'direction':_0xb08b('0x1c')};if(this['channel']===_0xb08b('0x1d')||this[_0xb08b('0x1e')]===_0xb08b('0x1f')){_0x1c3118['phone']=this[_0xb08b('0x14')][_0xb08b('0x20')];}var _0x4c7cbd=this[_0xb08b('0x1e')];if(_0x4c7cbd==='chat'){_0x1c3118[_0xb08b('0x21')]=this['account']['id'];}else{_0x1c3118[_[_0xb08b('0x22')](_0x4c7cbd)+_0xb08b('0x23')]=this['account']['id'];}_0x1c3118[_['upperFirst'](_0x4c7cbd)+_0xb08b('0x24')]=this['interaction']['id'];if(this[_0xb08b('0x14')][_0xb08b('0x25')]){var _0x53af25=_0x593732[0x4];if(!_['isEmpty'](_0x53af25)){_0x1c3118[_0xb08b('0xf')]=utils[_0xb08b('0x26')](_0x53af25,this);return rpc[_0x4c7cbd+'Message']['create'](_0x1c3118)['then'](function(_0x25c34c){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x45a5ef,_0x1c3118[_0xb08b('0xf')]);})['catch'](function(_0x4ec847){logger[_0xb08b('0x27')]('[%s][DIALOGFLOWV2]\x20%s',_0x45a5ef,JSON[_0xb08b('0x11')](_0x4ec847));})[_0xb08b('0x28')](function(){logger[_0xb08b('0x16')](_0xb08b('0x29'),_0x45a5ef);_0x28df7b[_0xb08b('0x2a')]();});}else{logger[_0xb08b('0x16')](_0xb08b('0x2b'),_0x45a5ef);_0x28df7b[_0xb08b('0x2a')]();}}else{var _0xbada51=this;var _0xe44e2f=_0x593732[0x2][_0xb08b('0x2c')](/\\n/g,'\x0a');var _0x5b4f07={'credentials':{'private_key':_0xe44e2f,'client_email':_0x593732[0x1]}};var _0x280855=new dialogflow['SessionsClient'](_0x5b4f07);var _0x3ecb3e=_0x280855[_0xb08b('0x2d')](_0x593732[0x0],md5(_0xbada51[_0xb08b('0x14')]['id']));var _0x411fc2={'session':_0x3ecb3e,'queryInput':{'text':{'text':_0xbada51[_0xb08b('0x2e')][_0xb08b('0xf')],'languageCode':_0x593732[0x3]||'en'}}};return _0x280855[_0xb08b('0x2f')](_0x411fc2)[_0xb08b('0xe')](function(_0x47dddf){if(_0x47dddf&&_0x47dddf[_0xb08b('0x30')]){_0xbada51['body'][_0xb08b('0x31')]=_0x47dddf;var _0x59152a=_0x47dddf[0x0];var _0x1a9b9a=_0x59152a[_0xb08b('0x32')][_0xb08b('0x33')]&&_0x59152a[_0xb08b('0x32')][_0xb08b('0x33')][_0xb08b('0x34')]?_0x59152a[_0xb08b('0x32')][_0xb08b('0x33')][_0xb08b('0x34')][_0xb08b('0x35')]['boolValue']:![];_0xbada51[_0xb08b('0xf')]['DIALOGFLOWV2_ACTION']=_0x59152a['queryResult']['action'];_0xbada51[_0xb08b('0xf')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x59152a[_0xb08b('0x32')][_0xb08b('0x36')];_0xbada51['body'][_0xb08b('0x37')]=_0x59152a['queryResult'][_0xb08b('0x33')]&&_0x59152a[_0xb08b('0x32')][_0xb08b('0x33')][_0xb08b('0x34')]?_0x59152a[_0xb08b('0x32')]['diagnosticInfo']['fields'][_0xb08b('0x35')][_0xb08b('0x38')]:![];_0xbada51[_0xb08b('0xf')]['DIALOGFLOWV2_INTENTNAME']=_0x59152a[_0xb08b('0x32')][_0xb08b('0x39')][_0xb08b('0x3a')];_0xbada51['body'][_0xb08b('0x3b')]=_0x59152a['queryResult']['intent']['displayName'];_0xbada51[_0xb08b('0xf')][_0xb08b('0x3c')]=_0x59152a[_0xb08b('0x32')][_0xb08b('0x39')]['isFallback'];_0xbada51[_0xb08b('0xf')]['DIALOGFLOWV2_LANGUAGECODE']=_0x59152a[_0xb08b('0x32')][_0xb08b('0x3d')];_0xbada51['body'][_0xb08b('0x3e')]=_0x59152a[_0xb08b('0x32')]['queryText'];_0xbada51[_0xb08b('0xf')][_0xb08b('0x3f')]=_0x59152a[_0xb08b('0x32')][_0xb08b('0x40')];_0x1c3118[_0xb08b('0x41')]=_0xb08b('0x31');_0x1c3118['providerResponse']=JSON[_0xb08b('0x11')](_0x47dddf);var _0x2a78f9=[];for(var _0x567532=0x0;_0x567532<_0x47dddf[_0xb08b('0x30')];_0x567532++){var _0x4ae2f8=_0x47dddf[_0x567532];if(_0x4ae2f8&&_0x4ae2f8[_0xb08b('0x32')]&&_0x4ae2f8[_0xb08b('0x32')][_0xb08b('0x42')]){_0x2a78f9['push'](createMessage(_0x45a5ef,_0x4c7cbd,_0x1c3118,_0x4ae2f8[_0xb08b('0x32')][_0xb08b('0x42')]));}}return Promise[_0xb08b('0x43')](_0x2a78f9)[_0xb08b('0xe')](function(){if(_0x1a9b9a){_0x28df7b[_0xb08b('0x18')]();}else{_0x28df7b[_0xb08b('0x2a')]();}})[_0xb08b('0x44')](function(_0xa2aff1){logger[_0xb08b('0x27')](_0xb08b('0x10'),_0x45a5ef,JSON[_0xb08b('0x11')](_0xa2aff1));_0x28df7b[_0xb08b('0x18')]();});}})[_0xb08b('0x44')](function(_0x1edc8d){logger[_0xb08b('0x27')](_0xb08b('0x10'),_0x45a5ef,_0x1edc8d[_0xb08b('0x2e')]);_0x28df7b[_0xb08b('0x18')]();});}}catch(_0x61e0e3){logger['error'](_0xb08b('0x10'),_0x45a5ef,JSON[_0xb08b('0x11')](_0x61e0e3));_0x28df7b['stop']();}};};
\ No newline at end of file
index 460c0d8..f204f56 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x505d=['replace','length','error','[%s][GOTOIF]\x20%s','message','join','stop','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender'];(function(_0x9ebb4a,_0x44a670){var _0x5c89da=function(_0x1e8f94){while(--_0x1e8f94){_0x9ebb4a['push'](_0x9ebb4a['shift']());}};_0x5c89da(++_0x44a670);}(_0x505d,0x1a6));var _0xd505=function(_0x99868f,_0xbdb8e7){_0x99868f=_0x99868f-0x0;var _0x27a71b=_0x505d[_0x99868f];return _0x27a71b;};'use strict';var schema=require(_0xd505('0x0'));var _=require(_0xd505('0x1'));var htmlToText=require('html-to-text');var utils=require('./utils');var logger=require('../../../../config/logger')(_0xd505('0x2'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xd505('0x3')},'priorityTrue':{'type':_0xd505('0x4'),'message':_0xd505('0x5')},'priorityFalse':{'type':'number','message':_0xd505('0x6')}});exports[_0xd505('0x7')]=function(_0x5cc7d1,_0x55e542){return function(_0x4247b1){try{var _0xe7fd77={'condition':htmlToText[_0xd505('0x8')](utils[_0xd505('0x9')](_0x55e542[0x0],this),{'wordwrap':![]})[_0xd505('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x55e542[0x1],'priorityFalse':_0x55e542[0x2]};var _0xd38092=gotoif[_0xd505('0x0')](_0xe7fd77,{'typecast':!![]});if(_0xd38092[_0xd505('0xb')]){logger[_0xd505('0xc')](_0xd505('0xd'),_0x5cc7d1,_['map'](_0xd38092,_0xd505('0xe'))[_0xd505('0xf')](',\x20'));_0x4247b1[_0xd505('0x10')]();}else{try{var _0x34744e=eval('('+_0xe7fd77['condition']+')');var _0x5c57f8=_0x34744e?_0xe7fd77[_0xd505('0x11')]:_0xe7fd77[_0xd505('0x12')];logger[_0xd505('0x13')](_0xd505('0x14'),_0x5cc7d1,_0xe7fd77['condition'],_0x34744e,_0x5c57f8||_0xd505('0x15'));if(_0x5c57f8){var _0x53f2b4=_[_0xd505('0x16')](_0x4247b1[_0xd505('0x17')](),{'p':_0x5c57f8});if(_0x53f2b4>=0x0){logger[_0xd505('0x13')](_0xd505('0x18'),_0x5cc7d1,_0x5c57f8||_0xd505('0x15'),_0x53f2b4);_0x4247b1[_0xd505('0x15')](_0x53f2b4);}else{logger['info'](_0xd505('0x19'),_0x5cc7d1,_0x5c57f8||'next');_0x4247b1[_0xd505('0x10')]();}}else{_0x4247b1[_0xd505('0x15')]();}}catch(_0x2480ba){logger[_0xd505('0xc')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x5cc7d1,_0x2480ba['message']);_0x4247b1[_0xd505('0x10')]();}}}catch(_0x5b127a){logger[_0xd505('0xc')](_0xd505('0xd'),_0x5cc7d1,JSON[_0xd505('0x1a')](_0x5b127a));_0x4247b1[_0xd505('0x10')]();}};};
\ No newline at end of file
+var _0x7ca4=['condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20eval\x20error:\x20%s','stop','error','[%s][GOTOIF]\x20%s','stringify','validate','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','message','join'];(function(_0x5565d8,_0x1a65d3){var _0x482b0d=function(_0x43809b){while(--_0x43809b){_0x5565d8['push'](_0x5565d8['shift']());}};_0x482b0d(++_0x1a65d3);}(_0x7ca4,0xc8));var _0x47ca=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7ca4[_0xa464c9];return _0x3d73c4;};'use strict';var schema=require(_0x47ca('0x0'));var _=require('lodash');var htmlToText=require(_0x47ca('0x1'));var utils=require(_0x47ca('0x2'));var logger=require(_0x47ca('0x3'))(_0x47ca('0x4'));var gotoif=schema({'condition':{'type':_0x47ca('0x5'),'required':!![],'message':_0x47ca('0x6')},'priorityTrue':{'type':_0x47ca('0x7'),'message':_0x47ca('0x8')},'priorityFalse':{'type':'number','message':_0x47ca('0x9')}});exports[_0x47ca('0xa')]=function(_0x51b80d,_0x61fc1c){return function(_0x1f5ec9){try{var _0x3e90ca={'condition':htmlToText[_0x47ca('0xb')](utils[_0x47ca('0xc')](_0x61fc1c[0x0],this),{'wordwrap':![]})[_0x47ca('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x61fc1c[0x1],'priorityFalse':_0x61fc1c[0x2]};var _0x32b049=gotoif[_0x47ca('0x0')](_0x3e90ca,{'typecast':!![]});if(_0x32b049[_0x47ca('0xe')]){logger['error']('[%s][GOTOIF]\x20%s',_0x51b80d,_['map'](_0x32b049,_0x47ca('0xf'))[_0x47ca('0x10')](',\x20'));_0x1f5ec9['stop']();}else{try{var _0x31e7d2=eval('('+_0x3e90ca[_0x47ca('0x11')]+')');var _0x30cac4=_0x31e7d2?_0x3e90ca[_0x47ca('0x12')]:_0x3e90ca[_0x47ca('0x13')];logger[_0x47ca('0x14')](_0x47ca('0x15'),_0x51b80d,_0x3e90ca[_0x47ca('0x11')],_0x31e7d2,_0x30cac4||_0x47ca('0x16'));if(_0x30cac4){var _0x5b2bf2=_[_0x47ca('0x17')](_0x1f5ec9[_0x47ca('0x18')](),{'p':_0x30cac4});if(_0x5b2bf2>=0x0){logger[_0x47ca('0x14')](_0x47ca('0x19'),_0x51b80d,_0x30cac4||_0x47ca('0x16'),_0x5b2bf2);_0x1f5ec9['next'](_0x5b2bf2);}else{logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x51b80d,_0x30cac4||_0x47ca('0x16'));_0x1f5ec9['stop']();}}else{_0x1f5ec9[_0x47ca('0x16')]();}}catch(_0x145b61){logger['error'](_0x47ca('0x1a'),_0x51b80d,_0x145b61[_0x47ca('0xf')]);_0x1f5ec9[_0x47ca('0x1b')]();}}}catch(_0x1d0d7b){logger[_0x47ca('0x1c')](_0x47ca('0x1d'),_0x51b80d,JSON[_0x47ca('0x1e')](_0x1d0d7b));_0x1f5ec9[_0x47ca('0x1b')]();}};};
\ No newline at end of file
index ab80229..3ae5020 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc45b=['routing','consequence','validate','length','error','map','message','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stop','stringify','../../../../config/logger'];(function(_0x41755a,_0x1e6703){var _0x1ace54=function(_0x57fdc7){while(--_0x57fdc7){_0x41755a['push'](_0x41755a['shift']());}};_0x1ace54(++_0x1e6703);}(_0xc45b,0x87));var _0xbc45=function(_0x336a59,_0x23d6f7){_0x336a59=_0x336a59-0x0;var _0x5cc4b6=_0xc45b[_0x336a59];return _0x5cc4b6;};'use strict';var schema=require('validate');var _=require('lodash');var logger=require(_0xbc45('0x0'))(_0xbc45('0x1'));var gotop=schema({'priority':{'type':'number','required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xbc45('0x2')]=function(_0x367b26,_0x295e53){return function(_0xbfbff0){try{var _0x32411c={'priority':_0x295e53[0x0]};var _0x1ed95c=gotop[_0xbc45('0x3')](_0x32411c,{'typecast':!![]});if(_0x1ed95c[_0xbc45('0x4')]){logger[_0xbc45('0x5')]('[%s][GOTOP]\x20%s',_0x367b26,_[_0xbc45('0x6')](_0x1ed95c,_0xbc45('0x7'))['join'](',\x20'));_0xbfbff0['stop']();}else{logger[_0xbc45('0x8')](_0xbc45('0x9'),_0x367b26,_0x32411c['priority']);if(_0x32411c[_0xbc45('0xa')]){var _0x5047a0=_[_0xbc45('0xb')](_0xbfbff0['rules'](),{'p':_0x32411c[_0xbc45('0xa')]});if(_0x5047a0>=0x0){logger[_0xbc45('0x8')](_0xbc45('0xc'),_0x367b26,_0x32411c[_0xbc45('0xa')]||_0xbc45('0xd'),_0x5047a0);_0xbfbff0[_0xbc45('0xd')](_0x5047a0);}else{logger[_0xbc45('0x8')](_0xbc45('0xe'),_0x367b26,_0x32411c[_0xbc45('0xa')]||_0xbc45('0xd'));_0xbfbff0[_0xbc45('0xf')]();}}else{_0xbfbff0['next']();}}}catch(_0x36eb7c){logger[_0xbc45('0x5')]('[%s][GOTOP]\x20%s',_0x367b26,JSON[_0xbc45('0x10')](_0x36eb7c));_0xbfbff0[_0xbc45('0xf')]();}};};
\ No newline at end of file
+var _0xe930=['stop','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','info','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOP]\x20%s','stringify','lodash','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','validate','length','map','message','join'];(function(_0x400169,_0x1b4acb){var _0x5cfd4c=function(_0x3a3ab){while(--_0x3a3ab){_0x400169['push'](_0x400169['shift']());}};_0x5cfd4c(++_0x1b4acb);}(_0xe930,0xbf));var _0x0e93=function(_0x1911ed,_0x4e8c73){_0x1911ed=_0x1911ed-0x0;var _0x11edaa=_0xe930[_0x1911ed];return _0x11edaa;};'use strict';var schema=require('validate');var _=require(_0x0e93('0x0'));var logger=require(_0x0e93('0x1'))(_0x0e93('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x0e93('0x3')}});exports['consequence']=function(_0x3c5b20,_0x38598a){return function(_0x30cb7b){try{var _0x55c695={'priority':_0x38598a[0x0]};var _0x33237d=gotop[_0x0e93('0x4')](_0x55c695,{'typecast':!![]});if(_0x33237d[_0x0e93('0x5')]){logger['error']('[%s][GOTOP]\x20%s',_0x3c5b20,_[_0x0e93('0x6')](_0x33237d,_0x0e93('0x7'))[_0x0e93('0x8')](',\x20'));_0x30cb7b[_0x0e93('0x9')]();}else{logger['info'](_0x0e93('0xa'),_0x3c5b20,_0x55c695['priority']);if(_0x55c695[_0x0e93('0xb')]){var _0x8cd075=_[_0x0e93('0xc')](_0x30cb7b[_0x0e93('0xd')](),{'p':_0x55c695['priority']});if(_0x8cd075>=0x0){logger[_0x0e93('0xe')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3c5b20,_0x55c695[_0x0e93('0xb')]||_0x0e93('0xf'),_0x8cd075);_0x30cb7b['next'](_0x8cd075);}else{logger[_0x0e93('0xe')](_0x0e93('0x10'),_0x3c5b20,_0x55c695['priority']||_0x0e93('0xf'));_0x30cb7b[_0x0e93('0x9')]();}}else{_0x30cb7b['next']();}}}catch(_0x358b00){logger[_0x0e93('0x11')](_0x0e93('0x12'),_0x3c5b20,JSON[_0x0e93('0x13')](_0x358b00));_0x30cb7b['stop']();}};};
\ No newline at end of file
index d74d851..31e7537 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbd9f=['../../rpc/smsMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','contact','chat','ChatWebsiteId','account','channel','InteractionId','Message','create','then','info','next','catch','error','stringify','stop','[%s][MESSAGE]\x20%s','routing','../../rpc/openchannelMessage'];(function(_0x5ef8d3,_0x2256b1){var _0x578599=function(_0xa80110){while(--_0xa80110){_0x5ef8d3['push'](_0x5ef8d3['shift']());}};_0x578599(++_0x2256b1);}(_0xbd9f,0x98));var _0xfbd9=function(_0x2a1280,_0x5e126e){_0x2a1280=_0x2a1280-0x0;var _0x49eafc=_0xbd9f[_0x2a1280];return _0x49eafc;};'use strict';var _=require('lodash');var utils=require('./utils');var logger=require('../../../../config/logger')(_0xfbd9('0x0'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xfbd9('0x1')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xfbd9('0x2')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xfbd9('0x3'))};exports[_0xfbd9('0x4')]=function(_0x18696a,_0x5a9faf){return function(_0x3329ae){try{var _0x4c6a18={'body':utils[_0xfbd9('0x5')](_0x5a9faf[0x0],this),'ContactId':this[_0xfbd9('0x6')]['id']};if(this['channel']===_0xfbd9('0x7')){_0x4c6a18[_0xfbd9('0x8')]=this[_0xfbd9('0x9')]['id'];}else{_0x4c6a18[_['upperFirst'](this[_0xfbd9('0xa')])+'AccountId']=this[_0xfbd9('0x9')]['id'];}_0x4c6a18[_['upperFirst'](this[_0xfbd9('0xa')])+_0xfbd9('0xb')]=this['interaction']['id'];if(rpc[this[_0xfbd9('0xa')]+_0xfbd9('0xc')]){return rpc[this['channel']+_0xfbd9('0xc')][_0xfbd9('0xd')](_0x4c6a18)[_0xfbd9('0xe')](function(_0x527707){logger[_0xfbd9('0xf')]('[%s][MESSAGE]\x20%s',_0x18696a,_0x4c6a18['body']);_0x3329ae[_0xfbd9('0x10')]();})[_0xfbd9('0x11')](function(_0x159743){logger[_0xfbd9('0x12')]('[%s][MESSAGE]\x20%s',_0x18696a,JSON[_0xfbd9('0x13')](_0x159743));_0x3329ae[_0xfbd9('0x14')]();});}}catch(_0x2b9553){logger['error'](_0xfbd9('0x15'),_0x18696a,JSON[_0xfbd9('0x13')](_0x2b9553));_0x3329ae['stop']();}};};
\ No newline at end of file
+var _0x4f54=['catch','error','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','contact','channel','chat','account','upperFirst','InteractionId','interaction','Message','then','[%s][MESSAGE]\x20%s','body','next'];(function(_0x13f0e2,_0x51e16c){var _0x498b8b=function(_0x55b315){while(--_0x55b315){_0x13f0e2['push'](_0x13f0e2['shift']());}};_0x498b8b(++_0x51e16c);}(_0x4f54,0x123));var _0x44f5=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x4f54[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x44f5('0x0'));var utils=require(_0x44f5('0x1'));var logger=require(_0x44f5('0x2'))(_0x44f5('0x3'));var rpc={'chatMessage':require(_0x44f5('0x4')),'openchannelMessage':require(_0x44f5('0x5')),'mailMessage':require(_0x44f5('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x44f5('0x7')),'whatsappMessage':require(_0x44f5('0x8'))};exports['consequence']=function(_0x5560fa,_0x4b15c6){return function(_0x5815ed){try{var _0x269636={'body':utils['getMustacheRender'](_0x4b15c6[0x0],this),'ContactId':this[_0x44f5('0x9')]['id']};if(this[_0x44f5('0xa')]===_0x44f5('0xb')){_0x269636['ChatWebsiteId']=this[_0x44f5('0xc')]['id'];}else{_0x269636[_[_0x44f5('0xd')](this[_0x44f5('0xa')])+'AccountId']=this[_0x44f5('0xc')]['id'];}_0x269636[_[_0x44f5('0xd')](this[_0x44f5('0xa')])+_0x44f5('0xe')]=this[_0x44f5('0xf')]['id'];if(rpc[this[_0x44f5('0xa')]+_0x44f5('0x10')]){return rpc[this[_0x44f5('0xa')]+_0x44f5('0x10')]['create'](_0x269636)[_0x44f5('0x11')](function(_0x43e37a){logger['info'](_0x44f5('0x12'),_0x5560fa,_0x269636[_0x44f5('0x13')]);_0x5815ed[_0x44f5('0x14')]();})[_0x44f5('0x15')](function(_0x1ae25f){logger[_0x44f5('0x16')](_0x44f5('0x12'),_0x5560fa,JSON['stringify'](_0x1ae25f));_0x5815ed[_0x44f5('0x17')]();});}}catch(_0x26361f){logger[_0x44f5('0x16')]('[%s][MESSAGE]\x20%s',_0x5560fa,JSON['stringify'](_0x26361f));_0x5815ed['stop']();}};};
\ No newline at end of file
index 0f3a247..526baea 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdfe0=['consequence','[%s][NOOP]\x20%s','stringify','stop','./utils','../../../../config/logger'];(function(_0xb94ea9,_0x3b469a){var _0xd50eca=function(_0x2d9a33){while(--_0x2d9a33){_0xb94ea9['push'](_0xb94ea9['shift']());}};_0xd50eca(++_0x3b469a);}(_0xdfe0,0xb8));var _0x0dfe=function(_0x326c89,_0x490b83){_0x326c89=_0x326c89-0x0;var _0x7918bb=_0xdfe0[_0x326c89];return _0x7918bb;};'use strict';var utils=require(_0x0dfe('0x0'));var logger=require(_0x0dfe('0x1'))('routing');exports[_0x0dfe('0x2')]=function(_0xf964f7,_0x59a1b6){return function(_0x24f0d1){try{logger['info'](_0x0dfe('0x3'),_0xf964f7,utils['getMustacheRender'](_0x59a1b6[0x0],this));_0x24f0d1['next']();}catch(_0xa1eb5f){logger['error'](_0x0dfe('0x3'),_0xf964f7,JSON[_0x0dfe('0x4')](_0xa1eb5f));_0x24f0d1[_0x0dfe('0x5')]();}};};
\ No newline at end of file
+var _0x73db=['./utils','../../../../config/logger','routing','consequence','info','next','error','[%s][NOOP]\x20%s','stringify','stop'];(function(_0x124afc,_0x555e96){var _0x3af593=function(_0x160910){while(--_0x160910){_0x124afc['push'](_0x124afc['shift']());}};_0x3af593(++_0x555e96);}(_0x73db,0xfa));var _0xb73d=function(_0x30b09f,_0x261971){_0x30b09f=_0x30b09f-0x0;var _0x2c7d6e=_0x73db[_0x30b09f];return _0x2c7d6e;};'use strict';var utils=require(_0xb73d('0x0'));var logger=require(_0xb73d('0x1'))(_0xb73d('0x2'));exports[_0xb73d('0x3')]=function(_0xa9f022,_0x1cc54e){return function(_0x42e81a){try{logger[_0xb73d('0x4')]('[%s][NOOP]\x20%s',_0xa9f022,utils['getMustacheRender'](_0x1cc54e[0x0],this));_0x42e81a[_0xb73d('0x5')]();}catch(_0x4a6dd1){logger[_0xb73d('0x6')](_0xb73d('0x7'),_0xa9f022,JSON[_0xb73d('0x8')](_0x4a6dd1));_0x42e81a[_0xb73d('0x9')]();}};};
\ No newline at end of file
index d42a8dc..b21704f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4790=['remove','pick','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','channel','QueueId','InteractionId','interaction','message','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','info','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','waiting','timeout','toLowerCase','[%s][QUEUE]\x20%s','join','find','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','stop','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/logger','routing','./strategy','redis','localhost','socket.io-emitter','account','queue','from','joinAt','emit','clone','queue_id','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save'];(function(_0x43a2d9,_0x3576b8){var _0x4038bf=function(_0xfd77f8){while(--_0xfd77f8){_0x43a2d9['push'](_0x43a2d9['shift']());}};_0x4038bf(++_0x3576b8);}(_0x4790,0x84));var _0x0479=function(_0x55c979,_0x36c5f0){_0x55c979=_0x55c979-0x0;var _0x690107=_0x4790[_0x55c979];return _0x690107;};'use strict';var schema=require(_0x0479('0x0'));var _=require(_0x0479('0x1'));var util=require(_0x0479('0x2'));var seqqueue=require(_0x0479('0x3'));var moment=require(_0x0479('0x4'));var Redis=require(_0x0479('0x5'));var config=require('../../../../config/environment');var logger=require(_0x0479('0x6'))(_0x0479('0x7'));var strategy=require(_0x0479('0x8'));config[_0x0479('0x9')]=_['defaults'](config['redis'],{'host':_0x0479('0xa'),'port':0x18eb});var io=require(_0x0479('0xb'))(new Redis(config[_0x0479('0x9')]));var attributes=['id','queue_id',_0x0479('0xc'),_0x0479('0xd'),_0x0479('0xe'),_0x0479('0xf')];function emit(_0x417637,_0x5aced6,_0x464500){io['to'](_0x417637)[_0x0479('0x10')](_0x5aced6,_0x464500);}function emitChannelQueueInteraction(_0x49c75a,_0x2c602d,_0x25a6aa,_0x4be0d0,_0x5ec523,_0x158bcd,_0x21b942,_0x5411d8){var _0x29fa84=_[_0x0479('0x11')](_0x25a6aa);_0x29fa84[_0x0479('0x12')]=_0x5411d8;_0x29fa84['queue']=_0x2c602d;_0x29fa84[_0x0479('0xc')]=_0x4be0d0;_0x29fa84['id']=_0x5ec523;if(_0x158bcd){_0x21b942[util[_0x0479('0x13')](_0x0479('0x14'),_0x49c75a)][_0x5ec523]=_['pick'](_0x29fa84,attributes);}else{delete _0x21b942[util['format']('%sQueuesWaitingInteractions',_0x49c75a)][_0x5ec523];}emit(util[_0x0479('0x13')](_0x0479('0x15'),_0x49c75a,_0x2c602d),util[_0x0479('0x13')](_0x0479('0x16'),_0x49c75a,_0x158bcd?_0x0479('0x17'):_0x0479('0x18')),_[_0x0479('0x19')](_0x29fa84,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x0479('0x1a')),'chatQueueReport':require(_0x0479('0x1b')),'smsQueueReport':require(_0x0479('0x1c')),'faxQueueReport':require(_0x0479('0x1d')),'whatsappQueueReport':require(_0x0479('0x1e'))};var queue=schema({'name':{'type':_0x0479('0x1f'),'required':!![],'message':_0x0479('0x20')},'timeout':{'type':_0x0479('0x21'),'message':_0x0479('0x22')}});function startRouting(_0x20eb56,_0x13f097,_0x2e9233,_0x594910){if(_0x20eb56&&_0x13f097&&_0x2e9233){_0x13f097['waiting']+=0x1;var _0x14d426={'uniqueid':_0x20eb56,'from':_0x2e9233[_0x0479('0x23')]?_0x2e9233[_0x0479('0x23')][_0x0479('0xe')]:'','joinAt':moment()[_0x0479('0x13')](_0x0479('0x24')),'ContactId':_0x2e9233[_0x0479('0x25')]?_0x2e9233[_0x0479('0x25')]['id']:null,'ListId':_0x2e9233[_0x0479('0x26')]?_0x2e9233['list']['id']:null};_0x14d426[_['upperFirst'](_0x2e9233[_0x0479('0x27')])+_0x0479('0x28')]=_0x13f097['id']||null;_0x14d426[_['upperFirst'](_0x2e9233['channel'])+_0x0479('0x29')]=_0x2e9233[_0x0479('0x2a')]?_0x2e9233[_0x0479('0x2a')]['id']:null;_0x14d426[_['upperFirst'](_0x2e9233[_0x0479('0x27')])+'MessageId']=_0x2e9233[_0x0479('0x2b')]?_0x2e9233[_0x0479('0x2b')]['id']:null;_0x14d426[_['upperFirst'](_0x2e9233['channel'])+(_0x2e9233[_0x0479('0x27')]!=='chat'?'AccountId':'WebsiteId')]=_0x2e9233['account']?_0x2e9233[_0x0479('0xc')]['id']:null;logger['info'](util[_0x0479('0x13')](_0x0479('0x2c'),_0x20eb56,_0x13f097['name']));emitChannelQueueInteraction(_0x2e9233['channel'],_0x13f097['name'],_0x14d426,_0x2e9233[_0x0479('0xc')][_0x0479('0x2d')],_0x2e9233[_0x0479('0x2b')]['id'],!![],_0x594910,_0x13f097['id']);if(rpc[_0x2e9233[_0x0479('0x27')]+_0x0479('0x2e')]){return rpc[_0x2e9233['channel']+_0x0479('0x2e')][_0x0479('0x2f')](_0x14d426)[_0x0479('0x30')](function(_0x1aeede){logger[_0x0479('0x31')](_0x0479('0x32'));});}}}function stopRouting(_0x58248d,_0x21e360,_0x7873be,_0x19f386){if(_0x58248d&&_0x21e360){_0x21e360['waiting']-=0x1;var _0x55492e={'leaveAt':moment()[_0x0479('0x13')](_0x0479('0x24')),'acceptAt':moment()[_0x0479('0x13')](_0x0479('0x24')),'reason':_0x0479('0x33')};logger[_0x0479('0x34')](util[_0x0479('0x13')](_0x0479('0x35'),_0x58248d,_0x21e360['name']));emitChannelQueueInteraction(_0x7873be[_0x0479('0x27')],_0x21e360[_0x0479('0x2d')],_0x7873be['body'],_0x7873be[_0x0479('0xc')][_0x0479('0x2d')],_0x7873be['message']['id'],![],_0x19f386,_0x21e360['id']);if(rpc[_0x7873be['channel']+'QueueReport']){return rpc[_0x7873be[_0x0479('0x27')]+_0x0479('0x2e')][_0x0479('0x36')](_0x58248d,_0x55492e)['catch'](function(_0x38e59d){logger['error'](_0x0479('0x37'));});}}}function endRouting(_0xff559e,_0x5338ea,_0x4c9c3d,_0x2a1897){if(_0xff559e&&_0x5338ea){_0x5338ea[_0x0479('0x38')]-=0x1;var _0x17721f={'leaveAt':moment()['format'](_0x0479('0x24')),'exitAt':moment()['format'](_0x0479('0x24')),'reason':_0x0479('0x39')};logger[_0x0479('0x34')](util[_0x0479('0x13')]('[%s][END:QUEUE][NAME:%s]',_0xff559e,_0x5338ea['name']));emitChannelQueueInteraction(_0x4c9c3d[_0x0479('0x27')],_0x5338ea[_0x0479('0x2d')],_0x4c9c3d[_0x0479('0x23')],_0x4c9c3d[_0x0479('0xc')][_0x0479('0x2d')],_0x4c9c3d[_0x0479('0x2b')]['id'],![],_0x2a1897);if(rpc[_0x4c9c3d['channel']+_0x0479('0x2e')]){return rpc[_0x4c9c3d[_0x0479('0x27')]+_0x0479('0x2e')][_0x0479('0x36')](_0xff559e,_0x17721f)[_0x0479('0x30')](function(_0x2803a2){logger[_0x0479('0x31')](_0x0479('0x37'));});}}}function handleFindQueue(_0x5284ae){return function(_0x2d5379){return _0x2d5379['name'][_0x0479('0x3a')]()===_0x5284ae[_0x0479('0x3a')]();};}exports['consequence']=function(_0xfa16f0,_0x5d20c4,_0x372a51,_0x3ce390){return function(_0x1d11c3){try{var _0x743a1a={'name':_0x5d20c4[0x0],'timeout':_0x5d20c4[0x1]};var _0x341399=queue['validate'](_0x743a1a,{'typecast':!![]});if(_0x341399['length']){logger[_0x0479('0x31')](_0x0479('0x3b'),_0xfa16f0,_['map'](_0x341399,_0x0479('0x2b'))[_0x0479('0x3c')](',\x20'));_0x1d11c3['stop']();}else{var _0x59246a=_[_0x0479('0x3d')](_0x372a51[_0x3ce390[_0x0479('0x27')]+'Queues'],handleFindQueue(_0x743a1a[_0x0479('0x2d')]));if(_0x59246a){startRouting(_0xfa16f0,_0x59246a,_0x3ce390,_0x372a51);var _0x37805a=(_0x59246a['timeout']||0xa)*0x3e8;var _0x25eadb=(_0x743a1a[_0x0479('0x39')]||0x14)*0x3e8;var _0x37302b,_0x4523c3;if(_0x37805a>_0x25eadb){_0x25eadb=_0x37805a;}var _0x358305=seqqueue[_0x0479('0x3e')](_0x37805a);_0x358305['id']=_0xfa16f0;_0x358305[_0x0479('0x3f')]=_0x37805a;_0x358305[_0x0479('0x40')]=_0x25eadb;_0x358305[_0x0479('0x27')]=_0x3ce390[_0x0479('0x27')];_0x372a51[_0x0479('0x41')][_0xfa16f0]['on'](_0x0479('0x42'),function(){logger['info'](_0x0479('0x43'),_0xfa16f0);stopRouting(_0xfa16f0,_0x59246a,_0x3ce390,_0x372a51);clearTimeout(_0x37302b);_0x37302b=undefined;_0x358305[_0x0479('0x44')](!![]);if(_0x372a51[_0x0479('0x41')][_0xfa16f0]){delete _0x372a51[_0x0479('0x41')][_0xfa16f0];}_0x1d11c3[_0x0479('0x45')]();});_0x372a51[_0x0479('0x41')][_0xfa16f0]['on'](_0x0479('0x46'),function(){if(_0x372a51[_0x0479('0x41')][_0xfa16f0]){delete _0x372a51[_0x0479('0x41')][_0xfa16f0];}});_0x37302b=setTimeout(function(){logger[_0x0479('0x34')](_0x0479('0x47'),_0xfa16f0);endRouting(_0xfa16f0,_0x59246a,_0x3ce390,_0x372a51);clearTimeout(_0x37302b);_0x358305[_0x0479('0x44')](!![]);_0x1d11c3[_0x0479('0x48')]();},_0x25eadb);switch(_0x59246a[_0x0479('0x49')]){case _0x0479('0x4a'):strategy[_0x0479('0x4a')](_0x358305,_0x59246a,_0x372a51,_0x3ce390);break;default:strategy[_0x0479('0x4b')](_0x358305,_0x59246a,_0x372a51,_0x3ce390);}}else{logger[_0x0479('0x31')](_0x0479('0x4c'),_0xfa16f0,_0x743a1a[_0x0479('0x2d')]);_0x1d11c3[_0x0479('0x45')]();}}}catch(_0x1df648){console['log'](_0x1df648);logger[_0x0479('0x31')](_0x0479('0x3b'),_0xfa16f0,_0x1df648[_0x0479('0x4d')]);_0x1d11c3[_0x0479('0x45')]();}};};
\ No newline at end of file
+var _0xfd9e=['name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','join','stop','find','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','save','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string'];(function(_0x218346,_0x43c261){var _0x30b7f2=function(_0x40f2c4){while(--_0x40f2c4){_0x218346['push'](_0x218346['shift']());}};_0x30b7f2(++_0x43c261);}(_0xfd9e,0x185));var _0xefd9=function(_0x54a512,_0x4af21f){_0x54a512=_0x54a512-0x0;var _0x4f6d62=_0xfd9e[_0x54a512];return _0x4f6d62;};'use strict';var schema=require(_0xefd9('0x0'));var _=require(_0xefd9('0x1'));var util=require(_0xefd9('0x2'));var seqqueue=require(_0xefd9('0x3'));var moment=require('moment');var Redis=require(_0xefd9('0x4'));var config=require(_0xefd9('0x5'));var logger=require(_0xefd9('0x6'))(_0xefd9('0x7'));var strategy=require(_0xefd9('0x8'));config[_0xefd9('0x9')]=_[_0xefd9('0xa')](config[_0xefd9('0x9')],{'host':_0xefd9('0xb'),'port':0x18eb});var io=require(_0xefd9('0xc'))(new Redis(config[_0xefd9('0x9')]));var attributes=['id',_0xefd9('0xd'),_0xefd9('0xe'),_0xefd9('0xf'),_0xefd9('0x10'),_0xefd9('0x11')];function emit(_0x1ef494,_0x3a8361,_0x8a3557){io['to'](_0x1ef494)[_0xefd9('0x12')](_0x3a8361,_0x8a3557);}function emitChannelQueueInteraction(_0x34dbfb,_0x285203,_0x1c63d8,_0x4c9f68,_0xfaced8,_0xa5fb33,_0x5e1c18,_0x250ea7){var _0x559e53=_[_0xefd9('0x13')](_0x1c63d8);_0x559e53[_0xefd9('0xd')]=_0x250ea7;_0x559e53[_0xefd9('0xf')]=_0x285203;_0x559e53[_0xefd9('0xe')]=_0x4c9f68;_0x559e53['id']=_0xfaced8;if(_0xa5fb33){_0x5e1c18[util[_0xefd9('0x14')](_0xefd9('0x15'),_0x34dbfb)][_0xfaced8]=_[_0xefd9('0x16')](_0x559e53,attributes);}else{delete _0x5e1c18[util[_0xefd9('0x14')](_0xefd9('0x15'),_0x34dbfb)][_0xfaced8];}emit(util['format'](_0xefd9('0x17'),_0x34dbfb,_0x285203),util[_0xefd9('0x14')]('%s_queue_waiting_interaction:%s',_0x34dbfb,_0xa5fb33?_0xefd9('0x18'):'remove'),_['pick'](_0x559e53,attributes));}var rpc={'openchannelQueueReport':require(_0xefd9('0x19')),'mailQueueReport':require(_0xefd9('0x1a')),'chatQueueReport':require(_0xefd9('0x1b')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0xefd9('0x1c')),'whatsappQueueReport':require(_0xefd9('0x1d'))};var queue=schema({'name':{'type':_0xefd9('0x1e'),'required':!![],'message':_0xefd9('0x1f')},'timeout':{'type':_0xefd9('0x20'),'message':_0xefd9('0x21')}});function startRouting(_0x2920db,_0x449c19,_0x3c9d3f,_0x4d6ca7){if(_0x2920db&&_0x449c19&&_0x3c9d3f){_0x449c19[_0xefd9('0x22')]+=0x1;var _0x2fc3e7={'uniqueid':_0x2920db,'from':_0x3c9d3f['body']?_0x3c9d3f[_0xefd9('0x23')][_0xefd9('0x10')]:'','joinAt':moment()[_0xefd9('0x14')](_0xefd9('0x24')),'ContactId':_0x3c9d3f[_0xefd9('0x25')]?_0x3c9d3f['contact']['id']:null,'ListId':_0x3c9d3f[_0xefd9('0x26')]?_0x3c9d3f[_0xefd9('0x26')]['id']:null};_0x2fc3e7[_[_0xefd9('0x27')](_0x3c9d3f[_0xefd9('0x28')])+_0xefd9('0x29')]=_0x449c19['id']||null;_0x2fc3e7[_[_0xefd9('0x27')](_0x3c9d3f[_0xefd9('0x28')])+_0xefd9('0x2a')]=_0x3c9d3f['interaction']?_0x3c9d3f['interaction']['id']:null;_0x2fc3e7[_[_0xefd9('0x27')](_0x3c9d3f[_0xefd9('0x28')])+_0xefd9('0x2b')]=_0x3c9d3f['message']?_0x3c9d3f[_0xefd9('0x2c')]['id']:null;_0x2fc3e7[_['upperFirst'](_0x3c9d3f[_0xefd9('0x28')])+(_0x3c9d3f[_0xefd9('0x28')]!==_0xefd9('0x2d')?_0xefd9('0x2e'):_0xefd9('0x2f'))]=_0x3c9d3f['account']?_0x3c9d3f[_0xefd9('0xe')]['id']:null;logger[_0xefd9('0x30')](util[_0xefd9('0x14')](_0xefd9('0x31'),_0x2920db,_0x449c19[_0xefd9('0x32')]));emitChannelQueueInteraction(_0x3c9d3f[_0xefd9('0x28')],_0x449c19[_0xefd9('0x32')],_0x2fc3e7,_0x3c9d3f['account'][_0xefd9('0x32')],_0x3c9d3f['message']['id'],!![],_0x4d6ca7,_0x449c19['id']);if(rpc[_0x3c9d3f[_0xefd9('0x28')]+_0xefd9('0x33')]){return rpc[_0x3c9d3f[_0xefd9('0x28')]+'QueueReport'][_0xefd9('0x34')](_0x2fc3e7)[_0xefd9('0x35')](function(_0x12f60c){logger[_0xefd9('0x36')](_0xefd9('0x37'));});}}}function stopRouting(_0x3ab8ce,_0x4cb004,_0x49875a,_0x1255b8){if(_0x3ab8ce&&_0x4cb004){_0x4cb004['waiting']-=0x1;var _0x2ec231={'leaveAt':moment()['format'](_0xefd9('0x24')),'acceptAt':moment()['format'](_0xefd9('0x24')),'reason':_0xefd9('0x38')};logger[_0xefd9('0x30')](util['format'](_0xefd9('0x39'),_0x3ab8ce,_0x4cb004[_0xefd9('0x32')]));emitChannelQueueInteraction(_0x49875a[_0xefd9('0x28')],_0x4cb004[_0xefd9('0x32')],_0x49875a[_0xefd9('0x23')],_0x49875a[_0xefd9('0xe')][_0xefd9('0x32')],_0x49875a[_0xefd9('0x2c')]['id'],![],_0x1255b8,_0x4cb004['id']);if(rpc[_0x49875a[_0xefd9('0x28')]+_0xefd9('0x33')]){return rpc[_0x49875a[_0xefd9('0x28')]+_0xefd9('0x33')][_0xefd9('0x3a')](_0x3ab8ce,_0x2ec231)[_0xefd9('0x35')](function(_0x2f1318){logger[_0xefd9('0x36')](_0xefd9('0x3b'));});}}}function endRouting(_0x5a4c3f,_0x4f956b,_0x177d55,_0x44a6aa){if(_0x5a4c3f&&_0x4f956b){_0x4f956b[_0xefd9('0x22')]-=0x1;var _0x37c135={'leaveAt':moment()['format'](_0xefd9('0x24')),'exitAt':moment()[_0xefd9('0x14')](_0xefd9('0x24')),'reason':_0xefd9('0x3c')};logger[_0xefd9('0x30')](util[_0xefd9('0x14')](_0xefd9('0x3d'),_0x5a4c3f,_0x4f956b[_0xefd9('0x32')]));emitChannelQueueInteraction(_0x177d55['channel'],_0x4f956b[_0xefd9('0x32')],_0x177d55['body'],_0x177d55[_0xefd9('0xe')]['name'],_0x177d55[_0xefd9('0x2c')]['id'],![],_0x44a6aa);if(rpc[_0x177d55[_0xefd9('0x28')]+_0xefd9('0x33')]){return rpc[_0x177d55[_0xefd9('0x28')]+'QueueReport']['update'](_0x5a4c3f,_0x37c135)[_0xefd9('0x35')](function(_0x37942e){logger[_0xefd9('0x36')]('update\x20queue\x20report');});}}}function handleFindQueue(_0x2a2a0b){return function(_0x5a9009){return _0x5a9009['name'][_0xefd9('0x3e')]()===_0x2a2a0b[_0xefd9('0x3e')]();};}exports[_0xefd9('0x3f')]=function(_0x40e676,_0x5be6f0,_0x40c8ae,_0x19abb6){return function(_0x3637fd){try{var _0x120354={'name':_0x5be6f0[0x0],'timeout':_0x5be6f0[0x1]};var _0x4ed49f=queue[_0xefd9('0x0')](_0x120354,{'typecast':!![]});if(_0x4ed49f[_0xefd9('0x40')]){logger[_0xefd9('0x36')](_0xefd9('0x41'),_0x40e676,_['map'](_0x4ed49f,_0xefd9('0x2c'))[_0xefd9('0x42')](',\x20'));_0x3637fd[_0xefd9('0x43')]();}else{var _0x32949d=_[_0xefd9('0x44')](_0x40c8ae[_0x19abb6[_0xefd9('0x28')]+'Queues'],handleFindQueue(_0x120354['name']));if(_0x32949d){startRouting(_0x40e676,_0x32949d,_0x19abb6,_0x40c8ae);var _0x2a9528=(_0x32949d[_0xefd9('0x3c')]||0xa)*0x3e8;var _0x398d19=(_0x120354[_0xefd9('0x3c')]||0x14)*0x3e8;var _0x5191fb,_0x48e917;if(_0x2a9528>_0x398d19){_0x398d19=_0x2a9528;}var _0x486266=seqqueue['createQueue'](_0x2a9528);_0x486266['id']=_0x40e676;_0x486266[_0xefd9('0x45')]=_0x2a9528;_0x486266[_0xefd9('0x46')]=_0x398d19;_0x486266[_0xefd9('0x28')]=_0x19abb6[_0xefd9('0x28')];_0x40c8ae[_0xefd9('0x47')][_0x40e676]['on'](_0xefd9('0x48'),function(){logger[_0xefd9('0x30')](_0xefd9('0x49'),_0x40e676);stopRouting(_0x40e676,_0x32949d,_0x19abb6,_0x40c8ae);clearTimeout(_0x5191fb);_0x5191fb=undefined;_0x486266[_0xefd9('0x4a')](!![]);if(_0x40c8ae[_0xefd9('0x47')][_0x40e676]){delete _0x40c8ae[_0xefd9('0x47')][_0x40e676];}_0x3637fd['stop']();});_0x40c8ae[_0xefd9('0x47')][_0x40e676]['on'](_0xefd9('0x4b'),function(){if(_0x40c8ae['rules'][_0x40e676]){delete _0x40c8ae[_0xefd9('0x47')][_0x40e676];}});_0x5191fb=setTimeout(function(){logger['info'](_0xefd9('0x4c'),_0x40e676);endRouting(_0x40e676,_0x32949d,_0x19abb6,_0x40c8ae);clearTimeout(_0x5191fb);_0x486266['close'](!![]);_0x3637fd[_0xefd9('0x4d')]();},_0x398d19);switch(_0x32949d[_0xefd9('0x4e')]){case _0xefd9('0x4f'):strategy[_0xefd9('0x4f')](_0x486266,_0x32949d,_0x40c8ae,_0x19abb6);break;default:strategy[_0xefd9('0x50')](_0x486266,_0x32949d,_0x40c8ae,_0x19abb6);}}else{logger[_0xefd9('0x36')](_0xefd9('0x51'),_0x40e676,_0x120354[_0xefd9('0x32')]);_0x3637fd[_0xefd9('0x43')]();}}}catch(_0x2b4e28){console[_0xefd9('0x52')](_0x2b4e28);logger[_0xefd9('0x36')](_0xefd9('0x41'),_0x40e676,_0x2b4e28[_0xefd9('0x53')]);_0x3637fd['stop']();}};};
\ No newline at end of file
index 9a2da19..9d1105d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x87c1=['[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','routing','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','writeLog',':FORCED','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','exports','lodash','./util','../../../../../config/logger','notificationId','squeue','realtime','handleRun','bind','timeout','handleTimeout','handleDrained','prototype','push','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','agent'];(function(_0x1260e3,_0x4e663f){var _0x292fbd=function(_0x4aa523){while(--_0x4aa523){_0x1260e3['push'](_0x1260e3['shift']());}};_0x292fbd(++_0x4e663f);}(_0x87c1,0x1bf));var _0x187c=function(_0xa16c97,_0x15ee86){_0xa16c97=_0xa16c97-0x0;var _0x227cb3=_0x87c1[_0xa16c97];return _0x227cb3;};'use strict';var _=require(_0x187c('0x0'));var uuid=require('uuid');var util=require(_0x187c('0x1'));var logger=require(_0x187c('0x2'))('routing');var Agent=function(_0x2f23fa,_0x388011,_0x289ada,_0x16ad52){this[_0x187c('0x3')]=uuid['v4']();this[_0x187c('0x4')]=_0x2f23fa;this['agent']=_0x388011;this[_0x187c('0x5')]=_0x289ada;this['routing']=_0x16ad52;this[_0x187c('0x4')]['push'](this[_0x187c('0x6')][_0x187c('0x7')](this),this['handleTimeout'][_0x187c('0x7')](this));this[_0x187c('0x4')]['on'](_0x187c('0x8'),this[_0x187c('0x9')][_0x187c('0x7')](this));this[_0x187c('0x4')]['on']('drained',this[_0x187c('0xa')]['bind'](this));};Agent[_0x187c('0xb')][_0x187c('0xc')]=function(){this[_0x187c('0x4')]['push'](this[_0x187c('0x6')][_0x187c('0x7')](this),this[_0x187c('0x9')]['bind'](this));};Agent[_0x187c('0xb')][_0x187c('0xa')]=function(){this['handleTimeout'](!![]);};Agent[_0x187c('0xb')][_0x187c('0x6')]=function(_0xfdfe3c){logger[_0x187c('0xd')](_0x187c('0xe'),this[_0x187c('0x4')]['id'],this['agent']['id']);if(_[_0x187c('0xf')](this['realtime'][_0x187c('0x10')][this[_0x187c('0x11')]['id']])){logger[_0x187c('0xd')](_0x187c('0x12'),this[_0x187c('0x4')]['id'],this[_0x187c('0x11')]['id']);setTimeout(this[_0x187c('0xc')]['bind'](this),0x3e8);}else{if(this[_0x187c('0x13')][_0x187c('0x14')]||util[_0x187c('0x15')](this['squeue']['id'],this[_0x187c('0x5')][_0x187c('0x10')][this[_0x187c('0x11')]['id']],this[_0x187c('0x4')][_0x187c('0x16')],![])){this[_0x187c('0x5')][_0x187c('0x10')][this[_0x187c('0x11')]['id']][_0x187c('0x17')]=!![];this[_0x187c('0x5')][_0x187c('0x10')][this['agent']['id']][_0x187c('0x18')]=undefined;util['showNotification'](this['notificationId'],this[_0x187c('0x4')]['id'],this[_0x187c('0x5')][_0x187c('0x10')][this['agent']['id']],null,this['routing']);util[_0x187c('0x19')](this[_0x187c('0x4')]['id'],this[_0x187c('0x5')][_0x187c('0x10')][this[_0x187c('0x11')]['id']],'RINGING'+(this['routing'][_0x187c('0x14')]?_0x187c('0x1a'):''));}else{logger[_0x187c('0xd')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x187c('0x4')]['id'],this[_0x187c('0x11')]['id']);setTimeout(this[_0x187c('0xc')][_0x187c('0x7')](this),0x3e8);}}};Agent[_0x187c('0xb')][_0x187c('0x9')]=function(_0x502994){if(_[_0x187c('0xf')](this[_0x187c('0x5')][_0x187c('0x10')][this[_0x187c('0x11')]['id']])){return logger[_0x187c('0xd')](_0x187c('0x12'),this[_0x187c('0x4')]['id'],this[_0x187c('0x11')]['id']);}else{logger['info'](_0x187c('0x1b'),this[_0x187c('0x4')]['id'],this['agent']['id']);util[_0x187c('0x1c')](this[_0x187c('0x3')],this['squeue']['id'],this[_0x187c('0x5')][_0x187c('0x10')][this['agent']['id']],null,this[_0x187c('0x13')]);this['realtime'][_0x187c('0x10')][this[_0x187c('0x11')]['id']][_0x187c('0x17')]=![];this[_0x187c('0x5')][_0x187c('0x10')][this[_0x187c('0x11')]['id']]['busyQueue']=undefined;util[_0x187c('0x19')](this['squeue']['id'],this[_0x187c('0x5')][_0x187c('0x10')][this[_0x187c('0x11')]['id']],_0x502994?_0x187c('0x1d'):'TIMEOUT');}if(!_0x502994){setTimeout(this['push']['bind'](this),0x3e8);}};function agent(_0x1fe2d7,_0x2c1eaf,_0x553d56,_0xf8cd5c){return new Agent(_0x1fe2d7,_0x2c1eaf,_0x553d56,_0xf8cd5c);}module[_0x187c('0x1e')]=agent;
\ No newline at end of file
+var _0xf2b4=['bind','timeout','handleDrained','prototype','handleRun','info','[%s][AGENT]\x20try\x20with\x20%s','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','agents','channel','writeLog','RINGING','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','busyQueue','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','handleTimeout'];(function(_0x278ff5,_0xe8a8da){var _0x2a3b45=function(_0x293d57){while(--_0x293d57){_0x278ff5['push'](_0x278ff5['shift']());}};_0x2a3b45(++_0xe8a8da);}(_0xf2b4,0x12b));var _0x4f2b=function(_0x8afee0,_0x583a13){_0x8afee0=_0x8afee0-0x0;var _0x3315ae=_0xf2b4[_0x8afee0];return _0x3315ae;};'use strict';var _=require(_0x4f2b('0x0'));var uuid=require(_0x4f2b('0x1'));var util=require(_0x4f2b('0x2'));var logger=require(_0x4f2b('0x3'))(_0x4f2b('0x4'));var Agent=function(_0xb4a48f,_0x1623d3,_0x5aa2f3,_0x982963){this[_0x4f2b('0x5')]=uuid['v4']();this[_0x4f2b('0x6')]=_0xb4a48f;this[_0x4f2b('0x7')]=_0x1623d3;this[_0x4f2b('0x8')]=_0x5aa2f3;this[_0x4f2b('0x4')]=_0x982963;this['squeue'][_0x4f2b('0x9')](this['handleRun']['bind'](this),this[_0x4f2b('0xa')][_0x4f2b('0xb')](this));this[_0x4f2b('0x6')]['on'](_0x4f2b('0xc'),this['handleTimeout']['bind'](this));this[_0x4f2b('0x6')]['on']('drained',this[_0x4f2b('0xd')][_0x4f2b('0xb')](this));};Agent[_0x4f2b('0xe')]['push']=function(){this[_0x4f2b('0x6')][_0x4f2b('0x9')](this[_0x4f2b('0xf')][_0x4f2b('0xb')](this),this[_0x4f2b('0xa')][_0x4f2b('0xb')](this));};Agent[_0x4f2b('0xe')]['handleDrained']=function(){this[_0x4f2b('0xa')](!![]);};Agent[_0x4f2b('0xe')]['handleRun']=function(_0x2703c6){logger[_0x4f2b('0x10')](_0x4f2b('0x11'),this[_0x4f2b('0x6')]['id'],this[_0x4f2b('0x7')]['id']);if(_['isNil'](this[_0x4f2b('0x8')]['agents'][this['agent']['id']])){logger[_0x4f2b('0x10')](_0x4f2b('0x12'),this[_0x4f2b('0x6')]['id'],this['agent']['id']);setTimeout(this['push'][_0x4f2b('0xb')](this),0x3e8);}else{if(this[_0x4f2b('0x4')]['forcedOwnership']||util['isAgentAvailable'](this[_0x4f2b('0x6')]['id'],this[_0x4f2b('0x8')][_0x4f2b('0x13')][this[_0x4f2b('0x7')]['id']],this[_0x4f2b('0x6')][_0x4f2b('0x14')],![])){this[_0x4f2b('0x8')]['agents'][this[_0x4f2b('0x7')]['id']]['busy']=!![];this[_0x4f2b('0x8')][_0x4f2b('0x13')][this[_0x4f2b('0x7')]['id']]['busyQueue']=undefined;util['showNotification'](this[_0x4f2b('0x5')],this[_0x4f2b('0x6')]['id'],this[_0x4f2b('0x8')][_0x4f2b('0x13')][this[_0x4f2b('0x7')]['id']],null,this[_0x4f2b('0x4')]);util[_0x4f2b('0x15')](this[_0x4f2b('0x6')]['id'],this[_0x4f2b('0x8')]['agents'][this[_0x4f2b('0x7')]['id']],_0x4f2b('0x16')+(this[_0x4f2b('0x4')]['forcedOwnership']?':FORCED':''));}else{logger[_0x4f2b('0x10')]('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this[_0x4f2b('0x6')]['id'],this[_0x4f2b('0x7')]['id']);setTimeout(this[_0x4f2b('0x9')]['bind'](this),0x3e8);}}};Agent[_0x4f2b('0xe')]['handleTimeout']=function(_0x52dd46){if(_[_0x4f2b('0x17')](this[_0x4f2b('0x8')][_0x4f2b('0x13')][this['agent']['id']])){return logger[_0x4f2b('0x10')](_0x4f2b('0x12'),this[_0x4f2b('0x6')]['id'],this[_0x4f2b('0x7')]['id']);}else{logger[_0x4f2b('0x10')](_0x4f2b('0x18'),this[_0x4f2b('0x6')]['id'],this[_0x4f2b('0x7')]['id']);util[_0x4f2b('0x19')](this['notificationId'],this[_0x4f2b('0x6')]['id'],this['realtime'][_0x4f2b('0x13')][this[_0x4f2b('0x7')]['id']],null,this[_0x4f2b('0x4')]);this['realtime'][_0x4f2b('0x13')][this[_0x4f2b('0x7')]['id']][_0x4f2b('0x1a')]=![];this[_0x4f2b('0x8')][_0x4f2b('0x13')][this[_0x4f2b('0x7')]['id']][_0x4f2b('0x1b')]=undefined;util['writeLog'](this[_0x4f2b('0x6')]['id'],this[_0x4f2b('0x8')][_0x4f2b('0x13')][this['agent']['id']],_0x52dd46?_0x4f2b('0x1c'):_0x4f2b('0x1d'));}if(!_0x52dd46){setTimeout(this[_0x4f2b('0x9')][_0x4f2b('0xb')](this),0x3e8);}};function agent(_0x213eae,_0x55828a,_0x16da02,_0x1b0ecc){return new Agent(_0x213eae,_0x55828a,_0x16da02,_0x1b0ecc);}module[_0x4f2b('0x1e')]=agent;
\ No newline at end of file
index 45ac0aa..4f38acf 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe574=['isNil','Agents','length','agents','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','busy','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','STOP','TIMEOUT','exports','lodash','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','handleRun','bind','timeout','handleTimeout','drained','handleDrained','prototype','push'];(function(_0x5b78e8,_0x55096b){var _0xf2c321=function(_0x4e0cff){while(--_0x4e0cff){_0x5b78e8['push'](_0x5b78e8['shift']());}};_0xf2c321(++_0x55096b);}(_0xe574,0x100));var _0x4e57=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xe574[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x4e57('0x0'));var uuid=require('uuid');var util=require(_0x4e57('0x1'));var logger=require(_0x4e57('0x2'))(_0x4e57('0x3'));var Beepall=function(_0xc485ee,_0x9153d1,_0x1bdd55,_0x10de04){this[_0x4e57('0x4')]=uuid['v4']();this[_0x4e57('0x5')]=_0xc485ee;this[_0x4e57('0x6')]=_0x9153d1;this[_0x4e57('0x7')]=_0x1bdd55;this[_0x4e57('0x3')]=_0x10de04;this['squeue']['push'](this[_0x4e57('0x8')]['bind'](this),this['handleTimeout'][_0x4e57('0x9')](this));this[_0x4e57('0x5')]['on'](_0x4e57('0xa'),this[_0x4e57('0xb')][_0x4e57('0x9')](this));this['squeue']['on'](_0x4e57('0xc'),this[_0x4e57('0xd')][_0x4e57('0x9')](this));};Beepall[_0x4e57('0xe')][_0x4e57('0xf')]=function(){this[_0x4e57('0x5')][_0x4e57('0xf')](this[_0x4e57('0x8')][_0x4e57('0x9')](this),this[_0x4e57('0xb')][_0x4e57('0x9')](this));};Beepall[_0x4e57('0xe')][_0x4e57('0xd')]=function(_0x1c1e8b){this[_0x4e57('0xb')](!![]);};Beepall[_0x4e57('0xe')]['handleRun']=function(_0x1298b8){var _0x52ca46=!![];if(!_[_0x4e57('0x10')](this['queue'])&&!_[_0x4e57('0x10')](this[_0x4e57('0x6')]['Agents'])&&this[_0x4e57('0x6')][_0x4e57('0x11')][_0x4e57('0x12')]>0x0){for(var _0xb06d8=0x0,_0x5377cf;_0xb06d8<this[_0x4e57('0x6')][_0x4e57('0x11')][_0x4e57('0x12')];_0xb06d8+=0x1){_0x5377cf=this[_0x4e57('0x6')][_0x4e57('0x11')][_0xb06d8]['id'];if(_['isNil'](this[_0x4e57('0x7')][_0x4e57('0x13')][_0x5377cf])){logger[_0x4e57('0x14')](_0x4e57('0x15'),this['squeue']['id'],_0x5377cf);}else{if(util[_0x4e57('0x16')](this['squeue']['id'],this[_0x4e57('0x7')]['agents'][_0x5377cf],this[_0x4e57('0x5')][_0x4e57('0x17')],!![])){_0x52ca46=![];util[_0x4e57('0x18')](this[_0x4e57('0x5')]['id'],this[_0x4e57('0x7')]['agents'][_0x5377cf],'RINGING');this[_0x4e57('0x7')]['agents'][_0x5377cf][_0x4e57('0x19')]=!![];this['realtime'][_0x4e57('0x13')][_0x5377cf][_0x4e57('0x1a')]=this[_0x4e57('0x6')][_0x4e57('0x1b')];util[_0x4e57('0x1c')](this[_0x4e57('0x4')],this['squeue']['id'],this[_0x4e57('0x7')][_0x4e57('0x13')][_0x5377cf],this['queue'],this[_0x4e57('0x3')]);}}}if(_0x52ca46){logger[_0x4e57('0x14')](_0x4e57('0x1d'),this[_0x4e57('0x5')]['id']);setTimeout(this[_0x4e57('0xf')][_0x4e57('0x9')](this),0x3e8);}}else{logger[_0x4e57('0x14')]('[%s][QUEUE]\x20EMPTY',this[_0x4e57('0x5')]['id']);setTimeout(this[_0x4e57('0xf')][_0x4e57('0x9')](this),0x3e8);}};Beepall[_0x4e57('0xe')][_0x4e57('0xb')]=function(_0x5d55b9){if(!_['isNil'](this[_0x4e57('0x6')])&&!_[_0x4e57('0x10')](this[_0x4e57('0x6')][_0x4e57('0x11')])){for(var _0x4bafa8=0x0,_0xdbd90f;_0x4bafa8<this[_0x4e57('0x6')][_0x4e57('0x11')][_0x4e57('0x12')];_0x4bafa8+=0x1){_0xdbd90f=this[_0x4e57('0x6')]['Agents'][_0x4bafa8]['id'];if(_[_0x4e57('0x10')](this[_0x4e57('0x7')]['agents'][_0xdbd90f])){logger[_0x4e57('0x14')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],_0xdbd90f);}else{util[_0x4e57('0x1e')](this[_0x4e57('0x4')],this[_0x4e57('0x5')]['id'],this['realtime'][_0x4e57('0x13')][_0xdbd90f],this['queue'],this[_0x4e57('0x3')]);util[_0x4e57('0x18')](this[_0x4e57('0x5')]['id'],this['realtime'][_0x4e57('0x13')][_0xdbd90f],_0x5d55b9?_0x4e57('0x1f'):_0x4e57('0x20'));this[_0x4e57('0x7')][_0x4e57('0x13')][_0xdbd90f][_0x4e57('0x19')]=![];this[_0x4e57('0x7')][_0x4e57('0x13')][_0xdbd90f][_0x4e57('0x1a')]=undefined;}}}if(!_0x5d55b9){setTimeout(this[_0x4e57('0xf')][_0x4e57('0x9')](this),0x3e8);}};function beepall(_0x5e941f,_0x2f1a6e,_0x5df7d3,_0x45af27){return new Beepall(_0x5e941f,_0x2f1a6e,_0x5df7d3,_0x45af27);}module[_0x4e57('0x21')]=beepall;
\ No newline at end of file
+var _0x00b3=['info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','writeLog','RINGING','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','busy','exports','lodash','../../../../../config/logger','routing','notificationId','queue','realtime','squeue','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','isNil','Agents','length','agents'];(function(_0x5c524e,_0x4f07dc){var _0x49ffd1=function(_0x153467){while(--_0x153467){_0x5c524e['push'](_0x5c524e['shift']());}};_0x49ffd1(++_0x4f07dc);}(_0x00b3,0x97));var _0x300b=function(_0x11c05d,_0xee480){_0x11c05d=_0x11c05d-0x0;var _0x2a9f6a=_0x00b3[_0x11c05d];return _0x2a9f6a;};'use strict';var _=require(_0x300b('0x0'));var uuid=require('uuid');var util=require('./util');var logger=require(_0x300b('0x1'))(_0x300b('0x2'));var Beepall=function(_0x4aa4f4,_0x5a96e9,_0x103196,_0x29e653){this[_0x300b('0x3')]=uuid['v4']();this['squeue']=_0x4aa4f4;this[_0x300b('0x4')]=_0x5a96e9;this[_0x300b('0x5')]=_0x103196;this[_0x300b('0x2')]=_0x29e653;this[_0x300b('0x6')][_0x300b('0x7')](this[_0x300b('0x8')][_0x300b('0x9')](this),this[_0x300b('0xa')][_0x300b('0x9')](this));this[_0x300b('0x6')]['on'](_0x300b('0xb'),this[_0x300b('0xa')][_0x300b('0x9')](this));this['squeue']['on'](_0x300b('0xc'),this[_0x300b('0xd')][_0x300b('0x9')](this));};Beepall['prototype'][_0x300b('0x7')]=function(){this[_0x300b('0x6')]['push'](this['handleRun'][_0x300b('0x9')](this),this['handleTimeout'][_0x300b('0x9')](this));};Beepall[_0x300b('0xe')][_0x300b('0xd')]=function(_0x1f26e3){this[_0x300b('0xa')](!![]);};Beepall[_0x300b('0xe')]['handleRun']=function(_0x59dd20){var _0xbede7=!![];if(!_[_0x300b('0xf')](this[_0x300b('0x4')])&&!_[_0x300b('0xf')](this[_0x300b('0x4')][_0x300b('0x10')])&&this[_0x300b('0x4')][_0x300b('0x10')]['length']>0x0){for(var _0x41cde4=0x0,_0x28c866;_0x41cde4<this['queue'][_0x300b('0x10')][_0x300b('0x11')];_0x41cde4+=0x1){_0x28c866=this[_0x300b('0x4')][_0x300b('0x10')][_0x41cde4]['id'];if(_['isNil'](this[_0x300b('0x5')][_0x300b('0x12')][_0x28c866])){logger[_0x300b('0x13')](_0x300b('0x14'),this['squeue']['id'],_0x28c866);}else{if(util['isAgentAvailable'](this['squeue']['id'],this['realtime'][_0x300b('0x12')][_0x28c866],this[_0x300b('0x6')][_0x300b('0x15')],!![])){_0xbede7=![];util[_0x300b('0x16')](this['squeue']['id'],this[_0x300b('0x5')][_0x300b('0x12')][_0x28c866],_0x300b('0x17'));this[_0x300b('0x5')][_0x300b('0x12')][_0x28c866]['busy']=!![];this[_0x300b('0x5')][_0x300b('0x12')][_0x28c866][_0x300b('0x18')]=this[_0x300b('0x4')][_0x300b('0x19')];util[_0x300b('0x1a')](this[_0x300b('0x3')],this[_0x300b('0x6')]['id'],this[_0x300b('0x5')]['agents'][_0x28c866],this['queue'],this[_0x300b('0x2')]);}}}if(_0xbede7){logger['info'](_0x300b('0x1b'),this[_0x300b('0x6')]['id']);setTimeout(this[_0x300b('0x7')][_0x300b('0x9')](this),0x3e8);}}else{logger['info'](_0x300b('0x1c'),this[_0x300b('0x6')]['id']);setTimeout(this['push'][_0x300b('0x9')](this),0x3e8);}};Beepall[_0x300b('0xe')][_0x300b('0xa')]=function(_0x150ebe){if(!_['isNil'](this['queue'])&&!_[_0x300b('0xf')](this[_0x300b('0x4')][_0x300b('0x10')])){for(var _0x4ee951=0x0,_0x4eb3e5;_0x4ee951<this[_0x300b('0x4')][_0x300b('0x10')][_0x300b('0x11')];_0x4ee951+=0x1){_0x4eb3e5=this[_0x300b('0x4')][_0x300b('0x10')][_0x4ee951]['id'];if(_[_0x300b('0xf')](this['realtime'][_0x300b('0x12')][_0x4eb3e5])){logger[_0x300b('0x13')](_0x300b('0x14'),this[_0x300b('0x6')]['id'],_0x4eb3e5);}else{util[_0x300b('0x1d')](this['notificationId'],this['squeue']['id'],this[_0x300b('0x5')][_0x300b('0x12')][_0x4eb3e5],this['queue'],this[_0x300b('0x2')]);util[_0x300b('0x16')](this['squeue']['id'],this[_0x300b('0x5')]['agents'][_0x4eb3e5],_0x150ebe?_0x300b('0x1e'):_0x300b('0x1f'));this['realtime'][_0x300b('0x12')][_0x4eb3e5][_0x300b('0x20')]=![];this[_0x300b('0x5')][_0x300b('0x12')][_0x4eb3e5][_0x300b('0x18')]=undefined;}}}if(!_0x150ebe){setTimeout(this[_0x300b('0x7')][_0x300b('0x9')](this),0x3e8);}};function beepall(_0x2fd367,_0xe296fb,_0x3128ec,_0x4700be){return new Beepall(_0x2fd367,_0xe296fb,_0x3128ec,_0x4700be);}module[_0x300b('0x21')]=beepall;
\ No newline at end of file
index d1bb744..5242314 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe0b6=['./rrmemory','./agent','exports'];(function(_0x439aed,_0x217880){var _0x2a59bd=function(_0xae84c5){while(--_0xae84c5){_0x439aed['push'](_0x439aed['shift']());}};_0x2a59bd(++_0x217880);}(_0xe0b6,0x119));var _0x6e0b=function(_0x4d2f00,_0x4e94d5){_0x4d2f00=_0x4d2f00-0x0;var _0x2d7b7f=_0xe0b6[_0x4d2f00];return _0x2d7b7f;};'use strict';module[_0x6e0b('0x0')]={'rrmemory':require(_0x6e0b('0x1')),'beepall':require('./beepall'),'agent':require(_0x6e0b('0x2'))};
\ No newline at end of file
+var _0x8f6f=['./agent','exports','./rrmemory'];(function(_0x85a305,_0x3714b7){var _0x535938=function(_0x2f8a52){while(--_0x2f8a52){_0x85a305['push'](_0x85a305['shift']());}};_0x535938(++_0x3714b7);}(_0x8f6f,0x1ed));var _0xf8f6=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x8f6f[_0x2763f2];return _0x3ef471;};'use strict';module[_0xf8f6('0x0')]={'rrmemory':require(_0xf8f6('0x1')),'beepall':require('./beepall'),'agent':require(_0xf8f6('0x2'))};
\ No newline at end of file
index ed21f9c..a6aee20 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xeee9=['[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','hideNotification','writeLog','TIMEOUT','exports','lodash','uuid','notificationId','squeue','queue','realtime','routing','intervals','push','handleRun','bind','handleTimeout','module','timeout','drained','prototype','handleDrained','handleCheckReject','isAgentAvailable','agents','agentId','info','done','mapAgentsId','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','busyQueue','name','showNotification','RINGING'];(function(_0x592bff,_0x5b2529){var _0x1d6b43=function(_0x2a9307){while(--_0x2a9307){_0x592bff['push'](_0x592bff['shift']());}};_0x1d6b43(++_0x5b2529);}(_0xeee9,0x126));var _0x9eee=function(_0x3d6821,_0x413388){_0x3d6821=_0x3d6821-0x0;var _0x44d43b=_0xeee9[_0x3d6821];return _0x44d43b;};'use strict';var rr=require('rr');var _=require(_0x9eee('0x0'));var uuid=require(_0x9eee('0x1'));var util=require('./util');var logger=require('../../../../../config/logger')('routing');var RRMemory=function(_0x3adaf7,_0x38ce8e,_0x499290,_0x370f3c){this[_0x9eee('0x2')]=uuid['v4']();this[_0x9eee('0x3')]=_0x3adaf7;this[_0x9eee('0x4')]=_0x38ce8e;this[_0x9eee('0x5')]=_0x499290;this[_0x9eee('0x6')]=_0x370f3c;this[_0x9eee('0x7')]={};this[_0x9eee('0x3')][_0x9eee('0x8')](this[_0x9eee('0x9')][_0x9eee('0xa')](this),this[_0x9eee('0xb')][_0x9eee('0xa')](this),this[_0x9eee('0xc')]);this['squeue']['on'](_0x9eee('0xd'),this[_0x9eee('0xb')][_0x9eee('0xa')](this));this[_0x9eee('0x3')]['on'](_0x9eee('0xe'),this['handleDrained'][_0x9eee('0xa')](this));};RRMemory['prototype'][_0x9eee('0x8')]=function(){this[_0x9eee('0x3')][_0x9eee('0x8')](this[_0x9eee('0x9')][_0x9eee('0xa')](this),this[_0x9eee('0xb')][_0x9eee('0xa')](this));};RRMemory[_0x9eee('0xf')][_0x9eee('0x10')]=function(_0x3b1f5f){this[_0x9eee('0xb')](!![]);};RRMemory[_0x9eee('0xf')][_0x9eee('0x11')]=function(_0x760e1d){if(util[_0x9eee('0x12')](this[_0x9eee('0x3')]['id'],this[_0x9eee('0x5')][_0x9eee('0x13')][this[_0x9eee('0x14')]],this[_0x9eee('0x3')]['channel'],!![])){logger[_0x9eee('0x15')]('[%s][QUEUE]\x20available\x20again\x20%s',this['squeue']['id'],this['agentId']);clearInterval(this['intervals'][this['agentId']]);_0x760e1d[_0x9eee('0x16')]();setTimeout(this[_0x9eee('0x8')][_0x9eee('0xa')](this),0x3e8);}};RRMemory[_0x9eee('0xf')][_0x9eee('0x9')]=function(_0x5e6336){this['agentId']=rr(this['queue'][_0x9eee('0x17')]);logger[_0x9eee('0x15')]('[%s][QUEUE]\x20try\x20with\x20%s',this[_0x9eee('0x3')]['id'],this[_0x9eee('0x14')]);if(_[_0x9eee('0x18')](this[_0x9eee('0x5')][_0x9eee('0x13')][this[_0x9eee('0x14')]])){logger[_0x9eee('0x15')](_0x9eee('0x19'),this[_0x9eee('0x3')]['id'],this['agentId']);_0x5e6336[_0x9eee('0x16')]();setTimeout(this[_0x9eee('0x8')][_0x9eee('0xa')](this),0x3e8);}else{if(util[_0x9eee('0x12')](this[_0x9eee('0x3')]['id'],this[_0x9eee('0x5')][_0x9eee('0x13')][this[_0x9eee('0x14')]],this[_0x9eee('0x3')]['channel'],!![])){this['realtime']['agents'][this[_0x9eee('0x14')]]['busy']=!![];this[_0x9eee('0x5')][_0x9eee('0x13')][this[_0x9eee('0x14')]][_0x9eee('0x1a')]=this[_0x9eee('0x4')][_0x9eee('0x1b')];util[_0x9eee('0x1c')](this['notificationId'],this['squeue']['id'],this[_0x9eee('0x5')]['agents'][this['agentId']],this[_0x9eee('0x4')],this['routing']);util['writeLog'](this[_0x9eee('0x3')]['id'],this[_0x9eee('0x5')]['agents'][this[_0x9eee('0x14')]],_0x9eee('0x1d'));this[_0x9eee('0x7')][this[_0x9eee('0x14')]]=setInterval(this[_0x9eee('0x11')][_0x9eee('0xa')](this,_0x5e6336),0x3e8);}else{logger['info'](_0x9eee('0x1e'),this['squeue']['id'],this[_0x9eee('0x14')]);_0x5e6336[_0x9eee('0x16')]();setTimeout(this[_0x9eee('0x8')][_0x9eee('0xa')](this),0x3e8);}}};RRMemory[_0x9eee('0xf')]['handleTimeout']=function(_0x17e6ec){logger[_0x9eee('0x15')](_0x9eee('0x1f'),this[_0x9eee('0x3')]['id'],this[_0x9eee('0x14')]);if(_[_0x9eee('0x18')](this[_0x9eee('0x5')]['agents'][this['agentId']])){logger[_0x9eee('0x15')](_0x9eee('0x19'),this[_0x9eee('0x3')]['id'],this[_0x9eee('0x14')]);}else{clearInterval(this[_0x9eee('0x7')][this['agentId']]);util[_0x9eee('0x20')](this[_0x9eee('0x2')],this[_0x9eee('0x3')]['id'],this['realtime'][_0x9eee('0x13')][this[_0x9eee('0x14')]],this[_0x9eee('0x4')],this['routing']);util[_0x9eee('0x21')](this['squeue']['id'],this['realtime'][_0x9eee('0x13')][this['agentId']],_0x9eee('0x22'));this[_0x9eee('0x5')][_0x9eee('0x13')][this[_0x9eee('0x14')]]['busy']=![];this['realtime'][_0x9eee('0x13')][this[_0x9eee('0x14')]][_0x9eee('0x1a')]=undefined;}if(!_0x17e6ec){setTimeout(this[_0x9eee('0x8')][_0x9eee('0xa')](this),0x3e8);}};function rrmemory(_0xdc114b,_0x15ace7,_0x4268e3,_0x51097f){return new RRMemory(_0xdc114b,_0x15ace7,_0x4268e3,_0x51097f);}module[_0x9eee('0x23')]=rrmemory;
\ No newline at end of file
+var _0xc4c1=['handleRun','bind','handleTimeout','module','timeout','drained','prototype','handleDrained','handleCheckReject','isAgentAvailable','agents','agentId','channel','info','[%s][QUEUE]\x20available\x20again\x20%s','[%s][QUEUE]\x20try\x20with\x20%s','busy','showNotification','notificationId','writeLog','RINGING','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','done','[%s][QUEUE]\x20timeout\x20with\x20%s','isNil','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','TIMEOUT','busyQueue','exports','./util','routing','squeue','queue','realtime','intervals','push'];(function(_0x53c0b3,_0x430ef4){var _0x38681f=function(_0x421615){while(--_0x421615){_0x53c0b3['push'](_0x53c0b3['shift']());}};_0x38681f(++_0x430ef4);}(_0xc4c1,0x16b));var _0x1c4c=function(_0x323b88,_0x226b67){_0x323b88=_0x323b88-0x0;var _0x5857e2=_0xc4c1[_0x323b88];return _0x5857e2;};'use strict';var rr=require('rr');var _=require('lodash');var uuid=require('uuid');var util=require(_0x1c4c('0x0'));var logger=require('../../../../../config/logger')(_0x1c4c('0x1'));var RRMemory=function(_0x44f868,_0x2e9f78,_0x2d4ca4,_0x4e3a6d){this['notificationId']=uuid['v4']();this[_0x1c4c('0x2')]=_0x44f868;this[_0x1c4c('0x3')]=_0x2e9f78;this[_0x1c4c('0x4')]=_0x2d4ca4;this[_0x1c4c('0x1')]=_0x4e3a6d;this[_0x1c4c('0x5')]={};this[_0x1c4c('0x2')][_0x1c4c('0x6')](this[_0x1c4c('0x7')][_0x1c4c('0x8')](this),this[_0x1c4c('0x9')][_0x1c4c('0x8')](this),this[_0x1c4c('0xa')]);this[_0x1c4c('0x2')]['on'](_0x1c4c('0xb'),this[_0x1c4c('0x9')][_0x1c4c('0x8')](this));this[_0x1c4c('0x2')]['on'](_0x1c4c('0xc'),this['handleDrained'][_0x1c4c('0x8')](this));};RRMemory[_0x1c4c('0xd')][_0x1c4c('0x6')]=function(){this['squeue'][_0x1c4c('0x6')](this['handleRun']['bind'](this),this['handleTimeout']['bind'](this));};RRMemory[_0x1c4c('0xd')][_0x1c4c('0xe')]=function(_0xdc577a){this[_0x1c4c('0x9')](!![]);};RRMemory[_0x1c4c('0xd')][_0x1c4c('0xf')]=function(_0x54df5d){if(util[_0x1c4c('0x10')](this[_0x1c4c('0x2')]['id'],this[_0x1c4c('0x4')][_0x1c4c('0x11')][this[_0x1c4c('0x12')]],this['squeue'][_0x1c4c('0x13')],!![])){logger[_0x1c4c('0x14')](_0x1c4c('0x15'),this[_0x1c4c('0x2')]['id'],this[_0x1c4c('0x12')]);clearInterval(this['intervals'][this['agentId']]);_0x54df5d['done']();setTimeout(this[_0x1c4c('0x6')][_0x1c4c('0x8')](this),0x3e8);}};RRMemory[_0x1c4c('0xd')][_0x1c4c('0x7')]=function(_0x437340){this['agentId']=rr(this[_0x1c4c('0x3')]['mapAgentsId']);logger[_0x1c4c('0x14')](_0x1c4c('0x16'),this['squeue']['id'],this['agentId']);if(_['isNil'](this[_0x1c4c('0x4')][_0x1c4c('0x11')][this[_0x1c4c('0x12')]])){logger['info']('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x1c4c('0x2')]['id'],this['agentId']);_0x437340['done']();setTimeout(this[_0x1c4c('0x6')][_0x1c4c('0x8')](this),0x3e8);}else{if(util[_0x1c4c('0x10')](this[_0x1c4c('0x2')]['id'],this[_0x1c4c('0x4')][_0x1c4c('0x11')][this[_0x1c4c('0x12')]],this['squeue'][_0x1c4c('0x13')],!![])){this[_0x1c4c('0x4')][_0x1c4c('0x11')][this[_0x1c4c('0x12')]][_0x1c4c('0x17')]=!![];this[_0x1c4c('0x4')][_0x1c4c('0x11')][this[_0x1c4c('0x12')]]['busyQueue']=this[_0x1c4c('0x3')]['name'];util[_0x1c4c('0x18')](this[_0x1c4c('0x19')],this['squeue']['id'],this[_0x1c4c('0x4')][_0x1c4c('0x11')][this[_0x1c4c('0x12')]],this['queue'],this[_0x1c4c('0x1')]);util[_0x1c4c('0x1a')](this[_0x1c4c('0x2')]['id'],this[_0x1c4c('0x4')][_0x1c4c('0x11')][this[_0x1c4c('0x12')]],_0x1c4c('0x1b'));this['intervals'][this[_0x1c4c('0x12')]]=setInterval(this[_0x1c4c('0xf')][_0x1c4c('0x8')](this,_0x437340),0x3e8);}else{logger['info'](_0x1c4c('0x1c'),this[_0x1c4c('0x2')]['id'],this['agentId']);_0x437340[_0x1c4c('0x1d')]();setTimeout(this[_0x1c4c('0x6')]['bind'](this),0x3e8);}}};RRMemory[_0x1c4c('0xd')]['handleTimeout']=function(_0x4e20b1){logger[_0x1c4c('0x14')](_0x1c4c('0x1e'),this[_0x1c4c('0x2')]['id'],this[_0x1c4c('0x12')]);if(_[_0x1c4c('0x1f')](this[_0x1c4c('0x4')]['agents'][this['agentId']])){logger['info'](_0x1c4c('0x20'),this['squeue']['id'],this[_0x1c4c('0x12')]);}else{clearInterval(this[_0x1c4c('0x5')][this['agentId']]);util[_0x1c4c('0x21')](this['notificationId'],this[_0x1c4c('0x2')]['id'],this[_0x1c4c('0x4')][_0x1c4c('0x11')][this[_0x1c4c('0x12')]],this[_0x1c4c('0x3')],this['routing']);util['writeLog'](this['squeue']['id'],this[_0x1c4c('0x4')]['agents'][this[_0x1c4c('0x12')]],_0x1c4c('0x22'));this[_0x1c4c('0x4')][_0x1c4c('0x11')][this['agentId']][_0x1c4c('0x17')]=![];this[_0x1c4c('0x4')][_0x1c4c('0x11')][this['agentId']][_0x1c4c('0x23')]=undefined;}if(!_0x4e20b1){setTimeout(this['push'][_0x1c4c('0x8')](this),0x3e8);}};function rrmemory(_0x1f0c4a,_0x48bd35,_0x5cfa37,_0x1f040f){return new RRMemory(_0x1f0c4a,_0x48bd35,_0x5cfa37,_0x1f040f);}module[_0x1c4c('0x24')]=rrmemory;
\ No newline at end of file
index 3a49746..0b28222 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1623=['account','notificationShake','body','queue','msg','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','format','message','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification','lodash','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','socket.io-emitter','emit','user:%s','name','user:save','split','\x20interaction'];(function(_0x27ee66,_0x42d5f6){var _0x2b5e03=function(_0x197a7e){while(--_0x197a7e){_0x27ee66['push'](_0x27ee66['shift']());}};_0x2b5e03(++_0x42d5f6);}(_0x1623,0xab));var _0x3162=function(_0x46f912,_0x45cedf){_0x46f912=_0x46f912-0x0;var _0x155241=_0x1623[_0x46f912];return _0x155241;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var utils=require('../utils');var Mustache=require(_0x3162('0x1'));var Redis=require(_0x3162('0x2'));var config=require(_0x3162('0x3'));var logger=require(_0x3162('0x4'))(_0x3162('0x5'));config['redis']=_['defaults'](config[_0x3162('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x3162('0x7'))(new Redis(config[_0x3162('0x6')]));function emit(_0x53260d,_0xffe9b6,_0x2dc07e){io['to'](_0x53260d)[_0x3162('0x8')](_0xffe9b6,_0x2dc07e);}function sendNotification(_0x36609e,_0x10d684,_0x382676,_0xe43099,_0x113d28,_0x4bde10){io['to'](util['format'](_0x3162('0x9'),_0xe43099[_0x3162('0xa')]))[_0x3162('0x8')](_0x3162('0xb'),_0xe43099);var _0x813d62=_0x4bde10||{};var _0x208f4e=_0x382676[_0x3162('0xc')]('.');var _0x38da60={'uniqueid':_0x10d684,'channel':_0x208f4e[0x0],'id':_0x208f4e[0x1],'title':_0x208f4e[0x0]+_0x3162('0xd'),'interactionId':_0x208f4e[0x2],'queue':_0x113d28?_0x113d28['name']:null,'sound':_0x813d62[_0x3162('0xe')]['notificationSound'],'shake':_0x813d62[_0x3162('0xe')][_0x3162('0xf')]};try{if(!_0x813d62['body']){_0x813d62['body']={};}if(_0x113d28){_0x813d62[_0x3162('0x10')][_0x3162('0x11')]=_0x113d28;}else if(_0x813d62[_0x3162('0x10')]['queue']){delete _0x813d62[_0x3162('0x10')][_0x3162('0x11')];}_0x38da60[_0x3162('0x12')]=utils['getMustacheRender'](_0x813d62[_0x3162('0xe')][_0x3162('0x13')],_0x813d62);}catch(_0x46864e){_0x38da60[_0x3162('0x12')]=_0x3162('0x14');logger[_0x3162('0x15')](util[_0x3162('0x16')]('[%s][QUEUE]\x20%s',_0x10d684,_0x46864e[_0x3162('0x17')]));}io['to'](util[_0x3162('0x16')](_0x3162('0x9'),_0xe43099[_0x3162('0xa')]))['emit'](util[_0x3162('0x16')]('notification:%s',_0x36609e?'save':_0x3162('0x18')),_0x38da60);}function writeLog(_0x3e4d23,_0x31946d,_0x523fab){return logger['info'](util[_0x3162('0x16')](_0x3162('0x19'),_0x3e4d23,_0x31946d[_0x3162('0xa')],_0x523fab));}exports[_0x3162('0x1a')]=function(_0x31b27b,_0x14cbba,_0x52ae25,_0x1b2713){if(_0x14cbba['busy']){writeLog(_0x31b27b,_0x14cbba,_0x3162('0x1b'));return![];}if(!_0x14cbba[_0x3162('0x1c')]){writeLog(_0x31b27b,_0x14cbba,_0x3162('0x1d'));return![];}if(_0x14cbba[_0x52ae25+_0x3162('0x1e')]){writeLog(_0x31b27b,_0x14cbba,_0x3162('0x1f'));return![];}if(_0x1b2713&&_0x14cbba[_0x3162('0x20')](_0x52ae25+_0x3162('0x21'))&&_0x14cbba[_0x3162('0x20')](_0x52ae25+_0x3162('0x22'))){if(_0x14cbba[_0x52ae25+_0x3162('0x21')]>0x0&&_0x14cbba[_0x52ae25+_0x3162('0x22')]>=_0x14cbba[_0x52ae25+_0x3162('0x21')]){writeLog(_0x31b27b,_0x14cbba,_0x52ae25[_0x3162('0x23')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x3162('0x24')]=function(_0x552469,_0x37acdd,_0x31f7fd,_0x10c90b,_0x57f567){return sendNotification(!![],_0x552469,_0x37acdd,_0x31f7fd,_0x10c90b,_0x57f567);};exports['hideNotification']=function(_0xda0389,_0xaa1f35,_0x14df16,_0x399148,_0x2f88ec){return sendNotification(![],_0xda0389,_0xaa1f35,_0x14df16,_0x399148,_0x2f88ec);};exports['writeLog']=writeLog;
\ No newline at end of file
+var _0x7ee1=['info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','lodash','ioredis','../../../../../config/environment','../../../../../config/logger','redis','defaults','localhost','format','name','emit','user:save','split','\x20interaction','account','notificationSound','notificationShake','body','queue','getMustacheRender','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','user:%s','save'];(function(_0xb9897a,_0x2730ca){var _0x5327fe=function(_0x51f5b0){while(--_0x51f5b0){_0xb9897a['push'](_0xb9897a['shift']());}};_0x5327fe(++_0x2730ca);}(_0x7ee1,0x8d));var _0x17ee=function(_0x237c8c,_0x21d4c5){_0x237c8c=_0x237c8c-0x0;var _0x42e698=_0x7ee1[_0x237c8c];return _0x42e698;};'use strict';var _=require(_0x17ee('0x0'));var util=require('util');var utils=require('../utils');var Mustache=require('mustache');var Redis=require(_0x17ee('0x1'));var config=require(_0x17ee('0x2'));var logger=require(_0x17ee('0x3'))('routing');config[_0x17ee('0x4')]=_[_0x17ee('0x5')](config[_0x17ee('0x4')],{'host':_0x17ee('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x17ee('0x4')]));function emit(_0x29b9eb,_0x54b4f6,_0x3f61af){io['to'](_0x29b9eb)['emit'](_0x54b4f6,_0x3f61af);}function sendNotification(_0x3d767b,_0xfa5096,_0x2c961f,_0x4af369,_0x4b6374,_0x4d6bb5){io['to'](util[_0x17ee('0x7')]('user:%s',_0x4af369[_0x17ee('0x8')]))[_0x17ee('0x9')](_0x17ee('0xa'),_0x4af369);var _0x3d4f0f=_0x4d6bb5||{};var _0x57fae0=_0x2c961f[_0x17ee('0xb')]('.');var _0x51b5d9={'uniqueid':_0xfa5096,'channel':_0x57fae0[0x0],'id':_0x57fae0[0x1],'title':_0x57fae0[0x0]+_0x17ee('0xc'),'interactionId':_0x57fae0[0x2],'queue':_0x4b6374?_0x4b6374[_0x17ee('0x8')]:null,'sound':_0x3d4f0f[_0x17ee('0xd')][_0x17ee('0xe')],'shake':_0x3d4f0f[_0x17ee('0xd')][_0x17ee('0xf')]};try{if(!_0x3d4f0f[_0x17ee('0x10')]){_0x3d4f0f[_0x17ee('0x10')]={};}if(_0x4b6374){_0x3d4f0f[_0x17ee('0x10')][_0x17ee('0x11')]=_0x4b6374;}else if(_0x3d4f0f[_0x17ee('0x10')]['queue']){delete _0x3d4f0f['body']['queue'];}_0x51b5d9['msg']=utils[_0x17ee('0x12')](_0x3d4f0f[_0x17ee('0xd')][_0x17ee('0x13')],_0x3d4f0f);}catch(_0x2e2287){_0x51b5d9[_0x17ee('0x14')]=_0x17ee('0x15');logger[_0x17ee('0x16')](util['format'](_0x17ee('0x17'),_0xfa5096,_0x2e2287[_0x17ee('0x18')]));}io['to'](util[_0x17ee('0x7')](_0x17ee('0x19'),_0x4af369[_0x17ee('0x8')]))['emit'](util[_0x17ee('0x7')]('notification:%s',_0x3d767b?_0x17ee('0x1a'):'remove'),_0x51b5d9);}function writeLog(_0x1f4956,_0x343f1b,_0x2ee1b6){return logger[_0x17ee('0x1b')](util[_0x17ee('0x7')](_0x17ee('0x1c'),_0x1f4956,_0x343f1b[_0x17ee('0x8')],_0x2ee1b6));}exports[_0x17ee('0x1d')]=function(_0x1425e5,_0x1f3d6d,_0x37fe4e,_0x4d2d91){if(_0x1f3d6d['busy']){writeLog(_0x1425e5,_0x1f3d6d,_0x17ee('0x1e'));return![];}if(!_0x1f3d6d[_0x17ee('0x1f')]){writeLog(_0x1425e5,_0x1f3d6d,_0x17ee('0x20'));return![];}if(_0x1f3d6d[_0x37fe4e+_0x17ee('0x21')]){writeLog(_0x1425e5,_0x1f3d6d,_0x17ee('0x22'));return![];}if(_0x4d2d91&&_0x1f3d6d[_0x17ee('0x23')](_0x37fe4e+_0x17ee('0x24'))&&_0x1f3d6d[_0x17ee('0x23')](_0x37fe4e+_0x17ee('0x25'))){if(_0x1f3d6d[_0x37fe4e+_0x17ee('0x24')]>0x0&&_0x1f3d6d[_0x37fe4e+_0x17ee('0x25')]>=_0x1f3d6d[_0x37fe4e+_0x17ee('0x24')]){writeLog(_0x1425e5,_0x1f3d6d,_0x37fe4e['toUpperCase']()+_0x17ee('0x26'));return![];}}return!![];};exports[_0x17ee('0x27')]=function(_0x11ce7e,_0x258018,_0x125513,_0x51a561,_0x38237c){return sendNotification(!![],_0x11ce7e,_0x258018,_0x125513,_0x51a561,_0x38237c);};exports[_0x17ee('0x28')]=function(_0x295186,_0x4c461b,_0x2220cb,_0x27ab38,_0x56c6ba){return sendNotification(![],_0x295186,_0x4c461b,_0x2220cb,_0x27ab38,_0x56c6ba);};exports[_0x17ee('0x29')]=writeLog;
\ No newline at end of file
index 568a51b..3e371bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xdb6e=['[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','next','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','message','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next'];(function(_0x22d7dd,_0x2305fc){var _0x2050b9=function(_0x1c20c7){while(--_0x1c20c7){_0x22d7dd['push'](_0x22d7dd['shift']());}};_0x2050b9(++_0x2305fc);}(_0xdb6e,0x179));var _0xedb6=function(_0x4ea6af,_0x4aa32e){_0x4ea6af=_0x4ea6af-0x0;var _0x4cb1e6=_0xdb6e[_0x4ea6af];return _0x4cb1e6;};'use strict';var schema=require(_0xedb6('0x0'));var sh=require(_0xedb6('0x1'));var _=require(_0xedb6('0x2'));var utils=require(_0xedb6('0x3'));var logger=require(_0xedb6('0x4'))(_0xedb6('0x5'));var system=schema({'command':{'type':'string','required':!![],'message':_0xedb6('0x6')}});exports[_0xedb6('0x7')]=function(_0x2965e8,_0x473708){return function(_0x38be96){try{var _0x30de0d={'command':_0x473708[0x0]};var _0x35f987=system['validate'](_0x30de0d,{'typecast':!![]});if(_0x35f987[_0xedb6('0x8')]){logger[_0xedb6('0x9')](_0xedb6('0xa'),_0x2965e8,_['map'](_0x35f987,_0xedb6('0xb'))['join'](',\x20'));logger[_0xedb6('0xc')](_0xedb6('0xd'),_0x2965e8);_0x38be96['next']();}else{var _0x5dd041=this;var _0x1956d5=utils['getMustacheRender'](_0x473708[0x0],this);logger[_0xedb6('0xc')](_0xedb6('0xe'),_0x2965e8,_0x1956d5);sh[_0xedb6('0xf')](_[_0xedb6('0x10')](_0x1956d5),function(_0xe244f4,_0x51ffe2){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x2965e8,_0xe244f4);if(_0xe244f4==0x0){var _0x5cd9a3=_0x51ffe2[_0xedb6('0x11')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x473708[0x1])||_[_0xedb6('0x12')](_0x473708[0x1])){logger['info'](_0xedb6('0x13'),_0x2965e8);_0x5dd041[_0xedb6('0x14')][_0x473708[0x1]]=_0x5cd9a3;}else{logger[_0xedb6('0xc')]('[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s',_0x2965e8,_0x473708[0x1],_0x5cd9a3);_0x5dd041['body'][_0x473708[0x1]]=_0x5cd9a3;}}_0x38be96[_0xedb6('0x15')]();});}}catch(_0x3db1d8){logger[_0xedb6('0x9')](_0xedb6('0xa'),_0x2965e8,_['isObject'](_0x3db1d8)?JSON[_0xedb6('0x16')](_0x3db1d8):_0x3db1d8);logger[_0xedb6('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x2965e8);_0x38be96[_0xedb6('0x15')]();}};};
\ No newline at end of file
+var _0x1ca5=['shelljs','lodash','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','stringify','validate'];(function(_0x35d9b5,_0x782d1b){var _0x3d8f85=function(_0x22a3bf){while(--_0x22a3bf){_0x35d9b5['push'](_0x35d9b5['shift']());}};_0x3d8f85(++_0x782d1b);}(_0x1ca5,0x11d));var _0x51ca=function(_0x597e85,_0x5a2cf5){_0x597e85=_0x597e85-0x0;var _0x4bf259=_0x1ca5[_0x597e85];return _0x4bf259;};'use strict';var schema=require(_0x51ca('0x0'));var sh=require(_0x51ca('0x1'));var _=require(_0x51ca('0x2'));var utils=require(_0x51ca('0x3'));var logger=require(_0x51ca('0x4'))(_0x51ca('0x5'));var system=schema({'command':{'type':'string','required':!![],'message':_0x51ca('0x6')}});exports['consequence']=function(_0x176c0a,_0x133113){return function(_0x22b217){try{var _0x5d2035={'command':_0x133113[0x0]};var _0x296a69=system['validate'](_0x5d2035,{'typecast':!![]});if(_0x296a69[_0x51ca('0x7')]){logger[_0x51ca('0x8')](_0x51ca('0x9'),_0x176c0a,_['map'](_0x296a69,_0x51ca('0xa'))[_0x51ca('0xb')](',\x20'));logger[_0x51ca('0xc')](_0x51ca('0xd'),_0x176c0a);_0x22b217[_0x51ca('0xe')]();}else{var _0x1f478c=this;var _0x473ed5=utils[_0x51ca('0xf')](_0x133113[0x0],this);logger['info'](_0x51ca('0x10'),_0x176c0a,_0x473ed5);sh['exec'](_['trim'](_0x473ed5),function(_0x317271,_0x2d0e0a){logger[_0x51ca('0xc')](_0x51ca('0x11'),_0x176c0a,_0x317271);if(_0x317271==0x0){var _0x4f7467=_0x2d0e0a[_0x51ca('0x12')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x133113[0x1])||_['isEmpty'](_0x133113[0x1])){logger[_0x51ca('0xc')]('[%s][SYSTEM]\x20no\x20variable',_0x176c0a);_0x1f478c[_0x51ca('0x13')][_0x133113[0x1]]=_0x4f7467;}else{logger[_0x51ca('0xc')](_0x51ca('0x14'),_0x176c0a,_0x133113[0x1],_0x4f7467);_0x1f478c[_0x51ca('0x13')][_0x133113[0x1]]=_0x4f7467;}}_0x22b217[_0x51ca('0xe')]();});}}catch(_0x5de690){logger[_0x51ca('0x8')](_0x51ca('0x9'),_0x176c0a,_['isObject'](_0x5de690)?JSON[_0x51ca('0x15')](_0x5de690):_0x5de690);logger[_0x51ca('0xc')](_0x51ca('0xd'),_0x176c0a);_0x22b217[_0x51ca('0xe')]();}};};
\ No newline at end of file
index 71d4eb2..df69a82 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa355=['map','message','join','info','next','channel','Interaction','addTags','interaction','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','[%s][TAG]\x20%s','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','routing','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error'];(function(_0x530901,_0xfaf8f1){var _0xbe5cbe=function(_0x5a8da5){while(--_0x5a8da5){_0x530901['push'](_0x530901['shift']());}};_0xbe5cbe(++_0xfaf8f1);}(_0xa355,0x12d));var _0x5a35=function(_0x3ab862,_0x584207){_0x3ab862=_0x3ab862-0x0;var _0xfd3898=_0xa355[_0x3ab862];return _0xfd3898;};'use strict';var schema=require(_0x5a35('0x0'));var _=require(_0x5a35('0x1'));var rpc={'chatInteraction':require(_0x5a35('0x2')),'openchannelInteraction':require(_0x5a35('0x3')),'smsInteraction':require(_0x5a35('0x4')),'mailInteraction':require(_0x5a35('0x5')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require('../../../../config/logger')(_0x5a35('0x6'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x5a35('0x7')}});exports[_0x5a35('0x8')]=function(_0x20929a,_0x258c84,_0x547c04,_0x5c45b0){return function(_0x548b12){try{var _0x183362={'tag':_0x258c84[0x0]};var _0x5ad976=tag[_0x5a35('0x0')](_0x183362,{'typecast':!![]});if(_0x5ad976[_0x5a35('0x9')]){logger[_0x5a35('0xa')]('[%s][TAG]\x20%s',_0x20929a,_[_0x5a35('0xb')](_0x5ad976,_0x5a35('0xc'))[_0x5a35('0xd')](',\x20'));logger[_0x5a35('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x20929a);_0x548b12[_0x5a35('0xf')]();}else{var _0xbaa3f4={'ids':[_0x258c84[0x0]]};if(rpc[_0x5c45b0[_0x5a35('0x10')]+_0x5a35('0x11')]){rpc[_0x5c45b0['channel']+_0x5a35('0x11')][_0x5a35('0x12')](_0x5c45b0[_0x5a35('0x13')]['id'],_0xbaa3f4)['then'](function(_0x4998f0){logger['info'](_0x5a35('0x14'),_0x20929a,_0x258c84[0x1],_0x5c45b0[_0x5a35('0x10')],_0x5c45b0[_0x5a35('0x13')]['id']);})[_0x5a35('0x15')](function(_0x48e3dd){logger['error'](_0x5a35('0x16'),_0x20929a,JSON[_0x5a35('0x17')](_0x48e3dd));logger['info'](_0x5a35('0x18'),_0x20929a);})[_0x5a35('0x19')](function(){_0x548b12[_0x5a35('0xf')]();});}}}catch(_0x2e031d){logger['error'](_0x5a35('0x16'),_0x20929a,_['isObject'](_0x2e031d)?JSON[_0x5a35('0x17')](_0x2e031d):_0x2e031d);logger[_0x5a35('0xe')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x20929a);_0x548b12[_0x5a35('0xf')]();}};};
\ No newline at end of file
+var _0x0fd7=['interaction','then','catch','stringify','finally','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message','join','info','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0x0fd7,0xd7));var _0x70fd=function(_0x350e72,_0x59d6c8){_0x350e72=_0x350e72-0x0;var _0x22851f=_0x0fd7[_0x350e72];return _0x22851f;};'use strict';var schema=require(_0x70fd('0x0'));var _=require(_0x70fd('0x1'));var rpc={'chatInteraction':require(_0x70fd('0x2')),'openchannelInteraction':require(_0x70fd('0x3')),'smsInteraction':require(_0x70fd('0x4')),'mailInteraction':require(_0x70fd('0x5')),'faxInteraction':require(_0x70fd('0x6')),'whatsappInteraction':require(_0x70fd('0x7'))};var logger=require(_0x70fd('0x8'))(_0x70fd('0x9'));var tag=schema({'tag':{'type':_0x70fd('0xa'),'required':!![],'message':_0x70fd('0xb')}});exports[_0x70fd('0xc')]=function(_0x56287e,_0x1143e5,_0x1d4b5,_0xafdb96){return function(_0x2606d8){try{var _0x52d892={'tag':_0x1143e5[0x0]};var _0x2d4a3d=tag[_0x70fd('0x0')](_0x52d892,{'typecast':!![]});if(_0x2d4a3d[_0x70fd('0xd')]){logger[_0x70fd('0xe')](_0x70fd('0xf'),_0x56287e,_[_0x70fd('0x10')](_0x2d4a3d,_0x70fd('0x11'))[_0x70fd('0x12')](',\x20'));logger[_0x70fd('0x13')](_0x70fd('0x14'),_0x56287e);_0x2606d8[_0x70fd('0x15')]();}else{var _0xb20693={'ids':[_0x1143e5[0x0]]};if(rpc[_0xafdb96[_0x70fd('0x16')]+_0x70fd('0x17')]){rpc[_0xafdb96['channel']+_0x70fd('0x17')][_0x70fd('0x18')](_0xafdb96[_0x70fd('0x19')]['id'],_0xb20693)[_0x70fd('0x1a')](function(_0x570931){logger[_0x70fd('0x13')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x56287e,_0x1143e5[0x1],_0xafdb96[_0x70fd('0x16')],_0xafdb96[_0x70fd('0x19')]['id']);})[_0x70fd('0x1b')](function(_0x3e6986){logger[_0x70fd('0xe')](_0x70fd('0xf'),_0x56287e,JSON[_0x70fd('0x1c')](_0x3e6986));logger[_0x70fd('0x13')](_0x70fd('0x14'),_0x56287e);})[_0x70fd('0x1d')](function(){_0x2606d8[_0x70fd('0x15')]();});}}}catch(_0xace46f){logger[_0x70fd('0xe')](_0x70fd('0xf'),_0x56287e,_['isObject'](_0xace46f)?JSON[_0x70fd('0x1c')](_0xace46f):_0xace46f);logger['info'](_0x70fd('0x14'),_0x56287e);_0x2606d8[_0x70fd('0x15')]();}};};
\ No newline at end of file
index fbbfcd1..0148a75 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x24b299,_0x17a98b){var _0x3a7f69=function(_0x40c7bf){while(--_0x40c7bf){_0x24b299['push'](_0x24b299['shift']());}};_0x3a7f69(++_0x17a98b);}(_0xe706,0xa3));var _0x6e70=function(_0x1f2b0e,_0xc804dc){_0x1f2b0e=_0x1f2b0e-0x0;var _0x23b334=_0xe706[_0x1f2b0e];return _0x23b334;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}};
\ No newline at end of file
+var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x3d0481,_0x44a69e){var _0x2b3c82=function(_0x1f29d6){while(--_0x1f29d6){_0x3d0481['push'](_0x3d0481['shift']());}};_0x2b3c82(++_0x44a69e);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}};
\ No newline at end of file
index c259020..f591378 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9467=['IntervalId','isNil','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','.js','app','toLowerCase','autoreply','appdata','mail','push','dialogflow','split','dialogflowv2','slice','tag','TagId','%s:%s:%s','./interval','intervals','consequence','priority','info','on\x20interval','error','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','loggedIn','name','paused','waiting','mailQueues','available','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','jayson/promise','bluebird','uuid','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','format','%s.%s.%s'];(function(_0x5d0f97,_0x25009f){var _0xc7236=function(_0xa7353f){while(--_0xa7353f){_0x5d0f97['push'](_0x5d0f97['shift']());}};_0xc7236(++_0x25009f);}(_0x9467,0x169));var _0x7946=function(_0x3c36c6,_0x301c08){_0x3c36c6=_0x3c36c6-0x0;var _0x491f64=_0x9467[_0x3c36c6];return _0x491f64;};'use strict';var _=require('lodash');var util=require(_0x7946('0x0'));var path=require('path');var fs=require('fs');var jayson=require(_0x7946('0x1'));var BPromise=require(_0x7946('0x2'));var uuid=require(_0x7946('0x3'));var config=require('../../../config/environment');var logger=require(_0x7946('0x4'))(_0x7946('0x5'));var rpc={'openchannelQueueReport':require(_0x7946('0x6')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x7946('0x7')),'faxQueueReport':require(_0x7946('0x8')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x3d1fc7,_0xbfd4d5,_0x349f1b){return util[_0x7946('0x9')](_0x7946('0xa'),_0x3d1fc7,_0xbfd4d5||0x0,_0x349f1b||0x0);}function getIntervals(_0x5192d1,_0x5a78c5){var _0x2a5d94=[];if(!_['isNil'](_0x5a78c5[_0x7946('0xb')])&&!_[_0x7946('0xc')](_0x5192d1[_0x5a78c5[_0x7946('0xb')]])&&!_['isNil'](_0x5192d1[_0x5a78c5[_0x7946('0xb')]][_0x7946('0xd')])){_0x2a5d94=_[_0x7946('0xe')](_0x5192d1[_0x5a78c5[_0x7946('0xb')]]['Intervals'],_0x7946('0xf'));}else if(!_['isNil'](_0x5a78c5[_0x7946('0xf')])){_0x2a5d94=[_0x5a78c5[_0x7946('0xf')]];}return _0x2a5d94;}exports[_0x7946('0x10')]=function(_0xab2053){_0xab2053[_0x7946('0x11')]={};return new BPromise(function(_0x40aecf,_0x32413b){var _0x42eaac={'Start':function(_0x4c7c16){var _0x438b51=this;return new Promise(function(_0xffc8da,_0x522427){if(_0x4c7c16){try{var _0x1bbc73=[];var _0x7bbe89=getId(_0x4c7c16[_0x7946('0x12')],_0x4c7c16[_0x7946('0x13')]?_0x4c7c16[_0x7946('0x13')]['id']:0x0,_0x4c7c16[_0x7946('0x14')]?_0x4c7c16[_0x7946('0x14')]['id']:0x0);if(_0x4c7c16[_0x7946('0x15')]&&_[_0x7946('0x16')](_0x4c7c16['applications'])&&_0x4c7c16[_0x7946('0x15')]['length']){for(var _0x3003b2=0x0;_0x3003b2<_0x4c7c16['applications'][_0x7946('0x17')];_0x3003b2+=0x1){var _0x2fe35f=_0x4c7c16[_0x7946('0x15')][_0x3003b2];if(fs[_0x7946('0x18')](path[_0x7946('0x19')](__dirname,'applications',_0x2fe35f['app']+_0x7946('0x1a')))){var _0xf0c5af=[];switch(_0x2fe35f[_0x7946('0x1b')][_0x7946('0x1c')]()){case _0x7946('0x1d'):var _0x7c725c=_0x2fe35f[_0x7946('0x1e')]['split'](',');if(_0x4c7c16[_0x7946('0x12')]===_0x7946('0x1f')){_0xf0c5af[_0x7946('0x20')](_0x7c725c[0x0]);_0xf0c5af[_0x7946('0x20')](_0x7c725c[0x1]);_0xf0c5af[_0x7946('0x20')](_0x7c725c['slice'](0x2,_0x7c725c[_0x7946('0x17')])[_0x7946('0x19')](','));}else{_0xf0c5af[_0x7946('0x20')](_0x7c725c[0x0]);_0xf0c5af['push'](_0x7c725c['slice'](0x1,_0x7c725c[_0x7946('0x17')])[_0x7946('0x19')](','));}break;case _0x7946('0x21'):var _0x186048=_0x2fe35f[_0x7946('0x1e')][_0x7946('0x22')](',');_0xf0c5af['push'](_0x186048[0x0]);_0xf0c5af[_0x7946('0x20')](_0x186048[0x1]);_0xf0c5af[_0x7946('0x20')](_0x186048['slice'](0x2,_0x186048['length'])[_0x7946('0x19')](','));break;case _0x7946('0x23'):var _0x2784b4=_0x2fe35f['appdata'][_0x7946('0x22')](',');_0xf0c5af[_0x7946('0x20')](_0x2784b4[0x0]);_0xf0c5af['push'](_0x2784b4[0x1]);_0xf0c5af[_0x7946('0x20')](_0x2784b4[0x2]);_0xf0c5af[_0x7946('0x20')](_0x2784b4[0x3]);_0xf0c5af[_0x7946('0x20')](_0x2784b4['slice'](0x4,_0x2784b4[_0x7946('0x17')])[_0x7946('0x19')](','));break;case'amazonlex':var _0xb80772=_0x2fe35f[_0x7946('0x1e')]['split'](',');_0xf0c5af[_0x7946('0x20')](_0xb80772[0x0]);_0xf0c5af[_0x7946('0x20')](_0xb80772[0x1]);_0xf0c5af['push'](_0xb80772[0x2]);_0xf0c5af[_0x7946('0x20')](_0xb80772[0x3]);_0xf0c5af[_0x7946('0x20')](_0xb80772[_0x7946('0x24')](0x4,_0xb80772[_0x7946('0x17')])['join'](','));break;case'message':_0xf0c5af['push'](_0x2fe35f['appdata']);break;case _0x7946('0x25'):_0xf0c5af[_0x7946('0x20')](_0x2fe35f[_0x7946('0x26')]);_0xf0c5af[_0x7946('0x20')](_0x2fe35f['appdata']);break;default:_0xf0c5af=_[_0x7946('0xc')](_0x2fe35f[_0x7946('0x1e')])?[]:_0x2fe35f[_0x7946('0x1e')]['split'](',');}var _0x1fb0c6={'id':util[_0x7946('0x9')](_0x7946('0x27'),_0x7bbe89,_0x2fe35f['id'],_0x2fe35f[_0x7946('0x1b')]),'condition':require(_0x7946('0x28'))['condition'](_0x7bbe89,getIntervals(_0xab2053[_0x7946('0x29')],_0x2fe35f),_0xab2053),'consequence':require('./applications/'+_0x2fe35f[_0x7946('0x1b')])[_0x7946('0x2a')](_0x7bbe89,_0xf0c5af,_0xab2053,_0x4c7c16),'p':_0x2fe35f[_0x7946('0x2b')]||0x0};logger[_0x7946('0x2c')]('Push\x20new\x20rule',_0x1fb0c6['id'],_0x7946('0x2d'),getIntervals(_0xab2053['intervals'],_0x2fe35f)[_0x7946('0x19')]('\x20|\x20'));_0x1bbc73['push'](_0x1fb0c6);}else{logger[_0x7946('0x2e')](_0x7946('0x2f'),path['join'](__dirname,_0x7946('0x15'),_0x2fe35f[_0x7946('0x1b')]+_0x7946('0x1a')));}}_0xab2053['rules'][_0x7bbe89]=new RuleEngine(_0x1bbc73);_0xab2053['rules'][_0x7bbe89]['execute'](_0x4c7c16,function(_0x218a13){logger['info'](_0x7946('0x30'),JSON[_0x7946('0x31')](_0x218a13[_0x7946('0x32')]));if(_0xab2053[_0x7946('0x11')][_0x7bbe89]){_0xab2053[_0x7946('0x11')][_0x7bbe89][_0x7946('0x33')](_0x7946('0x34'));}});return _0xffc8da({'code':0xc8,'message':_0x4c7c16});}else{logger['info'](_0x7946('0x35'));return _0xffc8da({'code':0xc8,'message':_0x4c7c16});}}catch(_0x23c5e2){logger[_0x7946('0x2e')](_0x23c5e2[_0x7946('0x36')]);return _0x522427(_0x438b51[_0x7946('0x2e')](0x1f4,_0x23c5e2));}}return _0x522427(_0x7946('0x37'));});},'AcceptMessage':function(_0x16f670){var _0x32a69d=this;return new Promise(function(_0x47bb3f,_0x22f922){if(_0x16f670['agent']&&_0x16f670[_0x7946('0x38')]['id']){if(_0xab2053[_0x7946('0x39')][_0x16f670[_0x7946('0x38')]['id']]){_0xab2053['agents'][_0x16f670[_0x7946('0x38')]['id']][_0x7946('0x3a')]=![];_0xab2053[_0x7946('0x39')][_0x16f670[_0x7946('0x38')]['id']][_0x7946('0x3b')]=undefined;}}if(_0x16f670[_0x7946('0x13')]&&_0x16f670['message']['id']){try{var _0x52d645=getId(_0x16f670[_0x7946('0x12')],_0x16f670[_0x7946('0x13')]?_0x16f670[_0x7946('0x13')]['id']:0x0,_0x16f670['interaction']?_0x16f670[_0x7946('0x14')]['id']:0x0);if(_0xab2053[_0x7946('0x11')][_0x52d645]){_0xab2053[_0x7946('0x11')][_0x52d645][_0x7946('0x33')](_0x7946('0x3c'));if(rpc[_0x16f670['channel']+'QueueReport']){rpc[_0x16f670[_0x7946('0x12')]+_0x7946('0x3d')][_0x7946('0x3e')](_0x52d645,{'UserId':_0x16f670[_0x7946('0x13')][_0x7946('0x3f')]})[_0x7946('0x40')](function(_0x235405){logger[_0x7946('0x2e')](_0x7946('0x41'));});}}return _0x47bb3f({'code':0xc8,'message':_0x16f670});}catch(_0x57c747){logger[_0x7946('0x2e')](_0x57c747[_0x7946('0x36')]);return _0x22f922(_0x32a69d[_0x7946('0x2e')](0x1f4,_0x57c747));}}logger[_0x7946('0x2e')]('message\x20is\x20empty');return _0x22f922(_0x32a69d['error'](0x1f4,_0x7946('0x42')));});},'RejectMessage':function(_0x3e1301){var _0x112c64=this;return new Promise(function(_0x24f305,_0x304a3c){if(_0x3e1301[_0x7946('0x38')]&&_0x3e1301[_0x7946('0x38')]['id']){try{if(_0xab2053[_0x7946('0x39')][_0x3e1301[_0x7946('0x38')]['id']]){_0xab2053[_0x7946('0x39')][_0x3e1301[_0x7946('0x38')]['id']][_0x7946('0x3a')]=![];_0xab2053[_0x7946('0x39')][_0x3e1301[_0x7946('0x38')]['id']][_0x7946('0x3b')]=undefined;}return _0x24f305({'code':0xc8,'message':_0x3e1301});}catch(_0x1a29de){logger['error'](_0x1a29de['stack']);return _0x304a3c(_0x112c64[_0x7946('0x2e')](0x1f4,_0x1a29de));}}logger[_0x7946('0x2e')]('message\x20is\x20empty');return _0x304a3c(_0x112c64[_0x7946('0x2e')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x298c3d){var _0x2c6f24=this;return new Promise(function(_0xcc0a2c,_0x3e9127){if(_0x298c3d[_0x7946('0x12')]&&_0x298c3d['interaction']&&_0x298c3d['interaction']['id']){try{var _0x1232fb=getId(_0x298c3d[_0x7946('0x12')],_0x298c3d[_0x7946('0x13')]?_0x298c3d[_0x7946('0x13')]['id']:0x0,_0x298c3d['interaction']?_0x298c3d['interaction']['id']:0x0);if(_0xab2053['rules'][_0x1232fb]){_0xab2053[_0x7946('0x11')][_0x1232fb][_0x7946('0x33')](_0x7946('0x3c'));}return _0xcc0a2c({'code':0xc8,'message':_0x298c3d});}catch(_0x148f87){logger[_0x7946('0x2e')](_0x148f87[_0x7946('0x36')]);return _0x3e9127(_0x2c6f24[_0x7946('0x2e')](0x1f4,_0x148f87));}}logger[_0x7946('0x2e')]('message\x20is\x20empty');return _0x3e9127(_0x2c6f24[_0x7946('0x2e')](0x1f4,_0x7946('0x42')));});},'AgentCapacity':function(_0x13b5d7){var _0x1157f0=this;return new Promise(function(_0x122b20,_0x51abba){if(_0xab2053[_0x7946('0x39')][_0x7946('0x43')](_0x13b5d7['id'])){for(var _0xfedcc4 in _0x13b5d7[_0x7946('0x44')]){if(_0x13b5d7[_0x7946('0x44')][_0x7946('0x43')](_0xfedcc4)){if(_0xab2053[_0x7946('0x39')][_0x13b5d7['id']][_0x7946('0x43')](_0xfedcc4+_0x7946('0x45'))){_0xab2053[_0x7946('0x39')][_0x13b5d7['id']][_0xfedcc4+'CurrentCapacity']=parseInt(_0x13b5d7[_0x7946('0x44')][_0xfedcc4],0xa);}}}_0xab2053[_0x7946('0x39')][_0x13b5d7['id']][_0x7946('0x46')]();return _0x122b20({'code':0xc8,'message':_0xab2053['agents'][_0x13b5d7['id']]});}else{return _0x51abba(_0x1157f0['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x263dd4){return new Promise(function(_0x491fd5,_0x285e12){var _0xfbda10=_[_0x7946('0x47')](_0xab2053[_0x7946('0x39')]);_0x491fd5({'count':_0xfbda10[_0x7946('0x17')],'rows':_0xfbda10});});},'ChatQueues':function(_0x383695){return new Promise(function(_0x161fa6,_0xb5ae75){var _0x214adf=[];for(var _0x1c6cf0 in _0xab2053[_0x7946('0x48')]){if(_0xab2053['chatQueues'][_0x7946('0x43')](_0x1c6cf0)){var _0x27f8bf=_0xab2053[_0x7946('0x48')][_0x1c6cf0];var _0x4c8510={'id':_0x27f8bf['id'],'available':_0x27f8bf['available'],'loggedIn':_0x27f8bf[_0x7946('0x49')],'name':_0x27f8bf[_0x7946('0x4a')],'paused':_0x27f8bf[_0x7946('0x4b')],'waiting':_0x27f8bf[_0x7946('0x4c')]};_0x214adf['push'](_0x4c8510);}}_0x161fa6({'count':_0x214adf[_0x7946('0x17')],'rows':_0x214adf});});},'MailQueues':function(_0x536827){return new Promise(function(_0x1a747f,_0x586f53){var _0x458293=[];for(var _0x2ff29c in _0xab2053[_0x7946('0x4d')]){if(_0xab2053['mailQueues'][_0x7946('0x43')](_0x2ff29c)){var _0x14d2e3=_0xab2053['mailQueues'][_0x2ff29c];var _0x17b273={'id':_0x14d2e3['id'],'available':_0x14d2e3[_0x7946('0x4e')],'loggedIn':_0x14d2e3[_0x7946('0x49')],'name':_0x14d2e3[_0x7946('0x4a')],'paused':_0x14d2e3[_0x7946('0x4b')],'waiting':_0x14d2e3[_0x7946('0x4c')]};_0x458293[_0x7946('0x20')](_0x17b273);}}_0x1a747f({'count':_0x458293[_0x7946('0x17')],'rows':_0x458293});});},'OpenchannelQueues':function(_0x5f0e31){return new Promise(function(_0x549a5f,_0x3ee7e6){var _0x3c16ac=[];for(var _0x1ffda4 in _0xab2053[_0x7946('0x4f')]){if(_0xab2053['openchannelQueues'][_0x7946('0x43')](_0x1ffda4)){var _0x543529=_0xab2053['openchannelQueues'][_0x1ffda4];var _0x1a3014={'id':_0x543529['id'],'available':_0x543529[_0x7946('0x4e')],'loggedIn':_0x543529['loggedIn'],'name':_0x543529[_0x7946('0x4a')],'paused':_0x543529[_0x7946('0x4b')],'waiting':_0x543529['waiting']};_0x3c16ac[_0x7946('0x20')](_0x1a3014);}}_0x549a5f({'count':_0x3c16ac[_0x7946('0x17')],'rows':_0x3c16ac});});},'SmsQueues':function(_0x33f09f){return new Promise(function(_0x1e3f83,_0x1d3703){var _0x64f18e=[];for(var _0x583179 in _0xab2053[_0x7946('0x50')]){if(_0xab2053[_0x7946('0x50')]['hasOwnProperty'](_0x583179)){var _0xc4fc84=_0xab2053[_0x7946('0x50')][_0x583179];var _0x3c21cf={'id':_0xc4fc84['id'],'available':_0xc4fc84[_0x7946('0x4e')],'loggedIn':_0xc4fc84[_0x7946('0x49')],'name':_0xc4fc84[_0x7946('0x4a')],'paused':_0xc4fc84[_0x7946('0x4b')],'waiting':_0xc4fc84['waiting']};_0x64f18e[_0x7946('0x20')](_0x3c21cf);}}_0x1e3f83({'count':_0x64f18e[_0x7946('0x17')],'rows':_0x64f18e});});},'FaxQueues':function(_0x34d21f){return new Promise(function(_0x32fe3f,_0x2c2d7a){var _0x411bab=[];for(var _0x7ea630 in _0xab2053[_0x7946('0x51')]){if(_0xab2053[_0x7946('0x51')][_0x7946('0x43')](_0x7ea630)){var _0x1fef80=_0xab2053[_0x7946('0x51')][_0x7ea630];var _0x221e4f={'id':_0x1fef80['id'],'available':_0x1fef80[_0x7946('0x4e')],'loggedIn':_0x1fef80[_0x7946('0x49')],'name':_0x1fef80['name'],'paused':_0x1fef80[_0x7946('0x4b')],'waiting':_0x1fef80['waiting']};_0x411bab[_0x7946('0x20')](_0x221e4f);}}_0x32fe3f({'count':_0x411bab[_0x7946('0x17')],'rows':_0x411bab});});},'WhatsappQueues':function(_0x597387){return new Promise(function(_0x575a19,_0x305d01){var _0x351182=[];for(var _0x515417 in _0xab2053[_0x7946('0x52')]){if(_0xab2053[_0x7946('0x52')][_0x7946('0x43')](_0x515417)){var _0xed67ff=_0xab2053[_0x7946('0x52')][_0x515417];var _0x12511f={'id':_0xed67ff['id'],'available':_0xed67ff[_0x7946('0x4e')],'loggedIn':_0xed67ff[_0x7946('0x49')],'name':_0xed67ff[_0x7946('0x4a')],'paused':_0xed67ff[_0x7946('0x4b')],'waiting':_0xed67ff[_0x7946('0x4c')]};_0x351182[_0x7946('0x20')](_0x12511f);}}_0x575a19({'count':_0x351182[_0x7946('0x17')],'rows':_0x351182});});},'ChatQueuesWaitingInteractions':function(_0x54e8ab){return new Promise(function(_0x18987b,_0x37a301){var _0x155d11=_[_0x7946('0x47')](_0xab2053[_0x7946('0x53')]);_0x18987b({'count':_0x155d11['length'],'rows':_0x155d11});});},'MailQueuesWaitingInteractions':function(_0x5976ce){return new Promise(function(_0x1b1fc6,_0x19ae8e){var _0x143323=_[_0x7946('0x47')](_0xab2053[_0x7946('0x54')]);_0x1b1fc6({'count':_0x143323[_0x7946('0x17')],'rows':_0x143323});});},'OpenchannelQueuesWaitingInteractions':function(_0x2230eb){return new Promise(function(_0x4e01a5,_0x45ca1c){var _0xd70ee0=_[_0x7946('0x47')](_0xab2053[_0x7946('0x55')]);_0x4e01a5({'count':_0xd70ee0['length'],'rows':_0xd70ee0});});},'SmsQueuesWaitingInteractions':function(_0x2815de){return new Promise(function(_0x5138bb,_0x3523de){var _0x127d29=_[_0x7946('0x47')](_0xab2053[_0x7946('0x56')]);_0x5138bb({'count':_0x127d29[_0x7946('0x17')],'rows':_0x127d29});});},'FaxQueuesWaitingInteractions':function(_0x311348){return new Promise(function(_0x3bce92,_0x323cc1){var _0x5e5ad9=_['values'](_0xab2053['faxQueuesWaitingInteractions']);_0x3bce92({'count':_0x5e5ad9[_0x7946('0x17')],'rows':_0x5e5ad9});});},'WhatsappQueuesWaitingInteractions':function(_0x39fa7f){return new Promise(function(_0x4ffcab,_0x1d1fbe){var _0x2809ea=_[_0x7946('0x47')](_0xab2053[_0x7946('0x57')]);_0x4ffcab({'count':_0x2809ea[_0x7946('0x17')],'rows':_0x2809ea});});}};var _0x1d9a17=jayson[_0x7946('0x58')](_0x42eaac)[_0x7946('0x59')]();_0x1d9a17['on'](_0x7946('0x2e'),function(_0x24af28){logger['error'](JSON[_0x7946('0x31')](_0x24af28));return _0x32413b(_0x24af28);});_0x1d9a17[_0x7946('0x10')](0x232c,'127.0.0.1',function(){console[_0x7946('0x5a')](_0x7946('0x5b'),0x232c);return _0x40aecf(_0x7946('0x5c')+0x232c);});});};
\ No newline at end of file
+var _0x70c3=['isNil','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','appdata','split','push','slice','dialogflow','dialogflowv2','tag','TagId','format','%s:%s:%s','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','end','QueueReport','update','UserId','message\x20is\x20empty','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','loggedIn','name','paused','waiting','openchannelQueues','available','smsQueues','faxQueues','whatsappQueues','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','jayson/promise','bluebird','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','IntervalId'];(function(_0x1bc013,_0x7771c6){var _0x55df36=function(_0x1c02e0){while(--_0x1c02e0){_0x1bc013['push'](_0x1bc013['shift']());}};_0x55df36(++_0x7771c6);}(_0x70c3,0x153));var _0x370c=function(_0x5d8cc7,_0x2f513e){_0x5d8cc7=_0x5d8cc7-0x0;var _0x7c43d0=_0x70c3[_0x5d8cc7];return _0x7c43d0;};'use strict';var _=require(_0x370c('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var jayson=require(_0x370c('0x1'));var BPromise=require(_0x370c('0x2'));var uuid=require('uuid');var config=require(_0x370c('0x3'));var logger=require('../../../config/logger')(_0x370c('0x4'));var rpc={'openchannelQueueReport':require(_0x370c('0x5')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require(_0x370c('0x6'))};var RuleEngine=require(_0x370c('0x7'));function getId(_0x1b4db9,_0xede5f1,_0x4d2552){return util['format']('%s.%s.%s',_0x1b4db9,_0xede5f1||0x0,_0x4d2552||0x0);}function getIntervals(_0x1811cf,_0x73b4f4){var _0x452929=[];if(!_['isNil'](_0x73b4f4[_0x370c('0x8')])&&!_['isNil'](_0x1811cf[_0x73b4f4[_0x370c('0x8')]])&&!_[_0x370c('0x9')](_0x1811cf[_0x73b4f4[_0x370c('0x8')]][_0x370c('0xa')])){_0x452929=_[_0x370c('0xb')](_0x1811cf[_0x73b4f4[_0x370c('0x8')]]['Intervals'],_0x370c('0xc'));}else if(!_['isNil'](_0x73b4f4[_0x370c('0xc')])){_0x452929=[_0x73b4f4[_0x370c('0xc')]];}return _0x452929;}exports[_0x370c('0xd')]=function(_0x4d1fde){_0x4d1fde[_0x370c('0xe')]={};return new BPromise(function(_0x4c751b,_0x334f2d){var _0x341e16={'Start':function(_0x4f185d){var _0x552506=this;return new Promise(function(_0x14ade3,_0x1a60a2){if(_0x4f185d){try{var _0x1a8ea5=[];var _0x55fa65=getId(_0x4f185d[_0x370c('0xf')],_0x4f185d[_0x370c('0x10')]?_0x4f185d[_0x370c('0x10')]['id']:0x0,_0x4f185d[_0x370c('0x11')]?_0x4f185d['interaction']['id']:0x0);if(_0x4f185d[_0x370c('0x12')]&&_[_0x370c('0x13')](_0x4f185d[_0x370c('0x12')])&&_0x4f185d[_0x370c('0x12')][_0x370c('0x14')]){for(var _0x37b50b=0x0;_0x37b50b<_0x4f185d['applications'][_0x370c('0x14')];_0x37b50b+=0x1){var _0x4ab302=_0x4f185d[_0x370c('0x12')][_0x37b50b];if(fs[_0x370c('0x15')](path[_0x370c('0x16')](__dirname,'applications',_0x4ab302[_0x370c('0x17')]+_0x370c('0x18')))){var _0x5864bd=[];switch(_0x4ab302[_0x370c('0x17')][_0x370c('0x19')]()){case'autoreply':var _0x40ea92=_0x4ab302[_0x370c('0x1a')][_0x370c('0x1b')](',');if(_0x4f185d['channel']==='mail'){_0x5864bd[_0x370c('0x1c')](_0x40ea92[0x0]);_0x5864bd[_0x370c('0x1c')](_0x40ea92[0x1]);_0x5864bd[_0x370c('0x1c')](_0x40ea92[_0x370c('0x1d')](0x2,_0x40ea92[_0x370c('0x14')])[_0x370c('0x16')](','));}else{_0x5864bd[_0x370c('0x1c')](_0x40ea92[0x0]);_0x5864bd[_0x370c('0x1c')](_0x40ea92[_0x370c('0x1d')](0x1,_0x40ea92[_0x370c('0x14')])[_0x370c('0x16')](','));}break;case _0x370c('0x1e'):var _0xab51de=_0x4ab302[_0x370c('0x1a')][_0x370c('0x1b')](',');_0x5864bd[_0x370c('0x1c')](_0xab51de[0x0]);_0x5864bd[_0x370c('0x1c')](_0xab51de[0x1]);_0x5864bd['push'](_0xab51de[_0x370c('0x1d')](0x2,_0xab51de[_0x370c('0x14')])[_0x370c('0x16')](','));break;case _0x370c('0x1f'):var _0x1ab256=_0x4ab302[_0x370c('0x1a')][_0x370c('0x1b')](',');_0x5864bd[_0x370c('0x1c')](_0x1ab256[0x0]);_0x5864bd[_0x370c('0x1c')](_0x1ab256[0x1]);_0x5864bd[_0x370c('0x1c')](_0x1ab256[0x2]);_0x5864bd[_0x370c('0x1c')](_0x1ab256[0x3]);_0x5864bd[_0x370c('0x1c')](_0x1ab256[_0x370c('0x1d')](0x4,_0x1ab256[_0x370c('0x14')])[_0x370c('0x16')](','));break;case'amazonlex':var _0x289cfa=_0x4ab302[_0x370c('0x1a')][_0x370c('0x1b')](',');_0x5864bd[_0x370c('0x1c')](_0x289cfa[0x0]);_0x5864bd[_0x370c('0x1c')](_0x289cfa[0x1]);_0x5864bd['push'](_0x289cfa[0x2]);_0x5864bd['push'](_0x289cfa[0x3]);_0x5864bd[_0x370c('0x1c')](_0x289cfa[_0x370c('0x1d')](0x4,_0x289cfa['length'])[_0x370c('0x16')](','));break;case _0x370c('0x10'):_0x5864bd[_0x370c('0x1c')](_0x4ab302['appdata']);break;case _0x370c('0x20'):_0x5864bd[_0x370c('0x1c')](_0x4ab302[_0x370c('0x21')]);_0x5864bd[_0x370c('0x1c')](_0x4ab302[_0x370c('0x1a')]);break;default:_0x5864bd=_[_0x370c('0x9')](_0x4ab302[_0x370c('0x1a')])?[]:_0x4ab302[_0x370c('0x1a')][_0x370c('0x1b')](',');}var _0x6b406d={'id':util[_0x370c('0x22')](_0x370c('0x23'),_0x55fa65,_0x4ab302['id'],_0x4ab302[_0x370c('0x17')]),'condition':require('./interval')[_0x370c('0x24')](_0x55fa65,getIntervals(_0x4d1fde[_0x370c('0x25')],_0x4ab302),_0x4d1fde),'consequence':require(_0x370c('0x26')+_0x4ab302[_0x370c('0x17')])[_0x370c('0x27')](_0x55fa65,_0x5864bd,_0x4d1fde,_0x4f185d),'p':_0x4ab302[_0x370c('0x28')]||0x0};logger[_0x370c('0x29')](_0x370c('0x2a'),_0x6b406d['id'],'on\x20interval',getIntervals(_0x4d1fde[_0x370c('0x25')],_0x4ab302)['join'](_0x370c('0x2b')));_0x1a8ea5['push'](_0x6b406d);}else{logger[_0x370c('0x2c')](_0x370c('0x2d'),path[_0x370c('0x16')](__dirname,_0x370c('0x12'),_0x4ab302[_0x370c('0x17')]+_0x370c('0x18')));}}_0x4d1fde['rules'][_0x55fa65]=new RuleEngine(_0x1a8ea5);_0x4d1fde['rules'][_0x55fa65][_0x370c('0x2e')](_0x4f185d,function(_0x4b7bf0){logger[_0x370c('0x29')]('Applications\x20executed',JSON[_0x370c('0x2f')](_0x4b7bf0[_0x370c('0x30')]));if(_0x4d1fde[_0x370c('0xe')][_0x55fa65]){_0x4d1fde[_0x370c('0xe')][_0x55fa65][_0x370c('0x31')](_0x370c('0x32'));}});return _0x14ade3({'code':0xc8,'message':_0x4f185d});}else{logger[_0x370c('0x29')](_0x370c('0x33'));return _0x14ade3({'code':0xc8,'message':_0x4f185d});}}catch(_0x55cae2){logger['error'](_0x55cae2[_0x370c('0x34')]);return _0x1a60a2(_0x552506['error'](0x1f4,_0x55cae2));}}return _0x1a60a2(_0x370c('0x35'));});},'AcceptMessage':function(_0x99eeee){var _0x13e3eb=this;return new Promise(function(_0x3461cc,_0x15ddd7){if(_0x99eeee[_0x370c('0x36')]&&_0x99eeee[_0x370c('0x36')]['id']){if(_0x4d1fde[_0x370c('0x37')][_0x99eeee[_0x370c('0x36')]['id']]){_0x4d1fde[_0x370c('0x37')][_0x99eeee[_0x370c('0x36')]['id']][_0x370c('0x38')]=![];_0x4d1fde['agents'][_0x99eeee[_0x370c('0x36')]['id']]['busyQueue']=undefined;}}if(_0x99eeee[_0x370c('0x10')]&&_0x99eeee[_0x370c('0x10')]['id']){try{var _0x15cb19=getId(_0x99eeee[_0x370c('0xf')],_0x99eeee[_0x370c('0x10')]?_0x99eeee['message']['id']:0x0,_0x99eeee[_0x370c('0x11')]?_0x99eeee['interaction']['id']:0x0);if(_0x4d1fde[_0x370c('0xe')][_0x15cb19]){_0x4d1fde[_0x370c('0xe')][_0x15cb19][_0x370c('0x31')](_0x370c('0x39'));if(rpc[_0x99eeee['channel']+_0x370c('0x3a')]){rpc[_0x99eeee['channel']+_0x370c('0x3a')][_0x370c('0x3b')](_0x15cb19,{'UserId':_0x99eeee[_0x370c('0x10')][_0x370c('0x3c')]})['catch'](function(_0x15c40c){logger[_0x370c('0x2c')]('error\x20update\x20queue\x20report');});}}return _0x3461cc({'code':0xc8,'message':_0x99eeee});}catch(_0x55f0ca){logger[_0x370c('0x2c')](_0x55f0ca['stack']);return _0x15ddd7(_0x13e3eb[_0x370c('0x2c')](0x1f4,_0x55f0ca));}}logger[_0x370c('0x2c')](_0x370c('0x3d'));return _0x15ddd7(_0x13e3eb[_0x370c('0x2c')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x4fb9e5){var _0x266899=this;return new Promise(function(_0x50a4a6,_0xbf1beb){if(_0x4fb9e5['agent']&&_0x4fb9e5['agent']['id']){try{if(_0x4d1fde[_0x370c('0x37')][_0x4fb9e5[_0x370c('0x36')]['id']]){_0x4d1fde[_0x370c('0x37')][_0x4fb9e5[_0x370c('0x36')]['id']]['busy']=![];_0x4d1fde[_0x370c('0x37')][_0x4fb9e5[_0x370c('0x36')]['id']][_0x370c('0x3e')]=undefined;}return _0x50a4a6({'code':0xc8,'message':_0x4fb9e5});}catch(_0x34b2bc){logger[_0x370c('0x2c')](_0x34b2bc['stack']);return _0xbf1beb(_0x266899[_0x370c('0x2c')](0x1f4,_0x34b2bc));}}logger[_0x370c('0x2c')](_0x370c('0x3d'));return _0xbf1beb(_0x266899[_0x370c('0x2c')](0x1f4,_0x370c('0x3d')));});},'AbandonInteraction':function(_0x4f1cdc){var _0xb44206=this;return new Promise(function(_0x59ada7,_0x291ec4){if(_0x4f1cdc['channel']&&_0x4f1cdc['interaction']&&_0x4f1cdc['interaction']['id']){try{var _0x54170f=getId(_0x4f1cdc[_0x370c('0xf')],_0x4f1cdc[_0x370c('0x10')]?_0x4f1cdc[_0x370c('0x10')]['id']:0x0,_0x4f1cdc['interaction']?_0x4f1cdc[_0x370c('0x11')]['id']:0x0);if(_0x4d1fde['rules'][_0x54170f]){_0x4d1fde[_0x370c('0xe')][_0x54170f][_0x370c('0x31')]('end');}return _0x59ada7({'code':0xc8,'message':_0x4f1cdc});}catch(_0x487c26){logger[_0x370c('0x2c')](_0x487c26[_0x370c('0x34')]);return _0x291ec4(_0xb44206[_0x370c('0x2c')](0x1f4,_0x487c26));}}logger[_0x370c('0x2c')](_0x370c('0x3d'));return _0x291ec4(_0xb44206[_0x370c('0x2c')](0x1f4,_0x370c('0x3d')));});},'AgentCapacity':function(_0x405a99){var _0x31dd18=this;return new Promise(function(_0x6ff15d,_0x5a3bda){if(_0x4d1fde[_0x370c('0x37')][_0x370c('0x3f')](_0x405a99['id'])){for(var _0x195946 in _0x405a99[_0x370c('0x40')]){if(_0x405a99['capacity'][_0x370c('0x3f')](_0x195946)){if(_0x4d1fde[_0x370c('0x37')][_0x405a99['id']][_0x370c('0x3f')](_0x195946+_0x370c('0x41'))){_0x4d1fde['agents'][_0x405a99['id']][_0x195946+'CurrentCapacity']=parseInt(_0x405a99['capacity'][_0x195946],0xa);}}}_0x4d1fde[_0x370c('0x37')][_0x405a99['id']][_0x370c('0x42')]();return _0x6ff15d({'code':0xc8,'message':_0x4d1fde['agents'][_0x405a99['id']]});}else{return _0x5a3bda(_0x31dd18[_0x370c('0x2c')](0x1f4,_0x370c('0x43')));}});},'Agents':function(_0x11e016){return new Promise(function(_0xf91de4,_0x4f4229){var _0x520455=_[_0x370c('0x44')](_0x4d1fde['agents']);_0xf91de4({'count':_0x520455['length'],'rows':_0x520455});});},'ChatQueues':function(_0x6a6176){return new Promise(function(_0x586b07,_0x43c1e6){var _0x59ba5d=[];for(var _0xcd30df in _0x4d1fde['chatQueues']){if(_0x4d1fde[_0x370c('0x45')]['hasOwnProperty'](_0xcd30df)){var _0x1b634f=_0x4d1fde[_0x370c('0x45')][_0xcd30df];var _0x648f9e={'id':_0x1b634f['id'],'available':_0x1b634f['available'],'loggedIn':_0x1b634f[_0x370c('0x46')],'name':_0x1b634f[_0x370c('0x47')],'paused':_0x1b634f[_0x370c('0x48')],'waiting':_0x1b634f['waiting']};_0x59ba5d[_0x370c('0x1c')](_0x648f9e);}}_0x586b07({'count':_0x59ba5d[_0x370c('0x14')],'rows':_0x59ba5d});});},'MailQueues':function(_0x3c5947){return new Promise(function(_0x37829c,_0x411a0f){var _0x50901a=[];for(var _0x112416 in _0x4d1fde['mailQueues']){if(_0x4d1fde['mailQueues']['hasOwnProperty'](_0x112416)){var _0x18a748=_0x4d1fde['mailQueues'][_0x112416];var _0x2d0c12={'id':_0x18a748['id'],'available':_0x18a748['available'],'loggedIn':_0x18a748['loggedIn'],'name':_0x18a748[_0x370c('0x47')],'paused':_0x18a748['paused'],'waiting':_0x18a748[_0x370c('0x49')]};_0x50901a[_0x370c('0x1c')](_0x2d0c12);}}_0x37829c({'count':_0x50901a[_0x370c('0x14')],'rows':_0x50901a});});},'OpenchannelQueues':function(_0x44a53c){return new Promise(function(_0x22a0c2,_0x5d86cc){var _0x39ecc7=[];for(var _0x35da71 in _0x4d1fde[_0x370c('0x4a')]){if(_0x4d1fde[_0x370c('0x4a')][_0x370c('0x3f')](_0x35da71)){var _0x4e4644=_0x4d1fde[_0x370c('0x4a')][_0x35da71];var _0x2b9edb={'id':_0x4e4644['id'],'available':_0x4e4644[_0x370c('0x4b')],'loggedIn':_0x4e4644[_0x370c('0x46')],'name':_0x4e4644[_0x370c('0x47')],'paused':_0x4e4644[_0x370c('0x48')],'waiting':_0x4e4644[_0x370c('0x49')]};_0x39ecc7[_0x370c('0x1c')](_0x2b9edb);}}_0x22a0c2({'count':_0x39ecc7['length'],'rows':_0x39ecc7});});},'SmsQueues':function(_0x16522b){return new Promise(function(_0x5c4916,_0x2a73af){var _0x5aa9e6=[];for(var _0x15fe41 in _0x4d1fde[_0x370c('0x4c')]){if(_0x4d1fde[_0x370c('0x4c')][_0x370c('0x3f')](_0x15fe41)){var _0x3448ff=_0x4d1fde[_0x370c('0x4c')][_0x15fe41];var _0x3b7d86={'id':_0x3448ff['id'],'available':_0x3448ff[_0x370c('0x4b')],'loggedIn':_0x3448ff['loggedIn'],'name':_0x3448ff[_0x370c('0x47')],'paused':_0x3448ff[_0x370c('0x48')],'waiting':_0x3448ff[_0x370c('0x49')]};_0x5aa9e6[_0x370c('0x1c')](_0x3b7d86);}}_0x5c4916({'count':_0x5aa9e6['length'],'rows':_0x5aa9e6});});},'FaxQueues':function(_0x3d312b){return new Promise(function(_0x303ac9,_0x3a66f7){var _0x59986f=[];for(var _0x11a5c8 in _0x4d1fde[_0x370c('0x4d')]){if(_0x4d1fde[_0x370c('0x4d')][_0x370c('0x3f')](_0x11a5c8)){var _0x5a64ca=_0x4d1fde[_0x370c('0x4d')][_0x11a5c8];var _0x320d6d={'id':_0x5a64ca['id'],'available':_0x5a64ca[_0x370c('0x4b')],'loggedIn':_0x5a64ca[_0x370c('0x46')],'name':_0x5a64ca[_0x370c('0x47')],'paused':_0x5a64ca[_0x370c('0x48')],'waiting':_0x5a64ca['waiting']};_0x59986f[_0x370c('0x1c')](_0x320d6d);}}_0x303ac9({'count':_0x59986f[_0x370c('0x14')],'rows':_0x59986f});});},'WhatsappQueues':function(_0x2bd172){return new Promise(function(_0x36da0e,_0x273258){var _0x492d33=[];for(var _0x7a8113 in _0x4d1fde[_0x370c('0x4e')]){if(_0x4d1fde['whatsappQueues']['hasOwnProperty'](_0x7a8113)){var _0xaabf3f=_0x4d1fde[_0x370c('0x4e')][_0x7a8113];var _0x5a183c={'id':_0xaabf3f['id'],'available':_0xaabf3f['available'],'loggedIn':_0xaabf3f[_0x370c('0x46')],'name':_0xaabf3f[_0x370c('0x47')],'paused':_0xaabf3f[_0x370c('0x48')],'waiting':_0xaabf3f['waiting']};_0x492d33[_0x370c('0x1c')](_0x5a183c);}}_0x36da0e({'count':_0x492d33['length'],'rows':_0x492d33});});},'ChatQueuesWaitingInteractions':function(_0x319e88){return new Promise(function(_0x34a867,_0x126800){var _0x3f6f61=_[_0x370c('0x44')](_0x4d1fde['chatQueuesWaitingInteractions']);_0x34a867({'count':_0x3f6f61[_0x370c('0x14')],'rows':_0x3f6f61});});},'MailQueuesWaitingInteractions':function(_0x563f86){return new Promise(function(_0x5ef781,_0x1b6030){var _0x29b75e=_[_0x370c('0x44')](_0x4d1fde['mailQueuesWaitingInteractions']);_0x5ef781({'count':_0x29b75e[_0x370c('0x14')],'rows':_0x29b75e});});},'OpenchannelQueuesWaitingInteractions':function(_0x5694ee){return new Promise(function(_0x1ef255,_0x1e605f){var _0x26eede=_[_0x370c('0x44')](_0x4d1fde[_0x370c('0x4f')]);_0x1ef255({'count':_0x26eede[_0x370c('0x14')],'rows':_0x26eede});});},'SmsQueuesWaitingInteractions':function(_0x40a036){return new Promise(function(_0x307d97,_0x3af2bb){var _0x56b085=_[_0x370c('0x44')](_0x4d1fde['smsQueuesWaitingInteractions']);_0x307d97({'count':_0x56b085[_0x370c('0x14')],'rows':_0x56b085});});},'FaxQueuesWaitingInteractions':function(_0x165d03){return new Promise(function(_0x249a69,_0x3c42d0){var _0x99de9a=_[_0x370c('0x44')](_0x4d1fde[_0x370c('0x50')]);_0x249a69({'count':_0x99de9a[_0x370c('0x14')],'rows':_0x99de9a});});},'WhatsappQueuesWaitingInteractions':function(_0x48a624){return new Promise(function(_0x3587c7,_0x43f0e8){var _0x431483=_[_0x370c('0x44')](_0x4d1fde[_0x370c('0x51')]);_0x3587c7({'count':_0x431483['length'],'rows':_0x431483});});}};var _0x368158=jayson[_0x370c('0x52')](_0x341e16)[_0x370c('0x53')]();_0x368158['on'](_0x370c('0x2c'),function(_0x5b63ce){logger[_0x370c('0x2c')](JSON['stringify'](_0x5b63ce));return _0x334f2d(_0x5b63ce);});_0x368158['listen'](0x232c,_0x370c('0x54'),function(){console[_0x370c('0x55')](_0x370c('0x56'),0x232c);return _0x4c751b('RPC\x20listening\x20on\x20port:'+0x232c);});});};
\ No newline at end of file
index 443382d..cf26a98 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2768=['message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','length','Command','format','true','[%s][INTERVAL]\x20%s','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','log','stack','util','bluebird','routing','http','then','error'];(function(_0x511246,_0x301952){var _0xa1ae62=function(_0x238009){while(--_0x238009){_0x511246['push'](_0x511246['shift']());}};_0xa1ae62(++_0x301952);}(_0x2768,0xd2));var _0x8276=function(_0x456431,_0x32ab89){_0x456431=_0x456431-0x0;var _0x2bac7d=_0x2768[_0x456431];return _0x2bac7d;};'use strict';var util=require(_0x8276('0x0'));var BPromise=require(_0x8276('0x1'));var jayson=require('jayson/promise');var _=require('lodash');var logger=require('../../../config/logger')(_0x8276('0x2'));var client=jayson['client'][_0x8276('0x3')]({'port':0x232a});function request(_0x13d276,_0x52f859){return new BPromise(function(_0x34d1d3,_0x2cc616){return client['request'](_0x13d276,_0x52f859)[_0x8276('0x4')](function(_0xbb6716){if(_0xbb6716[_0x8276('0x5')]){return _0x2cc616(_0xbb6716[_0x8276('0x5')][_0x8276('0x6')]);}else{return _0x34d1d3(_0xbb6716[_0x8276('0x7')]);}})[_0x8276('0x8')](function(_0x42232f){return _0x2cc616(_0x42232f);});});}exports[_0x8276('0x9')]=function(_0x4fdb9c,_0x31ccb2,_0x48cf1a){return function(_0x25f503){if(_0x48cf1a[_0x8276('0xa')]&&!_0x48cf1a[_0x8276('0xa')][_0x4fdb9c]){logger[_0x8276('0xb')](_0x8276('0xc'),_0x4fdb9c);return _0x25f503['stop']();}var _0x2c36da=[];for(var _0x225b48=0x0;_0x225b48<_0x31ccb2[_0x8276('0xd')];_0x225b48+=0x1){_0x2c36da['push'](request(_0x8276('0xe'),{'command':util[_0x8276('0xf')]('iftime\x20%s',_0x31ccb2[_0x225b48])})[_0x8276('0x4')](function(_0x203af7){return _0x203af7&&_0x203af7[_0x8276('0x6')]&&_0x203af7[_0x8276('0x6')]['indexOf'](_0x8276('0x10'))>=0x0?!![]:![];})[_0x8276('0x8')](function(_0x204059){logger[_0x8276('0x5')](_0x8276('0x11'),_0x4fdb9c,_0x31ccb2[_0x225b48]);}));}BPromise['all'](_0x2c36da)[_0x8276('0x4')](function(_0x32d021){var _0x13da7c=_[_0x8276('0x12')](_0x32d021);logger[_0x8276('0xb')](_0x8276('0x13'),_0x4fdb9c,_0x31ccb2['join'](_0x8276('0x14')),_0x13da7c);_0x25f503[_0x8276('0x15')](_0x13da7c);})[_0x8276('0x8')](function(_0x1c52f0){console[_0x8276('0x16')](_0x1c52f0);logger[_0x8276('0x5')](_0x8276('0x13'),_0x4fdb9c,_0x31ccb2['join'](_0x8276('0x14')),_0x1c52f0[_0x8276('0x17')]);_0x25f503['stop']();});};};
\ No newline at end of file
+var _0x6910=['jayson/promise','lodash','../../../config/logger','client','request','then','error','message','catch','condition','rules','stop','length','Command','iftime\x20%s','indexOf','true','all','info','join','\x20|\x20','when','[%s][INTERVAL]\x20%s\x20%s','stack','util','bluebird'];(function(_0x5b0996,_0x598f12){var _0x1d99e7=function(_0x3651b5){while(--_0x3651b5){_0x5b0996['push'](_0x5b0996['shift']());}};_0x1d99e7(++_0x598f12);}(_0x6910,0xb4));var _0x0691=function(_0x1717a0,_0x3df0e9){_0x1717a0=_0x1717a0-0x0;var _0x4065f3=_0x6910[_0x1717a0];return _0x4065f3;};'use strict';var util=require(_0x0691('0x0'));var BPromise=require(_0x0691('0x1'));var jayson=require(_0x0691('0x2'));var _=require(_0x0691('0x3'));var logger=require(_0x0691('0x4'))('routing');var client=jayson[_0x0691('0x5')]['http']({'port':0x232a});function request(_0xaea83e,_0x42ff23){return new BPromise(function(_0x133d90,_0x3a129f){return client[_0x0691('0x6')](_0xaea83e,_0x42ff23)[_0x0691('0x7')](function(_0x39840c){if(_0x39840c['error']){return _0x3a129f(_0x39840c[_0x0691('0x8')][_0x0691('0x9')]);}else{return _0x133d90(_0x39840c['result']);}})[_0x0691('0xa')](function(_0x24e0d8){return _0x3a129f(_0x24e0d8);});});}exports[_0x0691('0xb')]=function(_0x440172,_0x230ec8,_0x37d7da){return function(_0x42934c){if(_0x37d7da['rules']&&!_0x37d7da[_0x0691('0xc')][_0x440172]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x440172);return _0x42934c[_0x0691('0xd')]();}var _0x2712ee=[];for(var _0x3a9e16=0x0;_0x3a9e16<_0x230ec8[_0x0691('0xe')];_0x3a9e16+=0x1){_0x2712ee['push'](request(_0x0691('0xf'),{'command':util['format'](_0x0691('0x10'),_0x230ec8[_0x3a9e16])})[_0x0691('0x7')](function(_0x34c91d){return _0x34c91d&&_0x34c91d[_0x0691('0x9')]&&_0x34c91d['message'][_0x0691('0x11')](_0x0691('0x12'))>=0x0?!![]:![];})['catch'](function(_0x59f885){logger[_0x0691('0x8')]('[%s][INTERVAL]\x20%s',_0x440172,_0x230ec8[_0x3a9e16]);}));}BPromise[_0x0691('0x13')](_0x2712ee)[_0x0691('0x7')](function(_0x166e24){var _0x51f378=_['some'](_0x166e24);logger[_0x0691('0x14')]('[%s][INTERVAL]\x20%s\x20%s',_0x440172,_0x230ec8[_0x0691('0x15')](_0x0691('0x16')),_0x51f378);_0x42934c[_0x0691('0x17')](_0x51f378);})[_0x0691('0xa')](function(_0x2f166c){console['log'](_0x2f166c);logger[_0x0691('0x8')](_0x0691('0x18'),_0x440172,_0x230ec8[_0x0691('0x15')]('\x20|\x20'),_0x2f166c[_0x0691('0x19')]);_0x42934c[_0x0691('0xd')]();});};};
\ No newline at end of file
index 4784aad..87304b3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0565=['agentacw','agentcomplete','acwtime','acwTimeout','request','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt','now','lastevent','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','agentringnoanswerAt','timeout','holdtime','ringtime','talktime','push','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','forIn','answered_elsewhere','reason','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','blindtransfer','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','transferexten','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','ATTENDED','transfereeuniqueid','agententerreason','calleridname','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transfertargetuniqueid','hangup','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','diffTime','agent','[%s][agents][hangup]','lodash','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','interface','calleridnum','connectedlinenum','getVoiceQueueByName','queue','then','type'];(function(_0x21e23d,_0x749755){var _0x423baa=function(_0x175290){while(--_0x175290){_0x21e23d['push'](_0x21e23d['shift']());}};_0x423baa(++_0x749755);}(_0x0565,0xf2));var _0x5056=function(_0x1ccdf7,_0x215d5a){_0x1ccdf7=_0x1ccdf7-0x0;var _0x52a0ae=_0x0565[_0x1ccdf7];return _0x52a0ae;};'use strict';var _=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var utils=require(_0x5056('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x2e0694,_0x354d5d){utils[_0x5056('0x3')](util[_0x5056('0x4')](_0x5056('0x5'),_0x2e0694[_0x5056('0x6')],_0x2e0694[_0x5056('0x7')],_0x2e0694['queue'],_0x2e0694[_0x5056('0x8')],_0x2e0694[_0x5056('0x9')],_0x2e0694[_0x5056('0xa')],_0x2e0694[_0x5056('0xb')],_0x2e0694['lastevent']));if(_0x2e0694['queue']){utils[_0x5056('0xc')](_0x2e0694[_0x5056('0xd')])[_0x5056('0xe')](function(_0x2e6f18){if(_0x2e6f18){_0x2e0694[_0x5056('0xf')]=_0x2e6f18[_0x5056('0xf')];_0x2e0694[_0x5056('0x10')]=_0x2e0694[_0x5056('0x11')]?_0x2e6f18['acw']:![];_0x2e0694[_0x5056('0x12')]=_0x2e0694[_0x5056('0x10')]?_0x2e6f18[_0x5056('0x13')]:0x0;}utils['request']('CreateVoiceAgentReport',_0x2e0694);});}else{utils[_0x5056('0x14')]('CreateVoiceAgentReport',_0x2e0694);}if(_0x354d5d){delete transfers[_0x2e0694['uniqueid']];}else{delete agents[_0x2e0694['destuniqueid']];}}exports[_0x5056('0x15')]=function(_0x4b183a){try{utils[_0x5056('0x16')](util[_0x5056('0x4')](_0x5056('0x17'),_0x4b183a['uniqueid']),_0x4b183a);agents[_0x4b183a[_0x5056('0x18')]]=_0x4b183a;agents[_0x4b183a[_0x5056('0x18')]][_0x5056('0x19')]=utils[_0x5056('0x1a')]();agents[_0x4b183a[_0x5056('0x18')]][_0x5056('0x1b')]='called';agents[_0x4b183a[_0x5056('0x18')]]['connectedlinenum']=null;agents[_0x4b183a[_0x5056('0x18')]][_0x5056('0x1c')]=null;utils[_0x5056('0x3')](util[_0x5056('0x4')](_0x5056('0x1d'),_0x4b183a['uniqueid'],agents[_0x4b183a[_0x5056('0x18')]][_0x5056('0x8')],_0x4b183a['destuniqueid']));}catch(_0x5c1cec){utils[_0x5056('0x1e')](util[_0x5056('0x4')](_0x5056('0x17'),_0x4b183a[_0x5056('0x6')]),_0x5c1cec);}};exports[_0x5056('0x1f')]=function(_0xf04e08){try{if(!_[_0x5056('0x20')](agents[_0xf04e08['destuniqueid']])){utils[_0x5056('0x16')](util[_0x5056('0x4')]('[%s][agents][agentringnoanswer]',_0xf04e08[_0x5056('0x6')]),_0xf04e08);utils[_0x5056('0x3')](util[_0x5056('0x4')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0xf04e08[_0x5056('0x6')],agents[_0xf04e08[_0x5056('0x18')]]['membername'],_0xf04e08['destuniqueid']));agents[_0xf04e08[_0x5056('0x18')]][_0x5056('0x1f')]=!![];agents[_0xf04e08[_0x5056('0x18')]][_0x5056('0x21')]=utils['now']();agents[_0xf04e08[_0x5056('0x18')]][_0x5056('0x1b')]='timeout';agents[_0xf04e08[_0x5056('0x18')]]['reason']=_0x5056('0x22');agents[_0xf04e08[_0x5056('0x18')]][_0x5056('0x23')]=_0xf04e08[_0x5056('0x24')]?parseInt(_0xf04e08[_0x5056('0x24')])/0x3e8:0x0;agents[_0xf04e08['destuniqueid']][_0x5056('0x25')]=0x0;unanswered[_0x5056('0x26')](_0xf04e08[_0x5056('0x18')]);}}catch(_0x2ac79a){utils['error'](util[_0x5056('0x4')]('[%s][agents][agentringnoanswer]',_0xf04e08[_0x5056('0x6')]),_0x2ac79a);}};exports['queuecallerabandon']=function(_0x56ccba){try{_['forIn'](agents,function(_0x113be0,_0x252f75){if(_0x113be0['uniqueid']==_0x56ccba[_0x5056('0x6')]&&!_[_0x5056('0x27')](unanswered,_0x113be0[_0x5056('0x18')])){utils[_0x5056('0x16')](util[_0x5056('0x4')](_0x5056('0x28'),_0x56ccba[_0x5056('0x6')]),_0x56ccba);utils[_0x5056('0x3')](util[_0x5056('0x4')](_0x5056('0x29'),_0x56ccba[_0x5056('0x6')],_0x113be0['membername'],_0x113be0['destuniqueid']));_0x113be0[_0x5056('0x1f')]=!![];_0x113be0[_0x5056('0x21')]=utils['now']();_0x113be0[_0x5056('0x1b')]=_0x5056('0x2a');_0x113be0['reason']=_0x5056('0x2a');_0x113be0[_0x5056('0x23')]=_0x56ccba[_0x5056('0x23')];_0x113be0[_0x5056('0x25')]=0x0;writeDB(_0x113be0);}});}catch(_0x33edfb){utils[_0x5056('0x1e')](util[_0x5056('0x4')](_0x5056('0x28'),_0x56ccba[_0x5056('0x6')]),_0x33edfb);}};exports[_0x5056('0x2b')]=function(_0x199129){try{if(agents[_0x199129[_0x5056('0x18')]]){utils[_0x5056('0x16')](util[_0x5056('0x4')](_0x5056('0x2c'),_0x199129['uniqueid']),_0x199129);utils[_0x5056('0x3')](util['format'](_0x5056('0x2d'),_0x199129[_0x5056('0x6')],agents[_0x199129[_0x5056('0x18')]][_0x5056('0x8')],_0x199129['destuniqueid']));agents[_0x199129[_0x5056('0x18')]][_0x5056('0x2e')]=utils['now']();agents[_0x199129[_0x5056('0x18')]]['connectedlinenum']=_0x199129[_0x5056('0xb')];agents[_0x199129[_0x5056('0x18')]][_0x5056('0x1c')]=_0x199129['connectedlinename'];agents[_0x199129[_0x5056('0x18')]][_0x5056('0x23')]=_0x199129[_0x5056('0x24')];agents[_0x199129[_0x5056('0x18')]][_0x5056('0x1b')]=_0x5056('0x2f');_[_0x5056('0x30')](agents,function(_0x21aa75,_0x15553e){if(_0x21aa75[_0x5056('0x18')]!=_0x199129[_0x5056('0x18')]&&_0x21aa75[_0x5056('0x6')]==_0x199129[_0x5056('0x6')]){_0x21aa75[_0x5056('0x25')]=0x0;_0x21aa75[_0x5056('0x23')]=_0x199129[_0x5056('0x24')];_0x21aa75['agentringnoanswer']=!![];_0x21aa75['agentringnoanswerAt']=utils[_0x5056('0x1a')]();_0x21aa75[_0x5056('0x1b')]=_0x5056('0x31');_0x21aa75[_0x5056('0x32')]=_0x5056('0x31');_0x21aa75[_0x5056('0x33')]=_0x199129[_0x5056('0x18')];_0x21aa75[_0x5056('0x34')]=_0x199129['membername'];writeDB(_0x21aa75);}});}}catch(_0x58f12f){utils[_0x5056('0x1e')](util[_0x5056('0x4')](_0x5056('0x2c'),_0x199129['uniqueid']),_0x58f12f);}};exports[_0x5056('0x11')]=function(_0x5b99e9){try{if(!_[_0x5056('0x20')](agents[_0x5b99e9[_0x5056('0x18')]])){utils[_0x5056('0x16')](util[_0x5056('0x4')](_0x5056('0x35'),_0x5b99e9[_0x5056('0x6')]),_0x5b99e9);utils['info'](util[_0x5056('0x4')](_0x5056('0x36'),_0x5b99e9[_0x5056('0x6')],agents[_0x5b99e9['destuniqueid']]['membername'],_0x5b99e9['destuniqueid']));agents[_0x5b99e9['destuniqueid']][_0x5056('0x11')]=!![];agents[_0x5b99e9[_0x5056('0x18')]][_0x5056('0x37')]=utils[_0x5056('0x1a')]();agents[_0x5b99e9[_0x5056('0x18')]]['talktime']=utils['diffTime'](agents[_0x5b99e9[_0x5056('0x18')]][_0x5056('0x37')],agents[_0x5b99e9[_0x5056('0x18')]][_0x5056('0x2e')]);agents[_0x5b99e9[_0x5056('0x18')]][_0x5056('0x32')]=_0x5b99e9[_0x5056('0x32')];agents[_0x5b99e9['destuniqueid']]['lastevent']=_0x5056('0x38');writeDB(agents[_0x5b99e9[_0x5056('0x18')]]);}}catch(_0x5a2f73){utils[_0x5056('0x1e')](util[_0x5056('0x4')]('[%s][agents][agentcomplete]',_0x5b99e9['uniqueid']),_0x5a2f73);}};exports[_0x5056('0x39')]=function(_0x1ab1a9){try{if(!_['isNil'](agents[_0x1ab1a9['transfereruniqueid']])){utils[_0x5056('0x16')](util[_0x5056('0x4')]('[%s][agents][blindtransfer]',_0x1ab1a9['uniqueid']),_0x1ab1a9);utils[_0x5056('0x3')](util[_0x5056('0x4')](_0x5056('0x3a'),_0x1ab1a9[_0x5056('0x6')],agents[_0x1ab1a9[_0x5056('0x3b')]][_0x5056('0x8')],agents[_0x1ab1a9[_0x5056('0x3b')]][_0x5056('0x6')]));agents[_0x1ab1a9[_0x5056('0x3b')]][_0x5056('0x3c')]=!![];agents[_0x1ab1a9[_0x5056('0x3b')]][_0x5056('0x3d')]=_0x5056('0x3e');agents[_0x1ab1a9[_0x5056('0x3b')]][_0x5056('0x3f')]=_0x1ab1a9['extension'];agents[_0x1ab1a9['transfereruniqueid']][_0x5056('0x40')]=agents[_0x1ab1a9[_0x5056('0x3b')]][_0x5056('0x6')];}}catch(_0x1c84b1){utils[_0x5056('0x1e')](util[_0x5056('0x4')]('[%s][agents][blindtransfer]',_0x1ab1a9[_0x5056('0x6')]),_0x1c84b1);}};exports[_0x5056('0x41')]=function(_0x41dba4){try{utils[_0x5056('0x16')](util[_0x5056('0x4')](_0x5056('0x42'),_0x41dba4[_0x5056('0x43')]),_0x41dba4);if(_0x41dba4[_0x5056('0x43')]==_0x41dba4[_0x5056('0x44')]){if(!_[_0x5056('0x20')](agents[_0x41dba4[_0x5056('0x45')]])){utils[_0x5056('0x3')](util[_0x5056('0x4')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x41dba4[_0x5056('0x43')],agents[_0x41dba4[_0x5056('0x45')]][_0x5056('0x8')]));agents[_0x41dba4['secondtransfereruniqueid']][_0x5056('0x3c')]=!![];agents[_0x41dba4[_0x5056('0x45')]][_0x5056('0x3d')]=_0x5056('0x46');agents[_0x41dba4['secondtransfereruniqueid']]['transferexten']=_0x41dba4['origtransfererexten'];agents[_0x41dba4[_0x5056('0x45')]]['transferuniqueid']=_0x41dba4[_0x5056('0x43')];}if(_0x41dba4[_0x5056('0x47')]&&agents[_0x41dba4[_0x5056('0x47')]]){agents[_0x41dba4[_0x5056('0x47')]][_0x5056('0x48')]=0x1;transfers[_0x41dba4[_0x5056('0x47')]]=_['clone'](agents[_0x41dba4['transfereeuniqueid']]);transfers[_0x41dba4[_0x5056('0x47')]][_0x5056('0xa')]=agents[_0x41dba4['secondtransfereruniqueid']][_0x5056('0xa')];transfers[_0x41dba4[_0x5056('0x47')]][_0x5056('0x49')]=agents[_0x41dba4[_0x5056('0x45')]][_0x5056('0x49')];transfers[_0x41dba4['transfereeuniqueid']][_0x5056('0x19')]=utils[_0x5056('0x1a')]();transfers[_0x41dba4['transfereeuniqueid']][_0x5056('0x2e')]=utils[_0x5056('0x1a')]();transfers[_0x41dba4[_0x5056('0x47')]][_0x5056('0x23')]=0x0;transfers[_0x41dba4[_0x5056('0x47')]][_0x5056('0x48')]=0x2;}}else if(_0x41dba4[_0x5056('0x45')]==_0x41dba4[_0x5056('0x4a')]){if(!_[_0x5056('0x20')](agents[_0x41dba4[_0x5056('0x43')]])){utils[_0x5056('0x3')](util[_0x5056('0x4')](_0x5056('0x4b'),_0x41dba4['origtransfereruniqueid'],agents[_0x41dba4[_0x5056('0x43')]][_0x5056('0x8')]));agents[_0x41dba4[_0x5056('0x43')]][_0x5056('0x3c')]=!![];agents[_0x41dba4[_0x5056('0x43')]][_0x5056('0x3d')]='ATTENDED';agents[_0x41dba4[_0x5056('0x43')]]['transferexten']=_0x41dba4[_0x5056('0x4c')];agents[_0x41dba4[_0x5056('0x43')]]['transferuniqueid']=_0x41dba4['secondtransfereruniqueid'];}if(_0x41dba4[_0x5056('0x4d')]&&agents[_0x41dba4[_0x5056('0x4d')]]){agents[_0x41dba4[_0x5056('0x4d')]][_0x5056('0x48')]=0x1;transfers[_0x41dba4['transfertargetuniqueid']]=_['clone'](agents[_0x41dba4[_0x5056('0x4d')]]);transfers[_0x41dba4[_0x5056('0x4d')]][_0x5056('0xa')]=agents[_0x41dba4['origtransfereruniqueid']][_0x5056('0xa')];transfers[_0x41dba4['transfertargetuniqueid']][_0x5056('0x49')]=agents[_0x41dba4[_0x5056('0x43')]][_0x5056('0x49')];transfers[_0x41dba4['transfertargetuniqueid']][_0x5056('0x19')]=utils[_0x5056('0x1a')]();transfers[_0x41dba4[_0x5056('0x4d')]][_0x5056('0x2e')]=utils[_0x5056('0x1a')]();transfers[_0x41dba4[_0x5056('0x4d')]][_0x5056('0x23')]=0x0;transfers[_0x41dba4['transfertargetuniqueid']][_0x5056('0x48')]=0x2;}}}catch(_0x17131c){utils[_0x5056('0x1e')](util['format'](_0x5056('0x42'),_0x41dba4['origtransfereruniqueid']),_0x17131c);}};exports[_0x5056('0x4e')]=function(_0x5468d6){try{utils[_0x5056('0x16')](util[_0x5056('0x4')]('[%s][agents][hangup]',_0x5468d6[_0x5056('0x6')]),_0x5468d6);if(agents[_0x5468d6[_0x5056('0x6')]]&&agents[_0x5468d6['uniqueid']][_0x5056('0x32')]==='timeout'){if(_0x5468d6['cause']==='21'){agents[_0x5468d6[_0x5056('0x6')]][_0x5056('0x32')]=_0x5056('0x4f');agents[_0x5468d6[_0x5056('0x6')]][_0x5056('0x1b')]=_0x5056('0x4f');}utils[_0x5056('0x3')](util[_0x5056('0x4')](_0x5056('0x50'),_0x5468d6[_0x5056('0x6')],agents[_0x5468d6[_0x5056('0x6')]][_0x5056('0x8')],agents[_0x5468d6['uniqueid']][_0x5056('0x32')],agents[_0x5468d6['uniqueid']][_0x5056('0x1b')]));writeDB(agents[_0x5468d6[_0x5056('0x6')]]);var _0x53816f=unanswered[_0x5056('0x51')](_0x5468d6[_0x5056('0x6')]);if(_0x53816f>-0x1){unanswered[_0x5056('0x52')](_0x53816f,0x1);}}if(transfers[_0x5468d6[_0x5056('0x6')]]){transfers[_0x5468d6[_0x5056('0x6')]][_0x5056('0x11')]=!![];transfers[_0x5468d6[_0x5056('0x6')]][_0x5056('0x37')]=utils['now']();transfers[_0x5468d6[_0x5056('0x6')]][_0x5056('0x25')]=utils[_0x5056('0x53')](transfers[_0x5468d6[_0x5056('0x6')]][_0x5056('0x37')],transfers[_0x5468d6['uniqueid']][_0x5056('0x2e')]);transfers[_0x5468d6['uniqueid']][_0x5056('0x32')]=_0x5056('0x54');transfers[_0x5468d6[_0x5056('0x6')]][_0x5056('0x1b')]=_0x5056('0x38');utils[_0x5056('0x3')](util[_0x5056('0x4')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x5468d6[_0x5056('0x6')],transfers[_0x5468d6[_0x5056('0x6')]][_0x5056('0x8')],transfers[_0x5468d6[_0x5056('0x6')]][_0x5056('0x32')],transfers[_0x5468d6[_0x5056('0x6')]][_0x5056('0x1b')]));writeDB(transfers[_0x5468d6['uniqueid']],!![]);}if(agents[_0x5468d6['uniqueid']]&&agents[_0x5468d6['uniqueid']][_0x5056('0x2e')]){agents[_0x5468d6['uniqueid']][_0x5056('0x11')]=!![];agents[_0x5468d6[_0x5056('0x6')]][_0x5056('0x37')]=utils['now']();agents[_0x5468d6[_0x5056('0x6')]]['talktime']=utils[_0x5056('0x53')](agents[_0x5468d6[_0x5056('0x6')]][_0x5056('0x37')],agents[_0x5468d6['uniqueid']][_0x5056('0x2e')]);agents[_0x5468d6['uniqueid']]['reason']=agents[_0x5468d6[_0x5056('0x6')]][_0x5056('0x3c')]?'transfer':_0x5056('0x54');agents[_0x5468d6['uniqueid']][_0x5056('0x1b')]=_0x5056('0x38');utils[_0x5056('0x3')](util[_0x5056('0x4')](_0x5056('0x50'),_0x5468d6[_0x5056('0x6')],agents[_0x5468d6['uniqueid']][_0x5056('0x8')],agents[_0x5468d6[_0x5056('0x6')]][_0x5056('0x32')],agents[_0x5468d6[_0x5056('0x6')]][_0x5056('0x1b')]));writeDB(agents[_0x5468d6[_0x5056('0x6')]]);}}catch(_0x5d5c93){utils[_0x5056('0x1e')](util['format'](_0x5056('0x55'),_0x5468d6[_0x5056('0x6')]),_0x5d5c93);}};
\ No newline at end of file
+var _0x9354=['agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','timeout','reason','holdtime','ringtime','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','talktime','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfertype','blind','transferexten','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','agententerreason','hangup','[%s][agents][hangup]','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','splice','agent','transfer','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error'];(function(_0x239a9e,_0x5cf3f4){var _0x2a7085=function(_0x232216){while(--_0x232216){_0x239a9e['push'](_0x239a9e['shift']());}};_0x2a7085(++_0x5cf3f4);}(_0x9354,0x96));var _0x4935=function(_0x347471,_0x1c9a02){_0x347471=_0x347471-0x0;var _0x422b6a=_0x9354[_0x347471];return _0x422b6a;};'use strict';var _=require('lodash');var util=require(_0x4935('0x0'));var utils=require(_0x4935('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x4896da,_0x263dd5){utils[_0x4935('0x2')](util[_0x4935('0x3')](_0x4935('0x4'),_0x4896da['uniqueid'],_0x4896da[_0x4935('0x5')],_0x4896da[_0x4935('0x6')],_0x4896da[_0x4935('0x7')],_0x4896da[_0x4935('0x8')],_0x4896da[_0x4935('0x9')],_0x4896da[_0x4935('0xa')],_0x4896da[_0x4935('0xb')]));if(_0x4896da[_0x4935('0x6')]){utils[_0x4935('0xc')](_0x4896da['queue'])[_0x4935('0xd')](function(_0x47a44f){if(_0x47a44f){_0x4896da[_0x4935('0xe')]=_0x47a44f[_0x4935('0xe')];_0x4896da[_0x4935('0xf')]=_0x4896da[_0x4935('0x10')]?_0x47a44f[_0x4935('0x11')]:![];_0x4896da[_0x4935('0x12')]=_0x4896da['agentacw']?_0x47a44f['acwTimeout']:0x0;}utils[_0x4935('0x13')]('CreateVoiceAgentReport',_0x4896da);});}else{utils['request'](_0x4935('0x14'),_0x4896da);}if(_0x263dd5){delete transfers[_0x4896da[_0x4935('0x15')]];}else{delete agents[_0x4896da[_0x4935('0x16')]];}}exports[_0x4935('0x17')]=function(_0x3b246a){try{utils[_0x4935('0x18')](util[_0x4935('0x3')](_0x4935('0x19'),_0x3b246a[_0x4935('0x15')]),_0x3b246a);agents[_0x3b246a[_0x4935('0x16')]]=_0x3b246a;agents[_0x3b246a[_0x4935('0x16')]][_0x4935('0x1a')]=utils[_0x4935('0x1b')]();agents[_0x3b246a[_0x4935('0x16')]][_0x4935('0xb')]=_0x4935('0x1c');agents[_0x3b246a['destuniqueid']][_0x4935('0xa')]=null;agents[_0x3b246a[_0x4935('0x16')]][_0x4935('0x1d')]=null;utils[_0x4935('0x2')](util[_0x4935('0x3')](_0x4935('0x1e'),_0x3b246a['uniqueid'],agents[_0x3b246a[_0x4935('0x16')]][_0x4935('0x7')],_0x3b246a['destuniqueid']));}catch(_0x288eff){utils[_0x4935('0x1f')](util[_0x4935('0x3')]('[%s][agents][agentcalled]',_0x3b246a['uniqueid']),_0x288eff);}};exports[_0x4935('0x20')]=function(_0x6b849f){try{if(!_[_0x4935('0x21')](agents[_0x6b849f[_0x4935('0x16')]])){utils[_0x4935('0x18')](util[_0x4935('0x3')](_0x4935('0x22'),_0x6b849f[_0x4935('0x15')]),_0x6b849f);utils['info'](util[_0x4935('0x3')](_0x4935('0x23'),_0x6b849f[_0x4935('0x15')],agents[_0x6b849f[_0x4935('0x16')]][_0x4935('0x7')],_0x6b849f['destuniqueid']));agents[_0x6b849f['destuniqueid']][_0x4935('0x20')]=!![];agents[_0x6b849f[_0x4935('0x16')]][_0x4935('0x24')]=utils[_0x4935('0x1b')]();agents[_0x6b849f[_0x4935('0x16')]][_0x4935('0xb')]=_0x4935('0x25');agents[_0x6b849f[_0x4935('0x16')]][_0x4935('0x26')]=_0x4935('0x25');agents[_0x6b849f[_0x4935('0x16')]][_0x4935('0x27')]=_0x6b849f[_0x4935('0x28')]?parseInt(_0x6b849f[_0x4935('0x28')])/0x3e8:0x0;agents[_0x6b849f[_0x4935('0x16')]]['talktime']=0x0;unanswered['push'](_0x6b849f['destuniqueid']);}}catch(_0x1fc218){utils[_0x4935('0x1f')](util['format'](_0x4935('0x22'),_0x6b849f[_0x4935('0x15')]),_0x1fc218);}};exports[_0x4935('0x29')]=function(_0x9fe9f6){try{_[_0x4935('0x2a')](agents,function(_0x24262e,_0x28afc2){if(_0x24262e[_0x4935('0x15')]==_0x9fe9f6['uniqueid']&&!_[_0x4935('0x2b')](unanswered,_0x24262e[_0x4935('0x16')])){utils['debug'](util['format'](_0x4935('0x2c'),_0x9fe9f6['uniqueid']),_0x9fe9f6);utils[_0x4935('0x2')](util[_0x4935('0x3')](_0x4935('0x2d'),_0x9fe9f6['uniqueid'],_0x24262e['membername'],_0x24262e[_0x4935('0x16')]));_0x24262e[_0x4935('0x20')]=!![];_0x24262e['agentringnoanswerAt']=utils[_0x4935('0x1b')]();_0x24262e[_0x4935('0xb')]=_0x4935('0x2e');_0x24262e[_0x4935('0x26')]=_0x4935('0x2e');_0x24262e['holdtime']=_0x9fe9f6['holdtime'];_0x24262e[_0x4935('0x2f')]=0x0;writeDB(_0x24262e);}});}catch(_0x1016cc){utils['error'](util['format'](_0x4935('0x2c'),_0x9fe9f6['uniqueid']),_0x1016cc);}};exports[_0x4935('0x30')]=function(_0x3f32fb){try{if(agents[_0x3f32fb[_0x4935('0x16')]]){utils[_0x4935('0x18')](util[_0x4935('0x3')](_0x4935('0x31'),_0x3f32fb['uniqueid']),_0x3f32fb);utils[_0x4935('0x2')](util['format'](_0x4935('0x32'),_0x3f32fb['uniqueid'],agents[_0x3f32fb[_0x4935('0x16')]]['membername'],_0x3f32fb[_0x4935('0x16')]));agents[_0x3f32fb[_0x4935('0x16')]][_0x4935('0x33')]=utils[_0x4935('0x1b')]();agents[_0x3f32fb[_0x4935('0x16')]][_0x4935('0xa')]=_0x3f32fb[_0x4935('0xa')];agents[_0x3f32fb['destuniqueid']]['connectedlinename']=_0x3f32fb[_0x4935('0x1d')];agents[_0x3f32fb['destuniqueid']]['holdtime']=_0x3f32fb[_0x4935('0x28')];agents[_0x3f32fb['destuniqueid']][_0x4935('0xb')]=_0x4935('0x34');_[_0x4935('0x2a')](agents,function(_0x99b7c5,_0xb366e6){if(_0x99b7c5['destuniqueid']!=_0x3f32fb['destuniqueid']&&_0x99b7c5[_0x4935('0x15')]==_0x3f32fb[_0x4935('0x15')]){_0x99b7c5[_0x4935('0x2f')]=0x0;_0x99b7c5[_0x4935('0x27')]=_0x3f32fb[_0x4935('0x28')];_0x99b7c5[_0x4935('0x20')]=!![];_0x99b7c5[_0x4935('0x24')]=utils[_0x4935('0x1b')]();_0x99b7c5['lastevent']='answered_elsewhere';_0x99b7c5[_0x4935('0x26')]=_0x4935('0x35');_0x99b7c5['answeredelsewheredestinationuniqueid']=_0x3f32fb[_0x4935('0x16')];_0x99b7c5[_0x4935('0x36')]=_0x3f32fb[_0x4935('0x7')];writeDB(_0x99b7c5);}});}}catch(_0xe5c9f5){utils['error'](util['format'](_0x4935('0x31'),_0x3f32fb[_0x4935('0x15')]),_0xe5c9f5);}};exports['agentcomplete']=function(_0x1eaa47){try{if(!_[_0x4935('0x21')](agents[_0x1eaa47[_0x4935('0x16')]])){utils['debug'](util[_0x4935('0x3')](_0x4935('0x37'),_0x1eaa47[_0x4935('0x15')]),_0x1eaa47);utils[_0x4935('0x2')](util[_0x4935('0x3')](_0x4935('0x38'),_0x1eaa47[_0x4935('0x15')],agents[_0x1eaa47[_0x4935('0x16')]][_0x4935('0x7')],_0x1eaa47[_0x4935('0x16')]));agents[_0x1eaa47[_0x4935('0x16')]][_0x4935('0x10')]=!![];agents[_0x1eaa47[_0x4935('0x16')]][_0x4935('0x39')]=utils[_0x4935('0x1b')]();agents[_0x1eaa47[_0x4935('0x16')]][_0x4935('0x2f')]=utils[_0x4935('0x3a')](agents[_0x1eaa47['destuniqueid']][_0x4935('0x39')],agents[_0x1eaa47['destuniqueid']][_0x4935('0x33')]);agents[_0x1eaa47[_0x4935('0x16')]][_0x4935('0x26')]=_0x1eaa47[_0x4935('0x26')];agents[_0x1eaa47['destuniqueid']][_0x4935('0xb')]=_0x4935('0x3b');writeDB(agents[_0x1eaa47[_0x4935('0x16')]]);}}catch(_0xa55ce1){utils[_0x4935('0x1f')](util[_0x4935('0x3')](_0x4935('0x37'),_0x1eaa47[_0x4935('0x15')]),_0xa55ce1);}};exports[_0x4935('0x3c')]=function(_0x392cba){try{if(!_['isNil'](agents[_0x392cba[_0x4935('0x3d')]])){utils[_0x4935('0x18')](util['format'](_0x4935('0x3e'),_0x392cba[_0x4935('0x15')]),_0x392cba);utils[_0x4935('0x2')](util[_0x4935('0x3')](_0x4935('0x3f'),_0x392cba[_0x4935('0x15')],agents[_0x392cba[_0x4935('0x3d')]][_0x4935('0x7')],agents[_0x392cba['transfereruniqueid']][_0x4935('0x15')]));agents[_0x392cba['transfereruniqueid']]['transfer']=!![];agents[_0x392cba[_0x4935('0x3d')]][_0x4935('0x40')]=_0x4935('0x41');agents[_0x392cba[_0x4935('0x3d')]][_0x4935('0x42')]=_0x392cba['extension'];agents[_0x392cba[_0x4935('0x3d')]][_0x4935('0x43')]=agents[_0x392cba[_0x4935('0x3d')]][_0x4935('0x15')];}}catch(_0x377ff4){utils[_0x4935('0x1f')](util[_0x4935('0x3')](_0x4935('0x3e'),_0x392cba[_0x4935('0x15')]),_0x377ff4);}};exports[_0x4935('0x44')]=function(_0x4c1fb4){try{utils[_0x4935('0x18')](util['format'](_0x4935('0x45'),_0x4c1fb4[_0x4935('0x46')]),_0x4c1fb4);if(_0x4c1fb4['origtransfereruniqueid']==_0x4c1fb4[_0x4935('0x47')]){if(!_['isNil'](agents[_0x4c1fb4['secondtransfereruniqueid']])){utils['info'](util[_0x4935('0x3')](_0x4935('0x48'),_0x4c1fb4[_0x4935('0x46')],agents[_0x4c1fb4[_0x4935('0x49')]][_0x4935('0x7')]));agents[_0x4c1fb4['secondtransfereruniqueid']]['transfer']=!![];agents[_0x4c1fb4[_0x4935('0x49')]][_0x4935('0x40')]=_0x4935('0x4a');agents[_0x4c1fb4['secondtransfereruniqueid']][_0x4935('0x42')]=_0x4c1fb4[_0x4935('0x4b')];agents[_0x4c1fb4[_0x4935('0x49')]][_0x4935('0x43')]=_0x4c1fb4['origtransfereruniqueid'];}if(_0x4c1fb4[_0x4935('0x4c')]&&agents[_0x4c1fb4['transfereeuniqueid']]){agents[_0x4c1fb4['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x4c1fb4[_0x4935('0x4c')]]=_[_0x4935('0x4d')](agents[_0x4c1fb4['transfereeuniqueid']]);transfers[_0x4c1fb4[_0x4935('0x4c')]][_0x4935('0x9')]=agents[_0x4c1fb4['secondtransfereruniqueid']][_0x4935('0x9')];transfers[_0x4c1fb4[_0x4935('0x4c')]][_0x4935('0x4e')]=agents[_0x4c1fb4[_0x4935('0x49')]][_0x4935('0x4e')];transfers[_0x4c1fb4[_0x4935('0x4c')]][_0x4935('0x1a')]=utils['now']();transfers[_0x4c1fb4[_0x4935('0x4c')]]['agentconnectAt']=utils['now']();transfers[_0x4c1fb4[_0x4935('0x4c')]][_0x4935('0x27')]=0x0;transfers[_0x4c1fb4['transfereeuniqueid']]['agententerreason']=0x2;}}else if(_0x4c1fb4[_0x4935('0x49')]==_0x4c1fb4[_0x4935('0x4f')]){if(!_[_0x4935('0x21')](agents[_0x4c1fb4['origtransfereruniqueid']])){utils[_0x4935('0x2')](util['format'](_0x4935('0x48'),_0x4c1fb4[_0x4935('0x46')],agents[_0x4c1fb4[_0x4935('0x46')]][_0x4935('0x7')]));agents[_0x4c1fb4[_0x4935('0x46')]]['transfer']=!![];agents[_0x4c1fb4[_0x4935('0x46')]][_0x4935('0x40')]='ATTENDED';agents[_0x4c1fb4[_0x4935('0x46')]][_0x4935('0x42')]=_0x4c1fb4[_0x4935('0x50')];agents[_0x4c1fb4[_0x4935('0x46')]][_0x4935('0x43')]=_0x4c1fb4[_0x4935('0x49')];}if(_0x4c1fb4[_0x4935('0x51')]&&agents[_0x4c1fb4[_0x4935('0x51')]]){agents[_0x4c1fb4[_0x4935('0x51')]][_0x4935('0x52')]=0x1;transfers[_0x4c1fb4[_0x4935('0x51')]]=_['clone'](agents[_0x4c1fb4[_0x4935('0x51')]]);transfers[_0x4c1fb4[_0x4935('0x51')]][_0x4935('0x9')]=agents[_0x4c1fb4[_0x4935('0x46')]][_0x4935('0x9')];transfers[_0x4c1fb4[_0x4935('0x51')]][_0x4935('0x4e')]=agents[_0x4c1fb4[_0x4935('0x46')]][_0x4935('0x4e')];transfers[_0x4c1fb4[_0x4935('0x51')]][_0x4935('0x1a')]=utils[_0x4935('0x1b')]();transfers[_0x4c1fb4[_0x4935('0x51')]]['agentconnectAt']=utils['now']();transfers[_0x4c1fb4[_0x4935('0x51')]][_0x4935('0x27')]=0x0;transfers[_0x4c1fb4['transfertargetuniqueid']][_0x4935('0x52')]=0x2;}}}catch(_0x30e77f){utils['error'](util['format'](_0x4935('0x45'),_0x4c1fb4[_0x4935('0x46')]),_0x30e77f);}};exports[_0x4935('0x53')]=function(_0x2abd63){try{utils[_0x4935('0x18')](util['format'](_0x4935('0x54'),_0x2abd63[_0x4935('0x15')]),_0x2abd63);if(agents[_0x2abd63[_0x4935('0x15')]]&&agents[_0x2abd63[_0x4935('0x15')]]['reason']===_0x4935('0x25')){if(_0x2abd63['cause']==='21'){agents[_0x2abd63['uniqueid']][_0x4935('0x26')]=_0x4935('0x55');agents[_0x2abd63['uniqueid']][_0x4935('0xb')]=_0x4935('0x55');}utils[_0x4935('0x2')](util['format'](_0x4935('0x56'),_0x2abd63['uniqueid'],agents[_0x2abd63['uniqueid']][_0x4935('0x7')],agents[_0x2abd63[_0x4935('0x15')]][_0x4935('0x26')],agents[_0x2abd63[_0x4935('0x15')]][_0x4935('0xb')]));writeDB(agents[_0x2abd63[_0x4935('0x15')]]);var _0x2eae00=unanswered[_0x4935('0x57')](_0x2abd63['uniqueid']);if(_0x2eae00>-0x1){unanswered[_0x4935('0x58')](_0x2eae00,0x1);}}if(transfers[_0x2abd63[_0x4935('0x15')]]){transfers[_0x2abd63[_0x4935('0x15')]]['agentcomplete']=!![];transfers[_0x2abd63['uniqueid']][_0x4935('0x39')]=utils[_0x4935('0x1b')]();transfers[_0x2abd63['uniqueid']][_0x4935('0x2f')]=utils['diffTime'](transfers[_0x2abd63['uniqueid']][_0x4935('0x39')],transfers[_0x2abd63[_0x4935('0x15')]][_0x4935('0x33')]);transfers[_0x2abd63['uniqueid']]['reason']=_0x4935('0x59');transfers[_0x2abd63['uniqueid']][_0x4935('0xb')]='complete';utils[_0x4935('0x2')](util[_0x4935('0x3')](_0x4935('0x56'),_0x2abd63[_0x4935('0x15')],transfers[_0x2abd63[_0x4935('0x15')]][_0x4935('0x7')],transfers[_0x2abd63[_0x4935('0x15')]]['reason'],transfers[_0x2abd63[_0x4935('0x15')]]['lastevent']));writeDB(transfers[_0x2abd63[_0x4935('0x15')]],!![]);}if(agents[_0x2abd63[_0x4935('0x15')]]&&agents[_0x2abd63['uniqueid']][_0x4935('0x33')]){agents[_0x2abd63['uniqueid']][_0x4935('0x10')]=!![];agents[_0x2abd63[_0x4935('0x15')]]['agentcompleteAt']=utils['now']();agents[_0x2abd63['uniqueid']][_0x4935('0x2f')]=utils['diffTime'](agents[_0x2abd63['uniqueid']][_0x4935('0x39')],agents[_0x2abd63['uniqueid']][_0x4935('0x33')]);agents[_0x2abd63['uniqueid']]['reason']=agents[_0x2abd63['uniqueid']][_0x4935('0x5a')]?'transfer':_0x4935('0x59');agents[_0x2abd63[_0x4935('0x15')]][_0x4935('0xb')]=_0x4935('0x3b');utils[_0x4935('0x2')](util['format'](_0x4935('0x56'),_0x2abd63[_0x4935('0x15')],agents[_0x2abd63['uniqueid']][_0x4935('0x7')],agents[_0x2abd63[_0x4935('0x15')]]['reason'],agents[_0x2abd63[_0x4935('0x15')]][_0x4935('0xb')]));writeDB(agents[_0x2abd63['uniqueid']]);}}catch(_0x390767){utils['error'](util[_0x4935('0x3')](_0x4935('0x54'),_0x2abd63['uniqueid']),_0x390767);}};
\ No newline at end of file
index af50f91..286c66f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6819=['endtime','diffTime','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','origtransfererchannel','musiconholdstart','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][musiconholdstop]','varset','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','variable','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','toLowerCase','set','appdata','cdr','lastIndexOf','hangup','noop','gotoif','lodash','util','./utils','./transfers.controller','NO\x20ANSWER','FAILED','ANSWERED','blinds','uniqueid','transfereeuniqueid','info','format','channel','queue','membername','interface','calleridnum','connectedlinenum','accountcode','then','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','error','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','channelstate','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','[%s][calls][newstate]','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt'];(function(_0x540009,_0x197961){var _0x349c76=function(_0x441e0f){while(--_0x441e0f){_0x540009['push'](_0x540009['shift']());}};_0x349c76(++_0x197961);}(_0x6819,0xfd));var _0x9681=function(_0x3656f1,_0x2fd7ca){_0x3656f1=_0x3656f1-0x0;var _0x3ae213=_0x6819[_0x3656f1];return _0x3ae213;};'use strict';var _=require(_0x9681('0x0'));var util=require(_0x9681('0x1'));var utils=require(_0x9681('0x2'));var transfers=require(_0x9681('0x3'));var dispositions=[_0x9681('0x4'),_0x9681('0x5'),_0x9681('0x5'),_0x9681('0x4'),_0x9681('0x4'),_0x9681('0x4'),_0x9681('0x6'),'BUSY','FAILED','FAILED','FAILED'];var channels={};function writeDB(_0x4bbbc1){var _0x3ee915;if(transfers[_0x9681('0x7')][_0x4bbbc1[_0x9681('0x8')]]){_0x3ee915=_0x4bbbc1[_0x9681('0x8')];_0x4bbbc1[_0x9681('0x8')]=transfers[_0x9681('0x7')][_0x4bbbc1['uniqueid']][_0x9681('0x9')];}utils[_0x9681('0xa')](util[_0x9681('0xb')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x4bbbc1[_0x9681('0x8')],_0x4bbbc1[_0x9681('0xc')],_0x4bbbc1[_0x9681('0xd')],_0x4bbbc1[_0x9681('0xe')],_0x4bbbc1[_0x9681('0xf')],_0x4bbbc1[_0x9681('0x10')],_0x4bbbc1[_0x9681('0x11')],_0x4bbbc1['lastevent']));if(_0x4bbbc1[_0x9681('0x12')]){utils['getUserByInternal'](_0x4bbbc1['accountcode'])[_0x9681('0x13')](function(_0xf1b2c8){if(_0xf1b2c8){_0x4bbbc1['UserId']=_0xf1b2c8['id'];}utils['request']('CreateVoiceCallReport',_0x4bbbc1);});}else{utils['request'](_0x9681('0x14'),_0x4bbbc1);}if(channels[_0x4bbbc1[_0x9681('0x8')]]){delete channels[_0x4bbbc1[_0x9681('0x8')]];}else if(_0x3ee915&&channels[_0x3ee915]){delete transfers[_0x9681('0x7')][_0x3ee915];delete channels[_0x3ee915];}}exports[_0x9681('0x15')]=function(_0x3e67a1){try{utils[_0x9681('0x16')](util[_0x9681('0xb')](_0x9681('0x17'),_0x3e67a1[_0x9681('0x8')]),_0x3e67a1);if(_0x3e67a1['uniqueid']==_0x3e67a1[_0x9681('0x18')]&&_0x3e67a1['channel']!=_0x9681('0x19')){utils['info'](util[_0x9681('0xb')](_0x9681('0x1a'),_0x3e67a1[_0x9681('0x8')],_0x3e67a1[_0x9681('0x1b')],_0x3e67a1[_0x9681('0x1c')]));channels[_0x3e67a1[_0x9681('0x8')]]={'uniqueid':_0x3e67a1['uniqueid'],'accountcode':_0x3e67a1[_0x9681('0x12')],'source':_0x3e67a1['calleridnum'],'destination':_0x3e67a1[_0x9681('0x1c')],'destinationcontext':_0x3e67a1[_0x9681('0x1b')],'channel':_0x3e67a1[_0x9681('0xc')],'starttime':utils[_0x9681('0x1d')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x9681('0x1e')};}}catch(_0x25f7f7){utils[_0x9681('0x1f')](util[_0x9681('0xb')]('[%s][calls][newchannel]',_0x3e67a1[_0x9681('0x8')]),_0x25f7f7);}};exports['newstate']=function(_0x532868){try{utils['debug'](util[_0x9681('0xb')]('[%s][calls][newstate]',_0x532868[_0x9681('0x8')]),_0x532868);if(!_[_0x9681('0x20')](channels[_0x532868['uniqueid']])&&_0x532868['channelstate']==0x6){utils[_0x9681('0xa')](util[_0x9681('0xb')](_0x9681('0x21'),_0x532868[_0x9681('0x8')],_0x532868[_0x9681('0x1b')],_0x532868[_0x9681('0xc')]));if(_[_0x9681('0x20')](channels[_0x532868[_0x9681('0x8')]][_0x9681('0x22')])){channels[_0x532868[_0x9681('0x8')]][_0x9681('0x22')]=utils[_0x9681('0x1d')]();}}else if(!_[_0x9681('0x20')](channels[_0x532868['linkedid']])&&_0x532868[_0x9681('0x23')]==0x6&&_0x532868['context']!='transfer'){utils['info'](util['format'](_0x9681('0x24'),_0x532868['uniqueid'],_0x532868[_0x9681('0x18')],_0x532868[_0x9681('0x1b')],_0x532868['channel']));channels[_0x532868[_0x9681('0x18')]][_0x9681('0x12')]=_0x532868[_0x9681('0x12')];channels[_0x532868[_0x9681('0x18')]][_0x9681('0x25')]=_0x532868[_0x9681('0xc')];if(_['isNil'](channels[_0x532868[_0x9681('0x18')]][_0x9681('0x26')])){channels[_0x532868[_0x9681('0x18')]][_0x9681('0x26')]=utils['now']();}channels[_0x532868['linkedid']][_0x9681('0x27')]=dispositions[_[_0x9681('0x28')](_0x532868[_0x9681('0x23')])]||_0x9681('0x6');}}catch(_0x53946e){utils[_0x9681('0x1f')](util['format'](_0x9681('0x29'),_0x532868[_0x9681('0x8')]),_0x53946e);}};exports['hangup']=function(_0x1d7fcf){try{if(!_[_0x9681('0x20')](channels[_0x1d7fcf[_0x9681('0x8')]])){utils[_0x9681('0x16')](util[_0x9681('0xb')](_0x9681('0x2a'),_0x1d7fcf[_0x9681('0x8')]),_0x1d7fcf);if(_[_0x9681('0x20')](channels[_0x1d7fcf[_0x9681('0x8')]][_0x9681('0x2b')])){channels[_0x1d7fcf[_0x9681('0x8')]][_0x9681('0x2b')]=_0x1d7fcf[_0x9681('0x2c')]+'\x20<'+_0x1d7fcf[_0x9681('0x10')]+'>';}utils[_0x9681('0xa')](util[_0x9681('0xb')](_0x9681('0x2d'),_0x1d7fcf[_0x9681('0x8')],channels[_0x1d7fcf['uniqueid']][_0x9681('0x2b')],_0x1d7fcf[_0x9681('0x2e')]));channels[_0x1d7fcf[_0x9681('0x8')]][_0x9681('0x2f')]=utils['now']();channels[_0x1d7fcf[_0x9681('0x8')]]['duration']=utils[_0x9681('0x30')](channels[_0x1d7fcf['uniqueid']][_0x9681('0x2f')],channels[_0x1d7fcf[_0x9681('0x8')]]['starttime']);channels[_0x1d7fcf[_0x9681('0x8')]]['billableseconds']=channels[_0x1d7fcf[_0x9681('0x8')]]['answertime']?utils[_0x9681('0x30')](channels[_0x1d7fcf[_0x9681('0x8')]][_0x9681('0x2f')],channels[_0x1d7fcf[_0x9681('0x8')]][_0x9681('0x26')]):0x0;writeDB(channels[_0x1d7fcf['uniqueid']]);}}catch(_0x5d454a){utils[_0x9681('0x1f')](util[_0x9681('0xb')]('[%s][calls][hangup]',_0x1d7fcf[_0x9681('0x8')]),_0x5d454a);}};exports[_0x9681('0x31')]=function(_0x5b0dfe){try{if(!_['isNil'](channels[_0x5b0dfe['localtwolinkedid']])){utils[_0x9681('0x16')](util[_0x9681('0xb')](_0x9681('0x32'),_0x5b0dfe[_0x9681('0x33')]),_0x5b0dfe);if(channels[_0x5b0dfe[_0x9681('0x34')]][_0x9681('0xc')]==_0x5b0dfe['transfereechannel']){utils[_0x9681('0xa')](util[_0x9681('0xb')](_0x9681('0x35'),_0x5b0dfe[_0x9681('0x33')],_0x5b0dfe[_0x9681('0x34')],_0x5b0dfe['secondtransfererchannel']));channels[_0x5b0dfe[_0x9681('0x34')]][_0x9681('0x25')]=_0x5b0dfe[_0x9681('0x36')];channels[_0x5b0dfe[_0x9681('0x34')]][_0x9681('0x37')]=_0x9681('0x38');}else if(channels[_0x5b0dfe[_0x9681('0x34')]][_0x9681('0xc')]=_0x5b0dfe['transfertargetchannel']){utils[_0x9681('0xa')](util[_0x9681('0xb')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0x5b0dfe[_0x9681('0x33')],_0x5b0dfe[_0x9681('0x34')],_0x5b0dfe[_0x9681('0x39')]));channels[_0x5b0dfe[_0x9681('0x34')]][_0x9681('0x25')]=_0x5b0dfe['origtransfererchannel'];channels[_0x5b0dfe['localtwolinkedid']][_0x9681('0x37')]=_0x9681('0x38');}}}catch(_0x25dbf6){utils['error'](util['format'](_0x9681('0x32'),_0x5b0dfe[_0x9681('0x33')]),_0x25dbf6);}};exports[_0x9681('0x3a')]=function(_0x42ee80){try{if(!_[_0x9681('0x20')](channels[_0x42ee80[_0x9681('0x8')]])){utils[_0x9681('0x16')](util[_0x9681('0xb')]('[%s][calls][musiconholdstart]',_0x42ee80[_0x9681('0x8')]),_0x42ee80);channels[_0x42ee80[_0x9681('0x8')]][_0x9681('0x3b')]=utils['now']();utils['info'](util['format'](_0x9681('0x3c'),_0x42ee80[_0x9681('0x8')],channels[_0x42ee80[_0x9681('0x8')]][_0x9681('0x3b')]));}}catch(_0x5f1203){utils['error'](util[_0x9681('0xb')](_0x9681('0x3d'),_0x42ee80[_0x9681('0x8')]),_0x5f1203);}};exports[_0x9681('0x3e')]=function(_0xefdfd7){try{if(!_['isNil'](channels[_0xefdfd7[_0x9681('0x8')]])){utils[_0x9681('0x16')](util[_0x9681('0xb')]('[%s][calls][musiconholdstop]',_0xefdfd7[_0x9681('0x8')]),_0xefdfd7);if(!_[_0x9681('0x20')](channels[_0xefdfd7[_0x9681('0x8')]][_0x9681('0x3b')])){channels[_0xefdfd7[_0x9681('0x8')]]['mohtime']+=utils[_0x9681('0x30')](utils[_0x9681('0x1d')](),channels[_0xefdfd7[_0x9681('0x8')]][_0x9681('0x3b')]);utils[_0x9681('0xa')](util[_0x9681('0xb')](_0x9681('0x3f'),_0xefdfd7[_0x9681('0x8')],channels[_0xefdfd7['uniqueid']]['mohtime']));delete channels[_0xefdfd7[_0x9681('0x8')]][_0x9681('0x3b')];}}}catch(_0x1c271c){utils[_0x9681('0x1f')](util[_0x9681('0xb')](_0x9681('0x40'),_0xefdfd7[_0x9681('0x8')]),_0x1c271c);}};exports[_0x9681('0x41')]=function(_0x4e98d3){try{if(!_[_0x9681('0x20')](channels[_0x4e98d3[_0x9681('0x8')]])){utils[_0x9681('0x16')](util[_0x9681('0xb')]('[%s][calls][varset]',_0x4e98d3[_0x9681('0x8')]),_0x4e98d3);if(!_[_0x9681('0x20')](_0x4e98d3['variable'][_0x9681('0x42')])){utils[_0x9681('0xa')](util[_0x9681('0xb')](_0x9681('0x43'),_0x4e98d3['uniqueid'],_0x4e98d3[_0x9681('0x44')]));channels[_0x4e98d3['uniqueid']][_0x9681('0x45')]=_0x4e98d3[_0x9681('0x44')];}if(!_['isNil'](_0x4e98d3['variable'][_0x9681('0x46')])){utils[_0x9681('0xa')](util[_0x9681('0xb')](_0x9681('0x47'),_0x4e98d3[_0x9681('0x8')],_0x4e98d3[_0x9681('0x44')]));channels[_0x4e98d3[_0x9681('0x8')]]['destination']=_0x4e98d3[_0x9681('0x44')];channels[_0x4e98d3[_0x9681('0x8')]][_0x9681('0x2b')]='\x22'+_0x4e98d3[_0x9681('0x44')]+_0x9681('0x48')+_0x4e98d3[_0x9681('0x44')]+'>';}if(!_[_0x9681('0x20')](_0x4e98d3['variable'][_0x9681('0x49')])||!_[_0x9681('0x20')](_0x4e98d3[_0x9681('0x4a')]['xmd-callerid'])){utils[_0x9681('0xa')](util[_0x9681('0xb')](_0x9681('0x4b'),_0x4e98d3[_0x9681('0x8')],!_[_0x9681('0x20')](_0x4e98d3['variable'][_0x9681('0x49')])?_0x9681('0x49'):_0x9681('0x4c'),_0x4e98d3[_0x9681('0x44')]));channels[_0x4e98d3['uniqueid']][_0x9681('0x2b')]=_0x4e98d3['value'];}if(!_[_0x9681('0x20')](_0x4e98d3[_0x9681('0x4a')][_0x9681('0x4d')])||!_['isNil'](_0x4e98d3[_0x9681('0x4a')][_0x9681('0x4e')])){utils['info'](util[_0x9681('0xb')](_0x9681('0x4b'),_0x4e98d3[_0x9681('0x8')],!_[_0x9681('0x20')](_0x4e98d3[_0x9681('0x4a')]['xmd-queue'])?'xmd-queue':_0x9681('0x4e'),_0x4e98d3[_0x9681('0x44')]));channels[_0x4e98d3[_0x9681('0x8')]][_0x9681('0x4f')]=_0x9681('0x50');channels[_0x4e98d3['uniqueid']][_0x9681('0x51')]=_0x4e98d3[_0x9681('0x44')];channels[_0x4e98d3[_0x9681('0x8')]][_0x9681('0xd')]=!![];}if(!_['isNil'](_0x4e98d3['variable'][_0x9681('0x52')])){utils[_0x9681('0xa')](util[_0x9681('0xb')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x4e98d3[_0x9681('0x8')],_0x4e98d3[_0x9681('0x44')]));channels[_0x4e98d3['uniqueid']]['ContactId']=_0x4e98d3[_0x9681('0x44')];}if(!_[_0x9681('0x20')](_0x4e98d3[_0x9681('0x4a')]['xmd-cdrtype'])){utils['info'](util[_0x9681('0xb')](_0x9681('0x53'),_0x4e98d3[_0x9681('0x8')],_0x4e98d3['value']));channels[_0x4e98d3[_0x9681('0x8')]][_0x9681('0x54')]=_0x4e98d3['value'];}if(!_[_0x9681('0x20')](_0x4e98d3[_0x9681('0x4a')]['outboundrouteid'])){utils['info'](util[_0x9681('0xb')](_0x9681('0x55'),_0x4e98d3[_0x9681('0x8')],_0x4e98d3['value']));channels[_0x4e98d3['uniqueid']]['routeid']=_0x4e98d3[_0x9681('0x44')];}if(!_[_0x9681('0x20')](_0x4e98d3['variable'][_0x9681('0x56')])){utils[_0x9681('0xa')](util[_0x9681('0xb')](_0x9681('0x57'),_0x4e98d3['uniqueid'],_0x4e98d3[_0x9681('0x44')]));channels[_0x4e98d3[_0x9681('0x8')]][_0x9681('0x56')]=_0x4e98d3[_0x9681('0x44')];}}}catch(_0x5cdac3){utils[_0x9681('0x1f')](util[_0x9681('0xb')]('[%s][calls][varset]',_0x4e98d3[_0x9681('0x8')]),_0x5cdac3);}};exports[_0x9681('0x58')]=function(_0x2b817a){try{if(!_[_0x9681('0x20')](channels[_0x2b817a[_0x9681('0x8')]])){utils[_0x9681('0x16')](util[_0x9681('0xb')](_0x9681('0x59'),_0x2b817a[_0x9681('0x8')]),_0x2b817a);utils[_0x9681('0xa')](util['format'](_0x9681('0x5a'),_0x2b817a[_0x9681('0x8')],_0x2b817a[_0x9681('0x5b')],_0x2b817a['appdata']));if(_0x2b817a[_0x9681('0x5b')][_0x9681('0x5c')]()==_0x9681('0x5d')&&_['startsWith'](_0x2b817a[_0x9681('0x5e')][_0x9681('0x5c')](),_0x9681('0x5f'))){var _0x17393f=_0x2b817a[_0x9681('0x5e')]['split']('=');var _0x87f4d=_0x17393f[0x0]['substring'](_0x17393f[0x0][_0x9681('0x60')]('(')+0x1,_0x17393f[0x0][_0x9681('0x60')](')'));var _0x179463=_0x17393f[0x1];channels[_0x2b817a[_0x9681('0x8')]][_0x87f4d]=_0x179463;}if(!_['includes']([_0x9681('0x61'),_0x9681('0x62'),'execif','set',_0x9681('0x63')],_0x2b817a['application'][_0x9681('0x5c')]())){channels[_0x2b817a[_0x9681('0x8')]][_0x9681('0x4f')]=_0x2b817a[_0x9681('0x5b')];channels[_0x2b817a[_0x9681('0x8')]][_0x9681('0x51')]=_0x2b817a[_0x9681('0x5e')];}}}catch(_0x4c1102){utils[_0x9681('0x1f')](util[_0x9681('0xb')](_0x9681('0x59'),_0x2b817a[_0x9681('0x8')]),_0x4c1102);}};
\ No newline at end of file
+var _0x5b33=['cause-txt','endtime','starttime','billableseconds','diffTime','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','variable','value','xmd-phone','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','lastdata','queue','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','type','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','appdata','toLowerCase','startsWith','substring','lastIndexOf','includes','noop','execif','set','lodash','./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','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','channelstate','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s'];(function(_0x157b99,_0x2c6b9e){var _0x2ee6aa=function(_0xf09554){while(--_0xf09554){_0x157b99['push'](_0x157b99['shift']());}};_0x2ee6aa(++_0x2c6b9e);}(_0x5b33,0x1e0));var _0x35b3=function(_0x34bb68,_0x5b0079){_0x34bb68=_0x34bb68-0x0;var _0x3db9fb=_0x5b33[_0x34bb68];return _0x3db9fb;};'use strict';var _=require(_0x35b3('0x0'));var util=require('util');var utils=require(_0x35b3('0x1'));var transfers=require(_0x35b3('0x2'));var dispositions=[_0x35b3('0x3'),'FAILED',_0x35b3('0x4'),_0x35b3('0x3'),_0x35b3('0x3'),'NO\x20ANSWER',_0x35b3('0x5'),_0x35b3('0x6'),_0x35b3('0x4'),_0x35b3('0x4'),'FAILED'];var channels={};function writeDB(_0x572a39){var _0x346302;if(transfers[_0x35b3('0x7')][_0x572a39['uniqueid']]){_0x346302=_0x572a39[_0x35b3('0x8')];_0x572a39['uniqueid']=transfers[_0x35b3('0x7')][_0x572a39[_0x35b3('0x8')]][_0x35b3('0x9')];}utils[_0x35b3('0xa')](util[_0x35b3('0xb')](_0x35b3('0xc'),_0x572a39[_0x35b3('0x8')],_0x572a39['channel'],_0x572a39['queue'],_0x572a39[_0x35b3('0xd')],_0x572a39[_0x35b3('0xe')],_0x572a39[_0x35b3('0xf')],_0x572a39[_0x35b3('0x10')],_0x572a39[_0x35b3('0x11')]));if(_0x572a39[_0x35b3('0x12')]){utils[_0x35b3('0x13')](_0x572a39['accountcode'])[_0x35b3('0x14')](function(_0x33c621){if(_0x33c621){_0x572a39[_0x35b3('0x15')]=_0x33c621['id'];}utils[_0x35b3('0x16')](_0x35b3('0x17'),_0x572a39);});}else{utils[_0x35b3('0x16')](_0x35b3('0x17'),_0x572a39);}if(channels[_0x572a39[_0x35b3('0x8')]]){delete channels[_0x572a39[_0x35b3('0x8')]];}else if(_0x346302&&channels[_0x346302]){delete transfers[_0x35b3('0x7')][_0x346302];delete channels[_0x346302];}}exports['newchannel']=function(_0x9f263c){try{utils[_0x35b3('0x18')](util[_0x35b3('0xb')](_0x35b3('0x19'),_0x9f263c['uniqueid']),_0x9f263c);if(_0x9f263c[_0x35b3('0x8')]==_0x9f263c[_0x35b3('0x1a')]&&_0x9f263c['channel']!=_0x35b3('0x1b')){utils[_0x35b3('0xa')](util[_0x35b3('0xb')](_0x35b3('0x1c'),_0x9f263c[_0x35b3('0x8')],_0x9f263c[_0x35b3('0x1d')],_0x9f263c[_0x35b3('0x1e')]));channels[_0x9f263c[_0x35b3('0x8')]]={'uniqueid':_0x9f263c['uniqueid'],'accountcode':_0x9f263c['accountcode'],'source':_0x9f263c[_0x35b3('0xf')],'destination':_0x9f263c['exten'],'destinationcontext':_0x9f263c['context'],'channel':_0x9f263c[_0x35b3('0x1f')],'starttime':utils[_0x35b3('0x20')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x35b3('0x3'),'amaflags':_0x35b3('0x21')};}}catch(_0x4d8ce9){utils[_0x35b3('0x22')](util[_0x35b3('0xb')](_0x35b3('0x19'),_0x9f263c[_0x35b3('0x8')]),_0x4d8ce9);}};exports[_0x35b3('0x23')]=function(_0x46b532){try{utils['debug'](util[_0x35b3('0xb')](_0x35b3('0x24'),_0x46b532[_0x35b3('0x8')]),_0x46b532);if(!_[_0x35b3('0x25')](channels[_0x46b532[_0x35b3('0x8')]])&&_0x46b532['channelstate']==0x6){utils[_0x35b3('0xa')](util[_0x35b3('0xb')](_0x35b3('0x26'),_0x46b532['uniqueid'],_0x46b532[_0x35b3('0x1d')],_0x46b532['channel']));if(_[_0x35b3('0x25')](channels[_0x46b532[_0x35b3('0x8')]][_0x35b3('0x27')])){channels[_0x46b532['uniqueid']][_0x35b3('0x27')]=utils[_0x35b3('0x20')]();}}else if(!_[_0x35b3('0x25')](channels[_0x46b532[_0x35b3('0x1a')]])&&_0x46b532[_0x35b3('0x28')]==0x6&&_0x46b532['context']!=_0x35b3('0x29')){utils[_0x35b3('0xa')](util[_0x35b3('0xb')](_0x35b3('0x2a'),_0x46b532[_0x35b3('0x8')],_0x46b532['linkedid'],_0x46b532[_0x35b3('0x1d')],_0x46b532['channel']));channels[_0x46b532[_0x35b3('0x1a')]][_0x35b3('0x12')]=_0x46b532[_0x35b3('0x12')];channels[_0x46b532['linkedid']][_0x35b3('0x2b')]=_0x46b532[_0x35b3('0x1f')];if(_[_0x35b3('0x25')](channels[_0x46b532[_0x35b3('0x1a')]][_0x35b3('0x2c')])){channels[_0x46b532[_0x35b3('0x1a')]][_0x35b3('0x2c')]=utils[_0x35b3('0x20')]();}channels[_0x46b532['linkedid']][_0x35b3('0x2d')]=dispositions[_['toNumber'](_0x46b532[_0x35b3('0x28')])]||'ANSWERED';}}catch(_0x177fcc){utils[_0x35b3('0x22')](util[_0x35b3('0xb')](_0x35b3('0x24'),_0x46b532[_0x35b3('0x8')]),_0x177fcc);}};exports[_0x35b3('0x2e')]=function(_0x2c5544){try{if(!_['isNil'](channels[_0x2c5544[_0x35b3('0x8')]])){utils[_0x35b3('0x18')](util[_0x35b3('0xb')](_0x35b3('0x2f'),_0x2c5544[_0x35b3('0x8')]),_0x2c5544);if(_['isNil'](channels[_0x2c5544[_0x35b3('0x8')]]['callerid'])){channels[_0x2c5544['uniqueid']][_0x35b3('0x30')]=_0x2c5544['calleridname']+'\x20<'+_0x2c5544[_0x35b3('0xf')]+'>';}utils['info'](util['format'](_0x35b3('0x31'),_0x2c5544[_0x35b3('0x8')],channels[_0x2c5544[_0x35b3('0x8')]][_0x35b3('0x30')],_0x2c5544[_0x35b3('0x32')]));channels[_0x2c5544[_0x35b3('0x8')]][_0x35b3('0x33')]=utils[_0x35b3('0x20')]();channels[_0x2c5544[_0x35b3('0x8')]]['duration']=utils['diffTime'](channels[_0x2c5544[_0x35b3('0x8')]][_0x35b3('0x33')],channels[_0x2c5544[_0x35b3('0x8')]][_0x35b3('0x34')]);channels[_0x2c5544[_0x35b3('0x8')]][_0x35b3('0x35')]=channels[_0x2c5544[_0x35b3('0x8')]]['answertime']?utils[_0x35b3('0x36')](channels[_0x2c5544[_0x35b3('0x8')]][_0x35b3('0x33')],channels[_0x2c5544[_0x35b3('0x8')]][_0x35b3('0x2c')]):0x0;writeDB(channels[_0x2c5544[_0x35b3('0x8')]]);}}catch(_0x388606){utils[_0x35b3('0x22')](util[_0x35b3('0xb')](_0x35b3('0x2f'),_0x2c5544[_0x35b3('0x8')]),_0x388606);}};exports['attendedtransfer']=function(_0x4c8a9b){try{if(!_[_0x35b3('0x25')](channels[_0x4c8a9b[_0x35b3('0x37')]])){utils[_0x35b3('0x18')](util[_0x35b3('0xb')](_0x35b3('0x38'),_0x4c8a9b[_0x35b3('0x39')]),_0x4c8a9b);if(channels[_0x4c8a9b[_0x35b3('0x37')]][_0x35b3('0x1f')]==_0x4c8a9b[_0x35b3('0x3a')]){utils['info'](util['format'](_0x35b3('0x3b'),_0x4c8a9b[_0x35b3('0x39')],_0x4c8a9b[_0x35b3('0x37')],_0x4c8a9b[_0x35b3('0x3c')]));channels[_0x4c8a9b[_0x35b3('0x37')]]['destinationchannel']=_0x4c8a9b[_0x35b3('0x3c')];channels[_0x4c8a9b[_0x35b3('0x37')]][_0x35b3('0x3d')]=_0x35b3('0x3e');}else if(channels[_0x4c8a9b[_0x35b3('0x37')]][_0x35b3('0x1f')]=_0x4c8a9b[_0x35b3('0x3f')]){utils['info'](util[_0x35b3('0xb')](_0x35b3('0x3b'),_0x4c8a9b[_0x35b3('0x39')],_0x4c8a9b[_0x35b3('0x37')],_0x4c8a9b['origtransfererchannel']));channels[_0x4c8a9b[_0x35b3('0x37')]]['destinationchannel']=_0x4c8a9b[_0x35b3('0x40')];channels[_0x4c8a9b['localtwolinkedid']][_0x35b3('0x3d')]=_0x35b3('0x3e');}}}catch(_0x248e43){utils[_0x35b3('0x22')](util[_0x35b3('0xb')](_0x35b3('0x38'),_0x4c8a9b[_0x35b3('0x39')]),_0x248e43);}};exports[_0x35b3('0x41')]=function(_0x495ff2){try{if(!_[_0x35b3('0x25')](channels[_0x495ff2[_0x35b3('0x8')]])){utils[_0x35b3('0x18')](util['format'](_0x35b3('0x42'),_0x495ff2[_0x35b3('0x8')]),_0x495ff2);channels[_0x495ff2[_0x35b3('0x8')]][_0x35b3('0x43')]=utils[_0x35b3('0x20')]();utils[_0x35b3('0xa')](util['format'](_0x35b3('0x44'),_0x495ff2[_0x35b3('0x8')],channels[_0x495ff2[_0x35b3('0x8')]][_0x35b3('0x43')]));}}catch(_0x4a11d2){utils[_0x35b3('0x22')](util['format'](_0x35b3('0x42'),_0x495ff2[_0x35b3('0x8')]),_0x4a11d2);}};exports['musiconholdstop']=function(_0x5127a4){try{if(!_[_0x35b3('0x25')](channels[_0x5127a4['uniqueid']])){utils[_0x35b3('0x18')](util['format'](_0x35b3('0x45'),_0x5127a4['uniqueid']),_0x5127a4);if(!_['isNil'](channels[_0x5127a4[_0x35b3('0x8')]]['musiconholdstartAt'])){channels[_0x5127a4[_0x35b3('0x8')]][_0x35b3('0x46')]+=utils[_0x35b3('0x36')](utils['now'](),channels[_0x5127a4[_0x35b3('0x8')]][_0x35b3('0x43')]);utils[_0x35b3('0xa')](util[_0x35b3('0xb')](_0x35b3('0x47'),_0x5127a4[_0x35b3('0x8')],channels[_0x5127a4['uniqueid']][_0x35b3('0x46')]));delete channels[_0x5127a4[_0x35b3('0x8')]][_0x35b3('0x43')];}}}catch(_0x529306){utils[_0x35b3('0x22')](util[_0x35b3('0xb')](_0x35b3('0x45'),_0x5127a4[_0x35b3('0x8')]),_0x529306);}};exports['varset']=function(_0x282938){try{if(!_['isNil'](channels[_0x282938[_0x35b3('0x8')]])){utils[_0x35b3('0x18')](util[_0x35b3('0xb')]('[%s][calls][varset]',_0x282938[_0x35b3('0x8')]),_0x282938);if(!_[_0x35b3('0x25')](_0x282938[_0x35b3('0x48')]['xmd-originatecalleridnum'])){utils['info'](util[_0x35b3('0xb')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x282938[_0x35b3('0x8')],_0x282938[_0x35b3('0x49')]));channels[_0x282938[_0x35b3('0x8')]]['source']=_0x282938['value'];}if(!_[_0x35b3('0x25')](_0x282938[_0x35b3('0x48')][_0x35b3('0x4a')])){utils[_0x35b3('0xa')](util[_0x35b3('0xb')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x282938['uniqueid'],_0x282938[_0x35b3('0x49')]));channels[_0x282938[_0x35b3('0x8')]]['destination']=_0x282938[_0x35b3('0x49')];channels[_0x282938[_0x35b3('0x8')]]['callerid']='\x22'+_0x282938[_0x35b3('0x49')]+_0x35b3('0x4b')+_0x282938[_0x35b3('0x49')]+'>';}if(!_[_0x35b3('0x25')](_0x282938[_0x35b3('0x48')][_0x35b3('0x4c')])||!_[_0x35b3('0x25')](_0x282938['variable'][_0x35b3('0x4d')])){utils['info'](util[_0x35b3('0xb')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x282938[_0x35b3('0x8')],!_[_0x35b3('0x25')](_0x282938[_0x35b3('0x48')]['xmd-callerid-preview'])?_0x35b3('0x4c'):_0x35b3('0x4d'),_0x282938[_0x35b3('0x49')]));channels[_0x282938[_0x35b3('0x8')]][_0x35b3('0x30')]=_0x282938['value'];}if(!_[_0x35b3('0x25')](_0x282938['variable'][_0x35b3('0x4e')])||!_[_0x35b3('0x25')](_0x282938[_0x35b3('0x48')]['xmcs-queue'])){utils['info'](util[_0x35b3('0xb')](_0x35b3('0x4f'),_0x282938[_0x35b3('0x8')],!_['isNil'](_0x282938[_0x35b3('0x48')][_0x35b3('0x4e')])?'xmd-queue':'xmcs-queue',_0x282938[_0x35b3('0x49')]));channels[_0x282938['uniqueid']][_0x35b3('0x50')]=_0x35b3('0x51');channels[_0x282938['uniqueid']][_0x35b3('0x52')]=_0x282938[_0x35b3('0x49')];channels[_0x282938['uniqueid']][_0x35b3('0x53')]=!![];}if(!_[_0x35b3('0x25')](_0x282938[_0x35b3('0x48')][_0x35b3('0x54')])){utils['info'](util['format'](_0x35b3('0x55'),_0x282938['uniqueid'],_0x282938['value']));channels[_0x282938['uniqueid']]['ContactId']=_0x282938[_0x35b3('0x49')];}if(!_[_0x35b3('0x25')](_0x282938[_0x35b3('0x48')][_0x35b3('0x56')])){utils[_0x35b3('0xa')](util[_0x35b3('0xb')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x282938[_0x35b3('0x8')],_0x282938['value']));channels[_0x282938[_0x35b3('0x8')]][_0x35b3('0x57')]=_0x282938[_0x35b3('0x49')];}if(!_['isNil'](_0x282938[_0x35b3('0x48')][_0x35b3('0x58')])){utils['info'](util[_0x35b3('0xb')](_0x35b3('0x59'),_0x282938[_0x35b3('0x8')],_0x282938['value']));channels[_0x282938[_0x35b3('0x8')]][_0x35b3('0x5a')]=_0x282938[_0x35b3('0x49')];}if(!_[_0x35b3('0x25')](_0x282938['variable'][_0x35b3('0x5b')])){utils[_0x35b3('0xa')](util[_0x35b3('0xb')](_0x35b3('0x5c'),_0x282938['uniqueid'],_0x282938[_0x35b3('0x49')]));channels[_0x282938['uniqueid']][_0x35b3('0x5b')]=_0x282938['value'];}}}catch(_0x592371){utils[_0x35b3('0x22')](util[_0x35b3('0xb')](_0x35b3('0x5d'),_0x282938[_0x35b3('0x8')]),_0x592371);}};exports['newexten']=function(_0x4f6621){try{if(!_[_0x35b3('0x25')](channels[_0x4f6621[_0x35b3('0x8')]])){utils['debug'](util['format'](_0x35b3('0x5e'),_0x4f6621[_0x35b3('0x8')]),_0x4f6621);utils[_0x35b3('0xa')](util['format'](_0x35b3('0x5f'),_0x4f6621['uniqueid'],_0x4f6621[_0x35b3('0x60')],_0x4f6621[_0x35b3('0x61')]));if(_0x4f6621['application'][_0x35b3('0x62')]()=='set'&&_[_0x35b3('0x63')](_0x4f6621['appdata'][_0x35b3('0x62')](),'cdr')){var _0x3f3c64=_0x4f6621[_0x35b3('0x61')]['split']('=');var _0x29e38d=_0x3f3c64[0x0][_0x35b3('0x64')](_0x3f3c64[0x0][_0x35b3('0x65')]('(')+0x1,_0x3f3c64[0x0][_0x35b3('0x65')](')'));var _0x5ad213=_0x3f3c64[0x1];channels[_0x4f6621['uniqueid']][_0x29e38d]=_0x5ad213;}if(!_[_0x35b3('0x66')](['hangup',_0x35b3('0x67'),_0x35b3('0x68'),_0x35b3('0x69'),'gotoif'],_0x4f6621[_0x35b3('0x60')][_0x35b3('0x62')]())){channels[_0x4f6621[_0x35b3('0x8')]][_0x35b3('0x50')]=_0x4f6621[_0x35b3('0x60')];channels[_0x4f6621[_0x35b3('0x8')]][_0x35b3('0x52')]=_0x4f6621[_0x35b3('0x61')];}}}catch(_0x1a174){utils[_0x35b3('0x22')](util[_0x35b3('0xb')](_0x35b3('0x5e'),_0x4f6621['uniqueid']),_0x1a174);}};
\ No newline at end of file
index 10862dd..4f0eb4f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xff25=['[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','connect','info','fullybooted'];(function(_0x98417d,_0x2d249c){var _0x51ee3c=function(_0x270644){while(--_0x270644){_0x98417d['push'](_0x98417d['shift']());}};_0x51ee3c(++_0x2d249c);}(_0xff25,0x195));var _0x5ff2=function(_0x455ad6,_0x2301e9){_0x455ad6=_0x455ad6-0x0;var _0x2f706a=_0xff25[_0x455ad6];return _0x2f706a;};'use strict';var utils=require('./utils');exports[_0x5ff2('0x0')]=function(){utils[_0x5ff2('0x1')]('[core]\x20connected');};exports['shutdown']=function(){utils['info']('[core]\x20shutdown');};exports[_0x5ff2('0x2')]=function(){utils[_0x5ff2('0x1')](_0x5ff2('0x3'));};exports[_0x5ff2('0x4')]=function(_0x55cc83){utils[_0x5ff2('0x4')](_0x5ff2('0x5'),_0x55cc83);};exports[_0x5ff2('0x6')]=function(){utils[_0x5ff2('0x1')](_0x5ff2('0x7'));};exports['managerevent']=function(_0x4a24c3){};
\ No newline at end of file
+var _0x5f34=['[core]\x20error','managerevent','connect','info','shutdown','fullybooted','[core]\x20fullybooted','error'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x5f34,0xba));var _0x45f3=function(_0x50b75c,_0x3a0778){_0x50b75c=_0x50b75c-0x0;var _0x496f7b=_0x5f34[_0x50b75c];return _0x496f7b;};'use strict';var utils=require('./utils');exports[_0x45f3('0x0')]=function(){utils[_0x45f3('0x1')]('[core]\x20connected');};exports[_0x45f3('0x2')]=function(){utils['info']('[core]\x20shutdown');};exports[_0x45f3('0x3')]=function(){utils['info'](_0x45f3('0x4'));};exports[_0x45f3('0x5')]=function(_0x1bdce7){utils[_0x45f3('0x5')](_0x45f3('0x6'),_0x1bdce7);};exports['close']=function(){utils[_0x45f3('0x1')]('[core]\x20close');};exports[_0x45f3('0x7')]=function(_0x2ec025){};
\ No newline at end of file
index 86d3d46..2063f23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0db8=['[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','[%s][dials][dialbegin]','starttime','lastevent','called','dialend','[%s][dials][dialend]','ANSWER','assign','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','cause-txt','now','complete','duration','diffTime','endtime','holdtime','billableseconds','lodash','util','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','startsWith','toLowerCase','cdr(routeid)','varset','debug'];(function(_0x1e867d,_0x16cffc){var _0x1f758d=function(_0x4a24d1){while(--_0x4a24d1){_0x1e867d['push'](_0x1e867d['shift']());}};_0x1f758d(++_0x16cffc);}(_0x0db8,0xed));var _0x80db=function(_0x4e21fb,_0x2eb08b){_0x4e21fb=_0x4e21fb-0x0;var _0x1edbb1=_0x0db8[_0x4e21fb];return _0x1edbb1;};'use strict';var _=require(_0x80db('0x0'));var util=require(_0x80db('0x1'));var utils=require('./utils');var dials={};function writeDB(_0xd782ba){utils[_0x80db('0x2')](util[_0x80db('0x3')](_0x80db('0x4'),_0xd782ba[_0x80db('0x5')],_0xd782ba[_0x80db('0x6')],_0xd782ba[_0x80db('0x7')],_0xd782ba[_0x80db('0x8')],_0xd782ba[_0x80db('0x9')],_0xd782ba[_0x80db('0xa')]));utils[_0x80db('0xb')](_0x80db('0xc'),_0xd782ba);delete dials[_0xd782ba['uniqueid']];}exports[_0x80db('0xd')]=function(_0x3e8fd8){try{utils['debug'](util[_0x80db('0x3')](_0x80db('0xe'),_0x3e8fd8['uniqueid']),_0x3e8fd8);utils[_0x80db('0x2')](util[_0x80db('0x3')](_0x80db('0xf'),_0x3e8fd8[_0x80db('0x5')],_0x3e8fd8[_0x80db('0x10')],_0x3e8fd8[_0x80db('0x11')]));if(_0x3e8fd8[_0x80db('0x10')]['toLowerCase']()=='set'&&_[_0x80db('0x12')](_0x3e8fd8['appdata'][_0x80db('0x13')](),_0x80db('0x14'))){var _0x40c657=_0x3e8fd8['appdata']['split']('=');dials[_0x3e8fd8[_0x80db('0x5')]]={'routeId':_0x40c657[0x1]};}}catch(_0x4e23b8){utils['error'](util[_0x80db('0x3')]('[%s][dials][newexten]',_0x3e8fd8[_0x80db('0x5')]),_0x4e23b8);}};exports[_0x80db('0x15')]=function(_0x295dfd){try{utils[_0x80db('0x16')](util['format'](_0x80db('0x17'),_0x295dfd[_0x80db('0x5')]),_0x295dfd);if(!_[_0x80db('0x18')](_0x295dfd['variable'][_0x80db('0x19')])){utils[_0x80db('0x2')](util[_0x80db('0x3')](_0x80db('0x1a'),_0x295dfd[_0x80db('0x5')],_0x295dfd[_0x80db('0x1b')]));dials[_0x295dfd[_0x80db('0x5')]]={'routeId':_0x295dfd[_0x80db('0x1b')]};}}catch(_0x312e20){utils[_0x80db('0x1c')](util[_0x80db('0x3')](_0x80db('0x17'),_0x295dfd[_0x80db('0x5')]),_0x312e20);}};exports[_0x80db('0x1d')]=function(_0x368131){try{if(!_['isNil'](dials[_0x368131[_0x80db('0x5')]])){utils['debug'](util[_0x80db('0x3')](_0x80db('0x1e'),_0x368131[_0x80db('0x5')]),_0x368131);dials[_0x368131[_0x80db('0x5')]]=_['assign'](dials[_0x368131['uniqueid']],_0x368131);dials[_0x368131[_0x80db('0x5')]][_0x80db('0x1f')]=utils['now']();dials[_0x368131[_0x80db('0x5')]][_0x80db('0x20')]=_0x80db('0x21');utils['info'](util[_0x80db('0x3')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x368131[_0x80db('0x5')],dials[_0x368131['uniqueid']][_0x80db('0x1f')]));}}catch(_0x59aded){utils[_0x80db('0x1c')](util[_0x80db('0x3')](_0x80db('0x1e'),_0x368131[_0x80db('0x5')]),_0x59aded);}};exports[_0x80db('0x22')]=function(_0x41b97f){try{if(!_[_0x80db('0x18')](dials[_0x41b97f['uniqueid']])){utils[_0x80db('0x16')](util[_0x80db('0x3')](_0x80db('0x23'),_0x41b97f[_0x80db('0x5')]),_0x41b97f);dials[_0x41b97f['uniqueid']][_0x80db('0xa')]=_0x41b97f['dialstatus'];if(_0x41b97f['dialstatus']==_0x80db('0x24')){dials[_0x41b97f[_0x80db('0x5')]]=_[_0x80db('0x25')](dials[_0x41b97f[_0x80db('0x5')]],_0x41b97f);dials[_0x41b97f[_0x80db('0x5')]][_0x80db('0x26')]=utils['now']();dials[_0x41b97f['uniqueid']]['lastevent']=_0x80db('0x27');utils[_0x80db('0x2')](util['format'](_0x80db('0x28'),_0x41b97f[_0x80db('0x5')],_0x41b97f['dialstatus'],dials[_0x41b97f[_0x80db('0x5')]][_0x80db('0x26')]));}else{utils[_0x80db('0x2')](util[_0x80db('0x3')](_0x80db('0x29'),_0x41b97f['uniqueid'],_0x41b97f[_0x80db('0xa')]));}}}catch(_0x3ead00){utils['error'](util[_0x80db('0x3')]('[%s][dials][dialend]',_0x41b97f[_0x80db('0x5')]),_0x3ead00);}};exports[_0x80db('0x2a')]=function(_0xe1a2b4){try{if(!_[_0x80db('0x18')](dials[_0xe1a2b4[_0x80db('0x5')]])){utils['debug'](util[_0x80db('0x3')](_0x80db('0x2b'),_0xe1a2b4[_0x80db('0x5')]),_0xe1a2b4);utils[_0x80db('0x2')](util[_0x80db('0x3')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0xe1a2b4[_0x80db('0x5')],_0xe1a2b4[_0x80db('0x8')],_0xe1a2b4['calleridname'],_0xe1a2b4[_0x80db('0x2c')]));dials[_0xe1a2b4['uniqueid']]=_[_0x80db('0x25')](dials[_0xe1a2b4[_0x80db('0x5')]],{'endtime':utils[_0x80db('0x2d')](),'lastevent':_0x80db('0x2e')});dials[_0xe1a2b4['uniqueid']][_0x80db('0x2f')]=utils[_0x80db('0x30')](dials[_0xe1a2b4[_0x80db('0x5')]][_0x80db('0x31')],dials[_0xe1a2b4['uniqueid']][_0x80db('0x1f')]);dials[_0xe1a2b4[_0x80db('0x5')]][_0x80db('0x32')]=utils[_0x80db('0x30')](dials[_0xe1a2b4[_0x80db('0x5')]][_0x80db('0x26')]||dials[_0xe1a2b4['uniqueid']][_0x80db('0x31')],dials[_0xe1a2b4['uniqueid']][_0x80db('0x1f')]);dials[_0xe1a2b4[_0x80db('0x5')]][_0x80db('0x33')]=dials[_0xe1a2b4[_0x80db('0x5')]][_0x80db('0x26')]?utils[_0x80db('0x30')](dials[_0xe1a2b4['uniqueid']][_0x80db('0x31')],dials[_0xe1a2b4[_0x80db('0x5')]]['answertime']):0x0;writeDB(dials[_0xe1a2b4[_0x80db('0x5')]]);}}catch(_0x5b346c){utils[_0x80db('0x1c')](util[_0x80db('0x3')](_0x80db('0x2b'),_0xe1a2b4[_0x80db('0x5')]),_0x5b346c);}};
\ No newline at end of file
+var _0x02ba=['assign','now','lastevent','called','starttime','[%s][dials][dialbegin]','dialstatus','ANSWER','answertime','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','calleridname','cause-txt','complete','duration','holdtime','endtime','diffTime','lodash','util','./utils','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','calleridnum','request','CreateVoiceDialReport','format','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','toLowerCase','set','appdata','cdr(routeid)','split','error','debug','[%s][dials][varset]','isNil','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','dialbegin'];(function(_0x236906,_0x1c2803){var _0x21199e=function(_0x5eb347){while(--_0x5eb347){_0x236906['push'](_0x236906['shift']());}};_0x21199e(++_0x1c2803);}(_0x02ba,0xef));var _0xa02b=function(_0x44dff8,_0x12c43e){_0x44dff8=_0x44dff8-0x0;var _0x555174=_0x02ba[_0x44dff8];return _0x555174;};'use strict';var _=require(_0xa02b('0x0'));var util=require(_0xa02b('0x1'));var utils=require(_0xa02b('0x2'));var dials={};function writeDB(_0x3d988b){utils[_0xa02b('0x3')](util['format'](_0xa02b('0x4'),_0x3d988b[_0xa02b('0x5')],_0x3d988b[_0xa02b('0x6')],_0x3d988b['dialstring'],_0x3d988b[_0xa02b('0x7')],_0x3d988b['connectedlinenum'],_0x3d988b['dialstatus']));utils[_0xa02b('0x8')](_0xa02b('0x9'),_0x3d988b);delete dials[_0x3d988b[_0xa02b('0x5')]];}exports['newexten']=function(_0x64f6cd){try{utils['debug'](util[_0xa02b('0xa')](_0xa02b('0xb'),_0x64f6cd[_0xa02b('0x5')]),_0x64f6cd);utils[_0xa02b('0x3')](util[_0xa02b('0xa')](_0xa02b('0xc'),_0x64f6cd[_0xa02b('0x5')],_0x64f6cd['application'],_0x64f6cd['appdata']));if(_0x64f6cd['application'][_0xa02b('0xd')]()==_0xa02b('0xe')&&_['startsWith'](_0x64f6cd[_0xa02b('0xf')][_0xa02b('0xd')](),_0xa02b('0x10'))){var _0x4d3abc=_0x64f6cd['appdata'][_0xa02b('0x11')]('=');dials[_0x64f6cd[_0xa02b('0x5')]]={'routeId':_0x4d3abc[0x1]};}}catch(_0x37a521){utils[_0xa02b('0x12')](util[_0xa02b('0xa')]('[%s][dials][newexten]',_0x64f6cd[_0xa02b('0x5')]),_0x37a521);}};exports['varset']=function(_0x4c77ee){try{utils[_0xa02b('0x13')](util['format'](_0xa02b('0x14'),_0x4c77ee[_0xa02b('0x5')]),_0x4c77ee);if(!_[_0xa02b('0x15')](_0x4c77ee[_0xa02b('0x16')]['outboundrouteid'])){utils['info'](util['format'](_0xa02b('0x17'),_0x4c77ee[_0xa02b('0x5')],_0x4c77ee['value']));dials[_0x4c77ee['uniqueid']]={'routeId':_0x4c77ee['value']};}}catch(_0x4255ce){utils[_0xa02b('0x12')](util[_0xa02b('0xa')](_0xa02b('0x14'),_0x4c77ee[_0xa02b('0x5')]),_0x4255ce);}};exports[_0xa02b('0x18')]=function(_0x2a0d51){try{if(!_[_0xa02b('0x15')](dials[_0x2a0d51[_0xa02b('0x5')]])){utils['debug'](util['format']('[%s][dials][dialbegin]',_0x2a0d51[_0xa02b('0x5')]),_0x2a0d51);dials[_0x2a0d51[_0xa02b('0x5')]]=_[_0xa02b('0x19')](dials[_0x2a0d51[_0xa02b('0x5')]],_0x2a0d51);dials[_0x2a0d51[_0xa02b('0x5')]]['starttime']=utils[_0xa02b('0x1a')]();dials[_0x2a0d51[_0xa02b('0x5')]][_0xa02b('0x1b')]=_0xa02b('0x1c');utils[_0xa02b('0x3')](util[_0xa02b('0xa')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x2a0d51['uniqueid'],dials[_0x2a0d51[_0xa02b('0x5')]][_0xa02b('0x1d')]));}}catch(_0x24668c){utils['error'](util['format'](_0xa02b('0x1e'),_0x2a0d51['uniqueid']),_0x24668c);}};exports['dialend']=function(_0x2f719b){try{if(!_[_0xa02b('0x15')](dials[_0x2f719b[_0xa02b('0x5')]])){utils[_0xa02b('0x13')](util[_0xa02b('0xa')]('[%s][dials][dialend]',_0x2f719b[_0xa02b('0x5')]),_0x2f719b);dials[_0x2f719b[_0xa02b('0x5')]][_0xa02b('0x1f')]=_0x2f719b[_0xa02b('0x1f')];if(_0x2f719b[_0xa02b('0x1f')]==_0xa02b('0x20')){dials[_0x2f719b[_0xa02b('0x5')]]=_[_0xa02b('0x19')](dials[_0x2f719b[_0xa02b('0x5')]],_0x2f719b);dials[_0x2f719b[_0xa02b('0x5')]][_0xa02b('0x21')]=utils[_0xa02b('0x1a')]();dials[_0x2f719b[_0xa02b('0x5')]][_0xa02b('0x1b')]='connect';utils[_0xa02b('0x3')](util[_0xa02b('0xa')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x2f719b[_0xa02b('0x5')],_0x2f719b[_0xa02b('0x1f')],dials[_0x2f719b['uniqueid']]['answertime']));}else{utils[_0xa02b('0x3')](util[_0xa02b('0xa')](_0xa02b('0x22'),_0x2f719b[_0xa02b('0x5')],_0x2f719b['dialstatus']));}}}catch(_0x49ca2e){utils['error'](util[_0xa02b('0xa')]('[%s][dials][dialend]',_0x2f719b[_0xa02b('0x5')]),_0x49ca2e);}};exports[_0xa02b('0x23')]=function(_0x1e6aa7){try{if(!_[_0xa02b('0x15')](dials[_0x1e6aa7['uniqueid']])){utils[_0xa02b('0x13')](util[_0xa02b('0xa')](_0xa02b('0x24'),_0x1e6aa7[_0xa02b('0x5')]),_0x1e6aa7);utils[_0xa02b('0x3')](util[_0xa02b('0xa')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x1e6aa7[_0xa02b('0x5')],_0x1e6aa7[_0xa02b('0x7')],_0x1e6aa7[_0xa02b('0x25')],_0x1e6aa7[_0xa02b('0x26')]));dials[_0x1e6aa7[_0xa02b('0x5')]]=_[_0xa02b('0x19')](dials[_0x1e6aa7['uniqueid']],{'endtime':utils[_0xa02b('0x1a')](),'lastevent':_0xa02b('0x27')});dials[_0x1e6aa7[_0xa02b('0x5')]][_0xa02b('0x28')]=utils['diffTime'](dials[_0x1e6aa7[_0xa02b('0x5')]]['endtime'],dials[_0x1e6aa7['uniqueid']]['starttime']);dials[_0x1e6aa7[_0xa02b('0x5')]][_0xa02b('0x29')]=utils['diffTime'](dials[_0x1e6aa7[_0xa02b('0x5')]][_0xa02b('0x21')]||dials[_0x1e6aa7[_0xa02b('0x5')]][_0xa02b('0x2a')],dials[_0x1e6aa7['uniqueid']][_0xa02b('0x1d')]);dials[_0x1e6aa7[_0xa02b('0x5')]]['billableseconds']=dials[_0x1e6aa7[_0xa02b('0x5')]][_0xa02b('0x21')]?utils[_0xa02b('0x2b')](dials[_0x1e6aa7['uniqueid']][_0xa02b('0x2a')],dials[_0x1e6aa7[_0xa02b('0x5')]][_0xa02b('0x21')]):0x0;writeDB(dials[_0x1e6aa7[_0xa02b('0x5')]]);}}catch(_0x59d6ac){utils[_0xa02b('0x12')](util[_0xa02b('0xa')]('[%s][dials][hangup]',_0x1e6aa7['uniqueid']),_0x59d6ac);}};
\ No newline at end of file
index b3d2e3a..0e89edb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x4bb4=['./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','device','[%s][index][devicestatechange]','format','[%s][index][agentcalled]','agentcalled','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','[%s][index][agentcomplete]','agentcomplete','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','[%s][index][blindtransfer]','blindtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','attendedtransfer','varset','[%s][index][varset]','[%s][index][newexten]','newexten','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager','./utils','util','asterisk','username','password','keepConnected','xdr','disabled','XDR\x20DISABLED'];(function(_0x37acf7,_0x1fe112){var _0x1408b3=function(_0x368e86){while(--_0x368e86){_0x37acf7['push'](_0x37acf7['shift']());}};_0x1408b3(++_0x1fe112);}(_0x4bb4,0x10a));var _0x44bb=function(_0x53758c,_0x5664af){_0x53758c=_0x53758c-0x0;var _0x425eff=_0x4bb4[_0x53758c];return _0x425eff;};var AsteriskManager=require(_0x44bb('0x0'));var config=require('../../config/environment');var utils=require(_0x44bb('0x1'));var util=require(_0x44bb('0x2'));var ami=new AsteriskManager(config[_0x44bb('0x3')]['port'],config['asterisk']['ip'],config['asterisk'][_0x44bb('0x4')],config[_0x44bb('0x3')][_0x44bb('0x5')],!![]);ami[_0x44bb('0x6')]();if(config[_0x44bb('0x7')]&&config[_0x44bb('0x7')][_0x44bb('0x8')]){utils['info'](_0x44bb('0x9'));}else{var agents=require(_0x44bb('0xa'));var calls=require(_0x44bb('0xb'));var queues=require(_0x44bb('0xc'));var recordings=require(_0x44bb('0xd'));var members=require('./members.controller');var dials=require(_0x44bb('0xe'));var transfers=require(_0x44bb('0xf'));var core=require(_0x44bb('0x10'));ami['on'](_0x44bb('0x11'),core[_0x44bb('0x11')]);ami['on'](_0x44bb('0x12'),core[_0x44bb('0x12')]);ami['on'](_0x44bb('0x13'),core[_0x44bb('0x13')]);ami['on'](_0x44bb('0x14'),core['error']);ami['on'](_0x44bb('0x15'),core['close']);ami['on'](_0x44bb('0x16'),core[_0x44bb('0x16')]);ami['on'](_0x44bb('0x17'),function(_0x493696){try{utils[_0x44bb('0x18')](util['format']('[%s][index][devicestatechange]',_0x493696[_0x44bb('0x19')]),_0x493696);members[_0x44bb('0x17')](_0x493696);}catch(_0x1895c0){utils[_0x44bb('0x14')](util['format'](_0x44bb('0x1a'),_0x493696[_0x44bb('0x19')]),_0x1895c0);}});ami['on']('agentcalled',function(_0x2f733b){try{utils[_0x44bb('0x18')](util[_0x44bb('0x1b')](_0x44bb('0x1c'),_0x2f733b['uniqueid']),_0x2f733b);agents[_0x44bb('0x1d')](_0x2f733b);}catch(_0x12d4df){utils[_0x44bb('0x14')](util[_0x44bb('0x1b')](_0x44bb('0x1c'),_0x2f733b[_0x44bb('0x1e')]),_0x12d4df);}});ami['on'](_0x44bb('0x1f'),function(_0x429896){try{utils[_0x44bb('0x18')](util[_0x44bb('0x1b')]('[%s][index][agentringnoanswer]',_0x429896[_0x44bb('0x1e')]),_0x429896);agents[_0x44bb('0x1f')](_0x429896);}catch(_0x4ccc79){utils['error'](util['format'](_0x44bb('0x20'),_0x429896['uniqueid']),_0x4ccc79);}});ami['on'](_0x44bb('0x21'),function(_0xaea7e2){try{utils[_0x44bb('0x18')](util[_0x44bb('0x1b')](_0x44bb('0x22'),_0xaea7e2[_0x44bb('0x1e')]),_0xaea7e2);agents[_0x44bb('0x21')](_0xaea7e2);queues[_0x44bb('0x21')](_0xaea7e2);}catch(_0x4387a6){utils[_0x44bb('0x14')](util['format'](_0x44bb('0x22'),_0xaea7e2['uniqueid']),_0x4387a6);}});ami['on']('agentcomplete',function(_0x49febc){try{utils[_0x44bb('0x18')](util[_0x44bb('0x1b')](_0x44bb('0x23'),_0x49febc[_0x44bb('0x1e')]),_0x49febc);agents['agentcomplete'](_0x49febc);queues['agentcomplete'](_0x49febc);members[_0x44bb('0x24')](_0x49febc);}catch(_0xca535b){utils[_0x44bb('0x14')](util[_0x44bb('0x1b')]('[%s][index][agentcomplete]',_0x49febc[_0x44bb('0x1e')]),_0xca535b);}});ami['on']('queuecallerabandon',function(_0x346abc){try{utils[_0x44bb('0x18')](util[_0x44bb('0x1b')](_0x44bb('0x25'),_0x346abc[_0x44bb('0x1e')]),_0x346abc);agents[_0x44bb('0x26')](_0x346abc);queues[_0x44bb('0x26')](_0x346abc);}catch(_0x335d14){utils['error'](util[_0x44bb('0x1b')](_0x44bb('0x25'),_0x346abc[_0x44bb('0x1e')]),_0x335d14);}});ami['on'](_0x44bb('0x27'),function(_0x216563){try{utils[_0x44bb('0x18')](util[_0x44bb('0x1b')](_0x44bb('0x28'),_0x216563['uniqueid']),_0x216563);queues[_0x44bb('0x27')](_0x216563);recordings['queuecallerjoin'](_0x216563);}catch(_0x4eec4a){utils[_0x44bb('0x14')](util[_0x44bb('0x1b')](_0x44bb('0x28'),_0x216563[_0x44bb('0x1e')]),_0x4eec4a);}});ami['on']('queuecallerleave',function(_0x8700f4){try{utils[_0x44bb('0x18')](util[_0x44bb('0x1b')](_0x44bb('0x29'),_0x8700f4[_0x44bb('0x1e')]),_0x8700f4);queues[_0x44bb('0x2a')](_0x8700f4);}catch(_0x31035e){utils[_0x44bb('0x14')](util[_0x44bb('0x1b')](_0x44bb('0x29'),_0x8700f4[_0x44bb('0x1e')]),_0x31035e);}});ami['on'](_0x44bb('0x2b'),function(_0x5000d8){try{utils[_0x44bb('0x18')](util[_0x44bb('0x1b')](_0x44bb('0x2c'),_0x5000d8['uniqueid']),_0x5000d8);queues['musiconholdstart'](_0x5000d8);calls['musiconholdstart'](_0x5000d8);}catch(_0x6bc9d2){utils[_0x44bb('0x14')](util['format'](_0x44bb('0x2c'),_0x5000d8[_0x44bb('0x1e')]),_0x6bc9d2);}});ami['on']('musiconholdstop',function(_0x443cab){try{utils[_0x44bb('0x18')](util[_0x44bb('0x1b')](_0x44bb('0x2d'),_0x443cab[_0x44bb('0x1e')]),_0x443cab);queues[_0x44bb('0x2e')](_0x443cab);calls[_0x44bb('0x2e')](_0x443cab);}catch(_0x3ada50){utils['error'](util[_0x44bb('0x1b')](_0x44bb('0x2d'),_0x443cab['uniqueid']),_0x3ada50);}});ami['on']('newstate',function(_0x245c08){try{utils[_0x44bb('0x18')](util['format']('[%s][index][newstate]',_0x245c08[_0x44bb('0x1e')]),_0x245c08);calls[_0x44bb('0x2f')](_0x245c08);recordings[_0x44bb('0x2f')](_0x245c08);}catch(_0x11e080){utils[_0x44bb('0x14')](util[_0x44bb('0x1b')](_0x44bb('0x30'),_0x245c08[_0x44bb('0x1e')]),_0x11e080);}});ami['on'](_0x44bb('0x31'),function(_0x53a034){try{utils[_0x44bb('0x18')](util[_0x44bb('0x1b')](_0x44bb('0x32'),_0x53a034[_0x44bb('0x1e')]),_0x53a034);calls[_0x44bb('0x31')](_0x53a034);recordings[_0x44bb('0x31')](_0x53a034);dials[_0x44bb('0x31')](_0x53a034);agents[_0x44bb('0x31')](_0x53a034);queues[_0x44bb('0x31')](_0x53a034);}catch(_0xfde4d1){utils[_0x44bb('0x14')](util[_0x44bb('0x1b')](_0x44bb('0x32'),_0x53a034[_0x44bb('0x1e')]),_0xfde4d1);}});ami['on'](_0x44bb('0x33'),function(_0x4370ad){try{utils['debug'](util['format'](_0x44bb('0x34'),_0x4370ad[_0x44bb('0x1e')]),_0x4370ad);members['cdr'](_0x4370ad);}catch(_0x1f6203){utils[_0x44bb('0x14')](util[_0x44bb('0x1b')](_0x44bb('0x34'),_0x4370ad[_0x44bb('0x1e')]),_0x1f6203);}});ami['on']('blindtransfer',function(_0x289b8e){try{utils[_0x44bb('0x18')](util[_0x44bb('0x1b')](_0x44bb('0x35'),_0x289b8e[_0x44bb('0x1e')]),_0x289b8e);queues[_0x44bb('0x36')](_0x289b8e);agents['blindtransfer'](_0x289b8e);transfers[_0x44bb('0x36')](_0x289b8e);}catch(_0x249700){utils[_0x44bb('0x14')](util[_0x44bb('0x1b')]('[%s][index][blindtransfer]',_0x289b8e[_0x44bb('0x1e')]),_0x249700);}});ami['on']('attendedtransfer',function(_0x494a7e){try{utils['debug'](util[_0x44bb('0x1b')](_0x44bb('0x37'),_0x494a7e[_0x44bb('0x38')]),_0x494a7e);queues[_0x44bb('0x39')](_0x494a7e);transfers[_0x44bb('0x39')](_0x494a7e);agents[_0x44bb('0x39')](_0x494a7e);calls[_0x44bb('0x39')](_0x494a7e);}catch(_0x5eb20d){utils[_0x44bb('0x14')](util['format'](_0x44bb('0x37'),_0x494a7e[_0x44bb('0x38')]),_0x5eb20d);}});ami['on'](_0x44bb('0x3a'),function(_0x282723){try{utils['debug'](util[_0x44bb('0x1b')](_0x44bb('0x3b'),_0x282723[_0x44bb('0x1e')]),_0x282723);queues[_0x44bb('0x3a')](_0x282723);recordings[_0x44bb('0x3a')](_0x282723);calls['varset'](_0x282723);dials[_0x44bb('0x3a')](_0x282723);}catch(_0x473603){utils['error'](util[_0x44bb('0x1b')]('[%s][index][varset]',_0x282723['uniqueid']),_0x473603);}});ami['on']('newexten',function(_0x7be3a1){try{utils['debug'](util[_0x44bb('0x1b')](_0x44bb('0x3c'),_0x7be3a1[_0x44bb('0x1e')]),_0x7be3a1);calls[_0x44bb('0x3d')](_0x7be3a1);recordings[_0x44bb('0x3d')](_0x7be3a1);dials[_0x44bb('0x3d')](_0x7be3a1);}catch(_0xe6d15c){utils[_0x44bb('0x14')](util[_0x44bb('0x1b')](_0x44bb('0x3c'),_0x7be3a1[_0x44bb('0x1e')]),_0xe6d15c);}});ami['on']('newchannel',function(_0xb2197a){try{utils[_0x44bb('0x18')](util[_0x44bb('0x1b')](_0x44bb('0x3e'),_0xb2197a[_0x44bb('0x1e')]),_0xb2197a);calls[_0x44bb('0x3f')](_0xb2197a);recordings[_0x44bb('0x3f')](_0xb2197a);}catch(_0x518894){utils[_0x44bb('0x14')](util['format']('[%s][index][newchannel]',_0xb2197a[_0x44bb('0x1e')]),_0x518894);}});ami['on'](_0x44bb('0x40'),function(_0x1ae597){try{utils['debug'](util[_0x44bb('0x1b')](_0x44bb('0x41'),_0x1ae597[_0x44bb('0x1e')]),_0x1ae597);dials[_0x44bb('0x40')](_0x1ae597);}catch(_0x384526){utils[_0x44bb('0x14')](util[_0x44bb('0x1b')](_0x44bb('0x42'),_0x1ae597['uniqueid']),_0x384526);}});ami['on'](_0x44bb('0x43'),function(_0x3dfe81){try{utils[_0x44bb('0x18')](util['format'](_0x44bb('0x44'),_0x3dfe81[_0x44bb('0x1e')]),_0x3dfe81);dials[_0x44bb('0x43')](_0x3dfe81);}catch(_0x3266fb){utils['error'](util[_0x44bb('0x1b')]('[%s][index][dialend]',_0x3dfe81[_0x44bb('0x1e')]),_0x3266fb);}});}
\ No newline at end of file
+var _0x5389=['[%s][index][dialend]','asterisk-manager','../../config/environment','./utils','util','asterisk','port','username','keepConnected','xdr','disabled','info','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','debug','format','[%s][index][devicestatechange]','device','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','[%s][index][attendedtransfer]','attendedtransfer','origtransfereruniqueid','varset','[%s][index][varset]','newexten','newchannel','[%s][index][newchannel]','dialbegin','dialend'];(function(_0x5c4f6b,_0x2cdfce){var _0x104c4e=function(_0x31171b){while(--_0x31171b){_0x5c4f6b['push'](_0x5c4f6b['shift']());}};_0x104c4e(++_0x2cdfce);}(_0x5389,0x10d));var _0x9538=function(_0x28d9e5,_0x4ae860){_0x28d9e5=_0x28d9e5-0x0;var _0x434426=_0x5389[_0x28d9e5];return _0x434426;};var AsteriskManager=require(_0x9538('0x0'));var config=require(_0x9538('0x1'));var utils=require(_0x9538('0x2'));var util=require(_0x9538('0x3'));var ami=new AsteriskManager(config[_0x9538('0x4')][_0x9538('0x5')],config['asterisk']['ip'],config[_0x9538('0x4')][_0x9538('0x6')],config[_0x9538('0x4')]['password'],!![]);ami[_0x9538('0x7')]();if(config[_0x9538('0x8')]&&config[_0x9538('0x8')][_0x9538('0x9')]){utils[_0x9538('0xa')]('XDR\x20DISABLED');}else{var agents=require(_0x9538('0xb'));var calls=require(_0x9538('0xc'));var queues=require(_0x9538('0xd'));var recordings=require(_0x9538('0xe'));var members=require(_0x9538('0xf'));var dials=require(_0x9538('0x10'));var transfers=require(_0x9538('0x11'));var core=require(_0x9538('0x12'));ami['on'](_0x9538('0x13'),core[_0x9538('0x13')]);ami['on']('shutdown',core[_0x9538('0x14')]);ami['on'](_0x9538('0x15'),core[_0x9538('0x15')]);ami['on'](_0x9538('0x16'),core[_0x9538('0x16')]);ami['on'](_0x9538('0x17'),core[_0x9538('0x17')]);ami['on'](_0x9538('0x18'),core[_0x9538('0x18')]);ami['on'](_0x9538('0x19'),function(_0x30f64e){try{utils[_0x9538('0x1a')](util[_0x9538('0x1b')](_0x9538('0x1c'),_0x30f64e[_0x9538('0x1d')]),_0x30f64e);members[_0x9538('0x19')](_0x30f64e);}catch(_0x2ea85a){utils['error'](util['format'](_0x9538('0x1c'),_0x30f64e[_0x9538('0x1d')]),_0x2ea85a);}});ami['on']('agentcalled',function(_0x183629){try{utils[_0x9538('0x1a')](util['format'](_0x9538('0x1e'),_0x183629[_0x9538('0x1f')]),_0x183629);agents['agentcalled'](_0x183629);}catch(_0x10f134){utils[_0x9538('0x16')](util[_0x9538('0x1b')](_0x9538('0x1e'),_0x183629[_0x9538('0x1f')]),_0x10f134);}});ami['on'](_0x9538('0x20'),function(_0x56a2d3){try{utils['debug'](util[_0x9538('0x1b')](_0x9538('0x21'),_0x56a2d3[_0x9538('0x1f')]),_0x56a2d3);agents[_0x9538('0x20')](_0x56a2d3);}catch(_0x4b0aa0){utils[_0x9538('0x16')](util['format'](_0x9538('0x21'),_0x56a2d3[_0x9538('0x1f')]),_0x4b0aa0);}});ami['on'](_0x9538('0x22'),function(_0x1c1e50){try{utils['debug'](util[_0x9538('0x1b')](_0x9538('0x23'),_0x1c1e50[_0x9538('0x1f')]),_0x1c1e50);agents[_0x9538('0x22')](_0x1c1e50);queues['agentconnect'](_0x1c1e50);}catch(_0x542e07){utils['error'](util[_0x9538('0x1b')]('[%s][index][agentconnect]',_0x1c1e50[_0x9538('0x1f')]),_0x542e07);}});ami['on'](_0x9538('0x24'),function(_0x4e13a5){try{utils['debug'](util[_0x9538('0x1b')]('[%s][index][agentcomplete]',_0x4e13a5[_0x9538('0x1f')]),_0x4e13a5);agents[_0x9538('0x24')](_0x4e13a5);queues[_0x9538('0x24')](_0x4e13a5);members['agentcomplete'](_0x4e13a5);}catch(_0x424412){utils[_0x9538('0x16')](util[_0x9538('0x1b')](_0x9538('0x25'),_0x4e13a5[_0x9538('0x1f')]),_0x424412);}});ami['on'](_0x9538('0x26'),function(_0xeff950){try{utils['debug'](util[_0x9538('0x1b')](_0x9538('0x27'),_0xeff950[_0x9538('0x1f')]),_0xeff950);agents[_0x9538('0x26')](_0xeff950);queues['queuecallerabandon'](_0xeff950);}catch(_0x599548){utils[_0x9538('0x16')](util[_0x9538('0x1b')](_0x9538('0x27'),_0xeff950[_0x9538('0x1f')]),_0x599548);}});ami['on'](_0x9538('0x28'),function(_0x30fb0c){try{utils[_0x9538('0x1a')](util[_0x9538('0x1b')](_0x9538('0x29'),_0x30fb0c['uniqueid']),_0x30fb0c);queues[_0x9538('0x28')](_0x30fb0c);recordings[_0x9538('0x28')](_0x30fb0c);}catch(_0x87928d){utils['error'](util[_0x9538('0x1b')](_0x9538('0x29'),_0x30fb0c[_0x9538('0x1f')]),_0x87928d);}});ami['on'](_0x9538('0x2a'),function(_0x5743d9){try{utils[_0x9538('0x1a')](util['format'](_0x9538('0x2b'),_0x5743d9['uniqueid']),_0x5743d9);queues['queuecallerleave'](_0x5743d9);}catch(_0x4ac2ce){utils[_0x9538('0x16')](util[_0x9538('0x1b')](_0x9538('0x2b'),_0x5743d9[_0x9538('0x1f')]),_0x4ac2ce);}});ami['on'](_0x9538('0x2c'),function(_0x466ff0){try{utils[_0x9538('0x1a')](util['format'](_0x9538('0x2d'),_0x466ff0[_0x9538('0x1f')]),_0x466ff0);queues[_0x9538('0x2c')](_0x466ff0);calls[_0x9538('0x2c')](_0x466ff0);}catch(_0xe3a9c4){utils[_0x9538('0x16')](util[_0x9538('0x1b')](_0x9538('0x2d'),_0x466ff0[_0x9538('0x1f')]),_0xe3a9c4);}});ami['on'](_0x9538('0x2e'),function(_0x367255){try{utils[_0x9538('0x1a')](util['format'](_0x9538('0x2f'),_0x367255[_0x9538('0x1f')]),_0x367255);queues['musiconholdstop'](_0x367255);calls[_0x9538('0x2e')](_0x367255);}catch(_0x59c626){utils[_0x9538('0x16')](util[_0x9538('0x1b')]('[%s][index][musiconholdstop]',_0x367255['uniqueid']),_0x59c626);}});ami['on'](_0x9538('0x30'),function(_0x2510a8){try{utils['debug'](util[_0x9538('0x1b')]('[%s][index][newstate]',_0x2510a8[_0x9538('0x1f')]),_0x2510a8);calls['newstate'](_0x2510a8);recordings[_0x9538('0x30')](_0x2510a8);}catch(_0x577e13){utils['error'](util[_0x9538('0x1b')](_0x9538('0x31'),_0x2510a8['uniqueid']),_0x577e13);}});ami['on']('hangup',function(_0x31af21){try{utils[_0x9538('0x1a')](util[_0x9538('0x1b')](_0x9538('0x32'),_0x31af21[_0x9538('0x1f')]),_0x31af21);calls[_0x9538('0x33')](_0x31af21);recordings[_0x9538('0x33')](_0x31af21);dials[_0x9538('0x33')](_0x31af21);agents[_0x9538('0x33')](_0x31af21);queues[_0x9538('0x33')](_0x31af21);}catch(_0x284320){utils[_0x9538('0x16')](util[_0x9538('0x1b')]('[%s][index][hangup]',_0x31af21['uniqueid']),_0x284320);}});ami['on'](_0x9538('0x34'),function(_0x13e137){try{utils['debug'](util['format'](_0x9538('0x35'),_0x13e137[_0x9538('0x1f')]),_0x13e137);members[_0x9538('0x34')](_0x13e137);}catch(_0x5d3859){utils[_0x9538('0x16')](util['format']('[%s][index][cdr]',_0x13e137[_0x9538('0x1f')]),_0x5d3859);}});ami['on'](_0x9538('0x36'),function(_0x1132a3){try{utils[_0x9538('0x1a')](util['format']('[%s][index][blindtransfer]',_0x1132a3[_0x9538('0x1f')]),_0x1132a3);queues[_0x9538('0x36')](_0x1132a3);agents[_0x9538('0x36')](_0x1132a3);transfers[_0x9538('0x36')](_0x1132a3);}catch(_0x5502f5){utils['error'](util[_0x9538('0x1b')](_0x9538('0x37'),_0x1132a3[_0x9538('0x1f')]),_0x5502f5);}});ami['on']('attendedtransfer',function(_0x3e2b7f){try{utils[_0x9538('0x1a')](util[_0x9538('0x1b')](_0x9538('0x38'),_0x3e2b7f['origtransfereruniqueid']),_0x3e2b7f);queues['attendedtransfer'](_0x3e2b7f);transfers[_0x9538('0x39')](_0x3e2b7f);agents['attendedtransfer'](_0x3e2b7f);calls['attendedtransfer'](_0x3e2b7f);}catch(_0x10708c){utils['error'](util[_0x9538('0x1b')]('[%s][index][attendedtransfer]',_0x3e2b7f[_0x9538('0x3a')]),_0x10708c);}});ami['on'](_0x9538('0x3b'),function(_0x2805a6){try{utils[_0x9538('0x1a')](util[_0x9538('0x1b')](_0x9538('0x3c'),_0x2805a6[_0x9538('0x1f')]),_0x2805a6);queues[_0x9538('0x3b')](_0x2805a6);recordings[_0x9538('0x3b')](_0x2805a6);calls[_0x9538('0x3b')](_0x2805a6);dials[_0x9538('0x3b')](_0x2805a6);}catch(_0x509f9b){utils[_0x9538('0x16')](util['format'](_0x9538('0x3c'),_0x2805a6[_0x9538('0x1f')]),_0x509f9b);}});ami['on'](_0x9538('0x3d'),function(_0x3249b5){try{utils[_0x9538('0x1a')](util[_0x9538('0x1b')]('[%s][index][newexten]',_0x3249b5[_0x9538('0x1f')]),_0x3249b5);calls[_0x9538('0x3d')](_0x3249b5);recordings['newexten'](_0x3249b5);dials[_0x9538('0x3d')](_0x3249b5);}catch(_0x442290){utils[_0x9538('0x16')](util[_0x9538('0x1b')]('[%s][index][newexten]',_0x3249b5[_0x9538('0x1f')]),_0x442290);}});ami['on'](_0x9538('0x3e'),function(_0x5744ea){try{utils['debug'](util[_0x9538('0x1b')](_0x9538('0x3f'),_0x5744ea[_0x9538('0x1f')]),_0x5744ea);calls[_0x9538('0x3e')](_0x5744ea);recordings[_0x9538('0x3e')](_0x5744ea);}catch(_0x451d92){utils[_0x9538('0x16')](util[_0x9538('0x1b')](_0x9538('0x3f'),_0x5744ea[_0x9538('0x1f')]),_0x451d92);}});ami['on'](_0x9538('0x40'),function(_0x4115a5){try{utils[_0x9538('0x1a')](util[_0x9538('0x1b')]('[%s][index][dialbegin]',_0x4115a5['uniqueid']),_0x4115a5);dials['dialbegin'](_0x4115a5);}catch(_0xa7594f){utils[_0x9538('0x16')](util['format']('[%s]dialbegin',_0x4115a5['uniqueid']),_0xa7594f);}});ami['on'](_0x9538('0x41'),function(_0x4e3730){try{utils['debug'](util[_0x9538('0x1b')](_0x9538('0x42'),_0x4e3730[_0x9538('0x1f')]),_0x4e3730);dials['dialend'](_0x4e3730);}catch(_0x234178){utils[_0x9538('0x16')](util[_0x9538('0x1b')]('[%s][index][dialend]',_0x4e3730['uniqueid']),_0x234178);}});}
\ No newline at end of file
index 73a52a0..28b0c23 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32f8=['catch','error','some','startsWith','devicestatechange','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','agentcomplete','debug','info','queue','assign','[%s][members][agentcomplete]','cdr','channel','data1','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','./utils','Queue:','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','data2','membername','type','getUserByInterface','name','internal','CreateMemberReport','split','request'];(function(_0x395733,_0x1cf610){var _0x38ac34=function(_0x5361b6){while(--_0x5361b6){_0x395733['push'](_0x395733['shift']());}};_0x38ac34(++_0x1cf610);}(_0x32f8,0xaf));var _0x832f=function(_0x361795,_0x2ad8c1){_0x361795=_0x361795-0x0;var _0x5ad15f=_0x32f8[_0x361795];return _0x5ad15f;};'use strict';var _=require(_0x832f('0x0'));var util=require(_0x832f('0x1'));var utils=require(_0x832f('0x2'));var members={};var exclude=['Local/_attended@transfer',_0x832f('0x3')];function writeDB(_0x1b0261){utils['info'](util[_0x832f('0x4')](_0x832f('0x5'),_0x1b0261[_0x832f('0x6')],_0x1b0261[_0x832f('0x7')],_0x1b0261['channel'],_0x1b0261[_0x832f('0x8')],_0x1b0261[_0x832f('0x9')],_0x1b0261[_0x832f('0xa')]));if(_0x1b0261['interface']){utils[_0x832f('0xb')](_0x1b0261[_0x832f('0x7')])['then'](function(_0x193b5a){if(_0x193b5a){_0x1b0261[_0x832f('0x9')]=_0x193b5a[_0x832f('0xc')];_0x1b0261[_0x832f('0xd')]=_0x193b5a[_0x832f('0xd')];utils['request'](_0x832f('0xe'),_0x1b0261);}else{utils['getUserByName'](_0x1b0261[_0x832f('0x7')][_0x832f('0xf')]('/')[0x1])['then'](function(_0xde09d9){if(_0xde09d9){_0x1b0261[_0x832f('0x9')]=_0xde09d9[_0x832f('0xc')];_0x1b0261['internal']=_0xde09d9[_0x832f('0xd')];utils[_0x832f('0x10')](_0x832f('0xe'),_0x1b0261);}});}})[_0x832f('0x11')](function(_0x3956ea){utils[_0x832f('0x12')](util[_0x832f('0x4')]('[%s][members][writeDB]',_0x1b0261[_0x832f('0x6')]),_0x3956ea);});}delete members[_0x1b0261[_0x832f('0x7')]];}function startsWith(_0x1c76d0,_0x49824c){return _[_0x832f('0x13')](_0x1c76d0,function(_0x4eb3d7){return _[_0x832f('0x14')](_0x49824c,_0x4eb3d7);});}exports[_0x832f('0x15')]=function(_0x5f4977){try{utils['debug'](util[_0x832f('0x4')](_0x832f('0x16'),members[_0x5f4977[_0x832f('0x17')]]?members[_0x5f4977['device']]['uniqueid']:_0x5f4977['device']),_0x5f4977);utils['info'](util[_0x832f('0x4')](_0x832f('0x18'),members[_0x5f4977[_0x832f('0x17')]]?members[_0x5f4977[_0x832f('0x17')]][_0x832f('0x6')]:_0x5f4977[_0x832f('0x17')],_0x5f4977['state'],_0x5f4977[_0x832f('0x17')]));switch(_0x5f4977[_0x832f('0x19')]){case'INUSE':case _0x832f('0x1a'):if(!startsWith(exclude,_0x5f4977['device'])){members[_0x5f4977[_0x832f('0x17')]]={'channel':'voice','interface':_0x5f4977['device'],'type':_0x832f('0x1b'),'enterAt':utils[_0x832f('0x1c')](),'role':_0x832f('0x1d')};}break;case _0x832f('0x1e'):if(!_[_0x832f('0x1f')](members[_0x5f4977[_0x832f('0x17')]])){members[_0x5f4977[_0x832f('0x17')]][_0x832f('0x20')]=utils[_0x832f('0x1c')]();members[_0x5f4977['device']][_0x832f('0x21')]=utils['diffTime'](members[_0x5f4977[_0x832f('0x17')]][_0x832f('0x20')],members[_0x5f4977[_0x832f('0x17')]]['enterAt']);if(members[_0x5f4977[_0x832f('0x17')]][_0x832f('0x6')]){writeDB(members[_0x5f4977[_0x832f('0x17')]]);}}break;default:break;}}catch(_0x3db92c){utils[_0x832f('0x12')](util[_0x832f('0x4')](_0x832f('0x16'),members[_0x5f4977[_0x832f('0x17')]]?members[_0x5f4977[_0x832f('0x17')]][_0x832f('0x6')]:_0x5f4977['device']),_0x3db92c);}};exports[_0x832f('0x22')]=function(_0x12b81f){try{if(!_[_0x832f('0x1f')](members[_0x12b81f[_0x832f('0x7')]])){utils[_0x832f('0x23')](util['format']('[%s][members][agentcomplete]',_0x12b81f['uniqueid']),_0x12b81f);utils[_0x832f('0x24')](util[_0x832f('0x4')]('[%s][members][agentcomplete]\x20interface:%s\x20queue:%s',_0x12b81f['uniqueid'],_0x12b81f[_0x832f('0x7')],_0x12b81f[_0x832f('0x25')]));members[_0x12b81f[_0x832f('0x7')]]=_[_0x832f('0x26')](members[_0x12b81f['interface']],{'data4':_0x12b81f[_0x832f('0x25')],'uniqueid':_0x12b81f['uniqueid']});}}catch(_0x623161){utils[_0x832f('0x12')](util[_0x832f('0x4')](_0x832f('0x27'),_0x12b81f[_0x832f('0x6')]),_0x623161);}};exports[_0x832f('0x28')]=function(_0x51f560){try{utils[_0x832f('0x23')](util[_0x832f('0x4')]('[%s][members][cdr]',_0x51f560[_0x832f('0x6')]),_0x51f560);if(_0x51f560['channel']){var _0x8ea9eb=_0x51f560[_0x832f('0x29')][_0x832f('0xf')]('-')[0x0];if(!_[_0x832f('0x1f')](members[_0x8ea9eb])){members[_0x8ea9eb]=_[_0x832f('0x26')](members[_0x8ea9eb],{'data1':members[_0x8ea9eb][_0x832f('0x2a')]||_0x51f560['type'],'data2':members[_0x8ea9eb][_0x832f('0x8')]||_0x51f560[_0x832f('0x2b')],'data3':members[_0x8ea9eb][_0x832f('0x2c')]||_0x51f560[_0x832f('0x2d')],'uniqueid':members[_0x8ea9eb][_0x832f('0x6')]||_0x51f560['uniqueid']});utils[_0x832f('0x24')](util[_0x832f('0x4')](_0x832f('0x2e'),_0x51f560[_0x832f('0x6')],members[_0x8ea9eb][_0x832f('0x2a')],members[_0x8ea9eb]['data2'],members[_0x8ea9eb][_0x832f('0x2c')]));if(members[_0x8ea9eb][_0x832f('0x20')]){writeDB(members[_0x8ea9eb]);}}}if(_0x51f560[_0x832f('0x2f')]){var _0x50214b=_0x51f560[_0x832f('0x2f')][_0x832f('0xf')]('-')[0x0];if(!_['isNil'](members[_0x50214b])){members[_0x50214b]=_[_0x832f('0x26')](members[_0x50214b],{'data1':members[_0x50214b]['data1']||_0x51f560[_0x832f('0xa')],'data2':members[_0x50214b][_0x832f('0x8')]||_0x51f560[_0x832f('0x2b')],'data3':members[_0x50214b][_0x832f('0x2c')]||_0x51f560[_0x832f('0x2d')],'uniqueid':members[_0x50214b][_0x832f('0x6')]||_0x51f560[_0x832f('0x6')]});utils[_0x832f('0x24')](util[_0x832f('0x4')](_0x832f('0x2e'),_0x51f560['uniqueid'],members[_0x50214b][_0x832f('0x2a')],members[_0x50214b]['data2'],members[_0x50214b][_0x832f('0x2c')]));if(members[_0x50214b]['exitAt']){writeDB(members[_0x50214b]);}}}}catch(_0x3bb355){utils[_0x832f('0x12')](util[_0x832f('0x4')]('[%s][members][cdr]',_0x51f560[_0x832f('0x6')]),_0x3bb355);}};
\ No newline at end of file
+var _0x23c5=['agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','split','data1','data2','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','./utils','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','membername','type','getUserByInterface','then','name','internal','request','getUserByName','CreateMemberReport','catch','error','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now'];(function(_0xda5bd3,_0x1399a2){var _0x558bea=function(_0x5b15e2){while(--_0x5b15e2){_0xda5bd3['push'](_0xda5bd3['shift']());}};_0x558bea(++_0x1399a2);}(_0x23c5,0x128));var _0x523c=function(_0x2d0e60,_0x4ab98f){_0x2d0e60=_0x2d0e60-0x0;var _0x3c0aa7=_0x23c5[_0x2d0e60];return _0x3c0aa7;};'use strict';var _=require(_0x523c('0x0'));var util=require(_0x523c('0x1'));var utils=require(_0x523c('0x2'));var members={};var exclude=['Local/_attended@transfer',_0x523c('0x3')];function writeDB(_0x26febf){utils[_0x523c('0x4')](util[_0x523c('0x5')](_0x523c('0x6'),_0x26febf[_0x523c('0x7')],_0x26febf[_0x523c('0x8')],_0x26febf[_0x523c('0x9')],_0x26febf['data2'],_0x26febf[_0x523c('0xa')],_0x26febf[_0x523c('0xb')]));if(_0x26febf[_0x523c('0x8')]){utils[_0x523c('0xc')](_0x26febf[_0x523c('0x8')])[_0x523c('0xd')](function(_0x55b4eb){if(_0x55b4eb){_0x26febf['membername']=_0x55b4eb[_0x523c('0xe')];_0x26febf[_0x523c('0xf')]=_0x55b4eb[_0x523c('0xf')];utils[_0x523c('0x10')]('CreateMemberReport',_0x26febf);}else{utils[_0x523c('0x11')](_0x26febf[_0x523c('0x8')]['split']('/')[0x1])[_0x523c('0xd')](function(_0x75c1c4){if(_0x75c1c4){_0x26febf[_0x523c('0xa')]=_0x75c1c4[_0x523c('0xe')];_0x26febf[_0x523c('0xf')]=_0x75c1c4[_0x523c('0xf')];utils[_0x523c('0x10')](_0x523c('0x12'),_0x26febf);}});}})[_0x523c('0x13')](function(_0x31d57a){utils[_0x523c('0x14')](util[_0x523c('0x5')]('[%s][members][writeDB]',_0x26febf[_0x523c('0x7')]),_0x31d57a);});}delete members[_0x26febf[_0x523c('0x8')]];}function startsWith(_0x51f274,_0x5c62fc){return _[_0x523c('0x15')](_0x51f274,function(_0x5d8635){return _[_0x523c('0x16')](_0x5c62fc,_0x5d8635);});}exports[_0x523c('0x17')]=function(_0x233a08){try{utils[_0x523c('0x18')](util[_0x523c('0x5')](_0x523c('0x19'),members[_0x233a08[_0x523c('0x1a')]]?members[_0x233a08[_0x523c('0x1a')]][_0x523c('0x7')]:_0x233a08[_0x523c('0x1a')]),_0x233a08);utils[_0x523c('0x4')](util['format'](_0x523c('0x1b'),members[_0x233a08[_0x523c('0x1a')]]?members[_0x233a08[_0x523c('0x1a')]][_0x523c('0x7')]:_0x233a08[_0x523c('0x1a')],_0x233a08['state'],_0x233a08[_0x523c('0x1a')]));switch(_0x233a08[_0x523c('0x1c')]){case _0x523c('0x1d'):case _0x523c('0x1e'):if(!startsWith(exclude,_0x233a08[_0x523c('0x1a')])){members[_0x233a08[_0x523c('0x1a')]]={'channel':_0x523c('0x1f'),'interface':_0x233a08[_0x523c('0x1a')],'type':_0x523c('0x20'),'enterAt':utils[_0x523c('0x21')](),'role':_0x523c('0x22')};}break;case _0x523c('0x23'):if(!_[_0x523c('0x24')](members[_0x233a08['device']])){members[_0x233a08['device']][_0x523c('0x25')]=utils[_0x523c('0x21')]();members[_0x233a08[_0x523c('0x1a')]][_0x523c('0x26')]=utils[_0x523c('0x27')](members[_0x233a08[_0x523c('0x1a')]]['exitAt'],members[_0x233a08[_0x523c('0x1a')]][_0x523c('0x28')]);if(members[_0x233a08[_0x523c('0x1a')]]['uniqueid']){writeDB(members[_0x233a08[_0x523c('0x1a')]]);}}break;default:break;}}catch(_0x1c4e5f){utils['error'](util[_0x523c('0x5')](_0x523c('0x19'),members[_0x233a08[_0x523c('0x1a')]]?members[_0x233a08[_0x523c('0x1a')]]['uniqueid']:_0x233a08[_0x523c('0x1a')]),_0x1c4e5f);}};exports[_0x523c('0x29')]=function(_0x9f872){try{if(!_['isNil'](members[_0x9f872[_0x523c('0x8')]])){utils[_0x523c('0x18')](util[_0x523c('0x5')]('[%s][members][agentcomplete]',_0x9f872[_0x523c('0x7')]),_0x9f872);utils[_0x523c('0x4')](util[_0x523c('0x5')](_0x523c('0x2a'),_0x9f872[_0x523c('0x7')],_0x9f872[_0x523c('0x8')],_0x9f872[_0x523c('0x2b')]));members[_0x9f872[_0x523c('0x8')]]=_[_0x523c('0x2c')](members[_0x9f872[_0x523c('0x8')]],{'data4':_0x9f872['queue'],'uniqueid':_0x9f872[_0x523c('0x7')]});}}catch(_0x425596){utils[_0x523c('0x14')](util[_0x523c('0x5')]('[%s][members][agentcomplete]',_0x9f872[_0x523c('0x7')]),_0x425596);}};exports[_0x523c('0x2d')]=function(_0x18668b){try{utils[_0x523c('0x18')](util[_0x523c('0x5')](_0x523c('0x2e'),_0x18668b['uniqueid']),_0x18668b);if(_0x18668b[_0x523c('0x9')]){var _0x59fabe=_0x18668b[_0x523c('0x9')][_0x523c('0x2f')]('-')[0x0];if(!_[_0x523c('0x24')](members[_0x59fabe])){members[_0x59fabe]=_[_0x523c('0x2c')](members[_0x59fabe],{'data1':members[_0x59fabe][_0x523c('0x30')]||_0x18668b[_0x523c('0xb')],'data2':members[_0x59fabe][_0x523c('0x31')]||_0x18668b[_0x523c('0x32')],'data3':members[_0x59fabe][_0x523c('0x33')]||_0x18668b[_0x523c('0x34')],'uniqueid':members[_0x59fabe]['uniqueid']||_0x18668b[_0x523c('0x7')]});utils[_0x523c('0x4')](util[_0x523c('0x5')](_0x523c('0x35'),_0x18668b[_0x523c('0x7')],members[_0x59fabe]['data1'],members[_0x59fabe][_0x523c('0x31')],members[_0x59fabe]['data3']));if(members[_0x59fabe][_0x523c('0x25')]){writeDB(members[_0x59fabe]);}}}if(_0x18668b[_0x523c('0x36')]){var _0x5ce3fc=_0x18668b[_0x523c('0x36')]['split']('-')[0x0];if(!_[_0x523c('0x24')](members[_0x5ce3fc])){members[_0x5ce3fc]=_['assign'](members[_0x5ce3fc],{'data1':members[_0x5ce3fc]['data1']||_0x18668b[_0x523c('0xb')],'data2':members[_0x5ce3fc][_0x523c('0x31')]||_0x18668b[_0x523c('0x32')],'data3':members[_0x5ce3fc][_0x523c('0x33')]||_0x18668b[_0x523c('0x34')],'uniqueid':members[_0x5ce3fc]['uniqueid']||_0x18668b[_0x523c('0x7')]});utils[_0x523c('0x4')](util[_0x523c('0x5')](_0x523c('0x35'),_0x18668b[_0x523c('0x7')],members[_0x5ce3fc]['data1'],members[_0x5ce3fc][_0x523c('0x31')],members[_0x5ce3fc][_0x523c('0x33')]));if(members[_0x5ce3fc]['exitAt']){writeDB(members[_0x5ce3fc]);}}}}catch(_0x42c814){utils[_0x523c('0x14')](util[_0x523c('0x5')](_0x523c('0x2e'),_0x18668b[_0x523c('0x7')]),_0x42c814);}};
\ No newline at end of file
index 5a7c077..bc663e0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc6c8=['ATTENDED','transfereelinkedid','clone','transfertargetuniqueid','calleridname','queuecallerjoinAt','holdtime','mohtime','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDEDTRANSFER','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','[%s][queues][queuecallerjoin]','hangup','queuecallerleaveAt','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','[%s][queues][hangup]','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','isNil','queuecallerabandon','queuecallerabandonAt','queuecallerexitAt','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','diffTime','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten'];(function(_0x3f76ce,_0x456af1){var _0x3b43b2=function(_0x56a2d2){while(--_0x56a2d2){_0x3f76ce['push'](_0x3f76ce['shift']());}};_0x3b43b2(++_0x456af1);}(_0xc6c8,0xe2));var _0x8c6c=function(_0x1234d2,_0x188e8a){_0x1234d2=_0x1234d2-0x0;var _0x559b64=_0xc6c8[_0x1234d2];return _0x559b64;};'use strict';var _=require(_0x8c6c('0x0'));var util=require(_0x8c6c('0x1'));var utils=require(_0x8c6c('0x2'));var queues={};function writeDB(_0x3ad15a){utils[_0x8c6c('0x3')](util['format'](_0x8c6c('0x4'),_0x3ad15a[_0x8c6c('0x5')],_0x3ad15a[_0x8c6c('0x6')],_0x3ad15a[_0x8c6c('0x7')],_0x3ad15a[_0x8c6c('0x8')],_0x3ad15a[_0x8c6c('0x9')],_0x3ad15a[_0x8c6c('0xa')],_0x3ad15a[_0x8c6c('0xb')]));if(_0x3ad15a[_0x8c6c('0x7')]){utils[_0x8c6c('0xc')](_0x3ad15a[_0x8c6c('0x7')])[_0x8c6c('0xd')](function(_0x3b5235){if(_0x3b5235){_0x3ad15a['type']=_0x3b5235['type'];}utils[_0x8c6c('0xe')](_0x8c6c('0xf'),_0x3ad15a);});}else{utils[_0x8c6c('0xe')]('CreateVoiceQueueReport',_0x3ad15a);}if(_0x3ad15a[_0x8c6c('0x10')]){delete queues[_0x3ad15a[_0x8c6c('0x10')]];}else{delete queues[_0x3ad15a[_0x8c6c('0x5')]];}}exports[_0x8c6c('0x11')]=function(_0x5dbb29){try{utils[_0x8c6c('0x12')](util['format']('[%s][queues][queuecallerjoin]',_0x5dbb29[_0x8c6c('0x5')]),_0x5dbb29);utils['info'](util[_0x8c6c('0x13')](_0x8c6c('0x14'),_0x5dbb29[_0x8c6c('0x5')],_0x5dbb29[_0x8c6c('0x7')],_0x5dbb29[_0x8c6c('0x15')]));queues[_0x5dbb29[_0x8c6c('0x5')]]=_[_0x8c6c('0x16')](_0x5dbb29,{'originalposition':_0x5dbb29[_0x8c6c('0x15')],'queuecallerjoinAt':utils[_0x8c6c('0x17')](),'mohtime':0x0});}catch(_0x451ab6){utils[_0x8c6c('0x18')](util[_0x8c6c('0x13')](_0x8c6c('0x19'),_0x5dbb29[_0x8c6c('0x5')]),_0x451ab6);}};exports[_0x8c6c('0x1a')]=function(_0x5b0277){try{if(!_['isNil'](queues[_0x5b0277['uniqueid']])){utils[_0x8c6c('0x12')](util[_0x8c6c('0x13')]('[%s][queues][hangup]',_0x5b0277[_0x8c6c('0x5')]),_0x5b0277);if(queues[_0x5b0277[_0x8c6c('0x5')]][_0x8c6c('0x1b')]){if(!queues[_0x5b0277['uniqueid']]['queuecallerabandon']&&!queues[_0x5b0277[_0x8c6c('0x5')]][_0x8c6c('0x1c')]){queues[_0x5b0277['uniqueid']][_0x8c6c('0x1d')]=!![];queues[_0x5b0277[_0x8c6c('0x5')]]['queuecallercompleteAt']=utils['now']();queues[_0x5b0277[_0x8c6c('0x5')]]['queuecallerexitreason']=_0x8c6c('0x1e');}utils[_0x8c6c('0x3')](util['format'](_0x8c6c('0x1f'),_0x5b0277[_0x8c6c('0x5')],queues[_0x5b0277[_0x8c6c('0x5')]][_0x8c6c('0x20')],queues[_0x5b0277[_0x8c6c('0x5')]][_0x8c6c('0xb')]));writeDB(queues[_0x5b0277['uniqueid']]);}else if(queues[_0x5b0277['uniqueid']]['transfereduniqueid']){utils[_0x8c6c('0x3')](util[_0x8c6c('0x13')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x5b0277['uniqueid'],queues[_0x5b0277[_0x8c6c('0x5')]][_0x8c6c('0x20')],queues[_0x5b0277[_0x8c6c('0x5')]][_0x8c6c('0x10')]));queues[queues[_0x5b0277[_0x8c6c('0x5')]][_0x8c6c('0x10')]]=queues[_0x5b0277[_0x8c6c('0x5')]];queues[queues[_0x5b0277['uniqueid']][_0x8c6c('0x10')]][_0x8c6c('0x21')]=0x2;delete queues[_0x5b0277['uniqueid']];}}}catch(_0x51dbbf){utils['error'](util[_0x8c6c('0x13')](_0x8c6c('0x22'),_0x5b0277['uniqueid']),_0x51dbbf);}};exports[_0x8c6c('0x23')]=function(_0x196902){try{utils[_0x8c6c('0x12')](util['format'](_0x8c6c('0x24'),_0x196902[_0x8c6c('0x5')]),_0x196902);if(!_['isNil'](_0x196902[_0x8c6c('0x25')][_0x8c6c('0x26')])&&_0x196902[_0x8c6c('0x27')][_0x8c6c('0x28')]()!==_0x8c6c('0x29')){if(!_[_0x8c6c('0x2a')](queues[_0x196902[_0x8c6c('0x5')]])){queues[_0x196902[_0x8c6c('0x5')]][_0x8c6c('0x2b')]=![];queues[_0x196902[_0x8c6c('0x5')]][_0x8c6c('0x2c')]=null;queues[_0x196902[_0x8c6c('0x5')]]['queuecallerexit']=!![];queues[_0x196902[_0x8c6c('0x5')]][_0x8c6c('0x2d')]=utils['now']();queues[_0x196902[_0x8c6c('0x5')]][_0x8c6c('0xb')]=_0x196902[_0x8c6c('0x27')][_0x8c6c('0x28')]();utils['info'](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x196902[_0x8c6c('0x5')],queues[_0x196902['uniqueid']][_0x8c6c('0x20')],_0x196902[_0x8c6c('0x27')],queues[_0x196902[_0x8c6c('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x196902[_0x8c6c('0x5')]]);}}else if(!_[_0x8c6c('0x2a')](_0x196902[_0x8c6c('0x25')]['queueposition'])){if(!_[_0x8c6c('0x2a')](queues[_0x196902[_0x8c6c('0x5')]])&&!queues[_0x196902['uniqueid']]['queuecallerabandon']){queues[_0x196902[_0x8c6c('0x5')]][_0x8c6c('0x2b')]=![];queues[_0x196902[_0x8c6c('0x5')]]['queuecallerabandonAt']=null;queues[_0x196902[_0x8c6c('0x5')]][_0x8c6c('0x1c')]=!![];queues[_0x196902['uniqueid']][_0x8c6c('0x2d')]=utils[_0x8c6c('0x17')]();queues[_0x196902[_0x8c6c('0x5')]][_0x8c6c('0xb')]=_0x8c6c('0x2e');utils[_0x8c6c('0x3')](util['format'](_0x8c6c('0x2f'),_0x196902['uniqueid'],queues[_0x196902['uniqueid']][_0x8c6c('0x20')],_0x196902['value'],queues[_0x196902['uniqueid']][_0x8c6c('0xb')]));}}}catch(_0x1ab92e){utils[_0x8c6c('0x18')](util[_0x8c6c('0x13')](_0x8c6c('0x24'),_0x196902[_0x8c6c('0x5')]),_0x1ab92e);}};exports[_0x8c6c('0x2b')]=function(_0x486b21){try{if(!_[_0x8c6c('0x2a')](queues[_0x486b21[_0x8c6c('0x5')]])){utils[_0x8c6c('0x12')](util[_0x8c6c('0x13')]('[%s][queues][queuecallerabandon]',_0x486b21[_0x8c6c('0x5')]),_0x486b21);queues[_0x486b21[_0x8c6c('0x5')]][_0x8c6c('0x1c')]=![];queues[_0x486b21[_0x8c6c('0x5')]]['queuecallerexitAt']=null;queues[_0x486b21[_0x8c6c('0x5')]][_0x8c6c('0x2b')]=!![];queues[_0x486b21['uniqueid']][_0x8c6c('0x2c')]=utils[_0x8c6c('0x17')]();queues[_0x486b21[_0x8c6c('0x5')]][_0x8c6c('0xb')]='ABANDONED';utils[_0x8c6c('0x3')](util['format'](_0x8c6c('0x30'),_0x486b21[_0x8c6c('0x5')],queues[_0x486b21['uniqueid']][_0x8c6c('0x20')],queues[_0x486b21[_0x8c6c('0x5')]][_0x8c6c('0xb')]));}}catch(_0x200648){utils[_0x8c6c('0x18')](util[_0x8c6c('0x13')]('[%s][queues][queuecallerabandon]',_0x486b21['uniqueid']),_0x200648);}};exports[_0x8c6c('0x31')]=function(_0x26261d){try{if(!_[_0x8c6c('0x2a')](queues[_0x26261d['uniqueid']])){utils[_0x8c6c('0x12')](util[_0x8c6c('0x13')](_0x8c6c('0x32'),_0x26261d[_0x8c6c('0x5')]),_0x26261d);utils[_0x8c6c('0x3')](util['format'](_0x8c6c('0x33'),_0x26261d[_0x8c6c('0x5')],queues[_0x26261d[_0x8c6c('0x5')]][_0x8c6c('0x20')],_0x26261d[_0x8c6c('0x34')],_0x26261d['connectedlinename']));queues[_0x26261d[_0x8c6c('0x5')]][_0x8c6c('0x31')]=!![];queues[_0x26261d[_0x8c6c('0x5')]]['queuecallerleaveAt']=utils[_0x8c6c('0x17')]();queues[_0x26261d[_0x8c6c('0x5')]]['holdtime']=utils[_0x8c6c('0x35')](queues[_0x26261d[_0x8c6c('0x5')]][_0x8c6c('0x1b')],queues[_0x26261d[_0x8c6c('0x5')]]['queuecallerjoinAt']);queues[_0x26261d[_0x8c6c('0x5')]][_0x8c6c('0x15')]=_0x26261d[_0x8c6c('0x15')];queues[_0x26261d[_0x8c6c('0x5')]]['count']=_0x26261d[_0x8c6c('0x36')];queues[_0x26261d['uniqueid']]['connectedlinenum']=_0x26261d[_0x8c6c('0x34')];queues[_0x26261d['uniqueid']]['connectedlinename']=_0x26261d[_0x8c6c('0x37')];}}catch(_0x28ceea){utils[_0x8c6c('0x18')](util['format'](_0x8c6c('0x32'),_0x26261d['uniqueid']),_0x28ceea);}};exports[_0x8c6c('0x38')]=function(_0x295a37){try{if(!_['isNil'](queues[_0x295a37['uniqueid']])){utils[_0x8c6c('0x12')](util[_0x8c6c('0x13')](_0x8c6c('0x39'),_0x295a37[_0x8c6c('0x5')]),_0x295a37);utils['info'](util[_0x8c6c('0x13')](_0x8c6c('0x3a'),_0x295a37[_0x8c6c('0x5')],queues[_0x295a37[_0x8c6c('0x5')]]['name'],_0x295a37[_0x8c6c('0x3b')],_0x295a37[_0x8c6c('0x3c')]));queues[_0x295a37[_0x8c6c('0x5')]]['queuecallerabandon']=![];queues[_0x295a37['uniqueid']][_0x8c6c('0x2b')]=![];queues[_0x295a37[_0x8c6c('0x5')]][_0x8c6c('0x2c')]=null;queues[_0x295a37[_0x8c6c('0x5')]]['queuecallerexit']=![];queues[_0x295a37[_0x8c6c('0x5')]][_0x8c6c('0xb')]=null;queues[_0x295a37[_0x8c6c('0x5')]]['queuecallerexitAt']=null;queues[_0x295a37['uniqueid']][_0x8c6c('0x3d')]=!![];queues[_0x295a37[_0x8c6c('0x5')]]['accountcode']=_0x295a37['destaccountcode'];queues[_0x295a37[_0x8c6c('0x5')]][_0x8c6c('0x8')]=_0x295a37[_0x8c6c('0x3b')];}}catch(_0x2d609c){utils['error'](util['format'](_0x8c6c('0x39'),_0x295a37['uniqueid']),_0x2d609c);}};exports[_0x8c6c('0x3e')]=function(_0xa59428){try{if(!_[_0x8c6c('0x2a')](queues[_0xa59428[_0x8c6c('0x5')]])){if(queues[_0xa59428['uniqueid']][_0x8c6c('0x1b')]){utils[_0x8c6c('0x12')](util[_0x8c6c('0x13')]('[%s][queues][agentcomplete]',_0xa59428[_0x8c6c('0x5')]),_0xa59428);queues[_0xa59428[_0x8c6c('0x5')]]['queuecallerabandon']=![];queues[_0xa59428[_0x8c6c('0x5')]][_0x8c6c('0x2b')]=![];queues[_0xa59428['uniqueid']][_0x8c6c('0x2c')]=null;queues[_0xa59428[_0x8c6c('0x5')]][_0x8c6c('0x1c')]=![];queues[_0xa59428[_0x8c6c('0x5')]][_0x8c6c('0x2d')]=null;queues[_0xa59428[_0x8c6c('0x5')]][_0x8c6c('0x3d')]=!![];queues[_0xa59428['uniqueid']][_0x8c6c('0x8')]=_0xa59428[_0x8c6c('0x3b')];queues[_0xa59428[_0x8c6c('0x5')]][_0x8c6c('0x1d')]=!![];queues[_0xa59428[_0x8c6c('0x5')]][_0x8c6c('0x3f')]=utils[_0x8c6c('0x17')]();if(_0xa59428[_0x8c6c('0x40')]==_0x8c6c('0x41')){if(!queues[_0xa59428['uniqueid']][_0x8c6c('0x41')]){queues[_0xa59428[_0x8c6c('0x5')]]['queuecallerexitreason']=_0x8c6c('0x42');}}else{queues[_0xa59428[_0x8c6c('0x5')]][_0x8c6c('0xb')]=_0x8c6c('0x43')+_0xa59428['reason'][_0x8c6c('0x28')]();}utils[_0x8c6c('0x3')](util[_0x8c6c('0x13')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0xa59428[_0x8c6c('0x5')],queues[_0xa59428[_0x8c6c('0x5')]][_0x8c6c('0x20')],_0xa59428[_0x8c6c('0x3b')],queues[_0xa59428['uniqueid']][_0x8c6c('0xb')]));writeDB(queues[_0xa59428['uniqueid']]);}}}catch(_0x4baa17){utils[_0x8c6c('0x18')](util[_0x8c6c('0x13')]('[%s][queues][agentcomplete]',_0xa59428['uniqueid']),_0x4baa17);}};exports[_0x8c6c('0x44')]=function(_0x48a7f4){try{if(!_[_0x8c6c('0x2a')](queues[_0x48a7f4[_0x8c6c('0x45')]])){utils[_0x8c6c('0x12')](util[_0x8c6c('0x13')](_0x8c6c('0x46'),_0x48a7f4[_0x8c6c('0x5')]),_0x48a7f4);queues[_0x48a7f4['transfereeuniqueid']]['transfer']=!![];queues[_0x48a7f4[_0x8c6c('0x45')]][_0x8c6c('0x47')]='BLIND';queues[_0x48a7f4[_0x8c6c('0x45')]][_0x8c6c('0x48')]=_0x48a7f4[_0x8c6c('0x49')];queues[_0x48a7f4['transfereeuniqueid']][_0x8c6c('0x4a')]=_0x48a7f4[_0x8c6c('0x45')];queues[_0x48a7f4[_0x8c6c('0x45')]][_0x8c6c('0xb')]='BLINDTRANSFER';utils[_0x8c6c('0x3')](util[_0x8c6c('0x13')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x48a7f4[_0x8c6c('0x5')],queues[_0x48a7f4[_0x8c6c('0x45')]][_0x8c6c('0x20')],_0x48a7f4[_0x8c6c('0x45')],_0x48a7f4['extension']));}}catch(_0x5902cc){utils['error'](util[_0x8c6c('0x13')](_0x8c6c('0x46'),_0x48a7f4[_0x8c6c('0x5')]),_0x5902cc);}};exports[_0x8c6c('0x4b')]=function(_0x257da1){try{utils['debug'](util[_0x8c6c('0x13')]('[%s][queues][attendedtransfer]',_0x257da1[_0x8c6c('0x4c')]),_0x257da1);if(_0x257da1[_0x8c6c('0x4c')]==_0x257da1[_0x8c6c('0x4d')]){if(!_[_0x8c6c('0x2a')](queues[_0x257da1['secondtransfererlinkedid']])){utils[_0x8c6c('0x3')](util[_0x8c6c('0x13')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x257da1[_0x8c6c('0x4c')],queues[_0x257da1[_0x8c6c('0x4e')]]['name'],_0x257da1[_0x8c6c('0x4f')]));queues[_0x257da1['secondtransfererlinkedid']][_0x8c6c('0x41')]=!![];queues[_0x257da1[_0x8c6c('0x4e')]]['transfertype']=_0x8c6c('0x50');queues[_0x257da1[_0x8c6c('0x4e')]][_0x8c6c('0x48')]=_0x257da1[_0x8c6c('0x4f')];queues[_0x257da1[_0x8c6c('0x4e')]][_0x8c6c('0x4a')]=_0x257da1[_0x8c6c('0x4c')];queues[_0x257da1['secondtransfererlinkedid']][_0x8c6c('0xb')]='ATTENDEDTRANSFER';}if(!_[_0x8c6c('0x2a')](queues[_0x257da1[_0x8c6c('0x4d')]])){if(_0x257da1[_0x8c6c('0x51')]&&queues[_0x257da1[_0x8c6c('0x51')]]){queues[_0x257da1['transfereelinkedid']][_0x8c6c('0x21')]=0x1;queues[_0x257da1[_0x8c6c('0x45')]]=_[_0x8c6c('0x52')](queues[_0x257da1['transfereelinkedid']]);queues[_0x257da1[_0x8c6c('0x45')]][_0x8c6c('0x10')]=_0x257da1[_0x8c6c('0x53')];queues[_0x257da1[_0x8c6c('0x45')]][_0x8c6c('0x21')]=0x2;queues[_0x257da1[_0x8c6c('0x45')]][_0x8c6c('0x9')]=queues[_0x257da1[_0x8c6c('0x4e')]][_0x8c6c('0x9')];queues[_0x257da1[_0x8c6c('0x45')]][_0x8c6c('0x54')]=queues[_0x257da1[_0x8c6c('0x4e')]][_0x8c6c('0x54')];queues[_0x257da1[_0x8c6c('0x45')]][_0x8c6c('0x55')]=utils[_0x8c6c('0x17')]();queues[_0x257da1[_0x8c6c('0x45')]][_0x8c6c('0x1b')]=utils['now']();queues[_0x257da1[_0x8c6c('0x45')]][_0x8c6c('0x56')]=0x0;queues[_0x257da1[_0x8c6c('0x45')]][_0x8c6c('0x57')]=0x0;utils[_0x8c6c('0x3')](util[_0x8c6c('0x13')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x257da1['origtransfereruniqueid'],queues[_0x257da1[_0x8c6c('0x45')]][_0x8c6c('0x20')],queues[_0x257da1[_0x8c6c('0x45')]][_0x8c6c('0x9')],queues[_0x257da1[_0x8c6c('0x45')]][_0x8c6c('0x54')]));}else{utils[_0x8c6c('0x3')](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x257da1['origtransfereruniqueid'],queues[_0x257da1[_0x8c6c('0x4d')]][_0x8c6c('0x20')],_0x257da1[_0x8c6c('0x4e')]));queues[_0x257da1[_0x8c6c('0x4d')]]['transfereduniqueid']=_0x257da1[_0x8c6c('0x4e')];}}}else if(_0x257da1[_0x8c6c('0x58')]==_0x257da1[_0x8c6c('0x4e')]){if(!_['isNil'](queues[_0x257da1[_0x8c6c('0x4d')]])){utils[_0x8c6c('0x3')](util[_0x8c6c('0x13')](_0x8c6c('0x59'),_0x257da1[_0x8c6c('0x4c')],queues[_0x257da1['origtransfererlinkedid']][_0x8c6c('0x20')],_0x257da1[_0x8c6c('0x58')],_0x257da1['secondtransfererexten']));queues[_0x257da1[_0x8c6c('0x4d')]]['transfer']=!![];queues[_0x257da1[_0x8c6c('0x4d')]][_0x8c6c('0x47')]='ATTENDED';queues[_0x257da1[_0x8c6c('0x4d')]]['transferexten']=_0x257da1['secondtransfererexten'];queues[_0x257da1[_0x8c6c('0x4d')]][_0x8c6c('0x4a')]=_0x257da1[_0x8c6c('0x58')];queues[_0x257da1[_0x8c6c('0x4d')]][_0x8c6c('0xb')]=_0x8c6c('0x5a');}if(!_['isNil'](queues[_0x257da1['secondtransfererlinkedid']])){if(_0x257da1[_0x8c6c('0x5b')]&&queues[_0x257da1[_0x8c6c('0x5b')]]){queues[_0x257da1['transfertargetlinkedid']][_0x8c6c('0x21')]=0x1;queues[_0x257da1['transfertargetuniqueid']]=_['clone'](queues[_0x257da1[_0x8c6c('0x5b')]]);queues[_0x257da1[_0x8c6c('0x53')]][_0x8c6c('0x10')]=_0x257da1['transfertargetuniqueid'];queues[_0x257da1[_0x8c6c('0x53')]][_0x8c6c('0x21')]=0x2;queues[_0x257da1[_0x8c6c('0x53')]][_0x8c6c('0x9')]=queues[_0x257da1['origtransfererlinkedid']][_0x8c6c('0x9')];queues[_0x257da1[_0x8c6c('0x53')]]['calleridname']=queues[_0x257da1[_0x8c6c('0x4d')]][_0x8c6c('0x54')];queues[_0x257da1[_0x8c6c('0x53')]][_0x8c6c('0x55')]=utils[_0x8c6c('0x17')]();queues[_0x257da1[_0x8c6c('0x53')]][_0x8c6c('0x1b')]=utils[_0x8c6c('0x17')]();queues[_0x257da1[_0x8c6c('0x53')]]['holdtime']=0x0;queues[_0x257da1['transfertargetuniqueid']]['mohtime']=0x0;utils[_0x8c6c('0x3')](util['format'](_0x8c6c('0x5c'),_0x257da1['origtransfereruniqueid'],queues[_0x257da1[_0x8c6c('0x53')]][_0x8c6c('0x20')],queues[_0x257da1['transfertargetuniqueid']]['transfereduniqueid'],queues[_0x257da1[_0x8c6c('0x53')]]['calleridnum'],queues[_0x257da1['transfertargetuniqueid']]['calleridname']));}else{utils[_0x8c6c('0x3')](util[_0x8c6c('0x13')](_0x8c6c('0x5d'),_0x257da1[_0x8c6c('0x4c')],queues[_0x257da1[_0x8c6c('0x4e')]][_0x8c6c('0x20')],_0x257da1[_0x8c6c('0x4d')]));queues[_0x257da1[_0x8c6c('0x4e')]][_0x8c6c('0x10')]=_0x257da1[_0x8c6c('0x4d')];}}}}catch(_0x42bb41){utils['error'](util[_0x8c6c('0x13')](_0x8c6c('0x5e'),_0x257da1[_0x8c6c('0x4c')]),_0x42bb41);}};exports[_0x8c6c('0x5f')]=function(_0xaf1da9){try{if(!_[_0x8c6c('0x2a')](queues[_0xaf1da9['uniqueid']])){utils[_0x8c6c('0x12')](util['format'](_0x8c6c('0x60'),_0xaf1da9[_0x8c6c('0x5')]),_0xaf1da9);queues[_0xaf1da9[_0x8c6c('0x5')]]['musiconholdstartAt']=utils[_0x8c6c('0x17')]();utils[_0x8c6c('0x3')](util['format'](_0x8c6c('0x61'),_0xaf1da9[_0x8c6c('0x5')],queues[_0xaf1da9[_0x8c6c('0x5')]]['name'],queues[_0xaf1da9[_0x8c6c('0x5')]][_0x8c6c('0x62')]));}}catch(_0x6712c1){utils[_0x8c6c('0x18')](util[_0x8c6c('0x13')](_0x8c6c('0x60'),_0xaf1da9[_0x8c6c('0x5')]),_0x6712c1);}};exports[_0x8c6c('0x63')]=function(_0x230322){try{if(!_['isNil'](queues[_0x230322[_0x8c6c('0x5')]])){if(!_['isNil'](queues[_0x230322[_0x8c6c('0x5')]][_0x8c6c('0x62')])){utils[_0x8c6c('0x12')](util[_0x8c6c('0x13')](_0x8c6c('0x64'),_0x230322[_0x8c6c('0x5')]),_0x230322);queues[_0x230322[_0x8c6c('0x5')]][_0x8c6c('0x57')]+=utils[_0x8c6c('0x35')](utils['now'](),queues[_0x230322[_0x8c6c('0x5')]][_0x8c6c('0x62')]);utils[_0x8c6c('0x3')](util[_0x8c6c('0x13')](_0x8c6c('0x65'),_0x230322[_0x8c6c('0x5')],queues[_0x230322['uniqueid']]['name'],queues[_0x230322[_0x8c6c('0x5')]]['mohtime']));delete queues[_0x230322[_0x8c6c('0x5')]][_0x8c6c('0x62')];}}}catch(_0x4b85f3){utils[_0x8c6c('0x18')](util['format']('[%s][queues][musiconholdstop]',_0x230322[_0x8c6c('0x5')]),_0x4b85f3);}};
\ No newline at end of file
+var _0x872d=['musiconholdstartAt','musiconholdstop','[%s][queues][musiconholdstop]','mohtime','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','channel','lastAssignedTo','calleridnum','queuecallerexitreason','queue','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','queuecallerabandon','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][hangup]','varset','[%s][queues][varset]','isNil','variable','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleaveAt','holdtime','diffTime','queuecallerjoinAt','count','[%s][queues][queuecallerleave]','[%s][queues][agentconnect]','membername','destaccountcode','assigned','accountcode','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','TRANSFER','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','[%s][queues][blindtransfer]','BLIND','transferexten','extension','transferuniqueid','origtransfereruniqueid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','ATTENDED','origtransfererlinkedid','transfereelinkedid','transfertargetuniqueid','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','transfertype','ATTENDEDTRANSFER','transfertargetlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]','musiconholdstart','[%s][queues][musiconholdstart]'];(function(_0x7ae37,_0x37fc1d){var _0x1d1a9a=function(_0x4ab086){while(--_0x4ab086){_0x7ae37['push'](_0x7ae37['shift']());}};_0x1d1a9a(++_0x37fc1d);}(_0x872d,0x1f4));var _0xd872=function(_0x5d85cc,_0x2a016f){_0x5d85cc=_0x5d85cc-0x0;var _0x238311=_0x872d[_0x5d85cc];return _0x238311;};'use strict';var _=require(_0xd872('0x0'));var util=require(_0xd872('0x1'));var utils=require(_0xd872('0x2'));var queues={};function writeDB(_0x171364){utils[_0xd872('0x3')](util[_0xd872('0x4')](_0xd872('0x5'),_0x171364['uniqueid'],_0x171364[_0xd872('0x6')],_0x171364['queue'],_0x171364[_0xd872('0x7')],_0x171364[_0xd872('0x8')],_0x171364['accountcode'],_0x171364[_0xd872('0x9')]));if(_0x171364[_0xd872('0xa')]){utils[_0xd872('0xb')](_0x171364['queue'])['then'](function(_0x5811be){if(_0x5811be){_0x171364[_0xd872('0xc')]=_0x5811be[_0xd872('0xc')];}utils[_0xd872('0xd')](_0xd872('0xe'),_0x171364);});}else{utils[_0xd872('0xd')](_0xd872('0xe'),_0x171364);}if(_0x171364[_0xd872('0xf')]){delete queues[_0x171364['transfereduniqueid']];}else{delete queues[_0x171364[_0xd872('0x10')]];}}exports[_0xd872('0x11')]=function(_0x2070bc){try{utils[_0xd872('0x12')](util[_0xd872('0x4')](_0xd872('0x13'),_0x2070bc[_0xd872('0x10')]),_0x2070bc);utils[_0xd872('0x3')](util[_0xd872('0x4')](_0xd872('0x14'),_0x2070bc[_0xd872('0x10')],_0x2070bc[_0xd872('0xa')],_0x2070bc[_0xd872('0x15')]));queues[_0x2070bc['uniqueid']]=_[_0xd872('0x16')](_0x2070bc,{'originalposition':_0x2070bc[_0xd872('0x15')],'queuecallerjoinAt':utils[_0xd872('0x17')](),'mohtime':0x0});}catch(_0xecf0c5){utils[_0xd872('0x18')](util[_0xd872('0x4')]('[%s][queues][queuecallerjoin]',_0x2070bc['uniqueid']),_0xecf0c5);}};exports[_0xd872('0x19')]=function(_0xc1271d){try{if(!_['isNil'](queues[_0xc1271d[_0xd872('0x10')]])){utils[_0xd872('0x12')](util['format']('[%s][queues][hangup]',_0xc1271d['uniqueid']),_0xc1271d);if(queues[_0xc1271d[_0xd872('0x10')]]['queuecallerleaveAt']){if(!queues[_0xc1271d[_0xd872('0x10')]][_0xd872('0x1a')]&&!queues[_0xc1271d[_0xd872('0x10')]][_0xd872('0x1b')]){queues[_0xc1271d[_0xd872('0x10')]][_0xd872('0x1c')]=!![];queues[_0xc1271d[_0xd872('0x10')]]['queuecallercompleteAt']=utils['now']();queues[_0xc1271d[_0xd872('0x10')]][_0xd872('0x9')]=_0xd872('0x1d');}utils['info'](util['format'](_0xd872('0x1e'),_0xc1271d[_0xd872('0x10')],queues[_0xc1271d[_0xd872('0x10')]][_0xd872('0x1f')],queues[_0xc1271d[_0xd872('0x10')]]['queuecallerexitreason']));writeDB(queues[_0xc1271d[_0xd872('0x10')]]);}else if(queues[_0xc1271d[_0xd872('0x10')]][_0xd872('0xf')]){utils[_0xd872('0x3')](util[_0xd872('0x4')](_0xd872('0x20'),_0xc1271d[_0xd872('0x10')],queues[_0xc1271d[_0xd872('0x10')]][_0xd872('0x1f')],queues[_0xc1271d['uniqueid']][_0xd872('0xf')]));queues[queues[_0xc1271d[_0xd872('0x10')]]['transfereduniqueid']]=queues[_0xc1271d['uniqueid']];queues[queues[_0xc1271d[_0xd872('0x10')]][_0xd872('0xf')]][_0xd872('0x21')]=0x2;delete queues[_0xc1271d[_0xd872('0x10')]];}}}catch(_0x28ad2e){utils[_0xd872('0x18')](util['format'](_0xd872('0x22'),_0xc1271d[_0xd872('0x10')]),_0x28ad2e);}};exports[_0xd872('0x23')]=function(_0x17613b){try{utils[_0xd872('0x12')](util[_0xd872('0x4')](_0xd872('0x24'),_0x17613b[_0xd872('0x10')]),_0x17613b);if(!_[_0xd872('0x25')](_0x17613b[_0xd872('0x26')]['queuestatus'])&&_0x17613b[_0xd872('0x27')][_0xd872('0x28')]()!==_0xd872('0x29')){if(!_['isNil'](queues[_0x17613b[_0xd872('0x10')]])){queues[_0x17613b['uniqueid']][_0xd872('0x1a')]=![];queues[_0x17613b['uniqueid']][_0xd872('0x2a')]=null;queues[_0x17613b[_0xd872('0x10')]]['queuecallerexit']=!![];queues[_0x17613b[_0xd872('0x10')]][_0xd872('0x2b')]=utils[_0xd872('0x17')]();queues[_0x17613b['uniqueid']][_0xd872('0x9')]=_0x17613b[_0xd872('0x27')][_0xd872('0x28')]();utils[_0xd872('0x3')](util[_0xd872('0x4')](_0xd872('0x2c'),_0x17613b[_0xd872('0x10')],queues[_0x17613b[_0xd872('0x10')]]['name'],_0x17613b[_0xd872('0x27')],queues[_0x17613b[_0xd872('0x10')]][_0xd872('0x9')]));writeDB(queues[_0x17613b[_0xd872('0x10')]]);}}else if(!_[_0xd872('0x25')](_0x17613b[_0xd872('0x26')]['queueposition'])){if(!_[_0xd872('0x25')](queues[_0x17613b[_0xd872('0x10')]])&&!queues[_0x17613b[_0xd872('0x10')]][_0xd872('0x1a')]){queues[_0x17613b[_0xd872('0x10')]][_0xd872('0x1a')]=![];queues[_0x17613b['uniqueid']][_0xd872('0x2a')]=null;queues[_0x17613b[_0xd872('0x10')]]['queuecallerexit']=!![];queues[_0x17613b[_0xd872('0x10')]]['queuecallerexitAt']=utils[_0xd872('0x17')]();queues[_0x17613b['uniqueid']][_0xd872('0x9')]=_0xd872('0x2d');utils[_0xd872('0x3')](util['format'](_0xd872('0x2e'),_0x17613b[_0xd872('0x10')],queues[_0x17613b['uniqueid']]['name'],_0x17613b[_0xd872('0x27')],queues[_0x17613b[_0xd872('0x10')]][_0xd872('0x9')]));}}}catch(_0x245c12){utils[_0xd872('0x18')](util[_0xd872('0x4')](_0xd872('0x24'),_0x17613b[_0xd872('0x10')]),_0x245c12);}};exports[_0xd872('0x1a')]=function(_0x457a2d){try{if(!_['isNil'](queues[_0x457a2d[_0xd872('0x10')]])){utils[_0xd872('0x12')](util[_0xd872('0x4')](_0xd872('0x2f'),_0x457a2d[_0xd872('0x10')]),_0x457a2d);queues[_0x457a2d[_0xd872('0x10')]][_0xd872('0x1b')]=![];queues[_0x457a2d[_0xd872('0x10')]][_0xd872('0x2b')]=null;queues[_0x457a2d['uniqueid']][_0xd872('0x1a')]=!![];queues[_0x457a2d['uniqueid']][_0xd872('0x2a')]=utils['now']();queues[_0x457a2d[_0xd872('0x10')]][_0xd872('0x9')]=_0xd872('0x30');utils[_0xd872('0x3')](util[_0xd872('0x4')](_0xd872('0x31'),_0x457a2d[_0xd872('0x10')],queues[_0x457a2d[_0xd872('0x10')]]['name'],queues[_0x457a2d[_0xd872('0x10')]][_0xd872('0x9')]));}}catch(_0x3b445d){utils[_0xd872('0x18')](util[_0xd872('0x4')](_0xd872('0x2f'),_0x457a2d[_0xd872('0x10')]),_0x3b445d);}};exports['queuecallerleave']=function(_0x53313b){try{if(!_['isNil'](queues[_0x53313b[_0xd872('0x10')]])){utils[_0xd872('0x12')](util[_0xd872('0x4')]('[%s][queues][queuecallerleave]',_0x53313b[_0xd872('0x10')]),_0x53313b);utils['info'](util[_0xd872('0x4')](_0xd872('0x32'),_0x53313b[_0xd872('0x10')],queues[_0x53313b['uniqueid']][_0xd872('0x1f')],_0x53313b[_0xd872('0x33')],_0x53313b[_0xd872('0x34')]));queues[_0x53313b[_0xd872('0x10')]]['queuecallerleave']=!![];queues[_0x53313b[_0xd872('0x10')]][_0xd872('0x35')]=utils['now']();queues[_0x53313b[_0xd872('0x10')]][_0xd872('0x36')]=utils[_0xd872('0x37')](queues[_0x53313b[_0xd872('0x10')]][_0xd872('0x35')],queues[_0x53313b[_0xd872('0x10')]][_0xd872('0x38')]);queues[_0x53313b['uniqueid']][_0xd872('0x15')]=_0x53313b[_0xd872('0x15')];queues[_0x53313b[_0xd872('0x10')]][_0xd872('0x39')]=_0x53313b[_0xd872('0x39')];queues[_0x53313b['uniqueid']][_0xd872('0x33')]=_0x53313b[_0xd872('0x33')];queues[_0x53313b[_0xd872('0x10')]][_0xd872('0x34')]=_0x53313b[_0xd872('0x34')];}}catch(_0x31c8f8){utils[_0xd872('0x18')](util[_0xd872('0x4')](_0xd872('0x3a'),_0x53313b[_0xd872('0x10')]),_0x31c8f8);}};exports['agentconnect']=function(_0x3c222a){try{if(!_['isNil'](queues[_0x3c222a[_0xd872('0x10')]])){utils[_0xd872('0x12')](util['format'](_0xd872('0x3b'),_0x3c222a[_0xd872('0x10')]),_0x3c222a);utils['info'](util[_0xd872('0x4')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x3c222a[_0xd872('0x10')],queues[_0x3c222a[_0xd872('0x10')]][_0xd872('0x1f')],_0x3c222a[_0xd872('0x3c')],_0x3c222a[_0xd872('0x3d')]));queues[_0x3c222a[_0xd872('0x10')]][_0xd872('0x1a')]=![];queues[_0x3c222a['uniqueid']][_0xd872('0x1a')]=![];queues[_0x3c222a['uniqueid']][_0xd872('0x2a')]=null;queues[_0x3c222a[_0xd872('0x10')]][_0xd872('0x1b')]=![];queues[_0x3c222a[_0xd872('0x10')]]['queuecallerexitreason']=null;queues[_0x3c222a[_0xd872('0x10')]][_0xd872('0x2b')]=null;queues[_0x3c222a[_0xd872('0x10')]][_0xd872('0x3e')]=!![];queues[_0x3c222a['uniqueid']][_0xd872('0x3f')]=_0x3c222a['destaccountcode'];queues[_0x3c222a[_0xd872('0x10')]]['lastAssignedTo']=_0x3c222a[_0xd872('0x3c')];}}catch(_0x7d2745){utils[_0xd872('0x18')](util[_0xd872('0x4')]('[%s][queues][agentconnect]',_0x3c222a[_0xd872('0x10')]),_0x7d2745);}};exports['agentcomplete']=function(_0x438611){try{if(!_[_0xd872('0x25')](queues[_0x438611[_0xd872('0x10')]])){if(queues[_0x438611['uniqueid']][_0xd872('0x35')]){utils[_0xd872('0x12')](util[_0xd872('0x4')](_0xd872('0x40'),_0x438611[_0xd872('0x10')]),_0x438611);queues[_0x438611[_0xd872('0x10')]]['queuecallerabandon']=![];queues[_0x438611[_0xd872('0x10')]][_0xd872('0x1a')]=![];queues[_0x438611[_0xd872('0x10')]][_0xd872('0x2a')]=null;queues[_0x438611[_0xd872('0x10')]][_0xd872('0x1b')]=![];queues[_0x438611['uniqueid']]['queuecallerexitAt']=null;queues[_0x438611['uniqueid']][_0xd872('0x3e')]=!![];queues[_0x438611[_0xd872('0x10')]][_0xd872('0x7')]=_0x438611[_0xd872('0x3c')];queues[_0x438611[_0xd872('0x10')]][_0xd872('0x1c')]=!![];queues[_0x438611['uniqueid']][_0xd872('0x41')]=utils['now']();if(_0x438611[_0xd872('0x42')]=='transfer'){if(!queues[_0x438611['uniqueid']][_0xd872('0x43')]){queues[_0x438611[_0xd872('0x10')]]['queuecallerexitreason']=_0xd872('0x44');}}else{queues[_0x438611[_0xd872('0x10')]]['queuecallerexitreason']='COMPLETEDBY'+_0x438611[_0xd872('0x42')][_0xd872('0x28')]();}utils[_0xd872('0x3')](util[_0xd872('0x4')](_0xd872('0x45'),_0x438611[_0xd872('0x10')],queues[_0x438611[_0xd872('0x10')]]['name'],_0x438611[_0xd872('0x3c')],queues[_0x438611[_0xd872('0x10')]][_0xd872('0x9')]));writeDB(queues[_0x438611['uniqueid']]);}}}catch(_0x2a6505){utils[_0xd872('0x18')](util[_0xd872('0x4')]('[%s][queues][agentcomplete]',_0x438611[_0xd872('0x10')]),_0x2a6505);}};exports['blindtransfer']=function(_0x1d8676){try{if(!_['isNil'](queues[_0x1d8676[_0xd872('0x46')]])){utils[_0xd872('0x12')](util['format'](_0xd872('0x47'),_0x1d8676[_0xd872('0x10')]),_0x1d8676);queues[_0x1d8676['transfereeuniqueid']][_0xd872('0x43')]=!![];queues[_0x1d8676['transfereeuniqueid']]['transfertype']=_0xd872('0x48');queues[_0x1d8676[_0xd872('0x46')]][_0xd872('0x49')]=_0x1d8676[_0xd872('0x4a')];queues[_0x1d8676[_0xd872('0x46')]][_0xd872('0x4b')]=_0x1d8676[_0xd872('0x46')];queues[_0x1d8676['transfereeuniqueid']]['queuecallerexitreason']='BLINDTRANSFER';utils[_0xd872('0x3')](util[_0xd872('0x4')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x1d8676[_0xd872('0x10')],queues[_0x1d8676['transfereeuniqueid']][_0xd872('0x1f')],_0x1d8676['transfereeuniqueid'],_0x1d8676[_0xd872('0x4a')]));}}catch(_0x57d48a){utils[_0xd872('0x18')](util[_0xd872('0x4')](_0xd872('0x47'),_0x1d8676[_0xd872('0x10')]),_0x57d48a);}};exports['attendedtransfer']=function(_0x5ab3f4){try{utils['debug'](util[_0xd872('0x4')]('[%s][queues][attendedtransfer]',_0x5ab3f4[_0xd872('0x4c')]),_0x5ab3f4);if(_0x5ab3f4[_0xd872('0x4c')]==_0x5ab3f4['origtransfererlinkedid']){if(!_[_0xd872('0x25')](queues[_0x5ab3f4[_0xd872('0x4d')]])){utils['info'](util['format'](_0xd872('0x4e'),_0x5ab3f4['origtransfereruniqueid'],queues[_0x5ab3f4[_0xd872('0x4d')]]['name'],_0x5ab3f4['origtransfererexten']));queues[_0x5ab3f4[_0xd872('0x4d')]][_0xd872('0x43')]=!![];queues[_0x5ab3f4['secondtransfererlinkedid']]['transfertype']=_0xd872('0x4f');queues[_0x5ab3f4[_0xd872('0x4d')]]['transferexten']=_0x5ab3f4['origtransfererexten'];queues[_0x5ab3f4[_0xd872('0x4d')]][_0xd872('0x4b')]=_0x5ab3f4['origtransfereruniqueid'];queues[_0x5ab3f4[_0xd872('0x4d')]][_0xd872('0x9')]='ATTENDEDTRANSFER';}if(!_[_0xd872('0x25')](queues[_0x5ab3f4[_0xd872('0x50')]])){if(_0x5ab3f4[_0xd872('0x51')]&&queues[_0x5ab3f4[_0xd872('0x51')]]){queues[_0x5ab3f4['transfereelinkedid']][_0xd872('0x21')]=0x1;queues[_0x5ab3f4['transfereeuniqueid']]=_['clone'](queues[_0x5ab3f4[_0xd872('0x51')]]);queues[_0x5ab3f4[_0xd872('0x46')]]['transfereduniqueid']=_0x5ab3f4[_0xd872('0x52')];queues[_0x5ab3f4['transfereeuniqueid']][_0xd872('0x21')]=0x2;queues[_0x5ab3f4[_0xd872('0x46')]][_0xd872('0x8')]=queues[_0x5ab3f4[_0xd872('0x4d')]]['calleridnum'];queues[_0x5ab3f4[_0xd872('0x46')]][_0xd872('0x53')]=queues[_0x5ab3f4[_0xd872('0x4d')]][_0xd872('0x53')];queues[_0x5ab3f4['transfereeuniqueid']][_0xd872('0x38')]=utils[_0xd872('0x17')]();queues[_0x5ab3f4[_0xd872('0x46')]]['queuecallerleaveAt']=utils['now']();queues[_0x5ab3f4['transfereeuniqueid']]['holdtime']=0x0;queues[_0x5ab3f4['transfereeuniqueid']]['mohtime']=0x0;utils[_0xd872('0x3')](util[_0xd872('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s',_0x5ab3f4['origtransfereruniqueid'],queues[_0x5ab3f4[_0xd872('0x46')]][_0xd872('0x1f')],queues[_0x5ab3f4['transfereeuniqueid']][_0xd872('0x8')],queues[_0x5ab3f4[_0xd872('0x46')]][_0xd872('0x53')]));}else{utils[_0xd872('0x3')](util[_0xd872('0x4')](_0xd872('0x54'),_0x5ab3f4[_0xd872('0x4c')],queues[_0x5ab3f4[_0xd872('0x50')]]['name'],_0x5ab3f4['secondtransfererlinkedid']));queues[_0x5ab3f4['origtransfererlinkedid']][_0xd872('0xf')]=_0x5ab3f4['secondtransfererlinkedid'];}}}else if(_0x5ab3f4['secondtransfereruniqueid']==_0x5ab3f4[_0xd872('0x4d')]){if(!_[_0xd872('0x25')](queues[_0x5ab3f4[_0xd872('0x50')]])){utils[_0xd872('0x3')](util[_0xd872('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x5ab3f4[_0xd872('0x4c')],queues[_0x5ab3f4[_0xd872('0x50')]]['name'],_0x5ab3f4[_0xd872('0x55')],_0x5ab3f4[_0xd872('0x56')]));queues[_0x5ab3f4[_0xd872('0x50')]][_0xd872('0x43')]=!![];queues[_0x5ab3f4[_0xd872('0x50')]][_0xd872('0x57')]='ATTENDED';queues[_0x5ab3f4[_0xd872('0x50')]][_0xd872('0x49')]=_0x5ab3f4[_0xd872('0x56')];queues[_0x5ab3f4[_0xd872('0x50')]][_0xd872('0x4b')]=_0x5ab3f4[_0xd872('0x55')];queues[_0x5ab3f4[_0xd872('0x50')]][_0xd872('0x9')]=_0xd872('0x58');}if(!_[_0xd872('0x25')](queues[_0x5ab3f4[_0xd872('0x4d')]])){if(_0x5ab3f4[_0xd872('0x59')]&&queues[_0x5ab3f4[_0xd872('0x59')]]){queues[_0x5ab3f4['transfertargetlinkedid']][_0xd872('0x21')]=0x1;queues[_0x5ab3f4[_0xd872('0x52')]]=_['clone'](queues[_0x5ab3f4[_0xd872('0x59')]]);queues[_0x5ab3f4[_0xd872('0x52')]][_0xd872('0xf')]=_0x5ab3f4[_0xd872('0x52')];queues[_0x5ab3f4[_0xd872('0x52')]][_0xd872('0x21')]=0x2;queues[_0x5ab3f4[_0xd872('0x52')]][_0xd872('0x8')]=queues[_0x5ab3f4['origtransfererlinkedid']][_0xd872('0x8')];queues[_0x5ab3f4[_0xd872('0x52')]]['calleridname']=queues[_0x5ab3f4['origtransfererlinkedid']][_0xd872('0x53')];queues[_0x5ab3f4[_0xd872('0x52')]][_0xd872('0x38')]=utils[_0xd872('0x17')]();queues[_0x5ab3f4[_0xd872('0x52')]][_0xd872('0x35')]=utils[_0xd872('0x17')]();queues[_0x5ab3f4[_0xd872('0x52')]][_0xd872('0x36')]=0x0;queues[_0x5ab3f4['transfertargetuniqueid']]['mohtime']=0x0;utils['info'](util[_0xd872('0x4')](_0xd872('0x5a'),_0x5ab3f4['origtransfereruniqueid'],queues[_0x5ab3f4[_0xd872('0x52')]][_0xd872('0x1f')],queues[_0x5ab3f4['transfertargetuniqueid']][_0xd872('0xf')],queues[_0x5ab3f4['transfertargetuniqueid']][_0xd872('0x8')],queues[_0x5ab3f4[_0xd872('0x52')]]['calleridname']));}else{utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x5ab3f4[_0xd872('0x4c')],queues[_0x5ab3f4['secondtransfererlinkedid']][_0xd872('0x1f')],_0x5ab3f4[_0xd872('0x50')]));queues[_0x5ab3f4['secondtransfererlinkedid']]['transfereduniqueid']=_0x5ab3f4[_0xd872('0x50')];}}}}catch(_0x4ed73c){utils[_0xd872('0x18')](util['format'](_0xd872('0x5b'),_0x5ab3f4[_0xd872('0x4c')]),_0x4ed73c);}};exports[_0xd872('0x5c')]=function(_0xcb1ba9){try{if(!_[_0xd872('0x25')](queues[_0xcb1ba9[_0xd872('0x10')]])){utils['debug'](util['format'](_0xd872('0x5d'),_0xcb1ba9['uniqueid']),_0xcb1ba9);queues[_0xcb1ba9[_0xd872('0x10')]][_0xd872('0x5e')]=utils[_0xd872('0x17')]();utils[_0xd872('0x3')](util[_0xd872('0x4')]('[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s',_0xcb1ba9['uniqueid'],queues[_0xcb1ba9[_0xd872('0x10')]][_0xd872('0x1f')],queues[_0xcb1ba9[_0xd872('0x10')]][_0xd872('0x5e')]));}}catch(_0x263d9d){utils['error'](util[_0xd872('0x4')](_0xd872('0x5d'),_0xcb1ba9[_0xd872('0x10')]),_0x263d9d);}};exports[_0xd872('0x5f')]=function(_0x1db27b){try{if(!_[_0xd872('0x25')](queues[_0x1db27b[_0xd872('0x10')]])){if(!_[_0xd872('0x25')](queues[_0x1db27b['uniqueid']]['musiconholdstartAt'])){utils[_0xd872('0x12')](util[_0xd872('0x4')](_0xd872('0x60'),_0x1db27b[_0xd872('0x10')]),_0x1db27b);queues[_0x1db27b[_0xd872('0x10')]][_0xd872('0x61')]+=utils[_0xd872('0x37')](utils[_0xd872('0x17')](),queues[_0x1db27b[_0xd872('0x10')]][_0xd872('0x5e')]);utils[_0xd872('0x3')](util['format'](_0xd872('0x62'),_0x1db27b[_0xd872('0x10')],queues[_0x1db27b[_0xd872('0x10')]][_0xd872('0x1f')],queues[_0x1db27b[_0xd872('0x10')]][_0xd872('0x61')]));delete queues[_0x1db27b[_0xd872('0x10')]][_0xd872('0x5e')];}}}catch(_0x1df931){utils[_0xd872('0x18')](util[_0xd872('0x4')]('[%s][queues][musiconholdstop]',_0x1db27b[_0xd872('0x10')]),_0x1df931);}};
\ No newline at end of file
index 1336189..93bcce7 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xe512=['[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','error','newstate','[%s][recordings][newstate]','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','.WAV','monitors','hangup','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','type','outbound','forEach','clone','[%s][recordings][hangup]','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','util','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug'];(function(_0x3e9402,_0x130b9e){var _0x1f5996=function(_0x5ad15c){while(--_0x5ad15c){_0x3e9402['push'](_0x3e9402['shift']());}};_0x1f5996(++_0x130b9e);}(_0xe512,0x1e9));var _0x2e51=function(_0x17402f,_0x3bf6f4){_0x17402f=_0x17402f-0x0;var _0x13ab54=_0xe512[_0x17402f];return _0x13ab54;};'use strict';var _=require(_0x2e51('0x0'));var util=require(_0x2e51('0x1'));var utils=require('./utils');var recordings={};function writeDB(_0x43c2c4){utils[_0x2e51('0x2')](util[_0x2e51('0x3')](_0x2e51('0x4'),_0x43c2c4[_0x2e51('0x5')]));if(_0x43c2c4[_0x2e51('0x6')]){utils[_0x2e51('0x7')](_0x43c2c4[_0x2e51('0x6')])['then'](function(_0x33aa98){if(_0x33aa98){_0x43c2c4[_0x2e51('0x8')]=_0x33aa98[_0x2e51('0x9')];_0x43c2c4[_0x2e51('0xa')]=_0x33aa98['id'];}utils[_0x2e51('0xb')](_0x2e51('0xc'),_0x43c2c4);});}else{utils[_0x2e51('0xb')](_0x2e51('0xc'),_0x43c2c4);}}exports[_0x2e51('0xd')]=function(_0x43197c){try{utils[_0x2e51('0xe')](util[_0x2e51('0x3')](_0x2e51('0xf'),_0x43197c[_0x2e51('0x5')]),_0x43197c);if(_0x43197c['uniqueid']==_0x43197c[_0x2e51('0x10')]){utils[_0x2e51('0x2')](util[_0x2e51('0x3')](_0x2e51('0x11'),_0x43197c[_0x2e51('0x5')],_0x43197c['context'],_0x43197c[_0x2e51('0x12')]));recordings[_0x43197c[_0x2e51('0x5')]]={'uniqueid':_0x43197c[_0x2e51('0x5')],'accountcode':_0x43197c[_0x2e51('0x6')],'exten':_0x43197c['exten'],'context':_0x43197c[_0x2e51('0x13')],'channel':_0x43197c[_0x2e51('0x14')],'monitors':[]};}}catch(_0x3a6cfb){utils[_0x2e51('0x15')](util[_0x2e51('0x3')](_0x2e51('0xf'),_0x43197c[_0x2e51('0x5')]),_0x3a6cfb);}};exports[_0x2e51('0x16')]=function(_0x43fdf7){try{utils[_0x2e51('0xe')](util[_0x2e51('0x3')](_0x2e51('0x17'),_0x43fdf7[_0x2e51('0x5')]),_0x43fdf7);if(!_['isNil'](recordings[_0x43fdf7[_0x2e51('0x5')]])&&_0x43fdf7[_0x2e51('0x18')]==0x6){utils[_0x2e51('0x2')](util[_0x2e51('0x3')](_0x2e51('0x19'),_0x43fdf7[_0x2e51('0x5')],_0x43fdf7[_0x2e51('0x13')],_0x43fdf7[_0x2e51('0x14')]));}else if(!_[_0x2e51('0x1a')](recordings[_0x43fdf7[_0x2e51('0x10')]])&&_0x43fdf7[_0x2e51('0x18')]==0x6&&_0x43fdf7[_0x2e51('0x13')]!=_0x2e51('0x1b')){utils[_0x2e51('0x2')](util['format'](_0x2e51('0x1c'),_0x43fdf7[_0x2e51('0x5')],_0x43fdf7['linkedid'],_0x43fdf7['context'],_0x43fdf7[_0x2e51('0x14')]));recordings[_0x43fdf7['linkedid']][_0x2e51('0x6')]=_0x43fdf7[_0x2e51('0x6')];}}catch(_0x1831bc){utils[_0x2e51('0x15')](util[_0x2e51('0x3')](_0x2e51('0x17'),_0x43fdf7[_0x2e51('0x5')]),_0x1831bc);}};exports['varset']=function(_0x38363d){try{if(!_[_0x2e51('0x1a')](_0x38363d[_0x2e51('0x1d')])&&!_[_0x2e51('0x1a')](_0x38363d[_0x2e51('0x1d')]['mixmonitor_filename'])){utils[_0x2e51('0xe')](util[_0x2e51('0x3')](_0x2e51('0x1e'),_0x38363d[_0x2e51('0x5')]),_0x38363d);utils[_0x2e51('0x2')](util['format'](_0x2e51('0x1f'),_0x38363d[_0x2e51('0x5')],_0x38363d[_0x2e51('0x1d')],_0x38363d[_0x2e51('0x20')]));if(_[_0x2e51('0x21')](_0x38363d[_0x2e51('0x20')],'.wav49')){_0x38363d[_0x2e51('0x20')]=_0x38363d['value']['replace'](_0x2e51('0x22'),_0x2e51('0x23'));}if(recordings[_0x38363d[_0x2e51('0x10')]]){var _0x5c2b56=_['find'](recordings[_0x38363d[_0x2e51('0x10')]][_0x2e51('0x24')],{'value':_0x38363d[_0x2e51('0x20')]});if(_[_0x2e51('0x1a')](_0x5c2b56)){recordings[_0x38363d[_0x2e51('0x10')]]['monitors']['push']({'value':_0x38363d[_0x2e51('0x20')]});}}}}catch(_0x5023e6){utils[_0x2e51('0x15')](util[_0x2e51('0x3')](_0x2e51('0x1e'),_0x38363d[_0x2e51('0x5')]),_0x5023e6);}};exports[_0x2e51('0x25')]=function(_0x1529a2){try{if(!_[_0x2e51('0x1a')](recordings[_0x1529a2[_0x2e51('0x5')]])){utils[_0x2e51('0xe')](util[_0x2e51('0x3')]('[%s][recordings][hangup]',_0x1529a2[_0x2e51('0x5')]),_0x1529a2);utils[_0x2e51('0x2')](util[_0x2e51('0x3')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x1529a2[_0x2e51('0x5')],_0x1529a2['calleridnum'],_0x1529a2[_0x2e51('0x26')],_0x1529a2[_0x2e51('0x27')]));recordings[_0x1529a2[_0x2e51('0x5')]][_0x2e51('0x28')]=_0x1529a2[_0x2e51('0x28')];recordings[_0x1529a2['uniqueid']]['calleridname']=_0x1529a2[_0x2e51('0x26')];recordings[_0x1529a2[_0x2e51('0x5')]][_0x2e51('0x29')]=_0x1529a2[_0x2e51('0x29')];recordings[_0x1529a2['uniqueid']][_0x2e51('0x2a')]=_0x1529a2['connectedlinename'];if(recordings[_0x1529a2['uniqueid']][_0x2e51('0x2b')]==_0x2e51('0x2c')&&recordings[_0x1529a2[_0x2e51('0x5')]][_0x2e51('0x6')]){recordings[_0x1529a2['uniqueid']][_0x2e51('0x29')]=recordings[_0x1529a2['uniqueid']]['accountcode'];recordings[_0x1529a2[_0x2e51('0x5')]][_0x2e51('0x2a')]='';}recordings[_0x1529a2[_0x2e51('0x5')]][_0x2e51('0x24')][_0x2e51('0x2d')](function(_0x527d5e){var _0x43434d=_[_0x2e51('0x2e')](recordings[_0x1529a2['uniqueid']]);_0x43434d[_0x2e51('0x20')]=_0x527d5e[_0x2e51('0x20')];writeDB(_0x43434d);});delete recordings[_0x1529a2[_0x2e51('0x5')]];}}catch(_0x232d66){utils[_0x2e51('0x15')](util[_0x2e51('0x3')](_0x2e51('0x2f'),_0x1529a2[_0x2e51('0x5')]),_0x232d66);}};exports[_0x2e51('0x30')]=function(_0x10df2a){try{if(!_[_0x2e51('0x1a')](recordings[_0x10df2a[_0x2e51('0x5')]])){utils[_0x2e51('0xe')](util[_0x2e51('0x3')](_0x2e51('0x31'),_0x10df2a[_0x2e51('0x5')]),_0x10df2a);utils[_0x2e51('0x2')](util[_0x2e51('0x3')](_0x2e51('0x32'),_0x10df2a[_0x2e51('0x5')],_0x10df2a[_0x2e51('0x33')],_0x10df2a[_0x2e51('0x34')]));if(_0x10df2a[_0x2e51('0x33')][_0x2e51('0x35')]()=='set'&&_[_0x2e51('0x36')](_0x10df2a[_0x2e51('0x34')][_0x2e51('0x35')](),_0x2e51('0x37'))){var _0x1c2135=_0x10df2a['appdata'][_0x2e51('0x38')]('=');var _0x4d4aa9=_0x1c2135[0x0][_0x2e51('0x39')](_0x1c2135[0x0][_0x2e51('0x3a')]('(')+0x1,_0x1c2135[0x0][_0x2e51('0x3a')](')'));var _0x541d13=_0x1c2135[0x1];recordings[_0x10df2a[_0x2e51('0x5')]][_0x4d4aa9]=_0x541d13;}}}catch(_0x2f5e18){utils[_0x2e51('0x15')](util[_0x2e51('0x3')](_0x2e51('0x31'),_0x10df2a['uniqueid']),_0x2f5e18);}};exports[_0x2e51('0x3b')]=function(_0x107fbe){try{if(!_['isNil'](recordings[_0x107fbe[_0x2e51('0x5')]])){utils[_0x2e51('0xe')](util[_0x2e51('0x3')](_0x2e51('0x3c'),_0x107fbe[_0x2e51('0x5')]),_0x107fbe);utils[_0x2e51('0x2')](util[_0x2e51('0x3')](_0x2e51('0x3d'),_0x107fbe[_0x2e51('0x5')],_0x107fbe[_0x2e51('0x3e')]));recordings[_0x107fbe[_0x2e51('0x5')]][_0x2e51('0x3e')]=_0x107fbe[_0x2e51('0x3e')];}}catch(_0x5bd13c){utils[_0x2e51('0x15')](util[_0x2e51('0x3')]('[%s][recordings][queuecallerjoin]',_0x107fbe['uniqueid']),_0x5bd13c);}};
\ No newline at end of file
+var _0x1164=['context','exten','channel','newstate','[%s][recordings][newstate]','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','error','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','replace','.WAV','monitors','push','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','set','startsWith','cdr','substring','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','info','format','[%s][recordings][writeDB]','uniqueid','accountcode','getUserByInternal','UserId','request','CreateVoiceRecording','debug','[%s][recordings][newchannel]','linkedid'];(function(_0x18ccd6,_0x1098e8){var _0x587d2c=function(_0x460ad6){while(--_0x460ad6){_0x18ccd6['push'](_0x18ccd6['shift']());}};_0x587d2c(++_0x1098e8);}(_0x1164,0x1b3));var _0x4116=function(_0x119f23,_0x36ca9b){_0x119f23=_0x119f23-0x0;var _0x5a94c0=_0x1164[_0x119f23];return _0x5a94c0;};'use strict';var _=require(_0x4116('0x0'));var util=require('util');var utils=require('./utils');var recordings={};function writeDB(_0x54171a){utils[_0x4116('0x1')](util[_0x4116('0x2')](_0x4116('0x3'),_0x54171a[_0x4116('0x4')]));if(_0x54171a[_0x4116('0x5')]){utils[_0x4116('0x6')](_0x54171a[_0x4116('0x5')])['then'](function(_0x4a31cb){if(_0x4a31cb){_0x54171a['membername']=_0x4a31cb['name'];_0x54171a[_0x4116('0x7')]=_0x4a31cb['id'];}utils[_0x4116('0x8')]('CreateVoiceRecording',_0x54171a);});}else{utils[_0x4116('0x8')](_0x4116('0x9'),_0x54171a);}}exports['newchannel']=function(_0x2214ad){try{utils[_0x4116('0xa')](util[_0x4116('0x2')](_0x4116('0xb'),_0x2214ad['uniqueid']),_0x2214ad);if(_0x2214ad[_0x4116('0x4')]==_0x2214ad[_0x4116('0xc')]){utils[_0x4116('0x1')](util[_0x4116('0x2')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x2214ad[_0x4116('0x4')],_0x2214ad[_0x4116('0xd')],_0x2214ad[_0x4116('0xe')]));recordings[_0x2214ad[_0x4116('0x4')]]={'uniqueid':_0x2214ad[_0x4116('0x4')],'accountcode':_0x2214ad[_0x4116('0x5')],'exten':_0x2214ad[_0x4116('0xe')],'context':_0x2214ad[_0x4116('0xd')],'channel':_0x2214ad[_0x4116('0xf')],'monitors':[]};}}catch(_0x4a54cb){utils['error'](util[_0x4116('0x2')]('[%s][recordings][newchannel]',_0x2214ad[_0x4116('0x4')]),_0x4a54cb);}};exports[_0x4116('0x10')]=function(_0x46904e){try{utils[_0x4116('0xa')](util['format'](_0x4116('0x11'),_0x46904e[_0x4116('0x4')]),_0x46904e);if(!_['isNil'](recordings[_0x46904e[_0x4116('0x4')]])&&_0x46904e['channelstate']==0x6){utils[_0x4116('0x1')](util[_0x4116('0x2')](_0x4116('0x12'),_0x46904e[_0x4116('0x4')],_0x46904e[_0x4116('0xd')],_0x46904e[_0x4116('0xf')]));}else if(!_[_0x4116('0x13')](recordings[_0x46904e[_0x4116('0xc')]])&&_0x46904e['channelstate']==0x6&&_0x46904e[_0x4116('0xd')]!='transfer'){utils[_0x4116('0x1')](util[_0x4116('0x2')](_0x4116('0x14'),_0x46904e[_0x4116('0x4')],_0x46904e[_0x4116('0xc')],_0x46904e[_0x4116('0xd')],_0x46904e[_0x4116('0xf')]));recordings[_0x46904e[_0x4116('0xc')]][_0x4116('0x5')]=_0x46904e[_0x4116('0x5')];}}catch(_0x15b0bc){utils[_0x4116('0x15')](util[_0x4116('0x2')](_0x4116('0x11'),_0x46904e[_0x4116('0x4')]),_0x15b0bc);}};exports[_0x4116('0x16')]=function(_0x5ff02c){try{if(!_[_0x4116('0x13')](_0x5ff02c[_0x4116('0x17')])&&!_[_0x4116('0x13')](_0x5ff02c[_0x4116('0x17')][_0x4116('0x18')])){utils[_0x4116('0xa')](util[_0x4116('0x2')](_0x4116('0x19'),_0x5ff02c[_0x4116('0x4')]),_0x5ff02c);utils['info'](util[_0x4116('0x2')](_0x4116('0x1a'),_0x5ff02c['uniqueid'],_0x5ff02c[_0x4116('0x17')],_0x5ff02c[_0x4116('0x1b')]));if(_['endsWith'](_0x5ff02c[_0x4116('0x1b')],'.wav49')){_0x5ff02c[_0x4116('0x1b')]=_0x5ff02c[_0x4116('0x1b')][_0x4116('0x1c')]('.wav49',_0x4116('0x1d'));}if(recordings[_0x5ff02c[_0x4116('0xc')]]){var _0x5d77b5=_['find'](recordings[_0x5ff02c[_0x4116('0xc')]][_0x4116('0x1e')],{'value':_0x5ff02c[_0x4116('0x1b')]});if(_['isNil'](_0x5d77b5)){recordings[_0x5ff02c[_0x4116('0xc')]][_0x4116('0x1e')][_0x4116('0x1f')]({'value':_0x5ff02c[_0x4116('0x1b')]});}}}}catch(_0x262816){utils['error'](util[_0x4116('0x2')](_0x4116('0x19'),_0x5ff02c[_0x4116('0x4')]),_0x262816);}};exports['hangup']=function(_0x1d66f5){try{if(!_[_0x4116('0x13')](recordings[_0x1d66f5[_0x4116('0x4')]])){utils['debug'](util[_0x4116('0x2')](_0x4116('0x20'),_0x1d66f5[_0x4116('0x4')]),_0x1d66f5);utils['info'](util[_0x4116('0x2')](_0x4116('0x21'),_0x1d66f5[_0x4116('0x4')],_0x1d66f5[_0x4116('0x22')],_0x1d66f5[_0x4116('0x23')],_0x1d66f5[_0x4116('0x24')]));recordings[_0x1d66f5[_0x4116('0x4')]][_0x4116('0x22')]=_0x1d66f5[_0x4116('0x22')];recordings[_0x1d66f5[_0x4116('0x4')]][_0x4116('0x23')]=_0x1d66f5[_0x4116('0x23')];recordings[_0x1d66f5[_0x4116('0x4')]]['connectedlinenum']=_0x1d66f5[_0x4116('0x25')];recordings[_0x1d66f5[_0x4116('0x4')]][_0x4116('0x26')]=_0x1d66f5[_0x4116('0x26')];if(recordings[_0x1d66f5[_0x4116('0x4')]][_0x4116('0x27')]=='outbound'&&recordings[_0x1d66f5[_0x4116('0x4')]]['accountcode']){recordings[_0x1d66f5[_0x4116('0x4')]][_0x4116('0x25')]=recordings[_0x1d66f5[_0x4116('0x4')]]['accountcode'];recordings[_0x1d66f5[_0x4116('0x4')]][_0x4116('0x26')]='';}recordings[_0x1d66f5[_0x4116('0x4')]][_0x4116('0x1e')]['forEach'](function(_0x565a7d){var _0x14d50f=_[_0x4116('0x28')](recordings[_0x1d66f5[_0x4116('0x4')]]);_0x14d50f['value']=_0x565a7d[_0x4116('0x1b')];writeDB(_0x14d50f);});delete recordings[_0x1d66f5[_0x4116('0x4')]];}}catch(_0x3e97df){utils[_0x4116('0x15')](util[_0x4116('0x2')](_0x4116('0x20'),_0x1d66f5[_0x4116('0x4')]),_0x3e97df);}};exports[_0x4116('0x29')]=function(_0x40f552){try{if(!_[_0x4116('0x13')](recordings[_0x40f552[_0x4116('0x4')]])){utils[_0x4116('0xa')](util[_0x4116('0x2')](_0x4116('0x2a'),_0x40f552[_0x4116('0x4')]),_0x40f552);utils[_0x4116('0x1')](util[_0x4116('0x2')](_0x4116('0x2b'),_0x40f552[_0x4116('0x4')],_0x40f552[_0x4116('0x2c')],_0x40f552[_0x4116('0x2d')]));if(_0x40f552['application'][_0x4116('0x2e')]()==_0x4116('0x2f')&&_[_0x4116('0x30')](_0x40f552['appdata']['toLowerCase'](),_0x4116('0x31'))){var _0x43d7a8=_0x40f552[_0x4116('0x2d')]['split']('=');var _0xa94e47=_0x43d7a8[0x0][_0x4116('0x32')](_0x43d7a8[0x0][_0x4116('0x33')]('(')+0x1,_0x43d7a8[0x0][_0x4116('0x33')](')'));var _0x3784cc=_0x43d7a8[0x1];recordings[_0x40f552[_0x4116('0x4')]][_0xa94e47]=_0x3784cc;}}}catch(_0x254c58){utils[_0x4116('0x15')](util[_0x4116('0x2')]('[%s][recordings][newexten]',_0x40f552['uniqueid']),_0x254c58);}};exports[_0x4116('0x34')]=function(_0x5f41b3){try{if(!_[_0x4116('0x13')](recordings[_0x5f41b3['uniqueid']])){utils[_0x4116('0xa')](util['format'](_0x4116('0x35'),_0x5f41b3[_0x4116('0x4')]),_0x5f41b3);utils[_0x4116('0x1')](util[_0x4116('0x2')](_0x4116('0x36'),_0x5f41b3[_0x4116('0x4')],_0x5f41b3[_0x4116('0x37')]));recordings[_0x5f41b3['uniqueid']]['queue']=_0x5f41b3[_0x4116('0x37')];}}catch(_0x21eb13){utils[_0x4116('0x15')](util[_0x4116('0x2')]('[%s][recordings][queuecallerjoin]',_0x5f41b3[_0x4116('0x4')]),_0x21eb13);}};
\ No newline at end of file
index 5398b99..05747bb 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x1b79=['request','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','uniqueid','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','type','blind','transfereruniqueid','error','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetcontext','transfertargetexten','lodash','util','info','format','origtransfereruniqueid'];(function(_0x4350c2,_0x112f3c){var _0x8b6406=function(_0x49e845){while(--_0x49e845){_0x4350c2['push'](_0x4350c2['shift']());}};_0x8b6406(++_0x112f3c);}(_0x1b79,0x1d4));var _0x91b7=function(_0x4afcf2,_0x2c820){_0x4afcf2=_0x4afcf2-0x0;var _0x3b106b=_0x1b79[_0x4afcf2];return _0x3b106b;};'use strict';var _=require(_0x91b7('0x0'));var util=require(_0x91b7('0x1'));var utils=require('./utils');function writeDB(_0x33697b){utils[_0x91b7('0x2')](util[_0x91b7('0x3')]('[%s][transfers][writeDB]\x20type:%s',_0x33697b['type']==='attended'?_0x33697b[_0x91b7('0x4')]:_0x33697b['uniqueid'],_0x33697b['type']));utils[_0x91b7('0x5')](_0x91b7('0x6'),_0x33697b);}exports[_0x91b7('0x7')]={};exports[_0x91b7('0x8')]=function(_0x4b1a90){try{utils[_0x91b7('0x9')](util[_0x91b7('0x3')](_0x91b7('0xa'),_0x4b1a90['uniqueid']),_0x4b1a90);utils[_0x91b7('0x2')](util[_0x91b7('0x3')](_0x91b7('0xb'),_0x4b1a90[_0x91b7('0xc')],_0x4b1a90[_0x91b7('0xd')],_0x4b1a90[_0x91b7('0xe')],_0x4b1a90[_0x91b7('0xf')],_0x4b1a90[_0x91b7('0x10')]));_0x4b1a90[_0x91b7('0x11')]=_0x91b7('0x12');exports['blinds'][_0x4b1a90[_0x91b7('0x13')]]=_0x4b1a90;writeDB(_0x4b1a90);}catch(_0xb6103b){utils[_0x91b7('0x14')](util[_0x91b7('0x3')](_0x91b7('0xa'),_0x4b1a90[_0x91b7('0xc')]),_0xb6103b);}};exports[_0x91b7('0x15')]=function(_0x1acf23){try{utils[_0x91b7('0x9')](util['format'](_0x91b7('0x16'),_0x1acf23[_0x91b7('0x4')]),_0x1acf23);utils[_0x91b7('0x2')](util[_0x91b7('0x3')](_0x91b7('0x17'),_0x1acf23[_0x91b7('0x4')],_0x1acf23[_0x91b7('0x18')],_0x1acf23[_0x91b7('0x19')],_0x1acf23[_0x91b7('0x1a')],_0x1acf23[_0x91b7('0x1b')]));_0x1acf23=_[_0x91b7('0x1c')](_0x1acf23,{'transfererchannel':_0x1acf23['origtransfererchannel'],'transferercalleridnum':_0x1acf23[_0x91b7('0x18')],'transferercalleridname':_0x1acf23[_0x91b7('0x19')],'transfererconnectedlinenum':_0x1acf23[_0x91b7('0x1d')],'transfererconnectedlinename':_0x1acf23[_0x91b7('0x1e')],'transfereraccountcode':_0x1acf23[_0x91b7('0x1f')],'transferercontext':_0x1acf23[_0x91b7('0x20')],'transfererexten':_0x1acf23[_0x91b7('0x21')],'transfererlinkedid':_0x1acf23[_0x91b7('0x22')],'context':_0x1acf23[_0x91b7('0x23')],'extension':_0x1acf23[_0x91b7('0x24')],'type':'attended'});if(_[_0x91b7('0x25')](_0x1acf23[_0x91b7('0x26')])){_0x1acf23=_[_0x91b7('0x1c')](_0x1acf23,{'transfereechannel':_0x1acf23[_0x91b7('0x27')],'transfereecalleridnum':_0x1acf23[_0x91b7('0x1a')],'transfereecalleridname':_0x1acf23[_0x91b7('0x1b')],'transfereeconnectedlinenum':_0x1acf23[_0x91b7('0x28')],'transfereeconnectedlinename':_0x1acf23['transfertargetconnectedlinename'],'transfereeaccountcode':_0x1acf23['transfertargetaccountcode'],'transfereecontext':_0x1acf23[_0x91b7('0x29')],'transfereeexten':_0x1acf23[_0x91b7('0x2a')],'transfereelinkedid':_0x1acf23['transfertargetlinkedid']});}writeDB(_0x1acf23);}catch(_0x564115){utils[_0x91b7('0x14')](util[_0x91b7('0x3')](_0x91b7('0x16'),_0x1acf23[_0x91b7('0x4')]),_0x564115);}};
\ No newline at end of file
+var _0x3d26=['origtransfererchannel','origtransferercalleridname','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','isNil','transfereechannel','assign','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','[%s][transfers][attendedtransfer]','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','uniqueid','request','blinds','blindtransfer','transfereecalleridname','blind','transfereruniqueid','error','[%s][transfers][blindtransfer]','attendedtransfer','debug','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transfertargetcalleridnum'];(function(_0x1b0ad7,_0x161cda){var _0x473015=function(_0x3469df){while(--_0x3469df){_0x1b0ad7['push'](_0x1b0ad7['shift']());}};_0x473015(++_0x161cda);}(_0x3d26,0xd0));var _0x63d2=function(_0x4480b9,_0x5c2949){_0x4480b9=_0x4480b9-0x0;var _0x3f0f02=_0x3d26[_0x4480b9];return _0x3f0f02;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x63d2('0x0'));function writeDB(_0x38ff8a){utils[_0x63d2('0x1')](util[_0x63d2('0x2')](_0x63d2('0x3'),_0x38ff8a[_0x63d2('0x4')]===_0x63d2('0x5')?_0x38ff8a[_0x63d2('0x6')]:_0x38ff8a[_0x63d2('0x7')],_0x38ff8a[_0x63d2('0x4')]));utils[_0x63d2('0x8')]('CreateVoiceTransferReport',_0x38ff8a);}exports[_0x63d2('0x9')]={};exports[_0x63d2('0xa')]=function(_0x1e19cc){try{utils['debug'](util[_0x63d2('0x2')]('[%s][transfers][blindtransfer]',_0x1e19cc[_0x63d2('0x7')]),_0x1e19cc);utils['info'](util[_0x63d2('0x2')]('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x1e19cc['uniqueid'],_0x1e19cc['transferercalleridnum'],_0x1e19cc['transferercalleridname'],_0x1e19cc['transfereecalleridnum'],_0x1e19cc[_0x63d2('0xb')]));_0x1e19cc[_0x63d2('0x4')]=_0x63d2('0xc');exports[_0x63d2('0x9')][_0x1e19cc[_0x63d2('0xd')]]=_0x1e19cc;writeDB(_0x1e19cc);}catch(_0x84ca9c){utils[_0x63d2('0xe')](util[_0x63d2('0x2')](_0x63d2('0xf'),_0x1e19cc[_0x63d2('0x7')]),_0x84ca9c);}};exports[_0x63d2('0x10')]=function(_0x26d5a3){try{utils[_0x63d2('0x11')](util[_0x63d2('0x2')]('[%s][transfers][attendedtransfer]',_0x26d5a3[_0x63d2('0x6')]),_0x26d5a3);utils[_0x63d2('0x1')](util[_0x63d2('0x2')](_0x63d2('0x12'),_0x26d5a3[_0x63d2('0x6')],_0x26d5a3['origtransferercalleridnum'],_0x26d5a3['origtransferercalleridname'],_0x26d5a3[_0x63d2('0x13')],_0x26d5a3['transfertargetcalleridname']));_0x26d5a3=_['assign'](_0x26d5a3,{'transfererchannel':_0x26d5a3[_0x63d2('0x14')],'transferercalleridnum':_0x26d5a3['origtransferercalleridnum'],'transferercalleridname':_0x26d5a3[_0x63d2('0x15')],'transfererconnectedlinenum':_0x26d5a3['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x26d5a3['secondtransfererconnectedlinename'],'transfereraccountcode':_0x26d5a3[_0x63d2('0x16')],'transferercontext':_0x26d5a3[_0x63d2('0x17')],'transfererexten':_0x26d5a3[_0x63d2('0x18')],'transfererlinkedid':_0x26d5a3[_0x63d2('0x19')],'context':_0x26d5a3['origtransferercontext'],'extension':_0x26d5a3['origtransfererexten'],'type':_0x63d2('0x5')});if(_[_0x63d2('0x1a')](_0x26d5a3[_0x63d2('0x1b')])){_0x26d5a3=_[_0x63d2('0x1c')](_0x26d5a3,{'transfereechannel':_0x26d5a3[_0x63d2('0x1d')],'transfereecalleridnum':_0x26d5a3[_0x63d2('0x13')],'transfereecalleridname':_0x26d5a3[_0x63d2('0x1e')],'transfereeconnectedlinenum':_0x26d5a3[_0x63d2('0x1f')],'transfereeconnectedlinename':_0x26d5a3[_0x63d2('0x20')],'transfereeaccountcode':_0x26d5a3[_0x63d2('0x21')],'transfereecontext':_0x26d5a3[_0x63d2('0x22')],'transfereeexten':_0x26d5a3[_0x63d2('0x23')],'transfereelinkedid':_0x26d5a3[_0x63d2('0x24')]});}writeDB(_0x26d5a3);}catch(_0x4de1b6){utils['error'](util[_0x63d2('0x2')](_0x63d2('0x25'),_0x26d5a3['origtransfereruniqueid']),_0x4de1b6);}};
\ No newline at end of file
index 26d3baa..08ce1b0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9c8a=['acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add','subtractTime','subtract','seconds','format','diffTime','diff','sumTime','YYYY-MM-DD\x20HH:mm:ss','isAfter','isBefore','jayson/promise','moment','util','client','http','../../config/logger','info','debug','inspect','error','request','catch','GetUser','interface','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','then','[utils][getUserByName]','name','type','acw'];(function(_0x4d63ca,_0x43c8fa){var _0x1bbacc=function(_0x47a44a){while(--_0x47a44a){_0x4d63ca['push'](_0x4d63ca['shift']());}};_0x1bbacc(++_0x43c8fa);}(_0x9c8a,0x191));var _0xa9c8=function(_0x18f11d,_0x1e1dc5){_0x18f11d=_0x18f11d-0x0;var _0x1ec8f3=_0x9c8a[_0x18f11d];return _0x1ec8f3;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xa9c8('0x0'));var moment=require(_0xa9c8('0x1'));var util=require(_0xa9c8('0x2'));var client=jayson[_0xa9c8('0x3')][_0xa9c8('0x4')]({'port':0x2329});var logger=require(_0xa9c8('0x5'))('xdr');exports[_0xa9c8('0x6')]=function(_0x4fa96d,_0x2efe79){logger['info'](_0x4fa96d,_0x2efe79?util['inspect'](_0x2efe79,{'showHidden':![],'depth':null}):'');};exports[_0xa9c8('0x7')]=function(_0x301e63,_0x5bec8a){logger['debug'](_0x301e63,_0x5bec8a?util[_0xa9c8('0x8')](_0x5bec8a,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x54832f,_0x5a91df){logger[_0xa9c8('0x9')](_0x54832f,_0x5a91df?util[_0xa9c8('0x8')](_0x5a91df,{'showHidden':![],'depth':null}):'');};exports[_0xa9c8('0xa')]=function(_0x42f3d7,_0x1d2e29){return client[_0xa9c8('0xa')](_0x42f3d7,{'body':_0x1d2e29})['then'](function(_0x297e03){logger[_0xa9c8('0x7')]('[utils][request]\x20name:%s',_0x42f3d7,_0x297e03?util['inspect'](_0x297e03,{'showHidden':![],'depth':null}):'');})[_0xa9c8('0xb')](function(_0x5d25fb){logger[_0xa9c8('0x9')]('[utils][request]\x20name:%s',_0x42f3d7,_0x5d25fb?util['inspect'](_0x5d25fb,{'showHidden':![],'depth':null}):'');});};function getUser(_0x25a667){return client['request'](_0xa9c8('0xc'),{'options':{'raw':!![],'attributes':['id','internal','name',_0xa9c8('0xd')],'where':_0x25a667,'limit':0x1}})['then'](function(_0x55dcae){logger[_0xa9c8('0x7')](_0xa9c8('0xe'),JSON[_0xa9c8('0xf')](_0x25a667),_0x55dcae?util[_0xa9c8('0x8')](_0x55dcae,{'showHidden':![],'depth':null}):'');return _0x55dcae[_0xa9c8('0x10')]['length']?_0x55dcae['result'][0x0]:null;});}exports[_0xa9c8('0x11')]=function(_0x4bd0b7){return new BPromise(function(_0x4b2845,_0x822b2){if(_0x4bd0b7){return getUser({'internal':_0x4bd0b7})['then'](function(_0x25a2c1){logger[_0xa9c8('0x6')](_0xa9c8('0x12'),_0x4bd0b7,_0x25a2c1?_0xa9c8('0x13'):_0xa9c8('0x14'));return _0x4b2845(_0x25a2c1);})[_0xa9c8('0xb')](function(_0x1da1e0){logger[_0xa9c8('0x9')](_0xa9c8('0x15'),_0x1da1e0?util[_0xa9c8('0x8')](_0x1da1e0,{'showHidden':![],'depth':null}):'');return _0x4b2845(null);});}return _0x4b2845(null);});};exports['getUserByInterface']=function(_0x220733){return new BPromise(function(_0x183892,_0x491e72){if(_0x220733){return getUser({'interface':_0x220733})['then'](function(_0x246a54){logger['info'](_0xa9c8('0x16'),_0x220733,_0x246a54?_0xa9c8('0x13'):'notfound');return _0x183892(_0x246a54);})[_0xa9c8('0xb')](function(_0x3ff31d){logger[_0xa9c8('0x9')](_0xa9c8('0x17'),_0x3ff31d?util[_0xa9c8('0x8')](_0x3ff31d,{'showHidden':![],'depth':null}):'');return _0x183892(null);});}return _0x183892(null);});};exports['getUserByName']=function(_0x2f0376){return new BPromise(function(_0x5be2fc,_0x58740e){if(_0x2f0376){return getUser({'name':_0x2f0376})[_0xa9c8('0x18')](function(_0xb3393f){logger['info']('[utils][getUserByName]\x20name:%s\x20%s',_0x2f0376,_0xb3393f?_0xa9c8('0x13'):_0xa9c8('0x14'));return _0x5be2fc(_0xb3393f);})['catch'](function(_0x57bb48){logger['error'](_0xa9c8('0x19'),_0x57bb48?util['inspect'](_0x57bb48,{'showHidden':![],'depth':null}):'');return _0x5be2fc(null);});}return _0x5be2fc(null);});};exports['getVoiceQueueByName']=function(_0x257083){return new BPromise(function(_0x10ea59,_0x29c695){if(_0x257083){return client['request']('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0xa9c8('0x1a'),_0xa9c8('0x1b'),_0xa9c8('0x1c'),_0xa9c8('0x1d')],'where':{'name':_0x257083},'limit':0x1}})[_0xa9c8('0x18')](function(_0x3ddeaa){logger['debug']('[utils][getVoiceQueueByName]\x20name:%s',_0x257083,_0x3ddeaa?util['inspect'](_0x3ddeaa,{'showHidden':![],'depth':null}):'');logger[_0xa9c8('0x6')](_0xa9c8('0x1e'),_0x257083,_0x3ddeaa?_0xa9c8('0x13'):_0xa9c8('0x14'));return _0x10ea59(_0x3ddeaa[_0xa9c8('0x10')]['length']?_0x3ddeaa[_0xa9c8('0x10')][0x0]:null);})[_0xa9c8('0xb')](function(_0x345649){logger[_0xa9c8('0x9')]('[utils][getVoiceQueueByName]',_0x345649?util['inspect'](_0x345649,{'showHidden':![],'depth':null}):'');return _0x10ea59(null);});}return _0x10ea59(null);});};exports[_0xa9c8('0x1f')]=function(_0x329765,_0x3c30a9){return moment(_0x329765)[_0xa9c8('0x20')](_0x3c30a9,'seconds')['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xa9c8('0x21')]=function(_0x4f81eb,_0xf4b2d){return moment(_0x4f81eb)[_0xa9c8('0x22')](_0xf4b2d,_0xa9c8('0x23'))[_0xa9c8('0x24')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xa9c8('0x25')]=function(_0x4c1761,_0x5a781f){return moment(_0x4c1761)[_0xa9c8('0x26')](moment(_0x5a781f),_0xa9c8('0x23'));};exports[_0xa9c8('0x27')]=function(_0x236ee4,_0x5c8ab9){return parseInt(_0x236ee4,0xa)+parseInt(_0x5c8ab9,0xa);};exports['now']=function(){return moment()['format'](_0xa9c8('0x28'));};exports[_0xa9c8('0x29')]=function(_0x1ca276,_0x58fc67){if(_0x58fc67){return moment(_0x1ca276)[_0xa9c8('0x29')](_0x58fc67);}return!![];};exports['isBefore']=function(_0x225071,_0x3d756d){if(_0x3d756d){return moment(_0x225071)[_0xa9c8('0x2a')](_0x3d756d);}else if(_0x225071){return!![];}return![];};
\ No newline at end of file
+var _0xb344=['YYYY-MM-DD\x20HH:mm:ss','subtract','seconds','diffTime','diff','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','client','http','../../config/logger','info','inspect','debug','error','[utils][request]\x20name:%s','catch','request','GetUser','name','interface','result','length','getUserByInternal','then','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]','addTime','format'];(function(_0x40da98,_0x22393e){var _0x183a3f=function(_0x5b12f9){while(--_0x5b12f9){_0x40da98['push'](_0x40da98['shift']());}};_0x183a3f(++_0x22393e);}(_0xb344,0x152));var _0x4b34=function(_0x34bc5e,_0x538eb4){_0x34bc5e=_0x34bc5e-0x0;var _0x3e6969=_0xb344[_0x34bc5e];return _0x3e6969;};'use strict';var BPromise=require(_0x4b34('0x0'));var jayson=require(_0x4b34('0x1'));var moment=require(_0x4b34('0x2'));var util=require(_0x4b34('0x3'));var client=jayson[_0x4b34('0x4')][_0x4b34('0x5')]({'port':0x2329});var logger=require(_0x4b34('0x6'))('xdr');exports[_0x4b34('0x7')]=function(_0x423b07,_0x9f7bf3){logger['info'](_0x423b07,_0x9f7bf3?util[_0x4b34('0x8')](_0x9f7bf3,{'showHidden':![],'depth':null}):'');};exports[_0x4b34('0x9')]=function(_0x575e23,_0x2410de){logger['debug'](_0x575e23,_0x2410de?util[_0x4b34('0x8')](_0x2410de,{'showHidden':![],'depth':null}):'');};exports[_0x4b34('0xa')]=function(_0x5c0c48,_0x20ea42){logger['error'](_0x5c0c48,_0x20ea42?util['inspect'](_0x20ea42,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x55e478,_0x334df8){return client['request'](_0x55e478,{'body':_0x334df8})['then'](function(_0x5b8f38){logger[_0x4b34('0x9')](_0x4b34('0xb'),_0x55e478,_0x5b8f38?util[_0x4b34('0x8')](_0x5b8f38,{'showHidden':![],'depth':null}):'');})[_0x4b34('0xc')](function(_0x24212a){logger[_0x4b34('0xa')](_0x4b34('0xb'),_0x55e478,_0x24212a?util[_0x4b34('0x8')](_0x24212a,{'showHidden':![],'depth':null}):'');});};function getUser(_0x179efe){return client[_0x4b34('0xd')](_0x4b34('0xe'),{'options':{'raw':!![],'attributes':['id','internal',_0x4b34('0xf'),_0x4b34('0x10')],'where':_0x179efe,'limit':0x1}})['then'](function(_0x10ac9c){logger[_0x4b34('0x9')]('[utils][getUser]\x20where:%s',JSON['stringify'](_0x179efe),_0x10ac9c?util[_0x4b34('0x8')](_0x10ac9c,{'showHidden':![],'depth':null}):'');return _0x10ac9c[_0x4b34('0x11')][_0x4b34('0x12')]?_0x10ac9c[_0x4b34('0x11')][0x0]:null;});}exports[_0x4b34('0x13')]=function(_0x47fb36){return new BPromise(function(_0x558485,_0x5d055d){if(_0x47fb36){return getUser({'internal':_0x47fb36})[_0x4b34('0x14')](function(_0xcec619){logger['info'](_0x4b34('0x15'),_0x47fb36,_0xcec619?_0x4b34('0x16'):_0x4b34('0x17'));return _0x558485(_0xcec619);})[_0x4b34('0xc')](function(_0x5fdbfc){logger[_0x4b34('0xa')](_0x4b34('0x18'),_0x5fdbfc?util['inspect'](_0x5fdbfc,{'showHidden':![],'depth':null}):'');return _0x558485(null);});}return _0x558485(null);});};exports['getUserByInterface']=function(_0x4cb93f){return new BPromise(function(_0x19a8d7,_0x57d5b8){if(_0x4cb93f){return getUser({'interface':_0x4cb93f})[_0x4b34('0x14')](function(_0x18931f){logger['info'](_0x4b34('0x19'),_0x4cb93f,_0x18931f?_0x4b34('0x16'):_0x4b34('0x17'));return _0x19a8d7(_0x18931f);})[_0x4b34('0xc')](function(_0x1d88b4){logger[_0x4b34('0xa')](_0x4b34('0x1a'),_0x1d88b4?util['inspect'](_0x1d88b4,{'showHidden':![],'depth':null}):'');return _0x19a8d7(null);});}return _0x19a8d7(null);});};exports[_0x4b34('0x1b')]=function(_0x239a6a){return new BPromise(function(_0x45256b,_0x22cdf1){if(_0x239a6a){return getUser({'name':_0x239a6a})[_0x4b34('0x14')](function(_0x48a3dc){logger[_0x4b34('0x7')](_0x4b34('0x1c'),_0x239a6a,_0x48a3dc?_0x4b34('0x16'):_0x4b34('0x17'));return _0x45256b(_0x48a3dc);})[_0x4b34('0xc')](function(_0xc49f85){logger[_0x4b34('0xa')](_0x4b34('0x1d'),_0xc49f85?util[_0x4b34('0x8')](_0xc49f85,{'showHidden':![],'depth':null}):'');return _0x45256b(null);});}return _0x45256b(null);});};exports[_0x4b34('0x1e')]=function(_0x1a02aa){return new BPromise(function(_0x462e0a,_0x719483){if(_0x1a02aa){return client[_0x4b34('0xd')]('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0x4b34('0xf'),_0x4b34('0x1f'),_0x4b34('0x20'),_0x4b34('0x21')],'where':{'name':_0x1a02aa},'limit':0x1}})[_0x4b34('0x14')](function(_0x155010){logger[_0x4b34('0x9')](_0x4b34('0x22'),_0x1a02aa,_0x155010?util[_0x4b34('0x8')](_0x155010,{'showHidden':![],'depth':null}):'');logger[_0x4b34('0x7')]('[utils][getVoiceQueueByName]\x20name:%s\x20%s',_0x1a02aa,_0x155010?_0x4b34('0x16'):_0x4b34('0x17'));return _0x462e0a(_0x155010['result'][_0x4b34('0x12')]?_0x155010[_0x4b34('0x11')][0x0]:null);})[_0x4b34('0xc')](function(_0x54b562){logger['error'](_0x4b34('0x23'),_0x54b562?util[_0x4b34('0x8')](_0x54b562,{'showHidden':![],'depth':null}):'');return _0x462e0a(null);});}return _0x462e0a(null);});};exports[_0x4b34('0x24')]=function(_0x1a4488,_0x9aea6){return moment(_0x1a4488)['add'](_0x9aea6,'seconds')[_0x4b34('0x25')](_0x4b34('0x26'));};exports['subtractTime']=function(_0x31d57e,_0xd41a80){return moment(_0x31d57e)[_0x4b34('0x27')](_0xd41a80,_0x4b34('0x28'))['format'](_0x4b34('0x26'));};exports[_0x4b34('0x29')]=function(_0x4e50cf,_0x27ec77){return moment(_0x4e50cf)[_0x4b34('0x2a')](moment(_0x27ec77),_0x4b34('0x28'));};exports[_0x4b34('0x2b')]=function(_0x400a91,_0x3a05a6){return parseInt(_0x400a91,0xa)+parseInt(_0x3a05a6,0xa);};exports[_0x4b34('0x2c')]=function(){return moment()[_0x4b34('0x25')](_0x4b34('0x26'));};exports[_0x4b34('0x2d')]=function(_0x41ed39,_0x37c1d8){if(_0x37c1d8){return moment(_0x41ed39)[_0x4b34('0x2d')](_0x37c1d8);}return!![];};exports[_0x4b34('0x2e')]=function(_0x1e8a84,_0x39af72){if(_0x39af72){return moment(_0x1e8a84)[_0x4b34('0x2e')](_0x39af72);}else if(_0x1e8a84){return!![];}return![];};
\ No newline at end of file